Built motion from commit 1742a442.|2.5.37
authorAndrea Amorese <andrea.amorese@xenialab.it>
Thu, 28 Oct 2021 07:32:50 +0000 (09:32 +0200)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Thu, 28 Oct 2021 07:32:50 +0000 (09:32 +0200)
1152 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoicePrefix/teamVoicePrefix.attributes.js
server/api/teamVoicePrefix/teamVoicePrefix.model.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoicePrefix/userVoicePrefix.attributes.js
server/api/userVoicePrefix/userVoicePrefix.model.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/index.js
server/config/schedule/transcribe.js
server/config/schedule/whatsapp.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/index.js
server/mysqldb/index.js
server/routes.js
server/rpc/index.js
server/safe-template.js
server/services/agi/channel.js
server/services/agi/error.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/action.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/setting.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/rpc/setting.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/dialogflowV2.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js

index 2700636..ec26cdd 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-10-27T15:34:06.033Z",
+    "time": "2021-10-28T07:15:41.227Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index b03a9b3..6da3c19 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-10-27T15:34:06.033Z",
+    "time": "2021-10-28T07:15:41.227Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index eab498a..964af3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8873=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x4a4d71,_0x1d4d72){var _0x2f1f18=function(_0x50796d){while(--_0x50796d){_0x4a4d71['push'](_0x4a4d71['shift']());}};_0x2f1f18(++_0x1d4d72);}(_0x8873,0x9f));var _0x3887=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0x8873[_0x2d3d0d];return _0xca35b6;};'use strict';var Sequelize=require(_0x3887('0x0'));module[_0x3887('0x1')]={'name':{'type':Sequelize[_0x3887('0x2')],'get':function(_0x378d88){return this[_0x3887('0x3')](_0x3887('0x4'));}},'action':{'type':Sequelize[_0x3887('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3887('0x6'),'integration',_0x3887('0x7'),_0x3887('0x8'),_0x3887('0x9'),_0x3887('0xa'),_0x3887('0xb'),_0x3887('0xc')]],'msg':_0x3887('0xd')}},'comment':_0x3887('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0x10')},'data4':{'type':Sequelize[_0x3887('0x5')](0x1000),'comments':_0x3887('0x11')},'data5':{'type':Sequelize[_0x3887('0x5')](0x1000),'comments':_0x3887('0x12')},'data6':{'type':Sequelize[_0x3887('0x5')],'comments':_0x3887('0x13')},'data7':{'type':Sequelize[_0x3887('0x14')],'comments':_0x3887('0x15')}};
\ No newline at end of file
+var _0x9559=['STRING','contactManager','integration','motionbar','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x2d4521,_0x8d98b6){var _0x5d765f=function(_0x21795d){while(--_0x21795d){_0x2d4521['push'](_0x2d4521['shift']());}};_0x5d765f(++_0x8d98b6);}(_0x9559,0x14f));var _0x9955=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x9559[_0x5f08a6];return _0x5d0641;};'use strict';var Sequelize=require(_0x9955('0x0'));module[_0x9955('0x1')]={'name':{'type':Sequelize[_0x9955('0x2')],'get':function(_0x55f339){return this[_0x9955('0x3')](_0x9955('0x4'));}},'action':{'type':Sequelize[_0x9955('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9955('0x6'),_0x9955('0x7'),_0x9955('0x8'),'jscripty','urlForward',_0x9955('0x9'),_0x9955('0xa'),'script']],'msg':_0x9955('0xb')}},'comment':_0x9955('0xb')},'data1':{'type':Sequelize[_0x9955('0x5')](0x1000),'comment':_0x9955('0xc')},'data2':{'type':Sequelize[_0x9955('0x5')](0x1000),'comment':_0x9955('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x9955('0xe')},'data5':{'type':Sequelize[_0x9955('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x9955('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0x9955('0x10')}};
\ No newline at end of file
index 67327d8..56ab696 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01b9=['json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range'];(function(_0x52d7d2,_0x3c2a17){var _0x46b0f3=function(_0x157ef6){while(--_0x157ef6){_0x52d7d2['push'](_0x52d7d2['shift']());}};_0x46b0f3(++_0x3c2a17);}(_0x01b9,0x136));var _0x901b=function(_0xe02258,_0x13d2dc){_0xe02258=_0xe02258-0x0;var _0xce1ce3=_0x01b9[_0xe02258];return _0xce1ce3;};'use strict';var emlformat=require(_0x901b('0x0'));var rimraf=require(_0x901b('0x1'));var zipdir=require(_0x901b('0x2'));var jsonpatch=require(_0x901b('0x3'));var rp=require(_0x901b('0x4'));var moment=require(_0x901b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x901b('0x6'));var util=require(_0x901b('0x7'));var path=require(_0x901b('0x8'));var sox=require(_0x901b('0x9'));var csv=require(_0x901b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901b('0xb'));var _=require(_0x901b('0xc'));var squel=require(_0x901b('0xd'));var crypto=require(_0x901b('0xe'));var jsforce=require(_0x901b('0xf'));var deskjs=require(_0x901b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x901b('0x11'));var Redis=require('ioredis');var authService=require(_0x901b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x901b('0x13'));var hardwareService=require(_0x901b('0x14'));var logger=require(_0x901b('0x15'))(_0x901b('0x16'));var utils=require(_0x901b('0x17'));var config=require(_0x901b('0x18'));var licenseUtil=require(_0x901b('0x19'));var db=require(_0x901b('0x1a'))['db'];function respondWithStatusCode(_0x5e434d,_0x4b22e7){_0x4b22e7=_0x4b22e7||0xcc;return function(_0x305f75){if(_0x305f75){return _0x5e434d['sendStatus'](_0x4b22e7);}return _0x5e434d[_0x901b('0x1b')](_0x4b22e7)['end']();};}function respondWithResult(_0x3a4efc,_0x4de7ef){_0x4de7ef=_0x4de7ef||0xc8;return function(_0x1d473f){if(_0x1d473f){return _0x3a4efc[_0x901b('0x1b')](_0x4de7ef)['json'](_0x1d473f);}};}function respondWithFilteredResult(_0x450082,_0x1db4cf){return function(_0x4eb6f0){if(_0x4eb6f0){var _0x542452=typeof _0x1db4cf[_0x901b('0x1c')]===_0x901b('0x1d')&&typeof _0x1db4cf[_0x901b('0x1e')]===_0x901b('0x1d');var _0x3e04b6=_0x4eb6f0[_0x901b('0x1f')];var _0x31b1cc=_0x542452?0x0:_0x1db4cf['offset'];var _0x196cc7=_0x542452?_0x4eb6f0[_0x901b('0x1f')]:_0x1db4cf['offset']+_0x1db4cf['limit'];var _0xb461ed;if(_0x196cc7>=_0x3e04b6){_0x196cc7=_0x3e04b6;_0xb461ed=0xc8;}else{_0xb461ed=0xce;}_0x450082[_0x901b('0x1b')](_0xb461ed);return _0x450082['set'](_0x901b('0x20'),_0x31b1cc+'-'+_0x196cc7+'/'+_0x3e04b6)[_0x901b('0x21')](_0x4eb6f0);}return null;};}function patchUpdates(_0x2d571e){return function(_0x4d7ee6){try{jsonpatch['apply'](_0x4d7ee6,_0x2d571e,!![]);}catch(_0x35d6a6){return BPromise[_0x901b('0x22')](_0x35d6a6);}return _0x4d7ee6[_0x901b('0x23')]();};}function saveUpdates(_0x37eedd,_0x3edaa6){return function(_0x24bc47){if(_0x24bc47){return _0x24bc47[_0x901b('0x24')](_0x37eedd)['then'](function(_0x1f2932){return _0x1f2932;});}return null;};}function removeEntity(_0x3fdde0,_0x381593){return function(_0x299859){if(_0x299859){return _0x299859[_0x901b('0x25')]()[_0x901b('0x26')](function(){_0x3fdde0[_0x901b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x289afa,_0x59cfb7){return function(_0x4624dc){if(!_0x4624dc){_0x289afa[_0x901b('0x27')](0x194);}return _0x4624dc;};}function handleError(_0x7ec692,_0x3b0067){_0x3b0067=_0x3b0067||0x1f4;return function(_0x310188){logger[_0x901b('0x28')](_0x310188[_0x901b('0x29')]);if(_0x310188[_0x901b('0x2a')]){delete _0x310188['name'];}_0x7ec692[_0x901b('0x1b')](_0x3b0067)[_0x901b('0x2b')](_0x310188);};}exports[_0x901b('0x24')]=function(_0x1b0096,_0x518258){if(_0x1b0096['body']['id']){delete _0x1b0096[_0x901b('0x2c')]['id'];}return db[_0x901b('0x2d')][_0x901b('0x2e')]({'where':{'id':_0x1b0096['params']['id']}})[_0x901b('0x26')](handleEntityNotFound(_0x518258,null))['then'](saveUpdates(_0x1b0096[_0x901b('0x2c')],null))['then'](respondWithResult(_0x518258,null))[_0x901b('0x2f')](handleError(_0x518258,null));};exports[_0x901b('0x25')]=function(_0x2b90d2,_0x1a21cb){return db[_0x901b('0x2d')][_0x901b('0x2e')]({'where':{'id':_0x2b90d2[_0x901b('0x30')]['id']}})[_0x901b('0x26')](handleEntityNotFound(_0x1a21cb,null))[_0x901b('0x26')](removeEntity(_0x1a21cb,null))[_0x901b('0x2f')](handleError(_0x1a21cb,null));};
\ No newline at end of file
+var _0xe417=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','name','send','update','body','find','catch','Action','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe417,0x151));var _0x7e41=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0xe417[_0x28e74e];return _0xb45ac1;};'use strict';var emlformat=require(_0x7e41('0x0'));var rimraf=require(_0x7e41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e41('0x2'));var rp=require(_0x7e41('0x3'));var moment=require('moment');var BPromise=require(_0x7e41('0x4'));var Mustache=require(_0x7e41('0x5'));var util=require('util');var path=require(_0x7e41('0x6'));var sox=require(_0x7e41('0x7'));var csv=require('to-csv');var ejs=require(_0x7e41('0x8'));var fs=require('fs');var fs_extra=require(_0x7e41('0x9'));var _=require(_0x7e41('0xa'));var squel=require(_0x7e41('0xb'));var crypto=require(_0x7e41('0xc'));var jsforce=require(_0x7e41('0xd'));var deskjs=require(_0x7e41('0xe'));var toCsv=require(_0x7e41('0xf'));var querystring=require(_0x7e41('0x10'));var Papa=require(_0x7e41('0x11'));var Redis=require(_0x7e41('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7e41('0x13'));var as=require(_0x7e41('0x14'));var hardwareService=require(_0x7e41('0x15'));var logger=require(_0x7e41('0x16'))(_0x7e41('0x17'));var utils=require(_0x7e41('0x18'));var config=require(_0x7e41('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e41('0x1a'))['db'];function respondWithStatusCode(_0x3de07d,_0x55caec){_0x55caec=_0x55caec||0xcc;return function(_0x27c088){if(_0x27c088){return _0x3de07d[_0x7e41('0x1b')](_0x55caec);}return _0x3de07d['status'](_0x55caec)[_0x7e41('0x1c')]();};}function respondWithResult(_0x2be9a1,_0x1299a0){_0x1299a0=_0x1299a0||0xc8;return function(_0x5be73e){if(_0x5be73e){return _0x2be9a1['status'](_0x1299a0)[_0x7e41('0x1d')](_0x5be73e);}};}function respondWithFilteredResult(_0x1bfb35,_0xb962f7){return function(_0x4e802e){if(_0x4e802e){var _0x1424ad=typeof _0xb962f7[_0x7e41('0x1e')]===_0x7e41('0x1f')&&typeof _0xb962f7[_0x7e41('0x20')]===_0x7e41('0x1f');var _0x494d6f=_0x4e802e[_0x7e41('0x21')];var _0x3ece82=_0x1424ad?0x0:_0xb962f7[_0x7e41('0x1e')];var _0x253b8e=_0x1424ad?_0x4e802e['count']:_0xb962f7['offset']+_0xb962f7[_0x7e41('0x20')];var _0x42a43d;if(_0x253b8e>=_0x494d6f){_0x253b8e=_0x494d6f;_0x42a43d=0xc8;}else{_0x42a43d=0xce;}_0x1bfb35[_0x7e41('0x22')](_0x42a43d);return _0x1bfb35[_0x7e41('0x23')](_0x7e41('0x24'),_0x3ece82+'-'+_0x253b8e+'/'+_0x494d6f)[_0x7e41('0x1d')](_0x4e802e);}return null;};}function patchUpdates(_0x204886){return function(_0x358770){try{jsonpatch[_0x7e41('0x25')](_0x358770,_0x204886,!![]);}catch(_0x367016){return BPromise[_0x7e41('0x26')](_0x367016);}return _0x358770[_0x7e41('0x27')]();};}function saveUpdates(_0x162d7f,_0x46ba0a){return function(_0x203dda){if(_0x203dda){return _0x203dda['update'](_0x162d7f)[_0x7e41('0x28')](function(_0x2c4818){return _0x2c4818;});}return null;};}function removeEntity(_0x3f6c5c,_0x2b0e51){return function(_0x5d196e){if(_0x5d196e){return _0x5d196e[_0x7e41('0x29')]()[_0x7e41('0x28')](function(){_0x3f6c5c['status'](0xcc)[_0x7e41('0x1c')]();});}};}function handleEntityNotFound(_0x1dcffe,_0x3c5aa0){return function(_0x4aee72){if(!_0x4aee72){_0x1dcffe[_0x7e41('0x1b')](0x194);}return _0x4aee72;};}function handleError(_0x99de5f,_0x224368){_0x224368=_0x224368||0x1f4;return function(_0x456342){logger['error'](_0x456342['stack']);if(_0x456342[_0x7e41('0x2a')]){delete _0x456342[_0x7e41('0x2a')];}_0x99de5f['status'](_0x224368)[_0x7e41('0x2b')](_0x456342);};}exports[_0x7e41('0x2c')]=function(_0xb16f41,_0x2f8f66){if(_0xb16f41[_0x7e41('0x2d')]['id']){delete _0xb16f41[_0x7e41('0x2d')]['id'];}return db['Action'][_0x7e41('0x2e')]({'where':{'id':_0xb16f41['params']['id']}})['then'](handleEntityNotFound(_0x2f8f66,null))[_0x7e41('0x28')](saveUpdates(_0xb16f41[_0x7e41('0x2d')],null))[_0x7e41('0x28')](respondWithResult(_0x2f8f66,null))[_0x7e41('0x2f')](handleError(_0x2f8f66,null));};exports[_0x7e41('0x29')]=function(_0x5b900c,_0x14589b){return db[_0x7e41('0x30')][_0x7e41('0x2e')]({'where':{'id':_0x5b900c[_0x7e41('0x31')]['id']}})[_0x7e41('0x28')](handleEntityNotFound(_0x14589b,null))[_0x7e41('0x28')](removeEntity(_0x14589b,null))[_0x7e41('0x2f')](handleError(_0x14589b,null));};
\ No newline at end of file
index 2397fd3..f578532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb626=['Action','tools_actions','util','../../config/logger','moment','rimraf','./action.attributes'];(function(_0x356cff,_0x531a96){var _0x264796=function(_0xf22449){while(--_0xf22449){_0x356cff['push'](_0x356cff['shift']());}};_0x264796(++_0x531a96);}(_0xb626,0xbf));var _0x6b62=function(_0x16632f,_0x44d3df){_0x16632f=_0x16632f-0x0;var _0xd83545=_0xb626[_0x16632f];return _0xd83545;};'use strict';var _=require('lodash');var util=require(_0x6b62('0x0'));var logger=require(_0x6b62('0x1'))('api');var moment=require(_0x6b62('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b62('0x3'));var config=require('../../config/environment');var attributes=require(_0x6b62('0x4'));module['exports']=function(_0x49624a,_0x26f818){return _0x49624a['define'](_0x6b62('0x5'),attributes,{'tableName':_0x6b62('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cdd=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger','moment'];(function(_0x30b73c,_0x584f7c){var _0x182ad1=function(_0x5333ee){while(--_0x5333ee){_0x30b73c['push'](_0x30b73c['shift']());}};_0x182ad1(++_0x584f7c);}(_0x6cdd,0x8d));var _0xd6cd=function(_0x7d8967,_0x42a213){_0x7d8967=_0x7d8967-0x0;var _0x314cf5=_0x6cdd[_0x7d8967];return _0x314cf5;};'use strict';var _=require('lodash');var util=require(_0xd6cd('0x0'));var logger=require(_0xd6cd('0x1'))('api');var moment=require(_0xd6cd('0x2'));var BPromise=require(_0xd6cd('0x3'));var rp=require(_0xd6cd('0x4'));var fs=require('fs');var path=require(_0xd6cd('0x5'));var rimraf=require(_0xd6cd('0x6'));var config=require(_0xd6cd('0x7'));var attributes=require('./action.attributes');module[_0xd6cd('0x8')]=function(_0x11120c,_0xa23db2){return _0x11120c[_0xd6cd('0x9')](_0xd6cd('0xa'),attributes,{'tableName':_0xd6cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf09b4a..398a558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2f3395,_0x2846f5){_0x2f3395=_0x2f3395-0x0;var _0x59a706=_0x1cb9[_0x2f3395];return _0x59a706;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x6cbbcf,_0x1349bc){var _0x1df7a2=function(_0x1e0913){while(--_0x1e0913){_0x6cbbcf['push'](_0x6cbbcf['shift']());}};_0x1df7a2(++_0x1349bc);}(_0xabce,0x103));var _0xeabc=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xabce[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
index b7c1479..745e312 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf55a=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x4a7b46,_0x5e916c){var _0x436bee=function(_0x1c98ba){while(--_0x1c98ba){_0x4a7b46['push'](_0x4a7b46['shift']());}};_0x436bee(++_0x5e916c);}(_0xf55a,0x95));var _0xaf55=function(_0x23adc4,_0x45a8fc){_0x23adc4=_0x23adc4-0x0;var _0x5e8137=_0xf55a[_0x23adc4];return _0x5e8137;};'use strict';var multer=require(_0xaf55('0x0'));var util=require('util');var path=require(_0xaf55('0x1'));var timeout=require(_0xaf55('0x2'));var express=require('express');var router=express[_0xaf55('0x3')]();var fs_extra=require(_0xaf55('0x4'));var auth=require(_0xaf55('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf55('0x6'));var controller=require(_0xaf55('0x7'));router[_0xaf55('0x8')](_0xaf55('0x9'),auth[_0xaf55('0xa')](),controller[_0xaf55('0xb')]);router[_0xaf55('0xc')](_0xaf55('0x9'),auth[_0xaf55('0xa')](),controller[_0xaf55('0xd')]);module[_0xaf55('0xe')]=router;
\ No newline at end of file
+var _0x711a=['isAuthenticated','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./action.controller','put'];(function(_0x533e75,_0x5b84d7){var _0x3e05af=function(_0x388972){while(--_0x388972){_0x533e75['push'](_0x533e75['shift']());}};_0x3e05af(++_0x5b84d7);}(_0x711a,0xe6));var _0xa711=function(_0x1b33f8,_0x42d767){_0x1b33f8=_0x1b33f8-0x0;var _0x166ec2=_0x711a[_0x1b33f8];return _0x166ec2;};'use strict';var multer=require(_0xa711('0x0'));var util=require(_0xa711('0x1'));var path=require('path');var timeout=require(_0xa711('0x2'));var express=require(_0xa711('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa711('0x4'));var interaction=require(_0xa711('0x5'));var config=require('../../config/environment');var controller=require(_0xa711('0x6'));router[_0xa711('0x7')]('/:id',auth[_0xa711('0x8')](),controller[_0xa711('0x9')]);router[_0xa711('0xa')](_0xa711('0xb'),auth[_0xa711('0x8')](),controller[_0xa711('0xc')]);module[_0xa711('0xd')]=router;
\ No newline at end of file
index e1bfd8d..dd4a554 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x4adc8a,_0x4846fb){var _0x3953fa=function(_0x21ab7c){while(--_0x21ab7c){_0x4adc8a['push'](_0x4adc8a['shift']());}};_0x3953fa(++_0x4846fb);}(_0x5496,0x175));var _0x6549=function(_0x55a5d5,_0xc954bb){_0x55a5d5=_0x55a5d5-0x0;var _0x39f704=_0x5496[_0x55a5d5];return _0x39f704;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x038b=['exports','STRING','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x038b,0x114));var _0xb038=function(_0x50e501,_0x483689){_0x50e501=_0x50e501-0x0;var _0x3e3489=_0x038b[_0x50e501];return _0x3e3489;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
index 03b9447..8eecede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f9=['destroy','then','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','ValidationErrorItem','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','Sequelize','AnalyticMetric','from','field','DESC','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','CustomReports','UserProfileResource'];(function(_0x53fd68,_0x508a41){var _0x9e77bb=function(_0x16f999){while(--_0x16f999){_0x53fd68['push'](_0x53fd68['shift']());}};_0x9e77bb(++_0x508a41);}(_0xb3f9,0x122));var _0x9b3f=function(_0x9cb41b,_0x118b53){_0x9cb41b=_0x9cb41b-0x0;var _0x185058=_0xb3f9[_0x9cb41b];return _0x185058;};'use strict';var emlformat=require(_0x9b3f('0x0'));var rimraf=require(_0x9b3f('0x1'));var zipdir=require(_0x9b3f('0x2'));var jsonpatch=require(_0x9b3f('0x3'));var rp=require(_0x9b3f('0x4'));var moment=require('moment');var BPromise=require(_0x9b3f('0x5'));var Mustache=require(_0x9b3f('0x6'));var util=require(_0x9b3f('0x7'));var path=require(_0x9b3f('0x8'));var sox=require('sox');var csv=require(_0x9b3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b3f('0xa'));var _=require(_0x9b3f('0xb'));var squel=require(_0x9b3f('0xc'));var crypto=require(_0x9b3f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b3f('0x9'));var querystring=require(_0x9b3f('0xe'));var Papa=require(_0x9b3f('0xf'));var Redis=require(_0x9b3f('0x10'));var authService=require(_0x9b3f('0x11'));var qs=require(_0x9b3f('0x12'));var as=require(_0x9b3f('0x13'));var hardwareService=require(_0x9b3f('0x14'));var logger=require(_0x9b3f('0x15'))(_0x9b3f('0x16'));var utils=require(_0x9b3f('0x17'));var config=require(_0x9b3f('0x18'));var licenseUtil=require(_0x9b3f('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9b3f('0x1a'))[_0x9b3f('0x1b')];function respondWithStatusCode(_0x39931d,_0x84412e){_0x84412e=_0x84412e||0xcc;return function(_0x2d8879){if(_0x2d8879){return _0x39931d[_0x9b3f('0x1c')](_0x84412e);}return _0x39931d[_0x9b3f('0x1d')](_0x84412e)[_0x9b3f('0x1e')]();};}function respondWithResult(_0x25dcef,_0x39a810){_0x39a810=_0x39a810||0xc8;return function(_0x21fef5){if(_0x21fef5){return _0x25dcef[_0x9b3f('0x1d')](_0x39a810)[_0x9b3f('0x1f')](_0x21fef5);}};}function respondWithFilteredResult(_0x495554,_0x267da8){return function(_0x32b0e1){if(_0x32b0e1){var _0x1a4567=typeof _0x267da8[_0x9b3f('0x20')]==='undefined'&&typeof _0x267da8[_0x9b3f('0x21')]===_0x9b3f('0x22');var _0x295eed=_0x32b0e1[_0x9b3f('0x23')];var _0x32fecc=_0x1a4567?0x0:_0x267da8['offset'];var _0x281ad6=_0x1a4567?_0x32b0e1['count']:_0x267da8[_0x9b3f('0x20')]+_0x267da8[_0x9b3f('0x21')];var _0x1c29d2;if(_0x281ad6>=_0x295eed){_0x281ad6=_0x295eed;_0x1c29d2=0xc8;}else{_0x1c29d2=0xce;}_0x495554[_0x9b3f('0x1d')](_0x1c29d2);return _0x495554[_0x9b3f('0x24')]('Content-Range',_0x32fecc+'-'+_0x281ad6+'/'+_0x295eed)[_0x9b3f('0x1f')](_0x32b0e1);}return null;};}function patchUpdates(_0xbb7aa5){return function(_0x4f0e55){try{jsonpatch[_0x9b3f('0x25')](_0x4f0e55,_0xbb7aa5,!![]);}catch(_0x4ef190){return BPromise['reject'](_0x4ef190);}return _0x4f0e55[_0x9b3f('0x26')]();};}function saveUpdates(_0x58898e,_0x1078cf){return function(_0x2d4d08){if(_0x2d4d08){return _0x2d4d08[_0x9b3f('0x27')](_0x58898e)['then'](function(_0x59f029){return _0x59f029;});}return null;};}function removeEntity(_0x486349,_0x2d84d7){return function(_0x1fb8f6){if(_0x1fb8f6){return _0x1fb8f6['destroy']()['then'](function(){var _0x3d3246=_0x1fb8f6['get']({'plain':!![]});var _0xfae7d3=_0x9b3f('0x28');return db[_0x9b3f('0x29')][_0x9b3f('0x2a')]({'where':{'type':_0xfae7d3,'resourceId':_0x3d3246['id']}})[_0x9b3f('0x2b')](function(){return _0x1fb8f6;});})[_0x9b3f('0x2b')](function(){_0x486349[_0x9b3f('0x1d')](0xcc)[_0x9b3f('0x1e')]();});}};}function handleEntityNotFound(_0x108ec8,_0x295013){return function(_0x609717){if(!_0x609717){_0x108ec8['sendStatus'](0x194);}return _0x609717;};}function handleError(_0x54cfa9,_0x54ed85){_0x54ed85=_0x54ed85||0x1f4;return function(_0x3bb032){logger[_0x9b3f('0x2c')](_0x3bb032[_0x9b3f('0x2d')]);if(_0x3bb032['name']){delete _0x3bb032[_0x9b3f('0x2e')];}_0x54cfa9[_0x9b3f('0x1d')](_0x54ed85)[_0x9b3f('0x2f')](_0x3bb032);};}exports['index']=function(_0x51564c,_0x52c8d9){var _0x15b5ef={},_0x87dcdb={},_0x5e6cc9={'count':0x0,'rows':[]};var _0x588d4b=_['map'](db[_0x9b3f('0x30')][_0x9b3f('0x31')],function(_0x5617d9){return{'name':_0x5617d9[_0x9b3f('0x32')],'type':_0x5617d9[_0x9b3f('0x33')]['key']};});_0x87dcdb[_0x9b3f('0x34')]=_[_0x9b3f('0x35')](_0x588d4b,_0x9b3f('0x2e'));_0x87dcdb[_0x9b3f('0x36')]=_[_0x9b3f('0x37')](_0x51564c[_0x9b3f('0x36')]);_0x87dcdb[_0x9b3f('0x38')]=_[_0x9b3f('0x39')](_0x87dcdb['model'],_0x87dcdb[_0x9b3f('0x36')]);_0x15b5ef[_0x9b3f('0x3a')]=_[_0x9b3f('0x39')](_0x87dcdb['model'],qs[_0x9b3f('0x3b')](_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x3b')]));_0x15b5ef[_0x9b3f('0x3a')]=_0x15b5ef[_0x9b3f('0x3a')][_0x9b3f('0x3c')]?_0x15b5ef['attributes']:_0x87dcdb['model'];if(!_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x3d')]('nolimit')){_0x15b5ef['limit']=qs[_0x9b3f('0x21')](_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x21')]);_0x15b5ef[_0x9b3f('0x20')]=qs[_0x9b3f('0x20')](_0x51564c['query'][_0x9b3f('0x20')]);}_0x15b5ef[_0x9b3f('0x3e')]=qs[_0x9b3f('0x3f')](_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x3f')]);_0x15b5ef[_0x9b3f('0x40')]=qs['filters'](_['pick'](_0x51564c['query'],_0x87dcdb[_0x9b3f('0x38')]),_0x588d4b);if(_0x51564c[_0x9b3f('0x36')]['filter']){_0x15b5ef[_0x9b3f('0x40')]=_[_0x9b3f('0x41')](_0x15b5ef[_0x9b3f('0x40')],{'$or':_[_0x9b3f('0x35')](_0x588d4b,function(_0x5be3fd){if(_0x5be3fd[_0x9b3f('0x33')]!==_0x9b3f('0x42')){var _0x45d0c4={};_0x45d0c4[_0x5be3fd[_0x9b3f('0x2e')]]={'$like':'%'+_0x51564c['query'][_0x9b3f('0x43')]+'%'};return _0x45d0c4;}})});}_0x15b5ef=_['merge']({},_0x15b5ef,_0x51564c['options']);var _0x4c2866={'where':_0x15b5ef[_0x9b3f('0x40')]};return db['AnalyticCustomReport']['count'](_0x4c2866)[_0x9b3f('0x2b')](function(_0x53af06){_0x5e6cc9[_0x9b3f('0x23')]=_0x53af06;if(_0x51564c[_0x9b3f('0x36')]['includeAll']){_0x15b5ef[_0x9b3f('0x44')]=[{'all':!![]}];}return db[_0x9b3f('0x30')][_0x9b3f('0x45')](_0x15b5ef);})[_0x9b3f('0x2b')](function(_0x398fda){_0x5e6cc9[_0x9b3f('0x46')]=_0x398fda;return _0x5e6cc9;})[_0x9b3f('0x2b')](respondWithFilteredResult(_0x52c8d9,_0x15b5ef))['catch'](handleError(_0x52c8d9,null));};exports[_0x9b3f('0x47')]=function(_0x468ea6,_0x490a8e){var _0x566c60={'raw':![],'where':{'id':_0x468ea6[_0x9b3f('0x48')]['id']}},_0x124078={};_0x124078[_0x9b3f('0x34')]=_[_0x9b3f('0x37')](db[_0x9b3f('0x30')][_0x9b3f('0x31')]);_0x124078[_0x9b3f('0x36')]=_[_0x9b3f('0x37')](_0x468ea6[_0x9b3f('0x36')]);_0x124078[_0x9b3f('0x38')]=_[_0x9b3f('0x39')](_0x124078[_0x9b3f('0x34')],_0x124078[_0x9b3f('0x36')]);_0x566c60[_0x9b3f('0x3a')]=_[_0x9b3f('0x39')](_0x124078[_0x9b3f('0x34')],qs[_0x9b3f('0x3b')](_0x468ea6[_0x9b3f('0x36')][_0x9b3f('0x3b')]));_0x566c60[_0x9b3f('0x3a')]=_0x566c60[_0x9b3f('0x3a')]['length']?_0x566c60['attributes']:_0x124078['model'];if(_0x468ea6['query'][_0x9b3f('0x49')]){_0x566c60[_0x9b3f('0x44')]=[{'all':!![]}];}_0x566c60=_['merge']({},_0x566c60,_0x468ea6['options']);return db[_0x9b3f('0x30')][_0x9b3f('0x4a')](_0x566c60)['then'](handleEntityNotFound(_0x490a8e,null))['then'](respondWithResult(_0x490a8e,null))[_0x9b3f('0x4b')](handleError(_0x490a8e,null));};exports['create']=function(_0x562577,_0x48aa9e){return db[_0x9b3f('0x30')][_0x9b3f('0x4c')](_0x562577[_0x9b3f('0x4d')],{})[_0x9b3f('0x2b')](function(_0x290253){var _0x103ae2=_0x562577[_0x9b3f('0x4e')][_0x9b3f('0x4f')]({'plain':!![]});if(!_0x103ae2)throw new Error(_0x9b3f('0x50'));if(_0x103ae2['role']===_0x9b3f('0x4e')){var _0x384f97=_0x290253['get']({'plain':!![]});var _0x584b5f=_0x9b3f('0x51');return db[_0x9b3f('0x52')][_0x9b3f('0x4a')]({'where':{'name':_0x584b5f,'userProfileId':_0x103ae2['userProfileId']},'raw':!![]})[_0x9b3f('0x2b')](function(_0x491eae){if(_0x491eae&&_0x491eae['autoAssociation']===0x0){return db[_0x9b3f('0x29')][_0x9b3f('0x4c')]({'name':_0x384f97['name'],'resourceId':_0x384f97['id'],'type':_0x9b3f('0x28'),'sectionId':_0x491eae['id']},{})['then'](function(){return _0x290253;});}else{return _0x290253;}})[_0x9b3f('0x4b')](function(_0xa354f2){logger['error'](_0x9b3f('0x53'),_0xa354f2);throw _0xa354f2;});}return _0x290253;})[_0x9b3f('0x2b')](respondWithResult(_0x48aa9e,0xc9))['catch'](handleError(_0x48aa9e,null));};exports['update']=function(_0x543903,_0x13d165){if(_0x543903[_0x9b3f('0x4d')]['id']){delete _0x543903[_0x9b3f('0x4d')]['id'];}return db[_0x9b3f('0x30')][_0x9b3f('0x4a')]({'where':{'id':_0x543903['params']['id']}})['then'](handleEntityNotFound(_0x13d165,null))['then'](saveUpdates(_0x543903['body'],null))[_0x9b3f('0x2b')](respondWithResult(_0x13d165,null))['catch'](handleError(_0x13d165,null));};exports[_0x9b3f('0x2a')]=function(_0x1fe86e,_0x47c96b){return db['AnalyticCustomReport'][_0x9b3f('0x4a')]({'where':{'id':_0x1fe86e[_0x9b3f('0x48')]['id']}})[_0x9b3f('0x2b')](handleEntityNotFound(_0x47c96b,null))[_0x9b3f('0x2b')](removeEntity(_0x47c96b,null))[_0x9b3f('0x4b')](handleError(_0x47c96b,null));};exports[_0x9b3f('0x54')]=function(_0x1d2376,_0xa958a3){var _0x2cb1a6=0xa;var _0x39c04a=[_0x9b3f('0x55'),_0x9b3f('0x56'),_0x9b3f('0x57'),_0x9b3f('0x58')];var _0x15075f={'SUM':_0x9b3f('0x59'),'COUNT':_0x9b3f('0x5a'),'COUNT DISTINCT':_0x9b3f('0x5b'),'MAX':'MAX(%s)','MIN':_0x9b3f('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9b3f('0x5d'),'GROUP_CONCAT ASC':_0x9b3f('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb7249b={'SEC_TO_TIME':_0x9b3f('0x5f'),'DATE':'DATE(%s)','HOUR':_0x9b3f('0x60'),'ROUND':_0x9b3f('0x61'),'UNIX_TIMESTAMP':_0x9b3f('0x62')};var _0x4d7017=function(_0x4ef0a4){return!_[_0x9b3f('0x63')]([_0x9b3f('0x64'),_0x9b3f('0x65'),_0x9b3f('0x66'),_0x9b3f('0x67')],_0x4ef0a4);};var _0x37b0d0=function(_0x5f3a8e){if(!_0x5f3a8e||!_0x5f3a8e[_0x9b3f('0x68')][_0x9b3f('0x3c')]){return'';}for(var _0x4aeb7f='(',_0xd7204f=0x0;_0xd7204f<_0x5f3a8e[_0x9b3f('0x68')][_0x9b3f('0x3c')];_0xd7204f+=0x1){_0xd7204f>0x0&&(_0x4aeb7f+='\x20'+_0x5f3a8e[_0x9b3f('0x69')]+'\x20');_0x4aeb7f+=_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f]['group']?_0x37b0d0(_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6a')]):_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f]['field']+'\x20'+_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6b')]+(_0x4d7017(_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6b')])?'\x20'+_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6c')]:'');}return _0x4aeb7f+')';};var _0x1f0b8b={'where':{'id':_0x1d2376[_0x9b3f('0x48')]['id']}},_0x30bfb7,_0x48773f,_0x310e16,_0x1296c4,_0x232f1a;_0x1f0b8b=_[_0x9b3f('0x41')]({},_0x1f0b8b,_0x1d2376[_0x9b3f('0x6d')]);return db['AnalyticCustomReport']['find'](_0x1f0b8b)['then'](function(_0x2c861f){if(_0x2c861f){_0x30bfb7=_0x2c861f;return _0x2c861f[_0x9b3f('0x6e')]();}return null;})[_0x9b3f('0x2b')](function(_0x2ffb12){if(_0x2ffb12){if(!_0x2ffb12['length']){throw new db['Sequelize'][(_0x9b3f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x48773f=_0x2ffb12;return db['AnalyticMetric'][_0x9b3f('0x45')]({'raw':!![]});}return null;})['then'](function(_0xce4cda){if(_0xce4cda){_0x310e16=_['keyBy'](_0xce4cda,'id');var _0x311419;var _0x4daa02=squel[_0x9b3f('0x70')]();_0x4daa02['from'](_0x30bfb7[_0x9b3f('0x71')]);for(var _0x207a1e=0x0;_0x207a1e<_0x48773f[_0x9b3f('0x3c')];_0x207a1e+=0x1){_0x311419=_0x48773f[_0x207a1e][_0x9b3f('0x72')]?_0x310e16[_0x48773f[_0x207a1e][_0x9b3f('0x72')]][_0x9b3f('0x73')]:_0x48773f[_0x207a1e]['field'];_0x311419=_0x48773f[_0x207a1e][_0x9b3f('0x74')]?_[_0x9b3f('0x75')](_0x15075f[_0x48773f[_0x207a1e][_0x9b3f('0x74')]],'%s',_0x311419):_0x311419;_0x311419=_0x48773f[_0x207a1e][_0x9b3f('0x76')]?_[_0x9b3f('0x75')](_0xb7249b[_0x48773f[_0x207a1e][_0x9b3f('0x76')]],'%s',_0x311419):_0x311419;if(_0x48773f[_0x207a1e][_0x9b3f('0x77')]){_0x4daa02[_0x9b3f('0x6a')](_0x311419);}_0x48773f[_0x207a1e][_0x9b3f('0x78')]&&_0x4daa02[_0x9b3f('0x3e')](_0x311419,_0x48773f[_0x207a1e][_0x9b3f('0x78')]==='DESC'?![]:!![]);_0x4daa02['field'](_0x311419,_0x48773f[_0x207a1e][_0x9b3f('0x79')]||_0x311419);}if(_0x30bfb7[_0x9b3f('0x7a')]){_0x30bfb7[_0x9b3f('0x7a')]=JSON[_0x9b3f('0x7b')](_0x30bfb7[_0x9b3f('0x7a')]);for(var _0xfe23a5=0x0;_0xfe23a5<_0x30bfb7['joins'][_0x9b3f('0x3c')];_0xfe23a5+=0x1){if(_0x30bfb7['joins'][_0xfe23a5][_0x9b3f('0x33')]&&_['includes'](_0x39c04a,_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x33')])&&_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x7c')]&&_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5]['foreignTable']&&_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x7d')]){_0x4daa02[_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x33')]](_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5]['foreignTable'],null,util[_0x9b3f('0x76')](_0x9b3f('0x7e'),_0x30bfb7[_0x9b3f('0x71')],_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x7c')],_0x30bfb7['joins'][_0xfe23a5][_0x9b3f('0x7f')],_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5]['foreignKey']));}}}if(_0x30bfb7[_0x9b3f('0x80')]){_0x30bfb7['conditions']=JSON[_0x9b3f('0x7b')](_0x30bfb7[_0x9b3f('0x80')]);_0x4daa02[_0x9b3f('0x40')](_0x37b0d0(_0x30bfb7[_0x9b3f('0x80')][_0x9b3f('0x6a')]));}_0x232f1a=_0x4daa02[_0x9b3f('0x81')]();_0x4daa02[_0x9b3f('0x21')](_0x2cb1a6);_0x4daa02[_0x9b3f('0x20')](0x0);logger[_0x9b3f('0x82')](_0x9b3f('0x83'),_0x4daa02[_0x9b3f('0x84')]());return dbH['sequelize'][_0x9b3f('0x36')](_0x4daa02['toString'](),{'type':dbH[_0x9b3f('0x85')][_0x9b3f('0x86')][_0x9b3f('0x87')]});}})['then'](respondWithResult(_0xa958a3,null))[_0x9b3f('0x4b')](handleError(_0xa958a3,null));};function runReport(_0x4afc6b,_0x52f4bf,_0x34f56c){var _0x15e4db=_0x52f4bf[_0x9b3f('0x2e')];var _0xc9275=0xa;var _0x3b99ab=[_0x9b3f('0x55'),'left_join','right_join',_0x9b3f('0x58')];var _0x578100={'SUM':_0x9b3f('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9b3f('0x5b'),'MAX':_0x9b3f('0x88'),'MIN':_0x9b3f('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9b3f('0x5d'),'GROUP_CONCAT ASC':_0x9b3f('0x5e'),'GROUP_CONCAT DESC':_0x9b3f('0x89')};var _0x8d1f04={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9b3f('0x8a'),'HOUR':_0x9b3f('0x60'),'ROUND':_0x9b3f('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x587abe=function(_0x37d95e){return!_[_0x9b3f('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x9b3f('0x66'),_0x9b3f('0x67')],_0x37d95e);};var _0x35ba43=function(_0x52083b){if(!_0x52083b||!_0x52083b[_0x9b3f('0x68')]['length']){return'';}for(var _0x3c4cbc='(',_0x36bb42=0x0;_0x36bb42<_0x52083b[_0x9b3f('0x68')][_0x9b3f('0x3c')];_0x36bb42+=0x1){_0x36bb42>0x0&&(_0x3c4cbc+='\x20'+_0x52083b[_0x9b3f('0x69')]+'\x20');_0x3c4cbc+=_0x52083b[_0x9b3f('0x68')][_0x36bb42][_0x9b3f('0x6a')]?_0x35ba43(_0x52083b[_0x9b3f('0x68')][_0x36bb42]['group']):_0x52083b[_0x9b3f('0x68')][_0x36bb42]['field']+'\x20'+_0x52083b[_0x9b3f('0x68')][_0x36bb42][_0x9b3f('0x6b')]+(_0x587abe(_0x52083b[_0x9b3f('0x68')][_0x36bb42][_0x9b3f('0x6b')])?'\x20'+_0x52083b[_0x9b3f('0x68')][_0x36bb42]['value']:'');}return _0x3c4cbc+')';};var _0x45f035={'where':{'id':_0x4afc6b['id']}},_0x2ca247,_0x287951,_0x199281,_0x53802a,_0x54612d;_0x45f035=_['merge']({},_0x45f035,_0x34f56c);return db[_0x9b3f('0x30')][_0x9b3f('0x4a')](_0x45f035)[_0x9b3f('0x2b')](function(_0x29a949){if(_0x29a949){_0x2ca247=_0x29a949;return _0x29a949[_0x9b3f('0x6e')]();}return null;})[_0x9b3f('0x2b')](function(_0x223601){if(_0x223601){if(!_0x223601[_0x9b3f('0x3c')]){throw new db[(_0x9b3f('0x8b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x287951=_0x223601;return db[_0x9b3f('0x8c')][_0x9b3f('0x45')]({'raw':!![]});}return null;})[_0x9b3f('0x2b')](function(_0x54c39b){if(_0x54c39b){_0x199281=_['keyBy'](_0x54c39b,'id');var _0x72782;var _0x259716=squel[_0x9b3f('0x70')]();_0x259716[_0x9b3f('0x8d')](_0x2ca247[_0x9b3f('0x71')]);for(var _0x4fa30b=0x0;_0x4fa30b<_0x287951['length'];_0x4fa30b+=0x1){_0x72782=_0x287951[_0x4fa30b][_0x9b3f('0x72')]?_0x199281[_0x287951[_0x4fa30b]['MetricId']][_0x9b3f('0x73')]:_0x287951[_0x4fa30b][_0x9b3f('0x8e')];_0x72782=_0x287951[_0x4fa30b][_0x9b3f('0x74')]?_['replace'](_0x578100[_0x287951[_0x4fa30b][_0x9b3f('0x74')]],'%s',_0x72782):_0x72782;_0x72782=_0x287951[_0x4fa30b][_0x9b3f('0x76')]?_[_0x9b3f('0x75')](_0x8d1f04[_0x287951[_0x4fa30b][_0x9b3f('0x76')]],'%s',_0x72782):_0x72782;if(_0x287951[_0x4fa30b][_0x9b3f('0x77')]){_0x259716['group'](_0x72782);}_0x287951[_0x4fa30b][_0x9b3f('0x78')]&&_0x259716['order'](_0x72782,_0x287951[_0x4fa30b][_0x9b3f('0x78')]===_0x9b3f('0x8f')?![]:!![]);_0x259716['field'](_0x72782,_0x287951[_0x4fa30b][_0x9b3f('0x79')]||_0x72782);}if(_0x2ca247[_0x9b3f('0x7a')]){_0x2ca247[_0x9b3f('0x7a')]=JSON['parse'](_0x2ca247[_0x9b3f('0x7a')]);for(var _0x174b94=0x0;_0x174b94<_0x2ca247[_0x9b3f('0x7a')][_0x9b3f('0x3c')];_0x174b94+=0x1){if(_0x2ca247['joins'][_0x174b94][_0x9b3f('0x33')]&&_[_0x9b3f('0x63')](_0x3b99ab,_0x2ca247['joins'][_0x174b94][_0x9b3f('0x33')])&&_0x2ca247['joins'][_0x174b94][_0x9b3f('0x7c')]&&_0x2ca247[_0x9b3f('0x7a')][_0x174b94]['foreignTable']&&_0x2ca247[_0x9b3f('0x7a')][_0x174b94][_0x9b3f('0x7d')]){_0x259716[_0x2ca247['joins'][_0x174b94]['type']](_0x2ca247['joins'][_0x174b94][_0x9b3f('0x7f')],null,util[_0x9b3f('0x76')](_0x9b3f('0x7e'),_0x2ca247[_0x9b3f('0x71')],_0x2ca247['joins'][_0x174b94][_0x9b3f('0x7c')],_0x2ca247[_0x9b3f('0x7a')][_0x174b94][_0x9b3f('0x7f')],_0x2ca247[_0x9b3f('0x7a')][_0x174b94][_0x9b3f('0x7d')]));}}}if(_0x2ca247[_0x9b3f('0x80')]){_0x2ca247['conditions']=JSON[_0x9b3f('0x7b')](_0x2ca247[_0x9b3f('0x80')]);_0x259716[_0x9b3f('0x40')](_0x35ba43(_0x2ca247[_0x9b3f('0x80')][_0x9b3f('0x6a')]));}_0x54612d=_0x259716[_0x9b3f('0x81')]();_0x259716[_0x9b3f('0x21')](_0xc9275);_0x259716[_0x9b3f('0x20')](0x0);return;}})[_0x9b3f('0x2b')](function(){if(_0x52f4bf[_0x9b3f('0x90')]==='web'){return null;}var _0x12f1fa=_[_0x9b3f('0x41')](_0x52f4bf,{'name':_0x52f4bf[_0x9b3f('0x91')]||_0x52f4bf[_0x9b3f('0x2e')]||_0x2ca247[_0x9b3f('0x2e')],'basename':_0x15e4db,'savename':util[_0x9b3f('0x76')](_0x9b3f('0x92'),_0x52f4bf[_0x9b3f('0x2e')]||_0x2ca247[_0x9b3f('0x2e')],require(_0x9b3f('0x93'))[_0x9b3f('0x94')](0x4),_0x52f4bf[_0x9b3f('0x90')]||_0x9b3f('0x95')),'reportId':_0x2ca247['id'],'reportType':_0x9b3f('0x96')});return db[_0x9b3f('0x97')][_0x9b3f('0x4c')](_0x12f1fa,{'raw':!![]});})[_0x9b3f('0x2b')](function(_0x5d5ef4){if(_0x2ca247['table']==='cdr'){_0x54612d[_0x9b3f('0x40')](_0x2ca247[_0x9b3f('0x71')]+_0x9b3f('0x98'),_0x52f4bf[_0x9b3f('0x99')],_0x52f4bf[_0x9b3f('0x9a')]);}else{_0x54612d['where'](_0x2ca247[_0x9b3f('0x71')]+_0x9b3f('0x9b'),_0x52f4bf['startDate'],_0x52f4bf[_0x9b3f('0x9a')]);}if(_0x5d5ef4){logger['info'](_0x9b3f('0x9c'),_0x54612d[_0x9b3f('0x84')]());require(_0x9b3f('0x9d'))[_0x9b3f('0x9e')](path[_0x9b3f('0x55')](__dirname,'../../components/export/',_0x5d5ef4[_0x9b3f('0x90')]),[_0x5d5ef4['id'],_0x54612d[_0x9b3f('0x84')](),path[_0x9b3f('0x55')](__dirname,_0x9b3f('0x9f'),_0x5d5ef4[_0x9b3f('0xa0')]),_0x15e4db]);return _0x5d5ef4;}else{var _0xfec4dd=squel[_0x9b3f('0x70')]();_0xfec4dd[_0x9b3f('0x8d')]('('+_0x54612d[_0x9b3f('0x84')]()+')',_0x9b3f('0xa1'));_0xfec4dd[_0x9b3f('0x8e')](_0x9b3f('0xa2'),_0x9b3f('0x23'));_0x54612d[_0x9b3f('0x21')](_0x52f4bf[_0x9b3f('0x21')]||_0xc9275);_0x54612d[_0x9b3f('0x20')](_0x52f4bf[_0x9b3f('0x20')]||0x0);return dbH[_0x9b3f('0x85')][_0x9b3f('0x36')](_0xfec4dd['toString'](),{'type':dbH[_0x9b3f('0x85')][_0x9b3f('0x86')][_0x9b3f('0x87')]})[_0x9b3f('0x2b')](function(_0x54d533){if(!_0x54d533[_0x9b3f('0x3c')]){_0x53802a=0x0;}else{_0x53802a=_0x54d533[0x0][_0x9b3f('0x23')]||0x0;}return dbH[_0x9b3f('0x85')][_0x9b3f('0x36')](_0x54612d[_0x9b3f('0x84')](),{'type':dbH[_0x9b3f('0x85')][_0x9b3f('0x86')][_0x9b3f('0x87')]});})['then'](function(_0x3779e6){return{'rows':_0x3779e6||[],'count':_0x53802a};});}});}exports[_0x9b3f('0xa3')]=function(_0x592a82,_0x2bb67b){return runReport(_0x592a82[_0x9b3f('0x48')],_0x592a82['query'],_0x592a82[_0x9b3f('0x6d')])[_0x9b3f('0x2b')](respondWithResult(_0x2bb67b,null))[_0x9b3f('0x4b')](handleError(_0x2bb67b,null));};exports['runReport']=runReport;exports[_0x9b3f('0x36')]=function(_0x33837c,_0x5406e2){var _0x215a37=0xa;var _0x363870=['join',_0x9b3f('0x56'),_0x9b3f('0x57'),_0x9b3f('0x58')];var _0x5c4ff8={'SUM':'SUM(%s)','COUNT':_0x9b3f('0x5a'),'COUNT DISTINCT':_0x9b3f('0x5b'),'MAX':_0x9b3f('0x88'),'MIN':_0x9b3f('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9b3f('0x5d'),'GROUP_CONCAT ASC':_0x9b3f('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x438a44={'SEC_TO_TIME':_0x9b3f('0x5f'),'DATE':_0x9b3f('0x8a'),'HOUR':_0x9b3f('0x60'),'ROUND':_0x9b3f('0x61'),'UNIX_TIMESTAMP':_0x9b3f('0x62')};var _0x40b876=function(_0x113dee){return!_[_0x9b3f('0x63')]([_0x9b3f('0x64'),_0x9b3f('0x65'),_0x9b3f('0x66'),_0x9b3f('0x67')],_0x113dee);};var _0x8cfdb1=function(_0x307fda){if(!_0x307fda||!_0x307fda[_0x9b3f('0x68')][_0x9b3f('0x3c')]){return'';}for(var _0x237846='(',_0x2a17db=0x0;_0x2a17db<_0x307fda['rules'][_0x9b3f('0x3c')];_0x2a17db+=0x1){_0x2a17db>0x0&&(_0x237846+='\x20'+_0x307fda[_0x9b3f('0x69')]+'\x20');_0x237846+=_0x307fda['rules'][_0x2a17db][_0x9b3f('0x6a')]?_0x8cfdb1(_0x307fda['rules'][_0x2a17db]['group']):_0x307fda[_0x9b3f('0x68')][_0x2a17db][_0x9b3f('0x8e')]+'\x20'+_0x307fda[_0x9b3f('0x68')][_0x2a17db]['condition']+(_0x40b876(_0x307fda[_0x9b3f('0x68')][_0x2a17db][_0x9b3f('0x6b')])?'\x20'+_0x307fda[_0x9b3f('0x68')][_0x2a17db][_0x9b3f('0x6c')]:'');}return _0x237846+')';};var _0x7e1896={'where':{'id':_0x33837c[_0x9b3f('0x48')]['id']}},_0x32cc25,_0x23912b,_0x326dff,_0x3fff15,_0x495861;_0x7e1896=_[_0x9b3f('0x41')]({},_0x7e1896,_0x33837c[_0x9b3f('0x6d')]);return db['AnalyticCustomReport'][_0x9b3f('0x4a')](_0x7e1896)[_0x9b3f('0x2b')](function(_0x7a82f0){if(_0x7a82f0){_0x32cc25=_0x7a82f0;return _0x7a82f0[_0x9b3f('0x6e')]();}return null;})[_0x9b3f('0x2b')](function(_0x40116c){if(_0x40116c){if(!_0x40116c['length']){throw new db[(_0x9b3f('0x8b'))][(_0x9b3f('0x6f'))](_0x9b3f('0xa4'),0x193);}_0x23912b=_0x40116c;return db[_0x9b3f('0x8c')][_0x9b3f('0x45')]({'raw':!![]});}return null;})[_0x9b3f('0x2b')](function(_0x5a90f9){if(_0x5a90f9){_0x326dff=_[_0x9b3f('0xa5')](_0x5a90f9,'id');var _0x733b69;var _0x414da4=squel[_0x9b3f('0x70')]();_0x414da4[_0x9b3f('0x8d')](_0x32cc25[_0x9b3f('0x71')]);for(var _0x4271c9=0x0;_0x4271c9<_0x23912b[_0x9b3f('0x3c')];_0x4271c9+=0x1){_0x733b69=_0x23912b[_0x4271c9][_0x9b3f('0x72')]?_0x326dff[_0x23912b[_0x4271c9][_0x9b3f('0x72')]][_0x9b3f('0x73')]:_0x23912b[_0x4271c9][_0x9b3f('0x8e')];_0x733b69=_0x23912b[_0x4271c9][_0x9b3f('0x74')]?_[_0x9b3f('0x75')](_0x5c4ff8[_0x23912b[_0x4271c9][_0x9b3f('0x74')]],'%s',_0x733b69):_0x733b69;_0x733b69=_0x23912b[_0x4271c9][_0x9b3f('0x76')]?_[_0x9b3f('0x75')](_0x438a44[_0x23912b[_0x4271c9][_0x9b3f('0x76')]],'%s',_0x733b69):_0x733b69;if(_0x23912b[_0x4271c9][_0x9b3f('0x77')]){_0x414da4[_0x9b3f('0x6a')](_0x733b69);}_0x23912b[_0x4271c9][_0x9b3f('0x78')]&&_0x414da4['order'](_0x733b69,_0x23912b[_0x4271c9]['orderBy']==='DESC'?![]:!![]);_0x414da4[_0x9b3f('0x8e')](_0x733b69,_0x23912b[_0x4271c9][_0x9b3f('0x79')]||_0x733b69);}if(_0x32cc25[_0x9b3f('0x7a')]){_0x32cc25['joins']=JSON[_0x9b3f('0x7b')](_0x32cc25[_0x9b3f('0x7a')]);for(var _0x395fe2=0x0;_0x395fe2<_0x32cc25['joins'][_0x9b3f('0x3c')];_0x395fe2+=0x1){if(_0x32cc25['joins'][_0x395fe2][_0x9b3f('0x33')]&&_[_0x9b3f('0x63')](_0x363870,_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x33')])&&_0x32cc25[_0x9b3f('0x7a')][_0x395fe2]['parentKey']&&_0x32cc25['joins'][_0x395fe2][_0x9b3f('0x7f')]&&_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x7d')]){_0x414da4[_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x33')]](_0x32cc25['joins'][_0x395fe2][_0x9b3f('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x32cc25['table'],_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x7c')],_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x7f')],_0x32cc25[_0x9b3f('0x7a')][_0x395fe2]['foreignKey']));}}}if(_0x32cc25[_0x9b3f('0x80')]){_0x32cc25[_0x9b3f('0x80')]=JSON[_0x9b3f('0x7b')](_0x32cc25['conditions']);_0x414da4[_0x9b3f('0x40')](_0x8cfdb1(_0x32cc25[_0x9b3f('0x80')][_0x9b3f('0x6a')]));}_0x495861=_0x414da4['clone']();_0x414da4['limit'](_0x215a37);_0x414da4['offset'](0x0);logger[_0x9b3f('0x82')](_0x9b3f('0x83'),_0x414da4['toString']());return dbH[_0x9b3f('0x85')][_0x9b3f('0x36')](_0x414da4[_0x9b3f('0x84')](),{'type':dbH['sequelize'][_0x9b3f('0x86')][_0x9b3f('0x87')]});}})[_0x9b3f('0x2b')](function(){return{'sql':_0x495861[_0x9b3f('0x84')]()};})[_0x9b3f('0x2b')](respondWithResult(_0x5406e2,null))[_0x9b3f('0x4b')](handleError(_0x5406e2,null));};
\ No newline at end of file
+var _0xea12=['util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','length','nolimit','order','pick','filters','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','attributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','find','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','operator','AnalyticMetric','from','clone','web','randomstring','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','runReport','SEC_TO_TIME(%s)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xea12,0x1c5));var _0x2ea1=function(_0x46b92c,_0x2b5537){_0x46b92c=_0x46b92c-0x0;var _0x4d58ef=_0xea12[_0x46b92c];return _0x4d58ef;};'use strict';var emlformat=require(_0x2ea1('0x0'));var rimraf=require(_0x2ea1('0x1'));var zipdir=require(_0x2ea1('0x2'));var jsonpatch=require(_0x2ea1('0x3'));var rp=require('request-promise');var moment=require(_0x2ea1('0x4'));var BPromise=require(_0x2ea1('0x5'));var Mustache=require('mustache');var util=require(_0x2ea1('0x6'));var path=require(_0x2ea1('0x7'));var sox=require(_0x2ea1('0x8'));var csv=require(_0x2ea1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ea1('0xa'));var _=require(_0x2ea1('0xb'));var squel=require('squel');var crypto=require(_0x2ea1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ea1('0x9'));var querystring=require(_0x2ea1('0xd'));var Papa=require('papaparse');var Redis=require(_0x2ea1('0xe'));var authService=require(_0x2ea1('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ea1('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ea1('0x11'));var db=require(_0x2ea1('0x12'))['db'];var dbH=require(_0x2ea1('0x12'))[_0x2ea1('0x13')];function respondWithStatusCode(_0x4ffdd9,_0x587d01){_0x587d01=_0x587d01||0xcc;return function(_0x35e04a){if(_0x35e04a){return _0x4ffdd9[_0x2ea1('0x14')](_0x587d01);}return _0x4ffdd9[_0x2ea1('0x15')](_0x587d01)[_0x2ea1('0x16')]();};}function respondWithResult(_0x57de47,_0x4dfcbb){_0x4dfcbb=_0x4dfcbb||0xc8;return function(_0x23344d){if(_0x23344d){return _0x57de47[_0x2ea1('0x15')](_0x4dfcbb)[_0x2ea1('0x17')](_0x23344d);}};}function respondWithFilteredResult(_0x360268,_0x406f46){return function(_0x443ebf){if(_0x443ebf){var _0x30854c=typeof _0x406f46[_0x2ea1('0x18')]===_0x2ea1('0x19')&&typeof _0x406f46['limit']===_0x2ea1('0x19');var _0x537f52=_0x443ebf[_0x2ea1('0x1a')];var _0x2bc034=_0x30854c?0x0:_0x406f46[_0x2ea1('0x18')];var _0x449d4d=_0x30854c?_0x443ebf[_0x2ea1('0x1a')]:_0x406f46[_0x2ea1('0x18')]+_0x406f46[_0x2ea1('0x1b')];var _0x2ebb49;if(_0x449d4d>=_0x537f52){_0x449d4d=_0x537f52;_0x2ebb49=0xc8;}else{_0x2ebb49=0xce;}_0x360268[_0x2ea1('0x15')](_0x2ebb49);return _0x360268[_0x2ea1('0x1c')]('Content-Range',_0x2bc034+'-'+_0x449d4d+'/'+_0x537f52)[_0x2ea1('0x17')](_0x443ebf);}return null;};}function patchUpdates(_0x32a6d3){return function(_0x29410b){try{jsonpatch['apply'](_0x29410b,_0x32a6d3,!![]);}catch(_0x23eed4){return BPromise[_0x2ea1('0x1d')](_0x23eed4);}return _0x29410b[_0x2ea1('0x1e')]();};}function saveUpdates(_0x1ac7ab,_0x2e5975){return function(_0x1b2a50){if(_0x1b2a50){return _0x1b2a50[_0x2ea1('0x1f')](_0x1ac7ab)[_0x2ea1('0x20')](function(_0x55d5fb){return _0x55d5fb;});}return null;};}function removeEntity(_0x387fe6,_0x25f945){return function(_0x140a37){if(_0x140a37){return _0x140a37[_0x2ea1('0x21')]()[_0x2ea1('0x20')](function(){var _0x11710e=_0x140a37[_0x2ea1('0x22')]({'plain':!![]});var _0x514182=_0x2ea1('0x23');return db[_0x2ea1('0x24')][_0x2ea1('0x21')]({'where':{'type':_0x514182,'resourceId':_0x11710e['id']}})[_0x2ea1('0x20')](function(){return _0x140a37;});})['then'](function(){_0x387fe6[_0x2ea1('0x15')](0xcc)[_0x2ea1('0x16')]();});}};}function handleEntityNotFound(_0x5b84b0,_0x354238){return function(_0x3db0dc){if(!_0x3db0dc){_0x5b84b0[_0x2ea1('0x14')](0x194);}return _0x3db0dc;};}function handleError(_0x518faa,_0x29aa0c){_0x29aa0c=_0x29aa0c||0x1f4;return function(_0x350214){logger['error'](_0x350214[_0x2ea1('0x25')]);if(_0x350214['name']){delete _0x350214[_0x2ea1('0x26')];}_0x518faa[_0x2ea1('0x15')](_0x29aa0c)[_0x2ea1('0x27')](_0x350214);};}exports['index']=function(_0x459d52,_0x49b4f9){var _0x2a55ec={},_0x33f7ff={},_0x2172fd={'count':0x0,'rows':[]};var _0x34ba5b=_[_0x2ea1('0x28')](db[_0x2ea1('0x29')][_0x2ea1('0x2a')],function(_0x4d8ade){return{'name':_0x4d8ade[_0x2ea1('0x2b')],'type':_0x4d8ade[_0x2ea1('0x2c')][_0x2ea1('0x2d')]};});_0x33f7ff[_0x2ea1('0x2e')]=_[_0x2ea1('0x28')](_0x34ba5b,_0x2ea1('0x26'));_0x33f7ff['query']=_['keys'](_0x459d52[_0x2ea1('0x2f')]);_0x33f7ff['filters']=_[_0x2ea1('0x30')](_0x33f7ff[_0x2ea1('0x2e')],_0x33f7ff[_0x2ea1('0x2f')]);_0x2a55ec['attributes']=_[_0x2ea1('0x30')](_0x33f7ff['model'],qs[_0x2ea1('0x31')](_0x459d52['query']['fields']));_0x2a55ec['attributes']=_0x2a55ec['attributes'][_0x2ea1('0x32')]?_0x2a55ec['attributes']:_0x33f7ff[_0x2ea1('0x2e')];if(!_0x459d52[_0x2ea1('0x2f')]['hasOwnProperty'](_0x2ea1('0x33'))){_0x2a55ec[_0x2ea1('0x1b')]=qs[_0x2ea1('0x1b')](_0x459d52['query'][_0x2ea1('0x1b')]);_0x2a55ec['offset']=qs[_0x2ea1('0x18')](_0x459d52['query'][_0x2ea1('0x18')]);}_0x2a55ec[_0x2ea1('0x34')]=qs['sort'](_0x459d52[_0x2ea1('0x2f')]['sort']);_0x2a55ec['where']=qs['filters'](_[_0x2ea1('0x35')](_0x459d52[_0x2ea1('0x2f')],_0x33f7ff[_0x2ea1('0x36')]),_0x34ba5b);if(_0x459d52[_0x2ea1('0x2f')]['filter']){_0x2a55ec[_0x2ea1('0x37')]=_[_0x2ea1('0x38')](_0x2a55ec['where'],{'$or':_['map'](_0x34ba5b,function(_0x3349ca){if(_0x3349ca[_0x2ea1('0x2c')]!==_0x2ea1('0x39')){var _0x1f2ac3={};_0x1f2ac3[_0x3349ca[_0x2ea1('0x26')]]={'$like':'%'+_0x459d52[_0x2ea1('0x2f')]['filter']+'%'};return _0x1f2ac3;}})});}_0x2a55ec=_[_0x2ea1('0x38')]({},_0x2a55ec,_0x459d52[_0x2ea1('0x3a')]);var _0x66817b={'where':_0x2a55ec[_0x2ea1('0x37')]};return db[_0x2ea1('0x29')][_0x2ea1('0x1a')](_0x66817b)[_0x2ea1('0x20')](function(_0x5ed68f){_0x2172fd[_0x2ea1('0x1a')]=_0x5ed68f;if(_0x459d52['query'][_0x2ea1('0x3b')]){_0x2a55ec[_0x2ea1('0x3c')]=[{'all':!![]}];}return db[_0x2ea1('0x29')]['findAll'](_0x2a55ec);})[_0x2ea1('0x20')](function(_0x33ba97){_0x2172fd[_0x2ea1('0x3d')]=_0x33ba97;return _0x2172fd;})['then'](respondWithFilteredResult(_0x49b4f9,_0x2a55ec))[_0x2ea1('0x3e')](handleError(_0x49b4f9,null));};exports['show']=function(_0x4881e4,_0x560c1b){var _0x2fb466={'raw':![],'where':{'id':_0x4881e4[_0x2ea1('0x3f')]['id']}},_0x59cea9={};_0x59cea9[_0x2ea1('0x2e')]=_[_0x2ea1('0x40')](db[_0x2ea1('0x29')][_0x2ea1('0x2a')]);_0x59cea9['query']=_['keys'](_0x4881e4['query']);_0x59cea9[_0x2ea1('0x36')]=_[_0x2ea1('0x30')](_0x59cea9['model'],_0x59cea9['query']);_0x2fb466[_0x2ea1('0x41')]=_[_0x2ea1('0x30')](_0x59cea9[_0x2ea1('0x2e')],qs[_0x2ea1('0x31')](_0x4881e4[_0x2ea1('0x2f')][_0x2ea1('0x31')]));_0x2fb466[_0x2ea1('0x41')]=_0x2fb466[_0x2ea1('0x41')]['length']?_0x2fb466['attributes']:_0x59cea9[_0x2ea1('0x2e')];if(_0x4881e4[_0x2ea1('0x2f')][_0x2ea1('0x3b')]){_0x2fb466[_0x2ea1('0x3c')]=[{'all':!![]}];}_0x2fb466=_[_0x2ea1('0x38')]({},_0x2fb466,_0x4881e4[_0x2ea1('0x3a')]);return db[_0x2ea1('0x29')]['find'](_0x2fb466)['then'](handleEntityNotFound(_0x560c1b,null))[_0x2ea1('0x20')](respondWithResult(_0x560c1b,null))[_0x2ea1('0x3e')](handleError(_0x560c1b,null));};exports[_0x2ea1('0x42')]=function(_0x58bf5d,_0x4c6cd1){return db[_0x2ea1('0x29')][_0x2ea1('0x42')](_0x58bf5d[_0x2ea1('0x43')],{})[_0x2ea1('0x20')](function(_0x115fe1){var _0x39351c=_0x58bf5d[_0x2ea1('0x44')][_0x2ea1('0x22')]({'plain':!![]});if(!_0x39351c)throw new Error(_0x2ea1('0x45'));if(_0x39351c['role']===_0x2ea1('0x44')){var _0x45c5a0=_0x115fe1[_0x2ea1('0x22')]({'plain':!![]});var _0x403846='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x403846,'userProfileId':_0x39351c[_0x2ea1('0x46')]},'raw':!![]})[_0x2ea1('0x20')](function(_0x4f52ed){if(_0x4f52ed&&_0x4f52ed[_0x2ea1('0x47')]===0x0){return db[_0x2ea1('0x24')][_0x2ea1('0x42')]({'name':_0x45c5a0[_0x2ea1('0x26')],'resourceId':_0x45c5a0['id'],'type':_0x2ea1('0x23'),'sectionId':_0x4f52ed['id']},{})[_0x2ea1('0x20')](function(){return _0x115fe1;});}else{return _0x115fe1;}})[_0x2ea1('0x3e')](function(_0x2fc13a){logger[_0x2ea1('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fc13a);throw _0x2fc13a;});}return _0x115fe1;})[_0x2ea1('0x20')](respondWithResult(_0x4c6cd1,0xc9))[_0x2ea1('0x3e')](handleError(_0x4c6cd1,null));};exports['update']=function(_0x8d2aa6,_0x127a52){if(_0x8d2aa6[_0x2ea1('0x43')]['id']){delete _0x8d2aa6[_0x2ea1('0x43')]['id'];}return db[_0x2ea1('0x29')][_0x2ea1('0x49')]({'where':{'id':_0x8d2aa6[_0x2ea1('0x3f')]['id']}})[_0x2ea1('0x20')](handleEntityNotFound(_0x127a52,null))['then'](saveUpdates(_0x8d2aa6[_0x2ea1('0x43')],null))['then'](respondWithResult(_0x127a52,null))['catch'](handleError(_0x127a52,null));};exports[_0x2ea1('0x21')]=function(_0x33876b,_0x15e7b6){return db[_0x2ea1('0x29')]['find']({'where':{'id':_0x33876b[_0x2ea1('0x3f')]['id']}})[_0x2ea1('0x20')](handleEntityNotFound(_0x15e7b6,null))[_0x2ea1('0x20')](removeEntity(_0x15e7b6,null))[_0x2ea1('0x3e')](handleError(_0x15e7b6,null));};exports[_0x2ea1('0x4a')]=function(_0x2ea3b2,_0x27367f){var _0x51b38e=0xa;var _0xd1e7f9=[_0x2ea1('0x4b'),_0x2ea1('0x4c'),'right_join',_0x2ea1('0x4d')];var _0x3519d3={'SUM':_0x2ea1('0x4e'),'COUNT':_0x2ea1('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2ea1('0x50'),'MIN':_0x2ea1('0x51'),'AVG':_0x2ea1('0x52'),'GROUP_CONCAT':_0x2ea1('0x53'),'GROUP_CONCAT ASC':_0x2ea1('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x55b463={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x2ea1('0x55'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2ea1('0x56')};var _0x1ca328=function(_0x6b70f){return!_[_0x2ea1('0x57')](['IS\x20NULL',_0x2ea1('0x58'),_0x2ea1('0x59'),_0x2ea1('0x5a')],_0x6b70f);};var _0x442873=function(_0x404c3a){if(!_0x404c3a||!_0x404c3a[_0x2ea1('0x5b')][_0x2ea1('0x32')]){return'';}for(var _0x515b6d='(',_0x42437a=0x0;_0x42437a<_0x404c3a[_0x2ea1('0x5b')][_0x2ea1('0x32')];_0x42437a+=0x1){_0x42437a>0x0&&(_0x515b6d+='\x20'+_0x404c3a['operator']+'\x20');_0x515b6d+=_0x404c3a['rules'][_0x42437a][_0x2ea1('0x5c')]?_0x442873(_0x404c3a['rules'][_0x42437a][_0x2ea1('0x5c')]):_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5d')]+'\x20'+_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5e')]+(_0x1ca328(_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5e')])?'\x20'+_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5f')]:'');}return _0x515b6d+')';};var _0x519f6a={'where':{'id':_0x2ea3b2[_0x2ea1('0x3f')]['id']}},_0xcc2f53,_0x100e7c,_0x26dea8,_0x4254b5,_0x3a4c77;_0x519f6a=_[_0x2ea1('0x38')]({},_0x519f6a,_0x2ea3b2[_0x2ea1('0x3a')]);return db[_0x2ea1('0x29')][_0x2ea1('0x49')](_0x519f6a)[_0x2ea1('0x20')](function(_0x31b198){if(_0x31b198){_0xcc2f53=_0x31b198;return _0x31b198[_0x2ea1('0x60')]();}return null;})[_0x2ea1('0x20')](function(_0x436ab5){if(_0x436ab5){if(!_0x436ab5['length']){throw new db[(_0x2ea1('0x61'))][(_0x2ea1('0x62'))](_0x2ea1('0x63'),0x193);}_0x100e7c=_0x436ab5;return db['AnalyticMetric'][_0x2ea1('0x64')]({'raw':!![]});}return null;})[_0x2ea1('0x20')](function(_0x45cb49){if(_0x45cb49){_0x26dea8=_[_0x2ea1('0x65')](_0x45cb49,'id');var _0x58e071;var _0x1ff32e=squel[_0x2ea1('0x66')]();_0x1ff32e['from'](_0xcc2f53[_0x2ea1('0x67')]);for(var _0x121a8d=0x0;_0x121a8d<_0x100e7c[_0x2ea1('0x32')];_0x121a8d+=0x1){_0x58e071=_0x100e7c[_0x121a8d][_0x2ea1('0x68')]?_0x26dea8[_0x100e7c[_0x121a8d]['MetricId']][_0x2ea1('0x69')]:_0x100e7c[_0x121a8d][_0x2ea1('0x5d')];_0x58e071=_0x100e7c[_0x121a8d][_0x2ea1('0x6a')]?_[_0x2ea1('0x6b')](_0x3519d3[_0x100e7c[_0x121a8d]['function']],'%s',_0x58e071):_0x58e071;_0x58e071=_0x100e7c[_0x121a8d][_0x2ea1('0x6c')]?_[_0x2ea1('0x6b')](_0x55b463[_0x100e7c[_0x121a8d][_0x2ea1('0x6c')]],'%s',_0x58e071):_0x58e071;if(_0x100e7c[_0x121a8d][_0x2ea1('0x6d')]){_0x1ff32e['group'](_0x58e071);}_0x100e7c[_0x121a8d][_0x2ea1('0x6e')]&&_0x1ff32e[_0x2ea1('0x34')](_0x58e071,_0x100e7c[_0x121a8d]['orderBy']===_0x2ea1('0x6f')?![]:!![]);_0x1ff32e['field'](_0x58e071,_0x100e7c[_0x121a8d][_0x2ea1('0x70')]||_0x58e071);}if(_0xcc2f53[_0x2ea1('0x71')]){_0xcc2f53[_0x2ea1('0x71')]=JSON[_0x2ea1('0x72')](_0xcc2f53['joins']);for(var _0x59db73=0x0;_0x59db73<_0xcc2f53[_0x2ea1('0x71')][_0x2ea1('0x32')];_0x59db73+=0x1){if(_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x2c')]&&_[_0x2ea1('0x57')](_0xd1e7f9,_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x2c')])&&_0xcc2f53['joins'][_0x59db73][_0x2ea1('0x73')]&&_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x74')]&&_0xcc2f53[_0x2ea1('0x71')][_0x59db73]['foreignKey']){_0x1ff32e[_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x2c')]](_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x74')],null,util['format'](_0x2ea1('0x75'),_0xcc2f53[_0x2ea1('0x67')],_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x73')],_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x74')],_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x76')]));}}}if(_0xcc2f53[_0x2ea1('0x77')]){_0xcc2f53[_0x2ea1('0x77')]=JSON[_0x2ea1('0x72')](_0xcc2f53[_0x2ea1('0x77')]);_0x1ff32e[_0x2ea1('0x37')](_0x442873(_0xcc2f53[_0x2ea1('0x77')][_0x2ea1('0x5c')]));}_0x3a4c77=_0x1ff32e['clone']();_0x1ff32e[_0x2ea1('0x1b')](_0x51b38e);_0x1ff32e[_0x2ea1('0x18')](0x0);logger[_0x2ea1('0x78')](_0x2ea1('0x79'),_0x1ff32e[_0x2ea1('0x7a')]());return dbH[_0x2ea1('0x7b')]['query'](_0x1ff32e['toString'](),{'type':dbH[_0x2ea1('0x7b')][_0x2ea1('0x7c')][_0x2ea1('0x7d')]});}})[_0x2ea1('0x20')](respondWithResult(_0x27367f,null))[_0x2ea1('0x3e')](handleError(_0x27367f,null));};function runReport(_0x47617b,_0x2e585b,_0x3e2ac2){var _0x4e7a51=_0x2e585b[_0x2ea1('0x26')];var _0x548f82=0xa;var _0x6e2f44=[_0x2ea1('0x4b'),_0x2ea1('0x4c'),_0x2ea1('0x7e'),'cross_join'];var _0x25a969={'SUM':'SUM(%s)','COUNT':_0x2ea1('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x2ea1('0x51'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2ea1('0x53'),'GROUP_CONCAT ASC':_0x2ea1('0x54'),'GROUP_CONCAT DESC':_0x2ea1('0x7f')};var _0x34e4be={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2ea1('0x80'),'HOUR':'HOUR(%s)','ROUND':_0x2ea1('0x81'),'UNIX_TIMESTAMP':_0x2ea1('0x56')};var _0x320cc3=function(_0x50cbfd){return!_[_0x2ea1('0x57')](['IS\x20NULL',_0x2ea1('0x58'),_0x2ea1('0x59'),'IS\x20NOT\x20EMPTY'],_0x50cbfd);};var _0x2796fb=function(_0x598242){if(!_0x598242||!_0x598242[_0x2ea1('0x5b')][_0x2ea1('0x32')]){return'';}for(var _0x6442b3='(',_0x12f1d2=0x0;_0x12f1d2<_0x598242[_0x2ea1('0x5b')]['length'];_0x12f1d2+=0x1){_0x12f1d2>0x0&&(_0x6442b3+='\x20'+_0x598242[_0x2ea1('0x82')]+'\x20');_0x6442b3+=_0x598242['rules'][_0x12f1d2][_0x2ea1('0x5c')]?_0x2796fb(_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5c')]):_0x598242[_0x2ea1('0x5b')][_0x12f1d2]['field']+'\x20'+_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5e')]+(_0x320cc3(_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5e')])?'\x20'+_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5f')]:'');}return _0x6442b3+')';};var _0x4ffb39={'where':{'id':_0x47617b['id']}},_0x3c48ce,_0x5454f8,_0x2e2803,_0x32ca6a,_0x41a4ac;_0x4ffb39=_[_0x2ea1('0x38')]({},_0x4ffb39,_0x3e2ac2);return db[_0x2ea1('0x29')][_0x2ea1('0x49')](_0x4ffb39)[_0x2ea1('0x20')](function(_0x1c7c07){if(_0x1c7c07){_0x3c48ce=_0x1c7c07;return _0x1c7c07[_0x2ea1('0x60')]();}return null;})['then'](function(_0x3994a7){if(_0x3994a7){if(!_0x3994a7['length']){throw new db['Sequelize'][(_0x2ea1('0x62'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5454f8=_0x3994a7;return db[_0x2ea1('0x83')][_0x2ea1('0x64')]({'raw':!![]});}return null;})[_0x2ea1('0x20')](function(_0x3e9791){if(_0x3e9791){_0x2e2803=_[_0x2ea1('0x65')](_0x3e9791,'id');var _0xf36107;var _0x5f2b42=squel[_0x2ea1('0x66')]();_0x5f2b42[_0x2ea1('0x84')](_0x3c48ce[_0x2ea1('0x67')]);for(var _0x13ced8=0x0;_0x13ced8<_0x5454f8[_0x2ea1('0x32')];_0x13ced8+=0x1){_0xf36107=_0x5454f8[_0x13ced8][_0x2ea1('0x68')]?_0x2e2803[_0x5454f8[_0x13ced8]['MetricId']][_0x2ea1('0x69')]:_0x5454f8[_0x13ced8]['field'];_0xf36107=_0x5454f8[_0x13ced8][_0x2ea1('0x6a')]?_[_0x2ea1('0x6b')](_0x25a969[_0x5454f8[_0x13ced8][_0x2ea1('0x6a')]],'%s',_0xf36107):_0xf36107;_0xf36107=_0x5454f8[_0x13ced8][_0x2ea1('0x6c')]?_['replace'](_0x34e4be[_0x5454f8[_0x13ced8][_0x2ea1('0x6c')]],'%s',_0xf36107):_0xf36107;if(_0x5454f8[_0x13ced8][_0x2ea1('0x6d')]){_0x5f2b42[_0x2ea1('0x5c')](_0xf36107);}_0x5454f8[_0x13ced8]['orderBy']&&_0x5f2b42[_0x2ea1('0x34')](_0xf36107,_0x5454f8[_0x13ced8][_0x2ea1('0x6e')]===_0x2ea1('0x6f')?![]:!![]);_0x5f2b42[_0x2ea1('0x5d')](_0xf36107,_0x5454f8[_0x13ced8][_0x2ea1('0x70')]||_0xf36107);}if(_0x3c48ce[_0x2ea1('0x71')]){_0x3c48ce[_0x2ea1('0x71')]=JSON[_0x2ea1('0x72')](_0x3c48ce['joins']);for(var _0x4810ed=0x0;_0x4810ed<_0x3c48ce[_0x2ea1('0x71')][_0x2ea1('0x32')];_0x4810ed+=0x1){if(_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x2c')]&&_[_0x2ea1('0x57')](_0x6e2f44,_0x3c48ce[_0x2ea1('0x71')][_0x4810ed]['type'])&&_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x73')]&&_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x74')]&&_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x76')]){_0x5f2b42[_0x3c48ce['joins'][_0x4810ed][_0x2ea1('0x2c')]](_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x74')],null,util[_0x2ea1('0x6c')](_0x2ea1('0x75'),_0x3c48ce['table'],_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x73')],_0x3c48ce['joins'][_0x4810ed][_0x2ea1('0x74')],_0x3c48ce[_0x2ea1('0x71')][_0x4810ed]['foreignKey']));}}}if(_0x3c48ce[_0x2ea1('0x77')]){_0x3c48ce[_0x2ea1('0x77')]=JSON[_0x2ea1('0x72')](_0x3c48ce['conditions']);_0x5f2b42[_0x2ea1('0x37')](_0x2796fb(_0x3c48ce[_0x2ea1('0x77')]['group']));}_0x41a4ac=_0x5f2b42[_0x2ea1('0x85')]();_0x5f2b42[_0x2ea1('0x1b')](_0x548f82);_0x5f2b42[_0x2ea1('0x18')](0x0);return;}})[_0x2ea1('0x20')](function(){if(_0x2e585b['output']===_0x2ea1('0x86')){return null;}var _0xc5908c=_[_0x2ea1('0x38')](_0x2e585b,{'name':_0x2e585b['fullPath']||_0x2e585b[_0x2ea1('0x26')]||_0x3c48ce[_0x2ea1('0x26')],'basename':_0x4e7a51,'savename':util['format']('%s-%s.%s',_0x2e585b[_0x2ea1('0x26')]||_0x3c48ce[_0x2ea1('0x26')],require(_0x2ea1('0x87'))[_0x2ea1('0x88')](0x4),_0x2e585b[_0x2ea1('0x89')]||_0x2ea1('0x8a')),'reportId':_0x3c48ce['id'],'reportType':_0x2ea1('0x8b')});return db[_0x2ea1('0x8c')]['create'](_0xc5908c,{'raw':!![]});})[_0x2ea1('0x20')](function(_0x460b19){if(_0x3c48ce[_0x2ea1('0x67')]==='cdr'){_0x41a4ac[_0x2ea1('0x37')](_0x3c48ce[_0x2ea1('0x67')]+_0x2ea1('0x8d'),_0x2e585b['startDate'],_0x2e585b[_0x2ea1('0x8e')]);}else{_0x41a4ac[_0x2ea1('0x37')](_0x3c48ce[_0x2ea1('0x67')]+_0x2ea1('0x8f'),_0x2e585b['startDate'],_0x2e585b['endDate']);}if(_0x460b19){logger[_0x2ea1('0x90')](_0x2ea1('0x91'),_0x41a4ac['toString']());require(_0x2ea1('0x92'))[_0x2ea1('0x93')](path[_0x2ea1('0x4b')](__dirname,_0x2ea1('0x94'),_0x460b19[_0x2ea1('0x89')]),[_0x460b19['id'],_0x41a4ac[_0x2ea1('0x7a')](),path[_0x2ea1('0x4b')](__dirname,_0x2ea1('0x95'),_0x460b19[_0x2ea1('0x96')]),_0x4e7a51]);return _0x460b19;}else{var _0x383137=squel[_0x2ea1('0x66')]();_0x383137['from']('('+_0x41a4ac[_0x2ea1('0x7a')]()+')','countTable');_0x383137['field']('COUNT(*)','count');_0x41a4ac[_0x2ea1('0x1b')](_0x2e585b[_0x2ea1('0x1b')]||_0x548f82);_0x41a4ac[_0x2ea1('0x18')](_0x2e585b[_0x2ea1('0x18')]||0x0);return dbH['sequelize']['query'](_0x383137[_0x2ea1('0x7a')](),{'type':dbH['sequelize'][_0x2ea1('0x7c')][_0x2ea1('0x7d')]})[_0x2ea1('0x20')](function(_0x49e23d){if(!_0x49e23d[_0x2ea1('0x32')]){_0x32ca6a=0x0;}else{_0x32ca6a=_0x49e23d[0x0][_0x2ea1('0x1a')]||0x0;}return dbH[_0x2ea1('0x7b')][_0x2ea1('0x2f')](_0x41a4ac['toString'](),{'type':dbH[_0x2ea1('0x7b')][_0x2ea1('0x7c')][_0x2ea1('0x7d')]});})[_0x2ea1('0x20')](function(_0x4da2dd){return{'rows':_0x4da2dd||[],'count':_0x32ca6a};});}});}exports['run']=function(_0x34e3b2,_0x583e53){return runReport(_0x34e3b2[_0x2ea1('0x3f')],_0x34e3b2[_0x2ea1('0x2f')],_0x34e3b2[_0x2ea1('0x3a')])[_0x2ea1('0x20')](respondWithResult(_0x583e53,null))[_0x2ea1('0x3e')](handleError(_0x583e53,null));};exports[_0x2ea1('0x97')]=runReport;exports[_0x2ea1('0x2f')]=function(_0x20b9fa,_0x383520){var _0x369d05=0xa;var _0xb09fd0=[_0x2ea1('0x4b'),_0x2ea1('0x4c'),_0x2ea1('0x7e'),_0x2ea1('0x4d')];var _0x5cc503={'SUM':_0x2ea1('0x4e'),'COUNT':_0x2ea1('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2ea1('0x50'),'MIN':_0x2ea1('0x51'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2ea1('0x53'),'GROUP_CONCAT ASC':_0x2ea1('0x54'),'GROUP_CONCAT DESC':_0x2ea1('0x7f')};var _0x308ea4={'SEC_TO_TIME':_0x2ea1('0x98'),'DATE':_0x2ea1('0x80'),'HOUR':_0x2ea1('0x55'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2ea1('0x56')};var _0x87dfb8=function(_0x755f57){return!_[_0x2ea1('0x57')](['IS\x20NULL',_0x2ea1('0x58'),_0x2ea1('0x59'),_0x2ea1('0x5a')],_0x755f57);};var _0x3db600=function(_0x2a4281){if(!_0x2a4281||!_0x2a4281['rules']['length']){return'';}for(var _0x18d7b2='(',_0x497880=0x0;_0x497880<_0x2a4281['rules'][_0x2ea1('0x32')];_0x497880+=0x1){_0x497880>0x0&&(_0x18d7b2+='\x20'+_0x2a4281['operator']+'\x20');_0x18d7b2+=_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5c')]?_0x3db600(_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5c')]):_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5d')]+'\x20'+_0x2a4281['rules'][_0x497880][_0x2ea1('0x5e')]+(_0x87dfb8(_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5e')])?'\x20'+_0x2a4281['rules'][_0x497880][_0x2ea1('0x5f')]:'');}return _0x18d7b2+')';};var _0x7bec94={'where':{'id':_0x20b9fa[_0x2ea1('0x3f')]['id']}},_0x78af26,_0x45f7ab,_0x5675d8,_0x48b966,_0x38a13e;_0x7bec94=_[_0x2ea1('0x38')]({},_0x7bec94,_0x20b9fa[_0x2ea1('0x3a')]);return db[_0x2ea1('0x29')][_0x2ea1('0x49')](_0x7bec94)[_0x2ea1('0x20')](function(_0x1478dd){if(_0x1478dd){_0x78af26=_0x1478dd;return _0x1478dd[_0x2ea1('0x60')]();}return null;})['then'](function(_0x61dd47){if(_0x61dd47){if(!_0x61dd47[_0x2ea1('0x32')]){throw new db[(_0x2ea1('0x61'))]['ValidationErrorItem'](_0x2ea1('0x63'),0x193);}_0x45f7ab=_0x61dd47;return db[_0x2ea1('0x83')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x293e2a){if(_0x293e2a){_0x5675d8=_[_0x2ea1('0x65')](_0x293e2a,'id');var _0x4c9334;var _0xde0b00=squel[_0x2ea1('0x66')]();_0xde0b00[_0x2ea1('0x84')](_0x78af26[_0x2ea1('0x67')]);for(var _0x2ef063=0x0;_0x2ef063<_0x45f7ab['length'];_0x2ef063+=0x1){_0x4c9334=_0x45f7ab[_0x2ef063][_0x2ea1('0x68')]?_0x5675d8[_0x45f7ab[_0x2ef063]['MetricId']]['metric']:_0x45f7ab[_0x2ef063][_0x2ea1('0x5d')];_0x4c9334=_0x45f7ab[_0x2ef063][_0x2ea1('0x6a')]?_[_0x2ea1('0x6b')](_0x5cc503[_0x45f7ab[_0x2ef063][_0x2ea1('0x6a')]],'%s',_0x4c9334):_0x4c9334;_0x4c9334=_0x45f7ab[_0x2ef063][_0x2ea1('0x6c')]?_[_0x2ea1('0x6b')](_0x308ea4[_0x45f7ab[_0x2ef063][_0x2ea1('0x6c')]],'%s',_0x4c9334):_0x4c9334;if(_0x45f7ab[_0x2ef063]['groupBy']){_0xde0b00['group'](_0x4c9334);}_0x45f7ab[_0x2ef063][_0x2ea1('0x6e')]&&_0xde0b00[_0x2ea1('0x34')](_0x4c9334,_0x45f7ab[_0x2ef063][_0x2ea1('0x6e')]===_0x2ea1('0x6f')?![]:!![]);_0xde0b00[_0x2ea1('0x5d')](_0x4c9334,_0x45f7ab[_0x2ef063]['alias']||_0x4c9334);}if(_0x78af26[_0x2ea1('0x71')]){_0x78af26[_0x2ea1('0x71')]=JSON['parse'](_0x78af26[_0x2ea1('0x71')]);for(var _0x235c3a=0x0;_0x235c3a<_0x78af26[_0x2ea1('0x71')][_0x2ea1('0x32')];_0x235c3a+=0x1){if(_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x2c')]&&_[_0x2ea1('0x57')](_0xb09fd0,_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x2c')])&&_0x78af26['joins'][_0x235c3a]['parentKey']&&_0x78af26[_0x2ea1('0x71')][_0x235c3a]['foreignTable']&&_0x78af26['joins'][_0x235c3a][_0x2ea1('0x76')]){_0xde0b00[_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x2c')]](_0x78af26[_0x2ea1('0x71')][_0x235c3a]['foreignTable'],null,util[_0x2ea1('0x6c')](_0x2ea1('0x75'),_0x78af26[_0x2ea1('0x67')],_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x73')],_0x78af26['joins'][_0x235c3a][_0x2ea1('0x74')],_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x76')]));}}}if(_0x78af26[_0x2ea1('0x77')]){_0x78af26['conditions']=JSON[_0x2ea1('0x72')](_0x78af26[_0x2ea1('0x77')]);_0xde0b00[_0x2ea1('0x37')](_0x3db600(_0x78af26[_0x2ea1('0x77')]['group']));}_0x38a13e=_0xde0b00[_0x2ea1('0x85')]();_0xde0b00[_0x2ea1('0x1b')](_0x369d05);_0xde0b00[_0x2ea1('0x18')](0x0);logger[_0x2ea1('0x78')](_0x2ea1('0x79'),_0xde0b00['toString']());return dbH[_0x2ea1('0x7b')]['query'](_0xde0b00['toString'](),{'type':dbH[_0x2ea1('0x7b')][_0x2ea1('0x7c')][_0x2ea1('0x7d')]});}})[_0x2ea1('0x20')](function(){return{'sql':_0x38a13e['toString']()};})[_0x2ea1('0x20')](respondWithResult(_0x383520,null))['catch'](handleError(_0x383520,null));};
\ No newline at end of file
index 78e0b2d..990f6bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b8=['path','rimraf','exports','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd7b8,0x102));var _0x8d7b=function(_0x384cc2,_0x225e73){_0x384cc2=_0x384cc2-0x0;var _0x3cb452=_0xd7b8[_0x384cc2];return _0x3cb452;};'use strict';var _=require(_0x8d7b('0x0'));var util=require(_0x8d7b('0x1'));var logger=require('../../config/logger')(_0x8d7b('0x2'));var moment=require(_0x8d7b('0x3'));var BPromise=require(_0x8d7b('0x4'));var rp=require(_0x8d7b('0x5'));var fs=require('fs');var path=require(_0x8d7b('0x6'));var rimraf=require(_0x8d7b('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x8d7b('0x8')]=function(_0x340b14,_0x379650){return _0x340b14[_0x8d7b('0x9')](_0x8d7b('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4347=['path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x6eb02d,_0x20bdf5){var _0xb756de=function(_0x18fef2){while(--_0x18fef2){_0x6eb02d['push'](_0x6eb02d['shift']());}};_0xb756de(++_0x20bdf5);}(_0x4347,0x97));var _0x7434=function(_0xfe8790,_0x1e1172){_0xfe8790=_0xfe8790-0x0;var _0x443355=_0x4347[_0xfe8790];return _0x443355;};'use strict';var _=require(_0x7434('0x0'));var util=require('util');var logger=require(_0x7434('0x1'))('api');var moment=require(_0x7434('0x2'));var BPromise=require(_0x7434('0x3'));var rp=require(_0x7434('0x4'));var fs=require('fs');var path=require(_0x7434('0x5'));var rimraf=require('rimraf');var config=require(_0x7434('0x6'));var attributes=require(_0x7434('0x7'));module[_0x7434('0x8')]=function(_0x5ef568,_0x3c215f){return _0x5ef568[_0x7434('0x9')](_0x7434('0xa'),attributes,{'tableName':_0x7434('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26ee172..ebcad26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a49=['request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x2da80f,_0x420bb3){var _0xb9417e=function(_0x58baab){while(--_0x58baab){_0x2da80f['push'](_0x2da80f['shift']());}};_0xb9417e(++_0x420bb3);}(_0x3a49,0xc0));var _0x93a4=function(_0x18ea62,_0x3c4611){_0x18ea62=_0x18ea62-0x0;var _0x568c9c=_0x3a49[_0x18ea62];return _0x568c9c;};'use strict';var _=require(_0x93a4('0x0'));var util=require(_0x93a4('0x1'));var moment=require(_0x93a4('0x2'));var BPromise=require('bluebird');var rs=require(_0x93a4('0x3'));var fs=require('fs');var Redis=require(_0x93a4('0x4'));var db=require(_0x93a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x93a4('0x6'))(_0x93a4('0x7'));var config=require(_0x93a4('0x8'));var jayson=require(_0x93a4('0x9'));var client=jayson[_0x93a4('0xa')][_0x93a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c849d,_0xc3267b,_0x3acbf8){return new BPromise(function(_0x4a4a57,_0xc0b832){return client[_0x93a4('0xc')](_0x3c849d,_0x3acbf8)['then'](function(_0x5d7778){logger[_0x93a4('0xd')](_0x93a4('0xe'),_0xc3267b,_0x93a4('0xf'));logger['debug'](_0x93a4('0x10'),_0xc3267b,_0x93a4('0xf'),JSON[_0x93a4('0x11')](_0x5d7778));if(_0x5d7778['error']){if(_0x5d7778['error'][_0x93a4('0x12')]===0x1f4){logger[_0x93a4('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc3267b,_0x5d7778[_0x93a4('0x13')][_0x93a4('0x14')]);return _0xc0b832(_0x5d7778['error'][_0x93a4('0x14')]);}logger[_0x93a4('0x13')](_0x93a4('0xe'),_0xc3267b,_0x5d7778['error'][_0x93a4('0x14')]);return _0x4a4a57(_0x5d7778[_0x93a4('0x13')][_0x93a4('0x14')]);}else{logger[_0x93a4('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc3267b,'request\x20sent');_0x4a4a57(_0x5d7778[_0x93a4('0x15')]['message']);}})[_0x93a4('0x16')](function(_0x4129fe){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xc3267b,_0x4129fe);_0xc0b832(_0x4129fe);});});}
\ No newline at end of file
+var _0x62f2=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4fd2d1,_0x43f306){var _0x564564=function(_0x54121a){while(--_0x54121a){_0x4fd2d1['push'](_0x4fd2d1['shift']());}};_0x564564(++_0x43f306);}(_0x62f2,0x11e));var _0x262f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x62f2[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x262f('0x0'));var util=require(_0x262f('0x1'));var moment=require(_0x262f('0x2'));var BPromise=require('bluebird');var rs=require(_0x262f('0x3'));var fs=require('fs');var Redis=require(_0x262f('0x4'));var db=require(_0x262f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x262f('0x6'))(_0x262f('0x7'));var config=require(_0x262f('0x8'));var jayson=require(_0x262f('0x9'));var client=jayson[_0x262f('0xa')][_0x262f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12f4b8,_0x40f0e0,_0x2b117f){return new BPromise(function(_0x389945,_0x3f8473){return client[_0x262f('0xc')](_0x12f4b8,_0x2b117f)[_0x262f('0xd')](function(_0x16933c){logger[_0x262f('0xe')](_0x262f('0xf'),_0x40f0e0,'request\x20sent');logger[_0x262f('0x10')](_0x262f('0x11'),_0x40f0e0,_0x262f('0x12'),JSON[_0x262f('0x13')](_0x16933c));if(_0x16933c[_0x262f('0x14')]){if(_0x16933c[_0x262f('0x14')][_0x262f('0x15')]===0x1f4){logger[_0x262f('0x14')](_0x262f('0xf'),_0x40f0e0,_0x16933c[_0x262f('0x14')][_0x262f('0x16')]);return _0x3f8473(_0x16933c['error'][_0x262f('0x16')]);}logger['error'](_0x262f('0xf'),_0x40f0e0,_0x16933c[_0x262f('0x14')][_0x262f('0x16')]);return _0x389945(_0x16933c[_0x262f('0x14')]['message']);}else{logger[_0x262f('0xe')](_0x262f('0xf'),_0x40f0e0,_0x262f('0x12'));_0x389945(_0x16933c[_0x262f('0x17')]['message']);}})[_0x262f('0x18')](function(_0x49a79b){logger[_0x262f('0x14')](_0x262f('0xf'),_0x40f0e0,_0x49a79b);_0x3f8473(_0x49a79b);});});}
\ No newline at end of file
index ba7a14b..d2e12c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7581=['put','update','destroy','util','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','/:id/run','/:id/query','query','post','create'];(function(_0x4d1760,_0x47c103){var _0x5ee388=function(_0x469f2c){while(--_0x469f2c){_0x4d1760['push'](_0x4d1760['shift']());}};_0x5ee388(++_0x47c103);}(_0x7581,0x8f));var _0x1758=function(_0x48e723,_0x34a5e9){_0x48e723=_0x48e723-0x0;var _0x1c0ee2=_0x7581[_0x48e723];return _0x1c0ee2;};'use strict';var multer=require('multer');var util=require(_0x1758('0x0'));var path=require('path');var timeout=require(_0x1758('0x1'));var express=require(_0x1758('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1758('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1758('0x4'));var controller=require(_0x1758('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x1758('0x6')]);router[_0x1758('0x7')](_0x1758('0x8'),auth[_0x1758('0x9')](),controller[_0x1758('0xa')]);router['get'](_0x1758('0xb'),auth[_0x1758('0x9')](),controller['preview']);router[_0x1758('0x7')](_0x1758('0xc'),auth[_0x1758('0x9')](),controller['run']);router['get'](_0x1758('0xd'),auth[_0x1758('0x9')](),controller[_0x1758('0xe')]);router[_0x1758('0xf')]('/',auth[_0x1758('0x9')](),controller[_0x1758('0x10')]);router[_0x1758('0x11')]('/:id',auth[_0x1758('0x9')](),controller[_0x1758('0x12')]);router['delete'](_0x1758('0x8'),auth[_0x1758('0x9')](),controller[_0x1758('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xdfc9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','/:id/preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','express','Router'];(function(_0x1e6d07,_0x5ee49a){var _0x4ec616=function(_0x5b20cb){while(--_0x5b20cb){_0x1e6d07['push'](_0x1e6d07['shift']());}};_0x4ec616(++_0x5ee49a);}(_0xdfc9,0x103));var _0x9dfc=function(_0x140e7f,_0x5f50a7){_0x140e7f=_0x140e7f-0x0;var _0x39656b=_0xdfc9[_0x140e7f];return _0x39656b;};'use strict';var multer=require(_0x9dfc('0x0'));var util=require(_0x9dfc('0x1'));var path=require(_0x9dfc('0x2'));var timeout=require('connect-timeout');var express=require(_0x9dfc('0x3'));var router=express[_0x9dfc('0x4')]();var fs_extra=require(_0x9dfc('0x5'));var auth=require(_0x9dfc('0x6'));var interaction=require(_0x9dfc('0x7'));var config=require(_0x9dfc('0x8'));var controller=require(_0x9dfc('0x9'));router[_0x9dfc('0xa')]('/',auth['isAuthenticated'](),controller[_0x9dfc('0xb')]);router['get'](_0x9dfc('0xc'),auth[_0x9dfc('0xd')](),controller['show']);router[_0x9dfc('0xa')](_0x9dfc('0xe'),auth[_0x9dfc('0xd')](),controller['preview']);router[_0x9dfc('0xa')](_0x9dfc('0xf'),auth[_0x9dfc('0xd')](),controller['run']);router[_0x9dfc('0xa')](_0x9dfc('0x10'),auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x11')]);router[_0x9dfc('0x12')]('/',auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x13')]);router[_0x9dfc('0x14')](_0x9dfc('0xc'),auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x15')]);router[_0x9dfc('0x16')](_0x9dfc('0xc'),auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x17')]);module['exports']=router;
\ No newline at end of file
index 7524914..98435b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x1ae4c7,_0xc94382){var _0x290659=function(_0x58d055){while(--_0x58d055){_0x1ae4c7['push'](_0x1ae4c7['shift']());}};_0x290659(++_0xc94382);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x53f20e,_0x432ee6){_0x53f20e=_0x53f20e-0x0;var _0x46cab4=_0x9c5a[_0x53f20e];return _0x46cab4;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x2f2093,_0x9a1af9){var _0xa3289a=function(_0x2c291a){while(--_0x2c291a){_0x2f2093['push'](_0x2f2093['shift']());}};_0xa3289a(++_0x9a1af9);}(_0xabce,0x103));var _0xeabc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xabce[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
index c0a37d6..85b2c8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x34f470,_0x464db5){var _0x3ac6cd=function(_0x4a72be){while(--_0x4a72be){_0x34f470['push'](_0x34f470['shift']());}};_0x3ac6cd(++_0x464db5);}(_0x46ed,0x168));var _0xd46e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x46ed[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
+var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6d38[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
index 9916080..b59265f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95f3=['AnalyticDefaultReport','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x95f3,0x198));var _0x395f=function(_0xe5ddf,_0x435f31){_0xe5ddf=_0xe5ddf-0x0;var _0xb23604=_0x95f3[_0xe5ddf];return _0xb23604;};'use strict';var _=require('lodash');var util=require(_0x395f('0x0'));var logger=require(_0x395f('0x1'))('api');var moment=require(_0x395f('0x2'));var BPromise=require(_0x395f('0x3'));var rp=require(_0x395f('0x4'));var fs=require('fs');var path=require(_0x395f('0x5'));var rimraf=require(_0x395f('0x6'));var config=require(_0x395f('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x395f('0x8')]=function(_0x7fcf89,_0x209423){return _0x7fcf89[_0x395f('0x9')](_0x395f('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51b4=['moment','request-promise','path','rimraf','exports','define','lodash','util','../../config/logger'];(function(_0x131c48,_0x44c325){var _0xcba1aa=function(_0x2ced82){while(--_0x2ced82){_0x131c48['push'](_0x131c48['shift']());}};_0xcba1aa(++_0x44c325);}(_0x51b4,0xa8));var _0x451b=function(_0x3bde83,_0x3e6deb){_0x3bde83=_0x3bde83-0x0;var _0x158fc6=_0x51b4[_0x3bde83];return _0x158fc6;};'use strict';var _=require(_0x451b('0x0'));var util=require(_0x451b('0x1'));var logger=require(_0x451b('0x2'))('api');var moment=require(_0x451b('0x3'));var BPromise=require('bluebird');var rp=require(_0x451b('0x4'));var fs=require('fs');var path=require(_0x451b('0x5'));var rimraf=require(_0x451b('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x451b('0x7')]=function(_0x439f95,_0x1d8c5e){return _0x439f95[_0x451b('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 28c21d4..8b345d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0b3=['jayson/promise','client','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0xf3eb9,_0x225c4c){var _0x353601=function(_0x781c72){while(--_0x781c72){_0xf3eb9['push'](_0xf3eb9['shift']());}};_0x353601(++_0x225c4c);}(_0xc0b3,0x1d8));var _0x3c0b=function(_0x397c99,_0x21a0f2){_0x397c99=_0x397c99-0x0;var _0x47853c=_0xc0b3[_0x397c99];return _0x47853c;};'use strict';var _=require(_0x3c0b('0x0'));var util=require(_0x3c0b('0x1'));var moment=require(_0x3c0b('0x2'));var BPromise=require(_0x3c0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c0b('0x4'));var db=require(_0x3c0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c0b('0x6'))('rpc');var config=require(_0x3c0b('0x7'));var jayson=require(_0x3c0b('0x8'));var client=jayson[_0x3c0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cb9c6,_0x5c7c6b,_0x1d57b2){return new BPromise(function(_0x40c74c,_0x17cb00){return client[_0x3c0b('0xa')](_0x1cb9c6,_0x1d57b2)['then'](function(_0x52f4fc){logger['info'](_0x3c0b('0xb'),_0x5c7c6b,_0x3c0b('0xc'));logger[_0x3c0b('0xd')](_0x3c0b('0xe'),_0x5c7c6b,_0x3c0b('0xc'),JSON[_0x3c0b('0xf')](_0x52f4fc));if(_0x52f4fc[_0x3c0b('0x10')]){if(_0x52f4fc[_0x3c0b('0x10')]['code']===0x1f4){logger['error'](_0x3c0b('0xb'),_0x5c7c6b,_0x52f4fc['error'][_0x3c0b('0x11')]);return _0x17cb00(_0x52f4fc[_0x3c0b('0x10')][_0x3c0b('0x11')]);}logger[_0x3c0b('0x10')](_0x3c0b('0xb'),_0x5c7c6b,_0x52f4fc[_0x3c0b('0x10')]['message']);return _0x40c74c(_0x52f4fc[_0x3c0b('0x10')][_0x3c0b('0x11')]);}else{logger[_0x3c0b('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5c7c6b,'request\x20sent');_0x40c74c(_0x52f4fc[_0x3c0b('0x13')][_0x3c0b('0x11')]);}})['catch'](function(_0x51646e){logger[_0x3c0b('0x10')](_0x3c0b('0xb'),_0x5c7c6b,_0x51646e);_0x17cb00(_0x51646e);});});}
\ No newline at end of file
+var _0x9517=['../../config/environment','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x34cffb,_0x50d170){var _0x4f3ff3=function(_0x2044fc){while(--_0x2044fc){_0x34cffb['push'](_0x34cffb['shift']());}};_0x4f3ff3(++_0x50d170);}(_0x9517,0x177));var _0x7951=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9517[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7951('0x0'));var util=require('util');var moment=require(_0x7951('0x1'));var BPromise=require('bluebird');var rs=require(_0x7951('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7951('0x3'));var logger=require(_0x7951('0x4'))('rpc');var config=require(_0x7951('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7951('0x6')][_0x7951('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4804c1,_0x108541,_0x261d9f){return new BPromise(function(_0x4799b8,_0xb31e55){return client[_0x7951('0x8')](_0x4804c1,_0x261d9f)[_0x7951('0x9')](function(_0x2002b7){logger['info'](_0x7951('0xa'),_0x108541,_0x7951('0xb'));logger[_0x7951('0xc')](_0x7951('0xd'),_0x108541,_0x7951('0xb'),JSON[_0x7951('0xe')](_0x2002b7));if(_0x2002b7[_0x7951('0xf')]){if(_0x2002b7[_0x7951('0xf')][_0x7951('0x10')]===0x1f4){logger[_0x7951('0xf')](_0x7951('0xa'),_0x108541,_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);return _0xb31e55(_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);}logger[_0x7951('0xf')](_0x7951('0xa'),_0x108541,_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);return _0x4799b8(_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);}else{logger[_0x7951('0x12')](_0x7951('0xa'),_0x108541,_0x7951('0xb'));_0x4799b8(_0x2002b7[_0x7951('0x13')][_0x7951('0x11')]);}})['catch'](function(_0x3b53d5){logger[_0x7951('0xf')](_0x7951('0xa'),_0x108541,_0x3b53d5);_0xb31e55(_0x3b53d5);});});}
\ No newline at end of file
index b41b4d9..c09de92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e11=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','/:id','update','delete','destroy','exports','multer','path','express'];(function(_0x789179,_0x455e5f){var _0x10878f=function(_0x450629){while(--_0x450629){_0x789179['push'](_0x789179['shift']());}};_0x10878f(++_0x455e5f);}(_0x5e11,0x1a6));var _0x15e1=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x5e11[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0x15e1('0x0'));var util=require('util');var path=require(_0x15e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x15e1('0x2'));var router=express[_0x15e1('0x3')]();var fs_extra=require(_0x15e1('0x4'));var auth=require(_0x15e1('0x5'));var interaction=require(_0x15e1('0x6'));var config=require(_0x15e1('0x7'));var controller=require(_0x15e1('0x8'));router['get']('/',auth[_0x15e1('0x9')](),controller[_0x15e1('0xa')]);router[_0x15e1('0xb')]('/:id',auth[_0x15e1('0x9')](),controller[_0x15e1('0xc')]);router[_0x15e1('0xb')](_0x15e1('0xd'),auth['isAuthenticated'](),controller[_0x15e1('0xe')]);router['get'](_0x15e1('0xf'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x10')]);router['get'](_0x15e1('0x11'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x12')]);router['post']('/',auth[_0x15e1('0x9')](),controller[_0x15e1('0x13')]);router['put'](_0x15e1('0x14'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x15')]);router[_0x15e1('0x16')](_0x15e1('0x14'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x17')]);module[_0x15e1('0x18')]=router;
\ No newline at end of file
+var _0xc599=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','query','post','create'];(function(_0x54ffb6,_0x503f04){var _0x1ce6b2=function(_0x41351a){while(--_0x41351a){_0x54ffb6['push'](_0x54ffb6['shift']());}};_0x1ce6b2(++_0x503f04);}(_0xc599,0x123));var _0x9c59=function(_0x51be7f,_0xd159f3){_0x51be7f=_0x51be7f-0x0;var _0x58f88c=_0xc599[_0x51be7f];return _0x58f88c;};'use strict';var multer=require(_0x9c59('0x0'));var util=require(_0x9c59('0x1'));var path=require(_0x9c59('0x2'));var timeout=require(_0x9c59('0x3'));var express=require(_0x9c59('0x4'));var router=express[_0x9c59('0x5')]();var fs_extra=require(_0x9c59('0x6'));var auth=require(_0x9c59('0x7'));var interaction=require(_0x9c59('0x8'));var config=require('../../config/environment');var controller=require(_0x9c59('0x9'));router[_0x9c59('0xa')]('/',auth[_0x9c59('0xb')](),controller[_0x9c59('0xc')]);router[_0x9c59('0xa')](_0x9c59('0xd'),auth[_0x9c59('0xb')](),controller[_0x9c59('0xe')]);router[_0x9c59('0xa')](_0x9c59('0xf'),auth[_0x9c59('0xb')](),controller['preview']);router[_0x9c59('0xa')](_0x9c59('0x10'),auth[_0x9c59('0xb')](),controller['run']);router[_0x9c59('0xa')](_0x9c59('0x11'),auth['isAuthenticated'](),controller[_0x9c59('0x12')]);router[_0x9c59('0x13')]('/',auth['isAuthenticated'](),controller[_0x9c59('0x14')]);router['put'](_0x9c59('0xd'),auth[_0x9c59('0xb')](),controller[_0x9c59('0x15')]);router[_0x9c59('0x16')](_0x9c59('0xd'),auth[_0x9c59('0xb')](),controller['destroy']);module[_0x9c59('0x17')]=router;
\ No newline at end of file
index f3ddef8..5be4bd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa297=['sequelize','moment','exports','STRING','ENUM','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED'];(function(_0x43085b,_0x50aa9e){var _0x52e132=function(_0x3b60a7){while(--_0x3b60a7){_0x43085b['push'](_0x43085b['shift']());}};_0x52e132(++_0x50aa9e);}(_0xa297,0x1e1));var _0x7a29=function(_0x2cb79d,_0x13d34d){_0x2cb79d=_0x2cb79d-0x0;var _0x32dfdf=_0xa297[_0x2cb79d];return _0x32dfdf;};'use strict';var Sequelize=require(_0x7a29('0x0'));var moment=require(_0x7a29('0x1'));module[_0x7a29('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x7a29('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x7a29('0x4')]('csv',_0x7a29('0x5'),_0x7a29('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7a29('0x7')]},'status':{'type':Sequelize[_0x7a29('0x3')],'defaultValue':_0x7a29('0x8')},'type':{'type':Sequelize[_0x7a29('0x4')]('manual',_0x7a29('0x9')),'allowNull':![],'defaultValue':_0x7a29('0xa')},'reportId':{'type':Sequelize[_0x7a29('0xb')](0xb)[_0x7a29('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2de1=['UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER'];(function(_0x35084e,_0x471ceb){var _0x3eaf60=function(_0x132052){while(--_0x132052){_0x35084e['push'](_0x35084e['shift']());}};_0x3eaf60(++_0x471ceb);}(_0x2de1,0x1ed));var _0x12de=function(_0x3dcf96,_0x400d95){_0x3dcf96=_0x3dcf96-0x0;var _0x5e1126=_0x2de1[_0x3dcf96];return _0x5e1126;};'use strict';var Sequelize=require(_0x12de('0x0'));var moment=require('moment');module[_0x12de('0x1')]={'name':{'type':Sequelize[_0x12de('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x12de('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x12de('0x3')](_0x12de('0x4'),_0x12de('0x5'),_0x12de('0x6')),'allowNull':![],'defaultValue':_0x12de('0x4')},'savename':{'type':Sequelize[_0x12de('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x12de('0x7')]},'endDate':{'type':Sequelize[_0x12de('0x7')]},'status':{'type':Sequelize[_0x12de('0x2')],'defaultValue':_0x12de('0x8')},'type':{'type':Sequelize[_0x12de('0x3')](_0x12de('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x12de('0x9')},'reportId':{'type':Sequelize[_0x12de('0xa')](0xb)[_0x12de('0xb')]},'reportType':{'type':Sequelize[_0x12de('0x2')]}};
\ No newline at end of file
index 7af6504..6da5002 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45b5=['count','set','Content-Range','apply','then','ExtractedReports','destroy','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit'];(function(_0x88baaa,_0x23707f){var _0x177141=function(_0x466732){while(--_0x466732){_0x88baaa['push'](_0x88baaa['shift']());}};_0x177141(++_0x23707f);}(_0x45b5,0xfc));var _0x545b=function(_0x2d1230,_0x49456e){_0x2d1230=_0x2d1230-0x0;var _0x56bcb0=_0x45b5[_0x2d1230];return _0x56bcb0;};'use strict';var emlformat=require(_0x545b('0x0'));var rimraf=require(_0x545b('0x1'));var zipdir=require(_0x545b('0x2'));var jsonpatch=require(_0x545b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x545b('0x4'));var Mustache=require(_0x545b('0x5'));var util=require(_0x545b('0x6'));var path=require(_0x545b('0x7'));var sox=require(_0x545b('0x8'));var csv=require(_0x545b('0x9'));var ejs=require(_0x545b('0xa'));var fs=require('fs');var fs_extra=require(_0x545b('0xb'));var _=require(_0x545b('0xc'));var squel=require(_0x545b('0xd'));var crypto=require(_0x545b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x545b('0xf'));var toCsv=require(_0x545b('0x9'));var querystring=require(_0x545b('0x10'));var Papa=require(_0x545b('0x11'));var Redis=require(_0x545b('0x12'));var authService=require(_0x545b('0x13'));var qs=require(_0x545b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x545b('0x15'));var logger=require(_0x545b('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x545b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x155bb9,_0x41e737){_0x41e737=_0x41e737||0xcc;return function(_0x165329){if(_0x165329){return _0x155bb9[_0x545b('0x18')](_0x41e737);}return _0x155bb9[_0x545b('0x19')](_0x41e737)['end']();};}function respondWithResult(_0x41fb4d,_0x24aeaf){_0x24aeaf=_0x24aeaf||0xc8;return function(_0x42365e){if(_0x42365e){return _0x41fb4d[_0x545b('0x19')](_0x24aeaf)[_0x545b('0x1a')](_0x42365e);}};}function respondWithFilteredResult(_0xe7742c,_0x4b0bbd){return function(_0x26b74e){if(_0x26b74e){var _0x2fa49f=typeof _0x4b0bbd[_0x545b('0x1b')]===_0x545b('0x1c')&&typeof _0x4b0bbd[_0x545b('0x1d')]===_0x545b('0x1c');var _0x299178=_0x26b74e['count'];var _0x35e388=_0x2fa49f?0x0:_0x4b0bbd[_0x545b('0x1b')];var _0x3e079d=_0x2fa49f?_0x26b74e[_0x545b('0x1e')]:_0x4b0bbd['offset']+_0x4b0bbd[_0x545b('0x1d')];var _0x37eeeb;if(_0x3e079d>=_0x299178){_0x3e079d=_0x299178;_0x37eeeb=0xc8;}else{_0x37eeeb=0xce;}_0xe7742c[_0x545b('0x19')](_0x37eeeb);return _0xe7742c[_0x545b('0x1f')](_0x545b('0x20'),_0x35e388+'-'+_0x3e079d+'/'+_0x299178)[_0x545b('0x1a')](_0x26b74e);}return null;};}function patchUpdates(_0x152b6b){return function(_0x3c938f){try{jsonpatch[_0x545b('0x21')](_0x3c938f,_0x152b6b,!![]);}catch(_0x42cc7e){return BPromise['reject'](_0x42cc7e);}return _0x3c938f['save']();};}function saveUpdates(_0x490069,_0x1055f8){return function(_0x255f3d){if(_0x255f3d){return _0x255f3d['update'](_0x490069)[_0x545b('0x22')](function(_0x321733){return _0x321733;});}return null;};}function removeEntity(_0x333166,_0x2202c5){return function(_0x2140e5){if(_0x2140e5){return _0x2140e5['destroy']()[_0x545b('0x22')](function(){var _0x49123c=_0x2140e5['get']({'plain':!![]});var _0x453e1c=_0x545b('0x23');return db['UserProfileResource'][_0x545b('0x24')]({'where':{'type':_0x453e1c,'resourceId':_0x49123c['id']}})[_0x545b('0x22')](function(){return _0x2140e5;});})['then'](function(){_0x333166[_0x545b('0x19')](0xcc)[_0x545b('0x25')]();});}};}function handleEntityNotFound(_0x57393f,_0x155834){return function(_0x2e0473){if(!_0x2e0473){_0x57393f[_0x545b('0x18')](0x194);}return _0x2e0473;};}function handleError(_0x2bbd3a,_0x8fe2bb){_0x8fe2bb=_0x8fe2bb||0x1f4;return function(_0x128480){logger[_0x545b('0x26')](_0x128480[_0x545b('0x27')]);if(_0x128480[_0x545b('0x28')]){delete _0x128480['name'];}_0x2bbd3a[_0x545b('0x19')](_0x8fe2bb)[_0x545b('0x29')](_0x128480);};}exports[_0x545b('0x2a')]=function(_0x22ef0a,_0x21c93c){var _0x562dd3={},_0x41225b={},_0x393c39={'count':0x0,'rows':[]};var _0x22e1ee=_[_0x545b('0x2b')](db[_0x545b('0x2c')][_0x545b('0x2d')],function(_0x580c53){return{'name':_0x580c53['fieldName'],'type':_0x580c53[_0x545b('0x2e')][_0x545b('0x2f')]};});_0x41225b[_0x545b('0x30')]=_[_0x545b('0x2b')](_0x22e1ee,_0x545b('0x28'));_0x41225b[_0x545b('0x31')]=_[_0x545b('0x32')](_0x22ef0a[_0x545b('0x31')]);_0x41225b[_0x545b('0x33')]=_[_0x545b('0x34')](_0x41225b[_0x545b('0x30')],_0x41225b[_0x545b('0x31')]);_0x562dd3[_0x545b('0x35')]=_['intersection'](_0x41225b[_0x545b('0x30')],qs[_0x545b('0x36')](_0x22ef0a[_0x545b('0x31')][_0x545b('0x36')]));_0x562dd3[_0x545b('0x35')]=_0x562dd3['attributes'][_0x545b('0x37')]?_0x562dd3[_0x545b('0x35')]:_0x41225b[_0x545b('0x30')];if(!_0x22ef0a[_0x545b('0x31')][_0x545b('0x38')](_0x545b('0x39'))){_0x562dd3[_0x545b('0x1d')]=qs['limit'](_0x22ef0a[_0x545b('0x31')][_0x545b('0x1d')]);_0x562dd3['offset']=qs[_0x545b('0x1b')](_0x22ef0a['query']['offset']);}_0x562dd3[_0x545b('0x3a')]=qs[_0x545b('0x3b')](_0x22ef0a[_0x545b('0x31')]['sort']);_0x562dd3[_0x545b('0x3c')]=qs[_0x545b('0x33')](_['pick'](_0x22ef0a[_0x545b('0x31')],_0x41225b[_0x545b('0x33')]),_0x22e1ee);if(_0x22ef0a[_0x545b('0x31')][_0x545b('0x3d')]){_0x562dd3['where']=_[_0x545b('0x3e')](_0x562dd3[_0x545b('0x3c')],{'$or':_[_0x545b('0x2b')](_0x22e1ee,function(_0x549d41){if(_0x549d41[_0x545b('0x2e')]!==_0x545b('0x3f')){var _0x4af0e0={};_0x4af0e0[_0x549d41[_0x545b('0x28')]]={'$like':'%'+_0x22ef0a[_0x545b('0x31')][_0x545b('0x3d')]+'%'};return _0x4af0e0;}})});}_0x562dd3=_['merge']({},_0x562dd3,_0x22ef0a['options']);var _0x69b2ab={'where':_0x562dd3[_0x545b('0x3c')]};return db[_0x545b('0x2c')][_0x545b('0x1e')](_0x69b2ab)['then'](function(_0x2eb71a){_0x393c39[_0x545b('0x1e')]=_0x2eb71a;if(_0x22ef0a[_0x545b('0x31')][_0x545b('0x40')]){_0x562dd3['include']=[{'all':!![]}];}return db[_0x545b('0x2c')][_0x545b('0x41')](_0x562dd3);})[_0x545b('0x22')](function(_0x5c68e1){_0x393c39[_0x545b('0x42')]=_0x5c68e1;return _0x393c39;})[_0x545b('0x22')](respondWithFilteredResult(_0x21c93c,_0x562dd3))[_0x545b('0x43')](handleError(_0x21c93c,null));};exports[_0x545b('0x44')]=function(_0x47e849,_0x5e76db){var _0x3e75b5={'raw':!![],'where':{'id':_0x47e849['params']['id']}},_0x2e693c={};_0x2e693c['model']=_['keys'](db[_0x545b('0x2c')][_0x545b('0x2d')]);_0x2e693c[_0x545b('0x31')]=_[_0x545b('0x32')](_0x47e849[_0x545b('0x31')]);_0x2e693c[_0x545b('0x33')]=_[_0x545b('0x34')](_0x2e693c['model'],_0x2e693c[_0x545b('0x31')]);_0x3e75b5['attributes']=_[_0x545b('0x34')](_0x2e693c[_0x545b('0x30')],qs[_0x545b('0x36')](_0x47e849['query'][_0x545b('0x36')]));_0x3e75b5['attributes']=_0x3e75b5[_0x545b('0x35')][_0x545b('0x37')]?_0x3e75b5[_0x545b('0x35')]:_0x2e693c[_0x545b('0x30')];if(_0x47e849[_0x545b('0x31')][_0x545b('0x40')]){_0x3e75b5[_0x545b('0x45')]=[{'all':!![]}];}_0x3e75b5=_[_0x545b('0x3e')]({},_0x3e75b5,_0x47e849[_0x545b('0x46')]);return db[_0x545b('0x2c')][_0x545b('0x47')](_0x3e75b5)['then'](handleEntityNotFound(_0x5e76db,null))['then'](respondWithResult(_0x5e76db,null))[_0x545b('0x43')](handleError(_0x5e76db,null));};exports[_0x545b('0x48')]=function(_0x2f9cfb,_0x369968){return db[_0x545b('0x2c')][_0x545b('0x48')](_0x2f9cfb['body'],{})[_0x545b('0x22')](function(_0x3e5a94){var _0x4e90aa=_0x2f9cfb[_0x545b('0x49')]['get']({'plain':!![]});if(!_0x4e90aa)throw new Error(_0x545b('0x4a'));if(_0x4e90aa[_0x545b('0x4b')]===_0x545b('0x49')){var _0x53393c=_0x3e5a94['get']({'plain':!![]});var _0x5c3e8f=_0x545b('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x5c3e8f,'userProfileId':_0x4e90aa[_0x545b('0x4c')]},'raw':!![]})['then'](function(_0x387456){if(_0x387456&&_0x387456[_0x545b('0x4d')]===0x0){return db[_0x545b('0x4e')][_0x545b('0x48')]({'name':_0x53393c['name'],'resourceId':_0x53393c['id'],'type':_0x387456[_0x545b('0x28')],'sectionId':_0x387456['id']},{})[_0x545b('0x22')](function(){return _0x3e5a94;});}else{return _0x3e5a94;}})[_0x545b('0x43')](function(_0x583b9d){logger[_0x545b('0x26')](_0x545b('0x4f'),_0x583b9d);throw _0x583b9d;});}return _0x3e5a94;})[_0x545b('0x22')](respondWithResult(_0x369968,0xc9))['catch'](handleError(_0x369968,null));};exports['update']=function(_0x47d6fa,_0x581f6a){if(_0x47d6fa[_0x545b('0x50')]['id']){delete _0x47d6fa[_0x545b('0x50')]['id'];}return db[_0x545b('0x2c')][_0x545b('0x47')]({'where':{'id':_0x47d6fa[_0x545b('0x51')]['id']}})['then'](handleEntityNotFound(_0x581f6a,null))['then'](saveUpdates(_0x47d6fa['body'],null))[_0x545b('0x22')](respondWithResult(_0x581f6a,null))['catch'](handleError(_0x581f6a,null));};exports[_0x545b('0x24')]=function(_0x2b609f,_0xadbeaf){return db[_0x545b('0x2c')]['find']({'where':{'id':_0x2b609f[_0x545b('0x51')]['id']}})['then'](handleEntityNotFound(_0xadbeaf,null))[_0x545b('0x22')](removeEntity(_0xadbeaf,null))[_0x545b('0x43')](handleError(_0xadbeaf,null));};exports[_0x545b('0x52')]=function(_0x67b809,_0x1e0ac2,_0x2fe8f7){return db[_0x545b('0x2c')]['find']({'where':{'id':_0x67b809[_0x545b('0x51')]['id']},'attributes':['name',_0x545b('0x53'),_0x545b('0x54'),_0x545b('0x55')],'raw':!![]})[_0x545b('0x22')](handleEntityNotFound(_0x1e0ac2,null))[_0x545b('0x22')](function(_0x374695){if(_0x374695){if(!fs['existsSync'](path[_0x545b('0x56')](config[_0x545b('0x57')],_0x545b('0x58'),_0x374695[_0x545b('0x54')]))){throw new db[(_0x545b('0x59'))]['ValidationError'](_0x545b('0x5a'));}if(_0x67b809[_0x545b('0x31')][_0x545b('0x5b')]){return _0x1e0ac2[_0x545b('0x18')](0xc8);}return _0x1e0ac2[_0x545b('0x52')](path[_0x545b('0x56')](config[_0x545b('0x57')],_0x545b('0x58'),_0x374695[_0x545b('0x54')]),util['format'](_0x545b('0x5c'),_0x374695[_0x545b('0x53')]||_0x374695[_0x545b('0x28')],_0x374695['output'][_0x545b('0x5d')]()));}})[_0x545b('0x43')](handleError(_0x1e0ac2,null));};
\ No newline at end of file
+var _0xbf26=['options','includeAll','include','findAll','rows','catch','rawAttributes','create','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','AnalyticExtractedReport','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name'];(function(_0x220fd6,_0x3466b8){var _0x15f951=function(_0xd2802b){while(--_0xd2802b){_0x220fd6['push'](_0x220fd6['shift']());}};_0x15f951(++_0x3466b8);}(_0xbf26,0x1a4));var _0x6bf2=function(_0x2abec0,_0x480ff3){_0x2abec0=_0x2abec0-0x0;var _0x4bf548=_0xbf26[_0x2abec0];return _0x4bf548;};'use strict';var emlformat=require(_0x6bf2('0x0'));var rimraf=require(_0x6bf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6bf2('0x2'));var moment=require(_0x6bf2('0x3'));var BPromise=require(_0x6bf2('0x4'));var Mustache=require(_0x6bf2('0x5'));var util=require(_0x6bf2('0x6'));var path=require(_0x6bf2('0x7'));var sox=require(_0x6bf2('0x8'));var csv=require(_0x6bf2('0x9'));var ejs=require(_0x6bf2('0xa'));var fs=require('fs');var fs_extra=require(_0x6bf2('0xb'));var _=require(_0x6bf2('0xc'));var squel=require('squel');var crypto=require(_0x6bf2('0xd'));var jsforce=require(_0x6bf2('0xe'));var deskjs=require(_0x6bf2('0xf'));var toCsv=require(_0x6bf2('0x9'));var querystring=require(_0x6bf2('0x10'));var Papa=require(_0x6bf2('0x11'));var Redis=require(_0x6bf2('0x12'));var authService=require(_0x6bf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6bf2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bf2('0x15'))(_0x6bf2('0x16'));var utils=require(_0x6bf2('0x17'));var config=require(_0x6bf2('0x18'));var licenseUtil=require(_0x6bf2('0x19'));var db=require(_0x6bf2('0x1a'))['db'];function respondWithStatusCode(_0x22f88c,_0x48ed67){_0x48ed67=_0x48ed67||0xcc;return function(_0x34d48d){if(_0x34d48d){return _0x22f88c[_0x6bf2('0x1b')](_0x48ed67);}return _0x22f88c[_0x6bf2('0x1c')](_0x48ed67)[_0x6bf2('0x1d')]();};}function respondWithResult(_0xa24380,_0x10f63f){_0x10f63f=_0x10f63f||0xc8;return function(_0xfffb2d){if(_0xfffb2d){return _0xa24380[_0x6bf2('0x1c')](_0x10f63f)['json'](_0xfffb2d);}};}function respondWithFilteredResult(_0x36ab5c,_0x15a215){return function(_0x11abd5){if(_0x11abd5){var _0x371d02=typeof _0x15a215[_0x6bf2('0x1e')]===_0x6bf2('0x1f')&&typeof _0x15a215[_0x6bf2('0x20')]===_0x6bf2('0x1f');var _0x3ddbc4=_0x11abd5[_0x6bf2('0x21')];var _0x3102f6=_0x371d02?0x0:_0x15a215['offset'];var _0x2e7912=_0x371d02?_0x11abd5[_0x6bf2('0x21')]:_0x15a215[_0x6bf2('0x1e')]+_0x15a215[_0x6bf2('0x20')];var _0x3c2442;if(_0x2e7912>=_0x3ddbc4){_0x2e7912=_0x3ddbc4;_0x3c2442=0xc8;}else{_0x3c2442=0xce;}_0x36ab5c[_0x6bf2('0x1c')](_0x3c2442);return _0x36ab5c[_0x6bf2('0x22')](_0x6bf2('0x23'),_0x3102f6+'-'+_0x2e7912+'/'+_0x3ddbc4)[_0x6bf2('0x24')](_0x11abd5);}return null;};}function patchUpdates(_0x280506){return function(_0x511fe9){try{jsonpatch[_0x6bf2('0x25')](_0x511fe9,_0x280506,!![]);}catch(_0x22b095){return BPromise[_0x6bf2('0x26')](_0x22b095);}return _0x511fe9[_0x6bf2('0x27')]();};}function saveUpdates(_0x746e99,_0x217534){return function(_0x38b179){if(_0x38b179){return _0x38b179[_0x6bf2('0x28')](_0x746e99)[_0x6bf2('0x29')](function(_0x3a4ad8){return _0x3a4ad8;});}return null;};}function removeEntity(_0x21f41e,_0x596828){return function(_0x1695e0){if(_0x1695e0){return _0x1695e0[_0x6bf2('0x2a')]()[_0x6bf2('0x29')](function(){var _0x458612=_0x1695e0[_0x6bf2('0x2b')]({'plain':!![]});var _0x4d627e='ExtractedReports';return db[_0x6bf2('0x2c')][_0x6bf2('0x2a')]({'where':{'type':_0x4d627e,'resourceId':_0x458612['id']}})[_0x6bf2('0x29')](function(){return _0x1695e0;});})[_0x6bf2('0x29')](function(){_0x21f41e[_0x6bf2('0x1c')](0xcc)[_0x6bf2('0x1d')]();});}};}function handleEntityNotFound(_0x31f042,_0x5f532c){return function(_0x3fae7a){if(!_0x3fae7a){_0x31f042['sendStatus'](0x194);}return _0x3fae7a;};}function handleError(_0x15cd5a,_0x6410a8){_0x6410a8=_0x6410a8||0x1f4;return function(_0x2c451d){logger[_0x6bf2('0x2d')](_0x2c451d[_0x6bf2('0x2e')]);if(_0x2c451d['name']){delete _0x2c451d['name'];}_0x15cd5a[_0x6bf2('0x1c')](_0x6410a8)[_0x6bf2('0x2f')](_0x2c451d);};}exports[_0x6bf2('0x30')]=function(_0x143c3e,_0x12d632){var _0x4a8410={},_0x5b83e7={},_0x4f7ccd={'count':0x0,'rows':[]};var _0x629c0f=_[_0x6bf2('0x31')](db[_0x6bf2('0x32')]['rawAttributes'],function(_0x23092d){return{'name':_0x23092d['fieldName'],'type':_0x23092d[_0x6bf2('0x33')]['key']};});_0x5b83e7[_0x6bf2('0x34')]=_[_0x6bf2('0x31')](_0x629c0f,'name');_0x5b83e7[_0x6bf2('0x35')]=_[_0x6bf2('0x36')](_0x143c3e['query']);_0x5b83e7[_0x6bf2('0x37')]=_[_0x6bf2('0x38')](_0x5b83e7[_0x6bf2('0x34')],_0x5b83e7[_0x6bf2('0x35')]);_0x4a8410[_0x6bf2('0x39')]=_[_0x6bf2('0x38')](_0x5b83e7[_0x6bf2('0x34')],qs[_0x6bf2('0x3a')](_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x3a')]));_0x4a8410[_0x6bf2('0x39')]=_0x4a8410[_0x6bf2('0x39')][_0x6bf2('0x3b')]?_0x4a8410[_0x6bf2('0x39')]:_0x5b83e7[_0x6bf2('0x34')];if(!_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x3c')](_0x6bf2('0x3d'))){_0x4a8410[_0x6bf2('0x20')]=qs[_0x6bf2('0x20')](_0x143c3e['query'][_0x6bf2('0x20')]);_0x4a8410['offset']=qs[_0x6bf2('0x1e')](_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x1e')]);}_0x4a8410[_0x6bf2('0x3e')]=qs[_0x6bf2('0x3f')](_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x3f')]);_0x4a8410['where']=qs[_0x6bf2('0x37')](_[_0x6bf2('0x40')](_0x143c3e[_0x6bf2('0x35')],_0x5b83e7[_0x6bf2('0x37')]),_0x629c0f);if(_0x143c3e['query'][_0x6bf2('0x41')]){_0x4a8410[_0x6bf2('0x42')]=_[_0x6bf2('0x43')](_0x4a8410[_0x6bf2('0x42')],{'$or':_[_0x6bf2('0x31')](_0x629c0f,function(_0x197ec6){if(_0x197ec6['type']!==_0x6bf2('0x44')){var _0xfe99b8={};_0xfe99b8[_0x197ec6[_0x6bf2('0x45')]]={'$like':'%'+_0x143c3e['query'][_0x6bf2('0x41')]+'%'};return _0xfe99b8;}})});}_0x4a8410=_['merge']({},_0x4a8410,_0x143c3e[_0x6bf2('0x46')]);var _0x5f503d={'where':_0x4a8410[_0x6bf2('0x42')]};return db[_0x6bf2('0x32')][_0x6bf2('0x21')](_0x5f503d)['then'](function(_0x3984c6){_0x4f7ccd[_0x6bf2('0x21')]=_0x3984c6;if(_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x47')]){_0x4a8410[_0x6bf2('0x48')]=[{'all':!![]}];}return db[_0x6bf2('0x32')][_0x6bf2('0x49')](_0x4a8410);})['then'](function(_0x13e27d){_0x4f7ccd[_0x6bf2('0x4a')]=_0x13e27d;return _0x4f7ccd;})[_0x6bf2('0x29')](respondWithFilteredResult(_0x12d632,_0x4a8410))[_0x6bf2('0x4b')](handleError(_0x12d632,null));};exports['show']=function(_0x47b56c,_0x1d06fb){var _0x3f57d5={'raw':!![],'where':{'id':_0x47b56c['params']['id']}},_0x1a745c={};_0x1a745c['model']=_[_0x6bf2('0x36')](db[_0x6bf2('0x32')][_0x6bf2('0x4c')]);_0x1a745c[_0x6bf2('0x35')]=_[_0x6bf2('0x36')](_0x47b56c[_0x6bf2('0x35')]);_0x1a745c['filters']=_[_0x6bf2('0x38')](_0x1a745c[_0x6bf2('0x34')],_0x1a745c[_0x6bf2('0x35')]);_0x3f57d5['attributes']=_['intersection'](_0x1a745c[_0x6bf2('0x34')],qs[_0x6bf2('0x3a')](_0x47b56c[_0x6bf2('0x35')]['fields']));_0x3f57d5[_0x6bf2('0x39')]=_0x3f57d5[_0x6bf2('0x39')][_0x6bf2('0x3b')]?_0x3f57d5[_0x6bf2('0x39')]:_0x1a745c[_0x6bf2('0x34')];if(_0x47b56c[_0x6bf2('0x35')][_0x6bf2('0x47')]){_0x3f57d5['include']=[{'all':!![]}];}_0x3f57d5=_['merge']({},_0x3f57d5,_0x47b56c[_0x6bf2('0x46')]);return db[_0x6bf2('0x32')]['find'](_0x3f57d5)[_0x6bf2('0x29')](handleEntityNotFound(_0x1d06fb,null))[_0x6bf2('0x29')](respondWithResult(_0x1d06fb,null))[_0x6bf2('0x4b')](handleError(_0x1d06fb,null));};exports[_0x6bf2('0x4d')]=function(_0x4ad030,_0x28cb8f){return db['AnalyticExtractedReport'][_0x6bf2('0x4d')](_0x4ad030['body'],{})['then'](function(_0x15b526){var _0x1d0d2f=_0x4ad030[_0x6bf2('0x4e')]['get']({'plain':!![]});if(!_0x1d0d2f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d0d2f['role']===_0x6bf2('0x4e')){var _0x24bc3e=_0x15b526[_0x6bf2('0x2b')]({'plain':!![]});var _0x4b1f10='ExtractedReports';return db[_0x6bf2('0x4f')][_0x6bf2('0x50')]({'where':{'name':_0x4b1f10,'userProfileId':_0x1d0d2f[_0x6bf2('0x51')]},'raw':!![]})['then'](function(_0x1aa8bb){if(_0x1aa8bb&&_0x1aa8bb[_0x6bf2('0x52')]===0x0){return db[_0x6bf2('0x2c')][_0x6bf2('0x4d')]({'name':_0x24bc3e['name'],'resourceId':_0x24bc3e['id'],'type':_0x1aa8bb[_0x6bf2('0x45')],'sectionId':_0x1aa8bb['id']},{})['then'](function(){return _0x15b526;});}else{return _0x15b526;}})[_0x6bf2('0x4b')](function(_0x59167f){logger[_0x6bf2('0x2d')](_0x6bf2('0x53'),_0x59167f);throw _0x59167f;});}return _0x15b526;})[_0x6bf2('0x29')](respondWithResult(_0x28cb8f,0xc9))['catch'](handleError(_0x28cb8f,null));};exports['update']=function(_0x396699,_0x56064a){if(_0x396699[_0x6bf2('0x54')]['id']){delete _0x396699[_0x6bf2('0x54')]['id'];}return db[_0x6bf2('0x32')][_0x6bf2('0x50')]({'where':{'id':_0x396699['params']['id']}})[_0x6bf2('0x29')](handleEntityNotFound(_0x56064a,null))[_0x6bf2('0x29')](saveUpdates(_0x396699[_0x6bf2('0x54')],null))[_0x6bf2('0x29')](respondWithResult(_0x56064a,null))[_0x6bf2('0x4b')](handleError(_0x56064a,null));};exports[_0x6bf2('0x2a')]=function(_0x98898f,_0x12a887){return db[_0x6bf2('0x32')][_0x6bf2('0x50')]({'where':{'id':_0x98898f[_0x6bf2('0x55')]['id']}})[_0x6bf2('0x29')](handleEntityNotFound(_0x12a887,null))['then'](removeEntity(_0x12a887,null))[_0x6bf2('0x4b')](handleError(_0x12a887,null));};exports['download']=function(_0x1c11c3,_0x55c046,_0x8c7669){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1c11c3[_0x6bf2('0x55')]['id']},'attributes':[_0x6bf2('0x45'),_0x6bf2('0x56'),_0x6bf2('0x57'),_0x6bf2('0x58')],'raw':!![]})[_0x6bf2('0x29')](handleEntityNotFound(_0x55c046,null))[_0x6bf2('0x29')](function(_0x11ef19){if(_0x11ef19){if(!fs[_0x6bf2('0x59')](path[_0x6bf2('0x5a')](config[_0x6bf2('0x5b')],'server/files/reports',_0x11ef19[_0x6bf2('0x57')]))){throw new db[(_0x6bf2('0x5c'))][(_0x6bf2('0x5d'))](_0x6bf2('0x5e'));}if(_0x1c11c3[_0x6bf2('0x35')][_0x6bf2('0x5f')]){return _0x55c046['sendStatus'](0xc8);}return _0x55c046[_0x6bf2('0x60')](path[_0x6bf2('0x5a')](config['root'],'server/files/reports',_0x11ef19[_0x6bf2('0x57')]),util[_0x6bf2('0x61')]('%s.%s',_0x11ef19[_0x6bf2('0x56')]||_0x11ef19['name'],_0x11ef19[_0x6bf2('0x58')]['toLowerCase']()));}})[_0x6bf2('0x4b')](handleError(_0x55c046,null));};
\ No newline at end of file
index 6aca402..0863c6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70df=['path','rimraf','../../config/environment','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c0b53,_0x34cdd3){var _0x48246a=function(_0x314dbc){while(--_0x314dbc){_0x3c0b53['push'](_0x3c0b53['shift']());}};_0x48246a(++_0x34cdd3);}(_0x70df,0x192));var _0xf70d=function(_0x2c8805,_0x320e32){_0x2c8805=_0x2c8805-0x0;var _0x31fd9f=_0x70df[_0x2c8805];return _0x31fd9f;};'use strict';var _=require('lodash');var util=require(_0xf70d('0x0'));var logger=require(_0xf70d('0x1'))(_0xf70d('0x2'));var moment=require(_0xf70d('0x3'));var BPromise=require(_0xf70d('0x4'));var rp=require(_0xf70d('0x5'));var fs=require('fs');var path=require(_0xf70d('0x6'));var rimraf=require(_0xf70d('0x7'));var config=require(_0xf70d('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf70d('0x9')]=function(_0x52d7d2,_0x9896c1){return _0x52d7d2[_0xf70d('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xf70d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x290d=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x36b072,_0xaf2687){var _0x32de4e=function(_0x197a30){while(--_0x197a30){_0x36b072['push'](_0x36b072['shift']());}};_0x32de4e(++_0xaf2687);}(_0x290d,0x177));var _0xd290=function(_0x3d201d,_0x4fb09b){_0x3d201d=_0x3d201d-0x0;var _0x53d923=_0x290d[_0x3d201d];return _0x53d923;};'use strict';var _=require(_0xd290('0x0'));var util=require('util');var logger=require(_0xd290('0x1'))(_0xd290('0x2'));var moment=require('moment');var BPromise=require(_0xd290('0x3'));var rp=require(_0xd290('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd290('0x5'));var config=require(_0xd290('0x6'));var attributes=require(_0xd290('0x7'));module[_0xd290('0x8')]=function(_0x4a45bb,_0x362cad){return _0x4a45bb[_0xd290('0x9')](_0xd290('0xa'),attributes,{'tableName':_0xd290('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 73ef17f..0c502cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x256e=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c1489,_0x167dfa){var _0xff0770=function(_0x1bbfa1){while(--_0x1bbfa1){_0x1c1489['push'](_0x1c1489['shift']());}};_0xff0770(++_0x167dfa);}(_0x256e,0x176));var _0xe256=function(_0x2d40b9,_0x2aa430){_0x2d40b9=_0x2d40b9-0x0;var _0x118c40=_0x256e[_0x2d40b9];return _0x118c40;};'use strict';var _=require(_0xe256('0x0'));var util=require(_0xe256('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe256('0x2'));var fs=require('fs');var Redis=require(_0xe256('0x3'));var db=require(_0xe256('0x4'))['db'];var utils=require(_0xe256('0x5'));var logger=require(_0xe256('0x6'))(_0xe256('0x7'));var config=require(_0xe256('0x8'));var jayson=require(_0xe256('0x9'));var client=jayson[_0xe256('0xa')][_0xe256('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdfe79,_0x1ee628,_0x3646d0){return new BPromise(function(_0x4e9e9a,_0x429fc0){return client['request'](_0xdfe79,_0x3646d0)[_0xe256('0xc')](function(_0x4ea116){logger[_0xe256('0xd')](_0xe256('0xe'),_0x1ee628,_0xe256('0xf'));logger[_0xe256('0x10')](_0xe256('0x11'),_0x1ee628,'request\x20sent',JSON[_0xe256('0x12')](_0x4ea116));if(_0x4ea116[_0xe256('0x13')]){if(_0x4ea116[_0xe256('0x13')]['code']===0x1f4){logger[_0xe256('0x13')](_0xe256('0xe'),_0x1ee628,_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);return _0x429fc0(_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);}logger[_0xe256('0x13')](_0xe256('0xe'),_0x1ee628,_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);return _0x4e9e9a(_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);}else{logger[_0xe256('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1ee628,'request\x20sent');_0x4e9e9a(_0x4ea116[_0xe256('0x15')][_0xe256('0x14')]);}})[_0xe256('0x16')](function(_0x4c8f05){logger[_0xe256('0x13')](_0xe256('0xe'),_0x1ee628,_0x4c8f05);_0x429fc0(_0x4c8f05);});});}
\ No newline at end of file
+var _0x5216=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x3fb2d4,_0x44a3a8){var _0x4cfd9a=function(_0x35f723){while(--_0x35f723){_0x3fb2d4['push'](_0x3fb2d4['shift']());}};_0x4cfd9a(++_0x44a3a8);}(_0x5216,0x165));var _0x6521=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5216[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x6521('0x0'));var moment=require(_0x6521('0x1'));var BPromise=require(_0x6521('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6521('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6521('0x4'))('rpc');var config=require(_0x6521('0x5'));var jayson=require(_0x6521('0x6'));var client=jayson['client'][_0x6521('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54ebf2,_0xb493b8,_0x570d63){return new BPromise(function(_0x359d3b,_0x375406){return client[_0x6521('0x8')](_0x54ebf2,_0x570d63)[_0x6521('0x9')](function(_0x594f32){logger[_0x6521('0xa')](_0x6521('0xb'),_0xb493b8,_0x6521('0xc'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xb493b8,_0x6521('0xc'),JSON[_0x6521('0xd')](_0x594f32));if(_0x594f32[_0x6521('0xe')]){if(_0x594f32[_0x6521('0xe')][_0x6521('0xf')]===0x1f4){logger[_0x6521('0xe')](_0x6521('0xb'),_0xb493b8,_0x594f32[_0x6521('0xe')][_0x6521('0x10')]);return _0x375406(_0x594f32[_0x6521('0xe')][_0x6521('0x10')]);}logger[_0x6521('0xe')](_0x6521('0xb'),_0xb493b8,_0x594f32['error'][_0x6521('0x10')]);return _0x359d3b(_0x594f32[_0x6521('0xe')][_0x6521('0x10')]);}else{logger[_0x6521('0xa')](_0x6521('0xb'),_0xb493b8,_0x6521('0xc'));_0x359d3b(_0x594f32[_0x6521('0x11')][_0x6521('0x10')]);}})[_0x6521('0x12')](function(_0x42faab){logger[_0x6521('0xe')](_0x6521('0xb'),_0xb493b8,_0x42faab);_0x375406(_0x42faab);});});}
\ No newline at end of file
index 1ad3a9f..b47a8b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc775=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','exports','multer'];(function(_0x1fff57,_0x143cee){var _0x43cc66=function(_0x4e812d){while(--_0x4e812d){_0x1fff57['push'](_0x1fff57['shift']());}};_0x43cc66(++_0x143cee);}(_0xc775,0x1da));var _0x5c77=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc775[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x5c77('0x0'));var util=require(_0x5c77('0x1'));var path=require('path');var timeout=require(_0x5c77('0x2'));var express=require(_0x5c77('0x3'));var router=express[_0x5c77('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5c77('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5c77('0x6'));var controller=require(_0x5c77('0x7'));router[_0x5c77('0x8')]('/',auth[_0x5c77('0x9')](),controller[_0x5c77('0xa')]);router['get'](_0x5c77('0xb'),auth[_0x5c77('0x9')](),controller[_0x5c77('0xc')]);router['get'](_0x5c77('0xd'),auth[_0x5c77('0x9')](),controller[_0x5c77('0xe')]);router[_0x5c77('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5c77('0x10')](_0x5c77('0xb'),auth['isAuthenticated'](),controller[_0x5c77('0x11')]);router['delete'](_0x5c77('0xb'),auth[_0x5c77('0x9')](),controller['destroy']);module[_0x5c77('0x12')]=router;
\ No newline at end of file
+var _0xe430=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24e056,_0x257d1a){var _0x57b6ea=function(_0x2c9843){while(--_0x2c9843){_0x24e056['push'](_0x24e056['shift']());}};_0x57b6ea(++_0x257d1a);}(_0xe430,0x1da));var _0x0e43=function(_0x18edfe,_0x4060e1){_0x18edfe=_0x18edfe-0x0;var _0x31fabe=_0xe430[_0x18edfe];return _0x31fabe;};'use strict';var multer=require(_0x0e43('0x0'));var util=require(_0x0e43('0x1'));var path=require(_0x0e43('0x2'));var timeout=require(_0x0e43('0x3'));var express=require(_0x0e43('0x4'));var router=express[_0x0e43('0x5')]();var fs_extra=require(_0x0e43('0x6'));var auth=require(_0x0e43('0x7'));var interaction=require(_0x0e43('0x8'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x0e43('0x9')]('/',auth[_0x0e43('0xa')](),controller[_0x0e43('0xb')]);router[_0x0e43('0x9')](_0x0e43('0xc'),auth['isAuthenticated'](),controller[_0x0e43('0xd')]);router[_0x0e43('0x9')](_0x0e43('0xe'),auth[_0x0e43('0xa')](),controller[_0x0e43('0xf')]);router[_0x0e43('0x10')]('/',auth[_0x0e43('0xa')](),controller[_0x0e43('0x11')]);router[_0x0e43('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0e43('0x13')]);router[_0x0e43('0x14')]('/:id',auth[_0x0e43('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index cdc0681..a8dabe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4bf=['TEXT','STRING','sequelize','exports'];(function(_0x24e73d,_0x4ae5c9){var _0x1a2199=function(_0x2c0c34){while(--_0x2c0c34){_0x24e73d['push'](_0x24e73d['shift']());}};_0x1a2199(++_0x4ae5c9);}(_0xa4bf,0x6a));var _0xfa4b=function(_0xc7a0cb,_0x389964){_0xc7a0cb=_0xc7a0cb-0x0;var _0x10ce8e=_0xa4bf[_0xc7a0cb];return _0x10ce8e;};'use strict';var Sequelize=require(_0xfa4b('0x0'));module[_0xfa4b('0x1')]={'field':{'type':Sequelize[_0xfa4b('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xfa4b('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfa4b('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xebd8=['STRING','BOOLEAN','sequelize','exports'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xebd8,0xf2));var _0x8ebd=function(_0x5b7b11,_0x5833b0){_0x5b7b11=_0x5b7b11-0x0;var _0x31374a=_0xebd8[_0x5b7b11];return _0x31374a;};'use strict';var Sequelize=require(_0x8ebd('0x0'));module[_0x8ebd('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x8ebd('0x2')]},'groupBy':{'type':Sequelize[_0x8ebd('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8ebd('0x2')]},'custom':{'type':Sequelize[_0x8ebd('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 4a943ce..30e8317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x838c=['type','model','query','keys','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','filters','includeAll','find','catch','create','body','bulkCreate','params','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','map','AnalyticFieldReport','rawAttributes'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x838c,0xb1));var _0xc838=function(_0x37b35d,_0x405b32){_0x37b35d=_0x37b35d-0x0;var _0x5762f9=_0x838c[_0x37b35d];return _0x5762f9;};'use strict';var emlformat=require(_0xc838('0x0'));var rimraf=require(_0xc838('0x1'));var zipdir=require(_0xc838('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc838('0x3'));var Mustache=require('mustache');var util=require(_0xc838('0x4'));var path=require(_0xc838('0x5'));var sox=require(_0xc838('0x6'));var csv=require('to-csv');var ejs=require(_0xc838('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc838('0x8'));var squel=require('squel');var crypto=require(_0xc838('0x9'));var jsforce=require(_0xc838('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc838('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc838('0xc'));var as=require(_0xc838('0xd'));var hardwareService=require(_0xc838('0xe'));var logger=require(_0xc838('0xf'))(_0xc838('0x10'));var utils=require(_0xc838('0x11'));var config=require(_0xc838('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc838('0x13'))['db'];function respondWithStatusCode(_0x2607c6,_0x29bae6){_0x29bae6=_0x29bae6||0xcc;return function(_0x4ad5ed){if(_0x4ad5ed){return _0x2607c6[_0xc838('0x14')](_0x29bae6);}return _0x2607c6[_0xc838('0x15')](_0x29bae6)['end']();};}function respondWithResult(_0x3c5c98,_0x739d51){_0x739d51=_0x739d51||0xc8;return function(_0x17f902){if(_0x17f902){return _0x3c5c98[_0xc838('0x15')](_0x739d51)['json'](_0x17f902);}};}function respondWithFilteredResult(_0x102b29,_0x3ff8ae){return function(_0x937359){if(_0x937359){var _0x53ba92=typeof _0x3ff8ae['offset']===_0xc838('0x16')&&typeof _0x3ff8ae[_0xc838('0x17')]===_0xc838('0x16');var _0x5bfb71=_0x937359[_0xc838('0x18')];var _0x432537=_0x53ba92?0x0:_0x3ff8ae[_0xc838('0x19')];var _0x118cad=_0x53ba92?_0x937359['count']:_0x3ff8ae[_0xc838('0x19')]+_0x3ff8ae['limit'];var _0x45ad5b;if(_0x118cad>=_0x5bfb71){_0x118cad=_0x5bfb71;_0x45ad5b=0xc8;}else{_0x45ad5b=0xce;}_0x102b29[_0xc838('0x15')](_0x45ad5b);return _0x102b29[_0xc838('0x1a')](_0xc838('0x1b'),_0x432537+'-'+_0x118cad+'/'+_0x5bfb71)[_0xc838('0x1c')](_0x937359);}return null;};}function patchUpdates(_0x1cdbe3){return function(_0x1f22ea){try{jsonpatch[_0xc838('0x1d')](_0x1f22ea,_0x1cdbe3,!![]);}catch(_0x5e777e){return BPromise[_0xc838('0x1e')](_0x5e777e);}return _0x1f22ea[_0xc838('0x1f')]();};}function saveUpdates(_0x4af609,_0xe2c5a8){return function(_0x92e71e){if(_0x92e71e){return _0x92e71e['update'](_0x4af609)[_0xc838('0x20')](function(_0xb001ec){return _0xb001ec;});}return null;};}function removeEntity(_0x2725a2,_0x2d70af){return function(_0x3c39ac){if(_0x3c39ac){return _0x3c39ac[_0xc838('0x21')]()[_0xc838('0x20')](function(){_0x2725a2[_0xc838('0x15')](0xcc)[_0xc838('0x22')]();});}};}function handleEntityNotFound(_0xd613fb,_0x5880cb){return function(_0x37ba73){if(!_0x37ba73){_0xd613fb[_0xc838('0x14')](0x194);}return _0x37ba73;};}function handleError(_0x1b0452,_0x30391e){_0x30391e=_0x30391e||0x1f4;return function(_0xe4995f){logger[_0xc838('0x23')](_0xe4995f[_0xc838('0x24')]);if(_0xe4995f[_0xc838('0x25')]){delete _0xe4995f[_0xc838('0x25')];}_0x1b0452[_0xc838('0x15')](_0x30391e)[_0xc838('0x26')](_0xe4995f);};}exports['index']=function(_0x3f6a91,_0x42d5b6){var _0x1405fb={},_0x1fd114={},_0x17b560={'count':0x0,'rows':[]};var _0x147475=_[_0xc838('0x27')](db[_0xc838('0x28')][_0xc838('0x29')],function(_0x2fb217){return{'name':_0x2fb217['fieldName'],'type':_0x2fb217[_0xc838('0x2a')]['key']};});_0x1fd114[_0xc838('0x2b')]=_[_0xc838('0x27')](_0x147475,'name');_0x1fd114[_0xc838('0x2c')]=_[_0xc838('0x2d')](_0x3f6a91[_0xc838('0x2c')]);_0x1fd114['filters']=_[_0xc838('0x2e')](_0x1fd114[_0xc838('0x2b')],_0x1fd114[_0xc838('0x2c')]);_0x1405fb[_0xc838('0x2f')]=_[_0xc838('0x2e')](_0x1fd114[_0xc838('0x2b')],qs[_0xc838('0x30')](_0x3f6a91[_0xc838('0x2c')][_0xc838('0x30')]));_0x1405fb['attributes']=_0x1405fb[_0xc838('0x2f')][_0xc838('0x31')]?_0x1405fb[_0xc838('0x2f')]:_0x1fd114[_0xc838('0x2b')];if(!_0x3f6a91['query']['hasOwnProperty']('nolimit')){_0x1405fb[_0xc838('0x17')]=qs[_0xc838('0x17')](_0x3f6a91[_0xc838('0x2c')]['limit']);_0x1405fb['offset']=qs[_0xc838('0x19')](_0x3f6a91[_0xc838('0x2c')][_0xc838('0x19')]);}_0x1405fb[_0xc838('0x32')]=qs[_0xc838('0x33')](_0x3f6a91[_0xc838('0x2c')][_0xc838('0x33')]);_0x1405fb[_0xc838('0x34')]=qs['filters'](_[_0xc838('0x35')](_0x3f6a91[_0xc838('0x2c')],_0x1fd114['filters']),_0x147475);if(_0x3f6a91['query'][_0xc838('0x36')]){_0x1405fb[_0xc838('0x34')]=_[_0xc838('0x37')](_0x1405fb[_0xc838('0x34')],{'$or':_[_0xc838('0x27')](_0x147475,function(_0x145336){if(_0x145336[_0xc838('0x2a')]!=='VIRTUAL'){var _0x2857f6={};_0x2857f6[_0x145336['name']]={'$like':'%'+_0x3f6a91[_0xc838('0x2c')][_0xc838('0x36')]+'%'};return _0x2857f6;}})});}_0x1405fb=_['merge']({},_0x1405fb,_0x3f6a91[_0xc838('0x38')]);var _0x123d6e={'where':_0x1405fb[_0xc838('0x34')]};return db[_0xc838('0x28')]['count'](_0x123d6e)[_0xc838('0x20')](function(_0x2733bc){_0x17b560['count']=_0x2733bc;if(_0x3f6a91['query']['includeAll']){_0x1405fb[_0xc838('0x39')]=[{'all':!![]}];}return db[_0xc838('0x28')][_0xc838('0x3a')](_0x1405fb);})[_0xc838('0x20')](function(_0xd0d81b){_0x17b560[_0xc838('0x3b')]=_0xd0d81b;return _0x17b560;})[_0xc838('0x20')](respondWithFilteredResult(_0x42d5b6,_0x1405fb))['catch'](handleError(_0x42d5b6,null));};exports[_0xc838('0x3c')]=function(_0x5825fd,_0x3006da){var _0x3ba16b={'raw':![],'where':{'id':_0x5825fd['params']['id']}},_0x567345={};_0x567345[_0xc838('0x2b')]=_['keys'](db[_0xc838('0x28')][_0xc838('0x29')]);_0x567345['query']=_['keys'](_0x5825fd['query']);_0x567345[_0xc838('0x3d')]=_['intersection'](_0x567345[_0xc838('0x2b')],_0x567345['query']);_0x3ba16b[_0xc838('0x2f')]=_[_0xc838('0x2e')](_0x567345[_0xc838('0x2b')],qs[_0xc838('0x30')](_0x5825fd[_0xc838('0x2c')][_0xc838('0x30')]));_0x3ba16b[_0xc838('0x2f')]=_0x3ba16b[_0xc838('0x2f')][_0xc838('0x31')]?_0x3ba16b[_0xc838('0x2f')]:_0x567345[_0xc838('0x2b')];if(_0x5825fd['query'][_0xc838('0x3e')]){_0x3ba16b[_0xc838('0x39')]=[{'all':!![]}];}_0x3ba16b=_[_0xc838('0x37')]({},_0x3ba16b,_0x5825fd[_0xc838('0x38')]);return db[_0xc838('0x28')][_0xc838('0x3f')](_0x3ba16b)[_0xc838('0x20')](handleEntityNotFound(_0x3006da,null))[_0xc838('0x20')](respondWithResult(_0x3006da,null))[_0xc838('0x40')](handleError(_0x3006da,null));};exports[_0xc838('0x41')]=function(_0x5430b4,_0x966286){return db[_0xc838('0x28')]['create'](_0x5430b4[_0xc838('0x42')],{})[_0xc838('0x20')](respondWithResult(_0x966286,0xc9))[_0xc838('0x40')](handleError(_0x966286,null));};exports[_0xc838('0x43')]=function(_0x40b35b,_0x4800d0){return db[_0xc838('0x28')][_0xc838('0x43')](_0x40b35b[_0xc838('0x42')],{'raw':![],'individualHooks':!![]})[_0xc838('0x20')](respondWithResult(_0x4800d0,0xc9))[_0xc838('0x40')](handleError(_0x4800d0,null));};exports['update']=function(_0x569633,_0x2dcd9b){if(_0x569633[_0xc838('0x42')]['id']){delete _0x569633['body']['id'];}return db[_0xc838('0x28')][_0xc838('0x3f')]({'where':{'id':_0x569633[_0xc838('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dcd9b,null))[_0xc838('0x20')](saveUpdates(_0x569633[_0xc838('0x42')],null))[_0xc838('0x20')](respondWithResult(_0x2dcd9b,null))[_0xc838('0x40')](handleError(_0x2dcd9b,null));};exports[_0xc838('0x21')]=function(_0x15ad39,_0x3fff48){return db[_0xc838('0x28')][_0xc838('0x3f')]({'where':{'id':_0x15ad39['params']['id']}})[_0xc838('0x20')](handleEntityNotFound(_0x3fff48,null))[_0xc838('0x20')](removeEntity(_0x3fff48,null))[_0xc838('0x40')](handleError(_0x3fff48,null));};exports['bulkDestroy']=function(_0x53d1e8,_0x2d07cf){return db[_0xc838('0x28')]['destroy']({'where':{'id':_0x53d1e8[_0xc838('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc838('0x20')](respondWithResult(_0x2d07cf,0xcc))[_0xc838('0x40')](handleError(_0x2d07cf,null));};exports[_0xc838('0x45')]=function(_0x3e2d36,_0x4629dc,_0x5ef09e){return db[_0xc838('0x46')]['findOne']({'where':{'id':_0x3e2d36[_0xc838('0x44')]['id']}})[_0xc838('0x20')](handleEntityNotFound(_0x4629dc,null))[_0xc838('0x20')](function(_0x18a64e){if(_0x18a64e){return db[_0xc838('0x47')][_0xc838('0x48')](function(_0x584dba){return db[_0xc838('0x28')][_0xc838('0x21')]({'where':{'CustomReportId':_0x3e2d36[_0xc838('0x44')]['id']},'transaction':_0x584dba})[_0xc838('0x20')](function(_0x1ebac6){var _0x23c907=_[_0xc838('0x27')](_0x3e2d36['body'],function(_0xd2d01a){delete _0xd2d01a['id'];_0xd2d01a['CustomReportId']=_0x3e2d36[_0xc838('0x44')]['id'];return _0xd2d01a;});return db['AnalyticFieldReport']['bulkCreate'](_0x23c907,{'transaction':_0x584dba});});})['then'](function(){return db[_0xc838('0x28')][_0xc838('0x3a')]({'where':{'CustomReportId':_0x3e2d36[_0xc838('0x44')]['id']}});});}})['then'](respondWithResult(_0x4629dc,null))[_0xc838('0x40')](handleError(_0x4629dc,null));};
\ No newline at end of file
+var _0x2dcd=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','merge','options','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x2dcd,0x15c));var _0xd2dc=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2dcd[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0xd2dc('0x0'));var rimraf=require(_0xd2dc('0x1'));var zipdir=require(_0xd2dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2dc('0x3'));var moment=require(_0xd2dc('0x4'));var BPromise=require(_0xd2dc('0x5'));var Mustache=require(_0xd2dc('0x6'));var util=require(_0xd2dc('0x7'));var path=require(_0xd2dc('0x8'));var sox=require(_0xd2dc('0x9'));var csv=require(_0xd2dc('0xa'));var ejs=require(_0xd2dc('0xb'));var fs=require('fs');var fs_extra=require(_0xd2dc('0xc'));var _=require(_0xd2dc('0xd'));var squel=require(_0xd2dc('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd2dc('0xf'));var toCsv=require(_0xd2dc('0xa'));var querystring=require(_0xd2dc('0x10'));var Papa=require('papaparse');var Redis=require(_0xd2dc('0x11'));var authService=require(_0xd2dc('0x12'));var qs=require(_0xd2dc('0x13'));var as=require(_0xd2dc('0x14'));var hardwareService=require(_0xd2dc('0x15'));var logger=require('../../config/logger')(_0xd2dc('0x16'));var utils=require(_0xd2dc('0x17'));var config=require(_0xd2dc('0x18'));var licenseUtil=require(_0xd2dc('0x19'));var db=require(_0xd2dc('0x1a'))['db'];function respondWithStatusCode(_0x107eeb,_0x27a59f){_0x27a59f=_0x27a59f||0xcc;return function(_0x300517){if(_0x300517){return _0x107eeb[_0xd2dc('0x1b')](_0x27a59f);}return _0x107eeb[_0xd2dc('0x1c')](_0x27a59f)[_0xd2dc('0x1d')]();};}function respondWithResult(_0x47f028,_0x12e486){_0x12e486=_0x12e486||0xc8;return function(_0xcab0d1){if(_0xcab0d1){return _0x47f028['status'](_0x12e486)[_0xd2dc('0x1e')](_0xcab0d1);}};}function respondWithFilteredResult(_0x49205f,_0x8d936f){return function(_0x3b9253){if(_0x3b9253){var _0x31d98d=typeof _0x8d936f[_0xd2dc('0x1f')]==='undefined'&&typeof _0x8d936f[_0xd2dc('0x20')]===_0xd2dc('0x21');var _0x2df5af=_0x3b9253[_0xd2dc('0x22')];var _0x363df1=_0x31d98d?0x0:_0x8d936f[_0xd2dc('0x1f')];var _0xa2bc4d=_0x31d98d?_0x3b9253[_0xd2dc('0x22')]:_0x8d936f[_0xd2dc('0x1f')]+_0x8d936f[_0xd2dc('0x20')];var _0xe80beb;if(_0xa2bc4d>=_0x2df5af){_0xa2bc4d=_0x2df5af;_0xe80beb=0xc8;}else{_0xe80beb=0xce;}_0x49205f['status'](_0xe80beb);return _0x49205f[_0xd2dc('0x23')](_0xd2dc('0x24'),_0x363df1+'-'+_0xa2bc4d+'/'+_0x2df5af)[_0xd2dc('0x1e')](_0x3b9253);}return null;};}function patchUpdates(_0x17b9e0){return function(_0x47ac50){try{jsonpatch[_0xd2dc('0x25')](_0x47ac50,_0x17b9e0,!![]);}catch(_0xdbbcba){return BPromise[_0xd2dc('0x26')](_0xdbbcba);}return _0x47ac50[_0xd2dc('0x27')]();};}function saveUpdates(_0x201bde,_0x541411){return function(_0x36dbe0){if(_0x36dbe0){return _0x36dbe0['update'](_0x201bde)[_0xd2dc('0x28')](function(_0x4c163b){return _0x4c163b;});}return null;};}function removeEntity(_0x2c89fb,_0x2f11d1){return function(_0xa21be6){if(_0xa21be6){return _0xa21be6[_0xd2dc('0x29')]()[_0xd2dc('0x28')](function(){_0x2c89fb[_0xd2dc('0x1c')](0xcc)[_0xd2dc('0x1d')]();});}};}function handleEntityNotFound(_0x2cce4a,_0x3db5f5){return function(_0x297d83){if(!_0x297d83){_0x2cce4a[_0xd2dc('0x1b')](0x194);}return _0x297d83;};}function handleError(_0x2c9617,_0x55427c){_0x55427c=_0x55427c||0x1f4;return function(_0x2073c5){logger[_0xd2dc('0x2a')](_0x2073c5[_0xd2dc('0x2b')]);if(_0x2073c5[_0xd2dc('0x2c')]){delete _0x2073c5[_0xd2dc('0x2c')];}_0x2c9617[_0xd2dc('0x1c')](_0x55427c)['send'](_0x2073c5);};}exports[_0xd2dc('0x2d')]=function(_0x5eb574,_0x45d0e3){var _0x31afa2={},_0x5c1868={},_0x1c735c={'count':0x0,'rows':[]};var _0x56a293=_[_0xd2dc('0x2e')](db[_0xd2dc('0x2f')][_0xd2dc('0x30')],function(_0x42c6c1){return{'name':_0x42c6c1[_0xd2dc('0x31')],'type':_0x42c6c1[_0xd2dc('0x32')][_0xd2dc('0x33')]};});_0x5c1868[_0xd2dc('0x34')]=_[_0xd2dc('0x2e')](_0x56a293,_0xd2dc('0x2c'));_0x5c1868[_0xd2dc('0x35')]=_[_0xd2dc('0x36')](_0x5eb574[_0xd2dc('0x35')]);_0x5c1868[_0xd2dc('0x37')]=_[_0xd2dc('0x38')](_0x5c1868[_0xd2dc('0x34')],_0x5c1868['query']);_0x31afa2[_0xd2dc('0x39')]=_[_0xd2dc('0x38')](_0x5c1868[_0xd2dc('0x34')],qs[_0xd2dc('0x3a')](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x3a')]));_0x31afa2[_0xd2dc('0x39')]=_0x31afa2[_0xd2dc('0x39')][_0xd2dc('0x3b')]?_0x31afa2[_0xd2dc('0x39')]:_0x5c1868[_0xd2dc('0x34')];if(!_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x3c')]('nolimit')){_0x31afa2[_0xd2dc('0x20')]=qs[_0xd2dc('0x20')](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x20')]);_0x31afa2[_0xd2dc('0x1f')]=qs[_0xd2dc('0x1f')](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x1f')]);}_0x31afa2[_0xd2dc('0x3d')]=qs['sort'](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x3e')]);_0x31afa2[_0xd2dc('0x3f')]=qs[_0xd2dc('0x37')](_[_0xd2dc('0x40')](_0x5eb574[_0xd2dc('0x35')],_0x5c1868[_0xd2dc('0x37')]),_0x56a293);if(_0x5eb574['query']['filter']){_0x31afa2['where']=_['merge'](_0x31afa2[_0xd2dc('0x3f')],{'$or':_[_0xd2dc('0x2e')](_0x56a293,function(_0x26d5f0){if(_0x26d5f0[_0xd2dc('0x32')]!==_0xd2dc('0x41')){var _0x443707={};_0x443707[_0x26d5f0[_0xd2dc('0x2c')]]={'$like':'%'+_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x42')]+'%'};return _0x443707;}})});}_0x31afa2=_['merge']({},_0x31afa2,_0x5eb574['options']);var _0x130209={'where':_0x31afa2[_0xd2dc('0x3f')]};return db[_0xd2dc('0x2f')][_0xd2dc('0x22')](_0x130209)[_0xd2dc('0x28')](function(_0x537d30){_0x1c735c[_0xd2dc('0x22')]=_0x537d30;if(_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x43')]){_0x31afa2[_0xd2dc('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xd2dc('0x45')](_0x31afa2);})[_0xd2dc('0x28')](function(_0x2599ff){_0x1c735c[_0xd2dc('0x46')]=_0x2599ff;return _0x1c735c;})[_0xd2dc('0x28')](respondWithFilteredResult(_0x45d0e3,_0x31afa2))[_0xd2dc('0x47')](handleError(_0x45d0e3,null));};exports[_0xd2dc('0x48')]=function(_0x1fc92e,_0x4ac04f){var _0x2fbee6={'raw':![],'where':{'id':_0x1fc92e[_0xd2dc('0x49')]['id']}},_0x183bcf={};_0x183bcf[_0xd2dc('0x34')]=_['keys'](db[_0xd2dc('0x2f')]['rawAttributes']);_0x183bcf['query']=_[_0xd2dc('0x36')](_0x1fc92e[_0xd2dc('0x35')]);_0x183bcf[_0xd2dc('0x37')]=_['intersection'](_0x183bcf[_0xd2dc('0x34')],_0x183bcf['query']);_0x2fbee6[_0xd2dc('0x39')]=_[_0xd2dc('0x38')](_0x183bcf[_0xd2dc('0x34')],qs['fields'](_0x1fc92e[_0xd2dc('0x35')]['fields']));_0x2fbee6[_0xd2dc('0x39')]=_0x2fbee6[_0xd2dc('0x39')][_0xd2dc('0x3b')]?_0x2fbee6['attributes']:_0x183bcf[_0xd2dc('0x34')];if(_0x1fc92e[_0xd2dc('0x35')][_0xd2dc('0x43')]){_0x2fbee6[_0xd2dc('0x44')]=[{'all':!![]}];}_0x2fbee6=_[_0xd2dc('0x4a')]({},_0x2fbee6,_0x1fc92e[_0xd2dc('0x4b')]);return db[_0xd2dc('0x2f')]['find'](_0x2fbee6)[_0xd2dc('0x28')](handleEntityNotFound(_0x4ac04f,null))[_0xd2dc('0x28')](respondWithResult(_0x4ac04f,null))[_0xd2dc('0x47')](handleError(_0x4ac04f,null));};exports['create']=function(_0x55d49b,_0x14cc44){return db[_0xd2dc('0x2f')][_0xd2dc('0x4c')](_0x55d49b[_0xd2dc('0x4d')],{})['then'](respondWithResult(_0x14cc44,0xc9))['catch'](handleError(_0x14cc44,null));};exports[_0xd2dc('0x4e')]=function(_0x41721e,_0x535ab6){return db[_0xd2dc('0x2f')][_0xd2dc('0x4e')](_0x41721e[_0xd2dc('0x4d')],{'raw':![],'individualHooks':!![]})[_0xd2dc('0x28')](respondWithResult(_0x535ab6,0xc9))['catch'](handleError(_0x535ab6,null));};exports[_0xd2dc('0x4f')]=function(_0x4cd0bc,_0x1d51aa){if(_0x4cd0bc[_0xd2dc('0x4d')]['id']){delete _0x4cd0bc[_0xd2dc('0x4d')]['id'];}return db[_0xd2dc('0x2f')]['find']({'where':{'id':_0x4cd0bc[_0xd2dc('0x49')]['id']}})[_0xd2dc('0x28')](handleEntityNotFound(_0x1d51aa,null))['then'](saveUpdates(_0x4cd0bc[_0xd2dc('0x4d')],null))[_0xd2dc('0x28')](respondWithResult(_0x1d51aa,null))[_0xd2dc('0x47')](handleError(_0x1d51aa,null));};exports[_0xd2dc('0x29')]=function(_0x487d9c,_0x32fcae){return db['AnalyticFieldReport']['find']({'where':{'id':_0x487d9c['params']['id']}})['then'](handleEntityNotFound(_0x32fcae,null))[_0xd2dc('0x28')](removeEntity(_0x32fcae,null))['catch'](handleError(_0x32fcae,null));};exports[_0xd2dc('0x50')]=function(_0x2be009,_0x1eff21){return db[_0xd2dc('0x2f')][_0xd2dc('0x29')]({'where':{'id':_0x2be009['query'][_0xd2dc('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xd2dc('0x28')](respondWithResult(_0x1eff21,0xcc))[_0xd2dc('0x47')](handleError(_0x1eff21,null));};exports[_0xd2dc('0x52')]=function(_0x4ec65e,_0x50ce46,_0x24b663){return db[_0xd2dc('0x53')][_0xd2dc('0x54')]({'where':{'id':_0x4ec65e[_0xd2dc('0x49')]['id']}})[_0xd2dc('0x28')](handleEntityNotFound(_0x50ce46,null))[_0xd2dc('0x28')](function(_0x7fce3){if(_0x7fce3){return db[_0xd2dc('0x55')][_0xd2dc('0x56')](function(_0x2a955a){return db[_0xd2dc('0x2f')][_0xd2dc('0x29')]({'where':{'CustomReportId':_0x4ec65e[_0xd2dc('0x49')]['id']},'transaction':_0x2a955a})['then'](function(_0x531cb5){var _0x48697b=_[_0xd2dc('0x2e')](_0x4ec65e[_0xd2dc('0x4d')],function(_0x51722d){delete _0x51722d['id'];_0x51722d[_0xd2dc('0x57')]=_0x4ec65e[_0xd2dc('0x49')]['id'];return _0x51722d;});return db['AnalyticFieldReport']['bulkCreate'](_0x48697b,{'transaction':_0x2a955a});});})[_0xd2dc('0x28')](function(){return db[_0xd2dc('0x2f')][_0xd2dc('0x45')]({'where':{'CustomReportId':_0x4ec65e[_0xd2dc('0x49')]['id']}});});}})[_0xd2dc('0x28')](respondWithResult(_0x50ce46,null))['catch'](handleError(_0x50ce46,null));};
\ No newline at end of file
index af320ae..caf7adb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e8e=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','request-promise'];(function(_0x5550b0,_0x4b5838){var _0x3c3370=function(_0x5c5cf9){while(--_0x5c5cf9){_0x5550b0['push'](_0x5550b0['shift']());}};_0x3c3370(++_0x4b5838);}(_0x0e8e,0x126));var _0xe0e8=function(_0x361ee1,_0x5c3d08){_0x361ee1=_0x361ee1-0x0;var _0x2202df=_0x0e8e[_0x361ee1];return _0x2202df;};'use strict';var _=require(_0xe0e8('0x0'));var util=require(_0xe0e8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0e8('0x2'));var fs=require('fs');var path=require(_0xe0e8('0x3'));var rimraf=require(_0xe0e8('0x4'));var config=require(_0xe0e8('0x5'));var attributes=require(_0xe0e8('0x6'));module[_0xe0e8('0x7')]=function(_0x3f2b9b,_0x58d93d){return _0x3f2b9b[_0xe0e8('0x8')](_0xe0e8('0x9'),attributes,{'tableName':_0xe0e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9d0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x5c2209,_0xb353c2){var _0x482463=function(_0x1d3a72){while(--_0x1d3a72){_0x5c2209['push'](_0x5c2209['shift']());}};_0x482463(++_0xb353c2);}(_0xc9d0,0x196));var _0x0c9d=function(_0x4f2679,_0x42bad2){_0x4f2679=_0x4f2679-0x0;var _0x573915=_0xc9d0[_0x4f2679];return _0x573915;};'use strict';var _=require(_0x0c9d('0x0'));var util=require(_0x0c9d('0x1'));var logger=require(_0x0c9d('0x2'))(_0x0c9d('0x3'));var moment=require(_0x0c9d('0x4'));var BPromise=require(_0x0c9d('0x5'));var rp=require(_0x0c9d('0x6'));var fs=require('fs');var path=require(_0x0c9d('0x7'));var rimraf=require(_0x0c9d('0x8'));var config=require('../../config/environment');var attributes=require(_0x0c9d('0x9'));module[_0x0c9d('0xa')]=function(_0x17cb94,_0x355ccc){return _0x17cb94[_0x0c9d('0xb')](_0x0c9d('0xc'),attributes,{'tableName':_0x0c9d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d77a4f2..02e1c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f0=['info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x24f870,_0x2c8a88){var _0x5d065b=function(_0x168247){while(--_0x168247){_0x24f870['push'](_0x24f870['shift']());}};_0x5d065b(++_0x2c8a88);}(_0x44f0,0x197));var _0x044f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x44f0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x044f('0x0'));var util=require('util');var moment=require(_0x044f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x044f('0x2'));var db=require(_0x044f('0x3'))['db'];var utils=require(_0x044f('0x4'));var logger=require(_0x044f('0x5'))(_0x044f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x044f('0x7')][_0x044f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d957b,_0x21c1c5,_0x367631){return new BPromise(function(_0x458f81,_0x572d87){return client[_0x044f('0x9')](_0x2d957b,_0x367631)[_0x044f('0xa')](function(_0x4b5aa6){logger[_0x044f('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x21c1c5,'request\x20sent');logger[_0x044f('0xc')](_0x044f('0xd'),_0x21c1c5,_0x044f('0xe'),JSON[_0x044f('0xf')](_0x4b5aa6));if(_0x4b5aa6[_0x044f('0x10')]){if(_0x4b5aa6[_0x044f('0x10')][_0x044f('0x11')]===0x1f4){logger[_0x044f('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x21c1c5,_0x4b5aa6[_0x044f('0x10')][_0x044f('0x12')]);return _0x572d87(_0x4b5aa6['error'][_0x044f('0x12')]);}logger[_0x044f('0x10')](_0x044f('0x13'),_0x21c1c5,_0x4b5aa6[_0x044f('0x10')][_0x044f('0x12')]);return _0x458f81(_0x4b5aa6[_0x044f('0x10')][_0x044f('0x12')]);}else{logger[_0x044f('0xb')](_0x044f('0x13'),_0x21c1c5,'request\x20sent');_0x458f81(_0x4b5aa6[_0x044f('0x14')][_0x044f('0x12')]);}})[_0x044f('0x15')](function(_0x3a69f7){logger[_0x044f('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x21c1c5,_0x3a69f7);_0x572d87(_0x3a69f7);});});}
\ No newline at end of file
+var _0x605f=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x5292fe,_0x1f2656){var _0x117c87=function(_0x3c32c9){while(--_0x3c32c9){_0x5292fe['push'](_0x5292fe['shift']());}};_0x117c87(++_0x1f2656);}(_0x605f,0x77));var _0xf605=function(_0x4b60fb,_0x36d36d){_0x4b60fb=_0x4b60fb-0x0;var _0x2d266a=_0x605f[_0x4b60fb];return _0x2d266a;};'use strict';var _=require(_0xf605('0x0'));var util=require(_0xf605('0x1'));var moment=require(_0xf605('0x2'));var BPromise=require(_0xf605('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf605('0x4'));var db=require(_0xf605('0x5'))['db'];var utils=require(_0xf605('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf605('0x7'));var client=jayson['client'][_0xf605('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35b72e,_0x558f7b,_0x5a1f16){return new BPromise(function(_0x2a70e8,_0x36771a){return client[_0xf605('0x9')](_0x35b72e,_0x5a1f16)['then'](function(_0x58d902){logger[_0xf605('0xa')](_0xf605('0xb'),_0x558f7b,'request\x20sent');logger[_0xf605('0xc')](_0xf605('0xd'),_0x558f7b,_0xf605('0xe'),JSON[_0xf605('0xf')](_0x58d902));if(_0x58d902[_0xf605('0x10')]){if(_0x58d902[_0xf605('0x10')]['code']===0x1f4){logger[_0xf605('0x10')](_0xf605('0xb'),_0x558f7b,_0x58d902['error'][_0xf605('0x11')]);return _0x36771a(_0x58d902['error'][_0xf605('0x11')]);}logger['error'](_0xf605('0xb'),_0x558f7b,_0x58d902['error']['message']);return _0x2a70e8(_0x58d902['error'][_0xf605('0x11')]);}else{logger[_0xf605('0xa')](_0xf605('0xb'),_0x558f7b,_0xf605('0xe'));_0x2a70e8(_0x58d902[_0xf605('0x12')][_0xf605('0x11')]);}})[_0xf605('0x13')](function(_0x4691e){logger['error'](_0xf605('0xb'),_0x558f7b,_0x4691e);_0x36771a(_0x4691e);});});}
\ No newline at end of file
index 7818b77..04dd77d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x5c10bd,_0x445068){var _0x17cc9f=function(_0x47241e){while(--_0x47241e){_0x5c10bd['push'](_0x5c10bd['shift']());}};_0x17cc9f(++_0x445068);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x5decac,_0x24be8e){var _0x186fc8=function(_0x2b590f){while(--_0x2b590f){_0x5decac['push'](_0x5decac['shift']());}};_0x186fc8(++_0x24be8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
index af0f82f..79bc785 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ca7=['exports','TEXT','STRING','sequelize'];(function(_0x1001ff,_0x23f369){var _0x20dc38=function(_0x3f59dd){while(--_0x3f59dd){_0x1001ff['push'](_0x1001ff['shift']());}};_0x20dc38(++_0x23f369);}(_0x1ca7,0x157));var _0x71ca=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x1ca7[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x71ca('0x0'));module[_0x71ca('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x71ca('0x2')]},'description':{'type':Sequelize[_0x71ca('0x3')]}};
\ No newline at end of file
+var _0x98e5=['name','STRING'];(function(_0x533a69,_0x23b7bf){var _0x24872a=function(_0x2d2340){while(--_0x2d2340){_0x533a69['push'](_0x533a69['shift']());}};_0x24872a(++_0x23b7bf);}(_0x98e5,0x8a));var _0x598e=function(_0x2d4d66,_0x4ebf90){_0x2d4d66=_0x2d4d66-0x0;var _0x441c64=_0x98e5[_0x2d4d66];return _0x441c64;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x598e('0x0')},'table':{'type':Sequelize[_0x598e('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x598e('0x1')]}};
\ No newline at end of file
index acaf23d..48d2d75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x181d15,_0x567b26){var _0x4aa763=function(_0x138182){while(--_0x138182){_0x181d15['push'](_0x181d15['shift']());}};_0x4aa763(++_0x567b26);}(_0x425d,0x1e0));var _0xd425=function(_0x2ec4d3,_0x544043){_0x2ec4d3=_0x2ec4d3-0x0;var _0x4caf0b=_0x425d[_0x2ec4d3];return _0x4caf0b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5d2ee6,_0x172461){var _0x148dc1=function(_0x125b75){while(--_0x125b75){_0x5d2ee6['push'](_0x5d2ee6['shift']());}};_0x148dc1(++_0x172461);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1ad12c,_0x5bd618){_0x1ad12c=_0x1ad12c-0x0;var _0xb60e0f=_0xf2ca[_0x1ad12c];return _0xb60e0f;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
index f8a8e78..fc41fec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1488=['exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','path','../../config/environment','./analyticMetric.attributes'];(function(_0x4d9d40,_0x39f6ee){var _0x5bb24a=function(_0x2a836e){while(--_0x2a836e){_0x4d9d40['push'](_0x4d9d40['shift']());}};_0x5bb24a(++_0x39f6ee);}(_0x1488,0x88));var _0x8148=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x1488[_0x12ddb2];return _0x10b6dd;};'use strict';var _=require(_0x8148('0x0'));var util=require('util');var logger=require(_0x8148('0x1'))(_0x8148('0x2'));var moment=require(_0x8148('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8148('0x4'));var rimraf=require('rimraf');var config=require(_0x8148('0x5'));var attributes=require(_0x8148('0x6'));module[_0x8148('0x7')]=function(_0x153009,_0x173d87){return _0x153009[_0x8148('0x8')](_0x8148('0x9'),attributes,{'tableName':_0x8148('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc91=['analytics_metrics','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x4059a9,_0x4a82e1){var _0x179815=function(_0x67ddde){while(--_0x67ddde){_0x4059a9['push'](_0x4059a9['shift']());}};_0x179815(++_0x4a82e1);}(_0xfc91,0xb5));var _0x1fc9=function(_0x1c450e,_0x8cd2b5){_0x1c450e=_0x1c450e-0x0;var _0x3bc620=_0xfc91[_0x1c450e];return _0x3bc620;};'use strict';var _=require('lodash');var util=require(_0x1fc9('0x0'));var logger=require('../../config/logger')(_0x1fc9('0x1'));var moment=require(_0x1fc9('0x2'));var BPromise=require(_0x1fc9('0x3'));var rp=require(_0x1fc9('0x4'));var fs=require('fs');var path=require(_0x1fc9('0x5'));var rimraf=require(_0x1fc9('0x6'));var config=require(_0x1fc9('0x7'));var attributes=require(_0x1fc9('0x8'));module[_0x1fc9('0x9')]=function(_0xb6caac,_0xc81f3b){return _0xb6caac[_0x1fc9('0xa')]('AnalyticMetric',attributes,{'tableName':_0x1fc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e84982c..8c24ea2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd78e=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x429c79,_0x3d90c6){var _0x2dfeb1=function(_0x18da11){while(--_0x18da11){_0x429c79['push'](_0x429c79['shift']());}};_0x2dfeb1(++_0x3d90c6);}(_0xd78e,0x163));var _0xed78=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xd78e[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xed78('0x0'));var util=require(_0xed78('0x1'));var moment=require(_0xed78('0x2'));var BPromise=require(_0xed78('0x3'));var rs=require(_0xed78('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed78('0x5'))['db'];var utils=require(_0xed78('0x6'));var logger=require(_0xed78('0x7'))(_0xed78('0x8'));var config=require('../../config/environment');var jayson=require(_0xed78('0x9'));var client=jayson['client'][_0xed78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf6f0d0,_0x30b5cc,_0x6ffc64){return new BPromise(function(_0x3838a9,_0x34c533){return client['request'](_0xf6f0d0,_0x6ffc64)['then'](function(_0xb468d1){logger[_0xed78('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x30b5cc,_0xed78('0xc'));logger[_0xed78('0xd')](_0xed78('0xe'),_0x30b5cc,'request\x20sent',JSON[_0xed78('0xf')](_0xb468d1));if(_0xb468d1[_0xed78('0x10')]){if(_0xb468d1[_0xed78('0x10')][_0xed78('0x11')]===0x1f4){logger[_0xed78('0x10')](_0xed78('0x12'),_0x30b5cc,_0xb468d1[_0xed78('0x10')]['message']);return _0x34c533(_0xb468d1[_0xed78('0x10')][_0xed78('0x13')]);}logger['error'](_0xed78('0x12'),_0x30b5cc,_0xb468d1[_0xed78('0x10')]['message']);return _0x3838a9(_0xb468d1[_0xed78('0x10')]['message']);}else{logger[_0xed78('0xb')](_0xed78('0x12'),_0x30b5cc,_0xed78('0xc'));_0x3838a9(_0xb468d1['result'][_0xed78('0x13')]);}})['catch'](function(_0x298fd2){logger[_0xed78('0x10')](_0xed78('0x12'),_0x30b5cc,_0x298fd2);_0x34c533(_0x298fd2);});});}
\ No newline at end of file
+var _0x18c8=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x18c8,0x8c));var _0x818c=function(_0x391f9c,_0xd6d758){_0x391f9c=_0x391f9c-0x0;var _0x20aee0=_0x18c8[_0x391f9c];return _0x20aee0;};'use strict';var _=require('lodash');var util=require(_0x818c('0x0'));var moment=require(_0x818c('0x1'));var BPromise=require(_0x818c('0x2'));var rs=require(_0x818c('0x3'));var fs=require('fs');var Redis=require(_0x818c('0x4'));var db=require(_0x818c('0x5'))['db'];var utils=require(_0x818c('0x6'));var logger=require(_0x818c('0x7'))(_0x818c('0x8'));var config=require(_0x818c('0x9'));var jayson=require(_0x818c('0xa'));var client=jayson['client'][_0x818c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x201ca9,_0x1e12b8,_0x555398){return new BPromise(function(_0x9c469b,_0x14b38c){return client[_0x818c('0xc')](_0x201ca9,_0x555398)[_0x818c('0xd')](function(_0x5e67c8){logger['info'](_0x818c('0xe'),_0x1e12b8,_0x818c('0xf'));logger[_0x818c('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1e12b8,_0x818c('0xf'),JSON['stringify'](_0x5e67c8));if(_0x5e67c8[_0x818c('0x11')]){if(_0x5e67c8[_0x818c('0x11')][_0x818c('0x12')]===0x1f4){logger[_0x818c('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1e12b8,_0x5e67c8[_0x818c('0x11')][_0x818c('0x13')]);return _0x14b38c(_0x5e67c8[_0x818c('0x11')][_0x818c('0x13')]);}logger[_0x818c('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1e12b8,_0x5e67c8[_0x818c('0x11')][_0x818c('0x13')]);return _0x9c469b(_0x5e67c8['error'][_0x818c('0x13')]);}else{logger[_0x818c('0x14')](_0x818c('0xe'),_0x1e12b8,_0x818c('0xf'));_0x9c469b(_0x5e67c8[_0x818c('0x15')]['message']);}})[_0x818c('0x16')](function(_0x4f5749){logger[_0x818c('0x11')](_0x818c('0xe'),_0x1e12b8,_0x4f5749);_0x14b38c(_0x4f5749);});});}
\ No newline at end of file
index 0df5295..171994a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf873=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0xf873,0xb2));var _0x3f87=function(_0xbb706f,_0x5a3200){_0xbb706f=_0xbb706f-0x0;var _0x4a3bb9=_0xf873[_0xbb706f];return _0x4a3bb9;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./analyticMetric.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0xe')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['put'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);module[_0x3f87('0x13')]=router;
\ No newline at end of file
+var _0x046b=['put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x58569d,_0x4dad03){var _0x5966d8=function(_0x48ac6){while(--_0x48ac6){_0x58569d['push'](_0x58569d['shift']());}};_0x5966d8(++_0x4dad03);}(_0x046b,0x147));var _0xb046=function(_0x41cf29,_0x216a99){_0x41cf29=_0x41cf29-0x0;var _0x566462=_0x046b[_0x41cf29];return _0x566462;};'use strict';var multer=require('multer');var util=require(_0xb046('0x0'));var path=require(_0xb046('0x1'));var timeout=require(_0xb046('0x2'));var express=require(_0xb046('0x3'));var router=express[_0xb046('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb046('0x5'));var interaction=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var controller=require(_0xb046('0x8'));router[_0xb046('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb046('0x9')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0xc')]);router[_0xb046('0xd')]('/',auth[_0xb046('0xb')](),controller[_0xb046('0xe')]);router[_0xb046('0xf')]('/:id',auth[_0xb046('0xb')](),controller['update']);router[_0xb046('0x10')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0x11')]);module[_0xb046('0x12')]=router;
\ No newline at end of file
index 2061a9d..13d90b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x480c=['TEXT'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0x480c,0xcc));var _0xc480=function(_0x391db4,_0x5ef002){_0x391db4=_0x391db4-0x0;var _0x262d1a=_0x480c[_0x391db4];return _0x262d1a;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xc480('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x411f=['TEXT','exports'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x411f,0xe1));var _0xf411=function(_0x559f79,_0x20583d){_0x559f79=_0x559f79-0x0;var _0x5a3148=_0x411f[_0x559f79];return _0x5a3148;};'use strict';var Sequelize=require('sequelize');module[_0xf411('0x0')]={'tree':{'type':Sequelize[_0xf411('0x1')],'allowNull':![]}};
\ No newline at end of file
index d0482e2..85d4ff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecf4=['status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x389710,_0x336855){var _0x17a191=function(_0x39138c){while(--_0x39138c){_0x389710['push'](_0x389710['shift']());}};_0x17a191(++_0x336855);}(_0xecf4,0x79));var _0x4ecf=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xecf4[_0xfedc72];return _0x2c7c78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ecf('0x0'));var zipdir=require(_0x4ecf('0x1'));var jsonpatch=require(_0x4ecf('0x2'));var rp=require(_0x4ecf('0x3'));var moment=require(_0x4ecf('0x4'));var BPromise=require(_0x4ecf('0x5'));var Mustache=require('mustache');var util=require(_0x4ecf('0x6'));var path=require(_0x4ecf('0x7'));var sox=require(_0x4ecf('0x8'));var csv=require(_0x4ecf('0x9'));var ejs=require(_0x4ecf('0xa'));var fs=require('fs');var fs_extra=require(_0x4ecf('0xb'));var _=require(_0x4ecf('0xc'));var squel=require('squel');var crypto=require(_0x4ecf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4ecf('0xe'));var toCsv=require(_0x4ecf('0x9'));var querystring=require('querystring');var Papa=require(_0x4ecf('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4ecf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ecf('0x11'));var logger=require(_0x4ecf('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x4ecf('0x13'));var licenseUtil=require(_0x4ecf('0x14'));var db=require(_0x4ecf('0x15'))['db'];function respondWithStatusCode(_0x421e78,_0x21a6c3){_0x21a6c3=_0x21a6c3||0xcc;return function(_0x1092f0){if(_0x1092f0){return _0x421e78[_0x4ecf('0x16')](_0x21a6c3);}return _0x421e78[_0x4ecf('0x17')](_0x21a6c3)['end']();};}function respondWithResult(_0x4db499,_0x101c0e){_0x101c0e=_0x101c0e||0xc8;return function(_0x249a91){if(_0x249a91){return _0x4db499[_0x4ecf('0x17')](_0x101c0e)[_0x4ecf('0x18')](_0x249a91);}};}function respondWithFilteredResult(_0x59ce69,_0x76a64d){return function(_0x6144d4){if(_0x6144d4){var _0x620f3=typeof _0x76a64d['offset']===_0x4ecf('0x19')&&typeof _0x76a64d[_0x4ecf('0x1a')]===_0x4ecf('0x19');var _0x594f2a=_0x6144d4['count'];var _0x1e7648=_0x620f3?0x0:_0x76a64d[_0x4ecf('0x1b')];var _0xfa6aef=_0x620f3?_0x6144d4[_0x4ecf('0x1c')]:_0x76a64d['offset']+_0x76a64d[_0x4ecf('0x1a')];var _0x43bd8f;if(_0xfa6aef>=_0x594f2a){_0xfa6aef=_0x594f2a;_0x43bd8f=0xc8;}else{_0x43bd8f=0xce;}_0x59ce69[_0x4ecf('0x17')](_0x43bd8f);return _0x59ce69[_0x4ecf('0x1d')](_0x4ecf('0x1e'),_0x1e7648+'-'+_0xfa6aef+'/'+_0x594f2a)['json'](_0x6144d4);}return null;};}function patchUpdates(_0x41b48d){return function(_0x227d83){try{jsonpatch[_0x4ecf('0x1f')](_0x227d83,_0x41b48d,!![]);}catch(_0x304097){return BPromise['reject'](_0x304097);}return _0x227d83[_0x4ecf('0x20')]();};}function saveUpdates(_0x434f27,_0x3bff7b){return function(_0x394b93){if(_0x394b93){return _0x394b93[_0x4ecf('0x21')](_0x434f27)[_0x4ecf('0x22')](function(_0x225538){return _0x225538;});}return null;};}function removeEntity(_0x28c116,_0x1490b1){return function(_0x3bccd3){if(_0x3bccd3){return _0x3bccd3[_0x4ecf('0x23')]()['then'](function(){_0x28c116['status'](0xcc)[_0x4ecf('0x24')]();});}};}function handleEntityNotFound(_0x480122,_0x3dbf7c){return function(_0x1ea40d){if(!_0x1ea40d){_0x480122[_0x4ecf('0x16')](0x194);}return _0x1ea40d;};}function handleError(_0x58ea9a,_0x4fbee9){_0x4fbee9=_0x4fbee9||0x1f4;return function(_0x1c9d70){logger[_0x4ecf('0x25')](_0x1c9d70[_0x4ecf('0x26')]);if(_0x1c9d70[_0x4ecf('0x27')]){delete _0x1c9d70[_0x4ecf('0x27')];}_0x58ea9a[_0x4ecf('0x17')](_0x4fbee9)[_0x4ecf('0x28')](_0x1c9d70);};}exports[_0x4ecf('0x29')]=function(_0xbf68a4,_0xe2a7e4){var _0x531884={},_0x4beaad={},_0x41bf2f={'count':0x0,'rows':[]};var _0x4d6a9f=_[_0x4ecf('0x2a')](db['AnalyticTreeReport'][_0x4ecf('0x2b')],function(_0x55128b){return{'name':_0x55128b[_0x4ecf('0x2c')],'type':_0x55128b[_0x4ecf('0x2d')][_0x4ecf('0x2e')]};});_0x4beaad[_0x4ecf('0x2f')]=_[_0x4ecf('0x2a')](_0x4d6a9f,_0x4ecf('0x27'));_0x4beaad[_0x4ecf('0x30')]=_[_0x4ecf('0x31')](_0xbf68a4[_0x4ecf('0x30')]);_0x4beaad['filters']=_[_0x4ecf('0x32')](_0x4beaad['model'],_0x4beaad[_0x4ecf('0x30')]);_0x531884['attributes']=_[_0x4ecf('0x32')](_0x4beaad[_0x4ecf('0x2f')],qs['fields'](_0xbf68a4['query'][_0x4ecf('0x33')]));_0x531884[_0x4ecf('0x34')]=_0x531884[_0x4ecf('0x34')][_0x4ecf('0x35')]?_0x531884[_0x4ecf('0x34')]:_0x4beaad[_0x4ecf('0x2f')];if(!_0xbf68a4[_0x4ecf('0x30')]['hasOwnProperty'](_0x4ecf('0x36'))){_0x531884[_0x4ecf('0x1a')]=qs['limit'](_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x1a')]);_0x531884['offset']=qs['offset'](_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x1b')]);}_0x531884[_0x4ecf('0x37')]=qs['sort'](_0xbf68a4[_0x4ecf('0x30')]['sort']);_0x531884[_0x4ecf('0x38')]=qs[_0x4ecf('0x39')](_[_0x4ecf('0x3a')](_0xbf68a4['query'],_0x4beaad[_0x4ecf('0x39')]),_0x4d6a9f);if(_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x3b')]){_0x531884[_0x4ecf('0x38')]=_['merge'](_0x531884[_0x4ecf('0x38')],{'$or':_['map'](_0x4d6a9f,function(_0xc66c5a){if(_0xc66c5a[_0x4ecf('0x2d')]!==_0x4ecf('0x3c')){var _0x279f65={};_0x279f65[_0xc66c5a['name']]={'$like':'%'+_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x3b')]+'%'};return _0x279f65;}})});}_0x531884=_[_0x4ecf('0x3d')]({},_0x531884,_0xbf68a4[_0x4ecf('0x3e')]);var _0x173cf9={'where':_0x531884[_0x4ecf('0x38')]};return db[_0x4ecf('0x3f')][_0x4ecf('0x1c')](_0x173cf9)[_0x4ecf('0x22')](function(_0x175932){_0x41bf2f[_0x4ecf('0x1c')]=_0x175932;if(_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x40')]){_0x531884[_0x4ecf('0x41')]=[{'all':!![]}];}return db[_0x4ecf('0x3f')][_0x4ecf('0x42')](_0x531884);})[_0x4ecf('0x22')](function(_0x22d797){_0x41bf2f['rows']=_0x22d797;return _0x41bf2f;})[_0x4ecf('0x22')](respondWithFilteredResult(_0xe2a7e4,_0x531884))[_0x4ecf('0x43')](handleError(_0xe2a7e4,null));};exports['show']=function(_0x220a38,_0x8cf10d){var _0x10a5c0={'raw':!![],'where':{'id':_0x220a38[_0x4ecf('0x44')]['id']}},_0x471122={};_0x471122[_0x4ecf('0x2f')]=_[_0x4ecf('0x31')](db['AnalyticTreeReport'][_0x4ecf('0x2b')]);_0x471122[_0x4ecf('0x30')]=_['keys'](_0x220a38[_0x4ecf('0x30')]);_0x471122[_0x4ecf('0x39')]=_[_0x4ecf('0x32')](_0x471122[_0x4ecf('0x2f')],_0x471122['query']);_0x10a5c0[_0x4ecf('0x34')]=_[_0x4ecf('0x32')](_0x471122[_0x4ecf('0x2f')],qs[_0x4ecf('0x33')](_0x220a38[_0x4ecf('0x30')][_0x4ecf('0x33')]));_0x10a5c0['attributes']=_0x10a5c0[_0x4ecf('0x34')][_0x4ecf('0x35')]?_0x10a5c0['attributes']:_0x471122['model'];if(_0x220a38[_0x4ecf('0x30')][_0x4ecf('0x40')]){_0x10a5c0[_0x4ecf('0x41')]=[{'all':!![]}];}_0x10a5c0=_[_0x4ecf('0x3d')]({},_0x10a5c0,_0x220a38[_0x4ecf('0x3e')]);return db[_0x4ecf('0x3f')][_0x4ecf('0x45')](_0x10a5c0)[_0x4ecf('0x22')](handleEntityNotFound(_0x8cf10d,null))['then'](respondWithResult(_0x8cf10d,null))[_0x4ecf('0x43')](handleError(_0x8cf10d,null));};exports[_0x4ecf('0x46')]=function(_0x3242de,_0x289672){return db[_0x4ecf('0x3f')][_0x4ecf('0x46')](_0x3242de['body'],{})[_0x4ecf('0x22')](respondWithResult(_0x289672,0xc9))[_0x4ecf('0x43')](handleError(_0x289672,null));};exports[_0x4ecf('0x21')]=function(_0x4a8b83,_0x1999bc){if(_0x4a8b83[_0x4ecf('0x47')]['id']){delete _0x4a8b83[_0x4ecf('0x47')]['id'];}return db[_0x4ecf('0x3f')][_0x4ecf('0x45')]({'where':{'id':_0x4a8b83[_0x4ecf('0x44')]['id']}})[_0x4ecf('0x22')](handleEntityNotFound(_0x1999bc,null))[_0x4ecf('0x22')](saveUpdates(_0x4a8b83['body'],null))[_0x4ecf('0x22')](respondWithResult(_0x1999bc,null))['catch'](handleError(_0x1999bc,null));};exports[_0x4ecf('0x23')]=function(_0x4aca45,_0x58da98){return db[_0x4ecf('0x3f')][_0x4ecf('0x45')]({'where':{'id':_0x4aca45[_0x4ecf('0x44')]['id']}})[_0x4ecf('0x22')](handleEntityNotFound(_0x58da98,null))[_0x4ecf('0x22')](removeEntity(_0x58da98,null))[_0x4ecf('0x43')](handleError(_0x58da98,null));};
\ No newline at end of file
+var _0x5fc6=['filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5fc6,0x180));var _0x65fc=function(_0x5cdcf9,_0x3209ff){_0x5cdcf9=_0x5cdcf9-0x0;var _0x302f30=_0x5fc6[_0x5cdcf9];return _0x302f30;};'use strict';var emlformat=require(_0x65fc('0x0'));var rimraf=require(_0x65fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65fc('0x2'));var rp=require(_0x65fc('0x3'));var moment=require(_0x65fc('0x4'));var BPromise=require(_0x65fc('0x5'));var Mustache=require(_0x65fc('0x6'));var util=require(_0x65fc('0x7'));var path=require('path');var sox=require(_0x65fc('0x8'));var csv=require(_0x65fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x65fc('0xa'));var squel=require(_0x65fc('0xb'));var crypto=require(_0x65fc('0xc'));var jsforce=require(_0x65fc('0xd'));var deskjs=require(_0x65fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x65fc('0xf'));var Papa=require(_0x65fc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65fc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65fc('0x12'));var utils=require(_0x65fc('0x13'));var config=require(_0x65fc('0x14'));var licenseUtil=require(_0x65fc('0x15'));var db=require(_0x65fc('0x16'))['db'];function respondWithStatusCode(_0x2f2159,_0x1a4641){_0x1a4641=_0x1a4641||0xcc;return function(_0x518366){if(_0x518366){return _0x2f2159[_0x65fc('0x17')](_0x1a4641);}return _0x2f2159['status'](_0x1a4641)[_0x65fc('0x18')]();};}function respondWithResult(_0x3eee11,_0x17c60f){_0x17c60f=_0x17c60f||0xc8;return function(_0x3772fe){if(_0x3772fe){return _0x3eee11[_0x65fc('0x19')](_0x17c60f)['json'](_0x3772fe);}};}function respondWithFilteredResult(_0x5c1c60,_0x2de192){return function(_0x435b76){if(_0x435b76){var _0x1f6555=typeof _0x2de192[_0x65fc('0x1a')]===_0x65fc('0x1b')&&typeof _0x2de192[_0x65fc('0x1c')]===_0x65fc('0x1b');var _0x3732d6=_0x435b76[_0x65fc('0x1d')];var _0x8dd5a5=_0x1f6555?0x0:_0x2de192[_0x65fc('0x1a')];var _0x3854cf=_0x1f6555?_0x435b76['count']:_0x2de192['offset']+_0x2de192[_0x65fc('0x1c')];var _0x4cd5c8;if(_0x3854cf>=_0x3732d6){_0x3854cf=_0x3732d6;_0x4cd5c8=0xc8;}else{_0x4cd5c8=0xce;}_0x5c1c60[_0x65fc('0x19')](_0x4cd5c8);return _0x5c1c60[_0x65fc('0x1e')](_0x65fc('0x1f'),_0x8dd5a5+'-'+_0x3854cf+'/'+_0x3732d6)['json'](_0x435b76);}return null;};}function patchUpdates(_0x522d73){return function(_0x29d70e){try{jsonpatch[_0x65fc('0x20')](_0x29d70e,_0x522d73,!![]);}catch(_0x408b5e){return BPromise[_0x65fc('0x21')](_0x408b5e);}return _0x29d70e['save']();};}function saveUpdates(_0x2a88c7,_0x4683ee){return function(_0x1477c0){if(_0x1477c0){return _0x1477c0[_0x65fc('0x22')](_0x2a88c7)[_0x65fc('0x23')](function(_0x8929f8){return _0x8929f8;});}return null;};}function removeEntity(_0x562507,_0x5d52b5){return function(_0x5c1c5e){if(_0x5c1c5e){return _0x5c1c5e[_0x65fc('0x24')]()['then'](function(){_0x562507['status'](0xcc)[_0x65fc('0x18')]();});}};}function handleEntityNotFound(_0x1fe245,_0x20ea4c){return function(_0x94d629){if(!_0x94d629){_0x1fe245[_0x65fc('0x17')](0x194);}return _0x94d629;};}function handleError(_0x2871d3,_0x28d1e3){_0x28d1e3=_0x28d1e3||0x1f4;return function(_0x503538){logger[_0x65fc('0x25')](_0x503538[_0x65fc('0x26')]);if(_0x503538[_0x65fc('0x27')]){delete _0x503538[_0x65fc('0x27')];}_0x2871d3[_0x65fc('0x19')](_0x28d1e3)[_0x65fc('0x28')](_0x503538);};}exports[_0x65fc('0x29')]=function(_0x563c86,_0x5de76d){var _0x51dc61={},_0x47b89d={},_0x498877={'count':0x0,'rows':[]};var _0x1e70dd=_[_0x65fc('0x2a')](db[_0x65fc('0x2b')][_0x65fc('0x2c')],function(_0x630d5a){return{'name':_0x630d5a[_0x65fc('0x2d')],'type':_0x630d5a[_0x65fc('0x2e')]['key']};});_0x47b89d[_0x65fc('0x2f')]=_[_0x65fc('0x2a')](_0x1e70dd,'name');_0x47b89d[_0x65fc('0x30')]=_['keys'](_0x563c86[_0x65fc('0x30')]);_0x47b89d[_0x65fc('0x31')]=_[_0x65fc('0x32')](_0x47b89d['model'],_0x47b89d[_0x65fc('0x30')]);_0x51dc61[_0x65fc('0x33')]=_['intersection'](_0x47b89d[_0x65fc('0x2f')],qs['fields'](_0x563c86[_0x65fc('0x30')][_0x65fc('0x34')]));_0x51dc61[_0x65fc('0x33')]=_0x51dc61['attributes'][_0x65fc('0x35')]?_0x51dc61[_0x65fc('0x33')]:_0x47b89d[_0x65fc('0x2f')];if(!_0x563c86['query'][_0x65fc('0x36')](_0x65fc('0x37'))){_0x51dc61[_0x65fc('0x1c')]=qs[_0x65fc('0x1c')](_0x563c86['query'][_0x65fc('0x1c')]);_0x51dc61[_0x65fc('0x1a')]=qs[_0x65fc('0x1a')](_0x563c86['query']['offset']);}_0x51dc61[_0x65fc('0x38')]=qs['sort'](_0x563c86[_0x65fc('0x30')][_0x65fc('0x39')]);_0x51dc61[_0x65fc('0x3a')]=qs[_0x65fc('0x31')](_[_0x65fc('0x3b')](_0x563c86[_0x65fc('0x30')],_0x47b89d[_0x65fc('0x31')]),_0x1e70dd);if(_0x563c86[_0x65fc('0x30')][_0x65fc('0x3c')]){_0x51dc61[_0x65fc('0x3a')]=_['merge'](_0x51dc61['where'],{'$or':_[_0x65fc('0x2a')](_0x1e70dd,function(_0x26e683){if(_0x26e683[_0x65fc('0x2e')]!==_0x65fc('0x3d')){var _0x2154de={};_0x2154de[_0x26e683['name']]={'$like':'%'+_0x563c86[_0x65fc('0x30')][_0x65fc('0x3c')]+'%'};return _0x2154de;}})});}_0x51dc61=_[_0x65fc('0x3e')]({},_0x51dc61,_0x563c86[_0x65fc('0x3f')]);var _0x1ddf7c={'where':_0x51dc61[_0x65fc('0x3a')]};return db['AnalyticTreeReport'][_0x65fc('0x1d')](_0x1ddf7c)['then'](function(_0x515cc9){_0x498877[_0x65fc('0x1d')]=_0x515cc9;if(_0x563c86[_0x65fc('0x30')][_0x65fc('0x40')]){_0x51dc61[_0x65fc('0x41')]=[{'all':!![]}];}return db[_0x65fc('0x2b')]['findAll'](_0x51dc61);})[_0x65fc('0x23')](function(_0x58c100){_0x498877[_0x65fc('0x42')]=_0x58c100;return _0x498877;})[_0x65fc('0x23')](respondWithFilteredResult(_0x5de76d,_0x51dc61))[_0x65fc('0x43')](handleError(_0x5de76d,null));};exports[_0x65fc('0x44')]=function(_0x1a6676,_0x472e5b){var _0x133f18={'raw':!![],'where':{'id':_0x1a6676[_0x65fc('0x45')]['id']}},_0x3c444d={};_0x3c444d[_0x65fc('0x2f')]=_['keys'](db[_0x65fc('0x2b')][_0x65fc('0x2c')]);_0x3c444d[_0x65fc('0x30')]=_[_0x65fc('0x46')](_0x1a6676[_0x65fc('0x30')]);_0x3c444d[_0x65fc('0x31')]=_[_0x65fc('0x32')](_0x3c444d[_0x65fc('0x2f')],_0x3c444d[_0x65fc('0x30')]);_0x133f18[_0x65fc('0x33')]=_[_0x65fc('0x32')](_0x3c444d[_0x65fc('0x2f')],qs['fields'](_0x1a6676[_0x65fc('0x30')][_0x65fc('0x34')]));_0x133f18[_0x65fc('0x33')]=_0x133f18[_0x65fc('0x33')][_0x65fc('0x35')]?_0x133f18[_0x65fc('0x33')]:_0x3c444d['model'];if(_0x1a6676[_0x65fc('0x30')][_0x65fc('0x40')]){_0x133f18[_0x65fc('0x41')]=[{'all':!![]}];}_0x133f18=_[_0x65fc('0x3e')]({},_0x133f18,_0x1a6676[_0x65fc('0x3f')]);return db['AnalyticTreeReport']['find'](_0x133f18)['then'](handleEntityNotFound(_0x472e5b,null))[_0x65fc('0x23')](respondWithResult(_0x472e5b,null))[_0x65fc('0x43')](handleError(_0x472e5b,null));};exports[_0x65fc('0x47')]=function(_0x5bad97,_0x38b7f8){return db['AnalyticTreeReport']['create'](_0x5bad97[_0x65fc('0x48')],{})[_0x65fc('0x23')](respondWithResult(_0x38b7f8,0xc9))[_0x65fc('0x43')](handleError(_0x38b7f8,null));};exports['update']=function(_0x5e0d07,_0x5c0be3){if(_0x5e0d07['body']['id']){delete _0x5e0d07[_0x65fc('0x48')]['id'];}return db[_0x65fc('0x2b')]['find']({'where':{'id':_0x5e0d07['params']['id']}})['then'](handleEntityNotFound(_0x5c0be3,null))['then'](saveUpdates(_0x5e0d07[_0x65fc('0x48')],null))[_0x65fc('0x23')](respondWithResult(_0x5c0be3,null))[_0x65fc('0x43')](handleError(_0x5c0be3,null));};exports['destroy']=function(_0x4df909,_0x461caa){return db[_0x65fc('0x2b')][_0x65fc('0x49')]({'where':{'id':_0x4df909['params']['id']}})[_0x65fc('0x23')](handleEntityNotFound(_0x461caa,null))[_0x65fc('0x23')](removeEntity(_0x461caa,null))[_0x65fc('0x43')](handleError(_0x461caa,null));};
\ No newline at end of file
index 855712b..432404a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d1=['path','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4ba774,_0x490dba){var _0x3bccb1=function(_0x4e56f5){while(--_0x4e56f5){_0x4ba774['push'](_0x4ba774['shift']());}};_0x3bccb1(++_0x490dba);}(_0x30d1,0x1e9));var _0x130d=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0x30d1[_0x1034ee];return _0x2922af;};'use strict';var _=require(_0x130d('0x0'));var util=require(_0x130d('0x1'));var logger=require(_0x130d('0x2'))(_0x130d('0x3'));var moment=require(_0x130d('0x4'));var BPromise=require(_0x130d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x130d('0x6'));var rimraf=require('rimraf');var config=require(_0x130d('0x7'));var attributes=require(_0x130d('0x8'));module['exports']=function(_0x32936c,_0x546f1e){return _0x32936c['define'](_0x130d('0x9'),attributes,{'tableName':_0x130d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3a8=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./analyticTreeReport.attributes','exports'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0xd3a8,0x1ba));var _0x8d3a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd3a8[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x8d3a('0x0'));var util=require(_0x8d3a('0x1'));var logger=require(_0x8d3a('0x2'))(_0x8d3a('0x3'));var moment=require(_0x8d3a('0x4'));var BPromise=require(_0x8d3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d3a('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d3a('0x7'));module[_0x8d3a('0x8')]=function(_0x5d4fe0,_0x26eab5){return _0x5d4fe0['define'](_0x8d3a('0x9'),attributes,{'tableName':_0x8d3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eb2984c..6eca58d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x27f9d3,_0x54ee48){var _0x1d2c10=function(_0x591eae){while(--_0x591eae){_0x27f9d3['push'](_0x27f9d3['shift']());}};_0x1d2c10(++_0x54ee48);}(_0xadb5,0xad));var _0x5adb=function(_0x45e09c,_0x19bdf7){_0x45e09c=_0x45e09c-0x0;var _0x5118ec=_0xadb5[_0x45e09c];return _0x5118ec;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1e867a,_0x1e393c){var _0x1ecee6=function(_0xe87eb6){while(--_0xe87eb6){_0x1e867a['push'](_0x1e867a['shift']());}};_0x1ecee6(++_0x1e393c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x35b9e2,_0x502f41){_0x35b9e2=_0x35b9e2-0x0;var _0xa760d=_0x5f2f[_0x35b9e2];return _0xa760d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
index 3097e33..0b2ca61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6bb=['get','isAuthenticated','index','/:id','show','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf6bb,0x117));var _0xbf6b=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xf6bb[_0x3f993e];return _0x39c135;};'use strict';var multer=require('multer');var util=require(_0xbf6b('0x0'));var path=require(_0xbf6b('0x1'));var timeout=require(_0xbf6b('0x2'));var express=require(_0xbf6b('0x3'));var router=express[_0xbf6b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf6b('0x5'));var interaction=require(_0xbf6b('0x6'));var config=require(_0xbf6b('0x7'));var controller=require(_0xbf6b('0x8'));router[_0xbf6b('0x9')]('/',auth[_0xbf6b('0xa')](),controller[_0xbf6b('0xb')]);router[_0xbf6b('0x9')](_0xbf6b('0xc'),auth[_0xbf6b('0xa')](),controller[_0xbf6b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf6b('0xe')]);router[_0xbf6b('0xf')](_0xbf6b('0xc'),auth['isAuthenticated'](),controller[_0xbf6b('0x10')]);router[_0xbf6b('0x11')](_0xbf6b('0xc'),auth[_0xbf6b('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb46b=['post','update','delete','destroy','multer','util','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2e2617,_0x8400d4){var _0x41102c=function(_0x4d8589){while(--_0x4d8589){_0x2e2617['push'](_0x2e2617['shift']());}};_0x41102c(++_0x8400d4);}(_0xb46b,0x12a));var _0xbb46=function(_0x1c7103,_0x42e469){_0x1c7103=_0x1c7103-0x0;var _0x1ab05e=_0xb46b[_0x1c7103];return _0x1ab05e;};'use strict';var multer=require(_0xbb46('0x0'));var util=require(_0xbb46('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb46('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xbb46('0x3'));var controller=require(_0xbb46('0x4'));router[_0xbb46('0x5')]('/',auth[_0xbb46('0x6')](),controller[_0xbb46('0x7')]);router[_0xbb46('0x5')](_0xbb46('0x8'),auth[_0xbb46('0x6')](),controller[_0xbb46('0x9')]);router[_0xbb46('0xa')]('/',auth[_0xbb46('0x6')](),controller['create']);router['put']('/:id',auth[_0xbb46('0x6')](),controller[_0xbb46('0xb')]);router[_0xbb46('0xc')](_0xbb46('0x8'),auth[_0xbb46('0x6')](),controller[_0xbb46('0xd')]);module['exports']=router;
\ No newline at end of file
index 01abbb7..ac0a3c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1306=['sequelize','exports','STRING'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x1306,0x17a));var _0x6130=function(_0x3dfbc7,_0x3f70af){_0x3dfbc7=_0x3dfbc7-0x0;var _0x871409=_0x1306[_0x3dfbc7];return _0x871409;};'use strict';var Sequelize=require(_0x6130('0x0'));module[_0x6130('0x1')]={'name':{'type':Sequelize[_0x6130('0x2')]},'basename':{'type':Sequelize[_0x6130('0x2')]},'type':{'type':Sequelize[_0x6130('0x2')]}};
\ No newline at end of file
+var _0x843b=['exports','STRING','sequelize'];(function(_0x3f560e,_0x289aa8){var _0x5bf213=function(_0xcc2f71){while(--_0xcc2f71){_0x3f560e['push'](_0x3f560e['shift']());}};_0x5bf213(++_0x289aa8);}(_0x843b,0xc5));var _0xb843=function(_0x19ba4f,_0xc3978f){_0x19ba4f=_0x19ba4f-0x0;var _0x4d0405=_0x843b[_0x19ba4f];return _0x4d0405;};'use strict';var Sequelize=require(_0xb843('0x0'));module[_0xb843('0x1')]={'name':{'type':Sequelize[_0xb843('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb843('0x2')]}};
\ No newline at end of file
index 00d844d..c6279c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a9=['save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','options','Attachment','include','findAll','rows','catch','show','params','includeAll','find','omit','updatedAt','body','createdAt','create','file','originalname','filename','mimetype','download','findOne','join','root','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject'];(function(_0x3c4e02,_0x173a9a){var _0x245482=function(_0x2f9c45){while(--_0x2f9c45){_0x3c4e02['push'](_0x3c4e02['shift']());}};_0x245482(++_0x173a9a);}(_0xd3a9,0x184));var _0x9d3a=function(_0x98d6e3,_0x43163b){_0x98d6e3=_0x98d6e3-0x0;var _0x204a44=_0xd3a9[_0x98d6e3];return _0x204a44;};'use strict';var emlformat=require(_0x9d3a('0x0'));var rimraf=require(_0x9d3a('0x1'));var zipdir=require(_0x9d3a('0x2'));var jsonpatch=require(_0x9d3a('0x3'));var rp=require(_0x9d3a('0x4'));var moment=require(_0x9d3a('0x5'));var BPromise=require(_0x9d3a('0x6'));var Mustache=require('mustache');var util=require(_0x9d3a('0x7'));var path=require(_0x9d3a('0x8'));var sox=require('sox');var csv=require(_0x9d3a('0x9'));var ejs=require(_0x9d3a('0xa'));var fs=require('fs');var fs_extra=require(_0x9d3a('0xb'));var _=require('lodash');var squel=require(_0x9d3a('0xc'));var crypto=require('crypto');var jsforce=require(_0x9d3a('0xd'));var deskjs=require(_0x9d3a('0xe'));var toCsv=require(_0x9d3a('0x9'));var querystring=require('querystring');var Papa=require(_0x9d3a('0xf'));var Redis=require('ioredis');var authService=require(_0x9d3a('0x10'));var qs=require(_0x9d3a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d3a('0x12'));var logger=require(_0x9d3a('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d3a('0x14'));var db=require(_0x9d3a('0x15'))['db'];function respondWithStatusCode(_0x212832,_0xfa03e9){_0xfa03e9=_0xfa03e9||0xcc;return function(_0x6ad444){if(_0x6ad444){return _0x212832[_0x9d3a('0x16')](_0xfa03e9);}return _0x212832[_0x9d3a('0x17')](_0xfa03e9)[_0x9d3a('0x18')]();};}function respondWithResult(_0x49095a,_0x35cc32){_0x35cc32=_0x35cc32||0xc8;return function(_0x335081){if(_0x335081){return _0x49095a[_0x9d3a('0x17')](_0x35cc32)[_0x9d3a('0x19')](_0x335081);}};}function respondWithFilteredResult(_0x3b5442,_0x2b9550){return function(_0x20bfc9){if(_0x20bfc9){var _0x14cadb=typeof _0x2b9550[_0x9d3a('0x1a')]===_0x9d3a('0x1b')&&typeof _0x2b9550['limit']===_0x9d3a('0x1b');var _0x5c6b42=_0x20bfc9['count'];var _0x4f722a=_0x14cadb?0x0:_0x2b9550['offset'];var _0x4acc99=_0x14cadb?_0x20bfc9[_0x9d3a('0x1c')]:_0x2b9550[_0x9d3a('0x1a')]+_0x2b9550['limit'];var _0x1f46b6;if(_0x4acc99>=_0x5c6b42){_0x4acc99=_0x5c6b42;_0x1f46b6=0xc8;}else{_0x1f46b6=0xce;}_0x3b5442[_0x9d3a('0x17')](_0x1f46b6);return _0x3b5442[_0x9d3a('0x1d')](_0x9d3a('0x1e'),_0x4f722a+'-'+_0x4acc99+'/'+_0x5c6b42)[_0x9d3a('0x19')](_0x20bfc9);}return null;};}function patchUpdates(_0x14f1e9){return function(_0x1bf3d3){try{jsonpatch['apply'](_0x1bf3d3,_0x14f1e9,!![]);}catch(_0x20d610){return BPromise[_0x9d3a('0x1f')](_0x20d610);}return _0x1bf3d3[_0x9d3a('0x20')]();};}function saveUpdates(_0x5ea481,_0x494fd2){return function(_0x584717){if(_0x584717){return _0x584717[_0x9d3a('0x21')](_0x5ea481)[_0x9d3a('0x22')](function(_0x33004e){return _0x33004e;});}return null;};}function removeEntity(_0x384bb5,_0x546852){return function(_0x349fa0){if(_0x349fa0){return _0x349fa0[_0x9d3a('0x23')]()[_0x9d3a('0x22')](function(){_0x384bb5[_0x9d3a('0x17')](0xcc)[_0x9d3a('0x18')]();});}};}function handleEntityNotFound(_0x16e813,_0x349334){return function(_0x50e177){if(!_0x50e177){_0x16e813[_0x9d3a('0x16')](0x194);}return _0x50e177;};}function handleError(_0x423204,_0x5afa3a){_0x5afa3a=_0x5afa3a||0x1f4;return function(_0x2f5ce5){logger['error'](_0x2f5ce5['stack']);if(_0x2f5ce5[_0x9d3a('0x24')]){delete _0x2f5ce5[_0x9d3a('0x24')];}_0x423204[_0x9d3a('0x17')](_0x5afa3a)[_0x9d3a('0x25')](_0x2f5ce5);};}exports[_0x9d3a('0x26')]=function(_0x5bad7c,_0x54507c){var _0x8a1cd9={},_0x4fdf85={},_0x24210b={'count':0x0,'rows':[]};var _0x465f46=_[_0x9d3a('0x27')](db['Attachment'][_0x9d3a('0x28')],function(_0x876682){return{'name':_0x876682[_0x9d3a('0x29')],'type':_0x876682[_0x9d3a('0x2a')][_0x9d3a('0x2b')]};});_0x4fdf85[_0x9d3a('0x2c')]=_['map'](_0x465f46,_0x9d3a('0x24'));_0x4fdf85[_0x9d3a('0x2d')]=_[_0x9d3a('0x2e')](_0x5bad7c['query']);_0x4fdf85[_0x9d3a('0x2f')]=_['intersection'](_0x4fdf85['model'],_0x4fdf85[_0x9d3a('0x2d')]);_0x8a1cd9[_0x9d3a('0x30')]=_[_0x9d3a('0x31')](_0x4fdf85[_0x9d3a('0x2c')],qs[_0x9d3a('0x32')](_0x5bad7c['query'][_0x9d3a('0x32')]));_0x8a1cd9[_0x9d3a('0x30')]=_0x8a1cd9[_0x9d3a('0x30')][_0x9d3a('0x33')]?_0x8a1cd9[_0x9d3a('0x30')]:_0x4fdf85[_0x9d3a('0x2c')];if(!_0x5bad7c[_0x9d3a('0x2d')]['hasOwnProperty'](_0x9d3a('0x34'))){_0x8a1cd9['limit']=qs[_0x9d3a('0x35')](_0x5bad7c[_0x9d3a('0x2d')][_0x9d3a('0x35')]);_0x8a1cd9[_0x9d3a('0x1a')]=qs[_0x9d3a('0x1a')](_0x5bad7c[_0x9d3a('0x2d')][_0x9d3a('0x1a')]);}_0x8a1cd9[_0x9d3a('0x36')]=qs[_0x9d3a('0x37')](_0x5bad7c['query'][_0x9d3a('0x37')]);_0x8a1cd9['where']=qs[_0x9d3a('0x2f')](_[_0x9d3a('0x38')](_0x5bad7c['query'],_0x4fdf85[_0x9d3a('0x2f')]),_0x465f46);if(_0x5bad7c[_0x9d3a('0x2d')][_0x9d3a('0x39')]){_0x8a1cd9['where']=_['merge'](_0x8a1cd9[_0x9d3a('0x3a')],{'$or':_[_0x9d3a('0x27')](_0x465f46,function(_0x259064){if(_0x259064['type']!=='VIRTUAL'){var _0x3a2835={};_0x3a2835[_0x259064[_0x9d3a('0x24')]]={'$like':'%'+_0x5bad7c['query'][_0x9d3a('0x39')]+'%'};return _0x3a2835;}})});}_0x8a1cd9=_[_0x9d3a('0x3b')]({},_0x8a1cd9,_0x5bad7c[_0x9d3a('0x3c')]);var _0x292422={'where':_0x8a1cd9[_0x9d3a('0x3a')]};return db[_0x9d3a('0x3d')][_0x9d3a('0x1c')](_0x292422)[_0x9d3a('0x22')](function(_0xa0149b){_0x24210b[_0x9d3a('0x1c')]=_0xa0149b;if(_0x5bad7c[_0x9d3a('0x2d')]['includeAll']){_0x8a1cd9[_0x9d3a('0x3e')]=[{'all':!![]}];}return db[_0x9d3a('0x3d')][_0x9d3a('0x3f')](_0x8a1cd9);})['then'](function(_0x1b42b0){_0x24210b[_0x9d3a('0x40')]=_0x1b42b0;return _0x24210b;})['then'](respondWithFilteredResult(_0x54507c,_0x8a1cd9))[_0x9d3a('0x41')](handleError(_0x54507c,null));};exports[_0x9d3a('0x42')]=function(_0x4f5e19,_0x1e0804){var _0x47e945={'raw':!![],'where':{'id':_0x4f5e19[_0x9d3a('0x43')]['id']}},_0x1c3163={};_0x1c3163[_0x9d3a('0x2c')]=_[_0x9d3a('0x2e')](db['Attachment'][_0x9d3a('0x28')]);_0x1c3163['query']=_[_0x9d3a('0x2e')](_0x4f5e19[_0x9d3a('0x2d')]);_0x1c3163['filters']=_['intersection'](_0x1c3163[_0x9d3a('0x2c')],_0x1c3163[_0x9d3a('0x2d')]);_0x47e945['attributes']=_[_0x9d3a('0x31')](_0x1c3163[_0x9d3a('0x2c')],qs[_0x9d3a('0x32')](_0x4f5e19[_0x9d3a('0x2d')]['fields']));_0x47e945[_0x9d3a('0x30')]=_0x47e945['attributes'][_0x9d3a('0x33')]?_0x47e945[_0x9d3a('0x30')]:_0x1c3163[_0x9d3a('0x2c')];if(_0x4f5e19[_0x9d3a('0x2d')][_0x9d3a('0x44')]){_0x47e945[_0x9d3a('0x3e')]=[{'all':!![]}];}_0x47e945=_[_0x9d3a('0x3b')]({},_0x47e945,_0x4f5e19[_0x9d3a('0x3c')]);return db[_0x9d3a('0x3d')][_0x9d3a('0x45')](_0x47e945)[_0x9d3a('0x22')](handleEntityNotFound(_0x1e0804,null))['then'](respondWithResult(_0x1e0804,null))[_0x9d3a('0x41')](handleError(_0x1e0804,null));};exports['clone']=function(_0x12ff84,_0x4824d1){var _0x32e9cf={'where':{'id':_0x12ff84[_0x9d3a('0x43')]['id']}},_0x7900b7={};_0x7900b7['model']=_[_0x9d3a('0x2e')](db[_0x9d3a('0x3d')][_0x9d3a('0x28')]);_0x32e9cf[_0x9d3a('0x30')]=_[_0x9d3a('0x31')](_0x7900b7[_0x9d3a('0x2c')],qs[_0x9d3a('0x32')](_0x12ff84[_0x9d3a('0x2d')][_0x9d3a('0x32')]));_0x32e9cf[_0x9d3a('0x30')]=_0x32e9cf[_0x9d3a('0x30')][_0x9d3a('0x33')]?_0x32e9cf['attributes']:_0x7900b7[_0x9d3a('0x2c')];if(_0x12ff84[_0x9d3a('0x2d')][_0x9d3a('0x44')]){_0x32e9cf[_0x9d3a('0x3e')]=[{'all':!![]}];}_0x32e9cf=_['merge']({},_0x32e9cf,_0x12ff84[_0x9d3a('0x3c')]);return db['Attachment']['find'](_0x32e9cf)[_0x9d3a('0x22')](handleEntityNotFound(_0x4824d1,null))[_0x9d3a('0x22')](function(_0x33c8e0){if(_0x33c8e0){var _0x55a692=_0x33c8e0['get']({'plain':!![]});_0x55a692=qs[_0x9d3a('0x46')](_0x55a692,['id','createdAt',_0x9d3a('0x47')]);_0x12ff84[_0x9d3a('0x48')]=_[_0x9d3a('0x46')](_0x12ff84['body'],['id',_0x9d3a('0x49'),'updatedAt']);return db[_0x9d3a('0x3d')]['create'](_[_0x9d3a('0x3b')](_0x55a692,_0x12ff84['body']),{'include':_0x12ff84[_0x9d3a('0x2d')][_0x9d3a('0x44')]?[{'all':!![]}]:undefined});}})[_0x9d3a('0x22')](respondWithResult(_0x4824d1,0xc9))[_0x9d3a('0x41')](handleError(_0x4824d1,null));};exports[_0x9d3a('0x21')]=function(_0x2f256e,_0x2fbd00){if(_0x2f256e[_0x9d3a('0x48')]['id']){delete _0x2f256e[_0x9d3a('0x48')]['id'];}return db[_0x9d3a('0x3d')][_0x9d3a('0x45')]({'where':{'id':_0x2f256e[_0x9d3a('0x43')]['id']}})[_0x9d3a('0x22')](handleEntityNotFound(_0x2fbd00,null))[_0x9d3a('0x22')](saveUpdates(_0x2f256e[_0x9d3a('0x48')],null))[_0x9d3a('0x22')](respondWithResult(_0x2fbd00,null))[_0x9d3a('0x41')](handleError(_0x2fbd00,null));};exports[_0x9d3a('0x23')]=function(_0x4230b8,_0x1eab3c){return db[_0x9d3a('0x3d')][_0x9d3a('0x45')]({'where':{'id':_0x4230b8[_0x9d3a('0x43')]['id']}})[_0x9d3a('0x22')](handleEntityNotFound(_0x1eab3c,null))[_0x9d3a('0x22')](removeEntity(_0x1eab3c,null))[_0x9d3a('0x41')](handleError(_0x1eab3c,null));};exports[_0x9d3a('0x4a')]=function(_0xbf72f9,_0x42248,_0x4d7a22){_0xbf72f9[_0x9d3a('0x48')]['name']=_0xbf72f9[_0x9d3a('0x4b')][_0x9d3a('0x4c')];_0xbf72f9[_0x9d3a('0x48')]['basename']=_0xbf72f9[_0x9d3a('0x4b')][_0x9d3a('0x4d')];_0xbf72f9['body'][_0x9d3a('0x2a')]=_0xbf72f9['file'][_0x9d3a('0x4e')];return db[_0x9d3a('0x3d')]['create'](_0xbf72f9['body'])[_0x9d3a('0x22')](respondWithResult(_0x42248,0xc9))['catch'](handleError(_0x42248,null));};exports[_0x9d3a('0x4f')]=function(_0x6ecad2,_0x4fcd64,_0x1a0733){return db['Attachment'][_0x9d3a('0x50')]({'where':{'id':_0x6ecad2[_0x9d3a('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4fcd64,null))[_0x9d3a('0x22')](function(_0x2a7c8d){if(_0x2a7c8d){var _0x2ae3fe=_0x2a7c8d['ChatOfflineMessageId']!==null;var _0x2c29ab=path[_0x9d3a('0x51')](config[_0x9d3a('0x52')],'server/files/attachments/');if(_0x2ae3fe){_0x2c29ab=path[_0x9d3a('0x51')](_0x2c29ab,_0x9d3a('0x53'));}var _0x56a999=path[_0x9d3a('0x51')](_0x2c29ab,_0x2a7c8d['basename']);return _0x4fcd64[_0x9d3a('0x4f')](_0x56a999);}})['catch'](handleError(_0x4fcd64,null));};
\ No newline at end of file
+var _0x6155=['download','findOne','root','server/files/attachments/','join','offline-chat/','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','updatedAt','body','create','file','originalname','filename','mimetype'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0x6155,0x118));var _0x5615=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x6155[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0x5615('0x0'));var rimraf=require(_0x5615('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5615('0x2'));var rp=require(_0x5615('0x3'));var moment=require(_0x5615('0x4'));var BPromise=require(_0x5615('0x5'));var Mustache=require('mustache');var util=require(_0x5615('0x6'));var path=require(_0x5615('0x7'));var sox=require('sox');var csv=require(_0x5615('0x8'));var ejs=require(_0x5615('0x9'));var fs=require('fs');var fs_extra=require(_0x5615('0xa'));var _=require(_0x5615('0xb'));var squel=require('squel');var crypto=require(_0x5615('0xc'));var jsforce=require(_0x5615('0xd'));var deskjs=require(_0x5615('0xe'));var toCsv=require(_0x5615('0x8'));var querystring=require(_0x5615('0xf'));var Papa=require(_0x5615('0x10'));var Redis=require('ioredis');var authService=require(_0x5615('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5615('0x12'));var hardwareService=require(_0x5615('0x13'));var logger=require(_0x5615('0x14'))('api');var utils=require(_0x5615('0x15'));var config=require(_0x5615('0x16'));var licenseUtil=require(_0x5615('0x17'));var db=require(_0x5615('0x18'))['db'];function respondWithStatusCode(_0x290f36,_0x56b413){_0x56b413=_0x56b413||0xcc;return function(_0x3fb5da){if(_0x3fb5da){return _0x290f36[_0x5615('0x19')](_0x56b413);}return _0x290f36[_0x5615('0x1a')](_0x56b413)[_0x5615('0x1b')]();};}function respondWithResult(_0x142393,_0x410b76){_0x410b76=_0x410b76||0xc8;return function(_0x39f59b){if(_0x39f59b){return _0x142393['status'](_0x410b76)[_0x5615('0x1c')](_0x39f59b);}};}function respondWithFilteredResult(_0x333249,_0xe53024){return function(_0x30e7a1){if(_0x30e7a1){var _0x56b06c=typeof _0xe53024[_0x5615('0x1d')]==='undefined'&&typeof _0xe53024[_0x5615('0x1e')]===_0x5615('0x1f');var _0x533ad3=_0x30e7a1[_0x5615('0x20')];var _0xc4a04a=_0x56b06c?0x0:_0xe53024[_0x5615('0x1d')];var _0x3f0386=_0x56b06c?_0x30e7a1[_0x5615('0x20')]:_0xe53024[_0x5615('0x1d')]+_0xe53024[_0x5615('0x1e')];var _0x1b29d8;if(_0x3f0386>=_0x533ad3){_0x3f0386=_0x533ad3;_0x1b29d8=0xc8;}else{_0x1b29d8=0xce;}_0x333249[_0x5615('0x1a')](_0x1b29d8);return _0x333249[_0x5615('0x21')](_0x5615('0x22'),_0xc4a04a+'-'+_0x3f0386+'/'+_0x533ad3)[_0x5615('0x1c')](_0x30e7a1);}return null;};}function patchUpdates(_0x1574e1){return function(_0x1f21e5){try{jsonpatch['apply'](_0x1f21e5,_0x1574e1,!![]);}catch(_0x4a6a78){return BPromise['reject'](_0x4a6a78);}return _0x1f21e5[_0x5615('0x23')]();};}function saveUpdates(_0x198e22,_0xea4d7e){return function(_0x9a61d6){if(_0x9a61d6){return _0x9a61d6[_0x5615('0x24')](_0x198e22)[_0x5615('0x25')](function(_0x57d827){return _0x57d827;});}return null;};}function removeEntity(_0x4f1bdc,_0x525402){return function(_0x9d5b2){if(_0x9d5b2){return _0x9d5b2[_0x5615('0x26')]()[_0x5615('0x25')](function(){_0x4f1bdc[_0x5615('0x1a')](0xcc)[_0x5615('0x1b')]();});}};}function handleEntityNotFound(_0x54efdb,_0x52f94b){return function(_0x1c6ed2){if(!_0x1c6ed2){_0x54efdb[_0x5615('0x19')](0x194);}return _0x1c6ed2;};}function handleError(_0x3e79d6,_0x4965e7){_0x4965e7=_0x4965e7||0x1f4;return function(_0x1de927){logger[_0x5615('0x27')](_0x1de927[_0x5615('0x28')]);if(_0x1de927[_0x5615('0x29')]){delete _0x1de927[_0x5615('0x29')];}_0x3e79d6['status'](_0x4965e7)[_0x5615('0x2a')](_0x1de927);};}exports[_0x5615('0x2b')]=function(_0x2ac617,_0x3b2c60){var _0x532dbe={},_0x43c25a={},_0x272ac9={'count':0x0,'rows':[]};var _0x22a4e2=_[_0x5615('0x2c')](db[_0x5615('0x2d')][_0x5615('0x2e')],function(_0x211687){return{'name':_0x211687[_0x5615('0x2f')],'type':_0x211687[_0x5615('0x30')]['key']};});_0x43c25a[_0x5615('0x31')]=_[_0x5615('0x2c')](_0x22a4e2,'name');_0x43c25a['query']=_[_0x5615('0x32')](_0x2ac617['query']);_0x43c25a[_0x5615('0x33')]=_[_0x5615('0x34')](_0x43c25a[_0x5615('0x31')],_0x43c25a['query']);_0x532dbe[_0x5615('0x35')]=_['intersection'](_0x43c25a['model'],qs[_0x5615('0x36')](_0x2ac617[_0x5615('0x37')]['fields']));_0x532dbe[_0x5615('0x35')]=_0x532dbe['attributes'][_0x5615('0x38')]?_0x532dbe[_0x5615('0x35')]:_0x43c25a[_0x5615('0x31')];if(!_0x2ac617[_0x5615('0x37')][_0x5615('0x39')](_0x5615('0x3a'))){_0x532dbe[_0x5615('0x1e')]=qs[_0x5615('0x1e')](_0x2ac617[_0x5615('0x37')][_0x5615('0x1e')]);_0x532dbe[_0x5615('0x1d')]=qs[_0x5615('0x1d')](_0x2ac617[_0x5615('0x37')]['offset']);}_0x532dbe[_0x5615('0x3b')]=qs[_0x5615('0x3c')](_0x2ac617[_0x5615('0x37')][_0x5615('0x3c')]);_0x532dbe[_0x5615('0x3d')]=qs[_0x5615('0x33')](_[_0x5615('0x3e')](_0x2ac617[_0x5615('0x37')],_0x43c25a['filters']),_0x22a4e2);if(_0x2ac617[_0x5615('0x37')][_0x5615('0x3f')]){_0x532dbe[_0x5615('0x3d')]=_['merge'](_0x532dbe['where'],{'$or':_[_0x5615('0x2c')](_0x22a4e2,function(_0x2395c5){if(_0x2395c5[_0x5615('0x30')]!=='VIRTUAL'){var _0x4c3832={};_0x4c3832[_0x2395c5['name']]={'$like':'%'+_0x2ac617[_0x5615('0x37')]['filter']+'%'};return _0x4c3832;}})});}_0x532dbe=_[_0x5615('0x40')]({},_0x532dbe,_0x2ac617[_0x5615('0x41')]);var _0x2d8d47={'where':_0x532dbe[_0x5615('0x3d')]};return db[_0x5615('0x2d')][_0x5615('0x20')](_0x2d8d47)[_0x5615('0x25')](function(_0x126393){_0x272ac9[_0x5615('0x20')]=_0x126393;if(_0x2ac617[_0x5615('0x37')][_0x5615('0x42')]){_0x532dbe[_0x5615('0x43')]=[{'all':!![]}];}return db[_0x5615('0x2d')][_0x5615('0x44')](_0x532dbe);})[_0x5615('0x25')](function(_0x2ca8ef){_0x272ac9[_0x5615('0x45')]=_0x2ca8ef;return _0x272ac9;})[_0x5615('0x25')](respondWithFilteredResult(_0x3b2c60,_0x532dbe))[_0x5615('0x46')](handleError(_0x3b2c60,null));};exports[_0x5615('0x47')]=function(_0x4826a9,_0x27c1f9){var _0x5cbc56={'raw':!![],'where':{'id':_0x4826a9[_0x5615('0x48')]['id']}},_0x113482={};_0x113482[_0x5615('0x31')]=_[_0x5615('0x32')](db[_0x5615('0x2d')][_0x5615('0x2e')]);_0x113482[_0x5615('0x37')]=_[_0x5615('0x32')](_0x4826a9['query']);_0x113482[_0x5615('0x33')]=_[_0x5615('0x34')](_0x113482[_0x5615('0x31')],_0x113482[_0x5615('0x37')]);_0x5cbc56[_0x5615('0x35')]=_[_0x5615('0x34')](_0x113482[_0x5615('0x31')],qs[_0x5615('0x36')](_0x4826a9['query'][_0x5615('0x36')]));_0x5cbc56['attributes']=_0x5cbc56[_0x5615('0x35')][_0x5615('0x38')]?_0x5cbc56[_0x5615('0x35')]:_0x113482[_0x5615('0x31')];if(_0x4826a9[_0x5615('0x37')][_0x5615('0x42')]){_0x5cbc56[_0x5615('0x43')]=[{'all':!![]}];}_0x5cbc56=_[_0x5615('0x40')]({},_0x5cbc56,_0x4826a9[_0x5615('0x41')]);return db[_0x5615('0x2d')][_0x5615('0x49')](_0x5cbc56)[_0x5615('0x25')](handleEntityNotFound(_0x27c1f9,null))[_0x5615('0x25')](respondWithResult(_0x27c1f9,null))[_0x5615('0x46')](handleError(_0x27c1f9,null));};exports[_0x5615('0x4a')]=function(_0x1c3d14,_0x314c8){var _0x59ba5e={'where':{'id':_0x1c3d14[_0x5615('0x48')]['id']}},_0x4572eb={};_0x4572eb[_0x5615('0x31')]=_[_0x5615('0x32')](db[_0x5615('0x2d')][_0x5615('0x2e')]);_0x59ba5e['attributes']=_[_0x5615('0x34')](_0x4572eb[_0x5615('0x31')],qs[_0x5615('0x36')](_0x1c3d14[_0x5615('0x37')][_0x5615('0x36')]));_0x59ba5e[_0x5615('0x35')]=_0x59ba5e['attributes']['length']?_0x59ba5e[_0x5615('0x35')]:_0x4572eb[_0x5615('0x31')];if(_0x1c3d14[_0x5615('0x37')]['includeAll']){_0x59ba5e['include']=[{'all':!![]}];}_0x59ba5e=_['merge']({},_0x59ba5e,_0x1c3d14[_0x5615('0x41')]);return db[_0x5615('0x2d')][_0x5615('0x49')](_0x59ba5e)[_0x5615('0x25')](handleEntityNotFound(_0x314c8,null))[_0x5615('0x25')](function(_0x2d0fe9){if(_0x2d0fe9){var _0x4eb887=_0x2d0fe9[_0x5615('0x4b')]({'plain':!![]});_0x4eb887=qs[_0x5615('0x4c')](_0x4eb887,['id','createdAt',_0x5615('0x4d')]);_0x1c3d14[_0x5615('0x4e')]=_[_0x5615('0x4c')](_0x1c3d14[_0x5615('0x4e')],['id','createdAt',_0x5615('0x4d')]);return db[_0x5615('0x2d')][_0x5615('0x4f')](_[_0x5615('0x40')](_0x4eb887,_0x1c3d14[_0x5615('0x4e')]),{'include':_0x1c3d14[_0x5615('0x37')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x5615('0x25')](respondWithResult(_0x314c8,0xc9))[_0x5615('0x46')](handleError(_0x314c8,null));};exports[_0x5615('0x24')]=function(_0x482b0b,_0x31dada){if(_0x482b0b[_0x5615('0x4e')]['id']){delete _0x482b0b['body']['id'];}return db[_0x5615('0x2d')][_0x5615('0x49')]({'where':{'id':_0x482b0b[_0x5615('0x48')]['id']}})[_0x5615('0x25')](handleEntityNotFound(_0x31dada,null))[_0x5615('0x25')](saveUpdates(_0x482b0b[_0x5615('0x4e')],null))['then'](respondWithResult(_0x31dada,null))[_0x5615('0x46')](handleError(_0x31dada,null));};exports[_0x5615('0x26')]=function(_0x3f730a,_0x4871c9){return db[_0x5615('0x2d')][_0x5615('0x49')]({'where':{'id':_0x3f730a[_0x5615('0x48')]['id']}})[_0x5615('0x25')](handleEntityNotFound(_0x4871c9,null))[_0x5615('0x25')](removeEntity(_0x4871c9,null))[_0x5615('0x46')](handleError(_0x4871c9,null));};exports[_0x5615('0x4f')]=function(_0x160507,_0x542ba1,_0x47ccde){_0x160507[_0x5615('0x4e')]['name']=_0x160507[_0x5615('0x50')][_0x5615('0x51')];_0x160507[_0x5615('0x4e')]['basename']=_0x160507[_0x5615('0x50')][_0x5615('0x52')];_0x160507[_0x5615('0x4e')][_0x5615('0x30')]=_0x160507['file'][_0x5615('0x53')];return db['Attachment'][_0x5615('0x4f')](_0x160507['body'])[_0x5615('0x25')](respondWithResult(_0x542ba1,0xc9))['catch'](handleError(_0x542ba1,null));};exports[_0x5615('0x54')]=function(_0xe31db5,_0x1106b2,_0x1ffd73){return db[_0x5615('0x2d')][_0x5615('0x55')]({'where':{'id':_0xe31db5['params']['id']},'raw':!![]})[_0x5615('0x25')](handleEntityNotFound(_0x1106b2,null))[_0x5615('0x25')](function(_0x58b159){if(_0x58b159){var _0x5c09f0=_0x58b159['ChatOfflineMessageId']!==null;var _0x2ee9b1=path['join'](config[_0x5615('0x56')],_0x5615('0x57'));if(_0x5c09f0){_0x2ee9b1=path[_0x5615('0x58')](_0x2ee9b1,_0x5615('0x59'));}var _0x328730=path[_0x5615('0x58')](_0x2ee9b1,_0x58b159[_0x5615('0x5a')]);return _0x1106b2[_0x5615('0x54')](_0x328730);}})[_0x5615('0x46')](handleError(_0x1106b2,null));};
\ No newline at end of file
index 6ac6469..97e9f03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc2c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Attachment','attachments','lodash','../../config/logger'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xdc2c,0xf0));var _0xcdc2=function(_0xbc0b4d,_0x48d139){_0xbc0b4d=_0xbc0b4d-0x0;var _0x5920d7=_0xdc2c[_0xbc0b4d];return _0x5920d7;};'use strict';var _=require(_0xcdc2('0x0'));var util=require('util');var logger=require(_0xcdc2('0x1'))('api');var moment=require(_0xcdc2('0x2'));var BPromise=require(_0xcdc2('0x3'));var rp=require(_0xcdc2('0x4'));var fs=require('fs');var path=require(_0xcdc2('0x5'));var rimraf=require(_0xcdc2('0x6'));var config=require(_0xcdc2('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x4826af,_0x21d511){return _0x4826af[_0xcdc2('0x8')](_0xcdc2('0x9'),attributes,{'tableName':_0xcdc2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfd4=['path','./attachment.attributes','define','Attachment','attachments','util','bluebird','request-promise'];(function(_0x1ba19c,_0x3975e2){var _0x4e069b=function(_0xd95964){while(--_0xd95964){_0x1ba19c['push'](_0x1ba19c['shift']());}};_0x4e069b(++_0x3975e2);}(_0xbfd4,0xfd));var _0x4bfd=function(_0x1db9df,_0x2965c4){_0x1db9df=_0x1db9df-0x0;var _0x509da3=_0xbfd4[_0x1db9df];return _0x509da3;};'use strict';var _=require('lodash');var util=require(_0x4bfd('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4bfd('0x1'));var rp=require(_0x4bfd('0x2'));var fs=require('fs');var path=require(_0x4bfd('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4bfd('0x4'));module['exports']=function(_0x4f4e1b,_0x1329cf){return _0x4f4e1b[_0x4bfd('0x5')](_0x4bfd('0x6'),attributes,{'tableName':_0x4bfd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 38967ae..4227b72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad95=['ioredis','../../mysqldb','rpc','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xad95,0x70));var _0x5ad9=function(_0x16ae0f,_0x3517b6){_0x16ae0f=_0x16ae0f-0x0;var _0x508a1f=_0xad95[_0x16ae0f];return _0x508a1f;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('Attachment,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('Attachment,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});}exports[_0x5ad9('0x11')]=function(_0x54f392){var _0x3d1c8f=this;return new Promise(function(_0x28682f,_0xe4171b){return db[_0x5ad9('0x12')][_0x5ad9('0x13')](_0x54f392[_0x5ad9('0x14')],{'raw':_0x54f392[_0x5ad9('0x15')]?_0x54f392['options'][_0x5ad9('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x49363b){logger[_0x5ad9('0xe')]('CreateAttachment',_0x54f392);logger[_0x5ad9('0x9')](_0x5ad9('0x11'),_0x54f392,JSON[_0x5ad9('0xa')](_0x49363b));_0x28682f(_0x49363b);})[_0x5ad9('0x10')](function(_0x1274f7){logger['error'](_0x5ad9('0x11'),_0x1274f7['message'],_0x54f392);_0xe4171b(_0x3d1c8f[_0x5ad9('0xb')](0x1f4,_0x1274f7['message']));});});};
\ No newline at end of file
+var _0x4ea3=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','options','raw','debug'];(function(_0x3372dc,_0x18ff49){var _0x511d15=function(_0x310ffe){while(--_0x310ffe){_0x3372dc['push'](_0x3372dc['shift']());}};_0x511d15(++_0x18ff49);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('Attachment,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});}exports[_0x34ea('0x15')]=function(_0x34caea){var _0x5aeea3=this;return new Promise(function(_0x5340a4,_0x72fef0){return db[_0x34ea('0x16')][_0x34ea('0x17')](_0x34caea[_0x34ea('0x18')],{'raw':_0x34caea['options']?_0x34caea[_0x34ea('0x19')][_0x34ea('0x1a')]===undefined?!![]:![]:!![]})[_0x34ea('0xb')](function(_0x247ee7){logger['info']('CreateAttachment',_0x34caea);logger[_0x34ea('0x1b')](_0x34ea('0x15'),_0x34caea,JSON[_0x34ea('0x10')](_0x247ee7));_0x5340a4(_0x247ee7);})['catch'](function(_0x5197a2){logger[_0x34ea('0x11')](_0x34ea('0x15'),_0x5197a2[_0x34ea('0x13')],_0x34caea);_0x72fef0(_0x5aeea3[_0x34ea('0x11')](0x1f4,_0x5197a2[_0x34ea('0x13')]));});});};
\ No newline at end of file
index e64cb1d..2c49cc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x4482ff,_0x46609e){_0x4482ff=_0x4482ff-0x0;var _0x17b0c7=_0xdb28[_0x4482ff];return _0x17b0c7;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x2e7b47,_0xc8447d){var _0x194a23=function(_0x3369d9){while(--_0x3369d9){_0x2e7b47['push'](_0x2e7b47['shift']());}};_0x194a23(++_0xc8447d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a6269,_0x5deea5){_0x1a6269=_0x1a6269-0x0;var _0x536f68=_0xb10b[_0x1a6269];return _0x536f68;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
index 0e24a41..84608c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x219b=['findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile','email','callback','clientSecret','Setting'];(function(_0x272728,_0x5cc52d){var _0x2b7d86=function(_0x4fb4a3){while(--_0x4fb4a3){_0x272728['push'](_0x272728['shift']());}};_0x2b7d86(++_0x5cc52d);}(_0x219b,0x1d0));var _0xb219=function(_0x3649d9,_0x486750){_0x3649d9=_0x3649d9-0x0;var _0x151977=_0x219b[_0x3649d9];return _0x151977;};'use strict';var _=require(_0xb219('0x0'));var passport=require(_0xb219('0x1'));var GoogleStrategy=require(_0xb219('0x2'))['Strategy'];var moment=require(_0xb219('0x3'));var db=require(_0xb219('0x4'))['db'];var config=require(_0xb219('0x5'));var signToken=require(_0xb219('0x6'))[_0xb219('0x7')];var utils=require(_0xb219('0x8'));exports['login']=passport[_0xb219('0x9')](_0xb219('0xa'),{'failureRedirect':_0xb219('0xb'),'scope':[_0xb219('0xc'),_0xb219('0xd')],'session':![]});exports[_0xb219('0xe')]=passport[_0xb219('0x9')]('google',{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xb219('0xa')]?config[_0xb219('0xa')]['clientID']:'id','clientSecret':config['google']?config['google'][_0xb219('0xf')]:'secret','callbackURL':config['google']?config['google']['callbackURL']:''},function(_0x49741f,_0x4311ae,_0x46e091,_0x45541b){var _0x1aedb5,_0x130bd5;return db[_0xb219('0x10')][_0xb219('0x11')]({'where':{'id':0x1},'attributes':[_0xb219('0x12'),_0xb219('0x13')],'raw':!![]})[_0xb219('0x14')](function(_0x455561){_0x1aedb5=_0x455561;return db[_0xb219('0x15')][_0xb219('0x16')]({'where':{'email':_[_0xb219('0x17')](_0x46e091[_0xb219('0x18')],_0xb219('0x19')),'role':{'$or':[_0xb219('0x1a'),_0xb219('0x1b'),_0xb219('0x1c')]}}});})[_0xb219('0x14')](function(_0x68dfee){_0x130bd5=_0x68dfee;if(_0x130bd5){if(_0x130bd5[_0xb219('0x1d')]){return _0x45541b(_0xb219('0x1e'));}else if(_0x1aedb5[_0xb219('0x13')]>0x0){if(_0x130bd5[_0xb219('0x1f')]){if(moment(_0x130bd5['blockedAt'])[_0xb219('0x20')](_0x1aedb5[_0xb219('0x13')],_0xb219('0x21'))>moment()){return _0x45541b(_0xb219('0x1e'));}else{return utils[_0xb219('0x22')](_0x130bd5,0x0,![],null)[_0xb219('0x14')](function(){return utils['getLicense'](_0x130bd5);})[_0xb219('0x14')](function(){return _0x45541b(null,_0x130bd5);});}}else{return utils[_0xb219('0x23')](_0x130bd5)[_0xb219('0x14')](function(){return _0x45541b(null,_0x130bd5);});}}else{return utils[_0xb219('0x23')](_0x130bd5)[_0xb219('0x14')](function(){return _0x45541b(null,_0x130bd5);});}}return _0x45541b(_0xb219('0x1e'));})[_0xb219('0x24')](function(_0x3ec0ba){_0x45541b(_0x3ec0ba);});}));
\ No newline at end of file
+var _0xce3e=['../../components/auth/service','signToken','login','authenticate','google','profile','email','/login','clientSecret','secret','callbackURL','Setting','User','find','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','clearBlockUser','getLicense','then','catch','lodash','../../config/environment'];(function(_0x59c0e9,_0xad6e56){var _0x1590a3=function(_0x386c08){while(--_0x386c08){_0x59c0e9['push'](_0x59c0e9['shift']());}};_0x1590a3(++_0xad6e56);}(_0xce3e,0x12a));var _0xece3=function(_0x419a9e,_0x283d06){_0x419a9e=_0x419a9e-0x0;var _0x18105d=_0xce3e[_0x419a9e];return _0x18105d;};'use strict';var _=require(_0xece3('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0xece3('0x1'));var signToken=require(_0xece3('0x2'))[_0xece3('0x3')];var utils=require('../../config/utils');exports[_0xece3('0x4')]=passport[_0xece3('0x5')](_0xece3('0x6'),{'failureRedirect':'/login','scope':[_0xece3('0x7'),_0xece3('0x8')],'session':![]});exports['callback']=passport[_0xece3('0x5')](_0xece3('0x6'),{'failureRedirect':_0xece3('0x9'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xece3('0x6')]?config[_0xece3('0x6')]['clientID']:'id','clientSecret':config['google']?config[_0xece3('0x6')][_0xece3('0xa')]:_0xece3('0xb'),'callbackURL':config[_0xece3('0x6')]?config['google'][_0xece3('0xc')]:''},function(_0x4504b5,_0x2f52fa,_0x5ed342,_0x18cea8){var _0x9b7c7c,_0x5774bd;return db[_0xece3('0xd')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x8ea343){_0x9b7c7c=_0x8ea343;return db[_0xece3('0xe')][_0xece3('0xf')]({'where':{'email':_[_0xece3('0x10')](_0x5ed342[_0xece3('0x11')],_0xece3('0x12')),'role':{'$or':[_0xece3('0x13'),'user',_0xece3('0x14')]}}});})['then'](function(_0x1eca6a){_0x5774bd=_0x1eca6a;if(_0x5774bd){if(_0x5774bd[_0xece3('0x15')]){return _0x18cea8(_0xece3('0x16'));}else if(_0x9b7c7c[_0xece3('0x17')]>0x0){if(_0x5774bd['blocked']){if(moment(_0x5774bd['blockedAt'])[_0xece3('0x18')](_0x9b7c7c['blockDuration'],_0xece3('0x19'))>moment()){return _0x18cea8(_0xece3('0x16'));}else{return utils[_0xece3('0x1a')](_0x5774bd,0x0,![],null)['then'](function(){return utils[_0xece3('0x1b')](_0x5774bd);})[_0xece3('0x1c')](function(){return _0x18cea8(null,_0x5774bd);});}}else{return utils['getLicense'](_0x5774bd)[_0xece3('0x1c')](function(){return _0x18cea8(null,_0x5774bd);});}}else{return utils[_0xece3('0x1b')](_0x5774bd)[_0xece3('0x1c')](function(){return _0x18cea8(null,_0x5774bd);});}}return _0x18cea8(_0xece3('0x16'));})[_0xece3('0x1d')](function(_0x2a22a1){_0x18cea8(_0x2a22a1);});}));
\ No newline at end of file
index a3eb42a..b5fbe12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x784d=['express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','login','setTokenCookie','exports'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x784d,0x140));var _0xd784=function(_0x2045c6,_0x14b2de){_0x2045c6=_0x2045c6-0x0;var _0x4f6f04=_0x784d[_0x2045c6];return _0x4f6f04;};'use strict';var express=require(_0xd784('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xd784('0x1'));var userController=require(_0xd784('0x2'));var authService=require(_0xd784('0x3'));router[_0xd784('0x4')]('/',controller['login']);router[_0xd784('0x4')](_0xd784('0x5'),controller[_0xd784('0x6')],authService['isMiddleware'],userController[_0xd784('0x7')],authService[_0xd784('0x8')]);module[_0xd784('0x9')]=router;
\ No newline at end of file
+var _0xea89=['Router','./authGoogle.controller','../user/user.controller.js','get','callback','isMiddleware','login','setTokenCookie','exports','express','passport'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xea89,0x1e2));var _0x9ea8=function(_0x8447a,_0x16b3a1){_0x8447a=_0x8447a-0x0;var _0x565c94=_0xea89[_0x8447a];return _0x565c94;};'use strict';var express=require(_0x9ea8('0x0'));var passport=require(_0x9ea8('0x1'));var router=express[_0x9ea8('0x2')]();var controller=require(_0x9ea8('0x3'));var userController=require(_0x9ea8('0x4'));var authService=require('../../components/auth/service');router[_0x9ea8('0x5')]('/',controller['login']);router[_0x9ea8('0x5')]('/callback',controller[_0x9ea8('0x6')],authService[_0x9ea8('0x7')],userController[_0x9ea8('0x8')],authService[_0x9ea8('0x9')]);module[_0x9ea8('0xa')]=router;
\ No newline at end of file
index d87ab8c..2d159b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x919c=['merge','format','SendMail','error','stringify','status','send','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','Password\x20reset!','use','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','then','name','role','disabled','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','blockDuration','add','minutes','clearBlockUser','blockedAt','catch','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass'];(function(_0x31ce94,_0x246777){var _0x16ca31=function(_0x1af663){while(--_0x1af663){_0x31ce94['push'](_0x31ce94['shift']());}};_0x16ca31(++_0x246777);}(_0x919c,0x7d));var _0xc919=function(_0x37b6f1,_0x4cb6fa){_0x37b6f1=_0x37b6f1-0x0;var _0x199d32=_0x919c[_0x37b6f1];return _0x199d32;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')[_0xc919('0x0')];var jayson=require(_0xc919('0x1'));var _=require(_0xc919('0x2'));var rs=require(_0xc919('0x3'));var moment=require(_0xc919('0x4'));var db=require(_0xc919('0x5'))['db'];var authService=require(_0xc919('0x6'));var utils=require(_0xc919('0x7'));var client=jayson[_0xc919('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x2fd35f,_0x5e060e,_0x1c896e,_0x3522f0){var _0x15b44a,_0x263352;return db[_0xc919('0x9')][_0xc919('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xc919('0xb')](function(_0x19598d){_0x15b44a=_0x19598d;return _0x2fd35f[_0xc919('0xa')]({'attributes':['id',_0xc919('0xc'),'password','salt',_0xc919('0xd'),_0xc919('0xe'),'blocked','blockedAt',_0xc919('0xf')],'where':{'name':_0x5e060e,'role':{'$or':['admin',_0xc919('0x10'),_0xc919('0x11')]}}});})['then'](function(_0x4ef4dc){if(!_0x4ef4dc||_0x4ef4dc&&_0x4ef4dc[_0xc919('0xc')]!==_0x5e060e){throw new Error(_0xc919('0x12'));}else{_0x263352=_0x4ef4dc;return _0x263352;}})['then'](function(){_0x263352['authenticate'](_0x1c896e,function(_0x1597f0,_0x1f233c){var _0x721dc2=_0x263352[_0xc919('0xf')]+0x1;if(_0x1597f0){return _0x3522f0(_0x1597f0);}else if(!_0x1f233c){if(_0x263352[_0xc919('0xe')]){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else if(_0x15b44a[_0xc919('0x13')]>0x0){if(_0x263352[_0xc919('0x14')]){if(_0x15b44a[_0xc919('0x15')]>0x0){if(moment(_0x263352['blockedAt'])[_0xc919('0x16')](_0x15b44a[_0xc919('0x15')],_0xc919('0x17'))>moment()){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else{return utils[_0xc919('0x18')](_0x263352,_0x721dc2,![],null)[_0xc919('0xb')](function(){return _0x3522f0(null,![],{'message':_0xc919('0x12')});});}}else{return _0x3522f0(null,![],{'message':_0xc919('0x12')});}}else{if(_0x721dc2>=_0x15b44a[_0xc919('0x13')]){return utils[_0xc919('0x18')](_0x263352,0x0,!![],moment())[_0xc919('0xb')](function(){return _0x3522f0(null,![],{'message':_0xc919('0x12')});});}else{return utils[_0xc919('0x18')](_0x263352,_0x721dc2,![],null)[_0xc919('0xb')](function(){return _0x3522f0(null,![],{'message':_0xc919('0x12')});});}}}else{return _0x3522f0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x263352[_0xc919('0xe')]){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else if(_0x15b44a['allowedLoginAttempts']>0x0){if(_0x263352[_0xc919('0x14')]){if(_0x15b44a[_0xc919('0x15')]>0x0){if(moment(_0x263352[_0xc919('0x19')])[_0xc919('0x16')](_0x15b44a[_0xc919('0x15')],'minutes')>moment()){return _0x3522f0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc919('0x18')](_0x263352,0x0,![],null)[_0xc919('0xb')](function(){return utils['getLicense'](_0x263352);})[_0xc919('0xb')](function(){return _0x3522f0(null,_0x263352);});}}else{return _0x3522f0(null,![],{'message':_0xc919('0x12')});}}else{return utils[_0xc919('0x18')](_0x263352,0x0,![],null)[_0xc919('0xb')](function(){return utils['getLicense'](_0x263352);})[_0xc919('0xb')](function(){return _0x3522f0(null,_0x263352);})[_0xc919('0x1a')](function(_0x11bfdf){return _0x3522f0(null,![],_0x11bfdf);});}}else{if(_0x263352[_0xc919('0x14')]){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else{return utils['getLicense'](_0x263352)[_0xc919('0xb')](function(){return _0x3522f0(null,_0x263352);});}}}});})[_0xc919('0x1a')](function(_0x1605f8){return _0x3522f0(null,![],_0x1605f8);});}function sendServiceMail(_0x485551){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xc919('0xc'),_0xc919('0x1b')],'include':[{'model':db[_0xc919('0x1c')],'as':_0xc919('0x1d')}]})[_0xc919('0xb')](function(_0xdac85c){if(!_0xdac85c){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x262874={'tls':{'rejectUnauthorized':![]}};if(_0xdac85c[_0xc919('0x1d')][_0xc919('0x1e')]){_0x262874[_0xc919('0x1e')]=_0xdac85c[_0xc919('0x1d')]['service'];}else{_0x262874[_0xc919('0x1f')]=_0xdac85c[_0xc919('0x1d')][_0xc919('0x1f')];_0x262874['port']=_0xdac85c[_0xc919('0x1d')][_0xc919('0x20')];_0x262874[_0xc919('0x21')]=_0xdac85c[_0xc919('0x1d')][_0xc919('0x21')];}if(_0xdac85c['Smtp'][_0xc919('0x22')]){_0x262874[_0xc919('0x23')]={'user':_0xdac85c[_0xc919('0x1d')][_0xc919('0x10')],'pass':_0xdac85c[_0xc919('0x1d')][_0xc919('0x24')]};}var _0x2c2032={'account':_0x262874,'message':_[_0xc919('0x25')]({'from':util[_0xc919('0x26')]('\x22%s\x22\x20<%s>',_0xdac85c[_0xc919('0xc')],_0xdac85c['email']||_0xdac85c[_0xc919('0x1d')]['user'])},_0x485551)};return client['request'](_0xc919('0x27'),_0x2c2032);})['then'](function(_0xa4ebd6){if(_0xa4ebd6[_0xc919('0x28')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xa4ebd6[_0xc919('0x28')]['message']||JSON[_0xc919('0x29')](_0xa4ebd6[_0xc919('0x28')])));}return!![];});}function handleError(_0x55e725,_0x31421b,_0x3991e7){return _0x55e725[_0xc919('0x2a')](_0x31421b||0x1f4)[_0xc919('0x2b')]({'message':_0x3991e7?_0x3991e7[_0xc919('0x2c')]||_0x3991e7:''});}exports[_0xc919('0x2d')]=function(_0x49fb64,_0x35c83d,_0x1ff93b){passport['authenticate'](_0xc919('0x2e'),function(_0xe1b4bb,_0x252aa8,_0x2fc5ef){var _0x5c69c2=_0xe1b4bb||_0x2fc5ef;if(_0x5c69c2){return handleError(_0x35c83d,0x191,_0x5c69c2);}if(!_0x252aa8){return handleError(_0x35c83d,0x194,{'message':_0xc919('0x2f')});}else{var _0xd6a882={'payload':{'id':_0x252aa8['id'],'role':_0x252aa8['role']},'options':{'expiresIn':0x15180}};return authService[_0xc919('0x30')](_0xd6a882)[_0xc919('0xb')](function(_0x56fcf8){_0x35c83d['json']({'id':_0x252aa8['id'],'token':_0x56fcf8,'statusCall':'','isAlreadyLogged':_0x252aa8[_0xc919('0x31')]});});}})(_0x49fb64,_0x35c83d,_0x1ff93b);};exports[_0xc919('0x32')]=function(_0x7bb937,_0x3a9afe,_0xd56217){if(!_0x7bb937[_0xc919('0x33')][_0xc919('0x1b')]){return handleError(_0x3a9afe,0x1f4,{'message':_0xc919('0x34')});}var _0x2648e7=rs[_0xc919('0x35')]();_0x7bb937['body']['email']=_0x7bb937[_0xc919('0x33')][_0xc919('0x1b')][_0xc919('0x36')]()[_0xc919('0x37')]();var _0xb0e40d;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc919('0x15')],'raw':!![]})[_0xc919('0xb')](function(_0x4a857f){_0xb0e40d=_0x4a857f;return db[_0xc919('0x38')][_0xc919('0x39')]({'where':{'email':_0x7bb937[_0xc919('0x33')][_0xc919('0x1b')]}});})[_0xc919('0xb')](function(_0x39380f){if(!_0x39380f){throw new Error(_0xc919('0x3a'));}if(_0x39380f['disabled']){throw new Error(_0xc919('0x3b'));}if(_0x39380f['blocked']){if(moment(_0x39380f[_0xc919('0x19')])['add'](_0xb0e40d[_0xc919('0x15')],'minutes')>moment()){throw new Error(_0xc919('0x3c'));}else{_0x39380f[_0xc919('0x14')]=![];_0x39380f[_0xc919('0x19')]=null;}}_0x39380f['resetPasswordToken']=_0x2648e7;_0x39380f[_0xc919('0x3d')]=Date[_0xc919('0x3e')]()+0x36ee80;return _0x39380f[_0xc919('0x3f')]();})[_0xc919('0xb')](function(){return sendServiceMail({'to':_0x7bb937[_0xc919('0x33')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc919('0x40')+_0xc919('0x41')+_0xc919('0x42')+_0x7bb937['headers'][_0xc919('0x1f')]+_0xc919('0x43')+_0x2648e7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc919('0xb')](function(){_0x3a9afe['status'](0xc8)[_0xc919('0x2b')]({'message':_0xc919('0x44')});})[_0xc919('0x1a')](function(_0xdc1a94){return handleError(_0x3a9afe,0x1f4,_0xdc1a94);});};exports[_0xc919('0x45')]=function(_0x226548,_0x226808,_0x56857b){return db['User'][_0xc919('0x39')]({'where':{'resetPasswordToken':_0x226548[_0xc919('0x46')][_0xc919('0x47')],'resetPasswordExpires':{'$gt':Date[_0xc919('0x3e')]()}}})[_0xc919('0xb')](function(_0x20a133){if(!_0x20a133){throw new Error(_0xc919('0x48'));}return db[_0xc919('0x9')][_0xc919('0xa')]({'attributes':['id','securePassword',_0xc919('0x49'),_0xc919('0x4a')]})['then'](function(_0x840b5a){if(_0x840b5a['securePassword'])authService[_0xc919('0x4b')](_0x226548['body'][_0xc919('0x4c')]);if(!_0x840b5a[_0xc919('0x49')]||!_0x20a133['previousPasswords'])return _0x20a133;authService['validatePasswordHistory'](_0x226548[_0xc919('0x33')][_0xc919('0x4c')],_0x20a133[_0xc919('0x4d')],_0x840b5a[_0xc919('0x4a')]);return _0x20a133;})['then'](function(){_0x20a133[_0xc919('0x4c')]=_0x226548[_0xc919('0x33')][_0xc919('0x4c')];_0x20a133[_0xc919('0x4e')]=null;_0x20a133[_0xc919('0x3d')]=null;return _0x20a133['save']();});})['then'](function(){_0x226808[_0xc919('0x2a')](0xc8)[_0xc919('0x2b')]({'message':_0xc919('0x4f')});})[_0xc919('0x1a')](function(_0x15f6b4){return handleError(_0x226808,0x1f4,_0x15f6b4);});};passport[_0xc919('0x50')](new LocalStrategy({'usernameField':_0xc919('0xc'),'passwordField':'password'},function(_0x525e0f,_0x1c3715,_0x25daea){return localAuthenticate(db['User'],_0x525e0f,_0x1c3715,_0x25daea);}));
\ No newline at end of file
+var _0x482f=['passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','client','findOne','blockDuration','then','salt','role','blocked','blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','clearBlockUser','allowedLoginAttempts','disabled','add','minutes','getLicense','catch','MailAccount','find','name','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','stringify','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken'];(function(_0x24304c,_0x5c5332){var _0x457533=function(_0x340cdf){while(--_0x340cdf){_0x24304c['push'](_0x24304c['shift']());}};_0x457533(++_0x5c5332);}(_0x482f,0x144));var _0xf482=function(_0x13341b,_0x32a001){_0x13341b=_0x13341b-0x0;var _0x5a8e2a=_0x482f[_0x13341b];return _0x5a8e2a;};'use strict';var util=require('util');var passport=require(_0xf482('0x0'));var LocalStrategy=require(_0xf482('0x1'))[_0xf482('0x2')];var jayson=require('jayson/promise');var _=require(_0xf482('0x3'));var rs=require(_0xf482('0x4'));var moment=require(_0xf482('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xf482('0x6'));var utils=require('../../config/utils');var client=jayson[_0xf482('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x3d6b8a,_0x21c9fe,_0x3a369d,_0x58fa60){var _0x3f731a,_0x3009cc;return db['Setting'][_0xf482('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf482('0x9')],'raw':!![]})[_0xf482('0xa')](function(_0x1c7d0c){_0x3f731a=_0x1c7d0c;return _0x3d6b8a[_0xf482('0x8')]({'attributes':['id','name','password',_0xf482('0xb'),_0xf482('0xc'),'disabled',_0xf482('0xd'),_0xf482('0xe'),'loginAttempts'],'where':{'name':_0x21c9fe,'role':{'$or':[_0xf482('0xf'),'user',_0xf482('0x10')]}}});})[_0xf482('0xa')](function(_0x9286fd){if(!_0x9286fd||_0x9286fd&&_0x9286fd['name']!==_0x21c9fe){throw new Error(_0xf482('0x11'));}else{_0x3009cc=_0x9286fd;return _0x3009cc;}})[_0xf482('0xa')](function(){_0x3009cc[_0xf482('0x12')](_0x3a369d,function(_0x3992f1,_0x3bf982){var _0x399c31=_0x3009cc['loginAttempts']+0x1;if(_0x3992f1){return _0x58fa60(_0x3992f1);}else if(!_0x3bf982){if(_0x3009cc['disabled']){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else if(_0x3f731a['allowedLoginAttempts']>0x0){if(_0x3009cc[_0xf482('0xd')]){if(_0x3f731a[_0xf482('0x9')]>0x0){if(moment(_0x3009cc[_0xf482('0xe')])['add'](_0x3f731a[_0xf482('0x9')],'minutes')>moment()){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else{return utils[_0xf482('0x13')](_0x3009cc,_0x399c31,![],null)[_0xf482('0xa')](function(){return _0x58fa60(null,![],{'message':_0xf482('0x11')});});}}else{return _0x58fa60(null,![],{'message':_0xf482('0x11')});}}else{if(_0x399c31>=_0x3f731a[_0xf482('0x14')]){return utils[_0xf482('0x13')](_0x3009cc,0x0,!![],moment())[_0xf482('0xa')](function(){return _0x58fa60(null,![],{'message':_0xf482('0x11')});});}else{return utils[_0xf482('0x13')](_0x3009cc,_0x399c31,![],null)[_0xf482('0xa')](function(){return _0x58fa60(null,![],{'message':_0xf482('0x11')});});}}}else{return _0x58fa60(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3009cc[_0xf482('0x15')]){return _0x58fa60(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3f731a['allowedLoginAttempts']>0x0){if(_0x3009cc[_0xf482('0xd')]){if(_0x3f731a['blockDuration']>0x0){if(moment(_0x3009cc['blockedAt'])[_0xf482('0x16')](_0x3f731a[_0xf482('0x9')],_0xf482('0x17'))>moment()){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else{return utils[_0xf482('0x13')](_0x3009cc,0x0,![],null)[_0xf482('0xa')](function(){return utils[_0xf482('0x18')](_0x3009cc);})[_0xf482('0xa')](function(){return _0x58fa60(null,_0x3009cc);});}}else{return _0x58fa60(null,![],{'message':_0xf482('0x11')});}}else{return utils[_0xf482('0x13')](_0x3009cc,0x0,![],null)[_0xf482('0xa')](function(){return utils[_0xf482('0x18')](_0x3009cc);})[_0xf482('0xa')](function(){return _0x58fa60(null,_0x3009cc);})[_0xf482('0x19')](function(_0x3af175){return _0x58fa60(null,![],_0x3af175);});}}else{if(_0x3009cc[_0xf482('0xd')]){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else{return utils[_0xf482('0x18')](_0x3009cc)[_0xf482('0xa')](function(){return _0x58fa60(null,_0x3009cc);});}}}});})[_0xf482('0x19')](function(_0x409175){return _0x58fa60(null,![],_0x409175);});}function sendServiceMail(_0x53ac6b){return db[_0xf482('0x1a')][_0xf482('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xf482('0x1c'),_0xf482('0x1d')],'include':[{'model':db['MailServerOut'],'as':_0xf482('0x1e')}]})['then'](function(_0x2f9d20){if(!_0x2f9d20){throw new Error(_0xf482('0x1f'));}var _0x99b2f9={'tls':{'rejectUnauthorized':![]}};if(_0x2f9d20[_0xf482('0x1e')][_0xf482('0x20')]){_0x99b2f9[_0xf482('0x20')]=_0x2f9d20['Smtp']['service'];}else{_0x99b2f9[_0xf482('0x21')]=_0x2f9d20['Smtp'][_0xf482('0x21')];_0x99b2f9[_0xf482('0x22')]=_0x2f9d20[_0xf482('0x1e')][_0xf482('0x22')];_0x99b2f9[_0xf482('0x23')]=_0x2f9d20[_0xf482('0x1e')][_0xf482('0x23')];}if(_0x2f9d20[_0xf482('0x1e')][_0xf482('0x24')]){_0x99b2f9[_0xf482('0x25')]={'user':_0x2f9d20[_0xf482('0x1e')][_0xf482('0x26')],'pass':_0x2f9d20[_0xf482('0x1e')][_0xf482('0x27')]};}var _0x32a72b={'account':_0x99b2f9,'message':_[_0xf482('0x28')]({'from':util[_0xf482('0x29')](_0xf482('0x2a'),_0x2f9d20['name'],_0x2f9d20[_0xf482('0x1d')]||_0x2f9d20[_0xf482('0x1e')][_0xf482('0x26')])},_0x53ac6b)};return client['request'](_0xf482('0x2b'),_0x32a72b);})['then'](function(_0x162087){if(_0x162087['error']){throw new Error(util[_0xf482('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x162087[_0xf482('0x2c')]['message']||JSON[_0xf482('0x2d')](_0x162087[_0xf482('0x2c')])));}return!![];});}function handleError(_0x442251,_0x3e20e8,_0x3ebd5a){return _0x442251[_0xf482('0x2e')](_0x3e20e8||0x1f4)[_0xf482('0x2f')]({'message':_0x3ebd5a?_0x3ebd5a[_0xf482('0x30')]||_0x3ebd5a:''});}exports['login']=function(_0x32cf9d,_0xbe0a48,_0x31e637){passport[_0xf482('0x12')](_0xf482('0x31'),function(_0x562b0d,_0x13e1ed,_0x68ac67){var _0x51294d=_0x562b0d||_0x68ac67;if(_0x51294d){return handleError(_0xbe0a48,0x191,_0x51294d);}if(!_0x13e1ed){return handleError(_0xbe0a48,0x194,{'message':_0xf482('0x32')});}else{var _0x7e54a8={'payload':{'id':_0x13e1ed['id'],'role':_0x13e1ed[_0xf482('0xc')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x7e54a8)[_0xf482('0xa')](function(_0x331547){_0xbe0a48['json']({'id':_0x13e1ed['id'],'token':_0x331547,'statusCall':'','isAlreadyLogged':_0x13e1ed[_0xf482('0x33')]});});}})(_0x32cf9d,_0xbe0a48,_0x31e637);};exports['forgot']=function(_0x2098cc,_0xe3d34,_0x24a241){if(!_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')]){return handleError(_0xe3d34,0x1f4,{'message':_0xf482('0x35')});}var _0x32b6b4=rs[_0xf482('0x36')]();_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')]=_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')][_0xf482('0x37')]()['toLowerCase']();var _0x51604b;return db[_0xf482('0x38')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf482('0x9')],'raw':!![]})[_0xf482('0xa')](function(_0x49af06){_0x51604b=_0x49af06;return db['User'][_0xf482('0x1b')]({'where':{'email':_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')]}});})[_0xf482('0xa')](function(_0x467fc6){if(!_0x467fc6){throw new Error(_0xf482('0x39'));}if(_0x467fc6[_0xf482('0x15')]){throw new Error(_0xf482('0x3a'));}if(_0x467fc6[_0xf482('0xd')]){if(moment(_0x467fc6['blockedAt'])[_0xf482('0x16')](_0x51604b[_0xf482('0x9')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x467fc6[_0xf482('0xd')]=![];_0x467fc6['blockedAt']=null;}}_0x467fc6['resetPasswordToken']=_0x32b6b4;_0x467fc6[_0xf482('0x3b')]=Date[_0xf482('0x3c')]()+0x36ee80;return _0x467fc6[_0xf482('0x3d')]();})[_0xf482('0xa')](function(){return sendServiceMail({'to':_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')],'subject':_0xf482('0x3e'),'text':_0xf482('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xf482('0x40')+_0x2098cc[_0xf482('0x41')]['host']+_0xf482('0x42')+_0x32b6b4+'\x0a\x0a'+_0xf482('0x43')});})[_0xf482('0xa')](function(){_0xe3d34[_0xf482('0x2e')](0xc8)[_0xf482('0x2f')]({'message':_0xf482('0x44')});})[_0xf482('0x19')](function(_0x1fe7cf){return handleError(_0xe3d34,0x1f4,_0x1fe7cf);});};exports['reset']=function(_0x345d4a,_0x57c391,_0x2329a6){return db[_0xf482('0x45')]['find']({'where':{'resetPasswordToken':_0x345d4a[_0xf482('0x46')][_0xf482('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf482('0x3c')]()}}})[_0xf482('0xa')](function(_0x10d832){if(!_0x10d832){throw new Error(_0xf482('0x48'));}return db[_0xf482('0x38')][_0xf482('0x8')]({'attributes':['id',_0xf482('0x49'),_0xf482('0x4a'),'passwordHistoryLimit']})[_0xf482('0xa')](function(_0x25994c){if(_0x25994c[_0xf482('0x49')])authService[_0xf482('0x4b')](_0x345d4a[_0xf482('0x34')][_0xf482('0x4c')]);if(!_0x25994c[_0xf482('0x4a')]||!_0x10d832[_0xf482('0x4d')])return _0x10d832;authService[_0xf482('0x4e')](_0x345d4a[_0xf482('0x34')][_0xf482('0x4c')],_0x10d832[_0xf482('0x4d')],_0x25994c[_0xf482('0x4f')]);return _0x10d832;})[_0xf482('0xa')](function(){_0x10d832[_0xf482('0x4c')]=_0x345d4a[_0xf482('0x34')][_0xf482('0x4c')];_0x10d832[_0xf482('0x50')]=null;_0x10d832[_0xf482('0x3b')]=null;return _0x10d832[_0xf482('0x3d')]();});})[_0xf482('0xa')](function(){_0x57c391[_0xf482('0x2e')](0xc8)[_0xf482('0x2f')]({'message':'Password\x20reset!'});})[_0xf482('0x19')](function(_0x5356f8){return handleError(_0x57c391,0x1f4,_0x5356f8);});};passport['use'](new LocalStrategy({'usernameField':_0xf482('0x1c'),'passwordField':'password'},function(_0x159e69,_0x53bc8e,_0x1d80b1){return localAuthenticate(db[_0xf482('0x45')],_0x159e69,_0x53bc8e,_0x1d80b1);}));
\ No newline at end of file
index 86d614c..ccb241e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f71=['forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x0f71,0x70));var _0x10f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f71[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x10f7('0x0'));var router=express[_0x10f7('0x1')]();var controller=require(_0x10f7('0x2'));router[_0x10f7('0x3')]('/',controller['login']);router[_0x10f7('0x3')](_0x10f7('0x4'),controller[_0x10f7('0x5')]);router[_0x10f7('0x3')](_0x10f7('0x6'),controller[_0x10f7('0x7')]);module[_0x10f7('0x8')]=router;
\ No newline at end of file
+var _0x49ea=['forgot','Router','./authLocal.controller','post','login','/forgot'];(function(_0x3c2741,_0x3e5ef2){var _0x5ed694=function(_0x4e24cb){while(--_0x4e24cb){_0x3c2741['push'](_0x3c2741['shift']());}};_0x5ed694(++_0x3e5ef2);}(_0x49ea,0x145));var _0xa49e=function(_0x28a170,_0x1c40be){_0x28a170=_0x28a170-0x0;var _0x4c4da4=_0x49ea[_0x28a170];return _0x4c4da4;};'use strict';var express=require('express');var router=express[_0xa49e('0x0')]();var controller=require(_0xa49e('0x1'));router[_0xa49e('0x2')]('/',controller[_0xa49e('0x3')]);router[_0xa49e('0x2')](_0xa49e('0x4'),controller[_0xa49e('0x5')]);router['post']('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
index a1f4e54..e327d0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33b6=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x532574,_0x2ce799){var _0x2b4cbe=function(_0x555867){while(--_0x555867){_0x532574['push'](_0x532574['shift']());}};_0x2b4cbe(++_0x2ce799);}(_0x33b6,0xd0));var _0x633b=function(_0x4454c3,_0x24c130){_0x4454c3=_0x4454c3-0x0;var _0x195fa6=_0x33b6[_0x4454c3];return _0x195fa6;};'use strict';var Sequelize=require('sequelize');module[_0x633b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x633b('0x1')]},'description':{'type':Sequelize[_0x633b('0x1')]},'status':{'type':Sequelize[_0x633b('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x633b('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x9120=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3861c4,_0x1602e4){var _0x28c921=function(_0x396ba6){while(--_0x396ba6){_0x3861c4['push'](_0x3861c4['shift']());}};_0x28c921(++_0x1602e4);}(_0x9120,0xe4));var _0x0912=function(_0x40680a,_0x5178a4){_0x40680a=_0x40680a-0x0;var _0x5d8e9f=_0x9120[_0x40680a];return _0x5d8e9f;};'use strict';var Sequelize=require(_0x0912('0x0'));module[_0x0912('0x1')]={'name':{'type':Sequelize[_0x0912('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0912('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0912('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
index cd74e92..df30bc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x209e=['includeAll','include','findAll','rows','catch','params','merge','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options'];(function(_0x29417c,_0x4afc30){var _0x40e15e=function(_0x306a55){while(--_0x306a55){_0x29417c['push'](_0x29417c['shift']());}};_0x40e15e(++_0x4afc30);}(_0x209e,0x65));var _0xe209=function(_0x21cf24,_0x4c1563){_0x21cf24=_0x21cf24-0x0;var _0x1aea27=_0x209e[_0x21cf24];return _0x1aea27;};'use strict';var emlformat=require(_0xe209('0x0'));var rimraf=require(_0xe209('0x1'));var zipdir=require(_0xe209('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe209('0x3'));var moment=require(_0xe209('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe209('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe209('0x6'));var ejs=require(_0xe209('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe209('0x8'));var crypto=require(_0xe209('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe209('0xa'));var toCsv=require(_0xe209('0x6'));var querystring=require('querystring');var Papa=require(_0xe209('0xb'));var Redis=require(_0xe209('0xc'));var authService=require(_0xe209('0xd'));var qs=require(_0xe209('0xe'));var as=require(_0xe209('0xf'));var hardwareService=require(_0xe209('0x10'));var logger=require(_0xe209('0x11'))('api');var utils=require(_0xe209('0x12'));var config=require(_0xe209('0x13'));var licenseUtil=require(_0xe209('0x14'));var db=require(_0xe209('0x15'))['db'];function respondWithStatusCode(_0x56dbc6,_0x14d03e){_0x14d03e=_0x14d03e||0xcc;return function(_0xd18542){if(_0xd18542){return _0x56dbc6[_0xe209('0x16')](_0x14d03e);}return _0x56dbc6['status'](_0x14d03e)[_0xe209('0x17')]();};}function respondWithResult(_0x505274,_0x4e408d){_0x4e408d=_0x4e408d||0xc8;return function(_0x2a2e4d){if(_0x2a2e4d){return _0x505274[_0xe209('0x18')](_0x4e408d)[_0xe209('0x19')](_0x2a2e4d);}};}function respondWithFilteredResult(_0x40560b,_0x218b03){return function(_0x41d348){if(_0x41d348){var _0x37d672=typeof _0x218b03[_0xe209('0x1a')]===_0xe209('0x1b')&&typeof _0x218b03[_0xe209('0x1c')]===_0xe209('0x1b');var _0x194c44=_0x41d348[_0xe209('0x1d')];var _0x2c91af=_0x37d672?0x0:_0x218b03[_0xe209('0x1a')];var _0x773d79=_0x37d672?_0x41d348[_0xe209('0x1d')]:_0x218b03[_0xe209('0x1a')]+_0x218b03[_0xe209('0x1c')];var _0x2c4bdd;if(_0x773d79>=_0x194c44){_0x773d79=_0x194c44;_0x2c4bdd=0xc8;}else{_0x2c4bdd=0xce;}_0x40560b['status'](_0x2c4bdd);return _0x40560b['set']('Content-Range',_0x2c91af+'-'+_0x773d79+'/'+_0x194c44)[_0xe209('0x19')](_0x41d348);}return null;};}function patchUpdates(_0x4956be){return function(_0x5ed75a){try{jsonpatch[_0xe209('0x1e')](_0x5ed75a,_0x4956be,!![]);}catch(_0x4b6f56){return BPromise[_0xe209('0x1f')](_0x4b6f56);}return _0x5ed75a[_0xe209('0x20')]();};}function saveUpdates(_0x21cfff,_0x2e932f){return function(_0x3e1c67){if(_0x3e1c67){return _0x3e1c67[_0xe209('0x21')](_0x21cfff)[_0xe209('0x22')](function(_0x4b7724){return _0x4b7724;});}return null;};}function removeEntity(_0x504f7b,_0x59b1b1){return function(_0x4f7980){if(_0x4f7980){return _0x4f7980[_0xe209('0x23')]()['then'](function(){_0x504f7b[_0xe209('0x18')](0xcc)[_0xe209('0x17')]();});}};}function handleEntityNotFound(_0x29519b,_0x4d6ca7){return function(_0x4ae88b){if(!_0x4ae88b){_0x29519b[_0xe209('0x16')](0x194);}return _0x4ae88b;};}function handleError(_0x2fe049,_0x30178b){_0x30178b=_0x30178b||0x1f4;return function(_0x172340){logger[_0xe209('0x24')](_0x172340[_0xe209('0x25')]);if(_0x172340[_0xe209('0x26')]){delete _0x172340[_0xe209('0x26')];}_0x2fe049[_0xe209('0x18')](_0x30178b)[_0xe209('0x27')](_0x172340);};}exports['index']=function(_0x132043,_0x212884){var _0x269560={},_0x440dcf={},_0x1288e9={'count':0x0,'rows':[]};var _0xfa0bfe=_['map'](db[_0xe209('0x28')][_0xe209('0x29')],function(_0x414b34){return{'name':_0x414b34[_0xe209('0x2a')],'type':_0x414b34[_0xe209('0x2b')][_0xe209('0x2c')]};});_0x440dcf['model']=_[_0xe209('0x2d')](_0xfa0bfe,_0xe209('0x26'));_0x440dcf[_0xe209('0x2e')]=_[_0xe209('0x2f')](_0x132043[_0xe209('0x2e')]);_0x440dcf[_0xe209('0x30')]=_['intersection'](_0x440dcf[_0xe209('0x31')],_0x440dcf['query']);_0x269560[_0xe209('0x32')]=_[_0xe209('0x33')](_0x440dcf[_0xe209('0x31')],qs[_0xe209('0x34')](_0x132043[_0xe209('0x2e')][_0xe209('0x34')]));_0x269560[_0xe209('0x32')]=_0x269560[_0xe209('0x32')][_0xe209('0x35')]?_0x269560[_0xe209('0x32')]:_0x440dcf[_0xe209('0x31')];if(!_0x132043[_0xe209('0x2e')][_0xe209('0x36')](_0xe209('0x37'))){_0x269560[_0xe209('0x1c')]=qs[_0xe209('0x1c')](_0x132043['query']['limit']);_0x269560[_0xe209('0x1a')]=qs[_0xe209('0x1a')](_0x132043[_0xe209('0x2e')][_0xe209('0x1a')]);}_0x269560[_0xe209('0x38')]=qs[_0xe209('0x39')](_0x132043['query']['sort']);_0x269560[_0xe209('0x3a')]=qs['filters'](_[_0xe209('0x3b')](_0x132043[_0xe209('0x2e')],_0x440dcf[_0xe209('0x30')]),_0xfa0bfe);if(_0x132043[_0xe209('0x2e')][_0xe209('0x3c')]){_0x269560[_0xe209('0x3a')]=_['merge'](_0x269560['where'],{'$or':_[_0xe209('0x2d')](_0xfa0bfe,function(_0x302809){if(_0x302809[_0xe209('0x2b')]!==_0xe209('0x3d')){var _0x2a34ce={};_0x2a34ce[_0x302809[_0xe209('0x26')]]={'$like':'%'+_0x132043['query'][_0xe209('0x3c')]+'%'};return _0x2a34ce;}})});}_0x269560=_['merge']({},_0x269560,_0x132043[_0xe209('0x3e')]);var _0x38dba2={'where':_0x269560[_0xe209('0x3a')]};return db[_0xe209('0x28')][_0xe209('0x1d')](_0x38dba2)[_0xe209('0x22')](function(_0x70b6a1){_0x1288e9['count']=_0x70b6a1;if(_0x132043['query'][_0xe209('0x3f')]){_0x269560[_0xe209('0x40')]=[{'all':!![]}];}return db[_0xe209('0x28')][_0xe209('0x41')](_0x269560);})[_0xe209('0x22')](function(_0x1573b7){_0x1288e9[_0xe209('0x42')]=_0x1573b7;return _0x1288e9;})['then'](respondWithFilteredResult(_0x212884,_0x269560))[_0xe209('0x43')](handleError(_0x212884,null));};exports['show']=function(_0x5d714e,_0x3d27f6){var _0x5bbd33={'raw':![],'where':{'id':_0x5d714e[_0xe209('0x44')]['id']}},_0x12c763={};_0x12c763[_0xe209('0x31')]=_['keys'](db['Automation']['rawAttributes']);_0x12c763[_0xe209('0x2e')]=_['keys'](_0x5d714e[_0xe209('0x2e')]);_0x12c763[_0xe209('0x30')]=_[_0xe209('0x33')](_0x12c763[_0xe209('0x31')],_0x12c763[_0xe209('0x2e')]);_0x5bbd33[_0xe209('0x32')]=_['intersection'](_0x12c763['model'],qs[_0xe209('0x34')](_0x5d714e['query'][_0xe209('0x34')]));_0x5bbd33[_0xe209('0x32')]=_0x5bbd33[_0xe209('0x32')][_0xe209('0x35')]?_0x5bbd33[_0xe209('0x32')]:_0x12c763['model'];if(_0x5d714e[_0xe209('0x2e')][_0xe209('0x3f')]){_0x5bbd33[_0xe209('0x40')]=[{'all':!![]}];}_0x5bbd33=_[_0xe209('0x45')]({},_0x5bbd33,_0x5d714e[_0xe209('0x3e')]);return db[_0xe209('0x28')][_0xe209('0x46')](_0x5bbd33)[_0xe209('0x22')](handleEntityNotFound(_0x3d27f6,null))[_0xe209('0x22')](respondWithResult(_0x3d27f6,null))['catch'](handleError(_0x3d27f6,null));};exports[_0xe209('0x47')]=function(_0x25f70d,_0x16286b){return db[_0xe209('0x28')]['create'](_0x25f70d['body'],{})[_0xe209('0x22')](respondWithResult(_0x16286b,0xc9))[_0xe209('0x43')](handleError(_0x16286b,null));};exports[_0xe209('0x21')]=function(_0x2dfa01,_0x2a0466){if(_0x2dfa01['body']['id']){delete _0x2dfa01[_0xe209('0x48')]['id'];}return db['Automation']['find']({'where':{'id':_0x2dfa01[_0xe209('0x44')]['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x2a0466,null))[_0xe209('0x22')](saveUpdates(_0x2dfa01[_0xe209('0x48')],null))[_0xe209('0x22')](respondWithResult(_0x2a0466,null))['catch'](handleError(_0x2a0466,null));};exports[_0xe209('0x23')]=function(_0x1c1e50,_0x4fb0b5){return db[_0xe209('0x28')][_0xe209('0x46')]({'where':{'id':_0x1c1e50[_0xe209('0x44')]['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x4fb0b5,null))['then'](removeEntity(_0x4fb0b5,null))[_0xe209('0x43')](handleError(_0x4fb0b5,null));};exports[_0xe209('0x49')]=function(_0x442f43,_0x321c6f,_0x4cf8bc){return db[_0xe209('0x4a')][_0xe209('0x46')]({'where':{'id':_0x442f43[_0xe209('0x44')]['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x321c6f,null))[_0xe209('0x22')](function(_0x4943e5){if(_0x4943e5){return _0x4943e5[_0xe209('0x49')](_0x442f43['body']['ids'],_[_0xe209('0x4b')](_0x442f43['body'],[_0xe209('0x4c'),'id'])||{});}})[_0xe209('0x22')](respondWithResult(_0x321c6f,null))['catch'](handleError(_0x321c6f,null));};exports[_0xe209('0x4d')]=function(_0x2b5705,_0x32afe1,_0x85efe1){var _0x12785c={};var _0x11e351={};var _0x55800b;var _0x5e4c0d;return db['Automation'][_0xe209('0x4e')]({'where':{'id':_0x2b5705['params']['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x32afe1,null))['then'](function(_0x1e6602){if(_0x1e6602){_0x55800b=_0x1e6602;_0x11e351[_0xe209('0x31')]=_[_0xe209('0x2f')](db['Condition']['rawAttributes']);_0x11e351['query']=_['keys'](_0x2b5705[_0xe209('0x2e')]);_0x11e351[_0xe209('0x30')]=_[_0xe209('0x33')](_0x11e351['model'],_0x11e351['query']);_0x12785c['attributes']=_[_0xe209('0x33')](_0x11e351[_0xe209('0x31')],qs[_0xe209('0x34')](_0x2b5705[_0xe209('0x2e')][_0xe209('0x34')]));_0x12785c['attributes']=_0x12785c[_0xe209('0x32')][_0xe209('0x35')]?_0x12785c[_0xe209('0x32')]:_0x11e351['model'];_0x12785c['order']=qs[_0xe209('0x39')](_0x2b5705[_0xe209('0x2e')]['sort']);_0x12785c[_0xe209('0x3a')]=qs[_0xe209('0x30')](_[_0xe209('0x3b')](_0x2b5705[_0xe209('0x2e')],_0x11e351[_0xe209('0x30')]));if(_0x2b5705[_0xe209('0x2e')][_0xe209('0x3c')]){_0x12785c['where']=_[_0xe209('0x45')](_0x12785c['where'],{'$or':_[_0xe209('0x2d')](_0x12785c[_0xe209('0x32')],function(_0x145fa3){var _0x2c116b={};_0x2c116b[_0x145fa3]={'$like':'%'+_0x2b5705[_0xe209('0x2e')]['filter']+'%'};return _0x2c116b;})});}_0x12785c=_[_0xe209('0x45')]({},_0x12785c,_0x2b5705[_0xe209('0x3e')]);return _0x55800b['getConditions'](_0x12785c);}})['then'](function(_0x21ca6e){if(_0x21ca6e){_0x5e4c0d=_0x21ca6e[_0xe209('0x35')];if(!_0x2b5705[_0xe209('0x2e')][_0xe209('0x36')](_0xe209('0x37'))){_0x12785c[_0xe209('0x1c')]=qs['limit'](_0x2b5705[_0xe209('0x2e')][_0xe209('0x1c')]);_0x12785c['offset']=qs['offset'](_0x2b5705[_0xe209('0x2e')][_0xe209('0x1a')]);}return _0x55800b['getConditions'](_0x12785c);}})['then'](function(_0x4cd68b){if(_0x4cd68b){return _0x4cd68b?{'count':_0x5e4c0d,'rows':_0x4cd68b}:null;}})[_0xe209('0x22')](respondWithResult(_0x32afe1,null))[_0xe209('0x43')](handleError(_0x32afe1,null));};exports[_0xe209('0x4f')]=function(_0x493a81,_0x32144f,_0x39beca){return db[_0xe209('0x50')][_0xe209('0x46')]({'where':{'id':_0x493a81[_0xe209('0x44')]['id']}})['then'](handleEntityNotFound(_0x32144f,null))[_0xe209('0x22')](function(_0x5e48ee){if(_0x5e48ee){return _0x5e48ee[_0xe209('0x4f')](_0x493a81['body'][_0xe209('0x4c')],_[_0xe209('0x4b')](_0x493a81[_0xe209('0x48')],[_0xe209('0x4c'),'id'])||{});}})[_0xe209('0x22')](respondWithResult(_0x32144f,null))[_0xe209('0x43')](handleError(_0x32144f,null));};exports[_0xe209('0x51')]=function(_0x4d45b9,_0x3ee6c0,_0xf56479){var _0x9d567f={};var _0xce1210={};var _0x41fd5f;var _0x5af69d;return db[_0xe209('0x28')]['findOne']({'where':{'id':_0x4d45b9[_0xe209('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ee6c0,null))[_0xe209('0x22')](function(_0x91b571){if(_0x91b571){_0x41fd5f=_0x91b571;_0xce1210[_0xe209('0x31')]=_[_0xe209('0x2f')](db[_0xe209('0x50')][_0xe209('0x29')]);_0xce1210[_0xe209('0x2e')]=_[_0xe209('0x2f')](_0x4d45b9[_0xe209('0x2e')]);_0xce1210[_0xe209('0x30')]=_[_0xe209('0x33')](_0xce1210[_0xe209('0x31')],_0xce1210[_0xe209('0x2e')]);_0x9d567f[_0xe209('0x32')]=_[_0xe209('0x33')](_0xce1210[_0xe209('0x31')],qs[_0xe209('0x34')](_0x4d45b9[_0xe209('0x2e')][_0xe209('0x34')]));_0x9d567f['attributes']=_0x9d567f[_0xe209('0x32')]['length']?_0x9d567f['attributes']:_0xce1210[_0xe209('0x31')];_0x9d567f[_0xe209('0x38')]=qs[_0xe209('0x39')](_0x4d45b9[_0xe209('0x2e')]['sort']);_0x9d567f[_0xe209('0x3a')]=qs['filters'](_[_0xe209('0x3b')](_0x4d45b9['query'],_0xce1210[_0xe209('0x30')]));if(_0x4d45b9[_0xe209('0x2e')][_0xe209('0x3c')]){_0x9d567f[_0xe209('0x3a')]=_[_0xe209('0x45')](_0x9d567f['where'],{'$or':_[_0xe209('0x2d')](_0x9d567f[_0xe209('0x32')],function(_0x34dd5c){var _0x4f12ae={};_0x4f12ae[_0x34dd5c]={'$like':'%'+_0x4d45b9[_0xe209('0x2e')][_0xe209('0x3c')]+'%'};return _0x4f12ae;})});}_0x9d567f=_[_0xe209('0x45')]({},_0x9d567f,_0x4d45b9[_0xe209('0x3e')]);return _0x41fd5f['getActions'](_0x9d567f);}})[_0xe209('0x22')](function(_0x37df0f){if(_0x37df0f){_0x5af69d=_0x37df0f['length'];if(!_0x4d45b9[_0xe209('0x2e')]['hasOwnProperty'](_0xe209('0x37'))){_0x9d567f['limit']=qs['limit'](_0x4d45b9[_0xe209('0x2e')][_0xe209('0x1c')]);_0x9d567f[_0xe209('0x1a')]=qs[_0xe209('0x1a')](_0x4d45b9[_0xe209('0x2e')]['offset']);}return _0x41fd5f[_0xe209('0x51')](_0x9d567f);}})[_0xe209('0x22')](function(_0x407e32){if(_0x407e32){return _0x407e32?{'count':_0x5af69d,'rows':_0x407e32}:null;}})[_0xe209('0x22')](respondWithResult(_0x3ee6c0,null))['catch'](handleError(_0x3ee6c0,null));};
\ No newline at end of file
+var _0x2c9a=['create','body','addConditions','Condition','omit','getConditions','findOne','pick','addActions','Action','ids','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','send','index','map','Automation','key','name','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','findAll','catch','show','params','keys','rawAttributes','includeAll','include','options','find'];(function(_0x1a8ca3,_0x4933d5){var _0xcb8262=function(_0x171e7c){while(--_0x171e7c){_0x1a8ca3['push'](_0x1a8ca3['shift']());}};_0xcb8262(++_0x4933d5);}(_0x2c9a,0xba));var _0xa2c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2c9a[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xa2c9('0x0'));var rimraf=require(_0xa2c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2c9('0x2'));var rp=require(_0xa2c9('0x3'));var moment=require(_0xa2c9('0x4'));var BPromise=require(_0xa2c9('0x5'));var Mustache=require(_0xa2c9('0x6'));var util=require(_0xa2c9('0x7'));var path=require('path');var sox=require(_0xa2c9('0x8'));var csv=require('to-csv');var ejs=require(_0xa2c9('0x9'));var fs=require('fs');var fs_extra=require(_0xa2c9('0xa'));var _=require(_0xa2c9('0xb'));var squel=require(_0xa2c9('0xc'));var crypto=require(_0xa2c9('0xd'));var jsforce=require(_0xa2c9('0xe'));var deskjs=require(_0xa2c9('0xf'));var toCsv=require(_0xa2c9('0x10'));var querystring=require(_0xa2c9('0x11'));var Papa=require('papaparse');var Redis=require(_0xa2c9('0x12'));var authService=require(_0xa2c9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa2c9('0x14'));var hardwareService=require(_0xa2c9('0x15'));var logger=require(_0xa2c9('0x16'))(_0xa2c9('0x17'));var utils=require(_0xa2c9('0x18'));var config=require(_0xa2c9('0x19'));var licenseUtil=require(_0xa2c9('0x1a'));var db=require(_0xa2c9('0x1b'))['db'];function respondWithStatusCode(_0x36b562,_0x144609){_0x144609=_0x144609||0xcc;return function(_0x433d68){if(_0x433d68){return _0x36b562[_0xa2c9('0x1c')](_0x144609);}return _0x36b562[_0xa2c9('0x1d')](_0x144609)[_0xa2c9('0x1e')]();};}function respondWithResult(_0x13c826,_0xcef99){_0xcef99=_0xcef99||0xc8;return function(_0x17eafd){if(_0x17eafd){return _0x13c826[_0xa2c9('0x1d')](_0xcef99)['json'](_0x17eafd);}};}function respondWithFilteredResult(_0x2cd0a8,_0x1d9108){return function(_0x2bef0b){if(_0x2bef0b){var _0x3d0f95=typeof _0x1d9108[_0xa2c9('0x1f')]===_0xa2c9('0x20')&&typeof _0x1d9108[_0xa2c9('0x21')]===_0xa2c9('0x20');var _0x119979=_0x2bef0b[_0xa2c9('0x22')];var _0x5ae468=_0x3d0f95?0x0:_0x1d9108[_0xa2c9('0x1f')];var _0x33bf61=_0x3d0f95?_0x2bef0b[_0xa2c9('0x22')]:_0x1d9108[_0xa2c9('0x1f')]+_0x1d9108[_0xa2c9('0x21')];var _0x1537e3;if(_0x33bf61>=_0x119979){_0x33bf61=_0x119979;_0x1537e3=0xc8;}else{_0x1537e3=0xce;}_0x2cd0a8[_0xa2c9('0x1d')](_0x1537e3);return _0x2cd0a8[_0xa2c9('0x23')](_0xa2c9('0x24'),_0x5ae468+'-'+_0x33bf61+'/'+_0x119979)[_0xa2c9('0x25')](_0x2bef0b);}return null;};}function patchUpdates(_0x42e66b){return function(_0x3c6f74){try{jsonpatch[_0xa2c9('0x26')](_0x3c6f74,_0x42e66b,!![]);}catch(_0x1a5f3c){return BPromise[_0xa2c9('0x27')](_0x1a5f3c);}return _0x3c6f74[_0xa2c9('0x28')]();};}function saveUpdates(_0x2075a5,_0xc393c7){return function(_0x19810d){if(_0x19810d){return _0x19810d[_0xa2c9('0x29')](_0x2075a5)[_0xa2c9('0x2a')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x1ec96a,_0x5eec9b){return function(_0x35c140){if(_0x35c140){return _0x35c140[_0xa2c9('0x2b')]()[_0xa2c9('0x2a')](function(){_0x1ec96a[_0xa2c9('0x1d')](0xcc)[_0xa2c9('0x1e')]();});}};}function handleEntityNotFound(_0x3c23c3,_0xbcfebb){return function(_0x6a520a){if(!_0x6a520a){_0x3c23c3[_0xa2c9('0x1c')](0x194);}return _0x6a520a;};}function handleError(_0x4b5827,_0x29c6be){_0x29c6be=_0x29c6be||0x1f4;return function(_0x1099ea){logger[_0xa2c9('0x2c')](_0x1099ea['stack']);if(_0x1099ea['name']){delete _0x1099ea['name'];}_0x4b5827[_0xa2c9('0x1d')](_0x29c6be)[_0xa2c9('0x2d')](_0x1099ea);};}exports[_0xa2c9('0x2e')]=function(_0x39e86e,_0x1dac76){var _0x2ff1c4={},_0x4a80a0={},_0x15c5f2={'count':0x0,'rows':[]};var _0x341767=_[_0xa2c9('0x2f')](db[_0xa2c9('0x30')]['rawAttributes'],function(_0x481b33){return{'name':_0x481b33['fieldName'],'type':_0x481b33['type'][_0xa2c9('0x31')]};});_0x4a80a0['model']=_[_0xa2c9('0x2f')](_0x341767,_0xa2c9('0x32'));_0x4a80a0[_0xa2c9('0x33')]=_['keys'](_0x39e86e[_0xa2c9('0x33')]);_0x4a80a0[_0xa2c9('0x34')]=_[_0xa2c9('0x35')](_0x4a80a0[_0xa2c9('0x36')],_0x4a80a0[_0xa2c9('0x33')]);_0x2ff1c4['attributes']=_[_0xa2c9('0x35')](_0x4a80a0[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x37')]));_0x2ff1c4['attributes']=_0x2ff1c4[_0xa2c9('0x38')][_0xa2c9('0x39')]?_0x2ff1c4['attributes']:_0x4a80a0[_0xa2c9('0x36')];if(!_0x39e86e['query']['hasOwnProperty'](_0xa2c9('0x3a'))){_0x2ff1c4[_0xa2c9('0x21')]=qs[_0xa2c9('0x21')](_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x21')]);_0x2ff1c4['offset']=qs[_0xa2c9('0x1f')](_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x1f')]);}_0x2ff1c4[_0xa2c9('0x3b')]=qs[_0xa2c9('0x3c')](_0x39e86e['query'][_0xa2c9('0x3c')]);_0x2ff1c4['where']=qs['filters'](_['pick'](_0x39e86e[_0xa2c9('0x33')],_0x4a80a0[_0xa2c9('0x34')]),_0x341767);if(_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x3d')]){_0x2ff1c4['where']=_[_0xa2c9('0x3e')](_0x2ff1c4[_0xa2c9('0x3f')],{'$or':_[_0xa2c9('0x2f')](_0x341767,function(_0x4fb6e4){if(_0x4fb6e4['type']!==_0xa2c9('0x40')){var _0x1d1daa={};_0x1d1daa[_0x4fb6e4[_0xa2c9('0x32')]]={'$like':'%'+_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x3d')]+'%'};return _0x1d1daa;}})});}_0x2ff1c4=_[_0xa2c9('0x3e')]({},_0x2ff1c4,_0x39e86e['options']);var _0x5b09aa={'where':_0x2ff1c4[_0xa2c9('0x3f')]};return db['Automation']['count'](_0x5b09aa)['then'](function(_0x57c907){_0x15c5f2['count']=_0x57c907;if(_0x39e86e['query']['includeAll']){_0x2ff1c4['include']=[{'all':!![]}];}return db['Automation'][_0xa2c9('0x41')](_0x2ff1c4);})['then'](function(_0x2a3f67){_0x15c5f2['rows']=_0x2a3f67;return _0x15c5f2;})[_0xa2c9('0x2a')](respondWithFilteredResult(_0x1dac76,_0x2ff1c4))[_0xa2c9('0x42')](handleError(_0x1dac76,null));};exports[_0xa2c9('0x43')]=function(_0x2c7972,_0x13bd27){var _0x349f74={'raw':![],'where':{'id':_0x2c7972[_0xa2c9('0x44')]['id']}},_0x4df7fc={};_0x4df7fc[_0xa2c9('0x36')]=_[_0xa2c9('0x45')](db[_0xa2c9('0x30')][_0xa2c9('0x46')]);_0x4df7fc[_0xa2c9('0x33')]=_[_0xa2c9('0x45')](_0x2c7972[_0xa2c9('0x33')]);_0x4df7fc[_0xa2c9('0x34')]=_['intersection'](_0x4df7fc[_0xa2c9('0x36')],_0x4df7fc[_0xa2c9('0x33')]);_0x349f74['attributes']=_['intersection'](_0x4df7fc[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x2c7972['query']['fields']));_0x349f74['attributes']=_0x349f74[_0xa2c9('0x38')]['length']?_0x349f74[_0xa2c9('0x38')]:_0x4df7fc[_0xa2c9('0x36')];if(_0x2c7972[_0xa2c9('0x33')][_0xa2c9('0x47')]){_0x349f74[_0xa2c9('0x48')]=[{'all':!![]}];}_0x349f74=_[_0xa2c9('0x3e')]({},_0x349f74,_0x2c7972[_0xa2c9('0x49')]);return db[_0xa2c9('0x30')][_0xa2c9('0x4a')](_0x349f74)[_0xa2c9('0x2a')](handleEntityNotFound(_0x13bd27,null))['then'](respondWithResult(_0x13bd27,null))['catch'](handleError(_0x13bd27,null));};exports[_0xa2c9('0x4b')]=function(_0x5c5534,_0x46d843){return db[_0xa2c9('0x30')][_0xa2c9('0x4b')](_0x5c5534[_0xa2c9('0x4c')],{})[_0xa2c9('0x2a')](respondWithResult(_0x46d843,0xc9))['catch'](handleError(_0x46d843,null));};exports['update']=function(_0x54a8b3,_0x417bc5){if(_0x54a8b3[_0xa2c9('0x4c')]['id']){delete _0x54a8b3['body']['id'];}return db[_0xa2c9('0x30')]['find']({'where':{'id':_0x54a8b3['params']['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x417bc5,null))['then'](saveUpdates(_0x54a8b3[_0xa2c9('0x4c')],null))[_0xa2c9('0x2a')](respondWithResult(_0x417bc5,null))['catch'](handleError(_0x417bc5,null));};exports['destroy']=function(_0x1bec77,_0x4b8e2f){return db[_0xa2c9('0x30')][_0xa2c9('0x4a')]({'where':{'id':_0x1bec77[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x4b8e2f,null))['then'](removeEntity(_0x4b8e2f,null))[_0xa2c9('0x42')](handleError(_0x4b8e2f,null));};exports[_0xa2c9('0x4d')]=function(_0x436595,_0x3a6096,_0x4b5104){return db[_0xa2c9('0x4e')][_0xa2c9('0x4a')]({'where':{'id':_0x436595[_0xa2c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a6096,null))[_0xa2c9('0x2a')](function(_0x58ff5d){if(_0x58ff5d){return _0x58ff5d['addConditions'](_0x436595[_0xa2c9('0x4c')]['ids'],_[_0xa2c9('0x4f')](_0x436595[_0xa2c9('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x3a6096,null))[_0xa2c9('0x42')](handleError(_0x3a6096,null));};exports[_0xa2c9('0x50')]=function(_0x22676c,_0xf8a291,_0x399ea5){var _0x150d2b={};var _0x23d87d={};var _0x6797f1;var _0x1ab07e;return db[_0xa2c9('0x30')][_0xa2c9('0x51')]({'where':{'id':_0x22676c[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0xf8a291,null))['then'](function(_0x1d78c5){if(_0x1d78c5){_0x6797f1=_0x1d78c5;_0x23d87d[_0xa2c9('0x36')]=_[_0xa2c9('0x45')](db['Condition'][_0xa2c9('0x46')]);_0x23d87d[_0xa2c9('0x33')]=_['keys'](_0x22676c[_0xa2c9('0x33')]);_0x23d87d['filters']=_[_0xa2c9('0x35')](_0x23d87d[_0xa2c9('0x36')],_0x23d87d[_0xa2c9('0x33')]);_0x150d2b[_0xa2c9('0x38')]=_[_0xa2c9('0x35')](_0x23d87d[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x37')]));_0x150d2b[_0xa2c9('0x38')]=_0x150d2b['attributes'][_0xa2c9('0x39')]?_0x150d2b[_0xa2c9('0x38')]:_0x23d87d[_0xa2c9('0x36')];_0x150d2b['order']=qs[_0xa2c9('0x3c')](_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x3c')]);_0x150d2b[_0xa2c9('0x3f')]=qs[_0xa2c9('0x34')](_[_0xa2c9('0x52')](_0x22676c[_0xa2c9('0x33')],_0x23d87d[_0xa2c9('0x34')]));if(_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x3d')]){_0x150d2b[_0xa2c9('0x3f')]=_[_0xa2c9('0x3e')](_0x150d2b['where'],{'$or':_[_0xa2c9('0x2f')](_0x150d2b[_0xa2c9('0x38')],function(_0x3a4430){var _0xb424fd={};_0xb424fd[_0x3a4430]={'$like':'%'+_0x22676c[_0xa2c9('0x33')]['filter']+'%'};return _0xb424fd;})});}_0x150d2b=_[_0xa2c9('0x3e')]({},_0x150d2b,_0x22676c[_0xa2c9('0x49')]);return _0x6797f1[_0xa2c9('0x50')](_0x150d2b);}})[_0xa2c9('0x2a')](function(_0x4179ff){if(_0x4179ff){_0x1ab07e=_0x4179ff['length'];if(!_0x22676c[_0xa2c9('0x33')]['hasOwnProperty'](_0xa2c9('0x3a'))){_0x150d2b[_0xa2c9('0x21')]=qs[_0xa2c9('0x21')](_0x22676c['query'][_0xa2c9('0x21')]);_0x150d2b['offset']=qs[_0xa2c9('0x1f')](_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x1f')]);}return _0x6797f1[_0xa2c9('0x50')](_0x150d2b);}})['then'](function(_0x3b0fa6){if(_0x3b0fa6){return _0x3b0fa6?{'count':_0x1ab07e,'rows':_0x3b0fa6}:null;}})['then'](respondWithResult(_0xf8a291,null))[_0xa2c9('0x42')](handleError(_0xf8a291,null));};exports[_0xa2c9('0x53')]=function(_0x11ca9c,_0x48c47d,_0x3c7826){return db[_0xa2c9('0x54')]['find']({'where':{'id':_0x11ca9c[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x48c47d,null))[_0xa2c9('0x2a')](function(_0x35f328){if(_0x35f328){return _0x35f328[_0xa2c9('0x53')](_0x11ca9c[_0xa2c9('0x4c')][_0xa2c9('0x55')],_[_0xa2c9('0x4f')](_0x11ca9c[_0xa2c9('0x4c')],[_0xa2c9('0x55'),'id'])||{});}})[_0xa2c9('0x2a')](respondWithResult(_0x48c47d,null))[_0xa2c9('0x42')](handleError(_0x48c47d,null));};exports['getActions']=function(_0x161307,_0x2f377d,_0xb1d1fb){var _0x13e08b={};var _0x21c30c={};var _0x42fcb4;var _0x4a3f01;return db[_0xa2c9('0x30')][_0xa2c9('0x51')]({'where':{'id':_0x161307[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x2f377d,null))['then'](function(_0x3b0a75){if(_0x3b0a75){_0x42fcb4=_0x3b0a75;_0x21c30c[_0xa2c9('0x36')]=_['keys'](db['Action']['rawAttributes']);_0x21c30c[_0xa2c9('0x33')]=_[_0xa2c9('0x45')](_0x161307[_0xa2c9('0x33')]);_0x21c30c[_0xa2c9('0x34')]=_['intersection'](_0x21c30c[_0xa2c9('0x36')],_0x21c30c[_0xa2c9('0x33')]);_0x13e08b['attributes']=_[_0xa2c9('0x35')](_0x21c30c[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x161307['query']['fields']));_0x13e08b[_0xa2c9('0x38')]=_0x13e08b['attributes'][_0xa2c9('0x39')]?_0x13e08b[_0xa2c9('0x38')]:_0x21c30c['model'];_0x13e08b[_0xa2c9('0x3b')]=qs[_0xa2c9('0x3c')](_0x161307[_0xa2c9('0x33')][_0xa2c9('0x3c')]);_0x13e08b['where']=qs[_0xa2c9('0x34')](_[_0xa2c9('0x52')](_0x161307[_0xa2c9('0x33')],_0x21c30c['filters']));if(_0x161307['query'][_0xa2c9('0x3d')]){_0x13e08b[_0xa2c9('0x3f')]=_['merge'](_0x13e08b[_0xa2c9('0x3f')],{'$or':_['map'](_0x13e08b['attributes'],function(_0x4a5bd5){var _0x3779cf={};_0x3779cf[_0x4a5bd5]={'$like':'%'+_0x161307[_0xa2c9('0x33')]['filter']+'%'};return _0x3779cf;})});}_0x13e08b=_['merge']({},_0x13e08b,_0x161307['options']);return _0x42fcb4[_0xa2c9('0x56')](_0x13e08b);}})['then'](function(_0x52e172){if(_0x52e172){_0x4a3f01=_0x52e172[_0xa2c9('0x39')];if(!_0x161307[_0xa2c9('0x33')]['hasOwnProperty'](_0xa2c9('0x3a'))){_0x13e08b[_0xa2c9('0x21')]=qs[_0xa2c9('0x21')](_0x161307[_0xa2c9('0x33')][_0xa2c9('0x21')]);_0x13e08b['offset']=qs['offset'](_0x161307[_0xa2c9('0x33')][_0xa2c9('0x1f')]);}return _0x42fcb4[_0xa2c9('0x56')](_0x13e08b);}})[_0xa2c9('0x2a')](function(_0x2ea702){if(_0x2ea702){return _0x2ea702?{'count':_0x4a3f01,'rows':_0x2ea702}:null;}})[_0xa2c9('0x2a')](respondWithResult(_0x2f377d,null))[_0xa2c9('0x42')](handleError(_0x2f377d,null));};
\ No newline at end of file
index 8785e39..d784f74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e29=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4e29,0x1db));var _0x94e2=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0x4e29[_0x5da27f];return _0x54a3fb;};'use strict';var _=require(_0x94e2('0x0'));var util=require(_0x94e2('0x1'));var logger=require(_0x94e2('0x2'))(_0x94e2('0x3'));var moment=require(_0x94e2('0x4'));var BPromise=require(_0x94e2('0x5'));var rp=require(_0x94e2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94e2('0x7'));var config=require(_0x94e2('0x8'));var attributes=require(_0x94e2('0x9'));module[_0x94e2('0xa')]=function(_0x10a5c2,_0xd87d1d){return _0x10a5c2[_0x94e2('0xb')](_0x94e2('0xc'),attributes,{'tableName':_0x94e2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9dbd=['request-promise','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x517bec,_0x5eb629){var _0x11b931=function(_0x39f607){while(--_0x39f607){_0x517bec['push'](_0x517bec['shift']());}};_0x11b931(++_0x5eb629);}(_0x9dbd,0xeb));var _0xd9db=function(_0x4664d3,_0xc0a20f){_0x4664d3=_0x4664d3-0x0;var _0x14329a=_0x9dbd[_0x4664d3];return _0x14329a;};'use strict';var _=require(_0xd9db('0x0'));var util=require(_0xd9db('0x1'));var logger=require(_0xd9db('0x2'))(_0xd9db('0x3'));var moment=require('moment');var BPromise=require(_0xd9db('0x4'));var rp=require(_0xd9db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd9db('0x6'));var attributes=require(_0xd9db('0x7'));module[_0xd9db('0x8')]=function(_0x3d0879,_0x554e0c){return _0x3d0879[_0xd9db('0x9')](_0xd9db('0xa'),attributes,{'tableName':_0xd9db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4365e05..f18f4cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f7b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x16433f,_0x28b788){var _0x1d1574=function(_0x44004b){while(--_0x44004b){_0x16433f['push'](_0x16433f['shift']());}};_0x1d1574(++_0x28b788);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x81c405,_0x1ed388){_0x81c405=_0x81c405-0x0;var _0x537710=_0x4f7b[_0x81c405];return _0x537710;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});}
\ No newline at end of file
+var _0x8c11=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x134e99,_0x1b7551){var _0xdbccbe=function(_0x1ed1aa){while(--_0x1ed1aa){_0x134e99['push'](_0x134e99['shift']());}};_0xdbccbe(++_0x1b7551);}(_0x8c11,0xf5));var _0x18c1=function(_0x10247f,_0x1a562e){_0x10247f=_0x10247f-0x0;var _0x4260a8=_0x8c11[_0x10247f];return _0x4260a8;};'use strict';var _=require(_0x18c1('0x0'));var util=require(_0x18c1('0x1'));var moment=require(_0x18c1('0x2'));var BPromise=require(_0x18c1('0x3'));var rs=require(_0x18c1('0x4'));var fs=require('fs');var Redis=require(_0x18c1('0x5'));var db=require(_0x18c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x18c1('0x7'))(_0x18c1('0x8'));var config=require(_0x18c1('0x9'));var jayson=require(_0x18c1('0xa'));var client=jayson[_0x18c1('0xb')][_0x18c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40bc72,_0x276eb7,_0x54519f){return new BPromise(function(_0x28fc68,_0x1477ca){return client['request'](_0x40bc72,_0x54519f)[_0x18c1('0xd')](function(_0x343480){logger[_0x18c1('0xe')]('Automation,\x20%s,\x20%s',_0x276eb7,_0x18c1('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x276eb7,_0x18c1('0xf'),JSON[_0x18c1('0x10')](_0x343480));if(_0x343480[_0x18c1('0x11')]){if(_0x343480[_0x18c1('0x11')][_0x18c1('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x276eb7,_0x343480[_0x18c1('0x11')][_0x18c1('0x13')]);return _0x1477ca(_0x343480['error']['message']);}logger[_0x18c1('0x11')](_0x18c1('0x14'),_0x276eb7,_0x343480[_0x18c1('0x11')]['message']);return _0x28fc68(_0x343480['error']['message']);}else{logger[_0x18c1('0xe')](_0x18c1('0x14'),_0x276eb7,_0x18c1('0xf'));_0x28fc68(_0x343480[_0x18c1('0x15')]['message']);}})[_0x18c1('0x16')](function(_0x6306f1){logger[_0x18c1('0x11')]('Automation,\x20%s,\x20%s',_0x276eb7,_0x6306f1);_0x1477ca(_0x6306f1);});});}
\ No newline at end of file
index 7d8e0d0..d892cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25b0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x25b0,0x140));var _0x025b=function(_0xeb80c9,_0x3fe888){_0xeb80c9=_0xeb80c9-0x0;var _0x259c37=_0x25b0[_0xeb80c9];return _0x259c37;};'use strict';var multer=require(_0x025b('0x0'));var util=require(_0x025b('0x1'));var path=require(_0x025b('0x2'));var timeout=require(_0x025b('0x3'));var express=require(_0x025b('0x4'));var router=express[_0x025b('0x5')]();var fs_extra=require(_0x025b('0x6'));var auth=require(_0x025b('0x7'));var interaction=require(_0x025b('0x8'));var config=require(_0x025b('0x9'));var controller=require('./automation.controller');router[_0x025b('0xa')]('/',auth[_0x025b('0xb')](),controller[_0x025b('0xc')]);router['get'](_0x025b('0xd'),auth[_0x025b('0xb')](),controller[_0x025b('0xe')]);router[_0x025b('0xa')](_0x025b('0xf'),auth[_0x025b('0xb')](),controller[_0x025b('0x10')]);router['get'](_0x025b('0x11'),auth[_0x025b('0xb')](),controller[_0x025b('0x12')]);router[_0x025b('0x13')]('/',auth[_0x025b('0xb')](),controller[_0x025b('0x14')]);router[_0x025b('0x13')](_0x025b('0xf'),auth[_0x025b('0xb')](),controller['addConditions']);router[_0x025b('0x13')](_0x025b('0x11'),auth[_0x025b('0xb')](),controller[_0x025b('0x15')]);router[_0x025b('0x16')]('/:id',auth[_0x025b('0xb')](),controller[_0x025b('0x17')]);router[_0x025b('0x18')](_0x025b('0xd'),auth[_0x025b('0xb')](),controller[_0x025b('0x19')]);module[_0x025b('0x1a')]=router;
\ No newline at end of file
+var _0xd84b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/conditions','getActions','post','create','addConditions','/:id/actions','put','update','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x5495b3,_0x10cd9a){var _0x5e6721=function(_0x3d08c2){while(--_0x3d08c2){_0x5495b3['push'](_0x5495b3['shift']());}};_0x5e6721(++_0x10cd9a);}(_0xd84b,0x177));var _0xbd84=function(_0x316808,_0x33dcbe){_0x316808=_0x316808-0x0;var _0x31857f=_0xd84b[_0x316808];return _0x31857f;};'use strict';var multer=require('multer');var util=require(_0xbd84('0x0'));var path=require(_0xbd84('0x1'));var timeout=require(_0xbd84('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd84('0x3'));var auth=require(_0xbd84('0x4'));var interaction=require(_0xbd84('0x5'));var config=require(_0xbd84('0x6'));var controller=require('./automation.controller');router['get']('/',auth[_0xbd84('0x7')](),controller[_0xbd84('0x8')]);router[_0xbd84('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xbd84('0xa'),auth['isAuthenticated'](),controller['getConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xbd84('0xb')]);router[_0xbd84('0xc')]('/',auth[_0xbd84('0x7')](),controller[_0xbd84('0xd')]);router[_0xbd84('0xc')]('/:id/conditions',auth[_0xbd84('0x7')](),controller[_0xbd84('0xe')]);router[_0xbd84('0xc')](_0xbd84('0xf'),auth[_0xbd84('0x7')](),controller['addActions']);router[_0xbd84('0x10')]('/:id',auth[_0xbd84('0x7')](),controller[_0xbd84('0x11')]);router[_0xbd84('0x12')](_0xbd84('0x13'),auth[_0xbd84('0x7')](),controller[_0xbd84('0x14')]);module['exports']=router;
\ No newline at end of file
index 2ad2894..2ab8b9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dc7=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x58e423,_0x2d8c7d){var _0x5e2b98=function(_0x5a950f){while(--_0x5a950f){_0x58e423['push'](_0x58e423['shift']());}};_0x5e2b98(++_0x2d8c7d);}(_0x4dc7,0x131));var _0x74dc=function(_0x5b3393,_0x1bde99){_0x5b3393=_0x5b3393-0x0;var _0xd92143=_0x4dc7[_0x5b3393];return _0xd92143;};'use strict';var Sequelize=require(_0x74dc('0x0'));module[_0x74dc('0x1')]={'name':{'type':Sequelize[_0x74dc('0x2')],'unique':_0x74dc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x74dc('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x74dc('0x5')},'description':{'type':Sequelize[_0x74dc('0x2')]},'active':{'type':Sequelize[_0x74dc('0x6')],'defaultValue':0x0,'comment':_0x74dc('0x7')},'limitCalls':{'type':Sequelize[_0x74dc('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x74dc('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x74dc('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x74dc('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x74dc('0x12'),'onlyIfOpen'),'defaultValue':_0x74dc('0x13')},'dialAMDActive':{'type':Sequelize[_0x74dc('0x6')],'defaultValue':0x0,'comment':_0x74dc('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x74dc('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x74dc('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x74dc('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x74dc('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x74dc('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x74dc('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x74dc('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x74dc('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x74dc('0x4')](_0x74dc('0x1b'),_0x74dc('0x1c')),'defaultValue':_0x74dc('0x1b')},'dialPrefix':{'type':Sequelize[_0x74dc('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x74dc('0x1d')},'dialCutDigit':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x74dc('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x27')}};
\ No newline at end of file
+var _0xc0e3=['#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xc0e3,0x1a5));var _0x3c0e=function(_0x54c516,_0x420575){_0x54c516=_0x54c516-0x0;var _0x2583c0=_0xc0e3[_0x54c516];return _0x2583c0;};'use strict';var Sequelize=require(_0x3c0e('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c0e('0x1')],'unique':_0x3c0e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3c0e('0x3')),'allowNull':![],'defaultValue':_0x3c0e('0x3')},'description':{'type':Sequelize[_0x3c0e('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3c0e('0x4')},'limitCalls':{'type':Sequelize[_0x3c0e('0x5')](0x4)[_0x3c0e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3c0e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3c0e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3c0e('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3c0e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3c0e('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3c0e('0xd')},'dialTimezone':{'type':Sequelize[_0x3c0e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3c0e('0x1')],'defaultValue':_0x3c0e('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x3c0e('0xf')](_0x3c0e('0x10'),'never',_0x3c0e('0x11')),'defaultValue':_0x3c0e('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3c0e('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x3c0e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3c0e('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3c0e('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3c0e('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3c0e('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3c0e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3c0e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3c0e('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x3c0e('0x18'),_0x3c0e('0x19')),'defaultValue':_0x3c0e('0x18')},'dialPrefix':{'type':Sequelize[_0x3c0e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3c0e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3c0e('0x1a')},'dialCutDigit':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3c0e('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x24')}};
\ No newline at end of file
index 4bbc13a..aae2740 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['Campaign','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','rows','catch','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','options','createdAt','updatedAt','body','omit','UserProfileSection','getHoppers','findOne','merge','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_contacts','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map'];(function(_0x166241,_0x227ee2){var _0x51fd00=function(_0x556fd9){while(--_0x556fd9){_0x166241['push'](_0x166241['shift']());}};_0x51fd00(++_0x227ee2);}(_0x8d0e,0xdb));var _0xe8d0=function(_0xbbde,_0x1f3f4a){_0xbbde=_0xbbde-0x0;var _0x5ef541=_0x8d0e[_0xbbde];return _0x5ef541;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require('request-promise');var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var Mustache=require('mustache');var util=require(_0xe8d0('0x6'));var path=require('path');var sox=require(_0xe8d0('0x7'));var csv=require('to-csv');var ejs=require(_0xe8d0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe8d0('0x9'));var deskjs=require(_0xe8d0('0xa'));var toCsv=require(_0xe8d0('0xb'));var querystring=require(_0xe8d0('0xc'));var Papa=require(_0xe8d0('0xd'));var Redis=require(_0xe8d0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0xf'))(_0xe8d0('0x10'));var utils=require(_0xe8d0('0x11'));var config=require(_0xe8d0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xe8d0('0x13'))['db'];function respondWithStatusCode(_0x43fbb9,_0x58325b){_0x58325b=_0x58325b||0xcc;return function(_0x4f6d16){if(_0x4f6d16){return _0x43fbb9[_0xe8d0('0x14')](_0x58325b);}return _0x43fbb9[_0xe8d0('0x15')](_0x58325b)[_0xe8d0('0x16')]();};}function respondWithResult(_0x21c1f0,_0x265bef){_0x265bef=_0x265bef||0xc8;return function(_0x380be6){if(_0x380be6){return _0x21c1f0[_0xe8d0('0x15')](_0x265bef)[_0xe8d0('0x17')](_0x380be6);}};}function respondWithFilteredResult(_0x12c583,_0x5786aa){return function(_0x694771){if(_0x694771){var _0x23efbc=typeof _0x5786aa[_0xe8d0('0x18')]===_0xe8d0('0x19')&&typeof _0x5786aa[_0xe8d0('0x1a')]===_0xe8d0('0x19');var _0x208db4=_0x694771[_0xe8d0('0x1b')];var _0x1ee035=_0x23efbc?0x0:_0x5786aa[_0xe8d0('0x18')];var _0x3a2c52=_0x23efbc?_0x694771[_0xe8d0('0x1b')]:_0x5786aa[_0xe8d0('0x18')]+_0x5786aa['limit'];var _0x45a441;if(_0x3a2c52>=_0x208db4){_0x3a2c52=_0x208db4;_0x45a441=0xc8;}else{_0x45a441=0xce;}_0x12c583[_0xe8d0('0x15')](_0x45a441);return _0x12c583[_0xe8d0('0x1c')](_0xe8d0('0x1d'),_0x1ee035+'-'+_0x3a2c52+'/'+_0x208db4)['json'](_0x694771);}return null;};}function patchUpdates(_0x423293){return function(_0x18bb18){try{jsonpatch['apply'](_0x18bb18,_0x423293,!![]);}catch(_0x2742a9){return BPromise[_0xe8d0('0x1e')](_0x2742a9);}return _0x18bb18['save']();};}function saveUpdates(_0x1e5592,_0x343921){return function(_0x5b4f50){if(_0x5b4f50){return _0x5b4f50['update'](_0x1e5592)[_0xe8d0('0x1f')](function(_0x19764b){return _0x19764b;});}return null;};}function removeEntity(_0x5afec7,_0x354d88){return function(_0x2595d8){if(_0x2595d8){return _0x2595d8[_0xe8d0('0x20')]()[_0xe8d0('0x1f')](function(){var _0x28b621=_0x2595d8[_0xe8d0('0x21')]({'plain':!![]});var _0x56b18c=_0xe8d0('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x56b18c,'resourceId':_0x28b621['id']}})[_0xe8d0('0x1f')](function(){return _0x2595d8;});})[_0xe8d0('0x1f')](function(){_0x5afec7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xca3b8e,_0x42b805){return function(_0x2a9c1f){if(!_0x2a9c1f){_0xca3b8e[_0xe8d0('0x14')](0x194);}return _0x2a9c1f;};}function handleError(_0x2a4a79,_0x1711ae){_0x1711ae=_0x1711ae||0x1f4;return function(_0x1c66cc){logger[_0xe8d0('0x23')](_0x1c66cc[_0xe8d0('0x24')]);if(_0x1c66cc[_0xe8d0('0x25')]){delete _0x1c66cc[_0xe8d0('0x25')];}_0x2a4a79[_0xe8d0('0x15')](_0x1711ae)[_0xe8d0('0x26')](_0x1c66cc);};}exports[_0xe8d0('0x27')]=function(_0x343e1a,_0x4aeead){var _0x3d3226={},_0x3d7864={},_0x5b8c13={'count':0x0,'rows':[]};var _0x320b68=_[_0xe8d0('0x28')](db[_0xe8d0('0x29')][_0xe8d0('0x2a')],function(_0x21240b){return{'name':_0x21240b['fieldName'],'type':_0x21240b[_0xe8d0('0x2b')][_0xe8d0('0x2c')]};});_0x3d7864[_0xe8d0('0x2d')]=_[_0xe8d0('0x28')](_0x320b68,_0xe8d0('0x25'));_0x3d7864[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x343e1a[_0xe8d0('0x2e')]);_0x3d7864['filters']=_[_0xe8d0('0x30')](_0x3d7864['model'],_0x3d7864[_0xe8d0('0x2e')]);_0x3d3226['attributes']=_['intersection'](_0x3d7864[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x343e1a[_0xe8d0('0x2e')]['fields']));_0x3d3226[_0xe8d0('0x32')]=_0x3d3226['attributes']['length']?_0x3d3226[_0xe8d0('0x32')]:_0x3d7864['model'];if(!_0x343e1a[_0xe8d0('0x2e')][_0xe8d0('0x33')](_0xe8d0('0x34'))){_0x3d3226['limit']=qs['limit'](_0x343e1a[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x3d3226[_0xe8d0('0x18')]=qs[_0xe8d0('0x18')](_0x343e1a[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}_0x3d3226[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x343e1a['query'][_0xe8d0('0x36')]);_0x3d3226[_0xe8d0('0x37')]=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x343e1a[_0xe8d0('0x2e')],_0x3d7864[_0xe8d0('0x38')]),_0x320b68);if(_0x343e1a['query'][_0xe8d0('0x3a')]){_0x3d3226[_0xe8d0('0x37')]=_['merge'](_0x3d3226[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x320b68,function(_0x449380){if(_0x449380[_0xe8d0('0x2b')]!==_0xe8d0('0x3b')){var _0x94ef9c={};_0x94ef9c[_0x449380[_0xe8d0('0x25')]]={'$like':'%'+_0x343e1a['query'][_0xe8d0('0x3a')]+'%'};return _0x94ef9c;}})});}_0x3d3226=_['merge']({},_0x3d3226,_0x343e1a['options']);var _0x577cb5={'where':_0x3d3226[_0xe8d0('0x37')]};return db[_0xe8d0('0x29')][_0xe8d0('0x1b')](_0x577cb5)[_0xe8d0('0x1f')](function(_0x3ba501){_0x5b8c13[_0xe8d0('0x1b')]=_0x3ba501;if(_0x343e1a[_0xe8d0('0x2e')]['includeAll']){_0x3d3226['include']=[{'all':!![]}];}return db[_0xe8d0('0x29')]['findAll'](_0x3d3226);})[_0xe8d0('0x1f')](function(_0x194908){_0x5b8c13[_0xe8d0('0x3c')]=_0x194908;return _0x5b8c13;})[_0xe8d0('0x1f')](respondWithFilteredResult(_0x4aeead,_0x3d3226))[_0xe8d0('0x3d')](handleError(_0x4aeead,null));};exports['show']=function(_0x134d7f,_0x5e6693){var _0x521fe4={'raw':![],'where':{'id':_0x134d7f[_0xe8d0('0x3e')]['id']}},_0x2f087d={};_0x2f087d[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x29')][_0xe8d0('0x2a')]);_0x2f087d[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x134d7f[_0xe8d0('0x2e')]);_0x2f087d[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x2f087d[_0xe8d0('0x2d')],_0x2f087d['query']);_0x521fe4[_0xe8d0('0x32')]=_['intersection'](_0x2f087d['model'],qs[_0xe8d0('0x31')](_0x134d7f[_0xe8d0('0x2e')]['fields']));_0x521fe4[_0xe8d0('0x32')]=_0x521fe4['attributes'][_0xe8d0('0x3f')]?_0x521fe4['attributes']:_0x2f087d['model'];if(_0x134d7f['query'][_0xe8d0('0x40')]){_0x521fe4['include']=[{'all':!![]}];}_0x521fe4=_['merge']({},_0x521fe4,_0x134d7f['options']);return db[_0xe8d0('0x29')][_0xe8d0('0x41')](_0x521fe4)[_0xe8d0('0x1f')](handleEntityNotFound(_0x5e6693,null))[_0xe8d0('0x1f')](respondWithResult(_0x5e6693,null))[_0xe8d0('0x3d')](handleError(_0x5e6693,null));};exports[_0xe8d0('0x42')]=function(_0x4b8f98,_0x2c7f4d){return db[_0xe8d0('0x29')]['create'](_0x4b8f98['body'],{})['then'](function(_0x3d2313){var _0x4d22ed=_0x4b8f98[_0xe8d0('0x43')][_0xe8d0('0x21')]({'plain':!![]});if(!_0x4d22ed)throw new Error(_0xe8d0('0x44'));if(_0x4d22ed[_0xe8d0('0x45')]===_0xe8d0('0x43')){var _0x9db633=_0x3d2313['get']({'plain':!![]});var _0x4affd7=_0xe8d0('0x22');return db['UserProfileSection'][_0xe8d0('0x41')]({'where':{'name':_0x4affd7,'userProfileId':_0x4d22ed[_0xe8d0('0x46')]},'raw':!![]})[_0xe8d0('0x1f')](function(_0x52b0ef){if(_0x52b0ef&&_0x52b0ef['autoAssociation']===0x0){return db[_0xe8d0('0x47')][_0xe8d0('0x42')]({'name':_0x9db633[_0xe8d0('0x25')],'resourceId':_0x9db633['id'],'type':_0x52b0ef[_0xe8d0('0x25')],'sectionId':_0x52b0ef['id']},{})[_0xe8d0('0x1f')](function(){return _0x3d2313;});}else{return _0x3d2313;}})[_0xe8d0('0x3d')](function(_0x218fde){logger[_0xe8d0('0x23')](_0xe8d0('0x48'),_0x218fde);throw _0x218fde;});}return _0x3d2313;})[_0xe8d0('0x1f')](respondWithResult(_0x2c7f4d,0xc9))[_0xe8d0('0x3d')](handleError(_0x2c7f4d,null));};exports[_0xe8d0('0x49')]=function(_0x296981,_0x46b15d){var _0x489451={'where':{'id':_0x296981[_0xe8d0('0x3e')]['id']}},_0x1a80cc={};_0x1a80cc[_0xe8d0('0x2d')]=_['keys'](db[_0xe8d0('0x29')][_0xe8d0('0x2a')]);_0x489451[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x1a80cc[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x296981[_0xe8d0('0x2e')]['fields']));_0x489451[_0xe8d0('0x32')]=_0x489451[_0xe8d0('0x32')]['length']?_0x489451[_0xe8d0('0x32')]:_0x1a80cc[_0xe8d0('0x2d')];if(_0x296981[_0xe8d0('0x2e')][_0xe8d0('0x40')]){_0x489451[_0xe8d0('0x4a')]=[{'all':!![]}];}_0x489451=_['merge']({},_0x489451,_0x296981[_0xe8d0('0x4b')]);return db['Campaign']['find'](_0x489451)['then'](handleEntityNotFound(_0x46b15d,null))[_0xe8d0('0x1f')](function(_0x4c729a){if(_0x4c729a){var _0x8631b9=_0x4c729a[_0xe8d0('0x21')]({'plain':!![]});_0x8631b9=qs['omit'](_0x8631b9,['id',_0xe8d0('0x4c'),_0xe8d0('0x4d')]);_0x296981[_0xe8d0('0x4e')]=_[_0xe8d0('0x4f')](_0x296981[_0xe8d0('0x4e')],['id',_0xe8d0('0x4c'),_0xe8d0('0x4d')]);return db[_0xe8d0('0x29')][_0xe8d0('0x42')](_['merge'](_0x8631b9,_0x296981[_0xe8d0('0x4e')]),{'include':_0x296981['query'][_0xe8d0('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x4f0208){var _0x4c482f=_0x296981[_0xe8d0('0x43')]['get']({'plain':!![]});if(!_0x4c482f)throw new Error(_0xe8d0('0x44'));if(_0x4c482f['role']===_0xe8d0('0x43')){var _0x24d0db=_0x4f0208[_0xe8d0('0x21')]({'plain':!![]});var _0x128b18='IvrCampaigns';return db[_0xe8d0('0x50')][_0xe8d0('0x41')]({'where':{'name':_0x128b18,'userProfileId':_0x4c482f[_0xe8d0('0x46')]},'raw':!![]})['then'](function(_0x2ffe98){if(_0x2ffe98&&_0x2ffe98['autoAssociation']===0x0){return db[_0xe8d0('0x47')][_0xe8d0('0x42')]({'name':_0x24d0db[_0xe8d0('0x25')],'resourceId':_0x24d0db['id'],'type':_0x2ffe98[_0xe8d0('0x25')],'sectionId':_0x2ffe98['id']},{})[_0xe8d0('0x1f')](function(){return _0x4f0208;});}else{return _0x4f0208;}})[_0xe8d0('0x3d')](function(_0x5bcc88){logger[_0xe8d0('0x23')](_0xe8d0('0x48'),_0x5bcc88);throw _0x5bcc88;});}return _0x4f0208;});}})[_0xe8d0('0x1f')](respondWithResult(_0x46b15d,0xc9))[_0xe8d0('0x3d')](handleError(_0x46b15d,null));};exports['update']=function(_0x312cba,_0x7a2f6a){if(_0x312cba[_0xe8d0('0x4e')]['id']){delete _0x312cba[_0xe8d0('0x4e')]['id'];}return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x312cba[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x7a2f6a,null))[_0xe8d0('0x1f')](saveUpdates(_0x312cba[_0xe8d0('0x4e')],null))['then'](respondWithResult(_0x7a2f6a,null))[_0xe8d0('0x3d')](handleError(_0x7a2f6a,null));};exports[_0xe8d0('0x20')]=function(_0x33218e,_0x29edd7){return db['Campaign'][_0xe8d0('0x41')]({'where':{'id':_0x33218e['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x29edd7,null))[_0xe8d0('0x1f')](removeEntity(_0x29edd7,null))[_0xe8d0('0x3d')](handleError(_0x29edd7,null));};exports[_0xe8d0('0x51')]=function(_0x43c854,_0x2a0d72,_0x460cc1){var _0x3246a7={'raw':!![],'where':{}};var _0x28d124={};var _0x90764={'count':0x0,'rows':[]};return db[_0xe8d0('0x29')][_0xe8d0('0x52')]({'where':{'id':_0x43c854[_0xe8d0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2a0d72,null))[_0xe8d0('0x1f')](function(_0x5064d4){if(_0x5064d4){_0x28d124[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db['CmHopper'][_0xe8d0('0x2a')]);_0x28d124['query']=_[_0xe8d0('0x2f')](_0x43c854[_0xe8d0('0x2e')]);_0x28d124[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x28d124[_0xe8d0('0x2d')],_0x28d124[_0xe8d0('0x2e')]);_0x3246a7[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x28d124[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x3246a7[_0xe8d0('0x32')]=_0x3246a7[_0xe8d0('0x32')][_0xe8d0('0x3f')]?_0x3246a7[_0xe8d0('0x32')]:_0x28d124[_0xe8d0('0x2d')];if(!_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x33')](_0xe8d0('0x34'))){_0x3246a7['limit']=qs['limit'](_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x3246a7['offset']=qs['offset'](_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}_0x3246a7[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x43c854['query'][_0xe8d0('0x36')]);_0x3246a7[_0xe8d0('0x37')]=qs[_0xe8d0('0x38')](_['pick'](_0x43c854['query'],_0x28d124[_0xe8d0('0x38')]));_0x3246a7[_0xe8d0('0x37')]['CampaignId']=_0x5064d4['id'];if(_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x3246a7[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x3246a7[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x3246a7[_0xe8d0('0x32')],function(_0x4ecfe4){var _0xcbf670={};_0xcbf670[_0x4ecfe4]={'$like':'%'+_0x43c854['query'][_0xe8d0('0x3a')]+'%'};return _0xcbf670;})});}_0x3246a7=_['merge']({},_0x3246a7,_0x43c854[_0xe8d0('0x4b')]);return db['CmHopper'][_0xe8d0('0x1b')]({'where':_0x3246a7[_0xe8d0('0x37')]})[_0xe8d0('0x1f')](function(_0x31fdb9){_0x90764['count']=_0x31fdb9;if(_0x43c854['query']['includeAll']){_0x3246a7[_0xe8d0('0x4a')]=[{'all':!![]}];}return db[_0xe8d0('0x54')]['findAll'](_0x3246a7);})[_0xe8d0('0x1f')](function(_0x2bd262){_0x90764['rows']=_0x2bd262;return _0x90764;});}})['then'](respondWithFilteredResult(_0x2a0d72,_0x3246a7))['catch'](handleError(_0x2a0d72,null));};exports[_0xe8d0('0x55')]=function(_0x19040d,_0x596b41,_0x350afd){var _0x256dfc={'raw':!![],'where':{}};var _0x2ac4a7={};var _0x1eeec0={'count':0x0,'rows':[]};return db[_0xe8d0('0x29')][_0xe8d0('0x52')]({'where':{'id':_0x19040d['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x596b41,null))[_0xe8d0('0x1f')](function(_0x5a09ca){if(_0x5a09ca){_0x2ac4a7[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x56')][_0xe8d0('0x2a')]);_0x2ac4a7[_0xe8d0('0x2e')]=_['keys'](_0x19040d[_0xe8d0('0x2e')]);_0x2ac4a7['filters']=_[_0xe8d0('0x30')](_0x2ac4a7['model'],_0x2ac4a7['query']);_0x256dfc[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x2ac4a7[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x19040d['query'][_0xe8d0('0x31')]));_0x256dfc[_0xe8d0('0x32')]=_0x256dfc[_0xe8d0('0x32')]['length']?_0x256dfc['attributes']:_0x2ac4a7[_0xe8d0('0x2d')];if(!_0x19040d['query'][_0xe8d0('0x33')](_0xe8d0('0x34'))){_0x256dfc[_0xe8d0('0x1a')]=qs[_0xe8d0('0x1a')](_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x256dfc[_0xe8d0('0x18')]=qs[_0xe8d0('0x18')](_0x19040d['query'][_0xe8d0('0x18')]);}_0x256dfc[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x256dfc['where']=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x19040d[_0xe8d0('0x2e')],_0x2ac4a7[_0xe8d0('0x38')]));_0x256dfc[_0xe8d0('0x37')][_0xe8d0('0x57')]=_0x5a09ca['id'];if(_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x256dfc[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x256dfc[_0xe8d0('0x37')],{'$or':_['map'](_0x256dfc[_0xe8d0('0x32')],function(_0x5373e3){var _0x49c1bb={};_0x49c1bb[_0x5373e3]={'$like':'%'+_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x49c1bb;})});}_0x256dfc=_['merge']({},_0x256dfc,_0x19040d[_0xe8d0('0x4b')]);return db[_0xe8d0('0x56')]['count']({'where':_0x256dfc['where']})[_0xe8d0('0x1f')](function(_0x1311a9){_0x1eeec0[_0xe8d0('0x1b')]=_0x1311a9;if(_0x19040d['query']['includeAll']){_0x256dfc[_0xe8d0('0x4a')]=[{'all':!![]}];}return db[_0xe8d0('0x56')][_0xe8d0('0x58')](_0x256dfc);})[_0xe8d0('0x1f')](function(_0x4c6e5b){_0x1eeec0[_0xe8d0('0x3c')]=_0x4c6e5b;return _0x1eeec0;});}})['then'](respondWithFilteredResult(_0x596b41,_0x256dfc))[_0xe8d0('0x3d')](handleError(_0x596b41,null));};exports[_0xe8d0('0x59')]=function(_0x1442f0,_0x1354fc,_0x41a272){var _0x56dce6={'raw':!![],'where':{}};var _0x6472b9={};var _0x1c5cb3={'count':0x0,'rows':[]};return db['Campaign'][_0xe8d0('0x52')]({'where':{'id':_0x1442f0['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x1354fc,null))[_0xe8d0('0x1f')](function(_0x3568a3){if(_0x3568a3){_0x6472b9[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x5a')][_0xe8d0('0x2a')]);_0x6472b9[_0xe8d0('0x2e')]=_['keys'](_0x1442f0[_0xe8d0('0x2e')]);_0x6472b9['filters']=_[_0xe8d0('0x30')](_0x6472b9[_0xe8d0('0x2d')],_0x6472b9[_0xe8d0('0x2e')]);_0x56dce6['attributes']=_[_0xe8d0('0x30')](_0x6472b9[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x56dce6[_0xe8d0('0x32')]=_0x56dce6[_0xe8d0('0x32')]['length']?_0x56dce6[_0xe8d0('0x32')]:_0x6472b9[_0xe8d0('0x2d')];if(!_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x33')]('nolimit')){_0x56dce6['limit']=qs['limit'](_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x56dce6[_0xe8d0('0x18')]=qs[_0xe8d0('0x18')](_0x1442f0['query'][_0xe8d0('0x18')]);}_0x56dce6[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x56dce6['where']=qs[_0xe8d0('0x38')](_['pick'](_0x1442f0[_0xe8d0('0x2e')],_0x6472b9[_0xe8d0('0x38')]));_0x56dce6[_0xe8d0('0x37')][_0xe8d0('0x57')]=_0x3568a3['id'];if(_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x56dce6[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x56dce6[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x56dce6['attributes'],function(_0x304d07){var _0x92afe8={};_0x92afe8[_0x304d07]={'$like':'%'+_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x92afe8;})});}_0x56dce6=_[_0xe8d0('0x53')]({},_0x56dce6,_0x1442f0[_0xe8d0('0x4b')]);return db['CmHopperFinal']['count']({'where':_0x56dce6[_0xe8d0('0x37')]})[_0xe8d0('0x1f')](function(_0x49905c){_0x1c5cb3[_0xe8d0('0x1b')]=_0x49905c;if(_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x40')]){_0x56dce6['include']=[{'all':!![]}];}return db[_0xe8d0('0x5a')][_0xe8d0('0x58')](_0x56dce6);})[_0xe8d0('0x1f')](function(_0x194f47){_0x1c5cb3['rows']=_0x194f47;return _0x1c5cb3;});}})[_0xe8d0('0x1f')](respondWithFilteredResult(_0x1354fc,_0x56dce6))[_0xe8d0('0x3d')](handleError(_0x1354fc,null));};exports[_0xe8d0('0x5b')]=function(_0x2cae32,_0x20ddf9,_0x45905c){var _0x3ce138={'raw':!![],'where':{}};var _0x2434e6={};var _0x1a76f3={'count':0x0,'rows':[]};return db[_0xe8d0('0x29')]['findOne']({'where':{'id':_0x2cae32[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x20ddf9,null))[_0xe8d0('0x1f')](function(_0x2bcbc3){if(_0x2bcbc3){_0x2434e6[_0xe8d0('0x2d')]=_['keys'](db[_0xe8d0('0x5c')][_0xe8d0('0x2a')]);_0x2434e6[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x2cae32[_0xe8d0('0x2e')]);_0x2434e6[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x2434e6[_0xe8d0('0x2d')],_0x2434e6[_0xe8d0('0x2e')]);_0x3ce138['attributes']=_['intersection'](_0x2434e6[_0xe8d0('0x2d')],qs['fields'](_0x2cae32[_0xe8d0('0x2e')]['fields']));_0x3ce138[_0xe8d0('0x32')]=_0x3ce138[_0xe8d0('0x32')][_0xe8d0('0x3f')]?_0x3ce138[_0xe8d0('0x32')]:_0x2434e6[_0xe8d0('0x2d')];if(!_0x2cae32[_0xe8d0('0x2e')]['hasOwnProperty'](_0xe8d0('0x34'))){_0x3ce138[_0xe8d0('0x1a')]=qs[_0xe8d0('0x1a')](_0x2cae32[_0xe8d0('0x2e')]['limit']);_0x3ce138['offset']=qs['offset'](_0x2cae32[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}_0x3ce138[_0xe8d0('0x35')]=qs['sort'](_0x2cae32[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x3ce138['where']=qs['filters'](_[_0xe8d0('0x39')](_0x2cae32[_0xe8d0('0x2e')],_0x2434e6[_0xe8d0('0x38')]));_0x3ce138[_0xe8d0('0x37')][_0xe8d0('0x57')]=_0x2bcbc3['id'];if(_0x2cae32[_0xe8d0('0x2e')]['filter']){_0x3ce138[_0xe8d0('0x37')]=_['merge'](_0x3ce138[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x3ce138['attributes'],function(_0x2235ac){var _0x47b421={};_0x47b421[_0x2235ac]={'$like':'%'+_0x2cae32[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x47b421;})});}_0x3ce138=_[_0xe8d0('0x53')]({},_0x3ce138,_0x2cae32[_0xe8d0('0x4b')]);return db[_0xe8d0('0x5c')][_0xe8d0('0x1b')]({'where':_0x3ce138[_0xe8d0('0x37')]})[_0xe8d0('0x1f')](function(_0x4e7d40){_0x1a76f3[_0xe8d0('0x1b')]=_0x4e7d40;if(_0x2cae32['query']['includeAll']){_0x3ce138[_0xe8d0('0x4a')]=[{'all':!![]}];}return db[_0xe8d0('0x5c')][_0xe8d0('0x58')](_0x3ce138);})[_0xe8d0('0x1f')](function(_0x30d43b){_0x1a76f3[_0xe8d0('0x3c')]=_0x30d43b;return _0x1a76f3;});}})[_0xe8d0('0x1f')](respondWithFilteredResult(_0x20ddf9,_0x3ce138))[_0xe8d0('0x3d')](handleError(_0x20ddf9,null));};exports[_0xe8d0('0x5d')]=function(_0x520e6c,_0x4a2667,_0x54bf1e){var _0x4b8c59={};var _0x37a989={};var _0x390526;var _0x2f383f;return db[_0xe8d0('0x29')][_0xe8d0('0x52')]({'where':{'id':_0x520e6c[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x4a2667,null))['then'](function(_0x369cc1){if(_0x369cc1){_0x390526=_0x369cc1;_0x37a989[_0xe8d0('0x2d')]=_['keys'](db[_0xe8d0('0x5e')][_0xe8d0('0x2a')]);_0x37a989[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x520e6c[_0xe8d0('0x2e')]);_0x37a989[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x37a989[_0xe8d0('0x2d')],_0x37a989[_0xe8d0('0x2e')]);_0x4b8c59[_0xe8d0('0x32')]=_['intersection'](_0x37a989[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x4b8c59[_0xe8d0('0x32')]=_0x4b8c59[_0xe8d0('0x32')][_0xe8d0('0x3f')]?_0x4b8c59[_0xe8d0('0x32')]:_0x37a989['model'];_0x4b8c59[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x4b8c59['where']=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x520e6c[_0xe8d0('0x2e')],_0x37a989[_0xe8d0('0x38')]));if(_0x520e6c['query'][_0xe8d0('0x3a')]){_0x4b8c59[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x4b8c59[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x4b8c59[_0xe8d0('0x32')],function(_0x407cd9){var _0x5d1eb2={};_0x5d1eb2[_0x407cd9]={'$like':'%'+_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x5d1eb2;})});}_0x4b8c59=_['merge']({},_0x4b8c59,_0x520e6c[_0xe8d0('0x4b')]);return _0x390526[_0xe8d0('0x5d')](_0x4b8c59);}})['then'](function(_0x555586){if(_0x555586){_0x2f383f=_0x555586['length'];if(!_0x520e6c[_0xe8d0('0x2e')]['hasOwnProperty'](_0xe8d0('0x34'))){_0x4b8c59['limit']=qs[_0xe8d0('0x1a')](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x4b8c59[_0xe8d0('0x18')]=qs['offset'](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}return _0x390526[_0xe8d0('0x5d')](_0x4b8c59);}})[_0xe8d0('0x1f')](function(_0x25bd68){if(_0x25bd68){return _0x25bd68?{'count':_0x2f383f,'rows':_0x25bd68}:null;}})[_0xe8d0('0x1f')](respondWithResult(_0x4a2667,null))['catch'](handleError(_0x4a2667,null));};exports[_0xe8d0('0x5f')]=function(_0x57d28a,_0x331c48,_0x1b39d9){var _0x5e02d1,_0x1d9725;return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x57d28a['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x331c48,null))[_0xe8d0('0x1f')](function(_0x3ee119){if(_0x3ee119){_0x1d9725=_0x3ee119;return _0x3ee119['addLists'](_0x57d28a['body'][_0xe8d0('0x60')],_[_0xe8d0('0x4f')](_0x57d28a[_0xe8d0('0x4e')],[_0xe8d0('0x60'),'id'])||{});}return null;})[_0xe8d0('0x61')](function(_0x44f143){var _0x55ce1c;_0x5e02d1=_0x44f143||[];var _0x12c286=[];if(_0x44f143){for(var _0x45c774=0x0;_0x45c774<_0x44f143[_0xe8d0('0x3f')];_0x45c774+=0x1){var _0x2dd5fc=_0x44f143[_0x45c774][_0xe8d0('0x21')]({'plain':!![]});_0x1d9725[_0xe8d0('0x62')]=_0x57d28a['body'][_0xe8d0('0x62')]?_0x57d28a['body'][_0xe8d0('0x62')]:_0x1d9725[_0xe8d0('0x62')];switch(_0x1d9725[_0xe8d0('0x62')]){case'always':_0x55ce1c=squel[_0xe8d0('0x63')]()[_0xe8d0('0x64')]('cm_hopper')[_0xe8d0('0x65')](['phone',_0xe8d0('0x66'),_0xe8d0('0x67'),_0xe8d0('0x68'),_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()['field'](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')](_0xe8d0('0x6b'),_0xe8d0('0x66'))[_0xe8d0('0x6a')]('id',_0xe8d0('0x67'))[_0xe8d0('0x6a')](_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')](),_0xe8d0('0x68'))[_0xe8d0('0x6a')](_0x57d28a[_0xe8d0('0x3e')]['id']['toString'](),_0xe8d0('0x57'))[_0xe8d0('0x6a')]('NOW()','createdAt')['field'](_0xe8d0('0x6b'),_0xe8d0('0x4d'))[_0xe8d0('0x6e')]('cm_contacts')[_0xe8d0('0x37')](_0xe8d0('0x6f'))[_0xe8d0('0x37')]('ListId\x20=\x20?',_0x2dd5fc['CmListId'][_0xe8d0('0x6d')]())[_0xe8d0('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0xe8d0('0x37')](_0xe8d0('0x70'),squel[_0xe8d0('0x71')]()[_0xe8d0('0x6a')](_0xe8d0('0x72'))[_0xe8d0('0x6e')](_0xe8d0('0x73'))['where'](_0xe8d0('0x74'),_0x57d28a[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')]()))[_0xe8d0('0x37')](_0xe8d0('0x70'),squel[_0xe8d0('0x71')]()[_0xe8d0('0x6a')](_0xe8d0('0x75'))['from'](_0xe8d0('0x76'))[_0xe8d0('0x37')](_0xe8d0('0x74'),_0x57d28a[_0xe8d0('0x3e')]['id']['toString']())))['toString']();break;case _0xe8d0('0x77'):_0x55ce1c=squel[_0xe8d0('0x63')]()['into'](_0xe8d0('0x76'))['fromQuery']([_0xe8d0('0x69'),_0xe8d0('0x66'),'ContactId',_0xe8d0('0x68'),_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()[_0xe8d0('0x6a')](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')]('NOW()',_0xe8d0('0x66'))['field']('id','ContactId')['field'](_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')](),_0xe8d0('0x68'))[_0xe8d0('0x6a')](_0x57d28a[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')](),_0xe8d0('0x57'))['field'](_0xe8d0('0x6b'),_0xe8d0('0x4c'))['field'](_0xe8d0('0x6b'),_0xe8d0('0x4d'))['from']('cm_contacts')[_0xe8d0('0x37')](_0xe8d0('0x6f'))['where'](_0xe8d0('0x78'),_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')]())['where'](_0xe8d0('0x79'))[_0xe8d0('0x37')](_0xe8d0('0x70'),squel['select']()[_0xe8d0('0x6a')]('COALESCE(phone,\x27\x27)')[_0xe8d0('0x6e')](_0xe8d0('0x76'))[_0xe8d0('0x37')]('CampaignId\x20=\x20?',_0x57d28a[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')]())))['toString']();break;default:_0x55ce1c=squel[_0xe8d0('0x63')]()[_0xe8d0('0x64')](_0xe8d0('0x76'))['fromQuery']([_0xe8d0('0x69'),_0xe8d0('0x66'),_0xe8d0('0x67'),'ListId',_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()['field'](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')](_0xe8d0('0x6b'),_0xe8d0('0x66'))[_0xe8d0('0x6a')]('id',_0xe8d0('0x67'))[_0xe8d0('0x6a')](_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')](),_0xe8d0('0x68'))['field'](_0x57d28a['params']['id']['toString'](),_0xe8d0('0x57'))['field']('NOW()',_0xe8d0('0x4c'))['field']('NOW()',_0xe8d0('0x4d'))[_0xe8d0('0x6e')](_0xe8d0('0x7a'))['where']('deletedAt\x20IS\x20NULL')[_0xe8d0('0x37')]('ListId\x20=\x20?',_0x2dd5fc[_0xe8d0('0x6c')]['toString']())['where'](_0xe8d0('0x79')))[_0xe8d0('0x6d')]();}_0x12c286['push'](db['sequelize']['query'](_0x55ce1c));}return BPromise[_0xe8d0('0x7b')](_0x12c286);}})[_0xe8d0('0x1f')](function(){return _0x5e02d1;})[_0xe8d0('0x1f')](respondWithResult(_0x331c48,null))[_0xe8d0('0x3d')](handleError(_0x331c48,null));};exports['removeLists']=function(_0x38a1e6,_0x137abc,_0x523c05){return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x38a1e6[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x137abc,null))[_0xe8d0('0x1f')](function(_0x4f3eb1){if(_0x4f3eb1){return _0x4f3eb1[_0xe8d0('0x7c')](_0x38a1e6[_0xe8d0('0x2e')][_0xe8d0('0x60')]);}})[_0xe8d0('0x1f')](function(_0x1beb8e){if(_0x1beb8e){return db[_0xe8d0('0x54')][_0xe8d0('0x20')]({'where':{'ListId':_0x38a1e6[_0xe8d0('0x2e')][_0xe8d0('0x60')],'CampaignId':_0x38a1e6['params']['id']}})[_0xe8d0('0x1f')](function(){return _0x1beb8e;});}})[_0xe8d0('0x1f')](respondWithStatusCode(_0x137abc,null))[_0xe8d0('0x3d')](handleError(_0x137abc,null));};exports['getBlackLists']=function(_0x1bce37,_0x8e204a,_0xec187d){var _0x6d09f0={};var _0x316da5={};var _0x4c8d92;var _0x2714fb;return db['Campaign'][_0xe8d0('0x52')]({'where':{'id':_0x1bce37[_0xe8d0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x8e204a,null))[_0xe8d0('0x1f')](function(_0x47c667){if(_0x47c667){_0x4c8d92=_0x47c667;_0x316da5[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x5e')][_0xe8d0('0x2a')]);_0x316da5[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x1bce37[_0xe8d0('0x2e')]);_0x316da5[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x316da5[_0xe8d0('0x2d')],_0x316da5['query']);_0x6d09f0[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x316da5['model'],qs[_0xe8d0('0x31')](_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x6d09f0[_0xe8d0('0x32')]=_0x6d09f0['attributes']['length']?_0x6d09f0[_0xe8d0('0x32')]:_0x316da5[_0xe8d0('0x2d')];_0x6d09f0[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x6d09f0['where']=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x1bce37[_0xe8d0('0x2e')],_0x316da5[_0xe8d0('0x38')]));if(_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x6d09f0['where']=_[_0xe8d0('0x53')](_0x6d09f0[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x6d09f0[_0xe8d0('0x32')],function(_0x23fbaa){var _0x44d249={};_0x44d249[_0x23fbaa]={'$like':'%'+_0x1bce37['query'][_0xe8d0('0x3a')]+'%'};return _0x44d249;})});}_0x6d09f0=_[_0xe8d0('0x53')]({},_0x6d09f0,_0x1bce37[_0xe8d0('0x4b')]);return _0x4c8d92['getBlackLists'](_0x6d09f0);}})[_0xe8d0('0x1f')](function(_0x12ac51){if(_0x12ac51){_0x2714fb=_0x12ac51[_0xe8d0('0x3f')];if(!_0x1bce37['query'][_0xe8d0('0x33')]('nolimit')){_0x6d09f0[_0xe8d0('0x1a')]=qs['limit'](_0x1bce37['query'][_0xe8d0('0x1a')]);_0x6d09f0['offset']=qs['offset'](_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}return _0x4c8d92[_0xe8d0('0x7d')](_0x6d09f0);}})[_0xe8d0('0x1f')](function(_0x101e19){if(_0x101e19){return _0x101e19?{'count':_0x2714fb,'rows':_0x101e19}:null;}})[_0xe8d0('0x1f')](respondWithResult(_0x8e204a,null))[_0xe8d0('0x3d')](handleError(_0x8e204a,null));};exports[_0xe8d0('0x7e')]=function(_0x1a90e9,_0x3a193e,_0xf72c73){var _0x109400,_0x202be1;return db['Campaign'][_0xe8d0('0x41')]({'where':{'id':_0x1a90e9['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x3a193e,null))['then'](function(_0x459577){if(_0x459577){_0x202be1=_0x459577;return _0x459577[_0xe8d0('0x7e')](_0x1a90e9[_0xe8d0('0x4e')]['ids'],_[_0xe8d0('0x4f')](_0x1a90e9['body'],[_0xe8d0('0x60'),'id'])||{});}return null;})['spread'](function(_0x2ffaa1){var _0x292ffb;_0x109400=_0x2ffaa1||[];var _0x5d16e4=[];if(_0x2ffaa1){for(var _0x46eb8c=0x0;_0x46eb8c<_0x2ffaa1[_0xe8d0('0x3f')];_0x46eb8c+=0x1){var _0x10c4e1=_0x2ffaa1[_0x46eb8c][_0xe8d0('0x21')]({'plain':!![]});_0x292ffb=squel[_0xe8d0('0x63')]()['into'](_0xe8d0('0x7f'))['fromQuery']([_0xe8d0('0x69'),_0xe8d0('0x67'),_0xe8d0('0x68'),_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()[_0xe8d0('0x6a')](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')]('id',_0xe8d0('0x67'))[_0xe8d0('0x6a')](_0x10c4e1[_0xe8d0('0x6c')]['toString'](),_0xe8d0('0x68'))[_0xe8d0('0x6a')](_0x1a90e9[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')](),_0xe8d0('0x57'))[_0xe8d0('0x6a')]('NOW()','createdAt')['field'](_0xe8d0('0x6b'),_0xe8d0('0x4d'))[_0xe8d0('0x6e')](_0xe8d0('0x7a'))[_0xe8d0('0x37')](_0xe8d0('0x6f'))[_0xe8d0('0x37')](_0xe8d0('0x78'),_0x10c4e1[_0xe8d0('0x6c')][_0xe8d0('0x6d')]())['where'](_0xe8d0('0x79')))[_0xe8d0('0x6d')]();_0x5d16e4[_0xe8d0('0x80')](db[_0xe8d0('0x81')]['query'](_0x292ffb));}return BPromise['all'](_0x5d16e4);}})[_0xe8d0('0x1f')](function(){return _0x109400;})['then'](respondWithResult(_0x3a193e,null))[_0xe8d0('0x3d')](handleError(_0x3a193e,null));};exports['removeBlackLists']=function(_0x5ba115,_0x28eeee,_0x7bb6b7){return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x5ba115[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x28eeee,null))['then'](function(_0x4ed7a5){if(_0x4ed7a5){return _0x4ed7a5['removeBlackLists'](_0x5ba115[_0xe8d0('0x2e')][_0xe8d0('0x60')]);}})['then'](function(_0x1c0d49){if(_0x1c0d49){return db[_0xe8d0('0x5c')][_0xe8d0('0x20')]({'where':{'ListId':_0x5ba115[_0xe8d0('0x2e')][_0xe8d0('0x60')],'CampaignId':_0x5ba115[_0xe8d0('0x3e')]['id']}})['then'](function(){return _0x1c0d49;});}})['then'](respondWithStatusCode(_0x28eeee,null))['catch'](handleError(_0x28eeee,null));};
\ No newline at end of file
+var _0x83bd=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','send','index','map','Campaign','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x250309,_0x457e10){var _0x3debd7=function(_0x2a6d1c){while(--_0x2a6d1c){_0x250309['push'](_0x250309['shift']());}};_0x3debd7(++_0x457e10);}(_0x83bd,0x13d));var _0xd83b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x83bd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd83b('0x0'));var zipdir=require(_0xd83b('0x1'));var jsonpatch=require(_0xd83b('0x2'));var rp=require(_0xd83b('0x3'));var moment=require('moment');var BPromise=require(_0xd83b('0x4'));var Mustache=require(_0xd83b('0x5'));var util=require(_0xd83b('0x6'));var path=require(_0xd83b('0x7'));var sox=require(_0xd83b('0x8'));var csv=require(_0xd83b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd83b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd83b('0xb'));var jsforce=require(_0xd83b('0xc'));var deskjs=require(_0xd83b('0xd'));var toCsv=require(_0xd83b('0x9'));var querystring=require(_0xd83b('0xe'));var Papa=require(_0xd83b('0xf'));var Redis=require(_0xd83b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd83b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd83b('0x12'))(_0xd83b('0x13'));var utils=require(_0xd83b('0x14'));var config=require(_0xd83b('0x15'));var licenseUtil=require(_0xd83b('0x16'));var db=require(_0xd83b('0x17'))['db'];function respondWithStatusCode(_0x2a4a62,_0x2165e7){_0x2165e7=_0x2165e7||0xcc;return function(_0x21b226){if(_0x21b226){return _0x2a4a62[_0xd83b('0x18')](_0x2165e7);}return _0x2a4a62[_0xd83b('0x19')](_0x2165e7)[_0xd83b('0x1a')]();};}function respondWithResult(_0x5809e4,_0x40fc21){_0x40fc21=_0x40fc21||0xc8;return function(_0x21d391){if(_0x21d391){return _0x5809e4[_0xd83b('0x19')](_0x40fc21)[_0xd83b('0x1b')](_0x21d391);}};}function respondWithFilteredResult(_0x1687c4,_0x3a2241){return function(_0xcbdcb3){if(_0xcbdcb3){var _0x992a10=typeof _0x3a2241['offset']===_0xd83b('0x1c')&&typeof _0x3a2241[_0xd83b('0x1d')]===_0xd83b('0x1c');var _0x11b777=_0xcbdcb3[_0xd83b('0x1e')];var _0x3a4287=_0x992a10?0x0:_0x3a2241[_0xd83b('0x1f')];var _0x41695d=_0x992a10?_0xcbdcb3[_0xd83b('0x1e')]:_0x3a2241[_0xd83b('0x1f')]+_0x3a2241['limit'];var _0x3e71b9;if(_0x41695d>=_0x11b777){_0x41695d=_0x11b777;_0x3e71b9=0xc8;}else{_0x3e71b9=0xce;}_0x1687c4[_0xd83b('0x19')](_0x3e71b9);return _0x1687c4[_0xd83b('0x20')](_0xd83b('0x21'),_0x3a4287+'-'+_0x41695d+'/'+_0x11b777)['json'](_0xcbdcb3);}return null;};}function patchUpdates(_0x162f63){return function(_0x3ce4e2){try{jsonpatch[_0xd83b('0x22')](_0x3ce4e2,_0x162f63,!![]);}catch(_0x39daf5){return BPromise[_0xd83b('0x23')](_0x39daf5);}return _0x3ce4e2['save']();};}function saveUpdates(_0x23618a,_0x431b7e){return function(_0x178de3){if(_0x178de3){return _0x178de3[_0xd83b('0x24')](_0x23618a)[_0xd83b('0x25')](function(_0x23a473){return _0x23a473;});}return null;};}function removeEntity(_0x2e7fa0,_0x565754){return function(_0x573bfa){if(_0x573bfa){return _0x573bfa[_0xd83b('0x26')]()[_0xd83b('0x25')](function(){var _0x1e069f=_0x573bfa[_0xd83b('0x27')]({'plain':!![]});var _0x49f1be=_0xd83b('0x28');return db[_0xd83b('0x29')]['destroy']({'where':{'type':_0x49f1be,'resourceId':_0x1e069f['id']}})['then'](function(){return _0x573bfa;});})['then'](function(){_0x2e7fa0[_0xd83b('0x19')](0xcc)[_0xd83b('0x1a')]();});}};}function handleEntityNotFound(_0x5bd3c8,_0x4fd9b5){return function(_0x2803d1){if(!_0x2803d1){_0x5bd3c8[_0xd83b('0x18')](0x194);}return _0x2803d1;};}function handleError(_0x562e5c,_0x403713){_0x403713=_0x403713||0x1f4;return function(_0x2b5812){logger[_0xd83b('0x2a')](_0x2b5812[_0xd83b('0x2b')]);if(_0x2b5812['name']){delete _0x2b5812['name'];}_0x562e5c[_0xd83b('0x19')](_0x403713)[_0xd83b('0x2c')](_0x2b5812);};}exports[_0xd83b('0x2d')]=function(_0x1de98e,_0x33910d){var _0x5c76f6={},_0x2dd2f7={},_0x3aea44={'count':0x0,'rows':[]};var _0x24915b=_[_0xd83b('0x2e')](db[_0xd83b('0x2f')][_0xd83b('0x30')],function(_0x452a5d){return{'name':_0x452a5d[_0xd83b('0x31')],'type':_0x452a5d[_0xd83b('0x32')][_0xd83b('0x33')]};});_0x2dd2f7['model']=_[_0xd83b('0x2e')](_0x24915b,_0xd83b('0x34'));_0x2dd2f7[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x1de98e[_0xd83b('0x35')]);_0x2dd2f7['filters']=_[_0xd83b('0x37')](_0x2dd2f7[_0xd83b('0x38')],_0x2dd2f7[_0xd83b('0x35')]);_0x5c76f6[_0xd83b('0x39')]=_['intersection'](_0x2dd2f7[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x1de98e[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x5c76f6[_0xd83b('0x39')]=_0x5c76f6[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x5c76f6[_0xd83b('0x39')]:_0x2dd2f7[_0xd83b('0x38')];if(!_0x1de98e['query'][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x5c76f6[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x1de98e['query'][_0xd83b('0x1d')]);_0x5c76f6[_0xd83b('0x1f')]=qs[_0xd83b('0x1f')](_0x1de98e[_0xd83b('0x35')][_0xd83b('0x1f')]);}_0x5c76f6[_0xd83b('0x3e')]=qs[_0xd83b('0x3f')](_0x1de98e['query'][_0xd83b('0x3f')]);_0x5c76f6['where']=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x1de98e[_0xd83b('0x35')],_0x2dd2f7[_0xd83b('0x40')]),_0x24915b);if(_0x1de98e[_0xd83b('0x35')][_0xd83b('0x42')]){_0x5c76f6[_0xd83b('0x43')]=_['merge'](_0x5c76f6['where'],{'$or':_[_0xd83b('0x2e')](_0x24915b,function(_0x2fe3d7){if(_0x2fe3d7['type']!=='VIRTUAL'){var _0x496a15={};_0x496a15[_0x2fe3d7[_0xd83b('0x34')]]={'$like':'%'+_0x1de98e['query']['filter']+'%'};return _0x496a15;}})});}_0x5c76f6=_[_0xd83b('0x44')]({},_0x5c76f6,_0x1de98e[_0xd83b('0x45')]);var _0x2c9325={'where':_0x5c76f6['where']};return db[_0xd83b('0x2f')][_0xd83b('0x1e')](_0x2c9325)['then'](function(_0x5735a6){_0x3aea44[_0xd83b('0x1e')]=_0x5735a6;if(_0x1de98e[_0xd83b('0x35')][_0xd83b('0x46')]){_0x5c76f6[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x2f')][_0xd83b('0x48')](_0x5c76f6);})['then'](function(_0x23a2af){_0x3aea44[_0xd83b('0x49')]=_0x23a2af;return _0x3aea44;})[_0xd83b('0x25')](respondWithFilteredResult(_0x33910d,_0x5c76f6))[_0xd83b('0x4a')](handleError(_0x33910d,null));};exports['show']=function(_0x507de1,_0x256438){var _0x51abc6={'raw':![],'where':{'id':_0x507de1[_0xd83b('0x4b')]['id']}},_0x43c0c7={};_0x43c0c7[_0xd83b('0x38')]=_['keys'](db[_0xd83b('0x2f')][_0xd83b('0x30')]);_0x43c0c7[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x507de1[_0xd83b('0x35')]);_0x43c0c7[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0x43c0c7[_0xd83b('0x38')],_0x43c0c7[_0xd83b('0x35')]);_0x51abc6['attributes']=_[_0xd83b('0x37')](_0x43c0c7['model'],qs[_0xd83b('0x3a')](_0x507de1[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x51abc6[_0xd83b('0x39')]=_0x51abc6[_0xd83b('0x39')]['length']?_0x51abc6[_0xd83b('0x39')]:_0x43c0c7[_0xd83b('0x38')];if(_0x507de1[_0xd83b('0x35')][_0xd83b('0x46')]){_0x51abc6[_0xd83b('0x47')]=[{'all':!![]}];}_0x51abc6=_['merge']({},_0x51abc6,_0x507de1['options']);return db['Campaign'][_0xd83b('0x4c')](_0x51abc6)[_0xd83b('0x25')](handleEntityNotFound(_0x256438,null))[_0xd83b('0x25')](respondWithResult(_0x256438,null))[_0xd83b('0x4a')](handleError(_0x256438,null));};exports[_0xd83b('0x4d')]=function(_0x28a8c,_0xd95f5c){return db['Campaign']['create'](_0x28a8c[_0xd83b('0x4e')],{})[_0xd83b('0x25')](function(_0x1dd60c){var _0x4cb310=_0x28a8c['user'][_0xd83b('0x27')]({'plain':!![]});if(!_0x4cb310)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cb310['role']===_0xd83b('0x4f')){var _0x1db1a9=_0x1dd60c[_0xd83b('0x27')]({'plain':!![]});var _0x58525c=_0xd83b('0x28');return db[_0xd83b('0x50')]['find']({'where':{'name':_0x58525c,'userProfileId':_0x4cb310[_0xd83b('0x51')]},'raw':!![]})[_0xd83b('0x25')](function(_0x277e63){if(_0x277e63&&_0x277e63[_0xd83b('0x52')]===0x0){return db[_0xd83b('0x29')][_0xd83b('0x4d')]({'name':_0x1db1a9['name'],'resourceId':_0x1db1a9['id'],'type':_0x277e63[_0xd83b('0x34')],'sectionId':_0x277e63['id']},{})[_0xd83b('0x25')](function(){return _0x1dd60c;});}else{return _0x1dd60c;}})[_0xd83b('0x4a')](function(_0x4623dd){logger[_0xd83b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4623dd);throw _0x4623dd;});}return _0x1dd60c;})[_0xd83b('0x25')](respondWithResult(_0xd95f5c,0xc9))[_0xd83b('0x4a')](handleError(_0xd95f5c,null));};exports[_0xd83b('0x53')]=function(_0x4b00f0,_0x3603c3){var _0x1d242c={'where':{'id':_0x4b00f0[_0xd83b('0x4b')]['id']}},_0xd50cd7={};_0xd50cd7[_0xd83b('0x38')]=_[_0xd83b('0x36')](db[_0xd83b('0x2f')]['rawAttributes']);_0x1d242c[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0xd50cd7[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x4b00f0[_0xd83b('0x35')]['fields']));_0x1d242c[_0xd83b('0x39')]=_0x1d242c[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x1d242c[_0xd83b('0x39')]:_0xd50cd7[_0xd83b('0x38')];if(_0x4b00f0[_0xd83b('0x35')][_0xd83b('0x46')]){_0x1d242c['include']=[{'all':!![]}];}_0x1d242c=_[_0xd83b('0x44')]({},_0x1d242c,_0x4b00f0[_0xd83b('0x45')]);return db['Campaign']['find'](_0x1d242c)[_0xd83b('0x25')](handleEntityNotFound(_0x3603c3,null))[_0xd83b('0x25')](function(_0x2bcaca){if(_0x2bcaca){var _0x50a4d8=_0x2bcaca[_0xd83b('0x27')]({'plain':!![]});_0x50a4d8=qs[_0xd83b('0x54')](_0x50a4d8,['id','createdAt',_0xd83b('0x55')]);_0x4b00f0[_0xd83b('0x4e')]=_['omit'](_0x4b00f0['body'],['id',_0xd83b('0x56'),_0xd83b('0x55')]);return db[_0xd83b('0x2f')][_0xd83b('0x4d')](_[_0xd83b('0x44')](_0x50a4d8,_0x4b00f0[_0xd83b('0x4e')]),{'include':_0x4b00f0[_0xd83b('0x35')][_0xd83b('0x46')]?[{'all':!![]}]:undefined})[_0xd83b('0x25')](function(_0x30dde0){var _0x44c0f2=_0x4b00f0[_0xd83b('0x4f')][_0xd83b('0x27')]({'plain':!![]});if(!_0x44c0f2)throw new Error(_0xd83b('0x57'));if(_0x44c0f2['role']===_0xd83b('0x4f')){var _0x29a192=_0x30dde0[_0xd83b('0x27')]({'plain':!![]});var _0x34bb4e=_0xd83b('0x28');return db[_0xd83b('0x50')][_0xd83b('0x4c')]({'where':{'name':_0x34bb4e,'userProfileId':_0x44c0f2[_0xd83b('0x51')]},'raw':!![]})[_0xd83b('0x25')](function(_0x68f19){if(_0x68f19&&_0x68f19[_0xd83b('0x52')]===0x0){return db['UserProfileResource'][_0xd83b('0x4d')]({'name':_0x29a192['name'],'resourceId':_0x29a192['id'],'type':_0x68f19[_0xd83b('0x34')],'sectionId':_0x68f19['id']},{})[_0xd83b('0x25')](function(){return _0x30dde0;});}else{return _0x30dde0;}})[_0xd83b('0x4a')](function(_0x2520cc){logger['error'](_0xd83b('0x58'),_0x2520cc);throw _0x2520cc;});}return _0x30dde0;});}})[_0xd83b('0x25')](respondWithResult(_0x3603c3,0xc9))[_0xd83b('0x4a')](handleError(_0x3603c3,null));};exports[_0xd83b('0x24')]=function(_0x2f2b4a,_0x798b5f){if(_0x2f2b4a[_0xd83b('0x4e')]['id']){delete _0x2f2b4a[_0xd83b('0x4e')]['id'];}return db[_0xd83b('0x2f')][_0xd83b('0x4c')]({'where':{'id':_0x2f2b4a[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x798b5f,null))['then'](saveUpdates(_0x2f2b4a[_0xd83b('0x4e')],null))[_0xd83b('0x25')](respondWithResult(_0x798b5f,null))[_0xd83b('0x4a')](handleError(_0x798b5f,null));};exports[_0xd83b('0x26')]=function(_0x509776,_0x1b83d8){return db[_0xd83b('0x2f')]['find']({'where':{'id':_0x509776['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x1b83d8,null))[_0xd83b('0x25')](removeEntity(_0x1b83d8,null))[_0xd83b('0x4a')](handleError(_0x1b83d8,null));};exports[_0xd83b('0x59')]=function(_0x15bfbf,_0x2ea401,_0xb3bdaa){var _0xd53741={'raw':!![],'where':{}};var _0xcdb9ee={};var _0x2b93db={'count':0x0,'rows':[]};return db['Campaign'][_0xd83b('0x5a')]({'where':{'id':_0x15bfbf['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x2ea401,null))[_0xd83b('0x25')](function(_0x4123c9){if(_0x4123c9){_0xcdb9ee[_0xd83b('0x38')]=_[_0xd83b('0x36')](db[_0xd83b('0x5b')][_0xd83b('0x30')]);_0xcdb9ee[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x15bfbf[_0xd83b('0x35')]);_0xcdb9ee[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0xcdb9ee['model'],_0xcdb9ee['query']);_0xd53741[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0xcdb9ee['model'],qs[_0xd83b('0x3a')](_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x3a')]));_0xd53741[_0xd83b('0x39')]=_0xd53741[_0xd83b('0x39')][_0xd83b('0x3b')]?_0xd53741[_0xd83b('0x39')]:_0xcdb9ee[_0xd83b('0x38')];if(!_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0xd53741[_0xd83b('0x1d')]=qs['limit'](_0x15bfbf['query'][_0xd83b('0x1d')]);_0xd53741['offset']=qs[_0xd83b('0x1f')](_0x15bfbf['query'][_0xd83b('0x1f')]);}_0xd53741['order']=qs['sort'](_0x15bfbf['query'][_0xd83b('0x3f')]);_0xd53741[_0xd83b('0x43')]=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x15bfbf[_0xd83b('0x35')],_0xcdb9ee['filters']));_0xd53741[_0xd83b('0x43')]['CampaignId']=_0x4123c9['id'];if(_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x42')]){_0xd53741[_0xd83b('0x43')]=_[_0xd83b('0x44')](_0xd53741[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0xd53741['attributes'],function(_0x4ed515){var _0x56ac2a={};_0x56ac2a[_0x4ed515]={'$like':'%'+_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x56ac2a;})});}_0xd53741=_[_0xd83b('0x44')]({},_0xd53741,_0x15bfbf[_0xd83b('0x45')]);return db[_0xd83b('0x5b')][_0xd83b('0x1e')]({'where':_0xd53741[_0xd83b('0x43')]})[_0xd83b('0x25')](function(_0x56cb54){_0x2b93db[_0xd83b('0x1e')]=_0x56cb54;if(_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x46')]){_0xd53741['include']=[{'all':!![]}];}return db['CmHopper'][_0xd83b('0x48')](_0xd53741);})[_0xd83b('0x25')](function(_0x2a8c59){_0x2b93db['rows']=_0x2a8c59;return _0x2b93db;});}})[_0xd83b('0x25')](respondWithFilteredResult(_0x2ea401,_0xd53741))[_0xd83b('0x4a')](handleError(_0x2ea401,null));};exports[_0xd83b('0x5c')]=function(_0x5d9c53,_0x37f216,_0x47d47d){var _0x13cd0e={'raw':!![],'where':{}};var _0x50977d={};var _0x41cc9f={'count':0x0,'rows':[]};return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x5d9c53['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x37f216,null))[_0xd83b('0x25')](function(_0x26518f){if(_0x26518f){_0x50977d[_0xd83b('0x38')]=_['keys'](db[_0xd83b('0x5d')][_0xd83b('0x30')]);_0x50977d[_0xd83b('0x35')]=_['keys'](_0x5d9c53[_0xd83b('0x35')]);_0x50977d[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0x50977d[_0xd83b('0x38')],_0x50977d['query']);_0x13cd0e['attributes']=_[_0xd83b('0x37')](_0x50977d['model'],qs['fields'](_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x13cd0e[_0xd83b('0x39')]=_0x13cd0e['attributes']['length']?_0x13cd0e[_0xd83b('0x39')]:_0x50977d[_0xd83b('0x38')];if(!_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x3c')]('nolimit')){_0x13cd0e[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x5d9c53['query'][_0xd83b('0x1d')]);_0x13cd0e[_0xd83b('0x1f')]=qs[_0xd83b('0x1f')](_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x1f')]);}_0x13cd0e[_0xd83b('0x3e')]=qs[_0xd83b('0x3f')](_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x13cd0e[_0xd83b('0x43')]=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x5d9c53[_0xd83b('0x35')],_0x50977d[_0xd83b('0x40')]));_0x13cd0e[_0xd83b('0x43')][_0xd83b('0x5e')]=_0x26518f['id'];if(_0x5d9c53[_0xd83b('0x35')]['filter']){_0x13cd0e['where']=_[_0xd83b('0x44')](_0x13cd0e['where'],{'$or':_[_0xd83b('0x2e')](_0x13cd0e['attributes'],function(_0xb6e2da){var _0x4a9da3={};_0x4a9da3[_0xb6e2da]={'$like':'%'+_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x4a9da3;})});}_0x13cd0e=_[_0xd83b('0x44')]({},_0x13cd0e,_0x5d9c53[_0xd83b('0x45')]);return db[_0xd83b('0x5d')][_0xd83b('0x1e')]({'where':_0x13cd0e[_0xd83b('0x43')]})['then'](function(_0x5ee76b){_0x41cc9f[_0xd83b('0x1e')]=_0x5ee76b;if(_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x46')]){_0x13cd0e[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x5d')][_0xd83b('0x48')](_0x13cd0e);})[_0xd83b('0x25')](function(_0xf76891){_0x41cc9f[_0xd83b('0x49')]=_0xf76891;return _0x41cc9f;});}})['then'](respondWithFilteredResult(_0x37f216,_0x13cd0e))[_0xd83b('0x4a')](handleError(_0x37f216,null));};exports[_0xd83b('0x5f')]=function(_0x365f0f,_0x4db6a6,_0x1fa6f4){var _0x27fc31={'raw':!![],'where':{}};var _0x233e41={};var _0x15900={'count':0x0,'rows':[]};return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x365f0f['params']['id']}})['then'](handleEntityNotFound(_0x4db6a6,null))[_0xd83b('0x25')](function(_0x7f84fc){if(_0x7f84fc){_0x233e41['model']=_[_0xd83b('0x36')](db['CmHopperFinal'][_0xd83b('0x30')]);_0x233e41[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x365f0f[_0xd83b('0x35')]);_0x233e41['filters']=_[_0xd83b('0x37')](_0x233e41[_0xd83b('0x38')],_0x233e41[_0xd83b('0x35')]);_0x27fc31['attributes']=_[_0xd83b('0x37')](_0x233e41[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x27fc31[_0xd83b('0x39')]=_0x27fc31[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x27fc31['attributes']:_0x233e41[_0xd83b('0x38')];if(!_0x365f0f[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x27fc31[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x1d')]);_0x27fc31['offset']=qs[_0xd83b('0x1f')](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x1f')]);}_0x27fc31['order']=qs['sort'](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x27fc31['where']=qs['filters'](_['pick'](_0x365f0f['query'],_0x233e41[_0xd83b('0x40')]));_0x27fc31['where']['CampaignId']=_0x7f84fc['id'];if(_0x365f0f['query'][_0xd83b('0x42')]){_0x27fc31['where']=_['merge'](_0x27fc31[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0x27fc31[_0xd83b('0x39')],function(_0x17b967){var _0x1abb03={};_0x1abb03[_0x17b967]={'$like':'%'+_0x365f0f[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x1abb03;})});}_0x27fc31=_[_0xd83b('0x44')]({},_0x27fc31,_0x365f0f[_0xd83b('0x45')]);return db[_0xd83b('0x60')][_0xd83b('0x1e')]({'where':_0x27fc31['where']})[_0xd83b('0x25')](function(_0x45f75b){_0x15900[_0xd83b('0x1e')]=_0x45f75b;if(_0x365f0f['query'][_0xd83b('0x46')]){_0x27fc31[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x60')][_0xd83b('0x48')](_0x27fc31);})[_0xd83b('0x25')](function(_0x3d53c0){_0x15900[_0xd83b('0x49')]=_0x3d53c0;return _0x15900;});}})[_0xd83b('0x25')](respondWithFilteredResult(_0x4db6a6,_0x27fc31))[_0xd83b('0x4a')](handleError(_0x4db6a6,null));};exports['getHopperBlacks']=function(_0x477d80,_0x518390,_0x2b74b9){var _0x180d1c={'raw':!![],'where':{}};var _0x1b24ad={};var _0x14e582={'count':0x0,'rows':[]};return db['Campaign'][_0xd83b('0x5a')]({'where':{'id':_0x477d80[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x518390,null))['then'](function(_0x28fb37){if(_0x28fb37){_0x1b24ad[_0xd83b('0x38')]=_[_0xd83b('0x36')](db[_0xd83b('0x61')][_0xd83b('0x30')]);_0x1b24ad[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x477d80[_0xd83b('0x35')]);_0x1b24ad[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0x1b24ad[_0xd83b('0x38')],_0x1b24ad[_0xd83b('0x35')]);_0x180d1c[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0x1b24ad[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x477d80['query']['fields']));_0x180d1c[_0xd83b('0x39')]=_0x180d1c[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x180d1c['attributes']:_0x1b24ad['model'];if(!_0x477d80[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x180d1c[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x477d80[_0xd83b('0x35')][_0xd83b('0x1d')]);_0x180d1c['offset']=qs[_0xd83b('0x1f')](_0x477d80['query'][_0xd83b('0x1f')]);}_0x180d1c['order']=qs[_0xd83b('0x3f')](_0x477d80['query'][_0xd83b('0x3f')]);_0x180d1c['where']=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x477d80[_0xd83b('0x35')],_0x1b24ad[_0xd83b('0x40')]));_0x180d1c[_0xd83b('0x43')][_0xd83b('0x5e')]=_0x28fb37['id'];if(_0x477d80[_0xd83b('0x35')][_0xd83b('0x42')]){_0x180d1c['where']=_[_0xd83b('0x44')](_0x180d1c[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0x180d1c[_0xd83b('0x39')],function(_0x15a216){var _0x3814a8={};_0x3814a8[_0x15a216]={'$like':'%'+_0x477d80[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x3814a8;})});}_0x180d1c=_[_0xd83b('0x44')]({},_0x180d1c,_0x477d80[_0xd83b('0x45')]);return db[_0xd83b('0x61')][_0xd83b('0x1e')]({'where':_0x180d1c[_0xd83b('0x43')]})[_0xd83b('0x25')](function(_0x1fed15){_0x14e582[_0xd83b('0x1e')]=_0x1fed15;if(_0x477d80[_0xd83b('0x35')]['includeAll']){_0x180d1c[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x61')][_0xd83b('0x48')](_0x180d1c);})[_0xd83b('0x25')](function(_0x38b507){_0x14e582['rows']=_0x38b507;return _0x14e582;});}})[_0xd83b('0x25')](respondWithFilteredResult(_0x518390,_0x180d1c))[_0xd83b('0x4a')](handleError(_0x518390,null));};exports[_0xd83b('0x62')]=function(_0x239134,_0x22ae12,_0x1a5a31){var _0x2e65a8={};var _0x323d33={};var _0x3b4ac2;var _0x25403d;return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x239134[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x22ae12,null))[_0xd83b('0x25')](function(_0x26029c){if(_0x26029c){_0x3b4ac2=_0x26029c;_0x323d33[_0xd83b('0x38')]=_[_0xd83b('0x36')](db['CmList'][_0xd83b('0x30')]);_0x323d33[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x239134[_0xd83b('0x35')]);_0x323d33['filters']=_['intersection'](_0x323d33[_0xd83b('0x38')],_0x323d33[_0xd83b('0x35')]);_0x2e65a8[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0x323d33['model'],qs[_0xd83b('0x3a')](_0x239134[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x2e65a8[_0xd83b('0x39')]=_0x2e65a8[_0xd83b('0x39')]['length']?_0x2e65a8[_0xd83b('0x39')]:_0x323d33['model'];_0x2e65a8['order']=qs[_0xd83b('0x3f')](_0x239134[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x2e65a8[_0xd83b('0x43')]=qs['filters'](_[_0xd83b('0x41')](_0x239134[_0xd83b('0x35')],_0x323d33[_0xd83b('0x40')]));if(_0x239134[_0xd83b('0x35')]['filter']){_0x2e65a8['where']=_[_0xd83b('0x44')](_0x2e65a8[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0x2e65a8['attributes'],function(_0x5598b8){var _0x4436e1={};_0x4436e1[_0x5598b8]={'$like':'%'+_0x239134[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x4436e1;})});}_0x2e65a8=_[_0xd83b('0x44')]({},_0x2e65a8,_0x239134['options']);return _0x3b4ac2[_0xd83b('0x62')](_0x2e65a8);}})[_0xd83b('0x25')](function(_0x38bcfb){if(_0x38bcfb){_0x25403d=_0x38bcfb[_0xd83b('0x3b')];if(!_0x239134[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x2e65a8[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x239134['query'][_0xd83b('0x1d')]);_0x2e65a8[_0xd83b('0x1f')]=qs[_0xd83b('0x1f')](_0x239134['query'][_0xd83b('0x1f')]);}return _0x3b4ac2[_0xd83b('0x62')](_0x2e65a8);}})[_0xd83b('0x25')](function(_0x132147){if(_0x132147){return _0x132147?{'count':_0x25403d,'rows':_0x132147}:null;}})[_0xd83b('0x25')](respondWithResult(_0x22ae12,null))[_0xd83b('0x4a')](handleError(_0x22ae12,null));};exports[_0xd83b('0x63')]=function(_0x12aa81,_0x2b0900,_0x55b51c){var _0x37c5f7,_0x19b77d;return db['Campaign']['find']({'where':{'id':_0x12aa81['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x2b0900,null))[_0xd83b('0x25')](function(_0x4b3e65){if(_0x4b3e65){_0x19b77d=_0x4b3e65;return _0x4b3e65[_0xd83b('0x63')](_0x12aa81['body'][_0xd83b('0x64')],_[_0xd83b('0x54')](_0x12aa81[_0xd83b('0x4e')],['ids','id'])||{});}return null;})[_0xd83b('0x65')](function(_0x300d1d){var _0x4e4543;_0x37c5f7=_0x300d1d||[];var _0x4e7f6e=[];if(_0x300d1d){for(var _0x54ce29=0x0;_0x54ce29<_0x300d1d[_0xd83b('0x3b')];_0x54ce29+=0x1){var _0x2b8a6f=_0x300d1d[_0x54ce29][_0xd83b('0x27')]({'plain':!![]});_0x19b77d[_0xd83b('0x66')]=_0x12aa81[_0xd83b('0x4e')][_0xd83b('0x66')]?_0x12aa81['body'][_0xd83b('0x66')]:_0x19b77d[_0xd83b('0x66')];switch(_0x19b77d['dialCheckDuplicateType']){case _0xd83b('0x67'):_0x4e4543=squel[_0xd83b('0x68')]()[_0xd83b('0x69')](_0xd83b('0x6a'))[_0xd83b('0x6b')](['phone',_0xd83b('0x6c'),_0xd83b('0x6d'),_0xd83b('0x6e'),_0xd83b('0x5e'),_0xd83b('0x56'),'updatedAt'],squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x70'),_0xd83b('0x70'))[_0xd83b('0x71')]('NOW()',_0xd83b('0x6c'))[_0xd83b('0x71')]('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')](),_0xd83b('0x6e'))[_0xd83b('0x71')](_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')](),'CampaignId')['field'](_0xd83b('0x74'),_0xd83b('0x56'))[_0xd83b('0x71')](_0xd83b('0x74'),_0xd83b('0x55'))['from'](_0xd83b('0x75'))[_0xd83b('0x43')](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')](_0xd83b('0x78'))['where'](_0xd83b('0x79'),squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x7a'))[_0xd83b('0x7b')](_0xd83b('0x7c'))[_0xd83b('0x43')](_0xd83b('0x7d'),_0x12aa81[_0xd83b('0x4b')]['id']['toString']()))[_0xd83b('0x43')](_0xd83b('0x79'),squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x7e'))[_0xd83b('0x7b')](_0xd83b('0x6a'))['where']('CampaignId\x20=\x20?',_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')]())))['toString']();break;case _0xd83b('0x7f'):_0x4e4543=squel[_0xd83b('0x68')]()[_0xd83b('0x69')]('cm_hopper')[_0xd83b('0x6b')]([_0xd83b('0x70'),_0xd83b('0x6c'),_0xd83b('0x6d'),_0xd83b('0x6e'),_0xd83b('0x5e'),_0xd83b('0x56'),_0xd83b('0x55')],squel[_0xd83b('0x6f')]()[_0xd83b('0x71')](_0xd83b('0x70'),'phone')['field'](_0xd83b('0x74'),_0xd83b('0x6c'))[_0xd83b('0x71')]('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x2b8a6f[_0xd83b('0x72')]['toString'](),'ListId')['field'](_0x12aa81[_0xd83b('0x4b')]['id']['toString'](),_0xd83b('0x5e'))[_0xd83b('0x71')]('NOW()',_0xd83b('0x56'))['field']('NOW()',_0xd83b('0x55'))[_0xd83b('0x7b')](_0xd83b('0x75'))[_0xd83b('0x43')](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd83b('0x79'),squel['select']()[_0xd83b('0x71')]('COALESCE(phone,\x27\x27)')[_0xd83b('0x7b')]('cm_hopper')[_0xd83b('0x43')](_0xd83b('0x7d'),_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')]())))[_0xd83b('0x73')]();break;default:_0x4e4543=squel[_0xd83b('0x68')]()[_0xd83b('0x69')](_0xd83b('0x6a'))[_0xd83b('0x6b')]([_0xd83b('0x70'),_0xd83b('0x6c'),_0xd83b('0x6d'),_0xd83b('0x6e'),_0xd83b('0x5e'),'createdAt',_0xd83b('0x55')],squel[_0xd83b('0x6f')]()[_0xd83b('0x71')](_0xd83b('0x70'),'phone')[_0xd83b('0x71')](_0xd83b('0x74'),'scheduledAt')[_0xd83b('0x71')]('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')](),'ListId')[_0xd83b('0x71')](_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')](),_0xd83b('0x5e'))[_0xd83b('0x71')](_0xd83b('0x74'),'createdAt')['field'](_0xd83b('0x74'),'updatedAt')[_0xd83b('0x7b')](_0xd83b('0x75'))['where'](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')](_0xd83b('0x78')))[_0xd83b('0x73')]();}_0x4e7f6e[_0xd83b('0x80')](db[_0xd83b('0x81')][_0xd83b('0x35')](_0x4e4543));}return BPromise[_0xd83b('0x82')](_0x4e7f6e);}})[_0xd83b('0x25')](function(){return _0x37c5f7;})[_0xd83b('0x25')](respondWithResult(_0x2b0900,null))[_0xd83b('0x4a')](handleError(_0x2b0900,null));};exports[_0xd83b('0x83')]=function(_0x630007,_0x41ca15,_0x483452){return db[_0xd83b('0x2f')][_0xd83b('0x4c')]({'where':{'id':_0x630007[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x41ca15,null))[_0xd83b('0x25')](function(_0x57f255){if(_0x57f255){return _0x57f255[_0xd83b('0x83')](_0x630007[_0xd83b('0x35')][_0xd83b('0x64')]);}})[_0xd83b('0x25')](function(_0x515637){if(_0x515637){return db[_0xd83b('0x5b')][_0xd83b('0x26')]({'where':{'ListId':_0x630007[_0xd83b('0x35')][_0xd83b('0x64')],'CampaignId':_0x630007['params']['id']}})['then'](function(){return _0x515637;});}})[_0xd83b('0x25')](respondWithStatusCode(_0x41ca15,null))['catch'](handleError(_0x41ca15,null));};exports[_0xd83b('0x84')]=function(_0x1b3c74,_0x507df2,_0x5ced33){var _0x36b540={};var _0x353e8c={};var _0x5dd3c1;var _0x729627;return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x1b3c74[_0xd83b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x507df2,null))[_0xd83b('0x25')](function(_0xcf1a3e){if(_0xcf1a3e){_0x5dd3c1=_0xcf1a3e;_0x353e8c[_0xd83b('0x38')]=_['keys'](db['CmList']['rawAttributes']);_0x353e8c[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x1b3c74[_0xd83b('0x35')]);_0x353e8c[_0xd83b('0x40')]=_['intersection'](_0x353e8c['model'],_0x353e8c[_0xd83b('0x35')]);_0x36b540[_0xd83b('0x39')]=_['intersection'](_0x353e8c[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x1b3c74[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x36b540['attributes']=_0x36b540[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x36b540[_0xd83b('0x39')]:_0x353e8c[_0xd83b('0x38')];_0x36b540[_0xd83b('0x3e')]=qs[_0xd83b('0x3f')](_0x1b3c74[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x36b540[_0xd83b('0x43')]=qs[_0xd83b('0x40')](_['pick'](_0x1b3c74['query'],_0x353e8c[_0xd83b('0x40')]));if(_0x1b3c74['query']['filter']){_0x36b540[_0xd83b('0x43')]=_[_0xd83b('0x44')](_0x36b540['where'],{'$or':_[_0xd83b('0x2e')](_0x36b540['attributes'],function(_0x999473){var _0x4a940e={};_0x4a940e[_0x999473]={'$like':'%'+_0x1b3c74['query'][_0xd83b('0x42')]+'%'};return _0x4a940e;})});}_0x36b540=_[_0xd83b('0x44')]({},_0x36b540,_0x1b3c74[_0xd83b('0x45')]);return _0x5dd3c1[_0xd83b('0x84')](_0x36b540);}})['then'](function(_0x3730fd){if(_0x3730fd){_0x729627=_0x3730fd[_0xd83b('0x3b')];if(!_0x1b3c74['query'][_0xd83b('0x3c')]('nolimit')){_0x36b540['limit']=qs[_0xd83b('0x1d')](_0x1b3c74[_0xd83b('0x35')][_0xd83b('0x1d')]);_0x36b540[_0xd83b('0x1f')]=qs['offset'](_0x1b3c74['query'][_0xd83b('0x1f')]);}return _0x5dd3c1['getBlackLists'](_0x36b540);}})[_0xd83b('0x25')](function(_0x2b3a4b){if(_0x2b3a4b){return _0x2b3a4b?{'count':_0x729627,'rows':_0x2b3a4b}:null;}})[_0xd83b('0x25')](respondWithResult(_0x507df2,null))[_0xd83b('0x4a')](handleError(_0x507df2,null));};exports[_0xd83b('0x85')]=function(_0x15f652,_0x5bcae2,_0x4a107c){var _0x5a6c85,_0x209081;return db['Campaign']['find']({'where':{'id':_0x15f652[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x5bcae2,null))[_0xd83b('0x25')](function(_0x4263a9){if(_0x4263a9){_0x209081=_0x4263a9;return _0x4263a9[_0xd83b('0x85')](_0x15f652[_0xd83b('0x4e')][_0xd83b('0x64')],_[_0xd83b('0x54')](_0x15f652[_0xd83b('0x4e')],['ids','id'])||{});}return null;})[_0xd83b('0x65')](function(_0x16f8a8){var _0x28849a;_0x5a6c85=_0x16f8a8||[];var _0x487095=[];if(_0x16f8a8){for(var _0xb57bc1=0x0;_0xb57bc1<_0x16f8a8[_0xd83b('0x3b')];_0xb57bc1+=0x1){var _0x841bd8=_0x16f8a8[_0xb57bc1][_0xd83b('0x27')]({'plain':!![]});_0x28849a=squel[_0xd83b('0x68')]()['into']('cm_hopper_black')['fromQuery'](['phone',_0xd83b('0x6d'),'ListId',_0xd83b('0x5e'),_0xd83b('0x56'),_0xd83b('0x55')],squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x70'),_0xd83b('0x70'))['field']('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x841bd8[_0xd83b('0x72')]['toString'](),_0xd83b('0x6e'))[_0xd83b('0x71')](_0x15f652[_0xd83b('0x4b')]['id'][_0xd83b('0x73')](),_0xd83b('0x5e'))['field'](_0xd83b('0x74'),_0xd83b('0x56'))['field'](_0xd83b('0x74'),'updatedAt')[_0xd83b('0x7b')](_0xd83b('0x75'))[_0xd83b('0x43')](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x841bd8[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')](_0xd83b('0x78')))[_0xd83b('0x73')]();_0x487095[_0xd83b('0x80')](db[_0xd83b('0x81')]['query'](_0x28849a));}return BPromise[_0xd83b('0x82')](_0x487095);}})[_0xd83b('0x25')](function(){return _0x5a6c85;})[_0xd83b('0x25')](respondWithResult(_0x5bcae2,null))['catch'](handleError(_0x5bcae2,null));};exports[_0xd83b('0x86')]=function(_0xf7bc9f,_0x1e616f,_0x5ca7ac){return db[_0xd83b('0x2f')][_0xd83b('0x4c')]({'where':{'id':_0xf7bc9f[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x1e616f,null))['then'](function(_0x25b80d){if(_0x25b80d){return _0x25b80d[_0xd83b('0x86')](_0xf7bc9f[_0xd83b('0x35')]['ids']);}})[_0xd83b('0x25')](function(_0x20aa56){if(_0x20aa56){return db[_0xd83b('0x61')][_0xd83b('0x26')]({'where':{'ListId':_0xf7bc9f['query'][_0xd83b('0x64')],'CampaignId':_0xf7bc9f[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](function(){return _0x20aa56;});}})[_0xd83b('0x25')](respondWithStatusCode(_0x1e616f,null))[_0xd83b('0x4a')](handleError(_0x1e616f,null));};
\ No newline at end of file
index 5534067..dc4cc33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 44cb02e..2f2d105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe644=['error','code','message','catch','GetCampaign','findAll','options','raw','where','limit','map','include','model','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a2718,_0x2b8edb){var _0x41cddf=function(_0x2924d7){while(--_0x2924d7){_0x4a2718['push'](_0x4a2718['shift']());}};_0x41cddf(++_0x2b8edb);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});}exports[_0x4e64('0x16')]=function(_0x135ffb){var _0x3961c5=this;return new Promise(function(_0x1be196,_0x2df16a){return db['Campaign'][_0x4e64('0x17')]({'raw':_0x135ffb[_0x4e64('0x18')]?_0x135ffb['options'][_0x4e64('0x19')]===undefined?!![]:![]:!![],'where':_0x135ffb['options']?_0x135ffb['options'][_0x4e64('0x1a')]||null:null,'attributes':_0x135ffb[_0x4e64('0x18')]?_0x135ffb[_0x4e64('0x18')]['attributes']||null:null,'limit':_0x135ffb[_0x4e64('0x18')]?_0x135ffb['options'][_0x4e64('0x1b')]||null:null,'include':_0x135ffb[_0x4e64('0x18')]?_0x135ffb[_0x4e64('0x18')]['include']?_[_0x4e64('0x1c')](_0x135ffb[_0x4e64('0x18')][_0x4e64('0x1d')],function(_0x27d33e){return{'model':db[_0x27d33e[_0x4e64('0x1e')]],'as':_0x27d33e['as'],'attributes':_0x27d33e[_0x4e64('0x1f')],'include':_0x27d33e[_0x4e64('0x1d')]?_['map'](_0x27d33e[_0x4e64('0x1d')],function(_0x29b4f8){return{'model':db[_0x29b4f8[_0x4e64('0x1e')]],'as':_0x29b4f8['as'],'attributes':_0x29b4f8['attributes'],'include':_0x29b4f8[_0x4e64('0x1d')]?_[_0x4e64('0x1c')](_0x29b4f8[_0x4e64('0x1d')],function(_0x457023){return{'model':db[_0x457023[_0x4e64('0x1e')]],'as':_0x457023['as'],'attributes':_0x457023['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e64('0x20')](function(_0x2b1f2b){logger[_0x4e64('0xc')](_0x4e64('0x16'),_0x135ffb);logger[_0x4e64('0xf')](_0x4e64('0x16'),_0x135ffb,JSON[_0x4e64('0x11')](_0x2b1f2b));_0x1be196(_0x2b1f2b);})[_0x4e64('0x15')](function(_0x5467a5){logger[_0x4e64('0x12')](_0x4e64('0x16'),_0x5467a5[_0x4e64('0x14')],_0x135ffb);_0x2df16a(_0x3961c5[_0x4e64('0x12')](0x1f4,_0x5467a5[_0x4e64('0x14')]));});});};
\ No newline at end of file
+var _0x7980=['where','attributes','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw'];(function(_0x5f31b0,_0x5d6223){var _0x5eb946=function(_0x12d002){while(--_0x12d002){_0x5f31b0['push'](_0x5f31b0['shift']());}};_0x5eb946(++_0x5d6223);}(_0x7980,0xab));var _0x0798=function(_0x981b3c,_0x57e72f){_0x981b3c=_0x981b3c-0x0;var _0x39d4ad=_0x7980[_0x981b3c];return _0x39d4ad;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('Campaign,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});}exports['GetCampaign']=function(_0x41e217){var _0x46e74c=this;return new Promise(function(_0x288f41,_0x145197){return db['Campaign'][_0x0798('0x18')]({'raw':_0x41e217[_0x0798('0x19')]?_0x41e217['options'][_0x0798('0x1a')]===undefined?!![]:![]:!![],'where':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')][_0x0798('0x1b')]||null:null,'attributes':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')][_0x0798('0x1c')]||null:null,'limit':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')]['limit']||null:null,'include':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')][_0x0798('0x1d')]?_[_0x0798('0x1e')](_0x41e217[_0x0798('0x19')][_0x0798('0x1d')],function(_0x52037c){return{'model':db[_0x52037c[_0x0798('0x1f')]],'as':_0x52037c['as'],'attributes':_0x52037c[_0x0798('0x1c')],'include':_0x52037c[_0x0798('0x1d')]?_[_0x0798('0x1e')](_0x52037c[_0x0798('0x1d')],function(_0x23d59c){return{'model':db[_0x23d59c['model']],'as':_0x23d59c['as'],'attributes':_0x23d59c[_0x0798('0x1c')],'include':_0x23d59c[_0x0798('0x1d')]?_[_0x0798('0x1e')](_0x23d59c['include'],function(_0x4bc3f3){return{'model':db[_0x4bc3f3['model']],'as':_0x4bc3f3['as'],'attributes':_0x4bc3f3['attributes']};}):[]};}):[]};}):[]:[]})[_0x0798('0xc')](function(_0x2dfbff){logger[_0x0798('0xd')](_0x0798('0x20'),_0x41e217);logger[_0x0798('0x10')](_0x0798('0x20'),_0x41e217,JSON[_0x0798('0x12')](_0x2dfbff));_0x288f41(_0x2dfbff);})[_0x0798('0x17')](function(_0x5bbe3d){logger[_0x0798('0x13')]('GetCampaign',_0x5bbe3d['message'],_0x41e217);_0x145197(_0x46e74c[_0x0798('0x13')](0x1f4,_0x5bbe3d['message']));});});};
\ No newline at end of file
index 04fd70d..6b840ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa22a=['create','/:id/clone','addLists','put','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0xec722a,_0x354472){var _0xbb0f9e=function(_0x2a017b){while(--_0x2a017b){_0xec722a['push'](_0xec722a['shift']());}};_0xbb0f9e(++_0x354472);}(_0xa22a,0x153));var _0xaa22=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa22a[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xaa22('0x0'));var util=require(_0xaa22('0x1'));var path=require(_0xaa22('0x2'));var timeout=require(_0xaa22('0x3'));var express=require(_0xaa22('0x4'));var router=express['Router']();var fs_extra=require(_0xaa22('0x5'));var auth=require(_0xaa22('0x6'));var interaction=require(_0xaa22('0x7'));var config=require(_0xaa22('0x8'));var controller=require(_0xaa22('0x9'));router[_0xaa22('0xa')]('/',auth['isAuthenticated'](),controller[_0xaa22('0xb')]);router['get'](_0xaa22('0xc'),auth[_0xaa22('0xd')](),controller[_0xaa22('0xe')]);router[_0xaa22('0xa')]('/:id/hoppers',auth[_0xaa22('0xd')](),controller['getHoppers']);router[_0xaa22('0xa')](_0xaa22('0xf'),auth['isAuthenticated'](),controller[_0xaa22('0x10')]);router['get']('/:id/hopper_finals',auth[_0xaa22('0xd')](),controller['getHopperFinals']);router[_0xaa22('0xa')](_0xaa22('0x11'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x12')]);router[_0xaa22('0xa')](_0xaa22('0x13'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x14')]);router[_0xaa22('0xa')](_0xaa22('0x15'),auth['isAuthenticated'](),controller[_0xaa22('0x16')]);router[_0xaa22('0x17')]('/',auth[_0xaa22('0xd')](),controller[_0xaa22('0x18')]);router[_0xaa22('0x17')](_0xaa22('0x19'),auth['isAuthenticated'](),controller['clone']);router[_0xaa22('0x17')](_0xaa22('0x13'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1a')]);router[_0xaa22('0x17')](_0xaa22('0x15'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xaa22('0x1b')](_0xaa22('0xc'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1c')]);router[_0xaa22('0x1d')](_0xaa22('0xc'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1e')]);router[_0xaa22('0x1d')](_0xaa22('0x13'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1f')]);router[_0xaa22('0x1d')](_0xaa22('0x15'),auth[_0xaa22('0xd')](),controller['removeBlackLists']);module[_0xaa22('0x20')]=router;
\ No newline at end of file
+var _0xf31a=['/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0xf31a,0xaa));var _0xaf31=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xf31a[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require('multer');var util=require(_0xaf31('0x0'));var path=require(_0xaf31('0x1'));var timeout=require(_0xaf31('0x2'));var express=require('express');var router=express[_0xaf31('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf31('0x4'));var config=require(_0xaf31('0x5'));var controller=require('./campaign.controller');router['get']('/',auth[_0xaf31('0x6')](),controller[_0xaf31('0x7')]);router[_0xaf31('0x8')](_0xaf31('0x9'),auth[_0xaf31('0x6')](),controller['show']);router[_0xaf31('0x8')](_0xaf31('0xa'),auth[_0xaf31('0x6')](),controller[_0xaf31('0xb')]);router[_0xaf31('0x8')](_0xaf31('0xc'),auth[_0xaf31('0x6')](),controller['getHopperHistories']);router[_0xaf31('0x8')](_0xaf31('0xd'),auth[_0xaf31('0x6')](),controller[_0xaf31('0xe')]);router['get'](_0xaf31('0xf'),auth[_0xaf31('0x6')](),controller['getHopperBlacks']);router[_0xaf31('0x8')](_0xaf31('0x10'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x11')]);router[_0xaf31('0x8')](_0xaf31('0x12'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x13')]);router[_0xaf31('0x14')]('/',auth[_0xaf31('0x6')](),controller[_0xaf31('0x15')]);router['post'](_0xaf31('0x16'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x17')]);router[_0xaf31('0x14')](_0xaf31('0x10'),auth['isAuthenticated'](),controller[_0xaf31('0x18')]);router[_0xaf31('0x14')](_0xaf31('0x12'),auth['isAuthenticated'](),controller[_0xaf31('0x19')]);router[_0xaf31('0x1a')](_0xaf31('0x9'),auth[_0xaf31('0x6')](),controller['update']);router[_0xaf31('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xaf31('0x1c')]);router['delete'](_0xaf31('0x10'),auth['isAuthenticated'](),controller[_0xaf31('0x1d')]);router[_0xaf31('0x1b')](_0xaf31('0x12'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x1e')]);module[_0xaf31('0x1f')]=router;
\ No newline at end of file
index 5fabab1..e797c59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37c4=['sequelize','TEXT','VIRTUAL','getDataValue','key'];(function(_0x52f5bd,_0x5d3fda){var _0x2b7c6a=function(_0x1bfc8d){while(--_0x1bfc8d){_0x52f5bd['push'](_0x52f5bd['shift']());}};_0x2b7c6a(++_0x5d3fda);}(_0x37c4,0x190));var _0x437c=function(_0x401c1e,_0x37d694){_0x401c1e=_0x401c1e-0x0;var _0x28a94a=_0x37c4[_0x401c1e];return _0x28a94a;};'use strict';var Sequelize=require(_0x437c('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x437c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x437c('0x2')],'get':function(){return this[_0x437c('0x3')](_0x437c('0x4'));}}};
\ No newline at end of file
+var _0x0ea3=['TEXT','STRING','VIRTUAL','key','sequelize'];(function(_0x5bb876,_0x56be18){var _0x29ec93=function(_0x3e21a1){while(--_0x3e21a1){_0x5bb876['push'](_0x5bb876['shift']());}};_0x29ec93(++_0x56be18);}(_0x0ea3,0x81));var _0x30ea=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x0ea3[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0x30ea('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x30ea('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x30ea('0x2')]},'name':{'type':Sequelize[_0x30ea('0x3')],'get':function(){return this['getDataValue'](_0x30ea('0x4'));}}};
\ No newline at end of file
index 914507f..969f2b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb8a=['options','includeAll','include','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbb8a,0x1e0));var _0xabb8=function(_0x36ff0d,_0x4dad91){_0x36ff0d=_0x36ff0d-0x0;var _0x49ba07=_0xbb8a[_0x36ff0d];return _0x49ba07;};'use strict';var emlformat=require(_0xabb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabb8('0x2'));var moment=require('moment');var BPromise=require(_0xabb8('0x3'));var Mustache=require('mustache');var util=require(_0xabb8('0x4'));var path=require(_0xabb8('0x5'));var sox=require(_0xabb8('0x6'));var csv=require(_0xabb8('0x7'));var ejs=require(_0xabb8('0x8'));var fs=require('fs');var fs_extra=require(_0xabb8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xabb8('0xa'));var jsforce=require(_0xabb8('0xb'));var deskjs=require(_0xabb8('0xc'));var toCsv=require(_0xabb8('0x7'));var querystring=require(_0xabb8('0xd'));var Papa=require(_0xabb8('0xe'));var Redis=require(_0xabb8('0xf'));var authService=require(_0xabb8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xabb8('0x11'))('api');var utils=require(_0xabb8('0x12'));var config=require(_0xabb8('0x13'));var licenseUtil=require(_0xabb8('0x14'));var db=require(_0xabb8('0x15'))['db'];function respondWithStatusCode(_0x2050de,_0x13257f){_0x13257f=_0x13257f||0xcc;return function(_0x72242e){if(_0x72242e){return _0x2050de['sendStatus'](_0x13257f);}return _0x2050de[_0xabb8('0x16')](_0x13257f)[_0xabb8('0x17')]();};}function respondWithResult(_0x4078fc,_0xf646dc){_0xf646dc=_0xf646dc||0xc8;return function(_0x15322e){if(_0x15322e){return _0x4078fc[_0xabb8('0x16')](_0xf646dc)[_0xabb8('0x18')](_0x15322e);}};}function respondWithFilteredResult(_0x38acae,_0x3fd029){return function(_0x4d7f90){if(_0x4d7f90){var _0x4a396c=typeof _0x3fd029['offset']==='undefined'&&typeof _0x3fd029[_0xabb8('0x19')]===_0xabb8('0x1a');var _0x5926b3=_0x4d7f90[_0xabb8('0x1b')];var _0xe3bac3=_0x4a396c?0x0:_0x3fd029['offset'];var _0x284111=_0x4a396c?_0x4d7f90[_0xabb8('0x1b')]:_0x3fd029[_0xabb8('0x1c')]+_0x3fd029['limit'];var _0x36864f;if(_0x284111>=_0x5926b3){_0x284111=_0x5926b3;_0x36864f=0xc8;}else{_0x36864f=0xce;}_0x38acae[_0xabb8('0x16')](_0x36864f);return _0x38acae[_0xabb8('0x1d')](_0xabb8('0x1e'),_0xe3bac3+'-'+_0x284111+'/'+_0x5926b3)[_0xabb8('0x18')](_0x4d7f90);}return null;};}function patchUpdates(_0x27f9e){return function(_0x4938d3){try{jsonpatch[_0xabb8('0x1f')](_0x4938d3,_0x27f9e,!![]);}catch(_0x307c21){return BPromise['reject'](_0x307c21);}return _0x4938d3[_0xabb8('0x20')]();};}function saveUpdates(_0x2ea136,_0x5cb039){return function(_0x44293d){if(_0x44293d){return _0x44293d[_0xabb8('0x21')](_0x2ea136)[_0xabb8('0x22')](function(_0x375a4b){return _0x375a4b;});}return null;};}function removeEntity(_0x21fad4,_0x1dfb84){return function(_0x51e2bf){if(_0x51e2bf){return _0x51e2bf[_0xabb8('0x23')]()[_0xabb8('0x22')](function(){var _0x782105=_0x51e2bf[_0xabb8('0x24')]({'plain':!![]});var _0x428d70=_0xabb8('0x25');return db[_0xabb8('0x26')]['destroy']({'where':{'type':_0x428d70,'resourceId':_0x782105['id']}})[_0xabb8('0x22')](function(){return _0x51e2bf;});})[_0xabb8('0x22')](function(){_0x21fad4[_0xabb8('0x16')](0xcc)[_0xabb8('0x17')]();});}};}function handleEntityNotFound(_0x32381b,_0x2a7a31){return function(_0x577855){if(!_0x577855){_0x32381b[_0xabb8('0x27')](0x194);}return _0x577855;};}function handleError(_0x376de9,_0x303906){_0x303906=_0x303906||0x1f4;return function(_0x220cf4){logger[_0xabb8('0x28')](_0x220cf4[_0xabb8('0x29')]);if(_0x220cf4[_0xabb8('0x2a')]){delete _0x220cf4[_0xabb8('0x2a')];}_0x376de9[_0xabb8('0x16')](_0x303906)[_0xabb8('0x2b')](_0x220cf4);};}exports[_0xabb8('0x2c')]=function(_0x369eb9,_0x11fc4b){var _0xda507f={},_0x36c667={},_0x472d73={'count':0x0,'rows':[]};var _0x354614=_[_0xabb8('0x2d')](db[_0xabb8('0x2e')][_0xabb8('0x2f')],function(_0x21273b){return{'name':_0x21273b[_0xabb8('0x30')],'type':_0x21273b[_0xabb8('0x31')][_0xabb8('0x32')]};});_0x36c667[_0xabb8('0x33')]=_['map'](_0x354614,_0xabb8('0x2a'));_0x36c667[_0xabb8('0x34')]=_['keys'](_0x369eb9['query']);_0x36c667[_0xabb8('0x35')]=_['intersection'](_0x36c667[_0xabb8('0x33')],_0x36c667[_0xabb8('0x34')]);_0xda507f[_0xabb8('0x36')]=_[_0xabb8('0x37')](_0x36c667['model'],qs[_0xabb8('0x38')](_0x369eb9[_0xabb8('0x34')][_0xabb8('0x38')]));_0xda507f['attributes']=_0xda507f['attributes'][_0xabb8('0x39')]?_0xda507f['attributes']:_0x36c667['model'];if(!_0x369eb9[_0xabb8('0x34')][_0xabb8('0x3a')](_0xabb8('0x3b'))){_0xda507f['limit']=qs[_0xabb8('0x19')](_0x369eb9[_0xabb8('0x34')]['limit']);_0xda507f[_0xabb8('0x1c')]=qs[_0xabb8('0x1c')](_0x369eb9[_0xabb8('0x34')][_0xabb8('0x1c')]);}_0xda507f[_0xabb8('0x3c')]=qs[_0xabb8('0x3d')](_0x369eb9['query'][_0xabb8('0x3d')]);_0xda507f[_0xabb8('0x3e')]=qs['filters'](_[_0xabb8('0x3f')](_0x369eb9[_0xabb8('0x34')],_0x36c667[_0xabb8('0x35')]),_0x354614);if(_0x369eb9['query'][_0xabb8('0x40')]){_0xda507f['where']=_[_0xabb8('0x41')](_0xda507f[_0xabb8('0x3e')],{'$or':[{'key':{'$like':'%'+_0x369eb9['query'][_0xabb8('0x40')]+'%'}},{'value':{'$like':'%'+_0x369eb9[_0xabb8('0x34')][_0xabb8('0x40')]+'%'}}]});}_0xda507f=_[_0xabb8('0x41')]({},_0xda507f,_0x369eb9[_0xabb8('0x42')]);var _0x5f18b1={'where':_0xda507f[_0xabb8('0x3e')]};return db[_0xabb8('0x2e')]['count'](_0x5f18b1)[_0xabb8('0x22')](function(_0x44fda5){_0x472d73[_0xabb8('0x1b')]=_0x44fda5;if(_0x369eb9[_0xabb8('0x34')][_0xabb8('0x43')]){_0xda507f[_0xabb8('0x44')]=[{'all':!![]}];}return db[_0xabb8('0x2e')]['findAll'](_0xda507f);})[_0xabb8('0x22')](function(_0x5b6312){_0x472d73[_0xabb8('0x45')]=_0x5b6312;return _0x472d73;})[_0xabb8('0x22')](respondWithFilteredResult(_0x11fc4b,_0xda507f))[_0xabb8('0x46')](handleError(_0x11fc4b,null));};exports[_0xabb8('0x47')]=function(_0x471ee1,_0x314440){var _0x2495d3={'raw':!![],'where':{'id':_0x471ee1[_0xabb8('0x48')]['id']}},_0x257f82={};_0x257f82[_0xabb8('0x33')]=_[_0xabb8('0x49')](db[_0xabb8('0x2e')][_0xabb8('0x2f')]);_0x257f82[_0xabb8('0x34')]=_[_0xabb8('0x49')](_0x471ee1[_0xabb8('0x34')]);_0x257f82[_0xabb8('0x35')]=_[_0xabb8('0x37')](_0x257f82[_0xabb8('0x33')],_0x257f82[_0xabb8('0x34')]);_0x2495d3[_0xabb8('0x36')]=_['intersection'](_0x257f82[_0xabb8('0x33')],qs[_0xabb8('0x38')](_0x471ee1[_0xabb8('0x34')][_0xabb8('0x38')]));_0x2495d3[_0xabb8('0x36')]=_0x2495d3[_0xabb8('0x36')][_0xabb8('0x39')]?_0x2495d3[_0xabb8('0x36')]:_0x257f82['model'];if(_0x471ee1[_0xabb8('0x34')]['includeAll']){_0x2495d3[_0xabb8('0x44')]=[{'all':!![]}];}_0x2495d3=_[_0xabb8('0x41')]({},_0x2495d3,_0x471ee1[_0xabb8('0x42')]);return db[_0xabb8('0x2e')][_0xabb8('0x4a')](_0x2495d3)[_0xabb8('0x22')](handleEntityNotFound(_0x314440,null))[_0xabb8('0x22')](respondWithResult(_0x314440,null))[_0xabb8('0x46')](handleError(_0x314440,null));};exports['update']=function(_0x1c298c,_0x589b3d){if(_0x1c298c[_0xabb8('0x4b')]['id']){delete _0x1c298c[_0xabb8('0x4b')]['id'];}return db['CannedAnswer'][_0xabb8('0x4a')]({'where':{'id':_0x1c298c[_0xabb8('0x48')]['id']}})['then'](handleEntityNotFound(_0x589b3d,null))[_0xabb8('0x22')](saveUpdates(_0x1c298c[_0xabb8('0x4b')],null))[_0xabb8('0x22')](respondWithResult(_0x589b3d,null))[_0xabb8('0x46')](handleError(_0x589b3d,null));};exports[_0xabb8('0x23')]=function(_0x271c76,_0x1f8461){return db[_0xabb8('0x2e')][_0xabb8('0x4a')]({'where':{'id':_0x271c76[_0xabb8('0x48')]['id']}})[_0xabb8('0x22')](handleEntityNotFound(_0x1f8461,null))[_0xabb8('0x22')](removeEntity(_0x1f8461,null))['catch'](handleError(_0x1f8461,null));};exports[_0xabb8('0x4c')]=function(_0x3bc260,_0x97c149){var _0x323e4f={'key':_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x32')]};if(_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x4d')]){_0x323e4f[_0xabb8('0x4d')]=_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x4d')];}else if(_0x3bc260[_0xabb8('0x4b')]['SmsAccountId']){_0x323e4f[_0xabb8('0x4e')]=_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x4e')];}else if(_0x3bc260[_0xabb8('0x4b')]['OpenchannelAccountId']){_0x323e4f[_0xabb8('0x4f')]=_0x3bc260[_0xabb8('0x4b')]['OpenchannelAccountId'];}else if(_0x3bc260['body'][_0xabb8('0x50')]){_0x323e4f[_0xabb8('0x50')]=_0x3bc260['body'][_0xabb8('0x50')];}return db['CannedAnswer'][_0xabb8('0x4a')]({'where':_0x323e4f})['then'](function(_0x22e423){if(_0x22e423){throw new db[(_0xabb8('0x51'))][(_0xabb8('0x52'))](_0xabb8('0x53'));}return db['CannedAnswer'][_0xabb8('0x4c')](_0x3bc260['body']);})[_0xabb8('0x22')](function(_0x4069e1){var _0x48dfcc=_0x3bc260[_0xabb8('0x54')][_0xabb8('0x24')]({'plain':!![]});if(!_0x48dfcc)throw new Error(_0xabb8('0x55'));if(_0x48dfcc[_0xabb8('0x56')]===_0xabb8('0x54')){var _0xabc1d8=_0x4069e1[_0xabb8('0x24')]({'plain':!![]});return db[_0xabb8('0x57')]['find']({'where':{'name':_0xabb8('0x25'),'userProfileId':_0x48dfcc[_0xabb8('0x58')]},'raw':!![]})['then'](function(_0x386dcd){if(_0x386dcd&&_0x386dcd[_0xabb8('0x59')]===0x0){return db[_0xabb8('0x26')][_0xabb8('0x4c')]({'name':_0xabc1d8[_0xabb8('0x2a')],'resourceId':_0xabc1d8['id'],'type':_0x386dcd[_0xabb8('0x2a')],'sectionId':_0x386dcd['id']},{})[_0xabb8('0x22')](function(){return _0x4069e1;});}else{return _0x4069e1;}})[_0xabb8('0x46')](function(_0x534b95){logger[_0xabb8('0x28')](_0xabb8('0x5a'),_0x534b95);throw _0x534b95;});}return _0x4069e1;})[_0xabb8('0x22')](respondWithResult(_0x97c149,0xc9))[_0xabb8('0x46')](handleError(_0x97c149,null));};
\ No newline at end of file
+var _0xa495=['query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','params','length','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','key'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa495,0xc7));var _0x5a49=function(_0x58b693,_0x14ee77){_0x58b693=_0x58b693-0x0;var _0x400350=_0xa495[_0x58b693];return _0x400350;};'use strict';var emlformat=require(_0x5a49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a49('0x1'));var jsonpatch=require(_0x5a49('0x2'));var rp=require(_0x5a49('0x3'));var moment=require(_0x5a49('0x4'));var BPromise=require(_0x5a49('0x5'));var Mustache=require(_0x5a49('0x6'));var util=require(_0x5a49('0x7'));var path=require(_0x5a49('0x8'));var sox=require(_0x5a49('0x9'));var csv=require(_0x5a49('0xa'));var ejs=require(_0x5a49('0xb'));var fs=require('fs');var fs_extra=require(_0x5a49('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a49('0xd'));var jsforce=require(_0x5a49('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5a49('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5a49('0x10'));var as=require(_0x5a49('0x11'));var hardwareService=require(_0x5a49('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x5a49('0x13'));var config=require(_0x5a49('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a49('0x15'))['db'];function respondWithStatusCode(_0x1bfb35,_0x35f7ca){_0x35f7ca=_0x35f7ca||0xcc;return function(_0x380807){if(_0x380807){return _0x1bfb35[_0x5a49('0x16')](_0x35f7ca);}return _0x1bfb35['status'](_0x35f7ca)[_0x5a49('0x17')]();};}function respondWithResult(_0x2d217d,_0x5354b1){_0x5354b1=_0x5354b1||0xc8;return function(_0x9d406a){if(_0x9d406a){return _0x2d217d[_0x5a49('0x18')](_0x5354b1)[_0x5a49('0x19')](_0x9d406a);}};}function respondWithFilteredResult(_0x2a7a81,_0x5e62cc){return function(_0x52ca58){if(_0x52ca58){var _0x401383=typeof _0x5e62cc[_0x5a49('0x1a')]===_0x5a49('0x1b')&&typeof _0x5e62cc[_0x5a49('0x1c')]===_0x5a49('0x1b');var _0x20b740=_0x52ca58[_0x5a49('0x1d')];var _0x434a55=_0x401383?0x0:_0x5e62cc[_0x5a49('0x1a')];var _0x52874c=_0x401383?_0x52ca58[_0x5a49('0x1d')]:_0x5e62cc[_0x5a49('0x1a')]+_0x5e62cc[_0x5a49('0x1c')];var _0x17a68b;if(_0x52874c>=_0x20b740){_0x52874c=_0x20b740;_0x17a68b=0xc8;}else{_0x17a68b=0xce;}_0x2a7a81['status'](_0x17a68b);return _0x2a7a81[_0x5a49('0x1e')]('Content-Range',_0x434a55+'-'+_0x52874c+'/'+_0x20b740)['json'](_0x52ca58);}return null;};}function patchUpdates(_0x1db405){return function(_0x2abb42){try{jsonpatch['apply'](_0x2abb42,_0x1db405,!![]);}catch(_0x2096f5){return BPromise[_0x5a49('0x1f')](_0x2096f5);}return _0x2abb42[_0x5a49('0x20')]();};}function saveUpdates(_0x2d9bf5,_0x5b6c65){return function(_0x5afbdc){if(_0x5afbdc){return _0x5afbdc[_0x5a49('0x21')](_0x2d9bf5)['then'](function(_0x51377e){return _0x51377e;});}return null;};}function removeEntity(_0x1cc92e,_0x576ec2){return function(_0x52b9d4){if(_0x52b9d4){return _0x52b9d4[_0x5a49('0x22')]()[_0x5a49('0x23')](function(){var _0x26c24c=_0x52b9d4[_0x5a49('0x24')]({'plain':!![]});var _0x388615=_0x5a49('0x25');return db[_0x5a49('0x26')][_0x5a49('0x22')]({'where':{'type':_0x388615,'resourceId':_0x26c24c['id']}})['then'](function(){return _0x52b9d4;});})[_0x5a49('0x23')](function(){_0x1cc92e[_0x5a49('0x18')](0xcc)[_0x5a49('0x17')]();});}};}function handleEntityNotFound(_0x57fc1f,_0x887e42){return function(_0x52a2b9){if(!_0x52a2b9){_0x57fc1f['sendStatus'](0x194);}return _0x52a2b9;};}function handleError(_0x18d9be,_0x5d5e7a){_0x5d5e7a=_0x5d5e7a||0x1f4;return function(_0x4884eb){logger['error'](_0x4884eb[_0x5a49('0x27')]);if(_0x4884eb[_0x5a49('0x28')]){delete _0x4884eb['name'];}_0x18d9be[_0x5a49('0x18')](_0x5d5e7a)[_0x5a49('0x29')](_0x4884eb);};}exports[_0x5a49('0x2a')]=function(_0x3a0603,_0x539cee){var _0x3a25e7={},_0x523725={},_0x4a1b81={'count':0x0,'rows':[]};var _0x884660=_['map'](db[_0x5a49('0x2b')][_0x5a49('0x2c')],function(_0x546c28){return{'name':_0x546c28[_0x5a49('0x2d')],'type':_0x546c28['type'][_0x5a49('0x2e')]};});_0x523725['model']=_['map'](_0x884660,_0x5a49('0x28'));_0x523725[_0x5a49('0x2f')]=_[_0x5a49('0x30')](_0x3a0603['query']);_0x523725['filters']=_[_0x5a49('0x31')](_0x523725['model'],_0x523725['query']);_0x3a25e7[_0x5a49('0x32')]=_[_0x5a49('0x31')](_0x523725[_0x5a49('0x33')],qs[_0x5a49('0x34')](_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x34')]));_0x3a25e7[_0x5a49('0x32')]=_0x3a25e7['attributes']['length']?_0x3a25e7[_0x5a49('0x32')]:_0x523725[_0x5a49('0x33')];if(!_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x35')](_0x5a49('0x36'))){_0x3a25e7[_0x5a49('0x1c')]=qs[_0x5a49('0x1c')](_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x1c')]);_0x3a25e7[_0x5a49('0x1a')]=qs[_0x5a49('0x1a')](_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x1a')]);}_0x3a25e7[_0x5a49('0x37')]=qs[_0x5a49('0x38')](_0x3a0603['query'][_0x5a49('0x38')]);_0x3a25e7[_0x5a49('0x39')]=qs['filters'](_['pick'](_0x3a0603[_0x5a49('0x2f')],_0x523725[_0x5a49('0x3a')]),_0x884660);if(_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3b')]){_0x3a25e7[_0x5a49('0x39')]=_['merge'](_0x3a25e7[_0x5a49('0x39')],{'$or':[{'key':{'$like':'%'+_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3b')]+'%'}}]});}_0x3a25e7=_[_0x5a49('0x3c')]({},_0x3a25e7,_0x3a0603['options']);var _0x3daa86={'where':_0x3a25e7[_0x5a49('0x39')]};return db['CannedAnswer'][_0x5a49('0x1d')](_0x3daa86)['then'](function(_0x428d7a){_0x4a1b81[_0x5a49('0x1d')]=_0x428d7a;if(_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3d')]){_0x3a25e7[_0x5a49('0x3e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3a25e7);})['then'](function(_0x41ed37){_0x4a1b81['rows']=_0x41ed37;return _0x4a1b81;})['then'](respondWithFilteredResult(_0x539cee,_0x3a25e7))['catch'](handleError(_0x539cee,null));};exports['show']=function(_0x2bc01c,_0x8fb72c){var _0x357fef={'raw':!![],'where':{'id':_0x2bc01c[_0x5a49('0x3f')]['id']}},_0x3f23f3={};_0x3f23f3[_0x5a49('0x33')]=_[_0x5a49('0x30')](db['CannedAnswer'][_0x5a49('0x2c')]);_0x3f23f3[_0x5a49('0x2f')]=_[_0x5a49('0x30')](_0x2bc01c[_0x5a49('0x2f')]);_0x3f23f3['filters']=_[_0x5a49('0x31')](_0x3f23f3[_0x5a49('0x33')],_0x3f23f3[_0x5a49('0x2f')]);_0x357fef[_0x5a49('0x32')]=_['intersection'](_0x3f23f3[_0x5a49('0x33')],qs[_0x5a49('0x34')](_0x2bc01c[_0x5a49('0x2f')]['fields']));_0x357fef[_0x5a49('0x32')]=_0x357fef[_0x5a49('0x32')][_0x5a49('0x40')]?_0x357fef[_0x5a49('0x32')]:_0x3f23f3[_0x5a49('0x33')];if(_0x2bc01c['query'][_0x5a49('0x3d')]){_0x357fef['include']=[{'all':!![]}];}_0x357fef=_['merge']({},_0x357fef,_0x2bc01c[_0x5a49('0x41')]);return db['CannedAnswer'][_0x5a49('0x42')](_0x357fef)[_0x5a49('0x23')](handleEntityNotFound(_0x8fb72c,null))[_0x5a49('0x23')](respondWithResult(_0x8fb72c,null))['catch'](handleError(_0x8fb72c,null));};exports['update']=function(_0x4187d8,_0x3c57b4){if(_0x4187d8[_0x5a49('0x43')]['id']){delete _0x4187d8[_0x5a49('0x43')]['id'];}return db[_0x5a49('0x2b')][_0x5a49('0x42')]({'where':{'id':_0x4187d8[_0x5a49('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c57b4,null))[_0x5a49('0x23')](saveUpdates(_0x4187d8[_0x5a49('0x43')],null))['then'](respondWithResult(_0x3c57b4,null))['catch'](handleError(_0x3c57b4,null));};exports['destroy']=function(_0x146053,_0x182007){return db['CannedAnswer'][_0x5a49('0x42')]({'where':{'id':_0x146053['params']['id']}})['then'](handleEntityNotFound(_0x182007,null))[_0x5a49('0x23')](removeEntity(_0x182007,null))['catch'](handleError(_0x182007,null));};exports[_0x5a49('0x44')]=function(_0x297467,_0x5a0d49){var _0x5c8fc9={'key':_0x297467[_0x5a49('0x43')][_0x5a49('0x2e')]};if(_0x297467[_0x5a49('0x43')]['MailAccountId']){_0x5c8fc9[_0x5a49('0x45')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x45')];}else if(_0x297467[_0x5a49('0x43')][_0x5a49('0x46')]){_0x5c8fc9[_0x5a49('0x46')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x46')];}else if(_0x297467['body']['OpenchannelAccountId']){_0x5c8fc9[_0x5a49('0x47')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x47')];}else if(_0x297467[_0x5a49('0x43')]['ChatWebsiteId']){_0x5c8fc9[_0x5a49('0x48')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x48')];}return db[_0x5a49('0x2b')][_0x5a49('0x42')]({'where':_0x5c8fc9})[_0x5a49('0x23')](function(_0x20f7b9){if(_0x20f7b9){throw new db[(_0x5a49('0x49'))]['ValidationError'](_0x5a49('0x4a'));}return db[_0x5a49('0x2b')][_0x5a49('0x44')](_0x297467['body']);})[_0x5a49('0x23')](function(_0x132802){var _0x2023c9=_0x297467[_0x5a49('0x4b')][_0x5a49('0x24')]({'plain':!![]});if(!_0x2023c9)throw new Error(_0x5a49('0x4c'));if(_0x2023c9[_0x5a49('0x4d')]===_0x5a49('0x4b')){var _0x39df3c=_0x132802[_0x5a49('0x24')]({'plain':!![]});return db[_0x5a49('0x4e')][_0x5a49('0x42')]({'where':{'name':'CannedAnswers','userProfileId':_0x2023c9['userProfileId']},'raw':!![]})['then'](function(_0x449462){if(_0x449462&&_0x449462[_0x5a49('0x4f')]===0x0){return db[_0x5a49('0x26')][_0x5a49('0x44')]({'name':_0x39df3c[_0x5a49('0x28')],'resourceId':_0x39df3c['id'],'type':_0x449462[_0x5a49('0x28')],'sectionId':_0x449462['id']},{})[_0x5a49('0x23')](function(){return _0x132802;});}else{return _0x132802;}})[_0x5a49('0x50')](function(_0xa9ea39){logger['error'](_0x5a49('0x51'),_0xa9ea39);throw _0xa9ea39;});}return _0x132802;})[_0x5a49('0x23')](respondWithResult(_0x5a0d49,0xc9))[_0x5a49('0x50')](handleError(_0x5a0d49,null));};
\ No newline at end of file
index 2780875..02ecccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7f3=['moment','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa7f3,0x82));var _0x3a7f=function(_0x166294,_0x175bc9){_0x166294=_0x166294-0x0;var _0x304968=_0xa7f3[_0x166294];return _0x304968;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3a7f('0x0'))(_0x3a7f('0x1'));var moment=require(_0x3a7f('0x2'));var BPromise=require('bluebird');var rp=require(_0x3a7f('0x3'));var fs=require('fs');var path=require(_0x3a7f('0x4'));var rimraf=require(_0x3a7f('0x5'));var config=require(_0x3a7f('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x3a7f('0x7')]=function(_0x5b109a,_0x2b240b){return _0x5b109a[_0x3a7f('0x8')](_0x3a7f('0x9'),attributes,{'tableName':_0x3a7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a7f('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6a47=['../../config/logger','api','moment','request-promise','path','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x5cbc6e,_0x14aa6e){var _0x3692b2=function(_0xc8d180){while(--_0xc8d180){_0x5cbc6e['push'](_0x5cbc6e['shift']());}};_0x3692b2(++_0x14aa6e);}(_0x6a47,0x112));var _0x76a4=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x6a47[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x76a4('0x0'));var util=require(_0x76a4('0x1'));var logger=require(_0x76a4('0x2'))(_0x76a4('0x3'));var moment=require(_0x76a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x76a4('0x5'));var fs=require('fs');var path=require(_0x76a4('0x6'));var rimraf=require('rimraf');var config=require(_0x76a4('0x7'));var attributes=require(_0x76a4('0x8'));module['exports']=function(_0x3c179a,_0xf49643){return _0x3c179a['define'](_0x76a4('0x9'),attributes,{'tableName':_0x76a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x76a4('0xb')});};
\ No newline at end of file
index b42367a..8f39446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c1eec,_0x3c72c9){var _0x1496fb=function(_0x5e0e44){while(--_0x5e0e44){_0x5c1eec['push'](_0x5c1eec['shift']());}};_0x1496fb(++_0x3c72c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x472216,_0x1f82c9){var _0x53322c=function(_0x37c26d){while(--_0x37c26d){_0x472216['push'](_0x472216['shift']());}};_0x53322c(++_0x1f82c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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
index a580510..19e1a9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cdf=['/:id','create','put','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x4cdf,0x122));var _0xf4cd=function(_0x68fe95,_0x1dc817){_0x68fe95=_0x68fe95-0x0;var _0x441dfd=_0x4cdf[_0x68fe95];return _0x441dfd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf4cd('0x0'));var timeout=require(_0xf4cd('0x1'));var express=require(_0xf4cd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf4cd('0x3'));var interaction=require(_0xf4cd('0x4'));var config=require(_0xf4cd('0x5'));var controller=require(_0xf4cd('0x6'));router['get']('/',auth[_0xf4cd('0x7')](),controller[_0xf4cd('0x8')]);router[_0xf4cd('0x9')](_0xf4cd('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf4cd('0x7')](),controller[_0xf4cd('0xb')]);router[_0xf4cd('0xc')]('/:id',auth[_0xf4cd('0x7')](),controller['update']);router['delete']('/:id',auth[_0xf4cd('0x7')](),controller[_0xf4cd('0xd')]);module[_0xf4cd('0xe')]=router;
\ No newline at end of file
+var _0x4928=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','exports'];(function(_0x56c1cc,_0x111a6c){var _0x1bab95=function(_0x43e320){while(--_0x43e320){_0x56c1cc['push'](_0x56c1cc['shift']());}};_0x1bab95(++_0x111a6c);}(_0x4928,0x10a));var _0x8492=function(_0x5192e8,_0x254ca4){_0x5192e8=_0x5192e8-0x0;var _0x9f0941=_0x4928[_0x5192e8];return _0x9f0941;};'use strict';var multer=require(_0x8492('0x0'));var util=require(_0x8492('0x1'));var path=require(_0x8492('0x2'));var timeout=require(_0x8492('0x3'));var express=require('express');var router=express[_0x8492('0x4')]();var fs_extra=require(_0x8492('0x5'));var auth=require(_0x8492('0x6'));var interaction=require(_0x8492('0x7'));var config=require(_0x8492('0x8'));var controller=require(_0x8492('0x9'));router[_0x8492('0xa')]('/',auth[_0x8492('0xb')](),controller['index']);router[_0x8492('0xa')](_0x8492('0xc'),auth['isAuthenticated'](),controller[_0x8492('0xd')]);router[_0x8492('0xe')]('/',auth[_0x8492('0xb')](),controller[_0x8492('0xf')]);router[_0x8492('0x10')]('/:id',auth[_0x8492('0xb')](),controller['update']);router['delete'](_0x8492('0xc'),auth[_0x8492('0xb')](),controller[_0x8492('0x11')]);module[_0x8492('0x12')]=router;
\ No newline at end of file
index 0d3088e..2269cb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6fe=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x502662,_0x2a759d){var _0x413217=function(_0x1b9542){while(--_0x1b9542){_0x502662['push'](_0x502662['shift']());}};_0x413217(++_0x2a759d);}(_0xc6fe,0xbc));var _0xec6f=function(_0x14a9b0,_0x1e68ec){_0x14a9b0=_0x14a9b0-0x0;var _0x292de8=_0xc6fe[_0x14a9b0];return _0x292de8;};'use strict';var Sequelize=require(_0xec6f('0x0'));module[_0xec6f('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xec6f('0x2')},'clid':{'type':Sequelize[_0xec6f('0x3')]},'src':{'type':Sequelize[_0xec6f('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xec6f('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xec6f('0x3')]},'lastapp':{'type':Sequelize[_0xec6f('0x3')]},'lastdata':{'type':Sequelize[_0xec6f('0x3')]},'duration':{'type':Sequelize[_0xec6f('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xec6f('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xec6f('0x3')]},'amaflags':{'type':Sequelize[_0xec6f('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xec6f('0x3')]},'userfield':{'type':Sequelize[_0xec6f('0x3')]},'uniqueid':{'type':Sequelize[_0xec6f('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xec6f('0x3')]},'peeraccount':{'type':Sequelize[_0xec6f('0x3')]},'type':{'type':Sequelize[_0xec6f('0x3')]},'tag':{'type':Sequelize[_0xec6f('0x3')]}};
\ No newline at end of file
+var _0x22a4=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x172789,_0x44450f){var _0xca1a41=function(_0x27cf95){while(--_0x27cf95){_0x172789['push'](_0x172789['shift']());}};_0xca1a41(++_0x44450f);}(_0x22a4,0x1cb));var _0x422a=function(_0x316b61,_0x395d65){_0x316b61=_0x316b61-0x0;var _0x945283=_0x22a4[_0x316b61];return _0x945283;};'use strict';var Sequelize=require(_0x422a('0x0'));module[_0x422a('0x1')]={'calldate':{'type':Sequelize[_0x422a('0x2')],'allowNull':![],'defaultValue':_0x422a('0x3')},'clid':{'type':Sequelize[_0x422a('0x4')]},'src':{'type':Sequelize[_0x422a('0x4')]},'dst':{'type':Sequelize[_0x422a('0x4')]},'dcontext':{'type':Sequelize[_0x422a('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x422a('0x4')]},'lastapp':{'type':Sequelize[_0x422a('0x4')]},'lastdata':{'type':Sequelize[_0x422a('0x4')]},'duration':{'type':Sequelize[_0x422a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x422a('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x422a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x422a('0x4')]},'userfield':{'type':Sequelize[_0x422a('0x4')]},'uniqueid':{'type':Sequelize[_0x422a('0x4')]},'linkedid':{'type':Sequelize[_0x422a('0x4')]},'sequence':{'type':Sequelize[_0x422a('0x4')]},'peeraccount':{'type':Sequelize[_0x422a('0x4')]},'type':{'type':Sequelize[_0x422a('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0cf9d06..17a8038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c3=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x390a9c,_0x2df333){var _0x11c6e8=function(_0x15e8b0){while(--_0x15e8b0){_0x390a9c['push'](_0x390a9c['shift']());}};_0x11c6e8(++_0x2df333);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];function respondWithStatusCode(_0x5dc732,_0x38b416){_0x38b416=_0x38b416||0xcc;return function(_0x491432){if(_0x491432){return _0x5dc732[_0x3e0c('0x1c')](_0x38b416);}return _0x5dc732[_0x3e0c('0x1d')](_0x38b416)['end']();};}function respondWithResult(_0x5f2654,_0x6d9c61){_0x6d9c61=_0x6d9c61||0xc8;return function(_0x409b2c){if(_0x409b2c){return _0x5f2654[_0x3e0c('0x1d')](_0x6d9c61)[_0x3e0c('0x1e')](_0x409b2c);}};}function respondWithFilteredResult(_0x15a269,_0x24fcf9){return function(_0x1947c2){if(_0x1947c2){var _0x274d75=typeof _0x24fcf9[_0x3e0c('0x1f')]===_0x3e0c('0x20')&&typeof _0x24fcf9[_0x3e0c('0x21')]==='undefined';var _0x58c498=_0x1947c2[_0x3e0c('0x22')];var _0x216993=_0x274d75?0x0:_0x24fcf9[_0x3e0c('0x1f')];var _0x41b19f=_0x274d75?_0x1947c2[_0x3e0c('0x22')]:_0x24fcf9[_0x3e0c('0x1f')]+_0x24fcf9['limit'];var _0x2e4a4a;if(_0x41b19f>=_0x58c498){_0x41b19f=_0x58c498;_0x2e4a4a=0xc8;}else{_0x2e4a4a=0xce;}_0x15a269[_0x3e0c('0x1d')](_0x2e4a4a);return _0x15a269[_0x3e0c('0x23')]('Content-Range',_0x216993+'-'+_0x41b19f+'/'+_0x58c498)[_0x3e0c('0x1e')](_0x1947c2);}return null;};}function patchUpdates(_0x5e3a93){return function(_0x479265){try{jsonpatch[_0x3e0c('0x24')](_0x479265,_0x5e3a93,!![]);}catch(_0x1f3bad){return BPromise[_0x3e0c('0x25')](_0x1f3bad);}return _0x479265[_0x3e0c('0x26')]();};}function saveUpdates(_0x4f8d38,_0x4cd447){return function(_0x3320c6){if(_0x3320c6){return _0x3320c6['update'](_0x4f8d38)['then'](function(_0x3fd7de){return _0x3fd7de;});}return null;};}function removeEntity(_0x1769b1,_0x44ce68){return function(_0x5bb7aa){if(_0x5bb7aa){return _0x5bb7aa[_0x3e0c('0x27')]()[_0x3e0c('0x28')](function(){_0x1769b1['status'](0xcc)[_0x3e0c('0x29')]();});}};}function handleEntityNotFound(_0x3de58b,_0x308fd5){return function(_0x1db945){if(!_0x1db945){_0x3de58b['sendStatus'](0x194);}return _0x1db945;};}function handleError(_0x412960,_0xc2f3cc){_0xc2f3cc=_0xc2f3cc||0x1f4;return function(_0x2c5fba){logger[_0x3e0c('0x2a')](_0x2c5fba['stack']);if(_0x2c5fba[_0x3e0c('0x2b')]){delete _0x2c5fba['name'];}_0x412960['status'](_0xc2f3cc)[_0x3e0c('0x2c')](_0x2c5fba);};}exports[_0x3e0c('0x2d')]=function(_0x4d3ce2,_0x16fb92){var _0x3f22b1={},_0x21d7a0={},_0x59c22f={'count':0x0,'rows':[]};var _0x44ecad=_[_0x3e0c('0x2e')](db['Cdr'][_0x3e0c('0x2f')],function(_0x2f31ad){return{'name':_0x2f31ad[_0x3e0c('0x30')],'type':_0x2f31ad[_0x3e0c('0x31')]['key']};});_0x21d7a0[_0x3e0c('0x32')]=_[_0x3e0c('0x2e')](_0x44ecad,_0x3e0c('0x2b'));_0x21d7a0['query']=_[_0x3e0c('0x33')](_0x4d3ce2[_0x3e0c('0x34')]);_0x21d7a0[_0x3e0c('0x35')]=_['intersection'](_0x21d7a0[_0x3e0c('0x32')],_0x21d7a0[_0x3e0c('0x34')]);_0x3f22b1[_0x3e0c('0x36')]=_[_0x3e0c('0x37')](_0x21d7a0[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x3f22b1[_0x3e0c('0x36')]=_0x3f22b1[_0x3e0c('0x36')][_0x3e0c('0x39')]?_0x3f22b1[_0x3e0c('0x36')]:_0x21d7a0[_0x3e0c('0x32')];if(!_0x4d3ce2[_0x3e0c('0x34')]['hasOwnProperty'](_0x3e0c('0x3a'))){_0x3f22b1[_0x3e0c('0x21')]=qs[_0x3e0c('0x21')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x21')]);_0x3f22b1[_0x3e0c('0x1f')]=qs[_0x3e0c('0x1f')](_0x4d3ce2[_0x3e0c('0x34')]['offset']);}_0x3f22b1['order']=qs[_0x3e0c('0x3b')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3b')]);_0x3f22b1[_0x3e0c('0x3c')]=qs[_0x3e0c('0x35')](_[_0x3e0c('0x3d')](_0x4d3ce2['query'],_0x21d7a0[_0x3e0c('0x35')]),_0x44ecad);if(_0x4d3ce2[_0x3e0c('0x34')]['filter']){_0x3f22b1['where']=_['merge'](_0x3f22b1[_0x3e0c('0x3c')],{'$or':_[_0x3e0c('0x2e')](_0x44ecad,function(_0x3d6ed7){if(_0x3d6ed7[_0x3e0c('0x31')]!==_0x3e0c('0x3e')){var _0x45ec69={};_0x45ec69[_0x3d6ed7[_0x3e0c('0x2b')]]={'$like':'%'+_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3f')]+'%'};return _0x45ec69;}})});}_0x3f22b1=_[_0x3e0c('0x40')]({},_0x3f22b1,_0x4d3ce2[_0x3e0c('0x41')]);var _0x20135d={'where':_0x3f22b1['where']};return db['Cdr']['count'](_0x20135d)[_0x3e0c('0x28')](function(_0x22fcd8){_0x59c22f['count']=_0x22fcd8;if(_0x4d3ce2['query'][_0x3e0c('0x42')]){_0x3f22b1[_0x3e0c('0x43')]=[{'all':!![]}];}return db[_0x3e0c('0x44')][_0x3e0c('0x45')](_0x3f22b1);})['then'](function(_0x2e562f){_0x59c22f[_0x3e0c('0x46')]=_0x2e562f;return _0x59c22f;})[_0x3e0c('0x28')](respondWithFilteredResult(_0x16fb92,_0x3f22b1))[_0x3e0c('0x47')](handleError(_0x16fb92,null));};exports[_0x3e0c('0x48')]=function(_0x4b5638,_0x1bc4b3){var _0x5f4274={'raw':!![],'where':{'id':_0x4b5638[_0x3e0c('0x49')]['id']}},_0x35111f={};_0x35111f['model']=_['keys'](db[_0x3e0c('0x44')][_0x3e0c('0x2f')]);_0x35111f['query']=_[_0x3e0c('0x33')](_0x4b5638[_0x3e0c('0x34')]);_0x35111f[_0x3e0c('0x35')]=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],_0x35111f[_0x3e0c('0x34')]);_0x5f4274['attributes']=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4b5638[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x5f4274[_0x3e0c('0x36')]=_0x5f4274['attributes'][_0x3e0c('0x39')]?_0x5f4274[_0x3e0c('0x36')]:_0x35111f[_0x3e0c('0x32')];if(_0x4b5638['query'][_0x3e0c('0x42')]){_0x5f4274[_0x3e0c('0x43')]=[{'all':!![]}];}_0x5f4274=_['merge']({},_0x5f4274,_0x4b5638[_0x3e0c('0x41')]);return db[_0x3e0c('0x44')][_0x3e0c('0x4a')](_0x5f4274)['then'](handleEntityNotFound(_0x1bc4b3,null))[_0x3e0c('0x28')](respondWithResult(_0x1bc4b3,null))[_0x3e0c('0x47')](handleError(_0x1bc4b3,null));};exports[_0x3e0c('0x4b')]=function(_0x2c7b8c,_0x109078){return db[_0x3e0c('0x44')][_0x3e0c('0x4b')](_0x2c7b8c[_0x3e0c('0x4c')],{})[_0x3e0c('0x28')](respondWithResult(_0x109078,0xc9))[_0x3e0c('0x47')](handleError(_0x109078,null));};exports[_0x3e0c('0x4d')]=function(_0x4efbf2,_0x20c9df){if(_0x4efbf2['body']['id']){delete _0x4efbf2['body']['id'];}return db[_0x3e0c('0x44')]['find']({'where':{'id':_0x4efbf2[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x20c9df,null))['then'](saveUpdates(_0x4efbf2[_0x3e0c('0x4c')],null))[_0x3e0c('0x28')](respondWithResult(_0x20c9df,null))['catch'](handleError(_0x20c9df,null));};exports[_0x3e0c('0x27')]=function(_0x3e04c9,_0x166203){return db[_0x3e0c('0x44')][_0x3e0c('0x4a')]({'where':{'id':_0x3e04c9[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x166203,null))[_0x3e0c('0x28')](removeEntity(_0x166203,null))[_0x3e0c('0x47')](handleError(_0x166203,null));};exports[_0x3e0c('0x4e')]=function(_0x4d0f77,_0x3743ae){return db[_0x3e0c('0x44')][_0x3e0c('0x4e')]()[_0x3e0c('0x28')](respondWithResult(_0x3743ae,null))[_0x3e0c('0x47')](handleError(_0x3743ae,null));};
\ No newline at end of file
+var _0xab86=['fieldName','type','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','filters','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','map','Cdr','rawAttributes'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xab86,0x13e));var _0x6ab8=function(_0x451e93,_0x319002){_0x451e93=_0x451e93-0x0;var _0x3af049=_0xab86[_0x451e93];return _0x3af049;};'use strict';var emlformat=require(_0x6ab8('0x0'));var rimraf=require(_0x6ab8('0x1'));var zipdir=require(_0x6ab8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ab8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ab8('0x4'));var util=require('util');var path=require(_0x6ab8('0x5'));var sox=require(_0x6ab8('0x6'));var csv=require(_0x6ab8('0x7'));var ejs=require(_0x6ab8('0x8'));var fs=require('fs');var fs_extra=require(_0x6ab8('0x9'));var _=require(_0x6ab8('0xa'));var squel=require(_0x6ab8('0xb'));var crypto=require(_0x6ab8('0xc'));var jsforce=require(_0x6ab8('0xd'));var deskjs=require(_0x6ab8('0xe'));var toCsv=require(_0x6ab8('0x7'));var querystring=require(_0x6ab8('0xf'));var Papa=require(_0x6ab8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ab8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ab8('0x12'));var logger=require(_0x6ab8('0x13'))(_0x6ab8('0x14'));var utils=require('../../config/utils');var config=require(_0x6ab8('0x15'));var licenseUtil=require(_0x6ab8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44d1d9,_0x1b9b34){_0x1b9b34=_0x1b9b34||0xcc;return function(_0x408ce1){if(_0x408ce1){return _0x44d1d9['sendStatus'](_0x1b9b34);}return _0x44d1d9[_0x6ab8('0x17')](_0x1b9b34)[_0x6ab8('0x18')]();};}function respondWithResult(_0x60b50,_0x968bac){_0x968bac=_0x968bac||0xc8;return function(_0x1c83a1){if(_0x1c83a1){return _0x60b50[_0x6ab8('0x17')](_0x968bac)[_0x6ab8('0x19')](_0x1c83a1);}};}function respondWithFilteredResult(_0x2043bb,_0x293389){return function(_0x5218e9){if(_0x5218e9){var _0x1f64a3=typeof _0x293389[_0x6ab8('0x1a')]===_0x6ab8('0x1b')&&typeof _0x293389['limit']===_0x6ab8('0x1b');var _0x35b790=_0x5218e9['count'];var _0x543726=_0x1f64a3?0x0:_0x293389[_0x6ab8('0x1a')];var _0x57cd18=_0x1f64a3?_0x5218e9[_0x6ab8('0x1c')]:_0x293389[_0x6ab8('0x1a')]+_0x293389[_0x6ab8('0x1d')];var _0x4e0fbd;if(_0x57cd18>=_0x35b790){_0x57cd18=_0x35b790;_0x4e0fbd=0xc8;}else{_0x4e0fbd=0xce;}_0x2043bb[_0x6ab8('0x17')](_0x4e0fbd);return _0x2043bb[_0x6ab8('0x1e')](_0x6ab8('0x1f'),_0x543726+'-'+_0x57cd18+'/'+_0x35b790)[_0x6ab8('0x19')](_0x5218e9);}return null;};}function patchUpdates(_0x5227c6){return function(_0x301004){try{jsonpatch[_0x6ab8('0x20')](_0x301004,_0x5227c6,!![]);}catch(_0x520cd8){return BPromise['reject'](_0x520cd8);}return _0x301004['save']();};}function saveUpdates(_0x190af2,_0x46cfdc){return function(_0xe2d5d8){if(_0xe2d5d8){return _0xe2d5d8['update'](_0x190af2)[_0x6ab8('0x21')](function(_0x433f37){return _0x433f37;});}return null;};}function removeEntity(_0x50fc50,_0x503f94){return function(_0x8af7e9){if(_0x8af7e9){return _0x8af7e9[_0x6ab8('0x22')]()['then'](function(){_0x50fc50[_0x6ab8('0x17')](0xcc)[_0x6ab8('0x18')]();});}};}function handleEntityNotFound(_0x24e400,_0x3d614b){return function(_0x3ddaeb){if(!_0x3ddaeb){_0x24e400[_0x6ab8('0x23')](0x194);}return _0x3ddaeb;};}function handleError(_0x2e098f,_0x1e26ed){_0x1e26ed=_0x1e26ed||0x1f4;return function(_0x5a1be3){logger['error'](_0x5a1be3[_0x6ab8('0x24')]);if(_0x5a1be3['name']){delete _0x5a1be3[_0x6ab8('0x25')];}_0x2e098f[_0x6ab8('0x17')](_0x1e26ed)[_0x6ab8('0x26')](_0x5a1be3);};}exports['index']=function(_0x525687,_0x4871e3){var _0x79dbd3={},_0x14e822={},_0x3723a7={'count':0x0,'rows':[]};var _0x2f14ea=_[_0x6ab8('0x27')](db[_0x6ab8('0x28')][_0x6ab8('0x29')],function(_0x4eda0b){return{'name':_0x4eda0b[_0x6ab8('0x2a')],'type':_0x4eda0b[_0x6ab8('0x2b')][_0x6ab8('0x2c')]};});_0x14e822[_0x6ab8('0x2d')]=_[_0x6ab8('0x27')](_0x2f14ea,'name');_0x14e822['query']=_[_0x6ab8('0x2e')](_0x525687['query']);_0x14e822['filters']=_[_0x6ab8('0x2f')](_0x14e822[_0x6ab8('0x2d')],_0x14e822['query']);_0x79dbd3[_0x6ab8('0x30')]=_['intersection'](_0x14e822[_0x6ab8('0x2d')],qs[_0x6ab8('0x31')](_0x525687['query']['fields']));_0x79dbd3[_0x6ab8('0x30')]=_0x79dbd3[_0x6ab8('0x30')][_0x6ab8('0x32')]?_0x79dbd3[_0x6ab8('0x30')]:_0x14e822[_0x6ab8('0x2d')];if(!_0x525687[_0x6ab8('0x33')][_0x6ab8('0x34')](_0x6ab8('0x35'))){_0x79dbd3['limit']=qs[_0x6ab8('0x1d')](_0x525687[_0x6ab8('0x33')][_0x6ab8('0x1d')]);_0x79dbd3[_0x6ab8('0x1a')]=qs[_0x6ab8('0x1a')](_0x525687[_0x6ab8('0x33')]['offset']);}_0x79dbd3[_0x6ab8('0x36')]=qs[_0x6ab8('0x37')](_0x525687[_0x6ab8('0x33')]['sort']);_0x79dbd3['where']=qs[_0x6ab8('0x38')](_[_0x6ab8('0x39')](_0x525687[_0x6ab8('0x33')],_0x14e822[_0x6ab8('0x38')]),_0x2f14ea);if(_0x525687[_0x6ab8('0x33')]['filter']){_0x79dbd3['where']=_[_0x6ab8('0x3a')](_0x79dbd3['where'],{'$or':_[_0x6ab8('0x27')](_0x2f14ea,function(_0x9ca6ed){if(_0x9ca6ed['type']!=='VIRTUAL'){var _0x8d76aa={};_0x8d76aa[_0x9ca6ed[_0x6ab8('0x25')]]={'$like':'%'+_0x525687[_0x6ab8('0x33')][_0x6ab8('0x3b')]+'%'};return _0x8d76aa;}})});}_0x79dbd3=_[_0x6ab8('0x3a')]({},_0x79dbd3,_0x525687[_0x6ab8('0x3c')]);var _0xef0ce5={'where':_0x79dbd3['where']};return db['Cdr'][_0x6ab8('0x1c')](_0xef0ce5)[_0x6ab8('0x21')](function(_0x146f43){_0x3723a7[_0x6ab8('0x1c')]=_0x146f43;if(_0x525687['query'][_0x6ab8('0x3d')]){_0x79dbd3['include']=[{'all':!![]}];}return db['Cdr'][_0x6ab8('0x3e')](_0x79dbd3);})[_0x6ab8('0x21')](function(_0x45735d){_0x3723a7[_0x6ab8('0x3f')]=_0x45735d;return _0x3723a7;})[_0x6ab8('0x21')](respondWithFilteredResult(_0x4871e3,_0x79dbd3))[_0x6ab8('0x40')](handleError(_0x4871e3,null));};exports[_0x6ab8('0x41')]=function(_0xf3abb8,_0x2494c3){var _0x45c70d={'raw':!![],'where':{'id':_0xf3abb8[_0x6ab8('0x42')]['id']}},_0xc32c6e={};_0xc32c6e['model']=_[_0x6ab8('0x2e')](db[_0x6ab8('0x28')][_0x6ab8('0x29')]);_0xc32c6e[_0x6ab8('0x33')]=_['keys'](_0xf3abb8[_0x6ab8('0x33')]);_0xc32c6e['filters']=_[_0x6ab8('0x2f')](_0xc32c6e[_0x6ab8('0x2d')],_0xc32c6e['query']);_0x45c70d[_0x6ab8('0x30')]=_[_0x6ab8('0x2f')](_0xc32c6e['model'],qs[_0x6ab8('0x31')](_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x31')]));_0x45c70d[_0x6ab8('0x30')]=_0x45c70d[_0x6ab8('0x30')]['length']?_0x45c70d['attributes']:_0xc32c6e['model'];if(_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x3d')]){_0x45c70d['include']=[{'all':!![]}];}_0x45c70d=_[_0x6ab8('0x3a')]({},_0x45c70d,_0xf3abb8[_0x6ab8('0x3c')]);return db[_0x6ab8('0x28')][_0x6ab8('0x43')](_0x45c70d)[_0x6ab8('0x21')](handleEntityNotFound(_0x2494c3,null))[_0x6ab8('0x21')](respondWithResult(_0x2494c3,null))['catch'](handleError(_0x2494c3,null));};exports[_0x6ab8('0x44')]=function(_0x74de32,_0x4b00cc){return db[_0x6ab8('0x28')][_0x6ab8('0x44')](_0x74de32[_0x6ab8('0x45')],{})['then'](respondWithResult(_0x4b00cc,0xc9))['catch'](handleError(_0x4b00cc,null));};exports[_0x6ab8('0x46')]=function(_0x4c27fa,_0x31965e){if(_0x4c27fa['body']['id']){delete _0x4c27fa[_0x6ab8('0x45')]['id'];}return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x4c27fa[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0x31965e,null))[_0x6ab8('0x21')](saveUpdates(_0x4c27fa['body'],null))['then'](respondWithResult(_0x31965e,null))['catch'](handleError(_0x31965e,null));};exports[_0x6ab8('0x22')]=function(_0x54708b,_0xce83a3){return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x54708b[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0xce83a3,null))[_0x6ab8('0x21')](removeEntity(_0xce83a3,null))[_0x6ab8('0x40')](handleError(_0xce83a3,null));};exports[_0x6ab8('0x47')]=function(_0x4d4e88,_0x1a372b){return db[_0x6ab8('0x28')][_0x6ab8('0x47')]()[_0x6ab8('0x21')](respondWithResult(_0x1a372b,null))['catch'](handleError(_0x1a372b,null));};
\ No newline at end of file
index 946a1b2..c272ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1e7fc9,_0x1b738a){var _0x1d44b3=function(_0x4300a4){while(--_0x4300a4){_0x1e7fc9['push'](_0x1e7fc9['shift']());}};_0x1d44b3(++_0x1b738a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x15c979,_0x529aee){var _0x3f396c=function(_0x4cd41c){while(--_0x4cd41c){_0x15c979['push'](_0x15c979['shift']());}};_0x3f396c(++_0x529aee);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
index cf416af..e74584d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc608=['code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x174faa,_0x2555b7){var _0x50e033=function(_0xca5821){while(--_0xca5821){_0x174faa['push'](_0x174faa['shift']());}};_0x50e033(++_0x2555b7);}(_0xc608,0x18c));var _0x8c60=function(_0xf740cf,_0x5f1b1e){_0xf740cf=_0xf740cf-0x0;var _0x4ec1ab=_0xc608[_0xf740cf];return _0x4ec1ab;};'use strict';var _=require('lodash');var util=require(_0x8c60('0x0'));var moment=require(_0x8c60('0x1'));var BPromise=require(_0x8c60('0x2'));var rs=require(_0x8c60('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c60('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c60('0x5'));var config=require(_0x8c60('0x6'));var jayson=require(_0x8c60('0x7'));var client=jayson[_0x8c60('0x8')][_0x8c60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2009de,_0x2ba190,_0x3f0cd6){return new BPromise(function(_0x147107,_0x53fad5){return client[_0x8c60('0xa')](_0x2009de,_0x3f0cd6)[_0x8c60('0xb')](function(_0x18f04b){logger['info'](_0x8c60('0xc'),_0x2ba190,_0x8c60('0xd'));logger[_0x8c60('0xe')](_0x8c60('0xf'),_0x2ba190,_0x8c60('0xd'),JSON[_0x8c60('0x10')](_0x18f04b));if(_0x18f04b[_0x8c60('0x11')]){if(_0x18f04b[_0x8c60('0x11')][_0x8c60('0x12')]===0x1f4){logger['error'](_0x8c60('0xc'),_0x2ba190,_0x18f04b['error'][_0x8c60('0x13')]);return _0x53fad5(_0x18f04b[_0x8c60('0x11')][_0x8c60('0x13')]);}logger[_0x8c60('0x11')](_0x8c60('0xc'),_0x2ba190,_0x18f04b[_0x8c60('0x11')][_0x8c60('0x13')]);return _0x147107(_0x18f04b[_0x8c60('0x11')][_0x8c60('0x13')]);}else{logger[_0x8c60('0x14')](_0x8c60('0xc'),_0x2ba190,_0x8c60('0xd'));_0x147107(_0x18f04b[_0x8c60('0x15')][_0x8c60('0x13')]);}})[_0x8c60('0x16')](function(_0x269b9c){logger[_0x8c60('0x11')](_0x8c60('0xc'),_0x2ba190,_0x269b9c);_0x53fad5(_0x269b9c);});});}
\ No newline at end of file
+var _0x3af1=['then','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','Cdr,\x20%s,\x20%s','message','error','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x37b670,_0x4a1ae8){var _0x224d4f=function(_0x195cd5){while(--_0x195cd5){_0x37b670['push'](_0x37b670['shift']());}};_0x224d4f(++_0x4a1ae8);}(_0x3af1,0x1ba));var _0x13af=function(_0x3566ee,_0x352119){_0x3566ee=_0x3566ee-0x0;var _0x5bf901=_0x3af1[_0x3566ee];return _0x5bf901;};'use strict';var _=require(_0x13af('0x0'));var util=require(_0x13af('0x1'));var moment=require(_0x13af('0x2'));var BPromise=require(_0x13af('0x3'));var rs=require(_0x13af('0x4'));var fs=require('fs');var Redis=require(_0x13af('0x5'));var db=require(_0x13af('0x6'))['db'];var utils=require(_0x13af('0x7'));var logger=require('../../config/logger')(_0x13af('0x8'));var config=require(_0x13af('0x9'));var jayson=require(_0x13af('0xa'));var client=jayson[_0x13af('0xb')][_0x13af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x249fd0,_0x34333c,_0x59262f){return new BPromise(function(_0x400e50,_0x42958c){return client[_0x13af('0xd')](_0x249fd0,_0x59262f)[_0x13af('0xe')](function(_0x5c2748){logger['info']('Cdr,\x20%s,\x20%s',_0x34333c,_0x13af('0xf'));logger['debug'](_0x13af('0x10'),_0x34333c,_0x13af('0xf'),JSON[_0x13af('0x11')](_0x5c2748));if(_0x5c2748['error']){if(_0x5c2748['error'][_0x13af('0x12')]===0x1f4){logger['error'](_0x13af('0x13'),_0x34333c,_0x5c2748['error'][_0x13af('0x14')]);return _0x42958c(_0x5c2748[_0x13af('0x15')][_0x13af('0x14')]);}logger['error'](_0x13af('0x13'),_0x34333c,_0x5c2748['error']['message']);return _0x400e50(_0x5c2748[_0x13af('0x15')][_0x13af('0x14')]);}else{logger[_0x13af('0x16')](_0x13af('0x13'),_0x34333c,_0x13af('0xf'));_0x400e50(_0x5c2748['result'][_0x13af('0x14')]);}})[_0x13af('0x17')](function(_0x4d296f){logger[_0x13af('0x15')](_0x13af('0x13'),_0x34333c,_0x4d296f);_0x42958c(_0x4d296f);});});}
\ No newline at end of file
index 427e52e..cb706dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 1bd8582..e0ff616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd89c=['STRING','sequelize','exports'];(function(_0xd46c02,_0x2b2aa2){var _0x8a93d9=function(_0x3bc8d9){while(--_0x3bc8d9){_0xd46c02['push'](_0xd46c02['shift']());}};_0x8a93d9(++_0x2b2aa2);}(_0xd89c,0xac));var _0xcd89=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xd89c[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0xcd89('0x0'));module[_0xcd89('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcd89('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcd89('0x2')]},'interval':{'type':Sequelize[_0xcd89('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xda5c=['*,*,*,*','sequelize','exports','STRING'];(function(_0xce68df,_0x30be17){var _0x636d26=function(_0x136195){while(--_0x136195){_0xce68df['push'](_0xce68df['shift']());}};_0x636d26(++_0x30be17);}(_0xda5c,0x111));var _0xcda5=function(_0x1a0b43,_0x175f26){_0x1a0b43=_0x1a0b43-0x0;var _0x23d163=_0xda5c[_0x1a0b43];return _0x23d163;};'use strict';var Sequelize=require(_0xcda5('0x0'));module[_0xcda5('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcda5('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcda5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcda5('0x3')}};
\ No newline at end of file
index ce8234e..b1adb9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3140=['catch','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','update','then','end','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','ChatApplication','find'];(function(_0x65eae,_0x32dc5f){var _0x18e82b=function(_0x2b3bed){while(--_0x2b3bed){_0x65eae['push'](_0x65eae['shift']());}};_0x18e82b(++_0x32dc5f);}(_0x3140,0xaf));var _0x0314=function(_0x18ea8a,_0x32f09f){_0x18ea8a=_0x18ea8a-0x0;var _0x19c99a=_0x3140[_0x18ea8a];return _0x19c99a;};'use strict';var emlformat=require(_0x0314('0x0'));var rimraf=require(_0x0314('0x1'));var zipdir=require(_0x0314('0x2'));var jsonpatch=require(_0x0314('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0314('0x4'));var Mustache=require(_0x0314('0x5'));var util=require(_0x0314('0x6'));var path=require(_0x0314('0x7'));var sox=require(_0x0314('0x8'));var csv=require(_0x0314('0x9'));var ejs=require(_0x0314('0xa'));var fs=require('fs');var fs_extra=require(_0x0314('0xb'));var _=require(_0x0314('0xc'));var squel=require(_0x0314('0xd'));var crypto=require(_0x0314('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0314('0xf'));var toCsv=require(_0x0314('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0314('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0314('0x11'));var as=require(_0x0314('0x12'));var hardwareService=require(_0x0314('0x13'));var logger=require(_0x0314('0x14'))(_0x0314('0x15'));var utils=require(_0x0314('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0314('0x17'));var db=require(_0x0314('0x18'))['db'];function respondWithStatusCode(_0xd85ddf,_0x4602ec){_0x4602ec=_0x4602ec||0xcc;return function(_0x153077){if(_0x153077){return _0xd85ddf[_0x0314('0x19')](_0x4602ec);}return _0xd85ddf[_0x0314('0x1a')](_0x4602ec)['end']();};}function respondWithResult(_0x1c26ff,_0xbe0b07){_0xbe0b07=_0xbe0b07||0xc8;return function(_0x1316a0){if(_0x1316a0){return _0x1c26ff[_0x0314('0x1a')](_0xbe0b07)[_0x0314('0x1b')](_0x1316a0);}};}function respondWithFilteredResult(_0x398c91,_0x413bfa){return function(_0x3ea356){if(_0x3ea356){var _0x5e460f=typeof _0x413bfa[_0x0314('0x1c')]===_0x0314('0x1d')&&typeof _0x413bfa[_0x0314('0x1e')]==='undefined';var _0x6c48cb=_0x3ea356['count'];var _0x575b68=_0x5e460f?0x0:_0x413bfa[_0x0314('0x1c')];var _0x329679=_0x5e460f?_0x3ea356['count']:_0x413bfa[_0x0314('0x1c')]+_0x413bfa[_0x0314('0x1e')];var _0x583ffa;if(_0x329679>=_0x6c48cb){_0x329679=_0x6c48cb;_0x583ffa=0xc8;}else{_0x583ffa=0xce;}_0x398c91[_0x0314('0x1a')](_0x583ffa);return _0x398c91['set'](_0x0314('0x1f'),_0x575b68+'-'+_0x329679+'/'+_0x6c48cb)[_0x0314('0x1b')](_0x3ea356);}return null;};}function patchUpdates(_0x16d273){return function(_0x77ddfd){try{jsonpatch[_0x0314('0x20')](_0x77ddfd,_0x16d273,!![]);}catch(_0xdfad84){return BPromise['reject'](_0xdfad84);}return _0x77ddfd['save']();};}function saveUpdates(_0x20305b,_0xbd3ad0){return function(_0x1945f8){if(_0x1945f8){return _0x1945f8[_0x0314('0x21')](_0x20305b)[_0x0314('0x22')](function(_0xd7638b){return _0xd7638b;});}return null;};}function removeEntity(_0x58a1c9,_0x3c743e){return function(_0x43fb0e){if(_0x43fb0e){return _0x43fb0e['destroy']()[_0x0314('0x22')](function(){_0x58a1c9[_0x0314('0x1a')](0xcc)[_0x0314('0x23')]();});}};}function handleEntityNotFound(_0x26c6a4,_0x867cf7){return function(_0x3af9d3){if(!_0x3af9d3){_0x26c6a4['sendStatus'](0x194);}return _0x3af9d3;};}function handleError(_0x1a5947,_0x2e0c77){_0x2e0c77=_0x2e0c77||0x1f4;return function(_0x2d636b){logger['error'](_0x2d636b[_0x0314('0x24')]);if(_0x2d636b[_0x0314('0x25')]){delete _0x2d636b['name'];}_0x1a5947['status'](_0x2e0c77)[_0x0314('0x26')](_0x2d636b);};}exports[_0x0314('0x27')]=function(_0x550dc4,_0x1c3dfd){var _0x288535={'raw':!![],'where':{'id':_0x550dc4['params']['id']}},_0x5291c2={};_0x5291c2[_0x0314('0x28')]=_[_0x0314('0x29')](db['ChatApplication'][_0x0314('0x2a')]);_0x5291c2[_0x0314('0x2b')]=_[_0x0314('0x29')](_0x550dc4['query']);_0x5291c2[_0x0314('0x2c')]=_[_0x0314('0x2d')](_0x5291c2[_0x0314('0x28')],_0x5291c2[_0x0314('0x2b')]);_0x288535['attributes']=_[_0x0314('0x2d')](_0x5291c2['model'],qs['fields'](_0x550dc4[_0x0314('0x2b')][_0x0314('0x2e')]));_0x288535[_0x0314('0x2f')]=_0x288535['attributes'][_0x0314('0x30')]?_0x288535['attributes']:_0x5291c2[_0x0314('0x28')];if(_0x550dc4['query']['includeAll']){_0x288535[_0x0314('0x31')]=[{'all':!![]}];}_0x288535=_['merge']({},_0x288535,_0x550dc4[_0x0314('0x32')]);return db[_0x0314('0x33')][_0x0314('0x34')](_0x288535)[_0x0314('0x22')](handleEntityNotFound(_0x1c3dfd,null))[_0x0314('0x22')](respondWithResult(_0x1c3dfd,null))[_0x0314('0x35')](handleError(_0x1c3dfd,null));};exports[_0x0314('0x21')]=function(_0x4c763e,_0xf52c24){if(_0x4c763e[_0x0314('0x36')]['id']){delete _0x4c763e[_0x0314('0x36')]['id'];}return db[_0x0314('0x33')][_0x0314('0x34')]({'where':{'id':_0x4c763e[_0x0314('0x37')]['id']}})['then'](handleEntityNotFound(_0xf52c24,null))[_0x0314('0x22')](saveUpdates(_0x4c763e['body'],null))[_0x0314('0x22')](respondWithResult(_0xf52c24,null))['catch'](handleError(_0xf52c24,null));};exports[_0x0314('0x38')]=function(_0x531dde,_0x487c8d){return db['ChatApplication'][_0x0314('0x34')]({'where':{'id':_0x531dde[_0x0314('0x37')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0x487c8d,null))[_0x0314('0x22')](removeEntity(_0x487c8d,null))[_0x0314('0x35')](handleError(_0x487c8d,null));};
\ No newline at end of file
+var _0xd87e=['status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','ChatApplication','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3e573a,_0x7a5247){var _0x275831=function(_0x558790){while(--_0x558790){_0x3e573a['push'](_0x3e573a['shift']());}};_0x275831(++_0x7a5247);}(_0xd87e,0x1bf));var _0xed87=function(_0x4f3579,_0x22c620){_0x4f3579=_0x4f3579-0x0;var _0x166fdc=_0xd87e[_0x4f3579];return _0x166fdc;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){_0x3d1641['status'](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x3c22b7,_0x41e0d4){return function(_0x320bcc){if(!_0x320bcc){_0x3c22b7[_0xed87('0x18')](0x194);}return _0x320bcc;};}function handleError(_0x289e38,_0x25a6f7){_0x25a6f7=_0x25a6f7||0x1f4;return function(_0x4735b3){logger[_0xed87('0x25')](_0x4735b3[_0xed87('0x26')]);if(_0x4735b3[_0xed87('0x27')]){delete _0x4735b3[_0xed87('0x27')];}_0x289e38[_0xed87('0x19')](_0x25a6f7)[_0xed87('0x28')](_0x4735b3);};}exports['show']=function(_0xb32b1c,_0x1c4a65){var _0x4eaa44={'raw':!![],'where':{'id':_0xb32b1c[_0xed87('0x29')]['id']}},_0x3dff74={};_0x3dff74[_0xed87('0x2a')]=_['keys'](db['ChatApplication'][_0xed87('0x2b')]);_0x3dff74[_0xed87('0x2c')]=_[_0xed87('0x2d')](_0xb32b1c['query']);_0x3dff74[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0x3dff74[_0xed87('0x2a')],_0x3dff74[_0xed87('0x2c')]);_0x4eaa44[_0xed87('0x30')]=_[_0xed87('0x2f')](_0x3dff74[_0xed87('0x2a')],qs[_0xed87('0x31')](_0xb32b1c[_0xed87('0x2c')]['fields']));_0x4eaa44[_0xed87('0x30')]=_0x4eaa44[_0xed87('0x30')]['length']?_0x4eaa44[_0xed87('0x30')]:_0x3dff74['model'];if(_0xb32b1c[_0xed87('0x2c')][_0xed87('0x32')]){_0x4eaa44[_0xed87('0x33')]=[{'all':!![]}];}_0x4eaa44=_[_0xed87('0x34')]({},_0x4eaa44,_0xb32b1c[_0xed87('0x35')]);return db[_0xed87('0x36')][_0xed87('0x37')](_0x4eaa44)[_0xed87('0x23')](handleEntityNotFound(_0x1c4a65,null))[_0xed87('0x23')](respondWithResult(_0x1c4a65,null))[_0xed87('0x38')](handleError(_0x1c4a65,null));};exports[_0xed87('0x39')]=function(_0x544247,_0x3763a9){if(_0x544247[_0xed87('0x3a')]['id']){delete _0x544247['body']['id'];}return db[_0xed87('0x36')]['find']({'where':{'id':_0x544247[_0xed87('0x29')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3763a9,null))['then'](saveUpdates(_0x544247[_0xed87('0x3a')],null))[_0xed87('0x23')](respondWithResult(_0x3763a9,null))[_0xed87('0x38')](handleError(_0x3763a9,null));};exports[_0xed87('0x24')]=function(_0x1384e4,_0x5014fe){return db[_0xed87('0x36')]['find']({'where':{'id':_0x1384e4[_0xed87('0x29')]['id']}})['then'](handleEntityNotFound(_0x5014fe,null))[_0xed87('0x23')](removeEntity(_0x5014fe,null))[_0xed87('0x38')](handleError(_0x5014fe,null));};
\ No newline at end of file
index 23af84a..7dae466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47f4=['define','ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1f5873,_0x1497be){var _0x2a75d9=function(_0x16c497){while(--_0x16c497){_0x1f5873['push'](_0x1f5873['shift']());}};_0x2a75d9(++_0x1497be);}(_0x47f4,0x86));var _0x447f=function(_0xe07f00,_0x5107ad){_0xe07f00=_0xe07f00-0x0;var _0x4157b3=_0x47f4[_0xe07f00];return _0x4157b3;};'use strict';var _=require('lodash');var util=require(_0x447f('0x0'));var logger=require(_0x447f('0x1'))(_0x447f('0x2'));var moment=require('moment');var BPromise=require(_0x447f('0x3'));var rp=require(_0x447f('0x4'));var fs=require('fs');var path=require(_0x447f('0x5'));var rimraf=require(_0x447f('0x6'));var config=require(_0x447f('0x7'));var attributes=require('./chatApplication.attributes');module[_0x447f('0x8')]=function(_0x3008de,_0x5c0fe2){return _0x3008de[_0x447f('0x9')](_0x447f('0xa'),attributes,{'tableName':_0x447f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x447f('0xc')});};
\ No newline at end of file
+var _0xc8c3=['util','../../config/logger','bluebird','request-promise','path','./chatApplication.attributes','exports','chat_applications','utf8mb4','lodash'];(function(_0x32085b,_0x2ac2fd){var _0x1421d9=function(_0xc2c11b){while(--_0xc2c11b){_0x32085b['push'](_0x32085b['shift']());}};_0x1421d9(++_0x2ac2fd);}(_0xc8c3,0x1c1));var _0x3c8c=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xc8c3[_0x5c7e53];return _0x1c9af9;};'use strict';var _=require(_0x3c8c('0x0'));var util=require(_0x3c8c('0x1'));var logger=require(_0x3c8c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3c8c('0x3'));var rp=require(_0x3c8c('0x4'));var fs=require('fs');var path=require(_0x3c8c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3c8c('0x6'));module[_0x3c8c('0x7')]=function(_0xa99947,_0x5e1173){return _0xa99947['define']('ChatApplication',attributes,{'tableName':_0x3c8c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c8c('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 0a6ee56..21cca2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9e0=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3a8697,_0x4e39e8){var _0xa4c873=function(_0x3479aa){while(--_0x3479aa){_0x3a8697['push'](_0x3a8697['shift']());}};_0xa4c873(++_0x4e39e8);}(_0xc9e0,0x69));var _0x0c9e=function(_0xfd46cf,_0x23c059){_0xfd46cf=_0xfd46cf-0x0;var _0x4166c0=_0xc9e0[_0xfd46cf];return _0x4166c0;};'use strict';var _=require(_0x0c9e('0x0'));var util=require('util');var moment=require(_0x0c9e('0x1'));var BPromise=require(_0x0c9e('0x2'));var rs=require(_0x0c9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c9e('0x4'))['db'];var utils=require(_0x0c9e('0x5'));var logger=require(_0x0c9e('0x6'))('rpc');var config=require(_0x0c9e('0x7'));var jayson=require(_0x0c9e('0x8'));var client=jayson[_0x0c9e('0x9')][_0x0c9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29e6b1,_0x50b33d,_0x48917b){return new BPromise(function(_0x3ba4ec,_0x3ca3cd){return client[_0x0c9e('0xb')](_0x29e6b1,_0x48917b)[_0x0c9e('0xc')](function(_0x3828d2){logger['info'](_0x0c9e('0xd'),_0x50b33d,'request\x20sent');logger[_0x0c9e('0xe')](_0x0c9e('0xf'),_0x50b33d,_0x0c9e('0x10'),JSON[_0x0c9e('0x11')](_0x3828d2));if(_0x3828d2[_0x0c9e('0x12')]){if(_0x3828d2[_0x0c9e('0x12')]['code']===0x1f4){logger['error'](_0x0c9e('0xd'),_0x50b33d,_0x3828d2[_0x0c9e('0x12')][_0x0c9e('0x13')]);return _0x3ca3cd(_0x3828d2[_0x0c9e('0x12')][_0x0c9e('0x13')]);}logger[_0x0c9e('0x12')](_0x0c9e('0xd'),_0x50b33d,_0x3828d2[_0x0c9e('0x12')]['message']);return _0x3ba4ec(_0x3828d2[_0x0c9e('0x12')]['message']);}else{logger[_0x0c9e('0x14')]('ChatApplication,\x20%s,\x20%s',_0x50b33d,_0x0c9e('0x10'));_0x3ba4ec(_0x3828d2[_0x0c9e('0x15')][_0x0c9e('0x13')]);}})['catch'](function(_0x403fe7){logger[_0x0c9e('0x12')]('ChatApplication,\x20%s,\x20%s',_0x50b33d,_0x403fe7);_0x3ca3cd(_0x403fe7);});});}
\ No newline at end of file
+var _0xef2f=['rpc','jayson/promise','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5ba1e8,_0xba5705){var _0x157c6b=function(_0x5c7d09){while(--_0x5c7d09){_0x5ba1e8['push'](_0x5ba1e8['shift']());}};_0x157c6b(++_0xba5705);}(_0xef2f,0x1a8));var _0xfef2=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xef2f[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xfef2('0x0'));var util=require(_0xfef2('0x1'));var moment=require(_0xfef2('0x2'));var BPromise=require(_0xfef2('0x3'));var rs=require(_0xfef2('0x4'));var fs=require('fs');var Redis=require(_0xfef2('0x5'));var db=require(_0xfef2('0x6'))['db'];var utils=require(_0xfef2('0x7'));var logger=require('../../config/logger')(_0xfef2('0x8'));var config=require('../../config/environment');var jayson=require(_0xfef2('0x9'));var client=jayson[_0xfef2('0xa')][_0xfef2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bb23e,_0x2ce403,_0x5c3941){return new BPromise(function(_0x1a3945,_0x171a12){return client[_0xfef2('0xc')](_0x2bb23e,_0x5c3941)[_0xfef2('0xd')](function(_0x9012e2){logger[_0xfef2('0xe')]('ChatApplication,\x20%s,\x20%s',_0x2ce403,'request\x20sent');logger[_0xfef2('0xf')](_0xfef2('0x10'),_0x2ce403,_0xfef2('0x11'),JSON[_0xfef2('0x12')](_0x9012e2));if(_0x9012e2['error']){if(_0x9012e2['error'][_0xfef2('0x13')]===0x1f4){logger[_0xfef2('0x14')](_0xfef2('0x15'),_0x2ce403,_0x9012e2[_0xfef2('0x14')]['message']);return _0x171a12(_0x9012e2[_0xfef2('0x14')][_0xfef2('0x16')]);}logger[_0xfef2('0x14')]('ChatApplication,\x20%s,\x20%s',_0x2ce403,_0x9012e2[_0xfef2('0x14')]['message']);return _0x1a3945(_0x9012e2[_0xfef2('0x14')][_0xfef2('0x16')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2ce403,_0xfef2('0x11'));_0x1a3945(_0x9012e2['result'][_0xfef2('0x16')]);}})[_0xfef2('0x17')](function(_0x25e729){logger['error'](_0xfef2('0x15'),_0x2ce403,_0x25e729);_0x171a12(_0x25e729);});});}
\ No newline at end of file
index 3dcc354..81bfd73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb0b=['../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x4b9ac2,_0x1c9186){var _0x497723=function(_0x361fd0){while(--_0x361fd0){_0x4b9ac2['push'](_0x4b9ac2['shift']());}};_0x497723(++_0x1c9186);}(_0xcb0b,0x7b));var _0xbcb0=function(_0x2c80bc,_0xcd0e94){_0x2c80bc=_0x2c80bc-0x0;var _0x2cf25b=_0xcb0b[_0x2c80bc];return _0x2cf25b;};'use strict';var multer=require('multer');var util=require(_0xbcb0('0x0'));var path=require(_0xbcb0('0x1'));var timeout=require(_0xbcb0('0x2'));var express=require(_0xbcb0('0x3'));var router=express[_0xbcb0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbcb0('0x5'));var interaction=require(_0xbcb0('0x6'));var config=require('../../config/environment');var controller=require(_0xbcb0('0x7'));router[_0xbcb0('0x8')](_0xbcb0('0x9'),auth[_0xbcb0('0xa')](),controller[_0xbcb0('0xb')]);router[_0xbcb0('0xc')](_0xbcb0('0x9'),auth[_0xbcb0('0xa')](),controller[_0xbcb0('0xd')]);router[_0xbcb0('0xe')](_0xbcb0('0x9'),auth[_0xbcb0('0xa')](),controller['destroy']);module[_0xbcb0('0xf')]=router;
\ No newline at end of file
+var _0x05a8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','update','delete','/:id','destroy','exports','util'];(function(_0xa1e030,_0x579969){var _0x1619bb=function(_0x108f53){while(--_0x108f53){_0xa1e030['push'](_0xa1e030['shift']());}};_0x1619bb(++_0x579969);}(_0x05a8,0x1cf));var _0x805a=function(_0x2adb04,_0x4d4356){_0x2adb04=_0x2adb04-0x0;var _0x3c1bca=_0x05a8[_0x2adb04];return _0x3c1bca;};'use strict';var multer=require('multer');var util=require(_0x805a('0x0'));var path=require('path');var timeout=require(_0x805a('0x1'));var express=require(_0x805a('0x2'));var router=express[_0x805a('0x3')]();var fs_extra=require(_0x805a('0x4'));var auth=require(_0x805a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x805a('0x6'));var controller=require(_0x805a('0x7'));router[_0x805a('0x8')]('/:id',auth[_0x805a('0x9')](),controller[_0x805a('0xa')]);router['put']('/:id',auth[_0x805a('0x9')](),controller[_0x805a('0xb')]);router[_0x805a('0xc')](_0x805a('0xd'),auth['isAuthenticated'](),controller[_0x805a('0xe')]);module[_0x805a('0xf')]=router;
\ No newline at end of file
index 5b67bee..08ff359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd050=['exports','STRING','BOOLEAN','sequelize'];(function(_0x7d5b1b,_0x20e692){var _0x51988c=function(_0x4b8e77){while(--_0x4b8e77){_0x7d5b1b['push'](_0x7d5b1b['shift']());}};_0x51988c(++_0x20e692);}(_0xd050,0x11f));var _0x0d05=function(_0x107e91,_0x5e8760){_0x107e91=_0x107e91-0x0;var _0x962f7a=_0xd050[_0x107e91];return _0x962f7a;};'use strict';var Sequelize=require(_0x0d05('0x0'));module[_0x0d05('0x1')]={'name':{'type':Sequelize[_0x0d05('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0d05('0x2')]},'write':{'type':Sequelize[_0x0d05('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x62f1=['BOOLEAN','sequelize','STRING'];(function(_0x3ec0dd,_0x3a5e67){var _0x2818c7=function(_0x1f8166){while(--_0x1f8166){_0x3ec0dd['push'](_0x3ec0dd['shift']());}};_0x2818c7(++_0x3a5e67);}(_0x62f1,0x112));var _0x162f=function(_0x2d2a1a,_0x106fa7){_0x2d2a1a=_0x2d2a1a-0x0;var _0x5b1508=_0x62f1[_0x2d2a1a];return _0x5b1508;};'use strict';var Sequelize=require(_0x162f('0x0'));module['exports']={'name':{'type':Sequelize[_0x162f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x162f('0x1')]},'write':{'type':Sequelize[_0x162f('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 461d9b0..9e1cc43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf83a=['intersection','model','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','merge','options','where','findAll','rows','params','keys','length','includeAll','include','find','catch','create','body','describe','ChatInternalMessage','user','addMembers','omit','ids','getMembers','findOne','User','sort','map','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','query','filters'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xf83a,0x1b6));var _0xaf83=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xf83a[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0xaf83('0x0'));var rimraf=require(_0xaf83('0x1'));var zipdir=require(_0xaf83('0x2'));var jsonpatch=require(_0xaf83('0x3'));var rp=require(_0xaf83('0x4'));var moment=require('moment');var BPromise=require(_0xaf83('0x5'));var Mustache=require(_0xaf83('0x6'));var util=require(_0xaf83('0x7'));var path=require(_0xaf83('0x8'));var sox=require(_0xaf83('0x9'));var csv=require(_0xaf83('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf83('0xb'));var squel=require(_0xaf83('0xc'));var crypto=require(_0xaf83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaf83('0xe'));var toCsv=require(_0xaf83('0xa'));var querystring=require(_0xaf83('0xf'));var Papa=require('papaparse');var Redis=require(_0xaf83('0x10'));var authService=require(_0xaf83('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf83('0x12'));var hardwareService=require(_0xaf83('0x13'));var logger=require('../../config/logger')(_0xaf83('0x14'));var utils=require(_0xaf83('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaf83('0x16'));var db=require(_0xaf83('0x17'))['db'];config[_0xaf83('0x18')]=_[_0xaf83('0x19')](config[_0xaf83('0x18')],{'host':_0xaf83('0x1a'),'port':0x18eb});var socket=require(_0xaf83('0x1b'))(new Redis(config[_0xaf83('0x18')]));require(_0xaf83('0x1c'))[_0xaf83('0x1d')](socket);function respondWithStatusCode(_0x285542,_0x478a50){_0x478a50=_0x478a50||0xcc;return function(_0x493827){if(_0x493827){return _0x285542[_0xaf83('0x1e')](_0x478a50);}return _0x285542['status'](_0x478a50)[_0xaf83('0x1f')]();};}function respondWithResult(_0x19df11,_0x4d8d08){_0x4d8d08=_0x4d8d08||0xc8;return function(_0x1f56ab){if(_0x1f56ab){return _0x19df11['status'](_0x4d8d08)[_0xaf83('0x20')](_0x1f56ab);}};}function respondWithFilteredResult(_0x3b9f03,_0x4b4cb3){return function(_0x31f9a3){if(_0x31f9a3){var _0x29f2e6=typeof _0x4b4cb3[_0xaf83('0x21')]===_0xaf83('0x22')&&typeof _0x4b4cb3[_0xaf83('0x23')]===_0xaf83('0x22');var _0x36fb05=_0x31f9a3['count'];var _0x42b784=_0x29f2e6?0x0:_0x4b4cb3[_0xaf83('0x21')];var _0x239958=_0x29f2e6?_0x31f9a3[_0xaf83('0x24')]:_0x4b4cb3['offset']+_0x4b4cb3[_0xaf83('0x23')];var _0x5d76c3;if(_0x239958>=_0x36fb05){_0x239958=_0x36fb05;_0x5d76c3=0xc8;}else{_0x5d76c3=0xce;}_0x3b9f03[_0xaf83('0x25')](_0x5d76c3);return _0x3b9f03[_0xaf83('0x26')](_0xaf83('0x27'),_0x42b784+'-'+_0x239958+'/'+_0x36fb05)[_0xaf83('0x20')](_0x31f9a3);}return null;};}function patchUpdates(_0x322e58){return function(_0x36ec74){try{jsonpatch[_0xaf83('0x28')](_0x36ec74,_0x322e58,!![]);}catch(_0x307e49){return BPromise[_0xaf83('0x29')](_0x307e49);}return _0x36ec74['save']();};}function saveUpdates(_0x3d06ef,_0x20fa29){return function(_0x1d8fac){if(_0x1d8fac){return _0x1d8fac[_0xaf83('0x2a')](_0x3d06ef)['then'](function(_0x391925){return _0x391925;});}return null;};}function removeEntity(_0x1c1f50,_0x512249){return function(_0xdca149){if(_0xdca149){return _0xdca149[_0xaf83('0x2b')]()[_0xaf83('0x2c')](function(){_0x1c1f50['status'](0xcc)[_0xaf83('0x1f')]();});}};}function handleEntityNotFound(_0x798087,_0x36e2f3){return function(_0x25156e){if(!_0x25156e){_0x798087[_0xaf83('0x1e')](0x194);}return _0x25156e;};}function handleError(_0x16703a,_0x3ed681){_0x3ed681=_0x3ed681||0x1f4;return function(_0x104e5a){logger[_0xaf83('0x2d')](_0x104e5a[_0xaf83('0x2e')]);if(_0x104e5a['name']){delete _0x104e5a[_0xaf83('0x2f')];}_0x16703a['status'](_0x3ed681)[_0xaf83('0x30')](_0x104e5a);};}exports[_0xaf83('0x31')]=function(_0x18fc8f,_0x45663d){var _0x36912c={},_0x4d32a5={},_0x32198e={'count':0x0,'rows':[]};var _0x4ece2d=_['map'](db[_0xaf83('0x32')][_0xaf83('0x33')],function(_0x503d6c){return{'name':_0x503d6c[_0xaf83('0x34')],'type':_0x503d6c[_0xaf83('0x35')][_0xaf83('0x36')]};});_0x4d32a5['model']=_['map'](_0x4ece2d,'name');_0x4d32a5[_0xaf83('0x37')]=_['keys'](_0x18fc8f['query']);_0x4d32a5[_0xaf83('0x38')]=_[_0xaf83('0x39')](_0x4d32a5[_0xaf83('0x3a')],_0x4d32a5[_0xaf83('0x37')]);_0x36912c[_0xaf83('0x3b')]=_['intersection'](_0x4d32a5['model'],qs[_0xaf83('0x3c')](_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x3c')]));_0x36912c[_0xaf83('0x3b')]=_0x36912c['attributes']['length']?_0x36912c[_0xaf83('0x3b')]:_0x4d32a5[_0xaf83('0x3a')];if(!_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x3d')](_0xaf83('0x3e'))){_0x36912c[_0xaf83('0x23')]=qs['limit'](_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x23')]);_0x36912c[_0xaf83('0x21')]=qs['offset'](_0x18fc8f['query'][_0xaf83('0x21')]);}_0x36912c[_0xaf83('0x3f')]=qs['sort'](_0x18fc8f['query']['sort']);_0x36912c['where']=qs['filters'](_[_0xaf83('0x40')](_0x18fc8f[_0xaf83('0x37')],_0x4d32a5[_0xaf83('0x38')]),_0x4ece2d);if(_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x41')]){_0x36912c['where']=_['merge'](_0x36912c['where'],{'$or':_['map'](_0x4ece2d,function(_0x16308b){if(_0x16308b[_0xaf83('0x35')]!=='VIRTUAL'){var _0x19b56f={};_0x19b56f[_0x16308b['name']]={'$like':'%'+_0x18fc8f['query'][_0xaf83('0x41')]+'%'};return _0x19b56f;}})});}_0x36912c=_[_0xaf83('0x42')]({},_0x36912c,_0x18fc8f[_0xaf83('0x43')]);var _0x4f2fc7={'where':_0x36912c[_0xaf83('0x44')]};return db[_0xaf83('0x32')]['count'](_0x4f2fc7)[_0xaf83('0x2c')](function(_0x488e50){_0x32198e[_0xaf83('0x24')]=_0x488e50;if(_0x18fc8f[_0xaf83('0x37')]['includeAll']){_0x36912c['include']=[{'all':!![]}];}return db['ChatGroup'][_0xaf83('0x45')](_0x36912c);})[_0xaf83('0x2c')](function(_0xa86fdf){_0x32198e[_0xaf83('0x46')]=_0xa86fdf;return _0x32198e;})['then'](respondWithFilteredResult(_0x45663d,_0x36912c))['catch'](handleError(_0x45663d,null));};exports['show']=function(_0x451435,_0x4b0f6e){var _0xfe897c={'raw':!![],'where':{'id':_0x451435[_0xaf83('0x47')]['id']}},_0x49d9ff={};_0x49d9ff['model']=_[_0xaf83('0x48')](db['ChatGroup']['rawAttributes']);_0x49d9ff['query']=_[_0xaf83('0x48')](_0x451435['query']);_0x49d9ff[_0xaf83('0x38')]=_['intersection'](_0x49d9ff[_0xaf83('0x3a')],_0x49d9ff['query']);_0xfe897c[_0xaf83('0x3b')]=_[_0xaf83('0x39')](_0x49d9ff[_0xaf83('0x3a')],qs[_0xaf83('0x3c')](_0x451435['query'][_0xaf83('0x3c')]));_0xfe897c[_0xaf83('0x3b')]=_0xfe897c['attributes'][_0xaf83('0x49')]?_0xfe897c[_0xaf83('0x3b')]:_0x49d9ff[_0xaf83('0x3a')];if(_0x451435[_0xaf83('0x37')][_0xaf83('0x4a')]){_0xfe897c[_0xaf83('0x4b')]=[{'all':!![]}];}_0xfe897c=_[_0xaf83('0x42')]({},_0xfe897c,_0x451435['options']);return db[_0xaf83('0x32')][_0xaf83('0x4c')](_0xfe897c)['then'](handleEntityNotFound(_0x4b0f6e,null))[_0xaf83('0x2c')](respondWithResult(_0x4b0f6e,null))[_0xaf83('0x4d')](handleError(_0x4b0f6e,null));};exports[_0xaf83('0x4e')]=function(_0x5dbead,_0x1cdbf5){return db['ChatGroup'][_0xaf83('0x4e')](_0x5dbead['body'],{})[_0xaf83('0x2c')](respondWithResult(_0x1cdbf5,0xc9))[_0xaf83('0x4d')](handleError(_0x1cdbf5,null));};exports[_0xaf83('0x2a')]=function(_0x5991ea,_0x7397a3){if(_0x5991ea['body']['id']){delete _0x5991ea[_0xaf83('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5991ea[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x7397a3,null))[_0xaf83('0x2c')](saveUpdates(_0x5991ea[_0xaf83('0x4f')],null))[_0xaf83('0x2c')](respondWithResult(_0x7397a3,null))[_0xaf83('0x4d')](handleError(_0x7397a3,null));};exports[_0xaf83('0x2b')]=function(_0x46d2bb,_0x1f6726){return db[_0xaf83('0x32')]['find']({'where':{'id':_0x46d2bb['params']['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x1f6726,null))[_0xaf83('0x2c')](removeEntity(_0x1f6726,null))['catch'](handleError(_0x1f6726,null));};exports[_0xaf83('0x50')]=function(_0x3d9724,_0x13769f){return db[_0xaf83('0x32')][_0xaf83('0x50')]()['then'](respondWithResult(_0x13769f,null))[_0xaf83('0x4d')](handleError(_0x13769f,null));};exports['getUnread']=function(_0x3b9a85,_0x434f29,_0x107b1f){return db[_0xaf83('0x51')]['count']({'where':{'ChatGroupId':_0x3b9a85[_0xaf83('0x47')]['id'],'ToId':_0x3b9a85[_0xaf83('0x52')]['id'],'read':![]}})[_0xaf83('0x2c')](function(_0x4f76c1){return{'id':_['toInteger'](_0x3b9a85[_0xaf83('0x47')]['id']),'count':_0x4f76c1};})[_0xaf83('0x2c')](respondWithResult(_0x434f29,null))[_0xaf83('0x4d')](handleError(_0x434f29,null));};exports['addMembers']=function(_0x5f5d97,_0x37a737,_0x2d3fd5){return db[_0xaf83('0x32')][_0xaf83('0x4c')]({'where':{'id':_0x5f5d97[_0xaf83('0x47')]['id']}})['then'](handleEntityNotFound(_0x37a737,null))[_0xaf83('0x2c')](function(_0x5594b0){if(_0x5594b0){return _0x5594b0[_0xaf83('0x53')](_0x5f5d97[_0xaf83('0x4f')]['ids'],_[_0xaf83('0x54')](_0x5f5d97[_0xaf83('0x4f')],[_0xaf83('0x55'),'id'])||{});}})[_0xaf83('0x2c')](respondWithResult(_0x37a737,null))[_0xaf83('0x4d')](handleError(_0x37a737,null));};exports[_0xaf83('0x56')]=function(_0x137066,_0x2629fb,_0x21bfd5){var _0xe6a46a={};var _0x1dfc34={};var _0x4b56f5;var _0x7380d;return db['ChatGroup'][_0xaf83('0x57')]({'where':{'id':_0x137066[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x2629fb,null))[_0xaf83('0x2c')](function(_0x5b1682){if(_0x5b1682){_0x4b56f5=_0x5b1682;_0x1dfc34[_0xaf83('0x3a')]=_['keys'](db[_0xaf83('0x58')][_0xaf83('0x33')]);_0x1dfc34[_0xaf83('0x37')]=_[_0xaf83('0x48')](_0x137066[_0xaf83('0x37')]);_0x1dfc34[_0xaf83('0x38')]=_[_0xaf83('0x39')](_0x1dfc34[_0xaf83('0x3a')],_0x1dfc34[_0xaf83('0x37')]);_0xe6a46a[_0xaf83('0x3b')]=_[_0xaf83('0x39')](_0x1dfc34[_0xaf83('0x3a')],qs['fields'](_0x137066[_0xaf83('0x37')][_0xaf83('0x3c')]));_0xe6a46a[_0xaf83('0x3b')]=_0xe6a46a[_0xaf83('0x3b')]['length']?_0xe6a46a[_0xaf83('0x3b')]:_0x1dfc34['model'];_0xe6a46a[_0xaf83('0x3f')]=qs[_0xaf83('0x59')](_0x137066[_0xaf83('0x37')][_0xaf83('0x59')]);_0xe6a46a['where']=qs[_0xaf83('0x38')](_[_0xaf83('0x40')](_0x137066[_0xaf83('0x37')],_0x1dfc34['filters']));if(_0x137066[_0xaf83('0x37')][_0xaf83('0x41')]){_0xe6a46a[_0xaf83('0x44')]=_[_0xaf83('0x42')](_0xe6a46a[_0xaf83('0x44')],{'$or':_[_0xaf83('0x5a')](_0xe6a46a[_0xaf83('0x3b')],function(_0x115d15){var _0x330c19={};_0x330c19[_0x115d15]={'$like':'%'+_0x137066['query']['filter']+'%'};return _0x330c19;})});}_0xe6a46a=_['merge']({},_0xe6a46a,_0x137066[_0xaf83('0x43')]);return _0x4b56f5['getMembers'](_0xe6a46a);}})[_0xaf83('0x2c')](function(_0x64eb24){if(_0x64eb24){_0x7380d=_0x64eb24['length'];if(!_0x137066[_0xaf83('0x37')][_0xaf83('0x3d')]('nolimit')){_0xe6a46a[_0xaf83('0x23')]=qs[_0xaf83('0x23')](_0x137066[_0xaf83('0x37')][_0xaf83('0x23')]);_0xe6a46a['offset']=qs[_0xaf83('0x21')](_0x137066[_0xaf83('0x37')][_0xaf83('0x21')]);}return _0x4b56f5[_0xaf83('0x56')](_0xe6a46a);}})['then'](function(_0x57a811){if(_0x57a811){return _0x57a811?{'count':_0x7380d,'rows':_0x57a811}:null;}})['then'](respondWithResult(_0x2629fb,null))[_0xaf83('0x4d')](handleError(_0x2629fb,null));};exports[_0xaf83('0x5b')]=function(_0x51b478,_0x43e026,_0x69d31c){return db[_0xaf83('0x32')][_0xaf83('0x4c')]({'where':{'id':_0x51b478[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x43e026,null))[_0xaf83('0x2c')](function(_0x10b63f){if(_0x10b63f){return _0x10b63f[_0xaf83('0x5b')](_0x51b478['query'][_0xaf83('0x55')]);}})[_0xaf83('0x2c')](respondWithStatusCode(_0x43e026,null))[_0xaf83('0x4d')](handleError(_0x43e026,null));};exports[_0xaf83('0x5c')]=function(_0x257e58,_0x3dc420,_0x4a1228){if(_0x257e58['body']['id']){delete _0x257e58[_0xaf83('0x4f')]['id'];}return db[_0xaf83('0x32')][_0xaf83('0x4c')]({'where':{'id':_0x257e58[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x3dc420,null))['then'](function(_0x2e4cd7){if(_0x2e4cd7){_0x257e58[_0xaf83('0x4f')][_0xaf83('0x5d')]=_0x2e4cd7['id'];return db[_0xaf83('0x51')][_0xaf83('0x4e')](_0x257e58[_0xaf83('0x4f')]);}})[_0xaf83('0x2c')](respondWithResult(_0x3dc420,null))[_0xaf83('0x4d')](handleError(_0x3dc420,null));};exports[_0xaf83('0x5e')]=function(_0x2bd959,_0x3b8fdf,_0x527645){var _0xb773a1={};var _0x59d987={};var _0x3d86de;var _0x82bb07;return db[_0xaf83('0x32')]['findOne']({'where':{'id':_0x2bd959['params']['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x3b8fdf,null))[_0xaf83('0x2c')](function(_0x2d77fd){if(_0x2d77fd){_0x3d86de=_0x2d77fd;_0x59d987['model']=_[_0xaf83('0x48')](db[_0xaf83('0x51')][_0xaf83('0x33')]);_0x59d987[_0xaf83('0x37')]=_['keys'](_0x2bd959['query']);_0x59d987[_0xaf83('0x38')]=_['intersection'](_0x59d987[_0xaf83('0x3a')],_0x59d987[_0xaf83('0x37')]);_0xb773a1[_0xaf83('0x3b')]=_[_0xaf83('0x39')](_0x59d987['model'],qs[_0xaf83('0x3c')](_0x2bd959[_0xaf83('0x37')]['fields']));_0xb773a1[_0xaf83('0x3b')]=_0xb773a1[_0xaf83('0x3b')]['length']?_0xb773a1['attributes']:_0x59d987[_0xaf83('0x3a')];_0xb773a1['order']=qs[_0xaf83('0x59')](_0x2bd959['query'][_0xaf83('0x59')]);_0xb773a1['where']=qs[_0xaf83('0x38')](_['pick'](_0x2bd959[_0xaf83('0x37')],_0x59d987['filters']));if(_0x2bd959[_0xaf83('0x37')]['filter']){_0xb773a1[_0xaf83('0x44')]=_['merge'](_0xb773a1[_0xaf83('0x44')],{'$or':_[_0xaf83('0x5a')](_0xb773a1['attributes'],function(_0x4d5ff2){var _0xc16ddc={};_0xc16ddc[_0x4d5ff2]={'$like':'%'+_0x2bd959[_0xaf83('0x37')][_0xaf83('0x41')]+'%'};return _0xc16ddc;})});}if(_0x2bd959[_0xaf83('0x37')]['$gte']){var _0x2905fe=_0x2bd959['query'][_0xaf83('0x5f')][_0xaf83('0x60')](',');var _0x4d95ad={};_0x4d95ad[_0x2905fe[0x0]]={'$gte':moment(_0x2905fe[0x1])[_0xaf83('0x61')](_0xaf83('0x62'))};_0xb773a1['where']=_['merge'](_0xb773a1[_0xaf83('0x44')],_0x4d95ad);}_0xb773a1=_[_0xaf83('0x42')]({},_0xb773a1,_0x2bd959['options']);return _0x3d86de[_0xaf83('0x5e')](_0xb773a1);}})[_0xaf83('0x2c')](function(_0x3ef90b){if(_0x3ef90b){_0x82bb07=_0x3ef90b['length'];if(!_0x2bd959['query']['hasOwnProperty'](_0xaf83('0x3e'))){_0xb773a1[_0xaf83('0x23')]=qs['limit'](_0x2bd959['query'][_0xaf83('0x23')]);_0xb773a1[_0xaf83('0x21')]=qs[_0xaf83('0x21')](_0x2bd959[_0xaf83('0x37')]['offset']);}return _0x3d86de[_0xaf83('0x5e')](_0xb773a1);}})['then'](function(_0x1455fa){if(_0x1455fa){return _0x1455fa?{'count':_0x82bb07,'rows':_0x1455fa}:null;}})[_0xaf83('0x2c')](respondWithResult(_0x3b8fdf,null))[_0xaf83('0x4d')](handleError(_0x3b8fdf,null));};
\ No newline at end of file
+var _0x27b9=['ChatGroup','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','options','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','error','name','send','map'];(function(_0x185ce6,_0x80b049){var _0xb2b554=function(_0x132348){while(--_0x132348){_0x185ce6['push'](_0x185ce6['shift']());}};_0xb2b554(++_0x80b049);}(_0x27b9,0x1b4));var _0x927b=function(_0x28038f,_0x492076){_0x28038f=_0x28038f-0x0;var _0x3b16b8=_0x27b9[_0x28038f];return _0x3b16b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x927b('0x0'));var zipdir=require(_0x927b('0x1'));var jsonpatch=require(_0x927b('0x2'));var rp=require(_0x927b('0x3'));var moment=require(_0x927b('0x4'));var BPromise=require(_0x927b('0x5'));var Mustache=require(_0x927b('0x6'));var util=require(_0x927b('0x7'));var path=require(_0x927b('0x8'));var sox=require(_0x927b('0x9'));var csv=require(_0x927b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x927b('0xb'));var _=require(_0x927b('0xc'));var squel=require(_0x927b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x927b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x927b('0xf'));var Papa=require(_0x927b('0x10'));var Redis=require('ioredis');var authService=require(_0x927b('0x11'));var qs=require(_0x927b('0x12'));var as=require(_0x927b('0x13'));var hardwareService=require(_0x927b('0x14'));var logger=require(_0x927b('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x927b('0x16'));var licenseUtil=require(_0x927b('0x17'));var db=require(_0x927b('0x18'))['db'];config[_0x927b('0x19')]=_[_0x927b('0x1a')](config[_0x927b('0x19')],{'host':_0x927b('0x1b'),'port':0x18eb});var socket=require(_0x927b('0x1c'))(new Redis(config['redis']));require(_0x927b('0x1d'))[_0x927b('0x1e')](socket);function respondWithStatusCode(_0x570210,_0x199703){_0x199703=_0x199703||0xcc;return function(_0x36da10){if(_0x36da10){return _0x570210[_0x927b('0x1f')](_0x199703);}return _0x570210[_0x927b('0x20')](_0x199703)['end']();};}function respondWithResult(_0xd79cef,_0x74bdb3){_0x74bdb3=_0x74bdb3||0xc8;return function(_0x2dda33){if(_0x2dda33){return _0xd79cef[_0x927b('0x20')](_0x74bdb3)[_0x927b('0x21')](_0x2dda33);}};}function respondWithFilteredResult(_0x39a672,_0x31f601){return function(_0x1c90a2){if(_0x1c90a2){var _0x4a1857=typeof _0x31f601[_0x927b('0x22')]===_0x927b('0x23')&&typeof _0x31f601[_0x927b('0x24')]==='undefined';var _0xa4f28d=_0x1c90a2[_0x927b('0x25')];var _0x2fc4c2=_0x4a1857?0x0:_0x31f601[_0x927b('0x22')];var _0x26dea2=_0x4a1857?_0x1c90a2[_0x927b('0x25')]:_0x31f601[_0x927b('0x22')]+_0x31f601[_0x927b('0x24')];var _0x3ee984;if(_0x26dea2>=_0xa4f28d){_0x26dea2=_0xa4f28d;_0x3ee984=0xc8;}else{_0x3ee984=0xce;}_0x39a672['status'](_0x3ee984);return _0x39a672['set'](_0x927b('0x26'),_0x2fc4c2+'-'+_0x26dea2+'/'+_0xa4f28d)[_0x927b('0x21')](_0x1c90a2);}return null;};}function patchUpdates(_0x1d14c7){return function(_0x351fed){try{jsonpatch[_0x927b('0x27')](_0x351fed,_0x1d14c7,!![]);}catch(_0x147ee2){return BPromise[_0x927b('0x28')](_0x147ee2);}return _0x351fed['save']();};}function saveUpdates(_0x158d32,_0x2dcdf8){return function(_0x11b5b9){if(_0x11b5b9){return _0x11b5b9[_0x927b('0x29')](_0x158d32)['then'](function(_0x5b1e6b){return _0x5b1e6b;});}return null;};}function removeEntity(_0x131836,_0x2a43ab){return function(_0x3af4df){if(_0x3af4df){return _0x3af4df[_0x927b('0x2a')]()[_0x927b('0x2b')](function(){_0x131836[_0x927b('0x20')](0xcc)[_0x927b('0x2c')]();});}};}function handleEntityNotFound(_0x5df266,_0x212943){return function(_0x3e5d99){if(!_0x3e5d99){_0x5df266[_0x927b('0x1f')](0x194);}return _0x3e5d99;};}function handleError(_0x631734,_0x26e644){_0x26e644=_0x26e644||0x1f4;return function(_0x143e56){logger[_0x927b('0x2d')](_0x143e56['stack']);if(_0x143e56[_0x927b('0x2e')]){delete _0x143e56[_0x927b('0x2e')];}_0x631734[_0x927b('0x20')](_0x26e644)[_0x927b('0x2f')](_0x143e56);};}exports['index']=function(_0x27775a,_0x185369){var _0x44155e={},_0x2333e0={},_0x499996={'count':0x0,'rows':[]};var _0x4691e1=_[_0x927b('0x30')](db[_0x927b('0x31')][_0x927b('0x32')],function(_0x188f91){return{'name':_0x188f91[_0x927b('0x33')],'type':_0x188f91[_0x927b('0x34')][_0x927b('0x35')]};});_0x2333e0['model']=_['map'](_0x4691e1,_0x927b('0x2e'));_0x2333e0['query']=_[_0x927b('0x36')](_0x27775a[_0x927b('0x37')]);_0x2333e0[_0x927b('0x38')]=_[_0x927b('0x39')](_0x2333e0[_0x927b('0x3a')],_0x2333e0['query']);_0x44155e['attributes']=_[_0x927b('0x39')](_0x2333e0[_0x927b('0x3a')],qs[_0x927b('0x3b')](_0x27775a['query'][_0x927b('0x3b')]));_0x44155e[_0x927b('0x3c')]=_0x44155e['attributes'][_0x927b('0x3d')]?_0x44155e[_0x927b('0x3c')]:_0x2333e0['model'];if(!_0x27775a[_0x927b('0x37')]['hasOwnProperty'](_0x927b('0x3e'))){_0x44155e[_0x927b('0x24')]=qs['limit'](_0x27775a[_0x927b('0x37')][_0x927b('0x24')]);_0x44155e[_0x927b('0x22')]=qs[_0x927b('0x22')](_0x27775a['query'][_0x927b('0x22')]);}_0x44155e[_0x927b('0x3f')]=qs[_0x927b('0x40')](_0x27775a[_0x927b('0x37')][_0x927b('0x40')]);_0x44155e[_0x927b('0x41')]=qs[_0x927b('0x38')](_['pick'](_0x27775a['query'],_0x2333e0[_0x927b('0x38')]),_0x4691e1);if(_0x27775a[_0x927b('0x37')]['filter']){_0x44155e[_0x927b('0x41')]=_[_0x927b('0x42')](_0x44155e[_0x927b('0x41')],{'$or':_[_0x927b('0x30')](_0x4691e1,function(_0x443254){if(_0x443254[_0x927b('0x34')]!==_0x927b('0x43')){var _0x629242={};_0x629242[_0x443254['name']]={'$like':'%'+_0x27775a['query'][_0x927b('0x44')]+'%'};return _0x629242;}})});}_0x44155e=_['merge']({},_0x44155e,_0x27775a['options']);var _0x64ea59={'where':_0x44155e['where']};return db[_0x927b('0x31')]['count'](_0x64ea59)[_0x927b('0x2b')](function(_0x239d4d){_0x499996['count']=_0x239d4d;if(_0x27775a[_0x927b('0x37')][_0x927b('0x45')]){_0x44155e[_0x927b('0x46')]=[{'all':!![]}];}return db[_0x927b('0x31')][_0x927b('0x47')](_0x44155e);})[_0x927b('0x2b')](function(_0x3dc4de){_0x499996[_0x927b('0x48')]=_0x3dc4de;return _0x499996;})[_0x927b('0x2b')](respondWithFilteredResult(_0x185369,_0x44155e))[_0x927b('0x49')](handleError(_0x185369,null));};exports['show']=function(_0x1987d3,_0x1b56f5){var _0x4c8647={'raw':!![],'where':{'id':_0x1987d3[_0x927b('0x4a')]['id']}},_0x2154e9={};_0x2154e9[_0x927b('0x3a')]=_[_0x927b('0x36')](db['ChatGroup'][_0x927b('0x32')]);_0x2154e9[_0x927b('0x37')]=_[_0x927b('0x36')](_0x1987d3['query']);_0x2154e9[_0x927b('0x38')]=_['intersection'](_0x2154e9[_0x927b('0x3a')],_0x2154e9['query']);_0x4c8647[_0x927b('0x3c')]=_[_0x927b('0x39')](_0x2154e9[_0x927b('0x3a')],qs[_0x927b('0x3b')](_0x1987d3['query']['fields']));_0x4c8647[_0x927b('0x3c')]=_0x4c8647[_0x927b('0x3c')][_0x927b('0x3d')]?_0x4c8647[_0x927b('0x3c')]:_0x2154e9[_0x927b('0x3a')];if(_0x1987d3['query'][_0x927b('0x45')]){_0x4c8647[_0x927b('0x46')]=[{'all':!![]}];}_0x4c8647=_[_0x927b('0x42')]({},_0x4c8647,_0x1987d3['options']);return db[_0x927b('0x31')]['find'](_0x4c8647)[_0x927b('0x2b')](handleEntityNotFound(_0x1b56f5,null))['then'](respondWithResult(_0x1b56f5,null))[_0x927b('0x49')](handleError(_0x1b56f5,null));};exports[_0x927b('0x4b')]=function(_0xc62228,_0xf2dadc){return db[_0x927b('0x31')][_0x927b('0x4b')](_0xc62228[_0x927b('0x4c')],{})[_0x927b('0x2b')](respondWithResult(_0xf2dadc,0xc9))['catch'](handleError(_0xf2dadc,null));};exports[_0x927b('0x29')]=function(_0x50ef8f,_0x49dcd2){if(_0x50ef8f[_0x927b('0x4c')]['id']){delete _0x50ef8f['body']['id'];}return db['ChatGroup'][_0x927b('0x4d')]({'where':{'id':_0x50ef8f[_0x927b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49dcd2,null))[_0x927b('0x2b')](saveUpdates(_0x50ef8f['body'],null))[_0x927b('0x2b')](respondWithResult(_0x49dcd2,null))['catch'](handleError(_0x49dcd2,null));};exports[_0x927b('0x2a')]=function(_0x3e85da,_0x41f90d){return db[_0x927b('0x31')][_0x927b('0x4d')]({'where':{'id':_0x3e85da[_0x927b('0x4a')]['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x41f90d,null))['then'](removeEntity(_0x41f90d,null))[_0x927b('0x49')](handleError(_0x41f90d,null));};exports[_0x927b('0x4e')]=function(_0x57ce48,_0x1f34bd){return db[_0x927b('0x31')][_0x927b('0x4e')]()['then'](respondWithResult(_0x1f34bd,null))[_0x927b('0x49')](handleError(_0x1f34bd,null));};exports[_0x927b('0x4f')]=function(_0xa2fa3,_0x1bffd9,_0x414fc7){return db[_0x927b('0x50')]['count']({'where':{'ChatGroupId':_0xa2fa3[_0x927b('0x4a')]['id'],'ToId':_0xa2fa3[_0x927b('0x51')]['id'],'read':![]}})[_0x927b('0x2b')](function(_0x16c365){return{'id':_[_0x927b('0x52')](_0xa2fa3[_0x927b('0x4a')]['id']),'count':_0x16c365};})[_0x927b('0x2b')](respondWithResult(_0x1bffd9,null))['catch'](handleError(_0x1bffd9,null));};exports[_0x927b('0x53')]=function(_0x1fc7e0,_0x2c9903,_0x52c597){return db[_0x927b('0x31')]['find']({'where':{'id':_0x1fc7e0[_0x927b('0x4a')]['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x2c9903,null))[_0x927b('0x2b')](function(_0x2467e4){if(_0x2467e4){return _0x2467e4[_0x927b('0x53')](_0x1fc7e0['body'][_0x927b('0x54')],_[_0x927b('0x55')](_0x1fc7e0[_0x927b('0x4c')],[_0x927b('0x54'),'id'])||{});}})['then'](respondWithResult(_0x2c9903,null))[_0x927b('0x49')](handleError(_0x2c9903,null));};exports[_0x927b('0x56')]=function(_0x3fcec8,_0x2f8e7c,_0x4ee55d){var _0x2f8427={};var _0x3e09f0={};var _0x2f8491;var _0x26de80;return db[_0x927b('0x31')][_0x927b('0x57')]({'where':{'id':_0x3fcec8[_0x927b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f8e7c,null))[_0x927b('0x2b')](function(_0x22fd30){if(_0x22fd30){_0x2f8491=_0x22fd30;_0x3e09f0[_0x927b('0x3a')]=_['keys'](db[_0x927b('0x58')][_0x927b('0x32')]);_0x3e09f0[_0x927b('0x37')]=_[_0x927b('0x36')](_0x3fcec8['query']);_0x3e09f0[_0x927b('0x38')]=_[_0x927b('0x39')](_0x3e09f0[_0x927b('0x3a')],_0x3e09f0['query']);_0x2f8427[_0x927b('0x3c')]=_[_0x927b('0x39')](_0x3e09f0['model'],qs[_0x927b('0x3b')](_0x3fcec8['query'][_0x927b('0x3b')]));_0x2f8427[_0x927b('0x3c')]=_0x2f8427['attributes'][_0x927b('0x3d')]?_0x2f8427[_0x927b('0x3c')]:_0x3e09f0['model'];_0x2f8427['order']=qs[_0x927b('0x40')](_0x3fcec8[_0x927b('0x37')][_0x927b('0x40')]);_0x2f8427[_0x927b('0x41')]=qs[_0x927b('0x38')](_[_0x927b('0x59')](_0x3fcec8[_0x927b('0x37')],_0x3e09f0[_0x927b('0x38')]));if(_0x3fcec8[_0x927b('0x37')]['filter']){_0x2f8427[_0x927b('0x41')]=_[_0x927b('0x42')](_0x2f8427[_0x927b('0x41')],{'$or':_[_0x927b('0x30')](_0x2f8427[_0x927b('0x3c')],function(_0x5c31b2){var _0x4d4135={};_0x4d4135[_0x5c31b2]={'$like':'%'+_0x3fcec8['query'][_0x927b('0x44')]+'%'};return _0x4d4135;})});}_0x2f8427=_[_0x927b('0x42')]({},_0x2f8427,_0x3fcec8[_0x927b('0x5a')]);return _0x2f8491[_0x927b('0x56')](_0x2f8427);}})[_0x927b('0x2b')](function(_0x363194){if(_0x363194){_0x26de80=_0x363194['length'];if(!_0x3fcec8['query'][_0x927b('0x5b')](_0x927b('0x3e'))){_0x2f8427['limit']=qs[_0x927b('0x24')](_0x3fcec8[_0x927b('0x37')][_0x927b('0x24')]);_0x2f8427[_0x927b('0x22')]=qs[_0x927b('0x22')](_0x3fcec8['query'][_0x927b('0x22')]);}return _0x2f8491[_0x927b('0x56')](_0x2f8427);}})[_0x927b('0x2b')](function(_0x627ace){if(_0x627ace){return _0x627ace?{'count':_0x26de80,'rows':_0x627ace}:null;}})[_0x927b('0x2b')](respondWithResult(_0x2f8e7c,null))[_0x927b('0x49')](handleError(_0x2f8e7c,null));};exports['removeMembers']=function(_0x4903ea,_0x2c86b4,_0x568ecb){return db[_0x927b('0x31')][_0x927b('0x4d')]({'where':{'id':_0x4903ea['params']['id']}})['then'](handleEntityNotFound(_0x2c86b4,null))[_0x927b('0x2b')](function(_0x3ada69){if(_0x3ada69){return _0x3ada69[_0x927b('0x5c')](_0x4903ea[_0x927b('0x37')][_0x927b('0x54')]);}})[_0x927b('0x2b')](respondWithStatusCode(_0x2c86b4,null))[_0x927b('0x49')](handleError(_0x2c86b4,null));};exports[_0x927b('0x5d')]=function(_0x441594,_0x4660c7,_0x156d3c){if(_0x441594[_0x927b('0x4c')]['id']){delete _0x441594['body']['id'];}return db[_0x927b('0x31')]['find']({'where':{'id':_0x441594[_0x927b('0x4a')]['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x4660c7,null))[_0x927b('0x2b')](function(_0x3d72a3){if(_0x3d72a3){_0x441594[_0x927b('0x4c')][_0x927b('0x5e')]=_0x3d72a3['id'];return db[_0x927b('0x50')][_0x927b('0x4b')](_0x441594[_0x927b('0x4c')]);}})['then'](respondWithResult(_0x4660c7,null))[_0x927b('0x49')](handleError(_0x4660c7,null));};exports[_0x927b('0x5f')]=function(_0x46c4e1,_0x575e4e,_0x34e9de){var _0x2b78b6={};var _0x95f7c4={};var _0x1fdf67;var _0x29b5fc;return db['ChatGroup']['findOne']({'where':{'id':_0x46c4e1['params']['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x575e4e,null))['then'](function(_0x2004ab){if(_0x2004ab){_0x1fdf67=_0x2004ab;_0x95f7c4[_0x927b('0x3a')]=_[_0x927b('0x36')](db[_0x927b('0x50')]['rawAttributes']);_0x95f7c4[_0x927b('0x37')]=_['keys'](_0x46c4e1['query']);_0x95f7c4[_0x927b('0x38')]=_[_0x927b('0x39')](_0x95f7c4[_0x927b('0x3a')],_0x95f7c4[_0x927b('0x37')]);_0x2b78b6[_0x927b('0x3c')]=_['intersection'](_0x95f7c4[_0x927b('0x3a')],qs[_0x927b('0x3b')](_0x46c4e1['query'][_0x927b('0x3b')]));_0x2b78b6[_0x927b('0x3c')]=_0x2b78b6[_0x927b('0x3c')][_0x927b('0x3d')]?_0x2b78b6[_0x927b('0x3c')]:_0x95f7c4['model'];_0x2b78b6[_0x927b('0x3f')]=qs[_0x927b('0x40')](_0x46c4e1[_0x927b('0x37')][_0x927b('0x40')]);_0x2b78b6['where']=qs[_0x927b('0x38')](_['pick'](_0x46c4e1['query'],_0x95f7c4[_0x927b('0x38')]));if(_0x46c4e1['query'][_0x927b('0x44')]){_0x2b78b6[_0x927b('0x41')]=_[_0x927b('0x42')](_0x2b78b6['where'],{'$or':_[_0x927b('0x30')](_0x2b78b6[_0x927b('0x3c')],function(_0x574986){var _0x38db8e={};_0x38db8e[_0x574986]={'$like':'%'+_0x46c4e1[_0x927b('0x37')][_0x927b('0x44')]+'%'};return _0x38db8e;})});}if(_0x46c4e1[_0x927b('0x37')]['$gte']){var _0x72de80=_0x46c4e1[_0x927b('0x37')]['$gte']['split'](',');var _0x277e68={};_0x277e68[_0x72de80[0x0]]={'$gte':moment(_0x72de80[0x1])['format'](_0x927b('0x60'))};_0x2b78b6[_0x927b('0x41')]=_['merge'](_0x2b78b6['where'],_0x277e68);}_0x2b78b6=_['merge']({},_0x2b78b6,_0x46c4e1['options']);return _0x1fdf67['getMessages'](_0x2b78b6);}})[_0x927b('0x2b')](function(_0x106a0f){if(_0x106a0f){_0x29b5fc=_0x106a0f[_0x927b('0x3d')];if(!_0x46c4e1[_0x927b('0x37')][_0x927b('0x5b')](_0x927b('0x3e'))){_0x2b78b6['limit']=qs[_0x927b('0x24')](_0x46c4e1[_0x927b('0x37')][_0x927b('0x24')]);_0x2b78b6[_0x927b('0x22')]=qs[_0x927b('0x22')](_0x46c4e1[_0x927b('0x37')][_0x927b('0x22')]);}return _0x1fdf67['getMessages'](_0x2b78b6);}})['then'](function(_0x42a619){if(_0x42a619){return _0x42a619?{'count':_0x29b5fc,'rows':_0x42a619}:null;}})[_0x927b('0x2b')](respondWithResult(_0x575e4e,null))[_0x927b('0x49')](handleError(_0x575e4e,null));};
\ No newline at end of file
index dbda01c..4c9cc79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18b8=['save','remove','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x18b8,0x1bf));var _0x818b=function(_0x1fced6,_0x41b4a4){_0x1fced6=_0x1fced6-0x0;var _0x5de0d0=_0x18b8[_0x1fced6];return _0x5de0d0;};'use strict';var EventEmitter=require(_0x818b('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x818b('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x818b('0x2')](0x0);var events={'afterCreate':_0x818b('0x3'),'afterUpdate':'update','afterDestroy':_0x818b('0x4')};function emitEvent(_0x3da6e5){return function(_0x4d5086,_0x3302a1,_0x1bffd1){ChatGroupEvents[_0x818b('0x5')](_0x3da6e5+':'+_0x4d5086['id'],_0x4d5086);ChatGroupEvents[_0x818b('0x5')](_0x3da6e5,_0x4d5086);_0x1bffd1(null);};}for(var e in events){if(events[_0x818b('0x6')](e)){var event=events[e];ChatGroup[_0x818b('0x7')](e,emitEvent(event));}}module[_0x818b('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xc4a6=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hook'];(function(_0x15cbd4,_0x443ef9){var _0x32fc1e=function(_0x59ac74){while(--_0x59ac74){_0x15cbd4['push'](_0x15cbd4['shift']());}};_0x32fc1e(++_0x443ef9);}(_0xc4a6,0x106));var _0x6c4a=function(_0x5cc450,_0xbc6fa8){_0x5cc450=_0x5cc450-0x0;var _0x781ec6=_0xc4a6[_0x5cc450];return _0x781ec6;};'use strict';var EventEmitter=require(_0x6c4a('0x0'));var ChatGroup=require(_0x6c4a('0x1'))['db'][_0x6c4a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6c4a('0x3')](0x0);var events={'afterCreate':_0x6c4a('0x4'),'afterUpdate':'update','afterDestroy':_0x6c4a('0x5')};function emitEvent(_0x36ccd2){return function(_0x12f185,_0x7e185d,_0x223522){ChatGroupEvents[_0x6c4a('0x6')](_0x36ccd2+':'+_0x12f185['id'],_0x12f185);ChatGroupEvents[_0x6c4a('0x6')](_0x36ccd2,_0x12f185);_0x223522(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x6c4a('0x7')](e,emitEvent(event));}}module[_0x6c4a('0x8')]=ChatGroupEvents;
\ No newline at end of file
index 3af3a09..6a787bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8150=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird'];(function(_0xec8826,_0x373d98){var _0x3499a5=function(_0x1fc71c){while(--_0x1fc71c){_0xec8826['push'](_0xec8826['shift']());}};_0x3499a5(++_0x373d98);}(_0x8150,0xf7));var _0x0815=function(_0x4ab010,_0x506ef0){_0x4ab010=_0x4ab010-0x0;var _0x1b4dc8=_0x8150[_0x4ab010];return _0x1b4dc8;};'use strict';var _=require(_0x0815('0x0'));var util=require('util');var logger=require(_0x0815('0x1'))(_0x0815('0x2'));var moment=require(_0x0815('0x3'));var BPromise=require(_0x0815('0x4'));var rp=require(_0x0815('0x5'));var fs=require('fs');var path=require(_0x0815('0x6'));var rimraf=require(_0x0815('0x7'));var config=require(_0x0815('0x8'));var attributes=require(_0x0815('0x9'));module['exports']=function(_0x3989fd,_0x2b2793){return _0x3989fd['define'](_0x0815('0xa'),attributes,{'tableName':_0x0815('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51e2=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5f0d25,_0x5c0e51){var _0x51e3af=function(_0xdf071){while(--_0xdf071){_0x5f0d25['push'](_0x5f0d25['shift']());}};_0x51e3af(++_0x5c0e51);}(_0x51e2,0xc8));var _0x251e=function(_0x5c2cd8,_0x27f96c){_0x5c2cd8=_0x5c2cd8-0x0;var _0x46c2ff=_0x51e2[_0x5c2cd8];return _0x46c2ff;};'use strict';var _=require(_0x251e('0x0'));var util=require('util');var logger=require(_0x251e('0x1'))(_0x251e('0x2'));var moment=require('moment');var BPromise=require(_0x251e('0x3'));var rp=require(_0x251e('0x4'));var fs=require('fs');var path=require(_0x251e('0x5'));var rimraf=require(_0x251e('0x6'));var config=require(_0x251e('0x7'));var attributes=require(_0x251e('0x8'));module[_0x251e('0x9')]=function(_0x1969bf,_0x37cd23){return _0x1969bf[_0x251e('0xa')](_0x251e('0xb'),attributes,{'tableName':_0x251e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 17753f0..5ca4bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5b=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash'];(function(_0x5b57a3,_0xe935ea){var _0x343622=function(_0xc0c6ea){while(--_0xc0c6ea){_0x5b57a3['push'](_0x5b57a3['shift']());}};_0x343622(++_0xe935ea);}(_0x9c5b,0x1cb));var _0xb9c5=function(_0x1a2318,_0x3d1585){_0x1a2318=_0x1a2318-0x0;var _0xd987dd=_0x9c5b[_0x1a2318];return _0xd987dd;};'use strict';var _=require(_0xb9c5('0x0'));var util=require('util');var moment=require(_0xb9c5('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9c5('0x2'));var fs=require('fs');var Redis=require(_0xb9c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9c5('0x4'));var logger=require(_0xb9c5('0x5'))(_0xb9c5('0x6'));var config=require(_0xb9c5('0x7'));var jayson=require(_0xb9c5('0x8'));var client=jayson['client'][_0xb9c5('0x9')]({'port':0x232a});config[_0xb9c5('0xa')]=_['defaults'](config[_0xb9c5('0xa')],{'host':_0xb9c5('0xb'),'port':0x18eb});var socket=require(_0xb9c5('0xc'))(new Redis(config['redis']));require(_0xb9c5('0xd'))['register'](socket);function respondWithRpcPromise(_0x543987,_0x25f973,_0x5107cf){return new BPromise(function(_0x4118df,_0x354f57){return client[_0xb9c5('0xe')](_0x543987,_0x5107cf)['then'](function(_0x380357){logger[_0xb9c5('0xf')](_0xb9c5('0x10'),_0x25f973,_0xb9c5('0x11'));logger[_0xb9c5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x25f973,_0xb9c5('0x11'),JSON['stringify'](_0x380357));if(_0x380357[_0xb9c5('0x13')]){if(_0x380357[_0xb9c5('0x13')][_0xb9c5('0x14')]===0x1f4){logger[_0xb9c5('0x13')](_0xb9c5('0x10'),_0x25f973,_0x380357[_0xb9c5('0x13')]['message']);return _0x354f57(_0x380357[_0xb9c5('0x13')][_0xb9c5('0x15')]);}logger[_0xb9c5('0x13')](_0xb9c5('0x10'),_0x25f973,_0x380357[_0xb9c5('0x13')][_0xb9c5('0x15')]);return _0x4118df(_0x380357[_0xb9c5('0x13')]['message']);}else{logger[_0xb9c5('0xf')](_0xb9c5('0x10'),_0x25f973,_0xb9c5('0x11'));_0x4118df(_0x380357['result'][_0xb9c5('0x15')]);}})[_0xb9c5('0x16')](function(_0x3d8adf){logger[_0xb9c5('0x13')]('ChatGroup,\x20%s,\x20%s',_0x25f973,_0x3d8adf);_0x354f57(_0x3d8adf);});});}
\ No newline at end of file
+var _0xc92f=['socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis'];(function(_0x5921e8,_0x2ecbb1){var _0x1767b1=function(_0x125922){while(--_0x125922){_0x5921e8['push'](_0x5921e8['shift']());}};_0x1767b1(++_0x2ecbb1);}(_0xc92f,0xf3));var _0xfc92=function(_0x28ae0f,_0x3c0034){_0x28ae0f=_0x28ae0f-0x0;var _0x5f4b3e=_0xc92f[_0x28ae0f];return _0x5f4b3e;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var moment=require('moment');var BPromise=require(_0xfc92('0x2'));var rs=require(_0xfc92('0x3'));var fs=require('fs');var Redis=require(_0xfc92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc92('0x5'));var logger=require(_0xfc92('0x6'))(_0xfc92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc92('0x8')]['http']({'port':0x232a});config[_0xfc92('0x9')]=_['defaults'](config[_0xfc92('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc92('0xa'))(new Redis(config[_0xfc92('0x9')]));require(_0xfc92('0xb'))['register'](socket);function respondWithRpcPromise(_0x18a53b,_0x379756,_0x213ed0){return new BPromise(function(_0x552eab,_0x66d993){return client[_0xfc92('0xc')](_0x18a53b,_0x213ed0)[_0xfc92('0xd')](function(_0x5dee97){logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));logger[_0xfc92('0x11')](_0xfc92('0x12'),_0x379756,_0xfc92('0x10'),JSON[_0xfc92('0x13')](_0x5dee97));if(_0x5dee97[_0xfc92('0x14')]){if(_0x5dee97['error']['code']===0x1f4){logger['error'](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')]['message']);return _0x66d993(_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);}logger[_0xfc92('0x14')](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);return _0x552eab(_0x5dee97['error'][_0xfc92('0x15')]);}else{logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));_0x552eab(_0x5dee97['result']['message']);}})[_0xfc92('0x16')](function(_0x328345){logger['error'](_0xfc92('0xf'),_0x379756,_0x328345);_0x66d993(_0x328345);});});}
\ No newline at end of file
index 21775bc..c5f0508 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720e=['register','length','save','remove','update','emit'];(function(_0x2aa5b7,_0x198ec7){var _0x38e6a3=function(_0x49a90e){while(--_0x49a90e){_0x2aa5b7['push'](_0x2aa5b7['shift']());}};_0x38e6a3(++_0x198ec7);}(_0x720e,0x1a6));var _0xe720=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0x720e[_0xf2662b];return _0x257dc7;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xe720('0x0'),_0xe720('0x1'),_0xe720('0x2')];function createListener(_0x3247aa,_0x86b1ca){return function(_0x137b99){_0x86b1ca[_0xe720('0x3')](_0x3247aa,_0x137b99);};}function removeListener(_0x2dba3e,_0x5c5aad){return function(){ChatGroupEvents['removeListener'](_0x2dba3e,_0x5c5aad);};}exports[_0xe720('0x4')]=function(_0x3e873b){for(var _0x2eb106=0x0,_0xe35c38=events[_0xe720('0x5')];_0x2eb106<_0xe35c38;_0x2eb106++){var _0x41e8f8=events[_0x2eb106];var _0x46f735=createListener('chatGroup:'+_0x41e8f8,_0x3e873b);ChatGroupEvents['on'](_0x41e8f8,_0x46f735);}};
\ No newline at end of file
+var _0xf12f=['remove','update','emit','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x197e53,_0x1b13f7){var _0x2cdb98=function(_0x5a2926){while(--_0x5a2926){_0x197e53['push'](_0x197e53['shift']());}};_0x2cdb98(++_0x1b13f7);}(_0xf12f,0x7e));var _0xff12=function(_0x3a226b,_0x3f0e03){_0x3a226b=_0x3a226b-0x0;var _0x29b01c=_0xf12f[_0x3a226b];return _0x29b01c;};'use strict';var ChatGroupEvents=require(_0xff12('0x0'));var events=[_0xff12('0x1'),_0xff12('0x2'),_0xff12('0x3')];function createListener(_0x42c8cf,_0x3e9c6b){return function(_0x36955e){_0x3e9c6b[_0xff12('0x4')](_0x42c8cf,_0x36955e);};}function removeListener(_0x4e7fbd,_0x13668d){return function(){ChatGroupEvents['removeListener'](_0x4e7fbd,_0x13668d);};}exports[_0xff12('0x5')]=function(_0x326ce0){for(var _0x392715=0x0,_0x26fcb0=events[_0xff12('0x6')];_0x392715<_0x26fcb0;_0x392715++){var _0x314ebd=events[_0x392715];var _0x8335e6=createListener(_0xff12('0x7')+_0x314ebd,_0x326ce0);ChatGroupEvents['on'](_0x314ebd,_0x8335e6);}};
\ No newline at end of file
index 0343bef..890ea9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf9f=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/:id','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','update','delete','destroy','removeMembers','exports'];(function(_0x3b0b07,_0xc927c6){var _0x198e38=function(_0x19377d){while(--_0x19377d){_0x3b0b07['push'](_0x3b0b07['shift']());}};_0x198e38(++_0xc927c6);}(_0xcf9f,0x6c));var _0xfcf9=function(_0x5b54de,_0x4a0432){_0x5b54de=_0x5b54de-0x0;var _0x4d8131=_0xcf9f[_0x5b54de];return _0x4d8131;};'use strict';var multer=require(_0xfcf9('0x0'));var util=require(_0xfcf9('0x1'));var path=require(_0xfcf9('0x2'));var timeout=require('connect-timeout');var express=require(_0xfcf9('0x3'));var router=express[_0xfcf9('0x4')]();var fs_extra=require(_0xfcf9('0x5'));var auth=require(_0xfcf9('0x6'));var interaction=require(_0xfcf9('0x7'));var config=require('../../config/environment');var controller=require(_0xfcf9('0x8'));router[_0xfcf9('0x9')]('/',auth[_0xfcf9('0xa')](),controller[_0xfcf9('0xb')]);router['get']('/describe',auth[_0xfcf9('0xa')](),controller['describe']);router['get'](_0xfcf9('0xc'),auth[_0xfcf9('0xa')](),controller['show']);router['get'](_0xfcf9('0xd'),auth['isAuthenticated'](),controller[_0xfcf9('0xe')]);router['get'](_0xfcf9('0xf'),auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x10')]);router['get']('/:id/messages',auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x11')]);router[_0xfcf9('0x12')]('/',auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x13')]);router[_0xfcf9('0x12')](_0xfcf9('0xf'),auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x14')]);router[_0xfcf9('0x12')](_0xfcf9('0x15'),auth[_0xfcf9('0xa')](),controller['addMessage']);router['put'](_0xfcf9('0xc'),auth['isAuthenticated'](),controller[_0xfcf9('0x16')]);router[_0xfcf9('0x17')](_0xfcf9('0xc'),auth['isAuthenticated'](),controller[_0xfcf9('0x18')]);router[_0xfcf9('0x17')](_0xfcf9('0xf'),auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x19')]);module[_0xfcf9('0x1a')]=router;
\ No newline at end of file
+var _0x7b5f=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','get','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','connect-timeout','express','Router'];(function(_0x61d891,_0x8478d6){var _0x1c3b3b=function(_0x4b2e99){while(--_0x4b2e99){_0x61d891['push'](_0x61d891['shift']());}};_0x1c3b3b(++_0x8478d6);}(_0x7b5f,0x101));var _0xf7b5=function(_0x5039b1,_0x32f067){_0x5039b1=_0x5039b1-0x0;var _0x588a3a=_0x7b5f[_0x5039b1];return _0x588a3a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf7b5('0x0'));var express=require(_0xf7b5('0x1'));var router=express[_0xf7b5('0x2')]();var fs_extra=require(_0xf7b5('0x3'));var auth=require(_0xf7b5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf7b5('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x7')]);router['get']('/describe',auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x8')]);router[_0xf7b5('0x9')](_0xf7b5('0xa'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0xb')]);router[_0xf7b5('0x9')](_0xf7b5('0xc'),auth['isAuthenticated'](),controller[_0xf7b5('0xd')]);router[_0xf7b5('0x9')](_0xf7b5('0xe'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0xf')]);router[_0xf7b5('0x9')](_0xf7b5('0x10'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x11')]);router[_0xf7b5('0x12')]('/',auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x13')]);router[_0xf7b5('0x12')](_0xf7b5('0xe'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x14')]);router[_0xf7b5('0x12')](_0xf7b5('0x10'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x15')]);router[_0xf7b5('0x16')](_0xf7b5('0xa'),auth[_0xf7b5('0x6')](),controller['update']);router[_0xf7b5('0x17')](_0xf7b5('0xa'),auth[_0xf7b5('0x6')](),controller['destroy']);router[_0xf7b5('0x17')](_0xf7b5('0xe'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x18')]);module[_0xf7b5('0x19')]=router;
\ No newline at end of file
index df4e16c..102c700 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','sequelize','exports','BOOLEAN'];(function(_0x5321b5,_0x143137){var _0x32b203=function(_0x57007f){while(--_0x57007f){_0x5321b5['push'](_0x5321b5['shift']());}};_0x32b203(++_0x143137);}(_0xb9be,0xc5));var _0xeb9b=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xb9be[_0x58a4fe];return _0x697de2;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'closed':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb9b('0x3')]},'ratingType':{'type':Sequelize[_0xeb9b('0x4')](_0xeb9b('0x5'),_0xeb9b('0x6')),'defaultValue':_0xeb9b('0x5')},'ratingMessage':{'type':Sequelize[_0xeb9b('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeb9b('0x8')]},'disposition':{'type':Sequelize[_0xeb9b('0x9')]},'secondDisposition':{'type':Sequelize[_0xeb9b('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xeb9b('0x9')]},'browserName':{'type':Sequelize[_0xeb9b('0x9')]},'browserVersion':{'type':Sequelize[_0xeb9b('0x9')]},'osName':{'type':Sequelize[_0xeb9b('0x9')]},'osVersion':{'type':Sequelize[_0xeb9b('0x9')]},'deviceModel':{'type':Sequelize[_0xeb9b('0x9')]},'deviceVendor':{'type':Sequelize[_0xeb9b('0x9')]},'deviceType':{'type':Sequelize[_0xeb9b('0x9')]},'referer':{'type':Sequelize[_0xeb9b('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeb9b('0x7')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xeb9b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeb9b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb9b('0x9')]},'customerPort':{'type':Sequelize[_0xeb9b('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xeb9b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6947=['DATE','long','out','BOOLEAN','exports','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x2cea0e,_0x533e56){var _0x236406=function(_0x4dce1d){while(--_0x4dce1d){_0x2cea0e['push'](_0x2cea0e['shift']());}};_0x236406(++_0x533e56);}(_0x6947,0x72));var _0x7694=function(_0x93ffe0,_0x4619d8){_0x93ffe0=_0x93ffe0-0x0;var _0x1758a9=_0x6947[_0x93ffe0];return _0x1758a9;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7694('0x1')]},'ratingType':{'type':Sequelize[_0x7694('0x2')](_0x7694('0x3'),_0x7694('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7694('0x5')]},'mailTranscript':{'type':Sequelize[_0x7694('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7694('0x7')]},'disposition':{'type':Sequelize[_0x7694('0x6')]},'secondDisposition':{'type':Sequelize[_0x7694('0x6')]},'thirdDisposition':{'type':Sequelize[_0x7694('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x7694('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7694('0x6')]},'osVersion':{'type':Sequelize[_0x7694('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7694('0x6')]},'deviceType':{'type':Sequelize[_0x7694('0x6')]},'referer':{'type':Sequelize[_0x7694('0x5')]},'customerIp':{'type':Sequelize[_0x7694('0x6')]},'formData':{'type':Sequelize[_0x7694('0x5')](_0x7694('0x8'))},'read1stAt':{'type':Sequelize[_0x7694('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7694('0x2')]('in',_0x7694('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7694('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x7694('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x7694('0xa')],'defaultValue':![]}};
\ No newline at end of file
index f5c32c4..dbbac13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0e=['error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','stack','name','send','render','merge','contact','interaction','fullname','TagIds','Tags','split','forEach','index','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','`\x20=\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','includeAll','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','agentAlias','System','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','intersection','sort','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','alias','rows','addTags','spread','emit','removeTags','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','Account','Owner','mkdirSync','closedAt','browserName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','lastName','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d227a,_0xa2a2be){var _0x1788a2=function(_0x6391f0){while(--_0x6391f0){_0x2d227a['push'](_0x2d227a['shift']());}};_0x1788a2(++_0xa2a2be);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3366e2,_0x1109bc){_0x3366e2=_0x3366e2-0x0;var _0x2711da=_0x9f0e[_0x3366e2];return _0x2711da;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var pdf=require(_0xe9f0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9f0('0x15'))(_0xe9f0('0x16'));var utils=require(_0xe9f0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe9f0('0x18'));var db=require('../../mysqldb')['db'];config[_0xe9f0('0x19')]=_[_0xe9f0('0x1a')](config[_0xe9f0('0x19')],{'host':_0xe9f0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9f0('0x19')]));require('./chatInteraction.socket')[_0xe9f0('0x1c')](socket);var jayson=require(_0xe9f0('0x1d'));var client=jayson[_0xe9f0('0x1e')]['http']({'port':0x232b});var client9004=jayson[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2e68ef,_0x598eee,_0xaa7aa6,_0x1e16e0){return new BPromise(function(_0xcd2042,_0xd71ac8){var _0x3ed69a=_0x1e16e0||client;return _0x3ed69a[_0xe9f0('0x20')](_0x2e68ef,_0xaa7aa6)[_0xe9f0('0x21')](function(_0x59bf5a){logger[_0xe9f0('0x22')](_0xe9f0('0x23'),_0x598eee,_0xe9f0('0x24'));logger['debug'](_0xe9f0('0x25'),_0x598eee,_0xe9f0('0x24'),JSON[_0xe9f0('0x26')](_0x59bf5a));if(_0x59bf5a[_0xe9f0('0x27')]){if(_0x59bf5a['error'][_0xe9f0('0x28')]===0x1f4){logger[_0xe9f0('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x598eee,_0x59bf5a['error']['message']);return _0xd71ac8(_0x59bf5a[_0xe9f0('0x27')][_0xe9f0('0x29')]);}logger[_0xe9f0('0x27')](_0xe9f0('0x23'),_0x598eee,_0x59bf5a[_0xe9f0('0x27')]['message']);return _0xcd2042(_0x59bf5a[_0xe9f0('0x27')][_0xe9f0('0x29')]);}else{logger[_0xe9f0('0x22')](_0xe9f0('0x23'),_0x598eee,_0xe9f0('0x24'));_0xcd2042(_0x59bf5a[_0xe9f0('0x2a')][_0xe9f0('0x29')]);}})[_0xe9f0('0x2b')](function(_0x3c4ba9){logger[_0xe9f0('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x598eee,_0x3c4ba9);_0xd71ac8(_0x3c4ba9);});});}function respondWithStatusCode(_0x371095,_0x27541f){_0x27541f=_0x27541f||0xcc;return function(_0x2ddfba){if(_0x2ddfba){return _0x371095[_0xe9f0('0x2c')](_0x27541f);}return _0x371095['status'](_0x27541f)[_0xe9f0('0x2d')]();};}function respondWithResult(_0x2613fd,_0x856ac8){_0x856ac8=_0x856ac8||0xc8;return function(_0x1f98a7){if(_0x1f98a7){return _0x2613fd[_0xe9f0('0x2e')](_0x856ac8)['json'](_0x1f98a7);}};}function respondWithFilteredResult(_0x130f96,_0xdc16bc){return function(_0x44fb5b){if(_0x44fb5b){var _0xab3d81=typeof _0xdc16bc[_0xe9f0('0x2f')]===_0xe9f0('0x30')&&typeof _0xdc16bc[_0xe9f0('0x31')]===_0xe9f0('0x30');var _0x2b6503=_0x44fb5b[_0xe9f0('0x32')];var _0x22806c=_0xab3d81?0x0:_0xdc16bc[_0xe9f0('0x2f')];var _0x445ad0=_0xab3d81?_0x44fb5b[_0xe9f0('0x32')]:_0xdc16bc[_0xe9f0('0x2f')]+_0xdc16bc[_0xe9f0('0x31')];var _0x80e3ac;if(_0x445ad0>=_0x2b6503){_0x445ad0=_0x2b6503;_0x80e3ac=0xc8;}else{_0x80e3ac=0xce;}_0x130f96[_0xe9f0('0x2e')](_0x80e3ac);return _0x130f96[_0xe9f0('0x33')](_0xe9f0('0x34'),_0x22806c+'-'+_0x445ad0+'/'+_0x2b6503)[_0xe9f0('0x35')](_0x44fb5b);}return null;};}function patchUpdates(_0x589803){return function(_0x1c394){try{jsonpatch[_0xe9f0('0x36')](_0x1c394,_0x589803,!![]);}catch(_0x5480ce){return BPromise['reject'](_0x5480ce);}return _0x1c394['save']();};}function saveUpdates(_0x191a39,_0x585742){return function(_0x9bf61d){if(_0x9bf61d){return _0x9bf61d[_0xe9f0('0x37')](_0x191a39)['then'](function(_0x285457){return _0x285457;});}return null;};}function removeEntity(_0x4c181d,_0x576a7a){return function(_0x59024e){if(_0x59024e){return _0x59024e[_0xe9f0('0x38')]()[_0xe9f0('0x21')](function(){_0x4c181d['status'](0xcc)[_0xe9f0('0x2d')]();});}};}function handleEntityNotFound(_0xb0cfc,_0x1d4748){return function(_0x4d4186){if(!_0x4d4186){_0xb0cfc['sendStatus'](0x194);}return _0x4d4186;};}function handleError(_0x3fb04e,_0x3ff42d){_0x3ff42d=_0x3ff42d||0x1f4;return function(_0x1917c8){logger['error'](_0x1917c8[_0xe9f0('0x39')]);if(_0x1917c8[_0xe9f0('0x3a')]){delete _0x1917c8[_0xe9f0('0x3a')];}_0x3fb04e[_0xe9f0('0x2e')](_0x3ff42d)[_0xe9f0('0x3b')](_0x1917c8);};}function getMustacheRender(_0x552ec2,_0x2ab492){return Mustache[_0xe9f0('0x3c')](_0x552ec2,_[_0xe9f0('0x3d')](_0x2ab492['body'],{'contact':_0x2ab492[_0xe9f0('0x3e')],'message':_0x2ab492[_0xe9f0('0x29')],'agent':_0x2ab492['agent'],'interaction':_0x2ab492[_0xe9f0('0x3f')],'account':_0x2ab492['account']}))||'';}function getInteractionUsers(_0x56c03e,_0x55c0bd){return new BPromise(function(_0x5dcbeb,_0x51eda3){try{if(_0x55c0bd[_0x56c03e['id']]){_0x56c03e['Users']=_['map'](_0x55c0bd[_0x56c03e['id']],function(_0x35062f){return{'id':_0x35062f['id'],'fullname':_0x35062f[_0xe9f0('0x40')]};});}}catch(_0x2d8f93){_0x51eda3(_0x2d8f93);}_0x5dcbeb(_0x56c03e);});}function getInteractionTags(_0x40c2c6,_0x2560c6){return new BPromise(function(_0xd9b61b,_0x3d4eb7){try{if(_0x40c2c6[_0xe9f0('0x41')]){_0x40c2c6[_0xe9f0('0x42')]=[];_0x40c2c6['TagIds'][_0xe9f0('0x43')](',')[_0xe9f0('0x44')](function(_0x36b00a){_0x40c2c6['Tags']['push'](_0x2560c6[_0x36b00a]);});}delete _0x40c2c6[_0xe9f0('0x41')];}catch(_0x515fa6){_0x3d4eb7(_0x515fa6);}_0xd9b61b(_0x40c2c6);});}function updateChatInteraction(_0x297689,_0x52613a,_0x314f0e){return new BPromise(function(_0x42d9d2,_0x4f1663){return getInteractionUsers(_0x297689,_0x314f0e)[_0xe9f0('0x21')](function(_0x3f5255){return getInteractionTags(_0x3f5255,_0x52613a);})[_0xe9f0('0x21')](function(_0x18faaf){_0x42d9d2(_0x18faaf);})[_0xe9f0('0x2b')](function(_0x59378a){_0x4f1663(_0x59378a);});});}exports[_0xe9f0('0x45')]=function(_0x2941a0,_0x30141e){var _0x319380={},_0xf75ffb={},_0x4ffc17={'count':0x0,'rows':[]};var _0x3a8d1d=_['map'](db['ChatInteraction'][_0xe9f0('0x46')],function(_0x17b832){return{'name':_0x17b832['fieldName'],'type':_0x17b832[_0xe9f0('0x47')][_0xe9f0('0x48')]};});_0xf75ffb[_0xe9f0('0x49')]=_[_0xe9f0('0x4a')](_0x3a8d1d,_0xe9f0('0x3a'));_0xf75ffb[_0xe9f0('0x4b')]=_[_0xe9f0('0x4c')](_0x2941a0['query']);_0xf75ffb[_0xe9f0('0x4d')]=_['intersection'](_0xf75ffb[_0xe9f0('0x49')],_0xf75ffb['query']);_0x319380[_0xe9f0('0x4e')]=_['intersection'](_0xf75ffb[_0xe9f0('0x49')],qs[_0xe9f0('0x4f')](_0x2941a0[_0xe9f0('0x4b')]['fields']));_0x319380[_0xe9f0('0x4e')]=_0x319380[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x319380[_0xe9f0('0x4e')]:_0xf75ffb[_0xe9f0('0x49')];if(!_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x51')](_0xe9f0('0x52'))){_0x319380[_0xe9f0('0x31')]=qs[_0xe9f0('0x31')](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0x319380['offset']=qs['offset'](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0x319380[_0xe9f0('0x53')]=qs['sort'](_0x2941a0[_0xe9f0('0x4b')]['sort']);_0x319380[_0xe9f0('0x54')]=qs[_0xe9f0('0x4d')](_[_0xe9f0('0x55')](_0x2941a0[_0xe9f0('0x4b')],_0xf75ffb['filters']),_0x3a8d1d);var _0xb18f13=[];var _0x3fa271=squel['select']()[_0xe9f0('0x56')]('id')[_0xe9f0('0x56')](_0xe9f0('0x3a'))[_0xe9f0('0x56')]('color')[_0xe9f0('0x57')](_0xe9f0('0x58'));var _0x3dd40d=squel[_0xe9f0('0x59')]()[_0xe9f0('0x56')](_0xe9f0('0x5a'))[_0xe9f0('0x56')](_0xe9f0('0x5b'))['field'](_0xe9f0('0x5c'))[_0xe9f0('0x57')](_0xe9f0('0x5d'),'ui')[_0xe9f0('0x5e')](_0xe9f0('0x5f'),'u',_0xe9f0('0x60'));var _0x28fe47=squel[_0xe9f0('0x59')]()[_0xe9f0('0x57')](_0xe9f0('0x61'),'i')[_0xe9f0('0x5e')](_0xe9f0('0x62'),'c',_0xe9f0('0x63'))[_0xe9f0('0x5e')]('users','o',_0xe9f0('0x64'))[_0xe9f0('0x5e')](_0xe9f0('0x65'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0xe9f0('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xe9f0('0x5e')](_0xe9f0('0x67'),'it',_0xe9f0('0x68'))['left_join'](_0xe9f0('0x58'),'t',_0xe9f0('0x69'));var _0x954616=squel[_0xe9f0('0x6a')]();var _0x4bb39d=[];var _0x392eae=squel[_0xe9f0('0x6a')]();var _0x28a66e;if(_0x2941a0[_0xe9f0('0x4b')]['search']){_0x28a66e=as['parseSearch'](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x6b')]);var _0x29286b=_0x28a66e[_0xe9f0('0x6c')];for(var _0x7cbe71=0x0;_0x7cbe71<_0x28a66e['conditions'][_0xe9f0('0x50')];_0x7cbe71++){var _0x55ce2d=_0x28a66e[_0xe9f0('0x6d')][_0x7cbe71];var _0x5858a9='i';var _0x7c05aa=_[_0xe9f0('0x6e')](_0x3a8d1d,[_0xe9f0('0x3a'),_0x55ce2d[_0xe9f0('0x56')]]);if(!_0x7c05aa){switch(_0x55ce2d[_0xe9f0('0x56')]){case'unreadMessages':if(_0x55ce2d['value']==0x1){_0x28fe47['having']('`'+_0x55ce2d[_0xe9f0('0x56')]+_0xe9f0('0x6f'));}else{_0x28fe47['having']('`'+_0x55ce2d[_0xe9f0('0x56')]+'`\x20>\x200');}break;case'Contact':if(_0x55ce2d[_0xe9f0('0x70')]===_0xe9f0('0x71')){if(_0x55ce2d[_0xe9f0('0x72')][_0xe9f0('0x43')]('\x20')[_0xe9f0('0x50')]>0x1){_0x954616[_0x29286b](_0xe9f0('0x73'),qs['getFullTextValue'](_0x55ce2d['value']),null);}else{var _0x1255e6='%'+_0x55ce2d[_0xe9f0('0x72')]+'%';_0x954616[_0x29286b](_0xe9f0('0x74'),_0x1255e6,_0x1255e6,_0x1255e6);}}else{_0x7c05aa=_[_0xe9f0('0x6e')](_0x3a8d1d,['name',_0xe9f0('0x75')]);_0x55ce2d[_0xe9f0('0x56')]=_0xe9f0('0x75');_0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa[_0xe9f0('0x47')],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')][_0xe9f0('0x2d')]);}break;case _0xe9f0('0x79'):var _0xb6e75d=_0x55ce2d['value'][_0xe9f0('0x43')](',')[_0xe9f0('0x4a')](function(_0x388091){return Number(_0x388091);});_0xb6e75d[_0xe9f0('0x44')](function(_0x214ac0){_0x392eae['or'](_0xe9f0('0x7a'),'%,'+_0x214ac0+',%');});_0x4bb39d=_[_0xe9f0('0x7b')](_0x4bb39d,_0xb6e75d);break;case _0xe9f0('0x7c'):if(_0x55ce2d[_0xe9f0('0x70')]===_0xe9f0('0x71')){_0x954616[_0x29286b](_0xe9f0('0x7d'),'%'+_0x55ce2d[_0xe9f0('0x72')]+'%',null);}else{_0x7c05aa=_['find'](_0x3a8d1d,[_0xe9f0('0x3a'),_0xe9f0('0x7e')]);_0x55ce2d[_0xe9f0('0x56')]=_0xe9f0('0x7e');_0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa[_0xe9f0('0x47')],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')]['end']);}break;case _0xe9f0('0x7f'):_0x2cd0c1=as[_0xe9f0('0x76')]('me',null,_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')]['end']);break;}}else{var _0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa['type'],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1['text'],_0x2cd0c1[_0xe9f0('0x72')]['start'],_0x2cd0c1[_0xe9f0('0x72')][_0xe9f0('0x2d')]);}}}else{var _0x56d052=_(_0x2941a0[_0xe9f0('0x4b')])[_0xe9f0('0x4c')]()[_0xe9f0('0x4a')](function(_0x300fae){return _[_0xe9f0('0x80')](_0x3a8d1d,[_0xe9f0('0x3a'),_0x300fae])?_0x300fae:undefined;})[_0xe9f0('0x81')]()[_0xe9f0('0x72')]();if(!_[_0xe9f0('0x82')](_0x56d052)){_0x56d052['forEach'](function(_0x2e15f9){if(_0x2e15f9===_0xe9f0('0x83')){_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0x84'),[][_0xe9f0('0x85')](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9]));}else if(_0x2e15f9===_0xe9f0('0x86')){var _0x114033=JSON['parse'](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9])[_0xe9f0('0x87')];var _0x2ce60c=JSON[_0xe9f0('0x88')](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9])[_0xe9f0('0x89')];_0x28fe47['where'](_0xe9f0('0x8a'),_0x114033,_0x2ce60c);}else{if(_0x2941a0['query'][_0x2e15f9]==='null'){_0x28fe47['where']('i.'+_0x2e15f9+_0xe9f0('0x8b'));}else{_0x28fe47[_0xe9f0('0x54')]('i.'+_0x2e15f9+_0xe9f0('0x8c'),_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9]);}}});}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x8d')]){if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x8d')]==0x1){_0x28fe47[_0xe9f0('0x8e')]('`unreadMessages`\x20=\x200');}else{_0x28fe47[_0xe9f0('0x8e')](_0xe9f0('0x8f'));}}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')]){_0x4bb39d=_[_0xe9f0('0x91')](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')])?_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')]:new Array(_0x2941a0[_0xe9f0('0x4b')]['tag']);_0x4bb39d['forEach'](function(_0x23c9e8){_0x392eae['or'](_0xe9f0('0x7a'),'%,'+_0x23c9e8+',%');});}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x92')]){var _0xdaf9e3=_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x92')][_0xe9f0('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xdaf9e3)){_0x954616['or'](_0xe9f0('0x94'),_0xdaf9e3+'%');}else{_0x954616['or'](_0xe9f0('0x95'),qs['getFullTextValue'](_0xdaf9e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xdaf9e3+'%');}}}_0x28fe47[_0xe9f0('0x54')](_0x954616);_0x28fe47[_0xe9f0('0x96')](_0xe9f0('0x97'));var _0xab92b={'type':db[_0xe9f0('0x98')]['QueryTypes'][_0xe9f0('0x99')],'raw':!![]};var _0x21eba3=_0x28fe47[_0xe9f0('0x9a')]();_0x21eba3[_0xe9f0('0x56')](_0xe9f0('0x97'));_0x21eba3[_0xe9f0('0x56')](_0xe9f0('0x9b'),'unreadMessages');if(_0x319380['order']){_0x319380['order'][_0xe9f0('0x44')](function(_0x3c95f4){var _0x245458=_0x3c95f4[0x0]===_0xe9f0('0x9c')?_0x3c95f4[0x0]:'i.'+_0x3c95f4[0x0];_0x28fe47['order'](_0x245458,_0x3c95f4[0x1]===_0xe9f0('0x9d')?![]:!![]);});}if(!_['isEmpty'](_0x4bb39d)){_0x28fe47[_0xe9f0('0x8e')](_0x392eae);_0x21eba3['where'](_0xe9f0('0x9e'),_0x4bb39d);}BPromise[_0xe9f0('0x9f')]()[_0xe9f0('0x21')](function(){if(!_0x28a66e){if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x83')])return;_0x21eba3[_0xe9f0('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0xa0'));return;}if(_0x2941a0[_0xe9f0('0xa1')][_0xe9f0('0xa2')]!==_0xe9f0('0xa3'))return;return _0x2941a0['user'][_0xe9f0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xe9f0('0x21')](function(_0x4c9808){if(_[_0xe9f0('0x82')](_0x4c9808)){_0x21eba3['where'](_0xe9f0('0xa5'));_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0xa5'));}else{_0x21eba3['where'](_0xe9f0('0x84'),_[_0xe9f0('0x4a')](_0x4c9808,'id'));_0x28fe47[_0xe9f0('0x54')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe9f0('0x4a')](_0x4c9808,'id'));}});})[_0xe9f0('0x21')](function(){if(_0x2941a0[_0xe9f0('0xa1')][_0xe9f0('0xa2')]===_0xe9f0('0xa3')&&!_0x28a66e&&!_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x83')])return[];return db['sequelize']['query'](_0x21eba3[_0xe9f0('0xa6')](),_0xab92b);})[_0xe9f0('0x21')](function(_0x1a7549){_0x4ffc17['count']=_0x1a7549[_0xe9f0('0x50')];if(_0x4ffc17[_0xe9f0('0x32')]===0x0)return[];return db[_0xe9f0('0xa7')][_0xe9f0('0x4b')](_0x3fa271['toString'](),_0xab92b)['then'](function(_0x20436f){_0xb18f13=_[_0xe9f0('0xa8')](_0x20436f,'id');_0xab92b=_['merge'](_0xab92b,{'model':db[_0xe9f0('0xa9')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2941a0['query']['fields']){_0x319380[_0xe9f0('0x4e')][_0xe9f0('0x44')](function(_0x77b59d){_0x28fe47[_0xe9f0('0x56')]('i.'+_0x77b59d);});}else{_0x28fe47[_0xe9f0('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xaa'),_0xe9f0('0xab'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xac'),'Account.mandatoryDisposition');_0x28fe47['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xe9f0('0x9c'));_0x28fe47['field'](_0xe9f0('0xad'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xae'),_0xe9f0('0xaf'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb0'),'Contact.lastName');_0x28fe47['field'](_0xe9f0('0xb1'),_0xe9f0('0xb2'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb3'),_0xe9f0('0xb4'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb5'),_0xe9f0('0xb6'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb7'),_0xe9f0('0xb8'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb9'),_0xe9f0('0xba'));_0x28fe47['field'](_0xe9f0('0xbb'),_0xe9f0('0xbc'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xbd'),_0xe9f0('0x41'));}if(_0x319380[_0xe9f0('0x31')])_0x28fe47[_0xe9f0('0x31')](_0x319380[_0xe9f0('0x31')]);if(_0x319380[_0xe9f0('0x2f')])_0x28fe47[_0xe9f0('0x2f')](_0x319380[_0xe9f0('0x2f')]);return db['sequelize'][_0xe9f0('0x4b')](_0x28fe47[_0xe9f0('0xa6')](),_0xab92b);})[_0xe9f0('0x21')](function(_0x2af661){if(_0x2af661[_0xe9f0('0x50')]>0x0)_0x3dd40d[_0xe9f0('0x54')](_0xe9f0('0xbe'),_[_0xe9f0('0x4a')](_0x2af661,'id'));return db['sequelize']['query'](_0x3dd40d[_0xe9f0('0xa6')](),_0xab92b)[_0xe9f0('0x21')](function(_0x4e7f22){var _0x583c4c=_[_0xe9f0('0xbf')](_0x4e7f22,_0xe9f0('0xc0'));var _0x37a080=[];_0x2af661[_0xe9f0('0x44')](function(_0x21d159){_0x37a080[_0xe9f0('0xc1')](updateChatInteraction(_0x21d159,_0xb18f13,_0x583c4c));});return BPromise['all'](_0x37a080);});});})[_0xe9f0('0x21')](function(_0x2f1584){_0x4ffc17['rows']=_0x2f1584;return _0x4ffc17;})['then'](respondWithFilteredResult(_0x30141e,_0x319380))[_0xe9f0('0x2b')](handleError(_0x30141e,null));};exports[_0xe9f0('0xc2')]=function(_0x4b668a,_0x17013a){var _0x63e374={'raw':![],'where':{'id':_0x4b668a['params']['id']}},_0x34eda8={};_0x34eda8[_0xe9f0('0x49')]=_[_0xe9f0('0x4c')](db[_0xe9f0('0xa9')][_0xe9f0('0x46')]);_0x34eda8['query']=_[_0xe9f0('0x4c')](_0x4b668a[_0xe9f0('0x4b')]);_0x34eda8[_0xe9f0('0x4d')]=_['intersection'](_0x34eda8['model'],_0x34eda8['query']);_0x63e374[_0xe9f0('0x4e')]=_['intersection'](_0x34eda8['model'],qs[_0xe9f0('0x4f')](_0x4b668a['query'][_0xe9f0('0x4f')]));_0x63e374[_0xe9f0('0x4e')]=_0x63e374[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x63e374['attributes']:_0x34eda8[_0xe9f0('0x49')];if(_0x4b668a[_0xe9f0('0x4b')][_0xe9f0('0xc3')]){_0x63e374[_0xe9f0('0xc4')]=[{'all':!![]}];}_0x63e374=_[_0xe9f0('0x3d')]({},_0x63e374,_0x4b668a[_0xe9f0('0xc5')]);return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')](_0x63e374)[_0xe9f0('0x21')](handleEntityNotFound(_0x17013a,null))[_0xe9f0('0x21')](respondWithResult(_0x17013a,null))[_0xe9f0('0x2b')](handleError(_0x17013a,null));};exports[_0xe9f0('0xc6')]=function(_0x27c9f5,_0x56b64b){return db[_0xe9f0('0xa9')][_0xe9f0('0xc6')](_0x27c9f5['body'],{})['then'](respondWithResult(_0x56b64b,0xc9))[_0xe9f0('0x2b')](handleError(_0x56b64b,null));};exports[_0xe9f0('0x37')]=function(_0xef63f8,_0x1c0db4){if(_0xef63f8['body']['id']){delete _0xef63f8[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0xef63f8['params']['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x1c0db4,null))[_0xe9f0('0x21')](saveUpdates(_0xef63f8[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](respondWithResult(_0x1c0db4,null))[_0xe9f0('0x2b')](handleError(_0x1c0db4,null));};exports['destroy']=function(_0x5cbea8,_0x19f96b){return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x5cbea8[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x19f96b,null))[_0xe9f0('0x21')](removeEntity(_0x19f96b,null))[_0xe9f0('0x2b')](handleError(_0x19f96b,null));};exports[_0xe9f0('0xc8')]=function(_0x5ae9f1,_0x1aacfa){return db['ChatInteraction']['describe']()[_0xe9f0('0x21')](respondWithResult(_0x1aacfa,null))[_0xe9f0('0x2b')](handleError(_0x1aacfa,null));};exports[_0xe9f0('0xc9')]=function(_0x59396b,_0x564755){var _0x174e49=_0x59396b['params']['id'];var _0x3f2f29;var _0x18abe2;var _0x14e369;return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0x174e49}})[_0xe9f0('0x21')](function(_0x5108d3){_0x3f2f29=_0x5108d3;return db[_0xe9f0('0xca')]['findOne']({'where':{'id':_0x5108d3['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xe9f0('0xcb'),_0xe9f0('0xcc'),'vidaooNote',_0xe9f0('0xcd')],'raw':!![]});})[_0xe9f0('0x21')](function(_0x250bfe){if(_0x250bfe&&_0x250bfe[_0xe9f0('0xce')]&&_0x250bfe[_0xe9f0('0xcb')]){_0x18abe2=_0x250bfe;var _0x40306a={'interaction':{'id':_0x174e49},'agent':{'id':_0x59396b[_0xe9f0('0xa1')]['id'],'name':_0x59396b['user'][_0xe9f0('0x3a')],'fullname':_0x59396b[_0xe9f0('0xa1')][_0xe9f0('0x40')],'email':_0x59396b['user'][_0xe9f0('0xcf')]},'contact':_0x59396b[_0xe9f0('0x7f')][_0xe9f0('0x3e')],'account':_0x59396b['body'][_0xe9f0('0xd0')]};var _0x35456b={'rejectUnauthorized':![],'method':'POST','url':_0xe9f0('0xd1'),'headers':{'X-APIKEY':_0x250bfe['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x59396b[_0xe9f0('0xa1')][_0xe9f0('0xcf')]],'buttons':null,'topic':_0x18abe2[_0xe9f0('0xcc')],'note':_[_0xe9f0('0xd2')](_0x18abe2[_0xe9f0('0xd3')])?null:getMustacheRender(_0x18abe2[_0xe9f0('0xd3')],_0x40306a),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe9f0('0xd2')](_0x18abe2[_0xe9f0('0xcd')])){var _0xfe329a=getMustacheRender(_0x18abe2[_0xe9f0('0xcd')],_0x40306a);var _0x358cda=JSON[_0xe9f0('0x88')](_0xfe329a);_0x35456b[_0xe9f0('0x7f')]['metadata']=_0x358cda;}}catch(_0x5b9074){throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35456b);}else{throw new db[(_0xe9f0('0x98'))]['ValidationError'](_0xe9f0('0xd5'));}})[_0xe9f0('0x21')](function(_0x557b90){_0x14e369=_0x557b90;if(_0x14e369['id']){var _0x4aa320={'body':_0x14e369[_0xe9f0('0xd6')],'ChatWebsiteId':_0x18abe2['id'],'ChatInteractionId':_0x3f2f29['id'],'direction':_0xe9f0('0xd7'),'UserId':_0x59396b[_0xe9f0('0xa1')]['id']};return db['ChatMessage']['create'](_0x4aa320,{});}else{throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))](_0xe9f0('0xd8'));}})[_0xe9f0('0x21')](function(){return _0x3f2f29[_0xe9f0('0xd9')]({'vidaooSessionId':_0x14e369['id']});})[_0xe9f0('0x21')](respondWithResult(_0x564755,null))[_0xe9f0('0x2b')](handleError(_0x564755,null));};exports[_0xe9f0('0xda')]=function(_0x2f65a6,_0x45edd9){if(_0x2f65a6[_0xe9f0('0x7f')]['id']){delete _0x2f65a6[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x2f65a6['params']['id']},'include':[{'model':db[_0xe9f0('0xdb')],'as':'Contact'}]})[_0xe9f0('0x21')](handleEntityNotFound(_0x45edd9,null))[_0xe9f0('0x21')](saveUpdates(_0x2f65a6[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](respondWithResult(_0x45edd9,null))[_0xe9f0('0x2b')](handleError(_0x45edd9,null));};exports[_0xe9f0('0xdc')]=function(_0x297e2b,_0x114c65,_0x5df944){if(_0x297e2b[_0xe9f0('0x7f')]['id']){delete _0x297e2b[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x297e2b[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](function(_0x1095d8){if(!_0x1095d8){logger[_0xe9f0('0x27')](_0xe9f0('0xdd'),_0xe9f0('0xdc'),0x194,_0xe9f0('0xde'));_0x114c65[_0xe9f0('0x2c')](0x194);}else{if(_0x1095d8[_0xe9f0('0x7e')]){throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))](_0xe9f0('0xdf'));}}return _0x1095d8;})['then'](function(_0x430b27){if(_0x430b27){return _0x430b27[_0xe9f0('0x37')]({'closed':_0x297e2b['body'][_0xe9f0('0xe0')],'disposition':_0x297e2b[_0xe9f0('0x7f')][_0xe9f0('0xe1')]})[_0xe9f0('0x21')](function(_0x5c34fa){return _0x5c34fa;});}})[_0xe9f0('0x21')](function(_0x3c80a4){return respondWithRpcPromise(_0xe9f0('0xe2'),_0xe9f0('0xdc'),_0x297e2b['body'],client9004);})[_0xe9f0('0x21')](respondWithResult(_0x114c65,null))['catch'](handleError(_0x114c65,null));};exports['attachmentUpload']=function(_0x14cad3,_0x4a98e8,_0x5cba30){_0x14cad3[_0xe9f0('0x7f')][_0xe9f0('0x3a')]=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe4')];_0x14cad3[_0xe9f0('0x7f')]['basename']=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe5')];_0x14cad3['body'][_0xe9f0('0x47')]=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe6')];return db[_0xe9f0('0xe7')][_0xe9f0('0xc6')](_0x14cad3[_0xe9f0('0x7f')])[_0xe9f0('0x21')](respondWithResult(_0x4a98e8,0xc9))[_0xe9f0('0x2b')](handleError(_0x4a98e8,null));};exports[_0xe9f0('0xe8')]=function(_0x5b2c15,_0x2446b3,_0x3a3c7c){return db['ChatInteraction'][_0xe9f0('0xe9')]({'where':{'id':_0x5b2c15[_0xe9f0('0xc7')]['id']},'raw':!![]})[_0xe9f0('0x21')](handleEntityNotFound(_0x2446b3,null))[_0xe9f0('0x21')](function(_0x327d68){if(_0x327d68){if(_0x327d68['closed']){return _0x2446b3['status'](0x193)[_0xe9f0('0x35')]({'status':0x193,'message':_0xe9f0('0xea')});}return db[_0xe9f0('0xe7')]['findOne']({'where':{'id':_0x5b2c15[_0xe9f0('0x4b')][_0xe9f0('0xeb')]},'raw':!![]})[_0xe9f0('0x21')](handleEntityNotFound(_0x2446b3,null));}})[_0xe9f0('0x21')](function(_0x48ba5a){if(_0x48ba5a){var _0xac14ad=_0x48ba5a[_0xe9f0('0xec')]!==null;var _0x123951=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],_0xe9f0('0xef'));if(_0xac14ad){_0x123951=path[_0xe9f0('0xed')](_0x123951,_0xe9f0('0xf0'));}var _0x302279=path[_0xe9f0('0xed')](_0x123951,_0x48ba5a[_0xe9f0('0xf1')]);return _0x2446b3[_0xe9f0('0xf2')](_0x302279);}})['catch'](handleError(_0x2446b3,null));};exports[_0xe9f0('0xf3')]=function(_0x473602,_0x3cadbd){var _0x58fe38=null;var _0x1b37f7=null;var _0x4a3765=null;var _0x5964af=null;if(_0x473602[_0xe9f0('0x7f')]['id']){delete _0x473602['body']['id'];}if(_0x473602[_0xe9f0('0x7f')]['mailTranscript']){_0x5964af=path['join'](config[_0xe9f0('0xee')],_0xe9f0('0xf4'),util[_0xe9f0('0xf5')]('transcript-%s.txt',Date[_0xe9f0('0xf6')]()));_0x473602[_0xe9f0('0x7f')][_0xe9f0('0xf7')]=_0x5964af;}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x473602[_0xe9f0('0xc7')]['id']},'include':[{'model':db[_0xe9f0('0xf8')],'as':_0xe9f0('0xf9'),'include':[{'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x7c')}]}]})[_0xe9f0('0x21')](handleEntityNotFound(_0x3cadbd,null))[_0xe9f0('0x21')](saveUpdates(_0x473602[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](function(_0x56a50c){if(_0x56a50c){_0x58fe38=_0x56a50c;return db[_0xe9f0('0xca')][_0xe9f0('0x6e')]({'where':{'id':_0x58fe38[_0xe9f0('0x83')]}});}})[_0xe9f0('0x21')](function(_0x2136dc){if(_0x2136dc){_0x4a3765=_0x2136dc;return db[_0xe9f0('0xdb')][_0xe9f0('0x6e')]({'where':{'id':_0x58fe38[_0xe9f0('0x75')]}});}})['then'](function(_0x296efe){if(_0x296efe){_0x1b37f7=_0x296efe;if(_0x5964af){var _0x504875=null;for(var _0x46e2fe=0x1;_0x46e2fe<_0x58fe38[_0xe9f0('0xf9')][_0xe9f0('0x50')];++_0x46e2fe){_0x504875=_0x58fe38[_0xe9f0('0xf9')][_0x46e2fe];var _0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')]('%s%d',_0x4a3765[_0xe9f0('0xfa')],_0x504875['UserId']):_0xe9f0('0xfb');var _0x419fdf=_0x473602['body']['customer']||util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0xe9f0('0xfd'),_0x504875[_0xe9f0('0x75')]);switch(_0x4a3765[_0xe9f0('0xfe')]){case _0xe9f0('0xff'):_0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0x4a3765[_0xe9f0('0xfa')],_0x504875[_0xe9f0('0x7e')]):_0xe9f0('0xfb');break;case _0xe9f0('0x100'):_0x329aa8=_0x504875['UserId']?_0x504875[_0xe9f0('0x7c')]['alias']||_0x504875['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb');break;case _0xe9f0('0x101'):_0x329aa8=_0x504875[_0xe9f0('0x7e')]?_0x504875['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb');break;default:_0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0x4a3765['agentAlias'],_0x504875[_0xe9f0('0x7e')]):_0xe9f0('0xfb');}var _0x5293e4=util[_0xe9f0('0xf5')]('[%s]\x20%s:\x20%s\x0a',moment(_0x504875[_0xe9f0('0x86')])[_0xe9f0('0xf5')](_0xe9f0('0x102')),_0x504875[_0xe9f0('0x103')]==='in'?_0x419fdf:_0x329aa8,_0x504875[_0xe9f0('0x7f')]);if(!_0x504875[_0xe9f0('0x104')]){fs[_0xe9f0('0x105')](_0x5964af,_0x5293e4);}}return db[_0xe9f0('0x106')][_0xe9f0('0xe9')]({'where':{'service':!![]},'include':[{'model':db[_0xe9f0('0x107')],'as':'Smtp','raw':!![]}]});}}})[_0xe9f0('0x21')](function(_0x52919a){if(_0x52919a&&_0x52919a[_0xe9f0('0x108')]&&_0x473602[_0xe9f0('0x7f')]){var _0x509bb7={'tls':{'rejectUnauthorized':![]}};if(_0x52919a['Smtp']['service']){_0x509bb7[_0xe9f0('0x109')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x109')];}else{_0x509bb7[_0xe9f0('0x10a')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x10a')];_0x509bb7[_0xe9f0('0x10b')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x10b')];_0x509bb7['secure']=_0x52919a['Smtp'][_0xe9f0('0x10c')];}if(_0x52919a['Smtp'][_0xe9f0('0x10d')]){_0x509bb7[_0xe9f0('0x10e')]={'user':_0x52919a[_0xe9f0('0x108')][_0xe9f0('0xa1')],'pass':_0x52919a[_0xe9f0('0x108')]['pass']};}return respondWithRpcPromise(_0xe9f0('0x10f'),_0xe9f0('0x110'),{'account':_0x509bb7,'message':{'from':util[_0xe9f0('0xf5')](_0xe9f0('0x111'),_0x52919a[_0xe9f0('0x3a')],_0x52919a['email']||_0x52919a[_0xe9f0('0x108')][_0xe9f0('0xa1')]),'to':_0x473602['body'][_0xe9f0('0x112')],'subject':_0xe9f0('0x113'),'text':util[_0xe9f0('0xf5')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x473602['body'][_0xe9f0('0x112')]),'attachments':[{'path':_0x5964af}]}})[_0xe9f0('0x21')](function(){return _0x58fe38;})[_0xe9f0('0x2b')](function(_0x4e4045){console['error'](_0x4e4045);});}else{return _0x58fe38;}})[_0xe9f0('0x21')](respondWithStatusCode(_0x3cadbd,0xc8))[_0xe9f0('0x2b')](handleError(_0x3cadbd,null));};exports[_0xe9f0('0x114')]=function(_0x4ee4f9,_0x3d4e42,_0x108042){return db[_0xe9f0('0xf8')][_0xe9f0('0x6e')]({'where':{'id':_0x4ee4f9[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x3d4e42,null))['then'](function(_0x218ee5){if(_0x218ee5){return _0x218ee5[_0xe9f0('0x114')](_0x4ee4f9[_0xe9f0('0x7f')][_0xe9f0('0x115')],_[_0xe9f0('0x116')](_0x4ee4f9[_0xe9f0('0x7f')],[_0xe9f0('0x115'),'id'])||{});}})[_0xe9f0('0x21')](respondWithResult(_0x3d4e42,null))[_0xe9f0('0x2b')](handleError(_0x3d4e42,null));};exports[_0xe9f0('0x117')]=function(_0x302ea1,_0x267c6d,_0x6f6f84){var _0xa4fd68={'raw':![],'where':{}};var _0x444df7={};var _0xd6a343={'count':0x0,'rows':[]};return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0x302ea1['params']['id']}})['then'](handleEntityNotFound(_0x267c6d,null))[_0xe9f0('0x21')](function(_0xfa1b2){if(_0xfa1b2){_0x444df7['model']=_[_0xe9f0('0x4c')](db['ChatMessage'][_0xe9f0('0x46')]);_0x444df7[_0xe9f0('0x4b')]=_['keys'](_0x302ea1[_0xe9f0('0x4b')]);_0x444df7['filters']=_[_0xe9f0('0x118')](_0x444df7['model'],_0x444df7['query']);_0xa4fd68[_0xe9f0('0x4e')]=_[_0xe9f0('0x118')](_0x444df7['model'],qs[_0xe9f0('0x4f')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x4f')]));_0xa4fd68[_0xe9f0('0x4e')]=_0xa4fd68[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0xa4fd68['attributes']:_0x444df7[_0xe9f0('0x49')];if(!_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x51')](_0xe9f0('0x52'))){_0xa4fd68['limit']=qs[_0xe9f0('0x31')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0xa4fd68[_0xe9f0('0x2f')]=qs[_0xe9f0('0x2f')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0xa4fd68[_0xe9f0('0x53')]=qs[_0xe9f0('0x119')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x119')]);_0xa4fd68[_0xe9f0('0x54')]=qs['filters'](_[_0xe9f0('0x55')](_0x302ea1[_0xe9f0('0x4b')],_0x444df7[_0xe9f0('0x4d')]));_0xa4fd68['where'][_0xe9f0('0xc0')]=_0xfa1b2['id'];if(_0x302ea1[_0xe9f0('0x4b')]['filter']){_0xa4fd68[_0xe9f0('0x54')]=_[_0xe9f0('0x3d')](_0xa4fd68[_0xe9f0('0x54')],{'$or':_[_0xe9f0('0x4a')](_0xa4fd68[_0xe9f0('0x4e')],function(_0x40b24c){var _0x71ea35={};_0x71ea35[_0x40b24c]={'$like':'%'+_0x302ea1['query']['filter']+'%'};return _0x71ea35;})});}if(_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x87')]){var _0x2ecef9=_0x302ea1['query'][_0xe9f0('0x87')]['split'](',');var _0x52a628={};_0x52a628[_0x2ecef9[0x0]]={'$gte':moment(_0x2ecef9[0x1])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))};_0xa4fd68['where']=_[_0xe9f0('0x3d')](_0xa4fd68[_0xe9f0('0x54')],_0x52a628);}_0xa4fd68=_[_0xe9f0('0x3d')]({},_0xa4fd68,_0x302ea1[_0xe9f0('0xc5')]);return db[_0xe9f0('0xf8')][_0xe9f0('0x32')]({'where':_0xa4fd68[_0xe9f0('0x54')]})[_0xe9f0('0x21')](function(_0x90b257){_0xd6a343[_0xe9f0('0x32')]=_0x90b257;if(_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0xc3')]){_0xa4fd68[_0xe9f0('0xc4')]=[{'all':!![]}];}return db[_0xe9f0('0xf8')][_0xe9f0('0x11b')](_0xa4fd68);})[_0xe9f0('0x21')](function(_0x48e968){_0xd6a343['rows']=_0x48e968;return _0xd6a343;});}})[_0xe9f0('0x21')](respondWithFilteredResult(_0x267c6d,_0xa4fd68))[_0xe9f0('0x2b')](handleError(_0x267c6d,null));};exports['getMyMessages']=function(_0xc39799,_0x5efe58,_0x216fe9){var _0x7cc418={'where':{}},_0x32805e={},_0x4a3225={'count':0x0,'rows':[]};return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0xc39799[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x5efe58,null))[_0xe9f0('0x21')](function(_0x2391b7){if(_0x2391b7){_0x32805e[_0xe9f0('0x49')]=_[_0xe9f0('0x4c')](db[_0xe9f0('0xf8')]['rawAttributes']);_0x32805e['query']=_[_0xe9f0('0x4c')](_0xc39799[_0xe9f0('0x4b')]);_0x32805e['filters']=_[_0xe9f0('0x118')](_0x32805e['model'],_0x32805e[_0xe9f0('0x4b')]);_0x7cc418[_0xe9f0('0x4e')]=_[_0xe9f0('0x118')](_0x32805e[_0xe9f0('0x49')],qs['fields'](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x4f')]));_0x7cc418[_0xe9f0('0x4e')]=_0x7cc418[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x7cc418[_0xe9f0('0x4e')]:_0x32805e[_0xe9f0('0x49')];if(!_0xc39799[_0xe9f0('0x4b')]['hasOwnProperty']('nolimit')){_0x7cc418[_0xe9f0('0x31')]=qs[_0xe9f0('0x31')](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0x7cc418['offset']=qs[_0xe9f0('0x2f')](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0x7cc418['order']=qs[_0xe9f0('0x119')](_0xc39799[_0xe9f0('0x4b')]['sort']);_0x7cc418[_0xe9f0('0x54')]=qs[_0xe9f0('0x4d')](_[_0xe9f0('0x55')](_0xc39799[_0xe9f0('0x4b')],_0x32805e[_0xe9f0('0x4d')]));_0x7cc418[_0xe9f0('0x54')]['ChatInteractionId']=_0x2391b7['id'];if(_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x92')]){_0x7cc418[_0xe9f0('0x54')]=_[_0xe9f0('0x3d')](_0x7cc418['where'],{'$or':_[_0xe9f0('0x4a')](_0x7cc418['attributes'],function(_0x1ad83c){var _0x388dad={};_0x388dad[_0x1ad83c]={'$like':'%'+_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x92')]+'%'};return _0x388dad;})});}_0x7cc418[_0xe9f0('0x54')][_0xe9f0('0x104')]=![];if(_0xc39799[_0xe9f0('0x4b')]['id']){_0x7cc418[_0xe9f0('0x54')]['id']={'$gt':_0xc39799['query']['id']};}_0x7cc418=_[_0xe9f0('0x3d')]({},_0x7cc418,_0xc39799[_0xe9f0('0xc5')]);return db[_0xe9f0('0xf8')][_0xe9f0('0x32')]({'where':_0x7cc418[_0xe9f0('0x54')]})['then'](function(_0x198900){_0x4a3225[_0xe9f0('0x32')]=_0x198900;_0x7cc418['include']=[];if(_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x11c')]){_0x7cc418['include'][_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':'User','attributes':['id',_0xe9f0('0x40'),_0xe9f0('0x11d')]});}if(_0xc39799['query']['includeAll']){_0x7cc418['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x7cc418);})[_0xe9f0('0x21')](function(_0x266c0f){_0x4a3225[_0xe9f0('0x11e')]=_0x266c0f;return _0x4a3225;});}})['then'](respondWithFilteredResult(_0x5efe58,_0x7cc418))[_0xe9f0('0x2b')](handleError(_0x5efe58,null));};exports[_0xe9f0('0x11f')]=function(_0x548542,_0xdd7ded,_0x16b798){return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x548542['params']['id']}})['then'](handleEntityNotFound(_0xdd7ded,null))['then'](function(_0x2ebe48){if(_0x2ebe48){return _0x2ebe48['setTags'](_0x548542[_0xe9f0('0x7f')]['ids'],_['omit'](_0x548542[_0xe9f0('0x7f')],['ids','id'])||{})[_0xe9f0('0x120')](function(){return db[_0xe9f0('0x79')][_0xe9f0('0x11b')]({'attributes':['id',_0xe9f0('0x3a'),'color'],'where':{'id':_0x548542[_0xe9f0('0x7f')]['ids']}});})[_0xe9f0('0x21')](function(_0x107363){socket[_0xe9f0('0x121')]('chatInteractionTags:save',{'id':Number(_0x548542[_0xe9f0('0xc7')]['id']),'tags':_0x107363||[]});return{'id':Number(_0x548542[_0xe9f0('0xc7')]['id']),'tags':_0x107363||[]};});}})[_0xe9f0('0x21')](respondWithResult(_0xdd7ded,null))['catch'](handleError(_0xdd7ded,null));};exports['removeTags']=function(_0x257fc2,_0x58c366,_0x306620){return db['ChatInteraction'][_0xe9f0('0x6e')]({'where':{'id':_0x257fc2[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x58c366,null))[_0xe9f0('0x21')](function(_0x13e1bd){if(_0x13e1bd){return _0x13e1bd[_0xe9f0('0x122')](_0x257fc2[_0xe9f0('0x4b')]['ids']);}})[_0xe9f0('0x21')](respondWithStatusCode(_0x58c366,null))['catch'](handleError(_0x58c366,null));};exports[_0xe9f0('0xf2')]=function(_0x37d384,_0x35de8c){var _0x1da405=moment()['unix']()[_0xe9f0('0xa6')]();var _0x1e3715=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],_0xe9f0('0x123'),'files',_0xe9f0('0x124'));var _0x31a744=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],'server',_0xe9f0('0x125'),_0xe9f0('0x126'));var _0x1cc3b2=path[_0xe9f0('0xed')](_0x1e3715,_0x1da405);var _0x450684=util[_0xe9f0('0xf5')](_0xe9f0('0x127'),_0x37d384['params']['id'],_0x1da405);var _0x2163d8=path[_0xe9f0('0xed')](_0x1e3715,_0x450684);var _0x2dd6d1=[];_0x2dd6d1[_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x7c'),'attributes':['id',_0xe9f0('0x40')],'raw':!![]});_0x2dd6d1[_0xe9f0('0xc1')]({'model':db['CmContact'],'as':_0xe9f0('0x128'),'attributes':['id',_0xe9f0('0x129'),'lastName'],'raw':!![]});if(_0x37d384[_0xe9f0('0x4b')][_0xe9f0('0x126')]){_0x2dd6d1[_0xe9f0('0xc1')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x36e6b0=[{'model':db['ChatMessage'],'as':_0xe9f0('0xf9'),'attributes':['id',_0xe9f0('0x7f'),_0xe9f0('0x86'),_0xe9f0('0x103'),'secret',_0xe9f0('0x8d')],'include':_0x2dd6d1}];_0x36e6b0['push']({'model':db['ChatWebsite'],'as':_0xe9f0('0x12a'),'attributes':['id',_0xe9f0('0x3a')]});_0x36e6b0[_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x12b'),'attributes':['id',_0xe9f0('0x40')]});return db['ChatInteraction'][_0xe9f0('0x6e')]({'where':{'id':_0x37d384['params']['id']},'include':_0x36e6b0})[_0xe9f0('0x21')](handleEntityNotFound(_0x35de8c,null))[_0xe9f0('0x21')](function(_0x193cb2){if(_0x193cb2){var _0x3cb18a=_0x193cb2['get']({'plain':!![]});fs[_0xe9f0('0x12c')](_0x1cc3b2);var _0x3e49a0={'channel':'Chat','account':_0x3cb18a[_0xe9f0('0x12a')][_0xe9f0('0x3a')],'agent':_0x3cb18a[_0xe9f0('0x12b')]?_0x3cb18a['Owner']['fullname']:'N.A.','createdAt':moment(_0x3cb18a[_0xe9f0('0x86')])[_0xe9f0('0xf5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9f0('0xa6')](),'closedAt':_0x3cb18a[_0xe9f0('0xe0')]?moment(_0x3cb18a[_0xe9f0('0x12d')])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))[_0xe9f0('0xa6')]():'','disposition':_0x3cb18a[_0xe9f0('0xe1')],'chatInfo':{'browser':_0x3cb18a[_0xe9f0('0x12e')],'os':_0x3cb18a['osName'],'referer':_0x3cb18a[_0xe9f0('0x12f')],'customerIp':_0x3cb18a[_0xe9f0('0x130')],'customerPort':_0x3cb18a[_0xe9f0('0x131')]?_0x3cb18a[_0xe9f0('0x131')]:_0xe9f0('0x132')},'messages':_(_0x3cb18a['Messages'])[_0xe9f0('0x133')]()['filter']({'secret':![]})[_0xe9f0('0x4a')](function(_0xa78163){if(_0xa78163[_0xe9f0('0xe7')]){var _0x3b422c=path[_0xe9f0('0xed')](_0x31a744,_0xa78163['Attachment'][_0xe9f0('0xf1')]);if(fs[_0xe9f0('0x134')](_0x3b422c)){fs['createReadStream'](_0x3b422c)[_0xe9f0('0x135')](fs[_0xe9f0('0x136')](path['join'](_0x1cc3b2,_0xa78163[_0xe9f0('0xe7')][_0xe9f0('0xf1')])));}}return{'date':moment(_0xa78163[_0xe9f0('0x86')])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))[_0xe9f0('0xa6')](),'sender':_0xa78163[_0xe9f0('0x103')]===_0xe9f0('0xd7')?_0xa78163[_0xe9f0('0x7c')]?_0xa78163['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb'):_0xa78163[_0xe9f0('0x128')]['firstName']+(_0xa78163['Contact'][_0xe9f0('0x137')]?'\x20'+_0xa78163[_0xe9f0('0x128')]['lastName']:''),'body':_0xa78163[_0xe9f0('0xe7')]?_0xa78163['Attachment']['basename']:_0xa78163['body'],'direction':_0xa78163['direction']===_0xe9f0('0xd7')?'A':'C','secret':_0xa78163[_0xe9f0('0x104')],'read':_0xa78163['read'],'attachment':_0xa78163[_0xe9f0('0xe7')]};})[_0xe9f0('0x72')]()};return ejs['renderFile'](path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],'server','views',_0xe9f0('0x138')),{'interaction':_0x3e49a0})['then'](function(_0x27f0d9){var _0x296c10=path[_0xe9f0('0xed')](_0x1cc3b2,_0xe9f0('0x139')+_0x3cb18a['id']+'-'+_0x1da405+'.pdf');var _0x484e2d={'path':_0x296c10,'channel':_0xe9f0('0x13a'),'interactionId':_0x3cb18a['id']};return pdf[_0xe9f0('0x13b')](_0x27f0d9,_0x484e2d);})[_0xe9f0('0x21')](function(){return new BPromise(function(_0x1cf653,_0x571169){zipdir(_0x1cc3b2,{'saveTo':_0x2163d8},function(_0x1f25ea,_0x524711){if(_0x1f25ea)return _0x571169(_0x1f25ea);return _0x1cf653(_0x524711);});})[_0xe9f0('0x21')](function(){return new BPromise(function(_0xbb7e33,_0x2e2fb9){rimraf(_0x1cc3b2,function(_0x51d788){if(_0x51d788)_0x2e2fb9(_0x51d788);return _0xbb7e33();});});})[_0xe9f0('0x21')](function(){return _0x35de8c[_0xe9f0('0xf2')](_0x2163d8,_0x450684,function(_0x4da74e){if(_0x4da74e){console['log'](_0xe9f0('0x13c'),_0x4da74e);}else{fs['unlinkSync'](_0x2163d8);}});});});}else{return _0x35de8c['sendStatus'](0xc8);}})[_0xe9f0('0x2b')](handleError(_0x35de8c,null));};
\ No newline at end of file
+var _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x40c4dd,_0x5b3f96){var _0x3f2776=function(_0x1eb9cf){while(--_0x1eb9cf){_0x40c4dd['push'](_0x40c4dd['shift']());}};_0x3f2776(++_0x5b3f96);}(_0x4fc2,0x111));var _0x24fc=function(_0x4bfedd,_0xddfbf8){_0x4bfedd=_0x4bfedd-0x0;var _0x2e925c=_0x4fc2[_0x4bfedd];return _0x2e925c;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));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('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));};
\ No newline at end of file
index 1e38fec..422aea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8088=['exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x8088,0x101));var _0x8808=function(_0x3dd087,_0x176b99){_0x3dd087=_0x3dd087-0x0;var _0x54ef1d=_0x8088[_0x3dd087];return _0x54ef1d;};'use strict';var EventEmitter=require(_0x8808('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x8808('0x1')];var ChatMessage=require(_0x8808('0x2'))['db'][_0x8808('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8808('0x4')](0x0);var events={'afterCreate':_0x8808('0x5'),'afterUpdate':_0x8808('0x6'),'afterDestroy':'remove'};function emitEvent(_0x240d75){return function(_0x5a53fa,_0x22ef86,_0x216b49){_0x5a53fa['getUsers']({'attributes':['id'],'raw':!![]})[_0x8808('0x7')](function(_0x3140c1){_0x5a53fa[_0x8808('0x8')]('Users',_0x3140c1['map'](function(_0xb2bcad){return{'id':_0xb2bcad['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5a53fa['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8808('0x7')](function(_0x4c1127){_0x5a53fa[_0x8808('0x8')](_0x8808('0x9'),_0x4c1127[_0x8808('0xa')]);ChatInteractionEvents[_0x8808('0xb')](_0x240d75+':'+_0x5a53fa['id'],_0x5a53fa);ChatInteractionEvents[_0x8808('0xb')](_0x240d75,_0x5a53fa);_0x216b49(null);})[_0x8808('0xc')](_0x216b49(null));};}for(var e in events){if(events[_0x8808('0xd')](e)){var event=events[e];ChatInteraction[_0x8808('0xe')](e,emitEvent(event));}}module[_0x8808('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9d2b=['exports','events','../../mysqldb','ChatMessage','save','update','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x27fa65,_0x4e02ee){var _0x456594=function(_0x43b6da){while(--_0x43b6da){_0x27fa65['push'](_0x27fa65['shift']());}};_0x456594(++_0x4e02ee);}(_0x9d2b,0x79));var _0xb9d2=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x9d2b[_0x56916d];return _0x2b7f1f;};'use strict';var EventEmitter=require(_0xb9d2('0x0'));var ChatInteraction=require(_0xb9d2('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xb9d2('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb9d2('0x3'),'afterUpdate':_0xb9d2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x292098){return function(_0x405623,_0x286ad0,_0x1e5796){_0x405623['getUsers']({'attributes':['id'],'raw':!![]})[_0xb9d2('0x5')](function(_0x5a7bc9){_0x405623[_0xb9d2('0x6')]('Users',_0x5a7bc9[_0xb9d2('0x7')](function(_0x4a93cd){return{'id':_0x4a93cd['id']};}));return ChatMessage[_0xb9d2('0x8')]({'where':{'ChatInteractionId':_0x405623['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb9d2('0x5')](function(_0x1f4458){_0x405623[_0xb9d2('0x6')]('unreadMessages',_0x1f4458[_0xb9d2('0x9')]);ChatInteractionEvents[_0xb9d2('0xa')](_0x292098+':'+_0x405623['id'],_0x405623);ChatInteractionEvents[_0xb9d2('0xa')](_0x292098,_0x405623);_0x1e5796(null);})[_0xb9d2('0xb')](_0x1e5796(null));};}for(var e in events){if(events[_0xb9d2('0xc')](e)){var event=events[e];ChatInteraction[_0xb9d2('0xd')](e,emitEvent(event));}}module[_0xb9d2('0xe')]=ChatInteractionEvents;
\ No newline at end of file
index 8fa6a9b..c740556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb5=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xdeb5,0x70));var _0x5deb=function(_0xb40054,_0x54b30e){_0xb40054=_0xb40054-0x0;var _0x15cc8e=_0xdeb5[_0xb40054];return _0x15cc8e;};'use strict';var _=require(_0x5deb('0x0'));var util=require(_0x5deb('0x1'));var logger=require(_0x5deb('0x2'))(_0x5deb('0x3'));var moment=require('moment');var BPromise=require(_0x5deb('0x4'));var rp=require(_0x5deb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5deb('0x6'));var config=require(_0x5deb('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x5deb('0x8')]=function(_0x31bad7,_0x6aeefe){return _0x31bad7[_0x5deb('0x9')](_0x5deb('0xa'),attributes,{'tableName':_0x5deb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29acee,_0x5f0af1,_0x56c160){if(_0x29acee[_0x5deb('0xc')](_0x5deb('0xd'))){_0x29acee['closedAt']=moment()['format'](_0x5deb('0xe'));}_0x56c160(null,_0x29acee);}},'charset':_0x5deb('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6b9c=['lodash','util','api','moment','bluebird','path','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x465cb7,_0x4d1e5e){var _0x2f9ae5=function(_0x5cda38){while(--_0x5cda38){_0x465cb7['push'](_0x465cb7['shift']());}};_0x2f9ae5(++_0x4d1e5e);}(_0x6b9c,0x190));var _0xc6b9=function(_0x4b17c5,_0x5710d4){_0x4b17c5=_0x4b17c5-0x0;var _0x5eed8c=_0x6b9c[_0x4b17c5];return _0x5eed8c;};'use strict';var _=require(_0xc6b9('0x0'));var util=require(_0xc6b9('0x1'));var logger=require('../../config/logger')(_0xc6b9('0x2'));var moment=require(_0xc6b9('0x3'));var BPromise=require(_0xc6b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6b9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc6b9('0x6'));module[_0xc6b9('0x7')]=function(_0x4d809b,_0x58a615){return _0x4d809b[_0xc6b9('0x8')](_0xc6b9('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d787a,_0x1b7de7,_0x109a42){if(_0x2d787a[_0xc6b9('0xa')](_0xc6b9('0xb'))){_0x2d787a[_0xc6b9('0xc')]=moment()['format'](_0xc6b9('0xd'));}_0x109a42(null,_0x2d787a);}},'charset':_0xc6b9('0xe'),'collate':_0xc6b9('0xf')});};
\ No newline at end of file
index c0cd5c2..15b1bff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x275a=['bluebird','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','info','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x275a,0x6c));var _0xa275=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x275a[_0x28611e];return _0x530f69;};'use strict';var _=require(_0xa275('0x0'));var util=require(_0xa275('0x1'));var moment=require(_0xa275('0x2'));var BPromise=require(_0xa275('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa275('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa275('0x5'));var jayson=require(_0xa275('0x6'));var client=jayson['client'][_0xa275('0x7')]({'port':0x232a});config['redis']=_[_0xa275('0x8')](config[_0xa275('0x9')],{'host':_0xa275('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa275('0xb'))[_0xa275('0xc')](socket);function respondWithRpcPromise(_0x594fe3,_0x539fe6,_0x52c958){return new BPromise(function(_0x2d2d86,_0x5e4f90){return client['request'](_0x594fe3,_0x52c958)[_0xa275('0xd')](function(_0x5509d8){logger['info'](_0xa275('0xe'),_0x539fe6,_0xa275('0xf'));logger[_0xa275('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x539fe6,_0xa275('0xf'),JSON[_0xa275('0x11')](_0x5509d8));if(_0x5509d8[_0xa275('0x12')]){if(_0x5509d8[_0xa275('0x12')]['code']===0x1f4){logger['error'](_0xa275('0xe'),_0x539fe6,_0x5509d8[_0xa275('0x12')][_0xa275('0x13')]);return _0x5e4f90(_0x5509d8['error']['message']);}logger[_0xa275('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x539fe6,_0x5509d8[_0xa275('0x12')]['message']);return _0x2d2d86(_0x5509d8['error'][_0xa275('0x13')]);}else{logger['info'](_0xa275('0xe'),_0x539fe6,'request\x20sent');_0x2d2d86(_0x5509d8['result'][_0xa275('0x13')]);}})[_0xa275('0x14')](function(_0xdcfd58){logger[_0xa275('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x539fe6,_0xdcfd58);_0x5e4f90(_0xdcfd58);});});}exports[_0xa275('0x15')]=function(_0x579bc5){var _0x57ee0b=this;return new Promise(function(_0x36f369,_0x5192e9){return db[_0xa275('0x16')][_0xa275('0x17')](_0x579bc5[_0xa275('0x18')],{'raw':_0x579bc5[_0xa275('0x19')]?_0x579bc5[_0xa275('0x19')][_0xa275('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579bc5[_0xa275('0x19')]?_0x579bc5['options'][_0xa275('0x1b')]||null:null,'attributes':_0x579bc5[_0xa275('0x19')]?_0x579bc5[_0xa275('0x19')]['attributes']||null:null,'limit':_0x579bc5[_0xa275('0x19')]?_0x579bc5[_0xa275('0x19')][_0xa275('0x1c')]||null:null})[_0xa275('0xd')](function(_0x515b4d){logger[_0xa275('0x1d')](_0xa275('0x15'),_0x579bc5);logger['debug'](_0xa275('0x15'),_0x579bc5,JSON[_0xa275('0x11')](_0x515b4d));_0x36f369(_0x515b4d);})['catch'](function(_0x3f2e30){logger[_0xa275('0x12')](_0xa275('0x15'),_0x3f2e30[_0xa275('0x13')],_0x579bc5);_0x5192e9(_0x57ee0b['error'](0x1f4,_0x3f2e30[_0xa275('0x13')]));});});};exports[_0xa275('0x1e')]=function(_0x3d8530){return new Promise(function(_0x289c17,_0x8205a0){return db[_0xa275('0x16')][_0xa275('0x1f')]({'where':_0x3d8530[_0xa275('0x19')]?_0x3d8530['options'][_0xa275('0x1b')]||null:null})[_0xa275('0xd')](function(_0x363667){if(_0x363667){return _0x363667[_0xa275('0x20')](_0x3d8530['body'][_0xa275('0x21')],_[_0xa275('0x22')](_0x3d8530[_0xa275('0x18')],[_0xa275('0x21'),'id'])||{});}})[_0xa275('0x23')](function(_0x17d7c1){logger['info']('AddTags',_0x3d8530);logger[_0xa275('0x10')](_0xa275('0x24'),_0x3d8530,JSON[_0xa275('0x11')](_0x17d7c1));_0x289c17(_0x17d7c1);})[_0xa275('0x14')](function(_0x39cad1){logger[_0xa275('0x12')]('AddTags',_0x39cad1['message'],_0x3d8530);_0x8205a0(_this['error'](0x1f4,_0x39cad1[_0xa275('0x13')]));});});};
\ No newline at end of file
+var _0xd925=['info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateChatInteraction','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','ChatInteraction','find','addTags','body','ids','omit','spread','debug','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x52c53e,_0xc63215){var _0x1f8c9b=function(_0x13d07a){while(--_0x13d07a){_0x52c53e['push'](_0x52c53e['shift']());}};_0x1f8c9b(++_0xc63215);}(_0xd925,0xf0));var _0x5d92=function(_0x13efa4,_0x432c5c){_0x13efa4=_0x13efa4-0x0;var _0x592491=_0xd925[_0x13efa4];return _0x592491;};'use strict';var _=require(_0x5d92('0x0'));var util=require(_0x5d92('0x1'));var moment=require('moment');var BPromise=require(_0x5d92('0x2'));var rs=require(_0x5d92('0x3'));var fs=require('fs');var Redis=require(_0x5d92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d92('0x5'));var logger=require(_0x5d92('0x6'))(_0x5d92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d92('0x8')][_0x5d92('0x9')]({'port':0x232a});config[_0x5d92('0xa')]=_[_0x5d92('0xb')](config['redis'],{'host':_0x5d92('0xc'),'port':0x18eb});var socket=require(_0x5d92('0xd'))(new Redis(config[_0x5d92('0xa')]));require(_0x5d92('0xe'))[_0x5d92('0xf')](socket);function respondWithRpcPromise(_0x466d26,_0x39de36,_0x5891dc){return new BPromise(function(_0x5c581d,_0x5ba44b){return client[_0x5d92('0x10')](_0x466d26,_0x5891dc)[_0x5d92('0x11')](function(_0x40668c){logger[_0x5d92('0x12')](_0x5d92('0x13'),_0x39de36,_0x5d92('0x14'));logger['debug'](_0x5d92('0x15'),_0x39de36,_0x5d92('0x14'),JSON['stringify'](_0x40668c));if(_0x40668c[_0x5d92('0x16')]){if(_0x40668c[_0x5d92('0x16')][_0x5d92('0x17')]===0x1f4){logger[_0x5d92('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x39de36,_0x40668c[_0x5d92('0x16')][_0x5d92('0x18')]);return _0x5ba44b(_0x40668c[_0x5d92('0x16')][_0x5d92('0x18')]);}logger[_0x5d92('0x16')](_0x5d92('0x13'),_0x39de36,_0x40668c[_0x5d92('0x16')]['message']);return _0x5c581d(_0x40668c[_0x5d92('0x16')][_0x5d92('0x18')]);}else{logger[_0x5d92('0x12')](_0x5d92('0x13'),_0x39de36,_0x5d92('0x14'));_0x5c581d(_0x40668c['result'][_0x5d92('0x18')]);}})['catch'](function(_0x236e52){logger[_0x5d92('0x16')](_0x5d92('0x13'),_0x39de36,_0x236e52);_0x5ba44b(_0x236e52);});});}exports[_0x5d92('0x19')]=function(_0xb15641){var _0x570635=this;return new Promise(function(_0x47e739,_0x18f981){return db['ChatInteraction']['update'](_0xb15641['body'],{'raw':_0xb15641[_0x5d92('0x1a')]?_0xb15641[_0x5d92('0x1a')][_0x5d92('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb15641[_0x5d92('0x1a')]?_0xb15641[_0x5d92('0x1a')][_0x5d92('0x1c')]||null:null,'attributes':_0xb15641[_0x5d92('0x1a')]?_0xb15641[_0x5d92('0x1a')][_0x5d92('0x1d')]||null:null,'limit':_0xb15641[_0x5d92('0x1a')]?_0xb15641['options'][_0x5d92('0x1e')]||null:null})[_0x5d92('0x11')](function(_0x338d53){logger[_0x5d92('0x12')](_0x5d92('0x19'),_0xb15641);logger['debug']('UpdateChatInteraction',_0xb15641,JSON['stringify'](_0x338d53));_0x47e739(_0x338d53);})[_0x5d92('0x1f')](function(_0x5a9a94){logger[_0x5d92('0x16')](_0x5d92('0x19'),_0x5a9a94[_0x5d92('0x18')],_0xb15641);_0x18f981(_0x570635[_0x5d92('0x16')](0x1f4,_0x5a9a94['message']));});});};exports[_0x5d92('0x20')]=function(_0xcf46c1){return new Promise(function(_0x5c811d,_0x2294e8){return db[_0x5d92('0x21')][_0x5d92('0x22')]({'where':_0xcf46c1['options']?_0xcf46c1[_0x5d92('0x1a')][_0x5d92('0x1c')]||null:null})[_0x5d92('0x11')](function(_0x552b1d){if(_0x552b1d){return _0x552b1d[_0x5d92('0x23')](_0xcf46c1[_0x5d92('0x24')][_0x5d92('0x25')],_[_0x5d92('0x26')](_0xcf46c1[_0x5d92('0x24')],[_0x5d92('0x25'),'id'])||{});}})[_0x5d92('0x27')](function(_0x32fabc){logger[_0x5d92('0x12')]('AddTags',_0xcf46c1);logger[_0x5d92('0x28')](_0x5d92('0x29'),_0xcf46c1,JSON[_0x5d92('0x2a')](_0x32fabc));_0x5c811d(_0x32fabc);})[_0x5d92('0x1f')](function(_0x2e80e8){logger[_0x5d92('0x16')](_0x5d92('0x29'),_0x2e80e8[_0x5d92('0x18')],_0xcf46c1);_0x2294e8(_this['error'](0x1f4,_0x2e80e8[_0x5d92('0x18')]));});});};
\ No newline at end of file
index 0add4c3..fbbe5ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa26a=['remove','update','emit','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x53e90d,_0x3546fc){var _0x443b0f=function(_0x46ccbd){while(--_0x46ccbd){_0x53e90d['push'](_0x53e90d['shift']());}};_0x443b0f(++_0x3546fc);}(_0xa26a,0x1e6));var _0xaa26=function(_0x1d3eae,_0x5cd263){_0x1d3eae=_0x1d3eae-0x0;var _0x432dd0=_0xa26a[_0x1d3eae];return _0x432dd0;};'use strict';var ChatInteractionEvents=require(_0xaa26('0x0'));var events=[_0xaa26('0x1'),_0xaa26('0x2'),_0xaa26('0x3')];function createListener(_0x290dae,_0x32248c){return function(_0x4a3f31){_0x32248c[_0xaa26('0x4')](_0x290dae,_0x4a3f31);};}function removeListener(_0x13d122,_0x3ccedd){return function(){ChatInteractionEvents['removeListener'](_0x13d122,_0x3ccedd);};}exports[_0xaa26('0x5')]=function(_0x52b54d){for(var _0x1be84a=0x0,_0x4ec5a=events[_0xaa26('0x6')];_0x1be84a<_0x4ec5a;_0x1be84a++){var _0x59e2a3=events[_0x1be84a];var _0x2135ff=createListener(_0xaa26('0x7')+_0x59e2a3,_0x52b54d);ChatInteractionEvents['on'](_0x59e2a3,_0x2135ff);}};
\ No newline at end of file
+var _0x3ec1=['update','emit','removeListener','chatInteraction:','./chatInteraction.events','save'];(function(_0xefca73,_0x2d7ab4){var _0x198ee5=function(_0x13117b){while(--_0x13117b){_0xefca73['push'](_0xefca73['shift']());}};_0x198ee5(++_0x2d7ab4);}(_0x3ec1,0x9a));var _0x13ec=function(_0x482bd9,_0x59faf1){_0x482bd9=_0x482bd9-0x0;var _0x2354b2=_0x3ec1[_0x482bd9];return _0x2354b2;};'use strict';var ChatInteractionEvents=require(_0x13ec('0x0'));var events=[_0x13ec('0x1'),'remove',_0x13ec('0x2')];function createListener(_0x5522c9,_0x33d941){return function(_0x59c325){_0x33d941[_0x13ec('0x3')](_0x5522c9,_0x59c325);};}function removeListener(_0x22dcd7,_0x1c09bb){return function(){ChatInteractionEvents[_0x13ec('0x4')](_0x22dcd7,_0x1c09bb);};}exports['register']=function(_0x57061){for(var _0x3e8693=0x0,_0x68a4af=events['length'];_0x3e8693<_0x68a4af;_0x3e8693++){var _0x2ccaf2=events[_0x3e8693];var _0x18d614=createListener(_0x13ec('0x5')+_0x2ccaf2,_0x57061);ChatInteractionEvents['on'](_0x2ccaf2,_0x18d614);}};
\ No newline at end of file
index 827a221..461e2f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45cd=['getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','isAuthenticated'];(function(_0x47990f,_0x4e96d0){var _0x4b3674=function(_0x430320){while(--_0x430320){_0x47990f['push'](_0x47990f['shift']());}};_0x4b3674(++_0x4e96d0);}(_0x45cd,0xc7));var _0xd45c=function(_0x8e6d4d,_0x4f222c){_0x8e6d4d=_0x8e6d4d-0x0;var _0x9ae241=_0x45cd[_0x8e6d4d];return _0x9ae241;};'use strict';var multer=require(_0xd45c('0x0'));var util=require(_0xd45c('0x1'));var path=require(_0xd45c('0x2'));var timeout=require(_0xd45c('0x3'));var express=require(_0xd45c('0x4'));var router=express[_0xd45c('0x5')]();var fs_extra=require(_0xd45c('0x6'));var auth=require(_0xd45c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd45c('0x8'));router[_0xd45c('0x9')]('/',auth['isAuthenticated'](),controller[_0xd45c('0xa')]);router[_0xd45c('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xd45c('0xb')]);router[_0xd45c('0x9')](_0xd45c('0xc'),auth[_0xd45c('0xd')](),controller[_0xd45c('0xe')]);router[_0xd45c('0x9')]('/:id/attachment_download',auth[_0xd45c('0xd')](),controller[_0xd45c('0xf')]);router[_0xd45c('0x9')]('/:id/messages',auth[_0xd45c('0x10')](),controller[_0xd45c('0x11')]);router['get'](_0xd45c('0x12'),auth[_0xd45c('0xd')](),controller[_0xd45c('0x13')]);router['get'](_0xd45c('0x14'),auth[_0xd45c('0x10')](),controller[_0xd45c('0x15')]);router[_0xd45c('0x16')]('/',auth[_0xd45c('0x10')](),controller['create']);router[_0xd45c('0x16')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0xd45c('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x411c60,_0x525a82,_0x5d3101){_0x5d3101(null,path[_0xd45c('0x18')](config[_0xd45c('0x19')],_0xd45c('0x1a')));},'filename':function(_0x20bb8c,_0x5ee6a5,_0x39b9fc){_0x39b9fc(null,util[_0xd45c('0x1b')](_0xd45c('0x1c'),Date[_0xd45c('0x1d')](),_0x5ee6a5['originalname'][_0xd45c('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd45c('0x16')](_0xd45c('0x1f'),upload[_0xd45c('0x20')](_0xd45c('0x21')),controller[_0xd45c('0x22')]);router['post'](_0xd45c('0x23'),auth[_0xd45c('0xd')](),controller[_0xd45c('0x24')]);router[_0xd45c('0x16')](_0xd45c('0x25'),auth[_0xd45c('0x10')](),interaction[_0xd45c('0x26')](_0xd45c('0x27'),_0xd45c('0x28')),controller[_0xd45c('0x29')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked']('chat',_0xd45c('0x2a')),controller['update']);router[_0xd45c('0x2b')](_0xd45c('0x2c'),controller[_0xd45c('0x2d')]);router[_0xd45c('0x2b')](_0xd45c('0x2e'),auth[_0xd45c('0xd')](),controller[_0xd45c('0x2f')]);router[_0xd45c('0x2b')](_0xd45c('0x30'),controller[_0xd45c('0x31')]);router[_0xd45c('0x32')](_0xd45c('0xc'),auth[_0xd45c('0x10')](),interaction[_0xd45c('0x26')]('chat','chatinteraction:destroy'),controller[_0xd45c('0x33')]);router['delete'](_0xd45c('0x25'),auth[_0xd45c('0x10')](),controller[_0xd45c('0x34')]);module[_0xd45c('0x35')]=router;
\ No newline at end of file
+var _0x1e79=['../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4526f4,_0x46019f){var _0x51cd7a=function(_0x420c96){while(--_0x420c96){_0x4526f4['push'](_0x4526f4['shift']());}};_0x51cd7a(++_0x46019f);}(_0x1e79,0xd8));var _0x91e7=function(_0x4d8fc1,_0x1cd044){_0x4d8fc1=_0x4d8fc1-0x0;var _0x3bf05a=_0x1e79[_0x4d8fc1];return _0x3bf05a;};'use strict';var multer=require('multer');var util=require(_0x91e7('0x0'));var path=require(_0x91e7('0x1'));var timeout=require(_0x91e7('0x2'));var express=require(_0x91e7('0x3'));var router=express[_0x91e7('0x4')]();var fs_extra=require(_0x91e7('0x5'));var auth=require(_0x91e7('0x6'));var interaction=require(_0x91e7('0x7'));var config=require(_0x91e7('0x8'));var controller=require(_0x91e7('0x9'));router[_0x91e7('0xa')]('/',auth['isAuthenticated'](),controller[_0x91e7('0xb')]);router[_0x91e7('0xa')](_0x91e7('0xc'),auth[_0x91e7('0xd')](),controller[_0x91e7('0xe')]);router[_0x91e7('0xa')](_0x91e7('0xf'),auth[_0x91e7('0x10')](),controller[_0x91e7('0x11')]);router[_0x91e7('0xa')]('/:id/attachment_download',auth[_0x91e7('0x10')](),controller[_0x91e7('0x12')]);router[_0x91e7('0xa')](_0x91e7('0x13'),auth['isAuthenticated'](),controller[_0x91e7('0x14')]);router['get'](_0x91e7('0x15'),auth[_0x91e7('0x10')](),controller['getMyMessages']);router[_0x91e7('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x91e7('0x16')]);router[_0x91e7('0x17')]('/',auth[_0x91e7('0xd')](),controller[_0x91e7('0x18')]);router[_0x91e7('0x17')](_0x91e7('0x19'),auth[_0x91e7('0xd')](),controller[_0x91e7('0x1a')]);var upload=multer({'storage':multer[_0x91e7('0x1b')]({'destination':function(_0x34d6ac,_0x5be7e1,_0x10f01f){_0x10f01f(null,path[_0x91e7('0x1c')](config[_0x91e7('0x1d')],_0x91e7('0x1e')));},'filename':function(_0x1bf2d6,_0x4c7b8d,_0x4416b3){_0x4416b3(null,util[_0x91e7('0x1f')](_0x91e7('0x20'),Date[_0x91e7('0x21')](),_0x4c7b8d[_0x91e7('0x22')][_0x91e7('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x91e7('0x24')](_0x91e7('0x25')),controller['attachmentUpload']);router['post'](_0x91e7('0x13'),auth[_0x91e7('0x10')](),controller[_0x91e7('0x26')]);router[_0x91e7('0x17')](_0x91e7('0x27'),auth[_0x91e7('0xd')](),interaction['tracked']('chat',_0x91e7('0x28')),controller[_0x91e7('0x29')]);router[_0x91e7('0x2a')](_0x91e7('0xf'),auth[_0x91e7('0xd')](),interaction[_0x91e7('0x2b')](_0x91e7('0x2c'),_0x91e7('0x2d')),controller[_0x91e7('0x2e')]);router[_0x91e7('0x2a')](_0x91e7('0x2f'),controller[_0x91e7('0x30')]);router[_0x91e7('0x2a')](_0x91e7('0x31'),auth['isChatInteractionAuthorized'](),controller[_0x91e7('0x32')]);router[_0x91e7('0x2a')]('/:id/close',controller[_0x91e7('0x33')]);router[_0x91e7('0x34')](_0x91e7('0xf'),auth[_0x91e7('0xd')](),interaction[_0x91e7('0x2b')](_0x91e7('0x2c'),'chatinteraction:destroy'),controller[_0x91e7('0x35')]);router[_0x91e7('0x34')](_0x91e7('0x27'),auth[_0x91e7('0xd')](),controller[_0x91e7('0x36')]);module[_0x91e7('0x37')]=router;
\ No newline at end of file
index f8b6551..b33c601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf3d=['medium','BOOLEAN','sequelize','exports'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xaf3d,0xfe));var _0xdaf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf3d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdaf3('0x0'));module[_0xdaf3('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdaf3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdaf3('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xef4d=['sequelize','exports','medium','INTEGER'];(function(_0x219379,_0x53362a){var _0x57fa33=function(_0x98d5d3){while(--_0x98d5d3){_0x219379['push'](_0x219379['shift']());}};_0x57fa33(++_0x53362a);}(_0xef4d,0x17c));var _0xdef4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xef4d[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xdef4('0x0'));module[_0xdef4('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdef4('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdef4('0x3')]}};
\ No newline at end of file
index 00e27c7..a00069c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ca5=['online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','isEmpty','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','internal'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x5ca5,0xf8));var _0x55ca=function(_0x24de68,_0x409b0c){_0x24de68=_0x24de68-0x0;var _0x2f32a4=_0x5ca5[_0x24de68];return _0x2f32a4;};'use strict';var emlformat=require(_0x55ca('0x0'));var rimraf=require(_0x55ca('0x1'));var zipdir=require(_0x55ca('0x2'));var jsonpatch=require(_0x55ca('0x3'));var rp=require(_0x55ca('0x4'));var moment=require(_0x55ca('0x5'));var BPromise=require(_0x55ca('0x6'));var Mustache=require(_0x55ca('0x7'));var util=require(_0x55ca('0x8'));var path=require(_0x55ca('0x9'));var sox=require('sox');var csv=require(_0x55ca('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55ca('0xb'));var _=require(_0x55ca('0xc'));var squel=require(_0x55ca('0xd'));var crypto=require(_0x55ca('0xe'));var jsforce=require(_0x55ca('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x55ca('0xa'));var querystring=require('querystring');var Papa=require(_0x55ca('0x10'));var Redis=require(_0x55ca('0x11'));var authService=require(_0x55ca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x55ca('0x13'));var hardwareService=require(_0x55ca('0x14'));var logger=require(_0x55ca('0x15'))(_0x55ca('0x16'));var utils=require(_0x55ca('0x17'));var config=require(_0x55ca('0x18'));var licenseUtil=require(_0x55ca('0x19'));var db=require(_0x55ca('0x1a'))['db'];config[_0x55ca('0x1b')]=_[_0x55ca('0x1c')](config['redis'],{'host':_0x55ca('0x1d'),'port':0x18eb});var socket=require(_0x55ca('0x1e'))(new Redis(config['redis']));require(_0x55ca('0x1f'))['register'](socket);function respondWithStatusCode(_0x4d91ba,_0x3c4682){_0x3c4682=_0x3c4682||0xcc;return function(_0x3b9a25){if(_0x3b9a25){return _0x4d91ba['sendStatus'](_0x3c4682);}return _0x4d91ba[_0x55ca('0x20')](_0x3c4682)[_0x55ca('0x21')]();};}function respondWithResult(_0x55d8df,_0xe6e48c){_0xe6e48c=_0xe6e48c||0xc8;return function(_0x3d61eb){if(_0x3d61eb){return _0x55d8df[_0x55ca('0x20')](_0xe6e48c)[_0x55ca('0x22')](_0x3d61eb);}};}function respondWithFilteredResult(_0xef4a61,_0x551a38){return function(_0x1e53a6){if(_0x1e53a6){var _0x5c28ec=typeof _0x551a38[_0x55ca('0x23')]===_0x55ca('0x24')&&typeof _0x551a38['limit']===_0x55ca('0x24');var _0x546da6=_0x1e53a6[_0x55ca('0x25')];var _0x3fcdc6=_0x5c28ec?0x0:_0x551a38[_0x55ca('0x23')];var _0x383d5a=_0x5c28ec?_0x1e53a6[_0x55ca('0x25')]:_0x551a38[_0x55ca('0x23')]+_0x551a38[_0x55ca('0x26')];var _0x2ebd2e;if(_0x383d5a>=_0x546da6){_0x383d5a=_0x546da6;_0x2ebd2e=0xc8;}else{_0x2ebd2e=0xce;}_0xef4a61[_0x55ca('0x20')](_0x2ebd2e);return _0xef4a61[_0x55ca('0x27')]('Content-Range',_0x3fcdc6+'-'+_0x383d5a+'/'+_0x546da6)[_0x55ca('0x22')](_0x1e53a6);}return null;};}function patchUpdates(_0x1df9c2){return function(_0x3ec35a){try{jsonpatch[_0x55ca('0x28')](_0x3ec35a,_0x1df9c2,!![]);}catch(_0x1a1560){return BPromise[_0x55ca('0x29')](_0x1a1560);}return _0x3ec35a[_0x55ca('0x2a')]();};}function saveUpdates(_0x11da87,_0xe2251d){return function(_0x2b34df){if(_0x2b34df){return _0x2b34df[_0x55ca('0x2b')](_0x11da87)[_0x55ca('0x2c')](function(_0x526d21){return _0x526d21;});}return null;};}function removeEntity(_0x40cc11,_0x5aaf76){return function(_0xec628b){if(_0xec628b){return _0xec628b[_0x55ca('0x2d')]()[_0x55ca('0x2c')](function(){_0x40cc11[_0x55ca('0x20')](0xcc)[_0x55ca('0x21')]();});}};}function handleEntityNotFound(_0x4e0f24,_0x1af53b){return function(_0x14fadb){if(!_0x14fadb){_0x4e0f24[_0x55ca('0x2e')](0x194);}return _0x14fadb;};}function handleError(_0x5c9dfc,_0x272059){_0x272059=_0x272059||0x1f4;return function(_0x708cf3){logger[_0x55ca('0x2f')](_0x708cf3['stack']);if(_0x708cf3[_0x55ca('0x30')]){delete _0x708cf3[_0x55ca('0x30')];}_0x5c9dfc[_0x55ca('0x20')](_0x272059)[_0x55ca('0x31')](_0x708cf3);};}exports[_0x55ca('0x32')]=function(_0x4caef3,_0x2d6f68){var _0x32e365={},_0x18dd35={},_0x1fd54a={'count':0x0,'rows':[]};var _0x1a67a0=_[_0x55ca('0x33')](db[_0x55ca('0x34')][_0x55ca('0x35')],function(_0x1dc328){return{'name':_0x1dc328['fieldName'],'type':_0x1dc328[_0x55ca('0x36')][_0x55ca('0x37')]};});_0x18dd35['model']=_['map'](_0x1a67a0,'name');_0x18dd35['query']=_[_0x55ca('0x38')](_0x4caef3[_0x55ca('0x39')]);_0x18dd35[_0x55ca('0x3a')]=_['intersection'](_0x18dd35[_0x55ca('0x3b')],_0x18dd35[_0x55ca('0x39')]);_0x32e365[_0x55ca('0x3c')]=_[_0x55ca('0x3d')](_0x18dd35[_0x55ca('0x3b')],qs['fields'](_0x4caef3[_0x55ca('0x39')][_0x55ca('0x3e')]));_0x32e365[_0x55ca('0x3c')]=_0x32e365[_0x55ca('0x3c')][_0x55ca('0x3f')]?_0x32e365['attributes']:_0x18dd35['model'];if(!_0x4caef3[_0x55ca('0x39')][_0x55ca('0x40')](_0x55ca('0x41'))){_0x32e365[_0x55ca('0x26')]=qs['limit'](_0x4caef3[_0x55ca('0x39')][_0x55ca('0x26')]);_0x32e365['offset']=qs[_0x55ca('0x23')](_0x4caef3[_0x55ca('0x39')][_0x55ca('0x23')]);}_0x32e365['order']=qs['sort'](_0x4caef3[_0x55ca('0x39')]['sort']);_0x32e365[_0x55ca('0x42')]=qs['filters'](_[_0x55ca('0x43')](_0x4caef3[_0x55ca('0x39')],_0x18dd35['filters']),_0x1a67a0);if(_0x4caef3[_0x55ca('0x39')]['filter']){_0x32e365[_0x55ca('0x42')]=_['merge'](_0x32e365[_0x55ca('0x42')],{'$or':_[_0x55ca('0x33')](_0x1a67a0,function(_0x1a6565){if(_0x1a6565[_0x55ca('0x36')]!=='VIRTUAL'){var _0x271bd0={};_0x271bd0[_0x1a6565['name']]={'$like':'%'+_0x4caef3[_0x55ca('0x39')][_0x55ca('0x44')]+'%'};return _0x271bd0;}})});}_0x32e365=_[_0x55ca('0x45')]({},_0x32e365,_0x4caef3[_0x55ca('0x46')]);var _0x57a8ed={'where':_0x32e365['where']};return db[_0x55ca('0x34')][_0x55ca('0x25')](_0x57a8ed)[_0x55ca('0x2c')](function(_0x432d64){_0x1fd54a[_0x55ca('0x25')]=_0x432d64;if(_0x4caef3[_0x55ca('0x39')][_0x55ca('0x47')]){_0x32e365[_0x55ca('0x48')]=[{'all':!![]}];}return db[_0x55ca('0x34')][_0x55ca('0x49')](_0x32e365);})[_0x55ca('0x2c')](function(_0x446228){_0x1fd54a[_0x55ca('0x4a')]=_0x446228;return _0x1fd54a;})['then'](respondWithFilteredResult(_0x2d6f68,_0x32e365))[_0x55ca('0x4b')](handleError(_0x2d6f68,null));};exports[_0x55ca('0x4c')]=function(_0x4b5896,_0x1fe567){var _0x37c519={'raw':!![],'where':{'id':_0x4b5896['params']['id']}},_0x2e1145={};_0x2e1145[_0x55ca('0x3b')]=_[_0x55ca('0x38')](db[_0x55ca('0x34')][_0x55ca('0x35')]);_0x2e1145['query']=_['keys'](_0x4b5896[_0x55ca('0x39')]);_0x2e1145[_0x55ca('0x3a')]=_['intersection'](_0x2e1145[_0x55ca('0x3b')],_0x2e1145[_0x55ca('0x39')]);_0x37c519[_0x55ca('0x3c')]=_['intersection'](_0x2e1145[_0x55ca('0x3b')],qs['fields'](_0x4b5896[_0x55ca('0x39')]['fields']));_0x37c519[_0x55ca('0x3c')]=_0x37c519[_0x55ca('0x3c')][_0x55ca('0x3f')]?_0x37c519[_0x55ca('0x3c')]:_0x2e1145[_0x55ca('0x3b')];if(_0x4b5896[_0x55ca('0x39')][_0x55ca('0x47')]){_0x37c519[_0x55ca('0x48')]=[{'all':!![]}];}_0x37c519=_[_0x55ca('0x45')]({},_0x37c519,_0x4b5896[_0x55ca('0x46')]);return db[_0x55ca('0x34')][_0x55ca('0x4d')](_0x37c519)[_0x55ca('0x2c')](handleEntityNotFound(_0x1fe567,null))[_0x55ca('0x2c')](respondWithResult(_0x1fe567,null))[_0x55ca('0x4b')](handleError(_0x1fe567,null));};exports['create']=function(_0x5bb601,_0x5c01eb){return db[_0x55ca('0x34')][_0x55ca('0x4e')](_0x5bb601[_0x55ca('0x4f')],{})[_0x55ca('0x2c')](respondWithResult(_0x5c01eb,0xc9))[_0x55ca('0x4b')](handleError(_0x5c01eb,null));};exports[_0x55ca('0x2b')]=function(_0x38902f,_0xe3f880){if(_0x38902f[_0x55ca('0x4f')]['id']){delete _0x38902f[_0x55ca('0x4f')]['id'];}return db[_0x55ca('0x34')]['find']({'where':{'id':_0x38902f[_0x55ca('0x50')]['id']}})[_0x55ca('0x2c')](handleEntityNotFound(_0xe3f880,null))['then'](saveUpdates(_0x38902f[_0x55ca('0x4f')],null))[_0x55ca('0x2c')](respondWithResult(_0xe3f880,null))[_0x55ca('0x4b')](handleError(_0xe3f880,null));};exports[_0x55ca('0x2d')]=function(_0x38c66e,_0x4d5449){return db['ChatInternalMessage'][_0x55ca('0x4d')]({'where':{'id':_0x38c66e[_0x55ca('0x50')]['id']}})[_0x55ca('0x2c')](handleEntityNotFound(_0x4d5449,null))[_0x55ca('0x2c')](removeEntity(_0x4d5449,null))[_0x55ca('0x4b')](handleError(_0x4d5449,null));};exports[_0x55ca('0x51')]=function(_0x6d35b6,_0x1b3e3d){return db[_0x55ca('0x34')][_0x55ca('0x51')]()[_0x55ca('0x2c')](respondWithResult(_0x1b3e3d,null))[_0x55ca('0x4b')](handleError(_0x1b3e3d,null));};function wrapUser(_0x138a97){return function(_0x4980b2){var _0x56f2ec=_0x138a97['get']({'plain':!![]});_0x56f2ec[_0x55ca('0x52')]=[];if(_0x4980b2){_0x56f2ec['lastMessageAt']=_0x4980b2[_0x55ca('0x53')];_0x56f2ec[_0x55ca('0x54')]=_0x4980b2;}else{_0x56f2ec[_0x55ca('0x55')]=moment(0x0)[_0x55ca('0x56')](_0x55ca('0x57'));_0x56f2ec['lastMessage']={};}return _0x56f2ec;};}exports[_0x55ca('0x58')]=function(_0x59b08f,_0x44cd18,_0x5e8374){var _0x4cc33c=[];return db['User'][_0x55ca('0x49')]({'where':{'role':[_0x55ca('0x59'),_0x55ca('0x5a'),_0x55ca('0x5b')]},'attributes':['id',_0x55ca('0x5c'),_0x55ca('0x30'),'role','userpic',_0x55ca('0x5d'),_0x55ca('0x5e'),_0x55ca('0x5f'),_0x55ca('0x60'),_0x55ca('0x61')],'order':qs[_0x55ca('0x62')](_0x55ca('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x55ca('0x64'),'attributes':['id',_0x55ca('0x30'),_0x55ca('0x36')],'through':{'attributes':[]}}]})[_0x55ca('0x2c')](function(_0x37edc0){if(_0x37edc0){var _0x52a828=_0x59b08f['user'][_0x55ca('0x65')]({'plain':!![]});if(!_0x52a828)throw new Error(_0x55ca('0x66'));if(_0x52a828[_0x55ca('0x67')]===_0x55ca('0x5b')){return db[_0x55ca('0x68')][_0x55ca('0x4d')]({'where':{'name':'Agents','userProfileId':_0x52a828[_0x55ca('0x69')]},'raw':!![]})[_0x55ca('0x2c')](function(_0x190224){if(_0x190224){if(_0x190224['autoAssociation']===0x0){return db[_0x55ca('0x6a')][_0x55ca('0x49')]({'where':{'sectionId':_0x190224['id']},'raw':!![]})[_0x55ca('0x2c')](function(_0x1d058a){var _0x131c1f=[];if(_[_0x55ca('0x6b')](_0x1d058a)){_0x131c1f=_[_0x55ca('0x44')](_0x37edc0,function(_0x281145){if(_0x281145[_0x55ca('0x67')]!=='agent'){return _0x281145;}});return _0x131c1f;}else{for(var _0x21e3f7=0x0;_0x21e3f7<_0x37edc0[_0x55ca('0x3f')];_0x21e3f7++){var _0x14d7ee=_0x37edc0[_0x21e3f7];if(_0x14d7ee['role']===_0x55ca('0x59')){var _0xe981cc=_[_0x55ca('0x4d')](_0x1d058a,function(_0x4b9933){return _0x4b9933['resourceId']===_0x14d7ee['id'];});if(_0xe981cc)_0x131c1f[_0x55ca('0x6c')](_0x14d7ee);}else{_0x131c1f[_0x55ca('0x6c')](_0x14d7ee);}}return _0x131c1f;}});}else{return _0x37edc0;}}else{var _0x1ce241=_[_0x55ca('0x44')](_0x37edc0,function(_0x4f9499){if(_0x4f9499[_0x55ca('0x67')]!==_0x55ca('0x59')){return _0x4f9499;}});return _0x1ce241;}});}else{return _0x37edc0;}}})[_0x55ca('0x2c')](function(_0x2ae5ca){var _0x39639a=[];if(_0x2ae5ca){_0x4cc33c=_0x2ae5ca;for(var _0x48f5d1=0x0;_0x48f5d1<_0x2ae5ca[_0x55ca('0x3f')];_0x48f5d1+=0x1){_0x4cc33c[_0x48f5d1]['messages']=[];_0x39639a[_0x55ca('0x6c')](db['ChatInternalMessage'][_0x55ca('0x4d')]({'where':{'FromId':[_0x59b08f[_0x55ca('0x5b')]['id'],_0x2ae5ca[_0x48f5d1]['id']],'ToId':[_0x59b08f['user']['id'],_0x2ae5ca[_0x48f5d1]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x55ca('0x6d'),_0x55ca('0x6e'),_0x55ca('0x6f'),'body'],'order':qs[_0x55ca('0x62')](_0x55ca('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x55ca('0x2c')](wrapUser(_0x2ae5ca[_0x48f5d1])));}return BPromise[_0x55ca('0x71')](_0x39639a);}return[];})[_0x55ca('0x2c')](function(_0x28eaf2){return{'rows':_0x28eaf2,'count':_0x28eaf2[_0x55ca('0x3f')]};})['then'](respondWithResult(_0x44cd18,null))[_0x55ca('0x4b')](handleError(_0x44cd18,null));};
\ No newline at end of file
+var _0x4f7d=['allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','role','push','FromId','read','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','set','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','merge','find','create','body','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','internal','lastLoginAt'];(function(_0x470c73,_0x56fbb0){var _0x42d2f3=function(_0x2a88ab){while(--_0x2a88ab){_0x470c73['push'](_0x470c73['shift']());}};_0x42d2f3(++_0x56fbb0);}(_0x4f7d,0xf6));var _0xd4f7=function(_0x231875,_0x5ca90a){_0x231875=_0x231875-0x0;var _0x222ac2=_0x4f7d[_0x231875];return _0x222ac2;};'use strict';var emlformat=require(_0xd4f7('0x0'));var rimraf=require(_0xd4f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4f7('0x2'));var rp=require(_0xd4f7('0x3'));var moment=require(_0xd4f7('0x4'));var BPromise=require(_0xd4f7('0x5'));var Mustache=require(_0xd4f7('0x6'));var util=require(_0xd4f7('0x7'));var path=require(_0xd4f7('0x8'));var sox=require(_0xd4f7('0x9'));var csv=require('to-csv');var ejs=require(_0xd4f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4f7('0xb'));var squel=require(_0xd4f7('0xc'));var crypto=require(_0xd4f7('0xd'));var jsforce=require(_0xd4f7('0xe'));var deskjs=require(_0xd4f7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd4f7('0x10'));var Papa=require(_0xd4f7('0x11'));var Redis=require('ioredis');var authService=require(_0xd4f7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd4f7('0x13'));var hardwareService=require(_0xd4f7('0x14'));var logger=require(_0xd4f7('0x15'))(_0xd4f7('0x16'));var utils=require(_0xd4f7('0x17'));var config=require(_0xd4f7('0x18'));var licenseUtil=require(_0xd4f7('0x19'));var db=require(_0xd4f7('0x1a'))['db'];config['redis']=_[_0xd4f7('0x1b')](config[_0xd4f7('0x1c')],{'host':_0xd4f7('0x1d'),'port':0x18eb});var socket=require(_0xd4f7('0x1e'))(new Redis(config['redis']));require(_0xd4f7('0x1f'))[_0xd4f7('0x20')](socket);function respondWithStatusCode(_0x4ccb9e,_0x59c5d5){_0x59c5d5=_0x59c5d5||0xcc;return function(_0x475073){if(_0x475073){return _0x4ccb9e[_0xd4f7('0x21')](_0x59c5d5);}return _0x4ccb9e[_0xd4f7('0x22')](_0x59c5d5)['end']();};}function respondWithResult(_0x3cb16e,_0x31e549){_0x31e549=_0x31e549||0xc8;return function(_0x38dcdb){if(_0x38dcdb){return _0x3cb16e[_0xd4f7('0x22')](_0x31e549)[_0xd4f7('0x23')](_0x38dcdb);}};}function respondWithFilteredResult(_0x4e8912,_0x32863d){return function(_0x45b048){if(_0x45b048){var _0xa2e8cb=typeof _0x32863d[_0xd4f7('0x24')]===_0xd4f7('0x25')&&typeof _0x32863d['limit']===_0xd4f7('0x25');var _0x3c9669=_0x45b048['count'];var _0x608a76=_0xa2e8cb?0x0:_0x32863d[_0xd4f7('0x24')];var _0x40b9ce=_0xa2e8cb?_0x45b048[_0xd4f7('0x26')]:_0x32863d[_0xd4f7('0x24')]+_0x32863d['limit'];var _0x3bf796;if(_0x40b9ce>=_0x3c9669){_0x40b9ce=_0x3c9669;_0x3bf796=0xc8;}else{_0x3bf796=0xce;}_0x4e8912[_0xd4f7('0x22')](_0x3bf796);return _0x4e8912[_0xd4f7('0x27')]('Content-Range',_0x608a76+'-'+_0x40b9ce+'/'+_0x3c9669)['json'](_0x45b048);}return null;};}function patchUpdates(_0x19a958){return function(_0x5cead1){try{jsonpatch['apply'](_0x5cead1,_0x19a958,!![]);}catch(_0xb6270d){return BPromise[_0xd4f7('0x28')](_0xb6270d);}return _0x5cead1[_0xd4f7('0x29')]();};}function saveUpdates(_0x489aa4,_0x578e5c){return function(_0xef7c4e){if(_0xef7c4e){return _0xef7c4e[_0xd4f7('0x2a')](_0x489aa4)[_0xd4f7('0x2b')](function(_0xfcb8d3){return _0xfcb8d3;});}return null;};}function removeEntity(_0x4cb436,_0x1a1a11){return function(_0x70f58e){if(_0x70f58e){return _0x70f58e[_0xd4f7('0x2c')]()[_0xd4f7('0x2b')](function(){_0x4cb436[_0xd4f7('0x22')](0xcc)[_0xd4f7('0x2d')]();});}};}function handleEntityNotFound(_0x53f3f6,_0x145378){return function(_0x5536db){if(!_0x5536db){_0x53f3f6[_0xd4f7('0x21')](0x194);}return _0x5536db;};}function handleError(_0x371c6c,_0x471865){_0x471865=_0x471865||0x1f4;return function(_0x53dba3){logger['error'](_0x53dba3[_0xd4f7('0x2e')]);if(_0x53dba3[_0xd4f7('0x2f')]){delete _0x53dba3[_0xd4f7('0x2f')];}_0x371c6c[_0xd4f7('0x22')](_0x471865)[_0xd4f7('0x30')](_0x53dba3);};}exports[_0xd4f7('0x31')]=function(_0x3521e8,_0x492cdb){var _0x4b29ad={},_0x3df93f={},_0x11ac1d={'count':0x0,'rows':[]};var _0x1903f6=_[_0xd4f7('0x32')](db[_0xd4f7('0x33')][_0xd4f7('0x34')],function(_0x4731a3){return{'name':_0x4731a3[_0xd4f7('0x35')],'type':_0x4731a3[_0xd4f7('0x36')][_0xd4f7('0x37')]};});_0x3df93f[_0xd4f7('0x38')]=_[_0xd4f7('0x32')](_0x1903f6,_0xd4f7('0x2f'));_0x3df93f[_0xd4f7('0x39')]=_[_0xd4f7('0x3a')](_0x3521e8[_0xd4f7('0x39')]);_0x3df93f[_0xd4f7('0x3b')]=_[_0xd4f7('0x3c')](_0x3df93f[_0xd4f7('0x38')],_0x3df93f[_0xd4f7('0x39')]);_0x4b29ad[_0xd4f7('0x3d')]=_[_0xd4f7('0x3c')](_0x3df93f['model'],qs[_0xd4f7('0x3e')](_0x3521e8[_0xd4f7('0x39')]['fields']));_0x4b29ad['attributes']=_0x4b29ad[_0xd4f7('0x3d')][_0xd4f7('0x3f')]?_0x4b29ad[_0xd4f7('0x3d')]:_0x3df93f['model'];if(!_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x40')](_0xd4f7('0x41'))){_0x4b29ad[_0xd4f7('0x42')]=qs[_0xd4f7('0x42')](_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x42')]);_0x4b29ad[_0xd4f7('0x24')]=qs[_0xd4f7('0x24')](_0x3521e8[_0xd4f7('0x39')]['offset']);}_0x4b29ad[_0xd4f7('0x43')]=qs[_0xd4f7('0x44')](_0x3521e8['query'][_0xd4f7('0x44')]);_0x4b29ad[_0xd4f7('0x45')]=qs[_0xd4f7('0x3b')](_[_0xd4f7('0x46')](_0x3521e8['query'],_0x3df93f[_0xd4f7('0x3b')]),_0x1903f6);if(_0x3521e8['query']['filter']){_0x4b29ad[_0xd4f7('0x45')]=_['merge'](_0x4b29ad[_0xd4f7('0x45')],{'$or':_[_0xd4f7('0x32')](_0x1903f6,function(_0x490801){if(_0x490801[_0xd4f7('0x36')]!==_0xd4f7('0x47')){var _0x30612f={};_0x30612f[_0x490801[_0xd4f7('0x2f')]]={'$like':'%'+_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x48')]+'%'};return _0x30612f;}})});}_0x4b29ad=_['merge']({},_0x4b29ad,_0x3521e8[_0xd4f7('0x49')]);var _0x4fd0df={'where':_0x4b29ad[_0xd4f7('0x45')]};return db[_0xd4f7('0x33')][_0xd4f7('0x26')](_0x4fd0df)[_0xd4f7('0x2b')](function(_0x3e5a82){_0x11ac1d[_0xd4f7('0x26')]=_0x3e5a82;if(_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x4a')]){_0x4b29ad['include']=[{'all':!![]}];}return db[_0xd4f7('0x33')][_0xd4f7('0x4b')](_0x4b29ad);})['then'](function(_0x2cff6){_0x11ac1d[_0xd4f7('0x4c')]=_0x2cff6;return _0x11ac1d;})[_0xd4f7('0x2b')](respondWithFilteredResult(_0x492cdb,_0x4b29ad))[_0xd4f7('0x4d')](handleError(_0x492cdb,null));};exports[_0xd4f7('0x4e')]=function(_0x30870b,_0x4c3dae){var _0x15e3aa={'raw':!![],'where':{'id':_0x30870b[_0xd4f7('0x4f')]['id']}},_0x5ddb4e={};_0x5ddb4e[_0xd4f7('0x38')]=_[_0xd4f7('0x3a')](db[_0xd4f7('0x33')]['rawAttributes']);_0x5ddb4e[_0xd4f7('0x39')]=_[_0xd4f7('0x3a')](_0x30870b[_0xd4f7('0x39')]);_0x5ddb4e['filters']=_['intersection'](_0x5ddb4e['model'],_0x5ddb4e[_0xd4f7('0x39')]);_0x15e3aa[_0xd4f7('0x3d')]=_['intersection'](_0x5ddb4e[_0xd4f7('0x38')],qs[_0xd4f7('0x3e')](_0x30870b[_0xd4f7('0x39')][_0xd4f7('0x3e')]));_0x15e3aa['attributes']=_0x15e3aa['attributes'][_0xd4f7('0x3f')]?_0x15e3aa[_0xd4f7('0x3d')]:_0x5ddb4e['model'];if(_0x30870b['query'][_0xd4f7('0x4a')]){_0x15e3aa['include']=[{'all':!![]}];}_0x15e3aa=_[_0xd4f7('0x50')]({},_0x15e3aa,_0x30870b[_0xd4f7('0x49')]);return db[_0xd4f7('0x33')][_0xd4f7('0x51')](_0x15e3aa)[_0xd4f7('0x2b')](handleEntityNotFound(_0x4c3dae,null))[_0xd4f7('0x2b')](respondWithResult(_0x4c3dae,null))[_0xd4f7('0x4d')](handleError(_0x4c3dae,null));};exports[_0xd4f7('0x52')]=function(_0x518d49,_0x4a8fbc){return db[_0xd4f7('0x33')][_0xd4f7('0x52')](_0x518d49[_0xd4f7('0x53')],{})[_0xd4f7('0x2b')](respondWithResult(_0x4a8fbc,0xc9))[_0xd4f7('0x4d')](handleError(_0x4a8fbc,null));};exports['update']=function(_0x4c63a8,_0x34a6a8){if(_0x4c63a8[_0xd4f7('0x53')]['id']){delete _0x4c63a8[_0xd4f7('0x53')]['id'];}return db[_0xd4f7('0x33')][_0xd4f7('0x51')]({'where':{'id':_0x4c63a8['params']['id']}})['then'](handleEntityNotFound(_0x34a6a8,null))[_0xd4f7('0x2b')](saveUpdates(_0x4c63a8[_0xd4f7('0x53')],null))['then'](respondWithResult(_0x34a6a8,null))[_0xd4f7('0x4d')](handleError(_0x34a6a8,null));};exports['destroy']=function(_0x2ce480,_0x5157a){return db[_0xd4f7('0x33')]['find']({'where':{'id':_0x2ce480[_0xd4f7('0x4f')]['id']}})[_0xd4f7('0x2b')](handleEntityNotFound(_0x5157a,null))[_0xd4f7('0x2b')](removeEntity(_0x5157a,null))[_0xd4f7('0x4d')](handleError(_0x5157a,null));};exports[_0xd4f7('0x54')]=function(_0xd17b5d,_0x368363){return db[_0xd4f7('0x33')][_0xd4f7('0x54')]()['then'](respondWithResult(_0x368363,null))[_0xd4f7('0x4d')](handleError(_0x368363,null));};function wrapUser(_0x44db8a){return function(_0x47f520){var _0x25c503=_0x44db8a[_0xd4f7('0x55')]({'plain':!![]});_0x25c503['messages']=[];if(_0x47f520){_0x25c503[_0xd4f7('0x56')]=_0x47f520[_0xd4f7('0x57')];_0x25c503['lastMessage']=_0x47f520;}else{_0x25c503[_0xd4f7('0x56')]=moment(0x0)[_0xd4f7('0x58')](_0xd4f7('0x59'));_0x25c503[_0xd4f7('0x5a')]={};}return _0x25c503;};}exports[_0xd4f7('0x5b')]=function(_0x4a249d,_0x137c5c,_0x209a66){var _0xeb4410=[];return db[_0xd4f7('0x5c')][_0xd4f7('0x4b')]({'where':{'role':[_0xd4f7('0x5d'),_0xd4f7('0x5e'),_0xd4f7('0x5f')]},'attributes':['id',_0xd4f7('0x60'),_0xd4f7('0x2f'),'role','userpic',_0xd4f7('0x61'),'online',_0xd4f7('0x62'),_0xd4f7('0x63'),_0xd4f7('0x64')],'order':qs[_0xd4f7('0x44')](_0xd4f7('0x65')),'include':[{'model':db[_0xd4f7('0x66')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x53aff0){if(_0x53aff0){var _0x1119ba=_0x4a249d[_0xd4f7('0x5f')][_0xd4f7('0x55')]({'plain':!![]});if(!_0x1119ba)throw new Error(_0xd4f7('0x67'));if(_0x1119ba['role']===_0xd4f7('0x5f')){return db[_0xd4f7('0x68')][_0xd4f7('0x51')]({'where':{'name':_0xd4f7('0x69'),'userProfileId':_0x1119ba[_0xd4f7('0x6a')]},'raw':!![]})['then'](function(_0x284fe5){if(_0x284fe5){if(_0x284fe5[_0xd4f7('0x6b')]===0x0){return db[_0xd4f7('0x6c')][_0xd4f7('0x4b')]({'where':{'sectionId':_0x284fe5['id']},'raw':!![]})[_0xd4f7('0x2b')](function(_0x3e9009){var _0x102e61=[];if(_[_0xd4f7('0x6d')](_0x3e9009)){_0x102e61=_[_0xd4f7('0x48')](_0x53aff0,function(_0x170cd9){if(_0x170cd9[_0xd4f7('0x6e')]!==_0xd4f7('0x5d')){return _0x170cd9;}});return _0x102e61;}else{for(var _0x55bfae=0x0;_0x55bfae<_0x53aff0[_0xd4f7('0x3f')];_0x55bfae++){var _0x462f06=_0x53aff0[_0x55bfae];if(_0x462f06[_0xd4f7('0x6e')]===_0xd4f7('0x5d')){var _0x466b01=_[_0xd4f7('0x51')](_0x3e9009,function(_0xaf2af2){return _0xaf2af2['resourceId']===_0x462f06['id'];});if(_0x466b01)_0x102e61[_0xd4f7('0x6f')](_0x462f06);}else{_0x102e61['push'](_0x462f06);}}return _0x102e61;}});}else{return _0x53aff0;}}else{var _0x3f993e=_[_0xd4f7('0x48')](_0x53aff0,function(_0x53d2d7){if(_0x53d2d7[_0xd4f7('0x6e')]!==_0xd4f7('0x5d')){return _0x53d2d7;}});return _0x3f993e;}});}else{return _0x53aff0;}}})[_0xd4f7('0x2b')](function(_0x1846d3){var _0x298fa9=[];if(_0x1846d3){_0xeb4410=_0x1846d3;for(var _0x2c92f4=0x0;_0x2c92f4<_0x1846d3[_0xd4f7('0x3f')];_0x2c92f4+=0x1){_0xeb4410[_0x2c92f4]['messages']=[];_0x298fa9[_0xd4f7('0x6f')](db[_0xd4f7('0x33')]['find']({'where':{'FromId':[_0x4a249d['user']['id'],_0x1846d3[_0x2c92f4]['id']],'ToId':[_0x4a249d[_0xd4f7('0x5f')]['id'],_0x1846d3[_0x2c92f4]['id']],'ChatGroupId':null},'attributes':['id',_0xd4f7('0x57'),_0xd4f7('0x70'),'ToId',_0xd4f7('0x71'),'body'],'order':qs[_0xd4f7('0x44')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1846d3[_0x2c92f4])));}return BPromise[_0xd4f7('0x72')](_0x298fa9);}return[];})[_0xd4f7('0x2b')](function(_0xfea3a4){return{'rows':_0xfea3a4,'count':_0xfea3a4[_0xd4f7('0x3f')]};})['then'](respondWithResult(_0x137c5c,null))[_0xd4f7('0x4d')](handleError(_0x137c5c,null));};
\ No newline at end of file
index ee89fe7..4dbc626 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x367b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x58dc50,_0x2af0b7){var _0x1fda34=function(_0x5cf61b){while(--_0x5cf61b){_0x58dc50['push'](_0x58dc50['shift']());}};_0x1fda34(++_0x2af0b7);}(_0x367b,0xad));var _0xb367=function(_0x239d19,_0x2e325a){_0x239d19=_0x239d19-0x0;var _0x3bcad0=_0x367b[_0x239d19];return _0x3bcad0;};'use strict';var EventEmitter=require(_0xb367('0x0'));var ChatInternalMessage=require(_0xb367('0x1'))['db'][_0xb367('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb367('0x3')](0x0);var events={'afterCreate':_0xb367('0x4'),'afterUpdate':_0xb367('0x5'),'afterDestroy':_0xb367('0x6')};function emitEvent(_0x4d7a69){return function(_0x4d055a,_0x52a909,_0x29b757){ChatInternalMessageEvents[_0xb367('0x7')](_0x4d7a69+':'+_0x4d055a['id'],_0x4d055a);ChatInternalMessageEvents['emit'](_0x4d7a69,_0x4d055a);_0x29b757(null);};}for(var e in events){if(events[_0xb367('0x8')](e)){var event=events[e];ChatInternalMessage[_0xb367('0x9')](e,emitEvent(event));}}module[_0xb367('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x014b=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x014b,0x1a8));var _0xb014=function(_0x52851e,_0x535d7a){_0x52851e=_0x52851e-0x0;var _0x1c581e=_0x014b[_0x52851e];return _0x1c581e;};'use strict';var EventEmitter=require(_0xb014('0x0'));var ChatInternalMessage=require(_0xb014('0x1'))['db'][_0xb014('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb014('0x3')](0x0);var events={'afterCreate':_0xb014('0x4'),'afterUpdate':_0xb014('0x5'),'afterDestroy':_0xb014('0x6')};function emitEvent(_0x15dcd3){return function(_0xa9af8b,_0x2be87d,_0x2985bb){ChatInternalMessageEvents[_0xb014('0x7')](_0x15dcd3+':'+_0xa9af8b['id'],_0xa9af8b);ChatInternalMessageEvents['emit'](_0x15dcd3,_0xa9af8b);_0x2985bb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb014('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
index 9986455..522d21f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7acc=['request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x376482,_0x57bb69){var _0x365c80=function(_0x282d08){while(--_0x282d08){_0x376482['push'](_0x376482['shift']());}};_0x365c80(++_0x57bb69);}(_0x7acc,0x82));var _0xc7ac=function(_0x2acae5,_0x3a76cb){_0x2acae5=_0x2acae5-0x0;var _0x5c221f=_0x7acc[_0x2acae5];return _0x5c221f;};'use strict';var _=require(_0xc7ac('0x0'));var util=require('util');var logger=require(_0xc7ac('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc7ac('0x2'));var fs=require('fs');var path=require(_0xc7ac('0x3'));var rimraf=require('rimraf');var config=require(_0xc7ac('0x4'));var attributes=require(_0xc7ac('0x5'));module[_0xc7ac('0x6')]=function(_0x524db9,_0x5c9926){return _0x524db9[_0xc7ac('0x7')](_0xc7ac('0x8'),attributes,{'tableName':_0xc7ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc7ac('0xa')});};
\ No newline at end of file
+var _0xc37b=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','util','../../config/logger','moment'];(function(_0x19c3d2,_0x59f8e2){var _0x8a8c9e=function(_0x48ddbe){while(--_0x48ddbe){_0x19c3d2['push'](_0x19c3d2['shift']());}};_0x8a8c9e(++_0x59f8e2);}(_0xc37b,0xcc));var _0xbc37=function(_0x406f08,_0x38a7a4){_0x406f08=_0x406f08-0x0;var _0x375701=_0xc37b[_0x406f08];return _0x375701;};'use strict';var _=require('lodash');var util=require(_0xbc37('0x0'));var logger=require(_0xbc37('0x1'))('api');var moment=require(_0xbc37('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc37('0x3'));var config=require(_0xbc37('0x4'));var attributes=require(_0xbc37('0x5'));module['exports']=function(_0x5d6401,_0x4cd6c0){return _0x5d6401[_0xbc37('0x6')](_0xbc37('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc37('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 1c49ec1..453676b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc743=['redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x3bb954,_0x5173dd){var _0x3d96a3=function(_0x16688c){while(--_0x16688c){_0x3bb954['push'](_0x3bb954['shift']());}};_0x3d96a3(++_0x5173dd);}(_0xc743,0x103));var _0x3c74=function(_0x47199b,_0x16e824){_0x47199b=_0x47199b-0x0;var _0x390911=_0xc743[_0x47199b];return _0x390911;};'use strict';var _=require(_0x3c74('0x0'));var util=require(_0x3c74('0x1'));var moment=require(_0x3c74('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c74('0x3'));var fs=require('fs');var Redis=require(_0x3c74('0x4'));var db=require(_0x3c74('0x5'))['db'];var utils=require(_0x3c74('0x6'));var logger=require(_0x3c74('0x7'))(_0x3c74('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c74('0x9')][_0x3c74('0xa')]({'port':0x232a});config[_0x3c74('0xb')]=_['defaults'](config[_0x3c74('0xb')],{'host':_0x3c74('0xc'),'port':0x18eb});var socket=require(_0x3c74('0xd'))(new Redis(config['redis']));require(_0x3c74('0xe'))['register'](socket);function respondWithRpcPromise(_0x206b75,_0x521d30,_0x30ea64){return new BPromise(function(_0x2cc591,_0x1212ec){return client[_0x3c74('0xf')](_0x206b75,_0x30ea64)['then'](function(_0x29a5cc){logger[_0x3c74('0x10')](_0x3c74('0x11'),_0x521d30,_0x3c74('0x12'));logger[_0x3c74('0x13')](_0x3c74('0x14'),_0x521d30,'request\x20sent',JSON[_0x3c74('0x15')](_0x29a5cc));if(_0x29a5cc['error']){if(_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x17')]===0x1f4){logger[_0x3c74('0x16')](_0x3c74('0x11'),_0x521d30,_0x29a5cc[_0x3c74('0x16')]['message']);return _0x1212ec(_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x18')]);}logger[_0x3c74('0x16')](_0x3c74('0x11'),_0x521d30,_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x18')]);return _0x2cc591(_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x18')]);}else{logger[_0x3c74('0x10')](_0x3c74('0x11'),_0x521d30,'request\x20sent');_0x2cc591(_0x29a5cc[_0x3c74('0x19')][_0x3c74('0x18')]);}})[_0x3c74('0x1a')](function(_0x2380b3){logger['error'](_0x3c74('0x11'),_0x521d30,_0x2380b3);_0x1212ec(_0x2380b3);});});}
\ No newline at end of file
+var _0x35f9=['error','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x273fa0,_0x1aabbc){var _0xde4793=function(_0x1b5611){while(--_0x1b5611){_0x273fa0['push'](_0x273fa0['shift']());}};_0xde4793(++_0x1aabbc);}(_0x35f9,0x1df));var _0x935f=function(_0x2aba1d,_0x589dac){_0x2aba1d=_0x2aba1d-0x0;var _0x20c616=_0x35f9[_0x2aba1d];return _0x20c616;};'use strict';var _=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var moment=require(_0x935f('0x2'));var BPromise=require(_0x935f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x935f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x935f('0x5'))(_0x935f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x935f('0x7')][_0x935f('0x8')]({'port':0x232a});config[_0x935f('0x9')]=_[_0x935f('0xa')](config[_0x935f('0x9')],{'host':_0x935f('0xb'),'port':0x18eb});var socket=require(_0x935f('0xc'))(new Redis(config['redis']));require(_0x935f('0xd'))[_0x935f('0xe')](socket);function respondWithRpcPromise(_0x50675c,_0x318fc4,_0x1099bd){return new BPromise(function(_0x2fd9a4,_0x16c3e5){return client[_0x935f('0xf')](_0x50675c,_0x1099bd)[_0x935f('0x10')](function(_0x5e01d9){logger['info'](_0x935f('0x11'),_0x318fc4,_0x935f('0x12'));logger[_0x935f('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x318fc4,'request\x20sent',JSON[_0x935f('0x14')](_0x5e01d9));if(_0x5e01d9[_0x935f('0x15')]){if(_0x5e01d9['error']['code']===0x1f4){logger[_0x935f('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x318fc4,_0x5e01d9[_0x935f('0x15')][_0x935f('0x16')]);return _0x16c3e5(_0x5e01d9[_0x935f('0x15')][_0x935f('0x16')]);}logger[_0x935f('0x15')](_0x935f('0x11'),_0x318fc4,_0x5e01d9[_0x935f('0x15')][_0x935f('0x16')]);return _0x2fd9a4(_0x5e01d9['error'][_0x935f('0x16')]);}else{logger[_0x935f('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x318fc4,_0x935f('0x12'));_0x2fd9a4(_0x5e01d9[_0x935f('0x18')][_0x935f('0x16')]);}})['catch'](function(_0x393063){logger[_0x935f('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x318fc4,_0x393063);_0x16c3e5(_0x393063);});});}
\ No newline at end of file
index c36cf87..17de6a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55fa=['update','removeListener','register','length','./chatInternalMessage.events','remove'];(function(_0x53534a,_0x3a3fef){var _0x6be3ec=function(_0xcabdf8){while(--_0xcabdf8){_0x53534a['push'](_0x53534a['shift']());}};_0x6be3ec(++_0x3a3fef);}(_0x55fa,0xfa));var _0xa55f=function(_0x19cc31,_0x15ecfd){_0x19cc31=_0x19cc31-0x0;var _0x550c19=_0x55fa[_0x19cc31];return _0x550c19;};'use strict';var ChatInternalMessageEvents=require(_0xa55f('0x0'));var events=['save',_0xa55f('0x1'),_0xa55f('0x2')];function createListener(_0x35444a,_0x5f49b2){return function(_0x3d9b52){_0x5f49b2['emit'](_0x35444a,_0x3d9b52);};}function removeListener(_0x2a1480,_0x4a64fe){return function(){ChatInternalMessageEvents[_0xa55f('0x3')](_0x2a1480,_0x4a64fe);};}exports[_0xa55f('0x4')]=function(_0x19ed51){for(var _0x286c37=0x0,_0x5667da=events[_0xa55f('0x5')];_0x286c37<_0x5667da;_0x286c37++){var _0x5b48d8=events[_0x286c37];var _0x3130b8=createListener('chatInternalMessage:'+_0x5b48d8,_0x19ed51);ChatInternalMessageEvents['on'](_0x5b48d8,_0x3130b8);}};
\ No newline at end of file
+var _0xfd8b=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','register'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0xfd8b,0x1c1));var _0xbfd8=function(_0x4d40f8,_0x4f88de){_0x4d40f8=_0x4d40f8-0x0;var _0x193eeb=_0xfd8b[_0x4d40f8];return _0x193eeb;};'use strict';var ChatInternalMessageEvents=require(_0xbfd8('0x0'));var events=[_0xbfd8('0x1'),_0xbfd8('0x2'),_0xbfd8('0x3')];function createListener(_0x1110d2,_0x518f41){return function(_0x42f94d){_0x518f41[_0xbfd8('0x4')](_0x1110d2,_0x42f94d);};}function removeListener(_0x4b45ae,_0x4c9bd9){return function(){ChatInternalMessageEvents['removeListener'](_0x4b45ae,_0x4c9bd9);};}exports[_0xbfd8('0x5')]=function(_0x295b3a){for(var _0xaabbd8=0x0,_0x2c23eb=events['length'];_0xaabbd8<_0x2c23eb;_0xaabbd8++){var _0x412355=events[_0xaabbd8];var _0x454d89=createListener(_0xbfd8('0x6')+_0x412355,_0x295b3a);ChatInternalMessageEvents['on'](_0x412355,_0x454d89);}};
\ No newline at end of file
index d5de75f..a9f8696 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5702=['/describe','describe','/users','/:id','show','post','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x4b8408,_0x1bd0e2){var _0xde9378=function(_0x14e7cb){while(--_0x14e7cb){_0x4b8408['push'](_0x4b8408['shift']());}};_0xde9378(++_0x1bd0e2);}(_0x5702,0xc7));var _0x2570=function(_0x210e47,_0x576a9d){_0x210e47=_0x210e47-0x0;var _0x4a6ff1=_0x5702[_0x210e47];return _0x4a6ff1;};'use strict';var multer=require(_0x2570('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2570('0x1'));var express=require(_0x2570('0x2'));var router=express[_0x2570('0x3')]();var fs_extra=require(_0x2570('0x4'));var auth=require(_0x2570('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2570('0x6'));var controller=require(_0x2570('0x7'));router[_0x2570('0x8')]('/',auth[_0x2570('0x9')](),controller[_0x2570('0xa')]);router[_0x2570('0x8')](_0x2570('0xb'),auth[_0x2570('0x9')](),controller[_0x2570('0xc')]);router['get'](_0x2570('0xd'),auth[_0x2570('0x9')](),controller['getUsers']);router['get'](_0x2570('0xe'),auth[_0x2570('0x9')](),controller[_0x2570('0xf')]);router[_0x2570('0x10')]('/',auth[_0x2570('0x9')](),controller['create']);router[_0x2570('0x11')](_0x2570('0xe'),controller['update']);router[_0x2570('0x12')](_0x2570('0xe'),auth[_0x2570('0x9')](),controller[_0x2570('0x13')]);module[_0x2570('0x14')]=router;
\ No newline at end of file
+var _0xef4f=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','create','put','destroy'];(function(_0x19ae54,_0xacef8d){var _0x294c84=function(_0x12bea0){while(--_0x12bea0){_0x19ae54['push'](_0x19ae54['shift']());}};_0x294c84(++_0xacef8d);}(_0xef4f,0x105));var _0xfef4=function(_0x58e9d6,_0x840f76){_0x58e9d6=_0x58e9d6-0x0;var _0x10b2c0=_0xef4f[_0x58e9d6];return _0x10b2c0;};'use strict';var multer=require('multer');var util=require(_0xfef4('0x0'));var path=require(_0xfef4('0x1'));var timeout=require(_0xfef4('0x2'));var express=require('express');var router=express[_0xfef4('0x3')]();var fs_extra=require(_0xfef4('0x4'));var auth=require(_0xfef4('0x5'));var interaction=require(_0xfef4('0x6'));var config=require(_0xfef4('0x7'));var controller=require(_0xfef4('0x8'));router[_0xfef4('0x9')]('/',auth[_0xfef4('0xa')](),controller['index']);router[_0xfef4('0x9')](_0xfef4('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xfef4('0x9')](_0xfef4('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0xfef4('0x9')](_0xfef4('0xd'),auth[_0xfef4('0xa')](),controller[_0xfef4('0xe')]);router[_0xfef4('0xf')]('/',auth[_0xfef4('0xa')](),controller[_0xfef4('0x10')]);router[_0xfef4('0x11')](_0xfef4('0xd'),controller['update']);router['delete']('/:id',auth[_0xfef4('0xa')](),controller[_0xfef4('0x12')]);module[_0xfef4('0x13')]=router;
\ No newline at end of file
index a2322c1..55f08d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['out','DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x128582,_0xe61dba){var _0x38db19=function(_0x36c512){while(--_0x36c512){_0x128582['push'](_0x128582['shift']());}};_0x38db19(++_0xe61dba);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x26b4e8,_0x1c1a98){_0x26b4e8=_0x26b4e8-0x0;var _0x448057=_0xf4f4[_0x26b4e8];return _0x448057;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4f4f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4f4f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4f4f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f4f('0x4')]('in',_0x4f4f('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x4f4f('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4f4f('0x7')]}};
\ No newline at end of file
+var _0x4fc2=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4fc2,0x111));var _0x24fc=function(_0x58836f,_0x5351e2){_0x58836f=_0x58836f-0x0;var _0x28f9b1=_0x4fc2[_0x58836f];return _0x28f9b1;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'body':{'type':Sequelize[_0x24fc('0x2')](_0x24fc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x24fc('0x5')]('in',_0x24fc('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x24fc('0x7')]},'providerName':{'type':Sequelize[_0x24fc('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index d6cfc91..984556f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a6c=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','stack','name','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','body','destroy','describe','../../config/logger','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','format','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x8a6c,0xfc));var _0xc8a6=function(_0x523d34,_0x5e8c35){_0x523d34=_0x523d34-0x0;var _0x1d044a=_0x8a6c[_0x523d34];return _0x1d044a;};'use strict';var emlformat=require(_0xc8a6('0x0'));var rimraf=require(_0xc8a6('0x1'));var zipdir=require(_0xc8a6('0x2'));var jsonpatch=require(_0xc8a6('0x3'));var rp=require('request-promise');var moment=require(_0xc8a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8a6('0x5'));var util=require(_0xc8a6('0x6'));var path=require(_0xc8a6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc8a6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8a6('0x9'));var squel=require(_0xc8a6('0xa'));var crypto=require(_0xc8a6('0xb'));var jsforce=require(_0xc8a6('0xc'));var deskjs=require(_0xc8a6('0xd'));var toCsv=require(_0xc8a6('0xe'));var querystring=require(_0xc8a6('0xf'));var Papa=require(_0xc8a6('0x10'));var Redis=require(_0xc8a6('0x11'));var authService=require(_0xc8a6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8a6('0x13'));var utils=require(_0xc8a6('0x14'));var config=require(_0xc8a6('0x15'));var licenseUtil=require(_0xc8a6('0x16'));var db=require(_0xc8a6('0x17'))['db'];config[_0xc8a6('0x18')]=_[_0xc8a6('0x19')](config[_0xc8a6('0x18')],{'host':_0xc8a6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc8a6('0x18')]));require(_0xc8a6('0x1b'))['register'](socket);var jayson=require(_0xc8a6('0x1c'));var client=jayson[_0xc8a6('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xc8a6('0x1d')][_0xc8a6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4fe8e4,_0x3c03d6,_0x36cd31,_0x38de72){return new BPromise(function(_0x3ec154,_0xc378b4){var _0x43b0db=_0x38de72||client;return _0x43b0db['request'](_0x4fe8e4,_0x36cd31)['then'](function(_0x178bc1){logger[_0xc8a6('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x3c03d6,_0xc8a6('0x20'));logger[_0xc8a6('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3c03d6,'request\x20sent',JSON[_0xc8a6('0x22')](_0x178bc1));if(_0x178bc1[_0xc8a6('0x23')]){if(_0x178bc1[_0xc8a6('0x23')][_0xc8a6('0x24')]===0x1f4){logger[_0xc8a6('0x23')](_0xc8a6('0x25'),_0x3c03d6,_0x178bc1[_0xc8a6('0x23')][_0xc8a6('0x26')]);return _0xc378b4(_0x178bc1[_0xc8a6('0x23')]['message']);}logger[_0xc8a6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3c03d6,_0x178bc1[_0xc8a6('0x23')][_0xc8a6('0x26')]);return _0x3ec154(_0x178bc1['error'][_0xc8a6('0x26')]);}else{logger[_0xc8a6('0x1f')](_0xc8a6('0x25'),_0x3c03d6,_0xc8a6('0x20'));_0x3ec154(_0x178bc1[_0xc8a6('0x27')][_0xc8a6('0x26')]);}})[_0xc8a6('0x28')](function(_0x1f8b43){logger['error'](_0xc8a6('0x25'),_0x3c03d6,_0x1f8b43);_0xc378b4(_0x1f8b43);});});}function respondWithStatusCode(_0x5f36ba,_0x288058){_0x288058=_0x288058||0xcc;return function(_0x3a87aa){if(_0x3a87aa){return _0x5f36ba[_0xc8a6('0x29')](_0x288058);}return _0x5f36ba['status'](_0x288058)[_0xc8a6('0x2a')]();};}function respondWithResult(_0x5457f3,_0x1b76b3){_0x1b76b3=_0x1b76b3||0xc8;return function(_0x87bf5c){if(_0x87bf5c){return _0x5457f3[_0xc8a6('0x2b')](_0x1b76b3)['json'](_0x87bf5c);}};}function respondWithFilteredResult(_0x28211f,_0x558b00){return function(_0x1c1021){if(_0x1c1021){var _0xa43397=typeof _0x558b00[_0xc8a6('0x2c')]===_0xc8a6('0x2d')&&typeof _0x558b00[_0xc8a6('0x2e')]==='undefined';var _0x3712df=_0x1c1021[_0xc8a6('0x2f')];var _0x4f606c=_0xa43397?0x0:_0x558b00['offset'];var _0x3998aa=_0xa43397?_0x1c1021[_0xc8a6('0x2f')]:_0x558b00[_0xc8a6('0x2c')]+_0x558b00['limit'];var _0x2f12cc;if(_0x3998aa>=_0x3712df){_0x3998aa=_0x3712df;_0x2f12cc=0xc8;}else{_0x2f12cc=0xce;}_0x28211f[_0xc8a6('0x2b')](_0x2f12cc);return _0x28211f['set'](_0xc8a6('0x30'),_0x4f606c+'-'+_0x3998aa+'/'+_0x3712df)[_0xc8a6('0x31')](_0x1c1021);}return null;};}function patchUpdates(_0x2daba3){return function(_0x21006e){try{jsonpatch[_0xc8a6('0x32')](_0x21006e,_0x2daba3,!![]);}catch(_0x5759c4){return BPromise[_0xc8a6('0x33')](_0x5759c4);}return _0x21006e[_0xc8a6('0x34')]();};}function saveUpdates(_0x3ef1ee,_0x376c74){return function(_0x36a193){if(_0x36a193){return _0x36a193[_0xc8a6('0x35')](_0x3ef1ee)[_0xc8a6('0x36')](function(_0xad4675){return _0xad4675;});}return null;};}function removeEntity(_0x267231,_0x5ac870){return function(_0x138650){if(_0x138650){return _0x138650['destroy']()['then'](function(){_0x267231['status'](0xcc)[_0xc8a6('0x2a')]();});}};}function handleEntityNotFound(_0x4c553e,_0x1baa54){return function(_0x1e7950){if(!_0x1e7950){_0x4c553e[_0xc8a6('0x29')](0x194);}return _0x1e7950;};}function handleError(_0x4e04a9,_0x1826f7){_0x1826f7=_0x1826f7||0x1f4;return function(_0xb65be5){logger[_0xc8a6('0x23')](_0xb65be5[_0xc8a6('0x37')]);if(_0xb65be5[_0xc8a6('0x38')]){delete _0xb65be5[_0xc8a6('0x38')];}_0x4e04a9[_0xc8a6('0x2b')](_0x1826f7)['send'](_0xb65be5);};}exports['index']=function(_0x5ef202,_0x1d18f7){var _0x516c80={},_0x249424={},_0x12c86e={'count':0x0,'rows':[]};var _0x27098b=_[_0xc8a6('0x39')](db[_0xc8a6('0x3a')][_0xc8a6('0x3b')],function(_0x555a3f){return{'name':_0x555a3f['fieldName'],'type':_0x555a3f[_0xc8a6('0x3c')][_0xc8a6('0x3d')]};});_0x249424[_0xc8a6('0x3e')]=_[_0xc8a6('0x39')](_0x27098b,'name');_0x249424[_0xc8a6('0x3f')]=_[_0xc8a6('0x40')](_0x5ef202[_0xc8a6('0x3f')]);_0x249424[_0xc8a6('0x41')]=_[_0xc8a6('0x42')](_0x249424['model'],_0x249424[_0xc8a6('0x3f')]);_0x516c80[_0xc8a6('0x43')]=_[_0xc8a6('0x42')](_0x249424['model'],qs[_0xc8a6('0x44')](_0x5ef202[_0xc8a6('0x3f')]['fields']));_0x516c80[_0xc8a6('0x43')]=_0x516c80['attributes']['length']?_0x516c80[_0xc8a6('0x43')]:_0x249424[_0xc8a6('0x3e')];if(!_0x5ef202[_0xc8a6('0x3f')]['hasOwnProperty']('nolimit')){_0x516c80[_0xc8a6('0x2e')]=qs[_0xc8a6('0x2e')](_0x5ef202['query'][_0xc8a6('0x2e')]);_0x516c80[_0xc8a6('0x2c')]=qs[_0xc8a6('0x2c')](_0x5ef202[_0xc8a6('0x3f')]['offset']);}_0x516c80[_0xc8a6('0x45')]=qs[_0xc8a6('0x46')](_0x5ef202[_0xc8a6('0x3f')][_0xc8a6('0x46')]);_0x516c80[_0xc8a6('0x47')]=qs['filters'](_[_0xc8a6('0x48')](_0x5ef202['query'],_0x249424[_0xc8a6('0x41')]),_0x27098b);if(_0x5ef202['query'][_0xc8a6('0x49')]){_0x516c80['where']=_[_0xc8a6('0x4a')](_0x516c80[_0xc8a6('0x47')],{'$or':_[_0xc8a6('0x39')](_0x27098b,function(_0x50415d){if(_0x50415d[_0xc8a6('0x3c')]!==_0xc8a6('0x4b')){var _0x1addf7={};_0x1addf7[_0x50415d['name']]={'$like':'%'+_0x5ef202[_0xc8a6('0x3f')]['filter']+'%'};return _0x1addf7;}})});}_0x516c80=_['merge']({},_0x516c80,_0x5ef202[_0xc8a6('0x4c')]);var _0x3a7b94={'where':_0x516c80[_0xc8a6('0x47')]};return db[_0xc8a6('0x3a')][_0xc8a6('0x2f')](_0x3a7b94)[_0xc8a6('0x36')](function(_0x262a86){_0x12c86e['count']=_0x262a86;if(_0x5ef202['query'][_0xc8a6('0x4d')]){_0x516c80['include']=[{'all':!![]}];}return db[_0xc8a6('0x3a')][_0xc8a6('0x4e')](_0x516c80);})['then'](function(_0x9f3d13){_0x12c86e[_0xc8a6('0x4f')]=_0x9f3d13;return _0x12c86e;})[_0xc8a6('0x36')](respondWithFilteredResult(_0x1d18f7,_0x516c80))[_0xc8a6('0x28')](handleError(_0x1d18f7,null));};exports[_0xc8a6('0x50')]=function(_0x453471,_0x48f864){var _0x173e8c={'raw':!![],'where':{'id':_0x453471[_0xc8a6('0x51')]['id']}},_0x3fed5d={};_0x3fed5d['model']=_[_0xc8a6('0x40')](db[_0xc8a6('0x3a')][_0xc8a6('0x3b')]);_0x3fed5d[_0xc8a6('0x3f')]=_['keys'](_0x453471['query']);_0x3fed5d['filters']=_[_0xc8a6('0x42')](_0x3fed5d['model'],_0x3fed5d[_0xc8a6('0x3f')]);_0x173e8c[_0xc8a6('0x43')]=_[_0xc8a6('0x42')](_0x3fed5d['model'],qs['fields'](_0x453471[_0xc8a6('0x3f')][_0xc8a6('0x44')]));_0x173e8c['attributes']=_0x173e8c[_0xc8a6('0x43')][_0xc8a6('0x52')]?_0x173e8c[_0xc8a6('0x43')]:_0x3fed5d[_0xc8a6('0x3e')];if(_0x453471[_0xc8a6('0x3f')][_0xc8a6('0x4d')]){_0x173e8c[_0xc8a6('0x53')]=[{'all':!![]}];}_0x173e8c=_[_0xc8a6('0x4a')]({},_0x173e8c,_0x453471[_0xc8a6('0x4c')]);return db[_0xc8a6('0x3a')][_0xc8a6('0x54')](_0x173e8c)[_0xc8a6('0x36')](handleEntityNotFound(_0x48f864,null))[_0xc8a6('0x36')](respondWithResult(_0x48f864,null))[_0xc8a6('0x28')](handleError(_0x48f864,null));};exports[_0xc8a6('0x55')]=function(_0x21c638,_0x3622c2){return db[_0xc8a6('0x3a')]['create'](_0x21c638[_0xc8a6('0x56')],{})[_0xc8a6('0x36')](respondWithResult(_0x3622c2,0xc9))['catch'](handleError(_0x3622c2,null));};exports[_0xc8a6('0x35')]=function(_0x2f7705,_0x237437){if(_0x2f7705[_0xc8a6('0x56')]['id']){delete _0x2f7705[_0xc8a6('0x56')]['id'];}return db[_0xc8a6('0x3a')]['find']({'where':{'id':_0x2f7705[_0xc8a6('0x51')]['id']}})[_0xc8a6('0x36')](handleEntityNotFound(_0x237437,null))[_0xc8a6('0x36')](saveUpdates(_0x2f7705[_0xc8a6('0x56')],null))['then'](respondWithResult(_0x237437,null))[_0xc8a6('0x28')](handleError(_0x237437,null));};exports[_0xc8a6('0x57')]=function(_0x1a018a,_0x1968c8){return db['ChatMessage'][_0xc8a6('0x54')]({'where':{'id':_0x1a018a[_0xc8a6('0x51')]['id']}})[_0xc8a6('0x36')](handleEntityNotFound(_0x1968c8,null))[_0xc8a6('0x36')](removeEntity(_0x1968c8,null))['catch'](handleError(_0x1968c8,null));};exports[_0xc8a6('0x58')]=function(_0x4ad395,_0x1138f3){return db[_0xc8a6('0x3a')]['describe']()[_0xc8a6('0x36')](respondWithResult(_0x1138f3,null))['catch'](handleError(_0x1138f3,null));};var interaction_log=require(_0xc8a6('0x59'))('chat-interactions');exports[_0xc8a6('0x5a')]=function(_0x115611,_0x15e9cd,_0x550402){var _0x5d6632={'agent':{},'channel':_0xc8a6('0x5b')};if(_0x115611[_0xc8a6('0x56')]['id']){delete _0x115611[_0xc8a6('0x56')]['id'];}_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5c')]=!![];_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5d')]=moment()['format'](_0xc8a6('0x5e'));_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')]=_0x115611[_0xc8a6('0x56')]['UserId']||_0x115611[_0xc8a6('0x60')]['id'];_0x5d6632[_0xc8a6('0x61')]['id']=_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')];return db[_0xc8a6('0x3a')][_0xc8a6('0x54')]({'where':{'id':_0x115611[_0xc8a6('0x51')]['id'],'UserId':null}})[_0xc8a6('0x36')](handleEntityNotFound(_0x15e9cd,null))['then'](saveUpdates(_0x115611[_0xc8a6('0x56')],null))[_0xc8a6('0x36')](function(_0x1db4f4){if(_0x1db4f4){_0x5d6632['message']=_0x1db4f4['get']({'plain':!![]});return db[_0xc8a6('0x62')]['find']({'where':{'id':_0x1db4f4[_0xc8a6('0x63')]}});}return null;})[_0xc8a6('0x36')](handleEntityNotFound(_0x15e9cd,null))[_0xc8a6('0x36')](function(_0x1d8a14){if(_0x1d8a14){return _0x1d8a14[_0xc8a6('0x35')]({'UserId':_0x115611['body']['UserId'],'read1stAt':_[_0xc8a6('0x64')](_0x1d8a14['read1stAt'])?moment()[_0xc8a6('0x65')](_0xc8a6('0x5e')):undefined});}return null;})[_0xc8a6('0x36')](function(_0x363363){if(_0x363363){_0x5d6632['interaction']=_0x363363[_0xc8a6('0x66')]({'plain':!![]});interaction_log[_0xc8a6('0x1f')](_0xc8a6('0x67'),_0x115611[_0xc8a6('0x60')]['id'],_0x115611[_0xc8a6('0x60')][_0xc8a6('0x38')],_0x115611['user'][_0xc8a6('0x68')],_0x5d6632[_0xc8a6('0x69')]['id'],_0x115611[_0xc8a6('0x56')]?JSON['stringify'](_0x115611[_0xc8a6('0x56')]):_0xc8a6('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xc8a6('0x6b'),_0x5d6632);}return null;})[_0xc8a6('0x36')](function(_0x556197){var _0x761c37=_0xc8a6('0x6c')+_0x556197[_0xc8a6('0x26')][_0xc8a6('0x6d')];return db[_0xc8a6('0x6e')][_0xc8a6('0x3f')](_0x761c37,{'type':db[_0xc8a6('0x6f')]['QueryTypes'][_0xc8a6('0x70')],'raw':!![]})[_0xc8a6('0x36')](function(_0x49d2ea){return _0x49d2ea;});})[_0xc8a6('0x36')](function(_0x31dd4c){if(_0x31dd4c){_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x71')]=_0x31dd4c[0x0];if(!_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')])return;return db['User']['find']({'where':{'id':_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')],'role':_0xc8a6('0x61')},'attributes':['id',_0xc8a6('0x38'),_0xc8a6('0x72'),_0xc8a6('0x73'),_0xc8a6('0x74')],'raw':!![]});}return null;})['then'](function(_0x799856){if(!_0x799856)return null;_0x5d6632[_0xc8a6('0x26')]['agent']=_0x799856;return _0x5d6632;})[_0xc8a6('0x36')](function(_0x2e5dca){if(_0x2e5dca){if(_0x115611[_0xc8a6('0x56')]['manual']){_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x75')]=util[_0xc8a6('0x65')](_0xc8a6('0x76'),_0x115611['user'][_0xc8a6('0x38')]);_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x77')]=_0x5d6632['channel'];_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x78')]=_0x5d6632[_0xc8a6('0x77')];_0x5d6632['message']['event']=_0xc8a6('0x5a');return respondWithRpcPromise(_0xc8a6('0x79'),'EventManager',{'event':_0xc8a6('0x7a'),'message':_['merge'](_0x5d6632['message'],JSON['parse'](_0x5d6632['interaction']['formData']))},client9002)[_0xc8a6('0x36')](function(){return _0x5d6632;});}return _0x5d6632;}return null;})['then'](respondWithResult(_0x15e9cd,null))[_0xc8a6('0x28')](handleError(_0x15e9cd,null));};var interaction_log=require(_0xc8a6('0x59'))(_0xc8a6('0x7b'));exports[_0xc8a6('0x33')]=function(_0x367c5e,_0x2b74de,_0x1000f6){var _0x20fe9d={'agent':{},'channel':'chat'};if(_0x367c5e[_0xc8a6('0x56')]['id']){delete _0x367c5e['body']['id'];}_0x367c5e['body']['UserId']=_0x367c5e[_0xc8a6('0x56')][_0xc8a6('0x5f')]||_0x367c5e[_0xc8a6('0x60')]['id'];_0x20fe9d[_0xc8a6('0x61')]['id']=_0x367c5e[_0xc8a6('0x56')]['UserId'];return db[_0xc8a6('0x3a')][_0xc8a6('0x54')]({'where':{'id':_0x367c5e['params']['id'],'UserId':null}})[_0xc8a6('0x36')](handleEntityNotFound(_0x2b74de,null))[_0xc8a6('0x36')](function(_0x4d5cc4){if(_0x4d5cc4){_0x20fe9d[_0xc8a6('0x26')]=_0x4d5cc4[_0xc8a6('0x66')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4d5cc4[_0xc8a6('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2b74de,null))[_0xc8a6('0x36')](function(_0x278fe1){if(_0x278fe1){_0x20fe9d[_0xc8a6('0x69')]=_0x278fe1[_0xc8a6('0x66')]({'plain':!![]});interaction_log[_0xc8a6('0x1f')](_0xc8a6('0x7c'),_0x367c5e[_0xc8a6('0x60')]['id'],_0x367c5e['user'][_0xc8a6('0x38')],_0x367c5e[_0xc8a6('0x60')][_0xc8a6('0x68')],_0x20fe9d[_0xc8a6('0x69')]['id'],_0x367c5e[_0xc8a6('0x56')]?JSON[_0xc8a6('0x22')](_0x367c5e[_0xc8a6('0x56')]):_0xc8a6('0x6a'));return respondWithRpcPromise(_0xc8a6('0x7d'),_0xc8a6('0x7e'),_0x20fe9d);}return null;})['then'](function(_0x2916c1){var _0x2e7d55=_0xc8a6('0x6c')+_0x2916c1['message'][_0xc8a6('0x6d')];return db[_0xc8a6('0x6e')][_0xc8a6('0x3f')](_0x2e7d55,{'type':db[_0xc8a6('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc8a6('0x36')](function(_0xab39ed){return _0xab39ed;});})['then'](function(_0x4d763e){if(_0x4d763e){_0x20fe9d[_0xc8a6('0x26')]['contact']=_0x4d763e[0x0];if(!_0x367c5e[_0xc8a6('0x56')][_0xc8a6('0x5f')])return;return db[_0xc8a6('0x7f')][_0xc8a6('0x54')]({'where':{'id':_0x367c5e[_0xc8a6('0x56')][_0xc8a6('0x5f')],'role':_0xc8a6('0x61')},'attributes':['id','name',_0xc8a6('0x72'),'email',_0xc8a6('0x74')],'raw':!![]});}return null;})[_0xc8a6('0x36')](function(_0x3cb766){if(!_0x3cb766)return null;_0x20fe9d[_0xc8a6('0x26')][_0xc8a6('0x61')]=_0x3cb766;return _0x20fe9d;})[_0xc8a6('0x36')](function(_0x121655){if(_0x121655){_0x121655[_0xc8a6('0x26')][_0xc8a6('0x75')]=util[_0xc8a6('0x65')](_0xc8a6('0x76'),_0x367c5e[_0xc8a6('0x60')][_0xc8a6('0x38')]);_0x121655['message']['channel']=_0x20fe9d[_0xc8a6('0x77')];_0x121655[_0xc8a6('0x26')][_0xc8a6('0x78')]=_0x20fe9d['channel'];_0x121655[_0xc8a6('0x26')][_0xc8a6('0x80')]='reject';respondWithRpcPromise(_0xc8a6('0x79'),'EventManager',{'event':_0xc8a6('0x81'),'message':_['merge'](_0x20fe9d[_0xc8a6('0x26')],JSON['parse'](_0x20fe9d[_0xc8a6('0x69')]['formData']))},client9002);return _0x20fe9d;}return null;})[_0xc8a6('0x36')](respondWithResult(_0x2b74de,null))[_0xc8a6('0x28')](handleError(_0x2b74de,null));};
\ No newline at end of file
+var _0x0923=['role','stringify','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','rejectmessage','formData','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','catch','status','json','undefined','count','offset','limit','set','reject','save','then','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','show','params','include','find','body','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','update','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2332ed,_0x1780ec){var _0x2be002=function(_0x198730){while(--_0x198730){_0x2332ed['push'](_0x2332ed['shift']());}};_0x2be002(++_0x1780ec);}(_0x0923,0x184));var _0x3092=function(_0x283001,_0x412b3a){_0x283001=_0x283001-0x0;var _0x57915e=_0x0923[_0x283001];return _0x57915e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3092('0x0'));var BPromise=require(_0x3092('0x1'));var Mustache=require(_0x3092('0x2'));var util=require(_0x3092('0x3'));var path=require('path');var sox=require(_0x3092('0x4'));var csv=require('to-csv');var ejs=require(_0x3092('0x5'));var fs=require('fs');var fs_extra=require(_0x3092('0x6'));var _=require(_0x3092('0x7'));var squel=require('squel');var crypto=require(_0x3092('0x8'));var jsforce=require(_0x3092('0x9'));var deskjs=require(_0x3092('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3092('0xb'));var qs=require(_0x3092('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3092('0xd'))('api');var utils=require(_0x3092('0xe'));var config=require(_0x3092('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x3092('0x10'))['db'];config[_0x3092('0x11')]=_[_0x3092('0x12')](config[_0x3092('0x11')],{'host':_0x3092('0x13'),'port':0x18eb});var socket=require(_0x3092('0x14'))(new Redis(config[_0x3092('0x11')]));require(_0x3092('0x15'))[_0x3092('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3092('0x17')][_0x3092('0x18')]({'port':0x232c});var client9002=jayson[_0x3092('0x17')][_0x3092('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x515242,_0x3241d0,_0x5a8cd6,_0x32576e){return new BPromise(function(_0x458351,_0x26fc1d){var _0x7f4fd=_0x32576e||client;return _0x7f4fd[_0x3092('0x19')](_0x515242,_0x5a8cd6)['then'](function(_0x8e6399){logger[_0x3092('0x1a')](_0x3092('0x1b'),_0x3241d0,_0x3092('0x1c'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3241d0,_0x3092('0x1c'),JSON['stringify'](_0x8e6399));if(_0x8e6399[_0x3092('0x1d')]){if(_0x8e6399[_0x3092('0x1d')]['code']===0x1f4){logger['error'](_0x3092('0x1b'),_0x3241d0,_0x8e6399[_0x3092('0x1d')]['message']);return _0x26fc1d(_0x8e6399[_0x3092('0x1d')][_0x3092('0x1e')]);}logger[_0x3092('0x1d')](_0x3092('0x1b'),_0x3241d0,_0x8e6399[_0x3092('0x1d')][_0x3092('0x1e')]);return _0x458351(_0x8e6399['error']['message']);}else{logger['info'](_0x3092('0x1b'),_0x3241d0,_0x3092('0x1c'));_0x458351(_0x8e6399['result']['message']);}})[_0x3092('0x1f')](function(_0x268ee3){logger[_0x3092('0x1d')](_0x3092('0x1b'),_0x3241d0,_0x268ee3);_0x26fc1d(_0x268ee3);});});}function respondWithStatusCode(_0x37ffac,_0x5f1435){_0x5f1435=_0x5f1435||0xcc;return function(_0x2cd339){if(_0x2cd339){return _0x37ffac['sendStatus'](_0x5f1435);}return _0x37ffac[_0x3092('0x20')](_0x5f1435)['end']();};}function respondWithResult(_0x445664,_0x33b9c4){_0x33b9c4=_0x33b9c4||0xc8;return function(_0x589ccd){if(_0x589ccd){return _0x445664[_0x3092('0x20')](_0x33b9c4)[_0x3092('0x21')](_0x589ccd);}};}function respondWithFilteredResult(_0xc67999,_0x1b3962){return function(_0x4159ee){if(_0x4159ee){var _0x10c4ac=typeof _0x1b3962['offset']===_0x3092('0x22')&&typeof _0x1b3962['limit']===_0x3092('0x22');var _0x279ed6=_0x4159ee[_0x3092('0x23')];var _0x6b8ab5=_0x10c4ac?0x0:_0x1b3962[_0x3092('0x24')];var _0x341762=_0x10c4ac?_0x4159ee['count']:_0x1b3962[_0x3092('0x24')]+_0x1b3962[_0x3092('0x25')];var _0xb0e69;if(_0x341762>=_0x279ed6){_0x341762=_0x279ed6;_0xb0e69=0xc8;}else{_0xb0e69=0xce;}_0xc67999[_0x3092('0x20')](_0xb0e69);return _0xc67999[_0x3092('0x26')]('Content-Range',_0x6b8ab5+'-'+_0x341762+'/'+_0x279ed6)[_0x3092('0x21')](_0x4159ee);}return null;};}function patchUpdates(_0x456196){return function(_0x301afd){try{jsonpatch['apply'](_0x301afd,_0x456196,!![]);}catch(_0x998243){return BPromise[_0x3092('0x27')](_0x998243);}return _0x301afd[_0x3092('0x28')]();};}function saveUpdates(_0x2951e9,_0x242e72){return function(_0xd5f9b9){if(_0xd5f9b9){return _0xd5f9b9['update'](_0x2951e9)[_0x3092('0x29')](function(_0x1e3500){return _0x1e3500;});}return null;};}function removeEntity(_0x1824a9,_0x580ca7){return function(_0x4d1110){if(_0x4d1110){return _0x4d1110[_0x3092('0x2a')]()[_0x3092('0x29')](function(){_0x1824a9[_0x3092('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ed5a,_0x3d89e2){return function(_0x9a3784){if(!_0x9a3784){_0x29ed5a['sendStatus'](0x194);}return _0x9a3784;};}function handleError(_0x5625a6,_0x1ab428){_0x1ab428=_0x1ab428||0x1f4;return function(_0x258690){logger['error'](_0x258690[_0x3092('0x2b')]);if(_0x258690['name']){delete _0x258690[_0x3092('0x2c')];}_0x5625a6[_0x3092('0x20')](_0x1ab428)['send'](_0x258690);};}exports[_0x3092('0x2d')]=function(_0x39a447,_0xf6575f){var _0x379b12={},_0x4dc81b={},_0x5c75f1={'count':0x0,'rows':[]};var _0x2aae1d=_[_0x3092('0x2e')](db[_0x3092('0x2f')][_0x3092('0x30')],function(_0x5b6ea8){return{'name':_0x5b6ea8[_0x3092('0x31')],'type':_0x5b6ea8[_0x3092('0x32')]['key']};});_0x4dc81b[_0x3092('0x33')]=_[_0x3092('0x2e')](_0x2aae1d,_0x3092('0x2c'));_0x4dc81b[_0x3092('0x34')]=_[_0x3092('0x35')](_0x39a447[_0x3092('0x34')]);_0x4dc81b[_0x3092('0x36')]=_['intersection'](_0x4dc81b[_0x3092('0x33')],_0x4dc81b[_0x3092('0x34')]);_0x379b12[_0x3092('0x37')]=_[_0x3092('0x38')](_0x4dc81b[_0x3092('0x33')],qs[_0x3092('0x39')](_0x39a447[_0x3092('0x34')]['fields']));_0x379b12['attributes']=_0x379b12[_0x3092('0x37')][_0x3092('0x3a')]?_0x379b12[_0x3092('0x37')]:_0x4dc81b[_0x3092('0x33')];if(!_0x39a447[_0x3092('0x34')][_0x3092('0x3b')](_0x3092('0x3c'))){_0x379b12['limit']=qs[_0x3092('0x25')](_0x39a447['query'][_0x3092('0x25')]);_0x379b12[_0x3092('0x24')]=qs[_0x3092('0x24')](_0x39a447['query'][_0x3092('0x24')]);}_0x379b12[_0x3092('0x3d')]=qs['sort'](_0x39a447[_0x3092('0x34')][_0x3092('0x3e')]);_0x379b12[_0x3092('0x3f')]=qs[_0x3092('0x36')](_['pick'](_0x39a447[_0x3092('0x34')],_0x4dc81b['filters']),_0x2aae1d);if(_0x39a447[_0x3092('0x34')][_0x3092('0x40')]){_0x379b12[_0x3092('0x3f')]=_[_0x3092('0x41')](_0x379b12['where'],{'$or':_[_0x3092('0x2e')](_0x2aae1d,function(_0x383f0f){if(_0x383f0f[_0x3092('0x32')]!==_0x3092('0x42')){var _0x4e1f38={};_0x4e1f38[_0x383f0f[_0x3092('0x2c')]]={'$like':'%'+_0x39a447[_0x3092('0x34')][_0x3092('0x40')]+'%'};return _0x4e1f38;}})});}_0x379b12=_[_0x3092('0x41')]({},_0x379b12,_0x39a447[_0x3092('0x43')]);var _0x1b2438={'where':_0x379b12[_0x3092('0x3f')]};return db[_0x3092('0x2f')][_0x3092('0x23')](_0x1b2438)[_0x3092('0x29')](function(_0x268f9c){_0x5c75f1[_0x3092('0x23')]=_0x268f9c;if(_0x39a447['query'][_0x3092('0x44')]){_0x379b12['include']=[{'all':!![]}];}return db[_0x3092('0x2f')]['findAll'](_0x379b12);})[_0x3092('0x29')](function(_0x3acce5){_0x5c75f1['rows']=_0x3acce5;return _0x5c75f1;})[_0x3092('0x29')](respondWithFilteredResult(_0xf6575f,_0x379b12))[_0x3092('0x1f')](handleError(_0xf6575f,null));};exports[_0x3092('0x45')]=function(_0x2b9afc,_0x710403){var _0x3f0973={'raw':!![],'where':{'id':_0x2b9afc[_0x3092('0x46')]['id']}},_0x392a88={};_0x392a88['model']=_[_0x3092('0x35')](db[_0x3092('0x2f')][_0x3092('0x30')]);_0x392a88[_0x3092('0x34')]=_[_0x3092('0x35')](_0x2b9afc[_0x3092('0x34')]);_0x392a88['filters']=_[_0x3092('0x38')](_0x392a88[_0x3092('0x33')],_0x392a88[_0x3092('0x34')]);_0x3f0973[_0x3092('0x37')]=_[_0x3092('0x38')](_0x392a88[_0x3092('0x33')],qs[_0x3092('0x39')](_0x2b9afc[_0x3092('0x34')]['fields']));_0x3f0973['attributes']=_0x3f0973['attributes'][_0x3092('0x3a')]?_0x3f0973['attributes']:_0x392a88[_0x3092('0x33')];if(_0x2b9afc[_0x3092('0x34')][_0x3092('0x44')]){_0x3f0973[_0x3092('0x47')]=[{'all':!![]}];}_0x3f0973=_[_0x3092('0x41')]({},_0x3f0973,_0x2b9afc[_0x3092('0x43')]);return db['ChatMessage'][_0x3092('0x48')](_0x3f0973)[_0x3092('0x29')](handleEntityNotFound(_0x710403,null))[_0x3092('0x29')](respondWithResult(_0x710403,null))[_0x3092('0x1f')](handleError(_0x710403,null));};exports['create']=function(_0xae1b30,_0x2f82c2){return db[_0x3092('0x2f')]['create'](_0xae1b30[_0x3092('0x49')],{})[_0x3092('0x29')](respondWithResult(_0x2f82c2,0xc9))['catch'](handleError(_0x2f82c2,null));};exports['update']=function(_0xbd25c1,_0x341358){if(_0xbd25c1['body']['id']){delete _0xbd25c1['body']['id'];}return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0xbd25c1[_0x3092('0x46')]['id']}})['then'](handleEntityNotFound(_0x341358,null))[_0x3092('0x29')](saveUpdates(_0xbd25c1['body'],null))['then'](respondWithResult(_0x341358,null))[_0x3092('0x1f')](handleError(_0x341358,null));};exports[_0x3092('0x2a')]=function(_0x42030c,_0x482263){return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0x42030c[_0x3092('0x46')]['id']}})[_0x3092('0x29')](handleEntityNotFound(_0x482263,null))[_0x3092('0x29')](removeEntity(_0x482263,null))[_0x3092('0x1f')](handleError(_0x482263,null));};exports[_0x3092('0x4a')]=function(_0x5b898e,_0x598f80){return db[_0x3092('0x2f')][_0x3092('0x4a')]()[_0x3092('0x29')](respondWithResult(_0x598f80,null))['catch'](handleError(_0x598f80,null));};var interaction_log=require(_0x3092('0xd'))(_0x3092('0x4b'));exports['accept']=function(_0x1109bd,_0x3292ad,_0x2ba227){var _0x26401a={'agent':{},'channel':'chat'};if(_0x1109bd[_0x3092('0x49')]['id']){delete _0x1109bd[_0x3092('0x49')]['id'];}_0x1109bd[_0x3092('0x49')][_0x3092('0x4c')]=!![];_0x1109bd[_0x3092('0x49')][_0x3092('0x4d')]=moment()[_0x3092('0x4e')](_0x3092('0x4f'));_0x1109bd['body']['UserId']=_0x1109bd[_0x3092('0x49')][_0x3092('0x50')]||_0x1109bd[_0x3092('0x51')]['id'];_0x26401a[_0x3092('0x52')]['id']=_0x1109bd['body'][_0x3092('0x50')];return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0x1109bd[_0x3092('0x46')]['id'],'UserId':null}})[_0x3092('0x29')](handleEntityNotFound(_0x3292ad,null))[_0x3092('0x29')](saveUpdates(_0x1109bd[_0x3092('0x49')],null))[_0x3092('0x29')](function(_0x39568f){if(_0x39568f){_0x26401a[_0x3092('0x1e')]=_0x39568f['get']({'plain':!![]});return db[_0x3092('0x53')]['find']({'where':{'id':_0x39568f['ChatInteractionId']}});}return null;})[_0x3092('0x29')](handleEntityNotFound(_0x3292ad,null))[_0x3092('0x29')](function(_0x5b3b95){if(_0x5b3b95){return _0x5b3b95[_0x3092('0x54')]({'UserId':_0x1109bd[_0x3092('0x49')][_0x3092('0x50')],'read1stAt':_[_0x3092('0x55')](_0x5b3b95['read1stAt'])?moment()[_0x3092('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3092('0x29')](function(_0x59bcde){if(_0x59bcde){_0x26401a[_0x3092('0x56')]=_0x59bcde['get']({'plain':!![]});interaction_log[_0x3092('0x1a')](_0x3092('0x57'),_0x1109bd[_0x3092('0x51')]['id'],_0x1109bd[_0x3092('0x51')]['name'],_0x1109bd['user'][_0x3092('0x58')],_0x26401a[_0x3092('0x56')]['id'],_0x1109bd['body']?JSON[_0x3092('0x59')](_0x1109bd[_0x3092('0x49')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3092('0x5a'),_0x26401a);}return null;})['then'](function(_0xedd0ce){var _0x5a128a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xedd0ce[_0x3092('0x1e')][_0x3092('0x5b')];return db[_0x3092('0x5c')][_0x3092('0x34')](_0x5a128a,{'type':db[_0x3092('0x5d')]['QueryTypes'][_0x3092('0x5e')],'raw':!![]})[_0x3092('0x29')](function(_0x61b92b){return _0x61b92b;});})[_0x3092('0x29')](function(_0x3e3bbf){if(_0x3e3bbf){_0x26401a['message'][_0x3092('0x5f')]=_0x3e3bbf[0x0];if(!_0x1109bd[_0x3092('0x49')][_0x3092('0x50')])return;return db[_0x3092('0x60')][_0x3092('0x48')]({'where':{'id':_0x1109bd[_0x3092('0x49')][_0x3092('0x50')],'role':_0x3092('0x52')},'attributes':['id',_0x3092('0x2c'),_0x3092('0x61'),_0x3092('0x62'),_0x3092('0x63')],'raw':!![]});}return null;})[_0x3092('0x29')](function(_0x53a6e7){if(!_0x53a6e7)return null;_0x26401a['message'][_0x3092('0x52')]=_0x53a6e7;return _0x26401a;})[_0x3092('0x29')](function(_0x304768){if(_0x304768){if(_0x1109bd[_0x3092('0x49')][_0x3092('0x64')]){_0x26401a[_0x3092('0x1e')][_0x3092('0x65')]=util['format'](_0x3092('0x66'),_0x1109bd[_0x3092('0x51')][_0x3092('0x2c')]);_0x26401a['message'][_0x3092('0x67')]=_0x26401a['channel'];_0x26401a[_0x3092('0x1e')][_0x3092('0x68')]=_0x26401a[_0x3092('0x67')];_0x26401a['message'][_0x3092('0x69')]=_0x3092('0x6a');return respondWithRpcPromise(_0x3092('0x6b'),_0x3092('0x6b'),{'event':_0x3092('0x6c'),'message':_['merge'](_0x26401a['message'],JSON[_0x3092('0x6d')](_0x26401a['interaction']['formData']))},client9002)['then'](function(){return _0x26401a;});}return _0x26401a;}return null;})[_0x3092('0x29')](respondWithResult(_0x3292ad,null))['catch'](handleError(_0x3292ad,null));};var interaction_log=require(_0x3092('0xd'))(_0x3092('0x4b'));exports['reject']=function(_0x4842af,_0x35d182,_0x3c95fb){var _0x5b87f5={'agent':{},'channel':'chat'};if(_0x4842af['body']['id']){delete _0x4842af['body']['id'];}_0x4842af[_0x3092('0x49')][_0x3092('0x50')]=_0x4842af[_0x3092('0x49')]['UserId']||_0x4842af['user']['id'];_0x5b87f5[_0x3092('0x52')]['id']=_0x4842af[_0x3092('0x49')]['UserId'];return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0x4842af[_0x3092('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35d182,null))[_0x3092('0x29')](function(_0x1fe6d7){if(_0x1fe6d7){_0x5b87f5[_0x3092('0x1e')]=_0x1fe6d7[_0x3092('0x6e')]({'plain':!![]});return db[_0x3092('0x53')][_0x3092('0x48')]({'where':{'id':_0x1fe6d7[_0x3092('0x6f')]}});}return null;})[_0x3092('0x29')](handleEntityNotFound(_0x35d182,null))[_0x3092('0x29')](function(_0x510e3f){if(_0x510e3f){_0x5b87f5[_0x3092('0x56')]=_0x510e3f[_0x3092('0x6e')]({'plain':!![]});interaction_log[_0x3092('0x1a')](_0x3092('0x70'),_0x4842af[_0x3092('0x51')]['id'],_0x4842af[_0x3092('0x51')][_0x3092('0x2c')],_0x4842af[_0x3092('0x51')][_0x3092('0x58')],_0x5b87f5['interaction']['id'],_0x4842af[_0x3092('0x49')]?JSON[_0x3092('0x59')](_0x4842af[_0x3092('0x49')]):_0x3092('0x71'));return respondWithRpcPromise('RejectMessage',_0x3092('0x72'),_0x5b87f5);}return null;})[_0x3092('0x29')](function(_0x11ddf9){var _0x4f84a4=_0x3092('0x73')+_0x11ddf9[_0x3092('0x1e')][_0x3092('0x5b')];return db[_0x3092('0x5c')][_0x3092('0x34')](_0x4f84a4,{'type':db[_0x3092('0x5d')][_0x3092('0x74')][_0x3092('0x5e')],'raw':!![]})[_0x3092('0x29')](function(_0x3d862e){return _0x3d862e;});})[_0x3092('0x29')](function(_0x5a7dde){if(_0x5a7dde){_0x5b87f5['message'][_0x3092('0x5f')]=_0x5a7dde[0x0];if(!_0x4842af[_0x3092('0x49')][_0x3092('0x50')])return;return db['User'][_0x3092('0x48')]({'where':{'id':_0x4842af['body']['UserId'],'role':'agent'},'attributes':['id',_0x3092('0x2c'),_0x3092('0x61'),_0x3092('0x62'),_0x3092('0x63')],'raw':!![]});}return null;})[_0x3092('0x29')](function(_0x9cf8c1){if(!_0x9cf8c1)return null;_0x5b87f5[_0x3092('0x1e')][_0x3092('0x52')]=_0x9cf8c1;return _0x5b87f5;})[_0x3092('0x29')](function(_0xe48ce7){if(_0xe48ce7){_0xe48ce7[_0x3092('0x1e')][_0x3092('0x65')]=util[_0x3092('0x4e')](_0x3092('0x66'),_0x4842af['user'][_0x3092('0x2c')]);_0xe48ce7['message'][_0x3092('0x67')]=_0x5b87f5[_0x3092('0x67')];_0xe48ce7[_0x3092('0x1e')]['motionChannel']=_0x5b87f5['channel'];_0xe48ce7[_0x3092('0x1e')][_0x3092('0x69')]=_0x3092('0x27');respondWithRpcPromise(_0x3092('0x6b'),_0x3092('0x6b'),{'event':_0x3092('0x75'),'message':_['merge'](_0x5b87f5[_0x3092('0x1e')],JSON[_0x3092('0x6d')](_0x5b87f5[_0x3092('0x56')][_0x3092('0x76')]))},client9002);return _0x5b87f5;}return null;})['then'](respondWithResult(_0x35d182,null))[_0x3092('0x1f')](handleError(_0x35d182,null));};
\ No newline at end of file
index fdcc4a1..4708151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x013f=['emit','hook','exports','events','setMaxListeners','update','remove'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0x013f,0x1e6));var _0xf013=function(_0x5ac5c7,_0x346df2){_0x5ac5c7=_0x5ac5c7-0x0;var _0x1b4560=_0x013f[_0x5ac5c7];return _0x1b4560;};'use strict';var EventEmitter=require(_0xf013('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf013('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf013('0x2'),'afterDestroy':_0xf013('0x3')};function emitEvent(_0x2285ab){return function(_0x37bd4f,_0x24cf6d,_0x4fb3e6){ChatMessageEvents[_0xf013('0x4')](_0x2285ab+':'+_0x37bd4f['id'],_0x37bd4f);ChatMessageEvents[_0xf013('0x4')](_0x2285ab,_0x37bd4f);_0x4fb3e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf013('0x5')](e,emitEvent(event));}}module[_0xf013('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0xb047=['update','remove','emit','hook','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb047,0x1c4));var _0x7b04=function(_0x213e14,_0x3f4564){_0x213e14=_0x213e14-0x0;var _0xe1d980=_0xb047[_0x213e14];return _0xe1d980;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7b04('0x0'))['db'][_0x7b04('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7b04('0x2')](0x0);var events={'afterCreate':_0x7b04('0x3'),'afterUpdate':_0x7b04('0x4'),'afterDestroy':_0x7b04('0x5')};function emitEvent(_0x297442){return function(_0x419af9,_0x4fd200,_0x3e81b9){ChatMessageEvents[_0x7b04('0x6')](_0x297442+':'+_0x419af9['id'],_0x419af9);ChatMessageEvents[_0x7b04('0x6')](_0x297442,_0x419af9);_0x3e81b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7b04('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 6de7c1b..8881a52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcb8=['secret','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','toLowerCase','direction','out'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0xbcb8,0x1c9));var _0x8bcb=function(_0x2138bf,_0x2f01cf){_0x2138bf=_0x2138bf-0x0;var _0x129a73=_0xbcb8[_0x2138bf];return _0x129a73;};'use strict';var _=require(_0x8bcb('0x0'));var util=require(_0x8bcb('0x1'));var logger=require(_0x8bcb('0x2'))('api');var moment=require(_0x8bcb('0x3'));var BPromise=require(_0x8bcb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bcb('0x5'));var rimraf=require(_0x8bcb('0x6'));var config=require(_0x8bcb('0x7'));var attributes=require(_0x8bcb('0x8'));module['exports']=function(_0x2d2247,_0x22281f){return _0x2d2247[_0x8bcb('0x9')](_0x8bcb('0xa'),attributes,{'tableName':_0x8bcb('0xb'),'paranoid':![],'indexes':[{'name':_0x8bcb('0xc'),'fields':[_0x8bcb('0xd')],'type':_0x8bcb('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dfcdf,_0x63a31f,_0x1429c0){var _0x5e366e=_0x2d2247['models'];var _0x371e63=_0x3dfcdf[_0x8bcb('0xf')]({'plain':!![]});if(_0x371e63['direction'][_0x8bcb('0x10')]()==='in'||_0x371e63[_0x8bcb('0x11')]['toLowerCase']()===_0x8bcb('0x12')&&!_0x371e63[_0x8bcb('0x13')]&&!_['isNil'](_0x371e63['UserId'])){_0x5e366e['ChatInteraction'][_0x8bcb('0x14')]({'where':{'id':_0x371e63[_0x8bcb('0x15')]}})['then'](function(_0x26ee77){if(_0x26ee77){_0x26ee77[_0x8bcb('0x16')]({'lastMsgAt':_0x371e63[_0x8bcb('0x17')],'lastMsgDirection':_0x371e63['direction']['toLowerCase']()});}})[_0x8bcb('0x18')](function(_0x20c833){console[_0x8bcb('0x19')](_0x20c833);});}_0x1429c0();}},'charset':_0x8bcb('0x1a'),'collate':_0x8bcb('0x1b')});};
\ No newline at end of file
+var _0xda3f=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','get','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','update','direction','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1dece2,_0x3e6adf){var _0x3a1cfc=function(_0x413d6a){while(--_0x413d6a){_0x1dece2['push'](_0x1dece2['shift']());}};_0x3a1cfc(++_0x3e6adf);}(_0xda3f,0x120));var _0xfda3=function(_0x45233b,_0x68aeee){_0x45233b=_0x45233b-0x0;var _0x188c4b=_0xda3f[_0x45233b];return _0x188c4b;};'use strict';var _=require(_0xfda3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfda3('0x1'));var moment=require(_0xfda3('0x2'));var BPromise=require(_0xfda3('0x3'));var rp=require(_0xfda3('0x4'));var fs=require('fs');var path=require(_0xfda3('0x5'));var rimraf=require('rimraf');var config=require(_0xfda3('0x6'));var attributes=require(_0xfda3('0x7'));module['exports']=function(_0x3462b5,_0x4c26c6){return _0x3462b5[_0xfda3('0x8')](_0xfda3('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfe44a,_0x506d0c,_0x1b1a6c){var _0x3e1245=_0x3462b5['models'];var _0xe3db39=_0xfe44a[_0xfda3('0xa')]({'plain':!![]});if(_0xe3db39['direction'][_0xfda3('0xb')]()==='in'||_0xe3db39['direction'][_0xfda3('0xb')]()===_0xfda3('0xc')&&!_0xe3db39[_0xfda3('0xd')]&&!_[_0xfda3('0xe')](_0xe3db39[_0xfda3('0xf')])){_0x3e1245[_0xfda3('0x10')][_0xfda3('0x11')]({'where':{'id':_0xe3db39['ChatInteractionId']}})['then'](function(_0x5b6ddd){if(_0x5b6ddd){_0x5b6ddd[_0xfda3('0x12')]({'lastMsgAt':_0xe3db39['createdAt'],'lastMsgDirection':_0xe3db39[_0xfda3('0x13')][_0xfda3('0xb')]()});}})[_0xfda3('0x14')](function(_0x56f6c2){console[_0xfda3('0x15')](_0x56f6c2);});}_0x1b1a6c();}},'charset':_0xfda3('0x16'),'collate':_0xfda3('0x17')});};
\ No newline at end of file
index e382805..b253907 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b3b=['request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateChatMessage','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','request','then','ChatMessage,\x20%s,\x20%s'];(function(_0x2703fd,_0x3b5705){var _0x584a20=function(_0x15297f){while(--_0x15297f){_0x2703fd['push'](_0x2703fd['shift']());}};_0x584a20(++_0x3b5705);}(_0x0b3b,0xcd));var _0xb0b3=function(_0xb36a60,_0x5c2659){_0xb36a60=_0xb36a60-0x0;var _0x5e5aad=_0x0b3b[_0xb36a60];return _0x5e5aad;};'use strict';var _=require('lodash');var util=require(_0xb0b3('0x0'));var moment=require(_0xb0b3('0x1'));var BPromise=require(_0xb0b3('0x2'));var rs=require(_0xb0b3('0x3'));var fs=require('fs');var Redis=require(_0xb0b3('0x4'));var db=require(_0xb0b3('0x5'))['db'];var utils=require(_0xb0b3('0x6'));var logger=require(_0xb0b3('0x7'))(_0xb0b3('0x8'));var config=require(_0xb0b3('0x9'));var jayson=require(_0xb0b3('0xa'));var client=jayson['client'][_0xb0b3('0xb')]({'port':0x232a});config['redis']=_[_0xb0b3('0xc')](config[_0xb0b3('0xd')],{'host':_0xb0b3('0xe'),'port':0x18eb});var socket=require(_0xb0b3('0xf'))(new Redis(config[_0xb0b3('0xd')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x546ada,_0x323dac,_0xf13f89){return new BPromise(function(_0x1bd4fe,_0x4593ed){return client[_0xb0b3('0x10')](_0x546ada,_0xf13f89)[_0xb0b3('0x11')](function(_0x41bac7){logger['info'](_0xb0b3('0x12'),_0x323dac,_0xb0b3('0x13'));logger['debug'](_0xb0b3('0x14'),_0x323dac,'request\x20sent',JSON[_0xb0b3('0x15')](_0x41bac7));if(_0x41bac7[_0xb0b3('0x16')]){if(_0x41bac7[_0xb0b3('0x16')][_0xb0b3('0x17')]===0x1f4){logger[_0xb0b3('0x16')](_0xb0b3('0x12'),_0x323dac,_0x41bac7[_0xb0b3('0x16')][_0xb0b3('0x18')]);return _0x4593ed(_0x41bac7[_0xb0b3('0x16')]['message']);}logger[_0xb0b3('0x16')](_0xb0b3('0x12'),_0x323dac,_0x41bac7['error'][_0xb0b3('0x18')]);return _0x1bd4fe(_0x41bac7[_0xb0b3('0x16')]['message']);}else{logger[_0xb0b3('0x19')](_0xb0b3('0x12'),_0x323dac,'request\x20sent');_0x1bd4fe(_0x41bac7['result'][_0xb0b3('0x18')]);}})['catch'](function(_0x55a2b3){logger[_0xb0b3('0x16')](_0xb0b3('0x12'),_0x323dac,_0x55a2b3);_0x4593ed(_0x55a2b3);});});}exports[_0xb0b3('0x1a')]=function(_0x6ac39){var _0x3bbbf7=this;return new Promise(function(_0x1a5ee2,_0x3b48bf){return db['ChatMessage'][_0xb0b3('0x1b')](_0x6ac39[_0xb0b3('0x1c')],{'raw':_0x6ac39['options']?_0x6ac39[_0xb0b3('0x1d')][_0xb0b3('0x1e')]===undefined?!![]:![]:!![]})[_0xb0b3('0x11')](function(_0x1f52f2){logger[_0xb0b3('0x19')]('CreateChatMessage',_0x6ac39);logger['debug'](_0xb0b3('0x1a'),_0x6ac39,JSON[_0xb0b3('0x15')](_0x1f52f2));_0x1a5ee2(_0x1f52f2);})[_0xb0b3('0x1f')](function(_0x4f7dda){logger[_0xb0b3('0x16')](_0xb0b3('0x1a'),_0x4f7dda['message'],_0x6ac39);_0x3b48bf(_0x3bbbf7['error'](0x1f4,_0x4f7dda[_0xb0b3('0x18')]));});});};
\ No newline at end of file
+var _0x8297=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateChatMessage','ChatMessage','body','options','raw'];(function(_0x54ae7b,_0x12be0a){var _0x337021=function(_0x40c38f){while(--_0x40c38f){_0x54ae7b['push'](_0x54ae7b['shift']());}};_0x337021(++_0x12be0a);}(_0x8297,0x18c));var _0x7829=function(_0x39dbf9,_0x3118ab){_0x39dbf9=_0x39dbf9-0x0;var _0x49785c=_0x8297[_0x39dbf9];return _0x49785c;};'use strict';var _=require(_0x7829('0x0'));var util=require(_0x7829('0x1'));var moment=require(_0x7829('0x2'));var BPromise=require(_0x7829('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7829('0x4'));var db=require(_0x7829('0x5'))['db'];var utils=require(_0x7829('0x6'));var logger=require(_0x7829('0x7'))(_0x7829('0x8'));var config=require(_0x7829('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7829('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7829('0xb')](config[_0x7829('0xc')],{'host':_0x7829('0xd'),'port':0x18eb});var socket=require(_0x7829('0xe'))(new Redis(config[_0x7829('0xc')]));require(_0x7829('0xf'))[_0x7829('0x10')](socket);function respondWithRpcPromise(_0x474d4d,_0x3ba981,_0x305f01){return new BPromise(function(_0x3639db,_0xa8550f){return client[_0x7829('0x11')](_0x474d4d,_0x305f01)[_0x7829('0x12')](function(_0x52317a){logger['info'](_0x7829('0x13'),_0x3ba981,_0x7829('0x14'));logger[_0x7829('0x15')](_0x7829('0x16'),_0x3ba981,'request\x20sent',JSON[_0x7829('0x17')](_0x52317a));if(_0x52317a['error']){if(_0x52317a[_0x7829('0x18')]['code']===0x1f4){logger[_0x7829('0x18')](_0x7829('0x13'),_0x3ba981,_0x52317a['error']['message']);return _0xa8550f(_0x52317a[_0x7829('0x18')][_0x7829('0x19')]);}logger[_0x7829('0x18')](_0x7829('0x13'),_0x3ba981,_0x52317a[_0x7829('0x18')][_0x7829('0x19')]);return _0x3639db(_0x52317a[_0x7829('0x18')]['message']);}else{logger[_0x7829('0x1a')](_0x7829('0x13'),_0x3ba981,'request\x20sent');_0x3639db(_0x52317a['result'][_0x7829('0x19')]);}})[_0x7829('0x1b')](function(_0x566e19){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3ba981,_0x566e19);_0xa8550f(_0x566e19);});});}exports[_0x7829('0x1c')]=function(_0x58ee11){var _0x384d18=this;return new Promise(function(_0x226135,_0x26dae0){return db[_0x7829('0x1d')]['create'](_0x58ee11[_0x7829('0x1e')],{'raw':_0x58ee11[_0x7829('0x1f')]?_0x58ee11[_0x7829('0x1f')][_0x7829('0x20')]===undefined?!![]:![]:!![]})[_0x7829('0x12')](function(_0x223512){logger['info'](_0x7829('0x1c'),_0x58ee11);logger['debug'](_0x7829('0x1c'),_0x58ee11,JSON[_0x7829('0x17')](_0x223512));_0x226135(_0x223512);})['catch'](function(_0x379061){logger['error'](_0x7829('0x1c'),_0x379061['message'],_0x58ee11);_0x26dae0(_0x384d18[_0x7829('0x18')](0x1f4,_0x379061[_0x7829('0x19')]));});});};
\ No newline at end of file
index ad3f2fc..fa74057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['./chatMessage.events','save','emit','length'];(function(_0x4564f6,_0x5b5064){var _0x50005b=function(_0xb856bd){while(--_0xb856bd){_0x4564f6['push'](_0x4564f6['shift']());}};_0x50005b(++_0x5b5064);}(_0x4b84,0x1cc));var _0x44b8=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x4b84[_0x328b1c];return _0x4dbeaa;};'use strict';var ChatMessageEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatMessageEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatMessage:'+_0x5947f7,_0x55f25d);ChatMessageEvents['on'](_0x5947f7,_0x3e87c5);}};
\ No newline at end of file
+var _0x72b1=['register','length','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x72b1,0x16e));var _0x172b=function(_0x41048d,_0x25d4f4){_0x41048d=_0x41048d-0x0;var _0x1284ee=_0x72b1[_0x41048d];return _0x1284ee;};'use strict';var ChatMessageEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatMessageEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatMessage:'+_0x517363,_0x475fd6);ChatMessageEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
index 659db57..efd9c65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x519b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x519b,0x7d));var _0xb519=function(_0x362057,_0x448ff9){_0x362057=_0x362057-0x0;var _0x397f79=_0x519b[_0x362057];return _0x397f79;};'use strict';var multer=require(_0xb519('0x0'));var util=require(_0xb519('0x1'));var path=require(_0xb519('0x2'));var timeout=require(_0xb519('0x3'));var express=require(_0xb519('0x4'));var router=express[_0xb519('0x5')]();var fs_extra=require(_0xb519('0x6'));var auth=require(_0xb519('0x7'));var interaction=require(_0xb519('0x8'));var config=require(_0xb519('0x9'));var controller=require('./chatMessage.controller');router[_0xb519('0xa')]('/',auth[_0xb519('0xb')](),controller[_0xb519('0xc')]);router['get'](_0xb519('0xd'),auth[_0xb519('0xb')](),controller['describe']);router[_0xb519('0xa')](_0xb519('0xe'),auth[_0xb519('0xb')](),controller[_0xb519('0xf')]);router[_0xb519('0x10')]('/',auth[_0xb519('0xb')](),interaction[_0xb519('0x11')]('chat',_0xb519('0x12')),controller[_0xb519('0x13')]);router[_0xb519('0x14')](_0xb519('0xe'),controller['update']);router[_0xb519('0x14')](_0xb519('0x15'),auth[_0xb519('0xb')](),controller[_0xb519('0x16')]);router[_0xb519('0x14')](_0xb519('0x17'),auth[_0xb519('0xb')](),controller['reject']);router[_0xb519('0x18')]('/:id',auth[_0xb519('0xb')](),controller['destroy']);module[_0xb519('0x19')]=router;
\ No newline at end of file
+var _0x72ed=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','chatmessage:create','/:id','update','put','/:id/accept','accept','/:id/reject'];(function(_0x5d2e9d,_0xf6d965){var _0x4e0a11=function(_0x419594){while(--_0x419594){_0x5d2e9d['push'](_0x5d2e9d['shift']());}};_0x4e0a11(++_0xf6d965);}(_0x72ed,0x15b));var _0xd72e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x72ed[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0xd72e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd72e('0x1'));var express=require(_0xd72e('0x2'));var router=express[_0xd72e('0x3')]();var fs_extra=require(_0xd72e('0x4'));var auth=require(_0xd72e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd72e('0x6'));router[_0xd72e('0x7')]('/',auth[_0xd72e('0x8')](),controller[_0xd72e('0x9')]);router[_0xd72e('0x7')](_0xd72e('0xa'),auth[_0xd72e('0x8')](),controller['describe']);router[_0xd72e('0x7')]('/:id',auth[_0xd72e('0x8')](),controller[_0xd72e('0xb')]);router[_0xd72e('0xc')]('/',auth['isAuthenticated'](),interaction[_0xd72e('0xd')]('chat',_0xd72e('0xe')),controller['create']);router['put'](_0xd72e('0xf'),controller[_0xd72e('0x10')]);router[_0xd72e('0x11')](_0xd72e('0x12'),auth['isAuthenticated'](),controller[_0xd72e('0x13')]);router[_0xd72e('0x11')](_0xd72e('0x14'),auth['isAuthenticated'](),controller['reject']);router['delete']('/:id',auth[_0xd72e('0x8')](),controller[_0xd72e('0x15')]);module[_0xd72e('0x16')]=router;
\ No newline at end of file
index f7e4a2f..a161875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x761f=['TEXT','medium','sequelize','exports'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x761f,0x11e));var _0xf761=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x761f[_0x261522];return _0x98a25a;};'use strict';var Sequelize=require(_0xf761('0x0'));module[_0xf761('0x1')]={'body':{'type':Sequelize[_0xf761('0x2')](_0xf761('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x4806=['exports','TEXT','sequelize'];(function(_0x2fc5d4,_0x514199){var _0x3b273c=function(_0x46665a){while(--_0x46665a){_0x2fc5d4['push'](_0x2fc5d4['shift']());}};_0x3b273c(++_0x514199);}(_0x4806,0xb3));var _0x6480=function(_0x434bab,_0x17d564){_0x434bab=_0x434bab-0x0;var _0x39db99=_0x4806[_0x434bab];return _0x39db99;};'use strict';var Sequelize=require(_0x6480('0x0'));module[_0x6480('0x1')]={'body':{'type':Sequelize[_0x6480('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
index 3a02518..71486ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x51750f,_0x4326bd){_0x51750f=_0x51750f-0x0;var _0x478421=_0x7a54[_0x51750f];return _0x478421;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x811d27,_0x4eaa4f){var _0x150234=function(_0x4d2cb1){while(--_0x4d2cb1){_0x811d27['push'](_0x811d27['shift']());}};_0x150234(++_0x4eaa4f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index b580372..98fa741 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf55e=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x3b2596,_0x20becd){var _0x59fe32=function(_0x4369c1){while(--_0x4369c1){_0x3b2596['push'](_0x3b2596['shift']());}};_0x59fe32(++_0x20becd);}(_0xf55e,0xe5));var _0xef55=function(_0x244992,_0x5b22f6){_0x244992=_0x244992-0x0;var _0x386912=_0xf55e[_0x244992];return _0x386912;};'use strict';var _=require(_0xef55('0x0'));var util=require(_0xef55('0x1'));var logger=require(_0xef55('0x2'))('api');var moment=require('moment');var BPromise=require(_0xef55('0x3'));var rp=require(_0xef55('0x4'));var fs=require('fs');var path=require(_0xef55('0x5'));var rimraf=require(_0xef55('0x6'));var config=require(_0xef55('0x7'));var attributes=require(_0xef55('0x8'));module[_0xef55('0x9')]=function(_0x1db6e5,_0x5a109d){return _0x1db6e5[_0xef55('0xa')](_0xef55('0xb'),attributes,{'tableName':_0xef55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef55('0xd'),'collate':_0xef55('0xe')});};
\ No newline at end of file
+var _0xf2a3=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x9dc752,_0x49e38e){var _0x4e051b=function(_0x5087dc){while(--_0x5087dc){_0x9dc752['push'](_0x9dc752['shift']());}};_0x4e051b(++_0x49e38e);}(_0xf2a3,0x118));var _0x3f2a=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xf2a3[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x3f2a('0x0'));var util=require(_0x3f2a('0x1'));var logger=require(_0x3f2a('0x2'))(_0x3f2a('0x3'));var moment=require('moment');var BPromise=require(_0x3f2a('0x4'));var rp=require(_0x3f2a('0x5'));var fs=require('fs');var path=require(_0x3f2a('0x6'));var rimraf=require('rimraf');var config=require(_0x3f2a('0x7'));var attributes=require(_0x3f2a('0x8'));module['exports']=function(_0x565af1,_0xa0bf36){return _0x565af1[_0x3f2a('0x9')](_0x3f2a('0xa'),attributes,{'tableName':_0x3f2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f2a('0xc'),'collate':_0x3f2a('0xd')});};
\ No newline at end of file
index f7248db..4d8ccde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cb5=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xd976c2,_0x1cd473){var _0x3dac6a=function(_0x557616){while(--_0x557616){_0xd976c2['push'](_0xd976c2['shift']());}};_0x3dac6a(++_0x1cd473);}(_0x5cb5,0xd9));var _0x55cb=function(_0x5ab7b8,_0xdee83f){_0x5ab7b8=_0x5ab7b8-0x0;var _0x1fa78e=_0x5cb5[_0x5ab7b8];return _0x1fa78e;};'use strict';var _=require(_0x55cb('0x0'));var util=require('util');var moment=require(_0x55cb('0x1'));var BPromise=require(_0x55cb('0x2'));var rs=require(_0x55cb('0x3'));var fs=require('fs');var Redis=require(_0x55cb('0x4'));var db=require(_0x55cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x55cb('0x6'))(_0x55cb('0x7'));var config=require(_0x55cb('0x8'));var jayson=require(_0x55cb('0x9'));var client=jayson[_0x55cb('0xa')][_0x55cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c6108,_0x272089,_0x2b0084){return new BPromise(function(_0x1082ef,_0x2b744e){return client[_0x55cb('0xc')](_0x2c6108,_0x2b0084)[_0x55cb('0xd')](function(_0x315bc0){logger[_0x55cb('0xe')](_0x55cb('0xf'),_0x272089,_0x55cb('0x10'));logger[_0x55cb('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x272089,_0x55cb('0x10'),JSON[_0x55cb('0x12')](_0x315bc0));if(_0x315bc0['error']){if(_0x315bc0[_0x55cb('0x13')][_0x55cb('0x14')]===0x1f4){logger[_0x55cb('0x13')](_0x55cb('0xf'),_0x272089,_0x315bc0[_0x55cb('0x13')][_0x55cb('0x15')]);return _0x2b744e(_0x315bc0[_0x55cb('0x13')][_0x55cb('0x15')]);}logger[_0x55cb('0x13')](_0x55cb('0xf'),_0x272089,_0x315bc0[_0x55cb('0x13')][_0x55cb('0x15')]);return _0x1082ef(_0x315bc0['error'][_0x55cb('0x15')]);}else{logger['info'](_0x55cb('0xf'),_0x272089,_0x55cb('0x10'));_0x1082ef(_0x315bc0['result'][_0x55cb('0x15')]);}})[_0x55cb('0x16')](function(_0x588433){logger[_0x55cb('0x13')](_0x55cb('0xf'),_0x272089,_0x588433);_0x2b744e(_0x588433);});});}
\ No newline at end of file
+var _0x72bb=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x72bb,0x14a));var _0xb72b=function(_0x47f719,_0x2e559d){_0x47f719=_0x47f719-0x0;var _0x407f4e=_0x72bb[_0x47f719];return _0x407f4e;};'use strict';var _=require(_0xb72b('0x0'));var util=require(_0xb72b('0x1'));var moment=require(_0xb72b('0x2'));var BPromise=require(_0xb72b('0x3'));var rs=require(_0xb72b('0x4'));var fs=require('fs');var Redis=require(_0xb72b('0x5'));var db=require(_0xb72b('0x6'))['db'];var utils=require(_0xb72b('0x7'));var logger=require(_0xb72b('0x8'))(_0xb72b('0x9'));var config=require(_0xb72b('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1385b9,_0x3940cd,_0x21b085){return new BPromise(function(_0x303f45,_0x3e0768){return client[_0xb72b('0xb')](_0x1385b9,_0x21b085)[_0xb72b('0xc')](function(_0x3c922e){logger['info'](_0xb72b('0xd'),_0x3940cd,_0xb72b('0xe'));logger[_0xb72b('0xf')](_0xb72b('0x10'),_0x3940cd,'request\x20sent',JSON[_0xb72b('0x11')](_0x3c922e));if(_0x3c922e['error']){if(_0x3c922e['error']['code']===0x1f4){logger[_0xb72b('0x12')](_0xb72b('0xd'),_0x3940cd,_0x3c922e[_0xb72b('0x12')][_0xb72b('0x13')]);return _0x3e0768(_0x3c922e['error'][_0xb72b('0x13')]);}logger[_0xb72b('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3940cd,_0x3c922e[_0xb72b('0x12')][_0xb72b('0x13')]);return _0x303f45(_0x3c922e[_0xb72b('0x12')][_0xb72b('0x13')]);}else{logger[_0xb72b('0x14')](_0xb72b('0xd'),_0x3940cd,_0xb72b('0xe'));_0x303f45(_0x3c922e[_0xb72b('0x15')][_0xb72b('0x13')]);}})[_0xb72b('0x16')](function(_0x53c05d){logger[_0xb72b('0x12')](_0xb72b('0xd'),_0x3940cd,_0x53c05d);_0x3e0768(_0x53c05d);});});}
\ No newline at end of file
index 52a24c2..86a0b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b25=['../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','describe','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5b25,0x1a4));var _0x55b2=function(_0x4a890a,_0x27a853){_0x4a890a=_0x4a890a-0x0;var _0x1860ba=_0x5b25[_0x4a890a];return _0x1860ba;};'use strict';var multer=require(_0x55b2('0x0'));var util=require(_0x55b2('0x1'));var path=require(_0x55b2('0x2'));var timeout=require(_0x55b2('0x3'));var express=require('express');var router=express[_0x55b2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x55b2('0x5'));var config=require('../../config/environment');var controller=require(_0x55b2('0x6'));router['get']('/',auth[_0x55b2('0x7')](),controller[_0x55b2('0x8')]);router[_0x55b2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x55b2('0xa')]);router['get']('/:id',auth[_0x55b2('0x7')](),controller[_0x55b2('0xb')]);router['post']('/',auth[_0x55b2('0x7')](),controller['create']);router[_0x55b2('0xc')](_0x55b2('0xd'),auth[_0x55b2('0x7')](),controller[_0x55b2('0xe')]);router['delete']('/:id',auth[_0x55b2('0x7')](),controller[_0x55b2('0xf')]);module[_0x55b2('0x10')]=router;
\ No newline at end of file
+var _0xb417=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x4568a4,_0x1cbef0){var _0x48b612=function(_0x37671a){while(--_0x37671a){_0x4568a4['push'](_0x4568a4['shift']());}};_0x48b612(++_0x1cbef0);}(_0xb417,0xba));var _0x7b41=function(_0x362256,_0x4f8638){_0x362256=_0x362256-0x0;var _0xfa7997=_0xb417[_0x362256];return _0xfa7997;};'use strict';var multer=require(_0x7b41('0x0'));var util=require(_0x7b41('0x1'));var path=require(_0x7b41('0x2'));var timeout=require(_0x7b41('0x3'));var express=require(_0x7b41('0x4'));var router=express['Router']();var fs_extra=require(_0x7b41('0x5'));var auth=require(_0x7b41('0x6'));var interaction=require(_0x7b41('0x7'));var config=require('../../config/environment');var controller=require(_0x7b41('0x8'));router[_0x7b41('0x9')]('/',auth[_0x7b41('0xa')](),controller[_0x7b41('0xb')]);router[_0x7b41('0x9')]('/describe',auth[_0x7b41('0xa')](),controller[_0x7b41('0xc')]);router['get']('/:id',auth[_0x7b41('0xa')](),controller[_0x7b41('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b41('0xe')]);router[_0x7b41('0xf')](_0x7b41('0x10'),auth[_0x7b41('0xa')](),controller[_0x7b41('0x11')]);router[_0x7b41('0x12')](_0x7b41('0x10'),auth[_0x7b41('0xa')](),controller[_0x7b41('0x13')]);module[_0x7b41('0x14')]=router;
\ No newline at end of file
index 6d183ca..2279bbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1271=['exports','STRING','ENUM','mouseOver','INTEGER'];(function(_0x3ec8e4,_0x46c2bd){var _0x401828=function(_0x3f8cc6){while(--_0x3f8cc6){_0x3ec8e4['push'](_0x3ec8e4['shift']());}};_0x401828(++_0x46c2bd);}(_0x1271,0xc8));var _0x1127=function(_0x133a81,_0x31e6c7){_0x133a81=_0x133a81-0x0;var _0x3adcab=_0x1271[_0x133a81];return _0x3adcab;};'use strict';var Sequelize=require('sequelize');module[_0x1127('0x0')]={'name':{'type':Sequelize[_0x1127('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1127('0x2')](_0x1127('0x3'),'timeout'),'defaultValue':_0x1127('0x3')},'selector':{'type':Sequelize[_0x1127('0x1')]},'timeout':{'type':Sequelize[_0x1127('0x4')]}};
\ No newline at end of file
+var _0x1d8f=['STRING','ENUM','timeout','mouseOver','INTEGER','sequelize','exports'];(function(_0x3382e2,_0x2e26ba){var _0x3b000b=function(_0x2cdff3){while(--_0x2cdff3){_0x3382e2['push'](_0x3382e2['shift']());}};_0x3b000b(++_0x2e26ba);}(_0x1d8f,0x75));var _0xf1d8=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1d8f[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0xf1d8('0x0'));module[_0xf1d8('0x1')]={'name':{'type':Sequelize[_0xf1d8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf1d8('0x3')]('mouseOver',_0xf1d8('0x4')),'defaultValue':_0xf1d8('0x5')},'selector':{'type':Sequelize[_0xf1d8('0x2')]},'timeout':{'type':Sequelize[_0xf1d8('0x6')]}};
\ No newline at end of file
index 443d29a..72166fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1696=['catch','body','find','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','end','error','send','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','include','merge'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x1696,0x79));var _0x6169=function(_0x327efb,_0xcd8cae){_0x327efb=_0x327efb-0x0;var _0x2b4fb5=_0x1696[_0x327efb];return _0x2b4fb5;};'use strict';var emlformat=require(_0x6169('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6169('0x1'));var jsonpatch=require(_0x6169('0x2'));var rp=require(_0x6169('0x3'));var moment=require(_0x6169('0x4'));var BPromise=require(_0x6169('0x5'));var Mustache=require(_0x6169('0x6'));var util=require(_0x6169('0x7'));var path=require(_0x6169('0x8'));var sox=require(_0x6169('0x9'));var csv=require('to-csv');var ejs=require(_0x6169('0xa'));var fs=require('fs');var fs_extra=require(_0x6169('0xb'));var _=require(_0x6169('0xc'));var squel=require(_0x6169('0xd'));var crypto=require(_0x6169('0xe'));var jsforce=require(_0x6169('0xf'));var deskjs=require(_0x6169('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6169('0x11'));var Papa=require('papaparse');var Redis=require(_0x6169('0x12'));var authService=require(_0x6169('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6169('0x14'));var hardwareService=require(_0x6169('0x15'));var logger=require(_0x6169('0x16'))(_0x6169('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6169('0x18'));var db=require(_0x6169('0x19'))['db'];function respondWithStatusCode(_0x5f342e,_0x9288c4){_0x9288c4=_0x9288c4||0xcc;return function(_0x2d6570){if(_0x2d6570){return _0x5f342e[_0x6169('0x1a')](_0x9288c4);}return _0x5f342e['status'](_0x9288c4)['end']();};}function respondWithResult(_0x4ba7bf,_0x2829cf){_0x2829cf=_0x2829cf||0xc8;return function(_0x2171d1){if(_0x2171d1){return _0x4ba7bf[_0x6169('0x1b')](_0x2829cf)[_0x6169('0x1c')](_0x2171d1);}};}function respondWithFilteredResult(_0x3ffa76,_0x5837d8){return function(_0x461294){if(_0x461294){var _0x3e2eb4=typeof _0x5837d8['offset']===_0x6169('0x1d')&&typeof _0x5837d8['limit']===_0x6169('0x1d');var _0x1e3b4e=_0x461294['count'];var _0xdfe11e=_0x3e2eb4?0x0:_0x5837d8[_0x6169('0x1e')];var _0xd47fea=_0x3e2eb4?_0x461294[_0x6169('0x1f')]:_0x5837d8[_0x6169('0x1e')]+_0x5837d8[_0x6169('0x20')];var _0x2b2e20;if(_0xd47fea>=_0x1e3b4e){_0xd47fea=_0x1e3b4e;_0x2b2e20=0xc8;}else{_0x2b2e20=0xce;}_0x3ffa76['status'](_0x2b2e20);return _0x3ffa76['set'](_0x6169('0x21'),_0xdfe11e+'-'+_0xd47fea+'/'+_0x1e3b4e)[_0x6169('0x1c')](_0x461294);}return null;};}function patchUpdates(_0x486186){return function(_0x34675a){try{jsonpatch[_0x6169('0x22')](_0x34675a,_0x486186,!![]);}catch(_0x2f3ef3){return BPromise[_0x6169('0x23')](_0x2f3ef3);}return _0x34675a[_0x6169('0x24')]();};}function saveUpdates(_0x51598d,_0x2506bb){return function(_0x5579b9){if(_0x5579b9){return _0x5579b9[_0x6169('0x25')](_0x51598d)[_0x6169('0x26')](function(_0x13e390){return _0x13e390;});}return null;};}function removeEntity(_0x4b35ca,_0x3b0e8a){return function(_0x1f90aa){if(_0x1f90aa){return _0x1f90aa['destroy']()['then'](function(){_0x4b35ca[_0x6169('0x1b')](0xcc)[_0x6169('0x27')]();});}};}function handleEntityNotFound(_0x3e706c,_0x20b40c){return function(_0x1b207e){if(!_0x1b207e){_0x3e706c[_0x6169('0x1a')](0x194);}return _0x1b207e;};}function handleError(_0x647f57,_0x3010f7){_0x3010f7=_0x3010f7||0x1f4;return function(_0x5f2e3b){logger[_0x6169('0x28')](_0x5f2e3b['stack']);if(_0x5f2e3b['name']){delete _0x5f2e3b['name'];}_0x647f57['status'](_0x3010f7)[_0x6169('0x29')](_0x5f2e3b);};}exports['show']=function(_0x4466f3,_0x136d11){var _0x15bef9={'raw':!![],'where':{'id':_0x4466f3['params']['id']}},_0x512977={};_0x512977['model']=_[_0x6169('0x2a')](db[_0x6169('0x2b')]['rawAttributes']);_0x512977['query']=_[_0x6169('0x2a')](_0x4466f3[_0x6169('0x2c')]);_0x512977['filters']=_[_0x6169('0x2d')](_0x512977[_0x6169('0x2e')],_0x512977['query']);_0x15bef9['attributes']=_[_0x6169('0x2d')](_0x512977['model'],qs['fields'](_0x4466f3['query'][_0x6169('0x2f')]));_0x15bef9['attributes']=_0x15bef9[_0x6169('0x30')][_0x6169('0x31')]?_0x15bef9['attributes']:_0x512977[_0x6169('0x2e')];if(_0x4466f3['query'][_0x6169('0x32')]){_0x15bef9[_0x6169('0x33')]=[{'all':!![]}];}_0x15bef9=_[_0x6169('0x34')]({},_0x15bef9,_0x4466f3['options']);return db['ChatProactiveAction']['find'](_0x15bef9)['then'](handleEntityNotFound(_0x136d11,null))[_0x6169('0x26')](respondWithResult(_0x136d11,null))[_0x6169('0x35')](handleError(_0x136d11,null));};exports['create']=function(_0x3a4dd0,_0x1335e8){return db[_0x6169('0x2b')]['create'](_0x3a4dd0[_0x6169('0x36')],{})[_0x6169('0x26')](respondWithResult(_0x1335e8,0xc9))[_0x6169('0x35')](handleError(_0x1335e8,null));};exports[_0x6169('0x25')]=function(_0x153339,_0x19ab2b){if(_0x153339[_0x6169('0x36')]['id']){delete _0x153339[_0x6169('0x36')]['id'];}return db[_0x6169('0x2b')][_0x6169('0x37')]({'where':{'id':_0x153339[_0x6169('0x38')]['id']}})['then'](handleEntityNotFound(_0x19ab2b,null))[_0x6169('0x26')](saveUpdates(_0x153339[_0x6169('0x36')],null))['then'](respondWithResult(_0x19ab2b,null))[_0x6169('0x35')](handleError(_0x19ab2b,null));};exports[_0x6169('0x39')]=function(_0x308b5a,_0xdfce5f){return db[_0x6169('0x2b')][_0x6169('0x37')]({'where':{'id':_0x308b5a[_0x6169('0x38')]['id']}})[_0x6169('0x26')](handleEntityNotFound(_0xdfce5f,null))[_0x6169('0x26')](removeEntity(_0xdfce5f,null))['catch'](handleError(_0xdfce5f,null));};
\ No newline at end of file
+var _0xf767=['catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json','apply','save','then','error','stack','name','params','model','keys','ChatProactiveAction','query','filters','attributes','fields','length','includeAll','include','merge','find'];(function(_0x1f8cbf,_0x5b4e66){var _0x5e6c05=function(_0x5dcc5a){while(--_0x5dcc5a){_0x1f8cbf['push'](_0x1f8cbf['shift']());}};_0x5e6c05(++_0x5b4e66);}(_0xf767,0x76));var _0x7f76=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0xf767[_0x39a2d6];return _0x23af66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['show']=function(_0xe459de,_0x58829a){var _0x1dd664={'raw':!![],'where':{'id':_0xe459de[_0x7f76('0x28')]['id']}},_0x3542e3={};_0x3542e3[_0x7f76('0x29')]=_[_0x7f76('0x2a')](db[_0x7f76('0x2b')]['rawAttributes']);_0x3542e3[_0x7f76('0x2c')]=_[_0x7f76('0x2a')](_0xe459de[_0x7f76('0x2c')]);_0x3542e3[_0x7f76('0x2d')]=_['intersection'](_0x3542e3[_0x7f76('0x29')],_0x3542e3[_0x7f76('0x2c')]);_0x1dd664[_0x7f76('0x2e')]=_['intersection'](_0x3542e3[_0x7f76('0x29')],qs[_0x7f76('0x2f')](_0xe459de[_0x7f76('0x2c')][_0x7f76('0x2f')]));_0x1dd664[_0x7f76('0x2e')]=_0x1dd664[_0x7f76('0x2e')][_0x7f76('0x30')]?_0x1dd664[_0x7f76('0x2e')]:_0x3542e3[_0x7f76('0x29')];if(_0xe459de[_0x7f76('0x2c')][_0x7f76('0x31')]){_0x1dd664[_0x7f76('0x32')]=[{'all':!![]}];}_0x1dd664=_[_0x7f76('0x33')]({},_0x1dd664,_0xe459de['options']);return db[_0x7f76('0x2b')][_0x7f76('0x34')](_0x1dd664)[_0x7f76('0x24')](handleEntityNotFound(_0x58829a,null))[_0x7f76('0x24')](respondWithResult(_0x58829a,null))[_0x7f76('0x35')](handleError(_0x58829a,null));};exports[_0x7f76('0x36')]=function(_0x21cb09,_0xa02fb3){return db['ChatProactiveAction'][_0x7f76('0x36')](_0x21cb09['body'],{})['then'](respondWithResult(_0xa02fb3,0xc9))[_0x7f76('0x35')](handleError(_0xa02fb3,null));};exports['update']=function(_0x37b9d7,_0x165a1e){if(_0x37b9d7['body']['id']){delete _0x37b9d7[_0x7f76('0x37')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x37b9d7[_0x7f76('0x28')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x165a1e,null))[_0x7f76('0x24')](saveUpdates(_0x37b9d7[_0x7f76('0x37')],null))[_0x7f76('0x24')](respondWithResult(_0x165a1e,null))['catch'](handleError(_0x165a1e,null));};exports[_0x7f76('0x38')]=function(_0x42ff86,_0x4edf74){return db['ChatProactiveAction'][_0x7f76('0x34')]({'where':{'id':_0x42ff86['params']['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x4edf74,null))[_0x7f76('0x24')](removeEntity(_0x4edf74,null))[_0x7f76('0x35')](handleError(_0x4edf74,null));};
\ No newline at end of file
index d5998c1..271c838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5304=['exports','ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x258c83,_0x32fce8){var _0x108d39=function(_0x1766ef){while(--_0x1766ef){_0x258c83['push'](_0x258c83['shift']());}};_0x108d39(++_0x32fce8);}(_0x5304,0x87));var _0x4530=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x5304[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x4530('0x0'));var util=require(_0x4530('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4530('0x2'));var BPromise=require(_0x4530('0x3'));var rp=require(_0x4530('0x4'));var fs=require('fs');var path=require(_0x4530('0x5'));var rimraf=require(_0x4530('0x6'));var config=require(_0x4530('0x7'));var attributes=require(_0x4530('0x8'));module[_0x4530('0x9')]=function(_0x461059,_0x2cbc62){return _0x461059['define'](_0x4530('0xa'),attributes,{'tableName':_0x4530('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd953=['path','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xd953,0x17a));var _0x3d95=function(_0x4aaba4,_0x25709d){_0x4aaba4=_0x4aaba4-0x0;var _0x3eec4c=_0xd953[_0x4aaba4];return _0x3eec4c;};'use strict';var _=require('lodash');var util=require(_0x3d95('0x0'));var logger=require(_0x3d95('0x1'))(_0x3d95('0x2'));var moment=require(_0x3d95('0x3'));var BPromise=require(_0x3d95('0x4'));var rp=require(_0x3d95('0x5'));var fs=require('fs');var path=require(_0x3d95('0x6'));var rimraf=require(_0x3d95('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d95('0x8'));module[_0x3d95('0x9')]=function(_0x40f9db,_0x118281){return _0x40f9db['define'](_0x3d95('0xa'),attributes,{'tableName':_0x3d95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a89f31e..1f8667b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa19b=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x113fe4,_0x5ebae1){var _0x25a898=function(_0x460d57){while(--_0x460d57){_0x113fe4['push'](_0x113fe4['shift']());}};_0x25a898(++_0x5ebae1);}(_0xa19b,0x6c));var _0xba19=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa19b[_0x432682];return _0x463d05;};'use strict';var _=require(_0xba19('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba19('0x1'));var rs=require(_0xba19('0x2'));var fs=require('fs');var Redis=require(_0xba19('0x3'));var db=require(_0xba19('0x4'))['db'];var utils=require(_0xba19('0x5'));var logger=require(_0xba19('0x6'))('rpc');var config=require(_0xba19('0x7'));var jayson=require(_0xba19('0x8'));var client=jayson[_0xba19('0x9')][_0xba19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cda9e,_0x8c3da0,_0x34d490){return new BPromise(function(_0x59e905,_0x15fa82){return client[_0xba19('0xb')](_0x1cda9e,_0x34d490)[_0xba19('0xc')](function(_0x54dfe6){logger[_0xba19('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x8c3da0,_0xba19('0xe'));logger['debug'](_0xba19('0xf'),_0x8c3da0,_0xba19('0xe'),JSON[_0xba19('0x10')](_0x54dfe6));if(_0x54dfe6[_0xba19('0x11')]){if(_0x54dfe6['error'][_0xba19('0x12')]===0x1f4){logger[_0xba19('0x11')](_0xba19('0x13'),_0x8c3da0,_0x54dfe6[_0xba19('0x11')][_0xba19('0x14')]);return _0x15fa82(_0x54dfe6[_0xba19('0x11')][_0xba19('0x14')]);}logger[_0xba19('0x11')](_0xba19('0x13'),_0x8c3da0,_0x54dfe6[_0xba19('0x11')][_0xba19('0x14')]);return _0x59e905(_0x54dfe6['error'][_0xba19('0x14')]);}else{logger['info'](_0xba19('0x13'),_0x8c3da0,_0xba19('0xe'));_0x59e905(_0x54dfe6[_0xba19('0x15')][_0xba19('0x14')]);}})[_0xba19('0x16')](function(_0x153994){logger[_0xba19('0x11')](_0xba19('0x13'),_0x8c3da0,_0x153994);_0x15fa82(_0x153994);});});}
\ No newline at end of file
+var _0x4510=['stringify','ChatProactiveAction,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x11c6cd,_0x54ed63){var _0x2c7387=function(_0xda038d){while(--_0xda038d){_0x11c6cd['push'](_0x11c6cd['shift']());}};_0x2c7387(++_0x54ed63);}(_0x4510,0xe1));var _0x0451=function(_0x12c9df,_0x29f364){_0x12c9df=_0x12c9df-0x0;var _0x3b8549=_0x4510[_0x12c9df];return _0x3b8549;};'use strict';var _=require(_0x0451('0x0'));var util=require(_0x0451('0x1'));var moment=require(_0x0451('0x2'));var BPromise=require(_0x0451('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0451('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0451('0x5'))(_0x0451('0x6'));var config=require(_0x0451('0x7'));var jayson=require(_0x0451('0x8'));var client=jayson[_0x0451('0x9')][_0x0451('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110df4,_0x5d4136,_0x19cef2){return new BPromise(function(_0x5f5288,_0xa67aca){return client[_0x0451('0xb')](_0x110df4,_0x19cef2)[_0x0451('0xc')](function(_0x11c36d){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x5d4136,_0x0451('0xd'));logger['debug'](_0x0451('0xe'),_0x5d4136,_0x0451('0xd'),JSON[_0x0451('0xf')](_0x11c36d));if(_0x11c36d['error']){if(_0x11c36d['error']['code']===0x1f4){logger['error'](_0x0451('0x10'),_0x5d4136,_0x11c36d[_0x0451('0x11')]['message']);return _0xa67aca(_0x11c36d[_0x0451('0x11')]['message']);}logger[_0x0451('0x11')](_0x0451('0x10'),_0x5d4136,_0x11c36d[_0x0451('0x11')][_0x0451('0x12')]);return _0x5f5288(_0x11c36d['error'][_0x0451('0x12')]);}else{logger['info'](_0x0451('0x10'),_0x5d4136,'request\x20sent');_0x5f5288(_0x11c36d[_0x0451('0x13')][_0x0451('0x12')]);}})['catch'](function(_0x516123){logger[_0x0451('0x11')](_0x0451('0x10'),_0x5d4136,_0x516123);_0xa67aca(_0x516123);});});}
\ No newline at end of file
index 7530565..57ee6b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xeff8,0x186));var _0x8eff=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xeff8[_0x310504];return _0x5b36d0;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x4d499a,_0xa00579){var _0x10f2b4=function(_0x2f63f0){while(--_0x2f63f0){_0x4d499a['push'](_0x4d499a['shift']());}};_0x10f2b4(++_0xa00579);}(_0x5fc3,0xa8));var _0x35fc=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x5fc3[_0x15fc7a];return _0x3aa9f4;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);module['exports']=router;
\ No newline at end of file
index d361976..b5f19da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf195=['ENUM','rrmemory','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x4935b1,_0x2c6114){var _0x3354c1=function(_0x2cc551){while(--_0x2cc551){_0x4935b1['push'](_0x4935b1['shift']());}};_0x3354c1(++_0x2c6114);}(_0xf195,0x14c));var _0x5f19=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xf195[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require(_0x5f19('0x0'));module['exports']={'name':{'type':Sequelize[_0x5f19('0x1')],'unique':_0x5f19('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5f19('0x1')]},'timeout':{'type':Sequelize[_0x5f19('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5f19('0x4')](_0x5f19('0x5'),'beepall',_0x5f19('0x6'))}};
\ No newline at end of file
+var _0x80b3=['roundrobin','sequelize','STRING','name','rrmemory','beepall'];(function(_0x8abaf7,_0x253aa8){var _0x40345e=function(_0x49ee99){while(--_0x49ee99){_0x8abaf7['push'](_0x8abaf7['shift']());}};_0x40345e(++_0x253aa8);}(_0x80b3,0x13f));var _0x380b=function(_0x2c7921,_0x435ce5){_0x2c7921=_0x2c7921-0x0;var _0x37827f=_0x80b3[_0x2c7921];return _0x37827f;};'use strict';var Sequelize=require(_0x380b('0x0'));module['exports']={'name':{'type':Sequelize[_0x380b('0x1')],'unique':_0x380b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x380b('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x380b('0x3'),_0x380b('0x4'),_0x380b('0x5'))}};
\ No newline at end of file
index 2eaccc6..61ace1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e94=['ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','body','destroy','getMembers','findOne','hasOwnProperty','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','transaction','each','UserChatQueue','findOrCreate','emit','removeTeams','ids','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','ChatQueues','end','sendStatus','name','send','index','map'];(function(_0x236c13,_0x50cc9f){var _0x35aa66=function(_0x251e3c){while(--_0x251e3c){_0x236c13['push'](_0x236c13['shift']());}};_0x35aa66(++_0x50cc9f);}(_0x6e94,0xf6));var _0x46e9=function(_0x21fc80,_0x4bd215){_0x21fc80=_0x21fc80-0x0;var _0x4b44ea=_0x6e94[_0x21fc80];return _0x4b44ea;};'use strict';var emlformat=require(_0x46e9('0x0'));var rimraf=require(_0x46e9('0x1'));var zipdir=require(_0x46e9('0x2'));var jsonpatch=require(_0x46e9('0x3'));var rp=require('request-promise');var moment=require(_0x46e9('0x4'));var BPromise=require(_0x46e9('0x5'));var Mustache=require(_0x46e9('0x6'));var util=require(_0x46e9('0x7'));var path=require(_0x46e9('0x8'));var sox=require(_0x46e9('0x9'));var csv=require('to-csv');var ejs=require(_0x46e9('0xa'));var fs=require('fs');var fs_extra=require(_0x46e9('0xb'));var _=require('lodash');var squel=require(_0x46e9('0xc'));var crypto=require(_0x46e9('0xd'));var jsforce=require(_0x46e9('0xe'));var deskjs=require(_0x46e9('0xf'));var toCsv=require(_0x46e9('0x10'));var querystring=require(_0x46e9('0x11'));var Papa=require(_0x46e9('0x12'));var Redis=require(_0x46e9('0x13'));var authService=require(_0x46e9('0x14'));var qs=require(_0x46e9('0x15'));var as=require(_0x46e9('0x16'));var hardwareService=require(_0x46e9('0x17'));var logger=require(_0x46e9('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x46e9('0x19'));var licenseUtil=require(_0x46e9('0x1a'));var db=require('../../mysqldb')['db'];config[_0x46e9('0x1b')]=_['defaults'](config['redis'],{'host':_0x46e9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46e9('0x1b')]));require(_0x46e9('0x1d'))[_0x46e9('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x46e9('0x1f')][_0x46e9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x44eafd,_0x2ba04f,_0x543fab,_0xfb40f0){return new BPromise(function(_0x585b9c,_0x22946d){var _0x89c195=_0xfb40f0||client;return _0x89c195[_0x46e9('0x21')](_0x44eafd,_0x543fab)[_0x46e9('0x22')](function(_0x13c4c5){logger[_0x46e9('0x23')](_0x46e9('0x24'),_0x2ba04f,'request\x20sent');logger[_0x46e9('0x25')](_0x46e9('0x26'),_0x2ba04f,_0x46e9('0x27'),JSON[_0x46e9('0x28')](_0x13c4c5));if(_0x13c4c5['error']){if(_0x13c4c5[_0x46e9('0x29')][_0x46e9('0x2a')]===0x1f4){logger[_0x46e9('0x29')](_0x46e9('0x24'),_0x2ba04f,_0x13c4c5[_0x46e9('0x29')][_0x46e9('0x2b')]);return _0x22946d(_0x13c4c5['error'][_0x46e9('0x2b')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2ba04f,_0x13c4c5['error'][_0x46e9('0x2b')]);return _0x585b9c(_0x13c4c5['error'][_0x46e9('0x2b')]);}else{logger[_0x46e9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x2ba04f,'request\x20sent');_0x585b9c(_0x13c4c5[_0x46e9('0x2c')][_0x46e9('0x2b')]);}})['catch'](function(_0x16f42f){logger['error'](_0x46e9('0x24'),_0x2ba04f,_0x16f42f);_0x22946d(_0x16f42f);});});}function respondWithStatusCode(_0x2d5d9e,_0x37d05f){_0x37d05f=_0x37d05f||0xcc;return function(_0x2ea6fd){if(_0x2ea6fd){return _0x2d5d9e['sendStatus'](_0x37d05f);}return _0x2d5d9e['status'](_0x37d05f)['end']();};}function respondWithResult(_0x441567,_0x130a43){_0x130a43=_0x130a43||0xc8;return function(_0x4b5d67){if(_0x4b5d67){return _0x441567['status'](_0x130a43)[_0x46e9('0x2d')](_0x4b5d67);}};}function respondWithFilteredResult(_0xc3d157,_0x5885cd){return function(_0x29b956){if(_0x29b956){var _0x2a15a8=typeof _0x5885cd[_0x46e9('0x2e')]===_0x46e9('0x2f')&&typeof _0x5885cd[_0x46e9('0x30')]===_0x46e9('0x2f');var _0xbec5cd=_0x29b956[_0x46e9('0x31')];var _0x49a4ab=_0x2a15a8?0x0:_0x5885cd[_0x46e9('0x2e')];var _0x5e306a=_0x2a15a8?_0x29b956[_0x46e9('0x31')]:_0x5885cd[_0x46e9('0x2e')]+_0x5885cd[_0x46e9('0x30')];var _0x41afe2;if(_0x5e306a>=_0xbec5cd){_0x5e306a=_0xbec5cd;_0x41afe2=0xc8;}else{_0x41afe2=0xce;}_0xc3d157[_0x46e9('0x32')](_0x41afe2);return _0xc3d157[_0x46e9('0x33')](_0x46e9('0x34'),_0x49a4ab+'-'+_0x5e306a+'/'+_0xbec5cd)[_0x46e9('0x2d')](_0x29b956);}return null;};}function patchUpdates(_0x2b5dca){return function(_0x2d1e10){try{jsonpatch[_0x46e9('0x35')](_0x2d1e10,_0x2b5dca,!![]);}catch(_0x5a74b3){return BPromise[_0x46e9('0x36')](_0x5a74b3);}return _0x2d1e10['save']();};}function saveUpdates(_0x187fc9,_0x2fbdd8){return function(_0x255609){if(_0x255609){return _0x255609['update'](_0x187fc9)['then'](function(_0x56c972){return _0x56c972;});}return null;};}function removeEntity(_0xd50ab4,_0xd65bf){return function(_0x5e098c){if(_0x5e098c){return _0x5e098c['destroy']()[_0x46e9('0x22')](function(){var _0xba0272=_0x5e098c['get']({'plain':!![]});var _0x79efa7=_0x46e9('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x79efa7,'resourceId':_0xba0272['id']}})[_0x46e9('0x22')](function(){return _0x5e098c;});})[_0x46e9('0x22')](function(){_0xd50ab4[_0x46e9('0x32')](0xcc)[_0x46e9('0x38')]();});}};}function handleEntityNotFound(_0x2084d8,_0x30e2e6){return function(_0x378681){if(!_0x378681){_0x2084d8[_0x46e9('0x39')](0x194);}return _0x378681;};}function handleError(_0x1bb306,_0x244db0){_0x244db0=_0x244db0||0x1f4;return function(_0x144540){logger[_0x46e9('0x29')](_0x144540['stack']);if(_0x144540['name']){delete _0x144540[_0x46e9('0x3a')];}_0x1bb306[_0x46e9('0x32')](_0x244db0)[_0x46e9('0x3b')](_0x144540);};}exports[_0x46e9('0x3c')]=function(_0x15961f,_0x20148e){var _0x52eb1a={},_0x106fcd={},_0x3e2e02={'count':0x0,'rows':[]};var _0x3bb14f=_[_0x46e9('0x3d')](db[_0x46e9('0x3e')][_0x46e9('0x3f')],function(_0x5ab17e){return{'name':_0x5ab17e[_0x46e9('0x40')],'type':_0x5ab17e['type'][_0x46e9('0x41')]};});_0x106fcd[_0x46e9('0x42')]=_[_0x46e9('0x3d')](_0x3bb14f,_0x46e9('0x3a'));_0x106fcd[_0x46e9('0x43')]=_[_0x46e9('0x44')](_0x15961f[_0x46e9('0x43')]);_0x106fcd[_0x46e9('0x45')]=_[_0x46e9('0x46')](_0x106fcd[_0x46e9('0x42')],_0x106fcd[_0x46e9('0x43')]);_0x52eb1a[_0x46e9('0x47')]=_[_0x46e9('0x46')](_0x106fcd[_0x46e9('0x42')],qs[_0x46e9('0x48')](_0x15961f[_0x46e9('0x43')][_0x46e9('0x48')]));_0x52eb1a[_0x46e9('0x47')]=_0x52eb1a[_0x46e9('0x47')][_0x46e9('0x49')]?_0x52eb1a[_0x46e9('0x47')]:_0x106fcd[_0x46e9('0x42')];if(!_0x15961f[_0x46e9('0x43')]['hasOwnProperty'](_0x46e9('0x4a'))){_0x52eb1a[_0x46e9('0x30')]=qs[_0x46e9('0x30')](_0x15961f[_0x46e9('0x43')]['limit']);_0x52eb1a[_0x46e9('0x2e')]=qs['offset'](_0x15961f[_0x46e9('0x43')]['offset']);}_0x52eb1a[_0x46e9('0x4b')]=qs[_0x46e9('0x4c')](_0x15961f[_0x46e9('0x43')][_0x46e9('0x4c')]);_0x52eb1a[_0x46e9('0x4d')]=qs[_0x46e9('0x45')](_[_0x46e9('0x4e')](_0x15961f[_0x46e9('0x43')],_0x106fcd[_0x46e9('0x45')]),_0x3bb14f);if(_0x15961f[_0x46e9('0x43')][_0x46e9('0x4f')]){_0x52eb1a[_0x46e9('0x4d')]=_['merge'](_0x52eb1a[_0x46e9('0x4d')],{'$or':_[_0x46e9('0x3d')](_0x3bb14f,function(_0x3dc997){if(_0x3dc997['type']!=='VIRTUAL'){var _0x5b8cec={};_0x5b8cec[_0x3dc997[_0x46e9('0x3a')]]={'$like':'%'+_0x15961f[_0x46e9('0x43')][_0x46e9('0x4f')]+'%'};return _0x5b8cec;}})});}_0x52eb1a=_[_0x46e9('0x50')]({},_0x52eb1a,_0x15961f[_0x46e9('0x51')]);var _0x10bb0a={'where':_0x52eb1a['where']};return db[_0x46e9('0x3e')][_0x46e9('0x31')](_0x10bb0a)[_0x46e9('0x22')](function(_0x4292f0){_0x3e2e02[_0x46e9('0x31')]=_0x4292f0;if(_0x15961f['query'][_0x46e9('0x52')]){_0x52eb1a[_0x46e9('0x53')]=[{'all':!![]}];}return db[_0x46e9('0x3e')][_0x46e9('0x54')](_0x52eb1a);})[_0x46e9('0x22')](function(_0x5501c3){_0x3e2e02[_0x46e9('0x55')]=_0x5501c3;return _0x3e2e02;})[_0x46e9('0x22')](respondWithFilteredResult(_0x20148e,_0x52eb1a))[_0x46e9('0x56')](handleError(_0x20148e,null));};exports[_0x46e9('0x57')]=function(_0x2331b8,_0x474533){var _0x2b18ba={'raw':!![],'where':{'id':_0x2331b8[_0x46e9('0x58')]['id']}},_0x12e569={};_0x12e569[_0x46e9('0x42')]=_[_0x46e9('0x44')](db[_0x46e9('0x3e')][_0x46e9('0x3f')]);_0x12e569[_0x46e9('0x43')]=_['keys'](_0x2331b8[_0x46e9('0x43')]);_0x12e569[_0x46e9('0x45')]=_[_0x46e9('0x46')](_0x12e569[_0x46e9('0x42')],_0x12e569['query']);_0x2b18ba[_0x46e9('0x47')]=_[_0x46e9('0x46')](_0x12e569['model'],qs[_0x46e9('0x48')](_0x2331b8[_0x46e9('0x43')][_0x46e9('0x48')]));_0x2b18ba[_0x46e9('0x47')]=_0x2b18ba[_0x46e9('0x47')][_0x46e9('0x49')]?_0x2b18ba[_0x46e9('0x47')]:_0x12e569[_0x46e9('0x42')];if(_0x2331b8['query']['includeAll']){_0x2b18ba[_0x46e9('0x53')]=[{'all':!![]}];}_0x2b18ba=_[_0x46e9('0x50')]({},_0x2b18ba,_0x2331b8['options']);return db['ChatQueue'][_0x46e9('0x59')](_0x2b18ba)['then'](handleEntityNotFound(_0x474533,null))[_0x46e9('0x22')](respondWithResult(_0x474533,null))[_0x46e9('0x56')](handleError(_0x474533,null));};exports[_0x46e9('0x5a')]=function(_0x408ab8,_0x53a8d8){return db[_0x46e9('0x3e')][_0x46e9('0x5a')](_0x408ab8['body'],{})[_0x46e9('0x22')](function(_0x12b4ce){var _0x254e9c=_0x408ab8[_0x46e9('0x5b')]['get']({'plain':!![]});if(!_0x254e9c)throw new Error(_0x46e9('0x5c'));if(_0x254e9c[_0x46e9('0x5d')]===_0x46e9('0x5b')){var _0x25a43b=_0x12b4ce[_0x46e9('0x5e')]({'plain':!![]});var _0x13f933=_0x46e9('0x37');return db[_0x46e9('0x5f')][_0x46e9('0x59')]({'where':{'name':_0x13f933,'userProfileId':_0x254e9c[_0x46e9('0x60')]},'raw':!![]})[_0x46e9('0x22')](function(_0x508b8f){if(_0x508b8f&&_0x508b8f[_0x46e9('0x61')]===0x0){return db[_0x46e9('0x62')][_0x46e9('0x5a')]({'name':_0x25a43b[_0x46e9('0x3a')],'resourceId':_0x25a43b['id'],'type':_0x508b8f[_0x46e9('0x3a')],'sectionId':_0x508b8f['id']},{})[_0x46e9('0x22')](function(){return _0x12b4ce;});}else{return _0x12b4ce;}})[_0x46e9('0x56')](function(_0x1ccbb2){logger[_0x46e9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ccbb2);throw _0x1ccbb2;});}return _0x12b4ce;})[_0x46e9('0x22')](respondWithResult(_0x53a8d8,0xc9))[_0x46e9('0x56')](handleError(_0x53a8d8,null));};exports[_0x46e9('0x63')]=function(_0x37df4b,_0x27e44f){if(_0x37df4b[_0x46e9('0x64')]['id']){delete _0x37df4b[_0x46e9('0x64')]['id'];}return db['ChatQueue'][_0x46e9('0x59')]({'where':{'id':_0x37df4b[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x27e44f,null))['then'](saveUpdates(_0x37df4b[_0x46e9('0x64')],null))['then'](respondWithResult(_0x27e44f,null))[_0x46e9('0x56')](handleError(_0x27e44f,null));};exports[_0x46e9('0x65')]=function(_0x41437e,_0x3e41eb){return db[_0x46e9('0x3e')][_0x46e9('0x59')]({'where':{'id':_0x41437e[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x3e41eb,null))[_0x46e9('0x22')](removeEntity(_0x3e41eb,null))[_0x46e9('0x56')](handleError(_0x3e41eb,null));};exports['describe']=function(_0x2c000e,_0x495647){return db[_0x46e9('0x3e')]['describe']()[_0x46e9('0x22')](respondWithResult(_0x495647,null))[_0x46e9('0x56')](handleError(_0x495647,null));};exports[_0x46e9('0x66')]=function(_0x4adcee,_0x11fa62,_0x53c72e){var _0x2b119b={'raw':!![],'where':{}},_0x16b0e0={},_0x419762;return db[_0x46e9('0x3e')][_0x46e9('0x67')]({'where':{'id':_0x4adcee[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x11fa62,null))[_0x46e9('0x22')](function(_0x1355f0){if(_0x1355f0){_0x419762=_0x1355f0[_0x46e9('0x5e')]({'plain':!![]});_0x16b0e0[_0x46e9('0x42')]=_[_0x46e9('0x44')](db['UserChatQueue'][_0x46e9('0x3f')]);_0x16b0e0[_0x46e9('0x43')]=_[_0x46e9('0x44')](_0x4adcee[_0x46e9('0x43')]);_0x16b0e0['filters']=_[_0x46e9('0x46')](_0x16b0e0[_0x46e9('0x42')],_0x16b0e0[_0x46e9('0x43')]);_0x2b119b[_0x46e9('0x47')]=_['intersection'](_0x16b0e0['model'],qs['fields'](_0x4adcee[_0x46e9('0x43')][_0x46e9('0x48')]));_0x2b119b[_0x46e9('0x47')]=_0x2b119b[_0x46e9('0x47')][_0x46e9('0x49')]?_0x2b119b[_0x46e9('0x47')]:_0x16b0e0[_0x46e9('0x42')];if(!_0x4adcee['query'][_0x46e9('0x68')](_0x46e9('0x4a'))){_0x2b119b['limit']=qs[_0x46e9('0x30')](_0x4adcee[_0x46e9('0x43')][_0x46e9('0x30')]);_0x2b119b['offset']=qs[_0x46e9('0x2e')](_0x4adcee[_0x46e9('0x43')]['offset']);}_0x2b119b[_0x46e9('0x4b')]=qs['sort'](_0x4adcee[_0x46e9('0x43')][_0x46e9('0x4c')]);_0x2b119b[_0x46e9('0x4d')]=qs['filters'](_[_0x46e9('0x4e')](_0x4adcee['query'],_0x16b0e0[_0x46e9('0x45')]));_0x2b119b[_0x46e9('0x4d')]['ChatQueueId']=_0x1355f0['id'];if(_0x4adcee[_0x46e9('0x43')][_0x46e9('0x4f')]){_0x2b119b[_0x46e9('0x4d')]=_[_0x46e9('0x50')](_0x2b119b['where'],{'$or':_[_0x46e9('0x3d')](_0x2b119b[_0x46e9('0x47')],function(_0x1d0e6f){var _0x33b6ed={};_0x33b6ed[_0x1d0e6f]={'$like':'%'+_0x4adcee['query'][_0x46e9('0x4f')]+'%'};return _0x33b6ed;})});}_0x2b119b=_[_0x46e9('0x50')]({},_0x2b119b,_0x4adcee[_0x46e9('0x51')]);return db['UserChatQueue'][_0x46e9('0x54')](_0x2b119b);}})[_0x46e9('0x22')](function(_0x5efed9){if(_0x5efed9){return db[_0x46e9('0x69')][_0x46e9('0x6a')]({'where':{'id':_['map'](_0x5efed9,'UserId'),'role':_0x46e9('0x6b')},'attributes':['id',_0x46e9('0x3a'),_0x46e9('0x6c'),_0x46e9('0x6d'),_0x46e9('0x6e')]});}})['then'](function(_0x50f68c){if(_0x50f68c){return{'count':_0x50f68c[_0x46e9('0x31')],'rows':_['map'](_0x50f68c[_0x46e9('0x55')],function(_0x5b3649){return{'membername':_0x5b3649[_0x46e9('0x3a')],'UserId':_0x5b3649['id'],'queue_name':_0x419762[_0x46e9('0x3a')],'ChatQueueId':_0x419762['id'],'interface':util[_0x46e9('0x6f')](_0x46e9('0x70'),_0x46e9('0x71'),_0x5b3649[_0x46e9('0x3a')]),'penalty':0x0,'paused':_0x5b3649[_0x46e9('0x6c')],'createdAt':_0x5b3649['createdAt'],'updatedAt':_0x5b3649[_0x46e9('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x46e9('0x22')](respondWithFilteredResult(_0x11fa62,_0x2b119b))[_0x46e9('0x56')](handleError(_0x11fa62,null));};exports[_0x46e9('0x72')]=function(_0x3bb90d,_0x140198,_0x1a8ef3){var _0x2ac02a={};var _0x4e71e6={};var _0x5cdbdb;var _0x58f9ea;return db['ChatQueue'][_0x46e9('0x67')]({'where':{'id':_0x3bb90d['params']['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x140198,null))[_0x46e9('0x22')](function(_0x354237){if(_0x354237){_0x5cdbdb=_0x354237;_0x4e71e6[_0x46e9('0x42')]=_[_0x46e9('0x44')](db[_0x46e9('0x73')]['rawAttributes']);_0x4e71e6[_0x46e9('0x43')]=_[_0x46e9('0x44')](_0x3bb90d[_0x46e9('0x43')]);_0x4e71e6['filters']=_[_0x46e9('0x46')](_0x4e71e6[_0x46e9('0x42')],_0x4e71e6[_0x46e9('0x43')]);_0x2ac02a[_0x46e9('0x47')]=_['intersection'](_0x4e71e6[_0x46e9('0x42')],qs[_0x46e9('0x48')](_0x3bb90d['query']['fields']));_0x2ac02a[_0x46e9('0x47')]=_0x2ac02a[_0x46e9('0x47')][_0x46e9('0x49')]?_0x2ac02a[_0x46e9('0x47')]:_0x4e71e6[_0x46e9('0x42')];_0x2ac02a[_0x46e9('0x4b')]=qs[_0x46e9('0x4c')](_0x3bb90d[_0x46e9('0x43')][_0x46e9('0x4c')]);_0x2ac02a['where']=qs['filters'](_[_0x46e9('0x4e')](_0x3bb90d[_0x46e9('0x43')],_0x4e71e6['filters']));if(_0x3bb90d[_0x46e9('0x43')]['filter']){_0x2ac02a['where']=_[_0x46e9('0x50')](_0x2ac02a[_0x46e9('0x4d')],{'$or':_[_0x46e9('0x3d')](_0x2ac02a['attributes'],function(_0x546713){var _0x37e4ea={};_0x37e4ea[_0x546713]={'$like':'%'+_0x3bb90d[_0x46e9('0x43')][_0x46e9('0x4f')]+'%'};return _0x37e4ea;})});}_0x2ac02a=_[_0x46e9('0x50')]({},_0x2ac02a,_0x3bb90d[_0x46e9('0x51')]);return _0x5cdbdb['getTeams'](_0x2ac02a);}})[_0x46e9('0x22')](function(_0x55b000){if(_0x55b000){_0x58f9ea=_0x55b000['length'];if(!_0x3bb90d['query'][_0x46e9('0x68')](_0x46e9('0x4a'))){_0x2ac02a[_0x46e9('0x30')]=qs[_0x46e9('0x30')](_0x3bb90d['query'][_0x46e9('0x30')]);_0x2ac02a[_0x46e9('0x2e')]=qs[_0x46e9('0x2e')](_0x3bb90d['query'][_0x46e9('0x2e')]);}return _0x5cdbdb[_0x46e9('0x72')](_0x2ac02a);}})[_0x46e9('0x22')](function(_0x42c3c7){if(_0x42c3c7){return _0x42c3c7?{'count':_0x58f9ea,'rows':_0x42c3c7}:null;}})[_0x46e9('0x22')](respondWithResult(_0x140198,null))[_0x46e9('0x56')](handleError(_0x140198,null));};exports[_0x46e9('0x74')]=function(_0x5cf1ef,_0xa36e74,_0x3f2863){var _0x36e4ab=_0x5cf1ef['body']['ids'];return db['Team'][_0x46e9('0x54')]({'where':{'id':_0x36e4ab},'attributes':['id'],'include':[{'model':db['User'],'as':_0x46e9('0x75'),'attributes':['id',_0x46e9('0x3a'),'online',_0x46e9('0x76'),_0x46e9('0x77')],'raw':!![]}]})['then'](function(_0x4af3d0){if(_0x4af3d0){var _0x1218c6=_[_0x46e9('0x78')](_0x4af3d0,function(_0x1ffa32){var _0x42c960=_0x1ffa32[_0x46e9('0x5e')]({'plain':!![]});return _0x42c960[_0x46e9('0x75')];});return db[_0x46e9('0x3e')]['find']({'where':{'id':_0x5cf1ef['params']['id']}})['then'](function(_0x7a5e7f){return db['sequelize'][_0x46e9('0x79')](function(_0x5c2de0){return _0x7a5e7f[_0x46e9('0x74')](_0x36e4ab,{'transaction':_0x5c2de0})['then'](function(){return BPromise[_0x46e9('0x7a')](_0x1218c6,function(_0x52471d){return db[_0x46e9('0x7b')][_0x46e9('0x7c')]({'where':{'UserId':_0x52471d['id'],'ChatQueueId':_0x5cf1ef[_0x46e9('0x58')]['id']},'transaction':_0x5c2de0});});})[_0x46e9('0x22')](function(){_0x1218c6['forEach'](function(_0x4d4f7c){socket[_0x46e9('0x7d')]('userChatQueue:save',{'UserId':_0x4d4f7c['id'],'ChatQueueId':_0x7a5e7f['id']});});});});});}})['then'](respondWithStatusCode(_0xa36e74,null))[_0x46e9('0x56')](handleError(_0xa36e74,null));};exports[_0x46e9('0x7e')]=function(_0xd224a1,_0x1bc607,_0xe10332){return db['Team'][_0x46e9('0x54')]({'where':{'id':_0xd224a1['query'][_0x46e9('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x46e9('0x22')](handleEntityNotFound(_0x1bc607,null))[_0x46e9('0x22')](function(_0x5d9525){var _0x25d14a=_['map'](_0x5d9525,'id');var _0x5dd879=[];var _0x4f5f29=[];var _0x700e9b=squel[_0x46e9('0x80')]();_0x700e9b['field'](_0x46e9('0x81'))[_0x46e9('0x82')](_0x46e9('0x83'),'tq')[_0x46e9('0x84')]('user_has_teams','ut',_0x46e9('0x85'))[_0x46e9('0x4d')](_0x46e9('0x86'),_0xd224a1['params']['id']);for(var _0x56b008=0x0;_0x56b008<_0x5d9525[_0x46e9('0x49')];_0x56b008+=0x1){let _0x252a1b=_0x5d9525[_0x56b008];for(var _0x46af9d=0x0;_0x46af9d<_0x252a1b[_0x46e9('0x75')]['length'];_0x46af9d+=0x1){let _0x4670a4=_0x252a1b[_0x46e9('0x75')][_0x46af9d];var _0x496c24=_0x700e9b['clone']();_0x496c24[_0x46e9('0x4d')]('ut.UserId\x20=\x20?',_0x4670a4['id']);_0x4f5f29[_0x46e9('0x87')](db['sequelize'][_0x46e9('0x43')](_0x496c24['toString'](),{'type':db[_0x46e9('0x88')][_0x46e9('0x89')][_0x46e9('0x8a')]})[_0x46e9('0x22')](function(_0x5d4c1e){if(_0x5d4c1e[_0x46e9('0x49')]===0x1){return _0x4670a4['id'];}else{var _0x2402a2=_[_0x46e9('0x8b')](_['map'](_0x5d4c1e,_0x46e9('0x8c')),function(_0x3001f7){return _[_0x46e9('0x8d')](_0x25d14a,_0x3001f7);});if(_0x2402a2){return _0x4670a4['id'];}}}));}}return BPromise['all'](_0x4f5f29)[_0x46e9('0x22')](function(_0x15b924){_0x5dd879=_(_0x5dd879)[_0x46e9('0x8e')](_0x15b924)[_0x46e9('0x8f')]()['value']();return db[_0x46e9('0x3e')][_0x46e9('0x59')]({'where':{'id':_0xd224a1[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](function(_0x4fe5b1){return db[_0x46e9('0x88')][_0x46e9('0x79')](function(_0xd85ec){return _0x4fe5b1[_0x46e9('0x7e')](_0xd224a1['query'][_0x46e9('0x7f')],{'transaction':_0xd85ec})[_0x46e9('0x22')](function(){if(!_[_0x46e9('0x90')](_0x5dd879)){return _0x4fe5b1[_0x46e9('0x91')](_0x5dd879,{'transaction':_0xd85ec});}})[_0x46e9('0x22')](function(){_0x5dd879[_0x46e9('0x92')](function(_0x4a88cc){socket['emit'](_0x46e9('0x93'),{'UserId':_0x4a88cc,'ChatQueueId':_0x4fe5b1['id']});});});});});});})[_0x46e9('0x22')](respondWithStatusCode(_0x1bc607,null))[_0x46e9('0x56')](handleError(_0x1bc607,null));};exports['addAgents']=function(_0x2a6507,_0x241d5c,_0x36f11b){return db['ChatQueue'][_0x46e9('0x59')]({'where':{'id':_0x2a6507[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x241d5c,null))[_0x46e9('0x22')](function(_0x1289ad){if(_0x1289ad){return _0x1289ad[_0x46e9('0x94')](_0x2a6507[_0x46e9('0x64')]['ids'],_[_0x46e9('0x95')](_0x2a6507[_0x46e9('0x64')],[_0x46e9('0x7f'),'id'])||{})[_0x46e9('0x96')](function(_0x39226f){for(var _0xe89b3e=0x0;_0xe89b3e<_0x2a6507['body'][_0x46e9('0x7f')][_0x46e9('0x49')];_0xe89b3e+=0x1){socket[_0x46e9('0x7d')](_0x46e9('0x97'),{'UserId':Number(_0x2a6507['body'][_0x46e9('0x7f')][_0xe89b3e]),'ChatQueueId':Number(_0x2a6507[_0x46e9('0x58')]['id'])});}return _0x39226f;});}})[_0x46e9('0x22')](respondWithResult(_0x241d5c,null))[_0x46e9('0x56')](handleError(_0x241d5c,null));};exports[_0x46e9('0x91')]=function(_0x18933b,_0x53791c,_0x222ea8){return db[_0x46e9('0x3e')][_0x46e9('0x59')]({'where':{'id':_0x18933b[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x53791c,null))[_0x46e9('0x22')](function(_0x12d24c){if(_0x12d24c){return _0x12d24c[_0x46e9('0x91')](_0x18933b[_0x46e9('0x43')][_0x46e9('0x7f')])['then'](function(){if(_[_0x46e9('0x98')](_0x18933b['query'][_0x46e9('0x7f')])){for(var _0x5aa2e8=0x0;_0x5aa2e8<_0x18933b[_0x46e9('0x43')][_0x46e9('0x7f')]['length'];_0x5aa2e8+=0x1){socket[_0x46e9('0x7d')](_0x46e9('0x93'),{'UserId':Number(_0x18933b['query'][_0x46e9('0x7f')][_0x5aa2e8]),'ChatQueueId':Number(_0x18933b[_0x46e9('0x58')]['id'])});}}else{socket['emit'](_0x46e9('0x93'),{'UserId':Number(_0x18933b[_0x46e9('0x43')][_0x46e9('0x7f')]),'ChatQueueId':Number(_0x18933b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x53791c,null))['catch'](handleError(_0x53791c,null));};exports[_0x46e9('0x99')]=function(_0x4532f0,_0x152eb2,_0x4bcf2a){var _0x155d80={};var _0x416a94={};var _0x3e80ed;var _0x2fc156;return db[_0x46e9('0x3e')][_0x46e9('0x67')]({'where':{'id':_0x4532f0[_0x46e9('0x58')]['id']}})['then'](handleEntityNotFound(_0x152eb2,null))[_0x46e9('0x22')](function(_0xe15e8e){if(_0xe15e8e){_0x3e80ed=_0xe15e8e;_0x416a94[_0x46e9('0x42')]=_['keys'](db[_0x46e9('0x69')]['rawAttributes']);_0x416a94[_0x46e9('0x43')]=_['keys'](_0x4532f0[_0x46e9('0x43')]);_0x416a94[_0x46e9('0x45')]=_['intersection'](_0x416a94[_0x46e9('0x42')],_0x416a94[_0x46e9('0x43')]);_0x155d80['attributes']=_['intersection'](_0x416a94[_0x46e9('0x42')],qs[_0x46e9('0x48')](_0x4532f0['query'][_0x46e9('0x48')]));_0x155d80[_0x46e9('0x47')]=_0x155d80[_0x46e9('0x47')][_0x46e9('0x49')]?_0x155d80[_0x46e9('0x47')]:_0x416a94[_0x46e9('0x42')];_0x155d80[_0x46e9('0x4b')]=qs[_0x46e9('0x4c')](_0x4532f0['query'][_0x46e9('0x4c')]);_0x155d80[_0x46e9('0x4d')]=qs['filters'](_[_0x46e9('0x4e')](_0x4532f0[_0x46e9('0x43')],_0x416a94['filters']));if(_0x4532f0[_0x46e9('0x43')][_0x46e9('0x4f')]){_0x155d80[_0x46e9('0x4d')]=_[_0x46e9('0x50')](_0x155d80[_0x46e9('0x4d')],{'$or':_[_0x46e9('0x3d')](_0x155d80[_0x46e9('0x47')],function(_0xf76ee3){var _0xb7402c={};_0xb7402c[_0xf76ee3]={'$like':'%'+_0x4532f0[_0x46e9('0x43')][_0x46e9('0x4f')]+'%'};return _0xb7402c;})});}_0x155d80=_['merge']({},_0x155d80,_0x4532f0[_0x46e9('0x51')]);return _0x3e80ed[_0x46e9('0x99')](_0x155d80);}})['then'](function(_0x1d2d82){if(_0x1d2d82){_0x2fc156=_0x1d2d82[_0x46e9('0x49')];if(!_0x4532f0[_0x46e9('0x43')][_0x46e9('0x68')]('nolimit')){_0x155d80[_0x46e9('0x30')]=qs[_0x46e9('0x30')](_0x4532f0[_0x46e9('0x43')][_0x46e9('0x30')]);_0x155d80['offset']=qs[_0x46e9('0x2e')](_0x4532f0[_0x46e9('0x43')][_0x46e9('0x2e')]);}return _0x3e80ed[_0x46e9('0x99')](_0x155d80);}})[_0x46e9('0x22')](function(_0x387f13){if(_0x387f13){return _0x387f13?{'count':_0x2fc156,'rows':_0x387f13}:null;}})[_0x46e9('0x22')](respondWithResult(_0x152eb2,null))[_0x46e9('0x56')](handleError(_0x152eb2,null));};
\ No newline at end of file
+var _0x8ab2=['addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','sendStatus','status','json','undefined','limit','count','set','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','name','send','index','ChatQueue','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','offset','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','hasOwnProperty','nolimit','ChatQueueId','UserChatQueue','findAndCountAll','UserId','agent','chatPause','rows','format','updatedAt','getTeams','findOne','Team','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x8ab2,0x1b0));var _0x28ab=function(_0x452c64,_0x3de96e){_0x452c64=_0x452c64-0x0;var _0x2c7e6d=_0x8ab2[_0x452c64];return _0x2c7e6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ab('0x0'));var zipdir=require(_0x28ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x28ab('0x2'));var BPromise=require(_0x28ab('0x3'));var Mustache=require(_0x28ab('0x4'));var util=require(_0x28ab('0x5'));var path=require(_0x28ab('0x6'));var sox=require(_0x28ab('0x7'));var csv=require('to-csv');var ejs=require(_0x28ab('0x8'));var fs=require('fs');var fs_extra=require(_0x28ab('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x28ab('0xa'));var jsforce=require(_0x28ab('0xb'));var deskjs=require(_0x28ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x28ab('0xd'));var Papa=require('papaparse');var Redis=require(_0x28ab('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x28ab('0xf'));var as=require(_0x28ab('0x10'));var hardwareService=require(_0x28ab('0x11'));var logger=require(_0x28ab('0x12'))('api');var utils=require(_0x28ab('0x13'));var config=require(_0x28ab('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x28ab('0x15'))['db'];config[_0x28ab('0x16')]=_['defaults'](config[_0x28ab('0x16')],{'host':_0x28ab('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x28ab('0x16')]));require('./chatQueue.socket')[_0x28ab('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x28ab('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c4e9c,_0x220901,_0x35ad4b,_0x9caacf){return new BPromise(function(_0x38ece9,_0x39fa18){var _0x3b372f=_0x9caacf||client;return _0x3b372f[_0x28ab('0x1a')](_0x4c4e9c,_0x35ad4b)[_0x28ab('0x1b')](function(_0xd47b28){logger[_0x28ab('0x1c')](_0x28ab('0x1d'),_0x220901,'request\x20sent');logger[_0x28ab('0x1e')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x220901,_0x28ab('0x1f'),JSON['stringify'](_0xd47b28));if(_0xd47b28['error']){if(_0xd47b28[_0x28ab('0x20')]['code']===0x1f4){logger[_0x28ab('0x20')](_0x28ab('0x1d'),_0x220901,_0xd47b28[_0x28ab('0x20')][_0x28ab('0x21')]);return _0x39fa18(_0xd47b28[_0x28ab('0x20')][_0x28ab('0x21')]);}logger[_0x28ab('0x20')]('ChatQueue,\x20%s,\x20%s',_0x220901,_0xd47b28[_0x28ab('0x20')][_0x28ab('0x21')]);return _0x38ece9(_0xd47b28['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x220901,_0x28ab('0x1f'));_0x38ece9(_0xd47b28['result'][_0x28ab('0x21')]);}})['catch'](function(_0x27d0a8){logger[_0x28ab('0x20')](_0x28ab('0x1d'),_0x220901,_0x27d0a8);_0x39fa18(_0x27d0a8);});});}function respondWithStatusCode(_0x33205,_0x403d48){_0x403d48=_0x403d48||0xcc;return function(_0x209ae4){if(_0x209ae4){return _0x33205[_0x28ab('0x22')](_0x403d48);}return _0x33205[_0x28ab('0x23')](_0x403d48)['end']();};}function respondWithResult(_0x49be56,_0x6a749a){_0x6a749a=_0x6a749a||0xc8;return function(_0x1a9052){if(_0x1a9052){return _0x49be56[_0x28ab('0x23')](_0x6a749a)[_0x28ab('0x24')](_0x1a9052);}};}function respondWithFilteredResult(_0x3d8147,_0x4ca97d){return function(_0x11f304){if(_0x11f304){var _0x1b3948=typeof _0x4ca97d['offset']===_0x28ab('0x25')&&typeof _0x4ca97d[_0x28ab('0x26')]==='undefined';var _0x3a4fdf=_0x11f304[_0x28ab('0x27')];var _0x52fdc7=_0x1b3948?0x0:_0x4ca97d['offset'];var _0x2231b0=_0x1b3948?_0x11f304['count']:_0x4ca97d['offset']+_0x4ca97d[_0x28ab('0x26')];var _0x5947cf;if(_0x2231b0>=_0x3a4fdf){_0x2231b0=_0x3a4fdf;_0x5947cf=0xc8;}else{_0x5947cf=0xce;}_0x3d8147[_0x28ab('0x23')](_0x5947cf);return _0x3d8147[_0x28ab('0x28')]('Content-Range',_0x52fdc7+'-'+_0x2231b0+'/'+_0x3a4fdf)[_0x28ab('0x24')](_0x11f304);}return null;};}function patchUpdates(_0x2ba4aa){return function(_0x5d0379){try{jsonpatch[_0x28ab('0x29')](_0x5d0379,_0x2ba4aa,!![]);}catch(_0x5c481e){return BPromise[_0x28ab('0x2a')](_0x5c481e);}return _0x5d0379[_0x28ab('0x2b')]();};}function saveUpdates(_0x279179,_0x35aa29){return function(_0x51d357){if(_0x51d357){return _0x51d357[_0x28ab('0x2c')](_0x279179)['then'](function(_0x49f08b){return _0x49f08b;});}return null;};}function removeEntity(_0x448b81,_0x7fe6e8){return function(_0x522a5c){if(_0x522a5c){return _0x522a5c[_0x28ab('0x2d')]()[_0x28ab('0x1b')](function(){var _0x583df8=_0x522a5c[_0x28ab('0x2e')]({'plain':!![]});var _0x1b75d5=_0x28ab('0x2f');return db[_0x28ab('0x30')][_0x28ab('0x2d')]({'where':{'type':_0x1b75d5,'resourceId':_0x583df8['id']}})['then'](function(){return _0x522a5c;});})[_0x28ab('0x1b')](function(){_0x448b81[_0x28ab('0x23')](0xcc)[_0x28ab('0x31')]();});}};}function handleEntityNotFound(_0x1d41cf,_0x52bcfe){return function(_0x36e9ae){if(!_0x36e9ae){_0x1d41cf[_0x28ab('0x22')](0x194);}return _0x36e9ae;};}function handleError(_0x35550f,_0x29c39c){_0x29c39c=_0x29c39c||0x1f4;return function(_0x561836){logger[_0x28ab('0x20')](_0x561836['stack']);if(_0x561836[_0x28ab('0x32')]){delete _0x561836[_0x28ab('0x32')];}_0x35550f[_0x28ab('0x23')](_0x29c39c)[_0x28ab('0x33')](_0x561836);};}exports[_0x28ab('0x34')]=function(_0xe6c4b1,_0x414d89){var _0x78d9b1={},_0x5346fc={},_0x444a2a={'count':0x0,'rows':[]};var _0x4f9414=_['map'](db[_0x28ab('0x35')][_0x28ab('0x36')],function(_0xbd5520){return{'name':_0xbd5520['fieldName'],'type':_0xbd5520['type'][_0x28ab('0x37')]};});_0x5346fc[_0x28ab('0x38')]=_[_0x28ab('0x39')](_0x4f9414,_0x28ab('0x32'));_0x5346fc[_0x28ab('0x3a')]=_[_0x28ab('0x3b')](_0xe6c4b1[_0x28ab('0x3a')]);_0x5346fc['filters']=_[_0x28ab('0x3c')](_0x5346fc[_0x28ab('0x38')],_0x5346fc[_0x28ab('0x3a')]);_0x78d9b1[_0x28ab('0x3d')]=_[_0x28ab('0x3c')](_0x5346fc[_0x28ab('0x38')],qs[_0x28ab('0x3e')](_0xe6c4b1[_0x28ab('0x3a')]['fields']));_0x78d9b1[_0x28ab('0x3d')]=_0x78d9b1['attributes'][_0x28ab('0x3f')]?_0x78d9b1[_0x28ab('0x3d')]:_0x5346fc[_0x28ab('0x38')];if(!_0xe6c4b1[_0x28ab('0x3a')]['hasOwnProperty']('nolimit')){_0x78d9b1[_0x28ab('0x26')]=qs[_0x28ab('0x26')](_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x26')]);_0x78d9b1['offset']=qs[_0x28ab('0x40')](_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x40')]);}_0x78d9b1[_0x28ab('0x41')]=qs[_0x28ab('0x42')](_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x78d9b1[_0x28ab('0x43')]=qs['filters'](_[_0x28ab('0x44')](_0xe6c4b1[_0x28ab('0x3a')],_0x5346fc[_0x28ab('0x45')]),_0x4f9414);if(_0xe6c4b1['query'][_0x28ab('0x46')]){_0x78d9b1[_0x28ab('0x43')]=_[_0x28ab('0x47')](_0x78d9b1[_0x28ab('0x43')],{'$or':_['map'](_0x4f9414,function(_0x47afea){if(_0x47afea[_0x28ab('0x48')]!==_0x28ab('0x49')){var _0x1ba138={};_0x1ba138[_0x47afea[_0x28ab('0x32')]]={'$like':'%'+_0xe6c4b1[_0x28ab('0x3a')]['filter']+'%'};return _0x1ba138;}})});}_0x78d9b1=_['merge']({},_0x78d9b1,_0xe6c4b1[_0x28ab('0x4a')]);var _0x1ceda8={'where':_0x78d9b1[_0x28ab('0x43')]};return db[_0x28ab('0x35')]['count'](_0x1ceda8)[_0x28ab('0x1b')](function(_0x3a8214){_0x444a2a[_0x28ab('0x27')]=_0x3a8214;if(_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x4b')]){_0x78d9b1[_0x28ab('0x4c')]=[{'all':!![]}];}return db[_0x28ab('0x35')][_0x28ab('0x4d')](_0x78d9b1);})['then'](function(_0x360e45){_0x444a2a['rows']=_0x360e45;return _0x444a2a;})[_0x28ab('0x1b')](respondWithFilteredResult(_0x414d89,_0x78d9b1))['catch'](handleError(_0x414d89,null));};exports[_0x28ab('0x4e')]=function(_0x657cd4,_0x36a071){var _0x327a00={'raw':!![],'where':{'id':_0x657cd4[_0x28ab('0x4f')]['id']}},_0x395d94={};_0x395d94['model']=_[_0x28ab('0x3b')](db['ChatQueue'][_0x28ab('0x36')]);_0x395d94[_0x28ab('0x3a')]=_[_0x28ab('0x3b')](_0x657cd4[_0x28ab('0x3a')]);_0x395d94[_0x28ab('0x45')]=_[_0x28ab('0x3c')](_0x395d94['model'],_0x395d94[_0x28ab('0x3a')]);_0x327a00['attributes']=_[_0x28ab('0x3c')](_0x395d94[_0x28ab('0x38')],qs[_0x28ab('0x3e')](_0x657cd4[_0x28ab('0x3a')][_0x28ab('0x3e')]));_0x327a00[_0x28ab('0x3d')]=_0x327a00[_0x28ab('0x3d')]['length']?_0x327a00[_0x28ab('0x3d')]:_0x395d94['model'];if(_0x657cd4[_0x28ab('0x3a')][_0x28ab('0x4b')]){_0x327a00[_0x28ab('0x4c')]=[{'all':!![]}];}_0x327a00=_[_0x28ab('0x47')]({},_0x327a00,_0x657cd4[_0x28ab('0x4a')]);return db[_0x28ab('0x35')][_0x28ab('0x50')](_0x327a00)[_0x28ab('0x1b')](handleEntityNotFound(_0x36a071,null))[_0x28ab('0x1b')](respondWithResult(_0x36a071,null))[_0x28ab('0x51')](handleError(_0x36a071,null));};exports[_0x28ab('0x52')]=function(_0x3f066c,_0x26351d){return db[_0x28ab('0x35')]['create'](_0x3f066c[_0x28ab('0x53')],{})['then'](function(_0x57bc5d){var _0x1686e2=_0x3f066c[_0x28ab('0x54')][_0x28ab('0x2e')]({'plain':!![]});if(!_0x1686e2)throw new Error(_0x28ab('0x55'));if(_0x1686e2[_0x28ab('0x56')]==='user'){var _0x1e3736=_0x57bc5d['get']({'plain':!![]});var _0x4210c6=_0x28ab('0x2f');return db[_0x28ab('0x57')][_0x28ab('0x50')]({'where':{'name':_0x4210c6,'userProfileId':_0x1686e2[_0x28ab('0x58')]},'raw':!![]})['then'](function(_0x392c12){if(_0x392c12&&_0x392c12[_0x28ab('0x59')]===0x0){return db[_0x28ab('0x30')][_0x28ab('0x52')]({'name':_0x1e3736[_0x28ab('0x32')],'resourceId':_0x1e3736['id'],'type':_0x392c12['name'],'sectionId':_0x392c12['id']},{})['then'](function(){return _0x57bc5d;});}else{return _0x57bc5d;}})[_0x28ab('0x51')](function(_0x250ac1){logger['error'](_0x28ab('0x5a'),_0x250ac1);throw _0x250ac1;});}return _0x57bc5d;})[_0x28ab('0x1b')](respondWithResult(_0x26351d,0xc9))[_0x28ab('0x51')](handleError(_0x26351d,null));};exports[_0x28ab('0x2c')]=function(_0x34be62,_0xa8a2e9){if(_0x34be62[_0x28ab('0x53')]['id']){delete _0x34be62[_0x28ab('0x53')]['id'];}return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x34be62[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0xa8a2e9,null))[_0x28ab('0x1b')](saveUpdates(_0x34be62[_0x28ab('0x53')],null))['then'](respondWithResult(_0xa8a2e9,null))['catch'](handleError(_0xa8a2e9,null));};exports[_0x28ab('0x2d')]=function(_0x5009be,_0x14454e){return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x5009be[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x14454e,null))['then'](removeEntity(_0x14454e,null))[_0x28ab('0x51')](handleError(_0x14454e,null));};exports['describe']=function(_0x30bc6b,_0x384e1c){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x384e1c,null))['catch'](handleError(_0x384e1c,null));};exports[_0x28ab('0x5b')]=function(_0x5e6bd1,_0x4aa3e7,_0x5b9726){var _0x21e77e={'raw':!![],'where':{}},_0x24ca6a={},_0x1f96ec;return db[_0x28ab('0x35')]['findOne']({'where':{'id':_0x5e6bd1[_0x28ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4aa3e7,null))[_0x28ab('0x1b')](function(_0x427c2f){if(_0x427c2f){_0x1f96ec=_0x427c2f[_0x28ab('0x2e')]({'plain':!![]});_0x24ca6a[_0x28ab('0x38')]=_[_0x28ab('0x3b')](db['UserChatQueue'][_0x28ab('0x36')]);_0x24ca6a['query']=_[_0x28ab('0x3b')](_0x5e6bd1['query']);_0x24ca6a[_0x28ab('0x45')]=_[_0x28ab('0x3c')](_0x24ca6a[_0x28ab('0x38')],_0x24ca6a[_0x28ab('0x3a')]);_0x21e77e[_0x28ab('0x3d')]=_[_0x28ab('0x3c')](_0x24ca6a[_0x28ab('0x38')],qs[_0x28ab('0x3e')](_0x5e6bd1['query']['fields']));_0x21e77e[_0x28ab('0x3d')]=_0x21e77e['attributes']['length']?_0x21e77e[_0x28ab('0x3d')]:_0x24ca6a[_0x28ab('0x38')];if(!_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x5c')](_0x28ab('0x5d'))){_0x21e77e['limit']=qs['limit'](_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x26')]);_0x21e77e[_0x28ab('0x40')]=qs[_0x28ab('0x40')](_0x5e6bd1[_0x28ab('0x3a')]['offset']);}_0x21e77e['order']=qs['sort'](_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x21e77e['where']=qs[_0x28ab('0x45')](_['pick'](_0x5e6bd1['query'],_0x24ca6a[_0x28ab('0x45')]));_0x21e77e[_0x28ab('0x43')][_0x28ab('0x5e')]=_0x427c2f['id'];if(_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x46')]){_0x21e77e[_0x28ab('0x43')]=_['merge'](_0x21e77e['where'],{'$or':_['map'](_0x21e77e[_0x28ab('0x3d')],function(_0x2bb845){var _0x3229f3={};_0x3229f3[_0x2bb845]={'$like':'%'+_0x5e6bd1['query'][_0x28ab('0x46')]+'%'};return _0x3229f3;})});}_0x21e77e=_[_0x28ab('0x47')]({},_0x21e77e,_0x5e6bd1['options']);return db[_0x28ab('0x5f')]['findAll'](_0x21e77e);}})[_0x28ab('0x1b')](function(_0x2280d6){if(_0x2280d6){return db['User'][_0x28ab('0x60')]({'where':{'id':_[_0x28ab('0x39')](_0x2280d6,_0x28ab('0x61')),'role':_0x28ab('0x62')},'attributes':['id',_0x28ab('0x32'),_0x28ab('0x63'),'updatedAt','createdAt']});}})[_0x28ab('0x1b')](function(_0x155f35){if(_0x155f35){return{'count':_0x155f35[_0x28ab('0x27')],'rows':_['map'](_0x155f35[_0x28ab('0x64')],function(_0x2e2f5a){return{'membername':_0x2e2f5a[_0x28ab('0x32')],'UserId':_0x2e2f5a['id'],'queue_name':_0x1f96ec[_0x28ab('0x32')],'ChatQueueId':_0x1f96ec['id'],'interface':util[_0x28ab('0x65')]('%s/%s','SIP',_0x2e2f5a[_0x28ab('0x32')]),'penalty':0x0,'paused':_0x2e2f5a[_0x28ab('0x63')],'createdAt':_0x2e2f5a['createdAt'],'updatedAt':_0x2e2f5a[_0x28ab('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x28ab('0x1b')](respondWithFilteredResult(_0x4aa3e7,_0x21e77e))['catch'](handleError(_0x4aa3e7,null));};exports[_0x28ab('0x67')]=function(_0x102c47,_0x574663,_0x16de02){var _0x3e9caa={};var _0x32f1c4={};var _0x150eb0;var _0x12723e;return db['ChatQueue'][_0x28ab('0x68')]({'where':{'id':_0x102c47[_0x28ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x574663,null))[_0x28ab('0x1b')](function(_0x236093){if(_0x236093){_0x150eb0=_0x236093;_0x32f1c4[_0x28ab('0x38')]=_['keys'](db[_0x28ab('0x69')]['rawAttributes']);_0x32f1c4['query']=_[_0x28ab('0x3b')](_0x102c47['query']);_0x32f1c4[_0x28ab('0x45')]=_[_0x28ab('0x3c')](_0x32f1c4[_0x28ab('0x38')],_0x32f1c4['query']);_0x3e9caa[_0x28ab('0x3d')]=_[_0x28ab('0x3c')](_0x32f1c4['model'],qs[_0x28ab('0x3e')](_0x102c47[_0x28ab('0x3a')][_0x28ab('0x3e')]));_0x3e9caa[_0x28ab('0x3d')]=_0x3e9caa['attributes'][_0x28ab('0x3f')]?_0x3e9caa[_0x28ab('0x3d')]:_0x32f1c4[_0x28ab('0x38')];_0x3e9caa[_0x28ab('0x41')]=qs[_0x28ab('0x42')](_0x102c47[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x3e9caa[_0x28ab('0x43')]=qs[_0x28ab('0x45')](_[_0x28ab('0x44')](_0x102c47['query'],_0x32f1c4['filters']));if(_0x102c47['query']['filter']){_0x3e9caa[_0x28ab('0x43')]=_[_0x28ab('0x47')](_0x3e9caa[_0x28ab('0x43')],{'$or':_[_0x28ab('0x39')](_0x3e9caa[_0x28ab('0x3d')],function(_0x41735a){var _0x3affe6={};_0x3affe6[_0x41735a]={'$like':'%'+_0x102c47[_0x28ab('0x3a')][_0x28ab('0x46')]+'%'};return _0x3affe6;})});}_0x3e9caa=_[_0x28ab('0x47')]({},_0x3e9caa,_0x102c47[_0x28ab('0x4a')]);return _0x150eb0[_0x28ab('0x67')](_0x3e9caa);}})['then'](function(_0x3ed273){if(_0x3ed273){_0x12723e=_0x3ed273[_0x28ab('0x3f')];if(!_0x102c47[_0x28ab('0x3a')][_0x28ab('0x5c')]('nolimit')){_0x3e9caa[_0x28ab('0x26')]=qs[_0x28ab('0x26')](_0x102c47[_0x28ab('0x3a')]['limit']);_0x3e9caa[_0x28ab('0x40')]=qs['offset'](_0x102c47['query'][_0x28ab('0x40')]);}return _0x150eb0[_0x28ab('0x67')](_0x3e9caa);}})[_0x28ab('0x1b')](function(_0x39731a){if(_0x39731a){return _0x39731a?{'count':_0x12723e,'rows':_0x39731a}:null;}})[_0x28ab('0x1b')](respondWithResult(_0x574663,null))[_0x28ab('0x51')](handleError(_0x574663,null));};exports['addTeams']=function(_0xd25adc,_0x5775d4,_0x2c1de4){var _0x2b859e=_0xd25adc[_0x28ab('0x53')][_0x28ab('0x6a')];return db[_0x28ab('0x69')][_0x28ab('0x4d')]({'where':{'id':_0x2b859e},'attributes':['id'],'include':[{'model':db[_0x28ab('0x6b')],'as':_0x28ab('0x6c'),'attributes':['id',_0x28ab('0x32'),_0x28ab('0x6d'),_0x28ab('0x6e'),_0x28ab('0x6f')],'raw':!![]}]})[_0x28ab('0x1b')](function(_0x56b098){if(_0x56b098){var _0x5d9ba1=_[_0x28ab('0x70')](_0x56b098,function(_0xa355e7){var _0x3c8223=_0xa355e7[_0x28ab('0x2e')]({'plain':!![]});return _0x3c8223[_0x28ab('0x6c')];});return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0xd25adc[_0x28ab('0x4f')]['id']}})['then'](function(_0x1b1ad9){return db[_0x28ab('0x71')]['transaction'](function(_0x45ff27){return _0x1b1ad9[_0x28ab('0x72')](_0x2b859e,{'transaction':_0x45ff27})[_0x28ab('0x1b')](function(){return BPromise[_0x28ab('0x73')](_0x5d9ba1,function(_0x2671f6){return db['UserChatQueue'][_0x28ab('0x74')]({'where':{'UserId':_0x2671f6['id'],'ChatQueueId':_0xd25adc[_0x28ab('0x4f')]['id']},'transaction':_0x45ff27});});})[_0x28ab('0x1b')](function(){_0x5d9ba1[_0x28ab('0x75')](function(_0x5b9a1a){socket[_0x28ab('0x76')](_0x28ab('0x77'),{'UserId':_0x5b9a1a['id'],'ChatQueueId':_0x1b1ad9['id']});});});});});}})[_0x28ab('0x1b')](respondWithStatusCode(_0x5775d4,null))[_0x28ab('0x51')](handleError(_0x5775d4,null));};exports[_0x28ab('0x78')]=function(_0x2c8e96,_0x4ddf90,_0x5e3531){return db[_0x28ab('0x69')]['findAll']({'where':{'id':_0x2c8e96[_0x28ab('0x3a')][_0x28ab('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x28ab('0x6b')],'as':_0x28ab('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x28ab('0x1b')](handleEntityNotFound(_0x4ddf90,null))[_0x28ab('0x1b')](function(_0x96d1b8){var _0x37754e=_[_0x28ab('0x39')](_0x96d1b8,'id');var _0x288f2e=[];var _0x330ee5=[];var _0xf4de45=squel['select']();_0xf4de45[_0x28ab('0x79')]('tq.TeamId')['from'](_0x28ab('0x7a'),'tq')[_0x28ab('0x7b')]('user_has_teams','ut',_0x28ab('0x7c'))[_0x28ab('0x43')]('ChatQueueId\x20=\x20?',_0x2c8e96[_0x28ab('0x4f')]['id']);for(var _0x492b6e=0x0;_0x492b6e<_0x96d1b8[_0x28ab('0x3f')];_0x492b6e+=0x1){let _0x3f5e40=_0x96d1b8[_0x492b6e];for(var _0x2b417a=0x0;_0x2b417a<_0x3f5e40[_0x28ab('0x6c')][_0x28ab('0x3f')];_0x2b417a+=0x1){let _0xfdd783=_0x3f5e40[_0x28ab('0x6c')][_0x2b417a];var _0x1e3631=_0xf4de45['clone']();_0x1e3631['where'](_0x28ab('0x7d'),_0xfdd783['id']);_0x330ee5['push'](db[_0x28ab('0x71')]['query'](_0x1e3631[_0x28ab('0x7e')](),{'type':db[_0x28ab('0x71')]['QueryTypes']['SELECT']})[_0x28ab('0x1b')](function(_0x508c48){if(_0x508c48[_0x28ab('0x3f')]===0x1){return _0xfdd783['id'];}else{var _0x363b64=_[_0x28ab('0x7f')](_[_0x28ab('0x39')](_0x508c48,_0x28ab('0x80')),function(_0xf71991){return _[_0x28ab('0x81')](_0x37754e,_0xf71991);});if(_0x363b64){return _0xfdd783['id'];}}}));}}return BPromise[_0x28ab('0x82')](_0x330ee5)[_0x28ab('0x1b')](function(_0x221102){_0x288f2e=_(_0x288f2e)[_0x28ab('0x83')](_0x221102)[_0x28ab('0x84')]()[_0x28ab('0x85')]();return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x2c8e96[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](function(_0x21faab){return db[_0x28ab('0x71')]['transaction'](function(_0x217993){return _0x21faab[_0x28ab('0x78')](_0x2c8e96[_0x28ab('0x3a')]['ids'],{'transaction':_0x217993})[_0x28ab('0x1b')](function(){if(!_[_0x28ab('0x86')](_0x288f2e)){return _0x21faab['removeAgents'](_0x288f2e,{'transaction':_0x217993});}})[_0x28ab('0x1b')](function(){_0x288f2e[_0x28ab('0x75')](function(_0x1b407c){socket[_0x28ab('0x76')](_0x28ab('0x87'),{'UserId':_0x1b407c,'ChatQueueId':_0x21faab['id']});});});});});});})[_0x28ab('0x1b')](respondWithStatusCode(_0x4ddf90,null))[_0x28ab('0x51')](handleError(_0x4ddf90,null));};exports[_0x28ab('0x88')]=function(_0x456364,_0x4455d,_0x5aad8d){return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x456364[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x4455d,null))['then'](function(_0x27ddfb){if(_0x27ddfb){return _0x27ddfb[_0x28ab('0x88')](_0x456364[_0x28ab('0x53')]['ids'],_[_0x28ab('0x89')](_0x456364['body'],[_0x28ab('0x6a'),'id'])||{})[_0x28ab('0x8a')](function(_0x37f99b){for(var _0x1a9861=0x0;_0x1a9861<_0x456364['body'][_0x28ab('0x6a')][_0x28ab('0x3f')];_0x1a9861+=0x1){socket[_0x28ab('0x76')](_0x28ab('0x77'),{'UserId':Number(_0x456364['body'][_0x28ab('0x6a')][_0x1a9861]),'ChatQueueId':Number(_0x456364[_0x28ab('0x4f')]['id'])});}return _0x37f99b;});}})[_0x28ab('0x1b')](respondWithResult(_0x4455d,null))['catch'](handleError(_0x4455d,null));};exports[_0x28ab('0x8b')]=function(_0x1804a8,_0x3644a5,_0x36a254){return db['ChatQueue'][_0x28ab('0x50')]({'where':{'id':_0x1804a8[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x3644a5,null))[_0x28ab('0x1b')](function(_0x5a3b0d){if(_0x5a3b0d){return _0x5a3b0d[_0x28ab('0x8b')](_0x1804a8[_0x28ab('0x3a')][_0x28ab('0x6a')])['then'](function(){if(_[_0x28ab('0x8c')](_0x1804a8['query'][_0x28ab('0x6a')])){for(var _0x3b2ef0=0x0;_0x3b2ef0<_0x1804a8[_0x28ab('0x3a')]['ids'][_0x28ab('0x3f')];_0x3b2ef0+=0x1){socket[_0x28ab('0x76')](_0x28ab('0x87'),{'UserId':Number(_0x1804a8[_0x28ab('0x3a')][_0x28ab('0x6a')][_0x3b2ef0]),'ChatQueueId':Number(_0x1804a8[_0x28ab('0x4f')]['id'])});}}else{socket[_0x28ab('0x76')](_0x28ab('0x87'),{'UserId':Number(_0x1804a8[_0x28ab('0x3a')][_0x28ab('0x6a')]),'ChatQueueId':Number(_0x1804a8[_0x28ab('0x4f')]['id'])});}});}})[_0x28ab('0x1b')](respondWithStatusCode(_0x3644a5,null))[_0x28ab('0x51')](handleError(_0x3644a5,null));};exports[_0x28ab('0x8d')]=function(_0x2d6c82,_0x1a10f3,_0x2191b3){var _0x374d70={};var _0x5e82d0={};var _0x4c773a;var _0x2c3fad;return db[_0x28ab('0x35')]['findOne']({'where':{'id':_0x2d6c82[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x1a10f3,null))['then'](function(_0x589443){if(_0x589443){_0x4c773a=_0x589443;_0x5e82d0[_0x28ab('0x38')]=_['keys'](db[_0x28ab('0x6b')][_0x28ab('0x36')]);_0x5e82d0[_0x28ab('0x3a')]=_[_0x28ab('0x3b')](_0x2d6c82[_0x28ab('0x3a')]);_0x5e82d0[_0x28ab('0x45')]=_['intersection'](_0x5e82d0[_0x28ab('0x38')],_0x5e82d0[_0x28ab('0x3a')]);_0x374d70[_0x28ab('0x3d')]=_['intersection'](_0x5e82d0['model'],qs[_0x28ab('0x3e')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x3e')]));_0x374d70[_0x28ab('0x3d')]=_0x374d70[_0x28ab('0x3d')][_0x28ab('0x3f')]?_0x374d70[_0x28ab('0x3d')]:_0x5e82d0[_0x28ab('0x38')];_0x374d70[_0x28ab('0x41')]=qs[_0x28ab('0x42')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x374d70['where']=qs[_0x28ab('0x45')](_[_0x28ab('0x44')](_0x2d6c82[_0x28ab('0x3a')],_0x5e82d0[_0x28ab('0x45')]));if(_0x2d6c82[_0x28ab('0x3a')]['filter']){_0x374d70[_0x28ab('0x43')]=_['merge'](_0x374d70[_0x28ab('0x43')],{'$or':_['map'](_0x374d70[_0x28ab('0x3d')],function(_0x474ac1){var _0x13f4b1={};_0x13f4b1[_0x474ac1]={'$like':'%'+_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x46')]+'%'};return _0x13f4b1;})});}_0x374d70=_[_0x28ab('0x47')]({},_0x374d70,_0x2d6c82['options']);return _0x4c773a['getAgents'](_0x374d70);}})['then'](function(_0x4cc3ed){if(_0x4cc3ed){_0x2c3fad=_0x4cc3ed['length'];if(!_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x5c')](_0x28ab('0x5d'))){_0x374d70['limit']=qs[_0x28ab('0x26')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x26')]);_0x374d70[_0x28ab('0x40')]=qs[_0x28ab('0x40')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x40')]);}return _0x4c773a[_0x28ab('0x8d')](_0x374d70);}})[_0x28ab('0x1b')](function(_0x3ff82f){if(_0x3ff82f){return _0x3ff82f?{'count':_0x2c3fad,'rows':_0x3ff82f}:null;}})[_0x28ab('0x1b')](respondWithResult(_0x1a10f3,null))[_0x28ab('0x51')](handleError(_0x1a10f3,null));};
\ No newline at end of file
index f0c505d..4c3f2ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ea5=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x4f2d8e,_0x478943){var _0x2fa062=function(_0x257b5a){while(--_0x257b5a){_0x4f2d8e['push'](_0x4f2d8e['shift']());}};_0x2fa062(++_0x478943);}(_0x6ea5,0xa5));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x56ea('0x0'));var ChatQueue=require(_0x56ea('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x56ea('0x2')](0x0);var events={'afterCreate':_0x56ea('0x3'),'afterUpdate':'update','afterDestroy':_0x56ea('0x4')};function emitEvent(_0x514fec){return function(_0x4d590f,_0x3cee31,_0x4f349b){ChatQueueEvents[_0x56ea('0x5')](_0x514fec+':'+_0x4d590f['id'],_0x4d590f);ChatQueueEvents[_0x56ea('0x5')](_0x514fec,_0x4d590f);_0x4f349b(null);};}for(var e in events){if(events[_0x56ea('0x6')](e)){var event=events[e];ChatQueue[_0x56ea('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x3a9a=['events','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x534258,_0x1d171d){var _0x47aff8=function(_0x2471f3){while(--_0x2471f3){_0x534258['push'](_0x534258['shift']());}};_0x47aff8(++_0x1d171d);}(_0x3a9a,0x122));var _0xa3a9=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0x3a9a[_0x541260];return _0x1dd2b5;};'use strict';var EventEmitter=require(_0xa3a9('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xa3a9('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa3a9('0x2')](0x0);var events={'afterCreate':_0xa3a9('0x3'),'afterUpdate':_0xa3a9('0x4'),'afterDestroy':_0xa3a9('0x5')};function emitEvent(_0xb8cce8){return function(_0x58e3f9,_0x3a0d2c,_0x5dd0d2){ChatQueueEvents[_0xa3a9('0x6')](_0xb8cce8+':'+_0x58e3f9['id'],_0x58e3f9);ChatQueueEvents['emit'](_0xb8cce8,_0x58e3f9);_0x5dd0d2(null);};}for(var e in events){if(events[_0xa3a9('0x7')](e)){var event=events[e];ChatQueue[_0xa3a9('0x8')](e,emitEvent(event));}}module[_0xa3a9('0x9')]=ChatQueueEvents;
\ No newline at end of file
index 9b3f8cf..6cfb1ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26d7=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues'];(function(_0x527d44,_0x1dcd67){var _0x1374e2=function(_0x4c77d3){while(--_0x4c77d3){_0x527d44['push'](_0x527d44['shift']());}};_0x1374e2(++_0x1dcd67);}(_0x26d7,0xfd));var _0x726d=function(_0x44e18a,_0x198ce9){_0x44e18a=_0x44e18a-0x0;var _0x38af78=_0x26d7[_0x44e18a];return _0x38af78;};'use strict';var _=require(_0x726d('0x0'));var util=require(_0x726d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x726d('0x2'));var BPromise=require('bluebird');var rp=require(_0x726d('0x3'));var fs=require('fs');var path=require(_0x726d('0x4'));var rimraf=require(_0x726d('0x5'));var config=require(_0x726d('0x6'));var attributes=require(_0x726d('0x7'));module[_0x726d('0x8')]=function(_0x5bbb46,_0x23b31e){return _0x5bbb46[_0x726d('0x9')]('ChatQueue',attributes,{'tableName':_0x726d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48d4=['moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x48d4,0x99));var _0x448d=function(_0xef01a2,_0x426962){_0xef01a2=_0xef01a2-0x0;var _0x88a2bc=_0x48d4[_0xef01a2];return _0x88a2bc;};'use strict';var _=require(_0x448d('0x0'));var util=require(_0x448d('0x1'));var logger=require(_0x448d('0x2'))('api');var moment=require(_0x448d('0x3'));var BPromise=require(_0x448d('0x4'));var rp=require(_0x448d('0x5'));var fs=require('fs');var path=require(_0x448d('0x6'));var rimraf=require(_0x448d('0x7'));var config=require('../../config/environment');var attributes=require(_0x448d('0x8'));module[_0x448d('0x9')]=function(_0x8587d1,_0x248763){return _0x8587d1[_0x448d('0xa')](_0x448d('0xb'),attributes,{'tableName':_0x448d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f08ea1..97187bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf2f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowChatQueue','find','where','lodash'];(function(_0x97a971,_0x540bbe){var _0x1dff74=function(_0x4aa3f4){while(--_0x4aa3f4){_0x97a971['push'](_0x97a971['shift']());}};_0x1dff74(++_0x540bbe);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x553aa1,_0x512f29){_0x553aa1=_0x553aa1-0x0;var _0x1216a7=_0xcf2f[_0x553aa1];return _0x1216a7;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});config[_0xfcf2('0xd')]=_[_0xfcf2('0xe')](config[_0xfcf2('0xd')],{'host':_0xfcf2('0xf'),'port':0x18eb});var socket=require(_0xfcf2('0x10'))(new Redis(config[_0xfcf2('0xd')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4d6fc9,_0x91b579,_0x2a9ecb){return new BPromise(function(_0x481e38,_0xf38eab){return client[_0xfcf2('0x11')](_0x4d6fc9,_0x2a9ecb)[_0xfcf2('0x12')](function(_0x29e649){logger['info']('ChatQueue,\x20%s,\x20%s',_0x91b579,_0xfcf2('0x13'));logger[_0xfcf2('0x14')](_0xfcf2('0x15'),_0x91b579,_0xfcf2('0x13'),JSON['stringify'](_0x29e649));if(_0x29e649[_0xfcf2('0x16')]){if(_0x29e649['error']['code']===0x1f4){logger['error'](_0xfcf2('0x17'),_0x91b579,_0x29e649['error'][_0xfcf2('0x18')]);return _0xf38eab(_0x29e649[_0xfcf2('0x16')][_0xfcf2('0x18')]);}logger[_0xfcf2('0x16')](_0xfcf2('0x17'),_0x91b579,_0x29e649[_0xfcf2('0x16')][_0xfcf2('0x18')]);return _0x481e38(_0x29e649['error'][_0xfcf2('0x18')]);}else{logger[_0xfcf2('0x19')](_0xfcf2('0x17'),_0x91b579,'request\x20sent');_0x481e38(_0x29e649[_0xfcf2('0x1a')][_0xfcf2('0x18')]);}})[_0xfcf2('0x1b')](function(_0x1cc67e){logger[_0xfcf2('0x16')]('ChatQueue,\x20%s,\x20%s',_0x91b579,_0x1cc67e);_0xf38eab(_0x1cc67e);});});}exports[_0xfcf2('0x1c')]=function(_0x11c34f){var _0x4939e4=this;return new Promise(function(_0x9a1d9f,_0x23c079){return db[_0xfcf2('0x1d')][_0xfcf2('0x1e')]({'raw':_0x11c34f[_0xfcf2('0x1f')]?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x20')]===undefined?!![]:![]:!![],'where':_0x11c34f[_0xfcf2('0x1f')]?_0x11c34f[_0xfcf2('0x1f')]['where']||null:null,'attributes':_0x11c34f[_0xfcf2('0x1f')]?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x21')]||null:null,'limit':_0x11c34f['options']?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x22')]||null:null,'include':_0x11c34f['options']?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x23')]?_['map'](_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x23')],function(_0x1f0f07){return{'model':db[_0x1f0f07[_0xfcf2('0x24')]],'as':_0x1f0f07['as'],'attributes':_0x1f0f07['attributes'],'include':_0x1f0f07[_0xfcf2('0x23')]?_[_0xfcf2('0x25')](_0x1f0f07[_0xfcf2('0x23')],function(_0x3779ee){return{'model':db[_0x3779ee[_0xfcf2('0x24')]],'as':_0x3779ee['as'],'attributes':_0x3779ee[_0xfcf2('0x21')],'include':_0x3779ee[_0xfcf2('0x23')]?_[_0xfcf2('0x25')](_0x3779ee[_0xfcf2('0x23')],function(_0x56f839){return{'model':db[_0x56f839['model']],'as':_0x56f839['as'],'attributes':_0x56f839[_0xfcf2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfcf2('0x12')](function(_0x3308c3){logger['info'](_0xfcf2('0x1c'),_0x11c34f);logger['debug'](_0xfcf2('0x1c'),_0x11c34f,JSON[_0xfcf2('0x26')](_0x3308c3));_0x9a1d9f(_0x3308c3);})[_0xfcf2('0x1b')](function(_0x1a4485){logger[_0xfcf2('0x16')](_0xfcf2('0x1c'),_0x1a4485[_0xfcf2('0x18')],_0x11c34f);_0x23c079(_0x4939e4['error'](0x1f4,_0x1a4485['message']));});});};exports[_0xfcf2('0x27')]=function(_0x1acbea){var _0x147ed2=this;return new Promise(function(_0xd76c56,_0x4913fc){return db['ChatQueue'][_0xfcf2('0x28')]({'raw':_0x1acbea['options']?_0x1acbea[_0xfcf2('0x1f')][_0xfcf2('0x20')]===undefined?!![]:![]:!![],'where':_0x1acbea['options']?_0x1acbea[_0xfcf2('0x1f')][_0xfcf2('0x29')]||null:null,'attributes':_0x1acbea[_0xfcf2('0x1f')]?_0x1acbea[_0xfcf2('0x1f')][_0xfcf2('0x21')]||null:null,'include':_0x1acbea[_0xfcf2('0x1f')]?_0x1acbea[_0xfcf2('0x1f')]['include']?_[_0xfcf2('0x25')](_0x1acbea[_0xfcf2('0x1f')]['include'],function(_0x101561){return{'model':db[_0x101561[_0xfcf2('0x24')]],'as':_0x101561['as'],'attributes':_0x101561['attributes'],'include':_0x101561[_0xfcf2('0x23')]?_[_0xfcf2('0x25')](_0x101561['include'],function(_0x34a518){return{'model':db[_0x34a518[_0xfcf2('0x24')]],'as':_0x34a518['as'],'attributes':_0x34a518[_0xfcf2('0x21')],'include':_0x34a518[_0xfcf2('0x23')]?_['map'](_0x34a518[_0xfcf2('0x23')],function(_0x2dbabb){return{'model':db[_0x2dbabb[_0xfcf2('0x24')]],'as':_0x2dbabb['as'],'attributes':_0x2dbabb[_0xfcf2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfcf2('0x12')](function(_0x5722be){logger[_0xfcf2('0x19')](_0xfcf2('0x27'),_0x1acbea);logger[_0xfcf2('0x14')](_0xfcf2('0x27'),_0x1acbea,JSON[_0xfcf2('0x26')](_0x5722be));_0xd76c56(_0x5722be);})['catch'](function(_0xc38622){logger['error'](_0xfcf2('0x27'),_0xc38622[_0xfcf2('0x18')],_0x1acbea);_0x4913fc(_0x147ed2[_0xfcf2('0x16')](0x1f4,_0xc38622[_0xfcf2('0x18')]));});});};
\ No newline at end of file
+var _0x145d=['model','ShowChatQueue','find','raw','where','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','ChatQueue','options','limit','map','include','attributes'];(function(_0x27afb9,_0x291d1f){var _0x406866=function(_0x4639e8){while(--_0x4639e8){_0x27afb9['push'](_0x27afb9['shift']());}};_0x406866(++_0x291d1f);}(_0x145d,0xc9));var _0xd145=function(_0x195d50,_0x19816a){_0x195d50=_0x195d50-0x0;var _0x2f74ea=_0x145d[_0x195d50];return _0x2f74ea;};'use strict';var _=require('lodash');var util=require(_0xd145('0x0'));var moment=require(_0xd145('0x1'));var BPromise=require(_0xd145('0x2'));var rs=require(_0xd145('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd145('0x4'))['db'];var utils=require(_0xd145('0x5'));var logger=require(_0xd145('0x6'))('rpc');var config=require(_0xd145('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd145('0x8')][_0xd145('0x9')]({'port':0x232a});config[_0xd145('0xa')]=_[_0xd145('0xb')](config['redis'],{'host':_0xd145('0xc'),'port':0x18eb});var socket=require(_0xd145('0xd'))(new Redis(config[_0xd145('0xa')]));require(_0xd145('0xe'))[_0xd145('0xf')](socket);function respondWithRpcPromise(_0x30385d,_0x5d927e,_0x547317){return new BPromise(function(_0x46be49,_0x344a59){return client[_0xd145('0x10')](_0x30385d,_0x547317)['then'](function(_0x151615){logger[_0xd145('0x11')](_0xd145('0x12'),_0x5d927e,_0xd145('0x13'));logger[_0xd145('0x14')](_0xd145('0x15'),_0x5d927e,_0xd145('0x13'),JSON[_0xd145('0x16')](_0x151615));if(_0x151615[_0xd145('0x17')]){if(_0x151615[_0xd145('0x17')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5d927e,_0x151615[_0xd145('0x17')][_0xd145('0x18')]);return _0x344a59(_0x151615[_0xd145('0x17')][_0xd145('0x18')]);}logger[_0xd145('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5d927e,_0x151615['error'][_0xd145('0x18')]);return _0x46be49(_0x151615[_0xd145('0x17')][_0xd145('0x18')]);}else{logger[_0xd145('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5d927e,_0xd145('0x13'));_0x46be49(_0x151615['result'][_0xd145('0x18')]);}})[_0xd145('0x19')](function(_0x275c08){logger[_0xd145('0x17')](_0xd145('0x12'),_0x5d927e,_0x275c08);_0x344a59(_0x275c08);});});}exports[_0xd145('0x1a')]=function(_0x32061d){var _0x1feceb=this;return new Promise(function(_0x4ec45e,_0x25b041){return db[_0xd145('0x1b')]['findAll']({'raw':_0x32061d[_0xd145('0x1c')]?_0x32061d[_0xd145('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32061d[_0xd145('0x1c')]?_0x32061d[_0xd145('0x1c')]['where']||null:null,'attributes':_0x32061d[_0xd145('0x1c')]?_0x32061d['options']['attributes']||null:null,'limit':_0x32061d[_0xd145('0x1c')]?_0x32061d['options'][_0xd145('0x1d')]||null:null,'include':_0x32061d[_0xd145('0x1c')]?_0x32061d[_0xd145('0x1c')]['include']?_[_0xd145('0x1e')](_0x32061d[_0xd145('0x1c')][_0xd145('0x1f')],function(_0x1812c5){return{'model':db[_0x1812c5['model']],'as':_0x1812c5['as'],'attributes':_0x1812c5[_0xd145('0x20')],'include':_0x1812c5[_0xd145('0x1f')]?_['map'](_0x1812c5[_0xd145('0x1f')],function(_0xbdbbfc){return{'model':db[_0xbdbbfc[_0xd145('0x21')]],'as':_0xbdbbfc['as'],'attributes':_0xbdbbfc[_0xd145('0x20')],'include':_0xbdbbfc[_0xd145('0x1f')]?_['map'](_0xbdbbfc[_0xd145('0x1f')],function(_0x285665){return{'model':db[_0x285665['model']],'as':_0x285665['as'],'attributes':_0x285665[_0xd145('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x233186){logger[_0xd145('0x11')](_0xd145('0x1a'),_0x32061d);logger[_0xd145('0x14')](_0xd145('0x1a'),_0x32061d,JSON[_0xd145('0x16')](_0x233186));_0x4ec45e(_0x233186);})[_0xd145('0x19')](function(_0x2e7815){logger[_0xd145('0x17')]('GetChatQueue',_0x2e7815[_0xd145('0x18')],_0x32061d);_0x25b041(_0x1feceb['error'](0x1f4,_0x2e7815[_0xd145('0x18')]));});});};exports[_0xd145('0x22')]=function(_0x4f1e83){var _0x52a35a=this;return new Promise(function(_0x53061b,_0x19e9db){return db['ChatQueue'][_0xd145('0x23')]({'raw':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x24')]===undefined?!![]:![]:!![],'where':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x25')]||null:null,'attributes':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x20')]||null:null,'include':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x1f')]?_[_0xd145('0x1e')](_0x4f1e83[_0xd145('0x1c')]['include'],function(_0x401801){return{'model':db[_0x401801[_0xd145('0x21')]],'as':_0x401801['as'],'attributes':_0x401801['attributes'],'include':_0x401801['include']?_[_0xd145('0x1e')](_0x401801['include'],function(_0x5dc23e){return{'model':db[_0x5dc23e['model']],'as':_0x5dc23e['as'],'attributes':_0x5dc23e['attributes'],'include':_0x5dc23e['include']?_['map'](_0x5dc23e['include'],function(_0x293e22){return{'model':db[_0x293e22[_0xd145('0x21')]],'as':_0x293e22['as'],'attributes':_0x293e22[_0xd145('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd145('0x26')](function(_0xcf6c3e){logger[_0xd145('0x11')](_0xd145('0x22'),_0x4f1e83);logger[_0xd145('0x14')](_0xd145('0x22'),_0x4f1e83,JSON[_0xd145('0x16')](_0xcf6c3e));_0x53061b(_0xcf6c3e);})['catch'](function(_0x1534f0){logger[_0xd145('0x17')](_0xd145('0x22'),_0x1534f0[_0xd145('0x18')],_0x4f1e83);_0x19e9db(_0x52a35a[_0xd145('0x17')](0x1f4,_0x1534f0['message']));});});};
\ No newline at end of file
index fdcd4de..89fa15b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xed1f[_0x5a9c0c];return _0x53c77d;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}};
\ No newline at end of file
+var _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x5a79d8,_0x504a38){var _0x3edab8=function(_0x455d5b){while(--_0x455d5b){_0x5a79d8['push'](_0x5a79d8['shift']());}};_0x3edab8(++_0x504a38);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5637a6,_0x445c91){_0x5637a6=_0x5637a6-0x0;var _0x54a1c0=_0x8d0e[_0x5637a6];return _0x54a1c0;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}};
\ No newline at end of file
index 1628ace..c2213d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x5fc3[_0x52096b];return _0x2b1cc7;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x46b8aa,_0x246d21){var _0x5a3d61=function(_0x5c748d){while(--_0x5c748d){_0x46b8aa['push'](_0x46b8aa['shift']());}};_0x5a3d61(++_0x246d21);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index ff48a24..405dfca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06d7=['STRING','DATE','moment','sequelize','exports'];(function(_0x2bf9b5,_0x6d057b){var _0x48afb3=function(_0x294530){while(--_0x294530){_0x2bf9b5['push'](_0x2bf9b5['shift']());}};_0x48afb3(++_0x6d057b);}(_0x06d7,0x19c));var _0x706d=function(_0x4e63cf,_0x49b7ca){_0x4e63cf=_0x4e63cf-0x0;var _0x38e54e=_0x06d7[_0x4e63cf];return _0x38e54e;};'use strict';var moment=require(_0x706d('0x0'));var Sequelize=require(_0x706d('0x1'));module[_0x706d('0x2')]={'uniqueid':{'type':Sequelize[_0x706d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x706d('0x3')]},'joinAt':{'type':Sequelize[_0x706d('0x4')]},'leaveAt':{'type':Sequelize[_0x706d('0x4')]},'acceptAt':{'type':Sequelize[_0x706d('0x4')]},'exitAt':{'type':Sequelize[_0x706d('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc741=['DATE','moment','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc741,0xe7));var _0x1c74=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc741[_0x88cd7b];return _0x56fcc8;};'use strict';var moment=require(_0x1c74('0x0'));var Sequelize=require(_0x1c74('0x1'));module[_0x1c74('0x2')]={'uniqueid':{'type':Sequelize[_0x1c74('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1c74('0x3')]},'joinAt':{'type':Sequelize[_0x1c74('0x4')]},'leaveAt':{'type':Sequelize[_0x1c74('0x4')]},'acceptAt':{'type':Sequelize[_0x1c74('0x4')]},'exitAt':{'type':Sequelize[_0x1c74('0x4')]},'reason':{'type':Sequelize[_0x1c74('0x3')]}};
\ No newline at end of file
index ff0b638..08c1292 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf446=['type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','error','stack','name','index','map','ChatQueueReport','fieldName'];(function(_0x284d96,_0x2cd706){var _0x371303=function(_0x436a9b){while(--_0x436a9b){_0x284d96['push'](_0x284d96['shift']());}};_0x371303(++_0x2cd706);}(_0xf446,0x1c0));var _0x6f44=function(_0x4cab36,_0x27aa8f){_0x4cab36=_0x4cab36-0x0;var _0x1eca64=_0xf446[_0x4cab36];return _0x1eca64;};'use strict';var emlformat=require(_0x6f44('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f44('0x1'));var jsonpatch=require(_0x6f44('0x2'));var rp=require('request-promise');var moment=require(_0x6f44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f44('0x4'));var util=require(_0x6f44('0x5'));var path=require('path');var sox=require(_0x6f44('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f44('0x7'));var squel=require('squel');var crypto=require(_0x6f44('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f44('0x9'));var querystring=require('querystring');var Papa=require(_0x6f44('0xa'));var Redis=require(_0x6f44('0xb'));var authService=require(_0x6f44('0xc'));var qs=require(_0x6f44('0xd'));var as=require(_0x6f44('0xe'));var hardwareService=require(_0x6f44('0xf'));var logger=require(_0x6f44('0x10'))(_0x6f44('0x11'));var utils=require('../../config/utils');var config=require(_0x6f44('0x12'));var licenseUtil=require(_0x6f44('0x13'));var db=require(_0x6f44('0x14'))['db'];function respondWithStatusCode(_0x4bacc0,_0x305757){_0x305757=_0x305757||0xcc;return function(_0x381112){if(_0x381112){return _0x4bacc0[_0x6f44('0x15')](_0x305757);}return _0x4bacc0[_0x6f44('0x16')](_0x305757)['end']();};}function respondWithResult(_0x82c009,_0x4f1b19){_0x4f1b19=_0x4f1b19||0xc8;return function(_0x310dec){if(_0x310dec){return _0x82c009['status'](_0x4f1b19)['json'](_0x310dec);}};}function respondWithFilteredResult(_0x33e088,_0xe5c968){return function(_0x33a130){if(_0x33a130){var _0x22200e=typeof _0xe5c968[_0x6f44('0x17')]===_0x6f44('0x18')&&typeof _0xe5c968[_0x6f44('0x19')]===_0x6f44('0x18');var _0x16021b=_0x33a130[_0x6f44('0x1a')];var _0x27062e=_0x22200e?0x0:_0xe5c968['offset'];var _0x11b488=_0x22200e?_0x33a130[_0x6f44('0x1a')]:_0xe5c968[_0x6f44('0x17')]+_0xe5c968[_0x6f44('0x19')];var _0x46c693;if(_0x11b488>=_0x16021b){_0x11b488=_0x16021b;_0x46c693=0xc8;}else{_0x46c693=0xce;}_0x33e088['status'](_0x46c693);return _0x33e088[_0x6f44('0x1b')]('Content-Range',_0x27062e+'-'+_0x11b488+'/'+_0x16021b)[_0x6f44('0x1c')](_0x33a130);}return null;};}function patchUpdates(_0x57d6a2){return function(_0x3c1265){try{jsonpatch['apply'](_0x3c1265,_0x57d6a2,!![]);}catch(_0x415cce){return BPromise[_0x6f44('0x1d')](_0x415cce);}return _0x3c1265[_0x6f44('0x1e')]();};}function saveUpdates(_0xf1a57c,_0x1137db){return function(_0x1418e1){if(_0x1418e1){return _0x1418e1[_0x6f44('0x1f')](_0xf1a57c)[_0x6f44('0x20')](function(_0x3e121e){return _0x3e121e;});}return null;};}function removeEntity(_0x50bbad,_0x56cbea){return function(_0x3583c7){if(_0x3583c7){return _0x3583c7[_0x6f44('0x21')]()[_0x6f44('0x20')](function(){_0x50bbad[_0x6f44('0x16')](0xcc)[_0x6f44('0x22')]();});}};}function handleEntityNotFound(_0x2681a9,_0x5d19d8){return function(_0x17ebd2){if(!_0x17ebd2){_0x2681a9[_0x6f44('0x15')](0x194);}return _0x17ebd2;};}function handleError(_0x58351a,_0x568f8b){_0x568f8b=_0x568f8b||0x1f4;return function(_0x430b93){logger[_0x6f44('0x23')](_0x430b93[_0x6f44('0x24')]);if(_0x430b93[_0x6f44('0x25')]){delete _0x430b93[_0x6f44('0x25')];}_0x58351a[_0x6f44('0x16')](_0x568f8b)['send'](_0x430b93);};}exports[_0x6f44('0x26')]=function(_0x47feea,_0x33ec71){var _0x6784ce={},_0x1cb57d={},_0x4b275b={'count':0x0,'rows':[]};var _0x477a0f=_[_0x6f44('0x27')](db[_0x6f44('0x28')]['rawAttributes'],function(_0x5e7651){return{'name':_0x5e7651[_0x6f44('0x29')],'type':_0x5e7651[_0x6f44('0x2a')][_0x6f44('0x2b')]};});_0x1cb57d['model']=_[_0x6f44('0x27')](_0x477a0f,_0x6f44('0x25'));_0x1cb57d[_0x6f44('0x2c')]=_[_0x6f44('0x2d')](_0x47feea[_0x6f44('0x2c')]);_0x1cb57d[_0x6f44('0x2e')]=_[_0x6f44('0x2f')](_0x1cb57d[_0x6f44('0x30')],_0x1cb57d[_0x6f44('0x2c')]);_0x6784ce[_0x6f44('0x31')]=_[_0x6f44('0x2f')](_0x1cb57d[_0x6f44('0x30')],qs['fields'](_0x47feea['query'][_0x6f44('0x32')]));_0x6784ce[_0x6f44('0x31')]=_0x6784ce[_0x6f44('0x31')]['length']?_0x6784ce[_0x6f44('0x31')]:_0x1cb57d[_0x6f44('0x30')];if(!_0x47feea[_0x6f44('0x2c')][_0x6f44('0x33')](_0x6f44('0x34'))){_0x6784ce[_0x6f44('0x19')]=qs[_0x6f44('0x19')](_0x47feea[_0x6f44('0x2c')][_0x6f44('0x19')]);_0x6784ce['offset']=qs[_0x6f44('0x17')](_0x47feea['query']['offset']);}_0x6784ce['order']=qs[_0x6f44('0x35')](_0x47feea[_0x6f44('0x2c')][_0x6f44('0x35')]);_0x6784ce[_0x6f44('0x36')]=qs[_0x6f44('0x2e')](_['pick'](_0x47feea[_0x6f44('0x2c')],_0x1cb57d[_0x6f44('0x2e')]),_0x477a0f);if(_0x47feea[_0x6f44('0x2c')]['filter']){_0x6784ce[_0x6f44('0x36')]=_[_0x6f44('0x37')](_0x6784ce[_0x6f44('0x36')],{'$or':_[_0x6f44('0x27')](_0x477a0f,function(_0x27968a){if(_0x27968a['type']!==_0x6f44('0x38')){var _0x44c6c6={};_0x44c6c6[_0x27968a[_0x6f44('0x25')]]={'$like':'%'+_0x47feea['query']['filter']+'%'};return _0x44c6c6;}})});}_0x6784ce=_['merge']({},_0x6784ce,_0x47feea[_0x6f44('0x39')]);var _0x5e34ef={'where':_0x6784ce[_0x6f44('0x36')]};return db['ChatQueueReport'][_0x6f44('0x1a')](_0x5e34ef)[_0x6f44('0x20')](function(_0x3a3ca1){_0x4b275b[_0x6f44('0x1a')]=_0x3a3ca1;if(_0x47feea[_0x6f44('0x2c')][_0x6f44('0x3a')]){_0x6784ce['include']=[{'all':!![]}];}return db[_0x6f44('0x28')][_0x6f44('0x3b')](_0x6784ce);})[_0x6f44('0x20')](function(_0x297999){_0x4b275b[_0x6f44('0x3c')]=_0x297999;return _0x4b275b;})['then'](respondWithFilteredResult(_0x33ec71,_0x6784ce))[_0x6f44('0x3d')](handleError(_0x33ec71,null));};exports[_0x6f44('0x3e')]=function(_0x3c4dcb,_0x47052d){var _0xadfbd6={'raw':!![],'where':{'id':_0x3c4dcb[_0x6f44('0x3f')]['id']}},_0x3d1162={};_0x3d1162[_0x6f44('0x30')]=_[_0x6f44('0x2d')](db['ChatQueueReport'][_0x6f44('0x40')]);_0x3d1162['query']=_[_0x6f44('0x2d')](_0x3c4dcb[_0x6f44('0x2c')]);_0x3d1162[_0x6f44('0x2e')]=_[_0x6f44('0x2f')](_0x3d1162['model'],_0x3d1162[_0x6f44('0x2c')]);_0xadfbd6[_0x6f44('0x31')]=_['intersection'](_0x3d1162[_0x6f44('0x30')],qs[_0x6f44('0x32')](_0x3c4dcb[_0x6f44('0x2c')][_0x6f44('0x32')]));_0xadfbd6[_0x6f44('0x31')]=_0xadfbd6[_0x6f44('0x31')][_0x6f44('0x41')]?_0xadfbd6[_0x6f44('0x31')]:_0x3d1162['model'];if(_0x3c4dcb[_0x6f44('0x2c')][_0x6f44('0x3a')]){_0xadfbd6['include']=[{'all':!![]}];}_0xadfbd6=_[_0x6f44('0x37')]({},_0xadfbd6,_0x3c4dcb['options']);return db['ChatQueueReport']['find'](_0xadfbd6)[_0x6f44('0x20')](handleEntityNotFound(_0x47052d,null))['then'](respondWithResult(_0x47052d,null))['catch'](handleError(_0x47052d,null));};exports[_0x6f44('0x42')]=function(_0x3b3585,_0x3e1a61){return db[_0x6f44('0x28')][_0x6f44('0x42')](_0x3b3585['body'],{})[_0x6f44('0x20')](respondWithResult(_0x3e1a61,0xc9))[_0x6f44('0x3d')](handleError(_0x3e1a61,null));};exports[_0x6f44('0x1f')]=function(_0x35668c,_0x1fe022){if(_0x35668c['body']['id']){delete _0x35668c[_0x6f44('0x43')]['id'];}return db[_0x6f44('0x28')][_0x6f44('0x44')]({'where':{'id':_0x35668c[_0x6f44('0x3f')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x1fe022,null))['then'](saveUpdates(_0x35668c['body'],null))[_0x6f44('0x20')](respondWithResult(_0x1fe022,null))['catch'](handleError(_0x1fe022,null));};exports[_0x6f44('0x21')]=function(_0x55bda4,_0x5c3305){return db[_0x6f44('0x28')][_0x6f44('0x44')]({'where':{'id':_0x55bda4[_0x6f44('0x3f')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x5c3305,null))[_0x6f44('0x20')](removeEntity(_0x5c3305,null))['catch'](handleError(_0x5c3305,null));};exports[_0x6f44('0x45')]=function(_0x6f1cb5,_0xb97acf){return db[_0x6f44('0x28')]['describe']()[_0x6f44('0x20')](respondWithResult(_0xb97acf,null))[_0x6f44('0x3d')](handleError(_0xb97acf,null));};
\ No newline at end of file
+var _0xc1db=['show','params','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count','limit','Content-Range','json','reject','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','merge','VIRTUAL','options','where','ChatQueueReport','includeAll','findAll','rows'];(function(_0x3a355d,_0x26de2a){var _0x37aa3b=function(_0x42c21a){while(--_0x42c21a){_0x3a355d['push'](_0x3a355d['shift']());}};_0x37aa3b(++_0x26de2a);}(_0xc1db,0x120));var _0xbc1d=function(_0x414416,_0x19916a){_0x414416=_0x414416-0x0;var _0x13b218=_0xc1db[_0x414416];return _0x13b218;};'use strict';var emlformat=require(_0xbc1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc1d('0x1'));var jsonpatch=require(_0xbc1d('0x2'));var rp=require(_0xbc1d('0x3'));var moment=require(_0xbc1d('0x4'));var BPromise=require(_0xbc1d('0x5'));var Mustache=require('mustache');var util=require(_0xbc1d('0x6'));var path=require(_0xbc1d('0x7'));var sox=require(_0xbc1d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc1d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbc1d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbc1d('0xb'));var toCsv=require(_0xbc1d('0xc'));var querystring=require('querystring');var Papa=require(_0xbc1d('0xd'));var Redis=require('ioredis');var authService=require(_0xbc1d('0xe'));var qs=require(_0xbc1d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc1d('0x10'));var logger=require(_0xbc1d('0x11'))(_0xbc1d('0x12'));var utils=require(_0xbc1d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbc1d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3801b9,_0x112284){_0x112284=_0x112284||0xcc;return function(_0x50982e){if(_0x50982e){return _0x3801b9[_0xbc1d('0x15')](_0x112284);}return _0x3801b9[_0xbc1d('0x16')](_0x112284)['end']();};}function respondWithResult(_0x373f20,_0x35d81d){_0x35d81d=_0x35d81d||0xc8;return function(_0x58e7f4){if(_0x58e7f4){return _0x373f20[_0xbc1d('0x16')](_0x35d81d)['json'](_0x58e7f4);}};}function respondWithFilteredResult(_0x4142e4,_0x238c0d){return function(_0xfe7015){if(_0xfe7015){var _0xf56647=typeof _0x238c0d[_0xbc1d('0x17')]===_0xbc1d('0x18')&&typeof _0x238c0d['limit']===_0xbc1d('0x18');var _0x57cb2a=_0xfe7015[_0xbc1d('0x19')];var _0x225310=_0xf56647?0x0:_0x238c0d['offset'];var _0x58c56e=_0xf56647?_0xfe7015['count']:_0x238c0d[_0xbc1d('0x17')]+_0x238c0d[_0xbc1d('0x1a')];var _0x44887e;if(_0x58c56e>=_0x57cb2a){_0x58c56e=_0x57cb2a;_0x44887e=0xc8;}else{_0x44887e=0xce;}_0x4142e4[_0xbc1d('0x16')](_0x44887e);return _0x4142e4['set'](_0xbc1d('0x1b'),_0x225310+'-'+_0x58c56e+'/'+_0x57cb2a)[_0xbc1d('0x1c')](_0xfe7015);}return null;};}function patchUpdates(_0x59f362){return function(_0xd5886c){try{jsonpatch['apply'](_0xd5886c,_0x59f362,!![]);}catch(_0x5ab558){return BPromise[_0xbc1d('0x1d')](_0x5ab558);}return _0xd5886c['save']();};}function saveUpdates(_0x25fa75,_0x52c7c9){return function(_0x1b065e){if(_0x1b065e){return _0x1b065e[_0xbc1d('0x1e')](_0x25fa75)['then'](function(_0x1951a1){return _0x1951a1;});}return null;};}function removeEntity(_0x1890c0,_0x3955ab){return function(_0x4a0579){if(_0x4a0579){return _0x4a0579['destroy']()[_0xbc1d('0x1f')](function(){_0x1890c0['status'](0xcc)[_0xbc1d('0x20')]();});}};}function handleEntityNotFound(_0x13ce62,_0x59fd2e){return function(_0x4d959a){if(!_0x4d959a){_0x13ce62[_0xbc1d('0x15')](0x194);}return _0x4d959a;};}function handleError(_0x970e66,_0x5896d1){_0x5896d1=_0x5896d1||0x1f4;return function(_0x7b37c3){logger[_0xbc1d('0x21')](_0x7b37c3[_0xbc1d('0x22')]);if(_0x7b37c3[_0xbc1d('0x23')]){delete _0x7b37c3[_0xbc1d('0x23')];}_0x970e66[_0xbc1d('0x16')](_0x5896d1)[_0xbc1d('0x24')](_0x7b37c3);};}exports['index']=function(_0x363afd,_0x5e97e3){var _0x584fa5={},_0x40d1e2={},_0x420f28={'count':0x0,'rows':[]};var _0x238a4d=_[_0xbc1d('0x25')](db['ChatQueueReport'][_0xbc1d('0x26')],function(_0x292504){return{'name':_0x292504[_0xbc1d('0x27')],'type':_0x292504[_0xbc1d('0x28')][_0xbc1d('0x29')]};});_0x40d1e2[_0xbc1d('0x2a')]=_[_0xbc1d('0x25')](_0x238a4d,_0xbc1d('0x23'));_0x40d1e2[_0xbc1d('0x2b')]=_[_0xbc1d('0x2c')](_0x363afd[_0xbc1d('0x2b')]);_0x40d1e2[_0xbc1d('0x2d')]=_[_0xbc1d('0x2e')](_0x40d1e2['model'],_0x40d1e2[_0xbc1d('0x2b')]);_0x584fa5[_0xbc1d('0x2f')]=_[_0xbc1d('0x2e')](_0x40d1e2[_0xbc1d('0x2a')],qs[_0xbc1d('0x30')](_0x363afd[_0xbc1d('0x2b')]['fields']));_0x584fa5[_0xbc1d('0x2f')]=_0x584fa5[_0xbc1d('0x2f')][_0xbc1d('0x31')]?_0x584fa5['attributes']:_0x40d1e2[_0xbc1d('0x2a')];if(!_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x32')]('nolimit')){_0x584fa5[_0xbc1d('0x1a')]=qs[_0xbc1d('0x1a')](_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x1a')]);_0x584fa5['offset']=qs['offset'](_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x17')]);}_0x584fa5[_0xbc1d('0x33')]=qs['sort'](_0x363afd['query']['sort']);_0x584fa5['where']=qs[_0xbc1d('0x2d')](_[_0xbc1d('0x34')](_0x363afd[_0xbc1d('0x2b')],_0x40d1e2[_0xbc1d('0x2d')]),_0x238a4d);if(_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x35')]){_0x584fa5['where']=_[_0xbc1d('0x36')](_0x584fa5['where'],{'$or':_[_0xbc1d('0x25')](_0x238a4d,function(_0x560a7c){if(_0x560a7c[_0xbc1d('0x28')]!==_0xbc1d('0x37')){var _0xddc19b={};_0xddc19b[_0x560a7c['name']]={'$like':'%'+_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x35')]+'%'};return _0xddc19b;}})});}_0x584fa5=_[_0xbc1d('0x36')]({},_0x584fa5,_0x363afd[_0xbc1d('0x38')]);var _0x512a88={'where':_0x584fa5[_0xbc1d('0x39')]};return db[_0xbc1d('0x3a')][_0xbc1d('0x19')](_0x512a88)[_0xbc1d('0x1f')](function(_0x107e00){_0x420f28[_0xbc1d('0x19')]=_0x107e00;if(_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x3b')]){_0x584fa5['include']=[{'all':!![]}];}return db[_0xbc1d('0x3a')][_0xbc1d('0x3c')](_0x584fa5);})['then'](function(_0xbf378){_0x420f28[_0xbc1d('0x3d')]=_0xbf378;return _0x420f28;})['then'](respondWithFilteredResult(_0x5e97e3,_0x584fa5))['catch'](handleError(_0x5e97e3,null));};exports[_0xbc1d('0x3e')]=function(_0x371f25,_0x3e09f9){var _0x4a9006={'raw':!![],'where':{'id':_0x371f25[_0xbc1d('0x3f')]['id']}},_0x2475cb={};_0x2475cb[_0xbc1d('0x2a')]=_[_0xbc1d('0x2c')](db['ChatQueueReport'][_0xbc1d('0x26')]);_0x2475cb['query']=_[_0xbc1d('0x2c')](_0x371f25[_0xbc1d('0x2b')]);_0x2475cb['filters']=_[_0xbc1d('0x2e')](_0x2475cb[_0xbc1d('0x2a')],_0x2475cb[_0xbc1d('0x2b')]);_0x4a9006[_0xbc1d('0x2f')]=_['intersection'](_0x2475cb[_0xbc1d('0x2a')],qs['fields'](_0x371f25[_0xbc1d('0x2b')]['fields']));_0x4a9006[_0xbc1d('0x2f')]=_0x4a9006['attributes'][_0xbc1d('0x31')]?_0x4a9006[_0xbc1d('0x2f')]:_0x2475cb[_0xbc1d('0x2a')];if(_0x371f25[_0xbc1d('0x2b')][_0xbc1d('0x3b')]){_0x4a9006['include']=[{'all':!![]}];}_0x4a9006=_[_0xbc1d('0x36')]({},_0x4a9006,_0x371f25['options']);return db['ChatQueueReport'][_0xbc1d('0x40')](_0x4a9006)[_0xbc1d('0x1f')](handleEntityNotFound(_0x3e09f9,null))[_0xbc1d('0x1f')](respondWithResult(_0x3e09f9,null))[_0xbc1d('0x41')](handleError(_0x3e09f9,null));};exports[_0xbc1d('0x42')]=function(_0x567be6,_0x5be3d4){return db[_0xbc1d('0x3a')][_0xbc1d('0x42')](_0x567be6['body'],{})[_0xbc1d('0x1f')](respondWithResult(_0x5be3d4,0xc9))[_0xbc1d('0x41')](handleError(_0x5be3d4,null));};exports[_0xbc1d('0x1e')]=function(_0x1238b3,_0x3b0472){if(_0x1238b3[_0xbc1d('0x43')]['id']){delete _0x1238b3[_0xbc1d('0x43')]['id'];}return db[_0xbc1d('0x3a')][_0xbc1d('0x40')]({'where':{'id':_0x1238b3[_0xbc1d('0x3f')]['id']}})[_0xbc1d('0x1f')](handleEntityNotFound(_0x3b0472,null))[_0xbc1d('0x1f')](saveUpdates(_0x1238b3[_0xbc1d('0x43')],null))[_0xbc1d('0x1f')](respondWithResult(_0x3b0472,null))[_0xbc1d('0x41')](handleError(_0x3b0472,null));};exports[_0xbc1d('0x44')]=function(_0x413918,_0xfcd402){return db['ChatQueueReport'][_0xbc1d('0x40')]({'where':{'id':_0x413918[_0xbc1d('0x3f')]['id']}})[_0xbc1d('0x1f')](handleEntityNotFound(_0xfcd402,null))[_0xbc1d('0x1f')](removeEntity(_0xfcd402,null))[_0xbc1d('0x41')](handleError(_0xfcd402,null));};exports[_0xbc1d('0x45')]=function(_0x3114bb,_0x54448f){return db['ChatQueueReport'][_0xbc1d('0x45')]()[_0xbc1d('0x1f')](respondWithResult(_0x54448f,null))[_0xbc1d('0x41')](handleError(_0x54448f,null));};
\ No newline at end of file
index 6d929b4..7e63202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3fc75a,_0x1a125c){var _0x1d3083=function(_0x27ee51){while(--_0x27ee51){_0x3fc75a['push'](_0x3fc75a['shift']());}};_0x1d3083(++_0x1a125c);}(_0xe706,0xa3));var _0x6e70=function(_0xeea5ca,_0x2d569b){_0xeea5ca=_0xeea5ca-0x0;var _0x1fdf07=_0xe706[_0xeea5ca];return _0x1fdf07;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5acedb,_0x4c5967){var _0x283f72=function(_0x446861){while(--_0x446861){_0x5acedb['push'](_0x5acedb['shift']());}};_0x283f72(++_0x4c5967);}(_0x757a,0xde));var _0xa757=function(_0x5320bf,_0x70099a){_0x5320bf=_0x5320bf-0x0;var _0x246709=_0x757a[_0x5320bf];return _0x246709;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 4c66757..d044821 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cd5=['../../config/logger','rpc','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','limit','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4a4cc8,_0x5606d7){var _0x9854bb=function(_0x1fa78b){while(--_0x1fa78b){_0x4a4cc8['push'](_0x4a4cc8['shift']());}};_0x9854bb(++_0x5606d7);}(_0x2cd5,0x9b));var _0x52cd=function(_0x4dd90d,_0x567ac7){_0x4dd90d=_0x4dd90d-0x0;var _0x13eedb=_0x2cd5[_0x4dd90d];return _0x13eedb;};'use strict';var _=require('lodash');var util=require(_0x52cd('0x0'));var moment=require('moment');var BPromise=require(_0x52cd('0x1'));var rs=require(_0x52cd('0x2'));var fs=require('fs');var Redis=require(_0x52cd('0x3'));var db=require(_0x52cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x52cd('0x5'))(_0x52cd('0x6'));var config=require(_0x52cd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x52cd('0x8')][_0x52cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47d0a5,_0x271320,_0x1a8307){return new BPromise(function(_0x18f775,_0x20b8c9){return client[_0x52cd('0xa')](_0x47d0a5,_0x1a8307)[_0x52cd('0xb')](function(_0x1393fd){logger['info'](_0x52cd('0xc'),_0x271320,_0x52cd('0xd'));logger[_0x52cd('0xe')](_0x52cd('0xf'),_0x271320,_0x52cd('0xd'),JSON['stringify'](_0x1393fd));if(_0x1393fd[_0x52cd('0x10')]){if(_0x1393fd[_0x52cd('0x10')][_0x52cd('0x11')]===0x1f4){logger[_0x52cd('0x10')](_0x52cd('0xc'),_0x271320,_0x1393fd[_0x52cd('0x10')][_0x52cd('0x12')]);return _0x20b8c9(_0x1393fd[_0x52cd('0x10')][_0x52cd('0x12')]);}logger[_0x52cd('0x10')](_0x52cd('0xc'),_0x271320,_0x1393fd[_0x52cd('0x10')]['message']);return _0x18f775(_0x1393fd[_0x52cd('0x10')][_0x52cd('0x12')]);}else{logger[_0x52cd('0x13')](_0x52cd('0xc'),_0x271320,_0x52cd('0xd'));_0x18f775(_0x1393fd['result'][_0x52cd('0x12')]);}})['catch'](function(_0x32ce48){logger['error'](_0x52cd('0xc'),_0x271320,_0x32ce48);_0x20b8c9(_0x32ce48);});});}exports[_0x52cd('0x14')]=function(_0x11804a){var _0x2155bd=this;return new Promise(function(_0x2f18e0,_0x2a4edd){return db[_0x52cd('0x15')][_0x52cd('0x16')](_0x11804a[_0x52cd('0x17')],{'raw':_0x11804a['options']?_0x11804a[_0x52cd('0x18')][_0x52cd('0x19')]===undefined?!![]:![]:!![]})[_0x52cd('0xb')](function(_0x4f32a4){logger[_0x52cd('0x13')]('CreateChatQueueReport',_0x11804a);logger[_0x52cd('0xe')](_0x52cd('0x14'),_0x11804a,JSON[_0x52cd('0x1a')](_0x4f32a4));_0x2f18e0(_0x4f32a4);})[_0x52cd('0x1b')](function(_0x4b445e){logger[_0x52cd('0x10')](_0x52cd('0x14'),_0x4b445e[_0x52cd('0x12')],_0x11804a);_0x2a4edd(_0x2155bd[_0x52cd('0x10')](0x1f4,_0x4b445e[_0x52cd('0x12')]));});});};exports[_0x52cd('0x1c')]=function(_0x554d44){var _0x3cad12=this;return new Promise(function(_0x151701,_0x5530e9){return db[_0x52cd('0x15')][_0x52cd('0x1d')](_0x554d44[_0x52cd('0x17')],{'raw':_0x554d44[_0x52cd('0x18')]?_0x554d44['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x554d44['options']?_0x554d44[_0x52cd('0x18')][_0x52cd('0x1e')]||null:null,'attributes':_0x554d44[_0x52cd('0x18')]?_0x554d44[_0x52cd('0x18')]['attributes']||null:null,'limit':_0x554d44[_0x52cd('0x18')]?_0x554d44[_0x52cd('0x18')][_0x52cd('0x1f')]||null:null})[_0x52cd('0xb')](function(_0x1e4088){logger[_0x52cd('0x13')]('UpdateChatQueueReport',_0x554d44);logger[_0x52cd('0xe')](_0x52cd('0x1c'),_0x554d44,JSON[_0x52cd('0x1a')](_0x1e4088));_0x151701(_0x1e4088);})['catch'](function(_0x523706){logger[_0x52cd('0x10')](_0x52cd('0x1c'),_0x523706[_0x52cd('0x12')],_0x554d44);_0x5530e9(_0x3cad12[_0x52cd('0x10')](0x1f4,_0x523706['message']));});});};
\ No newline at end of file
+var _0x152f=['stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x214ef4,_0x4a62c0){var _0x3b1112=function(_0x28eec9){while(--_0x28eec9){_0x214ef4['push'](_0x214ef4['shift']());}};_0x3b1112(++_0x4a62c0);}(_0x152f,0x144));var _0xf152=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x152f[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0xf152('0x0'));var util=require(_0xf152('0x1'));var moment=require(_0xf152('0x2'));var BPromise=require(_0xf152('0x3'));var rs=require(_0xf152('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf152('0x5'))['db'];var utils=require(_0xf152('0x6'));var logger=require(_0xf152('0x7'))(_0xf152('0x8'));var config=require('../../config/environment');var jayson=require(_0xf152('0x9'));var client=jayson['client'][_0xf152('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504fb6,_0x36498a,_0x5ec158){return new BPromise(function(_0x5206b3,_0x3190e3){return client[_0xf152('0xb')](_0x504fb6,_0x5ec158)['then'](function(_0x133f44){logger[_0xf152('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x36498a,_0xf152('0xd'));logger[_0xf152('0xe')](_0xf152('0xf'),_0x36498a,_0xf152('0xd'),JSON[_0xf152('0x10')](_0x133f44));if(_0x133f44[_0xf152('0x11')]){if(_0x133f44[_0xf152('0x11')][_0xf152('0x12')]===0x1f4){logger[_0xf152('0x11')](_0xf152('0x13'),_0x36498a,_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);return _0x3190e3(_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);}logger['error'](_0xf152('0x13'),_0x36498a,_0x133f44[_0xf152('0x11')]['message']);return _0x5206b3(_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);}else{logger[_0xf152('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x36498a,_0xf152('0xd'));_0x5206b3(_0x133f44[_0xf152('0x15')]['message']);}})[_0xf152('0x16')](function(_0x29bad9){logger[_0xf152('0x11')](_0xf152('0x13'),_0x36498a,_0x29bad9);_0x3190e3(_0x29bad9);});});}exports['CreateChatQueueReport']=function(_0x3d732e){var _0x5872d9=this;return new Promise(function(_0x18bd0f,_0x58ef45){return db[_0xf152('0x17')][_0xf152('0x18')](_0x3d732e[_0xf152('0x19')],{'raw':_0x3d732e[_0xf152('0x1a')]?_0x3d732e[_0xf152('0x1a')][_0xf152('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2488a6){logger[_0xf152('0xc')](_0xf152('0x1c'),_0x3d732e);logger['debug'](_0xf152('0x1c'),_0x3d732e,JSON[_0xf152('0x10')](_0x2488a6));_0x18bd0f(_0x2488a6);})[_0xf152('0x16')](function(_0x35442a){logger[_0xf152('0x11')](_0xf152('0x1c'),_0x35442a['message'],_0x3d732e);_0x58ef45(_0x5872d9['error'](0x1f4,_0x35442a[_0xf152('0x14')]));});});};exports[_0xf152('0x1d')]=function(_0x201fcb){var _0x363379=this;return new Promise(function(_0x4f53d2,_0x36d624){return db[_0xf152('0x17')][_0xf152('0x1e')](_0x201fcb['body'],{'raw':_0x201fcb[_0xf152('0x1a')]?_0x201fcb[_0xf152('0x1a')][_0xf152('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201fcb['options']?_0x201fcb[_0xf152('0x1a')][_0xf152('0x1f')]||null:null,'attributes':_0x201fcb[_0xf152('0x1a')]?_0x201fcb[_0xf152('0x1a')][_0xf152('0x20')]||null:null,'limit':_0x201fcb[_0xf152('0x1a')]?_0x201fcb[_0xf152('0x1a')][_0xf152('0x21')]||null:null})['then'](function(_0x340d61){logger['info'](_0xf152('0x1d'),_0x201fcb);logger['debug'](_0xf152('0x1d'),_0x201fcb,JSON[_0xf152('0x10')](_0x340d61));_0x4f53d2(_0x340d61);})[_0xf152('0x16')](function(_0x2bdf10){logger[_0xf152('0x11')](_0xf152('0x1d'),_0x2bdf10[_0xf152('0x14')],_0x201fcb);_0x36d624(_0x363379['error'](0x1f4,_0x2bdf10[_0xf152('0x14')]));});});};
\ No newline at end of file
index a6a3441..2a0411d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc202=['express','Router','fs-extra','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xc202,0xd4));var _0x2c20=function(_0x155f27,_0x164989){_0x155f27=_0x155f27-0x0;var _0x48b237=_0xc202[_0x155f27];return _0x48b237;};'use strict';var multer=require(_0x2c20('0x0'));var util=require(_0x2c20('0x1'));var path=require(_0x2c20('0x2'));var timeout=require(_0x2c20('0x3'));var express=require(_0x2c20('0x4'));var router=express[_0x2c20('0x5')]();var fs_extra=require(_0x2c20('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c20('0x7'));router['get']('/',auth[_0x2c20('0x8')](),controller[_0x2c20('0x9')]);router[_0x2c20('0xa')](_0x2c20('0xb'),auth[_0x2c20('0x8')](),controller['describe']);router['get'](_0x2c20('0xc'),auth['isAuthenticated'](),controller[_0x2c20('0xd')]);router[_0x2c20('0xe')]('/',auth[_0x2c20('0x8')](),controller[_0x2c20('0xf')]);router['put']('/:id',auth[_0x2c20('0x8')](),controller['update']);router[_0x2c20('0x10')](_0x2c20('0xc'),auth[_0x2c20('0x8')](),controller[_0x2c20('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7dad=['show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x287ba8,_0x45608b){var _0x308ab1=function(_0x8024bf){while(--_0x8024bf){_0x287ba8['push'](_0x287ba8['shift']());}};_0x308ab1(++_0x45608b);}(_0x7dad,0x16b));var _0xd7da=function(_0x95a4d8,_0x3c555e){_0x95a4d8=_0x95a4d8-0x0;var _0x20f078=_0x7dad[_0x95a4d8];return _0x20f078;};'use strict';var multer=require(_0xd7da('0x0'));var util=require(_0xd7da('0x1'));var path=require(_0xd7da('0x2'));var timeout=require(_0xd7da('0x3'));var express=require(_0xd7da('0x4'));var router=express[_0xd7da('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd7da('0x6'));var interaction=require(_0xd7da('0x7'));var config=require('../../config/environment');var controller=require(_0xd7da('0x8'));router['get']('/',auth[_0xd7da('0x9')](),controller[_0xd7da('0xa')]);router[_0xd7da('0xb')](_0xd7da('0xc'),auth[_0xd7da('0x9')](),controller[_0xd7da('0xd')]);router[_0xd7da('0xb')](_0xd7da('0xe'),auth[_0xd7da('0x9')](),controller[_0xd7da('0xf')]);router[_0xd7da('0x10')]('/',auth[_0xd7da('0x9')](),controller['create']);router[_0xd7da('0x11')](_0xd7da('0xe'),auth[_0xd7da('0x9')](),controller[_0xd7da('0x12')]);router[_0xd7da('0x13')](_0xd7da('0xe'),auth[_0xd7da('0x9')](),controller[_0xd7da('0x14')]);module['exports']=router;
\ No newline at end of file
index c063153..88886bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x466316,_0x46d342){var _0xcfa4a1=function(_0x1c621f){while(--_0x1c621f){_0x466316['push'](_0x466316['shift']());}};_0xcfa4a1(++_0x46d342);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x4b84[_0x2b8077];return _0x308091;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x25fb78,_0xea1a5f){var _0x91fe44=function(_0x52f357){while(--_0x52f357){_0x25fb78['push'](_0x25fb78['shift']());}};_0x91fe44(++_0xea1a5f);}(_0x70e0,0x17b));var _0x070e=function(_0x4a3172,_0x542ff7){_0x4a3172=_0x4a3172-0x0;var _0x1fd35f=_0x70e0[_0x4a3172];return _0x1fd35f;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index e98ec32..6b64f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b2b=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','Content-Range','apply','then','destroy','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','filters','filter','merge','where','VIRTUAL','options','count','findAll','rows','catch','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x237a57,_0x271db9){var _0xc8643f=function(_0x19b089){while(--_0x19b089){_0x237a57['push'](_0x237a57['shift']());}};_0xc8643f(++_0x271db9);}(_0x5b2b,0x17f));var _0xb5b2=function(_0x489168,_0x6c5f3b){_0x489168=_0x489168-0x0;var _0x189c0c=_0x5b2b[_0x489168];return _0x189c0c;};'use strict';var emlformat=require(_0xb5b2('0x0'));var rimraf=require(_0xb5b2('0x1'));var zipdir=require(_0xb5b2('0x2'));var jsonpatch=require(_0xb5b2('0x3'));var rp=require(_0xb5b2('0x4'));var moment=require(_0xb5b2('0x5'));var BPromise=require(_0xb5b2('0x6'));var Mustache=require('mustache');var util=require(_0xb5b2('0x7'));var path=require(_0xb5b2('0x8'));var sox=require(_0xb5b2('0x9'));var csv=require('to-csv');var ejs=require(_0xb5b2('0xa'));var fs=require('fs');var fs_extra=require(_0xb5b2('0xb'));var _=require(_0xb5b2('0xc'));var squel=require(_0xb5b2('0xd'));var crypto=require(_0xb5b2('0xe'));var jsforce=require(_0xb5b2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5b2('0x10'));var Papa=require(_0xb5b2('0x11'));var Redis=require(_0xb5b2('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5b2('0x13'))(_0xb5b2('0x14'));var utils=require(_0xb5b2('0x15'));var config=require(_0xb5b2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26fa32,_0x40bf4e){_0x40bf4e=_0x40bf4e||0xcc;return function(_0x2661b8){if(_0x2661b8){return _0x26fa32[_0xb5b2('0x17')](_0x40bf4e);}return _0x26fa32['status'](_0x40bf4e)[_0xb5b2('0x18')]();};}function respondWithResult(_0x10843f,_0x37cbf4){_0x37cbf4=_0x37cbf4||0xc8;return function(_0x5517aa){if(_0x5517aa){return _0x10843f[_0xb5b2('0x19')](_0x37cbf4)['json'](_0x5517aa);}};}function respondWithFilteredResult(_0xfc1587,_0x327cd9){return function(_0x3a32ee){if(_0x3a32ee){var _0xa11b29=typeof _0x327cd9[_0xb5b2('0x1a')]===_0xb5b2('0x1b')&&typeof _0x327cd9[_0xb5b2('0x1c')]===_0xb5b2('0x1b');var _0x27f58c=_0x3a32ee['count'];var _0x929059=_0xa11b29?0x0:_0x327cd9['offset'];var _0x7f7063=_0xa11b29?_0x3a32ee['count']:_0x327cd9[_0xb5b2('0x1a')]+_0x327cd9[_0xb5b2('0x1c')];var _0x4b8e5e;if(_0x7f7063>=_0x27f58c){_0x7f7063=_0x27f58c;_0x4b8e5e=0xc8;}else{_0x4b8e5e=0xce;}_0xfc1587[_0xb5b2('0x19')](_0x4b8e5e);return _0xfc1587['set'](_0xb5b2('0x1d'),_0x929059+'-'+_0x7f7063+'/'+_0x27f58c)['json'](_0x3a32ee);}return null;};}function patchUpdates(_0x46cebc){return function(_0x593303){try{jsonpatch[_0xb5b2('0x1e')](_0x593303,_0x46cebc,!![]);}catch(_0x2acf50){return BPromise['reject'](_0x2acf50);}return _0x593303['save']();};}function saveUpdates(_0xdf12db,_0x2966f7){return function(_0xa3182f){if(_0xa3182f){return _0xa3182f['update'](_0xdf12db)[_0xb5b2('0x1f')](function(_0x11fb45){return _0x11fb45;});}return null;};}function removeEntity(_0x24580f,_0x2903c2){return function(_0x14ca35){if(_0x14ca35){return _0x14ca35[_0xb5b2('0x20')]()[_0xb5b2('0x1f')](function(){_0x24580f[_0xb5b2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x346a58,_0x3fc8c7){return function(_0x2157f8){if(!_0x2157f8){_0x346a58[_0xb5b2('0x17')](0x194);}return _0x2157f8;};}function handleError(_0x530e1d,_0x56c228){_0x56c228=_0x56c228||0x1f4;return function(_0x4901a2){logger['error'](_0x4901a2['stack']);if(_0x4901a2[_0xb5b2('0x21')]){delete _0x4901a2[_0xb5b2('0x21')];}_0x530e1d[_0xb5b2('0x19')](_0x56c228)[_0xb5b2('0x22')](_0x4901a2);};}exports['index']=function(_0x3444cf,_0xdc38e6){var _0x321a14={},_0x318a57={},_0x4687b3={'count':0x0,'rows':[]};var _0x5f0345=_[_0xb5b2('0x23')](db[_0xb5b2('0x24')][_0xb5b2('0x25')],function(_0x224ba1){return{'name':_0x224ba1[_0xb5b2('0x26')],'type':_0x224ba1[_0xb5b2('0x27')][_0xb5b2('0x28')]};});_0x318a57['model']=_[_0xb5b2('0x23')](_0x5f0345,_0xb5b2('0x21'));_0x318a57[_0xb5b2('0x29')]=_[_0xb5b2('0x2a')](_0x3444cf[_0xb5b2('0x29')]);_0x318a57['filters']=_[_0xb5b2('0x2b')](_0x318a57[_0xb5b2('0x2c')],_0x318a57[_0xb5b2('0x29')]);_0x321a14[_0xb5b2('0x2d')]=_[_0xb5b2('0x2b')](_0x318a57[_0xb5b2('0x2c')],qs[_0xb5b2('0x2e')](_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x2e')]));_0x321a14['attributes']=_0x321a14[_0xb5b2('0x2d')][_0xb5b2('0x2f')]?_0x321a14[_0xb5b2('0x2d')]:_0x318a57[_0xb5b2('0x2c')];if(!_0x3444cf['query']['hasOwnProperty']('nolimit')){_0x321a14[_0xb5b2('0x1c')]=qs['limit'](_0x3444cf['query'][_0xb5b2('0x1c')]);_0x321a14[_0xb5b2('0x1a')]=qs['offset'](_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x1a')]);}_0x321a14[_0xb5b2('0x30')]=qs[_0xb5b2('0x31')](_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x31')]);_0x321a14['where']=qs[_0xb5b2('0x32')](_['pick'](_0x3444cf[_0xb5b2('0x29')],_0x318a57['filters']),_0x5f0345);if(_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x33')]){_0x321a14['where']=_[_0xb5b2('0x34')](_0x321a14[_0xb5b2('0x35')],{'$or':_[_0xb5b2('0x23')](_0x5f0345,function(_0x35681f){if(_0x35681f[_0xb5b2('0x27')]!==_0xb5b2('0x36')){var _0x6e0e66={};_0x6e0e66[_0x35681f[_0xb5b2('0x21')]]={'$like':'%'+_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x33')]+'%'};return _0x6e0e66;}})});}_0x321a14=_['merge']({},_0x321a14,_0x3444cf[_0xb5b2('0x37')]);var _0x35775f={'where':_0x321a14[_0xb5b2('0x35')]};return db[_0xb5b2('0x24')][_0xb5b2('0x38')](_0x35775f)[_0xb5b2('0x1f')](function(_0x44a432){_0x4687b3[_0xb5b2('0x38')]=_0x44a432;if(_0x3444cf[_0xb5b2('0x29')]['includeAll']){_0x321a14['include']=[{'all':!![]}];}return db[_0xb5b2('0x24')][_0xb5b2('0x39')](_0x321a14);})['then'](function(_0x10348d){_0x4687b3[_0xb5b2('0x3a')]=_0x10348d;return _0x4687b3;})[_0xb5b2('0x1f')](respondWithFilteredResult(_0xdc38e6,_0x321a14))[_0xb5b2('0x3b')](handleError(_0xdc38e6,null));};exports['show']=function(_0x2ea99f,_0x3fe20d){var _0x323fb3={'raw':!![],'where':{'id':_0x2ea99f[_0xb5b2('0x3c')]['id']}},_0x58a65a={};_0x58a65a['model']=_[_0xb5b2('0x2a')](db[_0xb5b2('0x24')][_0xb5b2('0x25')]);_0x58a65a['query']=_['keys'](_0x2ea99f[_0xb5b2('0x29')]);_0x58a65a[_0xb5b2('0x32')]=_[_0xb5b2('0x2b')](_0x58a65a[_0xb5b2('0x2c')],_0x58a65a['query']);_0x323fb3[_0xb5b2('0x2d')]=_[_0xb5b2('0x2b')](_0x58a65a[_0xb5b2('0x2c')],qs[_0xb5b2('0x2e')](_0x2ea99f['query']['fields']));_0x323fb3[_0xb5b2('0x2d')]=_0x323fb3[_0xb5b2('0x2d')]['length']?_0x323fb3[_0xb5b2('0x2d')]:_0x58a65a[_0xb5b2('0x2c')];if(_0x2ea99f[_0xb5b2('0x29')][_0xb5b2('0x3d')]){_0x323fb3[_0xb5b2('0x3e')]=[{'all':!![]}];}_0x323fb3=_[_0xb5b2('0x34')]({},_0x323fb3,_0x2ea99f[_0xb5b2('0x37')]);return db['ChatTransferReport'][_0xb5b2('0x3f')](_0x323fb3)[_0xb5b2('0x1f')](handleEntityNotFound(_0x3fe20d,null))[_0xb5b2('0x1f')](respondWithResult(_0x3fe20d,null))['catch'](handleError(_0x3fe20d,null));};exports[_0xb5b2('0x40')]=function(_0x3d58fc,_0x26c54b){return db[_0xb5b2('0x24')][_0xb5b2('0x40')](_0x3d58fc['body'],{})[_0xb5b2('0x1f')](respondWithResult(_0x26c54b,0xc9))[_0xb5b2('0x3b')](handleError(_0x26c54b,null));};exports['update']=function(_0x3aca18,_0x572046){if(_0x3aca18['body']['id']){delete _0x3aca18[_0xb5b2('0x41')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x3aca18[_0xb5b2('0x3c')]['id']}})['then'](handleEntityNotFound(_0x572046,null))[_0xb5b2('0x1f')](saveUpdates(_0x3aca18['body'],null))['then'](respondWithResult(_0x572046,null))['catch'](handleError(_0x572046,null));};exports[_0xb5b2('0x20')]=function(_0x5619cc,_0xfe04cc){return db['ChatTransferReport'][_0xb5b2('0x3f')]({'where':{'id':_0x5619cc[_0xb5b2('0x3c')]['id']}})['then'](handleEntityNotFound(_0xfe04cc,null))[_0xb5b2('0x1f')](removeEntity(_0xfe04cc,null))[_0xb5b2('0x3b')](handleError(_0xfe04cc,null));};exports[_0xb5b2('0x42')]=function(_0x4baaf3,_0x55359c){return db[_0xb5b2('0x24')][_0xb5b2('0x42')]()[_0xb5b2('0x1f')](respondWithResult(_0x55359c,null))[_0xb5b2('0x3b')](handleError(_0x55359c,null));};
\ No newline at end of file
+var _0xcd03=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','type','filter','includeAll','include','rows','show','params','length','find','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit'];(function(_0x93be8f,_0x597b00){var _0x5a990a=function(_0x12877a){while(--_0x12877a){_0x93be8f['push'](_0x93be8f['shift']());}};_0x5a990a(++_0x597b00);}(_0xcd03,0x14f));var _0x3cd0=function(_0x3175fd,_0x58119f){_0x3175fd=_0x3175fd-0x0;var _0x53e28b=_0xcd03[_0x3175fd];return _0x53e28b;};'use strict';var emlformat=require(_0x3cd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3cd0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3cd0('0x2'));var moment=require(_0x3cd0('0x3'));var BPromise=require(_0x3cd0('0x4'));var Mustache=require(_0x3cd0('0x5'));var util=require(_0x3cd0('0x6'));var path=require('path');var sox=require(_0x3cd0('0x7'));var csv=require(_0x3cd0('0x8'));var ejs=require(_0x3cd0('0x9'));var fs=require('fs');var fs_extra=require(_0x3cd0('0xa'));var _=require(_0x3cd0('0xb'));var squel=require(_0x3cd0('0xc'));var crypto=require(_0x3cd0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3cd0('0xe'));var Papa=require(_0x3cd0('0xf'));var Redis=require(_0x3cd0('0x10'));var authService=require(_0x3cd0('0x11'));var qs=require(_0x3cd0('0x12'));var as=require(_0x3cd0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cd0('0x14'))('api');var utils=require(_0x3cd0('0x15'));var config=require(_0x3cd0('0x16'));var licenseUtil=require(_0x3cd0('0x17'));var db=require(_0x3cd0('0x18'))['db'];function respondWithStatusCode(_0x24dd2b,_0x41151f){_0x41151f=_0x41151f||0xcc;return function(_0xc90cc){if(_0xc90cc){return _0x24dd2b[_0x3cd0('0x19')](_0x41151f);}return _0x24dd2b[_0x3cd0('0x1a')](_0x41151f)['end']();};}function respondWithResult(_0x1d7ec9,_0x5c2f7a){_0x5c2f7a=_0x5c2f7a||0xc8;return function(_0xc4efeb){if(_0xc4efeb){return _0x1d7ec9['status'](_0x5c2f7a)[_0x3cd0('0x1b')](_0xc4efeb);}};}function respondWithFilteredResult(_0x5ee296,_0x39786d){return function(_0x247da3){if(_0x247da3){var _0x4faa81=typeof _0x39786d[_0x3cd0('0x1c')]==='undefined'&&typeof _0x39786d[_0x3cd0('0x1d')]===_0x3cd0('0x1e');var _0x1177c8=_0x247da3[_0x3cd0('0x1f')];var _0x3f6b70=_0x4faa81?0x0:_0x39786d[_0x3cd0('0x1c')];var _0x212aef=_0x4faa81?_0x247da3[_0x3cd0('0x1f')]:_0x39786d[_0x3cd0('0x1c')]+_0x39786d[_0x3cd0('0x1d')];var _0x436d65;if(_0x212aef>=_0x1177c8){_0x212aef=_0x1177c8;_0x436d65=0xc8;}else{_0x436d65=0xce;}_0x5ee296[_0x3cd0('0x1a')](_0x436d65);return _0x5ee296[_0x3cd0('0x20')](_0x3cd0('0x21'),_0x3f6b70+'-'+_0x212aef+'/'+_0x1177c8)[_0x3cd0('0x1b')](_0x247da3);}return null;};}function patchUpdates(_0x3e9d43){return function(_0x57b786){try{jsonpatch[_0x3cd0('0x22')](_0x57b786,_0x3e9d43,!![]);}catch(_0x595125){return BPromise[_0x3cd0('0x23')](_0x595125);}return _0x57b786[_0x3cd0('0x24')]();};}function saveUpdates(_0x129551,_0x4d10bc){return function(_0x43f485){if(_0x43f485){return _0x43f485[_0x3cd0('0x25')](_0x129551)[_0x3cd0('0x26')](function(_0x3a9bbe){return _0x3a9bbe;});}return null;};}function removeEntity(_0x1612a3,_0x248f90){return function(_0x19ceaf){if(_0x19ceaf){return _0x19ceaf[_0x3cd0('0x27')]()['then'](function(){_0x1612a3[_0x3cd0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x883e22,_0x50c300){return function(_0x7d493d){if(!_0x7d493d){_0x883e22[_0x3cd0('0x19')](0x194);}return _0x7d493d;};}function handleError(_0x53bceb,_0x24475a){_0x24475a=_0x24475a||0x1f4;return function(_0x989651){logger[_0x3cd0('0x28')](_0x989651[_0x3cd0('0x29')]);if(_0x989651[_0x3cd0('0x2a')]){delete _0x989651[_0x3cd0('0x2a')];}_0x53bceb[_0x3cd0('0x1a')](_0x24475a)[_0x3cd0('0x2b')](_0x989651);};}exports['index']=function(_0x537a62,_0x335196){var _0x375448={},_0x2904fa={},_0x897836={'count':0x0,'rows':[]};var _0x57c28c=_[_0x3cd0('0x2c')](db[_0x3cd0('0x2d')][_0x3cd0('0x2e')],function(_0x2fcefe){return{'name':_0x2fcefe['fieldName'],'type':_0x2fcefe['type'][_0x3cd0('0x2f')]};});_0x2904fa[_0x3cd0('0x30')]=_[_0x3cd0('0x2c')](_0x57c28c,_0x3cd0('0x2a'));_0x2904fa[_0x3cd0('0x31')]=_[_0x3cd0('0x32')](_0x537a62['query']);_0x2904fa[_0x3cd0('0x33')]=_['intersection'](_0x2904fa['model'],_0x2904fa[_0x3cd0('0x31')]);_0x375448[_0x3cd0('0x34')]=_[_0x3cd0('0x35')](_0x2904fa[_0x3cd0('0x30')],qs[_0x3cd0('0x36')](_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x36')]));_0x375448['attributes']=_0x375448[_0x3cd0('0x34')]['length']?_0x375448[_0x3cd0('0x34')]:_0x2904fa[_0x3cd0('0x30')];if(!_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x37')]('nolimit')){_0x375448[_0x3cd0('0x1d')]=qs[_0x3cd0('0x1d')](_0x537a62['query'][_0x3cd0('0x1d')]);_0x375448[_0x3cd0('0x1c')]=qs[_0x3cd0('0x1c')](_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x1c')]);}_0x375448[_0x3cd0('0x38')]=qs[_0x3cd0('0x39')](_0x537a62[_0x3cd0('0x31')]['sort']);_0x375448[_0x3cd0('0x3a')]=qs['filters'](_[_0x3cd0('0x3b')](_0x537a62[_0x3cd0('0x31')],_0x2904fa[_0x3cd0('0x33')]),_0x57c28c);if(_0x537a62['query']['filter']){_0x375448[_0x3cd0('0x3a')]=_[_0x3cd0('0x3c')](_0x375448[_0x3cd0('0x3a')],{'$or':_[_0x3cd0('0x2c')](_0x57c28c,function(_0x51bcc4){if(_0x51bcc4[_0x3cd0('0x3d')]!=='VIRTUAL'){var _0x42a572={};_0x42a572[_0x51bcc4[_0x3cd0('0x2a')]]={'$like':'%'+_0x537a62['query'][_0x3cd0('0x3e')]+'%'};return _0x42a572;}})});}_0x375448=_[_0x3cd0('0x3c')]({},_0x375448,_0x537a62['options']);var _0x4455ff={'where':_0x375448['where']};return db[_0x3cd0('0x2d')][_0x3cd0('0x1f')](_0x4455ff)[_0x3cd0('0x26')](function(_0x15c5fb){_0x897836[_0x3cd0('0x1f')]=_0x15c5fb;if(_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x3f')]){_0x375448[_0x3cd0('0x40')]=[{'all':!![]}];}return db[_0x3cd0('0x2d')]['findAll'](_0x375448);})[_0x3cd0('0x26')](function(_0x43dba6){_0x897836[_0x3cd0('0x41')]=_0x43dba6;return _0x897836;})[_0x3cd0('0x26')](respondWithFilteredResult(_0x335196,_0x375448))['catch'](handleError(_0x335196,null));};exports[_0x3cd0('0x42')]=function(_0x6cfe87,_0x5c4593){var _0x4aeeac={'raw':!![],'where':{'id':_0x6cfe87[_0x3cd0('0x43')]['id']}},_0x29b430={};_0x29b430[_0x3cd0('0x30')]=_['keys'](db[_0x3cd0('0x2d')][_0x3cd0('0x2e')]);_0x29b430[_0x3cd0('0x31')]=_[_0x3cd0('0x32')](_0x6cfe87[_0x3cd0('0x31')]);_0x29b430[_0x3cd0('0x33')]=_[_0x3cd0('0x35')](_0x29b430[_0x3cd0('0x30')],_0x29b430['query']);_0x4aeeac[_0x3cd0('0x34')]=_[_0x3cd0('0x35')](_0x29b430['model'],qs[_0x3cd0('0x36')](_0x6cfe87[_0x3cd0('0x31')]['fields']));_0x4aeeac[_0x3cd0('0x34')]=_0x4aeeac['attributes'][_0x3cd0('0x44')]?_0x4aeeac[_0x3cd0('0x34')]:_0x29b430[_0x3cd0('0x30')];if(_0x6cfe87['query'][_0x3cd0('0x3f')]){_0x4aeeac[_0x3cd0('0x40')]=[{'all':!![]}];}_0x4aeeac=_[_0x3cd0('0x3c')]({},_0x4aeeac,_0x6cfe87['options']);return db[_0x3cd0('0x2d')][_0x3cd0('0x45')](_0x4aeeac)[_0x3cd0('0x26')](handleEntityNotFound(_0x5c4593,null))[_0x3cd0('0x26')](respondWithResult(_0x5c4593,null))['catch'](handleError(_0x5c4593,null));};exports['create']=function(_0x5bf2d4,_0x2abf45){return db['ChatTransferReport']['create'](_0x5bf2d4[_0x3cd0('0x46')],{})[_0x3cd0('0x26')](respondWithResult(_0x2abf45,0xc9))[_0x3cd0('0x47')](handleError(_0x2abf45,null));};exports[_0x3cd0('0x25')]=function(_0x39cd9f,_0x3ea01e){if(_0x39cd9f['body']['id']){delete _0x39cd9f[_0x3cd0('0x46')]['id'];}return db['ChatTransferReport'][_0x3cd0('0x45')]({'where':{'id':_0x39cd9f[_0x3cd0('0x43')]['id']}})[_0x3cd0('0x26')](handleEntityNotFound(_0x3ea01e,null))[_0x3cd0('0x26')](saveUpdates(_0x39cd9f[_0x3cd0('0x46')],null))[_0x3cd0('0x26')](respondWithResult(_0x3ea01e,null))['catch'](handleError(_0x3ea01e,null));};exports[_0x3cd0('0x27')]=function(_0x31b213,_0x278e0a){return db['ChatTransferReport'][_0x3cd0('0x45')]({'where':{'id':_0x31b213[_0x3cd0('0x43')]['id']}})['then'](handleEntityNotFound(_0x278e0a,null))[_0x3cd0('0x26')](removeEntity(_0x278e0a,null))[_0x3cd0('0x47')](handleError(_0x278e0a,null));};exports[_0x3cd0('0x48')]=function(_0x11ecf4,_0x567cc7){return db[_0x3cd0('0x2d')][_0x3cd0('0x48')]()[_0x3cd0('0x26')](respondWithResult(_0x567cc7,null))['catch'](handleError(_0x567cc7,null));};
\ No newline at end of file
index c6b59f2..594a9a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbdd=['request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0xdbdd,0x1e9));var _0xddbd=function(_0x193f14,_0x176feb){_0x193f14=_0x193f14-0x0;var _0x5b5216=_0xdbdd[_0x193f14];return _0x5b5216;};'use strict';var _=require(_0xddbd('0x0'));var util=require(_0xddbd('0x1'));var logger=require(_0xddbd('0x2'))(_0xddbd('0x3'));var moment=require(_0xddbd('0x4'));var BPromise=require('bluebird');var rp=require(_0xddbd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddbd('0x6'));var config=require(_0xddbd('0x7'));var attributes=require(_0xddbd('0x8'));module[_0xddbd('0x9')]=function(_0x76a987,_0x392ee3){return _0x76a987[_0xddbd('0xa')](_0xddbd('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xddbd('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e8a=['path','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2d21c7,_0x19f6a8){var _0x592dad=function(_0x5d2d91){while(--_0x5d2d91){_0x2d21c7['push'](_0x2d21c7['shift']());}};_0x592dad(++_0x19f6a8);}(_0x8e8a,0x132));var _0xa8e8=function(_0x3ab66e,_0x2055d8){_0x3ab66e=_0x3ab66e-0x0;var _0x21449a=_0x8e8a[_0x3ab66e];return _0x21449a;};'use strict';var _=require(_0xa8e8('0x0'));var util=require('util');var logger=require(_0xa8e8('0x1'))(_0xa8e8('0x2'));var moment=require(_0xa8e8('0x3'));var BPromise=require(_0xa8e8('0x4'));var rp=require(_0xa8e8('0x5'));var fs=require('fs');var path=require(_0xa8e8('0x6'));var rimraf=require('rimraf');var config=require(_0xa8e8('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xa8e8('0x8')]=function(_0x44ac33,_0x133f1a){return _0x44ac33['define'](_0xa8e8('0x9'),attributes,{'tableName':_0xa8e8('0xa'),'paranoid':![],'indexes':[{'name':_0xa8e8('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index c7d59a4..561c964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a77=['debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','ChatTransferReport,\x20%s,\x20%s'];(function(_0x33bb07,_0x5b1849){var _0x481c81=function(_0x1709f0){while(--_0x1709f0){_0x33bb07['push'](_0x33bb07['shift']());}};_0x481c81(++_0x5b1849);}(_0x5a77,0xf8));var _0x75a7=function(_0xf038f8,_0x420f3b){_0xf038f8=_0xf038f8-0x0;var _0x417800=_0x5a77[_0xf038f8];return _0x417800;};'use strict';var _=require(_0x75a7('0x0'));var util=require(_0x75a7('0x1'));var moment=require(_0x75a7('0x2'));var BPromise=require(_0x75a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x75a7('0x5'));var logger=require(_0x75a7('0x6'))(_0x75a7('0x7'));var config=require(_0x75a7('0x8'));var jayson=require(_0x75a7('0x9'));var client=jayson[_0x75a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x531801,_0x35a8ce,_0x4eca6f){return new BPromise(function(_0x374bfa,_0x4854be){return client['request'](_0x531801,_0x4eca6f)['then'](function(_0x755a6b){logger['info'](_0x75a7('0xb'),_0x35a8ce,'request\x20sent');logger[_0x75a7('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x35a8ce,_0x75a7('0xd'),JSON[_0x75a7('0xe')](_0x755a6b));if(_0x755a6b[_0x75a7('0xf')]){if(_0x755a6b['error'][_0x75a7('0x10')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x35a8ce,_0x755a6b['error'][_0x75a7('0x11')]);return _0x4854be(_0x755a6b[_0x75a7('0xf')][_0x75a7('0x11')]);}logger['error'](_0x75a7('0xb'),_0x35a8ce,_0x755a6b[_0x75a7('0xf')][_0x75a7('0x11')]);return _0x374bfa(_0x755a6b[_0x75a7('0xf')][_0x75a7('0x11')]);}else{logger[_0x75a7('0x12')](_0x75a7('0xb'),_0x35a8ce,'request\x20sent');_0x374bfa(_0x755a6b[_0x75a7('0x13')]['message']);}})['catch'](function(_0xf3cb4a){logger['error'](_0x75a7('0xb'),_0x35a8ce,_0xf3cb4a);_0x4854be(_0xf3cb4a);});});}
\ No newline at end of file
+var _0xe88d=['message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3e6c64,_0x2793e5){var _0xafe208=function(_0x587888){while(--_0x587888){_0x3e6c64['push'](_0x3e6c64['shift']());}};_0xafe208(++_0x2793e5);}(_0xe88d,0x71));var _0xde88=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0xe88d[_0x22868f];return _0x97bc75;};'use strict';var _=require(_0xde88('0x0'));var util=require('util');var moment=require(_0xde88('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde88('0x2'));var db=require(_0xde88('0x3'))['db'];var utils=require(_0xde88('0x4'));var logger=require(_0xde88('0x5'))(_0xde88('0x6'));var config=require(_0xde88('0x7'));var jayson=require(_0xde88('0x8'));var client=jayson['client'][_0xde88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e89b9,_0x97418b,_0xd56793){return new BPromise(function(_0xc5d765,_0x4bc720){return client[_0xde88('0xa')](_0x1e89b9,_0xd56793)[_0xde88('0xb')](function(_0x5daa7a){logger[_0xde88('0xc')](_0xde88('0xd'),_0x97418b,'request\x20sent');logger[_0xde88('0xe')](_0xde88('0xf'),_0x97418b,_0xde88('0x10'),JSON[_0xde88('0x11')](_0x5daa7a));if(_0x5daa7a['error']){if(_0x5daa7a[_0xde88('0x12')]['code']===0x1f4){logger[_0xde88('0x12')](_0xde88('0xd'),_0x97418b,_0x5daa7a['error'][_0xde88('0x13')]);return _0x4bc720(_0x5daa7a[_0xde88('0x12')][_0xde88('0x13')]);}logger[_0xde88('0x12')](_0xde88('0xd'),_0x97418b,_0x5daa7a['error'][_0xde88('0x13')]);return _0xc5d765(_0x5daa7a[_0xde88('0x12')]['message']);}else{logger['info'](_0xde88('0xd'),_0x97418b,_0xde88('0x10'));_0xc5d765(_0x5daa7a[_0xde88('0x14')][_0xde88('0x13')]);}})[_0xde88('0x15')](function(_0x519af8){logger[_0xde88('0x12')](_0xde88('0xd'),_0x97418b,_0x519af8);_0x4bc720(_0x519af8);});});}
\ No newline at end of file
index 3a8a815..6e5b477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11a1=['../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','destroy','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c98bd,_0x176245){var _0x4b3190=function(_0x5c49e7){while(--_0x5c49e7){_0x2c98bd['push'](_0x2c98bd['shift']());}};_0x4b3190(++_0x176245);}(_0x11a1,0xf7));var _0x111a=function(_0x3c390d,_0x1cdc1b){_0x3c390d=_0x3c390d-0x0;var _0x101612=_0x11a1[_0x3c390d];return _0x101612;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x111a('0x0'));var timeout=require('connect-timeout');var express=require(_0x111a('0x1'));var router=express[_0x111a('0x2')]();var fs_extra=require(_0x111a('0x3'));var auth=require(_0x111a('0x4'));var interaction=require(_0x111a('0x5'));var config=require(_0x111a('0x6'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x111a('0x7')](),controller[_0x111a('0x8')]);router['get'](_0x111a('0x9'),auth[_0x111a('0x7')](),controller[_0x111a('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x111a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x111a('0xc')]);router[_0x111a('0xd')](_0x111a('0xe'),auth[_0x111a('0x7')](),controller[_0x111a('0xf')]);router['delete'](_0x111a('0xe'),auth[_0x111a('0x7')](),controller[_0x111a('0x10')]);module[_0x111a('0x11')]=router;
\ No newline at end of file
+var _0x9b48=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9b48,0x138));var _0x89b4=function(_0x47e260,_0x301d9e){_0x47e260=_0x47e260-0x0;var _0x4e28b9=_0x9b48[_0x47e260];return _0x4e28b9;};'use strict';var multer=require(_0x89b4('0x0'));var util=require(_0x89b4('0x1'));var path=require(_0x89b4('0x2'));var timeout=require(_0x89b4('0x3'));var express=require(_0x89b4('0x4'));var router=express[_0x89b4('0x5')]();var fs_extra=require(_0x89b4('0x6'));var auth=require(_0x89b4('0x7'));var interaction=require(_0x89b4('0x8'));var config=require(_0x89b4('0x9'));var controller=require(_0x89b4('0xa'));router[_0x89b4('0xb')]('/',auth[_0x89b4('0xc')](),controller[_0x89b4('0xd')]);router['get'](_0x89b4('0xe'),auth[_0x89b4('0xc')](),controller[_0x89b4('0xf')]);router[_0x89b4('0xb')](_0x89b4('0x10'),auth['isAuthenticated'](),controller[_0x89b4('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x89b4('0x12')]);router[_0x89b4('0x13')](_0x89b4('0x10'),auth[_0x89b4('0xc')](),controller[_0x89b4('0x14')]);router[_0x89b4('0x15')](_0x89b4('0x10'),auth[_0x89b4('0xc')](),controller['destroy']);module[_0x89b4('0x16')]=router;
\ No newline at end of file
index 31698e8..f81049e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8b6=['thumb','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback'];(function(_0x123985,_0x489296){var _0x176258=function(_0x192b10){while(--_0x192b10){_0x123985['push'](_0x123985['shift']());}};_0x176258(++_0x489296);}(_0xb8b6,0xa9));var _0x6b8b=function(_0x4bc217,_0x42f069){_0x4bc217=_0x4bc217-0x0;var _0x3e54d8=_0xb8b6[_0x4bc217];return _0x3e54d8;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x6b8b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![],'unique':_0x6b8b('0x2')},'description':{'type':Sequelize[_0x6b8b('0x1')]},'mapKey':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x3')},'mapKeyOffline':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x3')},'key':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x4')},'customerAlias':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b8b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![],'defaultValue':_0x6b8b('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b8b('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6b8b('0x9')](_0x6b8b('0xa'),_0x6b8b('0xb')),'defaultValue':_0x6b8b('0xa')},'header_online':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0xc')},'offline_chat_button':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0xd')},'header_offline':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6b8b('0xf')]},'closingQuestion':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x13')},'placeholderMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x14')},'closingMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x15')},'conditionAgreement':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x16')},'ratingType':{'type':Sequelize['ENUM']('star',_0x6b8b('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6b8b('0xf')],'defaultValue':function(){return JSON[_0x6b8b('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6b8b('0x19'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6b8b('0x1a'),'props':{'title':_0x6b8b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6b8b('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6b8b('0x1b')]('onlineForm')?JSON[_0x6b8b('0x1c')](this[_0x6b8b('0x1b')](_0x6b8b('0x1d'))):{};},'set':function(_0x4a399f){return this[_0x6b8b('0x1e')](_0x6b8b('0x1d'),JSON[_0x6b8b('0x18')](_0x4a399f));}},'offlineForm':{'type':Sequelize[_0x6b8b('0xf')],'defaultValue':function(){return JSON[_0x6b8b('0x18')]({'items':[{'type':'input','props':{'title':_0x6b8b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x6b8b('0x3'),'type':'email'},'variable':null},{'type':_0x6b8b('0x1f'),'config':{'placeholder':_0x6b8b('0x20')},'props':{'title':_0x6b8b('0x20'),'helpText':_0x6b8b('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6b8b('0x22'))?JSON[_0x6b8b('0x1c')](this['getDataValue']('offlineForm')):{};},'set':function(_0xb15d8b){return this['setDataValue'](_0x6b8b('0x22'),JSON[_0x6b8b('0x18')](_0xb15d8b));}},'token':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6b8b('0x1')]},'forwardOffline':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6b8b('0x1')]},'waitingTitle':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x23')},'waitingMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x24')},'offlineMessageBody':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6b8b('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6b8b('0x26');}},'notificationSound':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b8b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x28')},'verticalAlignment':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x29')},'defaultTitle':{'type':Sequelize[_0x6b8b('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b8b('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b8b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b8b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x2b')},'systemAvatar':{'type':Sequelize[_0x6b8b('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![],'comment':_0x6b8b('0x2c'),'set':function(_0xd3395e){if(!_0xd3395e)this[_0x6b8b('0x1e')](_0x6b8b('0x2d'),null);this[_0x6b8b('0x1e')](_0x6b8b('0x2e'),_0xd3395e);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6b8b('0x1')]},'vidaooTopic':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':function(){return _0x6b8b('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x6b8b('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6b8b('0xf')]}};
\ No newline at end of file
+var _0x2385=['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:','website_alias','alternate','System','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','stringify','name','input','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse'];(function(_0x38bda3,_0x572484){var _0x79b88c=function(_0x27d42d){while(--_0x27d42d){_0x38bda3['push'](_0x38bda3['shift']());}};_0x79b88c(++_0x572484);}(_0x2385,0x146));var _0x5238=function(_0x807ab6,_0x36977d){_0x807ab6=_0x807ab6-0x0;var _0x44abc1=_0x2385[_0x807ab6];return _0x44abc1;};'use strict';var Sequelize=require(_0x5238('0x0'));var rs=require('randomstring');module[_0x5238('0x1')]={'name':{'type':Sequelize[_0x5238('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'unique':_0x5238('0x3')},'description':{'type':Sequelize[_0x5238('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x5')},'customerAlias':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':_0x5238('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':_0x5238('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5238('0x2')]},'animation':{'type':Sequelize[_0x5238('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x5238('0xa'),'squared'),'defaultValue':_0x5238('0xa')},'header_online':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xb')},'offline_chat_button':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xc')},'header_offline':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x5238('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5238('0xf')]},'closingQuestion':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x11')},'placeholderMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x12')},'closingMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0xc')},'skipMessageButton':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x15')},'ratingType':{'type':Sequelize[_0x5238('0x16')](_0x5238('0x17'),'thumb'),'defaultValue':_0x5238('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5238('0xf')],'defaultValue':function(){return JSON[_0x5238('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x5238('0x19'),'helpText':''}},{'type':_0x5238('0x1a'),'props':{'title':_0x5238('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x5238('0x4'),'type':_0x5238('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5238('0x1b')](_0x5238('0x1c'))?JSON['parse'](this[_0x5238('0x1b')](_0x5238('0x1c'))):{};},'set':function(_0x25a6cd){return this[_0x5238('0x1d')](_0x5238('0x1c'),JSON['stringify'](_0x25a6cd));}},'offlineForm':{'type':Sequelize[_0x5238('0xf')],'defaultValue':function(){return JSON[_0x5238('0x18')]({'items':[{'type':_0x5238('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5238('0x4'),'type':_0x5238('0x4')},'variable':null},{'type':_0x5238('0x1e'),'config':{'placeholder':_0x5238('0x1f')},'props':{'title':'Comments','helpText':_0x5238('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x5238('0x1b')]('offlineForm')?JSON[_0x5238('0x21')](this[_0x5238('0x1b')](_0x5238('0x22'))):{};},'set':function(_0x3e27d4){return this[_0x5238('0x1d')](_0x5238('0x22'),JSON[_0x5238('0x18')](_0x3e27d4));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5238('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5238('0x2')]},'forwardOffline':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x24')},'waitingMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5238('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5238('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5238('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5238('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5238('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x29')},'systemAvatar':{'type':Sequelize[_0x5238('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5238('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b246d){if(!_0x1b246d)this[_0x5238('0x1d')](_0x5238('0x2a'),null);this['setDataValue'](_0x5238('0x2b'),_0x1b246d);}},'vidaooEscalation':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5238('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5238('0x2c')},'vidaooNote':{'type':Sequelize[_0x5238('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x5238('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 79e730c..475f014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21f1=['first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','unmanaged','*,*,*,*','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','email','NotifyMailAccount','notifyMail','addInteraction','omit','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','remote','connection','referer','virtual','replace','render','alignment','verticalAlignment','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','querystring','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','UserProfileResource','name','send','index','map','ChatWebsite','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','show','params','Pause','mandatoryDispositionPause','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','join','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','account','applications','list','asc','CmContact','contact','headers','cf-connecting-ip','x-forwarded-for'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21f1,0x1af));var _0x121f=function(_0x237825,_0x42c680){_0x237825=_0x237825-0x0;var _0x4d5e43=_0x21f1[_0x237825];return _0x4d5e43;};'use strict';var BPromise=require(_0x121f('0x0'));var Mustache=require(_0x121f('0x1'));var util=require(_0x121f('0x2'));var path=require(_0x121f('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x121f('0x4'));var _=require('lodash');var querystring=require(_0x121f('0x5'));var Redis=require('ioredis');var qs=require(_0x121f('0x6'));var logger=require(_0x121f('0x7'))('api');var config=require(_0x121f('0x8'));var db=require('../../mysqldb')['db'];config[_0x121f('0x9')]=_[_0x121f('0xa')](config[_0x121f('0x9')],{'host':_0x121f('0xb'),'port':0x18eb});var socket=require(_0x121f('0xc'))(new Redis(config[_0x121f('0x9')]));require(_0x121f('0xd'))[_0x121f('0xe')](socket);var jayson=require(_0x121f('0xf'));var client=jayson[_0x121f('0x10')][_0x121f('0x11')]({'port':0x232c});var client9002=jayson[_0x121f('0x10')][_0x121f('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x121f('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x55fecc,_0x5c4bc5,_0x5a3151,_0x2a486f){return new BPromise(function(_0x357253,_0x59f825){var _0x529dcc=_0x2a486f||client;return _0x529dcc[_0x121f('0x12')](_0x55fecc,_0x5a3151)[_0x121f('0x13')](function(_0x4aacc2){logger[_0x121f('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x5c4bc5,'request\x20sent');logger[_0x121f('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5c4bc5,_0x121f('0x16'),JSON[_0x121f('0x17')](_0x4aacc2));if(_0x4aacc2['error']){if(_0x4aacc2[_0x121f('0x18')][_0x121f('0x19')]===0x1f4){logger[_0x121f('0x18')](_0x121f('0x1a'),_0x5c4bc5,_0x4aacc2[_0x121f('0x18')]['message']);return _0x59f825(_0x4aacc2[_0x121f('0x18')]['message']);}logger[_0x121f('0x18')](_0x121f('0x1a'),_0x5c4bc5,_0x4aacc2[_0x121f('0x18')][_0x121f('0x1b')]);return _0x357253(_0x4aacc2[_0x121f('0x18')][_0x121f('0x1b')]);}else{logger[_0x121f('0x14')](_0x121f('0x1a'),_0x5c4bc5,_0x121f('0x16'));_0x357253(_0x4aacc2[_0x121f('0x1c')]['message']);}})[_0x121f('0x1d')](function(_0x1f9b95){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5c4bc5,_0x1f9b95);_0x59f825(_0x1f9b95);});});}function respondWithStatusCode(_0x290a55,_0x49825f){_0x49825f=_0x49825f||0xcc;return function(_0x53d87c){if(_0x53d87c){return _0x290a55[_0x121f('0x1e')](_0x49825f);}return _0x290a55[_0x121f('0x1f')](_0x49825f)[_0x121f('0x20')]();};}function respondWithResult(_0x26f192,_0x1213e2){_0x1213e2=_0x1213e2||0xc8;return function(_0x24ba00){if(_0x24ba00){return _0x26f192[_0x121f('0x1f')](_0x1213e2)[_0x121f('0x21')](_0x24ba00);}};}function respondWithFilteredResult(_0x1b79c5,_0x18c8dc){return function(_0x53ad93){if(_0x53ad93){var _0x4dc1f2=typeof _0x18c8dc['offset']===_0x121f('0x22')&&typeof _0x18c8dc[_0x121f('0x23')]===_0x121f('0x22');var _0x29850d=_0x53ad93[_0x121f('0x24')];var _0x3ab4b3=_0x4dc1f2?0x0:_0x18c8dc[_0x121f('0x25')];var _0x2847dd=_0x4dc1f2?_0x53ad93[_0x121f('0x24')]:_0x18c8dc[_0x121f('0x25')]+_0x18c8dc[_0x121f('0x23')];var _0xe126ab;if(_0x2847dd>=_0x29850d){_0x2847dd=_0x29850d;_0xe126ab=0xc8;}else{_0xe126ab=0xce;}_0x1b79c5[_0x121f('0x1f')](_0xe126ab);return _0x1b79c5[_0x121f('0x26')]('Content-Range',_0x3ab4b3+'-'+_0x2847dd+'/'+_0x29850d)[_0x121f('0x21')](_0x53ad93);}return null;};}function saveUpdates(_0x3ad613){return function(_0x4d99b7){if(_0x4d99b7){return _0x4d99b7[_0x121f('0x27')](_0x3ad613)['then'](function(_0x28a792){return _0x28a792;});}return null;};}function removeEntity(_0x275964){return function(_0x321b86){if(_0x321b86){return _0x321b86[_0x121f('0x28')]()['then'](function(){var _0x3d7c54=_0x321b86['get']({'plain':!![]});var _0x250fe5='ChatWebsites';return db[_0x121f('0x29')][_0x121f('0x28')]({'where':{'type':_0x250fe5,'resourceId':_0x3d7c54['id']}})['then'](function(){return _0x321b86;});})[_0x121f('0x13')](function(){_0x275964[_0x121f('0x1f')](0xcc)[_0x121f('0x20')]();});}};}function handleEntityNotFound(_0x4d61a6){return function(_0x2cc3ff){if(!_0x2cc3ff){_0x4d61a6[_0x121f('0x1e')](0x194);}return _0x2cc3ff;};}function handleError(_0x45541c,_0x11cdd0){_0x11cdd0=_0x11cdd0||0x1f4;return function(_0x588aed){logger[_0x121f('0x18')](_0x588aed['stack']);if(_0x588aed[_0x121f('0x2a')]){delete _0x588aed[_0x121f('0x2a')];}_0x45541c['status'](_0x11cdd0)[_0x121f('0x2b')](_0x588aed);};}exports[_0x121f('0x2c')]=function(_0x5b7b15,_0x2b4604){var _0x2b6ee6={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4fd5b7={},_0x28582d={'count':0x0,'rows':[]};var _0x2f1b30=_[_0x121f('0x2d')](db[_0x121f('0x2e')][_0x121f('0x2f')],function(_0x2aed99){return{'name':_0x2aed99['fieldName'],'type':_0x2aed99['type']['key']};});_0x4fd5b7['model']=_[_0x121f('0x2d')](_0x2f1b30,_0x121f('0x2a'));_0x4fd5b7[_0x121f('0x30')]=_[_0x121f('0x31')](_0x5b7b15['query']);_0x4fd5b7[_0x121f('0x32')]=_[_0x121f('0x33')](_0x4fd5b7[_0x121f('0x34')],_0x4fd5b7[_0x121f('0x30')]);_0x2b6ee6[_0x121f('0x35')]=_['intersection'](_0x4fd5b7['model'],qs[_0x121f('0x36')](_0x5b7b15[_0x121f('0x30')][_0x121f('0x36')]));_0x2b6ee6[_0x121f('0x35')]=_0x2b6ee6['attributes'][_0x121f('0x37')]?_0x2b6ee6[_0x121f('0x35')]:_0x4fd5b7[_0x121f('0x34')];if(!_0x5b7b15['query'][_0x121f('0x38')](_0x121f('0x39'))){_0x2b6ee6[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x5b7b15[_0x121f('0x30')][_0x121f('0x23')]);_0x2b6ee6[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x5b7b15[_0x121f('0x30')][_0x121f('0x25')]);}_0x2b6ee6[_0x121f('0x3a')]=qs['sort'](_0x5b7b15[_0x121f('0x30')][_0x121f('0x3b')]);_0x2b6ee6['where']=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x5b7b15[_0x121f('0x30')],_0x4fd5b7['filters']),_0x2f1b30);if(_0x5b7b15[_0x121f('0x30')][_0x121f('0x3d')]){_0x2b6ee6['where']=_[_0x121f('0x3e')](_0x2b6ee6[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x2f1b30,function(_0x3f385e){if(_0x3f385e[_0x121f('0x40')]!==_0x121f('0x41')){var _0x278153={};_0x278153[_0x3f385e['name']]={'$like':'%'+_0x5b7b15['query'][_0x121f('0x3d')]+'%'};return _0x278153;}})});}_0x2b6ee6=_[_0x121f('0x3e')]({},_0x2b6ee6,_0x5b7b15[_0x121f('0x42')]);var _0x5dc8ce={'where':_0x2b6ee6['where']};return db[_0x121f('0x2e')][_0x121f('0x24')](_0x5dc8ce)[_0x121f('0x13')](function(_0x5aad3a){_0x28582d[_0x121f('0x24')]=_0x5aad3a;if(_0x5b7b15['query'][_0x121f('0x43')]){_0x2b6ee6[_0x121f('0x44')]=[{'all':!![]}];}return db[_0x121f('0x2e')]['findAll'](_0x2b6ee6);})[_0x121f('0x13')](function(_0x284b94){_0x28582d[_0x121f('0x45')]=_0x284b94;return _0x28582d;})[_0x121f('0x13')](respondWithFilteredResult(_0x2b4604,_0x2b6ee6))['catch'](handleError(_0x2b4604,null));};exports[_0x121f('0x46')]=function(_0x505906,_0x2bf8f3){var _0x12c2de={'raw':![],'where':{'id':_0x505906[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0x48')],'as':_0x121f('0x49')}]},_0x253f71={};_0x253f71['model']=_[_0x121f('0x31')](db[_0x121f('0x2e')][_0x121f('0x2f')]);_0x253f71[_0x121f('0x30')]=_[_0x121f('0x31')](_0x505906[_0x121f('0x30')]);_0x253f71['filters']=_[_0x121f('0x33')](_0x253f71[_0x121f('0x34')],_0x253f71[_0x121f('0x30')]);_0x12c2de[_0x121f('0x35')]=_[_0x121f('0x33')](_0x253f71['model'],qs[_0x121f('0x36')](_0x505906[_0x121f('0x30')]['fields']));_0x12c2de[_0x121f('0x35')]=_0x12c2de[_0x121f('0x35')][_0x121f('0x37')]?_0x12c2de[_0x121f('0x35')]:_0x253f71['model'];if(_0x505906[_0x121f('0x30')][_0x121f('0x43')]){_0x12c2de[_0x121f('0x44')]=[{'all':!![]}];}_0x12c2de=_[_0x121f('0x3e')]({},_0x12c2de,_0x505906['options']);return db[_0x121f('0x2e')][_0x121f('0x4a')](_0x12c2de)[_0x121f('0x13')](handleEntityNotFound(_0x2bf8f3,null))[_0x121f('0x13')](respondWithResult(_0x2bf8f3,null))[_0x121f('0x1d')](handleError(_0x2bf8f3,null));};exports[_0x121f('0x4b')]=function(_0x3fda3c,_0x354376){return db['ChatWebsite'][_0x121f('0x4b')](_0x3fda3c[_0x121f('0x4c')],{})['then'](function(_0x3555fa){var _0x268c96=_0x3fda3c[_0x121f('0x4d')][_0x121f('0x4e')]({'plain':!![]});if(!_0x268c96)throw new Error(_0x121f('0x4f'));if(_0x268c96[_0x121f('0x50')]==='user'){var _0x53bda5=_0x3555fa[_0x121f('0x4e')]({'plain':!![]});var _0x2b4c65='ChatWebsites';return db[_0x121f('0x51')][_0x121f('0x4a')]({'where':{'name':_0x2b4c65,'userProfileId':_0x268c96[_0x121f('0x52')]},'raw':!![]})[_0x121f('0x13')](function(_0x457838){if(_0x457838&&_0x457838['autoAssociation']===0x0){return db[_0x121f('0x29')][_0x121f('0x4b')]({'name':_0x53bda5[_0x121f('0x2a')],'resourceId':_0x53bda5['id'],'type':_0x457838[_0x121f('0x2a')],'sectionId':_0x457838['id']},{})[_0x121f('0x13')](function(){return _0x3555fa;});}else{return _0x3555fa;}})['catch'](function(_0x178e20){logger[_0x121f('0x18')](_0x121f('0x53'),_0x178e20);throw _0x178e20;});}return _0x3555fa;})[_0x121f('0x13')](respondWithResult(_0x354376,0xc9))[_0x121f('0x1d')](handleError(_0x354376,null));};exports['update']=function(_0x3e6b3d,_0xcb5779){if(_0x3e6b3d[_0x121f('0x4c')]['id']){delete _0x3e6b3d['body']['id'];}return db[_0x121f('0x2e')]['find']({'where':{'id':_0x3e6b3d[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0x48')],'as':_0x121f('0x49')}]})['then'](handleEntityNotFound(_0xcb5779,null))[_0x121f('0x13')](saveUpdates(_0x3e6b3d[_0x121f('0x4c')],null))[_0x121f('0x13')](respondWithResult(_0xcb5779,null))['catch'](handleError(_0xcb5779,null));};exports[_0x121f('0x28')]=function(_0x1d7eb1,_0x510913){return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1d7eb1[_0x121f('0x47')]['id']}})['then'](handleEntityNotFound(_0x510913,null))[_0x121f('0x13')](removeEntity(_0x510913,null))[_0x121f('0x1d')](handleError(_0x510913,null));};exports['describe']=function(_0x5ceeff,_0x2903b6){return db[_0x121f('0x2e')][_0x121f('0x54')]()[_0x121f('0x13')](respondWithResult(_0x2903b6,null))[_0x121f('0x1d')](handleError(_0x2903b6,null));};exports['addDisposition']=function(_0x24242e,_0x35a9f4){if(_0x24242e[_0x121f('0x4c')]['id']){delete _0x24242e[_0x121f('0x4c')]['id'];}return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x24242e[_0x121f('0x47')]['id']}})['then'](handleEntityNotFound(_0x35a9f4,null))[_0x121f('0x13')](function(_0x3550bd){if(_0x3550bd){_0x24242e[_0x121f('0x4c')]['ChatWebsiteId']=_0x3550bd['id'];return db['Disposition'][_0x121f('0x4b')](_0x24242e[_0x121f('0x4c')]);}})[_0x121f('0x13')](respondWithResult(_0x35a9f4,null))[_0x121f('0x1d')](handleError(_0x35a9f4,null));};exports[_0x121f('0x55')]=function(_0x558a54,_0x5d6450){var _0xcd0986={'raw':![],'where':{}};var _0x109b53={};var _0x59aa03={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x558a54[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5d6450,null))[_0x121f('0x13')](function(_0x595a9e){if(_0x595a9e){_0x109b53[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x57')]['rawAttributes']);_0x109b53['query']=_['keys'](_0x558a54[_0x121f('0x30')]);_0x109b53[_0x121f('0x32')]=_[_0x121f('0x33')](_0x109b53[_0x121f('0x34')],_0x109b53[_0x121f('0x30')]);_0xcd0986['attributes']=_[_0x121f('0x33')](_0x109b53[_0x121f('0x34')],qs[_0x121f('0x36')](_0x558a54[_0x121f('0x30')][_0x121f('0x36')]));_0xcd0986[_0x121f('0x35')]=_0xcd0986['attributes']['length']?_0xcd0986[_0x121f('0x35')]:_0x109b53['model'];if(!_0x558a54[_0x121f('0x30')][_0x121f('0x38')]('nolimit')){_0xcd0986[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x558a54[_0x121f('0x30')][_0x121f('0x23')]);_0xcd0986[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x558a54['query'][_0x121f('0x25')]);}_0xcd0986[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x558a54['query']['sort']);_0xcd0986[_0x121f('0x3f')]=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x558a54[_0x121f('0x30')],_0x109b53[_0x121f('0x32')]));_0xcd0986[_0x121f('0x3f')]['ChatWebsiteId']=_0x595a9e['id'];if(_0x558a54[_0x121f('0x30')][_0x121f('0x3d')]){_0xcd0986[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0xcd0986['where'],{'$or':_[_0x121f('0x2d')](_0xcd0986[_0x121f('0x35')],function(_0x246903){var _0x30e17b={};_0x30e17b[_0x246903]={'$like':'%'+_0x558a54[_0x121f('0x30')][_0x121f('0x3d')]+'%'};return _0x30e17b;})});}_0xcd0986=_['merge']({},_0xcd0986,_0x558a54[_0x121f('0x42')]);return db[_0x121f('0x57')][_0x121f('0x24')]({'where':_0xcd0986[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x38c49d){_0x59aa03[_0x121f('0x24')]=_0x38c49d;if(_0x558a54[_0x121f('0x30')][_0x121f('0x43')]){_0xcd0986['include']=[{'all':!![]}];}return db[_0x121f('0x57')][_0x121f('0x58')](_0xcd0986);})[_0x121f('0x13')](function(_0x761fd9){_0x59aa03[_0x121f('0x45')]=_0x761fd9;return _0x59aa03;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x5d6450,_0xcd0986))[_0x121f('0x1d')](handleError(_0x5d6450,null));};exports[_0x121f('0x59')]=function(_0x1af2df,_0x3d5795){return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x1af2df['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x3d5795,null))['then'](function(_0x3cb44c){if(_0x3cb44c){return _0x3cb44c['removeDispositions'](_0x1af2df[_0x121f('0x30')][_0x121f('0x5a')]);}})[_0x121f('0x13')](respondWithStatusCode(_0x3d5795,null))[_0x121f('0x1d')](handleError(_0x3d5795,null));};exports[_0x121f('0x5b')]=function(_0x1df841,_0x160b8b){if(_0x1df841[_0x121f('0x4c')]['id']){delete _0x1df841['body']['id'];}return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1df841[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x160b8b,null))['then'](function(_0xf4266){if(_0xf4266){_0x1df841[_0x121f('0x4c')][_0x121f('0x5c')]=_0xf4266['id'];return db[_0x121f('0x5d')][_0x121f('0x4b')](_0x1df841[_0x121f('0x4c')]);}})[_0x121f('0x13')](respondWithResult(_0x160b8b,null))[_0x121f('0x1d')](handleError(_0x160b8b,null));};exports[_0x121f('0x5e')]=function(_0x51a6c0,_0x5939c7){var _0x1a3b57={'raw':![],'where':{}};var _0x12c12e={};var _0x58ca5a={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x51a6c0[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5939c7,null))['then'](function(_0x41e9f3){if(_0x41e9f3){_0x12c12e[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x5d')][_0x121f('0x2f')]);_0x12c12e[_0x121f('0x30')]=_[_0x121f('0x31')](_0x51a6c0[_0x121f('0x30')]);_0x12c12e[_0x121f('0x32')]=_[_0x121f('0x33')](_0x12c12e[_0x121f('0x34')],_0x12c12e[_0x121f('0x30')]);_0x1a3b57[_0x121f('0x35')]=_[_0x121f('0x33')](_0x12c12e[_0x121f('0x34')],qs[_0x121f('0x36')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x36')]));_0x1a3b57[_0x121f('0x35')]=_0x1a3b57[_0x121f('0x35')]['length']?_0x1a3b57[_0x121f('0x35')]:_0x12c12e[_0x121f('0x34')];if(!_0x51a6c0[_0x121f('0x30')][_0x121f('0x38')](_0x121f('0x39'))){_0x1a3b57[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x23')]);_0x1a3b57['offset']=qs[_0x121f('0x25')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x25')]);}_0x1a3b57[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x3b')]);_0x1a3b57[_0x121f('0x3f')]=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x51a6c0[_0x121f('0x30')],_0x12c12e[_0x121f('0x32')]));_0x1a3b57[_0x121f('0x3f')][_0x121f('0x5c')]=_0x41e9f3['id'];if(_0x51a6c0[_0x121f('0x30')][_0x121f('0x3d')]){_0x1a3b57[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x1a3b57[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x1a3b57[_0x121f('0x35')],function(_0x59678b){var _0x1eface={};_0x1eface[_0x59678b]={'$like':'%'+_0x51a6c0['query'][_0x121f('0x3d')]+'%'};return _0x1eface;})});}_0x1a3b57=_[_0x121f('0x3e')]({},_0x1a3b57,_0x51a6c0[_0x121f('0x42')]);return db[_0x121f('0x5d')][_0x121f('0x24')]({'where':_0x1a3b57[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x168773){_0x58ca5a['count']=_0x168773;if(_0x51a6c0[_0x121f('0x30')][_0x121f('0x43')]){_0x1a3b57[_0x121f('0x44')]=[{'all':!![]}];}return db[_0x121f('0x5d')][_0x121f('0x58')](_0x1a3b57);})[_0x121f('0x13')](function(_0x526d4a){_0x58ca5a[_0x121f('0x45')]=_0x526d4a;return _0x58ca5a;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x5939c7,_0x1a3b57))[_0x121f('0x1d')](handleError(_0x5939c7,null));};exports[_0x121f('0x5f')]=function(_0x407457,_0x59b4d8){return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x407457[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x59b4d8,null))[_0x121f('0x13')](function(_0x24468b){if(_0x24468b){return _0x24468b[_0x121f('0x5f')](_0x407457[_0x121f('0x30')][_0x121f('0x5a')]);}})[_0x121f('0x13')](respondWithStatusCode(_0x59b4d8,null))['catch'](handleError(_0x59b4d8,null));};exports['addLogo']=function(_0x5a8dcf,_0x2224f6){_0x5a8dcf[_0x121f('0x4c')][_0x121f('0x60')]=_0x5a8dcf[_0x121f('0x61')][_0x121f('0x62')];return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x5a8dcf[_0x121f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2224f6,null))[_0x121f('0x13')](saveUpdates(_0x5a8dcf['body'],null))[_0x121f('0x13')](respondWithResult(_0x2224f6,null))[_0x121f('0x1d')](handleError(_0x2224f6,null));};exports[_0x121f('0x63')]=function(_0x599b99,_0x4fd96d){_0x599b99[_0x121f('0x4c')][_0x121f('0x64')]=_0x599b99[_0x121f('0x61')][_0x121f('0x62')];return db['ChatWebsite']['find']({'where':{'id':_0x599b99['params']['id']}})['then'](handleEntityNotFound(_0x4fd96d,null))['then'](saveUpdates(_0x599b99[_0x121f('0x4c')],null))[_0x121f('0x13')](respondWithResult(_0x4fd96d,null))['catch'](handleError(_0x4fd96d,null));};exports[_0x121f('0x65')]=function(_0x1d629b,_0x4ed245){_0x1d629b[_0x121f('0x4c')][_0x121f('0x66')]=_0x1d629b[_0x121f('0x61')][_0x121f('0x62')];return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1d629b[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x4ed245,null))[_0x121f('0x13')](saveUpdates(_0x1d629b[_0x121f('0x4c')],null))['then'](respondWithResult(_0x4ed245,null))[_0x121f('0x1d')](handleError(_0x4ed245,null));};exports['addSystemAvatar']=function(_0x2a0e5e,_0x12b4f7){_0x2a0e5e[_0x121f('0x4c')][_0x121f('0x67')]=_0x2a0e5e['file'][_0x121f('0x62')];return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x2a0e5e['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x12b4f7,null))[_0x121f('0x13')](saveUpdates(_0x2a0e5e[_0x121f('0x4c')],null))[_0x121f('0x13')](respondWithResult(_0x12b4f7,null))['catch'](handleError(_0x12b4f7,null));};exports[_0x121f('0x68')]=function(_0x101baa,_0x2e5735){var _0x267384=path['join'](config[_0x121f('0x69')],_0x121f('0x6a'));var _0x1da8c6={'where':{'id':_0x101baa[_0x121f('0x47')]['id']},'attributes':['id',_0x121f('0x60')],'raw':!![]};var _0x4c1c6b=![];return require(_0x121f('0x6b'))[_0x121f('0x6c')]()[_0x121f('0x13')](function(_0x4fd44f){if(_0x4fd44f){_0x4c1c6b=_0x4fd44f[_0x121f('0x6d')];}})[_0x121f('0x13')](function(){return db[_0x121f('0x2e')]['find'](_0x1da8c6);})['then'](handleEntityNotFound(_0x2e5735,null))[_0x121f('0x13')](function(_0x1f9530){if(_0x1f9530){if(!_['isNil'](_0x1f9530[_0x121f('0x60')])){if(fs[_0x121f('0x6e')](path['join'](config[_0x121f('0x69')],'server/files/images/logos/',_0x1f9530[_0x121f('0x60')]))&&_0x4c1c6b){_0x267384=path['join'](config[_0x121f('0x69')],_0x121f('0x6f'),_0x1f9530['sitepic']);}}return _0x2e5735[_0x121f('0x70')](_0x267384);}})[_0x121f('0x1d')](handleError(_0x2e5735,null));};exports[_0x121f('0x71')]=function(_0x1e2c8a,_0x3c433d){var _0x3d4499=path['join'](config[_0x121f('0x69')],_0x121f('0x72'));var _0x57f2e0={'where':{'id':_0x1e2c8a[_0x121f('0x47')]['id']},'attributes':['id',_0x121f('0x64')],'raw':!![]};return db[_0x121f('0x2e')][_0x121f('0x4a')](_0x57f2e0)[_0x121f('0x13')](handleEntityNotFound(_0x3c433d,null))[_0x121f('0x13')](function(_0x21f7a7){if(_0x21f7a7){if(!_['isNil'](_0x21f7a7['agentAvatar'])){if(fs[_0x121f('0x6e')](path['join'](config[_0x121f('0x69')],_0x121f('0x73'),_0x21f7a7[_0x121f('0x64')]))){_0x3d4499=path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x21f7a7[_0x121f('0x64')]);}}return _0x3c433d[_0x121f('0x70')](_0x3d4499);}})[_0x121f('0x1d')](handleError(_0x3c433d,null));};exports[_0x121f('0x75')]=function(_0x36a6ea,_0x4bce04){var _0x497a5f=path['join'](config['root'],_0x121f('0x76'));var _0xec72d={'where':{'id':_0x36a6ea[_0x121f('0x47')]['id']},'attributes':['id',_0x121f('0x66'),_0x121f('0x77')],'raw':!![]};return db[_0x121f('0x2e')][_0x121f('0x4a')](_0xec72d)[_0x121f('0x13')](handleEntityNotFound(_0x4bce04,null))[_0x121f('0x13')](function(_0x26b4f7){if(_0x26b4f7){if(!_[_0x121f('0x78')](_0x26b4f7[_0x121f('0x66')])){if(fs['existsSync'](path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x26b4f7[_0x121f('0x66')]))&&_0x26b4f7['showCustomerAvatar']){_0x497a5f=path[_0x121f('0x74')](config['root'],_0x121f('0x73'),_0x26b4f7['customerAvatar']);}}return _0x4bce04[_0x121f('0x70')](_0x497a5f);}})[_0x121f('0x1d')](handleError(_0x4bce04,null));};exports['getSystemAvatar']=function(_0x266fda,_0x40f474){var _0x297405=path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x79'));var _0x164338={'where':{'id':_0x266fda['params']['id']},'attributes':['id',_0x121f('0x67')],'raw':!![]};return db[_0x121f('0x2e')][_0x121f('0x4a')](_0x164338)['then'](handleEntityNotFound(_0x40f474,null))[_0x121f('0x13')](function(_0x2ea273){if(_0x2ea273){if(!_[_0x121f('0x78')](_0x2ea273[_0x121f('0x67')])){if(fs[_0x121f('0x6e')](path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x2ea273[_0x121f('0x67')]))){_0x297405=path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x2ea273[_0x121f('0x67')]);}}return _0x40f474['download'](_0x297405);}})['catch'](handleError(_0x40f474,null));};exports['notify']=function(_0x1c7329,_0x117dd8){var _0x34bbf9=require(_0x121f('0x7a'));var _0x4ed956=new _0x34bbf9();var _0x5a92cc=_0x4ed956[_0x121f('0x7b')](_0x1c7329['headers'][_0x121f('0x7c')])[_0x121f('0x7d')]();var _0x313cf2={'body':_0x1c7329[_0x121f('0x4c')],'channel':_0x121f('0x7e')};var _0x528587=[];var _0x15d63d=[];var _0x12a95a={};var _0x3f2ed2=![];return db['CmContact']['describe']()[_0x121f('0x13')](function(_0x44fef4){if(!_0x44fef4){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x80'));}_0x528587=_[_0x121f('0x81')](_[_0x121f('0x31')](_0x44fef4),[_0x121f('0x82'),_0x121f('0x83')]);_0x15d63d=_[_0x121f('0x81')](_[_0x121f('0x31')](_0x44fef4),[_0x121f('0x82'),_0x121f('0x83'),_0x121f('0x84'),_0x121f('0x85')]);if(_0x1c7329['body']['id']){delete _0x1c7329[_0x121f('0x4c')]['id'];}if(_[_0x121f('0x78')](_0x1c7329[_0x121f('0x4c')][_0x121f('0x86')])){throw new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0x88'));}if(_[_0x121f('0x78')](_0x1c7329[_0x121f('0x4c')][_0x121f('0x4c')])||_0x1c7329[_0x121f('0x4c')][_0x121f('0x4c')]===''){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x89'));}if(_[_0x121f('0x78')](_0x1c7329[_0x121f('0x4c')][_0x121f('0x8a')])){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x8b')+_0x15d63d);}if(!_[_0x121f('0x8c')](_0x15d63d,_0x1c7329[_0x121f('0x4c')][_0x121f('0x8a')])){throw new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0x8d')+_0x15d63d);}_0x12a95a[_0x1c7329[_0x121f('0x4c')][_0x121f('0x8a')]]=_0x1c7329[_0x121f('0x4c')]['from'];})[_0x121f('0x13')](function(){return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1c7329[_0x121f('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x121f('0x8e'),'include':[{'model':db['CmContact'],'as':_0x121f('0x8f'),'where':_0x12a95a,'limit':0x1,'order':[[_0x121f('0x83'),'DESC']]}]},{'model':db[_0x121f('0x90')],'as':_0x121f('0x91')}]});})[_0x121f('0x13')](handleEntityNotFound(_0x117dd8,null))[_0x121f('0x13')](function(_0x304343){if(_0x304343&&_0x304343['List']){_0x313cf2[_0x121f('0x92')]=_0x304343;_0x313cf2[_0x121f('0x93')]=_0x304343[_0x121f('0x91')];_0x313cf2[_0x121f('0x94')]=_0x304343[_0x121f('0x8e')];_0x313cf2[_0x121f('0x93')]=_['orderBy'](_0x313cf2[_0x121f('0x93')],['priority'],[_0x121f('0x95')]);if(_0x313cf2[_0x121f('0x92')][_0x121f('0x91')]){delete _0x313cf2[_0x121f('0x92')][_0x121f('0x91')];}if(_0x313cf2[_0x121f('0x92')]['List']&&_0x313cf2[_0x121f('0x92')][_0x121f('0x8e')][_0x121f('0x8f')][_0x121f('0x37')]){return _0x313cf2[_0x121f('0x92')][_0x121f('0x8e')][_0x121f('0x8f')][0x0];}var _0x27f550=_['defaults'](_0x1c7329[_0x121f('0x4c')],{'firstName':_0x1c7329[_0x121f('0x4c')][_0x121f('0x86')],'ListId':_0x304343[_0x121f('0x85')]});_0x27f550[_0x1c7329['body'][_0x121f('0x8a')]]=_0x1c7329[_0x121f('0x4c')]['from'];return db[_0x121f('0x96')]['create'](_0x27f550,{'fields':_0x528587,'raw':!![]});}})[_0x121f('0x13')](handleEntityNotFound(_0x117dd8,null))['then'](function(_0x47d2ee){_0x313cf2[_0x121f('0x97')]=_0x47d2ee;var _0x1428ce=_0x1c7329[_0x121f('0x4c')]['customerIp'];if(_0x1c7329[_0x121f('0x98')][_0x121f('0x99')]){_0x1428ce=_0x1c7329['headers'][_0x121f('0x99')];}else if(_0x1c7329['headers'][_0x121f('0x9a')]){_0x1428ce=_[_0x121f('0x9b')](_0x1c7329[_0x121f('0x98')][_0x121f('0x9a')][_0x121f('0x9c')](','));}if(_0x47d2ee){var _0x4862d8={'ContactId':_0x47d2ee['id'],'ChatWebsiteId':_0x1c7329[_0x121f('0x47')]['id'],'from':(_0x47d2ee[_0x121f('0x9d')]||'')+'\x20'+(_0x47d2ee[_0x121f('0x9e')]||''),'customerIp':_0x1428ce,'customerPort':_0x1c7329[_0x121f('0x98')]['x-real-port']?_0x1c7329['headers'][_0x121f('0x9f')]:null,'referer':_0x1c7329[_0x121f('0x4c')]['referer'],'browserName':_0x5a92cc[_0x121f('0xa0')][_0x121f('0x2a')]&&_0x5a92cc[_0x121f('0xa0')][_0x121f('0xa1')]?util[_0x121f('0xa2')](_0x121f('0xa3'),_0x5a92cc['browser'][_0x121f('0x2a')],_0x5a92cc[_0x121f('0xa0')][_0x121f('0xa1')]):_0x121f('0xa4'),'browserVersion':_0x5a92cc[_0x121f('0xa0')][_0x121f('0xa1')]||'unknown','osName':util[_0x121f('0xa2')](_0x121f('0xa3'),_0x5a92cc['os'][_0x121f('0x2a')],_0x5a92cc['os']['version']),'osVersion':_0x5a92cc['os'][_0x121f('0xa1')],'deviceModel':_0x5a92cc[_0x121f('0xa5')][_0x121f('0x34')]&&_0x5a92cc[_0x121f('0xa5')]['vendor']?util[_0x121f('0xa2')](_0x121f('0xa6'),_0x5a92cc['device']['model'],_0x5a92cc[_0x121f('0xa5')]['vendor'],_0x5a92cc[_0x121f('0xa5')][_0x121f('0x40')]):null,'deviceVendor':_0x5a92cc[_0x121f('0xa5')][_0x121f('0xa7')],'deviceType':_0x5a92cc[_0x121f('0xa5')]['type'],'formData':JSON[_0x121f('0x17')](_0x1c7329['body'])};var _0x446b9d={'ChatWebsiteId':_0x1c7329[_0x121f('0x47')]['id'],'closed':![]};if(_0x1c7329[_0x121f('0x4c')][_0x121f('0xa8')]){_0x446b9d[_0x121f('0xa8')]=_0x1c7329[_0x121f('0x4c')]['threadId'];return db[_0x121f('0xa9')]['find']({'where':_0x446b9d})[_0x121f('0x13')](function(_0x388022){if(_0x388022){return[_0x388022,![]];}_0x4862d8[_0x121f('0xa8')]=_0x1c7329[_0x121f('0x4c')]['threadId'];_0x4862d8['externalUrl']=_0x1c7329[_0x121f('0x4c')][_0x121f('0xaa')];return db['ChatInteraction']['create'](_0x4862d8)[_0x121f('0x13')](function(_0x3dde49){return[_0x3dde49,!![]];});});}_0x446b9d[_0x121f('0xab')]=_0x47d2ee['id'];if(_0x1c7329[_0x121f('0x4c')]['interaction']&&_0x1c7329[_0x121f('0x4c')][_0x121f('0xac')]['id']){_0x446b9d['id']=_0x1c7329[_0x121f('0x4c')][_0x121f('0xac')]['id'];return db[_0x121f('0xa9')][_0x121f('0x4a')]({'where':_0x446b9d})[_0x121f('0x13')](function(_0x13126e){if(_0x13126e){return[_0x13126e,![]];}return db[_0x121f('0xa9')][_0x121f('0x4b')](_0x4862d8)['then'](function(_0x320bd9){return[_0x320bd9,!![]];});});}return db[_0x121f('0xa9')][_0x121f('0x4b')](_0x4862d8)[_0x121f('0x13')](function(_0x27f779){return[_0x27f779,!![]];});}})[_0x121f('0xad')](function(_0x4a45c,_0x20a1b6){if(_0x4a45c){_0x3f2ed2=_0x20a1b6;if(!_0x20a1b6){var _0x2dfc6b={'from':(_0x313cf2[_0x121f('0x97')][_0x121f('0x9d')]||'')+'\x20'+(_0x313cf2[_0x121f('0x97')][_0x121f('0x9e')]||'')};if(_0x1c7329[_0x121f('0x4c')]['threadId']&&_0x1c7329['body'][_0x121f('0xae')]&&_0x1c7329[_0x121f('0x4c')][_0x121f('0xa8')]!=_0x1c7329[_0x121f('0x4c')][_0x121f('0xae')]){_0x2dfc6b[_0x121f('0xa8')]=_0x1c7329['body']['messageId'];}return _0x4a45c['update'](_0x2dfc6b);}else{return _0x4a45c;}}})[_0x121f('0x13')](function(_0x1c0224){_0x313cf2[_0x121f('0xac')]=_0x1c0224[_0x121f('0x4e')]({'plain':!![]});_0x313cf2[_0x121f('0xac')][_0x121f('0xaf')]=_0x3f2ed2;if(_0x313cf2[_0x121f('0xac')]['created']){if(_0x313cf2[_0x121f('0x92')]['autoclose']){_0x313cf2[_0x121f('0x93')][_0x121f('0xb0')]({'id':0x0,'priority':_0x313cf2[_0x121f('0x93')]['length']+0x1,'app':'close','appdata':_0x121f('0xb1'),'interval':_0x121f('0xb2')});}}return db['ChatMessage']['create']({'body':_0x1c7329[_0x121f('0x4c')][_0x121f('0x4c')],'ChatWebsiteId':_0x1c7329[_0x121f('0x47')]['id'],'ChatInteractionId':_0x1c0224['id'],'direction':'in','ContactId':_0x313cf2[_0x121f('0x97')]['id'],'AttachmentId':_0x1c7329[_0x121f('0x4c')]['AttachmentId']});})[_0x121f('0x13')](function(_0x1c5a1d){_0x313cf2['message']=_0x1c5a1d;if(_0x313cf2[_0x121f('0xac')][_0x121f('0xb3')]){return db[_0x121f('0xb4')][_0x121f('0x4a')]({'attributes':['id',_0x121f('0x2a')],'where':{'id':_0x313cf2[_0x121f('0xac')][_0x121f('0xb3')]}})[_0x121f('0x13')](function(_0x5d9241){if(_0x5d9241){_0x313cf2[_0x121f('0x93')][_0x121f('0xb5')]({'id':0x0,'priority':0x0,'app':_0x121f('0xb6'),'appdata':_0x5d9241[_0x121f('0x2a')]+','+(_0x313cf2['account']['waitForTheAssignedAgent']||0xa),'interval':_0x121f('0xb2')});_0x313cf2[_0x121f('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x313cf2);});}return respondWithRpcPromise(_0x121f('0xb8'),_0x121f('0xb9'),_0x313cf2);})[_0x121f('0x13')](function(_0x7b4ef4){respondWithRpcPromise('EventManager',_0x121f('0xba'),{'event':_0x121f('0xbb'),'message':_0x7b4ef4},client9002);return _0x7b4ef4;})[_0x121f('0x13')](respondWithResult(_0x117dd8,null))[_0x121f('0x1d')](handleError(_0x117dd8,null));};exports[_0x121f('0xbc')]=function(_0x2040c6,_0x2eabb2){var _0x48c964,_0x13750b,_0x1ae0b6;var _0xccb226=[];var _0x595cf4={};var _0x24a1c7=_0x2040c6[_0x121f('0xbd')]||[];var _0x4698be=[];var _0x326e4b;return db['CmContact'][_0x121f('0x54')]()[_0x121f('0x13')](function(_0x2d5e38){if(!_0x2d5e38){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x80'));}_0xccb226=_[_0x121f('0x81')](_[_0x121f('0x31')](_0x2d5e38),['createdAt','updatedAt',_0x121f('0x84'),_0x121f('0x85')]);if(_0x2040c6['body']['id']){delete _0x2040c6['body']['id'];}if(_[_0x121f('0x78')](_0x2040c6[_0x121f('0x4c')]['from'])){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0x88')));}if(_[_0x121f('0x78')](_0x2040c6[_0x121f('0x4c')][_0x121f('0x4c')])||_0x2040c6[_0x121f('0x4c')][_0x121f('0x4c')]===''){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db['Sequelize']['ValidationError'](_0x121f('0x89')));}if(_['isNil'](_0x2040c6[_0x121f('0x4c')]['mapKeyOffline'])){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db[(_0x121f('0x87'))]['ValidationError'](_0x121f('0xbe')+_0xccb226));}if(!_[_0x121f('0x8c')](_0xccb226,_0x2040c6[_0x121f('0x4c')][_0x121f('0xbf')])){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0xc0')+_0xccb226));}_0x595cf4[_0x2040c6[_0x121f('0x4c')][_0x121f('0xbf')]]=_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')];})[_0x121f('0x13')](function(){return db[_0x121f('0x2e')]['find']({'where':{'id':_0x2040c6[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0xc1')],'as':_0x121f('0x8e')},{'model':db['MailAccount'],'as':_0x121f('0xc2')}]});})[_0x121f('0x13')](handleEntityNotFound(_0x2eabb2,null))[_0x121f('0x13')](function(_0xe2325c){if(_0xe2325c&&_0xe2325c[_0x121f('0x8e')]){_0x13750b=_0xe2325c;var _0x38d5f4=_[_0x121f('0xa')](_0x2040c6[_0x121f('0x4c')],{'firstName':_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')],'phone':_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')],'ListId':_0xe2325c[_0x121f('0x85')]});_0x38d5f4[_0x2040c6['body'][_0x121f('0xbf')]]=_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')];return db[_0x121f('0x96')]['findOrCreate']({'where':_0x595cf4,'defaults':_0x38d5f4});}})['spread'](function(_0x580af6){if(_0x580af6){_0x1ae0b6=_0x580af6;var _0x4584ef=fs[_0x121f('0xc3')](path[_0x121f('0x74')](config[_0x121f('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0x121f('0xc4'));var _0xadeabd=ejs['render'](_0x4584ef,{'body':_[_0x121f('0xc5')](_0x2040c6[_0x121f('0x4c')]['body']),'bodyTitle':_0x13750b['offlineMessageBody']});return db[_0x121f('0xc6')][_0x121f('0x4b')]({'body':_0xadeabd,'ContactId':_0x580af6['id'],'ChatWebsiteId':_0x13750b['id']});}})[_0x121f('0x13')](function(_0x3046c0){_0x326e4b=_0x3046c0;if(_0x24a1c7[_0x121f('0x37')]){var _0x2b555f=_0x24a1c7[_0x121f('0x2d')](function(_0x395716){return{'name':_0x395716[_0x121f('0xc7')],'basename':_0x395716[_0x121f('0x62')],'type':_0x395716[_0x121f('0xc8')],'ChatOfflineMessageId':_0x3046c0['id']};});_0x4698be=_0x2b555f['map'](_0x2eb5cc=>{var _0x1f3c8d={'filename':_0x2eb5cc[_0x121f('0x2a')],'path':path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0xc9'),_0x121f('0xbd'),_0x121f('0xca'),_0x121f('0xcb'),_0x2eb5cc[_0x121f('0xcc')])};return _0x1f3c8d;});if(!_0x13750b[_0x121f('0xcd')]){return db[_0x121f('0xce')][_0x121f('0xcf')](function(_0x5c5cd7){return db['Attachment']['bulkCreate'](_0x2b555f,{'transaction':_0x5c5cd7});});}}})[_0x121f('0x13')](function(){if(_0x326e4b){_0x48c964=_0x326e4b;return db['MailAccount'][_0x121f('0x56')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x121f('0x13')](function(_0x540063){if(_0x540063&&_0x540063[_0x121f('0xd0')]&&_0x13750b['forwardOffline']&&_0x13750b[_0x121f('0xd1')]){var _0x2b7036={'tls':{'rejectUnauthorized':![]}};if(_0x540063[_0x121f('0xd0')][_0x121f('0xd2')]){_0x2b7036[_0x121f('0xd2')]=_0x540063[_0x121f('0xd0')][_0x121f('0xd2')];}else{_0x2b7036[_0x121f('0xd3')]=_0x540063[_0x121f('0xd0')][_0x121f('0xd3')];_0x2b7036[_0x121f('0xd4')]=_0x540063['Smtp'][_0x121f('0xd4')];_0x2b7036[_0x121f('0xd5')]=_0x540063[_0x121f('0xd0')]['secure'];}if(_0x540063[_0x121f('0xd0')][_0x121f('0xd6')]){_0x2b7036['auth']={'user':_0x540063[_0x121f('0xd0')][_0x121f('0x4d')],'pass':_0x540063[_0x121f('0xd0')][_0x121f('0xd7')]};}return respondWithRpcPromise(_0x121f('0xd8'),_0x121f('0xd9'),{'account':_0x2b7036,'message':{'from':util['format'](_0x121f('0xda'),_0x540063[_0x121f('0x2a')],_0x540063['email']||_0x540063['Smtp'][_0x121f('0x4d')]),'to':_0x13750b[_0x121f('0xd1')],'subject':_0x13750b[_0x121f('0xdb')],'html':_0x48c964['body'],'attachments':_0x4698be}},client9003)[_0x121f('0x13')](function(){return _0x48c964;})['catch'](function(_0x483679){console[_0x121f('0x18')](_0x483679);});}})[_0x121f('0x13')](function(){if(_0x13750b&&_0x13750b[_0x121f('0xcd')]&&_0x13750b[_0x121f('0xdc')]){var _0x1b11f4=[];if(_0x24a1c7['length']){_0x1b11f4=_0x24a1c7[_0x121f('0x2d')](function(_0x398d06){return{'name':_0x398d06[_0x121f('0xc7')],'basename':_0x398d06['filename'],'type':_0x398d06[_0x121f('0xc8')],'ChatOfflineMessageId':_0x326e4b['id']};});}var _0x37fb78;if(!_['isNil'](_0x13750b[_0x121f('0xdd')])){var _0x2b8bf8=_[_0x121f('0x2d')](_0x2040c6[_0x121f('0x4c')],function(_0x5f5083){return _0x5f5083;});var _0x4c1954=_[_0x121f('0xde')](_0x2b8bf8)[0x0];var _0x3e8b38=_['mapValues'](_0x4c1954,function(_0x24aa8b){return _0x24aa8b;});_0x37fb78=_0x3e8b38[0x1][_0x13750b[_0x121f('0xdd')]];}var _0x88a05a={'from':_0x1ae0b6[_0x121f('0xdf')],'firstName':_0x1ae0b6[_0x121f('0x9d')],'lastName':_0x1ae0b6['lastName'],'mapKey':'email','message':{'from':_0x1ae0b6[_0x121f('0xdf')],'to':_0x13750b[_0x121f('0xc2')][_0x121f('0xdf')],'cc':'','subject':_['isNil'](_0x37fb78)?_0x13750b[_0x121f('0xdb')]:_0x37fb78,'messageId':'','sentAt':new Date(),'attach':_0x1b11f4[_0x121f('0x37')],'attachments':_0x1b11f4,'originChannel':'Chat','ChatWebsiteId':_0x13750b['id'],'ChatOfflineMessageId':_0x48c964['id'],'originTo':_0x13750b[_0x121f('0xc2')][_0x121f('0xdf')]},'body':_0x48c964[_0x121f('0x4c')]};var _0x23fd64={'account':{'id':_0x13750b[_0x121f('0xdc')]},'body':_0x88a05a,'log':_0x121f('0xe0')};return respondWithRpcPromise(_0x121f('0xe0'),_0x121f('0xe1'),_0x23fd64,client9001)[_0x121f('0x13')](function(){return _0x48c964;})['catch'](function(_0x5b91ba){console[_0x121f('0x18')](_0x5b91ba);});}return;})[_0x121f('0x13')](function(){if(_0x48c964){return _0x48c964;}})[_0x121f('0x13')](respondWithResult(_0x2eabb2,null))['catch'](function(_0x36fa49){console['error']('catch',_0x36fa49);for(var _0x595c09 of _0x24a1c7){var _0xca9eee=path['join'](config[_0x121f('0x69')],_0x121f('0xc9'),'files','attachments',_0x121f('0xcb'),_0x595c09['filename']);fs_extra['remove'](_0xca9eee)['catch'](function(_0x42a33e){console[_0x121f('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0xca9eee,_0x42a33e);});}});};exports[_0x121f('0xe2')]=function(_0x6ac209,_0x39f201){return db[_0x121f('0xa9')][_0x121f('0x4a')]({'where':{'id':_0x6ac209[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x39f201,null))[_0x121f('0x13')](function(_0xfa6885){if(_0xfa6885){return _0xfa6885[_0x121f('0xe2')](_0x6ac209[_0x121f('0x4c')][_0x121f('0x5a')],_[_0x121f('0xe3')](_0x6ac209[_0x121f('0x4c')],[_0x121f('0x5a'),'id'])||{});}})[_0x121f('0x13')](respondWithResult(_0x39f201,null))[_0x121f('0x1d')](handleError(_0x39f201,null));};exports['getInteractions']=function(_0x54e08a,_0x37d114){var _0x2cfceb={'raw':![],'where':{}};var _0x8d5dfb={};var _0x52ab64={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x54e08a['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x37d114,null))[_0x121f('0x13')](function(_0xba3112){if(_0xba3112){_0x8d5dfb[_0x121f('0x34')]=_[_0x121f('0x31')](db['ChatInteraction'][_0x121f('0x2f')]);_0x8d5dfb[_0x121f('0x30')]=_[_0x121f('0x31')](_0x54e08a[_0x121f('0x30')]);_0x8d5dfb[_0x121f('0x32')]=_[_0x121f('0x33')](_0x8d5dfb[_0x121f('0x34')],_0x8d5dfb[_0x121f('0x30')]);_0x2cfceb[_0x121f('0x35')]=_[_0x121f('0x33')](_0x8d5dfb[_0x121f('0x34')],qs[_0x121f('0x36')](_0x54e08a[_0x121f('0x30')][_0x121f('0x36')]));_0x2cfceb[_0x121f('0x35')]=_0x2cfceb[_0x121f('0x35')][_0x121f('0x37')]?_0x2cfceb['attributes']:_0x8d5dfb[_0x121f('0x34')];if(!_0x54e08a[_0x121f('0x30')][_0x121f('0x38')](_0x121f('0x39'))){_0x2cfceb[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x54e08a['query'][_0x121f('0x23')]);_0x2cfceb[_0x121f('0x25')]=qs['offset'](_0x54e08a['query']['offset']);}_0x2cfceb[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x54e08a['query']['sort']);_0x2cfceb[_0x121f('0x3f')]=qs[_0x121f('0x32')](_['pick'](_0x54e08a['query'],_0x8d5dfb[_0x121f('0x32')]));_0x2cfceb[_0x121f('0x3f')][_0x121f('0x5c')]=_0xba3112['id'];if(_0x54e08a['query'][_0x121f('0x3d')]){_0x2cfceb[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x2cfceb[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x2cfceb[_0x121f('0x35')],function(_0x30053c){var _0x57e869={};_0x57e869[_0x30053c]={'$like':'%'+_0x54e08a['query']['filter']+'%'};return _0x57e869;})});}_0x2cfceb=_[_0x121f('0x3e')]({},_0x2cfceb,_0x54e08a[_0x121f('0x42')]);return db[_0x121f('0xa9')]['count']({'where':_0x2cfceb[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x3511a4){_0x52ab64[_0x121f('0x24')]=_0x3511a4;if(_0x54e08a[_0x121f('0x30')][_0x121f('0x43')]){_0x2cfceb[_0x121f('0x44')]=[{'model':db[_0x121f('0x96')],'as':'Contact','required':![]},{'model':db[_0x121f('0xb4')],'as':_0x121f('0xe4'),'attributes':[_0x121f('0x2a'),_0x121f('0xe5'),_0x121f('0xe6')],'required':![]},{'model':db[_0x121f('0xe7')],'as':_0x121f('0xe8'),'attributes':['id',_0x121f('0x2a'),_0x121f('0xe9')],'where':_0x54e08a[_0x121f('0x30')][_0x121f('0xea')]?{'id':_0x54e08a[_0x121f('0x30')]['tag']}:undefined,'required':_0x54e08a['query'][_0x121f('0xea')]?!![]:![]}];}return db[_0x121f('0xa9')]['findAll'](_0x2cfceb);})[_0x121f('0x13')](function(_0x25938f){_0x52ab64[_0x121f('0x45')]=_0x25938f;return _0x52ab64;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x37d114,_0x2cfceb))[_0x121f('0x1d')](handleError(_0x37d114,null));};function iftimePromise(_0x3d9cdb,_0x590475){return respondWithRpcPromise(_0x121f('0xeb'),_0x121f('0xec'),{'command':_0x590475[_0x121f('0xed')]?util[_0x121f('0xa2')](_0x121f('0xee'),_0x3d9cdb[_0x121f('0xef')],_0x590475[_0x121f('0xed')]):util[_0x121f('0xa2')](_0x121f('0xf0'),_0x3d9cdb[_0x121f('0xef')])},client9002)['then'](function(_0x74a1d9){var _0x55c899=_0x74a1d9&&_0x74a1d9[_0x121f('0xf1')](_0x121f('0xf2'))>=0x0?!![]:![];logger['info'](_0x121f('0xf3'),_0x590475['id'],_0x3d9cdb['id'],_0x3d9cdb[_0x121f('0xef')],_0x55c899?_0x121f('0xf4'):_0x121f('0xf5'),_0x590475[_0x121f('0xed')]?_0x590475[_0x121f('0xed')]:_0x121f('0xf6'));return _0x55c899;})[_0x121f('0x1d')](function(_0x5ab6a6){logger['error'](_0x121f('0xf3'),_0x590475['id'],_0x3d9cdb['id'],_0x3d9cdb['interval'],util[_0x121f('0xf7')](_0x5ab6a6,{'showHidden':![],'depth':null}),_0x590475['timezone']?_0x590475[_0x121f('0xed')]:_0x121f('0xf6'));return![];});}exports['getSnippet']=function(_0x29b434,_0x2e231e){var _0x576cd8=0x0;var _0x13b10=0x0;var _0x1c3208=![];var _0x31b8f1;var _0x3e6e20;return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x29b434[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0xf8')],'as':_0x121f('0xf8'),'include':[{'model':db[_0x121f('0xf8')],'as':_0x121f('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x121f('0x13')](handleEntityNotFound(_0x2e231e,null))[_0x121f('0x13')](function(_0x409dc0){if(_0x409dc0){_0x31b8f1=_0x409dc0;return _0x409dc0[_0x121f('0xfa')]({'raw':!![]});}})['then'](function(_0x450725){if(_0x31b8f1){if(_0x450725){_0x3e6e20=_0x450725;}}return require(_0x121f('0x6b'))[_0x121f('0x6c')]();})[_0x121f('0x13')](function(_0x5ad255){if(_0x5ad255){_0x13b10=_0x5ad255['virtual'];_0x1c3208=_0x5ad255[_0x121f('0x6d')];}})[_0x121f('0x13')](function(){return db[_0x121f('0xa9')][_0x121f('0x24')]({'where':{'closed':![]}});})['then'](function(_0x42534f){_0x576cd8=_0x42534f;if(_0x13b10&&_0x42534f>_0x13b10){return db[_0x121f('0xfb')][_0x121f('0x56')]({'where':{'id':0x1}})[_0x121f('0x13')](function(_0x547ea3){if(_0x547ea3){_0x547ea3[_0x121f('0xfc')](_0x121f('0xfd'));}});}})[_0x121f('0x13')](function(){if(_0x31b8f1['Interval']&&_0x31b8f1[_0x121f('0xf8')][_0x121f('0xf9')]){var _0x1c84fb=[];for(var _0x2d2b48=0x0;_0x2d2b48<_0x31b8f1[_0x121f('0xf8')][_0x121f('0xf9')]['length'];_0x2d2b48++){var _0x5f3c09=_0x31b8f1['Interval'][_0x121f('0xf9')][_0x2d2b48][_0x121f('0x4e')]({'plain':!![]});_0x1c84fb[_0x121f('0xb0')](iftimePromise(_0x5f3c09,_0x31b8f1));}return BPromise['all'](_0x1c84fb)[_0x121f('0x13')](function(_0x56f79c){return _[_0x121f('0xfe')](_0x56f79c);});}else{return!![];}})[_0x121f('0x13')](function(_0x3ecb94){var _0x54da81=fs['readFileSync'](path['join'](config[_0x121f('0x69')],'server/files/chat/iframe.ejs'),_0x121f('0xc4'));var _0x56d9b7={'remote':_0x31b8f1[_0x121f('0xff')],'query':querystring['stringify'](_[_0x121f('0x3e')](_0x31b8f1[_0x121f('0x4e')]({'plain':!![]}),{'customerIp':_0x29b434[_0x121f('0x98')][_0x121f('0x9a')]||_0x29b434[_0x121f('0x98')]['x-real-ip']||_0x29b434[_0x121f('0x100')]['remoteAddress']||_0x29b434['ip'],'referer':_0x29b434['headers'][_0x121f('0x101')],'openedInteractions':_0x576cd8,'maxInteractions':_0x13b10,'virtual':_0x1c3208[_0x121f('0x102')],'online':_0x3ecb94,'custom':_0x1c3208}))[_0x121f('0x103')](/'/g,'\x5c\x27')};_0x2e231e[_0x121f('0x2b')](ejs[_0x121f('0x104')](Mustache[_0x121f('0x104')](_0x54da81,_0x56d9b7),{'proactiveActions':_0x3e6e20,'alignment':_0x31b8f1[_0x121f('0x105')],'verticalAlignment':_0x31b8f1[_0x121f('0x106')],'div_color':_0x31b8f1[_0x121f('0xe9')],'text_color':_0x31b8f1[_0x121f('0x107')],'button_color':_0x31b8f1['color_button'],'background_color':_0x31b8f1[_0x121f('0x108')]}));})['catch'](handleError(_0x2e231e,null));};exports[_0x121f('0x109')]=function(_0x47b7de,_0xd163aa){var _0x423dd3=_0x47b7de[_0x121f('0x47')]['id'];var _0x3b1c8d=_0x47b7de['body'];var _0x4450af=0xc8;var _0x183edb=null;return db[_0x121f('0xce')]['transaction']({'isolationLevel':db[_0x121f('0xce')][_0x121f('0x10a')][_0x121f('0x10b')][_0x121f('0x10c')]},function(_0x139d54){return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x423dd3},'transaction':_0x139d54})[_0x121f('0x13')](function(_0x2087d4){if(_0x2087d4){return db[_0x121f('0x90')][_0x121f('0x28')]({'where':{'ChatWebsiteId':_0x423dd3},'transaction':_0x139d54})['then'](function(){var _0x3e5dbf=_[_0x121f('0x2d')](_0x3b1c8d,function(_0x475869){_0x475869[_0x121f('0x5c')]=_0x423dd3;return _0x475869;});return db['ChatApplication'][_0x121f('0x10d')](_0x3e5dbf,{'transaction':_0x139d54});});}else{_0x4450af=0x194;_0x183edb=[];}});})[_0x121f('0x13')](function(){if(_0x4450af!==0x194){return db[_0x121f('0x90')][_0x121f('0x10e')]({'where':{'ChatWebsiteId':_0x423dd3},'order':'priority'})[_0x121f('0x13')](function(_0x2408ea){_0x183edb=_0x2408ea;});}})[_0x121f('0x1d')](function(_0x1ce598){_0x4450af=0x1f4;logger['error'](_0x1ce598[_0x121f('0x10f')]);if(_0x1ce598[_0x121f('0x2a')]){delete _0x1ce598['name'];}_0x183edb=_0x1ce598;})[_0x121f('0x110')](function(){if(_0x183edb===null){_0xd163aa[_0x121f('0x1e')](_0x4450af);}else{if(_0x4450af===0x1f4){_0xd163aa['status'](_0x4450af)[_0x121f('0x2b')](_0x183edb);}else{_0xd163aa[_0x121f('0x1f')](_0x4450af)[_0x121f('0x21')](_0x183edb);}}});};exports[_0x121f('0x111')]=function(_0x4380ac,_0x364c58){var _0x3188e0={};var _0xe92762={};var _0x251b63;var _0x4e6736;return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x4380ac[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x364c58,null))['then'](function(_0x421c4c){if(_0x421c4c){_0x251b63=_0x421c4c;_0xe92762[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x90')][_0x121f('0x2f')]);_0xe92762[_0x121f('0x30')]=_[_0x121f('0x31')](_0x4380ac['query']);_0xe92762['filters']=_['intersection'](_0xe92762[_0x121f('0x34')],_0xe92762[_0x121f('0x30')]);_0x3188e0['attributes']=_[_0x121f('0x33')](_0xe92762[_0x121f('0x34')],qs[_0x121f('0x36')](_0x4380ac[_0x121f('0x30')][_0x121f('0x36')]));_0x3188e0[_0x121f('0x35')]=_0x3188e0[_0x121f('0x35')][_0x121f('0x37')]?_0x3188e0['attributes']:_0xe92762[_0x121f('0x34')];_0x3188e0[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x4380ac[_0x121f('0x30')][_0x121f('0x3b')]);_0x3188e0['where']=qs['filters'](_[_0x121f('0x3c')](_0x4380ac[_0x121f('0x30')],_0xe92762[_0x121f('0x32')]));if(_0x4380ac['query'][_0x121f('0x3d')]){_0x3188e0[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x3188e0['where'],{'$or':_[_0x121f('0x2d')](_0x3188e0[_0x121f('0x35')],function(_0x398763){var _0x445673={};_0x445673[_0x398763]={'$like':'%'+_0x4380ac[_0x121f('0x30')][_0x121f('0x3d')]+'%'};return _0x445673;})});}_0x3188e0=_[_0x121f('0x3e')]({},_0x3188e0,_0x4380ac['options']);return _0x251b63[_0x121f('0x111')](_0x3188e0);}})[_0x121f('0x13')](function(_0x5d5f7f){if(_0x5d5f7f){_0x4e6736=_0x5d5f7f[_0x121f('0x37')];if(!_0x4380ac[_0x121f('0x30')][_0x121f('0x38')](_0x121f('0x39'))){_0x3188e0['limit']=qs['limit'](_0x4380ac[_0x121f('0x30')][_0x121f('0x23')]);_0x3188e0[_0x121f('0x25')]=qs['offset'](_0x4380ac[_0x121f('0x30')][_0x121f('0x25')]);}return _0x251b63[_0x121f('0x111')](_0x3188e0);}})[_0x121f('0x13')](function(_0x4df533){if(_0x4df533){return _0x4df533?{'count':_0x4e6736,'rows':_0x4df533}:null;}})[_0x121f('0x13')](respondWithResult(_0x364c58,null))[_0x121f('0x1d')](handleError(_0x364c58,null));};exports['addProactiveActions']=function(_0x140247,_0x5c05c8){return db[_0x121f('0x112')]['find']({'where':{'id':_0x140247[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5c05c8,null))['then'](function(_0x5b90ea){if(_0x5b90ea){return _0x5b90ea[_0x121f('0x113')](_0x140247[_0x121f('0x4c')][_0x121f('0x5a')],_['omit'](_0x140247[_0x121f('0x4c')],[_0x121f('0x5a'),'id'])||{});}})[_0x121f('0x13')](respondWithResult(_0x5c05c8,null))[_0x121f('0x1d')](handleError(_0x5c05c8,null));};exports[_0x121f('0xfa')]=function(_0x1b5ab8,_0x141abc){var _0x550736={};var _0x2e916f={};var _0x5e9806;var _0x1ec903;return db['ChatWebsite'][_0x121f('0x56')]({'where':{'id':_0x1b5ab8[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x141abc,null))[_0x121f('0x13')](function(_0x9408b4){if(_0x9408b4){_0x5e9806=_0x9408b4;_0x2e916f[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x114')][_0x121f('0x2f')]);_0x2e916f['query']=_[_0x121f('0x31')](_0x1b5ab8[_0x121f('0x30')]);_0x2e916f[_0x121f('0x32')]=_['intersection'](_0x2e916f['model'],_0x2e916f[_0x121f('0x30')]);_0x550736[_0x121f('0x35')]=_[_0x121f('0x33')](_0x2e916f[_0x121f('0x34')],qs[_0x121f('0x36')](_0x1b5ab8[_0x121f('0x30')]['fields']));_0x550736[_0x121f('0x35')]=_0x550736[_0x121f('0x35')][_0x121f('0x37')]?_0x550736[_0x121f('0x35')]:_0x2e916f['model'];_0x550736[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x1b5ab8['query'][_0x121f('0x3b')]);_0x550736[_0x121f('0x3f')]=qs['filters'](_['pick'](_0x1b5ab8[_0x121f('0x30')],_0x2e916f['filters']));if(_0x1b5ab8[_0x121f('0x30')][_0x121f('0x3d')]){_0x550736[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x550736['where'],{'$or':_['map'](_0x550736[_0x121f('0x35')],function(_0xf075cb){var _0x20ba70={};_0x20ba70[_0xf075cb]={'$like':'%'+_0x1b5ab8[_0x121f('0x30')]['filter']+'%'};return _0x20ba70;})});}_0x550736=_[_0x121f('0x3e')]({},_0x550736,_0x1b5ab8['options']);return _0x5e9806[_0x121f('0xfa')](_0x550736);}})[_0x121f('0x13')](function(_0x40b3b3){if(_0x40b3b3){_0x1ec903=_0x40b3b3[_0x121f('0x37')];if(!_0x1b5ab8[_0x121f('0x30')][_0x121f('0x38')]('nolimit')){_0x550736[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x1b5ab8[_0x121f('0x30')][_0x121f('0x23')]);_0x550736['offset']=qs[_0x121f('0x25')](_0x1b5ab8[_0x121f('0x30')]['offset']);}return _0x5e9806[_0x121f('0xfa')](_0x550736);}})[_0x121f('0x13')](function(_0x143fe1){if(_0x143fe1){return _0x143fe1?{'count':_0x1ec903,'rows':_0x143fe1}:null;}})['then'](respondWithResult(_0x141abc,null))[_0x121f('0x1d')](handleError(_0x141abc,null));};exports[_0x121f('0x115')]=function(_0x43885e,_0x5bb44a){var _0x1b022b=_0x43885e['query'][_0x121f('0x116')]===_0x121f('0x117')?'offlineForm':_0x121f('0x118');return db[_0x121f('0x2e')][_0x121f('0x4a')]({'attributes':['id',_0x1b022b],'where':{'id':_0x43885e[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5bb44a,null))[_0x121f('0x13')](function(_0x1ea0c7){if(_0x1ea0c7){var _0x1cba67=_0x1ea0c7[_0x1b022b];var _0x326193=_0x1cba67&&_0x1cba67[_0x121f('0x119')]?_0x1cba67[_0x121f('0x119')]:[];_0x5bb44a[_0x121f('0x2b')]({'fromKey':_[_0x121f('0x78')](_0x1cba67['fromKey'])?undefined:_0x1cba67[_0x121f('0x11a')],'count':_0x326193[_0x121f('0x37')],'rows':_0x326193});}})[_0x121f('0x1d')](handleError(_0x5bb44a,null));};exports[_0x121f('0x11b')]=function(_0x132651,_0x349385){var _0x5aee2e={'raw':![],'where':{}};var _0x124972={};var _0x385d42={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x132651[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x349385,null))['then'](function(_0x4191ba){if(_0x4191ba){_0x124972['model']=_[_0x121f('0x31')](db[_0x121f('0xc6')]['rawAttributes']);_0x124972[_0x121f('0x30')]=_[_0x121f('0x31')](_0x132651[_0x121f('0x30')]);_0x124972[_0x121f('0x32')]=_[_0x121f('0x33')](_0x124972['model'],_0x124972[_0x121f('0x30')]);_0x5aee2e[_0x121f('0x35')]=_[_0x121f('0x33')](_0x124972['model'],qs[_0x121f('0x36')](_0x132651[_0x121f('0x30')][_0x121f('0x36')]));_0x5aee2e[_0x121f('0x35')]=_0x5aee2e[_0x121f('0x35')]['length']?_0x5aee2e['attributes']:_0x124972['model'];if(!_0x132651[_0x121f('0x30')][_0x121f('0x38')]('nolimit')){_0x5aee2e[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x132651['query']['limit']);_0x5aee2e['offset']=qs[_0x121f('0x25')](_0x132651[_0x121f('0x30')][_0x121f('0x25')]);}_0x5aee2e['order']=qs['sort'](_0x132651[_0x121f('0x30')][_0x121f('0x3b')]);_0x5aee2e['where']=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x132651['query'],_0x124972[_0x121f('0x32')]));_0x5aee2e[_0x121f('0x3f')][_0x121f('0x5c')]=_0x4191ba['id'];if(_0x132651[_0x121f('0x30')][_0x121f('0x3d')]){_0x5aee2e[_0x121f('0x3f')]=_['merge'](_0x5aee2e[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x5aee2e[_0x121f('0x35')],function(_0x205aae){var _0x478e03={};_0x478e03[_0x205aae]={'$like':'%'+_0x132651[_0x121f('0x30')]['filter']+'%'};return _0x478e03;})});}_0x5aee2e=_[_0x121f('0x3e')]({},_0x5aee2e,_0x132651['options']);return db[_0x121f('0xc6')][_0x121f('0x24')]({'where':_0x5aee2e[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x10e88a){_0x385d42[_0x121f('0x24')]=_0x10e88a;if(_0x132651[_0x121f('0x30')][_0x121f('0x43')]){_0x5aee2e[_0x121f('0x44')]=[{'all':!![]}];}else{_0x5aee2e[_0x121f('0x44')]=[{'model':db[_0x121f('0x96')],'as':'Contact','required':![]},{'model':db[_0x121f('0x11c')],'as':_0x121f('0x11d'),'required':![]}];}return db[_0x121f('0xc6')][_0x121f('0x58')](_0x5aee2e);})[_0x121f('0x13')](function(_0x42e9af){_0x385d42[_0x121f('0x45')]=_0x42e9af;return _0x385d42;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x349385,_0x5aee2e))[_0x121f('0x1d')](handleError(_0x349385,null));};exports[_0x121f('0x11e')]=function(_0x495131,_0x315382){return db[_0x121f('0x2e')]['find']({'where':{'id':_0x495131[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x315382,null))[_0x121f('0x13')](function(_0x3d3b5d){if(_0x3d3b5d){return _0x3d3b5d[_0x121f('0x11e')](_0x495131[_0x121f('0x4c')][_0x121f('0x5a')],_[_0x121f('0xe3')](_0x495131[_0x121f('0x4c')],['ids','id'])||{})[_0x121f('0xad')](function(_0x4b0b5f){for(var _0x324caa=0x0;_0x324caa<_0x495131['body'][_0x121f('0x5a')][_0x121f('0x37')];_0x324caa+=0x1){socket[_0x121f('0x11f')](_0x121f('0x120'),{'UserId':Number(_0x495131['body'][_0x121f('0x5a')][_0x324caa]),'ChatWebsiteId':Number(_0x495131[_0x121f('0x47')]['id'])});}return _0x4b0b5f;});}})[_0x121f('0x13')](respondWithResult(_0x315382,null))[_0x121f('0x1d')](handleError(_0x315382,null));};exports[_0x121f('0x121')]=function(_0x46946e,_0x59cb46){return db[_0x121f('0x2e')]['find']({'where':{'id':_0x46946e['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x59cb46,null))[_0x121f('0x13')](function(_0x296bb6){if(_0x296bb6){return _0x296bb6['removeAgents'](_0x46946e['query'][_0x121f('0x5a')])['then'](function(){if(_[_0x121f('0x122')](_0x46946e[_0x121f('0x30')]['ids'])){for(var _0x50ae75=0x0;_0x50ae75<_0x46946e['query'][_0x121f('0x5a')][_0x121f('0x37')];_0x50ae75+=0x1){socket[_0x121f('0x11f')](_0x121f('0x123'),{'UserId':Number(_0x46946e[_0x121f('0x30')][_0x121f('0x5a')][_0x50ae75]),'ChatWebsiteId':Number(_0x46946e[_0x121f('0x47')]['id'])});}}else{socket[_0x121f('0x11f')](_0x121f('0x123'),{'UserId':Number(_0x46946e[_0x121f('0x30')]['ids']),'ChatWebsiteId':Number(_0x46946e[_0x121f('0x47')]['id'])});}});}})[_0x121f('0x13')](respondWithStatusCode(_0x59cb46,null))[_0x121f('0x1d')](handleError(_0x59cb46,null));};exports[_0x121f('0x124')]=function(_0x2e73de,_0x28c904){var _0x461d32={};var _0x47c3de={};var _0x1cb96e;var _0x3af06b;return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x2e73de[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x28c904,null))[_0x121f('0x13')](function(_0xcc1df6){if(_0xcc1df6){_0x1cb96e=_0xcc1df6;_0x47c3de[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0xb4')][_0x121f('0x2f')]);_0x47c3de['query']=_[_0x121f('0x31')](_0x2e73de[_0x121f('0x30')]);_0x47c3de[_0x121f('0x32')]=_['intersection'](_0x47c3de[_0x121f('0x34')],_0x47c3de[_0x121f('0x30')]);_0x461d32[_0x121f('0x35')]=_['intersection'](_0x47c3de[_0x121f('0x34')],qs[_0x121f('0x36')](_0x2e73de[_0x121f('0x30')][_0x121f('0x36')]));_0x461d32[_0x121f('0x35')]=_0x461d32['attributes'][_0x121f('0x37')]?_0x461d32[_0x121f('0x35')]:_0x47c3de[_0x121f('0x34')];_0x461d32[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x2e73de[_0x121f('0x30')][_0x121f('0x3b')]);_0x461d32['where']=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x2e73de[_0x121f('0x30')],_0x47c3de[_0x121f('0x32')]));if(_0x2e73de[_0x121f('0x30')][_0x121f('0x3d')]){_0x461d32[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x461d32[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x461d32['attributes'],function(_0x37320d){var _0x4a6dff={};_0x4a6dff[_0x37320d]={'$like':'%'+_0x2e73de['query'][_0x121f('0x3d')]+'%'};return _0x4a6dff;})});}_0x461d32=_[_0x121f('0x3e')]({},_0x461d32,_0x2e73de[_0x121f('0x42')]);return _0x1cb96e[_0x121f('0x124')](_0x461d32);}})[_0x121f('0x13')](function(_0x25bcd9){if(_0x25bcd9){_0x3af06b=_0x25bcd9[_0x121f('0x37')];if(!_0x2e73de['query'][_0x121f('0x38')](_0x121f('0x39'))){_0x461d32[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x2e73de[_0x121f('0x30')][_0x121f('0x23')]);_0x461d32[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x2e73de[_0x121f('0x30')][_0x121f('0x25')]);}return _0x1cb96e[_0x121f('0x124')](_0x461d32);}})['then'](function(_0x3fd9f7){if(_0x3fd9f7){return _0x3fd9f7?{'count':_0x3af06b,'rows':_0x3fd9f7}:null;}})['then'](respondWithResult(_0x28c904,null))[_0x121f('0x1d')](handleError(_0x28c904,null));};
\ No newline at end of file
+var _0xf76f=['online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','ChatWebsites','stack','name','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','nolimit','removeAnswers','file','addAvatar','agentAvatar','addCustomerAvatar','filename','addSystemAvatar','systemAvatar','join','root','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','list','orderBy','applications','priority','account','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','originalname','mimetype','subjectOffline','toPairsIn','lastName','email','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','getProactiveActions','License','increment','chatLicenseExceeded','Intervals','some','remote','connection','virtual','replace','alignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields'];(function(_0x437d62,_0xe7d06d){var _0x1b1151=function(_0xde71ff){while(--_0xde71ff){_0x437d62['push'](_0x437d62['shift']());}};_0x1b1151(++_0xe7d06d);}(_0xf76f,0x13b));var _0xff76=function(_0x4dcfbb,_0x170c85){_0x4dcfbb=_0x4dcfbb-0x0;var _0x1d02cd=_0xf76f[_0x4dcfbb];return _0x1d02cd;};'use strict';var BPromise=require(_0xff76('0x0'));var Mustache=require(_0xff76('0x1'));var util=require('util');var path=require(_0xff76('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff76('0x3'));var _=require(_0xff76('0x4'));var querystring=require('querystring');var Redis=require(_0xff76('0x5'));var qs=require(_0xff76('0x6'));var logger=require(_0xff76('0x7'))('api');var config=require(_0xff76('0x8'));var db=require(_0xff76('0x9'))['db'];config[_0xff76('0xa')]=_[_0xff76('0xb')](config[_0xff76('0xa')],{'host':_0xff76('0xc'),'port':0x18eb});var socket=require(_0xff76('0xd'))(new Redis(config[_0xff76('0xa')]));require('./chatWebsite.socket')[_0xff76('0xe')](socket);var jayson=require(_0xff76('0xf'));var client=jayson[_0xff76('0x10')][_0xff76('0x11')]({'port':0x232c});var client9002=jayson['client'][_0xff76('0x11')]({'port':0x232a});var client9003=jayson[_0xff76('0x10')]['http']({'port':0x232b});var client9001=jayson[_0xff76('0x10')][_0xff76('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x376946,_0x57a70f,_0x49c12d,_0x2b09da){return new BPromise(function(_0x5c2812,_0xd07949){var _0x4ac048=_0x2b09da||client;return _0x4ac048['request'](_0x376946,_0x49c12d)[_0xff76('0x12')](function(_0x8f8304){logger[_0xff76('0x13')](_0xff76('0x14'),_0x57a70f,'request\x20sent');logger[_0xff76('0x15')](_0xff76('0x16'),_0x57a70f,_0xff76('0x17'),JSON[_0xff76('0x18')](_0x8f8304));if(_0x8f8304[_0xff76('0x19')]){if(_0x8f8304[_0xff76('0x19')][_0xff76('0x1a')]===0x1f4){logger[_0xff76('0x19')](_0xff76('0x14'),_0x57a70f,_0x8f8304[_0xff76('0x19')][_0xff76('0x1b')]);return _0xd07949(_0x8f8304[_0xff76('0x19')]['message']);}logger[_0xff76('0x19')](_0xff76('0x14'),_0x57a70f,_0x8f8304['error'][_0xff76('0x1b')]);return _0x5c2812(_0x8f8304['error']['message']);}else{logger[_0xff76('0x13')](_0xff76('0x14'),_0x57a70f,_0xff76('0x17'));_0x5c2812(_0x8f8304[_0xff76('0x1c')][_0xff76('0x1b')]);}})[_0xff76('0x1d')](function(_0x3585e2){logger[_0xff76('0x19')](_0xff76('0x14'),_0x57a70f,_0x3585e2);_0xd07949(_0x3585e2);});});}function respondWithStatusCode(_0x16bf92,_0x21abab){_0x21abab=_0x21abab||0xcc;return function(_0x48df3f){if(_0x48df3f){return _0x16bf92[_0xff76('0x1e')](_0x21abab);}return _0x16bf92[_0xff76('0x1f')](_0x21abab)[_0xff76('0x20')]();};}function respondWithResult(_0x582cf7,_0x41e0a7){_0x41e0a7=_0x41e0a7||0xc8;return function(_0xb09462){if(_0xb09462){return _0x582cf7['status'](_0x41e0a7)[_0xff76('0x21')](_0xb09462);}};}function respondWithFilteredResult(_0x37ef75,_0x187bc3){return function(_0x42c08b){if(_0x42c08b){var _0x1026d0=typeof _0x187bc3[_0xff76('0x22')]===_0xff76('0x23')&&typeof _0x187bc3[_0xff76('0x24')]===_0xff76('0x23');var _0x5d3ae9=_0x42c08b['count'];var _0x328bcf=_0x1026d0?0x0:_0x187bc3[_0xff76('0x22')];var _0x24e79d=_0x1026d0?_0x42c08b[_0xff76('0x25')]:_0x187bc3['offset']+_0x187bc3[_0xff76('0x24')];var _0x5c7db2;if(_0x24e79d>=_0x5d3ae9){_0x24e79d=_0x5d3ae9;_0x5c7db2=0xc8;}else{_0x5c7db2=0xce;}_0x37ef75[_0xff76('0x1f')](_0x5c7db2);return _0x37ef75['set'](_0xff76('0x26'),_0x328bcf+'-'+_0x24e79d+'/'+_0x5d3ae9)[_0xff76('0x21')](_0x42c08b);}return null;};}function saveUpdates(_0x460f45){return function(_0x4ffc90){if(_0x4ffc90){return _0x4ffc90[_0xff76('0x27')](_0x460f45)[_0xff76('0x12')](function(_0x4e4cc3){return _0x4e4cc3;});}return null;};}function removeEntity(_0x618350){return function(_0x17ee30){if(_0x17ee30){return _0x17ee30[_0xff76('0x28')]()[_0xff76('0x12')](function(){var _0x1b1842=_0x17ee30['get']({'plain':!![]});var _0x12e64f=_0xff76('0x29');return db['UserProfileResource'][_0xff76('0x28')]({'where':{'type':_0x12e64f,'resourceId':_0x1b1842['id']}})[_0xff76('0x12')](function(){return _0x17ee30;});})['then'](function(){_0x618350['status'](0xcc)[_0xff76('0x20')]();});}};}function handleEntityNotFound(_0x536a0c){return function(_0x8298d4){if(!_0x8298d4){_0x536a0c[_0xff76('0x1e')](0x194);}return _0x8298d4;};}function handleError(_0x54909a,_0xfe6c41){_0xfe6c41=_0xfe6c41||0x1f4;return function(_0xc26810){logger['error'](_0xc26810[_0xff76('0x2a')]);if(_0xc26810[_0xff76('0x2b')]){delete _0xc26810[_0xff76('0x2b')];}_0x54909a['status'](_0xfe6c41)['send'](_0xc26810);};}exports[_0xff76('0x2c')]=function(_0x2420f5,_0x407cd7){var _0xf494a6={'include':[{'model':db['Pause'],'as':_0xff76('0x2d')}]},_0x4d09f1={},_0x10e557={'count':0x0,'rows':[]};var _0x37b008=_[_0xff76('0x2e')](db[_0xff76('0x2f')][_0xff76('0x30')],function(_0x34888d){return{'name':_0x34888d['fieldName'],'type':_0x34888d[_0xff76('0x31')]['key']};});_0x4d09f1[_0xff76('0x32')]=_[_0xff76('0x2e')](_0x37b008,'name');_0x4d09f1['query']=_[_0xff76('0x33')](_0x2420f5[_0xff76('0x34')]);_0x4d09f1[_0xff76('0x35')]=_['intersection'](_0x4d09f1[_0xff76('0x32')],_0x4d09f1['query']);_0xf494a6[_0xff76('0x36')]=_[_0xff76('0x37')](_0x4d09f1[_0xff76('0x32')],qs[_0xff76('0x38')](_0x2420f5[_0xff76('0x34')][_0xff76('0x38')]));_0xf494a6[_0xff76('0x36')]=_0xf494a6[_0xff76('0x36')]['length']?_0xf494a6['attributes']:_0x4d09f1['model'];if(!_0x2420f5['query'][_0xff76('0x39')]('nolimit')){_0xf494a6[_0xff76('0x24')]=qs[_0xff76('0x24')](_0x2420f5[_0xff76('0x34')][_0xff76('0x24')]);_0xf494a6['offset']=qs[_0xff76('0x22')](_0x2420f5[_0xff76('0x34')][_0xff76('0x22')]);}_0xf494a6[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x2420f5['query']['sort']);_0xf494a6[_0xff76('0x3c')]=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0x2420f5[_0xff76('0x34')],_0x4d09f1[_0xff76('0x35')]),_0x37b008);if(_0x2420f5[_0xff76('0x34')][_0xff76('0x3e')]){_0xf494a6[_0xff76('0x3c')]=_[_0xff76('0x3f')](_0xf494a6[_0xff76('0x3c')],{'$or':_[_0xff76('0x2e')](_0x37b008,function(_0x106dce){if(_0x106dce[_0xff76('0x31')]!==_0xff76('0x40')){var _0x36b262={};_0x36b262[_0x106dce['name']]={'$like':'%'+_0x2420f5[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x36b262;}})});}_0xf494a6=_['merge']({},_0xf494a6,_0x2420f5['options']);var _0x20a5fd={'where':_0xf494a6[_0xff76('0x3c')]};return db[_0xff76('0x2f')][_0xff76('0x25')](_0x20a5fd)[_0xff76('0x12')](function(_0x2bfa76){_0x10e557['count']=_0x2bfa76;if(_0x2420f5[_0xff76('0x34')][_0xff76('0x41')]){_0xf494a6[_0xff76('0x42')]=[{'all':!![]}];}return db[_0xff76('0x2f')]['findAll'](_0xf494a6);})[_0xff76('0x12')](function(_0x2e9e4c){_0x10e557[_0xff76('0x43')]=_0x2e9e4c;return _0x10e557;})[_0xff76('0x12')](respondWithFilteredResult(_0x407cd7,_0xf494a6))['catch'](handleError(_0x407cd7,null));};exports[_0xff76('0x44')]=function(_0xe64d70,_0x2f2bf0){var _0x702b36={'raw':![],'where':{'id':_0xe64d70[_0xff76('0x45')]['id']},'include':[{'model':db['Pause'],'as':_0xff76('0x2d')}]},_0xd2b59a={};_0xd2b59a[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0x2f')][_0xff76('0x30')]);_0xd2b59a['query']=_['keys'](_0xe64d70['query']);_0xd2b59a[_0xff76('0x35')]=_['intersection'](_0xd2b59a[_0xff76('0x32')],_0xd2b59a[_0xff76('0x34')]);_0x702b36[_0xff76('0x36')]=_[_0xff76('0x37')](_0xd2b59a[_0xff76('0x32')],qs['fields'](_0xe64d70[_0xff76('0x34')][_0xff76('0x38')]));_0x702b36[_0xff76('0x36')]=_0x702b36[_0xff76('0x36')][_0xff76('0x46')]?_0x702b36[_0xff76('0x36')]:_0xd2b59a['model'];if(_0xe64d70[_0xff76('0x34')][_0xff76('0x41')]){_0x702b36[_0xff76('0x42')]=[{'all':!![]}];}_0x702b36=_[_0xff76('0x3f')]({},_0x702b36,_0xe64d70[_0xff76('0x47')]);return db[_0xff76('0x2f')][_0xff76('0x48')](_0x702b36)[_0xff76('0x12')](handleEntityNotFound(_0x2f2bf0,null))[_0xff76('0x12')](respondWithResult(_0x2f2bf0,null))['catch'](handleError(_0x2f2bf0,null));};exports[_0xff76('0x49')]=function(_0x36dd0c,_0x36b7e5){return db[_0xff76('0x2f')]['create'](_0x36dd0c['body'],{})[_0xff76('0x12')](function(_0x2c8c9f){var _0x17e150=_0x36dd0c[_0xff76('0x4a')][_0xff76('0x4b')]({'plain':!![]});if(!_0x17e150)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17e150[_0xff76('0x4c')]==='user'){var _0x1c1cdd=_0x2c8c9f['get']({'plain':!![]});var _0x1a9f5b=_0xff76('0x29');return db[_0xff76('0x4d')][_0xff76('0x48')]({'where':{'name':_0x1a9f5b,'userProfileId':_0x17e150[_0xff76('0x4e')]},'raw':!![]})['then'](function(_0x2e508a){if(_0x2e508a&&_0x2e508a[_0xff76('0x4f')]===0x0){return db[_0xff76('0x50')]['create']({'name':_0x1c1cdd[_0xff76('0x2b')],'resourceId':_0x1c1cdd['id'],'type':_0x2e508a[_0xff76('0x2b')],'sectionId':_0x2e508a['id']},{})[_0xff76('0x12')](function(){return _0x2c8c9f;});}else{return _0x2c8c9f;}})[_0xff76('0x1d')](function(_0xde95bd){logger[_0xff76('0x19')](_0xff76('0x51'),_0xde95bd);throw _0xde95bd;});}return _0x2c8c9f;})[_0xff76('0x12')](respondWithResult(_0x36b7e5,0xc9))[_0xff76('0x1d')](handleError(_0x36b7e5,null));};exports[_0xff76('0x27')]=function(_0x5ef2a6,_0x194fa8){if(_0x5ef2a6[_0xff76('0x52')]['id']){delete _0x5ef2a6[_0xff76('0x52')]['id'];}return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x5ef2a6['params']['id']},'include':[{'model':db[_0xff76('0x53')],'as':_0xff76('0x2d')}]})['then'](handleEntityNotFound(_0x194fa8,null))['then'](saveUpdates(_0x5ef2a6[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x194fa8,null))[_0xff76('0x1d')](handleError(_0x194fa8,null));};exports[_0xff76('0x28')]=function(_0x3b1314,_0x1ff75f){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x3b1314[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x1ff75f,null))[_0xff76('0x12')](removeEntity(_0x1ff75f,null))['catch'](handleError(_0x1ff75f,null));};exports[_0xff76('0x54')]=function(_0x5e0cf3,_0x5a1ce8){return db[_0xff76('0x2f')][_0xff76('0x54')]()['then'](respondWithResult(_0x5a1ce8,null))[_0xff76('0x1d')](handleError(_0x5a1ce8,null));};exports['addDisposition']=function(_0x563895,_0x224c84){if(_0x563895[_0xff76('0x52')]['id']){delete _0x563895['body']['id'];}return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x563895[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x224c84,null))[_0xff76('0x12')](function(_0x128350){if(_0x128350){_0x563895[_0xff76('0x52')][_0xff76('0x55')]=_0x128350['id'];return db[_0xff76('0x56')]['create'](_0x563895[_0xff76('0x52')]);}})[_0xff76('0x12')](respondWithResult(_0x224c84,null))['catch'](handleError(_0x224c84,null));};exports[_0xff76('0x57')]=function(_0xa9d0b5,_0x214120){var _0x3da646={'raw':![],'where':{}};var _0x2ac5d2={};var _0x3a02c3={'count':0x0,'rows':[]};return db[_0xff76('0x2f')]['findOne']({'where':{'id':_0xa9d0b5[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x214120,null))[_0xff76('0x12')](function(_0x483693){if(_0x483693){_0x2ac5d2[_0xff76('0x32')]=_[_0xff76('0x33')](db['Disposition'][_0xff76('0x30')]);_0x2ac5d2[_0xff76('0x34')]=_[_0xff76('0x33')](_0xa9d0b5[_0xff76('0x34')]);_0x2ac5d2[_0xff76('0x35')]=_['intersection'](_0x2ac5d2['model'],_0x2ac5d2[_0xff76('0x34')]);_0x3da646[_0xff76('0x36')]=_[_0xff76('0x37')](_0x2ac5d2[_0xff76('0x32')],qs[_0xff76('0x38')](_0xa9d0b5[_0xff76('0x34')][_0xff76('0x38')]));_0x3da646[_0xff76('0x36')]=_0x3da646[_0xff76('0x36')][_0xff76('0x46')]?_0x3da646[_0xff76('0x36')]:_0x2ac5d2[_0xff76('0x32')];if(!_0xa9d0b5[_0xff76('0x34')][_0xff76('0x39')]('nolimit')){_0x3da646[_0xff76('0x24')]=qs[_0xff76('0x24')](_0xa9d0b5[_0xff76('0x34')][_0xff76('0x24')]);_0x3da646[_0xff76('0x22')]=qs[_0xff76('0x22')](_0xa9d0b5[_0xff76('0x34')][_0xff76('0x22')]);}_0x3da646[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0xa9d0b5['query'][_0xff76('0x3b')]);_0x3da646[_0xff76('0x3c')]=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0xa9d0b5[_0xff76('0x34')],_0x2ac5d2['filters']));_0x3da646[_0xff76('0x3c')][_0xff76('0x55')]=_0x483693['id'];if(_0xa9d0b5['query'][_0xff76('0x3e')]){_0x3da646['where']=_['merge'](_0x3da646['where'],{'$or':_[_0xff76('0x2e')](_0x3da646['attributes'],function(_0x973aea){var _0x4907d2={};_0x4907d2[_0x973aea]={'$like':'%'+_0xa9d0b5[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x4907d2;})});}_0x3da646=_[_0xff76('0x3f')]({},_0x3da646,_0xa9d0b5[_0xff76('0x47')]);return db[_0xff76('0x56')][_0xff76('0x25')]({'where':_0x3da646[_0xff76('0x3c')]})[_0xff76('0x12')](function(_0x1660a6){_0x3a02c3[_0xff76('0x25')]=_0x1660a6;if(_0xa9d0b5['query'][_0xff76('0x41')]){_0x3da646[_0xff76('0x42')]=[{'all':!![]}];}return db[_0xff76('0x56')][_0xff76('0x58')](_0x3da646);})[_0xff76('0x12')](function(_0x1288ac){_0x3a02c3[_0xff76('0x43')]=_0x1288ac;return _0x3a02c3;});}})[_0xff76('0x12')](respondWithFilteredResult(_0x214120,_0x3da646))['catch'](handleError(_0x214120,null));};exports['removeDispositions']=function(_0xa02b65,_0xce6686){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0xa02b65['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0xce6686,null))[_0xff76('0x12')](function(_0x7c965f){if(_0x7c965f){return _0x7c965f[_0xff76('0x59')](_0xa02b65['query'][_0xff76('0x5a')]);}})[_0xff76('0x12')](respondWithStatusCode(_0xce6686,null))[_0xff76('0x1d')](handleError(_0xce6686,null));};exports[_0xff76('0x5b')]=function(_0x5c4fdc,_0x273caf){if(_0x5c4fdc[_0xff76('0x52')]['id']){delete _0x5c4fdc[_0xff76('0x52')]['id'];}return db[_0xff76('0x2f')]['find']({'where':{'id':_0x5c4fdc[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x273caf,null))['then'](function(_0x493232){if(_0x493232){_0x5c4fdc[_0xff76('0x52')][_0xff76('0x55')]=_0x493232['id'];return db[_0xff76('0x5c')][_0xff76('0x49')](_0x5c4fdc[_0xff76('0x52')]);}})['then'](respondWithResult(_0x273caf,null))[_0xff76('0x1d')](handleError(_0x273caf,null));};exports['getAnswers']=function(_0x5c3976,_0x3dbe76){var _0x565a72={'raw':![],'where':{}};var _0x2c269c={};var _0x140719={'count':0x0,'rows':[]};return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x5c3976[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x3dbe76,null))[_0xff76('0x12')](function(_0x5936ad){if(_0x5936ad){_0x2c269c['model']=_[_0xff76('0x33')](db[_0xff76('0x5c')]['rawAttributes']);_0x2c269c[_0xff76('0x34')]=_[_0xff76('0x33')](_0x5c3976[_0xff76('0x34')]);_0x2c269c['filters']=_[_0xff76('0x37')](_0x2c269c[_0xff76('0x32')],_0x2c269c[_0xff76('0x34')]);_0x565a72[_0xff76('0x36')]=_[_0xff76('0x37')](_0x2c269c[_0xff76('0x32')],qs[_0xff76('0x38')](_0x5c3976[_0xff76('0x34')]['fields']));_0x565a72[_0xff76('0x36')]=_0x565a72[_0xff76('0x36')]['length']?_0x565a72[_0xff76('0x36')]:_0x2c269c[_0xff76('0x32')];if(!_0x5c3976[_0xff76('0x34')]['hasOwnProperty'](_0xff76('0x5e'))){_0x565a72['limit']=qs[_0xff76('0x24')](_0x5c3976[_0xff76('0x34')][_0xff76('0x24')]);_0x565a72['offset']=qs[_0xff76('0x22')](_0x5c3976[_0xff76('0x34')][_0xff76('0x22')]);}_0x565a72['order']=qs[_0xff76('0x3b')](_0x5c3976['query'][_0xff76('0x3b')]);_0x565a72[_0xff76('0x3c')]=qs['filters'](_[_0xff76('0x3d')](_0x5c3976[_0xff76('0x34')],_0x2c269c[_0xff76('0x35')]));_0x565a72[_0xff76('0x3c')][_0xff76('0x55')]=_0x5936ad['id'];if(_0x5c3976[_0xff76('0x34')][_0xff76('0x3e')]){_0x565a72[_0xff76('0x3c')]=_['merge'](_0x565a72[_0xff76('0x3c')],{'$or':_[_0xff76('0x2e')](_0x565a72[_0xff76('0x36')],function(_0x24b219){var _0x5f21cb={};_0x5f21cb[_0x24b219]={'$like':'%'+_0x5c3976[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x5f21cb;})});}_0x565a72=_[_0xff76('0x3f')]({},_0x565a72,_0x5c3976[_0xff76('0x47')]);return db[_0xff76('0x5c')][_0xff76('0x25')]({'where':_0x565a72['where']})[_0xff76('0x12')](function(_0xf3a78a){_0x140719[_0xff76('0x25')]=_0xf3a78a;if(_0x5c3976[_0xff76('0x34')][_0xff76('0x41')]){_0x565a72[_0xff76('0x42')]=[{'all':!![]}];}return db[_0xff76('0x5c')][_0xff76('0x58')](_0x565a72);})['then'](function(_0x5f2e2e){_0x140719[_0xff76('0x43')]=_0x5f2e2e;return _0x140719;});}})[_0xff76('0x12')](respondWithFilteredResult(_0x3dbe76,_0x565a72))[_0xff76('0x1d')](handleError(_0x3dbe76,null));};exports[_0xff76('0x5f')]=function(_0x12bf1e,_0x548b10){return db['ChatWebsite']['find']({'where':{'id':_0x12bf1e[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x548b10,null))[_0xff76('0x12')](function(_0x3308e0){if(_0x3308e0){return _0x3308e0[_0xff76('0x5f')](_0x12bf1e[_0xff76('0x34')][_0xff76('0x5a')]);}})[_0xff76('0x12')](respondWithStatusCode(_0x548b10,null))[_0xff76('0x1d')](handleError(_0x548b10,null));};exports['addLogo']=function(_0x455048,_0x4d6907){_0x455048[_0xff76('0x52')]['sitepic']=_0x455048[_0xff76('0x60')]['filename'];return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x455048[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x4d6907,null))[_0xff76('0x12')](saveUpdates(_0x455048['body'],null))[_0xff76('0x12')](respondWithResult(_0x4d6907,null))[_0xff76('0x1d')](handleError(_0x4d6907,null));};exports[_0xff76('0x61')]=function(_0xaeb944,_0x182161){_0xaeb944[_0xff76('0x52')][_0xff76('0x62')]=_0xaeb944[_0xff76('0x60')]['filename'];return db[_0xff76('0x2f')]['find']({'where':{'id':_0xaeb944['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x182161,null))[_0xff76('0x12')](saveUpdates(_0xaeb944[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x182161,null))['catch'](handleError(_0x182161,null));};exports[_0xff76('0x63')]=function(_0x36002c,_0x5c0d44){_0x36002c[_0xff76('0x52')]['customerAvatar']=_0x36002c['file'][_0xff76('0x64')];return db['ChatWebsite'][_0xff76('0x48')]({'where':{'id':_0x36002c['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x5c0d44,null))[_0xff76('0x12')](saveUpdates(_0x36002c[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x5c0d44,null))[_0xff76('0x1d')](handleError(_0x5c0d44,null));};exports[_0xff76('0x65')]=function(_0x545011,_0x4dfc36){_0x545011[_0xff76('0x52')][_0xff76('0x66')]=_0x545011[_0xff76('0x60')]['filename'];return db['ChatWebsite'][_0xff76('0x48')]({'where':{'id':_0x545011[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x4dfc36,null))[_0xff76('0x12')](saveUpdates(_0x545011[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x4dfc36,null))[_0xff76('0x1d')](handleError(_0x4dfc36,null));};exports['getLogo']=function(_0x501bd9,_0x262939){var _0x3dfb83=path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/images/logos/default_logo.svg');var _0x5d56fc={'where':{'id':_0x501bd9[_0xff76('0x45')]['id']},'attributes':['id',_0xff76('0x69')],'raw':!![]};var _0x23f579=![];return require(_0xff76('0x6a'))[_0xff76('0x6b')]()[_0xff76('0x12')](function(_0x4f061b){if(_0x4f061b){_0x23f579=_0x4f061b[_0xff76('0x6c')];}})['then'](function(){return db['ChatWebsite'][_0xff76('0x48')](_0x5d56fc);})[_0xff76('0x12')](handleEntityNotFound(_0x262939,null))[_0xff76('0x12')](function(_0x60ac86){if(_0x60ac86){if(!_[_0xff76('0x6d')](_0x60ac86['sitepic'])){if(fs[_0xff76('0x6e')](path['join'](config[_0xff76('0x68')],_0xff76('0x6f'),_0x60ac86[_0xff76('0x69')]))&&_0x23f579){_0x3dfb83=path[_0xff76('0x67')](config[_0xff76('0x68')],_0xff76('0x6f'),_0x60ac86[_0xff76('0x69')]);}}return _0x262939[_0xff76('0x70')](_0x3dfb83);}})[_0xff76('0x1d')](handleError(_0x262939,null));};exports[_0xff76('0x71')]=function(_0x150432,_0x2e117f){var _0x1d05a1=path[_0xff76('0x67')](config['root'],_0xff76('0x72'));var _0x5ee470={'where':{'id':_0x150432['params']['id']},'attributes':['id',_0xff76('0x62')],'raw':!![]};return db[_0xff76('0x2f')]['find'](_0x5ee470)['then'](handleEntityNotFound(_0x2e117f,null))['then'](function(_0x54c2bf){if(_0x54c2bf){if(!_[_0xff76('0x6d')](_0x54c2bf[_0xff76('0x62')])){if(fs['existsSync'](path['join'](config[_0xff76('0x68')],'server/files/images/avatars/',_0x54c2bf[_0xff76('0x62')]))){_0x1d05a1=path['join'](config[_0xff76('0x68')],_0xff76('0x73'),_0x54c2bf[_0xff76('0x62')]);}}return _0x2e117f[_0xff76('0x70')](_0x1d05a1);}})[_0xff76('0x1d')](handleError(_0x2e117f,null));};exports[_0xff76('0x74')]=function(_0x4db541,_0x1a5a04){var _0x498f8a=path[_0xff76('0x67')](config['root'],_0xff76('0x75'));var _0x29c33f={'where':{'id':_0x4db541['params']['id']},'attributes':['id','customerAvatar',_0xff76('0x76')],'raw':!![]};return db[_0xff76('0x2f')][_0xff76('0x48')](_0x29c33f)[_0xff76('0x12')](handleEntityNotFound(_0x1a5a04,null))['then'](function(_0x94152d){if(_0x94152d){if(!_['isNil'](_0x94152d[_0xff76('0x77')])){if(fs[_0xff76('0x6e')](path[_0xff76('0x67')](config[_0xff76('0x68')],_0xff76('0x73'),_0x94152d['customerAvatar']))&&_0x94152d[_0xff76('0x76')]){_0x498f8a=path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/images/avatars/',_0x94152d['customerAvatar']);}}return _0x1a5a04[_0xff76('0x70')](_0x498f8a);}})[_0xff76('0x1d')](handleError(_0x1a5a04,null));};exports[_0xff76('0x78')]=function(_0x5ee5dc,_0x1c5051){var _0xc8293c=path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/images/avatars/system_avatar.png');var _0xcc3315={'where':{'id':_0x5ee5dc[_0xff76('0x45')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xff76('0x2f')]['find'](_0xcc3315)[_0xff76('0x12')](handleEntityNotFound(_0x1c5051,null))[_0xff76('0x12')](function(_0x38de8d){if(_0x38de8d){if(!_['isNil'](_0x38de8d[_0xff76('0x66')])){if(fs[_0xff76('0x6e')](path['join'](config[_0xff76('0x68')],_0xff76('0x73'),_0x38de8d['systemAvatar']))){_0xc8293c=path[_0xff76('0x67')](config['root'],_0xff76('0x73'),_0x38de8d[_0xff76('0x66')]);}}return _0x1c5051['download'](_0xc8293c);}})[_0xff76('0x1d')](handleError(_0x1c5051,null));};exports['notify']=function(_0x3084ba,_0x3eab89){var _0x652683=require(_0xff76('0x79'));var _0x3b3e6d=new _0x652683();var _0x224e72=_0x3b3e6d[_0xff76('0x7a')](_0x3084ba[_0xff76('0x7b')][_0xff76('0x7c')])[_0xff76('0x7d')]();var _0x251964={'body':_0x3084ba[_0xff76('0x52')],'channel':_0xff76('0x7e')};var _0x4090fb=[];var _0xff0a50=[];var _0x1418aa={};var _0x29b229=![];return db[_0xff76('0x7f')][_0xff76('0x54')]()[_0xff76('0x12')](function(_0x188aa5){if(!_0x188aa5){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))]('no\x20available\x20attributes');}_0x4090fb=_[_0xff76('0x82')](_[_0xff76('0x33')](_0x188aa5),[_0xff76('0x83'),_0xff76('0x84')]);_0xff0a50=_[_0xff76('0x82')](_[_0xff76('0x33')](_0x188aa5),[_0xff76('0x83'),_0xff76('0x84'),_0xff76('0x85'),_0xff76('0x86')]);if(_0x3084ba[_0xff76('0x52')]['id']){delete _0x3084ba[_0xff76('0x52')]['id'];}if(_[_0xff76('0x6d')](_0x3084ba[_0xff76('0x52')][_0xff76('0x87')])){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x88'));}if(_[_0xff76('0x6d')](_0x3084ba[_0xff76('0x52')][_0xff76('0x52')])||_0x3084ba['body'][_0xff76('0x52')]===''){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x89'));}if(_['isNil'](_0x3084ba[_0xff76('0x52')][_0xff76('0x8a')])){throw new db[(_0xff76('0x80'))]['ValidationError'](_0xff76('0x8b')+_0xff0a50);}if(!_[_0xff76('0x8c')](_0xff0a50,_0x3084ba['body'][_0xff76('0x8a')])){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x8d')+_0xff0a50);}_0x1418aa[_0x3084ba[_0xff76('0x52')][_0xff76('0x8a')]]=_0x3084ba[_0xff76('0x52')]['from'];})['then'](function(){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x3084ba[_0xff76('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0xff76('0x8e'),'include':[{'model':db[_0xff76('0x7f')],'as':_0xff76('0x8f'),'where':_0x1418aa,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xff76('0x90')],'as':_0xff76('0x91')}]});})['then'](handleEntityNotFound(_0x3eab89,null))[_0xff76('0x12')](function(_0x18aaf2){if(_0x18aaf2&&_0x18aaf2[_0xff76('0x8e')]){_0x251964['account']=_0x18aaf2;_0x251964['applications']=_0x18aaf2[_0xff76('0x91')];_0x251964[_0xff76('0x92')]=_0x18aaf2['List'];_0x251964['applications']=_[_0xff76('0x93')](_0x251964[_0xff76('0x94')],[_0xff76('0x95')],['asc']);if(_0x251964[_0xff76('0x96')]['Applications']){delete _0x251964['account'][_0xff76('0x91')];}if(_0x251964[_0xff76('0x96')][_0xff76('0x8e')]&&_0x251964['account'][_0xff76('0x8e')][_0xff76('0x8f')][_0xff76('0x46')]){return _0x251964[_0xff76('0x96')][_0xff76('0x8e')][_0xff76('0x8f')][0x0];}var _0x257837=_[_0xff76('0xb')](_0x3084ba[_0xff76('0x52')],{'firstName':_0x3084ba[_0xff76('0x52')][_0xff76('0x87')],'ListId':_0x18aaf2[_0xff76('0x86')]});_0x257837[_0x3084ba[_0xff76('0x52')][_0xff76('0x8a')]]=_0x3084ba[_0xff76('0x52')][_0xff76('0x87')];return db[_0xff76('0x7f')]['create'](_0x257837,{'fields':_0x4090fb,'raw':!![]});}})[_0xff76('0x12')](handleEntityNotFound(_0x3eab89,null))[_0xff76('0x12')](function(_0x485058){_0x251964[_0xff76('0x97')]=_0x485058;var _0x1e1993=_0x3084ba['body'][_0xff76('0x98')];if(_0x3084ba[_0xff76('0x7b')][_0xff76('0x99')]){_0x1e1993=_0x3084ba[_0xff76('0x7b')]['cf-connecting-ip'];}else if(_0x3084ba[_0xff76('0x7b')]['x-forwarded-for']){_0x1e1993=_[_0xff76('0x9a')](_0x3084ba[_0xff76('0x7b')][_0xff76('0x9b')][_0xff76('0x9c')](','));}if(_0x485058){var _0x4bc602={'ContactId':_0x485058['id'],'ChatWebsiteId':_0x3084ba['params']['id'],'from':(_0x485058['firstName']||'')+'\x20'+(_0x485058['lastName']||''),'customerIp':_0x1e1993,'customerPort':_0x3084ba['headers']['x-real-port']?_0x3084ba[_0xff76('0x7b')]['x-real-port']:null,'referer':_0x3084ba['body'][_0xff76('0x9d')],'browserName':_0x224e72[_0xff76('0x9e')][_0xff76('0x2b')]&&_0x224e72[_0xff76('0x9e')][_0xff76('0x9f')]?util[_0xff76('0xa0')](_0xff76('0xa1'),_0x224e72[_0xff76('0x9e')][_0xff76('0x2b')],_0x224e72[_0xff76('0x9e')]['version']):_0xff76('0xa2'),'browserVersion':_0x224e72[_0xff76('0x9e')][_0xff76('0x9f')]||_0xff76('0xa2'),'osName':util[_0xff76('0xa0')](_0xff76('0xa1'),_0x224e72['os'][_0xff76('0x2b')],_0x224e72['os'][_0xff76('0x9f')]),'osVersion':_0x224e72['os'][_0xff76('0x9f')],'deviceModel':_0x224e72['device'][_0xff76('0x32')]&&_0x224e72['device'][_0xff76('0xa3')]?util[_0xff76('0xa0')](_0xff76('0xa4'),_0x224e72[_0xff76('0xa5')][_0xff76('0x32')],_0x224e72[_0xff76('0xa5')][_0xff76('0xa3')],_0x224e72['device'][_0xff76('0x31')]):null,'deviceVendor':_0x224e72[_0xff76('0xa5')][_0xff76('0xa3')],'deviceType':_0x224e72[_0xff76('0xa5')]['type'],'formData':JSON[_0xff76('0x18')](_0x3084ba[_0xff76('0x52')])};var _0x27b125={'ChatWebsiteId':_0x3084ba[_0xff76('0x45')]['id'],'closed':![]};if(_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')]){_0x27b125['threadId']=_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')];return db[_0xff76('0xa7')]['find']({'where':_0x27b125})[_0xff76('0x12')](function(_0x482a61){if(_0x482a61){return[_0x482a61,![]];}_0x4bc602['threadId']=_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')];_0x4bc602[_0xff76('0xa8')]=_0x3084ba['body']['externalUrl'];return db['ChatInteraction'][_0xff76('0x49')](_0x4bc602)[_0xff76('0x12')](function(_0x5c6aaf){return[_0x5c6aaf,!![]];});});}_0x27b125[_0xff76('0xa9')]=_0x485058['id'];if(_0x3084ba['body'][_0xff76('0xaa')]&&_0x3084ba[_0xff76('0x52')][_0xff76('0xaa')]['id']){_0x27b125['id']=_0x3084ba['body'][_0xff76('0xaa')]['id'];return db[_0xff76('0xa7')][_0xff76('0x48')]({'where':_0x27b125})[_0xff76('0x12')](function(_0x326b74){if(_0x326b74){return[_0x326b74,![]];}return db[_0xff76('0xa7')]['create'](_0x4bc602)['then'](function(_0x3c7764){return[_0x3c7764,!![]];});});}return db[_0xff76('0xa7')]['create'](_0x4bc602)[_0xff76('0x12')](function(_0x1737f0){return[_0x1737f0,!![]];});}})[_0xff76('0xab')](function(_0x289c26,_0x2fa575){if(_0x289c26){_0x29b229=_0x2fa575;if(!_0x2fa575){var _0x16b43a={'from':(_0x251964[_0xff76('0x97')][_0xff76('0xac')]||'')+'\x20'+(_0x251964['contact']['lastName']||'')};if(_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')]&&_0x3084ba[_0xff76('0x52')][_0xff76('0xad')]&&_0x3084ba[_0xff76('0x52')]['threadId']!=_0x3084ba[_0xff76('0x52')]['messageId']){_0x16b43a[_0xff76('0xa6')]=_0x3084ba[_0xff76('0x52')][_0xff76('0xad')];}return _0x289c26['update'](_0x16b43a);}else{return _0x289c26;}}})[_0xff76('0x12')](function(_0x5ce9d4){_0x251964['interaction']=_0x5ce9d4[_0xff76('0x4b')]({'plain':!![]});_0x251964[_0xff76('0xaa')][_0xff76('0xae')]=_0x29b229;if(_0x251964[_0xff76('0xaa')][_0xff76('0xae')]){if(_0x251964['account'][_0xff76('0xaf')]){_0x251964[_0xff76('0x94')][_0xff76('0xb0')]({'id':0x0,'priority':_0x251964[_0xff76('0x94')][_0xff76('0x46')]+0x1,'app':'close','appdata':_0xff76('0xb1'),'interval':_0xff76('0xb2')});}}return db[_0xff76('0xb3')]['create']({'body':_0x3084ba[_0xff76('0x52')][_0xff76('0x52')],'ChatWebsiteId':_0x3084ba[_0xff76('0x45')]['id'],'ChatInteractionId':_0x5ce9d4['id'],'direction':'in','ContactId':_0x251964[_0xff76('0x97')]['id'],'AttachmentId':_0x3084ba[_0xff76('0x52')][_0xff76('0xb4')]});})[_0xff76('0x12')](function(_0x40fc83){_0x251964[_0xff76('0x1b')]=_0x40fc83;if(_0x251964['interaction'][_0xff76('0xb5')]){return db[_0xff76('0xb6')][_0xff76('0x48')]({'attributes':['id',_0xff76('0x2b')],'where':{'id':_0x251964[_0xff76('0xaa')][_0xff76('0xb5')]}})[_0xff76('0x12')](function(_0x1baddf){if(_0x1baddf){_0x251964[_0xff76('0x94')][_0xff76('0xb7')]({'id':0x0,'priority':0x0,'app':_0xff76('0xb8'),'appdata':_0x1baddf['name']+','+(_0x251964['account'][_0xff76('0xb9')]||0xa),'interval':_0xff76('0xb2')});_0x251964[_0xff76('0xba')]=!![];}return respondWithRpcPromise('Start',_0xff76('0xbb'),_0x251964);});}return respondWithRpcPromise(_0xff76('0xbc'),'startRouting',_0x251964);})['then'](function(_0x61c7f4){respondWithRpcPromise('EventManager',_0xff76('0xbd'),{'event':'notify','message':_0x61c7f4},client9002);return _0x61c7f4;})[_0xff76('0x12')](respondWithResult(_0x3eab89,null))[_0xff76('0x1d')](handleError(_0x3eab89,null));};exports[_0xff76('0xbe')]=function(_0x34eefb,_0x5460b8){var _0x35ebf1,_0x172a74,_0x6bddac;var _0x3b777c=[];var _0x2bad7f={};var _0x54b533=_0x34eefb[_0xff76('0xbf')]||[];var _0x5289ac=[];var _0x751f41;return db['CmContact']['describe']()[_0xff76('0x12')](function(_0x4e32e8){if(!_0x4e32e8){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0xc0'));}_0x3b777c=_[_0xff76('0x82')](_[_0xff76('0x33')](_0x4e32e8),[_0xff76('0x83'),_0xff76('0x84'),_0xff76('0x85'),_0xff76('0x86')]);if(_0x34eefb['body']['id']){delete _0x34eefb[_0xff76('0x52')]['id'];}if(_[_0xff76('0x6d')](_0x34eefb['body'][_0xff76('0x87')])){throw _0x5460b8[_0xff76('0x1f')](0x1f4)[_0xff76('0xc1')](new db['Sequelize'][(_0xff76('0x81'))]('from\x20is\x20mandatory'));}if(_[_0xff76('0x6d')](_0x34eefb[_0xff76('0x52')][_0xff76('0x52')])||_0x34eefb[_0xff76('0x52')]['body']===''){throw _0x5460b8[_0xff76('0x1f')](0x1f4)[_0xff76('0xc1')](new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x89')));}if(_[_0xff76('0x6d')](_0x34eefb[_0xff76('0x52')][_0xff76('0xc2')])){throw _0x5460b8[_0xff76('0x1f')](0x1f4)['send'](new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0xc3')+_0x3b777c));}if(!_['includes'](_0x3b777c,_0x34eefb[_0xff76('0x52')][_0xff76('0xc2')])){throw _0x5460b8[_0xff76('0x1f')](0x1f4)['send'](new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0xc4')+_0x3b777c));}_0x2bad7f[_0x34eefb[_0xff76('0x52')]['mapKeyOffline']]=_0x34eefb['body']['from'];})[_0xff76('0x12')](function(){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x34eefb[_0xff76('0x45')]['id']},'include':[{'model':db[_0xff76('0xc5')],'as':_0xff76('0x8e')},{'model':db[_0xff76('0xc6')],'as':_0xff76('0xc6')}]});})[_0xff76('0x12')](handleEntityNotFound(_0x5460b8,null))['then'](function(_0x260952){if(_0x260952&&_0x260952[_0xff76('0x8e')]){_0x172a74=_0x260952;var _0x1deac5=_['defaults'](_0x34eefb[_0xff76('0x52')],{'firstName':_0x34eefb[_0xff76('0x52')][_0xff76('0x87')],'phone':_0x34eefb[_0xff76('0x52')][_0xff76('0x87')],'ListId':_0x260952[_0xff76('0x86')]});_0x1deac5[_0x34eefb[_0xff76('0x52')][_0xff76('0xc2')]]=_0x34eefb[_0xff76('0x52')]['from'];return db['CmContact'][_0xff76('0xc7')]({'where':_0x2bad7f,'defaults':_0x1deac5});}})[_0xff76('0xab')](function(_0x320b68){if(_0x320b68){_0x6bddac=_0x320b68;var _0x4044c8=fs[_0xff76('0xc8')](path['join'](config[_0xff76('0x68')],_0xff76('0xc9')),_0xff76('0xca'));var _0x5b191a=ejs[_0xff76('0xcb')](_0x4044c8,{'body':_[_0xff76('0xcc')](_0x34eefb[_0xff76('0x52')][_0xff76('0x52')]),'bodyTitle':_0x172a74['offlineMessageBody']});return db[_0xff76('0xcd')][_0xff76('0x49')]({'body':_0x5b191a,'ContactId':_0x320b68['id'],'ChatWebsiteId':_0x172a74['id']});}})[_0xff76('0x12')](function(_0x4890ed){_0x751f41=_0x4890ed;if(_0x54b533['length']){var _0x1b54f5=_0x54b533['map'](function(_0x4493e4){return{'name':_0x4493e4['originalname'],'basename':_0x4493e4['filename'],'type':_0x4493e4['mimetype'],'ChatOfflineMessageId':_0x4890ed['id']};});_0x5289ac=_0x1b54f5['map'](_0x29c31f=>{var _0x752362={'filename':_0x29c31f[_0xff76('0x2b')],'path':path[_0xff76('0x67')](config[_0xff76('0x68')],_0xff76('0xce'),'files','attachments',_0xff76('0xcf'),_0x29c31f[_0xff76('0xd0')])};return _0x752362;});if(!_0x172a74[_0xff76('0xd1')]){return db[_0xff76('0xd2')][_0xff76('0xd3')](function(_0xa74f3f){return db[_0xff76('0xd4')]['bulkCreate'](_0x1b54f5,{'transaction':_0xa74f3f});});}}})[_0xff76('0x12')](function(){if(_0x751f41){_0x35ebf1=_0x751f41;return db[_0xff76('0xc6')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xff76('0xd5'),'raw':!![]}]});}})[_0xff76('0x12')](function(_0x4c64ab){if(_0x4c64ab&&_0x4c64ab[_0xff76('0xd5')]&&_0x172a74[_0xff76('0xd6')]&&_0x172a74[_0xff76('0xd7')]){var _0x468ca2={'tls':{'rejectUnauthorized':![]}};if(_0x4c64ab[_0xff76('0xd5')][_0xff76('0xd8')]){_0x468ca2[_0xff76('0xd8')]=_0x4c64ab['Smtp']['service'];}else{_0x468ca2[_0xff76('0xd9')]=_0x4c64ab[_0xff76('0xd5')][_0xff76('0xd9')];_0x468ca2['port']=_0x4c64ab[_0xff76('0xd5')][_0xff76('0xda')];_0x468ca2[_0xff76('0xdb')]=_0x4c64ab['Smtp'][_0xff76('0xdb')];}if(_0x4c64ab[_0xff76('0xd5')][_0xff76('0xdc')]){_0x468ca2['auth']={'user':_0x4c64ab[_0xff76('0xd5')]['user'],'pass':_0x4c64ab[_0xff76('0xd5')][_0xff76('0xdd')]};}return respondWithRpcPromise(_0xff76('0xde'),_0xff76('0xdf'),{'account':_0x468ca2,'message':{'from':util[_0xff76('0xa0')](_0xff76('0xe0'),_0x4c64ab['name'],_0x4c64ab['email']||_0x4c64ab[_0xff76('0xd5')][_0xff76('0x4a')]),'to':_0x172a74[_0xff76('0xd7')],'subject':_0x172a74[_0xff76('0xe1')],'html':_0x35ebf1[_0xff76('0x52')],'attachments':_0x5289ac}},client9003)[_0xff76('0x12')](function(){return _0x35ebf1;})[_0xff76('0x1d')](function(_0xe9fa2){console[_0xff76('0x19')](_0xe9fa2);});}})[_0xff76('0x12')](function(){if(_0x172a74&&_0x172a74[_0xff76('0xd1')]&&_0x172a74[_0xff76('0xe2')]){var _0x48c45b=[];if(_0x54b533['length']){_0x48c45b=_0x54b533['map'](function(_0x31e079){return{'name':_0x31e079[_0xff76('0xe3')],'basename':_0x31e079[_0xff76('0x64')],'type':_0x31e079[_0xff76('0xe4')],'ChatOfflineMessageId':_0x751f41['id']};});}var _0x3c4dcd;if(!_['isNil'](_0x172a74[_0xff76('0xe5')])){var _0x16db62=_[_0xff76('0x2e')](_0x34eefb['body'],function(_0x3615b3){return _0x3615b3;});var _0x2bdd1f=_[_0xff76('0xe6')](_0x16db62)[0x0];var _0x1854fc=_['mapValues'](_0x2bdd1f,function(_0x121c96){return _0x121c96;});_0x3c4dcd=_0x1854fc[0x1][_0x172a74['subjectOffline']];}var _0x5c2043={'from':_0x6bddac['email'],'firstName':_0x6bddac[_0xff76('0xac')],'lastName':_0x6bddac[_0xff76('0xe7')],'mapKey':_0xff76('0xe8'),'message':{'from':_0x6bddac['email'],'to':_0x172a74['MailAccount']['email'],'cc':'','subject':_[_0xff76('0x6d')](_0x3c4dcd)?_0x172a74['offlineMessageSubject']:_0x3c4dcd,'messageId':'','sentAt':new Date(),'attach':_0x48c45b[_0xff76('0x46')],'attachments':_0x48c45b,'originChannel':'Chat','ChatWebsiteId':_0x172a74['id'],'ChatOfflineMessageId':_0x35ebf1['id'],'originTo':_0x172a74[_0xff76('0xc6')]['email']},'body':_0x35ebf1[_0xff76('0x52')]};var _0x3d337b={'account':{'id':_0x172a74['MailAccountId']},'body':_0x5c2043,'log':_0xff76('0xe9')};return respondWithRpcPromise('NotifyMailAccount',_0xff76('0xea'),_0x3d337b,client9001)[_0xff76('0x12')](function(){return _0x35ebf1;})[_0xff76('0x1d')](function(_0x2bbc11){console[_0xff76('0x19')](_0x2bbc11);});}return;})[_0xff76('0x12')](function(){if(_0x35ebf1){return _0x35ebf1;}})['then'](respondWithResult(_0x5460b8,null))['catch'](function(_0x21ceb8){console['error'](_0xff76('0x1d'),_0x21ceb8);for(var _0x2787c7 of _0x54b533){var _0x1eabfa=path['join'](config[_0xff76('0x68')],'server',_0xff76('0xbf'),_0xff76('0xeb'),'offline-chat',_0x2787c7[_0xff76('0x64')]);fs_extra[_0xff76('0xec')](_0x1eabfa)[_0xff76('0x1d')](function(_0x492f71){console[_0xff76('0x19')](_0xff76('0xed'),_0x1eabfa,_0x492f71);});}});};exports[_0xff76('0xee')]=function(_0x32690b,_0x29dc83){return db[_0xff76('0xa7')]['find']({'where':{'id':_0x32690b['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x29dc83,null))['then'](function(_0x2f98d4){if(_0x2f98d4){return _0x2f98d4['addInteraction'](_0x32690b[_0xff76('0x52')]['ids'],_['omit'](_0x32690b[_0xff76('0x52')],[_0xff76('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x29dc83,null))[_0xff76('0x1d')](handleError(_0x29dc83,null));};exports[_0xff76('0xef')]=function(_0x293b8f,_0xc7e8dd){var _0x506dce={'raw':![],'where':{}};var _0x4fa9ae={};var _0x3d9a8a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xff76('0x5d')]({'where':{'id':_0x293b8f[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0xc7e8dd,null))[_0xff76('0x12')](function(_0x1f3250){if(_0x1f3250){_0x4fa9ae['model']=_['keys'](db['ChatInteraction'][_0xff76('0x30')]);_0x4fa9ae[_0xff76('0x34')]=_['keys'](_0x293b8f[_0xff76('0x34')]);_0x4fa9ae['filters']=_[_0xff76('0x37')](_0x4fa9ae[_0xff76('0x32')],_0x4fa9ae[_0xff76('0x34')]);_0x506dce[_0xff76('0x36')]=_[_0xff76('0x37')](_0x4fa9ae['model'],qs[_0xff76('0x38')](_0x293b8f[_0xff76('0x34')]['fields']));_0x506dce[_0xff76('0x36')]=_0x506dce['attributes'][_0xff76('0x46')]?_0x506dce[_0xff76('0x36')]:_0x4fa9ae[_0xff76('0x32')];if(!_0x293b8f['query']['hasOwnProperty'](_0xff76('0x5e'))){_0x506dce[_0xff76('0x24')]=qs[_0xff76('0x24')](_0x293b8f[_0xff76('0x34')][_0xff76('0x24')]);_0x506dce['offset']=qs[_0xff76('0x22')](_0x293b8f[_0xff76('0x34')][_0xff76('0x22')]);}_0x506dce[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x293b8f[_0xff76('0x34')]['sort']);_0x506dce[_0xff76('0x3c')]=qs['filters'](_[_0xff76('0x3d')](_0x293b8f[_0xff76('0x34')],_0x4fa9ae['filters']));_0x506dce['where']['ChatWebsiteId']=_0x1f3250['id'];if(_0x293b8f[_0xff76('0x34')][_0xff76('0x3e')]){_0x506dce[_0xff76('0x3c')]=_['merge'](_0x506dce[_0xff76('0x3c')],{'$or':_['map'](_0x506dce['attributes'],function(_0xa14458){var _0x516416={};_0x516416[_0xa14458]={'$like':'%'+_0x293b8f[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x516416;})});}_0x506dce=_['merge']({},_0x506dce,_0x293b8f[_0xff76('0x47')]);return db[_0xff76('0xa7')]['count']({'where':_0x506dce[_0xff76('0x3c')]})[_0xff76('0x12')](function(_0x3f1ac6){_0x3d9a8a[_0xff76('0x25')]=_0x3f1ac6;if(_0x293b8f[_0xff76('0x34')][_0xff76('0x41')]){_0x506dce[_0xff76('0x42')]=[{'model':db['CmContact'],'as':_0xff76('0xf0'),'required':![]},{'model':db['User'],'as':_0xff76('0xf1'),'attributes':['name',_0xff76('0xf2'),_0xff76('0xf3')],'required':![]},{'model':db['Tag'],'as':_0xff76('0xf4'),'attributes':['id','name',_0xff76('0xf5')],'where':_0x293b8f['query'][_0xff76('0xf6')]?{'id':_0x293b8f[_0xff76('0x34')][_0xff76('0xf6')]}:undefined,'required':_0x293b8f['query'][_0xff76('0xf6')]?!![]:![]}];}return db['ChatInteraction'][_0xff76('0x58')](_0x506dce);})[_0xff76('0x12')](function(_0x5b1531){_0x3d9a8a[_0xff76('0x43')]=_0x5b1531;return _0x3d9a8a;});}})[_0xff76('0x12')](respondWithFilteredResult(_0xc7e8dd,_0x506dce))[_0xff76('0x1d')](handleError(_0xc7e8dd,null));};function iftimePromise(_0x2f7f1f,_0x2f847f){return respondWithRpcPromise(_0xff76('0xf7'),'getSnippet',{'command':_0x2f847f['timezone']?util[_0xff76('0xa0')]('iftime\x20%s,%s',_0x2f7f1f[_0xff76('0xf8')],_0x2f847f[_0xff76('0xf9')]):util[_0xff76('0xa0')](_0xff76('0xfa'),_0x2f7f1f[_0xff76('0xf8')])},client9002)[_0xff76('0x12')](function(_0x2a5c5f){var _0x3f19f8=_0x2a5c5f&&_0x2a5c5f[_0xff76('0xfb')](_0xff76('0xfc'))>=0x0?!![]:![];logger[_0xff76('0x13')](_0xff76('0xfd'),_0x2f847f['id'],_0x2f7f1f['id'],_0x2f7f1f[_0xff76('0xf8')],_0x3f19f8?_0xff76('0xfe'):_0xff76('0xff'),_0x2f847f['timezone']?_0x2f847f[_0xff76('0xf9')]:_0xff76('0x100'));return _0x3f19f8;})[_0xff76('0x1d')](function(_0x4f1bef){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2f847f['id'],_0x2f7f1f['id'],_0x2f7f1f[_0xff76('0xf8')],util[_0xff76('0x101')](_0x4f1bef,{'showHidden':![],'depth':null}),_0x2f847f[_0xff76('0xf9')]?_0x2f847f[_0xff76('0xf9')]:'No\x20timezone');return![];});}exports[_0xff76('0x102')]=function(_0x1b3545,_0x10eb47){var _0x5582b0=0x0;var _0xacaa9b=0x0;var _0x48bc72=![];var _0x4101da;var _0x3d7bd6;return db[_0xff76('0x2f')]['find']({'where':{'id':_0x1b3545[_0xff76('0x45')]['id']},'include':[{'model':db[_0xff76('0x103')],'as':'Interval','include':[{'model':db[_0xff76('0x103')],'as':'Intervals','attributes':['id',_0xff76('0xf8')],'raw':!![]}]}]})[_0xff76('0x12')](handleEntityNotFound(_0x10eb47,null))[_0xff76('0x12')](function(_0x38ad6e){if(_0x38ad6e){_0x4101da=_0x38ad6e;return _0x38ad6e[_0xff76('0x104')]({'raw':!![]});}})[_0xff76('0x12')](function(_0x31a5bf){if(_0x4101da){if(_0x31a5bf){_0x3d7bd6=_0x31a5bf;}}return require(_0xff76('0x6a'))[_0xff76('0x6b')]();})[_0xff76('0x12')](function(_0x637e31){if(_0x637e31){_0xacaa9b=_0x637e31['virtual'];_0x48bc72=_0x637e31[_0xff76('0x6c')];}})[_0xff76('0x12')](function(){return db['ChatInteraction'][_0xff76('0x25')]({'where':{'closed':![]}});})[_0xff76('0x12')](function(_0x2f1986){_0x5582b0=_0x2f1986;if(_0xacaa9b&&_0x2f1986>_0xacaa9b){return db[_0xff76('0x105')][_0xff76('0x5d')]({'where':{'id':0x1}})['then'](function(_0x6dccf0){if(_0x6dccf0){_0x6dccf0[_0xff76('0x106')](_0xff76('0x107'));}});}})[_0xff76('0x12')](function(){if(_0x4101da[_0xff76('0x103')]&&_0x4101da[_0xff76('0x103')][_0xff76('0x108')]){var _0x5d6806=[];for(var _0x2943ee=0x0;_0x2943ee<_0x4101da[_0xff76('0x103')][_0xff76('0x108')][_0xff76('0x46')];_0x2943ee++){var _0x425a7f=_0x4101da[_0xff76('0x103')][_0xff76('0x108')][_0x2943ee][_0xff76('0x4b')]({'plain':!![]});_0x5d6806[_0xff76('0xb0')](iftimePromise(_0x425a7f,_0x4101da));}return BPromise['all'](_0x5d6806)[_0xff76('0x12')](function(_0x2ed84a){return _[_0xff76('0x109')](_0x2ed84a);});}else{return!![];}})['then'](function(_0x16068b){var _0x4c8fc3=fs[_0xff76('0xc8')](path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/chat/iframe.ejs'),_0xff76('0xca'));var _0x459727={'remote':_0x4101da[_0xff76('0x10a')],'query':querystring['stringify'](_[_0xff76('0x3f')](_0x4101da[_0xff76('0x4b')]({'plain':!![]}),{'customerIp':_0x1b3545[_0xff76('0x7b')]['x-forwarded-for']||_0x1b3545[_0xff76('0x7b')]['x-real-ip']||_0x1b3545[_0xff76('0x10b')]['remoteAddress']||_0x1b3545['ip'],'referer':_0x1b3545[_0xff76('0x7b')][_0xff76('0x9d')],'openedInteractions':_0x5582b0,'maxInteractions':_0xacaa9b,'virtual':_0x48bc72[_0xff76('0x10c')],'online':_0x16068b,'custom':_0x48bc72}))[_0xff76('0x10d')](/'/g,'\x5c\x27')};_0x10eb47[_0xff76('0xc1')](ejs['render'](Mustache[_0xff76('0xcb')](_0x4c8fc3,_0x459727),{'proactiveActions':_0x3d7bd6,'alignment':_0x4101da[_0xff76('0x10e')],'verticalAlignment':_0x4101da['verticalAlignment'],'div_color':_0x4101da[_0xff76('0xf5')],'text_color':_0x4101da[_0xff76('0x10f')],'button_color':_0x4101da[_0xff76('0x110')],'background_color':_0x4101da[_0xff76('0x111')]}));})['catch'](handleError(_0x10eb47,null));};exports[_0xff76('0x112')]=function(_0x33055b,_0x3d4a51){var _0x3eaad9=_0x33055b[_0xff76('0x45')]['id'];var _0x1c54bd=_0x33055b[_0xff76('0x52')];var _0x2756eb=0xc8;var _0x451384=null;return db['sequelize'][_0xff76('0xd3')]({'isolationLevel':db[_0xff76('0xd2')][_0xff76('0x113')][_0xff76('0x114')][_0xff76('0x115')]},function(_0x4a3d33){return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x3eaad9},'transaction':_0x4a3d33})[_0xff76('0x12')](function(_0x9a8476){if(_0x9a8476){return db['ChatApplication'][_0xff76('0x28')]({'where':{'ChatWebsiteId':_0x3eaad9},'transaction':_0x4a3d33})['then'](function(){var _0x5f2f6b=_[_0xff76('0x2e')](_0x1c54bd,function(_0x48608a){_0x48608a['ChatWebsiteId']=_0x3eaad9;return _0x48608a;});return db[_0xff76('0x90')][_0xff76('0x116')](_0x5f2f6b,{'transaction':_0x4a3d33});});}else{_0x2756eb=0x194;_0x451384=[];}});})['then'](function(){if(_0x2756eb!==0x194){return db[_0xff76('0x90')][_0xff76('0x117')]({'where':{'ChatWebsiteId':_0x3eaad9},'order':'priority'})[_0xff76('0x12')](function(_0x27f1c7){_0x451384=_0x27f1c7;});}})[_0xff76('0x1d')](function(_0x28ea2e){_0x2756eb=0x1f4;logger[_0xff76('0x19')](_0x28ea2e[_0xff76('0x2a')]);if(_0x28ea2e[_0xff76('0x2b')]){delete _0x28ea2e[_0xff76('0x2b')];}_0x451384=_0x28ea2e;})[_0xff76('0x118')](function(){if(_0x451384===null){_0x3d4a51[_0xff76('0x1e')](_0x2756eb);}else{if(_0x2756eb===0x1f4){_0x3d4a51['status'](_0x2756eb)[_0xff76('0xc1')](_0x451384);}else{_0x3d4a51[_0xff76('0x1f')](_0x2756eb)[_0xff76('0x21')](_0x451384);}}});};exports['getApplications']=function(_0x56687d,_0x5687be){var _0x544a74={};var _0x33cfc1={};var _0x2ba0ad;var _0x41a469;return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x56687d[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x5687be,null))['then'](function(_0x471cbf){if(_0x471cbf){_0x2ba0ad=_0x471cbf;_0x33cfc1[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0x90')][_0xff76('0x30')]);_0x33cfc1[_0xff76('0x34')]=_[_0xff76('0x33')](_0x56687d['query']);_0x33cfc1[_0xff76('0x35')]=_[_0xff76('0x37')](_0x33cfc1[_0xff76('0x32')],_0x33cfc1[_0xff76('0x34')]);_0x544a74[_0xff76('0x36')]=_['intersection'](_0x33cfc1[_0xff76('0x32')],qs[_0xff76('0x38')](_0x56687d['query']['fields']));_0x544a74[_0xff76('0x36')]=_0x544a74['attributes'][_0xff76('0x46')]?_0x544a74[_0xff76('0x36')]:_0x33cfc1[_0xff76('0x32')];_0x544a74[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x56687d[_0xff76('0x34')][_0xff76('0x3b')]);_0x544a74['where']=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0x56687d[_0xff76('0x34')],_0x33cfc1[_0xff76('0x35')]));if(_0x56687d[_0xff76('0x34')][_0xff76('0x3e')]){_0x544a74[_0xff76('0x3c')]=_[_0xff76('0x3f')](_0x544a74['where'],{'$or':_['map'](_0x544a74[_0xff76('0x36')],function(_0x3c7590){var _0x35d540={};_0x35d540[_0x3c7590]={'$like':'%'+_0x56687d[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x35d540;})});}_0x544a74=_[_0xff76('0x3f')]({},_0x544a74,_0x56687d[_0xff76('0x47')]);return _0x2ba0ad['getApplications'](_0x544a74);}})['then'](function(_0xb9ba5c){if(_0xb9ba5c){_0x41a469=_0xb9ba5c[_0xff76('0x46')];if(!_0x56687d[_0xff76('0x34')][_0xff76('0x39')]('nolimit')){_0x544a74['limit']=qs[_0xff76('0x24')](_0x56687d[_0xff76('0x34')][_0xff76('0x24')]);_0x544a74[_0xff76('0x22')]=qs['offset'](_0x56687d[_0xff76('0x34')]['offset']);}return _0x2ba0ad[_0xff76('0x119')](_0x544a74);}})[_0xff76('0x12')](function(_0x7e7698){if(_0x7e7698){return _0x7e7698?{'count':_0x41a469,'rows':_0x7e7698}:null;}})['then'](respondWithResult(_0x5687be,null))[_0xff76('0x1d')](handleError(_0x5687be,null));};exports['addProactiveActions']=function(_0x4c60b5,_0x347618){return db[_0xff76('0x11a')][_0xff76('0x48')]({'where':{'id':_0x4c60b5['params']['id']}})['then'](handleEntityNotFound(_0x347618,null))[_0xff76('0x12')](function(_0x3f755c){if(_0x3f755c){return _0x3f755c[_0xff76('0x11b')](_0x4c60b5['body'][_0xff76('0x5a')],_[_0xff76('0x11c')](_0x4c60b5[_0xff76('0x52')],[_0xff76('0x5a'),'id'])||{});}})[_0xff76('0x12')](respondWithResult(_0x347618,null))['catch'](handleError(_0x347618,null));};exports[_0xff76('0x104')]=function(_0x41f593,_0x46f55c){var _0x556db4={};var _0x22b9c1={};var _0x2e5691;var _0x5f472a;return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x41f593['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x46f55c,null))[_0xff76('0x12')](function(_0x7e5465){if(_0x7e5465){_0x2e5691=_0x7e5465;_0x22b9c1[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0x11d')][_0xff76('0x30')]);_0x22b9c1[_0xff76('0x34')]=_[_0xff76('0x33')](_0x41f593[_0xff76('0x34')]);_0x22b9c1['filters']=_[_0xff76('0x37')](_0x22b9c1['model'],_0x22b9c1['query']);_0x556db4[_0xff76('0x36')]=_[_0xff76('0x37')](_0x22b9c1[_0xff76('0x32')],qs[_0xff76('0x38')](_0x41f593[_0xff76('0x34')][_0xff76('0x38')]));_0x556db4[_0xff76('0x36')]=_0x556db4[_0xff76('0x36')][_0xff76('0x46')]?_0x556db4[_0xff76('0x36')]:_0x22b9c1[_0xff76('0x32')];_0x556db4['order']=qs[_0xff76('0x3b')](_0x41f593[_0xff76('0x34')][_0xff76('0x3b')]);_0x556db4[_0xff76('0x3c')]=qs[_0xff76('0x35')](_['pick'](_0x41f593[_0xff76('0x34')],_0x22b9c1[_0xff76('0x35')]));if(_0x41f593[_0xff76('0x34')][_0xff76('0x3e')]){_0x556db4[_0xff76('0x3c')]=_['merge'](_0x556db4['where'],{'$or':_[_0xff76('0x2e')](_0x556db4[_0xff76('0x36')],function(_0x31929b){var _0x491fa8={};_0x491fa8[_0x31929b]={'$like':'%'+_0x41f593[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x491fa8;})});}_0x556db4=_['merge']({},_0x556db4,_0x41f593[_0xff76('0x47')]);return _0x2e5691[_0xff76('0x104')](_0x556db4);}})['then'](function(_0x1acfb3){if(_0x1acfb3){_0x5f472a=_0x1acfb3[_0xff76('0x46')];if(!_0x41f593['query']['hasOwnProperty'](_0xff76('0x5e'))){_0x556db4['limit']=qs[_0xff76('0x24')](_0x41f593[_0xff76('0x34')]['limit']);_0x556db4[_0xff76('0x22')]=qs[_0xff76('0x22')](_0x41f593[_0xff76('0x34')]['offset']);}return _0x2e5691['getProactiveActions'](_0x556db4);}})[_0xff76('0x12')](function(_0x4e2973){if(_0x4e2973){return _0x4e2973?{'count':_0x5f472a,'rows':_0x4e2973}:null;}})[_0xff76('0x12')](respondWithResult(_0x46f55c,null))[_0xff76('0x1d')](handleError(_0x46f55c,null));};exports[_0xff76('0x11e')]=function(_0x4cef74,_0x2b09c3){var _0x4df0cb=_0x4cef74['query'][_0xff76('0x11f')]===_0xff76('0x120')?_0xff76('0x121'):_0xff76('0x122');return db['ChatWebsite'][_0xff76('0x48')]({'attributes':['id',_0x4df0cb],'where':{'id':_0x4cef74['params']['id']}})['then'](handleEntityNotFound(_0x2b09c3,null))[_0xff76('0x12')](function(_0x4b688c){if(_0x4b688c){var _0x4ebf12=_0x4b688c[_0x4df0cb];var _0x1567f3=_0x4ebf12&&_0x4ebf12[_0xff76('0x123')]?_0x4ebf12[_0xff76('0x123')]:[];_0x2b09c3[_0xff76('0xc1')]({'fromKey':_[_0xff76('0x6d')](_0x4ebf12[_0xff76('0x124')])?undefined:_0x4ebf12['fromKey'],'count':_0x1567f3[_0xff76('0x46')],'rows':_0x1567f3});}})[_0xff76('0x1d')](handleError(_0x2b09c3,null));};exports[_0xff76('0x125')]=function(_0x4cfda9,_0x435cc0){var _0x44a789={'raw':![],'where':{}};var _0xef93d3={};var _0x3a801d={'count':0x0,'rows':[]};return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x4cfda9[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x435cc0,null))[_0xff76('0x12')](function(_0x278ea0){if(_0x278ea0){_0xef93d3[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0xcd')][_0xff76('0x30')]);_0xef93d3[_0xff76('0x34')]=_[_0xff76('0x33')](_0x4cfda9[_0xff76('0x34')]);_0xef93d3[_0xff76('0x35')]=_['intersection'](_0xef93d3[_0xff76('0x32')],_0xef93d3[_0xff76('0x34')]);_0x44a789['attributes']=_[_0xff76('0x37')](_0xef93d3[_0xff76('0x32')],qs['fields'](_0x4cfda9[_0xff76('0x34')][_0xff76('0x38')]));_0x44a789[_0xff76('0x36')]=_0x44a789[_0xff76('0x36')]['length']?_0x44a789[_0xff76('0x36')]:_0xef93d3[_0xff76('0x32')];if(!_0x4cfda9[_0xff76('0x34')]['hasOwnProperty'](_0xff76('0x5e'))){_0x44a789[_0xff76('0x24')]=qs['limit'](_0x4cfda9['query'][_0xff76('0x24')]);_0x44a789[_0xff76('0x22')]=qs[_0xff76('0x22')](_0x4cfda9[_0xff76('0x34')][_0xff76('0x22')]);}_0x44a789[_0xff76('0x3a')]=qs['sort'](_0x4cfda9[_0xff76('0x34')][_0xff76('0x3b')]);_0x44a789[_0xff76('0x3c')]=qs[_0xff76('0x35')](_['pick'](_0x4cfda9['query'],_0xef93d3[_0xff76('0x35')]));_0x44a789['where'][_0xff76('0x55')]=_0x278ea0['id'];if(_0x4cfda9[_0xff76('0x34')][_0xff76('0x3e')]){_0x44a789[_0xff76('0x3c')]=_[_0xff76('0x3f')](_0x44a789['where'],{'$or':_[_0xff76('0x2e')](_0x44a789['attributes'],function(_0x3a47dd){var _0x5de2a1={};_0x5de2a1[_0x3a47dd]={'$like':'%'+_0x4cfda9[_0xff76('0x34')]['filter']+'%'};return _0x5de2a1;})});}_0x44a789=_[_0xff76('0x3f')]({},_0x44a789,_0x4cfda9['options']);return db[_0xff76('0xcd')][_0xff76('0x25')]({'where':_0x44a789[_0xff76('0x3c')]})[_0xff76('0x12')](function(_0x5dad02){_0x3a801d[_0xff76('0x25')]=_0x5dad02;if(_0x4cfda9[_0xff76('0x34')][_0xff76('0x41')]){_0x44a789[_0xff76('0x42')]=[{'all':!![]}];}else{_0x44a789['include']=[{'model':db['CmContact'],'as':_0xff76('0xf0'),'required':![]},{'model':db[_0xff76('0xd4')],'as':_0xff76('0x126'),'required':![]}];}return db[_0xff76('0xcd')][_0xff76('0x58')](_0x44a789);})[_0xff76('0x12')](function(_0xaaaf4d){_0x3a801d[_0xff76('0x43')]=_0xaaaf4d;return _0x3a801d;});}})['then'](respondWithFilteredResult(_0x435cc0,_0x44a789))[_0xff76('0x1d')](handleError(_0x435cc0,null));};exports[_0xff76('0x127')]=function(_0x1eb9ac,_0x509236){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x1eb9ac[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x509236,null))['then'](function(_0x4c6185){if(_0x4c6185){return _0x4c6185[_0xff76('0x127')](_0x1eb9ac[_0xff76('0x52')][_0xff76('0x5a')],_['omit'](_0x1eb9ac['body'],[_0xff76('0x5a'),'id'])||{})['spread'](function(_0x5eee2a){for(var _0x5a5be3=0x0;_0x5a5be3<_0x1eb9ac[_0xff76('0x52')][_0xff76('0x5a')][_0xff76('0x46')];_0x5a5be3+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x1eb9ac[_0xff76('0x52')][_0xff76('0x5a')][_0x5a5be3]),'ChatWebsiteId':Number(_0x1eb9ac[_0xff76('0x45')]['id'])});}return _0x5eee2a;});}})['then'](respondWithResult(_0x509236,null))[_0xff76('0x1d')](handleError(_0x509236,null));};exports[_0xff76('0x128')]=function(_0x2f49cd,_0x4af308){return db['ChatWebsite'][_0xff76('0x48')]({'where':{'id':_0x2f49cd[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x4af308,null))[_0xff76('0x12')](function(_0x499315){if(_0x499315){return _0x499315[_0xff76('0x128')](_0x2f49cd['query'][_0xff76('0x5a')])[_0xff76('0x12')](function(){if(_[_0xff76('0x129')](_0x2f49cd[_0xff76('0x34')]['ids'])){for(var _0x1e7ef6=0x0;_0x1e7ef6<_0x2f49cd['query'][_0xff76('0x5a')][_0xff76('0x46')];_0x1e7ef6+=0x1){socket[_0xff76('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x2f49cd[_0xff76('0x34')][_0xff76('0x5a')][_0x1e7ef6]),'ChatWebsiteId':Number(_0x2f49cd['params']['id'])});}}else{socket['emit'](_0xff76('0x12b'),{'UserId':Number(_0x2f49cd[_0xff76('0x34')]['ids']),'ChatWebsiteId':Number(_0x2f49cd[_0xff76('0x45')]['id'])});}});}})[_0xff76('0x12')](respondWithStatusCode(_0x4af308,null))['catch'](handleError(_0x4af308,null));};exports[_0xff76('0x12c')]=function(_0x371fe0,_0x560ee8){var _0x5978b0={};var _0x374ac0={};var _0x2875c8;var _0x79aa3d;return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x371fe0[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x560ee8,null))[_0xff76('0x12')](function(_0x445a46){if(_0x445a46){_0x2875c8=_0x445a46;_0x374ac0['model']=_[_0xff76('0x33')](db[_0xff76('0xb6')]['rawAttributes']);_0x374ac0['query']=_[_0xff76('0x33')](_0x371fe0[_0xff76('0x34')]);_0x374ac0[_0xff76('0x35')]=_[_0xff76('0x37')](_0x374ac0['model'],_0x374ac0[_0xff76('0x34')]);_0x5978b0[_0xff76('0x36')]=_[_0xff76('0x37')](_0x374ac0[_0xff76('0x32')],qs[_0xff76('0x38')](_0x371fe0[_0xff76('0x34')]['fields']));_0x5978b0['attributes']=_0x5978b0['attributes'][_0xff76('0x46')]?_0x5978b0[_0xff76('0x36')]:_0x374ac0['model'];_0x5978b0[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x371fe0[_0xff76('0x34')]['sort']);_0x5978b0[_0xff76('0x3c')]=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0x371fe0[_0xff76('0x34')],_0x374ac0[_0xff76('0x35')]));if(_0x371fe0[_0xff76('0x34')]['filter']){_0x5978b0['where']=_[_0xff76('0x3f')](_0x5978b0[_0xff76('0x3c')],{'$or':_[_0xff76('0x2e')](_0x5978b0[_0xff76('0x36')],function(_0x4f936a){var _0xe91c6a={};_0xe91c6a[_0x4f936a]={'$like':'%'+_0x371fe0['query'][_0xff76('0x3e')]+'%'};return _0xe91c6a;})});}_0x5978b0=_[_0xff76('0x3f')]({},_0x5978b0,_0x371fe0['options']);return _0x2875c8[_0xff76('0x12c')](_0x5978b0);}})[_0xff76('0x12')](function(_0x1c1756){if(_0x1c1756){_0x79aa3d=_0x1c1756[_0xff76('0x46')];if(!_0x371fe0['query'][_0xff76('0x39')](_0xff76('0x5e'))){_0x5978b0[_0xff76('0x24')]=qs['limit'](_0x371fe0[_0xff76('0x34')][_0xff76('0x24')]);_0x5978b0[_0xff76('0x22')]=qs[_0xff76('0x22')](_0x371fe0[_0xff76('0x34')][_0xff76('0x22')]);}return _0x2875c8[_0xff76('0x12c')](_0x5978b0);}})[_0xff76('0x12')](function(_0x12ee8a){if(_0x12ee8a){return _0x12ee8a?{'count':_0x79aa3d,'rows':_0x12ee8a}:null;}})[_0xff76('0x12')](respondWithResult(_0x560ee8,null))[_0xff76('0x1d')](handleError(_0x560ee8,null));};
\ No newline at end of file
index 1b8e334..1d282a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c70=['ChatWebsite','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2cd4cf,_0x1ed34e){var _0x4c9605=function(_0x4f0b08){while(--_0x4f0b08){_0x2cd4cf['push'](_0x2cd4cf['shift']());}};_0x4c9605(++_0x1ed34e);}(_0x3c70,0x10c));var _0x03c7=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x3c70[_0x3c4737];return _0x2bb926;};'use strict';var EventEmitter=require(_0x03c7('0x0'));var ChatWebsite=require(_0x03c7('0x1'))['db'][_0x03c7('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x03c7('0x3'),'afterUpdate':_0x03c7('0x4'),'afterDestroy':_0x03c7('0x5')};function emitEvent(_0x37a9ea){return function(_0x38a36b,_0x2464f2,_0x55a9d5){ChatWebsiteEvents[_0x03c7('0x6')](_0x37a9ea+':'+_0x38a36b['id'],_0x38a36b);ChatWebsiteEvents['emit'](_0x37a9ea,_0x38a36b);_0x55a9d5(null);};}for(var e in events){if(events[_0x03c7('0x7')](e)){var event=events[e];ChatWebsite[_0x03c7('0x8')](e,emitEvent(event));}}module[_0x03c7('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc23a=['../../mysqldb','ChatWebsite','setMaxListeners','update','emit','exports'];(function(_0x14b5a5,_0x231b3a){var _0x2a7706=function(_0x2d451d){while(--_0x2d451d){_0x14b5a5['push'](_0x14b5a5['shift']());}};_0x2a7706(++_0x231b3a);}(_0xc23a,0xd2));var _0xac23=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0xc23a[_0x3e5bc8];return _0xfd84bc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xac23('0x0'))['db'][_0xac23('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xac23('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xac23('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49c690){return function(_0x35c541,_0x4f104c,_0x3f2613){ChatWebsiteEvents[_0xac23('0x4')](_0x49c690+':'+_0x35c541['id'],_0x35c541);ChatWebsiteEvents[_0xac23('0x4')](_0x49c690,_0x35c541);_0x3f2613(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xac23('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
index 12a5c41..d62de06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc0=['ChatWebsite','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x4311f5,_0x3550da){var _0x54107a=function(_0x147284){while(--_0x147284){_0x4311f5['push'](_0x4311f5['shift']());}};_0x54107a(++_0x3550da);}(_0xafc0,0x109));var _0x0afc=function(_0x15981e,_0x5d31ad){_0x15981e=_0x15981e-0x0;var _0x19e95e=_0xafc0[_0x15981e];return _0x19e95e;};'use strict';var _=require(_0x0afc('0x0'));var util=require(_0x0afc('0x1'));var logger=require(_0x0afc('0x2'))('api');var moment=require(_0x0afc('0x3'));var BPromise=require(_0x0afc('0x4'));var rp=require(_0x0afc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0afc('0x6'));var config=require(_0x0afc('0x7'));var attributes=require(_0x0afc('0x8'));module[_0x0afc('0x9')]=function(_0x4521e8,_0x4b0f71){return _0x4521e8[_0x0afc('0xa')](_0x0afc('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c50=['request-promise','path','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird'];(function(_0x22f309,_0x4001fb){var _0x524f16=function(_0x2156cd){while(--_0x2156cd){_0x22f309['push'](_0x22f309['shift']());}};_0x524f16(++_0x4001fb);}(_0x5c50,0x1c3));var _0x05c5=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0x5c50[_0x3cca7a];return _0x34e717;};'use strict';var _=require(_0x05c5('0x0'));var util=require(_0x05c5('0x1'));var logger=require('../../config/logger')(_0x05c5('0x2'));var moment=require(_0x05c5('0x3'));var BPromise=require(_0x05c5('0x4'));var rp=require(_0x05c5('0x5'));var fs=require('fs');var path=require(_0x05c5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x05c5('0x7'));module[_0x05c5('0x8')]=function(_0x53817b,_0x2b23ec){return _0x53817b[_0x05c5('0x9')](_0x05c5('0xa'),attributes,{'tableName':_0x05c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2bde40b..3e29602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94e8=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x150d2a,_0x570662){var _0x1064e5=function(_0xd9f42f){while(--_0xd9f42f){_0x150d2a['push'](_0x150d2a['shift']());}};_0x1064e5(++_0x570662);}(_0x94e8,0x142));var _0x894e=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0x94e8[_0x1ebe2f];return _0xdeb06f;};'use strict';var _=require(_0x894e('0x0'));var util=require(_0x894e('0x1'));var moment=require(_0x894e('0x2'));var BPromise=require(_0x894e('0x3'));var rs=require(_0x894e('0x4'));var fs=require('fs');var Redis=require(_0x894e('0x5'));var db=require(_0x894e('0x6'))['db'];var utils=require(_0x894e('0x7'));var logger=require(_0x894e('0x8'))(_0x894e('0x9'));var config=require(_0x894e('0xa'));var jayson=require(_0x894e('0xb'));var client=jayson[_0x894e('0xc')][_0x894e('0xd')]({'port':0x232a});config[_0x894e('0xe')]=_['defaults'](config['redis'],{'host':_0x894e('0xf'),'port':0x18eb});var socket=require(_0x894e('0x10'))(new Redis(config[_0x894e('0xe')]));require('./chatWebsite.socket')[_0x894e('0x11')](socket);function respondWithRpcPromise(_0x389304,_0x4c2ec0,_0x519edc){return new BPromise(function(_0x2f8bce,_0x1d7631){return client[_0x894e('0x12')](_0x389304,_0x519edc)[_0x894e('0x13')](function(_0x29fbb6){logger['info'](_0x894e('0x14'),_0x4c2ec0,_0x894e('0x15'));logger[_0x894e('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4c2ec0,_0x894e('0x15'),JSON[_0x894e('0x17')](_0x29fbb6));if(_0x29fbb6[_0x894e('0x18')]){if(_0x29fbb6[_0x894e('0x18')][_0x894e('0x19')]===0x1f4){logger[_0x894e('0x18')](_0x894e('0x14'),_0x4c2ec0,_0x29fbb6[_0x894e('0x18')][_0x894e('0x1a')]);return _0x1d7631(_0x29fbb6[_0x894e('0x18')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4c2ec0,_0x29fbb6[_0x894e('0x18')][_0x894e('0x1a')]);return _0x2f8bce(_0x29fbb6[_0x894e('0x18')][_0x894e('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4c2ec0,_0x894e('0x15'));_0x2f8bce(_0x29fbb6[_0x894e('0x1b')][_0x894e('0x1a')]);}})[_0x894e('0x1c')](function(_0x4064c8){logger[_0x894e('0x18')](_0x894e('0x14'),_0x4c2ec0,_0x4064c8);_0x1d7631(_0x4064c8);});});}
\ No newline at end of file
+var _0x8ce4=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x422ed7,_0x435058){var _0x36aee6=function(_0x2f2cd5){while(--_0x2f2cd5){_0x422ed7['push'](_0x422ed7['shift']());}};_0x36aee6(++_0x435058);}(_0x8ce4,0x198));var _0x48ce=function(_0x10eb11,_0x1c2aaa){_0x10eb11=_0x10eb11-0x0;var _0x1aad42=_0x8ce4[_0x10eb11];return _0x1aad42;};'use strict';var _=require(_0x48ce('0x0'));var util=require('util');var moment=require(_0x48ce('0x1'));var BPromise=require('bluebird');var rs=require(_0x48ce('0x2'));var fs=require('fs');var Redis=require(_0x48ce('0x3'));var db=require(_0x48ce('0x4'))['db'];var utils=require(_0x48ce('0x5'));var logger=require(_0x48ce('0x6'))(_0x48ce('0x7'));var config=require('../../config/environment');var jayson=require(_0x48ce('0x8'));var client=jayson[_0x48ce('0x9')][_0x48ce('0xa')]({'port':0x232a});config[_0x48ce('0xb')]=_[_0x48ce('0xc')](config['redis'],{'host':_0x48ce('0xd'),'port':0x18eb});var socket=require(_0x48ce('0xe'))(new Redis(config[_0x48ce('0xb')]));require(_0x48ce('0xf'))['register'](socket);function respondWithRpcPromise(_0x3f5ab6,_0x1aa0d6,_0x1589e3){return new BPromise(function(_0xb6dae4,_0x1551cb){return client[_0x48ce('0x10')](_0x3f5ab6,_0x1589e3)[_0x48ce('0x11')](function(_0x2b84d7){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1aa0d6,'request\x20sent');logger[_0x48ce('0x12')](_0x48ce('0x13'),_0x1aa0d6,_0x48ce('0x14'),JSON[_0x48ce('0x15')](_0x2b84d7));if(_0x2b84d7[_0x48ce('0x16')]){if(_0x2b84d7[_0x48ce('0x16')][_0x48ce('0x17')]===0x1f4){logger[_0x48ce('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1aa0d6,_0x2b84d7[_0x48ce('0x16')][_0x48ce('0x18')]);return _0x1551cb(_0x2b84d7[_0x48ce('0x16')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1aa0d6,_0x2b84d7[_0x48ce('0x16')]['message']);return _0xb6dae4(_0x2b84d7['error'][_0x48ce('0x18')]);}else{logger[_0x48ce('0x19')](_0x48ce('0x1a'),_0x1aa0d6,_0x48ce('0x14'));_0xb6dae4(_0x2b84d7[_0x48ce('0x1b')][_0x48ce('0x18')]);}})[_0x48ce('0x1c')](function(_0x5d8d19){logger[_0x48ce('0x16')](_0x48ce('0x1a'),_0x1aa0d6,_0x5d8d19);_0x1551cb(_0x5d8d19);});});}
\ No newline at end of file
index 5bf7e88..d6b3b65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd77f=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0xb3e40d,_0x43a176){var _0x291be1=function(_0x87961){while(--_0x87961){_0xb3e40d['push'](_0xb3e40d['shift']());}};_0x291be1(++_0x43a176);}(_0xd77f,0x152));var _0xfd77=function(_0x28d657,_0x16e0f9){_0x28d657=_0x28d657-0x0;var _0x5733d6=_0xd77f[_0x28d657];return _0x5733d6;};'use strict';var ChatWebsiteEvents=require(_0xfd77('0x0'));var events=[_0xfd77('0x1'),_0xfd77('0x2'),_0xfd77('0x3')];function createListener(_0x9b3647,_0x178213){return function(_0x27435c){_0x178213[_0xfd77('0x4')](_0x9b3647,_0x27435c);};}function removeListener(_0x178c8a,_0x481413){return function(){ChatWebsiteEvents[_0xfd77('0x5')](_0x178c8a,_0x481413);};}exports[_0xfd77('0x6')]=function(_0x29e3af){for(var _0x546b25=0x0,_0x465d3b=events[_0xfd77('0x7')];_0x546b25<_0x465d3b;_0x546b25++){var _0x45b905=events[_0x546b25];var _0x1212f2=createListener(_0xfd77('0x8')+_0x45b905,_0x29e3af);ChatWebsiteEvents['on'](_0x45b905,_0x1212f2);}};
\ No newline at end of file
+var _0x6621=['removeListener','register','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x3e5595,_0xbe4275){var _0x3fd3a6=function(_0x43874c){while(--_0x43874c){_0x3e5595['push'](_0x3e5595['shift']());}};_0x3fd3a6(++_0xbe4275);}(_0x6621,0xb7));var _0x1662=function(_0xb81c7f,_0x3c91fe){_0xb81c7f=_0xb81c7f-0x0;var _0x1bbcd6=_0x6621[_0xb81c7f];return _0x1bbcd6;};'use strict';var ChatWebsiteEvents=require(_0x1662('0x0'));var events=[_0x1662('0x1'),_0x1662('0x2'),'update'];function createListener(_0x46063c,_0x36a4d5){return function(_0x2b3b39){_0x36a4d5['emit'](_0x46063c,_0x2b3b39);};}function removeListener(_0x51214c,_0x5dbd05){return function(){ChatWebsiteEvents[_0x1662('0x3')](_0x51214c,_0x5dbd05);};}exports[_0x1662('0x4')]=function(_0x570d51){for(var _0x1f43d5=0x0,_0x3af120=events['length'];_0x1f43d5<_0x3af120;_0x1f43d5++){var _0x4eded6=events[_0x1f43d5];var _0x1b7610=createListener(_0x1662('0x5')+_0x4eded6,_0x570d51);ChatWebsiteEvents['on'](_0x4eded6,_0x1b7610);}};
\ No newline at end of file
index 750b90d..905f8c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde7a=['getAgents','post','addAnswer','diskStorage','root','format','%s-%s','now','originalname','single','file','addLogo','join','addAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages'];(function(_0x243515,_0x4241f3){var _0x44a8d6=function(_0x4e0922){while(--_0x4e0922){_0x243515['push'](_0x243515['shift']());}};_0x44a8d6(++_0x4241f3);}(_0xde7a,0x172));var _0xade7=function(_0x58e389,_0x169078){_0x58e389=_0x58e389-0x0;var _0x29f59c=_0xde7a[_0x58e389];return _0x29f59c;};'use strict';var multer=require('multer');var util=require(_0xade7('0x0'));var path=require('path');var timeout=require(_0xade7('0x1'));var express=require(_0xade7('0x2'));var router=express[_0xade7('0x3')]();var fs_extra=require(_0xade7('0x4'));var auth=require(_0xade7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xade7('0x6'));router[_0xade7('0x7')]('/',auth[_0xade7('0x8')](),controller['index']);router[_0xade7('0x7')]('/describe',auth[_0xade7('0x8')](),controller[_0xade7('0x9')]);router['get'](_0xade7('0xa'),auth[_0xade7('0x8')](),controller[_0xade7('0xb')]);router[_0xade7('0x7')](_0xade7('0xc'),auth[_0xade7('0x8')](),controller[_0xade7('0xd')]);router[_0xade7('0x7')](_0xade7('0xe'),auth[_0xade7('0x8')](),controller[_0xade7('0xf')]);router[_0xade7('0x7')](_0xade7('0x10'),controller[_0xade7('0x11')]);router['get'](_0xade7('0x12'),controller[_0xade7('0x13')]);router[_0xade7('0x7')](_0xade7('0x14'),controller[_0xade7('0x15')]);router[_0xade7('0x7')]('/:id/system_avatar',controller[_0xade7('0x16')]);router['get'](_0xade7('0x17'),auth[_0xade7('0x8')](),controller[_0xade7('0x18')]);router[_0xade7('0x7')](_0xade7('0x19'),controller['getSnippet']);router[_0xade7('0x7')](_0xade7('0x1a'),auth[_0xade7('0x8')](),controller[_0xade7('0x1b')]);router[_0xade7('0x7')](_0xade7('0x1c'),auth['isAuthenticated'](),controller[_0xade7('0x1d')]);router[_0xade7('0x7')]('/:id/fields',controller[_0xade7('0x1e')]);router[_0xade7('0x7')]('/:id/offline_messages',auth[_0xade7('0x8')](),controller[_0xade7('0x1f')]);router[_0xade7('0x7')]('/:id/users',auth[_0xade7('0x8')](),controller[_0xade7('0x20')]);router['post']('/',auth[_0xade7('0x8')](),controller['create']);router['post'](_0xade7('0xc'),auth[_0xade7('0x8')](),controller['addDisposition']);router[_0xade7('0x21')]('/:id/canned_answers',auth[_0xade7('0x8')](),controller[_0xade7('0x22')]);var upload=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x3efddc,_0x20bb25,_0x1dffd6){_0x1dffd6(null,path['join'](config[_0xade7('0x24')],'server/files/images/logos/'));},'filename':function(_0x2a493f,_0x2d6e61,_0x2649cb){_0x2649cb(null,util[_0xade7('0x25')](_0xade7('0x26'),Date[_0xade7('0x27')](),_0x2d6e61[_0xade7('0x28')]));}})});router[_0xade7('0x21')]('/:id/logo',upload[_0xade7('0x29')](_0xade7('0x2a')),controller[_0xade7('0x2b')]);var upload=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x82fd19,_0x4d0c40,_0xcee3f7){_0xcee3f7(null,path[_0xade7('0x2c')](config[_0xade7('0x24')],'server/files/images/avatars/'));},'filename':function(_0x1842d3,_0x599926,_0x59d684){_0x59d684(null,util[_0xade7('0x25')](_0xade7('0x26'),Date[_0xade7('0x27')](),_0x599926[_0xade7('0x28')]));}})});router[_0xade7('0x21')]('/:id/avatar',upload[_0xade7('0x29')](_0xade7('0x2a')),controller[_0xade7('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe938e7,_0x2f8514,_0x537e1e){_0x537e1e(null,path[_0xade7('0x2c')](config[_0xade7('0x24')],_0xade7('0x2e')));},'filename':function(_0x2f52af,_0x401a7c,_0x233cc4){_0x233cc4(null,util[_0xade7('0x25')]('%s-%s',Date[_0xade7('0x27')](),_0x401a7c[_0xade7('0x28')]));}})});router[_0xade7('0x21')](_0xade7('0x14'),upload['single'](_0xade7('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x379b95,_0x2fd121,_0x19fb74){_0x19fb74(null,path[_0xade7('0x2c')](config[_0xade7('0x24')],_0xade7('0x2e')));},'filename':function(_0x3e8a28,_0x28feb5,_0x57722c){_0x57722c(null,util['format']('%s-%s',Date[_0xade7('0x27')](),_0x28feb5[_0xade7('0x28')]));}})});router[_0xade7('0x21')]('/:id/system_avatar',upload['single']('file'),controller[_0xade7('0x2f')]);router[_0xade7('0x21')](_0xade7('0x30'),controller[_0xade7('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x4a0cd7,_0x1d300b,_0x3cb0b9){const _0x48cb6c=path[_0xade7('0x2c')](config[_0xade7('0x24')],_0xade7('0x32'),'attachments',_0xade7('0x33'));fs_extra[_0xade7('0x34')](_0x48cb6c,function(){_0x3cb0b9(null,_0x48cb6c);});},'filename':function(_0x555761,_0x166194,_0x2abeec){const _0x209939=_0x166194['originalname'][_0xade7('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4724e8=path[_0xade7('0x36')](_0x209939);const _0x1e31c3=Date[_0xade7('0x27')]()+'-'+_0x209939[_0xade7('0x35')](_0x4724e8,'')+_0x4724e8;_0x2abeec(null,_0x1e31c3);}})});router[_0xade7('0x21')]('/:id/offline',offlineUploadMulter[_0xade7('0x37')](),controller[_0xade7('0x38')]);router[_0xade7('0x21')](_0xade7('0x17'),auth[_0xade7('0x8')](),controller[_0xade7('0x39')]);router[_0xade7('0x21')](_0xade7('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xade7('0x1c'),auth['isAuthenticated'](),controller[_0xade7('0x3a')]);router[_0xade7('0x21')](_0xade7('0x3b'),auth['isAuthenticated'](),controller[_0xade7('0x3c')]);router[_0xade7('0x3d')](_0xade7('0xa'),auth['isAuthenticated'](),controller[_0xade7('0x3e')]);router[_0xade7('0x3f')]('/:id',auth[_0xade7('0x8')](),controller['destroy']);router[_0xade7('0x3f')](_0xade7('0xc'),auth[_0xade7('0x8')](),controller[_0xade7('0x40')]);router[_0xade7('0x3f')]('/:id/canned_answers',auth[_0xade7('0x8')](),controller[_0xade7('0x41')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xade7('0x42')]);module['exports']=router;
\ No newline at end of file
+var _0xc0b9=['getInteractions','getSnippet','/:id/applications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','single','file','join','server/files/images/avatars/','addAvatar','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','offline','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','express','Router','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions'];(function(_0x428609,_0x1b6787){var _0x3d22a4=function(_0x481703){while(--_0x481703){_0x428609['push'](_0x428609['shift']());}};_0x3d22a4(++_0x1b6787);}(_0xc0b9,0x149));var _0x9c0b=function(_0x36e299,_0x5f3e95){_0x36e299=_0x36e299-0x0;var _0xa47999=_0xc0b9[_0x36e299];return _0xa47999;};'use strict';var multer=require(_0x9c0b('0x0'));var util=require('util');var path=require(_0x9c0b('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c0b('0x2'));var router=express[_0x9c0b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c0b('0x4'));router[_0x9c0b('0x5')]('/',auth[_0x9c0b('0x6')](),controller['index']);router[_0x9c0b('0x5')](_0x9c0b('0x7'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x8')]);router[_0x9c0b('0x5')](_0x9c0b('0x9'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0xa')]);router[_0x9c0b('0x5')](_0x9c0b('0xb'),auth[_0x9c0b('0x6')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9c0b('0xc')]);router[_0x9c0b('0x5')]('/:id/logo',controller[_0x9c0b('0xd')]);router[_0x9c0b('0x5')](_0x9c0b('0xe'),controller[_0x9c0b('0xf')]);router[_0x9c0b('0x5')](_0x9c0b('0x10'),controller[_0x9c0b('0x11')]);router[_0x9c0b('0x5')](_0x9c0b('0x12'),controller[_0x9c0b('0x13')]);router['get'](_0x9c0b('0x14'),auth['isAuthenticated'](),controller[_0x9c0b('0x15')]);router['get']('/:id/snippet',controller[_0x9c0b('0x16')]);router[_0x9c0b('0x5')](_0x9c0b('0x17'),auth[_0x9c0b('0x6')](),controller['getApplications']);router[_0x9c0b('0x5')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x9c0b('0x5')](_0x9c0b('0x18'),controller[_0x9c0b('0x19')]);router[_0x9c0b('0x5')](_0x9c0b('0x1a'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x1b')]);router[_0x9c0b('0x5')](_0x9c0b('0x1c'),auth['isAuthenticated'](),controller[_0x9c0b('0x1d')]);router[_0x9c0b('0x1e')]('/',auth['isAuthenticated'](),controller[_0x9c0b('0x1f')]);router['post']('/:id/dispositions',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x20')]);router[_0x9c0b('0x1e')](_0x9c0b('0x21'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x22')]);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0xd3b892,_0x598290,_0x35f5fc){_0x35f5fc(null,path['join'](config[_0x9c0b('0x24')],_0x9c0b('0x25')));},'filename':function(_0x5be2f,_0x1064a6,_0xe650e){_0xe650e(null,util[_0x9c0b('0x26')](_0x9c0b('0x27'),Date[_0x9c0b('0x28')](),_0x1064a6['originalname']));}})});router['post'](_0x9c0b('0x29'),upload[_0x9c0b('0x2a')](_0x9c0b('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x32ac29,_0x4e8ab8,_0x711ea7){_0x711ea7(null,path[_0x9c0b('0x2c')](config[_0x9c0b('0x24')],_0x9c0b('0x2d')));},'filename':function(_0x571f99,_0x6babd9,_0x16bb9b){_0x16bb9b(null,util[_0x9c0b('0x26')]('%s-%s',Date[_0x9c0b('0x28')](),_0x6babd9['originalname']));}})});router[_0x9c0b('0x1e')](_0x9c0b('0xe'),upload['single'](_0x9c0b('0x2b')),controller[_0x9c0b('0x2e')]);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x4b6d80,_0x4d79a2,_0xaabea9){_0xaabea9(null,path[_0x9c0b('0x2c')](config[_0x9c0b('0x24')],_0x9c0b('0x2d')));},'filename':function(_0x14dffe,_0x57975c,_0x439c06){_0x439c06(null,util[_0x9c0b('0x26')](_0x9c0b('0x27'),Date['now'](),_0x57975c[_0x9c0b('0x2f')]));}})});router[_0x9c0b('0x1e')](_0x9c0b('0x10'),upload[_0x9c0b('0x2a')](_0x9c0b('0x2b')),controller[_0x9c0b('0x30')]);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x31b7bf,_0x25d3a0,_0x3d7e9a){_0x3d7e9a(null,path[_0x9c0b('0x2c')](config['root'],_0x9c0b('0x2d')));},'filename':function(_0x4fdab6,_0x22ebf3,_0x3e26b0){_0x3e26b0(null,util[_0x9c0b('0x26')](_0x9c0b('0x27'),Date[_0x9c0b('0x28')](),_0x22ebf3[_0x9c0b('0x2f')]));}})});router[_0x9c0b('0x1e')]('/:id/system_avatar',upload[_0x9c0b('0x2a')](_0x9c0b('0x2b')),controller[_0x9c0b('0x31')]);router[_0x9c0b('0x1e')](_0x9c0b('0x32'),controller[_0x9c0b('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x4ea145,_0x5eb605,_0x43e433){const _0x4b1047=path[_0x9c0b('0x2c')](config[_0x9c0b('0x24')],_0x9c0b('0x34'),_0x9c0b('0x35'),'offline-chat');fs_extra['ensureDir'](_0x4b1047,function(){_0x43e433(null,_0x4b1047);});},'filename':function(_0x1871ed,_0x57866b,_0x3b3269){const _0x338d0e=_0x57866b[_0x9c0b('0x2f')][_0x9c0b('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x7583f5=path[_0x9c0b('0x37')](_0x338d0e);const _0x4ccb02=Date['now']()+'-'+_0x338d0e[_0x9c0b('0x36')](_0x7583f5,'')+_0x7583f5;_0x3b3269(null,_0x4ccb02);}})});router['post'](_0x9c0b('0x38'),offlineUploadMulter[_0x9c0b('0x39')](),controller[_0x9c0b('0x3a')]);router[_0x9c0b('0x1e')](_0x9c0b('0x14'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x3b')]);router[_0x9c0b('0x1e')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x9c0b('0x1e')](_0x9c0b('0x3c'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x3d')]);router['post']('/:id/users',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x3e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9c0b('0x3f')]);router[_0x9c0b('0x40')]('/:id',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x41')]);router[_0x9c0b('0x40')](_0x9c0b('0xb'),auth['isAuthenticated'](),controller[_0x9c0b('0x42')]);router[_0x9c0b('0x40')](_0x9c0b('0x21'),auth['isAuthenticated'](),controller[_0x9c0b('0x43')]);router[_0x9c0b('0x40')]('/:id/users',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x44')]);module[_0x9c0b('0x45')]=router;
\ No newline at end of file
index 714e050..aa5d7f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab3f=['STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x2c3dc6,_0x187b82){var _0x2b48d8=function(_0x49b7bd){while(--_0x49b7bd){_0x2c3dc6['push'](_0x2c3dc6['shift']());}};_0x2b48d8(++_0x187b82);}(_0xab3f,0x72));var _0xfab3=function(_0x1268fc,_0x1e2f79){_0x1268fc=_0x1268fc-0x0;var _0x15158d=_0xab3f[_0x1268fc];return _0x15158d;};'use strict';var Sequelize=require(_0xfab3('0x0'));module['exports']={'name':{'type':Sequelize[_0xfab3('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfab3('0x2')](_0xfab3('0x3'),_0xfab3('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xfab3('0x1')]},'data2':{'type':Sequelize[_0xfab3('0x1')]}};
\ No newline at end of file
+var _0x0af5=['STRING','ENUM','AmazonAWS','Google','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0af5,0x158));var _0x50af=function(_0x344066,_0x16d1dd){_0x344066=_0x344066-0x0;var _0x526692=_0x0af5[_0x344066];return _0x526692;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x50af('0x2')](_0x50af('0x3'),_0x50af('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x50af('0x1')]},'data2':{'type':Sequelize[_0x50af('0x1')]}};
\ No newline at end of file
index 807de43..0307d8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x1d3a0b,_0x272ff6){var _0x1968b0=function(_0x27bce7){while(--_0x27bce7){_0x1d3a0b['push'](_0x1d3a0b['shift']());}};_0x1968b0(++_0x272ff6);}(_0x2032,0xd9));var _0x2203=function(_0x2c59f9,_0x242547){_0x2c59f9=_0x2c59f9-0x0;var _0xf7c8bd=_0x2032[_0x2c59f9];return _0xf7c8bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
+var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x4b07cf,_0x274300){var _0x2732c8=function(_0x19b1a4){while(--_0x19b1a4){_0x4b07cf['push'](_0x4b07cf['shift']());}};_0x2732c8(++_0x274300);}(_0x2032,0xd9));var _0x2203=function(_0x442705,_0xaa3b7d){_0x442705=_0x442705-0x0;var _0x3515fd=_0x2032[_0x442705];return _0x3515fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
index e3461af..1450ed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec16=['./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c78af,_0x13a87a){var _0x14b0cb=function(_0x2a6f28){while(--_0x2a6f28){_0x3c78af['push'](_0x3c78af['shift']());}};_0x14b0cb(++_0x13a87a);}(_0xec16,0xb8));var _0x6ec1=function(_0x54f10e,_0x328584){_0x54f10e=_0x54f10e-0x0;var _0x1cc01d=_0xec16[_0x54f10e];return _0x1cc01d;};'use strict';var _=require('lodash');var util=require(_0x6ec1('0x0'));var logger=require(_0x6ec1('0x1'))(_0x6ec1('0x2'));var moment=require(_0x6ec1('0x3'));var BPromise=require(_0x6ec1('0x4'));var rp=require(_0x6ec1('0x5'));var fs=require('fs');var path=require(_0x6ec1('0x6'));var rimraf=require(_0x6ec1('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ec1('0x8'));module[_0x6ec1('0x9')]=function(_0x2dbcc0,_0x2ba8b2){return _0x2dbcc0[_0x6ec1('0xa')](_0x6ec1('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b0b=['cloud_providers','lodash','../../config/logger','moment','bluebird','request-promise','path','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x497f4f,_0x251ed6){var _0x547310=function(_0x3fe420){while(--_0x3fe420){_0x497f4f['push'](_0x497f4f['shift']());}};_0x547310(++_0x251ed6);}(_0x3b0b,0x9b));var _0xb3b0=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x3b0b[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xb3b0('0x0'));var util=require('util');var logger=require(_0xb3b0('0x1'))('api');var moment=require(_0xb3b0('0x2'));var BPromise=require(_0xb3b0('0x3'));var rp=require(_0xb3b0('0x4'));var fs=require('fs');var path=require(_0xb3b0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb3b0('0x6'));module[_0xb3b0('0x7')]=function(_0x2f29e5,_0x443368){return _0x2f29e5[_0xb3b0('0x8')](_0xb3b0('0x9'),attributes,{'tableName':_0xb3b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aa79ffd..71b6777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd232=['then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x555555,_0xc2c92){var _0x530811=function(_0x8d8dde){while(--_0x8d8dde){_0x555555['push'](_0x555555['shift']());}};_0x530811(++_0xc2c92);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d23('0x0'));var util=require('util');var moment=require(_0x2d23('0x1'));var BPromise=require(_0x2d23('0x2'));var rs=require(_0x2d23('0x3'));var fs=require('fs');var Redis=require(_0x2d23('0x4'));var db=require(_0x2d23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d23('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d23('0x7')][_0x2d23('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15c735,_0x53ac18,_0x18cac8){return new BPromise(function(_0x4cf7f4,_0x2c4667){return client[_0x2d23('0x9')](_0x15c735,_0x18cac8)[_0x2d23('0xa')](function(_0x7847cb){logger[_0x2d23('0xb')](_0x2d23('0xc'),_0x53ac18,_0x2d23('0xd'));logger['debug'](_0x2d23('0xe'),_0x53ac18,_0x2d23('0xd'),JSON[_0x2d23('0xf')](_0x7847cb));if(_0x7847cb[_0x2d23('0x10')]){if(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x11')]===0x1f4){logger[_0x2d23('0x10')](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x2c4667(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}logger['error'](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x4cf7f4(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}else{logger['info'](_0x2d23('0xc'),_0x53ac18,'request\x20sent');_0x4cf7f4(_0x7847cb[_0x2d23('0x13')]['message']);}})[_0x2d23('0x14')](function(_0x30b578){logger['error']('CloudProvider,\x20%s,\x20%s',_0x53ac18,_0x30b578);_0x2c4667(_0x30b578);});});}
\ No newline at end of file
+var _0x2deb=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2de('0x4'))['db'];var utils=require(_0xb2de('0x5'));var logger=require(_0xb2de('0x6'))(_0xb2de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2de('0x8')][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191004,_0x49307b,_0x253d0b){return new BPromise(function(_0x1a4c44,_0x53ab0e){return client[_0xb2de('0xa')](_0x191004,_0x253d0b)[_0xb2de('0xb')](function(_0x1d40ec){logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x49307b,'request\x20sent',JSON['stringify'](_0x1d40ec));if(_0x1d40ec[_0xb2de('0x10')]){if(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x11')]===0x1f4){logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);return _0x53ab0e(_0x1d40ec['error'][_0xb2de('0x12')]);}logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec['error'][_0xb2de('0x12')]);return _0x1a4c44(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);}else{logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));_0x1a4c44(_0x1d40ec[_0xb2de('0x13')][_0xb2de('0x12')]);}})[_0xb2de('0x14')](function(_0x2dc15c){logger[_0xb2de('0x10')](_0xb2de('0xc'),_0x49307b,_0x2dc15c);_0x53ab0e(_0x2dc15c);});});}
\ No newline at end of file
index 8f7d547..b0f68c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa908=['../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x3b6266,_0x1a2b8b){var _0x37a372=function(_0x3ea98a){while(--_0x3ea98a){_0x3b6266['push'](_0x3b6266['shift']());}};_0x37a372(++_0x1a2b8b);}(_0xa908,0x1c3));var _0x8a90=function(_0x256422,_0x367394){_0x256422=_0x256422-0x0;var _0x55dddc=_0xa908[_0x256422];return _0x55dddc;};'use strict';var multer=require(_0x8a90('0x0'));var util=require('util');var path=require(_0x8a90('0x1'));var timeout=require('connect-timeout');var express=require(_0x8a90('0x2'));var router=express[_0x8a90('0x3')]();var fs_extra=require(_0x8a90('0x4'));var auth=require(_0x8a90('0x5'));var interaction=require(_0x8a90('0x6'));var config=require('../../config/environment');var controller=require(_0x8a90('0x7'));router[_0x8a90('0x8')]('/',auth['isAuthenticated'](),controller[_0x8a90('0x9')]);router[_0x8a90('0x8')](_0x8a90('0xa'),auth[_0x8a90('0xb')](),controller[_0x8a90('0xc')]);router[_0x8a90('0xd')]('/',auth['isAuthenticated'](),controller[_0x8a90('0xe')]);router['put'](_0x8a90('0xa'),auth['isAuthenticated'](),controller[_0x8a90('0xf')]);router[_0x8a90('0x10')](_0x8a90('0xa'),auth[_0x8a90('0xb')](),controller[_0x8a90('0x11')]);module[_0x8a90('0x12')]=router;
\ No newline at end of file
+var _0x4e6e=['put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','create'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x4e6e,0x143));var _0xe4e6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x4e6e[_0x24f31b];return _0x488401;};'use strict';var multer=require(_0xe4e6('0x0'));var util=require(_0xe4e6('0x1'));var path=require(_0xe4e6('0x2'));var timeout=require(_0xe4e6('0x3'));var express=require(_0xe4e6('0x4'));var router=express[_0xe4e6('0x5')]();var fs_extra=require(_0xe4e6('0x6'));var auth=require(_0xe4e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe4e6('0x8'));var controller=require(_0xe4e6('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe4e6('0xa')]('/:id',auth[_0xe4e6('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe4e6('0xc')]);router[_0xe4e6('0xd')]('/:id',auth[_0xe4e6('0xb')](),controller['update']);router[_0xe4e6('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe4e6('0xf')]=router;
\ No newline at end of file
index ae08b59..392eba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72d7=['name','STRING'];(function(_0x227d0d,_0x1a1363){var _0x2d23c4=function(_0x10e935){while(--_0x10e935){_0x227d0d['push'](_0x227d0d['shift']());}};_0x2d23c4(++_0x1a1363);}(_0x72d7,0x129));var _0x772d=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x72d7[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x772d('0x0')],'unique':_0x772d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x772d('0x0')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x772d('0x0')]},'phone':{'type':Sequelize[_0x772d('0x0')]},'fax':{'type':Sequelize[_0x772d('0x0')]},'type':{'type':Sequelize[_0x772d('0x0')]},'street':{'type':Sequelize[_0x772d('0x0')]},'postalCode':{'type':Sequelize[_0x772d('0x0')]},'city':{'type':Sequelize[_0x772d('0x0')]},'country':{'type':Sequelize[_0x772d('0x0')]},'email':{'type':Sequelize[_0x772d('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x772d('0x0')]},'sStreet':{'type':Sequelize[_0x772d('0x0')]},'sPostalCode':{'type':Sequelize[_0x772d('0x0')]},'sCity':{'type':Sequelize[_0x772d('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x772d('0x0')]}};
\ No newline at end of file
+var _0x11a1=['name','sequelize','exports','STRING'];(function(_0x530455,_0x41da2d){var _0x128a27=function(_0x3152af){while(--_0x3152af){_0x530455['push'](_0x530455['shift']());}};_0x128a27(++_0x41da2d);}(_0x11a1,0xbd));var _0x111a=function(_0x16d51f,_0x2868af){_0x16d51f=_0x16d51f-0x0;var _0x2d08a0=_0x11a1[_0x16d51f];return _0x2d08a0;};'use strict';var Sequelize=require(_0x111a('0x0'));module[_0x111a('0x1')]={'name':{'type':Sequelize[_0x111a('0x2')],'unique':_0x111a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x111a('0x2')]},'companyId':{'type':Sequelize[_0x111a('0x2')]},'website':{'type':Sequelize[_0x111a('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x111a('0x2')]},'street':{'type':Sequelize[_0x111a('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x111a('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x111a('0x2')]},'sCountry':{'type':Sequelize[_0x111a('0x2')]},'description':{'type':Sequelize[_0x111a('0x2')]}};
\ No newline at end of file
index fb4d7a7..f9e59b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29e2=['find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','CmContact','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','catch','show','params'];(function(_0x566407,_0x35c8ed){var _0x5dbbbe=function(_0x5c0d7f){while(--_0x5c0d7f){_0x566407['push'](_0x566407['shift']());}};_0x5dbbbe(++_0x35c8ed);}(_0x29e2,0xb8));var _0x229e=function(_0x589d37,_0x1399c4){_0x589d37=_0x589d37-0x0;var _0x5e8d4e=_0x29e2[_0x589d37];return _0x5e8d4e;};'use strict';var emlformat=require(_0x229e('0x0'));var rimraf=require(_0x229e('0x1'));var zipdir=require(_0x229e('0x2'));var jsonpatch=require(_0x229e('0x3'));var rp=require(_0x229e('0x4'));var moment=require(_0x229e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x229e('0x6'));var util=require(_0x229e('0x7'));var path=require(_0x229e('0x8'));var sox=require(_0x229e('0x9'));var csv=require(_0x229e('0xa'));var ejs=require(_0x229e('0xb'));var fs=require('fs');var fs_extra=require(_0x229e('0xc'));var _=require(_0x229e('0xd'));var squel=require('squel');var crypto=require(_0x229e('0xe'));var jsforce=require(_0x229e('0xf'));var deskjs=require(_0x229e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x229e('0x11'));var Papa=require(_0x229e('0x12'));var Redis=require(_0x229e('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x229e('0x14'));var hardwareService=require(_0x229e('0x15'));var logger=require(_0x229e('0x16'))(_0x229e('0x17'));var utils=require(_0x229e('0x18'));var config=require(_0x229e('0x19'));var licenseUtil=require(_0x229e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x156ecc,_0x56bdfd){_0x56bdfd=_0x56bdfd||0xcc;return function(_0x115195){if(_0x115195){return _0x156ecc[_0x229e('0x1b')](_0x56bdfd);}return _0x156ecc[_0x229e('0x1c')](_0x56bdfd)[_0x229e('0x1d')]();};}function respondWithResult(_0x284792,_0x5dbe3a){_0x5dbe3a=_0x5dbe3a||0xc8;return function(_0x251dfb){if(_0x251dfb){return _0x284792[_0x229e('0x1c')](_0x5dbe3a)[_0x229e('0x1e')](_0x251dfb);}};}function respondWithFilteredResult(_0x4b671e,_0x124ff7){return function(_0x2ca292){if(_0x2ca292){var _0x5e416e=typeof _0x124ff7[_0x229e('0x1f')]===_0x229e('0x20')&&typeof _0x124ff7[_0x229e('0x21')]==='undefined';var _0x4407dc=_0x2ca292[_0x229e('0x22')];var _0x128285=_0x5e416e?0x0:_0x124ff7[_0x229e('0x1f')];var _0x40fde9=_0x5e416e?_0x2ca292['count']:_0x124ff7[_0x229e('0x1f')]+_0x124ff7['limit'];var _0x24e4ee;if(_0x40fde9>=_0x4407dc){_0x40fde9=_0x4407dc;_0x24e4ee=0xc8;}else{_0x24e4ee=0xce;}_0x4b671e[_0x229e('0x1c')](_0x24e4ee);return _0x4b671e[_0x229e('0x23')](_0x229e('0x24'),_0x128285+'-'+_0x40fde9+'/'+_0x4407dc)['json'](_0x2ca292);}return null;};}function patchUpdates(_0x1138e9){return function(_0x26d37d){try{jsonpatch['apply'](_0x26d37d,_0x1138e9,!![]);}catch(_0x399cca){return BPromise[_0x229e('0x25')](_0x399cca);}return _0x26d37d[_0x229e('0x26')]();};}function saveUpdates(_0x39c0d6,_0x55c73d){return function(_0x42d464){if(_0x42d464){return _0x42d464[_0x229e('0x27')](_0x39c0d6)[_0x229e('0x28')](function(_0x418866){return _0x418866;});}return null;};}function removeEntity(_0x905280,_0x307817){return function(_0x1f63f0){if(_0x1f63f0){return _0x1f63f0[_0x229e('0x29')]()[_0x229e('0x28')](function(){var _0x527945=_0x1f63f0[_0x229e('0x2a')]({'plain':!![]});var _0x550ba9=_0x229e('0x2b');return db[_0x229e('0x2c')][_0x229e('0x29')]({'where':{'type':_0x550ba9,'resourceId':_0x527945['id']}})[_0x229e('0x28')](function(){return _0x1f63f0;});})[_0x229e('0x28')](function(){_0x905280[_0x229e('0x1c')](0xcc)[_0x229e('0x1d')]();});}};}function handleEntityNotFound(_0x9c1782,_0x5c3803){return function(_0x3269df){if(!_0x3269df){_0x9c1782[_0x229e('0x1b')](0x194);}return _0x3269df;};}function handleError(_0x302df4,_0x3d60bc){_0x3d60bc=_0x3d60bc||0x1f4;return function(_0x26c926){logger[_0x229e('0x2d')](_0x26c926[_0x229e('0x2e')]);if(_0x26c926[_0x229e('0x2f')]){delete _0x26c926[_0x229e('0x2f')];}_0x302df4['status'](_0x3d60bc)[_0x229e('0x30')](_0x26c926);};}exports['index']=function(_0x4aeee6,_0x1a64a6){var _0x3f6cc5={},_0x1d583a={},_0x384630={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x229e('0x28')](function(_0x4d79c3){_0x1d583a[_0x229e('0x31')]=_[_0x229e('0x32')](_0x4d79c3);_0x1d583a[_0x229e('0x33')]=_['keys'](_0x4aeee6['query']);_0x1d583a[_0x229e('0x34')]=_['intersection'](_0x1d583a[_0x229e('0x31')],_0x1d583a[_0x229e('0x33')]);_0x3f6cc5[_0x229e('0x35')]=_[_0x229e('0x36')](_0x1d583a['model'],qs['fields'](_0x4aeee6[_0x229e('0x33')][_0x229e('0x37')]));_0x3f6cc5[_0x229e('0x35')]=_0x3f6cc5[_0x229e('0x35')][_0x229e('0x38')]?_0x3f6cc5[_0x229e('0x35')]:_0x1d583a['model'];if(!_0x4aeee6[_0x229e('0x33')][_0x229e('0x39')](_0x229e('0x3a'))){_0x3f6cc5[_0x229e('0x21')]=qs[_0x229e('0x21')](_0x4aeee6[_0x229e('0x33')][_0x229e('0x21')]);_0x3f6cc5[_0x229e('0x1f')]=qs[_0x229e('0x1f')](_0x4aeee6[_0x229e('0x33')][_0x229e('0x1f')]);}_0x3f6cc5[_0x229e('0x3b')]=qs[_0x229e('0x3c')](_0x4aeee6[_0x229e('0x33')][_0x229e('0x3c')]);_0x3f6cc5[_0x229e('0x3d')]=qs[_0x229e('0x34')](_[_0x229e('0x3e')](_0x4aeee6[_0x229e('0x33')],_0x1d583a[_0x229e('0x34')]),_0x4d79c3);if(_0x4aeee6[_0x229e('0x33')][_0x229e('0x3f')]){_0x3f6cc5['where']=_[_0x229e('0x40')](_0x3f6cc5[_0x229e('0x3d')],{'$or':_[_0x229e('0x41')](_0x3f6cc5[_0x229e('0x35')],function(_0xea229d){var _0xcc6a2f={};_0xcc6a2f[_0xea229d]={'$like':'%'+_0x4aeee6[_0x229e('0x33')][_0x229e('0x3f')]+'%'};return _0xcc6a2f;})});}_0x3f6cc5=_[_0x229e('0x40')]({},_0x3f6cc5,_0x4aeee6[_0x229e('0x42')]);var _0xe3f071={'where':_0x3f6cc5[_0x229e('0x3d')]};return db[_0x229e('0x43')]['count'](_0xe3f071)['then'](function(_0x5049f7){_0x384630['count']=_0x5049f7;if(_0x4aeee6[_0x229e('0x33')][_0x229e('0x44')]){_0x3f6cc5[_0x229e('0x45')]=[{'all':!![]}];}return db[_0x229e('0x43')][_0x229e('0x46')](_0x3f6cc5);})[_0x229e('0x28')](function(_0x2cc859){_0x384630['rows']=_0x2cc859;return _0x384630;})[_0x229e('0x28')](respondWithFilteredResult(_0x1a64a6,_0x3f6cc5))[_0x229e('0x47')](handleError(_0x1a64a6,null));})[_0x229e('0x47')](handleError(_0x1a64a6,null));};exports[_0x229e('0x48')]=function(_0x528ab5,_0x36aff1){var _0x3271e6={'raw':![],'where':{'id':_0x528ab5[_0x229e('0x49')]['id']}},_0x541568={};_0x541568[_0x229e('0x31')]=_[_0x229e('0x32')](db[_0x229e('0x43')]['rawAttributes']);_0x541568['query']=_[_0x229e('0x32')](_0x528ab5[_0x229e('0x33')]);_0x541568[_0x229e('0x34')]=_[_0x229e('0x36')](_0x541568[_0x229e('0x31')],_0x541568[_0x229e('0x33')]);_0x3271e6[_0x229e('0x35')]=_[_0x229e('0x36')](_0x541568[_0x229e('0x31')],qs[_0x229e('0x37')](_0x528ab5[_0x229e('0x33')][_0x229e('0x37')]));_0x3271e6[_0x229e('0x35')]=_0x3271e6[_0x229e('0x35')][_0x229e('0x38')]?_0x3271e6[_0x229e('0x35')]:_0x541568[_0x229e('0x31')];if(_0x528ab5['query'][_0x229e('0x44')]){_0x3271e6[_0x229e('0x45')]=[{'all':!![]}];}_0x3271e6=_[_0x229e('0x40')]({},_0x3271e6,_0x528ab5[_0x229e('0x42')]);return db[_0x229e('0x43')][_0x229e('0x4a')](_0x3271e6)[_0x229e('0x28')](handleEntityNotFound(_0x36aff1,null))['then'](respondWithResult(_0x36aff1,null))[_0x229e('0x47')](handleError(_0x36aff1,null));};exports[_0x229e('0x4b')]=function(_0x2a2660,_0x2d466c){return db[_0x229e('0x43')][_0x229e('0x4b')](_0x2a2660['body'],{})[_0x229e('0x28')](function(_0x47fc14){var _0x38a914=_0x2a2660['user'][_0x229e('0x2a')]({'plain':!![]});if(!_0x38a914)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38a914['role']===_0x229e('0x4c')){var _0x6eda77=_0x47fc14['get']({'plain':!![]});var _0x3262dd=_0x229e('0x2b');return db[_0x229e('0x4d')][_0x229e('0x4a')]({'where':{'name':_0x3262dd,'userProfileId':_0x38a914[_0x229e('0x4e')]},'raw':!![]})['then'](function(_0x1d49e0){if(_0x1d49e0&&_0x1d49e0['autoAssociation']===0x0){return db[_0x229e('0x2c')]['create']({'name':_0x6eda77[_0x229e('0x2f')],'resourceId':_0x6eda77['id'],'type':_0x1d49e0[_0x229e('0x2f')],'sectionId':_0x1d49e0['id']},{})['then'](function(){return _0x47fc14;});}else{return _0x47fc14;}})['catch'](function(_0x27a8bb){logger[_0x229e('0x2d')](_0x229e('0x4f'),_0x27a8bb);throw _0x27a8bb;});}return _0x47fc14;})[_0x229e('0x28')](respondWithResult(_0x2d466c,0xc9))[_0x229e('0x47')](handleError(_0x2d466c,null));};exports[_0x229e('0x27')]=function(_0x3391f3,_0x18930e){if(_0x3391f3['body']['id']){delete _0x3391f3['body']['id'];}return db[_0x229e('0x43')][_0x229e('0x4a')]({'where':{'id':_0x3391f3[_0x229e('0x49')]['id']}})[_0x229e('0x28')](handleEntityNotFound(_0x18930e,null))[_0x229e('0x28')](saveUpdates(_0x3391f3[_0x229e('0x50')],null))[_0x229e('0x28')](respondWithResult(_0x18930e,null))['catch'](handleError(_0x18930e,null));};exports[_0x229e('0x29')]=function(_0x22fe34,_0x4d6491){return db[_0x229e('0x43')][_0x229e('0x4a')]({'where':{'id':_0x22fe34[_0x229e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d6491,null))[_0x229e('0x28')](removeEntity(_0x4d6491,null))['catch'](handleError(_0x4d6491,null));};exports[_0x229e('0x51')]=function(_0x36f256,_0x3ee86a){return db['CmCompany'][_0x229e('0x51')]()[_0x229e('0x28')](respondWithResult(_0x3ee86a,null))['catch'](handleError(_0x3ee86a,null));};exports[_0x229e('0x52')]=function(_0x26a9f3,_0x34f847,_0x5dc645){return db['CmContact'][_0x229e('0x4a')]({'where':{'id':_0x26a9f3[_0x229e('0x49')]['id']}})[_0x229e('0x28')](handleEntityNotFound(_0x34f847,null))[_0x229e('0x28')](function(_0x23f628){if(_0x23f628){return _0x23f628[_0x229e('0x52')](_0x26a9f3[_0x229e('0x50')]['ids'],_['omit'](_0x26a9f3[_0x229e('0x50')],[_0x229e('0x53'),'id'])||{});}})[_0x229e('0x28')](respondWithResult(_0x34f847,null))[_0x229e('0x47')](handleError(_0x34f847,null));};exports['getContacts']=function(_0x4f751a,_0x1dd504,_0x34a0ff){var _0x2369a2={};var _0x2ad6f8={};var _0x1b8d65;var _0xec39ef;return db[_0x229e('0x43')]['findOne']({'where':{'id':_0x4f751a['params']['id']}})[_0x229e('0x28')](handleEntityNotFound(_0x1dd504,null))['then'](function(_0x4a3278){if(_0x4a3278){_0x1b8d65=_0x4a3278;_0x2ad6f8[_0x229e('0x31')]=_[_0x229e('0x32')](db[_0x229e('0x54')]['rawAttributes']);_0x2ad6f8[_0x229e('0x33')]=_[_0x229e('0x32')](_0x4f751a[_0x229e('0x33')]);_0x2ad6f8['filters']=_[_0x229e('0x36')](_0x2ad6f8[_0x229e('0x31')],_0x2ad6f8[_0x229e('0x33')]);_0x2369a2[_0x229e('0x35')]=_['intersection'](_0x2ad6f8[_0x229e('0x31')],qs[_0x229e('0x37')](_0x4f751a['query'][_0x229e('0x37')]));_0x2369a2['attributes']=_0x2369a2[_0x229e('0x35')][_0x229e('0x38')]?_0x2369a2['attributes']:_0x2ad6f8[_0x229e('0x31')];_0x2369a2[_0x229e('0x3b')]=qs[_0x229e('0x3c')](_0x4f751a[_0x229e('0x33')][_0x229e('0x3c')]);_0x2369a2['where']=qs[_0x229e('0x34')](_[_0x229e('0x3e')](_0x4f751a[_0x229e('0x33')],_0x2ad6f8[_0x229e('0x34')]));if(_0x4f751a['query'][_0x229e('0x3f')]){_0x2369a2[_0x229e('0x3d')]=_[_0x229e('0x40')](_0x2369a2[_0x229e('0x3d')],{'$or':_[_0x229e('0x41')](_0x2369a2[_0x229e('0x35')],function(_0x5e083e){var _0x490539={};_0x490539[_0x5e083e]={'$like':'%'+_0x4f751a['query'][_0x229e('0x3f')]+'%'};return _0x490539;})});}_0x2369a2=_[_0x229e('0x40')]({},_0x2369a2,_0x4f751a[_0x229e('0x42')]);return _0x1b8d65['getContacts'](_0x2369a2);}})[_0x229e('0x28')](function(_0x3082ed){if(_0x3082ed){_0xec39ef=_0x3082ed[_0x229e('0x38')];if(!_0x4f751a['query'][_0x229e('0x39')](_0x229e('0x3a'))){_0x2369a2[_0x229e('0x21')]=qs['limit'](_0x4f751a[_0x229e('0x33')][_0x229e('0x21')]);_0x2369a2[_0x229e('0x1f')]=qs[_0x229e('0x1f')](_0x4f751a[_0x229e('0x33')][_0x229e('0x1f')]);}return _0x1b8d65[_0x229e('0x55')](_0x2369a2);}})[_0x229e('0x28')](function(_0x3543a7){if(_0x3543a7){return _0x3543a7?{'count':_0xec39ef,'rows':_0x3543a7}:null;}})[_0x229e('0x28')](respondWithResult(_0x1dd504,null))[_0x229e('0x47')](handleError(_0x1dd504,null));};
\ No newline at end of file
+var _0x0e97=['ids','omit','findOne','rawAttributes','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','Companies','UserProfileResource','sendStatus','error','name','index','CmCompany','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','filter','options','include','findAll','rows','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','CmContact'];(function(_0x35e7b3,_0x770749){var _0x1cb325=function(_0x157d26){while(--_0x157d26){_0x35e7b3['push'](_0x35e7b3['shift']());}};_0x1cb325(++_0x770749);}(_0x0e97,0x161));var _0x70e9=function(_0x87b0b9,_0x526c12){_0x87b0b9=_0x87b0b9-0x0;var _0x8ee1e5=_0x0e97[_0x87b0b9];return _0x8ee1e5;};'use strict';var emlformat=require(_0x70e9('0x0'));var rimraf=require(_0x70e9('0x1'));var zipdir=require(_0x70e9('0x2'));var jsonpatch=require(_0x70e9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x70e9('0x4'));var Mustache=require(_0x70e9('0x5'));var util=require(_0x70e9('0x6'));var path=require('path');var sox=require(_0x70e9('0x7'));var csv=require('to-csv');var ejs=require(_0x70e9('0x8'));var fs=require('fs');var fs_extra=require(_0x70e9('0x9'));var _=require(_0x70e9('0xa'));var squel=require(_0x70e9('0xb'));var crypto=require(_0x70e9('0xc'));var jsforce=require(_0x70e9('0xd'));var deskjs=require(_0x70e9('0xe'));var toCsv=require(_0x70e9('0xf'));var querystring=require(_0x70e9('0x10'));var Papa=require(_0x70e9('0x11'));var Redis=require(_0x70e9('0x12'));var authService=require(_0x70e9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x70e9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x70e9('0x15'));var utils=require(_0x70e9('0x16'));var config=require(_0x70e9('0x17'));var licenseUtil=require(_0x70e9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cc88b,_0x3f828e){_0x3f828e=_0x3f828e||0xcc;return function(_0x3a7d06){if(_0x3a7d06){return _0x4cc88b['sendStatus'](_0x3f828e);}return _0x4cc88b['status'](_0x3f828e)[_0x70e9('0x19')]();};}function respondWithResult(_0x384fdd,_0x388a5c){_0x388a5c=_0x388a5c||0xc8;return function(_0xed65a8){if(_0xed65a8){return _0x384fdd[_0x70e9('0x1a')](_0x388a5c)[_0x70e9('0x1b')](_0xed65a8);}};}function respondWithFilteredResult(_0x15aca1,_0x1532fd){return function(_0x3a5274){if(_0x3a5274){var _0x5b34c7=typeof _0x1532fd[_0x70e9('0x1c')]===_0x70e9('0x1d')&&typeof _0x1532fd['limit']===_0x70e9('0x1d');var _0x3b5042=_0x3a5274[_0x70e9('0x1e')];var _0x583bbe=_0x5b34c7?0x0:_0x1532fd[_0x70e9('0x1c')];var _0xa1c7dd=_0x5b34c7?_0x3a5274[_0x70e9('0x1e')]:_0x1532fd[_0x70e9('0x1c')]+_0x1532fd[_0x70e9('0x1f')];var _0xc131d3;if(_0xa1c7dd>=_0x3b5042){_0xa1c7dd=_0x3b5042;_0xc131d3=0xc8;}else{_0xc131d3=0xce;}_0x15aca1[_0x70e9('0x1a')](_0xc131d3);return _0x15aca1['set'](_0x70e9('0x20'),_0x583bbe+'-'+_0xa1c7dd+'/'+_0x3b5042)[_0x70e9('0x1b')](_0x3a5274);}return null;};}function patchUpdates(_0x26e78f){return function(_0xbd3b9b){try{jsonpatch[_0x70e9('0x21')](_0xbd3b9b,_0x26e78f,!![]);}catch(_0x4e7cee){return BPromise[_0x70e9('0x22')](_0x4e7cee);}return _0xbd3b9b['save']();};}function saveUpdates(_0x503a78,_0x4dbceb){return function(_0x3f44e1){if(_0x3f44e1){return _0x3f44e1['update'](_0x503a78)[_0x70e9('0x23')](function(_0x845dcf){return _0x845dcf;});}return null;};}function removeEntity(_0x4775dc,_0x4b2db4){return function(_0x1ee118){if(_0x1ee118){return _0x1ee118[_0x70e9('0x24')]()[_0x70e9('0x23')](function(){var _0x353595=_0x1ee118['get']({'plain':!![]});var _0x589e76=_0x70e9('0x25');return db[_0x70e9('0x26')][_0x70e9('0x24')]({'where':{'type':_0x589e76,'resourceId':_0x353595['id']}})[_0x70e9('0x23')](function(){return _0x1ee118;});})[_0x70e9('0x23')](function(){_0x4775dc[_0x70e9('0x1a')](0xcc)[_0x70e9('0x19')]();});}};}function handleEntityNotFound(_0xf1ee05,_0x3873df){return function(_0x133b75){if(!_0x133b75){_0xf1ee05[_0x70e9('0x27')](0x194);}return _0x133b75;};}function handleError(_0x55b25b,_0x990e41){_0x990e41=_0x990e41||0x1f4;return function(_0x1095f0){logger[_0x70e9('0x28')](_0x1095f0['stack']);if(_0x1095f0[_0x70e9('0x29')]){delete _0x1095f0['name'];}_0x55b25b['status'](_0x990e41)['send'](_0x1095f0);};}exports[_0x70e9('0x2a')]=function(_0x570251,_0x2ab076){var _0x415630={},_0x594bbe={},_0x9ed922={'count':0x0,'rows':[]};return db[_0x70e9('0x2b')]['describe']()[_0x70e9('0x23')](function(_0x375862){_0x594bbe[_0x70e9('0x2c')]=_[_0x70e9('0x2d')](_0x375862);_0x594bbe[_0x70e9('0x2e')]=_[_0x70e9('0x2d')](_0x570251['query']);_0x594bbe['filters']=_[_0x70e9('0x2f')](_0x594bbe[_0x70e9('0x2c')],_0x594bbe[_0x70e9('0x2e')]);_0x415630['attributes']=_[_0x70e9('0x2f')](_0x594bbe[_0x70e9('0x2c')],qs[_0x70e9('0x30')](_0x570251[_0x70e9('0x2e')][_0x70e9('0x30')]));_0x415630[_0x70e9('0x31')]=_0x415630[_0x70e9('0x31')][_0x70e9('0x32')]?_0x415630[_0x70e9('0x31')]:_0x594bbe['model'];if(!_0x570251[_0x70e9('0x2e')][_0x70e9('0x33')](_0x70e9('0x34'))){_0x415630[_0x70e9('0x1f')]=qs['limit'](_0x570251[_0x70e9('0x2e')][_0x70e9('0x1f')]);_0x415630[_0x70e9('0x1c')]=qs[_0x70e9('0x1c')](_0x570251[_0x70e9('0x2e')][_0x70e9('0x1c')]);}_0x415630[_0x70e9('0x35')]=qs[_0x70e9('0x36')](_0x570251[_0x70e9('0x2e')][_0x70e9('0x36')]);_0x415630['where']=qs['filters'](_['pick'](_0x570251[_0x70e9('0x2e')],_0x594bbe[_0x70e9('0x37')]),_0x375862);if(_0x570251[_0x70e9('0x2e')]['filter']){_0x415630[_0x70e9('0x38')]=_[_0x70e9('0x39')](_0x415630[_0x70e9('0x38')],{'$or':_[_0x70e9('0x3a')](_0x415630[_0x70e9('0x31')],function(_0x18cb40){var _0x116919={};_0x116919[_0x18cb40]={'$like':'%'+_0x570251[_0x70e9('0x2e')][_0x70e9('0x3b')]+'%'};return _0x116919;})});}_0x415630=_[_0x70e9('0x39')]({},_0x415630,_0x570251[_0x70e9('0x3c')]);var _0x2f6696={'where':_0x415630[_0x70e9('0x38')]};return db['CmCompany'][_0x70e9('0x1e')](_0x2f6696)[_0x70e9('0x23')](function(_0x13434a){_0x9ed922[_0x70e9('0x1e')]=_0x13434a;if(_0x570251[_0x70e9('0x2e')]['includeAll']){_0x415630[_0x70e9('0x3d')]=[{'all':!![]}];}return db[_0x70e9('0x2b')][_0x70e9('0x3e')](_0x415630);})[_0x70e9('0x23')](function(_0x27668e){_0x9ed922[_0x70e9('0x3f')]=_0x27668e;return _0x9ed922;})[_0x70e9('0x23')](respondWithFilteredResult(_0x2ab076,_0x415630))['catch'](handleError(_0x2ab076,null));})[_0x70e9('0x40')](handleError(_0x2ab076,null));};exports[_0x70e9('0x41')]=function(_0x208664,_0x3d0546){var _0x2f4071={'raw':![],'where':{'id':_0x208664['params']['id']}},_0x45d5c1={};_0x45d5c1[_0x70e9('0x2c')]=_[_0x70e9('0x2d')](db[_0x70e9('0x2b')]['rawAttributes']);_0x45d5c1[_0x70e9('0x2e')]=_[_0x70e9('0x2d')](_0x208664[_0x70e9('0x2e')]);_0x45d5c1[_0x70e9('0x37')]=_['intersection'](_0x45d5c1[_0x70e9('0x2c')],_0x45d5c1[_0x70e9('0x2e')]);_0x2f4071[_0x70e9('0x31')]=_[_0x70e9('0x2f')](_0x45d5c1[_0x70e9('0x2c')],qs[_0x70e9('0x30')](_0x208664[_0x70e9('0x2e')][_0x70e9('0x30')]));_0x2f4071[_0x70e9('0x31')]=_0x2f4071[_0x70e9('0x31')][_0x70e9('0x32')]?_0x2f4071[_0x70e9('0x31')]:_0x45d5c1[_0x70e9('0x2c')];if(_0x208664[_0x70e9('0x2e')][_0x70e9('0x42')]){_0x2f4071['include']=[{'all':!![]}];}_0x2f4071=_['merge']({},_0x2f4071,_0x208664[_0x70e9('0x3c')]);return db[_0x70e9('0x2b')][_0x70e9('0x43')](_0x2f4071)[_0x70e9('0x23')](handleEntityNotFound(_0x3d0546,null))['then'](respondWithResult(_0x3d0546,null))[_0x70e9('0x40')](handleError(_0x3d0546,null));};exports[_0x70e9('0x44')]=function(_0x355c0a,_0xd7fcba){return db[_0x70e9('0x2b')][_0x70e9('0x44')](_0x355c0a['body'],{})[_0x70e9('0x23')](function(_0x1def4e){var _0x4a4380=_0x355c0a[_0x70e9('0x45')][_0x70e9('0x46')]({'plain':!![]});if(!_0x4a4380)throw new Error(_0x70e9('0x47'));if(_0x4a4380['role']===_0x70e9('0x45')){var _0x58d05a=_0x1def4e[_0x70e9('0x46')]({'plain':!![]});var _0x3b4b16=_0x70e9('0x25');return db[_0x70e9('0x48')][_0x70e9('0x43')]({'where':{'name':_0x3b4b16,'userProfileId':_0x4a4380[_0x70e9('0x49')]},'raw':!![]})[_0x70e9('0x23')](function(_0x5ade45){if(_0x5ade45&&_0x5ade45[_0x70e9('0x4a')]===0x0){return db[_0x70e9('0x26')][_0x70e9('0x44')]({'name':_0x58d05a[_0x70e9('0x29')],'resourceId':_0x58d05a['id'],'type':_0x5ade45[_0x70e9('0x29')],'sectionId':_0x5ade45['id']},{})[_0x70e9('0x23')](function(){return _0x1def4e;});}else{return _0x1def4e;}})[_0x70e9('0x40')](function(_0x35b3d4){logger[_0x70e9('0x28')](_0x70e9('0x4b'),_0x35b3d4);throw _0x35b3d4;});}return _0x1def4e;})['then'](respondWithResult(_0xd7fcba,0xc9))[_0x70e9('0x40')](handleError(_0xd7fcba,null));};exports[_0x70e9('0x4c')]=function(_0x3b0f67,_0x44b55f){if(_0x3b0f67[_0x70e9('0x4d')]['id']){delete _0x3b0f67['body']['id'];}return db[_0x70e9('0x2b')]['find']({'where':{'id':_0x3b0f67[_0x70e9('0x4e')]['id']}})[_0x70e9('0x23')](handleEntityNotFound(_0x44b55f,null))[_0x70e9('0x23')](saveUpdates(_0x3b0f67['body'],null))[_0x70e9('0x23')](respondWithResult(_0x44b55f,null))[_0x70e9('0x40')](handleError(_0x44b55f,null));};exports[_0x70e9('0x24')]=function(_0x280e20,_0x14b0da){return db[_0x70e9('0x2b')][_0x70e9('0x43')]({'where':{'id':_0x280e20[_0x70e9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x14b0da,null))[_0x70e9('0x23')](removeEntity(_0x14b0da,null))[_0x70e9('0x40')](handleError(_0x14b0da,null));};exports[_0x70e9('0x4f')]=function(_0x299677,_0x12bc23){return db[_0x70e9('0x2b')][_0x70e9('0x4f')]()[_0x70e9('0x23')](respondWithResult(_0x12bc23,null))[_0x70e9('0x40')](handleError(_0x12bc23,null));};exports[_0x70e9('0x50')]=function(_0x4b35f0,_0x559944,_0x92aec3){return db[_0x70e9('0x51')][_0x70e9('0x43')]({'where':{'id':_0x4b35f0[_0x70e9('0x4e')]['id']}})[_0x70e9('0x23')](handleEntityNotFound(_0x559944,null))['then'](function(_0x3a3bfe){if(_0x3a3bfe){return _0x3a3bfe[_0x70e9('0x50')](_0x4b35f0[_0x70e9('0x4d')][_0x70e9('0x52')],_[_0x70e9('0x53')](_0x4b35f0[_0x70e9('0x4d')],['ids','id'])||{});}})[_0x70e9('0x23')](respondWithResult(_0x559944,null))['catch'](handleError(_0x559944,null));};exports['getContacts']=function(_0x48ee05,_0x3cb6e9,_0x3364b7){var _0x67a51f={};var _0x51deb7={};var _0x179e5b;var _0x31ace4;return db[_0x70e9('0x2b')][_0x70e9('0x54')]({'where':{'id':_0x48ee05[_0x70e9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3cb6e9,null))['then'](function(_0x5d7a8a){if(_0x5d7a8a){_0x179e5b=_0x5d7a8a;_0x51deb7[_0x70e9('0x2c')]=_[_0x70e9('0x2d')](db[_0x70e9('0x51')][_0x70e9('0x55')]);_0x51deb7['query']=_[_0x70e9('0x2d')](_0x48ee05['query']);_0x51deb7[_0x70e9('0x37')]=_[_0x70e9('0x2f')](_0x51deb7['model'],_0x51deb7[_0x70e9('0x2e')]);_0x67a51f['attributes']=_[_0x70e9('0x2f')](_0x51deb7['model'],qs[_0x70e9('0x30')](_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x30')]));_0x67a51f[_0x70e9('0x31')]=_0x67a51f['attributes']['length']?_0x67a51f[_0x70e9('0x31')]:_0x51deb7[_0x70e9('0x2c')];_0x67a51f[_0x70e9('0x35')]=qs[_0x70e9('0x36')](_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x36')]);_0x67a51f['where']=qs[_0x70e9('0x37')](_['pick'](_0x48ee05[_0x70e9('0x2e')],_0x51deb7['filters']));if(_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x3b')]){_0x67a51f[_0x70e9('0x38')]=_[_0x70e9('0x39')](_0x67a51f['where'],{'$or':_['map'](_0x67a51f['attributes'],function(_0x33d09c){var _0x552585={};_0x552585[_0x33d09c]={'$like':'%'+_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x3b')]+'%'};return _0x552585;})});}_0x67a51f=_[_0x70e9('0x39')]({},_0x67a51f,_0x48ee05[_0x70e9('0x3c')]);return _0x179e5b[_0x70e9('0x56')](_0x67a51f);}})['then'](function(_0x46dc5e){if(_0x46dc5e){_0x31ace4=_0x46dc5e['length'];if(!_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x33')](_0x70e9('0x34'))){_0x67a51f['limit']=qs['limit'](_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x1f')]);_0x67a51f[_0x70e9('0x1c')]=qs[_0x70e9('0x1c')](_0x48ee05['query'][_0x70e9('0x1c')]);}return _0x179e5b[_0x70e9('0x56')](_0x67a51f);}})['then'](function(_0xb6d0cf){if(_0xb6d0cf){return _0xb6d0cf?{'count':_0x31ace4,'rows':_0xb6d0cf}:null;}})['then'](respondWithResult(_0x3cb6e9,null))[_0x70e9('0x40')](handleError(_0x3cb6e9,null));};
\ No newline at end of file
index 3b211d5..f7eb654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3ab=['api','moment','bluebird','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util'];(function(_0x17e94c,_0x86bf53){var _0x257169=function(_0x24f0e0){while(--_0x24f0e0){_0x17e94c['push'](_0x17e94c['shift']());}};_0x257169(++_0x86bf53);}(_0xc3ab,0xae));var _0xbc3a=function(_0x28acc4,_0x23586){_0x28acc4=_0x28acc4-0x0;var _0x207585=_0xc3ab[_0x28acc4];return _0x207585;};'use strict';var _=require(_0xbc3a('0x0'));var util=require(_0xbc3a('0x1'));var logger=require('../../config/logger')(_0xbc3a('0x2'));var moment=require(_0xbc3a('0x3'));var BPromise=require(_0xbc3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc3a('0x5'));var rimraf=require(_0xbc3a('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc3a('0x7'));module[_0xbc3a('0x8')]=function(_0x175be7,_0x2d0d92){return _0x175be7[_0xbc3a('0x9')](_0xbc3a('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6096=['path','rimraf','../../config/environment','define','cm_companies','lodash','util','../../config/logger','api','request-promise'];(function(_0x36accc,_0xc4b9b3){var _0x5e8daf=function(_0x2950de){while(--_0x2950de){_0x36accc['push'](_0x36accc['shift']());}};_0x5e8daf(++_0xc4b9b3);}(_0x6096,0x7d));var _0x6609=function(_0x4cd6b9,_0x2da770){_0x4cd6b9=_0x4cd6b9-0x0;var _0x4437ea=_0x6096[_0x4cd6b9];return _0x4437ea;};'use strict';var _=require(_0x6609('0x0'));var util=require(_0x6609('0x1'));var logger=require(_0x6609('0x2'))(_0x6609('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6609('0x4'));var fs=require('fs');var path=require(_0x6609('0x5'));var rimraf=require(_0x6609('0x6'));var config=require(_0x6609('0x7'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x27f082,_0x4c56c7){return _0x27f082[_0x6609('0x8')]('CmCompany',attributes,{'tableName':_0x6609('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ed0eee5..7fe0a13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b29=['request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x113a8f,_0x52894b){var _0x1c5708=function(_0x2dc65b){while(--_0x2dc65b){_0x113a8f['push'](_0x113a8f['shift']());}};_0x1c5708(++_0x52894b);}(_0x6b29,0x141));var _0x96b2=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x6b29[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x96b2('0x0'));var util=require(_0x96b2('0x1'));var moment=require(_0x96b2('0x2'));var BPromise=require(_0x96b2('0x3'));var rs=require(_0x96b2('0x4'));var fs=require('fs');var Redis=require(_0x96b2('0x5'));var db=require(_0x96b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x96b2('0x7'))(_0x96b2('0x8'));var config=require(_0x96b2('0x9'));var jayson=require(_0x96b2('0xa'));var client=jayson['client'][_0x96b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5313e3,_0x5e7d20,_0x42fcce){return new BPromise(function(_0x471fe9,_0x173b00){return client['request'](_0x5313e3,_0x42fcce)[_0x96b2('0xc')](function(_0x31e5dc){logger[_0x96b2('0xd')](_0x96b2('0xe'),_0x5e7d20,_0x96b2('0xf'));logger[_0x96b2('0x10')](_0x96b2('0x11'),_0x5e7d20,_0x96b2('0xf'),JSON['stringify'](_0x31e5dc));if(_0x31e5dc[_0x96b2('0x12')]){if(_0x31e5dc[_0x96b2('0x12')]['code']===0x1f4){logger[_0x96b2('0x12')](_0x96b2('0xe'),_0x5e7d20,_0x31e5dc['error'][_0x96b2('0x13')]);return _0x173b00(_0x31e5dc[_0x96b2('0x12')][_0x96b2('0x13')]);}logger[_0x96b2('0x12')](_0x96b2('0xe'),_0x5e7d20,_0x31e5dc[_0x96b2('0x12')][_0x96b2('0x13')]);return _0x471fe9(_0x31e5dc[_0x96b2('0x12')][_0x96b2('0x13')]);}else{logger[_0x96b2('0xd')](_0x96b2('0xe'),_0x5e7d20,_0x96b2('0xf'));_0x471fe9(_0x31e5dc[_0x96b2('0x14')][_0x96b2('0x13')]);}})['catch'](function(_0x23b818){logger['error'](_0x96b2('0xe'),_0x5e7d20,_0x23b818);_0x173b00(_0x23b818);});});}
\ No newline at end of file
+var _0x3c99=['rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x3c99,0x189));var _0x93c9=function(_0x1761f7,_0x3367c7){_0x1761f7=_0x1761f7-0x0;var _0xfb470b=_0x3c99[_0x1761f7];return _0xfb470b;};'use strict';var _=require('lodash');var util=require(_0x93c9('0x0'));var moment=require(_0x93c9('0x1'));var BPromise=require(_0x93c9('0x2'));var rs=require(_0x93c9('0x3'));var fs=require('fs');var Redis=require(_0x93c9('0x4'));var db=require(_0x93c9('0x5'))['db'];var utils=require(_0x93c9('0x6'));var logger=require('../../config/logger')(_0x93c9('0x7'));var config=require(_0x93c9('0x8'));var jayson=require(_0x93c9('0x9'));var client=jayson['client'][_0x93c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c8f1e,_0x476d99,_0x5a4a7e){return new BPromise(function(_0x3f4865,_0x30b1dd){return client['request'](_0x4c8f1e,_0x5a4a7e)[_0x93c9('0xb')](function(_0x518d62){logger['info']('CmCompany,\x20%s,\x20%s',_0x476d99,_0x93c9('0xc'));logger[_0x93c9('0xd')](_0x93c9('0xe'),_0x476d99,_0x93c9('0xc'),JSON[_0x93c9('0xf')](_0x518d62));if(_0x518d62['error']){if(_0x518d62[_0x93c9('0x10')]['code']===0x1f4){logger['error'](_0x93c9('0x11'),_0x476d99,_0x518d62['error'][_0x93c9('0x12')]);return _0x30b1dd(_0x518d62[_0x93c9('0x10')][_0x93c9('0x12')]);}logger[_0x93c9('0x10')](_0x93c9('0x11'),_0x476d99,_0x518d62['error'][_0x93c9('0x12')]);return _0x3f4865(_0x518d62['error'][_0x93c9('0x12')]);}else{logger[_0x93c9('0x13')](_0x93c9('0x11'),_0x476d99,_0x93c9('0xc'));_0x3f4865(_0x518d62['result']['message']);}})['catch'](function(_0x26184a){logger[_0x93c9('0x10')](_0x93c9('0x11'),_0x476d99,_0x26184a);_0x30b1dd(_0x26184a);});});}
\ No newline at end of file
index 371439d..e375bf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ee7=['../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x38cac1,_0x1c852){var _0x386a7c=function(_0x205246){while(--_0x205246){_0x38cac1['push'](_0x38cac1['shift']());}};_0x386a7c(++_0x1c852);}(_0x3ee7,0xe1));var _0x73ee=function(_0x36375a,_0x43ede3){_0x36375a=_0x36375a-0x0;var _0xe646d0=_0x3ee7[_0x36375a];return _0xe646d0;};'use strict';var multer=require(_0x73ee('0x0'));var util=require(_0x73ee('0x1'));var path=require(_0x73ee('0x2'));var timeout=require('connect-timeout');var express=require(_0x73ee('0x3'));var router=express[_0x73ee('0x4')]();var fs_extra=require(_0x73ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x73ee('0x6'));var config=require('../../config/environment');var controller=require(_0x73ee('0x7'));router[_0x73ee('0x8')]('/',auth[_0x73ee('0x9')](),controller[_0x73ee('0xa')]);router[_0x73ee('0x8')](_0x73ee('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x73ee('0xc'),auth['isAuthenticated'](),controller[_0x73ee('0xd')]);router[_0x73ee('0x8')](_0x73ee('0xe'),auth[_0x73ee('0x9')](),controller[_0x73ee('0xf')]);router[_0x73ee('0x10')]('/',auth[_0x73ee('0x9')](),controller['create']);router[_0x73ee('0x10')]('/:id/contacts',auth[_0x73ee('0x9')](),controller[_0x73ee('0x11')]);router[_0x73ee('0x12')](_0x73ee('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x73ee('0x13')](_0x73ee('0xc'),auth[_0x73ee('0x9')](),controller[_0x73ee('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x18e9=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','create','addContacts','put','update','delete'];(function(_0x468f91,_0x2cb8e1){var _0x36e3a8=function(_0xe418d2){while(--_0xe418d2){_0x468f91['push'](_0x468f91['shift']());}};_0x36e3a8(++_0x2cb8e1);}(_0x18e9,0x1e5));var _0x918e=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x18e9[_0xdc37a1];return _0x99b4fe;};'use strict';var multer=require(_0x918e('0x0'));var util=require(_0x918e('0x1'));var path=require(_0x918e('0x2'));var timeout=require(_0x918e('0x3'));var express=require(_0x918e('0x4'));var router=express['Router']();var fs_extra=require(_0x918e('0x5'));var auth=require(_0x918e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x918e('0x7'));var controller=require('./cmCompany.controller');router[_0x918e('0x8')]('/',auth[_0x918e('0x9')](),controller[_0x918e('0xa')]);router['get'](_0x918e('0xb'),auth[_0x918e('0x9')](),controller['describe']);router[_0x918e('0x8')](_0x918e('0xc'),auth[_0x918e('0x9')](),controller[_0x918e('0xd')]);router[_0x918e('0x8')](_0x918e('0xe'),auth[_0x918e('0x9')](),controller[_0x918e('0xf')]);router['post']('/',auth[_0x918e('0x9')](),controller[_0x918e('0x10')]);router['post'](_0x918e('0xe'),auth['isAuthenticated'](),controller[_0x918e('0x11')]);router[_0x918e('0x12')]('/:id',auth[_0x918e('0x9')](),controller[_0x918e('0x13')]);router[_0x918e('0x14')](_0x918e('0xc'),auth[_0x918e('0x9')](),controller[_0x918e('0x15')]);module[_0x918e('0x16')]=router;
\ No newline at end of file
index 4dc6048..f20d619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf67a=['DATE','NOW','lodash','exports','STRING','INTEGER'];(function(_0x314331,_0x31e602){var _0xe15a39=function(_0x47d522){while(--_0x47d522){_0x314331['push'](_0x314331['shift']());}};_0xe15a39(++_0x31e602);}(_0xf67a,0x1b8));var _0xaf67=function(_0x1dadda,_0x158116){_0x1dadda=_0x1dadda-0x0;var _0x37e931=_0xf67a[_0x1dadda];return _0x37e931;};'use strict';var _=require(_0xaf67('0x0'));var Sequelize=require('sequelize');module[_0xaf67('0x1')]={'firstName':{'type':Sequelize[_0xaf67('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xaf67('0x2')]},'street':{'type':Sequelize[_0xaf67('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xaf67('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xaf67('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xaf67('0x2')]},'mobile':{'type':Sequelize[_0xaf67('0x2')]},'fax':{'type':Sequelize[_0xaf67('0x2')]},'email':{'type':Sequelize[_0xaf67('0x2')]},'url':{'type':Sequelize[_0xaf67('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xaf67('0x2')]},'skype':{'type':Sequelize[_0xaf67('0x2')]},'teams':{'type':Sequelize[_0xaf67('0x2')]},'viber':{'type':Sequelize[_0xaf67('0x2')]},'line':{'type':Sequelize[_0xaf67('0x2')]},'wechat':{'type':Sequelize[_0xaf67('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xaf67('0x3')]},'priority':{'type':Sequelize[_0xaf67('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xaf67('0x4')],'defaultValue':Sequelize[_0xaf67('0x5')]}};
\ No newline at end of file
+var _0xb88a=['TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x42f393,_0x3e0df0){var _0x2b035d=function(_0x36af6e){while(--_0x36af6e){_0x42f393['push'](_0x42f393['shift']());}};_0x2b035d(++_0x3e0df0);}(_0xb88a,0x1c4));var _0xab88=function(_0x364438,_0x156cd5){_0x364438=_0x364438-0x0;var _0x1abb30=_0xb88a[_0x364438];return _0x1abb30;};'use strict';var _=require(_0xab88('0x0'));var Sequelize=require(_0xab88('0x1'));module[_0xab88('0x2')]={'firstName':{'type':Sequelize[_0xab88('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xab88('0x3')]},'street':{'type':Sequelize[_0xab88('0x3')]},'postalCode':{'type':Sequelize[_0xab88('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xab88('0x3')]},'dateOfBirth':{'type':Sequelize[_0xab88('0x3')]},'description':{'type':Sequelize[_0xab88('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xab88('0x3')]},'fax':{'type':Sequelize[_0xab88('0x3')]},'email':{'type':Sequelize[_0xab88('0x3')]},'url':{'type':Sequelize[_0xab88('0x3')]},'facebook':{'type':Sequelize[_0xab88('0x3')]},'fb_data':{'type':Sequelize[_0xab88('0x3')]},'twitter':{'type':Sequelize[_0xab88('0x3')]},'skype':{'type':Sequelize[_0xab88('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xab88('0x3')]},'line':{'type':Sequelize[_0xab88('0x3')]},'wechat':{'type':Sequelize[_0xab88('0x3')]},'telegram':{'type':Sequelize[_0xab88('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xab88('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xab88('0x6')],'defaultValue':Sequelize[_0xab88('0x7')]}};
\ No newline at end of file
index 5e22022..bf2d0b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbd2=['status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','error','stack','name','send','CmContact','describe','length','keys','startsWith','cf_','push','CmCustomField','findOne','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','text','filter','isNil','Contact','c.ListId\x20IN\x20?','\x20=\x20?','isArray','tag','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','having','resolve','role','agent','User','c.ListId\x20IS\x20NULL','user','toString','sequelize','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','alias','custom','type','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','info','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','bulkCreate','duplicates','$or','ListId','findOrCreate','spread','$and','format','cf_%d','omit','pickBy','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','import','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','starttime','endtime','note','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','channel','startCase','Account','closed','closedAt','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','referer','subject','substatus','threadId','Interaction','findAndCountAll','sortBy','reverse','slice','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register'];(function(_0x1ef97c,_0x3a65f0){var _0x199029=function(_0x586208){while(--_0x586208){_0x1ef97c['push'](_0x1ef97c['shift']());}};_0x199029(++_0x3a65f0);}(_0xbbd2,0x100));var _0x2bbd=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xbbd2[_0x15ea09];return _0x3e9c78;};'use strict';var moment=require(_0x2bbd('0x0'));var BPromise=require('bluebird');var util=require(_0x2bbd('0x1'));var path=require(_0x2bbd('0x2'));var fs=require('fs');var _=require(_0x2bbd('0x3'));var squel=require(_0x2bbd('0x4'));var Papa=require(_0x2bbd('0x5'));var Redis=require(_0x2bbd('0x6'));var qs=require(_0x2bbd('0x7'));var as=require(_0x2bbd('0x8'));var logger=require(_0x2bbd('0x9'))(_0x2bbd('0xa'));var config=require(_0x2bbd('0xb'));var db=require(_0x2bbd('0xc'))['db'];config[_0x2bbd('0xd')]=_['defaults'](config[_0x2bbd('0xd')],{'host':_0x2bbd('0xe'),'port':0x18eb});var socket=require(_0x2bbd('0xf'))(new Redis(config['redis']));require(_0x2bbd('0x10'))[_0x2bbd('0x11')](socket);function respondWithResult(_0x3c4634,_0x3d582e){_0x3d582e=_0x3d582e||0xc8;return function(_0x3ec7cb){if(_0x3ec7cb){return _0x3c4634[_0x2bbd('0x12')](_0x3d582e)[_0x2bbd('0x13')](_0x3ec7cb);}};}function respondWithFilteredResult(_0x5ed59c,_0x1e7a09){return function(_0x3de9b0){if(_0x3de9b0){var _0xe20eed=typeof _0x1e7a09[_0x2bbd('0x14')]===_0x2bbd('0x15')&&typeof _0x1e7a09[_0x2bbd('0x16')]==='undefined';var _0x3d8ff6=_0x3de9b0['count'];var _0x1be2c3=_0xe20eed?0x0:_0x1e7a09[_0x2bbd('0x14')];var _0x2248ac=_0xe20eed?_0x3de9b0[_0x2bbd('0x17')]:_0x1e7a09[_0x2bbd('0x14')]+_0x1e7a09[_0x2bbd('0x16')];var _0x3a39ae;if(_0x2248ac>=_0x3d8ff6){_0x2248ac=_0x3d8ff6;_0x3a39ae=0xc8;}else{_0x3a39ae=0xce;}_0x5ed59c[_0x2bbd('0x12')](_0x3a39ae);return _0x5ed59c[_0x2bbd('0x18')]('Content-Range',_0x1be2c3+'-'+_0x2248ac+'/'+_0x3d8ff6)[_0x2bbd('0x13')](_0x3de9b0);}return null;};}function saveUpdates(_0x404101){return function(_0x232503){if(_0x232503){return _0x232503[_0x2bbd('0x19')](_0x404101)[_0x2bbd('0x1a')](function(_0x15b975){return _0x15b975;});}return null;};}function removeEntity(_0x490695){return function(_0xc20f3c){if(_0xc20f3c){return _0xc20f3c[_0x2bbd('0x1b')]()[_0x2bbd('0x1a')](function(){_0x490695[_0x2bbd('0x12')](0xcc)[_0x2bbd('0x1c')]();});}};}function handleEntityNotFound(_0xfd799e){return function(_0x16174a){if(!_0x16174a){_0xfd799e[_0x2bbd('0x1d')](0x194);}return _0x16174a;};}function handleError(_0x2df9bf,_0x498299){_0x498299=_0x498299||0x1f4;return function(_0x1e50d1){logger[_0x2bbd('0x1e')](_0x1e50d1[_0x2bbd('0x1f')]);if(_0x1e50d1[_0x2bbd('0x20')]){delete _0x1e50d1[_0x2bbd('0x20')];}_0x2df9bf[_0x2bbd('0x12')](_0x498299)[_0x2bbd('0x21')](_0x1e50d1);};}exports['index']=function(_0x151969,_0x1aba5a){var _0xf08d87={},_0x5e1cf5={},_0x32e715={'count':0x0,'rows':[]};return db[_0x2bbd('0x22')][_0x2bbd('0x23')]()['then'](function(_0x5dd706){var _0x1c4928=[];for(var _0x522e71=0x0;_0x522e71<Object['keys'](_0x5dd706)[_0x2bbd('0x24')];_0x522e71++){var _0x1d9a6d=Object[_0x2bbd('0x25')](_0x5dd706)[_0x522e71];if(_[_0x2bbd('0x26')](_0x1d9a6d,_0x2bbd('0x27'))){_0x1c4928[_0x2bbd('0x28')](db[_0x2bbd('0x29')][_0x2bbd('0x2a')]({'where':{'id':_['trimStart'](_0x1d9a6d,_0x2bbd('0x27'))},'raw':!![]}));}}return BPromise[_0x2bbd('0x2b')](_0x1c4928)[_0x2bbd('0x1a')](function(_0x486286){for(var _0xcfb1f8=0x0;_0xcfb1f8<_0x486286[_0x2bbd('0x24')];_0xcfb1f8++){if(_0x486286[_0xcfb1f8]){var _0x3b3263=_0x2bbd('0x27')+_0x486286[_0xcfb1f8]['id'];var _0x2955d3=_0x5dd706[_0x3b3263];_0x2955d3[_0x2bbd('0x2c')]=_0x486286[_0xcfb1f8]['type'];}}return _0x5dd706;});})[_0x2bbd('0x1a')](function(_0x4aa92d){_0x5e1cf5[_0x2bbd('0x2d')]=_[_0x2bbd('0x25')](_0x4aa92d);_0x5e1cf5[_0x2bbd('0x2e')]=_[_0x2bbd('0x25')](_0x151969[_0x2bbd('0x2e')]);_0x5e1cf5[_0x2bbd('0x2f')]=_[_0x2bbd('0x30')](_0x5e1cf5[_0x2bbd('0x2d')],_0x5e1cf5[_0x2bbd('0x2e')]);_0xf08d87[_0x2bbd('0x31')]=_['intersection'](_0x5e1cf5['model'],qs['fields'](_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x32')]));_0xf08d87['attributes']=_0xf08d87[_0x2bbd('0x31')][_0x2bbd('0x24')]?_0xf08d87[_0x2bbd('0x31')]:_0x5e1cf5[_0x2bbd('0x2d')];if(!_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x33')](_0x2bbd('0x34'))){_0xf08d87[_0x2bbd('0x16')]=qs[_0x2bbd('0x16')](_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x16')]);_0xf08d87['offset']=qs[_0x2bbd('0x14')](_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x14')]);}_0xf08d87[_0x2bbd('0x35')]=qs[_0x2bbd('0x36')](_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x36')]);_0xf08d87['where']=qs[_0x2bbd('0x2f')](_[_0x2bbd('0x37')](_0x151969['query'],_0x5e1cf5['filters']),_0x4aa92d);var _0x8d3f2=[];var _0x38e07d=squel[_0x2bbd('0x38')]()[_0x2bbd('0x39')]('id')[_0x2bbd('0x39')](_0x2bbd('0x20'))[_0x2bbd('0x39')](_0x2bbd('0x3a'))[_0x2bbd('0x3b')](_0x2bbd('0x3c'));var _0x4e49b4=squel[_0x2bbd('0x38')]()[_0x2bbd('0x3b')](_0x2bbd('0x3d'),'c')[_0x2bbd('0x3e')]('cm_user_has_contacts','uc',_0x2bbd('0x3f'))[_0x2bbd('0x3e')]('cm_contact_has_tags','ct',_0x2bbd('0x40'))[_0x2bbd('0x3e')]('tools_tags','t',_0x2bbd('0x41'))[_0x2bbd('0x42')](_0x2bbd('0x43'));var _0x3f0771=squel['expr']();var _0x549568=[];var _0x5ce3f3=squel[_0x2bbd('0x44')]();var _0x4b8236;if(_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x45')]){_0x4b8236=as['parseSearch'](_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x45')]);var _0x34f2c6=_0x4b8236[_0x2bbd('0x46')];for(var _0x44aaf6=0x0;_0x44aaf6<_0x4b8236[_0x2bbd('0x47')]['length'];_0x44aaf6++){var _0xf5a5ff=_0x4b8236[_0x2bbd('0x47')][_0x44aaf6];var _0x4f555e='c';var _0x3cc7d6=_(_0x4aa92d)[_0x2bbd('0x25')]()[_0x2bbd('0x48')](function(_0x57e658){return _0x57e658===_0xf5a5ff['field'];});if(_0x3cc7d6)_0x3cc7d6=_0x4aa92d[_0xf5a5ff[_0x2bbd('0x39')]];if(!_0x3cc7d6){if(_0xf5a5ff[_0x2bbd('0x39')]===_0x2bbd('0x49')){var _0xfccd7e=_0xf5a5ff[_0x2bbd('0x4a')]['split'](',')[_0x2bbd('0x4b')](function(_0x22cf86){return Number(_0x22cf86);});_0xfccd7e[_0x2bbd('0x4c')](function(_0x1116c4){_0x5ce3f3['or'](_0x2bbd('0x4d'),'%,'+_0x1116c4+',%');});_0x549568=_[_0x2bbd('0x4e')](_0x549568,_0xfccd7e);}else if(_0xf5a5ff[_0x2bbd('0x39')]==='User'){_0x3f0771[_0x2bbd('0x4f')](_0x2bbd('0x50'),_0xf5a5ff['value']);}}else{if(_0xf5a5ff[_0x2bbd('0x39')]==='dateOfBirth'||_0x3cc7d6[_0x2bbd('0x2c')]===_0x2bbd('0x51'))_0xf5a5ff[_0x2bbd('0x52')]=_0x2bbd('0x53');var _0x5afa6f=as['buildExpression'](_0x4f555e,_0x3cc7d6['type'],_0xf5a5ff);_0x3f0771[_0x34f2c6](_0x5afa6f[_0x2bbd('0x54')],_0x5afa6f[_0x2bbd('0x4a')]['start'],_0x5afa6f[_0x2bbd('0x4a')][_0x2bbd('0x1c')]);}}}else{var _0x1b19e7=_(Object['keys'](_0x151969['query']))[_0x2bbd('0x4b')](function(_0x1d2483){return _0x4aa92d[_0x2bbd('0x33')](_0x1d2483)?_0x1d2483:undefined;})[_0x2bbd('0x55')](function(_0x15fd9f){return!_[_0x2bbd('0x56')](_0x15fd9f);})[_0x2bbd('0x4a')]();if(_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x57')])_0x1b19e7[_0x2bbd('0x28')](_0x2bbd('0x57'));if(!_['isEmpty'](_0x1b19e7)){_0x1b19e7[_0x2bbd('0x4c')](function(_0x256a09){if(_0x256a09==='ListId'){_0x4e49b4['where'](_0x2bbd('0x58'),[]['concat'](_0x151969[_0x2bbd('0x2e')][_0x256a09]));}else if(_0x256a09==='Contact'){var _0x1f64ca='%'+_0x151969[_0x2bbd('0x2e')][_0x256a09]+'%';_0x4e49b4[_0x2bbd('0x42')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x1f64ca);}else{_0x4e49b4['where']('c.'+_0x256a09+_0x2bbd('0x59'),_0x151969[_0x2bbd('0x2e')][_0x256a09]);}});}if(_0x151969[_0x2bbd('0x2e')]['tag']){_0x549568=_[_0x2bbd('0x5a')](_0x151969['query'][_0x2bbd('0x5b')])?_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x5b')]:new Array(_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x5b')]);_0x549568['forEach'](function(_0x133ab4){_0x5ce3f3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x133ab4+',%');});}if(_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x55')]){var _0x4669d0=_0x151969[_0x2bbd('0x2e')]['filter'][_0x2bbd('0x5c')]('\x5c','\x5c\x5c')[_0x2bbd('0x5c')](/'/g,'\x27\x27');if(_0x4669d0[_0x2bbd('0x5d')]('\x20')[_0x2bbd('0x24')]>0x1){_0x3f0771['or'](_0x2bbd('0x5e'),qs[_0x2bbd('0x5f')](_0x4669d0),null);}else{if(qs['isNumeric'](_0x4669d0)){_0x3f0771['or'](_0x2bbd('0x60'),_0x4669d0+'%');_0x3f0771['or'](_0x2bbd('0x61'),_0x4669d0+'%');_0x3f0771['or']('c.mobile\x20LIKE\x20?',_0x4669d0+'%');_0x3f0771['or']('c.fax\x20LIKE\x20?',_0x4669d0+'%');}else if(qs[_0x2bbd('0x62')](_0x4669d0)){_0x3f0771['or'](_0x2bbd('0x63'),_0x4669d0+'%');}else{_0x3f0771['or'](_0x2bbd('0x64'),'%'+_0x4669d0+'%');_0x3f0771['or'](_0x2bbd('0x65'),'%'+_0x4669d0+'%');_0x3f0771['or'](_0x2bbd('0x63'),'%'+_0x4669d0+'%');}}}}_0x4e49b4[_0x2bbd('0x42')](_0x3f0771);_0x4e49b4['group'](_0x2bbd('0x66'));var _0xc77af7={'type':db[_0x2bbd('0x67')][_0x2bbd('0x68')][_0x2bbd('0x69')],'raw':!![]};var _0x256334=_0x4e49b4[_0x2bbd('0x6a')]()[_0x2bbd('0x39')](_0x2bbd('0x66'));if(_0xf08d87[_0x2bbd('0x35')]){_0xf08d87[_0x2bbd('0x35')][_0x2bbd('0x4c')](function(_0x59499c){_0x4e49b4[_0x2bbd('0x35')]('c.'+_0x59499c[0x0],_0x59499c[0x1]===_0x2bbd('0x6b')?![]:!![]);});}if(!_[_0x2bbd('0x6c')](_0x549568)){_0x4e49b4[_0x2bbd('0x6d')](_0x5ce3f3);_0x256334[_0x2bbd('0x42')]('t.id\x20IN\x20?',_0x549568);}BPromise[_0x2bbd('0x6e')]()[_0x2bbd('0x1a')](function(){if(!_0x4b8236)return;if(_0x151969['user'][_0x2bbd('0x6f')]!==_0x2bbd('0x70'))return;if(!_['some'](_0x4b8236[_0x2bbd('0x47')],[_0x2bbd('0x39'),_0x2bbd('0x71')])){return _0x151969['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x2bbd('0x1a')](function(_0x21bd23){if(_[_0x2bbd('0x6c')](_0x21bd23)){_0x256334[_0x2bbd('0x42')](_0x2bbd('0x72'));_0x4e49b4[_0x2bbd('0x42')](_0x2bbd('0x72'));}else{_0x256334[_0x2bbd('0x42')]('c.ListId\x20IN\x20?',_[_0x2bbd('0x4b')](_0x21bd23,'id'));_0x4e49b4['where'](_0x2bbd('0x58'),_[_0x2bbd('0x4b')](_0x21bd23,'id'));}});}})[_0x2bbd('0x1a')](function(){if(_0x151969[_0x2bbd('0x73')]['role']===_0x2bbd('0x70')&&!_0x4b8236&&!_0x151969[_0x2bbd('0x2e')]['ListId'])return[];return db['sequelize'][_0x2bbd('0x2e')](_0x256334[_0x2bbd('0x74')](),_0xc77af7);})[_0x2bbd('0x1a')](function(_0x27062a){_0x32e715['count']=_0x27062a['length'];if(_0x32e715[_0x2bbd('0x17')]===0x0)return[];return db[_0x2bbd('0x75')][_0x2bbd('0x2e')](_0x38e07d[_0x2bbd('0x74')](),_0xc77af7)[_0x2bbd('0x1a')](function(_0x3dd166){_0x8d3f2=_[_0x2bbd('0x76')](_0x3dd166,'id');_0xc77af7=_[_0x2bbd('0x77')](_0xc77af7,{'model':db[_0x2bbd('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x151969[_0x2bbd('0x2e')][_0x2bbd('0x32')]){_0xf08d87[_0x2bbd('0x31')]['forEach'](function(_0x28278a){_0x4e49b4['field']('c.'+_0x28278a);});}else{_0x4e49b4[_0x2bbd('0x39')](_0x2bbd('0x66'));_0x4e49b4['field'](_0x2bbd('0x78'));_0x4e49b4['field'](_0x2bbd('0x79'));_0x4e49b4['field'](_0x2bbd('0x7a'));_0x4e49b4['field'](_0x2bbd('0x7b'));_0x4e49b4[_0x2bbd('0x39')](_0x2bbd('0x7c'));_0x4e49b4[_0x2bbd('0x39')](_0x2bbd('0x7d'));_0x4e49b4[_0x2bbd('0x39')]('c.ListId');_0x4e49b4[_0x2bbd('0x39')]('c.createdAt');_0x4e49b4[_0x2bbd('0x39')](_0x2bbd('0x7e'));_0x4e49b4[_0x2bbd('0x39')](_0x2bbd('0x7f'));_0x4e49b4[_0x2bbd('0x39')](_0x2bbd('0x80'),_0x2bbd('0x81'));}if(_0xf08d87[_0x2bbd('0x16')])_0x4e49b4[_0x2bbd('0x16')](_0xf08d87['limit']);if(_0xf08d87[_0x2bbd('0x14')])_0x4e49b4[_0x2bbd('0x14')](_0xf08d87['offset']);return db['sequelize'][_0x2bbd('0x2e')](_0x4e49b4['toString'](),_0xc77af7);});})[_0x2bbd('0x1a')](function(_0x53e168){_0x53e168['forEach'](function(_0x13a1e1){if(_0x13a1e1[_0x2bbd('0x81')]){_0x13a1e1['Tags']=[];_0x13a1e1[_0x2bbd('0x81')]['split'](',')['forEach'](function(_0x117eda){_0x13a1e1[_0x2bbd('0x82')][_0x2bbd('0x28')](_0x8d3f2[_0x117eda]);});}delete _0x13a1e1[_0x2bbd('0x81')];});_0x32e715[_0x2bbd('0x83')]=_0x53e168;return _0x32e715;})[_0x2bbd('0x1a')](respondWithFilteredResult(_0x1aba5a,_0xf08d87));})[_0x2bbd('0x84')](handleError(_0x1aba5a,null));};exports[_0x2bbd('0x1b')]=function(_0x42033b,_0xf112cb){return db['CmContact'][_0x2bbd('0x48')]({'where':{'id':_0x42033b[_0x2bbd('0x85')]['id']}})[_0x2bbd('0x1a')](handleEntityNotFound(_0xf112cb,null))[_0x2bbd('0x1a')](removeEntity(_0xf112cb,null))['catch'](handleError(_0xf112cb,null));};exports[_0x2bbd('0x23')]=function(_0x303e50,_0x2856ed){return db[_0x2bbd('0x22')][_0x2bbd('0x23')]()[_0x2bbd('0x1a')](function(_0x236f07){delete _0x236f07[_0x2bbd('0x86')];for(var _0x119c70=0x0;_0x119c70<Object[_0x2bbd('0x25')](_0x236f07)[_0x2bbd('0x24')];_0x119c70++){var _0xecf203=Object[_0x2bbd('0x25')](_0x236f07)[_0x119c70];if(!_[_0x2bbd('0x26')](_0xecf203,_0x2bbd('0x27'))){_0x236f07[_0xecf203][_0x2bbd('0x87')]=_0xecf203;_0x236f07[_0xecf203][_0x2bbd('0x88')]=_0xecf203;}}return _0x236f07;})['then'](function(_0x4ce6c8){var _0x18b0bf={'where':Boolean(_0x303e50[_0x2bbd('0x2e')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x303e50[_0x2bbd('0x2e')]['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField'][_0x2bbd('0x89')](_0x18b0bf)[_0x2bbd('0x1a')](function(_0x1de793){for(var _0x2a9240=0x0;_0x2a9240<_0x1de793[_0x2bbd('0x24')];_0x2a9240++){var _0x3c3cb7=_0x2bbd('0x27')+_0x1de793[_0x2a9240]['id'];_0x4ce6c8[_0x3c3cb7][_0x2bbd('0x87')]=_0x3c3cb7;_0x4ce6c8[_0x3c3cb7][_0x2bbd('0x88')]=_0x1de793[_0x2a9240][_0x2bbd('0x8a')];_0x4ce6c8[_0x3c3cb7][_0x2bbd('0x8b')]={'type':_0x1de793[_0x2a9240][_0x2bbd('0x8c')],'values':_0x1de793[_0x2a9240][_0x2bbd('0x8d')]};}Object[_0x2bbd('0x25')](_0x4ce6c8)[_0x2bbd('0x4c')](function(_0x247fd9){if(!_0x4ce6c8[_0x247fd9][_0x2bbd('0x33')](_0x2bbd('0x87'))){delete _0x4ce6c8[_0x247fd9];}});return _0x4ce6c8;});})[_0x2bbd('0x1a')](respondWithResult(_0x2856ed,null))[_0x2bbd('0x84')](handleError(_0x2856ed,null));};exports['merge']=function(_0x195439,_0x1b4258){var _0x25d18a;var _0x501b26;var _0x55fca7;if(_0x195439[_0x2bbd('0x8e')]['id']){delete _0x195439[_0x2bbd('0x8e')]['id'];}return db[_0x2bbd('0x22')][_0x2bbd('0x89')]({'where':{'id':[_0x195439[_0x2bbd('0x8e')]['to'],_0x195439[_0x2bbd('0x8e')][_0x2bbd('0x3b')]]}})[_0x2bbd('0x1a')](function(_0x249cb6){if(_0x249cb6){if(_0x249cb6[_0x2bbd('0x24')]!==0x2){return null;}_0x249cb6[0x0]=_0x249cb6[0x0][_0x2bbd('0x8f')]({'plain':!![]});_0x249cb6[0x1]=_0x249cb6[0x1][_0x2bbd('0x8f')]({'plain':!![]});delete _0x249cb6[0x0]['id'];delete _0x249cb6[0x1]['id'];return _[_0x2bbd('0x90')](_0x249cb6[0x0],_0x249cb6[0x1],function(_0x1e1131,_0x469f01){if(Array[_0x2bbd('0x5a')](_0x469f01)&&!_0x469f01[_0x2bbd('0x24')]){return _0x1e1131;}else if(!_0x469f01){return _0x1e1131;}});}})[_0x2bbd('0x1a')](handleEntityNotFound(_0x1b4258,null))[_0x2bbd('0x1a')](function(_0x474cba){if(_0x474cba){if(_0x474cba['tags']&&_['isArray'](_0x474cba[_0x2bbd('0x86')])){_0x474cba[_0x2bbd('0x86')]=_0x474cba['tags'][_0x2bbd('0x91')]();}logger['info'](_0x2bbd('0x92'),_0x195439['body']['to'],_0x195439[_0x2bbd('0x8e')][_0x2bbd('0x3b')]);return db[_0x2bbd('0x93')][_0x2bbd('0x1b')]({'where':{'ContactId':[_0x195439[_0x2bbd('0x8e')]['to'],_0x195439[_0x2bbd('0x8e')]['from']]}})[_0x2bbd('0x1a')](function(_0x41db83){logger['info'](_0x2bbd('0x94'),_0x41db83);return db['CmHopperBlack'][_0x2bbd('0x1b')]({'where':{'ContactId':[_0x195439[_0x2bbd('0x8e')]['to'],_0x195439[_0x2bbd('0x8e')][_0x2bbd('0x3b')]]}})['then'](function(_0x4b84be){logger[_0x2bbd('0x95')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x4b84be);return db[_0x2bbd('0x22')][_0x2bbd('0x96')](_0x474cba);});});}})[_0x2bbd('0x1a')](function(_0x4caaa8){if(_0x4caaa8){_0x25d18a=_0x4caaa8;_0x501b26={'ContactId':_0x25d18a['id']};_0x55fca7={'where':{'ContactId':[_0x195439[_0x2bbd('0x8e')]['to'],_0x195439[_0x2bbd('0x8e')][_0x2bbd('0x3b')]]}};return db[_0x2bbd('0x97')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x98')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x99')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x9a')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x9b')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x9a')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x9b')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x9c')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x9d')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})['then'](function(){if(_0x25d18a){return db[_0x2bbd('0x9e')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db['FaxMessage']['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0x9f')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0xa0')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})['then'](function(){if(_0x25d18a){return db['CmHopperFinal']['update'](_0x501b26,_0x55fca7);}})['then'](function(){if(_0x25d18a){return db['CmHopperHistory'][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db['ReportAgentPreview'][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0xa1')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0xa2')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})['then'](function(){if(_0x25d18a){return db[_0x2bbd('0xa3')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db['MailQueueReport'][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0xa4')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0xa5')]['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db[_0x2bbd('0xa6')]['update'](_0x501b26,_0x55fca7);}})['then'](function(){if(_0x25d18a){return db[_0x2bbd('0xa7')][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db['WhatsappMessage']['update'](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db['WhatsappQueueReport'][_0x2bbd('0x19')](_0x501b26,_0x55fca7);}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return db['CmContact'][_0x2bbd('0x1b')]({'where':{'id':[_0x195439[_0x2bbd('0x8e')]['to'],_0x195439[_0x2bbd('0x8e')][_0x2bbd('0x3b')]]}});}})[_0x2bbd('0x1a')](function(){if(_0x25d18a){return _0x25d18a;}})[_0x2bbd('0x1a')](respondWithResult(_0x1b4258,null))['catch'](handleError(_0x1b4258,null));};exports[_0x2bbd('0x96')]=function(_0x251f84,_0xfcc24){return db[_0x2bbd('0x22')][_0x2bbd('0x23')]()[_0x2bbd('0x1a')](function(_0x4098f8){if(_0x251f84[_0x2bbd('0x8e')][_0x2bbd('0x86')]&&_[_0x2bbd('0x5a')](_0x251f84[_0x2bbd('0x8e')][_0x2bbd('0x86')])){if(_0x251f84[_0x2bbd('0x8e')][_0x2bbd('0x86')][_0x2bbd('0x24')]){_0x251f84[_0x2bbd('0x8e')][_0x2bbd('0x86')]=_0x251f84[_0x2bbd('0x8e')][_0x2bbd('0x86')]['join'](';')+';';}else{_0x251f84[_0x2bbd('0x8e')][_0x2bbd('0x86')]=null;}}else{_0x251f84['body']['tags']=null;}return db[_0x2bbd('0x22')]['create'](_0x251f84[_0x2bbd('0x8e')],{'fields':_['keys'](_0x4098f8),'raw':!![]});})[_0x2bbd('0x1a')](respondWithResult(_0xfcc24,0xc9))['catch'](handleError(_0xfcc24,null));};exports[_0x2bbd('0xa8')]=function(_0x21e0c5,_0x42b9e1){var _0x57f711=0x0;var _0x3e00b3=0x0;var _0x5669bf=0x0;return db[_0x2bbd('0x22')][_0x2bbd('0x23')]()['then'](function(_0x3bf5be){return BPromise['each'](_0x21e0c5[_0x2bbd('0x8e')],function(_0x5a8915){var _0x30871d={'where':{'$or':[]},'defaults':_0x5a8915,'fields':_[_0x2bbd('0x25')](_0x3bf5be),'raw':!![]};if(_0x5a8915[_0x2bbd('0xa9')]){for(var _0xb48612=0x0;_0xb48612<_0x5a8915['duplicates']['length'];_0xb48612++){var _0xea78e9={};_0xea78e9[_0x5a8915[_0x2bbd('0xa9')][_0xb48612]]=_0x5a8915[_0x5a8915[_0x2bbd('0xa9')][_0xb48612]];_0x30871d[_0x2bbd('0x42')][_0x2bbd('0xaa')]['push'](_0xea78e9);}_0x30871d['where']['ListId']=_0x5a8915[_0x2bbd('0xab')];}return db[_0x2bbd('0x22')][_0x2bbd('0xac')](_0x30871d)[_0x2bbd('0xad')](function(_0x22696b,_0xfdcbb2){if(_0xfdcbb2){_0x57f711++;}else{_0x5669bf++;}})[_0x2bbd('0x84')](function(){_0x3e00b3++;});});})['then'](function(_0x5274a4){if(_0x5274a4){return{'success':_0x57f711,'failure':_0x3e00b3,'duplicates':_0x5669bf};}})[_0x2bbd('0x1a')](respondWithResult(_0x42b9e1,0xc9))[_0x2bbd('0x84')](handleError(_0x42b9e1,null));};exports['show']=function(_0x379e60,_0xfea0a6){var _0xcce891;return db[_0x2bbd('0x22')]['describe']()['then'](function(_0x1da1f0){return db['CmContact'][_0x2bbd('0x48')]({'where':{'id':_0x379e60['params']['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0x2bbd('0x20'),_0x2bbd('0x3a')],'required':_0x379e60['query'][_0x2bbd('0x5b')]?!![]:![]}],'attributes':_[_0x2bbd('0x25')](_0x1da1f0)});})[_0x2bbd('0x1a')](function(_0x2657ee){if(!_[_0x2bbd('0x56')](_0x2657ee)){_0xcce891=_0x2657ee[_0x2bbd('0x8f')]({'plain':!![]});var _0x136c44={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2657ee&&_0x2657ee['ListId']){if(_0x2657ee[_0x2bbd('0xab')]){_0x136c44['where'][_0x2bbd('0xae')][_0x2bbd('0x28')]({'ListId':{'$ne':_0x2657ee[_0x2bbd('0xab')]}});}}return db[_0x2bbd('0x29')]['findAll'](_0x136c44);}})['then'](function(_0x26b522){if(!_['isNil'](_0x26b522)){return _['omit'](_0xcce891,_[_0x2bbd('0x4b')](_0x26b522,function(_0x156e19){return util[_0x2bbd('0xaf')](_0x2bbd('0xb0'),_0x156e19['id']);}));}})[_0x2bbd('0x1a')](handleEntityNotFound(_0xfea0a6,null))['then'](respondWithResult(_0xfea0a6,null))[_0x2bbd('0x84')](handleError(_0xfea0a6,null));};exports[_0x2bbd('0x19')]=function(_0x30d75a,_0x80a7f1){var _0xf1589b;if(_0x30d75a['body']['id']){delete _0x30d75a['body']['id'];}return db['CmContact'][_0x2bbd('0x48')]({'where':{'id':_0x30d75a[_0x2bbd('0x85')]['id']}})[_0x2bbd('0x1a')](handleEntityNotFound(_0x80a7f1,null))['then'](saveUpdates(_0x30d75a['body'],null))['then'](function(_0x13bdae){_0xf1589b=_0x13bdae;var _0x194b87={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x13bdae&&_0x13bdae['ListId']){if(_0x13bdae[_0x2bbd('0xab')]){_0x194b87['where'][_0x2bbd('0xae')][_0x2bbd('0x28')]({'ListId':{'$ne':_0x13bdae['ListId']}});}}return db[_0x2bbd('0x29')][_0x2bbd('0x89')](_0x194b87);})['then'](function(_0x359f60){if(_0x359f60){return _[_0x2bbd('0xb1')](_[_0x2bbd('0xb2')](_0x30d75a[_0x2bbd('0x8e')],function(_0x29a596,_0x4babe7){return _[_0x2bbd('0x26')](_0x4babe7,_0x2bbd('0x27'));}),_['map'](_0x359f60,function(_0x307084){return util[_0x2bbd('0xaf')](_0x2bbd('0xb0'),_0x307084['id']);}));}})[_0x2bbd('0x1a')](function(_0x41a5af){if(_0x41a5af&&!_[_0x2bbd('0x6c')](_0x41a5af)){var _0x1724a9=squel['update']()['table']('cm_contacts')[_0x2bbd('0xb3')](_0x41a5af)[_0x2bbd('0x42')](_0x2bbd('0xb4'),_0x30d75a[_0x2bbd('0x85')]['id'])[_0x2bbd('0xb5')]();return db[_0x2bbd('0x75')][_0x2bbd('0x2e')](_0x1724a9[_0x2bbd('0x54')],{'replacements':_0x1724a9[_0x2bbd('0x8d')]});}})[_0x2bbd('0x1a')](function(){if(_0x30d75a['body'][_0x2bbd('0xb6')]&&_0xf1589b){return db[_0x2bbd('0x93')][_0x2bbd('0x19')]({'phone':_0x30d75a['body']['phone']},{'where':{'ContactId':_0xf1589b['id']}});}})[_0x2bbd('0x1a')](function(){return _0xf1589b;})[_0x2bbd('0x1a')](respondWithResult(_0x80a7f1,null))['catch'](handleError(_0x80a7f1,null));};exports[_0x2bbd('0xb7')]=function(_0x826bfe,_0x1c2afa){var _0x30e631={};var _0x217fb7={};var _0x259116;var _0x2094b6;return db[_0x2bbd('0x22')][_0x2bbd('0x2a')]({'where':{'id':_0x826bfe[_0x2bbd('0x85')]['id']}})[_0x2bbd('0x1a')](handleEntityNotFound(_0x1c2afa,null))['then'](function(_0x1c81d5){if(_0x1c81d5){_0x259116=_0x1c81d5;_0x217fb7[_0x2bbd('0x2d')]=_[_0x2bbd('0x25')](db[_0x2bbd('0x49')][_0x2bbd('0xb8')]);_0x217fb7[_0x2bbd('0x2e')]=_[_0x2bbd('0x25')](_0x826bfe['query']);_0x217fb7[_0x2bbd('0x2f')]=_[_0x2bbd('0x30')](_0x217fb7[_0x2bbd('0x2d')],_0x217fb7[_0x2bbd('0x2e')]);_0x30e631[_0x2bbd('0x31')]=_[_0x2bbd('0x30')](_0x217fb7['model'],qs[_0x2bbd('0x32')](_0x826bfe[_0x2bbd('0x2e')][_0x2bbd('0x32')]));_0x30e631[_0x2bbd('0x31')]=_0x30e631['attributes'][_0x2bbd('0x24')]?_0x30e631[_0x2bbd('0x31')]:_0x217fb7['model'];_0x30e631[_0x2bbd('0x35')]=qs['sort'](_0x826bfe[_0x2bbd('0x2e')][_0x2bbd('0x36')]);_0x30e631[_0x2bbd('0x42')]=qs[_0x2bbd('0x2f')](_[_0x2bbd('0x37')](_0x826bfe[_0x2bbd('0x2e')],_0x217fb7[_0x2bbd('0x2f')]));if(_0x826bfe[_0x2bbd('0x2e')][_0x2bbd('0x55')]){_0x30e631[_0x2bbd('0x42')]=_['merge'](_0x30e631['where'],{'$or':_[_0x2bbd('0x4b')](_0x30e631[_0x2bbd('0x31')],function(_0x219fd9){var _0x2ea887={};_0x2ea887[_0x219fd9]={'$like':'%'+_0x826bfe[_0x2bbd('0x2e')][_0x2bbd('0x55')]+'%'};return _0x2ea887;})});}_0x30e631=_[_0x2bbd('0x77')]({},_0x30e631,_0x826bfe[_0x2bbd('0xb9')]);return _0x259116[_0x2bbd('0xb7')](_0x30e631);}})[_0x2bbd('0x1a')](function(_0x15de94){if(_0x15de94){_0x2094b6=_0x15de94[_0x2bbd('0x24')];if(!_0x826bfe['query'][_0x2bbd('0x33')]('nolimit')){_0x30e631[_0x2bbd('0x16')]=qs[_0x2bbd('0x16')](_0x826bfe[_0x2bbd('0x2e')][_0x2bbd('0x16')]);_0x30e631[_0x2bbd('0x14')]=qs[_0x2bbd('0x14')](_0x826bfe['query'][_0x2bbd('0x14')]);}return _0x259116[_0x2bbd('0xb7')](_0x30e631);}})[_0x2bbd('0x1a')](function(_0x645187){if(_0x645187){return _0x645187?{'count':_0x2094b6,'rows':_0x645187}:null;}})['then'](respondWithResult(_0x1c2afa,null))[_0x2bbd('0x84')](handleError(_0x1c2afa,null));};exports[_0x2bbd('0xba')]=function(_0x4d83b5,_0x178aaa){if(_0x4d83b5[_0x2bbd('0x8e')]['id']){delete _0x4d83b5[_0x2bbd('0x8e')]['id'];}return db[_0x2bbd('0x22')]['findOne']({'where':{'id':_0x4d83b5[_0x2bbd('0x85')]['id']}})['then'](handleEntityNotFound(_0x178aaa,null))['then'](function(_0x2e6f0a){if(_0x2e6f0a){return _0x2e6f0a[_0x2bbd('0xba')](_0x4d83b5[_0x2bbd('0x8e')][_0x2bbd('0xbb')]||[]);}return null;})[_0x2bbd('0x1a')](respondWithResult(_0x178aaa,null))[_0x2bbd('0x84')](handleError(_0x178aaa,null));};exports[_0x2bbd('0xbc')]=function(_0x422413,_0x3f6cbd){var _0x20f696={'raw':![],'where':{}};var _0xdaf38e={};var _0x411421={'count':0x0,'rows':[]};return db[_0x2bbd('0x22')][_0x2bbd('0x2a')]({'where':{'id':_0x422413['params']['id']}})[_0x2bbd('0x1a')](handleEntityNotFound(_0x3f6cbd,null))[_0x2bbd('0x1a')](function(_0x5cb3c5){if(_0x5cb3c5){_0xdaf38e[_0x2bbd('0x2d')]=_['keys'](db[_0x2bbd('0x93')][_0x2bbd('0xb8')]);_0xdaf38e[_0x2bbd('0x2e')]=_[_0x2bbd('0x25')](_0x422413['query']);_0xdaf38e[_0x2bbd('0x2f')]=_[_0x2bbd('0x30')](_0xdaf38e[_0x2bbd('0x2d')],_0xdaf38e[_0x2bbd('0x2e')]);_0x20f696[_0x2bbd('0x31')]=_[_0x2bbd('0x30')](_0xdaf38e['model'],qs[_0x2bbd('0x32')](_0x422413[_0x2bbd('0x2e')][_0x2bbd('0x32')]));_0x20f696[_0x2bbd('0x31')]=_0x20f696[_0x2bbd('0x31')]['length']?_0x20f696[_0x2bbd('0x31')]:_0xdaf38e[_0x2bbd('0x2d')];if(!_0x422413[_0x2bbd('0x2e')]['hasOwnProperty'](_0x2bbd('0x34'))){_0x20f696[_0x2bbd('0x16')]=qs[_0x2bbd('0x16')](_0x422413[_0x2bbd('0x2e')][_0x2bbd('0x16')]);_0x20f696[_0x2bbd('0x14')]=qs['offset'](_0x422413[_0x2bbd('0x2e')][_0x2bbd('0x14')]);}_0x20f696[_0x2bbd('0x35')]=qs[_0x2bbd('0x36')](_0x422413[_0x2bbd('0x2e')][_0x2bbd('0x36')]);_0x20f696['where']=qs['filters'](_[_0x2bbd('0x37')](_0x422413[_0x2bbd('0x2e')],_0xdaf38e[_0x2bbd('0x2f')]));_0x20f696['where'][_0x2bbd('0xbd')]=_0x5cb3c5['id'];if(_0x422413[_0x2bbd('0x2e')][_0x2bbd('0x55')]){_0x20f696[_0x2bbd('0x42')]=_[_0x2bbd('0x77')](_0x20f696[_0x2bbd('0x42')],{'$or':_[_0x2bbd('0x4b')](_0x20f696[_0x2bbd('0x31')],function(_0x8c1260){var _0x23660={};_0x23660[_0x8c1260]={'$like':'%'+_0x422413[_0x2bbd('0x2e')][_0x2bbd('0x55')]+'%'};return _0x23660;})});}_0x20f696=_[_0x2bbd('0x77')]({},_0x20f696,_0x422413[_0x2bbd('0xb9')]);return db[_0x2bbd('0x93')][_0x2bbd('0x17')]({'where':_0x20f696[_0x2bbd('0x42')]})['then'](function(_0x2fe72f){_0x411421[_0x2bbd('0x17')]=_0x2fe72f;if(_0x422413[_0x2bbd('0x2e')][_0x2bbd('0xbe')]){_0x20f696[_0x2bbd('0xbf')]=[{'all':!![]}];}return db[_0x2bbd('0x93')][_0x2bbd('0x89')](_0x20f696);})['then'](function(_0x22b6ff){_0x411421[_0x2bbd('0x83')]=_0x22b6ff;return _0x411421;});}})[_0x2bbd('0x1a')](respondWithFilteredResult(_0x3f6cbd,_0x20f696))['catch'](handleError(_0x3f6cbd,null));};exports[_0x2bbd('0xc0')]=function(_0x11be94,_0x212c59){var _0x3ae233={'raw':!![],'where':{}};var _0x576def={};var _0x54900e={'count':0x0,'rows':[]};return db[_0x2bbd('0x22')][_0x2bbd('0x2a')]({'where':{'id':_0x11be94['params']['id']}})[_0x2bbd('0x1a')](handleEntityNotFound(_0x212c59,null))[_0x2bbd('0x1a')](function(_0x45bb9a){if(_0x45bb9a){_0x576def['model']=_[_0x2bbd('0x25')](db['CmHopperHistory']['rawAttributes']);_0x576def[_0x2bbd('0x2e')]=_[_0x2bbd('0x25')](_0x11be94[_0x2bbd('0x2e')]);_0x576def[_0x2bbd('0x2f')]=_[_0x2bbd('0x30')](_0x576def[_0x2bbd('0x2d')],_0x576def['query']);_0x3ae233['attributes']=_['intersection'](_0x576def[_0x2bbd('0x2d')],qs[_0x2bbd('0x32')](_0x11be94['query'][_0x2bbd('0x32')]));_0x3ae233[_0x2bbd('0x31')]=_0x3ae233[_0x2bbd('0x31')]['length']?_0x3ae233[_0x2bbd('0x31')]:_0x576def[_0x2bbd('0x2d')];if(!_0x11be94[_0x2bbd('0x2e')][_0x2bbd('0x33')](_0x2bbd('0x34'))){_0x3ae233[_0x2bbd('0x16')]=qs[_0x2bbd('0x16')](_0x11be94[_0x2bbd('0x2e')]['limit']);_0x3ae233[_0x2bbd('0x14')]=qs[_0x2bbd('0x14')](_0x11be94[_0x2bbd('0x2e')][_0x2bbd('0x14')]);}_0x3ae233[_0x2bbd('0x35')]=qs[_0x2bbd('0x36')](_0x11be94['query'][_0x2bbd('0x36')]);_0x3ae233[_0x2bbd('0x42')]=qs[_0x2bbd('0x2f')](_['pick'](_0x11be94[_0x2bbd('0x2e')],_0x576def[_0x2bbd('0x2f')]));_0x3ae233[_0x2bbd('0x42')][_0x2bbd('0xbd')]=_0x45bb9a['id'];if(_0x11be94['query'][_0x2bbd('0x55')]){_0x3ae233[_0x2bbd('0x42')]=_[_0x2bbd('0x77')](_0x3ae233[_0x2bbd('0x42')],{'$or':_[_0x2bbd('0x4b')](_0x3ae233[_0x2bbd('0x31')],function(_0x38f3a1){var _0x34cd48={};_0x34cd48[_0x38f3a1]={'$like':'%'+_0x11be94[_0x2bbd('0x2e')][_0x2bbd('0x55')]+'%'};return _0x34cd48;})});}_0x3ae233=_[_0x2bbd('0x77')]({},_0x3ae233,_0x11be94[_0x2bbd('0xb9')]);return db['CmHopperHistory'][_0x2bbd('0x17')]({'where':_0x3ae233[_0x2bbd('0x42')]})['then'](function(_0x29efc2){_0x54900e['count']=_0x29efc2;if(_0x11be94['query'][_0x2bbd('0xbe')]){_0x3ae233[_0x2bbd('0xbf')]=[{'all':!![]}];}return db[_0x2bbd('0xc1')][_0x2bbd('0x89')](_0x3ae233);})[_0x2bbd('0x1a')](function(_0x19a7fe){_0x54900e[_0x2bbd('0x83')]=_0x19a7fe;return _0x54900e;});}})[_0x2bbd('0x1a')](respondWithFilteredResult(_0x212c59,_0x3ae233))[_0x2bbd('0x84')](handleError(_0x212c59,null));};exports[_0x2bbd('0xc2')]=function(_0x6bae7f,_0x33779f){var _0x3a86eb={'raw':!![],'where':{}};var _0x3c695e={};var _0x551133={'count':0x0,'rows':[]};return db[_0x2bbd('0x22')][_0x2bbd('0x2a')]({'where':{'id':_0x6bae7f[_0x2bbd('0x85')]['id']}})[_0x2bbd('0x1a')](handleEntityNotFound(_0x33779f,null))[_0x2bbd('0x1a')](function(_0x3bbdd8){if(_0x3bbdd8){_0x3c695e[_0x2bbd('0x2d')]=_[_0x2bbd('0x25')](db['CmHopperFinal'][_0x2bbd('0xb8')]);_0x3c695e[_0x2bbd('0x2e')]=_[_0x2bbd('0x25')](_0x6bae7f[_0x2bbd('0x2e')]);_0x3c695e[_0x2bbd('0x2f')]=_['intersection'](_0x3c695e[_0x2bbd('0x2d')],_0x3c695e[_0x2bbd('0x2e')]);_0x3a86eb[_0x2bbd('0x31')]=_['intersection'](_0x3c695e[_0x2bbd('0x2d')],qs[_0x2bbd('0x32')](_0x6bae7f['query'][_0x2bbd('0x32')]));_0x3a86eb[_0x2bbd('0x31')]=_0x3a86eb[_0x2bbd('0x31')][_0x2bbd('0x24')]?_0x3a86eb[_0x2bbd('0x31')]:_0x3c695e[_0x2bbd('0x2d')];if(!_0x6bae7f[_0x2bbd('0x2e')][_0x2bbd('0x33')](_0x2bbd('0x34'))){_0x3a86eb[_0x2bbd('0x16')]=qs[_0x2bbd('0x16')](_0x6bae7f[_0x2bbd('0x2e')][_0x2bbd('0x16')]);_0x3a86eb[_0x2bbd('0x14')]=qs['offset'](_0x6bae7f[_0x2bbd('0x2e')]['offset']);}_0x3a86eb[_0x2bbd('0x35')]=qs['sort'](_0x6bae7f['query']['sort']);_0x3a86eb[_0x2bbd('0x42')]=qs['filters'](_[_0x2bbd('0x37')](_0x6bae7f[_0x2bbd('0x2e')],_0x3c695e[_0x2bbd('0x2f')]));_0x3a86eb['where'][_0x2bbd('0xbd')]=_0x3bbdd8['id'];if(_0x6bae7f['query'][_0x2bbd('0x55')]){_0x3a86eb[_0x2bbd('0x42')]=_['merge'](_0x3a86eb[_0x2bbd('0x42')],{'$or':_['map'](_0x3a86eb[_0x2bbd('0x31')],function(_0x37c690){var _0x3b4b99={};_0x3b4b99[_0x37c690]={'$like':'%'+_0x6bae7f['query'][_0x2bbd('0x55')]+'%'};return _0x3b4b99;})});}_0x3a86eb=_['merge']({},_0x3a86eb,_0x6bae7f['options']);return db[_0x2bbd('0xc3')]['count']({'where':_0x3a86eb['where']})[_0x2bbd('0x1a')](function(_0x56e300){_0x551133['count']=_0x56e300;if(_0x6bae7f[_0x2bbd('0x2e')]['includeAll']){_0x3a86eb['include']=[{'all':!![]}];}return db[_0x2bbd('0xc3')][_0x2bbd('0x89')](_0x3a86eb);})['then'](function(_0x3e8300){_0x551133[_0x2bbd('0x83')]=_0x3e8300;return _0x551133;});}})['then'](respondWithFilteredResult(_0x33779f,_0x3a86eb))[_0x2bbd('0x84')](handleError(_0x33779f,null));};exports['getJscriptySessions']=function(_0x366777,_0x2964ae){var _0x4ab71a={'raw':!![],'where':{}};var _0x587717={};var _0x2b76b7={'count':0x0,'rows':[]};return db[_0x2bbd('0x22')][_0x2bbd('0x2a')]({'where':{'id':_0x366777[_0x2bbd('0x85')]['id']}})[_0x2bbd('0x1a')](handleEntityNotFound(_0x2964ae,null))[_0x2bbd('0x1a')](function(_0xfedd3a){if(_0xfedd3a){_0x587717[_0x2bbd('0x2d')]=_[_0x2bbd('0x25')](db[_0x2bbd('0xa6')][_0x2bbd('0xb8')]);_0x587717['query']=_['keys'](_0x366777[_0x2bbd('0x2e')]);_0x587717[_0x2bbd('0x2f')]=_[_0x2bbd('0x30')](_0x587717[_0x2bbd('0x2d')],_0x587717[_0x2bbd('0x2e')]);_0x4ab71a['attributes']=_[_0x2bbd('0x30')](_0x587717['model'],qs[_0x2bbd('0x32')](_0x366777[_0x2bbd('0x2e')][_0x2bbd('0x32')]));_0x4ab71a[_0x2bbd('0x31')]=_0x4ab71a[_0x2bbd('0x31')][_0x2bbd('0x24')]?_0x4ab71a['attributes']:_0x587717['model'];if(!_0x366777[_0x2bbd('0x2e')][_0x2bbd('0x33')](_0x2bbd('0x34'))){_0x4ab71a[_0x2bbd('0x16')]=qs[_0x2bbd('0x16')](_0x366777[_0x2bbd('0x2e')][_0x2bbd('0x16')]);_0x4ab71a[_0x2bbd('0x14')]=qs[_0x2bbd('0x14')](_0x366777[_0x2bbd('0x2e')][_0x2bbd('0x14')]);}_0x4ab71a['order']=qs[_0x2bbd('0x36')](_0x366777[_0x2bbd('0x2e')][_0x2bbd('0x36')]);_0x4ab71a[_0x2bbd('0x42')]=qs[_0x2bbd('0x2f')](_[_0x2bbd('0x37')](_0x366777[_0x2bbd('0x2e')],_0x587717[_0x2bbd('0x2f')]));_0x4ab71a[_0x2bbd('0x42')]['ContactId']=_0xfedd3a['id'];if(_0x366777[_0x2bbd('0x2e')]['filter']){_0x4ab71a[_0x2bbd('0x42')]=_['merge'](_0x4ab71a[_0x2bbd('0x42')],{'$or':_[_0x2bbd('0x4b')](_0x4ab71a['attributes'],function(_0x3ff9d9){var _0x5ed3e8={};_0x5ed3e8[_0x3ff9d9]={'$like':'%'+_0x366777[_0x2bbd('0x2e')][_0x2bbd('0x55')]+'%'};return _0x5ed3e8;})});}_0x4ab71a=_[_0x2bbd('0x77')]({},_0x4ab71a,_0x366777['options']);return db[_0x2bbd('0xa6')][_0x2bbd('0x17')]({'where':_0x4ab71a[_0x2bbd('0x42')]})[_0x2bbd('0x1a')](function(_0x437c47){_0x2b76b7[_0x2bbd('0x17')]=_0x437c47;if(_0x366777[_0x2bbd('0x2e')]['includeAll']){_0x4ab71a[_0x2bbd('0xbf')]=[{'all':!![]}];}return db[_0x2bbd('0xa6')][_0x2bbd('0x89')](_0x4ab71a);})[_0x2bbd('0x1a')](function(_0x3ddb6c){_0x2b76b7[_0x2bbd('0x83')]=_0x3ddb6c;return _0x2b76b7;});}})[_0x2bbd('0x1a')](respondWithFilteredResult(_0x2964ae,_0x4ab71a))[_0x2bbd('0x84')](handleError(_0x2964ae,null));};exports[_0x2bbd('0xc4')]=function(_0x18e4d3,_0xe77359){try{if(!_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0xab')]){throw new Error(_0x2bbd('0xc5'));}if(!_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0xc6')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0xc7')]){throw new Error(_0x2bbd('0xc8'));}if(!_0x18e4d3['body']['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0xc7ee59=_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0xc6')][_0x2bbd('0x5d')](',');var _0x49f3ba=_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0xc7')][_0x2bbd('0x5d')](',');if(!_0xc7ee59[_0x2bbd('0x24')]||!_0x49f3ba[_0x2bbd('0x24')]||_0xc7ee59[_0x2bbd('0x24')]!==_0x49f3ba[_0x2bbd('0x24')]){throw new Error(_0x2bbd('0xc9'));}_0x18e4d3[_0x2bbd('0x8e')]['fields']=_[_0x2bbd('0xca')](_0xc7ee59,_0x49f3ba);if(!_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0x32')][_0x2bbd('0xb6')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0x32')][_0x2bbd('0xcb')]){throw new Error(_0x2bbd('0xcc'));}var _0x4b9688=path[_0x2bbd('0x91')](config[_0x2bbd('0xcd')],_0x2bbd('0xce'),_0x18e4d3[_0x2bbd('0xcf')]['filename']);fs['chmodSync'](_0x4b9688,parseInt(_0x2bbd('0xd0'),0x8));var _0x9ed45f=require('child_process')[_0x2bbd('0xd1')](path[_0x2bbd('0x91')](__dirname,_0x2bbd('0xd2')),[_0x4b9688,_0x18e4d3['body'][_0x2bbd('0xc6')],_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0xc7')],_0x18e4d3[_0x2bbd('0x8e')][_0x2bbd('0xab')],_0x18e4d3['body'][_0x2bbd('0xd3')],_0x18e4d3[_0x2bbd('0x8e')]['duplicates'],_0x18e4d3[_0x2bbd('0x8e')]['socket_timestamp']]);return _0xe77359[_0x2bbd('0x12')](0xc8)['json']({'message':_0x2bbd('0xd4'),'pid':_0x9ed45f[_0x2bbd('0xd5')]});}catch(_0x3cb8f0){return _0xe77359['status'](0x1f4)['send'](_0x3cb8f0);}};exports['upload']=function(_0x5cfb94,_0x50e8c4){var _0x2e6a78=fs[_0x2bbd('0xd6')](_0x5cfb94[_0x2bbd('0xcf')][_0x2bbd('0x2')]);Papa[_0x2bbd('0xd7')](_0x2e6a78,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3c5c81){return _0x50e8c4[_0x2bbd('0x12')](0xc8)[_0x2bbd('0x13')]({'file':_0x5cfb94[_0x2bbd('0xcf')],'fields':_0x3c5c81['meta'][_0x2bbd('0x32')]});}});};exports[_0x2bbd('0xd8')]=function(_0x2caa7d,_0x156c3f){return db[_0x2bbd('0x71')][_0x2bbd('0x89')]({'raw':!![],'attributes':['id'],'where':{'role':_0x2bbd('0x70')}})[_0x2bbd('0x1a')](function(_0x5ca741){var _0x53c47b=![];if(!_0x2caa7d[_0x2bbd('0x8e')]['ListId']){throw new Error(_0x2bbd('0xc5'));}if(!_0x2caa7d[_0x2bbd('0x8e')][_0x2bbd('0xd9')][_0x2bbd('0xb6')]){throw new Error(_0x2bbd('0xda'));}if(!_0x2caa7d[_0x2bbd('0x8e')][_0x2bbd('0xd9')][_0x2bbd('0xcb')]){throw new Error(_0x2bbd('0xcc'));}if(!_0x2caa7d[_0x2bbd('0x8e')]['socket_timestamp']){throw new Error(_0x2bbd('0xdb'));}var _0x412139=require(_0x2bbd('0xdc'))['fork'](path[_0x2bbd('0x91')](__dirname,_0x2bbd('0xdd')),[_0x2caa7d['params']['id'],JSON[_0x2bbd('0xde')](_0x2caa7d[_0x2bbd('0x8e')]),JSON['stringify'](_0x5ca741)]);_0x412139['on']('message',function(){_0x53c47b=!![];return _0x156c3f[_0x2bbd('0x12')](0xc8)[_0x2bbd('0x13')]({'message':_0x2bbd('0xdf'),'pid':_0x412139['pid']});});_0x412139['on']('exit',function(_0x2d4ee5){if(_0x2d4ee5&&!_0x53c47b){return _0x156c3f[_0x2bbd('0x12')](0x1f4)[_0x2bbd('0x13')]({'message':'error\x20child\x20process','pid':_0x412139[_0x2bbd('0xd5')]});}});})[_0x2bbd('0x84')](handleError(_0x156c3f,null));};exports[_0x2bbd('0xe0')]=function(_0x2ae73d,_0x40dfdc){var _0x22e8dd=[_0x2bbd('0xe1'),_0x2bbd('0xe2'),_0x2bbd('0xe3'),_0x2bbd('0xe4'),_0x2bbd('0xe5'),_0x2bbd('0xe6'),_0x2bbd('0xe7')];var _0x2f2065={'offset':0x0,'order':qs[_0x2bbd('0x36')](_0x2bbd('0xe8'))},_0x412e12={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x2ae73d[_0x2bbd('0x2e')]['channel']){if(!_['includes'](_0x22e8dd,_0x2ae73d[_0x2bbd('0x2e')]['channel']['toLowerCase']())){throw new Error(_0x2bbd('0xe9'));}_0x22e8dd=[_0x2ae73d['query']['channel'][_0x2bbd('0xea')]()];}if(_0x2ae73d[_0x2bbd('0x2e')]['range']){try{var _0x1b2b3b=JSON['parse'](_0x2ae73d[_0x2bbd('0x2e')][_0x2bbd('0xeb')]);if(!moment(_0x1b2b3b[_0x2bbd('0x3b')])[_0x2bbd('0xec')]()){throw new Error(_0x2bbd('0xed'));}if(!moment(_0x1b2b3b['to'])[_0x2bbd('0xec')]()){throw new Error(_0x2bbd('0xee'));}}catch(_0x19cdd2){throw new Error(_0x2bbd('0xef'));}}if(!_0x2ae73d[_0x2bbd('0x2e')][_0x2bbd('0x33')]('nolimit')){_0x2f2065[_0x2bbd('0x16')]=qs[_0x2bbd('0x16')](_0x2ae73d['query'][_0x2bbd('0x16')]||0xa);_0x2f2065[_0x2bbd('0x14')]=qs[_0x2bbd('0x14')](_0x2ae73d['query'][_0x2bbd('0x14')]);}var _0x142cec=_0x22e8dd[_0x2bbd('0x4b')](function(_0x5f2b4d){if(_0x5f2b4d===_0x2bbd('0xe7')){var _0x5552a1={'attributes':['id','uniqueid',_0x2bbd('0x8c'),'source',_0x2bbd('0xf0'),_0x2bbd('0xf1'),_0x2bbd('0xf2'),_0x2bbd('0xf3'),'duration',_0x2bbd('0xf4'),'createdAt','userDisposition',_0x2bbd('0xf5'),_0x2bbd('0xf6'),_0x2bbd('0xf7')],'where':{'ContactId':_0x2ae73d[_0x2bbd('0x85')]['id']},'include':[{'model':db['User'],'as':_0x2bbd('0x71'),'attributes':['id','name',_0x2bbd('0xf8'),_0x2bbd('0x8a')]}],'order':[[_0x2bbd('0xf9'),_0x2bbd('0x6b')]]};if(_0x2ae73d['query']['range']){_0x5552a1[_0x2bbd('0x42')]['createdAt']={'$gte':_0x1b2b3b[_0x2bbd('0x3b')],'$lte':_0x1b2b3b['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x5552a1)[_0x2bbd('0x1a')](function(_0x156e5d){_0x412e12[_0x2bbd('0x17')]+=_0x156e5d[_0x2bbd('0x17')];return _[_0x2bbd('0x4b')](_0x156e5d[_0x2bbd('0x83')],function(_0x2bce5f){var _0x59ec67=_0x2bce5f['get']({'plain':!![]});_0x59ec67[_0x2bbd('0xfa')]=_0x5f2b4d;if(_0x59ec67['User']){_0x59ec67[_0x2bbd('0x71')]={'id':_0x59ec67[_0x2bbd('0x71')]['id'],'name':_0x59ec67[_0x2bbd('0x71')][_0x2bbd('0x20')],'fullname':_0x59ec67['User']['fullname'],'alias':_0x59ec67['User'][_0x2bbd('0x8a')]};}return _0x59ec67;});});}else{var _0x20e072=_[_0x2bbd('0xfb')](_0x5f2b4d)+(_0x5f2b4d==='chat'?'Website':_0x2bbd('0xfc'));var _0x2e8c42={'attributes':['id',_0x2bbd('0xfd'),_0x2bbd('0xfe'),'createdAt','note','disposition',_0x2bbd('0xff'),_0x2bbd('0x100'),_0x2bbd('0xf7'),_0x20e072+'Id'],'where':{'ContactId':_0x2ae73d[_0x2bbd('0x85')]['id']},'include':[{'model':db[_0x20e072],'as':_0x2bbd('0xfc'),'attributes':['id',_0x2bbd('0x20'),_0x2bbd('0x101')]},{'model':db[_0x2bbd('0x71')],'as':_0x2bbd('0x102'),'attributes':['id','name',_0x2bbd('0xf8')]},{'model':db[_0x2bbd('0x49')],'as':_0x2bbd('0x82'),'attributes':['id',_0x2bbd('0x20'),_0x2bbd('0x3a')],'through':{'attributes':[]}}],'order':[[_0x2bbd('0xf9'),'DESC']]};if(_0x2ae73d[_0x2bbd('0x2e')][_0x2bbd('0xeb')]){_0x2e8c42[_0x2bbd('0x42')][_0x2bbd('0xf9')]={'$gte':_0x1b2b3b[_0x2bbd('0x3b')],'$lte':_0x1b2b3b['to']};}switch(_0x5f2b4d){case _0x2bbd('0xe2'):_0x2e8c42[_0x2bbd('0x31')]['push'](_0x2bbd('0x103'),_0x2bbd('0x104'),_0x2bbd('0x105'),_0x2bbd('0x106'),'osName',_0x2bbd('0x107'),'ratingType',_0x2bbd('0x108'),_0x2bbd('0x109'));break;case'mail':_0x2e8c42['attributes'][_0x2bbd('0x28')](_0x2bbd('0x10a'),_0x2bbd('0x10b'));break;case _0x2bbd('0xe4'):_0x2e8c42[_0x2bbd('0x31')]['push']('externalUrl',_0x2bbd('0x10c'));break;}return db[_[_0x2bbd('0xfb')](_0x5f2b4d)+_0x2bbd('0x10d')][_0x2bbd('0x10e')](_0x2e8c42)[_0x2bbd('0x1a')](function(_0x24791e){_0x412e12[_0x2bbd('0x17')]+=_0x24791e['count'];return _[_0x2bbd('0x4b')](_0x24791e[_0x2bbd('0x83')],function(_0x545d47){var _0x52e9e2=_0x545d47[_0x2bbd('0x8f')]({'plain':!![]});_0x52e9e2[_0x2bbd('0xfa')]=_0x5f2b4d;if(_0x52e9e2[_0x2bbd('0x102')]){_0x52e9e2['Owner']={'id':_0x52e9e2[_0x2bbd('0x102')]['id'],'name':_0x52e9e2['Owner'][_0x2bbd('0x20')],'fullname':_0x52e9e2[_0x2bbd('0x102')]['fullname']};}return _0x52e9e2;});});}});return Promise[_0x2bbd('0x2b')](_0x142cec);})['then'](function(_0x43395c){return _(_0x43395c)['flatten']()[_0x2bbd('0x10f')](_0x2bbd('0xf9'))[_0x2bbd('0x110')]()[_0x2bbd('0x4a')]();})[_0x2bbd('0x1a')](function(_0x4c5505){_0x412e12[_0x2bbd('0x83')]=_0x2f2065[_0x2bbd('0x16')]?_0x4c5505[_0x2bbd('0x111')](_0x2f2065[_0x2bbd('0x14')],_0x2f2065[_0x2bbd('0x14')]+_0x2f2065['limit']):_0x4c5505;return _0x412e12;})['then'](respondWithFilteredResult(_0x40dfdc,_0x2f2065))[_0x2bbd('0x84')](handleError(_0x40dfdc,null));};
\ No newline at end of file
+var _0x50c4=['body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','MailInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','bulkCreate','duplicates','$or','show','$and','omit','format','cf_%d','table','setFields','id\x20=\x20?','phone','rawAttributes','nolimit','getTags','setTags','ids','getHoppers','CmHopper','includeAll','include','getHopperHistories','options','getHopperFinals','getJscriptySessions','ContactId','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','upload','createReadStream','file','parse','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','mail','sms','whatsapp','includes','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','chat','Website','closed','disposition','thirdDisposition','Account','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','subject','substatus','openchannel','threadId','Interaction','Owner','all','flatten','sortBy','reverse','slice','bluebird','util','path','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','then','destroy','error','stack','name','send','describe','length','startsWith','push','findOne','trimStart','cf_','type','keys','query','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','fieldType','castTo','buildExpression','text','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','isArray','tag','filter','replace','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','CmContact','c.firstName','c.phone','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','displayName','CmCustomField','findAll','alias','custom','values','columnName'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x50c4,0x8a));var _0x450c=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x50c4[_0x4de9e8];return _0x4db0de;};'use strict';var moment=require('moment');var BPromise=require(_0x450c('0x0'));var util=require(_0x450c('0x1'));var path=require(_0x450c('0x2'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0x450c('0x3'));var Redis=require(_0x450c('0x4'));var qs=require(_0x450c('0x5'));var as=require(_0x450c('0x6'));var logger=require('../../config/logger')(_0x450c('0x7'));var config=require(_0x450c('0x8'));var db=require('../../mysqldb')['db'];config[_0x450c('0x9')]=_[_0x450c('0xa')](config['redis'],{'host':_0x450c('0xb'),'port':0x18eb});var socket=require(_0x450c('0xc'))(new Redis(config['redis']));require(_0x450c('0xd'))[_0x450c('0xe')](socket);function respondWithResult(_0x4ff7d8,_0x16dd59){_0x16dd59=_0x16dd59||0xc8;return function(_0x23def7){if(_0x23def7){return _0x4ff7d8[_0x450c('0xf')](_0x16dd59)['json'](_0x23def7);}};}function respondWithFilteredResult(_0x4ffdbe,_0x303ea3){return function(_0x26bf01){if(_0x26bf01){var _0x18aa4f=typeof _0x303ea3['offset']===_0x450c('0x10')&&typeof _0x303ea3['limit']==='undefined';var _0x344e03=_0x26bf01[_0x450c('0x11')];var _0x4266ca=_0x18aa4f?0x0:_0x303ea3[_0x450c('0x12')];var _0x1a6258=_0x18aa4f?_0x26bf01['count']:_0x303ea3[_0x450c('0x12')]+_0x303ea3[_0x450c('0x13')];var _0x58f0bc;if(_0x1a6258>=_0x344e03){_0x1a6258=_0x344e03;_0x58f0bc=0xc8;}else{_0x58f0bc=0xce;}_0x4ffdbe['status'](_0x58f0bc);return _0x4ffdbe[_0x450c('0x14')](_0x450c('0x15'),_0x4266ca+'-'+_0x1a6258+'/'+_0x344e03)[_0x450c('0x16')](_0x26bf01);}return null;};}function saveUpdates(_0x26e250){return function(_0x186729){if(_0x186729){return _0x186729['update'](_0x26e250)[_0x450c('0x17')](function(_0x2c7727){return _0x2c7727;});}return null;};}function removeEntity(_0x382049){return function(_0x13a1f7){if(_0x13a1f7){return _0x13a1f7[_0x450c('0x18')]()[_0x450c('0x17')](function(){_0x382049[_0x450c('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48aa59){return function(_0x48a0f1){if(!_0x48a0f1){_0x48aa59['sendStatus'](0x194);}return _0x48a0f1;};}function handleError(_0x165cf1,_0x553dce){_0x553dce=_0x553dce||0x1f4;return function(_0x36460e){logger[_0x450c('0x19')](_0x36460e[_0x450c('0x1a')]);if(_0x36460e[_0x450c('0x1b')]){delete _0x36460e[_0x450c('0x1b')];}_0x165cf1[_0x450c('0xf')](_0x553dce)[_0x450c('0x1c')](_0x36460e);};}exports['index']=function(_0x3a05d8,_0x34ac82){var _0x456558={},_0x354d6d={},_0x3e3e34={'count':0x0,'rows':[]};return db['CmContact'][_0x450c('0x1d')]()[_0x450c('0x17')](function(_0x36e145){var _0xa4aedc=[];for(var _0x2d0446=0x0;_0x2d0446<Object['keys'](_0x36e145)[_0x450c('0x1e')];_0x2d0446++){var _0x34a308=Object['keys'](_0x36e145)[_0x2d0446];if(_[_0x450c('0x1f')](_0x34a308,'cf_')){_0xa4aedc[_0x450c('0x20')](db['CmCustomField'][_0x450c('0x21')]({'where':{'id':_[_0x450c('0x22')](_0x34a308,'cf_')},'raw':!![]}));}}return BPromise['all'](_0xa4aedc)['then'](function(_0x410083){for(var _0x14c9d0=0x0;_0x14c9d0<_0x410083[_0x450c('0x1e')];_0x14c9d0++){if(_0x410083[_0x14c9d0]){var _0x373a95=_0x450c('0x23')+_0x410083[_0x14c9d0]['id'];var _0x2d6376=_0x36e145[_0x373a95];_0x2d6376['fieldType']=_0x410083[_0x14c9d0][_0x450c('0x24')];}}return _0x36e145;});})['then'](function(_0xe7bdc6){_0x354d6d['model']=_[_0x450c('0x25')](_0xe7bdc6);_0x354d6d[_0x450c('0x26')]=_[_0x450c('0x25')](_0x3a05d8[_0x450c('0x26')]);_0x354d6d['filters']=_['intersection'](_0x354d6d[_0x450c('0x27')],_0x354d6d[_0x450c('0x26')]);_0x456558[_0x450c('0x28')]=_[_0x450c('0x29')](_0x354d6d[_0x450c('0x27')],qs[_0x450c('0x2a')](_0x3a05d8['query'][_0x450c('0x2a')]));_0x456558[_0x450c('0x28')]=_0x456558['attributes']['length']?_0x456558['attributes']:_0x354d6d[_0x450c('0x27')];if(!_0x3a05d8['query'][_0x450c('0x2b')]('nolimit')){_0x456558[_0x450c('0x13')]=qs['limit'](_0x3a05d8[_0x450c('0x26')][_0x450c('0x13')]);_0x456558['offset']=qs['offset'](_0x3a05d8[_0x450c('0x26')][_0x450c('0x12')]);}_0x456558[_0x450c('0x2c')]=qs[_0x450c('0x2d')](_0x3a05d8[_0x450c('0x26')][_0x450c('0x2d')]);_0x456558[_0x450c('0x2e')]=qs[_0x450c('0x2f')](_[_0x450c('0x30')](_0x3a05d8[_0x450c('0x26')],_0x354d6d[_0x450c('0x2f')]),_0xe7bdc6);var _0x3f3eaf=[];var _0x42becc=squel[_0x450c('0x31')]()[_0x450c('0x32')]('id')['field']('name')[_0x450c('0x32')](_0x450c('0x33'))[_0x450c('0x34')](_0x450c('0x35'));var _0x3f9ec6=squel[_0x450c('0x31')]()[_0x450c('0x34')]('cm_contacts','c')[_0x450c('0x36')]('cm_user_has_contacts','uc',_0x450c('0x37'))[_0x450c('0x36')](_0x450c('0x38'),'ct',_0x450c('0x39'))['left_join'](_0x450c('0x35'),'t','t.id\x20=\x20ct.TagId')['where']('c.deletedAt\x20IS\x20NULL');var _0x3d3aa0=squel[_0x450c('0x3a')]();var _0x180809=[];var _0x19d8ea=squel[_0x450c('0x3a')]();var _0x323d2e;if(_0x3a05d8['query'][_0x450c('0x3b')]){_0x323d2e=as[_0x450c('0x3c')](_0x3a05d8['query'][_0x450c('0x3b')]);var _0x547f46=_0x323d2e[_0x450c('0x3d')];for(var _0x22bfd6=0x0;_0x22bfd6<_0x323d2e[_0x450c('0x3e')]['length'];_0x22bfd6++){var _0x172471=_0x323d2e[_0x450c('0x3e')][_0x22bfd6];var _0x2bbe1b='c';var _0x12665b=_(_0xe7bdc6)[_0x450c('0x25')]()[_0x450c('0x3f')](function(_0x372b23){return _0x372b23===_0x172471[_0x450c('0x32')];});if(_0x12665b)_0x12665b=_0xe7bdc6[_0x172471['field']];if(!_0x12665b){if(_0x172471[_0x450c('0x32')]===_0x450c('0x40')){var _0x29d8d2=_0x172471[_0x450c('0x41')][_0x450c('0x42')](',')[_0x450c('0x43')](function(_0xdf66ae){return Number(_0xdf66ae);});_0x29d8d2[_0x450c('0x44')](function(_0x4543b8){_0x19d8ea['or'](_0x450c('0x45'),'%,'+_0x4543b8+',%');});_0x180809=_[_0x450c('0x46')](_0x180809,_0x29d8d2);}else if(_0x172471[_0x450c('0x32')]===_0x450c('0x47')){_0x3d3aa0[_0x450c('0x48')](_0x450c('0x49'),_0x172471[_0x450c('0x41')]);}}else{if(_0x172471['field']==='dateOfBirth'||_0x12665b[_0x450c('0x4a')]==='datetime')_0x172471[_0x450c('0x4b')]='DATE';var _0x59f0cf=as[_0x450c('0x4c')](_0x2bbe1b,_0x12665b[_0x450c('0x24')],_0x172471);_0x3d3aa0[_0x547f46](_0x59f0cf[_0x450c('0x4d')],_0x59f0cf[_0x450c('0x41')][_0x450c('0x4e')],_0x59f0cf[_0x450c('0x41')]['end']);}}}else{var _0x33e79d=_(Object[_0x450c('0x25')](_0x3a05d8['query']))[_0x450c('0x43')](function(_0x52706c){return _0xe7bdc6[_0x450c('0x2b')](_0x52706c)?_0x52706c:undefined;})['filter'](function(_0x4fb361){return!_[_0x450c('0x4f')](_0x4fb361);})[_0x450c('0x41')]();if(_0x3a05d8[_0x450c('0x26')][_0x450c('0x50')])_0x33e79d[_0x450c('0x20')]('Contact');if(!_[_0x450c('0x51')](_0x33e79d)){_0x33e79d['forEach'](function(_0x132d64){if(_0x132d64===_0x450c('0x52')){_0x3f9ec6[_0x450c('0x2e')](_0x450c('0x53'),[]['concat'](_0x3a05d8['query'][_0x132d64]));}else if(_0x132d64===_0x450c('0x50')){var _0x5ec199='%'+_0x3a05d8['query'][_0x132d64]+'%';_0x3f9ec6[_0x450c('0x2e')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x5ec199);}else{_0x3f9ec6[_0x450c('0x2e')]('c.'+_0x132d64+'\x20=\x20?',_0x3a05d8['query'][_0x132d64]);}});}if(_0x3a05d8[_0x450c('0x26')]['tag']){_0x180809=_[_0x450c('0x54')](_0x3a05d8[_0x450c('0x26')][_0x450c('0x55')])?_0x3a05d8[_0x450c('0x26')][_0x450c('0x55')]:new Array(_0x3a05d8[_0x450c('0x26')][_0x450c('0x55')]);_0x180809[_0x450c('0x44')](function(_0x1d833a){_0x19d8ea['or'](_0x450c('0x45'),'%,'+_0x1d833a+',%');});}if(_0x3a05d8['query'][_0x450c('0x56')]){var _0x297eb2=_0x3a05d8[_0x450c('0x26')][_0x450c('0x56')][_0x450c('0x57')]('\x5c','\x5c\x5c')[_0x450c('0x57')](/'/g,'\x27\x27');if(_0x297eb2[_0x450c('0x42')]('\x20')[_0x450c('0x1e')]>0x1){_0x3d3aa0['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x450c('0x58')](_0x297eb2),null);}else{if(qs[_0x450c('0x59')](_0x297eb2)){_0x3d3aa0['or']('c.id\x20LIKE\x20?',_0x297eb2+'%');_0x3d3aa0['or'](_0x450c('0x5a'),_0x297eb2+'%');_0x3d3aa0['or']('c.mobile\x20LIKE\x20?',_0x297eb2+'%');_0x3d3aa0['or'](_0x450c('0x5b'),_0x297eb2+'%');}else if(qs['isEmail'](_0x297eb2)){_0x3d3aa0['or'](_0x450c('0x5c'),_0x297eb2+'%');}else{_0x3d3aa0['or']('c.firstName\x20LIKE\x20?','%'+_0x297eb2+'%');_0x3d3aa0['or']('c.lastName\x20LIKE\x20?','%'+_0x297eb2+'%');_0x3d3aa0['or']('c.email\x20LIKE\x20?','%'+_0x297eb2+'%');}}}}_0x3f9ec6['where'](_0x3d3aa0);_0x3f9ec6[_0x450c('0x5d')](_0x450c('0x5e'));var _0x4e791a={'type':db[_0x450c('0x5f')][_0x450c('0x60')][_0x450c('0x61')],'raw':!![]};var _0x1f88ee=_0x3f9ec6[_0x450c('0x62')]()[_0x450c('0x32')](_0x450c('0x5e'));if(_0x456558[_0x450c('0x2c')]){_0x456558[_0x450c('0x2c')][_0x450c('0x44')](function(_0x3b067e){_0x3f9ec6['order']('c.'+_0x3b067e[0x0],_0x3b067e[0x1]===_0x450c('0x63')?![]:!![]);});}if(!_[_0x450c('0x51')](_0x180809)){_0x3f9ec6['having'](_0x19d8ea);_0x1f88ee[_0x450c('0x2e')](_0x450c('0x64'),_0x180809);}BPromise['resolve']()['then'](function(){if(!_0x323d2e)return;if(_0x3a05d8[_0x450c('0x65')]['role']!==_0x450c('0x66'))return;if(!_[_0x450c('0x67')](_0x323d2e['conditions'],[_0x450c('0x32'),_0x450c('0x47')])){return _0x3a05d8[_0x450c('0x65')][_0x450c('0x68')]({'attributes':['id'],'raw':!![]})[_0x450c('0x17')](function(_0x3fb820){if(_[_0x450c('0x51')](_0x3fb820)){_0x1f88ee[_0x450c('0x2e')](_0x450c('0x69'));_0x3f9ec6[_0x450c('0x2e')]('c.ListId\x20IS\x20NULL');}else{_0x1f88ee['where'](_0x450c('0x53'),_[_0x450c('0x43')](_0x3fb820,'id'));_0x3f9ec6[_0x450c('0x2e')](_0x450c('0x53'),_[_0x450c('0x43')](_0x3fb820,'id'));}});}})[_0x450c('0x17')](function(){if(_0x3a05d8[_0x450c('0x65')][_0x450c('0x6a')]===_0x450c('0x66')&&!_0x323d2e&&!_0x3a05d8[_0x450c('0x26')]['ListId'])return[];return db['sequelize'][_0x450c('0x26')](_0x1f88ee[_0x450c('0x6b')](),_0x4e791a);})[_0x450c('0x17')](function(_0x3656b5){_0x3e3e34[_0x450c('0x11')]=_0x3656b5[_0x450c('0x1e')];if(_0x3e3e34[_0x450c('0x11')]===0x0)return[];return db[_0x450c('0x6c')][_0x450c('0x26')](_0x42becc[_0x450c('0x6b')](),_0x4e791a)[_0x450c('0x17')](function(_0x3551de){_0x3f3eaf=_[_0x450c('0x6d')](_0x3551de,'id');_0x4e791a=_[_0x450c('0x6e')](_0x4e791a,{'model':db[_0x450c('0x6f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a05d8[_0x450c('0x26')][_0x450c('0x2a')]){_0x456558[_0x450c('0x28')][_0x450c('0x44')](function(_0xeac8a4){_0x3f9ec6[_0x450c('0x32')]('c.'+_0xeac8a4);});}else{_0x3f9ec6[_0x450c('0x32')](_0x450c('0x5e'));_0x3f9ec6[_0x450c('0x32')](_0x450c('0x70'));_0x3f9ec6['field']('c.lastName');_0x3f9ec6[_0x450c('0x32')](_0x450c('0x71'));_0x3f9ec6[_0x450c('0x32')]('c.mobile');_0x3f9ec6['field']('c.fax');_0x3f9ec6[_0x450c('0x32')](_0x450c('0x72'));_0x3f9ec6['field'](_0x450c('0x73'));_0x3f9ec6[_0x450c('0x32')](_0x450c('0x74'));_0x3f9ec6[_0x450c('0x32')](_0x450c('0x75'));_0x3f9ec6[_0x450c('0x32')](_0x450c('0x76'));_0x3f9ec6[_0x450c('0x32')](_0x450c('0x77'),'TagIds');}if(_0x456558[_0x450c('0x13')])_0x3f9ec6[_0x450c('0x13')](_0x456558['limit']);if(_0x456558['offset'])_0x3f9ec6[_0x450c('0x12')](_0x456558['offset']);return db['sequelize']['query'](_0x3f9ec6['toString'](),_0x4e791a);});})[_0x450c('0x17')](function(_0x41fd4f){_0x41fd4f['forEach'](function(_0x5721fa){if(_0x5721fa[_0x450c('0x78')]){_0x5721fa[_0x450c('0x79')]=[];_0x5721fa['TagIds']['split'](',')[_0x450c('0x44')](function(_0x3bce0c){_0x5721fa[_0x450c('0x79')][_0x450c('0x20')](_0x3f3eaf[_0x3bce0c]);});}delete _0x5721fa[_0x450c('0x78')];});_0x3e3e34[_0x450c('0x7a')]=_0x41fd4f;return _0x3e3e34;})['then'](respondWithFilteredResult(_0x34ac82,_0x456558));})[_0x450c('0x7b')](handleError(_0x34ac82,null));};exports['destroy']=function(_0x11a1e5,_0x21bef6){return db['CmContact'][_0x450c('0x3f')]({'where':{'id':_0x11a1e5[_0x450c('0x7c')]['id']}})[_0x450c('0x17')](handleEntityNotFound(_0x21bef6,null))['then'](removeEntity(_0x21bef6,null))[_0x450c('0x7b')](handleError(_0x21bef6,null));};exports[_0x450c('0x1d')]=function(_0x18e217,_0x6dc07){return db[_0x450c('0x6f')][_0x450c('0x1d')]()['then'](function(_0x44edba){delete _0x44edba[_0x450c('0x7d')];for(var _0x267027=0x0;_0x267027<Object[_0x450c('0x25')](_0x44edba)[_0x450c('0x1e')];_0x267027++){var _0x5a2970=Object[_0x450c('0x25')](_0x44edba)[_0x267027];if(!_[_0x450c('0x1f')](_0x5a2970,_0x450c('0x23'))){_0x44edba[_0x5a2970]['columnName']=_0x5a2970;_0x44edba[_0x5a2970][_0x450c('0x7e')]=_0x5a2970;}}return _0x44edba;})['then'](function(_0x6f81bd){var _0x4a1887={'where':Boolean(_0x18e217[_0x450c('0x26')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x18e217[_0x450c('0x26')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x450c('0x7f')][_0x450c('0x80')](_0x4a1887)[_0x450c('0x17')](function(_0x23849e){for(var _0x3a1ef2=0x0;_0x3a1ef2<_0x23849e[_0x450c('0x1e')];_0x3a1ef2++){var _0x119895=_0x450c('0x23')+_0x23849e[_0x3a1ef2]['id'];_0x6f81bd[_0x119895]['columnName']=_0x119895;_0x6f81bd[_0x119895][_0x450c('0x7e')]=_0x23849e[_0x3a1ef2][_0x450c('0x81')];_0x6f81bd[_0x119895][_0x450c('0x82')]={'type':_0x23849e[_0x3a1ef2]['type'],'values':_0x23849e[_0x3a1ef2][_0x450c('0x83')]};}Object[_0x450c('0x25')](_0x6f81bd)['forEach'](function(_0x67ba62){if(!_0x6f81bd[_0x67ba62][_0x450c('0x2b')](_0x450c('0x84'))){delete _0x6f81bd[_0x67ba62];}});return _0x6f81bd;});})[_0x450c('0x17')](respondWithResult(_0x6dc07,null))[_0x450c('0x7b')](handleError(_0x6dc07,null));};exports[_0x450c('0x6e')]=function(_0x1b7017,_0x14a3cc){var _0x395303;var _0x2a07de;var _0x386ce1;if(_0x1b7017[_0x450c('0x85')]['id']){delete _0x1b7017['body']['id'];}return db[_0x450c('0x6f')][_0x450c('0x80')]({'where':{'id':[_0x1b7017[_0x450c('0x85')]['to'],_0x1b7017[_0x450c('0x85')][_0x450c('0x34')]]}})[_0x450c('0x17')](function(_0x1bcb2e){if(_0x1bcb2e){if(_0x1bcb2e[_0x450c('0x1e')]!==0x2){return null;}_0x1bcb2e[0x0]=_0x1bcb2e[0x0][_0x450c('0x86')]({'plain':!![]});_0x1bcb2e[0x1]=_0x1bcb2e[0x1][_0x450c('0x86')]({'plain':!![]});delete _0x1bcb2e[0x0]['id'];delete _0x1bcb2e[0x1]['id'];return _[_0x450c('0x87')](_0x1bcb2e[0x0],_0x1bcb2e[0x1],function(_0x1665ff,_0x265fb7){if(Array[_0x450c('0x54')](_0x265fb7)&&!_0x265fb7[_0x450c('0x1e')]){return _0x1665ff;}else if(!_0x265fb7){return _0x1665ff;}});}})[_0x450c('0x17')](handleEntityNotFound(_0x14a3cc,null))[_0x450c('0x17')](function(_0x5626ac){if(_0x5626ac){if(_0x5626ac['tags']&&_[_0x450c('0x54')](_0x5626ac['tags'])){_0x5626ac[_0x450c('0x7d')]=_0x5626ac[_0x450c('0x7d')][_0x450c('0x88')]();}logger[_0x450c('0x89')](_0x450c('0x8a'),_0x1b7017[_0x450c('0x85')]['to'],_0x1b7017[_0x450c('0x85')][_0x450c('0x34')]);return db['CmHopper'][_0x450c('0x18')]({'where':{'ContactId':[_0x1b7017[_0x450c('0x85')]['to'],_0x1b7017['body']['from']]}})[_0x450c('0x17')](function(_0x1edd87){logger[_0x450c('0x89')](_0x450c('0x8b'),_0x1edd87);return db[_0x450c('0x8c')][_0x450c('0x18')]({'where':{'ContactId':[_0x1b7017['body']['to'],_0x1b7017[_0x450c('0x85')]['from']]}})['then'](function(_0x6b6d28){logger[_0x450c('0x89')](_0x450c('0x8d'),_0x6b6d28);return db[_0x450c('0x6f')][_0x450c('0x8e')](_0x5626ac);});});}})[_0x450c('0x17')](function(_0x26db0a){if(_0x26db0a){_0x395303=_0x26db0a;_0x2a07de={'ContactId':_0x395303['id']};_0x386ce1={'where':{'ContactId':[_0x1b7017['body']['to'],_0x1b7017[_0x450c('0x85')][_0x450c('0x34')]]}};return db[_0x450c('0x8f')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x91')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db['ChatOfflineMessage'][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db[_0x450c('0x92')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db['MailMessage'][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x92')]['update'](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db['MailMessage']['update'](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db['SmsInteraction']['update'](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x93')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x94')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x95')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x96')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db['OpenchannelMessage'][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x97')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x98')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x99')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db[_0x450c('0x9a')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x9b')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db[_0x450c('0x9c')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db['MailQueueReport'][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x9d')][_0x450c('0x90')](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db[_0x450c('0x9e')]['update'](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0x9f')]['update'](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db[_0x450c('0xa0')]['update'](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db['WhatsappMessage']['update'](_0x2a07de,_0x386ce1);}})[_0x450c('0x17')](function(){if(_0x395303){return db['WhatsappQueueReport']['update'](_0x2a07de,_0x386ce1);}})['then'](function(){if(_0x395303){return db[_0x450c('0x6f')]['destroy']({'where':{'id':[_0x1b7017[_0x450c('0x85')]['to'],_0x1b7017[_0x450c('0x85')][_0x450c('0x34')]]}});}})[_0x450c('0x17')](function(){if(_0x395303){return _0x395303;}})[_0x450c('0x17')](respondWithResult(_0x14a3cc,null))[_0x450c('0x7b')](handleError(_0x14a3cc,null));};exports[_0x450c('0x8e')]=function(_0x244c57,_0x31742c){return db['CmContact'][_0x450c('0x1d')]()[_0x450c('0x17')](function(_0x3a6b79){if(_0x244c57[_0x450c('0x85')][_0x450c('0x7d')]&&_[_0x450c('0x54')](_0x244c57[_0x450c('0x85')]['tags'])){if(_0x244c57[_0x450c('0x85')][_0x450c('0x7d')][_0x450c('0x1e')]){_0x244c57[_0x450c('0x85')][_0x450c('0x7d')]=_0x244c57[_0x450c('0x85')][_0x450c('0x7d')][_0x450c('0x88')](';')+';';}else{_0x244c57[_0x450c('0x85')]['tags']=null;}}else{_0x244c57[_0x450c('0x85')]['tags']=null;}return db[_0x450c('0x6f')][_0x450c('0x8e')](_0x244c57[_0x450c('0x85')],{'fields':_[_0x450c('0x25')](_0x3a6b79),'raw':!![]});})['then'](respondWithResult(_0x31742c,0xc9))[_0x450c('0x7b')](handleError(_0x31742c,null));};exports[_0x450c('0xa1')]=function(_0x2a8ccb,_0x3cf204){var _0x4ac4e3=0x0;var _0x2480e4=0x0;var _0x5d832f=0x0;return db[_0x450c('0x6f')][_0x450c('0x1d')]()[_0x450c('0x17')](function(_0x271c1f){return BPromise['each'](_0x2a8ccb['body'],function(_0x4708ea){var _0x1af646={'where':{'$or':[]},'defaults':_0x4708ea,'fields':_[_0x450c('0x25')](_0x271c1f),'raw':!![]};if(_0x4708ea[_0x450c('0xa2')]){for(var _0x584c5c=0x0;_0x584c5c<_0x4708ea[_0x450c('0xa2')][_0x450c('0x1e')];_0x584c5c++){var _0xda90e0={};_0xda90e0[_0x4708ea[_0x450c('0xa2')][_0x584c5c]]=_0x4708ea[_0x4708ea['duplicates'][_0x584c5c]];_0x1af646['where'][_0x450c('0xa3')][_0x450c('0x20')](_0xda90e0);}_0x1af646[_0x450c('0x2e')][_0x450c('0x52')]=_0x4708ea[_0x450c('0x52')];}return db[_0x450c('0x6f')]['findOrCreate'](_0x1af646)['spread'](function(_0x3d3985,_0x426a4b){if(_0x426a4b){_0x4ac4e3++;}else{_0x5d832f++;}})[_0x450c('0x7b')](function(){_0x2480e4++;});});})[_0x450c('0x17')](function(_0x518730){if(_0x518730){return{'success':_0x4ac4e3,'failure':_0x2480e4,'duplicates':_0x5d832f};}})['then'](respondWithResult(_0x3cf204,0xc9))['catch'](handleError(_0x3cf204,null));};exports[_0x450c('0xa4')]=function(_0x39e2ba,_0x6cad4f){var _0x26f527;return db[_0x450c('0x6f')]['describe']()[_0x450c('0x17')](function(_0x41da46){return db[_0x450c('0x6f')][_0x450c('0x3f')]({'where':{'id':_0x39e2ba[_0x450c('0x7c')]['id']},'include':[{'model':db[_0x450c('0x40')],'as':'Tags','attributes':['id',_0x450c('0x1b'),_0x450c('0x33')],'required':_0x39e2ba['query'][_0x450c('0x55')]?!![]:![]}],'attributes':_[_0x450c('0x25')](_0x41da46)});})['then'](function(_0x2ed698){if(!_['isNil'](_0x2ed698)){_0x26f527=_0x2ed698[_0x450c('0x86')]({'plain':!![]});var _0x307866={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2ed698&&_0x2ed698[_0x450c('0x52')]){if(_0x2ed698[_0x450c('0x52')]){_0x307866['where'][_0x450c('0xa5')]['push']({'ListId':{'$ne':_0x2ed698[_0x450c('0x52')]}});}}return db[_0x450c('0x7f')][_0x450c('0x80')](_0x307866);}})['then'](function(_0x342750){if(!_[_0x450c('0x4f')](_0x342750)){return _[_0x450c('0xa6')](_0x26f527,_[_0x450c('0x43')](_0x342750,function(_0x479e42){return util[_0x450c('0xa7')](_0x450c('0xa8'),_0x479e42['id']);}));}})[_0x450c('0x17')](handleEntityNotFound(_0x6cad4f,null))[_0x450c('0x17')](respondWithResult(_0x6cad4f,null))[_0x450c('0x7b')](handleError(_0x6cad4f,null));};exports[_0x450c('0x90')]=function(_0x307632,_0x6249b3){var _0x4b679e;if(_0x307632[_0x450c('0x85')]['id']){delete _0x307632[_0x450c('0x85')]['id'];}return db[_0x450c('0x6f')]['find']({'where':{'id':_0x307632[_0x450c('0x7c')]['id']}})['then'](handleEntityNotFound(_0x6249b3,null))[_0x450c('0x17')](saveUpdates(_0x307632[_0x450c('0x85')],null))['then'](function(_0x52fe28){_0x4b679e=_0x52fe28;var _0x428bfd={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x52fe28&&_0x52fe28[_0x450c('0x52')]){if(_0x52fe28['ListId']){_0x428bfd[_0x450c('0x2e')][_0x450c('0xa5')][_0x450c('0x20')]({'ListId':{'$ne':_0x52fe28[_0x450c('0x52')]}});}}return db[_0x450c('0x7f')][_0x450c('0x80')](_0x428bfd);})[_0x450c('0x17')](function(_0x8ed3d0){if(_0x8ed3d0){return _[_0x450c('0xa6')](_['pickBy'](_0x307632[_0x450c('0x85')],function(_0x196643,_0x1a75c3){return _[_0x450c('0x1f')](_0x1a75c3,_0x450c('0x23'));}),_[_0x450c('0x43')](_0x8ed3d0,function(_0x29a13d){return util['format'](_0x450c('0xa8'),_0x29a13d['id']);}));}})[_0x450c('0x17')](function(_0x400361){if(_0x400361&&!_[_0x450c('0x51')](_0x400361)){var _0x14c2f9=squel['update']()[_0x450c('0xa9')]('cm_contacts')[_0x450c('0xaa')](_0x400361)['where'](_0x450c('0xab'),_0x307632[_0x450c('0x7c')]['id'])['toParam']();return db[_0x450c('0x6c')][_0x450c('0x26')](_0x14c2f9[_0x450c('0x4d')],{'replacements':_0x14c2f9[_0x450c('0x83')]});}})['then'](function(){if(_0x307632[_0x450c('0x85')][_0x450c('0xac')]&&_0x4b679e){return db['CmHopper'][_0x450c('0x90')]({'phone':_0x307632['body'][_0x450c('0xac')]},{'where':{'ContactId':_0x4b679e['id']}});}})[_0x450c('0x17')](function(){return _0x4b679e;})[_0x450c('0x17')](respondWithResult(_0x6249b3,null))['catch'](handleError(_0x6249b3,null));};exports['getTags']=function(_0x529de4,_0x4984d8){var _0x441173={};var _0x2d5c8f={};var _0x203c50;var _0x382331;return db[_0x450c('0x6f')]['findOne']({'where':{'id':_0x529de4['params']['id']}})[_0x450c('0x17')](handleEntityNotFound(_0x4984d8,null))['then'](function(_0x55721d){if(_0x55721d){_0x203c50=_0x55721d;_0x2d5c8f[_0x450c('0x27')]=_[_0x450c('0x25')](db[_0x450c('0x40')][_0x450c('0xad')]);_0x2d5c8f[_0x450c('0x26')]=_[_0x450c('0x25')](_0x529de4['query']);_0x2d5c8f[_0x450c('0x2f')]=_['intersection'](_0x2d5c8f[_0x450c('0x27')],_0x2d5c8f[_0x450c('0x26')]);_0x441173[_0x450c('0x28')]=_['intersection'](_0x2d5c8f[_0x450c('0x27')],qs[_0x450c('0x2a')](_0x529de4['query'][_0x450c('0x2a')]));_0x441173[_0x450c('0x28')]=_0x441173[_0x450c('0x28')]['length']?_0x441173[_0x450c('0x28')]:_0x2d5c8f[_0x450c('0x27')];_0x441173[_0x450c('0x2c')]=qs[_0x450c('0x2d')](_0x529de4[_0x450c('0x26')]['sort']);_0x441173[_0x450c('0x2e')]=qs[_0x450c('0x2f')](_[_0x450c('0x30')](_0x529de4['query'],_0x2d5c8f[_0x450c('0x2f')]));if(_0x529de4[_0x450c('0x26')][_0x450c('0x56')]){_0x441173[_0x450c('0x2e')]=_[_0x450c('0x6e')](_0x441173['where'],{'$or':_[_0x450c('0x43')](_0x441173[_0x450c('0x28')],function(_0x54f54d){var _0x2bff4d={};_0x2bff4d[_0x54f54d]={'$like':'%'+_0x529de4['query']['filter']+'%'};return _0x2bff4d;})});}_0x441173=_['merge']({},_0x441173,_0x529de4['options']);return _0x203c50['getTags'](_0x441173);}})['then'](function(_0x1c5658){if(_0x1c5658){_0x382331=_0x1c5658[_0x450c('0x1e')];if(!_0x529de4[_0x450c('0x26')][_0x450c('0x2b')](_0x450c('0xae'))){_0x441173[_0x450c('0x13')]=qs[_0x450c('0x13')](_0x529de4[_0x450c('0x26')][_0x450c('0x13')]);_0x441173[_0x450c('0x12')]=qs[_0x450c('0x12')](_0x529de4[_0x450c('0x26')][_0x450c('0x12')]);}return _0x203c50[_0x450c('0xaf')](_0x441173);}})[_0x450c('0x17')](function(_0x4624af){if(_0x4624af){return _0x4624af?{'count':_0x382331,'rows':_0x4624af}:null;}})[_0x450c('0x17')](respondWithResult(_0x4984d8,null))['catch'](handleError(_0x4984d8,null));};exports[_0x450c('0xb0')]=function(_0x21481c,_0x9f7572){if(_0x21481c[_0x450c('0x85')]['id']){delete _0x21481c[_0x450c('0x85')]['id'];}return db[_0x450c('0x6f')][_0x450c('0x21')]({'where':{'id':_0x21481c['params']['id']}})[_0x450c('0x17')](handleEntityNotFound(_0x9f7572,null))[_0x450c('0x17')](function(_0x409ccb){if(_0x409ccb){return _0x409ccb[_0x450c('0xb0')](_0x21481c[_0x450c('0x85')][_0x450c('0xb1')]||[]);}return null;})[_0x450c('0x17')](respondWithResult(_0x9f7572,null))['catch'](handleError(_0x9f7572,null));};exports[_0x450c('0xb2')]=function(_0xde776d,_0x21464d){var _0x3a6833={'raw':![],'where':{}};var _0x49c26e={};var _0x431076={'count':0x0,'rows':[]};return db[_0x450c('0x6f')][_0x450c('0x21')]({'where':{'id':_0xde776d[_0x450c('0x7c')]['id']}})[_0x450c('0x17')](handleEntityNotFound(_0x21464d,null))[_0x450c('0x17')](function(_0x426205){if(_0x426205){_0x49c26e[_0x450c('0x27')]=_[_0x450c('0x25')](db['CmHopper'][_0x450c('0xad')]);_0x49c26e[_0x450c('0x26')]=_['keys'](_0xde776d[_0x450c('0x26')]);_0x49c26e['filters']=_[_0x450c('0x29')](_0x49c26e[_0x450c('0x27')],_0x49c26e[_0x450c('0x26')]);_0x3a6833[_0x450c('0x28')]=_[_0x450c('0x29')](_0x49c26e[_0x450c('0x27')],qs[_0x450c('0x2a')](_0xde776d[_0x450c('0x26')]['fields']));_0x3a6833[_0x450c('0x28')]=_0x3a6833[_0x450c('0x28')][_0x450c('0x1e')]?_0x3a6833['attributes']:_0x49c26e[_0x450c('0x27')];if(!_0xde776d['query'][_0x450c('0x2b')](_0x450c('0xae'))){_0x3a6833[_0x450c('0x13')]=qs['limit'](_0xde776d[_0x450c('0x26')][_0x450c('0x13')]);_0x3a6833[_0x450c('0x12')]=qs[_0x450c('0x12')](_0xde776d[_0x450c('0x26')][_0x450c('0x12')]);}_0x3a6833[_0x450c('0x2c')]=qs['sort'](_0xde776d['query']['sort']);_0x3a6833[_0x450c('0x2e')]=qs['filters'](_[_0x450c('0x30')](_0xde776d['query'],_0x49c26e[_0x450c('0x2f')]));_0x3a6833[_0x450c('0x2e')]['ContactId']=_0x426205['id'];if(_0xde776d[_0x450c('0x26')][_0x450c('0x56')]){_0x3a6833[_0x450c('0x2e')]=_['merge'](_0x3a6833[_0x450c('0x2e')],{'$or':_[_0x450c('0x43')](_0x3a6833[_0x450c('0x28')],function(_0xbadad0){var _0x97aedb={};_0x97aedb[_0xbadad0]={'$like':'%'+_0xde776d[_0x450c('0x26')][_0x450c('0x56')]+'%'};return _0x97aedb;})});}_0x3a6833=_[_0x450c('0x6e')]({},_0x3a6833,_0xde776d['options']);return db[_0x450c('0xb3')][_0x450c('0x11')]({'where':_0x3a6833[_0x450c('0x2e')]})[_0x450c('0x17')](function(_0x5e72f4){_0x431076[_0x450c('0x11')]=_0x5e72f4;if(_0xde776d[_0x450c('0x26')][_0x450c('0xb4')]){_0x3a6833[_0x450c('0xb5')]=[{'all':!![]}];}return db[_0x450c('0xb3')][_0x450c('0x80')](_0x3a6833);})[_0x450c('0x17')](function(_0x348b66){_0x431076['rows']=_0x348b66;return _0x431076;});}})[_0x450c('0x17')](respondWithFilteredResult(_0x21464d,_0x3a6833))[_0x450c('0x7b')](handleError(_0x21464d,null));};exports[_0x450c('0xb6')]=function(_0x43ac15,_0x1c10b6){var _0x127f60={'raw':!![],'where':{}};var _0x21e2f5={};var _0x40164d={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x43ac15[_0x450c('0x7c')]['id']}})[_0x450c('0x17')](handleEntityNotFound(_0x1c10b6,null))[_0x450c('0x17')](function(_0x88c942){if(_0x88c942){_0x21e2f5[_0x450c('0x27')]=_[_0x450c('0x25')](db[_0x450c('0x98')][_0x450c('0xad')]);_0x21e2f5['query']=_[_0x450c('0x25')](_0x43ac15[_0x450c('0x26')]);_0x21e2f5[_0x450c('0x2f')]=_[_0x450c('0x29')](_0x21e2f5['model'],_0x21e2f5['query']);_0x127f60['attributes']=_[_0x450c('0x29')](_0x21e2f5[_0x450c('0x27')],qs[_0x450c('0x2a')](_0x43ac15[_0x450c('0x26')][_0x450c('0x2a')]));_0x127f60[_0x450c('0x28')]=_0x127f60[_0x450c('0x28')][_0x450c('0x1e')]?_0x127f60[_0x450c('0x28')]:_0x21e2f5[_0x450c('0x27')];if(!_0x43ac15[_0x450c('0x26')]['hasOwnProperty']('nolimit')){_0x127f60[_0x450c('0x13')]=qs[_0x450c('0x13')](_0x43ac15[_0x450c('0x26')][_0x450c('0x13')]);_0x127f60['offset']=qs[_0x450c('0x12')](_0x43ac15[_0x450c('0x26')][_0x450c('0x12')]);}_0x127f60['order']=qs[_0x450c('0x2d')](_0x43ac15[_0x450c('0x26')][_0x450c('0x2d')]);_0x127f60[_0x450c('0x2e')]=qs['filters'](_[_0x450c('0x30')](_0x43ac15[_0x450c('0x26')],_0x21e2f5['filters']));_0x127f60[_0x450c('0x2e')]['ContactId']=_0x88c942['id'];if(_0x43ac15[_0x450c('0x26')][_0x450c('0x56')]){_0x127f60[_0x450c('0x2e')]=_[_0x450c('0x6e')](_0x127f60[_0x450c('0x2e')],{'$or':_[_0x450c('0x43')](_0x127f60['attributes'],function(_0x7b4818){var _0x20ee71={};_0x20ee71[_0x7b4818]={'$like':'%'+_0x43ac15[_0x450c('0x26')]['filter']+'%'};return _0x20ee71;})});}_0x127f60=_[_0x450c('0x6e')]({},_0x127f60,_0x43ac15[_0x450c('0xb7')]);return db[_0x450c('0x98')]['count']({'where':_0x127f60['where']})[_0x450c('0x17')](function(_0x54892b){_0x40164d[_0x450c('0x11')]=_0x54892b;if(_0x43ac15[_0x450c('0x26')][_0x450c('0xb4')]){_0x127f60[_0x450c('0xb5')]=[{'all':!![]}];}return db[_0x450c('0x98')][_0x450c('0x80')](_0x127f60);})['then'](function(_0xd03adb){_0x40164d[_0x450c('0x7a')]=_0xd03adb;return _0x40164d;});}})[_0x450c('0x17')](respondWithFilteredResult(_0x1c10b6,_0x127f60))[_0x450c('0x7b')](handleError(_0x1c10b6,null));};exports[_0x450c('0xb8')]=function(_0x509276,_0x152a0a){var _0x216d59={'raw':!![],'where':{}};var _0x3d4517={};var _0xcbf690={'count':0x0,'rows':[]};return db[_0x450c('0x6f')][_0x450c('0x21')]({'where':{'id':_0x509276[_0x450c('0x7c')]['id']}})['then'](handleEntityNotFound(_0x152a0a,null))[_0x450c('0x17')](function(_0x430d07){if(_0x430d07){_0x3d4517['model']=_['keys'](db['CmHopperFinal'][_0x450c('0xad')]);_0x3d4517[_0x450c('0x26')]=_['keys'](_0x509276[_0x450c('0x26')]);_0x3d4517['filters']=_[_0x450c('0x29')](_0x3d4517['model'],_0x3d4517['query']);_0x216d59[_0x450c('0x28')]=_[_0x450c('0x29')](_0x3d4517[_0x450c('0x27')],qs[_0x450c('0x2a')](_0x509276['query'][_0x450c('0x2a')]));_0x216d59[_0x450c('0x28')]=_0x216d59[_0x450c('0x28')][_0x450c('0x1e')]?_0x216d59[_0x450c('0x28')]:_0x3d4517[_0x450c('0x27')];if(!_0x509276[_0x450c('0x26')][_0x450c('0x2b')](_0x450c('0xae'))){_0x216d59['limit']=qs[_0x450c('0x13')](_0x509276[_0x450c('0x26')][_0x450c('0x13')]);_0x216d59['offset']=qs[_0x450c('0x12')](_0x509276[_0x450c('0x26')][_0x450c('0x12')]);}_0x216d59['order']=qs['sort'](_0x509276['query'][_0x450c('0x2d')]);_0x216d59[_0x450c('0x2e')]=qs[_0x450c('0x2f')](_[_0x450c('0x30')](_0x509276[_0x450c('0x26')],_0x3d4517[_0x450c('0x2f')]));_0x216d59[_0x450c('0x2e')]['ContactId']=_0x430d07['id'];if(_0x509276['query'][_0x450c('0x56')]){_0x216d59[_0x450c('0x2e')]=_[_0x450c('0x6e')](_0x216d59[_0x450c('0x2e')],{'$or':_[_0x450c('0x43')](_0x216d59[_0x450c('0x28')],function(_0x37e2d2){var _0x58dab8={};_0x58dab8[_0x37e2d2]={'$like':'%'+_0x509276[_0x450c('0x26')][_0x450c('0x56')]+'%'};return _0x58dab8;})});}_0x216d59=_[_0x450c('0x6e')]({},_0x216d59,_0x509276[_0x450c('0xb7')]);return db[_0x450c('0x97')]['count']({'where':_0x216d59['where']})['then'](function(_0x1d9ab1){_0xcbf690[_0x450c('0x11')]=_0x1d9ab1;if(_0x509276['query'][_0x450c('0xb4')]){_0x216d59['include']=[{'all':!![]}];}return db[_0x450c('0x97')][_0x450c('0x80')](_0x216d59);})['then'](function(_0x4bdb72){_0xcbf690[_0x450c('0x7a')]=_0x4bdb72;return _0xcbf690;});}})['then'](respondWithFilteredResult(_0x152a0a,_0x216d59))['catch'](handleError(_0x152a0a,null));};exports[_0x450c('0xb9')]=function(_0x3664f6,_0x493f8b){var _0x15726d={'raw':!![],'where':{}};var _0x58fc65={};var _0x1e5667={'count':0x0,'rows':[]};return db['CmContact'][_0x450c('0x21')]({'where':{'id':_0x3664f6[_0x450c('0x7c')]['id']}})[_0x450c('0x17')](handleEntityNotFound(_0x493f8b,null))[_0x450c('0x17')](function(_0x9adcec){if(_0x9adcec){_0x58fc65['model']=_['keys'](db['JscriptySessionReport'][_0x450c('0xad')]);_0x58fc65['query']=_[_0x450c('0x25')](_0x3664f6[_0x450c('0x26')]);_0x58fc65[_0x450c('0x2f')]=_[_0x450c('0x29')](_0x58fc65[_0x450c('0x27')],_0x58fc65['query']);_0x15726d[_0x450c('0x28')]=_[_0x450c('0x29')](_0x58fc65['model'],qs[_0x450c('0x2a')](_0x3664f6['query'][_0x450c('0x2a')]));_0x15726d[_0x450c('0x28')]=_0x15726d[_0x450c('0x28')][_0x450c('0x1e')]?_0x15726d[_0x450c('0x28')]:_0x58fc65[_0x450c('0x27')];if(!_0x3664f6[_0x450c('0x26')]['hasOwnProperty']('nolimit')){_0x15726d[_0x450c('0x13')]=qs['limit'](_0x3664f6[_0x450c('0x26')]['limit']);_0x15726d['offset']=qs[_0x450c('0x12')](_0x3664f6[_0x450c('0x26')][_0x450c('0x12')]);}_0x15726d['order']=qs[_0x450c('0x2d')](_0x3664f6['query'][_0x450c('0x2d')]);_0x15726d[_0x450c('0x2e')]=qs[_0x450c('0x2f')](_[_0x450c('0x30')](_0x3664f6[_0x450c('0x26')],_0x58fc65[_0x450c('0x2f')]));_0x15726d[_0x450c('0x2e')][_0x450c('0xba')]=_0x9adcec['id'];if(_0x3664f6[_0x450c('0x26')][_0x450c('0x56')]){_0x15726d[_0x450c('0x2e')]=_[_0x450c('0x6e')](_0x15726d['where'],{'$or':_[_0x450c('0x43')](_0x15726d['attributes'],function(_0x49f49f){var _0x3ca2b7={};_0x3ca2b7[_0x49f49f]={'$like':'%'+_0x3664f6['query'][_0x450c('0x56')]+'%'};return _0x3ca2b7;})});}_0x15726d=_[_0x450c('0x6e')]({},_0x15726d,_0x3664f6[_0x450c('0xb7')]);return db['JscriptySessionReport'][_0x450c('0x11')]({'where':_0x15726d['where']})[_0x450c('0x17')](function(_0x2499ea){_0x1e5667[_0x450c('0x11')]=_0x2499ea;if(_0x3664f6['query']['includeAll']){_0x15726d[_0x450c('0xb5')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x15726d);})[_0x450c('0x17')](function(_0x17b185){_0x1e5667[_0x450c('0x7a')]=_0x17b185;return _0x1e5667;});}})[_0x450c('0x17')](respondWithFilteredResult(_0x493f8b,_0x15726d))['catch'](handleError(_0x493f8b,null));};exports['uploadCsv']=function(_0x1778ca,_0x5eb0d0){try{if(!_0x1778ca[_0x450c('0x85')][_0x450c('0x52')]){throw new Error(_0x450c('0xbb'));}if(!_0x1778ca[_0x450c('0x85')][_0x450c('0xbc')]){throw new Error(_0x450c('0xbd'));}if(!_0x1778ca[_0x450c('0x85')][_0x450c('0xbe')]){throw new Error(_0x450c('0xbf'));}if(!_0x1778ca[_0x450c('0x85')][_0x450c('0xc0')]){throw new Error(_0x450c('0xc1'));}var _0x6aae18=_0x1778ca[_0x450c('0x85')][_0x450c('0xbc')][_0x450c('0x42')](',');var _0x5d347a=_0x1778ca[_0x450c('0x85')]['binding_values'][_0x450c('0x42')](',');if(!_0x6aae18[_0x450c('0x1e')]||!_0x5d347a[_0x450c('0x1e')]||_0x6aae18[_0x450c('0x1e')]!==_0x5d347a[_0x450c('0x1e')]){throw new Error(_0x450c('0xc2'));}_0x1778ca[_0x450c('0x85')][_0x450c('0x2a')]=_['zipObject'](_0x6aae18,_0x5d347a);if(!_0x1778ca[_0x450c('0x85')]['fields'][_0x450c('0xac')]){throw new Error(_0x450c('0xc3'));}if(!_0x1778ca['body']['fields'][_0x450c('0xc4')]){throw new Error(_0x450c('0xc5'));}var _0x21d5fc=path[_0x450c('0x88')](config[_0x450c('0xc6')],_0x450c('0xc7'),_0x1778ca['file'][_0x450c('0xc8')]);fs[_0x450c('0xc9')](_0x21d5fc,parseInt(_0x450c('0xca'),0x8));var _0xe4754b=require(_0x450c('0xcb'))[_0x450c('0xcc')](path[_0x450c('0x88')](__dirname,_0x450c('0xcd')),[_0x21d5fc,_0x1778ca['body'][_0x450c('0xbc')],_0x1778ca[_0x450c('0x85')][_0x450c('0xbe')],_0x1778ca[_0x450c('0x85')][_0x450c('0x52')],_0x1778ca['body']['CompanyId'],_0x1778ca[_0x450c('0x85')][_0x450c('0xa2')],_0x1778ca['body']['socket_timestamp']]);return _0x5eb0d0[_0x450c('0xf')](0xc8)[_0x450c('0x16')]({'message':_0x450c('0xce'),'pid':_0xe4754b['pid']});}catch(_0x2272e4){return _0x5eb0d0[_0x450c('0xf')](0x1f4)[_0x450c('0x1c')](_0x2272e4);}};exports[_0x450c('0xcf')]=function(_0x2c6439,_0x3de7ed){var _0x48d355=fs[_0x450c('0xd0')](_0x2c6439[_0x450c('0xd1')][_0x450c('0x2')]);Papa[_0x450c('0xd2')](_0x48d355,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x418c5f){return _0x3de7ed[_0x450c('0xf')](0xc8)[_0x450c('0x16')]({'file':_0x2c6439[_0x450c('0xd1')],'fields':_0x418c5f['meta'][_0x450c('0x2a')]});}});};exports[_0x450c('0xd3')]=function(_0x5eeb64,_0x5e5c6e){return db[_0x450c('0x47')][_0x450c('0x80')]({'raw':!![],'attributes':['id'],'where':{'role':_0x450c('0x66')}})['then'](function(_0x2a6fea){var _0x4fe18b=![];if(!_0x5eeb64['body']['ListId']){throw new Error(_0x450c('0xbb'));}if(!_0x5eeb64[_0x450c('0x85')][_0x450c('0xd4')][_0x450c('0xac')]){throw new Error(_0x450c('0xc3'));}if(!_0x5eeb64['body'][_0x450c('0xd4')][_0x450c('0xc4')]){throw new Error(_0x450c('0xc5'));}if(!_0x5eeb64[_0x450c('0x85')][_0x450c('0xc0')]){throw new Error(_0x450c('0xc1'));}var _0xdf68f0=require(_0x450c('0xcb'))[_0x450c('0xcc')](path[_0x450c('0x88')](__dirname,_0x450c('0xd5')),[_0x5eeb64[_0x450c('0x7c')]['id'],JSON[_0x450c('0xd6')](_0x5eeb64[_0x450c('0x85')]),JSON[_0x450c('0xd6')](_0x2a6fea)]);_0xdf68f0['on'](_0x450c('0xd7'),function(){_0x4fe18b=!![];return _0x5e5c6e[_0x450c('0xf')](0xc8)[_0x450c('0x16')]({'message':_0x450c('0xd8'),'pid':_0xdf68f0[_0x450c('0xd9')]});});_0xdf68f0['on'](_0x450c('0xda'),function(_0x767906){if(_0x767906&&!_0x4fe18b){return _0x5e5c6e[_0x450c('0xf')](0x1f4)[_0x450c('0x16')]({'message':_0x450c('0xdb'),'pid':_0xdf68f0['pid']});}});})[_0x450c('0x7b')](handleError(_0x5e5c6e,null));};exports['getJourney']=function(_0x5444b2,_0x31c494){var _0x11ba4e=[_0x450c('0xdc'),'chat',_0x450c('0xdd'),'openchannel','fax',_0x450c('0xde'),'voice'];var _0x5e0593={'offset':0x0,'order':qs['sort']('-createdAt')},_0x245afd={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x5444b2[_0x450c('0x26')]['channel']){if(!_[_0x450c('0xdf')](_0x11ba4e,_0x5444b2[_0x450c('0x26')]['channel'][_0x450c('0xe0')]())){throw new Error(_0x450c('0xe1'));}_0x11ba4e=[_0x5444b2[_0x450c('0x26')][_0x450c('0xe2')][_0x450c('0xe0')]()];}if(_0x5444b2[_0x450c('0x26')][_0x450c('0xe3')]){try{var _0x26a120=JSON[_0x450c('0xd2')](_0x5444b2['query'][_0x450c('0xe3')]);if(!moment(_0x26a120['from'])[_0x450c('0xe4')]()){throw new Error(_0x450c('0xe5'));}if(!moment(_0x26a120['to'])[_0x450c('0xe4')]()){throw new Error(_0x450c('0xe6'));}}catch(_0x1817d9){throw new Error(_0x450c('0xe7'));}}if(!_0x5444b2[_0x450c('0x26')][_0x450c('0x2b')](_0x450c('0xae'))){_0x5e0593[_0x450c('0x13')]=qs[_0x450c('0x13')](_0x5444b2[_0x450c('0x26')]['limit']||0xa);_0x5e0593[_0x450c('0x12')]=qs[_0x450c('0x12')](_0x5444b2[_0x450c('0x26')][_0x450c('0x12')]);}var _0x1f3da8=_0x11ba4e[_0x450c('0x43')](function(_0x2b93f5){if(_0x2b93f5===_0x450c('0xe8')){var _0x2d6d08={'attributes':['id',_0x450c('0xe9'),_0x450c('0x24'),_0x450c('0xea'),'destination',_0x450c('0xeb'),_0x450c('0xec'),_0x450c('0xed'),_0x450c('0xee'),_0x450c('0xef'),_0x450c('0xf0'),_0x450c('0xf1'),'userSecondDisposition',_0x450c('0xf2'),_0x450c('0xf3')],'where':{'ContactId':_0x5444b2[_0x450c('0x7c')]['id']},'include':[{'model':db[_0x450c('0x47')],'as':_0x450c('0x47'),'attributes':['id',_0x450c('0x1b'),_0x450c('0xf4'),_0x450c('0x81')]}],'order':[[_0x450c('0xf0'),_0x450c('0x63')]]};if(_0x5444b2[_0x450c('0x26')]['range']){_0x2d6d08['where'][_0x450c('0xf0')]={'$gte':_0x26a120['from'],'$lte':_0x26a120['to']};}return db['VoiceCallReport'][_0x450c('0xf5')](_0x2d6d08)[_0x450c('0x17')](function(_0x4722d9){_0x245afd['count']+=_0x4722d9[_0x450c('0x11')];return _[_0x450c('0x43')](_0x4722d9[_0x450c('0x7a')],function(_0x3d0ffb){var _0x295c1c=_0x3d0ffb[_0x450c('0x86')]({'plain':!![]});_0x295c1c[_0x450c('0xe2')]=_0x2b93f5;if(_0x295c1c['User']){_0x295c1c[_0x450c('0x47')]={'id':_0x295c1c[_0x450c('0x47')]['id'],'name':_0x295c1c['User'][_0x450c('0x1b')],'fullname':_0x295c1c[_0x450c('0x47')]['fullname'],'alias':_0x295c1c['User'][_0x450c('0x81')]};}return _0x295c1c;});});}else{var _0x1544d3=_[_0x450c('0xf6')](_0x2b93f5)+(_0x2b93f5===_0x450c('0xf7')?_0x450c('0xf8'):'Account');var _0x4fe540={'attributes':['id',_0x450c('0xf9'),'closedAt',_0x450c('0xf0'),'note',_0x450c('0xfa'),'secondDisposition',_0x450c('0xfb'),_0x450c('0xf3'),_0x1544d3+'Id'],'where':{'ContactId':_0x5444b2['params']['id']},'include':[{'model':db[_0x1544d3],'as':_0x450c('0xfc'),'attributes':['id',_0x450c('0x1b'),'key']},{'model':db[_0x450c('0x47')],'as':'Owner','attributes':['id','name',_0x450c('0xf4')]},{'model':db[_0x450c('0x40')],'as':_0x450c('0x79'),'attributes':['id','name',_0x450c('0x33')],'through':{'attributes':[]}}],'order':[[_0x450c('0xf0'),_0x450c('0x63')]]};if(_0x5444b2['query'][_0x450c('0xe3')]){_0x4fe540['where']['createdAt']={'$gte':_0x26a120[_0x450c('0x34')],'$lte':_0x26a120['to']};}switch(_0x2b93f5){case _0x450c('0xf7'):_0x4fe540[_0x450c('0x28')][_0x450c('0x20')]('browserName',_0x450c('0xfd'),_0x450c('0xfe'),_0x450c('0xff'),_0x450c('0x100'),'ratingMessage',_0x450c('0x101'),_0x450c('0x102'),_0x450c('0x103'));break;case'mail':_0x4fe540[_0x450c('0x28')][_0x450c('0x20')](_0x450c('0x104'),_0x450c('0x105'));break;case _0x450c('0x106'):_0x4fe540[_0x450c('0x28')][_0x450c('0x20')]('externalUrl',_0x450c('0x107'));break;}return db[_['startCase'](_0x2b93f5)+_0x450c('0x108')]['findAndCountAll'](_0x4fe540)[_0x450c('0x17')](function(_0x226e85){_0x245afd['count']+=_0x226e85[_0x450c('0x11')];return _[_0x450c('0x43')](_0x226e85[_0x450c('0x7a')],function(_0x1fea66){var _0x25db2c=_0x1fea66[_0x450c('0x86')]({'plain':!![]});_0x25db2c[_0x450c('0xe2')]=_0x2b93f5;if(_0x25db2c[_0x450c('0x109')]){_0x25db2c[_0x450c('0x109')]={'id':_0x25db2c[_0x450c('0x109')]['id'],'name':_0x25db2c[_0x450c('0x109')][_0x450c('0x1b')],'fullname':_0x25db2c['Owner'][_0x450c('0xf4')]};}return _0x25db2c;});});}});return Promise[_0x450c('0x10a')](_0x1f3da8);})[_0x450c('0x17')](function(_0xf9df8c){return _(_0xf9df8c)[_0x450c('0x10b')]()[_0x450c('0x10c')](_0x450c('0xf0'))[_0x450c('0x10d')]()[_0x450c('0x41')]();})[_0x450c('0x17')](function(_0x11f636){_0x245afd[_0x450c('0x7a')]=_0x5e0593['limit']?_0x11f636[_0x450c('0x10e')](_0x5e0593['offset'],_0x5e0593[_0x450c('0x12')]+_0x5e0593[_0x450c('0x13')]):_0x11f636;return _0x245afd;})[_0x450c('0x17')](respondWithFilteredResult(_0x31c494,_0x5e0593))[_0x450c('0x7b')](handleError(_0x31c494,null));};
\ No newline at end of file
index 65989f9..3a0d16f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xada1=['emit','hasOwnProperty','exports','CmContact','setMaxListeners','save','update','remove'];(function(_0x4849dd,_0x4b67cd){var _0x2ffbbc=function(_0xbbc47a){while(--_0xbbc47a){_0x4849dd['push'](_0x4849dd['shift']());}};_0x2ffbbc(++_0x4b67cd);}(_0xada1,0x183));var _0x1ada=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xada1[_0x45783c];return _0x1161da;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db'][_0x1ada('0x0')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x1ada('0x1')](0x0);var events={'afterCreate':_0x1ada('0x2'),'afterUpdate':_0x1ada('0x3'),'afterDestroy':_0x1ada('0x4')};function emitEvent(_0xd9efdb){return function(_0x19de54,_0x285bb1,_0x5d1e26){CmContactEvents['emit'](_0xd9efdb+':'+_0x19de54['id'],_0x19de54);CmContactEvents[_0x1ada('0x5')](_0xd9efdb,_0x19de54);_0x5d1e26(null);};}for(var e in events){if(events[_0x1ada('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x1ada('0x7')]=CmContactEvents;
\ No newline at end of file
+var _0x5a22=['../../mysqldb','CmContact','setMaxListeners','save','emit','hasOwnProperty','events'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x5a22,0x1b8));var _0x25a2=function(_0x295621,_0x4286b8){_0x295621=_0x295621-0x0;var _0x36d0dd=_0x5a22[_0x295621];return _0x36d0dd;};'use strict';var EventEmitter=require(_0x25a2('0x0'));var CmContact=require(_0x25a2('0x1'))['db'][_0x25a2('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x25a2('0x3')](0x0);var events={'afterCreate':_0x25a2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f8123){return function(_0x3fd5bb,_0x114bc4,_0x15e3ca){CmContactEvents[_0x25a2('0x5')](_0x1f8123+':'+_0x3fd5bb['id'],_0x3fd5bb);CmContactEvents[_0x25a2('0x5')](_0x1f8123,_0x3fd5bb);_0x15e3ca(null);};}for(var e in events){if(events[_0x25a2('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
index d7e10b9..ca596c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f3=['FULLTEXT','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','findOne','then','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','isNil','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','dialCheckDuplicateType','Lists','length','always','onlyIfOpen','VoiceQueue','findAll','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','inspect','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','mobile','fax','email'];(function(_0x562e73,_0x34d4d8){var _0x24cd7b=function(_0x3b13d6){while(--_0x3b13d6){_0x562e73['push'](_0x562e73['shift']());}};_0x24cd7b(++_0x34d4d8);}(_0x04f3,0xb8));var _0x304f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x04f3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x304f('0x0'));var util=require(_0x304f('0x1'));var logger=require(_0x304f('0x2'))('api');var moment=require(_0x304f('0x3'));var BPromise=require(_0x304f('0x4'));var rp=require(_0x304f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x304f('0x6'));var attributes=require(_0x304f('0x7'));module[_0x304f('0x8')]=function(_0x18ae35,_0x1f4a3a){return _0x18ae35[_0x304f('0x9')](_0x304f('0xa'),attributes,{'tableName':_0x304f('0xb'),'paranoid':!![],'indexes':[{'name':_0x304f('0xc'),'fields':[_0x304f('0xc')]},{'name':_0x304f('0xd'),'fields':['firstName','lastName','phone',_0x304f('0xe'),_0x304f('0xf'),_0x304f('0x10')],'type':_0x304f('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x304f('0x12'),'hooks':{'afterCreate':function(_0x5e34c4,_0x1da979,_0x4a888c){var _0x47d9a2=_0x18ae35['models'];var _0x2359f1=_0x5e34c4[_0x304f('0x13')]({'plain':!![]});function _0x27a8c3(){return function(_0x25ba0){logger[_0x304f('0x14')](_0x304f('0x15'),_0x304f('0x16'),util['inspect'](_0x25ba0,{'showHidden':![],'depth':null}));};}var _0x2e640d=function(_0x2084b3){return new BPromise(function(_0x4b77e9,_0x46573c){_0x47d9a2['CmHopper'][_0x304f('0x17')]({'where':{'phone':_0x2359f1[_0x304f('0xc')],'VoiceQueueId':_0x2084b3['id']}})[_0x304f('0x18')](function(_0x373ead){if(!_['isNil'](_0x373ead)){throw new Error(_0x304f('0x19')+_0x2359f1[_0x304f('0xc')]+_0x304f('0x1a')+_0x2084b3['id']);}return _0x47d9a2[_0x304f('0x1b')][_0x304f('0x1c')]({'phone':_0x2359f1[_0x304f('0xc')],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1[_0x304f('0x1d')],'priority':_0x2359f1[_0x304f('0x1e')]?_0x2359f1[_0x304f('0x1e')]:0x2,'scheduledat':_0x2359f1[_0x304f('0x1f')]?_0x2359f1['scheduledat']:moment()[_0x304f('0x20')](_0x304f('0x21')),'callback':_0x2359f1['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2359f1['callbackUniqueid']?_0x2359f1[_0x304f('0x22')]:undefined,'callbackat':_0x2359f1[_0x304f('0x22')]?moment()[_0x304f('0x20')](_0x304f('0x21')):undefined,'VoiceQueueId':_0x2084b3['id']});})[_0x304f('0x23')](function(_0x4dc200){_0x46573c(_0x4dc200);});});};var _0x31a7f1=function(_0x5886d2){return new BPromise(function(_0x32c6dd,_0x132add){_0x47d9a2[_0x304f('0x1b')][_0x304f('0x17')]({'where':{'phone':_0x2359f1['phone'],'VoiceQueueId':_0x5886d2['id']}})['then'](function(_0x1bc84b){if(!_[_0x304f('0x24')](_0x1bc84b)){throw new Error(_0x304f('0x19')+_0x2359f1['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5886d2['id']);}return _0x47d9a2[_0x304f('0x25')]['findOne']({'where':{'calleridnum':_0x2359f1[_0x304f('0xc')],'VoiceQueueId':_0x5886d2['id']}});})['then'](function(_0x5733f9){if(!_[_0x304f('0x24')](_0x5733f9)){throw new Error(_0x304f('0x26')+_0x2359f1[_0x304f('0xc')]+_0x304f('0x27')+_0x5886d2['id']);}return _0x47d9a2[_0x304f('0x1b')]['create']({'phone':_0x2359f1[_0x304f('0xc')],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1[_0x304f('0x1d')],'priority':_0x2359f1['priority']?_0x2359f1[_0x304f('0x1e')]:0x2,'scheduledat':_0x2359f1['scheduledat']?_0x2359f1[_0x304f('0x1f')]:moment()[_0x304f('0x20')](_0x304f('0x21')),'callback':_0x2359f1['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2359f1[_0x304f('0x22')]?_0x2359f1[_0x304f('0x22')]:undefined,'callbackat':_0x2359f1[_0x304f('0x22')]?moment()['format'](_0x304f('0x21')):undefined,'VoiceQueueId':_0x5886d2['id']});})['catch'](function(_0x43bbda){_0x132add(_0x43bbda);});});};function _0x4e31d5(){return function(_0x2fec74){logger[_0x304f('0x14')](_0x304f('0x15'),_0x304f('0x16'),util['inspect'](_0x2fec74,{'showHidden':![],'depth':null}));};}var _0x49f75b=function(_0x41192c){return new BPromise(function(_0x7eaccf,_0x3a24b9){_0x47d9a2['CmHopper']['findOne']({'where':{'phone':_0x2359f1[_0x304f('0xc')],'CampaignId':_0x41192c['id']}})[_0x304f('0x18')](function(_0x3f57c4){if(!_[_0x304f('0x24')](_0x3f57c4)){throw new Error(_0x304f('0x19')+_0x2359f1['phone']+_0x304f('0x28')+_0x41192c['id']);}return _0x47d9a2[_0x304f('0x1b')][_0x304f('0x1c')]({'phone':_0x2359f1[_0x304f('0xc')],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1[_0x304f('0x1d')],'priority':_0x2359f1[_0x304f('0x1e')]?_0x2359f1[_0x304f('0x1e')]:0x2,'scheduledat':_0x2359f1['scheduledat']?_0x2359f1[_0x304f('0x1f')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2359f1[_0x304f('0x22')]?!![]:![],'callbackuniqueid':_0x2359f1[_0x304f('0x22')]?_0x2359f1['callbackUniqueid']:undefined,'callbackat':_0x2359f1[_0x304f('0x22')]?moment()[_0x304f('0x20')](_0x304f('0x21')):undefined,'CampaignId':_0x41192c['id']});})[_0x304f('0x23')](function(_0xc34dbb){_0x3a24b9(_0xc34dbb);});});};var _0x246dfc=function(_0x34fdc0){return new BPromise(function(_0x9d13bc,_0xcb073b){_0x47d9a2[_0x304f('0x1b')][_0x304f('0x17')]({'where':{'phone':_0x2359f1[_0x304f('0xc')],'CampaignId':_0x34fdc0['id']}})[_0x304f('0x18')](function(_0x152814){if(!_[_0x304f('0x24')](_0x152814)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2359f1['phone']+_0x304f('0x29')+_0x34fdc0['id']);}return _0x47d9a2[_0x304f('0x25')][_0x304f('0x17')]({'where':{'calleridnum':_0x2359f1['phone'],'CampaignId':_0x34fdc0['id']}});})[_0x304f('0x18')](function(_0x1f7131){if(!_[_0x304f('0x24')](_0x1f7131)){throw new Error(_0x304f('0x26')+_0x2359f1['phone']+_0x304f('0x2a')+_0x34fdc0['id']);}return _0x47d9a2[_0x304f('0x1b')][_0x304f('0x1c')]({'phone':_0x2359f1[_0x304f('0xc')],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1[_0x304f('0x1d')],'priority':_0x2359f1[_0x304f('0x1e')]?_0x2359f1[_0x304f('0x1e')]:0x2,'scheduledat':_0x2359f1['scheduledat']?_0x2359f1[_0x304f('0x1f')]:moment()[_0x304f('0x20')](_0x304f('0x21')),'callback':_0x2359f1[_0x304f('0x22')]?!![]:![],'callbackuniqueid':_0x2359f1[_0x304f('0x22')]?_0x2359f1['callbackUniqueid']:undefined,'callbackat':_0x2359f1[_0x304f('0x22')]?moment()[_0x304f('0x20')](_0x304f('0x21')):undefined,'CampaignId':_0x34fdc0['id']});})['catch'](function(_0x1236a3){_0xcb073b(_0x1236a3);});});};if(_0x2359f1[_0x304f('0x1d')]){_0x47d9a2['VoiceQueue']['findAll']({'where':{'type':_0x304f('0x2b')},'attributes':['id',_0x304f('0x2c')],'include':[{'model':_0x47d9a2['CmList'],'as':_0x304f('0x2d'),'where':{'id':_0x2359f1[_0x304f('0x1d')]}}]})[_0x304f('0x18')](function(_0x21d99f){if(_0x21d99f){var _0x407476=[];for(var _0x26e599=0x0,_0x24ed6a;_0x26e599<_0x21d99f[_0x304f('0x2e')];_0x26e599+=0x1){_0x24ed6a=_0x21d99f[_0x26e599][_0x304f('0x13')]({'plain':!![]});switch(_0x24ed6a[_0x304f('0x2c')]){case _0x304f('0x2f'):_0x31a7f1(_0x24ed6a)[_0x304f('0x23')](_0x27a8c3());break;case _0x304f('0x30'):_0x2e640d(_0x24ed6a)['catch'](_0x27a8c3());break;default:_0x47d9a2[_0x304f('0x1b')][_0x304f('0x1c')]({'phone':_0x2359f1[_0x304f('0xc')],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1['ListId'],'scheduledat':_0x2359f1[_0x304f('0x1f')]?_0x2359f1['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2359f1[_0x304f('0x1e')]?_0x2359f1[_0x304f('0x1e')]:0x2,'callback':_0x2359f1[_0x304f('0x22')]?!![]:![],'callbackuniqueid':_0x2359f1['callbackUniqueid']?_0x2359f1[_0x304f('0x22')]:undefined,'callbackat':_0x2359f1[_0x304f('0x22')]?moment()[_0x304f('0x20')](_0x304f('0x21')):undefined,'VoiceQueueId':_0x24ed6a['id']})[_0x304f('0x23')](_0x27a8c3());}}}})[_0x304f('0x18')](function(){return _0x47d9a2[_0x304f('0x31')][_0x304f('0x32')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x47d9a2['CmList'],'as':_0x304f('0x33'),'where':{'id':_0x2359f1[_0x304f('0x1d')]}}]})[_0x304f('0x18')](function(_0x28d5d6){if(_0x28d5d6){var _0x44a3a0=[];for(var _0x277831=0x0,_0x3e93d4;_0x277831<_0x28d5d6[_0x304f('0x2e')];_0x277831+=0x1){_0x3e93d4=_0x28d5d6[_0x277831]['get']({'plain':!![]});_0x47d9a2[_0x304f('0x34')][_0x304f('0x1c')]({'phone':_0x2359f1[_0x304f('0xc')],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1[_0x304f('0x1d')],'VoiceQueueId':_0x3e93d4['id']})[_0x304f('0x23')](function(_0x9efac4){logger[_0x304f('0x14')](_0x304f('0x35'),_0x304f('0x16'),_0x9efac4[_0x304f('0x36')]);});}}});})[_0x304f('0x18')](function(){return _0x47d9a2['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x47d9a2['CmList'],'as':_0x304f('0x2d'),'where':{'id':_0x2359f1[_0x304f('0x1d')]}}]})[_0x304f('0x18')](function(_0x2e37b0){if(_0x2e37b0){var _0xa6bd3a=[];for(var _0x194503=0x0,_0x3f9632;_0x194503<_0x2e37b0[_0x304f('0x2e')];_0x194503+=0x1){_0x3f9632=_0x2e37b0[_0x194503][_0x304f('0x13')]({'plain':!![]});switch(_0x3f9632[_0x304f('0x2c')]){case _0x304f('0x2f'):_0x246dfc(_0x3f9632)[_0x304f('0x23')](_0x4e31d5());break;case'onlyIfOpen':_0x49f75b(_0x3f9632)['catch'](_0x4e31d5());break;default:_0x47d9a2['CmHopper'][_0x304f('0x1c')]({'phone':_0x2359f1['phone'],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1[_0x304f('0x1d')],'scheduledat':_0x2359f1['scheduledat']?_0x2359f1[_0x304f('0x1f')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2359f1[_0x304f('0x1e')]?_0x2359f1['priority']:0x2,'callback':_0x2359f1[_0x304f('0x22')]?!![]:![],'callbackuniqueid':_0x2359f1[_0x304f('0x22')]?_0x2359f1[_0x304f('0x22')]:undefined,'callbackat':_0x2359f1[_0x304f('0x22')]?moment()[_0x304f('0x20')](_0x304f('0x21')):undefined,'CampaignId':_0x3f9632['id']})[_0x304f('0x23')](_0x4e31d5());}}}});})[_0x304f('0x18')](function(){return _0x47d9a2[_0x304f('0x37')][_0x304f('0x32')]({'attributes':['id'],'include':[{'model':_0x47d9a2['CmList'],'as':_0x304f('0x33'),'where':{'id':_0x2359f1[_0x304f('0x1d')]}}]})[_0x304f('0x18')](function(_0x5849b3){if(_0x5849b3){var _0x43b2e4=[];for(var _0x458ecb=0x0,_0x388e8e;_0x458ecb<_0x5849b3[_0x304f('0x2e')];_0x458ecb+=0x1){_0x388e8e=_0x5849b3[_0x458ecb][_0x304f('0x13')]({'plain':!![]});_0x47d9a2['CmHopperBlack'][_0x304f('0x1c')]({'phone':_0x2359f1[_0x304f('0xc')],'ContactId':_0x2359f1['id'],'ListId':_0x2359f1['ListId'],'CampaignId':_0x388e8e['id']})['catch'](function(_0x52b7de){logger[_0x304f('0x14')](_0x304f('0x35'),_0x304f('0x16'),_0x52b7de['message']);});}}});})[_0x304f('0x18')](function(){_0x4a888c();})[_0x304f('0x23')](function(_0x3f5cbe){logger['error'](_0x304f('0x35'),_0x304f('0x16'),_0x3f5cbe[_0x304f('0x36')]);_0x4a888c(_0x3f5cbe);});}else{_0x4a888c(new Error(_0x304f('0x38')));}},'afterDestroy':function(_0x17c3c8,_0x19019a,_0x422d69){var _0x46fe0e=_0x18ae35[_0x304f('0x39')];var _0x5cce87=_0x17c3c8['get']({'plain':!![]});return _0x46fe0e['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x5cce87['ListId'],'ContactId':_0x5cce87['id']}})[_0x304f('0x18')](function(_0x16694c){if(!_[_0x304f('0x3a')](_0x16694c)){var _0x3842a9=[];for(var _0x7a9416=0x0;_0x7a9416<_0x16694c['length'];_0x7a9416+=0x1){var _0x48fa26=_0x46fe0e[_0x304f('0x1b')][_0x304f('0x3b')]({'where':{'ListId':_0x16694c[_0x7a9416][_0x304f('0x1d')],'ContactId':_0x16694c[_0x7a9416][_0x304f('0x3c')],'VoiceQueueId':_0x16694c[_0x7a9416][_0x304f('0x3d')],'CampaignId':_0x16694c[_0x7a9416][_0x304f('0x3e')]}});_0x3842a9[_0x304f('0x3f')](_0x48fa26);}return BPromise['all'](_0x3842a9);}})[_0x304f('0x18')](function(_0x5856cd){logger[_0x304f('0x40')]('[CmContact][afterDestroy][Succesfull]',util[_0x304f('0x41')](_0x5856cd,{'showHidden':![],'depth':null}));_0x422d69();})[_0x304f('0x23')](function(_0x2ce86e){logger[_0x304f('0x14')](_0x304f('0x42'),util['inspect'](_0x2ce86e,{'showHidden':![],'depth':null}));_0x422d69(_0x2ce86e);});}}});};
\ No newline at end of file
+var _0x9b94=['create','ListId','inspect','findOne','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','length','get','onlyIfOpen','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','Lists','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','email','FULLTEXT','utf8mb4_unicode_ci','error','cmContact','afterCreate','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','priority','scheduledat','format','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'];(function(_0x170a9f,_0x5ecb4a){var _0x9be5af=function(_0x28c2d6){while(--_0x28c2d6){_0x170a9f['push'](_0x170a9f['shift']());}};_0x9be5af(++_0x5ecb4a);}(_0x9b94,0x135));var _0x49b9=function(_0x3ea86b,_0x2b1e3a){_0x3ea86b=_0x3ea86b-0x0;var _0x41379a=_0x9b94[_0x3ea86b];return _0x41379a;};'use strict';var _=require(_0x49b9('0x0'));var util=require(_0x49b9('0x1'));var logger=require(_0x49b9('0x2'))(_0x49b9('0x3'));var moment=require('moment');var BPromise=require(_0x49b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49b9('0x5'));var rimraf=require(_0x49b9('0x6'));var config=require(_0x49b9('0x7'));var attributes=require(_0x49b9('0x8'));module[_0x49b9('0x9')]=function(_0x5a2b5f,_0x57a20f){return _0x5a2b5f[_0x49b9('0xa')](_0x49b9('0xb'),attributes,{'tableName':_0x49b9('0xc'),'paranoid':!![],'indexes':[{'name':_0x49b9('0xd'),'fields':['phone']},{'name':_0x49b9('0xe'),'fields':[_0x49b9('0xf'),_0x49b9('0x10'),_0x49b9('0xd'),'mobile','fax',_0x49b9('0x11')],'type':_0x49b9('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x49b9('0x13'),'hooks':{'afterCreate':function(_0x5ab9e4,_0x200949,_0xca8f4c){var _0xf18365=_0x5a2b5f['models'];var _0xf81bef=_0x5ab9e4['get']({'plain':!![]});function _0x43f9a0(){return function(_0x13d6de){logger[_0x49b9('0x14')](_0x49b9('0x15'),_0x49b9('0x16'),util['inspect'](_0x13d6de,{'showHidden':![],'depth':null}));};}var _0x14a941=function(_0x542a0e){return new BPromise(function(_0x28228e,_0x4ccd0f){_0xf18365[_0x49b9('0x17')]['findOne']({'where':{'phone':_0xf81bef['phone'],'VoiceQueueId':_0x542a0e['id']}})['then'](function(_0x45d3e2){if(!_['isNil'](_0x45d3e2)){throw new Error(_0x49b9('0x18')+_0xf81bef[_0x49b9('0xd')]+_0x49b9('0x19')+_0x542a0e['id']);}return _0xf18365[_0x49b9('0x17')]['create']({'phone':_0xf81bef['phone'],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef['ListId'],'priority':_0xf81bef['priority']?_0xf81bef[_0x49b9('0x1a')]:0x2,'scheduledat':_0xf81bef[_0x49b9('0x1b')]?_0xf81bef[_0x49b9('0x1b')]:moment()[_0x49b9('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xf81bef['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xf81bef[_0x49b9('0x1d')]?_0xf81bef[_0x49b9('0x1d')]:undefined,'callbackat':_0xf81bef['callbackUniqueid']?moment()[_0x49b9('0x1c')](_0x49b9('0x1e')):undefined,'VoiceQueueId':_0x542a0e['id']});})['catch'](function(_0xeab2ce){_0x4ccd0f(_0xeab2ce);});});};var _0x1b21be=function(_0x2a0d18){return new BPromise(function(_0x47aae4,_0x49ffc6){_0xf18365[_0x49b9('0x17')]['findOne']({'where':{'phone':_0xf81bef['phone'],'VoiceQueueId':_0x2a0d18['id']}})['then'](function(_0xb07ea3){if(!_[_0x49b9('0x1f')](_0xb07ea3)){throw new Error('cmContact,\x20afterCreate\x20'+_0xf81bef[_0x49b9('0xd')]+_0x49b9('0x20')+_0x2a0d18['id']);}return _0xf18365[_0x49b9('0x21')]['findOne']({'where':{'calleridnum':_0xf81bef[_0x49b9('0xd')],'VoiceQueueId':_0x2a0d18['id']}});})['then'](function(_0x2df49f){if(!_[_0x49b9('0x1f')](_0x2df49f)){throw new Error(_0x49b9('0x22')+_0xf81bef[_0x49b9('0xd')]+_0x49b9('0x23')+_0x2a0d18['id']);}return _0xf18365[_0x49b9('0x17')][_0x49b9('0x24')]({'phone':_0xf81bef[_0x49b9('0xd')],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef[_0x49b9('0x25')],'priority':_0xf81bef[_0x49b9('0x1a')]?_0xf81bef[_0x49b9('0x1a')]:0x2,'scheduledat':_0xf81bef[_0x49b9('0x1b')]?_0xf81bef[_0x49b9('0x1b')]:moment()[_0x49b9('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xf81bef[_0x49b9('0x1d')]?!![]:![],'callbackuniqueid':_0xf81bef['callbackUniqueid']?_0xf81bef[_0x49b9('0x1d')]:undefined,'callbackat':_0xf81bef[_0x49b9('0x1d')]?moment()[_0x49b9('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2a0d18['id']});})['catch'](function(_0x3b7b1e){_0x49ffc6(_0x3b7b1e);});});};function _0x3d09b0(){return function(_0x335cf1){logger[_0x49b9('0x14')]('cmContact',_0x49b9('0x16'),util[_0x49b9('0x26')](_0x335cf1,{'showHidden':![],'depth':null}));};}var _0x319b58=function(_0x46d12d){return new BPromise(function(_0x208669,_0x4579fa){_0xf18365[_0x49b9('0x17')][_0x49b9('0x27')]({'where':{'phone':_0xf81bef[_0x49b9('0xd')],'CampaignId':_0x46d12d['id']}})[_0x49b9('0x28')](function(_0x5466f7){if(!_['isNil'](_0x5466f7)){throw new Error(_0x49b9('0x18')+_0xf81bef[_0x49b9('0xd')]+_0x49b9('0x29')+_0x46d12d['id']);}return _0xf18365[_0x49b9('0x17')]['create']({'phone':_0xf81bef['phone'],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef['ListId'],'priority':_0xf81bef['priority']?_0xf81bef[_0x49b9('0x1a')]:0x2,'scheduledat':_0xf81bef[_0x49b9('0x1b')]?_0xf81bef[_0x49b9('0x1b')]:moment()[_0x49b9('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xf81bef['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xf81bef[_0x49b9('0x1d')]?_0xf81bef['callbackUniqueid']:undefined,'callbackat':_0xf81bef[_0x49b9('0x1d')]?moment()[_0x49b9('0x1c')](_0x49b9('0x1e')):undefined,'CampaignId':_0x46d12d['id']});})[_0x49b9('0x2a')](function(_0xbd09a){_0x4579fa(_0xbd09a);});});};var _0xdcc4a7=function(_0x20d758){return new BPromise(function(_0x572e5c,_0x6bcb0){_0xf18365[_0x49b9('0x17')]['findOne']({'where':{'phone':_0xf81bef[_0x49b9('0xd')],'CampaignId':_0x20d758['id']}})[_0x49b9('0x28')](function(_0x59a310){if(!_['isNil'](_0x59a310)){throw new Error(_0x49b9('0x18')+_0xf81bef['phone']+_0x49b9('0x2b')+_0x20d758['id']);}return _0xf18365[_0x49b9('0x21')][_0x49b9('0x27')]({'where':{'calleridnum':_0xf81bef[_0x49b9('0xd')],'CampaignId':_0x20d758['id']}});})[_0x49b9('0x28')](function(_0x225c0b){if(!_[_0x49b9('0x1f')](_0x225c0b)){throw new Error('cmContact,\x20afterCreate,\x20'+_0xf81bef[_0x49b9('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x20d758['id']);}return _0xf18365[_0x49b9('0x17')][_0x49b9('0x24')]({'phone':_0xf81bef[_0x49b9('0xd')],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef[_0x49b9('0x25')],'priority':_0xf81bef['priority']?_0xf81bef[_0x49b9('0x1a')]:0x2,'scheduledat':_0xf81bef[_0x49b9('0x1b')]?_0xf81bef['scheduledat']:moment()[_0x49b9('0x1c')](_0x49b9('0x1e')),'callback':_0xf81bef[_0x49b9('0x1d')]?!![]:![],'callbackuniqueid':_0xf81bef[_0x49b9('0x1d')]?_0xf81bef[_0x49b9('0x1d')]:undefined,'callbackat':_0xf81bef[_0x49b9('0x1d')]?moment()['format'](_0x49b9('0x1e')):undefined,'CampaignId':_0x20d758['id']});})[_0x49b9('0x2a')](function(_0x284a4d){_0x6bcb0(_0x284a4d);});});};if(_0xf81bef[_0x49b9('0x25')]){_0xf18365[_0x49b9('0x2c')][_0x49b9('0x2d')]({'where':{'type':'outbound'},'attributes':['id',_0x49b9('0x2e')],'include':[{'model':_0xf18365[_0x49b9('0x2f')],'as':'Lists','where':{'id':_0xf81bef[_0x49b9('0x25')]}}]})[_0x49b9('0x28')](function(_0x4f3be7){if(_0x4f3be7){var _0x352d3c=[];for(var _0x26713f=0x0,_0x381b49;_0x26713f<_0x4f3be7[_0x49b9('0x30')];_0x26713f+=0x1){_0x381b49=_0x4f3be7[_0x26713f][_0x49b9('0x31')]({'plain':!![]});switch(_0x381b49[_0x49b9('0x2e')]){case'always':_0x1b21be(_0x381b49)[_0x49b9('0x2a')](_0x43f9a0());break;case _0x49b9('0x32'):_0x14a941(_0x381b49)['catch'](_0x43f9a0());break;default:_0xf18365[_0x49b9('0x17')][_0x49b9('0x24')]({'phone':_0xf81bef['phone'],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef[_0x49b9('0x25')],'scheduledat':_0xf81bef[_0x49b9('0x1b')]?_0xf81bef[_0x49b9('0x1b')]:moment()[_0x49b9('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0xf81bef['priority']?_0xf81bef['priority']:0x2,'callback':_0xf81bef[_0x49b9('0x1d')]?!![]:![],'callbackuniqueid':_0xf81bef['callbackUniqueid']?_0xf81bef[_0x49b9('0x1d')]:undefined,'callbackat':_0xf81bef[_0x49b9('0x1d')]?moment()[_0x49b9('0x1c')](_0x49b9('0x1e')):undefined,'VoiceQueueId':_0x381b49['id']})[_0x49b9('0x2a')](_0x43f9a0());}}}})[_0x49b9('0x28')](function(){return _0xf18365[_0x49b9('0x2c')][_0x49b9('0x2d')]({'where':{'type':_0x49b9('0x33')},'attributes':['id'],'include':[{'model':_0xf18365['CmList'],'as':_0x49b9('0x34'),'where':{'id':_0xf81bef[_0x49b9('0x25')]}}]})['then'](function(_0x466886){if(_0x466886){var _0x216092=[];for(var _0x1d6fd1=0x0,_0x1639c6;_0x1d6fd1<_0x466886[_0x49b9('0x30')];_0x1d6fd1+=0x1){_0x1639c6=_0x466886[_0x1d6fd1]['get']({'plain':!![]});_0xf18365[_0x49b9('0x35')][_0x49b9('0x24')]({'phone':_0xf81bef[_0x49b9('0xd')],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef[_0x49b9('0x25')],'VoiceQueueId':_0x1639c6['id']})['catch'](function(_0x16e13b){logger[_0x49b9('0x14')](_0x49b9('0x36'),_0x49b9('0x16'),_0x16e13b[_0x49b9('0x37')]);});}}});})[_0x49b9('0x28')](function(){return _0xf18365[_0x49b9('0x38')][_0x49b9('0x2d')]({'attributes':['id',_0x49b9('0x2e')],'include':[{'model':_0xf18365[_0x49b9('0x2f')],'as':_0x49b9('0x39'),'where':{'id':_0xf81bef['ListId']}}]})[_0x49b9('0x28')](function(_0x84dcdd){if(_0x84dcdd){var _0x2f7d73=[];for(var _0x204c21=0x0,_0x39353e;_0x204c21<_0x84dcdd[_0x49b9('0x30')];_0x204c21+=0x1){_0x39353e=_0x84dcdd[_0x204c21]['get']({'plain':!![]});switch(_0x39353e[_0x49b9('0x2e')]){case'always':_0xdcc4a7(_0x39353e)['catch'](_0x3d09b0());break;case _0x49b9('0x32'):_0x319b58(_0x39353e)[_0x49b9('0x2a')](_0x3d09b0());break;default:_0xf18365[_0x49b9('0x17')][_0x49b9('0x24')]({'phone':_0xf81bef[_0x49b9('0xd')],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef['ListId'],'scheduledat':_0xf81bef['scheduledat']?_0xf81bef['scheduledat']:moment()[_0x49b9('0x1c')](_0x49b9('0x1e')),'priority':_0xf81bef[_0x49b9('0x1a')]?_0xf81bef[_0x49b9('0x1a')]:0x2,'callback':_0xf81bef[_0x49b9('0x1d')]?!![]:![],'callbackuniqueid':_0xf81bef[_0x49b9('0x1d')]?_0xf81bef[_0x49b9('0x1d')]:undefined,'callbackat':_0xf81bef[_0x49b9('0x1d')]?moment()[_0x49b9('0x1c')](_0x49b9('0x1e')):undefined,'CampaignId':_0x39353e['id']})[_0x49b9('0x2a')](_0x3d09b0());}}}});})['then'](function(){return _0xf18365[_0x49b9('0x38')]['findAll']({'attributes':['id'],'include':[{'model':_0xf18365[_0x49b9('0x2f')],'as':'BlackLists','where':{'id':_0xf81bef[_0x49b9('0x25')]}}]})[_0x49b9('0x28')](function(_0x42c581){if(_0x42c581){var _0x36ebb9=[];for(var _0x39721c=0x0,_0x31080c;_0x39721c<_0x42c581[_0x49b9('0x30')];_0x39721c+=0x1){_0x31080c=_0x42c581[_0x39721c][_0x49b9('0x31')]({'plain':!![]});_0xf18365['CmHopperBlack'][_0x49b9('0x24')]({'phone':_0xf81bef[_0x49b9('0xd')],'ContactId':_0xf81bef['id'],'ListId':_0xf81bef[_0x49b9('0x25')],'CampaignId':_0x31080c['id']})[_0x49b9('0x2a')](function(_0x24027b){logger[_0x49b9('0x14')](_0x49b9('0x36'),'afterCreate',_0x24027b['message']);});}}});})[_0x49b9('0x28')](function(){_0xca8f4c();})[_0x49b9('0x2a')](function(_0x18b6d4){logger[_0x49b9('0x14')]('cmContact,\x20%s,\x20%s','afterCreate',_0x18b6d4['message']);_0xca8f4c(_0x18b6d4);});}else{_0xca8f4c(new Error(_0x49b9('0x3a')));}},'afterDestroy':function(_0x497295,_0x4807c0,_0x29a369){var _0xe01129=_0x5a2b5f[_0x49b9('0x3b')];var _0x2eb551=_0x497295[_0x49b9('0x31')]({'plain':!![]});return _0xe01129[_0x49b9('0x17')]['findAll']({'raw':!![],'where':{'ListId':_0x2eb551[_0x49b9('0x25')],'ContactId':_0x2eb551['id']}})[_0x49b9('0x28')](function(_0x23b7ef){if(!_[_0x49b9('0x3c')](_0x23b7ef)){var _0x323892=[];for(var _0x55c4=0x0;_0x55c4<_0x23b7ef[_0x49b9('0x30')];_0x55c4+=0x1){var _0x33e3fa=_0xe01129['CmHopper'][_0x49b9('0x3d')]({'where':{'ListId':_0x23b7ef[_0x55c4][_0x49b9('0x25')],'ContactId':_0x23b7ef[_0x55c4][_0x49b9('0x3e')],'VoiceQueueId':_0x23b7ef[_0x55c4][_0x49b9('0x3f')],'CampaignId':_0x23b7ef[_0x55c4]['CampaignId']}});_0x323892[_0x49b9('0x40')](_0x33e3fa);}return BPromise[_0x49b9('0x41')](_0x323892);}})['then'](function(_0x55a165){logger[_0x49b9('0x42')](_0x49b9('0x43'),util[_0x49b9('0x26')](_0x55a165,{'showHidden':![],'depth':null}));_0x29a369();})[_0x49b9('0x2a')](function(_0x337c2c){logger[_0x49b9('0x14')](_0x49b9('0x44'),util[_0x49b9('0x26')](_0x337c2c,{'showHidden':![],'depth':null}));_0x29a369(_0x337c2c);});}}});};
\ No newline at end of file
index 1a91414..861aeed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a4e=['raw','where','attributes','limit','include','model','map','create','body','keys','length','startsWith','cf_','update','cm_contacts','set','id\x20=\x20?','toString','query','CreateCmContact','debug','lodash','util','randomstring','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmContact','CmContact','findAll','options'];(function(_0x15db07,_0x512b73){var _0x183d94=function(_0x51503b){while(--_0x51503b){_0x15db07['push'](_0x15db07['shift']());}};_0x183d94(++_0x512b73);}(_0x5a4e,0x119));var _0xe5a4=function(_0x473b41,_0x1c320f){_0x473b41=_0x473b41-0x0;var _0x4e521d=_0x5a4e[_0x473b41];return _0x4e521d;};'use strict';var _=require(_0xe5a4('0x0'));var util=require(_0xe5a4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe5a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0xe5a4('0x3'));var db=require(_0xe5a4('0x4'))['db'];var utils=require(_0xe5a4('0x5'));var logger=require(_0xe5a4('0x6'))(_0xe5a4('0x7'));var config=require(_0xe5a4('0x8'));var jayson=require(_0xe5a4('0x9'));var client=jayson[_0xe5a4('0xa')][_0xe5a4('0xb')]({'port':0x232a});config[_0xe5a4('0xc')]=_[_0xe5a4('0xd')](config[_0xe5a4('0xc')],{'host':_0xe5a4('0xe'),'port':0x18eb});var socket=require(_0xe5a4('0xf'))(new Redis(config[_0xe5a4('0xc')]));require('./cmContact.socket')[_0xe5a4('0x10')](socket);function respondWithRpcPromise(_0x2a8a8b,_0x1ebbe0,_0x3e9f5f){return new BPromise(function(_0x5d7441,_0x19bf72){return client[_0xe5a4('0x11')](_0x2a8a8b,_0x3e9f5f)[_0xe5a4('0x12')](function(_0x129267){logger[_0xe5a4('0x13')](_0xe5a4('0x14'),_0x1ebbe0,'request\x20sent');logger['debug']('CmContact,\x20%s,\x20%s,\x20%s',_0x1ebbe0,_0xe5a4('0x15'),JSON[_0xe5a4('0x16')](_0x129267));if(_0x129267[_0xe5a4('0x17')]){if(_0x129267[_0xe5a4('0x17')][_0xe5a4('0x18')]===0x1f4){logger[_0xe5a4('0x17')]('CmContact,\x20%s,\x20%s',_0x1ebbe0,_0x129267[_0xe5a4('0x17')][_0xe5a4('0x19')]);return _0x19bf72(_0x129267[_0xe5a4('0x17')]['message']);}logger['error'](_0xe5a4('0x14'),_0x1ebbe0,_0x129267[_0xe5a4('0x17')][_0xe5a4('0x19')]);return _0x5d7441(_0x129267[_0xe5a4('0x17')]['message']);}else{logger[_0xe5a4('0x13')](_0xe5a4('0x14'),_0x1ebbe0,_0xe5a4('0x15'));_0x5d7441(_0x129267['result'][_0xe5a4('0x19')]);}})[_0xe5a4('0x1a')](function(_0x41e88e){logger[_0xe5a4('0x17')](_0xe5a4('0x14'),_0x1ebbe0,_0x41e88e);_0x19bf72(_0x41e88e);});});}exports[_0xe5a4('0x1b')]=function(_0x4f17d1){var _0x4937e1=this;return new Promise(function(_0x1ff7f4,_0x194d85){return db[_0xe5a4('0x1c')][_0xe5a4('0x1d')]({'raw':_0x4f17d1['options']?_0x4f17d1[_0xe5a4('0x1e')][_0xe5a4('0x1f')]===undefined?!![]:![]:!![],'where':_0x4f17d1[_0xe5a4('0x1e')]?_0x4f17d1['options'][_0xe5a4('0x20')]||null:null,'attributes':_0x4f17d1[_0xe5a4('0x1e')]?_0x4f17d1[_0xe5a4('0x1e')][_0xe5a4('0x21')]||null:null,'limit':_0x4f17d1['options']?_0x4f17d1[_0xe5a4('0x1e')][_0xe5a4('0x22')]||null:null,'include':_0x4f17d1[_0xe5a4('0x1e')]?_0x4f17d1['options']['include']?_['map'](_0x4f17d1[_0xe5a4('0x1e')][_0xe5a4('0x23')],function(_0x2b5cd6){return{'model':db[_0x2b5cd6[_0xe5a4('0x24')]],'as':_0x2b5cd6['as'],'attributes':_0x2b5cd6[_0xe5a4('0x21')],'include':_0x2b5cd6[_0xe5a4('0x23')]?_['map'](_0x2b5cd6['include'],function(_0x368bb6){return{'model':db[_0x368bb6[_0xe5a4('0x24')]],'as':_0x368bb6['as'],'attributes':_0x368bb6['attributes'],'include':_0x368bb6[_0xe5a4('0x23')]?_[_0xe5a4('0x25')](_0x368bb6[_0xe5a4('0x23')],function(_0x4b771d){return{'model':db[_0x4b771d['model']],'as':_0x4b771d['as'],'attributes':_0x4b771d[_0xe5a4('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26b745){logger[_0xe5a4('0x13')]('GetCmContact',_0x4f17d1);logger['debug'](_0xe5a4('0x1b'),_0x4f17d1,JSON[_0xe5a4('0x16')](_0x26b745));_0x1ff7f4(_0x26b745);})[_0xe5a4('0x1a')](function(_0x5eeeb6){logger['error'](_0xe5a4('0x1b'),_0x5eeeb6[_0xe5a4('0x19')],_0x4f17d1);_0x194d85(_0x4937e1[_0xe5a4('0x17')](0x1f4,_0x5eeeb6[_0xe5a4('0x19')]));});});};exports['CreateCmContact']=function(_0x463e82){var _0x4de821=this;return new Promise(function(_0x2ae281,_0x2318eb){return db[_0xe5a4('0x1c')][_0xe5a4('0x26')](_0x463e82[_0xe5a4('0x27')],{'raw':_0x463e82[_0xe5a4('0x1e')]?_0x463e82[_0xe5a4('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3ac292){var _0x8aa2ab;for(var _0x96112=0x0;_0x96112<Object[_0xe5a4('0x28')](_0x463e82['body'])[_0xe5a4('0x29')];_0x96112++){var _0xa935b0=Object[_0xe5a4('0x28')](_0x463e82[_0xe5a4('0x27')])[_0x96112];if(_0xa935b0[_0xe5a4('0x2a')](_0xe5a4('0x2b'))){_0x8aa2ab=squel[_0xe5a4('0x2c')]()['table'](_0xe5a4('0x2d'))[_0xe5a4('0x2e')](_0xa935b0,_0x463e82[_0xe5a4('0x27')][_0xa935b0])[_0xe5a4('0x20')](_0xe5a4('0x2f'),_0x3ac292['id'])[_0xe5a4('0x30')]();break;}}if(!_0x8aa2ab)return _0x3ac292;return db['sequelize'][_0xe5a4('0x31')](_0x8aa2ab)[_0xe5a4('0x12')](function(){return _0x3ac292;});})['then'](function(_0x29b18e){logger[_0xe5a4('0x13')](_0xe5a4('0x32'),_0x463e82);logger[_0xe5a4('0x33')](_0xe5a4('0x32'),_0x463e82,JSON[_0xe5a4('0x16')](_0x29b18e));_0x2ae281(_0x29b18e);})[_0xe5a4('0x1a')](function(_0x119d9c){logger['error']('CreateCmContact',_0x119d9c[_0xe5a4('0x19')],_0x463e82);_0x2318eb(_0x4de821[_0xe5a4('0x17')](0x1f4,_0x119d9c[_0xe5a4('0x19')]));});});};
\ No newline at end of file
+var _0xaf8a=['http','redis','defaults','socket.io-emitter','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CmContact','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCmContact','catch','CreateCmContact','create','length','keys','body','startsWith','cf_','update','table','cm_contacts','id\x20=\x20?','toString','sequelize','query','util','moment','bluebird','randomstring','squel','../../config/utils','../../config/logger','rpc','client'];(function(_0x334e06,_0x284d46){var _0x467725=function(_0x562ec8){while(--_0x562ec8){_0x334e06['push'](_0x334e06['shift']());}};_0x467725(++_0x284d46);}(_0xaf8a,0x129));var _0xaaf8=function(_0x50ffe8,_0x32af51){_0x50ffe8=_0x50ffe8-0x0;var _0x505733=_0xaf8a[_0x50ffe8];return _0x505733;};'use strict';var _=require('lodash');var util=require(_0xaaf8('0x0'));var moment=require(_0xaaf8('0x1'));var BPromise=require(_0xaaf8('0x2'));var rs=require(_0xaaf8('0x3'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0xaaf8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaaf8('0x5'));var logger=require(_0xaaf8('0x6'))(_0xaaf8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaaf8('0x8')][_0xaaf8('0x9')]({'port':0x232a});config[_0xaaf8('0xa')]=_[_0xaaf8('0xb')](config[_0xaaf8('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaaf8('0xc'))(new Redis(config[_0xaaf8('0xa')]));require(_0xaaf8('0xd'))[_0xaaf8('0xe')](socket);function respondWithRpcPromise(_0x4c5b03,_0x2273d4,_0x4613c7){return new BPromise(function(_0x17e604,_0x26bedc){return client['request'](_0x4c5b03,_0x4613c7)['then'](function(_0x3b97bd){logger[_0xaaf8('0xf')](_0xaaf8('0x10'),_0x2273d4,_0xaaf8('0x11'));logger[_0xaaf8('0x12')]('CmContact,\x20%s,\x20%s,\x20%s',_0x2273d4,_0xaaf8('0x11'),JSON[_0xaaf8('0x13')](_0x3b97bd));if(_0x3b97bd[_0xaaf8('0x14')]){if(_0x3b97bd[_0xaaf8('0x14')][_0xaaf8('0x15')]===0x1f4){logger[_0xaaf8('0x14')](_0xaaf8('0x10'),_0x2273d4,_0x3b97bd['error']['message']);return _0x26bedc(_0x3b97bd['error'][_0xaaf8('0x16')]);}logger[_0xaaf8('0x14')]('CmContact,\x20%s,\x20%s',_0x2273d4,_0x3b97bd['error'][_0xaaf8('0x16')]);return _0x17e604(_0x3b97bd['error'][_0xaaf8('0x16')]);}else{logger[_0xaaf8('0xf')]('CmContact,\x20%s,\x20%s',_0x2273d4,_0xaaf8('0x11'));_0x17e604(_0x3b97bd[_0xaaf8('0x17')][_0xaaf8('0x16')]);}})['catch'](function(_0x4381f9){logger[_0xaaf8('0x14')](_0xaaf8('0x10'),_0x2273d4,_0x4381f9);_0x26bedc(_0x4381f9);});});}exports['GetCmContact']=function(_0x215c4b){var _0x72fd77=this;return new Promise(function(_0x470f6a,_0x19344a){return db[_0xaaf8('0x18')][_0xaaf8('0x19')]({'raw':_0x215c4b['options']?_0x215c4b[_0xaaf8('0x1a')][_0xaaf8('0x1b')]===undefined?!![]:![]:!![],'where':_0x215c4b[_0xaaf8('0x1a')]?_0x215c4b[_0xaaf8('0x1a')][_0xaaf8('0x1c')]||null:null,'attributes':_0x215c4b[_0xaaf8('0x1a')]?_0x215c4b['options'][_0xaaf8('0x1d')]||null:null,'limit':_0x215c4b[_0xaaf8('0x1a')]?_0x215c4b[_0xaaf8('0x1a')][_0xaaf8('0x1e')]||null:null,'include':_0x215c4b['options']?_0x215c4b[_0xaaf8('0x1a')][_0xaaf8('0x1f')]?_[_0xaaf8('0x20')](_0x215c4b[_0xaaf8('0x1a')][_0xaaf8('0x1f')],function(_0x29a196){return{'model':db[_0x29a196[_0xaaf8('0x21')]],'as':_0x29a196['as'],'attributes':_0x29a196['attributes'],'include':_0x29a196[_0xaaf8('0x1f')]?_[_0xaaf8('0x20')](_0x29a196[_0xaaf8('0x1f')],function(_0x8fdf1a){return{'model':db[_0x8fdf1a[_0xaaf8('0x21')]],'as':_0x8fdf1a['as'],'attributes':_0x8fdf1a[_0xaaf8('0x1d')],'include':_0x8fdf1a[_0xaaf8('0x1f')]?_['map'](_0x8fdf1a[_0xaaf8('0x1f')],function(_0x5abf51){return{'model':db[_0x5abf51[_0xaaf8('0x21')]],'as':_0x5abf51['as'],'attributes':_0x5abf51['attributes']};}):[]};}):[]};}):[]:[]})[_0xaaf8('0x22')](function(_0x4dbb35){logger[_0xaaf8('0xf')](_0xaaf8('0x23'),_0x215c4b);logger[_0xaaf8('0x12')](_0xaaf8('0x23'),_0x215c4b,JSON[_0xaaf8('0x13')](_0x4dbb35));_0x470f6a(_0x4dbb35);})[_0xaaf8('0x24')](function(_0x2c28a3){logger['error'](_0xaaf8('0x23'),_0x2c28a3[_0xaaf8('0x16')],_0x215c4b);_0x19344a(_0x72fd77[_0xaaf8('0x14')](0x1f4,_0x2c28a3['message']));});});};exports[_0xaaf8('0x25')]=function(_0x913dea){var _0x1c32b9=this;return new Promise(function(_0x111df0,_0x4680c5){return db[_0xaaf8('0x18')][_0xaaf8('0x26')](_0x913dea['body'],{'raw':_0x913dea[_0xaaf8('0x1a')]?_0x913dea[_0xaaf8('0x1a')][_0xaaf8('0x1b')]===undefined?!![]:![]:!![]})[_0xaaf8('0x22')](function(_0x15b7fa){var _0x76a464;for(var _0x6c5ce0=0x0;_0x6c5ce0<Object['keys'](_0x913dea['body'])[_0xaaf8('0x27')];_0x6c5ce0++){var _0x21b6b2=Object[_0xaaf8('0x28')](_0x913dea[_0xaaf8('0x29')])[_0x6c5ce0];if(_0x21b6b2[_0xaaf8('0x2a')](_0xaaf8('0x2b'))){_0x76a464=squel[_0xaaf8('0x2c')]()[_0xaaf8('0x2d')](_0xaaf8('0x2e'))['set'](_0x21b6b2,_0x913dea[_0xaaf8('0x29')][_0x21b6b2])[_0xaaf8('0x1c')](_0xaaf8('0x2f'),_0x15b7fa['id'])[_0xaaf8('0x30')]();break;}}if(!_0x76a464)return _0x15b7fa;return db[_0xaaf8('0x31')][_0xaaf8('0x32')](_0x76a464)[_0xaaf8('0x22')](function(){return _0x15b7fa;});})['then'](function(_0x5602e8){logger[_0xaaf8('0xf')]('CreateCmContact',_0x913dea);logger[_0xaaf8('0x12')](_0xaaf8('0x25'),_0x913dea,JSON[_0xaaf8('0x13')](_0x5602e8));_0x111df0(_0x5602e8);})['catch'](function(_0x40eda7){logger['error'](_0xaaf8('0x25'),_0x40eda7[_0xaaf8('0x16')],_0x913dea);_0x4680c5(_0x1c32b9[_0xaaf8('0x14')](0x1f4,_0x40eda7['message']));});});};
\ No newline at end of file
index 9bfa652..e7805f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 16fd903..c04d5ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74b2=['../../config/environment','./cmContact.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/tags','getTags','getHoppers','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','create','post','/create_many','bulkCreate','setTags','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','server/files/tmp','/upload','upload','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x74b2,0x1c7));var _0x274b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74b2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x274b('0x0'));var util=require(_0x274b('0x1'));var path=require(_0x274b('0x2'));var timeout=require(_0x274b('0x3'));var express=require(_0x274b('0x4'));var router=express[_0x274b('0x5')]();var fs_extra=require(_0x274b('0x6'));var auth=require(_0x274b('0x7'));var interaction=require(_0x274b('0x8'));var config=require(_0x274b('0x9'));var controller=require(_0x274b('0xa'));router['get']('/',auth[_0x274b('0xb')](),controller[_0x274b('0xc')]);router[_0x274b('0xd')](_0x274b('0xe'),auth[_0x274b('0xb')](),controller[_0x274b('0xf')]);router['get'](_0x274b('0x10'),auth[_0x274b('0xb')](),controller[_0x274b('0x11')]);router['get'](_0x274b('0x12'),auth[_0x274b('0xb')](),controller[_0x274b('0x13')]);router[_0x274b('0xd')]('/:id/hoppers',auth[_0x274b('0xb')](),controller[_0x274b('0x14')]);router[_0x274b('0xd')]('/:id/hopper_histories',auth[_0x274b('0xb')](),controller[_0x274b('0x15')]);router[_0x274b('0xd')]('/:id/hopper_finals',auth[_0x274b('0xb')](),controller[_0x274b('0x16')]);router[_0x274b('0xd')](_0x274b('0x17'),auth[_0x274b('0xb')](),controller[_0x274b('0x18')]);router[_0x274b('0xd')](_0x274b('0x19'),auth[_0x274b('0xb')](),controller[_0x274b('0x1a')]);router['post'](_0x274b('0x1b'),auth['isAuthenticated'](),controller[_0x274b('0x1c')]);router['post']('/',auth[_0x274b('0xb')](),controller[_0x274b('0x1d')]);router[_0x274b('0x1e')](_0x274b('0x1f'),auth['isAuthenticated'](),controller[_0x274b('0x20')]);router[_0x274b('0x1e')]('/:id/tags',auth[_0x274b('0xb')](),controller[_0x274b('0x21')]);var upload=multer({'storage':multer[_0x274b('0x22')]({'destination':function(_0x141480,_0x4e82e,_0x24c1dc){_0x24c1dc(null,path[_0x274b('0x23')](config[_0x274b('0x24')],'server/files/tmp'));},'filename':function(_0x34f860,_0x204725,_0x52365a){_0x204725[_0x274b('0x25')]=_0x204725['originalname'][_0x274b('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52365a(null,util[_0x274b('0x27')](_0x274b('0x28'),path[_0x274b('0x29')](_0x204725[_0x274b('0x25')],path[_0x274b('0x2a')](_0x204725['originalname'])),Date[_0x274b('0x2b')](),path[_0x274b('0x2a')](_0x204725[_0x274b('0x25')])));}})});router['post'](_0x274b('0x2c'),upload[_0x274b('0x2d')](_0x274b('0x2e')),controller[_0x274b('0x2f')]);var upload=multer({'storage':multer[_0x274b('0x22')]({'destination':function(_0x1eaf12,_0x44eb41,_0x325926){_0x325926(null,path[_0x274b('0x23')](config[_0x274b('0x24')],_0x274b('0x30')));},'filename':function(_0xdab003,_0x3dac4d,_0x9adb1d){_0x3dac4d[_0x274b('0x25')]=_0x3dac4d[_0x274b('0x25')][_0x274b('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9adb1d(null,util[_0x274b('0x27')](_0x274b('0x28'),path[_0x274b('0x29')](_0x3dac4d[_0x274b('0x25')],path['extname'](_0x3dac4d[_0x274b('0x25')])),Date['now'](),path[_0x274b('0x2a')](_0x3dac4d[_0x274b('0x25')])));}})});router[_0x274b('0x1e')](_0x274b('0x31'),upload[_0x274b('0x2d')]('file'),controller[_0x274b('0x32')]);router[_0x274b('0x1e')](_0x274b('0x33'),auth[_0x274b('0xb')](),controller[_0x274b('0x34')]);router[_0x274b('0x35')](_0x274b('0x10'),auth[_0x274b('0xb')](),controller[_0x274b('0x36')]);router[_0x274b('0x37')]('/:id',auth[_0x274b('0xb')](),controller[_0x274b('0x38')]);module[_0x274b('0x39')]=router;
\ No newline at end of file
+var _0x6da6=['/create_many','bulkCreate','/:id/tags','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','root','server/files/tmp','/upload','upload','/upload/:id','import','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getTags','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post'];(function(_0xa3b2fe,_0x2f59e8){var _0x1143ab=function(_0x1dc35a){while(--_0x1dc35a){_0xa3b2fe['push'](_0xa3b2fe['shift']());}};_0x1143ab(++_0x2f59e8);}(_0x6da6,0x14a));var _0x66da=function(_0x4ba35d,_0x4e7589){_0x4ba35d=_0x4ba35d-0x0;var _0x3d823a=_0x6da6[_0x4ba35d];return _0x3d823a;};'use strict';var multer=require(_0x66da('0x0'));var util=require(_0x66da('0x1'));var path=require(_0x66da('0x2'));var timeout=require(_0x66da('0x3'));var express=require(_0x66da('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x66da('0x5'));var interaction=require(_0x66da('0x6'));var config=require(_0x66da('0x7'));var controller=require(_0x66da('0x8'));router[_0x66da('0x9')]('/',auth['isAuthenticated'](),controller[_0x66da('0xa')]);router[_0x66da('0x9')](_0x66da('0xb'),auth[_0x66da('0xc')](),controller[_0x66da('0xd')]);router[_0x66da('0x9')](_0x66da('0xe'),auth['isAuthenticated'](),controller[_0x66da('0xf')]);router[_0x66da('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x66da('0x10')]);router[_0x66da('0x9')]('/:id/hoppers',auth[_0x66da('0xc')](),controller['getHoppers']);router[_0x66da('0x9')]('/:id/hopper_histories',auth[_0x66da('0xc')](),controller[_0x66da('0x11')]);router[_0x66da('0x9')](_0x66da('0x12'),auth['isAuthenticated'](),controller[_0x66da('0x13')]);router[_0x66da('0x9')](_0x66da('0x14'),auth[_0x66da('0xc')](),controller[_0x66da('0x15')]);router[_0x66da('0x9')](_0x66da('0x16'),auth[_0x66da('0xc')](),controller[_0x66da('0x17')]);router['post'](_0x66da('0x18'),auth[_0x66da('0xc')](),controller[_0x66da('0x19')]);router[_0x66da('0x1a')]('/',auth[_0x66da('0xc')](),controller['create']);router[_0x66da('0x1a')](_0x66da('0x1b'),auth[_0x66da('0xc')](),controller[_0x66da('0x1c')]);router[_0x66da('0x1a')](_0x66da('0x1d'),auth[_0x66da('0xc')](),controller['setTags']);var upload=multer({'storage':multer[_0x66da('0x1e')]({'destination':function(_0x49f808,_0xfb401f,_0x3ca9d2){_0x3ca9d2(null,path[_0x66da('0x1f')](config['root'],'server/files/tmp'));},'filename':function(_0x4fdd64,_0x51933f,_0x348f46){_0x51933f[_0x66da('0x20')]=_0x51933f[_0x66da('0x20')][_0x66da('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x348f46(null,util[_0x66da('0x22')](_0x66da('0x23'),path[_0x66da('0x24')](_0x51933f[_0x66da('0x20')],path[_0x66da('0x25')](_0x51933f['originalname'])),Date[_0x66da('0x26')](),path[_0x66da('0x25')](_0x51933f[_0x66da('0x20')])));}})});router[_0x66da('0x1a')](_0x66da('0x27'),upload[_0x66da('0x28')](_0x66da('0x29')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x66da('0x1e')]({'destination':function(_0x17adb1,_0x31a16f,_0x4da07b){_0x4da07b(null,path[_0x66da('0x1f')](config[_0x66da('0x2a')],_0x66da('0x2b')));},'filename':function(_0x124b92,_0x2ca605,_0x779219){_0x2ca605[_0x66da('0x20')]=_0x2ca605[_0x66da('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x779219(null,util[_0x66da('0x22')](_0x66da('0x23'),path[_0x66da('0x24')](_0x2ca605[_0x66da('0x20')],path['extname'](_0x2ca605[_0x66da('0x20')])),Date[_0x66da('0x26')](),path[_0x66da('0x25')](_0x2ca605[_0x66da('0x20')])));}})});router['post'](_0x66da('0x2c'),upload[_0x66da('0x28')](_0x66da('0x29')),controller[_0x66da('0x2d')]);router[_0x66da('0x1a')](_0x66da('0x2e'),auth[_0x66da('0xc')](),controller[_0x66da('0x2f')]);router[_0x66da('0x30')](_0x66da('0xe'),auth[_0x66da('0xc')](),controller[_0x66da('0x31')]);router[_0x66da('0x32')](_0x66da('0xe'),auth[_0x66da('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4728514..97ced72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074c=['STRING','setDataValue','alias','name','TEXT','long','type','parse','values','stringify','BOOLEAN','voice','lodash','exports','VIRTUAL','getDataValue'];(function(_0x27363a,_0x4510e5){var _0x2d2f73=function(_0x628fa7){while(--_0x628fa7){_0x27363a['push'](_0x27363a['shift']());}};_0x2d2f73(++_0x4510e5);}(_0x074c,0x19c));var _0xc074=function(_0x2b7cec,_0x948c5d){_0x2b7cec=_0x2b7cec-0x0;var _0x5c7780=_0x074c[_0x2b7cec];return _0x5c7780;};'use strict';var Sequelize=require('sequelize');var _=require(_0xc074('0x0'));module[_0xc074('0x1')]={'name':{'type':Sequelize[_0xc074('0x2')],'get':function(_0x4600ee){return this[_0xc074('0x3')]('alias');}},'alias':{'type':Sequelize[_0xc074('0x4')],'allowNull':![],'set':function(_0x2f4957){this[_0xc074('0x5')](_0xc074('0x6'),_0x2f4957?_0x2f4957:this[_0xc074('0x3')](_0xc074('0x7')));}},'type':{'type':Sequelize[_0xc074('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xc074('0x8')](_0xc074('0x9')),'get':function(){if(this[_0xc074('0x3')](_0xc074('0xa'))==='select'){return JSON[_0xc074('0xb')](this[_0xc074('0x3')](_0xc074('0xc')));}else{return this[_0xc074('0x3')](_0xc074('0xc'));}},'set':function(_0x1d4270){if(Array['isArray'](_0x1d4270)){this[_0xc074('0x5')](_0xc074('0xc'),JSON[_0xc074('0xd')](_0x1d4270));}else{this[_0xc074('0x5')](_0xc074('0xc'),_0x1d4270);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc074('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xc074('0xf'))}};
\ No newline at end of file
+var _0xb027=['type','select','parse','isArray','setDataValue','values','BOOLEAN','voice','sequelize','VIRTUAL','getDataValue','alias','STRING','name','long'];(function(_0x203e18,_0x308a11){var _0x2cb789=function(_0x38de58){while(--_0x38de58){_0x203e18['push'](_0x203e18['shift']());}};_0x2cb789(++_0x308a11);}(_0xb027,0xda));var _0x7b02=function(_0x44166f,_0x3e71e2){_0x44166f=_0x44166f-0x0;var _0x5f390a=_0xb027[_0x44166f];return _0x5f390a;};'use strict';var Sequelize=require(_0x7b02('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x7b02('0x1')],'get':function(_0x2df088){return this[_0x7b02('0x2')](_0x7b02('0x3'));}},'alias':{'type':Sequelize[_0x7b02('0x4')],'allowNull':![],'set':function(_0x471a36){this['setDataValue']('alias',_0x471a36?_0x471a36:this[_0x7b02('0x2')](_0x7b02('0x5')));}},'type':{'type':Sequelize[_0x7b02('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x7b02('0x6')),'get':function(){if(this[_0x7b02('0x2')](_0x7b02('0x7'))===_0x7b02('0x8')){return JSON[_0x7b02('0x9')](this[_0x7b02('0x2')]('values'));}else{return this[_0x7b02('0x2')]('values');}},'set':function(_0x2495e9){if(Array[_0x7b02('0xa')](_0x2495e9)){this['setDataValue']('values',JSON['stringify'](_0x2495e9));}else{this[_0x7b02('0xb')](_0x7b02('0xc'),_0x2495e9);}}},'required':{'type':Sequelize[_0x7b02('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7b02('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x7b02('0xe'))}};
\ No newline at end of file
index c42f4ef..ee57d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50ec=['sequelize','transaction','text','Sequelize','TEXT','number','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','stack','name','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','length','merge','options','find','body','create'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x50ec,0x1a7));var _0xc50e=function(_0x69135f,_0x266a07){_0x69135f=_0x69135f-0x0;var _0x51f5a9=_0x50ec[_0x69135f];return _0x51f5a9;};'use strict';var emlformat=require(_0xc50e('0x0'));var rimraf=require(_0xc50e('0x1'));var zipdir=require(_0xc50e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc50e('0x3'));var moment=require(_0xc50e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc50e('0x5'));var path=require('path');var sox=require(_0xc50e('0x6'));var csv=require(_0xc50e('0x7'));var ejs=require(_0xc50e('0x8'));var fs=require('fs');var fs_extra=require(_0xc50e('0x9'));var _=require(_0xc50e('0xa'));var squel=require(_0xc50e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc50e('0xc'));var deskjs=require(_0xc50e('0xd'));var toCsv=require(_0xc50e('0x7'));var querystring=require('querystring');var Papa=require(_0xc50e('0xe'));var Redis=require(_0xc50e('0xf'));var authService=require(_0xc50e('0x10'));var qs=require(_0xc50e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc50e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc50e('0x13'));var config=require(_0xc50e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4afb13,_0x5417ed){_0x5417ed=_0x5417ed||0xcc;return function(_0x233759){if(_0x233759){return _0x4afb13['sendStatus'](_0x5417ed);}return _0x4afb13[_0xc50e('0x15')](_0x5417ed)[_0xc50e('0x16')]();};}function respondWithResult(_0x21d5af,_0x10f50d){_0x10f50d=_0x10f50d||0xc8;return function(_0x45e579){if(_0x45e579){return _0x21d5af['status'](_0x10f50d)[_0xc50e('0x17')](_0x45e579);}};}function respondWithFilteredResult(_0x783189,_0x57362f){return function(_0x484df0){if(_0x484df0){var _0x2102d8=typeof _0x57362f[_0xc50e('0x18')]===_0xc50e('0x19')&&typeof _0x57362f[_0xc50e('0x1a')]===_0xc50e('0x19');var _0x53bc64=_0x484df0[_0xc50e('0x1b')];var _0x101456=_0x2102d8?0x0:_0x57362f['offset'];var _0x42574b=_0x2102d8?_0x484df0[_0xc50e('0x1b')]:_0x57362f[_0xc50e('0x18')]+_0x57362f[_0xc50e('0x1a')];var _0x3cb173;if(_0x42574b>=_0x53bc64){_0x42574b=_0x53bc64;_0x3cb173=0xc8;}else{_0x3cb173=0xce;}_0x783189['status'](_0x3cb173);return _0x783189['set'](_0xc50e('0x1c'),_0x101456+'-'+_0x42574b+'/'+_0x53bc64)[_0xc50e('0x17')](_0x484df0);}return null;};}function patchUpdates(_0x181bbf){return function(_0x34a5b9){try{jsonpatch[_0xc50e('0x1d')](_0x34a5b9,_0x181bbf,!![]);}catch(_0x58a9d3){return BPromise[_0xc50e('0x1e')](_0x58a9d3);}return _0x34a5b9['save']();};}function saveUpdates(_0x18f4b6,_0x5931bd){return function(_0x4d6474){if(_0x4d6474){return _0x4d6474[_0xc50e('0x1f')](_0x18f4b6)[_0xc50e('0x20')](function(_0x2fa664){return _0x2fa664;});}return null;};}function removeEntity(_0x75feb7,_0x473b48){return function(_0x1f8a8f){if(_0x1f8a8f){return _0x1f8a8f['destroy']()[_0xc50e('0x20')](function(){_0x75feb7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf752d7,_0x516147){return function(_0x8c0bbd){if(!_0x8c0bbd){_0xf752d7[_0xc50e('0x21')](0x194);}return _0x8c0bbd;};}function handleError(_0x2bebb1,_0x1ed25c){_0x1ed25c=_0x1ed25c||0x1f4;return function(_0x24eb4d){logger['error'](_0x24eb4d[_0xc50e('0x22')]);if(_0x24eb4d[_0xc50e('0x23')]){delete _0x24eb4d[_0xc50e('0x23')];}_0x2bebb1['status'](_0x1ed25c)['send'](_0x24eb4d);};}exports[_0xc50e('0x24')]=function(_0x41ad43,_0x22fbcc){var _0x1dda86={},_0x2e9d28={},_0x8b5d1b={'count':0x0,'rows':[]};var _0x499a2f=_['map'](db[_0xc50e('0x25')][_0xc50e('0x26')],function(_0x2fb1a8){return{'name':_0x2fb1a8[_0xc50e('0x27')],'type':_0x2fb1a8[_0xc50e('0x28')][_0xc50e('0x29')]};});_0x2e9d28[_0xc50e('0x2a')]=_[_0xc50e('0x2b')](_[_0xc50e('0x2c')](_0x499a2f,'name'),['name']);_0x2e9d28[_0xc50e('0x2d')]=_[_0xc50e('0x2e')](_0x41ad43['query']);_0x2e9d28[_0xc50e('0x2f')]=_[_0xc50e('0x30')](_0x2e9d28[_0xc50e('0x2a')],_0x2e9d28[_0xc50e('0x2d')]);_0x1dda86[_0xc50e('0x31')]=_[_0xc50e('0x30')](_0x2e9d28[_0xc50e('0x2a')],qs[_0xc50e('0x32')](_0x41ad43[_0xc50e('0x2d')][_0xc50e('0x32')]));_0x1dda86[_0xc50e('0x31')]=_0x1dda86[_0xc50e('0x31')]['length']?_0x1dda86[_0xc50e('0x31')]:_0x2e9d28[_0xc50e('0x2a')];if(!_0x41ad43['query'][_0xc50e('0x33')](_0xc50e('0x34'))){_0x1dda86[_0xc50e('0x1a')]=qs[_0xc50e('0x1a')](_0x41ad43['query'][_0xc50e('0x1a')]);_0x1dda86[_0xc50e('0x18')]=qs[_0xc50e('0x18')](_0x41ad43['query']['offset']);}_0x1dda86['order']=qs['sort'](_0x41ad43['query']['sort']);_0x1dda86[_0xc50e('0x35')]=qs[_0xc50e('0x2f')](_[_0xc50e('0x36')](_0x41ad43[_0xc50e('0x2d')],_0x2e9d28[_0xc50e('0x2f')]),_0x499a2f);if(_0x41ad43[_0xc50e('0x2d')][_0xc50e('0x37')]){_0x1dda86[_0xc50e('0x35')]=_['merge'](_0x1dda86[_0xc50e('0x35')],{'$or':_[_0xc50e('0x2c')](_0x499a2f,function(_0x509b16){if(_0x509b16[_0xc50e('0x28')]!==_0xc50e('0x38')){var _0x203b65={};_0x203b65[_0x509b16[_0xc50e('0x23')]]={'$like':'%'+_0x41ad43['query'][_0xc50e('0x37')]+'%'};return _0x203b65;}})});}_0x1dda86=_['merge']({},_0x1dda86,_0x41ad43['options']);var _0x1f292b={'where':_0x1dda86['where']};return db['CmCustomField']['count'](_0x1f292b)['then'](function(_0xa74588){_0x8b5d1b['count']=_0xa74588;if(_0x41ad43['query'][_0xc50e('0x39')]){_0x1dda86[_0xc50e('0x3a')]=[{'all':!![]}];}return db[_0xc50e('0x25')][_0xc50e('0x3b')](_0x1dda86);})['then'](function(_0x271b82){_0x8b5d1b['rows']=_0x271b82;return _0x8b5d1b;})[_0xc50e('0x20')](respondWithFilteredResult(_0x22fbcc,_0x1dda86))[_0xc50e('0x3c')](handleError(_0x22fbcc,null));};exports[_0xc50e('0x3d')]=function(_0x2666de,_0x4d19b5){var _0x3a0b52={'raw':!![],'where':{'id':_0x2666de[_0xc50e('0x3e')]['id']}},_0x397145={};_0x397145[_0xc50e('0x2a')]=_[_0xc50e('0x2e')](db['CmCustomField'][_0xc50e('0x26')]);_0x397145[_0xc50e('0x2d')]=_[_0xc50e('0x2e')](_0x2666de[_0xc50e('0x2d')]);_0x397145['filters']=_['intersection'](_0x397145['model'],_0x397145[_0xc50e('0x2d')]);_0x3a0b52['attributes']=_[_0xc50e('0x30')](_0x397145['model'],qs[_0xc50e('0x32')](_0x2666de['query'][_0xc50e('0x32')]));_0x3a0b52[_0xc50e('0x31')]=_0x3a0b52[_0xc50e('0x31')][_0xc50e('0x3f')]?_0x3a0b52['attributes']:_0x397145[_0xc50e('0x2a')];if(_0x2666de[_0xc50e('0x2d')][_0xc50e('0x39')]){_0x3a0b52[_0xc50e('0x3a')]=[{'all':!![]}];}_0x3a0b52=_[_0xc50e('0x40')]({},_0x3a0b52,_0x2666de[_0xc50e('0x41')]);return db['CmCustomField'][_0xc50e('0x42')](_0x3a0b52)[_0xc50e('0x20')](handleEntityNotFound(_0x4d19b5,null))[_0xc50e('0x20')](respondWithResult(_0x4d19b5,null))[_0xc50e('0x3c')](handleError(_0x4d19b5,null));};exports['update']=function(_0x590ca9,_0x3ec981){if(_0x590ca9[_0xc50e('0x43')]['id']){delete _0x590ca9[_0xc50e('0x43')]['id'];}return db['CmCustomField'][_0xc50e('0x42')]({'where':{'id':_0x590ca9['params']['id']}})[_0xc50e('0x20')](handleEntityNotFound(_0x3ec981,null))[_0xc50e('0x20')](saveUpdates(_0x590ca9[_0xc50e('0x43')],null))[_0xc50e('0x20')](respondWithResult(_0x3ec981,null))['catch'](handleError(_0x3ec981,null));};exports['destroy']=function(_0x1bf290,_0x5a8554){return db[_0xc50e('0x25')][_0xc50e('0x42')]({'where':{'id':_0x1bf290['params']['id']}})['then'](handleEntityNotFound(_0x5a8554,null))[_0xc50e('0x20')](removeEntity(_0x5a8554,null))[_0xc50e('0x3c')](handleError(_0x5a8554,null));};exports[_0xc50e('0x44')]=function(_0x3dde55,_0x5c22ba){var _0x93237a;return db[_0xc50e('0x45')][_0xc50e('0x46')](function(_0x42fa1f){return db[_0xc50e('0x25')][_0xc50e('0x44')](_0x3dde55[_0xc50e('0x43')],{'transaction':_0x42fa1f})[_0xc50e('0x20')](function(_0x1fbcdb){_0x93237a=_0x1fbcdb;var _0x5f517f={'type':db['Sequelize']['TEXT'],'transaction':_0x42fa1f};switch(_0x3dde55[_0xc50e('0x43')][_0xc50e('0x28')]){case _0xc50e('0x47'):_0x5f517f[_0xc50e('0x28')]=db[_0xc50e('0x48')][_0xc50e('0x49')];break;case _0xc50e('0x4a'):_0x5f517f['type']=db[_0xc50e('0x48')]['INTEGER'];break;case _0xc50e('0x4b'):_0x5f517f[_0xc50e('0x28')]=db[_0xc50e('0x48')]['BOOLEAN'];_0x5f517f[_0xc50e('0x4c')]=![];break;default:}return db[_0xc50e('0x45')][_0xc50e('0x4d')][_0xc50e('0x4e')](_0xc50e('0x4f'),util[_0xc50e('0x50')](_0xc50e('0x51'),_0x93237a['id']),_0x5f517f);})[_0xc50e('0x20')](function(){return _0x93237a;});})['then'](respondWithResult(_0x5c22ba,0xc9))['catch'](handleError(_0x5c22ba,null));};
\ No newline at end of file
+var _0xd112=['catch','show','params','find','body','create','sequelize','transaction','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows'];(function(_0x2ffafb,_0x453e21){var _0x400af6=function(_0x1d11d2){while(--_0x1d11d2){_0x2ffafb['push'](_0x2ffafb['shift']());}};_0x400af6(++_0x453e21);}(_0xd112,0x10a));var _0x2d11=function(_0x4f232d,_0x50c2fd){_0x4f232d=_0x4f232d-0x0;var _0x494086=_0xd112[_0x4f232d];return _0x494086;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d11('0x0'));var zipdir=require(_0x2d11('0x1'));var jsonpatch=require(_0x2d11('0x2'));var rp=require(_0x2d11('0x3'));var moment=require(_0x2d11('0x4'));var BPromise=require(_0x2d11('0x5'));var Mustache=require(_0x2d11('0x6'));var util=require(_0x2d11('0x7'));var path=require('path');var sox=require(_0x2d11('0x8'));var csv=require('to-csv');var ejs=require(_0x2d11('0x9'));var fs=require('fs');var fs_extra=require(_0x2d11('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d11('0xb'));var jsforce=require(_0x2d11('0xc'));var deskjs=require(_0x2d11('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d11('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2d11('0xf'));var hardwareService=require(_0x2d11('0x10'));var logger=require(_0x2d11('0x11'))(_0x2d11('0x12'));var utils=require(_0x2d11('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2d11('0x14'));var db=require(_0x2d11('0x15'))['db'];function respondWithStatusCode(_0x3b7209,_0x4051fe){_0x4051fe=_0x4051fe||0xcc;return function(_0x389aff){if(_0x389aff){return _0x3b7209[_0x2d11('0x16')](_0x4051fe);}return _0x3b7209[_0x2d11('0x17')](_0x4051fe)[_0x2d11('0x18')]();};}function respondWithResult(_0x247c79,_0x4dfa4e){_0x4dfa4e=_0x4dfa4e||0xc8;return function(_0x400e2e){if(_0x400e2e){return _0x247c79[_0x2d11('0x17')](_0x4dfa4e)[_0x2d11('0x19')](_0x400e2e);}};}function respondWithFilteredResult(_0x427bbc,_0x33906b){return function(_0x4a1c71){if(_0x4a1c71){var _0x39648d=typeof _0x33906b['offset']==='undefined'&&typeof _0x33906b[_0x2d11('0x1a')]===_0x2d11('0x1b');var _0x33f7d9=_0x4a1c71['count'];var _0x2a7a49=_0x39648d?0x0:_0x33906b[_0x2d11('0x1c')];var _0x28233f=_0x39648d?_0x4a1c71[_0x2d11('0x1d')]:_0x33906b[_0x2d11('0x1c')]+_0x33906b['limit'];var _0xbdf6a4;if(_0x28233f>=_0x33f7d9){_0x28233f=_0x33f7d9;_0xbdf6a4=0xc8;}else{_0xbdf6a4=0xce;}_0x427bbc[_0x2d11('0x17')](_0xbdf6a4);return _0x427bbc['set'](_0x2d11('0x1e'),_0x2a7a49+'-'+_0x28233f+'/'+_0x33f7d9)['json'](_0x4a1c71);}return null;};}function patchUpdates(_0x2dd685){return function(_0x4498ba){try{jsonpatch[_0x2d11('0x1f')](_0x4498ba,_0x2dd685,!![]);}catch(_0x15c3d4){return BPromise[_0x2d11('0x20')](_0x15c3d4);}return _0x4498ba[_0x2d11('0x21')]();};}function saveUpdates(_0x32b4c9,_0x34d0fb){return function(_0x43a366){if(_0x43a366){return _0x43a366[_0x2d11('0x22')](_0x32b4c9)[_0x2d11('0x23')](function(_0x49f64c){return _0x49f64c;});}return null;};}function removeEntity(_0x3959f0,_0x442959){return function(_0x4a7103){if(_0x4a7103){return _0x4a7103[_0x2d11('0x24')]()[_0x2d11('0x23')](function(){_0x3959f0[_0x2d11('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c1c0b,_0xbb6f9c){return function(_0x1e5e5f){if(!_0x1e5e5f){_0x2c1c0b[_0x2d11('0x16')](0x194);}return _0x1e5e5f;};}function handleError(_0x3b6448,_0x11d4a4){_0x11d4a4=_0x11d4a4||0x1f4;return function(_0x2990ad){logger[_0x2d11('0x25')](_0x2990ad['stack']);if(_0x2990ad[_0x2d11('0x26')]){delete _0x2990ad[_0x2d11('0x26')];}_0x3b6448[_0x2d11('0x17')](_0x11d4a4)[_0x2d11('0x27')](_0x2990ad);};}exports[_0x2d11('0x28')]=function(_0x5bb753,_0x4da22e){var _0x5c327c={},_0x2e2169={},_0x294343={'count':0x0,'rows':[]};var _0x282045=_[_0x2d11('0x29')](db[_0x2d11('0x2a')][_0x2d11('0x2b')],function(_0x1391a1){return{'name':_0x1391a1[_0x2d11('0x2c')],'type':_0x1391a1[_0x2d11('0x2d')][_0x2d11('0x2e')]};});_0x2e2169[_0x2d11('0x2f')]=_[_0x2d11('0x30')](_['map'](_0x282045,'name'),['name']);_0x2e2169[_0x2d11('0x31')]=_[_0x2d11('0x32')](_0x5bb753[_0x2d11('0x31')]);_0x2e2169[_0x2d11('0x33')]=_[_0x2d11('0x34')](_0x2e2169[_0x2d11('0x2f')],_0x2e2169[_0x2d11('0x31')]);_0x5c327c[_0x2d11('0x35')]=_[_0x2d11('0x34')](_0x2e2169[_0x2d11('0x2f')],qs[_0x2d11('0x36')](_0x5bb753[_0x2d11('0x31')][_0x2d11('0x36')]));_0x5c327c[_0x2d11('0x35')]=_0x5c327c['attributes'][_0x2d11('0x37')]?_0x5c327c[_0x2d11('0x35')]:_0x2e2169['model'];if(!_0x5bb753[_0x2d11('0x31')]['hasOwnProperty']('nolimit')){_0x5c327c[_0x2d11('0x1a')]=qs[_0x2d11('0x1a')](_0x5bb753[_0x2d11('0x31')]['limit']);_0x5c327c[_0x2d11('0x1c')]=qs['offset'](_0x5bb753[_0x2d11('0x31')][_0x2d11('0x1c')]);}_0x5c327c[_0x2d11('0x38')]=qs[_0x2d11('0x39')](_0x5bb753[_0x2d11('0x31')][_0x2d11('0x39')]);_0x5c327c[_0x2d11('0x3a')]=qs[_0x2d11('0x33')](_['pick'](_0x5bb753[_0x2d11('0x31')],_0x2e2169[_0x2d11('0x33')]),_0x282045);if(_0x5bb753[_0x2d11('0x31')][_0x2d11('0x3b')]){_0x5c327c[_0x2d11('0x3a')]=_['merge'](_0x5c327c[_0x2d11('0x3a')],{'$or':_['map'](_0x282045,function(_0x4594f1){if(_0x4594f1[_0x2d11('0x2d')]!==_0x2d11('0x3c')){var _0x2e22cb={};_0x2e22cb[_0x4594f1[_0x2d11('0x26')]]={'$like':'%'+_0x5bb753[_0x2d11('0x31')][_0x2d11('0x3b')]+'%'};return _0x2e22cb;}})});}_0x5c327c=_[_0x2d11('0x3d')]({},_0x5c327c,_0x5bb753['options']);var _0x125f23={'where':_0x5c327c[_0x2d11('0x3a')]};return db[_0x2d11('0x2a')][_0x2d11('0x1d')](_0x125f23)[_0x2d11('0x23')](function(_0xd8793b){_0x294343[_0x2d11('0x1d')]=_0xd8793b;if(_0x5bb753[_0x2d11('0x31')][_0x2d11('0x3e')]){_0x5c327c[_0x2d11('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x2d11('0x40')](_0x5c327c);})[_0x2d11('0x23')](function(_0x2b4cdb){_0x294343[_0x2d11('0x41')]=_0x2b4cdb;return _0x294343;})['then'](respondWithFilteredResult(_0x4da22e,_0x5c327c))[_0x2d11('0x42')](handleError(_0x4da22e,null));};exports[_0x2d11('0x43')]=function(_0x34e9bc,_0x18198b){var _0x277c65={'raw':!![],'where':{'id':_0x34e9bc[_0x2d11('0x44')]['id']}},_0x353ec3={};_0x353ec3[_0x2d11('0x2f')]=_[_0x2d11('0x32')](db[_0x2d11('0x2a')]['rawAttributes']);_0x353ec3[_0x2d11('0x31')]=_[_0x2d11('0x32')](_0x34e9bc['query']);_0x353ec3[_0x2d11('0x33')]=_[_0x2d11('0x34')](_0x353ec3[_0x2d11('0x2f')],_0x353ec3[_0x2d11('0x31')]);_0x277c65[_0x2d11('0x35')]=_[_0x2d11('0x34')](_0x353ec3[_0x2d11('0x2f')],qs[_0x2d11('0x36')](_0x34e9bc[_0x2d11('0x31')][_0x2d11('0x36')]));_0x277c65['attributes']=_0x277c65[_0x2d11('0x35')][_0x2d11('0x37')]?_0x277c65[_0x2d11('0x35')]:_0x353ec3['model'];if(_0x34e9bc[_0x2d11('0x31')][_0x2d11('0x3e')]){_0x277c65[_0x2d11('0x3f')]=[{'all':!![]}];}_0x277c65=_[_0x2d11('0x3d')]({},_0x277c65,_0x34e9bc['options']);return db[_0x2d11('0x2a')][_0x2d11('0x45')](_0x277c65)[_0x2d11('0x23')](handleEntityNotFound(_0x18198b,null))['then'](respondWithResult(_0x18198b,null))['catch'](handleError(_0x18198b,null));};exports[_0x2d11('0x22')]=function(_0x4e49dd,_0x37963e){if(_0x4e49dd[_0x2d11('0x46')]['id']){delete _0x4e49dd[_0x2d11('0x46')]['id'];}return db[_0x2d11('0x2a')][_0x2d11('0x45')]({'where':{'id':_0x4e49dd[_0x2d11('0x44')]['id']}})[_0x2d11('0x23')](handleEntityNotFound(_0x37963e,null))[_0x2d11('0x23')](saveUpdates(_0x4e49dd[_0x2d11('0x46')],null))[_0x2d11('0x23')](respondWithResult(_0x37963e,null))['catch'](handleError(_0x37963e,null));};exports[_0x2d11('0x24')]=function(_0x49b37e,_0x5785f7){return db[_0x2d11('0x2a')]['find']({'where':{'id':_0x49b37e[_0x2d11('0x44')]['id']}})[_0x2d11('0x23')](handleEntityNotFound(_0x5785f7,null))[_0x2d11('0x23')](removeEntity(_0x5785f7,null))[_0x2d11('0x42')](handleError(_0x5785f7,null));};exports[_0x2d11('0x47')]=function(_0x2442b2,_0xdeb5bc){var _0x57fa1c;return db[_0x2d11('0x48')][_0x2d11('0x49')](function(_0x30daf0){return db[_0x2d11('0x2a')][_0x2d11('0x47')](_0x2442b2[_0x2d11('0x46')],{'transaction':_0x30daf0})[_0x2d11('0x23')](function(_0x1b0ac9){_0x57fa1c=_0x1b0ac9;var _0x1cfabf={'type':db['Sequelize']['TEXT'],'transaction':_0x30daf0};switch(_0x2442b2[_0x2d11('0x46')]['type']){case _0x2d11('0x4a'):_0x1cfabf[_0x2d11('0x2d')]=db[_0x2d11('0x4b')]['TEXT'];break;case'number':_0x1cfabf[_0x2d11('0x2d')]=db[_0x2d11('0x4b')][_0x2d11('0x4c')];break;case _0x2d11('0x4d'):_0x1cfabf[_0x2d11('0x2d')]=db[_0x2d11('0x4b')][_0x2d11('0x4e')];_0x1cfabf[_0x2d11('0x4f')]=![];break;default:}return db[_0x2d11('0x48')]['queryInterface'][_0x2d11('0x50')](_0x2d11('0x51'),util[_0x2d11('0x52')]('cf_%d',_0x57fa1c['id']),_0x1cfabf);})[_0x2d11('0x23')](function(){return _0x57fa1c;});})[_0x2d11('0x23')](respondWithResult(_0xdeb5bc,0xc9))['catch'](handleError(_0xdeb5bc,null));};
\ No newline at end of file
index 69a3a13..3b35eb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e04=['request-promise','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6e04,0x172));var _0x46e0=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x6e04[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x46e0('0x0'));var util=require('util');var logger=require(_0x46e0('0x1'))(_0x46e0('0x2'));var moment=require(_0x46e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x46e0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x46e0('0x6'));module[_0x46e0('0x7')]=function(_0x6e2269,_0x5bd276){return _0x6e2269[_0x46e0('0x8')](_0x46e0('0x9'),attributes,{'tableName':_0x46e0('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb139=['./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x338352,_0x4149d9){var _0x1b9e75=function(_0x334563){while(--_0x334563){_0x338352['push'](_0x338352['shift']());}};_0x1b9e75(++_0x4149d9);}(_0xb139,0xf7));var _0x9b13=function(_0x12fa48,_0x3cd115){_0x12fa48=_0x12fa48-0x0;var _0x250da8=_0xb139[_0x12fa48];return _0x250da8;};'use strict';var _=require('lodash');var util=require(_0x9b13('0x0'));var logger=require(_0x9b13('0x1'))('api');var moment=require(_0x9b13('0x2'));var BPromise=require(_0x9b13('0x3'));var rp=require(_0x9b13('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9b13('0x5'));var attributes=require(_0x9b13('0x6'));module[_0x9b13('0x7')]=function(_0x5b5df5,_0x4f1a30){return _0x5b5df5[_0x9b13('0x8')](_0x9b13('0x9'),attributes,{'tableName':_0x9b13('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8785b7a..1a675dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x259f=['../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x259f,0x1dd));var _0xf259=function(_0x4a04d8,_0x79e1e8){_0x4a04d8=_0x4a04d8-0x0;var _0x191bb5=_0x259f[_0x4a04d8];return _0x191bb5;};'use strict';var _=require(_0xf259('0x0'));var util=require(_0xf259('0x1'));var moment=require('moment');var BPromise=require(_0xf259('0x2'));var rs=require(_0xf259('0x3'));var fs=require('fs');var Redis=require(_0xf259('0x4'));var db=require(_0xf259('0x5'))['db'];var utils=require(_0xf259('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf259('0x7'));var jayson=require(_0xf259('0x8'));var client=jayson[_0xf259('0x9')][_0xf259('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb82a6c,_0x225954,_0x26a29c){return new BPromise(function(_0x4be97f,_0x5a78f2){return client[_0xf259('0xb')](_0xb82a6c,_0x26a29c)[_0xf259('0xc')](function(_0xa75fbd){logger[_0xf259('0xd')](_0xf259('0xe'),_0x225954,_0xf259('0xf'));logger['debug'](_0xf259('0x10'),_0x225954,_0xf259('0xf'),JSON[_0xf259('0x11')](_0xa75fbd));if(_0xa75fbd[_0xf259('0x12')]){if(_0xa75fbd[_0xf259('0x12')]['code']===0x1f4){logger[_0xf259('0x12')](_0xf259('0xe'),_0x225954,_0xa75fbd[_0xf259('0x12')][_0xf259('0x13')]);return _0x5a78f2(_0xa75fbd[_0xf259('0x12')][_0xf259('0x13')]);}logger[_0xf259('0x12')](_0xf259('0xe'),_0x225954,_0xa75fbd[_0xf259('0x12')][_0xf259('0x13')]);return _0x4be97f(_0xa75fbd[_0xf259('0x12')]['message']);}else{logger[_0xf259('0xd')](_0xf259('0xe'),_0x225954,'request\x20sent');_0x4be97f(_0xa75fbd[_0xf259('0x14')][_0xf259('0x13')]);}})[_0xf259('0x15')](function(_0x34450d){logger[_0xf259('0x12')](_0xf259('0xe'),_0x225954,_0x34450d);_0x5a78f2(_0x34450d);});});}
\ No newline at end of file
+var _0x7ccf=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x7ccf,0xbc));var _0xf7cc=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x7ccf[_0x2af29a];return _0x5ef02f;};'use strict';var _=require(_0xf7cc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf7cc('0x1'));var rs=require(_0xf7cc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7cc('0x3'))['db'];var utils=require(_0xf7cc('0x4'));var logger=require(_0xf7cc('0x5'))(_0xf7cc('0x6'));var config=require(_0xf7cc('0x7'));var jayson=require(_0xf7cc('0x8'));var client=jayson[_0xf7cc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59ff0d,_0xa9e3cf,_0x4ffdb2){return new BPromise(function(_0x451475,_0x3a7aa4){return client['request'](_0x59ff0d,_0x4ffdb2)['then'](function(_0x58bbf7){logger[_0xf7cc('0xa')](_0xf7cc('0xb'),_0xa9e3cf,_0xf7cc('0xc'));logger[_0xf7cc('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xa9e3cf,_0xf7cc('0xc'),JSON[_0xf7cc('0xe')](_0x58bbf7));if(_0x58bbf7[_0xf7cc('0xf')]){if(_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x10')]===0x1f4){logger[_0xf7cc('0xf')](_0xf7cc('0xb'),_0xa9e3cf,_0x58bbf7[_0xf7cc('0xf')]['message']);return _0x3a7aa4(_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x11')]);}logger[_0xf7cc('0xf')](_0xf7cc('0xb'),_0xa9e3cf,_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x11')]);return _0x451475(_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x11')]);}else{logger[_0xf7cc('0xa')](_0xf7cc('0xb'),_0xa9e3cf,_0xf7cc('0xc'));_0x451475(_0x58bbf7['result'][_0xf7cc('0x11')]);}})['catch'](function(_0x5b98f6){logger[_0xf7cc('0xf')](_0xf7cc('0xb'),_0xa9e3cf,_0x5b98f6);_0x3a7aa4(_0x5b98f6);});});}
\ No newline at end of file
index 96f0eb0..d3a180c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeece=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','put','/:id','update','delete','destroy','exports'];(function(_0x4130c6,_0x5837a6){var _0x2afa60=function(_0x52c835){while(--_0x52c835){_0x4130c6['push'](_0x4130c6['shift']());}};_0x2afa60(++_0x5837a6);}(_0xeece,0x159));var _0xeeec=function(_0x4d65a6,_0x32bede){_0x4d65a6=_0x4d65a6-0x0;var _0xa80900=_0xeece[_0x4d65a6];return _0xa80900;};'use strict';var multer=require('multer');var util=require(_0xeeec('0x0'));var path=require(_0xeeec('0x1'));var timeout=require(_0xeeec('0x2'));var express=require('express');var router=express[_0xeeec('0x3')]();var fs_extra=require(_0xeeec('0x4'));var auth=require(_0xeeec('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0xeeec('0x6')](),controller[_0xeeec('0x7')]);router[_0xeeec('0x8')]('/:id',auth[_0xeeec('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xeeec('0x9')](_0xeeec('0xa'),auth[_0xeeec('0x6')](),controller[_0xeeec('0xb')]);router[_0xeeec('0xc')](_0xeeec('0xa'),auth['isAuthenticated'](),controller[_0xeeec('0xd')]);module[_0xeeec('0xe')]=router;
\ No newline at end of file
+var _0x4a9c=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put'];(function(_0x1884be,_0x21990a){var _0x35e372=function(_0x306563){while(--_0x306563){_0x1884be['push'](_0x1884be['shift']());}};_0x35e372(++_0x21990a);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x2b06bc,_0x3b48d0){_0x2b06bc=_0x2b06bc-0x0;var _0x4a0dbe=_0x4a9c[_0x2b06bc];return _0x4a0dbe;};'use strict';var multer=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var path=require(_0xc4a9('0x2'));var timeout=require(_0xc4a9('0x3'));var express=require(_0xc4a9('0x4'));var router=express[_0xc4a9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc4a9('0x6'));var interaction=require(_0xc4a9('0x7'));var config=require(_0xc4a9('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0xc4a9('0x9')](),controller[_0xc4a9('0xa')]);router[_0xc4a9('0xb')](_0xc4a9('0xc'),auth['isAuthenticated'](),controller[_0xc4a9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc4a9('0xe')]);router[_0xc4a9('0xf')](_0xc4a9('0xc'),auth[_0xc4a9('0x9')](),controller[_0xc4a9('0x10')]);router[_0xc4a9('0x11')](_0xc4a9('0xc'),auth[_0xc4a9('0x9')](),controller[_0xc4a9('0x12')]);module[_0xc4a9('0x13')]=router;
\ No newline at end of file
index 7ab5794..f2e2e82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bd1=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x479de0,_0x13a0f7){var _0x52d627=function(_0x1e633d){while(--_0x1e633d){_0x479de0['push'](_0x479de0['shift']());}};_0x52d627(++_0x13a0f7);}(_0x7bd1,0x173));var _0x17bd=function(_0x58128a,_0x8ab991){_0x58128a=_0x58128a-0x0;var _0x56f353=_0x7bd1[_0x58128a];return _0x56f353;};'use strict';var moment=require(_0x17bd('0x0'));var Sequelize=require(_0x17bd('0x1'));module[_0x17bd('0x2')]={'phone':{'type':Sequelize[_0x17bd('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x17bd('0x4')],'defaultValue':moment()[_0x17bd('0x5')](_0x17bd('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x17bd('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x17bd('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x17bd('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x17bd('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x17bd('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x17bd('0x7')],'unique':_0x17bd('0xa')},'ListId':{'type':Sequelize[_0x17bd('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x17bd('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x17bd('0x7')],'unique':_0x17bd('0xa')},'CampaignId':{'type':Sequelize[_0x17bd('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x17bd('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x17bd('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x17bd('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x17bd('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe7f3=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x1d3ec6,_0x1188fc){var _0x417228=function(_0x4f4de2){while(--_0x4f4de2){_0x1d3ec6['push'](_0x1d3ec6['shift']());}};_0x417228(++_0x1188fc);}(_0xe7f3,0x1e2));var _0x3e7f=function(_0x786bc1,_0x180ab2){_0x786bc1=_0x786bc1-0x0;var _0x22fab1=_0xe7f3[_0x786bc1];return _0x22fab1;};'use strict';var moment=require(_0x3e7f('0x0'));var Sequelize=require(_0x3e7f('0x1'));module[_0x3e7f('0x2')]={'phone':{'type':Sequelize[_0x3e7f('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3e7f('0x4')],'defaultValue':moment()[_0x3e7f('0x5')](_0x3e7f('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3e7f('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3e7f('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3e7f('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3e7f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e7f('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3e7f('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3e7f('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3e7f('0x7')],'unique':_0x3e7f('0xa')},'ListId':{'type':Sequelize[_0x3e7f('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3e7f('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x3e7f('0x7')],'unique':_0x3e7f('0xa')},'CampaignId':{'type':Sequelize[_0x3e7f('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3e7f('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3e7f('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ad56a1b..0f4ba30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28b5=['preview','sequelize','transaction','map','value','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','Company','CmList','List','Queue','getOpenContacts','getVoiceQueues','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','CmHopper','fieldName','key','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','model','fields','length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','createdAt','updatedAt','state','campaign','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','getPreview','outbound'];(function(_0x192437,_0x3fda23){var _0x1d27af=function(_0x1914fb){while(--_0x1914fb){_0x192437['push'](_0x192437['shift']());}};_0x1d27af(++_0x3fda23);}(_0x28b5,0x13f));var _0x528b=function(_0x3e471c,_0x15b98f){_0x3e471c=_0x3e471c-0x0;var _0xeabcf8=_0x28b5[_0x3e471c];return _0xeabcf8;};'use strict';var emlformat=require(_0x528b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x528b('0x1'));var jsonpatch=require(_0x528b('0x2'));var rp=require(_0x528b('0x3'));var moment=require('moment');var BPromise=require(_0x528b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x528b('0x5'));var sox=require(_0x528b('0x6'));var csv=require(_0x528b('0x7'));var ejs=require(_0x528b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x528b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x528b('0xa'));var deskjs=require(_0x528b('0xb'));var toCsv=require(_0x528b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x528b('0xc'));var authService=require(_0x528b('0xd'));var qs=require(_0x528b('0xe'));var as=require(_0x528b('0xf'));var hardwareService=require(_0x528b('0x10'));var logger=require('../../config/logger')(_0x528b('0x11'));var utils=require(_0x528b('0x12'));var config=require(_0x528b('0x13'));var licenseUtil=require(_0x528b('0x14'));var db=require(_0x528b('0x15'))['db'];function respondWithStatusCode(_0x48afc8,_0x55226f){_0x55226f=_0x55226f||0xcc;return function(_0x37ae6d){if(_0x37ae6d){return _0x48afc8['sendStatus'](_0x55226f);}return _0x48afc8[_0x528b('0x16')](_0x55226f)[_0x528b('0x17')]();};}function respondWithResult(_0x912e3a,_0x117a6f){_0x117a6f=_0x117a6f||0xc8;return function(_0x26b88f){if(_0x26b88f){return _0x912e3a['status'](_0x117a6f)[_0x528b('0x18')](_0x26b88f);}};}function respondWithFilteredResult(_0x2c646f,_0x51819e){return function(_0x243013){if(_0x243013){var _0x1a31cd=typeof _0x51819e['offset']===_0x528b('0x19')&&typeof _0x51819e[_0x528b('0x1a')]===_0x528b('0x19');var _0x3d6fb3=_0x243013['count'];var _0x4b95f9=_0x1a31cd?0x0:_0x51819e[_0x528b('0x1b')];var _0x311235=_0x1a31cd?_0x243013[_0x528b('0x1c')]:_0x51819e['offset']+_0x51819e[_0x528b('0x1a')];var _0x2862ea;if(_0x311235>=_0x3d6fb3){_0x311235=_0x3d6fb3;_0x2862ea=0xc8;}else{_0x2862ea=0xce;}_0x2c646f[_0x528b('0x16')](_0x2862ea);return _0x2c646f[_0x528b('0x1d')](_0x528b('0x1e'),_0x4b95f9+'-'+_0x311235+'/'+_0x3d6fb3)[_0x528b('0x18')](_0x243013);}return null;};}function patchUpdates(_0x1fa3d6){return function(_0x428a82){try{jsonpatch['apply'](_0x428a82,_0x1fa3d6,!![]);}catch(_0xb5ba11){return BPromise[_0x528b('0x1f')](_0xb5ba11);}return _0x428a82[_0x528b('0x20')]();};}function saveUpdates(_0xa61412,_0xba8e96){return function(_0x206d43){if(_0x206d43){return _0x206d43[_0x528b('0x21')](_0xa61412)[_0x528b('0x22')](function(_0x50f7b7){return _0x50f7b7;});}return null;};}function removeEntity(_0x627143,_0x568116){return function(_0x406b2a){if(_0x406b2a){return _0x406b2a['destroy']()[_0x528b('0x22')](function(){_0x627143[_0x528b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5282d5,_0x2ff15e){return function(_0x51efb0){if(!_0x51efb0){_0x5282d5[_0x528b('0x23')](0x194);}return _0x51efb0;};}function handleError(_0x4c7768,_0x4eb41f){_0x4eb41f=_0x4eb41f||0x1f4;return function(_0x52d1df){logger[_0x528b('0x24')](_0x52d1df[_0x528b('0x25')]);if(_0x52d1df[_0x528b('0x26')]){delete _0x52d1df[_0x528b('0x26')];}_0x4c7768[_0x528b('0x16')](_0x4eb41f)[_0x528b('0x27')](_0x52d1df);};}exports[_0x528b('0x28')]=function(_0xf96211,_0x276b06){var _0x1c5d43={},_0x2cb914={},_0x558cb5={'count':0x0,'rows':[]};var _0x514feb=_['map'](db[_0x528b('0x29')]['rawAttributes'],function(_0x439ee4){return{'name':_0x439ee4[_0x528b('0x2a')],'type':_0x439ee4['type'][_0x528b('0x2b')]};});_0x2cb914['model']=_['map'](_0x514feb,_0x528b('0x26'));_0x2cb914[_0x528b('0x2c')]=_[_0x528b('0x2d')](_0xf96211['query']);_0x2cb914[_0x528b('0x2e')]=_[_0x528b('0x2f')](_0x2cb914['model'],_0x2cb914[_0x528b('0x2c')]);_0x2cb914['filters']=_[_0x528b('0x30')](_0x2cb914[_0x528b('0x2e')],[_0x528b('0x31'),_0x528b('0x32'),_0x528b('0x33'),_0x528b('0x34'),'$lt',_0x528b('0x35'),_0x528b('0x36'),_0x528b('0x37'),_0x528b('0x38'),_0x528b('0x39'),_0x528b('0x3a'),_0x528b('0x3b'),'$notIn',_0x528b('0x3c'),_0x528b('0x3d'),_0x528b('0x3e'),_0x528b('0x3f'),'$like',_0x528b('0x40'),_0x528b('0x41'),_0x528b('0x42'),_0x528b('0x43')]);_0x1c5d43[_0x528b('0x44')]=_[_0x528b('0x2f')](_0x2cb914[_0x528b('0x45')],qs[_0x528b('0x46')](_0xf96211[_0x528b('0x2c')]['fields']));_0x1c5d43['attributes']=_0x1c5d43[_0x528b('0x44')][_0x528b('0x47')]?_0x1c5d43['attributes']:_0x2cb914['model'];if(!_0xf96211[_0x528b('0x2c')]['hasOwnProperty'](_0x528b('0x48'))){_0x1c5d43['limit']=qs['limit'](_0xf96211[_0x528b('0x2c')][_0x528b('0x1a')]);_0x1c5d43['offset']=qs[_0x528b('0x1b')](_0xf96211['query'][_0x528b('0x1b')]);}_0x1c5d43[_0x528b('0x49')]=qs[_0x528b('0x4a')](_0xf96211['query'][_0x528b('0x4a')]);_0x1c5d43['where']=qs[_0x528b('0x2e')](_['pick'](_0xf96211[_0x528b('0x2c')],_0x2cb914[_0x528b('0x2e')]),_0x514feb);if(_0xf96211[_0x528b('0x2c')][_0x528b('0x4b')]){_0x1c5d43[_0x528b('0x4c')]=_[_0x528b('0x4d')](_0x1c5d43[_0x528b('0x4c')],{'$or':_['map'](_0x514feb,function(_0x2869cb){if(_0x2869cb[_0x528b('0x4e')]!==_0x528b('0x4f')){var _0xe1c4f3={};_0xe1c4f3[_0x2869cb[_0x528b('0x26')]]={'$like':'%'+_0xf96211[_0x528b('0x2c')][_0x528b('0x4b')]+'%'};return _0xe1c4f3;}})});}_0x1c5d43=_['merge']({},_0x1c5d43,_0xf96211['options']);var _0x2b1ec1={'where':_0x1c5d43['where']};return db[_0x528b('0x29')][_0x528b('0x1c')](_0x2b1ec1)['then'](function(_0x362af5){_0x558cb5[_0x528b('0x1c')]=_0x362af5;if(_0xf96211[_0x528b('0x2c')][_0x528b('0x50')]){_0x1c5d43[_0x528b('0x51')]=[{'all':!![]}];}return db[_0x528b('0x29')]['findAll'](_0x1c5d43);})['then'](function(_0x3bfa73){_0x558cb5['rows']=_0x3bfa73;return _0x558cb5;})[_0x528b('0x22')](respondWithFilteredResult(_0x276b06,_0x1c5d43))[_0x528b('0x52')](handleError(_0x276b06,null));};exports[_0x528b('0x53')]=function(_0x4d9a5a,_0x5851f7){var _0x1dbd53={'raw':!![],'where':{'id':_0x4d9a5a[_0x528b('0x54')]['id']}},_0x3d9daf={};_0x3d9daf['model']=_[_0x528b('0x2d')](db[_0x528b('0x29')][_0x528b('0x55')]);_0x3d9daf['query']=_[_0x528b('0x2d')](_0x4d9a5a['query']);_0x3d9daf[_0x528b('0x2e')]=_[_0x528b('0x2f')](_0x3d9daf['model'],_0x3d9daf[_0x528b('0x2c')]);_0x1dbd53[_0x528b('0x44')]=_['intersection'](_0x3d9daf['model'],qs[_0x528b('0x46')](_0x4d9a5a[_0x528b('0x2c')]['fields']));_0x1dbd53[_0x528b('0x44')]=_0x1dbd53[_0x528b('0x44')]['length']?_0x1dbd53['attributes']:_0x3d9daf['model'];if(_0x4d9a5a[_0x528b('0x2c')][_0x528b('0x50')]){_0x1dbd53[_0x528b('0x51')]=[{'all':!![]}];}_0x1dbd53=_['merge']({},_0x1dbd53,_0x4d9a5a['options']);return db[_0x528b('0x29')][_0x528b('0x56')](_0x1dbd53)['then'](handleEntityNotFound(_0x5851f7,null))['then'](respondWithResult(_0x5851f7,null))[_0x528b('0x52')](handleError(_0x5851f7,null));};exports[_0x528b('0x57')]=function(_0x3c8e72,_0x33f900){return db[_0x528b('0x29')][_0x528b('0x57')](_0x3c8e72[_0x528b('0x58')],{})[_0x528b('0x22')](respondWithResult(_0x33f900,0xc9))[_0x528b('0x52')](handleError(_0x33f900,null));};exports[_0x528b('0x21')]=function(_0x2ed0d9,_0x408f42){if(_0x2ed0d9[_0x528b('0x58')]['id']){delete _0x2ed0d9[_0x528b('0x58')]['id'];}return db['CmHopper'][_0x528b('0x56')]({'where':{'id':_0x2ed0d9[_0x528b('0x54')]['id']}})['then'](handleEntityNotFound(_0x408f42,null))['then'](saveUpdates(_0x2ed0d9['body'],null))[_0x528b('0x22')](respondWithResult(_0x408f42,null))[_0x528b('0x52')](handleError(_0x408f42,null));};exports[_0x528b('0x59')]=function(_0x279937,_0x526a83){return db[_0x528b('0x29')]['describe']()['then'](respondWithResult(_0x526a83,null))[_0x528b('0x52')](handleError(_0x526a83,null));};exports['destroy']=function(_0x23637a,_0x3e3989){var _0x2b0872;return db[_0x528b('0x29')][_0x528b('0x56')]({'where':{'id':_0x23637a[_0x528b('0x54')]['id']}})[_0x528b('0x22')](handleEntityNotFound(_0x3e3989,null))[_0x528b('0x22')](function(_0x179a4a){if(_0x179a4a){return _0x179a4a[_0x528b('0x5a')]()[_0x528b('0x22')](function(_0x6b8edd){return _0x6b8edd;});}})[_0x528b('0x22')](function(_0x2fb658){_0x2b0872=_0x2fb658;if(_0x2fb658){if(_0x2fb658[_0x528b('0x5b')]||_0x2fb658[_0x528b('0x5c')]){return db[_0x2fb658[_0x528b('0x5b')]?_0x528b('0x5d'):_0x528b('0x5e')][_0x528b('0x56')]({'where':{'id':_0x2fb658[_0x528b('0x5b')]?_0x2fb658[_0x528b('0x5b')]:_0x2fb658['CampaignId']},'attributes':['id',_0x528b('0x26')],'raw':!![]});}}})[_0x528b('0x22')](function(_0x10a393){var _0x37b199={};if(_0x10a393){_[_0x528b('0x4d')](_0x37b199,_['omit'](_0x2b0872['dataValues'],[_0x528b('0x5f'),_0x528b('0x60'),'id']));_0x37b199[_0x528b('0x61')]=0x15;_0x37b199['statedesc']='deleted';_0x37b199[_0x528b('0x62')]=_0x10a393['name'];_0x37b199['membername']=_0x23637a[_0x528b('0x63')][_0x528b('0x26')];_0x37b199[_0x528b('0x64')]=_0x23637a[_0x528b('0x63')]['id'];_0x37b199[_0x528b('0x65')]=!![];_0x37b199[_0x528b('0x66')]=moment()[_0x528b('0x67')](_0x528b('0x68'));_0x37b199[_0x528b('0x69')]=_0x2b0872['phone'];_0x37b199[_0x528b('0x6a')]=_0x2b0872[_0x528b('0x5b')]?_0x528b('0x6b'):_0x528b('0x6c');return db[_0x528b('0x6d')][_0x528b('0x56')]({'where':{'id':_0x37b199[_0x528b('0x6e')]},'attributes':['firstName','lastName']})['then'](function(_0x41dedc){if(!_['isNil'](_0x3e3989)&&!_[_0x528b('0x6f')](_0x41dedc[_0x528b('0x70')])){_0x37b199['calleridname']=_0x41dedc[_0x528b('0x70')];if(!_[_0x528b('0x6f')](_0x41dedc['lastName'])){_0x37b199[_0x528b('0x71')]+='\x20'+_0x41dedc[_0x528b('0x72')];}}})[_0x528b('0x73')](function(){return db[_0x528b('0x74')][_0x528b('0x57')](_0x37b199);});}})[_0x528b('0x22')](function(){return _0x3e3989[_0x528b('0x16')](0xcc)['end']();})['catch'](handleError(_0x3e3989,null));};exports[_0x528b('0x75')]=function(_0x173d33,_0x239b04,_0x10290e){var _0x463b64=[];return db[_0x528b('0x6d')][_0x528b('0x59')]()[_0x528b('0x22')](function(_0x1259be){_0x463b64=_[_0x528b('0x2d')](_0x1259be);return _0x173d33['user']['getVoiceQueues']({'where':{'type':_0x528b('0x76'),'dialActive':!![],'dialMethod':_0x528b('0x77')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x3aee37){if(_0x3aee37&&_0x3aee37[_0x528b('0x47')]){return db[_0x528b('0x78')][_0x528b('0x79')](function(_0x469d19){var _0x36c51d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x528b('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x528b('0x7a')](_0x3aee37,'id')},'$or':[{'UserId':null},{'UserId':_0x173d33[_0x528b('0x63')]['id']}]};var _0x26482c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3aee37)[_0x528b('0x4b')](['dialPreviewAutoRecallMe',0x0])[_0x528b('0x7a')]('id')[_0x528b('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x173d33[_0x528b('0x63')]['id']}]};var _0x5e7eba={'$or':[_0x36c51d,_0x26482c]};var _0x14aac9=[];if(_0x173d33[_0x528b('0x58')][_0x528b('0x7c')]&&_0x173d33[_0x528b('0x58')]['direction']===_0x528b('0x7d')){if(!_['isEmpty'](_0x173d33[_0x528b('0x58')][_0x528b('0x7e')])){_0x5e7eba['id']={'$in':_0x173d33[_0x528b('0x58')]['hopperIds']};}_0x14aac9=[[_0x528b('0x7f'),_0x528b('0x80')],[_0x528b('0x81'),_0x3aee37[0x0]['dialOrderByScheduledAt']===_0x528b('0x80')?_0x528b('0x82'):_0x528b('0x80')],db['sequelize'][_0x528b('0x83')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_['isEmpty'](_0x173d33[_0x528b('0x58')]['hopperIds'])){_0x5e7eba['id']={'$notIn':_0x173d33[_0x528b('0x58')][_0x528b('0x7e')]};}_0x14aac9=[[_0x528b('0x7f'),_0x528b('0x82')],[_0x528b('0x81'),_0x3aee37[0x0][_0x528b('0x84')]],db['sequelize'][_0x528b('0x83')](_0x528b('0x85')),['id','ASC']];}return db[_0x528b('0x29')][_0x528b('0x86')]({'attributes':['id','scheduledat',_0x528b('0x87')],'where':_0x5e7eba,'order':_0x14aac9,'transaction':_0x469d19,'lock':_0x469d19[_0x528b('0x88')][_0x528b('0x89')],'include':[{'model':db[_0x528b('0x6d')],'as':_0x528b('0x8a'),'attributes':_0x463b64,'include':[{'model':db['CmCompany'],'as':_0x528b('0x8b'),'attributes':['id',_0x528b('0x26')]}]},{'model':db[_0x528b('0x8c')],'as':_0x528b('0x8d'),'attributes':['id',_0x528b('0x26')]},{'model':db[_0x528b('0x5d')],'as':_0x528b('0x8e'),'attributes':['id',_0x528b('0x26'),'dialActive']}]})['then'](function(_0x4fbaaa){if(_0x4fbaaa){return _0x4fbaaa[_0x528b('0x21')]({'UserId':_0x173d33['user']['id']},{'transaction':_0x469d19});}});});}})[_0x528b('0x22')](handleEntityNotFound(_0x239b04,null))[_0x528b('0x22')](respondWithResult(_0x239b04,null))[_0x528b('0x52')](handleError(_0x239b04,null));};exports[_0x528b('0x8f')]=function(_0x4e20f8,_0x2fe2a2,_0x1891a2){return _0x4e20f8[_0x528b('0x63')][_0x528b('0x90')]({'where':{'type':_0x528b('0x76'),'dialActive':!![],'dialMethod':_0x528b('0x77')},'attributes':['id'],'raw':!![]})[_0x528b('0x22')](function(_0x2c5505){if(_0x2c5505&&_0x2c5505[_0x528b('0x47')]){return db[_0x528b('0x29')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x528b('0x67')](_0x528b('0x68'))},'VoiceQueueId':{'$in':_[_0x528b('0x7a')](_0x2c5505,'id')},'$or':[{'UserId':null},{'UserId':_0x4e20f8[_0x528b('0x63')]['id']}]}});}return 0x0;})['then'](function(_0x72506c){if(!_[_0x528b('0x6f')](_0x72506c)&&_['isNumber'](_0x72506c)){return _0x2fe2a2[_0x528b('0x16')](0xc8)[_0x528b('0x18')]({'contacts':_0x72506c});}else{logger[_0x528b('0x24')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x528b('0x8f'),0x194,_0x528b('0x91'));_0x2fe2a2[_0x528b('0x23')](0x194);}})[_0x528b('0x52')](handleError(_0x2fe2a2,null));};
\ No newline at end of file
+var _0x2116=['error','stack','name','send','index','map','CmHopper','fieldName','type','query','keys','intersection','model','filters','concat','$or','$lte','$ne','$eq','$between','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','merge','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','updatedAt','state','statedesc','deleted','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledat','LOCK','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','outbound','entity\x20not\x20found','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2116,0x67));var _0x6211=function(_0x4cb610,_0x1b383c){_0x4cb610=_0x4cb610-0x0;var _0x84544=_0x2116[_0x4cb610];return _0x84544;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6211('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6211('0x1'));var rp=require(_0x6211('0x2'));var moment=require(_0x6211('0x3'));var BPromise=require(_0x6211('0x4'));var Mustache=require('mustache');var util=require(_0x6211('0x5'));var path=require(_0x6211('0x6'));var sox=require(_0x6211('0x7'));var csv=require(_0x6211('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6211('0x9'));var _=require('lodash');var squel=require(_0x6211('0xa'));var crypto=require(_0x6211('0xb'));var jsforce=require(_0x6211('0xc'));var deskjs=require(_0x6211('0xd'));var toCsv=require(_0x6211('0x8'));var querystring=require(_0x6211('0xe'));var Papa=require(_0x6211('0xf'));var Redis=require('ioredis');var authService=require(_0x6211('0x10'));var qs=require(_0x6211('0x11'));var as=require(_0x6211('0x12'));var hardwareService=require(_0x6211('0x13'));var logger=require(_0x6211('0x14'))(_0x6211('0x15'));var utils=require(_0x6211('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6211('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337362,_0x6661a7){_0x6661a7=_0x6661a7||0xcc;return function(_0x22963d){if(_0x22963d){return _0x337362['sendStatus'](_0x6661a7);}return _0x337362[_0x6211('0x18')](_0x6661a7)[_0x6211('0x19')]();};}function respondWithResult(_0x1a27a2,_0x509faa){_0x509faa=_0x509faa||0xc8;return function(_0x54a303){if(_0x54a303){return _0x1a27a2[_0x6211('0x18')](_0x509faa)[_0x6211('0x1a')](_0x54a303);}};}function respondWithFilteredResult(_0x23f8d2,_0xf69c79){return function(_0xa23863){if(_0xa23863){var _0x15adb6=typeof _0xf69c79[_0x6211('0x1b')]===_0x6211('0x1c')&&typeof _0xf69c79['limit']===_0x6211('0x1c');var _0x432c18=_0xa23863[_0x6211('0x1d')];var _0x2ccbb0=_0x15adb6?0x0:_0xf69c79[_0x6211('0x1b')];var _0x14c051=_0x15adb6?_0xa23863[_0x6211('0x1d')]:_0xf69c79['offset']+_0xf69c79[_0x6211('0x1e')];var _0x1528e6;if(_0x14c051>=_0x432c18){_0x14c051=_0x432c18;_0x1528e6=0xc8;}else{_0x1528e6=0xce;}_0x23f8d2['status'](_0x1528e6);return _0x23f8d2[_0x6211('0x1f')](_0x6211('0x20'),_0x2ccbb0+'-'+_0x14c051+'/'+_0x432c18)[_0x6211('0x1a')](_0xa23863);}return null;};}function patchUpdates(_0x30d6a5){return function(_0x4d99bc){try{jsonpatch['apply'](_0x4d99bc,_0x30d6a5,!![]);}catch(_0x4252d3){return BPromise[_0x6211('0x21')](_0x4252d3);}return _0x4d99bc['save']();};}function saveUpdates(_0x52eb53,_0x15ca00){return function(_0x1e6a53){if(_0x1e6a53){return _0x1e6a53[_0x6211('0x22')](_0x52eb53)[_0x6211('0x23')](function(_0x5b50cd){return _0x5b50cd;});}return null;};}function removeEntity(_0x2c1c0a,_0x311054){return function(_0x16fb0c){if(_0x16fb0c){return _0x16fb0c['destroy']()[_0x6211('0x23')](function(){_0x2c1c0a[_0x6211('0x18')](0xcc)[_0x6211('0x19')]();});}};}function handleEntityNotFound(_0x4a13f8,_0x532778){return function(_0x4ebae9){if(!_0x4ebae9){_0x4a13f8['sendStatus'](0x194);}return _0x4ebae9;};}function handleError(_0x524537,_0x15a096){_0x15a096=_0x15a096||0x1f4;return function(_0x2badd2){logger[_0x6211('0x24')](_0x2badd2[_0x6211('0x25')]);if(_0x2badd2[_0x6211('0x26')]){delete _0x2badd2[_0x6211('0x26')];}_0x524537[_0x6211('0x18')](_0x15a096)[_0x6211('0x27')](_0x2badd2);};}exports[_0x6211('0x28')]=function(_0x19a369,_0x105721){var _0x38f5f8={},_0x3564f2={},_0x26a8cc={'count':0x0,'rows':[]};var _0x20e576=_[_0x6211('0x29')](db[_0x6211('0x2a')]['rawAttributes'],function(_0x276a30){return{'name':_0x276a30[_0x6211('0x2b')],'type':_0x276a30[_0x6211('0x2c')]['key']};});_0x3564f2['model']=_[_0x6211('0x29')](_0x20e576,'name');_0x3564f2[_0x6211('0x2d')]=_[_0x6211('0x2e')](_0x19a369[_0x6211('0x2d')]);_0x3564f2['filters']=_[_0x6211('0x2f')](_0x3564f2[_0x6211('0x30')],_0x3564f2[_0x6211('0x2d')]);_0x3564f2[_0x6211('0x31')]=_[_0x6211('0x32')](_0x3564f2['filters'],['$and',_0x6211('0x33'),'$gt','$gte','$lt',_0x6211('0x34'),_0x6211('0x35'),_0x6211('0x36'),'$not',_0x6211('0x37'),'$notBetween',_0x6211('0x38'),_0x6211('0x39'),_0x6211('0x3a'),'$notLike',_0x6211('0x3b'),_0x6211('0x3c'),_0x6211('0x3a'),_0x6211('0x3d'),_0x6211('0x3e'),_0x6211('0x3f'),_0x6211('0x40')]);_0x38f5f8[_0x6211('0x41')]=_['intersection'](_0x3564f2[_0x6211('0x30')],qs[_0x6211('0x42')](_0x19a369[_0x6211('0x2d')][_0x6211('0x42')]));_0x38f5f8[_0x6211('0x41')]=_0x38f5f8['attributes'][_0x6211('0x43')]?_0x38f5f8[_0x6211('0x41')]:_0x3564f2[_0x6211('0x30')];if(!_0x19a369[_0x6211('0x2d')]['hasOwnProperty'](_0x6211('0x44'))){_0x38f5f8[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x19a369[_0x6211('0x2d')][_0x6211('0x1e')]);_0x38f5f8[_0x6211('0x1b')]=qs[_0x6211('0x1b')](_0x19a369['query'][_0x6211('0x1b')]);}_0x38f5f8['order']=qs[_0x6211('0x45')](_0x19a369[_0x6211('0x2d')]['sort']);_0x38f5f8[_0x6211('0x46')]=qs[_0x6211('0x31')](_['pick'](_0x19a369['query'],_0x3564f2['filters']),_0x20e576);if(_0x19a369[_0x6211('0x2d')][_0x6211('0x47')]){_0x38f5f8[_0x6211('0x46')]=_['merge'](_0x38f5f8[_0x6211('0x46')],{'$or':_[_0x6211('0x29')](_0x20e576,function(_0x2115af){if(_0x2115af[_0x6211('0x2c')]!==_0x6211('0x48')){var _0x476456={};_0x476456[_0x2115af[_0x6211('0x26')]]={'$like':'%'+_0x19a369[_0x6211('0x2d')]['filter']+'%'};return _0x476456;}})});}_0x38f5f8=_['merge']({},_0x38f5f8,_0x19a369[_0x6211('0x49')]);var _0x1881e1={'where':_0x38f5f8[_0x6211('0x46')]};return db[_0x6211('0x2a')][_0x6211('0x1d')](_0x1881e1)[_0x6211('0x23')](function(_0x4a3fc1){_0x26a8cc[_0x6211('0x1d')]=_0x4a3fc1;if(_0x19a369[_0x6211('0x2d')][_0x6211('0x4a')]){_0x38f5f8[_0x6211('0x4b')]=[{'all':!![]}];}return db[_0x6211('0x2a')]['findAll'](_0x38f5f8);})[_0x6211('0x23')](function(_0x54a667){_0x26a8cc[_0x6211('0x4c')]=_0x54a667;return _0x26a8cc;})['then'](respondWithFilteredResult(_0x105721,_0x38f5f8))[_0x6211('0x4d')](handleError(_0x105721,null));};exports[_0x6211('0x4e')]=function(_0x5770b0,_0x225f5f){var _0x150f41={'raw':!![],'where':{'id':_0x5770b0['params']['id']}},_0x311532={};_0x311532[_0x6211('0x30')]=_['keys'](db[_0x6211('0x2a')]['rawAttributes']);_0x311532[_0x6211('0x2d')]=_['keys'](_0x5770b0[_0x6211('0x2d')]);_0x311532[_0x6211('0x31')]=_[_0x6211('0x2f')](_0x311532[_0x6211('0x30')],_0x311532[_0x6211('0x2d')]);_0x150f41[_0x6211('0x41')]=_[_0x6211('0x2f')](_0x311532[_0x6211('0x30')],qs[_0x6211('0x42')](_0x5770b0[_0x6211('0x2d')]['fields']));_0x150f41[_0x6211('0x41')]=_0x150f41[_0x6211('0x41')][_0x6211('0x43')]?_0x150f41[_0x6211('0x41')]:_0x311532['model'];if(_0x5770b0[_0x6211('0x2d')][_0x6211('0x4a')]){_0x150f41['include']=[{'all':!![]}];}_0x150f41=_[_0x6211('0x4f')]({},_0x150f41,_0x5770b0['options']);return db['CmHopper'][_0x6211('0x50')](_0x150f41)[_0x6211('0x23')](handleEntityNotFound(_0x225f5f,null))['then'](respondWithResult(_0x225f5f,null))[_0x6211('0x4d')](handleError(_0x225f5f,null));};exports[_0x6211('0x51')]=function(_0x1c0ed2,_0x42bf11){return db[_0x6211('0x2a')]['create'](_0x1c0ed2[_0x6211('0x52')],{})[_0x6211('0x23')](respondWithResult(_0x42bf11,0xc9))[_0x6211('0x4d')](handleError(_0x42bf11,null));};exports['update']=function(_0x1b264a,_0x588ab7){if(_0x1b264a[_0x6211('0x52')]['id']){delete _0x1b264a[_0x6211('0x52')]['id'];}return db['CmHopper'][_0x6211('0x50')]({'where':{'id':_0x1b264a[_0x6211('0x53')]['id']}})['then'](handleEntityNotFound(_0x588ab7,null))[_0x6211('0x23')](saveUpdates(_0x1b264a[_0x6211('0x52')],null))[_0x6211('0x23')](respondWithResult(_0x588ab7,null))[_0x6211('0x4d')](handleError(_0x588ab7,null));};exports['describe']=function(_0x69722f,_0x294c84){return db[_0x6211('0x2a')][_0x6211('0x54')]()[_0x6211('0x23')](respondWithResult(_0x294c84,null))[_0x6211('0x4d')](handleError(_0x294c84,null));};exports[_0x6211('0x55')]=function(_0x382655,_0x596edc){var _0x17d340;return db[_0x6211('0x2a')]['find']({'where':{'id':_0x382655['params']['id']}})[_0x6211('0x23')](handleEntityNotFound(_0x596edc,null))[_0x6211('0x23')](function(_0x4375ff){if(_0x4375ff){return _0x4375ff['destroy']()[_0x6211('0x23')](function(_0x5a567e){return _0x5a567e;});}})[_0x6211('0x23')](function(_0xc79cc2){_0x17d340=_0xc79cc2;if(_0xc79cc2){if(_0xc79cc2['VoiceQueueId']||_0xc79cc2['CampaignId']){return db[_0xc79cc2[_0x6211('0x56')]?_0x6211('0x57'):_0x6211('0x58')][_0x6211('0x50')]({'where':{'id':_0xc79cc2[_0x6211('0x56')]?_0xc79cc2['VoiceQueueId']:_0xc79cc2[_0x6211('0x59')]},'attributes':['id',_0x6211('0x26')],'raw':!![]});}}})['then'](function(_0x207e1f){var _0x12067b={};if(_0x207e1f){_[_0x6211('0x4f')](_0x12067b,_[_0x6211('0x5a')](_0x17d340[_0x6211('0x5b')],['createdAt',_0x6211('0x5c'),'id']));_0x12067b[_0x6211('0x5d')]=0x15;_0x12067b[_0x6211('0x5e')]=_0x6211('0x5f');_0x12067b['campaign']=_0x207e1f[_0x6211('0x26')];_0x12067b['membername']=_0x382655[_0x6211('0x60')][_0x6211('0x26')];_0x12067b[_0x6211('0x61')]=_0x382655['user']['id'];_0x12067b[_0x6211('0x5f')]=!![];_0x12067b['deletedat']=moment()[_0x6211('0x62')](_0x6211('0x63'));_0x12067b['calleridnum']=_0x17d340[_0x6211('0x64')];_0x12067b['campaigntype']=_0x17d340[_0x6211('0x56')]?_0x6211('0x65'):_0x6211('0x66');return db[_0x6211('0x67')]['find']({'where':{'id':_0x12067b[_0x6211('0x68')]},'attributes':[_0x6211('0x69'),_0x6211('0x6a')]})[_0x6211('0x23')](function(_0x5453fd){if(!_[_0x6211('0x6b')](_0x596edc)&&!_[_0x6211('0x6b')](_0x5453fd['firstName'])){_0x12067b[_0x6211('0x6c')]=_0x5453fd[_0x6211('0x69')];if(!_[_0x6211('0x6b')](_0x5453fd[_0x6211('0x6a')])){_0x12067b[_0x6211('0x6c')]+='\x20'+_0x5453fd[_0x6211('0x6a')];}}})[_0x6211('0x6d')](function(){return db[_0x6211('0x6e')]['create'](_0x12067b);});}})[_0x6211('0x23')](function(){return _0x596edc[_0x6211('0x18')](0xcc)[_0x6211('0x19')]();})[_0x6211('0x4d')](handleError(_0x596edc,null));};exports[_0x6211('0x6f')]=function(_0x46a93e,_0x34ac44,_0x2ce016){var _0x352ad7=[];return db[_0x6211('0x67')]['describe']()['then'](function(_0x4f5117){_0x352ad7=_[_0x6211('0x2e')](_0x4f5117);return _0x46a93e['user'][_0x6211('0x70')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x6211('0x71')},'attributes':['id',_0x6211('0x72'),_0x6211('0x73')],'raw':!![]});})['then'](function(_0x102956){if(_0x102956&&_0x102956[_0x6211('0x43')]){return db[_0x6211('0x74')][_0x6211('0x75')](function(_0x144620){var _0x2fc630={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6211('0x63'))},'VoiceQueueId':{'$in':_['map'](_0x102956,'id')},'$or':[{'UserId':null},{'UserId':_0x46a93e[_0x6211('0x60')]['id']}]};var _0x4d6458={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x102956)[_0x6211('0x47')]([_0x6211('0x73'),0x0])[_0x6211('0x29')]('id')[_0x6211('0x76')]()},'$or':[{'UserId':null},{'UserId':_0x46a93e[_0x6211('0x60')]['id']}]};var _0x2148f6={'$or':[_0x2fc630,_0x4d6458]};var _0x337732=[];if(_0x46a93e[_0x6211('0x52')][_0x6211('0x77')]&&_0x46a93e[_0x6211('0x52')][_0x6211('0x77')]===_0x6211('0x78')){if(!_['isEmpty'](_0x46a93e[_0x6211('0x52')][_0x6211('0x79')])){_0x2148f6['id']={'$in':_0x46a93e['body'][_0x6211('0x79')]};}_0x337732=[[_0x6211('0x7a'),_0x6211('0x7b')],[_0x6211('0x7c'),_0x102956[0x0][_0x6211('0x72')]===_0x6211('0x7b')?_0x6211('0x7d'):_0x6211('0x7b')],db['sequelize'][_0x6211('0x7e')](_0x6211('0x7f')),['id',_0x6211('0x7d')]];}else{if(!_['isEmpty'](_0x46a93e['body'][_0x6211('0x79')])){_0x2148f6['id']={'$notIn':_0x46a93e[_0x6211('0x52')][_0x6211('0x79')]};}_0x337732=[['priority',_0x6211('0x7d')],[_0x6211('0x7c'),_0x102956[0x0][_0x6211('0x72')]],db[_0x6211('0x74')][_0x6211('0x7e')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x6211('0x7b')]];}return db[_0x6211('0x2a')]['findOne']({'attributes':['id',_0x6211('0x80'),'recallme'],'where':_0x2148f6,'order':_0x337732,'transaction':_0x144620,'lock':_0x144620[_0x6211('0x81')]['UPDATE'],'include':[{'model':db[_0x6211('0x67')],'as':_0x6211('0x82'),'attributes':_0x352ad7,'include':[{'model':db[_0x6211('0x83')],'as':_0x6211('0x84'),'attributes':['id',_0x6211('0x26')]}]},{'model':db['CmList'],'as':_0x6211('0x85'),'attributes':['id',_0x6211('0x26')]},{'model':db['VoiceQueue'],'as':_0x6211('0x86'),'attributes':['id',_0x6211('0x26'),_0x6211('0x87')]}]})[_0x6211('0x23')](function(_0x399ab9){if(_0x399ab9){return _0x399ab9[_0x6211('0x22')]({'UserId':_0x46a93e[_0x6211('0x60')]['id']},{'transaction':_0x144620});}});});}})['then'](handleEntityNotFound(_0x34ac44,null))[_0x6211('0x23')](respondWithResult(_0x34ac44,null))[_0x6211('0x4d')](handleError(_0x34ac44,null));};exports[_0x6211('0x88')]=function(_0x11211c,_0x5ee285,_0x86ae7c){return _0x11211c[_0x6211('0x60')]['getVoiceQueues']({'where':{'type':_0x6211('0x89'),'dialActive':!![],'dialMethod':_0x6211('0x71')},'attributes':['id'],'raw':!![]})['then'](function(_0x5c77f1){if(_0x5c77f1&&_0x5c77f1[_0x6211('0x43')]){return db['CmHopper'][_0x6211('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6211('0x62')](_0x6211('0x63'))},'VoiceQueueId':{'$in':_[_0x6211('0x29')](_0x5c77f1,'id')},'$or':[{'UserId':null},{'UserId':_0x11211c['user']['id']}]}});}return 0x0;})[_0x6211('0x23')](function(_0x23f947){if(!_['isNil'](_0x23f947)&&_['isNumber'](_0x23f947)){return _0x5ee285[_0x6211('0x18')](0xc8)[_0x6211('0x1a')]({'contacts':_0x23f947});}else{logger[_0x6211('0x24')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x6211('0x8a'));_0x5ee285['sendStatus'](0x194);}})[_0x6211('0x4d')](handleError(_0x5ee285,null));};
\ No newline at end of file
index 59a95ca..d87e335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x189889,_0x4aed12){var _0x1fce4d=function(_0xcdbfff){while(--_0xcdbfff){_0x189889['push'](_0x189889['shift']());}};_0x1fce4d(++_0x4aed12);}(_0xfcf0,0x138));var _0x0fcf=function(_0x34c027,_0x123688){_0x34c027=_0x34c027-0x0;var _0x47bff0=_0xfcf0[_0x34c027];return _0x47bff0;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['define','CmHopper','cm_hopper','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./cmHopper.attributes','exports'];(function(_0xd12ae,_0x120dc9){var _0x241497=function(_0x2c92fa){while(--_0x2c92fa){_0xd12ae['push'](_0xd12ae['shift']());}};_0x241497(++_0x120dc9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0xac4a('0xc'),'fields':[_0xac4a('0xc')]},{'name':_0xac4a('0xd'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
index 04b0138..736cff8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5af7=['../../config/environment','jayson/promise','http','request','then','CmHopper,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','GetCmHopper','CmHopper','options','raw','attributes','limit','include','map','model','info','stringify','ShowCmHopper','where','CreateCmHopper','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','sequelize','transaction','order','CmContact','Contact','keys','Agent','name','length','UserId','push','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','findAll','literal','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','LOCK','UPDATE','all','GetCmHopperPreview','lodash','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x17aa7a,_0x2be8e4){var _0x2321f8=function(_0x2324fc){while(--_0x2324fc){_0x17aa7a['push'](_0x17aa7a['shift']());}};_0x2321f8(++_0x2be8e4);}(_0x5af7,0x1bb));var _0x75af=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x5af7[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x75af('0x0'));var util=require('util');var moment=require(_0x75af('0x1'));var BPromise=require('bluebird');var rs=require(_0x75af('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75af('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x75af('0x4'))('rpc');var config=require(_0x75af('0x5'));var jayson=require(_0x75af('0x6'));var client=jayson['client'][_0x75af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3af2db,_0x27dd86,_0x5a4172){return new BPromise(function(_0x2b5f70,_0x189c40){return client[_0x75af('0x8')](_0x3af2db,_0x5a4172)[_0x75af('0x9')](function(_0x49bb20){logger['info'](_0x75af('0xa'),_0x27dd86,'request\x20sent');logger[_0x75af('0xb')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x27dd86,_0x75af('0xc'),JSON['stringify'](_0x49bb20));if(_0x49bb20[_0x75af('0xd')]){if(_0x49bb20['error'][_0x75af('0xe')]===0x1f4){logger[_0x75af('0xd')](_0x75af('0xa'),_0x27dd86,_0x49bb20[_0x75af('0xd')][_0x75af('0xf')]);return _0x189c40(_0x49bb20[_0x75af('0xd')]['message']);}logger['error'](_0x75af('0xa'),_0x27dd86,_0x49bb20[_0x75af('0xd')][_0x75af('0xf')]);return _0x2b5f70(_0x49bb20[_0x75af('0xd')]['message']);}else{logger['info'](_0x75af('0xa'),_0x27dd86,_0x75af('0xc'));_0x2b5f70(_0x49bb20['result']['message']);}})[_0x75af('0x10')](function(_0x4c16a2){logger['error'](_0x75af('0xa'),_0x27dd86,_0x4c16a2);_0x189c40(_0x4c16a2);});});}exports[_0x75af('0x11')]=function(_0xf01890){var _0x148477=this;return new Promise(function(_0x6ad72d,_0x3f0556){return db[_0x75af('0x12')]['findAll']({'raw':_0xf01890[_0x75af('0x13')]?_0xf01890[_0x75af('0x13')][_0x75af('0x14')]===undefined?!![]:![]:!![],'where':_0xf01890['options']?_0xf01890['options']['where']||null:null,'attributes':_0xf01890[_0x75af('0x13')]?_0xf01890[_0x75af('0x13')][_0x75af('0x15')]||null:null,'limit':_0xf01890['options']?_0xf01890[_0x75af('0x13')][_0x75af('0x16')]||null:null,'include':_0xf01890[_0x75af('0x13')]?_0xf01890[_0x75af('0x13')][_0x75af('0x17')]?_[_0x75af('0x18')](_0xf01890['options'][_0x75af('0x17')],function(_0x1ceaa5){return{'model':db[_0x1ceaa5[_0x75af('0x19')]],'as':_0x1ceaa5['as'],'attributes':_0x1ceaa5[_0x75af('0x15')],'include':_0x1ceaa5['include']?_[_0x75af('0x18')](_0x1ceaa5[_0x75af('0x17')],function(_0x68c3c6){return{'model':db[_0x68c3c6['model']],'as':_0x68c3c6['as'],'attributes':_0x68c3c6[_0x75af('0x15')],'include':_0x68c3c6[_0x75af('0x17')]?_[_0x75af('0x18')](_0x68c3c6[_0x75af('0x17')],function(_0x2cb67a){return{'model':db[_0x2cb67a[_0x75af('0x19')]],'as':_0x2cb67a['as'],'attributes':_0x2cb67a[_0x75af('0x15')]};}):[]};}):[]};}):[]:[]})[_0x75af('0x9')](function(_0x2af440){logger[_0x75af('0x1a')](_0x75af('0x11'),_0xf01890);logger[_0x75af('0xb')](_0x75af('0x11'),_0xf01890,JSON[_0x75af('0x1b')](_0x2af440));_0x6ad72d(_0x2af440);})[_0x75af('0x10')](function(_0xc17903){logger['error'](_0x75af('0x11'),_0xc17903[_0x75af('0xf')],_0xf01890);_0x3f0556(_0x148477['error'](0x1f4,_0xc17903['message']));});});};exports[_0x75af('0x1c')]=function(_0x32707d){var _0xd27453=this;return new Promise(function(_0x3798f8,_0xd006ad){return db[_0x75af('0x12')]['find']({'raw':_0x32707d[_0x75af('0x13')]?_0x32707d[_0x75af('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x32707d[_0x75af('0x13')]?_0x32707d[_0x75af('0x13')][_0x75af('0x1d')]||null:null,'attributes':_0x32707d[_0x75af('0x13')]?_0x32707d[_0x75af('0x13')][_0x75af('0x15')]||null:null,'include':_0x32707d[_0x75af('0x13')]?_0x32707d['options'][_0x75af('0x17')]?_[_0x75af('0x18')](_0x32707d[_0x75af('0x13')]['include'],function(_0x114841){return{'model':db[_0x114841['model']],'as':_0x114841['as'],'attributes':_0x114841[_0x75af('0x15')],'include':_0x114841['include']?_[_0x75af('0x18')](_0x114841['include'],function(_0x1e814f){return{'model':db[_0x1e814f[_0x75af('0x19')]],'as':_0x1e814f['as'],'attributes':_0x1e814f[_0x75af('0x15')],'include':_0x1e814f[_0x75af('0x17')]?_[_0x75af('0x18')](_0x1e814f['include'],function(_0xf56118){return{'model':db[_0xf56118[_0x75af('0x19')]],'as':_0xf56118['as'],'attributes':_0xf56118[_0x75af('0x15')]};}):[]};}):[]};}):[]:[]})[_0x75af('0x9')](function(_0x3c23b4){logger[_0x75af('0x1a')](_0x75af('0x1c'),_0x32707d);logger['debug'](_0x75af('0x1c'),_0x32707d,JSON[_0x75af('0x1b')](_0x3c23b4));_0x3798f8(_0x3c23b4);})[_0x75af('0x10')](function(_0x29f288){logger['error'](_0x75af('0x1c'),_0x29f288['message'],_0x32707d);_0xd006ad(_0xd27453['error'](0x1f4,_0x29f288[_0x75af('0xf')]));});});};exports[_0x75af('0x1e')]=function(_0xd8f5f3){var _0x16ea64=this;return new Promise(function(_0x37206f,_0x33dc09){return db['CmHopper']['create'](_0xd8f5f3[_0x75af('0x1f')],{'raw':_0xd8f5f3[_0x75af('0x13')]?_0xd8f5f3['options'][_0x75af('0x14')]===undefined?!![]:![]:!![]})[_0x75af('0x9')](function(_0x1d1e85){logger[_0x75af('0x1a')]('CreateCmHopper',_0xd8f5f3);logger[_0x75af('0xb')]('CreateCmHopper',_0xd8f5f3,JSON[_0x75af('0x1b')](_0x1d1e85));_0x37206f(_0x1d1e85);})[_0x75af('0x10')](function(_0x1a4b56){logger[_0x75af('0xd')]('CreateCmHopper',_0x1a4b56[_0x75af('0xf')],_0xd8f5f3);_0x33dc09(_0x16ea64['error'](0x1f4,_0x1a4b56['message']));});});};exports[_0x75af('0x20')]=function(_0x3b066c){var _0x5723ea=this;return new Promise(function(_0x5240c3,_0x5be976){return db[_0x75af('0x12')][_0x75af('0x21')](_0x3b066c['body'],{'raw':_0x3b066c[_0x75af('0x13')]?_0x3b066c[_0x75af('0x13')][_0x75af('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b066c['options']?_0x3b066c[_0x75af('0x13')][_0x75af('0x1d')]||null:null,'attributes':_0x3b066c[_0x75af('0x13')]?_0x3b066c[_0x75af('0x13')]['attributes']||null:null,'limit':_0x3b066c['options']?_0x3b066c[_0x75af('0x13')]['limit']||null:null})[_0x75af('0x9')](function(_0x278026){logger[_0x75af('0x1a')](_0x75af('0x20'),_0x3b066c);logger[_0x75af('0xb')](_0x75af('0x20'),_0x3b066c,JSON[_0x75af('0x1b')](_0x278026));_0x5240c3(_0x278026);})[_0x75af('0x10')](function(_0x1c2955){logger[_0x75af('0xd')](_0x75af('0x20'),_0x1c2955[_0x75af('0xf')],_0x3b066c);_0x5be976(_0x5723ea[_0x75af('0xd')](0x1f4,_0x1c2955[_0x75af('0xf')]));});});};exports[_0x75af('0x22')]=function(_0x5cf013){var _0xa20709=this;return new Promise(function(_0x119ded,_0x34bb88){return db[_0x75af('0x12')]['destroy']({'where':_0x5cf013[_0x75af('0x13')]?_0x5cf013[_0x75af('0x13')]['where']||null:null})[_0x75af('0x9')](function(_0x58ebf8){logger['info'](_0x75af('0x22'),_0x5cf013);logger[_0x75af('0xb')](_0x75af('0x22'),_0x5cf013,JSON[_0x75af('0x1b')](_0x58ebf8));_0x119ded(_0x58ebf8);})[_0x75af('0x10')](function(_0x5874e3){logger[_0x75af('0xd')](_0x75af('0x22'),_0x5874e3['message'],_0x5cf013);_0x34bb88(_0xa20709['error'](0x1f4,_0x5874e3[_0x75af('0xf')]));});});};exports[_0x75af('0x23')]=function(_0x4e0ecc){var _0x1cde1d=this;return new Promise(function(_0x5142d8,_0x128287){return db['CmContact']['describe']()[_0x75af('0x9')](function(_0x14a448){return db[_0x75af('0x24')][_0x75af('0x25')](function(_0x56a994){return db[_0x75af('0x12')]['findAll']({'where':_0x4e0ecc[_0x75af('0x13')]?_0x4e0ecc[_0x75af('0x13')][_0x75af('0x1d')]||null:null,'attributes':_0x4e0ecc[_0x75af('0x13')]?_0x4e0ecc['options'][_0x75af('0x15')]||null:null,'limit':_0x4e0ecc[_0x75af('0x13')]?_0x4e0ecc['options']['limit']||null:null,'order':_0x4e0ecc[_0x75af('0x13')]?_0x4e0ecc[_0x75af('0x13')][_0x75af('0x26')]||null:null,'transaction':_0x56a994,'lock':_0x56a994['LOCK']['UPDATE'],'include':[{'model':db[_0x75af('0x27')],'as':_0x75af('0x28'),'attributes':_[_0x75af('0x29')](_0x14a448)},{'model':db['User'],'as':_0x75af('0x2a'),'attributes':['id',_0x75af('0x2b'),'voicePause']}]})['then'](function(_0x102614){var _0x48c019=[];var _0x46a3bd=[];for(var _0x5c18f9=0x0;_0x5c18f9<_0x102614[_0x75af('0x2c')];_0x5c18f9+=0x1){var _0x487f1c=_0x102614[_0x5c18f9][_0x75af('0x2d')];if(_0x487f1c===null){_0x48c019[_0x75af('0x2e')](_0x102614[_0x5c18f9][_0x75af('0x21')](_0x4e0ecc[_0x75af('0x1f')],{'transaction':_0x56a994}));}else if(!_0x46a3bd['includes'](_0x487f1c)){_0x46a3bd[_0x75af('0x2e')](_0x487f1c);_0x48c019['push'](_0x102614[_0x5c18f9][_0x75af('0x21')](_0x4e0ecc[_0x75af('0x1f')],{'transaction':_0x56a994}));}}return BPromise['all'](_0x48c019);});})['then'](function(_0x123ef5){logger['info'](_0x75af('0x23'),_0x4e0ecc);logger[_0x75af('0xb')](_0x75af('0x23'),_0x4e0ecc,JSON[_0x75af('0x1b')](_0x123ef5));_0x5142d8(_0x123ef5);})['catch'](function(_0x1b96ab){logger[_0x75af('0xd')](_0x75af('0x23'),_0x1b96ab[_0x75af('0xf')],_0x4e0ecc);_0x128287(_0x1cde1d[_0x75af('0xd')](0x1f4,_0x1b96ab[_0x75af('0xf')]));});});});};exports[_0x75af('0x2f')]=function(_0x4de0e3){var _0x5b58ee=this;return new Promise(function(_0x2e2681,_0x1e943e){return db[_0x75af('0x24')][_0x75af('0x25')](function(_0x3aa965){return db[_0x75af('0x30')][_0x75af('0x31')](_0x4de0e3[_0x75af('0x1f')],{'raw':_0x4de0e3['options']?_0x4de0e3['options'][_0x75af('0x14')]===undefined?!![]:![]:!![],'transaction':_0x3aa965})[_0x75af('0x9')](function(){return db[_0x75af('0x12')]['destroy']({'where':_0x4de0e3['options']?_0x4de0e3[_0x75af('0x13')][_0x75af('0x1d')]||null:null,'transaction':_0x3aa965});});})[_0x75af('0x9')](function(_0x1a6af6){logger[_0x75af('0x1a')]('MoveContactManagedDialer',_0x4de0e3);logger['debug'](_0x75af('0x2f'),_0x4de0e3,JSON[_0x75af('0x1b')](_0x1a6af6));_0x2e2681(_0x1a6af6);})[_0x75af('0x10')](function(_0x20c43f){logger[_0x75af('0xd')](_0x75af('0x2f'),_0x20c43f[_0x75af('0xf')],_0x4de0e3);_0x1e943e(_0x5b58ee[_0x75af('0xd')](0x1f4,_0x20c43f[_0x75af('0xf')]));});});};exports[_0x75af('0x32')]=function(_0x1aa1be){var _0x33b365=this;return new Promise(function(_0x40b0b6,_0x311e95){return db[_0x75af('0x12')][_0x75af('0x33')]({'raw':_0x1aa1be[_0x75af('0x13')]?_0x1aa1be[_0x75af('0x13')][_0x75af('0x14')]===undefined?!![]:![]:!![],'where':_0x1aa1be[_0x75af('0x13')]?_0x1aa1be[_0x75af('0x13')][_0x75af('0x1d')]||null:null,'attributes':[[db[_0x75af('0x24')]['fn']('COUNT',db[_0x75af('0x24')]['fn']('IF',db[_0x75af('0x24')][_0x75af('0x34')](_0x75af('0x35')+util['format'](_0x75af('0x36'),moment()['format'](_0x75af('0x37')))+_0x75af('0x38')))),_0x75af('0x39')]]})[_0x75af('0x9')](function(_0x191141){logger[_0x75af('0x1a')]('CountReScheduled',_0x1aa1be);logger[_0x75af('0xb')](_0x75af('0x32'),_0x1aa1be,JSON[_0x75af('0x1b')](_0x191141));_0x40b0b6(_0x191141);})[_0x75af('0x10')](function(_0x42524e){logger[_0x75af('0xd')](_0x75af('0x32'),_0x42524e[_0x75af('0xf')],_0x1aa1be);_0x311e95(_0x33b365[_0x75af('0xd')](0x1f4,_0x42524e['message']));});});};exports[_0x75af('0x3a')]=function(_0x25c091){var _0x1aa5ae=this;return new Promise(function(_0x5062e2,_0x45e4ee){return db[_0x75af('0x27')][_0x75af('0x3b')]()[_0x75af('0x9')](function(_0x808d01){return db['sequelize'][_0x75af('0x25')](function(_0x1d6886){return db['CmHopper'][_0x75af('0x33')]({'where':_0x25c091['options']?_0x25c091['options'][_0x75af('0x1d')]||null:null,'attributes':_0x25c091[_0x75af('0x13')]?_0x25c091['options'][_0x75af('0x15')]||null:null,'limit':0x1,'order':_0x25c091[_0x75af('0x13')]?_0x25c091[_0x75af('0x13')]['order']||null:null,'group':db[_0x75af('0x12')]['UserId'],'transaction':_0x1d6886,'lock':_0x1d6886[_0x75af('0x3c')][_0x75af('0x3d')],'include':_0x25c091[_0x75af('0x13')]?_0x25c091['options'][_0x75af('0x17')]?_[_0x75af('0x18')](_0x25c091['options'][_0x75af('0x17')],function(_0x30517b){return{'model':db[_0x30517b['model']],'as':_0x30517b['as'],'attributes':_0x30517b['attributes'],'include':_0x30517b[_0x75af('0x17')]?_[_0x75af('0x18')](_0x30517b[_0x75af('0x17')],function(_0x5d9b0e){return{'model':db[_0x5d9b0e['model']],'as':_0x5d9b0e['as'],'attributes':_0x5d9b0e[_0x75af('0x15')],'include':_0x5d9b0e[_0x75af('0x17')]?_[_0x75af('0x18')](_0x5d9b0e['include'],function(_0x4e6d20){return{'model':db[_0x4e6d20[_0x75af('0x19')]],'as':_0x4e6d20['as'],'attributes':_0x4e6d20[_0x75af('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34a0e5){var _0x491951=[];for(var _0x1f8df0=0x0;_0x1f8df0<_0x34a0e5[_0x75af('0x2c')];_0x1f8df0+=0x1){_0x491951[_0x75af('0x2e')](_0x34a0e5[_0x1f8df0][_0x75af('0x21')](_0x25c091['body'],{'transaction':_0x1d6886}));}return BPromise[_0x75af('0x3e')](_0x491951);});})[_0x75af('0x9')](function(_0x462502){logger[_0x75af('0x1a')](_0x75af('0x3a'),_0x25c091);logger[_0x75af('0xb')](_0x75af('0x3a'),_0x25c091,JSON['stringify'](_0x462502));_0x5062e2(_0x462502);})[_0x75af('0x10')](function(_0x2eedf3){logger[_0x75af('0xd')](_0x75af('0x3a'),_0x2eedf3[_0x75af('0xf')],_0x25c091);_0x45e4ee(_0x1aa5ae['error'](0x1f4,_0x2eedf3[_0x75af('0xf')]));});});});};exports[_0x75af('0x3f')]=function(_0x407899){var _0x20ef96=this;return new Promise(function(_0x56d23e,_0x37fd24){db[_0x75af('0x27')][_0x75af('0x3b')]()[_0x75af('0x9')](function(_0xffcab1){return db[_0x75af('0x12')][_0x75af('0x33')]({'raw':_0x407899[_0x75af('0x13')]?_0x407899[_0x75af('0x13')][_0x75af('0x14')]===undefined?!![]:![]:!![],'where':_0x407899[_0x75af('0x13')]?_0x407899[_0x75af('0x13')][_0x75af('0x1d')]||null:null,'attributes':_0x407899['options']?_0x407899[_0x75af('0x13')][_0x75af('0x15')]||null:null,'limit':_0x407899[_0x75af('0x13')]?_0x407899[_0x75af('0x13')][_0x75af('0x16')]||null:null,'include':_0x407899[_0x75af('0x13')]?_0x407899[_0x75af('0x13')][_0x75af('0x17')]?_['map'](_0x407899[_0x75af('0x13')][_0x75af('0x17')],function(_0x3087a4){return{'model':db[_0x3087a4[_0x75af('0x19')]],'as':_0x3087a4['as'],'attributes':_0x3087a4['as']==='Contact'?_[_0x75af('0x29')](_0xffcab1):_0x3087a4[_0x75af('0x15')],'include':_0x3087a4[_0x75af('0x17')]?_[_0x75af('0x18')](_0x3087a4[_0x75af('0x17')],function(_0x26d2a7){return{'model':db[_0x26d2a7[_0x75af('0x19')]],'as':_0x26d2a7['as'],'attributes':_0x26d2a7[_0x75af('0x15')],'include':_0x26d2a7[_0x75af('0x17')]?_['map'](_0x26d2a7[_0x75af('0x17')],function(_0x108f4c){return{'model':db[_0x108f4c[_0x75af('0x19')]],'as':_0x108f4c['as'],'attributes':_0x108f4c[_0x75af('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49fa57){logger[_0x75af('0x1a')]('GetCmHopper',_0x407899);logger['debug']('GetCmHopper',_0x407899,JSON[_0x75af('0x1b')](_0x49fa57));_0x56d23e(_0x49fa57);})[_0x75af('0x10')](function(_0x5a7d75){logger[_0x75af('0xd')](_0x75af('0x11'),_0x5a7d75['message'],_0x407899);_0x37fd24(_0x20ef96['error'](0x1f4,_0x5a7d75[_0x75af('0xf')]));});});});};
\ No newline at end of file
+var _0x7ce5=['order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','push','includes','update','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','length','GetCmHopperPreview','describe','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','message','catch','GetCmHopper','findAll','options','attributes','limit','include','map','model','stringify','ShowCmHopper','CmHopper','find','where','debug','create','body','raw','CreateCmHopper','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','sequelize','transaction'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x7ce5,0x1c6));var _0x57ce=function(_0x2566d3,_0x402f30){_0x2566d3=_0x2566d3-0x0;var _0x3186d0=_0x7ce5[_0x2566d3];return _0x3186d0;};'use strict';var _=require(_0x57ce('0x0'));var util=require('util');var moment=require(_0x57ce('0x1'));var BPromise=require(_0x57ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57ce('0x3'));var db=require(_0x57ce('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x57ce('0x5'))(_0x57ce('0x6'));var config=require('../../config/environment');var jayson=require(_0x57ce('0x7'));var client=jayson[_0x57ce('0x8')][_0x57ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1366de,_0x588b46,_0x1ccdd4){return new BPromise(function(_0x30f95c,_0x59c7d4){return client[_0x57ce('0xa')](_0x1366de,_0x1ccdd4)[_0x57ce('0xb')](function(_0x3b1b34){logger[_0x57ce('0xc')](_0x57ce('0xd'),_0x588b46,_0x57ce('0xe'));logger['debug'](_0x57ce('0xf'),_0x588b46,_0x57ce('0xe'),JSON['stringify'](_0x3b1b34));if(_0x3b1b34[_0x57ce('0x10')]){if(_0x3b1b34[_0x57ce('0x10')]['code']===0x1f4){logger[_0x57ce('0x10')](_0x57ce('0xd'),_0x588b46,_0x3b1b34[_0x57ce('0x10')]['message']);return _0x59c7d4(_0x3b1b34['error']['message']);}logger['error']('CmHopper,\x20%s,\x20%s',_0x588b46,_0x3b1b34['error'][_0x57ce('0x11')]);return _0x30f95c(_0x3b1b34[_0x57ce('0x10')]['message']);}else{logger[_0x57ce('0xc')](_0x57ce('0xd'),_0x588b46,_0x57ce('0xe'));_0x30f95c(_0x3b1b34['result'][_0x57ce('0x11')]);}})[_0x57ce('0x12')](function(_0x593083){logger[_0x57ce('0x10')]('CmHopper,\x20%s,\x20%s',_0x588b46,_0x593083);_0x59c7d4(_0x593083);});});}exports[_0x57ce('0x13')]=function(_0x55d5e5){var _0x56ba1d=this;return new Promise(function(_0x3503de,_0x1fc79a){return db['CmHopper'][_0x57ce('0x14')]({'raw':_0x55d5e5['options']?_0x55d5e5['options']['raw']===undefined?!![]:![]:!![],'where':_0x55d5e5['options']?_0x55d5e5[_0x57ce('0x15')]['where']||null:null,'attributes':_0x55d5e5[_0x57ce('0x15')]?_0x55d5e5['options'][_0x57ce('0x16')]||null:null,'limit':_0x55d5e5[_0x57ce('0x15')]?_0x55d5e5[_0x57ce('0x15')][_0x57ce('0x17')]||null:null,'include':_0x55d5e5[_0x57ce('0x15')]?_0x55d5e5[_0x57ce('0x15')][_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x55d5e5[_0x57ce('0x15')][_0x57ce('0x18')],function(_0x39a432){return{'model':db[_0x39a432[_0x57ce('0x1a')]],'as':_0x39a432['as'],'attributes':_0x39a432[_0x57ce('0x16')],'include':_0x39a432[_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x39a432['include'],function(_0x5d60a8){return{'model':db[_0x5d60a8[_0x57ce('0x1a')]],'as':_0x5d60a8['as'],'attributes':_0x5d60a8[_0x57ce('0x16')],'include':_0x5d60a8['include']?_[_0x57ce('0x19')](_0x5d60a8[_0x57ce('0x18')],function(_0x2969d4){return{'model':db[_0x2969d4[_0x57ce('0x1a')]],'as':_0x2969d4['as'],'attributes':_0x2969d4[_0x57ce('0x16')]};}):[]};}):[]};}):[]:[]})[_0x57ce('0xb')](function(_0x19f74a){logger[_0x57ce('0xc')](_0x57ce('0x13'),_0x55d5e5);logger['debug'](_0x57ce('0x13'),_0x55d5e5,JSON[_0x57ce('0x1b')](_0x19f74a));_0x3503de(_0x19f74a);})[_0x57ce('0x12')](function(_0x393f96){logger['error'](_0x57ce('0x13'),_0x393f96[_0x57ce('0x11')],_0x55d5e5);_0x1fc79a(_0x56ba1d['error'](0x1f4,_0x393f96['message']));});});};exports[_0x57ce('0x1c')]=function(_0x44ee19){var _0x423459=this;return new Promise(function(_0x29efca,_0x1d9b63){return db[_0x57ce('0x1d')][_0x57ce('0x1e')]({'raw':_0x44ee19[_0x57ce('0x15')]?_0x44ee19['options']['raw']===undefined?!![]:![]:!![],'where':_0x44ee19[_0x57ce('0x15')]?_0x44ee19['options'][_0x57ce('0x1f')]||null:null,'attributes':_0x44ee19[_0x57ce('0x15')]?_0x44ee19[_0x57ce('0x15')][_0x57ce('0x16')]||null:null,'include':_0x44ee19[_0x57ce('0x15')]?_0x44ee19['options'][_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x44ee19[_0x57ce('0x15')][_0x57ce('0x18')],function(_0x781a2){return{'model':db[_0x781a2[_0x57ce('0x1a')]],'as':_0x781a2['as'],'attributes':_0x781a2['attributes'],'include':_0x781a2[_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x781a2[_0x57ce('0x18')],function(_0x54e922){return{'model':db[_0x54e922[_0x57ce('0x1a')]],'as':_0x54e922['as'],'attributes':_0x54e922[_0x57ce('0x16')],'include':_0x54e922[_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x54e922[_0x57ce('0x18')],function(_0x409ff0){return{'model':db[_0x409ff0[_0x57ce('0x1a')]],'as':_0x409ff0['as'],'attributes':_0x409ff0['attributes']};}):[]};}):[]};}):[]:[]})[_0x57ce('0xb')](function(_0x18fc27){logger['info'](_0x57ce('0x1c'),_0x44ee19);logger[_0x57ce('0x20')](_0x57ce('0x1c'),_0x44ee19,JSON[_0x57ce('0x1b')](_0x18fc27));_0x29efca(_0x18fc27);})[_0x57ce('0x12')](function(_0x145fd5){logger[_0x57ce('0x10')](_0x57ce('0x1c'),_0x145fd5['message'],_0x44ee19);_0x1d9b63(_0x423459[_0x57ce('0x10')](0x1f4,_0x145fd5[_0x57ce('0x11')]));});});};exports['CreateCmHopper']=function(_0x12e7a6){var _0x5e8edc=this;return new Promise(function(_0x5a8dbd,_0x587a7b){return db[_0x57ce('0x1d')][_0x57ce('0x21')](_0x12e7a6[_0x57ce('0x22')],{'raw':_0x12e7a6[_0x57ce('0x15')]?_0x12e7a6[_0x57ce('0x15')][_0x57ce('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x41fa76){logger[_0x57ce('0xc')](_0x57ce('0x24'),_0x12e7a6);logger[_0x57ce('0x20')](_0x57ce('0x24'),_0x12e7a6,JSON[_0x57ce('0x1b')](_0x41fa76));_0x5a8dbd(_0x41fa76);})[_0x57ce('0x12')](function(_0x453cbd){logger[_0x57ce('0x10')](_0x57ce('0x24'),_0x453cbd[_0x57ce('0x11')],_0x12e7a6);_0x587a7b(_0x5e8edc[_0x57ce('0x10')](0x1f4,_0x453cbd[_0x57ce('0x11')]));});});};exports['UpdateCmHopper']=function(_0x1e705a){var _0x1718e2=this;return new Promise(function(_0x56708b,_0x353f06){return db[_0x57ce('0x1d')]['update'](_0x1e705a[_0x57ce('0x22')],{'raw':_0x1e705a['options']?_0x1e705a[_0x57ce('0x15')][_0x57ce('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e705a[_0x57ce('0x15')]?_0x1e705a[_0x57ce('0x15')][_0x57ce('0x1f')]||null:null,'attributes':_0x1e705a[_0x57ce('0x15')]?_0x1e705a[_0x57ce('0x15')][_0x57ce('0x16')]||null:null,'limit':_0x1e705a[_0x57ce('0x15')]?_0x1e705a[_0x57ce('0x15')][_0x57ce('0x17')]||null:null})['then'](function(_0x39440c){logger[_0x57ce('0xc')](_0x57ce('0x25'),_0x1e705a);logger['debug'](_0x57ce('0x25'),_0x1e705a,JSON[_0x57ce('0x1b')](_0x39440c));_0x56708b(_0x39440c);})[_0x57ce('0x12')](function(_0x131bc8){logger[_0x57ce('0x10')](_0x57ce('0x25'),_0x131bc8[_0x57ce('0x11')],_0x1e705a);_0x353f06(_0x1718e2[_0x57ce('0x10')](0x1f4,_0x131bc8[_0x57ce('0x11')]));});});};exports[_0x57ce('0x26')]=function(_0x39caca){var _0x1ea32c=this;return new Promise(function(_0x60f3f8,_0xbb84c8){return db['CmHopper'][_0x57ce('0x27')]({'where':_0x39caca[_0x57ce('0x15')]?_0x39caca[_0x57ce('0x15')][_0x57ce('0x1f')]||null:null})[_0x57ce('0xb')](function(_0x4d12ac){logger['info'](_0x57ce('0x26'),_0x39caca);logger[_0x57ce('0x20')]('DestroyCmHopper',_0x39caca,JSON[_0x57ce('0x1b')](_0x4d12ac));_0x60f3f8(_0x4d12ac);})[_0x57ce('0x12')](function(_0x152a2b){logger[_0x57ce('0x10')]('DestroyCmHopper',_0x152a2b['message'],_0x39caca);_0xbb84c8(_0x1ea32c['error'](0x1f4,_0x152a2b[_0x57ce('0x11')]));});});};exports[_0x57ce('0x28')]=function(_0x4f1cf6){var _0x10f574=this;return new Promise(function(_0x6295fb,_0x182871){return db['CmContact']['describe']()['then'](function(_0x4c3787){return db[_0x57ce('0x29')][_0x57ce('0x2a')](function(_0x33dba7){return db[_0x57ce('0x1d')]['findAll']({'where':_0x4f1cf6[_0x57ce('0x15')]?_0x4f1cf6[_0x57ce('0x15')][_0x57ce('0x1f')]||null:null,'attributes':_0x4f1cf6[_0x57ce('0x15')]?_0x4f1cf6['options'][_0x57ce('0x16')]||null:null,'limit':_0x4f1cf6[_0x57ce('0x15')]?_0x4f1cf6[_0x57ce('0x15')][_0x57ce('0x17')]||null:null,'order':_0x4f1cf6[_0x57ce('0x15')]?_0x4f1cf6['options'][_0x57ce('0x2b')]||null:null,'transaction':_0x33dba7,'lock':_0x33dba7[_0x57ce('0x2c')][_0x57ce('0x2d')],'include':[{'model':db[_0x57ce('0x2e')],'as':_0x57ce('0x2f'),'attributes':_[_0x57ce('0x30')](_0x4c3787)},{'model':db[_0x57ce('0x31')],'as':_0x57ce('0x32'),'attributes':['id',_0x57ce('0x33'),_0x57ce('0x34')]}]})[_0x57ce('0xb')](function(_0x2022bb){var _0x40795f=[];var _0x2b08f1=[];for(var _0x281bae=0x0;_0x281bae<_0x2022bb['length'];_0x281bae+=0x1){var _0x103677=_0x2022bb[_0x281bae]['UserId'];if(_0x103677===null){_0x40795f[_0x57ce('0x35')](_0x2022bb[_0x281bae]['update'](_0x4f1cf6[_0x57ce('0x22')],{'transaction':_0x33dba7}));}else if(!_0x2b08f1[_0x57ce('0x36')](_0x103677)){_0x2b08f1[_0x57ce('0x35')](_0x103677);_0x40795f[_0x57ce('0x35')](_0x2022bb[_0x281bae][_0x57ce('0x37')](_0x4f1cf6['body'],{'transaction':_0x33dba7}));}}return BPromise[_0x57ce('0x38')](_0x40795f);});})[_0x57ce('0xb')](function(_0x20f843){logger[_0x57ce('0xc')](_0x57ce('0x28'),_0x4f1cf6);logger[_0x57ce('0x20')](_0x57ce('0x28'),_0x4f1cf6,JSON[_0x57ce('0x1b')](_0x20f843));_0x6295fb(_0x20f843);})[_0x57ce('0x12')](function(_0x1eec8e){logger[_0x57ce('0x10')](_0x57ce('0x28'),_0x1eec8e[_0x57ce('0x11')],_0x4f1cf6);_0x182871(_0x10f574[_0x57ce('0x10')](0x1f4,_0x1eec8e[_0x57ce('0x11')]));});});});};exports[_0x57ce('0x39')]=function(_0x37bfb3){var _0x120037=this;return new Promise(function(_0x5a5da8,_0x5c3a67){return db['sequelize']['transaction'](function(_0x1ecd9a){return db[_0x57ce('0x3a')]['create'](_0x37bfb3[_0x57ce('0x22')],{'raw':_0x37bfb3['options']?_0x37bfb3[_0x57ce('0x15')][_0x57ce('0x23')]===undefined?!![]:![]:!![],'transaction':_0x1ecd9a})[_0x57ce('0xb')](function(){return db['CmHopper'][_0x57ce('0x27')]({'where':_0x37bfb3['options']?_0x37bfb3[_0x57ce('0x15')][_0x57ce('0x1f')]||null:null,'transaction':_0x1ecd9a});});})[_0x57ce('0xb')](function(_0x54b19b){logger[_0x57ce('0xc')](_0x57ce('0x39'),_0x37bfb3);logger[_0x57ce('0x20')]('MoveContactManagedDialer',_0x37bfb3,JSON[_0x57ce('0x1b')](_0x54b19b));_0x5a5da8(_0x54b19b);})[_0x57ce('0x12')](function(_0x4b1ba5){logger['error'](_0x57ce('0x39'),_0x4b1ba5[_0x57ce('0x11')],_0x37bfb3);_0x5c3a67(_0x120037['error'](0x1f4,_0x4b1ba5[_0x57ce('0x11')]));});});};exports[_0x57ce('0x3b')]=function(_0x4ac54c){var _0x2db727=this;return new Promise(function(_0x41baa1,_0x7fa5c4){return db[_0x57ce('0x1d')]['findAll']({'raw':_0x4ac54c[_0x57ce('0x15')]?_0x4ac54c[_0x57ce('0x15')][_0x57ce('0x23')]===undefined?!![]:![]:!![],'where':_0x4ac54c[_0x57ce('0x15')]?_0x4ac54c['options'][_0x57ce('0x1f')]||null:null,'attributes':[[db[_0x57ce('0x29')]['fn']('COUNT',db[_0x57ce('0x29')]['fn']('IF',db[_0x57ce('0x29')][_0x57ce('0x3c')](_0x57ce('0x3d')+util[_0x57ce('0x3e')]('\x22%s\x22',moment()['format'](_0x57ce('0x3f')))+_0x57ce('0x40')))),_0x57ce('0x41')]]})[_0x57ce('0xb')](function(_0xfd3204){logger[_0x57ce('0xc')]('CountReScheduled',_0x4ac54c);logger['debug'](_0x57ce('0x3b'),_0x4ac54c,JSON['stringify'](_0xfd3204));_0x41baa1(_0xfd3204);})[_0x57ce('0x12')](function(_0x38092b){logger[_0x57ce('0x10')](_0x57ce('0x3b'),_0x38092b[_0x57ce('0x11')],_0x4ac54c);_0x7fa5c4(_0x2db727[_0x57ce('0x10')](0x1f4,_0x38092b[_0x57ce('0x11')]));});});};exports[_0x57ce('0x42')]=function(_0x317bec){var _0xb88f9a=this;return new Promise(function(_0xe197ad,_0x23bde8){return db[_0x57ce('0x2e')]['describe']()[_0x57ce('0xb')](function(_0x10726a){return db['sequelize']['transaction'](function(_0x3f8f2e){return db[_0x57ce('0x1d')]['findAll']({'where':_0x317bec[_0x57ce('0x15')]?_0x317bec[_0x57ce('0x15')][_0x57ce('0x1f')]||null:null,'attributes':_0x317bec[_0x57ce('0x15')]?_0x317bec[_0x57ce('0x15')]['attributes']||null:null,'limit':0x1,'order':_0x317bec[_0x57ce('0x15')]?_0x317bec[_0x57ce('0x15')][_0x57ce('0x2b')]||null:null,'group':db['CmHopper'][_0x57ce('0x43')],'transaction':_0x3f8f2e,'lock':_0x3f8f2e[_0x57ce('0x2c')][_0x57ce('0x2d')],'include':_0x317bec[_0x57ce('0x15')]?_0x317bec[_0x57ce('0x15')][_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x317bec['options'][_0x57ce('0x18')],function(_0x385e43){return{'model':db[_0x385e43[_0x57ce('0x1a')]],'as':_0x385e43['as'],'attributes':_0x385e43[_0x57ce('0x16')],'include':_0x385e43[_0x57ce('0x18')]?_['map'](_0x385e43[_0x57ce('0x18')],function(_0xc8e5e5){return{'model':db[_0xc8e5e5[_0x57ce('0x1a')]],'as':_0xc8e5e5['as'],'attributes':_0xc8e5e5['attributes'],'include':_0xc8e5e5['include']?_['map'](_0xc8e5e5[_0x57ce('0x18')],function(_0x544d14){return{'model':db[_0x544d14[_0x57ce('0x1a')]],'as':_0x544d14['as'],'attributes':_0x544d14['attributes']};}):[]};}):[]};}):[]:[]})[_0x57ce('0xb')](function(_0x4bc52d){var _0x17a082=[];for(var _0x103268=0x0;_0x103268<_0x4bc52d[_0x57ce('0x44')];_0x103268+=0x1){_0x17a082[_0x57ce('0x35')](_0x4bc52d[_0x103268][_0x57ce('0x37')](_0x317bec['body'],{'transaction':_0x3f8f2e}));}return BPromise['all'](_0x17a082);});})[_0x57ce('0xb')](function(_0x15e430){logger[_0x57ce('0xc')](_0x57ce('0x42'),_0x317bec);logger[_0x57ce('0x20')](_0x57ce('0x42'),_0x317bec,JSON[_0x57ce('0x1b')](_0x15e430));_0xe197ad(_0x15e430);})[_0x57ce('0x12')](function(_0x112c37){logger['error'](_0x57ce('0x42'),_0x112c37['message'],_0x317bec);_0x23bde8(_0xb88f9a[_0x57ce('0x10')](0x1f4,_0x112c37[_0x57ce('0x11')]));});});});};exports[_0x57ce('0x45')]=function(_0x1d6362){var _0x1be237=this;return new Promise(function(_0x27ae1b,_0x34c645){db[_0x57ce('0x2e')][_0x57ce('0x46')]()[_0x57ce('0xb')](function(_0x2d9271){return db[_0x57ce('0x1d')][_0x57ce('0x14')]({'raw':_0x1d6362[_0x57ce('0x15')]?_0x1d6362[_0x57ce('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1d6362[_0x57ce('0x15')]?_0x1d6362['options'][_0x57ce('0x1f')]||null:null,'attributes':_0x1d6362[_0x57ce('0x15')]?_0x1d6362[_0x57ce('0x15')][_0x57ce('0x16')]||null:null,'limit':_0x1d6362[_0x57ce('0x15')]?_0x1d6362['options'][_0x57ce('0x17')]||null:null,'include':_0x1d6362[_0x57ce('0x15')]?_0x1d6362[_0x57ce('0x15')][_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x1d6362[_0x57ce('0x15')][_0x57ce('0x18')],function(_0x32d4e5){return{'model':db[_0x32d4e5['model']],'as':_0x32d4e5['as'],'attributes':_0x32d4e5['as']===_0x57ce('0x2f')?_[_0x57ce('0x30')](_0x2d9271):_0x32d4e5[_0x57ce('0x16')],'include':_0x32d4e5[_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x32d4e5[_0x57ce('0x18')],function(_0x246131){return{'model':db[_0x246131[_0x57ce('0x1a')]],'as':_0x246131['as'],'attributes':_0x246131[_0x57ce('0x16')],'include':_0x246131[_0x57ce('0x18')]?_[_0x57ce('0x19')](_0x246131['include'],function(_0x5e4586){return{'model':db[_0x5e4586[_0x57ce('0x1a')]],'as':_0x5e4586['as'],'attributes':_0x5e4586['attributes']};}):[]};}):[]};}):[]:[]})[_0x57ce('0xb')](function(_0x11e2af){logger[_0x57ce('0xc')]('GetCmHopper',_0x1d6362);logger['debug'](_0x57ce('0x13'),_0x1d6362,JSON['stringify'](_0x11e2af));_0x27ae1b(_0x11e2af);})[_0x57ce('0x12')](function(_0x1bf295){logger['error'](_0x57ce('0x13'),_0x1bf295[_0x57ce('0x11')],_0x1d6362);_0x34c645(_0x1be237[_0x57ce('0x10')](0x1f4,_0x1bf295[_0x57ce('0x11')]));});});});};
\ No newline at end of file
index c6e79df..a3e47e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6157=['../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','/preview','getPreview','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3d84c6,_0x1b22e1){var _0x581bfa=function(_0x4b6901){while(--_0x4b6901){_0x3d84c6['push'](_0x3d84c6['shift']());}};_0x581bfa(++_0x1b22e1);}(_0x6157,0x1a9));var _0x7615=function(_0x1bc6af,_0x4fbcc4){_0x1bc6af=_0x1bc6af-0x0;var _0x35e765=_0x6157[_0x1bc6af];return _0x35e765;};'use strict';var multer=require(_0x7615('0x0'));var util=require(_0x7615('0x1'));var path=require('path');var timeout=require(_0x7615('0x2'));var express=require(_0x7615('0x3'));var router=express[_0x7615('0x4')]();var fs_extra=require(_0x7615('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7615('0x6'));var config=require(_0x7615('0x7'));var controller=require(_0x7615('0x8'));router[_0x7615('0x9')]('/',auth[_0x7615('0xa')](),controller[_0x7615('0xb')]);router[_0x7615('0x9')](_0x7615('0xc'),auth['isAuthenticated'](),controller[_0x7615('0xd')]);router[_0x7615('0x9')]('/opencontacts',auth[_0x7615('0xa')](),controller['getOpenContacts']);router[_0x7615('0x9')](_0x7615('0xe'),auth['isAuthenticated'](),controller[_0x7615('0xf')]);router[_0x7615('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7615('0x10')](_0x7615('0x11'),auth[_0x7615('0xa')](),controller[_0x7615('0x12')]);router[_0x7615('0x13')](_0x7615('0xe'),auth['isAuthenticated'](),controller[_0x7615('0x14')]);router[_0x7615('0x15')]('/:id',auth[_0x7615('0xa')](),controller[_0x7615('0x16')]);module[_0x7615('0x17')]=router;
\ No newline at end of file
+var _0xb216=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','/:id','show','post','create','getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x26bbd1,_0xb274f3){var _0x26b1eb=function(_0x4cf794){while(--_0x4cf794){_0x26bbd1['push'](_0x26bbd1['shift']());}};_0x26b1eb(++_0xb274f3);}(_0xb216,0x78));var _0x6b21=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xb216[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0x6b21('0x0'));var util=require(_0x6b21('0x1'));var path=require(_0x6b21('0x2'));var timeout=require(_0x6b21('0x3'));var express=require(_0x6b21('0x4'));var router=express[_0x6b21('0x5')]();var fs_extra=require(_0x6b21('0x6'));var auth=require(_0x6b21('0x7'));var interaction=require(_0x6b21('0x8'));var config=require(_0x6b21('0x9'));var controller=require('./cmHopper.controller');router[_0x6b21('0xa')]('/',auth[_0x6b21('0xb')](),controller[_0x6b21('0xc')]);router[_0x6b21('0xa')](_0x6b21('0xd'),auth[_0x6b21('0xb')](),controller['describe']);router['get'](_0x6b21('0xe'),auth[_0x6b21('0xb')](),controller['getOpenContacts']);router[_0x6b21('0xa')](_0x6b21('0xf'),auth[_0x6b21('0xb')](),controller[_0x6b21('0x10')]);router[_0x6b21('0x11')]('/',auth[_0x6b21('0xb')](),controller[_0x6b21('0x12')]);router[_0x6b21('0x11')]('/preview',auth[_0x6b21('0xb')](),controller[_0x6b21('0x13')]);router[_0x6b21('0x14')](_0x6b21('0xf'),auth[_0x6b21('0xb')](),controller[_0x6b21('0x15')]);router[_0x6b21('0x16')](_0x6b21('0xf'),auth[_0x6b21('0xb')](),controller[_0x6b21('0x17')]);module[_0x6b21('0x18')]=router;
\ No newline at end of file
index 626a7df..80b5d6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7827=['exports','contactListQueue','INTEGER','moment','sequelize'];(function(_0x595812,_0x2d5565){var _0x20ffeb=function(_0x3ec0f7){while(--_0x3ec0f7){_0x595812['push'](_0x595812['shift']());}};_0x20ffeb(++_0x2d5565);}(_0x7827,0x19d));var _0x7782=function(_0x37452f,_0x17a04c){_0x37452f=_0x37452f-0x0;var _0xd5b34f=_0x7827[_0x37452f];return _0xd5b34f;};'use strict';var moment=require(_0x7782('0x0'));var Sequelize=require(_0x7782('0x1'));module[_0x7782('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x7782('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x7782('0x3')},'VoiceQueueId':{'type':Sequelize[_0x7782('0x4')],'unique':_0x7782('0x3')}};
\ No newline at end of file
+var _0x3b74=['contactListQueue','INTEGER','moment','sequelize','exports','STRING'];(function(_0x4a7aca,_0x11b024){var _0x40cdc0=function(_0x3db7a1){while(--_0x3db7a1){_0x4a7aca['push'](_0x4a7aca['shift']());}};_0x40cdc0(++_0x11b024);}(_0x3b74,0x80));var _0x43b7=function(_0x167307,_0x5a60ae){_0x167307=_0x167307-0x0;var _0x550140=_0x3b74[_0x167307];return _0x550140;};'use strict';var moment=require(_0x43b7('0x0'));var Sequelize=require(_0x43b7('0x1'));module[_0x43b7('0x2')]={'phone':{'type':Sequelize[_0x43b7('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x43b7('0x4')},'ListId':{'type':Sequelize[_0x43b7('0x5')],'unique':_0x43b7('0x4')},'VoiceQueueId':{'type':Sequelize[_0x43b7('0x5')],'unique':'contactListQueue'}};
\ No newline at end of file
index 5e7a266..cf7ed08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x363a=['show','params','rawAttributes','find','catch','body','describe','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','end','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x363a,0x97));var _0xa363=function(_0x50392a,_0x2d4ed9){_0x50392a=_0x50392a-0x0;var _0x417b0a=_0x363a[_0x50392a];return _0x417b0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa363('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa363('0x1'));var rp=require('request-promise');var moment=require(_0xa363('0x2'));var BPromise=require(_0xa363('0x3'));var Mustache=require('mustache');var util=require(_0xa363('0x4'));var path=require(_0xa363('0x5'));var sox=require(_0xa363('0x6'));var csv=require('to-csv');var ejs=require(_0xa363('0x7'));var fs=require('fs');var fs_extra=require(_0xa363('0x8'));var _=require(_0xa363('0x9'));var squel=require(_0xa363('0xa'));var crypto=require(_0xa363('0xb'));var jsforce=require(_0xa363('0xc'));var deskjs=require(_0xa363('0xd'));var toCsv=require(_0xa363('0xe'));var querystring=require('querystring');var Papa=require(_0xa363('0xf'));var Redis=require(_0xa363('0x10'));var authService=require(_0xa363('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa363('0x12'));var logger=require('../../config/logger')(_0xa363('0x13'));var utils=require('../../config/utils');var config=require(_0xa363('0x14'));var licenseUtil=require(_0xa363('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x156b36,_0x21e2ef){_0x21e2ef=_0x21e2ef||0xcc;return function(_0x1cf34c){if(_0x1cf34c){return _0x156b36[_0xa363('0x16')](_0x21e2ef);}return _0x156b36[_0xa363('0x17')](_0x21e2ef)['end']();};}function respondWithResult(_0x57c858,_0x3a155d){_0x3a155d=_0x3a155d||0xc8;return function(_0x28c305){if(_0x28c305){return _0x57c858[_0xa363('0x17')](_0x3a155d)[_0xa363('0x18')](_0x28c305);}};}function respondWithFilteredResult(_0x5d0ca8,_0x570d49){return function(_0x1d5ef9){if(_0x1d5ef9){var _0x324e21=typeof _0x570d49[_0xa363('0x19')]===_0xa363('0x1a')&&typeof _0x570d49[_0xa363('0x1b')]==='undefined';var _0x4e19ff=_0x1d5ef9[_0xa363('0x1c')];var _0x298ea2=_0x324e21?0x0:_0x570d49[_0xa363('0x19')];var _0x5eae48=_0x324e21?_0x1d5ef9['count']:_0x570d49[_0xa363('0x19')]+_0x570d49[_0xa363('0x1b')];var _0x1a8b4c;if(_0x5eae48>=_0x4e19ff){_0x5eae48=_0x4e19ff;_0x1a8b4c=0xc8;}else{_0x1a8b4c=0xce;}_0x5d0ca8[_0xa363('0x17')](_0x1a8b4c);return _0x5d0ca8[_0xa363('0x1d')](_0xa363('0x1e'),_0x298ea2+'-'+_0x5eae48+'/'+_0x4e19ff)[_0xa363('0x18')](_0x1d5ef9);}return null;};}function patchUpdates(_0x106670){return function(_0x595350){try{jsonpatch[_0xa363('0x1f')](_0x595350,_0x106670,!![]);}catch(_0x14064a){return BPromise['reject'](_0x14064a);}return _0x595350[_0xa363('0x20')]();};}function saveUpdates(_0x5a6ef3,_0x5a4fd6){return function(_0x182f7e){if(_0x182f7e){return _0x182f7e['update'](_0x5a6ef3)['then'](function(_0x3939ff){return _0x3939ff;});}return null;};}function removeEntity(_0x104e43,_0x4a8e07){return function(_0x2f1851){if(_0x2f1851){return _0x2f1851[_0xa363('0x21')]()['then'](function(){_0x104e43[_0xa363('0x17')](0xcc)[_0xa363('0x22')]();});}};}function handleEntityNotFound(_0x2146d8,_0x421f21){return function(_0x39a85f){if(!_0x39a85f){_0x2146d8['sendStatus'](0x194);}return _0x39a85f;};}function handleError(_0x487b79,_0x2bf989){_0x2bf989=_0x2bf989||0x1f4;return function(_0x463ce3){logger[_0xa363('0x23')](_0x463ce3[_0xa363('0x24')]);if(_0x463ce3[_0xa363('0x25')]){delete _0x463ce3[_0xa363('0x25')];}_0x487b79['status'](_0x2bf989)[_0xa363('0x26')](_0x463ce3);};}exports[_0xa363('0x27')]=function(_0x3498d7,_0x27e61c){var _0x166403={},_0x262078={},_0x45a9e3={'count':0x0,'rows':[]};var _0x6f92b8=_[_0xa363('0x28')](db[_0xa363('0x29')]['rawAttributes'],function(_0x138bfc){return{'name':_0x138bfc[_0xa363('0x2a')],'type':_0x138bfc[_0xa363('0x2b')]['key']};});_0x262078['model']=_[_0xa363('0x28')](_0x6f92b8,_0xa363('0x25'));_0x262078[_0xa363('0x2c')]=_[_0xa363('0x2d')](_0x3498d7[_0xa363('0x2c')]);_0x262078[_0xa363('0x2e')]=_['intersection'](_0x262078[_0xa363('0x2f')],_0x262078['query']);_0x166403[_0xa363('0x30')]=_[_0xa363('0x31')](_0x262078['model'],qs['fields'](_0x3498d7[_0xa363('0x2c')][_0xa363('0x32')]));_0x166403[_0xa363('0x30')]=_0x166403['attributes'][_0xa363('0x33')]?_0x166403[_0xa363('0x30')]:_0x262078[_0xa363('0x2f')];if(!_0x3498d7[_0xa363('0x2c')][_0xa363('0x34')](_0xa363('0x35'))){_0x166403[_0xa363('0x1b')]=qs[_0xa363('0x1b')](_0x3498d7[_0xa363('0x2c')][_0xa363('0x1b')]);_0x166403['offset']=qs[_0xa363('0x19')](_0x3498d7[_0xa363('0x2c')][_0xa363('0x19')]);}_0x166403['order']=qs[_0xa363('0x36')](_0x3498d7['query'][_0xa363('0x36')]);_0x166403[_0xa363('0x37')]=qs[_0xa363('0x2e')](_[_0xa363('0x38')](_0x3498d7[_0xa363('0x2c')],_0x262078[_0xa363('0x2e')]),_0x6f92b8);if(_0x3498d7[_0xa363('0x2c')][_0xa363('0x39')]){_0x166403[_0xa363('0x37')]=_[_0xa363('0x3a')](_0x166403[_0xa363('0x37')],{'$or':_['map'](_0x6f92b8,function(_0x531c15){if(_0x531c15[_0xa363('0x2b')]!=='VIRTUAL'){var _0x49f51d={};_0x49f51d[_0x531c15['name']]={'$like':'%'+_0x3498d7[_0xa363('0x2c')][_0xa363('0x39')]+'%'};return _0x49f51d;}})});}_0x166403=_[_0xa363('0x3a')]({},_0x166403,_0x3498d7[_0xa363('0x3b')]);var _0x379ace={'where':_0x166403[_0xa363('0x37')]};return db[_0xa363('0x29')][_0xa363('0x1c')](_0x379ace)[_0xa363('0x3c')](function(_0x944543){_0x45a9e3[_0xa363('0x1c')]=_0x944543;if(_0x3498d7[_0xa363('0x2c')][_0xa363('0x3d')]){_0x166403[_0xa363('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa363('0x3f')](_0x166403);})[_0xa363('0x3c')](function(_0x506e8a){_0x45a9e3[_0xa363('0x40')]=_0x506e8a;return _0x45a9e3;})[_0xa363('0x3c')](respondWithFilteredResult(_0x27e61c,_0x166403))['catch'](handleError(_0x27e61c,null));};exports[_0xa363('0x41')]=function(_0x35c4ae,_0x13ca5d){var _0x154420={'raw':!![],'where':{'id':_0x35c4ae[_0xa363('0x42')]['id']}},_0x3c15e0={};_0x3c15e0[_0xa363('0x2f')]=_[_0xa363('0x2d')](db['CmHopperBlack'][_0xa363('0x43')]);_0x3c15e0[_0xa363('0x2c')]=_['keys'](_0x35c4ae[_0xa363('0x2c')]);_0x3c15e0[_0xa363('0x2e')]=_[_0xa363('0x31')](_0x3c15e0[_0xa363('0x2f')],_0x3c15e0[_0xa363('0x2c')]);_0x154420['attributes']=_[_0xa363('0x31')](_0x3c15e0[_0xa363('0x2f')],qs[_0xa363('0x32')](_0x35c4ae['query'][_0xa363('0x32')]));_0x154420[_0xa363('0x30')]=_0x154420[_0xa363('0x30')]['length']?_0x154420[_0xa363('0x30')]:_0x3c15e0[_0xa363('0x2f')];if(_0x35c4ae[_0xa363('0x2c')][_0xa363('0x3d')]){_0x154420[_0xa363('0x3e')]=[{'all':!![]}];}_0x154420=_[_0xa363('0x3a')]({},_0x154420,_0x35c4ae[_0xa363('0x3b')]);return db[_0xa363('0x29')][_0xa363('0x44')](_0x154420)['then'](handleEntityNotFound(_0x13ca5d,null))[_0xa363('0x3c')](respondWithResult(_0x13ca5d,null))[_0xa363('0x45')](handleError(_0x13ca5d,null));};exports['update']=function(_0x39deef,_0x57b969){if(_0x39deef[_0xa363('0x46')]['id']){delete _0x39deef['body']['id'];}return db[_0xa363('0x29')][_0xa363('0x44')]({'where':{'id':_0x39deef[_0xa363('0x42')]['id']}})[_0xa363('0x3c')](handleEntityNotFound(_0x57b969,null))[_0xa363('0x3c')](saveUpdates(_0x39deef['body'],null))[_0xa363('0x3c')](respondWithResult(_0x57b969,null))[_0xa363('0x45')](handleError(_0x57b969,null));};exports['destroy']=function(_0x1e8957,_0x3a1a3f){return db['CmHopperBlack'][_0xa363('0x44')]({'where':{'id':_0x1e8957[_0xa363('0x42')]['id']}})[_0xa363('0x3c')](handleEntityNotFound(_0x3a1a3f,null))[_0xa363('0x3c')](removeEntity(_0x3a1a3f,null))[_0xa363('0x45')](handleError(_0x3a1a3f,null));};exports['describe']=function(_0x15aaa0,_0x46abab){return db['CmHopperBlack'][_0xa363('0x47')]()[_0xa363('0x3c')](respondWithResult(_0x46abab,null))['catch'](handleError(_0x46abab,null));};
\ No newline at end of file
+var _0x9e54=['eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','error','stack','name','status','send','map','CmHopperBlack','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','body','find','describe'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x9e54,0x88));var _0x49e5=function(_0x1cdb2d,_0x8f1f76){_0x1cdb2d=_0x1cdb2d-0x0;var _0x4dafe3=_0x9e54[_0x1cdb2d];return _0x4dafe3;};'use strict';var emlformat=require(_0x49e5('0x0'));var rimraf=require(_0x49e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x49e5('0x2'));var BPromise=require(_0x49e5('0x3'));var Mustache=require(_0x49e5('0x4'));var util=require('util');var path=require(_0x49e5('0x5'));var sox=require(_0x49e5('0x6'));var csv=require('to-csv');var ejs=require(_0x49e5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x49e5('0x8'));var crypto=require('crypto');var jsforce=require(_0x49e5('0x9'));var deskjs=require(_0x49e5('0xa'));var toCsv=require(_0x49e5('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x49e5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x49e5('0xd'));var as=require(_0x49e5('0xe'));var hardwareService=require(_0x49e5('0xf'));var logger=require(_0x49e5('0x10'))(_0x49e5('0x11'));var utils=require('../../config/utils');var config=require(_0x49e5('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x49e5('0x13'))['db'];function respondWithStatusCode(_0x2d4996,_0xf393df){_0xf393df=_0xf393df||0xcc;return function(_0x412d42){if(_0x412d42){return _0x2d4996[_0x49e5('0x14')](_0xf393df);}return _0x2d4996['status'](_0xf393df)['end']();};}function respondWithResult(_0xb0073b,_0xc645f9){_0xc645f9=_0xc645f9||0xc8;return function(_0x5ea43e){if(_0x5ea43e){return _0xb0073b['status'](_0xc645f9)[_0x49e5('0x15')](_0x5ea43e);}};}function respondWithFilteredResult(_0x5d80ae,_0x351a87){return function(_0x5024e9){if(_0x5024e9){var _0x2cc353=typeof _0x351a87[_0x49e5('0x16')]===_0x49e5('0x17')&&typeof _0x351a87['limit']===_0x49e5('0x17');var _0x273023=_0x5024e9[_0x49e5('0x18')];var _0x1e2723=_0x2cc353?0x0:_0x351a87[_0x49e5('0x16')];var _0xff869e=_0x2cc353?_0x5024e9[_0x49e5('0x18')]:_0x351a87['offset']+_0x351a87[_0x49e5('0x19')];var _0x200a4e;if(_0xff869e>=_0x273023){_0xff869e=_0x273023;_0x200a4e=0xc8;}else{_0x200a4e=0xce;}_0x5d80ae['status'](_0x200a4e);return _0x5d80ae[_0x49e5('0x1a')]('Content-Range',_0x1e2723+'-'+_0xff869e+'/'+_0x273023)[_0x49e5('0x15')](_0x5024e9);}return null;};}function patchUpdates(_0x2b1bbe){return function(_0x495c32){try{jsonpatch[_0x49e5('0x1b')](_0x495c32,_0x2b1bbe,!![]);}catch(_0x41c6d0){return BPromise[_0x49e5('0x1c')](_0x41c6d0);}return _0x495c32[_0x49e5('0x1d')]();};}function saveUpdates(_0xe9a50,_0x3c14e3){return function(_0x5e8569){if(_0x5e8569){return _0x5e8569[_0x49e5('0x1e')](_0xe9a50)['then'](function(_0x3f2f6b){return _0x3f2f6b;});}return null;};}function removeEntity(_0x227615,_0x1033ed){return function(_0x2d1d63){if(_0x2d1d63){return _0x2d1d63[_0x49e5('0x1f')]()[_0x49e5('0x20')](function(){_0x227615['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd96520,_0x3bdd2b){return function(_0x5531bf){if(!_0x5531bf){_0xd96520[_0x49e5('0x14')](0x194);}return _0x5531bf;};}function handleError(_0xba7c12,_0x29a0c8){_0x29a0c8=_0x29a0c8||0x1f4;return function(_0x16f98f){logger[_0x49e5('0x21')](_0x16f98f[_0x49e5('0x22')]);if(_0x16f98f['name']){delete _0x16f98f[_0x49e5('0x23')];}_0xba7c12[_0x49e5('0x24')](_0x29a0c8)[_0x49e5('0x25')](_0x16f98f);};}exports['index']=function(_0x300754,_0x4cab78){var _0x365aeb={},_0x46a5be={},_0x5a0e10={'count':0x0,'rows':[]};var _0x56d96a=_[_0x49e5('0x26')](db[_0x49e5('0x27')]['rawAttributes'],function(_0x35a5f4){return{'name':_0x35a5f4['fieldName'],'type':_0x35a5f4[_0x49e5('0x28')][_0x49e5('0x29')]};});_0x46a5be[_0x49e5('0x2a')]=_[_0x49e5('0x26')](_0x56d96a,_0x49e5('0x23'));_0x46a5be['query']=_[_0x49e5('0x2b')](_0x300754[_0x49e5('0x2c')]);_0x46a5be[_0x49e5('0x2d')]=_[_0x49e5('0x2e')](_0x46a5be[_0x49e5('0x2a')],_0x46a5be['query']);_0x365aeb[_0x49e5('0x2f')]=_[_0x49e5('0x2e')](_0x46a5be['model'],qs[_0x49e5('0x30')](_0x300754['query']['fields']));_0x365aeb[_0x49e5('0x2f')]=_0x365aeb[_0x49e5('0x2f')]['length']?_0x365aeb['attributes']:_0x46a5be[_0x49e5('0x2a')];if(!_0x300754['query'][_0x49e5('0x31')](_0x49e5('0x32'))){_0x365aeb[_0x49e5('0x19')]=qs[_0x49e5('0x19')](_0x300754[_0x49e5('0x2c')][_0x49e5('0x19')]);_0x365aeb[_0x49e5('0x16')]=qs[_0x49e5('0x16')](_0x300754[_0x49e5('0x2c')][_0x49e5('0x16')]);}_0x365aeb['order']=qs[_0x49e5('0x33')](_0x300754['query']['sort']);_0x365aeb[_0x49e5('0x34')]=qs[_0x49e5('0x2d')](_[_0x49e5('0x35')](_0x300754[_0x49e5('0x2c')],_0x46a5be[_0x49e5('0x2d')]),_0x56d96a);if(_0x300754[_0x49e5('0x2c')][_0x49e5('0x36')]){_0x365aeb[_0x49e5('0x34')]=_[_0x49e5('0x37')](_0x365aeb[_0x49e5('0x34')],{'$or':_[_0x49e5('0x26')](_0x56d96a,function(_0x1c54c6){if(_0x1c54c6[_0x49e5('0x28')]!==_0x49e5('0x38')){var _0x3d0c93={};_0x3d0c93[_0x1c54c6['name']]={'$like':'%'+_0x300754[_0x49e5('0x2c')]['filter']+'%'};return _0x3d0c93;}})});}_0x365aeb=_[_0x49e5('0x37')]({},_0x365aeb,_0x300754[_0x49e5('0x39')]);var _0x5a8fda={'where':_0x365aeb[_0x49e5('0x34')]};return db[_0x49e5('0x27')]['count'](_0x5a8fda)[_0x49e5('0x20')](function(_0x56ec43){_0x5a0e10[_0x49e5('0x18')]=_0x56ec43;if(_0x300754[_0x49e5('0x2c')][_0x49e5('0x3a')]){_0x365aeb['include']=[{'all':!![]}];}return db[_0x49e5('0x27')][_0x49e5('0x3b')](_0x365aeb);})[_0x49e5('0x20')](function(_0x5efc4b){_0x5a0e10[_0x49e5('0x3c')]=_0x5efc4b;return _0x5a0e10;})['then'](respondWithFilteredResult(_0x4cab78,_0x365aeb))[_0x49e5('0x3d')](handleError(_0x4cab78,null));};exports['show']=function(_0x310a9c,_0x2248dc){var _0x3fbf05={'raw':!![],'where':{'id':_0x310a9c[_0x49e5('0x3e')]['id']}},_0x334ad3={};_0x334ad3[_0x49e5('0x2a')]=_[_0x49e5('0x2b')](db[_0x49e5('0x27')][_0x49e5('0x3f')]);_0x334ad3[_0x49e5('0x2c')]=_['keys'](_0x310a9c[_0x49e5('0x2c')]);_0x334ad3[_0x49e5('0x2d')]=_['intersection'](_0x334ad3[_0x49e5('0x2a')],_0x334ad3[_0x49e5('0x2c')]);_0x3fbf05[_0x49e5('0x2f')]=_['intersection'](_0x334ad3[_0x49e5('0x2a')],qs[_0x49e5('0x30')](_0x310a9c['query'][_0x49e5('0x30')]));_0x3fbf05[_0x49e5('0x2f')]=_0x3fbf05[_0x49e5('0x2f')]['length']?_0x3fbf05[_0x49e5('0x2f')]:_0x334ad3[_0x49e5('0x2a')];if(_0x310a9c[_0x49e5('0x2c')][_0x49e5('0x3a')]){_0x3fbf05[_0x49e5('0x40')]=[{'all':!![]}];}_0x3fbf05=_[_0x49e5('0x37')]({},_0x3fbf05,_0x310a9c[_0x49e5('0x39')]);return db[_0x49e5('0x27')]['find'](_0x3fbf05)[_0x49e5('0x20')](handleEntityNotFound(_0x2248dc,null))[_0x49e5('0x20')](respondWithResult(_0x2248dc,null))[_0x49e5('0x3d')](handleError(_0x2248dc,null));};exports[_0x49e5('0x1e')]=function(_0xd691ac,_0x238f7e){if(_0xd691ac[_0x49e5('0x41')]['id']){delete _0xd691ac[_0x49e5('0x41')]['id'];}return db[_0x49e5('0x27')][_0x49e5('0x42')]({'where':{'id':_0xd691ac[_0x49e5('0x3e')]['id']}})[_0x49e5('0x20')](handleEntityNotFound(_0x238f7e,null))[_0x49e5('0x20')](saveUpdates(_0xd691ac['body'],null))[_0x49e5('0x20')](respondWithResult(_0x238f7e,null))[_0x49e5('0x3d')](handleError(_0x238f7e,null));};exports[_0x49e5('0x1f')]=function(_0x1a6f77,_0x5b8635){return db[_0x49e5('0x27')][_0x49e5('0x42')]({'where':{'id':_0x1a6f77[_0x49e5('0x3e')]['id']}})[_0x49e5('0x20')](handleEntityNotFound(_0x5b8635,null))['then'](removeEntity(_0x5b8635,null))[_0x49e5('0x3d')](handleError(_0x5b8635,null));};exports[_0x49e5('0x43')]=function(_0x1db2de,_0xdc5ca0){return db['CmHopperBlack'][_0x49e5('0x43')]()[_0x49e5('0x20')](respondWithResult(_0xdc5ca0,null))[_0x49e5('0x3d')](handleError(_0xdc5ca0,null));};
\ No newline at end of file
index fbded57..5018704 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4c4=['request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird'];(function(_0x13bbb1,_0x20e170){var _0xf8e03d=function(_0x1c0a8a){while(--_0x1c0a8a){_0x13bbb1['push'](_0x13bbb1['shift']());}};_0xf8e03d(++_0x20e170);}(_0xb4c4,0x17b));var _0x4b4c=function(_0x587693,_0x27fe90){_0x587693=_0x587693-0x0;var _0x510a1a=_0xb4c4[_0x587693];return _0x510a1a;};'use strict';var _=require(_0x4b4c('0x0'));var util=require(_0x4b4c('0x1'));var logger=require('../../config/logger')(_0x4b4c('0x2'));var moment=require(_0x4b4c('0x3'));var BPromise=require(_0x4b4c('0x4'));var rp=require(_0x4b4c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b4c('0x6'));var config=require(_0x4b4c('0x7'));var attributes=require(_0x4b4c('0x8'));module[_0x4b4c('0x9')]=function(_0x1f92e0,_0x46e62e){return _0x1f92e0['define'](_0x4b4c('0xa'),attributes,{'tableName':_0x4b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0300=['../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x540b08,_0x3cfbba){var _0x4f027c=function(_0x34616f){while(--_0x34616f){_0x540b08['push'](_0x540b08['shift']());}};_0x4f027c(++_0x3cfbba);}(_0x0300,0x1de));var _0x0030=function(_0xe4f940,_0x40907c){_0xe4f940=_0xe4f940-0x0;var _0x57494e=_0x0300[_0xe4f940];return _0x57494e;};'use strict';var _=require(_0x0030('0x0'));var util=require(_0x0030('0x1'));var logger=require(_0x0030('0x2'))(_0x0030('0x3'));var moment=require('moment');var BPromise=require(_0x0030('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0030('0x5'));var rimraf=require('rimraf');var config=require(_0x0030('0x6'));var attributes=require(_0x0030('0x7'));module[_0x0030('0x8')]=function(_0x2dd6f8,_0x5e32a4){return _0x2dd6f8[_0x0030('0x9')]('CmHopperBlack',attributes,{'tableName':_0x0030('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f64dcc0..20c016e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe497=['lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopperBlack','options','where','limit','include','map','model','attributes','info','GetCmHopperBlack','stringify','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy'];(function(_0xed0422,_0x1ac67e){var _0x17aef5=function(_0x4c41b5){while(--_0x4c41b5){_0xed0422['push'](_0xed0422['shift']());}};_0x17aef5(++_0x1ac67e);}(_0xe497,0x197));var _0x7e49=function(_0x470605,_0x2c9e4a){_0x470605=_0x470605-0x0;var _0x2f451c=_0xe497[_0x470605];return _0x2f451c;};'use strict';var _=require(_0x7e49('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e49('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e49('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e49('0x3'));var logger=require('../../config/logger')(_0x7e49('0x4'));var config=require(_0x7e49('0x5'));var jayson=require(_0x7e49('0x6'));var client=jayson[_0x7e49('0x7')][_0x7e49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x318b02,_0x4e5501,_0x4fb6e2){return new BPromise(function(_0x2a482d,_0x4d1b5e){return client[_0x7e49('0x9')](_0x318b02,_0x4fb6e2)[_0x7e49('0xa')](function(_0x13f15e){logger['info'](_0x7e49('0xb'),_0x4e5501,_0x7e49('0xc'));logger[_0x7e49('0xd')](_0x7e49('0xe'),_0x4e5501,_0x7e49('0xc'),JSON['stringify'](_0x13f15e));if(_0x13f15e[_0x7e49('0xf')]){if(_0x13f15e['error'][_0x7e49('0x10')]===0x1f4){logger[_0x7e49('0xf')](_0x7e49('0xb'),_0x4e5501,_0x13f15e[_0x7e49('0xf')][_0x7e49('0x11')]);return _0x4d1b5e(_0x13f15e[_0x7e49('0xf')][_0x7e49('0x11')]);}logger[_0x7e49('0xf')](_0x7e49('0xb'),_0x4e5501,_0x13f15e[_0x7e49('0xf')][_0x7e49('0x11')]);return _0x2a482d(_0x13f15e[_0x7e49('0xf')][_0x7e49('0x11')]);}else{logger['info'](_0x7e49('0xb'),_0x4e5501,_0x7e49('0xc'));_0x2a482d(_0x13f15e[_0x7e49('0x12')][_0x7e49('0x11')]);}})[_0x7e49('0x13')](function(_0x528aef){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x4e5501,_0x528aef);_0x4d1b5e(_0x528aef);});});}exports['GetCmHopperBlack']=function(_0x5d48bc){var _0x562f31=this;return new Promise(function(_0x21d457,_0x50a5a7){return db[_0x7e49('0x14')]['findAll']({'raw':_0x5d48bc[_0x7e49('0x15')]?_0x5d48bc[_0x7e49('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5d48bc['options']?_0x5d48bc[_0x7e49('0x15')][_0x7e49('0x16')]||null:null,'attributes':_0x5d48bc[_0x7e49('0x15')]?_0x5d48bc[_0x7e49('0x15')]['attributes']||null:null,'limit':_0x5d48bc[_0x7e49('0x15')]?_0x5d48bc[_0x7e49('0x15')][_0x7e49('0x17')]||null:null,'include':_0x5d48bc[_0x7e49('0x15')]?_0x5d48bc['options'][_0x7e49('0x18')]?_[_0x7e49('0x19')](_0x5d48bc[_0x7e49('0x15')][_0x7e49('0x18')],function(_0x45c5c7){return{'model':db[_0x45c5c7[_0x7e49('0x1a')]],'as':_0x45c5c7['as'],'attributes':_0x45c5c7[_0x7e49('0x1b')],'include':_0x45c5c7[_0x7e49('0x18')]?_['map'](_0x45c5c7['include'],function(_0x2ffd0d){return{'model':db[_0x2ffd0d[_0x7e49('0x1a')]],'as':_0x2ffd0d['as'],'attributes':_0x2ffd0d[_0x7e49('0x1b')],'include':_0x2ffd0d[_0x7e49('0x18')]?_['map'](_0x2ffd0d['include'],function(_0x3932fe){return{'model':db[_0x3932fe['model']],'as':_0x3932fe['as'],'attributes':_0x3932fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c4e4c){logger[_0x7e49('0x1c')]('GetCmHopperBlack',_0x5d48bc);logger['debug'](_0x7e49('0x1d'),_0x5d48bc,JSON[_0x7e49('0x1e')](_0x2c4e4c));_0x21d457(_0x2c4e4c);})[_0x7e49('0x13')](function(_0x4f823b){logger[_0x7e49('0xf')](_0x7e49('0x1d'),_0x4f823b['message'],_0x5d48bc);_0x50a5a7(_0x562f31[_0x7e49('0xf')](0x1f4,_0x4f823b[_0x7e49('0x11')]));});});};exports[_0x7e49('0x1f')]=function(_0x2a346c){var _0x1cbfbc=this;return new Promise(function(_0x4f99f3,_0x310f45){return db['CmHopperBlack'][_0x7e49('0x20')](_0x2a346c[_0x7e49('0x21')],{'raw':_0x2a346c[_0x7e49('0x15')]?_0x2a346c[_0x7e49('0x15')][_0x7e49('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a346c[_0x7e49('0x15')]?_0x2a346c[_0x7e49('0x15')][_0x7e49('0x16')]||null:null,'attributes':_0x2a346c[_0x7e49('0x15')]?_0x2a346c['options']['attributes']||null:null,'limit':_0x2a346c['options']?_0x2a346c['options'][_0x7e49('0x17')]||null:null})[_0x7e49('0xa')](function(_0x1c6534){logger[_0x7e49('0x1c')](_0x7e49('0x1f'),_0x2a346c);logger[_0x7e49('0xd')](_0x7e49('0x1f'),_0x2a346c,JSON[_0x7e49('0x1e')](_0x1c6534));_0x4f99f3(_0x1c6534);})[_0x7e49('0x13')](function(_0x21b1a2){logger[_0x7e49('0xf')]('UpdateCmHopperBlack',_0x21b1a2[_0x7e49('0x11')],_0x2a346c);_0x310f45(_0x1cbfbc[_0x7e49('0xf')](0x1f4,_0x21b1a2[_0x7e49('0x11')]));});});};exports[_0x7e49('0x23')]=function(_0x391afe){var _0x26632e=this;return new Promise(function(_0x25b129,_0xaf34f5){return db[_0x7e49('0x14')][_0x7e49('0x24')]({'where':_0x391afe['options']?_0x391afe[_0x7e49('0x15')][_0x7e49('0x16')]||null:null})[_0x7e49('0xa')](function(_0x4eabc5){logger[_0x7e49('0x1c')]('DestroyCmHopperBlack',_0x391afe);logger[_0x7e49('0xd')](_0x7e49('0x23'),_0x391afe,JSON[_0x7e49('0x1e')](_0x4eabc5));_0x25b129(_0x4eabc5);})['catch'](function(_0x7d54c7){logger[_0x7e49('0xf')](_0x7e49('0x23'),_0x7d54c7['message'],_0x391afe);_0xaf34f5(_0x26632e['error'](0x1f4,_0x7d54c7[_0x7e49('0x11')]));});});};
\ No newline at end of file
+var _0x2d74=['info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','limit','include','map','model','attributes','debug','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x513fd9,_0x3e1df6){var _0x1934b9=function(_0x3a81e4){while(--_0x3a81e4){_0x513fd9['push'](_0x513fd9['shift']());}};_0x1934b9(++_0x3e1df6);}(_0x2d74,0x1c7));var _0x42d7=function(_0x2a7b77,_0x272ac1){_0x2a7b77=_0x2a7b77-0x0;var _0x34d924=_0x2d74[_0x2a7b77];return _0x34d924;};'use strict';var _=require(_0x42d7('0x0'));var util=require(_0x42d7('0x1'));var moment=require('moment');var BPromise=require(_0x42d7('0x2'));var rs=require(_0x42d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x42d7('0x4'));var logger=require(_0x42d7('0x5'))(_0x42d7('0x6'));var config=require(_0x42d7('0x7'));var jayson=require(_0x42d7('0x8'));var client=jayson[_0x42d7('0x9')][_0x42d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x484ee4,_0x440506,_0x5eba73){return new BPromise(function(_0x4a7902,_0x58ecb7){return client[_0x42d7('0xb')](_0x484ee4,_0x5eba73)[_0x42d7('0xc')](function(_0x6a71fc){logger[_0x42d7('0xd')](_0x42d7('0xe'),_0x440506,_0x42d7('0xf'));logger['debug'](_0x42d7('0x10'),_0x440506,_0x42d7('0xf'),JSON[_0x42d7('0x11')](_0x6a71fc));if(_0x6a71fc['error']){if(_0x6a71fc[_0x42d7('0x12')]['code']===0x1f4){logger[_0x42d7('0x12')](_0x42d7('0xe'),_0x440506,_0x6a71fc[_0x42d7('0x12')][_0x42d7('0x13')]);return _0x58ecb7(_0x6a71fc[_0x42d7('0x12')][_0x42d7('0x13')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x440506,_0x6a71fc[_0x42d7('0x12')][_0x42d7('0x13')]);return _0x4a7902(_0x6a71fc[_0x42d7('0x12')][_0x42d7('0x13')]);}else{logger[_0x42d7('0xd')](_0x42d7('0xe'),_0x440506,'request\x20sent');_0x4a7902(_0x6a71fc['result'][_0x42d7('0x13')]);}})[_0x42d7('0x14')](function(_0x43b43e){logger[_0x42d7('0x12')](_0x42d7('0xe'),_0x440506,_0x43b43e);_0x58ecb7(_0x43b43e);});});}exports[_0x42d7('0x15')]=function(_0x5a208a){var _0x1504c6=this;return new Promise(function(_0x59f0ce,_0x32cc19){return db[_0x42d7('0x16')]['findAll']({'raw':_0x5a208a[_0x42d7('0x17')]?_0x5a208a[_0x42d7('0x17')][_0x42d7('0x18')]===undefined?!![]:![]:!![],'where':_0x5a208a[_0x42d7('0x17')]?_0x5a208a['options'][_0x42d7('0x19')]||null:null,'attributes':_0x5a208a[_0x42d7('0x17')]?_0x5a208a['options']['attributes']||null:null,'limit':_0x5a208a['options']?_0x5a208a[_0x42d7('0x17')][_0x42d7('0x1a')]||null:null,'include':_0x5a208a['options']?_0x5a208a[_0x42d7('0x17')][_0x42d7('0x1b')]?_[_0x42d7('0x1c')](_0x5a208a[_0x42d7('0x17')]['include'],function(_0x353d5f){return{'model':db[_0x353d5f[_0x42d7('0x1d')]],'as':_0x353d5f['as'],'attributes':_0x353d5f[_0x42d7('0x1e')],'include':_0x353d5f[_0x42d7('0x1b')]?_[_0x42d7('0x1c')](_0x353d5f['include'],function(_0x127f3e){return{'model':db[_0x127f3e[_0x42d7('0x1d')]],'as':_0x127f3e['as'],'attributes':_0x127f3e[_0x42d7('0x1e')],'include':_0x127f3e[_0x42d7('0x1b')]?_[_0x42d7('0x1c')](_0x127f3e[_0x42d7('0x1b')],function(_0x277365){return{'model':db[_0x277365[_0x42d7('0x1d')]],'as':_0x277365['as'],'attributes':_0x277365['attributes']};}):[]};}):[]};}):[]:[]})[_0x42d7('0xc')](function(_0xf7dff4){logger[_0x42d7('0xd')]('GetCmHopperBlack',_0x5a208a);logger[_0x42d7('0x1f')](_0x42d7('0x15'),_0x5a208a,JSON[_0x42d7('0x11')](_0xf7dff4));_0x59f0ce(_0xf7dff4);})[_0x42d7('0x14')](function(_0x413d35){logger[_0x42d7('0x12')](_0x42d7('0x15'),_0x413d35['message'],_0x5a208a);_0x32cc19(_0x1504c6[_0x42d7('0x12')](0x1f4,_0x413d35[_0x42d7('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x3fc17e){var _0x10feee=this;return new Promise(function(_0x22cb4b,_0x4c650f){return db['CmHopperBlack'][_0x42d7('0x20')](_0x3fc17e[_0x42d7('0x21')],{'raw':_0x3fc17e[_0x42d7('0x17')]?_0x3fc17e[_0x42d7('0x17')][_0x42d7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fc17e['options']?_0x3fc17e[_0x42d7('0x17')]['where']||null:null,'attributes':_0x3fc17e[_0x42d7('0x17')]?_0x3fc17e[_0x42d7('0x17')][_0x42d7('0x1e')]||null:null,'limit':_0x3fc17e[_0x42d7('0x17')]?_0x3fc17e['options'][_0x42d7('0x1a')]||null:null})[_0x42d7('0xc')](function(_0x4cbaff){logger[_0x42d7('0xd')](_0x42d7('0x22'),_0x3fc17e);logger[_0x42d7('0x1f')]('UpdateCmHopperBlack',_0x3fc17e,JSON[_0x42d7('0x11')](_0x4cbaff));_0x22cb4b(_0x4cbaff);})['catch'](function(_0x8cb7dc){logger[_0x42d7('0x12')]('UpdateCmHopperBlack',_0x8cb7dc['message'],_0x3fc17e);_0x4c650f(_0x10feee[_0x42d7('0x12')](0x1f4,_0x8cb7dc[_0x42d7('0x13')]));});});};exports[_0x42d7('0x23')]=function(_0xc4ebb1){var _0x327426=this;return new Promise(function(_0x446e2d,_0x4f16c2){return db[_0x42d7('0x16')]['destroy']({'where':_0xc4ebb1[_0x42d7('0x17')]?_0xc4ebb1['options']['where']||null:null})[_0x42d7('0xc')](function(_0x1ee2e6){logger[_0x42d7('0xd')](_0x42d7('0x23'),_0xc4ebb1);logger[_0x42d7('0x1f')](_0x42d7('0x23'),_0xc4ebb1,JSON[_0x42d7('0x11')](_0x1ee2e6));_0x446e2d(_0x1ee2e6);})['catch'](function(_0x5d5c9e){logger[_0x42d7('0x12')](_0x42d7('0x23'),_0x5d5c9e[_0x42d7('0x13')],_0xc4ebb1);_0x4f16c2(_0x327426['error'](0x1f4,_0x5d5c9e['message']));});});};
\ No newline at end of file
index 946e6cd..02c8d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7096=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update'];(function(_0x2a4110,_0x31454b){var _0x27549c=function(_0x201cc4){while(--_0x201cc4){_0x2a4110['push'](_0x2a4110['shift']());}};_0x27549c(++_0x31454b);}(_0x7096,0x10c));var _0x6709=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7096[_0x47b58b];return _0x46bebe;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0xe')](_0x6709('0xf'),auth[_0x6709('0x9')](),controller[_0x6709('0x10')]);router['delete']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0x11')]);module[_0x6709('0x12')]=router;
\ No newline at end of file
+var _0x90b1=['index','get','/describe','isAuthenticated','describe','/:id','show','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b74e6,_0x117420){var _0x4452b0=function(_0x3d420b){while(--_0x3d420b){_0x1b74e6['push'](_0x1b74e6['shift']());}};_0x4452b0(++_0x117420);}(_0x90b1,0x1bb));var _0x190b=function(_0x4834c7,_0x320620){_0x4834c7=_0x4834c7-0x0;var _0x597940=_0x90b1[_0x4834c7];return _0x597940;};'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 fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0xe')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x10')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller['destroy']);module[_0x190b('0x11')]=router;
\ No newline at end of file
index 2bec774..6102e12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb05=['sequelize','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','BOOLEAN'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xfb05,0x1cc));var _0x5fb0=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xfb05[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require(_0x5fb0('0x0'));var moment=require('moment');module[_0x5fb0('0x1')]={'state':{'type':Sequelize[_0x5fb0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5fb0('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5fb0('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5fb0('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5fb0('0x3')]},'calleridnum':{'type':Sequelize[_0x5fb0('0x3')]},'calleridname':{'type':Sequelize[_0x5fb0('0x3')]},'starttime':{'type':Sequelize[_0x5fb0('0x4')]},'responsetime':{'type':Sequelize[_0x5fb0('0x4')]},'answertime':{'type':Sequelize[_0x5fb0('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5fb0('0x4')]},'ringtime':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5fb0('0x3')]},'campaign':{'type':Sequelize[_0x5fb0('0x3')]},'campaigntype':{'type':Sequelize[_0x5fb0('0x3')]},'membername':{'type':Sequelize[_0x5fb0('0x3')]},'reason':{'type':Sequelize[_0x5fb0('0x3')]},'disposition':{'type':Sequelize[_0x5fb0('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5fb0('0x3')]},'dispositionat':{'type':Sequelize[_0x5fb0('0x4')],'set':function(_0x114b39){var _0x4249f1=this[_0x5fb0('0x5')]('endtime');if(_0x4249f1&&_0x114b39){this[_0x5fb0('0x6')](_0x5fb0('0x7'),moment(_0x114b39)[_0x5fb0('0x8')](moment(_0x4249f1),'seconds'));}return this[_0x5fb0('0x6')]('dispositionat',_0x114b39);}},'amd':{'type':Sequelize[_0x5fb0('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5fb0('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5fb0('0x4')]},'callback':{'type':Sequelize[_0x5fb0('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5fb0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5fb0('0x4')]},'deleted':{'type':Sequelize[_0x5fb0('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5fb0('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5fb0('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5fb0('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x503a=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','INTEGER'];(function(_0x1e9ca8,_0x2af074){var _0x3a83f5=function(_0x2d2f8e){while(--_0x2d2f8e){_0x1e9ca8['push'](_0x1e9ca8['shift']());}};_0x3a83f5(++_0x2af074);}(_0x503a,0x77));var _0xa503=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x503a[_0xb833b1];return _0x1ab87a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xa503('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xa503('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xa503('0x1')]},'originatecalleridname':{'type':Sequelize[_0xa503('0x1')]},'calleridnum':{'type':Sequelize[_0xa503('0x1')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa503('0x2')]},'responsetime':{'type':Sequelize[_0xa503('0x2')]},'answertime':{'type':Sequelize[_0xa503('0x2')]},'droptime':{'type':Sequelize[_0xa503('0x2')]},'endtime':{'type':Sequelize[_0xa503('0x2')]},'ringtime':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xa503('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa503('0x1')]},'disposition':{'type':Sequelize[_0xa503('0x1')]},'secondDisposition':{'type':Sequelize[_0xa503('0x1')]},'thirdDisposition':{'type':Sequelize[_0xa503('0x1')]},'dispositionat':{'type':Sequelize[_0xa503('0x2')],'set':function(_0x7f65c){var _0x233800=this[_0xa503('0x3')](_0xa503('0x4'));if(_0x233800&&_0x7f65c){this[_0xa503('0x5')](_0xa503('0x6'),moment(_0x7f65c)[_0xa503('0x7')](moment(_0x233800),_0xa503('0x8')));}return this[_0xa503('0x5')]('dispositionat',_0x7f65c);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xa503('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa503('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa503('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa503('0x2')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa503('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa503('0x2')]},'deleted':{'type':Sequelize[_0xa503('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa503('0x2')]},'recallme':{'type':Sequelize[_0xa503('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa503('0x2')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa503('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index a6d90fe..ce91cf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x24087a,_0x297ef1){var _0x47ae2d=function(_0x41e2ef){while(--_0x41e2ef){_0x24087a['push'](_0x24087a['shift']());}};_0x47ae2d(++_0x297ef1);}(_0x2a07,0x74));var _0x72a0=function(_0xa62163,_0x4a26fb){_0xa62163=_0xa62163-0x0;var _0x46b4fb=_0x2a07[_0xa62163];return _0x46b4fb;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));};
\ No newline at end of file
+var _0xfcf0=['noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','state\x20=\x20?','state','toString','VoiceQueueId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ListId','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null'];(function(_0x59ae95,_0x5c3671){var _0x5276f7=function(_0x4094ee){while(--_0x4094ee){_0x59ae95['push'](_0x59ae95['shift']());}};_0x5276f7(++_0x5c3671);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0xfcf0[_0x4492af];return _0x216729;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':!![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')]()[_0x0fcf('0x24')](respondWithResult(_0x345188,null))['catch'](handleError(_0x345188,null));};exports['update']=function(_0x259c91,_0x243699){if(_0x259c91[_0x0fcf('0x47')][_0x0fcf('0x48')]){delete _0x259c91[_0x0fcf('0x47')][_0x0fcf('0x48')];}return db['CmHopperFinal'][_0x0fcf('0x49')]({'where':{'uniqueid':_0x259c91[_0x0fcf('0x43')]['id']}})['then'](handleEntityNotFound(_0x243699,null))[_0x0fcf('0x24')](saveUpdates(_0x259c91[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x243699,null))[_0x0fcf('0x42')](handleError(_0x243699,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xc514bf,_0x382448,_0x1bb062){return db[_0x0fcf('0x2b')][_0x0fcf('0x4a')]({'raw':![],'where':{'VoiceQueueId':_0xc514bf[_0x0fcf('0x43')]['id']},'attributes':[[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x4e')))),_0x0fcf('0x4f')],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x50')))),_0x0fcf('0x51')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')]['literal'](_0x0fcf('0x52')))),_0x0fcf('0x53')],[db['sequelize']['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x54')))),_0x0fcf('0x55')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0fcf('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x0fcf('0x56')],[db[_0x0fcf('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x57')))),'abandonedContacts'],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0x0fcf('0x58')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x59')))),_0x0fcf('0x5a')]]})[_0x0fcf('0x24')](handleEntityNotFound(_0x382448,null))[_0x0fcf('0x24')](respondWithResult(_0x382448,null))[_0x0fcf('0x42')](handleError(_0x382448,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x62d12e,_0x1dda2e,_0x6af0f5){return db[_0x0fcf('0x2b')][_0x0fcf('0x4a')]({'raw':![],'where':{'CampaignId':_0x62d12e[_0x0fcf('0x43')]['id']},'attributes':[[db[_0x0fcf('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x0fcf('0x4f')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x50')))),_0x0fcf('0x51')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x52')))),_0x0fcf('0x53')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x54')))),_0x0fcf('0x55')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x5b')))),_0x0fcf('0x56')],[db['sequelize']['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x57')))),_0x0fcf('0x5c')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x0fcf('0x24')](handleEntityNotFound(_0x1dda2e,null))[_0x0fcf('0x24')](respondWithResult(_0x1dda2e,null))['catch'](handleError(_0x1dda2e,null));};exports[_0x0fcf('0x5d')]=function(_0x3cb75a,_0x5936a6,_0x3d02c1){return db[_0x0fcf('0x5e')][_0x0fcf('0x49')]({'where':{'id':_0x3cb75a[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x5936a6,null))[_0x0fcf('0x24')](function(_0x4704c9){var _0x4b1f10;if(_0x4704c9){_0x4b1f10=squel[_0x0fcf('0x5f')]()[_0x0fcf('0x60')](_0x0fcf('0x61'))[_0x0fcf('0x62')]([_0x0fcf('0x63'),_0x0fcf('0x64'),'ContactId','ListId',_0x0fcf('0x65'),_0x0fcf('0x66'),_0x0fcf('0x67')],squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x69'),_0x0fcf('0x63'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x64'))['field']('ANY_VALUE(ContactId)',_0x0fcf('0x6c'))['field'](_0x0fcf('0x6d'),'ListId')[_0x0fcf('0x6a')](_0x0fcf('0x6e'),_0x0fcf('0x65'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),'createdAt')[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x67'))[_0x0fcf('0x6f')]('cm_hopper_final')[_0x0fcf('0x3d')]('VoiceQueueId\x20=\x20?',_0x3cb75a[_0x0fcf('0x43')]['id']['toString']())[_0x0fcf('0x3d')](_0x0fcf('0x70'),_0x3cb75a['body'][_0x0fcf('0x71')][_0x0fcf('0x72')]())[_0x0fcf('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x63'))[_0x0fcf('0x6f')](_0x0fcf('0x61'))[_0x0fcf('0x3d')](_0x0fcf('0x73'),_0x3cb75a[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]()))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel['select']()[_0x0fcf('0x6a')](_0x0fcf('0x75'))[_0x0fcf('0x6f')](_0x0fcf('0x76'))[_0x0fcf('0x3d')](_0x0fcf('0x73'),_0x3cb75a[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]())['where'](_0x0fcf('0x77')))[_0x0fcf('0x78')](_0x0fcf('0x6c')))[_0x0fcf('0x72')]();return db[_0x0fcf('0x4b')][_0x0fcf('0x33')](_0x4b1f10);}return[];})[_0x0fcf('0x24')](respondWithResult(_0x5936a6,null))['catch'](handleError(_0x5936a6,null));};exports[_0x0fcf('0x79')]=function(_0x489c6d,_0x18645d,_0x9e933e){return db[_0x0fcf('0x7a')]['find']({'where':{'id':_0x489c6d['params']['id']}})['then'](handleEntityNotFound(_0x18645d,null))['then'](function(_0x301991){var _0x46bcc2;if(_0x301991){_0x46bcc2=squel[_0x0fcf('0x5f')]()[_0x0fcf('0x60')](_0x0fcf('0x61'))[_0x0fcf('0x62')]([_0x0fcf('0x63'),_0x0fcf('0x64'),_0x0fcf('0x6c'),_0x0fcf('0x7b'),_0x0fcf('0x7c'),'createdAt',_0x0fcf('0x67')],squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x69'),'phone')[_0x0fcf('0x6a')](_0x0fcf('0x6b'),'scheduledAt')['field'](_0x0fcf('0x7d'),_0x0fcf('0x6c'))['field'](_0x0fcf('0x6d'),_0x0fcf('0x7b'))[_0x0fcf('0x6a')](_0x0fcf('0x7e'),_0x0fcf('0x7c'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x66'))['field'](_0x0fcf('0x6b'),_0x0fcf('0x67'))[_0x0fcf('0x6f')](_0x0fcf('0x76'))['where'](_0x0fcf('0x7f'),_0x489c6d['params']['id']['toString']())['where'](_0x0fcf('0x70'),_0x489c6d[_0x0fcf('0x47')][_0x0fcf('0x71')][_0x0fcf('0x72')]())[_0x0fcf('0x3d')](_0x0fcf('0x80'))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x63'))[_0x0fcf('0x6f')](_0x0fcf('0x61'))[_0x0fcf('0x3d')](_0x0fcf('0x7f'),_0x489c6d[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]()))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel['select']()['field']('calleridnum')[_0x0fcf('0x6f')](_0x0fcf('0x76'))[_0x0fcf('0x3d')](_0x0fcf('0x7f'),_0x489c6d['params']['id']['toString']())['where'](_0x0fcf('0x77')))['group'](_0x0fcf('0x6c')))['toString']();return db[_0x0fcf('0x4b')]['query'](_0x46bcc2);}return[];})[_0x0fcf('0x24')](respondWithResult(_0x18645d,null))['catch'](handleError(_0x18645d,null));};exports['checkContactHopper']=function(_0x426625,_0x4ccae3,_0x2905fa){return db[_0x0fcf('0x81')][_0x0fcf('0x82')]({'where':{'VoiceQueueId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x65')],'CampaignId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x7c')],'ContactId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x6c')]}})[_0x0fcf('0x24')](handleEntityNotFound(_0x4ccae3,null))[_0x0fcf('0x24')](function(_0x274aa9){if(_0x274aa9){return _0x274aa9;}return null;})[_0x0fcf('0x24')](respondWithResult(_0x4ccae3,null))['catch'](handleError(_0x4ccae3,null));};
\ No newline at end of file
index 46a0258..2057272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa53d=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0xa53d,0xb6));var _0xda53=function(_0x20b40c,_0x514c73){_0x20b40c=_0x20b40c-0x0;var _0x37ff34=_0xa53d[_0x20b40c];return _0x37ff34;};'use strict';var _=require(_0xda53('0x0'));var util=require(_0xda53('0x1'));var logger=require(_0xda53('0x2'))(_0xda53('0x3'));var moment=require(_0xda53('0x4'));var BPromise=require(_0xda53('0x5'));var rp=require(_0xda53('0x6'));var fs=require('fs');var path=require(_0xda53('0x7'));var rimraf=require(_0xda53('0x8'));var config=require(_0xda53('0x9'));var attributes=require('./cmHopperFinal.attributes');module[_0xda53('0xa')]=function(_0x180397,_0x6a00f3){return _0x180397[_0xda53('0xb')](_0xda53('0xc'),attributes,{'tableName':_0xda53('0xd'),'paranoid':![],'indexes':[{'name':_0xda53('0xe'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xda53('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe253=['CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0xe253,0x6b));var _0x3e25=function(_0x4c7270,_0x13fbfb){_0x4c7270=_0x4c7270-0x0;var _0x4ec5e9=_0xe253[_0x4c7270];return _0x4ec5e9;};'use strict';var _=require(_0x3e25('0x0'));var util=require(_0x3e25('0x1'));var logger=require(_0x3e25('0x2'))(_0x3e25('0x3'));var moment=require(_0x3e25('0x4'));var BPromise=require(_0x3e25('0x5'));var rp=require(_0x3e25('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e25('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x3e25('0x8')]=function(_0xbd1b4,_0x41d69c){return _0xbd1b4[_0x3e25('0x9')](_0x3e25('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3e25('0xb'),'fields':[_0x3e25('0xb')]},{'name':_0x3e25('0xc'),'fields':[_0x3e25('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4df006e..e6e227f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2dcbb9,_0x3b5d74){var _0x4b75e0=function(_0x2b91d7){while(--_0x2b91d7){_0x2dcbb9['push'](_0x2dcbb9['shift']());}};_0x4b75e0(++_0x3b5d74);}(_0xb10b,0x12a));var _0xbb10=function(_0x29eb10,_0x190cb3){_0x29eb10=_0x29eb10-0x0;var _0x5371a2=_0xb10b[_0x29eb10];return _0x5371a2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4fa6aa,_0x507536){var _0x244d4d=function(_0x71eb12){while(--_0x71eb12){_0x4fa6aa['push'](_0x4fa6aa['shift']());}};_0x244d4d(++_0x507536);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ecbad,_0xe90ac4){_0x1ecbad=_0x1ecbad-0x0;var _0x50fe57=_0xb10b[_0x1ecbad];return _0x50fe57;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
index 82b4876..8f934cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6e8=['express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','index','get','isAuthenticated','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','multer','util','path','connect-timeout'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xc6e8,0x9e));var _0x8c6e=function(_0x3e9d06,_0x30e68f){_0x3e9d06=_0x3e9d06-0x0;var _0x1f5e28=_0xc6e8[_0x3e9d06];return _0x1f5e28;};'use strict';var multer=require(_0x8c6e('0x0'));var util=require(_0x8c6e('0x1'));var path=require(_0x8c6e('0x2'));var timeout=require(_0x8c6e('0x3'));var express=require(_0x8c6e('0x4'));var router=express['Router']();var fs_extra=require(_0x8c6e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c6e('0x6'));var config=require(_0x8c6e('0x7'));var controller=require(_0x8c6e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8c6e('0x9')]);router[_0x8c6e('0xa')]('/describe',auth[_0x8c6e('0xb')](),controller[_0x8c6e('0xc')]);router[_0x8c6e('0xa')]('/:id',auth[_0x8c6e('0xb')](),controller[_0x8c6e('0xd')]);router[_0x8c6e('0xa')](_0x8c6e('0xe'),auth[_0x8c6e('0xb')](),controller[_0x8c6e('0xf')]);router['get'](_0x8c6e('0x10'),auth['isAuthenticated'](),controller[_0x8c6e('0x11')]);router[_0x8c6e('0x12')](_0x8c6e('0x13'),auth[_0x8c6e('0xb')](),controller[_0x8c6e('0x14')]);router[_0x8c6e('0x12')](_0x8c6e('0x15'),auth['isAuthenticated'](),controller[_0x8c6e('0x16')]);router[_0x8c6e('0x12')](_0x8c6e('0x17'),auth['isAuthenticated'](),controller[_0x8c6e('0x18')]);router[_0x8c6e('0x19')](_0x8c6e('0x1a'),auth[_0x8c6e('0xb')](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0x7c13=['describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated'];(function(_0x184fc6,_0x4ff1db){var _0x3ddaf2=function(_0x38ed92){while(--_0x38ed92){_0x184fc6['push'](_0x184fc6['shift']());}};_0x3ddaf2(++_0x4ff1db);}(_0x7c13,0xfd));var _0x37c1=function(_0x12012d,_0x46e1f6){_0x12012d=_0x12012d-0x0;var _0x2ccaf1=_0x7c13[_0x12012d];return _0x2ccaf1;};'use strict';var multer=require(_0x37c1('0x0'));var util=require(_0x37c1('0x1'));var path=require('path');var timeout=require(_0x37c1('0x2'));var express=require(_0x37c1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37c1('0x4'));var interaction=require(_0x37c1('0x5'));var config=require(_0x37c1('0x6'));var controller=require(_0x37c1('0x7'));router[_0x37c1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x37c1('0x9'),auth[_0x37c1('0xa')](),controller[_0x37c1('0xb')]);router['get'](_0x37c1('0xc'),auth[_0x37c1('0xa')](),controller['show']);router['get'](_0x37c1('0xd'),auth[_0x37c1('0xa')](),controller[_0x37c1('0xe')]);router['get'](_0x37c1('0xf'),auth[_0x37c1('0xa')](),controller[_0x37c1('0x10')]);router[_0x37c1('0x11')](_0x37c1('0x12'),auth['isAuthenticated'](),controller[_0x37c1('0x13')]);router[_0x37c1('0x11')](_0x37c1('0x14'),auth['isAuthenticated'](),controller[_0x37c1('0x15')]);router[_0x37c1('0x11')]('/checkContactHopper',auth[_0x37c1('0xa')](),controller[_0x37c1('0x16')]);router[_0x37c1('0x17')](_0x37c1('0xc'),auth[_0x37c1('0xa')](),controller['update']);module['exports']=router;
\ No newline at end of file
index 65a61fb..e441829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62fc=['exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x182cdd,_0x20c7d1){var _0x5c4424=function(_0x15ce57){while(--_0x15ce57){_0x182cdd['push'](_0x182cdd['shift']());}};_0x5c4424(++_0x20c7d1);}(_0x62fc,0x1db));var _0xc62f=function(_0x5803ec,_0x10644c){_0x5803ec=_0x5803ec-0x0;var _0x1f11fe=_0x62fc[_0x5803ec];return _0x1f11fe;};'use strict';var Sequelize=require('sequelize');module[_0xc62f('0x0')]={'state':{'type':Sequelize[_0xc62f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc62f('0x2')]},'scheduledat':{'type':Sequelize[_0xc62f('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc62f('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc62f('0x2')]},'originatecalleridname':{'type':Sequelize[_0xc62f('0x2')]},'calleridnum':{'type':Sequelize[_0xc62f('0x2')]},'calleridname':{'type':Sequelize[_0xc62f('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xc62f('0x3')]},'droptime':{'type':Sequelize[_0xc62f('0x3')]},'endtime':{'type':Sequelize[_0xc62f('0x3')]},'ringtime':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc62f('0x2')]},'campaign':{'type':Sequelize[_0xc62f('0x2')]},'campaigntype':{'type':Sequelize[_0xc62f('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xc62f('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc62f('0x3')]},'edited':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc62f('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2314=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x19e2e6,_0x531b3c){var _0x1d4fa5=function(_0xe07f38){while(--_0xe07f38){_0x19e2e6['push'](_0x19e2e6['shift']());}};_0x1d4fa5(++_0x531b3c);}(_0x2314,0x107));var _0x4231=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x2314[_0x2f3ecd];return _0xffdc44;};'use strict';var Sequelize=require(_0x4231('0x0'));module[_0x4231('0x1')]={'state':{'type':Sequelize[_0x4231('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4231('0x3')]},'scheduledat':{'type':Sequelize[_0x4231('0x4')]},'countbusyretry':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x4231('0x3')]},'calleridnum':{'type':Sequelize[_0x4231('0x3')]},'calleridname':{'type':Sequelize[_0x4231('0x3')]},'starttime':{'type':Sequelize[_0x4231('0x4')]},'responsetime':{'type':Sequelize[_0x4231('0x4')]},'answertime':{'type':Sequelize[_0x4231('0x4')]},'droptime':{'type':Sequelize[_0x4231('0x4')]},'endtime':{'type':Sequelize[_0x4231('0x4')]},'ringtime':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4231('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4231('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x4231('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4231('0x4')]},'recallme':{'type':Sequelize[_0x4231('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4231('0x4')]},'edited':{'type':Sequelize[_0x4231('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4231('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 9783be8..2874063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeed=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','destroy','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','keys','length','catch','create','describe','body','uniqueid','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash'];(function(_0x213190,_0x58c768){var _0x1477a5=function(_0x596bc5){while(--_0x596bc5){_0x213190['push'](_0x213190['shift']());}};_0x1477a5(++_0x58c768);}(_0xfeed,0x1bc));var _0xdfee=function(_0x5873fd,_0x7c77a9){_0x5873fd=_0x5873fd-0x0;var _0x2312b9=_0xfeed[_0x5873fd];return _0x2312b9;};'use strict';var emlformat=require(_0xdfee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfee('0x1'));var jsonpatch=require(_0xdfee('0x2'));var rp=require(_0xdfee('0x3'));var moment=require(_0xdfee('0x4'));var BPromise=require(_0xdfee('0x5'));var Mustache=require(_0xdfee('0x6'));var util=require(_0xdfee('0x7'));var path=require('path');var sox=require(_0xdfee('0x8'));var csv=require('to-csv');var ejs=require(_0xdfee('0x9'));var fs=require('fs');var fs_extra=require(_0xdfee('0xa'));var _=require(_0xdfee('0xb'));var squel=require(_0xdfee('0xc'));var crypto=require(_0xdfee('0xd'));var jsforce=require(_0xdfee('0xe'));var deskjs=require(_0xdfee('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdfee('0x10'));var Papa=require(_0xdfee('0x11'));var Redis=require(_0xdfee('0x12'));var authService=require(_0xdfee('0x13'));var qs=require(_0xdfee('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfee('0x15'));var logger=require(_0xdfee('0x16'))(_0xdfee('0x17'));var utils=require('../../config/utils');var config=require(_0xdfee('0x18'));var licenseUtil=require(_0xdfee('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x238af2,_0x1c30b5){_0x1c30b5=_0x1c30b5||0xcc;return function(_0x2b1c63){if(_0x2b1c63){return _0x238af2[_0xdfee('0x1a')](_0x1c30b5);}return _0x238af2[_0xdfee('0x1b')](_0x1c30b5)[_0xdfee('0x1c')]();};}function respondWithResult(_0x25c87c,_0x2f6bd8){_0x2f6bd8=_0x2f6bd8||0xc8;return function(_0x56cc34){if(_0x56cc34){return _0x25c87c[_0xdfee('0x1b')](_0x2f6bd8)[_0xdfee('0x1d')](_0x56cc34);}};}function respondWithFilteredResult(_0x3dfefd,_0x471941){return function(_0x33b0b7){if(_0x33b0b7){var _0x9921ad=typeof _0x471941[_0xdfee('0x1e')]===_0xdfee('0x1f')&&typeof _0x471941[_0xdfee('0x20')]===_0xdfee('0x1f');var _0x64af38=_0x33b0b7[_0xdfee('0x21')];var _0x57ca9d=_0x9921ad?0x0:_0x471941['offset'];var _0x16732c=_0x9921ad?_0x33b0b7[_0xdfee('0x21')]:_0x471941['offset']+_0x471941['limit'];var _0x5e4fdf;if(_0x16732c>=_0x64af38){_0x16732c=_0x64af38;_0x5e4fdf=0xc8;}else{_0x5e4fdf=0xce;}_0x3dfefd['status'](_0x5e4fdf);return _0x3dfefd['set']('Content-Range',_0x57ca9d+'-'+_0x16732c+'/'+_0x64af38)[_0xdfee('0x1d')](_0x33b0b7);}return null;};}function patchUpdates(_0xa78e84){return function(_0x50f8a4){try{jsonpatch['apply'](_0x50f8a4,_0xa78e84,!![]);}catch(_0x193fd7){return BPromise[_0xdfee('0x22')](_0x193fd7);}return _0x50f8a4['save']();};}function saveUpdates(_0x26001b,_0x5da18e){return function(_0x46e7ca){if(_0x46e7ca){return _0x46e7ca[_0xdfee('0x23')](_0x26001b)['then'](function(_0x855903){return _0x855903;});}return null;};}function removeEntity(_0x536358,_0x500edc){return function(_0x3be2ad){if(_0x3be2ad){return _0x3be2ad[_0xdfee('0x24')]()[_0xdfee('0x25')](function(){_0x536358[_0xdfee('0x1b')](0xcc)[_0xdfee('0x1c')]();});}};}function handleEntityNotFound(_0x38a598,_0x221564){return function(_0x2eac90){if(!_0x2eac90){_0x38a598[_0xdfee('0x1a')](0x194);}return _0x2eac90;};}function handleError(_0x142e80,_0x1740e1){_0x1740e1=_0x1740e1||0x1f4;return function(_0x3cfa1d){logger[_0xdfee('0x26')](_0x3cfa1d[_0xdfee('0x27')]);if(_0x3cfa1d[_0xdfee('0x28')]){delete _0x3cfa1d[_0xdfee('0x28')];}_0x142e80['status'](_0x1740e1)[_0xdfee('0x29')](_0x3cfa1d);};}exports[_0xdfee('0x2a')]=function(_0x1e0a70,_0x581a62){var _0x4cc826={},_0x378c00={},_0xc3fed={'count':0x0,'rows':[]};var _0x15189f=_[_0xdfee('0x2b')](db[_0xdfee('0x2c')][_0xdfee('0x2d')],function(_0x3d2e32){return{'name':_0x3d2e32['fieldName'],'type':_0x3d2e32[_0xdfee('0x2e')][_0xdfee('0x2f')]};});_0x378c00[_0xdfee('0x30')]=_['map'](_0x15189f,'name');_0x378c00['query']=_['keys'](_0x1e0a70['query']);_0x378c00[_0xdfee('0x31')]=_['intersection'](_0x378c00[_0xdfee('0x30')],_0x378c00['query']);_0x4cc826[_0xdfee('0x32')]=_[_0xdfee('0x33')](_0x378c00[_0xdfee('0x30')],qs[_0xdfee('0x34')](_0x1e0a70[_0xdfee('0x35')][_0xdfee('0x34')]));_0x4cc826['attributes']=_0x4cc826[_0xdfee('0x32')]['length']?_0x4cc826['attributes']:_0x378c00[_0xdfee('0x30')];if(!_0x1e0a70[_0xdfee('0x35')][_0xdfee('0x36')](_0xdfee('0x37'))){_0x4cc826[_0xdfee('0x20')]=qs[_0xdfee('0x20')](_0x1e0a70['query'][_0xdfee('0x20')]);_0x4cc826['offset']=qs[_0xdfee('0x1e')](_0x1e0a70['query'][_0xdfee('0x1e')]);}_0x4cc826['order']=qs[_0xdfee('0x38')](_0x1e0a70[_0xdfee('0x35')]['sort']);_0x4cc826[_0xdfee('0x39')]=qs[_0xdfee('0x31')](_[_0xdfee('0x3a')](_0x1e0a70[_0xdfee('0x35')],_0x378c00[_0xdfee('0x31')]),_0x15189f);if(_0x1e0a70[_0xdfee('0x35')]['filter']){_0x4cc826[_0xdfee('0x39')]=_[_0xdfee('0x3b')](_0x4cc826[_0xdfee('0x39')],{'$or':_[_0xdfee('0x2b')](_0x15189f,function(_0x150716){if(_0x150716[_0xdfee('0x2e')]!==_0xdfee('0x3c')){var _0x293653={};_0x293653[_0x150716['name']]={'$like':'%'+_0x1e0a70[_0xdfee('0x35')][_0xdfee('0x3d')]+'%'};return _0x293653;}})});}_0x4cc826=_[_0xdfee('0x3b')]({},_0x4cc826,_0x1e0a70[_0xdfee('0x3e')]);var _0x27404f={'where':_0x4cc826[_0xdfee('0x39')]};return db[_0xdfee('0x2c')]['count'](_0x27404f)[_0xdfee('0x25')](function(_0x3acb93){_0xc3fed[_0xdfee('0x21')]=_0x3acb93;if(_0x1e0a70[_0xdfee('0x35')][_0xdfee('0x3f')]){_0x4cc826[_0xdfee('0x40')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4cc826);})['then'](function(_0x2d9a4f){_0xc3fed[_0xdfee('0x41')]=_0x2d9a4f;return _0xc3fed;})['then'](respondWithFilteredResult(_0x581a62,_0x4cc826))['catch'](handleError(_0x581a62,null));};exports[_0xdfee('0x42')]=function(_0x2c09f1,_0x199074){var _0x5e3b52={'raw':!![],'where':{'id':_0x2c09f1['params']['id']}},_0x559d79={};_0x559d79[_0xdfee('0x30')]=_[_0xdfee('0x43')](db[_0xdfee('0x2c')][_0xdfee('0x2d')]);_0x559d79[_0xdfee('0x35')]=_[_0xdfee('0x43')](_0x2c09f1[_0xdfee('0x35')]);_0x559d79[_0xdfee('0x31')]=_[_0xdfee('0x33')](_0x559d79[_0xdfee('0x30')],_0x559d79[_0xdfee('0x35')]);_0x5e3b52[_0xdfee('0x32')]=_[_0xdfee('0x33')](_0x559d79[_0xdfee('0x30')],qs[_0xdfee('0x34')](_0x2c09f1['query'][_0xdfee('0x34')]));_0x5e3b52['attributes']=_0x5e3b52['attributes'][_0xdfee('0x44')]?_0x5e3b52[_0xdfee('0x32')]:_0x559d79[_0xdfee('0x30')];if(_0x2c09f1['query'][_0xdfee('0x3f')]){_0x5e3b52['include']=[{'all':!![]}];}_0x5e3b52=_[_0xdfee('0x3b')]({},_0x5e3b52,_0x2c09f1['options']);return db[_0xdfee('0x2c')]['find'](_0x5e3b52)[_0xdfee('0x25')](handleEntityNotFound(_0x199074,null))[_0xdfee('0x25')](respondWithResult(_0x199074,null))[_0xdfee('0x45')](handleError(_0x199074,null));};exports[_0xdfee('0x46')]=function(_0x3466c1,_0x538094){return db[_0xdfee('0x2c')][_0xdfee('0x46')](_0x3466c1['body'],{})[_0xdfee('0x25')](respondWithResult(_0x538094,0xc9))['catch'](handleError(_0x538094,null));};exports[_0xdfee('0x47')]=function(_0x160fd7,_0x4bf42b){return db['CmHopperHistory'][_0xdfee('0x47')]()[_0xdfee('0x25')](respondWithResult(_0x4bf42b,null))['catch'](handleError(_0x4bf42b,null));};exports['update']=function(_0x3e92d3,_0xaa3e08){if(_0x3e92d3[_0xdfee('0x48')]['uniqueid']){delete _0x3e92d3[_0xdfee('0x48')][_0xdfee('0x49')];}return db[_0xdfee('0x2c')][_0xdfee('0x4a')]({'where':{'uniqueid':_0x3e92d3[_0xdfee('0x4b')]['id']}})[_0xdfee('0x25')](handleEntityNotFound(_0xaa3e08,null))[_0xdfee('0x25')](saveUpdates(_0x3e92d3[_0xdfee('0x48')],null))[_0xdfee('0x25')](respondWithResult(_0xaa3e08,null))['catch'](handleError(_0xaa3e08,null));};
\ No newline at end of file
+var _0x0c01=['catch','create','describe','update','body','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','show','params','intersection'];(function(_0xab12d4,_0x5e5d8e){var _0x355e03=function(_0x410dd6){while(--_0x410dd6){_0xab12d4['push'](_0xab12d4['shift']());}};_0x355e03(++_0x5e5d8e);}(_0x0c01,0x13b));var _0x10c0=function(_0x1a1f4b,_0x279274){_0x1a1f4b=_0x1a1f4b-0x0;var _0xa37f79=_0x0c01[_0x1a1f4b];return _0xa37f79;};'use strict';var emlformat=require(_0x10c0('0x0'));var rimraf=require(_0x10c0('0x1'));var zipdir=require(_0x10c0('0x2'));var jsonpatch=require(_0x10c0('0x3'));var rp=require(_0x10c0('0x4'));var moment=require(_0x10c0('0x5'));var BPromise=require(_0x10c0('0x6'));var Mustache=require('mustache');var util=require(_0x10c0('0x7'));var path=require('path');var sox=require(_0x10c0('0x8'));var csv=require(_0x10c0('0x9'));var ejs=require(_0x10c0('0xa'));var fs=require('fs');var fs_extra=require(_0x10c0('0xb'));var _=require(_0x10c0('0xc'));var squel=require(_0x10c0('0xd'));var crypto=require('crypto');var jsforce=require(_0x10c0('0xe'));var deskjs=require(_0x10c0('0xf'));var toCsv=require(_0x10c0('0x9'));var querystring=require(_0x10c0('0x10'));var Papa=require(_0x10c0('0x11'));var Redis=require(_0x10c0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x10c0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x10c0('0x14'))(_0x10c0('0x15'));var utils=require('../../config/utils');var config=require(_0x10c0('0x16'));var licenseUtil=require(_0x10c0('0x17'));var db=require(_0x10c0('0x18'))['db'];function respondWithStatusCode(_0x2ca460,_0x2db3a9){_0x2db3a9=_0x2db3a9||0xcc;return function(_0x3ec6b8){if(_0x3ec6b8){return _0x2ca460[_0x10c0('0x19')](_0x2db3a9);}return _0x2ca460[_0x10c0('0x1a')](_0x2db3a9)[_0x10c0('0x1b')]();};}function respondWithResult(_0x3ac089,_0x404144){_0x404144=_0x404144||0xc8;return function(_0x50afc3){if(_0x50afc3){return _0x3ac089[_0x10c0('0x1a')](_0x404144)['json'](_0x50afc3);}};}function respondWithFilteredResult(_0xf7bf36,_0x38463f){return function(_0x1bd982){if(_0x1bd982){var _0x13c159=typeof _0x38463f['offset']===_0x10c0('0x1c')&&typeof _0x38463f['limit']===_0x10c0('0x1c');var _0x113ffe=_0x1bd982[_0x10c0('0x1d')];var _0x52e414=_0x13c159?0x0:_0x38463f[_0x10c0('0x1e')];var _0x28c19c=_0x13c159?_0x1bd982[_0x10c0('0x1d')]:_0x38463f['offset']+_0x38463f[_0x10c0('0x1f')];var _0x32d0da;if(_0x28c19c>=_0x113ffe){_0x28c19c=_0x113ffe;_0x32d0da=0xc8;}else{_0x32d0da=0xce;}_0xf7bf36[_0x10c0('0x1a')](_0x32d0da);return _0xf7bf36['set'](_0x10c0('0x20'),_0x52e414+'-'+_0x28c19c+'/'+_0x113ffe)['json'](_0x1bd982);}return null;};}function patchUpdates(_0xd71497){return function(_0x1095d4){try{jsonpatch[_0x10c0('0x21')](_0x1095d4,_0xd71497,!![]);}catch(_0x32d41c){return BPromise[_0x10c0('0x22')](_0x32d41c);}return _0x1095d4[_0x10c0('0x23')]();};}function saveUpdates(_0x1b05fa,_0x3f4ae9){return function(_0x13494c){if(_0x13494c){return _0x13494c['update'](_0x1b05fa)[_0x10c0('0x24')](function(_0x50c361){return _0x50c361;});}return null;};}function removeEntity(_0x1095b6,_0x23e076){return function(_0x20dc2d){if(_0x20dc2d){return _0x20dc2d[_0x10c0('0x25')]()['then'](function(){_0x1095b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e9425,_0x20b340){return function(_0x48703f){if(!_0x48703f){_0x1e9425[_0x10c0('0x19')](0x194);}return _0x48703f;};}function handleError(_0x12e5a6,_0x52397b){_0x52397b=_0x52397b||0x1f4;return function(_0x587e0d){logger[_0x10c0('0x26')](_0x587e0d[_0x10c0('0x27')]);if(_0x587e0d['name']){delete _0x587e0d[_0x10c0('0x28')];}_0x12e5a6[_0x10c0('0x1a')](_0x52397b)[_0x10c0('0x29')](_0x587e0d);};}exports[_0x10c0('0x2a')]=function(_0x4a4b28,_0x2f5269){var _0x2c5568={},_0x2d8b8d={},_0x43cf1c={'count':0x0,'rows':[]};var _0x1bc27e=_[_0x10c0('0x2b')](db['CmHopperHistory']['rawAttributes'],function(_0x32d837){return{'name':_0x32d837[_0x10c0('0x2c')],'type':_0x32d837[_0x10c0('0x2d')][_0x10c0('0x2e')]};});_0x2d8b8d[_0x10c0('0x2f')]=_[_0x10c0('0x2b')](_0x1bc27e,_0x10c0('0x28'));_0x2d8b8d['query']=_[_0x10c0('0x30')](_0x4a4b28[_0x10c0('0x31')]);_0x2d8b8d[_0x10c0('0x32')]=_['intersection'](_0x2d8b8d[_0x10c0('0x2f')],_0x2d8b8d['query']);_0x2c5568[_0x10c0('0x33')]=_['intersection'](_0x2d8b8d[_0x10c0('0x2f')],qs[_0x10c0('0x34')](_0x4a4b28[_0x10c0('0x31')][_0x10c0('0x34')]));_0x2c5568['attributes']=_0x2c5568[_0x10c0('0x33')][_0x10c0('0x35')]?_0x2c5568[_0x10c0('0x33')]:_0x2d8b8d[_0x10c0('0x2f')];if(!_0x4a4b28['query']['hasOwnProperty'](_0x10c0('0x36'))){_0x2c5568[_0x10c0('0x1f')]=qs[_0x10c0('0x1f')](_0x4a4b28[_0x10c0('0x31')][_0x10c0('0x1f')]);_0x2c5568[_0x10c0('0x1e')]=qs[_0x10c0('0x1e')](_0x4a4b28[_0x10c0('0x31')][_0x10c0('0x1e')]);}_0x2c5568[_0x10c0('0x37')]=qs['sort'](_0x4a4b28[_0x10c0('0x31')][_0x10c0('0x38')]);_0x2c5568[_0x10c0('0x39')]=qs[_0x10c0('0x32')](_[_0x10c0('0x3a')](_0x4a4b28[_0x10c0('0x31')],_0x2d8b8d['filters']),_0x1bc27e);if(_0x4a4b28['query']['filter']){_0x2c5568[_0x10c0('0x39')]=_[_0x10c0('0x3b')](_0x2c5568[_0x10c0('0x39')],{'$or':_[_0x10c0('0x2b')](_0x1bc27e,function(_0x1c03aa){if(_0x1c03aa[_0x10c0('0x2d')]!==_0x10c0('0x3c')){var _0x449804={};_0x449804[_0x1c03aa[_0x10c0('0x28')]]={'$like':'%'+_0x4a4b28['query']['filter']+'%'};return _0x449804;}})});}_0x2c5568=_[_0x10c0('0x3b')]({},_0x2c5568,_0x4a4b28[_0x10c0('0x3d')]);var _0x54fa61={'where':_0x2c5568['where']};return db[_0x10c0('0x3e')][_0x10c0('0x1d')](_0x54fa61)[_0x10c0('0x24')](function(_0x276be5){_0x43cf1c[_0x10c0('0x1d')]=_0x276be5;if(_0x4a4b28['query'][_0x10c0('0x3f')]){_0x2c5568[_0x10c0('0x40')]=[{'all':!![]}];}return db[_0x10c0('0x3e')][_0x10c0('0x41')](_0x2c5568);})[_0x10c0('0x24')](function(_0x24067b){_0x43cf1c[_0x10c0('0x42')]=_0x24067b;return _0x43cf1c;})['then'](respondWithFilteredResult(_0x2f5269,_0x2c5568))['catch'](handleError(_0x2f5269,null));};exports[_0x10c0('0x43')]=function(_0x200f6a,_0x4a2376){var _0x4287c3={'raw':!![],'where':{'id':_0x200f6a[_0x10c0('0x44')]['id']}},_0x1411a1={};_0x1411a1[_0x10c0('0x2f')]=_[_0x10c0('0x30')](db[_0x10c0('0x3e')]['rawAttributes']);_0x1411a1[_0x10c0('0x31')]=_['keys'](_0x200f6a['query']);_0x1411a1[_0x10c0('0x32')]=_['intersection'](_0x1411a1[_0x10c0('0x2f')],_0x1411a1[_0x10c0('0x31')]);_0x4287c3[_0x10c0('0x33')]=_[_0x10c0('0x45')](_0x1411a1[_0x10c0('0x2f')],qs[_0x10c0('0x34')](_0x200f6a[_0x10c0('0x31')][_0x10c0('0x34')]));_0x4287c3[_0x10c0('0x33')]=_0x4287c3[_0x10c0('0x33')][_0x10c0('0x35')]?_0x4287c3[_0x10c0('0x33')]:_0x1411a1[_0x10c0('0x2f')];if(_0x200f6a[_0x10c0('0x31')][_0x10c0('0x3f')]){_0x4287c3['include']=[{'all':!![]}];}_0x4287c3=_[_0x10c0('0x3b')]({},_0x4287c3,_0x200f6a[_0x10c0('0x3d')]);return db['CmHopperHistory']['find'](_0x4287c3)[_0x10c0('0x24')](handleEntityNotFound(_0x4a2376,null))[_0x10c0('0x24')](respondWithResult(_0x4a2376,null))[_0x10c0('0x46')](handleError(_0x4a2376,null));};exports[_0x10c0('0x47')]=function(_0xcce947,_0x155bbb){return db['CmHopperHistory']['create'](_0xcce947['body'],{})[_0x10c0('0x24')](respondWithResult(_0x155bbb,0xc9))[_0x10c0('0x46')](handleError(_0x155bbb,null));};exports['describe']=function(_0x163a5e,_0x403879){return db[_0x10c0('0x3e')][_0x10c0('0x48')]()[_0x10c0('0x24')](respondWithResult(_0x403879,null))[_0x10c0('0x46')](handleError(_0x403879,null));};exports[_0x10c0('0x49')]=function(_0x1c5254,_0x57897b){if(_0x1c5254['body']['uniqueid']){delete _0x1c5254[_0x10c0('0x4a')][_0x10c0('0x4b')];}return db[_0x10c0('0x3e')][_0x10c0('0x4c')]({'where':{'uniqueid':_0x1c5254[_0x10c0('0x44')]['id']}})[_0x10c0('0x24')](handleEntityNotFound(_0x57897b,null))['then'](saveUpdates(_0x1c5254[_0x10c0('0x4a')],null))[_0x10c0('0x24')](respondWithResult(_0x57897b,null))['catch'](handleError(_0x57897b,null));};
\ No newline at end of file
index 9de5bd4..b0ee807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5a2=['bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x52eca7,_0x1622b3){_0x52eca7=_0x52eca7-0x0;var _0x306df3=_0xd5a2[_0x52eca7];return _0x306df3;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var logger=require(_0x2d5a('0x1'))(_0x2d5a('0x2'));var moment=require(_0x2d5a('0x3'));var BPromise=require(_0x2d5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module[_0x2d5a('0x9')]=function(_0x1187b5,_0x923c29){return _0x1187b5[_0x2d5a('0xa')](_0x2d5a('0xb'),attributes,{'tableName':_0x2d5a('0xc'),'paranoid':![],'indexes':[{'name':_0x2d5a('0xd'),'fields':['endtime']},{'name':'uniqueid','fields':[_0x2d5a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5360=['rimraf','../../config/environment','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','request-promise'];(function(_0x367749,_0x422372){var _0xe27918=function(_0x4dce71){while(--_0x4dce71){_0x367749['push'](_0x367749['shift']());}};_0xe27918(++_0x422372);}(_0x5360,0x157));var _0x0536=function(_0x1e746e,_0x6b6c15){_0x1e746e=_0x1e746e-0x0;var _0x53a9f3=_0x5360[_0x1e746e];return _0x53a9f3;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var logger=require(_0x0536('0x2'))(_0x0536('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0536('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0536('0x5'));var config=require(_0x0536('0x6'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x4fc885,_0x459432){return _0x4fc885[_0x0536('0x7')](_0x0536('0x8'),attributes,{'tableName':_0x0536('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0536('0xa')]},{'name':_0x0536('0xb'),'fields':[_0x0536('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 53815a8..c6d518a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc7=['AvgHandleTime','findAll','raw','where','col','predictiveIntervalTotalCalls','sequelize','COUNT','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CmHopperHistory','create','body','options','CreateCmHopperHistory','stringify'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x5fc7[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var moment=require(_0x75fc('0x2'));var BPromise=require(_0x75fc('0x3'));var rs=require(_0x75fc('0x4'));var fs=require('fs');var Redis=require(_0x75fc('0x5'));var db=require(_0x75fc('0x6'))['db'];var utils=require(_0x75fc('0x7'));var logger=require(_0x75fc('0x8'))(_0x75fc('0x9'));var config=require(_0x75fc('0xa'));var jayson=require(_0x75fc('0xb'));var client=jayson['client'][_0x75fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc85b45,_0x1430f3,_0x347ce8){return new BPromise(function(_0x17a1d5,_0x15f3bc){return client[_0x75fc('0xd')](_0xc85b45,_0x347ce8)[_0x75fc('0xe')](function(_0x957f42){logger[_0x75fc('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1430f3,_0x75fc('0x10'));logger[_0x75fc('0x11')](_0x75fc('0x12'),_0x1430f3,_0x75fc('0x10'),JSON['stringify'](_0x957f42));if(_0x957f42[_0x75fc('0x13')]){if(_0x957f42[_0x75fc('0x13')][_0x75fc('0x14')]===0x1f4){logger[_0x75fc('0x13')](_0x75fc('0x15'),_0x1430f3,_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);return _0x15f3bc(_0x957f42['error']['message']);}logger['error'](_0x75fc('0x15'),_0x1430f3,_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);return _0x17a1d5(_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);}else{logger[_0x75fc('0xf')](_0x75fc('0x15'),_0x1430f3,_0x75fc('0x10'));_0x17a1d5(_0x957f42['result'][_0x75fc('0x16')]);}})[_0x75fc('0x17')](function(_0x51011d){logger[_0x75fc('0x13')](_0x75fc('0x15'),_0x1430f3,_0x51011d);_0x15f3bc(_0x51011d);});});}exports['CreateCmHopperHistory']=function(_0x5cdf1e){var _0x25b52b=this;return new Promise(function(_0x2608bf,_0x3b1edf){return db[_0x75fc('0x18')][_0x75fc('0x19')](_0x5cdf1e[_0x75fc('0x1a')],{'raw':_0x5cdf1e['options']?_0x5cdf1e[_0x75fc('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x75fc('0xe')](function(_0x2373b0){logger[_0x75fc('0xf')](_0x75fc('0x1c'),_0x5cdf1e);logger['debug'](_0x75fc('0x1c'),_0x5cdf1e,JSON[_0x75fc('0x1d')](_0x2373b0));_0x2608bf(_0x2373b0);})['catch'](function(_0x458cc4){logger[_0x75fc('0x13')]('CreateCmHopperHistory',_0x458cc4[_0x75fc('0x16')],_0x5cdf1e);_0x3b1edf(_0x25b52b['error'](0x1f4,_0x458cc4[_0x75fc('0x16')]));});});};exports[_0x75fc('0x1e')]=function(_0x54b684){var _0xd8b8e1=this;return new Promise(function(_0x151046,_0x5a62ef){return db[_0x75fc('0x18')][_0x75fc('0x1f')]({'raw':_0x54b684['options']?_0x54b684['options'][_0x75fc('0x20')]===undefined?!![]:![]:!![],'where':_0x54b684['options']?_0x54b684[_0x75fc('0x1b')][_0x75fc('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0x75fc('0x22')]('id')),_0x75fc('0x23')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0x75fc('0x27')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')]('`state`\x20=\x2010,\x201,\x20null'))),_0x75fc('0x28')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')]('`state`\x20=\x2011,\x201,\x20null'))),_0x75fc('0x29')],[db[_0x75fc('0x24')]['fn']('AVG',db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x2a')))),_0x75fc('0x2b')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x2c'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x2d')))),'predictiveIntervalAvgTalktime']]})[_0x75fc('0xe')](function(_0x447c13){logger[_0x75fc('0xf')](_0x75fc('0x1e'),_0x54b684);logger[_0x75fc('0x11')](_0x75fc('0x1e'),_0x54b684,JSON[_0x75fc('0x1d')](_0x447c13));_0x151046(_0x447c13);})[_0x75fc('0x17')](function(_0x1ad353){logger[_0x75fc('0x13')](_0x75fc('0x1e'),_0x1ad353[_0x75fc('0x16')],_0x54b684);_0x5a62ef(_0xd8b8e1[_0x75fc('0x13')](0x1f4,_0x1ad353['message']));});});};exports[_0x75fc('0x2e')]=function(_0x1c9e6f){var _0x9636fe=this;return new Promise(function(_0x19e172,_0x51b9fa){return db[_0x75fc('0x18')][_0x75fc('0x1f')]({'raw':_0x1c9e6f[_0x75fc('0x1b')]?_0x1c9e6f[_0x75fc('0x1b')][_0x75fc('0x20')]===undefined?!![]:![]:!![],'where':_0x1c9e6f[_0x75fc('0x1b')]?_0x1c9e6f[_0x75fc('0x1b')][_0x75fc('0x21')]||null:null,'attributes':[['campaign',_0x75fc('0x2f')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x200,\x201,\x20null'))),_0x75fc('0x30')],[db[_0x75fc('0x24')]['fn']('COUNT',db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x31')))),_0x75fc('0x32')],[db['sequelize']['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x33')))),_0x75fc('0x34')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x205,\x201,\x20null'))),_0x75fc('0x35')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x36')))),_0x75fc('0x37')],[db[_0x75fc('0x24')]['fn']('COUNT',db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x38')))),_0x75fc('0x39')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x75fc('0x3a')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')]('`state`\x20=\x2013,\x201,\x20null'))),_0x75fc('0x3b')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')](_0x75fc('0x3c')))),_0x75fc('0x3d')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x3e')))),'outboundRejectCallsDay'],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x3f')))),_0x75fc('0x40')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x41')))),_0x75fc('0x42')],[db['sequelize']['fn']('COUNT',db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')](_0x75fc('0x43')))),_0x75fc('0x44')]],'group':[_0x75fc('0x45')]})[_0x75fc('0xe')](function(_0xee6e51){logger[_0x75fc('0xf')](_0x75fc('0x2e'),_0x1c9e6f);logger[_0x75fc('0x11')](_0x75fc('0x2e'),_0x1c9e6f,JSON['stringify'](_0xee6e51));_0x19e172(_0xee6e51);})[_0x75fc('0x17')](function(_0x152ac6){logger[_0x75fc('0x13')]('GetVoiceQueueHopperHistory',_0x152ac6['message'],_0x1c9e6f);_0x51b9fa(_0x9636fe[_0x75fc('0x13')](0x1f4,_0x152ac6[_0x75fc('0x16')]));});});};exports[_0x75fc('0x46')]=function(_0x7e65e1){var _0x4f6d63=this;return new Promise(function(_0x18fa7a,_0x47d7d8){return db['CmHopperHistory'][_0x75fc('0x1f')]({'raw':_0x7e65e1['options']?_0x7e65e1[_0x75fc('0x1b')][_0x75fc('0x20')]===undefined?!![]:![]:!![],'where':_0x7e65e1[_0x75fc('0x1b')]?_0x7e65e1['options'][_0x75fc('0x21')]||null:null,'attributes':[[_0x75fc('0x45'),_0x75fc('0x2f')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')][_0x75fc('0x22')]('id')),_0x75fc('0x47')],[db[_0x75fc('0x24')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x33')))),_0x75fc('0x48')]],'group':['campaign']})[_0x75fc('0xe')](function(_0x3d2687){logger['info'](_0x75fc('0x46'),_0x7e65e1);logger[_0x75fc('0x11')](_0x75fc('0x46'),_0x7e65e1,JSON['stringify'](_0x3d2687));_0x18fa7a(_0x3d2687);})[_0x75fc('0x17')](function(_0xc54460){logger[_0x75fc('0x13')](_0x75fc('0x46'),_0xc54460[_0x75fc('0x16')],_0x7e65e1);_0x47d7d8(_0x4f6d63[_0x75fc('0x13')](0x1f4,_0xc54460[_0x75fc('0x16')]));});});};
\ No newline at end of file
+var _0x106b=['outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','stringify','catch','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','then','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x106b,0xa2));var _0xb106=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x106b[_0x296897];return _0x2b44ab;};'use strict';var _=require(_0xb106('0x0'));var util=require(_0xb106('0x1'));var moment=require(_0xb106('0x2'));var BPromise=require(_0xb106('0x3'));var rs=require(_0xb106('0x4'));var fs=require('fs');var Redis=require(_0xb106('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb106('0x6'));var logger=require(_0xb106('0x7'))(_0xb106('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb106('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462961,_0x10c8f2,_0x10134a){return new BPromise(function(_0x3997e9,_0x3c4b4c){return client[_0xb106('0xa')](_0x462961,_0x10134a)['then'](function(_0x3200e6){logger[_0xb106('0xb')](_0xb106('0xc'),_0x10c8f2,_0xb106('0xd'));logger[_0xb106('0xe')](_0xb106('0xf'),_0x10c8f2,_0xb106('0xd'),JSON['stringify'](_0x3200e6));if(_0x3200e6[_0xb106('0x10')]){if(_0x3200e6[_0xb106('0x10')][_0xb106('0x11')]===0x1f4){logger[_0xb106('0x10')](_0xb106('0xc'),_0x10c8f2,_0x3200e6[_0xb106('0x10')][_0xb106('0x12')]);return _0x3c4b4c(_0x3200e6['error'][_0xb106('0x12')]);}logger['error'](_0xb106('0xc'),_0x10c8f2,_0x3200e6[_0xb106('0x10')][_0xb106('0x12')]);return _0x3997e9(_0x3200e6[_0xb106('0x10')][_0xb106('0x12')]);}else{logger[_0xb106('0xb')](_0xb106('0xc'),_0x10c8f2,_0xb106('0xd'));_0x3997e9(_0x3200e6[_0xb106('0x13')][_0xb106('0x12')]);}})['catch'](function(_0x5175e8){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x10c8f2,_0x5175e8);_0x3c4b4c(_0x5175e8);});});}exports['CreateCmHopperHistory']=function(_0x442b36){var _0x371d15=this;return new Promise(function(_0x25ad30,_0x1d1c26){return db[_0xb106('0x14')][_0xb106('0x15')](_0x442b36[_0xb106('0x16')],{'raw':_0x442b36['options']?_0x442b36[_0xb106('0x17')][_0xb106('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x48438a){logger[_0xb106('0xb')](_0xb106('0x19'),_0x442b36);logger['debug'](_0xb106('0x19'),_0x442b36,JSON[_0xb106('0x1a')](_0x48438a));_0x25ad30(_0x48438a);})[_0xb106('0x1b')](function(_0x32d504){logger[_0xb106('0x10')](_0xb106('0x19'),_0x32d504[_0xb106('0x12')],_0x442b36);_0x1d1c26(_0x371d15['error'](0x1f4,_0x32d504[_0xb106('0x12')]));});});};exports[_0xb106('0x1c')]=function(_0x5a9b09){var _0x3bf0b9=this;return new Promise(function(_0x125e1e,_0x4f46aa){return db['CmHopperHistory'][_0xb106('0x1d')]({'raw':_0x5a9b09[_0xb106('0x17')]?_0x5a9b09[_0xb106('0x17')][_0xb106('0x18')]===undefined?!![]:![]:!![],'where':_0x5a9b09['options']?_0x5a9b09[_0xb106('0x17')][_0xb106('0x1e')]||null:null,'attributes':[[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')][_0xb106('0x21')]('id')),_0xb106('0x22')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x24')))),_0xb106('0x25')],[db[_0xb106('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xb106('0x23')](_0xb106('0x26')))),_0xb106('0x27')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x28')))),_0xb106('0x29')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x2a'),db[_0xb106('0x1f')]['fn']('IF',db['sequelize'][_0xb106('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xb106('0x2b')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x2a'),db[_0xb106('0x1f')]['fn']('IF',db['sequelize'][_0xb106('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xb106('0x2c')]]})[_0xb106('0x2d')](function(_0x4d1699){logger[_0xb106('0xb')]('AvgHandleTime',_0x5a9b09);logger[_0xb106('0xe')](_0xb106('0x1c'),_0x5a9b09,JSON['stringify'](_0x4d1699));_0x125e1e(_0x4d1699);})[_0xb106('0x1b')](function(_0x1481b6){logger[_0xb106('0x10')](_0xb106('0x1c'),_0x1481b6[_0xb106('0x12')],_0x5a9b09);_0x4f46aa(_0x3bf0b9['error'](0x1f4,_0x1481b6[_0xb106('0x12')]));});});};exports[_0xb106('0x2e')]=function(_0x544e9f){var _0x340bd7=this;return new Promise(function(_0x18bc8c,_0x1b77ca){return db['CmHopperHistory'][_0xb106('0x1d')]({'raw':_0x544e9f[_0xb106('0x17')]?_0x544e9f['options']['raw']===undefined?!![]:![]:!![],'where':_0x544e9f[_0xb106('0x17')]?_0x544e9f[_0xb106('0x17')]['where']||null:null,'attributes':[[_0xb106('0x2f'),_0xb106('0x30')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0xb106('0x31')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xb106('0x32')],[db[_0xb106('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xb106('0x33')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')]['literal'](_0xb106('0x34')))),_0xb106('0x35')],[db['sequelize']['fn']('COUNT',db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x36')))),_0xb106('0x37')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x38')))),_0xb106('0x39')],[db['sequelize']['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x3a')))),_0xb106('0x3b')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x3c')))),_0xb106('0x3d')],[db['sequelize']['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x3e')))),'outboundBlacklistCallsDay'],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db['sequelize']['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x3f')))),_0xb106('0x40')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db['sequelize'][_0xb106('0x23')](_0xb106('0x41')))),_0xb106('0x42')],[db[_0xb106('0x1f')]['fn']('COUNT',db[_0xb106('0x1f')]['fn']('IF',db['sequelize'][_0xb106('0x23')](_0xb106('0x43')))),_0xb106('0x44')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x45')))),'outboundRejectCallsDay'],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db['sequelize']['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x46')))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x45fb46){logger[_0xb106('0xb')](_0xb106('0x2e'),_0x544e9f);logger[_0xb106('0xe')](_0xb106('0x2e'),_0x544e9f,JSON['stringify'](_0x45fb46));_0x18bc8c(_0x45fb46);})[_0xb106('0x1b')](function(_0x2c49c1){logger[_0xb106('0x10')](_0xb106('0x2e'),_0x2c49c1['message'],_0x544e9f);_0x1b77ca(_0x340bd7[_0xb106('0x10')](0x1f4,_0x2c49c1[_0xb106('0x12')]));});});};exports[_0xb106('0x47')]=function(_0x19105d){var _0x540243=this;return new Promise(function(_0x1ba85a,_0x2e7b8c){return db[_0xb106('0x14')]['findAll']({'raw':_0x19105d['options']?_0x19105d[_0xb106('0x17')][_0xb106('0x18')]===undefined?!![]:![]:!![],'where':_0x19105d[_0xb106('0x17')]?_0x19105d['options'][_0xb106('0x1e')]||null:null,'attributes':[[_0xb106('0x2f'),_0xb106('0x30')],[db['sequelize']['fn'](_0xb106('0x20'),db[_0xb106('0x1f')][_0xb106('0x21')]('id')),_0xb106('0x48')],[db[_0xb106('0x1f')]['fn'](_0xb106('0x20'),db[_0xb106('0x1f')]['fn']('IF',db[_0xb106('0x1f')][_0xb106('0x23')](_0xb106('0x24')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0xb106('0x2d')](function(_0x22b319){logger[_0xb106('0xb')](_0xb106('0x47'),_0x19105d);logger[_0xb106('0xe')]('GetCampaignHopperHistory',_0x19105d,JSON[_0xb106('0x1a')](_0x22b319));_0x1ba85a(_0x22b319);})[_0xb106('0x1b')](function(_0x2bd63d){logger[_0xb106('0x10')](_0xb106('0x47'),_0x2bd63d['message'],_0x19105d);_0x2e7b8c(_0x540243['error'](0x1f4,_0x2bd63d['message']));});});};
\ No newline at end of file
index 85c2db2..04bbfec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadda=['/:id','show','create','update','exports','multer','Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x46bac8,_0x33ca8c){var _0x3b196c=function(_0x31f2b6){while(--_0x31f2b6){_0x46bac8['push'](_0x46bac8['shift']());}};_0x3b196c(++_0x33ca8c);}(_0xadda,0x140));var _0xaadd=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xadda[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0xaadd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaadd('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xaadd('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xaadd('0x3'));var controller=require(_0xaadd('0x4'));router['get']('/',auth[_0xaadd('0x5')](),controller[_0xaadd('0x6')]);router[_0xaadd('0x7')](_0xaadd('0x8'),auth['isAuthenticated'](),controller[_0xaadd('0x9')]);router['get'](_0xaadd('0xa'),auth['isAuthenticated'](),controller[_0xaadd('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaadd('0xc')]);router['put'](_0xaadd('0xa'),auth[_0xaadd('0x5')](),controller[_0xaadd('0xd')]);module[_0xaadd('0xe')]=router;
\ No newline at end of file
+var _0x0af0=['show','post','create','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x30977b,_0x22be64){var _0x339a92=function(_0x2d7a68){while(--_0x2d7a68){_0x30977b['push'](_0x30977b['shift']());}};_0x339a92(++_0x22be64);}(_0x0af0,0xd5));var _0x00af=function(_0x3b9e13,_0x3cdc73){_0x3b9e13=_0x3b9e13-0x0;var _0x4ea299=_0x0af0[_0x3b9e13];return _0x4ea299;};'use strict';var multer=require(_0x00af('0x0'));var util=require(_0x00af('0x1'));var path=require(_0x00af('0x2'));var timeout=require(_0x00af('0x3'));var express=require('express');var router=express[_0x00af('0x4')]();var fs_extra=require(_0x00af('0x5'));var auth=require(_0x00af('0x6'));var interaction=require(_0x00af('0x7'));var config=require(_0x00af('0x8'));var controller=require(_0x00af('0x9'));router['get']('/',auth[_0x00af('0xa')](),controller['index']);router[_0x00af('0xb')](_0x00af('0xc'),auth[_0x00af('0xa')](),controller[_0x00af('0xd')]);router[_0x00af('0xb')](_0x00af('0xe'),auth['isAuthenticated'](),controller[_0x00af('0xf')]);router[_0x00af('0x10')]('/',auth[_0x00af('0xa')](),controller[_0x00af('0x11')]);router['put'](_0x00af('0xe'),auth[_0x00af('0xa')](),controller[_0x00af('0x12')]);module['exports']=router;
\ No newline at end of file
index 1489a06..d5606d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5243=['name','STRING','sequelize'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x5243,0x71));var _0x3524=function(_0x134ce1,_0x5a4d43){_0x134ce1=_0x134ce1-0x0;var _0x5a8e49=_0x5243[_0x134ce1];return _0x5a8e49;};'use strict';var Sequelize=require(_0x3524('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3524('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3524('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8c79=['sequelize','STRING'];(function(_0x4771e2,_0x2d7b51){var _0x24c284=function(_0x2d5eb8){while(--_0x2d5eb8){_0x4771e2['push'](_0x4771e2['shift']());}};_0x24c284(++_0x2d7b51);}(_0x8c79,0xa8));var _0x98c7=function(_0x381bff,_0x19d01f){_0x381bff=_0x381bff-0x0;var _0x201ab1=_0x8c79[_0x381bff];return _0x201ab1;};'use strict';var Sequelize=require(_0x98c7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x98c7('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5d82307..87825f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa403=['rows','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','describe','ListId','Disposition','getDispositions','findOne','nolimit','findAll','removeDispositions','CmContact','tags','isArray','join','push','each','omit','ids','success','dataValues','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','writeFileSync','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','Sequelize','TEXT','INTEGER','switch','BOOLEAN','cm_contacts','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x3796a6,_0x548d50){var _0x389313=function(_0x29fb04){while(--_0x29fb04){_0x3796a6['push'](_0x3796a6['shift']());}};_0x389313(++_0x548d50);}(_0xa403,0x1f2));var _0x3a40=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xa403[_0x27c068];return _0xe5a67f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a40('0x0'));var zipdir=require(_0x3a40('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a40('0x2'));var moment=require(_0x3a40('0x3'));var BPromise=require(_0x3a40('0x4'));var Mustache=require(_0x3a40('0x5'));var util=require(_0x3a40('0x6'));var path=require(_0x3a40('0x7'));var sox=require(_0x3a40('0x8'));var csv=require(_0x3a40('0x9'));var ejs=require(_0x3a40('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a40('0xb'));var squel=require('squel');var crypto=require(_0x3a40('0xc'));var jsforce=require(_0x3a40('0xd'));var deskjs=require(_0x3a40('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a40('0xf'));var Papa=require(_0x3a40('0x10'));var Redis=require('ioredis');var authService=require(_0x3a40('0x11'));var qs=require(_0x3a40('0x12'));var as=require(_0x3a40('0x13'));var hardwareService=require(_0x3a40('0x14'));var logger=require(_0x3a40('0x15'))('api');var utils=require(_0x3a40('0x16'));var config=require(_0x3a40('0x17'));var licenseUtil=require(_0x3a40('0x18'));var db=require(_0x3a40('0x19'))['db'];config[_0x3a40('0x1a')]=_[_0x3a40('0x1b')](config[_0x3a40('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a40('0x1c'))(new Redis(config[_0x3a40('0x1a')]));require(_0x3a40('0x1d'))['register'](socket);function respondWithStatusCode(_0x4060ff,_0x34ce3b){_0x34ce3b=_0x34ce3b||0xcc;return function(_0x130d72){if(_0x130d72){return _0x4060ff[_0x3a40('0x1e')](_0x34ce3b);}return _0x4060ff['status'](_0x34ce3b)[_0x3a40('0x1f')]();};}function respondWithResult(_0xcbcb1c,_0x330c5){_0x330c5=_0x330c5||0xc8;return function(_0xbe5dd6){if(_0xbe5dd6){return _0xcbcb1c[_0x3a40('0x20')](_0x330c5)['json'](_0xbe5dd6);}};}function respondWithFilteredResult(_0x492d02,_0xdb19ec){return function(_0x44b0fd){if(_0x44b0fd){var _0x3032b1=typeof _0xdb19ec[_0x3a40('0x21')]==='undefined'&&typeof _0xdb19ec[_0x3a40('0x22')]===_0x3a40('0x23');var _0x5535f6=_0x44b0fd[_0x3a40('0x24')];var _0x54219b=_0x3032b1?0x0:_0xdb19ec['offset'];var _0x24cd73=_0x3032b1?_0x44b0fd['count']:_0xdb19ec['offset']+_0xdb19ec[_0x3a40('0x22')];var _0x39c4c5;if(_0x24cd73>=_0x5535f6){_0x24cd73=_0x5535f6;_0x39c4c5=0xc8;}else{_0x39c4c5=0xce;}_0x492d02['status'](_0x39c4c5);return _0x492d02[_0x3a40('0x25')](_0x3a40('0x26'),_0x54219b+'-'+_0x24cd73+'/'+_0x5535f6)[_0x3a40('0x27')](_0x44b0fd);}return null;};}function patchUpdates(_0x4de3e0){return function(_0x4180f8){try{jsonpatch['apply'](_0x4180f8,_0x4de3e0,!![]);}catch(_0x18993e){return BPromise[_0x3a40('0x28')](_0x18993e);}return _0x4180f8['save']();};}function saveUpdates(_0x2d8f3f,_0x484bcf){return function(_0x4b6496){if(_0x4b6496){return _0x4b6496[_0x3a40('0x29')](_0x2d8f3f)[_0x3a40('0x2a')](function(_0x4ff14e){return _0x4ff14e;});}return null;};}function removeEntity(_0x1e98db,_0x5e8f12){return function(_0x5433b5){if(_0x5433b5){return _0x5433b5[_0x3a40('0x2b')]()[_0x3a40('0x2a')](function(){var _0x1adb59=_0x5433b5[_0x3a40('0x2c')]({'plain':!![]});var _0x5787ed='Lists';return db[_0x3a40('0x2d')][_0x3a40('0x2b')]({'where':{'type':_0x5787ed,'resourceId':_0x1adb59['id']}})[_0x3a40('0x2a')](function(){return _0x5433b5;});})['then'](function(){_0x1e98db[_0x3a40('0x20')](0xcc)[_0x3a40('0x1f')]();});}};}function handleEntityNotFound(_0x1b85ef,_0x120cd8){return function(_0x52b81f){if(!_0x52b81f){_0x1b85ef[_0x3a40('0x1e')](0x194);}return _0x52b81f;};}function handleError(_0x97def6,_0x3efced){_0x3efced=_0x3efced||0x1f4;return function(_0x215d91){logger[_0x3a40('0x2e')](_0x215d91[_0x3a40('0x2f')]);if(_0x215d91[_0x3a40('0x30')]){delete _0x215d91['name'];}_0x97def6[_0x3a40('0x20')](_0x3efced)[_0x3a40('0x31')](_0x215d91);};}exports[_0x3a40('0x32')]=function(_0x230661,_0x3f089e){var _0x4633ec={},_0x1a4d98={},_0x131c34={'count':0x0,'rows':[]};var _0x1fbe18=_[_0x3a40('0x33')](db[_0x3a40('0x34')]['rawAttributes'],function(_0x5eb4cd){return{'name':_0x5eb4cd['fieldName'],'type':_0x5eb4cd['type'][_0x3a40('0x35')]};});_0x1a4d98[_0x3a40('0x36')]=_[_0x3a40('0x33')](_0x1fbe18,_0x3a40('0x30'));_0x1a4d98['query']=_[_0x3a40('0x37')](_0x230661['query']);_0x1a4d98[_0x3a40('0x38')]=_[_0x3a40('0x39')](_0x1a4d98[_0x3a40('0x36')],_0x1a4d98[_0x3a40('0x3a')]);_0x4633ec[_0x3a40('0x3b')]=_[_0x3a40('0x39')](_0x1a4d98[_0x3a40('0x36')],qs[_0x3a40('0x3c')](_0x230661['query']['fields']));_0x4633ec[_0x3a40('0x3b')]=_0x4633ec['attributes'][_0x3a40('0x3d')]?_0x4633ec[_0x3a40('0x3b')]:_0x1a4d98[_0x3a40('0x36')];if(!_0x230661[_0x3a40('0x3a')][_0x3a40('0x3e')]('nolimit')){_0x4633ec[_0x3a40('0x22')]=qs[_0x3a40('0x22')](_0x230661['query'][_0x3a40('0x22')]);_0x4633ec[_0x3a40('0x21')]=qs[_0x3a40('0x21')](_0x230661[_0x3a40('0x3a')]['offset']);}_0x4633ec[_0x3a40('0x3f')]=qs['sort'](_0x230661[_0x3a40('0x3a')][_0x3a40('0x40')]);_0x4633ec[_0x3a40('0x41')]=qs[_0x3a40('0x38')](_[_0x3a40('0x42')](_0x230661[_0x3a40('0x3a')],_0x1a4d98[_0x3a40('0x38')]),_0x1fbe18);if(_0x230661['query'][_0x3a40('0x43')]){_0x4633ec['where']=_[_0x3a40('0x44')](_0x4633ec['where'],{'$or':_[_0x3a40('0x33')](_0x1fbe18,function(_0x1eb51e){if(_0x1eb51e[_0x3a40('0x45')]!==_0x3a40('0x46')){var _0x399cbe={};_0x399cbe[_0x1eb51e[_0x3a40('0x30')]]={'$like':'%'+_0x230661['query'][_0x3a40('0x43')]+'%'};return _0x399cbe;}})});}_0x4633ec=_[_0x3a40('0x44')]({},_0x4633ec,_0x230661[_0x3a40('0x47')]);var _0x5c223d={'where':_0x4633ec[_0x3a40('0x41')]};return db[_0x3a40('0x34')][_0x3a40('0x24')](_0x5c223d)[_0x3a40('0x2a')](function(_0xd3ff73){_0x131c34[_0x3a40('0x24')]=_0xd3ff73;if(_0x230661[_0x3a40('0x3a')][_0x3a40('0x48')]){_0x4633ec[_0x3a40('0x49')]=[{'all':!![]}];}return db[_0x3a40('0x34')]['findAll'](_0x4633ec);})[_0x3a40('0x2a')](function(_0x86e03f){_0x131c34[_0x3a40('0x4a')]=_0x86e03f;return _0x131c34;})[_0x3a40('0x2a')](respondWithFilteredResult(_0x3f089e,_0x4633ec))['catch'](handleError(_0x3f089e,null));};exports[_0x3a40('0x4b')]=function(_0x4984ee,_0x388208){var _0xd6bcf9={'raw':![],'where':{'id':_0x4984ee[_0x3a40('0x4c')]['id']}},_0xdc277f={};_0xdc277f['model']=_['keys'](db['CmList'][_0x3a40('0x4d')]);_0xdc277f[_0x3a40('0x3a')]=_[_0x3a40('0x37')](_0x4984ee[_0x3a40('0x3a')]);_0xdc277f[_0x3a40('0x38')]=_[_0x3a40('0x39')](_0xdc277f[_0x3a40('0x36')],_0xdc277f[_0x3a40('0x3a')]);_0xd6bcf9[_0x3a40('0x3b')]=_['intersection'](_0xdc277f['model'],qs[_0x3a40('0x3c')](_0x4984ee[_0x3a40('0x3a')][_0x3a40('0x3c')]));_0xd6bcf9[_0x3a40('0x3b')]=_0xd6bcf9[_0x3a40('0x3b')][_0x3a40('0x3d')]?_0xd6bcf9['attributes']:_0xdc277f[_0x3a40('0x36')];if(_0x4984ee[_0x3a40('0x3a')][_0x3a40('0x48')]){_0xd6bcf9[_0x3a40('0x49')]=[{'all':!![]}];}_0xd6bcf9=_[_0x3a40('0x44')]({},_0xd6bcf9,_0x4984ee[_0x3a40('0x47')]);return db['CmList'][_0x3a40('0x4e')](_0xd6bcf9)[_0x3a40('0x2a')](handleEntityNotFound(_0x388208,null))[_0x3a40('0x2a')](respondWithResult(_0x388208,null))['catch'](handleError(_0x388208,null));};exports[_0x3a40('0x4f')]=function(_0x3eb0b4,_0x138065){return db[_0x3a40('0x34')]['create'](_0x3eb0b4['body'],{})[_0x3a40('0x2a')](function(_0x1993fd){var _0x3fd167=_0x3eb0b4[_0x3a40('0x50')][_0x3a40('0x2c')]({'plain':!![]});if(!_0x3fd167)throw new Error(_0x3a40('0x51'));if(_0x3fd167[_0x3a40('0x52')]===_0x3a40('0x50')){var _0x2400aa=_0x1993fd[_0x3a40('0x2c')]({'plain':!![]});var _0x219d15=_0x3a40('0x53');return db[_0x3a40('0x54')]['find']({'where':{'name':_0x219d15,'userProfileId':_0x3fd167[_0x3a40('0x55')]},'raw':!![]})[_0x3a40('0x2a')](function(_0x51e812){if(_0x51e812&&_0x51e812[_0x3a40('0x56')]===0x0){return db[_0x3a40('0x2d')][_0x3a40('0x4f')]({'name':_0x2400aa[_0x3a40('0x30')],'resourceId':_0x2400aa['id'],'type':_0x51e812[_0x3a40('0x30')],'sectionId':_0x51e812['id']},{})[_0x3a40('0x2a')](function(){return _0x1993fd;});}else{return _0x1993fd;}})['catch'](function(_0x26fd9b){logger[_0x3a40('0x2e')](_0x3a40('0x57'),_0x26fd9b);throw _0x26fd9b;});}return _0x1993fd;})[_0x3a40('0x2a')](respondWithResult(_0x138065,0xc9))[_0x3a40('0x58')](handleError(_0x138065,null));};exports['update']=function(_0x1fb129,_0x2c8555){if(_0x1fb129['body']['id']){delete _0x1fb129[_0x3a40('0x59')]['id'];}return db[_0x3a40('0x34')][_0x3a40('0x4e')]({'where':{'id':_0x1fb129[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x2c8555,null))['then'](saveUpdates(_0x1fb129['body'],null))['then'](respondWithResult(_0x2c8555,null))['catch'](handleError(_0x2c8555,null));};exports[_0x3a40('0x2b')]=function(_0x54e01b,_0x10c623){return db[_0x3a40('0x34')]['find']({'where':{'id':_0x54e01b[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x10c623,null))['then'](removeEntity(_0x10c623,null))[_0x3a40('0x58')](handleError(_0x10c623,null));};exports[_0x3a40('0x5a')]=function(_0x27a66a,_0x36ec43){return db[_0x3a40('0x34')]['describe']()['then'](respondWithResult(_0x36ec43,null))[_0x3a40('0x58')](handleError(_0x36ec43,null));};exports['addDisposition']=function(_0x253465,_0x51547a,_0xbb7dc0){if(_0x253465[_0x3a40('0x59')]['id']){delete _0x253465[_0x3a40('0x59')]['id'];}return db[_0x3a40('0x34')]['find']({'where':{'id':_0x253465['params']['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x51547a,null))[_0x3a40('0x2a')](function(_0xffdc2b){if(_0xffdc2b){_0x253465[_0x3a40('0x59')][_0x3a40('0x5b')]=_0xffdc2b['id'];return db[_0x3a40('0x5c')][_0x3a40('0x4f')](_0x253465[_0x3a40('0x59')]);}})[_0x3a40('0x2a')](respondWithResult(_0x51547a,null))[_0x3a40('0x58')](handleError(_0x51547a,null));};exports[_0x3a40('0x5d')]=function(_0x3faa9c,_0x5a490a,_0x2cebc2){var _0x5477f1={'raw':![],'where':{}};var _0x5907e0={};var _0x3403f5={'count':0x0,'rows':[]};return db[_0x3a40('0x34')][_0x3a40('0x5e')]({'where':{'id':_0x3faa9c[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x5a490a,null))['then'](function(_0x1cc65d){if(_0x1cc65d){_0x5907e0['model']=_[_0x3a40('0x37')](db['Disposition']['rawAttributes']);_0x5907e0[_0x3a40('0x3a')]=_[_0x3a40('0x37')](_0x3faa9c[_0x3a40('0x3a')]);_0x5907e0[_0x3a40('0x38')]=_['intersection'](_0x5907e0[_0x3a40('0x36')],_0x5907e0[_0x3a40('0x3a')]);_0x5477f1[_0x3a40('0x3b')]=_[_0x3a40('0x39')](_0x5907e0[_0x3a40('0x36')],qs[_0x3a40('0x3c')](_0x3faa9c['query'][_0x3a40('0x3c')]));_0x5477f1[_0x3a40('0x3b')]=_0x5477f1[_0x3a40('0x3b')][_0x3a40('0x3d')]?_0x5477f1['attributes']:_0x5907e0[_0x3a40('0x36')];if(!_0x3faa9c['query'][_0x3a40('0x3e')](_0x3a40('0x5f'))){_0x5477f1['limit']=qs['limit'](_0x3faa9c[_0x3a40('0x3a')][_0x3a40('0x22')]);_0x5477f1[_0x3a40('0x21')]=qs[_0x3a40('0x21')](_0x3faa9c[_0x3a40('0x3a')][_0x3a40('0x21')]);}_0x5477f1[_0x3a40('0x3f')]=qs[_0x3a40('0x40')](_0x3faa9c[_0x3a40('0x3a')][_0x3a40('0x40')]);_0x5477f1[_0x3a40('0x41')]=qs[_0x3a40('0x38')](_[_0x3a40('0x42')](_0x3faa9c['query'],_0x5907e0['filters']));_0x5477f1['where'][_0x3a40('0x5b')]=_0x1cc65d['id'];if(_0x3faa9c[_0x3a40('0x3a')][_0x3a40('0x43')]){_0x5477f1[_0x3a40('0x41')]=_[_0x3a40('0x44')](_0x5477f1[_0x3a40('0x41')],{'$or':_[_0x3a40('0x33')](_0x5477f1[_0x3a40('0x3b')],function(_0x39568a){var _0x477b1c={};_0x477b1c[_0x39568a]={'$like':'%'+_0x3faa9c[_0x3a40('0x3a')][_0x3a40('0x43')]+'%'};return _0x477b1c;})});}_0x5477f1=_[_0x3a40('0x44')]({},_0x5477f1,_0x3faa9c['options']);return db[_0x3a40('0x5c')][_0x3a40('0x24')]({'where':_0x5477f1[_0x3a40('0x41')]})[_0x3a40('0x2a')](function(_0x28a1dd){_0x3403f5[_0x3a40('0x24')]=_0x28a1dd;if(_0x3faa9c[_0x3a40('0x3a')][_0x3a40('0x48')]){_0x5477f1['include']=[{'all':!![]}];}return db['Disposition'][_0x3a40('0x60')](_0x5477f1);})[_0x3a40('0x2a')](function(_0x475537){_0x3403f5[_0x3a40('0x4a')]=_0x475537;return _0x3403f5;});}})[_0x3a40('0x2a')](respondWithFilteredResult(_0x5a490a,_0x5477f1))[_0x3a40('0x58')](handleError(_0x5a490a,null));};exports[_0x3a40('0x61')]=function(_0x1793ff,_0x41ecb8,_0x1abc3f){return db[_0x3a40('0x34')][_0x3a40('0x4e')]({'where':{'id':_0x1793ff['params']['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x41ecb8,null))[_0x3a40('0x2a')](function(_0x11d093){if(_0x11d093){return _0x11d093[_0x3a40('0x61')](_0x1793ff['query']['ids']);}})[_0x3a40('0x2a')](respondWithStatusCode(_0x41ecb8,null))[_0x3a40('0x58')](handleError(_0x41ecb8,null));};exports['addContacts']=function(_0x4ecc23,_0x3d0ae4,_0x2eaf72){return db[_0x3a40('0x34')][_0x3a40('0x4e')]({'where':{'id':_0x4ecc23[_0x3a40('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d0ae4,null))[_0x3a40('0x2a')](function(_0x433f73){if(_0x433f73){var _0x52c3ab=[];var _0x4be3ce={'success':[],'errors':[]};return db[_0x3a40('0x62')][_0x3a40('0x5a')]()[_0x3a40('0x2a')](function(_0x2c7107){if(_0x4ecc23[_0x3a40('0x59')][_0x3a40('0x63')]&&_[_0x3a40('0x64')](_0x4ecc23[_0x3a40('0x59')]['tags'])){if(_0x4ecc23[_0x3a40('0x59')]['tags'][_0x3a40('0x3d')]){_0x4ecc23[_0x3a40('0x59')][_0x3a40('0x63')]=_0x4ecc23[_0x3a40('0x59')][_0x3a40('0x63')][_0x3a40('0x65')](';')+';';}else{_0x4ecc23[_0x3a40('0x59')][_0x3a40('0x63')]=null;}}else{_0x4ecc23[_0x3a40('0x59')][_0x3a40('0x63')]=null;}if(_0x4ecc23[_0x3a40('0x59')]&&_[_0x3a40('0x64')](_0x4ecc23[_0x3a40('0x59')])){for(var _0x559b1c=0x0;_0x559b1c<_0x4ecc23[_0x3a40('0x59')]['length'];_0x559b1c+=0x1){_0x4ecc23[_0x3a40('0x59')][_0x559b1c][_0x3a40('0x5b')]=_0x4ecc23[_0x3a40('0x4c')]['id'];_0x52c3ab[_0x3a40('0x66')](_0x4ecc23[_0x3a40('0x59')][_0x559b1c]);}return BPromise[_0x3a40('0x67')](_0x52c3ab,function(_0x25b9e5){return db['CmContact'][_0x3a40('0x4f')](_[_0x3a40('0x68')](_0x25b9e5,[_0x3a40('0x69'),'id'])||{},{'fields':_['keys'](_0x2c7107),'raw':!![]})[_0x3a40('0x2a')](function(_0x4328f3){_0x4be3ce[_0x3a40('0x6a')][_0x3a40('0x66')](_0x4328f3[_0x3a40('0x6b')]);})[_0x3a40('0x58')](function(_0x48767d){_0x4be3ce['errors'][_0x3a40('0x66')]({'data':_0x25b9e5,'error':_0x48767d[_0x3a40('0x6c')]});});})['then'](function(_0x56beca){return _0x4be3ce;})[_0x3a40('0x58')](function(_0x2cfdd6){return _0x2cfdd6;});}else{_0x3d0ae4[_0x3a40('0x20')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x3a40('0x2a')](respondWithResult(_0x3d0ae4,null))[_0x3a40('0x58')](handleError(_0x3d0ae4,null));};exports[_0x3a40('0x6d')]=function(_0x36549a,_0x6f8a1,_0x39c9a7){var _0x6aa910;return db[_0x3a40('0x34')]['find']({'where':{'id':_0x36549a['params']['id']},'include':[{'model':db[_0x3a40('0x6e')],'as':_0x3a40('0x6f')}]})[_0x3a40('0x2a')](handleEntityNotFound(_0x6f8a1,null))[_0x3a40('0x2a')](function(_0x4eb468){if(_0x4eb468){_0x6aa910=_0x4eb468;return db['CmContact'][_0x3a40('0x4d')];}})[_0x3a40('0x2a')](function(_0x2794ba){if(_0x2794ba){var _0x25b282={};var _0x39f2ce={};_0x39f2ce['model']=_[_0x3a40('0x70')](_[_0x3a40('0x37')](_0x2794ba),_['map'](_0x6aa910['CustomFields'],function(_0x1ffe8d){return util[_0x3a40('0x71')](_0x3a40('0x72'),_0x1ffe8d['id']);}));_0x39f2ce['query']=_['keys'](_0x36549a[_0x3a40('0x3a')]);_0x39f2ce[_0x3a40('0x38')]=_[_0x3a40('0x39')](_0x39f2ce[_0x3a40('0x36')],_0x39f2ce[_0x3a40('0x3a')]);_0x25b282[_0x3a40('0x3b')]=_[_0x3a40('0x39')](_0x39f2ce[_0x3a40('0x36')],qs['fields'](_0x36549a['query']['fields']));_0x25b282[_0x3a40('0x3b')]=_0x25b282[_0x3a40('0x3b')][_0x3a40('0x3d')]?_0x25b282['attributes']:_0x39f2ce['model'];if(!_0x36549a[_0x3a40('0x3a')][_0x3a40('0x3e')](_0x3a40('0x5f'))){_0x25b282[_0x3a40('0x22')]=qs['limit'](_0x36549a[_0x3a40('0x3a')][_0x3a40('0x22')]);_0x25b282[_0x3a40('0x21')]=qs['offset'](_0x36549a[_0x3a40('0x3a')][_0x3a40('0x21')]);}_0x25b282[_0x3a40('0x3f')]=qs[_0x3a40('0x40')](_0x36549a[_0x3a40('0x3a')][_0x3a40('0x40')]);_0x25b282[_0x3a40('0x41')]=qs['filters'](_[_0x3a40('0x42')](_0x36549a[_0x3a40('0x3a')],_0x39f2ce[_0x3a40('0x38')]));_0x25b282[_0x3a40('0x73')]=!![];if(_0x36549a[_0x3a40('0x3a')][_0x3a40('0x43')]){_0x25b282['where']=_['merge'](_0x25b282['where'],{'$or':_[_0x3a40('0x33')](_0x25b282[_0x3a40('0x3b')],function(_0x2fc2a1){var _0x23eaea={};_0x23eaea[_0x2fc2a1]={'$like':'%'+_0x36549a['query']['filter']+'%'};return _0x23eaea;})});}_0x25b282=_[_0x3a40('0x44')]({},_0x25b282,_0x36549a['options']);return _0x6aa910[_0x3a40('0x6d')](_0x25b282);}})[_0x3a40('0x2a')](respondWithResult(_0x6f8a1,null))[_0x3a40('0x58')](handleError(_0x6f8a1,null));};exports[_0x3a40('0x74')]=function(_0x2a9594,_0x4bbe8e,_0x3edf9e){var _0x579e21;return db[_0x3a40('0x34')][_0x3a40('0x4e')]({'where':{'id':_0x2a9594['params']['id']},'include':[{'model':db[_0x3a40('0x6e')],'as':_0x3a40('0x6f')}]})[_0x3a40('0x2a')](handleEntityNotFound(_0x4bbe8e,null))[_0x3a40('0x2a')](function(_0x4993c1){if(_0x4993c1){_0x579e21=_0x4993c1;return db[_0x3a40('0x62')][_0x3a40('0x4d')];}})[_0x3a40('0x2a')](function(_0x221537){if(_0x221537){var _0x4358c5={};var _0x2f9a46={};_0x2f9a46['model']=_[_0x3a40('0x70')](_[_0x3a40('0x37')](_0x221537),_[_0x3a40('0x33')](_0x579e21[_0x3a40('0x6f')],function(_0x5df413){return util[_0x3a40('0x71')]('cf_%d',_0x5df413['id']);}));_0x2f9a46[_0x3a40('0x3a')]=_[_0x3a40('0x37')](_0x2a9594[_0x3a40('0x3a')]);_0x2f9a46[_0x3a40('0x38')]=_[_0x3a40('0x39')](_0x2f9a46['model'],_0x2f9a46[_0x3a40('0x3a')]);_0x4358c5[_0x3a40('0x3b')]=_[_0x3a40('0x39')](_0x2f9a46[_0x3a40('0x36')],qs[_0x3a40('0x3c')](_0x2a9594[_0x3a40('0x3a')]['fields']));_0x4358c5[_0x3a40('0x3b')]=_0x4358c5['attributes'][_0x3a40('0x3d')]?_0x4358c5[_0x3a40('0x3b')]:_0x2f9a46[_0x3a40('0x36')];if(!_0x2a9594[_0x3a40('0x3a')][_0x3a40('0x3e')](_0x3a40('0x5f'))){_0x4358c5[_0x3a40('0x22')]=qs[_0x3a40('0x22')](_0x2a9594[_0x3a40('0x3a')][_0x3a40('0x22')]);_0x4358c5[_0x3a40('0x21')]=qs['offset'](_0x2a9594[_0x3a40('0x3a')]['offset']);}_0x4358c5['order']=qs[_0x3a40('0x40')](_0x2a9594[_0x3a40('0x3a')][_0x3a40('0x40')]);_0x4358c5[_0x3a40('0x41')]=qs[_0x3a40('0x38')](_['pick'](_0x2a9594[_0x3a40('0x3a')],_0x2f9a46[_0x3a40('0x38')]));_0x4358c5[_0x3a40('0x73')]=!![];if(_0x2a9594[_0x3a40('0x3a')]['filter']){_0x4358c5[_0x3a40('0x41')]=_[_0x3a40('0x44')](_0x4358c5['where'],{'$or':_[_0x3a40('0x33')](_0x4358c5[_0x3a40('0x3b')],function(_0x1d9cf0){var _0x1420da={};_0x1420da[_0x1d9cf0]={'$like':'%'+_0x2a9594[_0x3a40('0x3a')][_0x3a40('0x43')]+'%'};return _0x1420da;})});}_0x4358c5=_[_0x3a40('0x44')]({},_0x4358c5,_0x2a9594[_0x3a40('0x47')]);return _0x579e21[_0x3a40('0x6d')](_0x4358c5);}})['then'](function(_0xb9d3ec){if(!_[_0x3a40('0x75')](_0xb9d3ec)){var _0x5a4cfe=toCsv(_0xb9d3ec);var _0x583269=Date['now']();fs[_0x3a40('0x76')](util['format']('/tmp/list_%d_%s.csv',_0x579e21['id'],_0x583269),_0x5a4cfe);_0x4bbe8e['setHeader'](_0x3a40('0x77'),_0x3a40('0x78')+util[_0x3a40('0x71')]('list_%d_%s.csv',_0x579e21['id'],_0x583269));_0x4bbe8e['setHeader'](_0x3a40('0x79'),_0x3a40('0x7a'));return _0x4bbe8e[_0x3a40('0x7b')](util['format'](_0x3a40('0x7c'),_0x579e21['id'],_0x583269));}else{return _0x4bbe8e[_0x3a40('0x1e')](0xcc);}})[_0x3a40('0x58')](handleError(_0x4bbe8e,null));};exports[_0x3a40('0x7d')]=function(_0x2cab99,_0x313234,_0x452c15){var _0x16034c;delete _0x2cab99[_0x3a40('0x59')]['id'];return db['CmList'][_0x3a40('0x5e')]({'where':{'id':_0x2cab99[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x313234,null))['then'](function(_0x51f6d8){if(_0x51f6d8){return db[_0x3a40('0x7e')][_0x3a40('0x7f')](function(_0x10e473){return db[_0x3a40('0x6e')][_0x3a40('0x4f')](_0x2cab99[_0x3a40('0x59')],{'transaction':_0x10e473})[_0x3a40('0x2a')](function(_0x2c142d){_0x16034c=_0x2c142d;return _0x51f6d8['addCustomFields'](_0x2c142d,{'transaction':_0x10e473});})[_0x3a40('0x2a')](function(){var _0x4f815c={'type':db[_0x3a40('0x80')][_0x3a40('0x81')],'transaction':_0x10e473};switch(_0x2cab99[_0x3a40('0x59')][_0x3a40('0x45')]){case'text':_0x4f815c['type']=db[_0x3a40('0x80')][_0x3a40('0x81')];break;case'number':_0x4f815c[_0x3a40('0x45')]=db['Sequelize'][_0x3a40('0x82')];break;case _0x3a40('0x83'):_0x4f815c[_0x3a40('0x45')]=db[_0x3a40('0x80')][_0x3a40('0x84')];_0x4f815c['defaultValue']=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0x3a40('0x85'),util[_0x3a40('0x71')]('cf_%s',_0x16034c['id']),_0x4f815c);})[_0x3a40('0x2a')](function(){return _0x16034c;});});}})['then'](respondWithResult(_0x313234,null))[_0x3a40('0x58')](handleError(_0x313234,null));};exports[_0x3a40('0x86')]=function(_0x469e39,_0x35c2e5,_0x3255e8){var _0x48f099={};var _0x38bb21={};var _0x36a0b0;var _0xfcda62;return db['CmList'][_0x3a40('0x5e')]({'where':{'id':_0x469e39[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x35c2e5,null))[_0x3a40('0x2a')](function(_0x270291){if(_0x270291){_0x36a0b0=_0x270291;_0x38bb21[_0x3a40('0x36')]=_[_0x3a40('0x37')](db[_0x3a40('0x6e')]['rawAttributes']);_0x38bb21[_0x3a40('0x3a')]=_[_0x3a40('0x37')](_0x469e39[_0x3a40('0x3a')]);_0x38bb21[_0x3a40('0x38')]=_['intersection'](_0x38bb21[_0x3a40('0x36')],_0x38bb21['query']);_0x48f099[_0x3a40('0x3b')]=_[_0x3a40('0x39')](_0x38bb21['model'],qs[_0x3a40('0x3c')](_0x469e39[_0x3a40('0x3a')]['fields']));_0x48f099[_0x3a40('0x3b')]=_0x48f099[_0x3a40('0x3b')][_0x3a40('0x3d')]?_0x48f099[_0x3a40('0x3b')]:_0x38bb21[_0x3a40('0x36')];_0x48f099[_0x3a40('0x3f')]=qs[_0x3a40('0x40')](_0x469e39['query']['sort']);_0x48f099['where']=qs[_0x3a40('0x38')](_[_0x3a40('0x42')](_0x469e39[_0x3a40('0x3a')],_0x38bb21['filters']));_0x48f099[_0x3a40('0x41')]=_['merge'](_0x48f099[_0x3a40('0x41')],{'$or':[{'ListId':_0x270291['id']},{'ListId':null}]});if(_0x469e39[_0x3a40('0x3a')][_0x3a40('0x43')]){_0x48f099[_0x3a40('0x41')]=_[_0x3a40('0x44')](_0x48f099[_0x3a40('0x41')],{'$or':_[_0x3a40('0x33')](_0x48f099[_0x3a40('0x3b')],function(_0x1d4aaf){var _0x308369={};_0x308369[_0x1d4aaf]={'$like':'%'+_0x469e39[_0x3a40('0x3a')]['filter']+'%'};return _0x308369;})});}_0x48f099=_[_0x3a40('0x44')]({},_0x48f099,_0x469e39[_0x3a40('0x47')]);return db['CmCustomField']['findAndCountAll'](_0x48f099);}})[_0x3a40('0x2a')](respondWithResult(_0x35c2e5,null))['catch'](handleError(_0x35c2e5,null));};exports[_0x3a40('0x87')]=function(_0x4751bb,_0x5c0bc5,_0x319464){return db['CmList'][_0x3a40('0x4e')]({'where':{'id':_0x4751bb[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x5c0bc5,null))[_0x3a40('0x2a')](function(_0x9fe2e){if(_0x9fe2e){return _0x9fe2e['addAgents'](_0x4751bb[_0x3a40('0x59')][_0x3a40('0x69')],_[_0x3a40('0x68')](_0x4751bb[_0x3a40('0x59')],['ids','id'])||{})[_0x3a40('0x88')](function(_0x52879e){for(var _0x54bc9a=0x0;_0x54bc9a<_0x4751bb[_0x3a40('0x59')][_0x3a40('0x69')][_0x3a40('0x3d')];_0x54bc9a+=0x1){socket[_0x3a40('0x89')](_0x3a40('0x8a'),{'UserId':Number(_0x4751bb[_0x3a40('0x59')][_0x3a40('0x69')][_0x54bc9a]),'CmListId':Number(_0x4751bb['params']['id'])});}return _0x52879e;});}})[_0x3a40('0x2a')](respondWithResult(_0x5c0bc5,null))['catch'](handleError(_0x5c0bc5,null));};exports[_0x3a40('0x8b')]=function(_0x459cbb,_0x56c452,_0x44b8b0){return db[_0x3a40('0x34')][_0x3a40('0x4e')]({'where':{'id':_0x459cbb[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x56c452,null))[_0x3a40('0x2a')](function(_0x285c5a){if(_0x285c5a){return _0x285c5a[_0x3a40('0x8b')](_0x459cbb[_0x3a40('0x3a')]['ids'])[_0x3a40('0x2a')](function(){if(_[_0x3a40('0x64')](_0x459cbb[_0x3a40('0x3a')]['ids'])){for(var _0x5c4236=0x0;_0x5c4236<_0x459cbb[_0x3a40('0x3a')][_0x3a40('0x69')][_0x3a40('0x3d')];_0x5c4236+=0x1){socket['emit'](_0x3a40('0x8c'),{'UserId':Number(_0x459cbb['query'][_0x3a40('0x69')][_0x5c4236]),'CmListId':Number(_0x459cbb['params']['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x459cbb[_0x3a40('0x3a')][_0x3a40('0x69')]),'CmListId':Number(_0x459cbb[_0x3a40('0x4c')]['id'])});}});}})[_0x3a40('0x2a')](respondWithStatusCode(_0x56c452,null))[_0x3a40('0x58')](handleError(_0x56c452,null));};exports[_0x3a40('0x8d')]=function(_0x31016d,_0x1aff58,_0x1c47ff){var _0x28082e={};var _0x1d5917={};var _0x49ff7c;var _0x1be6da;return db[_0x3a40('0x34')][_0x3a40('0x5e')]({'where':{'id':_0x31016d[_0x3a40('0x4c')]['id']}})[_0x3a40('0x2a')](handleEntityNotFound(_0x1aff58,null))[_0x3a40('0x2a')](function(_0x3741e3){if(_0x3741e3){_0x49ff7c=_0x3741e3;_0x1d5917[_0x3a40('0x36')]=_[_0x3a40('0x37')](db[_0x3a40('0x8e')][_0x3a40('0x4d')]);_0x1d5917[_0x3a40('0x3a')]=_['keys'](_0x31016d['query']);_0x1d5917['filters']=_[_0x3a40('0x39')](_0x1d5917[_0x3a40('0x36')],_0x1d5917[_0x3a40('0x3a')]);_0x28082e[_0x3a40('0x3b')]=_['intersection'](_0x1d5917[_0x3a40('0x36')],qs[_0x3a40('0x3c')](_0x31016d[_0x3a40('0x3a')][_0x3a40('0x3c')]));_0x28082e[_0x3a40('0x3b')]=_0x28082e[_0x3a40('0x3b')][_0x3a40('0x3d')]?_0x28082e[_0x3a40('0x3b')]:_0x1d5917[_0x3a40('0x36')];_0x28082e['order']=qs[_0x3a40('0x40')](_0x31016d['query']['sort']);_0x28082e[_0x3a40('0x41')]=qs[_0x3a40('0x38')](_[_0x3a40('0x42')](_0x31016d[_0x3a40('0x3a')],_0x1d5917[_0x3a40('0x38')]));if(_0x31016d[_0x3a40('0x3a')][_0x3a40('0x43')]){_0x28082e[_0x3a40('0x41')]=_['merge'](_0x28082e[_0x3a40('0x41')],{'$or':_[_0x3a40('0x33')](_0x28082e[_0x3a40('0x3b')],function(_0x1514f8){var _0x27984f={};_0x27984f[_0x1514f8]={'$like':'%'+_0x31016d[_0x3a40('0x3a')][_0x3a40('0x43')]+'%'};return _0x27984f;})});}_0x28082e=_[_0x3a40('0x44')]({},_0x28082e,_0x31016d[_0x3a40('0x47')]);return _0x49ff7c[_0x3a40('0x8d')](_0x28082e);}})[_0x3a40('0x2a')](function(_0x33229d){if(_0x33229d){_0x1be6da=_0x33229d[_0x3a40('0x3d')];if(!_0x31016d[_0x3a40('0x3a')][_0x3a40('0x3e')](_0x3a40('0x5f'))){_0x28082e['limit']=qs['limit'](_0x31016d[_0x3a40('0x3a')]['limit']);_0x28082e[_0x3a40('0x21')]=qs[_0x3a40('0x21')](_0x31016d[_0x3a40('0x3a')][_0x3a40('0x21')]);}return _0x49ff7c[_0x3a40('0x8d')](_0x28082e);}})['then'](function(_0x5ef4f2){if(_0x5ef4f2){return _0x5ef4f2?{'count':_0x1be6da,'rows':_0x5ef4f2}:null;}})[_0x3a40('0x2a')](respondWithResult(_0x1aff58,null))[_0x3a40('0x58')](handleError(_0x1aff58,null));};
\ No newline at end of file
+var _0x0881=['Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','getDispositions','findOne','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','omit','push','message','getContacts','CustomFields','concat','cf_%d','raw','getContactsCsv','CmCustomField','format','pick','isEmpty','now','writeFileSync','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','spread','emit','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get'];(function(_0x3a6ade,_0x41e239){var _0x4f557f=function(_0x46cff1){while(--_0x46cff1){_0x3a6ade['push'](_0x3a6ade['shift']());}};_0x4f557f(++_0x41e239);}(_0x0881,0x17f));var _0x1088=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x0881[_0x3f2a90];return _0xb46279;};'use strict';var emlformat=require(_0x1088('0x0'));var rimraf=require(_0x1088('0x1'));var zipdir=require(_0x1088('0x2'));var jsonpatch=require(_0x1088('0x3'));var rp=require('request-promise');var moment=require(_0x1088('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1088('0x5'));var util=require(_0x1088('0x6'));var path=require(_0x1088('0x7'));var sox=require(_0x1088('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1088('0x9'));var squel=require(_0x1088('0xa'));var crypto=require(_0x1088('0xb'));var jsforce=require(_0x1088('0xc'));var deskjs=require(_0x1088('0xd'));var toCsv=require(_0x1088('0xe'));var querystring=require(_0x1088('0xf'));var Papa=require(_0x1088('0x10'));var Redis=require('ioredis');var authService=require(_0x1088('0x11'));var qs=require(_0x1088('0x12'));var as=require(_0x1088('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1088('0x14'))(_0x1088('0x15'));var utils=require(_0x1088('0x16'));var config=require(_0x1088('0x17'));var licenseUtil=require(_0x1088('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1088('0x19')](config[_0x1088('0x1a')],{'host':_0x1088('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1088('0x1a')]));require(_0x1088('0x1c'))[_0x1088('0x1d')](socket);function respondWithStatusCode(_0x1d400b,_0x19c551){_0x19c551=_0x19c551||0xcc;return function(_0x2043ad){if(_0x2043ad){return _0x1d400b[_0x1088('0x1e')](_0x19c551);}return _0x1d400b[_0x1088('0x1f')](_0x19c551)['end']();};}function respondWithResult(_0x58ce5d,_0x5acccb){_0x5acccb=_0x5acccb||0xc8;return function(_0x12bcc5){if(_0x12bcc5){return _0x58ce5d[_0x1088('0x1f')](_0x5acccb)[_0x1088('0x20')](_0x12bcc5);}};}function respondWithFilteredResult(_0x46dde0,_0x354649){return function(_0x2cf0e0){if(_0x2cf0e0){var _0x394f28=typeof _0x354649[_0x1088('0x21')]===_0x1088('0x22')&&typeof _0x354649[_0x1088('0x23')]===_0x1088('0x22');var _0x373d79=_0x2cf0e0[_0x1088('0x24')];var _0x2be998=_0x394f28?0x0:_0x354649[_0x1088('0x21')];var _0x5522d9=_0x394f28?_0x2cf0e0['count']:_0x354649[_0x1088('0x21')]+_0x354649[_0x1088('0x23')];var _0x12e353;if(_0x5522d9>=_0x373d79){_0x5522d9=_0x373d79;_0x12e353=0xc8;}else{_0x12e353=0xce;}_0x46dde0[_0x1088('0x1f')](_0x12e353);return _0x46dde0[_0x1088('0x25')](_0x1088('0x26'),_0x2be998+'-'+_0x5522d9+'/'+_0x373d79)[_0x1088('0x20')](_0x2cf0e0);}return null;};}function patchUpdates(_0x299161){return function(_0x2a6c57){try{jsonpatch['apply'](_0x2a6c57,_0x299161,!![]);}catch(_0x2e80a2){return BPromise['reject'](_0x2e80a2);}return _0x2a6c57[_0x1088('0x27')]();};}function saveUpdates(_0x104598,_0x2c3f51){return function(_0x1fcd0d){if(_0x1fcd0d){return _0x1fcd0d['update'](_0x104598)[_0x1088('0x28')](function(_0x52534a){return _0x52534a;});}return null;};}function removeEntity(_0x595f59,_0x51a57f){return function(_0x6697db){if(_0x6697db){return _0x6697db[_0x1088('0x29')]()[_0x1088('0x28')](function(){var _0x226069=_0x6697db[_0x1088('0x2a')]({'plain':!![]});var _0x222c4f=_0x1088('0x2b');return db[_0x1088('0x2c')]['destroy']({'where':{'type':_0x222c4f,'resourceId':_0x226069['id']}})[_0x1088('0x28')](function(){return _0x6697db;});})[_0x1088('0x28')](function(){_0x595f59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a36b,_0x5d483d){return function(_0x3a6fec){if(!_0x3a6fec){_0x36a36b[_0x1088('0x1e')](0x194);}return _0x3a6fec;};}function handleError(_0x31dee9,_0x2491f1){_0x2491f1=_0x2491f1||0x1f4;return function(_0x4e9109){logger[_0x1088('0x2d')](_0x4e9109[_0x1088('0x2e')]);if(_0x4e9109[_0x1088('0x2f')]){delete _0x4e9109[_0x1088('0x2f')];}_0x31dee9['status'](_0x2491f1)[_0x1088('0x30')](_0x4e9109);};}exports[_0x1088('0x31')]=function(_0x589de8,_0x393bf3){var _0xe1596b={},_0x34dd24={},_0x59a62b={'count':0x0,'rows':[]};var _0x242438=_[_0x1088('0x32')](db[_0x1088('0x33')][_0x1088('0x34')],function(_0x2aa4fb){return{'name':_0x2aa4fb['fieldName'],'type':_0x2aa4fb[_0x1088('0x35')][_0x1088('0x36')]};});_0x34dd24['model']=_[_0x1088('0x32')](_0x242438,_0x1088('0x2f'));_0x34dd24['query']=_[_0x1088('0x37')](_0x589de8[_0x1088('0x38')]);_0x34dd24[_0x1088('0x39')]=_[_0x1088('0x3a')](_0x34dd24[_0x1088('0x3b')],_0x34dd24[_0x1088('0x38')]);_0xe1596b['attributes']=_[_0x1088('0x3a')](_0x34dd24[_0x1088('0x3b')],qs['fields'](_0x589de8[_0x1088('0x38')][_0x1088('0x3c')]));_0xe1596b['attributes']=_0xe1596b[_0x1088('0x3d')][_0x1088('0x3e')]?_0xe1596b[_0x1088('0x3d')]:_0x34dd24['model'];if(!_0x589de8['query'][_0x1088('0x3f')](_0x1088('0x40'))){_0xe1596b[_0x1088('0x23')]=qs[_0x1088('0x23')](_0x589de8['query']['limit']);_0xe1596b[_0x1088('0x21')]=qs[_0x1088('0x21')](_0x589de8[_0x1088('0x38')][_0x1088('0x21')]);}_0xe1596b[_0x1088('0x41')]=qs[_0x1088('0x42')](_0x589de8[_0x1088('0x38')]['sort']);_0xe1596b['where']=qs[_0x1088('0x39')](_['pick'](_0x589de8[_0x1088('0x38')],_0x34dd24[_0x1088('0x39')]),_0x242438);if(_0x589de8[_0x1088('0x38')][_0x1088('0x43')]){_0xe1596b['where']=_['merge'](_0xe1596b[_0x1088('0x44')],{'$or':_['map'](_0x242438,function(_0x494f1a){if(_0x494f1a[_0x1088('0x35')]!==_0x1088('0x45')){var _0xcf1e4={};_0xcf1e4[_0x494f1a[_0x1088('0x2f')]]={'$like':'%'+_0x589de8[_0x1088('0x38')][_0x1088('0x43')]+'%'};return _0xcf1e4;}})});}_0xe1596b=_[_0x1088('0x46')]({},_0xe1596b,_0x589de8[_0x1088('0x47')]);var _0xf70735={'where':_0xe1596b[_0x1088('0x44')]};return db['CmList'][_0x1088('0x24')](_0xf70735)[_0x1088('0x28')](function(_0x28d1e8){_0x59a62b[_0x1088('0x24')]=_0x28d1e8;if(_0x589de8[_0x1088('0x38')][_0x1088('0x48')]){_0xe1596b[_0x1088('0x49')]=[{'all':!![]}];}return db['CmList'][_0x1088('0x4a')](_0xe1596b);})[_0x1088('0x28')](function(_0x2bc546){_0x59a62b[_0x1088('0x4b')]=_0x2bc546;return _0x59a62b;})[_0x1088('0x28')](respondWithFilteredResult(_0x393bf3,_0xe1596b))[_0x1088('0x4c')](handleError(_0x393bf3,null));};exports['show']=function(_0xaa2108,_0x35a505){var _0x3784d6={'raw':![],'where':{'id':_0xaa2108[_0x1088('0x4d')]['id']}},_0x3dad3b={};_0x3dad3b['model']=_[_0x1088('0x37')](db[_0x1088('0x33')][_0x1088('0x34')]);_0x3dad3b[_0x1088('0x38')]=_[_0x1088('0x37')](_0xaa2108[_0x1088('0x38')]);_0x3dad3b[_0x1088('0x39')]=_[_0x1088('0x3a')](_0x3dad3b['model'],_0x3dad3b[_0x1088('0x38')]);_0x3784d6[_0x1088('0x3d')]=_[_0x1088('0x3a')](_0x3dad3b[_0x1088('0x3b')],qs[_0x1088('0x3c')](_0xaa2108[_0x1088('0x38')]['fields']));_0x3784d6[_0x1088('0x3d')]=_0x3784d6['attributes']['length']?_0x3784d6[_0x1088('0x3d')]:_0x3dad3b['model'];if(_0xaa2108['query']['includeAll']){_0x3784d6[_0x1088('0x49')]=[{'all':!![]}];}_0x3784d6=_[_0x1088('0x46')]({},_0x3784d6,_0xaa2108[_0x1088('0x47')]);return db[_0x1088('0x33')][_0x1088('0x4e')](_0x3784d6)[_0x1088('0x28')](handleEntityNotFound(_0x35a505,null))[_0x1088('0x28')](respondWithResult(_0x35a505,null))[_0x1088('0x4c')](handleError(_0x35a505,null));};exports[_0x1088('0x4f')]=function(_0x10fb66,_0x22e4ee){return db['CmList'][_0x1088('0x4f')](_0x10fb66[_0x1088('0x50')],{})['then'](function(_0x1bb7b2){var _0x526fdf=_0x10fb66['user']['get']({'plain':!![]});if(!_0x526fdf)throw new Error(_0x1088('0x51'));if(_0x526fdf['role']==='user'){var _0x176373=_0x1bb7b2[_0x1088('0x2a')]({'plain':!![]});var _0x14c712=_0x1088('0x2b');return db[_0x1088('0x52')][_0x1088('0x4e')]({'where':{'name':_0x14c712,'userProfileId':_0x526fdf['userProfileId']},'raw':!![]})[_0x1088('0x28')](function(_0x2289c8){if(_0x2289c8&&_0x2289c8[_0x1088('0x53')]===0x0){return db[_0x1088('0x2c')][_0x1088('0x4f')]({'name':_0x176373[_0x1088('0x2f')],'resourceId':_0x176373['id'],'type':_0x2289c8['name'],'sectionId':_0x2289c8['id']},{})['then'](function(){return _0x1bb7b2;});}else{return _0x1bb7b2;}})['catch'](function(_0x2449bb){logger[_0x1088('0x2d')](_0x1088('0x54'),_0x2449bb);throw _0x2449bb;});}return _0x1bb7b2;})[_0x1088('0x28')](respondWithResult(_0x22e4ee,0xc9))['catch'](handleError(_0x22e4ee,null));};exports[_0x1088('0x55')]=function(_0x1bd7e4,_0x24fa8e){if(_0x1bd7e4['body']['id']){delete _0x1bd7e4['body']['id'];}return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x1bd7e4['params']['id']}})[_0x1088('0x28')](handleEntityNotFound(_0x24fa8e,null))[_0x1088('0x28')](saveUpdates(_0x1bd7e4[_0x1088('0x50')],null))[_0x1088('0x28')](respondWithResult(_0x24fa8e,null))['catch'](handleError(_0x24fa8e,null));};exports[_0x1088('0x29')]=function(_0x58166a,_0x13d2b4){return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x58166a[_0x1088('0x4d')]['id']}})[_0x1088('0x28')](handleEntityNotFound(_0x13d2b4,null))['then'](removeEntity(_0x13d2b4,null))[_0x1088('0x4c')](handleError(_0x13d2b4,null));};exports[_0x1088('0x56')]=function(_0x55af38,_0x3b724c){return db['CmList'][_0x1088('0x56')]()[_0x1088('0x28')](respondWithResult(_0x3b724c,null))[_0x1088('0x4c')](handleError(_0x3b724c,null));};exports[_0x1088('0x57')]=function(_0x3863f1,_0x552d4f,_0x2d3f59){if(_0x3863f1['body']['id']){delete _0x3863f1[_0x1088('0x50')]['id'];}return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x3863f1[_0x1088('0x4d')]['id']}})['then'](handleEntityNotFound(_0x552d4f,null))[_0x1088('0x28')](function(_0x171cbf){if(_0x171cbf){_0x3863f1['body'][_0x1088('0x58')]=_0x171cbf['id'];return db['Disposition'][_0x1088('0x4f')](_0x3863f1['body']);}})[_0x1088('0x28')](respondWithResult(_0x552d4f,null))[_0x1088('0x4c')](handleError(_0x552d4f,null));};exports[_0x1088('0x59')]=function(_0xbef887,_0x9f40ba,_0x52e8a6){var _0x5a5bb3={'raw':![],'where':{}};var _0x1651a1={};var _0x330c0d={'count':0x0,'rows':[]};return db['CmList'][_0x1088('0x5a')]({'where':{'id':_0xbef887[_0x1088('0x4d')]['id']}})[_0x1088('0x28')](handleEntityNotFound(_0x9f40ba,null))[_0x1088('0x28')](function(_0x59b7fe){if(_0x59b7fe){_0x1651a1[_0x1088('0x3b')]=_[_0x1088('0x37')](db[_0x1088('0x5b')][_0x1088('0x34')]);_0x1651a1[_0x1088('0x38')]=_[_0x1088('0x37')](_0xbef887[_0x1088('0x38')]);_0x1651a1[_0x1088('0x39')]=_['intersection'](_0x1651a1[_0x1088('0x3b')],_0x1651a1[_0x1088('0x38')]);_0x5a5bb3[_0x1088('0x3d')]=_[_0x1088('0x3a')](_0x1651a1[_0x1088('0x3b')],qs[_0x1088('0x3c')](_0xbef887[_0x1088('0x38')]['fields']));_0x5a5bb3[_0x1088('0x3d')]=_0x5a5bb3['attributes']['length']?_0x5a5bb3[_0x1088('0x3d')]:_0x1651a1[_0x1088('0x3b')];if(!_0xbef887[_0x1088('0x38')][_0x1088('0x3f')](_0x1088('0x40'))){_0x5a5bb3[_0x1088('0x23')]=qs['limit'](_0xbef887[_0x1088('0x38')]['limit']);_0x5a5bb3[_0x1088('0x21')]=qs[_0x1088('0x21')](_0xbef887['query'][_0x1088('0x21')]);}_0x5a5bb3[_0x1088('0x41')]=qs[_0x1088('0x42')](_0xbef887['query']['sort']);_0x5a5bb3['where']=qs[_0x1088('0x39')](_['pick'](_0xbef887[_0x1088('0x38')],_0x1651a1[_0x1088('0x39')]));_0x5a5bb3[_0x1088('0x44')][_0x1088('0x58')]=_0x59b7fe['id'];if(_0xbef887[_0x1088('0x38')][_0x1088('0x43')]){_0x5a5bb3[_0x1088('0x44')]=_[_0x1088('0x46')](_0x5a5bb3[_0x1088('0x44')],{'$or':_['map'](_0x5a5bb3[_0x1088('0x3d')],function(_0x3b454){var _0x1a3dda={};_0x1a3dda[_0x3b454]={'$like':'%'+_0xbef887[_0x1088('0x38')][_0x1088('0x43')]+'%'};return _0x1a3dda;})});}_0x5a5bb3=_[_0x1088('0x46')]({},_0x5a5bb3,_0xbef887[_0x1088('0x47')]);return db[_0x1088('0x5b')][_0x1088('0x24')]({'where':_0x5a5bb3['where']})[_0x1088('0x28')](function(_0x3f9b05){_0x330c0d[_0x1088('0x24')]=_0x3f9b05;if(_0xbef887['query'][_0x1088('0x48')]){_0x5a5bb3['include']=[{'all':!![]}];}return db['Disposition'][_0x1088('0x4a')](_0x5a5bb3);})[_0x1088('0x28')](function(_0x24ec6f){_0x330c0d[_0x1088('0x4b')]=_0x24ec6f;return _0x330c0d;});}})[_0x1088('0x28')](respondWithFilteredResult(_0x9f40ba,_0x5a5bb3))[_0x1088('0x4c')](handleError(_0x9f40ba,null));};exports[_0x1088('0x5c')]=function(_0x1115ef,_0x1df9e5,_0x3642f5){return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x1115ef['params']['id']}})['then'](handleEntityNotFound(_0x1df9e5,null))[_0x1088('0x28')](function(_0x5d7480){if(_0x5d7480){return _0x5d7480[_0x1088('0x5c')](_0x1115ef[_0x1088('0x38')][_0x1088('0x5d')]);}})[_0x1088('0x28')](respondWithStatusCode(_0x1df9e5,null))[_0x1088('0x4c')](handleError(_0x1df9e5,null));};exports[_0x1088('0x5e')]=function(_0x49a8b7,_0x2a90ea,_0x5377e1){return db['CmList']['find']({'where':{'id':_0x49a8b7[_0x1088('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a90ea,null))['then'](function(_0x23201e){if(_0x23201e){var _0x522bdf=[];var _0x13f496={'success':[],'errors':[]};return db[_0x1088('0x5f')][_0x1088('0x56')]()[_0x1088('0x28')](function(_0x161263){if(_0x49a8b7[_0x1088('0x50')][_0x1088('0x60')]&&_[_0x1088('0x61')](_0x49a8b7[_0x1088('0x50')][_0x1088('0x60')])){if(_0x49a8b7[_0x1088('0x50')]['tags']['length']){_0x49a8b7[_0x1088('0x50')][_0x1088('0x60')]=_0x49a8b7[_0x1088('0x50')][_0x1088('0x60')][_0x1088('0x62')](';')+';';}else{_0x49a8b7[_0x1088('0x50')][_0x1088('0x60')]=null;}}else{_0x49a8b7['body']['tags']=null;}if(_0x49a8b7[_0x1088('0x50')]&&_['isArray'](_0x49a8b7[_0x1088('0x50')])){for(var _0xa65de3=0x0;_0xa65de3<_0x49a8b7[_0x1088('0x50')][_0x1088('0x3e')];_0xa65de3+=0x1){_0x49a8b7['body'][_0xa65de3][_0x1088('0x58')]=_0x49a8b7[_0x1088('0x4d')]['id'];_0x522bdf['push'](_0x49a8b7[_0x1088('0x50')][_0xa65de3]);}return BPromise[_0x1088('0x63')](_0x522bdf,function(_0x4dd8c7){return db[_0x1088('0x5f')][_0x1088('0x4f')](_[_0x1088('0x64')](_0x4dd8c7,[_0x1088('0x5d'),'id'])||{},{'fields':_[_0x1088('0x37')](_0x161263),'raw':!![]})[_0x1088('0x28')](function(_0x174a9b){_0x13f496['success'][_0x1088('0x65')](_0x174a9b['dataValues']);})[_0x1088('0x4c')](function(_0x37d225){_0x13f496['errors'][_0x1088('0x65')]({'data':_0x4dd8c7,'error':_0x37d225[_0x1088('0x66')]});});})['then'](function(_0x4d0ca6){return _0x13f496;})[_0x1088('0x4c')](function(_0x2de660){return _0x2de660;});}else{_0x2a90ea[_0x1088('0x1f')](0x190)[_0x1088('0x20')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x1088('0x28')](respondWithResult(_0x2a90ea,null))['catch'](handleError(_0x2a90ea,null));};exports[_0x1088('0x67')]=function(_0x2e20be,_0x1deece,_0x3bc96f){var _0x1e4527;return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x2e20be['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x1088('0x68')}]})[_0x1088('0x28')](handleEntityNotFound(_0x1deece,null))[_0x1088('0x28')](function(_0x2baa0f){if(_0x2baa0f){_0x1e4527=_0x2baa0f;return db[_0x1088('0x5f')][_0x1088('0x34')];}})['then'](function(_0x327854){if(_0x327854){var _0x51aaaf={};var _0x2c487f={};_0x2c487f['model']=_[_0x1088('0x69')](_[_0x1088('0x37')](_0x327854),_[_0x1088('0x32')](_0x1e4527[_0x1088('0x68')],function(_0x257918){return util['format'](_0x1088('0x6a'),_0x257918['id']);}));_0x2c487f[_0x1088('0x38')]=_[_0x1088('0x37')](_0x2e20be[_0x1088('0x38')]);_0x2c487f['filters']=_[_0x1088('0x3a')](_0x2c487f[_0x1088('0x3b')],_0x2c487f[_0x1088('0x38')]);_0x51aaaf['attributes']=_[_0x1088('0x3a')](_0x2c487f[_0x1088('0x3b')],qs['fields'](_0x2e20be['query'][_0x1088('0x3c')]));_0x51aaaf[_0x1088('0x3d')]=_0x51aaaf[_0x1088('0x3d')][_0x1088('0x3e')]?_0x51aaaf[_0x1088('0x3d')]:_0x2c487f[_0x1088('0x3b')];if(!_0x2e20be[_0x1088('0x38')][_0x1088('0x3f')](_0x1088('0x40'))){_0x51aaaf[_0x1088('0x23')]=qs[_0x1088('0x23')](_0x2e20be[_0x1088('0x38')][_0x1088('0x23')]);_0x51aaaf[_0x1088('0x21')]=qs[_0x1088('0x21')](_0x2e20be[_0x1088('0x38')][_0x1088('0x21')]);}_0x51aaaf[_0x1088('0x41')]=qs[_0x1088('0x42')](_0x2e20be['query']['sort']);_0x51aaaf[_0x1088('0x44')]=qs[_0x1088('0x39')](_['pick'](_0x2e20be[_0x1088('0x38')],_0x2c487f[_0x1088('0x39')]));_0x51aaaf[_0x1088('0x6b')]=!![];if(_0x2e20be[_0x1088('0x38')]['filter']){_0x51aaaf[_0x1088('0x44')]=_['merge'](_0x51aaaf['where'],{'$or':_[_0x1088('0x32')](_0x51aaaf[_0x1088('0x3d')],function(_0xf30584){var _0xb799d2={};_0xb799d2[_0xf30584]={'$like':'%'+_0x2e20be[_0x1088('0x38')][_0x1088('0x43')]+'%'};return _0xb799d2;})});}_0x51aaaf=_[_0x1088('0x46')]({},_0x51aaaf,_0x2e20be[_0x1088('0x47')]);return _0x1e4527[_0x1088('0x67')](_0x51aaaf);}})[_0x1088('0x28')](respondWithResult(_0x1deece,null))['catch'](handleError(_0x1deece,null));};exports[_0x1088('0x6c')]=function(_0x4bcbe6,_0x265a01,_0x7b0edb){var _0x2eeb58;return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x4bcbe6[_0x1088('0x4d')]['id']},'include':[{'model':db[_0x1088('0x6d')],'as':_0x1088('0x68')}]})[_0x1088('0x28')](handleEntityNotFound(_0x265a01,null))[_0x1088('0x28')](function(_0x31efa7){if(_0x31efa7){_0x2eeb58=_0x31efa7;return db[_0x1088('0x5f')][_0x1088('0x34')];}})[_0x1088('0x28')](function(_0x567a9e){if(_0x567a9e){var _0x28a0dd={};var _0x37a493={};_0x37a493[_0x1088('0x3b')]=_[_0x1088('0x69')](_[_0x1088('0x37')](_0x567a9e),_[_0x1088('0x32')](_0x2eeb58['CustomFields'],function(_0x5263fa){return util[_0x1088('0x6e')](_0x1088('0x6a'),_0x5263fa['id']);}));_0x37a493[_0x1088('0x38')]=_[_0x1088('0x37')](_0x4bcbe6[_0x1088('0x38')]);_0x37a493['filters']=_['intersection'](_0x37a493['model'],_0x37a493[_0x1088('0x38')]);_0x28a0dd[_0x1088('0x3d')]=_[_0x1088('0x3a')](_0x37a493[_0x1088('0x3b')],qs[_0x1088('0x3c')](_0x4bcbe6[_0x1088('0x38')]['fields']));_0x28a0dd['attributes']=_0x28a0dd['attributes'][_0x1088('0x3e')]?_0x28a0dd[_0x1088('0x3d')]:_0x37a493['model'];if(!_0x4bcbe6[_0x1088('0x38')][_0x1088('0x3f')](_0x1088('0x40'))){_0x28a0dd[_0x1088('0x23')]=qs[_0x1088('0x23')](_0x4bcbe6[_0x1088('0x38')][_0x1088('0x23')]);_0x28a0dd['offset']=qs[_0x1088('0x21')](_0x4bcbe6['query'][_0x1088('0x21')]);}_0x28a0dd[_0x1088('0x41')]=qs['sort'](_0x4bcbe6[_0x1088('0x38')][_0x1088('0x42')]);_0x28a0dd[_0x1088('0x44')]=qs[_0x1088('0x39')](_[_0x1088('0x6f')](_0x4bcbe6[_0x1088('0x38')],_0x37a493[_0x1088('0x39')]));_0x28a0dd['raw']=!![];if(_0x4bcbe6[_0x1088('0x38')]['filter']){_0x28a0dd[_0x1088('0x44')]=_[_0x1088('0x46')](_0x28a0dd[_0x1088('0x44')],{'$or':_[_0x1088('0x32')](_0x28a0dd['attributes'],function(_0x4087a5){var _0x2b5212={};_0x2b5212[_0x4087a5]={'$like':'%'+_0x4bcbe6[_0x1088('0x38')]['filter']+'%'};return _0x2b5212;})});}_0x28a0dd=_[_0x1088('0x46')]({},_0x28a0dd,_0x4bcbe6[_0x1088('0x47')]);return _0x2eeb58[_0x1088('0x67')](_0x28a0dd);}})['then'](function(_0x3b432b){if(!_[_0x1088('0x70')](_0x3b432b)){var _0x4880ba=toCsv(_0x3b432b);var _0x2a3f5d=Date[_0x1088('0x71')]();fs[_0x1088('0x72')](util[_0x1088('0x6e')]('/tmp/list_%d_%s.csv',_0x2eeb58['id'],_0x2a3f5d),_0x4880ba);_0x265a01['setHeader']('Content-disposition',_0x1088('0x73')+util['format'](_0x1088('0x74'),_0x2eeb58['id'],_0x2a3f5d));_0x265a01['setHeader'](_0x1088('0x75'),_0x1088('0x76'));return _0x265a01[_0x1088('0x77')](util[_0x1088('0x6e')]('/tmp/list_%d_%s.csv',_0x2eeb58['id'],_0x2a3f5d));}else{return _0x265a01[_0x1088('0x1e')](0xcc);}})[_0x1088('0x4c')](handleError(_0x265a01,null));};exports[_0x1088('0x78')]=function(_0x111230,_0x4cb584,_0x557328){var _0x395bb2;delete _0x111230['body']['id'];return db[_0x1088('0x33')][_0x1088('0x5a')]({'where':{'id':_0x111230['params']['id']}})['then'](handleEntityNotFound(_0x4cb584,null))['then'](function(_0x12d9ce){if(_0x12d9ce){return db[_0x1088('0x79')][_0x1088('0x7a')](function(_0x4ea7d8){return db[_0x1088('0x6d')]['create'](_0x111230[_0x1088('0x50')],{'transaction':_0x4ea7d8})[_0x1088('0x28')](function(_0x3be9f2){_0x395bb2=_0x3be9f2;return _0x12d9ce[_0x1088('0x7b')](_0x3be9f2,{'transaction':_0x4ea7d8});})['then'](function(){var _0x2300d0={'type':db['Sequelize']['TEXT'],'transaction':_0x4ea7d8};switch(_0x111230[_0x1088('0x50')][_0x1088('0x35')]){case'text':_0x2300d0['type']=db[_0x1088('0x7c')][_0x1088('0x7d')];break;case _0x1088('0x7e'):_0x2300d0[_0x1088('0x35')]=db[_0x1088('0x7c')][_0x1088('0x7f')];break;case _0x1088('0x80'):_0x2300d0['type']=db[_0x1088('0x7c')][_0x1088('0x81')];_0x2300d0[_0x1088('0x82')]=![];break;default:}return db[_0x1088('0x79')][_0x1088('0x83')][_0x1088('0x84')](_0x1088('0x85'),util[_0x1088('0x6e')]('cf_%s',_0x395bb2['id']),_0x2300d0);})[_0x1088('0x28')](function(){return _0x395bb2;});});}})['then'](respondWithResult(_0x4cb584,null))[_0x1088('0x4c')](handleError(_0x4cb584,null));};exports[_0x1088('0x86')]=function(_0x4b4c4b,_0x584864,_0x1e0c17){var _0x538908={};var _0x19280d={};var _0x302135;var _0x39a2a2;return db[_0x1088('0x33')]['findOne']({'where':{'id':_0x4b4c4b[_0x1088('0x4d')]['id']}})['then'](handleEntityNotFound(_0x584864,null))['then'](function(_0x32aa0d){if(_0x32aa0d){_0x302135=_0x32aa0d;_0x19280d[_0x1088('0x3b')]=_[_0x1088('0x37')](db['CmCustomField'][_0x1088('0x34')]);_0x19280d[_0x1088('0x38')]=_[_0x1088('0x37')](_0x4b4c4b[_0x1088('0x38')]);_0x19280d[_0x1088('0x39')]=_[_0x1088('0x3a')](_0x19280d[_0x1088('0x3b')],_0x19280d[_0x1088('0x38')]);_0x538908[_0x1088('0x3d')]=_['intersection'](_0x19280d[_0x1088('0x3b')],qs[_0x1088('0x3c')](_0x4b4c4b[_0x1088('0x38')][_0x1088('0x3c')]));_0x538908['attributes']=_0x538908['attributes'][_0x1088('0x3e')]?_0x538908[_0x1088('0x3d')]:_0x19280d[_0x1088('0x3b')];_0x538908[_0x1088('0x41')]=qs['sort'](_0x4b4c4b['query'][_0x1088('0x42')]);_0x538908[_0x1088('0x44')]=qs[_0x1088('0x39')](_[_0x1088('0x6f')](_0x4b4c4b[_0x1088('0x38')],_0x19280d[_0x1088('0x39')]));_0x538908[_0x1088('0x44')]=_['merge'](_0x538908[_0x1088('0x44')],{'$or':[{'ListId':_0x32aa0d['id']},{'ListId':null}]});if(_0x4b4c4b[_0x1088('0x38')][_0x1088('0x43')]){_0x538908[_0x1088('0x44')]=_['merge'](_0x538908[_0x1088('0x44')],{'$or':_['map'](_0x538908[_0x1088('0x3d')],function(_0x5a24a1){var _0x5a5ba1={};_0x5a5ba1[_0x5a24a1]={'$like':'%'+_0x4b4c4b[_0x1088('0x38')][_0x1088('0x43')]+'%'};return _0x5a5ba1;})});}_0x538908=_['merge']({},_0x538908,_0x4b4c4b['options']);return db[_0x1088('0x6d')][_0x1088('0x87')](_0x538908);}})[_0x1088('0x28')](respondWithResult(_0x584864,null))[_0x1088('0x4c')](handleError(_0x584864,null));};exports['addAgents']=function(_0x2d1308,_0x5e9e3a,_0x47906a){return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x2d1308[_0x1088('0x4d')]['id']}})[_0x1088('0x28')](handleEntityNotFound(_0x5e9e3a,null))[_0x1088('0x28')](function(_0x5f0b83){if(_0x5f0b83){return _0x5f0b83['addAgents'](_0x2d1308[_0x1088('0x50')][_0x1088('0x5d')],_[_0x1088('0x64')](_0x2d1308[_0x1088('0x50')],[_0x1088('0x5d'),'id'])||{})[_0x1088('0x88')](function(_0x2bf871){for(var _0x3a8daf=0x0;_0x3a8daf<_0x2d1308['body']['ids'][_0x1088('0x3e')];_0x3a8daf+=0x1){socket[_0x1088('0x89')]('userCmList:save',{'UserId':Number(_0x2d1308['body'][_0x1088('0x5d')][_0x3a8daf]),'CmListId':Number(_0x2d1308['params']['id'])});}return _0x2bf871;});}})['then'](respondWithResult(_0x5e9e3a,null))[_0x1088('0x4c')](handleError(_0x5e9e3a,null));};exports[_0x1088('0x8a')]=function(_0x1877fe,_0x4747ee,_0x32de13){return db[_0x1088('0x33')][_0x1088('0x4e')]({'where':{'id':_0x1877fe['params']['id']}})[_0x1088('0x28')](handleEntityNotFound(_0x4747ee,null))[_0x1088('0x28')](function(_0x5aed1b){if(_0x5aed1b){return _0x5aed1b[_0x1088('0x8a')](_0x1877fe[_0x1088('0x38')][_0x1088('0x5d')])[_0x1088('0x28')](function(){if(_[_0x1088('0x61')](_0x1877fe['query'][_0x1088('0x5d')])){for(var _0x146f1b=0x0;_0x146f1b<_0x1877fe[_0x1088('0x38')][_0x1088('0x5d')][_0x1088('0x3e')];_0x146f1b+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x1877fe[_0x1088('0x38')][_0x1088('0x5d')][_0x146f1b]),'CmListId':Number(_0x1877fe[_0x1088('0x4d')]['id'])});}}else{socket[_0x1088('0x89')](_0x1088('0x8b'),{'UserId':Number(_0x1877fe[_0x1088('0x38')]['ids']),'CmListId':Number(_0x1877fe[_0x1088('0x4d')]['id'])});}});}})[_0x1088('0x28')](respondWithStatusCode(_0x4747ee,null))[_0x1088('0x4c')](handleError(_0x4747ee,null));};exports['getAgents']=function(_0x3a4b15,_0x4ebd98,_0x51fc38){var _0x34b104={};var _0x14372e={};var _0x22c6b3;var _0x4b8740;return db[_0x1088('0x33')][_0x1088('0x5a')]({'where':{'id':_0x3a4b15[_0x1088('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ebd98,null))[_0x1088('0x28')](function(_0xf40bd1){if(_0xf40bd1){_0x22c6b3=_0xf40bd1;_0x14372e[_0x1088('0x3b')]=_[_0x1088('0x37')](db[_0x1088('0x8c')][_0x1088('0x34')]);_0x14372e[_0x1088('0x38')]=_[_0x1088('0x37')](_0x3a4b15[_0x1088('0x38')]);_0x14372e[_0x1088('0x39')]=_[_0x1088('0x3a')](_0x14372e['model'],_0x14372e[_0x1088('0x38')]);_0x34b104[_0x1088('0x3d')]=_[_0x1088('0x3a')](_0x14372e[_0x1088('0x3b')],qs['fields'](_0x3a4b15['query'][_0x1088('0x3c')]));_0x34b104[_0x1088('0x3d')]=_0x34b104[_0x1088('0x3d')][_0x1088('0x3e')]?_0x34b104[_0x1088('0x3d')]:_0x14372e['model'];_0x34b104['order']=qs[_0x1088('0x42')](_0x3a4b15[_0x1088('0x38')][_0x1088('0x42')]);_0x34b104[_0x1088('0x44')]=qs[_0x1088('0x39')](_[_0x1088('0x6f')](_0x3a4b15[_0x1088('0x38')],_0x14372e[_0x1088('0x39')]));if(_0x3a4b15[_0x1088('0x38')][_0x1088('0x43')]){_0x34b104[_0x1088('0x44')]=_[_0x1088('0x46')](_0x34b104[_0x1088('0x44')],{'$or':_['map'](_0x34b104[_0x1088('0x3d')],function(_0x38a0b9){var _0x7c8913={};_0x7c8913[_0x38a0b9]={'$like':'%'+_0x3a4b15[_0x1088('0x38')][_0x1088('0x43')]+'%'};return _0x7c8913;})});}_0x34b104=_[_0x1088('0x46')]({},_0x34b104,_0x3a4b15[_0x1088('0x47')]);return _0x22c6b3[_0x1088('0x8d')](_0x34b104);}})[_0x1088('0x28')](function(_0x2e98d0){if(_0x2e98d0){_0x4b8740=_0x2e98d0['length'];if(!_0x3a4b15[_0x1088('0x38')][_0x1088('0x3f')](_0x1088('0x40'))){_0x34b104[_0x1088('0x23')]=qs['limit'](_0x3a4b15[_0x1088('0x38')]['limit']);_0x34b104[_0x1088('0x21')]=qs[_0x1088('0x21')](_0x3a4b15[_0x1088('0x38')][_0x1088('0x21')]);}return _0x22c6b3['getAgents'](_0x34b104);}})['then'](function(_0x4fe6e7){if(_0x4fe6e7){return _0x4fe6e7?{'count':_0x4b8740,'rows':_0x4fe6e7}:null;}})[_0x1088('0x28')](respondWithResult(_0x4ebd98,null))[_0x1088('0x4c')](handleError(_0x4ebd98,null));};
\ No newline at end of file
index 1eed7de..2106dc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x5fc3[_0x43a1b8];return _0x324ecc;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x5fc3[_0x5235dd];return _0x13059d;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
index 8a00601..9ad785f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be1=['define','cm_lists','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0x1be1,0x192));var _0x11be=function(_0x5ca2e3,_0x5e5c44){_0x5ca2e3=_0x5ca2e3-0x0;var _0x154199=_0x1be1[_0x5ca2e3];return _0x154199;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var moment=require('moment');var BPromise=require(_0x11be('0x2'));var rp=require(_0x11be('0x3'));var fs=require('fs');var path=require(_0x11be('0x4'));var rimraf=require(_0x11be('0x5'));var config=require('../../config/environment');var attributes=require(_0x11be('0x6'));module[_0x11be('0x7')]=function(_0x11f793,_0x479719){return _0x11f793[_0x11be('0x8')]('CmList',attributes,{'tableName':_0x11be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbec5=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','api','moment','bluebird'];(function(_0x4ca561,_0x4e707d){var _0x17d27a=function(_0x455fbb){while(--_0x455fbb){_0x4ca561['push'](_0x4ca561['shift']());}};_0x17d27a(++_0x4e707d);}(_0xbec5,0xe5));var _0x5bec=function(_0x2ba740,_0x62a305){_0x2ba740=_0x2ba740-0x0;var _0x358bda=_0xbec5[_0x2ba740];return _0x358bda;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 72429c2..9fb253c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e51=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x523f3d,_0x240caa){var _0x5123c4=function(_0x4fe72a){while(--_0x4fe72a){_0x523f3d['push'](_0x523f3d['shift']());}};_0x5123c4(++_0x240caa);}(_0x7e51,0xee));var _0x17e5=function(_0x1154d9,_0x2ca464){_0x1154d9=_0x1154d9-0x0;var _0x1f5b54=_0x7e51[_0x1154d9];return _0x1f5b54;};'use strict';var _=require(_0x17e5('0x0'));var util=require(_0x17e5('0x1'));var moment=require('moment');var BPromise=require(_0x17e5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17e5('0x3'));var db=require(_0x17e5('0x4'))['db'];var utils=require(_0x17e5('0x5'));var logger=require(_0x17e5('0x6'))(_0x17e5('0x7'));var config=require(_0x17e5('0x8'));var jayson=require(_0x17e5('0x9'));var client=jayson[_0x17e5('0xa')][_0x17e5('0xb')]({'port':0x232a});config[_0x17e5('0xc')]=_['defaults'](config['redis'],{'host':_0x17e5('0xd'),'port':0x18eb});var socket=require(_0x17e5('0xe'))(new Redis(config['redis']));require(_0x17e5('0xf'))[_0x17e5('0x10')](socket);function respondWithRpcPromise(_0x549df9,_0x170c21,_0x577e9c){return new BPromise(function(_0x150ecd,_0x28841e){return client[_0x17e5('0x11')](_0x549df9,_0x577e9c)['then'](function(_0x3a9f9c){logger[_0x17e5('0x12')](_0x17e5('0x13'),_0x170c21,_0x17e5('0x14'));logger[_0x17e5('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x170c21,'request\x20sent',JSON[_0x17e5('0x16')](_0x3a9f9c));if(_0x3a9f9c[_0x17e5('0x17')]){if(_0x3a9f9c['error'][_0x17e5('0x18')]===0x1f4){logger['error'](_0x17e5('0x13'),_0x170c21,_0x3a9f9c[_0x17e5('0x17')][_0x17e5('0x19')]);return _0x28841e(_0x3a9f9c[_0x17e5('0x17')][_0x17e5('0x19')]);}logger[_0x17e5('0x17')](_0x17e5('0x13'),_0x170c21,_0x3a9f9c[_0x17e5('0x17')][_0x17e5('0x19')]);return _0x150ecd(_0x3a9f9c['error'][_0x17e5('0x19')]);}else{logger['info'](_0x17e5('0x13'),_0x170c21,'request\x20sent');_0x150ecd(_0x3a9f9c[_0x17e5('0x1a')][_0x17e5('0x19')]);}})['catch'](function(_0x2f7f96){logger[_0x17e5('0x17')](_0x17e5('0x13'),_0x170c21,_0x2f7f96);_0x28841e(_0x2f7f96);});});}
\ No newline at end of file
+var _0xfce0=['defaults','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis'];(function(_0x464726,_0x319d0b){var _0xfdc7bb=function(_0x470409){while(--_0x470409){_0x464726['push'](_0x464726['shift']());}};_0xfdc7bb(++_0x319d0b);}(_0xfce0,0x103));var _0x0fce=function(_0x27236a,_0x59bc6b){_0x27236a=_0x27236a-0x0;var _0x34a6a3=_0xfce0[_0x27236a];return _0x34a6a3;};'use strict';var _=require(_0x0fce('0x0'));var util=require('util');var moment=require(_0x0fce('0x1'));var BPromise=require(_0x0fce('0x2'));var rs=require(_0x0fce('0x3'));var fs=require('fs');var Redis=require(_0x0fce('0x4'));var db=require(_0x0fce('0x5'))['db'];var utils=require(_0x0fce('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0fce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fce('0x8')][_0x0fce('0x9')]({'port':0x232a});config[_0x0fce('0xa')]=_[_0x0fce('0xb')](config[_0x0fce('0xa')],{'host':_0x0fce('0xc'),'port':0x18eb});var socket=require(_0x0fce('0xd'))(new Redis(config['redis']));require('./cmList.socket')[_0x0fce('0xe')](socket);function respondWithRpcPromise(_0x5750ea,_0x1dfea7,_0x3dae0a){return new BPromise(function(_0x3c3013,_0x51870f){return client[_0x0fce('0xf')](_0x5750ea,_0x3dae0a)[_0x0fce('0x10')](function(_0x2e3a97){logger[_0x0fce('0x11')](_0x0fce('0x12'),_0x1dfea7,_0x0fce('0x13'));logger[_0x0fce('0x14')](_0x0fce('0x15'),_0x1dfea7,_0x0fce('0x13'),JSON['stringify'](_0x2e3a97));if(_0x2e3a97[_0x0fce('0x16')]){if(_0x2e3a97[_0x0fce('0x16')][_0x0fce('0x17')]===0x1f4){logger[_0x0fce('0x16')]('CmList,\x20%s,\x20%s',_0x1dfea7,_0x2e3a97[_0x0fce('0x16')][_0x0fce('0x18')]);return _0x51870f(_0x2e3a97[_0x0fce('0x16')][_0x0fce('0x18')]);}logger['error'](_0x0fce('0x12'),_0x1dfea7,_0x2e3a97[_0x0fce('0x16')][_0x0fce('0x18')]);return _0x3c3013(_0x2e3a97[_0x0fce('0x16')][_0x0fce('0x18')]);}else{logger['info'](_0x0fce('0x12'),_0x1dfea7,_0x0fce('0x13'));_0x3c3013(_0x2e3a97[_0x0fce('0x19')][_0x0fce('0x18')]);}})[_0x0fce('0x1a')](function(_0x9895a){logger[_0x0fce('0x16')](_0x0fce('0x12'),_0x1dfea7,_0x9895a);_0x51870f(_0x9895a);});});}
\ No newline at end of file
index 4938c41..4e1f7f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eab=['update','removeListener','register','save','remove'];(function(_0x5575e6,_0xd91c5e){var _0x5de2d6=function(_0x10b795){while(--_0x10b795){_0x5575e6['push'](_0x5575e6['shift']());}};_0x5de2d6(++_0xd91c5e);}(_0x7eab,0xf8));var _0xb7ea=function(_0x182caa,_0x1dd02b){_0x182caa=_0x182caa-0x0;var _0x48b836=_0x7eab[_0x182caa];return _0x48b836;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xb7ea('0x0'),_0xb7ea('0x1'),_0xb7ea('0x2')];function createListener(_0x3da782,_0x4fcdd3){return function(_0x1b010a){_0x4fcdd3['emit'](_0x3da782,_0x1b010a);};}function removeListener(_0x2b03f9,_0x3d2c12){return function(){CmListEvents[_0xb7ea('0x3')](_0x2b03f9,_0x3d2c12);};}exports[_0xb7ea('0x4')]=function(_0xdc362a){for(var _0x35d4bd=0x0,_0x4c5429=events['length'];_0x35d4bd<_0x4c5429;_0x35d4bd++){var _0x43ae67=events[_0x35d4bd];var _0x43e317=createListener('cmList:'+_0x43ae67,_0xdc362a);CmListEvents['on'](_0x43ae67,_0x43e317);}};
\ No newline at end of file
+var _0x5e6b=['emit','removeListener','length','cmList:','./cmList.events'];(function(_0x1d66a0,_0x5acdff){var _0x5ed7d2=function(_0x1db4a3){while(--_0x1db4a3){_0x1d66a0['push'](_0x1d66a0['shift']());}};_0x5ed7d2(++_0x5acdff);}(_0x5e6b,0x16c));var _0xb5e6=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x5e6b[_0x36884e];return _0x1cc367;};'use strict';var CmListEvents=require(_0xb5e6('0x0'));var events=['save','remove','update'];function createListener(_0x2dfa39,_0x196121){return function(_0x249f12){_0x196121[_0xb5e6('0x1')](_0x2dfa39,_0x249f12);};}function removeListener(_0x782fae,_0x1170ff){return function(){CmListEvents[_0xb5e6('0x2')](_0x782fae,_0x1170ff);};}exports['register']=function(_0x3636ef){for(var _0x232124=0x0,_0x3c43ab=events[_0xb5e6('0x3')];_0x232124<_0x3c43ab;_0x232124++){var _0x5c75da=events[_0x232124];var _0x8b8e20=createListener(_0xb5e6('0x4')+_0x5c75da,_0x3636ef);CmListEvents['on'](_0x5c75da,_0x8b8e20);}};
\ No newline at end of file
index 92a62ed..8df70b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b46=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','create','post','addContacts','addCustomField','put','update','destroy','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x145acf,_0x5c0b2d){var _0x4ca111=function(_0x560f82){while(--_0x560f82){_0x145acf['push'](_0x145acf['shift']());}};_0x4ca111(++_0x5c0b2d);}(_0x2b46,0xdd));var _0x62b4=function(_0x4ba51a,_0x10b210){_0x4ba51a=_0x4ba51a-0x0;var _0x515805=_0x2b46[_0x4ba51a];return _0x515805;};'use strict';var multer=require(_0x62b4('0x0'));var util=require('util');var path=require(_0x62b4('0x1'));var timeout=require(_0x62b4('0x2'));var express=require('express');var router=express[_0x62b4('0x3')]();var fs_extra=require(_0x62b4('0x4'));var auth=require(_0x62b4('0x5'));var interaction=require(_0x62b4('0x6'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x62b4('0x7')]('/',auth[_0x62b4('0x8')](),controller[_0x62b4('0x9')]);router[_0x62b4('0x7')](_0x62b4('0xa'),auth[_0x62b4('0x8')](),controller[_0x62b4('0xb')]);router[_0x62b4('0x7')](_0x62b4('0xc'),auth[_0x62b4('0x8')](),controller[_0x62b4('0xd')]);router[_0x62b4('0x7')](_0x62b4('0xe'),auth['isAuthenticated'](),controller[_0x62b4('0xf')]);router[_0x62b4('0x7')](_0x62b4('0x10'),auth[_0x62b4('0x8')](),controller['getContacts']);router[_0x62b4('0x7')](_0x62b4('0x11'),auth['isAuthenticated'](),controller[_0x62b4('0x12')]);router['get'](_0x62b4('0x13'),auth[_0x62b4('0x8')](),controller[_0x62b4('0x14')]);router[_0x62b4('0x7')](_0x62b4('0x15'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x62b4('0x16')]);router[_0x62b4('0x17')](_0x62b4('0xe'),auth[_0x62b4('0x8')](),controller['addDisposition']);router[_0x62b4('0x17')]('/:id/contacts',auth[_0x62b4('0x8')](),controller[_0x62b4('0x18')]);router['post'](_0x62b4('0x13'),auth[_0x62b4('0x8')](),controller[_0x62b4('0x19')]);router[_0x62b4('0x17')](_0x62b4('0x15'),auth[_0x62b4('0x8')](),controller['addAgents']);router[_0x62b4('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x62b4('0x1b')]);router['delete'](_0x62b4('0xc'),auth[_0x62b4('0x8')](),controller[_0x62b4('0x1c')]);router[_0x62b4('0x1d')](_0x62b4('0xe'),auth['isAuthenticated'](),controller[_0x62b4('0x1e')]);router[_0x62b4('0x1d')](_0x62b4('0x15'),auth[_0x62b4('0x8')](),controller[_0x62b4('0x1f')]);module[_0x62b4('0x20')]=router;
\ No newline at end of file
+var _0xd3a5=['addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts'];(function(_0x9852d5,_0x37dd63){var _0x4b2afe=function(_0x28f2b1){while(--_0x28f2b1){_0x9852d5['push'](_0x9852d5['shift']());}};_0x4b2afe(++_0x37dd63);}(_0xd3a5,0xed));var _0x5d3a=function(_0x479143,_0x4e798d){_0x479143=_0x479143-0x0;var _0x3a47f5=_0xd3a5[_0x479143];return _0x3a47f5;};'use strict';var multer=require('multer');var util=require(_0x5d3a('0x0'));var path=require('path');var timeout=require(_0x5d3a('0x1'));var express=require(_0x5d3a('0x2'));var router=express[_0x5d3a('0x3')]();var fs_extra=require(_0x5d3a('0x4'));var auth=require(_0x5d3a('0x5'));var interaction=require(_0x5d3a('0x6'));var config=require(_0x5d3a('0x7'));var controller=require(_0x5d3a('0x8'));router[_0x5d3a('0x9')]('/',auth[_0x5d3a('0xa')](),controller[_0x5d3a('0xb')]);router['get']('/describe',auth[_0x5d3a('0xa')](),controller[_0x5d3a('0xc')]);router[_0x5d3a('0x9')](_0x5d3a('0xd'),auth[_0x5d3a('0xa')](),controller[_0x5d3a('0xe')]);router[_0x5d3a('0x9')](_0x5d3a('0xf'),auth['isAuthenticated'](),controller[_0x5d3a('0x10')]);router[_0x5d3a('0x9')](_0x5d3a('0x11'),auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x12')]);router[_0x5d3a('0x9')](_0x5d3a('0x13'),auth['isAuthenticated'](),controller[_0x5d3a('0x14')]);router[_0x5d3a('0x9')](_0x5d3a('0x15'),auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x16')]);router[_0x5d3a('0x9')](_0x5d3a('0x17'),auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x18')]);router[_0x5d3a('0x19')]('/',auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x1a')]);router[_0x5d3a('0x19')](_0x5d3a('0xf'),auth['isAuthenticated'](),controller[_0x5d3a('0x1b')]);router[_0x5d3a('0x19')]('/:id/contacts',auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x1c')]);router['post'](_0x5d3a('0x15'),auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x1d')]);router[_0x5d3a('0x19')](_0x5d3a('0x17'),auth['isAuthenticated'](),controller[_0x5d3a('0x1e')]);router[_0x5d3a('0x1f')]('/:id',auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x20')]);router[_0x5d3a('0x21')]('/:id',auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x22')]);router[_0x5d3a('0x21')](_0x5d3a('0xf'),auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x23')]);router['delete'](_0x5d3a('0x17'),auth[_0x5d3a('0xa')](),controller[_0x5d3a('0x24')]);module[_0x5d3a('0x25')]=router;
\ No newline at end of file
index ace6727..438a611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cd3=['STRING','sequelize','exports','getDataValue','field'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0x9cd3,0x1d2));var _0x39cd=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x9cd3[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x39cd('0x0'));module[_0x39cd('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x8cf1fd){return this[_0x39cd('0x2')](_0x39cd('0x3'));}},'field':{'type':Sequelize[_0x39cd('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x39cd('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x39cd('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0xef82=['STRING','getDataValue','field'];(function(_0x10c78c,_0x2af95d){var _0x5d1add=function(_0x6d8be4){while(--_0x6d8be4){_0x10c78c['push'](_0x10c78c['shift']());}};_0x5d1add(++_0x2af95d);}(_0xef82,0xc4));var _0x2ef8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xef82[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x149d0b){return this[_0x2ef8('0x0')](_0x2ef8('0x1'));}},'field':{'type':Sequelize[_0x2ef8('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x2ef8('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2ef8('0x2')],'allowNull':![]}};
\ No newline at end of file
index df864eb..c34387a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x22061f,_0x96d6dc){var _0x63c80c=function(_0x131158){while(--_0x131158){_0x22061f['push'](_0x22061f['shift']());}};_0x63c80c(++_0x96d6dc);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x5bbc16,_0x164718){var _0xf50625=function(_0xc921c4){while(--_0xc921c4){_0x5bbc16['push'](_0x5bbc16['shift']());}};_0xf50625(++_0x164718);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
index c04780b..1de4c58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f97=['request-promise','path','./condition.attributes','exports','Condition','tools_conditions','lodash','util','../../config/logger','bluebird'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0x3f97,0x164));var _0x73f9=function(_0x193464,_0x1bd33f){_0x193464=_0x193464-0x0;var _0xc64f2a=_0x3f97[_0x193464];return _0xc64f2a;};'use strict';var _=require(_0x73f9('0x0'));var util=require(_0x73f9('0x1'));var logger=require(_0x73f9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x73f9('0x3'));var rp=require(_0x73f9('0x4'));var fs=require('fs');var path=require(_0x73f9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x73f9('0x6'));module[_0x73f9('0x7')]=function(_0x2026ca,_0x1cbce2){return _0x2026ca['define'](_0x73f9('0x8'),attributes,{'tableName':_0x73f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9c3=['tools_conditions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','Condition'];(function(_0x454ea9,_0x4f9868){var _0x5dbe48=function(_0x37ea31){while(--_0x37ea31){_0x454ea9['push'](_0x454ea9['shift']());}};_0x5dbe48(++_0x4f9868);}(_0xd9c3,0x139));var _0x3d9c=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xd9c3[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0x3d9c('0x0'));var util=require(_0x3d9c('0x1'));var logger=require(_0x3d9c('0x2'))('api');var moment=require(_0x3d9c('0x3'));var BPromise=require(_0x3d9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d9c('0x5'));var rimraf=require(_0x3d9c('0x6'));var config=require(_0x3d9c('0x7'));var attributes=require(_0x3d9c('0x8'));module[_0x3d9c('0x9')]=function(_0x1e7d42,_0x33a2f8){return _0x1e7d42['define'](_0x3d9c('0xa'),attributes,{'tableName':_0x3d9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 99c9e0f..e191d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69cd=['http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69cd,0xcd));var _0xd69c=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x69cd[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0xd69c('0x0'));var util=require(_0xd69c('0x1'));var moment=require(_0xd69c('0x2'));var BPromise=require(_0xd69c('0x3'));var rs=require(_0xd69c('0x4'));var fs=require('fs');var Redis=require(_0xd69c('0x5'));var db=require(_0xd69c('0x6'))['db'];var utils=require(_0xd69c('0x7'));var logger=require(_0xd69c('0x8'))(_0xd69c('0x9'));var config=require(_0xd69c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd69c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47a901,_0x1ef4d4,_0x1f7504){return new BPromise(function(_0x39a061,_0x53b33f){return client[_0xd69c('0xc')](_0x47a901,_0x1f7504)[_0xd69c('0xd')](function(_0xb9637f){logger['info'](_0xd69c('0xe'),_0x1ef4d4,'request\x20sent');logger[_0xd69c('0xf')](_0xd69c('0x10'),_0x1ef4d4,_0xd69c('0x11'),JSON[_0xd69c('0x12')](_0xb9637f));if(_0xb9637f[_0xd69c('0x13')]){if(_0xb9637f[_0xd69c('0x13')][_0xd69c('0x14')]===0x1f4){logger[_0xd69c('0x13')](_0xd69c('0xe'),_0x1ef4d4,_0xb9637f[_0xd69c('0x13')][_0xd69c('0x15')]);return _0x53b33f(_0xb9637f[_0xd69c('0x13')]['message']);}logger[_0xd69c('0x13')](_0xd69c('0xe'),_0x1ef4d4,_0xb9637f[_0xd69c('0x13')][_0xd69c('0x15')]);return _0x39a061(_0xb9637f[_0xd69c('0x13')][_0xd69c('0x15')]);}else{logger[_0xd69c('0x16')](_0xd69c('0xe'),_0x1ef4d4,_0xd69c('0x11'));_0x39a061(_0xb9637f[_0xd69c('0x17')][_0xd69c('0x15')]);}})['catch'](function(_0x184a4b){logger['error'](_0xd69c('0xe'),_0x1ef4d4,_0x184a4b);_0x53b33f(_0x184a4b);});});}
\ No newline at end of file
+var _0x0d7c=['request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2e5727,_0x1a1910){var _0x41faad=function(_0x309ab9){while(--_0x309ab9){_0x2e5727['push'](_0x2e5727['shift']());}};_0x41faad(++_0x1a1910);}(_0x0d7c,0x95));var _0xc0d7=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x0d7c[_0x30182f];return _0x5207db;};'use strict';var _=require(_0xc0d7('0x0'));var util=require(_0xc0d7('0x1'));var moment=require(_0xc0d7('0x2'));var BPromise=require('bluebird');var rs=require(_0xc0d7('0x3'));var fs=require('fs');var Redis=require(_0xc0d7('0x4'));var db=require(_0xc0d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0d7('0x6'))(_0xc0d7('0x7'));var config=require(_0xc0d7('0x8'));var jayson=require(_0xc0d7('0x9'));var client=jayson[_0xc0d7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51b8be,_0x4f4083,_0x41b4fa){return new BPromise(function(_0x3f68a1,_0x3771c8){return client['request'](_0x51b8be,_0x41b4fa)[_0xc0d7('0xb')](function(_0x1c59d5){logger[_0xc0d7('0xc')](_0xc0d7('0xd'),_0x4f4083,'request\x20sent');logger[_0xc0d7('0xe')](_0xc0d7('0xf'),_0x4f4083,'request\x20sent',JSON['stringify'](_0x1c59d5));if(_0x1c59d5[_0xc0d7('0x10')]){if(_0x1c59d5[_0xc0d7('0x10')][_0xc0d7('0x11')]===0x1f4){logger[_0xc0d7('0x10')](_0xc0d7('0xd'),_0x4f4083,_0x1c59d5[_0xc0d7('0x10')][_0xc0d7('0x12')]);return _0x3771c8(_0x1c59d5[_0xc0d7('0x10')][_0xc0d7('0x12')]);}logger['error']('Condition,\x20%s,\x20%s',_0x4f4083,_0x1c59d5['error']['message']);return _0x3f68a1(_0x1c59d5['error'][_0xc0d7('0x12')]);}else{logger['info'](_0xc0d7('0xd'),_0x4f4083,_0xc0d7('0x13'));_0x3f68a1(_0x1c59d5[_0xc0d7('0x14')][_0xc0d7('0x12')]);}})['catch'](function(_0x3226e4){logger[_0xc0d7('0x10')](_0xc0d7('0xd'),_0x4f4083,_0x3226e4);_0x3771c8(_0x3226e4);});});}
\ No newline at end of file
index 6d911c0..4a36d2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5c4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x5ce65b,_0x47d9c2){var _0x209008=function(_0x22dddc){while(--_0x22dddc){_0x5ce65b['push'](_0x5ce65b['shift']());}};_0x209008(++_0x47d9c2);}(_0xe5c4,0x163));var _0x4e5c=function(_0xc03d40,_0x4e8c61){_0xc03d40=_0xc03d40-0x0;var _0x35ed56=_0xe5c4[_0xc03d40];return _0x35ed56;};'use strict';var multer=require(_0x4e5c('0x0'));var util=require(_0x4e5c('0x1'));var path=require(_0x4e5c('0x2'));var timeout=require(_0x4e5c('0x3'));var express=require(_0x4e5c('0x4'));var router=express[_0x4e5c('0x5')]();var fs_extra=require(_0x4e5c('0x6'));var auth=require(_0x4e5c('0x7'));var interaction=require(_0x4e5c('0x8'));var config=require(_0x4e5c('0x9'));var controller=require('./condition.controller');router[_0x4e5c('0xa')](_0x4e5c('0xb'),auth[_0x4e5c('0xc')](),controller[_0x4e5c('0xd')]);router[_0x4e5c('0xe')](_0x4e5c('0xb'),auth['isAuthenticated'](),controller[_0x4e5c('0xf')]);module[_0x4e5c('0x10')]=router;
\ No newline at end of file
+var _0x7faa=['path','express','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','util'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x7faa,0xa8));var _0xa7fa=function(_0x2e54c6,_0x420e3a){_0x2e54c6=_0x2e54c6-0x0;var _0x4d59b0=_0x7faa[_0x2e54c6];return _0x4d59b0;};'use strict';var multer=require('multer');var util=require(_0xa7fa('0x0'));var path=require(_0xa7fa('0x1'));var timeout=require('connect-timeout');var express=require(_0xa7fa('0x2'));var router=express['Router']();var fs_extra=require(_0xa7fa('0x3'));var auth=require(_0xa7fa('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa7fa('0x5'));var controller=require(_0xa7fa('0x6'));router[_0xa7fa('0x7')](_0xa7fa('0x8'),auth[_0xa7fa('0x9')](),controller['update']);router[_0xa7fa('0xa')]('/:id',auth[_0xa7fa('0x9')](),controller[_0xa7fa('0xb')]);module[_0xa7fa('0xc')]=router;
\ No newline at end of file
index c76d458..6ab2374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['STRING','name'];(function(_0x518374,_0x2d5ed6){var _0x28b0c7=function(_0x3b63f1){while(--_0x3b63f1){_0x518374['push'](_0x518374['shift']());}};_0x28b0c7(++_0x2d5ed6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
+var _0xb10b=['name','sequelize','STRING'];(function(_0x593eb5,_0x3eab78){var _0x300dea=function(_0x3d2ed8){while(--_0x3d2ed8){_0x593eb5['push'](_0x593eb5['shift']());}};_0x300dea(++_0x3eab78);}(_0xb10b,0x12a));var _0xbb10=function(_0x27c021,_0x190f72){_0x27c021=_0x27c021-0x0;var _0x1d0700=_0xb10b[_0x27c021];return _0x1d0700;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
index 63df385..e0b0c34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2594=['DashboardItem','findOne','pick','getItems','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','get','CustomDashboards','sendStatus','stack','name','index','map','Dashboard','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','update','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','addItem'];(function(_0x5ba9dc,_0x48e8dc){var _0x7e519c=function(_0x52007f){while(--_0x52007f){_0x5ba9dc['push'](_0x5ba9dc['shift']());}};_0x7e519c(++_0x48e8dc);}(_0x2594,0x1dc));var _0x4259=function(_0x2647c7,_0x6f6ae0){_0x2647c7=_0x2647c7-0x0;var _0x198567=_0x2594[_0x2647c7];return _0x198567;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4259('0x0'));var zipdir=require(_0x4259('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4259('0x2'));var moment=require('moment');var BPromise=require(_0x4259('0x3'));var Mustache=require(_0x4259('0x4'));var util=require(_0x4259('0x5'));var path=require('path');var sox=require(_0x4259('0x6'));var csv=require('to-csv');var ejs=require(_0x4259('0x7'));var fs=require('fs');var fs_extra=require(_0x4259('0x8'));var _=require(_0x4259('0x9'));var squel=require('squel');var crypto=require(_0x4259('0xa'));var jsforce=require(_0x4259('0xb'));var deskjs=require(_0x4259('0xc'));var toCsv=require(_0x4259('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4259('0xe'));var authService=require(_0x4259('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4259('0x10'));var hardwareService=require(_0x4259('0x11'));var logger=require(_0x4259('0x12'))(_0x4259('0x13'));var utils=require(_0x4259('0x14'));var config=require(_0x4259('0x15'));var licenseUtil=require(_0x4259('0x16'));var db=require(_0x4259('0x17'))['db'];config[_0x4259('0x18')]=_['defaults'](config['redis'],{'host':_0x4259('0x19'),'port':0x18eb});var socket=require(_0x4259('0x1a'))(new Redis(config[_0x4259('0x18')]));require('./dashboard.socket')[_0x4259('0x1b')](socket);function respondWithStatusCode(_0x298543,_0x11561a){_0x11561a=_0x11561a||0xcc;return function(_0x528ddd){if(_0x528ddd){return _0x298543['sendStatus'](_0x11561a);}return _0x298543[_0x4259('0x1c')](_0x11561a)[_0x4259('0x1d')]();};}function respondWithResult(_0x1ba0e1,_0x39287a){_0x39287a=_0x39287a||0xc8;return function(_0x5463e4){if(_0x5463e4){return _0x1ba0e1[_0x4259('0x1c')](_0x39287a)[_0x4259('0x1e')](_0x5463e4);}};}function respondWithFilteredResult(_0x425444,_0x55b0c5){return function(_0x12d4ff){if(_0x12d4ff){var _0x4758a4=typeof _0x55b0c5['offset']==='undefined'&&typeof _0x55b0c5[_0x4259('0x1f')]===_0x4259('0x20');var _0x12573f=_0x12d4ff[_0x4259('0x21')];var _0x1a0144=_0x4758a4?0x0:_0x55b0c5['offset'];var _0x43c4da=_0x4758a4?_0x12d4ff['count']:_0x55b0c5[_0x4259('0x22')]+_0x55b0c5[_0x4259('0x1f')];var _0x476aa7;if(_0x43c4da>=_0x12573f){_0x43c4da=_0x12573f;_0x476aa7=0xc8;}else{_0x476aa7=0xce;}_0x425444[_0x4259('0x1c')](_0x476aa7);return _0x425444[_0x4259('0x23')](_0x4259('0x24'),_0x1a0144+'-'+_0x43c4da+'/'+_0x12573f)[_0x4259('0x1e')](_0x12d4ff);}return null;};}function patchUpdates(_0x1583ac){return function(_0x22bbb7){try{jsonpatch['apply'](_0x22bbb7,_0x1583ac,!![]);}catch(_0x25eac9){return BPromise[_0x4259('0x25')](_0x25eac9);}return _0x22bbb7[_0x4259('0x26')]();};}function saveUpdates(_0x25023a,_0x13dba6){return function(_0x4a5034){if(_0x4a5034){return _0x4a5034['update'](_0x25023a)[_0x4259('0x27')](function(_0x237d55){return _0x237d55;});}return null;};}function removeEntity(_0x43cc35,_0x598d2b){return function(_0x2fb765){if(_0x2fb765){return _0x2fb765[_0x4259('0x28')]()[_0x4259('0x27')](function(){var _0x3da503=_0x2fb765[_0x4259('0x29')]({'plain':!![]});var _0x1a2d8a=_0x4259('0x2a');return db['UserProfileResource'][_0x4259('0x28')]({'where':{'type':_0x1a2d8a,'resourceId':_0x3da503['id']}})['then'](function(){return _0x2fb765;});})[_0x4259('0x27')](function(){_0x43cc35[_0x4259('0x1c')](0xcc)[_0x4259('0x1d')]();});}};}function handleEntityNotFound(_0x252225,_0x566547){return function(_0x2a804c){if(!_0x2a804c){_0x252225[_0x4259('0x2b')](0x194);}return _0x2a804c;};}function handleError(_0x2695ec,_0x28e981){_0x28e981=_0x28e981||0x1f4;return function(_0x2b4535){logger['error'](_0x2b4535[_0x4259('0x2c')]);if(_0x2b4535[_0x4259('0x2d')]){delete _0x2b4535[_0x4259('0x2d')];}_0x2695ec['status'](_0x28e981)['send'](_0x2b4535);};}exports[_0x4259('0x2e')]=function(_0x230bd5,_0x4cf1ff){var _0x526026={},_0x69f991={},_0x102593={'count':0x0,'rows':[]};var _0x9d7b4d=_[_0x4259('0x2f')](db[_0x4259('0x30')][_0x4259('0x31')],function(_0x2798db){return{'name':_0x2798db['fieldName'],'type':_0x2798db['type'][_0x4259('0x32')]};});_0x69f991[_0x4259('0x33')]=_[_0x4259('0x2f')](_0x9d7b4d,_0x4259('0x2d'));_0x69f991[_0x4259('0x34')]=_[_0x4259('0x35')](_0x230bd5[_0x4259('0x34')]);_0x69f991[_0x4259('0x36')]=_['intersection'](_0x69f991[_0x4259('0x33')],_0x69f991[_0x4259('0x34')]);_0x526026[_0x4259('0x37')]=_['intersection'](_0x69f991['model'],qs[_0x4259('0x38')](_0x230bd5[_0x4259('0x34')][_0x4259('0x38')]));_0x526026[_0x4259('0x37')]=_0x526026[_0x4259('0x37')][_0x4259('0x39')]?_0x526026[_0x4259('0x37')]:_0x69f991['model'];if(!_0x230bd5[_0x4259('0x34')][_0x4259('0x3a')](_0x4259('0x3b'))){_0x526026['limit']=qs[_0x4259('0x1f')](_0x230bd5['query']['limit']);_0x526026[_0x4259('0x22')]=qs[_0x4259('0x22')](_0x230bd5[_0x4259('0x34')][_0x4259('0x22')]);}_0x526026[_0x4259('0x3c')]=qs['sort'](_0x230bd5[_0x4259('0x34')][_0x4259('0x3d')]);_0x526026[_0x4259('0x3e')]=qs[_0x4259('0x36')](_['pick'](_0x230bd5[_0x4259('0x34')],_0x69f991[_0x4259('0x36')]),_0x9d7b4d);if(_0x230bd5[_0x4259('0x34')]['filter']){_0x526026[_0x4259('0x3e')]=_[_0x4259('0x3f')](_0x526026[_0x4259('0x3e')],{'$or':_[_0x4259('0x2f')](_0x9d7b4d,function(_0x322948){if(_0x322948[_0x4259('0x40')]!==_0x4259('0x41')){var _0x112e20={};_0x112e20[_0x322948['name']]={'$like':'%'+_0x230bd5[_0x4259('0x34')][_0x4259('0x42')]+'%'};return _0x112e20;}})});}_0x526026=_['merge']({},_0x526026,_0x230bd5[_0x4259('0x43')]);var _0x4de019={'where':_0x526026[_0x4259('0x3e')]};return db['Dashboard'][_0x4259('0x21')](_0x4de019)[_0x4259('0x27')](function(_0x42f8eb){_0x102593[_0x4259('0x21')]=_0x42f8eb;if(_0x230bd5[_0x4259('0x34')][_0x4259('0x44')]){_0x526026['include']=[{'all':!![]}];}return db[_0x4259('0x30')][_0x4259('0x45')](_0x526026);})[_0x4259('0x27')](function(_0x19f933){_0x102593['rows']=_0x19f933;return _0x102593;})['then'](respondWithFilteredResult(_0x4cf1ff,_0x526026))[_0x4259('0x46')](handleError(_0x4cf1ff,null));};exports[_0x4259('0x47')]=function(_0x42693a,_0x190492){var _0x260a39={'raw':![],'where':{'id':_0x42693a[_0x4259('0x48')]['id']}},_0x766e9a={};_0x766e9a[_0x4259('0x33')]=_['keys'](db[_0x4259('0x30')][_0x4259('0x31')]);_0x766e9a[_0x4259('0x34')]=_['keys'](_0x42693a[_0x4259('0x34')]);_0x766e9a[_0x4259('0x36')]=_['intersection'](_0x766e9a[_0x4259('0x33')],_0x766e9a['query']);_0x260a39[_0x4259('0x37')]=_[_0x4259('0x49')](_0x766e9a[_0x4259('0x33')],qs[_0x4259('0x38')](_0x42693a['query'][_0x4259('0x38')]));_0x260a39[_0x4259('0x37')]=_0x260a39[_0x4259('0x37')][_0x4259('0x39')]?_0x260a39['attributes']:_0x766e9a['model'];if(_0x42693a[_0x4259('0x34')][_0x4259('0x44')]){_0x260a39[_0x4259('0x4a')]=[{'all':!![]}];}_0x260a39=_[_0x4259('0x3f')]({},_0x260a39,_0x42693a['options']);return db[_0x4259('0x30')][_0x4259('0x4b')](_0x260a39)['then'](handleEntityNotFound(_0x190492,null))[_0x4259('0x27')](respondWithResult(_0x190492,null))[_0x4259('0x46')](handleError(_0x190492,null));};exports['create']=function(_0x54c0e3,_0x232812){return db['Dashboard'][_0x4259('0x4c')](_0x54c0e3[_0x4259('0x4d')],{})[_0x4259('0x27')](function(_0x35c7b9){var _0x3416b4=_0x54c0e3[_0x4259('0x4e')]['get']({'plain':!![]});if(!_0x3416b4)throw new Error(_0x4259('0x4f'));if(_0x3416b4[_0x4259('0x50')]===_0x4259('0x4e')){var _0x432906=_0x35c7b9['get']({'plain':!![]});var _0x4806f1=_0x4259('0x2a');return db[_0x4259('0x51')]['find']({'where':{'name':_0x4806f1,'userProfileId':_0x3416b4[_0x4259('0x52')]},'raw':!![]})[_0x4259('0x27')](function(_0x47c91b){if(_0x47c91b&&_0x47c91b[_0x4259('0x53')]===0x0){return db[_0x4259('0x54')][_0x4259('0x4c')]({'name':_0x432906['name'],'resourceId':_0x432906['id'],'type':_0x47c91b[_0x4259('0x2d')],'sectionId':_0x47c91b['id']},{})[_0x4259('0x27')](function(){return _0x35c7b9;});}else{return _0x35c7b9;}})[_0x4259('0x46')](function(_0xa32447){logger[_0x4259('0x55')](_0x4259('0x56'),_0xa32447);throw _0xa32447;});}return _0x35c7b9;})[_0x4259('0x27')](respondWithResult(_0x232812,0xc9))[_0x4259('0x46')](handleError(_0x232812,null));};exports['clone']=function(_0x54eab7,_0x28599c){var _0x37f148={'where':{'id':_0x54eab7[_0x4259('0x48')]['id']}},_0x5f3fc4={};_0x5f3fc4[_0x4259('0x33')]=_[_0x4259('0x35')](db['Dashboard'][_0x4259('0x31')]);_0x37f148[_0x4259('0x37')]=_[_0x4259('0x49')](_0x5f3fc4[_0x4259('0x33')],qs[_0x4259('0x38')](_0x54eab7[_0x4259('0x34')][_0x4259('0x38')]));_0x37f148[_0x4259('0x37')]=_0x37f148[_0x4259('0x37')][_0x4259('0x39')]?_0x37f148[_0x4259('0x37')]:_0x5f3fc4[_0x4259('0x33')];if(_0x54eab7['query'][_0x4259('0x44')]){_0x37f148[_0x4259('0x4a')]=[{'all':!![]}];}_0x37f148=_[_0x4259('0x3f')]({},_0x37f148,_0x54eab7[_0x4259('0x43')]);return db[_0x4259('0x30')][_0x4259('0x4b')](_0x37f148)['then'](handleEntityNotFound(_0x28599c,null))[_0x4259('0x27')](function(_0x4919e7){if(_0x4919e7){var _0x165fc=_0x4919e7[_0x4259('0x29')]({'plain':!![]});_0x165fc=qs[_0x4259('0x57')](_0x165fc,['id',_0x4259('0x58'),_0x4259('0x59')]);_0x54eab7['body']=_['omit'](_0x54eab7['body'],['id',_0x4259('0x58'),'updatedAt']);return db[_0x4259('0x30')][_0x4259('0x4c')](_['merge'](_0x165fc,_0x54eab7['body']),{'include':_0x54eab7[_0x4259('0x34')][_0x4259('0x44')]?[{'all':!![]}]:undefined})[_0x4259('0x27')](function(_0x15893f){var _0x17245d=_0x54eab7['user'][_0x4259('0x29')]({'plain':!![]});if(!_0x17245d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17245d[_0x4259('0x50')]===_0x4259('0x4e')){var _0x26209d=_0x15893f[_0x4259('0x29')]({'plain':!![]});var _0x86a32='CustomDashboards';return db[_0x4259('0x51')][_0x4259('0x4b')]({'where':{'name':_0x86a32,'userProfileId':_0x17245d[_0x4259('0x52')]},'raw':!![]})[_0x4259('0x27')](function(_0x37b612){if(_0x37b612&&_0x37b612[_0x4259('0x53')]===0x0){return db['UserProfileResource'][_0x4259('0x4c')]({'name':_0x26209d[_0x4259('0x2d')],'resourceId':_0x26209d['id'],'type':_0x37b612[_0x4259('0x2d')],'sectionId':_0x37b612['id']},{})[_0x4259('0x27')](function(){return _0x15893f;});}else{return _0x15893f;}})[_0x4259('0x46')](function(_0x466fb7){logger[_0x4259('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x466fb7);throw _0x466fb7;});}return _0x15893f;});}})[_0x4259('0x27')](respondWithResult(_0x28599c,0xc9))['catch'](handleError(_0x28599c,null));};exports[_0x4259('0x5a')]=function(_0x50ae1a,_0x537314){if(_0x50ae1a[_0x4259('0x4d')]['id']){delete _0x50ae1a[_0x4259('0x4d')]['id'];}return db[_0x4259('0x30')][_0x4259('0x4b')]({'where':{'id':_0x50ae1a[_0x4259('0x48')]['id']}})[_0x4259('0x27')](handleEntityNotFound(_0x537314,null))[_0x4259('0x27')](saveUpdates(_0x50ae1a[_0x4259('0x4d')],null))[_0x4259('0x27')](respondWithResult(_0x537314,null))['catch'](handleError(_0x537314,null));};exports[_0x4259('0x28')]=function(_0x48fbbd,_0x18a0da){return db['Dashboard'][_0x4259('0x4b')]({'where':{'id':_0x48fbbd[_0x4259('0x48')]['id']}})[_0x4259('0x27')](handleEntityNotFound(_0x18a0da,null))[_0x4259('0x27')](removeEntity(_0x18a0da,null))[_0x4259('0x46')](handleError(_0x18a0da,null));};function widgetAttributes(_0x55e6b7){try{switch(_0x55e6b7[_0x4259('0x40')]){case'iframe':return[{'name':_0x4259('0x5b'),'value':_0x55e6b7['attrUrl']||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x0]?_0x55e6b7[_0x4259('0x5c')][0x0]['value']:undefined)||_0x4259('0x5d')}];case _0x4259('0x5e'):return[{'name':_0x4259('0x5f'),'value':_0x55e6b7[_0x4259('0x5f')]||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7['attrs'][0x0]?_0x55e6b7[_0x4259('0x5c')][0x0][_0x4259('0x60')]:undefined)||''}];case'clock':return[{'name':_0x4259('0x61'),'value':_0x55e6b7[_0x4259('0x61')]||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x0]?_0x55e6b7[_0x4259('0x5c')][0x0]['value']:undefined)||_0x4259('0x62')},{'name':'attrTimezone','value':_0x55e6b7[_0x4259('0x63')]||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x1]?_0x55e6b7[_0x4259('0x5c')][0x1][_0x4259('0x60')]:undefined)||_0x4259('0x64')},{'name':_0x4259('0x65'),'value':_0x55e6b7[_0x4259('0x65')]||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x2]?_0x55e6b7[_0x4259('0x5c')][0x2][_0x4259('0x60')]:undefined)||0xc}];case _0x4259('0x66'):return[{'name':_0x4259('0x67'),'value':_0x55e6b7[_0x4259('0x67')]||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x0]?_0x55e6b7[_0x4259('0x5c')][0x0]['value']:undefined)||_0x4259('0x68')},{'name':_0x4259('0x69'),'value':_0x55e6b7[_0x4259('0x69')]||(_0x55e6b7['attrs']&&_0x55e6b7[_0x4259('0x5c')][0x1]?_0x55e6b7[_0x4259('0x5c')][0x1]['value']:undefined)||[]},{'name':_0x4259('0x65'),'value':_0x55e6b7['attrFontSize']||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x2]?_0x55e6b7[_0x4259('0x5c')][0x2][_0x4259('0x60')]:undefined)||0x14}];case _0x4259('0x6a'):case'pie-chart':return[{'name':'attrSerie1','value':_0x55e6b7[_0x4259('0x6b')]||(_0x55e6b7['attrs']&&_0x55e6b7['attrs'][0x0]?_0x55e6b7['attrs'][0x0][_0x4259('0x60')]:undefined)||_0x4259('0x68')},{'name':'attrSerie2','value':_0x55e6b7[_0x4259('0x6c')]||(_0x55e6b7['attrs']&&_0x55e6b7[_0x4259('0x5c')][0x1]?_0x55e6b7[_0x4259('0x5c')][0x1][_0x4259('0x60')]:undefined)||null},{'name':_0x4259('0x6d'),'value':_0x55e6b7['attrSerie3']||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x2]?_0x55e6b7[_0x4259('0x5c')][0x2]['value']:undefined)||null},{'name':_0x4259('0x69'),'value':_0x55e6b7[_0x4259('0x69')]||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x3]?_0x55e6b7[_0x4259('0x5c')][0x3][_0x4259('0x60')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x55e6b7[_0x4259('0x6e')]||(_0x55e6b7['attrs']&&_0x55e6b7[_0x4259('0x5c')][0x0]?_0x55e6b7['attrs'][0x0][_0x4259('0x40')]:undefined)||null,'value':_0x55e6b7[_0x4259('0x6f')]||(_0x55e6b7['attrs']&&_0x55e6b7[_0x4259('0x5c')][0x0]?_0x55e6b7[_0x4259('0x5c')][0x0][_0x4259('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x55e6b7[_0x4259('0x70')]||(_0x55e6b7[_0x4259('0x5c')]&&_0x55e6b7[_0x4259('0x5c')][0x1]?_0x55e6b7[_0x4259('0x5c')][0x1][_0x4259('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x472a7e){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x472a7e));return[];}}exports[_0x4259('0x71')]=function(_0x414bef,_0x347bbe,_0x45ef46){if(_0x414bef[_0x4259('0x4d')]['id']){delete _0x414bef[_0x4259('0x4d')]['id'];}return db[_0x4259('0x30')][_0x4259('0x4b')]({'where':{'id':_0x414bef[_0x4259('0x48')]['id']}})[_0x4259('0x27')](handleEntityNotFound(_0x347bbe,null))['then'](function(_0x99406a){if(_0x99406a){_0x414bef[_0x4259('0x4d')]['DashboardId']=_0x99406a['id'];_0x414bef[_0x4259('0x4d')][_0x4259('0x5c')]=widgetAttributes(_0x414bef[_0x4259('0x4d')]);return db[_0x4259('0x72')][_0x4259('0x4c')](_0x414bef['body']);}})[_0x4259('0x27')](respondWithResult(_0x347bbe,null))[_0x4259('0x46')](handleError(_0x347bbe,null));};exports['getItems']=function(_0x2d1f8f,_0x45b538,_0x582af8){var _0x577d69={};var _0x2dce67={};var _0x3a672b;var _0x172df4;return db['Dashboard'][_0x4259('0x73')]({'where':{'id':_0x2d1f8f['params']['id']}})[_0x4259('0x27')](handleEntityNotFound(_0x45b538,null))[_0x4259('0x27')](function(_0x47219b){if(_0x47219b){_0x3a672b=_0x47219b;_0x2dce67[_0x4259('0x33')]=_[_0x4259('0x35')](db['DashboardItem']['rawAttributes']);_0x2dce67['query']=_['keys'](_0x2d1f8f[_0x4259('0x34')]);_0x2dce67[_0x4259('0x36')]=_[_0x4259('0x49')](_0x2dce67[_0x4259('0x33')],_0x2dce67[_0x4259('0x34')]);_0x577d69[_0x4259('0x37')]=_['intersection'](_0x2dce67[_0x4259('0x33')],qs[_0x4259('0x38')](_0x2d1f8f[_0x4259('0x34')][_0x4259('0x38')]));_0x577d69['attributes']=_0x577d69[_0x4259('0x37')][_0x4259('0x39')]?_0x577d69[_0x4259('0x37')]:_0x2dce67[_0x4259('0x33')];_0x577d69[_0x4259('0x3c')]=qs[_0x4259('0x3d')](_0x2d1f8f[_0x4259('0x34')]['sort']);_0x577d69['where']=qs[_0x4259('0x36')](_[_0x4259('0x74')](_0x2d1f8f[_0x4259('0x34')],_0x2dce67[_0x4259('0x36')]));if(_0x2d1f8f[_0x4259('0x34')][_0x4259('0x42')]){_0x577d69[_0x4259('0x3e')]=_[_0x4259('0x3f')](_0x577d69[_0x4259('0x3e')],{'$or':_[_0x4259('0x2f')](_0x577d69['attributes'],function(_0x12a567){var _0x1566d2={};_0x1566d2[_0x12a567]={'$like':'%'+_0x2d1f8f[_0x4259('0x34')]['filter']+'%'};return _0x1566d2;})});}_0x577d69=_[_0x4259('0x3f')]({},_0x577d69,_0x2d1f8f['options']);return _0x3a672b[_0x4259('0x75')](_0x577d69);}})['then'](function(_0x35460d){if(_0x35460d){_0x172df4=_0x35460d['length'];if(!_0x2d1f8f['query'][_0x4259('0x3a')](_0x4259('0x3b'))){_0x577d69[_0x4259('0x1f')]=qs[_0x4259('0x1f')](_0x2d1f8f[_0x4259('0x34')][_0x4259('0x1f')]);_0x577d69[_0x4259('0x22')]=qs[_0x4259('0x22')](_0x2d1f8f[_0x4259('0x34')]['offset']);}return _0x3a672b[_0x4259('0x75')](_0x577d69);}})[_0x4259('0x27')](function(_0x1f1e7c){if(_0x1f1e7c){return _0x1f1e7c?{'count':_0x172df4,'rows':_0x1f1e7c}:null;}})[_0x4259('0x27')](respondWithResult(_0x45b538,null))['catch'](handleError(_0x45b538,null));};
\ No newline at end of file
+var _0x1434=['role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','options','omit','createdAt','updatedAt','CustomDashboards','UserProfileSection','iframe','attrUrl','https://','custom','attrPath','attrs','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','socket.io-emitter','./dashboard.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','sendStatus','error','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get'];(function(_0x13bea0,_0x210a0c){var _0x3f12df=function(_0x11ef1c){while(--_0x11ef1c){_0x13bea0['push'](_0x13bea0['shift']());}};_0x3f12df(++_0x210a0c);}(_0x1434,0x18c));var _0x4143=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x1434[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0x4143('0x0'));var rimraf=require(_0x4143('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4143('0x2'));var rp=require(_0x4143('0x3'));var moment=require(_0x4143('0x4'));var BPromise=require(_0x4143('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4143('0x6'));var sox=require(_0x4143('0x7'));var csv=require(_0x4143('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4143('0x9'));var _=require('lodash');var squel=require(_0x4143('0xa'));var crypto=require(_0x4143('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4143('0xc'));var toCsv=require(_0x4143('0x8'));var querystring=require(_0x4143('0xd'));var Papa=require(_0x4143('0xe'));var Redis=require(_0x4143('0xf'));var authService=require(_0x4143('0x10'));var qs=require(_0x4143('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4143('0x12'));var logger=require(_0x4143('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4143('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4143('0x15')]=_['defaults'](config[_0x4143('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x4143('0x16'))(new Redis(config[_0x4143('0x15')]));require(_0x4143('0x17'))[_0x4143('0x18')](socket);function respondWithStatusCode(_0x5dedb2,_0x56dc35){_0x56dc35=_0x56dc35||0xcc;return function(_0x1123af){if(_0x1123af){return _0x5dedb2['sendStatus'](_0x56dc35);}return _0x5dedb2['status'](_0x56dc35)[_0x4143('0x19')]();};}function respondWithResult(_0x3d0865,_0x30881a){_0x30881a=_0x30881a||0xc8;return function(_0x3b390a){if(_0x3b390a){return _0x3d0865[_0x4143('0x1a')](_0x30881a)[_0x4143('0x1b')](_0x3b390a);}};}function respondWithFilteredResult(_0x53dc67,_0x462efe){return function(_0x3b4ab8){if(_0x3b4ab8){var _0x10c918=typeof _0x462efe[_0x4143('0x1c')]===_0x4143('0x1d')&&typeof _0x462efe[_0x4143('0x1e')]===_0x4143('0x1d');var _0x1eaf71=_0x3b4ab8[_0x4143('0x1f')];var _0x114349=_0x10c918?0x0:_0x462efe[_0x4143('0x1c')];var _0x2b1b12=_0x10c918?_0x3b4ab8[_0x4143('0x1f')]:_0x462efe[_0x4143('0x1c')]+_0x462efe[_0x4143('0x1e')];var _0x309399;if(_0x2b1b12>=_0x1eaf71){_0x2b1b12=_0x1eaf71;_0x309399=0xc8;}else{_0x309399=0xce;}_0x53dc67[_0x4143('0x1a')](_0x309399);return _0x53dc67[_0x4143('0x20')](_0x4143('0x21'),_0x114349+'-'+_0x2b1b12+'/'+_0x1eaf71)[_0x4143('0x1b')](_0x3b4ab8);}return null;};}function patchUpdates(_0x1e2233){return function(_0x3c5b97){try{jsonpatch[_0x4143('0x22')](_0x3c5b97,_0x1e2233,!![]);}catch(_0xe5b244){return BPromise[_0x4143('0x23')](_0xe5b244);}return _0x3c5b97['save']();};}function saveUpdates(_0xf8789b,_0x2d0d71){return function(_0x4ba88f){if(_0x4ba88f){return _0x4ba88f[_0x4143('0x24')](_0xf8789b)['then'](function(_0x1eeb63){return _0x1eeb63;});}return null;};}function removeEntity(_0x57c41d,_0xc3439b){return function(_0x338acc){if(_0x338acc){return _0x338acc[_0x4143('0x25')]()[_0x4143('0x26')](function(){var _0x13bca7=_0x338acc['get']({'plain':!![]});var _0xab60bb='CustomDashboards';return db[_0x4143('0x27')][_0x4143('0x25')]({'where':{'type':_0xab60bb,'resourceId':_0x13bca7['id']}})[_0x4143('0x26')](function(){return _0x338acc;});})[_0x4143('0x26')](function(){_0x57c41d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xad2beb,_0x158de1){return function(_0x948eb2){if(!_0x948eb2){_0xad2beb[_0x4143('0x28')](0x194);}return _0x948eb2;};}function handleError(_0x329983,_0x5d3666){_0x5d3666=_0x5d3666||0x1f4;return function(_0x369fbd){logger[_0x4143('0x29')](_0x369fbd['stack']);if(_0x369fbd[_0x4143('0x2a')]){delete _0x369fbd['name'];}_0x329983[_0x4143('0x1a')](_0x5d3666)[_0x4143('0x2b')](_0x369fbd);};}exports[_0x4143('0x2c')]=function(_0x2f0b7f,_0x30cf50){var _0x4d4d4a={},_0x1bb043={},_0x43f912={'count':0x0,'rows':[]};var _0x4daac4=_['map'](db[_0x4143('0x2d')][_0x4143('0x2e')],function(_0x449563){return{'name':_0x449563[_0x4143('0x2f')],'type':_0x449563[_0x4143('0x30')][_0x4143('0x31')]};});_0x1bb043[_0x4143('0x32')]=_['map'](_0x4daac4,_0x4143('0x2a'));_0x1bb043[_0x4143('0x33')]=_[_0x4143('0x34')](_0x2f0b7f[_0x4143('0x33')]);_0x1bb043['filters']=_[_0x4143('0x35')](_0x1bb043[_0x4143('0x32')],_0x1bb043['query']);_0x4d4d4a[_0x4143('0x36')]=_[_0x4143('0x35')](_0x1bb043['model'],qs[_0x4143('0x37')](_0x2f0b7f['query'][_0x4143('0x37')]));_0x4d4d4a[_0x4143('0x36')]=_0x4d4d4a[_0x4143('0x36')][_0x4143('0x38')]?_0x4d4d4a[_0x4143('0x36')]:_0x1bb043[_0x4143('0x32')];if(!_0x2f0b7f['query'][_0x4143('0x39')](_0x4143('0x3a'))){_0x4d4d4a[_0x4143('0x1e')]=qs['limit'](_0x2f0b7f['query'][_0x4143('0x1e')]);_0x4d4d4a[_0x4143('0x1c')]=qs[_0x4143('0x1c')](_0x2f0b7f[_0x4143('0x33')][_0x4143('0x1c')]);}_0x4d4d4a[_0x4143('0x3b')]=qs[_0x4143('0x3c')](_0x2f0b7f['query'][_0x4143('0x3c')]);_0x4d4d4a[_0x4143('0x3d')]=qs[_0x4143('0x3e')](_[_0x4143('0x3f')](_0x2f0b7f[_0x4143('0x33')],_0x1bb043[_0x4143('0x3e')]),_0x4daac4);if(_0x2f0b7f[_0x4143('0x33')][_0x4143('0x40')]){_0x4d4d4a[_0x4143('0x3d')]=_[_0x4143('0x41')](_0x4d4d4a[_0x4143('0x3d')],{'$or':_[_0x4143('0x42')](_0x4daac4,function(_0x55839e){if(_0x55839e[_0x4143('0x30')]!==_0x4143('0x43')){var _0xc1ed04={};_0xc1ed04[_0x55839e['name']]={'$like':'%'+_0x2f0b7f[_0x4143('0x33')]['filter']+'%'};return _0xc1ed04;}})});}_0x4d4d4a=_[_0x4143('0x41')]({},_0x4d4d4a,_0x2f0b7f['options']);var _0x4bc0fd={'where':_0x4d4d4a[_0x4143('0x3d')]};return db[_0x4143('0x2d')][_0x4143('0x1f')](_0x4bc0fd)[_0x4143('0x26')](function(_0xd523c1){_0x43f912['count']=_0xd523c1;if(_0x2f0b7f[_0x4143('0x33')][_0x4143('0x44')]){_0x4d4d4a[_0x4143('0x45')]=[{'all':!![]}];}return db[_0x4143('0x2d')][_0x4143('0x46')](_0x4d4d4a);})[_0x4143('0x26')](function(_0x2e1c0e){_0x43f912[_0x4143('0x47')]=_0x2e1c0e;return _0x43f912;})[_0x4143('0x26')](respondWithFilteredResult(_0x30cf50,_0x4d4d4a))[_0x4143('0x48')](handleError(_0x30cf50,null));};exports[_0x4143('0x49')]=function(_0x4b4827,_0x4b0f73){var _0x19192c={'raw':![],'where':{'id':_0x4b4827[_0x4143('0x4a')]['id']}},_0x1feb88={};_0x1feb88[_0x4143('0x32')]=_[_0x4143('0x34')](db[_0x4143('0x2d')][_0x4143('0x2e')]);_0x1feb88['query']=_['keys'](_0x4b4827[_0x4143('0x33')]);_0x1feb88[_0x4143('0x3e')]=_['intersection'](_0x1feb88['model'],_0x1feb88[_0x4143('0x33')]);_0x19192c[_0x4143('0x36')]=_['intersection'](_0x1feb88[_0x4143('0x32')],qs[_0x4143('0x37')](_0x4b4827['query']['fields']));_0x19192c[_0x4143('0x36')]=_0x19192c[_0x4143('0x36')]['length']?_0x19192c[_0x4143('0x36')]:_0x1feb88['model'];if(_0x4b4827[_0x4143('0x33')][_0x4143('0x44')]){_0x19192c['include']=[{'all':!![]}];}_0x19192c=_[_0x4143('0x41')]({},_0x19192c,_0x4b4827['options']);return db[_0x4143('0x2d')][_0x4143('0x4b')](_0x19192c)[_0x4143('0x26')](handleEntityNotFound(_0x4b0f73,null))[_0x4143('0x26')](respondWithResult(_0x4b0f73,null))['catch'](handleError(_0x4b0f73,null));};exports[_0x4143('0x4c')]=function(_0x4669a5,_0x3d41ba){return db[_0x4143('0x2d')][_0x4143('0x4c')](_0x4669a5[_0x4143('0x4d')],{})[_0x4143('0x26')](function(_0x2fc240){var _0x3a3ca1=_0x4669a5[_0x4143('0x4e')][_0x4143('0x4f')]({'plain':!![]});if(!_0x3a3ca1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a3ca1[_0x4143('0x50')]===_0x4143('0x4e')){var _0x344c51=_0x2fc240[_0x4143('0x4f')]({'plain':!![]});var _0x3b25a6='CustomDashboards';return db['UserProfileSection'][_0x4143('0x4b')]({'where':{'name':_0x3b25a6,'userProfileId':_0x3a3ca1[_0x4143('0x51')]},'raw':!![]})[_0x4143('0x26')](function(_0xfcebc3){if(_0xfcebc3&&_0xfcebc3['autoAssociation']===0x0){return db[_0x4143('0x27')][_0x4143('0x4c')]({'name':_0x344c51[_0x4143('0x2a')],'resourceId':_0x344c51['id'],'type':_0xfcebc3['name'],'sectionId':_0xfcebc3['id']},{})[_0x4143('0x26')](function(){return _0x2fc240;});}else{return _0x2fc240;}})[_0x4143('0x48')](function(_0x2aee3f){logger[_0x4143('0x29')](_0x4143('0x52'),_0x2aee3f);throw _0x2aee3f;});}return _0x2fc240;})['then'](respondWithResult(_0x3d41ba,0xc9))[_0x4143('0x48')](handleError(_0x3d41ba,null));};exports['clone']=function(_0x18c53c,_0x31e449){var _0x48672f={'where':{'id':_0x18c53c[_0x4143('0x4a')]['id']}},_0x57d761={};_0x57d761['model']=_[_0x4143('0x34')](db[_0x4143('0x2d')]['rawAttributes']);_0x48672f[_0x4143('0x36')]=_[_0x4143('0x35')](_0x57d761[_0x4143('0x32')],qs[_0x4143('0x37')](_0x18c53c[_0x4143('0x33')]['fields']));_0x48672f[_0x4143('0x36')]=_0x48672f[_0x4143('0x36')][_0x4143('0x38')]?_0x48672f[_0x4143('0x36')]:_0x57d761[_0x4143('0x32')];if(_0x18c53c[_0x4143('0x33')]['includeAll']){_0x48672f['include']=[{'all':!![]}];}_0x48672f=_['merge']({},_0x48672f,_0x18c53c[_0x4143('0x53')]);return db[_0x4143('0x2d')][_0x4143('0x4b')](_0x48672f)[_0x4143('0x26')](handleEntityNotFound(_0x31e449,null))[_0x4143('0x26')](function(_0x374fea){if(_0x374fea){var _0x1e06f1=_0x374fea[_0x4143('0x4f')]({'plain':!![]});_0x1e06f1=qs[_0x4143('0x54')](_0x1e06f1,['id',_0x4143('0x55'),_0x4143('0x56')]);_0x18c53c[_0x4143('0x4d')]=_[_0x4143('0x54')](_0x18c53c[_0x4143('0x4d')],['id',_0x4143('0x55'),_0x4143('0x56')]);return db['Dashboard'][_0x4143('0x4c')](_[_0x4143('0x41')](_0x1e06f1,_0x18c53c[_0x4143('0x4d')]),{'include':_0x18c53c['query'][_0x4143('0x44')]?[{'all':!![]}]:undefined})[_0x4143('0x26')](function(_0x21ed70){var _0x4688af=_0x18c53c[_0x4143('0x4e')]['get']({'plain':!![]});if(!_0x4688af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4688af[_0x4143('0x50')]==='user'){var _0x5c762b=_0x21ed70[_0x4143('0x4f')]({'plain':!![]});var _0x4ffe24=_0x4143('0x57');return db[_0x4143('0x58')][_0x4143('0x4b')]({'where':{'name':_0x4ffe24,'userProfileId':_0x4688af[_0x4143('0x51')]},'raw':!![]})[_0x4143('0x26')](function(_0xbfaafe){if(_0xbfaafe&&_0xbfaafe['autoAssociation']===0x0){return db[_0x4143('0x27')][_0x4143('0x4c')]({'name':_0x5c762b[_0x4143('0x2a')],'resourceId':_0x5c762b['id'],'type':_0xbfaafe[_0x4143('0x2a')],'sectionId':_0xbfaafe['id']},{})['then'](function(){return _0x21ed70;});}else{return _0x21ed70;}})[_0x4143('0x48')](function(_0x38c5b2){logger[_0x4143('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38c5b2);throw _0x38c5b2;});}return _0x21ed70;});}})[_0x4143('0x26')](respondWithResult(_0x31e449,0xc9))[_0x4143('0x48')](handleError(_0x31e449,null));};exports['update']=function(_0x23c97a,_0x266efe){if(_0x23c97a[_0x4143('0x4d')]['id']){delete _0x23c97a[_0x4143('0x4d')]['id'];}return db[_0x4143('0x2d')][_0x4143('0x4b')]({'where':{'id':_0x23c97a['params']['id']}})[_0x4143('0x26')](handleEntityNotFound(_0x266efe,null))[_0x4143('0x26')](saveUpdates(_0x23c97a[_0x4143('0x4d')],null))[_0x4143('0x26')](respondWithResult(_0x266efe,null))[_0x4143('0x48')](handleError(_0x266efe,null));};exports[_0x4143('0x25')]=function(_0x581cc1,_0x506010){return db[_0x4143('0x2d')][_0x4143('0x4b')]({'where':{'id':_0x581cc1[_0x4143('0x4a')]['id']}})['then'](handleEntityNotFound(_0x506010,null))[_0x4143('0x26')](removeEntity(_0x506010,null))[_0x4143('0x48')](handleError(_0x506010,null));};function widgetAttributes(_0x41628e){try{switch(_0x41628e[_0x4143('0x30')]){case _0x4143('0x59'):return[{'name':_0x4143('0x5a'),'value':_0x41628e[_0x4143('0x5a')]||(_0x41628e['attrs']&&_0x41628e['attrs'][0x0]?_0x41628e['attrs'][0x0]['value']:undefined)||_0x4143('0x5b')}];case _0x4143('0x5c'):return[{'name':_0x4143('0x5d'),'value':_0x41628e[_0x4143('0x5d')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x0]?_0x41628e['attrs'][0x0][_0x4143('0x5f')]:undefined)||''}];case _0x4143('0x60'):return[{'name':'attrHourFormat','value':_0x41628e[_0x4143('0x61')]||(_0x41628e['attrs']&&_0x41628e[_0x4143('0x5e')][0x0]?_0x41628e[_0x4143('0x5e')][0x0]['value']:undefined)||_0x4143('0x62')},{'name':_0x4143('0x63'),'value':_0x41628e[_0x4143('0x63')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x1]?_0x41628e['attrs'][0x1][_0x4143('0x5f')]:undefined)||_0x4143('0x64')},{'name':_0x4143('0x65'),'value':_0x41628e['attrFontSize']||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x2]?_0x41628e[_0x4143('0x5e')][0x2]['value']:undefined)||0xc}];case _0x4143('0x66'):return[{'name':_0x4143('0x67'),'value':_0x41628e[_0x4143('0x67')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e['attrs'][0x0]?_0x41628e[_0x4143('0x5e')][0x0][_0x4143('0x5f')]:undefined)||_0x4143('0x68')},{'name':_0x4143('0x69'),'value':_0x41628e[_0x4143('0x69')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e['attrs'][0x1]?_0x41628e[_0x4143('0x5e')][0x1]['value']:undefined)||[]},{'name':_0x4143('0x65'),'value':_0x41628e[_0x4143('0x65')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x2]?_0x41628e[_0x4143('0x5e')][0x2][_0x4143('0x5f')]:undefined)||0x14}];case _0x4143('0x6a'):case _0x4143('0x6b'):return[{'name':'attrSerie1','value':_0x41628e[_0x4143('0x6c')]||(_0x41628e['attrs']&&_0x41628e['attrs'][0x0]?_0x41628e[_0x4143('0x5e')][0x0][_0x4143('0x5f')]:undefined)||_0x4143('0x68')},{'name':_0x4143('0x6d'),'value':_0x41628e[_0x4143('0x6d')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x1]?_0x41628e[_0x4143('0x5e')][0x1][_0x4143('0x5f')]:undefined)||null},{'name':_0x4143('0x6e'),'value':_0x41628e[_0x4143('0x6e')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x2]?_0x41628e['attrs'][0x2][_0x4143('0x5f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x41628e[_0x4143('0x69')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x3]?_0x41628e[_0x4143('0x5e')][0x3][_0x4143('0x5f')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x41628e[_0x4143('0x6f')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x0]?_0x41628e[_0x4143('0x5e')][0x0][_0x4143('0x30')]:undefined)||null,'value':_0x41628e[_0x4143('0x70')]||(_0x41628e[_0x4143('0x5e')]&&_0x41628e[_0x4143('0x5e')][0x0]?_0x41628e[_0x4143('0x5e')][0x0][_0x4143('0x5f')]:undefined)||null},{'name':_0x4143('0x71'),'value':_0x41628e['attrRefresh']||(_0x41628e['attrs']&&_0x41628e[_0x4143('0x5e')][0x1]?_0x41628e[_0x4143('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2289e6){logger[_0x4143('0x29')](_0x4143('0x72'),JSON[_0x4143('0x73')](_0x2289e6));return[];}}exports[_0x4143('0x74')]=function(_0x1d55ea,_0x3595ca,_0x56270c){if(_0x1d55ea[_0x4143('0x4d')]['id']){delete _0x1d55ea[_0x4143('0x4d')]['id'];}return db['Dashboard'][_0x4143('0x4b')]({'where':{'id':_0x1d55ea['params']['id']}})[_0x4143('0x26')](handleEntityNotFound(_0x3595ca,null))[_0x4143('0x26')](function(_0x4965ce){if(_0x4965ce){_0x1d55ea[_0x4143('0x4d')]['DashboardId']=_0x4965ce['id'];_0x1d55ea[_0x4143('0x4d')][_0x4143('0x5e')]=widgetAttributes(_0x1d55ea['body']);return db['DashboardItem'][_0x4143('0x4c')](_0x1d55ea[_0x4143('0x4d')]);}})[_0x4143('0x26')](respondWithResult(_0x3595ca,null))[_0x4143('0x48')](handleError(_0x3595ca,null));};exports[_0x4143('0x75')]=function(_0x1e5e36,_0x316846,_0x4c5a32){var _0x1cbc36={};var _0x476c68={};var _0x55316b;var _0x3066f8;return db[_0x4143('0x2d')][_0x4143('0x76')]({'where':{'id':_0x1e5e36[_0x4143('0x4a')]['id']}})[_0x4143('0x26')](handleEntityNotFound(_0x316846,null))[_0x4143('0x26')](function(_0x1368c0){if(_0x1368c0){_0x55316b=_0x1368c0;_0x476c68[_0x4143('0x32')]=_[_0x4143('0x34')](db['DashboardItem']['rawAttributes']);_0x476c68[_0x4143('0x33')]=_[_0x4143('0x34')](_0x1e5e36['query']);_0x476c68[_0x4143('0x3e')]=_[_0x4143('0x35')](_0x476c68[_0x4143('0x32')],_0x476c68[_0x4143('0x33')]);_0x1cbc36[_0x4143('0x36')]=_[_0x4143('0x35')](_0x476c68[_0x4143('0x32')],qs[_0x4143('0x37')](_0x1e5e36['query'][_0x4143('0x37')]));_0x1cbc36[_0x4143('0x36')]=_0x1cbc36[_0x4143('0x36')][_0x4143('0x38')]?_0x1cbc36[_0x4143('0x36')]:_0x476c68[_0x4143('0x32')];_0x1cbc36[_0x4143('0x3b')]=qs[_0x4143('0x3c')](_0x1e5e36[_0x4143('0x33')][_0x4143('0x3c')]);_0x1cbc36[_0x4143('0x3d')]=qs[_0x4143('0x3e')](_[_0x4143('0x3f')](_0x1e5e36[_0x4143('0x33')],_0x476c68['filters']));if(_0x1e5e36['query'][_0x4143('0x40')]){_0x1cbc36[_0x4143('0x3d')]=_['merge'](_0x1cbc36[_0x4143('0x3d')],{'$or':_[_0x4143('0x42')](_0x1cbc36[_0x4143('0x36')],function(_0x2ff8da){var _0x5d2ca0={};_0x5d2ca0[_0x2ff8da]={'$like':'%'+_0x1e5e36[_0x4143('0x33')]['filter']+'%'};return _0x5d2ca0;})});}_0x1cbc36=_[_0x4143('0x41')]({},_0x1cbc36,_0x1e5e36[_0x4143('0x53')]);return _0x55316b[_0x4143('0x75')](_0x1cbc36);}})[_0x4143('0x26')](function(_0x65b8fc){if(_0x65b8fc){_0x3066f8=_0x65b8fc[_0x4143('0x38')];if(!_0x1e5e36['query'][_0x4143('0x39')](_0x4143('0x3a'))){_0x1cbc36[_0x4143('0x1e')]=qs[_0x4143('0x1e')](_0x1e5e36['query'][_0x4143('0x1e')]);_0x1cbc36['offset']=qs['offset'](_0x1e5e36['query'][_0x4143('0x1c')]);}return _0x55316b['getItems'](_0x1cbc36);}})[_0x4143('0x26')](function(_0x484b15){if(_0x484b15){return _0x484b15?{'count':_0x3066f8,'rows':_0x484b15}:null;}})[_0x4143('0x26')](respondWithResult(_0x316846,null))[_0x4143('0x48')](handleError(_0x316846,null));};
\ No newline at end of file
index a277181..293c752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85a6=['update','remove','emit','hook','exports','Dashboard'];(function(_0x30e0c4,_0xfb4dd){var _0x4f48cc=function(_0x40c219){while(--_0x40c219){_0x30e0c4['push'](_0x30e0c4['shift']());}};_0x4f48cc(++_0xfb4dd);}(_0x85a6,0x1cd));var _0x685a=function(_0xd746a2,_0x1f3c19){_0xd746a2=_0xd746a2-0x0;var _0x175753=_0x85a6[_0xd746a2];return _0x175753;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x685a('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x685a('0x1'),'afterDestroy':_0x685a('0x2')};function emitEvent(_0x3ffbb7){return function(_0x2a66f6,_0x344a01,_0x3a9fc0){DashboardEvents[_0x685a('0x3')](_0x3ffbb7+':'+_0x2a66f6['id'],_0x2a66f6);DashboardEvents[_0x685a('0x3')](_0x3ffbb7,_0x2a66f6);_0x3a9fc0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x685a('0x4')](e,emitEvent(event));}}module[_0x685a('0x5')]=DashboardEvents;
\ No newline at end of file
+var _0x492f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update'];(function(_0x3155d4,_0x48595c){var _0x1814d0=function(_0x28ea7f){while(--_0x28ea7f){_0x3155d4['push'](_0x3155d4['shift']());}};_0x1814d0(++_0x48595c);}(_0x492f,0x10d));var _0xf492=function(_0x31f749,_0x15c7c0){_0x31f749=_0x31f749-0x0;var _0x26951b=_0x492f[_0x31f749];return _0x26951b;};'use strict';var EventEmitter=require(_0xf492('0x0'));var Dashboard=require(_0xf492('0x1'))['db'][_0xf492('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf492('0x3')](0x0);var events={'afterCreate':_0xf492('0x4'),'afterUpdate':_0xf492('0x5'),'afterDestroy':_0xf492('0x6')};function emitEvent(_0x528c67){return function(_0x89b811,_0x48e17c,_0x12997e){DashboardEvents['emit'](_0x528c67+':'+_0x89b811['id'],_0x89b811);DashboardEvents[_0xf492('0x7')](_0x528c67,_0x89b811);_0x12997e(null);};}for(var e in events){if(events[_0xf492('0x8')](e)){var event=events[e];Dashboard[_0xf492('0x9')](e,emitEvent(event));}}module[_0xf492('0xa')]=DashboardEvents;
\ No newline at end of file
index cdc26ee..733098c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8921=['Dashboard','dashboards','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x1bf263,_0x48603c){var _0x1b8d7a=function(_0x54d96c){while(--_0x54d96c){_0x1bf263['push'](_0x1bf263['shift']());}};_0x1b8d7a(++_0x48603c);}(_0x8921,0x70));var _0x1892=function(_0x2f67ce,_0x419c88){_0x2f67ce=_0x2f67ce-0x0;var _0x55d3d6=_0x8921[_0x2f67ce];return _0x55d3d6;};'use strict';var _=require('lodash');var util=require(_0x1892('0x0'));var logger=require('../../config/logger')(_0x1892('0x1'));var moment=require(_0x1892('0x2'));var BPromise=require(_0x1892('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1892('0x4'));var rimraf=require(_0x1892('0x5'));var config=require(_0x1892('0x6'));var attributes=require('./dashboard.attributes');module[_0x1892('0x7')]=function(_0x1076c6,_0x3ce039){return _0x1076c6[_0x1892('0x8')](_0x1892('0x9'),attributes,{'tableName':_0x1892('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2470=['rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','api','moment','path'];(function(_0x33cb89,_0x489e3c){var _0x1bd93e=function(_0x305b2c){while(--_0x305b2c){_0x33cb89['push'](_0x33cb89['shift']());}};_0x1bd93e(++_0x489e3c);}(_0x2470,0xb6));var _0x0247=function(_0x110e68,_0x252643){_0x110e68=_0x110e68-0x0;var _0x389564=_0x2470[_0x110e68];return _0x389564;};'use strict';var _=require(_0x0247('0x0'));var util=require(_0x0247('0x1'));var logger=require('../../config/logger')(_0x0247('0x2'));var moment=require(_0x0247('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0247('0x4'));var rimraf=require(_0x0247('0x5'));var config=require(_0x0247('0x6'));var attributes=require(_0x0247('0x7'));module['exports']=function(_0x4adc99,_0x41ed22){return _0x4adc99[_0x0247('0x8')](_0x0247('0x9'),attributes,{'tableName':_0x0247('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f0535f..d278a06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91dd=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1ff820,_0x54e982){var _0xcddfff=function(_0x1ad9e6){while(--_0x1ad9e6){_0x1ff820['push'](_0x1ff820['shift']());}};_0xcddfff(++_0x54e982);}(_0x91dd,0x141));var _0xd91d=function(_0x474f88,_0xc14cc){_0x474f88=_0x474f88-0x0;var _0x39dc66=_0x91dd[_0x474f88];return _0x39dc66;};'use strict';var _=require(_0xd91d('0x0'));var util=require('util');var moment=require(_0xd91d('0x1'));var BPromise=require(_0xd91d('0x2'));var rs=require(_0xd91d('0x3'));var fs=require('fs');var Redis=require(_0xd91d('0x4'));var db=require(_0xd91d('0x5'))['db'];var utils=require(_0xd91d('0x6'));var logger=require(_0xd91d('0x7'))(_0xd91d('0x8'));var config=require(_0xd91d('0x9'));var jayson=require(_0xd91d('0xa'));var client=jayson['client'][_0xd91d('0xb')]({'port':0x232a});config['redis']=_[_0xd91d('0xc')](config[_0xd91d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd91d('0xe'))(new Redis(config['redis']));require(_0xd91d('0xf'))[_0xd91d('0x10')](socket);function respondWithRpcPromise(_0xbd9282,_0x2841eb,_0x38b60f){return new BPromise(function(_0x16292a,_0x46b8c1){return client[_0xd91d('0x11')](_0xbd9282,_0x38b60f)[_0xd91d('0x12')](function(_0x587572){logger[_0xd91d('0x13')](_0xd91d('0x14'),_0x2841eb,_0xd91d('0x15'));logger[_0xd91d('0x16')](_0xd91d('0x17'),_0x2841eb,_0xd91d('0x15'),JSON[_0xd91d('0x18')](_0x587572));if(_0x587572[_0xd91d('0x19')]){if(_0x587572[_0xd91d('0x19')][_0xd91d('0x1a')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x2841eb,_0x587572[_0xd91d('0x19')][_0xd91d('0x1b')]);return _0x46b8c1(_0x587572[_0xd91d('0x19')][_0xd91d('0x1b')]);}logger[_0xd91d('0x19')](_0xd91d('0x14'),_0x2841eb,_0x587572[_0xd91d('0x19')][_0xd91d('0x1b')]);return _0x16292a(_0x587572['error'][_0xd91d('0x1b')]);}else{logger['info'](_0xd91d('0x14'),_0x2841eb,_0xd91d('0x15'));_0x16292a(_0x587572['result']['message']);}})[_0xd91d('0x1c')](function(_0x4fe87b){logger['error'](_0xd91d('0x14'),_0x2841eb,_0x4fe87b);_0x46b8c1(_0x4fe87b);});});}
\ No newline at end of file
+var _0x7409=['redis','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','defaults'];(function(_0x57c026,_0x1af206){var _0x358b9c=function(_0x247b67){while(--_0x247b67){_0x57c026['push'](_0x57c026['shift']());}};_0x358b9c(++_0x1af206);}(_0x7409,0xc6));var _0x9740=function(_0x105c6a,_0x48c736){_0x105c6a=_0x105c6a-0x0;var _0x5b844d=_0x7409[_0x105c6a];return _0x5b844d;};'use strict';var _=require(_0x9740('0x0'));var util=require('util');var moment=require(_0x9740('0x1'));var BPromise=require(_0x9740('0x2'));var rs=require(_0x9740('0x3'));var fs=require('fs');var Redis=require(_0x9740('0x4'));var db=require(_0x9740('0x5'))['db'];var utils=require(_0x9740('0x6'));var logger=require('../../config/logger')(_0x9740('0x7'));var config=require('../../config/environment');var jayson=require(_0x9740('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9740('0x9')](config[_0x9740('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9740('0xb'))(new Redis(config[_0x9740('0xa')]));require(_0x9740('0xc'))[_0x9740('0xd')](socket);function respondWithRpcPromise(_0x57caae,_0x42ac09,_0x8f8c1b){return new BPromise(function(_0x43273b,_0x5872b7){return client[_0x9740('0xe')](_0x57caae,_0x8f8c1b)[_0x9740('0xf')](function(_0x12ef94){logger[_0x9740('0x10')](_0x9740('0x11'),_0x42ac09,_0x9740('0x12'));logger[_0x9740('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x42ac09,_0x9740('0x12'),JSON[_0x9740('0x14')](_0x12ef94));if(_0x12ef94[_0x9740('0x15')]){if(_0x12ef94[_0x9740('0x15')][_0x9740('0x16')]===0x1f4){logger['error'](_0x9740('0x11'),_0x42ac09,_0x12ef94['error'][_0x9740('0x17')]);return _0x5872b7(_0x12ef94['error'][_0x9740('0x17')]);}logger[_0x9740('0x15')](_0x9740('0x11'),_0x42ac09,_0x12ef94[_0x9740('0x15')][_0x9740('0x17')]);return _0x43273b(_0x12ef94['error'][_0x9740('0x17')]);}else{logger[_0x9740('0x10')](_0x9740('0x11'),_0x42ac09,_0x9740('0x12'));_0x43273b(_0x12ef94[_0x9740('0x18')][_0x9740('0x17')]);}})[_0x9740('0x19')](function(_0x1347f3){logger[_0x9740('0x15')]('Dashboard,\x20%s,\x20%s',_0x42ac09,_0x1347f3);_0x5872b7(_0x1347f3);});});}
\ No newline at end of file
index 26db146..5f93107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7448=['./dashboard.events','save','remove','update','removeListener','length','dashboard:'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x7448,0x149));var _0x8744=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x7448[_0x10dbf6];return _0x452147;};'use strict';var DashboardEvents=require(_0x8744('0x0'));var events=[_0x8744('0x1'),_0x8744('0x2'),_0x8744('0x3')];function createListener(_0x115f87,_0x16d448){return function(_0x27d8f4){_0x16d448['emit'](_0x115f87,_0x27d8f4);};}function removeListener(_0x6d428d,_0x2f1506){return function(){DashboardEvents[_0x8744('0x4')](_0x6d428d,_0x2f1506);};}exports['register']=function(_0x3b527d){for(var _0x275ae0=0x0,_0x3d870a=events[_0x8744('0x5')];_0x275ae0<_0x3d870a;_0x275ae0++){var _0x3af634=events[_0x275ae0];var _0x4e8de4=createListener(_0x8744('0x6')+_0x3af634,_0x3b527d);DashboardEvents['on'](_0x3af634,_0x4e8de4);}};
\ No newline at end of file
+var _0x5690=['length','./dashboard.events','save','remove','register'];(function(_0x165782,_0x41de33){var _0x30f7ef=function(_0x52703a){while(--_0x52703a){_0x165782['push'](_0x165782['shift']());}};_0x30f7ef(++_0x41de33);}(_0x5690,0x74));var _0x0569=function(_0x4453a9,_0x217f6c){_0x4453a9=_0x4453a9-0x0;var _0x2828ea=_0x5690[_0x4453a9];return _0x2828ea;};'use strict';var DashboardEvents=require(_0x0569('0x0'));var events=[_0x0569('0x1'),_0x0569('0x2'),'update'];function createListener(_0x5d2d84,_0x34cc37){return function(_0x1ebae1){_0x34cc37['emit'](_0x5d2d84,_0x1ebae1);};}function removeListener(_0x136fb9,_0x2b9c0b){return function(){DashboardEvents['removeListener'](_0x136fb9,_0x2b9c0b);};}exports[_0x0569('0x3')]=function(_0x202876){for(var _0x84e864=0x0,_0x2ae4b6=events[_0x0569('0x4')];_0x84e864<_0x2ae4b6;_0x84e864++){var _0x527640=events[_0x84e864];var _0x36859f=createListener('dashboard:'+_0x527640,_0x202876);DashboardEvents['on'](_0x527640,_0x36859f);}};
\ No newline at end of file
index 5805efa..bb4fa2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9e6=['path','express','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','getItems','post','create','/:id/clone','/:id/items','addItem','destroy','exports','multer'];(function(_0x461480,_0x771a9){var _0xeae1e9=function(_0x149830){while(--_0x149830){_0x461480['push'](_0x461480['shift']());}};_0xeae1e9(++_0x771a9);}(_0xb9e6,0x1b4));var _0x6b9e=function(_0x2b3446,_0x5058bc){_0x2b3446=_0x2b3446-0x0;var _0x3ed291=_0xb9e6[_0x2b3446];return _0x3ed291;};'use strict';var multer=require(_0x6b9e('0x0'));var util=require('util');var path=require(_0x6b9e('0x1'));var timeout=require('connect-timeout');var express=require(_0x6b9e('0x2'));var router=express[_0x6b9e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6b9e('0x4'));var config=require(_0x6b9e('0x5'));var controller=require(_0x6b9e('0x6'));router[_0x6b9e('0x7')]('/',auth[_0x6b9e('0x8')](),controller[_0x6b9e('0x9')]);router[_0x6b9e('0x7')](_0x6b9e('0xa'),auth[_0x6b9e('0x8')](),controller['show']);router['get']('/:id/items',auth['isAuthenticated'](),controller[_0x6b9e('0xb')]);router[_0x6b9e('0xc')]('/',auth[_0x6b9e('0x8')](),controller[_0x6b9e('0xd')]);router[_0x6b9e('0xc')](_0x6b9e('0xe'),auth[_0x6b9e('0x8')](),controller['clone']);router[_0x6b9e('0xc')](_0x6b9e('0xf'),auth[_0x6b9e('0x8')](),controller[_0x6b9e('0x10')]);router['put']('/:id',auth[_0x6b9e('0x8')](),controller['update']);router['delete'](_0x6b9e('0xa'),auth['isAuthenticated'](),controller[_0x6b9e('0x11')]);module[_0x6b9e('0x12')]=router;
\ No newline at end of file
+var _0x4149=['post','/:id/clone','clone','addItem','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4149,0x1ce));var _0x9414=function(_0x1d3e5c,_0x14741c){_0x1d3e5c=_0x1d3e5c-0x0;var _0xb4970=_0x4149[_0x1d3e5c];return _0xb4970;};'use strict';var multer=require(_0x9414('0x0'));var util=require(_0x9414('0x1'));var path=require(_0x9414('0x2'));var timeout=require(_0x9414('0x3'));var express=require(_0x9414('0x4'));var router=express[_0x9414('0x5')]();var fs_extra=require(_0x9414('0x6'));var auth=require(_0x9414('0x7'));var interaction=require(_0x9414('0x8'));var config=require(_0x9414('0x9'));var controller=require(_0x9414('0xa'));router[_0x9414('0xb')]('/',auth[_0x9414('0xc')](),controller[_0x9414('0xd')]);router[_0x9414('0xb')](_0x9414('0xe'),auth['isAuthenticated'](),controller[_0x9414('0xf')]);router[_0x9414('0xb')](_0x9414('0x10'),auth[_0x9414('0xc')](),controller[_0x9414('0x11')]);router[_0x9414('0x12')]('/',auth[_0x9414('0xc')](),controller['create']);router['post'](_0x9414('0x13'),auth['isAuthenticated'](),controller[_0x9414('0x14')]);router[_0x9414('0x12')](_0x9414('0x10'),auth[_0x9414('0xc')](),controller[_0x9414('0x15')]);router[_0x9414('0x16')](_0x9414('0xe'),auth[_0x9414('0xc')](),controller['update']);router['delete'](_0x9414('0xe'),auth[_0x9414('0xc')](),controller[_0x9414('0x17')]);module['exports']=router;
\ No newline at end of file
index d771349..00ea5b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','lodash'];(function(_0xf9738,_0x390801){var _0x589190=function(_0xcb5675){while(--_0xcb5675){_0xf9738['push'](_0xf9738['shift']());}};_0x589190(++_0x390801);}(_0x524e,0x15e));var _0xe524=function(_0x326daf,_0x298201){_0x326daf=_0x326daf-0x0;var _0x5c6d2d=_0x524e[_0x326daf];return _0x5c6d2d;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0xe524('0x0'));module[_0xe524('0x1')]={'title':{'type':Sequelize[_0xe524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe524('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xe524('0x3')](_0xe524('0x4')),'get':function(){try{return JSON[_0xe524('0x5')](this[_0xe524('0x6')](_0xe524('0x7')));}catch(_0x110cff){return[];}},'set':function(_0x4f75d6){try{this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')](_0x4f75d6));}catch(_0x533c14){this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe524('0xa')]},'col':{'type':Sequelize[_0xe524('0xa')]},'background':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe524('0x2')]},'titleFontSize':{'type':Sequelize[_0xe524('0xa')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x5fab=['STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','exports'];(function(_0x54fb33,_0x2acf76){var _0x3120da=function(_0x50be07){while(--_0x50be07){_0x54fb33['push'](_0x54fb33['shift']());}};_0x3120da(++_0x2acf76);}(_0x5fab,0x177));var _0xb5fa=function(_0x1ce236,_0xca922e){_0x1ce236=_0x1ce236-0x0;var _0x241819=_0x5fab[_0x1ce236];return _0x241819;};'use strict';var Sequelize=require(_0xb5fa('0x0'));var squel=require(_0xb5fa('0x1'));var _=require('lodash');module[_0xb5fa('0x2')]={'title':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb5fa('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb5fa('0x4')](_0xb5fa('0x5')),'get':function(){try{return JSON[_0xb5fa('0x6')](this[_0xb5fa('0x7')](_0xb5fa('0x8')));}catch(_0x10361d){return[];}},'set':function(_0x44df89){try{this['setDataValue']('attrs',JSON[_0xb5fa('0x9')](_0x44df89));}catch(_0x1aec3e){this[_0xb5fa('0xa')]('attrs',JSON[_0xb5fa('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb5fa('0x3')]},'titleFontSize':{'type':Sequelize[_0xb5fa('0xb')],'defaultValue':0xc}};
\ No newline at end of file
index 6c3be4d..78fca99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63af=['attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','status','json','undefined','limit','count','apply','reject','update','then','destroy','end','sendStatus','stack','name','show','params','keys','DashboardItem','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','options','find','catch','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total'];(function(_0x32f898,_0x541c51){var _0x2af575=function(_0x2f38b5){while(--_0x2f38b5){_0x32f898['push'](_0x32f898['shift']());}};_0x2af575(++_0x541c51);}(_0x63af,0x68));var _0xf63a=function(_0x338887,_0xe6300f){_0x338887=_0x338887-0x0;var _0x3d2721=_0x63af[_0x338887];return _0x3d2721;};'use strict';var emlformat=require(_0xf63a('0x0'));var rimraf=require(_0xf63a('0x1'));var zipdir=require(_0xf63a('0x2'));var jsonpatch=require(_0xf63a('0x3'));var rp=require('request-promise');var moment=require(_0xf63a('0x4'));var BPromise=require(_0xf63a('0x5'));var Mustache=require(_0xf63a('0x6'));var util=require(_0xf63a('0x7'));var path=require(_0xf63a('0x8'));var sox=require(_0xf63a('0x9'));var csv=require('to-csv');var ejs=require(_0xf63a('0xa'));var fs=require('fs');var fs_extra=require(_0xf63a('0xb'));var _=require(_0xf63a('0xc'));var squel=require(_0xf63a('0xd'));var crypto=require('crypto');var jsforce=require(_0xf63a('0xe'));var deskjs=require(_0xf63a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf63a('0x10'));var Papa=require('papaparse');var Redis=require(_0xf63a('0x11'));var authService=require(_0xf63a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf63a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf63a('0x14'))('api');var utils=require(_0xf63a('0x15'));var config=require(_0xf63a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf63a('0x17'))['db'];config['redis']=_[_0xf63a('0x18')](config[_0xf63a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf63a('0x1a'))(new Redis(config['redis']));require(_0xf63a('0x1b'))[_0xf63a('0x1c')](socket);function respondWithStatusCode(_0xf34272,_0x4740d9){_0x4740d9=_0x4740d9||0xcc;return function(_0x2d8492){if(_0x2d8492){return _0xf34272['sendStatus'](_0x4740d9);}return _0xf34272[_0xf63a('0x1d')](_0x4740d9)['end']();};}function respondWithResult(_0x197326,_0x354313){_0x354313=_0x354313||0xc8;return function(_0x31d812){if(_0x31d812){return _0x197326['status'](_0x354313)[_0xf63a('0x1e')](_0x31d812);}};}function respondWithFilteredResult(_0x1256d6,_0x157801){return function(_0x488b43){if(_0x488b43){var _0x12a56d=typeof _0x157801['offset']===_0xf63a('0x1f')&&typeof _0x157801[_0xf63a('0x20')]==='undefined';var _0x69567d=_0x488b43[_0xf63a('0x21')];var _0x3153ad=_0x12a56d?0x0:_0x157801['offset'];var _0x1e5e19=_0x12a56d?_0x488b43['count']:_0x157801['offset']+_0x157801[_0xf63a('0x20')];var _0x28ecc6;if(_0x1e5e19>=_0x69567d){_0x1e5e19=_0x69567d;_0x28ecc6=0xc8;}else{_0x28ecc6=0xce;}_0x1256d6[_0xf63a('0x1d')](_0x28ecc6);return _0x1256d6['set']('Content-Range',_0x3153ad+'-'+_0x1e5e19+'/'+_0x69567d)[_0xf63a('0x1e')](_0x488b43);}return null;};}function patchUpdates(_0x1f8d6b){return function(_0x167f38){try{jsonpatch[_0xf63a('0x22')](_0x167f38,_0x1f8d6b,!![]);}catch(_0x107a5f){return BPromise[_0xf63a('0x23')](_0x107a5f);}return _0x167f38['save']();};}function saveUpdates(_0x33284e,_0x7e5222){return function(_0x18e153){if(_0x18e153){return _0x18e153[_0xf63a('0x24')](_0x33284e)[_0xf63a('0x25')](function(_0x4dea4c){return _0x4dea4c;});}return null;};}function removeEntity(_0x590017,_0x31bcad){return function(_0x397c8f){if(_0x397c8f){return _0x397c8f[_0xf63a('0x26')]()['then'](function(){_0x590017[_0xf63a('0x1d')](0xcc)[_0xf63a('0x27')]();});}};}function handleEntityNotFound(_0xfeddc7,_0x3348f4){return function(_0x533532){if(!_0x533532){_0xfeddc7[_0xf63a('0x28')](0x194);}return _0x533532;};}function handleError(_0x3c718f,_0x32c997){_0x32c997=_0x32c997||0x1f4;return function(_0x394964){logger['error'](_0x394964[_0xf63a('0x29')]);if(_0x394964[_0xf63a('0x2a')]){delete _0x394964[_0xf63a('0x2a')];}_0x3c718f[_0xf63a('0x1d')](_0x32c997)['send'](_0x394964);};}exports[_0xf63a('0x2b')]=function(_0x4d002b,_0x1ffb0d){var _0x278c65={'raw':![],'where':{'id':_0x4d002b[_0xf63a('0x2c')]['id']}},_0x1c10c3={};_0x1c10c3['model']=_[_0xf63a('0x2d')](db[_0xf63a('0x2e')][_0xf63a('0x2f')]);_0x1c10c3[_0xf63a('0x30')]=_[_0xf63a('0x2d')](_0x4d002b[_0xf63a('0x30')]);_0x1c10c3[_0xf63a('0x31')]=_['intersection'](_0x1c10c3[_0xf63a('0x32')],_0x1c10c3[_0xf63a('0x30')]);_0x278c65[_0xf63a('0x33')]=_[_0xf63a('0x34')](_0x1c10c3['model'],qs[_0xf63a('0x35')](_0x4d002b[_0xf63a('0x30')]['fields']));_0x278c65[_0xf63a('0x33')]=_0x278c65[_0xf63a('0x33')][_0xf63a('0x36')]?_0x278c65[_0xf63a('0x33')]:_0x1c10c3['model'];if(_0x4d002b['query'][_0xf63a('0x37')]){_0x278c65['include']=[{'all':!![]}];}_0x278c65=_['merge']({},_0x278c65,_0x4d002b[_0xf63a('0x38')]);return db[_0xf63a('0x2e')][_0xf63a('0x39')](_0x278c65)[_0xf63a('0x25')](handleEntityNotFound(_0x1ffb0d,null))[_0xf63a('0x25')](respondWithResult(_0x1ffb0d,null))['catch'](handleError(_0x1ffb0d,null));};exports['destroy']=function(_0x6da8e0,_0x355f79){return db['DashboardItem'][_0xf63a('0x39')]({'where':{'id':_0x6da8e0[_0xf63a('0x2c')]['id']}})[_0xf63a('0x25')](handleEntityNotFound(_0x355f79,null))[_0xf63a('0x25')](removeEntity(_0x355f79,null))[_0xf63a('0x3a')](handleError(_0x355f79,null));};function widgetAttributes(_0x222526){try{switch(_0x222526['type']){case _0xf63a('0x3b'):return[{'name':_0xf63a('0x3c'),'value':_0x222526[_0xf63a('0x3c')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526[_0xf63a('0x3d')][0x0]?_0x222526[_0xf63a('0x3d')][0x0]['value']:undefined)||_0xf63a('0x3e')}];case _0xf63a('0x3f'):return[{'name':_0xf63a('0x40'),'value':_0x222526[_0xf63a('0x40')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526[_0xf63a('0x3d')][0x0]?_0x222526[_0xf63a('0x3d')][0x0][_0xf63a('0x41')]:undefined)||''}];case'clock':return[{'name':_0xf63a('0x42'),'value':_0x222526[_0xf63a('0x42')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526[_0xf63a('0x3d')][0x0]?_0x222526[_0xf63a('0x3d')][0x0][_0xf63a('0x41')]:undefined)||_0xf63a('0x43')},{'name':'attrTimezone','value':_0x222526[_0xf63a('0x44')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526[_0xf63a('0x3d')][0x1]?_0x222526[_0xf63a('0x3d')][0x1][_0xf63a('0x41')]:undefined)||_0xf63a('0x45')},{'name':_0xf63a('0x46'),'value':_0x222526[_0xf63a('0x46')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526[_0xf63a('0x3d')][0x2]?_0x222526[_0xf63a('0x3d')][0x2][_0xf63a('0x41')]:undefined)||0xc}];case _0xf63a('0x47'):return[{'name':_0xf63a('0x48'),'value':_0x222526[_0xf63a('0x48')]||(_0x222526['attrs']&&_0x222526[_0xf63a('0x3d')][0x0]?_0x222526[_0xf63a('0x3d')][0x0][_0xf63a('0x41')]:undefined)||_0xf63a('0x49')},{'name':_0xf63a('0x4a'),'value':_0x222526[_0xf63a('0x4a')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526[_0xf63a('0x3d')][0x1]?_0x222526[_0xf63a('0x3d')][0x1]['value']:undefined)||[]},{'name':_0xf63a('0x46'),'value':_0x222526[_0xf63a('0x46')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526['attrs'][0x2]?_0x222526[_0xf63a('0x3d')][0x2][_0xf63a('0x41')]:undefined)||0x14}];case _0xf63a('0x4b'):case'pie-chart':return[{'name':'attrSerie1','value':_0x222526[_0xf63a('0x4c')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526[_0xf63a('0x3d')][0x0]?_0x222526[_0xf63a('0x3d')][0x0][_0xf63a('0x41')]:undefined)||_0xf63a('0x49')},{'name':_0xf63a('0x4d'),'value':_0x222526[_0xf63a('0x4d')]||(_0x222526['attrs']&&_0x222526[_0xf63a('0x3d')][0x1]?_0x222526[_0xf63a('0x3d')][0x1][_0xf63a('0x41')]:undefined)||null},{'name':_0xf63a('0x4e'),'value':_0x222526[_0xf63a('0x4e')]||(_0x222526['attrs']&&_0x222526['attrs'][0x2]?_0x222526['attrs'][0x2][_0xf63a('0x41')]:undefined)||null},{'name':_0xf63a('0x4a'),'value':_0x222526[_0xf63a('0x4a')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526['attrs'][0x3]?_0x222526[_0xf63a('0x3d')][0x3][_0xf63a('0x41')]:undefined)||[]}];case _0xf63a('0x4f'):return[{'name':_0xf63a('0x50'),'type':_0x222526[_0xf63a('0x51')]||(_0x222526[_0xf63a('0x3d')]&&_0x222526['attrs'][0x0]?_0x222526['attrs'][0x0][_0xf63a('0x52')]:undefined)||null,'value':_0x222526[_0xf63a('0x50')]||(_0x222526['attrs']&&_0x222526[_0xf63a('0x3d')][0x0]?_0x222526[_0xf63a('0x3d')][0x0][_0xf63a('0x41')]:undefined)||null},{'name':_0xf63a('0x53'),'value':_0x222526[_0xf63a('0x53')]||(_0x222526['attrs']&&_0x222526['attrs'][0x1]?_0x222526[_0xf63a('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5e0086){logger[_0xf63a('0x54')](_0xf63a('0x55'),JSON[_0xf63a('0x56')](_0x5e0086));return[];}}exports[_0xf63a('0x57')]=function(_0x216fee,_0x5acce2){if(_0x216fee[_0xf63a('0x58')]){_0x216fee['body'][_0xf63a('0x3d')]=widgetAttributes(_0x216fee[_0xf63a('0x58')]);}return db[_0xf63a('0x2e')][_0xf63a('0x57')](_0x216fee[_0xf63a('0x58')],{})[_0xf63a('0x25')](respondWithResult(_0x5acce2,0xc9))['catch'](handleError(_0x5acce2,null));};exports[_0xf63a('0x24')]=function(_0x417aa3,_0x514f6f){if(_0x417aa3['body']['id']){delete _0x417aa3['body']['id'];}_0x417aa3['body'][_0xf63a('0x3d')]=widgetAttributes(_0x417aa3['body']);return db[_0xf63a('0x2e')]['find']({'where':{'id':_0x417aa3[_0xf63a('0x2c')]['id']}})[_0xf63a('0x25')](handleEntityNotFound(_0x514f6f,null))[_0xf63a('0x25')](saveUpdates(_0x417aa3[_0xf63a('0x58')],null))[_0xf63a('0x25')](respondWithResult(_0x514f6f,null))[_0xf63a('0x3a')](handleError(_0x514f6f,null));};
\ No newline at end of file
+var _0xb1bd=['eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','params','model','keys','DashboardItem','query','intersection','attributes','fields','length','includeAll','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','update'];(function(_0x4178fd,_0x4d78d5){var _0x30afa2=function(_0x5262ed){while(--_0x5262ed){_0x4178fd['push'](_0x4178fd['shift']());}};_0x30afa2(++_0x4d78d5);}(_0xb1bd,0x105));var _0xdb1b=function(_0x372074,_0x47e7da){_0x372074=_0x372074-0x0;var _0x5046e9=_0xb1bd[_0x372074];return _0x5046e9;};'use strict';var emlformat=require(_0xdb1b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdb1b('0x1'));var rp=require('request-promise');var moment=require(_0xdb1b('0x2'));var BPromise=require(_0xdb1b('0x3'));var Mustache=require(_0xdb1b('0x4'));var util=require(_0xdb1b('0x5'));var path=require(_0xdb1b('0x6'));var sox=require(_0xdb1b('0x7'));var csv=require(_0xdb1b('0x8'));var ejs=require(_0xdb1b('0x9'));var fs=require('fs');var fs_extra=require(_0xdb1b('0xa'));var _=require('lodash');var squel=require(_0xdb1b('0xb'));var crypto=require(_0xdb1b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb1b('0xd'));var toCsv=require(_0xdb1b('0x8'));var querystring=require('querystring');var Papa=require(_0xdb1b('0xe'));var Redis=require(_0xdb1b('0xf'));var authService=require(_0xdb1b('0x10'));var qs=require(_0xdb1b('0x11'));var as=require(_0xdb1b('0x12'));var hardwareService=require(_0xdb1b('0x13'));var logger=require(_0xdb1b('0x14'))(_0xdb1b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb1b('0x16'))['db'];config[_0xdb1b('0x17')]=_[_0xdb1b('0x18')](config[_0xdb1b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb1b('0x19'))(new Redis(config[_0xdb1b('0x17')]));require(_0xdb1b('0x1a'))[_0xdb1b('0x1b')](socket);function respondWithStatusCode(_0x4e0c33,_0x382cd9){_0x382cd9=_0x382cd9||0xcc;return function(_0x3f8713){if(_0x3f8713){return _0x4e0c33[_0xdb1b('0x1c')](_0x382cd9);}return _0x4e0c33[_0xdb1b('0x1d')](_0x382cd9)[_0xdb1b('0x1e')]();};}function respondWithResult(_0x24d04f,_0x35a71b){_0x35a71b=_0x35a71b||0xc8;return function(_0x4347ee){if(_0x4347ee){return _0x24d04f[_0xdb1b('0x1d')](_0x35a71b)['json'](_0x4347ee);}};}function respondWithFilteredResult(_0x36b478,_0xf5d2c6){return function(_0x5b1d30){if(_0x5b1d30){var _0x599aa9=typeof _0xf5d2c6[_0xdb1b('0x1f')]===_0xdb1b('0x20')&&typeof _0xf5d2c6[_0xdb1b('0x21')]===_0xdb1b('0x20');var _0x18507f=_0x5b1d30[_0xdb1b('0x22')];var _0x528e42=_0x599aa9?0x0:_0xf5d2c6['offset'];var _0x35043e=_0x599aa9?_0x5b1d30[_0xdb1b('0x22')]:_0xf5d2c6['offset']+_0xf5d2c6[_0xdb1b('0x21')];var _0x2bb386;if(_0x35043e>=_0x18507f){_0x35043e=_0x18507f;_0x2bb386=0xc8;}else{_0x2bb386=0xce;}_0x36b478[_0xdb1b('0x1d')](_0x2bb386);return _0x36b478[_0xdb1b('0x23')](_0xdb1b('0x24'),_0x528e42+'-'+_0x35043e+'/'+_0x18507f)[_0xdb1b('0x25')](_0x5b1d30);}return null;};}function patchUpdates(_0x45e000){return function(_0x46b711){try{jsonpatch[_0xdb1b('0x26')](_0x46b711,_0x45e000,!![]);}catch(_0x3f539f){return BPromise[_0xdb1b('0x27')](_0x3f539f);}return _0x46b711[_0xdb1b('0x28')]();};}function saveUpdates(_0x28d22f,_0x184e3e){return function(_0x2ae2a0){if(_0x2ae2a0){return _0x2ae2a0['update'](_0x28d22f)[_0xdb1b('0x29')](function(_0x14650b){return _0x14650b;});}return null;};}function removeEntity(_0x4cfd1f,_0x21fecf){return function(_0x19d236){if(_0x19d236){return _0x19d236[_0xdb1b('0x2a')]()['then'](function(){_0x4cfd1f[_0xdb1b('0x1d')](0xcc)[_0xdb1b('0x1e')]();});}};}function handleEntityNotFound(_0x14f6ac,_0x37892c){return function(_0x442513){if(!_0x442513){_0x14f6ac[_0xdb1b('0x1c')](0x194);}return _0x442513;};}function handleError(_0x55ef00,_0x583a49){_0x583a49=_0x583a49||0x1f4;return function(_0x59551e){logger[_0xdb1b('0x2b')](_0x59551e[_0xdb1b('0x2c')]);if(_0x59551e['name']){delete _0x59551e[_0xdb1b('0x2d')];}_0x55ef00[_0xdb1b('0x1d')](_0x583a49)[_0xdb1b('0x2e')](_0x59551e);};}exports['show']=function(_0x1ed0ec,_0x1b09ed){var _0x133fe9={'raw':![],'where':{'id':_0x1ed0ec[_0xdb1b('0x2f')]['id']}},_0x1cf1f6={};_0x1cf1f6[_0xdb1b('0x30')]=_[_0xdb1b('0x31')](db[_0xdb1b('0x32')]['rawAttributes']);_0x1cf1f6[_0xdb1b('0x33')]=_[_0xdb1b('0x31')](_0x1ed0ec['query']);_0x1cf1f6['filters']=_[_0xdb1b('0x34')](_0x1cf1f6[_0xdb1b('0x30')],_0x1cf1f6[_0xdb1b('0x33')]);_0x133fe9[_0xdb1b('0x35')]=_[_0xdb1b('0x34')](_0x1cf1f6['model'],qs[_0xdb1b('0x36')](_0x1ed0ec[_0xdb1b('0x33')][_0xdb1b('0x36')]));_0x133fe9[_0xdb1b('0x35')]=_0x133fe9[_0xdb1b('0x35')][_0xdb1b('0x37')]?_0x133fe9[_0xdb1b('0x35')]:_0x1cf1f6[_0xdb1b('0x30')];if(_0x1ed0ec[_0xdb1b('0x33')][_0xdb1b('0x38')]){_0x133fe9['include']=[{'all':!![]}];}_0x133fe9=_['merge']({},_0x133fe9,_0x1ed0ec['options']);return db['DashboardItem']['find'](_0x133fe9)['then'](handleEntityNotFound(_0x1b09ed,null))[_0xdb1b('0x29')](respondWithResult(_0x1b09ed,null))['catch'](handleError(_0x1b09ed,null));};exports[_0xdb1b('0x2a')]=function(_0x38aaa9,_0x126e9c){return db[_0xdb1b('0x32')][_0xdb1b('0x39')]({'where':{'id':_0x38aaa9[_0xdb1b('0x2f')]['id']}})[_0xdb1b('0x29')](handleEntityNotFound(_0x126e9c,null))[_0xdb1b('0x29')](removeEntity(_0x126e9c,null))[_0xdb1b('0x3a')](handleError(_0x126e9c,null));};function widgetAttributes(_0x2caa70){try{switch(_0x2caa70[_0xdb1b('0x3b')]){case _0xdb1b('0x3c'):return[{'name':_0xdb1b('0x3d'),'value':_0x2caa70[_0xdb1b('0x3d')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x0]?_0x2caa70[_0xdb1b('0x3e')][0x0]['value']:undefined)||_0xdb1b('0x3f')}];case _0xdb1b('0x40'):return[{'name':_0xdb1b('0x41'),'value':_0x2caa70[_0xdb1b('0x41')]||(_0x2caa70['attrs']&&_0x2caa70[_0xdb1b('0x3e')][0x0]?_0x2caa70[_0xdb1b('0x3e')][0x0]['value']:undefined)||''}];case _0xdb1b('0x42'):return[{'name':_0xdb1b('0x43'),'value':_0x2caa70['attrHourFormat']||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x0]?_0x2caa70[_0xdb1b('0x3e')][0x0][_0xdb1b('0x44')]:undefined)||_0xdb1b('0x45')},{'name':_0xdb1b('0x46'),'value':_0x2caa70[_0xdb1b('0x46')]||(_0x2caa70['attrs']&&_0x2caa70['attrs'][0x1]?_0x2caa70[_0xdb1b('0x3e')][0x1]['value']:undefined)||'0.00'},{'name':_0xdb1b('0x47'),'value':_0x2caa70[_0xdb1b('0x47')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x2]?_0x2caa70[_0xdb1b('0x3e')][0x2]['value']:undefined)||0xc}];case _0xdb1b('0x48'):return[{'name':_0xdb1b('0x49'),'value':_0x2caa70[_0xdb1b('0x49')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x0]?_0x2caa70[_0xdb1b('0x3e')][0x0][_0xdb1b('0x44')]:undefined)||_0xdb1b('0x4a')},{'name':_0xdb1b('0x4b'),'value':_0x2caa70[_0xdb1b('0x4b')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x1]?_0x2caa70[_0xdb1b('0x3e')][0x1][_0xdb1b('0x44')]:undefined)||[]},{'name':'attrFontSize','value':_0x2caa70[_0xdb1b('0x47')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70['attrs'][0x2]?_0x2caa70[_0xdb1b('0x3e')][0x2][_0xdb1b('0x44')]:undefined)||0x14}];case _0xdb1b('0x4c'):case'pie-chart':return[{'name':_0xdb1b('0x4d'),'value':_0x2caa70[_0xdb1b('0x4d')]||(_0x2caa70['attrs']&&_0x2caa70['attrs'][0x0]?_0x2caa70[_0xdb1b('0x3e')][0x0]['value']:undefined)||_0xdb1b('0x4a')},{'name':_0xdb1b('0x4e'),'value':_0x2caa70['attrSerie2']||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x1]?_0x2caa70[_0xdb1b('0x3e')][0x1][_0xdb1b('0x44')]:undefined)||null},{'name':_0xdb1b('0x4f'),'value':_0x2caa70[_0xdb1b('0x4f')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x2]?_0x2caa70['attrs'][0x2]['value']:undefined)||null},{'name':_0xdb1b('0x4b'),'value':_0x2caa70['attrVoiceQueues']||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x3]?_0x2caa70[_0xdb1b('0x3e')][0x3][_0xdb1b('0x44')]:undefined)||[]}];case'web-report':return[{'name':_0xdb1b('0x50'),'type':_0x2caa70[_0xdb1b('0x51')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x0]?_0x2caa70['attrs'][0x0]['type']:undefined)||null,'value':_0x2caa70[_0xdb1b('0x50')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70[_0xdb1b('0x3e')][0x0]?_0x2caa70[_0xdb1b('0x3e')][0x0][_0xdb1b('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x2caa70[_0xdb1b('0x52')]||(_0x2caa70[_0xdb1b('0x3e')]&&_0x2caa70['attrs'][0x1]?_0x2caa70['attrs'][0x1][_0xdb1b('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x4fa511){logger['error'](_0xdb1b('0x53'),JSON[_0xdb1b('0x54')](_0x4fa511));return[];}}exports['create']=function(_0x4cba6d,_0x3eb946){if(_0x4cba6d[_0xdb1b('0x55')]){_0x4cba6d['body']['attrs']=widgetAttributes(_0x4cba6d[_0xdb1b('0x55')]);}return db[_0xdb1b('0x32')]['create'](_0x4cba6d[_0xdb1b('0x55')],{})[_0xdb1b('0x29')](respondWithResult(_0x3eb946,0xc9))[_0xdb1b('0x3a')](handleError(_0x3eb946,null));};exports[_0xdb1b('0x56')]=function(_0x2d17e0,_0x5a2775){if(_0x2d17e0['body']['id']){delete _0x2d17e0[_0xdb1b('0x55')]['id'];}_0x2d17e0[_0xdb1b('0x55')][_0xdb1b('0x3e')]=widgetAttributes(_0x2d17e0['body']);return db[_0xdb1b('0x32')][_0xdb1b('0x39')]({'where':{'id':_0x2d17e0['params']['id']}})[_0xdb1b('0x29')](handleEntityNotFound(_0x5a2775,null))['then'](saveUpdates(_0x2d17e0[_0xdb1b('0x55')],null))[_0xdb1b('0x29')](respondWithResult(_0x5a2775,null))['catch'](handleError(_0x5a2775,null));};
\ No newline at end of file
index 8157c88..104f40f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26e4=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','update','emit'];(function(_0xcbb785,_0xebc206){var _0x5969ca=function(_0x34ba69){while(--_0x34ba69){_0xcbb785['push'](_0xcbb785['shift']());}};_0x5969ca(++_0xebc206);}(_0x26e4,0x1be));var _0x426e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x26e4[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x426e('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x426e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x426e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x479d16){return function(_0x354d08,_0x224a18,_0x494aa6){DashboardItemEvents[_0x426e('0x3')](_0x479d16+':'+_0x354d08['id'],_0x354d08);DashboardItemEvents[_0x426e('0x3')](_0x479d16,_0x354d08);_0x494aa6(null);};}for(var e in events){if(events[_0x426e('0x4')](e)){var event=events[e];DashboardItem[_0x426e('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x4ab2=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem'];(function(_0x4b1790,_0x35bc91){var _0x3d7a6a=function(_0x58e454){while(--_0x58e454){_0x4b1790['push'](_0x4b1790['shift']());}};_0x3d7a6a(++_0x35bc91);}(_0x4ab2,0xbb));var _0x24ab=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x4ab2[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x24ab('0x0'))['db'][_0x24ab('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x24ab('0x2')](0x0);var events={'afterCreate':_0x24ab('0x3'),'afterUpdate':'update','afterDestroy':_0x24ab('0x4')};function emitEvent(_0xa6ecea){return function(_0x4062d2,_0x18b8bb,_0x42984a){DashboardItemEvents['emit'](_0xa6ecea+':'+_0x4062d2['id'],_0x4062d2);DashboardItemEvents[_0x24ab('0x5')](_0xa6ecea,_0x4062d2);_0x42984a(null);};}for(var e in events){if(events[_0x24ab('0x6')](e)){var event=events[e];DashboardItem[_0x24ab('0x7')](e,emitEvent(event));}}module[_0x24ab('0x8')]=DashboardItemEvents;
\ No newline at end of file
index affefe2..23cf8a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96cf=['util','api','bluebird','path','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x96cf,0xdb));var _0xf96c=function(_0x4fe858,_0x3c375a){_0x4fe858=_0x4fe858-0x0;var _0x3b5fb0=_0x96cf[_0x4fe858];return _0x3b5fb0;};'use strict';var _=require(_0xf96c('0x0'));var util=require(_0xf96c('0x1'));var logger=require('../../config/logger')(_0xf96c('0x2'));var moment=require('moment');var BPromise=require(_0xf96c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf96c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf96c('0x5'));module[_0xf96c('0x6')]=function(_0x46dab3,_0x45eed7){return _0x46dab3[_0xf96c('0x7')](_0xf96c('0x8'),attributes,{'tableName':_0xf96c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b68=['moment','request-promise','rimraf','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x319f0d,_0xfb6f10){var _0x7a35cd=function(_0x582917){while(--_0x582917){_0x319f0d['push'](_0x319f0d['shift']());}};_0x7a35cd(++_0xfb6f10);}(_0x6b68,0x1e0));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x86b6('0x0'));var util=require(_0x86b6('0x1'));var logger=require(_0x86b6('0x2'))(_0x86b6('0x3'));var moment=require(_0x86b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x86b6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86b6('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x86b6('0x7')]=function(_0x576211,_0x35e12c){return _0x576211[_0x86b6('0x8')](_0x86b6('0x9'),attributes,{'tableName':_0x86b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79e9fb5..bef0be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fd9=['http','defaults','redis','./dashboardItem.socket','request','then','info','request\x20sent','debug','stringify','code','error','message','DashboardItem,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x7c0288,_0x54bab3){var _0x5548c2=function(_0x47e02d){while(--_0x47e02d){_0x7c0288['push'](_0x7c0288['shift']());}};_0x5548c2(++_0x54bab3);}(_0x8fd9,0x70));var _0x98fd=function(_0x46f7f0,_0x4ef418){_0x46f7f0=_0x46f7f0-0x0;var _0x783786=_0x8fd9[_0x46f7f0];return _0x783786;};'use strict';var _=require(_0x98fd('0x0'));var util=require(_0x98fd('0x1'));var moment=require(_0x98fd('0x2'));var BPromise=require(_0x98fd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98fd('0x4'))['db'];var utils=require(_0x98fd('0x5'));var logger=require(_0x98fd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x98fd('0x7'));var client=jayson['client'][_0x98fd('0x8')]({'port':0x232a});config['redis']=_[_0x98fd('0x9')](config[_0x98fd('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98fd('0xa')]));require(_0x98fd('0xb'))['register'](socket);function respondWithRpcPromise(_0xd442e4,_0x531723,_0x35ddb5){return new BPromise(function(_0x3b548d,_0x551cf5){return client[_0x98fd('0xc')](_0xd442e4,_0x35ddb5)[_0x98fd('0xd')](function(_0x3dbc84){logger[_0x98fd('0xe')]('DashboardItem,\x20%s,\x20%s',_0x531723,_0x98fd('0xf'));logger[_0x98fd('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x531723,_0x98fd('0xf'),JSON[_0x98fd('0x11')](_0x3dbc84));if(_0x3dbc84['error']){if(_0x3dbc84['error'][_0x98fd('0x12')]===0x1f4){logger[_0x98fd('0x13')]('DashboardItem,\x20%s,\x20%s',_0x531723,_0x3dbc84['error']['message']);return _0x551cf5(_0x3dbc84[_0x98fd('0x13')][_0x98fd('0x14')]);}logger[_0x98fd('0x13')](_0x98fd('0x15'),_0x531723,_0x3dbc84['error']['message']);return _0x3b548d(_0x3dbc84[_0x98fd('0x13')][_0x98fd('0x14')]);}else{logger[_0x98fd('0xe')](_0x98fd('0x15'),_0x531723,_0x98fd('0xf'));_0x3b548d(_0x3dbc84[_0x98fd('0x16')][_0x98fd('0x14')]);}})[_0x98fd('0x17')](function(_0xd263e2){logger[_0x98fd('0x13')](_0x98fd('0x15'),_0x531723,_0xd263e2);_0x551cf5(_0xd263e2);});});}
\ No newline at end of file
+var _0x6759=['client','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x2f2a59,_0x346580){var _0x4746cf=function(_0x19932c){while(--_0x19932c){_0x2f2a59['push'](_0x2f2a59['shift']());}};_0x4746cf(++_0x346580);}(_0x6759,0x18c));var _0x9675=function(_0x4c2b96,_0x17ab0d){_0x4c2b96=_0x4c2b96-0x0;var _0x2a62bf=_0x6759[_0x4c2b96];return _0x2a62bf;};'use strict';var _=require(_0x9675('0x0'));var util=require(_0x9675('0x1'));var moment=require(_0x9675('0x2'));var BPromise=require(_0x9675('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9675('0x4'));var db=require(_0x9675('0x5'))['db'];var utils=require(_0x9675('0x6'));var logger=require('../../config/logger')(_0x9675('0x7'));var config=require('../../config/environment');var jayson=require(_0x9675('0x8'));var client=jayson[_0x9675('0x9')]['http']({'port':0x232a});config[_0x9675('0xa')]=_[_0x9675('0xb')](config[_0x9675('0xa')],{'host':_0x9675('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9675('0xa')]));require(_0x9675('0xd'))[_0x9675('0xe')](socket);function respondWithRpcPromise(_0x5becf4,_0x5adb65,_0x1d4a78){return new BPromise(function(_0x486000,_0x4309b1){return client[_0x9675('0xf')](_0x5becf4,_0x1d4a78)[_0x9675('0x10')](function(_0x3f7698){logger[_0x9675('0x11')]('DashboardItem,\x20%s,\x20%s',_0x5adb65,'request\x20sent');logger['debug'](_0x9675('0x12'),_0x5adb65,_0x9675('0x13'),JSON[_0x9675('0x14')](_0x3f7698));if(_0x3f7698[_0x9675('0x15')]){if(_0x3f7698[_0x9675('0x15')][_0x9675('0x16')]===0x1f4){logger['error'](_0x9675('0x17'),_0x5adb65,_0x3f7698[_0x9675('0x15')][_0x9675('0x18')]);return _0x4309b1(_0x3f7698['error'][_0x9675('0x18')]);}logger[_0x9675('0x15')]('DashboardItem,\x20%s,\x20%s',_0x5adb65,_0x3f7698[_0x9675('0x15')][_0x9675('0x18')]);return _0x486000(_0x3f7698[_0x9675('0x15')][_0x9675('0x18')]);}else{logger[_0x9675('0x11')](_0x9675('0x17'),_0x5adb65,_0x9675('0x13'));_0x486000(_0x3f7698[_0x9675('0x19')][_0x9675('0x18')]);}})[_0x9675('0x1a')](function(_0x259b22){logger[_0x9675('0x15')](_0x9675('0x17'),_0x5adb65,_0x259b22);_0x4309b1(_0x259b22);});});}
\ No newline at end of file
index 20d0807..7ac6fb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5202=['register','dashboardItem:','./dashboardItem.events','save','update','removeListener'];(function(_0x48b819,_0x5159df){var _0x16b470=function(_0x46083e){while(--_0x46083e){_0x48b819['push'](_0x48b819['shift']());}};_0x16b470(++_0x5159df);}(_0x5202,0x170));var _0x2520=function(_0x5146bd,_0x38f351){_0x5146bd=_0x5146bd-0x0;var _0x27e4bf=_0x5202[_0x5146bd];return _0x27e4bf;};'use strict';var DashboardItemEvents=require(_0x2520('0x0'));var events=[_0x2520('0x1'),'remove',_0x2520('0x2')];function createListener(_0x55e929,_0x527a2f){return function(_0x4a4fc0){_0x527a2f['emit'](_0x55e929,_0x4a4fc0);};}function removeListener(_0x2a99bf,_0x2b9e8b){return function(){DashboardItemEvents[_0x2520('0x3')](_0x2a99bf,_0x2b9e8b);};}exports[_0x2520('0x4')]=function(_0x34a978){for(var _0xfb99e=0x0,_0x5df39d=events['length'];_0xfb99e<_0x5df39d;_0xfb99e++){var _0x1faf84=events[_0xfb99e];var _0x283ec6=createListener(_0x2520('0x5')+_0x1faf84,_0x34a978);DashboardItemEvents['on'](_0x1faf84,_0x283ec6);}};
\ No newline at end of file
+var _0x9286=['register','length','save','remove','update','removeListener'];(function(_0x419550,_0x15cdf1){var _0x55f9ef=function(_0x44f707){while(--_0x44f707){_0x419550['push'](_0x419550['shift']());}};_0x55f9ef(++_0x15cdf1);}(_0x9286,0x1be));var _0x6928=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x9286[_0x242a4f];return _0x122117;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x6928('0x0'),_0x6928('0x1'),_0x6928('0x2')];function createListener(_0x3d8ca0,_0x3e3236){return function(_0x559205){_0x3e3236['emit'](_0x3d8ca0,_0x559205);};}function removeListener(_0x14cfd9,_0x56dbcc){return function(){DashboardItemEvents[_0x6928('0x3')](_0x14cfd9,_0x56dbcc);};}exports[_0x6928('0x4')]=function(_0x172fb2){for(var _0x676ed=0x0,_0x54bb94=events[_0x6928('0x5')];_0x676ed<_0x54bb94;_0x676ed++){var _0x13801c=events[_0x676ed];var _0x5d105d=createListener('dashboardItem:'+_0x13801c,_0x172fb2);DashboardItemEvents['on'](_0x13801c,_0x5d105d);}};
\ No newline at end of file
index bcc682e..c48766c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481d=['create','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x4c5a24,_0x5ef60c){var _0x4b067e=function(_0x33c0da){while(--_0x33c0da){_0x4c5a24['push'](_0x4c5a24['shift']());}};_0x4b067e(++_0x5ef60c);}(_0x481d,0xb7));var _0xd481=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x481d[_0x482214];return _0x38d0cb;};'use strict';var multer=require(_0xd481('0x0'));var util=require(_0xd481('0x1'));var path=require(_0xd481('0x2'));var timeout=require('connect-timeout');var express=require(_0xd481('0x3'));var router=express[_0xd481('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd481('0x5'));var interaction=require(_0xd481('0x6'));var config=require(_0xd481('0x7'));var controller=require('./dashboardItem.controller');router[_0xd481('0x8')](_0xd481('0x9'),auth[_0xd481('0xa')](),controller[_0xd481('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd481('0xc')]);router['put'](_0xd481('0x9'),auth[_0xd481('0xa')](),controller[_0xd481('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd481('0xe')]=router;
\ No newline at end of file
+var _0xd318=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','create','update','exports','util','path'];(function(_0x4266d0,_0x21770a){var _0x2ad76c=function(_0x534371){while(--_0x534371){_0x4266d0['push'](_0x4266d0['shift']());}};_0x2ad76c(++_0x21770a);}(_0xd318,0x13e));var _0x8d31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd318[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x8d31('0x0'));var path=require(_0x8d31('0x1'));var timeout=require(_0x8d31('0x2'));var express=require(_0x8d31('0x3'));var router=express[_0x8d31('0x4')]();var fs_extra=require(_0x8d31('0x5'));var auth=require(_0x8d31('0x6'));var interaction=require(_0x8d31('0x7'));var config=require(_0x8d31('0x8'));var controller=require(_0x8d31('0x9'));router['get'](_0x8d31('0xa'),auth[_0x8d31('0xb')](),controller['show']);router[_0x8d31('0xc')]('/',auth[_0x8d31('0xb')](),controller[_0x8d31('0xd')]);router['put'](_0x8d31('0xa'),auth[_0x8d31('0xb')](),controller[_0x8d31('0xe')]);router['delete'](_0x8d31('0xa'),auth[_0x8d31('0xb')](),controller['destroy']);module[_0x8d31('0xf')]=router;
\ No newline at end of file
index 13405fb..dde1bb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7100=['sequelize','STRING','ENUM','second','third','first'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7100,0x96));var _0x0710=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x7100[_0x75f869];return _0x10af8b;};'use strict';var Sequelize=require(_0x0710('0x0'));module['exports']={'name':{'type':Sequelize[_0x0710('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x0710('0x2')]('first',_0x0710('0x3'),_0x0710('0x4')),'allowNull':![],'defaultValue':_0x0710('0x5')},'description':{'type':Sequelize[_0x0710('0x1')]}};
\ No newline at end of file
+var _0x897e=['third','exports','STRING','first','second'];(function(_0x430e38,_0x3ad193){var _0x5890d6=function(_0x11733e){while(--_0x11733e){_0x430e38['push'](_0x430e38['shift']());}};_0x5890d6(++_0x3ad193);}(_0x897e,0x1c3));var _0xe897=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x897e[_0x24061a];return _0x82054e;};'use strict';var Sequelize=require('sequelize');module[_0xe897('0x0')]={'name':{'type':Sequelize[_0xe897('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xe897('0x2'),_0xe897('0x3'),_0xe897('0x4')),'allowNull':![],'defaultValue':_0xe897('0x2')},'description':{'type':Sequelize[_0xe897('0x1')]}};
\ No newline at end of file
index 986fafa..e152f97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc911=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','key','query','keys','filters','attributes','model','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash'];(function(_0x14a34f,_0x250eec){var _0x32676c=function(_0x414e9e){while(--_0x414e9e){_0x14a34f['push'](_0x14a34f['shift']());}};_0x32676c(++_0x250eec);}(_0xc911,0x9a));var _0x1c91=function(_0x4e8124,_0x2c5096){_0x4e8124=_0x4e8124-0x0;var _0x1c6028=_0xc911[_0x4e8124];return _0x1c6028;};'use strict';var emlformat=require(_0x1c91('0x0'));var rimraf=require(_0x1c91('0x1'));var zipdir=require(_0x1c91('0x2'));var jsonpatch=require(_0x1c91('0x3'));var rp=require(_0x1c91('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c91('0x5'));var util=require(_0x1c91('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1c91('0x7'));var ejs=require(_0x1c91('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c91('0x9'));var squel=require(_0x1c91('0xa'));var crypto=require(_0x1c91('0xb'));var jsforce=require(_0x1c91('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c91('0x7'));var querystring=require(_0x1c91('0xd'));var Papa=require(_0x1c91('0xe'));var Redis=require(_0x1c91('0xf'));var authService=require(_0x1c91('0x10'));var qs=require(_0x1c91('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c91('0x12'));var logger=require(_0x1c91('0x13'))(_0x1c91('0x14'));var utils=require(_0x1c91('0x15'));var config=require(_0x1c91('0x16'));var licenseUtil=require(_0x1c91('0x17'));var db=require(_0x1c91('0x18'))['db'];function respondWithStatusCode(_0x30921c,_0x5b412c){_0x5b412c=_0x5b412c||0xcc;return function(_0x187f44){if(_0x187f44){return _0x30921c[_0x1c91('0x19')](_0x5b412c);}return _0x30921c['status'](_0x5b412c)[_0x1c91('0x1a')]();};}function respondWithResult(_0x1d4df4,_0x1b14fe){_0x1b14fe=_0x1b14fe||0xc8;return function(_0x11532e){if(_0x11532e){return _0x1d4df4[_0x1c91('0x1b')](_0x1b14fe)[_0x1c91('0x1c')](_0x11532e);}};}function respondWithFilteredResult(_0x2ab3c6,_0x37da15){return function(_0x15777f){if(_0x15777f){var _0x43f9ec=typeof _0x37da15[_0x1c91('0x1d')]==='undefined'&&typeof _0x37da15[_0x1c91('0x1e')]===_0x1c91('0x1f');var _0x494564=_0x15777f[_0x1c91('0x20')];var _0x2d6bd6=_0x43f9ec?0x0:_0x37da15[_0x1c91('0x1d')];var _0x5c38af=_0x43f9ec?_0x15777f[_0x1c91('0x20')]:_0x37da15[_0x1c91('0x1d')]+_0x37da15[_0x1c91('0x1e')];var _0x1e4b3d;if(_0x5c38af>=_0x494564){_0x5c38af=_0x494564;_0x1e4b3d=0xc8;}else{_0x1e4b3d=0xce;}_0x2ab3c6['status'](_0x1e4b3d);return _0x2ab3c6[_0x1c91('0x21')](_0x1c91('0x22'),_0x2d6bd6+'-'+_0x5c38af+'/'+_0x494564)['json'](_0x15777f);}return null;};}function patchUpdates(_0x5672ea){return function(_0x25138d){try{jsonpatch[_0x1c91('0x23')](_0x25138d,_0x5672ea,!![]);}catch(_0x503ecc){return BPromise[_0x1c91('0x24')](_0x503ecc);}return _0x25138d[_0x1c91('0x25')]();};}function saveUpdates(_0x3ad9b0,_0x4b71e0){return function(_0x339311){if(_0x339311){return _0x339311[_0x1c91('0x26')](_0x3ad9b0)['then'](function(_0x3a5f14){return _0x3a5f14;});}return null;};}function removeEntity(_0x13853e,_0x5199f5){return function(_0x3fcec2){if(_0x3fcec2){return _0x3fcec2[_0x1c91('0x27')]()[_0x1c91('0x28')](function(){var _0x7c41e6=_0x3fcec2[_0x1c91('0x29')]({'plain':!![]});var _0x27aa0d=_0x1c91('0x2a');return db[_0x1c91('0x2b')][_0x1c91('0x27')]({'where':{'type':_0x27aa0d,'resourceId':_0x7c41e6['id']}})['then'](function(){return _0x3fcec2;});})[_0x1c91('0x28')](function(){_0x13853e[_0x1c91('0x1b')](0xcc)[_0x1c91('0x1a')]();});}};}function handleEntityNotFound(_0x187e59,_0x4aa18d){return function(_0x5c9609){if(!_0x5c9609){_0x187e59['sendStatus'](0x194);}return _0x5c9609;};}function handleError(_0x4717ee,_0x2c77a6){_0x2c77a6=_0x2c77a6||0x1f4;return function(_0x117fcc){logger[_0x1c91('0x2c')](_0x117fcc['stack']);if(_0x117fcc[_0x1c91('0x2d')]){delete _0x117fcc[_0x1c91('0x2d')];}_0x4717ee['status'](_0x2c77a6)[_0x1c91('0x2e')](_0x117fcc);};}exports[_0x1c91('0x2f')]=function(_0x47889a,_0x274a2b){var _0x3515ce={},_0x3ee6dc={},_0x20bb44={'count':0x0,'rows':[]};var _0x56ecc4=_[_0x1c91('0x30')](db[_0x1c91('0x31')][_0x1c91('0x32')],function(_0x1ea3d6){return{'name':_0x1ea3d6['fieldName'],'type':_0x1ea3d6['type'][_0x1c91('0x33')]};});_0x3ee6dc['model']=_[_0x1c91('0x30')](_0x56ecc4,_0x1c91('0x2d'));_0x3ee6dc[_0x1c91('0x34')]=_[_0x1c91('0x35')](_0x47889a['query']);_0x3ee6dc[_0x1c91('0x36')]=_['intersection'](_0x3ee6dc['model'],_0x3ee6dc[_0x1c91('0x34')]);_0x3515ce[_0x1c91('0x37')]=_['intersection'](_0x3ee6dc[_0x1c91('0x38')],qs[_0x1c91('0x39')](_0x47889a[_0x1c91('0x34')][_0x1c91('0x39')]));_0x3515ce[_0x1c91('0x37')]=_0x3515ce[_0x1c91('0x37')]['length']?_0x3515ce[_0x1c91('0x37')]:_0x3ee6dc[_0x1c91('0x38')];if(!_0x47889a['query']['hasOwnProperty'](_0x1c91('0x3a'))){_0x3515ce['limit']=qs['limit'](_0x47889a[_0x1c91('0x34')][_0x1c91('0x1e')]);_0x3515ce[_0x1c91('0x1d')]=qs[_0x1c91('0x1d')](_0x47889a[_0x1c91('0x34')][_0x1c91('0x1d')]);}_0x3515ce[_0x1c91('0x3b')]=qs[_0x1c91('0x3c')](_0x47889a[_0x1c91('0x34')][_0x1c91('0x3c')]);_0x3515ce[_0x1c91('0x3d')]=qs[_0x1c91('0x36')](_[_0x1c91('0x3e')](_0x47889a[_0x1c91('0x34')],_0x3ee6dc[_0x1c91('0x36')]),_0x56ecc4);if(_0x47889a['query'][_0x1c91('0x3f')]){_0x3515ce['where']=_[_0x1c91('0x40')](_0x3515ce[_0x1c91('0x3d')],{'$or':_[_0x1c91('0x30')](_0x56ecc4,function(_0x4dd143){if(_0x4dd143['type']!=='VIRTUAL'){var _0x339bd5={};_0x339bd5[_0x4dd143[_0x1c91('0x2d')]]={'$like':'%'+_0x47889a[_0x1c91('0x34')]['filter']+'%'};return _0x339bd5;}})});}_0x3515ce=_[_0x1c91('0x40')]({},_0x3515ce,_0x47889a['options']);var _0x2b769c={'where':_0x3515ce[_0x1c91('0x3d')]};return db[_0x1c91('0x31')][_0x1c91('0x20')](_0x2b769c)[_0x1c91('0x28')](function(_0x4b07d6){_0x20bb44[_0x1c91('0x20')]=_0x4b07d6;if(_0x47889a[_0x1c91('0x34')][_0x1c91('0x41')]){_0x3515ce[_0x1c91('0x42')]=[{'all':!![]}];}return db[_0x1c91('0x31')][_0x1c91('0x43')](_0x3515ce);})[_0x1c91('0x28')](function(_0x4828d7){_0x20bb44['rows']=_0x4828d7;return _0x20bb44;})[_0x1c91('0x28')](respondWithFilteredResult(_0x274a2b,_0x3515ce))[_0x1c91('0x44')](handleError(_0x274a2b,null));};exports[_0x1c91('0x45')]=function(_0x27d7e5,_0x82b6ad){var _0x1a3e99={'raw':!![],'where':{'id':_0x27d7e5[_0x1c91('0x46')]['id']}},_0x51a572={};_0x51a572[_0x1c91('0x38')]=_[_0x1c91('0x35')](db[_0x1c91('0x31')][_0x1c91('0x32')]);_0x51a572[_0x1c91('0x34')]=_[_0x1c91('0x35')](_0x27d7e5[_0x1c91('0x34')]);_0x51a572[_0x1c91('0x36')]=_[_0x1c91('0x47')](_0x51a572[_0x1c91('0x38')],_0x51a572[_0x1c91('0x34')]);_0x1a3e99[_0x1c91('0x37')]=_['intersection'](_0x51a572[_0x1c91('0x38')],qs['fields'](_0x27d7e5[_0x1c91('0x34')][_0x1c91('0x39')]));_0x1a3e99[_0x1c91('0x37')]=_0x1a3e99[_0x1c91('0x37')][_0x1c91('0x48')]?_0x1a3e99[_0x1c91('0x37')]:_0x51a572['model'];if(_0x27d7e5['query'][_0x1c91('0x41')]){_0x1a3e99[_0x1c91('0x42')]=[{'all':!![]}];}_0x1a3e99=_[_0x1c91('0x40')]({},_0x1a3e99,_0x27d7e5['options']);return db[_0x1c91('0x31')][_0x1c91('0x49')](_0x1a3e99)[_0x1c91('0x28')](handleEntityNotFound(_0x82b6ad,null))['then'](respondWithResult(_0x82b6ad,null))[_0x1c91('0x44')](handleError(_0x82b6ad,null));};exports[_0x1c91('0x4a')]=function(_0x3cdd54,_0x5ecee0){return db[_0x1c91('0x31')][_0x1c91('0x4a')](_0x3cdd54[_0x1c91('0x4b')],{})[_0x1c91('0x28')](function(_0x560bda){var _0x5db511=_0x3cdd54[_0x1c91('0x4c')]['get']({'plain':!![]});if(!_0x5db511)throw new Error(_0x1c91('0x4d'));if(_0x5db511['role']===_0x1c91('0x4c')){var _0x217ffd=_0x560bda[_0x1c91('0x29')]({'plain':!![]});var _0x537581='Dispositions';return db[_0x1c91('0x4e')][_0x1c91('0x49')]({'where':{'name':_0x537581,'userProfileId':_0x5db511[_0x1c91('0x4f')]},'raw':!![]})[_0x1c91('0x28')](function(_0x3fd45c){if(_0x3fd45c&&_0x3fd45c[_0x1c91('0x50')]===0x0){return db[_0x1c91('0x2b')][_0x1c91('0x4a')]({'name':_0x217ffd['name'],'resourceId':_0x217ffd['id'],'type':_0x3fd45c[_0x1c91('0x2d')],'sectionId':_0x3fd45c['id']},{})[_0x1c91('0x28')](function(){return _0x560bda;});}else{return _0x560bda;}})[_0x1c91('0x44')](function(_0x1d6d59){logger[_0x1c91('0x2c')](_0x1c91('0x51'),_0x1d6d59);throw _0x1d6d59;});}return _0x560bda;})[_0x1c91('0x28')](respondWithResult(_0x5ecee0,0xc9))['catch'](handleError(_0x5ecee0,null));};exports['update']=function(_0x4280b7,_0x36c9d7){if(_0x4280b7[_0x1c91('0x4b')]['id']){delete _0x4280b7[_0x1c91('0x4b')]['id'];}return db[_0x1c91('0x31')]['find']({'where':{'id':_0x4280b7[_0x1c91('0x46')]['id']}})[_0x1c91('0x28')](handleEntityNotFound(_0x36c9d7,null))['then'](saveUpdates(_0x4280b7[_0x1c91('0x4b')],null))[_0x1c91('0x28')](respondWithResult(_0x36c9d7,null))[_0x1c91('0x44')](handleError(_0x36c9d7,null));};exports['destroy']=function(_0x4e1970,_0x40009c){return db[_0x1c91('0x31')]['find']({'where':{'id':_0x4e1970[_0x1c91('0x46')]['id']}})[_0x1c91('0x28')](handleEntityNotFound(_0x40009c,null))[_0x1c91('0x28')](removeEntity(_0x40009c,null))[_0x1c91('0x44')](handleError(_0x40009c,null));};
\ No newline at end of file
+var _0xc01b=['sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','set','json','reject','save','update','destroy','then','Dispositions','sendStatus','error','stack','name','send','index','map','Disposition','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x252080,_0xfaeaf0){var _0x2cbb5f=function(_0x1a4803){while(--_0x1a4803){_0x252080['push'](_0x252080['shift']());}};_0x2cbb5f(++_0xfaeaf0);}(_0xc01b,0x65));var _0xbc01=function(_0x3de64a,_0x54809a){_0x3de64a=_0x3de64a-0x0;var _0x37a73f=_0xc01b[_0x3de64a];return _0x37a73f;};'use strict';var emlformat=require(_0xbc01('0x0'));var rimraf=require(_0xbc01('0x1'));var zipdir=require(_0xbc01('0x2'));var jsonpatch=require(_0xbc01('0x3'));var rp=require('request-promise');var moment=require(_0xbc01('0x4'));var BPromise=require(_0xbc01('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbc01('0x6'));var csv=require(_0xbc01('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc01('0x8'));var squel=require(_0xbc01('0x9'));var crypto=require(_0xbc01('0xa'));var jsforce=require(_0xbc01('0xb'));var deskjs=require(_0xbc01('0xc'));var toCsv=require(_0xbc01('0x7'));var querystring=require(_0xbc01('0xd'));var Papa=require('papaparse');var Redis=require(_0xbc01('0xe'));var authService=require(_0xbc01('0xf'));var qs=require(_0xbc01('0x10'));var as=require(_0xbc01('0x11'));var hardwareService=require(_0xbc01('0x12'));var logger=require(_0xbc01('0x13'))(_0xbc01('0x14'));var utils=require(_0xbc01('0x15'));var config=require(_0xbc01('0x16'));var licenseUtil=require(_0xbc01('0x17'));var db=require(_0xbc01('0x18'))['db'];function respondWithStatusCode(_0x13d9ff,_0x403af3){_0x403af3=_0x403af3||0xcc;return function(_0x2d3cc4){if(_0x2d3cc4){return _0x13d9ff['sendStatus'](_0x403af3);}return _0x13d9ff[_0xbc01('0x19')](_0x403af3)[_0xbc01('0x1a')]();};}function respondWithResult(_0xfc7e92,_0x5de273){_0x5de273=_0x5de273||0xc8;return function(_0x20aedd){if(_0x20aedd){return _0xfc7e92[_0xbc01('0x19')](_0x5de273)['json'](_0x20aedd);}};}function respondWithFilteredResult(_0x3d3fe6,_0x30a0fe){return function(_0x45736c){if(_0x45736c){var _0xf61d88=typeof _0x30a0fe['offset']==='undefined'&&typeof _0x30a0fe[_0xbc01('0x1b')]===_0xbc01('0x1c');var _0x47b5b2=_0x45736c[_0xbc01('0x1d')];var _0x48c750=_0xf61d88?0x0:_0x30a0fe[_0xbc01('0x1e')];var _0x21821a=_0xf61d88?_0x45736c[_0xbc01('0x1d')]:_0x30a0fe[_0xbc01('0x1e')]+_0x30a0fe['limit'];var _0x17cc53;if(_0x21821a>=_0x47b5b2){_0x21821a=_0x47b5b2;_0x17cc53=0xc8;}else{_0x17cc53=0xce;}_0x3d3fe6[_0xbc01('0x19')](_0x17cc53);return _0x3d3fe6[_0xbc01('0x1f')]('Content-Range',_0x48c750+'-'+_0x21821a+'/'+_0x47b5b2)[_0xbc01('0x20')](_0x45736c);}return null;};}function patchUpdates(_0x121670){return function(_0x4a944c){try{jsonpatch['apply'](_0x4a944c,_0x121670,!![]);}catch(_0x4a9656){return BPromise[_0xbc01('0x21')](_0x4a9656);}return _0x4a944c[_0xbc01('0x22')]();};}function saveUpdates(_0x3ae9d6,_0x1299a7){return function(_0x23d4f0){if(_0x23d4f0){return _0x23d4f0[_0xbc01('0x23')](_0x3ae9d6)['then'](function(_0x77a41a){return _0x77a41a;});}return null;};}function removeEntity(_0x5b283b,_0x230ae9){return function(_0x535ad7){if(_0x535ad7){return _0x535ad7[_0xbc01('0x24')]()[_0xbc01('0x25')](function(){var _0x466831=_0x535ad7['get']({'plain':!![]});var _0xf13b08=_0xbc01('0x26');return db['UserProfileResource'][_0xbc01('0x24')]({'where':{'type':_0xf13b08,'resourceId':_0x466831['id']}})[_0xbc01('0x25')](function(){return _0x535ad7;});})[_0xbc01('0x25')](function(){_0x5b283b[_0xbc01('0x19')](0xcc)[_0xbc01('0x1a')]();});}};}function handleEntityNotFound(_0x2ca748,_0x3d39c4){return function(_0x28cd90){if(!_0x28cd90){_0x2ca748[_0xbc01('0x27')](0x194);}return _0x28cd90;};}function handleError(_0x142173,_0x8a19bf){_0x8a19bf=_0x8a19bf||0x1f4;return function(_0x5778d7){logger[_0xbc01('0x28')](_0x5778d7[_0xbc01('0x29')]);if(_0x5778d7[_0xbc01('0x2a')]){delete _0x5778d7[_0xbc01('0x2a')];}_0x142173[_0xbc01('0x19')](_0x8a19bf)[_0xbc01('0x2b')](_0x5778d7);};}exports[_0xbc01('0x2c')]=function(_0x55b9ff,_0x27ec89){var _0x540330={},_0x11e8b9={},_0x48a003={'count':0x0,'rows':[]};var _0x49d749=_[_0xbc01('0x2d')](db[_0xbc01('0x2e')]['rawAttributes'],function(_0x4692bc){return{'name':_0x4692bc[_0xbc01('0x2f')],'type':_0x4692bc[_0xbc01('0x30')]['key']};});_0x11e8b9[_0xbc01('0x31')]=_[_0xbc01('0x2d')](_0x49d749,_0xbc01('0x2a'));_0x11e8b9[_0xbc01('0x32')]=_[_0xbc01('0x33')](_0x55b9ff['query']);_0x11e8b9[_0xbc01('0x34')]=_[_0xbc01('0x35')](_0x11e8b9['model'],_0x11e8b9[_0xbc01('0x32')]);_0x540330[_0xbc01('0x36')]=_[_0xbc01('0x35')](_0x11e8b9[_0xbc01('0x31')],qs[_0xbc01('0x37')](_0x55b9ff[_0xbc01('0x32')][_0xbc01('0x37')]));_0x540330[_0xbc01('0x36')]=_0x540330[_0xbc01('0x36')][_0xbc01('0x38')]?_0x540330[_0xbc01('0x36')]:_0x11e8b9['model'];if(!_0x55b9ff[_0xbc01('0x32')][_0xbc01('0x39')]('nolimit')){_0x540330[_0xbc01('0x1b')]=qs[_0xbc01('0x1b')](_0x55b9ff['query'][_0xbc01('0x1b')]);_0x540330[_0xbc01('0x1e')]=qs[_0xbc01('0x1e')](_0x55b9ff[_0xbc01('0x32')][_0xbc01('0x1e')]);}_0x540330[_0xbc01('0x3a')]=qs[_0xbc01('0x3b')](_0x55b9ff[_0xbc01('0x32')][_0xbc01('0x3b')]);_0x540330[_0xbc01('0x3c')]=qs[_0xbc01('0x34')](_['pick'](_0x55b9ff[_0xbc01('0x32')],_0x11e8b9['filters']),_0x49d749);if(_0x55b9ff[_0xbc01('0x32')][_0xbc01('0x3d')]){_0x540330[_0xbc01('0x3c')]=_[_0xbc01('0x3e')](_0x540330[_0xbc01('0x3c')],{'$or':_['map'](_0x49d749,function(_0x1fcd18){if(_0x1fcd18[_0xbc01('0x30')]!==_0xbc01('0x3f')){var _0x55988c={};_0x55988c[_0x1fcd18[_0xbc01('0x2a')]]={'$like':'%'+_0x55b9ff['query'][_0xbc01('0x3d')]+'%'};return _0x55988c;}})});}_0x540330=_['merge']({},_0x540330,_0x55b9ff[_0xbc01('0x40')]);var _0x3d8d4e={'where':_0x540330['where']};return db[_0xbc01('0x2e')][_0xbc01('0x1d')](_0x3d8d4e)[_0xbc01('0x25')](function(_0x4eaa07){_0x48a003[_0xbc01('0x1d')]=_0x4eaa07;if(_0x55b9ff[_0xbc01('0x32')][_0xbc01('0x41')]){_0x540330['include']=[{'all':!![]}];}return db[_0xbc01('0x2e')]['findAll'](_0x540330);})[_0xbc01('0x25')](function(_0x5cfe63){_0x48a003[_0xbc01('0x42')]=_0x5cfe63;return _0x48a003;})[_0xbc01('0x25')](respondWithFilteredResult(_0x27ec89,_0x540330))[_0xbc01('0x43')](handleError(_0x27ec89,null));};exports[_0xbc01('0x44')]=function(_0x18d585,_0x1bb1eb){var _0x494a6b={'raw':!![],'where':{'id':_0x18d585[_0xbc01('0x45')]['id']}},_0x55f322={};_0x55f322[_0xbc01('0x31')]=_[_0xbc01('0x33')](db[_0xbc01('0x2e')]['rawAttributes']);_0x55f322['query']=_[_0xbc01('0x33')](_0x18d585[_0xbc01('0x32')]);_0x55f322[_0xbc01('0x34')]=_[_0xbc01('0x35')](_0x55f322[_0xbc01('0x31')],_0x55f322[_0xbc01('0x32')]);_0x494a6b[_0xbc01('0x36')]=_['intersection'](_0x55f322['model'],qs[_0xbc01('0x37')](_0x18d585[_0xbc01('0x32')][_0xbc01('0x37')]));_0x494a6b['attributes']=_0x494a6b[_0xbc01('0x36')][_0xbc01('0x38')]?_0x494a6b[_0xbc01('0x36')]:_0x55f322[_0xbc01('0x31')];if(_0x18d585[_0xbc01('0x32')][_0xbc01('0x41')]){_0x494a6b[_0xbc01('0x46')]=[{'all':!![]}];}_0x494a6b=_[_0xbc01('0x3e')]({},_0x494a6b,_0x18d585[_0xbc01('0x40')]);return db['Disposition'][_0xbc01('0x47')](_0x494a6b)[_0xbc01('0x25')](handleEntityNotFound(_0x1bb1eb,null))[_0xbc01('0x25')](respondWithResult(_0x1bb1eb,null))['catch'](handleError(_0x1bb1eb,null));};exports[_0xbc01('0x48')]=function(_0x24b61d,_0x83b750){return db[_0xbc01('0x2e')]['create'](_0x24b61d['body'],{})[_0xbc01('0x25')](function(_0x1cc594){var _0x4c15ef=_0x24b61d['user']['get']({'plain':!![]});if(!_0x4c15ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c15ef[_0xbc01('0x49')]==='user'){var _0x5f3e0d=_0x1cc594[_0xbc01('0x4a')]({'plain':!![]});var _0x2b61cb=_0xbc01('0x26');return db[_0xbc01('0x4b')][_0xbc01('0x47')]({'where':{'name':_0x2b61cb,'userProfileId':_0x4c15ef[_0xbc01('0x4c')]},'raw':!![]})[_0xbc01('0x25')](function(_0x354a5a){if(_0x354a5a&&_0x354a5a[_0xbc01('0x4d')]===0x0){return db['UserProfileResource'][_0xbc01('0x48')]({'name':_0x5f3e0d['name'],'resourceId':_0x5f3e0d['id'],'type':_0x354a5a['name'],'sectionId':_0x354a5a['id']},{})['then'](function(){return _0x1cc594;});}else{return _0x1cc594;}})[_0xbc01('0x43')](function(_0x23a532){logger[_0xbc01('0x28')](_0xbc01('0x4e'),_0x23a532);throw _0x23a532;});}return _0x1cc594;})['then'](respondWithResult(_0x83b750,0xc9))[_0xbc01('0x43')](handleError(_0x83b750,null));};exports['update']=function(_0x3ba99f,_0x326632){if(_0x3ba99f[_0xbc01('0x4f')]['id']){delete _0x3ba99f[_0xbc01('0x4f')]['id'];}return db[_0xbc01('0x2e')][_0xbc01('0x47')]({'where':{'id':_0x3ba99f['params']['id']}})[_0xbc01('0x25')](handleEntityNotFound(_0x326632,null))[_0xbc01('0x25')](saveUpdates(_0x3ba99f[_0xbc01('0x4f')],null))['then'](respondWithResult(_0x326632,null))[_0xbc01('0x43')](handleError(_0x326632,null));};exports[_0xbc01('0x24')]=function(_0x52bb86,_0x404b26){return db[_0xbc01('0x2e')][_0xbc01('0x47')]({'where':{'id':_0x52bb86['params']['id']}})['then'](handleEntityNotFound(_0x404b26,null))[_0xbc01('0x25')](removeEntity(_0x404b26,null))[_0xbc01('0x43')](handleError(_0x404b26,null));};
\ No newline at end of file
index b064738..853b5ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15a4=['WhatsappAccountId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','name_openchannel'];(function(_0x5c1b05,_0x213768){var _0x1a65e7=function(_0x2845d7){while(--_0x2845d7){_0x5c1b05['push'](_0x5c1b05['shift']());}};_0x1a65e7(++_0x213768);}(_0x15a4,0x178));var _0x415a=function(_0x280429,_0x55b86f){_0x280429=_0x280429-0x0;var _0x219e8c=_0x15a4[_0x280429];return _0x219e8c;};'use strict';var _=require(_0x415a('0x0'));var util=require(_0x415a('0x1'));var logger=require(_0x415a('0x2'))(_0x415a('0x3'));var moment=require(_0x415a('0x4'));var BPromise=require('bluebird');var rp=require(_0x415a('0x5'));var fs=require('fs');var path=require(_0x415a('0x6'));var rimraf=require(_0x415a('0x7'));var config=require(_0x415a('0x8'));var attributes=require(_0x415a('0x9'));module[_0x415a('0xa')]=function(_0x7f34f3,_0x30ba26){return _0x7f34f3[_0x415a('0xb')](_0x415a('0xc'),attributes,{'tableName':_0x415a('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x415a('0xe'),'fields':[_0x415a('0xf'),_0x415a('0x10')]},{'unique':!![],'name':_0x415a('0x11'),'fields':[_0x415a('0xf'),_0x415a('0x12')]},{'unique':!![],'name':_0x415a('0x13'),'fields':['name',_0x415a('0x14')]},{'unique':!![],'name':_0x415a('0x15'),'fields':[_0x415a('0xf'),'SmsAccountId']},{'unique':!![],'name':_0x415a('0x16'),'fields':[_0x415a('0xf'),'FaxAccountId']},{'unique':!![],'name':_0x415a('0x17'),'fields':[_0x415a('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x415a('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbf9=['api','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name_chat','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger'];(function(_0x566dc0,_0x4addd7){var _0x1fd291=function(_0x3b2e7f){while(--_0x3b2e7f){_0x566dc0['push'](_0x566dc0['shift']());}};_0x1fd291(++_0x4addd7);}(_0xfbf9,0x166));var _0x9fbf=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xfbf9[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require('lodash');var util=require(_0x9fbf('0x0'));var logger=require(_0x9fbf('0x1'))(_0x9fbf('0x2'));var moment=require(_0x9fbf('0x3'));var BPromise=require(_0x9fbf('0x4'));var rp=require(_0x9fbf('0x5'));var fs=require('fs');var path=require(_0x9fbf('0x6'));var rimraf=require(_0x9fbf('0x7'));var config=require('../../config/environment');var attributes=require(_0x9fbf('0x8'));module[_0x9fbf('0x9')]=function(_0x3ee2ba,_0x390069){return _0x3ee2ba['define'](_0x9fbf('0xa'),attributes,{'tableName':_0x9fbf('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x9fbf('0xc'),'fields':['name','ListId']},{'unique':!![],'name':_0x9fbf('0xd'),'fields':[_0x9fbf('0xe'),_0x9fbf('0xf')]},{'unique':!![],'name':_0x9fbf('0x10'),'fields':[_0x9fbf('0xe'),'MailAccountId']},{'unique':!![],'name':_0x9fbf('0x11'),'fields':[_0x9fbf('0xe'),_0x9fbf('0x12')]},{'unique':!![],'name':_0x9fbf('0x13'),'fields':['name',_0x9fbf('0x14')]},{'unique':!![],'name':_0x9fbf('0x15'),'fields':[_0x9fbf('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':_0x9fbf('0x16'),'fields':[_0x9fbf('0xe'),_0x9fbf('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
index 60948ed..d6285ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x22b8b7,_0x4a1e0b){var _0x362aaf=function(_0x52aa8d){while(--_0x52aa8d){_0x22b8b7['push'](_0x22b8b7['shift']());}};_0x362aaf(++_0x4a1e0b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x95a289,_0x4891e1){var _0x505c40=function(_0x57c150){while(--_0x57c150){_0x95a289['push'](_0x95a289['shift']());}};_0x505c40(++_0x4891e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index fc9d0e2..9e53f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4981=['../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x266ddc,_0x45aa52){var _0x39c1d7=function(_0x4cd07c){while(--_0x4cd07c){_0x266ddc['push'](_0x266ddc['shift']());}};_0x39c1d7(++_0x45aa52);}(_0x4981,0x19d));var _0x1498=function(_0x402f6f,_0x566e84){_0x402f6f=_0x402f6f-0x0;var _0x46f13f=_0x4981[_0x402f6f];return _0x46f13f;};'use strict';var multer=require(_0x1498('0x0'));var util=require(_0x1498('0x1'));var path=require(_0x1498('0x2'));var timeout=require(_0x1498('0x3'));var express=require(_0x1498('0x4'));var router=express[_0x1498('0x5')]();var fs_extra=require(_0x1498('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1498('0x7'));var config=require(_0x1498('0x8'));var controller=require(_0x1498('0x9'));router[_0x1498('0xa')]('/',auth[_0x1498('0xb')](),controller['index']);router[_0x1498('0xa')](_0x1498('0xc'),auth['isAuthenticated'](),controller[_0x1498('0xd')]);router[_0x1498('0xe')]('/',auth[_0x1498('0xb')](),controller[_0x1498('0xf')]);router[_0x1498('0x10')]('/:id',auth[_0x1498('0xb')](),controller[_0x1498('0x11')]);router[_0x1498('0x12')](_0x1498('0xc'),auth[_0x1498('0xb')](),controller[_0x1498('0x13')]);module[_0x1498('0x14')]=router;
\ No newline at end of file
+var _0xccef=['get','isAuthenticated','index','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccef,0x100));var _0xfcce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xccef[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xfcce('0x0'));var path=require(_0xfcce('0x1'));var timeout=require(_0xfcce('0x2'));var express=require(_0xfcce('0x3'));var router=express[_0xfcce('0x4')]();var fs_extra=require(_0xfcce('0x5'));var auth=require(_0xfcce('0x6'));var interaction=require(_0xfcce('0x7'));var config=require(_0xfcce('0x8'));var controller=require(_0xfcce('0x9'));router[_0xfcce('0xa')]('/',auth[_0xfcce('0xb')](),controller[_0xfcce('0xc')]);router[_0xfcce('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfcce('0xd')]('/',auth['isAuthenticated'](),controller[_0xfcce('0xe')]);router[_0xfcce('0xf')]('/:id',auth[_0xfcce('0xb')](),controller[_0xfcce('0x10')]);router[_0xfcce('0x11')]('/:id',auth[_0xfcce('0xb')](),controller['destroy']);module[_0xfcce('0x12')]=router;
\ No newline at end of file
index 868db43..0ff7378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a58=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2e7a43,_0x3b3df4){var _0x52e9e1=function(_0x2c08cf){while(--_0x2c08cf){_0x2e7a43['push'](_0x2e7a43['shift']());}};_0x52e9e1(++_0x3b3df4);}(_0x7a58,0x1c4));var _0x87a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a58[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x87a5('0x0'));module[_0x87a5('0x1')]={'name':{'type':Sequelize[_0x87a5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x87a5('0x2')]},'ecm':{'type':Sequelize[_0x87a5('0x3')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x87a5('0x2')],'defaultValue':_0x87a5('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x87a5('0x5')},'minrate':{'type':Sequelize[_0x87a5('0x3')](_0x87a5('0x6'),_0x87a5('0x7'),_0x87a5('0x8'),_0x87a5('0x9'),'12000',_0x87a5('0xa')),'defaultValue':_0x87a5('0x7')},'maxrate':{'type':Sequelize[_0x87a5('0x3')](_0x87a5('0x6'),'4800','7200',_0x87a5('0x9'),_0x87a5('0xb'),'14400'),'defaultValue':_0x87a5('0xa')},'modem':{'type':Sequelize[_0x87a5('0x2')],'defaultValue':_0x87a5('0xc')},'gateway':{'type':Sequelize[_0x87a5('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x87a5('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x87a5('0x3')](_0x87a5('0xe'),'IAX',_0x87a5('0xf'),_0x87a5('0x10')),'defaultValue':_0x87a5('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x87a5('0x11')],'defaultValue':function(){return _0x87a5('0x12');}},'notificationSound':{'type':Sequelize[_0x87a5('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x87a5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x87a5('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x87a5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x87a5('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x87a5('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x87a5('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x87a5('0x13')],'defaultValue':![],'comment':_0x87a5('0x15'),'set':function(_0x18b5fe){if(!_0x18b5fe)this[_0x87a5('0x16')](_0x87a5('0x17'),null);this[_0x87a5('0x16')](_0x87a5('0x18'),_0x18b5fe);}}};
\ No newline at end of file
+var _0xdace=['mandatoryDispositionPauseId','exports','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x501e74,_0x4e0345){var _0x2006e4=function(_0x1b6438){while(--_0x1b6438){_0x501e74['push'](_0x501e74['shift']());}};_0x2006e4(++_0x4e0345);}(_0xdace,0xc1));var _0xedac=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xdace[_0x9729d7];return _0x3c4ac6;};'use strict';var Sequelize=require('sequelize');module[_0xedac('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xedac('0x1')},'headerinfo':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xedac('0x4')},'minrate':{'type':Sequelize[_0xedac('0x5')](_0xedac('0x6'),_0xedac('0x7'),_0xedac('0x8'),_0xedac('0x9'),_0xedac('0xa'),'14400'),'defaultValue':_0xedac('0x7')},'maxrate':{'type':Sequelize[_0xedac('0x5')](_0xedac('0x6'),_0xedac('0x7'),_0xedac('0x8'),_0xedac('0x9'),_0xedac('0xa'),_0xedac('0xb')),'defaultValue':_0xedac('0xb')},'modem':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0xc')},'gateway':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xedac('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xedac('0x5')](_0xedac('0xe'),_0xedac('0xf'),_0xedac('0x10'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xedac('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xedac('0x11')],'defaultValue':function(){return _0xedac('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xedac('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xedac('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xedac('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xedac('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xedac('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xedac('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xedac('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xedac('0x15'),'set':function(_0x56b524){if(!_0x56b524)this[_0xedac('0x16')](_0xedac('0x17'),null);this[_0xedac('0x16')]('mandatoryDisposition',_0x56b524);}}};
\ No newline at end of file
index 6380ecc..b840598 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf462=['from','fax','defaults','Send\x20Fax\x20failed','out','filename','Messages','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','client','http','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','undefined','limit','offset','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','end','stack','name','index','Pause','map','FaxAccount','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','count','rows','show','params','mandatoryDispositionPause','rawAttributes','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','FaxAccountId','Disposition','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','send','getApplications','context','from-voip-provider','app','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','minrate','modem','push','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','key','createdAt','updatedAt','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil'];(function(_0x2450d2,_0x145591){var _0xf8ce7a=function(_0x1e018a){while(--_0x1e018a){_0x2450d2['push'](_0x2450d2['shift']());}};_0xf8ce7a(++_0x145591);}(_0xf462,0xd1));var _0x2f46=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xf462[_0x2c1dcd];return _0x158ce5;};'use strict';var emlformat=require(_0x2f46('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f46('0x1'));var jsonpatch=require(_0x2f46('0x2'));var rp=require(_0x2f46('0x3'));var moment=require('moment');var BPromise=require(_0x2f46('0x4'));var Mustache=require(_0x2f46('0x5'));var util=require(_0x2f46('0x6'));var path=require(_0x2f46('0x7'));var sox=require('sox');var csv=require(_0x2f46('0x8'));var ejs=require(_0x2f46('0x9'));var fs=require('fs');var fs_extra=require(_0x2f46('0xa'));var _=require(_0x2f46('0xb'));var squel=require(_0x2f46('0xc'));var crypto=require(_0x2f46('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2f46('0x8'));var querystring=require(_0x2f46('0xe'));var Papa=require(_0x2f46('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2f46('0x10'));var as=require(_0x2f46('0x11'));var hardwareService=require(_0x2f46('0x12'));var logger=require(_0x2f46('0x13'))('api');var utils=require(_0x2f46('0x14'));var config=require(_0x2f46('0x15'));var licenseUtil=require(_0x2f46('0x16'));var db=require(_0x2f46('0x17'))['db'];config[_0x2f46('0x18')]=_['defaults'](config['redis'],{'host':_0x2f46('0x19'),'port':0x18eb});var socket=require(_0x2f46('0x1a'))(new Redis(config['redis']));require(_0x2f46('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2f46('0x1c')][_0x2f46('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x2f46('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23d971,_0x58c1de,_0x100b69,_0x321f11){return new BPromise(function(_0x135b64,_0x213348){var _0x2837b5=_0x321f11||client;return _0x2837b5[_0x2f46('0x1e')](_0x23d971,_0x100b69)[_0x2f46('0x1f')](function(_0x8b213a){logger[_0x2f46('0x20')]('FaxAccount,\x20%s,\x20%s',_0x58c1de,_0x2f46('0x21'));logger[_0x2f46('0x22')](_0x2f46('0x23'),_0x58c1de,_0x2f46('0x21'),JSON[_0x2f46('0x24')](_0x8b213a));if(_0x8b213a['error']){if(_0x8b213a[_0x2f46('0x25')][_0x2f46('0x26')]===0x1f4){logger[_0x2f46('0x25')](_0x2f46('0x27'),_0x58c1de,_0x8b213a[_0x2f46('0x25')][_0x2f46('0x28')]);return _0x213348(_0x8b213a[_0x2f46('0x25')][_0x2f46('0x28')]);}logger[_0x2f46('0x25')](_0x2f46('0x27'),_0x58c1de,_0x8b213a[_0x2f46('0x25')][_0x2f46('0x28')]);return _0x135b64(_0x8b213a[_0x2f46('0x25')][_0x2f46('0x28')]);}else{logger['info'](_0x2f46('0x27'),_0x58c1de,_0x2f46('0x21'));_0x135b64(_0x8b213a['result'][_0x2f46('0x28')]);}})[_0x2f46('0x29')](function(_0x559f7f){logger[_0x2f46('0x25')](_0x2f46('0x27'),_0x58c1de,_0x559f7f);_0x213348(_0x559f7f);});});}function respondWithStatusCode(_0x318f10,_0x5106d7){_0x5106d7=_0x5106d7||0xcc;return function(_0x3734a5){if(_0x3734a5){return _0x318f10[_0x2f46('0x2a')](_0x5106d7);}return _0x318f10[_0x2f46('0x2b')](_0x5106d7)['end']();};}function respondWithResult(_0x5956e6,_0x1d27a4){_0x1d27a4=_0x1d27a4||0xc8;return function(_0x1867fb){if(_0x1867fb){return _0x5956e6['status'](_0x1d27a4)[_0x2f46('0x2c')](_0x1867fb);}};}function respondWithFilteredResult(_0x332b84,_0x2fd15c){return function(_0x5977e4){if(_0x5977e4){var _0x556bcc=typeof _0x2fd15c['offset']===_0x2f46('0x2d')&&typeof _0x2fd15c[_0x2f46('0x2e')]==='undefined';var _0x4ed317=_0x5977e4['count'];var _0x3a8a47=_0x556bcc?0x0:_0x2fd15c['offset'];var _0x73443c=_0x556bcc?_0x5977e4['count']:_0x2fd15c[_0x2f46('0x2f')]+_0x2fd15c[_0x2f46('0x2e')];var _0x44b14c;if(_0x73443c>=_0x4ed317){_0x73443c=_0x4ed317;_0x44b14c=0xc8;}else{_0x44b14c=0xce;}_0x332b84[_0x2f46('0x2b')](_0x44b14c);return _0x332b84['set'](_0x2f46('0x30'),_0x3a8a47+'-'+_0x73443c+'/'+_0x4ed317)[_0x2f46('0x2c')](_0x5977e4);}return null;};}function patchUpdates(_0x4fa783){return function(_0x3b703d){try{jsonpatch[_0x2f46('0x31')](_0x3b703d,_0x4fa783,!![]);}catch(_0x157a9b){return BPromise[_0x2f46('0x32')](_0x157a9b);}return _0x3b703d[_0x2f46('0x33')]();};}function saveUpdates(_0x3ed70f,_0x470020){return function(_0x223bcd){if(_0x223bcd){return _0x223bcd[_0x2f46('0x34')](_0x3ed70f)[_0x2f46('0x1f')](function(_0x3ef73c){return _0x3ef73c;});}return null;};}function removeEntity(_0xea3c9f,_0x240e47){return function(_0x4323fe){if(_0x4323fe){return _0x4323fe['destroy']()[_0x2f46('0x1f')](function(){var _0x581a71=_0x4323fe[_0x2f46('0x35')]({'plain':!![]});var _0x15a7a2='FaxAccounts';return db[_0x2f46('0x36')][_0x2f46('0x37')]({'where':{'type':_0x15a7a2,'resourceId':_0x581a71['id']}})[_0x2f46('0x1f')](function(){return _0x4323fe;});})[_0x2f46('0x1f')](function(){_0xea3c9f[_0x2f46('0x2b')](0xcc)[_0x2f46('0x38')]();});}};}function handleEntityNotFound(_0x3c8adb,_0x46f3ef){return function(_0x55a464){if(!_0x55a464){_0x3c8adb[_0x2f46('0x2a')](0x194);}return _0x55a464;};}function handleError(_0x2e5d66,_0x46e441){_0x46e441=_0x46e441||0x1f4;return function(_0x33dadf){logger[_0x2f46('0x25')](_0x33dadf[_0x2f46('0x39')]);if(_0x33dadf[_0x2f46('0x3a')]){delete _0x33dadf[_0x2f46('0x3a')];}_0x2e5d66[_0x2f46('0x2b')](_0x46e441)['send'](_0x33dadf);};}exports[_0x2f46('0x3b')]=function(_0x25c795,_0x42987b){var _0x514492={'include':[{'model':db[_0x2f46('0x3c')],'as':'mandatoryDispositionPause'}]},_0x2dbd90={},_0x1a6c06={'count':0x0,'rows':[]};var _0x1dd910=_[_0x2f46('0x3d')](db[_0x2f46('0x3e')]['rawAttributes'],function(_0x53f9da){return{'name':_0x53f9da[_0x2f46('0x3f')],'type':_0x53f9da[_0x2f46('0x40')]['key']};});_0x2dbd90[_0x2f46('0x41')]=_[_0x2f46('0x3d')](_0x1dd910,'name');_0x2dbd90['query']=_[_0x2f46('0x42')](_0x25c795[_0x2f46('0x43')]);_0x2dbd90[_0x2f46('0x44')]=_['intersection'](_0x2dbd90[_0x2f46('0x41')],_0x2dbd90[_0x2f46('0x43')]);_0x514492[_0x2f46('0x45')]=_[_0x2f46('0x46')](_0x2dbd90[_0x2f46('0x41')],qs['fields'](_0x25c795[_0x2f46('0x43')][_0x2f46('0x47')]));_0x514492['attributes']=_0x514492[_0x2f46('0x45')][_0x2f46('0x48')]?_0x514492[_0x2f46('0x45')]:_0x2dbd90['model'];if(!_0x25c795[_0x2f46('0x43')][_0x2f46('0x49')](_0x2f46('0x4a'))){_0x514492[_0x2f46('0x2e')]=qs[_0x2f46('0x2e')](_0x25c795[_0x2f46('0x43')][_0x2f46('0x2e')]);_0x514492['offset']=qs[_0x2f46('0x2f')](_0x25c795[_0x2f46('0x43')][_0x2f46('0x2f')]);}_0x514492[_0x2f46('0x4b')]=qs[_0x2f46('0x4c')](_0x25c795['query']['sort']);_0x514492['where']=qs[_0x2f46('0x44')](_['pick'](_0x25c795['query'],_0x2dbd90[_0x2f46('0x44')]),_0x1dd910);if(_0x25c795[_0x2f46('0x43')][_0x2f46('0x4d')]){_0x514492['where']=_[_0x2f46('0x4e')](_0x514492[_0x2f46('0x4f')],{'$or':_['map'](_0x1dd910,function(_0x18594c){if(_0x18594c['type']!==_0x2f46('0x50')){var _0xece1e4={};_0xece1e4[_0x18594c[_0x2f46('0x3a')]]={'$like':'%'+_0x25c795['query'][_0x2f46('0x4d')]+'%'};return _0xece1e4;}})});}_0x514492=_[_0x2f46('0x4e')]({},_0x514492,_0x25c795[_0x2f46('0x51')]);var _0x63ef2={'where':_0x514492[_0x2f46('0x4f')]};return db[_0x2f46('0x3e')][_0x2f46('0x52')](_0x63ef2)[_0x2f46('0x1f')](function(_0x1474d){_0x1a6c06[_0x2f46('0x52')]=_0x1474d;if(_0x25c795['query']['includeAll']){_0x514492['include']=[{'all':!![]}];}return db[_0x2f46('0x3e')]['findAll'](_0x514492);})[_0x2f46('0x1f')](function(_0x444706){_0x1a6c06[_0x2f46('0x53')]=_0x444706;return _0x1a6c06;})['then'](respondWithFilteredResult(_0x42987b,_0x514492))[_0x2f46('0x29')](handleError(_0x42987b,null));};exports[_0x2f46('0x54')]=function(_0x5079af,_0x2837fe){var _0x4c6093={'raw':![],'where':{'id':_0x5079af[_0x2f46('0x55')]['id']},'include':[{'model':db[_0x2f46('0x3c')],'as':_0x2f46('0x56')}]},_0x23fb67={};_0x23fb67[_0x2f46('0x41')]=_[_0x2f46('0x42')](db['FaxAccount'][_0x2f46('0x57')]);_0x23fb67[_0x2f46('0x43')]=_[_0x2f46('0x42')](_0x5079af['query']);_0x23fb67[_0x2f46('0x44')]=_[_0x2f46('0x46')](_0x23fb67['model'],_0x23fb67[_0x2f46('0x43')]);_0x4c6093['attributes']=_[_0x2f46('0x46')](_0x23fb67[_0x2f46('0x41')],qs[_0x2f46('0x47')](_0x5079af['query'][_0x2f46('0x47')]));_0x4c6093['attributes']=_0x4c6093[_0x2f46('0x45')][_0x2f46('0x48')]?_0x4c6093[_0x2f46('0x45')]:_0x23fb67[_0x2f46('0x41')];if(_0x5079af[_0x2f46('0x43')][_0x2f46('0x58')]){_0x4c6093[_0x2f46('0x59')]=[{'all':!![]}];}_0x4c6093=_[_0x2f46('0x4e')]({},_0x4c6093,_0x5079af[_0x2f46('0x51')]);return db[_0x2f46('0x3e')]['find'](_0x4c6093)[_0x2f46('0x1f')](handleEntityNotFound(_0x2837fe,null))['then'](respondWithResult(_0x2837fe,null))[_0x2f46('0x29')](handleError(_0x2837fe,null));};exports[_0x2f46('0x5a')]=function(_0x18a80b,_0x37efa4){return db[_0x2f46('0x3e')][_0x2f46('0x5a')](_0x18a80b['body'],{})[_0x2f46('0x1f')](function(_0x64abf6){var _0x1c8ebf=_0x18a80b[_0x2f46('0x5b')][_0x2f46('0x35')]({'plain':!![]});if(!_0x1c8ebf)throw new Error(_0x2f46('0x5c'));if(_0x1c8ebf[_0x2f46('0x5d')]===_0x2f46('0x5b')){var _0x587029=_0x64abf6[_0x2f46('0x35')]({'plain':!![]});var _0x4f7d96=_0x2f46('0x5e');return db[_0x2f46('0x5f')]['find']({'where':{'name':_0x4f7d96,'userProfileId':_0x1c8ebf['userProfileId']},'raw':!![]})[_0x2f46('0x1f')](function(_0x49c720){if(_0x49c720&&_0x49c720[_0x2f46('0x60')]===0x0){return db[_0x2f46('0x36')][_0x2f46('0x5a')]({'name':_0x587029[_0x2f46('0x3a')],'resourceId':_0x587029['id'],'type':_0x49c720[_0x2f46('0x3a')],'sectionId':_0x49c720['id']},{})[_0x2f46('0x1f')](function(){return _0x64abf6;});}else{return _0x64abf6;}})[_0x2f46('0x29')](function(_0x46356d){logger['error'](_0x2f46('0x61'),_0x46356d);throw _0x46356d;});}return _0x64abf6;})[_0x2f46('0x1f')](respondWithResult(_0x37efa4,0xc9))[_0x2f46('0x29')](handleError(_0x37efa4,null));};exports['update']=function(_0x20be76,_0x2811b0){if(_0x20be76[_0x2f46('0x62')]['id']){delete _0x20be76[_0x2f46('0x62')]['id'];}return db[_0x2f46('0x3e')][_0x2f46('0x63')]({'where':{'id':_0x20be76[_0x2f46('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x2f46('0x56')}]})[_0x2f46('0x1f')](handleEntityNotFound(_0x2811b0,null))['then'](saveUpdates(_0x20be76[_0x2f46('0x62')],null))[_0x2f46('0x1f')](respondWithResult(_0x2811b0,null))[_0x2f46('0x29')](handleError(_0x2811b0,null));};exports[_0x2f46('0x37')]=function(_0x27f2e0,_0x2f916e){return db[_0x2f46('0x3e')]['find']({'where':{'id':_0x27f2e0[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x2f916e,null))[_0x2f46('0x1f')](removeEntity(_0x2f916e,null))[_0x2f46('0x29')](handleError(_0x2f916e,null));};exports[_0x2f46('0x64')]=function(_0x372d56,_0x1f7559){return db['FaxAccount'][_0x2f46('0x64')]()[_0x2f46('0x1f')](respondWithResult(_0x1f7559,null))[_0x2f46('0x29')](handleError(_0x1f7559,null));};exports[_0x2f46('0x65')]=function(_0x16c3bc,_0x31bdbc,_0x270c3c){if(_0x16c3bc[_0x2f46('0x62')]['id']){delete _0x16c3bc[_0x2f46('0x62')]['id'];}return db[_0x2f46('0x3e')][_0x2f46('0x63')]({'where':{'id':_0x16c3bc['params']['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x31bdbc,null))['then'](function(_0x3e75f1){if(_0x3e75f1){_0x16c3bc[_0x2f46('0x62')][_0x2f46('0x66')]=_0x3e75f1['id'];return db['Disposition'][_0x2f46('0x5a')](_0x16c3bc[_0x2f46('0x62')]);}})[_0x2f46('0x1f')](respondWithResult(_0x31bdbc,null))[_0x2f46('0x29')](handleError(_0x31bdbc,null));};exports['getDispositions']=function(_0x3f17d0,_0x355b04,_0x403f38){var _0xa66139={'raw':![],'where':{}};var _0x2d91f2={};var _0x4314c9={'count':0x0,'rows':[]};return db[_0x2f46('0x3e')]['findOne']({'where':{'id':_0x3f17d0['params']['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x355b04,null))['then'](function(_0x430b61){if(_0x430b61){_0x2d91f2['model']=_['keys'](db[_0x2f46('0x67')][_0x2f46('0x57')]);_0x2d91f2['query']=_[_0x2f46('0x42')](_0x3f17d0[_0x2f46('0x43')]);_0x2d91f2[_0x2f46('0x44')]=_[_0x2f46('0x46')](_0x2d91f2[_0x2f46('0x41')],_0x2d91f2[_0x2f46('0x43')]);_0xa66139['attributes']=_[_0x2f46('0x46')](_0x2d91f2[_0x2f46('0x41')],qs[_0x2f46('0x47')](_0x3f17d0['query'][_0x2f46('0x47')]));_0xa66139['attributes']=_0xa66139[_0x2f46('0x45')][_0x2f46('0x48')]?_0xa66139[_0x2f46('0x45')]:_0x2d91f2[_0x2f46('0x41')];if(!_0x3f17d0[_0x2f46('0x43')][_0x2f46('0x49')](_0x2f46('0x4a'))){_0xa66139[_0x2f46('0x2e')]=qs[_0x2f46('0x2e')](_0x3f17d0['query'][_0x2f46('0x2e')]);_0xa66139['offset']=qs[_0x2f46('0x2f')](_0x3f17d0[_0x2f46('0x43')][_0x2f46('0x2f')]);}_0xa66139['order']=qs[_0x2f46('0x4c')](_0x3f17d0[_0x2f46('0x43')][_0x2f46('0x4c')]);_0xa66139[_0x2f46('0x4f')]=qs[_0x2f46('0x44')](_[_0x2f46('0x68')](_0x3f17d0[_0x2f46('0x43')],_0x2d91f2[_0x2f46('0x44')]));_0xa66139[_0x2f46('0x4f')][_0x2f46('0x66')]=_0x430b61['id'];if(_0x3f17d0['query'][_0x2f46('0x4d')]){_0xa66139[_0x2f46('0x4f')]=_[_0x2f46('0x4e')](_0xa66139[_0x2f46('0x4f')],{'$or':_[_0x2f46('0x3d')](_0xa66139[_0x2f46('0x45')],function(_0x41064a){var _0x277421={};_0x277421[_0x41064a]={'$like':'%'+_0x3f17d0[_0x2f46('0x43')][_0x2f46('0x4d')]+'%'};return _0x277421;})});}_0xa66139=_['merge']({},_0xa66139,_0x3f17d0[_0x2f46('0x51')]);return db[_0x2f46('0x67')][_0x2f46('0x52')]({'where':_0xa66139['where']})['then'](function(_0x1b1270){_0x4314c9[_0x2f46('0x52')]=_0x1b1270;if(_0x3f17d0[_0x2f46('0x43')][_0x2f46('0x58')]){_0xa66139[_0x2f46('0x59')]=[{'all':!![]}];}return db[_0x2f46('0x67')][_0x2f46('0x69')](_0xa66139);})[_0x2f46('0x1f')](function(_0x576e46){_0x4314c9[_0x2f46('0x53')]=_0x576e46;return _0x4314c9;});}})[_0x2f46('0x1f')](respondWithFilteredResult(_0x355b04,_0xa66139))[_0x2f46('0x29')](handleError(_0x355b04,null));};exports['removeDispositions']=function(_0x3c90d0,_0x5b768e,_0x430d68){return db['FaxAccount'][_0x2f46('0x63')]({'where':{'id':_0x3c90d0['params']['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x5b768e,null))[_0x2f46('0x1f')](function(_0x4153a3){if(_0x4153a3){return _0x4153a3[_0x2f46('0x6a')](_0x3c90d0[_0x2f46('0x43')][_0x2f46('0x6b')]);}})[_0x2f46('0x1f')](respondWithStatusCode(_0x5b768e,null))[_0x2f46('0x29')](handleError(_0x5b768e,null));};exports[_0x2f46('0x6c')]=function(_0x3c63fa,_0x2ce183,_0x2a8e54){if(_0x3c63fa[_0x2f46('0x62')]['id']){delete _0x3c63fa[_0x2f46('0x62')]['id'];}return db[_0x2f46('0x3e')][_0x2f46('0x63')]({'where':{'id':_0x3c63fa[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x2ce183,null))[_0x2f46('0x1f')](function(_0x37f491){if(_0x37f491){_0x3c63fa[_0x2f46('0x62')][_0x2f46('0x66')]=_0x37f491['id'];return db[_0x2f46('0x6d')][_0x2f46('0x5a')](_0x3c63fa['body']);}})[_0x2f46('0x1f')](respondWithResult(_0x2ce183,null))[_0x2f46('0x29')](handleError(_0x2ce183,null));};exports[_0x2f46('0x6e')]=function(_0x254818,_0x444ce3,_0xf388fd){var _0x3800d6={'raw':![],'where':{}};var _0x59a551={};var _0x2bdeba={'count':0x0,'rows':[]};return db[_0x2f46('0x3e')][_0x2f46('0x6f')]({'where':{'id':_0x254818[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x444ce3,null))['then'](function(_0x4d30c3){if(_0x4d30c3){_0x59a551['model']=_[_0x2f46('0x42')](db[_0x2f46('0x6d')][_0x2f46('0x57')]);_0x59a551[_0x2f46('0x43')]=_[_0x2f46('0x42')](_0x254818[_0x2f46('0x43')]);_0x59a551['filters']=_[_0x2f46('0x46')](_0x59a551[_0x2f46('0x41')],_0x59a551[_0x2f46('0x43')]);_0x3800d6[_0x2f46('0x45')]=_[_0x2f46('0x46')](_0x59a551[_0x2f46('0x41')],qs['fields'](_0x254818['query']['fields']));_0x3800d6[_0x2f46('0x45')]=_0x3800d6[_0x2f46('0x45')][_0x2f46('0x48')]?_0x3800d6[_0x2f46('0x45')]:_0x59a551['model'];if(!_0x254818['query'][_0x2f46('0x49')]('nolimit')){_0x3800d6[_0x2f46('0x2e')]=qs[_0x2f46('0x2e')](_0x254818[_0x2f46('0x43')][_0x2f46('0x2e')]);_0x3800d6['offset']=qs['offset'](_0x254818[_0x2f46('0x43')]['offset']);}_0x3800d6[_0x2f46('0x4b')]=qs[_0x2f46('0x4c')](_0x254818[_0x2f46('0x43')]['sort']);_0x3800d6[_0x2f46('0x4f')]=qs[_0x2f46('0x44')](_[_0x2f46('0x68')](_0x254818[_0x2f46('0x43')],_0x59a551['filters']));_0x3800d6['where'][_0x2f46('0x66')]=_0x4d30c3['id'];if(_0x254818[_0x2f46('0x43')]['filter']){_0x3800d6[_0x2f46('0x4f')]=_['merge'](_0x3800d6[_0x2f46('0x4f')],{'$or':_[_0x2f46('0x3d')](_0x3800d6[_0x2f46('0x45')],function(_0x390a74){var _0x52fc39={};_0x52fc39[_0x390a74]={'$like':'%'+_0x254818['query'][_0x2f46('0x4d')]+'%'};return _0x52fc39;})});}_0x3800d6=_[_0x2f46('0x4e')]({},_0x3800d6,_0x254818[_0x2f46('0x51')]);return db[_0x2f46('0x6d')]['count']({'where':_0x3800d6[_0x2f46('0x4f')]})['then'](function(_0x3b50ef){_0x2bdeba[_0x2f46('0x52')]=_0x3b50ef;if(_0x254818[_0x2f46('0x43')][_0x2f46('0x58')]){_0x3800d6[_0x2f46('0x59')]=[{'all':!![]}];}return db[_0x2f46('0x6d')][_0x2f46('0x69')](_0x3800d6);})[_0x2f46('0x1f')](function(_0x49dda7){_0x2bdeba['rows']=_0x49dda7;return _0x2bdeba;});}})[_0x2f46('0x1f')](respondWithFilteredResult(_0x444ce3,_0x3800d6))[_0x2f46('0x29')](handleError(_0x444ce3,null));};exports['removeAnswers']=function(_0x46cfda,_0x3dbe28,_0x3f031a){return db['FaxAccount'][_0x2f46('0x63')]({'where':{'id':_0x46cfda[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x3dbe28,null))[_0x2f46('0x1f')](function(_0x45d349){if(_0x45d349){return _0x45d349[_0x2f46('0x70')](_0x46cfda[_0x2f46('0x43')][_0x2f46('0x6b')]);}})['then'](respondWithStatusCode(_0x3dbe28,null))[_0x2f46('0x29')](handleError(_0x3dbe28,null));};exports[_0x2f46('0x71')]=function(_0x18808a,_0x4ed4b3,_0x3dbe99){return db[_0x2f46('0x72')][_0x2f46('0x63')]({'where':{'id':_0x18808a['params']['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x4ed4b3,null))[_0x2f46('0x1f')](function(_0x3c2703){if(_0x3c2703){return _0x3c2703[_0x2f46('0x71')](_0x18808a[_0x2f46('0x62')][_0x2f46('0x6b')],_[_0x2f46('0x73')](_0x18808a[_0x2f46('0x62')],[_0x2f46('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x4ed4b3,null))[_0x2f46('0x29')](handleError(_0x4ed4b3,null));};exports[_0x2f46('0x74')]=function(_0x5abdf6,_0x4ca19,_0x3f2d8c){var _0x4e08b7={'raw':![],'where':{}};var _0x2444ed={};var _0x1256a8={'count':0x0,'rows':[]};return db[_0x2f46('0x3e')]['findOne']({'where':{'id':_0x5abdf6[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x4ca19,null))[_0x2f46('0x1f')](function(_0x46c651){if(_0x46c651){_0x2444ed[_0x2f46('0x41')]=_[_0x2f46('0x42')](db[_0x2f46('0x72')][_0x2f46('0x57')]);_0x2444ed[_0x2f46('0x43')]=_[_0x2f46('0x42')](_0x5abdf6['query']);_0x2444ed['filters']=_[_0x2f46('0x46')](_0x2444ed[_0x2f46('0x41')],_0x2444ed[_0x2f46('0x43')]);_0x4e08b7['attributes']=_['intersection'](_0x2444ed['model'],qs[_0x2f46('0x47')](_0x5abdf6['query'][_0x2f46('0x47')]));_0x4e08b7[_0x2f46('0x45')]=_0x4e08b7['attributes'][_0x2f46('0x48')]?_0x4e08b7[_0x2f46('0x45')]:_0x2444ed[_0x2f46('0x41')];if(!_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x49')]('nolimit')){_0x4e08b7[_0x2f46('0x2e')]=qs['limit'](_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x2e')]);_0x4e08b7['offset']=qs[_0x2f46('0x2f')](_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x2f')]);}_0x4e08b7[_0x2f46('0x4b')]=qs[_0x2f46('0x4c')](_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x4c')]);_0x4e08b7[_0x2f46('0x4f')]=qs['filters'](_['pick'](_0x5abdf6[_0x2f46('0x43')],_0x2444ed[_0x2f46('0x44')]));_0x4e08b7[_0x2f46('0x4f')][_0x2f46('0x66')]=_0x46c651['id'];if(_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x4d')]){_0x4e08b7['where']=_[_0x2f46('0x4e')](_0x4e08b7[_0x2f46('0x4f')],{'$or':_[_0x2f46('0x3d')](_0x4e08b7[_0x2f46('0x45')],function(_0x24ce95){var _0x3e8ea5={};_0x3e8ea5[_0x24ce95]={'$like':'%'+_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x4d')]+'%'};return _0x3e8ea5;})});}_0x4e08b7=_['merge']({},_0x4e08b7,_0x5abdf6['options']);return db[_0x2f46('0x72')]['count']({'where':_0x4e08b7['where']})[_0x2f46('0x1f')](function(_0x16c236){_0x1256a8[_0x2f46('0x52')]=_0x16c236;if(_0x5abdf6[_0x2f46('0x43')]['includeAll']){_0x4e08b7[_0x2f46('0x59')]=[{'model':db[_0x2f46('0x75')],'as':_0x2f46('0x76'),'required':![]},{'model':db[_0x2f46('0x77')],'as':_0x2f46('0x78'),'attributes':[_0x2f46('0x3a'),'fullname',_0x2f46('0x79')],'required':![]},{'model':db[_0x2f46('0x7a')],'as':_0x2f46('0x7b'),'attributes':['id',_0x2f46('0x3a'),_0x2f46('0x7c')],'where':_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x7d')]?{'id':_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x7d')]}:undefined,'required':_0x5abdf6[_0x2f46('0x43')][_0x2f46('0x7d')]?!![]:![]}];}return db[_0x2f46('0x72')][_0x2f46('0x69')](_0x4e08b7);})['then'](function(_0x4c6cca){_0x1256a8[_0x2f46('0x53')]=_0x4c6cca;return _0x1256a8;});}})[_0x2f46('0x1f')](respondWithFilteredResult(_0x4ca19,_0x4e08b7))[_0x2f46('0x29')](handleError(_0x4ca19,null));};exports[_0x2f46('0x7e')]=function(_0x40d669,_0x52aeaa){var _0x35cd5a=_0x40d669[_0x2f46('0x55')]['id'];var _0x1e5421=_0x40d669['body'];var _0x74052=0xc8;var _0xc2ba1e=null;return db[_0x2f46('0x7f')][_0x2f46('0x80')]({'isolationLevel':db['sequelize'][_0x2f46('0x81')][_0x2f46('0x82')][_0x2f46('0x83')]},function(_0x3fe61b){return db[_0x2f46('0x3e')][_0x2f46('0x6f')]({'where':{'id':_0x35cd5a},'transaction':_0x3fe61b})[_0x2f46('0x1f')](function(_0x3b1882){if(_0x3b1882){return db[_0x2f46('0x84')]['destroy']({'where':{'FaxAccountId':_0x35cd5a},'transaction':_0x3fe61b})['then'](function(){var _0x3d722e=_[_0x2f46('0x3d')](_0x1e5421,function(_0x230641){_0x230641[_0x2f46('0x66')]=_0x35cd5a;return _0x230641;});return db[_0x2f46('0x84')][_0x2f46('0x85')](_0x3d722e,{'transaction':_0x3fe61b});});}else{_0x74052=0x194;_0xc2ba1e=[];}});})[_0x2f46('0x1f')](function(){if(_0x74052!==0x194){return db[_0x2f46('0x84')]['findAndCountAll']({'where':{'FaxAccountId':_0x35cd5a},'order':_0x2f46('0x86')})[_0x2f46('0x1f')](function(_0x1c5d4e){_0xc2ba1e=_0x1c5d4e;});}})[_0x2f46('0x29')](function(_0x333496){_0x74052=0x1f4;logger[_0x2f46('0x25')](_0x333496['stack']);if(_0x333496[_0x2f46('0x3a')]){delete _0x333496['name'];}_0xc2ba1e=_0x333496;})[_0x2f46('0x87')](function(){if(_0xc2ba1e===null){_0x52aeaa[_0x2f46('0x2a')](_0x74052);}else{if(_0x74052===0x1f4){_0x52aeaa[_0x2f46('0x2b')](_0x74052)[_0x2f46('0x88')](_0xc2ba1e);}else{_0x52aeaa[_0x2f46('0x2b')](_0x74052)[_0x2f46('0x2c')](_0xc2ba1e);}}});};exports[_0x2f46('0x89')]=function(_0xc21fdd,_0x587e40,_0xdf8278){var _0x374847={};var _0x39e3df={};var _0x4af415;var _0x399f55;return db[_0x2f46('0x3e')]['findOne']({'where':{'id':_0xc21fdd[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x587e40,null))[_0x2f46('0x1f')](function(_0x3af3d9){if(_0x3af3d9){_0x4af415=_0x3af3d9;_0x39e3df[_0x2f46('0x41')]=_['keys'](db[_0x2f46('0x84')][_0x2f46('0x57')]);_0x39e3df[_0x2f46('0x43')]=_['keys'](_0xc21fdd['query']);_0x39e3df[_0x2f46('0x44')]=_[_0x2f46('0x46')](_0x39e3df[_0x2f46('0x41')],_0x39e3df[_0x2f46('0x43')]);_0x374847[_0x2f46('0x45')]=_['intersection'](_0x39e3df[_0x2f46('0x41')],qs[_0x2f46('0x47')](_0xc21fdd['query'][_0x2f46('0x47')]));_0x374847[_0x2f46('0x45')]=_0x374847[_0x2f46('0x45')][_0x2f46('0x48')]?_0x374847['attributes']:_0x39e3df[_0x2f46('0x41')];_0x374847[_0x2f46('0x4b')]=qs[_0x2f46('0x4c')](_0xc21fdd['query'][_0x2f46('0x4c')]);_0x374847[_0x2f46('0x4f')]=qs[_0x2f46('0x44')](_[_0x2f46('0x68')](_0xc21fdd[_0x2f46('0x43')],_0x39e3df['filters']));if(_0xc21fdd[_0x2f46('0x43')][_0x2f46('0x4d')]){_0x374847[_0x2f46('0x4f')]=_[_0x2f46('0x4e')](_0x374847[_0x2f46('0x4f')],{'$or':_[_0x2f46('0x3d')](_0x374847[_0x2f46('0x45')],function(_0x56385d){var _0x20e3c2={};_0x20e3c2[_0x56385d]={'$like':'%'+_0xc21fdd[_0x2f46('0x43')][_0x2f46('0x4d')]+'%'};return _0x20e3c2;})});}_0x374847=_[_0x2f46('0x4e')]({},_0x374847,_0xc21fdd[_0x2f46('0x51')]);return _0x4af415['getApplications'](_0x374847);}})[_0x2f46('0x1f')](function(_0x322460){if(_0x322460){_0x399f55=_0x322460['length'];if(!_0xc21fdd[_0x2f46('0x43')]['hasOwnProperty'](_0x2f46('0x4a'))){_0x374847[_0x2f46('0x2e')]=qs['limit'](_0xc21fdd['query']['limit']);_0x374847[_0x2f46('0x2f')]=qs[_0x2f46('0x2f')](_0xc21fdd[_0x2f46('0x43')][_0x2f46('0x2f')]);}return _0x4af415[_0x2f46('0x89')](_0x374847);}})['then'](function(_0x2d9d9e){if(_0x2d9d9e){return _0x2d9d9e?{'count':_0x399f55,'rows':_0x2d9d9e}:null;}})[_0x2f46('0x1f')](respondWithResult(_0x587e40,null))[_0x2f46('0x29')](handleError(_0x587e40,null));};function Extension(_0x53fe78,_0x2759e4,_0x3a52db,_0x463e61){this[_0x2f46('0x8a')]=_0x2f46('0x8b');this['exten']=_0x53fe78['localstationid'];this[_0x2f46('0x8c')]=_0x463e61;this[_0x2f46('0x40')]='system';this['description']='Fax\x20Extension';this['FaxAccountId']=_0x53fe78['id'];this['priority']=_0x2759e4;this[_0x2f46('0x8d')]=_0x3a52db;}function createExtensionsReciveFax(_0x21c7ce){var _0x2eef0e=0x1;var _0x2d9420=[];_0x2d9420['push'](new Extension(_0x21c7ce,_0x2eef0e,'',_0x2f46('0x8e')));_0x2eef0e+=0x1;_0x2d9420['push'](new Extension(_0x21c7ce,_0x2eef0e,_0x2f46('0x8f'),_0x2f46('0x90')));_0x2eef0e+=0x1;for(var _0x7c38c5 in _0x21c7ce){if(_0x21c7ce[_0x2f46('0x49')](_0x7c38c5)&&(_0x7c38c5===_0x2f46('0x91')||_0x7c38c5==='localstationid'||_0x7c38c5===_0x2f46('0x92')||_0x7c38c5==='faxdetect'||_0x7c38c5===_0x2f46('0x93')||_0x7c38c5==='maxrate'||_0x7c38c5===_0x2f46('0x94')||_0x7c38c5===_0x2f46('0x95')||_0x7c38c5==='t38timeout')){_0x2d9420[_0x2f46('0x96')](new Extension(_0x21c7ce,_0x2eef0e,_0x2f46('0x97')+_0x7c38c5+')='+_0x21c7ce[_0x7c38c5],_0x2f46('0x90')));_0x2eef0e+=0x1;}}_0x2d9420[_0x2f46('0x96')](new Extension(_0x21c7ce,_0x2eef0e,'6',_0x2f46('0x98')));_0x2eef0e+=0x1;_0x2d9420['push'](new Extension(_0x21c7ce,_0x2eef0e,_0x2f46('0x99'),_0x2f46('0x9a')));_0x2eef0e=0x0;return _0x2d9420;}exports[_0x2f46('0x9b')]=function(_0x569b92,_0x2b6f9b,_0x3c70d7){var _0x2c3961;return db[_0x2f46('0x7f')]['transaction'](function(_0x2f9a8d){return db[_0x2f46('0x3e')][_0x2f46('0x5a')](_0x569b92[_0x2f46('0x62')],{'transaction':_0x2f9a8d})[_0x2f46('0x1f')](function(_0x2fdbf4){_0x2c3961=_0x2fdbf4[_0x2f46('0x35')]({'plain':!![]});return db[_0x2f46('0x9c')][_0x2f46('0x85')](createExtensionsReciveFax(_0x2c3961),{'transaction':_0x2f9a8d});});})[_0x2f46('0x1f')](function(){return _0x2c3961;})['then'](respondWithResult(_0x2b6f9b,null))[_0x2f46('0x29')](handleError(_0x2b6f9b,null));};exports['updateAccountApplications']=function(_0x40c422,_0x542c21,_0x5dbcd3){var _0x30e3fd;return db[_0x2f46('0x7f')][_0x2f46('0x80')](function(_0x4f8e79){return db[_0x2f46('0x3e')][_0x2f46('0x34')](_0x40c422['body'],{'where':{'id':_0x40c422[_0x2f46('0x62')]['id']},'transaction':_0x4f8e79})['then'](function(_0x302928){return db[_0x2f46('0x9c')]['destroy']({'where':{'FaxAccountId':_0x40c422[_0x2f46('0x62')]['id']},'transaction':_0x4f8e79})[_0x2f46('0x1f')](function(_0x28ed18){return db[_0x2f46('0x9c')][_0x2f46('0x85')](createExtensionsReciveFax(_[_0x2f46('0x73')](_0x40c422[_0x2f46('0x62')],['tech',_0x2f46('0x9d'),_0x2f46('0x9e'),_0x2f46('0x9f'),'TrunkId',_0x2f46('0xa0')])),{'transaction':_0x4f8e79});});});})[_0x2f46('0x1f')](function(){return db[_0x2f46('0x3e')][_0x2f46('0xa1')](_0x40c422['body']['id']);})[_0x2f46('0x1f')](respondWithResult(_0x542c21,null))[_0x2f46('0x29')](handleError(_0x542c21,null));};exports['getMessages']=function(_0x2ef246,_0x199336,_0x9254cb){var _0x13c20a={'raw':!![],'where':{}};var _0x30ae58={};var _0x1835cd={'count':0x0,'rows':[]};return db[_0x2f46('0x3e')][_0x2f46('0x6f')]({'where':{'id':_0x2ef246[_0x2f46('0x55')]['id']}})['then'](handleEntityNotFound(_0x199336,null))[_0x2f46('0x1f')](function(_0x5a83bb){if(_0x5a83bb){_0x30ae58[_0x2f46('0x41')]=_[_0x2f46('0x42')](db[_0x2f46('0xa2')][_0x2f46('0x57')]);_0x30ae58[_0x2f46('0x43')]=_[_0x2f46('0x42')](_0x2ef246['query']);_0x30ae58[_0x2f46('0x44')]=_['intersection'](_0x30ae58[_0x2f46('0x41')],_0x30ae58[_0x2f46('0x43')]);_0x13c20a[_0x2f46('0x45')]=_[_0x2f46('0x46')](_0x30ae58['model'],qs[_0x2f46('0x47')](_0x2ef246[_0x2f46('0x43')]['fields']));_0x13c20a[_0x2f46('0x45')]=_0x13c20a[_0x2f46('0x45')][_0x2f46('0x48')]?_0x13c20a[_0x2f46('0x45')]:_0x30ae58[_0x2f46('0x41')];if(!_0x2ef246[_0x2f46('0x43')]['hasOwnProperty']('nolimit')){_0x13c20a[_0x2f46('0x2e')]=qs[_0x2f46('0x2e')](_0x2ef246[_0x2f46('0x43')]['limit']);_0x13c20a['offset']=qs[_0x2f46('0x2f')](_0x2ef246[_0x2f46('0x43')]['offset']);}_0x13c20a[_0x2f46('0x4b')]=qs['sort'](_0x2ef246['query'][_0x2f46('0x4c')]);_0x13c20a['where']=qs['filters'](_[_0x2f46('0x68')](_0x2ef246[_0x2f46('0x43')],_0x30ae58[_0x2f46('0x44')]));_0x13c20a[_0x2f46('0x4f')]['FaxAccountId']=_0x5a83bb['id'];if(_0x2ef246[_0x2f46('0x43')]['filter']){_0x13c20a[_0x2f46('0x4f')]=_[_0x2f46('0x4e')](_0x13c20a[_0x2f46('0x4f')],{'$or':_[_0x2f46('0x3d')](_0x13c20a[_0x2f46('0x45')],function(_0x1c7c6a){var _0xd26a3={};_0xd26a3[_0x1c7c6a]={'$like':'%'+_0x2ef246[_0x2f46('0x43')][_0x2f46('0x4d')]+'%'};return _0xd26a3;})});}if(_0x2ef246[_0x2f46('0x43')][_0x2f46('0xa3')]){var _0x29b10e=_0x2ef246[_0x2f46('0x43')][_0x2f46('0xa3')][_0x2f46('0xa4')](',');var _0x7e939a={};_0x7e939a[_0x29b10e[0x0]]={'$gte':moment(_0x29b10e[0x1])[_0x2f46('0xa5')](_0x2f46('0xa6'))};_0x13c20a['where']=_['merge'](_0x13c20a[_0x2f46('0x4f')],_0x7e939a);}_0x13c20a=_[_0x2f46('0x4e')]({},_0x13c20a,_0x2ef246['options']);return db[_0x2f46('0xa2')][_0x2f46('0x52')]({'where':_0x13c20a[_0x2f46('0x4f')]})['then'](function(_0x436636){_0x1835cd[_0x2f46('0x52')]=_0x436636;if(_0x2ef246[_0x2f46('0x43')][_0x2f46('0x58')]){_0x13c20a[_0x2f46('0x59')]=[{'all':!![]}];}return db['FaxMessage'][_0x2f46('0x69')](_0x13c20a);})[_0x2f46('0x1f')](function(_0x583692){_0x1835cd[_0x2f46('0x53')]=_0x583692;return _0x1835cd;});}})['then'](respondWithFilteredResult(_0x199336,_0x13c20a))[_0x2f46('0x29')](handleError(_0x199336,null));};exports[_0x2f46('0x88')]=function(_0x426e4b,_0x257bd2,_0x33b790){var _0x10b271,_0x5c30c5={},_0x21bd83;if(_0x426e4b[_0x2f46('0x62')]['to']){_0x21bd83=_0x426e4b['body']['to'][0x0];}return db[_0x2f46('0x3e')][_0x2f46('0x63')]({'where':{'id':_0x426e4b[_0x2f46('0x55')]['id']},'include':[{'model':db[_0x2f46('0xa7')],'as':_0x2f46('0xa8'),'include':[{'model':db[_0x2f46('0x75')],'as':_0x2f46('0xa9'),'where':{'fax':_0x21bd83},'limit':0x1,'order':[[_0x2f46('0x9f'),'DESC']]}]}]})[_0x2f46('0x1f')](handleEntityNotFound(_0x257bd2,null))[_0x2f46('0x1f')](function(_0x56e923){_0x10b271=_0x56e923;if(_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')]&&_0x426e4b['body']['attachments'][_0x2f46('0x48')]){for(var _0x1d8f5d=0x0;_0x1d8f5d<_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')][_0x2f46('0x48')];_0x1d8f5d+=0x1){_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')][_0x1d8f5d]={'filename':_0x426e4b[_0x2f46('0x62')]['attachments'][_0x1d8f5d][_0x2f46('0x3a')],'id':_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')][_0x1d8f5d]['id'],'path':path[_0x2f46('0xab')](config[_0x2f46('0xac')],_0x2f46('0xad'),_0x426e4b['body'][_0x2f46('0xaa')][_0x1d8f5d][_0x2f46('0xae')])};}}return respondWithRpcPromise('CheckAfterSend',_0x2f46('0xaf'),{'FaxAccountId':_[_0x2f46('0xb0')](_0x426e4b[_0x2f46('0x55')]['id'])?undefined:_0x426e4b[_0x2f46('0x55')]['id'],'path':_[_0x2f46('0xb0')](_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')][0x0][_0x2f46('0x7')])?undefined:_0x426e4b[_0x2f46('0x62')]['attachments'][0x0][_0x2f46('0x7')],'fax':_[_0x2f46('0xb0')](_0x426e4b[_0x2f46('0x62')]['to'][0x0])?undefined:_0x426e4b[_0x2f46('0x62')]['to'][0x0]},client9002);})[_0x2f46('0x1f')](function(){if(_0x10b271){if(_['isNil'](_0x426e4b[_0x2f46('0x62')][_0x2f46('0xb1')])){_0x426e4b['body'][_0x2f46('0xb1')]=util['format']('\x22%s\x22\x20<%s>',_0x10b271['name'],_0x10b271[_0x2f46('0xb2')]);}if(_0x10b271[_0x2f46('0xa8')]){if(_0x10b271[_0x2f46('0xa8')]['Contacts'][_0x2f46('0x48')]){return _0x10b271['List'][_0x2f46('0xa9')][0x0];}else{return db[_0x2f46('0x75')][_0x2f46('0x5a')](_[_0x2f46('0xb3')](_0x426e4b[_0x2f46('0x62')],{'firstName':_0x426e4b['body']['to'][0x0],'phone':_0x426e4b[_0x2f46('0x62')]['to'][0x0],'fax':_0x426e4b[_0x2f46('0x62')]['to'][0x0],'ListId':_0x10b271[_0x2f46('0xa0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x2f46('0xb4'));}})[_0x2f46('0x1f')](function(_0x4c1704){if(_0x4c1704){return db[_0x2f46('0x72')]['find']({'where':{'ContactId':_0x4c1704['id'],'closed':![],'FaxAccountId':_0x10b271['id']}})[_0x2f46('0x1f')](function(_0x3f1942){if(_0x3f1942){return[_0x3f1942,![]];}return db[_0x2f46('0x72')][_0x2f46('0x5a')]({'UserId':_0x426e4b[_0x2f46('0x5b')]['id'],'ContactId':_0x4c1704['id'],'FaxAccountId':_0x10b271['id'],'fax':_0x426e4b[_0x2f46('0x62')]['to'][0x0],'firstMsgDirection':_0x2f46('0xb5'),'Messages':[_['merge'](_0x426e4b[_0x2f46('0x62')],{'read':![],'body':_0x426e4b[_0x2f46('0x62')]['attachments'][0x0][_0x2f46('0xb6')],'FaxAccountId':_0x10b271['id'],'UserId':_0x426e4b[_0x2f46('0x5b')]['id'],'ContactId':_0x4c1704['id'],'AttachmentId':_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x2f46('0xa2')],'as':_0x2f46('0xb7')}]})[_0x2f46('0x1f')](function(_0x1d44d4){return[_0x1d44d4,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x2f46('0xb8')](function(_0x4a1646,_0x24cbd6){if(_0x24cbd6){return _0x4a1646;}return db[_0x2f46('0xa2')][_0x2f46('0x5a')]({'direction':'out','read':![],'body':_0x426e4b[_0x2f46('0x62')]['attachments'][0x0][_0x2f46('0xb6')],'FaxAccountId':_0x10b271['id'],'FaxInteractionId':_0x4a1646['id'],'UserId':_0x426e4b[_0x2f46('0x5b')]['id'],'ContactId':_0x4a1646['ContactId'],'AttachmentId':_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')][0x0]['id']})[_0x2f46('0x1f')](function(_0x522c48){_0x4a1646[_0x2f46('0xb9')]['Messages']=[];_0x4a1646[_0x2f46('0xb9')]['Messages'][_0x2f46('0x96')](_0x522c48[_0x2f46('0xb9')]);return _0x4a1646;});})['then'](function(_0x41288a){respondWithRpcPromise(_0x2f46('0xba'),_0x2f46('0xba'),{'FaxAccountId':_[_0x2f46('0xb0')](_0x426e4b[_0x2f46('0x55')]['id'])?undefined:_0x426e4b[_0x2f46('0x55')]['id'],'path':_[_0x2f46('0xb0')](_0x426e4b['body']['attachments'][0x0]['path'])?undefined:_0x426e4b[_0x2f46('0x62')][_0x2f46('0xaa')][0x0][_0x2f46('0x7')],'fax':_['isNil'](_0x426e4b[_0x2f46('0x62')]['to'][0x0])?undefined:_0x426e4b[_0x2f46('0x62')]['to'][0x0],'AttachmentId':_0x426e4b[_0x2f46('0x62')]['attachments'][0x0]['id']},client9002)['then'](function(_0x2a193d){logger['info'](_0x2f46('0xbb'),_0x2a193d);})[_0x2f46('0x29')](function(_0x11486a){logger['info'](_0x2f46('0xbb'),_0x11486a);});return _0x41288a;})[_0x2f46('0x1f')](respondWithResult(_0x257bd2,null))[_0x2f46('0x29')](handleError(_0x257bd2,null));};exports['addAgents']=function(_0x25d0d1,_0x1d6990,_0x21fe4a){return db['FaxAccount']['find']({'where':{'id':_0x25d0d1['params']['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x1d6990,null))['then'](function(_0x9347be){if(_0x9347be){return _0x9347be[_0x2f46('0xbc')](_0x25d0d1[_0x2f46('0x62')][_0x2f46('0x6b')],_[_0x2f46('0x73')](_0x25d0d1[_0x2f46('0x62')],[_0x2f46('0x6b'),'id'])||{})[_0x2f46('0xb8')](function(_0x4fc440){for(var _0x5f23be=0x0;_0x5f23be<_0x25d0d1['body'][_0x2f46('0x6b')][_0x2f46('0x48')];_0x5f23be+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x25d0d1['body'][_0x2f46('0x6b')][_0x5f23be]),'FaxAccountId':Number(_0x25d0d1[_0x2f46('0x55')]['id'])});}return _0x4fc440;});}})[_0x2f46('0x1f')](respondWithResult(_0x1d6990,null))[_0x2f46('0x29')](handleError(_0x1d6990,null));};exports[_0x2f46('0xbd')]=function(_0x233eb7,_0x5a7639,_0x36d30d){return db[_0x2f46('0x3e')]['find']({'where':{'id':_0x233eb7[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x5a7639,null))[_0x2f46('0x1f')](function(_0x412684){if(_0x412684){return _0x412684[_0x2f46('0xbd')](_0x233eb7[_0x2f46('0x43')]['ids'])[_0x2f46('0x1f')](function(){if(_['isArray'](_0x233eb7['query'][_0x2f46('0x6b')])){for(var _0x4fadff=0x0;_0x4fadff<_0x233eb7[_0x2f46('0x43')]['ids']['length'];_0x4fadff+=0x1){socket[_0x2f46('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x233eb7['query'][_0x2f46('0x6b')][_0x4fadff]),'FaxAccountId':Number(_0x233eb7[_0x2f46('0x55')]['id'])});}}else{socket['emit'](_0x2f46('0xbf'),{'UserId':Number(_0x233eb7[_0x2f46('0x43')][_0x2f46('0x6b')]),'FaxAccountId':Number(_0x233eb7[_0x2f46('0x55')]['id'])});}});}})[_0x2f46('0x1f')](respondWithStatusCode(_0x5a7639,null))[_0x2f46('0x29')](handleError(_0x5a7639,null));};exports[_0x2f46('0xc0')]=function(_0x20d305,_0x45c504,_0x1fe44c){var _0x389945={};var _0x2d8eb9={};var _0x48503a;var _0x307513;return db[_0x2f46('0x3e')]['findOne']({'where':{'id':_0x20d305[_0x2f46('0x55')]['id']}})[_0x2f46('0x1f')](handleEntityNotFound(_0x45c504,null))['then'](function(_0x403b2e){if(_0x403b2e){_0x48503a=_0x403b2e;_0x2d8eb9[_0x2f46('0x41')]=_[_0x2f46('0x42')](db[_0x2f46('0x77')]['rawAttributes']);_0x2d8eb9[_0x2f46('0x43')]=_[_0x2f46('0x42')](_0x20d305[_0x2f46('0x43')]);_0x2d8eb9[_0x2f46('0x44')]=_[_0x2f46('0x46')](_0x2d8eb9['model'],_0x2d8eb9['query']);_0x389945[_0x2f46('0x45')]=_[_0x2f46('0x46')](_0x2d8eb9[_0x2f46('0x41')],qs[_0x2f46('0x47')](_0x20d305['query'][_0x2f46('0x47')]));_0x389945['attributes']=_0x389945[_0x2f46('0x45')][_0x2f46('0x48')]?_0x389945['attributes']:_0x2d8eb9[_0x2f46('0x41')];_0x389945[_0x2f46('0x4b')]=qs[_0x2f46('0x4c')](_0x20d305[_0x2f46('0x43')][_0x2f46('0x4c')]);_0x389945[_0x2f46('0x4f')]=qs[_0x2f46('0x44')](_['pick'](_0x20d305['query'],_0x2d8eb9[_0x2f46('0x44')]));if(_0x20d305[_0x2f46('0x43')]['filter']){_0x389945['where']=_[_0x2f46('0x4e')](_0x389945[_0x2f46('0x4f')],{'$or':_[_0x2f46('0x3d')](_0x389945['attributes'],function(_0xa80dd4){var _0x1e72a0={};_0x1e72a0[_0xa80dd4]={'$like':'%'+_0x20d305[_0x2f46('0x43')][_0x2f46('0x4d')]+'%'};return _0x1e72a0;})});}_0x389945=_['merge']({},_0x389945,_0x20d305[_0x2f46('0x51')]);return _0x48503a['getAgents'](_0x389945);}})[_0x2f46('0x1f')](function(_0x18a830){if(_0x18a830){_0x307513=_0x18a830[_0x2f46('0x48')];if(!_0x20d305['query'][_0x2f46('0x49')]('nolimit')){_0x389945[_0x2f46('0x2e')]=qs[_0x2f46('0x2e')](_0x20d305['query'][_0x2f46('0x2e')]);_0x389945[_0x2f46('0x2f')]=qs[_0x2f46('0x2f')](_0x20d305['query'][_0x2f46('0x2f')]);}return _0x48503a[_0x2f46('0xc0')](_0x389945);}})[_0x2f46('0x1f')](function(_0x28b104){if(_0x28b104){return _0x28b104?{'count':_0x307513,'rows':_0x28b104}:null;}})[_0x2f46('0x1f')](respondWithResult(_0x45c504,null))[_0x2f46('0x29')](handleError(_0x45c504,null));};
\ No newline at end of file
+var _0x55b0=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','get','FaxAccounts','destroy','stack','name','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','filters','find','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','push','Set','ecm','gateway','faxdetect','maxrate','t38timeout','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','omit','tech','key','createdAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','send','CmList','List','Contacts','updatedAt','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x55b0,0x173));var _0x055b=function(_0x230f8d,_0x8a9d7b){_0x230f8d=_0x230f8d-0x0;var _0x34512f=_0x55b0[_0x230f8d];return _0x34512f;};'use strict';var emlformat=require(_0x055b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x055b('0x1'));var jsonpatch=require(_0x055b('0x2'));var rp=require(_0x055b('0x3'));var moment=require(_0x055b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x055b('0x5'));var util=require(_0x055b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x055b('0x7'));var ejs=require(_0x055b('0x8'));var fs=require('fs');var fs_extra=require(_0x055b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x055b('0xa'));var jsforce=require(_0x055b('0xb'));var deskjs=require(_0x055b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x055b('0xd'));var Papa=require(_0x055b('0xe'));var Redis=require(_0x055b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x055b('0x10'));var logger=require(_0x055b('0x11'))(_0x055b('0x12'));var utils=require(_0x055b('0x13'));var config=require(_0x055b('0x14'));var licenseUtil=require(_0x055b('0x15'));var db=require('../../mysqldb')['db'];config[_0x055b('0x16')]=_['defaults'](config[_0x055b('0x16')],{'host':_0x055b('0x17'),'port':0x18eb});var socket=require(_0x055b('0x18'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x055b('0x19')](socket);var jayson=require(_0x055b('0x1a'));var client=jayson[_0x055b('0x1b')][_0x055b('0x1c')]({'port':0x232c});var client9002=jayson[_0x055b('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2609af,_0x5cb7c4,_0x397e5e,_0x2c0c90){return new BPromise(function(_0x3a2385,_0x56a6df){var _0x5d3e4b=_0x2c0c90||client;return _0x5d3e4b['request'](_0x2609af,_0x397e5e)[_0x055b('0x1d')](function(_0x56b59e){logger[_0x055b('0x1e')](_0x055b('0x1f'),_0x5cb7c4,_0x055b('0x20'));logger[_0x055b('0x21')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5cb7c4,_0x055b('0x20'),JSON[_0x055b('0x22')](_0x56b59e));if(_0x56b59e[_0x055b('0x23')]){if(_0x56b59e[_0x055b('0x23')][_0x055b('0x24')]===0x1f4){logger[_0x055b('0x23')](_0x055b('0x1f'),_0x5cb7c4,_0x56b59e['error'][_0x055b('0x25')]);return _0x56a6df(_0x56b59e['error'][_0x055b('0x25')]);}logger[_0x055b('0x23')]('FaxAccount,\x20%s,\x20%s',_0x5cb7c4,_0x56b59e[_0x055b('0x23')][_0x055b('0x25')]);return _0x3a2385(_0x56b59e[_0x055b('0x23')][_0x055b('0x25')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x5cb7c4,_0x055b('0x20'));_0x3a2385(_0x56b59e[_0x055b('0x26')]['message']);}})[_0x055b('0x27')](function(_0xb1396c){logger[_0x055b('0x23')](_0x055b('0x1f'),_0x5cb7c4,_0xb1396c);_0x56a6df(_0xb1396c);});});}function respondWithStatusCode(_0x1bb8a0,_0x5bceb7){_0x5bceb7=_0x5bceb7||0xcc;return function(_0xf8aab2){if(_0xf8aab2){return _0x1bb8a0[_0x055b('0x28')](_0x5bceb7);}return _0x1bb8a0['status'](_0x5bceb7)[_0x055b('0x29')]();};}function respondWithResult(_0x553eb1,_0x6d90a1){_0x6d90a1=_0x6d90a1||0xc8;return function(_0x1f2aa4){if(_0x1f2aa4){return _0x553eb1[_0x055b('0x2a')](_0x6d90a1)[_0x055b('0x2b')](_0x1f2aa4);}};}function respondWithFilteredResult(_0x2ec63a,_0x2f3ab8){return function(_0x2db2c3){if(_0x2db2c3){var _0x290a86=typeof _0x2f3ab8[_0x055b('0x2c')]===_0x055b('0x2d')&&typeof _0x2f3ab8['limit']===_0x055b('0x2d');var _0x78bd86=_0x2db2c3[_0x055b('0x2e')];var _0x238213=_0x290a86?0x0:_0x2f3ab8[_0x055b('0x2c')];var _0x5bf314=_0x290a86?_0x2db2c3['count']:_0x2f3ab8['offset']+_0x2f3ab8[_0x055b('0x2f')];var _0x5ec256;if(_0x5bf314>=_0x78bd86){_0x5bf314=_0x78bd86;_0x5ec256=0xc8;}else{_0x5ec256=0xce;}_0x2ec63a[_0x055b('0x2a')](_0x5ec256);return _0x2ec63a[_0x055b('0x30')]('Content-Range',_0x238213+'-'+_0x5bf314+'/'+_0x78bd86)[_0x055b('0x2b')](_0x2db2c3);}return null;};}function patchUpdates(_0x5c948d){return function(_0x3562be){try{jsonpatch[_0x055b('0x31')](_0x3562be,_0x5c948d,!![]);}catch(_0x3f7b04){return BPromise[_0x055b('0x32')](_0x3f7b04);}return _0x3562be['save']();};}function saveUpdates(_0xf43cd7,_0x3c616a){return function(_0x106254){if(_0x106254){return _0x106254[_0x055b('0x33')](_0xf43cd7)[_0x055b('0x1d')](function(_0x65ac79){return _0x65ac79;});}return null;};}function removeEntity(_0xb55441,_0x903537){return function(_0x42b495){if(_0x42b495){return _0x42b495['destroy']()[_0x055b('0x1d')](function(){var _0x3b61e5=_0x42b495[_0x055b('0x34')]({'plain':!![]});var _0x10dd89=_0x055b('0x35');return db['UserProfileResource'][_0x055b('0x36')]({'where':{'type':_0x10dd89,'resourceId':_0x3b61e5['id']}})[_0x055b('0x1d')](function(){return _0x42b495;});})[_0x055b('0x1d')](function(){_0xb55441['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c0640,_0x5bc1be){return function(_0xe1dbe2){if(!_0xe1dbe2){_0x4c0640['sendStatus'](0x194);}return _0xe1dbe2;};}function handleError(_0x335c24,_0x3bda5a){_0x3bda5a=_0x3bda5a||0x1f4;return function(_0x539111){logger[_0x055b('0x23')](_0x539111[_0x055b('0x37')]);if(_0x539111['name']){delete _0x539111[_0x055b('0x38')];}_0x335c24[_0x055b('0x2a')](_0x3bda5a)['send'](_0x539111);};}exports['index']=function(_0x247f7e,_0x4c0c41){var _0x2f6075={'include':[{'model':db[_0x055b('0x39')],'as':_0x055b('0x3a')}]},_0x1b1265={},_0x6a13b2={'count':0x0,'rows':[]};var _0x297f75=_[_0x055b('0x3b')](db[_0x055b('0x3c')][_0x055b('0x3d')],function(_0x3cc119){return{'name':_0x3cc119[_0x055b('0x3e')],'type':_0x3cc119[_0x055b('0x3f')]['key']};});_0x1b1265[_0x055b('0x40')]=_[_0x055b('0x3b')](_0x297f75,_0x055b('0x38'));_0x1b1265['query']=_[_0x055b('0x41')](_0x247f7e[_0x055b('0x42')]);_0x1b1265['filters']=_[_0x055b('0x43')](_0x1b1265[_0x055b('0x40')],_0x1b1265[_0x055b('0x42')]);_0x2f6075[_0x055b('0x44')]=_['intersection'](_0x1b1265[_0x055b('0x40')],qs[_0x055b('0x45')](_0x247f7e[_0x055b('0x42')][_0x055b('0x45')]));_0x2f6075[_0x055b('0x44')]=_0x2f6075[_0x055b('0x44')][_0x055b('0x46')]?_0x2f6075[_0x055b('0x44')]:_0x1b1265[_0x055b('0x40')];if(!_0x247f7e[_0x055b('0x42')][_0x055b('0x47')](_0x055b('0x48'))){_0x2f6075[_0x055b('0x2f')]=qs['limit'](_0x247f7e[_0x055b('0x42')][_0x055b('0x2f')]);_0x2f6075[_0x055b('0x2c')]=qs[_0x055b('0x2c')](_0x247f7e[_0x055b('0x42')][_0x055b('0x2c')]);}_0x2f6075[_0x055b('0x49')]=qs[_0x055b('0x4a')](_0x247f7e[_0x055b('0x42')]['sort']);_0x2f6075[_0x055b('0x4b')]=qs['filters'](_[_0x055b('0x4c')](_0x247f7e[_0x055b('0x42')],_0x1b1265['filters']),_0x297f75);if(_0x247f7e['query'][_0x055b('0x4d')]){_0x2f6075[_0x055b('0x4b')]=_['merge'](_0x2f6075['where'],{'$or':_['map'](_0x297f75,function(_0x2113a2){if(_0x2113a2['type']!==_0x055b('0x4e')){var _0x3def4f={};_0x3def4f[_0x2113a2['name']]={'$like':'%'+_0x247f7e[_0x055b('0x42')]['filter']+'%'};return _0x3def4f;}})});}_0x2f6075=_[_0x055b('0x4f')]({},_0x2f6075,_0x247f7e[_0x055b('0x50')]);var _0x5cacfe={'where':_0x2f6075['where']};return db[_0x055b('0x3c')][_0x055b('0x2e')](_0x5cacfe)[_0x055b('0x1d')](function(_0x4fcf63){_0x6a13b2[_0x055b('0x2e')]=_0x4fcf63;if(_0x247f7e[_0x055b('0x42')][_0x055b('0x51')]){_0x2f6075[_0x055b('0x52')]=[{'all':!![]}];}return db[_0x055b('0x3c')][_0x055b('0x53')](_0x2f6075);})['then'](function(_0x381b23){_0x6a13b2['rows']=_0x381b23;return _0x6a13b2;})[_0x055b('0x1d')](respondWithFilteredResult(_0x4c0c41,_0x2f6075))[_0x055b('0x27')](handleError(_0x4c0c41,null));};exports[_0x055b('0x54')]=function(_0x4c68b9,_0x1b0844){var _0x44eb3f={'raw':![],'where':{'id':_0x4c68b9[_0x055b('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x055b('0x3a')}]},_0x347939={};_0x347939[_0x055b('0x40')]=_[_0x055b('0x41')](db['FaxAccount'][_0x055b('0x3d')]);_0x347939[_0x055b('0x42')]=_['keys'](_0x4c68b9[_0x055b('0x42')]);_0x347939[_0x055b('0x56')]=_[_0x055b('0x43')](_0x347939[_0x055b('0x40')],_0x347939[_0x055b('0x42')]);_0x44eb3f[_0x055b('0x44')]=_['intersection'](_0x347939[_0x055b('0x40')],qs[_0x055b('0x45')](_0x4c68b9['query'][_0x055b('0x45')]));_0x44eb3f[_0x055b('0x44')]=_0x44eb3f[_0x055b('0x44')][_0x055b('0x46')]?_0x44eb3f[_0x055b('0x44')]:_0x347939['model'];if(_0x4c68b9[_0x055b('0x42')]['includeAll']){_0x44eb3f[_0x055b('0x52')]=[{'all':!![]}];}_0x44eb3f=_[_0x055b('0x4f')]({},_0x44eb3f,_0x4c68b9[_0x055b('0x50')]);return db[_0x055b('0x3c')][_0x055b('0x57')](_0x44eb3f)['then'](handleEntityNotFound(_0x1b0844,null))[_0x055b('0x1d')](respondWithResult(_0x1b0844,null))[_0x055b('0x27')](handleError(_0x1b0844,null));};exports[_0x055b('0x58')]=function(_0x3e11ca,_0x387db8){return db[_0x055b('0x3c')]['create'](_0x3e11ca[_0x055b('0x59')],{})['then'](function(_0x430024){var _0xfaddc=_0x3e11ca[_0x055b('0x5a')][_0x055b('0x34')]({'plain':!![]});if(!_0xfaddc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfaddc['role']===_0x055b('0x5a')){var _0x3c30ff=_0x430024[_0x055b('0x34')]({'plain':!![]});var _0x5a81b2=_0x055b('0x35');return db['UserProfileSection'][_0x055b('0x57')]({'where':{'name':_0x5a81b2,'userProfileId':_0xfaddc[_0x055b('0x5b')]},'raw':!![]})[_0x055b('0x1d')](function(_0x1875a2){if(_0x1875a2&&_0x1875a2['autoAssociation']===0x0){return db['UserProfileResource'][_0x055b('0x58')]({'name':_0x3c30ff['name'],'resourceId':_0x3c30ff['id'],'type':_0x1875a2[_0x055b('0x38')],'sectionId':_0x1875a2['id']},{})[_0x055b('0x1d')](function(){return _0x430024;});}else{return _0x430024;}})[_0x055b('0x27')](function(_0x37a8aa){logger[_0x055b('0x23')](_0x055b('0x5c'),_0x37a8aa);throw _0x37a8aa;});}return _0x430024;})[_0x055b('0x1d')](respondWithResult(_0x387db8,0xc9))[_0x055b('0x27')](handleError(_0x387db8,null));};exports['update']=function(_0x3a9053,_0x2aacbf){if(_0x3a9053[_0x055b('0x59')]['id']){delete _0x3a9053['body']['id'];}return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x3a9053['params']['id']},'include':[{'model':db[_0x055b('0x39')],'as':'mandatoryDispositionPause'}]})[_0x055b('0x1d')](handleEntityNotFound(_0x2aacbf,null))[_0x055b('0x1d')](saveUpdates(_0x3a9053[_0x055b('0x59')],null))[_0x055b('0x1d')](respondWithResult(_0x2aacbf,null))[_0x055b('0x27')](handleError(_0x2aacbf,null));};exports['destroy']=function(_0x2740d1,_0x540c21){return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x2740d1[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x540c21,null))['then'](removeEntity(_0x540c21,null))[_0x055b('0x27')](handleError(_0x540c21,null));};exports[_0x055b('0x5d')]=function(_0x1526d4,_0x4efa5a){return db[_0x055b('0x3c')][_0x055b('0x5d')]()['then'](respondWithResult(_0x4efa5a,null))['catch'](handleError(_0x4efa5a,null));};exports[_0x055b('0x5e')]=function(_0x2d6c37,_0x3324dd,_0x3af271){if(_0x2d6c37[_0x055b('0x59')]['id']){delete _0x2d6c37[_0x055b('0x59')]['id'];}return db['FaxAccount'][_0x055b('0x57')]({'where':{'id':_0x2d6c37[_0x055b('0x55')]['id']}})['then'](handleEntityNotFound(_0x3324dd,null))[_0x055b('0x1d')](function(_0x4bb68a){if(_0x4bb68a){_0x2d6c37['body'][_0x055b('0x5f')]=_0x4bb68a['id'];return db[_0x055b('0x60')]['create'](_0x2d6c37[_0x055b('0x59')]);}})[_0x055b('0x1d')](respondWithResult(_0x3324dd,null))[_0x055b('0x27')](handleError(_0x3324dd,null));};exports[_0x055b('0x61')]=function(_0x2277e9,_0x427744,_0x4b42db){var _0x2fda1e={'raw':![],'where':{}};var _0x48b117={};var _0x3951da={'count':0x0,'rows':[]};return db['FaxAccount'][_0x055b('0x62')]({'where':{'id':_0x2277e9[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x427744,null))['then'](function(_0x51b751){if(_0x51b751){_0x48b117[_0x055b('0x40')]=_[_0x055b('0x41')](db[_0x055b('0x60')][_0x055b('0x3d')]);_0x48b117[_0x055b('0x42')]=_[_0x055b('0x41')](_0x2277e9[_0x055b('0x42')]);_0x48b117[_0x055b('0x56')]=_[_0x055b('0x43')](_0x48b117['model'],_0x48b117['query']);_0x2fda1e['attributes']=_[_0x055b('0x43')](_0x48b117['model'],qs[_0x055b('0x45')](_0x2277e9[_0x055b('0x42')][_0x055b('0x45')]));_0x2fda1e[_0x055b('0x44')]=_0x2fda1e[_0x055b('0x44')][_0x055b('0x46')]?_0x2fda1e[_0x055b('0x44')]:_0x48b117[_0x055b('0x40')];if(!_0x2277e9[_0x055b('0x42')][_0x055b('0x47')](_0x055b('0x48'))){_0x2fda1e[_0x055b('0x2f')]=qs[_0x055b('0x2f')](_0x2277e9[_0x055b('0x42')][_0x055b('0x2f')]);_0x2fda1e[_0x055b('0x2c')]=qs[_0x055b('0x2c')](_0x2277e9['query'][_0x055b('0x2c')]);}_0x2fda1e[_0x055b('0x49')]=qs[_0x055b('0x4a')](_0x2277e9[_0x055b('0x42')][_0x055b('0x4a')]);_0x2fda1e['where']=qs['filters'](_[_0x055b('0x4c')](_0x2277e9[_0x055b('0x42')],_0x48b117[_0x055b('0x56')]));_0x2fda1e[_0x055b('0x4b')][_0x055b('0x5f')]=_0x51b751['id'];if(_0x2277e9[_0x055b('0x42')]['filter']){_0x2fda1e[_0x055b('0x4b')]=_[_0x055b('0x4f')](_0x2fda1e[_0x055b('0x4b')],{'$or':_[_0x055b('0x3b')](_0x2fda1e['attributes'],function(_0x571363){var _0x342270={};_0x342270[_0x571363]={'$like':'%'+_0x2277e9[_0x055b('0x42')][_0x055b('0x4d')]+'%'};return _0x342270;})});}_0x2fda1e=_[_0x055b('0x4f')]({},_0x2fda1e,_0x2277e9['options']);return db['Disposition'][_0x055b('0x2e')]({'where':_0x2fda1e[_0x055b('0x4b')]})[_0x055b('0x1d')](function(_0x4b6dc4){_0x3951da[_0x055b('0x2e')]=_0x4b6dc4;if(_0x2277e9['query'][_0x055b('0x51')]){_0x2fda1e[_0x055b('0x52')]=[{'all':!![]}];}return db[_0x055b('0x60')][_0x055b('0x53')](_0x2fda1e);})[_0x055b('0x1d')](function(_0x26c0b0){_0x3951da[_0x055b('0x63')]=_0x26c0b0;return _0x3951da;});}})[_0x055b('0x1d')](respondWithFilteredResult(_0x427744,_0x2fda1e))[_0x055b('0x27')](handleError(_0x427744,null));};exports['removeDispositions']=function(_0x8631ac,_0x3e0d0b,_0x85d76d){return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x8631ac[_0x055b('0x55')]['id']}})['then'](handleEntityNotFound(_0x3e0d0b,null))['then'](function(_0xefcf78){if(_0xefcf78){return _0xefcf78[_0x055b('0x64')](_0x8631ac[_0x055b('0x42')][_0x055b('0x65')]);}})[_0x055b('0x1d')](respondWithStatusCode(_0x3e0d0b,null))[_0x055b('0x27')](handleError(_0x3e0d0b,null));};exports['addAnswer']=function(_0x10cb62,_0x13c109,_0x129709){if(_0x10cb62[_0x055b('0x59')]['id']){delete _0x10cb62[_0x055b('0x59')]['id'];}return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x10cb62[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x13c109,null))[_0x055b('0x1d')](function(_0x5d10fb){if(_0x5d10fb){_0x10cb62[_0x055b('0x59')]['FaxAccountId']=_0x5d10fb['id'];return db[_0x055b('0x66')]['create'](_0x10cb62[_0x055b('0x59')]);}})[_0x055b('0x1d')](respondWithResult(_0x13c109,null))[_0x055b('0x27')](handleError(_0x13c109,null));};exports[_0x055b('0x67')]=function(_0x5a3768,_0x43be9c,_0x3bc9e4){var _0x2144ff={'raw':![],'where':{}};var _0xd723dc={};var _0x3e7f5b={'count':0x0,'rows':[]};return db[_0x055b('0x3c')][_0x055b('0x62')]({'where':{'id':_0x5a3768[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x43be9c,null))[_0x055b('0x1d')](function(_0x49a3ab){if(_0x49a3ab){_0xd723dc[_0x055b('0x40')]=_['keys'](db['CannedAnswer'][_0x055b('0x3d')]);_0xd723dc[_0x055b('0x42')]=_[_0x055b('0x41')](_0x5a3768[_0x055b('0x42')]);_0xd723dc[_0x055b('0x56')]=_['intersection'](_0xd723dc[_0x055b('0x40')],_0xd723dc[_0x055b('0x42')]);_0x2144ff[_0x055b('0x44')]=_[_0x055b('0x43')](_0xd723dc['model'],qs[_0x055b('0x45')](_0x5a3768[_0x055b('0x42')][_0x055b('0x45')]));_0x2144ff[_0x055b('0x44')]=_0x2144ff['attributes'][_0x055b('0x46')]?_0x2144ff['attributes']:_0xd723dc[_0x055b('0x40')];if(!_0x5a3768[_0x055b('0x42')][_0x055b('0x47')](_0x055b('0x48'))){_0x2144ff[_0x055b('0x2f')]=qs[_0x055b('0x2f')](_0x5a3768[_0x055b('0x42')][_0x055b('0x2f')]);_0x2144ff[_0x055b('0x2c')]=qs[_0x055b('0x2c')](_0x5a3768[_0x055b('0x42')][_0x055b('0x2c')]);}_0x2144ff[_0x055b('0x49')]=qs[_0x055b('0x4a')](_0x5a3768[_0x055b('0x42')][_0x055b('0x4a')]);_0x2144ff[_0x055b('0x4b')]=qs[_0x055b('0x56')](_[_0x055b('0x4c')](_0x5a3768['query'],_0xd723dc[_0x055b('0x56')]));_0x2144ff['where'][_0x055b('0x5f')]=_0x49a3ab['id'];if(_0x5a3768['query'][_0x055b('0x4d')]){_0x2144ff[_0x055b('0x4b')]=_[_0x055b('0x4f')](_0x2144ff[_0x055b('0x4b')],{'$or':_[_0x055b('0x3b')](_0x2144ff[_0x055b('0x44')],function(_0x137a81){var _0x3c31d7={};_0x3c31d7[_0x137a81]={'$like':'%'+_0x5a3768[_0x055b('0x42')][_0x055b('0x4d')]+'%'};return _0x3c31d7;})});}_0x2144ff=_[_0x055b('0x4f')]({},_0x2144ff,_0x5a3768['options']);return db[_0x055b('0x66')][_0x055b('0x2e')]({'where':_0x2144ff['where']})['then'](function(_0x1a23a5){_0x3e7f5b[_0x055b('0x2e')]=_0x1a23a5;if(_0x5a3768[_0x055b('0x42')]['includeAll']){_0x2144ff[_0x055b('0x52')]=[{'all':!![]}];}return db[_0x055b('0x66')][_0x055b('0x53')](_0x2144ff);})[_0x055b('0x1d')](function(_0x17e805){_0x3e7f5b[_0x055b('0x63')]=_0x17e805;return _0x3e7f5b;});}})[_0x055b('0x1d')](respondWithFilteredResult(_0x43be9c,_0x2144ff))[_0x055b('0x27')](handleError(_0x43be9c,null));};exports[_0x055b('0x68')]=function(_0x1f296a,_0x1fc762,_0x504a81){return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x1f296a[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x1fc762,null))['then'](function(_0x60a08c){if(_0x60a08c){return _0x60a08c[_0x055b('0x68')](_0x1f296a[_0x055b('0x42')][_0x055b('0x65')]);}})['then'](respondWithStatusCode(_0x1fc762,null))['catch'](handleError(_0x1fc762,null));};exports[_0x055b('0x69')]=function(_0x12d2be,_0x215004,_0x1f9e9e){return db[_0x055b('0x6a')][_0x055b('0x57')]({'where':{'id':_0x12d2be['params']['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x215004,null))['then'](function(_0x8a3d7c){if(_0x8a3d7c){return _0x8a3d7c[_0x055b('0x69')](_0x12d2be[_0x055b('0x59')]['ids'],_['omit'](_0x12d2be['body'],['ids','id'])||{});}})[_0x055b('0x1d')](respondWithResult(_0x215004,null))[_0x055b('0x27')](handleError(_0x215004,null));};exports[_0x055b('0x6b')]=function(_0x25c7d3,_0x5b0da4,_0x127510){var _0x1e9747={'raw':![],'where':{}};var _0x2c890c={};var _0x1d9afd={'count':0x0,'rows':[]};return db[_0x055b('0x3c')][_0x055b('0x62')]({'where':{'id':_0x25c7d3['params']['id']}})['then'](handleEntityNotFound(_0x5b0da4,null))[_0x055b('0x1d')](function(_0x59b8da){if(_0x59b8da){_0x2c890c[_0x055b('0x40')]=_[_0x055b('0x41')](db[_0x055b('0x6a')]['rawAttributes']);_0x2c890c[_0x055b('0x42')]=_[_0x055b('0x41')](_0x25c7d3[_0x055b('0x42')]);_0x2c890c[_0x055b('0x56')]=_['intersection'](_0x2c890c[_0x055b('0x40')],_0x2c890c[_0x055b('0x42')]);_0x1e9747[_0x055b('0x44')]=_[_0x055b('0x43')](_0x2c890c[_0x055b('0x40')],qs[_0x055b('0x45')](_0x25c7d3['query'][_0x055b('0x45')]));_0x1e9747[_0x055b('0x44')]=_0x1e9747[_0x055b('0x44')][_0x055b('0x46')]?_0x1e9747[_0x055b('0x44')]:_0x2c890c[_0x055b('0x40')];if(!_0x25c7d3[_0x055b('0x42')]['hasOwnProperty'](_0x055b('0x48'))){_0x1e9747[_0x055b('0x2f')]=qs[_0x055b('0x2f')](_0x25c7d3[_0x055b('0x42')][_0x055b('0x2f')]);_0x1e9747[_0x055b('0x2c')]=qs[_0x055b('0x2c')](_0x25c7d3[_0x055b('0x42')]['offset']);}_0x1e9747[_0x055b('0x49')]=qs[_0x055b('0x4a')](_0x25c7d3[_0x055b('0x42')][_0x055b('0x4a')]);_0x1e9747[_0x055b('0x4b')]=qs[_0x055b('0x56')](_[_0x055b('0x4c')](_0x25c7d3[_0x055b('0x42')],_0x2c890c[_0x055b('0x56')]));_0x1e9747['where'][_0x055b('0x5f')]=_0x59b8da['id'];if(_0x25c7d3[_0x055b('0x42')][_0x055b('0x4d')]){_0x1e9747[_0x055b('0x4b')]=_[_0x055b('0x4f')](_0x1e9747[_0x055b('0x4b')],{'$or':_['map'](_0x1e9747[_0x055b('0x44')],function(_0x3fa0c7){var _0x1c4e64={};_0x1c4e64[_0x3fa0c7]={'$like':'%'+_0x25c7d3[_0x055b('0x42')][_0x055b('0x4d')]+'%'};return _0x1c4e64;})});}_0x1e9747=_[_0x055b('0x4f')]({},_0x1e9747,_0x25c7d3['options']);return db[_0x055b('0x6a')][_0x055b('0x2e')]({'where':_0x1e9747[_0x055b('0x4b')]})[_0x055b('0x1d')](function(_0x303a4d){_0x1d9afd['count']=_0x303a4d;if(_0x25c7d3[_0x055b('0x42')]['includeAll']){_0x1e9747[_0x055b('0x52')]=[{'model':db[_0x055b('0x6c')],'as':_0x055b('0x6d'),'required':![]},{'model':db[_0x055b('0x6e')],'as':_0x055b('0x6f'),'attributes':[_0x055b('0x38'),_0x055b('0x70'),_0x055b('0x71')],'required':![]},{'model':db[_0x055b('0x72')],'as':_0x055b('0x73'),'attributes':['id',_0x055b('0x38'),_0x055b('0x74')],'where':_0x25c7d3[_0x055b('0x42')]['tag']?{'id':_0x25c7d3[_0x055b('0x42')]['tag']}:undefined,'required':_0x25c7d3[_0x055b('0x42')]['tag']?!![]:![]}];}return db[_0x055b('0x6a')][_0x055b('0x53')](_0x1e9747);})['then'](function(_0x38cd4b){_0x1d9afd[_0x055b('0x63')]=_0x38cd4b;return _0x1d9afd;});}})[_0x055b('0x1d')](respondWithFilteredResult(_0x5b0da4,_0x1e9747))[_0x055b('0x27')](handleError(_0x5b0da4,null));};exports[_0x055b('0x75')]=function(_0x99f75b,_0x3c32c5){var _0x143b4e=_0x99f75b['params']['id'];var _0x1ef251=_0x99f75b[_0x055b('0x59')];var _0x1cee04=0xc8;var _0x199aae=null;return db[_0x055b('0x76')][_0x055b('0x77')]({'isolationLevel':db[_0x055b('0x76')][_0x055b('0x78')][_0x055b('0x79')][_0x055b('0x7a')]},function(_0xc13c0a){return db[_0x055b('0x3c')]['findOne']({'where':{'id':_0x143b4e},'transaction':_0xc13c0a})[_0x055b('0x1d')](function(_0x153084){if(_0x153084){return db[_0x055b('0x7b')][_0x055b('0x36')]({'where':{'FaxAccountId':_0x143b4e},'transaction':_0xc13c0a})[_0x055b('0x1d')](function(){var _0x511633=_['map'](_0x1ef251,function(_0x176eb8){_0x176eb8[_0x055b('0x5f')]=_0x143b4e;return _0x176eb8;});return db['FaxApplication'][_0x055b('0x7c')](_0x511633,{'transaction':_0xc13c0a});});}else{_0x1cee04=0x194;_0x199aae=[];}});})[_0x055b('0x1d')](function(){if(_0x1cee04!==0x194){return db[_0x055b('0x7b')][_0x055b('0x7d')]({'where':{'FaxAccountId':_0x143b4e},'order':_0x055b('0x7e')})[_0x055b('0x1d')](function(_0x5deaa3){_0x199aae=_0x5deaa3;});}})['catch'](function(_0x3b2146){_0x1cee04=0x1f4;logger['error'](_0x3b2146[_0x055b('0x37')]);if(_0x3b2146[_0x055b('0x38')]){delete _0x3b2146[_0x055b('0x38')];}_0x199aae=_0x3b2146;})[_0x055b('0x7f')](function(){if(_0x199aae===null){_0x3c32c5[_0x055b('0x28')](_0x1cee04);}else{if(_0x1cee04===0x1f4){_0x3c32c5[_0x055b('0x2a')](_0x1cee04)['send'](_0x199aae);}else{_0x3c32c5[_0x055b('0x2a')](_0x1cee04)['json'](_0x199aae);}}});};exports['getApplications']=function(_0x221742,_0x2e7f62,_0x483c63){var _0x53053f={};var _0x48577a={};var _0x37d71a;var _0xd2e8e5;return db[_0x055b('0x3c')][_0x055b('0x62')]({'where':{'id':_0x221742[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x2e7f62,null))[_0x055b('0x1d')](function(_0x2a22ba){if(_0x2a22ba){_0x37d71a=_0x2a22ba;_0x48577a['model']=_[_0x055b('0x41')](db[_0x055b('0x7b')][_0x055b('0x3d')]);_0x48577a[_0x055b('0x42')]=_['keys'](_0x221742[_0x055b('0x42')]);_0x48577a['filters']=_[_0x055b('0x43')](_0x48577a[_0x055b('0x40')],_0x48577a['query']);_0x53053f[_0x055b('0x44')]=_[_0x055b('0x43')](_0x48577a[_0x055b('0x40')],qs['fields'](_0x221742['query']['fields']));_0x53053f[_0x055b('0x44')]=_0x53053f[_0x055b('0x44')][_0x055b('0x46')]?_0x53053f[_0x055b('0x44')]:_0x48577a['model'];_0x53053f[_0x055b('0x49')]=qs[_0x055b('0x4a')](_0x221742['query'][_0x055b('0x4a')]);_0x53053f[_0x055b('0x4b')]=qs[_0x055b('0x56')](_[_0x055b('0x4c')](_0x221742['query'],_0x48577a[_0x055b('0x56')]));if(_0x221742[_0x055b('0x42')][_0x055b('0x4d')]){_0x53053f[_0x055b('0x4b')]=_[_0x055b('0x4f')](_0x53053f[_0x055b('0x4b')],{'$or':_[_0x055b('0x3b')](_0x53053f[_0x055b('0x44')],function(_0x281389){var _0x45b59b={};_0x45b59b[_0x281389]={'$like':'%'+_0x221742['query'][_0x055b('0x4d')]+'%'};return _0x45b59b;})});}_0x53053f=_[_0x055b('0x4f')]({},_0x53053f,_0x221742['options']);return _0x37d71a[_0x055b('0x80')](_0x53053f);}})['then'](function(_0x36636e){if(_0x36636e){_0xd2e8e5=_0x36636e[_0x055b('0x46')];if(!_0x221742['query'][_0x055b('0x47')]('nolimit')){_0x53053f[_0x055b('0x2f')]=qs[_0x055b('0x2f')](_0x221742[_0x055b('0x42')][_0x055b('0x2f')]);_0x53053f[_0x055b('0x2c')]=qs['offset'](_0x221742[_0x055b('0x42')][_0x055b('0x2c')]);}return _0x37d71a[_0x055b('0x80')](_0x53053f);}})[_0x055b('0x1d')](function(_0x69aa){if(_0x69aa){return _0x69aa?{'count':_0xd2e8e5,'rows':_0x69aa}:null;}})['then'](respondWithResult(_0x2e7f62,null))[_0x055b('0x27')](handleError(_0x2e7f62,null));};function Extension(_0x5bd326,_0x3bbdf,_0x98d2ea,_0x1cb17f){this[_0x055b('0x81')]=_0x055b('0x82');this['exten']=_0x5bd326[_0x055b('0x83')];this[_0x055b('0x84')]=_0x1cb17f;this[_0x055b('0x3f')]=_0x055b('0x85');this[_0x055b('0x86')]=_0x055b('0x87');this['FaxAccountId']=_0x5bd326['id'];this[_0x055b('0x7e')]=_0x3bbdf;this[_0x055b('0x88')]=_0x98d2ea;}function createExtensionsReciveFax(_0xf166cb){var _0x3916d4=0x1;var _0x38127a=[];_0x38127a[_0x055b('0x89')](new Extension(_0xf166cb,_0x3916d4,'','Answer'));_0x3916d4+=0x1;_0x38127a[_0x055b('0x89')](new Extension(_0xf166cb,_0x3916d4,'CDR(type)=inbound-fax',_0x055b('0x8a')));_0x3916d4+=0x1;for(var _0x4b3fdc in _0xf166cb){if(_0xf166cb[_0x055b('0x47')](_0x4b3fdc)&&(_0x4b3fdc===_0x055b('0x8b')||_0x4b3fdc===_0x055b('0x83')||_0x4b3fdc===_0x055b('0x8c')||_0x4b3fdc===_0x055b('0x8d')||_0x4b3fdc==='headerinfo'||_0x4b3fdc===_0x055b('0x8e')||_0x4b3fdc==='minrate'||_0x4b3fdc==='modem'||_0x4b3fdc===_0x055b('0x8f'))){_0x38127a[_0x055b('0x89')](new Extension(_0xf166cb,_0x3916d4,'FAXOPT('+_0x4b3fdc+')='+_0xf166cb[_0x4b3fdc],_0x055b('0x8a')));_0x3916d4+=0x1;}}_0x38127a['push'](new Extension(_0xf166cb,_0x3916d4,'6','Wait'));_0x3916d4+=0x1;_0x38127a[_0x055b('0x89')](new Extension(_0xf166cb,_0x3916d4,'/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',_0x055b('0x90')));_0x3916d4=0x0;return _0x38127a;}exports[_0x055b('0x91')]=function(_0x1731db,_0x162894,_0x280449){var _0x4a6a48;return db[_0x055b('0x76')][_0x055b('0x77')](function(_0x97c277){return db[_0x055b('0x3c')]['create'](_0x1731db['body'],{'transaction':_0x97c277})[_0x055b('0x1d')](function(_0x339170){_0x4a6a48=_0x339170[_0x055b('0x34')]({'plain':!![]});return db['VoiceExtension'][_0x055b('0x7c')](createExtensionsReciveFax(_0x4a6a48),{'transaction':_0x97c277});});})[_0x055b('0x1d')](function(){return _0x4a6a48;})[_0x055b('0x1d')](respondWithResult(_0x162894,null))['catch'](handleError(_0x162894,null));};exports[_0x055b('0x92')]=function(_0x432444,_0x4b3a79,_0x2dd090){var _0x8987c7;return db['sequelize'][_0x055b('0x77')](function(_0xbd4a98){return db[_0x055b('0x3c')][_0x055b('0x33')](_0x432444[_0x055b('0x59')],{'where':{'id':_0x432444['body']['id']},'transaction':_0xbd4a98})['then'](function(_0x4218b1){return db[_0x055b('0x93')][_0x055b('0x36')]({'where':{'FaxAccountId':_0x432444[_0x055b('0x59')]['id']},'transaction':_0xbd4a98})['then'](function(_0x3a90b7){return db[_0x055b('0x93')][_0x055b('0x7c')](createExtensionsReciveFax(_[_0x055b('0x94')](_0x432444[_0x055b('0x59')],[_0x055b('0x95'),_0x055b('0x96'),_0x055b('0x97'),'updatedAt',_0x055b('0x98'),'ListId'])),{'transaction':_0xbd4a98});});});})[_0x055b('0x1d')](function(){return db[_0x055b('0x3c')][_0x055b('0x99')](_0x432444[_0x055b('0x59')]['id']);})['then'](respondWithResult(_0x4b3a79,null))[_0x055b('0x27')](handleError(_0x4b3a79,null));};exports[_0x055b('0x9a')]=function(_0xcd52eb,_0x3a3993,_0x3d4f13){var _0xd88f52={'raw':!![],'where':{}};var _0x1f6619={};var _0x50ea63={'count':0x0,'rows':[]};return db[_0x055b('0x3c')][_0x055b('0x62')]({'where':{'id':_0xcd52eb[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x3a3993,null))[_0x055b('0x1d')](function(_0x4bc85f){if(_0x4bc85f){_0x1f6619['model']=_[_0x055b('0x41')](db[_0x055b('0x9b')][_0x055b('0x3d')]);_0x1f6619[_0x055b('0x42')]=_[_0x055b('0x41')](_0xcd52eb[_0x055b('0x42')]);_0x1f6619['filters']=_[_0x055b('0x43')](_0x1f6619['model'],_0x1f6619[_0x055b('0x42')]);_0xd88f52[_0x055b('0x44')]=_[_0x055b('0x43')](_0x1f6619[_0x055b('0x40')],qs[_0x055b('0x45')](_0xcd52eb[_0x055b('0x42')]['fields']));_0xd88f52[_0x055b('0x44')]=_0xd88f52[_0x055b('0x44')][_0x055b('0x46')]?_0xd88f52[_0x055b('0x44')]:_0x1f6619[_0x055b('0x40')];if(!_0xcd52eb[_0x055b('0x42')][_0x055b('0x47')](_0x055b('0x48'))){_0xd88f52[_0x055b('0x2f')]=qs[_0x055b('0x2f')](_0xcd52eb[_0x055b('0x42')][_0x055b('0x2f')]);_0xd88f52[_0x055b('0x2c')]=qs[_0x055b('0x2c')](_0xcd52eb[_0x055b('0x42')][_0x055b('0x2c')]);}_0xd88f52[_0x055b('0x49')]=qs[_0x055b('0x4a')](_0xcd52eb[_0x055b('0x42')][_0x055b('0x4a')]);_0xd88f52[_0x055b('0x4b')]=qs['filters'](_[_0x055b('0x4c')](_0xcd52eb[_0x055b('0x42')],_0x1f6619['filters']));_0xd88f52[_0x055b('0x4b')][_0x055b('0x5f')]=_0x4bc85f['id'];if(_0xcd52eb[_0x055b('0x42')][_0x055b('0x4d')]){_0xd88f52[_0x055b('0x4b')]=_[_0x055b('0x4f')](_0xd88f52[_0x055b('0x4b')],{'$or':_[_0x055b('0x3b')](_0xd88f52[_0x055b('0x44')],function(_0x4a003b){var _0x4855a9={};_0x4855a9[_0x4a003b]={'$like':'%'+_0xcd52eb[_0x055b('0x42')][_0x055b('0x4d')]+'%'};return _0x4855a9;})});}if(_0xcd52eb[_0x055b('0x42')][_0x055b('0x9c')]){var _0x576081=_0xcd52eb[_0x055b('0x42')][_0x055b('0x9c')][_0x055b('0x9d')](',');var _0x3be2e5={};_0x3be2e5[_0x576081[0x0]]={'$gte':moment(_0x576081[0x1])[_0x055b('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd88f52[_0x055b('0x4b')]=_['merge'](_0xd88f52[_0x055b('0x4b')],_0x3be2e5);}_0xd88f52=_[_0x055b('0x4f')]({},_0xd88f52,_0xcd52eb['options']);return db['FaxMessage'][_0x055b('0x2e')]({'where':_0xd88f52['where']})[_0x055b('0x1d')](function(_0x4ce72e){_0x50ea63[_0x055b('0x2e')]=_0x4ce72e;if(_0xcd52eb['query'][_0x055b('0x51')]){_0xd88f52[_0x055b('0x52')]=[{'all':!![]}];}return db[_0x055b('0x9b')][_0x055b('0x53')](_0xd88f52);})[_0x055b('0x1d')](function(_0x445cb7){_0x50ea63['rows']=_0x445cb7;return _0x50ea63;});}})[_0x055b('0x1d')](respondWithFilteredResult(_0x3a3993,_0xd88f52))['catch'](handleError(_0x3a3993,null));};exports[_0x055b('0x9f')]=function(_0x8db5d6,_0x7816b9,_0x5a11d3){var _0x568442,_0x18b8d3={},_0x7354f6;if(_0x8db5d6['body']['to']){_0x7354f6=_0x8db5d6['body']['to'][0x0];}return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x8db5d6[_0x055b('0x55')]['id']},'include':[{'model':db[_0x055b('0xa0')],'as':_0x055b('0xa1'),'include':[{'model':db['CmContact'],'as':_0x055b('0xa2'),'where':{'fax':_0x7354f6},'limit':0x1,'order':[[_0x055b('0xa3'),'DESC']]}]}]})[_0x055b('0x1d')](handleEntityNotFound(_0x7816b9,null))['then'](function(_0x2369b1){_0x568442=_0x2369b1;if(_0x8db5d6['body'][_0x055b('0xa4')]&&_0x8db5d6['body'][_0x055b('0xa4')]['length']){for(var _0x1331c5=0x0;_0x1331c5<_0x8db5d6[_0x055b('0x59')]['attachments'][_0x055b('0x46')];_0x1331c5+=0x1){_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][_0x1331c5]={'filename':_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][_0x1331c5][_0x055b('0x38')],'id':_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][_0x1331c5]['id'],'path':path[_0x055b('0xa5')](config[_0x055b('0xa6')],_0x055b('0xa7'),_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][_0x1331c5]['basename'])};}}return respondWithRpcPromise(_0x055b('0xa8'),_0x055b('0xa8'),{'FaxAccountId':_[_0x055b('0xa9')](_0x8db5d6['params']['id'])?undefined:_0x8db5d6[_0x055b('0x55')]['id'],'path':_[_0x055b('0xa9')](_0x8db5d6[_0x055b('0x59')]['attachments'][0x0][_0x055b('0xaa')])?undefined:_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][0x0][_0x055b('0xaa')],'fax':_[_0x055b('0xa9')](_0x8db5d6[_0x055b('0x59')]['to'][0x0])?undefined:_0x8db5d6[_0x055b('0x59')]['to'][0x0]},client9002);})[_0x055b('0x1d')](function(){if(_0x568442){if(_[_0x055b('0xa9')](_0x8db5d6[_0x055b('0x59')][_0x055b('0xab')])){_0x8db5d6[_0x055b('0x59')][_0x055b('0xab')]=util[_0x055b('0x9e')](_0x055b('0xac'),_0x568442[_0x055b('0x38')],_0x568442[_0x055b('0xad')]);}if(_0x568442[_0x055b('0xa1')]){if(_0x568442['List'][_0x055b('0xa2')][_0x055b('0x46')]){return _0x568442[_0x055b('0xa1')][_0x055b('0xa2')][0x0];}else{return db[_0x055b('0x6c')][_0x055b('0x58')](_[_0x055b('0xae')](_0x8db5d6[_0x055b('0x59')],{'firstName':_0x8db5d6[_0x055b('0x59')]['to'][0x0],'phone':_0x8db5d6[_0x055b('0x59')]['to'][0x0],'fax':_0x8db5d6['body']['to'][0x0],'ListId':_0x568442[_0x055b('0xaf')]}));}}else{throw new Error(_0x055b('0xb0'));}}else{throw new Error(_0x055b('0xb1'));}})[_0x055b('0x1d')](function(_0x1effc8){if(_0x1effc8){return db[_0x055b('0x6a')][_0x055b('0x57')]({'where':{'ContactId':_0x1effc8['id'],'closed':![],'FaxAccountId':_0x568442['id']}})['then'](function(_0xcc7fa){if(_0xcc7fa){return[_0xcc7fa,![]];}return db['FaxInteraction']['create']({'UserId':_0x8db5d6['user']['id'],'ContactId':_0x1effc8['id'],'FaxAccountId':_0x568442['id'],'fax':_0x8db5d6[_0x055b('0x59')]['to'][0x0],'firstMsgDirection':_0x055b('0xb2'),'Messages':[_[_0x055b('0x4f')](_0x8db5d6[_0x055b('0x59')],{'read':![],'body':_0x8db5d6['body'][_0x055b('0xa4')][0x0][_0x055b('0xb3')],'FaxAccountId':_0x568442['id'],'UserId':_0x8db5d6[_0x055b('0x5a')]['id'],'ContactId':_0x1effc8['id'],'AttachmentId':_0x8db5d6['body'][_0x055b('0xa4')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x055b('0x1d')](function(_0x4eb98e){return[_0x4eb98e,!![]];});});}else{throw new Error(_0x055b('0xb4'));}})[_0x055b('0xb5')](function(_0x294d51,_0x4db8aa){if(_0x4db8aa){return _0x294d51;}return db[_0x055b('0x9b')][_0x055b('0x58')]({'direction':_0x055b('0xb2'),'read':![],'body':_0x8db5d6[_0x055b('0x59')]['attachments'][0x0][_0x055b('0xb3')],'FaxAccountId':_0x568442['id'],'FaxInteractionId':_0x294d51['id'],'UserId':_0x8db5d6[_0x055b('0x5a')]['id'],'ContactId':_0x294d51[_0x055b('0xb6')],'AttachmentId':_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][0x0]['id']})[_0x055b('0x1d')](function(_0x36ca23){_0x294d51[_0x055b('0xb7')][_0x055b('0xb8')]=[];_0x294d51[_0x055b('0xb7')]['Messages'][_0x055b('0x89')](_0x36ca23['dataValues']);return _0x294d51;});})[_0x055b('0x1d')](function(_0x1791fc){respondWithRpcPromise(_0x055b('0xb9'),_0x055b('0xb9'),{'FaxAccountId':_[_0x055b('0xa9')](_0x8db5d6[_0x055b('0x55')]['id'])?undefined:_0x8db5d6[_0x055b('0x55')]['id'],'path':_[_0x055b('0xa9')](_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][0x0][_0x055b('0xaa')])?undefined:_0x8db5d6[_0x055b('0x59')][_0x055b('0xa4')][0x0][_0x055b('0xaa')],'fax':_[_0x055b('0xa9')](_0x8db5d6['body']['to'][0x0])?undefined:_0x8db5d6[_0x055b('0x59')]['to'][0x0],'AttachmentId':_0x8db5d6['body'][_0x055b('0xa4')][0x0]['id']},client9002)[_0x055b('0x1d')](function(_0x3a4471){logger['info'](_0x055b('0xba'),_0x3a4471);})[_0x055b('0x27')](function(_0x5cc300){logger[_0x055b('0x1e')]('SendFaxRpc,\x20%s',_0x5cc300);});return _0x1791fc;})[_0x055b('0x1d')](respondWithResult(_0x7816b9,null))['catch'](handleError(_0x7816b9,null));};exports[_0x055b('0xbb')]=function(_0x41fe6b,_0x1bac5b,_0x255685){return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x41fe6b[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x1bac5b,null))[_0x055b('0x1d')](function(_0xfe6434){if(_0xfe6434){return _0xfe6434[_0x055b('0xbb')](_0x41fe6b[_0x055b('0x59')][_0x055b('0x65')],_[_0x055b('0x94')](_0x41fe6b[_0x055b('0x59')],['ids','id'])||{})[_0x055b('0xb5')](function(_0x115193){for(var _0x325487=0x0;_0x325487<_0x41fe6b[_0x055b('0x59')]['ids']['length'];_0x325487+=0x1){socket['emit'](_0x055b('0xbc'),{'UserId':Number(_0x41fe6b[_0x055b('0x59')][_0x055b('0x65')][_0x325487]),'FaxAccountId':Number(_0x41fe6b[_0x055b('0x55')]['id'])});}return _0x115193;});}})[_0x055b('0x1d')](respondWithResult(_0x1bac5b,null))[_0x055b('0x27')](handleError(_0x1bac5b,null));};exports['removeAgents']=function(_0x29fce3,_0x5aa7bc,_0x337fc5){return db[_0x055b('0x3c')][_0x055b('0x57')]({'where':{'id':_0x29fce3[_0x055b('0x55')]['id']}})[_0x055b('0x1d')](handleEntityNotFound(_0x5aa7bc,null))[_0x055b('0x1d')](function(_0x3c8433){if(_0x3c8433){return _0x3c8433[_0x055b('0xbd')](_0x29fce3[_0x055b('0x42')][_0x055b('0x65')])[_0x055b('0x1d')](function(){if(_[_0x055b('0xbe')](_0x29fce3[_0x055b('0x42')][_0x055b('0x65')])){for(var _0x58f35a=0x0;_0x58f35a<_0x29fce3[_0x055b('0x42')][_0x055b('0x65')][_0x055b('0x46')];_0x58f35a+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x29fce3[_0x055b('0x42')][_0x055b('0x65')][_0x58f35a]),'FaxAccountId':Number(_0x29fce3[_0x055b('0x55')]['id'])});}}else{socket[_0x055b('0xbf')](_0x055b('0xc0'),{'UserId':Number(_0x29fce3[_0x055b('0x42')][_0x055b('0x65')]),'FaxAccountId':Number(_0x29fce3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5aa7bc,null))[_0x055b('0x27')](handleError(_0x5aa7bc,null));};exports[_0x055b('0xc1')]=function(_0x3534fc,_0x1e6c2f,_0x48a02e){var _0x152645={};var _0x3f365b={};var _0x2cfa4f;var _0x446a23;return db['FaxAccount']['findOne']({'where':{'id':_0x3534fc[_0x055b('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e6c2f,null))[_0x055b('0x1d')](function(_0x367643){if(_0x367643){_0x2cfa4f=_0x367643;_0x3f365b[_0x055b('0x40')]=_[_0x055b('0x41')](db[_0x055b('0x6e')]['rawAttributes']);_0x3f365b['query']=_[_0x055b('0x41')](_0x3534fc[_0x055b('0x42')]);_0x3f365b[_0x055b('0x56')]=_['intersection'](_0x3f365b['model'],_0x3f365b['query']);_0x152645[_0x055b('0x44')]=_[_0x055b('0x43')](_0x3f365b['model'],qs[_0x055b('0x45')](_0x3534fc[_0x055b('0x42')][_0x055b('0x45')]));_0x152645[_0x055b('0x44')]=_0x152645['attributes'][_0x055b('0x46')]?_0x152645[_0x055b('0x44')]:_0x3f365b['model'];_0x152645[_0x055b('0x49')]=qs[_0x055b('0x4a')](_0x3534fc[_0x055b('0x42')][_0x055b('0x4a')]);_0x152645[_0x055b('0x4b')]=qs[_0x055b('0x56')](_['pick'](_0x3534fc[_0x055b('0x42')],_0x3f365b[_0x055b('0x56')]));if(_0x3534fc[_0x055b('0x42')][_0x055b('0x4d')]){_0x152645[_0x055b('0x4b')]=_[_0x055b('0x4f')](_0x152645[_0x055b('0x4b')],{'$or':_[_0x055b('0x3b')](_0x152645[_0x055b('0x44')],function(_0x3ed50e){var _0x407209={};_0x407209[_0x3ed50e]={'$like':'%'+_0x3534fc['query'][_0x055b('0x4d')]+'%'};return _0x407209;})});}_0x152645=_[_0x055b('0x4f')]({},_0x152645,_0x3534fc[_0x055b('0x50')]);return _0x2cfa4f[_0x055b('0xc1')](_0x152645);}})[_0x055b('0x1d')](function(_0x4522ff){if(_0x4522ff){_0x446a23=_0x4522ff[_0x055b('0x46')];if(!_0x3534fc[_0x055b('0x42')]['hasOwnProperty'](_0x055b('0x48'))){_0x152645[_0x055b('0x2f')]=qs[_0x055b('0x2f')](_0x3534fc[_0x055b('0x42')][_0x055b('0x2f')]);_0x152645[_0x055b('0x2c')]=qs['offset'](_0x3534fc[_0x055b('0x42')][_0x055b('0x2c')]);}return _0x2cfa4f[_0x055b('0xc1')](_0x152645);}})[_0x055b('0x1d')](function(_0x20afed){if(_0x20afed){return _0x20afed?{'count':_0x446a23,'rows':_0x20afed}:null;}})['then'](respondWithResult(_0x1e6c2f,null))[_0x055b('0x27')](handleError(_0x1e6c2f,null));};
\ No newline at end of file
index 3d371d1..c8ffe0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2a0=['exports','events','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa2a0,0xc7));var _0x0a2a=function(_0x9d5e4c,_0x25d7cd){_0x9d5e4c=_0x9d5e4c-0x0;var _0xb50ea1=_0xa2a0[_0x9d5e4c];return _0xb50ea1;};'use strict';var EventEmitter=require(_0x0a2a('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x0a2a('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0a2a('0x2')](0x0);var events={'afterCreate':_0x0a2a('0x3'),'afterUpdate':'update','afterDestroy':_0x0a2a('0x4')};function emitEvent(_0x1f28f8){return function(_0x5e563d,_0xc1db31,_0x50e053){FaxAccountEvents['emit'](_0x1f28f8+':'+_0x5e563d['id'],_0x5e563d);FaxAccountEvents[_0x0a2a('0x5')](_0x1f28f8,_0x5e563d);_0x50e053(null);};}for(var e in events){if(events[_0x0a2a('0x6')](e)){var event=events[e];FaxAccount[_0x0a2a('0x7')](e,emitEvent(event));}}module[_0x0a2a('0x8')]=FaxAccountEvents;
\ No newline at end of file
+var _0x1b2a=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0x1b2a,0xd8));var _0xa1b2=function(_0x579dda,_0x3b3b9a){_0x579dda=_0x579dda-0x0;var _0x4c6a6f=_0x1b2a[_0x579dda];return _0x4c6a6f;};'use strict';var EventEmitter=require(_0xa1b2('0x0'));var FaxAccount=require(_0xa1b2('0x1'))['db'][_0xa1b2('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa1b2('0x3')](0x0);var events={'afterCreate':_0xa1b2('0x4'),'afterUpdate':_0xa1b2('0x5'),'afterDestroy':_0xa1b2('0x6')};function emitEvent(_0x49ad2a){return function(_0x364bed,_0x2b6f6d,_0x24c87a){FaxAccountEvents[_0xa1b2('0x7')](_0x49ad2a+':'+_0x364bed['id'],_0x364bed);FaxAccountEvents[_0xa1b2('0x7')](_0x49ad2a,_0x364bed);_0x24c87a(null);};}for(var e in events){if(events[_0xa1b2('0x8')](e)){var event=events[e];FaxAccount[_0xa1b2('0x9')](e,emitEvent(event));}}module[_0xa1b2('0xa')]=FaxAccountEvents;
\ No newline at end of file
index e81abe2..13c5242 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd9=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','util'];(function(_0x2b917f,_0x304181){var _0x1dff58=function(_0x5d2120){while(--_0x5d2120){_0x2b917f['push'](_0x2b917f['shift']());}};_0x1dff58(++_0x304181);}(_0x0fd9,0x1cd));var _0x90fd=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x0fd9[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require('lodash');var util=require(_0x90fd('0x0'));var logger=require(_0x90fd('0x1'))('api');var moment=require(_0x90fd('0x2'));var BPromise=require('bluebird');var rp=require(_0x90fd('0x3'));var fs=require('fs');var path=require(_0x90fd('0x4'));var rimraf=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var attributes=require(_0x90fd('0x7'));module[_0x90fd('0x8')]=function(_0x56b58d,_0x289f93){return _0x56b58d['define'](_0x90fd('0x9'),attributes,{'tableName':_0x90fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5196=['path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','util','api','moment','bluebird','request-promise'];(function(_0x455e9e,_0x1ad3f5){var _0x27d976=function(_0x311df4){while(--_0x311df4){_0x455e9e['push'](_0x455e9e['shift']());}};_0x27d976(++_0x1ad3f5);}(_0x5196,0xd7));var _0x6519=function(_0x53accd,_0x636b7c){_0x53accd=_0x53accd-0x0;var _0x448716=_0x5196[_0x53accd];return _0x448716;};'use strict';var _=require('lodash');var util=require(_0x6519('0x0'));var logger=require('../../config/logger')(_0x6519('0x1'));var moment=require(_0x6519('0x2'));var BPromise=require(_0x6519('0x3'));var rp=require(_0x6519('0x4'));var fs=require('fs');var path=require(_0x6519('0x5'));var rimraf=require(_0x6519('0x6'));var config=require(_0x6519('0x7'));var attributes=require(_0x6519('0x8'));module[_0x6519('0x9')]=function(_0x4c6f63,_0xdbd202){return _0x4c6f63[_0x6519('0xa')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 17ddf87..f142333 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d74=['interaction','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from','Sequelize','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','find','CmList','CmContact','Contacts','DESC','FaxApplication','List','get','account','applications','Applications','list','asc','length','create','contact','FaxInteraction','spread','push','close','unmanaged','created'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x6d74,0x11c));var _0x46d7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6d74[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x46d7('0x0'));var BPromise=require(_0x46d7('0x1'));var rs=require(_0x46d7('0x2'));var fs=require('fs');var Redis=require(_0x46d7('0x3'));var db=require(_0x46d7('0x4'))['db'];var utils=require(_0x46d7('0x5'));var logger=require(_0x46d7('0x6'))('rpc');var config=require(_0x46d7('0x7'));var jayson=require(_0x46d7('0x8'));var client=jayson[_0x46d7('0x9')]['http']({'port':0x232c});config[_0x46d7('0xa')]=_[_0x46d7('0xb')](config[_0x46d7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x46d7('0xc'))(new Redis(config['redis']));require(_0x46d7('0xd'))[_0x46d7('0xe')](socket);function respondWithRpcPromise(_0x3d1f3a,_0x253a3f,_0x334099){return new BPromise(function(_0x5561c6,_0x4e2b36){return client[_0x46d7('0xf')](_0x3d1f3a,_0x334099)[_0x46d7('0x10')](function(_0x8d6c24){logger[_0x46d7('0x11')](_0x46d7('0x12'),_0x253a3f,_0x46d7('0x13'));logger[_0x46d7('0x14')](_0x46d7('0x15'),_0x253a3f,_0x46d7('0x13'),JSON['stringify'](_0x8d6c24));if(_0x8d6c24[_0x46d7('0x16')]){if(_0x8d6c24['error'][_0x46d7('0x17')]===0x1f4){logger[_0x46d7('0x16')](_0x46d7('0x12'),_0x253a3f,_0x8d6c24[_0x46d7('0x16')][_0x46d7('0x18')]);return _0x4e2b36(_0x8d6c24[_0x46d7('0x16')][_0x46d7('0x18')]);}logger[_0x46d7('0x16')](_0x46d7('0x12'),_0x253a3f,_0x8d6c24['error'][_0x46d7('0x18')]);return _0x5561c6(_0x8d6c24[_0x46d7('0x16')][_0x46d7('0x18')]);}else{logger[_0x46d7('0x11')](_0x46d7('0x12'),_0x253a3f,_0x46d7('0x13'));_0x5561c6(_0x8d6c24[_0x46d7('0x19')][_0x46d7('0x18')]);}})[_0x46d7('0x1a')](function(_0x3acffe){logger[_0x46d7('0x16')](_0x46d7('0x12'),_0x253a3f,_0x3acffe);_0x4e2b36(_0x3acffe);});});}exports[_0x46d7('0x1b')]=function(_0x277bdf){var _0x14cd1f=this;return new Promise(function(_0x4c9980,_0x5a5c7b){return db[_0x46d7('0x1c')][_0x46d7('0x1d')]({'raw':_0x277bdf[_0x46d7('0x1e')]?_0x277bdf[_0x46d7('0x1e')][_0x46d7('0x1f')]===undefined?!![]:![]:!![],'where':_0x277bdf[_0x46d7('0x1e')]?_0x277bdf[_0x46d7('0x1e')][_0x46d7('0x20')]||null:null,'attributes':_0x277bdf['options']?_0x277bdf[_0x46d7('0x1e')][_0x46d7('0x21')]||null:null,'limit':_0x277bdf[_0x46d7('0x1e')]?_0x277bdf['options'][_0x46d7('0x22')]||null:null,'include':_0x277bdf[_0x46d7('0x1e')]?_0x277bdf[_0x46d7('0x1e')][_0x46d7('0x23')]?_[_0x46d7('0x24')](_0x277bdf[_0x46d7('0x1e')][_0x46d7('0x23')],function(_0x285107){return{'model':db[_0x285107[_0x46d7('0x25')]],'as':_0x285107['as'],'attributes':_0x285107[_0x46d7('0x21')],'include':_0x285107['include']?_[_0x46d7('0x24')](_0x285107['include'],function(_0x12fb74){return{'model':db[_0x12fb74[_0x46d7('0x25')]],'as':_0x12fb74['as'],'attributes':_0x12fb74[_0x46d7('0x21')],'include':_0x12fb74[_0x46d7('0x23')]?_[_0x46d7('0x24')](_0x12fb74[_0x46d7('0x23')],function(_0x5afb28){return{'model':db[_0x5afb28[_0x46d7('0x25')]],'as':_0x5afb28['as'],'attributes':_0x5afb28[_0x46d7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x46d7('0x10')](function(_0x5ea1b1){logger[_0x46d7('0x11')](_0x46d7('0x1b'),_0x277bdf);logger[_0x46d7('0x14')](_0x46d7('0x1b'),_0x277bdf,JSON[_0x46d7('0x26')](_0x5ea1b1));_0x4c9980(_0x5ea1b1);})[_0x46d7('0x1a')](function(_0x1a3816){logger[_0x46d7('0x16')]('GetFaxAccount',_0x1a3816[_0x46d7('0x18')],_0x277bdf);_0x5a5c7b(_0x14cd1f['error'](0x1f4,_0x1a3816['message']));});});};exports[_0x46d7('0x27')]=function(_0x22bf81,_0x3c06b1,_0x9f7140){var _0x29f1bc=this;return new Promise(function(_0x556a90,_0x12e818){var _0x8c26ae={'body':_0x22bf81[_0x46d7('0x28')],'channel':_0x46d7('0x29')};var _0x5ebbcf=[];var _0x2f3f6d=[];var _0x2ae6df={};return db['CmContact'][_0x46d7('0x2a')]()[_0x46d7('0x10')](function(_0x38c108){if(!_0x38c108){throw new db['Sequelize'][(_0x46d7('0x2b'))](_0x46d7('0x2c'));}_0x5ebbcf=_[_0x46d7('0x2d')](_[_0x46d7('0x2e')](_0x38c108),[_0x46d7('0x2f'),_0x46d7('0x30')]);_0x2f3f6d=_[_0x46d7('0x2d')](_[_0x46d7('0x2e')](_0x38c108),[_0x46d7('0x2f'),'updatedAt','CompanyId',_0x46d7('0x31')]);if(_0x22bf81[_0x46d7('0x28')]['id']){delete _0x22bf81[_0x46d7('0x28')]['id'];}if(_[_0x46d7('0x32')](_0x22bf81[_0x46d7('0x28')][_0x46d7('0x33')])){throw new db[(_0x46d7('0x34'))][(_0x46d7('0x2b'))]('from\x20is\x20mandatory');}if(_[_0x46d7('0x32')](_0x22bf81[_0x46d7('0x28')][_0x46d7('0x28')])||_0x22bf81[_0x46d7('0x28')][_0x46d7('0x28')]===''){throw new db[(_0x46d7('0x34'))][(_0x46d7('0x2b'))](_0x46d7('0x35'));}if(_[_0x46d7('0x32')](_0x22bf81[_0x46d7('0x28')]['mapKey'])){throw new db[(_0x46d7('0x34'))][(_0x46d7('0x2b'))](_0x46d7('0x36')+_0x2f3f6d);}if(!_[_0x46d7('0x37')](_0x2f3f6d,_0x22bf81[_0x46d7('0x28')][_0x46d7('0x38')])){throw new db[(_0x46d7('0x34'))][(_0x46d7('0x2b'))](_0x46d7('0x39')+_0x2f3f6d);}_0x2ae6df[_0x22bf81[_0x46d7('0x28')][_0x46d7('0x38')]]=_0x22bf81[_0x46d7('0x28')][_0x46d7('0x33')];})[_0x46d7('0x10')](function(){return db[_0x46d7('0x1c')][_0x46d7('0x3a')]({'where':{'id':_0x22bf81['account']['id']},'include':[{'model':db[_0x46d7('0x3b')],'as':'List','include':[{'model':db[_0x46d7('0x3c')],'as':_0x46d7('0x3d'),'where':_0x2ae6df,'limit':0x1,'order':[['updatedAt',_0x46d7('0x3e')]]}]},{'model':db[_0x46d7('0x3f')],'as':'Applications'}]});})[_0x46d7('0x10')](function(_0x28564b){if(_0x28564b&&_0x28564b[_0x46d7('0x40')]){var _0x1eecba=_0x28564b[_0x46d7('0x41')]({'plain':!![]});_0x8c26ae[_0x46d7('0x42')]=_0x1eecba;_0x8c26ae[_0x46d7('0x43')]=_0x1eecba[_0x46d7('0x44')];_0x8c26ae[_0x46d7('0x45')]=_0x1eecba[_0x46d7('0x40')];_0x8c26ae[_0x46d7('0x43')]=_['orderBy'](_0x8c26ae[_0x46d7('0x43')],['priority'],[_0x46d7('0x46')]);if(_0x8c26ae['account'][_0x46d7('0x44')]){delete _0x8c26ae[_0x46d7('0x42')]['Applications'];}if(_0x8c26ae['account'][_0x46d7('0x40')]&&_0x8c26ae['account'][_0x46d7('0x40')][_0x46d7('0x3d')][_0x46d7('0x47')]){return _0x8c26ae[_0x46d7('0x42')][_0x46d7('0x40')][_0x46d7('0x3d')][0x0];}var _0x33404f=_[_0x46d7('0xb')](_0x22bf81[_0x46d7('0x28')],{'firstName':_0x22bf81['body'][_0x46d7('0x33')],'ListId':_0x1eecba[_0x46d7('0x31')]});_0x33404f[_0x22bf81['body'][_0x46d7('0x38')]]=_0x22bf81[_0x46d7('0x28')][_0x46d7('0x33')];return db[_0x46d7('0x3c')][_0x46d7('0x48')](_0x33404f,{'fields':_0x5ebbcf,'raw':!![]});}})[_0x46d7('0x10')](function(_0x175a27){_0x8c26ae[_0x46d7('0x49')]=_0x175a27;if(_0x175a27){var _0x3bbf03={'ContactId':_0x175a27['id'],'FaxAccountId':_0x22bf81[_0x46d7('0x42')]['id'],'fax':_0x175a27[_0x46d7('0x29')]};return db[_0x46d7('0x4a')][_0x46d7('0x3a')]({'where':{'ContactId':_0x175a27['id'],'closed':![],'FaxAccountId':_0x22bf81[_0x46d7('0x42')]['id']}})[_0x46d7('0x10')](function(_0x16ac08){if(_0x16ac08){return[_0x16ac08,![]];}return db[_0x46d7('0x4a')][_0x46d7('0x48')](_0x3bbf03)[_0x46d7('0x10')](function(_0x50c18a){return[_0x50c18a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x46d7('0x4b')](function(_0xd33206,_0x442ade){var _0x4654c9=_0xd33206[_0x46d7('0x41')]({'plain':!![]});if(_0x442ade){if(_0x8c26ae[_0x46d7('0x42')]['autoclose']){_0x8c26ae[_0x46d7('0x43')][_0x46d7('0x4c')]({'id':0x0,'priority':_0x8c26ae[_0x46d7('0x43')]['length']+0x1,'app':_0x46d7('0x4d'),'appdata':_0x46d7('0x4e'),'interval':'*,*,*,*'});}_0x4654c9[_0x46d7('0x4f')]=!![];}else{_0x4654c9[_0x46d7('0x4f')]=![];}_0x8c26ae[_0x46d7('0x50')]=_0x4654c9;return db['FaxMessage'][_0x46d7('0x48')]({'body':_0x22bf81[_0x46d7('0x28')][_0x46d7('0x28')],'FaxAccountId':_0x22bf81[_0x46d7('0x42')]['id'],'FaxInteractionId':_0xd33206['id'],'direction':'in','ContactId':_0xd33206[_0x46d7('0x51')],'AttachmentId':_0x22bf81['body']['AttachmentId']});})[_0x46d7('0x10')](function(_0x7fe601){_0x8c26ae[_0x46d7('0x18')]=_0x7fe601;if(_0x8c26ae[_0x46d7('0x50')][_0x46d7('0x52')]){return db[_0x46d7('0x53')][_0x46d7('0x3a')]({'attributes':['id',_0x46d7('0x54')],'where':{'id':_0x8c26ae['interaction'][_0x46d7('0x52')]}})[_0x46d7('0x10')](function(_0x20d6b9){if(_0x20d6b9){_0x8c26ae[_0x46d7('0x43')][_0x46d7('0x55')]({'id':0x0,'priority':0x0,'app':_0x46d7('0x56'),'appdata':_0x20d6b9[_0x46d7('0x54')]+','+(_0x8c26ae[_0x46d7('0x42')][_0x46d7('0x57')]||0xa),'interval':_0x46d7('0x58')});}return respondWithRpcPromise('Start',_0x46d7('0x59'),_0x8c26ae);});}return respondWithRpcPromise(_0x46d7('0x5a'),'startRouting',_0x8c26ae);})[_0x46d7('0x10')](function(_0xd3a8bb){_0x556a90(_0xd3a8bb);})[_0x46d7('0x1a')](function(_0x3b0dab){_0x12e818(_0x29f1bc[_0x46d7('0x16')](0x1f4,_0x3b0dab['message']));});});};
\ No newline at end of file
+var _0xccb5=['List','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','defaults','create','contact','FaxInteraction','spread','push','length','*,*,*,*','FaxMessage','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','createdAt','updatedAt','difference','keys','CompanyId','ListId','Sequelize','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xccb5,0x77));var _0x5ccb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xccb5[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x5ccb('0x0'));var util=require(_0x5ccb('0x1'));var moment=require('moment');var BPromise=require(_0x5ccb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ccb('0x3'));var db=require(_0x5ccb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ccb('0x5'))(_0x5ccb('0x6'));var config=require(_0x5ccb('0x7'));var jayson=require(_0x5ccb('0x8'));var client=jayson[_0x5ccb('0x9')]['http']({'port':0x232c});config['redis']=_['defaults'](config[_0x5ccb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ccb('0xb'))(new Redis(config['redis']));require(_0x5ccb('0xc'))[_0x5ccb('0xd')](socket);function respondWithRpcPromise(_0x462088,_0x3ee428,_0x39a45c){return new BPromise(function(_0x58792a,_0x1f8b8f){return client[_0x5ccb('0xe')](_0x462088,_0x39a45c)[_0x5ccb('0xf')](function(_0xe7500){logger[_0x5ccb('0x10')](_0x5ccb('0x11'),_0x3ee428,'request\x20sent');logger[_0x5ccb('0x12')](_0x5ccb('0x13'),_0x3ee428,_0x5ccb('0x14'),JSON[_0x5ccb('0x15')](_0xe7500));if(_0xe7500[_0x5ccb('0x16')]){if(_0xe7500['error'][_0x5ccb('0x17')]===0x1f4){logger[_0x5ccb('0x16')](_0x5ccb('0x11'),_0x3ee428,_0xe7500[_0x5ccb('0x16')][_0x5ccb('0x18')]);return _0x1f8b8f(_0xe7500['error']['message']);}logger[_0x5ccb('0x16')](_0x5ccb('0x11'),_0x3ee428,_0xe7500[_0x5ccb('0x16')][_0x5ccb('0x18')]);return _0x58792a(_0xe7500['error'][_0x5ccb('0x18')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x3ee428,_0x5ccb('0x14'));_0x58792a(_0xe7500['result'][_0x5ccb('0x18')]);}})[_0x5ccb('0x19')](function(_0x7c1517){logger[_0x5ccb('0x16')](_0x5ccb('0x11'),_0x3ee428,_0x7c1517);_0x1f8b8f(_0x7c1517);});});}exports['GetFaxAccount']=function(_0x4a16d0){var _0x528e60=this;return new Promise(function(_0x46584d,_0x189fb6){return db['FaxAccount']['findAll']({'raw':_0x4a16d0[_0x5ccb('0x1a')]?_0x4a16d0[_0x5ccb('0x1a')][_0x5ccb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a16d0[_0x5ccb('0x1a')]?_0x4a16d0['options'][_0x5ccb('0x1c')]||null:null,'attributes':_0x4a16d0[_0x5ccb('0x1a')]?_0x4a16d0[_0x5ccb('0x1a')][_0x5ccb('0x1d')]||null:null,'limit':_0x4a16d0[_0x5ccb('0x1a')]?_0x4a16d0[_0x5ccb('0x1a')][_0x5ccb('0x1e')]||null:null,'include':_0x4a16d0['options']?_0x4a16d0[_0x5ccb('0x1a')][_0x5ccb('0x1f')]?_['map'](_0x4a16d0['options']['include'],function(_0x501ec6){return{'model':db[_0x501ec6['model']],'as':_0x501ec6['as'],'attributes':_0x501ec6['attributes'],'include':_0x501ec6['include']?_[_0x5ccb('0x20')](_0x501ec6[_0x5ccb('0x1f')],function(_0x50dfbc){return{'model':db[_0x50dfbc[_0x5ccb('0x21')]],'as':_0x50dfbc['as'],'attributes':_0x50dfbc[_0x5ccb('0x1d')],'include':_0x50dfbc['include']?_['map'](_0x50dfbc['include'],function(_0x26c25c){return{'model':db[_0x26c25c[_0x5ccb('0x21')]],'as':_0x26c25c['as'],'attributes':_0x26c25c[_0x5ccb('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x282f92){logger[_0x5ccb('0x10')](_0x5ccb('0x22'),_0x4a16d0);logger[_0x5ccb('0x12')](_0x5ccb('0x22'),_0x4a16d0,JSON[_0x5ccb('0x15')](_0x282f92));_0x46584d(_0x282f92);})['catch'](function(_0x2753c5){logger[_0x5ccb('0x16')]('GetFaxAccount',_0x2753c5[_0x5ccb('0x18')],_0x4a16d0);_0x189fb6(_0x528e60['error'](0x1f4,_0x2753c5[_0x5ccb('0x18')]));});});};exports[_0x5ccb('0x23')]=function(_0x536eea,_0x40e8e3,_0x2b2381){var _0x31fbbb=this;return new Promise(function(_0x43a491,_0x2313c3){var _0x4fa762={'body':_0x536eea[_0x5ccb('0x24')],'channel':_0x5ccb('0x25')};var _0x476bc1=[];var _0xdd17f7=[];var _0x149432={};return db[_0x5ccb('0x26')][_0x5ccb('0x27')]()['then'](function(_0x59a1b1){if(!_0x59a1b1){throw new db['Sequelize'][(_0x5ccb('0x28'))]('no\x20available\x20attributes');}_0x476bc1=_['difference'](_['keys'](_0x59a1b1),[_0x5ccb('0x29'),_0x5ccb('0x2a')]);_0xdd17f7=_[_0x5ccb('0x2b')](_[_0x5ccb('0x2c')](_0x59a1b1),['createdAt',_0x5ccb('0x2a'),_0x5ccb('0x2d'),_0x5ccb('0x2e')]);if(_0x536eea[_0x5ccb('0x24')]['id']){delete _0x536eea[_0x5ccb('0x24')]['id'];}if(_['isNil'](_0x536eea[_0x5ccb('0x24')]['from'])){throw new db[(_0x5ccb('0x2f'))][(_0x5ccb('0x28'))]('from\x20is\x20mandatory');}if(_[_0x5ccb('0x30')](_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x24')])||_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x24')]===''){throw new db['Sequelize'][(_0x5ccb('0x28'))](_0x5ccb('0x31'));}if(_[_0x5ccb('0x30')](_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x32')])){throw new db[(_0x5ccb('0x2f'))][(_0x5ccb('0x28'))](_0x5ccb('0x33')+_0xdd17f7);}if(!_[_0x5ccb('0x34')](_0xdd17f7,_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x32')])){throw new db[(_0x5ccb('0x2f'))]['ValidationError'](_0x5ccb('0x35')+_0xdd17f7);}_0x149432[_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x32')]]=_0x536eea['body'][_0x5ccb('0x36')];})[_0x5ccb('0xf')](function(){return db[_0x5ccb('0x37')][_0x5ccb('0x38')]({'where':{'id':_0x536eea[_0x5ccb('0x39')]['id']},'include':[{'model':db[_0x5ccb('0x3a')],'as':_0x5ccb('0x3b'),'include':[{'model':db[_0x5ccb('0x26')],'as':_0x5ccb('0x3c'),'where':_0x149432,'limit':0x1,'order':[['updatedAt',_0x5ccb('0x3d')]]}]},{'model':db[_0x5ccb('0x3e')],'as':_0x5ccb('0x3f')}]});})['then'](function(_0x58a589){if(_0x58a589&&_0x58a589[_0x5ccb('0x3b')]){var _0x38359e=_0x58a589[_0x5ccb('0x40')]({'plain':!![]});_0x4fa762['account']=_0x38359e;_0x4fa762['applications']=_0x38359e[_0x5ccb('0x3f')];_0x4fa762[_0x5ccb('0x41')]=_0x38359e[_0x5ccb('0x3b')];_0x4fa762[_0x5ccb('0x42')]=_[_0x5ccb('0x43')](_0x4fa762['applications'],[_0x5ccb('0x44')],[_0x5ccb('0x45')]);if(_0x4fa762['account'][_0x5ccb('0x3f')]){delete _0x4fa762[_0x5ccb('0x39')]['Applications'];}if(_0x4fa762[_0x5ccb('0x39')]['List']&&_0x4fa762[_0x5ccb('0x39')][_0x5ccb('0x3b')]['Contacts']['length']){return _0x4fa762[_0x5ccb('0x39')][_0x5ccb('0x3b')][_0x5ccb('0x3c')][0x0];}var _0x5f2a41=_[_0x5ccb('0x46')](_0x536eea['body'],{'firstName':_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x36')],'ListId':_0x38359e[_0x5ccb('0x2e')]});_0x5f2a41[_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x32')]]=_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x36')];return db['CmContact'][_0x5ccb('0x47')](_0x5f2a41,{'fields':_0x476bc1,'raw':!![]});}})[_0x5ccb('0xf')](function(_0x5444bb){_0x4fa762[_0x5ccb('0x48')]=_0x5444bb;if(_0x5444bb){var _0x2ec2ae={'ContactId':_0x5444bb['id'],'FaxAccountId':_0x536eea[_0x5ccb('0x39')]['id'],'fax':_0x5444bb[_0x5ccb('0x25')]};return db[_0x5ccb('0x49')][_0x5ccb('0x38')]({'where':{'ContactId':_0x5444bb['id'],'closed':![],'FaxAccountId':_0x536eea['account']['id']}})[_0x5ccb('0xf')](function(_0x1fb013){if(_0x1fb013){return[_0x1fb013,![]];}return db['FaxInteraction'][_0x5ccb('0x47')](_0x2ec2ae)['then'](function(_0x202dde){return[_0x202dde,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5ccb('0x4a')](function(_0x582918,_0x507721){var _0xb6092=_0x582918[_0x5ccb('0x40')]({'plain':!![]});if(_0x507721){if(_0x4fa762[_0x5ccb('0x39')]['autoclose']){_0x4fa762[_0x5ccb('0x42')][_0x5ccb('0x4b')]({'id':0x0,'priority':_0x4fa762[_0x5ccb('0x42')][_0x5ccb('0x4c')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x5ccb('0x4d')});}_0xb6092['created']=!![];}else{_0xb6092['created']=![];}_0x4fa762['interaction']=_0xb6092;return db[_0x5ccb('0x4e')][_0x5ccb('0x47')]({'body':_0x536eea[_0x5ccb('0x24')][_0x5ccb('0x24')],'FaxAccountId':_0x536eea['account']['id'],'FaxInteractionId':_0x582918['id'],'direction':'in','ContactId':_0x582918['ContactId'],'AttachmentId':_0x536eea['body'][_0x5ccb('0x4f')]});})[_0x5ccb('0xf')](function(_0x5c53f4){_0x4fa762[_0x5ccb('0x18')]=_0x5c53f4;if(_0x4fa762[_0x5ccb('0x50')][_0x5ccb('0x51')]){return db[_0x5ccb('0x52')]['find']({'attributes':['id',_0x5ccb('0x53')],'where':{'id':_0x4fa762['interaction'][_0x5ccb('0x51')]}})[_0x5ccb('0xf')](function(_0x5c1708){if(_0x5c1708){_0x4fa762[_0x5ccb('0x42')][_0x5ccb('0x54')]({'id':0x0,'priority':0x0,'app':_0x5ccb('0x55'),'appdata':_0x5c1708[_0x5ccb('0x53')]+','+(_0x4fa762[_0x5ccb('0x39')][_0x5ccb('0x56')]||0xa),'interval':_0x5ccb('0x4d')});}return respondWithRpcPromise('Start',_0x5ccb('0x57'),_0x4fa762);});}return respondWithRpcPromise(_0x5ccb('0x58'),'startRouting',_0x4fa762);})['then'](function(_0x2c50d8){_0x43a491(_0x2c50d8);})['catch'](function(_0x2ceb9d){_0x2313c3(_0x31fbbb[_0x5ccb('0x16')](0x1f4,_0x2ceb9d['message']));});});};
\ No newline at end of file
index 97148b7..cc8430b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7168=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','remove'];(function(_0x576183,_0xcfa10e){var _0x479d3b=function(_0x42b915){while(--_0x42b915){_0x576183['push'](_0x576183['shift']());}};_0x479d3b(++_0xcfa10e);}(_0x7168,0x1ef));var _0x8716=function(_0x4122da,_0x300f82){_0x4122da=_0x4122da-0x0;var _0xc5846c=_0x7168[_0x4122da];return _0xc5846c;};'use strict';var FaxAccountEvents=require(_0x8716('0x0'));var events=['save',_0x8716('0x1'),'update'];function createListener(_0x25345a,_0x49b584){return function(_0x267218){_0x49b584[_0x8716('0x2')](_0x25345a,_0x267218);};}function removeListener(_0x566b1e,_0x191431){return function(){FaxAccountEvents[_0x8716('0x3')](_0x566b1e,_0x191431);};}exports[_0x8716('0x4')]=function(_0x389bc9){for(var _0x2d352e=0x0,_0x5c3963=events[_0x8716('0x5')];_0x2d352e<_0x5c3963;_0x2d352e++){var _0x5f41d9=events[_0x2d352e];var _0x20230e=createListener(_0x8716('0x6')+_0x5f41d9,_0x389bc9);FaxAccountEvents['on'](_0x5f41d9,_0x20230e);}};
\ No newline at end of file
+var _0xdebd=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x3e3f15,_0x2e5f90){var _0x31b6a5=function(_0xe95e1){while(--_0xe95e1){_0x3e3f15['push'](_0x3e3f15['shift']());}};_0x31b6a5(++_0x2e5f90);}(_0xdebd,0xa7));var _0xddeb=function(_0x48907c,_0x371484){_0x48907c=_0x48907c-0x0;var _0x9e53cc=_0xdebd[_0x48907c];return _0x9e53cc;};'use strict';var FaxAccountEvents=require(_0xddeb('0x0'));var events=[_0xddeb('0x1'),_0xddeb('0x2'),_0xddeb('0x3')];function createListener(_0x4e2c92,_0x238d64){return function(_0x3c5c46){_0x238d64[_0xddeb('0x4')](_0x4e2c92,_0x3c5c46);};}function removeListener(_0x4d22d4,_0x2b249b){return function(){FaxAccountEvents[_0xddeb('0x5')](_0x4d22d4,_0x2b249b);};}exports[_0xddeb('0x6')]=function(_0x60e3cc){for(var _0x45d52b=0x0,_0x48aae2=events[_0xddeb('0x7')];_0x45d52b<_0x48aae2;_0x45d52b++){var _0x12c1c3=events[_0x45d52b];var _0x453f2b=createListener(_0xddeb('0x8')+_0x12c1c3,_0x60e3cc);FaxAccountEvents['on'](_0x12c1c3,_0x453f2b);}};
\ No newline at end of file
index c416338..0f4507f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x568527,_0x50fb1a){var _0x273650=function(_0x3c43b3){while(--_0x3c43b3){_0x568527['push'](_0x568527['shift']());}};_0x273650(++_0x50fb1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x4c50fb,_0x42d1f2){var _0x5a289f=function(_0x377a84){while(--_0x377a84){_0x4c50fb['push'](_0x4c50fb['shift']());}};_0x5a289f(++_0x42d1f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
index f5a21fe..19c67f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe611=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe611,0x133));var _0x1e61=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xe611[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require('sequelize');module[_0x1e61('0x0')]={'priority':{'type':Sequelize[_0x1e61('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1e61('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1e61('0x3')]()},'description':{'type':Sequelize[_0x1e61('0x2')]},'interval':{'type':Sequelize[_0x1e61('0x2')],'defaultValue':_0x1e61('0x4')}};
\ No newline at end of file
+var _0xfa5c=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xfa5c,0x17e));var _0xcfa5=function(_0x329fde,_0x2c7da0){_0x329fde=_0x329fde-0x0;var _0x20184c=_0xfa5c[_0x329fde];return _0x20184c;};'use strict';var Sequelize=require(_0xcfa5('0x0'));module['exports']={'priority':{'type':Sequelize[_0xcfa5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcfa5('0x2')],'allowNull':![],'defaultValue':_0xcfa5('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcfa5('0x2')]},'interval':{'type':Sequelize[_0xcfa5('0x2')],'defaultValue':_0xcfa5('0x4')}};
\ No newline at end of file
index 071cbf7..ecdea24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dc7=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','find','eml-format','moment'];(function(_0xbe6395,_0x3a76fb){var _0x34b645=function(_0x4f3c18){while(--_0x4f3c18){_0xbe6395['push'](_0xbe6395['shift']());}};_0x34b645(++_0x3a76fb);}(_0x8dc7,0xd9));var _0x78dc=function(_0x7507de,_0x28f447){_0x7507de=_0x7507de-0x0;var _0x372ecf=_0x8dc7[_0x7507de];return _0x372ecf;};'use strict';var emlformat=require(_0x78dc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x78dc('0x1'));var BPromise=require(_0x78dc('0x2'));var Mustache=require(_0x78dc('0x3'));var util=require(_0x78dc('0x4'));var path=require('path');var sox=require(_0x78dc('0x5'));var csv=require(_0x78dc('0x6'));var ejs=require(_0x78dc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x78dc('0x8'));var squel=require(_0x78dc('0x9'));var crypto=require(_0x78dc('0xa'));var jsforce=require(_0x78dc('0xb'));var deskjs=require(_0x78dc('0xc'));var toCsv=require(_0x78dc('0x6'));var querystring=require(_0x78dc('0xd'));var Papa=require(_0x78dc('0xe'));var Redis=require(_0x78dc('0xf'));var authService=require(_0x78dc('0x10'));var qs=require(_0x78dc('0x11'));var as=require(_0x78dc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78dc('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x78dc('0x14'));var licenseUtil=require(_0x78dc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d998e,_0x30fda3){_0x30fda3=_0x30fda3||0xcc;return function(_0x5accc0){if(_0x5accc0){return _0x5d998e[_0x78dc('0x16')](_0x30fda3);}return _0x5d998e[_0x78dc('0x17')](_0x30fda3)[_0x78dc('0x18')]();};}function respondWithResult(_0x3fb3f6,_0x2ee0f4){_0x2ee0f4=_0x2ee0f4||0xc8;return function(_0x400c26){if(_0x400c26){return _0x3fb3f6[_0x78dc('0x17')](_0x2ee0f4)[_0x78dc('0x19')](_0x400c26);}};}function respondWithFilteredResult(_0x211baa,_0x2f48f2){return function(_0x46efc2){if(_0x46efc2){var _0x2f8cab=typeof _0x2f48f2[_0x78dc('0x1a')]===_0x78dc('0x1b')&&typeof _0x2f48f2[_0x78dc('0x1c')]===_0x78dc('0x1b');var _0x373365=_0x46efc2[_0x78dc('0x1d')];var _0x464a79=_0x2f8cab?0x0:_0x2f48f2[_0x78dc('0x1a')];var _0x5dd1fb=_0x2f8cab?_0x46efc2[_0x78dc('0x1d')]:_0x2f48f2[_0x78dc('0x1a')]+_0x2f48f2['limit'];var _0x41c389;if(_0x5dd1fb>=_0x373365){_0x5dd1fb=_0x373365;_0x41c389=0xc8;}else{_0x41c389=0xce;}_0x211baa[_0x78dc('0x17')](_0x41c389);return _0x211baa[_0x78dc('0x1e')](_0x78dc('0x1f'),_0x464a79+'-'+_0x5dd1fb+'/'+_0x373365)[_0x78dc('0x19')](_0x46efc2);}return null;};}function patchUpdates(_0x3ccb6d){return function(_0x40fee2){try{jsonpatch['apply'](_0x40fee2,_0x3ccb6d,!![]);}catch(_0x227694){return BPromise['reject'](_0x227694);}return _0x40fee2[_0x78dc('0x20')]();};}function saveUpdates(_0x38358b,_0x20d971){return function(_0x5c6a84){if(_0x5c6a84){return _0x5c6a84[_0x78dc('0x21')](_0x38358b)[_0x78dc('0x22')](function(_0x5f173c){return _0x5f173c;});}return null;};}function removeEntity(_0x3e9646,_0x3918b6){return function(_0xafbfb6){if(_0xafbfb6){return _0xafbfb6[_0x78dc('0x23')]()['then'](function(){_0x3e9646[_0x78dc('0x17')](0xcc)[_0x78dc('0x18')]();});}};}function handleEntityNotFound(_0x38e3e1,_0x46f930){return function(_0x47b5fe){if(!_0x47b5fe){_0x38e3e1[_0x78dc('0x16')](0x194);}return _0x47b5fe;};}function handleError(_0x463a0f,_0x4cc28b){_0x4cc28b=_0x4cc28b||0x1f4;return function(_0x16c7a3){logger['error'](_0x16c7a3[_0x78dc('0x24')]);if(_0x16c7a3[_0x78dc('0x25')]){delete _0x16c7a3[_0x78dc('0x25')];}_0x463a0f[_0x78dc('0x17')](_0x4cc28b)[_0x78dc('0x26')](_0x16c7a3);};}exports[_0x78dc('0x27')]=function(_0x266442,_0x330050){var _0x25788e={},_0x5c7583={},_0x179c5a={'count':0x0,'rows':[]};var _0x52b736=_[_0x78dc('0x28')](db[_0x78dc('0x29')]['rawAttributes'],function(_0x4aea04){return{'name':_0x4aea04[_0x78dc('0x2a')],'type':_0x4aea04[_0x78dc('0x2b')][_0x78dc('0x2c')]};});_0x5c7583[_0x78dc('0x2d')]=_['map'](_0x52b736,_0x78dc('0x25'));_0x5c7583[_0x78dc('0x2e')]=_[_0x78dc('0x2f')](_0x266442[_0x78dc('0x2e')]);_0x5c7583[_0x78dc('0x30')]=_[_0x78dc('0x31')](_0x5c7583['model'],_0x5c7583[_0x78dc('0x2e')]);_0x25788e['attributes']=_[_0x78dc('0x31')](_0x5c7583[_0x78dc('0x2d')],qs[_0x78dc('0x32')](_0x266442[_0x78dc('0x2e')][_0x78dc('0x32')]));_0x25788e['attributes']=_0x25788e['attributes'][_0x78dc('0x33')]?_0x25788e[_0x78dc('0x34')]:_0x5c7583[_0x78dc('0x2d')];if(!_0x266442[_0x78dc('0x2e')][_0x78dc('0x35')](_0x78dc('0x36'))){_0x25788e[_0x78dc('0x1c')]=qs['limit'](_0x266442['query']['limit']);_0x25788e[_0x78dc('0x1a')]=qs['offset'](_0x266442[_0x78dc('0x2e')]['offset']);}_0x25788e[_0x78dc('0x37')]=qs[_0x78dc('0x38')](_0x266442[_0x78dc('0x2e')][_0x78dc('0x38')]);_0x25788e['where']=qs[_0x78dc('0x30')](_[_0x78dc('0x39')](_0x266442[_0x78dc('0x2e')],_0x5c7583[_0x78dc('0x30')]),_0x52b736);if(_0x266442[_0x78dc('0x2e')][_0x78dc('0x3a')]){_0x25788e['where']=_['merge'](_0x25788e[_0x78dc('0x3b')],{'$or':_['map'](_0x52b736,function(_0x30d581){if(_0x30d581[_0x78dc('0x2b')]!==_0x78dc('0x3c')){var _0x57e5a4={};_0x57e5a4[_0x30d581[_0x78dc('0x25')]]={'$like':'%'+_0x266442[_0x78dc('0x2e')][_0x78dc('0x3a')]+'%'};return _0x57e5a4;}})});}_0x25788e=_[_0x78dc('0x3d')]({},_0x25788e,_0x266442['options']);var _0x3fc5b9={'where':_0x25788e[_0x78dc('0x3b')]};return db[_0x78dc('0x29')]['count'](_0x3fc5b9)['then'](function(_0x5962b8){_0x179c5a[_0x78dc('0x1d')]=_0x5962b8;if(_0x266442[_0x78dc('0x2e')][_0x78dc('0x3e')]){_0x25788e[_0x78dc('0x3f')]=[{'all':!![]}];}return db['FaxApplication'][_0x78dc('0x40')](_0x25788e);})[_0x78dc('0x22')](function(_0x3996bb){_0x179c5a[_0x78dc('0x41')]=_0x3996bb;return _0x179c5a;})['then'](respondWithFilteredResult(_0x330050,_0x25788e))[_0x78dc('0x42')](handleError(_0x330050,null));};exports[_0x78dc('0x43')]=function(_0x2b0b1a,_0x4754c5){var _0x5d14a8={'raw':!![],'where':{'id':_0x2b0b1a['params']['id']}},_0x96a472={};_0x96a472[_0x78dc('0x2d')]=_[_0x78dc('0x2f')](db[_0x78dc('0x29')][_0x78dc('0x44')]);_0x96a472[_0x78dc('0x2e')]=_[_0x78dc('0x2f')](_0x2b0b1a['query']);_0x96a472['filters']=_['intersection'](_0x96a472[_0x78dc('0x2d')],_0x96a472[_0x78dc('0x2e')]);_0x5d14a8['attributes']=_[_0x78dc('0x31')](_0x96a472[_0x78dc('0x2d')],qs[_0x78dc('0x32')](_0x2b0b1a[_0x78dc('0x2e')][_0x78dc('0x32')]));_0x5d14a8[_0x78dc('0x34')]=_0x5d14a8[_0x78dc('0x34')]['length']?_0x5d14a8[_0x78dc('0x34')]:_0x96a472['model'];if(_0x2b0b1a['query']['includeAll']){_0x5d14a8[_0x78dc('0x3f')]=[{'all':!![]}];}_0x5d14a8=_[_0x78dc('0x3d')]({},_0x5d14a8,_0x2b0b1a['options']);return db[_0x78dc('0x29')]['find'](_0x5d14a8)[_0x78dc('0x22')](handleEntityNotFound(_0x4754c5,null))[_0x78dc('0x22')](respondWithResult(_0x4754c5,null))[_0x78dc('0x42')](handleError(_0x4754c5,null));};exports[_0x78dc('0x45')]=function(_0x1c337d,_0x5de29){return db['FaxApplication'][_0x78dc('0x45')](_0x1c337d[_0x78dc('0x46')],{})[_0x78dc('0x22')](respondWithResult(_0x5de29,0xc9))[_0x78dc('0x42')](handleError(_0x5de29,null));};exports['update']=function(_0x2b46a9,_0x1246da){if(_0x2b46a9[_0x78dc('0x46')]['id']){delete _0x2b46a9[_0x78dc('0x46')]['id'];}return db[_0x78dc('0x29')]['find']({'where':{'id':_0x2b46a9[_0x78dc('0x47')]['id']}})[_0x78dc('0x22')](handleEntityNotFound(_0x1246da,null))[_0x78dc('0x22')](saveUpdates(_0x2b46a9[_0x78dc('0x46')],null))[_0x78dc('0x22')](respondWithResult(_0x1246da,null))[_0x78dc('0x42')](handleError(_0x1246da,null));};exports['destroy']=function(_0x90a107,_0x2cfc23){return db[_0x78dc('0x29')][_0x78dc('0x48')]({'where':{'id':_0x90a107[_0x78dc('0x47')]['id']}})['then'](handleEntityNotFound(_0x2cfc23,null))[_0x78dc('0x22')](removeEntity(_0x2cfc23,null))[_0x78dc('0x42')](handleError(_0x2cfc23,null));};
\ No newline at end of file
+var _0xd26e=['length','options','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','model','map','query','keys','fields','attributes','hasOwnProperty','order','filters','pick','filter','where','merge','includeAll','include','findAll','show','intersection'];(function(_0x27fcf0,_0x2abcbe){var _0x47ab65=function(_0x1b76e5){while(--_0x1b76e5){_0x27fcf0['push'](_0x27fcf0['shift']());}};_0x47ab65(++_0x2abcbe);}(_0xd26e,0x138));var _0xed26=function(_0x29a7bd,_0x4da9ac){_0x29a7bd=_0x29a7bd-0x0;var _0x5a95d3=_0xd26e[_0x29a7bd];return _0x5a95d3;};'use strict';var emlformat=require(_0xed26('0x0'));var rimraf=require(_0xed26('0x1'));var zipdir=require(_0xed26('0x2'));var jsonpatch=require(_0xed26('0x3'));var rp=require(_0xed26('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xed26('0x5'));var util=require('util');var path=require(_0xed26('0x6'));var sox=require(_0xed26('0x7'));var csv=require(_0xed26('0x8'));var ejs=require(_0xed26('0x9'));var fs=require('fs');var fs_extra=require(_0xed26('0xa'));var _=require(_0xed26('0xb'));var squel=require(_0xed26('0xc'));var crypto=require('crypto');var jsforce=require(_0xed26('0xd'));var deskjs=require(_0xed26('0xe'));var toCsv=require(_0xed26('0x8'));var querystring=require('querystring');var Papa=require(_0xed26('0xf'));var Redis=require(_0xed26('0x10'));var authService=require(_0xed26('0x11'));var qs=require(_0xed26('0x12'));var as=require(_0xed26('0x13'));var hardwareService=require(_0xed26('0x14'));var logger=require(_0xed26('0x15'))(_0xed26('0x16'));var utils=require(_0xed26('0x17'));var config=require(_0xed26('0x18'));var licenseUtil=require(_0xed26('0x19'));var db=require(_0xed26('0x1a'))['db'];function respondWithStatusCode(_0x2eb91f,_0x4b8546){_0x4b8546=_0x4b8546||0xcc;return function(_0xf5ff9a){if(_0xf5ff9a){return _0x2eb91f[_0xed26('0x1b')](_0x4b8546);}return _0x2eb91f['status'](_0x4b8546)[_0xed26('0x1c')]();};}function respondWithResult(_0xe1a455,_0x4a3f57){_0x4a3f57=_0x4a3f57||0xc8;return function(_0x161df7){if(_0x161df7){return _0xe1a455[_0xed26('0x1d')](_0x4a3f57)[_0xed26('0x1e')](_0x161df7);}};}function respondWithFilteredResult(_0x5c7ebb,_0x2eeccc){return function(_0x200e66){if(_0x200e66){var _0x12431d=typeof _0x2eeccc['offset']===_0xed26('0x1f')&&typeof _0x2eeccc[_0xed26('0x20')]===_0xed26('0x1f');var _0x1ab1c2=_0x200e66[_0xed26('0x21')];var _0x1be0e4=_0x12431d?0x0:_0x2eeccc[_0xed26('0x22')];var _0x18e789=_0x12431d?_0x200e66['count']:_0x2eeccc[_0xed26('0x22')]+_0x2eeccc['limit'];var _0x18103c;if(_0x18e789>=_0x1ab1c2){_0x18e789=_0x1ab1c2;_0x18103c=0xc8;}else{_0x18103c=0xce;}_0x5c7ebb[_0xed26('0x1d')](_0x18103c);return _0x5c7ebb[_0xed26('0x23')](_0xed26('0x24'),_0x1be0e4+'-'+_0x18e789+'/'+_0x1ab1c2)[_0xed26('0x1e')](_0x200e66);}return null;};}function patchUpdates(_0x22fd13){return function(_0x18dc8b){try{jsonpatch[_0xed26('0x25')](_0x18dc8b,_0x22fd13,!![]);}catch(_0x37a893){return BPromise[_0xed26('0x26')](_0x37a893);}return _0x18dc8b[_0xed26('0x27')]();};}function saveUpdates(_0x37febc,_0x4a8b8c){return function(_0x49193b){if(_0x49193b){return _0x49193b['update'](_0x37febc)[_0xed26('0x28')](function(_0x4f80e){return _0x4f80e;});}return null;};}function removeEntity(_0x340a45,_0x488966){return function(_0x2d7e95){if(_0x2d7e95){return _0x2d7e95[_0xed26('0x29')]()['then'](function(){_0x340a45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7fd0,_0x33f6f7){return function(_0x33ac11){if(!_0x33ac11){_0x3b7fd0[_0xed26('0x1b')](0x194);}return _0x33ac11;};}function handleError(_0x1ebac5,_0x1692db){_0x1692db=_0x1692db||0x1f4;return function(_0x199cfc){logger[_0xed26('0x2a')](_0x199cfc[_0xed26('0x2b')]);if(_0x199cfc['name']){delete _0x199cfc[_0xed26('0x2c')];}_0x1ebac5[_0xed26('0x1d')](_0x1692db)[_0xed26('0x2d')](_0x199cfc);};}exports[_0xed26('0x2e')]=function(_0x21c0e4,_0x2e88d3){var _0x253452={},_0x4d8a77={},_0x4cd31a={'count':0x0,'rows':[]};var _0x2b2853=_['map'](db[_0xed26('0x2f')][_0xed26('0x30')],function(_0x2e9bdf){return{'name':_0x2e9bdf[_0xed26('0x31')],'type':_0x2e9bdf['type']['key']};});_0x4d8a77[_0xed26('0x32')]=_[_0xed26('0x33')](_0x2b2853,_0xed26('0x2c'));_0x4d8a77[_0xed26('0x34')]=_[_0xed26('0x35')](_0x21c0e4[_0xed26('0x34')]);_0x4d8a77['filters']=_['intersection'](_0x4d8a77[_0xed26('0x32')],_0x4d8a77[_0xed26('0x34')]);_0x253452['attributes']=_['intersection'](_0x4d8a77[_0xed26('0x32')],qs[_0xed26('0x36')](_0x21c0e4[_0xed26('0x34')][_0xed26('0x36')]));_0x253452[_0xed26('0x37')]=_0x253452[_0xed26('0x37')]['length']?_0x253452[_0xed26('0x37')]:_0x4d8a77[_0xed26('0x32')];if(!_0x21c0e4['query'][_0xed26('0x38')]('nolimit')){_0x253452[_0xed26('0x20')]=qs['limit'](_0x21c0e4[_0xed26('0x34')]['limit']);_0x253452['offset']=qs['offset'](_0x21c0e4[_0xed26('0x34')][_0xed26('0x22')]);}_0x253452[_0xed26('0x39')]=qs['sort'](_0x21c0e4[_0xed26('0x34')]['sort']);_0x253452['where']=qs[_0xed26('0x3a')](_[_0xed26('0x3b')](_0x21c0e4[_0xed26('0x34')],_0x4d8a77[_0xed26('0x3a')]),_0x2b2853);if(_0x21c0e4['query'][_0xed26('0x3c')]){_0x253452[_0xed26('0x3d')]=_[_0xed26('0x3e')](_0x253452[_0xed26('0x3d')],{'$or':_['map'](_0x2b2853,function(_0x57cf79){if(_0x57cf79['type']!=='VIRTUAL'){var _0x3d8696={};_0x3d8696[_0x57cf79[_0xed26('0x2c')]]={'$like':'%'+_0x21c0e4[_0xed26('0x34')]['filter']+'%'};return _0x3d8696;}})});}_0x253452=_[_0xed26('0x3e')]({},_0x253452,_0x21c0e4['options']);var _0xf992d5={'where':_0x253452[_0xed26('0x3d')]};return db['FaxApplication'][_0xed26('0x21')](_0xf992d5)[_0xed26('0x28')](function(_0x5be5c9){_0x4cd31a[_0xed26('0x21')]=_0x5be5c9;if(_0x21c0e4[_0xed26('0x34')][_0xed26('0x3f')]){_0x253452[_0xed26('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0xed26('0x41')](_0x253452);})[_0xed26('0x28')](function(_0x11040a){_0x4cd31a['rows']=_0x11040a;return _0x4cd31a;})['then'](respondWithFilteredResult(_0x2e88d3,_0x253452))['catch'](handleError(_0x2e88d3,null));};exports[_0xed26('0x42')]=function(_0x5898f7,_0x483f76){var _0x3cb7b5={'raw':!![],'where':{'id':_0x5898f7['params']['id']}},_0x3264dc={};_0x3264dc[_0xed26('0x32')]=_[_0xed26('0x35')](db['FaxApplication'][_0xed26('0x30')]);_0x3264dc['query']=_[_0xed26('0x35')](_0x5898f7[_0xed26('0x34')]);_0x3264dc[_0xed26('0x3a')]=_[_0xed26('0x43')](_0x3264dc[_0xed26('0x32')],_0x3264dc[_0xed26('0x34')]);_0x3cb7b5[_0xed26('0x37')]=_[_0xed26('0x43')](_0x3264dc[_0xed26('0x32')],qs[_0xed26('0x36')](_0x5898f7[_0xed26('0x34')][_0xed26('0x36')]));_0x3cb7b5[_0xed26('0x37')]=_0x3cb7b5[_0xed26('0x37')][_0xed26('0x44')]?_0x3cb7b5[_0xed26('0x37')]:_0x3264dc[_0xed26('0x32')];if(_0x5898f7[_0xed26('0x34')][_0xed26('0x3f')]){_0x3cb7b5['include']=[{'all':!![]}];}_0x3cb7b5=_[_0xed26('0x3e')]({},_0x3cb7b5,_0x5898f7[_0xed26('0x45')]);return db[_0xed26('0x2f')][_0xed26('0x46')](_0x3cb7b5)[_0xed26('0x28')](handleEntityNotFound(_0x483f76,null))[_0xed26('0x28')](respondWithResult(_0x483f76,null))[_0xed26('0x47')](handleError(_0x483f76,null));};exports[_0xed26('0x48')]=function(_0x422cdd,_0x3f8369){return db[_0xed26('0x2f')][_0xed26('0x48')](_0x422cdd[_0xed26('0x49')],{})[_0xed26('0x28')](respondWithResult(_0x3f8369,0xc9))['catch'](handleError(_0x3f8369,null));};exports[_0xed26('0x4a')]=function(_0xf8e871,_0x1e0e44){if(_0xf8e871['body']['id']){delete _0xf8e871[_0xed26('0x49')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0xf8e871['params']['id']}})[_0xed26('0x28')](handleEntityNotFound(_0x1e0e44,null))['then'](saveUpdates(_0xf8e871[_0xed26('0x49')],null))[_0xed26('0x28')](respondWithResult(_0x1e0e44,null))[_0xed26('0x47')](handleError(_0x1e0e44,null));};exports['destroy']=function(_0x37fe22,_0x3977ed){return db[_0xed26('0x2f')][_0xed26('0x46')]({'where':{'id':_0x37fe22[_0xed26('0x4b')]['id']}})[_0xed26('0x28')](handleEntityNotFound(_0x3977ed,null))[_0xed26('0x28')](removeEntity(_0x3977ed,null))[_0xed26('0x47')](handleError(_0x3977ed,null));};
\ No newline at end of file
index bf6fd61..cf701ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb81a=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication'];(function(_0x1aa3f5,_0x57c3e1){var _0x5107ff=function(_0x1b8133){while(--_0x1b8133){_0x1aa3f5['push'](_0x1aa3f5['shift']());}};_0x5107ff(++_0x57c3e1);}(_0xb81a,0x1f0));var _0xab81=function(_0x1bb18c,_0x3ce898){_0x1bb18c=_0x1bb18c-0x0;var _0x5ca70b=_0xb81a[_0x1bb18c];return _0x5ca70b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab81('0x0'))(_0xab81('0x1'));var moment=require(_0xab81('0x2'));var BPromise=require(_0xab81('0x3'));var rp=require(_0xab81('0x4'));var fs=require('fs');var path=require(_0xab81('0x5'));var rimraf=require(_0xab81('0x6'));var config=require(_0xab81('0x7'));var attributes=require(_0xab81('0x8'));module['exports']=function(_0x3c6fa6,_0x206703){return _0x3c6fa6[_0xab81('0x9')](_0xab81('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab81('0xb'),'collate':_0xab81('0xc')});};
\ No newline at end of file
+var _0x3413=['bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x188863,_0x4a6583){var _0x3ad9a5=function(_0x58b29a){while(--_0x58b29a){_0x188863['push'](_0x188863['shift']());}};_0x3ad9a5(++_0x4a6583);}(_0x3413,0x109));var _0x3341=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3413[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3341('0x0'));var util=require(_0x3341('0x1'));var logger=require(_0x3341('0x2'))(_0x3341('0x3'));var moment=require(_0x3341('0x4'));var BPromise=require(_0x3341('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3341('0x6'));var rimraf=require(_0x3341('0x7'));var config=require(_0x3341('0x8'));var attributes=require(_0x3341('0x9'));module[_0x3341('0xa')]=function(_0x58dabd,_0x5112fb){return _0x58dabd['define'](_0x3341('0xb'),attributes,{'tableName':_0x3341('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3341('0xd'),'collate':_0x3341('0xe')});};
\ No newline at end of file
index 6a7b091..46b08be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddf6=['randomstring','ioredis','../../mysqldb','../../config/environment','client','info','request\x20sent','debug','stringify','error','message','FaxApplication,\x20%s,\x20%s','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','then','catch','util','moment','bluebird'];(function(_0x2d0286,_0x7bf4af){var _0x2d09d0=function(_0x5eaa93){while(--_0x5eaa93){_0x2d0286['push'](_0x2d0286['shift']());}};_0x2d09d0(++_0x7bf4af);}(_0xddf6,0xf7));var _0x6ddf=function(_0x186e79,_0x479b2c){_0x186e79=_0x186e79-0x0;var _0x5227a2=_0xddf6[_0x186e79];return _0x5227a2;};'use strict';var _=require('lodash');var util=require(_0x6ddf('0x0'));var moment=require(_0x6ddf('0x1'));var BPromise=require(_0x6ddf('0x2'));var rs=require(_0x6ddf('0x3'));var fs=require('fs');var Redis=require(_0x6ddf('0x4'));var db=require(_0x6ddf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6ddf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6ddf('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e4a6a,_0x38cfb6,_0x4d9469){return new BPromise(function(_0x1636a0,_0x5efe0e){return client['request'](_0x2e4a6a,_0x4d9469)['then'](function(_0x3a4054){logger[_0x6ddf('0x8')]('FaxApplication,\x20%s,\x20%s',_0x38cfb6,_0x6ddf('0x9'));logger[_0x6ddf('0xa')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x38cfb6,'request\x20sent',JSON[_0x6ddf('0xb')](_0x3a4054));if(_0x3a4054[_0x6ddf('0xc')]){if(_0x3a4054['error']['code']===0x1f4){logger[_0x6ddf('0xc')]('FaxApplication,\x20%s,\x20%s',_0x38cfb6,_0x3a4054[_0x6ddf('0xc')][_0x6ddf('0xd')]);return _0x5efe0e(_0x3a4054[_0x6ddf('0xc')][_0x6ddf('0xd')]);}logger[_0x6ddf('0xc')](_0x6ddf('0xe'),_0x38cfb6,_0x3a4054[_0x6ddf('0xc')][_0x6ddf('0xd')]);return _0x1636a0(_0x3a4054['error']['message']);}else{logger[_0x6ddf('0x8')](_0x6ddf('0xe'),_0x38cfb6,'request\x20sent');_0x1636a0(_0x3a4054['result'][_0x6ddf('0xd')]);}})['catch'](function(_0xa586d3){logger[_0x6ddf('0xc')]('FaxApplication,\x20%s,\x20%s',_0x38cfb6,_0xa586d3);_0x5efe0e(_0xa586d3);});});}exports[_0x6ddf('0xf')]=function(_0x2e2a48){var _0x408fa8=this;return new Promise(function(_0x3bb2b4,_0x675c9f){return db[_0x6ddf('0x10')][_0x6ddf('0x11')](_0x2e2a48[_0x6ddf('0x12')],{'raw':_0x2e2a48[_0x6ddf('0x13')]?_0x2e2a48[_0x6ddf('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e2a48[_0x6ddf('0x13')]?_0x2e2a48[_0x6ddf('0x13')][_0x6ddf('0x14')]||null:null,'attributes':_0x2e2a48['options']?_0x2e2a48['options'][_0x6ddf('0x15')]||null:null,'limit':_0x2e2a48[_0x6ddf('0x13')]?_0x2e2a48[_0x6ddf('0x13')][_0x6ddf('0x16')]||null:null})[_0x6ddf('0x17')](function(_0x7ec481){logger[_0x6ddf('0x8')]('UpdateFaxApplication',_0x2e2a48);logger['debug']('UpdateFaxApplication',_0x2e2a48,JSON[_0x6ddf('0xb')](_0x7ec481));_0x3bb2b4(_0x7ec481);})[_0x6ddf('0x18')](function(_0xd60db6){logger[_0x6ddf('0xc')]('UpdateFaxApplication',_0xd60db6[_0x6ddf('0xd')],_0x2e2a48);_0x675c9f(_0x408fa8['error'](0x1f4,_0xd60db6[_0x6ddf('0xd')]));});});};
\ No newline at end of file
+var _0x4b2e=['body','options','raw','where','attributes','limit','UpdateFaxApplication','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x329042,_0x546352){var _0x5eacb4=function(_0x589e59){while(--_0x589e59){_0x329042['push'](_0x329042['shift']());}};_0x5eacb4(++_0x546352);}(_0x4b2e,0xcb));var _0xe4b2=function(_0x19e7fb,_0x5c0c4c){_0x19e7fb=_0x19e7fb-0x0;var _0x23fa80=_0x4b2e[_0x19e7fb];return _0x23fa80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe4b2('0x0'));var BPromise=require(_0xe4b2('0x1'));var rs=require(_0xe4b2('0x2'));var fs=require('fs');var Redis=require(_0xe4b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4b2('0x4'));var logger=require(_0xe4b2('0x5'))(_0xe4b2('0x6'));var config=require(_0xe4b2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b3d41,_0xdb5d95,_0x42b146){return new BPromise(function(_0x386446,_0xc41e63){return client[_0xe4b2('0x8')](_0x4b3d41,_0x42b146)[_0xe4b2('0x9')](function(_0x140e11){logger[_0xe4b2('0xa')]('FaxApplication,\x20%s,\x20%s',_0xdb5d95,'request\x20sent');logger[_0xe4b2('0xb')](_0xe4b2('0xc'),_0xdb5d95,'request\x20sent',JSON[_0xe4b2('0xd')](_0x140e11));if(_0x140e11[_0xe4b2('0xe')]){if(_0x140e11['error'][_0xe4b2('0xf')]===0x1f4){logger['error'](_0xe4b2('0x10'),_0xdb5d95,_0x140e11[_0xe4b2('0xe')][_0xe4b2('0x11')]);return _0xc41e63(_0x140e11[_0xe4b2('0xe')][_0xe4b2('0x11')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0xdb5d95,_0x140e11['error']['message']);return _0x386446(_0x140e11[_0xe4b2('0xe')][_0xe4b2('0x11')]);}else{logger['info'](_0xe4b2('0x10'),_0xdb5d95,_0xe4b2('0x12'));_0x386446(_0x140e11[_0xe4b2('0x13')]['message']);}})[_0xe4b2('0x14')](function(_0x388b76){logger['error'](_0xe4b2('0x10'),_0xdb5d95,_0x388b76);_0xc41e63(_0x388b76);});});}exports['UpdateFaxApplication']=function(_0x42639b){var _0xf9785e=this;return new Promise(function(_0x16481b,_0x484ed5){return db['FaxApplication']['update'](_0x42639b[_0xe4b2('0x15')],{'raw':_0x42639b[_0xe4b2('0x16')]?_0x42639b[_0xe4b2('0x16')][_0xe4b2('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42639b[_0xe4b2('0x16')]?_0x42639b['options'][_0xe4b2('0x18')]||null:null,'attributes':_0x42639b[_0xe4b2('0x16')]?_0x42639b[_0xe4b2('0x16')][_0xe4b2('0x19')]||null:null,'limit':_0x42639b[_0xe4b2('0x16')]?_0x42639b['options'][_0xe4b2('0x1a')]||null:null})[_0xe4b2('0x9')](function(_0x340ca3){logger[_0xe4b2('0xa')](_0xe4b2('0x1b'),_0x42639b);logger[_0xe4b2('0xb')]('UpdateFaxApplication',_0x42639b,JSON[_0xe4b2('0xd')](_0x340ca3));_0x16481b(_0x340ca3);})['catch'](function(_0x5394d1){logger[_0xe4b2('0xe')]('UpdateFaxApplication',_0x5394d1[_0xe4b2('0x11')],_0x42639b);_0x484ed5(_0xf9785e[_0xe4b2('0xe')](0x1f4,_0x5394d1['message']));});});};
\ No newline at end of file
index 5407df5..5806afd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x5b3ca9,_0x3c9ed8){var _0x45f386=function(_0x76fe3){while(--_0x76fe3){_0x5b3ca9['push'](_0x5b3ca9['shift']());}};_0x45f386(++_0x3c9ed8);}(_0x9c00,0x1a0));var _0x09c0=function(_0x30fe8c,_0x272cb9){_0x30fe8c=_0x30fe8c-0x0;var _0x4f1068=_0x9c00[_0x30fe8c];return _0x4f1068;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x09c0('0xd')]);router[_0x09c0('0xe')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xf')]);router[_0x09c0('0x10')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x11')]);module[_0x09c0('0x12')]=router;
\ No newline at end of file
+var _0xd7d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x55257d,_0x3998ec){var _0x4d296d=function(_0x522f05){while(--_0x522f05){_0x55257d['push'](_0x55257d['shift']());}};_0x4d296d(++_0x3998ec);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x271b09,_0x42f439){_0x271b09=_0x271b09-0x0;var _0x234808=_0xd7d1[_0x271b09];return _0x234808;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xf')]('/',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router['delete'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller[_0x1d7d('0x13')]);module[_0x1d7d('0x14')]=router;
\ No newline at end of file
index 10dbc3e..476fc7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58cc=['DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x1d2614,_0x132b05){var _0x5f4fd7=function(_0x3bd9bf){while(--_0x3bd9bf){_0x1d2614['push'](_0x1d2614['shift']());}};_0x5f4fd7(++_0x132b05);}(_0x58cc,0x13a));var _0xc58c=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x58cc[_0xe8129c];return _0x709fc5;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xc58c('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc58c('0x1')]},'disposition':{'type':Sequelize[_0xc58c('0x2')]},'secondDisposition':{'type':Sequelize[_0xc58c('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc58c('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xc58c('0x3')]('in',_0xc58c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc58c('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc58c('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xca8a=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x569adf,_0x1d1a36){var _0x32e496=function(_0x5f5ae1){while(--_0x5f5ae1){_0x569adf['push'](_0x569adf['shift']());}};_0x32e496(++_0x1d1a36);}(_0xca8a,0x193));var _0xaca8=function(_0x47bdc0,_0x1124d8){_0x47bdc0=_0x47bdc0-0x0;var _0x361143=_0xca8a[_0x47bdc0];return _0x361143;};'use strict';var Sequelize=require('sequelize');module[_0xaca8('0x0')]={'closed':{'type':Sequelize[_0xaca8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaca8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaca8('0x3')]},'note':{'type':Sequelize[_0xaca8('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xaca8('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xaca8('0x4')]('in',_0xaca8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaca8('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 5e0fd9f..497108f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5dc=['length','nolimit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','expr','search','conditions','find','unreadMessages','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','buildExpression','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','FaxAccountId','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','catch','params','rawAttributes','fields','includeAll','include','options','create','update','describe','FaxMessage','addMessage','omit','ids','hasOwnProperty','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','removeTags','download','unix','join','root','files','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxInteraction.socket','register','end','status','json','offset','undefined','count','limit','Content-Range','save','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','push','FaxInteraction','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x49f6f7,_0x363f7a){var _0xe411e3=function(_0x273bb5){while(--_0x273bb5){_0x49f6f7['push'](_0x49f6f7['shift']());}};_0xe411e3(++_0x363f7a);}(_0xc5dc,0x9d));var _0xcc5d=function(_0x3240c4,_0x46e141){_0x3240c4=_0x3240c4-0x0;var _0x41cea5=_0xc5dc[_0x3240c4];return _0x41cea5;};'use strict';var emlformat=require(_0xcc5d('0x0'));var rimraf=require(_0xcc5d('0x1'));var zipdir=require(_0xcc5d('0x2'));var jsonpatch=require(_0xcc5d('0x3'));var rp=require('request-promise');var moment=require(_0xcc5d('0x4'));var BPromise=require(_0xcc5d('0x5'));var Mustache=require(_0xcc5d('0x6'));var util=require('util');var path=require(_0xcc5d('0x7'));var sox=require(_0xcc5d('0x8'));var csv=require(_0xcc5d('0x9'));var ejs=require(_0xcc5d('0xa'));var fs=require('fs');var fs_extra=require(_0xcc5d('0xb'));var _=require(_0xcc5d('0xc'));var squel=require(_0xcc5d('0xd'));var crypto=require('crypto');var jsforce=require(_0xcc5d('0xe'));var deskjs=require(_0xcc5d('0xf'));var toCsv=require(_0xcc5d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc5d('0x10'));var authService=require(_0xcc5d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc5d('0x12'));var logger=require(_0xcc5d('0x13'))(_0xcc5d('0x14'));var utils=require('../../config/utils');var config=require(_0xcc5d('0x15'));var licenseUtil=require(_0xcc5d('0x16'));var db=require(_0xcc5d('0x17'))['db'];config['redis']=_['defaults'](config[_0xcc5d('0x18')],{'host':_0xcc5d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc5d('0x18')]));require(_0xcc5d('0x1a'))[_0xcc5d('0x1b')](socket);function respondWithStatusCode(_0x129177,_0x5ee6e4){_0x5ee6e4=_0x5ee6e4||0xcc;return function(_0x44dae1){if(_0x44dae1){return _0x129177['sendStatus'](_0x5ee6e4);}return _0x129177['status'](_0x5ee6e4)[_0xcc5d('0x1c')]();};}function respondWithResult(_0x1797cf,_0xfe69f4){_0xfe69f4=_0xfe69f4||0xc8;return function(_0x13f9c9){if(_0x13f9c9){return _0x1797cf[_0xcc5d('0x1d')](_0xfe69f4)[_0xcc5d('0x1e')](_0x13f9c9);}};}function respondWithFilteredResult(_0xc270b4,_0x2393a5){return function(_0x505bca){if(_0x505bca){var _0x535b83=typeof _0x2393a5[_0xcc5d('0x1f')]==='undefined'&&typeof _0x2393a5['limit']===_0xcc5d('0x20');var _0x4b1650=_0x505bca['count'];var _0x240afd=_0x535b83?0x0:_0x2393a5[_0xcc5d('0x1f')];var _0x1feab7=_0x535b83?_0x505bca[_0xcc5d('0x21')]:_0x2393a5['offset']+_0x2393a5[_0xcc5d('0x22')];var _0x10a6be;if(_0x1feab7>=_0x4b1650){_0x1feab7=_0x4b1650;_0x10a6be=0xc8;}else{_0x10a6be=0xce;}_0xc270b4[_0xcc5d('0x1d')](_0x10a6be);return _0xc270b4['set'](_0xcc5d('0x23'),_0x240afd+'-'+_0x1feab7+'/'+_0x4b1650)[_0xcc5d('0x1e')](_0x505bca);}return null;};}function patchUpdates(_0x2caea8){return function(_0x3ad74d){try{jsonpatch['apply'](_0x3ad74d,_0x2caea8,!![]);}catch(_0x5cf080){return BPromise['reject'](_0x5cf080);}return _0x3ad74d[_0xcc5d('0x24')]();};}function saveUpdates(_0x1a6eb8,_0x1936c8){return function(_0x41ac2d){if(_0x41ac2d){return _0x41ac2d['update'](_0x1a6eb8)[_0xcc5d('0x25')](function(_0x240e19){return _0x240e19;});}return null;};}function removeEntity(_0x2c5a5f,_0x2a754a){return function(_0x3615b6){if(_0x3615b6){return _0x3615b6[_0xcc5d('0x26')]()[_0xcc5d('0x25')](function(){_0x2c5a5f[_0xcc5d('0x1d')](0xcc)[_0xcc5d('0x1c')]();});}};}function handleEntityNotFound(_0x4b55aa,_0x4692c3){return function(_0x4bba7b){if(!_0x4bba7b){_0x4b55aa[_0xcc5d('0x27')](0x194);}return _0x4bba7b;};}function handleError(_0x285b3a,_0x226c56){_0x226c56=_0x226c56||0x1f4;return function(_0x4b77ee){logger['error'](_0x4b77ee[_0xcc5d('0x28')]);if(_0x4b77ee['name']){delete _0x4b77ee[_0xcc5d('0x29')];}_0x285b3a[_0xcc5d('0x1d')](_0x226c56)[_0xcc5d('0x2a')](_0x4b77ee);};}function getInteractionUsers(_0xf12ab6,_0x42b04f){return new BPromise(function(_0x33b0f4,_0xced72){try{if(_0x42b04f[_0xf12ab6['id']]){_0xf12ab6[_0xcc5d('0x2b')]=_[_0xcc5d('0x2c')](_0x42b04f[_0xf12ab6['id']],function(_0x3f497b){return{'id':_0x3f497b['id'],'fullname':_0x3f497b[_0xcc5d('0x2d')]};});}}catch(_0x262528){_0xced72(_0x262528);}_0x33b0f4(_0xf12ab6);});}function getInteractionTags(_0x864a27,_0x490110){return new BPromise(function(_0x3fed2d,_0x368422){try{if(_0x864a27[_0xcc5d('0x2e')]){_0x864a27[_0xcc5d('0x2f')]=[];_0x864a27[_0xcc5d('0x2e')]['split'](',')['forEach'](function(_0x466e22){_0x864a27[_0xcc5d('0x2f')][_0xcc5d('0x30')](_0x490110[_0x466e22]);});}delete _0x864a27[_0xcc5d('0x2e')];}catch(_0x2b91ed){_0x368422(_0x2b91ed);}_0x3fed2d(_0x864a27);});}function updateFaxInteraction(_0x5bb3e0,_0x1b3d59,_0x2ee9ad){return new BPromise(function(_0x257c6d,_0x54bbdd){return getInteractionUsers(_0x5bb3e0,_0x2ee9ad)['then'](function(_0x24b7bf){return getInteractionTags(_0x24b7bf,_0x1b3d59);})[_0xcc5d('0x25')](function(_0x326ec6){_0x257c6d(_0x326ec6);})['catch'](function(_0x25f9b6){_0x54bbdd(_0x25f9b6);});});}exports['index']=function(_0x540fe8,_0x32de43){var _0x315a55={},_0x22bfb3={},_0xe96ebd={'count':0x0,'rows':[]};var _0x46e7db=_[_0xcc5d('0x2c')](db[_0xcc5d('0x31')]['rawAttributes'],function(_0x1bbf3a){return{'name':_0x1bbf3a[_0xcc5d('0x32')],'type':_0x1bbf3a[_0xcc5d('0x33')][_0xcc5d('0x34')]};});_0x22bfb3[_0xcc5d('0x35')]=_[_0xcc5d('0x2c')](_0x46e7db,_0xcc5d('0x29'));_0x22bfb3['query']=_[_0xcc5d('0x36')](_0x540fe8[_0xcc5d('0x37')]);_0x22bfb3[_0xcc5d('0x38')]=_[_0xcc5d('0x39')](_0x22bfb3['model'],_0x22bfb3['query']);_0x315a55['attributes']=_[_0xcc5d('0x39')](_0x22bfb3['model'],qs['fields'](_0x540fe8['query']['fields']));_0x315a55[_0xcc5d('0x3a')]=_0x315a55[_0xcc5d('0x3a')][_0xcc5d('0x3b')]?_0x315a55[_0xcc5d('0x3a')]:_0x22bfb3[_0xcc5d('0x35')];if(!_0x540fe8[_0xcc5d('0x37')]['hasOwnProperty'](_0xcc5d('0x3c'))){_0x315a55[_0xcc5d('0x22')]=qs[_0xcc5d('0x22')](_0x540fe8['query'][_0xcc5d('0x22')]);_0x315a55[_0xcc5d('0x1f')]=qs[_0xcc5d('0x1f')](_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x1f')]);}_0x315a55[_0xcc5d('0x3d')]=qs[_0xcc5d('0x3e')](_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x3e')]);_0x315a55[_0xcc5d('0x3f')]=qs[_0xcc5d('0x38')](_[_0xcc5d('0x40')](_0x540fe8[_0xcc5d('0x37')],_0x22bfb3['filters']),_0x46e7db);var _0x4986f2=[];var _0x2be81e=squel['select']()['field']('id')[_0xcc5d('0x41')](_0xcc5d('0x29'))[_0xcc5d('0x41')](_0xcc5d('0x42'))[_0xcc5d('0x43')]('tools_tags');var _0xc239fc=squel[_0xcc5d('0x44')]()[_0xcc5d('0x41')](_0xcc5d('0x45'))['field'](_0xcc5d('0x46'))['field'](_0xcc5d('0x47'))[_0xcc5d('0x43')]('user_has_fax_interactions','ui')[_0xcc5d('0x48')](_0xcc5d('0x49'),'u',_0xcc5d('0x4a'));var _0x4c8a96=squel['select']()['from'](_0xcc5d('0x4b'),'i')[_0xcc5d('0x48')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xcc5d('0x48')](_0xcc5d('0x49'),'o',_0xcc5d('0x4c'))['left_join'](_0xcc5d('0x4d'),'a',_0xcc5d('0x4e'))[_0xcc5d('0x48')]('fax_messages','me',_0xcc5d('0x4f'))[_0xcc5d('0x48')](_0xcc5d('0x50'),'it',_0xcc5d('0x51'))[_0xcc5d('0x48')](_0xcc5d('0x52'),'t','t.id\x20=\x20it.TagId');var _0x594bb6=squel[_0xcc5d('0x53')]();var _0x4808e4=[];var _0x18ada2=squel['expr']();var _0x56eae7;if(_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x54')]){_0x56eae7=as['parseSearch'](_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x54')]);var _0x314a9e=_0x56eae7['sqlOperator'];for(var _0x586b69=0x0;_0x586b69<_0x56eae7[_0xcc5d('0x55')]['length'];_0x586b69++){var _0x4b8d52=_0x56eae7[_0xcc5d('0x55')][_0x586b69];var _0xabee64='i';var _0x822aca=_[_0xcc5d('0x56')](_0x46e7db,[_0xcc5d('0x29'),_0x4b8d52[_0xcc5d('0x41')]]);if(!_0x822aca){switch(_0x4b8d52[_0xcc5d('0x41')]){case _0xcc5d('0x57'):if(_0x4b8d52['value']==0x1){_0x4c8a96['having']('`'+_0x4b8d52[_0xcc5d('0x41')]+_0xcc5d('0x58'));}else{_0x4c8a96['having']('`'+_0x4b8d52[_0xcc5d('0x41')]+_0xcc5d('0x59'));}break;case _0xcc5d('0x5a'):if(_0x4b8d52[_0xcc5d('0x5b')]===_0xcc5d('0x5c')){if(_0x4b8d52[_0xcc5d('0x5d')][_0xcc5d('0x5e')]('\x20')[_0xcc5d('0x3b')]>0x1){_0x594bb6[_0x314a9e](_0xcc5d('0x5f'),qs[_0xcc5d('0x60')](_0x4b8d52['value']),null);}else{var _0x55a122='%'+_0x4b8d52[_0xcc5d('0x5d')]+'%';_0x594bb6[_0x314a9e](_0xcc5d('0x61'),_0x55a122,_0x55a122,_0x55a122);}}else{_0x822aca=_[_0xcc5d('0x56')](_0x46e7db,[_0xcc5d('0x29'),_0xcc5d('0x62')]);_0x4b8d52[_0xcc5d('0x41')]='ContactId';_0x492f4a=as['buildExpression'](_0xabee64,_0x822aca[_0xcc5d('0x33')],_0x4b8d52);_0x594bb6[_0x314a9e](_0x492f4a[_0xcc5d('0x63')],_0x492f4a[_0xcc5d('0x5d')][_0xcc5d('0x64')],_0x492f4a[_0xcc5d('0x5d')][_0xcc5d('0x1c')]);}break;case'Tag':var _0x4559a4=_0x4b8d52[_0xcc5d('0x5d')][_0xcc5d('0x5e')](',')[_0xcc5d('0x2c')](function(_0xdfdf84){return Number(_0xdfdf84);});_0x4559a4[_0xcc5d('0x65')](function(_0x3a9ddc){_0x18ada2['or'](_0xcc5d('0x66'),'%,'+_0x3a9ddc+',%');});_0x4808e4=_[_0xcc5d('0x67')](_0x4808e4,_0x4559a4);break;case _0xcc5d('0x68'):if(_0x4b8d52[_0xcc5d('0x5b')]==='$substring'){_0x594bb6[_0x314a9e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b8d52[_0xcc5d('0x5d')]+'%',null);}else{_0x822aca=_[_0xcc5d('0x56')](_0x46e7db,[_0xcc5d('0x29'),_0xcc5d('0x69')]);_0x4b8d52[_0xcc5d('0x41')]=_0xcc5d('0x69');_0x492f4a=as['buildExpression'](_0xabee64,_0x822aca[_0xcc5d('0x33')],_0x4b8d52);_0x594bb6[_0x314a9e](_0x492f4a['text'],_0x492f4a[_0xcc5d('0x5d')][_0xcc5d('0x64')],_0x492f4a[_0xcc5d('0x5d')][_0xcc5d('0x1c')]);}break;case _0xcc5d('0x6a'):_0x492f4a=as[_0xcc5d('0x6b')]('me',null,_0x4b8d52);_0x594bb6[_0x314a9e](_0x492f4a[_0xcc5d('0x63')],_0x492f4a[_0xcc5d('0x5d')]['start'],_0x492f4a['value'][_0xcc5d('0x1c')]);break;}}else{var _0x492f4a=as[_0xcc5d('0x6b')](_0xabee64,_0x822aca['type'],_0x4b8d52);_0x594bb6[_0x314a9e](_0x492f4a[_0xcc5d('0x63')],_0x492f4a['value'][_0xcc5d('0x64')],_0x492f4a[_0xcc5d('0x5d')][_0xcc5d('0x1c')]);}}}else{var _0x48400b=_(_0x540fe8[_0xcc5d('0x37')])['keys']()[_0xcc5d('0x2c')](function(_0x2d885f){return _[_0xcc5d('0x6c')](_0x46e7db,[_0xcc5d('0x29'),_0x2d885f])?_0x2d885f:undefined;})[_0xcc5d('0x6d')]()[_0xcc5d('0x5d')]();if(!_[_0xcc5d('0x6e')](_0x48400b)){_0x48400b[_0xcc5d('0x65')](function(_0x5ec394){if(_0x5ec394==='FaxAccountId'){_0x4c8a96['where'](_0xcc5d('0x6f'),[][_0xcc5d('0x70')](_0x540fe8[_0xcc5d('0x37')][_0x5ec394]));}else if(_0x5ec394===_0xcc5d('0x71')){var _0x3e35ea=JSON[_0xcc5d('0x72')](_0x540fe8[_0xcc5d('0x37')][_0x5ec394])[_0xcc5d('0x73')];var _0xc9df09=JSON[_0xcc5d('0x72')](_0x540fe8[_0xcc5d('0x37')][_0x5ec394])[_0xcc5d('0x74')];_0x4c8a96['where'](_0xcc5d('0x75'),_0x3e35ea,_0xc9df09);}else{if(_0x540fe8[_0xcc5d('0x37')][_0x5ec394]===_0xcc5d('0x76')){_0x4c8a96[_0xcc5d('0x3f')]('i.'+_0x5ec394+_0xcc5d('0x77'));}else{_0x4c8a96[_0xcc5d('0x3f')]('i.'+_0x5ec394+_0xcc5d('0x78'),_0x540fe8[_0xcc5d('0x37')][_0x5ec394]);}}});}if(_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x79')]){if(_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x79')]==0x1){_0x4c8a96['having']('`unreadMessages`\x20=\x200');}else{_0x4c8a96['having'](_0xcc5d('0x7a'));}}if(_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x7b')]){_0x4808e4=_[_0xcc5d('0x7c')](_0x540fe8['query'][_0xcc5d('0x7b')])?_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x7b')]:new Array(_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x7b')]);_0x4808e4[_0xcc5d('0x65')](function(_0x406ef8){_0x18ada2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x406ef8+',%');});}if(_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x7d')]){var _0x334b26=_0x540fe8[_0xcc5d('0x37')][_0xcc5d('0x7d')][_0xcc5d('0x7e')]('\x5c','\x5c\x5c')[_0xcc5d('0x7e')](/'/g,'\x27\x27');if(qs[_0xcc5d('0x7f')](_0x334b26)){_0x594bb6['or']('i.id\x20LIKE\x20?',_0x334b26+'%')['or'](_0xcc5d('0x80'),_0x334b26+'%');}_0x594bb6['or'](_0xcc5d('0x81'),_0x334b26+'%');}}_0x4c8a96['where'](_0x594bb6);_0x4c8a96[_0xcc5d('0x82')](_0xcc5d('0x83'));var _0x43e93a={'type':db[_0xcc5d('0x84')][_0xcc5d('0x85')]['SELECT'],'raw':!![]};var _0x5711a5=_0x4c8a96[_0xcc5d('0x86')]();_0x5711a5[_0xcc5d('0x41')]('i.id');_0x5711a5[_0xcc5d('0x41')](_0xcc5d('0x87'),_0xcc5d('0x57'));if(_0x315a55[_0xcc5d('0x3d')]){_0x315a55[_0xcc5d('0x3d')][_0xcc5d('0x65')](function(_0x4c8b74){var _0x34e36d=_0x4c8b74[0x0]===_0xcc5d('0x88')?_0x4c8b74[0x0]:'i.'+_0x4c8b74[0x0];_0x4c8a96[_0xcc5d('0x3d')](_0x34e36d,_0x4c8b74[0x1]===_0xcc5d('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x4808e4)){_0x4c8a96['having'](_0x18ada2);_0x5711a5[_0xcc5d('0x3f')]('t.id\x20IN\x20?',_0x4808e4);}BPromise[_0xcc5d('0x8a')]()[_0xcc5d('0x25')](function(){if(!_0x56eae7){if(_0x540fe8[_0xcc5d('0x37')]['FaxAccountId'])return;_0x5711a5['where'](_0xcc5d('0x8b'));_0x4c8a96[_0xcc5d('0x3f')](_0xcc5d('0x8b'));return;}if(_0x540fe8[_0xcc5d('0x8c')][_0xcc5d('0x8d')]!=='agent')return;return _0x540fe8['user'][_0xcc5d('0x8e')]({'attributes':['id'],'raw':!![]})[_0xcc5d('0x25')](function(_0x2d09d1){if(_[_0xcc5d('0x6e')](_0x2d09d1)){_0x5711a5[_0xcc5d('0x3f')](_0xcc5d('0x8f'));_0x4c8a96[_0xcc5d('0x3f')](_0xcc5d('0x8f'));}else{_0x5711a5[_0xcc5d('0x3f')](_0xcc5d('0x6f'),_[_0xcc5d('0x2c')](_0x2d09d1,'id'));_0x4c8a96[_0xcc5d('0x3f')](_0xcc5d('0x6f'),_[_0xcc5d('0x2c')](_0x2d09d1,'id'));}});})[_0xcc5d('0x25')](function(){if(_0x540fe8[_0xcc5d('0x8c')][_0xcc5d('0x8d')]===_0xcc5d('0x90')&&!_0x56eae7&&!_0x540fe8['query'][_0xcc5d('0x91')])return[];return db[_0xcc5d('0x92')][_0xcc5d('0x37')](_0x5711a5[_0xcc5d('0x93')](),_0x43e93a);})['then'](function(_0x302126){_0xe96ebd[_0xcc5d('0x21')]=_0x302126[_0xcc5d('0x3b')];if(_0xe96ebd['count']===0x0)return[];return db[_0xcc5d('0x92')]['query'](_0x2be81e[_0xcc5d('0x93')](),_0x43e93a)['then'](function(_0x4dd89b){_0x4986f2=_[_0xcc5d('0x94')](_0x4dd89b,'id');_0x43e93a=_[_0xcc5d('0x95')](_0x43e93a,{'model':db[_0xcc5d('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x540fe8[_0xcc5d('0x37')]['fields']){_0x315a55[_0xcc5d('0x3a')]['forEach'](function(_0xce8854){_0x4c8a96[_0xcc5d('0x41')]('i.'+_0xce8854);});}else{_0x4c8a96[_0xcc5d('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xcc5d('0x57'));_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0x96'),_0xcc5d('0x97'));_0x4c8a96[_0xcc5d('0x41')]('a.mandatoryDisposition',_0xcc5d('0x98'));_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0x99'),_0xcc5d('0x88'));_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0x9a'));_0x4c8a96['field'](_0xcc5d('0x9b'),_0xcc5d('0x9c'));_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0x9d'),_0xcc5d('0x9e'));_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0x9f'),_0xcc5d('0xa0'));_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0xa1'),_0xcc5d('0xa2'));_0x4c8a96['field'](_0xcc5d('0xa3'),_0xcc5d('0xa4'));_0x4c8a96['field'](_0xcc5d('0xa5'),_0xcc5d('0xa6'));_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0xa7'),'Owner.fullname');_0x4c8a96[_0xcc5d('0x41')](_0xcc5d('0xa8'),_0xcc5d('0xa9'));_0x4c8a96['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xcc5d('0x2e'));}if(_0x315a55[_0xcc5d('0x22')])_0x4c8a96['limit'](_0x315a55[_0xcc5d('0x22')]);if(_0x315a55[_0xcc5d('0x1f')])_0x4c8a96[_0xcc5d('0x1f')](_0x315a55[_0xcc5d('0x1f')]);return db[_0xcc5d('0x92')][_0xcc5d('0x37')](_0x4c8a96['toString'](),_0x43e93a);})['then'](function(_0x241a43){if(_0x241a43[_0xcc5d('0x3b')]>0x0)_0xc239fc[_0xcc5d('0x3f')](_0xcc5d('0xaa'),_[_0xcc5d('0x2c')](_0x241a43,'id'));return db[_0xcc5d('0x92')][_0xcc5d('0x37')](_0xc239fc[_0xcc5d('0x93')](),_0x43e93a)[_0xcc5d('0x25')](function(_0x2ab564){var _0x5f288b=_[_0xcc5d('0xab')](_0x2ab564,'FaxInteractionId');var _0x94ba40=[];_0x241a43[_0xcc5d('0x65')](function(_0x10c5b0){_0x94ba40[_0xcc5d('0x30')](updateFaxInteraction(_0x10c5b0,_0x4986f2,_0x5f288b));});return BPromise[_0xcc5d('0xac')](_0x94ba40);});});})[_0xcc5d('0x25')](function(_0x1a5e94){_0xe96ebd[_0xcc5d('0xad')]=_0x1a5e94;return _0xe96ebd;})['then'](respondWithFilteredResult(_0x32de43,_0x315a55))[_0xcc5d('0xae')](handleError(_0x32de43,null));};exports['show']=function(_0x61c5ee,_0x129bb8){var _0x133b4a={'raw':![],'where':{'id':_0x61c5ee[_0xcc5d('0xaf')]['id']}},_0x181e9c={};_0x181e9c[_0xcc5d('0x35')]=_[_0xcc5d('0x36')](db[_0xcc5d('0x31')][_0xcc5d('0xb0')]);_0x181e9c[_0xcc5d('0x37')]=_[_0xcc5d('0x36')](_0x61c5ee[_0xcc5d('0x37')]);_0x181e9c['filters']=_[_0xcc5d('0x39')](_0x181e9c[_0xcc5d('0x35')],_0x181e9c[_0xcc5d('0x37')]);_0x133b4a[_0xcc5d('0x3a')]=_[_0xcc5d('0x39')](_0x181e9c[_0xcc5d('0x35')],qs[_0xcc5d('0xb1')](_0x61c5ee['query'][_0xcc5d('0xb1')]));_0x133b4a[_0xcc5d('0x3a')]=_0x133b4a[_0xcc5d('0x3a')][_0xcc5d('0x3b')]?_0x133b4a[_0xcc5d('0x3a')]:_0x181e9c[_0xcc5d('0x35')];if(_0x61c5ee[_0xcc5d('0x37')][_0xcc5d('0xb2')]){_0x133b4a[_0xcc5d('0xb3')]=[{'all':!![]}];}_0x133b4a=_[_0xcc5d('0x95')]({},_0x133b4a,_0x61c5ee[_0xcc5d('0xb4')]);return db[_0xcc5d('0x31')][_0xcc5d('0x56')](_0x133b4a)[_0xcc5d('0x25')](handleEntityNotFound(_0x129bb8,null))[_0xcc5d('0x25')](respondWithResult(_0x129bb8,null))['catch'](handleError(_0x129bb8,null));};exports[_0xcc5d('0xb5')]=function(_0xc2ba69,_0x3040a2){return db[_0xcc5d('0x31')]['create'](_0xc2ba69['body'],{})[_0xcc5d('0x25')](respondWithResult(_0x3040a2,0xc9))[_0xcc5d('0xae')](handleError(_0x3040a2,null));};exports[_0xcc5d('0xb6')]=function(_0x12a8cc,_0x2f93aa){if(_0x12a8cc[_0xcc5d('0x6a')]['id']){delete _0x12a8cc[_0xcc5d('0x6a')]['id'];}return db[_0xcc5d('0x31')]['find']({'where':{'id':_0x12a8cc[_0xcc5d('0xaf')]['id']}})['then'](handleEntityNotFound(_0x2f93aa,null))[_0xcc5d('0x25')](saveUpdates(_0x12a8cc['body'],null))[_0xcc5d('0x25')](respondWithResult(_0x2f93aa,null))[_0xcc5d('0xae')](handleError(_0x2f93aa,null));};exports[_0xcc5d('0x26')]=function(_0x25a386,_0xbff504){return db[_0xcc5d('0x31')][_0xcc5d('0x56')]({'where':{'id':_0x25a386['params']['id']}})[_0xcc5d('0x25')](handleEntityNotFound(_0xbff504,null))[_0xcc5d('0x25')](removeEntity(_0xbff504,null))['catch'](handleError(_0xbff504,null));};exports[_0xcc5d('0xb7')]=function(_0xbeafe1,_0x3cbd5e){return db[_0xcc5d('0x31')][_0xcc5d('0xb7')]()[_0xcc5d('0x25')](respondWithResult(_0x3cbd5e,null))['catch'](handleError(_0x3cbd5e,null));};exports['addMessage']=function(_0x21c84a,_0x1008fe,_0x1d15ad){return db[_0xcc5d('0xb8')][_0xcc5d('0x56')]({'where':{'id':_0x21c84a[_0xcc5d('0xaf')]['id']}})[_0xcc5d('0x25')](handleEntityNotFound(_0x1008fe,null))['then'](function(_0x1f47dc){if(_0x1f47dc){return _0x1f47dc[_0xcc5d('0xb9')](_0x21c84a[_0xcc5d('0x6a')]['ids'],_[_0xcc5d('0xba')](_0x21c84a['body'],[_0xcc5d('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x1008fe,null))[_0xcc5d('0xae')](handleError(_0x1008fe,null));};exports['getMessages']=function(_0x304746,_0x14a065,_0x16dbc0){var _0x67e076={'raw':![],'where':{}};var _0x5b7052={};var _0x18edd3={'count':0x0,'rows':[]};return db[_0xcc5d('0x31')]['findOne']({'where':{'id':_0x304746['params']['id']}})[_0xcc5d('0x25')](handleEntityNotFound(_0x14a065,null))[_0xcc5d('0x25')](function(_0x5ca5d8){if(_0x5ca5d8){_0x5b7052['model']=_[_0xcc5d('0x36')](db['FaxMessage'][_0xcc5d('0xb0')]);_0x5b7052['query']=_[_0xcc5d('0x36')](_0x304746['query']);_0x5b7052[_0xcc5d('0x38')]=_[_0xcc5d('0x39')](_0x5b7052[_0xcc5d('0x35')],_0x5b7052['query']);_0x67e076[_0xcc5d('0x3a')]=_[_0xcc5d('0x39')](_0x5b7052[_0xcc5d('0x35')],qs['fields'](_0x304746[_0xcc5d('0x37')][_0xcc5d('0xb1')]));_0x67e076[_0xcc5d('0x3a')]=_0x67e076[_0xcc5d('0x3a')][_0xcc5d('0x3b')]?_0x67e076[_0xcc5d('0x3a')]:_0x5b7052[_0xcc5d('0x35')];if(!_0x304746[_0xcc5d('0x37')][_0xcc5d('0xbc')](_0xcc5d('0x3c'))){_0x67e076['limit']=qs['limit'](_0x304746['query'][_0xcc5d('0x22')]);_0x67e076[_0xcc5d('0x1f')]=qs['offset'](_0x304746[_0xcc5d('0x37')]['offset']);}_0x67e076[_0xcc5d('0x3d')]=qs[_0xcc5d('0x3e')](_0x304746['query']['sort']);_0x67e076[_0xcc5d('0x3f')]=qs[_0xcc5d('0x38')](_[_0xcc5d('0x40')](_0x304746['query'],_0x5b7052[_0xcc5d('0x38')]));_0x67e076[_0xcc5d('0x3f')][_0xcc5d('0xbd')]=_0x5ca5d8['id'];if(_0x304746['query'][_0xcc5d('0x7d')]){_0x67e076[_0xcc5d('0x3f')]=_['merge'](_0x67e076[_0xcc5d('0x3f')],{'$or':_[_0xcc5d('0x2c')](_0x67e076['attributes'],function(_0x4554ff){var _0x1f8925={};_0x1f8925[_0x4554ff]={'$like':'%'+_0x304746[_0xcc5d('0x37')][_0xcc5d('0x7d')]+'%'};return _0x1f8925;})});}if(_0x304746[_0xcc5d('0x37')][_0xcc5d('0x73')]){var _0x8355cb=_0x304746['query']['$gte'][_0xcc5d('0x5e')](',');var _0x2f4cff={};_0x2f4cff[_0x8355cb[0x0]]={'$gte':moment(_0x8355cb[0x1])[_0xcc5d('0xbe')](_0xcc5d('0xbf'))};_0x67e076['where']=_[_0xcc5d('0x95')](_0x67e076[_0xcc5d('0x3f')],_0x2f4cff);}_0x67e076=_[_0xcc5d('0x95')]({},_0x67e076,_0x304746[_0xcc5d('0xb4')]);return db[_0xcc5d('0xb8')]['count']({'where':_0x67e076['where']})[_0xcc5d('0x25')](function(_0x344d5a){_0x18edd3['count']=_0x344d5a;if(_0x304746[_0xcc5d('0x37')][_0xcc5d('0xb2')]){_0x67e076[_0xcc5d('0xb3')]=[{'all':!![]}];}return db[_0xcc5d('0xb8')][_0xcc5d('0xc0')](_0x67e076);})[_0xcc5d('0x25')](function(_0x73b1ed){_0x18edd3[_0xcc5d('0xad')]=_0x73b1ed;return _0x18edd3;});}})[_0xcc5d('0x25')](respondWithFilteredResult(_0x14a065,_0x67e076))[_0xcc5d('0xae')](handleError(_0x14a065,null));};exports[_0xcc5d('0xc1')]=function(_0x3edd72,_0x40f65a,_0x3bcdf7){return db[_0xcc5d('0x31')][_0xcc5d('0x56')]({'where':{'id':_0x3edd72[_0xcc5d('0xaf')]['id']}})['then'](handleEntityNotFound(_0x40f65a,null))[_0xcc5d('0x25')](function(_0x1782e3){if(_0x1782e3){return _0x1782e3[_0xcc5d('0xc2')](_0x3edd72[_0xcc5d('0x6a')][_0xcc5d('0xbb')],_[_0xcc5d('0xba')](_0x3edd72[_0xcc5d('0x6a')],['ids','id'])||{})[_0xcc5d('0xc3')](function(){return db[_0xcc5d('0xc4')][_0xcc5d('0xc0')]({'attributes':['id','name',_0xcc5d('0x42')],'where':{'id':_0x3edd72[_0xcc5d('0x6a')][_0xcc5d('0xbb')]}});})[_0xcc5d('0x25')](function(_0x4dd96c){socket[_0xcc5d('0xc5')]('faxInteractionTags:save',{'id':Number(_0x3edd72[_0xcc5d('0xaf')]['id']),'tags':_0x4dd96c||[]});return{'id':Number(_0x3edd72['params']['id']),'tags':_0x4dd96c||[]};});}})['then'](respondWithResult(_0x40f65a,null))[_0xcc5d('0xae')](handleError(_0x40f65a,null));};exports[_0xcc5d('0xc6')]=function(_0x492421,_0x1ea05a,_0x3b0d58){return db[_0xcc5d('0x31')]['find']({'where':{'id':_0x492421[_0xcc5d('0xaf')]['id']}})[_0xcc5d('0x25')](handleEntityNotFound(_0x1ea05a,null))[_0xcc5d('0x25')](function(_0x1eb22b){if(_0x1eb22b){return _0x1eb22b[_0xcc5d('0xc6')](_0x492421[_0xcc5d('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x1ea05a,null))[_0xcc5d('0xae')](handleError(_0x1ea05a,null));};exports[_0xcc5d('0xc7')]=function(_0x18517a,_0x3d8ff4){var _0x4ee956=moment()[_0xcc5d('0xc8')]()['toString']();var _0x1b9511=path[_0xcc5d('0xc9')](config[_0xcc5d('0xca')],'server',_0xcc5d('0xcb'),'tmp');var _0x1f5dc6=path[_0xcc5d('0xc9')](config[_0xcc5d('0xca')],'server',_0xcc5d('0xcb'),_0xcc5d('0xcc'));var _0x54adf3=path[_0xcc5d('0xc9')](_0x1b9511,_0x4ee956);var _0x1078b8=util[_0xcc5d('0xbe')]('transcript-%d-%s.zip',_0x18517a[_0xcc5d('0xaf')]['id'],_0x4ee956);var _0x111d5e=path[_0xcc5d('0xc9')](_0x1b9511,_0x1078b8);var _0x78b9f0=[];_0x78b9f0[_0xcc5d('0x30')]({'model':db[_0xcc5d('0xcd')],'as':_0xcc5d('0xcd'),'raw':!![]});var _0x3a0e00=[{'model':db[_0xcc5d('0xb8')],'as':_0xcc5d('0xce'),'attributes':['id','body','createdAt'],'include':_0x78b9f0}];return db[_0xcc5d('0x31')][_0xcc5d('0x56')]({'where':{'id':_0x18517a[_0xcc5d('0xaf')]['id']},'include':_0x3a0e00})['then'](handleEntityNotFound(_0x3d8ff4,null))[_0xcc5d('0x25')](function(_0x31dd33){if(_0x31dd33&&_0x31dd33[_0xcc5d('0xce')]){var _0x531be9=_0x31dd33[_0xcc5d('0xcf')]({'plain':!![]});fs[_0xcc5d('0xd0')](_0x54adf3);for(var _0x588a31=0x0;_0x588a31<_0x531be9['Messages'][_0xcc5d('0x3b')];_0x588a31++){var _0x4e8a56=_0x531be9[_0xcc5d('0xce')][_0x588a31][_0xcc5d('0xcd')];if(_0x4e8a56){var _0x53b2a0=path[_0xcc5d('0xc9')](_0x1f5dc6,_0x4e8a56[_0xcc5d('0xd1')]);if(fs[_0xcc5d('0xd2')](_0x53b2a0)){fs['createReadStream'](_0x53b2a0)[_0xcc5d('0xd3')](fs[_0xcc5d('0xd4')](path[_0xcc5d('0xc9')](_0x54adf3,_0x4e8a56[_0xcc5d('0xd1')])));}}}return BPromise[_0xcc5d('0x8a')]()['then'](function(){return new BPromise(function(_0x99db37,_0x34a0fd){zipdir(_0x54adf3,{'saveTo':_0x111d5e},function(_0x2062e9,_0x2dc8e9){if(_0x2062e9)return _0x34a0fd(_0x2062e9);return _0x99db37(_0x2dc8e9);});})[_0xcc5d('0x25')](function(){return new BPromise(function(_0x1f3d75,_0x7bc115){rimraf(_0x54adf3,function(_0x40ba20){if(_0x40ba20)_0x7bc115(_0x40ba20);return _0x1f3d75();});});})['then'](function(){return _0x3d8ff4[_0xcc5d('0xc7')](_0x111d5e,_0x1078b8,function(_0x2b25d7){if(_0x2b25d7){console[_0xcc5d('0xd5')](_0xcc5d('0xd6'),_0x2b25d7);}else{fs[_0xcc5d('0xd7')](_0x111d5e);}});});});}else{return _0x3d8ff4['sendStatus'](0xc8);}})['catch'](handleError(_0x3d8ff4,null));};
\ No newline at end of file
+var _0xc8d7=['root','server','files','attachments','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','err','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','FaxInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','FaxAccountId','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','tag','filter','replace','isNumeric','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','isEmpty','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','agent','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','push','all','show','params','includeAll','include','create','describe','addMessage','FaxMessage','omit','ids','findOne','fields','merge','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','join'];(function(_0x1e878f,_0x3a63e7){var _0x442563=function(_0x311f4d){while(--_0x311f4d){_0x1e878f['push'](_0x1e878f['shift']());}};_0x442563(++_0x3a63e7);}(_0xc8d7,0x1a9));var _0x7c8d=function(_0x358480,_0x53782f){_0x358480=_0x358480-0x0;var _0x51d1a9=_0xc8d7[_0x358480];return _0x51d1a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c8d('0x0'));var jsonpatch=require(_0x7c8d('0x1'));var rp=require(_0x7c8d('0x2'));var moment=require(_0x7c8d('0x3'));var BPromise=require(_0x7c8d('0x4'));var Mustache=require('mustache');var util=require(_0x7c8d('0x5'));var path=require(_0x7c8d('0x6'));var sox=require('sox');var csv=require(_0x7c8d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c8d('0x8'));var _=require(_0x7c8d('0x9'));var squel=require(_0x7c8d('0xa'));var crypto=require(_0x7c8d('0xb'));var jsforce=require(_0x7c8d('0xc'));var deskjs=require(_0x7c8d('0xd'));var toCsv=require(_0x7c8d('0x7'));var querystring=require(_0x7c8d('0xe'));var Papa=require(_0x7c8d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7c8d('0x10'));var hardwareService=require(_0x7c8d('0x11'));var logger=require(_0x7c8d('0x12'))(_0x7c8d('0x13'));var utils=require('../../config/utils');var config=require(_0x7c8d('0x14'));var licenseUtil=require(_0x7c8d('0x15'));var db=require('../../mysqldb')['db'];config[_0x7c8d('0x16')]=_[_0x7c8d('0x17')](config[_0x7c8d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c8d('0x18'))(new Redis(config[_0x7c8d('0x16')]));require(_0x7c8d('0x19'))['register'](socket);function respondWithStatusCode(_0x1b7de9,_0x4ff301){_0x4ff301=_0x4ff301||0xcc;return function(_0x417b04){if(_0x417b04){return _0x1b7de9[_0x7c8d('0x1a')](_0x4ff301);}return _0x1b7de9['status'](_0x4ff301)[_0x7c8d('0x1b')]();};}function respondWithResult(_0x199dca,_0x5b67a9){_0x5b67a9=_0x5b67a9||0xc8;return function(_0x1ee87b){if(_0x1ee87b){return _0x199dca[_0x7c8d('0x1c')](_0x5b67a9)[_0x7c8d('0x1d')](_0x1ee87b);}};}function respondWithFilteredResult(_0x48b15e,_0x28c467){return function(_0x356e93){if(_0x356e93){var _0x10cd3c=typeof _0x28c467[_0x7c8d('0x1e')]===_0x7c8d('0x1f')&&typeof _0x28c467['limit']===_0x7c8d('0x1f');var _0x61fca4=_0x356e93[_0x7c8d('0x20')];var _0x3c62b9=_0x10cd3c?0x0:_0x28c467[_0x7c8d('0x1e')];var _0x330d13=_0x10cd3c?_0x356e93[_0x7c8d('0x20')]:_0x28c467['offset']+_0x28c467['limit'];var _0x8fac83;if(_0x330d13>=_0x61fca4){_0x330d13=_0x61fca4;_0x8fac83=0xc8;}else{_0x8fac83=0xce;}_0x48b15e[_0x7c8d('0x1c')](_0x8fac83);return _0x48b15e[_0x7c8d('0x21')]('Content-Range',_0x3c62b9+'-'+_0x330d13+'/'+_0x61fca4)[_0x7c8d('0x1d')](_0x356e93);}return null;};}function patchUpdates(_0x3d8439){return function(_0x44ef6f){try{jsonpatch[_0x7c8d('0x22')](_0x44ef6f,_0x3d8439,!![]);}catch(_0x651588){return BPromise[_0x7c8d('0x23')](_0x651588);}return _0x44ef6f[_0x7c8d('0x24')]();};}function saveUpdates(_0x38f7fc,_0x139d55){return function(_0x45a80a){if(_0x45a80a){return _0x45a80a[_0x7c8d('0x25')](_0x38f7fc)[_0x7c8d('0x26')](function(_0x2a49e6){return _0x2a49e6;});}return null;};}function removeEntity(_0x124615,_0x145ce9){return function(_0x5bc79a){if(_0x5bc79a){return _0x5bc79a[_0x7c8d('0x27')]()['then'](function(){_0x124615[_0x7c8d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x95230f,_0x1c854a){return function(_0xbb84e4){if(!_0xbb84e4){_0x95230f[_0x7c8d('0x1a')](0x194);}return _0xbb84e4;};}function handleError(_0x225f74,_0x379022){_0x379022=_0x379022||0x1f4;return function(_0x340bba){logger[_0x7c8d('0x28')](_0x340bba[_0x7c8d('0x29')]);if(_0x340bba[_0x7c8d('0x2a')]){delete _0x340bba[_0x7c8d('0x2a')];}_0x225f74[_0x7c8d('0x1c')](_0x379022)[_0x7c8d('0x2b')](_0x340bba);};}function getInteractionUsers(_0x1582d6,_0x4b728e){return new BPromise(function(_0x15037f,_0x235305){try{if(_0x4b728e[_0x1582d6['id']]){_0x1582d6[_0x7c8d('0x2c')]=_[_0x7c8d('0x2d')](_0x4b728e[_0x1582d6['id']],function(_0x563028){return{'id':_0x563028['id'],'fullname':_0x563028[_0x7c8d('0x2e')]};});}}catch(_0xda25fe){_0x235305(_0xda25fe);}_0x15037f(_0x1582d6);});}function getInteractionTags(_0x43f010,_0x48271e){return new BPromise(function(_0x3cebf6,_0x45c9b7){try{if(_0x43f010[_0x7c8d('0x2f')]){_0x43f010[_0x7c8d('0x30')]=[];_0x43f010[_0x7c8d('0x2f')][_0x7c8d('0x31')](',')[_0x7c8d('0x32')](function(_0x220d62){_0x43f010[_0x7c8d('0x30')]['push'](_0x48271e[_0x220d62]);});}delete _0x43f010['TagIds'];}catch(_0x47f044){_0x45c9b7(_0x47f044);}_0x3cebf6(_0x43f010);});}function updateFaxInteraction(_0x2236ae,_0x3940d1,_0x1276e9){return new BPromise(function(_0x2d2fd4,_0x5e2b47){return getInteractionUsers(_0x2236ae,_0x1276e9)['then'](function(_0xb13978){return getInteractionTags(_0xb13978,_0x3940d1);})[_0x7c8d('0x26')](function(_0x2f1e99){_0x2d2fd4(_0x2f1e99);})[_0x7c8d('0x33')](function(_0x25dc40){_0x5e2b47(_0x25dc40);});});}exports['index']=function(_0x2ae6e0,_0x31721d){var _0x2d7fcb={},_0x2612b4={},_0x27d550={'count':0x0,'rows':[]};var _0x52cf35=_[_0x7c8d('0x2d')](db[_0x7c8d('0x34')][_0x7c8d('0x35')],function(_0x245fb4){return{'name':_0x245fb4[_0x7c8d('0x36')],'type':_0x245fb4[_0x7c8d('0x37')]['key']};});_0x2612b4[_0x7c8d('0x38')]=_[_0x7c8d('0x2d')](_0x52cf35,_0x7c8d('0x2a'));_0x2612b4['query']=_['keys'](_0x2ae6e0[_0x7c8d('0x39')]);_0x2612b4[_0x7c8d('0x3a')]=_[_0x7c8d('0x3b')](_0x2612b4[_0x7c8d('0x38')],_0x2612b4[_0x7c8d('0x39')]);_0x2d7fcb[_0x7c8d('0x3c')]=_[_0x7c8d('0x3b')](_0x2612b4[_0x7c8d('0x38')],qs['fields'](_0x2ae6e0[_0x7c8d('0x39')]['fields']));_0x2d7fcb[_0x7c8d('0x3c')]=_0x2d7fcb[_0x7c8d('0x3c')][_0x7c8d('0x3d')]?_0x2d7fcb[_0x7c8d('0x3c')]:_0x2612b4[_0x7c8d('0x38')];if(!_0x2ae6e0['query'][_0x7c8d('0x3e')](_0x7c8d('0x3f'))){_0x2d7fcb[_0x7c8d('0x40')]=qs['limit'](_0x2ae6e0['query']['limit']);_0x2d7fcb['offset']=qs['offset'](_0x2ae6e0['query'][_0x7c8d('0x1e')]);}_0x2d7fcb['order']=qs[_0x7c8d('0x41')](_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x41')]);_0x2d7fcb[_0x7c8d('0x42')]=qs[_0x7c8d('0x3a')](_[_0x7c8d('0x43')](_0x2ae6e0[_0x7c8d('0x39')],_0x2612b4['filters']),_0x52cf35);var _0x2b11d5=[];var _0xc14730=squel[_0x7c8d('0x44')]()[_0x7c8d('0x45')]('id')[_0x7c8d('0x45')](_0x7c8d('0x2a'))[_0x7c8d('0x45')](_0x7c8d('0x46'))[_0x7c8d('0x47')](_0x7c8d('0x48'));var _0x5c39d3=squel[_0x7c8d('0x44')]()[_0x7c8d('0x45')](_0x7c8d('0x49'))[_0x7c8d('0x45')]('u.fullname')['field']('ui.FaxInteractionId')[_0x7c8d('0x47')](_0x7c8d('0x4a'),'ui')['left_join'](_0x7c8d('0x4b'),'u',_0x7c8d('0x4c'));var _0x1ecb1c=squel['select']()[_0x7c8d('0x47')](_0x7c8d('0x4d'),'i')[_0x7c8d('0x4e')]('cm_contacts','c',_0x7c8d('0x4f'))[_0x7c8d('0x4e')](_0x7c8d('0x4b'),'o',_0x7c8d('0x50'))[_0x7c8d('0x4e')]('fax_accounts','a',_0x7c8d('0x51'))[_0x7c8d('0x4e')](_0x7c8d('0x52'),'me',_0x7c8d('0x53'))[_0x7c8d('0x4e')]('fax_interaction_has_tags','it',_0x7c8d('0x54'))[_0x7c8d('0x4e')](_0x7c8d('0x48'),'t',_0x7c8d('0x55'));var _0x5bbcf8=squel['expr']();var _0x2c10f0=[];var _0x183a28=squel[_0x7c8d('0x56')]();var _0x2cf2cf;if(_0x2ae6e0['query']['search']){_0x2cf2cf=as[_0x7c8d('0x57')](_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x58')]);var _0x3aebb3=_0x2cf2cf['sqlOperator'];for(var _0x1fec7c=0x0;_0x1fec7c<_0x2cf2cf[_0x7c8d('0x59')]['length'];_0x1fec7c++){var _0x1d2449=_0x2cf2cf[_0x7c8d('0x59')][_0x1fec7c];var _0x3764ad='i';var _0x3db07e=_[_0x7c8d('0x5a')](_0x52cf35,[_0x7c8d('0x2a'),_0x1d2449['field']]);if(!_0x3db07e){switch(_0x1d2449[_0x7c8d('0x45')]){case'unreadMessages':if(_0x1d2449['value']==0x1){_0x1ecb1c['having']('`'+_0x1d2449['field']+_0x7c8d('0x5b'));}else{_0x1ecb1c['having']('`'+_0x1d2449[_0x7c8d('0x45')]+_0x7c8d('0x5c'));}break;case _0x7c8d('0x5d'):if(_0x1d2449['operator']===_0x7c8d('0x5e')){if(_0x1d2449[_0x7c8d('0x5f')]['split']('\x20')[_0x7c8d('0x3d')]>0x1){_0x5bbcf8[_0x3aebb3](_0x7c8d('0x60'),qs[_0x7c8d('0x61')](_0x1d2449['value']),null);}else{var _0x177bfb='%'+_0x1d2449[_0x7c8d('0x5f')]+'%';_0x5bbcf8[_0x3aebb3](_0x7c8d('0x62'),_0x177bfb,_0x177bfb,_0x177bfb);}}else{_0x3db07e=_[_0x7c8d('0x5a')](_0x52cf35,[_0x7c8d('0x2a'),_0x7c8d('0x63')]);_0x1d2449[_0x7c8d('0x45')]=_0x7c8d('0x63');_0xf17271=as[_0x7c8d('0x64')](_0x3764ad,_0x3db07e[_0x7c8d('0x37')],_0x1d2449);_0x5bbcf8[_0x3aebb3](_0xf17271[_0x7c8d('0x65')],_0xf17271[_0x7c8d('0x5f')]['start'],_0xf17271['value'][_0x7c8d('0x1b')]);}break;case _0x7c8d('0x66'):var _0x5da9fb=_0x1d2449[_0x7c8d('0x5f')]['split'](',')[_0x7c8d('0x2d')](function(_0x27e9c1){return Number(_0x27e9c1);});_0x5da9fb[_0x7c8d('0x32')](function(_0x61bc97){_0x183a28['or'](_0x7c8d('0x67'),'%,'+_0x61bc97+',%');});_0x2c10f0=_[_0x7c8d('0x68')](_0x2c10f0,_0x5da9fb);break;case'User':if(_0x1d2449[_0x7c8d('0x69')]==='$substring'){_0x5bbcf8[_0x3aebb3](_0x7c8d('0x6a'),'%'+_0x1d2449['value']+'%',null);}else{_0x3db07e=_[_0x7c8d('0x5a')](_0x52cf35,['name',_0x7c8d('0x6b')]);_0x1d2449[_0x7c8d('0x45')]='UserId';_0xf17271=as[_0x7c8d('0x64')](_0x3764ad,_0x3db07e[_0x7c8d('0x37')],_0x1d2449);_0x5bbcf8[_0x3aebb3](_0xf17271[_0x7c8d('0x65')],_0xf17271[_0x7c8d('0x5f')][_0x7c8d('0x6c')],_0xf17271[_0x7c8d('0x5f')]['end']);}break;case _0x7c8d('0x6d'):_0xf17271=as[_0x7c8d('0x64')]('me',null,_0x1d2449);_0x5bbcf8[_0x3aebb3](_0xf17271['text'],_0xf17271[_0x7c8d('0x5f')][_0x7c8d('0x6c')],_0xf17271['value']['end']);break;}}else{var _0xf17271=as[_0x7c8d('0x64')](_0x3764ad,_0x3db07e[_0x7c8d('0x37')],_0x1d2449);_0x5bbcf8[_0x3aebb3](_0xf17271[_0x7c8d('0x65')],_0xf17271[_0x7c8d('0x5f')][_0x7c8d('0x6c')],_0xf17271[_0x7c8d('0x5f')]['end']);}}}else{var _0x3af3e7=_(_0x2ae6e0[_0x7c8d('0x39')])[_0x7c8d('0x6e')]()[_0x7c8d('0x2d')](function(_0x1e5871){return _[_0x7c8d('0x6f')](_0x52cf35,[_0x7c8d('0x2a'),_0x1e5871])?_0x1e5871:undefined;})['compact']()[_0x7c8d('0x5f')]();if(!_['isEmpty'](_0x3af3e7)){_0x3af3e7['forEach'](function(_0x37040a){if(_0x37040a===_0x7c8d('0x70')){_0x1ecb1c['where']('i.FaxAccountId\x20IN\x20?',[][_0x7c8d('0x71')](_0x2ae6e0[_0x7c8d('0x39')][_0x37040a]));}else if(_0x37040a==='createdAt'){var _0x4e091b=JSON[_0x7c8d('0x72')](_0x2ae6e0[_0x7c8d('0x39')][_0x37040a])[_0x7c8d('0x73')];var _0x4cc457=JSON[_0x7c8d('0x72')](_0x2ae6e0[_0x7c8d('0x39')][_0x37040a])[_0x7c8d('0x74')];_0x1ecb1c[_0x7c8d('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e091b,_0x4cc457);}else{if(_0x2ae6e0[_0x7c8d('0x39')][_0x37040a]===_0x7c8d('0x75')){_0x1ecb1c[_0x7c8d('0x42')]('i.'+_0x37040a+_0x7c8d('0x76'));}else{_0x1ecb1c[_0x7c8d('0x42')]('i.'+_0x37040a+_0x7c8d('0x77'),_0x2ae6e0['query'][_0x37040a]);}}});}if(_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x78')]){if(_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x78')]==0x1){_0x1ecb1c['having'](_0x7c8d('0x79'));}else{_0x1ecb1c[_0x7c8d('0x7a')]('`unreadMessages`\x20>\x200');}}if(_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x7b')]){_0x2c10f0=_['isArray'](_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x7b')])?_0x2ae6e0['query']['tag']:new Array(_0x2ae6e0[_0x7c8d('0x39')]['tag']);_0x2c10f0['forEach'](function(_0x2b5b76){_0x183a28['or'](_0x7c8d('0x67'),'%,'+_0x2b5b76+',%');});}if(_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x7c')]){var _0x59dc95=_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x7c')]['replace']('\x5c','\x5c\x5c')[_0x7c8d('0x7d')](/'/g,'\x27\x27');if(qs[_0x7c8d('0x7e')](_0x59dc95)){_0x5bbcf8['or']('i.id\x20LIKE\x20?',_0x59dc95+'%')['or']('i.fax\x20LIKE\x20?',_0x59dc95+'%');}_0x5bbcf8['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x59dc95+'%');}}_0x1ecb1c[_0x7c8d('0x42')](_0x5bbcf8);_0x1ecb1c[_0x7c8d('0x7f')](_0x7c8d('0x80'));var _0x144834={'type':db['Sequelize'][_0x7c8d('0x81')]['SELECT'],'raw':!![]};var _0x2b5846=_0x1ecb1c[_0x7c8d('0x82')]();_0x2b5846[_0x7c8d('0x45')]('i.id');_0x2b5846[_0x7c8d('0x45')](_0x7c8d('0x83'),_0x7c8d('0x84'));if(_0x2d7fcb['order']){_0x2d7fcb[_0x7c8d('0x85')][_0x7c8d('0x32')](function(_0x298f1d){var _0x2c8cb7=_0x298f1d[0x0]===_0x7c8d('0x86')?_0x298f1d[0x0]:'i.'+_0x298f1d[0x0];_0x1ecb1c[_0x7c8d('0x85')](_0x2c8cb7,_0x298f1d[0x1]===_0x7c8d('0x87')?![]:!![]);});}if(!_[_0x7c8d('0x88')](_0x2c10f0)){_0x1ecb1c['having'](_0x183a28);_0x2b5846[_0x7c8d('0x42')]('t.id\x20IN\x20?',_0x2c10f0);}BPromise[_0x7c8d('0x89')]()[_0x7c8d('0x26')](function(){if(!_0x2cf2cf){if(_0x2ae6e0['query'][_0x7c8d('0x70')])return;_0x2b5846[_0x7c8d('0x42')](_0x7c8d('0x8a'));_0x1ecb1c['where'](_0x7c8d('0x8a'));return;}if(_0x2ae6e0[_0x7c8d('0x8b')][_0x7c8d('0x8c')]!=='agent')return;return _0x2ae6e0[_0x7c8d('0x8b')][_0x7c8d('0x8d')]({'attributes':['id'],'raw':!![]})[_0x7c8d('0x26')](function(_0x414c6b){if(_[_0x7c8d('0x88')](_0x414c6b)){_0x2b5846[_0x7c8d('0x42')]('i.FaxAccountId\x20IS\x20NULL');_0x1ecb1c[_0x7c8d('0x42')](_0x7c8d('0x8e'));}else{_0x2b5846[_0x7c8d('0x42')]('i.FaxAccountId\x20IN\x20?',_[_0x7c8d('0x2d')](_0x414c6b,'id'));_0x1ecb1c[_0x7c8d('0x42')](_0x7c8d('0x8f'),_[_0x7c8d('0x2d')](_0x414c6b,'id'));}});})[_0x7c8d('0x26')](function(){if(_0x2ae6e0['user']['role']===_0x7c8d('0x90')&&!_0x2cf2cf&&!_0x2ae6e0[_0x7c8d('0x39')][_0x7c8d('0x70')])return[];return db[_0x7c8d('0x91')][_0x7c8d('0x39')](_0x2b5846[_0x7c8d('0x92')](),_0x144834);})[_0x7c8d('0x26')](function(_0x1f393b){_0x27d550[_0x7c8d('0x20')]=_0x1f393b['length'];if(_0x27d550[_0x7c8d('0x20')]===0x0)return[];return db[_0x7c8d('0x91')][_0x7c8d('0x39')](_0xc14730[_0x7c8d('0x92')](),_0x144834)[_0x7c8d('0x26')](function(_0x32e410){_0x2b11d5=_[_0x7c8d('0x93')](_0x32e410,'id');_0x144834=_['merge'](_0x144834,{'model':db[_0x7c8d('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ae6e0[_0x7c8d('0x39')]['fields']){_0x2d7fcb[_0x7c8d('0x3c')][_0x7c8d('0x32')](function(_0x31e053){_0x1ecb1c[_0x7c8d('0x45')]('i.'+_0x31e053);});}else{_0x1ecb1c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x1ecb1c[_0x7c8d('0x45')]('a.key',_0x7c8d('0x94'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0x95'),'Account.mandatoryDisposition');_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0x96'),_0x7c8d('0x86'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0x97'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0x98'),_0x7c8d('0x99'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0x9a'),'Contact.lastName');_0x1ecb1c['field'](_0x7c8d('0x9b'),_0x7c8d('0x9c'));_0x1ecb1c['field']('c.phone',_0x7c8d('0x9d'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0x9e'),_0x7c8d('0x9f'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0xa0'),'Contact.fax');_0x1ecb1c['field']('o.fullname',_0x7c8d('0xa1'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0xa2'),_0x7c8d('0xa3'));_0x1ecb1c[_0x7c8d('0x45')](_0x7c8d('0xa4'),_0x7c8d('0x2f'));}if(_0x2d7fcb[_0x7c8d('0x40')])_0x1ecb1c['limit'](_0x2d7fcb[_0x7c8d('0x40')]);if(_0x2d7fcb['offset'])_0x1ecb1c[_0x7c8d('0x1e')](_0x2d7fcb[_0x7c8d('0x1e')]);return db[_0x7c8d('0x91')][_0x7c8d('0x39')](_0x1ecb1c[_0x7c8d('0x92')](),_0x144834);})['then'](function(_0x2af8a9){if(_0x2af8a9[_0x7c8d('0x3d')]>0x0)_0x5c39d3[_0x7c8d('0x42')]('ui.FaxInteractionId\x20IN\x20?',_[_0x7c8d('0x2d')](_0x2af8a9,'id'));return db['sequelize'][_0x7c8d('0x39')](_0x5c39d3[_0x7c8d('0x92')](),_0x144834)['then'](function(_0x36afa9){var _0x57a0b7=_[_0x7c8d('0xa5')](_0x36afa9,_0x7c8d('0xa6'));var _0x3b51f4=[];_0x2af8a9['forEach'](function(_0x3ea86c){_0x3b51f4[_0x7c8d('0xa7')](updateFaxInteraction(_0x3ea86c,_0x2b11d5,_0x57a0b7));});return BPromise[_0x7c8d('0xa8')](_0x3b51f4);});});})['then'](function(_0x17aa91){_0x27d550['rows']=_0x17aa91;return _0x27d550;})[_0x7c8d('0x26')](respondWithFilteredResult(_0x31721d,_0x2d7fcb))[_0x7c8d('0x33')](handleError(_0x31721d,null));};exports[_0x7c8d('0xa9')]=function(_0x49956a,_0x2d6ad8){var _0x185e17={'raw':![],'where':{'id':_0x49956a[_0x7c8d('0xaa')]['id']}},_0x2b600e={};_0x2b600e['model']=_['keys'](db[_0x7c8d('0x34')][_0x7c8d('0x35')]);_0x2b600e['query']=_[_0x7c8d('0x6e')](_0x49956a['query']);_0x2b600e['filters']=_[_0x7c8d('0x3b')](_0x2b600e[_0x7c8d('0x38')],_0x2b600e[_0x7c8d('0x39')]);_0x185e17[_0x7c8d('0x3c')]=_[_0x7c8d('0x3b')](_0x2b600e['model'],qs['fields'](_0x49956a[_0x7c8d('0x39')]['fields']));_0x185e17[_0x7c8d('0x3c')]=_0x185e17[_0x7c8d('0x3c')]['length']?_0x185e17[_0x7c8d('0x3c')]:_0x2b600e[_0x7c8d('0x38')];if(_0x49956a[_0x7c8d('0x39')][_0x7c8d('0xab')]){_0x185e17[_0x7c8d('0xac')]=[{'all':!![]}];}_0x185e17=_['merge']({},_0x185e17,_0x49956a['options']);return db[_0x7c8d('0x34')][_0x7c8d('0x5a')](_0x185e17)[_0x7c8d('0x26')](handleEntityNotFound(_0x2d6ad8,null))[_0x7c8d('0x26')](respondWithResult(_0x2d6ad8,null))['catch'](handleError(_0x2d6ad8,null));};exports[_0x7c8d('0xad')]=function(_0x1b991f,_0x429efb){return db[_0x7c8d('0x34')][_0x7c8d('0xad')](_0x1b991f[_0x7c8d('0x6d')],{})['then'](respondWithResult(_0x429efb,0xc9))[_0x7c8d('0x33')](handleError(_0x429efb,null));};exports['update']=function(_0x3cd806,_0x345b94){if(_0x3cd806[_0x7c8d('0x6d')]['id']){delete _0x3cd806['body']['id'];}return db[_0x7c8d('0x34')][_0x7c8d('0x5a')]({'where':{'id':_0x3cd806[_0x7c8d('0xaa')]['id']}})[_0x7c8d('0x26')](handleEntityNotFound(_0x345b94,null))['then'](saveUpdates(_0x3cd806[_0x7c8d('0x6d')],null))[_0x7c8d('0x26')](respondWithResult(_0x345b94,null))[_0x7c8d('0x33')](handleError(_0x345b94,null));};exports['destroy']=function(_0x12f8c9,_0x5a2870){return db[_0x7c8d('0x34')][_0x7c8d('0x5a')]({'where':{'id':_0x12f8c9['params']['id']}})[_0x7c8d('0x26')](handleEntityNotFound(_0x5a2870,null))['then'](removeEntity(_0x5a2870,null))[_0x7c8d('0x33')](handleError(_0x5a2870,null));};exports[_0x7c8d('0xae')]=function(_0x3a0779,_0x36d2e3){return db[_0x7c8d('0x34')][_0x7c8d('0xae')]()[_0x7c8d('0x26')](respondWithResult(_0x36d2e3,null))[_0x7c8d('0x33')](handleError(_0x36d2e3,null));};exports[_0x7c8d('0xaf')]=function(_0xf8f9cc,_0xbabb37,_0x54e75c){return db[_0x7c8d('0xb0')]['find']({'where':{'id':_0xf8f9cc[_0x7c8d('0xaa')]['id']}})[_0x7c8d('0x26')](handleEntityNotFound(_0xbabb37,null))['then'](function(_0x568e31){if(_0x568e31){return _0x568e31['addMessage'](_0xf8f9cc['body']['ids'],_[_0x7c8d('0xb1')](_0xf8f9cc[_0x7c8d('0x6d')],[_0x7c8d('0xb2'),'id'])||{});}})[_0x7c8d('0x26')](respondWithResult(_0xbabb37,null))[_0x7c8d('0x33')](handleError(_0xbabb37,null));};exports['getMessages']=function(_0x2eec11,_0x5177f0,_0x5b68f0){var _0x1ba4ea={'raw':![],'where':{}};var _0x3ab37b={};var _0x41d307={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x7c8d('0xb3')]({'where':{'id':_0x2eec11[_0x7c8d('0xaa')]['id']}})[_0x7c8d('0x26')](handleEntityNotFound(_0x5177f0,null))[_0x7c8d('0x26')](function(_0x8daf76){if(_0x8daf76){_0x3ab37b[_0x7c8d('0x38')]=_[_0x7c8d('0x6e')](db[_0x7c8d('0xb0')][_0x7c8d('0x35')]);_0x3ab37b[_0x7c8d('0x39')]=_['keys'](_0x2eec11[_0x7c8d('0x39')]);_0x3ab37b[_0x7c8d('0x3a')]=_[_0x7c8d('0x3b')](_0x3ab37b[_0x7c8d('0x38')],_0x3ab37b[_0x7c8d('0x39')]);_0x1ba4ea[_0x7c8d('0x3c')]=_[_0x7c8d('0x3b')](_0x3ab37b[_0x7c8d('0x38')],qs[_0x7c8d('0xb4')](_0x2eec11[_0x7c8d('0x39')][_0x7c8d('0xb4')]));_0x1ba4ea[_0x7c8d('0x3c')]=_0x1ba4ea[_0x7c8d('0x3c')][_0x7c8d('0x3d')]?_0x1ba4ea[_0x7c8d('0x3c')]:_0x3ab37b[_0x7c8d('0x38')];if(!_0x2eec11[_0x7c8d('0x39')][_0x7c8d('0x3e')]('nolimit')){_0x1ba4ea[_0x7c8d('0x40')]=qs[_0x7c8d('0x40')](_0x2eec11['query'][_0x7c8d('0x40')]);_0x1ba4ea[_0x7c8d('0x1e')]=qs[_0x7c8d('0x1e')](_0x2eec11['query'][_0x7c8d('0x1e')]);}_0x1ba4ea[_0x7c8d('0x85')]=qs['sort'](_0x2eec11['query'][_0x7c8d('0x41')]);_0x1ba4ea['where']=qs[_0x7c8d('0x3a')](_[_0x7c8d('0x43')](_0x2eec11[_0x7c8d('0x39')],_0x3ab37b['filters']));_0x1ba4ea[_0x7c8d('0x42')]['FaxInteractionId']=_0x8daf76['id'];if(_0x2eec11[_0x7c8d('0x39')][_0x7c8d('0x7c')]){_0x1ba4ea['where']=_[_0x7c8d('0xb5')](_0x1ba4ea[_0x7c8d('0x42')],{'$or':_['map'](_0x1ba4ea['attributes'],function(_0x51c328){var _0x3c0e13={};_0x3c0e13[_0x51c328]={'$like':'%'+_0x2eec11['query']['filter']+'%'};return _0x3c0e13;})});}if(_0x2eec11[_0x7c8d('0x39')][_0x7c8d('0x73')]){var _0x30add4=_0x2eec11[_0x7c8d('0x39')][_0x7c8d('0x73')][_0x7c8d('0x31')](',');var _0x208e62={};_0x208e62[_0x30add4[0x0]]={'$gte':moment(_0x30add4[0x1])[_0x7c8d('0xb6')](_0x7c8d('0xb7'))};_0x1ba4ea[_0x7c8d('0x42')]=_[_0x7c8d('0xb5')](_0x1ba4ea[_0x7c8d('0x42')],_0x208e62);}_0x1ba4ea=_['merge']({},_0x1ba4ea,_0x2eec11[_0x7c8d('0xb8')]);return db[_0x7c8d('0xb0')][_0x7c8d('0x20')]({'where':_0x1ba4ea[_0x7c8d('0x42')]})['then'](function(_0x21d208){_0x41d307[_0x7c8d('0x20')]=_0x21d208;if(_0x2eec11[_0x7c8d('0x39')][_0x7c8d('0xab')]){_0x1ba4ea[_0x7c8d('0xac')]=[{'all':!![]}];}return db[_0x7c8d('0xb0')][_0x7c8d('0xb9')](_0x1ba4ea);})[_0x7c8d('0x26')](function(_0x31f61c){_0x41d307['rows']=_0x31f61c;return _0x41d307;});}})['then'](respondWithFilteredResult(_0x5177f0,_0x1ba4ea))[_0x7c8d('0x33')](handleError(_0x5177f0,null));};exports[_0x7c8d('0xba')]=function(_0x448200,_0x13f06d,_0x455562){return db[_0x7c8d('0x34')][_0x7c8d('0x5a')]({'where':{'id':_0x448200[_0x7c8d('0xaa')]['id']}})[_0x7c8d('0x26')](handleEntityNotFound(_0x13f06d,null))[_0x7c8d('0x26')](function(_0x4b23b9){if(_0x4b23b9){return _0x4b23b9[_0x7c8d('0xbb')](_0x448200['body'][_0x7c8d('0xb2')],_[_0x7c8d('0xb1')](_0x448200[_0x7c8d('0x6d')],['ids','id'])||{})[_0x7c8d('0xbc')](function(){return db[_0x7c8d('0x66')][_0x7c8d('0xb9')]({'attributes':['id','name',_0x7c8d('0x46')],'where':{'id':_0x448200[_0x7c8d('0x6d')]['ids']}});})[_0x7c8d('0x26')](function(_0xdd9fdf){socket[_0x7c8d('0xbd')](_0x7c8d('0xbe'),{'id':Number(_0x448200[_0x7c8d('0xaa')]['id']),'tags':_0xdd9fdf||[]});return{'id':Number(_0x448200[_0x7c8d('0xaa')]['id']),'tags':_0xdd9fdf||[]};});}})[_0x7c8d('0x26')](respondWithResult(_0x13f06d,null))[_0x7c8d('0x33')](handleError(_0x13f06d,null));};exports[_0x7c8d('0xbf')]=function(_0x27f30f,_0x2f4eb6,_0xae3bde){return db[_0x7c8d('0x34')][_0x7c8d('0x5a')]({'where':{'id':_0x27f30f[_0x7c8d('0xaa')]['id']}})[_0x7c8d('0x26')](handleEntityNotFound(_0x2f4eb6,null))[_0x7c8d('0x26')](function(_0x4497a4){if(_0x4497a4){return _0x4497a4[_0x7c8d('0xbf')](_0x27f30f['query']['ids']);}})[_0x7c8d('0x26')](respondWithStatusCode(_0x2f4eb6,null))['catch'](handleError(_0x2f4eb6,null));};exports['download']=function(_0x15b3f7,_0x258a90){var _0x49ca47=moment()['unix']()[_0x7c8d('0x92')]();var _0x56eb67=path[_0x7c8d('0xc0')](config[_0x7c8d('0xc1')],_0x7c8d('0xc2'),_0x7c8d('0xc3'),'tmp');var _0x2400b8=path['join'](config['root'],_0x7c8d('0xc2'),'files',_0x7c8d('0xc4'));var _0x421abe=path[_0x7c8d('0xc0')](_0x56eb67,_0x49ca47);var _0x563bb9=util['format']('transcript-%d-%s.zip',_0x15b3f7[_0x7c8d('0xaa')]['id'],_0x49ca47);var _0x18c56e=path['join'](_0x56eb67,_0x563bb9);var _0x99b6ea=[];_0x99b6ea[_0x7c8d('0xa7')]({'model':db['Attachment'],'as':_0x7c8d('0xc5'),'raw':!![]});var _0x282a25=[{'model':db[_0x7c8d('0xb0')],'as':_0x7c8d('0xc6'),'attributes':['id','body',_0x7c8d('0xc7')],'include':_0x99b6ea}];return db[_0x7c8d('0x34')][_0x7c8d('0x5a')]({'where':{'id':_0x15b3f7[_0x7c8d('0xaa')]['id']},'include':_0x282a25})['then'](handleEntityNotFound(_0x258a90,null))[_0x7c8d('0x26')](function(_0x1fa2fb){if(_0x1fa2fb&&_0x1fa2fb[_0x7c8d('0xc6')]){var _0x224198=_0x1fa2fb[_0x7c8d('0xc8')]({'plain':!![]});fs[_0x7c8d('0xc9')](_0x421abe);for(var _0x20c41a=0x0;_0x20c41a<_0x224198[_0x7c8d('0xc6')]['length'];_0x20c41a++){var _0x5aafa5=_0x224198[_0x7c8d('0xc6')][_0x20c41a][_0x7c8d('0xc5')];if(_0x5aafa5){var _0x2776e9=path['join'](_0x2400b8,_0x5aafa5[_0x7c8d('0xca')]);if(fs['existsSync'](_0x2776e9)){fs[_0x7c8d('0xcb')](_0x2776e9)['pipe'](fs['createWriteStream'](path[_0x7c8d('0xc0')](_0x421abe,_0x5aafa5['basename'])));}}}return BPromise[_0x7c8d('0x89')]()[_0x7c8d('0x26')](function(){return new BPromise(function(_0xb1eacf,_0x14b2d6){zipdir(_0x421abe,{'saveTo':_0x18c56e},function(_0x54ebbf,_0x31a8d3){if(_0x54ebbf)return _0x14b2d6(_0x54ebbf);return _0xb1eacf(_0x31a8d3);});})[_0x7c8d('0x26')](function(){return new BPromise(function(_0x6af47a,_0x44069d){rimraf(_0x421abe,function(_0x4a0801){if(_0x4a0801)_0x44069d(_0x4a0801);return _0x6af47a();});});})[_0x7c8d('0x26')](function(){return _0x258a90['download'](_0x18c56e,_0x563bb9,function(_0x2add00){if(_0x2add00){console['log'](_0x7c8d('0xcc'),_0x2add00);}else{fs[_0x7c8d('0xcd')](_0x18c56e);}});});});}else{return _0x258a90[_0x7c8d('0x1a')](0xc8);}})[_0x7c8d('0x33')](handleError(_0x258a90,null));};
\ No newline at end of file
index cacb201..6f11ab1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3c7=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','then','setDataValue'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xb3c7,0xb3));var _0x7b3c=function(_0x5539c2,_0x582ccf){_0x5539c2=_0x5539c2-0x0;var _0x284cae=_0xb3c7[_0x5539c2];return _0x284cae;};'use strict';var EventEmitter=require(_0x7b3c('0x0'));var FaxInteraction=require(_0x7b3c('0x1'))['db'][_0x7b3c('0x2')];var FaxMessage=require(_0x7b3c('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7b3c('0x3')](0x0);var events={'afterCreate':_0x7b3c('0x4'),'afterUpdate':_0x7b3c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x33de41){return function(_0xeff9a4,_0x5ef301,_0x2069d7){_0xeff9a4['getUsers']({'attributes':['id'],'raw':!![]})[_0x7b3c('0x6')](function(_0x1980af){_0xeff9a4[_0x7b3c('0x7')]('Users',_0x1980af[_0x7b3c('0x8')](function(_0x93f71c){return{'id':_0x93f71c['id']};}));return FaxMessage[_0x7b3c('0x9')]({'where':{'FaxInteractionId':_0xeff9a4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7b3c('0x6')](function(_0x3433d5){_0xeff9a4['setDataValue'](_0x7b3c('0xa'),_0x3433d5[_0x7b3c('0xb')]);FaxInteractionEvents[_0x7b3c('0xc')](_0x33de41+':'+_0xeff9a4['id'],_0xeff9a4);FaxInteractionEvents[_0x7b3c('0xc')](_0x33de41,_0xeff9a4);_0x2069d7(null);})[_0x7b3c('0xd')](_0x2069d7(null));};}for(var e in events){if(events[_0x7b3c('0xe')](e)){var event=events[e];FaxInteraction[_0x7b3c('0xf')](e,emitEvent(event));}}module[_0x7b3c('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x365f=['getUsers','setDataValue','Users','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','remove'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x365f,0x10a));var _0xf365=function(_0x44dded,_0x50c3e6){_0x44dded=_0x44dded-0x0;var _0xa76fd8=_0x365f[_0x44dded];return _0xa76fd8;};'use strict';var EventEmitter=require(_0xf365('0x0'));var FaxInteraction=require(_0xf365('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xf365('0x1'))['db'][_0xf365('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf365('0x3')};function emitEvent(_0x1dbcad){return function(_0x2bb9cf,_0x1a050c,_0x1214ea){_0x2bb9cf[_0xf365('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x335c14){_0x2bb9cf[_0xf365('0x5')](_0xf365('0x6'),_0x335c14['map'](function(_0x54aacb){return{'id':_0x54aacb['id']};}));return FaxMessage[_0xf365('0x7')]({'where':{'FaxInteractionId':_0x2bb9cf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf365('0x8')](function(_0x538722){_0x2bb9cf['setDataValue']('unreadMessages',_0x538722[_0xf365('0x9')]);FaxInteractionEvents[_0xf365('0xa')](_0x1dbcad+':'+_0x2bb9cf['id'],_0x2bb9cf);FaxInteractionEvents[_0xf365('0xa')](_0x1dbcad,_0x2bb9cf);_0x1214ea(null);})[_0xf365('0xb')](_0x1214ea(null));};}for(var e in events){if(events[_0xf365('0xc')](e)){var event=events[e];FaxInteraction[_0xf365('0xd')](e,emitEvent(event));}}module[_0xf365('0xe')]=FaxInteractionEvents;
\ No newline at end of file
index 5ccf26e..f02422d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09cb=['lodash','api','moment','bluebird','request-promise','path','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x09cb,0xdd));var _0xb09c=function(_0x4ec656,_0x1ad5dc){_0x4ec656=_0x4ec656-0x0;var _0x1615f8=_0x09cb[_0x4ec656];return _0x1615f8;};'use strict';var _=require(_0xb09c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb09c('0x1'));var moment=require(_0xb09c('0x2'));var BPromise=require(_0xb09c('0x3'));var rp=require(_0xb09c('0x4'));var fs=require('fs');var path=require(_0xb09c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xb09c('0x6')]=function(_0x57a2aa,_0x3342e1){return _0x57a2aa[_0xb09c('0x7')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4eb509,_0x490a92,_0x4c2e64){if(_0x4eb509[_0xb09c('0x8')](_0xb09c('0x9'))){_0x4eb509[_0xb09c('0xa')]=moment()[_0xb09c('0xb')](_0xb09c('0xc'));}_0x4c2e64(null,_0x4eb509);}}});};
\ No newline at end of file
+var _0x6219=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions'];(function(_0x31e5e0,_0x356163){var _0x4e01f7=function(_0x1c0009){while(--_0x1c0009){_0x31e5e0['push'](_0x31e5e0['shift']());}};_0x4e01f7(++_0x356163);}(_0x6219,0xc4));var _0x9621=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x6219[_0x35c5a8];return _0x34782c;};'use strict';var _=require(_0x9621('0x0'));var util=require(_0x9621('0x1'));var logger=require(_0x9621('0x2'))(_0x9621('0x3'));var moment=require(_0x9621('0x4'));var BPromise=require(_0x9621('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9621('0x6'));var rimraf=require(_0x9621('0x7'));var config=require('../../config/environment');var attributes=require(_0x9621('0x8'));module[_0x9621('0x9')]=function(_0x641df2,_0x26dd63){return _0x641df2['define'](_0x9621('0xa'),attributes,{'tableName':_0x9621('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bca3b,_0x4069f5,_0x1086b2){if(_0x2bca3b[_0x9621('0xc')]('closed')){_0x2bca3b[_0x9621('0xd')]=moment()[_0x9621('0xe')](_0x9621('0xf'));}_0x1086b2(null,_0x2bca3b);}}});};
\ No newline at end of file
index c2f6783..613c3c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f7f=['message','info','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','catch','find','addTags','ids','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x573a27,_0x26d295){var _0x49f7c0=function(_0x1a88ff){while(--_0x1a88ff){_0x573a27['push'](_0x573a27['shift']());}};_0x49f7c0(++_0x26d295);}(_0x2f7f,0x1b5));var _0xf2f7=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0x2f7f[_0x2a3c4d];return _0x55c390;};'use strict';var _=require('lodash');var util=require(_0xf2f7('0x0'));var moment=require(_0xf2f7('0x1'));var BPromise=require(_0xf2f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2f7('0x3'));var db=require(_0xf2f7('0x4'))['db'];var utils=require(_0xf2f7('0x5'));var logger=require(_0xf2f7('0x6'))(_0xf2f7('0x7'));var config=require(_0xf2f7('0x8'));var jayson=require(_0xf2f7('0x9'));var client=jayson[_0xf2f7('0xa')][_0xf2f7('0xb')]({'port':0x232a});config[_0xf2f7('0xc')]=_['defaults'](config[_0xf2f7('0xc')],{'host':_0xf2f7('0xd'),'port':0x18eb});var socket=require(_0xf2f7('0xe'))(new Redis(config[_0xf2f7('0xc')]));require(_0xf2f7('0xf'))[_0xf2f7('0x10')](socket);function respondWithRpcPromise(_0x5d412c,_0x2e3a03,_0x38aaa8){return new BPromise(function(_0x200460,_0x3ec985){return client['request'](_0x5d412c,_0x38aaa8)[_0xf2f7('0x11')](function(_0x578c8e){logger['info'](_0xf2f7('0x12'),_0x2e3a03,'request\x20sent');logger[_0xf2f7('0x13')](_0xf2f7('0x14'),_0x2e3a03,_0xf2f7('0x15'),JSON[_0xf2f7('0x16')](_0x578c8e));if(_0x578c8e[_0xf2f7('0x17')]){if(_0x578c8e[_0xf2f7('0x17')][_0xf2f7('0x18')]===0x1f4){logger[_0xf2f7('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x2e3a03,_0x578c8e[_0xf2f7('0x17')][_0xf2f7('0x19')]);return _0x3ec985(_0x578c8e[_0xf2f7('0x17')][_0xf2f7('0x19')]);}logger['error'](_0xf2f7('0x12'),_0x2e3a03,_0x578c8e['error'][_0xf2f7('0x19')]);return _0x200460(_0x578c8e[_0xf2f7('0x17')][_0xf2f7('0x19')]);}else{logger[_0xf2f7('0x1a')]('FaxInteraction,\x20%s,\x20%s',_0x2e3a03,_0xf2f7('0x15'));_0x200460(_0x578c8e[_0xf2f7('0x1b')][_0xf2f7('0x19')]);}})['catch'](function(_0x8d9d5){logger[_0xf2f7('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x2e3a03,_0x8d9d5);_0x3ec985(_0x8d9d5);});});}exports[_0xf2f7('0x1c')]=function(_0x2adfcf){var _0x5e6864=this;return new Promise(function(_0x1f839c,_0x3625ff){return db[_0xf2f7('0x1d')][_0xf2f7('0x1e')](_0x2adfcf[_0xf2f7('0x1f')],{'raw':_0x2adfcf[_0xf2f7('0x20')]?_0x2adfcf[_0xf2f7('0x20')][_0xf2f7('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2adfcf['options']?_0x2adfcf[_0xf2f7('0x20')][_0xf2f7('0x22')]||null:null,'attributes':_0x2adfcf[_0xf2f7('0x20')]?_0x2adfcf[_0xf2f7('0x20')][_0xf2f7('0x23')]||null:null,'limit':_0x2adfcf[_0xf2f7('0x20')]?_0x2adfcf[_0xf2f7('0x20')][_0xf2f7('0x24')]||null:null})['then'](function(_0x915798){logger[_0xf2f7('0x1a')](_0xf2f7('0x1c'),_0x2adfcf);logger[_0xf2f7('0x13')](_0xf2f7('0x1c'),_0x2adfcf,JSON[_0xf2f7('0x16')](_0x915798));_0x1f839c(_0x915798);})[_0xf2f7('0x25')](function(_0x59bb12){logger[_0xf2f7('0x17')](_0xf2f7('0x1c'),_0x59bb12[_0xf2f7('0x19')],_0x2adfcf);_0x3625ff(_0x5e6864['error'](0x1f4,_0x59bb12[_0xf2f7('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x43582f){return new Promise(function(_0x42238b,_0x150434){return db[_0xf2f7('0x1d')][_0xf2f7('0x26')]({'where':_0x43582f['options']?_0x43582f[_0xf2f7('0x20')][_0xf2f7('0x22')]||null:null})[_0xf2f7('0x11')](function(_0x55d17f){if(_0x55d17f){return _0x55d17f[_0xf2f7('0x27')](_0x43582f[_0xf2f7('0x1f')][_0xf2f7('0x28')],_['omit'](_0x43582f[_0xf2f7('0x1f')],[_0xf2f7('0x28'),'id'])||{});}})['spread'](function(_0x5cb536){logger['info'](_0xf2f7('0x29'),_0x43582f);logger[_0xf2f7('0x13')](_0xf2f7('0x29'),_0x43582f,JSON[_0xf2f7('0x16')](_0x5cb536));_0x42238b(_0x5cb536);})[_0xf2f7('0x25')](function(_0x27afcd){logger['error'](_0xf2f7('0x29'),_0x27afcd[_0xf2f7('0x19')],_0x43582f);_0x150434(_this['error'](0x1f4,_0x27afcd['message']));});});};
\ No newline at end of file
+var _0x41a5=['request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','limit','stringify','catch','AddTagsToFaxInteraction','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./faxInteraction.socket','register'];(function(_0x5214e1,_0x30f6d2){var _0x3b7dd4=function(_0x754f07){while(--_0x754f07){_0x5214e1['push'](_0x5214e1['shift']());}};_0x3b7dd4(++_0x30f6d2);}(_0x41a5,0x98));var _0x541a=function(_0x5aba4f,_0x1afb63){_0x5aba4f=_0x5aba4f-0x0;var _0x10cf5c=_0x41a5[_0x5aba4f];return _0x10cf5c;};'use strict';var _=require('lodash');var util=require(_0x541a('0x0'));var moment=require(_0x541a('0x1'));var BPromise=require(_0x541a('0x2'));var rs=require(_0x541a('0x3'));var fs=require('fs');var Redis=require(_0x541a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x541a('0x5'));var logger=require(_0x541a('0x6'))(_0x541a('0x7'));var config=require(_0x541a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x541a('0x9')][_0x541a('0xa')]({'port':0x232a});config[_0x541a('0xb')]=_[_0x541a('0xc')](config[_0x541a('0xb')],{'host':_0x541a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x541a('0xb')]));require(_0x541a('0xe'))[_0x541a('0xf')](socket);function respondWithRpcPromise(_0x2b61db,_0x4f5433,_0x28e14f){return new BPromise(function(_0x545b5e,_0x149c4c){return client[_0x541a('0x10')](_0x2b61db,_0x28e14f)[_0x541a('0x11')](function(_0x3babe4){logger[_0x541a('0x12')](_0x541a('0x13'),_0x4f5433,_0x541a('0x14'));logger[_0x541a('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4f5433,_0x541a('0x14'),JSON['stringify'](_0x3babe4));if(_0x3babe4['error']){if(_0x3babe4[_0x541a('0x16')][_0x541a('0x17')]===0x1f4){logger[_0x541a('0x16')](_0x541a('0x13'),_0x4f5433,_0x3babe4[_0x541a('0x16')][_0x541a('0x18')]);return _0x149c4c(_0x3babe4[_0x541a('0x16')][_0x541a('0x18')]);}logger['error'](_0x541a('0x13'),_0x4f5433,_0x3babe4['error'][_0x541a('0x18')]);return _0x545b5e(_0x3babe4[_0x541a('0x16')][_0x541a('0x18')]);}else{logger[_0x541a('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x4f5433,_0x541a('0x14'));_0x545b5e(_0x3babe4[_0x541a('0x19')][_0x541a('0x18')]);}})['catch'](function(_0xd339fc){logger[_0x541a('0x16')](_0x541a('0x13'),_0x4f5433,_0xd339fc);_0x149c4c(_0xd339fc);});});}exports[_0x541a('0x1a')]=function(_0x5525a1){var _0x349abd=this;return new Promise(function(_0x466f61,_0x43f067){return db[_0x541a('0x1b')][_0x541a('0x1c')](_0x5525a1['body'],{'raw':_0x5525a1[_0x541a('0x1d')]?_0x5525a1[_0x541a('0x1d')][_0x541a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5525a1[_0x541a('0x1d')]?_0x5525a1[_0x541a('0x1d')][_0x541a('0x1f')]||null:null,'attributes':_0x5525a1[_0x541a('0x1d')]?_0x5525a1['options']['attributes']||null:null,'limit':_0x5525a1[_0x541a('0x1d')]?_0x5525a1[_0x541a('0x1d')][_0x541a('0x20')]||null:null})['then'](function(_0x529e82){logger[_0x541a('0x12')]('UpdateFaxInteraction',_0x5525a1);logger[_0x541a('0x15')](_0x541a('0x1a'),_0x5525a1,JSON[_0x541a('0x21')](_0x529e82));_0x466f61(_0x529e82);})[_0x541a('0x22')](function(_0x4cddcc){logger[_0x541a('0x16')](_0x541a('0x1a'),_0x4cddcc[_0x541a('0x18')],_0x5525a1);_0x43f067(_0x349abd['error'](0x1f4,_0x4cddcc[_0x541a('0x18')]));});});};exports[_0x541a('0x23')]=function(_0x5b47bd){return new Promise(function(_0x4495df,_0x3d1dd3){return db['FaxInteraction']['find']({'where':_0x5b47bd[_0x541a('0x1d')]?_0x5b47bd['options'][_0x541a('0x1f')]||null:null})[_0x541a('0x11')](function(_0x1a0b65){if(_0x1a0b65){return _0x1a0b65[_0x541a('0x24')](_0x5b47bd[_0x541a('0x25')][_0x541a('0x26')],_[_0x541a('0x27')](_0x5b47bd[_0x541a('0x25')],['ids','id'])||{});}})[_0x541a('0x28')](function(_0x59d9bc){logger[_0x541a('0x12')](_0x541a('0x29'),_0x5b47bd);logger[_0x541a('0x15')](_0x541a('0x29'),_0x5b47bd,JSON[_0x541a('0x21')](_0x59d9bc));_0x4495df(_0x59d9bc);})[_0x541a('0x22')](function(_0x3ac03c){logger[_0x541a('0x16')](_0x541a('0x29'),_0x3ac03c[_0x541a('0x18')],_0x5b47bd);_0x3d1dd3(_this[_0x541a('0x16')](0x1f4,_0x3ac03c[_0x541a('0x18')]));});});};
\ No newline at end of file
index a26b2b3..882575a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2f6=['remove','emit','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2f6,0x1d0));var _0x6f2f=function(_0x2164e1,_0x53298d){_0x2164e1=_0x2164e1-0x0;var _0x48b618=_0xf2f6[_0x2164e1];return _0x48b618;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x6f2f('0x0'),'update'];function createListener(_0x534db2,_0x1d7985){return function(_0x5b5275){_0x1d7985[_0x6f2f('0x1')](_0x534db2,_0x5b5275);};}function removeListener(_0x127149,_0x3d995b){return function(){FaxInteractionEvents[_0x6f2f('0x2')](_0x127149,_0x3d995b);};}exports['register']=function(_0x160577){for(var _0x1b3bcf=0x0,_0x384e0c=events[_0x6f2f('0x3')];_0x1b3bcf<_0x384e0c;_0x1b3bcf++){var _0x196f1c=events[_0x1b3bcf];var _0x309aff=createListener('faxInteraction:'+_0x196f1c,_0x160577);FaxInteractionEvents['on'](_0x196f1c,_0x309aff);}};
\ No newline at end of file
+var _0x60f8=['length','faxInteraction:','remove','update','emit','removeListener','register'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x60f8,0x10c));var _0x860f=function(_0x398140,_0x55b247){_0x398140=_0x398140-0x0;var _0x39f02f=_0x60f8[_0x398140];return _0x39f02f;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x860f('0x0'),_0x860f('0x1')];function createListener(_0x3b306b,_0xa3d394){return function(_0x59af14){_0xa3d394[_0x860f('0x2')](_0x3b306b,_0x59af14);};}function removeListener(_0x166ca8,_0x3de2a5){return function(){FaxInteractionEvents[_0x860f('0x3')](_0x166ca8,_0x3de2a5);};}exports[_0x860f('0x4')]=function(_0x3d0c96){for(var _0x2fb719=0x0,_0x5a5d3c=events[_0x860f('0x5')];_0x2fb719<_0x5a5d3c;_0x2fb719++){var _0x52235b=events[_0x2fb719];var _0x4e4136=createListener(_0x860f('0x6')+_0x52235b,_0x3d0c96);FaxInteractionEvents['on'](_0x52235b,_0x4e4136);}};
\ No newline at end of file
index 29e74e4..bd1cf1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab7=['show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x92f009,_0x501ca4){var _0x5b92c3=function(_0x34399a){while(--_0x34399a){_0x92f009['push'](_0x92f009['shift']());}};_0x5b92c3(++_0x501ca4);}(_0x4ab7,0xe4));var _0x74ab=function(_0x43f86d,_0xabd2c9){_0x43f86d=_0x43f86d-0x0;var _0x479cad=_0x4ab7[_0x43f86d];return _0x479cad;};'use strict';var multer=require(_0x74ab('0x0'));var util=require(_0x74ab('0x1'));var path=require(_0x74ab('0x2'));var timeout=require(_0x74ab('0x3'));var express=require(_0x74ab('0x4'));var router=express[_0x74ab('0x5')]();var fs_extra=require(_0x74ab('0x6'));var auth=require(_0x74ab('0x7'));var interaction=require(_0x74ab('0x8'));var config=require(_0x74ab('0x9'));var controller=require(_0x74ab('0xa'));router[_0x74ab('0xb')]('/',auth[_0x74ab('0xc')](),controller[_0x74ab('0xd')]);router[_0x74ab('0xb')](_0x74ab('0xe'),auth[_0x74ab('0xc')](),controller[_0x74ab('0xf')]);router['get'](_0x74ab('0x10'),auth[_0x74ab('0xc')](),controller[_0x74ab('0x11')]);router[_0x74ab('0xb')](_0x74ab('0x12'),auth['isAuthenticated'](),controller[_0x74ab('0x13')]);router[_0x74ab('0xb')](_0x74ab('0x14'),auth[_0x74ab('0xc')](),controller['download']);router[_0x74ab('0x15')]('/',auth[_0x74ab('0xc')](),controller['create']);router[_0x74ab('0x15')](_0x74ab('0x12'),auth[_0x74ab('0xc')](),controller[_0x74ab('0x16')]);router[_0x74ab('0x15')](_0x74ab('0x17'),auth['isAuthenticated'](),interaction[_0x74ab('0x18')](_0x74ab('0x19'),_0x74ab('0x1a')),controller[_0x74ab('0x1b')]);router[_0x74ab('0x1c')](_0x74ab('0x10'),auth[_0x74ab('0xc')](),interaction[_0x74ab('0x18')]('fax','faxinteraction:update'),controller[_0x74ab('0x1d')]);router[_0x74ab('0x1e')](_0x74ab('0x10'),auth[_0x74ab('0xc')](),interaction[_0x74ab('0x18')](_0x74ab('0x19'),_0x74ab('0x1f')),controller[_0x74ab('0x20')]);router[_0x74ab('0x1e')](_0x74ab('0x17'),auth[_0x74ab('0xc')](),controller[_0x74ab('0x21')]);module[_0x74ab('0x22')]=router;
\ No newline at end of file
+var _0x2dd6=['destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','/:id/messages','getMessages','post','create','/:id/tags','tracked','fax','put','faxinteraction:update','update','delete','faxinteraction:destroy'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x2dd6,0x8f));var _0x62dd=function(_0x238a32,_0x596754){_0x238a32=_0x238a32-0x0;var _0x266ed5=_0x2dd6[_0x238a32];return _0x266ed5;};'use strict';var multer=require(_0x62dd('0x0'));var util=require(_0x62dd('0x1'));var path=require(_0x62dd('0x2'));var timeout=require('connect-timeout');var express=require(_0x62dd('0x3'));var router=express[_0x62dd('0x4')]();var fs_extra=require(_0x62dd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x62dd('0x6'));var config=require(_0x62dd('0x7'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0x62dd('0x8')](),controller['index']);router[_0x62dd('0x9')](_0x62dd('0xa'),auth['isAuthenticated'](),controller[_0x62dd('0xb')]);router[_0x62dd('0x9')](_0x62dd('0xc'),auth[_0x62dd('0x8')](),controller['show']);router[_0x62dd('0x9')](_0x62dd('0xd'),auth['isAuthenticated'](),controller[_0x62dd('0xe')]);router[_0x62dd('0x9')]('/:id/download',auth[_0x62dd('0x8')](),controller['download']);router[_0x62dd('0xf')]('/',auth[_0x62dd('0x8')](),controller[_0x62dd('0x10')]);router[_0x62dd('0xf')]('/:id/messages',auth[_0x62dd('0x8')](),controller['addMessage']);router[_0x62dd('0xf')](_0x62dd('0x11'),auth['isAuthenticated'](),interaction[_0x62dd('0x12')](_0x62dd('0x13'),'faxinteraction:addtags'),controller['addTags']);router[_0x62dd('0x14')](_0x62dd('0xc'),auth[_0x62dd('0x8')](),interaction['tracked']('fax',_0x62dd('0x15')),controller[_0x62dd('0x16')]);router[_0x62dd('0x17')](_0x62dd('0xc'),auth[_0x62dd('0x8')](),interaction['tracked'](_0x62dd('0x13'),_0x62dd('0x18')),controller[_0x62dd('0x19')]);router[_0x62dd('0x17')](_0x62dd('0x11'),auth[_0x62dd('0x8')](),controller[_0x62dd('0x1a')]);module[_0x62dd('0x1b')]=router;
\ No newline at end of file
index df870d5..cbcea48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a9c=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE'];(function(_0x46a2a5,_0xb31d62){var _0x4213dd=function(_0xbc06ec){while(--_0xbc06ec){_0x46a2a5['push'](_0x46a2a5['shift']());}};_0x4213dd(++_0xb31d62);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8a9('0x0'));module[_0xc8a9('0x1')]={'body':{'type':Sequelize[_0xc8a9('0x2')](_0xc8a9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc8a9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc8a9('0x5')),'defaultValue':_0xc8a9('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xc8a9('0x6')]}};
\ No newline at end of file
+var _0x7a72=['BOOLEAN','out','exports','TEXT'];(function(_0x1989b7,_0x5d8d6e){var _0x111d37=function(_0x86f495){while(--_0x86f495){_0x1989b7['push'](_0x1989b7['shift']());}};_0x111d37(++_0x5d8d6e);}(_0x7a72,0x1be));var _0x27a7=function(_0x3355b4,_0xb77993){_0x3355b4=_0x3355b4-0x0;var _0x11cc75=_0x7a72[_0x3355b4];return _0x11cc75;};'use strict';var Sequelize=require('sequelize');module[_0x27a7('0x0')]={'body':{'type':Sequelize[_0x27a7('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x27a7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x27a7('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x27a7('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 6676288..a818a48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a9=['stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','internal','motionChannel','reject','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','join','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','request','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','length','find','body','describe','fax-interactions','accept','read','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa8a9,0xb8));var _0x9a8a=function(_0x1ad9a6,_0x3a6c55){_0x1ad9a6=_0x1ad9a6-0x0;var _0x17539a=_0xa8a9[_0x1ad9a6];return _0x17539a;};'use strict';var emlformat=require(_0x9a8a('0x0'));var rimraf=require(_0x9a8a('0x1'));var zipdir=require(_0x9a8a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a8a('0x3'));var moment=require(_0x9a8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9a8a('0x5'));var util=require(_0x9a8a('0x6'));var path=require('path');var sox=require(_0x9a8a('0x7'));var csv=require('to-csv');var ejs=require(_0x9a8a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a8a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9a8a('0xa'));var deskjs=require(_0x9a8a('0xb'));var toCsv=require(_0x9a8a('0xc'));var querystring=require(_0x9a8a('0xd'));var Papa=require(_0x9a8a('0xe'));var Redis=require(_0x9a8a('0xf'));var authService=require(_0x9a8a('0x10'));var qs=require(_0x9a8a('0x11'));var as=require(_0x9a8a('0x12'));var hardwareService=require(_0x9a8a('0x13'));var logger=require(_0x9a8a('0x14'))(_0x9a8a('0x15'));var utils=require(_0x9a8a('0x16'));var config=require(_0x9a8a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a8a('0x18'))['db'];config[_0x9a8a('0x19')]=_['defaults'](config[_0x9a8a('0x19')],{'host':_0x9a8a('0x1a'),'port':0x18eb});var socket=require(_0x9a8a('0x1b'))(new Redis(config[_0x9a8a('0x19')]));require('./faxMessage.socket')[_0x9a8a('0x1c')](socket);var jayson=require(_0x9a8a('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ae3fe,_0x368e38,_0x5aab63,_0x1ca092){return new BPromise(function(_0x398594,_0x5065ef){var _0x1b9102=_0x1ca092||client;return _0x1b9102[_0x9a8a('0x1e')](_0x1ae3fe,_0x5aab63)['then'](function(_0x3cd828){logger[_0x9a8a('0x1f')](_0x9a8a('0x20'),_0x368e38,'request\x20sent');logger[_0x9a8a('0x21')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x368e38,_0x9a8a('0x22'),JSON['stringify'](_0x3cd828));if(_0x3cd828[_0x9a8a('0x23')]){if(_0x3cd828[_0x9a8a('0x23')][_0x9a8a('0x24')]===0x1f4){logger[_0x9a8a('0x23')](_0x9a8a('0x20'),_0x368e38,_0x3cd828[_0x9a8a('0x23')][_0x9a8a('0x25')]);return _0x5065ef(_0x3cd828[_0x9a8a('0x23')][_0x9a8a('0x25')]);}logger[_0x9a8a('0x23')](_0x9a8a('0x20'),_0x368e38,_0x3cd828['error'][_0x9a8a('0x25')]);return _0x398594(_0x3cd828[_0x9a8a('0x23')][_0x9a8a('0x25')]);}else{logger[_0x9a8a('0x1f')](_0x9a8a('0x20'),_0x368e38,_0x9a8a('0x22'));_0x398594(_0x3cd828['result'][_0x9a8a('0x25')]);}})[_0x9a8a('0x26')](function(_0x3ea6dd){logger[_0x9a8a('0x23')](_0x9a8a('0x20'),_0x368e38,_0x3ea6dd);_0x5065ef(_0x3ea6dd);});});}function respondWithStatusCode(_0x1ba695,_0xbb35e){_0xbb35e=_0xbb35e||0xcc;return function(_0x3404fe){if(_0x3404fe){return _0x1ba695[_0x9a8a('0x27')](_0xbb35e);}return _0x1ba695[_0x9a8a('0x28')](_0xbb35e)[_0x9a8a('0x29')]();};}function respondWithResult(_0x4cd503,_0x312aca){_0x312aca=_0x312aca||0xc8;return function(_0x2f107d){if(_0x2f107d){return _0x4cd503[_0x9a8a('0x28')](_0x312aca)[_0x9a8a('0x2a')](_0x2f107d);}};}function respondWithFilteredResult(_0x1727ba,_0x3c8ae4){return function(_0x49558d){if(_0x49558d){var _0x403932=typeof _0x3c8ae4[_0x9a8a('0x2b')]===_0x9a8a('0x2c')&&typeof _0x3c8ae4[_0x9a8a('0x2d')]===_0x9a8a('0x2c');var _0x590705=_0x49558d[_0x9a8a('0x2e')];var _0x273e71=_0x403932?0x0:_0x3c8ae4['offset'];var _0x322c11=_0x403932?_0x49558d['count']:_0x3c8ae4['offset']+_0x3c8ae4[_0x9a8a('0x2d')];var _0x3a0033;if(_0x322c11>=_0x590705){_0x322c11=_0x590705;_0x3a0033=0xc8;}else{_0x3a0033=0xce;}_0x1727ba[_0x9a8a('0x28')](_0x3a0033);return _0x1727ba[_0x9a8a('0x2f')](_0x9a8a('0x30'),_0x273e71+'-'+_0x322c11+'/'+_0x590705)['json'](_0x49558d);}return null;};}function patchUpdates(_0x36db52){return function(_0x2ed0e1){try{jsonpatch['apply'](_0x2ed0e1,_0x36db52,!![]);}catch(_0x2b93cd){return BPromise['reject'](_0x2b93cd);}return _0x2ed0e1[_0x9a8a('0x31')]();};}function saveUpdates(_0x53b217,_0x17ba9d){return function(_0x541cbc){if(_0x541cbc){return _0x541cbc[_0x9a8a('0x32')](_0x53b217)[_0x9a8a('0x33')](function(_0x21a60b){return _0x21a60b;});}return null;};}function removeEntity(_0x4c8122,_0x4849e4){return function(_0x52b961){if(_0x52b961){return _0x52b961[_0x9a8a('0x34')]()[_0x9a8a('0x33')](function(){_0x4c8122['status'](0xcc)[_0x9a8a('0x29')]();});}};}function handleEntityNotFound(_0xabcbb1,_0x5c8b7c){return function(_0x5ca9de){if(!_0x5ca9de){_0xabcbb1[_0x9a8a('0x27')](0x194);}return _0x5ca9de;};}function handleError(_0x4ce644,_0x5283ec){_0x5283ec=_0x5283ec||0x1f4;return function(_0x2f8b61){logger['error'](_0x2f8b61[_0x9a8a('0x35')]);if(_0x2f8b61[_0x9a8a('0x36')]){delete _0x2f8b61['name'];}_0x4ce644[_0x9a8a('0x28')](_0x5283ec)[_0x9a8a('0x37')](_0x2f8b61);};}exports[_0x9a8a('0x38')]=function(_0x33c37f,_0x52efee){var _0x4d3179={},_0x102340={},_0x5d1472={'count':0x0,'rows':[]};var _0x454382=_['map'](db[_0x9a8a('0x39')][_0x9a8a('0x3a')],function(_0x187520){return{'name':_0x187520[_0x9a8a('0x3b')],'type':_0x187520[_0x9a8a('0x3c')][_0x9a8a('0x3d')]};});_0x102340[_0x9a8a('0x3e')]=_['map'](_0x454382,_0x9a8a('0x36'));_0x102340['query']=_[_0x9a8a('0x3f')](_0x33c37f[_0x9a8a('0x40')]);_0x102340[_0x9a8a('0x41')]=_[_0x9a8a('0x42')](_0x102340[_0x9a8a('0x3e')],_0x102340['query']);_0x4d3179[_0x9a8a('0x43')]=_[_0x9a8a('0x42')](_0x102340[_0x9a8a('0x3e')],qs[_0x9a8a('0x44')](_0x33c37f[_0x9a8a('0x40')]['fields']));_0x4d3179[_0x9a8a('0x43')]=_0x4d3179[_0x9a8a('0x43')]['length']?_0x4d3179[_0x9a8a('0x43')]:_0x102340[_0x9a8a('0x3e')];if(!_0x33c37f[_0x9a8a('0x40')][_0x9a8a('0x45')](_0x9a8a('0x46'))){_0x4d3179['limit']=qs[_0x9a8a('0x2d')](_0x33c37f[_0x9a8a('0x40')]['limit']);_0x4d3179[_0x9a8a('0x2b')]=qs[_0x9a8a('0x2b')](_0x33c37f['query']['offset']);}_0x4d3179[_0x9a8a('0x47')]=qs['sort'](_0x33c37f['query']['sort']);_0x4d3179[_0x9a8a('0x48')]=qs[_0x9a8a('0x41')](_['pick'](_0x33c37f[_0x9a8a('0x40')],_0x102340[_0x9a8a('0x41')]),_0x454382);if(_0x33c37f[_0x9a8a('0x40')][_0x9a8a('0x49')]){_0x4d3179[_0x9a8a('0x48')]=_[_0x9a8a('0x4a')](_0x4d3179[_0x9a8a('0x48')],{'$or':_[_0x9a8a('0x4b')](_0x454382,function(_0x1788f4){if(_0x1788f4[_0x9a8a('0x3c')]!==_0x9a8a('0x4c')){var _0x4d7c8a={};_0x4d7c8a[_0x1788f4[_0x9a8a('0x36')]]={'$like':'%'+_0x33c37f[_0x9a8a('0x40')][_0x9a8a('0x49')]+'%'};return _0x4d7c8a;}})});}_0x4d3179=_[_0x9a8a('0x4a')]({},_0x4d3179,_0x33c37f[_0x9a8a('0x4d')]);var _0x3134a5={'where':_0x4d3179['where']};return db[_0x9a8a('0x39')][_0x9a8a('0x2e')](_0x3134a5)[_0x9a8a('0x33')](function(_0x4773ce){_0x5d1472[_0x9a8a('0x2e')]=_0x4773ce;if(_0x33c37f[_0x9a8a('0x40')]['includeAll']){_0x4d3179[_0x9a8a('0x4e')]=[{'all':!![]}];}return db[_0x9a8a('0x39')][_0x9a8a('0x4f')](_0x4d3179);})[_0x9a8a('0x33')](function(_0x3f6449){_0x5d1472[_0x9a8a('0x50')]=_0x3f6449;return _0x5d1472;})['then'](respondWithFilteredResult(_0x52efee,_0x4d3179))['catch'](handleError(_0x52efee,null));};exports[_0x9a8a('0x51')]=function(_0x183497,_0x1dcf71){var _0x3982cf={'raw':!![],'where':{'id':_0x183497[_0x9a8a('0x52')]['id']}},_0x509f7d={};_0x509f7d[_0x9a8a('0x3e')]=_[_0x9a8a('0x3f')](db[_0x9a8a('0x39')][_0x9a8a('0x3a')]);_0x509f7d['query']=_['keys'](_0x183497[_0x9a8a('0x40')]);_0x509f7d[_0x9a8a('0x41')]=_[_0x9a8a('0x42')](_0x509f7d[_0x9a8a('0x3e')],_0x509f7d[_0x9a8a('0x40')]);_0x3982cf[_0x9a8a('0x43')]=_['intersection'](_0x509f7d[_0x9a8a('0x3e')],qs[_0x9a8a('0x44')](_0x183497[_0x9a8a('0x40')]['fields']));_0x3982cf[_0x9a8a('0x43')]=_0x3982cf[_0x9a8a('0x43')][_0x9a8a('0x53')]?_0x3982cf[_0x9a8a('0x43')]:_0x509f7d['model'];if(_0x183497['query']['includeAll']){_0x3982cf[_0x9a8a('0x4e')]=[{'all':!![]}];}_0x3982cf=_['merge']({},_0x3982cf,_0x183497[_0x9a8a('0x4d')]);return db[_0x9a8a('0x39')][_0x9a8a('0x54')](_0x3982cf)[_0x9a8a('0x33')](handleEntityNotFound(_0x1dcf71,null))[_0x9a8a('0x33')](respondWithResult(_0x1dcf71,null))[_0x9a8a('0x26')](handleError(_0x1dcf71,null));};exports[_0x9a8a('0x32')]=function(_0x3a9ec0,_0xfa1e4d){if(_0x3a9ec0[_0x9a8a('0x55')]['id']){delete _0x3a9ec0['body']['id'];}return db[_0x9a8a('0x39')][_0x9a8a('0x54')]({'where':{'id':_0x3a9ec0[_0x9a8a('0x52')]['id']}})[_0x9a8a('0x33')](handleEntityNotFound(_0xfa1e4d,null))[_0x9a8a('0x33')](saveUpdates(_0x3a9ec0['body'],null))[_0x9a8a('0x33')](respondWithResult(_0xfa1e4d,null))[_0x9a8a('0x26')](handleError(_0xfa1e4d,null));};exports[_0x9a8a('0x34')]=function(_0x483432,_0x446659){return db['FaxMessage'][_0x9a8a('0x54')]({'where':{'id':_0x483432[_0x9a8a('0x52')]['id']}})[_0x9a8a('0x33')](handleEntityNotFound(_0x446659,null))[_0x9a8a('0x33')](removeEntity(_0x446659,null))['catch'](handleError(_0x446659,null));};exports[_0x9a8a('0x56')]=function(_0xa9f521,_0x2259ef){return db[_0x9a8a('0x39')][_0x9a8a('0x56')]()[_0x9a8a('0x33')](respondWithResult(_0x2259ef,null))['catch'](handleError(_0x2259ef,null));};var interaction_log=require(_0x9a8a('0x14'))(_0x9a8a('0x57'));exports[_0x9a8a('0x58')]=function(_0x3c9d0f,_0xd07d78,_0x36ba7e){var _0x509de4={'agent':{},'channel':'fax'};if(_0x3c9d0f[_0x9a8a('0x55')]['id']){delete _0x3c9d0f['body']['id'];}_0x3c9d0f[_0x9a8a('0x55')][_0x9a8a('0x59')]=!![];_0x3c9d0f[_0x9a8a('0x55')][_0x9a8a('0x5a')]=moment()[_0x9a8a('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c9d0f[_0x9a8a('0x55')][_0x9a8a('0x5c')]=_0x3c9d0f[_0x9a8a('0x55')][_0x9a8a('0x5c')]||_0x3c9d0f[_0x9a8a('0x5d')]['id'];_0x509de4[_0x9a8a('0x5e')]['id']=_0x3c9d0f['body'][_0x9a8a('0x5c')];return db[_0x9a8a('0x39')]['find']({'where':{'id':_0x3c9d0f[_0x9a8a('0x52')]['id'],'UserId':null}})[_0x9a8a('0x33')](handleEntityNotFound(_0xd07d78,null))[_0x9a8a('0x33')](saveUpdates(_0x3c9d0f['body'],null))['then'](function(_0x4c84a1){if(_0x4c84a1){_0x509de4[_0x9a8a('0x25')]=_0x4c84a1[_0x9a8a('0x5f')]({'plain':!![]});return db[_0x9a8a('0x60')]['find']({'where':{'id':_0x4c84a1[_0x9a8a('0x61')]}});}return null;})[_0x9a8a('0x33')](handleEntityNotFound(_0xd07d78,null))['then'](function(_0x447dd5){if(_0x447dd5){return _0x447dd5[_0x9a8a('0x32')]({'UserId':_0x3c9d0f['body'][_0x9a8a('0x5c')],'read1stAt':_[_0x9a8a('0x62')](_0x447dd5[_0x9a8a('0x63')])?moment()[_0x9a8a('0x5b')](_0x9a8a('0x64')):undefined});}return null;})[_0x9a8a('0x33')](function(_0x4a9104){if(_0x4a9104){_0x509de4['interaction']=_0x4a9104[_0x9a8a('0x5f')]({'plain':!![]});interaction_log[_0x9a8a('0x1f')](_0x9a8a('0x65'),_0x3c9d0f[_0x9a8a('0x5d')]['id'],_0x3c9d0f[_0x9a8a('0x5d')]['name'],_0x3c9d0f[_0x9a8a('0x5d')][_0x9a8a('0x66')],_0x509de4[_0x9a8a('0x67')]['id'],_0x3c9d0f[_0x9a8a('0x55')]?JSON[_0x9a8a('0x68')](_0x3c9d0f['body']):_0x9a8a('0x69'));return respondWithRpcPromise(_0x9a8a('0x6a'),_0x9a8a('0x6b'),_0x509de4);}return null;})[_0x9a8a('0x33')](function(_0x53377f){var _0x4f0856=_0x9a8a('0x6c')+_0x53377f[_0x9a8a('0x25')][_0x9a8a('0x6d')];return db[_0x9a8a('0x6e')][_0x9a8a('0x40')](_0x4f0856,{'type':db[_0x9a8a('0x6f')][_0x9a8a('0x70')][_0x9a8a('0x71')],'raw':!![]})[_0x9a8a('0x33')](function(_0x426368){return _0x426368;});})['then'](function(_0x58486a){if(_0x58486a){_0x509de4[_0x9a8a('0x25')][_0x9a8a('0x72')]=_0x58486a[0x0];if(!_0x3c9d0f[_0x9a8a('0x55')]['UserId'])return;return db['User'][_0x9a8a('0x54')]({'where':{'id':_0x3c9d0f['body'][_0x9a8a('0x5c')],'role':'agent'},'attributes':['id',_0x9a8a('0x36'),_0x9a8a('0x73'),_0x9a8a('0x74'),'internal'],'raw':!![]});}return null;})[_0x9a8a('0x33')](function(_0x19cff5){if(!_0x19cff5)return null;_0x509de4[_0x9a8a('0x25')][_0x9a8a('0x5e')]=_0x19cff5;return _0x509de4;})[_0x9a8a('0x33')](function(_0x6796cb){if(_0x6796cb){if(_0x3c9d0f['body']['manual']){_0x509de4[_0x9a8a('0x25')][_0x9a8a('0x75')]=util['format'](_0x9a8a('0x76'),_0x3c9d0f['user'][_0x9a8a('0x36')]);_0x509de4[_0x9a8a('0x25')]['channel']=_0x509de4[_0x9a8a('0x77')];_0x509de4[_0x9a8a('0x25')]['motionChannel']=_0x509de4[_0x9a8a('0x77')];_0x509de4[_0x9a8a('0x25')][_0x9a8a('0x78')]='accept';return respondWithRpcPromise(_0x9a8a('0x79'),_0x9a8a('0x79'),{'event':_0x9a8a('0x7a'),'message':_0x509de4[_0x9a8a('0x25')]},client9002)[_0x9a8a('0x33')](function(){return _0x509de4;});}return _0x509de4;}return null;})[_0x9a8a('0x33')](respondWithResult(_0xd07d78,null))[_0x9a8a('0x26')](handleError(_0xd07d78,null));};var interaction_log=require(_0x9a8a('0x14'))(_0x9a8a('0x57'));exports['reject']=function(_0x24f5e6,_0x162336,_0x139cd1){var _0x22940e={'agent':{},'channel':_0x9a8a('0x7b')};if(_0x24f5e6[_0x9a8a('0x55')]['id']){delete _0x24f5e6[_0x9a8a('0x55')]['id'];}_0x24f5e6['body']['UserId']=_0x24f5e6[_0x9a8a('0x55')][_0x9a8a('0x5c')]||_0x24f5e6[_0x9a8a('0x5d')]['id'];_0x22940e[_0x9a8a('0x5e')]['id']=_0x24f5e6[_0x9a8a('0x55')]['UserId'];return db[_0x9a8a('0x39')][_0x9a8a('0x54')]({'where':{'id':_0x24f5e6['params']['id'],'UserId':null}})[_0x9a8a('0x33')](handleEntityNotFound(_0x162336,null))[_0x9a8a('0x33')](function(_0x3cc667){if(_0x3cc667){_0x22940e[_0x9a8a('0x25')]=_0x3cc667[_0x9a8a('0x5f')]({'plain':!![]});return db['FaxInteraction'][_0x9a8a('0x54')]({'where':{'id':_0x3cc667['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x162336,null))[_0x9a8a('0x33')](function(_0x40e460){if(_0x40e460){_0x22940e['interaction']=_0x40e460['get']({'plain':!![]});interaction_log['info'](_0x9a8a('0x7c'),_0x24f5e6[_0x9a8a('0x5d')]['id'],_0x24f5e6['user']['name'],_0x24f5e6['user'][_0x9a8a('0x66')],_0x22940e[_0x9a8a('0x67')]['id'],_0x24f5e6[_0x9a8a('0x55')]?JSON['stringify'](_0x24f5e6[_0x9a8a('0x55')]):_0x9a8a('0x69'));return respondWithRpcPromise('RejectMessage',_0x9a8a('0x7d'),_0x22940e);}return null;})['then'](function(_0x474cb1){var _0x4d77b0=_0x9a8a('0x6c')+_0x474cb1[_0x9a8a('0x25')]['ContactId'];return db['sequelize']['query'](_0x4d77b0,{'type':db[_0x9a8a('0x6f')][_0x9a8a('0x70')][_0x9a8a('0x71')],'raw':!![]})[_0x9a8a('0x33')](function(_0x46c567){return _0x46c567;});})[_0x9a8a('0x33')](function(_0xc23552){if(_0xc23552){_0x22940e[_0x9a8a('0x25')][_0x9a8a('0x72')]=_0xc23552[0x0];if(!_0x24f5e6['body'][_0x9a8a('0x5c')])return;return db['User'][_0x9a8a('0x54')]({'where':{'id':_0x24f5e6[_0x9a8a('0x55')][_0x9a8a('0x5c')],'role':_0x9a8a('0x5e')},'attributes':['id',_0x9a8a('0x36'),_0x9a8a('0x73'),_0x9a8a('0x74'),_0x9a8a('0x7e')],'raw':!![]});}return null;})['then'](function(_0x4591bc){if(!_0x4591bc)return null;_0x22940e[_0x9a8a('0x25')][_0x9a8a('0x5e')]=_0x4591bc;return _0x22940e;})['then'](function(_0x2c8c25){if(_0x2c8c25){_0x2c8c25[_0x9a8a('0x25')][_0x9a8a('0x75')]=util[_0x9a8a('0x5b')](_0x9a8a('0x76'),_0x24f5e6[_0x9a8a('0x5d')][_0x9a8a('0x36')]);_0x2c8c25[_0x9a8a('0x25')]['channel']=_0x22940e[_0x9a8a('0x77')];_0x2c8c25[_0x9a8a('0x25')][_0x9a8a('0x7f')]=_0x22940e[_0x9a8a('0x77')];_0x2c8c25['message'][_0x9a8a('0x78')]=_0x9a8a('0x80');respondWithRpcPromise(_0x9a8a('0x79'),_0x9a8a('0x79'),{'event':_0x9a8a('0x81'),'message':_0x2c8c25['message']},client9002);return _0x22940e;}return null;})[_0x9a8a('0x33')](respondWithResult(_0x162336,null))[_0x9a8a('0x26')](handleError(_0x162336,null));};exports[_0x9a8a('0x82')]=function(_0x4cfc8e,_0x18dd27){var _0x431e23;return db[_0x9a8a('0x39')][_0x9a8a('0x82')](_0x4cfc8e[_0x9a8a('0x55')],{})[_0x9a8a('0x33')](function(_0xdadc76){_0x431e23=_0xdadc76;return db[_0x9a8a('0x83')][_0x9a8a('0x84')]({'where':{'id':_0x431e23[_0x9a8a('0x6d')]}});})[_0x9a8a('0x33')](function(_0x2e36ef){if(_[_0x9a8a('0x62')](_0x2e36ef)){return;}else{_0x431e23['fax']=_0x2e36ef['fax'];return db[_0x9a8a('0x85')]['findOne']({'where':{'id':_0x431e23[_0x9a8a('0x86')]}});}})[_0x9a8a('0x33')](function(_0x6c3322){return respondWithRpcPromise(_0x9a8a('0x87'),_0x9a8a('0x87'),{'FaxAccountId':_[_0x9a8a('0x62')](_0x4cfc8e[_0x9a8a('0x55')])?undefined:_0x4cfc8e[_0x9a8a('0x55')]['FaxAccountId'],'path':_['isNil'](_0x6c3322)?undefined:util['format'](_0x9a8a('0x88'),_0x6c3322[_0x9a8a('0x89')]),'fax':_['isNil'](_0x431e23[_0x9a8a('0x7b')])?undefined:_0x431e23['fax'],'AttachmentId':_0x431e23[_0x9a8a('0x86')]},client9002);})[_0x9a8a('0x33')](respondWithResult(_0x18dd27,0xc9))[_0x9a8a('0x26')](handleError(_0x18dd27,null));};exports[_0x9a8a('0x8a')]=function(_0x39291d,_0x5ba194){var _0x19d75e=path['join'](config[_0x9a8a('0x8b')],_0x9a8a('0x8c'),_0x9a8a('0x8d'),_0x9a8a('0x8e'));return db[_0x9a8a('0x39')][_0x9a8a('0x54')]({'where':{'id':_0x39291d['params']['id']},'include':[{'model':db['Attachment'],'as':_0x9a8a('0x85')}]})['then'](handleEntityNotFound(_0x5ba194,null))[_0x9a8a('0x33')](function(_0x1ac6d){if(_0x1ac6d){return _0x5ba194[_0x9a8a('0x8a')](path[_0x9a8a('0x8f')](_0x19d75e,_0x1ac6d[_0x9a8a('0x85')]['basename']));}})[_0x9a8a('0x26')](handleError(_0x5ba194,null));};
\ No newline at end of file
+var _0xf3cb=['json','undefined','count','offset','limit','set','Content-Range','apply','save','update','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','keys','options','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','params','get','FaxInteractionId','read1stAt','format','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','agent','fullname','email','internal','manual','channel','motionChannel','event','EventManager','reject','FaxInteraction','stringify','rejectMessage','QueryTypes','SELECT','interface','rejectmessage','create','CmContact','Attachment','findOne','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','attachments','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf3cb,0x175));var _0xbf3c=function(_0xa533ca,_0x4c8bef){_0xa533ca=_0xa533ca-0x0;var _0x4f18a3=_0xf3cb[_0xa533ca];return _0x4f18a3;};'use strict';var emlformat=require(_0xbf3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf3c('0x1'));var jsonpatch=require(_0xbf3c('0x2'));var rp=require(_0xbf3c('0x3'));var moment=require(_0xbf3c('0x4'));var BPromise=require(_0xbf3c('0x5'));var Mustache=require(_0xbf3c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbf3c('0x7'));var ejs=require(_0xbf3c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf3c('0x9'));var squel=require(_0xbf3c('0xa'));var crypto=require(_0xbf3c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbf3c('0xc'));var toCsv=require(_0xbf3c('0x7'));var querystring=require(_0xbf3c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbf3c('0xe'));var qs=require(_0xbf3c('0xf'));var as=require(_0xbf3c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf3c('0x11'))(_0xbf3c('0x12'));var utils=require(_0xbf3c('0x13'));var config=require(_0xbf3c('0x14'));var licenseUtil=require(_0xbf3c('0x15'));var db=require(_0xbf3c('0x16'))['db'];config[_0xbf3c('0x17')]=_[_0xbf3c('0x18')](config['redis'],{'host':_0xbf3c('0x19'),'port':0x18eb});var socket=require(_0xbf3c('0x1a'))(new Redis(config[_0xbf3c('0x17')]));require(_0xbf3c('0x1b'))['register'](socket);var jayson=require(_0xbf3c('0x1c'));var client=jayson[_0xbf3c('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xbf3c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6e6f0f,_0x53d644,_0x22edce,_0x2ef49f){return new BPromise(function(_0x104b91,_0x39faac){var _0x53e120=_0x2ef49f||client;return _0x53e120['request'](_0x6e6f0f,_0x22edce)[_0xbf3c('0x1e')](function(_0x1837aa){logger['info'](_0xbf3c('0x1f'),_0x53d644,_0xbf3c('0x20'));logger[_0xbf3c('0x21')](_0xbf3c('0x22'),_0x53d644,'request\x20sent',JSON['stringify'](_0x1837aa));if(_0x1837aa[_0xbf3c('0x23')]){if(_0x1837aa[_0xbf3c('0x23')][_0xbf3c('0x24')]===0x1f4){logger[_0xbf3c('0x23')](_0xbf3c('0x1f'),_0x53d644,_0x1837aa[_0xbf3c('0x23')][_0xbf3c('0x25')]);return _0x39faac(_0x1837aa[_0xbf3c('0x23')][_0xbf3c('0x25')]);}logger[_0xbf3c('0x23')](_0xbf3c('0x1f'),_0x53d644,_0x1837aa[_0xbf3c('0x23')][_0xbf3c('0x25')]);return _0x104b91(_0x1837aa[_0xbf3c('0x23')]['message']);}else{logger[_0xbf3c('0x26')](_0xbf3c('0x1f'),_0x53d644,_0xbf3c('0x20'));_0x104b91(_0x1837aa[_0xbf3c('0x27')]['message']);}})[_0xbf3c('0x28')](function(_0x48d05c){logger[_0xbf3c('0x23')](_0xbf3c('0x1f'),_0x53d644,_0x48d05c);_0x39faac(_0x48d05c);});});}function respondWithStatusCode(_0x57bdb3,_0x61e500){_0x61e500=_0x61e500||0xcc;return function(_0xa7f653){if(_0xa7f653){return _0x57bdb3[_0xbf3c('0x29')](_0x61e500);}return _0x57bdb3[_0xbf3c('0x2a')](_0x61e500)[_0xbf3c('0x2b')]();};}function respondWithResult(_0xc473b3,_0x444928){_0x444928=_0x444928||0xc8;return function(_0x434bea){if(_0x434bea){return _0xc473b3['status'](_0x444928)[_0xbf3c('0x2c')](_0x434bea);}};}function respondWithFilteredResult(_0x49dbee,_0x426041){return function(_0x2621dd){if(_0x2621dd){var _0x19106d=typeof _0x426041['offset']===_0xbf3c('0x2d')&&typeof _0x426041['limit']===_0xbf3c('0x2d');var _0x1259e3=_0x2621dd[_0xbf3c('0x2e')];var _0x1bb9cf=_0x19106d?0x0:_0x426041[_0xbf3c('0x2f')];var _0x28b3f0=_0x19106d?_0x2621dd[_0xbf3c('0x2e')]:_0x426041['offset']+_0x426041[_0xbf3c('0x30')];var _0x39bbcd;if(_0x28b3f0>=_0x1259e3){_0x28b3f0=_0x1259e3;_0x39bbcd=0xc8;}else{_0x39bbcd=0xce;}_0x49dbee[_0xbf3c('0x2a')](_0x39bbcd);return _0x49dbee[_0xbf3c('0x31')](_0xbf3c('0x32'),_0x1bb9cf+'-'+_0x28b3f0+'/'+_0x1259e3)[_0xbf3c('0x2c')](_0x2621dd);}return null;};}function patchUpdates(_0x159c4d){return function(_0x4d8461){try{jsonpatch[_0xbf3c('0x33')](_0x4d8461,_0x159c4d,!![]);}catch(_0x37b845){return BPromise['reject'](_0x37b845);}return _0x4d8461[_0xbf3c('0x34')]();};}function saveUpdates(_0x33a72e,_0x7fdf60){return function(_0x34561b){if(_0x34561b){return _0x34561b[_0xbf3c('0x35')](_0x33a72e)['then'](function(_0x42919c){return _0x42919c;});}return null;};}function removeEntity(_0x31dc8d,_0x3c1329){return function(_0x7b6a7){if(_0x7b6a7){return _0x7b6a7['destroy']()[_0xbf3c('0x1e')](function(){_0x31dc8d[_0xbf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22ed87,_0x44311a){return function(_0x26c44d){if(!_0x26c44d){_0x22ed87[_0xbf3c('0x29')](0x194);}return _0x26c44d;};}function handleError(_0x225072,_0x5b152c){_0x5b152c=_0x5b152c||0x1f4;return function(_0x2f2efb){logger[_0xbf3c('0x23')](_0x2f2efb[_0xbf3c('0x36')]);if(_0x2f2efb['name']){delete _0x2f2efb[_0xbf3c('0x37')];}_0x225072[_0xbf3c('0x2a')](_0x5b152c)[_0xbf3c('0x38')](_0x2f2efb);};}exports[_0xbf3c('0x39')]=function(_0x460597,_0x31c7ca){var _0x62ff9={},_0x238c1b={},_0x29b4ed={'count':0x0,'rows':[]};var _0x2ca979=_[_0xbf3c('0x3a')](db[_0xbf3c('0x3b')][_0xbf3c('0x3c')],function(_0x16794f){return{'name':_0x16794f[_0xbf3c('0x3d')],'type':_0x16794f[_0xbf3c('0x3e')]['key']};});_0x238c1b[_0xbf3c('0x3f')]=_[_0xbf3c('0x3a')](_0x2ca979,_0xbf3c('0x37'));_0x238c1b[_0xbf3c('0x40')]=_['keys'](_0x460597['query']);_0x238c1b[_0xbf3c('0x41')]=_[_0xbf3c('0x42')](_0x238c1b['model'],_0x238c1b[_0xbf3c('0x40')]);_0x62ff9[_0xbf3c('0x43')]=_[_0xbf3c('0x42')](_0x238c1b[_0xbf3c('0x3f')],qs[_0xbf3c('0x44')](_0x460597[_0xbf3c('0x40')]['fields']));_0x62ff9[_0xbf3c('0x43')]=_0x62ff9[_0xbf3c('0x43')][_0xbf3c('0x45')]?_0x62ff9[_0xbf3c('0x43')]:_0x238c1b[_0xbf3c('0x3f')];if(!_0x460597[_0xbf3c('0x40')][_0xbf3c('0x46')]('nolimit')){_0x62ff9['limit']=qs[_0xbf3c('0x30')](_0x460597[_0xbf3c('0x40')][_0xbf3c('0x30')]);_0x62ff9[_0xbf3c('0x2f')]=qs[_0xbf3c('0x2f')](_0x460597['query'][_0xbf3c('0x2f')]);}_0x62ff9['order']=qs[_0xbf3c('0x47')](_0x460597[_0xbf3c('0x40')]['sort']);_0x62ff9[_0xbf3c('0x48')]=qs[_0xbf3c('0x41')](_[_0xbf3c('0x49')](_0x460597[_0xbf3c('0x40')],_0x238c1b[_0xbf3c('0x41')]),_0x2ca979);if(_0x460597['query']['filter']){_0x62ff9[_0xbf3c('0x48')]=_[_0xbf3c('0x4a')](_0x62ff9['where'],{'$or':_[_0xbf3c('0x3a')](_0x2ca979,function(_0x3fce83){if(_0x3fce83['type']!==_0xbf3c('0x4b')){var _0x155994={};_0x155994[_0x3fce83[_0xbf3c('0x37')]]={'$like':'%'+_0x460597['query'][_0xbf3c('0x4c')]+'%'};return _0x155994;}})});}_0x62ff9=_['merge']({},_0x62ff9,_0x460597['options']);var _0x46e813={'where':_0x62ff9['where']};return db['FaxMessage'][_0xbf3c('0x2e')](_0x46e813)['then'](function(_0x1bac57){_0x29b4ed[_0xbf3c('0x2e')]=_0x1bac57;if(_0x460597[_0xbf3c('0x40')][_0xbf3c('0x4d')]){_0x62ff9[_0xbf3c('0x4e')]=[{'all':!![]}];}return db[_0xbf3c('0x3b')][_0xbf3c('0x4f')](_0x62ff9);})[_0xbf3c('0x1e')](function(_0x3d62bb){_0x29b4ed['rows']=_0x3d62bb;return _0x29b4ed;})[_0xbf3c('0x1e')](respondWithFilteredResult(_0x31c7ca,_0x62ff9))[_0xbf3c('0x28')](handleError(_0x31c7ca,null));};exports['show']=function(_0x356c86,_0x2d6794){var _0x3891c5={'raw':!![],'where':{'id':_0x356c86['params']['id']}},_0x49564b={};_0x49564b[_0xbf3c('0x3f')]=_[_0xbf3c('0x50')](db[_0xbf3c('0x3b')]['rawAttributes']);_0x49564b[_0xbf3c('0x40')]=_[_0xbf3c('0x50')](_0x356c86['query']);_0x49564b[_0xbf3c('0x41')]=_[_0xbf3c('0x42')](_0x49564b['model'],_0x49564b[_0xbf3c('0x40')]);_0x3891c5[_0xbf3c('0x43')]=_[_0xbf3c('0x42')](_0x49564b[_0xbf3c('0x3f')],qs['fields'](_0x356c86[_0xbf3c('0x40')][_0xbf3c('0x44')]));_0x3891c5[_0xbf3c('0x43')]=_0x3891c5[_0xbf3c('0x43')][_0xbf3c('0x45')]?_0x3891c5[_0xbf3c('0x43')]:_0x49564b[_0xbf3c('0x3f')];if(_0x356c86['query'][_0xbf3c('0x4d')]){_0x3891c5['include']=[{'all':!![]}];}_0x3891c5=_[_0xbf3c('0x4a')]({},_0x3891c5,_0x356c86[_0xbf3c('0x51')]);return db['FaxMessage'][_0xbf3c('0x52')](_0x3891c5)[_0xbf3c('0x1e')](handleEntityNotFound(_0x2d6794,null))['then'](respondWithResult(_0x2d6794,null))[_0xbf3c('0x28')](handleError(_0x2d6794,null));};exports[_0xbf3c('0x35')]=function(_0x4c99de,_0x3aa422){if(_0x4c99de['body']['id']){delete _0x4c99de[_0xbf3c('0x53')]['id'];}return db[_0xbf3c('0x3b')][_0xbf3c('0x52')]({'where':{'id':_0x4c99de['params']['id']}})['then'](handleEntityNotFound(_0x3aa422,null))[_0xbf3c('0x1e')](saveUpdates(_0x4c99de['body'],null))[_0xbf3c('0x1e')](respondWithResult(_0x3aa422,null))['catch'](handleError(_0x3aa422,null));};exports[_0xbf3c('0x54')]=function(_0x356eec,_0x426b02){return db[_0xbf3c('0x3b')][_0xbf3c('0x52')]({'where':{'id':_0x356eec['params']['id']}})[_0xbf3c('0x1e')](handleEntityNotFound(_0x426b02,null))[_0xbf3c('0x1e')](removeEntity(_0x426b02,null))['catch'](handleError(_0x426b02,null));};exports['describe']=function(_0x33a7f1,_0x1bbfcc){return db[_0xbf3c('0x3b')][_0xbf3c('0x55')]()[_0xbf3c('0x1e')](respondWithResult(_0x1bbfcc,null))[_0xbf3c('0x28')](handleError(_0x1bbfcc,null));};var interaction_log=require('../../config/logger')(_0xbf3c('0x56'));exports[_0xbf3c('0x57')]=function(_0xd27b31,_0x3a920f,_0x222521){var _0x4b61fc={'agent':{},'channel':_0xbf3c('0x58')};if(_0xd27b31['body']['id']){delete _0xd27b31['body']['id'];}_0xd27b31[_0xbf3c('0x53')][_0xbf3c('0x59')]=!![];_0xd27b31[_0xbf3c('0x53')][_0xbf3c('0x5a')]=moment()['format'](_0xbf3c('0x5b'));_0xd27b31['body']['UserId']=_0xd27b31[_0xbf3c('0x53')][_0xbf3c('0x5c')]||_0xd27b31['user']['id'];_0x4b61fc['agent']['id']=_0xd27b31[_0xbf3c('0x53')][_0xbf3c('0x5c')];return db['FaxMessage'][_0xbf3c('0x52')]({'where':{'id':_0xd27b31[_0xbf3c('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a920f,null))[_0xbf3c('0x1e')](saveUpdates(_0xd27b31[_0xbf3c('0x53')],null))['then'](function(_0x277da0){if(_0x277da0){_0x4b61fc[_0xbf3c('0x25')]=_0x277da0[_0xbf3c('0x5e')]({'plain':!![]});return db['FaxInteraction'][_0xbf3c('0x52')]({'where':{'id':_0x277da0[_0xbf3c('0x5f')]}});}return null;})[_0xbf3c('0x1e')](handleEntityNotFound(_0x3a920f,null))[_0xbf3c('0x1e')](function(_0x534225){if(_0x534225){return _0x534225['update']({'UserId':_0xd27b31[_0xbf3c('0x53')][_0xbf3c('0x5c')],'read1stAt':_['isNil'](_0x534225[_0xbf3c('0x60')])?moment()[_0xbf3c('0x61')](_0xbf3c('0x5b')):undefined});}return null;})['then'](function(_0x5856f8){if(_0x5856f8){_0x4b61fc['interaction']=_0x5856f8['get']({'plain':!![]});interaction_log[_0xbf3c('0x26')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd27b31[_0xbf3c('0x62')]['id'],_0xd27b31['user']['name'],_0xd27b31[_0xbf3c('0x62')][_0xbf3c('0x63')],_0x4b61fc[_0xbf3c('0x64')]['id'],_0xd27b31['body']?JSON['stringify'](_0xd27b31['body']):_0xbf3c('0x65'));return respondWithRpcPromise(_0xbf3c('0x66'),_0xbf3c('0x67'),_0x4b61fc);}return null;})[_0xbf3c('0x1e')](function(_0x5e7851){var _0x8ed87a=_0xbf3c('0x68')+_0x5e7851['message'][_0xbf3c('0x69')];return db[_0xbf3c('0x6a')]['query'](_0x8ed87a,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xbf3c('0x1e')](function(_0x29d590){return _0x29d590;});})['then'](function(_0x1f5ecd){if(_0x1f5ecd){_0x4b61fc[_0xbf3c('0x25')][_0xbf3c('0x6b')]=_0x1f5ecd[0x0];if(!_0xd27b31['body'][_0xbf3c('0x5c')])return;return db[_0xbf3c('0x6c')][_0xbf3c('0x52')]({'where':{'id':_0xd27b31['body'][_0xbf3c('0x5c')],'role':_0xbf3c('0x6d')},'attributes':['id','name',_0xbf3c('0x6e'),_0xbf3c('0x6f'),_0xbf3c('0x70')],'raw':!![]});}return null;})[_0xbf3c('0x1e')](function(_0xd86a6a){if(!_0xd86a6a)return null;_0x4b61fc['message']['agent']=_0xd86a6a;return _0x4b61fc;})['then'](function(_0x4112fb){if(_0x4112fb){if(_0xd27b31[_0xbf3c('0x53')][_0xbf3c('0x71')]){_0x4b61fc[_0xbf3c('0x25')]['interface']=util[_0xbf3c('0x61')]('SIP/%s',_0xd27b31[_0xbf3c('0x62')][_0xbf3c('0x37')]);_0x4b61fc[_0xbf3c('0x25')][_0xbf3c('0x72')]=_0x4b61fc[_0xbf3c('0x72')];_0x4b61fc[_0xbf3c('0x25')][_0xbf3c('0x73')]=_0x4b61fc[_0xbf3c('0x72')];_0x4b61fc[_0xbf3c('0x25')][_0xbf3c('0x74')]='accept';return respondWithRpcPromise('EventManager',_0xbf3c('0x75'),{'event':'acceptmessage','message':_0x4b61fc[_0xbf3c('0x25')]},client9002)[_0xbf3c('0x1e')](function(){return _0x4b61fc;});}return _0x4b61fc;}return null;})[_0xbf3c('0x1e')](respondWithResult(_0x3a920f,null))[_0xbf3c('0x28')](handleError(_0x3a920f,null));};var interaction_log=require(_0xbf3c('0x11'))(_0xbf3c('0x56'));exports[_0xbf3c('0x76')]=function(_0x3aab14,_0x4f9f34,_0x543846){var _0x270d8c={'agent':{},'channel':_0xbf3c('0x58')};if(_0x3aab14[_0xbf3c('0x53')]['id']){delete _0x3aab14['body']['id'];}_0x3aab14[_0xbf3c('0x53')][_0xbf3c('0x5c')]=_0x3aab14['body'][_0xbf3c('0x5c')]||_0x3aab14[_0xbf3c('0x62')]['id'];_0x270d8c['agent']['id']=_0x3aab14[_0xbf3c('0x53')][_0xbf3c('0x5c')];return db['FaxMessage'][_0xbf3c('0x52')]({'where':{'id':_0x3aab14[_0xbf3c('0x5d')]['id'],'UserId':null}})[_0xbf3c('0x1e')](handleEntityNotFound(_0x4f9f34,null))['then'](function(_0x1ff608){if(_0x1ff608){_0x270d8c[_0xbf3c('0x25')]=_0x1ff608[_0xbf3c('0x5e')]({'plain':!![]});return db[_0xbf3c('0x77')][_0xbf3c('0x52')]({'where':{'id':_0x1ff608[_0xbf3c('0x5f')]}});}return null;})[_0xbf3c('0x1e')](handleEntityNotFound(_0x4f9f34,null))[_0xbf3c('0x1e')](function(_0xb26b5c){if(_0xb26b5c){_0x270d8c[_0xbf3c('0x64')]=_0xb26b5c[_0xbf3c('0x5e')]({'plain':!![]});interaction_log[_0xbf3c('0x26')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3aab14[_0xbf3c('0x62')]['id'],_0x3aab14[_0xbf3c('0x62')]['name'],_0x3aab14[_0xbf3c('0x62')][_0xbf3c('0x63')],_0x270d8c[_0xbf3c('0x64')]['id'],_0x3aab14[_0xbf3c('0x53')]?JSON[_0xbf3c('0x78')](_0x3aab14[_0xbf3c('0x53')]):_0xbf3c('0x65'));return respondWithRpcPromise('RejectMessage',_0xbf3c('0x79'),_0x270d8c);}return null;})[_0xbf3c('0x1e')](function(_0x46f03b){var _0x5b3cf8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46f03b[_0xbf3c('0x25')][_0xbf3c('0x69')];return db['sequelize'][_0xbf3c('0x40')](_0x5b3cf8,{'type':db['Sequelize'][_0xbf3c('0x7a')][_0xbf3c('0x7b')],'raw':!![]})[_0xbf3c('0x1e')](function(_0x2afede){return _0x2afede;});})['then'](function(_0x8917bc){if(_0x8917bc){_0x270d8c[_0xbf3c('0x25')][_0xbf3c('0x6b')]=_0x8917bc[0x0];if(!_0x3aab14[_0xbf3c('0x53')][_0xbf3c('0x5c')])return;return db[_0xbf3c('0x6c')]['find']({'where':{'id':_0x3aab14[_0xbf3c('0x53')][_0xbf3c('0x5c')],'role':'agent'},'attributes':['id',_0xbf3c('0x37'),_0xbf3c('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0xbf3c('0x1e')](function(_0x58d5b3){if(!_0x58d5b3)return null;_0x270d8c[_0xbf3c('0x25')][_0xbf3c('0x6d')]=_0x58d5b3;return _0x270d8c;})[_0xbf3c('0x1e')](function(_0x19c501){if(_0x19c501){_0x19c501[_0xbf3c('0x25')][_0xbf3c('0x7c')]=util[_0xbf3c('0x61')]('SIP/%s',_0x3aab14[_0xbf3c('0x62')][_0xbf3c('0x37')]);_0x19c501[_0xbf3c('0x25')][_0xbf3c('0x72')]=_0x270d8c['channel'];_0x19c501['message']['motionChannel']=_0x270d8c[_0xbf3c('0x72')];_0x19c501[_0xbf3c('0x25')][_0xbf3c('0x74')]=_0xbf3c('0x76');respondWithRpcPromise(_0xbf3c('0x75'),_0xbf3c('0x75'),{'event':_0xbf3c('0x7d'),'message':_0x19c501['message']},client9002);return _0x270d8c;}return null;})[_0xbf3c('0x1e')](respondWithResult(_0x4f9f34,null))[_0xbf3c('0x28')](handleError(_0x4f9f34,null));};exports[_0xbf3c('0x7e')]=function(_0x452b3f,_0x4b264c){var _0x5999c5;return db[_0xbf3c('0x3b')]['create'](_0x452b3f[_0xbf3c('0x53')],{})[_0xbf3c('0x1e')](function(_0x3ca23e){_0x5999c5=_0x3ca23e;return db[_0xbf3c('0x7f')]['findOne']({'where':{'id':_0x5999c5[_0xbf3c('0x69')]}});})['then'](function(_0x1489f4){if(_['isNil'](_0x1489f4)){return;}else{_0x5999c5[_0xbf3c('0x58')]=_0x1489f4['fax'];return db[_0xbf3c('0x80')][_0xbf3c('0x81')]({'where':{'id':_0x5999c5['AttachmentId']}});}})[_0xbf3c('0x1e')](function(_0x4e99d6){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xbf3c('0x82')](_0x452b3f[_0xbf3c('0x53')])?undefined:_0x452b3f[_0xbf3c('0x53')][_0xbf3c('0x83')],'path':_['isNil'](_0x4e99d6)?undefined:util['format'](_0xbf3c('0x84'),_0x4e99d6[_0xbf3c('0x85')]),'fax':_[_0xbf3c('0x82')](_0x5999c5[_0xbf3c('0x58')])?undefined:_0x5999c5[_0xbf3c('0x58')],'AttachmentId':_0x5999c5[_0xbf3c('0x86')]},client9002);})[_0xbf3c('0x1e')](respondWithResult(_0x4b264c,0xc9))['catch'](handleError(_0x4b264c,null));};exports[_0xbf3c('0x87')]=function(_0x29b021,_0x180f7b){var _0x4348d5=path['join'](config[_0xbf3c('0x88')],'server','files',_0xbf3c('0x89'));return db[_0xbf3c('0x3b')][_0xbf3c('0x52')]({'where':{'id':_0x29b021[_0xbf3c('0x5d')]['id']},'include':[{'model':db[_0xbf3c('0x80')],'as':_0xbf3c('0x80')}]})[_0xbf3c('0x1e')](handleEntityNotFound(_0x180f7b,null))[_0xbf3c('0x1e')](function(_0x103e1f){if(_0x103e1f){return _0x180f7b['download'](path[_0xbf3c('0x8a')](_0x4348d5,_0x103e1f[_0xbf3c('0x80')]['basename']));}})[_0xbf3c('0x28')](handleError(_0x180f7b,null));};
\ No newline at end of file
index adad64f..8fb5ac8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2484=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x39cefa,_0x22a1a6){var _0x3b2ceb=function(_0x5328e0){while(--_0x5328e0){_0x39cefa['push'](_0x39cefa['shift']());}};_0x3b2ceb(++_0x22a1a6);}(_0x2484,0x178));var _0x4248=function(_0x8f0755,_0x9b2637){_0x8f0755=_0x8f0755-0x0;var _0x2b2997=_0x2484[_0x8f0755];return _0x2b2997;};'use strict';var EventEmitter=require(_0x4248('0x0'));var FaxMessage=require(_0x4248('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4248('0x2')](0x0);var events={'afterCreate':_0x4248('0x3'),'afterUpdate':_0x4248('0x4'),'afterDestroy':_0x4248('0x5')};function emitEvent(_0x20f0ec){return function(_0x3f98a6,_0x42b611,_0x588b99){FaxMessageEvents[_0x4248('0x6')](_0x20f0ec+':'+_0x3f98a6['id'],_0x3f98a6);FaxMessageEvents[_0x4248('0x6')](_0x20f0ec,_0x3f98a6);_0x588b99(null);};}for(var e in events){if(events[_0x4248('0x7')](e)){var event=events[e];FaxMessage[_0x4248('0x8')](e,emitEvent(event));}}module[_0x4248('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0x8fcd=['events','../../mysqldb','FaxMessage','setMaxListeners','save','emit','exports'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x435576,_0x12a1af){_0x435576=_0x435576-0x0;var _0x3df7d3=_0x8fcd[_0x435576];return _0x3df7d3;};'use strict';var EventEmitter=require(_0xd8fc('0x0'));var FaxMessage=require(_0xd8fc('0x1'))['db'][_0xd8fc('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xd8fc('0x3')](0x0);var events={'afterCreate':_0xd8fc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x353592){return function(_0x36d5ad,_0x41aaf1,_0x2d5000){FaxMessageEvents[_0xd8fc('0x5')](_0x353592+':'+_0x36d5ad['id'],_0x36d5ad);FaxMessageEvents[_0xd8fc('0x5')](_0x353592,_0x36d5ad);_0x2d5000(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xd8fc('0x6')]=FaxMessageEvents;
\ No newline at end of file
index 4cc4c28..9b465a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb2=['update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','FaxMessage','fax_messages','body','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x6bb2,0x117));var _0x26bb=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6bb2[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x26bb('0x0'));var util=require(_0x26bb('0x1'));var logger=require(_0x26bb('0x2'))('api');var moment=require('moment');var BPromise=require(_0x26bb('0x3'));var rp=require(_0x26bb('0x4'));var fs=require('fs');var path=require(_0x26bb('0x5'));var rimraf=require(_0x26bb('0x6'));var config=require(_0x26bb('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x412d76,_0x194b2f){return _0x412d76['define'](_0x26bb('0x8'),attributes,{'tableName':_0x26bb('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x26bb('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x558bbd,_0x274920,_0x3b0fa4){var _0x49b460=_0x412d76[_0x26bb('0xb')];var _0xcfdbfe=_0x558bbd['get']({'plain':!![]});if(_0xcfdbfe[_0x26bb('0xc')]['toLowerCase']()==='in'||_0xcfdbfe[_0x26bb('0xc')][_0x26bb('0xd')]()===_0x26bb('0xe')&&!_0xcfdbfe['secret']&&!_[_0x26bb('0xf')](_0xcfdbfe[_0x26bb('0x10')])){_0x49b460[_0x26bb('0x11')][_0x26bb('0x12')]({'where':{'id':_0xcfdbfe[_0x26bb('0x13')]}})['then'](function(_0x5c4d52){if(_0x5c4d52){_0x5c4d52[_0x26bb('0x14')]({'lastMsgAt':_0xcfdbfe['createdAt'],'lastMsgDirection':_0xcfdbfe['direction'][_0x26bb('0xd')]()});}})['catch'](function(_0x4d7db5){console['error'](_0x4d7db5);});}_0x3b0fa4();}},'charset':_0x26bb('0x15'),'collate':_0x26bb('0x16')});};
\ No newline at end of file
+var _0xdb4d=['toLowerCase','out','secret','isNil','UserId','findOne','then','update','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction'];(function(_0x5df3bb,_0x109705){var _0x2c9915=function(_0x3f5efc){while(--_0x3f5efc){_0x5df3bb['push'](_0x5df3bb['shift']());}};_0x2c9915(++_0x109705);}(_0xdb4d,0xab));var _0xddb4=function(_0x2ab063,_0x49abb5){_0x2ab063=_0x2ab063-0x0;var _0x148313=_0xdb4d[_0x2ab063];return _0x148313;};'use strict';var _=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var logger=require(_0xddb4('0x2'))(_0xddb4('0x3'));var moment=require(_0xddb4('0x4'));var BPromise=require(_0xddb4('0x5'));var rp=require(_0xddb4('0x6'));var fs=require('fs');var path=require(_0xddb4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xddb4('0x8'));module[_0xddb4('0x9')]=function(_0xb4b073,_0x433d2b){return _0xb4b073[_0xddb4('0xa')](_0xddb4('0xb'),attributes,{'tableName':_0xddb4('0xc'),'paranoid':![],'indexes':[{'name':_0xddb4('0xd'),'fields':[_0xddb4('0xe')],'type':_0xddb4('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58ad64,_0x92e301,_0x27ac6d){var _0x50d8bb=_0xb4b073[_0xddb4('0x10')];var _0x24c654=_0x58ad64['get']({'plain':!![]});if(_0x24c654[_0xddb4('0x11')][_0xddb4('0x12')]()==='in'||_0x24c654['direction'][_0xddb4('0x12')]()===_0xddb4('0x13')&&!_0x24c654[_0xddb4('0x14')]&&!_[_0xddb4('0x15')](_0x24c654[_0xddb4('0x16')])){_0x50d8bb['FaxInteraction'][_0xddb4('0x17')]({'where':{'id':_0x24c654['FaxInteractionId']}})[_0xddb4('0x18')](function(_0x1e103a){if(_0x1e103a){_0x1e103a[_0xddb4('0x19')]({'lastMsgAt':_0x24c654['createdAt'],'lastMsgDirection':_0x24c654['direction']['toLowerCase']()});}})[_0xddb4('0x1a')](function(_0x4a3adc){console['error'](_0x4a3adc);});}_0x27ac6d();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 08b9197..5c078ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['code','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d8b5a,_0x305edd){var _0x80c139=function(_0x452489){while(--_0x452489){_0x5d8b5a['push'](_0x5d8b5a['shift']());}};_0x80c139(++_0x305edd);}(_0xe14d,0x1ee));var _0xde14=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xe14d[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xde14('0xc')],{'host':_0xde14('0xd'),'port':0x18eb});var socket=require(_0xde14('0xe'))(new Redis(config[_0xde14('0xc')]));require(_0xde14('0xf'))[_0xde14('0x10')](socket);function respondWithRpcPromise(_0xa17e8,_0x1ce0a2,_0x4b2b15){return new BPromise(function(_0x1a7167,_0xe785fb){return client[_0xde14('0x11')](_0xa17e8,_0x4b2b15)[_0xde14('0x12')](function(_0x8e0e){logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));logger[_0xde14('0x16')](_0xde14('0x17'),_0x1ce0a2,_0xde14('0x15'),JSON[_0xde14('0x18')](_0x8e0e));if(_0x8e0e[_0xde14('0x19')]){if(_0x8e0e[_0xde14('0x19')][_0xde14('0x1a')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0xe785fb(_0x8e0e[_0xde14('0x19')]['message']);}logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0x1a7167(_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);}else{logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));_0x1a7167(_0x8e0e[_0xde14('0x1c')]['message']);}})[_0xde14('0x1d')](function(_0x3bfc59){logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x3bfc59);_0xe785fb(_0x3bfc59);});});}exports['CreateFaxMessage']=function(_0x394de7){var _0x53e905=this;return new Promise(function(_0x45d101,_0x4c24a8){return db[_0xde14('0x1e')][_0xde14('0x1f')](_0x394de7[_0xde14('0x20')],{'raw':_0x394de7[_0xde14('0x21')]?_0x394de7[_0xde14('0x21')][_0xde14('0x22')]===undefined?!![]:![]:!![]})[_0xde14('0x12')](function(_0x2dd9e7){logger[_0xde14('0x13')](_0xde14('0x23'),_0x394de7);logger[_0xde14('0x16')](_0xde14('0x23'),_0x394de7,JSON[_0xde14('0x18')](_0x2dd9e7));_0x45d101(_0x2dd9e7);})['catch'](function(_0x42dd4f){logger[_0xde14('0x19')](_0xde14('0x23'),_0x42dd4f[_0xde14('0x1b')],_0x394de7);_0x4c24a8(_0x53e905[_0xde14('0x19')](0x1f4,_0x42dd4f[_0xde14('0x1b')]));});});};exports[_0xde14('0x24')]=function(_0x23c735){var _0x1618e1=this;return new Promise(function(_0x350a78,_0x4eff65){return db[_0xde14('0x1e')][_0xde14('0x25')](_0x23c735[_0xde14('0x20')],{'raw':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')]['where']||null:null,'attributes':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x26')]||null:null,'limit':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')][_0xde14('0x27')]||null:null})[_0xde14('0x12')](function(_0x237d3f){logger[_0xde14('0x13')](_0xde14('0x24'),_0x23c735);logger['debug'](_0xde14('0x24'),_0x23c735,JSON[_0xde14('0x18')](_0x237d3f));_0x350a78(_0x237d3f);})['catch'](function(_0xf25a9e){logger['error'](_0xde14('0x24'),_0xf25a9e[_0xde14('0x1b')],_0x23c735);_0x4eff65(_0x1618e1[_0xde14('0x19')](0x1f4,_0xf25a9e[_0xde14('0x1b')]));});});};
\ No newline at end of file
+var _0x9957=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','body','options','raw','CreateFaxMessage','catch','UpdateFaxMessage','FaxMessage','where','attributes','lodash'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});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')]('FaxMessage,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['CreateFaxMessage']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['FaxMessage']['create'](_0x3ec178[_0x7995('0x1c')],{'raw':_0x3ec178[_0x7995('0x1d')]?_0x3ec178[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![]})[_0x7995('0x12')](function(_0x1c278a){logger['info'](_0x7995('0x1f'),_0x3ec178);logger[_0x7995('0x15')](_0x7995('0x1f'),_0x3ec178,JSON[_0x7995('0x17')](_0x1c278a));_0x4cbe10(_0x1c278a);})[_0x7995('0x20')](function(_0x13bc35){logger[_0x7995('0x18')](_0x7995('0x1f'),_0x13bc35['message'],_0x3ec178);_0x3a9b54(_0x3d463e[_0x7995('0x18')](0x1f4,_0x13bc35[_0x7995('0x19')]));});});};exports[_0x7995('0x21')]=function(_0x268ce7){var _0x3a3fcf=this;return new Promise(function(_0x2a307e,_0x56691a){return db[_0x7995('0x22')]['update'](_0x268ce7[_0x7995('0x1c')],{'raw':_0x268ce7[_0x7995('0x1d')]?_0x268ce7[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options'][_0x7995('0x23')]||null:null,'attributes':_0x268ce7['options']?_0x268ce7[_0x7995('0x1d')][_0x7995('0x24')]||null:null,'limit':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options']['limit']||null:null})['then'](function(_0x3573be){logger[_0x7995('0x1a')](_0x7995('0x21'),_0x268ce7);logger[_0x7995('0x15')](_0x7995('0x21'),_0x268ce7,JSON[_0x7995('0x17')](_0x3573be));_0x2a307e(_0x3573be);})['catch'](function(_0x481c74){logger[_0x7995('0x18')]('UpdateFaxMessage',_0x481c74[_0x7995('0x19')],_0x268ce7);_0x56691a(_0x3a3fcf[_0x7995('0x18')](0x1f4,_0x481c74[_0x7995('0x19')]));});});};
\ No newline at end of file
index 57bafcf..6f0e82a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf9f=['length','faxMessage:','save','update','emit','removeListener','register'];(function(_0x454e70,_0x5367ae){var _0x57a428=function(_0x995a6){while(--_0x995a6){_0x454e70['push'](_0x454e70['shift']());}};_0x57a428(++_0x5367ae);}(_0xdf9f,0x79));var _0xfdf9=function(_0x19c9b9,_0x1af545){_0x19c9b9=_0x19c9b9-0x0;var _0x5af33f=_0xdf9f[_0x19c9b9];return _0x5af33f;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xfdf9('0x0'),'remove',_0xfdf9('0x1')];function createListener(_0x5e0e70,_0x16e693){return function(_0xd29f0){_0x16e693[_0xfdf9('0x2')](_0x5e0e70,_0xd29f0);};}function removeListener(_0xeafac1,_0x585728){return function(){FaxMessageEvents[_0xfdf9('0x3')](_0xeafac1,_0x585728);};}exports[_0xfdf9('0x4')]=function(_0x19abf6){for(var _0x4d13cc=0x0,_0x565cda=events[_0xfdf9('0x5')];_0x4d13cc<_0x565cda;_0x4d13cc++){var _0x3fb8f0=events[_0x4d13cc];var _0x2edaa4=createListener(_0xfdf9('0x6')+_0x3fb8f0,_0x19abf6);FaxMessageEvents['on'](_0x3fb8f0,_0x2edaa4);}};
\ No newline at end of file
+var _0x3787=['length','faxMessage:','save','update','emit'];(function(_0xe0217a,_0x231ea7){var _0x17260e=function(_0x5c1c97){while(--_0x5c1c97){_0xe0217a['push'](_0xe0217a['shift']());}};_0x17260e(++_0x231ea7);}(_0x3787,0x1d3));var _0x7378=function(_0x4f622c,_0x434190){_0x4f622c=_0x4f622c-0x0;var _0x1c0d65=_0x3787[_0x4f622c];return _0x1c0d65;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x7378('0x0'),'remove',_0x7378('0x1')];function createListener(_0x4588b3,_0x540d1b){return function(_0x4d5b9b){_0x540d1b[_0x7378('0x2')](_0x4588b3,_0x4d5b9b);};}function removeListener(_0x3dc44c,_0x1db6f9){return function(){FaxMessageEvents['removeListener'](_0x3dc44c,_0x1db6f9);};}exports['register']=function(_0x4c0a4e){for(var _0x1e4007=0x0,_0x2a1764=events[_0x7378('0x3')];_0x1e4007<_0x2a1764;_0x1e4007++){var _0xbba144=events[_0x1e4007];var _0x3d01b2=createListener(_0x7378('0x4')+_0xbba144,_0x4c0a4e);FaxMessageEvents['on'](_0xbba144,_0x3d01b2);}};
\ No newline at end of file
index ba90891..0fbf41e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2750=['put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','/:id','/:id/download','download','post','tracked','fax','create'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2750,0x13b));var _0x0275=function(_0x22cd53,_0x6fd9f){_0x22cd53=_0x22cd53-0x0;var _0x394c2e=_0x2750[_0x22cd53];return _0x394c2e;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['get'](_0x0275('0xf'),auth['isAuthenticated'](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/',auth[_0x0275('0xd')](),interaction[_0x0275('0x12')](_0x0275('0x13'),'faxmessage:create'),controller[_0x0275('0x14')]);router[_0x0275('0x15')](_0x0275('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x0275('0x15')](_0x0275('0x16'),auth[_0x0275('0xd')](),controller[_0x0275('0x17')]);router[_0x0275('0x15')](_0x0275('0x18'),auth['isAuthenticated'](),controller[_0x0275('0x19')]);router[_0x0275('0x1a')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x16d2=['./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x16d2,0x123));var _0x216d=function(_0x11d517,_0x2daed9){_0x11d517=_0x11d517-0x0;var _0x566a0a=_0x16d2[_0x11d517];return _0x566a0a;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['download']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),interaction[_0x216d('0x13')](_0x216d('0x14'),_0x216d('0x15')),controller[_0x216d('0x16')]);router[_0x216d('0x17')](_0x216d('0xf'),auth['isAuthenticated'](),controller[_0x216d('0x18')]);router['put'](_0x216d('0x19'),auth[_0x216d('0xb')](),controller['accept']);router[_0x216d('0x17')](_0x216d('0x1a'),auth['isAuthenticated'](),controller[_0x216d('0x1b')]);router['delete'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x1c')]);module[_0x216d('0x1d')]=router;
\ No newline at end of file
index d2cd76c..ef8ea83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdc2=['sequelize','exports','STRING','name','ENUM','rrmemory','roundrobin','INTEGER'];(function(_0x9aac22,_0x45bb71){var _0x295d36=function(_0x43c1cd){while(--_0x43c1cd){_0x9aac22['push'](_0x9aac22['shift']());}};_0x295d36(++_0x45bb71);}(_0xbdc2,0x148));var _0x2bdc=function(_0x4ef1a9,_0x59a5fa){_0x4ef1a9=_0x4ef1a9-0x0;var _0x23f201=_0xbdc2[_0x4ef1a9];return _0x23f201;};'use strict';var Sequelize=require(_0x2bdc('0x0'));module[_0x2bdc('0x1')]={'name':{'type':Sequelize[_0x2bdc('0x2')],'unique':_0x2bdc('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2bdc('0x4')](_0x2bdc('0x5'),'beepall',_0x2bdc('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2bdc('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x51d1=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x317b5e,_0x4028a4){var _0x54ebeb=function(_0x327984){while(--_0x327984){_0x317b5e['push'](_0x317b5e['shift']());}};_0x54ebeb(++_0x4028a4);}(_0x51d1,0x1d6));var _0x151d=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x51d1[_0x460150];return _0x340677;};'use strict';var Sequelize=require(_0x151d('0x0'));module[_0x151d('0x1')]={'name':{'type':Sequelize[_0x151d('0x2')],'unique':_0x151d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x151d('0x2')]},'timeout':{'type':Sequelize[_0x151d('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x151d('0x5')](_0x151d('0x6'),_0x151d('0x7'),_0x151d('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x151d('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 1513412..a723935 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9ba=['user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','nolimit','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','Team','Agents','online','interface','transaction','each','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','includes','union','compact','value','isEmpty','removeAgents','addAgents','ids','omit','spread','isArray','userFaxQueue:remove','getAgents','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','then','destroy','get','FaxQueues','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','FaxQueue','count','includeAll','include','findAll','rows','catch','params','find','create','body'];(function(_0x1c7bb2,_0x3a2053){var _0x36f891=function(_0x437e4f){while(--_0x437e4f){_0x1c7bb2['push'](_0x1c7bb2['shift']());}};_0x36f891(++_0x3a2053);}(_0xf9ba,0x156));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf9b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf9b('0x1'));var moment=require(_0xaf9b('0x2'));var BPromise=require(_0xaf9b('0x3'));var Mustache=require(_0xaf9b('0x4'));var util=require(_0xaf9b('0x5'));var path=require('path');var sox=require(_0xaf9b('0x6'));var csv=require(_0xaf9b('0x7'));var ejs=require(_0xaf9b('0x8'));var fs=require('fs');var fs_extra=require(_0xaf9b('0x9'));var _=require(_0xaf9b('0xa'));var squel=require(_0xaf9b('0xb'));var crypto=require(_0xaf9b('0xc'));var jsforce=require(_0xaf9b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaf9b('0x7'));var querystring=require(_0xaf9b('0xe'));var Papa=require(_0xaf9b('0xf'));var Redis=require(_0xaf9b('0x10'));var authService=require(_0xaf9b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf9b('0x12'));var hardwareService=require(_0xaf9b('0x13'));var logger=require(_0xaf9b('0x14'))(_0xaf9b('0x15'));var utils=require('../../config/utils');var config=require(_0xaf9b('0x16'));var licenseUtil=require(_0xaf9b('0x17'));var db=require(_0xaf9b('0x18'))['db'];config[_0xaf9b('0x19')]=_[_0xaf9b('0x1a')](config[_0xaf9b('0x19')],{'host':_0xaf9b('0x1b'),'port':0x18eb});var socket=require(_0xaf9b('0x1c'))(new Redis(config[_0xaf9b('0x19')]));require(_0xaf9b('0x1d'))[_0xaf9b('0x1e')](socket);function respondWithStatusCode(_0x4e9fcb,_0x4a674c){_0x4a674c=_0x4a674c||0xcc;return function(_0x355de1){if(_0x355de1){return _0x4e9fcb[_0xaf9b('0x1f')](_0x4a674c);}return _0x4e9fcb['status'](_0x4a674c)[_0xaf9b('0x20')]();};}function respondWithResult(_0x8f1064,_0x2488eb){_0x2488eb=_0x2488eb||0xc8;return function(_0x4ba296){if(_0x4ba296){return _0x8f1064[_0xaf9b('0x21')](_0x2488eb)[_0xaf9b('0x22')](_0x4ba296);}};}function respondWithFilteredResult(_0x88790a,_0x303e2e){return function(_0x357844){if(_0x357844){var _0x2c20fd=typeof _0x303e2e[_0xaf9b('0x23')]===_0xaf9b('0x24')&&typeof _0x303e2e[_0xaf9b('0x25')]===_0xaf9b('0x24');var _0x1a7c66=_0x357844['count'];var _0x31c3c6=_0x2c20fd?0x0:_0x303e2e['offset'];var _0xcda8e0=_0x2c20fd?_0x357844['count']:_0x303e2e[_0xaf9b('0x23')]+_0x303e2e[_0xaf9b('0x25')];var _0x40e750;if(_0xcda8e0>=_0x1a7c66){_0xcda8e0=_0x1a7c66;_0x40e750=0xc8;}else{_0x40e750=0xce;}_0x88790a['status'](_0x40e750);return _0x88790a[_0xaf9b('0x26')](_0xaf9b('0x27'),_0x31c3c6+'-'+_0xcda8e0+'/'+_0x1a7c66)['json'](_0x357844);}return null;};}function patchUpdates(_0x2d71f7){return function(_0x36c6f1){try{jsonpatch['apply'](_0x36c6f1,_0x2d71f7,!![]);}catch(_0x2d6cdc){return BPromise[_0xaf9b('0x28')](_0x2d6cdc);}return _0x36c6f1['save']();};}function saveUpdates(_0x2b3a39,_0x2d6329){return function(_0x1376c9){if(_0x1376c9){return _0x1376c9['update'](_0x2b3a39)[_0xaf9b('0x29')](function(_0x2863ce){return _0x2863ce;});}return null;};}function removeEntity(_0x2b9c1e,_0x108acc){return function(_0x1dab19){if(_0x1dab19){return _0x1dab19[_0xaf9b('0x2a')]()[_0xaf9b('0x29')](function(){var _0x4a56f2=_0x1dab19[_0xaf9b('0x2b')]({'plain':!![]});var _0x44acc7=_0xaf9b('0x2c');return db['UserProfileResource'][_0xaf9b('0x2a')]({'where':{'type':_0x44acc7,'resourceId':_0x4a56f2['id']}})[_0xaf9b('0x29')](function(){return _0x1dab19;});})[_0xaf9b('0x29')](function(){_0x2b9c1e[_0xaf9b('0x21')](0xcc)[_0xaf9b('0x20')]();});}};}function handleEntityNotFound(_0x18f1e2,_0x136b05){return function(_0x56977c){if(!_0x56977c){_0x18f1e2[_0xaf9b('0x1f')](0x194);}return _0x56977c;};}function handleError(_0x136a94,_0x371cae){_0x371cae=_0x371cae||0x1f4;return function(_0x592dd6){logger[_0xaf9b('0x2d')](_0x592dd6[_0xaf9b('0x2e')]);if(_0x592dd6['name']){delete _0x592dd6[_0xaf9b('0x2f')];}_0x136a94[_0xaf9b('0x21')](_0x371cae)[_0xaf9b('0x30')](_0x592dd6);};}exports[_0xaf9b('0x31')]=function(_0x11d546,_0x419747){var _0x1afb79={},_0x59eb22={},_0x275631={'count':0x0,'rows':[]};var _0x39abf9=_['map'](db['FaxQueue'][_0xaf9b('0x32')],function(_0x4ab914){return{'name':_0x4ab914['fieldName'],'type':_0x4ab914[_0xaf9b('0x33')][_0xaf9b('0x34')]};});_0x59eb22[_0xaf9b('0x35')]=_[_0xaf9b('0x36')](_0x39abf9,_0xaf9b('0x2f'));_0x59eb22[_0xaf9b('0x37')]=_[_0xaf9b('0x38')](_0x11d546[_0xaf9b('0x37')]);_0x59eb22[_0xaf9b('0x39')]=_['intersection'](_0x59eb22['model'],_0x59eb22[_0xaf9b('0x37')]);_0x1afb79['attributes']=_[_0xaf9b('0x3a')](_0x59eb22['model'],qs[_0xaf9b('0x3b')](_0x11d546[_0xaf9b('0x37')][_0xaf9b('0x3b')]));_0x1afb79[_0xaf9b('0x3c')]=_0x1afb79[_0xaf9b('0x3c')][_0xaf9b('0x3d')]?_0x1afb79[_0xaf9b('0x3c')]:_0x59eb22[_0xaf9b('0x35')];if(!_0x11d546[_0xaf9b('0x37')][_0xaf9b('0x3e')]('nolimit')){_0x1afb79[_0xaf9b('0x25')]=qs['limit'](_0x11d546[_0xaf9b('0x37')]['limit']);_0x1afb79[_0xaf9b('0x23')]=qs[_0xaf9b('0x23')](_0x11d546[_0xaf9b('0x37')]['offset']);}_0x1afb79[_0xaf9b('0x3f')]=qs[_0xaf9b('0x40')](_0x11d546[_0xaf9b('0x37')]['sort']);_0x1afb79['where']=qs['filters'](_[_0xaf9b('0x41')](_0x11d546[_0xaf9b('0x37')],_0x59eb22[_0xaf9b('0x39')]),_0x39abf9);if(_0x11d546[_0xaf9b('0x37')]['filter']){_0x1afb79[_0xaf9b('0x42')]=_[_0xaf9b('0x43')](_0x1afb79['where'],{'$or':_['map'](_0x39abf9,function(_0x4ae2be){if(_0x4ae2be[_0xaf9b('0x33')]!=='VIRTUAL'){var _0x336373={};_0x336373[_0x4ae2be[_0xaf9b('0x2f')]]={'$like':'%'+_0x11d546['query'][_0xaf9b('0x44')]+'%'};return _0x336373;}})});}_0x1afb79=_[_0xaf9b('0x43')]({},_0x1afb79,_0x11d546[_0xaf9b('0x45')]);var _0x4c386e={'where':_0x1afb79['where']};return db[_0xaf9b('0x46')][_0xaf9b('0x47')](_0x4c386e)[_0xaf9b('0x29')](function(_0x2a2daf){_0x275631[_0xaf9b('0x47')]=_0x2a2daf;if(_0x11d546[_0xaf9b('0x37')][_0xaf9b('0x48')]){_0x1afb79[_0xaf9b('0x49')]=[{'all':!![]}];}return db['FaxQueue'][_0xaf9b('0x4a')](_0x1afb79);})[_0xaf9b('0x29')](function(_0x5620f3){_0x275631[_0xaf9b('0x4b')]=_0x5620f3;return _0x275631;})['then'](respondWithFilteredResult(_0x419747,_0x1afb79))[_0xaf9b('0x4c')](handleError(_0x419747,null));};exports['show']=function(_0xa94028,_0x5de1bd){var _0x11cf50={'raw':!![],'where':{'id':_0xa94028[_0xaf9b('0x4d')]['id']}},_0x2699ca={};_0x2699ca[_0xaf9b('0x35')]=_[_0xaf9b('0x38')](db[_0xaf9b('0x46')][_0xaf9b('0x32')]);_0x2699ca[_0xaf9b('0x37')]=_[_0xaf9b('0x38')](_0xa94028[_0xaf9b('0x37')]);_0x2699ca[_0xaf9b('0x39')]=_[_0xaf9b('0x3a')](_0x2699ca[_0xaf9b('0x35')],_0x2699ca[_0xaf9b('0x37')]);_0x11cf50['attributes']=_[_0xaf9b('0x3a')](_0x2699ca['model'],qs[_0xaf9b('0x3b')](_0xa94028[_0xaf9b('0x37')]['fields']));_0x11cf50[_0xaf9b('0x3c')]=_0x11cf50[_0xaf9b('0x3c')][_0xaf9b('0x3d')]?_0x11cf50[_0xaf9b('0x3c')]:_0x2699ca['model'];if(_0xa94028[_0xaf9b('0x37')][_0xaf9b('0x48')]){_0x11cf50[_0xaf9b('0x49')]=[{'all':!![]}];}_0x11cf50=_[_0xaf9b('0x43')]({},_0x11cf50,_0xa94028[_0xaf9b('0x45')]);return db[_0xaf9b('0x46')][_0xaf9b('0x4e')](_0x11cf50)[_0xaf9b('0x29')](handleEntityNotFound(_0x5de1bd,null))[_0xaf9b('0x29')](respondWithResult(_0x5de1bd,null))[_0xaf9b('0x4c')](handleError(_0x5de1bd,null));};exports[_0xaf9b('0x4f')]=function(_0x1163c2,_0x3c557c){return db['FaxQueue'][_0xaf9b('0x4f')](_0x1163c2[_0xaf9b('0x50')],{})[_0xaf9b('0x29')](function(_0x1e4350){var _0x2205aa=_0x1163c2[_0xaf9b('0x51')]['get']({'plain':!![]});if(!_0x2205aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2205aa[_0xaf9b('0x52')]===_0xaf9b('0x51')){var _0x5b4907=_0x1e4350[_0xaf9b('0x2b')]({'plain':!![]});var _0x3a45c4=_0xaf9b('0x2c');return db[_0xaf9b('0x53')]['find']({'where':{'name':_0x3a45c4,'userProfileId':_0x2205aa[_0xaf9b('0x54')]},'raw':!![]})[_0xaf9b('0x29')](function(_0x1310fb){if(_0x1310fb&&_0x1310fb[_0xaf9b('0x55')]===0x0){return db[_0xaf9b('0x56')][_0xaf9b('0x4f')]({'name':_0x5b4907[_0xaf9b('0x2f')],'resourceId':_0x5b4907['id'],'type':_0x1310fb[_0xaf9b('0x2f')],'sectionId':_0x1310fb['id']},{})[_0xaf9b('0x29')](function(){return _0x1e4350;});}else{return _0x1e4350;}})['catch'](function(_0x43ccc6){logger[_0xaf9b('0x2d')](_0xaf9b('0x57'),_0x43ccc6);throw _0x43ccc6;});}return _0x1e4350;})[_0xaf9b('0x29')](respondWithResult(_0x3c557c,0xc9))[_0xaf9b('0x4c')](handleError(_0x3c557c,null));};exports['update']=function(_0x20a849,_0x5e7002){if(_0x20a849[_0xaf9b('0x50')]['id']){delete _0x20a849[_0xaf9b('0x50')]['id'];}return db['FaxQueue'][_0xaf9b('0x4e')]({'where':{'id':_0x20a849['params']['id']}})[_0xaf9b('0x29')](handleEntityNotFound(_0x5e7002,null))[_0xaf9b('0x29')](saveUpdates(_0x20a849[_0xaf9b('0x50')],null))[_0xaf9b('0x29')](respondWithResult(_0x5e7002,null))[_0xaf9b('0x4c')](handleError(_0x5e7002,null));};exports[_0xaf9b('0x2a')]=function(_0x25e3b8,_0x5088b4){return db['FaxQueue'][_0xaf9b('0x4e')]({'where':{'id':_0x25e3b8[_0xaf9b('0x4d')]['id']}})[_0xaf9b('0x29')](handleEntityNotFound(_0x5088b4,null))[_0xaf9b('0x29')](removeEntity(_0x5088b4,null))['catch'](handleError(_0x5088b4,null));};exports[_0xaf9b('0x58')]=function(_0x1b04cc,_0x5c6a5a){return db[_0xaf9b('0x46')][_0xaf9b('0x58')]()[_0xaf9b('0x29')](respondWithResult(_0x5c6a5a,null))['catch'](handleError(_0x5c6a5a,null));};exports['getMembers']=function(_0x356cda,_0x3f7654,_0x4166ad){var _0x575e7f={'raw':!![],'where':{}},_0x3174b8={},_0x4c278a;return db[_0xaf9b('0x46')][_0xaf9b('0x59')]({'where':{'id':_0x356cda[_0xaf9b('0x4d')]['id']}})[_0xaf9b('0x29')](handleEntityNotFound(_0x3f7654,null))[_0xaf9b('0x29')](function(_0x360e2a){if(_0x360e2a){_0x4c278a=_0x360e2a[_0xaf9b('0x2b')]({'plain':!![]});_0x3174b8['model']=_[_0xaf9b('0x38')](db['UserFaxQueue'][_0xaf9b('0x32')]);_0x3174b8[_0xaf9b('0x37')]=_['keys'](_0x356cda[_0xaf9b('0x37')]);_0x3174b8[_0xaf9b('0x39')]=_[_0xaf9b('0x3a')](_0x3174b8[_0xaf9b('0x35')],_0x3174b8['query']);_0x575e7f[_0xaf9b('0x3c')]=_['intersection'](_0x3174b8[_0xaf9b('0x35')],qs[_0xaf9b('0x3b')](_0x356cda[_0xaf9b('0x37')][_0xaf9b('0x3b')]));_0x575e7f[_0xaf9b('0x3c')]=_0x575e7f[_0xaf9b('0x3c')][_0xaf9b('0x3d')]?_0x575e7f[_0xaf9b('0x3c')]:_0x3174b8[_0xaf9b('0x35')];if(!_0x356cda[_0xaf9b('0x37')][_0xaf9b('0x3e')](_0xaf9b('0x5a'))){_0x575e7f['limit']=qs[_0xaf9b('0x25')](_0x356cda[_0xaf9b('0x37')][_0xaf9b('0x25')]);_0x575e7f[_0xaf9b('0x23')]=qs[_0xaf9b('0x23')](_0x356cda[_0xaf9b('0x37')]['offset']);}_0x575e7f[_0xaf9b('0x3f')]=qs[_0xaf9b('0x40')](_0x356cda[_0xaf9b('0x37')][_0xaf9b('0x40')]);_0x575e7f[_0xaf9b('0x42')]=qs[_0xaf9b('0x39')](_[_0xaf9b('0x41')](_0x356cda[_0xaf9b('0x37')],_0x3174b8[_0xaf9b('0x39')]));_0x575e7f['where'][_0xaf9b('0x5b')]=_0x360e2a['id'];if(_0x356cda[_0xaf9b('0x37')][_0xaf9b('0x44')]){_0x575e7f[_0xaf9b('0x42')]=_[_0xaf9b('0x43')](_0x575e7f['where'],{'$or':_[_0xaf9b('0x36')](_0x575e7f[_0xaf9b('0x3c')],function(_0x2994c7){var _0x1b86fd={};_0x1b86fd[_0x2994c7]={'$like':'%'+_0x356cda[_0xaf9b('0x37')][_0xaf9b('0x44')]+'%'};return _0x1b86fd;})});}_0x575e7f=_[_0xaf9b('0x43')]({},_0x575e7f,_0x356cda[_0xaf9b('0x45')]);return db[_0xaf9b('0x5c')][_0xaf9b('0x4a')](_0x575e7f);}})['then'](function(_0x48cbdc){if(_0x48cbdc){return db[_0xaf9b('0x5d')][_0xaf9b('0x5e')]({'where':{'id':_[_0xaf9b('0x36')](_0x48cbdc,_0xaf9b('0x5f')),'role':_0xaf9b('0x60')},'attributes':['id','name',_0xaf9b('0x61'),_0xaf9b('0x62'),_0xaf9b('0x63')]});}})[_0xaf9b('0x29')](function(_0x1c2673){if(_0x1c2673){return{'count':_0x1c2673[_0xaf9b('0x47')],'rows':_[_0xaf9b('0x36')](_0x1c2673[_0xaf9b('0x4b')],function(_0x2d43b1){return{'membername':_0x2d43b1['name'],'UserId':_0x2d43b1['id'],'queue_name':_0x4c278a[_0xaf9b('0x2f')],'FaxQueueId':_0x4c278a['id'],'interface':util['format'](_0xaf9b('0x64'),_0xaf9b('0x65'),_0x2d43b1['name']),'penalty':0x0,'paused':_0x2d43b1['faxPause'],'createdAt':_0x2d43b1['createdAt'],'updatedAt':_0x2d43b1[_0xaf9b('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaf9b('0x29')](respondWithFilteredResult(_0x3f7654,_0x575e7f))[_0xaf9b('0x4c')](handleError(_0x3f7654,null));};exports[_0xaf9b('0x66')]=function(_0x272ace,_0x1fc3b4,_0x36b23b){var _0x25e560={};var _0x32f1d1={};var _0x1c8253;var _0x3fac78;return db[_0xaf9b('0x46')][_0xaf9b('0x59')]({'where':{'id':_0x272ace['params']['id']}})['then'](handleEntityNotFound(_0x1fc3b4,null))[_0xaf9b('0x29')](function(_0x2165be){if(_0x2165be){_0x1c8253=_0x2165be;_0x32f1d1['model']=_['keys'](db['Team']['rawAttributes']);_0x32f1d1[_0xaf9b('0x37')]=_[_0xaf9b('0x38')](_0x272ace[_0xaf9b('0x37')]);_0x32f1d1['filters']=_[_0xaf9b('0x3a')](_0x32f1d1[_0xaf9b('0x35')],_0x32f1d1[_0xaf9b('0x37')]);_0x25e560[_0xaf9b('0x3c')]=_[_0xaf9b('0x3a')](_0x32f1d1[_0xaf9b('0x35')],qs[_0xaf9b('0x3b')](_0x272ace['query'][_0xaf9b('0x3b')]));_0x25e560[_0xaf9b('0x3c')]=_0x25e560['attributes'][_0xaf9b('0x3d')]?_0x25e560['attributes']:_0x32f1d1[_0xaf9b('0x35')];_0x25e560[_0xaf9b('0x3f')]=qs[_0xaf9b('0x40')](_0x272ace[_0xaf9b('0x37')][_0xaf9b('0x40')]);_0x25e560[_0xaf9b('0x42')]=qs[_0xaf9b('0x39')](_['pick'](_0x272ace['query'],_0x32f1d1[_0xaf9b('0x39')]));if(_0x272ace['query'][_0xaf9b('0x44')]){_0x25e560[_0xaf9b('0x42')]=_[_0xaf9b('0x43')](_0x25e560['where'],{'$or':_['map'](_0x25e560[_0xaf9b('0x3c')],function(_0x21b9cd){var _0x1785ec={};_0x1785ec[_0x21b9cd]={'$like':'%'+_0x272ace[_0xaf9b('0x37')][_0xaf9b('0x44')]+'%'};return _0x1785ec;})});}_0x25e560=_[_0xaf9b('0x43')]({},_0x25e560,_0x272ace['options']);return _0x1c8253['getTeams'](_0x25e560);}})[_0xaf9b('0x29')](function(_0x90ebc3){if(_0x90ebc3){_0x3fac78=_0x90ebc3[_0xaf9b('0x3d')];if(!_0x272ace[_0xaf9b('0x37')][_0xaf9b('0x3e')](_0xaf9b('0x5a'))){_0x25e560[_0xaf9b('0x25')]=qs[_0xaf9b('0x25')](_0x272ace[_0xaf9b('0x37')][_0xaf9b('0x25')]);_0x25e560[_0xaf9b('0x23')]=qs[_0xaf9b('0x23')](_0x272ace['query'][_0xaf9b('0x23')]);}return _0x1c8253[_0xaf9b('0x66')](_0x25e560);}})[_0xaf9b('0x29')](function(_0x143563){if(_0x143563){return _0x143563?{'count':_0x3fac78,'rows':_0x143563}:null;}})[_0xaf9b('0x29')](respondWithResult(_0x1fc3b4,null))[_0xaf9b('0x4c')](handleError(_0x1fc3b4,null));};exports[_0xaf9b('0x67')]=function(_0x535310,_0x2760b7,_0x49f1b2){var _0x309108=_0x535310[_0xaf9b('0x50')]['ids'];return db[_0xaf9b('0x68')][_0xaf9b('0x4a')]({'where':{'id':_0x309108},'attributes':['id'],'include':[{'model':db[_0xaf9b('0x5d')],'as':_0xaf9b('0x69'),'attributes':['id',_0xaf9b('0x2f'),_0xaf9b('0x6a'),'voicePause',_0xaf9b('0x6b')],'raw':!![]}]})[_0xaf9b('0x29')](function(_0x5af414){if(_0x5af414){var _0x31dd6f=_['flatMap'](_0x5af414,function(_0x1f839f){var _0x415eed=_0x1f839f['get']({'plain':!![]});return _0x415eed[_0xaf9b('0x69')];});return db[_0xaf9b('0x46')][_0xaf9b('0x4e')]({'where':{'id':_0x535310['params']['id']}})[_0xaf9b('0x29')](function(_0x3f1980){return db['sequelize'][_0xaf9b('0x6c')](function(_0x45a308){return _0x3f1980[_0xaf9b('0x67')](_0x309108,{'transaction':_0x45a308})[_0xaf9b('0x29')](function(){return BPromise[_0xaf9b('0x6d')](_0x31dd6f,function(_0x57c875){return db[_0xaf9b('0x5c')]['findOrCreate']({'where':{'UserId':_0x57c875['id'],'FaxQueueId':_0x535310[_0xaf9b('0x4d')]['id']},'transaction':_0x45a308});});})['then'](function(){_0x31dd6f['forEach'](function(_0x14328f){socket[_0xaf9b('0x6e')](_0xaf9b('0x6f'),{'UserId':_0x14328f['id'],'FaxQueueId':_0x3f1980['id']});});});});});}})[_0xaf9b('0x29')](respondWithStatusCode(_0x2760b7,null))[_0xaf9b('0x4c')](handleError(_0x2760b7,null));};exports['removeTeams']=function(_0x26106a,_0x4c8414,_0x568a6a){return db[_0xaf9b('0x68')][_0xaf9b('0x4a')]({'where':{'id':_0x26106a[_0xaf9b('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xaf9b('0x5d')],'as':_0xaf9b('0x69'),'attributes':['id'],'raw':!![]}]})[_0xaf9b('0x29')](handleEntityNotFound(_0x4c8414,null))[_0xaf9b('0x29')](function(_0x61907){var _0x18aa55=_[_0xaf9b('0x36')](_0x61907,'id');var _0x3d5456=[];var _0x53af20=[];var _0x51f530=squel[_0xaf9b('0x70')]();_0x51f530[_0xaf9b('0x71')](_0xaf9b('0x72'))[_0xaf9b('0x73')](_0xaf9b('0x74'),'tq')[_0xaf9b('0x75')](_0xaf9b('0x76'),'ut',_0xaf9b('0x77'))[_0xaf9b('0x42')](_0xaf9b('0x78'),_0x26106a[_0xaf9b('0x4d')]['id']);for(var _0x471010=0x0;_0x471010<_0x61907[_0xaf9b('0x3d')];_0x471010+=0x1){let _0x111694=_0x61907[_0x471010];for(var _0x18ada3=0x0;_0x18ada3<_0x111694['Agents'][_0xaf9b('0x3d')];_0x18ada3+=0x1){let _0x36bc78=_0x111694[_0xaf9b('0x69')][_0x18ada3];var _0x189a09=_0x51f530[_0xaf9b('0x79')]();_0x189a09[_0xaf9b('0x42')](_0xaf9b('0x7a'),_0x36bc78['id']);_0x53af20[_0xaf9b('0x7b')](db[_0xaf9b('0x7c')][_0xaf9b('0x37')](_0x189a09[_0xaf9b('0x7d')](),{'type':db[_0xaf9b('0x7c')][_0xaf9b('0x7e')]['SELECT']})[_0xaf9b('0x29')](function(_0x47a336){if(_0x47a336[_0xaf9b('0x3d')]===0x1){return _0x36bc78['id'];}else{var _0x1861b9=_['every'](_['map'](_0x47a336,_0xaf9b('0x7f')),function(_0x335101){return _[_0xaf9b('0x80')](_0x18aa55,_0x335101);});if(_0x1861b9){return _0x36bc78['id'];}}}));}}return BPromise['all'](_0x53af20)[_0xaf9b('0x29')](function(_0x502918){_0x3d5456=_(_0x3d5456)[_0xaf9b('0x81')](_0x502918)[_0xaf9b('0x82')]()[_0xaf9b('0x83')]();return db[_0xaf9b('0x46')][_0xaf9b('0x4e')]({'where':{'id':_0x26106a[_0xaf9b('0x4d')]['id']}})[_0xaf9b('0x29')](function(_0x226dc9){return db[_0xaf9b('0x7c')][_0xaf9b('0x6c')](function(_0x319d0a){return _0x226dc9['removeTeams'](_0x26106a['query']['ids'],{'transaction':_0x319d0a})[_0xaf9b('0x29')](function(){if(!_[_0xaf9b('0x84')](_0x3d5456)){return _0x226dc9[_0xaf9b('0x85')](_0x3d5456,{'transaction':_0x319d0a});}})[_0xaf9b('0x29')](function(){_0x3d5456['forEach'](function(_0x11f442){socket[_0xaf9b('0x6e')]('userFaxQueue:remove',{'UserId':_0x11f442,'FaxQueueId':_0x226dc9['id']});});});});});});})['then'](respondWithStatusCode(_0x4c8414,null))[_0xaf9b('0x4c')](handleError(_0x4c8414,null));};exports[_0xaf9b('0x86')]=function(_0x3c1567,_0x399abf,_0x4964f8){return db[_0xaf9b('0x46')][_0xaf9b('0x4e')]({'where':{'id':_0x3c1567['params']['id']}})[_0xaf9b('0x29')](handleEntityNotFound(_0x399abf,null))[_0xaf9b('0x29')](function(_0x4f2fab){if(_0x4f2fab){return _0x4f2fab[_0xaf9b('0x86')](_0x3c1567[_0xaf9b('0x50')][_0xaf9b('0x87')],_[_0xaf9b('0x88')](_0x3c1567[_0xaf9b('0x50')],[_0xaf9b('0x87'),'id'])||{})[_0xaf9b('0x89')](function(_0x1553ea){for(var _0x467890=0x0;_0x467890<_0x3c1567[_0xaf9b('0x50')][_0xaf9b('0x87')][_0xaf9b('0x3d')];_0x467890+=0x1){socket[_0xaf9b('0x6e')](_0xaf9b('0x6f'),{'UserId':Number(_0x3c1567['body'][_0xaf9b('0x87')][_0x467890]),'FaxQueueId':Number(_0x3c1567[_0xaf9b('0x4d')]['id'])});}return _0x1553ea;});}})['then'](respondWithResult(_0x399abf,null))[_0xaf9b('0x4c')](handleError(_0x399abf,null));};exports[_0xaf9b('0x85')]=function(_0x30b89d,_0x2fd3b8,_0x86f7e0){return db['FaxQueue'][_0xaf9b('0x4e')]({'where':{'id':_0x30b89d[_0xaf9b('0x4d')]['id']}})[_0xaf9b('0x29')](handleEntityNotFound(_0x2fd3b8,null))[_0xaf9b('0x29')](function(_0x2f56ea){if(_0x2f56ea){return _0x2f56ea[_0xaf9b('0x85')](_0x30b89d['query']['ids'])[_0xaf9b('0x29')](function(){if(_[_0xaf9b('0x8a')](_0x30b89d['query'][_0xaf9b('0x87')])){for(var _0x2cddaa=0x0;_0x2cddaa<_0x30b89d[_0xaf9b('0x37')][_0xaf9b('0x87')][_0xaf9b('0x3d')];_0x2cddaa+=0x1){socket[_0xaf9b('0x6e')](_0xaf9b('0x8b'),{'UserId':Number(_0x30b89d['query']['ids'][_0x2cddaa]),'FaxQueueId':Number(_0x30b89d[_0xaf9b('0x4d')]['id'])});}}else{socket[_0xaf9b('0x6e')](_0xaf9b('0x8b'),{'UserId':Number(_0x30b89d['query'][_0xaf9b('0x87')]),'FaxQueueId':Number(_0x30b89d[_0xaf9b('0x4d')]['id'])});}});}})[_0xaf9b('0x29')](respondWithStatusCode(_0x2fd3b8,null))[_0xaf9b('0x4c')](handleError(_0x2fd3b8,null));};exports[_0xaf9b('0x8c')]=function(_0x550454,_0x5a84bb,_0x210aea){var _0x5b05a6={};var _0x7dcfb8={};var _0x4531b3;var _0x4bb350;return db[_0xaf9b('0x46')][_0xaf9b('0x59')]({'where':{'id':_0x550454[_0xaf9b('0x4d')]['id']}})[_0xaf9b('0x29')](handleEntityNotFound(_0x5a84bb,null))[_0xaf9b('0x29')](function(_0x552d05){if(_0x552d05){_0x4531b3=_0x552d05;_0x7dcfb8['model']=_['keys'](db[_0xaf9b('0x5d')][_0xaf9b('0x32')]);_0x7dcfb8[_0xaf9b('0x37')]=_['keys'](_0x550454['query']);_0x7dcfb8['filters']=_['intersection'](_0x7dcfb8[_0xaf9b('0x35')],_0x7dcfb8['query']);_0x5b05a6[_0xaf9b('0x3c')]=_[_0xaf9b('0x3a')](_0x7dcfb8[_0xaf9b('0x35')],qs[_0xaf9b('0x3b')](_0x550454[_0xaf9b('0x37')][_0xaf9b('0x3b')]));_0x5b05a6[_0xaf9b('0x3c')]=_0x5b05a6[_0xaf9b('0x3c')][_0xaf9b('0x3d')]?_0x5b05a6[_0xaf9b('0x3c')]:_0x7dcfb8[_0xaf9b('0x35')];_0x5b05a6[_0xaf9b('0x3f')]=qs[_0xaf9b('0x40')](_0x550454['query'][_0xaf9b('0x40')]);_0x5b05a6[_0xaf9b('0x42')]=qs[_0xaf9b('0x39')](_[_0xaf9b('0x41')](_0x550454['query'],_0x7dcfb8[_0xaf9b('0x39')]));if(_0x550454['query'][_0xaf9b('0x44')]){_0x5b05a6[_0xaf9b('0x42')]=_[_0xaf9b('0x43')](_0x5b05a6[_0xaf9b('0x42')],{'$or':_[_0xaf9b('0x36')](_0x5b05a6[_0xaf9b('0x3c')],function(_0xb63d17){var _0x781a7a={};_0x781a7a[_0xb63d17]={'$like':'%'+_0x550454[_0xaf9b('0x37')][_0xaf9b('0x44')]+'%'};return _0x781a7a;})});}_0x5b05a6=_[_0xaf9b('0x43')]({},_0x5b05a6,_0x550454[_0xaf9b('0x45')]);return _0x4531b3[_0xaf9b('0x8c')](_0x5b05a6);}})[_0xaf9b('0x29')](function(_0x3b39c2){if(_0x3b39c2){_0x4bb350=_0x3b39c2[_0xaf9b('0x3d')];if(!_0x550454[_0xaf9b('0x37')]['hasOwnProperty'](_0xaf9b('0x5a'))){_0x5b05a6[_0xaf9b('0x25')]=qs[_0xaf9b('0x25')](_0x550454['query'][_0xaf9b('0x25')]);_0x5b05a6[_0xaf9b('0x23')]=qs[_0xaf9b('0x23')](_0x550454[_0xaf9b('0x37')]['offset']);}return _0x4531b3[_0xaf9b('0x8c')](_0x5b05a6);}})[_0xaf9b('0x29')](function(_0x52fb34){if(_0x52fb34){return _0x52fb34?{'count':_0x4bb350,'rows':_0x52fb34}:null;}})[_0xaf9b('0x29')](respondWithResult(_0x5a84bb,null))['catch'](handleError(_0x5a84bb,null));};
\ No newline at end of file
+var _0x48b2=['fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update','then','destroy','get','FaxQueues','UserProfileResource','end','stack','name','send','index','FaxQueue','rawAttributes','type','model','map','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','includeAll','findAll','rows','show','params','keys','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','nolimit','FaxQueueId','options','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','getAgents','findOne','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','ejs'];(function(_0x1f3319,_0x4278bc){var _0x17167c=function(_0x221d7b){while(--_0x221d7b){_0x1f3319['push'](_0x1f3319['shift']());}};_0x17167c(++_0x4278bc);}(_0x48b2,0x10e));var _0x248b=function(_0x22a9e3,_0x283809){_0x22a9e3=_0x22a9e3-0x0;var _0x405cf9=_0x48b2[_0x22a9e3];return _0x405cf9;};'use strict';var emlformat=require(_0x248b('0x0'));var rimraf=require(_0x248b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x248b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x248b('0x3'));var Mustache=require(_0x248b('0x4'));var util=require('util');var path=require(_0x248b('0x5'));var sox=require('sox');var csv=require(_0x248b('0x6'));var ejs=require(_0x248b('0x7'));var fs=require('fs');var fs_extra=require(_0x248b('0x8'));var _=require('lodash');var squel=require(_0x248b('0x9'));var crypto=require(_0x248b('0xa'));var jsforce=require(_0x248b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x248b('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x248b('0xc'));var authService=require(_0x248b('0xd'));var qs=require(_0x248b('0xe'));var as=require(_0x248b('0xf'));var hardwareService=require(_0x248b('0x10'));var logger=require(_0x248b('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x248b('0x12'));var licenseUtil=require(_0x248b('0x13'));var db=require(_0x248b('0x14'))['db'];config[_0x248b('0x15')]=_[_0x248b('0x16')](config[_0x248b('0x15')],{'host':_0x248b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x248b('0x15')]));require('./faxQueue.socket')[_0x248b('0x18')](socket);function respondWithStatusCode(_0x3b7b09,_0x408b59){_0x408b59=_0x408b59||0xcc;return function(_0x4760dd){if(_0x4760dd){return _0x3b7b09[_0x248b('0x19')](_0x408b59);}return _0x3b7b09['status'](_0x408b59)['end']();};}function respondWithResult(_0x12a9fa,_0x3f6f4a){_0x3f6f4a=_0x3f6f4a||0xc8;return function(_0x466df5){if(_0x466df5){return _0x12a9fa['status'](_0x3f6f4a)[_0x248b('0x1a')](_0x466df5);}};}function respondWithFilteredResult(_0x3e3e66,_0x371d17){return function(_0x38257c){if(_0x38257c){var _0x4b9a76=typeof _0x371d17[_0x248b('0x1b')]==='undefined'&&typeof _0x371d17[_0x248b('0x1c')]===_0x248b('0x1d');var _0x508f98=_0x38257c[_0x248b('0x1e')];var _0x1417c5=_0x4b9a76?0x0:_0x371d17[_0x248b('0x1b')];var _0x322166=_0x4b9a76?_0x38257c[_0x248b('0x1e')]:_0x371d17['offset']+_0x371d17[_0x248b('0x1c')];var _0x3f3dec;if(_0x322166>=_0x508f98){_0x322166=_0x508f98;_0x3f3dec=0xc8;}else{_0x3f3dec=0xce;}_0x3e3e66[_0x248b('0x1f')](_0x3f3dec);return _0x3e3e66[_0x248b('0x20')](_0x248b('0x21'),_0x1417c5+'-'+_0x322166+'/'+_0x508f98)[_0x248b('0x1a')](_0x38257c);}return null;};}function patchUpdates(_0x3015b1){return function(_0x1862e5){try{jsonpatch[_0x248b('0x22')](_0x1862e5,_0x3015b1,!![]);}catch(_0x5b6f75){return BPromise[_0x248b('0x23')](_0x5b6f75);}return _0x1862e5['save']();};}function saveUpdates(_0x5a6677,_0x469ad8){return function(_0x3b36ec){if(_0x3b36ec){return _0x3b36ec[_0x248b('0x24')](_0x5a6677)[_0x248b('0x25')](function(_0x3f156d){return _0x3f156d;});}return null;};}function removeEntity(_0x2179a5,_0x717463){return function(_0x2c7c94){if(_0x2c7c94){return _0x2c7c94[_0x248b('0x26')]()['then'](function(){var _0x551966=_0x2c7c94[_0x248b('0x27')]({'plain':!![]});var _0x3868c3=_0x248b('0x28');return db[_0x248b('0x29')][_0x248b('0x26')]({'where':{'type':_0x3868c3,'resourceId':_0x551966['id']}})[_0x248b('0x25')](function(){return _0x2c7c94;});})[_0x248b('0x25')](function(){_0x2179a5[_0x248b('0x1f')](0xcc)[_0x248b('0x2a')]();});}};}function handleEntityNotFound(_0x454751,_0x4c2ca2){return function(_0x3200cf){if(!_0x3200cf){_0x454751[_0x248b('0x19')](0x194);}return _0x3200cf;};}function handleError(_0x2821ec,_0x17eabc){_0x17eabc=_0x17eabc||0x1f4;return function(_0x29d95a){logger['error'](_0x29d95a[_0x248b('0x2b')]);if(_0x29d95a[_0x248b('0x2c')]){delete _0x29d95a[_0x248b('0x2c')];}_0x2821ec[_0x248b('0x1f')](_0x17eabc)[_0x248b('0x2d')](_0x29d95a);};}exports[_0x248b('0x2e')]=function(_0x3dfc83,_0x1e530f){var _0x23ce1a={},_0x6606ac={},_0x2dc0f4={'count':0x0,'rows':[]};var _0x3c965a=_['map'](db[_0x248b('0x2f')][_0x248b('0x30')],function(_0x118f65){return{'name':_0x118f65['fieldName'],'type':_0x118f65[_0x248b('0x31')]['key']};});_0x6606ac[_0x248b('0x32')]=_[_0x248b('0x33')](_0x3c965a,_0x248b('0x2c'));_0x6606ac[_0x248b('0x34')]=_['keys'](_0x3dfc83[_0x248b('0x34')]);_0x6606ac['filters']=_['intersection'](_0x6606ac['model'],_0x6606ac[_0x248b('0x34')]);_0x23ce1a[_0x248b('0x35')]=_['intersection'](_0x6606ac[_0x248b('0x32')],qs[_0x248b('0x36')](_0x3dfc83[_0x248b('0x34')]['fields']));_0x23ce1a['attributes']=_0x23ce1a[_0x248b('0x35')][_0x248b('0x37')]?_0x23ce1a[_0x248b('0x35')]:_0x6606ac['model'];if(!_0x3dfc83['query'][_0x248b('0x38')]('nolimit')){_0x23ce1a[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x3dfc83[_0x248b('0x34')]['limit']);_0x23ce1a[_0x248b('0x1b')]=qs[_0x248b('0x1b')](_0x3dfc83['query'][_0x248b('0x1b')]);}_0x23ce1a[_0x248b('0x39')]=qs['sort'](_0x3dfc83[_0x248b('0x34')][_0x248b('0x3a')]);_0x23ce1a[_0x248b('0x3b')]=qs[_0x248b('0x3c')](_[_0x248b('0x3d')](_0x3dfc83[_0x248b('0x34')],_0x6606ac[_0x248b('0x3c')]),_0x3c965a);if(_0x3dfc83['query']['filter']){_0x23ce1a[_0x248b('0x3b')]=_[_0x248b('0x3e')](_0x23ce1a[_0x248b('0x3b')],{'$or':_[_0x248b('0x33')](_0x3c965a,function(_0x8c4d80){if(_0x8c4d80[_0x248b('0x31')]!=='VIRTUAL'){var _0x5d14b2={};_0x5d14b2[_0x8c4d80[_0x248b('0x2c')]]={'$like':'%'+_0x3dfc83['query'][_0x248b('0x3f')]+'%'};return _0x5d14b2;}})});}_0x23ce1a=_[_0x248b('0x3e')]({},_0x23ce1a,_0x3dfc83['options']);var _0x2ed6d3={'where':_0x23ce1a[_0x248b('0x3b')]};return db[_0x248b('0x2f')]['count'](_0x2ed6d3)[_0x248b('0x25')](function(_0x391a2b){_0x2dc0f4[_0x248b('0x1e')]=_0x391a2b;if(_0x3dfc83[_0x248b('0x34')][_0x248b('0x40')]){_0x23ce1a['include']=[{'all':!![]}];}return db['FaxQueue'][_0x248b('0x41')](_0x23ce1a);})[_0x248b('0x25')](function(_0x19d4bf){_0x2dc0f4[_0x248b('0x42')]=_0x19d4bf;return _0x2dc0f4;})['then'](respondWithFilteredResult(_0x1e530f,_0x23ce1a))['catch'](handleError(_0x1e530f,null));};exports[_0x248b('0x43')]=function(_0x4ffb77,_0x3df981){var _0x2bc41f={'raw':!![],'where':{'id':_0x4ffb77[_0x248b('0x44')]['id']}},_0x8e25a3={};_0x8e25a3['model']=_[_0x248b('0x45')](db[_0x248b('0x2f')]['rawAttributes']);_0x8e25a3['query']=_[_0x248b('0x45')](_0x4ffb77[_0x248b('0x34')]);_0x8e25a3['filters']=_['intersection'](_0x8e25a3['model'],_0x8e25a3[_0x248b('0x34')]);_0x2bc41f[_0x248b('0x35')]=_[_0x248b('0x46')](_0x8e25a3[_0x248b('0x32')],qs[_0x248b('0x36')](_0x4ffb77[_0x248b('0x34')][_0x248b('0x36')]));_0x2bc41f[_0x248b('0x35')]=_0x2bc41f[_0x248b('0x35')]['length']?_0x2bc41f[_0x248b('0x35')]:_0x8e25a3['model'];if(_0x4ffb77[_0x248b('0x34')]['includeAll']){_0x2bc41f['include']=[{'all':!![]}];}_0x2bc41f=_[_0x248b('0x3e')]({},_0x2bc41f,_0x4ffb77['options']);return db[_0x248b('0x2f')][_0x248b('0x47')](_0x2bc41f)[_0x248b('0x25')](handleEntityNotFound(_0x3df981,null))[_0x248b('0x25')](respondWithResult(_0x3df981,null))[_0x248b('0x48')](handleError(_0x3df981,null));};exports['create']=function(_0x6f692,_0x2636c8){return db[_0x248b('0x2f')][_0x248b('0x49')](_0x6f692[_0x248b('0x4a')],{})[_0x248b('0x25')](function(_0x17697d){var _0x4909d7=_0x6f692[_0x248b('0x4b')][_0x248b('0x27')]({'plain':!![]});if(!_0x4909d7)throw new Error(_0x248b('0x4c'));if(_0x4909d7['role']===_0x248b('0x4b')){var _0x273313=_0x17697d[_0x248b('0x27')]({'plain':!![]});var _0x2e72e1=_0x248b('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x2e72e1,'userProfileId':_0x4909d7['userProfileId']},'raw':!![]})[_0x248b('0x25')](function(_0x1f9aff){if(_0x1f9aff&&_0x1f9aff[_0x248b('0x4d')]===0x0){return db[_0x248b('0x29')]['create']({'name':_0x273313[_0x248b('0x2c')],'resourceId':_0x273313['id'],'type':_0x1f9aff['name'],'sectionId':_0x1f9aff['id']},{})['then'](function(){return _0x17697d;});}else{return _0x17697d;}})['catch'](function(_0x313100){logger[_0x248b('0x4e')](_0x248b('0x4f'),_0x313100);throw _0x313100;});}return _0x17697d;})['then'](respondWithResult(_0x2636c8,0xc9))['catch'](handleError(_0x2636c8,null));};exports[_0x248b('0x24')]=function(_0x4e2913,_0x31aad9){if(_0x4e2913[_0x248b('0x4a')]['id']){delete _0x4e2913[_0x248b('0x4a')]['id'];}return db[_0x248b('0x2f')][_0x248b('0x47')]({'where':{'id':_0x4e2913[_0x248b('0x44')]['id']}})[_0x248b('0x25')](handleEntityNotFound(_0x31aad9,null))[_0x248b('0x25')](saveUpdates(_0x4e2913[_0x248b('0x4a')],null))[_0x248b('0x25')](respondWithResult(_0x31aad9,null))[_0x248b('0x48')](handleError(_0x31aad9,null));};exports[_0x248b('0x26')]=function(_0x24bfee,_0x2b768b){return db[_0x248b('0x2f')][_0x248b('0x47')]({'where':{'id':_0x24bfee[_0x248b('0x44')]['id']}})[_0x248b('0x25')](handleEntityNotFound(_0x2b768b,null))['then'](removeEntity(_0x2b768b,null))[_0x248b('0x48')](handleError(_0x2b768b,null));};exports['describe']=function(_0x12e28c,_0x1aa979){return db['FaxQueue'][_0x248b('0x50')]()[_0x248b('0x25')](respondWithResult(_0x1aa979,null))[_0x248b('0x48')](handleError(_0x1aa979,null));};exports[_0x248b('0x51')]=function(_0x4d5d18,_0x5ee781,_0x24d5c1){var _0x1eb896={'raw':!![],'where':{}},_0x3237bc={},_0x2482b7;return db[_0x248b('0x2f')]['findOne']({'where':{'id':_0x4d5d18[_0x248b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ee781,null))['then'](function(_0x914b77){if(_0x914b77){_0x2482b7=_0x914b77['get']({'plain':!![]});_0x3237bc[_0x248b('0x32')]=_[_0x248b('0x45')](db[_0x248b('0x52')][_0x248b('0x30')]);_0x3237bc[_0x248b('0x34')]=_['keys'](_0x4d5d18[_0x248b('0x34')]);_0x3237bc['filters']=_['intersection'](_0x3237bc[_0x248b('0x32')],_0x3237bc['query']);_0x1eb896[_0x248b('0x35')]=_[_0x248b('0x46')](_0x3237bc[_0x248b('0x32')],qs[_0x248b('0x36')](_0x4d5d18[_0x248b('0x34')][_0x248b('0x36')]));_0x1eb896[_0x248b('0x35')]=_0x1eb896[_0x248b('0x35')][_0x248b('0x37')]?_0x1eb896[_0x248b('0x35')]:_0x3237bc[_0x248b('0x32')];if(!_0x4d5d18[_0x248b('0x34')][_0x248b('0x38')](_0x248b('0x53'))){_0x1eb896[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x4d5d18['query'][_0x248b('0x1c')]);_0x1eb896[_0x248b('0x1b')]=qs[_0x248b('0x1b')](_0x4d5d18['query'][_0x248b('0x1b')]);}_0x1eb896['order']=qs[_0x248b('0x3a')](_0x4d5d18[_0x248b('0x34')][_0x248b('0x3a')]);_0x1eb896[_0x248b('0x3b')]=qs[_0x248b('0x3c')](_['pick'](_0x4d5d18[_0x248b('0x34')],_0x3237bc[_0x248b('0x3c')]));_0x1eb896['where'][_0x248b('0x54')]=_0x914b77['id'];if(_0x4d5d18[_0x248b('0x34')][_0x248b('0x3f')]){_0x1eb896[_0x248b('0x3b')]=_['merge'](_0x1eb896[_0x248b('0x3b')],{'$or':_['map'](_0x1eb896[_0x248b('0x35')],function(_0xdc0514){var _0x38e62f={};_0x38e62f[_0xdc0514]={'$like':'%'+_0x4d5d18['query'][_0x248b('0x3f')]+'%'};return _0x38e62f;})});}_0x1eb896=_[_0x248b('0x3e')]({},_0x1eb896,_0x4d5d18[_0x248b('0x55')]);return db[_0x248b('0x52')][_0x248b('0x41')](_0x1eb896);}})[_0x248b('0x25')](function(_0x3aebbc){if(_0x3aebbc){return db[_0x248b('0x56')][_0x248b('0x57')]({'where':{'id':_['map'](_0x3aebbc,_0x248b('0x58')),'role':_0x248b('0x59')},'attributes':['id','name','faxPause',_0x248b('0x5a'),_0x248b('0x5b')]});}})[_0x248b('0x25')](function(_0x22b150){if(_0x22b150){return{'count':_0x22b150[_0x248b('0x1e')],'rows':_[_0x248b('0x33')](_0x22b150[_0x248b('0x42')],function(_0x4423e4){return{'membername':_0x4423e4[_0x248b('0x2c')],'UserId':_0x4423e4['id'],'queue_name':_0x2482b7[_0x248b('0x2c')],'FaxQueueId':_0x2482b7['id'],'interface':util[_0x248b('0x5c')]('%s/%s',_0x248b('0x5d'),_0x4423e4[_0x248b('0x2c')]),'penalty':0x0,'paused':_0x4423e4[_0x248b('0x5e')],'createdAt':_0x4423e4[_0x248b('0x5b')],'updatedAt':_0x4423e4[_0x248b('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x248b('0x25')](respondWithFilteredResult(_0x5ee781,_0x1eb896))['catch'](handleError(_0x5ee781,null));};exports[_0x248b('0x5f')]=function(_0x22ab03,_0x3b2049,_0x8bee88){var _0x42db24={};var _0x14e039={};var _0x59b6ee;var _0xcb6110;return db['FaxQueue']['findOne']({'where':{'id':_0x22ab03[_0x248b('0x44')]['id']}})[_0x248b('0x25')](handleEntityNotFound(_0x3b2049,null))[_0x248b('0x25')](function(_0x1144b3){if(_0x1144b3){_0x59b6ee=_0x1144b3;_0x14e039[_0x248b('0x32')]=_[_0x248b('0x45')](db[_0x248b('0x60')][_0x248b('0x30')]);_0x14e039[_0x248b('0x34')]=_[_0x248b('0x45')](_0x22ab03[_0x248b('0x34')]);_0x14e039[_0x248b('0x3c')]=_[_0x248b('0x46')](_0x14e039[_0x248b('0x32')],_0x14e039[_0x248b('0x34')]);_0x42db24[_0x248b('0x35')]=_[_0x248b('0x46')](_0x14e039[_0x248b('0x32')],qs[_0x248b('0x36')](_0x22ab03[_0x248b('0x34')][_0x248b('0x36')]));_0x42db24[_0x248b('0x35')]=_0x42db24['attributes'][_0x248b('0x37')]?_0x42db24[_0x248b('0x35')]:_0x14e039[_0x248b('0x32')];_0x42db24[_0x248b('0x39')]=qs['sort'](_0x22ab03[_0x248b('0x34')][_0x248b('0x3a')]);_0x42db24[_0x248b('0x3b')]=qs[_0x248b('0x3c')](_[_0x248b('0x3d')](_0x22ab03[_0x248b('0x34')],_0x14e039[_0x248b('0x3c')]));if(_0x22ab03[_0x248b('0x34')][_0x248b('0x3f')]){_0x42db24['where']=_[_0x248b('0x3e')](_0x42db24[_0x248b('0x3b')],{'$or':_[_0x248b('0x33')](_0x42db24['attributes'],function(_0x9c3161){var _0x464fc0={};_0x464fc0[_0x9c3161]={'$like':'%'+_0x22ab03[_0x248b('0x34')][_0x248b('0x3f')]+'%'};return _0x464fc0;})});}_0x42db24=_[_0x248b('0x3e')]({},_0x42db24,_0x22ab03['options']);return _0x59b6ee['getTeams'](_0x42db24);}})[_0x248b('0x25')](function(_0x4c7c73){if(_0x4c7c73){_0xcb6110=_0x4c7c73[_0x248b('0x37')];if(!_0x22ab03[_0x248b('0x34')][_0x248b('0x38')](_0x248b('0x53'))){_0x42db24[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x22ab03[_0x248b('0x34')][_0x248b('0x1c')]);_0x42db24['offset']=qs[_0x248b('0x1b')](_0x22ab03[_0x248b('0x34')][_0x248b('0x1b')]);}return _0x59b6ee['getTeams'](_0x42db24);}})[_0x248b('0x25')](function(_0xf618e6){if(_0xf618e6){return _0xf618e6?{'count':_0xcb6110,'rows':_0xf618e6}:null;}})[_0x248b('0x25')](respondWithResult(_0x3b2049,null))[_0x248b('0x48')](handleError(_0x3b2049,null));};exports[_0x248b('0x61')]=function(_0x376ea1,_0x594a61,_0x249e9d){var _0xc262=_0x376ea1[_0x248b('0x4a')][_0x248b('0x62')];return db[_0x248b('0x60')][_0x248b('0x41')]({'where':{'id':_0xc262},'attributes':['id'],'include':[{'model':db[_0x248b('0x56')],'as':_0x248b('0x63'),'attributes':['id',_0x248b('0x2c'),_0x248b('0x64'),_0x248b('0x65'),_0x248b('0x66')],'raw':!![]}]})[_0x248b('0x25')](function(_0x569b31){if(_0x569b31){var _0x302293=_[_0x248b('0x67')](_0x569b31,function(_0x4adeeb){var _0x147ad4=_0x4adeeb[_0x248b('0x27')]({'plain':!![]});return _0x147ad4['Agents'];});return db['FaxQueue'][_0x248b('0x47')]({'where':{'id':_0x376ea1[_0x248b('0x44')]['id']}})[_0x248b('0x25')](function(_0x1b301c){return db[_0x248b('0x68')][_0x248b('0x69')](function(_0x45c0b9){return _0x1b301c[_0x248b('0x61')](_0xc262,{'transaction':_0x45c0b9})[_0x248b('0x25')](function(){return BPromise[_0x248b('0x6a')](_0x302293,function(_0x6f8b65){return db[_0x248b('0x52')][_0x248b('0x6b')]({'where':{'UserId':_0x6f8b65['id'],'FaxQueueId':_0x376ea1[_0x248b('0x44')]['id']},'transaction':_0x45c0b9});});})[_0x248b('0x25')](function(){_0x302293[_0x248b('0x6c')](function(_0x360603){socket[_0x248b('0x6d')](_0x248b('0x6e'),{'UserId':_0x360603['id'],'FaxQueueId':_0x1b301c['id']});});});});});}})['then'](respondWithStatusCode(_0x594a61,null))['catch'](handleError(_0x594a61,null));};exports['removeTeams']=function(_0x21cc72,_0xa6c46b,_0x5ddbfe){return db[_0x248b('0x60')][_0x248b('0x41')]({'where':{'id':_0x21cc72[_0x248b('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x248b('0x56')],'as':_0x248b('0x63'),'attributes':['id'],'raw':!![]}]})[_0x248b('0x25')](handleEntityNotFound(_0xa6c46b,null))[_0x248b('0x25')](function(_0x1fe86c){var _0x44e5d9=_['map'](_0x1fe86c,'id');var _0x58e3e8=[];var _0x5d1b30=[];var _0x45223b=squel[_0x248b('0x6f')]();_0x45223b[_0x248b('0x70')](_0x248b('0x71'))[_0x248b('0x72')](_0x248b('0x73'),'tq')[_0x248b('0x74')](_0x248b('0x75'),'ut',_0x248b('0x76'))[_0x248b('0x3b')]('FaxQueueId\x20=\x20?',_0x21cc72['params']['id']);for(var _0xd18add=0x0;_0xd18add<_0x1fe86c['length'];_0xd18add+=0x1){let _0x310475=_0x1fe86c[_0xd18add];for(var _0xab463a=0x0;_0xab463a<_0x310475[_0x248b('0x63')][_0x248b('0x37')];_0xab463a+=0x1){let _0x3caad3=_0x310475[_0x248b('0x63')][_0xab463a];var _0x54d54c=_0x45223b[_0x248b('0x77')]();_0x54d54c[_0x248b('0x3b')](_0x248b('0x78'),_0x3caad3['id']);_0x5d1b30[_0x248b('0x79')](db[_0x248b('0x68')][_0x248b('0x34')](_0x54d54c[_0x248b('0x7a')](),{'type':db['sequelize'][_0x248b('0x7b')]['SELECT']})['then'](function(_0x16dc68){if(_0x16dc68['length']===0x1){return _0x3caad3['id'];}else{var _0x3c493b=_[_0x248b('0x7c')](_['map'](_0x16dc68,_0x248b('0x7d')),function(_0x44b15e){return _[_0x248b('0x7e')](_0x44e5d9,_0x44b15e);});if(_0x3c493b){return _0x3caad3['id'];}}}));}}return BPromise['all'](_0x5d1b30)[_0x248b('0x25')](function(_0x448070){_0x58e3e8=_(_0x58e3e8)[_0x248b('0x7f')](_0x448070)[_0x248b('0x80')]()[_0x248b('0x81')]();return db[_0x248b('0x2f')][_0x248b('0x47')]({'where':{'id':_0x21cc72['params']['id']}})[_0x248b('0x25')](function(_0x3df77e){return db[_0x248b('0x68')]['transaction'](function(_0x2d230){return _0x3df77e[_0x248b('0x82')](_0x21cc72[_0x248b('0x34')][_0x248b('0x62')],{'transaction':_0x2d230})[_0x248b('0x25')](function(){if(!_[_0x248b('0x83')](_0x58e3e8)){return _0x3df77e[_0x248b('0x84')](_0x58e3e8,{'transaction':_0x2d230});}})[_0x248b('0x25')](function(){_0x58e3e8[_0x248b('0x6c')](function(_0x62d8df){socket[_0x248b('0x6d')](_0x248b('0x85'),{'UserId':_0x62d8df,'FaxQueueId':_0x3df77e['id']});});});});});});})['then'](respondWithStatusCode(_0xa6c46b,null))[_0x248b('0x48')](handleError(_0xa6c46b,null));};exports[_0x248b('0x86')]=function(_0x525059,_0x32821a,_0x53b47c){return db['FaxQueue'][_0x248b('0x47')]({'where':{'id':_0x525059[_0x248b('0x44')]['id']}})[_0x248b('0x25')](handleEntityNotFound(_0x32821a,null))[_0x248b('0x25')](function(_0x4aef18){if(_0x4aef18){return _0x4aef18[_0x248b('0x86')](_0x525059[_0x248b('0x4a')]['ids'],_[_0x248b('0x87')](_0x525059[_0x248b('0x4a')],[_0x248b('0x62'),'id'])||{})['spread'](function(_0x119f3e){for(var _0x5bfe67=0x0;_0x5bfe67<_0x525059[_0x248b('0x4a')]['ids'][_0x248b('0x37')];_0x5bfe67+=0x1){socket['emit'](_0x248b('0x6e'),{'UserId':Number(_0x525059[_0x248b('0x4a')][_0x248b('0x62')][_0x5bfe67]),'FaxQueueId':Number(_0x525059[_0x248b('0x44')]['id'])});}return _0x119f3e;});}})[_0x248b('0x25')](respondWithResult(_0x32821a,null))[_0x248b('0x48')](handleError(_0x32821a,null));};exports[_0x248b('0x84')]=function(_0x485e10,_0x3bf7db,_0x233919){return db[_0x248b('0x2f')][_0x248b('0x47')]({'where':{'id':_0x485e10[_0x248b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3bf7db,null))[_0x248b('0x25')](function(_0x1e24e2){if(_0x1e24e2){return _0x1e24e2['removeAgents'](_0x485e10[_0x248b('0x34')][_0x248b('0x62')])[_0x248b('0x25')](function(){if(_[_0x248b('0x88')](_0x485e10['query']['ids'])){for(var _0x12644c=0x0;_0x12644c<_0x485e10[_0x248b('0x34')][_0x248b('0x62')]['length'];_0x12644c+=0x1){socket[_0x248b('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x485e10[_0x248b('0x34')][_0x248b('0x62')][_0x12644c]),'FaxQueueId':Number(_0x485e10[_0x248b('0x44')]['id'])});}}else{socket[_0x248b('0x6d')](_0x248b('0x85'),{'UserId':Number(_0x485e10[_0x248b('0x34')][_0x248b('0x62')]),'FaxQueueId':Number(_0x485e10['params']['id'])});}});}})[_0x248b('0x25')](respondWithStatusCode(_0x3bf7db,null))['catch'](handleError(_0x3bf7db,null));};exports[_0x248b('0x89')]=function(_0xaab08c,_0x3e78cf,_0x242048){var _0x4ae0ae={};var _0x26a3b2={};var _0x7381b4;var _0x2fa4db;return db[_0x248b('0x2f')][_0x248b('0x8a')]({'where':{'id':_0xaab08c[_0x248b('0x44')]['id']}})[_0x248b('0x25')](handleEntityNotFound(_0x3e78cf,null))['then'](function(_0x4547a0){if(_0x4547a0){_0x7381b4=_0x4547a0;_0x26a3b2['model']=_[_0x248b('0x45')](db[_0x248b('0x56')][_0x248b('0x30')]);_0x26a3b2[_0x248b('0x34')]=_['keys'](_0xaab08c[_0x248b('0x34')]);_0x26a3b2[_0x248b('0x3c')]=_[_0x248b('0x46')](_0x26a3b2[_0x248b('0x32')],_0x26a3b2[_0x248b('0x34')]);_0x4ae0ae[_0x248b('0x35')]=_[_0x248b('0x46')](_0x26a3b2[_0x248b('0x32')],qs['fields'](_0xaab08c[_0x248b('0x34')][_0x248b('0x36')]));_0x4ae0ae[_0x248b('0x35')]=_0x4ae0ae[_0x248b('0x35')]['length']?_0x4ae0ae[_0x248b('0x35')]:_0x26a3b2['model'];_0x4ae0ae[_0x248b('0x39')]=qs[_0x248b('0x3a')](_0xaab08c[_0x248b('0x34')][_0x248b('0x3a')]);_0x4ae0ae[_0x248b('0x3b')]=qs[_0x248b('0x3c')](_['pick'](_0xaab08c[_0x248b('0x34')],_0x26a3b2[_0x248b('0x3c')]));if(_0xaab08c['query'][_0x248b('0x3f')]){_0x4ae0ae[_0x248b('0x3b')]=_['merge'](_0x4ae0ae[_0x248b('0x3b')],{'$or':_['map'](_0x4ae0ae['attributes'],function(_0x241a86){var _0x99c5fc={};_0x99c5fc[_0x241a86]={'$like':'%'+_0xaab08c[_0x248b('0x34')][_0x248b('0x3f')]+'%'};return _0x99c5fc;})});}_0x4ae0ae=_[_0x248b('0x3e')]({},_0x4ae0ae,_0xaab08c['options']);return _0x7381b4[_0x248b('0x89')](_0x4ae0ae);}})['then'](function(_0x7bb322){if(_0x7bb322){_0x2fa4db=_0x7bb322[_0x248b('0x37')];if(!_0xaab08c[_0x248b('0x34')][_0x248b('0x38')](_0x248b('0x53'))){_0x4ae0ae['limit']=qs[_0x248b('0x1c')](_0xaab08c[_0x248b('0x34')][_0x248b('0x1c')]);_0x4ae0ae['offset']=qs[_0x248b('0x1b')](_0xaab08c[_0x248b('0x34')][_0x248b('0x1b')]);}return _0x7381b4[_0x248b('0x89')](_0x4ae0ae);}})[_0x248b('0x25')](function(_0x50ff36){if(_0x50ff36){return _0x50ff36?{'count':_0x2fa4db,'rows':_0x50ff36}:null;}})[_0x248b('0x25')](respondWithResult(_0x3e78cf,null))[_0x248b('0x48')](handleError(_0x3e78cf,null));};
\ No newline at end of file
index 210223a..4d38145 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47b1=['FaxQueue','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5bd9be,_0x160897){var _0x2b26cd=function(_0x257613){while(--_0x257613){_0x5bd9be['push'](_0x5bd9be['shift']());}};_0x2b26cd(++_0x160897);}(_0x47b1,0x15e));var _0x147b=function(_0x24b0b0,_0x28cc95){_0x24b0b0=_0x24b0b0-0x0;var _0x56ad4e=_0x47b1[_0x24b0b0];return _0x56ad4e;};'use strict';var EventEmitter=require(_0x147b('0x0'));var FaxQueue=require(_0x147b('0x1'))['db'][_0x147b('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x147b('0x3'),'afterUpdate':'update','afterDestroy':_0x147b('0x4')};function emitEvent(_0xfd0951){return function(_0x481f05,_0x1141c7,_0x533160){FaxQueueEvents[_0x147b('0x5')](_0xfd0951+':'+_0x481f05['id'],_0x481f05);FaxQueueEvents[_0x147b('0x5')](_0xfd0951,_0x481f05);_0x533160(null);};}for(var e in events){if(events[_0x147b('0x6')](e)){var event=events[e];FaxQueue[_0x147b('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0x9711=['events','../../mysqldb','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9711,0x15e));var _0x1971=function(_0x25ddc3,_0x886b46){_0x25ddc3=_0x25ddc3-0x0;var _0x2544e7=_0x9711[_0x25ddc3];return _0x2544e7;};'use strict';var EventEmitter=require(_0x1971('0x0'));var FaxQueue=require(_0x1971('0x1'))['db'][_0x1971('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1971('0x3')](0x0);var events={'afterCreate':_0x1971('0x4'),'afterUpdate':_0x1971('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2c4b3f){return function(_0x57a35e,_0x3a0580,_0x3c246d){FaxQueueEvents[_0x1971('0x6')](_0x2c4b3f+':'+_0x57a35e['id'],_0x57a35e);FaxQueueEvents['emit'](_0x2c4b3f,_0x57a35e);_0x3c246d(null);};}for(var e in events){if(events[_0x1971('0x7')](e)){var event=events[e];FaxQueue[_0x1971('0x8')](e,emitEvent(event));}}module[_0x1971('0x9')]=FaxQueueEvents;
\ No newline at end of file
index 5d6e663..89b98cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x318a=['FaxQueue','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x45966f,_0x208d42){var _0x223c92=function(_0x54ca0b){while(--_0x54ca0b){_0x45966f['push'](_0x45966f['shift']());}};_0x223c92(++_0x208d42);}(_0x318a,0x15f));var _0xa318=function(_0x43a638,_0x20be03){_0x43a638=_0x43a638-0x0;var _0x49a916=_0x318a[_0x43a638];return _0x49a916;};'use strict';var _=require(_0xa318('0x0'));var util=require('util');var logger=require(_0xa318('0x1'))('api');var moment=require(_0xa318('0x2'));var BPromise=require(_0xa318('0x3'));var rp=require(_0xa318('0x4'));var fs=require('fs');var path=require(_0xa318('0x5'));var rimraf=require(_0xa318('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xa318('0x7')]=function(_0x5a66ca,_0x58f7ac){return _0x5a66ca[_0xa318('0x8')](_0xa318('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xccbe=['moment','bluebird','request-promise','path','rimraf','exports','define','fax_queues','lodash','../../config/logger','api'];(function(_0x89ace6,_0x39064b){var _0x302694=function(_0x7dd49){while(--_0x7dd49){_0x89ace6['push'](_0x89ace6['shift']());}};_0x302694(++_0x39064b);}(_0xccbe,0xfa));var _0xeccb=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0xccbe[_0x401d67];return _0x25076b;};'use strict';var _=require(_0xeccb('0x0'));var util=require('util');var logger=require(_0xeccb('0x1'))(_0xeccb('0x2'));var moment=require(_0xeccb('0x3'));var BPromise=require(_0xeccb('0x4'));var rp=require(_0xeccb('0x5'));var fs=require('fs');var path=require(_0xeccb('0x6'));var rimraf=require(_0xeccb('0x7'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xeccb('0x8')]=function(_0x5d583e,_0x32cfdb){return _0x5d583e[_0xeccb('0x9')]('FaxQueue',attributes,{'tableName':_0xeccb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b39e4a8..cda1513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab5=['ShowFaxQueue','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','debug'];(function(_0x33ad1f,_0xfc2fc8){var _0x26ef22=function(_0x58f97c){while(--_0x58f97c){_0x33ad1f['push'](_0x33ad1f['shift']());}};_0x26ef22(++_0xfc2fc8);}(_0x1ab5,0xcb));var _0x51ab=function(_0x4eaecc,_0x4956c4){_0x4eaecc=_0x4eaecc-0x0;var _0x239f4c=_0x1ab5[_0x4eaecc];return _0x239f4c;};'use strict';var _=require(_0x51ab('0x0'));var util=require(_0x51ab('0x1'));var moment=require(_0x51ab('0x2'));var BPromise=require(_0x51ab('0x3'));var rs=require(_0x51ab('0x4'));var fs=require('fs');var Redis=require(_0x51ab('0x5'));var db=require(_0x51ab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x51ab('0x7'))(_0x51ab('0x8'));var config=require(_0x51ab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x51ab('0xa')]['http']({'port':0x232a});config[_0x51ab('0xb')]=_[_0x51ab('0xc')](config[_0x51ab('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51ab('0xb')]));require(_0x51ab('0xd'))[_0x51ab('0xe')](socket);function respondWithRpcPromise(_0x4618cb,_0x1a9f06,_0x12a045){return new BPromise(function(_0x22ad22,_0xd9f755){return client[_0x51ab('0xf')](_0x4618cb,_0x12a045)['then'](function(_0x25cabf){logger[_0x51ab('0x10')](_0x51ab('0x11'),_0x1a9f06,_0x51ab('0x12'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x1a9f06,_0x51ab('0x12'),JSON['stringify'](_0x25cabf));if(_0x25cabf[_0x51ab('0x13')]){if(_0x25cabf[_0x51ab('0x13')][_0x51ab('0x14')]===0x1f4){logger[_0x51ab('0x13')]('FaxQueue,\x20%s,\x20%s',_0x1a9f06,_0x25cabf[_0x51ab('0x13')][_0x51ab('0x15')]);return _0xd9f755(_0x25cabf[_0x51ab('0x13')][_0x51ab('0x15')]);}logger[_0x51ab('0x13')](_0x51ab('0x11'),_0x1a9f06,_0x25cabf[_0x51ab('0x13')][_0x51ab('0x15')]);return _0x22ad22(_0x25cabf[_0x51ab('0x13')][_0x51ab('0x15')]);}else{logger['info'](_0x51ab('0x11'),_0x1a9f06,_0x51ab('0x12'));_0x22ad22(_0x25cabf[_0x51ab('0x16')][_0x51ab('0x15')]);}})[_0x51ab('0x17')](function(_0x4a57df){logger[_0x51ab('0x13')](_0x51ab('0x11'),_0x1a9f06,_0x4a57df);_0xd9f755(_0x4a57df);});});}exports[_0x51ab('0x18')]=function(_0x228a23){var _0x3d0856=this;return new Promise(function(_0x2714c9,_0x137134){return db[_0x51ab('0x19')][_0x51ab('0x1a')]({'raw':_0x228a23['options']?_0x228a23[_0x51ab('0x1b')][_0x51ab('0x1c')]===undefined?!![]:![]:!![],'where':_0x228a23[_0x51ab('0x1b')]?_0x228a23[_0x51ab('0x1b')][_0x51ab('0x1d')]||null:null,'attributes':_0x228a23[_0x51ab('0x1b')]?_0x228a23[_0x51ab('0x1b')][_0x51ab('0x1e')]||null:null,'limit':_0x228a23[_0x51ab('0x1b')]?_0x228a23[_0x51ab('0x1b')][_0x51ab('0x1f')]||null:null,'include':_0x228a23[_0x51ab('0x1b')]?_0x228a23[_0x51ab('0x1b')][_0x51ab('0x20')]?_[_0x51ab('0x21')](_0x228a23[_0x51ab('0x1b')][_0x51ab('0x20')],function(_0x496d91){return{'model':db[_0x496d91['model']],'as':_0x496d91['as'],'attributes':_0x496d91[_0x51ab('0x1e')],'include':_0x496d91[_0x51ab('0x20')]?_['map'](_0x496d91[_0x51ab('0x20')],function(_0x121a8e){return{'model':db[_0x121a8e[_0x51ab('0x22')]],'as':_0x121a8e['as'],'attributes':_0x121a8e[_0x51ab('0x1e')],'include':_0x121a8e[_0x51ab('0x20')]?_['map'](_0x121a8e[_0x51ab('0x20')],function(_0x25ec7f){return{'model':db[_0x25ec7f[_0x51ab('0x22')]],'as':_0x25ec7f['as'],'attributes':_0x25ec7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x51ab('0x23')](function(_0x2a3087){logger['info'](_0x51ab('0x18'),_0x228a23);logger[_0x51ab('0x24')](_0x51ab('0x18'),_0x228a23,JSON['stringify'](_0x2a3087));_0x2714c9(_0x2a3087);})[_0x51ab('0x17')](function(_0xcefe7f){logger['error'](_0x51ab('0x18'),_0xcefe7f[_0x51ab('0x15')],_0x228a23);_0x137134(_0x3d0856['error'](0x1f4,_0xcefe7f[_0x51ab('0x15')]));});});};exports[_0x51ab('0x25')]=function(_0x2ff28c){var _0x145b9f=this;return new Promise(function(_0x4461fb,_0x677444){return db[_0x51ab('0x19')][_0x51ab('0x26')]({'raw':_0x2ff28c['options']?_0x2ff28c['options'][_0x51ab('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ff28c[_0x51ab('0x1b')]?_0x2ff28c[_0x51ab('0x1b')][_0x51ab('0x1d')]||null:null,'attributes':_0x2ff28c['options']?_0x2ff28c[_0x51ab('0x1b')][_0x51ab('0x1e')]||null:null,'include':_0x2ff28c[_0x51ab('0x1b')]?_0x2ff28c[_0x51ab('0x1b')]['include']?_[_0x51ab('0x21')](_0x2ff28c[_0x51ab('0x1b')][_0x51ab('0x20')],function(_0x435be8){return{'model':db[_0x435be8['model']],'as':_0x435be8['as'],'attributes':_0x435be8[_0x51ab('0x1e')],'include':_0x435be8[_0x51ab('0x20')]?_[_0x51ab('0x21')](_0x435be8[_0x51ab('0x20')],function(_0x577dfa){return{'model':db[_0x577dfa[_0x51ab('0x22')]],'as':_0x577dfa['as'],'attributes':_0x577dfa[_0x51ab('0x1e')],'include':_0x577dfa[_0x51ab('0x20')]?_[_0x51ab('0x21')](_0x577dfa[_0x51ab('0x20')],function(_0x57fe72){return{'model':db[_0x57fe72[_0x51ab('0x22')]],'as':_0x57fe72['as'],'attributes':_0x57fe72[_0x51ab('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x51ab('0x23')](function(_0x243544){logger[_0x51ab('0x10')](_0x51ab('0x25'),_0x2ff28c);logger[_0x51ab('0x24')](_0x51ab('0x25'),_0x2ff28c,JSON[_0x51ab('0x27')](_0x243544));_0x4461fb(_0x243544);})['catch'](function(_0x522c9a){logger[_0x51ab('0x13')](_0x51ab('0x25'),_0x522c9a[_0x51ab('0x15')],_0x2ff28c);_0x677444(_0x145b9f['error'](0x1f4,_0x522c9a[_0x51ab('0x15')]));});});};
\ No newline at end of file
+var _0x0204=['limit','include','map','model','ShowFaxQueue','FaxQueue','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFaxQueue','findAll','options','raw','where','attributes'];(function(_0xc6583e,_0x3e854a){var _0x11f67e=function(_0x7b32db){while(--_0x7b32db){_0xc6583e['push'](_0xc6583e['shift']());}};_0x11f67e(++_0x3e854a);}(_0x0204,0x11f));var _0x4020=function(_0x219011,_0x4fdd9b){_0x219011=_0x219011-0x0;var _0x573847=_0x0204[_0x219011];return _0x573847;};'use strict';var _=require(_0x4020('0x0'));var util=require(_0x4020('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4020('0x2'));var db=require(_0x4020('0x3'))['db'];var utils=require(_0x4020('0x4'));var logger=require(_0x4020('0x5'))('rpc');var config=require(_0x4020('0x6'));var jayson=require(_0x4020('0x7'));var client=jayson[_0x4020('0x8')][_0x4020('0x9')]({'port':0x232a});config['redis']=_[_0x4020('0xa')](config['redis'],{'host':_0x4020('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4020('0xc')]));require(_0x4020('0xd'))[_0x4020('0xe')](socket);function respondWithRpcPromise(_0x57f130,_0x3ce359,_0x165b37){return new BPromise(function(_0x1bcd31,_0x4493f2){return client[_0x4020('0xf')](_0x57f130,_0x165b37)[_0x4020('0x10')](function(_0x32c1e3){logger['info'](_0x4020('0x11'),_0x3ce359,_0x4020('0x12'));logger[_0x4020('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3ce359,_0x4020('0x12'),JSON[_0x4020('0x14')](_0x32c1e3));if(_0x32c1e3[_0x4020('0x15')]){if(_0x32c1e3['error'][_0x4020('0x16')]===0x1f4){logger[_0x4020('0x15')](_0x4020('0x11'),_0x3ce359,_0x32c1e3[_0x4020('0x15')][_0x4020('0x17')]);return _0x4493f2(_0x32c1e3[_0x4020('0x15')][_0x4020('0x17')]);}logger[_0x4020('0x15')](_0x4020('0x11'),_0x3ce359,_0x32c1e3[_0x4020('0x15')][_0x4020('0x17')]);return _0x1bcd31(_0x32c1e3[_0x4020('0x15')][_0x4020('0x17')]);}else{logger[_0x4020('0x18')]('FaxQueue,\x20%s,\x20%s',_0x3ce359,_0x4020('0x12'));_0x1bcd31(_0x32c1e3[_0x4020('0x19')]['message']);}})[_0x4020('0x1a')](function(_0x60bf4b){logger[_0x4020('0x15')]('FaxQueue,\x20%s,\x20%s',_0x3ce359,_0x60bf4b);_0x4493f2(_0x60bf4b);});});}exports[_0x4020('0x1b')]=function(_0x440f36){var _0x113ae9=this;return new Promise(function(_0x1cc022,_0x32f214){return db['FaxQueue'][_0x4020('0x1c')]({'raw':_0x440f36[_0x4020('0x1d')]?_0x440f36[_0x4020('0x1d')][_0x4020('0x1e')]===undefined?!![]:![]:!![],'where':_0x440f36['options']?_0x440f36[_0x4020('0x1d')][_0x4020('0x1f')]||null:null,'attributes':_0x440f36[_0x4020('0x1d')]?_0x440f36[_0x4020('0x1d')][_0x4020('0x20')]||null:null,'limit':_0x440f36['options']?_0x440f36[_0x4020('0x1d')][_0x4020('0x21')]||null:null,'include':_0x440f36[_0x4020('0x1d')]?_0x440f36[_0x4020('0x1d')][_0x4020('0x22')]?_[_0x4020('0x23')](_0x440f36['options'][_0x4020('0x22')],function(_0x1d4c69){return{'model':db[_0x1d4c69[_0x4020('0x24')]],'as':_0x1d4c69['as'],'attributes':_0x1d4c69['attributes'],'include':_0x1d4c69[_0x4020('0x22')]?_[_0x4020('0x23')](_0x1d4c69[_0x4020('0x22')],function(_0x37fc2e){return{'model':db[_0x37fc2e[_0x4020('0x24')]],'as':_0x37fc2e['as'],'attributes':_0x37fc2e[_0x4020('0x20')],'include':_0x37fc2e[_0x4020('0x22')]?_[_0x4020('0x23')](_0x37fc2e[_0x4020('0x22')],function(_0x510b71){return{'model':db[_0x510b71[_0x4020('0x24')]],'as':_0x510b71['as'],'attributes':_0x510b71[_0x4020('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4020('0x10')](function(_0x58b6fe){logger['info']('GetFaxQueue',_0x440f36);logger['debug'](_0x4020('0x1b'),_0x440f36,JSON[_0x4020('0x14')](_0x58b6fe));_0x1cc022(_0x58b6fe);})[_0x4020('0x1a')](function(_0x3efd7a){logger[_0x4020('0x15')]('GetFaxQueue',_0x3efd7a[_0x4020('0x17')],_0x440f36);_0x32f214(_0x113ae9[_0x4020('0x15')](0x1f4,_0x3efd7a['message']));});});};exports[_0x4020('0x25')]=function(_0x5a5240){var _0x232086=this;return new Promise(function(_0x3023fa,_0x15f022){return db[_0x4020('0x26')][_0x4020('0x27')]({'raw':_0x5a5240['options']?_0x5a5240['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a5240[_0x4020('0x1d')]?_0x5a5240[_0x4020('0x1d')][_0x4020('0x1f')]||null:null,'attributes':_0x5a5240['options']?_0x5a5240[_0x4020('0x1d')][_0x4020('0x20')]||null:null,'include':_0x5a5240['options']?_0x5a5240[_0x4020('0x1d')]['include']?_['map'](_0x5a5240[_0x4020('0x1d')][_0x4020('0x22')],function(_0x421de5){return{'model':db[_0x421de5[_0x4020('0x24')]],'as':_0x421de5['as'],'attributes':_0x421de5[_0x4020('0x20')],'include':_0x421de5[_0x4020('0x22')]?_[_0x4020('0x23')](_0x421de5[_0x4020('0x22')],function(_0x38ea14){return{'model':db[_0x38ea14['model']],'as':_0x38ea14['as'],'attributes':_0x38ea14['attributes'],'include':_0x38ea14[_0x4020('0x22')]?_[_0x4020('0x23')](_0x38ea14[_0x4020('0x22')],function(_0xb41483){return{'model':db[_0xb41483[_0x4020('0x24')]],'as':_0xb41483['as'],'attributes':_0xb41483[_0x4020('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4020('0x10')](function(_0x49c164){logger[_0x4020('0x18')]('ShowFaxQueue',_0x5a5240);logger['debug']('ShowFaxQueue',_0x5a5240,JSON[_0x4020('0x14')](_0x49c164));_0x3023fa(_0x49c164);})[_0x4020('0x1a')](function(_0x1d32fd){logger[_0x4020('0x15')](_0x4020('0x25'),_0x1d32fd[_0x4020('0x17')],_0x5a5240);_0x15f022(_0x232086[_0x4020('0x15')](0x1f4,_0x1d32fd[_0x4020('0x17')]));});});};
\ No newline at end of file
index e4197ec..54205af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf12f=['removeListener','length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x38c548,_0x180e01){var _0x4facd9=function(_0xbf15d4){while(--_0xbf15d4){_0x38c548['push'](_0x38c548['shift']());}};_0x4facd9(++_0x180e01);}(_0xf12f,0x1bb));var _0xff12=function(_0xbafc3d,_0x3a790c){_0xbafc3d=_0xbafc3d-0x0;var _0x1cb141=_0xf12f[_0xbafc3d];return _0x1cb141;};'use strict';var FaxQueueEvents=require(_0xff12('0x0'));var events=[_0xff12('0x1'),_0xff12('0x2'),_0xff12('0x3')];function createListener(_0x31f47e,_0x30b4fa){return function(_0x9f5089){_0x30b4fa[_0xff12('0x4')](_0x31f47e,_0x9f5089);};}function removeListener(_0x10f239,_0x54be86){return function(){FaxQueueEvents[_0xff12('0x5')](_0x10f239,_0x54be86);};}exports['register']=function(_0x37a286){for(var _0x271e49=0x0,_0x3e5d13=events[_0xff12('0x6')];_0x271e49<_0x3e5d13;_0x271e49++){var _0x1e9c17=events[_0x271e49];var _0x3ce247=createListener(_0xff12('0x7')+_0x1e9c17,_0x37a286);FaxQueueEvents['on'](_0x1e9c17,_0x3ce247);}};
\ No newline at end of file
+var _0x62c9=['removeListener','register','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x3d0113,_0x1c3a5f){var _0x40d13b=function(_0x26cf73){while(--_0x26cf73){_0x3d0113['push'](_0x3d0113['shift']());}};_0x40d13b(++_0x1c3a5f);}(_0x62c9,0xe3));var _0x962c=function(_0x2686ff,_0x582126){_0x2686ff=_0x2686ff-0x0;var _0x1f8107=_0x62c9[_0x2686ff];return _0x1f8107;};'use strict';var FaxQueueEvents=require(_0x962c('0x0'));var events=[_0x962c('0x1'),_0x962c('0x2'),_0x962c('0x3')];function createListener(_0x4e0487,_0x3cb62c){return function(_0x4578f5){_0x3cb62c['emit'](_0x4e0487,_0x4578f5);};}function removeListener(_0x4e7db4,_0x5ac1ad){return function(){FaxQueueEvents[_0x962c('0x4')](_0x4e7db4,_0x5ac1ad);};}exports[_0x962c('0x5')]=function(_0x4c0c99){for(var _0x5ce84c=0x0,_0xa1a2e=events['length'];_0x5ce84c<_0xa1a2e;_0x5ce84c++){var _0x3a3f0f=events[_0x5ce84c];var _0x16fe05=createListener(_0x962c('0x6')+_0x3a3f0f,_0x4c0c99);FaxQueueEvents['on'](_0x3a3f0f,_0x16fe05);}};
\ No newline at end of file
index 26d09c4..3df11cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['addTeams','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','post'];(function(_0x14b963,_0x4156ca){var _0x2d26de=function(_0x33326c){while(--_0x33326c){_0x14b963['push'](_0x14b963['shift']());}};_0x2d26de(++_0x4156ca);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/members',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getTeams']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0x15')]('/',auth[_0x7413('0xe')](),controller['create']);router['post']('/:id/teams',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x13'),auth[_0x7413('0xe')](),controller['addAgents']);router[_0x7413('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7413('0x18')]);router['delete'](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x19')]);router[_0x7413('0x1a')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x1a')]('/:id/users',auth[_0x7413('0xe')](),controller[_0x7413('0x1c')]);module[_0x7413('0x1d')]=router;
\ No newline at end of file
+var _0xe2bc=['/:id/users','update','destroy','delete','removeTeams','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create'];(function(_0x5ec924,_0x1fde7b){var _0xbb930e=function(_0x16cb8f){while(--_0x16cb8f){_0x5ec924['push'](_0x5ec924['shift']());}};_0xbb930e(++_0x1fde7b);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xe2bc[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0xce2b('0x0'));var util=require('util');var path=require(_0xce2b('0x1'));var timeout=require('connect-timeout');var express=require(_0xce2b('0x2'));var router=express[_0xce2b('0x3')]();var fs_extra=require(_0xce2b('0x4'));var auth=require(_0xce2b('0x5'));var interaction=require(_0xce2b('0x6'));var config=require('../../config/environment');var controller=require(_0xce2b('0x7'));router[_0xce2b('0x8')]('/',auth[_0xce2b('0x9')](),controller[_0xce2b('0xa')]);router[_0xce2b('0x8')]('/describe',auth[_0xce2b('0x9')](),controller[_0xce2b('0xb')]);router['get'](_0xce2b('0xc'),auth[_0xce2b('0x9')](),controller[_0xce2b('0xd')]);router[_0xce2b('0x8')](_0xce2b('0xe'),auth[_0xce2b('0x9')](),controller[_0xce2b('0xf')]);router[_0xce2b('0x8')](_0xce2b('0x10'),auth[_0xce2b('0x9')](),controller['getTeams']);router[_0xce2b('0x8')]('/:id/users',auth[_0xce2b('0x9')](),controller[_0xce2b('0x11')]);router[_0xce2b('0x12')]('/',auth[_0xce2b('0x9')](),controller[_0xce2b('0x13')]);router[_0xce2b('0x12')](_0xce2b('0x10'),auth[_0xce2b('0x9')](),controller['addTeams']);router[_0xce2b('0x12')](_0xce2b('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xce2b('0xc'),auth[_0xce2b('0x9')](),controller[_0xce2b('0x15')]);router['delete']('/:id',auth[_0xce2b('0x9')](),controller[_0xce2b('0x16')]);router[_0xce2b('0x17')](_0xce2b('0x10'),auth[_0xce2b('0x9')](),controller[_0xce2b('0x18')]);router[_0xce2b('0x17')](_0xce2b('0x14'),auth[_0xce2b('0x9')](),controller[_0xce2b('0x19')]);module['exports']=router;
\ No newline at end of file
index 959a7d3..9755cd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52bc=['DATE','sequelize','STRING'];(function(_0x517648,_0x3e4708){var _0xb5372a=function(_0x4b0628){while(--_0x4b0628){_0x517648['push'](_0x517648['shift']());}};_0xb5372a(++_0x3e4708);}(_0x52bc,0x1ba));var _0xc52b=function(_0x3e0521,_0x2db9a2){_0x3e0521=_0x3e0521-0x0;var _0x5c662a=_0x52bc[_0x3e0521];return _0x5c662a;};'use strict';var moment=require('moment');var Sequelize=require(_0xc52b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc52b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xc52b('0x1')]},'joinAt':{'type':Sequelize[_0xc52b('0x2')]},'leaveAt':{'type':Sequelize[_0xc52b('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc52b('0x2')]},'reason':{'type':Sequelize[_0xc52b('0x1')]}};
\ No newline at end of file
+var _0x8015=['DATE','moment','exports','STRING'];(function(_0x38a833,_0x1418e5){var _0x330fa6=function(_0x29206a){while(--_0x29206a){_0x38a833['push'](_0x38a833['shift']());}};_0x330fa6(++_0x1418e5);}(_0x8015,0x1c9));var _0x5801=function(_0x2ea085,_0x1fc5d1){_0x2ea085=_0x2ea085-0x0;var _0x36b47b=_0x8015[_0x2ea085];return _0x36b47b;};'use strict';var moment=require(_0x5801('0x0'));var Sequelize=require('sequelize');module[_0x5801('0x1')]={'uniqueid':{'type':Sequelize[_0x5801('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5801('0x2')]},'joinAt':{'type':Sequelize[_0x5801('0x3')]},'leaveAt':{'type':Sequelize[_0x5801('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5801('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3e9aa8c..5e2a434 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc30d=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','FaxQueueReport','rawAttributes'];(function(_0x4508da,_0x58fb21){var _0x2dc9a2=function(_0x4a7d20){while(--_0x4a7d20){_0x4508da['push'](_0x4508da['shift']());}};_0x2dc9a2(++_0x58fb21);}(_0xc30d,0x6e));var _0xdc30=function(_0xdcb582,_0x2fb7ed){_0xdcb582=_0xdcb582-0x0;var _0x82ffba=_0xc30d[_0xdcb582];return _0x82ffba;};'use strict';var emlformat=require(_0xdc30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc30('0x1'));var jsonpatch=require(_0xdc30('0x2'));var rp=require(_0xdc30('0x3'));var moment=require(_0xdc30('0x4'));var BPromise=require(_0xdc30('0x5'));var Mustache=require('mustache');var util=require(_0xdc30('0x6'));var path=require('path');var sox=require(_0xdc30('0x7'));var csv=require(_0xdc30('0x8'));var ejs=require(_0xdc30('0x9'));var fs=require('fs');var fs_extra=require(_0xdc30('0xa'));var _=require(_0xdc30('0xb'));var squel=require(_0xdc30('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc30('0xd'));var deskjs=require(_0xdc30('0xe'));var toCsv=require(_0xdc30('0x8'));var querystring=require(_0xdc30('0xf'));var Papa=require(_0xdc30('0x10'));var Redis=require(_0xdc30('0x11'));var authService=require(_0xdc30('0x12'));var qs=require(_0xdc30('0x13'));var as=require(_0xdc30('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdc30('0x15'));var config=require(_0xdc30('0x16'));var licenseUtil=require(_0xdc30('0x17'));var db=require(_0xdc30('0x18'))['db'];function respondWithStatusCode(_0x4659ab,_0x1241f2){_0x1241f2=_0x1241f2||0xcc;return function(_0x7e4e17){if(_0x7e4e17){return _0x4659ab['sendStatus'](_0x1241f2);}return _0x4659ab[_0xdc30('0x19')](_0x1241f2)[_0xdc30('0x1a')]();};}function respondWithResult(_0x2220e3,_0x502425){_0x502425=_0x502425||0xc8;return function(_0x5a9e68){if(_0x5a9e68){return _0x2220e3[_0xdc30('0x19')](_0x502425)[_0xdc30('0x1b')](_0x5a9e68);}};}function respondWithFilteredResult(_0x3620e9,_0x553b45){return function(_0x21e3f1){if(_0x21e3f1){var _0x160404=typeof _0x553b45[_0xdc30('0x1c')]===_0xdc30('0x1d')&&typeof _0x553b45[_0xdc30('0x1e')]===_0xdc30('0x1d');var _0x37d9bb=_0x21e3f1['count'];var _0x3eff2c=_0x160404?0x0:_0x553b45[_0xdc30('0x1c')];var _0x57a868=_0x160404?_0x21e3f1['count']:_0x553b45[_0xdc30('0x1c')]+_0x553b45[_0xdc30('0x1e')];var _0x28336e;if(_0x57a868>=_0x37d9bb){_0x57a868=_0x37d9bb;_0x28336e=0xc8;}else{_0x28336e=0xce;}_0x3620e9[_0xdc30('0x19')](_0x28336e);return _0x3620e9[_0xdc30('0x1f')](_0xdc30('0x20'),_0x3eff2c+'-'+_0x57a868+'/'+_0x37d9bb)[_0xdc30('0x1b')](_0x21e3f1);}return null;};}function patchUpdates(_0x8dd720){return function(_0x38f237){try{jsonpatch[_0xdc30('0x21')](_0x38f237,_0x8dd720,!![]);}catch(_0x385e08){return BPromise[_0xdc30('0x22')](_0x385e08);}return _0x38f237[_0xdc30('0x23')]();};}function saveUpdates(_0x274d9a,_0x3e7893){return function(_0x453b55){if(_0x453b55){return _0x453b55['update'](_0x274d9a)[_0xdc30('0x24')](function(_0x4ecc39){return _0x4ecc39;});}return null;};}function removeEntity(_0x4ee4be,_0x2bde2e){return function(_0x2f7a75){if(_0x2f7a75){return _0x2f7a75[_0xdc30('0x25')]()['then'](function(){_0x4ee4be[_0xdc30('0x19')](0xcc)[_0xdc30('0x1a')]();});}};}function handleEntityNotFound(_0x4fdafc,_0x21d199){return function(_0x4dc9f8){if(!_0x4dc9f8){_0x4fdafc[_0xdc30('0x26')](0x194);}return _0x4dc9f8;};}function handleError(_0x4c0725,_0x2c1af3){_0x2c1af3=_0x2c1af3||0x1f4;return function(_0x16ee63){logger[_0xdc30('0x27')](_0x16ee63['stack']);if(_0x16ee63['name']){delete _0x16ee63[_0xdc30('0x28')];}_0x4c0725['status'](_0x2c1af3)[_0xdc30('0x29')](_0x16ee63);};}exports[_0xdc30('0x2a')]=function(_0x457574,_0x373ad7){var _0x1f4553={},_0x2c309e={},_0x50fa33={'count':0x0,'rows':[]};var _0x2b29c6=_[_0xdc30('0x2b')](db[_0xdc30('0x2c')][_0xdc30('0x2d')],function(_0x26a250){return{'name':_0x26a250['fieldName'],'type':_0x26a250[_0xdc30('0x2e')][_0xdc30('0x2f')]};});_0x2c309e[_0xdc30('0x30')]=_[_0xdc30('0x2b')](_0x2b29c6,'name');_0x2c309e[_0xdc30('0x31')]=_[_0xdc30('0x32')](_0x457574[_0xdc30('0x31')]);_0x2c309e[_0xdc30('0x33')]=_[_0xdc30('0x34')](_0x2c309e[_0xdc30('0x30')],_0x2c309e[_0xdc30('0x31')]);_0x1f4553[_0xdc30('0x35')]=_[_0xdc30('0x34')](_0x2c309e[_0xdc30('0x30')],qs['fields'](_0x457574[_0xdc30('0x31')][_0xdc30('0x36')]));_0x1f4553[_0xdc30('0x35')]=_0x1f4553[_0xdc30('0x35')][_0xdc30('0x37')]?_0x1f4553['attributes']:_0x2c309e[_0xdc30('0x30')];if(!_0x457574[_0xdc30('0x31')][_0xdc30('0x38')](_0xdc30('0x39'))){_0x1f4553[_0xdc30('0x1e')]=qs[_0xdc30('0x1e')](_0x457574[_0xdc30('0x31')][_0xdc30('0x1e')]);_0x1f4553[_0xdc30('0x1c')]=qs['offset'](_0x457574[_0xdc30('0x31')][_0xdc30('0x1c')]);}_0x1f4553[_0xdc30('0x3a')]=qs[_0xdc30('0x3b')](_0x457574[_0xdc30('0x31')][_0xdc30('0x3b')]);_0x1f4553[_0xdc30('0x3c')]=qs[_0xdc30('0x33')](_[_0xdc30('0x3d')](_0x457574[_0xdc30('0x31')],_0x2c309e[_0xdc30('0x33')]),_0x2b29c6);if(_0x457574[_0xdc30('0x31')][_0xdc30('0x3e')]){_0x1f4553[_0xdc30('0x3c')]=_[_0xdc30('0x3f')](_0x1f4553[_0xdc30('0x3c')],{'$or':_[_0xdc30('0x2b')](_0x2b29c6,function(_0x58ec72){if(_0x58ec72[_0xdc30('0x2e')]!==_0xdc30('0x40')){var _0x5b729d={};_0x5b729d[_0x58ec72[_0xdc30('0x28')]]={'$like':'%'+_0x457574[_0xdc30('0x31')][_0xdc30('0x3e')]+'%'};return _0x5b729d;}})});}_0x1f4553=_[_0xdc30('0x3f')]({},_0x1f4553,_0x457574[_0xdc30('0x41')]);var _0x1d42af={'where':_0x1f4553['where']};return db[_0xdc30('0x2c')]['count'](_0x1d42af)[_0xdc30('0x24')](function(_0x231a19){_0x50fa33['count']=_0x231a19;if(_0x457574[_0xdc30('0x31')][_0xdc30('0x42')]){_0x1f4553[_0xdc30('0x43')]=[{'all':!![]}];}return db[_0xdc30('0x2c')][_0xdc30('0x44')](_0x1f4553);})[_0xdc30('0x24')](function(_0x4315cd){_0x50fa33[_0xdc30('0x45')]=_0x4315cd;return _0x50fa33;})[_0xdc30('0x24')](respondWithFilteredResult(_0x373ad7,_0x1f4553))[_0xdc30('0x46')](handleError(_0x373ad7,null));};exports[_0xdc30('0x47')]=function(_0x5eee5b,_0x36990f){var _0x57017d={'raw':!![],'where':{'id':_0x5eee5b['params']['id']}},_0x3bcf03={};_0x3bcf03[_0xdc30('0x30')]=_[_0xdc30('0x32')](db[_0xdc30('0x2c')]['rawAttributes']);_0x3bcf03[_0xdc30('0x31')]=_[_0xdc30('0x32')](_0x5eee5b['query']);_0x3bcf03[_0xdc30('0x33')]=_[_0xdc30('0x34')](_0x3bcf03[_0xdc30('0x30')],_0x3bcf03[_0xdc30('0x31')]);_0x57017d['attributes']=_[_0xdc30('0x34')](_0x3bcf03[_0xdc30('0x30')],qs[_0xdc30('0x36')](_0x5eee5b[_0xdc30('0x31')][_0xdc30('0x36')]));_0x57017d[_0xdc30('0x35')]=_0x57017d[_0xdc30('0x35')][_0xdc30('0x37')]?_0x57017d[_0xdc30('0x35')]:_0x3bcf03[_0xdc30('0x30')];if(_0x5eee5b[_0xdc30('0x31')][_0xdc30('0x42')]){_0x57017d[_0xdc30('0x43')]=[{'all':!![]}];}_0x57017d=_[_0xdc30('0x3f')]({},_0x57017d,_0x5eee5b['options']);return db['FaxQueueReport'][_0xdc30('0x48')](_0x57017d)[_0xdc30('0x24')](handleEntityNotFound(_0x36990f,null))[_0xdc30('0x24')](respondWithResult(_0x36990f,null))[_0xdc30('0x46')](handleError(_0x36990f,null));};exports[_0xdc30('0x49')]=function(_0x416277,_0x1b6c0b){return db[_0xdc30('0x2c')][_0xdc30('0x49')](_0x416277['body'],{})[_0xdc30('0x24')](respondWithResult(_0x1b6c0b,0xc9))['catch'](handleError(_0x1b6c0b,null));};exports[_0xdc30('0x4a')]=function(_0x5036b2,_0x4afdcf){if(_0x5036b2['body']['id']){delete _0x5036b2[_0xdc30('0x4b')]['id'];}return db[_0xdc30('0x2c')][_0xdc30('0x48')]({'where':{'id':_0x5036b2[_0xdc30('0x4c')]['id']}})[_0xdc30('0x24')](handleEntityNotFound(_0x4afdcf,null))[_0xdc30('0x24')](saveUpdates(_0x5036b2[_0xdc30('0x4b')],null))[_0xdc30('0x24')](respondWithResult(_0x4afdcf,null))[_0xdc30('0x46')](handleError(_0x4afdcf,null));};exports[_0xdc30('0x25')]=function(_0x2282ea,_0x169f1c){return db[_0xdc30('0x2c')]['find']({'where':{'id':_0x2282ea['params']['id']}})[_0xdc30('0x24')](handleEntityNotFound(_0x169f1c,null))[_0xdc30('0x24')](removeEntity(_0x169f1c,null))[_0xdc30('0x46')](handleError(_0x169f1c,null));};exports[_0xdc30('0x4d')]=function(_0x254182,_0x33f4cb){return db[_0xdc30('0x2c')][_0xdc30('0x4d')]()[_0xdc30('0x24')](respondWithResult(_0x33f4cb,null))[_0xdc30('0x46')](handleError(_0x33f4cb,null));};
\ No newline at end of file
+var _0xae7b=['save','update','then','sendStatus','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x3c6a24,_0x46e9d6){var _0x4ca954=function(_0x1094ad){while(--_0x1094ad){_0x3c6a24['push'](_0x3c6a24['shift']());}};_0x4ca954(++_0x46e9d6);}(_0xae7b,0xbe));var _0xbae7=function(_0x4f0057,_0x23c77a){_0x4f0057=_0x4f0057-0x0;var _0x45e03a=_0xae7b[_0x4f0057];return _0x45e03a;};'use strict';var emlformat=require(_0xbae7('0x0'));var rimraf=require(_0xbae7('0x1'));var zipdir=require(_0xbae7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var Mustache=require(_0xbae7('0x5'));var util=require(_0xbae7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae7('0x7'));var ejs=require(_0xbae7('0x8'));var fs=require('fs');var fs_extra=require(_0xbae7('0x9'));var _=require('lodash');var squel=require(_0xbae7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbae7('0xb'));var deskjs=require(_0xbae7('0xc'));var toCsv=require(_0xbae7('0x7'));var querystring=require('querystring');var Papa=require(_0xbae7('0xd'));var Redis=require('ioredis');var authService=require(_0xbae7('0xe'));var qs=require(_0xbae7('0xf'));var as=require(_0xbae7('0x10'));var hardwareService=require(_0xbae7('0x11'));var logger=require('../../config/logger')(_0xbae7('0x12'));var utils=require(_0xbae7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d17ae,_0x4090a1){_0x4090a1=_0x4090a1||0xcc;return function(_0x5b1abe){if(_0x5b1abe){return _0x3d17ae['sendStatus'](_0x4090a1);}return _0x3d17ae[_0xbae7('0x15')](_0x4090a1)[_0xbae7('0x16')]();};}function respondWithResult(_0x43e4ca,_0x25d1a){_0x25d1a=_0x25d1a||0xc8;return function(_0x4cc0a9){if(_0x4cc0a9){return _0x43e4ca[_0xbae7('0x15')](_0x25d1a)['json'](_0x4cc0a9);}};}function respondWithFilteredResult(_0x5aae99,_0x249669){return function(_0xb272c4){if(_0xb272c4){var _0x1b9ee1=typeof _0x249669[_0xbae7('0x17')]===_0xbae7('0x18')&&typeof _0x249669[_0xbae7('0x19')]==='undefined';var _0x1b2949=_0xb272c4[_0xbae7('0x1a')];var _0x99d88=_0x1b9ee1?0x0:_0x249669[_0xbae7('0x17')];var _0x1fc9fb=_0x1b9ee1?_0xb272c4['count']:_0x249669['offset']+_0x249669['limit'];var _0xa9ed79;if(_0x1fc9fb>=_0x1b2949){_0x1fc9fb=_0x1b2949;_0xa9ed79=0xc8;}else{_0xa9ed79=0xce;}_0x5aae99[_0xbae7('0x15')](_0xa9ed79);return _0x5aae99[_0xbae7('0x1b')](_0xbae7('0x1c'),_0x99d88+'-'+_0x1fc9fb+'/'+_0x1b2949)[_0xbae7('0x1d')](_0xb272c4);}return null;};}function patchUpdates(_0x519980){return function(_0xd87dc2){try{jsonpatch[_0xbae7('0x1e')](_0xd87dc2,_0x519980,!![]);}catch(_0x34a82b){return BPromise[_0xbae7('0x1f')](_0x34a82b);}return _0xd87dc2[_0xbae7('0x20')]();};}function saveUpdates(_0x502f06,_0x32d772){return function(_0x3e4569){if(_0x3e4569){return _0x3e4569[_0xbae7('0x21')](_0x502f06)[_0xbae7('0x22')](function(_0xb5d7f3){return _0xb5d7f3;});}return null;};}function removeEntity(_0x384ea6,_0x32f8eb){return function(_0x5c0245){if(_0x5c0245){return _0x5c0245['destroy']()[_0xbae7('0x22')](function(){_0x384ea6[_0xbae7('0x15')](0xcc)[_0xbae7('0x16')]();});}};}function handleEntityNotFound(_0x375df5,_0x61170a){return function(_0x3e003d){if(!_0x3e003d){_0x375df5[_0xbae7('0x23')](0x194);}return _0x3e003d;};}function handleError(_0x1b5caa,_0x1399bc){_0x1399bc=_0x1399bc||0x1f4;return function(_0x3e104e){logger[_0xbae7('0x24')](_0x3e104e[_0xbae7('0x25')]);if(_0x3e104e['name']){delete _0x3e104e['name'];}_0x1b5caa['status'](_0x1399bc)[_0xbae7('0x26')](_0x3e104e);};}exports[_0xbae7('0x27')]=function(_0x203848,_0x12dd23){var _0x12797a={},_0x2d8202={},_0x47e12b={'count':0x0,'rows':[]};var _0x5d702f=_[_0xbae7('0x28')](db[_0xbae7('0x29')][_0xbae7('0x2a')],function(_0x258c08){return{'name':_0x258c08[_0xbae7('0x2b')],'type':_0x258c08[_0xbae7('0x2c')]['key']};});_0x2d8202[_0xbae7('0x2d')]=_[_0xbae7('0x28')](_0x5d702f,_0xbae7('0x2e'));_0x2d8202[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x203848[_0xbae7('0x2f')]);_0x2d8202[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x2d8202[_0xbae7('0x2d')],_0x2d8202[_0xbae7('0x2f')]);_0x12797a[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x2d8202['model'],qs[_0xbae7('0x34')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x12797a['attributes']=_0x12797a[_0xbae7('0x33')][_0xbae7('0x35')]?_0x12797a['attributes']:_0x2d8202[_0xbae7('0x2d')];if(!_0x203848[_0xbae7('0x2f')][_0xbae7('0x36')](_0xbae7('0x37'))){_0x12797a[_0xbae7('0x19')]=qs[_0xbae7('0x19')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x19')]);_0x12797a[_0xbae7('0x17')]=qs['offset'](_0x203848['query'][_0xbae7('0x17')]);}_0x12797a[_0xbae7('0x38')]=qs['sort'](_0x203848[_0xbae7('0x2f')][_0xbae7('0x39')]);_0x12797a[_0xbae7('0x3a')]=qs[_0xbae7('0x31')](_[_0xbae7('0x3b')](_0x203848[_0xbae7('0x2f')],_0x2d8202[_0xbae7('0x31')]),_0x5d702f);if(_0x203848[_0xbae7('0x2f')]['filter']){_0x12797a['where']=_[_0xbae7('0x3c')](_0x12797a['where'],{'$or':_[_0xbae7('0x28')](_0x5d702f,function(_0x59e90b){if(_0x59e90b[_0xbae7('0x2c')]!==_0xbae7('0x3d')){var _0x1fdb4f={};_0x1fdb4f[_0x59e90b[_0xbae7('0x2e')]]={'$like':'%'+_0x203848[_0xbae7('0x2f')][_0xbae7('0x3e')]+'%'};return _0x1fdb4f;}})});}_0x12797a=_['merge']({},_0x12797a,_0x203848[_0xbae7('0x3f')]);var _0x4fa0ba={'where':_0x12797a['where']};return db[_0xbae7('0x29')][_0xbae7('0x1a')](_0x4fa0ba)[_0xbae7('0x22')](function(_0xc1c69e){_0x47e12b[_0xbae7('0x1a')]=_0xc1c69e;if(_0x203848['query'][_0xbae7('0x40')]){_0x12797a[_0xbae7('0x41')]=[{'all':!![]}];}return db[_0xbae7('0x29')][_0xbae7('0x42')](_0x12797a);})[_0xbae7('0x22')](function(_0x5047b0){_0x47e12b[_0xbae7('0x43')]=_0x5047b0;return _0x47e12b;})['then'](respondWithFilteredResult(_0x12dd23,_0x12797a))[_0xbae7('0x44')](handleError(_0x12dd23,null));};exports[_0xbae7('0x45')]=function(_0x3647a8,_0x472686){var _0x1895ef={'raw':!![],'where':{'id':_0x3647a8[_0xbae7('0x46')]['id']}},_0x57f345={};_0x57f345[_0xbae7('0x2d')]=_[_0xbae7('0x30')](db[_0xbae7('0x29')][_0xbae7('0x2a')]);_0x57f345[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x3647a8['query']);_0x57f345[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x57f345[_0xbae7('0x2d')],_0x57f345[_0xbae7('0x2f')]);_0x1895ef[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x57f345['model'],qs['fields'](_0x3647a8[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x1895ef['attributes']=_0x1895ef[_0xbae7('0x33')][_0xbae7('0x35')]?_0x1895ef[_0xbae7('0x33')]:_0x57f345[_0xbae7('0x2d')];if(_0x3647a8[_0xbae7('0x2f')]['includeAll']){_0x1895ef[_0xbae7('0x41')]=[{'all':!![]}];}_0x1895ef=_[_0xbae7('0x3c')]({},_0x1895ef,_0x3647a8[_0xbae7('0x3f')]);return db[_0xbae7('0x29')]['find'](_0x1895ef)[_0xbae7('0x22')](handleEntityNotFound(_0x472686,null))[_0xbae7('0x22')](respondWithResult(_0x472686,null))[_0xbae7('0x44')](handleError(_0x472686,null));};exports[_0xbae7('0x47')]=function(_0x50b52b,_0x11722e){return db[_0xbae7('0x29')][_0xbae7('0x47')](_0x50b52b[_0xbae7('0x48')],{})['then'](respondWithResult(_0x11722e,0xc9))[_0xbae7('0x44')](handleError(_0x11722e,null));};exports[_0xbae7('0x21')]=function(_0xb6df1f,_0x363b7b){if(_0xb6df1f[_0xbae7('0x48')]['id']){delete _0xb6df1f['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0xb6df1f[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x363b7b,null))[_0xbae7('0x22')](saveUpdates(_0xb6df1f[_0xbae7('0x48')],null))[_0xbae7('0x22')](respondWithResult(_0x363b7b,null))['catch'](handleError(_0x363b7b,null));};exports['destroy']=function(_0x1bb00a,_0x46f0a9){return db[_0xbae7('0x29')]['find']({'where':{'id':_0x1bb00a[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x46f0a9,null))[_0xbae7('0x22')](removeEntity(_0x46f0a9,null))[_0xbae7('0x44')](handleError(_0x46f0a9,null));};exports[_0xbae7('0x49')]=function(_0x4cf377,_0x2ccd2c){return db['FaxQueueReport'][_0xbae7('0x49')]()[_0xbae7('0x22')](respondWithResult(_0x2ccd2c,null))[_0xbae7('0x44')](handleError(_0x2ccd2c,null));};
\ No newline at end of file
index 343dde5..6ea96a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x814b,0x1a2));var _0xb814=function(_0x4c11f7,_0x5a0447){_0x4c11f7=_0x4c11f7-0x0;var _0x587d6b=_0x814b[_0x4c11f7];return _0x587d6b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x5e00a0,_0x39b979){var _0x4cf2af=function(_0x890e8c){while(--_0x890e8c){_0x5e00a0['push'](_0x5e00a0['shift']());}};_0x4cf2af(++_0x39b979);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4a231f,_0x1989a6){_0x4a231f=_0x4a231f-0x0;var _0x7ea6bf=_0x7fbe[_0x4a231f];return _0x7ea6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a365df1..b69f03a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8354=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxQueueReport','create','body','options','debug','CreateFaxQueueReport','catch','UpdateFaxQueueReport','update','raw','attributes','limit','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8354,0x16a));var _0x4835=function(_0x45ebc0,_0x3c8485){_0x45ebc0=_0x45ebc0-0x0;var _0x2603c9=_0x8354[_0x45ebc0];return _0x2603c9;};'use strict';var _=require(_0x4835('0x0'));var util=require(_0x4835('0x1'));var moment=require(_0x4835('0x2'));var BPromise=require(_0x4835('0x3'));var rs=require(_0x4835('0x4'));var fs=require('fs');var Redis=require(_0x4835('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4835('0x6'));var logger=require('../../config/logger')(_0x4835('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4835('0x8')][_0x4835('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ddfa7,_0x2ecaac,_0xac1d1e){return new BPromise(function(_0x3d0504,_0x318f95){return client[_0x4835('0xa')](_0x3ddfa7,_0xac1d1e)[_0x4835('0xb')](function(_0xd63f0a){logger[_0x4835('0xc')](_0x4835('0xd'),_0x2ecaac,_0x4835('0xe'));logger['debug'](_0x4835('0xf'),_0x2ecaac,'request\x20sent',JSON[_0x4835('0x10')](_0xd63f0a));if(_0xd63f0a['error']){if(_0xd63f0a[_0x4835('0x11')][_0x4835('0x12')]===0x1f4){logger['error'](_0x4835('0xd'),_0x2ecaac,_0xd63f0a[_0x4835('0x11')][_0x4835('0x13')]);return _0x318f95(_0xd63f0a[_0x4835('0x11')]['message']);}logger[_0x4835('0x11')](_0x4835('0xd'),_0x2ecaac,_0xd63f0a[_0x4835('0x11')]['message']);return _0x3d0504(_0xd63f0a[_0x4835('0x11')][_0x4835('0x13')]);}else{logger[_0x4835('0xc')](_0x4835('0xd'),_0x2ecaac,'request\x20sent');_0x3d0504(_0xd63f0a[_0x4835('0x14')][_0x4835('0x13')]);}})['catch'](function(_0x1ee5c6){logger[_0x4835('0x11')](_0x4835('0xd'),_0x2ecaac,_0x1ee5c6);_0x318f95(_0x1ee5c6);});});}exports['CreateFaxQueueReport']=function(_0x2d7b73){var _0xcbc2d6=this;return new Promise(function(_0x52eb76,_0x120418){return db[_0x4835('0x15')][_0x4835('0x16')](_0x2d7b73[_0x4835('0x17')],{'raw':_0x2d7b73[_0x4835('0x18')]?_0x2d7b73[_0x4835('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4a45f3){logger['info']('CreateFaxQueueReport',_0x2d7b73);logger[_0x4835('0x19')](_0x4835('0x1a'),_0x2d7b73,JSON['stringify'](_0x4a45f3));_0x52eb76(_0x4a45f3);})[_0x4835('0x1b')](function(_0xc86467){logger[_0x4835('0x11')]('CreateFaxQueueReport',_0xc86467[_0x4835('0x13')],_0x2d7b73);_0x120418(_0xcbc2d6['error'](0x1f4,_0xc86467[_0x4835('0x13')]));});});};exports[_0x4835('0x1c')]=function(_0x4ea75a){var _0x5dc5a9=this;return new Promise(function(_0x3e8c40,_0x1908de){return db[_0x4835('0x15')][_0x4835('0x1d')](_0x4ea75a[_0x4835('0x17')],{'raw':_0x4ea75a['options']?_0x4ea75a[_0x4835('0x18')][_0x4835('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ea75a[_0x4835('0x18')]?_0x4ea75a[_0x4835('0x18')]['where']||null:null,'attributes':_0x4ea75a[_0x4835('0x18')]?_0x4ea75a[_0x4835('0x18')][_0x4835('0x1f')]||null:null,'limit':_0x4ea75a[_0x4835('0x18')]?_0x4ea75a[_0x4835('0x18')][_0x4835('0x20')]||null:null})[_0x4835('0xb')](function(_0x545885){logger[_0x4835('0xc')](_0x4835('0x1c'),_0x4ea75a);logger['debug'](_0x4835('0x1c'),_0x4ea75a,JSON[_0x4835('0x10')](_0x545885));_0x3e8c40(_0x545885);})[_0x4835('0x1b')](function(_0x425237){logger[_0x4835('0x11')](_0x4835('0x1c'),_0x425237[_0x4835('0x13')],_0x4ea75a);_0x1908de(_0x5dc5a9[_0x4835('0x11')](0x1f4,_0x425237['message']));});});};
\ No newline at end of file
+var _0x176c=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1a2795,_0x41fab4){var _0x5b9498=function(_0xd84e8){while(--_0xd84e8){_0x1a2795['push'](_0x1a2795['shift']());}};_0x5b9498(++_0x41fab4);}(_0x176c,0x13a));var _0xc176=function(_0x5f1c4f,_0x401d14){_0x5f1c4f=_0x5f1c4f-0x0;var _0x1d0432=_0x176c[_0x5f1c4f];return _0x1d0432;};'use strict';var _=require(_0xc176('0x0'));var util=require(_0xc176('0x1'));var moment=require(_0xc176('0x2'));var BPromise=require('bluebird');var rs=require(_0xc176('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc176('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc176('0x5'))(_0xc176('0x6'));var config=require(_0xc176('0x7'));var jayson=require(_0xc176('0x8'));var client=jayson[_0xc176('0x9')][_0xc176('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ed5f8,_0x344098,_0x153664){return new BPromise(function(_0x203b40,_0x54d27c){return client[_0xc176('0xb')](_0x3ed5f8,_0x153664)[_0xc176('0xc')](function(_0x1310a5){logger[_0xc176('0xd')](_0xc176('0xe'),_0x344098,_0xc176('0xf'));logger[_0xc176('0x10')](_0xc176('0x11'),_0x344098,_0xc176('0xf'),JSON[_0xc176('0x12')](_0x1310a5));if(_0x1310a5[_0xc176('0x13')]){if(_0x1310a5[_0xc176('0x13')][_0xc176('0x14')]===0x1f4){logger['error'](_0xc176('0xe'),_0x344098,_0x1310a5[_0xc176('0x13')][_0xc176('0x15')]);return _0x54d27c(_0x1310a5['error']['message']);}logger[_0xc176('0x13')](_0xc176('0xe'),_0x344098,_0x1310a5['error']['message']);return _0x203b40(_0x1310a5[_0xc176('0x13')]['message']);}else{logger[_0xc176('0xd')](_0xc176('0xe'),_0x344098,'request\x20sent');_0x203b40(_0x1310a5['result'][_0xc176('0x15')]);}})[_0xc176('0x16')](function(_0x5e4c66){logger[_0xc176('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x344098,_0x5e4c66);_0x54d27c(_0x5e4c66);});});}exports[_0xc176('0x17')]=function(_0x41e03e){var _0x42c5ad=this;return new Promise(function(_0x2273d0,_0x39d2b6){return db[_0xc176('0x18')][_0xc176('0x19')](_0x41e03e[_0xc176('0x1a')],{'raw':_0x41e03e['options']?_0x41e03e[_0xc176('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xc176('0xc')](function(_0x4dc8b4){logger[_0xc176('0xd')]('CreateFaxQueueReport',_0x41e03e);logger[_0xc176('0x10')](_0xc176('0x17'),_0x41e03e,JSON[_0xc176('0x12')](_0x4dc8b4));_0x2273d0(_0x4dc8b4);})[_0xc176('0x16')](function(_0x242a13){logger[_0xc176('0x13')]('CreateFaxQueueReport',_0x242a13[_0xc176('0x15')],_0x41e03e);_0x39d2b6(_0x42c5ad[_0xc176('0x13')](0x1f4,_0x242a13[_0xc176('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0xadbff){var _0x5b93b4=this;return new Promise(function(_0x2fe421,_0x19e4cf){return db[_0xc176('0x18')]['update'](_0xadbff[_0xc176('0x1a')],{'raw':_0xadbff[_0xc176('0x1b')]?_0xadbff[_0xc176('0x1b')][_0xc176('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xadbff[_0xc176('0x1b')]?_0xadbff[_0xc176('0x1b')]['where']||null:null,'attributes':_0xadbff[_0xc176('0x1b')]?_0xadbff['options']['attributes']||null:null,'limit':_0xadbff[_0xc176('0x1b')]?_0xadbff[_0xc176('0x1b')]['limit']||null:null})['then'](function(_0x26187f){logger[_0xc176('0xd')](_0xc176('0x1d'),_0xadbff);logger['debug']('UpdateFaxQueueReport',_0xadbff,JSON['stringify'](_0x26187f));_0x2fe421(_0x26187f);})[_0xc176('0x16')](function(_0x266c8b){logger[_0xc176('0x13')](_0xc176('0x1d'),_0x266c8b[_0xc176('0x15')],_0xadbff);_0x19e4cf(_0x5b93b4[_0xc176('0x13')](0x1f4,_0x266c8b['message']));});});};
\ No newline at end of file
index 8543152..1a86d64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a5c=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x46aad9,_0xb6e3ef){var _0xd6488d=function(_0x2937c5){while(--_0x2937c5){_0x46aad9['push'](_0x46aad9['shift']());}};_0xd6488d(++_0xb6e3ef);}(_0x7a5c,0xf2));var _0xc7a5=function(_0x244a58,_0x4bc4e1){_0x244a58=_0x244a58-0x0;var _0x2b77d2=_0x7a5c[_0x244a58];return _0x2b77d2;};'use strict';var multer=require(_0xc7a5('0x0'));var util=require(_0xc7a5('0x1'));var path=require(_0xc7a5('0x2'));var timeout=require(_0xc7a5('0x3'));var express=require('express');var router=express[_0xc7a5('0x4')]();var fs_extra=require(_0xc7a5('0x5'));var auth=require(_0xc7a5('0x6'));var interaction=require(_0xc7a5('0x7'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xc7a5('0x8')]('/',auth['isAuthenticated'](),controller[_0xc7a5('0x9')]);router[_0xc7a5('0x8')](_0xc7a5('0xa'),auth[_0xc7a5('0xb')](),controller['describe']);router[_0xc7a5('0x8')](_0xc7a5('0xc'),auth[_0xc7a5('0xb')](),controller[_0xc7a5('0xd')]);router[_0xc7a5('0xe')]('/',auth[_0xc7a5('0xb')](),controller[_0xc7a5('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc7a5('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc7a5('0x11')]);module[_0xc7a5('0x12')]=router;
\ No newline at end of file
+var _0x276b=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ce67b,_0x5d1e9f){var _0xc64cb0=function(_0x376ce4){while(--_0x376ce4){_0x1ce67b['push'](_0x1ce67b['shift']());}};_0xc64cb0(++_0x5d1e9f);}(_0x276b,0x13a));var _0xb276=function(_0x30ebbe,_0x52aef1){_0x30ebbe=_0x30ebbe-0x0;var _0x2b818c=_0x276b[_0x30ebbe];return _0x2b818c;};'use strict';var multer=require(_0xb276('0x0'));var util=require(_0xb276('0x1'));var path=require(_0xb276('0x2'));var timeout=require(_0xb276('0x3'));var express=require(_0xb276('0x4'));var router=express[_0xb276('0x5')]();var fs_extra=require(_0xb276('0x6'));var auth=require(_0xb276('0x7'));var interaction=require(_0xb276('0x8'));var config=require(_0xb276('0x9'));var controller=require(_0xb276('0xa'));router[_0xb276('0xb')]('/',auth[_0xb276('0xc')](),controller[_0xb276('0xd')]);router[_0xb276('0xb')](_0xb276('0xe'),auth[_0xb276('0xc')](),controller['describe']);router['get'](_0xb276('0xf'),auth[_0xb276('0xc')](),controller[_0xb276('0x10')]);router[_0xb276('0x11')]('/',auth[_0xb276('0xc')](),controller[_0xb276('0x12')]);router['put'](_0xb276('0xf'),auth[_0xb276('0xc')](),controller[_0xb276('0x13')]);router[_0xb276('0x14')](_0xb276('0xf'),auth['isAuthenticated'](),controller[_0xb276('0x15')]);module[_0xb276('0x16')]=router;
\ No newline at end of file
index 351ce34..19c9139 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4468b3,_0x22732b){var _0x54f04f=function(_0x56ea52){while(--_0x56ea52){_0x4468b3['push'](_0x4468b3['shift']());}};_0x54f04f(++_0x22732b);}(_0xaa88,0x137));var _0x8aa8=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xaa88[_0x5f0089];return _0x193892;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x161b14,_0x7f0c40){_0x161b14=_0x161b14-0x0;var _0x314851=_0xb43b[_0x161b14];return _0x314851;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
index e79dca5..c9d63c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa435=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','query'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0xa435,0x18b));var _0x5a43=function(_0x394d53,_0x48a160){_0x394d53=_0x394d53-0x0;var _0x240632=_0xa435[_0x394d53];return _0x240632;};'use strict';var emlformat=require(_0x5a43('0x0'));var rimraf=require(_0x5a43('0x1'));var zipdir=require(_0x5a43('0x2'));var jsonpatch=require(_0x5a43('0x3'));var rp=require(_0x5a43('0x4'));var moment=require(_0x5a43('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a43('0x6'));var path=require(_0x5a43('0x7'));var sox=require(_0x5a43('0x8'));var csv=require(_0x5a43('0x9'));var ejs=require(_0x5a43('0xa'));var fs=require('fs');var fs_extra=require(_0x5a43('0xb'));var _=require(_0x5a43('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a43('0xd'));var Papa=require(_0x5a43('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5a43('0xf'));var as=require(_0x5a43('0x10'));var hardwareService=require(_0x5a43('0x11'));var logger=require(_0x5a43('0x12'))(_0x5a43('0x13'));var utils=require(_0x5a43('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5a43('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f3c78,_0x2bdeb1){_0x2bdeb1=_0x2bdeb1||0xcc;return function(_0x4be967){if(_0x4be967){return _0x5f3c78[_0x5a43('0x16')](_0x2bdeb1);}return _0x5f3c78[_0x5a43('0x17')](_0x2bdeb1)['end']();};}function respondWithResult(_0x245c25,_0x2b4609){_0x2b4609=_0x2b4609||0xc8;return function(_0xe42955){if(_0xe42955){return _0x245c25[_0x5a43('0x17')](_0x2b4609)[_0x5a43('0x18')](_0xe42955);}};}function respondWithFilteredResult(_0x5588d3,_0x657284){return function(_0x3bdc55){if(_0x3bdc55){var _0x42ae1b=typeof _0x657284['offset']==='undefined'&&typeof _0x657284['limit']===_0x5a43('0x19');var _0x1e90c8=_0x3bdc55[_0x5a43('0x1a')];var _0x58249f=_0x42ae1b?0x0:_0x657284[_0x5a43('0x1b')];var _0x42c57e=_0x42ae1b?_0x3bdc55[_0x5a43('0x1a')]:_0x657284[_0x5a43('0x1b')]+_0x657284[_0x5a43('0x1c')];var _0x505a79;if(_0x42c57e>=_0x1e90c8){_0x42c57e=_0x1e90c8;_0x505a79=0xc8;}else{_0x505a79=0xce;}_0x5588d3[_0x5a43('0x17')](_0x505a79);return _0x5588d3[_0x5a43('0x1d')](_0x5a43('0x1e'),_0x58249f+'-'+_0x42c57e+'/'+_0x1e90c8)[_0x5a43('0x18')](_0x3bdc55);}return null;};}function patchUpdates(_0x575f19){return function(_0x4e32f1){try{jsonpatch[_0x5a43('0x1f')](_0x4e32f1,_0x575f19,!![]);}catch(_0x2ae291){return BPromise[_0x5a43('0x20')](_0x2ae291);}return _0x4e32f1[_0x5a43('0x21')]();};}function saveUpdates(_0x3937e9,_0x27aac7){return function(_0x203e67){if(_0x203e67){return _0x203e67[_0x5a43('0x22')](_0x3937e9)['then'](function(_0x1a0724){return _0x1a0724;});}return null;};}function removeEntity(_0x2875e8,_0x1556f3){return function(_0x508fd4){if(_0x508fd4){return _0x508fd4[_0x5a43('0x23')]()[_0x5a43('0x24')](function(){_0x2875e8[_0x5a43('0x17')](0xcc)[_0x5a43('0x25')]();});}};}function handleEntityNotFound(_0x14d4b2,_0x51a4cf){return function(_0x323350){if(!_0x323350){_0x14d4b2['sendStatus'](0x194);}return _0x323350;};}function handleError(_0xff000d,_0x13e7de){_0x13e7de=_0x13e7de||0x1f4;return function(_0x4c23fa){logger[_0x5a43('0x26')](_0x4c23fa[_0x5a43('0x27')]);if(_0x4c23fa[_0x5a43('0x28')]){delete _0x4c23fa[_0x5a43('0x28')];}_0xff000d[_0x5a43('0x17')](_0x13e7de)['send'](_0x4c23fa);};}exports[_0x5a43('0x29')]=function(_0xded427,_0x52bbd7){var _0x7b143b={},_0x35ca9f={},_0x2e53cb={'count':0x0,'rows':[]};var _0xd7d4c8=_[_0x5a43('0x2a')](db[_0x5a43('0x2b')][_0x5a43('0x2c')],function(_0x7c8453){return{'name':_0x7c8453[_0x5a43('0x2d')],'type':_0x7c8453['type'][_0x5a43('0x2e')]};});_0x35ca9f[_0x5a43('0x2f')]=_[_0x5a43('0x2a')](_0xd7d4c8,_0x5a43('0x28'));_0x35ca9f[_0x5a43('0x30')]=_[_0x5a43('0x31')](_0xded427[_0x5a43('0x30')]);_0x35ca9f[_0x5a43('0x32')]=_[_0x5a43('0x33')](_0x35ca9f[_0x5a43('0x2f')],_0x35ca9f[_0x5a43('0x30')]);_0x7b143b[_0x5a43('0x34')]=_[_0x5a43('0x33')](_0x35ca9f[_0x5a43('0x2f')],qs[_0x5a43('0x35')](_0xded427[_0x5a43('0x30')]['fields']));_0x7b143b[_0x5a43('0x34')]=_0x7b143b[_0x5a43('0x34')][_0x5a43('0x36')]?_0x7b143b[_0x5a43('0x34')]:_0x35ca9f[_0x5a43('0x2f')];if(!_0xded427[_0x5a43('0x30')][_0x5a43('0x37')]('nolimit')){_0x7b143b['limit']=qs[_0x5a43('0x1c')](_0xded427[_0x5a43('0x30')]['limit']);_0x7b143b[_0x5a43('0x1b')]=qs[_0x5a43('0x1b')](_0xded427['query'][_0x5a43('0x1b')]);}_0x7b143b[_0x5a43('0x38')]=qs[_0x5a43('0x39')](_0xded427['query'][_0x5a43('0x39')]);_0x7b143b[_0x5a43('0x3a')]=qs[_0x5a43('0x32')](_['pick'](_0xded427[_0x5a43('0x30')],_0x35ca9f['filters']),_0xd7d4c8);if(_0xded427[_0x5a43('0x30')]['filter']){_0x7b143b[_0x5a43('0x3a')]=_[_0x5a43('0x3b')](_0x7b143b[_0x5a43('0x3a')],{'$or':_[_0x5a43('0x2a')](_0xd7d4c8,function(_0x22a177){if(_0x22a177[_0x5a43('0x3c')]!=='VIRTUAL'){var _0x372e35={};_0x372e35[_0x22a177[_0x5a43('0x28')]]={'$like':'%'+_0xded427['query'][_0x5a43('0x3d')]+'%'};return _0x372e35;}})});}_0x7b143b=_[_0x5a43('0x3b')]({},_0x7b143b,_0xded427[_0x5a43('0x3e')]);var _0x45b7f5={'where':_0x7b143b[_0x5a43('0x3a')]};return db['FaxTransferReport'][_0x5a43('0x1a')](_0x45b7f5)[_0x5a43('0x24')](function(_0x190b98){_0x2e53cb[_0x5a43('0x1a')]=_0x190b98;if(_0xded427[_0x5a43('0x30')]['includeAll']){_0x7b143b[_0x5a43('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x5a43('0x40')](_0x7b143b);})[_0x5a43('0x24')](function(_0x23fa5c){_0x2e53cb[_0x5a43('0x41')]=_0x23fa5c;return _0x2e53cb;})[_0x5a43('0x24')](respondWithFilteredResult(_0x52bbd7,_0x7b143b))[_0x5a43('0x42')](handleError(_0x52bbd7,null));};exports[_0x5a43('0x43')]=function(_0x5ce787,_0x474e65){var _0x24bb0e={'raw':!![],'where':{'id':_0x5ce787[_0x5a43('0x44')]['id']}},_0x5dda75={};_0x5dda75[_0x5a43('0x2f')]=_[_0x5a43('0x31')](db['FaxTransferReport'][_0x5a43('0x2c')]);_0x5dda75['query']=_[_0x5a43('0x31')](_0x5ce787[_0x5a43('0x30')]);_0x5dda75[_0x5a43('0x32')]=_['intersection'](_0x5dda75[_0x5a43('0x2f')],_0x5dda75[_0x5a43('0x30')]);_0x24bb0e[_0x5a43('0x34')]=_[_0x5a43('0x33')](_0x5dda75['model'],qs['fields'](_0x5ce787['query'][_0x5a43('0x35')]));_0x24bb0e[_0x5a43('0x34')]=_0x24bb0e[_0x5a43('0x34')]['length']?_0x24bb0e['attributes']:_0x5dda75[_0x5a43('0x2f')];if(_0x5ce787[_0x5a43('0x30')][_0x5a43('0x45')]){_0x24bb0e[_0x5a43('0x3f')]=[{'all':!![]}];}_0x24bb0e=_[_0x5a43('0x3b')]({},_0x24bb0e,_0x5ce787[_0x5a43('0x3e')]);return db['FaxTransferReport'][_0x5a43('0x46')](_0x24bb0e)[_0x5a43('0x24')](handleEntityNotFound(_0x474e65,null))[_0x5a43('0x24')](respondWithResult(_0x474e65,null))[_0x5a43('0x42')](handleError(_0x474e65,null));};exports[_0x5a43('0x47')]=function(_0x1477ab,_0x40d3ba){return db['FaxTransferReport']['create'](_0x1477ab[_0x5a43('0x48')],{})[_0x5a43('0x24')](respondWithResult(_0x40d3ba,0xc9))[_0x5a43('0x42')](handleError(_0x40d3ba,null));};exports[_0x5a43('0x22')]=function(_0x12b1d0,_0x4a0d86){if(_0x12b1d0[_0x5a43('0x48')]['id']){delete _0x12b1d0['body']['id'];}return db[_0x5a43('0x2b')][_0x5a43('0x46')]({'where':{'id':_0x12b1d0[_0x5a43('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a0d86,null))[_0x5a43('0x24')](saveUpdates(_0x12b1d0[_0x5a43('0x48')],null))[_0x5a43('0x24')](respondWithResult(_0x4a0d86,null))[_0x5a43('0x42')](handleError(_0x4a0d86,null));};exports[_0x5a43('0x23')]=function(_0x21c8f0,_0x23fb4d){return db['FaxTransferReport'][_0x5a43('0x46')]({'where':{'id':_0x21c8f0[_0x5a43('0x44')]['id']}})['then'](handleEntityNotFound(_0x23fb4d,null))[_0x5a43('0x24')](removeEntity(_0x23fb4d,null))[_0x5a43('0x42')](handleError(_0x23fb4d,null));};exports[_0x5a43('0x49')]=function(_0x3eb609,_0x3c92c2){return db['FaxTransferReport'][_0x5a43('0x49')]()['then'](respondWithResult(_0x3c92c2,null))['catch'](handleError(_0x3c92c2,null));};
\ No newline at end of file
+var _0xb702=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model'];(function(_0x2c0abe,_0x2a14c4){var _0x1b0041=function(_0x5642cf){while(--_0x5642cf){_0x2c0abe['push'](_0x2c0abe['shift']());}};_0x1b0041(++_0x2a14c4);}(_0xb702,0x65));var _0x2b70=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xb702[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0x2b70('0x0'));var rimraf=require(_0x2b70('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2b70('0x2'));var moment=require(_0x2b70('0x3'));var BPromise=require(_0x2b70('0x4'));var Mustache=require(_0x2b70('0x5'));var util=require('util');var path=require(_0x2b70('0x6'));var sox=require(_0x2b70('0x7'));var csv=require(_0x2b70('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b70('0x9'));var squel=require(_0x2b70('0xa'));var crypto=require(_0x2b70('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2b70('0xc'));var toCsv=require(_0x2b70('0x8'));var querystring=require('querystring');var Papa=require(_0x2b70('0xd'));var Redis=require('ioredis');var authService=require(_0x2b70('0xe'));var qs=require(_0x2b70('0xf'));var as=require(_0x2b70('0x10'));var hardwareService=require(_0x2b70('0x11'));var logger=require(_0x2b70('0x12'))(_0x2b70('0x13'));var utils=require(_0x2b70('0x14'));var config=require(_0x2b70('0x15'));var licenseUtil=require(_0x2b70('0x16'));var db=require(_0x2b70('0x17'))['db'];function respondWithStatusCode(_0x3b353d,_0x16d4ea){_0x16d4ea=_0x16d4ea||0xcc;return function(_0x52dc4d){if(_0x52dc4d){return _0x3b353d[_0x2b70('0x18')](_0x16d4ea);}return _0x3b353d['status'](_0x16d4ea)['end']();};}function respondWithResult(_0x201c1b,_0xd30171){_0xd30171=_0xd30171||0xc8;return function(_0x40427b){if(_0x40427b){return _0x201c1b[_0x2b70('0x19')](_0xd30171)[_0x2b70('0x1a')](_0x40427b);}};}function respondWithFilteredResult(_0x1b0f49,_0x4de320){return function(_0x298589){if(_0x298589){var _0x4962c2=typeof _0x4de320['offset']===_0x2b70('0x1b')&&typeof _0x4de320[_0x2b70('0x1c')]===_0x2b70('0x1b');var _0x239dd4=_0x298589[_0x2b70('0x1d')];var _0x2b79ef=_0x4962c2?0x0:_0x4de320[_0x2b70('0x1e')];var _0x399a14=_0x4962c2?_0x298589[_0x2b70('0x1d')]:_0x4de320[_0x2b70('0x1e')]+_0x4de320[_0x2b70('0x1c')];var _0x28ee0b;if(_0x399a14>=_0x239dd4){_0x399a14=_0x239dd4;_0x28ee0b=0xc8;}else{_0x28ee0b=0xce;}_0x1b0f49[_0x2b70('0x19')](_0x28ee0b);return _0x1b0f49[_0x2b70('0x1f')](_0x2b70('0x20'),_0x2b79ef+'-'+_0x399a14+'/'+_0x239dd4)[_0x2b70('0x1a')](_0x298589);}return null;};}function patchUpdates(_0x10dfa2){return function(_0x5db70a){try{jsonpatch['apply'](_0x5db70a,_0x10dfa2,!![]);}catch(_0x47053a){return BPromise['reject'](_0x47053a);}return _0x5db70a['save']();};}function saveUpdates(_0x491b96,_0x5bf9a3){return function(_0x121c03){if(_0x121c03){return _0x121c03[_0x2b70('0x21')](_0x491b96)[_0x2b70('0x22')](function(_0x795e90){return _0x795e90;});}return null;};}function removeEntity(_0x222179,_0x148bea){return function(_0x3f8af){if(_0x3f8af){return _0x3f8af[_0x2b70('0x23')]()[_0x2b70('0x22')](function(){_0x222179[_0x2b70('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478f4f,_0x239ed1){return function(_0x24e277){if(!_0x24e277){_0x478f4f['sendStatus'](0x194);}return _0x24e277;};}function handleError(_0x35db0e,_0x5d5366){_0x5d5366=_0x5d5366||0x1f4;return function(_0x2eace1){logger[_0x2b70('0x24')](_0x2eace1[_0x2b70('0x25')]);if(_0x2eace1[_0x2b70('0x26')]){delete _0x2eace1[_0x2b70('0x26')];}_0x35db0e[_0x2b70('0x19')](_0x5d5366)[_0x2b70('0x27')](_0x2eace1);};}exports[_0x2b70('0x28')]=function(_0xa4591c,_0xf51958){var _0x6f6982={},_0x21f2c1={},_0x50875c={'count':0x0,'rows':[]};var _0x103703=_[_0x2b70('0x29')](db[_0x2b70('0x2a')][_0x2b70('0x2b')],function(_0x51ff0f){return{'name':_0x51ff0f[_0x2b70('0x2c')],'type':_0x51ff0f[_0x2b70('0x2d')]['key']};});_0x21f2c1[_0x2b70('0x2e')]=_[_0x2b70('0x29')](_0x103703,_0x2b70('0x26'));_0x21f2c1[_0x2b70('0x2f')]=_[_0x2b70('0x30')](_0xa4591c[_0x2b70('0x2f')]);_0x21f2c1[_0x2b70('0x31')]=_[_0x2b70('0x32')](_0x21f2c1['model'],_0x21f2c1[_0x2b70('0x2f')]);_0x6f6982['attributes']=_[_0x2b70('0x32')](_0x21f2c1['model'],qs[_0x2b70('0x33')](_0xa4591c[_0x2b70('0x2f')][_0x2b70('0x33')]));_0x6f6982['attributes']=_0x6f6982[_0x2b70('0x34')][_0x2b70('0x35')]?_0x6f6982[_0x2b70('0x34')]:_0x21f2c1['model'];if(!_0xa4591c[_0x2b70('0x2f')][_0x2b70('0x36')](_0x2b70('0x37'))){_0x6f6982[_0x2b70('0x1c')]=qs['limit'](_0xa4591c[_0x2b70('0x2f')][_0x2b70('0x1c')]);_0x6f6982['offset']=qs[_0x2b70('0x1e')](_0xa4591c[_0x2b70('0x2f')]['offset']);}_0x6f6982[_0x2b70('0x38')]=qs[_0x2b70('0x39')](_0xa4591c[_0x2b70('0x2f')][_0x2b70('0x39')]);_0x6f6982[_0x2b70('0x3a')]=qs[_0x2b70('0x31')](_['pick'](_0xa4591c[_0x2b70('0x2f')],_0x21f2c1[_0x2b70('0x31')]),_0x103703);if(_0xa4591c[_0x2b70('0x2f')][_0x2b70('0x3b')]){_0x6f6982['where']=_[_0x2b70('0x3c')](_0x6f6982[_0x2b70('0x3a')],{'$or':_['map'](_0x103703,function(_0x32afbc){if(_0x32afbc[_0x2b70('0x2d')]!==_0x2b70('0x3d')){var _0x287a5d={};_0x287a5d[_0x32afbc['name']]={'$like':'%'+_0xa4591c[_0x2b70('0x2f')][_0x2b70('0x3b')]+'%'};return _0x287a5d;}})});}_0x6f6982=_[_0x2b70('0x3c')]({},_0x6f6982,_0xa4591c[_0x2b70('0x3e')]);var _0x6485c={'where':_0x6f6982['where']};return db[_0x2b70('0x2a')]['count'](_0x6485c)[_0x2b70('0x22')](function(_0x56c4e2){_0x50875c['count']=_0x56c4e2;if(_0xa4591c[_0x2b70('0x2f')][_0x2b70('0x3f')]){_0x6f6982['include']=[{'all':!![]}];}return db[_0x2b70('0x2a')][_0x2b70('0x40')](_0x6f6982);})[_0x2b70('0x22')](function(_0x264300){_0x50875c[_0x2b70('0x41')]=_0x264300;return _0x50875c;})[_0x2b70('0x22')](respondWithFilteredResult(_0xf51958,_0x6f6982))[_0x2b70('0x42')](handleError(_0xf51958,null));};exports[_0x2b70('0x43')]=function(_0xdf2fba,_0x31bc66){var _0x3edd28={'raw':!![],'where':{'id':_0xdf2fba[_0x2b70('0x44')]['id']}},_0xaec055={};_0xaec055[_0x2b70('0x2e')]=_[_0x2b70('0x30')](db[_0x2b70('0x2a')]['rawAttributes']);_0xaec055['query']=_[_0x2b70('0x30')](_0xdf2fba[_0x2b70('0x2f')]);_0xaec055[_0x2b70('0x31')]=_[_0x2b70('0x32')](_0xaec055[_0x2b70('0x2e')],_0xaec055[_0x2b70('0x2f')]);_0x3edd28['attributes']=_[_0x2b70('0x32')](_0xaec055['model'],qs['fields'](_0xdf2fba[_0x2b70('0x2f')][_0x2b70('0x33')]));_0x3edd28[_0x2b70('0x34')]=_0x3edd28['attributes'][_0x2b70('0x35')]?_0x3edd28[_0x2b70('0x34')]:_0xaec055[_0x2b70('0x2e')];if(_0xdf2fba['query'][_0x2b70('0x3f')]){_0x3edd28[_0x2b70('0x45')]=[{'all':!![]}];}_0x3edd28=_[_0x2b70('0x3c')]({},_0x3edd28,_0xdf2fba[_0x2b70('0x3e')]);return db[_0x2b70('0x2a')]['find'](_0x3edd28)[_0x2b70('0x22')](handleEntityNotFound(_0x31bc66,null))['then'](respondWithResult(_0x31bc66,null))['catch'](handleError(_0x31bc66,null));};exports[_0x2b70('0x46')]=function(_0x25958e,_0xd0bed7){return db[_0x2b70('0x2a')][_0x2b70('0x46')](_0x25958e[_0x2b70('0x47')],{})[_0x2b70('0x22')](respondWithResult(_0xd0bed7,0xc9))['catch'](handleError(_0xd0bed7,null));};exports[_0x2b70('0x21')]=function(_0x46bc7b,_0x506c6d){if(_0x46bc7b[_0x2b70('0x47')]['id']){delete _0x46bc7b[_0x2b70('0x47')]['id'];}return db[_0x2b70('0x2a')]['find']({'where':{'id':_0x46bc7b['params']['id']}})['then'](handleEntityNotFound(_0x506c6d,null))[_0x2b70('0x22')](saveUpdates(_0x46bc7b[_0x2b70('0x47')],null))[_0x2b70('0x22')](respondWithResult(_0x506c6d,null))[_0x2b70('0x42')](handleError(_0x506c6d,null));};exports[_0x2b70('0x23')]=function(_0x2ddc14,_0x39ae7b){return db[_0x2b70('0x2a')][_0x2b70('0x48')]({'where':{'id':_0x2ddc14[_0x2b70('0x44')]['id']}})[_0x2b70('0x22')](handleEntityNotFound(_0x39ae7b,null))[_0x2b70('0x22')](removeEntity(_0x39ae7b,null))[_0x2b70('0x42')](handleError(_0x39ae7b,null));};exports[_0x2b70('0x49')]=function(_0x3ceb19,_0x51d3bb){return db[_0x2b70('0x2a')][_0x2b70('0x49')]()[_0x2b70('0x22')](respondWithResult(_0x51d3bb,null))[_0x2b70('0x42')](handleError(_0x51d3bb,null));};
\ No newline at end of file
index 575d7f7..9e11cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6212=['api','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger'];(function(_0x3ae23a,_0x127f5d){var _0x3653ff=function(_0xab5612){while(--_0xab5612){_0x3ae23a['push'](_0x3ae23a['shift']());}};_0x3653ff(++_0x127f5d);}(_0x6212,0x1d2));var _0x2621=function(_0x15bbb0,_0x50ef3f){_0x15bbb0=_0x15bbb0-0x0;var _0x3597c0=_0x6212[_0x15bbb0];return _0x3597c0;};'use strict';var _=require('lodash');var util=require(_0x2621('0x0'));var logger=require(_0x2621('0x1'))(_0x2621('0x2'));var moment=require('moment');var BPromise=require(_0x2621('0x3'));var rp=require(_0x2621('0x4'));var fs=require('fs');var path=require(_0x2621('0x5'));var rimraf=require(_0x2621('0x6'));var config=require(_0x2621('0x7'));var attributes=require(_0x2621('0x8'));module[_0x2621('0x9')]=function(_0x36216b,_0x1d4bea){return _0x36216b['define'](_0x2621('0xa'),attributes,{'tableName':_0x2621('0xb'),'paranoid':![],'indexes':[{'name':_0x2621('0xc'),'fields':[_0x2621('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf215=['report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xf215,0xec));var _0x5f21=function(_0x149dcd,_0x2632f8){_0x149dcd=_0x149dcd-0x0;var _0x587c43=_0xf215[_0x149dcd];return _0x587c43;};'use strict';var _=require(_0x5f21('0x0'));var util=require(_0x5f21('0x1'));var logger=require('../../config/logger')(_0x5f21('0x2'));var moment=require(_0x5f21('0x3'));var BPromise=require(_0x5f21('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f21('0x5'));var rimraf=require(_0x5f21('0x6'));var config=require(_0x5f21('0x7'));var attributes=require(_0x5f21('0x8'));module['exports']=function(_0x5066a5,_0x68b2bd){return _0x5066a5[_0x5f21('0x9')](_0x5f21('0xa'),attributes,{'tableName':_0x5f21('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5f21('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 7e086b1..28e5942 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd84b=['lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','catch'];(function(_0x438d14,_0x31efa1){var _0x50b95f=function(_0x13e4d0){while(--_0x13e4d0){_0x438d14['push'](_0x438d14['shift']());}};_0x50b95f(++_0x31efa1);}(_0xd84b,0x159));var _0xbd84=function(_0x54b7a5,_0x134fbc){_0x54b7a5=_0x54b7a5-0x0;var _0xc6f3eb=_0xd84b[_0x54b7a5];return _0xc6f3eb;};'use strict';var _=require(_0xbd84('0x0'));var util=require('util');var moment=require(_0xbd84('0x1'));var BPromise=require(_0xbd84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd84('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd84('0x4'));var logger=require(_0xbd84('0x5'))(_0xbd84('0x6'));var config=require(_0xbd84('0x7'));var jayson=require(_0xbd84('0x8'));var client=jayson[_0xbd84('0x9')][_0xbd84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x515d25,_0x3b9e90,_0x2fc131){return new BPromise(function(_0x1cf1b0,_0x321512){return client['request'](_0x515d25,_0x2fc131)[_0xbd84('0xb')](function(_0x2b69a9){logger[_0xbd84('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x3b9e90,_0xbd84('0xd'));logger[_0xbd84('0xe')](_0xbd84('0xf'),_0x3b9e90,_0xbd84('0xd'),JSON[_0xbd84('0x10')](_0x2b69a9));if(_0x2b69a9[_0xbd84('0x11')]){if(_0x2b69a9['error'][_0xbd84('0x12')]===0x1f4){logger[_0xbd84('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x3b9e90,_0x2b69a9[_0xbd84('0x11')]['message']);return _0x321512(_0x2b69a9[_0xbd84('0x11')][_0xbd84('0x13')]);}logger[_0xbd84('0x11')](_0xbd84('0x14'),_0x3b9e90,_0x2b69a9['error']['message']);return _0x1cf1b0(_0x2b69a9['error'][_0xbd84('0x13')]);}else{logger[_0xbd84('0xc')](_0xbd84('0x14'),_0x3b9e90,'request\x20sent');_0x1cf1b0(_0x2b69a9[_0xbd84('0x15')][_0xbd84('0x13')]);}})[_0xbd84('0x16')](function(_0x20db7f){logger[_0xbd84('0x11')](_0xbd84('0x14'),_0x3b9e90,_0x20db7f);_0x321512(_0x20db7f);});});}
\ No newline at end of file
+var _0xbf77=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbf77,0x195));var _0x7bf7=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xbf77[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x7bf7('0x0'));var util=require(_0x7bf7('0x1'));var moment=require('moment');var BPromise=require(_0x7bf7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bf7('0x3'))['db'];var utils=require(_0x7bf7('0x4'));var logger=require(_0x7bf7('0x5'))(_0x7bf7('0x6'));var config=require(_0x7bf7('0x7'));var jayson=require(_0x7bf7('0x8'));var client=jayson[_0x7bf7('0x9')][_0x7bf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7bd42e,_0x56acae,_0x5663a1){return new BPromise(function(_0x54084d,_0x17116f){return client[_0x7bf7('0xb')](_0x7bd42e,_0x5663a1)['then'](function(_0x537193){logger[_0x7bf7('0xc')](_0x7bf7('0xd'),_0x56acae,_0x7bf7('0xe'));logger['debug'](_0x7bf7('0xf'),_0x56acae,'request\x20sent',JSON[_0x7bf7('0x10')](_0x537193));if(_0x537193[_0x7bf7('0x11')]){if(_0x537193[_0x7bf7('0x11')]['code']===0x1f4){logger[_0x7bf7('0x11')](_0x7bf7('0xd'),_0x56acae,_0x537193[_0x7bf7('0x11')][_0x7bf7('0x12')]);return _0x17116f(_0x537193[_0x7bf7('0x11')]['message']);}logger[_0x7bf7('0x11')](_0x7bf7('0xd'),_0x56acae,_0x537193[_0x7bf7('0x11')][_0x7bf7('0x12')]);return _0x54084d(_0x537193['error'][_0x7bf7('0x12')]);}else{logger[_0x7bf7('0xc')](_0x7bf7('0xd'),_0x56acae,_0x7bf7('0xe'));_0x54084d(_0x537193[_0x7bf7('0x13')]['message']);}})[_0x7bf7('0x14')](function(_0x4cb233){logger[_0x7bf7('0x11')](_0x7bf7('0xd'),_0x56acae,_0x4cb233);_0x17116f(_0x4cb233);});});}
\ No newline at end of file
index 1f92278..ce4b24e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5047=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','multer','util','path','express','Router'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x5047,0x1f3));var _0x7504=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0x5047[_0x2d8434];return _0x26b9e4;};'use strict';var multer=require(_0x7504('0x0'));var util=require(_0x7504('0x1'));var path=require(_0x7504('0x2'));var timeout=require('connect-timeout');var express=require(_0x7504('0x3'));var router=express[_0x7504('0x4')]();var fs_extra=require(_0x7504('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7504('0x6'));var config=require(_0x7504('0x7'));var controller=require('./faxTransferReport.controller');router[_0x7504('0x8')]('/',auth[_0x7504('0x9')](),controller[_0x7504('0xa')]);router['get'](_0x7504('0xb'),auth[_0x7504('0x9')](),controller['describe']);router[_0x7504('0x8')](_0x7504('0xc'),auth[_0x7504('0x9')](),controller[_0x7504('0xd')]);router['post']('/',auth[_0x7504('0x9')](),controller[_0x7504('0xe')]);router['put'](_0x7504('0xc'),auth[_0x7504('0x9')](),controller[_0x7504('0xf')]);router[_0x7504('0x10')](_0x7504('0xc'),auth[_0x7504('0x9')](),controller[_0x7504('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x4650=['multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x172fca,_0x23e438){var _0x5bfcc0=function(_0x3cc62a){while(--_0x3cc62a){_0x172fca['push'](_0x172fca['shift']());}};_0x5bfcc0(++_0x23e438);}(_0x4650,0x10a));var _0x0465=function(_0x171cbb,_0x5cb93c){_0x171cbb=_0x171cbb-0x0;var _0x42f533=_0x4650[_0x171cbb];return _0x42f533;};'use strict';var multer=require(_0x0465('0x0'));var util=require(_0x0465('0x1'));var path=require('path');var timeout=require(_0x0465('0x2'));var express=require(_0x0465('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0465('0x4'));var config=require(_0x0465('0x5'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0x0465('0x6')](),controller[_0x0465('0x7')]);router[_0x0465('0x8')](_0x0465('0x9'),auth[_0x0465('0x6')](),controller[_0x0465('0xa')]);router[_0x0465('0x8')](_0x0465('0xb'),auth['isAuthenticated'](),controller[_0x0465('0xc')]);router[_0x0465('0xd')]('/',auth['isAuthenticated'](),controller[_0x0465('0xe')]);router['put'](_0x0465('0xb'),auth[_0x0465('0x6')](),controller[_0x0465('0xf')]);router[_0x0465('0x10')](_0x0465('0xb'),auth[_0x0465('0x6')](),controller[_0x0465('0x11')]);module[_0x0465('0x12')]=router;
\ No newline at end of file
index ec545b1..6c1806c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf887=['create','addConfiguration','update','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post'];(function(_0x1483af,_0x4fdeb0){var _0x26f469=function(_0xde9505){while(--_0xde9505){_0x1483af['push'](_0x1483af['shift']());}};_0x26f469(++_0x4fdeb0);}(_0xf887,0x1bc));var _0x7f88=function(_0x346de9,_0x44871c){_0x346de9=_0x346de9-0x0;var _0x3346e9=_0xf887[_0x346de9];return _0x3346e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7f88('0x0'));var timeout=require(_0x7f88('0x1'));var express=require(_0x7f88('0x2'));var router=express[_0x7f88('0x3')]();var fs_extra=require(_0x7f88('0x4'));var auth=require(_0x7f88('0x5'));var interaction=require(_0x7f88('0x6'));var config=require(_0x7f88('0x7'));var controller=require(_0x7f88('0x8'));router[_0x7f88('0x9')]('/',auth[_0x7f88('0xa')](),controller[_0x7f88('0xb')]);router[_0x7f88('0x9')](_0x7f88('0xc'),auth['isAuthenticated'](),controller[_0x7f88('0xd')]);router['get'](_0x7f88('0xe'),auth[_0x7f88('0xa')](),controller[_0x7f88('0xf')]);router[_0x7f88('0x9')]('/:id/fields',auth[_0x7f88('0xa')](),controller[_0x7f88('0x10')]);router[_0x7f88('0x11')]('/',auth[_0x7f88('0xa')](),controller[_0x7f88('0x12')]);router[_0x7f88('0x11')](_0x7f88('0xe'),auth[_0x7f88('0xa')](),controller[_0x7f88('0x13')]);router['put'](_0x7f88('0xc'),auth[_0x7f88('0xa')](),controller[_0x7f88('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xdb83=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x250f9f,_0x5c81ba){var _0x539346=function(_0x3295f2){while(--_0x3295f2){_0x250f9f['push'](_0x250f9f['shift']());}};_0x539346(++_0x5c81ba);}(_0xdb83,0x137));var _0x3db8=function(_0x15d1f7,_0x567bba){_0x15d1f7=_0x15d1f7-0x0;var _0x318629=_0xdb83[_0x15d1f7];return _0x318629;};'use strict';var multer=require(_0x3db8('0x0'));var util=require(_0x3db8('0x1'));var path=require(_0x3db8('0x2'));var timeout=require('connect-timeout');var express=require(_0x3db8('0x3'));var router=express[_0x3db8('0x4')]();var fs_extra=require(_0x3db8('0x5'));var auth=require(_0x3db8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3db8('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x3db8('0x8')](),controller[_0x3db8('0x9')]);router[_0x3db8('0xa')](_0x3db8('0xb'),auth[_0x3db8('0x8')](),controller[_0x3db8('0xc')]);router['get'](_0x3db8('0xd'),auth[_0x3db8('0x8')](),controller[_0x3db8('0xe')]);router[_0x3db8('0xa')](_0x3db8('0xf'),auth['isAuthenticated'](),controller[_0x3db8('0x10')]);router[_0x3db8('0x11')]('/',auth[_0x3db8('0x8')](),controller['create']);router[_0x3db8('0x11')](_0x3db8('0xd'),auth[_0x3db8('0x8')](),controller[_0x3db8('0x12')]);router[_0x3db8('0x13')](_0x3db8('0xb'),auth[_0x3db8('0x8')](),controller[_0x3db8('0x14')]);router[_0x3db8('0x15')](_0x3db8('0xb'),auth[_0x3db8('0x8')](),controller[_0x3db8('0x16')]);module[_0x3db8('0x17')]=router;
\ No newline at end of file
index 2601bff..969702c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a4d=['basic','integrationTab','sequelize','STRING','ENUM'];(function(_0x5c114b,_0x5c7ece){var _0x41603a=function(_0x107a29){while(--_0x107a29){_0x5c114b['push'](_0x5c114b['shift']());}};_0x41603a(++_0x5c7ece);}(_0x3a4d,0x13d));var _0xd3a4=function(_0xb24b6d,_0x49f15e){_0xb24b6d=_0xb24b6d-0x0;var _0xc88ebd=_0x3a4d[_0xb24b6d];return _0xc88ebd;};'use strict';var Sequelize=require(_0xd3a4('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3a4('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd3a4('0x1')]},'authType':{'type':Sequelize[_0xd3a4('0x2')](_0xd3a4('0x3')),'defaultValue':_0xd3a4('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xd3a4('0x1')]},'consumerSecret':{'type':Sequelize[_0xd3a4('0x1')]},'token':{'type':Sequelize[_0xd3a4('0x1')]},'tokenSecret':{'type':Sequelize[_0xd3a4('0x1')]},'serverUrl':{'type':Sequelize[_0xd3a4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd3a4('0x2')](_0xd3a4('0x4'),'newTab'),'defaultValue':_0xd3a4('0x4')}};
\ No newline at end of file
+var _0xa649=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x4da925,_0x2c599d){var _0x23dfbc=function(_0x37242d){while(--_0x37242d){_0x4da925['push'](_0x4da925['shift']());}};_0x23dfbc(++_0x2c599d);}(_0xa649,0x1af));var _0x9a64=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa649[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x9a64('0x0'));module[_0x9a64('0x1')]={'name':{'type':Sequelize[_0x9a64('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9a64('0x2')]},'authType':{'type':Sequelize[_0x9a64('0x3')](_0x9a64('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x9a64('0x2')]},'consumerKey':{'type':Sequelize[_0x9a64('0x2')]},'consumerSecret':{'type':Sequelize[_0x9a64('0x2')]},'token':{'type':Sequelize[_0x9a64('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9a64('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9a64('0x5'),_0x9a64('0x6')),'defaultValue':_0x9a64('0x5')}};
\ No newline at end of file
index cca81b3..c01f357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3740=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','undefined','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','DeskAccount','count','includeAll','include','rows','catch','params','keys','rawAttributes','fields','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','priority','authType','username','password','consumerKey','consumerSecret','token','remoteUri','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','base64','concat','label','test','getFields,\x20%s,\x20%s,\x20%s','getFields','send','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x505b17,_0x262681){var _0x1a5722=function(_0x168c78){while(--_0x168c78){_0x505b17['push'](_0x505b17['shift']());}};_0x1a5722(++_0x262681);}(_0x3740,0xe6));var _0x0374=function(_0x718f1f,_0x2e2338){_0x718f1f=_0x718f1f-0x0;var _0x48b289=_0x3740[_0x718f1f];return _0x48b289;};'use strict';var emlformat=require(_0x0374('0x0'));var rimraf=require(_0x0374('0x1'));var zipdir=require(_0x0374('0x2'));var jsonpatch=require(_0x0374('0x3'));var rp=require(_0x0374('0x4'));var moment=require(_0x0374('0x5'));var BPromise=require(_0x0374('0x6'));var Mustache=require(_0x0374('0x7'));var util=require(_0x0374('0x8'));var path=require(_0x0374('0x9'));var sox=require('sox');var csv=require(_0x0374('0xa'));var ejs=require(_0x0374('0xb'));var fs=require('fs');var fs_extra=require(_0x0374('0xc'));var _=require(_0x0374('0xd'));var squel=require(_0x0374('0xe'));var crypto=require(_0x0374('0xf'));var jsforce=require(_0x0374('0x10'));var deskjs=require(_0x0374('0x11'));var toCsv=require(_0x0374('0xa'));var querystring=require(_0x0374('0x12'));var Papa=require(_0x0374('0x13'));var Redis=require(_0x0374('0x14'));var authService=require(_0x0374('0x15'));var qs=require(_0x0374('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0374('0x17'));var logger=require(_0x0374('0x18'))(_0x0374('0x19'));var utils=require(_0x0374('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x0374('0x1b'));var db=require(_0x0374('0x1c'))['db'];var integrations=require(_0x0374('0x1d'));function respondWithStatusCode(_0x404af7,_0x740dc6){_0x740dc6=_0x740dc6||0xcc;return function(_0x3bd783){if(_0x3bd783){return _0x404af7['sendStatus'](_0x740dc6);}return _0x404af7['status'](_0x740dc6)[_0x0374('0x1e')]();};}function respondWithResult(_0x85f709,_0x312af2){_0x312af2=_0x312af2||0xc8;return function(_0x1ce5fa){if(_0x1ce5fa){return _0x85f709[_0x0374('0x1f')](_0x312af2)[_0x0374('0x20')](_0x1ce5fa);}};}function respondWithFilteredResult(_0x31925c,_0x1c4f8f){return function(_0x2f344e){if(_0x2f344e){var _0x1e634f=typeof _0x1c4f8f['offset']===_0x0374('0x21')&&typeof _0x1c4f8f['limit']===_0x0374('0x21');var _0x101cc4=_0x2f344e['count'];var _0x2492a6=_0x1e634f?0x0:_0x1c4f8f['offset'];var _0x477b31=_0x1e634f?_0x2f344e['count']:_0x1c4f8f[_0x0374('0x22')]+_0x1c4f8f['limit'];var _0x2f00ea;if(_0x477b31>=_0x101cc4){_0x477b31=_0x101cc4;_0x2f00ea=0xc8;}else{_0x2f00ea=0xce;}_0x31925c[_0x0374('0x1f')](_0x2f00ea);return _0x31925c[_0x0374('0x23')]('Content-Range',_0x2492a6+'-'+_0x477b31+'/'+_0x101cc4)[_0x0374('0x20')](_0x2f344e);}return null;};}function patchUpdates(_0x369c9d){return function(_0x45d32b){try{jsonpatch[_0x0374('0x24')](_0x45d32b,_0x369c9d,!![]);}catch(_0x40e0d3){return BPromise[_0x0374('0x25')](_0x40e0d3);}return _0x45d32b[_0x0374('0x26')]();};}function saveUpdates(_0xc3806e,_0x48612f){return function(_0x5a2b03){if(_0x5a2b03){return _0x5a2b03[_0x0374('0x27')](_0xc3806e)[_0x0374('0x28')](function(_0x3ee750){return _0x3ee750;});}return null;};}function removeEntity(_0xd626c1,_0x40f322){return function(_0x19f182){if(_0x19f182){return _0x19f182[_0x0374('0x29')]()['then'](function(){_0xd626c1[_0x0374('0x1f')](0xcc)[_0x0374('0x1e')]();});}};}function handleEntityNotFound(_0x38f90b,_0x7da9c8){return function(_0x4648b5){if(!_0x4648b5){_0x38f90b[_0x0374('0x2a')](0x194);}return _0x4648b5;};}function handleError(_0x113e26,_0x1d68f1){_0x1d68f1=_0x1d68f1||0x1f4;return function(_0x10e092){logger[_0x0374('0x2b')](_0x10e092[_0x0374('0x2c')]);if(_0x10e092[_0x0374('0x2d')]){delete _0x10e092[_0x0374('0x2d')];}_0x113e26[_0x0374('0x1f')](_0x1d68f1)['send'](_0x10e092);};}exports[_0x0374('0x2e')]=function(_0x24ca50,_0x521884){var _0x80707f={},_0x16d9ea={},_0x22784c={'count':0x0,'rows':[]};var _0x4d7e1e=_[_0x0374('0x2f')](db['DeskAccount']['rawAttributes'],function(_0x14cef1){return{'name':_0x14cef1[_0x0374('0x30')],'type':_0x14cef1[_0x0374('0x31')][_0x0374('0x32')]};});_0x16d9ea[_0x0374('0x33')]=_['map'](_0x4d7e1e,'name');_0x16d9ea[_0x0374('0x34')]=_['keys'](_0x24ca50['query']);_0x16d9ea[_0x0374('0x35')]=_['intersection'](_0x16d9ea[_0x0374('0x33')],_0x16d9ea[_0x0374('0x34')]);_0x80707f[_0x0374('0x36')]=_[_0x0374('0x37')](_0x16d9ea[_0x0374('0x33')],qs['fields'](_0x24ca50[_0x0374('0x34')]['fields']));_0x80707f[_0x0374('0x36')]=_0x80707f[_0x0374('0x36')][_0x0374('0x38')]?_0x80707f[_0x0374('0x36')]:_0x16d9ea[_0x0374('0x33')];if(!_0x24ca50[_0x0374('0x34')][_0x0374('0x39')](_0x0374('0x3a'))){_0x80707f['limit']=qs[_0x0374('0x3b')](_0x24ca50['query'][_0x0374('0x3b')]);_0x80707f[_0x0374('0x22')]=qs['offset'](_0x24ca50[_0x0374('0x34')][_0x0374('0x22')]);}_0x80707f[_0x0374('0x3c')]=qs[_0x0374('0x3d')](_0x24ca50[_0x0374('0x34')]['sort']);_0x80707f[_0x0374('0x3e')]=qs[_0x0374('0x35')](_[_0x0374('0x3f')](_0x24ca50['query'],_0x16d9ea[_0x0374('0x35')]),_0x4d7e1e);if(_0x24ca50[_0x0374('0x34')][_0x0374('0x40')]){_0x80707f['where']=_['merge'](_0x80707f['where'],{'$or':_[_0x0374('0x2f')](_0x4d7e1e,function(_0x34705d){if(_0x34705d[_0x0374('0x31')]!==_0x0374('0x41')){var _0x1bc6f0={};_0x1bc6f0[_0x34705d[_0x0374('0x2d')]]={'$like':'%'+_0x24ca50['query']['filter']+'%'};return _0x1bc6f0;}})});}_0x80707f=_[_0x0374('0x42')]({},_0x80707f,_0x24ca50[_0x0374('0x43')]);var _0xa7fa31={'where':_0x80707f['where']};return db[_0x0374('0x44')]['count'](_0xa7fa31)[_0x0374('0x28')](function(_0x150fc7){_0x22784c[_0x0374('0x45')]=_0x150fc7;if(_0x24ca50[_0x0374('0x34')][_0x0374('0x46')]){_0x80707f[_0x0374('0x47')]=[{'all':!![]}];}return db[_0x0374('0x44')]['findAll'](_0x80707f);})[_0x0374('0x28')](function(_0x58b2b7){_0x22784c[_0x0374('0x48')]=_0x58b2b7;return _0x22784c;})[_0x0374('0x28')](respondWithFilteredResult(_0x521884,_0x80707f))[_0x0374('0x49')](handleError(_0x521884,null));};exports['show']=function(_0x1107bb,_0x151062){var _0x403924={'raw':![],'where':{'id':_0x1107bb[_0x0374('0x4a')]['id']}},_0x340d1b={};_0x340d1b[_0x0374('0x33')]=_[_0x0374('0x4b')](db[_0x0374('0x44')][_0x0374('0x4c')]);_0x340d1b[_0x0374('0x34')]=_[_0x0374('0x4b')](_0x1107bb[_0x0374('0x34')]);_0x340d1b[_0x0374('0x35')]=_['intersection'](_0x340d1b[_0x0374('0x33')],_0x340d1b[_0x0374('0x34')]);_0x403924['attributes']=_[_0x0374('0x37')](_0x340d1b[_0x0374('0x33')],qs['fields'](_0x1107bb[_0x0374('0x34')][_0x0374('0x4d')]));_0x403924['attributes']=_0x403924[_0x0374('0x36')][_0x0374('0x38')]?_0x403924['attributes']:_0x340d1b[_0x0374('0x33')];if(_0x1107bb['query'][_0x0374('0x46')]){_0x403924['include']=[{'all':!![]}];}_0x403924=_[_0x0374('0x42')]({},_0x403924,_0x1107bb[_0x0374('0x43')]);return db['DeskAccount'][_0x0374('0x4e')](_0x403924)['then'](handleEntityNotFound(_0x151062,null))[_0x0374('0x28')](respondWithResult(_0x151062,null))[_0x0374('0x49')](handleError(_0x151062,null));};exports[_0x0374('0x4f')]=function(_0x341d6b,_0x1b2071){return db['DeskAccount'][_0x0374('0x4f')](_0x341d6b[_0x0374('0x50')],{})[_0x0374('0x28')](respondWithResult(_0x1b2071,0xc9))[_0x0374('0x49')](handleError(_0x1b2071,null));};exports[_0x0374('0x27')]=function(_0x429d3b,_0x101829){if(_0x429d3b['body']['id']){delete _0x429d3b[_0x0374('0x50')]['id'];}return db['DeskAccount'][_0x0374('0x4e')]({'where':{'id':_0x429d3b[_0x0374('0x4a')]['id']}})[_0x0374('0x28')](handleEntityNotFound(_0x101829,null))[_0x0374('0x28')](saveUpdates(_0x429d3b['body'],null))['then'](respondWithResult(_0x101829,null))[_0x0374('0x49')](handleError(_0x101829,null));};exports['destroy']=function(_0x4e998b,_0x3017a5){return db[_0x0374('0x44')][_0x0374('0x4e')]({'where':{'id':_0x4e998b['params']['id']}})[_0x0374('0x28')](handleEntityNotFound(_0x3017a5,null))[_0x0374('0x28')](removeEntity(_0x3017a5,null))[_0x0374('0x49')](handleError(_0x3017a5,null));};exports[_0x0374('0x51')]=function(_0x36a9bf,_0x591eec,_0x1b571e){var _0x14fe64={};var _0x162bf1={};var _0x304dc1;var _0x50b970;return db[_0x0374('0x44')][_0x0374('0x52')]({'where':{'id':_0x36a9bf[_0x0374('0x4a')]['id']}})['then'](handleEntityNotFound(_0x591eec,null))['then'](function(_0x5b629e){if(_0x5b629e){_0x304dc1=_0x5b629e;_0x162bf1['model']=_[_0x0374('0x4b')](db[_0x0374('0x53')][_0x0374('0x4c')]);_0x162bf1['query']=_[_0x0374('0x4b')](_0x36a9bf[_0x0374('0x34')]);_0x162bf1[_0x0374('0x35')]=_[_0x0374('0x37')](_0x162bf1[_0x0374('0x33')],_0x162bf1['query']);_0x14fe64[_0x0374('0x36')]=_[_0x0374('0x37')](_0x162bf1[_0x0374('0x33')],qs[_0x0374('0x4d')](_0x36a9bf[_0x0374('0x34')][_0x0374('0x4d')]));_0x14fe64[_0x0374('0x36')]=_0x14fe64[_0x0374('0x36')][_0x0374('0x38')]?_0x14fe64[_0x0374('0x36')]:_0x162bf1['model'];_0x14fe64[_0x0374('0x3c')]=qs['sort'](_0x36a9bf[_0x0374('0x34')][_0x0374('0x3d')]);_0x14fe64['where']=qs[_0x0374('0x35')](_[_0x0374('0x3f')](_0x36a9bf[_0x0374('0x34')],_0x162bf1[_0x0374('0x35')]));if(_0x36a9bf[_0x0374('0x34')][_0x0374('0x40')]){_0x14fe64[_0x0374('0x3e')]=_[_0x0374('0x42')](_0x14fe64[_0x0374('0x3e')],{'$or':_[_0x0374('0x2f')](_0x14fe64[_0x0374('0x36')],function(_0x47da17){var _0x7063c3={};_0x7063c3[_0x47da17]={'$like':'%'+_0x36a9bf[_0x0374('0x34')][_0x0374('0x40')]+'%'};return _0x7063c3;})});}_0x14fe64=_[_0x0374('0x42')]({},_0x14fe64,_0x36a9bf['options']);return _0x304dc1[_0x0374('0x51')](_0x14fe64);}})[_0x0374('0x28')](function(_0x12e5b9){if(_0x12e5b9){_0x50b970=_0x12e5b9[_0x0374('0x38')];if(!_0x36a9bf[_0x0374('0x34')][_0x0374('0x39')](_0x0374('0x3a'))){_0x14fe64['limit']=qs[_0x0374('0x3b')](_0x36a9bf[_0x0374('0x34')][_0x0374('0x3b')]);_0x14fe64[_0x0374('0x22')]=qs[_0x0374('0x22')](_0x36a9bf['query'][_0x0374('0x22')]);}return _0x304dc1[_0x0374('0x51')](_0x14fe64);}})[_0x0374('0x28')](function(_0x1d192a){if(_0x1d192a){return _0x1d192a?{'count':_0x50b970,'rows':_0x1d192a}:null;}})[_0x0374('0x28')](respondWithResult(_0x591eec,null))[_0x0374('0x49')](handleError(_0x591eec,null));};exports[_0x0374('0x54')]=function(_0x27aeff,_0x2fd400,_0x17bdc6){if(_0x27aeff[_0x0374('0x50')]['id']){delete _0x27aeff['body']['id'];}return db[_0x0374('0x44')][_0x0374('0x52')]({'where':{'id':_0x27aeff[_0x0374('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fd400,null))[_0x0374('0x28')](function(_0xf2fb99){if(_0xf2fb99){_0x27aeff[_0x0374('0x50')][_0x0374('0x55')]=_0xf2fb99['id'];_0x27aeff[_0x0374('0x50')][_0x0374('0x56')]=integrations[_0x0374('0x57')](_0x27aeff['body'][_0x0374('0x58')],_0x27aeff[_0x0374('0x50')][_0x0374('0x31')]);_0x27aeff['body']['Descriptions']=integrations[_0x0374('0x59')](_0x27aeff['body']['channel'],_0x27aeff[_0x0374('0x50')]['type']);return db['DeskConfiguration'][_0x0374('0x4f')](_0x27aeff[_0x0374('0x50')],{'include':[{'model':db[_0x0374('0x5a')],'as':_0x0374('0x56')},{'model':db[_0x0374('0x5a')],'as':_0x0374('0x5b')}]});}return null;})['then'](respondWithResult(_0x2fd400,null))[_0x0374('0x49')](handleError(_0x2fd400,null));};exports['getFields']=function(_0xffebaf,_0x835c1f,_0x4979a7){var _0x4dc809=[{'name':_0x0374('0x5c'),'label':_0x0374('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 _0x165bdd='';return db[_0x0374('0x44')]['findOne']({'where':{'id':_0xffebaf[_0x0374('0x4a')]['id']},'attributes':['id','remoteUri',_0x0374('0x5d'),_0x0374('0x5e'),_0x0374('0x5f'),_0x0374('0x60'),_0x0374('0x61'),_0x0374('0x62'),'tokenSecret']})[_0x0374('0x28')](handleEntityNotFound(_0x835c1f,null))[_0x0374('0x28')](function(_0x49d3ca){if(_0x49d3ca){_0x165bdd=_0x49d3ca[_0x0374('0x63')];var _0x4d4558=_0x165bdd[_0x0374('0x64')](-0x1);if(_0x4d4558==='/'){_0x165bdd=_0x165bdd['substring'](0x0,_0x165bdd[_0x0374('0x65')](_0x4d4558));}var _0xd422f2={'method':_0x0374('0x66'),'uri':util[_0x0374('0x67')](_0x0374('0x68'),_0x165bdd),'headers':{'Content-Type':_0x0374('0x69'),'Accept':'application/json'},'json':!![]};if(_0x49d3ca[_0x0374('0x5d')]===_0x0374('0x6a')){_0xd422f2['headers'][_0x0374('0x6b')]=util['format'](_0x0374('0x6c'),new Buffer(util[_0x0374('0x67')](_0x0374('0x6d'),_0x49d3ca[_0x0374('0x5e')],_0x49d3ca[_0x0374('0x5f')]))['toString'](_0x0374('0x6e')));}return rp(_0xd422f2)[_0x0374('0x28')](function(_0x423c43){return _0x4dc809[_0x0374('0x6f')](_['map'](_0x423c43['_embedded']['entries'],function(_0x5a6b0e){return{'id':_0x5a6b0e['name'],'name':_0x5a6b0e['name'],'type':_0x5a6b0e[_0x0374('0x31')],'active':_0x5a6b0e['active'],'label':_0x5a6b0e[_0x0374('0x70')],'custom':!![]};}));});}})[_0x0374('0x28')](function(_0x5622fd){return{'count':_0x5622fd[_0x0374('0x38')],'rows':_0x5622fd};})[_0x0374('0x28')](respondWithResult(_0x835c1f,null))[_0x0374('0x49')](function(_0x6aaeef){var _0x551c66=_0xffebaf[_0x0374('0x34')][_0x0374('0x71')]?0x1f4:_0x6aaeef['statusCode']||0x1f4;logger[_0x0374('0x2b')](_0x0374('0x72'),_0x0374('0x73'),_0x551c66,JSON['stringify'](_0x6aaeef));delete _0x6aaeef[_0x0374('0x2d')];if(_0x551c66===0x191){_0x551c66=0x190;}_0x835c1f[_0x0374('0x1f')](_0x551c66)[_0x0374('0x74')](_0xffebaf[_0x0374('0x34')][_0x0374('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x6aaeef['statusCode']}:_0x6aaeef);});};
\ No newline at end of file
+var _0x6d82=['body','findOne','DeskConfiguration','rawAttributes','getConfigurations','addConfiguration','AccountId','channel','Descriptions','getDescriptions','Subjects','DeskField','getFields','priority','authType','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Basic\x20%s','%s:%s','username','toString','base64','_embedded','entries','active','label','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','DeskAccount','findAll','rows','catch','show','params','length','include','find','create'];(function(_0xf3b3bb,_0xb392e2){var _0x26b2f=function(_0x464522){while(--_0x464522){_0xf3b3bb['push'](_0xf3b3bb['shift']());}};_0x26b2f(++_0xb392e2);}(_0x6d82,0x9a));var _0x26d8=function(_0x180d59,_0xcc8e8c){_0x180d59=_0x180d59-0x0;var _0xf07bd5=_0x6d82[_0x180d59];return _0xf07bd5;};'use strict';var emlformat=require(_0x26d8('0x0'));var rimraf=require(_0x26d8('0x1'));var zipdir=require(_0x26d8('0x2'));var jsonpatch=require(_0x26d8('0x3'));var rp=require(_0x26d8('0x4'));var moment=require('moment');var BPromise=require(_0x26d8('0x5'));var Mustache=require('mustache');var util=require(_0x26d8('0x6'));var path=require(_0x26d8('0x7'));var sox=require(_0x26d8('0x8'));var csv=require('to-csv');var ejs=require(_0x26d8('0x9'));var fs=require('fs');var fs_extra=require(_0x26d8('0xa'));var _=require(_0x26d8('0xb'));var squel=require(_0x26d8('0xc'));var crypto=require(_0x26d8('0xd'));var jsforce=require(_0x26d8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x26d8('0xf'));var querystring=require(_0x26d8('0x10'));var Papa=require(_0x26d8('0x11'));var Redis=require('ioredis');var authService=require(_0x26d8('0x12'));var qs=require(_0x26d8('0x13'));var as=require(_0x26d8('0x14'));var hardwareService=require(_0x26d8('0x15'));var logger=require('../../config/logger')(_0x26d8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x26d8('0x17'));var db=require(_0x26d8('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4d2c49,_0x441f0f){_0x441f0f=_0x441f0f||0xcc;return function(_0xca3f0d){if(_0xca3f0d){return _0x4d2c49[_0x26d8('0x19')](_0x441f0f);}return _0x4d2c49['status'](_0x441f0f)[_0x26d8('0x1a')]();};}function respondWithResult(_0x26cc70,_0x1b24a0){_0x1b24a0=_0x1b24a0||0xc8;return function(_0x110ed0){if(_0x110ed0){return _0x26cc70[_0x26d8('0x1b')](_0x1b24a0)[_0x26d8('0x1c')](_0x110ed0);}};}function respondWithFilteredResult(_0x1b5b4a,_0x5b9343){return function(_0x1a34bc){if(_0x1a34bc){var _0x1e1ee9=typeof _0x5b9343[_0x26d8('0x1d')]===_0x26d8('0x1e')&&typeof _0x5b9343[_0x26d8('0x1f')]===_0x26d8('0x1e');var _0x562439=_0x1a34bc[_0x26d8('0x20')];var _0x236150=_0x1e1ee9?0x0:_0x5b9343[_0x26d8('0x1d')];var _0x1b9926=_0x1e1ee9?_0x1a34bc['count']:_0x5b9343[_0x26d8('0x1d')]+_0x5b9343[_0x26d8('0x1f')];var _0x3c6c23;if(_0x1b9926>=_0x562439){_0x1b9926=_0x562439;_0x3c6c23=0xc8;}else{_0x3c6c23=0xce;}_0x1b5b4a[_0x26d8('0x1b')](_0x3c6c23);return _0x1b5b4a[_0x26d8('0x21')](_0x26d8('0x22'),_0x236150+'-'+_0x1b9926+'/'+_0x562439)['json'](_0x1a34bc);}return null;};}function patchUpdates(_0x50a59d){return function(_0x2f35b2){try{jsonpatch[_0x26d8('0x23')](_0x2f35b2,_0x50a59d,!![]);}catch(_0x31fd99){return BPromise[_0x26d8('0x24')](_0x31fd99);}return _0x2f35b2[_0x26d8('0x25')]();};}function saveUpdates(_0x2abe84,_0x5cf313){return function(_0x3ed04c){if(_0x3ed04c){return _0x3ed04c[_0x26d8('0x26')](_0x2abe84)[_0x26d8('0x27')](function(_0x1a7fae){return _0x1a7fae;});}return null;};}function removeEntity(_0x541129,_0x308def){return function(_0x10a8ba){if(_0x10a8ba){return _0x10a8ba['destroy']()['then'](function(){_0x541129[_0x26d8('0x1b')](0xcc)[_0x26d8('0x1a')]();});}};}function handleEntityNotFound(_0x3aa51a,_0x29105a){return function(_0x10c16e){if(!_0x10c16e){_0x3aa51a[_0x26d8('0x19')](0x194);}return _0x10c16e;};}function handleError(_0x78edcf,_0x48e8d8){_0x48e8d8=_0x48e8d8||0x1f4;return function(_0x5c6ee7){logger[_0x26d8('0x28')](_0x5c6ee7[_0x26d8('0x29')]);if(_0x5c6ee7[_0x26d8('0x2a')]){delete _0x5c6ee7[_0x26d8('0x2a')];}_0x78edcf[_0x26d8('0x1b')](_0x48e8d8)[_0x26d8('0x2b')](_0x5c6ee7);};}exports[_0x26d8('0x2c')]=function(_0x1f251a,_0x1ec3ec){var _0x2c2b5a={},_0x45794d={},_0x562cb8={'count':0x0,'rows':[]};var _0x27ab0b=_[_0x26d8('0x2d')](db['DeskAccount']['rawAttributes'],function(_0x41f300){return{'name':_0x41f300[_0x26d8('0x2e')],'type':_0x41f300[_0x26d8('0x2f')][_0x26d8('0x30')]};});_0x45794d[_0x26d8('0x31')]=_[_0x26d8('0x2d')](_0x27ab0b,_0x26d8('0x2a'));_0x45794d[_0x26d8('0x32')]=_[_0x26d8('0x33')](_0x1f251a[_0x26d8('0x32')]);_0x45794d[_0x26d8('0x34')]=_[_0x26d8('0x35')](_0x45794d[_0x26d8('0x31')],_0x45794d['query']);_0x2c2b5a[_0x26d8('0x36')]=_[_0x26d8('0x35')](_0x45794d[_0x26d8('0x31')],qs[_0x26d8('0x37')](_0x1f251a[_0x26d8('0x32')][_0x26d8('0x37')]));_0x2c2b5a[_0x26d8('0x36')]=_0x2c2b5a[_0x26d8('0x36')]['length']?_0x2c2b5a[_0x26d8('0x36')]:_0x45794d[_0x26d8('0x31')];if(!_0x1f251a[_0x26d8('0x32')][_0x26d8('0x38')](_0x26d8('0x39'))){_0x2c2b5a[_0x26d8('0x1f')]=qs[_0x26d8('0x1f')](_0x1f251a[_0x26d8('0x32')][_0x26d8('0x1f')]);_0x2c2b5a[_0x26d8('0x1d')]=qs[_0x26d8('0x1d')](_0x1f251a[_0x26d8('0x32')][_0x26d8('0x1d')]);}_0x2c2b5a[_0x26d8('0x3a')]=qs[_0x26d8('0x3b')](_0x1f251a[_0x26d8('0x32')]['sort']);_0x2c2b5a[_0x26d8('0x3c')]=qs[_0x26d8('0x34')](_[_0x26d8('0x3d')](_0x1f251a['query'],_0x45794d[_0x26d8('0x34')]),_0x27ab0b);if(_0x1f251a[_0x26d8('0x32')][_0x26d8('0x3e')]){_0x2c2b5a[_0x26d8('0x3c')]=_[_0x26d8('0x3f')](_0x2c2b5a[_0x26d8('0x3c')],{'$or':_[_0x26d8('0x2d')](_0x27ab0b,function(_0x6592c3){if(_0x6592c3['type']!=='VIRTUAL'){var _0x3e2742={};_0x3e2742[_0x6592c3[_0x26d8('0x2a')]]={'$like':'%'+_0x1f251a[_0x26d8('0x32')][_0x26d8('0x3e')]+'%'};return _0x3e2742;}})});}_0x2c2b5a=_[_0x26d8('0x3f')]({},_0x2c2b5a,_0x1f251a[_0x26d8('0x40')]);var _0x57ccd3={'where':_0x2c2b5a[_0x26d8('0x3c')]};return db['DeskAccount']['count'](_0x57ccd3)[_0x26d8('0x27')](function(_0x3058c6){_0x562cb8[_0x26d8('0x20')]=_0x3058c6;if(_0x1f251a[_0x26d8('0x32')][_0x26d8('0x41')]){_0x2c2b5a['include']=[{'all':!![]}];}return db[_0x26d8('0x42')][_0x26d8('0x43')](_0x2c2b5a);})[_0x26d8('0x27')](function(_0x46adb7){_0x562cb8[_0x26d8('0x44')]=_0x46adb7;return _0x562cb8;})[_0x26d8('0x27')](respondWithFilteredResult(_0x1ec3ec,_0x2c2b5a))[_0x26d8('0x45')](handleError(_0x1ec3ec,null));};exports[_0x26d8('0x46')]=function(_0x535bf4,_0x7d6418){var _0x2f7205={'raw':![],'where':{'id':_0x535bf4[_0x26d8('0x47')]['id']}},_0x3cf165={};_0x3cf165[_0x26d8('0x31')]=_[_0x26d8('0x33')](db['DeskAccount']['rawAttributes']);_0x3cf165[_0x26d8('0x32')]=_['keys'](_0x535bf4[_0x26d8('0x32')]);_0x3cf165[_0x26d8('0x34')]=_['intersection'](_0x3cf165['model'],_0x3cf165[_0x26d8('0x32')]);_0x2f7205[_0x26d8('0x36')]=_['intersection'](_0x3cf165[_0x26d8('0x31')],qs[_0x26d8('0x37')](_0x535bf4['query']['fields']));_0x2f7205['attributes']=_0x2f7205['attributes'][_0x26d8('0x48')]?_0x2f7205['attributes']:_0x3cf165['model'];if(_0x535bf4[_0x26d8('0x32')]['includeAll']){_0x2f7205[_0x26d8('0x49')]=[{'all':!![]}];}_0x2f7205=_[_0x26d8('0x3f')]({},_0x2f7205,_0x535bf4[_0x26d8('0x40')]);return db[_0x26d8('0x42')][_0x26d8('0x4a')](_0x2f7205)[_0x26d8('0x27')](handleEntityNotFound(_0x7d6418,null))[_0x26d8('0x27')](respondWithResult(_0x7d6418,null))[_0x26d8('0x45')](handleError(_0x7d6418,null));};exports[_0x26d8('0x4b')]=function(_0x16a93f,_0x5e2bbc){return db[_0x26d8('0x42')][_0x26d8('0x4b')](_0x16a93f[_0x26d8('0x4c')],{})[_0x26d8('0x27')](respondWithResult(_0x5e2bbc,0xc9))[_0x26d8('0x45')](handleError(_0x5e2bbc,null));};exports['update']=function(_0x472660,_0x179e31){if(_0x472660[_0x26d8('0x4c')]['id']){delete _0x472660[_0x26d8('0x4c')]['id'];}return db[_0x26d8('0x42')][_0x26d8('0x4a')]({'where':{'id':_0x472660['params']['id']}})['then'](handleEntityNotFound(_0x179e31,null))[_0x26d8('0x27')](saveUpdates(_0x472660[_0x26d8('0x4c')],null))['then'](respondWithResult(_0x179e31,null))['catch'](handleError(_0x179e31,null));};exports['destroy']=function(_0x50e77f,_0x4fbca0){return db[_0x26d8('0x42')]['find']({'where':{'id':_0x50e77f[_0x26d8('0x47')]['id']}})[_0x26d8('0x27')](handleEntityNotFound(_0x4fbca0,null))[_0x26d8('0x27')](removeEntity(_0x4fbca0,null))[_0x26d8('0x45')](handleError(_0x4fbca0,null));};exports['getConfigurations']=function(_0x44b147,_0x46cb52,_0x4c86af){var _0x1ff4a3={};var _0x13877f={};var _0x2e525f;var _0x3a38b8;return db['DeskAccount'][_0x26d8('0x4d')]({'where':{'id':_0x44b147[_0x26d8('0x47')]['id']}})[_0x26d8('0x27')](handleEntityNotFound(_0x46cb52,null))[_0x26d8('0x27')](function(_0x333bb6){if(_0x333bb6){_0x2e525f=_0x333bb6;_0x13877f[_0x26d8('0x31')]=_[_0x26d8('0x33')](db[_0x26d8('0x4e')][_0x26d8('0x4f')]);_0x13877f[_0x26d8('0x32')]=_[_0x26d8('0x33')](_0x44b147['query']);_0x13877f[_0x26d8('0x34')]=_[_0x26d8('0x35')](_0x13877f[_0x26d8('0x31')],_0x13877f[_0x26d8('0x32')]);_0x1ff4a3[_0x26d8('0x36')]=_[_0x26d8('0x35')](_0x13877f['model'],qs[_0x26d8('0x37')](_0x44b147[_0x26d8('0x32')][_0x26d8('0x37')]));_0x1ff4a3[_0x26d8('0x36')]=_0x1ff4a3[_0x26d8('0x36')][_0x26d8('0x48')]?_0x1ff4a3[_0x26d8('0x36')]:_0x13877f[_0x26d8('0x31')];_0x1ff4a3[_0x26d8('0x3a')]=qs[_0x26d8('0x3b')](_0x44b147['query']['sort']);_0x1ff4a3['where']=qs[_0x26d8('0x34')](_['pick'](_0x44b147['query'],_0x13877f[_0x26d8('0x34')]));if(_0x44b147[_0x26d8('0x32')]['filter']){_0x1ff4a3[_0x26d8('0x3c')]=_['merge'](_0x1ff4a3['where'],{'$or':_['map'](_0x1ff4a3[_0x26d8('0x36')],function(_0x556d46){var _0x275ced={};_0x275ced[_0x556d46]={'$like':'%'+_0x44b147[_0x26d8('0x32')][_0x26d8('0x3e')]+'%'};return _0x275ced;})});}_0x1ff4a3=_[_0x26d8('0x3f')]({},_0x1ff4a3,_0x44b147[_0x26d8('0x40')]);return _0x2e525f[_0x26d8('0x50')](_0x1ff4a3);}})[_0x26d8('0x27')](function(_0x4111de){if(_0x4111de){_0x3a38b8=_0x4111de[_0x26d8('0x48')];if(!_0x44b147[_0x26d8('0x32')][_0x26d8('0x38')](_0x26d8('0x39'))){_0x1ff4a3[_0x26d8('0x1f')]=qs[_0x26d8('0x1f')](_0x44b147[_0x26d8('0x32')][_0x26d8('0x1f')]);_0x1ff4a3[_0x26d8('0x1d')]=qs[_0x26d8('0x1d')](_0x44b147[_0x26d8('0x32')]['offset']);}return _0x2e525f[_0x26d8('0x50')](_0x1ff4a3);}})[_0x26d8('0x27')](function(_0x2a61ac){if(_0x2a61ac){return _0x2a61ac?{'count':_0x3a38b8,'rows':_0x2a61ac}:null;}})[_0x26d8('0x27')](respondWithResult(_0x46cb52,null))[_0x26d8('0x45')](handleError(_0x46cb52,null));};exports[_0x26d8('0x51')]=function(_0x49f9a2,_0x8b3d5,_0x557d3e){if(_0x49f9a2[_0x26d8('0x4c')]['id']){delete _0x49f9a2[_0x26d8('0x4c')]['id'];}return db[_0x26d8('0x42')][_0x26d8('0x4d')]({'where':{'id':_0x49f9a2[_0x26d8('0x47')]['id']}})['then'](handleEntityNotFound(_0x8b3d5,null))[_0x26d8('0x27')](function(_0x1fcfcb){if(_0x1fcfcb){_0x49f9a2[_0x26d8('0x4c')][_0x26d8('0x52')]=_0x1fcfcb['id'];_0x49f9a2[_0x26d8('0x4c')]['Subjects']=integrations['getSubjects'](_0x49f9a2[_0x26d8('0x4c')][_0x26d8('0x53')],_0x49f9a2[_0x26d8('0x4c')][_0x26d8('0x2f')]);_0x49f9a2[_0x26d8('0x4c')][_0x26d8('0x54')]=integrations[_0x26d8('0x55')](_0x49f9a2['body'][_0x26d8('0x53')],_0x49f9a2['body']['type']);return db[_0x26d8('0x4e')]['create'](_0x49f9a2[_0x26d8('0x4c')],{'include':[{'model':db['DeskField'],'as':_0x26d8('0x56')},{'model':db[_0x26d8('0x57')],'as':_0x26d8('0x54')}]});}return null;})[_0x26d8('0x27')](respondWithResult(_0x8b3d5,null))['catch'](handleError(_0x8b3d5,null));};exports[_0x26d8('0x58')]=function(_0x5abad7,_0x216094,_0x30c00e){var _0x52d5df=[{'name':_0x26d8('0x59'),'label':_0x26d8('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x22ba63='';return db[_0x26d8('0x42')][_0x26d8('0x4d')]({'where':{'id':_0x5abad7[_0x26d8('0x47')]['id']},'attributes':['id','remoteUri',_0x26d8('0x5a'),'username',_0x26d8('0x5b'),_0x26d8('0x5c'),_0x26d8('0x5d'),_0x26d8('0x5e'),_0x26d8('0x5f')]})['then'](handleEntityNotFound(_0x216094,null))[_0x26d8('0x27')](function(_0x2dbba0){if(_0x2dbba0){_0x22ba63=_0x2dbba0[_0x26d8('0x60')];var _0x4d1ab8=_0x22ba63['slice'](-0x1);if(_0x4d1ab8==='/'){_0x22ba63=_0x22ba63['substring'](0x0,_0x22ba63[_0x26d8('0x61')](_0x4d1ab8));}var _0x525662={'method':_0x26d8('0x62'),'uri':util[_0x26d8('0x63')](_0x26d8('0x64'),_0x22ba63),'headers':{'Content-Type':_0x26d8('0x65'),'Accept':'application/json'},'json':!![]};if(_0x2dbba0[_0x26d8('0x5a')]===_0x26d8('0x66')){_0x525662['headers']['Authorization']=util[_0x26d8('0x63')](_0x26d8('0x67'),new Buffer(util[_0x26d8('0x63')](_0x26d8('0x68'),_0x2dbba0[_0x26d8('0x69')],_0x2dbba0[_0x26d8('0x5b')]))[_0x26d8('0x6a')](_0x26d8('0x6b')));}return rp(_0x525662)[_0x26d8('0x27')](function(_0x291b95){return _0x52d5df['concat'](_['map'](_0x291b95[_0x26d8('0x6c')][_0x26d8('0x6d')],function(_0x2df4fa){return{'id':_0x2df4fa[_0x26d8('0x2a')],'name':_0x2df4fa[_0x26d8('0x2a')],'type':_0x2df4fa[_0x26d8('0x2f')],'active':_0x2df4fa[_0x26d8('0x6e')],'label':_0x2df4fa[_0x26d8('0x6f')],'custom':!![]};}));});}})['then'](function(_0x34fe5f){return{'count':_0x34fe5f['length'],'rows':_0x34fe5f};})[_0x26d8('0x27')](respondWithResult(_0x216094,null))[_0x26d8('0x45')](function(_0xa3babb){var _0xe2d239=_0x5abad7[_0x26d8('0x32')][_0x26d8('0x70')]?0x1f4:_0xa3babb[_0x26d8('0x71')]||0x1f4;logger[_0x26d8('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x26d8('0x58'),_0xe2d239,JSON['stringify'](_0xa3babb));delete _0xa3babb[_0x26d8('0x2a')];if(_0xe2d239===0x191){_0xe2d239=0x190;}_0x216094[_0x26d8('0x1b')](_0xe2d239)[_0x26d8('0x2b')](_0x5abad7[_0x26d8('0x32')]['test']?{'message':_0x26d8('0x72'),'statusCode':_0xa3babb[_0x26d8('0x71')]}:_0xa3babb);});};
\ No newline at end of file
index df002a5..dfab960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda71=['bluebird','path','../../config/environment','../../components/integrations/configuration','DeskAccount','int_desk_accounts','lodash','util','api'];(function(_0xe22fae,_0x55ea6a){var _0x315d82=function(_0x1f8c2d){while(--_0x1f8c2d){_0xe22fae['push'](_0xe22fae['shift']());}};_0x315d82(++_0x55ea6a);}(_0xda71,0x165));var _0x1da7=function(_0x103b2b,_0x23e639){_0x103b2b=_0x103b2b-0x0;var _0xc96719=_0xda71[_0x103b2b];return _0xc96719;};'use strict';var _=require(_0x1da7('0x0'));var util=require(_0x1da7('0x1'));var logger=require('../../config/logger')(_0x1da7('0x2'));var moment=require('moment');var BPromise=require(_0x1da7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1da7('0x4'));var rimraf=require('rimraf');var config=require(_0x1da7('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x1da7('0x6'));module['exports']=function(_0x6b90d5,_0x94f4ee){return _0x6b90d5['define'](_0x1da7('0x7'),attributes,{'tableName':_0x1da7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae9d=['path','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','util','api','bluebird'];(function(_0x166085,_0x24a409){var _0x15c21d=function(_0x3003e6){while(--_0x3003e6){_0x166085['push'](_0x166085['shift']());}};_0x15c21d(++_0x24a409);}(_0xae9d,0x1ec));var _0xdae9=function(_0x1f9b23,_0x4fec1f){_0x1f9b23=_0x1f9b23-0x0;var _0x39a610=_0xae9d[_0x1f9b23];return _0x39a610;};'use strict';var _=require('lodash');var util=require(_0xdae9('0x0'));var logger=require('../../config/logger')(_0xdae9('0x1'));var moment=require('moment');var BPromise=require(_0xdae9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdae9('0x3'));var rimraf=require('rimraf');var config=require(_0xdae9('0x4'));var attributes=require(_0xdae9('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xdae9('0x6')]=function(_0x5886fc,_0x16a9d7){return _0x5886fc[_0xdae9('0x7')]('DeskAccount',attributes,{'tableName':_0xdae9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6c427fa..17fa649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ca4=['client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetDeskAccount','options','raw','attributes','map','include','model','catch','ShowDeskAccount','DeskAccount','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35e589,_0x5084de){var _0x5d0adc=function(_0x3fe6f2){while(--_0x3fe6f2){_0x35e589['push'](_0x35e589['shift']());}};_0x5d0adc(++_0x5084de);}(_0x3ca4,0x190));var _0x43ca=function(_0x4ad9ac,_0x51b571){_0x4ad9ac=_0x4ad9ac-0x0;var _0x3c52fb=_0x3ca4[_0x4ad9ac];return _0x3c52fb;};'use strict';var _=require(_0x43ca('0x0'));var util=require(_0x43ca('0x1'));var moment=require('moment');var BPromise=require(_0x43ca('0x2'));var rs=require(_0x43ca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x43ca('0x5'))(_0x43ca('0x6'));var config=require(_0x43ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43ca('0x8')][_0x43ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd21c59,_0x451389,_0x4709ec){return new BPromise(function(_0x1eaaa2,_0xd0d985){return client[_0x43ca('0xa')](_0xd21c59,_0x4709ec)[_0x43ca('0xb')](function(_0xe5808b){logger[_0x43ca('0xc')](_0x43ca('0xd'),_0x451389,_0x43ca('0xe'));logger[_0x43ca('0xf')](_0x43ca('0x10'),_0x451389,_0x43ca('0xe'),JSON[_0x43ca('0x11')](_0xe5808b));if(_0xe5808b['error']){if(_0xe5808b['error'][_0x43ca('0x12')]===0x1f4){logger[_0x43ca('0x13')](_0x43ca('0xd'),_0x451389,_0xe5808b[_0x43ca('0x13')][_0x43ca('0x14')]);return _0xd0d985(_0xe5808b[_0x43ca('0x13')][_0x43ca('0x14')]);}logger[_0x43ca('0x13')]('DeskAccount,\x20%s,\x20%s',_0x451389,_0xe5808b[_0x43ca('0x13')][_0x43ca('0x14')]);return _0x1eaaa2(_0xe5808b[_0x43ca('0x13')][_0x43ca('0x14')]);}else{logger[_0x43ca('0xc')](_0x43ca('0xd'),_0x451389,_0x43ca('0xe'));_0x1eaaa2(_0xe5808b[_0x43ca('0x15')][_0x43ca('0x14')]);}})['catch'](function(_0xcc46be){logger['error'](_0x43ca('0xd'),_0x451389,_0xcc46be);_0xd0d985(_0xcc46be);});});}exports[_0x43ca('0x16')]=function(_0x35952b){var _0xc22c6d=this;return new Promise(function(_0x57d261,_0x4561b7){return db['DeskAccount']['findAll']({'raw':_0x35952b[_0x43ca('0x17')]?_0x35952b['options'][_0x43ca('0x18')]===undefined?!![]:![]:!![],'where':_0x35952b[_0x43ca('0x17')]?_0x35952b['options']['where']||null:null,'attributes':_0x35952b['options']?_0x35952b[_0x43ca('0x17')][_0x43ca('0x19')]||null:null,'limit':_0x35952b[_0x43ca('0x17')]?_0x35952b['options']['limit']||null:null,'include':_0x35952b[_0x43ca('0x17')]?_0x35952b[_0x43ca('0x17')]['include']?_[_0x43ca('0x1a')](_0x35952b[_0x43ca('0x17')][_0x43ca('0x1b')],function(_0x287dea){return{'model':db[_0x287dea[_0x43ca('0x1c')]],'as':_0x287dea['as'],'attributes':_0x287dea['attributes'],'include':_0x287dea[_0x43ca('0x1b')]?_[_0x43ca('0x1a')](_0x287dea[_0x43ca('0x1b')],function(_0x2613e9){return{'model':db[_0x2613e9['model']],'as':_0x2613e9['as'],'attributes':_0x2613e9[_0x43ca('0x19')],'include':_0x2613e9[_0x43ca('0x1b')]?_[_0x43ca('0x1a')](_0x2613e9[_0x43ca('0x1b')],function(_0xf7139f){return{'model':db[_0xf7139f[_0x43ca('0x1c')]],'as':_0xf7139f['as'],'attributes':_0xf7139f[_0x43ca('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2aac51){logger[_0x43ca('0xc')](_0x43ca('0x16'),_0x35952b);logger[_0x43ca('0xf')](_0x43ca('0x16'),_0x35952b,JSON['stringify'](_0x2aac51));_0x57d261(_0x2aac51);})[_0x43ca('0x1d')](function(_0x186564){logger[_0x43ca('0x13')]('GetDeskAccount',_0x186564[_0x43ca('0x14')],_0x35952b);_0x4561b7(_0xc22c6d[_0x43ca('0x13')](0x1f4,_0x186564[_0x43ca('0x14')]));});});};exports[_0x43ca('0x1e')]=function(_0x52bd8b){var _0x47a284=this;return new Promise(function(_0x4d69aa,_0x4c2e3c){return db[_0x43ca('0x1f')][_0x43ca('0x20')]({'raw':_0x52bd8b[_0x43ca('0x17')]?_0x52bd8b[_0x43ca('0x17')][_0x43ca('0x18')]===undefined?!![]:![]:!![],'where':_0x52bd8b[_0x43ca('0x17')]?_0x52bd8b[_0x43ca('0x17')][_0x43ca('0x21')]||null:null,'attributes':_0x52bd8b['options']?_0x52bd8b[_0x43ca('0x17')][_0x43ca('0x19')]||null:null,'include':_0x52bd8b[_0x43ca('0x17')]?_0x52bd8b[_0x43ca('0x17')][_0x43ca('0x1b')]?_[_0x43ca('0x1a')](_0x52bd8b['options'][_0x43ca('0x1b')],function(_0x296bd7){return{'model':db[_0x296bd7[_0x43ca('0x1c')]],'as':_0x296bd7['as'],'attributes':_0x296bd7[_0x43ca('0x19')],'include':_0x296bd7[_0x43ca('0x1b')]?_[_0x43ca('0x1a')](_0x296bd7[_0x43ca('0x1b')],function(_0x5f47de){return{'model':db[_0x5f47de[_0x43ca('0x1c')]],'as':_0x5f47de['as'],'attributes':_0x5f47de['attributes'],'include':_0x5f47de[_0x43ca('0x1b')]?_[_0x43ca('0x1a')](_0x5f47de[_0x43ca('0x1b')],function(_0x2b0048){return{'model':db[_0x2b0048[_0x43ca('0x1c')]],'as':_0x2b0048['as'],'attributes':_0x2b0048['attributes']};}):[]};}):[]};}):[]:[]})[_0x43ca('0xb')](function(_0x47d44a){logger[_0x43ca('0xc')](_0x43ca('0x1e'),_0x52bd8b);logger['debug'](_0x43ca('0x1e'),_0x52bd8b,JSON[_0x43ca('0x11')](_0x47d44a));_0x4d69aa(_0x47d44a);})['catch'](function(_0x2d6f47){logger[_0x43ca('0x13')]('ShowDeskAccount',_0x2d6f47[_0x43ca('0x14')],_0x52bd8b);_0x4c2e3c(_0x47a284['error'](0x1f4,_0x2d6f47['message']));});});};
\ No newline at end of file
+var _0x79ff=['GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','model','map','ShowDeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x79ff,0xb5));var _0xf79f=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0x79ff[_0x59cda9];return _0x26c18f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf79f('0x0'));var BPromise=require(_0xf79f('0x1'));var rs=require(_0xf79f('0x2'));var fs=require('fs');var Redis=require(_0xf79f('0x3'));var db=require(_0xf79f('0x4'))['db'];var utils=require(_0xf79f('0x5'));var logger=require('../../config/logger')(_0xf79f('0x6'));var config=require(_0xf79f('0x7'));var jayson=require(_0xf79f('0x8'));var client=jayson[_0xf79f('0x9')][_0xf79f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d17d7,_0x592a53,_0x444a0b){return new BPromise(function(_0x262842,_0x998e4a){return client[_0xf79f('0xb')](_0x4d17d7,_0x444a0b)[_0xf79f('0xc')](function(_0x79edac){logger[_0xf79f('0xd')](_0xf79f('0xe'),_0x592a53,_0xf79f('0xf'));logger[_0xf79f('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x592a53,_0xf79f('0xf'),JSON[_0xf79f('0x11')](_0x79edac));if(_0x79edac['error']){if(_0x79edac[_0xf79f('0x12')][_0xf79f('0x13')]===0x1f4){logger['error'](_0xf79f('0xe'),_0x592a53,_0x79edac[_0xf79f('0x12')][_0xf79f('0x14')]);return _0x998e4a(_0x79edac['error'][_0xf79f('0x14')]);}logger[_0xf79f('0x12')](_0xf79f('0xe'),_0x592a53,_0x79edac[_0xf79f('0x12')][_0xf79f('0x14')]);return _0x262842(_0x79edac[_0xf79f('0x12')]['message']);}else{logger[_0xf79f('0xd')](_0xf79f('0xe'),_0x592a53,_0xf79f('0xf'));_0x262842(_0x79edac[_0xf79f('0x15')][_0xf79f('0x14')]);}})[_0xf79f('0x16')](function(_0x209359){logger[_0xf79f('0x12')](_0xf79f('0xe'),_0x592a53,_0x209359);_0x998e4a(_0x209359);});});}exports[_0xf79f('0x17')]=function(_0x266918){var _0x3fe98c=this;return new Promise(function(_0x58ccac,_0xf166bc){return db[_0xf79f('0x18')]['findAll']({'raw':_0x266918[_0xf79f('0x19')]?_0x266918[_0xf79f('0x19')][_0xf79f('0x1a')]===undefined?!![]:![]:!![],'where':_0x266918[_0xf79f('0x19')]?_0x266918[_0xf79f('0x19')][_0xf79f('0x1b')]||null:null,'attributes':_0x266918['options']?_0x266918[_0xf79f('0x19')][_0xf79f('0x1c')]||null:null,'limit':_0x266918[_0xf79f('0x19')]?_0x266918[_0xf79f('0x19')][_0xf79f('0x1d')]||null:null,'include':_0x266918[_0xf79f('0x19')]?_0x266918[_0xf79f('0x19')][_0xf79f('0x1e')]?_['map'](_0x266918['options']['include'],function(_0x567f0d){return{'model':db[_0x567f0d[_0xf79f('0x1f')]],'as':_0x567f0d['as'],'attributes':_0x567f0d['attributes'],'include':_0x567f0d[_0xf79f('0x1e')]?_[_0xf79f('0x20')](_0x567f0d['include'],function(_0xb3c24d){return{'model':db[_0xb3c24d[_0xf79f('0x1f')]],'as':_0xb3c24d['as'],'attributes':_0xb3c24d[_0xf79f('0x1c')],'include':_0xb3c24d['include']?_[_0xf79f('0x20')](_0xb3c24d[_0xf79f('0x1e')],function(_0x1597d2){return{'model':db[_0x1597d2[_0xf79f('0x1f')]],'as':_0x1597d2['as'],'attributes':_0x1597d2[_0xf79f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf79f('0xc')](function(_0x3a8481){logger[_0xf79f('0xd')](_0xf79f('0x17'),_0x266918);logger[_0xf79f('0x10')]('GetDeskAccount',_0x266918,JSON[_0xf79f('0x11')](_0x3a8481));_0x58ccac(_0x3a8481);})[_0xf79f('0x16')](function(_0x5aebfc){logger[_0xf79f('0x12')]('GetDeskAccount',_0x5aebfc[_0xf79f('0x14')],_0x266918);_0xf166bc(_0x3fe98c[_0xf79f('0x12')](0x1f4,_0x5aebfc[_0xf79f('0x14')]));});});};exports[_0xf79f('0x21')]=function(_0xc3b07c){var _0x5f56a0=this;return new Promise(function(_0x454302,_0x125186){return db[_0xf79f('0x18')]['find']({'raw':_0xc3b07c[_0xf79f('0x19')]?_0xc3b07c['options'][_0xf79f('0x1a')]===undefined?!![]:![]:!![],'where':_0xc3b07c[_0xf79f('0x19')]?_0xc3b07c[_0xf79f('0x19')]['where']||null:null,'attributes':_0xc3b07c[_0xf79f('0x19')]?_0xc3b07c[_0xf79f('0x19')][_0xf79f('0x1c')]||null:null,'include':_0xc3b07c[_0xf79f('0x19')]?_0xc3b07c[_0xf79f('0x19')][_0xf79f('0x1e')]?_[_0xf79f('0x20')](_0xc3b07c[_0xf79f('0x19')][_0xf79f('0x1e')],function(_0x13136f){return{'model':db[_0x13136f[_0xf79f('0x1f')]],'as':_0x13136f['as'],'attributes':_0x13136f[_0xf79f('0x1c')],'include':_0x13136f[_0xf79f('0x1e')]?_[_0xf79f('0x20')](_0x13136f[_0xf79f('0x1e')],function(_0x342905){return{'model':db[_0x342905[_0xf79f('0x1f')]],'as':_0x342905['as'],'attributes':_0x342905[_0xf79f('0x1c')],'include':_0x342905[_0xf79f('0x1e')]?_[_0xf79f('0x20')](_0x342905[_0xf79f('0x1e')],function(_0x2ee1d2){return{'model':db[_0x2ee1d2[_0xf79f('0x1f')]],'as':_0x2ee1d2['as'],'attributes':_0x2ee1d2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a12ce){logger[_0xf79f('0xd')](_0xf79f('0x21'),_0xc3b07c);logger[_0xf79f('0x10')](_0xf79f('0x21'),_0xc3b07c,JSON[_0xf79f('0x11')](_0x4a12ce));_0x454302(_0x4a12ce);})['catch'](function(_0x30322b){logger[_0xf79f('0x12')](_0xf79f('0x21'),_0x30322b[_0xf79f('0x14')],_0xc3b07c);_0x125186(_0x5f56a0['error'](0x1f4,_0x30322b['message']));});});};
\ No newline at end of file
index 3dfa2c1..7a9605a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe4a16f,_0x3ccfbf){var _0x1ad35f=function(_0x15c1ed){while(--_0x15c1ed){_0xe4a16f['push'](_0xe4a16f['shift']());}};_0x1ad35f(++_0x3ccfbf);}(_0x008c,0x188));var _0xc008=function(_0x41ecfc,_0x54f670){_0x41ecfc=_0x41ecfc-0x0;var _0x4cdc47=_0x008c[_0x41ecfc];return _0x4cdc47;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router;
\ No newline at end of file
+var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x10d173,_0x4520dc){var _0x39b800=function(_0x22bb8b){while(--_0x22bb8b){_0x10d173['push'](_0x10d173['shift']());}};_0x39b800(++_0x4520dc);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router;
\ No newline at end of file
index 4a9c70c..1c71df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe33d=['STRING','sequelize','exports'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0xe33d,0x1a5));var _0xde33=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xe33d[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0xde33('0x0'));module[_0xde33('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde33('0x2')]}};
\ No newline at end of file
+var _0xe91b=['STRING','exports'];(function(_0x502ac1,_0x390a37){var _0x23323f=function(_0xfbb1b2){while(--_0xfbb1b2){_0x502ac1['push'](_0x502ac1['shift']());}};_0x23323f(++_0x390a37);}(_0xe91b,0xdd));var _0xbe91=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0xe91b[_0x144b30];return _0x1bb7bc;};'use strict';var Sequelize=require('sequelize');module[_0xbe91('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbe91('0x1')]}};
\ No newline at end of file
index c7de57b..ee7d459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e43=['nolimit','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','getFields','findOne','DeskField','pick','getSubjects'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0e43,0xaf));var _0x30e4=function(_0x2bd197,_0xafa2ae){_0x2bd197=_0x2bd197-0x0;var _0x28e48a=_0x0e43[_0x2bd197];return _0x28e48a;};'use strict';var emlformat=require(_0x30e4('0x0'));var rimraf=require(_0x30e4('0x1'));var zipdir=require(_0x30e4('0x2'));var jsonpatch=require(_0x30e4('0x3'));var rp=require('request-promise');var moment=require(_0x30e4('0x4'));var BPromise=require(_0x30e4('0x5'));var Mustache=require(_0x30e4('0x6'));var util=require('util');var path=require(_0x30e4('0x7'));var sox=require(_0x30e4('0x8'));var csv=require('to-csv');var ejs=require(_0x30e4('0x9'));var fs=require('fs');var fs_extra=require(_0x30e4('0xa'));var _=require(_0x30e4('0xb'));var squel=require(_0x30e4('0xc'));var crypto=require('crypto');var jsforce=require(_0x30e4('0xd'));var deskjs=require(_0x30e4('0xe'));var toCsv=require(_0x30e4('0xf'));var querystring=require(_0x30e4('0x10'));var Papa=require(_0x30e4('0x11'));var Redis=require(_0x30e4('0x12'));var authService=require(_0x30e4('0x13'));var qs=require(_0x30e4('0x14'));var as=require(_0x30e4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30e4('0x16'))(_0x30e4('0x17'));var utils=require(_0x30e4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x30e4('0x19'));var db=require(_0x30e4('0x1a'))['db'];function respondWithStatusCode(_0x48415a,_0x1a5073){_0x1a5073=_0x1a5073||0xcc;return function(_0xdf411a){if(_0xdf411a){return _0x48415a['sendStatus'](_0x1a5073);}return _0x48415a[_0x30e4('0x1b')](_0x1a5073)[_0x30e4('0x1c')]();};}function respondWithResult(_0x58b962,_0x2a4ffe){_0x2a4ffe=_0x2a4ffe||0xc8;return function(_0x4c0e00){if(_0x4c0e00){return _0x58b962[_0x30e4('0x1b')](_0x2a4ffe)[_0x30e4('0x1d')](_0x4c0e00);}};}function respondWithFilteredResult(_0x5f6a39,_0xdaf84c){return function(_0x299b1a){if(_0x299b1a){var _0x10bb82=typeof _0xdaf84c[_0x30e4('0x1e')]===_0x30e4('0x1f')&&typeof _0xdaf84c[_0x30e4('0x20')]==='undefined';var _0x5bc007=_0x299b1a['count'];var _0x587607=_0x10bb82?0x0:_0xdaf84c[_0x30e4('0x1e')];var _0x22566b=_0x10bb82?_0x299b1a[_0x30e4('0x21')]:_0xdaf84c[_0x30e4('0x1e')]+_0xdaf84c[_0x30e4('0x20')];var _0x22c1d0;if(_0x22566b>=_0x5bc007){_0x22566b=_0x5bc007;_0x22c1d0=0xc8;}else{_0x22c1d0=0xce;}_0x5f6a39[_0x30e4('0x1b')](_0x22c1d0);return _0x5f6a39[_0x30e4('0x22')](_0x30e4('0x23'),_0x587607+'-'+_0x22566b+'/'+_0x5bc007)[_0x30e4('0x1d')](_0x299b1a);}return null;};}function patchUpdates(_0x49131f){return function(_0xe4bd43){try{jsonpatch[_0x30e4('0x24')](_0xe4bd43,_0x49131f,!![]);}catch(_0x50eb52){return BPromise['reject'](_0x50eb52);}return _0xe4bd43[_0x30e4('0x25')]();};}function saveUpdates(_0x4ba191,_0xb345bd){return function(_0xd96937){if(_0xd96937){return _0xd96937[_0x30e4('0x26')](_0x4ba191)[_0x30e4('0x27')](function(_0x13e131){return _0x13e131;});}return null;};}function removeEntity(_0x4b6eee,_0x5da500){return function(_0x47d8ff){if(_0x47d8ff){return _0x47d8ff[_0x30e4('0x28')]()[_0x30e4('0x27')](function(){_0x4b6eee['status'](0xcc)[_0x30e4('0x1c')]();});}};}function handleEntityNotFound(_0x49b278,_0x1b954b){return function(_0x4b2e61){if(!_0x4b2e61){_0x49b278['sendStatus'](0x194);}return _0x4b2e61;};}function handleError(_0x4359a8,_0x2cbf4a){_0x2cbf4a=_0x2cbf4a||0x1f4;return function(_0x2e7c5c){logger[_0x30e4('0x29')](_0x2e7c5c[_0x30e4('0x2a')]);if(_0x2e7c5c[_0x30e4('0x2b')]){delete _0x2e7c5c[_0x30e4('0x2b')];}_0x4359a8[_0x30e4('0x1b')](_0x2cbf4a)[_0x30e4('0x2c')](_0x2e7c5c);};}exports[_0x30e4('0x2d')]=function(_0x202303,_0x95a3c2){var _0x3bd46a={},_0x208a81={},_0x708410={'count':0x0,'rows':[]};var _0x46345e=_[_0x30e4('0x2e')](db[_0x30e4('0x2f')][_0x30e4('0x30')],function(_0x360571){return{'name':_0x360571['fieldName'],'type':_0x360571[_0x30e4('0x31')][_0x30e4('0x32')]};});_0x208a81['model']=_[_0x30e4('0x2e')](_0x46345e,'name');_0x208a81[_0x30e4('0x33')]=_['keys'](_0x202303[_0x30e4('0x33')]);_0x208a81[_0x30e4('0x34')]=_[_0x30e4('0x35')](_0x208a81[_0x30e4('0x36')],_0x208a81[_0x30e4('0x33')]);_0x3bd46a[_0x30e4('0x37')]=_[_0x30e4('0x35')](_0x208a81[_0x30e4('0x36')],qs[_0x30e4('0x38')](_0x202303['query'][_0x30e4('0x38')]));_0x3bd46a['attributes']=_0x3bd46a['attributes'][_0x30e4('0x39')]?_0x3bd46a['attributes']:_0x208a81[_0x30e4('0x36')];if(!_0x202303[_0x30e4('0x33')][_0x30e4('0x3a')]('nolimit')){_0x3bd46a[_0x30e4('0x20')]=qs['limit'](_0x202303[_0x30e4('0x33')][_0x30e4('0x20')]);_0x3bd46a[_0x30e4('0x1e')]=qs[_0x30e4('0x1e')](_0x202303[_0x30e4('0x33')][_0x30e4('0x1e')]);}_0x3bd46a[_0x30e4('0x3b')]=qs[_0x30e4('0x3c')](_0x202303[_0x30e4('0x33')][_0x30e4('0x3c')]);_0x3bd46a[_0x30e4('0x3d')]=qs[_0x30e4('0x34')](_['pick'](_0x202303[_0x30e4('0x33')],_0x208a81[_0x30e4('0x34')]),_0x46345e);if(_0x202303[_0x30e4('0x33')][_0x30e4('0x3e')]){_0x3bd46a[_0x30e4('0x3d')]=_[_0x30e4('0x3f')](_0x3bd46a[_0x30e4('0x3d')],{'$or':_['map'](_0x46345e,function(_0x70fe29){if(_0x70fe29[_0x30e4('0x31')]!=='VIRTUAL'){var _0x46ffcd={};_0x46ffcd[_0x70fe29['name']]={'$like':'%'+_0x202303[_0x30e4('0x33')][_0x30e4('0x3e')]+'%'};return _0x46ffcd;}})});}_0x3bd46a=_['merge']({},_0x3bd46a,_0x202303[_0x30e4('0x40')]);var _0xd47270={'where':_0x3bd46a[_0x30e4('0x3d')]};return db[_0x30e4('0x2f')][_0x30e4('0x21')](_0xd47270)[_0x30e4('0x27')](function(_0xea8c8e){_0x708410[_0x30e4('0x21')]=_0xea8c8e;if(_0x202303['query'][_0x30e4('0x41')]){_0x3bd46a[_0x30e4('0x42')]=[{'all':!![]}];}return db[_0x30e4('0x2f')]['findAll'](_0x3bd46a);})[_0x30e4('0x27')](function(_0x374166){_0x708410[_0x30e4('0x43')]=_0x374166;return _0x708410;})['then'](respondWithFilteredResult(_0x95a3c2,_0x3bd46a))[_0x30e4('0x44')](handleError(_0x95a3c2,null));};exports[_0x30e4('0x45')]=function(_0x6de0fd,_0x19ebfd){var _0x5c880c={'raw':![],'where':{'id':_0x6de0fd[_0x30e4('0x46')]['id']}},_0x1a1905={};_0x1a1905['model']=_['keys'](db[_0x30e4('0x2f')][_0x30e4('0x30')]);_0x1a1905[_0x30e4('0x33')]=_[_0x30e4('0x47')](_0x6de0fd[_0x30e4('0x33')]);_0x1a1905[_0x30e4('0x34')]=_[_0x30e4('0x35')](_0x1a1905['model'],_0x1a1905[_0x30e4('0x33')]);_0x5c880c[_0x30e4('0x37')]=_[_0x30e4('0x35')](_0x1a1905[_0x30e4('0x36')],qs[_0x30e4('0x38')](_0x6de0fd['query'][_0x30e4('0x38')]));_0x5c880c[_0x30e4('0x37')]=_0x5c880c[_0x30e4('0x37')][_0x30e4('0x39')]?_0x5c880c[_0x30e4('0x37')]:_0x1a1905['model'];if(_0x6de0fd[_0x30e4('0x33')][_0x30e4('0x41')]){_0x5c880c[_0x30e4('0x42')]=[{'all':!![]}];}_0x5c880c=_[_0x30e4('0x3f')]({},_0x5c880c,_0x6de0fd[_0x30e4('0x40')]);return db[_0x30e4('0x2f')][_0x30e4('0x48')](_0x5c880c)[_0x30e4('0x27')](handleEntityNotFound(_0x19ebfd,null))[_0x30e4('0x27')](respondWithResult(_0x19ebfd,null))['catch'](handleError(_0x19ebfd,null));};exports[_0x30e4('0x49')]=function(_0x2cd70b,_0x1077d5){return db[_0x30e4('0x2f')][_0x30e4('0x49')](_0x2cd70b['body'],{})[_0x30e4('0x27')](respondWithResult(_0x1077d5,0xc9))[_0x30e4('0x44')](handleError(_0x1077d5,null));};exports[_0x30e4('0x26')]=function(_0x28a873,_0x328194){if(_0x28a873[_0x30e4('0x4a')]['id']){delete _0x28a873['body']['id'];}return db[_0x30e4('0x2f')][_0x30e4('0x48')]({'where':{'id':_0x28a873[_0x30e4('0x46')]['id']}})['then'](handleEntityNotFound(_0x328194,null))['then'](saveUpdates(_0x28a873['body'],null))[_0x30e4('0x27')](respondWithResult(_0x328194,null))['catch'](handleError(_0x328194,null));};exports[_0x30e4('0x28')]=function(_0x58df5d,_0x27aa48){return db[_0x30e4('0x2f')][_0x30e4('0x48')]({'where':{'id':_0x58df5d['params']['id']}})[_0x30e4('0x27')](handleEntityNotFound(_0x27aa48,null))['then'](removeEntity(_0x27aa48,null))[_0x30e4('0x44')](handleError(_0x27aa48,null));};exports[_0x30e4('0x4b')]=function(_0x541a95,_0x428c02,_0x10dff7){var _0x4d8b9c={};var _0x45406f={};var _0x3f98e1;var _0x1968cf;return db[_0x30e4('0x2f')][_0x30e4('0x4c')]({'where':{'id':_0x541a95[_0x30e4('0x46')]['id']}})[_0x30e4('0x27')](handleEntityNotFound(_0x428c02,null))['then'](function(_0x195052){if(_0x195052){_0x3f98e1=_0x195052;_0x45406f['model']=_[_0x30e4('0x47')](db[_0x30e4('0x4d')][_0x30e4('0x30')]);_0x45406f[_0x30e4('0x33')]=_[_0x30e4('0x47')](_0x541a95[_0x30e4('0x33')]);_0x45406f['filters']=_[_0x30e4('0x35')](_0x45406f[_0x30e4('0x36')],_0x45406f[_0x30e4('0x33')]);_0x4d8b9c['attributes']=_[_0x30e4('0x35')](_0x45406f[_0x30e4('0x36')],qs['fields'](_0x541a95[_0x30e4('0x33')][_0x30e4('0x38')]));_0x4d8b9c[_0x30e4('0x37')]=_0x4d8b9c[_0x30e4('0x37')]['length']?_0x4d8b9c[_0x30e4('0x37')]:_0x45406f[_0x30e4('0x36')];_0x4d8b9c[_0x30e4('0x3b')]=qs[_0x30e4('0x3c')](_0x541a95[_0x30e4('0x33')][_0x30e4('0x3c')]);_0x4d8b9c['where']=qs[_0x30e4('0x34')](_[_0x30e4('0x4e')](_0x541a95[_0x30e4('0x33')],_0x45406f[_0x30e4('0x34')]));if(_0x541a95[_0x30e4('0x33')]['filter']){_0x4d8b9c[_0x30e4('0x3d')]=_[_0x30e4('0x3f')](_0x4d8b9c['where'],{'$or':_['map'](_0x4d8b9c[_0x30e4('0x37')],function(_0x5f0459){var _0x146238={};_0x146238[_0x5f0459]={'$like':'%'+_0x541a95[_0x30e4('0x33')][_0x30e4('0x3e')]+'%'};return _0x146238;})});}_0x4d8b9c=_[_0x30e4('0x3f')]({},_0x4d8b9c,_0x541a95[_0x30e4('0x40')]);return _0x3f98e1[_0x30e4('0x4b')](_0x4d8b9c);}})['then'](function(_0x423851){if(_0x423851){_0x1968cf=_0x423851['length'];if(!_0x541a95[_0x30e4('0x33')]['hasOwnProperty']('nolimit')){_0x4d8b9c[_0x30e4('0x20')]=qs[_0x30e4('0x20')](_0x541a95[_0x30e4('0x33')][_0x30e4('0x20')]);_0x4d8b9c['offset']=qs[_0x30e4('0x1e')](_0x541a95[_0x30e4('0x33')][_0x30e4('0x1e')]);}return _0x3f98e1[_0x30e4('0x4b')](_0x4d8b9c);}})[_0x30e4('0x27')](function(_0x4450f7){if(_0x4450f7){return _0x4450f7?{'count':_0x1968cf,'rows':_0x4450f7}:null;}})[_0x30e4('0x27')](respondWithResult(_0x428c02,null))[_0x30e4('0x44')](handleError(_0x428c02,null));};exports[_0x30e4('0x4f')]=function(_0x2e06ce,_0x353729,_0x17d122){var _0x9f887f={};var _0x5709a5={};var _0x3f546f;var _0x5d82f3;return db[_0x30e4('0x2f')]['findOne']({'where':{'id':_0x2e06ce[_0x30e4('0x46')]['id']}})[_0x30e4('0x27')](handleEntityNotFound(_0x353729,null))[_0x30e4('0x27')](function(_0x15ab73){if(_0x15ab73){_0x3f546f=_0x15ab73;_0x5709a5[_0x30e4('0x36')]=_[_0x30e4('0x47')](db['DeskField'][_0x30e4('0x30')]);_0x5709a5[_0x30e4('0x33')]=_[_0x30e4('0x47')](_0x2e06ce[_0x30e4('0x33')]);_0x5709a5[_0x30e4('0x34')]=_[_0x30e4('0x35')](_0x5709a5[_0x30e4('0x36')],_0x5709a5[_0x30e4('0x33')]);_0x9f887f[_0x30e4('0x37')]=_[_0x30e4('0x35')](_0x5709a5[_0x30e4('0x36')],qs[_0x30e4('0x38')](_0x2e06ce['query'][_0x30e4('0x38')]));_0x9f887f[_0x30e4('0x37')]=_0x9f887f[_0x30e4('0x37')][_0x30e4('0x39')]?_0x9f887f['attributes']:_0x5709a5[_0x30e4('0x36')];_0x9f887f[_0x30e4('0x3b')]=qs['sort'](_0x2e06ce['query']['sort']);_0x9f887f['where']=qs[_0x30e4('0x34')](_[_0x30e4('0x4e')](_0x2e06ce[_0x30e4('0x33')],_0x5709a5['filters']));if(_0x2e06ce[_0x30e4('0x33')][_0x30e4('0x3e')]){_0x9f887f[_0x30e4('0x3d')]=_[_0x30e4('0x3f')](_0x9f887f[_0x30e4('0x3d')],{'$or':_['map'](_0x9f887f[_0x30e4('0x37')],function(_0x481414){var _0x2a039c={};_0x2a039c[_0x481414]={'$like':'%'+_0x2e06ce[_0x30e4('0x33')][_0x30e4('0x3e')]+'%'};return _0x2a039c;})});}_0x9f887f=_[_0x30e4('0x3f')]({},_0x9f887f,_0x2e06ce['options']);return _0x3f546f[_0x30e4('0x4f')](_0x9f887f);}})[_0x30e4('0x27')](function(_0x4e7222){if(_0x4e7222){_0x5d82f3=_0x4e7222[_0x30e4('0x39')];if(!_0x2e06ce[_0x30e4('0x33')][_0x30e4('0x3a')](_0x30e4('0x50'))){_0x9f887f['limit']=qs['limit'](_0x2e06ce[_0x30e4('0x33')][_0x30e4('0x20')]);_0x9f887f['offset']=qs[_0x30e4('0x1e')](_0x2e06ce['query']['offset']);}return _0x3f546f[_0x30e4('0x4f')](_0x9f887f);}})[_0x30e4('0x27')](function(_0x1a29c7){if(_0x1a29c7){return _0x1a29c7?{'count':_0x5d82f3,'rows':_0x1a29c7}:null;}})['then'](respondWithResult(_0x353729,null))['catch'](handleError(_0x353729,null));};exports[_0x30e4('0x51')]=function(_0x1bcd58,_0x5bd9d7,_0x5e9c8b){var _0x4f17a4={};var _0x58a9cb={};var _0x1781ba;var _0x27b70b;return db[_0x30e4('0x2f')]['findOne']({'where':{'id':_0x1bcd58[_0x30e4('0x46')]['id']}})[_0x30e4('0x27')](handleEntityNotFound(_0x5bd9d7,null))['then'](function(_0xee27e9){if(_0xee27e9){_0x1781ba=_0xee27e9;_0x58a9cb[_0x30e4('0x36')]=_['keys'](db[_0x30e4('0x4d')][_0x30e4('0x30')]);_0x58a9cb[_0x30e4('0x33')]=_[_0x30e4('0x47')](_0x1bcd58[_0x30e4('0x33')]);_0x58a9cb[_0x30e4('0x34')]=_['intersection'](_0x58a9cb['model'],_0x58a9cb['query']);_0x4f17a4[_0x30e4('0x37')]=_[_0x30e4('0x35')](_0x58a9cb[_0x30e4('0x36')],qs[_0x30e4('0x38')](_0x1bcd58['query'][_0x30e4('0x38')]));_0x4f17a4[_0x30e4('0x37')]=_0x4f17a4['attributes'][_0x30e4('0x39')]?_0x4f17a4[_0x30e4('0x37')]:_0x58a9cb['model'];_0x4f17a4[_0x30e4('0x3b')]=qs['sort'](_0x1bcd58['query'][_0x30e4('0x3c')]);_0x4f17a4[_0x30e4('0x3d')]=qs[_0x30e4('0x34')](_[_0x30e4('0x4e')](_0x1bcd58[_0x30e4('0x33')],_0x58a9cb['filters']));if(_0x1bcd58[_0x30e4('0x33')]['filter']){_0x4f17a4[_0x30e4('0x3d')]=_[_0x30e4('0x3f')](_0x4f17a4[_0x30e4('0x3d')],{'$or':_[_0x30e4('0x2e')](_0x4f17a4['attributes'],function(_0x13aed6){var _0x66fe9e={};_0x66fe9e[_0x13aed6]={'$like':'%'+_0x1bcd58[_0x30e4('0x33')][_0x30e4('0x3e')]+'%'};return _0x66fe9e;})});}_0x4f17a4=_[_0x30e4('0x3f')]({},_0x4f17a4,_0x1bcd58[_0x30e4('0x40')]);return _0x1781ba[_0x30e4('0x51')](_0x4f17a4);}})['then'](function(_0x171f4c){if(_0x171f4c){_0x27b70b=_0x171f4c[_0x30e4('0x39')];if(!_0x1bcd58[_0x30e4('0x33')][_0x30e4('0x3a')](_0x30e4('0x50'))){_0x4f17a4['limit']=qs['limit'](_0x1bcd58[_0x30e4('0x33')][_0x30e4('0x20')]);_0x4f17a4[_0x30e4('0x1e')]=qs[_0x30e4('0x1e')](_0x1bcd58[_0x30e4('0x33')][_0x30e4('0x1e')]);}return _0x1781ba['getDescriptions'](_0x4f17a4);}})[_0x30e4('0x27')](function(_0x9985dc){if(_0x9985dc){return _0x9985dc?{'count':_0x27b70b,'rows':_0x9985dc}:null;}})[_0x30e4('0x27')](respondWithResult(_0x5bd9d7,null))['catch'](handleError(_0x5bd9d7,null));};exports[_0x30e4('0x52')]=function(_0x4e7656,_0x5b3e4c,_0x50b4c4){var _0x3d69c2={};var _0x322ffd={};var _0x4b7ff7;var _0x127de4;return db[_0x30e4('0x2f')][_0x30e4('0x4c')]({'where':{'id':_0x4e7656[_0x30e4('0x46')]['id']}})[_0x30e4('0x27')](handleEntityNotFound(_0x5b3e4c,null))[_0x30e4('0x27')](function(_0x162581){if(_0x162581){_0x4b7ff7=_0x162581;_0x322ffd['model']=_[_0x30e4('0x47')](db[_0x30e4('0x53')][_0x30e4('0x30')]);_0x322ffd[_0x30e4('0x33')]=_[_0x30e4('0x47')](_0x4e7656[_0x30e4('0x33')]);_0x322ffd[_0x30e4('0x34')]=_['intersection'](_0x322ffd[_0x30e4('0x36')],_0x322ffd['query']);_0x3d69c2['attributes']=_[_0x30e4('0x35')](_0x322ffd[_0x30e4('0x36')],qs[_0x30e4('0x38')](_0x4e7656[_0x30e4('0x33')][_0x30e4('0x38')]));_0x3d69c2['attributes']=_0x3d69c2[_0x30e4('0x37')][_0x30e4('0x39')]?_0x3d69c2['attributes']:_0x322ffd[_0x30e4('0x36')];_0x3d69c2[_0x30e4('0x3b')]=qs['sort'](_0x4e7656[_0x30e4('0x33')][_0x30e4('0x3c')]);_0x3d69c2[_0x30e4('0x3d')]=qs['filters'](_[_0x30e4('0x4e')](_0x4e7656[_0x30e4('0x33')],_0x322ffd['filters']));if(_0x4e7656['query'][_0x30e4('0x3e')]){_0x3d69c2[_0x30e4('0x3d')]=_[_0x30e4('0x3f')](_0x3d69c2['where'],{'$or':_[_0x30e4('0x2e')](_0x3d69c2[_0x30e4('0x37')],function(_0x3da186){var _0x54d903={};_0x54d903[_0x3da186]={'$like':'%'+_0x4e7656[_0x30e4('0x33')][_0x30e4('0x3e')]+'%'};return _0x54d903;})});}_0x3d69c2=_[_0x30e4('0x3f')]({},_0x3d69c2,_0x4e7656[_0x30e4('0x40')]);return _0x4b7ff7['getTags'](_0x3d69c2);}})['then'](function(_0x5a10ba){if(_0x5a10ba){_0x127de4=_0x5a10ba[_0x30e4('0x39')];if(!_0x4e7656['query'][_0x30e4('0x3a')](_0x30e4('0x50'))){_0x3d69c2[_0x30e4('0x20')]=qs[_0x30e4('0x20')](_0x4e7656[_0x30e4('0x33')][_0x30e4('0x20')]);_0x3d69c2['offset']=qs[_0x30e4('0x1e')](_0x4e7656[_0x30e4('0x33')][_0x30e4('0x1e')]);}return _0x4b7ff7['getTags'](_0x3d69c2);}})[_0x30e4('0x27')](function(_0x30205a){if(_0x30205a){return _0x30205a?{'count':_0x127de4,'rows':_0x30205a}:null;}})[_0x30e4('0x27')](respondWithResult(_0x5b3e4c,null))[_0x30e4('0x44')](handleError(_0x5b3e4c,null));};exports['setTags']=function(_0x493825,_0x29f9c6,_0x69860c){if(_0x493825[_0x30e4('0x4a')]['id']){delete _0x493825['body']['id'];}return db[_0x30e4('0x2f')]['findOne']({'where':{'id':_0x493825[_0x30e4('0x46')]['id']}})[_0x30e4('0x27')](handleEntityNotFound(_0x29f9c6,null))['then'](function(_0x1a3b58){if(_0x1a3b58){return _0x1a3b58[_0x30e4('0x54')](_0x493825[_0x30e4('0x4a')]['ids']||[]);}return null;})[_0x30e4('0x27')](respondWithResult(_0x29f9c6,null))['catch'](handleError(_0x29f9c6,null));};
\ No newline at end of file
+var _0xfad8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','DeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','params','find','catch','body','destroy','getFields','findOne','DeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3c6d90,_0x526d49){var _0x14c627=function(_0x3200ca){while(--_0x3200ca){_0x3c6d90['push'](_0x3c6d90['shift']());}};_0x14c627(++_0x526d49);}(_0xfad8,0x1ec));var _0x8fad=function(_0x478bcf,_0x11eb51){_0x478bcf=_0x478bcf-0x0;var _0x4b84e0=_0xfad8[_0x478bcf];return _0x4b84e0;};'use strict';var emlformat=require(_0x8fad('0x0'));var rimraf=require(_0x8fad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fad('0x2'));var rp=require(_0x8fad('0x3'));var moment=require(_0x8fad('0x4'));var BPromise=require(_0x8fad('0x5'));var Mustache=require(_0x8fad('0x6'));var util=require('util');var path=require(_0x8fad('0x7'));var sox=require(_0x8fad('0x8'));var csv=require(_0x8fad('0x9'));var ejs=require(_0x8fad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fad('0xb'));var squel=require(_0x8fad('0xc'));var crypto=require(_0x8fad('0xd'));var jsforce=require(_0x8fad('0xe'));var deskjs=require(_0x8fad('0xf'));var toCsv=require(_0x8fad('0x9'));var querystring=require(_0x8fad('0x10'));var Papa=require(_0x8fad('0x11'));var Redis=require('ioredis');var authService=require(_0x8fad('0x12'));var qs=require(_0x8fad('0x13'));var as=require(_0x8fad('0x14'));var hardwareService=require(_0x8fad('0x15'));var logger=require(_0x8fad('0x16'))(_0x8fad('0x17'));var utils=require(_0x8fad('0x18'));var config=require(_0x8fad('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fad('0x1a'))['db'];function respondWithStatusCode(_0x45e7ae,_0x13fa48){_0x13fa48=_0x13fa48||0xcc;return function(_0x1a284e){if(_0x1a284e){return _0x45e7ae[_0x8fad('0x1b')](_0x13fa48);}return _0x45e7ae[_0x8fad('0x1c')](_0x13fa48)[_0x8fad('0x1d')]();};}function respondWithResult(_0x1da735,_0x403067){_0x403067=_0x403067||0xc8;return function(_0x34140b){if(_0x34140b){return _0x1da735[_0x8fad('0x1c')](_0x403067)[_0x8fad('0x1e')](_0x34140b);}};}function respondWithFilteredResult(_0x1aac4d,_0x4a1f03){return function(_0x3abad8){if(_0x3abad8){var _0x2b5604=typeof _0x4a1f03['offset']==='undefined'&&typeof _0x4a1f03['limit']===_0x8fad('0x1f');var _0x8cee99=_0x3abad8['count'];var _0x3eab94=_0x2b5604?0x0:_0x4a1f03['offset'];var _0x430b86=_0x2b5604?_0x3abad8[_0x8fad('0x20')]:_0x4a1f03['offset']+_0x4a1f03[_0x8fad('0x21')];var _0x42b446;if(_0x430b86>=_0x8cee99){_0x430b86=_0x8cee99;_0x42b446=0xc8;}else{_0x42b446=0xce;}_0x1aac4d['status'](_0x42b446);return _0x1aac4d[_0x8fad('0x22')](_0x8fad('0x23'),_0x3eab94+'-'+_0x430b86+'/'+_0x8cee99)[_0x8fad('0x1e')](_0x3abad8);}return null;};}function patchUpdates(_0x1ea8c6){return function(_0x6bc394){try{jsonpatch[_0x8fad('0x24')](_0x6bc394,_0x1ea8c6,!![]);}catch(_0x148d51){return BPromise[_0x8fad('0x25')](_0x148d51);}return _0x6bc394[_0x8fad('0x26')]();};}function saveUpdates(_0x104723,_0x27dd83){return function(_0x730266){if(_0x730266){return _0x730266[_0x8fad('0x27')](_0x104723)[_0x8fad('0x28')](function(_0x57d13c){return _0x57d13c;});}return null;};}function removeEntity(_0x1093b9,_0x25f1e2){return function(_0x38543b){if(_0x38543b){return _0x38543b['destroy']()[_0x8fad('0x28')](function(){_0x1093b9[_0x8fad('0x1c')](0xcc)[_0x8fad('0x1d')]();});}};}function handleEntityNotFound(_0x562e21,_0x1d8647){return function(_0x506fe2){if(!_0x506fe2){_0x562e21[_0x8fad('0x1b')](0x194);}return _0x506fe2;};}function handleError(_0x1aba30,_0x2e635f){_0x2e635f=_0x2e635f||0x1f4;return function(_0x45f6c0){logger[_0x8fad('0x29')](_0x45f6c0[_0x8fad('0x2a')]);if(_0x45f6c0[_0x8fad('0x2b')]){delete _0x45f6c0[_0x8fad('0x2b')];}_0x1aba30[_0x8fad('0x1c')](_0x2e635f)['send'](_0x45f6c0);};}exports[_0x8fad('0x2c')]=function(_0x317010,_0x41e67a){var _0x218b56={},_0x364d1e={},_0x4e3298={'count':0x0,'rows':[]};var _0x40f995=_['map'](db[_0x8fad('0x2d')][_0x8fad('0x2e')],function(_0x22051b){return{'name':_0x22051b['fieldName'],'type':_0x22051b[_0x8fad('0x2f')][_0x8fad('0x30')]};});_0x364d1e[_0x8fad('0x31')]=_['map'](_0x40f995,_0x8fad('0x2b'));_0x364d1e[_0x8fad('0x32')]=_[_0x8fad('0x33')](_0x317010['query']);_0x364d1e['filters']=_[_0x8fad('0x34')](_0x364d1e[_0x8fad('0x31')],_0x364d1e[_0x8fad('0x32')]);_0x218b56['attributes']=_[_0x8fad('0x34')](_0x364d1e[_0x8fad('0x31')],qs['fields'](_0x317010[_0x8fad('0x32')][_0x8fad('0x35')]));_0x218b56[_0x8fad('0x36')]=_0x218b56['attributes'][_0x8fad('0x37')]?_0x218b56[_0x8fad('0x36')]:_0x364d1e['model'];if(!_0x317010[_0x8fad('0x32')][_0x8fad('0x38')](_0x8fad('0x39'))){_0x218b56[_0x8fad('0x21')]=qs[_0x8fad('0x21')](_0x317010[_0x8fad('0x32')][_0x8fad('0x21')]);_0x218b56[_0x8fad('0x3a')]=qs[_0x8fad('0x3a')](_0x317010['query'][_0x8fad('0x3a')]);}_0x218b56['order']=qs['sort'](_0x317010[_0x8fad('0x32')][_0x8fad('0x3b')]);_0x218b56[_0x8fad('0x3c')]=qs[_0x8fad('0x3d')](_[_0x8fad('0x3e')](_0x317010[_0x8fad('0x32')],_0x364d1e[_0x8fad('0x3d')]),_0x40f995);if(_0x317010[_0x8fad('0x32')][_0x8fad('0x3f')]){_0x218b56[_0x8fad('0x3c')]=_[_0x8fad('0x40')](_0x218b56[_0x8fad('0x3c')],{'$or':_[_0x8fad('0x41')](_0x40f995,function(_0x2f0c15){if(_0x2f0c15[_0x8fad('0x2f')]!==_0x8fad('0x42')){var _0x50202b={};_0x50202b[_0x2f0c15[_0x8fad('0x2b')]]={'$like':'%'+_0x317010['query']['filter']+'%'};return _0x50202b;}})});}_0x218b56=_[_0x8fad('0x40')]({},_0x218b56,_0x317010[_0x8fad('0x43')]);var _0x24aa3f={'where':_0x218b56[_0x8fad('0x3c')]};return db[_0x8fad('0x2d')][_0x8fad('0x20')](_0x24aa3f)[_0x8fad('0x28')](function(_0x108832){_0x4e3298[_0x8fad('0x20')]=_0x108832;if(_0x317010['query'][_0x8fad('0x44')]){_0x218b56[_0x8fad('0x45')]=[{'all':!![]}];}return db[_0x8fad('0x2d')]['findAll'](_0x218b56);})['then'](function(_0xdb8296){_0x4e3298[_0x8fad('0x46')]=_0xdb8296;return _0x4e3298;})[_0x8fad('0x28')](respondWithFilteredResult(_0x41e67a,_0x218b56))['catch'](handleError(_0x41e67a,null));};exports['show']=function(_0x21b037,_0x5ef562){var _0x71338={'raw':![],'where':{'id':_0x21b037[_0x8fad('0x47')]['id']}},_0x39ec54={};_0x39ec54[_0x8fad('0x31')]=_['keys'](db[_0x8fad('0x2d')][_0x8fad('0x2e')]);_0x39ec54['query']=_[_0x8fad('0x33')](_0x21b037[_0x8fad('0x32')]);_0x39ec54[_0x8fad('0x3d')]=_[_0x8fad('0x34')](_0x39ec54[_0x8fad('0x31')],_0x39ec54[_0x8fad('0x32')]);_0x71338[_0x8fad('0x36')]=_[_0x8fad('0x34')](_0x39ec54[_0x8fad('0x31')],qs['fields'](_0x21b037[_0x8fad('0x32')]['fields']));_0x71338[_0x8fad('0x36')]=_0x71338['attributes'][_0x8fad('0x37')]?_0x71338[_0x8fad('0x36')]:_0x39ec54[_0x8fad('0x31')];if(_0x21b037['query'][_0x8fad('0x44')]){_0x71338[_0x8fad('0x45')]=[{'all':!![]}];}_0x71338=_['merge']({},_0x71338,_0x21b037['options']);return db[_0x8fad('0x2d')][_0x8fad('0x48')](_0x71338)[_0x8fad('0x28')](handleEntityNotFound(_0x5ef562,null))['then'](respondWithResult(_0x5ef562,null))[_0x8fad('0x49')](handleError(_0x5ef562,null));};exports['create']=function(_0x58fe6d,_0x23bbae){return db[_0x8fad('0x2d')]['create'](_0x58fe6d[_0x8fad('0x4a')],{})['then'](respondWithResult(_0x23bbae,0xc9))['catch'](handleError(_0x23bbae,null));};exports[_0x8fad('0x27')]=function(_0x310469,_0x39466c){if(_0x310469[_0x8fad('0x4a')]['id']){delete _0x310469[_0x8fad('0x4a')]['id'];}return db[_0x8fad('0x2d')][_0x8fad('0x48')]({'where':{'id':_0x310469[_0x8fad('0x47')]['id']}})['then'](handleEntityNotFound(_0x39466c,null))[_0x8fad('0x28')](saveUpdates(_0x310469[_0x8fad('0x4a')],null))[_0x8fad('0x28')](respondWithResult(_0x39466c,null))[_0x8fad('0x49')](handleError(_0x39466c,null));};exports[_0x8fad('0x4b')]=function(_0x8b9891,_0x487493){return db[_0x8fad('0x2d')][_0x8fad('0x48')]({'where':{'id':_0x8b9891[_0x8fad('0x47')]['id']}})[_0x8fad('0x28')](handleEntityNotFound(_0x487493,null))[_0x8fad('0x28')](removeEntity(_0x487493,null))[_0x8fad('0x49')](handleError(_0x487493,null));};exports[_0x8fad('0x4c')]=function(_0x28555c,_0x2819d9,_0x72fba9){var _0x2936a7={};var _0x56684f={};var _0x1f03ab;var _0x236b75;return db['DeskConfiguration'][_0x8fad('0x4d')]({'where':{'id':_0x28555c[_0x8fad('0x47')]['id']}})[_0x8fad('0x28')](handleEntityNotFound(_0x2819d9,null))[_0x8fad('0x28')](function(_0x1b5857){if(_0x1b5857){_0x1f03ab=_0x1b5857;_0x56684f[_0x8fad('0x31')]=_[_0x8fad('0x33')](db[_0x8fad('0x4e')][_0x8fad('0x2e')]);_0x56684f[_0x8fad('0x32')]=_[_0x8fad('0x33')](_0x28555c[_0x8fad('0x32')]);_0x56684f[_0x8fad('0x3d')]=_[_0x8fad('0x34')](_0x56684f[_0x8fad('0x31')],_0x56684f['query']);_0x2936a7[_0x8fad('0x36')]=_[_0x8fad('0x34')](_0x56684f[_0x8fad('0x31')],qs[_0x8fad('0x35')](_0x28555c[_0x8fad('0x32')][_0x8fad('0x35')]));_0x2936a7[_0x8fad('0x36')]=_0x2936a7['attributes']['length']?_0x2936a7[_0x8fad('0x36')]:_0x56684f[_0x8fad('0x31')];_0x2936a7[_0x8fad('0x4f')]=qs[_0x8fad('0x3b')](_0x28555c[_0x8fad('0x32')][_0x8fad('0x3b')]);_0x2936a7[_0x8fad('0x3c')]=qs[_0x8fad('0x3d')](_[_0x8fad('0x3e')](_0x28555c[_0x8fad('0x32')],_0x56684f[_0x8fad('0x3d')]));if(_0x28555c[_0x8fad('0x32')][_0x8fad('0x3f')]){_0x2936a7[_0x8fad('0x3c')]=_[_0x8fad('0x40')](_0x2936a7[_0x8fad('0x3c')],{'$or':_['map'](_0x2936a7[_0x8fad('0x36')],function(_0x67af1c){var _0x198d73={};_0x198d73[_0x67af1c]={'$like':'%'+_0x28555c[_0x8fad('0x32')]['filter']+'%'};return _0x198d73;})});}_0x2936a7=_[_0x8fad('0x40')]({},_0x2936a7,_0x28555c[_0x8fad('0x43')]);return _0x1f03ab['getFields'](_0x2936a7);}})[_0x8fad('0x28')](function(_0x166c9e){if(_0x166c9e){_0x236b75=_0x166c9e[_0x8fad('0x37')];if(!_0x28555c[_0x8fad('0x32')][_0x8fad('0x38')](_0x8fad('0x39'))){_0x2936a7[_0x8fad('0x21')]=qs[_0x8fad('0x21')](_0x28555c[_0x8fad('0x32')][_0x8fad('0x21')]);_0x2936a7[_0x8fad('0x3a')]=qs[_0x8fad('0x3a')](_0x28555c['query'][_0x8fad('0x3a')]);}return _0x1f03ab[_0x8fad('0x4c')](_0x2936a7);}})['then'](function(_0xac800d){if(_0xac800d){return _0xac800d?{'count':_0x236b75,'rows':_0xac800d}:null;}})[_0x8fad('0x28')](respondWithResult(_0x2819d9,null))[_0x8fad('0x49')](handleError(_0x2819d9,null));};exports[_0x8fad('0x50')]=function(_0x710485,_0x40be7e,_0x2f9472){var _0x29940d={};var _0x1d81d1={};var _0x484ed4;var _0x140ffd;return db[_0x8fad('0x2d')][_0x8fad('0x4d')]({'where':{'id':_0x710485[_0x8fad('0x47')]['id']}})[_0x8fad('0x28')](handleEntityNotFound(_0x40be7e,null))[_0x8fad('0x28')](function(_0x5383eb){if(_0x5383eb){_0x484ed4=_0x5383eb;_0x1d81d1[_0x8fad('0x31')]=_['keys'](db[_0x8fad('0x4e')]['rawAttributes']);_0x1d81d1[_0x8fad('0x32')]=_[_0x8fad('0x33')](_0x710485[_0x8fad('0x32')]);_0x1d81d1[_0x8fad('0x3d')]=_['intersection'](_0x1d81d1['model'],_0x1d81d1[_0x8fad('0x32')]);_0x29940d[_0x8fad('0x36')]=_[_0x8fad('0x34')](_0x1d81d1[_0x8fad('0x31')],qs[_0x8fad('0x35')](_0x710485[_0x8fad('0x32')][_0x8fad('0x35')]));_0x29940d[_0x8fad('0x36')]=_0x29940d[_0x8fad('0x36')]['length']?_0x29940d[_0x8fad('0x36')]:_0x1d81d1[_0x8fad('0x31')];_0x29940d[_0x8fad('0x4f')]=qs[_0x8fad('0x3b')](_0x710485[_0x8fad('0x32')][_0x8fad('0x3b')]);_0x29940d['where']=qs[_0x8fad('0x3d')](_[_0x8fad('0x3e')](_0x710485[_0x8fad('0x32')],_0x1d81d1[_0x8fad('0x3d')]));if(_0x710485[_0x8fad('0x32')]['filter']){_0x29940d[_0x8fad('0x3c')]=_['merge'](_0x29940d[_0x8fad('0x3c')],{'$or':_['map'](_0x29940d['attributes'],function(_0x6a613f){var _0x325060={};_0x325060[_0x6a613f]={'$like':'%'+_0x710485[_0x8fad('0x32')][_0x8fad('0x3f')]+'%'};return _0x325060;})});}_0x29940d=_[_0x8fad('0x40')]({},_0x29940d,_0x710485['options']);return _0x484ed4[_0x8fad('0x50')](_0x29940d);}})[_0x8fad('0x28')](function(_0xcacf28){if(_0xcacf28){_0x140ffd=_0xcacf28[_0x8fad('0x37')];if(!_0x710485[_0x8fad('0x32')][_0x8fad('0x38')]('nolimit')){_0x29940d[_0x8fad('0x21')]=qs[_0x8fad('0x21')](_0x710485['query'][_0x8fad('0x21')]);_0x29940d[_0x8fad('0x3a')]=qs['offset'](_0x710485[_0x8fad('0x32')]['offset']);}return _0x484ed4[_0x8fad('0x50')](_0x29940d);}})[_0x8fad('0x28')](function(_0xb89967){if(_0xb89967){return _0xb89967?{'count':_0x140ffd,'rows':_0xb89967}:null;}})['then'](respondWithResult(_0x40be7e,null))[_0x8fad('0x49')](handleError(_0x40be7e,null));};exports[_0x8fad('0x51')]=function(_0x1dc459,_0x204cdd,_0x200488){var _0x2eaf9a={};var _0x47cdb9={};var _0x455362;var _0x7d04dc;return db[_0x8fad('0x2d')][_0x8fad('0x4d')]({'where':{'id':_0x1dc459[_0x8fad('0x47')]['id']}})[_0x8fad('0x28')](handleEntityNotFound(_0x204cdd,null))[_0x8fad('0x28')](function(_0x4a4a85){if(_0x4a4a85){_0x455362=_0x4a4a85;_0x47cdb9[_0x8fad('0x31')]=_[_0x8fad('0x33')](db[_0x8fad('0x4e')][_0x8fad('0x2e')]);_0x47cdb9[_0x8fad('0x32')]=_[_0x8fad('0x33')](_0x1dc459[_0x8fad('0x32')]);_0x47cdb9[_0x8fad('0x3d')]=_[_0x8fad('0x34')](_0x47cdb9[_0x8fad('0x31')],_0x47cdb9[_0x8fad('0x32')]);_0x2eaf9a[_0x8fad('0x36')]=_['intersection'](_0x47cdb9[_0x8fad('0x31')],qs[_0x8fad('0x35')](_0x1dc459[_0x8fad('0x32')]['fields']));_0x2eaf9a[_0x8fad('0x36')]=_0x2eaf9a[_0x8fad('0x36')][_0x8fad('0x37')]?_0x2eaf9a[_0x8fad('0x36')]:_0x47cdb9['model'];_0x2eaf9a['order']=qs[_0x8fad('0x3b')](_0x1dc459[_0x8fad('0x32')][_0x8fad('0x3b')]);_0x2eaf9a[_0x8fad('0x3c')]=qs[_0x8fad('0x3d')](_[_0x8fad('0x3e')](_0x1dc459[_0x8fad('0x32')],_0x47cdb9[_0x8fad('0x3d')]));if(_0x1dc459[_0x8fad('0x32')][_0x8fad('0x3f')]){_0x2eaf9a[_0x8fad('0x3c')]=_[_0x8fad('0x40')](_0x2eaf9a['where'],{'$or':_[_0x8fad('0x41')](_0x2eaf9a[_0x8fad('0x36')],function(_0x68e476){var _0xb6f731={};_0xb6f731[_0x68e476]={'$like':'%'+_0x1dc459[_0x8fad('0x32')][_0x8fad('0x3f')]+'%'};return _0xb6f731;})});}_0x2eaf9a=_[_0x8fad('0x40')]({},_0x2eaf9a,_0x1dc459[_0x8fad('0x43')]);return _0x455362[_0x8fad('0x51')](_0x2eaf9a);}})[_0x8fad('0x28')](function(_0x183133){if(_0x183133){_0x7d04dc=_0x183133['length'];if(!_0x1dc459[_0x8fad('0x32')][_0x8fad('0x38')]('nolimit')){_0x2eaf9a[_0x8fad('0x21')]=qs[_0x8fad('0x21')](_0x1dc459[_0x8fad('0x32')][_0x8fad('0x21')]);_0x2eaf9a[_0x8fad('0x3a')]=qs[_0x8fad('0x3a')](_0x1dc459[_0x8fad('0x32')][_0x8fad('0x3a')]);}return _0x455362['getDescriptions'](_0x2eaf9a);}})[_0x8fad('0x28')](function(_0x5173cf){if(_0x5173cf){return _0x5173cf?{'count':_0x7d04dc,'rows':_0x5173cf}:null;}})[_0x8fad('0x28')](respondWithResult(_0x204cdd,null))['catch'](handleError(_0x204cdd,null));};exports['getTags']=function(_0x1fd5a1,_0x14b522,_0x33dba1){var _0x314beb={};var _0x560266={};var _0x4ec6db;var _0x29f691;return db[_0x8fad('0x2d')][_0x8fad('0x4d')]({'where':{'id':_0x1fd5a1[_0x8fad('0x47')]['id']}})['then'](handleEntityNotFound(_0x14b522,null))[_0x8fad('0x28')](function(_0x4e2b2e){if(_0x4e2b2e){_0x4ec6db=_0x4e2b2e;_0x560266[_0x8fad('0x31')]=_[_0x8fad('0x33')](db[_0x8fad('0x52')][_0x8fad('0x2e')]);_0x560266[_0x8fad('0x32')]=_['keys'](_0x1fd5a1['query']);_0x560266['filters']=_[_0x8fad('0x34')](_0x560266[_0x8fad('0x31')],_0x560266[_0x8fad('0x32')]);_0x314beb[_0x8fad('0x36')]=_[_0x8fad('0x34')](_0x560266[_0x8fad('0x31')],qs[_0x8fad('0x35')](_0x1fd5a1['query']['fields']));_0x314beb[_0x8fad('0x36')]=_0x314beb[_0x8fad('0x36')][_0x8fad('0x37')]?_0x314beb[_0x8fad('0x36')]:_0x560266['model'];_0x314beb[_0x8fad('0x4f')]=qs['sort'](_0x1fd5a1['query'][_0x8fad('0x3b')]);_0x314beb[_0x8fad('0x3c')]=qs[_0x8fad('0x3d')](_['pick'](_0x1fd5a1[_0x8fad('0x32')],_0x560266[_0x8fad('0x3d')]));if(_0x1fd5a1[_0x8fad('0x32')][_0x8fad('0x3f')]){_0x314beb[_0x8fad('0x3c')]=_[_0x8fad('0x40')](_0x314beb[_0x8fad('0x3c')],{'$or':_[_0x8fad('0x41')](_0x314beb['attributes'],function(_0x239126){var _0x435a69={};_0x435a69[_0x239126]={'$like':'%'+_0x1fd5a1['query']['filter']+'%'};return _0x435a69;})});}_0x314beb=_[_0x8fad('0x40')]({},_0x314beb,_0x1fd5a1[_0x8fad('0x43')]);return _0x4ec6db[_0x8fad('0x53')](_0x314beb);}})[_0x8fad('0x28')](function(_0x27904a){if(_0x27904a){_0x29f691=_0x27904a[_0x8fad('0x37')];if(!_0x1fd5a1[_0x8fad('0x32')][_0x8fad('0x38')](_0x8fad('0x39'))){_0x314beb[_0x8fad('0x21')]=qs['limit'](_0x1fd5a1[_0x8fad('0x32')][_0x8fad('0x21')]);_0x314beb[_0x8fad('0x3a')]=qs['offset'](_0x1fd5a1[_0x8fad('0x32')]['offset']);}return _0x4ec6db['getTags'](_0x314beb);}})[_0x8fad('0x28')](function(_0x104425){if(_0x104425){return _0x104425?{'count':_0x29f691,'rows':_0x104425}:null;}})[_0x8fad('0x28')](respondWithResult(_0x14b522,null))[_0x8fad('0x49')](handleError(_0x14b522,null));};exports[_0x8fad('0x54')]=function(_0x5b7adb,_0x246ed2,_0xf91f96){if(_0x5b7adb[_0x8fad('0x4a')]['id']){delete _0x5b7adb[_0x8fad('0x4a')]['id'];}return db['DeskConfiguration'][_0x8fad('0x4d')]({'where':{'id':_0x5b7adb[_0x8fad('0x47')]['id']}})[_0x8fad('0x28')](handleEntityNotFound(_0x246ed2,null))['then'](function(_0x5ca22f){if(_0x5ca22f){return _0x5ca22f['setTags'](_0x5b7adb['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x246ed2,null))['catch'](handleError(_0x246ed2,null));};
\ No newline at end of file
index dfe501e..4f56bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3686=['exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x5bfb78,_0x22e3ff){var _0x4efd00=function(_0x5c9496){while(--_0x5c9496){_0x5bfb78['push'](_0x5bfb78['shift']());}};_0x4efd00(++_0x22e3ff);}(_0x3686,0x148));var _0x6368=function(_0x160512,_0x43104f){_0x160512=_0x160512-0x0;var _0x4c1082=_0x3686[_0x160512];return _0x4c1082;};'use strict';var _=require(_0x6368('0x0'));var util=require('util');var logger=require(_0x6368('0x1'))(_0x6368('0x2'));var moment=require(_0x6368('0x3'));var BPromise=require('bluebird');var rp=require(_0x6368('0x4'));var fs=require('fs');var path=require(_0x6368('0x5'));var rimraf=require('rimraf');var config=require(_0x6368('0x6'));var attributes=require(_0x6368('0x7'));module[_0x6368('0x8')]=function(_0x3e0187,_0x240a43){return _0x3e0187[_0x6368('0x9')](_0x6368('0xa'),attributes,{'tableName':_0x6368('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d17=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x1d17,0x123));var _0x71d1=function(_0x801ced,_0x506b2a){_0x801ced=_0x801ced-0x0;var _0x134ab6=_0x1d17[_0x801ced];return _0x134ab6;};'use strict';var _=require(_0x71d1('0x0'));var util=require(_0x71d1('0x1'));var logger=require(_0x71d1('0x2'))(_0x71d1('0x3'));var moment=require(_0x71d1('0x4'));var BPromise=require(_0x71d1('0x5'));var rp=require(_0x71d1('0x6'));var fs=require('fs');var path=require(_0x71d1('0x7'));var rimraf=require(_0x71d1('0x8'));var config=require(_0x71d1('0x9'));var attributes=require(_0x71d1('0xa'));module[_0x71d1('0xb')]=function(_0x56293d,_0x53149a){return _0x56293d['define'](_0x71d1('0xc'),attributes,{'tableName':_0x71d1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 063bd41..466e896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x605b=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x55fb5a,_0x36d31d){var _0x37f10e=function(_0x53e027){while(--_0x53e027){_0x55fb5a['push'](_0x55fb5a['shift']());}};_0x37f10e(++_0x36d31d);}(_0x605b,0xf4));var _0xb605=function(_0x50df1d,_0x26f55f){_0x50df1d=_0x50df1d-0x0;var _0xb406ef=_0x605b[_0x50df1d];return _0xb406ef;};'use strict';var _=require(_0xb605('0x0'));var util=require(_0xb605('0x1'));var moment=require(_0xb605('0x2'));var BPromise=require(_0xb605('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb605('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb605('0x5'))('rpc');var config=require(_0xb605('0x6'));var jayson=require(_0xb605('0x7'));var client=jayson[_0xb605('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x169eab,_0x18606a,_0x1fe3d6){return new BPromise(function(_0x3c2ac5,_0x3a1b4b){return client[_0xb605('0x9')](_0x169eab,_0x1fe3d6)[_0xb605('0xa')](function(_0xd84af5){logger[_0xb605('0xb')](_0xb605('0xc'),_0x18606a,_0xb605('0xd'));logger['debug'](_0xb605('0xe'),_0x18606a,_0xb605('0xd'),JSON['stringify'](_0xd84af5));if(_0xd84af5[_0xb605('0xf')]){if(_0xd84af5['error'][_0xb605('0x10')]===0x1f4){logger[_0xb605('0xf')](_0xb605('0xc'),_0x18606a,_0xd84af5[_0xb605('0xf')]['message']);return _0x3a1b4b(_0xd84af5[_0xb605('0xf')]['message']);}logger[_0xb605('0xf')](_0xb605('0xc'),_0x18606a,_0xd84af5[_0xb605('0xf')][_0xb605('0x11')]);return _0x3c2ac5(_0xd84af5[_0xb605('0xf')][_0xb605('0x11')]);}else{logger[_0xb605('0xb')](_0xb605('0xc'),_0x18606a,_0xb605('0xd'));_0x3c2ac5(_0xd84af5[_0xb605('0x12')][_0xb605('0x11')]);}})[_0xb605('0x13')](function(_0x4bc3c2){logger[_0xb605('0xf')](_0xb605('0xc'),_0x18606a,_0x4bc3c2);_0x3a1b4b(_0x4bc3c2);});});}
\ No newline at end of file
+var _0x6df9=['../../config/logger','../../config/environment','client','http','then','DeskConfiguration,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','../../mysqldb'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x6df9,0x84));var _0x96df=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6df9[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var moment=require('moment');var BPromise=require(_0x96df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96df('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x96df('0x4'))('rpc');var config=require(_0x96df('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x96df('0x6')][_0x96df('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf09d,_0x302764,_0x25f1d5){return new BPromise(function(_0x5ae861,_0x6efa54){return client['request'](_0x5cf09d,_0x25f1d5)[_0x96df('0x8')](function(_0x1df012){logger['info'](_0x96df('0x9'),_0x302764,'request\x20sent');logger[_0x96df('0xa')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x302764,'request\x20sent',JSON['stringify'](_0x1df012));if(_0x1df012[_0x96df('0xb')]){if(_0x1df012[_0x96df('0xb')][_0x96df('0xc')]===0x1f4){logger[_0x96df('0xb')](_0x96df('0x9'),_0x302764,_0x1df012[_0x96df('0xb')]['message']);return _0x6efa54(_0x1df012[_0x96df('0xb')][_0x96df('0xd')]);}logger[_0x96df('0xb')](_0x96df('0x9'),_0x302764,_0x1df012[_0x96df('0xb')][_0x96df('0xd')]);return _0x5ae861(_0x1df012['error']['message']);}else{logger['info'](_0x96df('0x9'),_0x302764,_0x96df('0xe'));_0x5ae861(_0x1df012[_0x96df('0xf')][_0x96df('0xd')]);}})[_0x96df('0x10')](function(_0x1212c1){logger[_0x96df('0xb')](_0x96df('0x9'),_0x302764,_0x1212c1);_0x6efa54(_0x1212c1);});});}
\ No newline at end of file
index 79a1640..34c4355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c9=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x13c9,0x1c1));var _0x913c=function(_0x19f396,_0x24ff78){_0x19f396=_0x19f396-0x0;var _0xf5f83a=_0x13c9[_0x19f396];return _0xf5f83a;};'use strict';var multer=require('multer');var util=require(_0x913c('0x0'));var path=require(_0x913c('0x1'));var timeout=require('connect-timeout');var express=require(_0x913c('0x2'));var router=express[_0x913c('0x3')]();var fs_extra=require(_0x913c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x913c('0x5'));var config=require(_0x913c('0x6'));var controller=require(_0x913c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x913c('0x8')]);router['get'](_0x913c('0x9'),auth[_0x913c('0xa')](),controller[_0x913c('0xb')]);router[_0x913c('0xc')]('/',auth[_0x913c('0xa')](),controller[_0x913c('0xd')]);router[_0x913c('0xe')](_0x913c('0x9'),auth['isAuthenticated'](),controller[_0x913c('0xf')]);router[_0x913c('0x10')]('/:id',auth[_0x913c('0xa')](),controller[_0x913c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xc113=['get','index','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc113,0x1ab));var _0x3c11=function(_0x28c0ec,_0x1d337c){_0x28c0ec=_0x28c0ec-0x0;var _0x32fda1=_0xc113[_0x28c0ec];return _0x32fda1;};'use strict';var multer=require(_0x3c11('0x0'));var util=require(_0x3c11('0x1'));var path=require(_0x3c11('0x2'));var timeout=require(_0x3c11('0x3'));var express=require(_0x3c11('0x4'));var router=express[_0x3c11('0x5')]();var fs_extra=require(_0x3c11('0x6'));var auth=require(_0x3c11('0x7'));var interaction=require(_0x3c11('0x8'));var config=require('../../config/environment');var controller=require(_0x3c11('0x9'));router[_0x3c11('0xa')]('/',auth['isAuthenticated'](),controller[_0x3c11('0xb')]);router[_0x3c11('0xa')](_0x3c11('0xc'),auth['isAuthenticated'](),controller[_0x3c11('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3c11('0xe')](_0x3c11('0xc'),auth['isAuthenticated'](),controller[_0x3c11('0xf')]);router[_0x3c11('0x10')](_0x3c11('0xc'),auth['isAuthenticated'](),controller[_0x3c11('0x11')]);module[_0x3c11('0x12')]=router;
\ No newline at end of file
index f42e96b..7f12e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4072=['variable','BOOLEAN','sequelize','exports','customVariable','keyValue','picklist','string','STRING'];(function(_0x406102,_0x7036ca){var _0x2e05d7=function(_0x203b52){while(--_0x203b52){_0x406102['push'](_0x406102['shift']());}};_0x2e05d7(++_0x7036ca);}(_0x4072,0xec));var _0x2407=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x4072[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0x2407('0x0'));module[_0x2407('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x2407('0x2'),_0x2407('0x3'),_0x2407('0x4')),'defaultValue':_0x2407('0x5')},'content':{'type':Sequelize[_0x2407('0x6')]},'key':{'type':Sequelize[_0x2407('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x2407('0x5'),_0x2407('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2407('0x6')]},'nameField':{'type':Sequelize[_0x2407('0x6')]},'customField':{'type':Sequelize[_0x2407('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2407('0x6')]}};
\ No newline at end of file
+var _0x5f70=['ENUM','variable','exports','string','customVariable','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5f70,0x134));var _0x05f7=function(_0x43e1e7,_0x581e2b){_0x43e1e7=_0x43e1e7-0x0;var _0x1f071b=_0x5f70[_0x43e1e7];return _0x1f071b;};'use strict';var Sequelize=require('sequelize');module[_0x05f7('0x0')]={'type':{'type':Sequelize['ENUM'](_0x05f7('0x1'),'variable',_0x05f7('0x2'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x05f7('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x05f7('0x4')](_0x05f7('0x1'),_0x05f7('0x5'),_0x05f7('0x2'))},'keyContent':{'type':Sequelize[_0x05f7('0x3')]},'idField':{'type':Sequelize[_0x05f7('0x3')]},'nameField':{'type':Sequelize[_0x05f7('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05f7('0x3')]}};
\ No newline at end of file
index 431c490..35cca69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd663=['apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','create','body','find','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x1edd91,_0x1c5d8d){var _0x19c839=function(_0x2e159f){while(--_0x2e159f){_0x1edd91['push'](_0x1edd91['shift']());}};_0x19c839(++_0x1c5d8d);}(_0xd663,0x1ed));var _0x3d66=function(_0x596c9a,_0x227f73){_0x596c9a=_0x596c9a-0x0;var _0x56e30f=_0xd663[_0x596c9a];return _0x56e30f;};'use strict';var emlformat=require(_0x3d66('0x0'));var rimraf=require(_0x3d66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d66('0x2'));var rp=require(_0x3d66('0x3'));var moment=require(_0x3d66('0x4'));var BPromise=require(_0x3d66('0x5'));var Mustache=require(_0x3d66('0x6'));var util=require('util');var path=require(_0x3d66('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d66('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d66('0x9'));var deskjs=require(_0x3d66('0xa'));var toCsv=require(_0x3d66('0xb'));var querystring=require(_0x3d66('0xc'));var Papa=require(_0x3d66('0xd'));var Redis=require(_0x3d66('0xe'));var authService=require(_0x3d66('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d66('0x10'));var hardwareService=require(_0x3d66('0x11'));var logger=require(_0x3d66('0x12'))('api');var utils=require(_0x3d66('0x13'));var config=require(_0x3d66('0x14'));var licenseUtil=require(_0x3d66('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207712,_0x223de6){_0x223de6=_0x223de6||0xcc;return function(_0x288693){if(_0x288693){return _0x207712[_0x3d66('0x16')](_0x223de6);}return _0x207712['status'](_0x223de6)[_0x3d66('0x17')]();};}function respondWithResult(_0x5a940c,_0x15bba0){_0x15bba0=_0x15bba0||0xc8;return function(_0x290f29){if(_0x290f29){return _0x5a940c[_0x3d66('0x18')](_0x15bba0)[_0x3d66('0x19')](_0x290f29);}};}function respondWithFilteredResult(_0x30260d,_0x153b88){return function(_0x5628ae){if(_0x5628ae){var _0x5eba7e=typeof _0x153b88[_0x3d66('0x1a')]===_0x3d66('0x1b')&&typeof _0x153b88['limit']===_0x3d66('0x1b');var _0x24d137=_0x5628ae[_0x3d66('0x1c')];var _0x1dfd81=_0x5eba7e?0x0:_0x153b88[_0x3d66('0x1a')];var _0x239ffb=_0x5eba7e?_0x5628ae[_0x3d66('0x1c')]:_0x153b88[_0x3d66('0x1a')]+_0x153b88[_0x3d66('0x1d')];var _0x3902f1;if(_0x239ffb>=_0x24d137){_0x239ffb=_0x24d137;_0x3902f1=0xc8;}else{_0x3902f1=0xce;}_0x30260d[_0x3d66('0x18')](_0x3902f1);return _0x30260d[_0x3d66('0x1e')](_0x3d66('0x1f'),_0x1dfd81+'-'+_0x239ffb+'/'+_0x24d137)[_0x3d66('0x19')](_0x5628ae);}return null;};}function patchUpdates(_0x21cfd7){return function(_0x4c61ee){try{jsonpatch[_0x3d66('0x20')](_0x4c61ee,_0x21cfd7,!![]);}catch(_0x5e1516){return BPromise[_0x3d66('0x21')](_0x5e1516);}return _0x4c61ee[_0x3d66('0x22')]();};}function saveUpdates(_0x4486f5,_0x37ed73){return function(_0x11be7f){if(_0x11be7f){return _0x11be7f[_0x3d66('0x23')](_0x4486f5)[_0x3d66('0x24')](function(_0x1bfa81){return _0x1bfa81;});}return null;};}function removeEntity(_0x1eb922,_0x4e2c42){return function(_0x151364){if(_0x151364){return _0x151364[_0x3d66('0x25')]()[_0x3d66('0x24')](function(){_0x1eb922[_0x3d66('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59fe0a,_0x45628b){return function(_0x4302ad){if(!_0x4302ad){_0x59fe0a[_0x3d66('0x16')](0x194);}return _0x4302ad;};}function handleError(_0x4f0d9e,_0x402c4c){_0x402c4c=_0x402c4c||0x1f4;return function(_0x3e6712){logger[_0x3d66('0x26')](_0x3e6712[_0x3d66('0x27')]);if(_0x3e6712[_0x3d66('0x28')]){delete _0x3e6712[_0x3d66('0x28')];}_0x4f0d9e[_0x3d66('0x18')](_0x402c4c)[_0x3d66('0x29')](_0x3e6712);};}exports[_0x3d66('0x2a')]=function(_0x1271bf,_0x54ba13){var _0x28466b={},_0x1dff3b={},_0x197c5e={'count':0x0,'rows':[]};var _0xc128a7=_[_0x3d66('0x2b')](db[_0x3d66('0x2c')][_0x3d66('0x2d')],function(_0xabe382){return{'name':_0xabe382[_0x3d66('0x2e')],'type':_0xabe382[_0x3d66('0x2f')][_0x3d66('0x30')]};});_0x1dff3b['model']=_['map'](_0xc128a7,_0x3d66('0x28'));_0x1dff3b[_0x3d66('0x31')]=_[_0x3d66('0x32')](_0x1271bf[_0x3d66('0x31')]);_0x1dff3b[_0x3d66('0x33')]=_[_0x3d66('0x34')](_0x1dff3b[_0x3d66('0x35')],_0x1dff3b[_0x3d66('0x31')]);_0x28466b[_0x3d66('0x36')]=_[_0x3d66('0x34')](_0x1dff3b[_0x3d66('0x35')],qs[_0x3d66('0x37')](_0x1271bf[_0x3d66('0x31')][_0x3d66('0x37')]));_0x28466b[_0x3d66('0x36')]=_0x28466b[_0x3d66('0x36')][_0x3d66('0x38')]?_0x28466b[_0x3d66('0x36')]:_0x1dff3b[_0x3d66('0x35')];if(!_0x1271bf[_0x3d66('0x31')][_0x3d66('0x39')](_0x3d66('0x3a'))){_0x28466b[_0x3d66('0x1d')]=qs['limit'](_0x1271bf[_0x3d66('0x31')][_0x3d66('0x1d')]);_0x28466b[_0x3d66('0x1a')]=qs['offset'](_0x1271bf[_0x3d66('0x31')]['offset']);}_0x28466b[_0x3d66('0x3b')]=qs[_0x3d66('0x3c')](_0x1271bf['query'][_0x3d66('0x3c')]);_0x28466b[_0x3d66('0x3d')]=qs['filters'](_[_0x3d66('0x3e')](_0x1271bf[_0x3d66('0x31')],_0x1dff3b['filters']),_0xc128a7);if(_0x1271bf[_0x3d66('0x31')][_0x3d66('0x3f')]){_0x28466b[_0x3d66('0x3d')]=_[_0x3d66('0x40')](_0x28466b['where'],{'$or':_[_0x3d66('0x2b')](_0xc128a7,function(_0x58851d){if(_0x58851d[_0x3d66('0x2f')]!=='VIRTUAL'){var _0xc77eb5={};_0xc77eb5[_0x58851d[_0x3d66('0x28')]]={'$like':'%'+_0x1271bf[_0x3d66('0x31')]['filter']+'%'};return _0xc77eb5;}})});}_0x28466b=_[_0x3d66('0x40')]({},_0x28466b,_0x1271bf[_0x3d66('0x41')]);var _0x105726={'where':_0x28466b[_0x3d66('0x3d')]};return db[_0x3d66('0x2c')][_0x3d66('0x1c')](_0x105726)[_0x3d66('0x24')](function(_0x38633f){_0x197c5e[_0x3d66('0x1c')]=_0x38633f;if(_0x1271bf[_0x3d66('0x31')][_0x3d66('0x42')]){_0x28466b[_0x3d66('0x43')]=[{'all':!![]}];}return db[_0x3d66('0x2c')]['findAll'](_0x28466b);})[_0x3d66('0x24')](function(_0x4482a3){_0x197c5e[_0x3d66('0x44')]=_0x4482a3;return _0x197c5e;})['then'](respondWithFilteredResult(_0x54ba13,_0x28466b))['catch'](handleError(_0x54ba13,null));};exports[_0x3d66('0x45')]=function(_0x263e9f,_0x3deb7d){var _0x26350b={'raw':!![],'where':{'id':_0x263e9f[_0x3d66('0x46')]['id']}},_0x283395={};_0x283395[_0x3d66('0x35')]=_[_0x3d66('0x32')](db['DeskField'][_0x3d66('0x2d')]);_0x283395[_0x3d66('0x31')]=_[_0x3d66('0x32')](_0x263e9f['query']);_0x283395['filters']=_[_0x3d66('0x34')](_0x283395[_0x3d66('0x35')],_0x283395[_0x3d66('0x31')]);_0x26350b[_0x3d66('0x36')]=_[_0x3d66('0x34')](_0x283395[_0x3d66('0x35')],qs[_0x3d66('0x37')](_0x263e9f[_0x3d66('0x31')]['fields']));_0x26350b[_0x3d66('0x36')]=_0x26350b['attributes'][_0x3d66('0x38')]?_0x26350b[_0x3d66('0x36')]:_0x283395[_0x3d66('0x35')];if(_0x263e9f['query'][_0x3d66('0x42')]){_0x26350b[_0x3d66('0x43')]=[{'all':!![]}];}_0x26350b=_[_0x3d66('0x40')]({},_0x26350b,_0x263e9f[_0x3d66('0x41')]);return db['DeskField']['find'](_0x26350b)[_0x3d66('0x24')](handleEntityNotFound(_0x3deb7d,null))['then'](respondWithResult(_0x3deb7d,null))['catch'](handleError(_0x3deb7d,null));};exports[_0x3d66('0x47')]=function(_0x3c5b6d,_0x32edc2){return db[_0x3d66('0x2c')][_0x3d66('0x47')](_0x3c5b6d[_0x3d66('0x48')],{})[_0x3d66('0x24')](respondWithResult(_0x32edc2,0xc9))['catch'](handleError(_0x32edc2,null));};exports[_0x3d66('0x23')]=function(_0x2e05ce,_0x22c447){if(_0x2e05ce[_0x3d66('0x48')]['id']){delete _0x2e05ce[_0x3d66('0x48')]['id'];}return db['DeskField'][_0x3d66('0x49')]({'where':{'id':_0x2e05ce[_0x3d66('0x46')]['id']}})[_0x3d66('0x24')](handleEntityNotFound(_0x22c447,null))[_0x3d66('0x24')](saveUpdates(_0x2e05ce[_0x3d66('0x48')],null))[_0x3d66('0x24')](respondWithResult(_0x22c447,null))[_0x3d66('0x4a')](handleError(_0x22c447,null));};exports['destroy']=function(_0x4a6c1c,_0x505abb){return db[_0x3d66('0x2c')][_0x3d66('0x49')]({'where':{'id':_0x4a6c1c['params']['id']}})[_0x3d66('0x24')](handleEntityNotFound(_0x505abb,null))[_0x3d66('0x24')](removeEntity(_0x505abb,null))[_0x3d66('0x4a')](handleError(_0x505abb,null));};
\ No newline at end of file
+var _0x15c6=['set','Content-Range','save','update','then','destroy','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','fields','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count'];(function(_0x575aa6,_0x62d907){var _0x58ed27=function(_0x1b0a5d){while(--_0x1b0a5d){_0x575aa6['push'](_0x575aa6['shift']());}};_0x58ed27(++_0x62d907);}(_0x15c6,0x1cd));var _0x615c=function(_0x599041,_0x40fbea){_0x599041=_0x599041-0x0;var _0x1c4969=_0x15c6[_0x599041];return _0x1c4969;};'use strict';var emlformat=require(_0x615c('0x0'));var rimraf=require(_0x615c('0x1'));var zipdir=require(_0x615c('0x2'));var jsonpatch=require(_0x615c('0x3'));var rp=require(_0x615c('0x4'));var moment=require(_0x615c('0x5'));var BPromise=require(_0x615c('0x6'));var Mustache=require(_0x615c('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x615c('0x8'));var ejs=require(_0x615c('0x9'));var fs=require('fs');var fs_extra=require(_0x615c('0xa'));var _=require('lodash');var squel=require(_0x615c('0xb'));var crypto=require(_0x615c('0xc'));var jsforce=require(_0x615c('0xd'));var deskjs=require(_0x615c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x615c('0xf'));var Papa=require('papaparse');var Redis=require(_0x615c('0x10'));var authService=require(_0x615c('0x11'));var qs=require(_0x615c('0x12'));var as=require(_0x615c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x615c('0x14'));var utils=require(_0x615c('0x15'));var config=require(_0x615c('0x16'));var licenseUtil=require(_0x615c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x497ecb,_0x1c029d){_0x1c029d=_0x1c029d||0xcc;return function(_0x1b6e92){if(_0x1b6e92){return _0x497ecb['sendStatus'](_0x1c029d);}return _0x497ecb[_0x615c('0x18')](_0x1c029d)['end']();};}function respondWithResult(_0x525708,_0x31dca1){_0x31dca1=_0x31dca1||0xc8;return function(_0x11d751){if(_0x11d751){return _0x525708[_0x615c('0x18')](_0x31dca1)[_0x615c('0x19')](_0x11d751);}};}function respondWithFilteredResult(_0x146659,_0x1ab157){return function(_0x55ec9e){if(_0x55ec9e){var _0x2d10d2=typeof _0x1ab157[_0x615c('0x1a')]===_0x615c('0x1b')&&typeof _0x1ab157['limit']===_0x615c('0x1b');var _0x3953aa=_0x55ec9e[_0x615c('0x1c')];var _0x1e0d18=_0x2d10d2?0x0:_0x1ab157[_0x615c('0x1a')];var _0x374516=_0x2d10d2?_0x55ec9e[_0x615c('0x1c')]:_0x1ab157[_0x615c('0x1a')]+_0x1ab157['limit'];var _0x504e63;if(_0x374516>=_0x3953aa){_0x374516=_0x3953aa;_0x504e63=0xc8;}else{_0x504e63=0xce;}_0x146659['status'](_0x504e63);return _0x146659[_0x615c('0x1d')](_0x615c('0x1e'),_0x1e0d18+'-'+_0x374516+'/'+_0x3953aa)[_0x615c('0x19')](_0x55ec9e);}return null;};}function patchUpdates(_0x146c58){return function(_0x5c6e16){try{jsonpatch['apply'](_0x5c6e16,_0x146c58,!![]);}catch(_0x2f77cc){return BPromise['reject'](_0x2f77cc);}return _0x5c6e16[_0x615c('0x1f')]();};}function saveUpdates(_0x53638f,_0x23e4c5){return function(_0x508ea5){if(_0x508ea5){return _0x508ea5[_0x615c('0x20')](_0x53638f)[_0x615c('0x21')](function(_0x5d148b){return _0x5d148b;});}return null;};}function removeEntity(_0x4cca36,_0x5bba2f){return function(_0x4117f5){if(_0x4117f5){return _0x4117f5[_0x615c('0x22')]()[_0x615c('0x21')](function(){_0x4cca36[_0x615c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32635f,_0x2f1959){return function(_0x5968aa){if(!_0x5968aa){_0x32635f['sendStatus'](0x194);}return _0x5968aa;};}function handleError(_0x35ccef,_0x3bcff0){_0x3bcff0=_0x3bcff0||0x1f4;return function(_0x8671eb){logger['error'](_0x8671eb[_0x615c('0x23')]);if(_0x8671eb[_0x615c('0x24')]){delete _0x8671eb[_0x615c('0x24')];}_0x35ccef[_0x615c('0x18')](_0x3bcff0)['send'](_0x8671eb);};}exports[_0x615c('0x25')]=function(_0x174259,_0x2a4d37){var _0x263f90={},_0x41866b={},_0x266e46={'count':0x0,'rows':[]};var _0x2da5bb=_[_0x615c('0x26')](db[_0x615c('0x27')][_0x615c('0x28')],function(_0x1985a7){return{'name':_0x1985a7[_0x615c('0x29')],'type':_0x1985a7[_0x615c('0x2a')][_0x615c('0x2b')]};});_0x41866b['model']=_[_0x615c('0x26')](_0x2da5bb,_0x615c('0x24'));_0x41866b[_0x615c('0x2c')]=_[_0x615c('0x2d')](_0x174259[_0x615c('0x2c')]);_0x41866b[_0x615c('0x2e')]=_['intersection'](_0x41866b[_0x615c('0x2f')],_0x41866b[_0x615c('0x2c')]);_0x263f90[_0x615c('0x30')]=_[_0x615c('0x31')](_0x41866b[_0x615c('0x2f')],qs['fields'](_0x174259[_0x615c('0x2c')]['fields']));_0x263f90[_0x615c('0x30')]=_0x263f90[_0x615c('0x30')][_0x615c('0x32')]?_0x263f90[_0x615c('0x30')]:_0x41866b[_0x615c('0x2f')];if(!_0x174259[_0x615c('0x2c')]['hasOwnProperty'](_0x615c('0x33'))){_0x263f90[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x174259[_0x615c('0x2c')][_0x615c('0x34')]);_0x263f90[_0x615c('0x1a')]=qs[_0x615c('0x1a')](_0x174259['query'][_0x615c('0x1a')]);}_0x263f90[_0x615c('0x35')]=qs[_0x615c('0x36')](_0x174259[_0x615c('0x2c')]['sort']);_0x263f90[_0x615c('0x37')]=qs[_0x615c('0x2e')](_[_0x615c('0x38')](_0x174259[_0x615c('0x2c')],_0x41866b['filters']),_0x2da5bb);if(_0x174259['query'][_0x615c('0x39')]){_0x263f90[_0x615c('0x37')]=_[_0x615c('0x3a')](_0x263f90['where'],{'$or':_[_0x615c('0x26')](_0x2da5bb,function(_0x3a6ced){if(_0x3a6ced[_0x615c('0x2a')]!==_0x615c('0x3b')){var _0x57b921={};_0x57b921[_0x3a6ced['name']]={'$like':'%'+_0x174259[_0x615c('0x2c')]['filter']+'%'};return _0x57b921;}})});}_0x263f90=_[_0x615c('0x3a')]({},_0x263f90,_0x174259[_0x615c('0x3c')]);var _0xa59935={'where':_0x263f90['where']};return db[_0x615c('0x27')][_0x615c('0x1c')](_0xa59935)[_0x615c('0x21')](function(_0x93e864){_0x266e46[_0x615c('0x1c')]=_0x93e864;if(_0x174259['query'][_0x615c('0x3d')]){_0x263f90[_0x615c('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x263f90);})['then'](function(_0x1b8ce0){_0x266e46[_0x615c('0x3f')]=_0x1b8ce0;return _0x266e46;})['then'](respondWithFilteredResult(_0x2a4d37,_0x263f90))['catch'](handleError(_0x2a4d37,null));};exports[_0x615c('0x40')]=function(_0x210774,_0x46afa9){var _0x23ea59={'raw':!![],'where':{'id':_0x210774[_0x615c('0x41')]['id']}},_0x1f1d55={};_0x1f1d55[_0x615c('0x2f')]=_[_0x615c('0x2d')](db[_0x615c('0x27')][_0x615c('0x28')]);_0x1f1d55['query']=_[_0x615c('0x2d')](_0x210774[_0x615c('0x2c')]);_0x1f1d55[_0x615c('0x2e')]=_[_0x615c('0x31')](_0x1f1d55['model'],_0x1f1d55[_0x615c('0x2c')]);_0x23ea59[_0x615c('0x30')]=_[_0x615c('0x31')](_0x1f1d55[_0x615c('0x2f')],qs[_0x615c('0x42')](_0x210774[_0x615c('0x2c')]['fields']));_0x23ea59[_0x615c('0x30')]=_0x23ea59['attributes']['length']?_0x23ea59[_0x615c('0x30')]:_0x1f1d55['model'];if(_0x210774[_0x615c('0x2c')][_0x615c('0x3d')]){_0x23ea59[_0x615c('0x3e')]=[{'all':!![]}];}_0x23ea59=_[_0x615c('0x3a')]({},_0x23ea59,_0x210774[_0x615c('0x3c')]);return db[_0x615c('0x27')][_0x615c('0x43')](_0x23ea59)['then'](handleEntityNotFound(_0x46afa9,null))[_0x615c('0x21')](respondWithResult(_0x46afa9,null))[_0x615c('0x44')](handleError(_0x46afa9,null));};exports['create']=function(_0x38c3de,_0x343626){return db[_0x615c('0x27')]['create'](_0x38c3de[_0x615c('0x45')],{})[_0x615c('0x21')](respondWithResult(_0x343626,0xc9))[_0x615c('0x44')](handleError(_0x343626,null));};exports['update']=function(_0x1bd4f1,_0x546124){if(_0x1bd4f1[_0x615c('0x45')]['id']){delete _0x1bd4f1[_0x615c('0x45')]['id'];}return db[_0x615c('0x27')][_0x615c('0x43')]({'where':{'id':_0x1bd4f1[_0x615c('0x41')]['id']}})['then'](handleEntityNotFound(_0x546124,null))[_0x615c('0x21')](saveUpdates(_0x1bd4f1[_0x615c('0x45')],null))['then'](respondWithResult(_0x546124,null))[_0x615c('0x44')](handleError(_0x546124,null));};exports['destroy']=function(_0x25b4e7,_0x2800e2){return db[_0x615c('0x27')][_0x615c('0x43')]({'where':{'id':_0x25b4e7[_0x615c('0x41')]['id']}})[_0x615c('0x21')](handleEntityNotFound(_0x2800e2,null))[_0x615c('0x21')](removeEntity(_0x2800e2,null))[_0x615c('0x44')](handleError(_0x2800e2,null));};
\ No newline at end of file
index 580a5c3..5c11516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22f2=['define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x3d5db9,_0x2dbe0a){var _0x3c114c=function(_0x3e0239){while(--_0x3e0239){_0x3d5db9['push'](_0x3d5db9['shift']());}};_0x3c114c(++_0x2dbe0a);}(_0x22f2,0x110));var _0x222f=function(_0x121050,_0x4d7b5a){_0x121050=_0x121050-0x0;var _0x533103=_0x22f2[_0x121050];return _0x533103;};'use strict';var _=require(_0x222f('0x0'));var util=require(_0x222f('0x1'));var logger=require(_0x222f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x222f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x222f('0x4'));var config=require(_0x222f('0x5'));var attributes=require(_0x222f('0x6'));module[_0x222f('0x7')]=function(_0x28a2f,_0x242574){return _0x28a2f[_0x222f('0x8')](_0x222f('0x9'),attributes,{'tableName':_0x222f('0xa'),'paranoid':![],'indexes':[{'name':_0x222f('0xb'),'fields':[_0x222f('0xc'),_0x222f('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb125=['request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x724e1a,_0x499e03){var _0xec0235=function(_0x417ea9){while(--_0x417ea9){_0x724e1a['push'](_0x724e1a['shift']());}};_0xec0235(++_0x499e03);}(_0xb125,0xaf));var _0x5b12=function(_0x2b24dc,_0x17bc26){_0x2b24dc=_0x2b24dc-0x0;var _0x40c5e7=_0xb125[_0x2b24dc];return _0x40c5e7;};'use strict';var _=require(_0x5b12('0x0'));var util=require(_0x5b12('0x1'));var logger=require(_0x5b12('0x2'))(_0x5b12('0x3'));var moment=require(_0x5b12('0x4'));var BPromise=require('bluebird');var rp=require(_0x5b12('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b12('0x6'));var config=require(_0x5b12('0x7'));var attributes=require(_0x5b12('0x8'));module[_0x5b12('0x9')]=function(_0x5460da,_0x2bc845){return _0x5460da[_0x5b12('0xa')](_0x5b12('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x5b12('0xc'),'fields':[_0x5b12('0xd'),_0x5b12('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e0e3822..ba28e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ec2=['http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ec2,0x175));var _0x23ec=function(_0x4f3949,_0x1b28b5){_0x4f3949=_0x4f3949-0x0;var _0x2bbb60=_0x3ec2[_0x4f3949];return _0x2bbb60;};'use strict';var _=require(_0x23ec('0x0'));var util=require(_0x23ec('0x1'));var moment=require(_0x23ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x23ec('0x3'));var fs=require('fs');var Redis=require(_0x23ec('0x4'));var db=require(_0x23ec('0x5'))['db'];var utils=require(_0x23ec('0x6'));var logger=require('../../config/logger')(_0x23ec('0x7'));var config=require(_0x23ec('0x8'));var jayson=require(_0x23ec('0x9'));var client=jayson[_0x23ec('0xa')][_0x23ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293aa0,_0x46eb6a,_0x33dcac){return new BPromise(function(_0x46c687,_0x5be3b3){return client[_0x23ec('0xc')](_0x293aa0,_0x33dcac)[_0x23ec('0xd')](function(_0x19624d){logger[_0x23ec('0xe')](_0x23ec('0xf'),_0x46eb6a,_0x23ec('0x10'));logger[_0x23ec('0x11')](_0x23ec('0x12'),_0x46eb6a,_0x23ec('0x10'),JSON['stringify'](_0x19624d));if(_0x19624d[_0x23ec('0x13')]){if(_0x19624d['error'][_0x23ec('0x14')]===0x1f4){logger['error'](_0x23ec('0xf'),_0x46eb6a,_0x19624d['error'][_0x23ec('0x15')]);return _0x5be3b3(_0x19624d[_0x23ec('0x13')][_0x23ec('0x15')]);}logger['error'](_0x23ec('0xf'),_0x46eb6a,_0x19624d['error']['message']);return _0x46c687(_0x19624d['error']['message']);}else{logger['info'](_0x23ec('0xf'),_0x46eb6a,_0x23ec('0x10'));_0x46c687(_0x19624d[_0x23ec('0x16')][_0x23ec('0x15')]);}})[_0x23ec('0x17')](function(_0x502214){logger[_0x23ec('0x13')](_0x23ec('0xf'),_0x46eb6a,_0x502214);_0x5be3b3(_0x502214);});});}
\ No newline at end of file
+var _0x9504=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird'];(function(_0x10cb29,_0x1c7683){var _0x182e5b=function(_0x42e966){while(--_0x42e966){_0x10cb29['push'](_0x10cb29['shift']());}};_0x182e5b(++_0x1c7683);}(_0x9504,0xa5));var _0x4950=function(_0xfd330b,_0x57793d){_0xfd330b=_0xfd330b-0x0;var _0xa02d91=_0x9504[_0xfd330b];return _0xa02d91;};'use strict';var _=require(_0x4950('0x0'));var util=require(_0x4950('0x1'));var moment=require('moment');var BPromise=require(_0x4950('0x2'));var rs=require(_0x4950('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4950('0x4'))['db'];var utils=require(_0x4950('0x5'));var logger=require('../../config/logger')(_0x4950('0x6'));var config=require(_0x4950('0x7'));var jayson=require(_0x4950('0x8'));var client=jayson['client'][_0x4950('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8c6ac1,_0x109f1f,_0x1a1859){return new BPromise(function(_0xc5ac9e,_0x3ba6ce){return client[_0x4950('0xa')](_0x8c6ac1,_0x1a1859)[_0x4950('0xb')](function(_0x1548bc){logger[_0x4950('0xc')](_0x4950('0xd'),_0x109f1f,_0x4950('0xe'));logger[_0x4950('0xf')](_0x4950('0x10'),_0x109f1f,_0x4950('0xe'),JSON[_0x4950('0x11')](_0x1548bc));if(_0x1548bc['error']){if(_0x1548bc[_0x4950('0x12')]['code']===0x1f4){logger[_0x4950('0x12')]('DeskField,\x20%s,\x20%s',_0x109f1f,_0x1548bc[_0x4950('0x12')][_0x4950('0x13')]);return _0x3ba6ce(_0x1548bc[_0x4950('0x12')][_0x4950('0x13')]);}logger['error'](_0x4950('0xd'),_0x109f1f,_0x1548bc['error'][_0x4950('0x13')]);return _0xc5ac9e(_0x1548bc[_0x4950('0x12')][_0x4950('0x13')]);}else{logger[_0x4950('0xc')]('DeskField,\x20%s,\x20%s',_0x109f1f,'request\x20sent');_0xc5ac9e(_0x1548bc[_0x4950('0x14')]['message']);}})['catch'](function(_0x326520){logger[_0x4950('0x12')](_0x4950('0xd'),_0x109f1f,_0x326520);_0x3ba6ce(_0x326520);});});}
\ No newline at end of file
index 4e01107..3718fac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd16=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x143ab9,_0x1e9f97){var _0x50f303=function(_0x57132f){while(--_0x57132f){_0x143ab9['push'](_0x143ab9['shift']());}};_0x50f303(++_0x1e9f97);}(_0xcd16,0x182));var _0x6cd1=function(_0x33472e,_0x5c0680){_0x33472e=_0x33472e-0x0;var _0xd444b2=_0xcd16[_0x33472e];return _0xd444b2;};'use strict';var multer=require(_0x6cd1('0x0'));var util=require(_0x6cd1('0x1'));var path=require(_0x6cd1('0x2'));var timeout=require(_0x6cd1('0x3'));var express=require('express');var router=express[_0x6cd1('0x4')]();var fs_extra=require(_0x6cd1('0x5'));var auth=require(_0x6cd1('0x6'));var interaction=require(_0x6cd1('0x7'));var config=require(_0x6cd1('0x8'));var controller=require(_0x6cd1('0x9'));router[_0x6cd1('0xa')]('/',auth[_0x6cd1('0xb')](),controller[_0x6cd1('0xc')]);router['get']('/:id',auth[_0x6cd1('0xb')](),controller[_0x6cd1('0xd')]);router['get'](_0x6cd1('0xe'),auth[_0x6cd1('0xb')](),controller[_0x6cd1('0xf')]);router[_0x6cd1('0xa')]('/:id/fields',auth[_0x6cd1('0xb')](),controller['getFields']);router[_0x6cd1('0x10')]('/',auth[_0x6cd1('0xb')](),controller[_0x6cd1('0x11')]);router['post'](_0x6cd1('0xe'),auth[_0x6cd1('0xb')](),controller[_0x6cd1('0x12')]);router[_0x6cd1('0x13')](_0x6cd1('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x6cd1('0x15')](_0x6cd1('0x14'),auth[_0x6cd1('0xb')](),controller[_0x6cd1('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x749b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','create','post','addConfiguration','destroy','exports','multer','connect-timeout','express'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0x749b,0x18d));var _0xb749=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x749b[_0x5e2751];return _0x139a39;};'use strict';var multer=require(_0xb749('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb749('0x1'));var express=require(_0xb749('0x2'));var router=express[_0xb749('0x3')]();var fs_extra=require(_0xb749('0x4'));var auth=require(_0xb749('0x5'));var interaction=require(_0xb749('0x6'));var config=require(_0xb749('0x7'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb749('0x8')](_0xb749('0x9'),auth['isAuthenticated'](),controller[_0xb749('0xa')]);router[_0xb749('0x8')](_0xb749('0xb'),auth[_0xb749('0xc')](),controller[_0xb749('0xd')]);router['get']('/:id/fields',auth[_0xb749('0xc')](),controller[_0xb749('0xe')]);router['post']('/',auth[_0xb749('0xc')](),controller[_0xb749('0xf')]);router[_0xb749('0x10')](_0xb749('0xb'),auth['isAuthenticated'](),controller[_0xb749('0x11')]);router['put'](_0xb749('0x9'),auth[_0xb749('0xc')](),controller['update']);router['delete'](_0xb749('0x9'),auth[_0xb749('0xc')](),controller[_0xb749('0x12')]);module[_0xb749('0x13')]=router;
\ No newline at end of file
index d767569..be74650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa9c=['exports','STRING','sequelize'];(function(_0x1bb4da,_0x597af0){var _0x2bbc41=function(_0x90df2b){while(--_0x90df2b){_0x1bb4da['push'](_0x1bb4da['shift']());}};_0x2bbc41(++_0x597af0);}(_0xaa9c,0x110));var _0xcaa9=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xaa9c[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xcaa9('0x0'));module[_0xcaa9('0x1')]={'name':{'type':Sequelize[_0xcaa9('0x2')]},'username':{'type':Sequelize[_0xcaa9('0x2')]},'password':{'type':Sequelize[_0xcaa9('0x2')]},'remoteUri':{'type':Sequelize[_0xcaa9('0x2')]},'tenantId':{'type':Sequelize[_0xcaa9('0x2')]},'clientId':{'type':Sequelize[_0xcaa9('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcaa9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf9a8=['STRING','sequelize'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0xf9a8,0x1bd));var _0x8f9a=function(_0x159107,_0x4f214f){_0x159107=_0x159107-0x0;var _0x59801b=_0xf9a8[_0x159107];return _0x59801b;};'use strict';var Sequelize=require(_0x8f9a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8f9a('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8f9a('0x1')]},'tenantId':{'type':Sequelize[_0x8f9a('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8f9a('0x1')]},'serverUrl':{'type':Sequelize[_0x8f9a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8f9a('0x1')]}};
\ No newline at end of file
index 088b2ba..2efec32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61a5=['forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','4.0','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','type','merge','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','find','params','getConfigurations','findOne','Dynamics365Configuration','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ticketType','incident','Incident','title','customerid','ownerid','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','resolveby','resolvebykpiidname','responseby','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','Attributes','includes','LogicalName'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x61a5,0xf0));var _0x561a=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0x61a5[_0x59710f];return _0xaae66a;};'use strict';var emlformat=require(_0x561a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x561a('0x1'));var jsonpatch=require(_0x561a('0x2'));var rp=require(_0x561a('0x3'));var moment=require(_0x561a('0x4'));var BPromise=require(_0x561a('0x5'));var Mustache=require('mustache');var util=require(_0x561a('0x6'));var path=require(_0x561a('0x7'));var sox=require('sox');var csv=require(_0x561a('0x8'));var ejs=require(_0x561a('0x9'));var fs=require('fs');var fs_extra=require(_0x561a('0xa'));var _=require(_0x561a('0xb'));var squel=require(_0x561a('0xc'));var crypto=require(_0x561a('0xd'));var jsforce=require(_0x561a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x561a('0x8'));var querystring=require('querystring');var Papa=require(_0x561a('0xf'));var Redis=require(_0x561a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x561a('0x11'));var as=require(_0x561a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x561a('0x13'))('api');var utils=require(_0x561a('0x14'));var config=require(_0x561a('0x15'));var licenseUtil=require(_0x561a('0x16'));var db=require(_0x561a('0x17'))['db'];var integrations=require(_0x561a('0x18'));function respondWithStatusCode(_0x3dfa9f,_0x136465){_0x136465=_0x136465||0xcc;return function(_0x22c89d){if(_0x22c89d){return _0x3dfa9f[_0x561a('0x19')](_0x136465);}return _0x3dfa9f[_0x561a('0x1a')](_0x136465)[_0x561a('0x1b')]();};}function respondWithResult(_0x28638b,_0x5696b9){_0x5696b9=_0x5696b9||0xc8;return function(_0x4037a9){if(_0x4037a9){return _0x28638b[_0x561a('0x1a')](_0x5696b9)[_0x561a('0x1c')](_0x4037a9);}};}function respondWithFilteredResult(_0xecbcc4,_0xd7f0fb){return function(_0x28ad8b){if(_0x28ad8b){var _0x3d91be=typeof _0xd7f0fb[_0x561a('0x1d')]===_0x561a('0x1e')&&typeof _0xd7f0fb[_0x561a('0x1f')]===_0x561a('0x1e');var _0x48df6a=_0x28ad8b[_0x561a('0x20')];var _0x190057=_0x3d91be?0x0:_0xd7f0fb['offset'];var _0x11033f=_0x3d91be?_0x28ad8b[_0x561a('0x20')]:_0xd7f0fb['offset']+_0xd7f0fb[_0x561a('0x1f')];var _0x567399;if(_0x11033f>=_0x48df6a){_0x11033f=_0x48df6a;_0x567399=0xc8;}else{_0x567399=0xce;}_0xecbcc4['status'](_0x567399);return _0xecbcc4[_0x561a('0x21')](_0x561a('0x22'),_0x190057+'-'+_0x11033f+'/'+_0x48df6a)['json'](_0x28ad8b);}return null;};}function patchUpdates(_0x432b33){return function(_0x88b2b5){try{jsonpatch[_0x561a('0x23')](_0x88b2b5,_0x432b33,!![]);}catch(_0x3cf6c8){return BPromise[_0x561a('0x24')](_0x3cf6c8);}return _0x88b2b5[_0x561a('0x25')]();};}function saveUpdates(_0x4f9c3a,_0x3e5509){return function(_0x4480d8){if(_0x4480d8){return _0x4480d8[_0x561a('0x26')](_0x4f9c3a)['then'](function(_0x58c32f){return _0x58c32f;});}return null;};}function removeEntity(_0x25b53c,_0x1d29d6){return function(_0x27afb3){if(_0x27afb3){return _0x27afb3[_0x561a('0x27')]()[_0x561a('0x28')](function(){_0x25b53c[_0x561a('0x1a')](0xcc)[_0x561a('0x1b')]();});}};}function handleEntityNotFound(_0x326c1e,_0x5bf2fa){return function(_0x4c2752){if(!_0x4c2752){_0x326c1e[_0x561a('0x19')](0x194);}return _0x4c2752;};}function handleError(_0x2765c5,_0x986172){_0x986172=_0x986172||0x1f4;return function(_0x45dd89){logger['error'](_0x45dd89[_0x561a('0x29')]);if(_0x45dd89[_0x561a('0x2a')]){delete _0x45dd89[_0x561a('0x2a')];}_0x2765c5[_0x561a('0x1a')](_0x986172)[_0x561a('0x2b')](_0x45dd89);};}exports['index']=function(_0x42053f,_0x1d48d9){var _0x4f0b23={},_0x401636={},_0x276ae7={'count':0x0,'rows':[]};var _0x58db23=_[_0x561a('0x2c')](db['Dynamics365Account']['rawAttributes'],function(_0x3633d2){return{'name':_0x3633d2[_0x561a('0x2d')],'type':_0x3633d2['type'][_0x561a('0x2e')]};});_0x401636[_0x561a('0x2f')]=_[_0x561a('0x2c')](_0x58db23,_0x561a('0x2a'));_0x401636[_0x561a('0x30')]=_[_0x561a('0x31')](_0x42053f[_0x561a('0x30')]);_0x401636[_0x561a('0x32')]=_['intersection'](_0x401636[_0x561a('0x2f')],_0x401636[_0x561a('0x30')]);_0x4f0b23[_0x561a('0x33')]=_[_0x561a('0x34')](_0x401636[_0x561a('0x2f')],qs['fields'](_0x42053f[_0x561a('0x30')][_0x561a('0x35')]));_0x4f0b23[_0x561a('0x33')]=_0x4f0b23[_0x561a('0x33')]['length']?_0x4f0b23[_0x561a('0x33')]:_0x401636[_0x561a('0x2f')];if(!_0x42053f[_0x561a('0x30')]['hasOwnProperty']('nolimit')){_0x4f0b23[_0x561a('0x1f')]=qs['limit'](_0x42053f['query']['limit']);_0x4f0b23[_0x561a('0x1d')]=qs[_0x561a('0x1d')](_0x42053f[_0x561a('0x30')][_0x561a('0x1d')]);}_0x4f0b23[_0x561a('0x36')]=qs[_0x561a('0x37')](_0x42053f['query']['sort']);_0x4f0b23[_0x561a('0x38')]=qs[_0x561a('0x32')](_[_0x561a('0x39')](_0x42053f[_0x561a('0x30')],_0x401636[_0x561a('0x32')]),_0x58db23);if(_0x42053f[_0x561a('0x30')][_0x561a('0x3a')]){_0x4f0b23[_0x561a('0x38')]=_['merge'](_0x4f0b23[_0x561a('0x38')],{'$or':_[_0x561a('0x2c')](_0x58db23,function(_0x322d66){if(_0x322d66[_0x561a('0x3b')]!=='VIRTUAL'){var _0xbd11c4={};_0xbd11c4[_0x322d66[_0x561a('0x2a')]]={'$like':'%'+_0x42053f[_0x561a('0x30')]['filter']+'%'};return _0xbd11c4;}})});}_0x4f0b23=_[_0x561a('0x3c')]({},_0x4f0b23,_0x42053f[_0x561a('0x3d')]);var _0x289c68={'where':_0x4f0b23[_0x561a('0x38')]};return db[_0x561a('0x3e')][_0x561a('0x20')](_0x289c68)[_0x561a('0x28')](function(_0x51e608){_0x276ae7[_0x561a('0x20')]=_0x51e608;if(_0x42053f[_0x561a('0x30')][_0x561a('0x3f')]){_0x4f0b23[_0x561a('0x40')]=[{'all':!![]}];}return db[_0x561a('0x3e')][_0x561a('0x41')](_0x4f0b23);})['then'](function(_0x465376){_0x276ae7[_0x561a('0x42')]=_0x465376;return _0x276ae7;})[_0x561a('0x28')](respondWithFilteredResult(_0x1d48d9,_0x4f0b23))[_0x561a('0x43')](handleError(_0x1d48d9,null));};exports[_0x561a('0x44')]=function(_0x295adc,_0x293e11){var _0x32f8bd={'raw':![],'where':{'id':_0x295adc['params']['id']}},_0x2e32b3={};_0x2e32b3[_0x561a('0x2f')]=_[_0x561a('0x31')](db['Dynamics365Account'][_0x561a('0x45')]);_0x2e32b3['query']=_[_0x561a('0x31')](_0x295adc[_0x561a('0x30')]);_0x2e32b3[_0x561a('0x32')]=_[_0x561a('0x34')](_0x2e32b3[_0x561a('0x2f')],_0x2e32b3['query']);_0x32f8bd[_0x561a('0x33')]=_[_0x561a('0x34')](_0x2e32b3[_0x561a('0x2f')],qs[_0x561a('0x35')](_0x295adc[_0x561a('0x30')][_0x561a('0x35')]));_0x32f8bd['attributes']=_0x32f8bd['attributes'][_0x561a('0x46')]?_0x32f8bd['attributes']:_0x2e32b3['model'];if(_0x295adc['query']['includeAll']){_0x32f8bd['include']=[{'all':!![]}];}_0x32f8bd=_[_0x561a('0x3c')]({},_0x32f8bd,_0x295adc[_0x561a('0x3d')]);return db[_0x561a('0x3e')]['find'](_0x32f8bd)[_0x561a('0x28')](handleEntityNotFound(_0x293e11,null))['then'](respondWithResult(_0x293e11,null))['catch'](handleError(_0x293e11,null));};exports[_0x561a('0x47')]=function(_0x13a2ad,_0x19d247){return db['Dynamics365Account'][_0x561a('0x47')](_0x13a2ad['body'],{})[_0x561a('0x28')](respondWithResult(_0x19d247,0xc9))['catch'](handleError(_0x19d247,null));};exports[_0x561a('0x26')]=function(_0x43d557,_0x68dc4a){if(_0x43d557[_0x561a('0x48')]['id']){delete _0x43d557[_0x561a('0x48')]['id'];}return db[_0x561a('0x3e')][_0x561a('0x49')]({'where':{'id':_0x43d557[_0x561a('0x4a')]['id']}})[_0x561a('0x28')](handleEntityNotFound(_0x68dc4a,null))['then'](saveUpdates(_0x43d557[_0x561a('0x48')],null))[_0x561a('0x28')](respondWithResult(_0x68dc4a,null))[_0x561a('0x43')](handleError(_0x68dc4a,null));};exports['destroy']=function(_0x14fe1b,_0x4583b1){return db['Dynamics365Account'][_0x561a('0x49')]({'where':{'id':_0x14fe1b[_0x561a('0x4a')]['id']}})[_0x561a('0x28')](handleEntityNotFound(_0x4583b1,null))['then'](removeEntity(_0x4583b1,null))[_0x561a('0x43')](handleError(_0x4583b1,null));};exports[_0x561a('0x4b')]=function(_0x213e7c,_0x2cd4e0,_0xf1fa19){var _0x1f941f={};var _0x3d9b63={};var _0x4ebb99;var _0x14c7bd;return db[_0x561a('0x3e')][_0x561a('0x4c')]({'where':{'id':_0x213e7c[_0x561a('0x4a')]['id']}})[_0x561a('0x28')](handleEntityNotFound(_0x2cd4e0,null))[_0x561a('0x28')](function(_0x3b0a93){if(_0x3b0a93){_0x4ebb99=_0x3b0a93;_0x3d9b63['model']=_[_0x561a('0x31')](db[_0x561a('0x4d')][_0x561a('0x45')]);_0x3d9b63['query']=_[_0x561a('0x31')](_0x213e7c['query']);_0x3d9b63[_0x561a('0x32')]=_[_0x561a('0x34')](_0x3d9b63[_0x561a('0x2f')],_0x3d9b63[_0x561a('0x30')]);_0x1f941f[_0x561a('0x33')]=_[_0x561a('0x34')](_0x3d9b63[_0x561a('0x2f')],qs['fields'](_0x213e7c['query'][_0x561a('0x35')]));_0x1f941f[_0x561a('0x33')]=_0x1f941f[_0x561a('0x33')][_0x561a('0x46')]?_0x1f941f[_0x561a('0x33')]:_0x3d9b63[_0x561a('0x2f')];_0x1f941f['order']=qs[_0x561a('0x37')](_0x213e7c[_0x561a('0x30')]['sort']);_0x1f941f[_0x561a('0x38')]=qs['filters'](_[_0x561a('0x39')](_0x213e7c[_0x561a('0x30')],_0x3d9b63[_0x561a('0x32')]));if(_0x213e7c[_0x561a('0x30')][_0x561a('0x3a')]){_0x1f941f['where']=_[_0x561a('0x3c')](_0x1f941f['where'],{'$or':_[_0x561a('0x2c')](_0x1f941f[_0x561a('0x33')],function(_0x457d0e){var _0x552460={};_0x552460[_0x457d0e]={'$like':'%'+_0x213e7c['query']['filter']+'%'};return _0x552460;})});}_0x1f941f=_['merge']({},_0x1f941f,_0x213e7c[_0x561a('0x3d')]);return _0x4ebb99[_0x561a('0x4b')](_0x1f941f);}})['then'](function(_0xb0f744){if(_0xb0f744){_0x14c7bd=_0xb0f744[_0x561a('0x46')];if(!_0x213e7c[_0x561a('0x30')]['hasOwnProperty'](_0x561a('0x4e'))){_0x1f941f[_0x561a('0x1f')]=qs[_0x561a('0x1f')](_0x213e7c[_0x561a('0x30')][_0x561a('0x1f')]);_0x1f941f[_0x561a('0x1d')]=qs[_0x561a('0x1d')](_0x213e7c[_0x561a('0x30')][_0x561a('0x1d')]);}return _0x4ebb99[_0x561a('0x4b')](_0x1f941f);}})[_0x561a('0x28')](function(_0x5ac279){if(_0x5ac279){return _0x5ac279?{'count':_0x14c7bd,'rows':_0x5ac279}:null;}})[_0x561a('0x28')](respondWithResult(_0x2cd4e0,null))[_0x561a('0x43')](handleError(_0x2cd4e0,null));};exports['addConfiguration']=function(_0x54056b,_0x33509a,_0x2b8d54){if(_0x54056b['body']['id']){delete _0x54056b[_0x561a('0x48')]['id'];}return db[_0x561a('0x3e')][_0x561a('0x4c')]({'where':{'id':_0x54056b[_0x561a('0x4a')]['id']}})[_0x561a('0x28')](handleEntityNotFound(_0x33509a,null))[_0x561a('0x28')](function(_0x51219f){if(_0x51219f){_0x54056b['body'][_0x561a('0x4f')]=_0x51219f['id'];_0x54056b[_0x561a('0x48')][_0x561a('0x50')]=integrations[_0x561a('0x51')](_0x54056b[_0x561a('0x48')][_0x561a('0x52')],_0x54056b['body']['type']);_0x54056b['body'][_0x561a('0x53')]=integrations[_0x561a('0x54')](_0x54056b[_0x561a('0x48')]['channel'],_0x54056b['body']['type']);return db['Dynamics365Configuration'][_0x561a('0x47')](_0x54056b[_0x561a('0x48')],{'include':[{'model':db['Dynamics365Field'],'as':_0x561a('0x50')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x561a('0x28')](respondWithResult(_0x33509a,null))[_0x561a('0x43')](handleError(_0x33509a,null));};exports['getFields']=function(_0x40bc90,_0x5eb0d9,_0x19fc87){var _0x2baa25=_0x40bc90[_0x561a('0x30')][_0x561a('0x55')];var _0x1cac4b=_0x2baa25===_0x561a('0x56')?_0x561a('0x57'):'PhoneCall';var _0x4ef174='';var _0x41a1a7='';var _0x4428ba='';var _0x5dbbae='';var _0x2eb2db='';var _0x31d907='';var _0x4b7a20='';var _0x2d4f3b='';var _0x2ff92a=[_0x561a('0x58'),'description',_0x561a('0x59'),_0x561a('0x5a'),'caseorigincode',_0x561a('0x5b'),'phonenumber',_0x561a('0x5c'),_0x561a('0x5d'),_0x561a('0x5e')];var _0x511793=[_0x561a('0x5f'),'accountidyominame',_0x561a('0x60'),'billedserviceunits',_0x561a('0x61'),_0x561a('0x62'),_0x561a('0x63'),_0x561a('0x64'),_0x561a('0x65'),_0x561a('0x66'),'createdbyname','createdbyyominame',_0x561a('0x67'),_0x561a('0x68'),'createdonbehalfbyyominame',_0x561a('0x69'),_0x561a('0x6a'),_0x561a('0x6b'),_0x561a('0x6c'),_0x561a('0x6d'),_0x561a('0x6e'),_0x561a('0x6f'),_0x561a('0x70'),_0x561a('0x71'),_0x561a('0x72'),_0x561a('0x73'),_0x561a('0x74'),_0x561a('0x75'),'kbarticleidname',_0x561a('0x76'),_0x561a('0x77'),_0x561a('0x78'),'modifiedbyexternalpartyyominame',_0x561a('0x79'),_0x561a('0x7a'),_0x561a('0x7b'),_0x561a('0x7c'),'modifiedonbehalfbyyominame',_0x561a('0x7d'),_0x561a('0x7e'),_0x561a('0x7f'),_0x561a('0x80'),_0x561a('0x81'),_0x561a('0x82'),_0x561a('0x83'),'owneridyominame','parentcaseidname',_0x561a('0x84'),_0x561a('0x85'),'prioritycodename','productidname','productserialnumber',_0x561a('0x86'),_0x561a('0x87'),_0x561a('0x88'),'responsiblecontactidname','responsiblecontactidyominame','sentimentvalue',_0x561a('0x89'),_0x561a('0x8a'),_0x561a('0x8b'),_0x561a('0x8c'),'statuscode',_0x561a('0x8d'),_0x561a('0x8e'),_0x561a('0x8f'),_0x561a('0x90'),_0x561a('0x91'),'utcconversiontimezonecode','versionnumber'];var _0x3fba76=_0x2ff92a[_0x561a('0x92')](_0x511793);return db[_0x561a('0x3e')][_0x561a('0x4c')]({'where':{'id':_0x40bc90[_0x561a('0x4a')]['id']},'attributes':['id',_0x561a('0x93'),'password',_0x561a('0x94'),_0x561a('0x95'),_0x561a('0x96'),_0x561a('0x97')]})[_0x561a('0x28')](handleEntityNotFound(_0x5eb0d9,null))['then'](function(_0x2fd5d9){if(_0x2fd5d9){_0x2d4f3b=_0x2fd5d9[_0x561a('0x94')];var _0x295166=_0x2d4f3b[_0x561a('0x98')](-0x1);if(_0x295166==='/'){_0x2d4f3b=_0x2d4f3b[_0x561a('0x99')](0x0,_0x2d4f3b[_0x561a('0x9a')](_0x295166));}_0x4b7a20=util[_0x561a('0x9b')](_0x561a('0x9c'),_0x2d4f3b);var _0x917757={'method':'POST','uri':_0x561a('0x9d')+_0x2fd5d9[_0x561a('0x95')]+_0x561a('0x9e'),'form':{'client_id':_0x2fd5d9[_0x561a('0x96')],'resource':_0x2d4f3b,'username':_0x2fd5d9[_0x561a('0x93')],'password':_0x2fd5d9[_0x561a('0x9f')],'grant_type':_0x561a('0x9f'),'client_secret':_0x2fd5d9['clientSecret']},'json':!![]};return rp(_0x917757);}})[_0x561a('0x28')](function(_0x163f70){_0x31d907=_0x163f70['access_token'];var _0x1eb6aa={'method':_0x561a('0xa0'),'uri':encodeURI(_0x4b7a20+_0x561a('0xa1')+_0x1cac4b+'\x27'),'headers':{'Authorization':_0x561a('0xa2')+_0x31d907,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1eb6aa);})[_0x561a('0x28')](function(_0x19d817){var _0x23da4f=_0x19d817[_0x561a('0xa3')][0x0];var _0x2a5c58=_0x23da4f[_0x561a('0xa4')];var _0x1140ac={'method':_0x561a('0xa0'),'uri':_0x4b7a20+'EntityDefinitions('+_0x2a5c58+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x561a('0xa2')+_0x31d907,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1140ac);})[_0x561a('0x28')](function(_0xb5aecd){_0x4ef174=_0xb5aecd;_0x41a1a7=_0x4ef174[_0x561a('0xa5')];_0x41a1a7=_['remove'](_0x41a1a7,function(_0x15b8ab){return!_0x3fba76[_0x561a('0xa6')](_0x15b8ab[_0x561a('0xa7')]);});var _0x1d2cfd=[];var _0x54168b=[];_0x41a1a7[_0x561a('0xa8')](function(_0x121c7b){if(_0x121c7b['@odata.type']){var _0x515820=_0x121c7b['@odata.type']['substring'](_0x121c7b[_0x561a('0xa9')][_0x561a('0x9a')]('.')+0x1);if(_0x515820==='PicklistAttributeMetadata'){_0x1d2cfd[_0x561a('0xaa')](getSelectList(_0x4b7a20,_0x2baa25,_0x54168b,_0x4ef174[_0x561a('0xa4')],_0x121c7b[_0x561a('0xa4')],_0x31d907));}}});return Promise[_0x561a('0xab')](_0x1d2cfd);})[_0x561a('0x28')](function(_0x40a372){_0x4428ba=_0x40a372[0x0];var _0x1fbb12=[];var _0x603e94=[];_0x41a1a7[_0x561a('0xa8')](function(_0x5f3f4c){if(!_[_0x561a('0xac')](_0x5f3f4c[_0x561a('0xa9')])){var _0x507273=_0x5f3f4c[_0x561a('0xa9')][_0x561a('0x99')](_0x5f3f4c[_0x561a('0xa9')][_0x561a('0x9a')]('.')+0x1);if(_0x507273===_0x561a('0xad')){_0x1fbb12['push'](getBooleanList(_0x4b7a20,_0x2baa25,_0x603e94,_0x4ef174[_0x561a('0xa4')],_0x5f3f4c[_0x561a('0xa4')],_0x31d907));}}});return Promise[_0x561a('0xab')](_0x1fbb12);})[_0x561a('0x28')](function(_0x3098d8){_0x5dbbae=_0x3098d8[0x0];var _0x2be528=[];var _0x1251bf=[];_0x41a1a7['forEach'](function(_0x299d9c){if(_0x299d9c[_0x561a('0xa9')]){var _0x93530e=_0x299d9c['@odata.type']['substring'](_0x299d9c[_0x561a('0xa9')]['lastIndexOf']('.')+0x1);if(_0x93530e===_0x561a('0xae')||_0x93530e===_0x561a('0xaf')||_0x93530e===_0x561a('0xb0')||_0x93530e===_0x561a('0xb1')||_0x93530e==='MemoAttributeMetadata'||_0x93530e===_0x561a('0xb2')||_0x93530e===_0x561a('0xb3')||_0x93530e===_0x561a('0xb4')||_0x93530e===_0x561a('0xb5')||_0x93530e===_0x561a('0xb6')){_0x2be528[_0x561a('0xaa')](getInputList(_0x4b7a20,_0x2baa25,_0x93530e,_0x1251bf,_0x4ef174['MetadataId'],_0x299d9c[_0x561a('0xa4')],_0x31d907));}}});return Promise[_0x561a('0xab')](_0x2be528);})[_0x561a('0x28')](function(_0x56f282){_0x2eb2db=_0x56f282[0x0];var _0x407c68=_0x4428ba[_0x561a('0x92')](_0x5dbbae)[_0x561a('0x92')](_0x2eb2db);var _0x454ce0={'count':_0x407c68[_0x561a('0x46')],'rows':_0x407c68};return _0x454ce0;})[_0x561a('0x28')](respondWithResult(_0x5eb0d9,null))[_0x561a('0x43')](function(_0x1939cc){var _0x5978e1=_0x40bc90['query'][_0x561a('0xb7')]?0x1f4:_0x1939cc[_0x561a('0xb8')]||0x1f4;logger[_0x561a('0xb9')](_0x1939cc[_0x561a('0x29')]);delete _0x1939cc[_0x561a('0x2a')];if(_0x5978e1===0x191){_0x5978e1=0x190;}_0x5eb0d9[_0x561a('0x1a')](_0x5978e1)[_0x561a('0x2b')](_0x40bc90[_0x561a('0x30')][_0x561a('0xb7')]?{'message':_0x561a('0xba'),'statusCode':_0x1939cc['statusCode']}:_0x1939cc);});};function getSelectList(_0xcf664d,_0x32d26c,_0x20136e,_0x437754,_0x2656fb,_0x5d6e1c){var _0x2417b7={'method':_0x561a('0xa0'),'uri':_0xcf664d+_0x561a('0xbb')+_0x437754+_0x561a('0xbc')+_0x2656fb+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x561a('0xbd'),'headers':{'Authorization':'Bearer\x20'+_0x5d6e1c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2417b7)['then'](function(_0x393c5b){var _0x39f2f2=[];var _0x1a8e29=_0x393c5b[_0x561a('0xbe')][_0x561a('0xbf')];_0x1a8e29[_0x561a('0xa8')](function(_0x38b363){_0x39f2f2[_0x561a('0xaa')]({'name':_0x38b363[_0x561a('0xc0')][_0x561a('0xc1')][_0x561a('0xc0')],'value':String(_0x38b363[_0x561a('0xc2')])});});var _0x45839e={'id':_0x32d26c+'_'+_0x393c5b[_0x561a('0xa7')],'name':_0x393c5b[_0x561a('0xc3')][_0x561a('0xc1')][_0x561a('0xc0')],'custom':![],'options':_0x39f2f2};_0x20136e[_0x561a('0xaa')](_0x45839e);return _0x20136e;});}function getBooleanList(_0x44d7fd,_0x33a52f,_0x4ef20a,_0x39a4a5,_0x46ae9c,_0x12e02d){var _0x3cf431={'method':_0x561a('0xa0'),'uri':_0x44d7fd+_0x561a('0xbb')+_0x39a4a5+_0x561a('0xbc')+_0x46ae9c+_0x561a('0xc4'),'headers':{'Authorization':'Bearer\x20'+_0x12e02d,'If-None-Match':null,'OData-Version':_0x561a('0xc5')},'json':!![]};return rp(_0x3cf431)[_0x561a('0x28')](function(_0x5079a8){var _0x1ffbd5=[];_0x1ffbd5[_0x561a('0xaa')]({'name':_0x5079a8[_0x561a('0xbe')][_0x561a('0xc6')][_0x561a('0xc0')][_0x561a('0xc1')]['Label'],'value':_0x561a('0xc7')},{'name':_0x5079a8[_0x561a('0xbe')][_0x561a('0xc8')]['Label'][_0x561a('0xc1')][_0x561a('0xc0')],'value':_0x561a('0xc9')});var _0x239232={'id':_0x33a52f+'_'+_0x5079a8[_0x561a('0xa7')],'name':_0x5079a8[_0x561a('0xc3')][_0x561a('0xc1')][_0x561a('0xc0')],'custom':![],'options':_0x1ffbd5};_0x4ef20a[_0x561a('0xaa')](_0x239232);return _0x4ef20a;});}function getInputList(_0x169dcb,_0x7b97c5,_0x3935d9,_0x18b4dd,_0x1498b1,_0xe1b486,_0x469c6e){var _0x42859d={'method':_0x561a('0xa0'),'uri':_0x169dcb+_0x561a('0xbb')+_0x1498b1+_0x561a('0xbc')+_0xe1b486+_0x561a('0xca')+_0x3935d9+_0x561a('0xcb'),'headers':{'Authorization':_0x561a('0xa2')+_0x469c6e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x42859d)[_0x561a('0x28')](function(_0x445981){var _0xb9ebf1={'id':_0x7b97c5+'_'+_0x445981[_0x561a('0xa7')],'name':_0x445981[_0x561a('0xc3')]['UserLocalizedLabel']?_0x445981[_0x561a('0xc3')][_0x561a('0xc1')][_0x561a('0xc0')]:_0x445981[_0x561a('0xa7')],'custom':![],'options':[]};_0x18b4dd['push'](_0xb9ebf1);return _0x18b4dd;});}
\ No newline at end of file
+var _0xeb5d=['limit','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','update','getConfigurations','hasOwnProperty','findOne','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','send','Wrong\x20credentials','statusCode',')/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','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','set','Content-Range','json','apply','then','destroy','error','stack','name','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x161301,_0x2c8c1b){var _0x403e41=function(_0x1e9cfc){while(--_0x1e9cfc){_0x161301['push'](_0x161301['shift']());}};_0x403e41(++_0x2c8c1b);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb5d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdeb5('0x0'));var zipdir=require(_0xdeb5('0x1'));var jsonpatch=require(_0xdeb5('0x2'));var rp=require(_0xdeb5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdeb5('0x4'));var util=require(_0xdeb5('0x5'));var path=require('path');var sox=require(_0xdeb5('0x6'));var csv=require(_0xdeb5('0x7'));var ejs=require(_0xdeb5('0x8'));var fs=require('fs');var fs_extra=require(_0xdeb5('0x9'));var _=require(_0xdeb5('0xa'));var squel=require(_0xdeb5('0xb'));var crypto=require(_0xdeb5('0xc'));var jsforce=require(_0xdeb5('0xd'));var deskjs=require(_0xdeb5('0xe'));var toCsv=require(_0xdeb5('0x7'));var querystring=require(_0xdeb5('0xf'));var Papa=require(_0xdeb5('0x10'));var Redis=require(_0xdeb5('0x11'));var authService=require(_0xdeb5('0x12'));var qs=require(_0xdeb5('0x13'));var as=require(_0xdeb5('0x14'));var hardwareService=require(_0xdeb5('0x15'));var logger=require('../../config/logger')(_0xdeb5('0x16'));var utils=require(_0xdeb5('0x17'));var config=require(_0xdeb5('0x18'));var licenseUtil=require(_0xdeb5('0x19'));var db=require(_0xdeb5('0x1a'))['db'];var integrations=require(_0xdeb5('0x1b'));function respondWithStatusCode(_0x2fe452,_0xb55c82){_0xb55c82=_0xb55c82||0xcc;return function(_0x59f62e){if(_0x59f62e){return _0x2fe452[_0xdeb5('0x1c')](_0xb55c82);}return _0x2fe452['status'](_0xb55c82)[_0xdeb5('0x1d')]();};}function respondWithResult(_0x11d83a,_0x266aa2){_0x266aa2=_0x266aa2||0xc8;return function(_0x3a63c8){if(_0x3a63c8){return _0x11d83a[_0xdeb5('0x1e')](_0x266aa2)['json'](_0x3a63c8);}};}function respondWithFilteredResult(_0x82d3ba,_0x384145){return function(_0x5caec0){if(_0x5caec0){var _0x17312b=typeof _0x384145[_0xdeb5('0x1f')]===_0xdeb5('0x20')&&typeof _0x384145['limit']==='undefined';var _0x3a44e1=_0x5caec0['count'];var _0x1679ee=_0x17312b?0x0:_0x384145[_0xdeb5('0x1f')];var _0x86b945=_0x17312b?_0x5caec0['count']:_0x384145[_0xdeb5('0x1f')]+_0x384145['limit'];var _0x20ac22;if(_0x86b945>=_0x3a44e1){_0x86b945=_0x3a44e1;_0x20ac22=0xc8;}else{_0x20ac22=0xce;}_0x82d3ba[_0xdeb5('0x1e')](_0x20ac22);return _0x82d3ba[_0xdeb5('0x21')](_0xdeb5('0x22'),_0x1679ee+'-'+_0x86b945+'/'+_0x3a44e1)[_0xdeb5('0x23')](_0x5caec0);}return null;};}function patchUpdates(_0x540300){return function(_0x16c5c3){try{jsonpatch[_0xdeb5('0x24')](_0x16c5c3,_0x540300,!![]);}catch(_0x4ef4d5){return BPromise['reject'](_0x4ef4d5);}return _0x16c5c3['save']();};}function saveUpdates(_0x1ca65d,_0x14af0f){return function(_0xc21d92){if(_0xc21d92){return _0xc21d92['update'](_0x1ca65d)[_0xdeb5('0x25')](function(_0x5cdf41){return _0x5cdf41;});}return null;};}function removeEntity(_0x37d039,_0x30e5c3){return function(_0x462310){if(_0x462310){return _0x462310[_0xdeb5('0x26')]()[_0xdeb5('0x25')](function(){_0x37d039[_0xdeb5('0x1e')](0xcc)[_0xdeb5('0x1d')]();});}};}function handleEntityNotFound(_0x3e9fe2,_0x17fb18){return function(_0x1a30b1){if(!_0x1a30b1){_0x3e9fe2['sendStatus'](0x194);}return _0x1a30b1;};}function handleError(_0x466ca7,_0x3bcc76){_0x3bcc76=_0x3bcc76||0x1f4;return function(_0x427302){logger[_0xdeb5('0x27')](_0x427302[_0xdeb5('0x28')]);if(_0x427302['name']){delete _0x427302[_0xdeb5('0x29')];}_0x466ca7[_0xdeb5('0x1e')](_0x3bcc76)['send'](_0x427302);};}exports[_0xdeb5('0x2a')]=function(_0x4eb19b,_0x41bf2b){var _0x37a417={},_0x5dc7e2={},_0x4a2065={'count':0x0,'rows':[]};var _0x19841d=_[_0xdeb5('0x2b')](db[_0xdeb5('0x2c')][_0xdeb5('0x2d')],function(_0x12931a){return{'name':_0x12931a['fieldName'],'type':_0x12931a[_0xdeb5('0x2e')][_0xdeb5('0x2f')]};});_0x5dc7e2[_0xdeb5('0x30')]=_[_0xdeb5('0x2b')](_0x19841d,_0xdeb5('0x29'));_0x5dc7e2[_0xdeb5('0x31')]=_[_0xdeb5('0x32')](_0x4eb19b[_0xdeb5('0x31')]);_0x5dc7e2[_0xdeb5('0x33')]=_[_0xdeb5('0x34')](_0x5dc7e2[_0xdeb5('0x30')],_0x5dc7e2[_0xdeb5('0x31')]);_0x37a417[_0xdeb5('0x35')]=_['intersection'](_0x5dc7e2[_0xdeb5('0x30')],qs['fields'](_0x4eb19b[_0xdeb5('0x31')][_0xdeb5('0x36')]));_0x37a417[_0xdeb5('0x35')]=_0x37a417['attributes'][_0xdeb5('0x37')]?_0x37a417['attributes']:_0x5dc7e2['model'];if(!_0x4eb19b[_0xdeb5('0x31')]['hasOwnProperty'](_0xdeb5('0x38'))){_0x37a417[_0xdeb5('0x39')]=qs[_0xdeb5('0x39')](_0x4eb19b[_0xdeb5('0x31')][_0xdeb5('0x39')]);_0x37a417[_0xdeb5('0x1f')]=qs[_0xdeb5('0x1f')](_0x4eb19b[_0xdeb5('0x31')]['offset']);}_0x37a417[_0xdeb5('0x3a')]=qs['sort'](_0x4eb19b[_0xdeb5('0x31')][_0xdeb5('0x3b')]);_0x37a417[_0xdeb5('0x3c')]=qs[_0xdeb5('0x33')](_[_0xdeb5('0x3d')](_0x4eb19b[_0xdeb5('0x31')],_0x5dc7e2[_0xdeb5('0x33')]),_0x19841d);if(_0x4eb19b[_0xdeb5('0x31')][_0xdeb5('0x3e')]){_0x37a417[_0xdeb5('0x3c')]=_[_0xdeb5('0x3f')](_0x37a417[_0xdeb5('0x3c')],{'$or':_[_0xdeb5('0x2b')](_0x19841d,function(_0x225c73){if(_0x225c73[_0xdeb5('0x2e')]!=='VIRTUAL'){var _0x45f6fe={};_0x45f6fe[_0x225c73['name']]={'$like':'%'+_0x4eb19b[_0xdeb5('0x31')][_0xdeb5('0x3e')]+'%'};return _0x45f6fe;}})});}_0x37a417=_[_0xdeb5('0x3f')]({},_0x37a417,_0x4eb19b[_0xdeb5('0x40')]);var _0x3bc66e={'where':_0x37a417['where']};return db['Dynamics365Account'][_0xdeb5('0x41')](_0x3bc66e)[_0xdeb5('0x25')](function(_0x42c821){_0x4a2065['count']=_0x42c821;if(_0x4eb19b[_0xdeb5('0x31')]['includeAll']){_0x37a417[_0xdeb5('0x42')]=[{'all':!![]}];}return db[_0xdeb5('0x2c')][_0xdeb5('0x43')](_0x37a417);})['then'](function(_0x450bbc){_0x4a2065[_0xdeb5('0x44')]=_0x450bbc;return _0x4a2065;})[_0xdeb5('0x25')](respondWithFilteredResult(_0x41bf2b,_0x37a417))[_0xdeb5('0x45')](handleError(_0x41bf2b,null));};exports['show']=function(_0x34604e,_0x34c2ae){var _0x55ece2={'raw':![],'where':{'id':_0x34604e[_0xdeb5('0x46')]['id']}},_0x2c1b35={};_0x2c1b35[_0xdeb5('0x30')]=_[_0xdeb5('0x32')](db[_0xdeb5('0x2c')][_0xdeb5('0x2d')]);_0x2c1b35[_0xdeb5('0x31')]=_[_0xdeb5('0x32')](_0x34604e[_0xdeb5('0x31')]);_0x2c1b35[_0xdeb5('0x33')]=_['intersection'](_0x2c1b35[_0xdeb5('0x30')],_0x2c1b35[_0xdeb5('0x31')]);_0x55ece2[_0xdeb5('0x35')]=_[_0xdeb5('0x34')](_0x2c1b35[_0xdeb5('0x30')],qs[_0xdeb5('0x36')](_0x34604e[_0xdeb5('0x31')][_0xdeb5('0x36')]));_0x55ece2[_0xdeb5('0x35')]=_0x55ece2['attributes'][_0xdeb5('0x37')]?_0x55ece2[_0xdeb5('0x35')]:_0x2c1b35['model'];if(_0x34604e[_0xdeb5('0x31')][_0xdeb5('0x47')]){_0x55ece2[_0xdeb5('0x42')]=[{'all':!![]}];}_0x55ece2=_[_0xdeb5('0x3f')]({},_0x55ece2,_0x34604e['options']);return db[_0xdeb5('0x2c')][_0xdeb5('0x48')](_0x55ece2)['then'](handleEntityNotFound(_0x34c2ae,null))['then'](respondWithResult(_0x34c2ae,null))[_0xdeb5('0x45')](handleError(_0x34c2ae,null));};exports[_0xdeb5('0x49')]=function(_0x214d5c,_0x23b6f4){return db[_0xdeb5('0x2c')]['create'](_0x214d5c[_0xdeb5('0x4a')],{})[_0xdeb5('0x25')](respondWithResult(_0x23b6f4,0xc9))[_0xdeb5('0x45')](handleError(_0x23b6f4,null));};exports[_0xdeb5('0x4b')]=function(_0xc7ca95,_0x3f0484){if(_0xc7ca95[_0xdeb5('0x4a')]['id']){delete _0xc7ca95[_0xdeb5('0x4a')]['id'];}return db[_0xdeb5('0x2c')]['find']({'where':{'id':_0xc7ca95[_0xdeb5('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f0484,null))[_0xdeb5('0x25')](saveUpdates(_0xc7ca95['body'],null))[_0xdeb5('0x25')](respondWithResult(_0x3f0484,null))[_0xdeb5('0x45')](handleError(_0x3f0484,null));};exports[_0xdeb5('0x26')]=function(_0x1089f2,_0x3c3b08){return db[_0xdeb5('0x2c')][_0xdeb5('0x48')]({'where':{'id':_0x1089f2[_0xdeb5('0x46')]['id']}})[_0xdeb5('0x25')](handleEntityNotFound(_0x3c3b08,null))[_0xdeb5('0x25')](removeEntity(_0x3c3b08,null))[_0xdeb5('0x45')](handleError(_0x3c3b08,null));};exports[_0xdeb5('0x4c')]=function(_0x481961,_0x14e8fc,_0x180b7f){var _0x3f2fd2={};var _0x5e6e17={};var _0x3bca2e;var _0x45914d;return db[_0xdeb5('0x2c')]['findOne']({'where':{'id':_0x481961[_0xdeb5('0x46')]['id']}})[_0xdeb5('0x25')](handleEntityNotFound(_0x14e8fc,null))[_0xdeb5('0x25')](function(_0x1edafd){if(_0x1edafd){_0x3bca2e=_0x1edafd;_0x5e6e17['model']=_[_0xdeb5('0x32')](db['Dynamics365Configuration'][_0xdeb5('0x2d')]);_0x5e6e17[_0xdeb5('0x31')]=_['keys'](_0x481961[_0xdeb5('0x31')]);_0x5e6e17[_0xdeb5('0x33')]=_[_0xdeb5('0x34')](_0x5e6e17[_0xdeb5('0x30')],_0x5e6e17[_0xdeb5('0x31')]);_0x3f2fd2['attributes']=_['intersection'](_0x5e6e17[_0xdeb5('0x30')],qs[_0xdeb5('0x36')](_0x481961['query']['fields']));_0x3f2fd2[_0xdeb5('0x35')]=_0x3f2fd2[_0xdeb5('0x35')][_0xdeb5('0x37')]?_0x3f2fd2['attributes']:_0x5e6e17['model'];_0x3f2fd2['order']=qs[_0xdeb5('0x3b')](_0x481961[_0xdeb5('0x31')][_0xdeb5('0x3b')]);_0x3f2fd2[_0xdeb5('0x3c')]=qs[_0xdeb5('0x33')](_[_0xdeb5('0x3d')](_0x481961[_0xdeb5('0x31')],_0x5e6e17[_0xdeb5('0x33')]));if(_0x481961[_0xdeb5('0x31')][_0xdeb5('0x3e')]){_0x3f2fd2['where']=_[_0xdeb5('0x3f')](_0x3f2fd2[_0xdeb5('0x3c')],{'$or':_[_0xdeb5('0x2b')](_0x3f2fd2[_0xdeb5('0x35')],function(_0x50282c){var _0x18ff57={};_0x18ff57[_0x50282c]={'$like':'%'+_0x481961[_0xdeb5('0x31')][_0xdeb5('0x3e')]+'%'};return _0x18ff57;})});}_0x3f2fd2=_['merge']({},_0x3f2fd2,_0x481961[_0xdeb5('0x40')]);return _0x3bca2e[_0xdeb5('0x4c')](_0x3f2fd2);}})['then'](function(_0x4bd627){if(_0x4bd627){_0x45914d=_0x4bd627[_0xdeb5('0x37')];if(!_0x481961[_0xdeb5('0x31')][_0xdeb5('0x4d')](_0xdeb5('0x38'))){_0x3f2fd2[_0xdeb5('0x39')]=qs['limit'](_0x481961[_0xdeb5('0x31')]['limit']);_0x3f2fd2[_0xdeb5('0x1f')]=qs[_0xdeb5('0x1f')](_0x481961[_0xdeb5('0x31')][_0xdeb5('0x1f')]);}return _0x3bca2e['getConfigurations'](_0x3f2fd2);}})[_0xdeb5('0x25')](function(_0x51f51e){if(_0x51f51e){return _0x51f51e?{'count':_0x45914d,'rows':_0x51f51e}:null;}})[_0xdeb5('0x25')](respondWithResult(_0x14e8fc,null))[_0xdeb5('0x45')](handleError(_0x14e8fc,null));};exports['addConfiguration']=function(_0x30ced9,_0x22f92b,_0x2ef796){if(_0x30ced9[_0xdeb5('0x4a')]['id']){delete _0x30ced9[_0xdeb5('0x4a')]['id'];}return db[_0xdeb5('0x2c')][_0xdeb5('0x4e')]({'where':{'id':_0x30ced9[_0xdeb5('0x46')]['id']}})['then'](handleEntityNotFound(_0x22f92b,null))['then'](function(_0x12e961){if(_0x12e961){_0x30ced9[_0xdeb5('0x4a')][_0xdeb5('0x4f')]=_0x12e961['id'];_0x30ced9[_0xdeb5('0x4a')][_0xdeb5('0x50')]=integrations['getSubjects'](_0x30ced9[_0xdeb5('0x4a')][_0xdeb5('0x51')],_0x30ced9[_0xdeb5('0x4a')][_0xdeb5('0x2e')]);_0x30ced9[_0xdeb5('0x4a')]['Descriptions']=integrations[_0xdeb5('0x52')](_0x30ced9[_0xdeb5('0x4a')][_0xdeb5('0x51')],_0x30ced9['body']['type']);return db['Dynamics365Configuration'][_0xdeb5('0x49')](_0x30ced9[_0xdeb5('0x4a')],{'include':[{'model':db[_0xdeb5('0x53')],'as':_0xdeb5('0x50')},{'model':db[_0xdeb5('0x53')],'as':_0xdeb5('0x54')}]});}return null;})['then'](respondWithResult(_0x22f92b,null))[_0xdeb5('0x45')](handleError(_0x22f92b,null));};exports[_0xdeb5('0x55')]=function(_0x52fd3a,_0x3f2401,_0xc926a0){var _0x24c5ca=_0x52fd3a[_0xdeb5('0x31')][_0xdeb5('0x56')];var _0x2575a0=_0x24c5ca===_0xdeb5('0x57')?_0xdeb5('0x58'):'PhoneCall';var _0x17f5ee='';var _0x1a52cd='';var _0x5c6278='';var _0x8abf01='';var _0x29500c='';var _0x38a6f9='';var _0x1fb8f5='';var _0x1d492b='';var _0x43052d=[_0xdeb5('0x59'),_0xdeb5('0x5a'),_0xdeb5('0x5b'),_0xdeb5('0x5c'),_0xdeb5('0x5d'),_0xdeb5('0x5e'),_0xdeb5('0x5f'),_0xdeb5('0x60'),_0xdeb5('0x61'),_0xdeb5('0x62')];var _0x180201=[_0xdeb5('0x63'),'accountidyominame','actualserviceunits',_0xdeb5('0x64'),_0xdeb5('0x65'),_0xdeb5('0x66'),_0xdeb5('0x67'),_0xdeb5('0x68'),_0xdeb5('0x69'),_0xdeb5('0x6a'),_0xdeb5('0x6b'),'createdbyyominame',_0xdeb5('0x6c'),'createdonbehalfbyname',_0xdeb5('0x6d'),'customeridname',_0xdeb5('0x6e'),_0xdeb5('0x6f'),_0xdeb5('0x70'),_0xdeb5('0x71'),_0xdeb5('0x72'),_0xdeb5('0x73'),_0xdeb5('0x74'),_0xdeb5('0x75'),'firstresponsebykpiidname','followupby',_0xdeb5('0x76'),_0xdeb5('0x77'),_0xdeb5('0x78'),'lastonholdtime','masteridname','modifiedbyexternalpartyname',_0xdeb5('0x79'),'modifiedbyname',_0xdeb5('0x7a'),_0xdeb5('0x7b'),'modifiedonbehalfbyname',_0xdeb5('0x7c'),_0xdeb5('0x7d'),_0xdeb5('0x7e'),_0xdeb5('0x7f'),_0xdeb5('0x80'),_0xdeb5('0x81'),'owneridname',_0xdeb5('0x82'),_0xdeb5('0x83'),_0xdeb5('0x84'),_0xdeb5('0x85'),'primarycontactidyominame',_0xdeb5('0x86'),_0xdeb5('0x87'),_0xdeb5('0x88'),_0xdeb5('0x89'),_0xdeb5('0x8a'),'responseby',_0xdeb5('0x8b'),_0xdeb5('0x8c'),_0xdeb5('0x8d'),_0xdeb5('0x8e'),_0xdeb5('0x8f'),_0xdeb5('0x90'),_0xdeb5('0x91'),'statuscode',_0xdeb5('0x92'),'ticketnumber',_0xdeb5('0x93'),_0xdeb5('0x94'),_0xdeb5('0x95'),_0xdeb5('0x96'),_0xdeb5('0x97')];var _0x51c6c8=_0x43052d[_0xdeb5('0x98')](_0x180201);return db[_0xdeb5('0x2c')]['findOne']({'where':{'id':_0x52fd3a[_0xdeb5('0x46')]['id']},'attributes':['id',_0xdeb5('0x99'),_0xdeb5('0x9a'),_0xdeb5('0x9b'),_0xdeb5('0x9c'),_0xdeb5('0x9d'),_0xdeb5('0x9e')]})[_0xdeb5('0x25')](handleEntityNotFound(_0x3f2401,null))['then'](function(_0x104d95){if(_0x104d95){_0x1d492b=_0x104d95[_0xdeb5('0x9b')];var _0xce916b=_0x1d492b['slice'](-0x1);if(_0xce916b==='/'){_0x1d492b=_0x1d492b[_0xdeb5('0x9f')](0x0,_0x1d492b[_0xdeb5('0xa0')](_0xce916b));}_0x1fb8f5=util['format'](_0xdeb5('0xa1'),_0x1d492b);var _0x4dd476={'method':'POST','uri':_0xdeb5('0xa2')+_0x104d95[_0xdeb5('0x9c')]+_0xdeb5('0xa3'),'form':{'client_id':_0x104d95[_0xdeb5('0x9d')],'resource':_0x1d492b,'username':_0x104d95[_0xdeb5('0x99')],'password':_0x104d95[_0xdeb5('0x9a')],'grant_type':'password','client_secret':_0x104d95[_0xdeb5('0x9e')]},'json':!![]};return rp(_0x4dd476);}})['then'](function(_0x24d6e6){_0x38a6f9=_0x24d6e6[_0xdeb5('0xa4')];var _0x2ce764={'method':_0xdeb5('0xa5'),'uri':encodeURI(_0x1fb8f5+_0xdeb5('0xa6')+_0x2575a0+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x38a6f9,'If-None-Match':null,'OData-Version':_0xdeb5('0xa7')},'json':!![]};return rp(_0x2ce764);})['then'](function(_0x75f130){var _0x3fb8b0=_0x75f130[_0xdeb5('0xa8')][0x0];var _0x339d07=_0x3fb8b0[_0xdeb5('0xa9')];var _0x549c42={'method':_0xdeb5('0xa5'),'uri':_0x1fb8f5+_0xdeb5('0xaa')+_0x339d07+_0xdeb5('0xab'),'headers':{'Authorization':_0xdeb5('0xac')+_0x38a6f9,'If-None-Match':null,'OData-Version':_0xdeb5('0xa7')},'json':!![]};return rp(_0x549c42);})[_0xdeb5('0x25')](function(_0x41608d){_0x17f5ee=_0x41608d;_0x1a52cd=_0x17f5ee[_0xdeb5('0xad')];_0x1a52cd=_[_0xdeb5('0xae')](_0x1a52cd,function(_0x193029){return!_0x51c6c8['includes'](_0x193029[_0xdeb5('0xaf')]);});var _0x51580a=[];var _0x317923=[];_0x1a52cd[_0xdeb5('0xb0')](function(_0x5873dd){if(_0x5873dd[_0xdeb5('0xb1')]){var _0x2f6f0b=_0x5873dd[_0xdeb5('0xb1')]['substring'](_0x5873dd[_0xdeb5('0xb1')][_0xdeb5('0xa0')]('.')+0x1);if(_0x2f6f0b===_0xdeb5('0xb2')){_0x51580a[_0xdeb5('0xb3')](getSelectList(_0x1fb8f5,_0x24c5ca,_0x317923,_0x17f5ee[_0xdeb5('0xa9')],_0x5873dd['MetadataId'],_0x38a6f9));}}});return Promise[_0xdeb5('0xb4')](_0x51580a);})[_0xdeb5('0x25')](function(_0x2acfe1){_0x5c6278=_0x2acfe1[0x0];var _0x369b71=[];var _0x34c214=[];_0x1a52cd[_0xdeb5('0xb0')](function(_0x2fa7bc){if(!_[_0xdeb5('0xb5')](_0x2fa7bc[_0xdeb5('0xb1')])){var _0x3235b9=_0x2fa7bc[_0xdeb5('0xb1')]['substring'](_0x2fa7bc[_0xdeb5('0xb1')][_0xdeb5('0xa0')]('.')+0x1);if(_0x3235b9===_0xdeb5('0xb6')){_0x369b71[_0xdeb5('0xb3')](getBooleanList(_0x1fb8f5,_0x24c5ca,_0x34c214,_0x17f5ee[_0xdeb5('0xa9')],_0x2fa7bc['MetadataId'],_0x38a6f9));}}});return Promise[_0xdeb5('0xb4')](_0x369b71);})['then'](function(_0x5af4e2){_0x8abf01=_0x5af4e2[0x0];var _0x551f8a=[];var _0xfd22d6=[];_0x1a52cd['forEach'](function(_0x5b6811){if(_0x5b6811[_0xdeb5('0xb1')]){var _0x15a2dd=_0x5b6811[_0xdeb5('0xb1')]['substring'](_0x5b6811[_0xdeb5('0xb1')]['lastIndexOf']('.')+0x1);if(_0x15a2dd===_0xdeb5('0xb7')||_0x15a2dd==='DoubleAttributeMetadata'||_0x15a2dd===_0xdeb5('0xb8')||_0x15a2dd===_0xdeb5('0xb9')||_0x15a2dd===_0xdeb5('0xba')||_0x15a2dd==='DateTimeAttributeMetadata'||_0x15a2dd===_0xdeb5('0xbb')||_0x15a2dd===_0xdeb5('0xbc')||_0x15a2dd===_0xdeb5('0xbd')||_0x15a2dd===_0xdeb5('0xbe')){_0x551f8a[_0xdeb5('0xb3')](getInputList(_0x1fb8f5,_0x24c5ca,_0x15a2dd,_0xfd22d6,_0x17f5ee[_0xdeb5('0xa9')],_0x5b6811[_0xdeb5('0xa9')],_0x38a6f9));}}});return Promise[_0xdeb5('0xb4')](_0x551f8a);})[_0xdeb5('0x25')](function(_0x424f41){_0x29500c=_0x424f41[0x0];var _0x11c378=_0x5c6278[_0xdeb5('0x98')](_0x8abf01)['concat'](_0x29500c);var _0x280bcc={'count':_0x11c378[_0xdeb5('0x37')],'rows':_0x11c378};return _0x280bcc;})[_0xdeb5('0x25')](respondWithResult(_0x3f2401,null))[_0xdeb5('0x45')](function(_0x178c61){var _0x39a161=_0x52fd3a['query'][_0xdeb5('0xbf')]?0x1f4:_0x178c61['statusCode']||0x1f4;logger[_0xdeb5('0x27')](_0x178c61[_0xdeb5('0x28')]);delete _0x178c61['name'];if(_0x39a161===0x191){_0x39a161=0x190;}_0x3f2401[_0xdeb5('0x1e')](_0x39a161)[_0xdeb5('0xc0')](_0x52fd3a[_0xdeb5('0x31')][_0xdeb5('0xbf')]?{'message':_0xdeb5('0xc1'),'statusCode':_0x178c61[_0xdeb5('0xc2')]}:_0x178c61);});};function getSelectList(_0x3c09cb,_0x36f8b2,_0x4afcc7,_0xa61524,_0x1a56ba,_0x38792d){var _0x35c1ad={'method':_0xdeb5('0xa5'),'uri':_0x3c09cb+_0xdeb5('0xaa')+_0xa61524+_0xdeb5('0xc3')+_0x1a56ba+_0xdeb5('0xc4')+_0xdeb5('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x38792d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x35c1ad)[_0xdeb5('0x25')](function(_0x38db96){var _0x8331d4=[];var _0x56dd79=_0x38db96[_0xdeb5('0xc6')][_0xdeb5('0xc7')];_0x56dd79[_0xdeb5('0xb0')](function(_0x305f7b){_0x8331d4[_0xdeb5('0xb3')]({'name':_0x305f7b[_0xdeb5('0xc8')][_0xdeb5('0xc9')][_0xdeb5('0xc8')],'value':String(_0x305f7b[_0xdeb5('0xca')])});});var _0x338a50={'id':_0x36f8b2+'_'+_0x38db96[_0xdeb5('0xaf')],'name':_0x38db96[_0xdeb5('0xcb')][_0xdeb5('0xc9')][_0xdeb5('0xc8')],'custom':![],'options':_0x8331d4};_0x4afcc7[_0xdeb5('0xb3')](_0x338a50);return _0x4afcc7;});}function getBooleanList(_0x44f00a,_0x28587a,_0x41fc9e,_0x1318d1,_0x2ca01b,_0x2174ed){var _0x2d5833={'method':'GET','uri':_0x44f00a+_0xdeb5('0xaa')+_0x1318d1+_0xdeb5('0xc3')+_0x2ca01b+_0xdeb5('0xcc'),'headers':{'Authorization':_0xdeb5('0xac')+_0x2174ed,'If-None-Match':null,'OData-Version':_0xdeb5('0xa7')},'json':!![]};return rp(_0x2d5833)[_0xdeb5('0x25')](function(_0x1b08a5){var _0x391842=[];_0x391842[_0xdeb5('0xb3')]({'name':_0x1b08a5[_0xdeb5('0xc6')][_0xdeb5('0xcd')]['Label'][_0xdeb5('0xc9')][_0xdeb5('0xc8')],'value':_0xdeb5('0xce')},{'name':_0x1b08a5[_0xdeb5('0xc6')][_0xdeb5('0xcf')][_0xdeb5('0xc8')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x3178c4={'id':_0x28587a+'_'+_0x1b08a5[_0xdeb5('0xaf')],'name':_0x1b08a5[_0xdeb5('0xcb')][_0xdeb5('0xc9')][_0xdeb5('0xc8')],'custom':![],'options':_0x391842};_0x41fc9e[_0xdeb5('0xb3')](_0x3178c4);return _0x41fc9e;});}function getInputList(_0xcb8c44,_0x59920b,_0x519a8b,_0x3d7d40,_0x26bc77,_0x4169c1,_0x4c1a31){var _0x46a8b7={'method':'GET','uri':_0xcb8c44+_0xdeb5('0xaa')+_0x26bc77+_0xdeb5('0xc3')+_0x4169c1+_0xdeb5('0xd0')+_0x519a8b+_0xdeb5('0xd1'),'headers':{'Authorization':_0xdeb5('0xac')+_0x4c1a31,'If-None-Match':null,'OData-Version':_0xdeb5('0xa7')},'json':!![]};return rp(_0x46a8b7)[_0xdeb5('0x25')](function(_0x3c8d7d){var _0xa9bb80={'id':_0x59920b+'_'+_0x3c8d7d[_0xdeb5('0xaf')],'name':_0x3c8d7d['DisplayName'][_0xdeb5('0xc9')]?_0x3c8d7d[_0xdeb5('0xcb')]['UserLocalizedLabel'][_0xdeb5('0xc8')]:_0x3c8d7d[_0xdeb5('0xaf')],'custom':![],'options':[]};_0x3d7d40[_0xdeb5('0xb3')](_0xa9bb80);return _0x3d7d40;});}
\ No newline at end of file
index 0a8fd9e..5693306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x5d59c7,_0x1a274f){var _0x13cada=function(_0x3acbae){while(--_0x3acbae){_0x5d59c7['push'](_0x5d59c7['shift']());}};_0x13cada(++_0x1a274f);}(_0xe706,0xa3));var _0x6e70=function(_0x455284,_0x383648){_0x455284=_0x455284-0x0;var _0x3e70dc=_0xe706[_0x455284];return _0x3e70dc;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 47d5b76..2612c50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04a3=['../../config/environment','jayson/promise','request','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','catch','GetDynamics365Account','findAll','raw','options','where','limit','include','map','model','attributes','info','ShowDynamics365Account','Dynamics365Account','find','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc'];(function(_0x1e2e77,_0x4e8ca8){var _0x408ff4=function(_0xfe15bd){while(--_0xfe15bd){_0x1e2e77['push'](_0x1e2e77['shift']());}};_0x408ff4(++_0x4e8ca8);}(_0x04a3,0x16f));var _0x304a=function(_0x2c71ce,_0x358b49){_0x2c71ce=_0x2c71ce-0x0;var _0x4d55a0=_0x04a3[_0x2c71ce];return _0x4d55a0;};'use strict';var _=require(_0x304a('0x0'));var util=require(_0x304a('0x1'));var moment=require(_0x304a('0x2'));var BPromise=require('bluebird');var rs=require(_0x304a('0x3'));var fs=require('fs');var Redis=require(_0x304a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x304a('0x5'));var logger=require('../../config/logger')(_0x304a('0x6'));var config=require(_0x304a('0x7'));var jayson=require(_0x304a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x141808,_0x5155fb,_0x6d7d73){return new BPromise(function(_0x3bcc85,_0x324c0b){return client[_0x304a('0x9')](_0x141808,_0x6d7d73)[_0x304a('0xa')](function(_0x5a7360){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x5155fb,_0x304a('0xb'));logger[_0x304a('0xc')](_0x304a('0xd'),_0x5155fb,_0x304a('0xb'),JSON[_0x304a('0xe')](_0x5a7360));if(_0x5a7360[_0x304a('0xf')]){if(_0x5a7360[_0x304a('0xf')][_0x304a('0x10')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5155fb,_0x5a7360[_0x304a('0xf')][_0x304a('0x11')]);return _0x324c0b(_0x5a7360[_0x304a('0xf')][_0x304a('0x11')]);}logger[_0x304a('0xf')](_0x304a('0x12'),_0x5155fb,_0x5a7360[_0x304a('0xf')][_0x304a('0x11')]);return _0x3bcc85(_0x5a7360['error'][_0x304a('0x11')]);}else{logger['info'](_0x304a('0x12'),_0x5155fb,'request\x20sent');_0x3bcc85(_0x5a7360['result'][_0x304a('0x11')]);}})[_0x304a('0x13')](function(_0x2a1bbc){logger[_0x304a('0xf')](_0x304a('0x12'),_0x5155fb,_0x2a1bbc);_0x324c0b(_0x2a1bbc);});});}exports[_0x304a('0x14')]=function(_0x9e4847){var _0x5e7414=this;return new Promise(function(_0x32e689,_0x257d88){return db['Dynamics365Account'][_0x304a('0x15')]({'raw':_0x9e4847['options']?_0x9e4847['options'][_0x304a('0x16')]===undefined?!![]:![]:!![],'where':_0x9e4847[_0x304a('0x17')]?_0x9e4847[_0x304a('0x17')][_0x304a('0x18')]||null:null,'attributes':_0x9e4847['options']?_0x9e4847[_0x304a('0x17')]['attributes']||null:null,'limit':_0x9e4847[_0x304a('0x17')]?_0x9e4847[_0x304a('0x17')][_0x304a('0x19')]||null:null,'include':_0x9e4847['options']?_0x9e4847['options'][_0x304a('0x1a')]?_[_0x304a('0x1b')](_0x9e4847[_0x304a('0x17')]['include'],function(_0xbffa98){return{'model':db[_0xbffa98[_0x304a('0x1c')]],'as':_0xbffa98['as'],'attributes':_0xbffa98[_0x304a('0x1d')],'include':_0xbffa98[_0x304a('0x1a')]?_[_0x304a('0x1b')](_0xbffa98[_0x304a('0x1a')],function(_0x12d38b){return{'model':db[_0x12d38b[_0x304a('0x1c')]],'as':_0x12d38b['as'],'attributes':_0x12d38b[_0x304a('0x1d')],'include':_0x12d38b[_0x304a('0x1a')]?_[_0x304a('0x1b')](_0x12d38b['include'],function(_0xb0f334){return{'model':db[_0xb0f334[_0x304a('0x1c')]],'as':_0xb0f334['as'],'attributes':_0xb0f334[_0x304a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x304a('0xa')](function(_0x511c15){logger[_0x304a('0x1e')](_0x304a('0x14'),_0x9e4847);logger[_0x304a('0xc')]('GetDynamics365Account',_0x9e4847,JSON['stringify'](_0x511c15));_0x32e689(_0x511c15);})[_0x304a('0x13')](function(_0x334cd8){logger[_0x304a('0xf')](_0x304a('0x14'),_0x334cd8[_0x304a('0x11')],_0x9e4847);_0x257d88(_0x5e7414[_0x304a('0xf')](0x1f4,_0x334cd8[_0x304a('0x11')]));});});};exports[_0x304a('0x1f')]=function(_0x65747){var _0x164696=this;return new Promise(function(_0x256d8d,_0x397f55){return db[_0x304a('0x20')][_0x304a('0x21')]({'raw':_0x65747[_0x304a('0x17')]?_0x65747[_0x304a('0x17')][_0x304a('0x16')]===undefined?!![]:![]:!![],'where':_0x65747[_0x304a('0x17')]?_0x65747[_0x304a('0x17')]['where']||null:null,'attributes':_0x65747[_0x304a('0x17')]?_0x65747[_0x304a('0x17')][_0x304a('0x1d')]||null:null,'include':_0x65747[_0x304a('0x17')]?_0x65747['options'][_0x304a('0x1a')]?_[_0x304a('0x1b')](_0x65747[_0x304a('0x17')]['include'],function(_0xc0265c){return{'model':db[_0xc0265c[_0x304a('0x1c')]],'as':_0xc0265c['as'],'attributes':_0xc0265c[_0x304a('0x1d')],'include':_0xc0265c[_0x304a('0x1a')]?_[_0x304a('0x1b')](_0xc0265c[_0x304a('0x1a')],function(_0xc74eb7){return{'model':db[_0xc74eb7[_0x304a('0x1c')]],'as':_0xc74eb7['as'],'attributes':_0xc74eb7[_0x304a('0x1d')],'include':_0xc74eb7[_0x304a('0x1a')]?_[_0x304a('0x1b')](_0xc74eb7[_0x304a('0x1a')],function(_0xdf3dce){return{'model':db[_0xdf3dce['model']],'as':_0xdf3dce['as'],'attributes':_0xdf3dce['attributes']};}):[]};}):[]};}):[]:[]})[_0x304a('0xa')](function(_0x3214e6){logger['info'](_0x304a('0x1f'),_0x65747);logger['debug']('ShowDynamics365Account',_0x65747,JSON['stringify'](_0x3214e6));_0x256d8d(_0x3214e6);})[_0x304a('0x13')](function(_0x59d38f){logger[_0x304a('0xf')](_0x304a('0x1f'),_0x59d38f[_0x304a('0x11')],_0x65747);_0x397f55(_0x164696[_0x304a('0xf')](0x1f4,_0x59d38f[_0x304a('0x11')]));});});};
\ No newline at end of file
+var _0x944e=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','options','attributes','limit','include','model','map','find','raw','where','ShowDynamics365Account','debug','lodash','util'];(function(_0x4fa468,_0x502bed){var _0x53a362=function(_0x418ef2){while(--_0x418ef2){_0x4fa468['push'](_0x4fa468['shift']());}};_0x53a362(++_0x502bed);}(_0x944e,0x1df));var _0xe944=function(_0x3c54e8,_0x251c0d){_0x3c54e8=_0x3c54e8-0x0;var _0x3072ae=_0x944e[_0x3c54e8];return _0x3072ae;};'use strict';var _=require(_0xe944('0x0'));var util=require(_0xe944('0x1'));var moment=require(_0xe944('0x2'));var BPromise=require('bluebird');var rs=require(_0xe944('0x3'));var fs=require('fs');var Redis=require(_0xe944('0x4'));var db=require(_0xe944('0x5'))['db'];var utils=require(_0xe944('0x6'));var logger=require(_0xe944('0x7'))(_0xe944('0x8'));var config=require(_0xe944('0x9'));var jayson=require(_0xe944('0xa'));var client=jayson[_0xe944('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ba98a,_0x4c34b0,_0x41debf){return new BPromise(function(_0x109d65,_0xfce170){return client[_0xe944('0xc')](_0x1ba98a,_0x41debf)[_0xe944('0xd')](function(_0x241d55){logger['info'](_0xe944('0xe'),_0x4c34b0,_0xe944('0xf'));logger['debug'](_0xe944('0x10'),_0x4c34b0,_0xe944('0xf'),JSON[_0xe944('0x11')](_0x241d55));if(_0x241d55[_0xe944('0x12')]){if(_0x241d55[_0xe944('0x12')][_0xe944('0x13')]===0x1f4){logger[_0xe944('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x4c34b0,_0x241d55[_0xe944('0x12')][_0xe944('0x14')]);return _0xfce170(_0x241d55[_0xe944('0x12')][_0xe944('0x14')]);}logger['error'](_0xe944('0xe'),_0x4c34b0,_0x241d55[_0xe944('0x12')][_0xe944('0x14')]);return _0x109d65(_0x241d55['error'][_0xe944('0x14')]);}else{logger[_0xe944('0x15')](_0xe944('0xe'),_0x4c34b0,_0xe944('0xf'));_0x109d65(_0x241d55[_0xe944('0x16')][_0xe944('0x14')]);}})[_0xe944('0x17')](function(_0x4e7ec0){logger[_0xe944('0x12')](_0xe944('0xe'),_0x4c34b0,_0x4e7ec0);_0xfce170(_0x4e7ec0);});});}exports[_0xe944('0x18')]=function(_0x629028){var _0x41fe31=this;return new Promise(function(_0x47f215,_0x3f3932){return db[_0xe944('0x19')]['findAll']({'raw':_0x629028[_0xe944('0x1a')]?_0x629028['options']['raw']===undefined?!![]:![]:!![],'where':_0x629028['options']?_0x629028[_0xe944('0x1a')]['where']||null:null,'attributes':_0x629028[_0xe944('0x1a')]?_0x629028[_0xe944('0x1a')][_0xe944('0x1b')]||null:null,'limit':_0x629028[_0xe944('0x1a')]?_0x629028[_0xe944('0x1a')][_0xe944('0x1c')]||null:null,'include':_0x629028['options']?_0x629028[_0xe944('0x1a')][_0xe944('0x1d')]?_['map'](_0x629028['options']['include'],function(_0x340b94){return{'model':db[_0x340b94[_0xe944('0x1e')]],'as':_0x340b94['as'],'attributes':_0x340b94[_0xe944('0x1b')],'include':_0x340b94[_0xe944('0x1d')]?_[_0xe944('0x1f')](_0x340b94[_0xe944('0x1d')],function(_0xd01959){return{'model':db[_0xd01959['model']],'as':_0xd01959['as'],'attributes':_0xd01959['attributes'],'include':_0xd01959['include']?_['map'](_0xd01959['include'],function(_0x3a80e4){return{'model':db[_0x3a80e4['model']],'as':_0x3a80e4['as'],'attributes':_0x3a80e4[_0xe944('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe944('0xd')](function(_0x38e25e){logger[_0xe944('0x15')]('GetDynamics365Account',_0x629028);logger['debug'](_0xe944('0x18'),_0x629028,JSON[_0xe944('0x11')](_0x38e25e));_0x47f215(_0x38e25e);})['catch'](function(_0x12f055){logger[_0xe944('0x12')](_0xe944('0x18'),_0x12f055[_0xe944('0x14')],_0x629028);_0x3f3932(_0x41fe31[_0xe944('0x12')](0x1f4,_0x12f055[_0xe944('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x261e42){var _0x33b4d2=this;return new Promise(function(_0x109a88,_0x27953a){return db[_0xe944('0x19')][_0xe944('0x20')]({'raw':_0x261e42[_0xe944('0x1a')]?_0x261e42[_0xe944('0x1a')][_0xe944('0x21')]===undefined?!![]:![]:!![],'where':_0x261e42[_0xe944('0x1a')]?_0x261e42[_0xe944('0x1a')][_0xe944('0x22')]||null:null,'attributes':_0x261e42[_0xe944('0x1a')]?_0x261e42[_0xe944('0x1a')][_0xe944('0x1b')]||null:null,'include':_0x261e42[_0xe944('0x1a')]?_0x261e42['options'][_0xe944('0x1d')]?_[_0xe944('0x1f')](_0x261e42[_0xe944('0x1a')][_0xe944('0x1d')],function(_0x3cbaf7){return{'model':db[_0x3cbaf7[_0xe944('0x1e')]],'as':_0x3cbaf7['as'],'attributes':_0x3cbaf7[_0xe944('0x1b')],'include':_0x3cbaf7[_0xe944('0x1d')]?_[_0xe944('0x1f')](_0x3cbaf7['include'],function(_0x46be03){return{'model':db[_0x46be03[_0xe944('0x1e')]],'as':_0x46be03['as'],'attributes':_0x46be03['attributes'],'include':_0x46be03[_0xe944('0x1d')]?_[_0xe944('0x1f')](_0x46be03[_0xe944('0x1d')],function(_0x4256f9){return{'model':db[_0x4256f9['model']],'as':_0x4256f9['as'],'attributes':_0x4256f9[_0xe944('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe944('0xd')](function(_0x1de02b){logger[_0xe944('0x15')](_0xe944('0x23'),_0x261e42);logger[_0xe944('0x24')](_0xe944('0x23'),_0x261e42,JSON[_0xe944('0x11')](_0x1de02b));_0x109a88(_0x1de02b);})[_0xe944('0x17')](function(_0x491a77){logger[_0xe944('0x12')](_0xe944('0x23'),_0x491a77[_0xe944('0x14')],_0x261e42);_0x27953a(_0x33b4d2[_0xe944('0x12')](0x1f4,_0x491a77[_0xe944('0x14')]));});});};
\ No newline at end of file
index 62fedbe..5ac503a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1e3=['get','isAuthenticated','index','/:id','show','/:id/fields','/:id/descriptions','post','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x26b674,_0x5c3412){_0x26b674=_0x26b674-0x0;var _0x18d1bc=_0xe1e3[_0x26b674];return _0x18d1bc;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var path=require('path');var timeout=require(_0x3e1e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e1e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var controller=require(_0x3e1e('0x6'));router[_0x3e1e('0x7')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x9')]);router['get'](_0x3e1e('0xa'),auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xb')]);router[_0x3e1e('0x7')](_0x3e1e('0xc'),auth[_0x3e1e('0x8')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x3e1e('0x8')](),controller['getSubjects']);router[_0x3e1e('0x7')](_0x3e1e('0xd'),auth[_0x3e1e('0x8')](),controller['getDescriptions']);router[_0x3e1e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e1e('0xf')]);router['delete']('/:id',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x10')]);module[_0x3e1e('0x11')]=router;
\ No newline at end of file
+var _0x07b8=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x07b8,0x1d4));var _0x807b=function(_0x2d9c11,_0x2a4c8a){_0x2d9c11=_0x2d9c11-0x0;var _0x3b3e89=_0x07b8[_0x2d9c11];return _0x3b3e89;};'use strict';var multer=require(_0x807b('0x0'));var util=require(_0x807b('0x1'));var path=require(_0x807b('0x2'));var timeout=require(_0x807b('0x3'));var express=require(_0x807b('0x4'));var router=express[_0x807b('0x5')]();var fs_extra=require(_0x807b('0x6'));var auth=require(_0x807b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x807b('0x8'));var controller=require(_0x807b('0x9'));router[_0x807b('0xa')]('/',auth[_0x807b('0xb')](),controller[_0x807b('0xc')]);router['get'](_0x807b('0xd'),auth[_0x807b('0xb')](),controller['show']);router[_0x807b('0xa')](_0x807b('0xe'),auth[_0x807b('0xb')](),controller[_0x807b('0xf')]);router['get'](_0x807b('0x10'),auth[_0x807b('0xb')](),controller[_0x807b('0x11')]);router['get'](_0x807b('0x12'),auth[_0x807b('0xb')](),controller[_0x807b('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x807b('0x14')]);router['put'](_0x807b('0xd'),auth[_0x807b('0xb')](),controller['update']);router[_0x807b('0x15')](_0x807b('0xd'),auth[_0x807b('0xb')](),controller['destroy']);module[_0x807b('0x16')]=router;
\ No newline at end of file
index 64c9c66..4465586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8627=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x2aa647,_0x520d2d){var _0xcbc1dc=function(_0x333118){while(--_0x333118){_0x2aa647['push'](_0x2aa647['shift']());}};_0xcbc1dc(++_0x520d2d);}(_0x8627,0x157));var _0x7862=function(_0x43665b,_0xb7c5b){_0x43665b=_0x43665b-0x0;var _0x4a9c37=_0x8627[_0x43665b];return _0x4a9c37;};'use strict';var Sequelize=require(_0x7862('0x0'));module[_0x7862('0x1')]={'name':{'type':Sequelize[_0x7862('0x2')]},'description':{'type':Sequelize[_0x7862('0x2')]},'ticketType':{'type':Sequelize[_0x7862('0x3')](_0x7862('0x4'),_0x7862('0x5')),'defaultValue':'incident'}};
\ No newline at end of file
+var _0x7b65=['exports','STRING','ENUM','phonecall','incident','sequelize'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x7b65,0x71));var _0x57b6=function(_0x44037f,_0x148661){_0x44037f=_0x44037f-0x0;var _0x1a3250=_0x7b65[_0x44037f];return _0x1a3250;};'use strict';var Sequelize=require(_0x57b6('0x0'));module[_0x57b6('0x1')]={'name':{'type':Sequelize[_0x57b6('0x2')]},'description':{'type':Sequelize[_0x57b6('0x2')]},'ticketType':{'type':Sequelize[_0x57b6('0x3')]('incident',_0x57b6('0x4')),'defaultValue':_0x57b6('0x5')}};
\ No newline at end of file
index 0e4b4d3..bd6012d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf7f=['getDescriptions','eml-format','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','options','include','Dynamics365Configuration','rows','catch','show','includeAll','find','create','body','params','getFields','findOne','Dynamics365Field','pick','getSubjects'];(function(_0x3f2fad,_0x4d8b79){var _0x39af94=function(_0x2241a5){while(--_0x2241a5){_0x3f2fad['push'](_0x3f2fad['shift']());}};_0x39af94(++_0x4d8b79);}(_0xdf7f,0x9d));var _0xfdf7=function(_0x5008c6,_0x18e53e){_0x5008c6=_0x5008c6-0x0;var _0x1bf3e0=_0xdf7f[_0x5008c6];return _0x1bf3e0;};'use strict';var emlformat=require(_0xfdf7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdf7('0x1'));var jsonpatch=require(_0xfdf7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfdf7('0x3'));var util=require(_0xfdf7('0x4'));var path=require('path');var sox=require(_0xfdf7('0x5'));var csv=require(_0xfdf7('0x6'));var ejs=require(_0xfdf7('0x7'));var fs=require('fs');var fs_extra=require(_0xfdf7('0x8'));var _=require(_0xfdf7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdf7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfdf7('0x6'));var querystring=require(_0xfdf7('0xb'));var Papa=require(_0xfdf7('0xc'));var Redis=require(_0xfdf7('0xd'));var authService=require(_0xfdf7('0xe'));var qs=require(_0xfdf7('0xf'));var as=require(_0xfdf7('0x10'));var hardwareService=require(_0xfdf7('0x11'));var logger=require('../../config/logger')(_0xfdf7('0x12'));var utils=require('../../config/utils');var config=require(_0xfdf7('0x13'));var licenseUtil=require(_0xfdf7('0x14'));var db=require(_0xfdf7('0x15'))['db'];function respondWithStatusCode(_0x539b1f,_0x3f7cfe){_0x3f7cfe=_0x3f7cfe||0xcc;return function(_0x384bee){if(_0x384bee){return _0x539b1f[_0xfdf7('0x16')](_0x3f7cfe);}return _0x539b1f['status'](_0x3f7cfe)[_0xfdf7('0x17')]();};}function respondWithResult(_0x2acce0,_0x55eb5a){_0x55eb5a=_0x55eb5a||0xc8;return function(_0x5a4d5e){if(_0x5a4d5e){return _0x2acce0[_0xfdf7('0x18')](_0x55eb5a)[_0xfdf7('0x19')](_0x5a4d5e);}};}function respondWithFilteredResult(_0x2b058d,_0x489d95){return function(_0x1c4f2a){if(_0x1c4f2a){var _0x31f692=typeof _0x489d95['offset']===_0xfdf7('0x1a')&&typeof _0x489d95[_0xfdf7('0x1b')]==='undefined';var _0x55e371=_0x1c4f2a[_0xfdf7('0x1c')];var _0x451037=_0x31f692?0x0:_0x489d95[_0xfdf7('0x1d')];var _0x4f9234=_0x31f692?_0x1c4f2a['count']:_0x489d95[_0xfdf7('0x1d')]+_0x489d95['limit'];var _0x39bca1;if(_0x4f9234>=_0x55e371){_0x4f9234=_0x55e371;_0x39bca1=0xc8;}else{_0x39bca1=0xce;}_0x2b058d['status'](_0x39bca1);return _0x2b058d[_0xfdf7('0x1e')](_0xfdf7('0x1f'),_0x451037+'-'+_0x4f9234+'/'+_0x55e371)[_0xfdf7('0x19')](_0x1c4f2a);}return null;};}function patchUpdates(_0x89ec11){return function(_0x36058d){try{jsonpatch['apply'](_0x36058d,_0x89ec11,!![]);}catch(_0x3a46de){return BPromise[_0xfdf7('0x20')](_0x3a46de);}return _0x36058d[_0xfdf7('0x21')]();};}function saveUpdates(_0x44c217,_0x586cc0){return function(_0xb06ca8){if(_0xb06ca8){return _0xb06ca8[_0xfdf7('0x22')](_0x44c217)['then'](function(_0x469924){return _0x469924;});}return null;};}function removeEntity(_0x1a06ac,_0x4e4506){return function(_0x33cc03){if(_0x33cc03){return _0x33cc03[_0xfdf7('0x23')]()[_0xfdf7('0x24')](function(){_0x1a06ac[_0xfdf7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xec3abb,_0x57c802){return function(_0x5b3655){if(!_0x5b3655){_0xec3abb['sendStatus'](0x194);}return _0x5b3655;};}function handleError(_0x4eb804,_0x117b50){_0x117b50=_0x117b50||0x1f4;return function(_0x45221a){logger[_0xfdf7('0x25')](_0x45221a[_0xfdf7('0x26')]);if(_0x45221a['name']){delete _0x45221a[_0xfdf7('0x27')];}_0x4eb804['status'](_0x117b50)[_0xfdf7('0x28')](_0x45221a);};}exports[_0xfdf7('0x29')]=function(_0x458886,_0x5a20d8){var _0x2040bc={},_0x385d01={},_0x5f1967={'count':0x0,'rows':[]};var _0x3f97cc=_[_0xfdf7('0x2a')](db['Dynamics365Configuration'][_0xfdf7('0x2b')],function(_0x4e378e){return{'name':_0x4e378e['fieldName'],'type':_0x4e378e['type'][_0xfdf7('0x2c')]};});_0x385d01[_0xfdf7('0x2d')]=_[_0xfdf7('0x2a')](_0x3f97cc,_0xfdf7('0x27'));_0x385d01['query']=_[_0xfdf7('0x2e')](_0x458886[_0xfdf7('0x2f')]);_0x385d01['filters']=_[_0xfdf7('0x30')](_0x385d01[_0xfdf7('0x2d')],_0x385d01[_0xfdf7('0x2f')]);_0x2040bc['attributes']=_[_0xfdf7('0x30')](_0x385d01[_0xfdf7('0x2d')],qs['fields'](_0x458886[_0xfdf7('0x2f')][_0xfdf7('0x31')]));_0x2040bc[_0xfdf7('0x32')]=_0x2040bc['attributes'][_0xfdf7('0x33')]?_0x2040bc[_0xfdf7('0x32')]:_0x385d01['model'];if(!_0x458886['query'][_0xfdf7('0x34')](_0xfdf7('0x35'))){_0x2040bc[_0xfdf7('0x1b')]=qs[_0xfdf7('0x1b')](_0x458886[_0xfdf7('0x2f')][_0xfdf7('0x1b')]);_0x2040bc['offset']=qs[_0xfdf7('0x1d')](_0x458886[_0xfdf7('0x2f')]['offset']);}_0x2040bc[_0xfdf7('0x36')]=qs[_0xfdf7('0x37')](_0x458886['query']['sort']);_0x2040bc['where']=qs[_0xfdf7('0x38')](_['pick'](_0x458886[_0xfdf7('0x2f')],_0x385d01[_0xfdf7('0x38')]),_0x3f97cc);if(_0x458886[_0xfdf7('0x2f')][_0xfdf7('0x39')]){_0x2040bc[_0xfdf7('0x3a')]=_[_0xfdf7('0x3b')](_0x2040bc[_0xfdf7('0x3a')],{'$or':_[_0xfdf7('0x2a')](_0x3f97cc,function(_0x4bf187){if(_0x4bf187[_0xfdf7('0x3c')]!=='VIRTUAL'){var _0x394c71={};_0x394c71[_0x4bf187['name']]={'$like':'%'+_0x458886[_0xfdf7('0x2f')]['filter']+'%'};return _0x394c71;}})});}_0x2040bc=_['merge']({},_0x2040bc,_0x458886[_0xfdf7('0x3d')]);var _0x4651d2={'where':_0x2040bc[_0xfdf7('0x3a')]};return db['Dynamics365Configuration']['count'](_0x4651d2)[_0xfdf7('0x24')](function(_0xe34be9){_0x5f1967[_0xfdf7('0x1c')]=_0xe34be9;if(_0x458886[_0xfdf7('0x2f')]['includeAll']){_0x2040bc[_0xfdf7('0x3e')]=[{'all':!![]}];}return db[_0xfdf7('0x3f')]['findAll'](_0x2040bc);})[_0xfdf7('0x24')](function(_0x49483f){_0x5f1967[_0xfdf7('0x40')]=_0x49483f;return _0x5f1967;})['then'](respondWithFilteredResult(_0x5a20d8,_0x2040bc))[_0xfdf7('0x41')](handleError(_0x5a20d8,null));};exports[_0xfdf7('0x42')]=function(_0x334ee2,_0x3ced32){var _0x33add5={'raw':![],'where':{'id':_0x334ee2['params']['id']}},_0x495d84={};_0x495d84[_0xfdf7('0x2d')]=_[_0xfdf7('0x2e')](db[_0xfdf7('0x3f')][_0xfdf7('0x2b')]);_0x495d84['query']=_['keys'](_0x334ee2[_0xfdf7('0x2f')]);_0x495d84[_0xfdf7('0x38')]=_[_0xfdf7('0x30')](_0x495d84[_0xfdf7('0x2d')],_0x495d84[_0xfdf7('0x2f')]);_0x33add5['attributes']=_['intersection'](_0x495d84[_0xfdf7('0x2d')],qs[_0xfdf7('0x31')](_0x334ee2[_0xfdf7('0x2f')][_0xfdf7('0x31')]));_0x33add5['attributes']=_0x33add5['attributes'][_0xfdf7('0x33')]?_0x33add5[_0xfdf7('0x32')]:_0x495d84['model'];if(_0x334ee2[_0xfdf7('0x2f')][_0xfdf7('0x43')]){_0x33add5[_0xfdf7('0x3e')]=[{'all':!![]}];}_0x33add5=_[_0xfdf7('0x3b')]({},_0x33add5,_0x334ee2[_0xfdf7('0x3d')]);return db['Dynamics365Configuration'][_0xfdf7('0x44')](_0x33add5)[_0xfdf7('0x24')](handleEntityNotFound(_0x3ced32,null))[_0xfdf7('0x24')](respondWithResult(_0x3ced32,null))[_0xfdf7('0x41')](handleError(_0x3ced32,null));};exports[_0xfdf7('0x45')]=function(_0x14e171,_0x2523c9){return db[_0xfdf7('0x3f')]['create'](_0x14e171[_0xfdf7('0x46')],{})[_0xfdf7('0x24')](respondWithResult(_0x2523c9,0xc9))[_0xfdf7('0x41')](handleError(_0x2523c9,null));};exports[_0xfdf7('0x22')]=function(_0x1d2b38,_0x3a28ff){if(_0x1d2b38['body']['id']){delete _0x1d2b38[_0xfdf7('0x46')]['id'];}return db[_0xfdf7('0x3f')][_0xfdf7('0x44')]({'where':{'id':_0x1d2b38[_0xfdf7('0x47')]['id']}})[_0xfdf7('0x24')](handleEntityNotFound(_0x3a28ff,null))['then'](saveUpdates(_0x1d2b38[_0xfdf7('0x46')],null))[_0xfdf7('0x24')](respondWithResult(_0x3a28ff,null))[_0xfdf7('0x41')](handleError(_0x3a28ff,null));};exports[_0xfdf7('0x23')]=function(_0xbc5ca,_0x12610f){return db[_0xfdf7('0x3f')][_0xfdf7('0x44')]({'where':{'id':_0xbc5ca[_0xfdf7('0x47')]['id']}})[_0xfdf7('0x24')](handleEntityNotFound(_0x12610f,null))[_0xfdf7('0x24')](removeEntity(_0x12610f,null))[_0xfdf7('0x41')](handleError(_0x12610f,null));};exports[_0xfdf7('0x48')]=function(_0x238f64,_0x45b401,_0x98d1f4){var _0x29e55a={};var _0x116e4a={};var _0x13b056;var _0x43a2e9;return db[_0xfdf7('0x3f')][_0xfdf7('0x49')]({'where':{'id':_0x238f64[_0xfdf7('0x47')]['id']}})[_0xfdf7('0x24')](handleEntityNotFound(_0x45b401,null))['then'](function(_0x6467cb){if(_0x6467cb){_0x13b056=_0x6467cb;_0x116e4a[_0xfdf7('0x2d')]=_['keys'](db[_0xfdf7('0x4a')][_0xfdf7('0x2b')]);_0x116e4a['query']=_[_0xfdf7('0x2e')](_0x238f64[_0xfdf7('0x2f')]);_0x116e4a[_0xfdf7('0x38')]=_[_0xfdf7('0x30')](_0x116e4a[_0xfdf7('0x2d')],_0x116e4a['query']);_0x29e55a['attributes']=_['intersection'](_0x116e4a[_0xfdf7('0x2d')],qs[_0xfdf7('0x31')](_0x238f64['query'][_0xfdf7('0x31')]));_0x29e55a[_0xfdf7('0x32')]=_0x29e55a['attributes'][_0xfdf7('0x33')]?_0x29e55a['attributes']:_0x116e4a[_0xfdf7('0x2d')];_0x29e55a[_0xfdf7('0x36')]=qs[_0xfdf7('0x37')](_0x238f64[_0xfdf7('0x2f')][_0xfdf7('0x37')]);_0x29e55a['where']=qs[_0xfdf7('0x38')](_[_0xfdf7('0x4b')](_0x238f64['query'],_0x116e4a[_0xfdf7('0x38')]));if(_0x238f64[_0xfdf7('0x2f')]['filter']){_0x29e55a[_0xfdf7('0x3a')]=_['merge'](_0x29e55a[_0xfdf7('0x3a')],{'$or':_[_0xfdf7('0x2a')](_0x29e55a['attributes'],function(_0x2aed14){var _0x1592bc={};_0x1592bc[_0x2aed14]={'$like':'%'+_0x238f64['query'][_0xfdf7('0x39')]+'%'};return _0x1592bc;})});}_0x29e55a=_[_0xfdf7('0x3b')]({},_0x29e55a,_0x238f64[_0xfdf7('0x3d')]);return _0x13b056[_0xfdf7('0x48')](_0x29e55a);}})[_0xfdf7('0x24')](function(_0x3d0924){if(_0x3d0924){_0x43a2e9=_0x3d0924[_0xfdf7('0x33')];if(!_0x238f64['query']['hasOwnProperty']('nolimit')){_0x29e55a[_0xfdf7('0x1b')]=qs['limit'](_0x238f64[_0xfdf7('0x2f')][_0xfdf7('0x1b')]);_0x29e55a[_0xfdf7('0x1d')]=qs['offset'](_0x238f64[_0xfdf7('0x2f')][_0xfdf7('0x1d')]);}return _0x13b056['getFields'](_0x29e55a);}})[_0xfdf7('0x24')](function(_0x58bce8){if(_0x58bce8){return _0x58bce8?{'count':_0x43a2e9,'rows':_0x58bce8}:null;}})['then'](respondWithResult(_0x45b401,null))[_0xfdf7('0x41')](handleError(_0x45b401,null));};exports[_0xfdf7('0x4c')]=function(_0x2d28b8,_0xd71acc,_0x5f06f6){var _0x5b9751={};var _0x56e792={};var _0x21adb8;var _0x36964b;return db['Dynamics365Configuration'][_0xfdf7('0x49')]({'where':{'id':_0x2d28b8[_0xfdf7('0x47')]['id']}})['then'](handleEntityNotFound(_0xd71acc,null))['then'](function(_0x3d6f40){if(_0x3d6f40){_0x21adb8=_0x3d6f40;_0x56e792[_0xfdf7('0x2d')]=_[_0xfdf7('0x2e')](db[_0xfdf7('0x4a')][_0xfdf7('0x2b')]);_0x56e792[_0xfdf7('0x2f')]=_['keys'](_0x2d28b8[_0xfdf7('0x2f')]);_0x56e792[_0xfdf7('0x38')]=_[_0xfdf7('0x30')](_0x56e792[_0xfdf7('0x2d')],_0x56e792[_0xfdf7('0x2f')]);_0x5b9751[_0xfdf7('0x32')]=_['intersection'](_0x56e792[_0xfdf7('0x2d')],qs[_0xfdf7('0x31')](_0x2d28b8[_0xfdf7('0x2f')][_0xfdf7('0x31')]));_0x5b9751['attributes']=_0x5b9751[_0xfdf7('0x32')][_0xfdf7('0x33')]?_0x5b9751['attributes']:_0x56e792[_0xfdf7('0x2d')];_0x5b9751[_0xfdf7('0x36')]=qs['sort'](_0x2d28b8['query']['sort']);_0x5b9751[_0xfdf7('0x3a')]=qs[_0xfdf7('0x38')](_['pick'](_0x2d28b8[_0xfdf7('0x2f')],_0x56e792['filters']));if(_0x2d28b8[_0xfdf7('0x2f')][_0xfdf7('0x39')]){_0x5b9751[_0xfdf7('0x3a')]=_['merge'](_0x5b9751[_0xfdf7('0x3a')],{'$or':_[_0xfdf7('0x2a')](_0x5b9751[_0xfdf7('0x32')],function(_0x3fa756){var _0x38aa43={};_0x38aa43[_0x3fa756]={'$like':'%'+_0x2d28b8['query']['filter']+'%'};return _0x38aa43;})});}_0x5b9751=_['merge']({},_0x5b9751,_0x2d28b8[_0xfdf7('0x3d')]);return _0x21adb8['getSubjects'](_0x5b9751);}})[_0xfdf7('0x24')](function(_0x3c53bc){if(_0x3c53bc){_0x36964b=_0x3c53bc[_0xfdf7('0x33')];if(!_0x2d28b8[_0xfdf7('0x2f')][_0xfdf7('0x34')](_0xfdf7('0x35'))){_0x5b9751[_0xfdf7('0x1b')]=qs[_0xfdf7('0x1b')](_0x2d28b8[_0xfdf7('0x2f')][_0xfdf7('0x1b')]);_0x5b9751[_0xfdf7('0x1d')]=qs[_0xfdf7('0x1d')](_0x2d28b8[_0xfdf7('0x2f')][_0xfdf7('0x1d')]);}return _0x21adb8[_0xfdf7('0x4c')](_0x5b9751);}})[_0xfdf7('0x24')](function(_0x3cfac4){if(_0x3cfac4){return _0x3cfac4?{'count':_0x36964b,'rows':_0x3cfac4}:null;}})['then'](respondWithResult(_0xd71acc,null))[_0xfdf7('0x41')](handleError(_0xd71acc,null));};exports['getDescriptions']=function(_0x4b9e7b,_0x2f07a9,_0x1bcb28){var _0x59d1f9={};var _0x3b4791={};var _0x41d73d;var _0x78b87c;return db[_0xfdf7('0x3f')][_0xfdf7('0x49')]({'where':{'id':_0x4b9e7b[_0xfdf7('0x47')]['id']}})[_0xfdf7('0x24')](handleEntityNotFound(_0x2f07a9,null))[_0xfdf7('0x24')](function(_0x1558f5){if(_0x1558f5){_0x41d73d=_0x1558f5;_0x3b4791['model']=_[_0xfdf7('0x2e')](db[_0xfdf7('0x4a')][_0xfdf7('0x2b')]);_0x3b4791[_0xfdf7('0x2f')]=_[_0xfdf7('0x2e')](_0x4b9e7b['query']);_0x3b4791['filters']=_[_0xfdf7('0x30')](_0x3b4791[_0xfdf7('0x2d')],_0x3b4791[_0xfdf7('0x2f')]);_0x59d1f9[_0xfdf7('0x32')]=_[_0xfdf7('0x30')](_0x3b4791[_0xfdf7('0x2d')],qs['fields'](_0x4b9e7b[_0xfdf7('0x2f')][_0xfdf7('0x31')]));_0x59d1f9[_0xfdf7('0x32')]=_0x59d1f9[_0xfdf7('0x32')][_0xfdf7('0x33')]?_0x59d1f9['attributes']:_0x3b4791[_0xfdf7('0x2d')];_0x59d1f9[_0xfdf7('0x36')]=qs[_0xfdf7('0x37')](_0x4b9e7b[_0xfdf7('0x2f')]['sort']);_0x59d1f9[_0xfdf7('0x3a')]=qs['filters'](_[_0xfdf7('0x4b')](_0x4b9e7b[_0xfdf7('0x2f')],_0x3b4791['filters']));if(_0x4b9e7b['query'][_0xfdf7('0x39')]){_0x59d1f9['where']=_['merge'](_0x59d1f9[_0xfdf7('0x3a')],{'$or':_[_0xfdf7('0x2a')](_0x59d1f9[_0xfdf7('0x32')],function(_0x46eddf){var _0x1faff5={};_0x1faff5[_0x46eddf]={'$like':'%'+_0x4b9e7b['query'][_0xfdf7('0x39')]+'%'};return _0x1faff5;})});}_0x59d1f9=_[_0xfdf7('0x3b')]({},_0x59d1f9,_0x4b9e7b[_0xfdf7('0x3d')]);return _0x41d73d[_0xfdf7('0x4d')](_0x59d1f9);}})[_0xfdf7('0x24')](function(_0x396e50){if(_0x396e50){_0x78b87c=_0x396e50['length'];if(!_0x4b9e7b[_0xfdf7('0x2f')][_0xfdf7('0x34')](_0xfdf7('0x35'))){_0x59d1f9[_0xfdf7('0x1b')]=qs[_0xfdf7('0x1b')](_0x4b9e7b[_0xfdf7('0x2f')][_0xfdf7('0x1b')]);_0x59d1f9['offset']=qs[_0xfdf7('0x1d')](_0x4b9e7b['query'][_0xfdf7('0x1d')]);}return _0x41d73d['getDescriptions'](_0x59d1f9);}})[_0xfdf7('0x24')](function(_0x294b04){if(_0x294b04){return _0x294b04?{'count':_0x78b87c,'rows':_0x294b04}:null;}})[_0xfdf7('0x24')](respondWithResult(_0x2f07a9,null))['catch'](handleError(_0x2f07a9,null));};
\ No newline at end of file
+var _0x168a=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','end','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','options','find','create','body','update','getFields','Dynamics365Field','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','to-csv'];(function(_0x28d318,_0x2cd9e7){var _0x4be737=function(_0x536d43){while(--_0x536d43){_0x28d318['push'](_0x28d318['shift']());}};_0x4be737(++_0x2cd9e7);}(_0x168a,0xdf));var _0xa168=function(_0x586617,_0xaa2154){_0x586617=_0x586617-0x0;var _0x84015e=_0x168a[_0x586617];return _0x84015e;};'use strict';var emlformat=require(_0xa168('0x0'));var rimraf=require(_0xa168('0x1'));var zipdir=require(_0xa168('0x2'));var jsonpatch=require(_0xa168('0x3'));var rp=require(_0xa168('0x4'));var moment=require('moment');var BPromise=require(_0xa168('0x5'));var Mustache=require(_0xa168('0x6'));var util=require(_0xa168('0x7'));var path=require('path');var sox=require(_0xa168('0x8'));var csv=require('to-csv');var ejs=require(_0xa168('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa168('0xa'));var squel=require('squel');var crypto=require(_0xa168('0xb'));var jsforce=require(_0xa168('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa168('0xd'));var querystring=require(_0xa168('0xe'));var Papa=require(_0xa168('0xf'));var Redis=require(_0xa168('0x10'));var authService=require(_0xa168('0x11'));var qs=require(_0xa168('0x12'));var as=require(_0xa168('0x13'));var hardwareService=require(_0xa168('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa168('0x15'));var config=require(_0xa168('0x16'));var licenseUtil=require(_0xa168('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2041cc,_0x1023b0){_0x1023b0=_0x1023b0||0xcc;return function(_0x4e7cc7){if(_0x4e7cc7){return _0x2041cc[_0xa168('0x18')](_0x1023b0);}return _0x2041cc['status'](_0x1023b0)['end']();};}function respondWithResult(_0x3625ba,_0x1a6305){_0x1a6305=_0x1a6305||0xc8;return function(_0x5e32e8){if(_0x5e32e8){return _0x3625ba[_0xa168('0x19')](_0x1a6305)[_0xa168('0x1a')](_0x5e32e8);}};}function respondWithFilteredResult(_0x27be30,_0x26ffda){return function(_0x270495){if(_0x270495){var _0x4114d7=typeof _0x26ffda[_0xa168('0x1b')]==='undefined'&&typeof _0x26ffda['limit']===_0xa168('0x1c');var _0x2cdfb2=_0x270495[_0xa168('0x1d')];var _0x1e68df=_0x4114d7?0x0:_0x26ffda[_0xa168('0x1b')];var _0x42dbfe=_0x4114d7?_0x270495[_0xa168('0x1d')]:_0x26ffda[_0xa168('0x1b')]+_0x26ffda[_0xa168('0x1e')];var _0x4ae668;if(_0x42dbfe>=_0x2cdfb2){_0x42dbfe=_0x2cdfb2;_0x4ae668=0xc8;}else{_0x4ae668=0xce;}_0x27be30[_0xa168('0x19')](_0x4ae668);return _0x27be30[_0xa168('0x1f')](_0xa168('0x20'),_0x1e68df+'-'+_0x42dbfe+'/'+_0x2cdfb2)[_0xa168('0x1a')](_0x270495);}return null;};}function patchUpdates(_0x46c022){return function(_0x56479e){try{jsonpatch[_0xa168('0x21')](_0x56479e,_0x46c022,!![]);}catch(_0x54082b){return BPromise['reject'](_0x54082b);}return _0x56479e['save']();};}function saveUpdates(_0x4b4132,_0x41eeeb){return function(_0x150c33){if(_0x150c33){return _0x150c33['update'](_0x4b4132)['then'](function(_0x231fbe){return _0x231fbe;});}return null;};}function removeEntity(_0xd1f43e,_0x57a8c5){return function(_0x297647){if(_0x297647){return _0x297647[_0xa168('0x22')]()['then'](function(){_0xd1f43e['status'](0xcc)[_0xa168('0x23')]();});}};}function handleEntityNotFound(_0x20b645,_0x102fff){return function(_0x4373ec){if(!_0x4373ec){_0x20b645[_0xa168('0x18')](0x194);}return _0x4373ec;};}function handleError(_0x509eae,_0x3436fe){_0x3436fe=_0x3436fe||0x1f4;return function(_0x3ecbbc){logger['error'](_0x3ecbbc[_0xa168('0x24')]);if(_0x3ecbbc[_0xa168('0x25')]){delete _0x3ecbbc[_0xa168('0x25')];}_0x509eae[_0xa168('0x19')](_0x3436fe)[_0xa168('0x26')](_0x3ecbbc);};}exports['index']=function(_0x54e88c,_0x18044a){var _0x291772={},_0xf1445c={},_0x22fc31={'count':0x0,'rows':[]};var _0x2014a1=_[_0xa168('0x27')](db[_0xa168('0x28')][_0xa168('0x29')],function(_0xa40830){return{'name':_0xa40830[_0xa168('0x2a')],'type':_0xa40830[_0xa168('0x2b')][_0xa168('0x2c')]};});_0xf1445c['model']=_[_0xa168('0x27')](_0x2014a1,_0xa168('0x25'));_0xf1445c[_0xa168('0x2d')]=_[_0xa168('0x2e')](_0x54e88c[_0xa168('0x2d')]);_0xf1445c[_0xa168('0x2f')]=_['intersection'](_0xf1445c[_0xa168('0x30')],_0xf1445c[_0xa168('0x2d')]);_0x291772[_0xa168('0x31')]=_[_0xa168('0x32')](_0xf1445c[_0xa168('0x30')],qs['fields'](_0x54e88c[_0xa168('0x2d')][_0xa168('0x33')]));_0x291772[_0xa168('0x31')]=_0x291772[_0xa168('0x31')][_0xa168('0x34')]?_0x291772[_0xa168('0x31')]:_0xf1445c['model'];if(!_0x54e88c[_0xa168('0x2d')][_0xa168('0x35')](_0xa168('0x36'))){_0x291772[_0xa168('0x1e')]=qs[_0xa168('0x1e')](_0x54e88c[_0xa168('0x2d')][_0xa168('0x1e')]);_0x291772[_0xa168('0x1b')]=qs[_0xa168('0x1b')](_0x54e88c['query'][_0xa168('0x1b')]);}_0x291772[_0xa168('0x37')]=qs[_0xa168('0x38')](_0x54e88c[_0xa168('0x2d')][_0xa168('0x38')]);_0x291772[_0xa168('0x39')]=qs[_0xa168('0x2f')](_[_0xa168('0x3a')](_0x54e88c[_0xa168('0x2d')],_0xf1445c['filters']),_0x2014a1);if(_0x54e88c['query'][_0xa168('0x3b')]){_0x291772[_0xa168('0x39')]=_[_0xa168('0x3c')](_0x291772[_0xa168('0x39')],{'$or':_[_0xa168('0x27')](_0x2014a1,function(_0xb1e8b9){if(_0xb1e8b9[_0xa168('0x2b')]!=='VIRTUAL'){var _0x3cd1b9={};_0x3cd1b9[_0xb1e8b9[_0xa168('0x25')]]={'$like':'%'+_0x54e88c[_0xa168('0x2d')][_0xa168('0x3b')]+'%'};return _0x3cd1b9;}})});}_0x291772=_[_0xa168('0x3c')]({},_0x291772,_0x54e88c['options']);var _0x45c8b9={'where':_0x291772[_0xa168('0x39')]};return db['Dynamics365Configuration'][_0xa168('0x1d')](_0x45c8b9)['then'](function(_0x463b7d){_0x22fc31[_0xa168('0x1d')]=_0x463b7d;if(_0x54e88c[_0xa168('0x2d')][_0xa168('0x3d')]){_0x291772[_0xa168('0x3e')]=[{'all':!![]}];}return db[_0xa168('0x28')][_0xa168('0x3f')](_0x291772);})[_0xa168('0x40')](function(_0x2def83){_0x22fc31[_0xa168('0x41')]=_0x2def83;return _0x22fc31;})[_0xa168('0x40')](respondWithFilteredResult(_0x18044a,_0x291772))[_0xa168('0x42')](handleError(_0x18044a,null));};exports[_0xa168('0x43')]=function(_0x42a384,_0x2e5ab5){var _0x2da42d={'raw':![],'where':{'id':_0x42a384[_0xa168('0x44')]['id']}},_0x45bf18={};_0x45bf18[_0xa168('0x30')]=_[_0xa168('0x2e')](db['Dynamics365Configuration'][_0xa168('0x29')]);_0x45bf18['query']=_[_0xa168('0x2e')](_0x42a384[_0xa168('0x2d')]);_0x45bf18[_0xa168('0x2f')]=_[_0xa168('0x32')](_0x45bf18[_0xa168('0x30')],_0x45bf18['query']);_0x2da42d[_0xa168('0x31')]=_['intersection'](_0x45bf18[_0xa168('0x30')],qs['fields'](_0x42a384['query'][_0xa168('0x33')]));_0x2da42d['attributes']=_0x2da42d[_0xa168('0x31')][_0xa168('0x34')]?_0x2da42d[_0xa168('0x31')]:_0x45bf18[_0xa168('0x30')];if(_0x42a384[_0xa168('0x2d')][_0xa168('0x3d')]){_0x2da42d[_0xa168('0x3e')]=[{'all':!![]}];}_0x2da42d=_[_0xa168('0x3c')]({},_0x2da42d,_0x42a384[_0xa168('0x45')]);return db[_0xa168('0x28')][_0xa168('0x46')](_0x2da42d)[_0xa168('0x40')](handleEntityNotFound(_0x2e5ab5,null))[_0xa168('0x40')](respondWithResult(_0x2e5ab5,null))['catch'](handleError(_0x2e5ab5,null));};exports[_0xa168('0x47')]=function(_0x4e7eaa,_0x2e8e06){return db[_0xa168('0x28')][_0xa168('0x47')](_0x4e7eaa[_0xa168('0x48')],{})[_0xa168('0x40')](respondWithResult(_0x2e8e06,0xc9))['catch'](handleError(_0x2e8e06,null));};exports[_0xa168('0x49')]=function(_0xd30356,_0x5afd6d){if(_0xd30356[_0xa168('0x48')]['id']){delete _0xd30356['body']['id'];}return db[_0xa168('0x28')][_0xa168('0x46')]({'where':{'id':_0xd30356[_0xa168('0x44')]['id']}})[_0xa168('0x40')](handleEntityNotFound(_0x5afd6d,null))[_0xa168('0x40')](saveUpdates(_0xd30356[_0xa168('0x48')],null))['then'](respondWithResult(_0x5afd6d,null))['catch'](handleError(_0x5afd6d,null));};exports[_0xa168('0x22')]=function(_0x34329a,_0xd63147){return db[_0xa168('0x28')]['find']({'where':{'id':_0x34329a[_0xa168('0x44')]['id']}})['then'](handleEntityNotFound(_0xd63147,null))[_0xa168('0x40')](removeEntity(_0xd63147,null))['catch'](handleError(_0xd63147,null));};exports[_0xa168('0x4a')]=function(_0x416f01,_0xed8a85,_0x1a933d){var _0x28a405={};var _0x3af988={};var _0x312e05;var _0x4927c9;return db[_0xa168('0x28')]['findOne']({'where':{'id':_0x416f01[_0xa168('0x44')]['id']}})[_0xa168('0x40')](handleEntityNotFound(_0xed8a85,null))[_0xa168('0x40')](function(_0x4c6d68){if(_0x4c6d68){_0x312e05=_0x4c6d68;_0x3af988[_0xa168('0x30')]=_['keys'](db[_0xa168('0x4b')][_0xa168('0x29')]);_0x3af988[_0xa168('0x2d')]=_['keys'](_0x416f01[_0xa168('0x2d')]);_0x3af988['filters']=_[_0xa168('0x32')](_0x3af988['model'],_0x3af988['query']);_0x28a405[_0xa168('0x31')]=_[_0xa168('0x32')](_0x3af988['model'],qs[_0xa168('0x33')](_0x416f01[_0xa168('0x2d')]['fields']));_0x28a405[_0xa168('0x31')]=_0x28a405['attributes'][_0xa168('0x34')]?_0x28a405[_0xa168('0x31')]:_0x3af988['model'];_0x28a405['order']=qs[_0xa168('0x38')](_0x416f01[_0xa168('0x2d')][_0xa168('0x38')]);_0x28a405[_0xa168('0x39')]=qs[_0xa168('0x2f')](_[_0xa168('0x3a')](_0x416f01[_0xa168('0x2d')],_0x3af988[_0xa168('0x2f')]));if(_0x416f01[_0xa168('0x2d')]['filter']){_0x28a405[_0xa168('0x39')]=_[_0xa168('0x3c')](_0x28a405[_0xa168('0x39')],{'$or':_[_0xa168('0x27')](_0x28a405['attributes'],function(_0x3956d5){var _0x117339={};_0x117339[_0x3956d5]={'$like':'%'+_0x416f01[_0xa168('0x2d')][_0xa168('0x3b')]+'%'};return _0x117339;})});}_0x28a405=_['merge']({},_0x28a405,_0x416f01[_0xa168('0x45')]);return _0x312e05['getFields'](_0x28a405);}})[_0xa168('0x40')](function(_0x4c3330){if(_0x4c3330){_0x4927c9=_0x4c3330[_0xa168('0x34')];if(!_0x416f01[_0xa168('0x2d')][_0xa168('0x35')](_0xa168('0x36'))){_0x28a405[_0xa168('0x1e')]=qs[_0xa168('0x1e')](_0x416f01[_0xa168('0x2d')]['limit']);_0x28a405[_0xa168('0x1b')]=qs[_0xa168('0x1b')](_0x416f01[_0xa168('0x2d')][_0xa168('0x1b')]);}return _0x312e05[_0xa168('0x4a')](_0x28a405);}})['then'](function(_0x5254a2){if(_0x5254a2){return _0x5254a2?{'count':_0x4927c9,'rows':_0x5254a2}:null;}})[_0xa168('0x40')](respondWithResult(_0xed8a85,null))[_0xa168('0x42')](handleError(_0xed8a85,null));};exports[_0xa168('0x4c')]=function(_0x3f864d,_0x1dde20,_0x5e2e2f){var _0xcf83ab={};var _0x16e610={};var _0x4bbac6;var _0x59cd23;return db[_0xa168('0x28')][_0xa168('0x4d')]({'where':{'id':_0x3f864d['params']['id']}})['then'](handleEntityNotFound(_0x1dde20,null))[_0xa168('0x40')](function(_0x8dff5a){if(_0x8dff5a){_0x4bbac6=_0x8dff5a;_0x16e610['model']=_['keys'](db[_0xa168('0x4b')][_0xa168('0x29')]);_0x16e610[_0xa168('0x2d')]=_['keys'](_0x3f864d[_0xa168('0x2d')]);_0x16e610[_0xa168('0x2f')]=_[_0xa168('0x32')](_0x16e610['model'],_0x16e610['query']);_0xcf83ab['attributes']=_[_0xa168('0x32')](_0x16e610[_0xa168('0x30')],qs[_0xa168('0x33')](_0x3f864d['query'][_0xa168('0x33')]));_0xcf83ab[_0xa168('0x31')]=_0xcf83ab[_0xa168('0x31')][_0xa168('0x34')]?_0xcf83ab[_0xa168('0x31')]:_0x16e610['model'];_0xcf83ab[_0xa168('0x37')]=qs[_0xa168('0x38')](_0x3f864d[_0xa168('0x2d')][_0xa168('0x38')]);_0xcf83ab[_0xa168('0x39')]=qs['filters'](_[_0xa168('0x3a')](_0x3f864d[_0xa168('0x2d')],_0x16e610[_0xa168('0x2f')]));if(_0x3f864d[_0xa168('0x2d')][_0xa168('0x3b')]){_0xcf83ab[_0xa168('0x39')]=_[_0xa168('0x3c')](_0xcf83ab[_0xa168('0x39')],{'$or':_[_0xa168('0x27')](_0xcf83ab[_0xa168('0x31')],function(_0x4834bc){var _0x3c6793={};_0x3c6793[_0x4834bc]={'$like':'%'+_0x3f864d['query'][_0xa168('0x3b')]+'%'};return _0x3c6793;})});}_0xcf83ab=_['merge']({},_0xcf83ab,_0x3f864d[_0xa168('0x45')]);return _0x4bbac6[_0xa168('0x4c')](_0xcf83ab);}})[_0xa168('0x40')](function(_0x27e7f3){if(_0x27e7f3){_0x59cd23=_0x27e7f3['length'];if(!_0x3f864d['query']['hasOwnProperty']('nolimit')){_0xcf83ab[_0xa168('0x1e')]=qs[_0xa168('0x1e')](_0x3f864d[_0xa168('0x2d')][_0xa168('0x1e')]);_0xcf83ab[_0xa168('0x1b')]=qs[_0xa168('0x1b')](_0x3f864d[_0xa168('0x2d')][_0xa168('0x1b')]);}return _0x4bbac6['getSubjects'](_0xcf83ab);}})['then'](function(_0x456e3c){if(_0x456e3c){return _0x456e3c?{'count':_0x59cd23,'rows':_0x456e3c}:null;}})[_0xa168('0x40')](respondWithResult(_0x1dde20,null))[_0xa168('0x42')](handleError(_0x1dde20,null));};exports[_0xa168('0x4e')]=function(_0x534f99,_0x229676,_0x5550fe){var _0x6f25bf={};var _0x282e07={};var _0x1c281b;var _0x269b98;return db[_0xa168('0x28')][_0xa168('0x4d')]({'where':{'id':_0x534f99['params']['id']}})[_0xa168('0x40')](handleEntityNotFound(_0x229676,null))[_0xa168('0x40')](function(_0x407da5){if(_0x407da5){_0x1c281b=_0x407da5;_0x282e07[_0xa168('0x30')]=_[_0xa168('0x2e')](db[_0xa168('0x4b')][_0xa168('0x29')]);_0x282e07[_0xa168('0x2d')]=_[_0xa168('0x2e')](_0x534f99[_0xa168('0x2d')]);_0x282e07['filters']=_['intersection'](_0x282e07['model'],_0x282e07[_0xa168('0x2d')]);_0x6f25bf[_0xa168('0x31')]=_[_0xa168('0x32')](_0x282e07['model'],qs[_0xa168('0x33')](_0x534f99[_0xa168('0x2d')][_0xa168('0x33')]));_0x6f25bf[_0xa168('0x31')]=_0x6f25bf[_0xa168('0x31')][_0xa168('0x34')]?_0x6f25bf[_0xa168('0x31')]:_0x282e07[_0xa168('0x30')];_0x6f25bf[_0xa168('0x37')]=qs[_0xa168('0x38')](_0x534f99['query']['sort']);_0x6f25bf['where']=qs['filters'](_[_0xa168('0x3a')](_0x534f99[_0xa168('0x2d')],_0x282e07[_0xa168('0x2f')]));if(_0x534f99['query'][_0xa168('0x3b')]){_0x6f25bf['where']=_[_0xa168('0x3c')](_0x6f25bf['where'],{'$or':_['map'](_0x6f25bf[_0xa168('0x31')],function(_0x1a762e){var _0x2f5846={};_0x2f5846[_0x1a762e]={'$like':'%'+_0x534f99['query'][_0xa168('0x3b')]+'%'};return _0x2f5846;})});}_0x6f25bf=_[_0xa168('0x3c')]({},_0x6f25bf,_0x534f99[_0xa168('0x45')]);return _0x1c281b['getDescriptions'](_0x6f25bf);}})[_0xa168('0x40')](function(_0x342d6d){if(_0x342d6d){_0x269b98=_0x342d6d['length'];if(!_0x534f99[_0xa168('0x2d')][_0xa168('0x35')](_0xa168('0x36'))){_0x6f25bf[_0xa168('0x1e')]=qs[_0xa168('0x1e')](_0x534f99['query'][_0xa168('0x1e')]);_0x6f25bf[_0xa168('0x1b')]=qs[_0xa168('0x1b')](_0x534f99[_0xa168('0x2d')][_0xa168('0x1b')]);}return _0x1c281b[_0xa168('0x4e')](_0x6f25bf);}})['then'](function(_0x15b564){if(_0x15b564){return _0x15b564?{'count':_0x269b98,'rows':_0x15b564}:null;}})['then'](respondWithResult(_0x229676,null))[_0xa168('0x42')](handleError(_0x229676,null));};
\ No newline at end of file
index 51e408a..0f0c6df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0x4b84[_0x3c858f];return _0x198090;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x3bbe75,_0x18c3a5){var _0x5226f0=function(_0x4ac541){while(--_0x4ac541){_0x3bbe75['push'](_0x3bbe75['shift']());}};_0x5226f0(++_0x18c3a5);}(_0x70e0,0x17b));var _0x070e=function(_0x5370b2,_0x363cc1){_0x5370b2=_0x5370b2-0x0;var _0x4107d3=_0x70e0[_0x5370b2];return _0x4107d3;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a74b389..e7acf92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x390b=['../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x390b,0xcb));var _0xb390=function(_0x2c1f96,_0x3331ab){_0x2c1f96=_0x2c1f96-0x0;var _0x2b25e4=_0x390b[_0x2c1f96];return _0x2b25e4;};'use strict';var _=require(_0xb390('0x0'));var util=require(_0xb390('0x1'));var moment=require(_0xb390('0x2'));var BPromise=require(_0xb390('0x3'));var rs=require(_0xb390('0x4'));var fs=require('fs');var Redis=require(_0xb390('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb390('0x6'));var logger=require(_0xb390('0x7'))(_0xb390('0x8'));var config=require('../../config/environment');var jayson=require(_0xb390('0x9'));var client=jayson[_0xb390('0xa')][_0xb390('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ad10d,_0x40e8b9,_0x20c405){return new BPromise(function(_0x4adf4a,_0x25a83a){return client[_0xb390('0xc')](_0x3ad10d,_0x20c405)['then'](function(_0x174b6a){logger[_0xb390('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x40e8b9,_0xb390('0xe'));logger[_0xb390('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x40e8b9,'request\x20sent',JSON['stringify'](_0x174b6a));if(_0x174b6a[_0xb390('0x10')]){if(_0x174b6a[_0xb390('0x10')]['code']===0x1f4){logger[_0xb390('0x10')](_0xb390('0x11'),_0x40e8b9,_0x174b6a[_0xb390('0x10')][_0xb390('0x12')]);return _0x25a83a(_0x174b6a['error'][_0xb390('0x12')]);}logger[_0xb390('0x10')](_0xb390('0x11'),_0x40e8b9,_0x174b6a[_0xb390('0x10')][_0xb390('0x12')]);return _0x4adf4a(_0x174b6a[_0xb390('0x10')]['message']);}else{logger[_0xb390('0xd')](_0xb390('0x11'),_0x40e8b9,'request\x20sent');_0x4adf4a(_0x174b6a[_0xb390('0x13')]['message']);}})[_0xb390('0x14')](function(_0x12763e){logger[_0xb390('0x10')](_0xb390('0x11'),_0x40e8b9,_0x12763e);_0x25a83a(_0x12763e);});});}
\ No newline at end of file
+var _0xfaf3=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x354af4,_0x27491d){var _0x3e3e93=function(_0xad9e86){while(--_0xad9e86){_0x354af4['push'](_0x354af4['shift']());}};_0x3e3e93(++_0x27491d);}(_0xfaf3,0x14e));var _0x3faf=function(_0x38cff7,_0x5c5239){_0x38cff7=_0x38cff7-0x0;var _0x3d7072=_0xfaf3[_0x38cff7];return _0x3d7072;};'use strict';var _=require('lodash');var util=require(_0x3faf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3faf('0x1'));var fs=require('fs');var Redis=require(_0x3faf('0x2'));var db=require(_0x3faf('0x3'))['db'];var utils=require(_0x3faf('0x4'));var logger=require(_0x3faf('0x5'))(_0x3faf('0x6'));var config=require(_0x3faf('0x7'));var jayson=require(_0x3faf('0x8'));var client=jayson['client'][_0x3faf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa46d,_0x5055b6,_0x3c8489){return new BPromise(function(_0x545ea3,_0x2983c5){return client['request'](_0x3fa46d,_0x3c8489)[_0x3faf('0xa')](function(_0x2b024f){logger[_0x3faf('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5055b6,_0x3faf('0xc'));logger['debug'](_0x3faf('0xd'),_0x5055b6,'request\x20sent',JSON[_0x3faf('0xe')](_0x2b024f));if(_0x2b024f['error']){if(_0x2b024f[_0x3faf('0xf')]['code']===0x1f4){logger[_0x3faf('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5055b6,_0x2b024f[_0x3faf('0xf')][_0x3faf('0x10')]);return _0x2983c5(_0x2b024f[_0x3faf('0xf')][_0x3faf('0x10')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x5055b6,_0x2b024f[_0x3faf('0xf')]['message']);return _0x545ea3(_0x2b024f[_0x3faf('0xf')][_0x3faf('0x10')]);}else{logger['info'](_0x3faf('0x11'),_0x5055b6,_0x3faf('0xc'));_0x545ea3(_0x2b024f[_0x3faf('0x12')][_0x3faf('0x10')]);}})[_0x3faf('0x13')](function(_0x1024b5){logger[_0x3faf('0xf')](_0x3faf('0x11'),_0x5055b6,_0x1024b5);_0x2983c5(_0x1024b5);});});}
\ No newline at end of file
index 284ae5b..9c4c7df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d6c=['post','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4190eb,_0x2cac1c){var _0x264c85=function(_0x1cb207){while(--_0x1cb207){_0x4190eb['push'](_0x4190eb['shift']());}};_0x264c85(++_0x2cac1c);}(_0x5d6c,0xef));var _0xc5d6=function(_0x6ac24a,_0x5cec4a){_0x6ac24a=_0x6ac24a-0x0;var _0x12d41d=_0x5d6c[_0x6ac24a];return _0x12d41d;};'use strict';var multer=require('multer');var util=require(_0xc5d6('0x0'));var path=require(_0xc5d6('0x1'));var timeout=require(_0xc5d6('0x2'));var express=require(_0xc5d6('0x3'));var router=express[_0xc5d6('0x4')]();var fs_extra=require(_0xc5d6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc5d6('0x6'));var controller=require(_0xc5d6('0x7'));router[_0xc5d6('0x8')]('/',auth[_0xc5d6('0x9')](),controller[_0xc5d6('0xa')]);router[_0xc5d6('0x8')](_0xc5d6('0xb'),auth[_0xc5d6('0x9')](),controller[_0xc5d6('0xc')]);router[_0xc5d6('0xd')]('/',auth[_0xc5d6('0x9')](),controller[_0xc5d6('0xe')]);router['put'](_0xc5d6('0xb'),auth['isAuthenticated'](),controller[_0xc5d6('0xf')]);router['delete'](_0xc5d6('0xb'),auth[_0xc5d6('0x9')](),controller[_0xc5d6('0x10')]);module[_0xc5d6('0x11')]=router;
\ No newline at end of file
+var _0x9f60=['post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x9f60,0x101));var _0x09f6=function(_0x2d4a51,_0x3feea9){_0x2d4a51=_0x2d4a51-0x0;var _0x3e165b=_0x9f60[_0x2d4a51];return _0x3e165b;};'use strict';var multer=require(_0x09f6('0x0'));var util=require(_0x09f6('0x1'));var path=require(_0x09f6('0x2'));var timeout=require(_0x09f6('0x3'));var express=require('express');var router=express[_0x09f6('0x4')]();var fs_extra=require(_0x09f6('0x5'));var auth=require(_0x09f6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x09f6('0x7'));var controller=require(_0x09f6('0x8'));router[_0x09f6('0x9')]('/',auth[_0x09f6('0xa')](),controller['index']);router[_0x09f6('0x9')](_0x09f6('0xb'),auth[_0x09f6('0xa')](),controller[_0x09f6('0xc')]);router[_0x09f6('0xd')]('/',auth[_0x09f6('0xa')](),controller[_0x09f6('0xe')]);router[_0x09f6('0xf')](_0x09f6('0xb'),auth[_0x09f6('0xa')](),controller['update']);router[_0x09f6('0x10')](_0x09f6('0xb'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x11')]);module['exports']=router;
\ No newline at end of file
index d0e5933..3d246f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af3=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x293beb,_0x3e50ce){var _0x3ec142=function(_0x5a0271){while(--_0x5a0271){_0x293beb['push'](_0x293beb['shift']());}};_0x3ec142(++_0x3e50ce);}(_0x7af3,0x128));var _0x37af=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7af3[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x37af('0x0')]('string',_0x37af('0x1'),_0x37af('0x2'),_0x37af('0x3'),_0x37af('0x4')),'defaultValue':_0x37af('0x5')},'content':{'type':Sequelize[_0x37af('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x37af('0x0')]('string',_0x37af('0x1'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x37af('0x6')]},'nameField':{'type':Sequelize[_0x37af('0x6')]},'customField':{'type':Sequelize[_0x37af('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd739=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd739,0x184));var _0x9d73=function(_0x101bb1,_0x515f86){_0x101bb1=_0x101bb1-0x0;var _0x3b3c58=_0xd739[_0x101bb1];return _0x3b3c58;};'use strict';var Sequelize=require('sequelize');module[_0x9d73('0x0')]={'type':{'type':Sequelize[_0x9d73('0x1')]('string',_0x9d73('0x2'),_0x9d73('0x3'),_0x9d73('0x4'),_0x9d73('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9d73('0x6')]},'key':{'type':Sequelize[_0x9d73('0x6')]},'keyType':{'type':Sequelize[_0x9d73('0x1')]('string',_0x9d73('0x2'),_0x9d73('0x3'))},'keyContent':{'type':Sequelize[_0x9d73('0x6')]},'idField':{'type':Sequelize[_0x9d73('0x6')]},'nameField':{'type':Sequelize[_0x9d73('0x6')]},'customField':{'type':Sequelize[_0x9d73('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d73('0x6')]}};
\ No newline at end of file
index 0c3a305..1cd8746 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18a0=['create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','keys','find'];(function(_0x419693,_0xb8f2eb){var _0x156f4=function(_0x26654e){while(--_0x26654e){_0x419693['push'](_0x419693['shift']());}};_0x156f4(++_0xb8f2eb);}(_0x18a0,0x8c));var _0x018a=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x18a0[_0x810e4d];return _0x13f01c;};'use strict';var emlformat=require(_0x018a('0x0'));var rimraf=require(_0x018a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x018a('0x2'));var rp=require(_0x018a('0x3'));var moment=require('moment');var BPromise=require(_0x018a('0x4'));var Mustache=require(_0x018a('0x5'));var util=require(_0x018a('0x6'));var path=require(_0x018a('0x7'));var sox=require('sox');var csv=require(_0x018a('0x8'));var ejs=require(_0x018a('0x9'));var fs=require('fs');var fs_extra=require(_0x018a('0xa'));var _=require('lodash');var squel=require(_0x018a('0xb'));var crypto=require('crypto');var jsforce=require(_0x018a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x018a('0x8'));var querystring=require(_0x018a('0xd'));var Papa=require(_0x018a('0xe'));var Redis=require(_0x018a('0xf'));var authService=require(_0x018a('0x10'));var qs=require(_0x018a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x018a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x018a('0x13'));var licenseUtil=require(_0x018a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f3acc,_0x213134){_0x213134=_0x213134||0xcc;return function(_0x50ab0a){if(_0x50ab0a){return _0x1f3acc[_0x018a('0x15')](_0x213134);}return _0x1f3acc['status'](_0x213134)[_0x018a('0x16')]();};}function respondWithResult(_0x13051f,_0x31449b){_0x31449b=_0x31449b||0xc8;return function(_0x19961a){if(_0x19961a){return _0x13051f[_0x018a('0x17')](_0x31449b)[_0x018a('0x18')](_0x19961a);}};}function respondWithFilteredResult(_0x134aa7,_0x108265){return function(_0x1da930){if(_0x1da930){var _0x54ff27=typeof _0x108265[_0x018a('0x19')]===_0x018a('0x1a')&&typeof _0x108265[_0x018a('0x1b')]==='undefined';var _0x195336=_0x1da930[_0x018a('0x1c')];var _0x5c05e5=_0x54ff27?0x0:_0x108265[_0x018a('0x19')];var _0x45dae2=_0x54ff27?_0x1da930[_0x018a('0x1c')]:_0x108265[_0x018a('0x19')]+_0x108265['limit'];var _0x41a5d9;if(_0x45dae2>=_0x195336){_0x45dae2=_0x195336;_0x41a5d9=0xc8;}else{_0x41a5d9=0xce;}_0x134aa7['status'](_0x41a5d9);return _0x134aa7['set'](_0x018a('0x1d'),_0x5c05e5+'-'+_0x45dae2+'/'+_0x195336)[_0x018a('0x18')](_0x1da930);}return null;};}function patchUpdates(_0x3be2a5){return function(_0x5d80d9){try{jsonpatch[_0x018a('0x1e')](_0x5d80d9,_0x3be2a5,!![]);}catch(_0x1b2113){return BPromise[_0x018a('0x1f')](_0x1b2113);}return _0x5d80d9[_0x018a('0x20')]();};}function saveUpdates(_0x504017,_0x5e77ff){return function(_0x11348b){if(_0x11348b){return _0x11348b[_0x018a('0x21')](_0x504017)[_0x018a('0x22')](function(_0x235c1c){return _0x235c1c;});}return null;};}function removeEntity(_0x413e0d,_0x490c06){return function(_0x405ef9){if(_0x405ef9){return _0x405ef9[_0x018a('0x23')]()[_0x018a('0x22')](function(){_0x413e0d[_0x018a('0x17')](0xcc)[_0x018a('0x16')]();});}};}function handleEntityNotFound(_0x3efb19,_0x35ac41){return function(_0x608705){if(!_0x608705){_0x3efb19['sendStatus'](0x194);}return _0x608705;};}function handleError(_0x30c5b4,_0x5befed){_0x5befed=_0x5befed||0x1f4;return function(_0x3480fc){logger[_0x018a('0x24')](_0x3480fc['stack']);if(_0x3480fc['name']){delete _0x3480fc[_0x018a('0x25')];}_0x30c5b4[_0x018a('0x17')](_0x5befed)['send'](_0x3480fc);};}exports[_0x018a('0x26')]=function(_0x48fc9e,_0x5f1062){var _0x5cc216={},_0x4fc8b0={},_0x631526={'count':0x0,'rows':[]};var _0xbac512=_[_0x018a('0x27')](db[_0x018a('0x28')][_0x018a('0x29')],function(_0xf04df7){return{'name':_0xf04df7[_0x018a('0x2a')],'type':_0xf04df7['type'][_0x018a('0x2b')]};});_0x4fc8b0[_0x018a('0x2c')]=_[_0x018a('0x27')](_0xbac512,'name');_0x4fc8b0[_0x018a('0x2d')]=_['keys'](_0x48fc9e[_0x018a('0x2d')]);_0x4fc8b0[_0x018a('0x2e')]=_['intersection'](_0x4fc8b0['model'],_0x4fc8b0[_0x018a('0x2d')]);_0x5cc216[_0x018a('0x2f')]=_[_0x018a('0x30')](_0x4fc8b0[_0x018a('0x2c')],qs[_0x018a('0x31')](_0x48fc9e[_0x018a('0x2d')]['fields']));_0x5cc216[_0x018a('0x2f')]=_0x5cc216[_0x018a('0x2f')][_0x018a('0x32')]?_0x5cc216[_0x018a('0x2f')]:_0x4fc8b0[_0x018a('0x2c')];if(!_0x48fc9e['query'][_0x018a('0x33')](_0x018a('0x34'))){_0x5cc216[_0x018a('0x1b')]=qs[_0x018a('0x1b')](_0x48fc9e[_0x018a('0x2d')][_0x018a('0x1b')]);_0x5cc216[_0x018a('0x19')]=qs[_0x018a('0x19')](_0x48fc9e['query'][_0x018a('0x19')]);}_0x5cc216['order']=qs[_0x018a('0x35')](_0x48fc9e[_0x018a('0x2d')][_0x018a('0x35')]);_0x5cc216[_0x018a('0x36')]=qs[_0x018a('0x2e')](_[_0x018a('0x37')](_0x48fc9e[_0x018a('0x2d')],_0x4fc8b0[_0x018a('0x2e')]),_0xbac512);if(_0x48fc9e[_0x018a('0x2d')]['filter']){_0x5cc216['where']=_[_0x018a('0x38')](_0x5cc216['where'],{'$or':_[_0x018a('0x27')](_0xbac512,function(_0x1f6b79){if(_0x1f6b79['type']!==_0x018a('0x39')){var _0x356463={};_0x356463[_0x1f6b79[_0x018a('0x25')]]={'$like':'%'+_0x48fc9e[_0x018a('0x2d')][_0x018a('0x3a')]+'%'};return _0x356463;}})});}_0x5cc216=_[_0x018a('0x38')]({},_0x5cc216,_0x48fc9e['options']);var _0x5c3d79={'where':_0x5cc216[_0x018a('0x36')]};return db['Dynamics365Field'][_0x018a('0x1c')](_0x5c3d79)['then'](function(_0x4242d5){_0x631526[_0x018a('0x1c')]=_0x4242d5;if(_0x48fc9e['query'][_0x018a('0x3b')]){_0x5cc216[_0x018a('0x3c')]=[{'all':!![]}];}return db[_0x018a('0x28')][_0x018a('0x3d')](_0x5cc216);})[_0x018a('0x22')](function(_0x541bdb){_0x631526[_0x018a('0x3e')]=_0x541bdb;return _0x631526;})[_0x018a('0x22')](respondWithFilteredResult(_0x5f1062,_0x5cc216))[_0x018a('0x3f')](handleError(_0x5f1062,null));};exports['show']=function(_0x43f581,_0x1c0375){var _0x23f7de={'raw':!![],'where':{'id':_0x43f581[_0x018a('0x40')]['id']}},_0x30198a={};_0x30198a[_0x018a('0x2c')]=_[_0x018a('0x41')](db[_0x018a('0x28')][_0x018a('0x29')]);_0x30198a[_0x018a('0x2d')]=_[_0x018a('0x41')](_0x43f581[_0x018a('0x2d')]);_0x30198a[_0x018a('0x2e')]=_[_0x018a('0x30')](_0x30198a[_0x018a('0x2c')],_0x30198a[_0x018a('0x2d')]);_0x23f7de[_0x018a('0x2f')]=_[_0x018a('0x30')](_0x30198a[_0x018a('0x2c')],qs[_0x018a('0x31')](_0x43f581[_0x018a('0x2d')][_0x018a('0x31')]));_0x23f7de['attributes']=_0x23f7de['attributes']['length']?_0x23f7de[_0x018a('0x2f')]:_0x30198a[_0x018a('0x2c')];if(_0x43f581['query'][_0x018a('0x3b')]){_0x23f7de[_0x018a('0x3c')]=[{'all':!![]}];}_0x23f7de=_[_0x018a('0x38')]({},_0x23f7de,_0x43f581['options']);return db[_0x018a('0x28')][_0x018a('0x42')](_0x23f7de)['then'](handleEntityNotFound(_0x1c0375,null))[_0x018a('0x22')](respondWithResult(_0x1c0375,null))[_0x018a('0x3f')](handleError(_0x1c0375,null));};exports['create']=function(_0x8a5b0f,_0x33786d){return db[_0x018a('0x28')][_0x018a('0x43')](_0x8a5b0f[_0x018a('0x44')],{})[_0x018a('0x22')](respondWithResult(_0x33786d,0xc9))['catch'](handleError(_0x33786d,null));};exports[_0x018a('0x21')]=function(_0x58b9b9,_0x3b1eb7){if(_0x58b9b9[_0x018a('0x44')]['id']){delete _0x58b9b9[_0x018a('0x44')]['id'];}return db[_0x018a('0x28')][_0x018a('0x42')]({'where':{'id':_0x58b9b9['params']['id']}})[_0x018a('0x22')](handleEntityNotFound(_0x3b1eb7,null))[_0x018a('0x22')](saveUpdates(_0x58b9b9['body'],null))[_0x018a('0x22')](respondWithResult(_0x3b1eb7,null))[_0x018a('0x3f')](handleError(_0x3b1eb7,null));};exports[_0x018a('0x23')]=function(_0x29487e,_0x5086c8){return db['Dynamics365Field'][_0x018a('0x42')]({'where':{'id':_0x29487e[_0x018a('0x40')]['id']}})[_0x018a('0x22')](handleEntityNotFound(_0x5086c8,null))[_0x018a('0x22')](removeEntity(_0x5086c8,null))[_0x018a('0x3f')](handleError(_0x5086c8,null));};
\ No newline at end of file
+var _0x2536=['reject','save','then','sendStatus','error','stack','name','send','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','undefined','limit','offset','count','set','apply'];(function(_0x3055f7,_0x38a5a3){var _0x909ca8=function(_0x3128f3){while(--_0x3128f3){_0x3055f7['push'](_0x3055f7['shift']());}};_0x909ca8(++_0x38a5a3);}(_0x2536,0x1d8));var _0x6253=function(_0xa22b06,_0x64e148){_0xa22b06=_0xa22b06-0x0;var _0x3cb855=_0x2536[_0xa22b06];return _0x3cb855;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6253('0x0'));var rp=require(_0x6253('0x1'));var moment=require(_0x6253('0x2'));var BPromise=require(_0x6253('0x3'));var Mustache=require(_0x6253('0x4'));var util=require('util');var path=require(_0x6253('0x5'));var sox=require(_0x6253('0x6'));var csv=require(_0x6253('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6253('0x8'));var _=require(_0x6253('0x9'));var squel=require('squel');var crypto=require(_0x6253('0xa'));var jsforce=require(_0x6253('0xb'));var deskjs=require(_0x6253('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6253('0xd'));var Papa=require(_0x6253('0xe'));var Redis=require(_0x6253('0xf'));var authService=require(_0x6253('0x10'));var qs=require(_0x6253('0x11'));var as=require(_0x6253('0x12'));var hardwareService=require(_0x6253('0x13'));var logger=require(_0x6253('0x14'))(_0x6253('0x15'));var utils=require(_0x6253('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6253('0x17'))['db'];function respondWithStatusCode(_0x19e152,_0xf1e270){_0xf1e270=_0xf1e270||0xcc;return function(_0x1ea671){if(_0x1ea671){return _0x19e152['sendStatus'](_0xf1e270);}return _0x19e152['status'](_0xf1e270)[_0x6253('0x18')]();};}function respondWithResult(_0x4170a9,_0x41fb71){_0x41fb71=_0x41fb71||0xc8;return function(_0x3127b){if(_0x3127b){return _0x4170a9[_0x6253('0x19')](_0x41fb71)['json'](_0x3127b);}};}function respondWithFilteredResult(_0x5f566d,_0xebcc1f){return function(_0x52cf53){if(_0x52cf53){var _0x3814b=typeof _0xebcc1f['offset']===_0x6253('0x1a')&&typeof _0xebcc1f[_0x6253('0x1b')]===_0x6253('0x1a');var _0x48feae=_0x52cf53['count'];var _0x50b32e=_0x3814b?0x0:_0xebcc1f[_0x6253('0x1c')];var _0xd14c7f=_0x3814b?_0x52cf53[_0x6253('0x1d')]:_0xebcc1f['offset']+_0xebcc1f[_0x6253('0x1b')];var _0x62235c;if(_0xd14c7f>=_0x48feae){_0xd14c7f=_0x48feae;_0x62235c=0xc8;}else{_0x62235c=0xce;}_0x5f566d[_0x6253('0x19')](_0x62235c);return _0x5f566d[_0x6253('0x1e')]('Content-Range',_0x50b32e+'-'+_0xd14c7f+'/'+_0x48feae)['json'](_0x52cf53);}return null;};}function patchUpdates(_0x4771e6){return function(_0x57b1d2){try{jsonpatch[_0x6253('0x1f')](_0x57b1d2,_0x4771e6,!![]);}catch(_0x1bc21b){return BPromise[_0x6253('0x20')](_0x1bc21b);}return _0x57b1d2[_0x6253('0x21')]();};}function saveUpdates(_0x10d008,_0x2691c7){return function(_0x2f68ae){if(_0x2f68ae){return _0x2f68ae['update'](_0x10d008)['then'](function(_0x391a1e){return _0x391a1e;});}return null;};}function removeEntity(_0x905f2a,_0x270e51){return function(_0x28fbca){if(_0x28fbca){return _0x28fbca['destroy']()[_0x6253('0x22')](function(){_0x905f2a[_0x6253('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39c05f,_0x49fda8){return function(_0x434388){if(!_0x434388){_0x39c05f[_0x6253('0x23')](0x194);}return _0x434388;};}function handleError(_0x2c4ec2,_0x333878){_0x333878=_0x333878||0x1f4;return function(_0x42c60d){logger[_0x6253('0x24')](_0x42c60d[_0x6253('0x25')]);if(_0x42c60d[_0x6253('0x26')]){delete _0x42c60d[_0x6253('0x26')];}_0x2c4ec2['status'](_0x333878)[_0x6253('0x27')](_0x42c60d);};}exports['index']=function(_0x213ad5,_0x292689){var _0xf3d87={},_0x326419={},_0x30a74e={'count':0x0,'rows':[]};var _0x4d49eb=_['map'](db[_0x6253('0x28')][_0x6253('0x29')],function(_0x6f7ab1){return{'name':_0x6f7ab1[_0x6253('0x2a')],'type':_0x6f7ab1[_0x6253('0x2b')][_0x6253('0x2c')]};});_0x326419[_0x6253('0x2d')]=_[_0x6253('0x2e')](_0x4d49eb,_0x6253('0x26'));_0x326419[_0x6253('0x2f')]=_[_0x6253('0x30')](_0x213ad5[_0x6253('0x2f')]);_0x326419['filters']=_[_0x6253('0x31')](_0x326419[_0x6253('0x2d')],_0x326419[_0x6253('0x2f')]);_0xf3d87[_0x6253('0x32')]=_[_0x6253('0x31')](_0x326419[_0x6253('0x2d')],qs[_0x6253('0x33')](_0x213ad5['query'][_0x6253('0x33')]));_0xf3d87['attributes']=_0xf3d87[_0x6253('0x32')][_0x6253('0x34')]?_0xf3d87[_0x6253('0x32')]:_0x326419['model'];if(!_0x213ad5[_0x6253('0x2f')][_0x6253('0x35')](_0x6253('0x36'))){_0xf3d87[_0x6253('0x1b')]=qs['limit'](_0x213ad5[_0x6253('0x2f')]['limit']);_0xf3d87[_0x6253('0x1c')]=qs[_0x6253('0x1c')](_0x213ad5[_0x6253('0x2f')][_0x6253('0x1c')]);}_0xf3d87[_0x6253('0x37')]=qs[_0x6253('0x38')](_0x213ad5[_0x6253('0x2f')][_0x6253('0x38')]);_0xf3d87['where']=qs[_0x6253('0x39')](_['pick'](_0x213ad5['query'],_0x326419['filters']),_0x4d49eb);if(_0x213ad5[_0x6253('0x2f')][_0x6253('0x3a')]){_0xf3d87[_0x6253('0x3b')]=_[_0x6253('0x3c')](_0xf3d87[_0x6253('0x3b')],{'$or':_[_0x6253('0x2e')](_0x4d49eb,function(_0x2c7507){if(_0x2c7507['type']!=='VIRTUAL'){var _0xcf1148={};_0xcf1148[_0x2c7507[_0x6253('0x26')]]={'$like':'%'+_0x213ad5[_0x6253('0x2f')][_0x6253('0x3a')]+'%'};return _0xcf1148;}})});}_0xf3d87=_['merge']({},_0xf3d87,_0x213ad5['options']);var _0x143a7e={'where':_0xf3d87[_0x6253('0x3b')]};return db[_0x6253('0x28')][_0x6253('0x1d')](_0x143a7e)['then'](function(_0x336b0a){_0x30a74e[_0x6253('0x1d')]=_0x336b0a;if(_0x213ad5[_0x6253('0x2f')][_0x6253('0x3d')]){_0xf3d87[_0x6253('0x3e')]=[{'all':!![]}];}return db[_0x6253('0x28')][_0x6253('0x3f')](_0xf3d87);})[_0x6253('0x22')](function(_0x296d05){_0x30a74e['rows']=_0x296d05;return _0x30a74e;})[_0x6253('0x22')](respondWithFilteredResult(_0x292689,_0xf3d87))[_0x6253('0x40')](handleError(_0x292689,null));};exports[_0x6253('0x41')]=function(_0x3405c8,_0x42cf73){var _0x27911f={'raw':!![],'where':{'id':_0x3405c8[_0x6253('0x42')]['id']}},_0x35282e={};_0x35282e[_0x6253('0x2d')]=_[_0x6253('0x30')](db[_0x6253('0x28')][_0x6253('0x29')]);_0x35282e[_0x6253('0x2f')]=_['keys'](_0x3405c8['query']);_0x35282e[_0x6253('0x39')]=_[_0x6253('0x31')](_0x35282e[_0x6253('0x2d')],_0x35282e[_0x6253('0x2f')]);_0x27911f['attributes']=_[_0x6253('0x31')](_0x35282e[_0x6253('0x2d')],qs['fields'](_0x3405c8[_0x6253('0x2f')][_0x6253('0x33')]));_0x27911f[_0x6253('0x32')]=_0x27911f['attributes'][_0x6253('0x34')]?_0x27911f[_0x6253('0x32')]:_0x35282e[_0x6253('0x2d')];if(_0x3405c8[_0x6253('0x2f')][_0x6253('0x3d')]){_0x27911f['include']=[{'all':!![]}];}_0x27911f=_[_0x6253('0x3c')]({},_0x27911f,_0x3405c8[_0x6253('0x43')]);return db['Dynamics365Field']['find'](_0x27911f)['then'](handleEntityNotFound(_0x42cf73,null))['then'](respondWithResult(_0x42cf73,null))[_0x6253('0x40')](handleError(_0x42cf73,null));};exports[_0x6253('0x44')]=function(_0x1a6ee1,_0x45fd19){return db['Dynamics365Field'][_0x6253('0x44')](_0x1a6ee1[_0x6253('0x45')],{})[_0x6253('0x22')](respondWithResult(_0x45fd19,0xc9))[_0x6253('0x40')](handleError(_0x45fd19,null));};exports['update']=function(_0x1cbf50,_0x821f87){if(_0x1cbf50[_0x6253('0x45')]['id']){delete _0x1cbf50[_0x6253('0x45')]['id'];}return db[_0x6253('0x28')][_0x6253('0x46')]({'where':{'id':_0x1cbf50['params']['id']}})[_0x6253('0x22')](handleEntityNotFound(_0x821f87,null))[_0x6253('0x22')](saveUpdates(_0x1cbf50[_0x6253('0x45')],null))[_0x6253('0x22')](respondWithResult(_0x821f87,null))[_0x6253('0x40')](handleError(_0x821f87,null));};exports[_0x6253('0x47')]=function(_0xb5f17b,_0x1ca0b4){return db[_0x6253('0x28')][_0x6253('0x46')]({'where':{'id':_0xb5f17b[_0x6253('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ca0b4,null))[_0x6253('0x22')](removeEntity(_0x1ca0b4,null))[_0x6253('0x40')](handleError(_0x1ca0b4,null));};
\ No newline at end of file
index f736705..98cb126 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad84=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','FieldId'];(function(_0x1558c8,_0x5064f2){var _0x1e647b=function(_0x16f077){while(--_0x16f077){_0x1558c8['push'](_0x1558c8['shift']());}};_0x1e647b(++_0x5064f2);}(_0xad84,0x188));var _0x4ad8=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xad84[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x4ad8('0x0'));var util=require(_0x4ad8('0x1'));var logger=require('../../config/logger')(_0x4ad8('0x2'));var moment=require(_0x4ad8('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ad8('0x4'));var fs=require('fs');var path=require(_0x4ad8('0x5'));var rimraf=require(_0x4ad8('0x6'));var config=require(_0x4ad8('0x7'));var attributes=require(_0x4ad8('0x8'));module[_0x4ad8('0x9')]=function(_0x3065f8,_0xf23177){return _0x3065f8[_0x4ad8('0xa')](_0x4ad8('0xb'),attributes,{'tableName':_0x4ad8('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x4ad8('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x524b=['util','bluebird','request-promise','../../config/environment','exports','define','Dynamics365Field'];(function(_0x1a17b4,_0x4122f7){var _0x42195e=function(_0x476c9b){while(--_0x476c9b){_0x1a17b4['push'](_0x1a17b4['shift']());}};_0x42195e(++_0x4122f7);}(_0x524b,0x111));var _0xb524=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x524b[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require(_0xb524('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb524('0x1'));var rp=require(_0xb524('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb524('0x3'));var attributes=require('./intDynamics365Field.attributes');module[_0xb524('0x4')]=function(_0x128a57,_0x519821){return _0x128a57[_0xb524('0x5')](_0xb524('0x6'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ddfbb48..1f0284a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83cb=['Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','request','info'];(function(_0x996e48,_0x145c96){var _0x3eced1=function(_0x1b9417){while(--_0x1b9417){_0x996e48['push'](_0x996e48['shift']());}};_0x3eced1(++_0x145c96);}(_0x83cb,0x1ae));var _0xb83c=function(_0x8ce99,_0xe40fa0){_0x8ce99=_0x8ce99-0x0;var _0x186ca7=_0x83cb[_0x8ce99];return _0x186ca7;};'use strict';var _=require(_0xb83c('0x0'));var util=require(_0xb83c('0x1'));var moment=require(_0xb83c('0x2'));var BPromise=require(_0xb83c('0x3'));var rs=require(_0xb83c('0x4'));var fs=require('fs');var Redis=require(_0xb83c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb83c('0x6'))('rpc');var config=require(_0xb83c('0x7'));var jayson=require(_0xb83c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e5ba0,_0x306c3a,_0x5b520e){return new BPromise(function(_0x6c0188,_0x3d5ff7){return client[_0xb83c('0x9')](_0x4e5ba0,_0x5b520e)['then'](function(_0x475ee8){logger[_0xb83c('0xa')](_0xb83c('0xb'),_0x306c3a,_0xb83c('0xc'));logger[_0xb83c('0xd')](_0xb83c('0xe'),_0x306c3a,_0xb83c('0xc'),JSON[_0xb83c('0xf')](_0x475ee8));if(_0x475ee8[_0xb83c('0x10')]){if(_0x475ee8[_0xb83c('0x10')][_0xb83c('0x11')]===0x1f4){logger[_0xb83c('0x10')](_0xb83c('0xb'),_0x306c3a,_0x475ee8[_0xb83c('0x10')]['message']);return _0x3d5ff7(_0x475ee8[_0xb83c('0x10')]['message']);}logger[_0xb83c('0x10')](_0xb83c('0xb'),_0x306c3a,_0x475ee8['error'][_0xb83c('0x12')]);return _0x6c0188(_0x475ee8['error']['message']);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x306c3a,_0xb83c('0xc'));_0x6c0188(_0x475ee8[_0xb83c('0x13')][_0xb83c('0x12')]);}})[_0xb83c('0x14')](function(_0x45e1e2){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x306c3a,_0x45e1e2);_0x3d5ff7(_0x45e1e2);});});}
\ No newline at end of file
+var _0x3ecd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird'];(function(_0x4307e5,_0x2ddfd3){var _0x1de2cb=function(_0x31237c){while(--_0x31237c){_0x4307e5['push'](_0x4307e5['shift']());}};_0x1de2cb(++_0x2ddfd3);}(_0x3ecd,0x1a0));var _0xd3ec=function(_0x35891,_0x13cbe2){_0x35891=_0x35891-0x0;var _0x44c31d=_0x3ecd[_0x35891];return _0x44c31d;};'use strict';var _=require('lodash');var util=require(_0xd3ec('0x0'));var moment=require('moment');var BPromise=require(_0xd3ec('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3ec('0x2'))['db'];var utils=require(_0xd3ec('0x3'));var logger=require(_0xd3ec('0x4'))(_0xd3ec('0x5'));var config=require(_0xd3ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd3ec('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43520b,_0x373fc3,_0x5678c4){return new BPromise(function(_0x412f07,_0x47c57a){return client[_0xd3ec('0x8')](_0x43520b,_0x5678c4)['then'](function(_0x3e2b5d){logger[_0xd3ec('0x9')](_0xd3ec('0xa'),_0x373fc3,_0xd3ec('0xb'));logger[_0xd3ec('0xc')](_0xd3ec('0xd'),_0x373fc3,_0xd3ec('0xb'),JSON[_0xd3ec('0xe')](_0x3e2b5d));if(_0x3e2b5d[_0xd3ec('0xf')]){if(_0x3e2b5d[_0xd3ec('0xf')]['code']===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x373fc3,_0x3e2b5d[_0xd3ec('0xf')][_0xd3ec('0x10')]);return _0x47c57a(_0x3e2b5d[_0xd3ec('0xf')][_0xd3ec('0x10')]);}logger[_0xd3ec('0xf')](_0xd3ec('0xa'),_0x373fc3,_0x3e2b5d[_0xd3ec('0xf')][_0xd3ec('0x10')]);return _0x412f07(_0x3e2b5d[_0xd3ec('0xf')][_0xd3ec('0x10')]);}else{logger[_0xd3ec('0x9')](_0xd3ec('0xa'),_0x373fc3,'request\x20sent');_0x412f07(_0x3e2b5d[_0xd3ec('0x11')][_0xd3ec('0x10')]);}})[_0xd3ec('0x12')](function(_0x3bdf04){logger[_0xd3ec('0xf')](_0xd3ec('0xa'),_0x373fc3,_0x3bdf04);_0x47c57a(_0x3bdf04);});});}
\ No newline at end of file
index 4a86af9..e7ca884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8960=['../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','create','post','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59400c,_0x364897){var _0x51508d=function(_0x1f7682){while(--_0x1f7682){_0x59400c['push'](_0x59400c['shift']());}};_0x51508d(++_0x364897);}(_0x8960,0x1ac));var _0x0896=function(_0x7debd8,_0x2d299c){_0x7debd8=_0x7debd8-0x0;var _0x544d5c=_0x8960[_0x7debd8];return _0x544d5c;};'use strict';var multer=require(_0x0896('0x0'));var util=require(_0x0896('0x1'));var path=require(_0x0896('0x2'));var timeout=require(_0x0896('0x3'));var express=require(_0x0896('0x4'));var router=express[_0x0896('0x5')]();var fs_extra=require(_0x0896('0x6'));var auth=require(_0x0896('0x7'));var interaction=require(_0x0896('0x8'));var config=require(_0x0896('0x9'));var controller=require(_0x0896('0xa'));router[_0x0896('0xb')]('/',auth['isAuthenticated'](),controller[_0x0896('0xc')]);router[_0x0896('0xb')](_0x0896('0xd'),auth[_0x0896('0xe')](),controller[_0x0896('0xf')]);router['get'](_0x0896('0x10'),auth[_0x0896('0xe')](),controller['getConfigurations']);router[_0x0896('0xb')]('/:id/fields',auth[_0x0896('0xe')](),controller['getFields']);router['post']('/',auth[_0x0896('0xe')](),controller[_0x0896('0x11')]);router[_0x0896('0x12')](_0x0896('0x10'),auth[_0x0896('0xe')](),controller[_0x0896('0x13')]);router[_0x0896('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0896('0x15')](_0x0896('0xd'),auth[_0x0896('0xe')](),controller['destroy']);module[_0x0896('0x16')]=router;
\ No newline at end of file
+var _0x4638=['../../components/interaction/service','./intFreshdeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x21d3d5,_0x38163c){var _0xf0057b=function(_0x2d1646){while(--_0x2d1646){_0x21d3d5['push'](_0x21d3d5['shift']());}};_0xf0057b(++_0x38163c);}(_0x4638,0x112));var _0x8463=function(_0x1d3d3a,_0x45f247){_0x1d3d3a=_0x1d3d3a-0x0;var _0x64db5=_0x4638[_0x1d3d3a];return _0x64db5;};'use strict';var multer=require(_0x8463('0x0'));var util=require(_0x8463('0x1'));var path=require(_0x8463('0x2'));var timeout=require(_0x8463('0x3'));var express=require('express');var router=express[_0x8463('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8463('0x5'));var interaction=require(_0x8463('0x6'));var config=require('../../config/environment');var controller=require(_0x8463('0x7'));router['get']('/',auth[_0x8463('0x8')](),controller[_0x8463('0x9')]);router['get'](_0x8463('0xa'),auth[_0x8463('0x8')](),controller[_0x8463('0xb')]);router[_0x8463('0xc')](_0x8463('0xd'),auth[_0x8463('0x8')](),controller[_0x8463('0xe')]);router[_0x8463('0xc')](_0x8463('0xf'),auth[_0x8463('0x8')](),controller[_0x8463('0x10')]);router[_0x8463('0x11')]('/',auth[_0x8463('0x8')](),controller['create']);router[_0x8463('0x11')]('/:id/configurations',auth[_0x8463('0x8')](),controller['addConfiguration']);router['put'](_0x8463('0xa'),auth[_0x8463('0x8')](),controller[_0x8463('0x12')]);router['delete'](_0x8463('0xa'),auth[_0x8463('0x8')](),controller[_0x8463('0x13')]);module['exports']=router;
\ No newline at end of file
index 0c434c8..fb9d470 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7916=['sequelize','STRING','username','remoteUri'];(function(_0x12cba8,_0x4874df){var _0x2d350d=function(_0x188e50){while(--_0x188e50){_0x12cba8['push'](_0x12cba8['shift']());}};_0x2d350d(++_0x4874df);}(_0x7916,0x128));var _0x6791=function(_0xa370e9,_0x373eaf){_0xa370e9=_0xa370e9-0x0;var _0x4bb612=_0x7916[_0xa370e9];return _0x4bb612;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')]},'description':{'type':Sequelize[_0x6791('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6791('0x2')},'apiKey':{'type':Sequelize[_0x6791('0x1')]},'remoteUri':{'type':Sequelize[_0x6791('0x1')],'unique':_0x6791('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x1893=['STRING','username','remoteUri'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1893,0xa2));var _0x3189=function(_0x4a0ae2,_0x4930df){_0x4a0ae2=_0x4a0ae2-0x0;var _0x3986a6=_0x1893[_0x4a0ae2];return _0x3986a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3189('0x0')]},'description':{'type':Sequelize[_0x3189('0x0')]},'username':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x1')},'apiKey':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index da955fc..9ba21d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1707=['priority','group','source','ticket_type','company','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','FreshdeskAccount','rawAttributes','fieldName','key','map','keys','query','filters','model','fields','attributes','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','intersection','length','find','create','body','catch','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','toString','base64','requester','subject','description'];(function(_0x29f767,_0x254453){var _0x2acf5a=function(_0x273886){while(--_0x273886){_0x29f767['push'](_0x29f767['shift']());}};_0x2acf5a(++_0x254453);}(_0x1707,0x1df));var _0x7170=function(_0x59dc5f,_0x3e930b){_0x59dc5f=_0x59dc5f-0x0;var _0x2c40b8=_0x1707[_0x59dc5f];return _0x2c40b8;};'use strict';var emlformat=require(_0x7170('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7170('0x1'));var moment=require(_0x7170('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7170('0x3'));var util=require(_0x7170('0x4'));var path=require(_0x7170('0x5'));var sox=require(_0x7170('0x6'));var csv=require(_0x7170('0x7'));var ejs=require(_0x7170('0x8'));var fs=require('fs');var fs_extra=require(_0x7170('0x9'));var _=require(_0x7170('0xa'));var squel=require(_0x7170('0xb'));var crypto=require(_0x7170('0xc'));var jsforce=require(_0x7170('0xd'));var deskjs=require(_0x7170('0xe'));var toCsv=require(_0x7170('0x7'));var querystring=require(_0x7170('0xf'));var Papa=require(_0x7170('0x10'));var Redis=require(_0x7170('0x11'));var authService=require(_0x7170('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7170('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7170('0x14'))(_0x7170('0x15'));var utils=require(_0x7170('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7170('0x17'));function respondWithStatusCode(_0x3193c7,_0x58c1ec){_0x58c1ec=_0x58c1ec||0xcc;return function(_0x42911e){if(_0x42911e){return _0x3193c7[_0x7170('0x18')](_0x58c1ec);}return _0x3193c7[_0x7170('0x19')](_0x58c1ec)[_0x7170('0x1a')]();};}function respondWithResult(_0x369b9e,_0x418282){_0x418282=_0x418282||0xc8;return function(_0x4f3b70){if(_0x4f3b70){return _0x369b9e['status'](_0x418282)[_0x7170('0x1b')](_0x4f3b70);}};}function respondWithFilteredResult(_0x599aa8,_0x31ffb6){return function(_0xabf79a){if(_0xabf79a){var _0x578f10=typeof _0x31ffb6[_0x7170('0x1c')]==='undefined'&&typeof _0x31ffb6[_0x7170('0x1d')]===_0x7170('0x1e');var _0x4f6ab5=_0xabf79a[_0x7170('0x1f')];var _0x58f2dc=_0x578f10?0x0:_0x31ffb6[_0x7170('0x1c')];var _0x2cf7da=_0x578f10?_0xabf79a['count']:_0x31ffb6[_0x7170('0x1c')]+_0x31ffb6['limit'];var _0x58e2ef;if(_0x2cf7da>=_0x4f6ab5){_0x2cf7da=_0x4f6ab5;_0x58e2ef=0xc8;}else{_0x58e2ef=0xce;}_0x599aa8[_0x7170('0x19')](_0x58e2ef);return _0x599aa8[_0x7170('0x20')](_0x7170('0x21'),_0x58f2dc+'-'+_0x2cf7da+'/'+_0x4f6ab5)[_0x7170('0x1b')](_0xabf79a);}return null;};}function patchUpdates(_0x126d87){return function(_0x32b51a){try{jsonpatch[_0x7170('0x22')](_0x32b51a,_0x126d87,!![]);}catch(_0x57b3ae){return BPromise[_0x7170('0x23')](_0x57b3ae);}return _0x32b51a[_0x7170('0x24')]();};}function saveUpdates(_0x25e86e,_0x1fa020){return function(_0x25b033){if(_0x25b033){return _0x25b033[_0x7170('0x25')](_0x25e86e)[_0x7170('0x26')](function(_0x474d30){return _0x474d30;});}return null;};}function removeEntity(_0x598fe3,_0x1539b4){return function(_0xfa8e3){if(_0xfa8e3){return _0xfa8e3[_0x7170('0x27')]()[_0x7170('0x26')](function(){_0x598fe3[_0x7170('0x19')](0xcc)[_0x7170('0x1a')]();});}};}function handleEntityNotFound(_0x1af07f,_0x31c3cb){return function(_0x256991){if(!_0x256991){_0x1af07f['sendStatus'](0x194);}return _0x256991;};}function handleError(_0x38aadf,_0x57977b){_0x57977b=_0x57977b||0x1f4;return function(_0x2f6c1c){logger[_0x7170('0x28')](_0x2f6c1c['stack']);if(_0x2f6c1c['name']){delete _0x2f6c1c[_0x7170('0x29')];}_0x38aadf[_0x7170('0x19')](_0x57977b)[_0x7170('0x2a')](_0x2f6c1c);};}exports['index']=function(_0x382c9f,_0x2a5c45){var _0x126985={},_0x533f40={},_0xb0d003={'count':0x0,'rows':[]};var _0x515b12=_['map'](db[_0x7170('0x2b')][_0x7170('0x2c')],function(_0x39861a){return{'name':_0x39861a[_0x7170('0x2d')],'type':_0x39861a['type'][_0x7170('0x2e')]};});_0x533f40['model']=_[_0x7170('0x2f')](_0x515b12,_0x7170('0x29'));_0x533f40['query']=_[_0x7170('0x30')](_0x382c9f[_0x7170('0x31')]);_0x533f40[_0x7170('0x32')]=_['intersection'](_0x533f40['model'],_0x533f40[_0x7170('0x31')]);_0x126985['attributes']=_['intersection'](_0x533f40[_0x7170('0x33')],qs[_0x7170('0x34')](_0x382c9f['query'][_0x7170('0x34')]));_0x126985['attributes']=_0x126985[_0x7170('0x35')]['length']?_0x126985[_0x7170('0x35')]:_0x533f40['model'];if(!_0x382c9f[_0x7170('0x31')]['hasOwnProperty'](_0x7170('0x36'))){_0x126985[_0x7170('0x1d')]=qs[_0x7170('0x1d')](_0x382c9f[_0x7170('0x31')][_0x7170('0x1d')]);_0x126985[_0x7170('0x1c')]=qs[_0x7170('0x1c')](_0x382c9f['query'][_0x7170('0x1c')]);}_0x126985[_0x7170('0x37')]=qs['sort'](_0x382c9f[_0x7170('0x31')][_0x7170('0x38')]);_0x126985['where']=qs[_0x7170('0x32')](_[_0x7170('0x39')](_0x382c9f[_0x7170('0x31')],_0x533f40[_0x7170('0x32')]),_0x515b12);if(_0x382c9f[_0x7170('0x31')][_0x7170('0x3a')]){_0x126985[_0x7170('0x3b')]=_['merge'](_0x126985[_0x7170('0x3b')],{'$or':_[_0x7170('0x2f')](_0x515b12,function(_0x4b8a26){if(_0x4b8a26[_0x7170('0x3c')]!==_0x7170('0x3d')){var _0x35ae24={};_0x35ae24[_0x4b8a26[_0x7170('0x29')]]={'$like':'%'+_0x382c9f[_0x7170('0x31')][_0x7170('0x3a')]+'%'};return _0x35ae24;}})});}_0x126985=_[_0x7170('0x3e')]({},_0x126985,_0x382c9f[_0x7170('0x3f')]);var _0x385e2e={'where':_0x126985[_0x7170('0x3b')]};return db[_0x7170('0x2b')][_0x7170('0x1f')](_0x385e2e)[_0x7170('0x26')](function(_0x48c7f3){_0xb0d003[_0x7170('0x1f')]=_0x48c7f3;if(_0x382c9f['query'][_0x7170('0x40')]){_0x126985['include']=[{'all':!![]}];}return db[_0x7170('0x2b')][_0x7170('0x41')](_0x126985);})[_0x7170('0x26')](function(_0x293ba5){_0xb0d003[_0x7170('0x42')]=_0x293ba5;return _0xb0d003;})[_0x7170('0x26')](respondWithFilteredResult(_0x2a5c45,_0x126985))['catch'](handleError(_0x2a5c45,null));};exports[_0x7170('0x43')]=function(_0x2086b1,_0xcaa498){var _0x404bdd={'raw':![],'where':{'id':_0x2086b1[_0x7170('0x44')]['id']}},_0xc16b7={};_0xc16b7['model']=_[_0x7170('0x30')](db[_0x7170('0x2b')][_0x7170('0x2c')]);_0xc16b7[_0x7170('0x31')]=_['keys'](_0x2086b1[_0x7170('0x31')]);_0xc16b7[_0x7170('0x32')]=_[_0x7170('0x45')](_0xc16b7['model'],_0xc16b7[_0x7170('0x31')]);_0x404bdd[_0x7170('0x35')]=_[_0x7170('0x45')](_0xc16b7[_0x7170('0x33')],qs['fields'](_0x2086b1[_0x7170('0x31')]['fields']));_0x404bdd['attributes']=_0x404bdd['attributes'][_0x7170('0x46')]?_0x404bdd['attributes']:_0xc16b7[_0x7170('0x33')];if(_0x2086b1[_0x7170('0x31')][_0x7170('0x40')]){_0x404bdd['include']=[{'all':!![]}];}_0x404bdd=_[_0x7170('0x3e')]({},_0x404bdd,_0x2086b1['options']);return db[_0x7170('0x2b')][_0x7170('0x47')](_0x404bdd)[_0x7170('0x26')](handleEntityNotFound(_0xcaa498,null))[_0x7170('0x26')](respondWithResult(_0xcaa498,null))['catch'](handleError(_0xcaa498,null));};exports[_0x7170('0x48')]=function(_0x27d103,_0x495105){return db[_0x7170('0x2b')][_0x7170('0x48')](_0x27d103[_0x7170('0x49')],{})[_0x7170('0x26')](respondWithResult(_0x495105,0xc9))[_0x7170('0x4a')](handleError(_0x495105,null));};exports[_0x7170('0x25')]=function(_0x33b41f,_0x56674b){if(_0x33b41f[_0x7170('0x49')]['id']){delete _0x33b41f[_0x7170('0x49')]['id'];}return db[_0x7170('0x2b')][_0x7170('0x47')]({'where':{'id':_0x33b41f[_0x7170('0x44')]['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x56674b,null))[_0x7170('0x26')](saveUpdates(_0x33b41f['body'],null))[_0x7170('0x26')](respondWithResult(_0x56674b,null))[_0x7170('0x4a')](handleError(_0x56674b,null));};exports[_0x7170('0x27')]=function(_0x4e84ed,_0x1be3b1){return db[_0x7170('0x2b')][_0x7170('0x47')]({'where':{'id':_0x4e84ed[_0x7170('0x44')]['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x1be3b1,null))[_0x7170('0x26')](removeEntity(_0x1be3b1,null))[_0x7170('0x4a')](handleError(_0x1be3b1,null));};exports[_0x7170('0x4b')]=function(_0x125083,_0x595890,_0x4dec37){var _0x3f5f3b={};var _0x2b5b8b={};var _0x9b4c2;var _0x20acb8;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x125083[_0x7170('0x44')]['id']}})['then'](handleEntityNotFound(_0x595890,null))[_0x7170('0x26')](function(_0x1964d8){if(_0x1964d8){_0x9b4c2=_0x1964d8;_0x2b5b8b['model']=_[_0x7170('0x30')](db[_0x7170('0x4c')][_0x7170('0x2c')]);_0x2b5b8b[_0x7170('0x31')]=_[_0x7170('0x30')](_0x125083[_0x7170('0x31')]);_0x2b5b8b[_0x7170('0x32')]=_[_0x7170('0x45')](_0x2b5b8b[_0x7170('0x33')],_0x2b5b8b[_0x7170('0x31')]);_0x3f5f3b['attributes']=_[_0x7170('0x45')](_0x2b5b8b[_0x7170('0x33')],qs[_0x7170('0x34')](_0x125083[_0x7170('0x31')][_0x7170('0x34')]));_0x3f5f3b[_0x7170('0x35')]=_0x3f5f3b['attributes'][_0x7170('0x46')]?_0x3f5f3b[_0x7170('0x35')]:_0x2b5b8b[_0x7170('0x33')];_0x3f5f3b['order']=qs[_0x7170('0x38')](_0x125083['query']['sort']);_0x3f5f3b[_0x7170('0x3b')]=qs[_0x7170('0x32')](_[_0x7170('0x39')](_0x125083[_0x7170('0x31')],_0x2b5b8b[_0x7170('0x32')]));if(_0x125083[_0x7170('0x31')][_0x7170('0x3a')]){_0x3f5f3b[_0x7170('0x3b')]=_['merge'](_0x3f5f3b[_0x7170('0x3b')],{'$or':_[_0x7170('0x2f')](_0x3f5f3b['attributes'],function(_0x520981){var _0x4f389b={};_0x4f389b[_0x520981]={'$like':'%'+_0x125083[_0x7170('0x31')][_0x7170('0x3a')]+'%'};return _0x4f389b;})});}_0x3f5f3b=_[_0x7170('0x3e')]({},_0x3f5f3b,_0x125083[_0x7170('0x3f')]);return _0x9b4c2[_0x7170('0x4b')](_0x3f5f3b);}})[_0x7170('0x26')](function(_0x12855b){if(_0x12855b){_0x20acb8=_0x12855b['length'];if(!_0x125083[_0x7170('0x31')][_0x7170('0x4d')](_0x7170('0x36'))){_0x3f5f3b[_0x7170('0x1d')]=qs['limit'](_0x125083[_0x7170('0x31')][_0x7170('0x1d')]);_0x3f5f3b['offset']=qs[_0x7170('0x1c')](_0x125083[_0x7170('0x31')][_0x7170('0x1c')]);}return _0x9b4c2[_0x7170('0x4b')](_0x3f5f3b);}})['then'](function(_0x11de38){if(_0x11de38){return _0x11de38?{'count':_0x20acb8,'rows':_0x11de38}:null;}})[_0x7170('0x26')](respondWithResult(_0x595890,null))['catch'](handleError(_0x595890,null));};exports[_0x7170('0x4e')]=function(_0x2162d3,_0x397250,_0x55f5f2){if(_0x2162d3[_0x7170('0x49')]['id']){delete _0x2162d3[_0x7170('0x49')]['id'];}return db[_0x7170('0x2b')][_0x7170('0x4f')]({'where':{'id':_0x2162d3['params']['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x397250,null))[_0x7170('0x26')](function(_0x14a6f0){if(_0x14a6f0){_0x2162d3[_0x7170('0x49')][_0x7170('0x50')]=_0x14a6f0['id'];_0x2162d3[_0x7170('0x49')][_0x7170('0x51')]=integrations[_0x7170('0x52')](_0x2162d3[_0x7170('0x49')][_0x7170('0x53')],_0x2162d3[_0x7170('0x49')][_0x7170('0x3c')]);_0x2162d3[_0x7170('0x49')]['Descriptions']=integrations[_0x7170('0x54')](_0x2162d3[_0x7170('0x49')][_0x7170('0x53')],_0x2162d3[_0x7170('0x49')][_0x7170('0x3c')]);return db[_0x7170('0x4c')]['create'](_0x2162d3[_0x7170('0x49')],{'include':[{'model':db[_0x7170('0x55')],'as':_0x7170('0x51')},{'model':db[_0x7170('0x55')],'as':_0x7170('0x56')}]});}return null;})['then'](respondWithResult(_0x397250,null))[_0x7170('0x4a')](handleError(_0x397250,null));};exports[_0x7170('0x57')]=function(_0xa36419,_0x3f1318,_0x25a7e0){var _0x4aab89='';return db[_0x7170('0x2b')]['findOne']({'where':{'id':_0xa36419['params']['id']},'attributes':['id',_0x7170('0x58'),_0x7170('0x59')]})['then'](handleEntityNotFound(_0x3f1318,null))[_0x7170('0x26')](function(_0x241f8){if(_0x241f8){_0x4aab89=_0x241f8[_0x7170('0x58')];var _0x30413d=_0x4aab89[_0x7170('0x5a')](-0x1);if(_0x30413d==='/'){_0x4aab89=_0x4aab89['substring'](0x0,_0x4aab89[_0x7170('0x5b')](_0x30413d));}return rp({'method':_0x7170('0x5c'),'uri':util[_0x7170('0x5d')](_0x7170('0x5e'),_0x4aab89,_0x7170('0x5f')),'headers':{'Authorization':util[_0x7170('0x5d')]('Basic\x20%s',new Buffer(util[_0x7170('0x5d')]('%s:X',_0x241f8[_0x7170('0x59')]))[_0x7170('0x60')](_0x7170('0x61')))},'json':!![]});}})[_0x7170('0x26')](function(_0x4fd91a){if(_0x4fd91a){var _0x36de8e=[_0x7170('0x62'),_0x7170('0x63'),'agent',_0x7170('0x64'),_0x7170('0x19'),_0x7170('0x65'),_0x7170('0x66'),_0x7170('0x67'),_0x7170('0x68'),'group',_0x7170('0x69')];_['remove'](_0x4fd91a,function(_0x59292c){return _0x36de8e['includes'](_0x59292c[_0x7170('0x29')])||!_0x59292c[_0x7170('0x6a')]&&_0x59292c[_0x7170('0x3c')]!==_0x7170('0x6b')&&_0x59292c['type']!=='custom_dropdown';});return{'count':_0x4fd91a[_0x7170('0x46')],'rows':_[_0x7170('0x2f')](_0x4fd91a,function(_0x1ee17e){return{'id':_0x1ee17e['name'],'name':_0x1ee17e[_0x7170('0x6c')],'custom':!_0x1ee17e[_0x7170('0x6a')],'options':_0x1ee17e['choices']?_['map'](_0x1ee17e[_0x7170('0x6d')],function(_0x2818c2){return{'name':_[_0x7170('0x6e')](_0x2818c2),'value':_0x2818c2};}):[]};})};}})['then'](respondWithResult(_0x3f1318,null))[_0x7170('0x4a')](function(_0x39fd2d){var _0x3660a7=_0xa36419['query']['test']?0x1f4:_0x39fd2d[_0x7170('0x6f')]||0x1f4;logger['error'](_0x7170('0x70'),'getFields',_0x3660a7,JSON[_0x7170('0x71')](_0x39fd2d));delete _0x39fd2d[_0x7170('0x29')];if(_0x3660a7===0x191){_0x3660a7=0x190;}_0x3f1318['status'](_0x3660a7)[_0x7170('0x2a')](_0xa36419[_0x7170('0x31')][_0x7170('0x72')]?{'message':_0x7170('0x73'),'statusCode':_0x39fd2d[_0x7170('0x6f')]}:_0x39fd2d);});};
\ No newline at end of file
+var _0x2e31=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','merge','options','includeAll','include','FreshdeskAccount','findAll','rows','show','params','keys','create','body','catch','find','getConfigurations','findOne','FreshdeskConfiguration','order','pick','filter','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','format','apiKey','toString','base64','requester','subject','agent','description','priority','source','group','remove','includes','custom_text','custom_dropdown','default','choices','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x32eb5b,_0x16bec8){var _0x3e7984=function(_0x4ff130){while(--_0x4ff130){_0x32eb5b['push'](_0x32eb5b['shift']());}};_0x3e7984(++_0x16bec8);}(_0x2e31,0x145));var _0x12e3=function(_0x332fb0,_0x19f033){_0x332fb0=_0x332fb0-0x0;var _0x1f3ea0=_0x2e31[_0x332fb0];return _0x1f3ea0;};'use strict';var emlformat=require(_0x12e3('0x0'));var rimraf=require(_0x12e3('0x1'));var zipdir=require(_0x12e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12e3('0x3'));var moment=require(_0x12e3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12e3('0x5'));var path=require(_0x12e3('0x6'));var sox=require(_0x12e3('0x7'));var csv=require('to-csv');var ejs=require(_0x12e3('0x8'));var fs=require('fs');var fs_extra=require(_0x12e3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12e3('0xa'));var jsforce=require(_0x12e3('0xb'));var deskjs=require(_0x12e3('0xc'));var toCsv=require(_0x12e3('0xd'));var querystring=require('querystring');var Papa=require(_0x12e3('0xe'));var Redis=require(_0x12e3('0xf'));var authService=require(_0x12e3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12e3('0x11'));var logger=require(_0x12e3('0x12'))(_0x12e3('0x13'));var utils=require(_0x12e3('0x14'));var config=require(_0x12e3('0x15'));var licenseUtil=require(_0x12e3('0x16'));var db=require(_0x12e3('0x17'))['db'];var integrations=require(_0x12e3('0x18'));function respondWithStatusCode(_0x2b5dc3,_0x464b63){_0x464b63=_0x464b63||0xcc;return function(_0x247631){if(_0x247631){return _0x2b5dc3[_0x12e3('0x19')](_0x464b63);}return _0x2b5dc3['status'](_0x464b63)[_0x12e3('0x1a')]();};}function respondWithResult(_0x19de67,_0xd9f80f){_0xd9f80f=_0xd9f80f||0xc8;return function(_0x5f315a){if(_0x5f315a){return _0x19de67[_0x12e3('0x1b')](_0xd9f80f)[_0x12e3('0x1c')](_0x5f315a);}};}function respondWithFilteredResult(_0x4a29e8,_0x5434fd){return function(_0x583ca3){if(_0x583ca3){var _0x7e6a5c=typeof _0x5434fd['offset']===_0x12e3('0x1d')&&typeof _0x5434fd[_0x12e3('0x1e')]===_0x12e3('0x1d');var _0x16dab1=_0x583ca3[_0x12e3('0x1f')];var _0x2041e9=_0x7e6a5c?0x0:_0x5434fd['offset'];var _0x77ad03=_0x7e6a5c?_0x583ca3[_0x12e3('0x1f')]:_0x5434fd['offset']+_0x5434fd['limit'];var _0x4a68ec;if(_0x77ad03>=_0x16dab1){_0x77ad03=_0x16dab1;_0x4a68ec=0xc8;}else{_0x4a68ec=0xce;}_0x4a29e8[_0x12e3('0x1b')](_0x4a68ec);return _0x4a29e8['set'](_0x12e3('0x20'),_0x2041e9+'-'+_0x77ad03+'/'+_0x16dab1)[_0x12e3('0x1c')](_0x583ca3);}return null;};}function patchUpdates(_0x5a1990){return function(_0x48f4b6){try{jsonpatch[_0x12e3('0x21')](_0x48f4b6,_0x5a1990,!![]);}catch(_0x7a0793){return BPromise[_0x12e3('0x22')](_0x7a0793);}return _0x48f4b6[_0x12e3('0x23')]();};}function saveUpdates(_0x4b8617,_0x55380a){return function(_0x3e03d8){if(_0x3e03d8){return _0x3e03d8[_0x12e3('0x24')](_0x4b8617)[_0x12e3('0x25')](function(_0x2705e8){return _0x2705e8;});}return null;};}function removeEntity(_0x2cf78a,_0x553982){return function(_0xaaf65f){if(_0xaaf65f){return _0xaaf65f[_0x12e3('0x26')]()[_0x12e3('0x25')](function(){_0x2cf78a[_0x12e3('0x1b')](0xcc)[_0x12e3('0x1a')]();});}};}function handleEntityNotFound(_0x3361d2,_0x578681){return function(_0xaf0b43){if(!_0xaf0b43){_0x3361d2[_0x12e3('0x19')](0x194);}return _0xaf0b43;};}function handleError(_0x4213db,_0x42765f){_0x42765f=_0x42765f||0x1f4;return function(_0x4d1792){logger[_0x12e3('0x27')](_0x4d1792[_0x12e3('0x28')]);if(_0x4d1792[_0x12e3('0x29')]){delete _0x4d1792['name'];}_0x4213db[_0x12e3('0x1b')](_0x42765f)[_0x12e3('0x2a')](_0x4d1792);};}exports[_0x12e3('0x2b')]=function(_0x337790,_0x5a5dd1){var _0x342ad2={},_0x2859d2={},_0x40aefe={'count':0x0,'rows':[]};var _0x546f26=_[_0x12e3('0x2c')](db['FreshdeskAccount'][_0x12e3('0x2d')],function(_0x1a3a4a){return{'name':_0x1a3a4a[_0x12e3('0x2e')],'type':_0x1a3a4a[_0x12e3('0x2f')][_0x12e3('0x30')]};});_0x2859d2[_0x12e3('0x31')]=_['map'](_0x546f26,_0x12e3('0x29'));_0x2859d2[_0x12e3('0x32')]=_['keys'](_0x337790[_0x12e3('0x32')]);_0x2859d2[_0x12e3('0x33')]=_['intersection'](_0x2859d2[_0x12e3('0x31')],_0x2859d2[_0x12e3('0x32')]);_0x342ad2['attributes']=_[_0x12e3('0x34')](_0x2859d2[_0x12e3('0x31')],qs[_0x12e3('0x35')](_0x337790['query'][_0x12e3('0x35')]));_0x342ad2[_0x12e3('0x36')]=_0x342ad2[_0x12e3('0x36')][_0x12e3('0x37')]?_0x342ad2[_0x12e3('0x36')]:_0x2859d2[_0x12e3('0x31')];if(!_0x337790[_0x12e3('0x32')][_0x12e3('0x38')](_0x12e3('0x39'))){_0x342ad2[_0x12e3('0x1e')]=qs[_0x12e3('0x1e')](_0x337790[_0x12e3('0x32')][_0x12e3('0x1e')]);_0x342ad2['offset']=qs[_0x12e3('0x3a')](_0x337790['query'][_0x12e3('0x3a')]);}_0x342ad2['order']=qs[_0x12e3('0x3b')](_0x337790[_0x12e3('0x32')]['sort']);_0x342ad2[_0x12e3('0x3c')]=qs[_0x12e3('0x33')](_['pick'](_0x337790[_0x12e3('0x32')],_0x2859d2[_0x12e3('0x33')]),_0x546f26);if(_0x337790[_0x12e3('0x32')]['filter']){_0x342ad2[_0x12e3('0x3c')]=_[_0x12e3('0x3d')](_0x342ad2[_0x12e3('0x3c')],{'$or':_['map'](_0x546f26,function(_0x42392b){if(_0x42392b['type']!=='VIRTUAL'){var _0x367180={};_0x367180[_0x42392b[_0x12e3('0x29')]]={'$like':'%'+_0x337790[_0x12e3('0x32')]['filter']+'%'};return _0x367180;}})});}_0x342ad2=_['merge']({},_0x342ad2,_0x337790[_0x12e3('0x3e')]);var _0x501e83={'where':_0x342ad2[_0x12e3('0x3c')]};return db['FreshdeskAccount'][_0x12e3('0x1f')](_0x501e83)[_0x12e3('0x25')](function(_0x27546e){_0x40aefe['count']=_0x27546e;if(_0x337790[_0x12e3('0x32')][_0x12e3('0x3f')]){_0x342ad2[_0x12e3('0x40')]=[{'all':!![]}];}return db[_0x12e3('0x41')][_0x12e3('0x42')](_0x342ad2);})[_0x12e3('0x25')](function(_0x4d4844){_0x40aefe[_0x12e3('0x43')]=_0x4d4844;return _0x40aefe;})[_0x12e3('0x25')](respondWithFilteredResult(_0x5a5dd1,_0x342ad2))['catch'](handleError(_0x5a5dd1,null));};exports[_0x12e3('0x44')]=function(_0x448d96,_0x52c1c5){var _0x433ca4={'raw':![],'where':{'id':_0x448d96[_0x12e3('0x45')]['id']}},_0xc03bd0={};_0xc03bd0[_0x12e3('0x31')]=_[_0x12e3('0x46')](db[_0x12e3('0x41')][_0x12e3('0x2d')]);_0xc03bd0['query']=_[_0x12e3('0x46')](_0x448d96[_0x12e3('0x32')]);_0xc03bd0[_0x12e3('0x33')]=_[_0x12e3('0x34')](_0xc03bd0[_0x12e3('0x31')],_0xc03bd0[_0x12e3('0x32')]);_0x433ca4[_0x12e3('0x36')]=_[_0x12e3('0x34')](_0xc03bd0['model'],qs['fields'](_0x448d96[_0x12e3('0x32')][_0x12e3('0x35')]));_0x433ca4['attributes']=_0x433ca4[_0x12e3('0x36')]['length']?_0x433ca4[_0x12e3('0x36')]:_0xc03bd0[_0x12e3('0x31')];if(_0x448d96[_0x12e3('0x32')][_0x12e3('0x3f')]){_0x433ca4[_0x12e3('0x40')]=[{'all':!![]}];}_0x433ca4=_[_0x12e3('0x3d')]({},_0x433ca4,_0x448d96['options']);return db['FreshdeskAccount']['find'](_0x433ca4)[_0x12e3('0x25')](handleEntityNotFound(_0x52c1c5,null))[_0x12e3('0x25')](respondWithResult(_0x52c1c5,null))['catch'](handleError(_0x52c1c5,null));};exports['create']=function(_0x34a629,_0x5ceb50){return db[_0x12e3('0x41')][_0x12e3('0x47')](_0x34a629[_0x12e3('0x48')],{})[_0x12e3('0x25')](respondWithResult(_0x5ceb50,0xc9))[_0x12e3('0x49')](handleError(_0x5ceb50,null));};exports[_0x12e3('0x24')]=function(_0x20fb60,_0x5541db){if(_0x20fb60[_0x12e3('0x48')]['id']){delete _0x20fb60[_0x12e3('0x48')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x20fb60[_0x12e3('0x45')]['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x5541db,null))[_0x12e3('0x25')](saveUpdates(_0x20fb60['body'],null))[_0x12e3('0x25')](respondWithResult(_0x5541db,null))[_0x12e3('0x49')](handleError(_0x5541db,null));};exports[_0x12e3('0x26')]=function(_0x498cdb,_0x327a2b){return db[_0x12e3('0x41')][_0x12e3('0x4a')]({'where':{'id':_0x498cdb['params']['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x327a2b,null))[_0x12e3('0x25')](removeEntity(_0x327a2b,null))[_0x12e3('0x49')](handleError(_0x327a2b,null));};exports[_0x12e3('0x4b')]=function(_0x3e772d,_0x220d97,_0x60e6fc){var _0x2d409f={};var _0x4159ab={};var _0x2d9ed0;var _0x3ea59e;return db[_0x12e3('0x41')][_0x12e3('0x4c')]({'where':{'id':_0x3e772d[_0x12e3('0x45')]['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x220d97,null))['then'](function(_0x5066de){if(_0x5066de){_0x2d9ed0=_0x5066de;_0x4159ab[_0x12e3('0x31')]=_[_0x12e3('0x46')](db[_0x12e3('0x4d')][_0x12e3('0x2d')]);_0x4159ab[_0x12e3('0x32')]=_[_0x12e3('0x46')](_0x3e772d[_0x12e3('0x32')]);_0x4159ab['filters']=_[_0x12e3('0x34')](_0x4159ab[_0x12e3('0x31')],_0x4159ab['query']);_0x2d409f[_0x12e3('0x36')]=_[_0x12e3('0x34')](_0x4159ab['model'],qs['fields'](_0x3e772d[_0x12e3('0x32')][_0x12e3('0x35')]));_0x2d409f[_0x12e3('0x36')]=_0x2d409f[_0x12e3('0x36')][_0x12e3('0x37')]?_0x2d409f[_0x12e3('0x36')]:_0x4159ab[_0x12e3('0x31')];_0x2d409f[_0x12e3('0x4e')]=qs[_0x12e3('0x3b')](_0x3e772d['query'][_0x12e3('0x3b')]);_0x2d409f['where']=qs[_0x12e3('0x33')](_[_0x12e3('0x4f')](_0x3e772d[_0x12e3('0x32')],_0x4159ab[_0x12e3('0x33')]));if(_0x3e772d[_0x12e3('0x32')][_0x12e3('0x50')]){_0x2d409f[_0x12e3('0x3c')]=_[_0x12e3('0x3d')](_0x2d409f[_0x12e3('0x3c')],{'$or':_[_0x12e3('0x2c')](_0x2d409f[_0x12e3('0x36')],function(_0x35cd26){var _0x879064={};_0x879064[_0x35cd26]={'$like':'%'+_0x3e772d[_0x12e3('0x32')][_0x12e3('0x50')]+'%'};return _0x879064;})});}_0x2d409f=_['merge']({},_0x2d409f,_0x3e772d[_0x12e3('0x3e')]);return _0x2d9ed0[_0x12e3('0x4b')](_0x2d409f);}})['then'](function(_0x106e76){if(_0x106e76){_0x3ea59e=_0x106e76[_0x12e3('0x37')];if(!_0x3e772d[_0x12e3('0x32')]['hasOwnProperty'](_0x12e3('0x39'))){_0x2d409f[_0x12e3('0x1e')]=qs[_0x12e3('0x1e')](_0x3e772d[_0x12e3('0x32')]['limit']);_0x2d409f[_0x12e3('0x3a')]=qs[_0x12e3('0x3a')](_0x3e772d[_0x12e3('0x32')][_0x12e3('0x3a')]);}return _0x2d9ed0[_0x12e3('0x4b')](_0x2d409f);}})[_0x12e3('0x25')](function(_0x4ac6a0){if(_0x4ac6a0){return _0x4ac6a0?{'count':_0x3ea59e,'rows':_0x4ac6a0}:null;}})[_0x12e3('0x25')](respondWithResult(_0x220d97,null))[_0x12e3('0x49')](handleError(_0x220d97,null));};exports[_0x12e3('0x51')]=function(_0x4307d7,_0x238aa6,_0x2da056){if(_0x4307d7[_0x12e3('0x48')]['id']){delete _0x4307d7['body']['id'];}return db[_0x12e3('0x41')][_0x12e3('0x4c')]({'where':{'id':_0x4307d7['params']['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x238aa6,null))[_0x12e3('0x25')](function(_0x38020d){if(_0x38020d){_0x4307d7[_0x12e3('0x48')][_0x12e3('0x52')]=_0x38020d['id'];_0x4307d7['body'][_0x12e3('0x53')]=integrations['getSubjects'](_0x4307d7['body'][_0x12e3('0x54')],_0x4307d7[_0x12e3('0x48')][_0x12e3('0x2f')]);_0x4307d7[_0x12e3('0x48')][_0x12e3('0x55')]=integrations['getDescriptions'](_0x4307d7[_0x12e3('0x48')][_0x12e3('0x54')],_0x4307d7['body'][_0x12e3('0x2f')]);return db[_0x12e3('0x4d')][_0x12e3('0x47')](_0x4307d7[_0x12e3('0x48')],{'include':[{'model':db[_0x12e3('0x56')],'as':'Subjects'},{'model':db[_0x12e3('0x56')],'as':_0x12e3('0x55')}]});}return null;})[_0x12e3('0x25')](respondWithResult(_0x238aa6,null))[_0x12e3('0x49')](handleError(_0x238aa6,null));};exports[_0x12e3('0x57')]=function(_0x5078bc,_0x40d32c,_0xe73106){var _0x2d8d37='';return db[_0x12e3('0x41')]['findOne']({'where':{'id':_0x5078bc[_0x12e3('0x45')]['id']},'attributes':['id',_0x12e3('0x58'),'apiKey']})[_0x12e3('0x25')](handleEntityNotFound(_0x40d32c,null))[_0x12e3('0x25')](function(_0x4f0d07){if(_0x4f0d07){_0x2d8d37=_0x4f0d07['remoteUri'];var _0x77aa9a=_0x2d8d37[_0x12e3('0x59')](-0x1);if(_0x77aa9a==='/'){_0x2d8d37=_0x2d8d37[_0x12e3('0x5a')](0x0,_0x2d8d37[_0x12e3('0x5b')](_0x77aa9a));}return rp({'method':_0x12e3('0x5c'),'uri':util['format'](_0x12e3('0x5d'),_0x2d8d37,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x12e3('0x5e')]('Basic\x20%s',new Buffer(util[_0x12e3('0x5e')]('%s:X',_0x4f0d07[_0x12e3('0x5f')]))[_0x12e3('0x60')](_0x12e3('0x61')))},'json':!![]});}})[_0x12e3('0x25')](function(_0x355301){if(_0x355301){var _0x497d54=[_0x12e3('0x62'),_0x12e3('0x63'),_0x12e3('0x64'),_0x12e3('0x65'),_0x12e3('0x1b'),_0x12e3('0x66'),'group',_0x12e3('0x67'),'ticket_type',_0x12e3('0x68'),'company'];_[_0x12e3('0x69')](_0x355301,function(_0x2ab227){return _0x497d54[_0x12e3('0x6a')](_0x2ab227[_0x12e3('0x29')])||!_0x2ab227['default']&&_0x2ab227['type']!==_0x12e3('0x6b')&&_0x2ab227[_0x12e3('0x2f')]!==_0x12e3('0x6c');});return{'count':_0x355301[_0x12e3('0x37')],'rows':_[_0x12e3('0x2c')](_0x355301,function(_0x2474bf){return{'id':_0x2474bf[_0x12e3('0x29')],'name':_0x2474bf['label'],'custom':!_0x2474bf[_0x12e3('0x6d')],'options':_0x2474bf[_0x12e3('0x6e')]?_[_0x12e3('0x2c')](_0x2474bf[_0x12e3('0x6e')],function(_0x5328c8){return{'name':_['capitalize'](_0x5328c8),'value':_0x5328c8};}):[]};})};}})[_0x12e3('0x25')](respondWithResult(_0x40d32c,null))[_0x12e3('0x49')](function(_0x2cf2b0){var _0x198c11=_0x5078bc[_0x12e3('0x32')]['test']?0x1f4:_0x2cf2b0['statusCode']||0x1f4;logger[_0x12e3('0x27')](_0x12e3('0x6f'),_0x12e3('0x57'),_0x198c11,JSON['stringify'](_0x2cf2b0));delete _0x2cf2b0[_0x12e3('0x29')];if(_0x198c11===0x191){_0x198c11=0x190;}_0x40d32c[_0x12e3('0x1b')](_0x198c11)[_0x12e3('0x2a')](_0x5078bc[_0x12e3('0x32')][_0x12e3('0x70')]?{'message':_0x12e3('0x71'),'statusCode':_0x2cf2b0[_0x12e3('0x72')]}:_0x2cf2b0);});};
\ No newline at end of file
index 0b06791..6acf38b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04ac=['FreshdeskAccount','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x04ac,0x90));var _0xc04a=function(_0x5d1bc5,_0x2a5ea3){_0x5d1bc5=_0x5d1bc5-0x0;var _0x22cad5=_0x04ac[_0x5d1bc5];return _0x22cad5;};'use strict';var _=require(_0xc04a('0x0'));var util=require(_0xc04a('0x1'));var logger=require(_0xc04a('0x2'))(_0xc04a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc04a('0x4'));var rimraf=require(_0xc04a('0x5'));var config=require(_0xc04a('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xc04a('0x7'));module[_0xc04a('0x8')]=function(_0x363b8a,_0x4d8e9e){return _0x363b8a[_0xc04a('0x9')](_0xc04a('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b2c=['rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3e27a8,_0x5f267a){var _0x2578f6=function(_0x147307){while(--_0x147307){_0x3e27a8['push'](_0x3e27a8['shift']());}};_0x2578f6(++_0x5f267a);}(_0x2b2c,0x149));var _0xc2b2=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x2b2c[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0xc2b2('0x0'));var util=require(_0xc2b2('0x1'));var logger=require(_0xc2b2('0x2'))('api');var moment=require(_0xc2b2('0x3'));var BPromise=require(_0xc2b2('0x4'));var rp=require(_0xc2b2('0x5'));var fs=require('fs');var path=require(_0xc2b2('0x6'));var rimraf=require(_0xc2b2('0x7'));var config=require('../../config/environment');var attributes=require(_0xc2b2('0x8'));var integrations=require(_0xc2b2('0x9'));module[_0xc2b2('0xa')]=function(_0x597999,_0x1740c2){return _0x597999[_0xc2b2('0xb')](_0xc2b2('0xc'),attributes,{'tableName':_0xc2b2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 808b70c..849933a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9d1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowFreshdeskAccount','lodash','util','moment','bluebird'];(function(_0x3bcd96,_0x226d9e){var _0xd2b7f0=function(_0x1aa60d){while(--_0x1aa60d){_0x3bcd96['push'](_0x3bcd96['shift']());}};_0xd2b7f0(++_0x226d9e);}(_0xe9d1,0x1ea));var _0x1e9d=function(_0x436854,_0x4e191d){_0x436854=_0x436854-0x0;var _0xccb95d=_0xe9d1[_0x436854];return _0xccb95d;};'use strict';var _=require(_0x1e9d('0x0'));var util=require(_0x1e9d('0x1'));var moment=require(_0x1e9d('0x2'));var BPromise=require(_0x1e9d('0x3'));var rs=require(_0x1e9d('0x4'));var fs=require('fs');var Redis=require(_0x1e9d('0x5'));var db=require(_0x1e9d('0x6'))['db'];var utils=require(_0x1e9d('0x7'));var logger=require(_0x1e9d('0x8'))('rpc');var config=require(_0x1e9d('0x9'));var jayson=require(_0x1e9d('0xa'));var client=jayson['client'][_0x1e9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x186485,_0x4e8fef,_0x10bcfb){return new BPromise(function(_0x176747,_0x22085e){return client[_0x1e9d('0xc')](_0x186485,_0x10bcfb)[_0x1e9d('0xd')](function(_0x299f0c){logger[_0x1e9d('0xe')](_0x1e9d('0xf'),_0x4e8fef,_0x1e9d('0x10'));logger[_0x1e9d('0x11')](_0x1e9d('0x12'),_0x4e8fef,_0x1e9d('0x10'),JSON[_0x1e9d('0x13')](_0x299f0c));if(_0x299f0c[_0x1e9d('0x14')]){if(_0x299f0c[_0x1e9d('0x14')][_0x1e9d('0x15')]===0x1f4){logger[_0x1e9d('0x14')](_0x1e9d('0xf'),_0x4e8fef,_0x299f0c[_0x1e9d('0x14')][_0x1e9d('0x16')]);return _0x22085e(_0x299f0c[_0x1e9d('0x14')][_0x1e9d('0x16')]);}logger[_0x1e9d('0x14')](_0x1e9d('0xf'),_0x4e8fef,_0x299f0c[_0x1e9d('0x14')][_0x1e9d('0x16')]);return _0x176747(_0x299f0c[_0x1e9d('0x14')]['message']);}else{logger[_0x1e9d('0xe')](_0x1e9d('0xf'),_0x4e8fef,_0x1e9d('0x10'));_0x176747(_0x299f0c[_0x1e9d('0x17')][_0x1e9d('0x16')]);}})[_0x1e9d('0x18')](function(_0x50b568){logger[_0x1e9d('0x14')](_0x1e9d('0xf'),_0x4e8fef,_0x50b568);_0x22085e(_0x50b568);});});}exports[_0x1e9d('0x19')]=function(_0x194601){var _0x19a8d1=this;return new Promise(function(_0x43e92c,_0x5e00c5){return db[_0x1e9d('0x1a')][_0x1e9d('0x1b')]({'raw':_0x194601[_0x1e9d('0x1c')]?_0x194601['options']['raw']===undefined?!![]:![]:!![],'where':_0x194601[_0x1e9d('0x1c')]?_0x194601[_0x1e9d('0x1c')][_0x1e9d('0x1d')]||null:null,'attributes':_0x194601[_0x1e9d('0x1c')]?_0x194601[_0x1e9d('0x1c')][_0x1e9d('0x1e')]||null:null,'limit':_0x194601[_0x1e9d('0x1c')]?_0x194601[_0x1e9d('0x1c')][_0x1e9d('0x1f')]||null:null,'include':_0x194601[_0x1e9d('0x1c')]?_0x194601[_0x1e9d('0x1c')][_0x1e9d('0x20')]?_[_0x1e9d('0x21')](_0x194601[_0x1e9d('0x1c')][_0x1e9d('0x20')],function(_0x5e3f6c){return{'model':db[_0x5e3f6c[_0x1e9d('0x22')]],'as':_0x5e3f6c['as'],'attributes':_0x5e3f6c[_0x1e9d('0x1e')],'include':_0x5e3f6c[_0x1e9d('0x20')]?_[_0x1e9d('0x21')](_0x5e3f6c['include'],function(_0x383c0f){return{'model':db[_0x383c0f[_0x1e9d('0x22')]],'as':_0x383c0f['as'],'attributes':_0x383c0f[_0x1e9d('0x1e')],'include':_0x383c0f[_0x1e9d('0x20')]?_[_0x1e9d('0x21')](_0x383c0f[_0x1e9d('0x20')],function(_0xa0e7d5){return{'model':db[_0xa0e7d5[_0x1e9d('0x22')]],'as':_0xa0e7d5['as'],'attributes':_0xa0e7d5[_0x1e9d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1e9d('0xd')](function(_0x1bf700){logger['info']('GetFreshdeskAccount',_0x194601);logger[_0x1e9d('0x11')](_0x1e9d('0x19'),_0x194601,JSON[_0x1e9d('0x13')](_0x1bf700));_0x43e92c(_0x1bf700);})[_0x1e9d('0x18')](function(_0x1098ca){logger['error'](_0x1e9d('0x19'),_0x1098ca['message'],_0x194601);_0x5e00c5(_0x19a8d1['error'](0x1f4,_0x1098ca[_0x1e9d('0x16')]));});});};exports['ShowFreshdeskAccount']=function(_0x10eb4b){var _0x4f6272=this;return new Promise(function(_0x68a5f2,_0x1c4294){return db[_0x1e9d('0x1a')][_0x1e9d('0x23')]({'raw':_0x10eb4b[_0x1e9d('0x1c')]?_0x10eb4b[_0x1e9d('0x1c')][_0x1e9d('0x24')]===undefined?!![]:![]:!![],'where':_0x10eb4b[_0x1e9d('0x1c')]?_0x10eb4b[_0x1e9d('0x1c')][_0x1e9d('0x1d')]||null:null,'attributes':_0x10eb4b[_0x1e9d('0x1c')]?_0x10eb4b[_0x1e9d('0x1c')]['attributes']||null:null,'include':_0x10eb4b['options']?_0x10eb4b['options'][_0x1e9d('0x20')]?_['map'](_0x10eb4b[_0x1e9d('0x1c')][_0x1e9d('0x20')],function(_0x1b9266){return{'model':db[_0x1b9266[_0x1e9d('0x22')]],'as':_0x1b9266['as'],'attributes':_0x1b9266['attributes'],'include':_0x1b9266['include']?_[_0x1e9d('0x21')](_0x1b9266[_0x1e9d('0x20')],function(_0x22c5ea){return{'model':db[_0x22c5ea[_0x1e9d('0x22')]],'as':_0x22c5ea['as'],'attributes':_0x22c5ea['attributes'],'include':_0x22c5ea[_0x1e9d('0x20')]?_[_0x1e9d('0x21')](_0x22c5ea[_0x1e9d('0x20')],function(_0x534d9b){return{'model':db[_0x534d9b[_0x1e9d('0x22')]],'as':_0x534d9b['as'],'attributes':_0x534d9b[_0x1e9d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1e9d('0xd')](function(_0x1da44b){logger[_0x1e9d('0xe')]('ShowFreshdeskAccount',_0x10eb4b);logger[_0x1e9d('0x11')](_0x1e9d('0x25'),_0x10eb4b,JSON[_0x1e9d('0x13')](_0x1da44b));_0x68a5f2(_0x1da44b);})[_0x1e9d('0x18')](function(_0x5dcf9a){logger[_0x1e9d('0x14')](_0x1e9d('0x25'),_0x5dcf9a['message'],_0x10eb4b);_0x1c4294(_0x4f6272['error'](0x1f4,_0x5dcf9a[_0x1e9d('0x16')]));});});};
\ No newline at end of file
+var _0xe5e5=['where','limit','include','map','model','attributes','catch','ShowFreshdeskAccount','find','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options'];(function(_0xf1658d,_0x528504){var _0xaa9236=function(_0x389d94){while(--_0x389d94){_0xf1658d['push'](_0xf1658d['shift']());}};_0xaa9236(++_0x528504);}(_0xe5e5,0x7c));var _0x5e5e=function(_0x184b7a,_0x1b1c30){_0x184b7a=_0x184b7a-0x0;var _0x1190ff=_0xe5e5[_0x184b7a];return _0x1190ff;};'use strict';var _=require(_0x5e5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e5e('0x1'));var rs=require(_0x5e5e('0x2'));var fs=require('fs');var Redis=require(_0x5e5e('0x3'));var db=require(_0x5e5e('0x4'))['db'];var utils=require(_0x5e5e('0x5'));var logger=require(_0x5e5e('0x6'))(_0x5e5e('0x7'));var config=require(_0x5e5e('0x8'));var jayson=require(_0x5e5e('0x9'));var client=jayson[_0x5e5e('0xa')][_0x5e5e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2336ec,_0x179979,_0x5e9ed7){return new BPromise(function(_0x6b4779,_0x44be9d){return client[_0x5e5e('0xc')](_0x2336ec,_0x5e9ed7)[_0x5e5e('0xd')](function(_0x59e38b){logger[_0x5e5e('0xe')](_0x5e5e('0xf'),_0x179979,_0x5e5e('0x10'));logger[_0x5e5e('0x11')](_0x5e5e('0x12'),_0x179979,'request\x20sent',JSON[_0x5e5e('0x13')](_0x59e38b));if(_0x59e38b[_0x5e5e('0x14')]){if(_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x15')]===0x1f4){logger[_0x5e5e('0x14')]('FreshdeskAccount,\x20%s,\x20%s',_0x179979,_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);return _0x44be9d(_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);}logger[_0x5e5e('0x14')](_0x5e5e('0xf'),_0x179979,_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);return _0x6b4779(_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);}else{logger[_0x5e5e('0xe')](_0x5e5e('0xf'),_0x179979,_0x5e5e('0x10'));_0x6b4779(_0x59e38b[_0x5e5e('0x17')]['message']);}})['catch'](function(_0xfcd63b){logger[_0x5e5e('0x14')](_0x5e5e('0xf'),_0x179979,_0xfcd63b);_0x44be9d(_0xfcd63b);});});}exports[_0x5e5e('0x18')]=function(_0x1b87d2){var _0x21aec1=this;return new Promise(function(_0x5f4a3f,_0x3d9f62){return db[_0x5e5e('0x19')][_0x5e5e('0x1a')]({'raw':_0x1b87d2[_0x5e5e('0x1b')]?_0x1b87d2[_0x5e5e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b87d2[_0x5e5e('0x1b')]?_0x1b87d2['options'][_0x5e5e('0x1c')]||null:null,'attributes':_0x1b87d2[_0x5e5e('0x1b')]?_0x1b87d2[_0x5e5e('0x1b')]['attributes']||null:null,'limit':_0x1b87d2['options']?_0x1b87d2['options'][_0x5e5e('0x1d')]||null:null,'include':_0x1b87d2[_0x5e5e('0x1b')]?_0x1b87d2[_0x5e5e('0x1b')][_0x5e5e('0x1e')]?_[_0x5e5e('0x1f')](_0x1b87d2[_0x5e5e('0x1b')][_0x5e5e('0x1e')],function(_0x302c9f){return{'model':db[_0x302c9f[_0x5e5e('0x20')]],'as':_0x302c9f['as'],'attributes':_0x302c9f['attributes'],'include':_0x302c9f[_0x5e5e('0x1e')]?_['map'](_0x302c9f['include'],function(_0x2e5dfe){return{'model':db[_0x2e5dfe[_0x5e5e('0x20')]],'as':_0x2e5dfe['as'],'attributes':_0x2e5dfe[_0x5e5e('0x21')],'include':_0x2e5dfe[_0x5e5e('0x1e')]?_['map'](_0x2e5dfe[_0x5e5e('0x1e')],function(_0x48e6d9){return{'model':db[_0x48e6d9['model']],'as':_0x48e6d9['as'],'attributes':_0x48e6d9[_0x5e5e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5e5e('0xd')](function(_0x2b8b49){logger[_0x5e5e('0xe')](_0x5e5e('0x18'),_0x1b87d2);logger[_0x5e5e('0x11')](_0x5e5e('0x18'),_0x1b87d2,JSON['stringify'](_0x2b8b49));_0x5f4a3f(_0x2b8b49);})[_0x5e5e('0x22')](function(_0x17f1bd){logger[_0x5e5e('0x14')](_0x5e5e('0x18'),_0x17f1bd[_0x5e5e('0x16')],_0x1b87d2);_0x3d9f62(_0x21aec1[_0x5e5e('0x14')](0x1f4,_0x17f1bd[_0x5e5e('0x16')]));});});};exports[_0x5e5e('0x23')]=function(_0xdc525e){var _0x4c0de0=this;return new Promise(function(_0x2d3b4c,_0x1c0311){return db[_0x5e5e('0x19')][_0x5e5e('0x24')]({'raw':_0xdc525e[_0x5e5e('0x1b')]?_0xdc525e[_0x5e5e('0x1b')][_0x5e5e('0x25')]===undefined?!![]:![]:!![],'where':_0xdc525e[_0x5e5e('0x1b')]?_0xdc525e[_0x5e5e('0x1b')][_0x5e5e('0x1c')]||null:null,'attributes':_0xdc525e[_0x5e5e('0x1b')]?_0xdc525e[_0x5e5e('0x1b')][_0x5e5e('0x21')]||null:null,'include':_0xdc525e[_0x5e5e('0x1b')]?_0xdc525e[_0x5e5e('0x1b')][_0x5e5e('0x1e')]?_[_0x5e5e('0x1f')](_0xdc525e['options'][_0x5e5e('0x1e')],function(_0x54ed32){return{'model':db[_0x54ed32[_0x5e5e('0x20')]],'as':_0x54ed32['as'],'attributes':_0x54ed32[_0x5e5e('0x21')],'include':_0x54ed32[_0x5e5e('0x1e')]?_['map'](_0x54ed32[_0x5e5e('0x1e')],function(_0x12d9a2){return{'model':db[_0x12d9a2[_0x5e5e('0x20')]],'as':_0x12d9a2['as'],'attributes':_0x12d9a2[_0x5e5e('0x21')],'include':_0x12d9a2[_0x5e5e('0x1e')]?_[_0x5e5e('0x1f')](_0x12d9a2[_0x5e5e('0x1e')],function(_0x578cc6){return{'model':db[_0x578cc6[_0x5e5e('0x20')]],'as':_0x578cc6['as'],'attributes':_0x578cc6['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e5e('0xd')](function(_0x1252e4){logger[_0x5e5e('0xe')](_0x5e5e('0x23'),_0xdc525e);logger[_0x5e5e('0x11')](_0x5e5e('0x23'),_0xdc525e,JSON[_0x5e5e('0x13')](_0x1252e4));_0x2d3b4c(_0x1252e4);})[_0x5e5e('0x22')](function(_0x4f2439){logger[_0x5e5e('0x14')](_0x5e5e('0x23'),_0x4f2439[_0x5e5e('0x16')],_0xdc525e);_0x1c0311(_0x4c0de0[_0x5e5e('0x14')](0x1f4,_0x4f2439[_0x5e5e('0x16')]));});});};
\ No newline at end of file
index a69308a..dbe0b35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf247=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','post','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x21b8b6,_0x5e68f4){var _0x1ac143=function(_0xb7587f){while(--_0xb7587f){_0x21b8b6['push'](_0x21b8b6['shift']());}};_0x1ac143(++_0x5e68f4);}(_0xf247,0xf7));var _0x7f24=function(_0x257896,_0x8de612){_0x257896=_0x257896-0x0;var _0x1ff242=_0xf247[_0x257896];return _0x1ff242;};'use strict';var multer=require(_0x7f24('0x0'));var util=require(_0x7f24('0x1'));var path=require(_0x7f24('0x2'));var timeout=require(_0x7f24('0x3'));var express=require(_0x7f24('0x4'));var router=express[_0x7f24('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7f24('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x7f24('0x7')]('/',auth[_0x7f24('0x8')](),controller[_0x7f24('0x9')]);router[_0x7f24('0x7')](_0x7f24('0xa'),auth[_0x7f24('0x8')](),controller[_0x7f24('0xb')]);router[_0x7f24('0x7')](_0x7f24('0xc'),auth[_0x7f24('0x8')](),controller[_0x7f24('0xd')]);router[_0x7f24('0x7')](_0x7f24('0xe'),auth[_0x7f24('0x8')](),controller['getSubjects']);router[_0x7f24('0x7')](_0x7f24('0xf'),auth[_0x7f24('0x8')](),controller[_0x7f24('0x10')]);router[_0x7f24('0x7')]('/:id/tags',auth[_0x7f24('0x8')](),controller['getTags']);router['post']('/',auth[_0x7f24('0x8')](),controller[_0x7f24('0x11')]);router[_0x7f24('0x12')](_0x7f24('0x13'),auth[_0x7f24('0x8')](),controller[_0x7f24('0x14')]);router[_0x7f24('0x15')]('/:id',auth[_0x7f24('0x8')](),controller[_0x7f24('0x16')]);router[_0x7f24('0x17')](_0x7f24('0xa'),auth[_0x7f24('0x8')](),controller[_0x7f24('0x18')]);module[_0x7f24('0x19')]=router;
\ No newline at end of file
+var _0xd0a6=['./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4aee45,_0x3a28fe){var _0x427cef=function(_0x4aa871){while(--_0x4aa871){_0x4aee45['push'](_0x4aee45['shift']());}};_0x427cef(++_0x3a28fe);}(_0xd0a6,0xc2));var _0x6d0a=function(_0x381831,_0x59e68d){_0x381831=_0x381831-0x0;var _0x418df6=_0xd0a6[_0x381831];return _0x418df6;};'use strict';var multer=require(_0x6d0a('0x0'));var util=require(_0x6d0a('0x1'));var path=require(_0x6d0a('0x2'));var timeout=require(_0x6d0a('0x3'));var express=require(_0x6d0a('0x4'));var router=express[_0x6d0a('0x5')]();var fs_extra=require(_0x6d0a('0x6'));var auth=require(_0x6d0a('0x7'));var interaction=require(_0x6d0a('0x8'));var config=require('../../config/environment');var controller=require(_0x6d0a('0x9'));router[_0x6d0a('0xa')]('/',auth[_0x6d0a('0xb')](),controller[_0x6d0a('0xc')]);router[_0x6d0a('0xa')](_0x6d0a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x6d0a('0xa')](_0x6d0a('0xe'),auth['isAuthenticated'](),controller[_0x6d0a('0xf')]);router[_0x6d0a('0xa')](_0x6d0a('0x10'),auth['isAuthenticated'](),controller[_0x6d0a('0x11')]);router[_0x6d0a('0xa')](_0x6d0a('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0x6d0a('0x13'),auth[_0x6d0a('0xb')](),controller[_0x6d0a('0x14')]);router[_0x6d0a('0x15')]('/',auth['isAuthenticated'](),controller[_0x6d0a('0x16')]);router[_0x6d0a('0x15')](_0x6d0a('0x13'),auth[_0x6d0a('0xb')](),controller[_0x6d0a('0x17')]);router[_0x6d0a('0x18')](_0x6d0a('0xd'),auth[_0x6d0a('0xb')](),controller[_0x6d0a('0x19')]);router[_0x6d0a('0x1a')](_0x6d0a('0xd'),auth[_0x6d0a('0xb')](),controller[_0x6d0a('0x1b')]);module[_0x6d0a('0x1c')]=router;
\ No newline at end of file
index dbc6255..f145bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc756=['sequelize','STRING'];(function(_0x102e8c,_0x414f0f){var _0x2ec248=function(_0x59e9bd){while(--_0x59e9bd){_0x102e8c['push'](_0x102e8c['shift']());}};_0x2ec248(++_0x414f0f);}(_0xc756,0x198));var _0x6c75=function(_0x382be4,_0x5edf3a){_0x382be4=_0x382be4-0x0;var _0x4da6bc=_0xc756[_0x382be4];return _0x4da6bc;};'use strict';var Sequelize=require(_0x6c75('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c75('0x1')]},'description':{'type':Sequelize[_0x6c75('0x1')]}};
\ No newline at end of file
+var _0xe552=['sequelize','exports','STRING'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0xe552,0x9c));var _0x2e55=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0xe552[_0x4521e3];return _0x46a272;};'use strict';var Sequelize=require(_0x2e55('0x0'));module[_0x2e55('0x1')]={'name':{'type':Sequelize[_0x2e55('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cd61513..384bada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xded9=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','intersection','create','body','find','params','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xded9,0x14a));var _0x9ded=function(_0x481242,_0x3860e0){_0x481242=_0x481242-0x0;var _0x57e325=_0xded9[_0x481242];return _0x57e325;};'use strict';var emlformat=require(_0x9ded('0x0'));var rimraf=require(_0x9ded('0x1'));var zipdir=require(_0x9ded('0x2'));var jsonpatch=require(_0x9ded('0x3'));var rp=require('request-promise');var moment=require(_0x9ded('0x4'));var BPromise=require(_0x9ded('0x5'));var Mustache=require(_0x9ded('0x6'));var util=require(_0x9ded('0x7'));var path=require(_0x9ded('0x8'));var sox=require('sox');var csv=require(_0x9ded('0x9'));var ejs=require(_0x9ded('0xa'));var fs=require('fs');var fs_extra=require(_0x9ded('0xb'));var _=require(_0x9ded('0xc'));var squel=require('squel');var crypto=require(_0x9ded('0xd'));var jsforce=require(_0x9ded('0xe'));var deskjs=require(_0x9ded('0xf'));var toCsv=require(_0x9ded('0x9'));var querystring=require(_0x9ded('0x10'));var Papa=require(_0x9ded('0x11'));var Redis=require(_0x9ded('0x12'));var authService=require(_0x9ded('0x13'));var qs=require(_0x9ded('0x14'));var as=require(_0x9ded('0x15'));var hardwareService=require(_0x9ded('0x16'));var logger=require(_0x9ded('0x17'))(_0x9ded('0x18'));var utils=require(_0x9ded('0x19'));var config=require(_0x9ded('0x1a'));var licenseUtil=require(_0x9ded('0x1b'));var db=require(_0x9ded('0x1c'))['db'];function respondWithStatusCode(_0x5bed8d,_0x5c8630){_0x5c8630=_0x5c8630||0xcc;return function(_0x54ecac){if(_0x54ecac){return _0x5bed8d[_0x9ded('0x1d')](_0x5c8630);}return _0x5bed8d[_0x9ded('0x1e')](_0x5c8630)[_0x9ded('0x1f')]();};}function respondWithResult(_0x349552,_0x2dbfed){_0x2dbfed=_0x2dbfed||0xc8;return function(_0x335166){if(_0x335166){return _0x349552[_0x9ded('0x1e')](_0x2dbfed)[_0x9ded('0x20')](_0x335166);}};}function respondWithFilteredResult(_0x3163c3,_0x2db869){return function(_0x453e8a){if(_0x453e8a){var _0x2df42e=typeof _0x2db869[_0x9ded('0x21')]===_0x9ded('0x22')&&typeof _0x2db869['limit']===_0x9ded('0x22');var _0x338c1c=_0x453e8a[_0x9ded('0x23')];var _0x3614f0=_0x2df42e?0x0:_0x2db869[_0x9ded('0x21')];var _0x138dc9=_0x2df42e?_0x453e8a[_0x9ded('0x23')]:_0x2db869[_0x9ded('0x21')]+_0x2db869[_0x9ded('0x24')];var _0x526c26;if(_0x138dc9>=_0x338c1c){_0x138dc9=_0x338c1c;_0x526c26=0xc8;}else{_0x526c26=0xce;}_0x3163c3[_0x9ded('0x1e')](_0x526c26);return _0x3163c3['set'](_0x9ded('0x25'),_0x3614f0+'-'+_0x138dc9+'/'+_0x338c1c)[_0x9ded('0x20')](_0x453e8a);}return null;};}function patchUpdates(_0x110946){return function(_0x17646a){try{jsonpatch[_0x9ded('0x26')](_0x17646a,_0x110946,!![]);}catch(_0x172a7e){return BPromise['reject'](_0x172a7e);}return _0x17646a['save']();};}function saveUpdates(_0x2fe90a,_0x4a50c6){return function(_0x87b22){if(_0x87b22){return _0x87b22[_0x9ded('0x27')](_0x2fe90a)[_0x9ded('0x28')](function(_0xd8cfea){return _0xd8cfea;});}return null;};}function removeEntity(_0x4d287c,_0x25e596){return function(_0x193fa2){if(_0x193fa2){return _0x193fa2['destroy']()[_0x9ded('0x28')](function(){_0x4d287c[_0x9ded('0x1e')](0xcc)[_0x9ded('0x1f')]();});}};}function handleEntityNotFound(_0x5976f0,_0x343c6d){return function(_0x3cfa24){if(!_0x3cfa24){_0x5976f0['sendStatus'](0x194);}return _0x3cfa24;};}function handleError(_0x5c7d79,_0x3aff5a){_0x3aff5a=_0x3aff5a||0x1f4;return function(_0x17b0a6){logger[_0x9ded('0x29')](_0x17b0a6[_0x9ded('0x2a')]);if(_0x17b0a6[_0x9ded('0x2b')]){delete _0x17b0a6[_0x9ded('0x2b')];}_0x5c7d79[_0x9ded('0x1e')](_0x3aff5a)[_0x9ded('0x2c')](_0x17b0a6);};}exports[_0x9ded('0x2d')]=function(_0xaf331f,_0x4ad199){var _0x4899f3={},_0x1e11bc={},_0x428910={'count':0x0,'rows':[]};var _0x2d2e54=_[_0x9ded('0x2e')](db[_0x9ded('0x2f')][_0x9ded('0x30')],function(_0x28b3e5){return{'name':_0x28b3e5[_0x9ded('0x31')],'type':_0x28b3e5[_0x9ded('0x32')][_0x9ded('0x33')]};});_0x1e11bc[_0x9ded('0x34')]=_['map'](_0x2d2e54,'name');_0x1e11bc[_0x9ded('0x35')]=_['keys'](_0xaf331f[_0x9ded('0x35')]);_0x1e11bc[_0x9ded('0x36')]=_['intersection'](_0x1e11bc[_0x9ded('0x34')],_0x1e11bc[_0x9ded('0x35')]);_0x4899f3['attributes']=_['intersection'](_0x1e11bc[_0x9ded('0x34')],qs[_0x9ded('0x37')](_0xaf331f[_0x9ded('0x35')][_0x9ded('0x37')]));_0x4899f3[_0x9ded('0x38')]=_0x4899f3[_0x9ded('0x38')][_0x9ded('0x39')]?_0x4899f3[_0x9ded('0x38')]:_0x1e11bc['model'];if(!_0xaf331f[_0x9ded('0x35')]['hasOwnProperty']('nolimit')){_0x4899f3[_0x9ded('0x24')]=qs[_0x9ded('0x24')](_0xaf331f[_0x9ded('0x35')][_0x9ded('0x24')]);_0x4899f3[_0x9ded('0x21')]=qs[_0x9ded('0x21')](_0xaf331f[_0x9ded('0x35')][_0x9ded('0x21')]);}_0x4899f3[_0x9ded('0x3a')]=qs[_0x9ded('0x3b')](_0xaf331f[_0x9ded('0x35')][_0x9ded('0x3b')]);_0x4899f3[_0x9ded('0x3c')]=qs[_0x9ded('0x36')](_[_0x9ded('0x3d')](_0xaf331f['query'],_0x1e11bc[_0x9ded('0x36')]),_0x2d2e54);if(_0xaf331f[_0x9ded('0x35')][_0x9ded('0x3e')]){_0x4899f3[_0x9ded('0x3c')]=_['merge'](_0x4899f3['where'],{'$or':_[_0x9ded('0x2e')](_0x2d2e54,function(_0x2e9ed7){if(_0x2e9ed7['type']!==_0x9ded('0x3f')){var _0x54ccbe={};_0x54ccbe[_0x2e9ed7['name']]={'$like':'%'+_0xaf331f['query']['filter']+'%'};return _0x54ccbe;}})});}_0x4899f3=_[_0x9ded('0x40')]({},_0x4899f3,_0xaf331f[_0x9ded('0x41')]);var _0x5b3f0b={'where':_0x4899f3[_0x9ded('0x3c')]};return db['FreshdeskConfiguration']['count'](_0x5b3f0b)['then'](function(_0xd5eff){_0x428910[_0x9ded('0x23')]=_0xd5eff;if(_0xaf331f[_0x9ded('0x35')]['includeAll']){_0x4899f3[_0x9ded('0x42')]=[{'all':!![]}];}return db[_0x9ded('0x2f')][_0x9ded('0x43')](_0x4899f3);})[_0x9ded('0x28')](function(_0x4d86a9){_0x428910[_0x9ded('0x44')]=_0x4d86a9;return _0x428910;})[_0x9ded('0x28')](respondWithFilteredResult(_0x4ad199,_0x4899f3))[_0x9ded('0x45')](handleError(_0x4ad199,null));};exports[_0x9ded('0x46')]=function(_0x286da5,_0xc2efaa){var _0x55dbcb={'raw':![],'where':{'id':_0x286da5['params']['id']}},_0x7fa7c0={};_0x7fa7c0['model']=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x7fa7c0[_0x9ded('0x35')]=_[_0x9ded('0x47')](_0x286da5[_0x9ded('0x35')]);_0x7fa7c0['filters']=_['intersection'](_0x7fa7c0[_0x9ded('0x34')],_0x7fa7c0[_0x9ded('0x35')]);_0x55dbcb['attributes']=_[_0x9ded('0x48')](_0x7fa7c0[_0x9ded('0x34')],qs['fields'](_0x286da5[_0x9ded('0x35')][_0x9ded('0x37')]));_0x55dbcb['attributes']=_0x55dbcb[_0x9ded('0x38')][_0x9ded('0x39')]?_0x55dbcb['attributes']:_0x7fa7c0[_0x9ded('0x34')];if(_0x286da5[_0x9ded('0x35')]['includeAll']){_0x55dbcb[_0x9ded('0x42')]=[{'all':!![]}];}_0x55dbcb=_[_0x9ded('0x40')]({},_0x55dbcb,_0x286da5[_0x9ded('0x41')]);return db[_0x9ded('0x2f')]['find'](_0x55dbcb)[_0x9ded('0x28')](handleEntityNotFound(_0xc2efaa,null))[_0x9ded('0x28')](respondWithResult(_0xc2efaa,null))[_0x9ded('0x45')](handleError(_0xc2efaa,null));};exports['create']=function(_0x54def6,_0x271f74){return db[_0x9ded('0x2f')][_0x9ded('0x49')](_0x54def6[_0x9ded('0x4a')],{})[_0x9ded('0x28')](respondWithResult(_0x271f74,0xc9))['catch'](handleError(_0x271f74,null));};exports[_0x9ded('0x27')]=function(_0x564e5f,_0x5483b3){if(_0x564e5f[_0x9ded('0x4a')]['id']){delete _0x564e5f['body']['id'];}return db[_0x9ded('0x2f')][_0x9ded('0x4b')]({'where':{'id':_0x564e5f[_0x9ded('0x4c')]['id']}})[_0x9ded('0x28')](handleEntityNotFound(_0x5483b3,null))[_0x9ded('0x28')](saveUpdates(_0x564e5f['body'],null))[_0x9ded('0x28')](respondWithResult(_0x5483b3,null))[_0x9ded('0x45')](handleError(_0x5483b3,null));};exports[_0x9ded('0x4d')]=function(_0x34e0e5,_0x292beb){return db[_0x9ded('0x2f')][_0x9ded('0x4b')]({'where':{'id':_0x34e0e5[_0x9ded('0x4c')]['id']}})[_0x9ded('0x28')](handleEntityNotFound(_0x292beb,null))[_0x9ded('0x28')](removeEntity(_0x292beb,null))['catch'](handleError(_0x292beb,null));};exports[_0x9ded('0x4e')]=function(_0x9c1e1e,_0x5bdf8d,_0x54d6ca){var _0x1e50c6={};var _0x430651={};var _0x131b99;var _0x1f86a8;return db['FreshdeskConfiguration'][_0x9ded('0x4f')]({'where':{'id':_0x9c1e1e[_0x9ded('0x4c')]['id']}})[_0x9ded('0x28')](handleEntityNotFound(_0x5bdf8d,null))[_0x9ded('0x28')](function(_0x3afbb2){if(_0x3afbb2){_0x131b99=_0x3afbb2;_0x430651['model']=_[_0x9ded('0x47')](db[_0x9ded('0x50')]['rawAttributes']);_0x430651[_0x9ded('0x35')]=_[_0x9ded('0x47')](_0x9c1e1e[_0x9ded('0x35')]);_0x430651['filters']=_[_0x9ded('0x48')](_0x430651[_0x9ded('0x34')],_0x430651[_0x9ded('0x35')]);_0x1e50c6[_0x9ded('0x38')]=_[_0x9ded('0x48')](_0x430651['model'],qs[_0x9ded('0x37')](_0x9c1e1e[_0x9ded('0x35')][_0x9ded('0x37')]));_0x1e50c6[_0x9ded('0x38')]=_0x1e50c6[_0x9ded('0x38')][_0x9ded('0x39')]?_0x1e50c6[_0x9ded('0x38')]:_0x430651[_0x9ded('0x34')];_0x1e50c6[_0x9ded('0x3a')]=qs['sort'](_0x9c1e1e[_0x9ded('0x35')][_0x9ded('0x3b')]);_0x1e50c6[_0x9ded('0x3c')]=qs[_0x9ded('0x36')](_[_0x9ded('0x3d')](_0x9c1e1e[_0x9ded('0x35')],_0x430651[_0x9ded('0x36')]));if(_0x9c1e1e['query'][_0x9ded('0x3e')]){_0x1e50c6[_0x9ded('0x3c')]=_['merge'](_0x1e50c6[_0x9ded('0x3c')],{'$or':_[_0x9ded('0x2e')](_0x1e50c6[_0x9ded('0x38')],function(_0x294271){var _0x14292a={};_0x14292a[_0x294271]={'$like':'%'+_0x9c1e1e[_0x9ded('0x35')][_0x9ded('0x3e')]+'%'};return _0x14292a;})});}_0x1e50c6=_['merge']({},_0x1e50c6,_0x9c1e1e[_0x9ded('0x41')]);return _0x131b99[_0x9ded('0x4e')](_0x1e50c6);}})['then'](function(_0x250d3e){if(_0x250d3e){_0x1f86a8=_0x250d3e[_0x9ded('0x39')];if(!_0x9c1e1e[_0x9ded('0x35')][_0x9ded('0x51')](_0x9ded('0x52'))){_0x1e50c6[_0x9ded('0x24')]=qs['limit'](_0x9c1e1e[_0x9ded('0x35')][_0x9ded('0x24')]);_0x1e50c6['offset']=qs['offset'](_0x9c1e1e[_0x9ded('0x35')][_0x9ded('0x21')]);}return _0x131b99[_0x9ded('0x4e')](_0x1e50c6);}})['then'](function(_0x27ecd2){if(_0x27ecd2){return _0x27ecd2?{'count':_0x1f86a8,'rows':_0x27ecd2}:null;}})[_0x9ded('0x28')](respondWithResult(_0x5bdf8d,null))['catch'](handleError(_0x5bdf8d,null));};exports['getSubjects']=function(_0xeb67d9,_0x1812f8,_0xfcd581){var _0x11b1c8={};var _0x90c97a={};var _0x2c5e18;var _0x155818;return db['FreshdeskConfiguration'][_0x9ded('0x4f')]({'where':{'id':_0xeb67d9['params']['id']}})[_0x9ded('0x28')](handleEntityNotFound(_0x1812f8,null))['then'](function(_0x3309eb){if(_0x3309eb){_0x2c5e18=_0x3309eb;_0x90c97a[_0x9ded('0x34')]=_['keys'](db[_0x9ded('0x50')][_0x9ded('0x30')]);_0x90c97a[_0x9ded('0x35')]=_[_0x9ded('0x47')](_0xeb67d9[_0x9ded('0x35')]);_0x90c97a[_0x9ded('0x36')]=_[_0x9ded('0x48')](_0x90c97a['model'],_0x90c97a[_0x9ded('0x35')]);_0x11b1c8[_0x9ded('0x38')]=_[_0x9ded('0x48')](_0x90c97a[_0x9ded('0x34')],qs[_0x9ded('0x37')](_0xeb67d9[_0x9ded('0x35')][_0x9ded('0x37')]));_0x11b1c8[_0x9ded('0x38')]=_0x11b1c8[_0x9ded('0x38')][_0x9ded('0x39')]?_0x11b1c8['attributes']:_0x90c97a[_0x9ded('0x34')];_0x11b1c8[_0x9ded('0x3a')]=qs[_0x9ded('0x3b')](_0xeb67d9['query'][_0x9ded('0x3b')]);_0x11b1c8['where']=qs['filters'](_[_0x9ded('0x3d')](_0xeb67d9[_0x9ded('0x35')],_0x90c97a[_0x9ded('0x36')]));if(_0xeb67d9['query'][_0x9ded('0x3e')]){_0x11b1c8[_0x9ded('0x3c')]=_[_0x9ded('0x40')](_0x11b1c8[_0x9ded('0x3c')],{'$or':_[_0x9ded('0x2e')](_0x11b1c8['attributes'],function(_0x958152){var _0x5a1cc4={};_0x5a1cc4[_0x958152]={'$like':'%'+_0xeb67d9[_0x9ded('0x35')][_0x9ded('0x3e')]+'%'};return _0x5a1cc4;})});}_0x11b1c8=_[_0x9ded('0x40')]({},_0x11b1c8,_0xeb67d9[_0x9ded('0x41')]);return _0x2c5e18['getSubjects'](_0x11b1c8);}})[_0x9ded('0x28')](function(_0x401193){if(_0x401193){_0x155818=_0x401193[_0x9ded('0x39')];if(!_0xeb67d9[_0x9ded('0x35')][_0x9ded('0x51')](_0x9ded('0x52'))){_0x11b1c8['limit']=qs[_0x9ded('0x24')](_0xeb67d9[_0x9ded('0x35')][_0x9ded('0x24')]);_0x11b1c8[_0x9ded('0x21')]=qs[_0x9ded('0x21')](_0xeb67d9[_0x9ded('0x35')]['offset']);}return _0x2c5e18[_0x9ded('0x53')](_0x11b1c8);}})[_0x9ded('0x28')](function(_0x38b918){if(_0x38b918){return _0x38b918?{'count':_0x155818,'rows':_0x38b918}:null;}})['then'](respondWithResult(_0x1812f8,null))[_0x9ded('0x45')](handleError(_0x1812f8,null));};exports[_0x9ded('0x54')]=function(_0x4a50f6,_0x3d39c9,_0x3762fe){var _0x5e9d5f={};var _0x359b97={};var _0x656fb2;var _0x154b61;return db[_0x9ded('0x2f')][_0x9ded('0x4f')]({'where':{'id':_0x4a50f6[_0x9ded('0x4c')]['id']}})[_0x9ded('0x28')](handleEntityNotFound(_0x3d39c9,null))['then'](function(_0x3523a0){if(_0x3523a0){_0x656fb2=_0x3523a0;_0x359b97['model']=_[_0x9ded('0x47')](db['FreshdeskField'][_0x9ded('0x30')]);_0x359b97[_0x9ded('0x35')]=_[_0x9ded('0x47')](_0x4a50f6[_0x9ded('0x35')]);_0x359b97[_0x9ded('0x36')]=_['intersection'](_0x359b97[_0x9ded('0x34')],_0x359b97['query']);_0x5e9d5f[_0x9ded('0x38')]=_[_0x9ded('0x48')](_0x359b97[_0x9ded('0x34')],qs[_0x9ded('0x37')](_0x4a50f6[_0x9ded('0x35')][_0x9ded('0x37')]));_0x5e9d5f[_0x9ded('0x38')]=_0x5e9d5f[_0x9ded('0x38')]['length']?_0x5e9d5f[_0x9ded('0x38')]:_0x359b97[_0x9ded('0x34')];_0x5e9d5f['order']=qs[_0x9ded('0x3b')](_0x4a50f6[_0x9ded('0x35')]['sort']);_0x5e9d5f[_0x9ded('0x3c')]=qs[_0x9ded('0x36')](_[_0x9ded('0x3d')](_0x4a50f6[_0x9ded('0x35')],_0x359b97[_0x9ded('0x36')]));if(_0x4a50f6['query'][_0x9ded('0x3e')]){_0x5e9d5f[_0x9ded('0x3c')]=_['merge'](_0x5e9d5f['where'],{'$or':_[_0x9ded('0x2e')](_0x5e9d5f[_0x9ded('0x38')],function(_0x2e53ae){var _0x57b37a={};_0x57b37a[_0x2e53ae]={'$like':'%'+_0x4a50f6[_0x9ded('0x35')][_0x9ded('0x3e')]+'%'};return _0x57b37a;})});}_0x5e9d5f=_[_0x9ded('0x40')]({},_0x5e9d5f,_0x4a50f6[_0x9ded('0x41')]);return _0x656fb2[_0x9ded('0x54')](_0x5e9d5f);}})[_0x9ded('0x28')](function(_0x5ddf2f){if(_0x5ddf2f){_0x154b61=_0x5ddf2f[_0x9ded('0x39')];if(!_0x4a50f6[_0x9ded('0x35')][_0x9ded('0x51')](_0x9ded('0x52'))){_0x5e9d5f[_0x9ded('0x24')]=qs['limit'](_0x4a50f6['query']['limit']);_0x5e9d5f[_0x9ded('0x21')]=qs[_0x9ded('0x21')](_0x4a50f6[_0x9ded('0x35')][_0x9ded('0x21')]);}return _0x656fb2[_0x9ded('0x54')](_0x5e9d5f);}})[_0x9ded('0x28')](function(_0x49ce07){if(_0x49ce07){return _0x49ce07?{'count':_0x154b61,'rows':_0x49ce07}:null;}})[_0x9ded('0x28')](respondWithResult(_0x3d39c9,null))[_0x9ded('0x45')](handleError(_0x3d39c9,null));};exports[_0x9ded('0x55')]=function(_0x550daf,_0x4251b2,_0x241a2d){var _0x42ca52={};var _0x5df743={};var _0x197449;var _0x757ab4;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x550daf[_0x9ded('0x4c')]['id']}})[_0x9ded('0x28')](handleEntityNotFound(_0x4251b2,null))[_0x9ded('0x28')](function(_0xc0e46f){if(_0xc0e46f){_0x197449=_0xc0e46f;_0x5df743[_0x9ded('0x34')]=_[_0x9ded('0x47')](db[_0x9ded('0x56')][_0x9ded('0x30')]);_0x5df743['query']=_[_0x9ded('0x47')](_0x550daf[_0x9ded('0x35')]);_0x5df743[_0x9ded('0x36')]=_['intersection'](_0x5df743[_0x9ded('0x34')],_0x5df743[_0x9ded('0x35')]);_0x42ca52[_0x9ded('0x38')]=_[_0x9ded('0x48')](_0x5df743[_0x9ded('0x34')],qs['fields'](_0x550daf[_0x9ded('0x35')][_0x9ded('0x37')]));_0x42ca52[_0x9ded('0x38')]=_0x42ca52[_0x9ded('0x38')][_0x9ded('0x39')]?_0x42ca52[_0x9ded('0x38')]:_0x5df743[_0x9ded('0x34')];_0x42ca52[_0x9ded('0x3a')]=qs[_0x9ded('0x3b')](_0x550daf[_0x9ded('0x35')][_0x9ded('0x3b')]);_0x42ca52[_0x9ded('0x3c')]=qs[_0x9ded('0x36')](_[_0x9ded('0x3d')](_0x550daf['query'],_0x5df743['filters']));if(_0x550daf[_0x9ded('0x35')]['filter']){_0x42ca52[_0x9ded('0x3c')]=_[_0x9ded('0x40')](_0x42ca52[_0x9ded('0x3c')],{'$or':_[_0x9ded('0x2e')](_0x42ca52[_0x9ded('0x38')],function(_0x436959){var _0x21d6dc={};_0x21d6dc[_0x436959]={'$like':'%'+_0x550daf[_0x9ded('0x35')][_0x9ded('0x3e')]+'%'};return _0x21d6dc;})});}_0x42ca52=_['merge']({},_0x42ca52,_0x550daf[_0x9ded('0x41')]);return _0x197449[_0x9ded('0x55')](_0x42ca52);}})[_0x9ded('0x28')](function(_0x3395cd){if(_0x3395cd){_0x757ab4=_0x3395cd[_0x9ded('0x39')];if(!_0x550daf[_0x9ded('0x35')][_0x9ded('0x51')]('nolimit')){_0x42ca52[_0x9ded('0x24')]=qs[_0x9ded('0x24')](_0x550daf[_0x9ded('0x35')][_0x9ded('0x24')]);_0x42ca52[_0x9ded('0x21')]=qs['offset'](_0x550daf[_0x9ded('0x35')][_0x9ded('0x21')]);}return _0x197449[_0x9ded('0x55')](_0x42ca52);}})[_0x9ded('0x28')](function(_0x84c585){if(_0x84c585){return _0x84c585?{'count':_0x757ab4,'rows':_0x84c585}:null;}})['then'](respondWithResult(_0x4251b2,null))['catch'](handleError(_0x4251b2,null));};exports[_0x9ded('0x57')]=function(_0x4d7f5f,_0x42edd3,_0x237829){if(_0x4d7f5f[_0x9ded('0x4a')]['id']){delete _0x4d7f5f[_0x9ded('0x4a')]['id'];}return db[_0x9ded('0x2f')][_0x9ded('0x4f')]({'where':{'id':_0x4d7f5f[_0x9ded('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42edd3,null))['then'](function(_0xa0e195){if(_0xa0e195){return _0xa0e195[_0x9ded('0x57')](_0x4d7f5f[_0x9ded('0x4a')][_0x9ded('0x58')]||[]);}return null;})[_0x9ded('0x28')](respondWithResult(_0x42edd3,null))[_0x9ded('0x45')](handleError(_0x42edd3,null));};
\ No newline at end of file
+var _0x40bd=['pick','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','FreshdeskConfiguration','includeAll','include','findAll','catch','params','intersection','options','find','create','body','destroy','getFields','findOne','order','sort'];(function(_0x417f0c,_0xcd2149){var _0x1db3bd=function(_0x3dd634){while(--_0x3dd634){_0x417f0c['push'](_0x417f0c['shift']());}};_0x1db3bd(++_0xcd2149);}(_0x40bd,0x1e1));var _0xd40b=function(_0x2687b2,_0x2efdb0){_0x2687b2=_0x2687b2-0x0;var _0x503865=_0x40bd[_0x2687b2];return _0x503865;};'use strict';var emlformat=require(_0xd40b('0x0'));var rimraf=require(_0xd40b('0x1'));var zipdir=require(_0xd40b('0x2'));var jsonpatch=require(_0xd40b('0x3'));var rp=require('request-promise');var moment=require(_0xd40b('0x4'));var BPromise=require(_0xd40b('0x5'));var Mustache=require(_0xd40b('0x6'));var util=require(_0xd40b('0x7'));var path=require('path');var sox=require(_0xd40b('0x8'));var csv=require(_0xd40b('0x9'));var ejs=require(_0xd40b('0xa'));var fs=require('fs');var fs_extra=require(_0xd40b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd40b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd40b('0x9'));var querystring=require(_0xd40b('0xd'));var Papa=require(_0xd40b('0xe'));var Redis=require(_0xd40b('0xf'));var authService=require(_0xd40b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd40b('0x11'))(_0xd40b('0x12'));var utils=require(_0xd40b('0x13'));var config=require(_0xd40b('0x14'));var licenseUtil=require(_0xd40b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cb3e6,_0x182c0f){_0x182c0f=_0x182c0f||0xcc;return function(_0x57fd98){if(_0x57fd98){return _0x2cb3e6['sendStatus'](_0x182c0f);}return _0x2cb3e6['status'](_0x182c0f)[_0xd40b('0x16')]();};}function respondWithResult(_0x13cc5f,_0x1c86dd){_0x1c86dd=_0x1c86dd||0xc8;return function(_0x166a6f){if(_0x166a6f){return _0x13cc5f[_0xd40b('0x17')](_0x1c86dd)[_0xd40b('0x18')](_0x166a6f);}};}function respondWithFilteredResult(_0x326ebf,_0x34c299){return function(_0x41e45d){if(_0x41e45d){var _0x3b1505=typeof _0x34c299[_0xd40b('0x19')]===_0xd40b('0x1a')&&typeof _0x34c299['limit']===_0xd40b('0x1a');var _0x29e268=_0x41e45d[_0xd40b('0x1b')];var _0x2d374=_0x3b1505?0x0:_0x34c299[_0xd40b('0x19')];var _0x53d253=_0x3b1505?_0x41e45d[_0xd40b('0x1b')]:_0x34c299[_0xd40b('0x19')]+_0x34c299[_0xd40b('0x1c')];var _0x53e519;if(_0x53d253>=_0x29e268){_0x53d253=_0x29e268;_0x53e519=0xc8;}else{_0x53e519=0xce;}_0x326ebf[_0xd40b('0x17')](_0x53e519);return _0x326ebf[_0xd40b('0x1d')](_0xd40b('0x1e'),_0x2d374+'-'+_0x53d253+'/'+_0x29e268)['json'](_0x41e45d);}return null;};}function patchUpdates(_0x2379e3){return function(_0x676c84){try{jsonpatch[_0xd40b('0x1f')](_0x676c84,_0x2379e3,!![]);}catch(_0x15d023){return BPromise[_0xd40b('0x20')](_0x15d023);}return _0x676c84[_0xd40b('0x21')]();};}function saveUpdates(_0x91b20d,_0x5d5efd){return function(_0x1f2d5d){if(_0x1f2d5d){return _0x1f2d5d[_0xd40b('0x22')](_0x91b20d)[_0xd40b('0x23')](function(_0x20ab39){return _0x20ab39;});}return null;};}function removeEntity(_0x4b6e68,_0x517c5c){return function(_0x105c3c){if(_0x105c3c){return _0x105c3c['destroy']()[_0xd40b('0x23')](function(){_0x4b6e68[_0xd40b('0x17')](0xcc)[_0xd40b('0x16')]();});}};}function handleEntityNotFound(_0x152af5,_0x175045){return function(_0x520f87){if(!_0x520f87){_0x152af5['sendStatus'](0x194);}return _0x520f87;};}function handleError(_0x218e4c,_0x201f40){_0x201f40=_0x201f40||0x1f4;return function(_0x44f707){logger[_0xd40b('0x24')](_0x44f707[_0xd40b('0x25')]);if(_0x44f707[_0xd40b('0x26')]){delete _0x44f707[_0xd40b('0x26')];}_0x218e4c[_0xd40b('0x17')](_0x201f40)[_0xd40b('0x27')](_0x44f707);};}exports['index']=function(_0x29356a,_0x33b736){var _0x38f45d={},_0x41448b={},_0xbb4318={'count':0x0,'rows':[]};var _0x3572e7=_[_0xd40b('0x28')](db['FreshdeskConfiguration'][_0xd40b('0x29')],function(_0x8d4335){return{'name':_0x8d4335[_0xd40b('0x2a')],'type':_0x8d4335[_0xd40b('0x2b')]['key']};});_0x41448b['model']=_[_0xd40b('0x28')](_0x3572e7,'name');_0x41448b[_0xd40b('0x2c')]=_[_0xd40b('0x2d')](_0x29356a['query']);_0x41448b[_0xd40b('0x2e')]=_['intersection'](_0x41448b[_0xd40b('0x2f')],_0x41448b[_0xd40b('0x2c')]);_0x38f45d[_0xd40b('0x30')]=_['intersection'](_0x41448b['model'],qs[_0xd40b('0x31')](_0x29356a[_0xd40b('0x2c')]['fields']));_0x38f45d[_0xd40b('0x30')]=_0x38f45d['attributes'][_0xd40b('0x32')]?_0x38f45d[_0xd40b('0x30')]:_0x41448b[_0xd40b('0x2f')];if(!_0x29356a[_0xd40b('0x2c')][_0xd40b('0x33')](_0xd40b('0x34'))){_0x38f45d[_0xd40b('0x1c')]=qs[_0xd40b('0x1c')](_0x29356a['query']['limit']);_0x38f45d['offset']=qs['offset'](_0x29356a[_0xd40b('0x2c')][_0xd40b('0x19')]);}_0x38f45d['order']=qs['sort'](_0x29356a[_0xd40b('0x2c')]['sort']);_0x38f45d[_0xd40b('0x35')]=qs['filters'](_['pick'](_0x29356a[_0xd40b('0x2c')],_0x41448b[_0xd40b('0x2e')]),_0x3572e7);if(_0x29356a[_0xd40b('0x2c')][_0xd40b('0x36')]){_0x38f45d[_0xd40b('0x35')]=_[_0xd40b('0x37')](_0x38f45d['where'],{'$or':_[_0xd40b('0x28')](_0x3572e7,function(_0x427c4a){if(_0x427c4a['type']!=='VIRTUAL'){var _0xf95a12={};_0xf95a12[_0x427c4a[_0xd40b('0x26')]]={'$like':'%'+_0x29356a[_0xd40b('0x2c')][_0xd40b('0x36')]+'%'};return _0xf95a12;}})});}_0x38f45d=_[_0xd40b('0x37')]({},_0x38f45d,_0x29356a['options']);var _0x24548f={'where':_0x38f45d[_0xd40b('0x35')]};return db[_0xd40b('0x38')]['count'](_0x24548f)[_0xd40b('0x23')](function(_0x20f0e7){_0xbb4318[_0xd40b('0x1b')]=_0x20f0e7;if(_0x29356a[_0xd40b('0x2c')][_0xd40b('0x39')]){_0x38f45d[_0xd40b('0x3a')]=[{'all':!![]}];}return db[_0xd40b('0x38')][_0xd40b('0x3b')](_0x38f45d);})['then'](function(_0x3c5d0e){_0xbb4318['rows']=_0x3c5d0e;return _0xbb4318;})['then'](respondWithFilteredResult(_0x33b736,_0x38f45d))[_0xd40b('0x3c')](handleError(_0x33b736,null));};exports['show']=function(_0x51e71e,_0x44334b){var _0x443f46={'raw':![],'where':{'id':_0x51e71e[_0xd40b('0x3d')]['id']}},_0x15ecbd={};_0x15ecbd['model']=_[_0xd40b('0x2d')](db[_0xd40b('0x38')][_0xd40b('0x29')]);_0x15ecbd[_0xd40b('0x2c')]=_[_0xd40b('0x2d')](_0x51e71e[_0xd40b('0x2c')]);_0x15ecbd[_0xd40b('0x2e')]=_['intersection'](_0x15ecbd[_0xd40b('0x2f')],_0x15ecbd[_0xd40b('0x2c')]);_0x443f46[_0xd40b('0x30')]=_[_0xd40b('0x3e')](_0x15ecbd[_0xd40b('0x2f')],qs[_0xd40b('0x31')](_0x51e71e[_0xd40b('0x2c')][_0xd40b('0x31')]));_0x443f46['attributes']=_0x443f46[_0xd40b('0x30')]['length']?_0x443f46[_0xd40b('0x30')]:_0x15ecbd['model'];if(_0x51e71e[_0xd40b('0x2c')][_0xd40b('0x39')]){_0x443f46['include']=[{'all':!![]}];}_0x443f46=_[_0xd40b('0x37')]({},_0x443f46,_0x51e71e[_0xd40b('0x3f')]);return db[_0xd40b('0x38')][_0xd40b('0x40')](_0x443f46)[_0xd40b('0x23')](handleEntityNotFound(_0x44334b,null))[_0xd40b('0x23')](respondWithResult(_0x44334b,null))[_0xd40b('0x3c')](handleError(_0x44334b,null));};exports[_0xd40b('0x41')]=function(_0xef9b32,_0x1f3e57){return db[_0xd40b('0x38')][_0xd40b('0x41')](_0xef9b32[_0xd40b('0x42')],{})['then'](respondWithResult(_0x1f3e57,0xc9))[_0xd40b('0x3c')](handleError(_0x1f3e57,null));};exports[_0xd40b('0x22')]=function(_0x4ab1ea,_0x1ec3ab){if(_0x4ab1ea[_0xd40b('0x42')]['id']){delete _0x4ab1ea['body']['id'];}return db[_0xd40b('0x38')]['find']({'where':{'id':_0x4ab1ea[_0xd40b('0x3d')]['id']}})[_0xd40b('0x23')](handleEntityNotFound(_0x1ec3ab,null))[_0xd40b('0x23')](saveUpdates(_0x4ab1ea[_0xd40b('0x42')],null))['then'](respondWithResult(_0x1ec3ab,null))[_0xd40b('0x3c')](handleError(_0x1ec3ab,null));};exports[_0xd40b('0x43')]=function(_0x1dbb61,_0x525046){return db[_0xd40b('0x38')]['find']({'where':{'id':_0x1dbb61[_0xd40b('0x3d')]['id']}})[_0xd40b('0x23')](handleEntityNotFound(_0x525046,null))[_0xd40b('0x23')](removeEntity(_0x525046,null))[_0xd40b('0x3c')](handleError(_0x525046,null));};exports[_0xd40b('0x44')]=function(_0x24d226,_0x294083,_0x226715){var _0x596b7a={};var _0x531aa2={};var _0x282909;var _0x2a2e2b;return db[_0xd40b('0x38')][_0xd40b('0x45')]({'where':{'id':_0x24d226[_0xd40b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x294083,null))[_0xd40b('0x23')](function(_0x57ecbb){if(_0x57ecbb){_0x282909=_0x57ecbb;_0x531aa2[_0xd40b('0x2f')]=_[_0xd40b('0x2d')](db['FreshdeskField'][_0xd40b('0x29')]);_0x531aa2[_0xd40b('0x2c')]=_[_0xd40b('0x2d')](_0x24d226[_0xd40b('0x2c')]);_0x531aa2[_0xd40b('0x2e')]=_[_0xd40b('0x3e')](_0x531aa2['model'],_0x531aa2[_0xd40b('0x2c')]);_0x596b7a[_0xd40b('0x30')]=_[_0xd40b('0x3e')](_0x531aa2[_0xd40b('0x2f')],qs['fields'](_0x24d226[_0xd40b('0x2c')][_0xd40b('0x31')]));_0x596b7a['attributes']=_0x596b7a[_0xd40b('0x30')][_0xd40b('0x32')]?_0x596b7a[_0xd40b('0x30')]:_0x531aa2['model'];_0x596b7a[_0xd40b('0x46')]=qs[_0xd40b('0x47')](_0x24d226[_0xd40b('0x2c')][_0xd40b('0x47')]);_0x596b7a[_0xd40b('0x35')]=qs[_0xd40b('0x2e')](_[_0xd40b('0x48')](_0x24d226['query'],_0x531aa2[_0xd40b('0x2e')]));if(_0x24d226[_0xd40b('0x2c')]['filter']){_0x596b7a[_0xd40b('0x35')]=_[_0xd40b('0x37')](_0x596b7a[_0xd40b('0x35')],{'$or':_[_0xd40b('0x28')](_0x596b7a[_0xd40b('0x30')],function(_0x1e9231){var _0x1d2b3e={};_0x1d2b3e[_0x1e9231]={'$like':'%'+_0x24d226[_0xd40b('0x2c')][_0xd40b('0x36')]+'%'};return _0x1d2b3e;})});}_0x596b7a=_[_0xd40b('0x37')]({},_0x596b7a,_0x24d226[_0xd40b('0x3f')]);return _0x282909[_0xd40b('0x44')](_0x596b7a);}})[_0xd40b('0x23')](function(_0x142893){if(_0x142893){_0x2a2e2b=_0x142893['length'];if(!_0x24d226['query'][_0xd40b('0x33')](_0xd40b('0x34'))){_0x596b7a[_0xd40b('0x1c')]=qs[_0xd40b('0x1c')](_0x24d226['query'][_0xd40b('0x1c')]);_0x596b7a[_0xd40b('0x19')]=qs[_0xd40b('0x19')](_0x24d226[_0xd40b('0x2c')][_0xd40b('0x19')]);}return _0x282909[_0xd40b('0x44')](_0x596b7a);}})[_0xd40b('0x23')](function(_0x950ba0){if(_0x950ba0){return _0x950ba0?{'count':_0x2a2e2b,'rows':_0x950ba0}:null;}})[_0xd40b('0x23')](respondWithResult(_0x294083,null))[_0xd40b('0x3c')](handleError(_0x294083,null));};exports['getSubjects']=function(_0x5070ac,_0x5a94b5,_0x521108){var _0x544eb4={};var _0x2c6ed7={};var _0x50f7bf;var _0x40e80a;return db[_0xd40b('0x38')]['findOne']({'where':{'id':_0x5070ac[_0xd40b('0x3d')]['id']}})[_0xd40b('0x23')](handleEntityNotFound(_0x5a94b5,null))['then'](function(_0x3e794e){if(_0x3e794e){_0x50f7bf=_0x3e794e;_0x2c6ed7[_0xd40b('0x2f')]=_[_0xd40b('0x2d')](db[_0xd40b('0x49')]['rawAttributes']);_0x2c6ed7[_0xd40b('0x2c')]=_[_0xd40b('0x2d')](_0x5070ac[_0xd40b('0x2c')]);_0x2c6ed7[_0xd40b('0x2e')]=_['intersection'](_0x2c6ed7[_0xd40b('0x2f')],_0x2c6ed7['query']);_0x544eb4['attributes']=_[_0xd40b('0x3e')](_0x2c6ed7['model'],qs[_0xd40b('0x31')](_0x5070ac[_0xd40b('0x2c')][_0xd40b('0x31')]));_0x544eb4[_0xd40b('0x30')]=_0x544eb4['attributes'][_0xd40b('0x32')]?_0x544eb4[_0xd40b('0x30')]:_0x2c6ed7['model'];_0x544eb4[_0xd40b('0x46')]=qs[_0xd40b('0x47')](_0x5070ac[_0xd40b('0x2c')][_0xd40b('0x47')]);_0x544eb4[_0xd40b('0x35')]=qs[_0xd40b('0x2e')](_[_0xd40b('0x48')](_0x5070ac[_0xd40b('0x2c')],_0x2c6ed7[_0xd40b('0x2e')]));if(_0x5070ac[_0xd40b('0x2c')][_0xd40b('0x36')]){_0x544eb4[_0xd40b('0x35')]=_[_0xd40b('0x37')](_0x544eb4['where'],{'$or':_[_0xd40b('0x28')](_0x544eb4[_0xd40b('0x30')],function(_0x2ca75f){var _0x3414ed={};_0x3414ed[_0x2ca75f]={'$like':'%'+_0x5070ac[_0xd40b('0x2c')][_0xd40b('0x36')]+'%'};return _0x3414ed;})});}_0x544eb4=_[_0xd40b('0x37')]({},_0x544eb4,_0x5070ac[_0xd40b('0x3f')]);return _0x50f7bf[_0xd40b('0x4a')](_0x544eb4);}})[_0xd40b('0x23')](function(_0x5c8a1d){if(_0x5c8a1d){_0x40e80a=_0x5c8a1d['length'];if(!_0x5070ac[_0xd40b('0x2c')]['hasOwnProperty'](_0xd40b('0x34'))){_0x544eb4[_0xd40b('0x1c')]=qs['limit'](_0x5070ac[_0xd40b('0x2c')]['limit']);_0x544eb4[_0xd40b('0x19')]=qs[_0xd40b('0x19')](_0x5070ac[_0xd40b('0x2c')]['offset']);}return _0x50f7bf[_0xd40b('0x4a')](_0x544eb4);}})[_0xd40b('0x23')](function(_0xd1fefe){if(_0xd1fefe){return _0xd1fefe?{'count':_0x40e80a,'rows':_0xd1fefe}:null;}})[_0xd40b('0x23')](respondWithResult(_0x5a94b5,null))[_0xd40b('0x3c')](handleError(_0x5a94b5,null));};exports['getDescriptions']=function(_0x290ffb,_0x2c62ce,_0x25c2d9){var _0x21bb1b={};var _0x4b35b4={};var _0x340b98;var _0x1bed6c;return db['FreshdeskConfiguration'][_0xd40b('0x45')]({'where':{'id':_0x290ffb[_0xd40b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2c62ce,null))[_0xd40b('0x23')](function(_0x622395){if(_0x622395){_0x340b98=_0x622395;_0x4b35b4[_0xd40b('0x2f')]=_[_0xd40b('0x2d')](db[_0xd40b('0x49')][_0xd40b('0x29')]);_0x4b35b4['query']=_[_0xd40b('0x2d')](_0x290ffb[_0xd40b('0x2c')]);_0x4b35b4[_0xd40b('0x2e')]=_['intersection'](_0x4b35b4[_0xd40b('0x2f')],_0x4b35b4[_0xd40b('0x2c')]);_0x21bb1b[_0xd40b('0x30')]=_[_0xd40b('0x3e')](_0x4b35b4['model'],qs[_0xd40b('0x31')](_0x290ffb['query'][_0xd40b('0x31')]));_0x21bb1b[_0xd40b('0x30')]=_0x21bb1b['attributes'][_0xd40b('0x32')]?_0x21bb1b[_0xd40b('0x30')]:_0x4b35b4[_0xd40b('0x2f')];_0x21bb1b[_0xd40b('0x46')]=qs[_0xd40b('0x47')](_0x290ffb[_0xd40b('0x2c')][_0xd40b('0x47')]);_0x21bb1b[_0xd40b('0x35')]=qs[_0xd40b('0x2e')](_[_0xd40b('0x48')](_0x290ffb['query'],_0x4b35b4['filters']));if(_0x290ffb[_0xd40b('0x2c')][_0xd40b('0x36')]){_0x21bb1b[_0xd40b('0x35')]=_['merge'](_0x21bb1b['where'],{'$or':_[_0xd40b('0x28')](_0x21bb1b[_0xd40b('0x30')],function(_0xc1893c){var _0x5b6b38={};_0x5b6b38[_0xc1893c]={'$like':'%'+_0x290ffb[_0xd40b('0x2c')][_0xd40b('0x36')]+'%'};return _0x5b6b38;})});}_0x21bb1b=_[_0xd40b('0x37')]({},_0x21bb1b,_0x290ffb[_0xd40b('0x3f')]);return _0x340b98[_0xd40b('0x4b')](_0x21bb1b);}})[_0xd40b('0x23')](function(_0x19c240){if(_0x19c240){_0x1bed6c=_0x19c240[_0xd40b('0x32')];if(!_0x290ffb[_0xd40b('0x2c')][_0xd40b('0x33')](_0xd40b('0x34'))){_0x21bb1b[_0xd40b('0x1c')]=qs[_0xd40b('0x1c')](_0x290ffb['query'][_0xd40b('0x1c')]);_0x21bb1b[_0xd40b('0x19')]=qs['offset'](_0x290ffb[_0xd40b('0x2c')][_0xd40b('0x19')]);}return _0x340b98['getDescriptions'](_0x21bb1b);}})[_0xd40b('0x23')](function(_0xae2af6){if(_0xae2af6){return _0xae2af6?{'count':_0x1bed6c,'rows':_0xae2af6}:null;}})[_0xd40b('0x23')](respondWithResult(_0x2c62ce,null))[_0xd40b('0x3c')](handleError(_0x2c62ce,null));};exports[_0xd40b('0x4c')]=function(_0x5b2d7b,_0x202f47,_0x170820){var _0x49eb5b={};var _0x207ed0={};var _0x517e1e;var _0x591777;return db[_0xd40b('0x38')]['findOne']({'where':{'id':_0x5b2d7b[_0xd40b('0x3d')]['id']}})[_0xd40b('0x23')](handleEntityNotFound(_0x202f47,null))[_0xd40b('0x23')](function(_0x5eb74b){if(_0x5eb74b){_0x517e1e=_0x5eb74b;_0x207ed0[_0xd40b('0x2f')]=_[_0xd40b('0x2d')](db['Tag'][_0xd40b('0x29')]);_0x207ed0[_0xd40b('0x2c')]=_[_0xd40b('0x2d')](_0x5b2d7b['query']);_0x207ed0[_0xd40b('0x2e')]=_[_0xd40b('0x3e')](_0x207ed0[_0xd40b('0x2f')],_0x207ed0['query']);_0x49eb5b[_0xd40b('0x30')]=_['intersection'](_0x207ed0[_0xd40b('0x2f')],qs[_0xd40b('0x31')](_0x5b2d7b[_0xd40b('0x2c')]['fields']));_0x49eb5b[_0xd40b('0x30')]=_0x49eb5b[_0xd40b('0x30')][_0xd40b('0x32')]?_0x49eb5b[_0xd40b('0x30')]:_0x207ed0[_0xd40b('0x2f')];_0x49eb5b[_0xd40b('0x46')]=qs[_0xd40b('0x47')](_0x5b2d7b['query'][_0xd40b('0x47')]);_0x49eb5b[_0xd40b('0x35')]=qs[_0xd40b('0x2e')](_[_0xd40b('0x48')](_0x5b2d7b[_0xd40b('0x2c')],_0x207ed0[_0xd40b('0x2e')]));if(_0x5b2d7b[_0xd40b('0x2c')][_0xd40b('0x36')]){_0x49eb5b[_0xd40b('0x35')]=_[_0xd40b('0x37')](_0x49eb5b[_0xd40b('0x35')],{'$or':_['map'](_0x49eb5b[_0xd40b('0x30')],function(_0x18983e){var _0xc76463={};_0xc76463[_0x18983e]={'$like':'%'+_0x5b2d7b[_0xd40b('0x2c')][_0xd40b('0x36')]+'%'};return _0xc76463;})});}_0x49eb5b=_['merge']({},_0x49eb5b,_0x5b2d7b['options']);return _0x517e1e[_0xd40b('0x4c')](_0x49eb5b);}})[_0xd40b('0x23')](function(_0x2766fa){if(_0x2766fa){_0x591777=_0x2766fa[_0xd40b('0x32')];if(!_0x5b2d7b[_0xd40b('0x2c')][_0xd40b('0x33')]('nolimit')){_0x49eb5b[_0xd40b('0x1c')]=qs['limit'](_0x5b2d7b['query'][_0xd40b('0x1c')]);_0x49eb5b['offset']=qs[_0xd40b('0x19')](_0x5b2d7b['query']['offset']);}return _0x517e1e['getTags'](_0x49eb5b);}})[_0xd40b('0x23')](function(_0x195bc6){if(_0x195bc6){return _0x195bc6?{'count':_0x591777,'rows':_0x195bc6}:null;}})[_0xd40b('0x23')](respondWithResult(_0x202f47,null))[_0xd40b('0x3c')](handleError(_0x202f47,null));};exports[_0xd40b('0x4d')]=function(_0x163211,_0x1da1e9,_0x2d0157){if(_0x163211[_0xd40b('0x42')]['id']){delete _0x163211[_0xd40b('0x42')]['id'];}return db[_0xd40b('0x38')][_0xd40b('0x45')]({'where':{'id':_0x163211[_0xd40b('0x3d')]['id']}})[_0xd40b('0x23')](handleEntityNotFound(_0x1da1e9,null))[_0xd40b('0x23')](function(_0x4895a4){if(_0x4895a4){return _0x4895a4[_0xd40b('0x4d')](_0x163211[_0xd40b('0x42')][_0xd40b('0x4e')]||[]);}return null;})[_0xd40b('0x23')](respondWithResult(_0x1da1e9,null))[_0xd40b('0x3c')](handleError(_0x1da1e9,null));};
\ No newline at end of file
index 13cc1d9..9f5b83d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2d4=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd2d4,0x17b));var _0x4d2d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd2d4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4d2d('0x0'));var util=require(_0x4d2d('0x1'));var logger=require(_0x4d2d('0x2'))(_0x4d2d('0x3'));var moment=require(_0x4d2d('0x4'));var BPromise=require('bluebird');var rp=require(_0x4d2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d2d('0x6'));var config=require(_0x4d2d('0x7'));var attributes=require(_0x4d2d('0x8'));module['exports']=function(_0x57facb,_0x17c7b8){return _0x57facb[_0x4d2d('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x4d2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5dd7=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x3c5642,_0x5c2bac){var _0x28b696=function(_0x5afcc5){while(--_0x5afcc5){_0x3c5642['push'](_0x3c5642['shift']());}};_0x28b696(++_0x5c2bac);}(_0x5dd7,0xf0));var _0x75dd=function(_0x51b0a6,_0x212857){_0x51b0a6=_0x51b0a6-0x0;var _0x134624=_0x5dd7[_0x51b0a6];return _0x134624;};'use strict';var _=require(_0x75dd('0x0'));var util=require(_0x75dd('0x1'));var logger=require('../../config/logger')(_0x75dd('0x2'));var moment=require(_0x75dd('0x3'));var BPromise=require(_0x75dd('0x4'));var rp=require(_0x75dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75dd('0x6'));var config=require(_0x75dd('0x7'));var attributes=require(_0x75dd('0x8'));module[_0x75dd('0x9')]=function(_0x1c3376,_0xbd4774){return _0x1c3376[_0x75dd('0xa')](_0x75dd('0xb'),attributes,{'tableName':_0x75dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9e89f5c..67b1f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7773=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7773,0x1d9));var _0x3777=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7773[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3777('0x0'));var BPromise=require('bluebird');var rs=require(_0x3777('0x1'));var fs=require('fs');var Redis=require(_0x3777('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3777('0x3'));var logger=require(_0x3777('0x4'))(_0x3777('0x5'));var config=require(_0x3777('0x6'));var jayson=require(_0x3777('0x7'));var client=jayson[_0x3777('0x8')][_0x3777('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x286895,_0x51336a,_0x273da9){return new BPromise(function(_0x3dcceb,_0x1a2e05){return client[_0x3777('0xa')](_0x286895,_0x273da9)[_0x3777('0xb')](function(_0x638f92){logger[_0x3777('0xc')](_0x3777('0xd'),_0x51336a,_0x3777('0xe'));logger[_0x3777('0xf')](_0x3777('0x10'),_0x51336a,'request\x20sent',JSON[_0x3777('0x11')](_0x638f92));if(_0x638f92[_0x3777('0x12')]){if(_0x638f92['error'][_0x3777('0x13')]===0x1f4){logger['error'](_0x3777('0xd'),_0x51336a,_0x638f92[_0x3777('0x12')][_0x3777('0x14')]);return _0x1a2e05(_0x638f92[_0x3777('0x12')][_0x3777('0x14')]);}logger[_0x3777('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x51336a,_0x638f92[_0x3777('0x12')][_0x3777('0x14')]);return _0x3dcceb(_0x638f92[_0x3777('0x12')][_0x3777('0x14')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x51336a,_0x3777('0xe'));_0x3dcceb(_0x638f92[_0x3777('0x15')][_0x3777('0x14')]);}})[_0x3777('0x16')](function(_0x135fdd){logger[_0x3777('0x12')](_0x3777('0xd'),_0x51336a,_0x135fdd);_0x1a2e05(_0x135fdd);});});}
\ No newline at end of file
+var _0x7e31=['../../config/logger','rpc','http','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1324f3,_0x5ce564){var _0x5787fe=function(_0x100e15){while(--_0x100e15){_0x1324f3['push'](_0x1324f3['shift']());}};_0x5787fe(++_0x5ce564);}(_0x7e31,0x7f));var _0x17e3=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x7e31[_0x10291b];return _0x1d5fbe;};'use strict';var _=require('lodash');var util=require(_0x17e3('0x0'));var moment=require(_0x17e3('0x1'));var BPromise=require(_0x17e3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17e3('0x3'));var db=require(_0x17e3('0x4'))['db'];var utils=require(_0x17e3('0x5'));var logger=require(_0x17e3('0x6'))(_0x17e3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x17e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xad17bd,_0x456819,_0x4bf919){return new BPromise(function(_0x588fa0,_0xc5d9e1){return client['request'](_0xad17bd,_0x4bf919)['then'](function(_0x5709bd){logger[_0x17e3('0x9')](_0x17e3('0xa'),_0x456819,_0x17e3('0xb'));logger[_0x17e3('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x456819,_0x17e3('0xb'),JSON[_0x17e3('0xd')](_0x5709bd));if(_0x5709bd[_0x17e3('0xe')]){if(_0x5709bd[_0x17e3('0xe')][_0x17e3('0xf')]===0x1f4){logger['error'](_0x17e3('0xa'),_0x456819,_0x5709bd[_0x17e3('0xe')][_0x17e3('0x10')]);return _0xc5d9e1(_0x5709bd['error']['message']);}logger[_0x17e3('0xe')](_0x17e3('0xa'),_0x456819,_0x5709bd[_0x17e3('0xe')][_0x17e3('0x10')]);return _0x588fa0(_0x5709bd['error']['message']);}else{logger[_0x17e3('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x456819,_0x17e3('0xb'));_0x588fa0(_0x5709bd[_0x17e3('0x11')][_0x17e3('0x10')]);}})[_0x17e3('0x12')](function(_0x5510b9){logger[_0x17e3('0xe')](_0x17e3('0xa'),_0x456819,_0x5510b9);_0xc5d9e1(_0x5510b9);});});}
\ No newline at end of file
index 37317f9..b7f56fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0265=['put','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x19db49,_0x3989a4){var _0x30de0e=function(_0x416b33){while(--_0x416b33){_0x19db49['push'](_0x19db49['shift']());}};_0x30de0e(++_0x3989a4);}(_0x0265,0x18b));var _0x5026=function(_0x14a85c,_0x1db7a5){_0x14a85c=_0x14a85c-0x0;var _0x32e12b=_0x0265[_0x14a85c];return _0x32e12b;};'use strict';var multer=require(_0x5026('0x0'));var util=require(_0x5026('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5026('0x2'));var router=express[_0x5026('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5026('0x4'));var config=require('../../config/environment');var controller=require(_0x5026('0x5'));router[_0x5026('0x6')]('/',auth[_0x5026('0x7')](),controller[_0x5026('0x8')]);router[_0x5026('0x6')](_0x5026('0x9'),auth[_0x5026('0x7')](),controller[_0x5026('0xa')]);router[_0x5026('0xb')]('/',auth[_0x5026('0x7')](),controller[_0x5026('0xc')]);router[_0x5026('0xd')]('/:id',auth[_0x5026('0x7')](),controller['update']);router[_0x5026('0xe')]('/:id',auth[_0x5026('0x7')](),controller[_0x5026('0xf')]);module[_0x5026('0x10')]=router;
\ No newline at end of file
+var _0x80d0=['show','post','create','put','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x86a88d,_0x11a46c){var _0x2514a7=function(_0x28cba7){while(--_0x28cba7){_0x86a88d['push'](_0x86a88d['shift']());}};_0x2514a7(++_0x11a46c);}(_0x80d0,0xb0));var _0x080d=function(_0x495940,_0x55f04d){_0x495940=_0x495940-0x0;var _0x33650d=_0x80d0[_0x495940];return _0x33650d;};'use strict';var multer=require(_0x080d('0x0'));var util=require(_0x080d('0x1'));var path=require('path');var timeout=require(_0x080d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x080d('0x3'));var auth=require(_0x080d('0x4'));var interaction=require(_0x080d('0x5'));var config=require('../../config/environment');var controller=require(_0x080d('0x6'));router[_0x080d('0x7')]('/',auth[_0x080d('0x8')](),controller[_0x080d('0x9')]);router[_0x080d('0x7')](_0x080d('0xa'),auth[_0x080d('0x8')](),controller[_0x080d('0xb')]);router[_0x080d('0xc')]('/',auth['isAuthenticated'](),controller[_0x080d('0xd')]);router[_0x080d('0xe')]('/:id',auth[_0x080d('0x8')](),controller['update']);router['delete'](_0x080d('0xa'),auth[_0x080d('0x8')](),controller[_0x080d('0xf')]);module[_0x080d('0x10')]=router;
\ No newline at end of file
index b4b54e5..2db2f5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf261=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x547022,_0x95a75d){var _0x3bf12c=function(_0xc67d83){while(--_0xc67d83){_0x547022['push'](_0x547022['shift']());}};_0x3bf12c(++_0x95a75d);}(_0xf261,0x17d));var _0x1f26=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf261[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x1f26('0x0'));module[_0x1f26('0x1')]={'type':{'type':Sequelize[_0x1f26('0x2')](_0x1f26('0x3'),'variable',_0x1f26('0x4'),_0x1f26('0x5'),_0x1f26('0x6')),'defaultValue':_0x1f26('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1f26('0x7')]},'keyType':{'type':Sequelize[_0x1f26('0x2')]('string',_0x1f26('0x8'),_0x1f26('0x4'))},'keyContent':{'type':Sequelize[_0x1f26('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1f26('0x7')]},'customField':{'type':Sequelize[_0x1f26('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f26('0x7')]}};
\ No newline at end of file
+var _0x0cc0=['variable','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x104b35,_0x33d934){var _0x1a957a=function(_0xb96c3){while(--_0xb96c3){_0x104b35['push'](_0x104b35['shift']());}};_0x1a957a(++_0x33d934);}(_0x0cc0,0x121));var _0x00cc=function(_0x3b4476,_0x1846df){_0x3b4476=_0x3b4476-0x0;var _0x5982e6=_0x0cc0[_0x3b4476];return _0x5982e6;};'use strict';var Sequelize=require(_0x00cc('0x0'));module[_0x00cc('0x1')]={'type':{'type':Sequelize[_0x00cc('0x2')](_0x00cc('0x3'),'variable',_0x00cc('0x4'),_0x00cc('0x5'),_0x00cc('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x00cc('0x7')]},'keyType':{'type':Sequelize[_0x00cc('0x2')](_0x00cc('0x3'),_0x00cc('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x00cc('0x7')]},'idField':{'type':Sequelize[_0x00cc('0x7')]},'nameField':{'type':Sequelize[_0x00cc('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x00cc('0x7')]}};
\ No newline at end of file
index 14dcfdc..8bbe6ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3d4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','destroy','error','name','index','FreshdeskField','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','keys','find','create','update','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4521ba,_0x56f76a){var _0x6fe0b0=function(_0x1ec4a8){while(--_0x1ec4a8){_0x4521ba['push'](_0x4521ba['shift']());}};_0x6fe0b0(++_0x56f76a);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x131390,_0xd0846e){_0x131390=_0x131390-0x0;var _0x550870=_0xe3d4[_0x131390];return _0x550870;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e3d('0x0'));var zipdir=require(_0x4e3d('0x1'));var jsonpatch=require(_0x4e3d('0x2'));var rp=require('request-promise');var moment=require(_0x4e3d('0x3'));var BPromise=require(_0x4e3d('0x4'));var Mustache=require('mustache');var util=require(_0x4e3d('0x5'));var path=require('path');var sox=require(_0x4e3d('0x6'));var csv=require(_0x4e3d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e3d('0x8'));var _=require(_0x4e3d('0x9'));var squel=require('squel');var crypto=require(_0x4e3d('0xa'));var jsforce=require(_0x4e3d('0xb'));var deskjs=require(_0x4e3d('0xc'));var toCsv=require(_0x4e3d('0x7'));var querystring=require(_0x4e3d('0xd'));var Papa=require(_0x4e3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e3d('0xf'));var as=require(_0x4e3d('0x10'));var hardwareService=require(_0x4e3d('0x11'));var logger=require(_0x4e3d('0x12'))(_0x4e3d('0x13'));var utils=require(_0x4e3d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4e3d('0x15'));var db=require(_0x4e3d('0x16'))['db'];function respondWithStatusCode(_0x2fc5f6,_0x30b359){_0x30b359=_0x30b359||0xcc;return function(_0x3556ec){if(_0x3556ec){return _0x2fc5f6[_0x4e3d('0x17')](_0x30b359);}return _0x2fc5f6[_0x4e3d('0x18')](_0x30b359)[_0x4e3d('0x19')]();};}function respondWithResult(_0x54debc,_0x44022b){_0x44022b=_0x44022b||0xc8;return function(_0x4325b4){if(_0x4325b4){return _0x54debc[_0x4e3d('0x18')](_0x44022b)['json'](_0x4325b4);}};}function respondWithFilteredResult(_0x3708be,_0x438973){return function(_0x46bf2b){if(_0x46bf2b){var _0xc20768=typeof _0x438973[_0x4e3d('0x1a')]===_0x4e3d('0x1b')&&typeof _0x438973[_0x4e3d('0x1c')]===_0x4e3d('0x1b');var _0x554ba6=_0x46bf2b[_0x4e3d('0x1d')];var _0x5129d5=_0xc20768?0x0:_0x438973['offset'];var _0x19010b=_0xc20768?_0x46bf2b['count']:_0x438973['offset']+_0x438973[_0x4e3d('0x1c')];var _0x2e37ad;if(_0x19010b>=_0x554ba6){_0x19010b=_0x554ba6;_0x2e37ad=0xc8;}else{_0x2e37ad=0xce;}_0x3708be[_0x4e3d('0x18')](_0x2e37ad);return _0x3708be[_0x4e3d('0x1e')]('Content-Range',_0x5129d5+'-'+_0x19010b+'/'+_0x554ba6)[_0x4e3d('0x1f')](_0x46bf2b);}return null;};}function patchUpdates(_0x552ca7){return function(_0x20c533){try{jsonpatch['apply'](_0x20c533,_0x552ca7,!![]);}catch(_0x170f88){return BPromise[_0x4e3d('0x20')](_0x170f88);}return _0x20c533[_0x4e3d('0x21')]();};}function saveUpdates(_0x534185,_0x224c05){return function(_0x2c8186){if(_0x2c8186){return _0x2c8186['update'](_0x534185)['then'](function(_0x18271a){return _0x18271a;});}return null;};}function removeEntity(_0x7a0b3c,_0x35a31b){return function(_0x49301f){if(_0x49301f){return _0x49301f[_0x4e3d('0x22')]()['then'](function(){_0x7a0b3c[_0x4e3d('0x18')](0xcc)[_0x4e3d('0x19')]();});}};}function handleEntityNotFound(_0x43bc1b,_0x50d9db){return function(_0x2434ea){if(!_0x2434ea){_0x43bc1b[_0x4e3d('0x17')](0x194);}return _0x2434ea;};}function handleError(_0x5b1a18,_0x192cb4){_0x192cb4=_0x192cb4||0x1f4;return function(_0x21d7e4){logger[_0x4e3d('0x23')](_0x21d7e4['stack']);if(_0x21d7e4[_0x4e3d('0x24')]){delete _0x21d7e4['name'];}_0x5b1a18[_0x4e3d('0x18')](_0x192cb4)['send'](_0x21d7e4);};}exports[_0x4e3d('0x25')]=function(_0x2d1991,_0x17c0f4){var _0x4dfc6b={},_0x2c5935={},_0x9133f9={'count':0x0,'rows':[]};var _0x492788=_['map'](db[_0x4e3d('0x26')][_0x4e3d('0x27')],function(_0x36621d){return{'name':_0x36621d['fieldName'],'type':_0x36621d[_0x4e3d('0x28')][_0x4e3d('0x29')]};});_0x2c5935['model']=_['map'](_0x492788,_0x4e3d('0x24'));_0x2c5935[_0x4e3d('0x2a')]=_['keys'](_0x2d1991[_0x4e3d('0x2a')]);_0x2c5935['filters']=_[_0x4e3d('0x2b')](_0x2c5935[_0x4e3d('0x2c')],_0x2c5935['query']);_0x4dfc6b[_0x4e3d('0x2d')]=_[_0x4e3d('0x2b')](_0x2c5935[_0x4e3d('0x2c')],qs['fields'](_0x2d1991[_0x4e3d('0x2a')][_0x4e3d('0x2e')]));_0x4dfc6b['attributes']=_0x4dfc6b[_0x4e3d('0x2d')][_0x4e3d('0x2f')]?_0x4dfc6b['attributes']:_0x2c5935[_0x4e3d('0x2c')];if(!_0x2d1991[_0x4e3d('0x2a')][_0x4e3d('0x30')](_0x4e3d('0x31'))){_0x4dfc6b[_0x4e3d('0x1c')]=qs[_0x4e3d('0x1c')](_0x2d1991[_0x4e3d('0x2a')][_0x4e3d('0x1c')]);_0x4dfc6b[_0x4e3d('0x1a')]=qs[_0x4e3d('0x1a')](_0x2d1991[_0x4e3d('0x2a')]['offset']);}_0x4dfc6b[_0x4e3d('0x32')]=qs[_0x4e3d('0x33')](_0x2d1991[_0x4e3d('0x2a')][_0x4e3d('0x33')]);_0x4dfc6b[_0x4e3d('0x34')]=qs[_0x4e3d('0x35')](_['pick'](_0x2d1991[_0x4e3d('0x2a')],_0x2c5935[_0x4e3d('0x35')]),_0x492788);if(_0x2d1991[_0x4e3d('0x2a')][_0x4e3d('0x36')]){_0x4dfc6b[_0x4e3d('0x34')]=_[_0x4e3d('0x37')](_0x4dfc6b[_0x4e3d('0x34')],{'$or':_[_0x4e3d('0x38')](_0x492788,function(_0x5ba9b5){if(_0x5ba9b5[_0x4e3d('0x28')]!==_0x4e3d('0x39')){var _0xdd79a0={};_0xdd79a0[_0x5ba9b5[_0x4e3d('0x24')]]={'$like':'%'+_0x2d1991[_0x4e3d('0x2a')][_0x4e3d('0x36')]+'%'};return _0xdd79a0;}})});}_0x4dfc6b=_['merge']({},_0x4dfc6b,_0x2d1991[_0x4e3d('0x3a')]);var _0x4e8745={'where':_0x4dfc6b[_0x4e3d('0x34')]};return db[_0x4e3d('0x26')][_0x4e3d('0x1d')](_0x4e8745)[_0x4e3d('0x3b')](function(_0x279e69){_0x9133f9[_0x4e3d('0x1d')]=_0x279e69;if(_0x2d1991['query'][_0x4e3d('0x3c')]){_0x4dfc6b[_0x4e3d('0x3d')]=[{'all':!![]}];}return db[_0x4e3d('0x26')][_0x4e3d('0x3e')](_0x4dfc6b);})[_0x4e3d('0x3b')](function(_0x4e1b89){_0x9133f9['rows']=_0x4e1b89;return _0x9133f9;})[_0x4e3d('0x3b')](respondWithFilteredResult(_0x17c0f4,_0x4dfc6b))[_0x4e3d('0x3f')](handleError(_0x17c0f4,null));};exports[_0x4e3d('0x40')]=function(_0x4f1c27,_0x36a36c){var _0x334275={'raw':!![],'where':{'id':_0x4f1c27[_0x4e3d('0x41')]['id']}},_0x572134={};_0x572134['model']=_[_0x4e3d('0x42')](db[_0x4e3d('0x26')][_0x4e3d('0x27')]);_0x572134['query']=_[_0x4e3d('0x42')](_0x4f1c27['query']);_0x572134[_0x4e3d('0x35')]=_[_0x4e3d('0x2b')](_0x572134[_0x4e3d('0x2c')],_0x572134['query']);_0x334275[_0x4e3d('0x2d')]=_[_0x4e3d('0x2b')](_0x572134[_0x4e3d('0x2c')],qs[_0x4e3d('0x2e')](_0x4f1c27[_0x4e3d('0x2a')][_0x4e3d('0x2e')]));_0x334275[_0x4e3d('0x2d')]=_0x334275[_0x4e3d('0x2d')][_0x4e3d('0x2f')]?_0x334275[_0x4e3d('0x2d')]:_0x572134['model'];if(_0x4f1c27[_0x4e3d('0x2a')][_0x4e3d('0x3c')]){_0x334275[_0x4e3d('0x3d')]=[{'all':!![]}];}_0x334275=_[_0x4e3d('0x37')]({},_0x334275,_0x4f1c27[_0x4e3d('0x3a')]);return db[_0x4e3d('0x26')][_0x4e3d('0x43')](_0x334275)[_0x4e3d('0x3b')](handleEntityNotFound(_0x36a36c,null))[_0x4e3d('0x3b')](respondWithResult(_0x36a36c,null))[_0x4e3d('0x3f')](handleError(_0x36a36c,null));};exports[_0x4e3d('0x44')]=function(_0x63bcae,_0x4fba01){return db['FreshdeskField'][_0x4e3d('0x44')](_0x63bcae['body'],{})[_0x4e3d('0x3b')](respondWithResult(_0x4fba01,0xc9))[_0x4e3d('0x3f')](handleError(_0x4fba01,null));};exports[_0x4e3d('0x45')]=function(_0x229b3f,_0x403fa7){if(_0x229b3f['body']['id']){delete _0x229b3f[_0x4e3d('0x46')]['id'];}return db[_0x4e3d('0x26')]['find']({'where':{'id':_0x229b3f['params']['id']}})['then'](handleEntityNotFound(_0x403fa7,null))['then'](saveUpdates(_0x229b3f[_0x4e3d('0x46')],null))[_0x4e3d('0x3b')](respondWithResult(_0x403fa7,null))[_0x4e3d('0x3f')](handleError(_0x403fa7,null));};exports[_0x4e3d('0x22')]=function(_0x1eeaf1,_0x2c59ec){return db[_0x4e3d('0x26')]['find']({'where':{'id':_0x1eeaf1[_0x4e3d('0x41')]['id']}})[_0x4e3d('0x3b')](handleEntityNotFound(_0x2c59ec,null))[_0x4e3d('0x3b')](removeEntity(_0x2c59ec,null))[_0x4e3d('0x3f')](handleError(_0x2c59ec,null));};
\ No newline at end of file
+var _0x705f=['Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','pick','where','merge','filter','count','includeAll','FreshdeskField','findAll','rows','catch','show','rawAttributes','fields','include','options','find','create','body','params','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit'];(function(_0x283bb4,_0x1addf2){var _0x14fb35=function(_0x2c8366){while(--_0x2c8366){_0x283bb4['push'](_0x283bb4['shift']());}};_0x14fb35(++_0x1addf2);}(_0x705f,0x75));var _0xf705=function(_0x5600ba,_0xe51f7c){_0x5600ba=_0x5600ba-0x0;var _0x2db0f1=_0x705f[_0x5600ba];return _0x2db0f1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf705('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf705('0x1'));var moment=require(_0xf705('0x2'));var BPromise=require(_0xf705('0x3'));var Mustache=require(_0xf705('0x4'));var util=require(_0xf705('0x5'));var path=require(_0xf705('0x6'));var sox=require(_0xf705('0x7'));var csv=require(_0xf705('0x8'));var ejs=require(_0xf705('0x9'));var fs=require('fs');var fs_extra=require(_0xf705('0xa'));var _=require(_0xf705('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf705('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf705('0x8'));var querystring=require(_0xf705('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf705('0xe'));var qs=require(_0xf705('0xf'));var as=require(_0xf705('0x10'));var hardwareService=require(_0xf705('0x11'));var logger=require(_0xf705('0x12'))(_0xf705('0x13'));var utils=require(_0xf705('0x14'));var config=require(_0xf705('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf705('0x16'))['db'];function respondWithStatusCode(_0x296a62,_0xb50c9f){_0xb50c9f=_0xb50c9f||0xcc;return function(_0xf625da){if(_0xf625da){return _0x296a62[_0xf705('0x17')](_0xb50c9f);}return _0x296a62['status'](_0xb50c9f)['end']();};}function respondWithResult(_0x26cb9a,_0x10763f){_0x10763f=_0x10763f||0xc8;return function(_0x15d2e2){if(_0x15d2e2){return _0x26cb9a[_0xf705('0x18')](_0x10763f)['json'](_0x15d2e2);}};}function respondWithFilteredResult(_0x9c7b75,_0x23a64b){return function(_0x4555a8){if(_0x4555a8){var _0x32f48b=typeof _0x23a64b['offset']===_0xf705('0x19')&&typeof _0x23a64b['limit']===_0xf705('0x19');var _0x1c0778=_0x4555a8['count'];var _0xa9a2ca=_0x32f48b?0x0:_0x23a64b['offset'];var _0x425cd6=_0x32f48b?_0x4555a8['count']:_0x23a64b['offset']+_0x23a64b[_0xf705('0x1a')];var _0xfee2a8;if(_0x425cd6>=_0x1c0778){_0x425cd6=_0x1c0778;_0xfee2a8=0xc8;}else{_0xfee2a8=0xce;}_0x9c7b75[_0xf705('0x18')](_0xfee2a8);return _0x9c7b75['set'](_0xf705('0x1b'),_0xa9a2ca+'-'+_0x425cd6+'/'+_0x1c0778)[_0xf705('0x1c')](_0x4555a8);}return null;};}function patchUpdates(_0x8d5b49){return function(_0x57456a){try{jsonpatch[_0xf705('0x1d')](_0x57456a,_0x8d5b49,!![]);}catch(_0x4d34cd){return BPromise['reject'](_0x4d34cd);}return _0x57456a[_0xf705('0x1e')]();};}function saveUpdates(_0x1052a6,_0x2a2fb7){return function(_0x24622b){if(_0x24622b){return _0x24622b[_0xf705('0x1f')](_0x1052a6)[_0xf705('0x20')](function(_0xcab54f){return _0xcab54f;});}return null;};}function removeEntity(_0x10dfc9,_0x424d4e){return function(_0x39dddb){if(_0x39dddb){return _0x39dddb[_0xf705('0x21')]()['then'](function(){_0x10dfc9[_0xf705('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23bb4a,_0x4ccff8){return function(_0x5eadda){if(!_0x5eadda){_0x23bb4a[_0xf705('0x17')](0x194);}return _0x5eadda;};}function handleError(_0x33da21,_0x593180){_0x593180=_0x593180||0x1f4;return function(_0x4f5435){logger[_0xf705('0x22')](_0x4f5435[_0xf705('0x23')]);if(_0x4f5435[_0xf705('0x24')]){delete _0x4f5435[_0xf705('0x24')];}_0x33da21[_0xf705('0x18')](_0x593180)['send'](_0x4f5435);};}exports[_0xf705('0x25')]=function(_0x2c4a5d,_0x3a6343){var _0x54f905={},_0x4a09ab={},_0x4a0fd3={'count':0x0,'rows':[]};var _0x54ff43=_[_0xf705('0x26')](db['FreshdeskField']['rawAttributes'],function(_0x29ac24){return{'name':_0x29ac24[_0xf705('0x27')],'type':_0x29ac24[_0xf705('0x28')][_0xf705('0x29')]};});_0x4a09ab[_0xf705('0x2a')]=_['map'](_0x54ff43,'name');_0x4a09ab[_0xf705('0x2b')]=_[_0xf705('0x2c')](_0x2c4a5d[_0xf705('0x2b')]);_0x4a09ab[_0xf705('0x2d')]=_[_0xf705('0x2e')](_0x4a09ab[_0xf705('0x2a')],_0x4a09ab[_0xf705('0x2b')]);_0x54f905[_0xf705('0x2f')]=_['intersection'](_0x4a09ab[_0xf705('0x2a')],qs['fields'](_0x2c4a5d[_0xf705('0x2b')]['fields']));_0x54f905[_0xf705('0x2f')]=_0x54f905[_0xf705('0x2f')][_0xf705('0x30')]?_0x54f905[_0xf705('0x2f')]:_0x4a09ab[_0xf705('0x2a')];if(!_0x2c4a5d[_0xf705('0x2b')][_0xf705('0x31')]('nolimit')){_0x54f905[_0xf705('0x1a')]=qs[_0xf705('0x1a')](_0x2c4a5d[_0xf705('0x2b')]['limit']);_0x54f905['offset']=qs[_0xf705('0x32')](_0x2c4a5d['query'][_0xf705('0x32')]);}_0x54f905[_0xf705('0x33')]=qs[_0xf705('0x34')](_0x2c4a5d['query'][_0xf705('0x34')]);_0x54f905['where']=qs[_0xf705('0x2d')](_[_0xf705('0x35')](_0x2c4a5d[_0xf705('0x2b')],_0x4a09ab['filters']),_0x54ff43);if(_0x2c4a5d[_0xf705('0x2b')]['filter']){_0x54f905[_0xf705('0x36')]=_[_0xf705('0x37')](_0x54f905[_0xf705('0x36')],{'$or':_[_0xf705('0x26')](_0x54ff43,function(_0x38f9d5){if(_0x38f9d5[_0xf705('0x28')]!=='VIRTUAL'){var _0x2b9902={};_0x2b9902[_0x38f9d5[_0xf705('0x24')]]={'$like':'%'+_0x2c4a5d[_0xf705('0x2b')][_0xf705('0x38')]+'%'};return _0x2b9902;}})});}_0x54f905=_['merge']({},_0x54f905,_0x2c4a5d['options']);var _0x3b02f7={'where':_0x54f905[_0xf705('0x36')]};return db['FreshdeskField'][_0xf705('0x39')](_0x3b02f7)[_0xf705('0x20')](function(_0x10e28b){_0x4a0fd3['count']=_0x10e28b;if(_0x2c4a5d[_0xf705('0x2b')][_0xf705('0x3a')]){_0x54f905['include']=[{'all':!![]}];}return db[_0xf705('0x3b')][_0xf705('0x3c')](_0x54f905);})[_0xf705('0x20')](function(_0x4382cd){_0x4a0fd3[_0xf705('0x3d')]=_0x4382cd;return _0x4a0fd3;})[_0xf705('0x20')](respondWithFilteredResult(_0x3a6343,_0x54f905))[_0xf705('0x3e')](handleError(_0x3a6343,null));};exports[_0xf705('0x3f')]=function(_0x3355b1,_0x108663){var _0x343f1a={'raw':!![],'where':{'id':_0x3355b1['params']['id']}},_0x50520d={};_0x50520d['model']=_[_0xf705('0x2c')](db[_0xf705('0x3b')][_0xf705('0x40')]);_0x50520d['query']=_[_0xf705('0x2c')](_0x3355b1[_0xf705('0x2b')]);_0x50520d[_0xf705('0x2d')]=_[_0xf705('0x2e')](_0x50520d[_0xf705('0x2a')],_0x50520d[_0xf705('0x2b')]);_0x343f1a['attributes']=_['intersection'](_0x50520d[_0xf705('0x2a')],qs[_0xf705('0x41')](_0x3355b1['query'][_0xf705('0x41')]));_0x343f1a[_0xf705('0x2f')]=_0x343f1a[_0xf705('0x2f')][_0xf705('0x30')]?_0x343f1a['attributes']:_0x50520d[_0xf705('0x2a')];if(_0x3355b1[_0xf705('0x2b')]['includeAll']){_0x343f1a[_0xf705('0x42')]=[{'all':!![]}];}_0x343f1a=_[_0xf705('0x37')]({},_0x343f1a,_0x3355b1[_0xf705('0x43')]);return db[_0xf705('0x3b')][_0xf705('0x44')](_0x343f1a)[_0xf705('0x20')](handleEntityNotFound(_0x108663,null))[_0xf705('0x20')](respondWithResult(_0x108663,null))[_0xf705('0x3e')](handleError(_0x108663,null));};exports[_0xf705('0x45')]=function(_0x4a5a02,_0x5b5463){return db[_0xf705('0x3b')][_0xf705('0x45')](_0x4a5a02['body'],{})[_0xf705('0x20')](respondWithResult(_0x5b5463,0xc9))[_0xf705('0x3e')](handleError(_0x5b5463,null));};exports[_0xf705('0x1f')]=function(_0x2c6861,_0x99c560){if(_0x2c6861[_0xf705('0x46')]['id']){delete _0x2c6861['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x2c6861[_0xf705('0x47')]['id']}})[_0xf705('0x20')](handleEntityNotFound(_0x99c560,null))[_0xf705('0x20')](saveUpdates(_0x2c6861['body'],null))[_0xf705('0x20')](respondWithResult(_0x99c560,null))[_0xf705('0x3e')](handleError(_0x99c560,null));};exports[_0xf705('0x21')]=function(_0x598441,_0x5b8f3f){return db['FreshdeskField'][_0xf705('0x44')]({'where':{'id':_0x598441[_0xf705('0x47')]['id']}})[_0xf705('0x20')](handleEntityNotFound(_0x5b8f3f,null))[_0xf705('0x20')](removeEntity(_0x5b8f3f,null))[_0xf705('0x3e')](handleError(_0x5b8f3f,null));};
\ No newline at end of file
index 7003c88..22d5844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebe7=['exports','define','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0x3e06c3,_0x1af655){var _0x1ab919=function(_0x4a0f90){while(--_0x4a0f90){_0x3e06c3['push'](_0x3e06c3['shift']());}};_0x1ab919(++_0x1af655);}(_0xebe7,0x165));var _0x7ebe=function(_0x4ed3e8,_0x20c1ce){_0x4ed3e8=_0x4ed3e8-0x0;var _0x3e3f14=_0xebe7[_0x4ed3e8];return _0x3e3f14;};'use strict';var _=require(_0x7ebe('0x0'));var util=require(_0x7ebe('0x1'));var logger=require(_0x7ebe('0x2'))('api');var moment=require(_0x7ebe('0x3'));var BPromise=require(_0x7ebe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ebe('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x7ebe('0x6')]=function(_0x4c23ad,_0xbd6236){return _0x4c23ad[_0x7ebe('0x7')]('FreshdeskField',attributes,{'tableName':_0x7ebe('0x8'),'paranoid':![],'indexes':[{'name':_0x7ebe('0x9'),'fields':['idField',_0x7ebe('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5089=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','FreshdeskField','int_freshdesk_fields','idField'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5089,0x1bb));var _0x9508=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x5089[_0x378b4];return _0x11d07b;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x9508('0x8')]=function(_0x4538dd,_0x257318){return _0x4538dd['define'](_0x9508('0x9'),attributes,{'tableName':_0x9508('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x9508('0xb'),_0x9508('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c30e05a..7617570 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fad=['stringify','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdff790,_0x13adb1){var _0xde90d3=function(_0x3c2b52){while(--_0x3c2b52){_0xdff790['push'](_0xdff790['shift']());}};_0xde90d3(++_0x13adb1);}(_0x1fad,0xa8));var _0xd1fa=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x1fad[_0x506d2f];return _0x101255;};'use strict';var _=require('lodash');var util=require(_0xd1fa('0x0'));var moment=require('moment');var BPromise=require(_0xd1fa('0x1'));var rs=require(_0xd1fa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1fa('0x3'))['db'];var utils=require(_0xd1fa('0x4'));var logger=require(_0xd1fa('0x5'))(_0xd1fa('0x6'));var config=require(_0xd1fa('0x7'));var jayson=require(_0xd1fa('0x8'));var client=jayson[_0xd1fa('0x9')][_0xd1fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c33a9,_0x3c4e89,_0x422493){return new BPromise(function(_0x2fc6ac,_0x529e02){return client[_0xd1fa('0xb')](_0x3c33a9,_0x422493)[_0xd1fa('0xc')](function(_0x8d5aa0){logger['info'](_0xd1fa('0xd'),_0x3c4e89,_0xd1fa('0xe'));logger[_0xd1fa('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3c4e89,_0xd1fa('0xe'),JSON[_0xd1fa('0x10')](_0x8d5aa0));if(_0x8d5aa0[_0xd1fa('0x11')]){if(_0x8d5aa0[_0xd1fa('0x11')][_0xd1fa('0x12')]===0x1f4){logger['error'](_0xd1fa('0xd'),_0x3c4e89,_0x8d5aa0['error'][_0xd1fa('0x13')]);return _0x529e02(_0x8d5aa0[_0xd1fa('0x11')]['message']);}logger[_0xd1fa('0x11')](_0xd1fa('0xd'),_0x3c4e89,_0x8d5aa0[_0xd1fa('0x11')][_0xd1fa('0x13')]);return _0x2fc6ac(_0x8d5aa0[_0xd1fa('0x11')][_0xd1fa('0x13')]);}else{logger[_0xd1fa('0x14')](_0xd1fa('0xd'),_0x3c4e89,_0xd1fa('0xe'));_0x2fc6ac(_0x8d5aa0[_0xd1fa('0x15')][_0xd1fa('0x13')]);}})[_0xd1fa('0x16')](function(_0x2cc208){logger[_0xd1fa('0x11')](_0xd1fa('0xd'),_0x3c4e89,_0x2cc208);_0x529e02(_0x2cc208);});});}
\ No newline at end of file
+var _0xc203=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc203,0xa5));var _0x3c20=function(_0x60b91d,_0x256c72){_0x60b91d=_0x60b91d-0x0;var _0x43e275=_0xc203[_0x60b91d];return _0x43e275;};'use strict';var _=require(_0x3c20('0x0'));var util=require(_0x3c20('0x1'));var moment=require('moment');var BPromise=require(_0x3c20('0x2'));var rs=require(_0x3c20('0x3'));var fs=require('fs');var Redis=require(_0x3c20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c20('0x5'));var logger=require('../../config/logger')(_0x3c20('0x6'));var config=require(_0x3c20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3c20('0x8')][_0x3c20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33fd41,_0xe22098,_0x1aebcf){return new BPromise(function(_0x5adf30,_0x57ae1c){return client[_0x3c20('0xa')](_0x33fd41,_0x1aebcf)[_0x3c20('0xb')](function(_0x2c6b97){logger[_0x3c20('0xc')](_0x3c20('0xd'),_0xe22098,_0x3c20('0xe'));logger[_0x3c20('0xf')](_0x3c20('0x10'),_0xe22098,_0x3c20('0xe'),JSON[_0x3c20('0x11')](_0x2c6b97));if(_0x2c6b97[_0x3c20('0x12')]){if(_0x2c6b97[_0x3c20('0x12')][_0x3c20('0x13')]===0x1f4){logger[_0x3c20('0x12')](_0x3c20('0xd'),_0xe22098,_0x2c6b97[_0x3c20('0x12')]['message']);return _0x57ae1c(_0x2c6b97[_0x3c20('0x12')][_0x3c20('0x14')]);}logger[_0x3c20('0x12')](_0x3c20('0xd'),_0xe22098,_0x2c6b97[_0x3c20('0x12')][_0x3c20('0x14')]);return _0x5adf30(_0x2c6b97[_0x3c20('0x12')]['message']);}else{logger[_0x3c20('0xc')](_0x3c20('0xd'),_0xe22098,_0x3c20('0xe'));_0x5adf30(_0x2c6b97[_0x3c20('0x15')][_0x3c20('0x14')]);}})['catch'](function(_0x11f5fa){logger['error']('FreshdeskField,\x20%s,\x20%s',_0xe22098,_0x11f5fa);_0x57ae1c(_0x11f5fa);});});}
\ No newline at end of file
index 1fbadda..3a8897b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x53c81a,_0x372d7f){var _0x2e58a7=function(_0x1fd713){while(--_0x1fd713){_0x53c81a['push'](_0x53c81a['shift']());}};_0x2e58a7(++_0x372d7f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x15')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);module[_0x0d8b('0x17')]=router;
\ No newline at end of file
+var _0xd404=['/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show'];(function(_0x351be4,_0x2d1332){var _0x192da5=function(_0x3e0e25){while(--_0x3e0e25){_0x351be4['push'](_0x351be4['shift']());}};_0x192da5(++_0x2d1332);}(_0xd404,0x15b));var _0x4d40=function(_0x53135d,_0x55c4ad){_0x53135d=_0x53135d-0x0;var _0x341912=_0xd404[_0x53135d];return _0x341912;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/:id',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['get'](_0x4d40('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4d40('0x9')](_0x4d40('0xe'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0x11')]);router[_0x4d40('0x10')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x12')]);router[_0x4d40('0x13')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller['update']);router[_0x4d40('0x15')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x16')]);module[_0x4d40('0x17')]=router;
\ No newline at end of file
index deb9f08..8a7222c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf2f=['exports','STRING','remoteUri','sequelize'];(function(_0xfedead,_0x4c573f){var _0x5a0d16=function(_0x86e80b){while(--_0x86e80b){_0xfedead['push'](_0xfedead['shift']());}};_0x5a0d16(++_0x4c573f);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x54b3a7,_0x25e3f9){_0x54b3a7=_0x54b3a7-0x0;var _0x43cf40=_0xcf2f[_0x54b3a7];return _0x43cf40;};'use strict';var Sequelize=require(_0xfcf2('0x0'));module[_0xfcf2('0x1')]={'name':{'type':Sequelize[_0xfcf2('0x2')]},'description':{'type':Sequelize[_0xfcf2('0x2')]},'username':{'type':Sequelize[_0xfcf2('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfcf2('0x2')]},'remoteUri':{'type':Sequelize[_0xfcf2('0x2')],'unique':_0xfcf2('0x3')},'serverUrl':{'type':Sequelize[_0xfcf2('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xfff0=['username','exports','STRING'];(function(_0x588370,_0x4563b9){var _0x1b0dc1=function(_0x2a1689){while(--_0x2a1689){_0x588370['push'](_0x588370['shift']());}};_0x1b0dc1(++_0x4563b9);}(_0xfff0,0x139));var _0x0fff=function(_0x443aa7,_0xebc19c){_0x443aa7=_0x443aa7-0x0;var _0x19b853=_0xfff0[_0x443aa7];return _0x19b853;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')]},'description':{'type':Sequelize[_0x0fff('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x0fff('0x2')},'apiKey':{'type':Sequelize[_0x0fff('0x1')]},'remoteUri':{'type':Sequelize[_0x0fff('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0fff('0x1')],'allowNull':![]}};
\ No newline at end of file
index f692c3f..98b1184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21ab=['/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','offset','count','limit','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','show','params','include','find','catch','create','body','findOne','FreshsalesConfiguration','pick','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','username','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s%s'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x21ab,0x148));var _0xb21a=function(_0x44b057,_0x4f87f2){_0x44b057=_0x44b057-0x0;var _0x440a12=_0x21ab[_0x44b057];return _0x440a12;};'use strict';var emlformat=require(_0xb21a('0x0'));var rimraf=require(_0xb21a('0x1'));var zipdir=require(_0xb21a('0x2'));var jsonpatch=require(_0xb21a('0x3'));var rp=require(_0xb21a('0x4'));var moment=require(_0xb21a('0x5'));var BPromise=require(_0xb21a('0x6'));var Mustache=require(_0xb21a('0x7'));var util=require(_0xb21a('0x8'));var path=require(_0xb21a('0x9'));var sox=require(_0xb21a('0xa'));var csv=require('to-csv');var ejs=require(_0xb21a('0xb'));var fs=require('fs');var fs_extra=require(_0xb21a('0xc'));var _=require(_0xb21a('0xd'));var squel=require(_0xb21a('0xe'));var crypto=require(_0xb21a('0xf'));var jsforce=require(_0xb21a('0x10'));var deskjs=require(_0xb21a('0x11'));var toCsv=require(_0xb21a('0x12'));var querystring=require('querystring');var Papa=require(_0xb21a('0x13'));var Redis=require('ioredis');var authService=require(_0xb21a('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb21a('0x15'));var logger=require('../../config/logger')(_0xb21a('0x16'));var utils=require(_0xb21a('0x17'));var config=require(_0xb21a('0x18'));var licenseUtil=require(_0xb21a('0x19'));var db=require(_0xb21a('0x1a'))['db'];var integrations=require(_0xb21a('0x1b'));function respondWithStatusCode(_0x14c9fb,_0x46b6f1){_0x46b6f1=_0x46b6f1||0xcc;return function(_0x905a80){if(_0x905a80){return _0x14c9fb[_0xb21a('0x1c')](_0x46b6f1);}return _0x14c9fb[_0xb21a('0x1d')](_0x46b6f1)['end']();};}function respondWithResult(_0x50fff4,_0x430784){_0x430784=_0x430784||0xc8;return function(_0x2d2fb1){if(_0x2d2fb1){return _0x50fff4[_0xb21a('0x1d')](_0x430784)[_0xb21a('0x1e')](_0x2d2fb1);}};}function respondWithFilteredResult(_0x4d817d,_0x325a81){return function(_0x2e0bfa){if(_0x2e0bfa){var _0x45088c=typeof _0x325a81['offset']===_0xb21a('0x1f')&&typeof _0x325a81['limit']===_0xb21a('0x1f');var _0x518fee=_0x2e0bfa['count'];var _0x2d3f0c=_0x45088c?0x0:_0x325a81[_0xb21a('0x20')];var _0x3368f6=_0x45088c?_0x2e0bfa[_0xb21a('0x21')]:_0x325a81['offset']+_0x325a81[_0xb21a('0x22')];var _0x192f57;if(_0x3368f6>=_0x518fee){_0x3368f6=_0x518fee;_0x192f57=0xc8;}else{_0x192f57=0xce;}_0x4d817d[_0xb21a('0x1d')](_0x192f57);return _0x4d817d['set'](_0xb21a('0x23'),_0x2d3f0c+'-'+_0x3368f6+'/'+_0x518fee)[_0xb21a('0x1e')](_0x2e0bfa);}return null;};}function patchUpdates(_0x2515c9){return function(_0x300ba5){try{jsonpatch['apply'](_0x300ba5,_0x2515c9,!![]);}catch(_0x55ce6a){return BPromise[_0xb21a('0x24')](_0x55ce6a);}return _0x300ba5[_0xb21a('0x25')]();};}function saveUpdates(_0x2cb424,_0x44cf7c){return function(_0x40decb){if(_0x40decb){return _0x40decb['update'](_0x2cb424)[_0xb21a('0x26')](function(_0x3edaa5){return _0x3edaa5;});}return null;};}function removeEntity(_0x3c2bad,_0x4eaebd){return function(_0x10879f){if(_0x10879f){return _0x10879f[_0xb21a('0x27')]()[_0xb21a('0x26')](function(){_0x3c2bad[_0xb21a('0x1d')](0xcc)[_0xb21a('0x28')]();});}};}function handleEntityNotFound(_0x454f39,_0x48487f){return function(_0x439728){if(!_0x439728){_0x454f39[_0xb21a('0x1c')](0x194);}return _0x439728;};}function handleError(_0x12c653,_0x326c1a){_0x326c1a=_0x326c1a||0x1f4;return function(_0x32a857){logger[_0xb21a('0x29')](_0x32a857[_0xb21a('0x2a')]);if(_0x32a857['name']){delete _0x32a857[_0xb21a('0x2b')];}_0x12c653[_0xb21a('0x1d')](_0x326c1a)[_0xb21a('0x2c')](_0x32a857);};}exports[_0xb21a('0x2d')]=function(_0x19e14a,_0xf24bc0){var _0x1e63aa={},_0x8e1f51={},_0x4a202e={'count':0x0,'rows':[]};var _0x3e440b=_[_0xb21a('0x2e')](db[_0xb21a('0x2f')][_0xb21a('0x30')],function(_0x250a83){return{'name':_0x250a83[_0xb21a('0x31')],'type':_0x250a83[_0xb21a('0x32')][_0xb21a('0x33')]};});_0x8e1f51['model']=_[_0xb21a('0x2e')](_0x3e440b,_0xb21a('0x2b'));_0x8e1f51[_0xb21a('0x34')]=_[_0xb21a('0x35')](_0x19e14a[_0xb21a('0x34')]);_0x8e1f51['filters']=_[_0xb21a('0x36')](_0x8e1f51['model'],_0x8e1f51['query']);_0x1e63aa[_0xb21a('0x37')]=_[_0xb21a('0x36')](_0x8e1f51[_0xb21a('0x38')],qs[_0xb21a('0x39')](_0x19e14a['query'][_0xb21a('0x39')]));_0x1e63aa['attributes']=_0x1e63aa[_0xb21a('0x37')][_0xb21a('0x3a')]?_0x1e63aa['attributes']:_0x8e1f51['model'];if(!_0x19e14a['query'][_0xb21a('0x3b')]('nolimit')){_0x1e63aa[_0xb21a('0x22')]=qs[_0xb21a('0x22')](_0x19e14a[_0xb21a('0x34')][_0xb21a('0x22')]);_0x1e63aa[_0xb21a('0x20')]=qs[_0xb21a('0x20')](_0x19e14a[_0xb21a('0x34')][_0xb21a('0x20')]);}_0x1e63aa[_0xb21a('0x3c')]=qs['sort'](_0x19e14a[_0xb21a('0x34')][_0xb21a('0x3d')]);_0x1e63aa[_0xb21a('0x3e')]=qs['filters'](_['pick'](_0x19e14a[_0xb21a('0x34')],_0x8e1f51[_0xb21a('0x3f')]),_0x3e440b);if(_0x19e14a['query'][_0xb21a('0x40')]){_0x1e63aa[_0xb21a('0x3e')]=_['merge'](_0x1e63aa['where'],{'$or':_[_0xb21a('0x2e')](_0x3e440b,function(_0x1f7229){if(_0x1f7229[_0xb21a('0x32')]!=='VIRTUAL'){var _0x1b09a2={};_0x1b09a2[_0x1f7229['name']]={'$like':'%'+_0x19e14a[_0xb21a('0x34')][_0xb21a('0x40')]+'%'};return _0x1b09a2;}})});}_0x1e63aa=_[_0xb21a('0x41')]({},_0x1e63aa,_0x19e14a[_0xb21a('0x42')]);var _0x37d00a={'where':_0x1e63aa[_0xb21a('0x3e')]};return db[_0xb21a('0x2f')][_0xb21a('0x21')](_0x37d00a)[_0xb21a('0x26')](function(_0x523e4b){_0x4a202e[_0xb21a('0x21')]=_0x523e4b;if(_0x19e14a[_0xb21a('0x34')][_0xb21a('0x43')]){_0x1e63aa['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x1e63aa);})[_0xb21a('0x26')](function(_0x2cb198){_0x4a202e['rows']=_0x2cb198;return _0x4a202e;})['then'](respondWithFilteredResult(_0xf24bc0,_0x1e63aa))['catch'](handleError(_0xf24bc0,null));};exports[_0xb21a('0x44')]=function(_0x546773,_0x56f31b){var _0x4e3df9={'raw':![],'where':{'id':_0x546773[_0xb21a('0x45')]['id']}},_0x47b38d={};_0x47b38d[_0xb21a('0x38')]=_[_0xb21a('0x35')](db[_0xb21a('0x2f')][_0xb21a('0x30')]);_0x47b38d[_0xb21a('0x34')]=_['keys'](_0x546773['query']);_0x47b38d['filters']=_[_0xb21a('0x36')](_0x47b38d[_0xb21a('0x38')],_0x47b38d[_0xb21a('0x34')]);_0x4e3df9[_0xb21a('0x37')]=_[_0xb21a('0x36')](_0x47b38d['model'],qs[_0xb21a('0x39')](_0x546773[_0xb21a('0x34')]['fields']));_0x4e3df9[_0xb21a('0x37')]=_0x4e3df9[_0xb21a('0x37')][_0xb21a('0x3a')]?_0x4e3df9[_0xb21a('0x37')]:_0x47b38d[_0xb21a('0x38')];if(_0x546773[_0xb21a('0x34')][_0xb21a('0x43')]){_0x4e3df9[_0xb21a('0x46')]=[{'all':!![]}];}_0x4e3df9=_[_0xb21a('0x41')]({},_0x4e3df9,_0x546773[_0xb21a('0x42')]);return db[_0xb21a('0x2f')][_0xb21a('0x47')](_0x4e3df9)['then'](handleEntityNotFound(_0x56f31b,null))[_0xb21a('0x26')](respondWithResult(_0x56f31b,null))[_0xb21a('0x48')](handleError(_0x56f31b,null));};exports[_0xb21a('0x49')]=function(_0x20a0f2,_0x41fe3d){return db[_0xb21a('0x2f')][_0xb21a('0x49')](_0x20a0f2[_0xb21a('0x4a')],{})[_0xb21a('0x26')](respondWithResult(_0x41fe3d,0xc9))['catch'](handleError(_0x41fe3d,null));};exports['update']=function(_0x705b05,_0x5ecb25){if(_0x705b05['body']['id']){delete _0x705b05[_0xb21a('0x4a')]['id'];}return db[_0xb21a('0x2f')][_0xb21a('0x47')]({'where':{'id':_0x705b05[_0xb21a('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ecb25,null))['then'](saveUpdates(_0x705b05[_0xb21a('0x4a')],null))['then'](respondWithResult(_0x5ecb25,null))['catch'](handleError(_0x5ecb25,null));};exports['destroy']=function(_0x2e4f40,_0x290fd5){return db['FreshsalesAccount'][_0xb21a('0x47')]({'where':{'id':_0x2e4f40['params']['id']}})['then'](handleEntityNotFound(_0x290fd5,null))['then'](removeEntity(_0x290fd5,null))[_0xb21a('0x48')](handleError(_0x290fd5,null));};exports['getConfigurations']=function(_0x59ff73,_0x420e5d,_0x54072f){var _0x58e280={};var _0x183ad2={};var _0x3f5dea;var _0x173fd9;return db[_0xb21a('0x2f')][_0xb21a('0x4b')]({'where':{'id':_0x59ff73[_0xb21a('0x45')]['id']}})['then'](handleEntityNotFound(_0x420e5d,null))['then'](function(_0x2700e5){if(_0x2700e5){_0x3f5dea=_0x2700e5;_0x183ad2['model']=_[_0xb21a('0x35')](db[_0xb21a('0x4c')]['rawAttributes']);_0x183ad2[_0xb21a('0x34')]=_[_0xb21a('0x35')](_0x59ff73[_0xb21a('0x34')]);_0x183ad2[_0xb21a('0x3f')]=_[_0xb21a('0x36')](_0x183ad2[_0xb21a('0x38')],_0x183ad2[_0xb21a('0x34')]);_0x58e280['attributes']=_[_0xb21a('0x36')](_0x183ad2[_0xb21a('0x38')],qs[_0xb21a('0x39')](_0x59ff73[_0xb21a('0x34')]['fields']));_0x58e280['attributes']=_0x58e280[_0xb21a('0x37')][_0xb21a('0x3a')]?_0x58e280['attributes']:_0x183ad2['model'];_0x58e280[_0xb21a('0x3c')]=qs[_0xb21a('0x3d')](_0x59ff73['query'][_0xb21a('0x3d')]);_0x58e280[_0xb21a('0x3e')]=qs[_0xb21a('0x3f')](_[_0xb21a('0x4d')](_0x59ff73['query'],_0x183ad2[_0xb21a('0x3f')]));if(_0x59ff73['query'][_0xb21a('0x40')]){_0x58e280[_0xb21a('0x3e')]=_['merge'](_0x58e280[_0xb21a('0x3e')],{'$or':_['map'](_0x58e280[_0xb21a('0x37')],function(_0xfd5a23){var _0x2e7b48={};_0x2e7b48[_0xfd5a23]={'$like':'%'+_0x59ff73['query'][_0xb21a('0x40')]+'%'};return _0x2e7b48;})});}_0x58e280=_['merge']({},_0x58e280,_0x59ff73[_0xb21a('0x42')]);return _0x3f5dea[_0xb21a('0x4e')](_0x58e280);}})[_0xb21a('0x26')](function(_0x19580a){if(_0x19580a){_0x173fd9=_0x19580a[_0xb21a('0x3a')];if(!_0x59ff73[_0xb21a('0x34')][_0xb21a('0x3b')](_0xb21a('0x4f'))){_0x58e280[_0xb21a('0x22')]=qs[_0xb21a('0x22')](_0x59ff73['query'][_0xb21a('0x22')]);_0x58e280[_0xb21a('0x20')]=qs[_0xb21a('0x20')](_0x59ff73[_0xb21a('0x34')][_0xb21a('0x20')]);}return _0x3f5dea[_0xb21a('0x4e')](_0x58e280);}})['then'](function(_0x15ae72){if(_0x15ae72){return _0x15ae72?{'count':_0x173fd9,'rows':_0x15ae72}:null;}})[_0xb21a('0x26')](respondWithResult(_0x420e5d,null))['catch'](handleError(_0x420e5d,null));};exports[_0xb21a('0x50')]=function(_0x31b8c1,_0x421f02,_0x51c367){if(_0x31b8c1[_0xb21a('0x4a')]['id']){delete _0x31b8c1['body']['id'];}return db[_0xb21a('0x2f')][_0xb21a('0x4b')]({'where':{'id':_0x31b8c1[_0xb21a('0x45')]['id']}})[_0xb21a('0x26')](handleEntityNotFound(_0x421f02,null))[_0xb21a('0x26')](function(_0x3a4560){if(_0x3a4560){_0x31b8c1[_0xb21a('0x4a')][_0xb21a('0x51')]=_0x3a4560['id'];_0x31b8c1[_0xb21a('0x4a')][_0xb21a('0x52')]=integrations[_0xb21a('0x53')](_0x31b8c1[_0xb21a('0x4a')]['channel'],_0x31b8c1[_0xb21a('0x4a')][_0xb21a('0x32')]);_0x31b8c1[_0xb21a('0x4a')][_0xb21a('0x54')]=integrations[_0xb21a('0x55')](_0x31b8c1['body'][_0xb21a('0x56')],_0x31b8c1[_0xb21a('0x4a')][_0xb21a('0x32')]);return db[_0xb21a('0x4c')][_0xb21a('0x49')](_0x31b8c1[_0xb21a('0x4a')],{'include':[{'model':db[_0xb21a('0x57')],'as':_0xb21a('0x52')},{'model':db[_0xb21a('0x57')],'as':_0xb21a('0x54')}]});}return null;})[_0xb21a('0x26')](respondWithResult(_0x421f02,null))[_0xb21a('0x48')](handleError(_0x421f02,null));};exports['getFields']=function(_0x471064,_0x17b720,_0x494d59){var _0xa2020b='';var _0x13169e='';return db['FreshsalesAccount'][_0xb21a('0x4b')]({'where':{'id':_0x471064[_0xb21a('0x45')]['id']},'attributes':['id',_0xb21a('0x58'),_0xb21a('0x59'),_0xb21a('0x5a')]})['then'](handleEntityNotFound(_0x17b720,null))[_0xb21a('0x26')](function(_0x307a50){if(_0x307a50){_0x13169e=_0x307a50['username'];_0xa2020b=_0x307a50['remoteUri'];var _0x5a36f9=_0x307a50[_0xb21a('0x59')]['slice'](-0x1);if(_0x5a36f9==='/'){_0xa2020b=_0xa2020b[_0xb21a('0x5b')](0x0,_0xa2020b[_0xb21a('0x5c')](_0x5a36f9));}return rp({'method':_0xb21a('0x5d'),'uri':util[_0xb21a('0x5e')](_0xb21a('0x5f'),_0xa2020b,_0xb21a('0x60')),'headers':{'Authorization':_0xb21a('0x61')+_0x307a50[_0xb21a('0x5a')]},'json':!![]});}})[_0xb21a('0x26')](function(_0x18992d){if(_0x18992d){var _0x726283=_0x18992d['users'];var _0x246bcf=![];var _0x5f44d1=null;for(_0x5f44d1=0x0;_0x5f44d1<_0x726283[_0xb21a('0x3a')];_0x5f44d1++){if(_0x726283[_0x5f44d1][_0xb21a('0x62')]===_0x13169e){_0x246bcf=!![];}}if(_0x246bcf){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb21a('0x63')});}}})[_0xb21a('0x26')](respondWithResult(_0x17b720,null))[_0xb21a('0x48')](function(_0x5aea4f){var _0x3fb3f0=_0x471064[_0xb21a('0x34')][_0xb21a('0x64')]?0x1f4:_0x5aea4f[_0xb21a('0x65')]||0x1f4;logger['error'](_0xb21a('0x66'),_0xb21a('0x67'),_0x3fb3f0,JSON[_0xb21a('0x68')](_0x5aea4f));delete _0x5aea4f['name'];if(_0x3fb3f0===0x191){_0x3fb3f0=0x190;}_0x17b720[_0xb21a('0x1d')](_0x3fb3f0)['send'](_0x471064[_0xb21a('0x34')][_0xb21a('0x64')]?{'message':_0xb21a('0x69'),'statusCode':_0x5aea4f[_0xb21a('0x65')]}:_0x5aea4f);});};
\ No newline at end of file
+var _0xd54d=['getSubjects','Descriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','moment','bluebird','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','getConfigurations','findOne','AccountId','Subjects'];(function(_0x142050,_0x170603){var _0xdd75a6=function(_0x34b9c6){while(--_0x34b9c6){_0x142050['push'](_0x142050['shift']());}};_0xdd75a6(++_0x170603);}(_0xd54d,0x19c));var _0xdd54=function(_0x465ed5,_0x3f7019){_0x465ed5=_0x465ed5-0x0;var _0x1ae374=_0xd54d[_0x465ed5];return _0x1ae374;};'use strict';var emlformat=require(_0xdd54('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdd54('0x1'));var BPromise=require(_0xdd54('0x2'));var Mustache=require('mustache');var util=require(_0xdd54('0x3'));var path=require('path');var sox=require(_0xdd54('0x4'));var csv=require(_0xdd54('0x5'));var ejs=require(_0xdd54('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd54('0x7'));var crypto=require('crypto');var jsforce=require(_0xdd54('0x8'));var deskjs=require(_0xdd54('0x9'));var toCsv=require('to-csv');var querystring=require(_0xdd54('0xa'));var Papa=require(_0xdd54('0xb'));var Redis=require('ioredis');var authService=require(_0xdd54('0xc'));var qs=require(_0xdd54('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd54('0xe'));var logger=require(_0xdd54('0xf'))(_0xdd54('0x10'));var utils=require(_0xdd54('0x11'));var config=require(_0xdd54('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd54('0x13'))['db'];var integrations=require(_0xdd54('0x14'));function respondWithStatusCode(_0x12a5e4,_0x1e1888){_0x1e1888=_0x1e1888||0xcc;return function(_0x5c5a2e){if(_0x5c5a2e){return _0x12a5e4[_0xdd54('0x15')](_0x1e1888);}return _0x12a5e4[_0xdd54('0x16')](_0x1e1888)[_0xdd54('0x17')]();};}function respondWithResult(_0x38f4a9,_0x1d3bfc){_0x1d3bfc=_0x1d3bfc||0xc8;return function(_0x21bc98){if(_0x21bc98){return _0x38f4a9['status'](_0x1d3bfc)['json'](_0x21bc98);}};}function respondWithFilteredResult(_0x261af7,_0x4f19b6){return function(_0x159ebf){if(_0x159ebf){var _0x38db13=typeof _0x4f19b6[_0xdd54('0x18')]==='undefined'&&typeof _0x4f19b6[_0xdd54('0x19')]===_0xdd54('0x1a');var _0x253d61=_0x159ebf[_0xdd54('0x1b')];var _0x5b5ab4=_0x38db13?0x0:_0x4f19b6[_0xdd54('0x18')];var _0x380857=_0x38db13?_0x159ebf[_0xdd54('0x1b')]:_0x4f19b6['offset']+_0x4f19b6[_0xdd54('0x19')];var _0x1684c1;if(_0x380857>=_0x253d61){_0x380857=_0x253d61;_0x1684c1=0xc8;}else{_0x1684c1=0xce;}_0x261af7[_0xdd54('0x16')](_0x1684c1);return _0x261af7[_0xdd54('0x1c')](_0xdd54('0x1d'),_0x5b5ab4+'-'+_0x380857+'/'+_0x253d61)[_0xdd54('0x1e')](_0x159ebf);}return null;};}function patchUpdates(_0x5e7e25){return function(_0x509a08){try{jsonpatch[_0xdd54('0x1f')](_0x509a08,_0x5e7e25,!![]);}catch(_0x2e7b5a){return BPromise[_0xdd54('0x20')](_0x2e7b5a);}return _0x509a08[_0xdd54('0x21')]();};}function saveUpdates(_0x40f024,_0x3b3ead){return function(_0xa2209c){if(_0xa2209c){return _0xa2209c[_0xdd54('0x22')](_0x40f024)[_0xdd54('0x23')](function(_0x58c9e7){return _0x58c9e7;});}return null;};}function removeEntity(_0x1ba5c3,_0x355ee6){return function(_0x46d30a){if(_0x46d30a){return _0x46d30a[_0xdd54('0x24')]()[_0xdd54('0x23')](function(){_0x1ba5c3['status'](0xcc)[_0xdd54('0x17')]();});}};}function handleEntityNotFound(_0x5991a9,_0x2f7bed){return function(_0x5894c4){if(!_0x5894c4){_0x5991a9['sendStatus'](0x194);}return _0x5894c4;};}function handleError(_0x3de040,_0x299af3){_0x299af3=_0x299af3||0x1f4;return function(_0x32ff5c){logger[_0xdd54('0x25')](_0x32ff5c[_0xdd54('0x26')]);if(_0x32ff5c['name']){delete _0x32ff5c[_0xdd54('0x27')];}_0x3de040[_0xdd54('0x16')](_0x299af3)[_0xdd54('0x28')](_0x32ff5c);};}exports[_0xdd54('0x29')]=function(_0x12356d,_0x13abb2){var _0x23db83={},_0x5452e3={},_0x111353={'count':0x0,'rows':[]};var _0x497a40=_[_0xdd54('0x2a')](db[_0xdd54('0x2b')][_0xdd54('0x2c')],function(_0xbabc99){return{'name':_0xbabc99[_0xdd54('0x2d')],'type':_0xbabc99[_0xdd54('0x2e')]['key']};});_0x5452e3[_0xdd54('0x2f')]=_[_0xdd54('0x2a')](_0x497a40,_0xdd54('0x27'));_0x5452e3[_0xdd54('0x30')]=_['keys'](_0x12356d[_0xdd54('0x30')]);_0x5452e3[_0xdd54('0x31')]=_['intersection'](_0x5452e3['model'],_0x5452e3[_0xdd54('0x30')]);_0x23db83[_0xdd54('0x32')]=_[_0xdd54('0x33')](_0x5452e3[_0xdd54('0x2f')],qs[_0xdd54('0x34')](_0x12356d[_0xdd54('0x30')][_0xdd54('0x34')]));_0x23db83[_0xdd54('0x32')]=_0x23db83[_0xdd54('0x32')][_0xdd54('0x35')]?_0x23db83[_0xdd54('0x32')]:_0x5452e3[_0xdd54('0x2f')];if(!_0x12356d[_0xdd54('0x30')][_0xdd54('0x36')](_0xdd54('0x37'))){_0x23db83['limit']=qs[_0xdd54('0x19')](_0x12356d[_0xdd54('0x30')][_0xdd54('0x19')]);_0x23db83['offset']=qs[_0xdd54('0x18')](_0x12356d[_0xdd54('0x30')][_0xdd54('0x18')]);}_0x23db83[_0xdd54('0x38')]=qs[_0xdd54('0x39')](_0x12356d[_0xdd54('0x30')]['sort']);_0x23db83[_0xdd54('0x3a')]=qs[_0xdd54('0x31')](_[_0xdd54('0x3b')](_0x12356d[_0xdd54('0x30')],_0x5452e3[_0xdd54('0x31')]),_0x497a40);if(_0x12356d['query'][_0xdd54('0x3c')]){_0x23db83[_0xdd54('0x3a')]=_[_0xdd54('0x3d')](_0x23db83[_0xdd54('0x3a')],{'$or':_[_0xdd54('0x2a')](_0x497a40,function(_0x3a01fb){if(_0x3a01fb[_0xdd54('0x2e')]!==_0xdd54('0x3e')){var _0x40fe68={};_0x40fe68[_0x3a01fb[_0xdd54('0x27')]]={'$like':'%'+_0x12356d[_0xdd54('0x30')][_0xdd54('0x3c')]+'%'};return _0x40fe68;}})});}_0x23db83=_[_0xdd54('0x3d')]({},_0x23db83,_0x12356d['options']);var _0x42cc83={'where':_0x23db83[_0xdd54('0x3a')]};return db[_0xdd54('0x2b')][_0xdd54('0x1b')](_0x42cc83)[_0xdd54('0x23')](function(_0x235380){_0x111353['count']=_0x235380;if(_0x12356d[_0xdd54('0x30')][_0xdd54('0x3f')]){_0x23db83[_0xdd54('0x40')]=[{'all':!![]}];}return db[_0xdd54('0x2b')][_0xdd54('0x41')](_0x23db83);})[_0xdd54('0x23')](function(_0x20927f){_0x111353[_0xdd54('0x42')]=_0x20927f;return _0x111353;})[_0xdd54('0x23')](respondWithFilteredResult(_0x13abb2,_0x23db83))[_0xdd54('0x43')](handleError(_0x13abb2,null));};exports[_0xdd54('0x44')]=function(_0x49d77c,_0x40aac4){var _0x3ccb74={'raw':![],'where':{'id':_0x49d77c['params']['id']}},_0x745ef={};_0x745ef[_0xdd54('0x2f')]=_['keys'](db[_0xdd54('0x2b')][_0xdd54('0x2c')]);_0x745ef[_0xdd54('0x30')]=_[_0xdd54('0x45')](_0x49d77c[_0xdd54('0x30')]);_0x745ef['filters']=_[_0xdd54('0x33')](_0x745ef[_0xdd54('0x2f')],_0x745ef[_0xdd54('0x30')]);_0x3ccb74[_0xdd54('0x32')]=_[_0xdd54('0x33')](_0x745ef['model'],qs[_0xdd54('0x34')](_0x49d77c[_0xdd54('0x30')]['fields']));_0x3ccb74['attributes']=_0x3ccb74[_0xdd54('0x32')]['length']?_0x3ccb74[_0xdd54('0x32')]:_0x745ef[_0xdd54('0x2f')];if(_0x49d77c[_0xdd54('0x30')][_0xdd54('0x3f')]){_0x3ccb74[_0xdd54('0x40')]=[{'all':!![]}];}_0x3ccb74=_[_0xdd54('0x3d')]({},_0x3ccb74,_0x49d77c['options']);return db[_0xdd54('0x2b')]['find'](_0x3ccb74)[_0xdd54('0x23')](handleEntityNotFound(_0x40aac4,null))[_0xdd54('0x23')](respondWithResult(_0x40aac4,null))['catch'](handleError(_0x40aac4,null));};exports[_0xdd54('0x46')]=function(_0x16acbd,_0x2395ae){return db[_0xdd54('0x2b')][_0xdd54('0x46')](_0x16acbd[_0xdd54('0x47')],{})[_0xdd54('0x23')](respondWithResult(_0x2395ae,0xc9))[_0xdd54('0x43')](handleError(_0x2395ae,null));};exports['update']=function(_0x5f0299,_0x148066){if(_0x5f0299[_0xdd54('0x47')]['id']){delete _0x5f0299[_0xdd54('0x47')]['id'];}return db[_0xdd54('0x2b')][_0xdd54('0x48')]({'where':{'id':_0x5f0299[_0xdd54('0x49')]['id']}})[_0xdd54('0x23')](handleEntityNotFound(_0x148066,null))[_0xdd54('0x23')](saveUpdates(_0x5f0299[_0xdd54('0x47')],null))[_0xdd54('0x23')](respondWithResult(_0x148066,null))[_0xdd54('0x43')](handleError(_0x148066,null));};exports[_0xdd54('0x24')]=function(_0x47026f,_0xb43e0d){return db[_0xdd54('0x2b')]['find']({'where':{'id':_0x47026f['params']['id']}})['then'](handleEntityNotFound(_0xb43e0d,null))[_0xdd54('0x23')](removeEntity(_0xb43e0d,null))[_0xdd54('0x43')](handleError(_0xb43e0d,null));};exports[_0xdd54('0x4a')]=function(_0x3922ea,_0x3a31b3,_0x3a3c9d){var _0x3d19e3={};var _0x18d1a8={};var _0x3ac383;var _0x464644;return db[_0xdd54('0x2b')][_0xdd54('0x4b')]({'where':{'id':_0x3922ea[_0xdd54('0x49')]['id']}})[_0xdd54('0x23')](handleEntityNotFound(_0x3a31b3,null))['then'](function(_0xd832a4){if(_0xd832a4){_0x3ac383=_0xd832a4;_0x18d1a8['model']=_[_0xdd54('0x45')](db['FreshsalesConfiguration'][_0xdd54('0x2c')]);_0x18d1a8[_0xdd54('0x30')]=_['keys'](_0x3922ea[_0xdd54('0x30')]);_0x18d1a8[_0xdd54('0x31')]=_[_0xdd54('0x33')](_0x18d1a8[_0xdd54('0x2f')],_0x18d1a8['query']);_0x3d19e3['attributes']=_[_0xdd54('0x33')](_0x18d1a8['model'],qs[_0xdd54('0x34')](_0x3922ea[_0xdd54('0x30')][_0xdd54('0x34')]));_0x3d19e3[_0xdd54('0x32')]=_0x3d19e3[_0xdd54('0x32')]['length']?_0x3d19e3[_0xdd54('0x32')]:_0x18d1a8[_0xdd54('0x2f')];_0x3d19e3[_0xdd54('0x38')]=qs[_0xdd54('0x39')](_0x3922ea[_0xdd54('0x30')][_0xdd54('0x39')]);_0x3d19e3[_0xdd54('0x3a')]=qs[_0xdd54('0x31')](_[_0xdd54('0x3b')](_0x3922ea[_0xdd54('0x30')],_0x18d1a8['filters']));if(_0x3922ea[_0xdd54('0x30')][_0xdd54('0x3c')]){_0x3d19e3[_0xdd54('0x3a')]=_[_0xdd54('0x3d')](_0x3d19e3[_0xdd54('0x3a')],{'$or':_[_0xdd54('0x2a')](_0x3d19e3['attributes'],function(_0x2abc83){var _0xb518ec={};_0xb518ec[_0x2abc83]={'$like':'%'+_0x3922ea[_0xdd54('0x30')][_0xdd54('0x3c')]+'%'};return _0xb518ec;})});}_0x3d19e3=_[_0xdd54('0x3d')]({},_0x3d19e3,_0x3922ea['options']);return _0x3ac383[_0xdd54('0x4a')](_0x3d19e3);}})[_0xdd54('0x23')](function(_0x26d42a){if(_0x26d42a){_0x464644=_0x26d42a[_0xdd54('0x35')];if(!_0x3922ea[_0xdd54('0x30')][_0xdd54('0x36')](_0xdd54('0x37'))){_0x3d19e3[_0xdd54('0x19')]=qs[_0xdd54('0x19')](_0x3922ea[_0xdd54('0x30')]['limit']);_0x3d19e3[_0xdd54('0x18')]=qs[_0xdd54('0x18')](_0x3922ea[_0xdd54('0x30')]['offset']);}return _0x3ac383[_0xdd54('0x4a')](_0x3d19e3);}})[_0xdd54('0x23')](function(_0x259e20){if(_0x259e20){return _0x259e20?{'count':_0x464644,'rows':_0x259e20}:null;}})[_0xdd54('0x23')](respondWithResult(_0x3a31b3,null))['catch'](handleError(_0x3a31b3,null));};exports['addConfiguration']=function(_0x5ab624,_0x2bd334,_0x553181){if(_0x5ab624[_0xdd54('0x47')]['id']){delete _0x5ab624[_0xdd54('0x47')]['id'];}return db[_0xdd54('0x2b')][_0xdd54('0x4b')]({'where':{'id':_0x5ab624[_0xdd54('0x49')]['id']}})[_0xdd54('0x23')](handleEntityNotFound(_0x2bd334,null))['then'](function(_0x52af98){if(_0x52af98){_0x5ab624[_0xdd54('0x47')][_0xdd54('0x4c')]=_0x52af98['id'];_0x5ab624[_0xdd54('0x47')][_0xdd54('0x4d')]=integrations[_0xdd54('0x4e')](_0x5ab624[_0xdd54('0x47')]['channel'],_0x5ab624[_0xdd54('0x47')][_0xdd54('0x2e')]);_0x5ab624[_0xdd54('0x47')][_0xdd54('0x4f')]=integrations['getDescriptions'](_0x5ab624[_0xdd54('0x47')]['channel'],_0x5ab624[_0xdd54('0x47')][_0xdd54('0x2e')]);return db[_0xdd54('0x50')][_0xdd54('0x46')](_0x5ab624[_0xdd54('0x47')],{'include':[{'model':db[_0xdd54('0x51')],'as':'Subjects'},{'model':db[_0xdd54('0x51')],'as':_0xdd54('0x4f')}]});}return null;})[_0xdd54('0x23')](respondWithResult(_0x2bd334,null))[_0xdd54('0x43')](handleError(_0x2bd334,null));};exports[_0xdd54('0x52')]=function(_0x11d0ad,_0x5ef513,_0x1cef9e){var _0x4e1a57='';var _0x158df4='';return db[_0xdd54('0x2b')][_0xdd54('0x4b')]({'where':{'id':_0x11d0ad[_0xdd54('0x49')]['id']},'attributes':['id',_0xdd54('0x53'),_0xdd54('0x54'),_0xdd54('0x55')]})[_0xdd54('0x23')](handleEntityNotFound(_0x5ef513,null))[_0xdd54('0x23')](function(_0x53f860){if(_0x53f860){_0x158df4=_0x53f860[_0xdd54('0x53')];_0x4e1a57=_0x53f860[_0xdd54('0x54')];var _0x29eced=_0x53f860[_0xdd54('0x54')][_0xdd54('0x56')](-0x1);if(_0x29eced==='/'){_0x4e1a57=_0x4e1a57['substring'](0x0,_0x4e1a57[_0xdd54('0x57')](_0x29eced));}return rp({'method':'GET','uri':util[_0xdd54('0x58')](_0xdd54('0x59'),_0x4e1a57,_0xdd54('0x5a')),'headers':{'Authorization':_0xdd54('0x5b')+_0x53f860['apiKey']},'json':!![]});}})[_0xdd54('0x23')](function(_0x36e905){if(_0x36e905){var _0x2a97c1=_0x36e905['users'];var _0x588867=![];var _0x5e7200=null;for(_0x5e7200=0x0;_0x5e7200<_0x2a97c1[_0xdd54('0x35')];_0x5e7200++){if(_0x2a97c1[_0x5e7200][_0xdd54('0x5c')]===_0x158df4){_0x588867=!![];}}if(_0x588867){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xdd54('0x5d')});}}})[_0xdd54('0x23')](respondWithResult(_0x5ef513,null))['catch'](function(_0x35b5b1){var _0x343366=_0x11d0ad[_0xdd54('0x30')][_0xdd54('0x5e')]?0x1f4:_0x35b5b1[_0xdd54('0x5f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xdd54('0x52'),_0x343366,JSON[_0xdd54('0x60')](_0x35b5b1));delete _0x35b5b1[_0xdd54('0x27')];if(_0x343366===0x191){_0x343366=0x190;}_0x5ef513[_0xdd54('0x16')](_0x343366)[_0xdd54('0x28')](_0x11d0ad[_0xdd54('0x30')][_0xdd54('0x5e')]?{'message':_0xdd54('0x61'),'statusCode':_0x35b5b1[_0xdd54('0x5f')]}:_0x35b5b1);});};
\ No newline at end of file
index b00ee2f..ca84675 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x37f8b9,_0x110744){var _0x4a2a0c=function(_0x23ded4){while(--_0x23ded4){_0x37f8b9['push'](_0x37f8b9['shift']());}};_0x4a2a0c(++_0x110744);}(_0xba34,0x119));var _0x4ba3=function(_0x5e9ae3,_0x5d8148){_0x5e9ae3=_0x5e9ae3-0x0;var _0x4c0d2b=_0xba34[_0x5e9ae3];return _0x4c0d2b;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xba34=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x31fec5,_0x304549){var _0x287812=function(_0x5a16b3){while(--_0x5a16b3){_0x31fec5['push'](_0x31fec5['shift']());}};_0x287812(++_0x304549);}(_0xba34,0x119));var _0x4ba3=function(_0x341d7d,_0x4be969){_0x341d7d=_0x341d7d-0x0;var _0x3e8b48=_0xba34[_0x341d7d];return _0x3e8b48;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c775527..b3e47ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa456=['message','result','GetFreshsalesAccount','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x50d548,_0x1925f7){var _0x557926=function(_0x2862e6){while(--_0x2862e6){_0x50d548['push'](_0x50d548['shift']());}};_0x557926(++_0x1925f7);}(_0xa456,0x142));var _0x6a45=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xa456[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});}exports[_0x6a45('0x14')]=function(_0x52a055){var _0x379c22=this;return new Promise(function(_0x102981,_0x3439c8){return db['FreshsalesAccount']['findAll']({'raw':_0x52a055['options']?_0x52a055[_0x6a45('0x15')][_0x6a45('0x16')]===undefined?!![]:![]:!![],'where':_0x52a055['options']?_0x52a055[_0x6a45('0x15')][_0x6a45('0x17')]||null:null,'attributes':_0x52a055['options']?_0x52a055[_0x6a45('0x15')][_0x6a45('0x18')]||null:null,'limit':_0x52a055[_0x6a45('0x15')]?_0x52a055[_0x6a45('0x15')][_0x6a45('0x19')]||null:null,'include':_0x52a055['options']?_0x52a055['options'][_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x52a055[_0x6a45('0x15')][_0x6a45('0x1a')],function(_0x25a380){return{'model':db[_0x25a380[_0x6a45('0x1c')]],'as':_0x25a380['as'],'attributes':_0x25a380[_0x6a45('0x18')],'include':_0x25a380[_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x25a380[_0x6a45('0x1a')],function(_0x1310d7){return{'model':db[_0x1310d7[_0x6a45('0x1c')]],'as':_0x1310d7['as'],'attributes':_0x1310d7['attributes'],'include':_0x1310d7[_0x6a45('0x1a')]?_['map'](_0x1310d7[_0x6a45('0x1a')],function(_0x25467d){return{'model':db[_0x25467d[_0x6a45('0x1c')]],'as':_0x25467d['as'],'attributes':_0x25467d[_0x6a45('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6a45('0xb')](function(_0x526062){logger[_0x6a45('0xc')](_0x6a45('0x14'),_0x52a055);logger[_0x6a45('0xf')](_0x6a45('0x14'),_0x52a055,JSON[_0x6a45('0x1d')](_0x526062));_0x102981(_0x526062);})[_0x6a45('0x1e')](function(_0x3fac9b){logger[_0x6a45('0x11')]('GetFreshsalesAccount',_0x3fac9b[_0x6a45('0x12')],_0x52a055);_0x3439c8(_0x379c22[_0x6a45('0x11')](0x1f4,_0x3fac9b[_0x6a45('0x12')]));});});};exports[_0x6a45('0x1f')]=function(_0x3b07a1){var _0x5dc288=this;return new Promise(function(_0x1f95d4,_0x1f96bf){return db[_0x6a45('0x20')][_0x6a45('0x21')]({'raw':_0x3b07a1['options']?_0x3b07a1['options'][_0x6a45('0x16')]===undefined?!![]:![]:!![],'where':_0x3b07a1['options']?_0x3b07a1[_0x6a45('0x15')]['where']||null:null,'attributes':_0x3b07a1[_0x6a45('0x15')]?_0x3b07a1[_0x6a45('0x15')][_0x6a45('0x18')]||null:null,'include':_0x3b07a1[_0x6a45('0x15')]?_0x3b07a1[_0x6a45('0x15')][_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x3b07a1[_0x6a45('0x15')][_0x6a45('0x1a')],function(_0x36f4a4){return{'model':db[_0x36f4a4[_0x6a45('0x1c')]],'as':_0x36f4a4['as'],'attributes':_0x36f4a4[_0x6a45('0x18')],'include':_0x36f4a4[_0x6a45('0x1a')]?_['map'](_0x36f4a4[_0x6a45('0x1a')],function(_0x4ae2ac){return{'model':db[_0x4ae2ac[_0x6a45('0x1c')]],'as':_0x4ae2ac['as'],'attributes':_0x4ae2ac[_0x6a45('0x18')],'include':_0x4ae2ac[_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x4ae2ac[_0x6a45('0x1a')],function(_0x2199c1){return{'model':db[_0x2199c1['model']],'as':_0x2199c1['as'],'attributes':_0x2199c1[_0x6a45('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6a45('0xb')](function(_0x2b75f6){logger[_0x6a45('0xc')](_0x6a45('0x1f'),_0x3b07a1);logger[_0x6a45('0xf')]('ShowFreshsalesAccount',_0x3b07a1,JSON[_0x6a45('0x1d')](_0x2b75f6));_0x1f95d4(_0x2b75f6);})[_0x6a45('0x1e')](function(_0x5c76bd){logger[_0x6a45('0x11')](_0x6a45('0x1f'),_0x5c76bd[_0x6a45('0x12')],_0x3b07a1);_0x1f96bf(_0x5dc288[_0x6a45('0x11')](0x1f4,_0x5c76bd[_0x6a45('0x12')]));});});};
\ No newline at end of file
+var _0x2ef3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','include','model','map','attributes','ShowFreshsalesAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5c8aee,_0x21dde0){var _0x103636=function(_0x1a613c){while(--_0x1a613c){_0x5c8aee['push'](_0x5c8aee['shift']());}};_0x103636(++_0x21dde0);}(_0x2ef3,0xba));var _0x32ef=function(_0x4fbcd6,_0x5c5af8){_0x4fbcd6=_0x4fbcd6-0x0;var _0x1ec52e=_0x2ef3[_0x4fbcd6];return _0x1ec52e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['findAll']({'raw':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x19')]||null:null,'attributes':_0x1a9476['options']?_0x1a9476[_0x32ef('0x17')]['attributes']||null:null,'limit':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')]['limit']||null:null,'include':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x1a')]?_['map'](_0x1a9476['options'][_0x32ef('0x1a')],function(_0xb30fab){return{'model':db[_0xb30fab[_0x32ef('0x1b')]],'as':_0xb30fab['as'],'attributes':_0xb30fab['attributes'],'include':_0xb30fab['include']?_[_0x32ef('0x1c')](_0xb30fab['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1b')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1d')],'include':_0x51a412[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x51a412[_0x32ef('0x1a')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1b')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x2f52d7){logger[_0x32ef('0xc')](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x2f52d7));_0x57863c(_0x2f52d7);})['catch'](function(_0x12de1a){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x12de1a[_0x32ef('0x13')],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x12de1a[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1e')]=function(_0x31dbc3){var _0x2ac686=this;return new Promise(function(_0x1b668a,_0x1a6ed2){return db[_0x32ef('0x16')]['find']({'raw':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x19')]||null:null,'attributes':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3[_0x32ef('0x17')][_0x32ef('0x1d')]||null:null,'include':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options']['include']?_[_0x32ef('0x1c')](_0x31dbc3['options'][_0x32ef('0x1a')],function(_0x15b873){return{'model':db[_0x15b873[_0x32ef('0x1b')]],'as':_0x15b873['as'],'attributes':_0x15b873[_0x32ef('0x1d')],'include':_0x15b873[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x15b873['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1d')],'include':_0x482d3a[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1b')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x480348){logger['info'](_0x32ef('0x1e'),_0x31dbc3);logger[_0x32ef('0x1f')](_0x32ef('0x1e'),_0x31dbc3,JSON[_0x32ef('0x10')](_0x480348));_0x1b668a(_0x480348);})[_0x32ef('0x14')](function(_0x211c79){logger[_0x32ef('0x11')](_0x32ef('0x1e'),_0x211c79[_0x32ef('0x13')],_0x31dbc3);_0x1a6ed2(_0x2ac686['error'](0x1f4,_0x211c79[_0x32ef('0x13')]));});});};
\ No newline at end of file
index 8786c47..697ce6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc23b=['/:id/descriptions','getDescriptions','/:id/fields','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects'];(function(_0x1bc651,_0xb0db8f){var _0x43cdb1=function(_0xa56a46){while(--_0xa56a46){_0x1bc651['push'](_0x1bc651['shift']());}};_0x43cdb1(++_0xb0db8f);}(_0xc23b,0x157));var _0xbc23=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0xc23b[_0x56c70f];return _0x3812ed;};'use strict';var multer=require(_0xbc23('0x0'));var util=require(_0xbc23('0x1'));var path=require(_0xbc23('0x2'));var timeout=require(_0xbc23('0x3'));var express=require(_0xbc23('0x4'));var router=express[_0xbc23('0x5')]();var fs_extra=require(_0xbc23('0x6'));var auth=require(_0xbc23('0x7'));var interaction=require(_0xbc23('0x8'));var config=require(_0xbc23('0x9'));var controller=require(_0xbc23('0xa'));router[_0xbc23('0xb')]('/',auth[_0xbc23('0xc')](),controller[_0xbc23('0xd')]);router['get']('/:id',auth[_0xbc23('0xc')](),controller[_0xbc23('0xe')]);router[_0xbc23('0xb')](_0xbc23('0xf'),auth[_0xbc23('0xc')](),controller[_0xbc23('0x10')]);router['get'](_0xbc23('0x11'),auth[_0xbc23('0xc')](),controller[_0xbc23('0x12')]);router['get'](_0xbc23('0x13'),auth[_0xbc23('0xc')](),controller['getFields']);router['post']('/',auth[_0xbc23('0xc')](),controller[_0xbc23('0x14')]);router[_0xbc23('0x15')](_0xbc23('0x16'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbc23('0x16'),auth['isAuthenticated'](),controller['destroy']);module[_0xbc23('0x17')]=router;
\ No newline at end of file
+var _0xdac5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','show','/:id/subjects','getSubjects','/:id/descriptions','isAuthenticated','/:id/fields','getFields','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdac5,0x175));var _0x5dac=function(_0x49aad6,_0x4438ba){_0x49aad6=_0x49aad6-0x0;var _0xba129c=_0xdac5[_0x49aad6];return _0xba129c;};'use strict';var multer=require(_0x5dac('0x0'));var util=require(_0x5dac('0x1'));var path=require('path');var timeout=require(_0x5dac('0x2'));var express=require(_0x5dac('0x3'));var router=express[_0x5dac('0x4')]();var fs_extra=require(_0x5dac('0x5'));var auth=require(_0x5dac('0x6'));var interaction=require(_0x5dac('0x7'));var config=require(_0x5dac('0x8'));var controller=require(_0x5dac('0x9'));router[_0x5dac('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5dac('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5dac('0xb')]);router[_0x5dac('0xa')](_0x5dac('0xc'),auth['isAuthenticated'](),controller[_0x5dac('0xd')]);router[_0x5dac('0xa')](_0x5dac('0xe'),auth[_0x5dac('0xf')](),controller['getDescriptions']);router[_0x5dac('0xa')](_0x5dac('0x10'),auth['isAuthenticated'](),controller[_0x5dac('0x11')]);router['post']('/',auth[_0x5dac('0xf')](),controller[_0x5dac('0x12')]);router[_0x5dac('0x13')](_0x5dac('0x14'),auth[_0x5dac('0xf')](),controller[_0x5dac('0x15')]);router[_0x5dac('0x16')](_0x5dac('0x14'),auth['isAuthenticated'](),controller[_0x5dac('0x17')]);module[_0x5dac('0x18')]=router;
\ No newline at end of file
index 82edbcf..a88b635 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e9a=['exports','STRING','sequelize'];(function(_0x287059,_0x499940){var _0x225c79=function(_0x3aa36e){while(--_0x3aa36e){_0x287059['push'](_0x287059['shift']());}};_0x225c79(++_0x499940);}(_0x7e9a,0x1f4));var _0xa7e9=function(_0x465aab,_0x275380){_0x465aab=_0x465aab-0x0;var _0x3a4c32=_0x7e9a[_0x465aab];return _0x3a4c32;};'use strict';var Sequelize=require(_0xa7e9('0x0'));module[_0xa7e9('0x1')]={'name':{'type':Sequelize[_0xa7e9('0x2')]},'description':{'type':Sequelize[_0xa7e9('0x2')]}};
\ No newline at end of file
+var _0x3e82=['STRING','sequelize','exports'];(function(_0x2683e3,_0x1db0bc){var _0x28d7ba=function(_0x2b9811){while(--_0x2b9811){_0x2683e3['push'](_0x2683e3['shift']());}};_0x28d7ba(++_0x1db0bc);}(_0x3e82,0x1c6));var _0x23e8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3e82[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x23e8('0x0'));module[_0x23e8('0x1')]={'name':{'type':Sequelize[_0x23e8('0x2')]},'description':{'type':Sequelize[_0x23e8('0x2')]}};
\ No newline at end of file
index 3b6800b..4ffd566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e44=['model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','options','find','create','body','params','getSubjects','findOne','rawAttributes','nolimit','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','destroy','then','stack','name','send','index','FreshsalesConfiguration','type'];(function(_0x485ff7,_0x28a723){var _0x3d3488=function(_0x56c7be){while(--_0x56c7be){_0x485ff7['push'](_0x485ff7['shift']());}};_0x3d3488(++_0x28a723);}(_0x3e44,0x152));var _0x43e4=function(_0x565dc5,_0x1391a0){_0x565dc5=_0x565dc5-0x0;var _0x3e4967=_0x3e44[_0x565dc5];return _0x3e4967;};'use strict';var emlformat=require(_0x43e4('0x0'));var rimraf=require(_0x43e4('0x1'));var zipdir=require(_0x43e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43e4('0x3'));var moment=require(_0x43e4('0x4'));var BPromise=require(_0x43e4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x43e4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43e4('0x7'));var _=require(_0x43e4('0x8'));var squel=require(_0x43e4('0x9'));var crypto=require(_0x43e4('0xa'));var jsforce=require(_0x43e4('0xb'));var deskjs=require(_0x43e4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x43e4('0xd'));var Redis=require(_0x43e4('0xe'));var authService=require(_0x43e4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x43e4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e4('0x11'))(_0x43e4('0x12'));var utils=require(_0x43e4('0x13'));var config=require(_0x43e4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e4('0x15'))['db'];function respondWithStatusCode(_0x5d4412,_0x5b5c13){_0x5b5c13=_0x5b5c13||0xcc;return function(_0x1ce609){if(_0x1ce609){return _0x5d4412[_0x43e4('0x16')](_0x5b5c13);}return _0x5d4412[_0x43e4('0x17')](_0x5b5c13)[_0x43e4('0x18')]();};}function respondWithResult(_0x49c7a4,_0xe237a){_0xe237a=_0xe237a||0xc8;return function(_0x56ff20){if(_0x56ff20){return _0x49c7a4['status'](_0xe237a)[_0x43e4('0x19')](_0x56ff20);}};}function respondWithFilteredResult(_0x115a5f,_0x4298f7){return function(_0x5893b1){if(_0x5893b1){var _0x577bef=typeof _0x4298f7['offset']===_0x43e4('0x1a')&&typeof _0x4298f7[_0x43e4('0x1b')]===_0x43e4('0x1a');var _0x5ed8f7=_0x5893b1[_0x43e4('0x1c')];var _0x2055c8=_0x577bef?0x0:_0x4298f7[_0x43e4('0x1d')];var _0x2e6718=_0x577bef?_0x5893b1[_0x43e4('0x1c')]:_0x4298f7['offset']+_0x4298f7[_0x43e4('0x1b')];var _0x28e05e;if(_0x2e6718>=_0x5ed8f7){_0x2e6718=_0x5ed8f7;_0x28e05e=0xc8;}else{_0x28e05e=0xce;}_0x115a5f[_0x43e4('0x17')](_0x28e05e);return _0x115a5f[_0x43e4('0x1e')]('Content-Range',_0x2055c8+'-'+_0x2e6718+'/'+_0x5ed8f7)['json'](_0x5893b1);}return null;};}function patchUpdates(_0x53927c){return function(_0x403624){try{jsonpatch[_0x43e4('0x1f')](_0x403624,_0x53927c,!![]);}catch(_0x563fe6){return BPromise[_0x43e4('0x20')](_0x563fe6);}return _0x403624['save']();};}function saveUpdates(_0x2a7497,_0x58b4fa){return function(_0x2f4e2c){if(_0x2f4e2c){return _0x2f4e2c[_0x43e4('0x21')](_0x2a7497)['then'](function(_0x2e4f3d){return _0x2e4f3d;});}return null;};}function removeEntity(_0x3bee5c,_0x43093e){return function(_0x3195e3){if(_0x3195e3){return _0x3195e3[_0x43e4('0x22')]()[_0x43e4('0x23')](function(){_0x3bee5c['status'](0xcc)[_0x43e4('0x18')]();});}};}function handleEntityNotFound(_0x1368b7,_0x35e2d4){return function(_0x2189cc){if(!_0x2189cc){_0x1368b7[_0x43e4('0x16')](0x194);}return _0x2189cc;};}function handleError(_0x4d2bef,_0x3ef0d4){_0x3ef0d4=_0x3ef0d4||0x1f4;return function(_0x6db962){logger['error'](_0x6db962[_0x43e4('0x24')]);if(_0x6db962[_0x43e4('0x25')]){delete _0x6db962['name'];}_0x4d2bef[_0x43e4('0x17')](_0x3ef0d4)[_0x43e4('0x26')](_0x6db962);};}exports[_0x43e4('0x27')]=function(_0x59f78c,_0x17d6d3){var _0x59c894={},_0x5c482f={},_0x5a4e78={'count':0x0,'rows':[]};var _0x144499=_['map'](db[_0x43e4('0x28')]['rawAttributes'],function(_0x3df492){return{'name':_0x3df492['fieldName'],'type':_0x3df492[_0x43e4('0x29')]['key']};});_0x5c482f[_0x43e4('0x2a')]=_[_0x43e4('0x2b')](_0x144499,_0x43e4('0x25'));_0x5c482f[_0x43e4('0x2c')]=_[_0x43e4('0x2d')](_0x59f78c[_0x43e4('0x2c')]);_0x5c482f['filters']=_[_0x43e4('0x2e')](_0x5c482f[_0x43e4('0x2a')],_0x5c482f[_0x43e4('0x2c')]);_0x59c894[_0x43e4('0x2f')]=_[_0x43e4('0x2e')](_0x5c482f[_0x43e4('0x2a')],qs[_0x43e4('0x30')](_0x59f78c['query'][_0x43e4('0x30')]));_0x59c894['attributes']=_0x59c894['attributes'][_0x43e4('0x31')]?_0x59c894[_0x43e4('0x2f')]:_0x5c482f[_0x43e4('0x2a')];if(!_0x59f78c[_0x43e4('0x2c')][_0x43e4('0x32')]('nolimit')){_0x59c894[_0x43e4('0x1b')]=qs[_0x43e4('0x1b')](_0x59f78c[_0x43e4('0x2c')][_0x43e4('0x1b')]);_0x59c894['offset']=qs[_0x43e4('0x1d')](_0x59f78c['query'][_0x43e4('0x1d')]);}_0x59c894[_0x43e4('0x33')]=qs[_0x43e4('0x34')](_0x59f78c[_0x43e4('0x2c')][_0x43e4('0x34')]);_0x59c894[_0x43e4('0x35')]=qs[_0x43e4('0x36')](_[_0x43e4('0x37')](_0x59f78c['query'],_0x5c482f['filters']),_0x144499);if(_0x59f78c[_0x43e4('0x2c')][_0x43e4('0x38')]){_0x59c894[_0x43e4('0x35')]=_['merge'](_0x59c894[_0x43e4('0x35')],{'$or':_[_0x43e4('0x2b')](_0x144499,function(_0x4079df){if(_0x4079df['type']!==_0x43e4('0x39')){var _0x4a6c49={};_0x4a6c49[_0x4079df[_0x43e4('0x25')]]={'$like':'%'+_0x59f78c[_0x43e4('0x2c')][_0x43e4('0x38')]+'%'};return _0x4a6c49;}})});}_0x59c894=_[_0x43e4('0x3a')]({},_0x59c894,_0x59f78c['options']);var _0x1d92b4={'where':_0x59c894[_0x43e4('0x35')]};return db[_0x43e4('0x28')][_0x43e4('0x1c')](_0x1d92b4)['then'](function(_0x1a99fa){_0x5a4e78[_0x43e4('0x1c')]=_0x1a99fa;if(_0x59f78c[_0x43e4('0x2c')][_0x43e4('0x3b')]){_0x59c894[_0x43e4('0x3c')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x59c894);})['then'](function(_0x3bc333){_0x5a4e78[_0x43e4('0x3d')]=_0x3bc333;return _0x5a4e78;})[_0x43e4('0x23')](respondWithFilteredResult(_0x17d6d3,_0x59c894))[_0x43e4('0x3e')](handleError(_0x17d6d3,null));};exports[_0x43e4('0x3f')]=function(_0x389e0f,_0x4e5429){var _0x188238={'raw':![],'where':{'id':_0x389e0f['params']['id']}},_0x5addf7={};_0x5addf7[_0x43e4('0x2a')]=_[_0x43e4('0x2d')](db['FreshsalesConfiguration']['rawAttributes']);_0x5addf7[_0x43e4('0x2c')]=_[_0x43e4('0x2d')](_0x389e0f[_0x43e4('0x2c')]);_0x5addf7[_0x43e4('0x36')]=_['intersection'](_0x5addf7[_0x43e4('0x2a')],_0x5addf7[_0x43e4('0x2c')]);_0x188238[_0x43e4('0x2f')]=_['intersection'](_0x5addf7['model'],qs['fields'](_0x389e0f[_0x43e4('0x2c')][_0x43e4('0x30')]));_0x188238[_0x43e4('0x2f')]=_0x188238['attributes'][_0x43e4('0x31')]?_0x188238[_0x43e4('0x2f')]:_0x5addf7[_0x43e4('0x2a')];if(_0x389e0f[_0x43e4('0x2c')][_0x43e4('0x3b')]){_0x188238[_0x43e4('0x3c')]=[{'all':!![]}];}_0x188238=_['merge']({},_0x188238,_0x389e0f[_0x43e4('0x40')]);return db[_0x43e4('0x28')][_0x43e4('0x41')](_0x188238)[_0x43e4('0x23')](handleEntityNotFound(_0x4e5429,null))[_0x43e4('0x23')](respondWithResult(_0x4e5429,null))[_0x43e4('0x3e')](handleError(_0x4e5429,null));};exports[_0x43e4('0x42')]=function(_0x1154fe,_0x20ca49){return db['FreshsalesConfiguration']['create'](_0x1154fe['body'],{})[_0x43e4('0x23')](respondWithResult(_0x20ca49,0xc9))[_0x43e4('0x3e')](handleError(_0x20ca49,null));};exports[_0x43e4('0x21')]=function(_0x54fad2,_0x42a82a){if(_0x54fad2[_0x43e4('0x43')]['id']){delete _0x54fad2[_0x43e4('0x43')]['id'];}return db[_0x43e4('0x28')]['find']({'where':{'id':_0x54fad2[_0x43e4('0x44')]['id']}})[_0x43e4('0x23')](handleEntityNotFound(_0x42a82a,null))[_0x43e4('0x23')](saveUpdates(_0x54fad2[_0x43e4('0x43')],null))[_0x43e4('0x23')](respondWithResult(_0x42a82a,null))['catch'](handleError(_0x42a82a,null));};exports['destroy']=function(_0x3ad8c7,_0x106e76){return db[_0x43e4('0x28')][_0x43e4('0x41')]({'where':{'id':_0x3ad8c7['params']['id']}})['then'](handleEntityNotFound(_0x106e76,null))[_0x43e4('0x23')](removeEntity(_0x106e76,null))['catch'](handleError(_0x106e76,null));};exports[_0x43e4('0x45')]=function(_0xdda950,_0x4827bd,_0x12987f){var _0x3fb0d3={};var _0x28bcc1={};var _0x2ddf48;var _0x5869c0;return db['FreshsalesConfiguration'][_0x43e4('0x46')]({'where':{'id':_0xdda950[_0x43e4('0x44')]['id']}})[_0x43e4('0x23')](handleEntityNotFound(_0x4827bd,null))['then'](function(_0x1744f9){if(_0x1744f9){_0x2ddf48=_0x1744f9;_0x28bcc1[_0x43e4('0x2a')]=_['keys'](db['FreshsalesField'][_0x43e4('0x47')]);_0x28bcc1[_0x43e4('0x2c')]=_['keys'](_0xdda950[_0x43e4('0x2c')]);_0x28bcc1[_0x43e4('0x36')]=_[_0x43e4('0x2e')](_0x28bcc1[_0x43e4('0x2a')],_0x28bcc1[_0x43e4('0x2c')]);_0x3fb0d3[_0x43e4('0x2f')]=_[_0x43e4('0x2e')](_0x28bcc1[_0x43e4('0x2a')],qs[_0x43e4('0x30')](_0xdda950['query'][_0x43e4('0x30')]));_0x3fb0d3['attributes']=_0x3fb0d3[_0x43e4('0x2f')][_0x43e4('0x31')]?_0x3fb0d3['attributes']:_0x28bcc1[_0x43e4('0x2a')];_0x3fb0d3['order']=qs[_0x43e4('0x34')](_0xdda950[_0x43e4('0x2c')]['sort']);_0x3fb0d3[_0x43e4('0x35')]=qs[_0x43e4('0x36')](_['pick'](_0xdda950[_0x43e4('0x2c')],_0x28bcc1[_0x43e4('0x36')]));if(_0xdda950[_0x43e4('0x2c')][_0x43e4('0x38')]){_0x3fb0d3[_0x43e4('0x35')]=_['merge'](_0x3fb0d3[_0x43e4('0x35')],{'$or':_['map'](_0x3fb0d3[_0x43e4('0x2f')],function(_0x3df16a){var _0x1231a5={};_0x1231a5[_0x3df16a]={'$like':'%'+_0xdda950[_0x43e4('0x2c')][_0x43e4('0x38')]+'%'};return _0x1231a5;})});}_0x3fb0d3=_[_0x43e4('0x3a')]({},_0x3fb0d3,_0xdda950['options']);return _0x2ddf48['getSubjects'](_0x3fb0d3);}})[_0x43e4('0x23')](function(_0x1a5039){if(_0x1a5039){_0x5869c0=_0x1a5039[_0x43e4('0x31')];if(!_0xdda950['query']['hasOwnProperty'](_0x43e4('0x48'))){_0x3fb0d3[_0x43e4('0x1b')]=qs['limit'](_0xdda950[_0x43e4('0x2c')][_0x43e4('0x1b')]);_0x3fb0d3[_0x43e4('0x1d')]=qs[_0x43e4('0x1d')](_0xdda950[_0x43e4('0x2c')][_0x43e4('0x1d')]);}return _0x2ddf48[_0x43e4('0x45')](_0x3fb0d3);}})['then'](function(_0x3463ae){if(_0x3463ae){return _0x3463ae?{'count':_0x5869c0,'rows':_0x3463ae}:null;}})[_0x43e4('0x23')](respondWithResult(_0x4827bd,null))[_0x43e4('0x3e')](handleError(_0x4827bd,null));};exports[_0x43e4('0x49')]=function(_0x49ba33,_0x4cb3aa,_0x2f9bbb){var _0x5e5328={};var _0x404e39={};var _0x5629d1;var _0x5c2970;return db[_0x43e4('0x28')][_0x43e4('0x46')]({'where':{'id':_0x49ba33[_0x43e4('0x44')]['id']}})[_0x43e4('0x23')](handleEntityNotFound(_0x4cb3aa,null))[_0x43e4('0x23')](function(_0x332c7b){if(_0x332c7b){_0x5629d1=_0x332c7b;_0x404e39['model']=_[_0x43e4('0x2d')](db[_0x43e4('0x4a')][_0x43e4('0x47')]);_0x404e39['query']=_[_0x43e4('0x2d')](_0x49ba33[_0x43e4('0x2c')]);_0x404e39[_0x43e4('0x36')]=_['intersection'](_0x404e39['model'],_0x404e39[_0x43e4('0x2c')]);_0x5e5328['attributes']=_[_0x43e4('0x2e')](_0x404e39['model'],qs[_0x43e4('0x30')](_0x49ba33['query']['fields']));_0x5e5328[_0x43e4('0x2f')]=_0x5e5328[_0x43e4('0x2f')][_0x43e4('0x31')]?_0x5e5328['attributes']:_0x404e39[_0x43e4('0x2a')];_0x5e5328[_0x43e4('0x33')]=qs[_0x43e4('0x34')](_0x49ba33[_0x43e4('0x2c')]['sort']);_0x5e5328[_0x43e4('0x35')]=qs['filters'](_[_0x43e4('0x37')](_0x49ba33['query'],_0x404e39['filters']));if(_0x49ba33[_0x43e4('0x2c')][_0x43e4('0x38')]){_0x5e5328['where']=_[_0x43e4('0x3a')](_0x5e5328[_0x43e4('0x35')],{'$or':_['map'](_0x5e5328['attributes'],function(_0x5d7a0c){var _0x6d0e27={};_0x6d0e27[_0x5d7a0c]={'$like':'%'+_0x49ba33[_0x43e4('0x2c')][_0x43e4('0x38')]+'%'};return _0x6d0e27;})});}_0x5e5328=_[_0x43e4('0x3a')]({},_0x5e5328,_0x49ba33[_0x43e4('0x40')]);return _0x5629d1[_0x43e4('0x49')](_0x5e5328);}})['then'](function(_0x7fad8e){if(_0x7fad8e){_0x5c2970=_0x7fad8e[_0x43e4('0x31')];if(!_0x49ba33[_0x43e4('0x2c')][_0x43e4('0x32')](_0x43e4('0x48'))){_0x5e5328[_0x43e4('0x1b')]=qs[_0x43e4('0x1b')](_0x49ba33[_0x43e4('0x2c')][_0x43e4('0x1b')]);_0x5e5328[_0x43e4('0x1d')]=qs[_0x43e4('0x1d')](_0x49ba33[_0x43e4('0x2c')][_0x43e4('0x1d')]);}return _0x5629d1[_0x43e4('0x49')](_0x5e5328);}})['then'](function(_0x15c936){if(_0x15c936){return _0x15c936?{'count':_0x5c2970,'rows':_0x15c936}:null;}})[_0x43e4('0x23')](respondWithResult(_0x4cb3aa,null))[_0x43e4('0x3e')](handleError(_0x4cb3aa,null));};exports[_0x43e4('0x4b')]=function(_0x594537,_0x54e19f,_0xd20291){var _0x3ae24c={};var _0x1d617b={};var _0x2121e4;var _0x164fa3;return db[_0x43e4('0x28')][_0x43e4('0x46')]({'where':{'id':_0x594537['params']['id']}})[_0x43e4('0x23')](handleEntityNotFound(_0x54e19f,null))['then'](function(_0x5c4e1d){if(_0x5c4e1d){_0x2121e4=_0x5c4e1d;_0x1d617b[_0x43e4('0x2a')]=_[_0x43e4('0x2d')](db['FreshsalesField'][_0x43e4('0x47')]);_0x1d617b['query']=_[_0x43e4('0x2d')](_0x594537['query']);_0x1d617b[_0x43e4('0x36')]=_[_0x43e4('0x2e')](_0x1d617b[_0x43e4('0x2a')],_0x1d617b[_0x43e4('0x2c')]);_0x3ae24c['attributes']=_['intersection'](_0x1d617b[_0x43e4('0x2a')],qs[_0x43e4('0x30')](_0x594537[_0x43e4('0x2c')]['fields']));_0x3ae24c[_0x43e4('0x2f')]=_0x3ae24c[_0x43e4('0x2f')][_0x43e4('0x31')]?_0x3ae24c['attributes']:_0x1d617b[_0x43e4('0x2a')];_0x3ae24c[_0x43e4('0x33')]=qs[_0x43e4('0x34')](_0x594537['query']['sort']);_0x3ae24c['where']=qs[_0x43e4('0x36')](_['pick'](_0x594537[_0x43e4('0x2c')],_0x1d617b[_0x43e4('0x36')]));if(_0x594537['query'][_0x43e4('0x38')]){_0x3ae24c[_0x43e4('0x35')]=_[_0x43e4('0x3a')](_0x3ae24c['where'],{'$or':_[_0x43e4('0x2b')](_0x3ae24c[_0x43e4('0x2f')],function(_0x24c798){var _0x4ebb01={};_0x4ebb01[_0x24c798]={'$like':'%'+_0x594537[_0x43e4('0x2c')][_0x43e4('0x38')]+'%'};return _0x4ebb01;})});}_0x3ae24c=_['merge']({},_0x3ae24c,_0x594537['options']);return _0x2121e4['getFields'](_0x3ae24c);}})['then'](function(_0x51e730){if(_0x51e730){_0x164fa3=_0x51e730['length'];if(!_0x594537[_0x43e4('0x2c')][_0x43e4('0x32')](_0x43e4('0x48'))){_0x3ae24c[_0x43e4('0x1b')]=qs[_0x43e4('0x1b')](_0x594537['query'][_0x43e4('0x1b')]);_0x3ae24c['offset']=qs[_0x43e4('0x1d')](_0x594537['query']['offset']);}return _0x2121e4[_0x43e4('0x4b')](_0x3ae24c);}})[_0x43e4('0x23')](function(_0x375016){if(_0x375016){return _0x375016?{'count':_0x164fa3,'rows':_0x375016}:null;}})[_0x43e4('0x23')](respondWithResult(_0x54e19f,null))[_0x43e4('0x3e')](handleError(_0x54e19f,null));};
\ No newline at end of file
+var _0x2335=['name','send','index','map','FreshsalesConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','filter','where','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','findOne','pick','getSubjects','hasOwnProperty','getDescriptions','FreshsalesField','getFields','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','stack'];(function(_0x53c422,_0x19ac93){var _0x962022=function(_0x239e22){while(--_0x239e22){_0x53c422['push'](_0x53c422['shift']());}};_0x962022(++_0x19ac93);}(_0x2335,0x1c7));var _0x5233=function(_0x361455,_0x3fabc4){_0x361455=_0x361455-0x0;var _0x24cee9=_0x2335[_0x361455];return _0x24cee9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5233('0x0'));var zipdir=require(_0x5233('0x1'));var jsonpatch=require(_0x5233('0x2'));var rp=require(_0x5233('0x3'));var moment=require(_0x5233('0x4'));var BPromise=require(_0x5233('0x5'));var Mustache=require(_0x5233('0x6'));var util=require(_0x5233('0x7'));var path=require(_0x5233('0x8'));var sox=require(_0x5233('0x9'));var csv=require('to-csv');var ejs=require(_0x5233('0xa'));var fs=require('fs');var fs_extra=require(_0x5233('0xb'));var _=require(_0x5233('0xc'));var squel=require(_0x5233('0xd'));var crypto=require('crypto');var jsforce=require(_0x5233('0xe'));var deskjs=require(_0x5233('0xf'));var toCsv=require(_0x5233('0x10'));var querystring=require('querystring');var Papa=require(_0x5233('0x11'));var Redis=require(_0x5233('0x12'));var authService=require(_0x5233('0x13'));var qs=require(_0x5233('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5233('0x15'));var logger=require('../../config/logger')(_0x5233('0x16'));var utils=require(_0x5233('0x17'));var config=require(_0x5233('0x18'));var licenseUtil=require(_0x5233('0x19'));var db=require(_0x5233('0x1a'))['db'];function respondWithStatusCode(_0x25e91f,_0x42fb1c){_0x42fb1c=_0x42fb1c||0xcc;return function(_0x3e9b5d){if(_0x3e9b5d){return _0x25e91f[_0x5233('0x1b')](_0x42fb1c);}return _0x25e91f['status'](_0x42fb1c)[_0x5233('0x1c')]();};}function respondWithResult(_0x5cde70,_0x4c363b){_0x4c363b=_0x4c363b||0xc8;return function(_0x2ecfc2){if(_0x2ecfc2){return _0x5cde70['status'](_0x4c363b)['json'](_0x2ecfc2);}};}function respondWithFilteredResult(_0x768f1d,_0xa2aa60){return function(_0x21ab52){if(_0x21ab52){var _0x21a414=typeof _0xa2aa60[_0x5233('0x1d')]===_0x5233('0x1e')&&typeof _0xa2aa60[_0x5233('0x1f')]===_0x5233('0x1e');var _0x2a5332=_0x21ab52[_0x5233('0x20')];var _0x16765d=_0x21a414?0x0:_0xa2aa60[_0x5233('0x1d')];var _0x1e1628=_0x21a414?_0x21ab52[_0x5233('0x20')]:_0xa2aa60[_0x5233('0x1d')]+_0xa2aa60[_0x5233('0x1f')];var _0x19cdb7;if(_0x1e1628>=_0x2a5332){_0x1e1628=_0x2a5332;_0x19cdb7=0xc8;}else{_0x19cdb7=0xce;}_0x768f1d[_0x5233('0x21')](_0x19cdb7);return _0x768f1d['set'](_0x5233('0x22'),_0x16765d+'-'+_0x1e1628+'/'+_0x2a5332)[_0x5233('0x23')](_0x21ab52);}return null;};}function patchUpdates(_0x4a6cfd){return function(_0x4097e3){try{jsonpatch[_0x5233('0x24')](_0x4097e3,_0x4a6cfd,!![]);}catch(_0x4f7ef1){return BPromise[_0x5233('0x25')](_0x4f7ef1);}return _0x4097e3[_0x5233('0x26')]();};}function saveUpdates(_0x586dbb,_0x14f610){return function(_0x139432){if(_0x139432){return _0x139432[_0x5233('0x27')](_0x586dbb)[_0x5233('0x28')](function(_0x2e0f41){return _0x2e0f41;});}return null;};}function removeEntity(_0x3156ba,_0x2f0afd){return function(_0x28331a){if(_0x28331a){return _0x28331a[_0x5233('0x29')]()['then'](function(){_0x3156ba[_0x5233('0x21')](0xcc)[_0x5233('0x1c')]();});}};}function handleEntityNotFound(_0x24c6e7,_0x111137){return function(_0xbcc153){if(!_0xbcc153){_0x24c6e7['sendStatus'](0x194);}return _0xbcc153;};}function handleError(_0x1a2376,_0x172763){_0x172763=_0x172763||0x1f4;return function(_0x359adb){logger['error'](_0x359adb[_0x5233('0x2a')]);if(_0x359adb[_0x5233('0x2b')]){delete _0x359adb[_0x5233('0x2b')];}_0x1a2376['status'](_0x172763)[_0x5233('0x2c')](_0x359adb);};}exports[_0x5233('0x2d')]=function(_0x15a206,_0x46c370){var _0x55bc28={},_0x5803b3={},_0x248098={'count':0x0,'rows':[]};var _0x5edca2=_[_0x5233('0x2e')](db[_0x5233('0x2f')]['rawAttributes'],function(_0x5384cb){return{'name':_0x5384cb[_0x5233('0x30')],'type':_0x5384cb[_0x5233('0x31')][_0x5233('0x32')]};});_0x5803b3['model']=_['map'](_0x5edca2,_0x5233('0x2b'));_0x5803b3[_0x5233('0x33')]=_[_0x5233('0x34')](_0x15a206[_0x5233('0x33')]);_0x5803b3[_0x5233('0x35')]=_[_0x5233('0x36')](_0x5803b3[_0x5233('0x37')],_0x5803b3[_0x5233('0x33')]);_0x55bc28[_0x5233('0x38')]=_[_0x5233('0x36')](_0x5803b3[_0x5233('0x37')],qs[_0x5233('0x39')](_0x15a206[_0x5233('0x33')][_0x5233('0x39')]));_0x55bc28[_0x5233('0x38')]=_0x55bc28[_0x5233('0x38')][_0x5233('0x3a')]?_0x55bc28[_0x5233('0x38')]:_0x5803b3[_0x5233('0x37')];if(!_0x15a206[_0x5233('0x33')]['hasOwnProperty'](_0x5233('0x3b'))){_0x55bc28[_0x5233('0x1f')]=qs['limit'](_0x15a206[_0x5233('0x33')][_0x5233('0x1f')]);_0x55bc28[_0x5233('0x1d')]=qs['offset'](_0x15a206[_0x5233('0x33')][_0x5233('0x1d')]);}_0x55bc28['order']=qs['sort'](_0x15a206[_0x5233('0x33')][_0x5233('0x3c')]);_0x55bc28['where']=qs[_0x5233('0x35')](_['pick'](_0x15a206[_0x5233('0x33')],_0x5803b3['filters']),_0x5edca2);if(_0x15a206[_0x5233('0x33')][_0x5233('0x3d')]){_0x55bc28[_0x5233('0x3e')]=_['merge'](_0x55bc28[_0x5233('0x3e')],{'$or':_['map'](_0x5edca2,function(_0x5550d4){if(_0x5550d4[_0x5233('0x31')]!=='VIRTUAL'){var _0x26e1d3={};_0x26e1d3[_0x5550d4[_0x5233('0x2b')]]={'$like':'%'+_0x15a206[_0x5233('0x33')][_0x5233('0x3d')]+'%'};return _0x26e1d3;}})});}_0x55bc28=_[_0x5233('0x3f')]({},_0x55bc28,_0x15a206['options']);var _0xc1acd4={'where':_0x55bc28[_0x5233('0x3e')]};return db[_0x5233('0x2f')]['count'](_0xc1acd4)[_0x5233('0x28')](function(_0x6f16c7){_0x248098[_0x5233('0x20')]=_0x6f16c7;if(_0x15a206['query'][_0x5233('0x40')]){_0x55bc28[_0x5233('0x41')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x5233('0x42')](_0x55bc28);})[_0x5233('0x28')](function(_0xbf76d7){_0x248098['rows']=_0xbf76d7;return _0x248098;})['then'](respondWithFilteredResult(_0x46c370,_0x55bc28))[_0x5233('0x43')](handleError(_0x46c370,null));};exports[_0x5233('0x44')]=function(_0x20c139,_0x3881d7){var _0x391a4a={'raw':![],'where':{'id':_0x20c139[_0x5233('0x45')]['id']}},_0x531a81={};_0x531a81[_0x5233('0x37')]=_['keys'](db['FreshsalesConfiguration'][_0x5233('0x46')]);_0x531a81[_0x5233('0x33')]=_['keys'](_0x20c139[_0x5233('0x33')]);_0x531a81[_0x5233('0x35')]=_[_0x5233('0x36')](_0x531a81[_0x5233('0x37')],_0x531a81[_0x5233('0x33')]);_0x391a4a[_0x5233('0x38')]=_[_0x5233('0x36')](_0x531a81['model'],qs[_0x5233('0x39')](_0x20c139[_0x5233('0x33')][_0x5233('0x39')]));_0x391a4a[_0x5233('0x38')]=_0x391a4a[_0x5233('0x38')][_0x5233('0x3a')]?_0x391a4a[_0x5233('0x38')]:_0x531a81[_0x5233('0x37')];if(_0x20c139[_0x5233('0x33')]['includeAll']){_0x391a4a['include']=[{'all':!![]}];}_0x391a4a=_[_0x5233('0x3f')]({},_0x391a4a,_0x20c139[_0x5233('0x47')]);return db[_0x5233('0x2f')][_0x5233('0x48')](_0x391a4a)['then'](handleEntityNotFound(_0x3881d7,null))[_0x5233('0x28')](respondWithResult(_0x3881d7,null))[_0x5233('0x43')](handleError(_0x3881d7,null));};exports['create']=function(_0x1a4c07,_0x5d1232){return db[_0x5233('0x2f')][_0x5233('0x49')](_0x1a4c07[_0x5233('0x4a')],{})['then'](respondWithResult(_0x5d1232,0xc9))[_0x5233('0x43')](handleError(_0x5d1232,null));};exports[_0x5233('0x27')]=function(_0x287660,_0x1ac9b6){if(_0x287660[_0x5233('0x4a')]['id']){delete _0x287660[_0x5233('0x4a')]['id'];}return db[_0x5233('0x2f')][_0x5233('0x48')]({'where':{'id':_0x287660['params']['id']}})['then'](handleEntityNotFound(_0x1ac9b6,null))[_0x5233('0x28')](saveUpdates(_0x287660[_0x5233('0x4a')],null))[_0x5233('0x28')](respondWithResult(_0x1ac9b6,null))[_0x5233('0x43')](handleError(_0x1ac9b6,null));};exports[_0x5233('0x29')]=function(_0x3fcad2,_0x46fccb){return db[_0x5233('0x2f')][_0x5233('0x48')]({'where':{'id':_0x3fcad2[_0x5233('0x45')]['id']}})[_0x5233('0x28')](handleEntityNotFound(_0x46fccb,null))['then'](removeEntity(_0x46fccb,null))[_0x5233('0x43')](handleError(_0x46fccb,null));};exports['getSubjects']=function(_0x21b54e,_0x2eedd6,_0x2f2de2){var _0x519bb2={};var _0x26b9b1={};var _0x1bf097;var _0x332260;return db['FreshsalesConfiguration'][_0x5233('0x4b')]({'where':{'id':_0x21b54e[_0x5233('0x45')]['id']}})[_0x5233('0x28')](handleEntityNotFound(_0x2eedd6,null))['then'](function(_0x19da16){if(_0x19da16){_0x1bf097=_0x19da16;_0x26b9b1['model']=_[_0x5233('0x34')](db['FreshsalesField']['rawAttributes']);_0x26b9b1[_0x5233('0x33')]=_[_0x5233('0x34')](_0x21b54e[_0x5233('0x33')]);_0x26b9b1[_0x5233('0x35')]=_[_0x5233('0x36')](_0x26b9b1[_0x5233('0x37')],_0x26b9b1[_0x5233('0x33')]);_0x519bb2[_0x5233('0x38')]=_[_0x5233('0x36')](_0x26b9b1['model'],qs[_0x5233('0x39')](_0x21b54e[_0x5233('0x33')][_0x5233('0x39')]));_0x519bb2[_0x5233('0x38')]=_0x519bb2[_0x5233('0x38')]['length']?_0x519bb2[_0x5233('0x38')]:_0x26b9b1[_0x5233('0x37')];_0x519bb2['order']=qs['sort'](_0x21b54e[_0x5233('0x33')]['sort']);_0x519bb2['where']=qs['filters'](_[_0x5233('0x4c')](_0x21b54e['query'],_0x26b9b1[_0x5233('0x35')]));if(_0x21b54e['query'][_0x5233('0x3d')]){_0x519bb2[_0x5233('0x3e')]=_['merge'](_0x519bb2[_0x5233('0x3e')],{'$or':_[_0x5233('0x2e')](_0x519bb2[_0x5233('0x38')],function(_0xcb7b85){var _0x567211={};_0x567211[_0xcb7b85]={'$like':'%'+_0x21b54e[_0x5233('0x33')][_0x5233('0x3d')]+'%'};return _0x567211;})});}_0x519bb2=_['merge']({},_0x519bb2,_0x21b54e[_0x5233('0x47')]);return _0x1bf097[_0x5233('0x4d')](_0x519bb2);}})['then'](function(_0x4fc225){if(_0x4fc225){_0x332260=_0x4fc225['length'];if(!_0x21b54e[_0x5233('0x33')][_0x5233('0x4e')](_0x5233('0x3b'))){_0x519bb2['limit']=qs[_0x5233('0x1f')](_0x21b54e[_0x5233('0x33')][_0x5233('0x1f')]);_0x519bb2[_0x5233('0x1d')]=qs['offset'](_0x21b54e[_0x5233('0x33')][_0x5233('0x1d')]);}return _0x1bf097['getSubjects'](_0x519bb2);}})[_0x5233('0x28')](function(_0x1a4e48){if(_0x1a4e48){return _0x1a4e48?{'count':_0x332260,'rows':_0x1a4e48}:null;}})[_0x5233('0x28')](respondWithResult(_0x2eedd6,null))[_0x5233('0x43')](handleError(_0x2eedd6,null));};exports[_0x5233('0x4f')]=function(_0x447b5d,_0x18bff8,_0x525417){var _0x229cf4={};var _0x102a62={};var _0x298dbf;var _0x24baad;return db[_0x5233('0x2f')][_0x5233('0x4b')]({'where':{'id':_0x447b5d[_0x5233('0x45')]['id']}})['then'](handleEntityNotFound(_0x18bff8,null))[_0x5233('0x28')](function(_0x3c4f8b){if(_0x3c4f8b){_0x298dbf=_0x3c4f8b;_0x102a62[_0x5233('0x37')]=_[_0x5233('0x34')](db[_0x5233('0x50')][_0x5233('0x46')]);_0x102a62[_0x5233('0x33')]=_[_0x5233('0x34')](_0x447b5d['query']);_0x102a62[_0x5233('0x35')]=_[_0x5233('0x36')](_0x102a62[_0x5233('0x37')],_0x102a62['query']);_0x229cf4['attributes']=_[_0x5233('0x36')](_0x102a62[_0x5233('0x37')],qs[_0x5233('0x39')](_0x447b5d[_0x5233('0x33')][_0x5233('0x39')]));_0x229cf4['attributes']=_0x229cf4[_0x5233('0x38')][_0x5233('0x3a')]?_0x229cf4['attributes']:_0x102a62[_0x5233('0x37')];_0x229cf4['order']=qs[_0x5233('0x3c')](_0x447b5d[_0x5233('0x33')]['sort']);_0x229cf4[_0x5233('0x3e')]=qs[_0x5233('0x35')](_[_0x5233('0x4c')](_0x447b5d[_0x5233('0x33')],_0x102a62[_0x5233('0x35')]));if(_0x447b5d[_0x5233('0x33')]['filter']){_0x229cf4[_0x5233('0x3e')]=_[_0x5233('0x3f')](_0x229cf4[_0x5233('0x3e')],{'$or':_[_0x5233('0x2e')](_0x229cf4[_0x5233('0x38')],function(_0x53d8a5){var _0xed86d7={};_0xed86d7[_0x53d8a5]={'$like':'%'+_0x447b5d[_0x5233('0x33')][_0x5233('0x3d')]+'%'};return _0xed86d7;})});}_0x229cf4=_[_0x5233('0x3f')]({},_0x229cf4,_0x447b5d[_0x5233('0x47')]);return _0x298dbf['getDescriptions'](_0x229cf4);}})[_0x5233('0x28')](function(_0x1c7213){if(_0x1c7213){_0x24baad=_0x1c7213['length'];if(!_0x447b5d[_0x5233('0x33')][_0x5233('0x4e')](_0x5233('0x3b'))){_0x229cf4[_0x5233('0x1f')]=qs[_0x5233('0x1f')](_0x447b5d[_0x5233('0x33')][_0x5233('0x1f')]);_0x229cf4[_0x5233('0x1d')]=qs[_0x5233('0x1d')](_0x447b5d['query'][_0x5233('0x1d')]);}return _0x298dbf[_0x5233('0x4f')](_0x229cf4);}})[_0x5233('0x28')](function(_0x53a3f9){if(_0x53a3f9){return _0x53a3f9?{'count':_0x24baad,'rows':_0x53a3f9}:null;}})[_0x5233('0x28')](respondWithResult(_0x18bff8,null))['catch'](handleError(_0x18bff8,null));};exports[_0x5233('0x51')]=function(_0x8fb9aa,_0x3943a1,_0x3a6ef0){var _0x14ad87={};var _0x3dca7c={};var _0xe477eb;var _0x1c9dd1;return db[_0x5233('0x2f')][_0x5233('0x4b')]({'where':{'id':_0x8fb9aa['params']['id']}})[_0x5233('0x28')](handleEntityNotFound(_0x3943a1,null))[_0x5233('0x28')](function(_0x303b27){if(_0x303b27){_0xe477eb=_0x303b27;_0x3dca7c['model']=_[_0x5233('0x34')](db[_0x5233('0x50')]['rawAttributes']);_0x3dca7c[_0x5233('0x33')]=_[_0x5233('0x34')](_0x8fb9aa[_0x5233('0x33')]);_0x3dca7c[_0x5233('0x35')]=_[_0x5233('0x36')](_0x3dca7c['model'],_0x3dca7c[_0x5233('0x33')]);_0x14ad87['attributes']=_[_0x5233('0x36')](_0x3dca7c[_0x5233('0x37')],qs[_0x5233('0x39')](_0x8fb9aa['query'][_0x5233('0x39')]));_0x14ad87[_0x5233('0x38')]=_0x14ad87[_0x5233('0x38')]['length']?_0x14ad87['attributes']:_0x3dca7c['model'];_0x14ad87[_0x5233('0x52')]=qs[_0x5233('0x3c')](_0x8fb9aa[_0x5233('0x33')][_0x5233('0x3c')]);_0x14ad87['where']=qs['filters'](_[_0x5233('0x4c')](_0x8fb9aa[_0x5233('0x33')],_0x3dca7c[_0x5233('0x35')]));if(_0x8fb9aa['query']['filter']){_0x14ad87[_0x5233('0x3e')]=_[_0x5233('0x3f')](_0x14ad87[_0x5233('0x3e')],{'$or':_['map'](_0x14ad87[_0x5233('0x38')],function(_0x32a032){var _0x1cc073={};_0x1cc073[_0x32a032]={'$like':'%'+_0x8fb9aa['query']['filter']+'%'};return _0x1cc073;})});}_0x14ad87=_[_0x5233('0x3f')]({},_0x14ad87,_0x8fb9aa[_0x5233('0x47')]);return _0xe477eb[_0x5233('0x51')](_0x14ad87);}})[_0x5233('0x28')](function(_0x34b366){if(_0x34b366){_0x1c9dd1=_0x34b366[_0x5233('0x3a')];if(!_0x8fb9aa['query'][_0x5233('0x4e')](_0x5233('0x3b'))){_0x14ad87[_0x5233('0x1f')]=qs[_0x5233('0x1f')](_0x8fb9aa[_0x5233('0x33')]['limit']);_0x14ad87[_0x5233('0x1d')]=qs['offset'](_0x8fb9aa[_0x5233('0x33')][_0x5233('0x1d')]);}return _0xe477eb[_0x5233('0x51')](_0x14ad87);}})[_0x5233('0x28')](function(_0x3137c1){if(_0x3137c1){return _0x3137c1?{'count':_0x1c9dd1,'rows':_0x3137c1}:null;}})[_0x5233('0x28')](respondWithResult(_0x3943a1,null))[_0x5233('0x43')](handleError(_0x3943a1,null));};
\ No newline at end of file
index 92181b4..fc42cbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc35e=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration'];(function(_0x1cab2f,_0x401118){var _0x9dd42=function(_0x5daba6){while(--_0x5daba6){_0x1cab2f['push'](_0x1cab2f['shift']());}};_0x9dd42(++_0x401118);}(_0xc35e,0xe6));var _0xec35=function(_0x3fc0e7,_0x2b971e){_0x3fc0e7=_0x3fc0e7-0x0;var _0x1e2d2f=_0xc35e[_0x3fc0e7];return _0x1e2d2f;};'use strict';var _=require(_0xec35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xec35('0x1'));var moment=require(_0xec35('0x2'));var BPromise=require('bluebird');var rp=require(_0xec35('0x3'));var fs=require('fs');var path=require(_0xec35('0x4'));var rimraf=require(_0xec35('0x5'));var config=require(_0xec35('0x6'));var attributes=require(_0xec35('0x7'));module[_0xec35('0x8')]=function(_0x439f99,_0x4e1dcc){return _0x439f99['define'](_0xec35('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb014=['rimraf','../../config/environment','exports','define','FreshsalesConfiguration','lodash','util','api','bluebird','request-promise','path'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0xb014,0x73));var _0x4b01=function(_0x15f3a8,_0x9bcdcc){_0x15f3a8=_0x15f3a8-0x0;var _0x26f727=_0xb014[_0x15f3a8];return _0x26f727;};'use strict';var _=require(_0x4b01('0x0'));var util=require(_0x4b01('0x1'));var logger=require('../../config/logger')(_0x4b01('0x2'));var moment=require('moment');var BPromise=require(_0x4b01('0x3'));var rp=require(_0x4b01('0x4'));var fs=require('fs');var path=require(_0x4b01('0x5'));var rimraf=require(_0x4b01('0x6'));var config=require(_0x4b01('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x4b01('0x8')]=function(_0x565083,_0x1d8c2a){return _0x565083[_0x4b01('0x9')](_0x4b01('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe5b666..7feef31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4e6=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd4e6,0xe1));var _0x6d4e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xd4e6[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x6d4e('0x0'));var util=require(_0x6d4e('0x1'));var moment=require(_0x6d4e('0x2'));var BPromise=require(_0x6d4e('0x3'));var rs=require(_0x6d4e('0x4'));var fs=require('fs');var Redis=require(_0x6d4e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d4e('0x6'))(_0x6d4e('0x7'));var config=require(_0x6d4e('0x8'));var jayson=require(_0x6d4e('0x9'));var client=jayson['client'][_0x6d4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x297436,_0x10bd21,_0x5d3c96){return new BPromise(function(_0x388908,_0xd24ecf){return client[_0x6d4e('0xb')](_0x297436,_0x5d3c96)['then'](function(_0x47c1d9){logger[_0x6d4e('0xc')](_0x6d4e('0xd'),_0x10bd21,_0x6d4e('0xe'));logger[_0x6d4e('0xf')](_0x6d4e('0x10'),_0x10bd21,_0x6d4e('0xe'),JSON[_0x6d4e('0x11')](_0x47c1d9));if(_0x47c1d9[_0x6d4e('0x12')]){if(_0x47c1d9[_0x6d4e('0x12')]['code']===0x1f4){logger[_0x6d4e('0x12')](_0x6d4e('0xd'),_0x10bd21,_0x47c1d9[_0x6d4e('0x12')][_0x6d4e('0x13')]);return _0xd24ecf(_0x47c1d9[_0x6d4e('0x12')][_0x6d4e('0x13')]);}logger[_0x6d4e('0x12')](_0x6d4e('0xd'),_0x10bd21,_0x47c1d9[_0x6d4e('0x12')][_0x6d4e('0x13')]);return _0x388908(_0x47c1d9[_0x6d4e('0x12')][_0x6d4e('0x13')]);}else{logger[_0x6d4e('0xc')](_0x6d4e('0xd'),_0x10bd21,_0x6d4e('0xe'));_0x388908(_0x47c1d9[_0x6d4e('0x14')][_0x6d4e('0x13')]);}})['catch'](function(_0x7aa313){logger[_0x6d4e('0x12')](_0x6d4e('0xd'),_0x10bd21,_0x7aa313);_0xd24ecf(_0x7aa313);});});}
\ No newline at end of file
+var _0x4467=['info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x213689,_0x427332){var _0x5edeaf=function(_0x1372c1){while(--_0x1372c1){_0x213689['push'](_0x213689['shift']());}};_0x5edeaf(++_0x427332);}(_0x4467,0x199));var _0x7446=function(_0x56ff2e,_0x1941c5){_0x56ff2e=_0x56ff2e-0x0;var _0x2d1a68=_0x4467[_0x56ff2e];return _0x2d1a68;};'use strict';var _=require(_0x7446('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7446('0x1'));var fs=require('fs');var Redis=require(_0x7446('0x2'));var db=require(_0x7446('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7446('0x4'));var config=require(_0x7446('0x5'));var jayson=require(_0x7446('0x6'));var client=jayson[_0x7446('0x7')][_0x7446('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c6fbd,_0x1a7c69,_0x39be49){return new BPromise(function(_0x1cad6e,_0x56ccfb){return client[_0x7446('0x9')](_0x3c6fbd,_0x39be49)[_0x7446('0xa')](function(_0x3bb8dc){logger[_0x7446('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1a7c69,'request\x20sent');logger[_0x7446('0xc')](_0x7446('0xd'),_0x1a7c69,_0x7446('0xe'),JSON[_0x7446('0xf')](_0x3bb8dc));if(_0x3bb8dc[_0x7446('0x10')]){if(_0x3bb8dc[_0x7446('0x10')][_0x7446('0x11')]===0x1f4){logger[_0x7446('0x10')](_0x7446('0x12'),_0x1a7c69,_0x3bb8dc[_0x7446('0x10')][_0x7446('0x13')]);return _0x56ccfb(_0x3bb8dc[_0x7446('0x10')][_0x7446('0x13')]);}logger[_0x7446('0x10')](_0x7446('0x12'),_0x1a7c69,_0x3bb8dc[_0x7446('0x10')][_0x7446('0x13')]);return _0x1cad6e(_0x3bb8dc[_0x7446('0x10')]['message']);}else{logger['info'](_0x7446('0x12'),_0x1a7c69,_0x7446('0xe'));_0x1cad6e(_0x3bb8dc[_0x7446('0x14')][_0x7446('0x13')]);}})['catch'](function(_0x5d450f){logger[_0x7446('0x10')](_0x7446('0x12'),_0x1a7c69,_0x5d450f);_0x56ccfb(_0x5d450f);});});}
\ No newline at end of file
index 53aee8f..9197402 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2746=['update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x5a23c9,_0x2793a4){var _0x14bf85=function(_0x995b51){while(--_0x995b51){_0x5a23c9['push'](_0x5a23c9['shift']());}};_0x14bf85(++_0x2793a4);}(_0x2746,0x19c));var _0x6274=function(_0x42686d,_0x9aa3e0){_0x42686d=_0x42686d-0x0;var _0x1ea1d8=_0x2746[_0x42686d];return _0x1ea1d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6274('0x0'));var timeout=require(_0x6274('0x1'));var express=require(_0x6274('0x2'));var router=express[_0x6274('0x3')]();var fs_extra=require(_0x6274('0x4'));var auth=require(_0x6274('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6274('0x6'));router[_0x6274('0x7')]('/',auth[_0x6274('0x8')](),controller['index']);router[_0x6274('0x7')](_0x6274('0x9'),auth[_0x6274('0x8')](),controller[_0x6274('0xa')]);router[_0x6274('0xb')]('/',auth['isAuthenticated'](),controller[_0x6274('0xc')]);router['put'](_0x6274('0x9'),auth[_0x6274('0x8')](),controller[_0x6274('0xd')]);router[_0x6274('0xe')](_0x6274('0x9'),auth[_0x6274('0x8')](),controller[_0x6274('0xf')]);module[_0x6274('0x10')]=router;
\ No newline at end of file
+var _0xfa7c=['create','put','update','delete','/:id','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x40e9a1,_0x3a85bf){_0x40e9a1=_0x40e9a1-0x0;var _0x2ed26f=_0xfa7c[_0x40e9a1];return _0x2ed26f;};'use strict';var multer=require(_0xcfa7('0x0'));var util=require('util');var path=require(_0xcfa7('0x1'));var timeout=require(_0xcfa7('0x2'));var express=require(_0xcfa7('0x3'));var router=express[_0xcfa7('0x4')]();var fs_extra=require(_0xcfa7('0x5'));var auth=require(_0xcfa7('0x6'));var interaction=require(_0xcfa7('0x7'));var config=require(_0xcfa7('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xcfa7('0x9')]('/',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0xb')]);router[_0xcfa7('0x9')]('/:id',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0xc')]);router[_0xcfa7('0xd')]('/',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0xe')]);router[_0xcfa7('0xf')]('/:id',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0x10')]);router[_0xcfa7('0x11')](_0xcfa7('0x12'),auth[_0xcfa7('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 93557a4..88d5cd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f49=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x11e67f,_0x50a2ce){var _0x3ce761=function(_0x58aad8){while(--_0x58aad8){_0x11e67f['push'](_0x11e67f['shift']());}};_0x3ce761(++_0x50a2ce);}(_0x7f49,0x6a));var _0x97f4=function(_0xf27303,_0x57fd67){_0xf27303=_0xf27303-0x0;var _0x48d663=_0x7f49[_0xf27303];return _0x48d663;};'use strict';var Sequelize=require(_0x97f4('0x0'));module[_0x97f4('0x1')]={'type':{'type':Sequelize[_0x97f4('0x2')](_0x97f4('0x3'),_0x97f4('0x4'),'customVariable',_0x97f4('0x5'),_0x97f4('0x6')),'defaultValue':_0x97f4('0x3')},'content':{'type':Sequelize[_0x97f4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x97f4('0x2')]('string',_0x97f4('0x4'),_0x97f4('0x8'))},'keyContent':{'type':Sequelize[_0x97f4('0x7')]},'idField':{'type':Sequelize[_0x97f4('0x7')]},'nameField':{'type':Sequelize[_0x97f4('0x7')]},'customField':{'type':Sequelize[_0x97f4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x97f4('0x7')]}};
\ No newline at end of file
+var _0x9512=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x4c5cb8,_0x48914d){var _0x2f5c85=function(_0x26fc43){while(--_0x26fc43){_0x4c5cb8['push'](_0x4c5cb8['shift']());}};_0x2f5c85(++_0x48914d);}(_0x9512,0x8c));var _0x2951=function(_0x151e0b,_0x3bec86){_0x151e0b=_0x151e0b-0x0;var _0x5d4a5c=_0x9512[_0x151e0b];return _0x5d4a5c;};'use strict';var Sequelize=require(_0x2951('0x0'));module[_0x2951('0x1')]={'type':{'type':Sequelize[_0x2951('0x2')](_0x2951('0x3'),_0x2951('0x4'),_0x2951('0x5'),_0x2951('0x6'),_0x2951('0x7')),'defaultValue':_0x2951('0x3')},'content':{'type':Sequelize[_0x2951('0x8')]},'key':{'type':Sequelize[_0x2951('0x8')]},'keyType':{'type':Sequelize[_0x2951('0x2')](_0x2951('0x3'),_0x2951('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2951('0x8')]},'idField':{'type':Sequelize[_0x2951('0x8')]},'nameField':{'type':Sequelize[_0x2951('0x8')]},'customField':{'type':Sequelize[_0x2951('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2951('0x8')]}};
\ No newline at end of file
index bf7ec9a..f015a30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f2e=['params','rawAttributes','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','show'];(function(_0x401a4d,_0x4bb835){var _0x1faaff=function(_0x57539e){while(--_0x57539e){_0x401a4d['push'](_0x401a4d['shift']());}};_0x1faaff(++_0x4bb835);}(_0x6f2e,0x9a));var _0xe6f2=function(_0xf6fdb5,_0x1ff686){_0xf6fdb5=_0xf6fdb5-0x0;var _0xbc3fe4=_0x6f2e[_0xf6fdb5];return _0xbc3fe4;};'use strict';var emlformat=require(_0xe6f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6f2('0x1'));var jsonpatch=require(_0xe6f2('0x2'));var rp=require(_0xe6f2('0x3'));var moment=require(_0xe6f2('0x4'));var BPromise=require(_0xe6f2('0x5'));var Mustache=require('mustache');var util=require(_0xe6f2('0x6'));var path=require(_0xe6f2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe6f2('0x8'));var fs=require('fs');var fs_extra=require(_0xe6f2('0x9'));var _=require(_0xe6f2('0xa'));var squel=require('squel');var crypto=require(_0xe6f2('0xb'));var jsforce=require(_0xe6f2('0xc'));var deskjs=require(_0xe6f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe6f2('0xe'));var Papa=require(_0xe6f2('0xf'));var Redis=require(_0xe6f2('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe6f2('0x11'));var hardwareService=require(_0xe6f2('0x12'));var logger=require(_0xe6f2('0x13'))(_0xe6f2('0x14'));var utils=require(_0xe6f2('0x15'));var config=require(_0xe6f2('0x16'));var licenseUtil=require(_0xe6f2('0x17'));var db=require(_0xe6f2('0x18'))['db'];function respondWithStatusCode(_0xed59b2,_0x15138c){_0x15138c=_0x15138c||0xcc;return function(_0x4e4618){if(_0x4e4618){return _0xed59b2[_0xe6f2('0x19')](_0x15138c);}return _0xed59b2['status'](_0x15138c)['end']();};}function respondWithResult(_0x4c40d0,_0x30d2df){_0x30d2df=_0x30d2df||0xc8;return function(_0x7accef){if(_0x7accef){return _0x4c40d0[_0xe6f2('0x1a')](_0x30d2df)['json'](_0x7accef);}};}function respondWithFilteredResult(_0x304dd0,_0x3e6a1d){return function(_0x12602e){if(_0x12602e){var _0x26c523=typeof _0x3e6a1d[_0xe6f2('0x1b')]===_0xe6f2('0x1c')&&typeof _0x3e6a1d['limit']==='undefined';var _0x31be8f=_0x12602e['count'];var _0x52ebfc=_0x26c523?0x0:_0x3e6a1d['offset'];var _0x1d9316=_0x26c523?_0x12602e['count']:_0x3e6a1d[_0xe6f2('0x1b')]+_0x3e6a1d[_0xe6f2('0x1d')];var _0x542557;if(_0x1d9316>=_0x31be8f){_0x1d9316=_0x31be8f;_0x542557=0xc8;}else{_0x542557=0xce;}_0x304dd0[_0xe6f2('0x1a')](_0x542557);return _0x304dd0[_0xe6f2('0x1e')](_0xe6f2('0x1f'),_0x52ebfc+'-'+_0x1d9316+'/'+_0x31be8f)[_0xe6f2('0x20')](_0x12602e);}return null;};}function patchUpdates(_0x2f903d){return function(_0x396eca){try{jsonpatch[_0xe6f2('0x21')](_0x396eca,_0x2f903d,!![]);}catch(_0x423580){return BPromise[_0xe6f2('0x22')](_0x423580);}return _0x396eca[_0xe6f2('0x23')]();};}function saveUpdates(_0x4551d2,_0x9e3187){return function(_0x12e3c9){if(_0x12e3c9){return _0x12e3c9[_0xe6f2('0x24')](_0x4551d2)[_0xe6f2('0x25')](function(_0x21edc7){return _0x21edc7;});}return null;};}function removeEntity(_0x38e15d,_0x12550c){return function(_0x6b0f90){if(_0x6b0f90){return _0x6b0f90[_0xe6f2('0x26')]()[_0xe6f2('0x25')](function(){_0x38e15d[_0xe6f2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ff5b,_0x540f69){return function(_0xe0f152){if(!_0xe0f152){_0x29ff5b[_0xe6f2('0x19')](0x194);}return _0xe0f152;};}function handleError(_0x426128,_0x3e40af){_0x3e40af=_0x3e40af||0x1f4;return function(_0x4a56e7){logger[_0xe6f2('0x27')](_0x4a56e7[_0xe6f2('0x28')]);if(_0x4a56e7[_0xe6f2('0x29')]){delete _0x4a56e7['name'];}_0x426128[_0xe6f2('0x1a')](_0x3e40af)[_0xe6f2('0x2a')](_0x4a56e7);};}exports[_0xe6f2('0x2b')]=function(_0x55c726,_0x3ff8ff){var _0x1e58a8={},_0x1acb4e={},_0x50958c={'count':0x0,'rows':[]};var _0x2ad836=_[_0xe6f2('0x2c')](db[_0xe6f2('0x2d')]['rawAttributes'],function(_0x50b2b7){return{'name':_0x50b2b7['fieldName'],'type':_0x50b2b7[_0xe6f2('0x2e')][_0xe6f2('0x2f')]};});_0x1acb4e[_0xe6f2('0x30')]=_[_0xe6f2('0x2c')](_0x2ad836,_0xe6f2('0x29'));_0x1acb4e['query']=_[_0xe6f2('0x31')](_0x55c726[_0xe6f2('0x32')]);_0x1acb4e['filters']=_[_0xe6f2('0x33')](_0x1acb4e[_0xe6f2('0x30')],_0x1acb4e[_0xe6f2('0x32')]);_0x1e58a8[_0xe6f2('0x34')]=_[_0xe6f2('0x33')](_0x1acb4e[_0xe6f2('0x30')],qs[_0xe6f2('0x35')](_0x55c726[_0xe6f2('0x32')][_0xe6f2('0x35')]));_0x1e58a8['attributes']=_0x1e58a8[_0xe6f2('0x34')]['length']?_0x1e58a8['attributes']:_0x1acb4e['model'];if(!_0x55c726[_0xe6f2('0x32')]['hasOwnProperty'](_0xe6f2('0x36'))){_0x1e58a8['limit']=qs[_0xe6f2('0x1d')](_0x55c726['query'][_0xe6f2('0x1d')]);_0x1e58a8[_0xe6f2('0x1b')]=qs[_0xe6f2('0x1b')](_0x55c726['query'][_0xe6f2('0x1b')]);}_0x1e58a8[_0xe6f2('0x37')]=qs[_0xe6f2('0x38')](_0x55c726[_0xe6f2('0x32')][_0xe6f2('0x38')]);_0x1e58a8['where']=qs['filters'](_[_0xe6f2('0x39')](_0x55c726[_0xe6f2('0x32')],_0x1acb4e[_0xe6f2('0x3a')]),_0x2ad836);if(_0x55c726[_0xe6f2('0x32')][_0xe6f2('0x3b')]){_0x1e58a8[_0xe6f2('0x3c')]=_['merge'](_0x1e58a8[_0xe6f2('0x3c')],{'$or':_[_0xe6f2('0x2c')](_0x2ad836,function(_0x3ee5ec){if(_0x3ee5ec[_0xe6f2('0x2e')]!==_0xe6f2('0x3d')){var _0x1d239a={};_0x1d239a[_0x3ee5ec[_0xe6f2('0x29')]]={'$like':'%'+_0x55c726[_0xe6f2('0x32')][_0xe6f2('0x3b')]+'%'};return _0x1d239a;}})});}_0x1e58a8=_[_0xe6f2('0x3e')]({},_0x1e58a8,_0x55c726[_0xe6f2('0x3f')]);var _0x16eb41={'where':_0x1e58a8[_0xe6f2('0x3c')]};return db[_0xe6f2('0x2d')]['count'](_0x16eb41)[_0xe6f2('0x25')](function(_0x43f499){_0x50958c['count']=_0x43f499;if(_0x55c726[_0xe6f2('0x32')][_0xe6f2('0x40')]){_0x1e58a8['include']=[{'all':!![]}];}return db[_0xe6f2('0x2d')]['findAll'](_0x1e58a8);})[_0xe6f2('0x25')](function(_0x110963){_0x50958c[_0xe6f2('0x41')]=_0x110963;return _0x50958c;})['then'](respondWithFilteredResult(_0x3ff8ff,_0x1e58a8))[_0xe6f2('0x42')](handleError(_0x3ff8ff,null));};exports[_0xe6f2('0x43')]=function(_0x3f5737,_0x3ac56a){var _0x2ae000={'raw':!![],'where':{'id':_0x3f5737[_0xe6f2('0x44')]['id']}},_0x47f488={};_0x47f488[_0xe6f2('0x30')]=_[_0xe6f2('0x31')](db[_0xe6f2('0x2d')][_0xe6f2('0x45')]);_0x47f488[_0xe6f2('0x32')]=_[_0xe6f2('0x31')](_0x3f5737[_0xe6f2('0x32')]);_0x47f488[_0xe6f2('0x3a')]=_[_0xe6f2('0x33')](_0x47f488[_0xe6f2('0x30')],_0x47f488['query']);_0x2ae000[_0xe6f2('0x34')]=_['intersection'](_0x47f488['model'],qs[_0xe6f2('0x35')](_0x3f5737[_0xe6f2('0x32')]['fields']));_0x2ae000[_0xe6f2('0x34')]=_0x2ae000['attributes'][_0xe6f2('0x46')]?_0x2ae000['attributes']:_0x47f488[_0xe6f2('0x30')];if(_0x3f5737[_0xe6f2('0x32')]['includeAll']){_0x2ae000['include']=[{'all':!![]}];}_0x2ae000=_[_0xe6f2('0x3e')]({},_0x2ae000,_0x3f5737[_0xe6f2('0x3f')]);return db['FreshsalesField'][_0xe6f2('0x47')](_0x2ae000)['then'](handleEntityNotFound(_0x3ac56a,null))['then'](respondWithResult(_0x3ac56a,null))[_0xe6f2('0x42')](handleError(_0x3ac56a,null));};exports[_0xe6f2('0x48')]=function(_0x5985ff,_0x49949b){return db[_0xe6f2('0x2d')][_0xe6f2('0x48')](_0x5985ff[_0xe6f2('0x49')],{})['then'](respondWithResult(_0x49949b,0xc9))[_0xe6f2('0x42')](handleError(_0x49949b,null));};exports[_0xe6f2('0x24')]=function(_0x28e5da,_0x52d38c){if(_0x28e5da[_0xe6f2('0x49')]['id']){delete _0x28e5da['body']['id'];}return db[_0xe6f2('0x2d')][_0xe6f2('0x47')]({'where':{'id':_0x28e5da[_0xe6f2('0x44')]['id']}})[_0xe6f2('0x25')](handleEntityNotFound(_0x52d38c,null))[_0xe6f2('0x25')](saveUpdates(_0x28e5da[_0xe6f2('0x49')],null))[_0xe6f2('0x25')](respondWithResult(_0x52d38c,null))[_0xe6f2('0x42')](handleError(_0x52d38c,null));};exports[_0xe6f2('0x26')]=function(_0x3925a8,_0x3dd43b){return db[_0xe6f2('0x2d')][_0xe6f2('0x47')]({'where':{'id':_0x3925a8[_0xe6f2('0x44')]['id']}})[_0xe6f2('0x25')](handleEntityNotFound(_0x3dd43b,null))[_0xe6f2('0x25')](removeEntity(_0x3dd43b,null))[_0xe6f2('0x42')](handleError(_0x3dd43b,null));};
\ No newline at end of file
+var _0xf04c=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','show','params','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xf04c,0x1ab));var _0xcf04=function(_0x2b1b65,_0x5de58c){_0x2b1b65=_0x2b1b65-0x0;var _0x3cf9cb=_0xf04c[_0x2b1b65];return _0x3cf9cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf04('0x0'));var zipdir=require(_0xcf04('0x1'));var jsonpatch=require(_0xcf04('0x2'));var rp=require(_0xcf04('0x3'));var moment=require(_0xcf04('0x4'));var BPromise=require(_0xcf04('0x5'));var Mustache=require(_0xcf04('0x6'));var util=require(_0xcf04('0x7'));var path=require('path');var sox=require(_0xcf04('0x8'));var csv=require(_0xcf04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf04('0xa'));var squel=require('squel');var crypto=require(_0xcf04('0xb'));var jsforce=require(_0xcf04('0xc'));var deskjs=require(_0xcf04('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcf04('0xe'));var Papa=require('papaparse');var Redis=require(_0xcf04('0xf'));var authService=require(_0xcf04('0x10'));var qs=require(_0xcf04('0x11'));var as=require(_0xcf04('0x12'));var hardwareService=require(_0xcf04('0x13'));var logger=require('../../config/logger')(_0xcf04('0x14'));var utils=require(_0xcf04('0x15'));var config=require(_0xcf04('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf04('0x17'))['db'];function respondWithStatusCode(_0x2ae92b,_0xfd6ce5){_0xfd6ce5=_0xfd6ce5||0xcc;return function(_0x139215){if(_0x139215){return _0x2ae92b[_0xcf04('0x18')](_0xfd6ce5);}return _0x2ae92b[_0xcf04('0x19')](_0xfd6ce5)[_0xcf04('0x1a')]();};}function respondWithResult(_0x128a06,_0x2435ba){_0x2435ba=_0x2435ba||0xc8;return function(_0x2149e3){if(_0x2149e3){return _0x128a06[_0xcf04('0x19')](_0x2435ba)[_0xcf04('0x1b')](_0x2149e3);}};}function respondWithFilteredResult(_0x10693c,_0x1f910e){return function(_0x4d035a){if(_0x4d035a){var _0x3d9a61=typeof _0x1f910e[_0xcf04('0x1c')]===_0xcf04('0x1d')&&typeof _0x1f910e[_0xcf04('0x1e')]===_0xcf04('0x1d');var _0x4efd6=_0x4d035a['count'];var _0x78c751=_0x3d9a61?0x0:_0x1f910e[_0xcf04('0x1c')];var _0x2b81b9=_0x3d9a61?_0x4d035a[_0xcf04('0x1f')]:_0x1f910e['offset']+_0x1f910e[_0xcf04('0x1e')];var _0x2a0798;if(_0x2b81b9>=_0x4efd6){_0x2b81b9=_0x4efd6;_0x2a0798=0xc8;}else{_0x2a0798=0xce;}_0x10693c['status'](_0x2a0798);return _0x10693c[_0xcf04('0x20')](_0xcf04('0x21'),_0x78c751+'-'+_0x2b81b9+'/'+_0x4efd6)[_0xcf04('0x1b')](_0x4d035a);}return null;};}function patchUpdates(_0x2b9086){return function(_0x7d7800){try{jsonpatch[_0xcf04('0x22')](_0x7d7800,_0x2b9086,!![]);}catch(_0x2bd487){return BPromise[_0xcf04('0x23')](_0x2bd487);}return _0x7d7800[_0xcf04('0x24')]();};}function saveUpdates(_0x32b6e9,_0xc608ab){return function(_0x457f46){if(_0x457f46){return _0x457f46[_0xcf04('0x25')](_0x32b6e9)[_0xcf04('0x26')](function(_0x15cecb){return _0x15cecb;});}return null;};}function removeEntity(_0x1d5db6,_0x56ed8f){return function(_0x2bf426){if(_0x2bf426){return _0x2bf426[_0xcf04('0x27')]()[_0xcf04('0x26')](function(){_0x1d5db6[_0xcf04('0x19')](0xcc)[_0xcf04('0x1a')]();});}};}function handleEntityNotFound(_0x5b3e25,_0x3cf5e0){return function(_0x423b89){if(!_0x423b89){_0x5b3e25['sendStatus'](0x194);}return _0x423b89;};}function handleError(_0x59684d,_0x370ac6){_0x370ac6=_0x370ac6||0x1f4;return function(_0x38b390){logger[_0xcf04('0x28')](_0x38b390['stack']);if(_0x38b390[_0xcf04('0x29')]){delete _0x38b390[_0xcf04('0x29')];}_0x59684d[_0xcf04('0x19')](_0x370ac6)['send'](_0x38b390);};}exports[_0xcf04('0x2a')]=function(_0x4e7b52,_0x443e41){var _0x2f08d9={},_0x95efc={},_0x4c1c4e={'count':0x0,'rows':[]};var _0x20de47=_[_0xcf04('0x2b')](db['FreshsalesField'][_0xcf04('0x2c')],function(_0x3eae26){return{'name':_0x3eae26[_0xcf04('0x2d')],'type':_0x3eae26[_0xcf04('0x2e')][_0xcf04('0x2f')]};});_0x95efc[_0xcf04('0x30')]=_['map'](_0x20de47,_0xcf04('0x29'));_0x95efc[_0xcf04('0x31')]=_[_0xcf04('0x32')](_0x4e7b52[_0xcf04('0x31')]);_0x95efc[_0xcf04('0x33')]=_[_0xcf04('0x34')](_0x95efc[_0xcf04('0x30')],_0x95efc['query']);_0x2f08d9[_0xcf04('0x35')]=_[_0xcf04('0x34')](_0x95efc[_0xcf04('0x30')],qs[_0xcf04('0x36')](_0x4e7b52[_0xcf04('0x31')][_0xcf04('0x36')]));_0x2f08d9['attributes']=_0x2f08d9[_0xcf04('0x35')][_0xcf04('0x37')]?_0x2f08d9[_0xcf04('0x35')]:_0x95efc[_0xcf04('0x30')];if(!_0x4e7b52[_0xcf04('0x31')]['hasOwnProperty'](_0xcf04('0x38'))){_0x2f08d9[_0xcf04('0x1e')]=qs[_0xcf04('0x1e')](_0x4e7b52[_0xcf04('0x31')]['limit']);_0x2f08d9[_0xcf04('0x1c')]=qs['offset'](_0x4e7b52['query'][_0xcf04('0x1c')]);}_0x2f08d9[_0xcf04('0x39')]=qs['sort'](_0x4e7b52[_0xcf04('0x31')][_0xcf04('0x3a')]);_0x2f08d9[_0xcf04('0x3b')]=qs[_0xcf04('0x33')](_[_0xcf04('0x3c')](_0x4e7b52[_0xcf04('0x31')],_0x95efc[_0xcf04('0x33')]),_0x20de47);if(_0x4e7b52['query'][_0xcf04('0x3d')]){_0x2f08d9[_0xcf04('0x3b')]=_[_0xcf04('0x3e')](_0x2f08d9[_0xcf04('0x3b')],{'$or':_[_0xcf04('0x2b')](_0x20de47,function(_0x38de80){if(_0x38de80[_0xcf04('0x2e')]!==_0xcf04('0x3f')){var _0x103f49={};_0x103f49[_0x38de80[_0xcf04('0x29')]]={'$like':'%'+_0x4e7b52['query'][_0xcf04('0x3d')]+'%'};return _0x103f49;}})});}_0x2f08d9=_[_0xcf04('0x3e')]({},_0x2f08d9,_0x4e7b52[_0xcf04('0x40')]);var _0x4080e6={'where':_0x2f08d9[_0xcf04('0x3b')]};return db[_0xcf04('0x41')][_0xcf04('0x1f')](_0x4080e6)[_0xcf04('0x26')](function(_0x28721d){_0x4c1c4e[_0xcf04('0x1f')]=_0x28721d;if(_0x4e7b52[_0xcf04('0x31')][_0xcf04('0x42')]){_0x2f08d9[_0xcf04('0x43')]=[{'all':!![]}];}return db[_0xcf04('0x41')]['findAll'](_0x2f08d9);})[_0xcf04('0x26')](function(_0xa105d6){_0x4c1c4e['rows']=_0xa105d6;return _0x4c1c4e;})[_0xcf04('0x26')](respondWithFilteredResult(_0x443e41,_0x2f08d9))['catch'](handleError(_0x443e41,null));};exports[_0xcf04('0x44')]=function(_0x7ce37f,_0x2101c8){var _0x5cbf31={'raw':!![],'where':{'id':_0x7ce37f[_0xcf04('0x45')]['id']}},_0x3cc99c={};_0x3cc99c[_0xcf04('0x30')]=_[_0xcf04('0x32')](db[_0xcf04('0x41')][_0xcf04('0x2c')]);_0x3cc99c['query']=_[_0xcf04('0x32')](_0x7ce37f['query']);_0x3cc99c[_0xcf04('0x33')]=_['intersection'](_0x3cc99c['model'],_0x3cc99c[_0xcf04('0x31')]);_0x5cbf31[_0xcf04('0x35')]=_[_0xcf04('0x34')](_0x3cc99c['model'],qs[_0xcf04('0x36')](_0x7ce37f[_0xcf04('0x31')][_0xcf04('0x36')]));_0x5cbf31[_0xcf04('0x35')]=_0x5cbf31[_0xcf04('0x35')]['length']?_0x5cbf31[_0xcf04('0x35')]:_0x3cc99c[_0xcf04('0x30')];if(_0x7ce37f[_0xcf04('0x31')][_0xcf04('0x42')]){_0x5cbf31[_0xcf04('0x43')]=[{'all':!![]}];}_0x5cbf31=_[_0xcf04('0x3e')]({},_0x5cbf31,_0x7ce37f[_0xcf04('0x40')]);return db[_0xcf04('0x41')]['find'](_0x5cbf31)[_0xcf04('0x26')](handleEntityNotFound(_0x2101c8,null))[_0xcf04('0x26')](respondWithResult(_0x2101c8,null))[_0xcf04('0x46')](handleError(_0x2101c8,null));};exports['create']=function(_0x507e07,_0x4a1197){return db[_0xcf04('0x41')][_0xcf04('0x47')](_0x507e07['body'],{})['then'](respondWithResult(_0x4a1197,0xc9))['catch'](handleError(_0x4a1197,null));};exports['update']=function(_0x4eee59,_0x25f064){if(_0x4eee59[_0xcf04('0x48')]['id']){delete _0x4eee59[_0xcf04('0x48')]['id'];}return db['FreshsalesField'][_0xcf04('0x49')]({'where':{'id':_0x4eee59[_0xcf04('0x45')]['id']}})['then'](handleEntityNotFound(_0x25f064,null))['then'](saveUpdates(_0x4eee59[_0xcf04('0x48')],null))[_0xcf04('0x26')](respondWithResult(_0x25f064,null))[_0xcf04('0x46')](handleError(_0x25f064,null));};exports[_0xcf04('0x27')]=function(_0x2c09e2,_0x511073){return db[_0xcf04('0x41')][_0xcf04('0x49')]({'where':{'id':_0x2c09e2[_0xcf04('0x45')]['id']}})[_0xcf04('0x26')](handleEntityNotFound(_0x511073,null))[_0xcf04('0x26')](removeEntity(_0x511073,null))[_0xcf04('0x46')](handleError(_0x511073,null));};
\ No newline at end of file
index b4d93d0..d219c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df9=['freshsales_unique_index','idField','lodash','util','api','request-promise','rimraf','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x6df9,0x84));var _0x96df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6df9[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var logger=require('../../config/logger')(_0x96df('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96df('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96df('0x4'));var config=require('../../config/environment');var attributes=require(_0x96df('0x5'));module['exports']=function(_0x23e387,_0x3951b3){return _0x23e387['define'](_0x96df('0x6'),attributes,{'tableName':_0x96df('0x7'),'paranoid':![],'indexes':[{'name':_0x96df('0x8'),'fields':[_0x96df('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd386=['freshsales_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields'];(function(_0x32569d,_0x58f9de){var _0x52dabf=function(_0x441a10){while(--_0x441a10){_0x32569d['push'](_0x32569d['shift']());}};_0x52dabf(++_0x58f9de);}(_0xd386,0x10c));var _0x6d38=function(_0x5df3ab,_0x4a0a7e){_0x5df3ab=_0x5df3ab-0x0;var _0x42cce5=_0xd386[_0x5df3ab];return _0x42cce5;};'use strict';var _=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var logger=require(_0x6d38('0x2'))('api');var moment=require(_0x6d38('0x3'));var BPromise=require(_0x6d38('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d38('0x5'));var rimraf=require(_0x6d38('0x6'));var config=require(_0x6d38('0x7'));var attributes=require(_0x6d38('0x8'));module['exports']=function(_0x1a54fa,_0x25eef5){return _0x1a54fa[_0x6d38('0x9')](_0x6d38('0xa'),attributes,{'tableName':_0x6d38('0xb'),'paranoid':![],'indexes':[{'name':_0x6d38('0xc'),'fields':['idField',_0x6d38('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5e4e7e8..432ed0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d34fd,_0xa8744){var _0x163b8c=function(_0x29503f){while(--_0x29503f){_0x2d34fd['push'](_0x2d34fd['shift']());}};_0x163b8c(++_0xa8744);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}
\ No newline at end of file
+var _0x326f=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d5505,_0x5bc945){var _0x154e8a=function(_0x14c1b6){while(--_0x14c1b6){_0x4d5505['push'](_0x4d5505['shift']());}};_0x154e8a(++_0x5bc945);}(_0x326f,0xd1));var _0xf326=function(_0x59f9bc,_0x5201cd){_0x59f9bc=_0x59f9bc-0x0;var _0x24ba1d=_0x326f[_0x59f9bc];return _0x24ba1d;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
index e3f4376..a9faf23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xd910fe,_0x4478ac){var _0x1d03bd=function(_0x2c5896){while(--_0x2c5896){_0xd910fe['push'](_0xd910fe['shift']());}};_0x1d03bd(++_0x4478ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x40d3e3,_0x217698){var _0x244b41=function(_0x506add){while(--_0x506add){_0x40d3e3['push'](_0x40d3e3['shift']());}};_0x244b41(++_0x217698);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index 216eb36..e46539a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34f0=['username','ENUM','newTab','sequelize','exports','STRING'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0x34f0,0x13b));var _0x034f=function(_0x1e0f28,_0x1ecfb7){_0x1e0f28=_0x1e0f28-0x0;var _0x172227=_0x34f0[_0x1e0f28];return _0x172227;};'use strict';var Sequelize=require(_0x034f('0x0'));module[_0x034f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x034f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x034f('0x3')},'remoteUri':{'type':Sequelize[_0x034f('0x2')]},'password':{'type':Sequelize[_0x034f('0x2')]},'clientId':{'type':Sequelize[_0x034f('0x2')]},'clientSecret':{'type':Sequelize[_0x034f('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x034f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x034f('0x4')]('integrationTab',_0x034f('0x5')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0xff01=['STRING','username','integrationTab','sequelize','exports'];(function(_0x2689e5,_0x42df39){var _0x5bd472=function(_0x824bf1){while(--_0x824bf1){_0x2689e5['push'](_0x2689e5['shift']());}};_0x5bd472(++_0x42df39);}(_0xff01,0xb7));var _0x1ff0=function(_0x40a0b6,_0x10d2ae){_0x40a0b6=_0x40a0b6-0x0;var _0xfd7d21=_0xff01[_0x40a0b6];return _0xfd7d21;};'use strict';var Sequelize=require(_0x1ff0('0x0'));module[_0x1ff0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1ff0('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1ff0('0x3')},'remoteUri':{'type':Sequelize[_0x1ff0('0x2')]},'password':{'type':Sequelize[_0x1ff0('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1ff0('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1ff0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1ff0('0x4'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
index dc79022..34df2be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbc1=['rows','catch','show','params','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','keys','filters','intersection','model','fields','length','attributes','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x4b0a63,_0x54ad08){var _0x329a38=function(_0x1a1dca){while(--_0x1a1dca){_0x4b0a63['push'](_0x4b0a63['shift']());}};_0x329a38(++_0x54ad08);}(_0xcbc1,0x1d2));var _0x1cbc=function(_0x34205a,_0x2158de){_0x34205a=_0x34205a-0x0;var _0x2040ed=_0xcbc1[_0x34205a];return _0x2040ed;};'use strict';var emlformat=require(_0x1cbc('0x0'));var rimraf=require(_0x1cbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cbc('0x2'));var rp=require(_0x1cbc('0x3'));var moment=require(_0x1cbc('0x4'));var BPromise=require(_0x1cbc('0x5'));var Mustache=require(_0x1cbc('0x6'));var util=require(_0x1cbc('0x7'));var path=require('path');var sox=require(_0x1cbc('0x8'));var csv=require(_0x1cbc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cbc('0xa'));var _=require(_0x1cbc('0xb'));var squel=require(_0x1cbc('0xc'));var crypto=require(_0x1cbc('0xd'));var jsforce=require(_0x1cbc('0xe'));var deskjs=require(_0x1cbc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1cbc('0x10'));var Papa=require('papaparse');var Redis=require(_0x1cbc('0x11'));var authService=require(_0x1cbc('0x12'));var qs=require(_0x1cbc('0x13'));var as=require(_0x1cbc('0x14'));var hardwareService=require(_0x1cbc('0x15'));var logger=require(_0x1cbc('0x16'))(_0x1cbc('0x17'));var utils=require(_0x1cbc('0x18'));var config=require(_0x1cbc('0x19'));var licenseUtil=require(_0x1cbc('0x1a'));var db=require(_0x1cbc('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e8901,_0x19e36d){_0x19e36d=_0x19e36d||0xcc;return function(_0x44d977){if(_0x44d977){return _0x3e8901['sendStatus'](_0x19e36d);}return _0x3e8901['status'](_0x19e36d)[_0x1cbc('0x1c')]();};}function respondWithResult(_0xe938ed,_0x2caec9){_0x2caec9=_0x2caec9||0xc8;return function(_0x34da0f){if(_0x34da0f){return _0xe938ed['status'](_0x2caec9)[_0x1cbc('0x1d')](_0x34da0f);}};}function respondWithFilteredResult(_0x363f21,_0x94d217){return function(_0x1da74a){if(_0x1da74a){var _0x38bd4d=typeof _0x94d217[_0x1cbc('0x1e')]===_0x1cbc('0x1f')&&typeof _0x94d217[_0x1cbc('0x20')]===_0x1cbc('0x1f');var _0x195b57=_0x1da74a[_0x1cbc('0x21')];var _0x5e07ce=_0x38bd4d?0x0:_0x94d217[_0x1cbc('0x1e')];var _0x5149b2=_0x38bd4d?_0x1da74a[_0x1cbc('0x21')]:_0x94d217[_0x1cbc('0x1e')]+_0x94d217['limit'];var _0x566ec0;if(_0x5149b2>=_0x195b57){_0x5149b2=_0x195b57;_0x566ec0=0xc8;}else{_0x566ec0=0xce;}_0x363f21[_0x1cbc('0x22')](_0x566ec0);return _0x363f21['set'](_0x1cbc('0x23'),_0x5e07ce+'-'+_0x5149b2+'/'+_0x195b57)[_0x1cbc('0x1d')](_0x1da74a);}return null;};}function patchUpdates(_0x4ce175){return function(_0x22c449){try{jsonpatch[_0x1cbc('0x24')](_0x22c449,_0x4ce175,!![]);}catch(_0x17f241){return BPromise[_0x1cbc('0x25')](_0x17f241);}return _0x22c449[_0x1cbc('0x26')]();};}function saveUpdates(_0x35cad2,_0x1eef00){return function(_0x94e3cf){if(_0x94e3cf){return _0x94e3cf[_0x1cbc('0x27')](_0x35cad2)['then'](function(_0x5ac054){return _0x5ac054;});}return null;};}function removeEntity(_0x25c1f2,_0x2edf1a){return function(_0x58b464){if(_0x58b464){return _0x58b464[_0x1cbc('0x28')]()[_0x1cbc('0x29')](function(){_0x25c1f2[_0x1cbc('0x22')](0xcc)[_0x1cbc('0x1c')]();});}};}function handleEntityNotFound(_0x494e62,_0x171d62){return function(_0x997405){if(!_0x997405){_0x494e62[_0x1cbc('0x2a')](0x194);}return _0x997405;};}function handleError(_0x273097,_0x5f5c64){_0x5f5c64=_0x5f5c64||0x1f4;return function(_0x3b43cf){logger[_0x1cbc('0x2b')](_0x3b43cf[_0x1cbc('0x2c')]);if(_0x3b43cf[_0x1cbc('0x2d')]){delete _0x3b43cf[_0x1cbc('0x2d')];}_0x273097['status'](_0x5f5c64)[_0x1cbc('0x2e')](_0x3b43cf);};}exports[_0x1cbc('0x2f')]=function(_0x36fb0c,_0x5e37ef){var _0x5196f4={},_0x4dc518={},_0x5cc761={'count':0x0,'rows':[]};var _0x4d84d5=_[_0x1cbc('0x30')](db[_0x1cbc('0x31')][_0x1cbc('0x32')],function(_0x47fc55){return{'name':_0x47fc55[_0x1cbc('0x33')],'type':_0x47fc55[_0x1cbc('0x34')][_0x1cbc('0x35')]};});_0x4dc518['model']=_['map'](_0x4d84d5,'name');_0x4dc518['query']=_[_0x1cbc('0x36')](_0x36fb0c['query']);_0x4dc518[_0x1cbc('0x37')]=_[_0x1cbc('0x38')](_0x4dc518[_0x1cbc('0x39')],_0x4dc518['query']);_0x5196f4['attributes']=_[_0x1cbc('0x38')](_0x4dc518[_0x1cbc('0x39')],qs['fields'](_0x36fb0c['query'][_0x1cbc('0x3a')]));_0x5196f4['attributes']=_0x5196f4['attributes'][_0x1cbc('0x3b')]?_0x5196f4[_0x1cbc('0x3c')]:_0x4dc518[_0x1cbc('0x39')];if(!_0x36fb0c[_0x1cbc('0x3d')][_0x1cbc('0x3e')](_0x1cbc('0x3f'))){_0x5196f4[_0x1cbc('0x20')]=qs[_0x1cbc('0x20')](_0x36fb0c['query'][_0x1cbc('0x20')]);_0x5196f4[_0x1cbc('0x1e')]=qs[_0x1cbc('0x1e')](_0x36fb0c[_0x1cbc('0x3d')][_0x1cbc('0x1e')]);}_0x5196f4[_0x1cbc('0x40')]=qs[_0x1cbc('0x41')](_0x36fb0c['query'][_0x1cbc('0x41')]);_0x5196f4[_0x1cbc('0x42')]=qs['filters'](_[_0x1cbc('0x43')](_0x36fb0c[_0x1cbc('0x3d')],_0x4dc518[_0x1cbc('0x37')]),_0x4d84d5);if(_0x36fb0c[_0x1cbc('0x3d')][_0x1cbc('0x44')]){_0x5196f4[_0x1cbc('0x42')]=_[_0x1cbc('0x45')](_0x5196f4['where'],{'$or':_[_0x1cbc('0x30')](_0x4d84d5,function(_0x176e48){if(_0x176e48[_0x1cbc('0x34')]!==_0x1cbc('0x46')){var _0x45eb12={};_0x45eb12[_0x176e48[_0x1cbc('0x2d')]]={'$like':'%'+_0x36fb0c['query'][_0x1cbc('0x44')]+'%'};return _0x45eb12;}})});}_0x5196f4=_['merge']({},_0x5196f4,_0x36fb0c['options']);var _0x3528bd={'where':_0x5196f4['where']};return db[_0x1cbc('0x31')][_0x1cbc('0x21')](_0x3528bd)[_0x1cbc('0x29')](function(_0x4b6666){_0x5cc761[_0x1cbc('0x21')]=_0x4b6666;if(_0x36fb0c[_0x1cbc('0x3d')][_0x1cbc('0x47')]){_0x5196f4[_0x1cbc('0x48')]=[{'all':!![]}];}return db[_0x1cbc('0x31')][_0x1cbc('0x49')](_0x5196f4);})[_0x1cbc('0x29')](function(_0x73da92){_0x5cc761[_0x1cbc('0x4a')]=_0x73da92;return _0x5cc761;})[_0x1cbc('0x29')](respondWithFilteredResult(_0x5e37ef,_0x5196f4))[_0x1cbc('0x4b')](handleError(_0x5e37ef,null));};exports[_0x1cbc('0x4c')]=function(_0x293ba6,_0x25f1a0){var _0x9d215a={'raw':![],'where':{'id':_0x293ba6[_0x1cbc('0x4d')]['id']}},_0x1e5ace={};_0x1e5ace[_0x1cbc('0x39')]=_[_0x1cbc('0x36')](db[_0x1cbc('0x31')]['rawAttributes']);_0x1e5ace[_0x1cbc('0x3d')]=_[_0x1cbc('0x36')](_0x293ba6[_0x1cbc('0x3d')]);_0x1e5ace[_0x1cbc('0x37')]=_[_0x1cbc('0x38')](_0x1e5ace[_0x1cbc('0x39')],_0x1e5ace[_0x1cbc('0x3d')]);_0x9d215a[_0x1cbc('0x3c')]=_[_0x1cbc('0x38')](_0x1e5ace[_0x1cbc('0x39')],qs['fields'](_0x293ba6[_0x1cbc('0x3d')][_0x1cbc('0x3a')]));_0x9d215a[_0x1cbc('0x3c')]=_0x9d215a[_0x1cbc('0x3c')]['length']?_0x9d215a[_0x1cbc('0x3c')]:_0x1e5ace['model'];if(_0x293ba6[_0x1cbc('0x3d')][_0x1cbc('0x47')]){_0x9d215a['include']=[{'all':!![]}];}_0x9d215a=_[_0x1cbc('0x45')]({},_0x9d215a,_0x293ba6[_0x1cbc('0x4e')]);return db['SalesforceAccount'][_0x1cbc('0x4f')](_0x9d215a)[_0x1cbc('0x29')](handleEntityNotFound(_0x25f1a0,null))[_0x1cbc('0x29')](respondWithResult(_0x25f1a0,null))[_0x1cbc('0x4b')](handleError(_0x25f1a0,null));};exports[_0x1cbc('0x50')]=function(_0x4c5ea5,_0x33cfd7){return db[_0x1cbc('0x31')][_0x1cbc('0x50')](_0x4c5ea5[_0x1cbc('0x51')],{})[_0x1cbc('0x29')](respondWithResult(_0x33cfd7,0xc9))[_0x1cbc('0x4b')](handleError(_0x33cfd7,null));};exports[_0x1cbc('0x27')]=function(_0x3b8d1a,_0x2b5f24){if(_0x3b8d1a[_0x1cbc('0x51')]['id']){delete _0x3b8d1a[_0x1cbc('0x51')]['id'];}return db[_0x1cbc('0x31')][_0x1cbc('0x4f')]({'where':{'id':_0x3b8d1a['params']['id']}})['then'](handleEntityNotFound(_0x2b5f24,null))[_0x1cbc('0x29')](saveUpdates(_0x3b8d1a[_0x1cbc('0x51')],null))[_0x1cbc('0x29')](respondWithResult(_0x2b5f24,null))[_0x1cbc('0x4b')](handleError(_0x2b5f24,null));};exports['destroy']=function(_0x360ee1,_0x1b4e80){return db[_0x1cbc('0x31')][_0x1cbc('0x4f')]({'where':{'id':_0x360ee1[_0x1cbc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1b4e80,null))['then'](removeEntity(_0x1b4e80,null))[_0x1cbc('0x4b')](handleError(_0x1b4e80,null));};exports[_0x1cbc('0x52')]=function(_0x13299a,_0x209978,_0x538659){var _0xb048d5={};var _0x5e4729={};var _0x7884d3;var _0xac8356;return db[_0x1cbc('0x31')][_0x1cbc('0x53')]({'where':{'id':_0x13299a['params']['id']}})[_0x1cbc('0x29')](handleEntityNotFound(_0x209978,null))[_0x1cbc('0x29')](function(_0x5d46d9){if(_0x5d46d9){_0x7884d3=_0x5d46d9;_0x5e4729[_0x1cbc('0x39')]=_['keys'](db[_0x1cbc('0x54')]['rawAttributes']);_0x5e4729['query']=_[_0x1cbc('0x36')](_0x13299a[_0x1cbc('0x3d')]);_0x5e4729[_0x1cbc('0x37')]=_[_0x1cbc('0x38')](_0x5e4729[_0x1cbc('0x39')],_0x5e4729[_0x1cbc('0x3d')]);_0xb048d5[_0x1cbc('0x3c')]=_[_0x1cbc('0x38')](_0x5e4729['model'],qs[_0x1cbc('0x3a')](_0x13299a[_0x1cbc('0x3d')][_0x1cbc('0x3a')]));_0xb048d5['attributes']=_0xb048d5[_0x1cbc('0x3c')]['length']?_0xb048d5[_0x1cbc('0x3c')]:_0x5e4729[_0x1cbc('0x39')];_0xb048d5['order']=qs['sort'](_0x13299a[_0x1cbc('0x3d')][_0x1cbc('0x41')]);_0xb048d5[_0x1cbc('0x42')]=qs[_0x1cbc('0x37')](_[_0x1cbc('0x43')](_0x13299a[_0x1cbc('0x3d')],_0x5e4729['filters']));if(_0x13299a[_0x1cbc('0x3d')]['filter']){_0xb048d5[_0x1cbc('0x42')]=_[_0x1cbc('0x45')](_0xb048d5[_0x1cbc('0x42')],{'$or':_[_0x1cbc('0x30')](_0xb048d5[_0x1cbc('0x3c')],function(_0xfea200){var _0x2dbcd0={};_0x2dbcd0[_0xfea200]={'$like':'%'+_0x13299a[_0x1cbc('0x3d')][_0x1cbc('0x44')]+'%'};return _0x2dbcd0;})});}_0xb048d5=_[_0x1cbc('0x45')]({},_0xb048d5,_0x13299a[_0x1cbc('0x4e')]);return _0x7884d3[_0x1cbc('0x52')](_0xb048d5);}})[_0x1cbc('0x29')](function(_0xca3812){if(_0xca3812){_0xac8356=_0xca3812['length'];if(!_0x13299a[_0x1cbc('0x3d')][_0x1cbc('0x3e')](_0x1cbc('0x3f'))){_0xb048d5[_0x1cbc('0x20')]=qs['limit'](_0x13299a[_0x1cbc('0x3d')][_0x1cbc('0x20')]);_0xb048d5[_0x1cbc('0x1e')]=qs[_0x1cbc('0x1e')](_0x13299a[_0x1cbc('0x3d')][_0x1cbc('0x1e')]);}return _0x7884d3['getConfigurations'](_0xb048d5);}})[_0x1cbc('0x29')](function(_0xf4a118){if(_0xf4a118){return _0xf4a118?{'count':_0xac8356,'rows':_0xf4a118}:null;}})[_0x1cbc('0x29')](respondWithResult(_0x209978,null))['catch'](handleError(_0x209978,null));};exports[_0x1cbc('0x55')]=function(_0x7891f7,_0x1d0e9c,_0x369679){if(_0x7891f7['body']['id']){delete _0x7891f7['body']['id'];}return db['SalesforceAccount'][_0x1cbc('0x53')]({'where':{'id':_0x7891f7[_0x1cbc('0x4d')]['id']}})[_0x1cbc('0x29')](handleEntityNotFound(_0x1d0e9c,null))[_0x1cbc('0x29')](function(_0xbf2e6f){if(_0xbf2e6f){_0x7891f7[_0x1cbc('0x51')][_0x1cbc('0x56')]=_0xbf2e6f['id'];_0x7891f7[_0x1cbc('0x51')][_0x1cbc('0x57')]=integrations[_0x1cbc('0x58')](_0x7891f7[_0x1cbc('0x51')]['channel'],_0x7891f7[_0x1cbc('0x51')]['type']);_0x7891f7['body'][_0x1cbc('0x59')]=integrations[_0x1cbc('0x5a')](_0x7891f7[_0x1cbc('0x51')]['channel'],_0x7891f7['body']['type']);return db[_0x1cbc('0x54')]['create'](_0x7891f7[_0x1cbc('0x51')],{'include':[{'model':db[_0x1cbc('0x5b')],'as':_0x1cbc('0x57')},{'model':db[_0x1cbc('0x5b')],'as':'Descriptions'}]});}return null;})[_0x1cbc('0x29')](respondWithResult(_0x1d0e9c,null))[_0x1cbc('0x4b')](handleError(_0x1d0e9c,null));};exports[_0x1cbc('0x5c')]=function(_0x4be8ca,_0x153ec9,_0x2a2d36){var _0x5b4e9a;var _0x326a1e='';var _0x58f6f2='Task';return db[_0x1cbc('0x31')][_0x1cbc('0x53')]({'where':{'id':_0x4be8ca[_0x1cbc('0x4d')]['id']},'attributes':['id',_0x1cbc('0x5d'),_0x1cbc('0x5e'),_0x1cbc('0x5f'),_0x1cbc('0x60'),_0x1cbc('0x61'),_0x1cbc('0x62')]})[_0x1cbc('0x29')](handleEntityNotFound(_0x153ec9,null))[_0x1cbc('0x29')](function(_0x157b12){if(_0x157b12){_0x326a1e=_0x157b12[_0x1cbc('0x5d')];var _0x1f846b=_0x326a1e[_0x1cbc('0x63')](-0x1);if(_0x1f846b==='/'){_0x326a1e=_0x326a1e['substring'](0x0,_0x326a1e[_0x1cbc('0x64')](_0x1f846b));}_0x5b4e9a=new jsforce[(_0x1cbc('0x65'))]({'oauth2':{'loginUrl':_0x326a1e,'clientId':_0x157b12['clientId'],'clientSecret':_0x157b12[_0x1cbc('0x5f')]}});return _0x5b4e9a[_0x1cbc('0x66')](_0x157b12[_0x1cbc('0x60')],_0x157b12[_0x1cbc('0x61')][_0x1cbc('0x67')](_0x157b12[_0x1cbc('0x62')]));}})[_0x1cbc('0x29')](function(_0x81d8eb){if(_0x81d8eb){if(!_[_0x1cbc('0x68')](_0x4be8ca[_0x1cbc('0x3d')][_0x1cbc('0x69')])){_0x58f6f2=_0x4be8ca[_0x1cbc('0x3d')][_0x1cbc('0x69')];}return _0x5b4e9a[_0x1cbc('0x6a')](_0x58f6f2)[_0x1cbc('0x6b')]();}})[_0x1cbc('0x29')](function(_0x198599){var _0x41b930=[_0x1cbc('0x6c'),_0x1cbc('0x6d'),_0x1cbc('0x6e'),_0x1cbc('0x6f'),_0x1cbc('0x70'),_0x1cbc('0x71')];var _0x5a17a9=[_0x1cbc('0x72'),_0x1cbc('0x73'),_0x1cbc('0x74'),_0x1cbc('0x75'),_0x1cbc('0x76'),_0x1cbc('0x77'),_0x1cbc('0x78')];if(_0x198599){_[_0x1cbc('0x79')](_0x198599['fields'],function(_0x4909d7){return _0x41b930[_0x1cbc('0x7a')](_0x4909d7[_0x1cbc('0x2d')])||!_0x5a17a9[_0x1cbc('0x7a')](_0x4909d7[_0x1cbc('0x34')]);});return{'count':_0x198599['fields'][_0x1cbc('0x3b')],'rows':_[_0x1cbc('0x30')](_0x198599[_0x1cbc('0x3a')],function(_0x16792b){return{'id':_0x16792b[_0x1cbc('0x2d')],'name':_0x16792b['label'],'custom':_0x16792b[_0x1cbc('0x7b')],'options':_0x16792b[_0x1cbc('0x7c')]['length']>0x0?_[_0x1cbc('0x30')](_0x16792b['picklistValues'],function(_0x5d18bc){return{'name':_0x5d18bc[_0x1cbc('0x7d')],'value':_0x5d18bc[_0x1cbc('0x7e')]};}):_0x16792b[_0x1cbc('0x34')]=='boolean'?[{'name':_0x1cbc('0x7f'),'value':'true'},{'name':_0x1cbc('0x80'),'value':_0x1cbc('0x81')}]:[]};})};}})[_0x1cbc('0x29')](respondWithResult(_0x153ec9,null))[_0x1cbc('0x4b')](function(_0x306e20){var _0x4fe4e6=_0x4be8ca['query'][_0x1cbc('0x82')]?0x1f4:_0x306e20[_0x1cbc('0x83')]||0x1f4;logger[_0x1cbc('0x2b')](_0x1cbc('0x84'),'getFields',_0x4fe4e6,JSON[_0x1cbc('0x85')](_0x306e20));delete _0x306e20[_0x1cbc('0x2d')];if(_0x4fe4e6===0x191){_0x4fe4e6=0x190;}_0x153ec9[_0x1cbc('0x22')](_0x4fe4e6)[_0x1cbc('0x2e')](_0x4be8ca[_0x1cbc('0x3d')][_0x1cbc('0x82')]?{'message':_0x1cbc('0x86'),'statusCode':_0x306e20[_0x1cbc('0x83')]}:_0x306e20);});};
\ No newline at end of file
+var _0xd215=['set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','SalesforceAccount','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','count','include','rows','catch','show','params','includeAll','find','create','body','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','map','picklistValues','value','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','json','undefined','limit','offset','status'];(function(_0x47b7c4,_0x3a26f3){var _0x2795fd=function(_0x46017b){while(--_0x46017b){_0x47b7c4['push'](_0x47b7c4['shift']());}};_0x2795fd(++_0x3a26f3);}(_0xd215,0xe0));var _0x5d21=function(_0x2d1393,_0x3f30f3){_0x2d1393=_0x2d1393-0x0;var _0x334d54=_0xd215[_0x2d1393];return _0x334d54;};'use strict';var emlformat=require(_0x5d21('0x0'));var rimraf=require(_0x5d21('0x1'));var zipdir=require(_0x5d21('0x2'));var jsonpatch=require(_0x5d21('0x3'));var rp=require(_0x5d21('0x4'));var moment=require(_0x5d21('0x5'));var BPromise=require(_0x5d21('0x6'));var Mustache=require('mustache');var util=require(_0x5d21('0x7'));var path=require(_0x5d21('0x8'));var sox=require(_0x5d21('0x9'));var csv=require(_0x5d21('0xa'));var ejs=require(_0x5d21('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5d21('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5d21('0xd'));var toCsv=require(_0x5d21('0xa'));var querystring=require(_0x5d21('0xe'));var Papa=require('papaparse');var Redis=require(_0x5d21('0xf'));var authService=require(_0x5d21('0x10'));var qs=require(_0x5d21('0x11'));var as=require(_0x5d21('0x12'));var hardwareService=require(_0x5d21('0x13'));var logger=require('../../config/logger')(_0x5d21('0x14'));var utils=require(_0x5d21('0x15'));var config=require(_0x5d21('0x16'));var licenseUtil=require(_0x5d21('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5d21('0x18'));function respondWithStatusCode(_0x4804a4,_0x327ccf){_0x327ccf=_0x327ccf||0xcc;return function(_0x47067b){if(_0x47067b){return _0x4804a4[_0x5d21('0x19')](_0x327ccf);}return _0x4804a4['status'](_0x327ccf)[_0x5d21('0x1a')]();};}function respondWithResult(_0x5ee828,_0x3baef4){_0x3baef4=_0x3baef4||0xc8;return function(_0xcbd966){if(_0xcbd966){return _0x5ee828['status'](_0x3baef4)[_0x5d21('0x1b')](_0xcbd966);}};}function respondWithFilteredResult(_0x1b35c9,_0x5295c6){return function(_0x36d477){if(_0x36d477){var _0x21c4c4=typeof _0x5295c6['offset']===_0x5d21('0x1c')&&typeof _0x5295c6[_0x5d21('0x1d')]===_0x5d21('0x1c');var _0x2a68a3=_0x36d477['count'];var _0x4bc7ce=_0x21c4c4?0x0:_0x5295c6['offset'];var _0x1e49e6=_0x21c4c4?_0x36d477['count']:_0x5295c6[_0x5d21('0x1e')]+_0x5295c6[_0x5d21('0x1d')];var _0x4e7e9a;if(_0x1e49e6>=_0x2a68a3){_0x1e49e6=_0x2a68a3;_0x4e7e9a=0xc8;}else{_0x4e7e9a=0xce;}_0x1b35c9[_0x5d21('0x1f')](_0x4e7e9a);return _0x1b35c9[_0x5d21('0x20')](_0x5d21('0x21'),_0x4bc7ce+'-'+_0x1e49e6+'/'+_0x2a68a3)[_0x5d21('0x1b')](_0x36d477);}return null;};}function patchUpdates(_0x293e04){return function(_0x2cf4e1){try{jsonpatch[_0x5d21('0x22')](_0x2cf4e1,_0x293e04,!![]);}catch(_0x2098ab){return BPromise['reject'](_0x2098ab);}return _0x2cf4e1[_0x5d21('0x23')]();};}function saveUpdates(_0x120e38,_0x564f0a){return function(_0x185bf2){if(_0x185bf2){return _0x185bf2[_0x5d21('0x24')](_0x120e38)[_0x5d21('0x25')](function(_0x476f97){return _0x476f97;});}return null;};}function removeEntity(_0x1771f6,_0x2cbad0){return function(_0x5ae31f){if(_0x5ae31f){return _0x5ae31f[_0x5d21('0x26')]()['then'](function(){_0x1771f6[_0x5d21('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2357,_0x32b870){return function(_0x9b9632){if(!_0x9b9632){_0x5b2357[_0x5d21('0x19')](0x194);}return _0x9b9632;};}function handleError(_0x25acc2,_0xb26170){_0xb26170=_0xb26170||0x1f4;return function(_0x30ac25){logger[_0x5d21('0x27')](_0x30ac25[_0x5d21('0x28')]);if(_0x30ac25[_0x5d21('0x29')]){delete _0x30ac25[_0x5d21('0x29')];}_0x25acc2[_0x5d21('0x1f')](_0xb26170)['send'](_0x30ac25);};}exports[_0x5d21('0x2a')]=function(_0x2ef9c2,_0x126357){var _0x50e041={},_0x2b4f97={},_0x3b123c={'count':0x0,'rows':[]};var _0x506d6e=_['map'](db[_0x5d21('0x2b')][_0x5d21('0x2c')],function(_0x2eab23){return{'name':_0x2eab23['fieldName'],'type':_0x2eab23[_0x5d21('0x2d')][_0x5d21('0x2e')]};});_0x2b4f97['model']=_['map'](_0x506d6e,_0x5d21('0x29'));_0x2b4f97['query']=_[_0x5d21('0x2f')](_0x2ef9c2[_0x5d21('0x30')]);_0x2b4f97[_0x5d21('0x31')]=_[_0x5d21('0x32')](_0x2b4f97[_0x5d21('0x33')],_0x2b4f97['query']);_0x50e041[_0x5d21('0x34')]=_[_0x5d21('0x32')](_0x2b4f97[_0x5d21('0x33')],qs[_0x5d21('0x35')](_0x2ef9c2['query'][_0x5d21('0x35')]));_0x50e041[_0x5d21('0x34')]=_0x50e041[_0x5d21('0x34')][_0x5d21('0x36')]?_0x50e041['attributes']:_0x2b4f97['model'];if(!_0x2ef9c2[_0x5d21('0x30')][_0x5d21('0x37')]('nolimit')){_0x50e041[_0x5d21('0x1d')]=qs[_0x5d21('0x1d')](_0x2ef9c2['query']['limit']);_0x50e041[_0x5d21('0x1e')]=qs[_0x5d21('0x1e')](_0x2ef9c2[_0x5d21('0x30')][_0x5d21('0x1e')]);}_0x50e041[_0x5d21('0x38')]=qs[_0x5d21('0x39')](_0x2ef9c2[_0x5d21('0x30')][_0x5d21('0x39')]);_0x50e041[_0x5d21('0x3a')]=qs[_0x5d21('0x31')](_[_0x5d21('0x3b')](_0x2ef9c2[_0x5d21('0x30')],_0x2b4f97[_0x5d21('0x31')]),_0x506d6e);if(_0x2ef9c2['query']['filter']){_0x50e041[_0x5d21('0x3a')]=_[_0x5d21('0x3c')](_0x50e041[_0x5d21('0x3a')],{'$or':_['map'](_0x506d6e,function(_0x1099cd){if(_0x1099cd[_0x5d21('0x2d')]!==_0x5d21('0x3d')){var _0x5680a1={};_0x5680a1[_0x1099cd[_0x5d21('0x29')]]={'$like':'%'+_0x2ef9c2[_0x5d21('0x30')][_0x5d21('0x3e')]+'%'};return _0x5680a1;}})});}_0x50e041=_[_0x5d21('0x3c')]({},_0x50e041,_0x2ef9c2[_0x5d21('0x3f')]);var _0xeeea5f={'where':_0x50e041['where']};return db['SalesforceAccount'][_0x5d21('0x40')](_0xeeea5f)[_0x5d21('0x25')](function(_0x278087){_0x3b123c[_0x5d21('0x40')]=_0x278087;if(_0x2ef9c2['query']['includeAll']){_0x50e041[_0x5d21('0x41')]=[{'all':!![]}];}return db[_0x5d21('0x2b')]['findAll'](_0x50e041);})[_0x5d21('0x25')](function(_0x186a9b){_0x3b123c[_0x5d21('0x42')]=_0x186a9b;return _0x3b123c;})['then'](respondWithFilteredResult(_0x126357,_0x50e041))[_0x5d21('0x43')](handleError(_0x126357,null));};exports[_0x5d21('0x44')]=function(_0x336f0c,_0x240d2e){var _0x542265={'raw':![],'where':{'id':_0x336f0c[_0x5d21('0x45')]['id']}},_0x519d03={};_0x519d03[_0x5d21('0x33')]=_[_0x5d21('0x2f')](db[_0x5d21('0x2b')][_0x5d21('0x2c')]);_0x519d03[_0x5d21('0x30')]=_[_0x5d21('0x2f')](_0x336f0c['query']);_0x519d03[_0x5d21('0x31')]=_['intersection'](_0x519d03['model'],_0x519d03['query']);_0x542265[_0x5d21('0x34')]=_['intersection'](_0x519d03['model'],qs['fields'](_0x336f0c[_0x5d21('0x30')][_0x5d21('0x35')]));_0x542265[_0x5d21('0x34')]=_0x542265[_0x5d21('0x34')][_0x5d21('0x36')]?_0x542265[_0x5d21('0x34')]:_0x519d03['model'];if(_0x336f0c['query'][_0x5d21('0x46')]){_0x542265[_0x5d21('0x41')]=[{'all':!![]}];}_0x542265=_[_0x5d21('0x3c')]({},_0x542265,_0x336f0c[_0x5d21('0x3f')]);return db[_0x5d21('0x2b')][_0x5d21('0x47')](_0x542265)[_0x5d21('0x25')](handleEntityNotFound(_0x240d2e,null))[_0x5d21('0x25')](respondWithResult(_0x240d2e,null))['catch'](handleError(_0x240d2e,null));};exports[_0x5d21('0x48')]=function(_0x159973,_0x15927f){return db[_0x5d21('0x2b')][_0x5d21('0x48')](_0x159973['body'],{})[_0x5d21('0x25')](respondWithResult(_0x15927f,0xc9))[_0x5d21('0x43')](handleError(_0x15927f,null));};exports['update']=function(_0xd84284,_0x536ec3){if(_0xd84284[_0x5d21('0x49')]['id']){delete _0xd84284[_0x5d21('0x49')]['id'];}return db[_0x5d21('0x2b')][_0x5d21('0x47')]({'where':{'id':_0xd84284['params']['id']}})[_0x5d21('0x25')](handleEntityNotFound(_0x536ec3,null))['then'](saveUpdates(_0xd84284[_0x5d21('0x49')],null))[_0x5d21('0x25')](respondWithResult(_0x536ec3,null))[_0x5d21('0x43')](handleError(_0x536ec3,null));};exports[_0x5d21('0x26')]=function(_0x1b97eb,_0x72a929){return db[_0x5d21('0x2b')][_0x5d21('0x47')]({'where':{'id':_0x1b97eb[_0x5d21('0x45')]['id']}})[_0x5d21('0x25')](handleEntityNotFound(_0x72a929,null))[_0x5d21('0x25')](removeEntity(_0x72a929,null))[_0x5d21('0x43')](handleError(_0x72a929,null));};exports['getConfigurations']=function(_0x40078e,_0x31dcd9,_0xb87ac8){var _0x17d093={};var _0x47839f={};var _0x528d40;var _0x114049;return db[_0x5d21('0x2b')][_0x5d21('0x4a')]({'where':{'id':_0x40078e[_0x5d21('0x45')]['id']}})[_0x5d21('0x25')](handleEntityNotFound(_0x31dcd9,null))[_0x5d21('0x25')](function(_0x51eeb2){if(_0x51eeb2){_0x528d40=_0x51eeb2;_0x47839f[_0x5d21('0x33')]=_[_0x5d21('0x2f')](db[_0x5d21('0x4b')][_0x5d21('0x2c')]);_0x47839f['query']=_[_0x5d21('0x2f')](_0x40078e['query']);_0x47839f[_0x5d21('0x31')]=_['intersection'](_0x47839f[_0x5d21('0x33')],_0x47839f[_0x5d21('0x30')]);_0x17d093[_0x5d21('0x34')]=_[_0x5d21('0x32')](_0x47839f['model'],qs['fields'](_0x40078e[_0x5d21('0x30')][_0x5d21('0x35')]));_0x17d093[_0x5d21('0x34')]=_0x17d093['attributes'][_0x5d21('0x36')]?_0x17d093[_0x5d21('0x34')]:_0x47839f[_0x5d21('0x33')];_0x17d093[_0x5d21('0x38')]=qs[_0x5d21('0x39')](_0x40078e['query'][_0x5d21('0x39')]);_0x17d093[_0x5d21('0x3a')]=qs[_0x5d21('0x31')](_[_0x5d21('0x3b')](_0x40078e[_0x5d21('0x30')],_0x47839f[_0x5d21('0x31')]));if(_0x40078e[_0x5d21('0x30')][_0x5d21('0x3e')]){_0x17d093['where']=_[_0x5d21('0x3c')](_0x17d093[_0x5d21('0x3a')],{'$or':_['map'](_0x17d093[_0x5d21('0x34')],function(_0x5f53ca){var _0x1deea4={};_0x1deea4[_0x5f53ca]={'$like':'%'+_0x40078e['query'][_0x5d21('0x3e')]+'%'};return _0x1deea4;})});}_0x17d093=_[_0x5d21('0x3c')]({},_0x17d093,_0x40078e[_0x5d21('0x3f')]);return _0x528d40['getConfigurations'](_0x17d093);}})[_0x5d21('0x25')](function(_0x3f8b7d){if(_0x3f8b7d){_0x114049=_0x3f8b7d['length'];if(!_0x40078e['query'][_0x5d21('0x37')]('nolimit')){_0x17d093['limit']=qs[_0x5d21('0x1d')](_0x40078e['query'][_0x5d21('0x1d')]);_0x17d093[_0x5d21('0x1e')]=qs[_0x5d21('0x1e')](_0x40078e[_0x5d21('0x30')][_0x5d21('0x1e')]);}return _0x528d40[_0x5d21('0x4c')](_0x17d093);}})[_0x5d21('0x25')](function(_0x1b38de){if(_0x1b38de){return _0x1b38de?{'count':_0x114049,'rows':_0x1b38de}:null;}})['then'](respondWithResult(_0x31dcd9,null))[_0x5d21('0x43')](handleError(_0x31dcd9,null));};exports[_0x5d21('0x4d')]=function(_0x44690c,_0x12b9f7,_0x4aae01){if(_0x44690c['body']['id']){delete _0x44690c[_0x5d21('0x49')]['id'];}return db['SalesforceAccount'][_0x5d21('0x4a')]({'where':{'id':_0x44690c[_0x5d21('0x45')]['id']}})[_0x5d21('0x25')](handleEntityNotFound(_0x12b9f7,null))['then'](function(_0x4a60b5){if(_0x4a60b5){_0x44690c['body']['AccountId']=_0x4a60b5['id'];_0x44690c[_0x5d21('0x49')][_0x5d21('0x4e')]=integrations[_0x5d21('0x4f')](_0x44690c[_0x5d21('0x49')][_0x5d21('0x50')],_0x44690c[_0x5d21('0x49')][_0x5d21('0x2d')]);_0x44690c['body'][_0x5d21('0x51')]=integrations[_0x5d21('0x52')](_0x44690c[_0x5d21('0x49')][_0x5d21('0x50')],_0x44690c['body']['type']);return db[_0x5d21('0x4b')][_0x5d21('0x48')](_0x44690c['body'],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x5d21('0x53')],'as':_0x5d21('0x51')}]});}return null;})[_0x5d21('0x25')](respondWithResult(_0x12b9f7,null))[_0x5d21('0x43')](handleError(_0x12b9f7,null));};exports['getFields']=function(_0xf84863,_0x4f03f2,_0x2f3d34){var _0x3031af;var _0x21e0f4='';var _0x524887=_0x5d21('0x54');return db[_0x5d21('0x2b')][_0x5d21('0x4a')]({'where':{'id':_0xf84863['params']['id']},'attributes':['id',_0x5d21('0x55'),_0x5d21('0x56'),_0x5d21('0x57'),_0x5d21('0x58'),_0x5d21('0x59'),_0x5d21('0x5a')]})['then'](handleEntityNotFound(_0x4f03f2,null))[_0x5d21('0x25')](function(_0x4d467e){if(_0x4d467e){_0x21e0f4=_0x4d467e['remoteUri'];var _0x3d39eb=_0x21e0f4[_0x5d21('0x5b')](-0x1);if(_0x3d39eb==='/'){_0x21e0f4=_0x21e0f4['substring'](0x0,_0x21e0f4[_0x5d21('0x5c')](_0x3d39eb));}_0x3031af=new jsforce[(_0x5d21('0x5d'))]({'oauth2':{'loginUrl':_0x21e0f4,'clientId':_0x4d467e[_0x5d21('0x56')],'clientSecret':_0x4d467e[_0x5d21('0x57')]}});return _0x3031af['login'](_0x4d467e[_0x5d21('0x58')],_0x4d467e[_0x5d21('0x59')][_0x5d21('0x5e')](_0x4d467e[_0x5d21('0x5a')]));}})[_0x5d21('0x25')](function(_0x56983e){if(_0x56983e){if(!_[_0x5d21('0x5f')](_0xf84863[_0x5d21('0x30')][_0x5d21('0x60')])){_0x524887=_0xf84863[_0x5d21('0x30')][_0x5d21('0x60')];}return _0x3031af[_0x5d21('0x61')](_0x524887)['describe']();}})[_0x5d21('0x25')](function(_0x16fe09){var _0x36a531=[_0x5d21('0x62'),_0x5d21('0x63'),_0x5d21('0x64'),_0x5d21('0x65'),_0x5d21('0x66'),_0x5d21('0x67')];var _0x480892=[_0x5d21('0x68'),_0x5d21('0x69'),_0x5d21('0x6a'),_0x5d21('0x6b'),_0x5d21('0x6c'),_0x5d21('0x6d'),_0x5d21('0x6e')];if(_0x16fe09){_[_0x5d21('0x6f')](_0x16fe09[_0x5d21('0x35')],function(_0xc955bc){return _0x36a531[_0x5d21('0x70')](_0xc955bc[_0x5d21('0x29')])||!_0x480892[_0x5d21('0x70')](_0xc955bc[_0x5d21('0x2d')]);});return{'count':_0x16fe09[_0x5d21('0x35')]['length'],'rows':_['map'](_0x16fe09['fields'],function(_0x3092de){return{'id':_0x3092de['name'],'name':_0x3092de[_0x5d21('0x71')],'custom':_0x3092de[_0x5d21('0x72')],'options':_0x3092de['picklistValues'][_0x5d21('0x36')]>0x0?_[_0x5d21('0x73')](_0x3092de[_0x5d21('0x74')],function(_0x472ba3){return{'name':_0x472ba3[_0x5d21('0x71')],'value':_0x472ba3[_0x5d21('0x75')]};}):_0x3092de[_0x5d21('0x2d')]=='boolean'?[{'name':_0x5d21('0x76'),'value':_0x5d21('0x77')},{'name':_0x5d21('0x78'),'value':'false'}]:[]};})};}})[_0x5d21('0x25')](respondWithResult(_0x4f03f2,null))[_0x5d21('0x43')](function(_0x1d583c){var _0x1946f6=_0xf84863[_0x5d21('0x30')][_0x5d21('0x79')]?0x1f4:_0x1d583c[_0x5d21('0x7a')]||0x1f4;logger[_0x5d21('0x27')](_0x5d21('0x7b'),_0x5d21('0x7c'),_0x1946f6,JSON[_0x5d21('0x7d')](_0x1d583c));delete _0x1d583c[_0x5d21('0x29')];if(_0x1946f6===0x191){_0x1946f6=0x190;}_0x4f03f2[_0x5d21('0x1f')](_0x1946f6)[_0x5d21('0x7e')](_0xf84863['query'][_0x5d21('0x79')]?{'message':_0x5d21('0x7f'),'statusCode':_0x1d583c[_0x5d21('0x7a')]}:_0x1d583c);});};
\ No newline at end of file
index 8d18b96..4587f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe516=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api'];(function(_0x341850,_0x272961){var _0x1e31f0=function(_0x463ad5){while(--_0x463ad5){_0x341850['push'](_0x341850['shift']());}};_0x1e31f0(++_0x272961);}(_0xe516,0x129));var _0x6e51=function(_0x5ad67c,_0x144860){_0x5ad67c=_0x5ad67c-0x0;var _0xccce2e=_0xe516[_0x5ad67c];return _0xccce2e;};'use strict';var _=require('lodash');var util=require(_0x6e51('0x0'));var logger=require(_0x6e51('0x1'))(_0x6e51('0x2'));var moment=require(_0x6e51('0x3'));var BPromise=require(_0x6e51('0x4'));var rp=require(_0x6e51('0x5'));var fs=require('fs');var path=require(_0x6e51('0x6'));var rimraf=require(_0x6e51('0x7'));var config=require(_0x6e51('0x8'));var attributes=require(_0x6e51('0x9'));var integrations=require(_0x6e51('0xa'));module[_0x6e51('0xb')]=function(_0x1c3d87,_0x52cfe7){return _0x1c3d87[_0x6e51('0xc')](_0x6e51('0xd'),attributes,{'tableName':_0x6e51('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd171=['rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x474fb3,_0x33c57e){var _0x4f27cd=function(_0x537c63){while(--_0x537c63){_0x474fb3['push'](_0x474fb3['shift']());}};_0x4f27cd(++_0x33c57e);}(_0xd171,0xa3));var _0x1d17=function(_0x30c1d6,_0x4de4ba){_0x30c1d6=_0x30c1d6-0x0;var _0x34433a=_0xd171[_0x30c1d6];return _0x34433a;};'use strict';var _=require(_0x1d17('0x0'));var util=require(_0x1d17('0x1'));var logger=require(_0x1d17('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1d17('0x3'));var rp=require(_0x1d17('0x4'));var fs=require('fs');var path=require(_0x1d17('0x5'));var rimraf=require(_0x1d17('0x6'));var config=require(_0x1d17('0x7'));var attributes=require(_0x1d17('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x1d17('0x9')]=function(_0x11df32,_0x57dbc2){return _0x11df32[_0x1d17('0xa')](_0x1d17('0xb'),attributes,{'tableName':_0x1d17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae1a589..b48839b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe52c=['model','ShowSalesforceAccount','map','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe52c,0xa3));var _0xce52=function(_0xef97e2,_0x4587b1){_0xef97e2=_0xef97e2-0x0;var _0xe05b32=_0xe52c[_0xef97e2];return _0xe05b32;};'use strict';var _=require(_0xce52('0x0'));var util=require(_0xce52('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xce52('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce52('0x3'))['db'];var utils=require(_0xce52('0x4'));var logger=require(_0xce52('0x5'))(_0xce52('0x6'));var config=require('../../config/environment');var jayson=require(_0xce52('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cbc45,_0x1855cb,_0x30958d){return new BPromise(function(_0x21f06f,_0x23700e){return client[_0xce52('0x8')](_0x5cbc45,_0x30958d)[_0xce52('0x9')](function(_0x57e141){logger[_0xce52('0xa')](_0xce52('0xb'),_0x1855cb,_0xce52('0xc'));logger[_0xce52('0xd')](_0xce52('0xe'),_0x1855cb,_0xce52('0xc'),JSON[_0xce52('0xf')](_0x57e141));if(_0x57e141[_0xce52('0x10')]){if(_0x57e141[_0xce52('0x10')][_0xce52('0x11')]===0x1f4){logger['error'](_0xce52('0xb'),_0x1855cb,_0x57e141[_0xce52('0x10')]['message']);return _0x23700e(_0x57e141[_0xce52('0x10')]['message']);}logger[_0xce52('0x10')](_0xce52('0xb'),_0x1855cb,_0x57e141['error'][_0xce52('0x12')]);return _0x21f06f(_0x57e141[_0xce52('0x10')][_0xce52('0x12')]);}else{logger[_0xce52('0xa')](_0xce52('0xb'),_0x1855cb,_0xce52('0xc'));_0x21f06f(_0x57e141[_0xce52('0x13')][_0xce52('0x12')]);}})[_0xce52('0x14')](function(_0x2b9740){logger['error'](_0xce52('0xb'),_0x1855cb,_0x2b9740);_0x23700e(_0x2b9740);});});}exports[_0xce52('0x15')]=function(_0x34acdd){var _0x239652=this;return new Promise(function(_0x367ccf,_0x121c1c){return db[_0xce52('0x16')]['findAll']({'raw':_0x34acdd[_0xce52('0x17')]?_0x34acdd[_0xce52('0x17')][_0xce52('0x18')]===undefined?!![]:![]:!![],'where':_0x34acdd[_0xce52('0x17')]?_0x34acdd[_0xce52('0x17')][_0xce52('0x19')]||null:null,'attributes':_0x34acdd['options']?_0x34acdd[_0xce52('0x17')][_0xce52('0x1a')]||null:null,'limit':_0x34acdd['options']?_0x34acdd['options'][_0xce52('0x1b')]||null:null,'include':_0x34acdd['options']?_0x34acdd[_0xce52('0x17')][_0xce52('0x1c')]?_['map'](_0x34acdd[_0xce52('0x17')]['include'],function(_0x3ffe5e){return{'model':db[_0x3ffe5e['model']],'as':_0x3ffe5e['as'],'attributes':_0x3ffe5e[_0xce52('0x1a')],'include':_0x3ffe5e[_0xce52('0x1c')]?_['map'](_0x3ffe5e[_0xce52('0x1c')],function(_0x3b5f74){return{'model':db[_0x3b5f74[_0xce52('0x1d')]],'as':_0x3b5f74['as'],'attributes':_0x3b5f74[_0xce52('0x1a')],'include':_0x3b5f74[_0xce52('0x1c')]?_['map'](_0x3b5f74['include'],function(_0x22fa88){return{'model':db[_0x22fa88['model']],'as':_0x22fa88['as'],'attributes':_0x22fa88[_0xce52('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xce52('0x9')](function(_0x591f16){logger[_0xce52('0xa')](_0xce52('0x15'),_0x34acdd);logger[_0xce52('0xd')]('GetSalesforceAccount',_0x34acdd,JSON[_0xce52('0xf')](_0x591f16));_0x367ccf(_0x591f16);})[_0xce52('0x14')](function(_0xc57a8f){logger[_0xce52('0x10')]('GetSalesforceAccount',_0xc57a8f[_0xce52('0x12')],_0x34acdd);_0x121c1c(_0x239652['error'](0x1f4,_0xc57a8f['message']));});});};exports[_0xce52('0x1e')]=function(_0x456d6d){var _0x297284=this;return new Promise(function(_0x450fe6,_0x1a5993){return db[_0xce52('0x16')]['find']({'raw':_0x456d6d[_0xce52('0x17')]?_0x456d6d['options'][_0xce52('0x18')]===undefined?!![]:![]:!![],'where':_0x456d6d[_0xce52('0x17')]?_0x456d6d[_0xce52('0x17')][_0xce52('0x19')]||null:null,'attributes':_0x456d6d[_0xce52('0x17')]?_0x456d6d[_0xce52('0x17')]['attributes']||null:null,'include':_0x456d6d[_0xce52('0x17')]?_0x456d6d[_0xce52('0x17')][_0xce52('0x1c')]?_[_0xce52('0x1f')](_0x456d6d[_0xce52('0x17')][_0xce52('0x1c')],function(_0x159302){return{'model':db[_0x159302[_0xce52('0x1d')]],'as':_0x159302['as'],'attributes':_0x159302['attributes'],'include':_0x159302[_0xce52('0x1c')]?_[_0xce52('0x1f')](_0x159302[_0xce52('0x1c')],function(_0x12038e){return{'model':db[_0x12038e[_0xce52('0x1d')]],'as':_0x12038e['as'],'attributes':_0x12038e[_0xce52('0x1a')],'include':_0x12038e[_0xce52('0x1c')]?_[_0xce52('0x1f')](_0x12038e[_0xce52('0x1c')],function(_0x5b8dd7){return{'model':db[_0x5b8dd7['model']],'as':_0x5b8dd7['as'],'attributes':_0x5b8dd7['attributes']};}):[]};}):[]};}):[]:[]})[_0xce52('0x9')](function(_0x114395){logger[_0xce52('0xa')](_0xce52('0x1e'),_0x456d6d);logger[_0xce52('0xd')](_0xce52('0x1e'),_0x456d6d,JSON['stringify'](_0x114395));_0x450fe6(_0x114395);})[_0xce52('0x14')](function(_0x342550){logger[_0xce52('0x10')]('ShowSalesforceAccount',_0x342550[_0xce52('0x12')],_0x456d6d);_0x1a5993(_0x297284['error'](0x1f4,_0x342550['message']));});});};
\ No newline at end of file
+var _0x0a1c=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','map','include','model','attributes','stringify','catch','ShowSalesforceAccount'];(function(_0x50cae4,_0x453238){var _0x552577=function(_0x48deee){while(--_0x48deee){_0x50cae4['push'](_0x50cae4['shift']());}};_0x552577(++_0x453238);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x0a1c[_0x8560d3];return _0x33b1b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc0a1('0x0'));var BPromise=require(_0xc0a1('0x1'));var rs=require(_0xc0a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc0a1('0x3'));var logger=require(_0xc0a1('0x4'))(_0xc0a1('0x5'));var config=require(_0xc0a1('0x6'));var jayson=require(_0xc0a1('0x7'));var client=jayson[_0xc0a1('0x8')][_0xc0a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22405c,_0x1712cd,_0x43d318){return new BPromise(function(_0x43623a,_0x42c215){return client[_0xc0a1('0xa')](_0x22405c,_0x43d318)[_0xc0a1('0xb')](function(_0x38ed7b){logger[_0xc0a1('0xc')](_0xc0a1('0xd'),_0x1712cd,'request\x20sent');logger[_0xc0a1('0xe')](_0xc0a1('0xf'),_0x1712cd,_0xc0a1('0x10'),JSON['stringify'](_0x38ed7b));if(_0x38ed7b[_0xc0a1('0x11')]){if(_0x38ed7b[_0xc0a1('0x11')][_0xc0a1('0x12')]===0x1f4){logger['error'](_0xc0a1('0xd'),_0x1712cd,_0x38ed7b[_0xc0a1('0x11')]['message']);return _0x42c215(_0x38ed7b[_0xc0a1('0x11')][_0xc0a1('0x13')]);}logger[_0xc0a1('0x11')](_0xc0a1('0xd'),_0x1712cd,_0x38ed7b[_0xc0a1('0x11')]['message']);return _0x43623a(_0x38ed7b['error'][_0xc0a1('0x13')]);}else{logger[_0xc0a1('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x1712cd,'request\x20sent');_0x43623a(_0x38ed7b[_0xc0a1('0x14')][_0xc0a1('0x13')]);}})['catch'](function(_0x334cc4){logger[_0xc0a1('0x11')](_0xc0a1('0xd'),_0x1712cd,_0x334cc4);_0x42c215(_0x334cc4);});});}exports[_0xc0a1('0x15')]=function(_0x234067){var _0x124d0f=this;return new Promise(function(_0x36620e,_0x16755f){return db[_0xc0a1('0x16')][_0xc0a1('0x17')]({'raw':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')][_0xc0a1('0x19')]===undefined?!![]:![]:!![],'where':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')][_0xc0a1('0x1a')]||null:null,'attributes':_0x234067['options']?_0x234067[_0xc0a1('0x18')]['attributes']||null:null,'limit':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')][_0xc0a1('0x1b')]||null:null,'include':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')]['include']?_[_0xc0a1('0x1c')](_0x234067[_0xc0a1('0x18')][_0xc0a1('0x1d')],function(_0x3e7997){return{'model':db[_0x3e7997[_0xc0a1('0x1e')]],'as':_0x3e7997['as'],'attributes':_0x3e7997[_0xc0a1('0x1f')],'include':_0x3e7997[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x3e7997[_0xc0a1('0x1d')],function(_0x161bff){return{'model':db[_0x161bff['model']],'as':_0x161bff['as'],'attributes':_0x161bff['attributes'],'include':_0x161bff[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x161bff['include'],function(_0x52ba51){return{'model':db[_0x52ba51[_0xc0a1('0x1e')]],'as':_0x52ba51['as'],'attributes':_0x52ba51[_0xc0a1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x203ab8){logger[_0xc0a1('0xc')](_0xc0a1('0x15'),_0x234067);logger[_0xc0a1('0xe')](_0xc0a1('0x15'),_0x234067,JSON[_0xc0a1('0x20')](_0x203ab8));_0x36620e(_0x203ab8);})[_0xc0a1('0x21')](function(_0x2bc99f){logger['error'](_0xc0a1('0x15'),_0x2bc99f[_0xc0a1('0x13')],_0x234067);_0x16755f(_0x124d0f[_0xc0a1('0x11')](0x1f4,_0x2bc99f[_0xc0a1('0x13')]));});});};exports[_0xc0a1('0x22')]=function(_0x38750d){var _0x4bc7fc=this;return new Promise(function(_0x5741a6,_0x3bf70f){return db[_0xc0a1('0x16')]['find']({'raw':_0x38750d[_0xc0a1('0x18')]?_0x38750d['options'][_0xc0a1('0x19')]===undefined?!![]:![]:!![],'where':_0x38750d['options']?_0x38750d[_0xc0a1('0x18')][_0xc0a1('0x1a')]||null:null,'attributes':_0x38750d[_0xc0a1('0x18')]?_0x38750d['options'][_0xc0a1('0x1f')]||null:null,'include':_0x38750d['options']?_0x38750d[_0xc0a1('0x18')][_0xc0a1('0x1d')]?_['map'](_0x38750d[_0xc0a1('0x18')][_0xc0a1('0x1d')],function(_0x3ea952){return{'model':db[_0x3ea952[_0xc0a1('0x1e')]],'as':_0x3ea952['as'],'attributes':_0x3ea952[_0xc0a1('0x1f')],'include':_0x3ea952[_0xc0a1('0x1d')]?_['map'](_0x3ea952[_0xc0a1('0x1d')],function(_0x402479){return{'model':db[_0x402479[_0xc0a1('0x1e')]],'as':_0x402479['as'],'attributes':_0x402479[_0xc0a1('0x1f')],'include':_0x402479[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x402479['include'],function(_0x5e1ac6){return{'model':db[_0x5e1ac6[_0xc0a1('0x1e')]],'as':_0x5e1ac6['as'],'attributes':_0x5e1ac6[_0xc0a1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0a1('0xb')](function(_0x4796a8){logger['info'](_0xc0a1('0x22'),_0x38750d);logger[_0xc0a1('0xe')](_0xc0a1('0x22'),_0x38750d,JSON['stringify'](_0x4796a8));_0x5741a6(_0x4796a8);})[_0xc0a1('0x21')](function(_0x423da0){logger['error'](_0xc0a1('0x22'),_0x423da0[_0xc0a1('0x13')],_0x38750d);_0x3bf70f(_0x4bc7fc['error'](0x1f4,_0x423da0[_0xc0a1('0x13')]));});});};
\ No newline at end of file
index 8f474cf..2d1bdfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x269798,_0x474bab){var _0x40393e=function(_0xbc06bf){while(--_0xbc06bf){_0x269798['push'](_0x269798['shift']());}};_0x40393e(++_0x474bab);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdb28,0x106));var _0x8db2=function(_0x22508f,_0x4d1eb1){_0x22508f=_0x22508f-0x0;var _0x471859=_0xdb28[_0x22508f];return _0x471859;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router;
\ No newline at end of file
index 3a79cce..0afad51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec4=['exports','STRING','ENUM','Task','contact_lead','contact','account_contact_lead','lead','account','sequelize'];(function(_0x20b6cc,_0x3684bc){var _0x571272=function(_0x561729){while(--_0x561729){_0x20b6cc['push'](_0x20b6cc['shift']());}};_0x571272(++_0x3684bc);}(_0xeec4,0xef));var _0x4eec=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0xeec4[_0x13ff53];return _0x290228;};'use strict';var Sequelize=require(_0x4eec('0x0'));module[_0x4eec('0x1')]={'name':{'type':Sequelize[_0x4eec('0x2')]},'description':{'type':Sequelize[_0x4eec('0x2')]},'ticketType':{'type':Sequelize[_0x4eec('0x3')]('Task','Case'),'defaultValue':_0x4eec('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x4eec('0x5'),_0x4eec('0x6'),'lead',_0x4eec('0x7'),'account'),'defaultValue':_0x4eec('0x5')},'moduleCreate':{'type':Sequelize[_0x4eec('0x3')]('nothing',_0x4eec('0x6'),_0x4eec('0x8'),_0x4eec('0x9')),'defaultValue':_0x4eec('0x8')},'leadId':{'type':Sequelize[_0x4eec('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x4eec('0x2')]}};
\ No newline at end of file
+var _0xf816=['exports','STRING','Task','ENUM','contact_lead','lead','account_contact_lead','account','nothing','contact','sequelize'];(function(_0x3cf9d4,_0x519083){var _0x2b6e52=function(_0x290680){while(--_0x290680){_0x3cf9d4['push'](_0x3cf9d4['shift']());}};_0x2b6e52(++_0x519083);}(_0xf816,0x11d));var _0x6f81=function(_0x1915e7,_0x150549){_0x1915e7=_0x1915e7-0x0;var _0x4bcf07=_0xf816[_0x1915e7];return _0x4bcf07;};'use strict';var Sequelize=require(_0x6f81('0x0'));module[_0x6f81('0x1')]={'name':{'type':Sequelize[_0x6f81('0x2')]},'description':{'type':Sequelize[_0x6f81('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x6f81('0x3'),'Case'),'defaultValue':_0x6f81('0x3')},'moduleSearch':{'type':Sequelize[_0x6f81('0x4')](_0x6f81('0x5'),'contact',_0x6f81('0x6'),_0x6f81('0x7'),_0x6f81('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x6f81('0x4')](_0x6f81('0x9'),_0x6f81('0xa'),_0x6f81('0x6'),'account'),'defaultValue':_0x6f81('0x6')},'leadId':{'type':Sequelize[_0x6f81('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x6f81('0x2')]}};
\ No newline at end of file
index 58e0925..f39f719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86b6=['order','sort','where','pick','filter','merge','type','findAll','rows','catch','show','length','includeAll','include','options','find','create','body','params','destroy','getFields','findOne','map','getSubjects','getDescriptions','SalesforceField','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','apply','reject','save','update','then','error','stack','name','index','SalesforceConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x86f5d7,_0x1fab10){var _0x7123d=function(_0x4aa8ca){while(--_0x4aa8ca){_0x86f5d7['push'](_0x86f5d7['shift']());}};_0x7123d(++_0x1fab10);}(_0x86b6,0x6b));var _0x686b=function(_0x75b25d,_0x3fbae3){_0x75b25d=_0x75b25d-0x0;var _0x3400de=_0x86b6[_0x75b25d];return _0x3400de;};'use strict';var emlformat=require(_0x686b('0x0'));var rimraf=require(_0x686b('0x1'));var zipdir=require(_0x686b('0x2'));var jsonpatch=require(_0x686b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x686b('0x4'));var Mustache=require(_0x686b('0x5'));var util=require(_0x686b('0x6'));var path=require(_0x686b('0x7'));var sox=require(_0x686b('0x8'));var csv=require(_0x686b('0x9'));var ejs=require(_0x686b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x686b('0xb'));var squel=require(_0x686b('0xc'));var crypto=require(_0x686b('0xd'));var jsforce=require(_0x686b('0xe'));var deskjs=require(_0x686b('0xf'));var toCsv=require(_0x686b('0x9'));var querystring=require('querystring');var Papa=require(_0x686b('0x10'));var Redis=require(_0x686b('0x11'));var authService=require(_0x686b('0x12'));var qs=require(_0x686b('0x13'));var as=require(_0x686b('0x14'));var hardwareService=require(_0x686b('0x15'));var logger=require(_0x686b('0x16'))(_0x686b('0x17'));var utils=require('../../config/utils');var config=require(_0x686b('0x18'));var licenseUtil=require(_0x686b('0x19'));var db=require(_0x686b('0x1a'))['db'];function respondWithStatusCode(_0x2428f1,_0x23f0a9){_0x23f0a9=_0x23f0a9||0xcc;return function(_0x100e04){if(_0x100e04){return _0x2428f1[_0x686b('0x1b')](_0x23f0a9);}return _0x2428f1['status'](_0x23f0a9)[_0x686b('0x1c')]();};}function respondWithResult(_0x312cad,_0x4edb30){_0x4edb30=_0x4edb30||0xc8;return function(_0x3f0494){if(_0x3f0494){return _0x312cad[_0x686b('0x1d')](_0x4edb30)[_0x686b('0x1e')](_0x3f0494);}};}function respondWithFilteredResult(_0x51d3bc,_0xdbc1db){return function(_0x1188de){if(_0x1188de){var _0x4ea5a7=typeof _0xdbc1db['offset']==='undefined'&&typeof _0xdbc1db[_0x686b('0x1f')]===_0x686b('0x20');var _0x293186=_0x1188de[_0x686b('0x21')];var _0x408ab9=_0x4ea5a7?0x0:_0xdbc1db[_0x686b('0x22')];var _0x53dc2f=_0x4ea5a7?_0x1188de[_0x686b('0x21')]:_0xdbc1db[_0x686b('0x22')]+_0xdbc1db[_0x686b('0x1f')];var _0x300969;if(_0x53dc2f>=_0x293186){_0x53dc2f=_0x293186;_0x300969=0xc8;}else{_0x300969=0xce;}_0x51d3bc['status'](_0x300969);return _0x51d3bc['set']('Content-Range',_0x408ab9+'-'+_0x53dc2f+'/'+_0x293186)['json'](_0x1188de);}return null;};}function patchUpdates(_0x1badaf){return function(_0x36dfd5){try{jsonpatch[_0x686b('0x23')](_0x36dfd5,_0x1badaf,!![]);}catch(_0x5b6423){return BPromise[_0x686b('0x24')](_0x5b6423);}return _0x36dfd5[_0x686b('0x25')]();};}function saveUpdates(_0x706155,_0x56f366){return function(_0x5aab44){if(_0x5aab44){return _0x5aab44[_0x686b('0x26')](_0x706155)[_0x686b('0x27')](function(_0x3cf1b3){return _0x3cf1b3;});}return null;};}function removeEntity(_0x23d348,_0x3b4c03){return function(_0x2c617b){if(_0x2c617b){return _0x2c617b['destroy']()[_0x686b('0x27')](function(){_0x23d348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4068a2,_0x3691d9){return function(_0xdebf7e){if(!_0xdebf7e){_0x4068a2[_0x686b('0x1b')](0x194);}return _0xdebf7e;};}function handleError(_0x4436bc,_0x122761){_0x122761=_0x122761||0x1f4;return function(_0x86fac8){logger[_0x686b('0x28')](_0x86fac8[_0x686b('0x29')]);if(_0x86fac8[_0x686b('0x2a')]){delete _0x86fac8['name'];}_0x4436bc[_0x686b('0x1d')](_0x122761)['send'](_0x86fac8);};}exports[_0x686b('0x2b')]=function(_0x2090fa,_0x5ad2e3){var _0x946066={},_0x55e42a={},_0x46e1d7={'count':0x0,'rows':[]};var _0x270cad=_['map'](db[_0x686b('0x2c')][_0x686b('0x2d')],function(_0x2fdcb4){return{'name':_0x2fdcb4['fieldName'],'type':_0x2fdcb4['type']['key']};});_0x55e42a[_0x686b('0x2e')]=_['map'](_0x270cad,_0x686b('0x2a'));_0x55e42a['query']=_[_0x686b('0x2f')](_0x2090fa[_0x686b('0x30')]);_0x55e42a[_0x686b('0x31')]=_[_0x686b('0x32')](_0x55e42a['model'],_0x55e42a[_0x686b('0x30')]);_0x946066[_0x686b('0x33')]=_[_0x686b('0x32')](_0x55e42a[_0x686b('0x2e')],qs['fields'](_0x2090fa[_0x686b('0x30')][_0x686b('0x34')]));_0x946066['attributes']=_0x946066[_0x686b('0x33')]['length']?_0x946066[_0x686b('0x33')]:_0x55e42a[_0x686b('0x2e')];if(!_0x2090fa['query'][_0x686b('0x35')](_0x686b('0x36'))){_0x946066[_0x686b('0x1f')]=qs[_0x686b('0x1f')](_0x2090fa[_0x686b('0x30')][_0x686b('0x1f')]);_0x946066[_0x686b('0x22')]=qs[_0x686b('0x22')](_0x2090fa[_0x686b('0x30')][_0x686b('0x22')]);}_0x946066[_0x686b('0x37')]=qs[_0x686b('0x38')](_0x2090fa[_0x686b('0x30')][_0x686b('0x38')]);_0x946066[_0x686b('0x39')]=qs[_0x686b('0x31')](_[_0x686b('0x3a')](_0x2090fa[_0x686b('0x30')],_0x55e42a[_0x686b('0x31')]),_0x270cad);if(_0x2090fa[_0x686b('0x30')][_0x686b('0x3b')]){_0x946066['where']=_[_0x686b('0x3c')](_0x946066['where'],{'$or':_['map'](_0x270cad,function(_0x9a5099){if(_0x9a5099[_0x686b('0x3d')]!=='VIRTUAL'){var _0x41b245={};_0x41b245[_0x9a5099[_0x686b('0x2a')]]={'$like':'%'+_0x2090fa['query']['filter']+'%'};return _0x41b245;}})});}_0x946066=_['merge']({},_0x946066,_0x2090fa['options']);var _0x3d649a={'where':_0x946066[_0x686b('0x39')]};return db[_0x686b('0x2c')]['count'](_0x3d649a)[_0x686b('0x27')](function(_0x52d7d4){_0x46e1d7[_0x686b('0x21')]=_0x52d7d4;if(_0x2090fa[_0x686b('0x30')]['includeAll']){_0x946066['include']=[{'all':!![]}];}return db[_0x686b('0x2c')][_0x686b('0x3e')](_0x946066);})['then'](function(_0x2011ce){_0x46e1d7[_0x686b('0x3f')]=_0x2011ce;return _0x46e1d7;})['then'](respondWithFilteredResult(_0x5ad2e3,_0x946066))[_0x686b('0x40')](handleError(_0x5ad2e3,null));};exports[_0x686b('0x41')]=function(_0x496812,_0x480996){var _0x480fe8={'raw':![],'where':{'id':_0x496812['params']['id']}},_0x46b25f={};_0x46b25f[_0x686b('0x2e')]=_['keys'](db[_0x686b('0x2c')][_0x686b('0x2d')]);_0x46b25f[_0x686b('0x30')]=_[_0x686b('0x2f')](_0x496812['query']);_0x46b25f[_0x686b('0x31')]=_[_0x686b('0x32')](_0x46b25f[_0x686b('0x2e')],_0x46b25f[_0x686b('0x30')]);_0x480fe8['attributes']=_[_0x686b('0x32')](_0x46b25f[_0x686b('0x2e')],qs[_0x686b('0x34')](_0x496812['query'][_0x686b('0x34')]));_0x480fe8[_0x686b('0x33')]=_0x480fe8[_0x686b('0x33')][_0x686b('0x42')]?_0x480fe8['attributes']:_0x46b25f[_0x686b('0x2e')];if(_0x496812[_0x686b('0x30')][_0x686b('0x43')]){_0x480fe8[_0x686b('0x44')]=[{'all':!![]}];}_0x480fe8=_[_0x686b('0x3c')]({},_0x480fe8,_0x496812[_0x686b('0x45')]);return db[_0x686b('0x2c')][_0x686b('0x46')](_0x480fe8)['then'](handleEntityNotFound(_0x480996,null))[_0x686b('0x27')](respondWithResult(_0x480996,null))['catch'](handleError(_0x480996,null));};exports[_0x686b('0x47')]=function(_0x1b7ae2,_0x2af062){return db[_0x686b('0x2c')][_0x686b('0x47')](_0x1b7ae2[_0x686b('0x48')],{})[_0x686b('0x27')](respondWithResult(_0x2af062,0xc9))[_0x686b('0x40')](handleError(_0x2af062,null));};exports[_0x686b('0x26')]=function(_0x1b4607,_0x28fef1){if(_0x1b4607[_0x686b('0x48')]['id']){delete _0x1b4607[_0x686b('0x48')]['id'];}return db['SalesforceConfiguration'][_0x686b('0x46')]({'where':{'id':_0x1b4607[_0x686b('0x49')]['id']}})[_0x686b('0x27')](handleEntityNotFound(_0x28fef1,null))[_0x686b('0x27')](saveUpdates(_0x1b4607['body'],null))['then'](respondWithResult(_0x28fef1,null))[_0x686b('0x40')](handleError(_0x28fef1,null));};exports[_0x686b('0x4a')]=function(_0x3d3cd9,_0x55a0cc){return db[_0x686b('0x2c')]['find']({'where':{'id':_0x3d3cd9[_0x686b('0x49')]['id']}})[_0x686b('0x27')](handleEntityNotFound(_0x55a0cc,null))[_0x686b('0x27')](removeEntity(_0x55a0cc,null))[_0x686b('0x40')](handleError(_0x55a0cc,null));};exports[_0x686b('0x4b')]=function(_0xad13f9,_0x125d24,_0x2850c1){var _0xf1e7de={};var _0x4989fd={};var _0x3bdda3;var _0x5d02ac;return db[_0x686b('0x2c')][_0x686b('0x4c')]({'where':{'id':_0xad13f9['params']['id']}})[_0x686b('0x27')](handleEntityNotFound(_0x125d24,null))[_0x686b('0x27')](function(_0x494a94){if(_0x494a94){_0x3bdda3=_0x494a94;_0x4989fd[_0x686b('0x2e')]=_['keys'](db['SalesforceField'][_0x686b('0x2d')]);_0x4989fd[_0x686b('0x30')]=_[_0x686b('0x2f')](_0xad13f9[_0x686b('0x30')]);_0x4989fd['filters']=_[_0x686b('0x32')](_0x4989fd[_0x686b('0x2e')],_0x4989fd[_0x686b('0x30')]);_0xf1e7de['attributes']=_[_0x686b('0x32')](_0x4989fd[_0x686b('0x2e')],qs[_0x686b('0x34')](_0xad13f9[_0x686b('0x30')]['fields']));_0xf1e7de[_0x686b('0x33')]=_0xf1e7de['attributes']['length']?_0xf1e7de[_0x686b('0x33')]:_0x4989fd['model'];_0xf1e7de['order']=qs[_0x686b('0x38')](_0xad13f9['query'][_0x686b('0x38')]);_0xf1e7de[_0x686b('0x39')]=qs[_0x686b('0x31')](_[_0x686b('0x3a')](_0xad13f9[_0x686b('0x30')],_0x4989fd[_0x686b('0x31')]));if(_0xad13f9[_0x686b('0x30')]['filter']){_0xf1e7de[_0x686b('0x39')]=_[_0x686b('0x3c')](_0xf1e7de[_0x686b('0x39')],{'$or':_[_0x686b('0x4d')](_0xf1e7de[_0x686b('0x33')],function(_0x34246c){var _0x5873dc={};_0x5873dc[_0x34246c]={'$like':'%'+_0xad13f9[_0x686b('0x30')][_0x686b('0x3b')]+'%'};return _0x5873dc;})});}_0xf1e7de=_[_0x686b('0x3c')]({},_0xf1e7de,_0xad13f9[_0x686b('0x45')]);return _0x3bdda3[_0x686b('0x4b')](_0xf1e7de);}})['then'](function(_0x51f4fb){if(_0x51f4fb){_0x5d02ac=_0x51f4fb['length'];if(!_0xad13f9['query']['hasOwnProperty'](_0x686b('0x36'))){_0xf1e7de['limit']=qs['limit'](_0xad13f9['query']['limit']);_0xf1e7de[_0x686b('0x22')]=qs[_0x686b('0x22')](_0xad13f9[_0x686b('0x30')][_0x686b('0x22')]);}return _0x3bdda3[_0x686b('0x4b')](_0xf1e7de);}})[_0x686b('0x27')](function(_0x41e6bd){if(_0x41e6bd){return _0x41e6bd?{'count':_0x5d02ac,'rows':_0x41e6bd}:null;}})['then'](respondWithResult(_0x125d24,null))['catch'](handleError(_0x125d24,null));};exports[_0x686b('0x4e')]=function(_0x47b01a,_0x2881a9,_0x4a5205){var _0xaaf8d8={};var _0x512ec8={};var _0x1f5af7;var _0x1a383e;return db[_0x686b('0x2c')][_0x686b('0x4c')]({'where':{'id':_0x47b01a['params']['id']}})[_0x686b('0x27')](handleEntityNotFound(_0x2881a9,null))[_0x686b('0x27')](function(_0xe106e9){if(_0xe106e9){_0x1f5af7=_0xe106e9;_0x512ec8['model']=_[_0x686b('0x2f')](db['SalesforceField']['rawAttributes']);_0x512ec8[_0x686b('0x30')]=_['keys'](_0x47b01a[_0x686b('0x30')]);_0x512ec8[_0x686b('0x31')]=_[_0x686b('0x32')](_0x512ec8[_0x686b('0x2e')],_0x512ec8[_0x686b('0x30')]);_0xaaf8d8['attributes']=_[_0x686b('0x32')](_0x512ec8[_0x686b('0x2e')],qs[_0x686b('0x34')](_0x47b01a[_0x686b('0x30')][_0x686b('0x34')]));_0xaaf8d8[_0x686b('0x33')]=_0xaaf8d8[_0x686b('0x33')]['length']?_0xaaf8d8[_0x686b('0x33')]:_0x512ec8[_0x686b('0x2e')];_0xaaf8d8[_0x686b('0x37')]=qs['sort'](_0x47b01a[_0x686b('0x30')][_0x686b('0x38')]);_0xaaf8d8[_0x686b('0x39')]=qs[_0x686b('0x31')](_['pick'](_0x47b01a[_0x686b('0x30')],_0x512ec8['filters']));if(_0x47b01a[_0x686b('0x30')][_0x686b('0x3b')]){_0xaaf8d8[_0x686b('0x39')]=_[_0x686b('0x3c')](_0xaaf8d8[_0x686b('0x39')],{'$or':_[_0x686b('0x4d')](_0xaaf8d8['attributes'],function(_0x3a6538){var _0x35d5b2={};_0x35d5b2[_0x3a6538]={'$like':'%'+_0x47b01a['query'][_0x686b('0x3b')]+'%'};return _0x35d5b2;})});}_0xaaf8d8=_[_0x686b('0x3c')]({},_0xaaf8d8,_0x47b01a[_0x686b('0x45')]);return _0x1f5af7[_0x686b('0x4e')](_0xaaf8d8);}})['then'](function(_0xc6673a){if(_0xc6673a){_0x1a383e=_0xc6673a['length'];if(!_0x47b01a[_0x686b('0x30')]['hasOwnProperty']('nolimit')){_0xaaf8d8[_0x686b('0x1f')]=qs['limit'](_0x47b01a[_0x686b('0x30')][_0x686b('0x1f')]);_0xaaf8d8[_0x686b('0x22')]=qs[_0x686b('0x22')](_0x47b01a[_0x686b('0x30')][_0x686b('0x22')]);}return _0x1f5af7[_0x686b('0x4e')](_0xaaf8d8);}})[_0x686b('0x27')](function(_0x1008c4){if(_0x1008c4){return _0x1008c4?{'count':_0x1a383e,'rows':_0x1008c4}:null;}})['then'](respondWithResult(_0x2881a9,null))['catch'](handleError(_0x2881a9,null));};exports[_0x686b('0x4f')]=function(_0x3f2d41,_0x2db99c,_0x545a9e){var _0x16a69b={};var _0x112b83={};var _0x468277;var _0x37c960;return db[_0x686b('0x2c')][_0x686b('0x4c')]({'where':{'id':_0x3f2d41[_0x686b('0x49')]['id']}})[_0x686b('0x27')](handleEntityNotFound(_0x2db99c,null))['then'](function(_0x93147f){if(_0x93147f){_0x468277=_0x93147f;_0x112b83[_0x686b('0x2e')]=_[_0x686b('0x2f')](db[_0x686b('0x50')][_0x686b('0x2d')]);_0x112b83['query']=_[_0x686b('0x2f')](_0x3f2d41['query']);_0x112b83[_0x686b('0x31')]=_[_0x686b('0x32')](_0x112b83[_0x686b('0x2e')],_0x112b83[_0x686b('0x30')]);_0x16a69b[_0x686b('0x33')]=_[_0x686b('0x32')](_0x112b83[_0x686b('0x2e')],qs['fields'](_0x3f2d41[_0x686b('0x30')][_0x686b('0x34')]));_0x16a69b[_0x686b('0x33')]=_0x16a69b['attributes']['length']?_0x16a69b[_0x686b('0x33')]:_0x112b83[_0x686b('0x2e')];_0x16a69b[_0x686b('0x37')]=qs[_0x686b('0x38')](_0x3f2d41['query'][_0x686b('0x38')]);_0x16a69b[_0x686b('0x39')]=qs[_0x686b('0x31')](_[_0x686b('0x3a')](_0x3f2d41['query'],_0x112b83['filters']));if(_0x3f2d41[_0x686b('0x30')]['filter']){_0x16a69b[_0x686b('0x39')]=_[_0x686b('0x3c')](_0x16a69b[_0x686b('0x39')],{'$or':_[_0x686b('0x4d')](_0x16a69b['attributes'],function(_0x3c5e14){var _0x24c866={};_0x24c866[_0x3c5e14]={'$like':'%'+_0x3f2d41[_0x686b('0x30')][_0x686b('0x3b')]+'%'};return _0x24c866;})});}_0x16a69b=_[_0x686b('0x3c')]({},_0x16a69b,_0x3f2d41['options']);return _0x468277[_0x686b('0x4f')](_0x16a69b);}})[_0x686b('0x27')](function(_0x86893e){if(_0x86893e){_0x37c960=_0x86893e[_0x686b('0x42')];if(!_0x3f2d41[_0x686b('0x30')]['hasOwnProperty'](_0x686b('0x36'))){_0x16a69b[_0x686b('0x1f')]=qs[_0x686b('0x1f')](_0x3f2d41['query'][_0x686b('0x1f')]);_0x16a69b[_0x686b('0x22')]=qs[_0x686b('0x22')](_0x3f2d41[_0x686b('0x30')][_0x686b('0x22')]);}return _0x468277[_0x686b('0x4f')](_0x16a69b);}})[_0x686b('0x27')](function(_0x3b8fc6){if(_0x3b8fc6){return _0x3b8fc6?{'count':_0x37c960,'rows':_0x3b8fc6}:null;}})['then'](respondWithResult(_0x2db99c,null))[_0x686b('0x40')](handleError(_0x2db99c,null));};
\ No newline at end of file
+var _0x5309=['find','catch','create','body','findOne','length','nolimit','getFields','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','findAll','rows','show','params','include'];(function(_0x22766,_0x1c0e8f){var _0xcdd76e=function(_0x262a70){while(--_0x262a70){_0x22766['push'](_0x22766['shift']());}};_0xcdd76e(++_0x1c0e8f);}(_0x5309,0x1aa));var _0x9530=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x5309[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x9530('0x0'));var rimraf=require(_0x9530('0x1'));var zipdir=require(_0x9530('0x2'));var jsonpatch=require(_0x9530('0x3'));var rp=require(_0x9530('0x4'));var moment=require(_0x9530('0x5'));var BPromise=require(_0x9530('0x6'));var Mustache=require(_0x9530('0x7'));var util=require(_0x9530('0x8'));var path=require(_0x9530('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9530('0xa'));var fs=require('fs');var fs_extra=require(_0x9530('0xb'));var _=require(_0x9530('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9530('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9530('0xe'));var querystring=require(_0x9530('0xf'));var Papa=require(_0x9530('0x10'));var Redis=require(_0x9530('0x11'));var authService=require(_0x9530('0x12'));var qs=require(_0x9530('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9530('0x14'))(_0x9530('0x15'));var utils=require(_0x9530('0x16'));var config=require(_0x9530('0x17'));var licenseUtil=require(_0x9530('0x18'));var db=require(_0x9530('0x19'))['db'];function respondWithStatusCode(_0x3af84d,_0x250cb4){_0x250cb4=_0x250cb4||0xcc;return function(_0x116c03){if(_0x116c03){return _0x3af84d[_0x9530('0x1a')](_0x250cb4);}return _0x3af84d[_0x9530('0x1b')](_0x250cb4)['end']();};}function respondWithResult(_0xeeb7bf,_0x55090c){_0x55090c=_0x55090c||0xc8;return function(_0x3b1c4f){if(_0x3b1c4f){return _0xeeb7bf[_0x9530('0x1b')](_0x55090c)['json'](_0x3b1c4f);}};}function respondWithFilteredResult(_0x4109e3,_0x2b550e){return function(_0x4e08cc){if(_0x4e08cc){var _0x3724c1=typeof _0x2b550e[_0x9530('0x1c')]===_0x9530('0x1d')&&typeof _0x2b550e[_0x9530('0x1e')]===_0x9530('0x1d');var _0x4bf7a8=_0x4e08cc['count'];var _0x244c8f=_0x3724c1?0x0:_0x2b550e[_0x9530('0x1c')];var _0x5b2836=_0x3724c1?_0x4e08cc[_0x9530('0x1f')]:_0x2b550e[_0x9530('0x1c')]+_0x2b550e[_0x9530('0x1e')];var _0x4ea7a3;if(_0x5b2836>=_0x4bf7a8){_0x5b2836=_0x4bf7a8;_0x4ea7a3=0xc8;}else{_0x4ea7a3=0xce;}_0x4109e3['status'](_0x4ea7a3);return _0x4109e3[_0x9530('0x20')](_0x9530('0x21'),_0x244c8f+'-'+_0x5b2836+'/'+_0x4bf7a8)['json'](_0x4e08cc);}return null;};}function patchUpdates(_0x117662){return function(_0x807165){try{jsonpatch[_0x9530('0x22')](_0x807165,_0x117662,!![]);}catch(_0x22bab2){return BPromise[_0x9530('0x23')](_0x22bab2);}return _0x807165[_0x9530('0x24')]();};}function saveUpdates(_0x10846f,_0x3b0732){return function(_0x548cd3){if(_0x548cd3){return _0x548cd3[_0x9530('0x25')](_0x10846f)['then'](function(_0x12cbf4){return _0x12cbf4;});}return null;};}function removeEntity(_0x5c1abf,_0x23c306){return function(_0x48cacf){if(_0x48cacf){return _0x48cacf[_0x9530('0x26')]()['then'](function(){_0x5c1abf[_0x9530('0x1b')](0xcc)[_0x9530('0x27')]();});}};}function handleEntityNotFound(_0x48bab8,_0x5685be){return function(_0x3a14b1){if(!_0x3a14b1){_0x48bab8[_0x9530('0x1a')](0x194);}return _0x3a14b1;};}function handleError(_0x1a3a6d,_0x327edc){_0x327edc=_0x327edc||0x1f4;return function(_0x29eef9){logger['error'](_0x29eef9[_0x9530('0x28')]);if(_0x29eef9[_0x9530('0x29')]){delete _0x29eef9['name'];}_0x1a3a6d['status'](_0x327edc)['send'](_0x29eef9);};}exports[_0x9530('0x2a')]=function(_0x5d4c14,_0x3b0a14){var _0x622990={},_0x2c9096={},_0x9356cd={'count':0x0,'rows':[]};var _0x252f9e=_[_0x9530('0x2b')](db[_0x9530('0x2c')][_0x9530('0x2d')],function(_0x238044){return{'name':_0x238044[_0x9530('0x2e')],'type':_0x238044[_0x9530('0x2f')][_0x9530('0x30')]};});_0x2c9096['model']=_[_0x9530('0x2b')](_0x252f9e,_0x9530('0x29'));_0x2c9096[_0x9530('0x31')]=_[_0x9530('0x32')](_0x5d4c14[_0x9530('0x31')]);_0x2c9096[_0x9530('0x33')]=_[_0x9530('0x34')](_0x2c9096['model'],_0x2c9096['query']);_0x622990[_0x9530('0x35')]=_[_0x9530('0x34')](_0x2c9096['model'],qs[_0x9530('0x36')](_0x5d4c14['query'][_0x9530('0x36')]));_0x622990['attributes']=_0x622990[_0x9530('0x35')]['length']?_0x622990[_0x9530('0x35')]:_0x2c9096[_0x9530('0x37')];if(!_0x5d4c14[_0x9530('0x31')][_0x9530('0x38')]('nolimit')){_0x622990[_0x9530('0x1e')]=qs[_0x9530('0x1e')](_0x5d4c14[_0x9530('0x31')][_0x9530('0x1e')]);_0x622990['offset']=qs['offset'](_0x5d4c14[_0x9530('0x31')][_0x9530('0x1c')]);}_0x622990[_0x9530('0x39')]=qs['sort'](_0x5d4c14[_0x9530('0x31')][_0x9530('0x3a')]);_0x622990['where']=qs['filters'](_[_0x9530('0x3b')](_0x5d4c14[_0x9530('0x31')],_0x2c9096[_0x9530('0x33')]),_0x252f9e);if(_0x5d4c14[_0x9530('0x31')][_0x9530('0x3c')]){_0x622990[_0x9530('0x3d')]=_[_0x9530('0x3e')](_0x622990[_0x9530('0x3d')],{'$or':_[_0x9530('0x2b')](_0x252f9e,function(_0x456779){if(_0x456779[_0x9530('0x2f')]!==_0x9530('0x3f')){var _0x1a4b10={};_0x1a4b10[_0x456779[_0x9530('0x29')]]={'$like':'%'+_0x5d4c14['query'][_0x9530('0x3c')]+'%'};return _0x1a4b10;}})});}_0x622990=_[_0x9530('0x3e')]({},_0x622990,_0x5d4c14[_0x9530('0x40')]);var _0x19eb1e={'where':_0x622990[_0x9530('0x3d')]};return db['SalesforceConfiguration'][_0x9530('0x1f')](_0x19eb1e)[_0x9530('0x41')](function(_0x46a28f){_0x9356cd[_0x9530('0x1f')]=_0x46a28f;if(_0x5d4c14['query'][_0x9530('0x42')]){_0x622990['include']=[{'all':!![]}];}return db[_0x9530('0x2c')][_0x9530('0x43')](_0x622990);})[_0x9530('0x41')](function(_0xc9c129){_0x9356cd[_0x9530('0x44')]=_0xc9c129;return _0x9356cd;})[_0x9530('0x41')](respondWithFilteredResult(_0x3b0a14,_0x622990))['catch'](handleError(_0x3b0a14,null));};exports[_0x9530('0x45')]=function(_0x13b713,_0x154ee9){var _0x5b0d8d={'raw':![],'where':{'id':_0x13b713[_0x9530('0x46')]['id']}},_0x1d0bbd={};_0x1d0bbd['model']=_[_0x9530('0x32')](db[_0x9530('0x2c')][_0x9530('0x2d')]);_0x1d0bbd[_0x9530('0x31')]=_['keys'](_0x13b713[_0x9530('0x31')]);_0x1d0bbd[_0x9530('0x33')]=_[_0x9530('0x34')](_0x1d0bbd[_0x9530('0x37')],_0x1d0bbd[_0x9530('0x31')]);_0x5b0d8d[_0x9530('0x35')]=_[_0x9530('0x34')](_0x1d0bbd[_0x9530('0x37')],qs['fields'](_0x13b713[_0x9530('0x31')][_0x9530('0x36')]));_0x5b0d8d[_0x9530('0x35')]=_0x5b0d8d['attributes']['length']?_0x5b0d8d['attributes']:_0x1d0bbd[_0x9530('0x37')];if(_0x13b713['query'][_0x9530('0x42')]){_0x5b0d8d[_0x9530('0x47')]=[{'all':!![]}];}_0x5b0d8d=_[_0x9530('0x3e')]({},_0x5b0d8d,_0x13b713['options']);return db[_0x9530('0x2c')][_0x9530('0x48')](_0x5b0d8d)['then'](handleEntityNotFound(_0x154ee9,null))['then'](respondWithResult(_0x154ee9,null))[_0x9530('0x49')](handleError(_0x154ee9,null));};exports[_0x9530('0x4a')]=function(_0x1196a2,_0x3ef167){return db[_0x9530('0x2c')]['create'](_0x1196a2[_0x9530('0x4b')],{})['then'](respondWithResult(_0x3ef167,0xc9))[_0x9530('0x49')](handleError(_0x3ef167,null));};exports[_0x9530('0x25')]=function(_0x2d4d3c,_0x220c3d){if(_0x2d4d3c['body']['id']){delete _0x2d4d3c[_0x9530('0x4b')]['id'];}return db['SalesforceConfiguration'][_0x9530('0x48')]({'where':{'id':_0x2d4d3c['params']['id']}})[_0x9530('0x41')](handleEntityNotFound(_0x220c3d,null))[_0x9530('0x41')](saveUpdates(_0x2d4d3c[_0x9530('0x4b')],null))[_0x9530('0x41')](respondWithResult(_0x220c3d,null))[_0x9530('0x49')](handleError(_0x220c3d,null));};exports[_0x9530('0x26')]=function(_0x1c3d41,_0x5cdb55){return db[_0x9530('0x2c')]['find']({'where':{'id':_0x1c3d41['params']['id']}})[_0x9530('0x41')](handleEntityNotFound(_0x5cdb55,null))[_0x9530('0x41')](removeEntity(_0x5cdb55,null))[_0x9530('0x49')](handleError(_0x5cdb55,null));};exports['getFields']=function(_0x313cf9,_0x3117a0,_0x2d93d9){var _0x371a15={};var _0x2043a2={};var _0x489181;var _0x52e453;return db[_0x9530('0x2c')][_0x9530('0x4c')]({'where':{'id':_0x313cf9[_0x9530('0x46')]['id']}})['then'](handleEntityNotFound(_0x3117a0,null))['then'](function(_0x1848cd){if(_0x1848cd){_0x489181=_0x1848cd;_0x2043a2[_0x9530('0x37')]=_[_0x9530('0x32')](db['SalesforceField'][_0x9530('0x2d')]);_0x2043a2[_0x9530('0x31')]=_[_0x9530('0x32')](_0x313cf9[_0x9530('0x31')]);_0x2043a2['filters']=_['intersection'](_0x2043a2[_0x9530('0x37')],_0x2043a2[_0x9530('0x31')]);_0x371a15[_0x9530('0x35')]=_['intersection'](_0x2043a2[_0x9530('0x37')],qs[_0x9530('0x36')](_0x313cf9[_0x9530('0x31')][_0x9530('0x36')]));_0x371a15[_0x9530('0x35')]=_0x371a15[_0x9530('0x35')][_0x9530('0x4d')]?_0x371a15[_0x9530('0x35')]:_0x2043a2[_0x9530('0x37')];_0x371a15['order']=qs[_0x9530('0x3a')](_0x313cf9[_0x9530('0x31')][_0x9530('0x3a')]);_0x371a15[_0x9530('0x3d')]=qs[_0x9530('0x33')](_[_0x9530('0x3b')](_0x313cf9[_0x9530('0x31')],_0x2043a2['filters']));if(_0x313cf9[_0x9530('0x31')][_0x9530('0x3c')]){_0x371a15[_0x9530('0x3d')]=_[_0x9530('0x3e')](_0x371a15[_0x9530('0x3d')],{'$or':_[_0x9530('0x2b')](_0x371a15[_0x9530('0x35')],function(_0x556212){var _0x11715a={};_0x11715a[_0x556212]={'$like':'%'+_0x313cf9['query'][_0x9530('0x3c')]+'%'};return _0x11715a;})});}_0x371a15=_[_0x9530('0x3e')]({},_0x371a15,_0x313cf9[_0x9530('0x40')]);return _0x489181['getFields'](_0x371a15);}})['then'](function(_0x7458e){if(_0x7458e){_0x52e453=_0x7458e[_0x9530('0x4d')];if(!_0x313cf9[_0x9530('0x31')][_0x9530('0x38')](_0x9530('0x4e'))){_0x371a15['limit']=qs[_0x9530('0x1e')](_0x313cf9[_0x9530('0x31')][_0x9530('0x1e')]);_0x371a15['offset']=qs[_0x9530('0x1c')](_0x313cf9['query'][_0x9530('0x1c')]);}return _0x489181[_0x9530('0x4f')](_0x371a15);}})['then'](function(_0x4b6846){if(_0x4b6846){return _0x4b6846?{'count':_0x52e453,'rows':_0x4b6846}:null;}})[_0x9530('0x41')](respondWithResult(_0x3117a0,null))[_0x9530('0x49')](handleError(_0x3117a0,null));};exports[_0x9530('0x50')]=function(_0x5cb721,_0x54d842,_0x1b8526){var _0x53382d={};var _0x586062={};var _0x9d40c6;var _0x382ea0;return db[_0x9530('0x2c')][_0x9530('0x4c')]({'where':{'id':_0x5cb721['params']['id']}})[_0x9530('0x41')](handleEntityNotFound(_0x54d842,null))[_0x9530('0x41')](function(_0x335474){if(_0x335474){_0x9d40c6=_0x335474;_0x586062[_0x9530('0x37')]=_[_0x9530('0x32')](db[_0x9530('0x51')][_0x9530('0x2d')]);_0x586062[_0x9530('0x31')]=_[_0x9530('0x32')](_0x5cb721[_0x9530('0x31')]);_0x586062['filters']=_[_0x9530('0x34')](_0x586062[_0x9530('0x37')],_0x586062[_0x9530('0x31')]);_0x53382d[_0x9530('0x35')]=_[_0x9530('0x34')](_0x586062['model'],qs[_0x9530('0x36')](_0x5cb721[_0x9530('0x31')][_0x9530('0x36')]));_0x53382d[_0x9530('0x35')]=_0x53382d['attributes'][_0x9530('0x4d')]?_0x53382d['attributes']:_0x586062[_0x9530('0x37')];_0x53382d['order']=qs[_0x9530('0x3a')](_0x5cb721[_0x9530('0x31')][_0x9530('0x3a')]);_0x53382d[_0x9530('0x3d')]=qs[_0x9530('0x33')](_['pick'](_0x5cb721[_0x9530('0x31')],_0x586062[_0x9530('0x33')]));if(_0x5cb721[_0x9530('0x31')][_0x9530('0x3c')]){_0x53382d[_0x9530('0x3d')]=_['merge'](_0x53382d['where'],{'$or':_[_0x9530('0x2b')](_0x53382d[_0x9530('0x35')],function(_0x2921fd){var _0x3421f3={};_0x3421f3[_0x2921fd]={'$like':'%'+_0x5cb721[_0x9530('0x31')]['filter']+'%'};return _0x3421f3;})});}_0x53382d=_[_0x9530('0x3e')]({},_0x53382d,_0x5cb721[_0x9530('0x40')]);return _0x9d40c6[_0x9530('0x50')](_0x53382d);}})['then'](function(_0x3cc2ef){if(_0x3cc2ef){_0x382ea0=_0x3cc2ef['length'];if(!_0x5cb721[_0x9530('0x31')][_0x9530('0x38')](_0x9530('0x4e'))){_0x53382d['limit']=qs['limit'](_0x5cb721[_0x9530('0x31')]['limit']);_0x53382d[_0x9530('0x1c')]=qs['offset'](_0x5cb721[_0x9530('0x31')][_0x9530('0x1c')]);}return _0x9d40c6[_0x9530('0x50')](_0x53382d);}})[_0x9530('0x41')](function(_0x3c3208){if(_0x3c3208){return _0x3c3208?{'count':_0x382ea0,'rows':_0x3c3208}:null;}})[_0x9530('0x41')](respondWithResult(_0x54d842,null))[_0x9530('0x49')](handleError(_0x54d842,null));};exports['getDescriptions']=function(_0xd07f04,_0x2ecd13,_0x2e62ff){var _0x2c9684={};var _0x3bfbc9={};var _0xd6ca3c;var _0x3430dc;return db['SalesforceConfiguration'][_0x9530('0x4c')]({'where':{'id':_0xd07f04[_0x9530('0x46')]['id']}})[_0x9530('0x41')](handleEntityNotFound(_0x2ecd13,null))[_0x9530('0x41')](function(_0x32cc92){if(_0x32cc92){_0xd6ca3c=_0x32cc92;_0x3bfbc9[_0x9530('0x37')]=_[_0x9530('0x32')](db[_0x9530('0x51')]['rawAttributes']);_0x3bfbc9['query']=_[_0x9530('0x32')](_0xd07f04[_0x9530('0x31')]);_0x3bfbc9[_0x9530('0x33')]=_[_0x9530('0x34')](_0x3bfbc9[_0x9530('0x37')],_0x3bfbc9[_0x9530('0x31')]);_0x2c9684[_0x9530('0x35')]=_[_0x9530('0x34')](_0x3bfbc9[_0x9530('0x37')],qs[_0x9530('0x36')](_0xd07f04[_0x9530('0x31')]['fields']));_0x2c9684[_0x9530('0x35')]=_0x2c9684[_0x9530('0x35')][_0x9530('0x4d')]?_0x2c9684[_0x9530('0x35')]:_0x3bfbc9['model'];_0x2c9684[_0x9530('0x39')]=qs[_0x9530('0x3a')](_0xd07f04[_0x9530('0x31')][_0x9530('0x3a')]);_0x2c9684['where']=qs[_0x9530('0x33')](_[_0x9530('0x3b')](_0xd07f04[_0x9530('0x31')],_0x3bfbc9[_0x9530('0x33')]));if(_0xd07f04[_0x9530('0x31')][_0x9530('0x3c')]){_0x2c9684['where']=_['merge'](_0x2c9684[_0x9530('0x3d')],{'$or':_[_0x9530('0x2b')](_0x2c9684[_0x9530('0x35')],function(_0x51d04b){var _0x2667d0={};_0x2667d0[_0x51d04b]={'$like':'%'+_0xd07f04[_0x9530('0x31')][_0x9530('0x3c')]+'%'};return _0x2667d0;})});}_0x2c9684=_[_0x9530('0x3e')]({},_0x2c9684,_0xd07f04[_0x9530('0x40')]);return _0xd6ca3c[_0x9530('0x52')](_0x2c9684);}})['then'](function(_0x47b410){if(_0x47b410){_0x3430dc=_0x47b410['length'];if(!_0xd07f04[_0x9530('0x31')][_0x9530('0x38')](_0x9530('0x4e'))){_0x2c9684['limit']=qs['limit'](_0xd07f04[_0x9530('0x31')][_0x9530('0x1e')]);_0x2c9684[_0x9530('0x1c')]=qs['offset'](_0xd07f04[_0x9530('0x31')]['offset']);}return _0xd6ca3c[_0x9530('0x52')](_0x2c9684);}})['then'](function(_0x590617){if(_0x590617){return _0x590617?{'count':_0x3430dc,'rows':_0x590617}:null;}})[_0x9530('0x41')](respondWithResult(_0x2ecd13,null))[_0x9530('0x49')](handleError(_0x2ecd13,null));};
\ No newline at end of file
index abde5d6..9564913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3857=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','int_salesforce_configurations','lodash','util'];(function(_0x177ba0,_0x21ceb4){var _0x2b91ca=function(_0x19fd00){while(--_0x19fd00){_0x177ba0['push'](_0x177ba0['shift']());}};_0x2b91ca(++_0x21ceb4);}(_0x3857,0x195));var _0x7385=function(_0x5936cc,_0x26b1f1){_0x5936cc=_0x5936cc-0x0;var _0x2365d1=_0x3857[_0x5936cc];return _0x2365d1;};'use strict';var _=require(_0x7385('0x0'));var util=require(_0x7385('0x1'));var logger=require('../../config/logger')(_0x7385('0x2'));var moment=require('moment');var BPromise=require(_0x7385('0x3'));var rp=require(_0x7385('0x4'));var fs=require('fs');var path=require(_0x7385('0x5'));var rimraf=require(_0x7385('0x6'));var config=require(_0x7385('0x7'));var attributes=require(_0x7385('0x8'));module[_0x7385('0x9')]=function(_0x2bbd65,_0x4aaa74){return _0x2bbd65['define']('SalesforceConfiguration',attributes,{'tableName':_0x7385('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c93=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment'];(function(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0x7c93,0x192));var _0x37c9=function(_0x39551c,_0x249ec1){_0x39551c=_0x39551c-0x0;var _0x120d02=_0x7c93[_0x39551c];return _0x120d02;};'use strict';var _=require(_0x37c9('0x0'));var util=require(_0x37c9('0x1'));var logger=require(_0x37c9('0x2'))('api');var moment=require(_0x37c9('0x3'));var BPromise=require(_0x37c9('0x4'));var rp=require(_0x37c9('0x5'));var fs=require('fs');var path=require(_0x37c9('0x6'));var rimraf=require(_0x37c9('0x7'));var config=require(_0x37c9('0x8'));var attributes=require(_0x37c9('0x9'));module[_0x37c9('0xa')]=function(_0x376861,_0x510fbd){return _0x376861[_0x37c9('0xb')](_0x37c9('0xc'),attributes,{'tableName':_0x37c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b22fb2d..ca3ad28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7fb=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message'];(function(_0x3fef8b,_0x1b7270){var _0xcd3588=function(_0x41c739){while(--_0x41c739){_0x3fef8b['push'](_0x3fef8b['shift']());}};_0xcd3588(++_0x1b7270);}(_0xe7fb,0x1dc));var _0xbe7f=function(_0x87a080,_0x295888){_0x87a080=_0x87a080-0x0;var _0x1ffb6e=_0xe7fb[_0x87a080];return _0x1ffb6e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe7f('0x0'));var BPromise=require('bluebird');var rs=require(_0xbe7f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe7f('0x2'))['db'];var utils=require(_0xbe7f('0x3'));var logger=require(_0xbe7f('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbe7f('0x5')][_0xbe7f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2d6f30,_0x5a1284,_0x5b4841){return new BPromise(function(_0x276034,_0x23fb75){return client[_0xbe7f('0x7')](_0x2d6f30,_0x5b4841)[_0xbe7f('0x8')](function(_0x13afee){logger[_0xbe7f('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a1284,_0xbe7f('0xa'));logger['debug'](_0xbe7f('0xb'),_0x5a1284,'request\x20sent',JSON[_0xbe7f('0xc')](_0x13afee));if(_0x13afee[_0xbe7f('0xd')]){if(_0x13afee[_0xbe7f('0xd')][_0xbe7f('0xe')]===0x1f4){logger[_0xbe7f('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a1284,_0x13afee['error']['message']);return _0x23fb75(_0x13afee[_0xbe7f('0xd')]['message']);}logger[_0xbe7f('0xd')](_0xbe7f('0xf'),_0x5a1284,_0x13afee[_0xbe7f('0xd')][_0xbe7f('0x10')]);return _0x276034(_0x13afee[_0xbe7f('0xd')][_0xbe7f('0x10')]);}else{logger[_0xbe7f('0x9')](_0xbe7f('0xf'),_0x5a1284,_0xbe7f('0xa'));_0x276034(_0x13afee['result'][_0xbe7f('0x10')]);}})['catch'](function(_0x134d2d){logger[_0xbe7f('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a1284,_0x134d2d);_0x23fb75(_0x134d2d);});});}
\ No newline at end of file
+var _0xa594=['then','info','request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa594,0x186));var _0x4a59=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0xa594[_0x190ff6];return _0x5356d2;};'use strict';var _=require(_0x4a59('0x0'));var util=require(_0x4a59('0x1'));var moment=require(_0x4a59('0x2'));var BPromise=require(_0x4a59('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a59('0x4'))['db'];var utils=require(_0x4a59('0x5'));var logger=require('../../config/logger')(_0x4a59('0x6'));var config=require(_0x4a59('0x7'));var jayson=require(_0x4a59('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5f18,_0x4215ca,_0x12d155){return new BPromise(function(_0x4736cb,_0x6b8cfa){return client[_0x4a59('0x9')](_0x3e5f18,_0x12d155)[_0x4a59('0xa')](function(_0x24cfa3){logger[_0x4a59('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4215ca,_0x4a59('0xc'));logger[_0x4a59('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4215ca,_0x4a59('0xc'),JSON[_0x4a59('0xe')](_0x24cfa3));if(_0x24cfa3['error']){if(_0x24cfa3[_0x4a59('0xf')][_0x4a59('0x10')]===0x1f4){logger['error'](_0x4a59('0x11'),_0x4215ca,_0x24cfa3['error'][_0x4a59('0x12')]);return _0x6b8cfa(_0x24cfa3[_0x4a59('0xf')][_0x4a59('0x12')]);}logger[_0x4a59('0xf')](_0x4a59('0x11'),_0x4215ca,_0x24cfa3[_0x4a59('0xf')]['message']);return _0x4736cb(_0x24cfa3['error'][_0x4a59('0x12')]);}else{logger[_0x4a59('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4215ca,_0x4a59('0xc'));_0x4736cb(_0x24cfa3[_0x4a59('0x13')]['message']);}})['catch'](function(_0x1b28a9){logger[_0x4a59('0xf')](_0x4a59('0x11'),_0x4215ca,_0x1b28a9);_0x6b8cfa(_0x1b28a9);});});}
\ No newline at end of file
index 9bd48ea..1f6251a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6546=['./intSalesforceField.controller','get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xaf4ea4,_0x16de87){var _0x2457c9=function(_0x782d8e){while(--_0x782d8e){_0xaf4ea4['push'](_0xaf4ea4['shift']());}};_0x2457c9(++_0x16de87);}(_0x6546,0x1e6));var _0x6654=function(_0x12a03d,_0x2b6946){_0x12a03d=_0x12a03d-0x0;var _0x439a3b=_0x6546[_0x12a03d];return _0x439a3b;};'use strict';var multer=require(_0x6654('0x0'));var util=require('util');var path=require(_0x6654('0x1'));var timeout=require(_0x6654('0x2'));var express=require(_0x6654('0x3'));var router=express[_0x6654('0x4')]();var fs_extra=require(_0x6654('0x5'));var auth=require(_0x6654('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6654('0x7'));router[_0x6654('0x8')]('/',auth[_0x6654('0x9')](),controller['index']);router[_0x6654('0x8')]('/:id',auth[_0x6654('0x9')](),controller[_0x6654('0xa')]);router[_0x6654('0xb')]('/',auth[_0x6654('0x9')](),controller[_0x6654('0xc')]);router['put'](_0x6654('0xd'),auth[_0x6654('0x9')](),controller['update']);router[_0x6654('0xe')](_0x6654('0xd'),auth[_0x6654('0x9')](),controller[_0x6654('0xf')]);module[_0x6654('0x10')]=router;
\ No newline at end of file
+var _0x5180=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0xf11120,_0x1cd5c1){var _0x36d42a=function(_0x4e2300){while(--_0x4e2300){_0xf11120['push'](_0xf11120['shift']());}};_0x36d42a(++_0x1cd5c1);}(_0x5180,0x176));var _0x0518=function(_0x18ae8a,_0x247fb8){_0x18ae8a=_0x18ae8a-0x0;var _0x43886e=_0x5180[_0x18ae8a];return _0x43886e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0518('0x0'));var timeout=require(_0x0518('0x1'));var express=require(_0x0518('0x2'));var router=express[_0x0518('0x3')]();var fs_extra=require(_0x0518('0x4'));var auth=require(_0x0518('0x5'));var interaction=require(_0x0518('0x6'));var config=require(_0x0518('0x7'));var controller=require(_0x0518('0x8'));router['get']('/',auth[_0x0518('0x9')](),controller[_0x0518('0xa')]);router[_0x0518('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0518('0xc')]);router[_0x0518('0xd')]('/',auth['isAuthenticated'](),controller[_0x0518('0xe')]);router[_0x0518('0xf')](_0x0518('0x10'),auth['isAuthenticated'](),controller[_0x0518('0x11')]);router[_0x0518('0x12')](_0x0518('0x10'),auth['isAuthenticated'](),controller[_0x0518('0x13')]);module[_0x0518('0x14')]=router;
\ No newline at end of file
index 156d026..d062e58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e76=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x7e76,0x162));var _0x67e7=function(_0x4ce564,_0x5c289a){_0x4ce564=_0x4ce564-0x0;var _0x4b3227=_0x7e76[_0x4ce564];return _0x4b3227;};'use strict';var Sequelize=require(_0x67e7('0x0'));module[_0x67e7('0x1')]={'type':{'type':Sequelize[_0x67e7('0x2')](_0x67e7('0x3'),_0x67e7('0x4'),_0x67e7('0x5'),'keyValue',_0x67e7('0x6')),'defaultValue':_0x67e7('0x3')},'content':{'type':Sequelize[_0x67e7('0x7')]},'key':{'type':Sequelize[_0x67e7('0x7')]},'keyType':{'type':Sequelize[_0x67e7('0x2')]('string',_0x67e7('0x4'),_0x67e7('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x67e7('0x7')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa2d7=['ENUM','string','keyValue','picklist','STRING','variable','exports'];(function(_0x774a25,_0x46f547){var _0x3dc2fd=function(_0x27de02){while(--_0x27de02){_0x774a25['push'](_0x774a25['shift']());}};_0x3dc2fd(++_0x46f547);}(_0xa2d7,0x172));var _0x7a2d=function(_0x4aab50,_0x2f42cd){_0x4aab50=_0x4aab50-0x0;var _0x24377c=_0xa2d7[_0x4aab50];return _0x24377c;};'use strict';var Sequelize=require('sequelize');module[_0x7a2d('0x0')]={'type':{'type':Sequelize[_0x7a2d('0x1')](_0x7a2d('0x2'),'variable','customVariable',_0x7a2d('0x3'),_0x7a2d('0x4')),'defaultValue':_0x7a2d('0x2')},'content':{'type':Sequelize[_0x7a2d('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7a2d('0x2'),_0x7a2d('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x7a2d('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x7a2d('0x5')]}};
\ No newline at end of file
index 6201522..50be9ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05d4=['set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count'];(function(_0xbc7919,_0xf0cf39){var _0x58310c=function(_0x2e2fbe){while(--_0x2e2fbe){_0xbc7919['push'](_0xbc7919['shift']());}};_0x58310c(++_0xf0cf39);}(_0x05d4,0xbd));var _0x405d=function(_0x46f988,_0x221569){_0x46f988=_0x46f988-0x0;var _0x11f15b=_0x05d4[_0x46f988];return _0x11f15b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x405d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x405d('0x1'));var rp=require(_0x405d('0x2'));var moment=require(_0x405d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x405d('0x4'));var util=require(_0x405d('0x5'));var path=require('path');var sox=require(_0x405d('0x6'));var csv=require('to-csv');var ejs=require(_0x405d('0x7'));var fs=require('fs');var fs_extra=require(_0x405d('0x8'));var _=require(_0x405d('0x9'));var squel=require(_0x405d('0xa'));var crypto=require(_0x405d('0xb'));var jsforce=require(_0x405d('0xc'));var deskjs=require(_0x405d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x405d('0xe'));var Papa=require('papaparse');var Redis=require(_0x405d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x405d('0x10'));var as=require(_0x405d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x405d('0x12'));var utils=require(_0x405d('0x13'));var config=require(_0x405d('0x14'));var licenseUtil=require(_0x405d('0x15'));var db=require(_0x405d('0x16'))['db'];function respondWithStatusCode(_0x3814df,_0x1b7463){_0x1b7463=_0x1b7463||0xcc;return function(_0x29f410){if(_0x29f410){return _0x3814df[_0x405d('0x17')](_0x1b7463);}return _0x3814df[_0x405d('0x18')](_0x1b7463)['end']();};}function respondWithResult(_0x39bed6,_0x593280){_0x593280=_0x593280||0xc8;return function(_0x5bf540){if(_0x5bf540){return _0x39bed6['status'](_0x593280)[_0x405d('0x19')](_0x5bf540);}};}function respondWithFilteredResult(_0x11e9ed,_0x3fb9c7){return function(_0x305c08){if(_0x305c08){var _0x2f7fd3=typeof _0x3fb9c7[_0x405d('0x1a')]==='undefined'&&typeof _0x3fb9c7[_0x405d('0x1b')]===_0x405d('0x1c');var _0x176908=_0x305c08[_0x405d('0x1d')];var _0xe2e8ea=_0x2f7fd3?0x0:_0x3fb9c7['offset'];var _0x1b2372=_0x2f7fd3?_0x305c08['count']:_0x3fb9c7[_0x405d('0x1a')]+_0x3fb9c7['limit'];var _0x3c1e32;if(_0x1b2372>=_0x176908){_0x1b2372=_0x176908;_0x3c1e32=0xc8;}else{_0x3c1e32=0xce;}_0x11e9ed[_0x405d('0x18')](_0x3c1e32);return _0x11e9ed[_0x405d('0x1e')](_0x405d('0x1f'),_0xe2e8ea+'-'+_0x1b2372+'/'+_0x176908)['json'](_0x305c08);}return null;};}function patchUpdates(_0x4cdb19){return function(_0x54f8e7){try{jsonpatch[_0x405d('0x20')](_0x54f8e7,_0x4cdb19,!![]);}catch(_0x376dd4){return BPromise[_0x405d('0x21')](_0x376dd4);}return _0x54f8e7[_0x405d('0x22')]();};}function saveUpdates(_0x35f774,_0x1380c1){return function(_0x5d8486){if(_0x5d8486){return _0x5d8486[_0x405d('0x23')](_0x35f774)['then'](function(_0x3237f8){return _0x3237f8;});}return null;};}function removeEntity(_0x522fa3,_0x18be91){return function(_0x1f5ff1){if(_0x1f5ff1){return _0x1f5ff1[_0x405d('0x24')]()[_0x405d('0x25')](function(){_0x522fa3[_0x405d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463cb6,_0x187dc5){return function(_0x290fcc){if(!_0x290fcc){_0x463cb6[_0x405d('0x17')](0x194);}return _0x290fcc;};}function handleError(_0x1cd600,_0x4d6caa){_0x4d6caa=_0x4d6caa||0x1f4;return function(_0x2a108a){logger[_0x405d('0x26')](_0x2a108a[_0x405d('0x27')]);if(_0x2a108a[_0x405d('0x28')]){delete _0x2a108a['name'];}_0x1cd600[_0x405d('0x18')](_0x4d6caa)[_0x405d('0x29')](_0x2a108a);};}exports[_0x405d('0x2a')]=function(_0x3406fe,_0x2db3a2){var _0x1d6c43={},_0x3840a7={},_0xe23332={'count':0x0,'rows':[]};var _0x5661f5=_[_0x405d('0x2b')](db[_0x405d('0x2c')][_0x405d('0x2d')],function(_0x309a85){return{'name':_0x309a85['fieldName'],'type':_0x309a85['type'][_0x405d('0x2e')]};});_0x3840a7[_0x405d('0x2f')]=_[_0x405d('0x2b')](_0x5661f5,_0x405d('0x28'));_0x3840a7[_0x405d('0x30')]=_[_0x405d('0x31')](_0x3406fe['query']);_0x3840a7[_0x405d('0x32')]=_[_0x405d('0x33')](_0x3840a7[_0x405d('0x2f')],_0x3840a7[_0x405d('0x30')]);_0x1d6c43[_0x405d('0x34')]=_[_0x405d('0x33')](_0x3840a7[_0x405d('0x2f')],qs[_0x405d('0x35')](_0x3406fe[_0x405d('0x30')]['fields']));_0x1d6c43[_0x405d('0x34')]=_0x1d6c43['attributes']['length']?_0x1d6c43[_0x405d('0x34')]:_0x3840a7[_0x405d('0x2f')];if(!_0x3406fe[_0x405d('0x30')][_0x405d('0x36')](_0x405d('0x37'))){_0x1d6c43[_0x405d('0x1b')]=qs[_0x405d('0x1b')](_0x3406fe[_0x405d('0x30')][_0x405d('0x1b')]);_0x1d6c43[_0x405d('0x1a')]=qs[_0x405d('0x1a')](_0x3406fe[_0x405d('0x30')][_0x405d('0x1a')]);}_0x1d6c43[_0x405d('0x38')]=qs['sort'](_0x3406fe['query']['sort']);_0x1d6c43[_0x405d('0x39')]=qs[_0x405d('0x32')](_[_0x405d('0x3a')](_0x3406fe[_0x405d('0x30')],_0x3840a7['filters']),_0x5661f5);if(_0x3406fe[_0x405d('0x30')]['filter']){_0x1d6c43[_0x405d('0x39')]=_[_0x405d('0x3b')](_0x1d6c43[_0x405d('0x39')],{'$or':_[_0x405d('0x2b')](_0x5661f5,function(_0x3b1bc7){if(_0x3b1bc7[_0x405d('0x3c')]!==_0x405d('0x3d')){var _0x1b1f2b={};_0x1b1f2b[_0x3b1bc7['name']]={'$like':'%'+_0x3406fe[_0x405d('0x30')][_0x405d('0x3e')]+'%'};return _0x1b1f2b;}})});}_0x1d6c43=_['merge']({},_0x1d6c43,_0x3406fe[_0x405d('0x3f')]);var _0x48660f={'where':_0x1d6c43[_0x405d('0x39')]};return db['SalesforceField'][_0x405d('0x1d')](_0x48660f)[_0x405d('0x25')](function(_0x281d1e){_0xe23332['count']=_0x281d1e;if(_0x3406fe['query'][_0x405d('0x40')]){_0x1d6c43['include']=[{'all':!![]}];}return db[_0x405d('0x2c')][_0x405d('0x41')](_0x1d6c43);})[_0x405d('0x25')](function(_0x17e358){_0xe23332[_0x405d('0x42')]=_0x17e358;return _0xe23332;})[_0x405d('0x25')](respondWithFilteredResult(_0x2db3a2,_0x1d6c43))[_0x405d('0x43')](handleError(_0x2db3a2,null));};exports[_0x405d('0x44')]=function(_0x2966bd,_0x5ac99b){var _0x6841f1={'raw':!![],'where':{'id':_0x2966bd[_0x405d('0x45')]['id']}},_0x3b6ccf={};_0x3b6ccf[_0x405d('0x2f')]=_['keys'](db[_0x405d('0x2c')][_0x405d('0x2d')]);_0x3b6ccf[_0x405d('0x30')]=_[_0x405d('0x31')](_0x2966bd[_0x405d('0x30')]);_0x3b6ccf['filters']=_[_0x405d('0x33')](_0x3b6ccf['model'],_0x3b6ccf[_0x405d('0x30')]);_0x6841f1['attributes']=_[_0x405d('0x33')](_0x3b6ccf['model'],qs[_0x405d('0x35')](_0x2966bd[_0x405d('0x30')]['fields']));_0x6841f1[_0x405d('0x34')]=_0x6841f1[_0x405d('0x34')]['length']?_0x6841f1['attributes']:_0x3b6ccf[_0x405d('0x2f')];if(_0x2966bd[_0x405d('0x30')][_0x405d('0x40')]){_0x6841f1['include']=[{'all':!![]}];}_0x6841f1=_[_0x405d('0x3b')]({},_0x6841f1,_0x2966bd[_0x405d('0x3f')]);return db[_0x405d('0x2c')][_0x405d('0x46')](_0x6841f1)['then'](handleEntityNotFound(_0x5ac99b,null))[_0x405d('0x25')](respondWithResult(_0x5ac99b,null))[_0x405d('0x43')](handleError(_0x5ac99b,null));};exports[_0x405d('0x47')]=function(_0x19ea81,_0x3787be){return db['SalesforceField']['create'](_0x19ea81[_0x405d('0x48')],{})[_0x405d('0x25')](respondWithResult(_0x3787be,0xc9))['catch'](handleError(_0x3787be,null));};exports[_0x405d('0x23')]=function(_0x4d8020,_0x4415a2){if(_0x4d8020[_0x405d('0x48')]['id']){delete _0x4d8020['body']['id'];}return db['SalesforceField']['find']({'where':{'id':_0x4d8020['params']['id']}})[_0x405d('0x25')](handleEntityNotFound(_0x4415a2,null))['then'](saveUpdates(_0x4d8020['body'],null))['then'](respondWithResult(_0x4415a2,null))['catch'](handleError(_0x4415a2,null));};exports[_0x405d('0x24')]=function(_0x4c0938,_0x34b65f){return db[_0x405d('0x2c')][_0x405d('0x46')]({'where':{'id':_0x4c0938[_0x405d('0x45')]['id']}})['then'](handleEntityNotFound(_0x34b65f,null))['then'](removeEntity(_0x34b65f,null))['catch'](handleError(_0x34b65f,null));};
\ No newline at end of file
+var _0xfa62=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','SalesforceField','count','include','findAll','catch','show','params','fields','options','create','body','find','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x207092,_0x4cbe32){var _0x4e7889=function(_0x45e77b){while(--_0x45e77b){_0x207092['push'](_0x207092['shift']());}};_0x4e7889(++_0x4cbe32);}(_0xfa62,0xc0));var _0x2fa6=function(_0x4112cb,_0x1673fe){_0x4112cb=_0x4112cb-0x0;var _0x2231bc=_0xfa62[_0x4112cb];return _0x2231bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2fa6('0x0'));var zipdir=require(_0x2fa6('0x1'));var jsonpatch=require(_0x2fa6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2fa6('0x3'));var Mustache=require('mustache');var util=require(_0x2fa6('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x2fa6('0x5'));var ejs=require(_0x2fa6('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2fa6('0x7'));var squel=require(_0x2fa6('0x8'));var crypto=require('crypto');var jsforce=require(_0x2fa6('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2fa6('0x5'));var querystring=require('querystring');var Papa=require(_0x2fa6('0xa'));var Redis=require('ioredis');var authService=require(_0x2fa6('0xb'));var qs=require(_0x2fa6('0xc'));var as=require(_0x2fa6('0xd'));var hardwareService=require(_0x2fa6('0xe'));var logger=require(_0x2fa6('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x2fa6('0x10'));var licenseUtil=require(_0x2fa6('0x11'));var db=require(_0x2fa6('0x12'))['db'];function respondWithStatusCode(_0x53b41c,_0x25286a){_0x25286a=_0x25286a||0xcc;return function(_0x43b15c){if(_0x43b15c){return _0x53b41c[_0x2fa6('0x13')](_0x25286a);}return _0x53b41c['status'](_0x25286a)['end']();};}function respondWithResult(_0xe44609,_0x543c77){_0x543c77=_0x543c77||0xc8;return function(_0x556b78){if(_0x556b78){return _0xe44609[_0x2fa6('0x14')](_0x543c77)[_0x2fa6('0x15')](_0x556b78);}};}function respondWithFilteredResult(_0x5a4f86,_0x2dd1a2){return function(_0x2f0514){if(_0x2f0514){var _0x254577=typeof _0x2dd1a2[_0x2fa6('0x16')]==='undefined'&&typeof _0x2dd1a2[_0x2fa6('0x17')]===_0x2fa6('0x18');var _0x545610=_0x2f0514['count'];var _0x389fa4=_0x254577?0x0:_0x2dd1a2[_0x2fa6('0x16')];var _0x4dfe6c=_0x254577?_0x2f0514['count']:_0x2dd1a2[_0x2fa6('0x16')]+_0x2dd1a2[_0x2fa6('0x17')];var _0x558730;if(_0x4dfe6c>=_0x545610){_0x4dfe6c=_0x545610;_0x558730=0xc8;}else{_0x558730=0xce;}_0x5a4f86[_0x2fa6('0x14')](_0x558730);return _0x5a4f86[_0x2fa6('0x19')](_0x2fa6('0x1a'),_0x389fa4+'-'+_0x4dfe6c+'/'+_0x545610)[_0x2fa6('0x15')](_0x2f0514);}return null;};}function patchUpdates(_0x10f198){return function(_0x3053f2){try{jsonpatch[_0x2fa6('0x1b')](_0x3053f2,_0x10f198,!![]);}catch(_0x481695){return BPromise[_0x2fa6('0x1c')](_0x481695);}return _0x3053f2[_0x2fa6('0x1d')]();};}function saveUpdates(_0x11ae50,_0x4bfef9){return function(_0x1db399){if(_0x1db399){return _0x1db399[_0x2fa6('0x1e')](_0x11ae50)[_0x2fa6('0x1f')](function(_0x276b20){return _0x276b20;});}return null;};}function removeEntity(_0x3c9480,_0x3319f0){return function(_0x30b8eb){if(_0x30b8eb){return _0x30b8eb[_0x2fa6('0x20')]()[_0x2fa6('0x1f')](function(){_0x3c9480[_0x2fa6('0x14')](0xcc)[_0x2fa6('0x21')]();});}};}function handleEntityNotFound(_0xf77f51,_0x359005){return function(_0x19cc9e){if(!_0x19cc9e){_0xf77f51[_0x2fa6('0x13')](0x194);}return _0x19cc9e;};}function handleError(_0x1533a8,_0xed820){_0xed820=_0xed820||0x1f4;return function(_0x42f1a6){logger[_0x2fa6('0x22')](_0x42f1a6[_0x2fa6('0x23')]);if(_0x42f1a6['name']){delete _0x42f1a6[_0x2fa6('0x24')];}_0x1533a8[_0x2fa6('0x14')](_0xed820)[_0x2fa6('0x25')](_0x42f1a6);};}exports[_0x2fa6('0x26')]=function(_0x1c5c94,_0xe3ad64){var _0x39bfea={},_0x2ca627={},_0x26049f={'count':0x0,'rows':[]};var _0x1d2f3c=_[_0x2fa6('0x27')](db['SalesforceField'][_0x2fa6('0x28')],function(_0x218ef8){return{'name':_0x218ef8[_0x2fa6('0x29')],'type':_0x218ef8[_0x2fa6('0x2a')]['key']};});_0x2ca627[_0x2fa6('0x2b')]=_[_0x2fa6('0x27')](_0x1d2f3c,_0x2fa6('0x24'));_0x2ca627[_0x2fa6('0x2c')]=_[_0x2fa6('0x2d')](_0x1c5c94['query']);_0x2ca627[_0x2fa6('0x2e')]=_[_0x2fa6('0x2f')](_0x2ca627[_0x2fa6('0x2b')],_0x2ca627['query']);_0x39bfea['attributes']=_['intersection'](_0x2ca627[_0x2fa6('0x2b')],qs['fields'](_0x1c5c94[_0x2fa6('0x2c')]['fields']));_0x39bfea[_0x2fa6('0x30')]=_0x39bfea[_0x2fa6('0x30')][_0x2fa6('0x31')]?_0x39bfea[_0x2fa6('0x30')]:_0x2ca627[_0x2fa6('0x2b')];if(!_0x1c5c94[_0x2fa6('0x2c')][_0x2fa6('0x32')]('nolimit')){_0x39bfea[_0x2fa6('0x17')]=qs[_0x2fa6('0x17')](_0x1c5c94[_0x2fa6('0x2c')]['limit']);_0x39bfea[_0x2fa6('0x16')]=qs['offset'](_0x1c5c94[_0x2fa6('0x2c')][_0x2fa6('0x16')]);}_0x39bfea[_0x2fa6('0x33')]=qs['sort'](_0x1c5c94[_0x2fa6('0x2c')][_0x2fa6('0x34')]);_0x39bfea[_0x2fa6('0x35')]=qs[_0x2fa6('0x2e')](_['pick'](_0x1c5c94['query'],_0x2ca627[_0x2fa6('0x2e')]),_0x1d2f3c);if(_0x1c5c94[_0x2fa6('0x2c')][_0x2fa6('0x36')]){_0x39bfea[_0x2fa6('0x35')]=_[_0x2fa6('0x37')](_0x39bfea[_0x2fa6('0x35')],{'$or':_['map'](_0x1d2f3c,function(_0x58ec1a){if(_0x58ec1a[_0x2fa6('0x2a')]!==_0x2fa6('0x38')){var _0x1c0e83={};_0x1c0e83[_0x58ec1a['name']]={'$like':'%'+_0x1c5c94[_0x2fa6('0x2c')]['filter']+'%'};return _0x1c0e83;}})});}_0x39bfea=_[_0x2fa6('0x37')]({},_0x39bfea,_0x1c5c94['options']);var _0x20367d={'where':_0x39bfea['where']};return db[_0x2fa6('0x39')][_0x2fa6('0x3a')](_0x20367d)[_0x2fa6('0x1f')](function(_0xa3509c){_0x26049f[_0x2fa6('0x3a')]=_0xa3509c;if(_0x1c5c94[_0x2fa6('0x2c')]['includeAll']){_0x39bfea[_0x2fa6('0x3b')]=[{'all':!![]}];}return db[_0x2fa6('0x39')][_0x2fa6('0x3c')](_0x39bfea);})[_0x2fa6('0x1f')](function(_0x2e3642){_0x26049f['rows']=_0x2e3642;return _0x26049f;})[_0x2fa6('0x1f')](respondWithFilteredResult(_0xe3ad64,_0x39bfea))[_0x2fa6('0x3d')](handleError(_0xe3ad64,null));};exports[_0x2fa6('0x3e')]=function(_0x24d906,_0x46abb2){var _0x13275a={'raw':!![],'where':{'id':_0x24d906[_0x2fa6('0x3f')]['id']}},_0x4b9a51={};_0x4b9a51[_0x2fa6('0x2b')]=_[_0x2fa6('0x2d')](db[_0x2fa6('0x39')][_0x2fa6('0x28')]);_0x4b9a51[_0x2fa6('0x2c')]=_[_0x2fa6('0x2d')](_0x24d906[_0x2fa6('0x2c')]);_0x4b9a51[_0x2fa6('0x2e')]=_[_0x2fa6('0x2f')](_0x4b9a51[_0x2fa6('0x2b')],_0x4b9a51[_0x2fa6('0x2c')]);_0x13275a[_0x2fa6('0x30')]=_['intersection'](_0x4b9a51['model'],qs[_0x2fa6('0x40')](_0x24d906['query'][_0x2fa6('0x40')]));_0x13275a[_0x2fa6('0x30')]=_0x13275a[_0x2fa6('0x30')][_0x2fa6('0x31')]?_0x13275a[_0x2fa6('0x30')]:_0x4b9a51[_0x2fa6('0x2b')];if(_0x24d906[_0x2fa6('0x2c')]['includeAll']){_0x13275a[_0x2fa6('0x3b')]=[{'all':!![]}];}_0x13275a=_[_0x2fa6('0x37')]({},_0x13275a,_0x24d906[_0x2fa6('0x41')]);return db[_0x2fa6('0x39')]['find'](_0x13275a)[_0x2fa6('0x1f')](handleEntityNotFound(_0x46abb2,null))[_0x2fa6('0x1f')](respondWithResult(_0x46abb2,null))[_0x2fa6('0x3d')](handleError(_0x46abb2,null));};exports[_0x2fa6('0x42')]=function(_0x478f36,_0x545d57){return db['SalesforceField'][_0x2fa6('0x42')](_0x478f36[_0x2fa6('0x43')],{})[_0x2fa6('0x1f')](respondWithResult(_0x545d57,0xc9))[_0x2fa6('0x3d')](handleError(_0x545d57,null));};exports[_0x2fa6('0x1e')]=function(_0x3a55f2,_0x591194){if(_0x3a55f2[_0x2fa6('0x43')]['id']){delete _0x3a55f2[_0x2fa6('0x43')]['id'];}return db[_0x2fa6('0x39')][_0x2fa6('0x44')]({'where':{'id':_0x3a55f2[_0x2fa6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x591194,null))['then'](saveUpdates(_0x3a55f2[_0x2fa6('0x43')],null))[_0x2fa6('0x1f')](respondWithResult(_0x591194,null))[_0x2fa6('0x3d')](handleError(_0x591194,null));};exports[_0x2fa6('0x20')]=function(_0x2a0618,_0x44ad32){return db[_0x2fa6('0x39')][_0x2fa6('0x44')]({'where':{'id':_0x2a0618[_0x2fa6('0x3f')]['id']}})[_0x2fa6('0x1f')](handleEntityNotFound(_0x44ad32,null))['then'](removeEntity(_0x44ad32,null))[_0x2fa6('0x3d')](handleError(_0x44ad32,null));};
\ No newline at end of file
index c94fe9d..8252621 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51b9=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','FieldId'];(function(_0x892220,_0x3d7e63){var _0x520f3a=function(_0x55ecda){while(--_0x55ecda){_0x892220['push'](_0x892220['shift']());}};_0x520f3a(++_0x3d7e63);}(_0x51b9,0x1c2));var _0x951b=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x51b9[_0x102977];return _0x15c466;};'use strict';var _=require(_0x951b('0x0'));var util=require('util');var logger=require(_0x951b('0x1'))(_0x951b('0x2'));var moment=require(_0x951b('0x3'));var BPromise=require(_0x951b('0x4'));var rp=require(_0x951b('0x5'));var fs=require('fs');var path=require(_0x951b('0x6'));var rimraf=require(_0x951b('0x7'));var config=require(_0x951b('0x8'));var attributes=require(_0x951b('0x9'));module[_0x951b('0xa')]=function(_0x2515c6,_0x35dc0f){return _0x2515c6[_0x951b('0xb')](_0x951b('0xc'),attributes,{'tableName':_0x951b('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x951b('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x40e1=['./intSalesforceField.attributes','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','api','moment','rimraf','../../config/environment'];(function(_0x1416fc,_0x72e155){var _0x3a4b34=function(_0x455ac8){while(--_0x455ac8){_0x1416fc['push'](_0x1416fc['shift']());}};_0x3a4b34(++_0x72e155);}(_0x40e1,0x1da));var _0x140e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x40e1[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x140e('0x0'));var util=require(_0x140e('0x1'));var logger=require('../../config/logger')(_0x140e('0x2'));var moment=require(_0x140e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x140e('0x4'));var config=require(_0x140e('0x5'));var attributes=require(_0x140e('0x6'));module['exports']=function(_0x2b1c17,_0x391144){return _0x2b1c17['define']('SalesforceField',attributes,{'tableName':_0x140e('0x7'),'paranoid':![],'indexes':[{'name':_0x140e('0x8'),'fields':['idField',_0x140e('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 86174b7..b974a56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2df8=['client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x59b48b,_0x584733){var _0x4c3f79=function(_0x3f2e94){while(--_0x3f2e94){_0x59b48b['push'](_0x59b48b['shift']());}};_0x4c3f79(++_0x584733);}(_0x2df8,0x65));var _0x82df=function(_0x2de740,_0x1c823c){_0x2de740=_0x2de740-0x0;var _0x3bdf20=_0x2df8[_0x2de740];return _0x3bdf20;};'use strict';var _=require(_0x82df('0x0'));var util=require(_0x82df('0x1'));var moment=require('moment');var BPromise=require(_0x82df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82df('0x3'));var db=require(_0x82df('0x4'))['db'];var utils=require(_0x82df('0x5'));var logger=require(_0x82df('0x6'))(_0x82df('0x7'));var config=require(_0x82df('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x82df('0x9')][_0x82df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1487a0,_0x2f2846,_0x358896){return new BPromise(function(_0x1ca4ed,_0x6a1f30){return client[_0x82df('0xb')](_0x1487a0,_0x358896)[_0x82df('0xc')](function(_0xa6e163){logger['info'](_0x82df('0xd'),_0x2f2846,_0x82df('0xe'));logger['debug'](_0x82df('0xf'),_0x2f2846,'request\x20sent',JSON[_0x82df('0x10')](_0xa6e163));if(_0xa6e163['error']){if(_0xa6e163[_0x82df('0x11')]['code']===0x1f4){logger[_0x82df('0x11')](_0x82df('0xd'),_0x2f2846,_0xa6e163['error']['message']);return _0x6a1f30(_0xa6e163[_0x82df('0x11')][_0x82df('0x12')]);}logger[_0x82df('0x11')]('SalesforceField,\x20%s,\x20%s',_0x2f2846,_0xa6e163[_0x82df('0x11')]['message']);return _0x1ca4ed(_0xa6e163[_0x82df('0x11')][_0x82df('0x12')]);}else{logger[_0x82df('0x13')](_0x82df('0xd'),_0x2f2846,_0x82df('0xe'));_0x1ca4ed(_0xa6e163[_0x82df('0x14')][_0x82df('0x12')]);}})[_0x82df('0x15')](function(_0x3fbc36){logger['error']('SalesforceField,\x20%s,\x20%s',_0x2f2846,_0x3fbc36);_0x6a1f30(_0x3fbc36);});});}
\ No newline at end of file
+var _0xba73=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xba73,0x199));var _0x3ba7=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xba73[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ba7('0x0'));var BPromise=require(_0x3ba7('0x1'));var rs=require(_0x3ba7('0x2'));var fs=require('fs');var Redis=require(_0x3ba7('0x3'));var db=require(_0x3ba7('0x4'))['db'];var utils=require(_0x3ba7('0x5'));var logger=require('../../config/logger')(_0x3ba7('0x6'));var config=require(_0x3ba7('0x7'));var jayson=require(_0x3ba7('0x8'));var client=jayson[_0x3ba7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4bc9,_0x41d9fc,_0x12de7d){return new BPromise(function(_0x464851,_0x4adf4a){return client[_0x3ba7('0xa')](_0x3c4bc9,_0x12de7d)[_0x3ba7('0xb')](function(_0x186028){logger[_0x3ba7('0xc')](_0x3ba7('0xd'),_0x41d9fc,_0x3ba7('0xe'));logger['debug'](_0x3ba7('0xf'),_0x41d9fc,'request\x20sent',JSON[_0x3ba7('0x10')](_0x186028));if(_0x186028[_0x3ba7('0x11')]){if(_0x186028[_0x3ba7('0x11')]['code']===0x1f4){logger['error'](_0x3ba7('0xd'),_0x41d9fc,_0x186028['error'][_0x3ba7('0x12')]);return _0x4adf4a(_0x186028[_0x3ba7('0x11')][_0x3ba7('0x12')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x41d9fc,_0x186028[_0x3ba7('0x11')][_0x3ba7('0x12')]);return _0x464851(_0x186028[_0x3ba7('0x11')][_0x3ba7('0x12')]);}else{logger[_0x3ba7('0xc')]('SalesforceField,\x20%s,\x20%s',_0x41d9fc,'request\x20sent');_0x464851(_0x186028[_0x3ba7('0x13')]['message']);}})['catch'](function(_0x4a787b){logger[_0x3ba7('0x11')](_0x3ba7('0xd'),_0x41d9fc,_0x4a787b);_0x4adf4a(_0x4a787b);});});}
\ No newline at end of file
index 3444530..3703b52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6fe=['addConfiguration','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0x46ec93,_0x39af2d){var _0x515657=function(_0x4b46b7){while(--_0x4b46b7){_0x46ec93['push'](_0x46ec93['shift']());}};_0x515657(++_0x39af2d);}(_0xc6fe,0xbc));var _0xec6f=function(_0x394176,_0x229d99){_0x394176=_0x394176-0x0;var _0x1ce047=_0xc6fe[_0x394176];return _0x1ce047;};'use strict';var multer=require(_0xec6f('0x0'));var util=require(_0xec6f('0x1'));var path=require('path');var timeout=require(_0xec6f('0x2'));var express=require(_0xec6f('0x3'));var router=express[_0xec6f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xec6f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec6f('0x6'));var controller=require(_0xec6f('0x7'));router[_0xec6f('0x8')]('/',auth[_0xec6f('0x9')](),controller[_0xec6f('0xa')]);router[_0xec6f('0x8')](_0xec6f('0xb'),auth[_0xec6f('0x9')](),controller[_0xec6f('0xc')]);router[_0xec6f('0x8')]('/:id/configurations',auth[_0xec6f('0x9')](),controller[_0xec6f('0xd')]);router[_0xec6f('0x8')](_0xec6f('0xe'),auth[_0xec6f('0x9')](),controller[_0xec6f('0xf')]);router[_0xec6f('0x10')]('/',auth[_0xec6f('0x9')](),controller[_0xec6f('0x11')]);router[_0xec6f('0x10')](_0xec6f('0x12'),auth['isAuthenticated'](),controller[_0xec6f('0x13')]);router[_0xec6f('0x14')](_0xec6f('0xb'),auth[_0xec6f('0x9')](),controller[_0xec6f('0x15')]);router['delete']('/:id',auth[_0xec6f('0x9')](),controller[_0xec6f('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x515d=['getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x77e6d7,_0xecb4fc){var _0x554225=function(_0x1b8254){while(--_0x1b8254){_0x77e6d7['push'](_0x77e6d7['shift']());}};_0x554225(++_0xecb4fc);}(_0x515d,0x104));var _0xd515=function(_0x4b70a2,_0x5d0fbd){_0x4b70a2=_0x4b70a2-0x0;var _0x2170fa=_0x515d[_0x4b70a2];return _0x2170fa;};'use strict';var multer=require('multer');var util=require(_0xd515('0x0'));var path=require(_0xd515('0x1'));var timeout=require(_0xd515('0x2'));var express=require(_0xd515('0x3'));var router=express[_0xd515('0x4')]();var fs_extra=require(_0xd515('0x5'));var auth=require(_0xd515('0x6'));var interaction=require(_0xd515('0x7'));var config=require('../../config/environment');var controller=require(_0xd515('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd515('0x9')]);router[_0xd515('0xa')](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0xd')]);router['get'](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0xf')]);router[_0xd515('0xa')](_0xd515('0x10'),auth[_0xd515('0xc')](),controller['getFields']);router[_0xd515('0x11')]('/',auth[_0xd515('0xc')](),controller[_0xd515('0x12')]);router[_0xd515('0x11')]('/:id/configurations',auth[_0xd515('0xc')](),controller[_0xd515('0x13')]);router[_0xd515('0x14')](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0x15')]);router[_0xd515('0x16')](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0x17')]);module[_0xd515('0x18')]=router;
\ No newline at end of file
index 636b4af..c183046 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1265=['sequelize','STRING','username','remoteUri'];(function(_0x287e90,_0x4a77f1){var _0x4e95e2=function(_0x3761ae){while(--_0x3761ae){_0x287e90['push'](_0x287e90['shift']());}};_0x4e95e2(++_0x4a77f1);}(_0x1265,0x98));var _0x5126=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1265[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x5126('0x0'));module['exports']={'name':{'type':Sequelize[_0x5126('0x1')]},'description':{'type':Sequelize[_0x5126('0x1')]},'username':{'type':Sequelize[_0x5126('0x1')],'unique':_0x5126('0x2')},'password':{'type':Sequelize[_0x5126('0x1')]},'email':{'type':Sequelize[_0x5126('0x1')]},'remoteUri':{'type':Sequelize[_0x5126('0x1')],'unique':_0x5126('0x3')},'serverUrl':{'type':Sequelize[_0x5126('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x7bad=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5275eb,_0x14a099){var _0xc3f8fe=function(_0xeae144){while(--_0xeae144){_0x5275eb['push'](_0x5275eb['shift']());}};_0xc3f8fe(++_0x14a099);}(_0x7bad,0x1d2));var _0xd7ba=function(_0x40710f,_0x3f145e){_0x40710f=_0x40710f-0x0;var _0x591385=_0x7bad[_0x40710f];return _0x591385;};'use strict';var Sequelize=require(_0xd7ba('0x0'));module[_0xd7ba('0x1')]={'name':{'type':Sequelize[_0xd7ba('0x2')]},'description':{'type':Sequelize[_0xd7ba('0x2')]},'username':{'type':Sequelize[_0xd7ba('0x2')],'unique':_0xd7ba('0x3')},'password':{'type':Sequelize[_0xd7ba('0x2')]},'email':{'type':Sequelize[_0xd7ba('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd7ba('0x4')},'serverUrl':{'type':Sequelize[_0xd7ba('0x2')],'allowNull':![]}};
\ No newline at end of file
index 313012c..60d0ed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a11=['fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','findOne','ServicenowConfiguration','sort','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','category','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','expected_start','business_duration','group_list','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','email','serverUrl','slice','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','remove','includes','forEach','label','push','all','assign','TCL:\x20_object','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','error','send','Wrong\x20credentials','true','false','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','offset','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','index','map','ServicenowAccount','model','query','keys','intersection','attributes'];(function(_0x27d383,_0x2d4433){var _0x34795b=function(_0x59ce15){while(--_0x59ce15){_0x27d383['push'](_0x27d383['shift']());}};_0x34795b(++_0x2d4433);}(_0x6a11,0x13d));var _0x16a1=function(_0x2cebbc,_0x1822d5){_0x2cebbc=_0x2cebbc-0x0;var _0x62ae04=_0x6a11[_0x2cebbc];return _0x62ae04;};'use strict';var emlformat=require(_0x16a1('0x0'));var rimraf=require(_0x16a1('0x1'));var zipdir=require(_0x16a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16a1('0x3'));var moment=require(_0x16a1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x16a1('0x5'));var util=require(_0x16a1('0x6'));var path=require(_0x16a1('0x7'));var sox=require(_0x16a1('0x8'));var csv=require(_0x16a1('0x9'));var ejs=require(_0x16a1('0xa'));var fs=require('fs');var fs_extra=require(_0x16a1('0xb'));var _=require(_0x16a1('0xc'));var squel=require(_0x16a1('0xd'));var crypto=require(_0x16a1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x16a1('0xf'));var toCsv=require(_0x16a1('0x9'));var querystring=require(_0x16a1('0x10'));var Papa=require(_0x16a1('0x11'));var Redis=require(_0x16a1('0x12'));var authService=require(_0x16a1('0x13'));var qs=require(_0x16a1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16a1('0x15'));var logger=require('../../config/logger')(_0x16a1('0x16'));var utils=require(_0x16a1('0x17'));var config=require(_0x16a1('0x18'));var licenseUtil=require(_0x16a1('0x19'));var db=require(_0x16a1('0x1a'))['db'];var integrations=require(_0x16a1('0x1b'));function respondWithStatusCode(_0xbb663b,_0x31e935){_0x31e935=_0x31e935||0xcc;return function(_0x5ce096){if(_0x5ce096){return _0xbb663b[_0x16a1('0x1c')](_0x31e935);}return _0xbb663b['status'](_0x31e935)['end']();};}function respondWithResult(_0x4948a3,_0x36bde2){_0x36bde2=_0x36bde2||0xc8;return function(_0xf0458){if(_0xf0458){return _0x4948a3[_0x16a1('0x1d')](_0x36bde2)['json'](_0xf0458);}};}function respondWithFilteredResult(_0x10a8db,_0x5895f4){return function(_0x2d6822){if(_0x2d6822){var _0x3a9649=typeof _0x5895f4['offset']===_0x16a1('0x1e')&&typeof _0x5895f4['limit']===_0x16a1('0x1e');var _0x70310a=_0x2d6822['count'];var _0x1d0cfc=_0x3a9649?0x0:_0x5895f4[_0x16a1('0x1f')];var _0x2565b3=_0x3a9649?_0x2d6822[_0x16a1('0x20')]:_0x5895f4[_0x16a1('0x1f')]+_0x5895f4[_0x16a1('0x21')];var _0x216e38;if(_0x2565b3>=_0x70310a){_0x2565b3=_0x70310a;_0x216e38=0xc8;}else{_0x216e38=0xce;}_0x10a8db[_0x16a1('0x1d')](_0x216e38);return _0x10a8db['set'](_0x16a1('0x22'),_0x1d0cfc+'-'+_0x2565b3+'/'+_0x70310a)[_0x16a1('0x23')](_0x2d6822);}return null;};}function patchUpdates(_0x48ef47){return function(_0x3f8106){try{jsonpatch[_0x16a1('0x24')](_0x3f8106,_0x48ef47,!![]);}catch(_0xc6a10f){return BPromise[_0x16a1('0x25')](_0xc6a10f);}return _0x3f8106[_0x16a1('0x26')]();};}function saveUpdates(_0x59faed,_0x5b2125){return function(_0x4fe956){if(_0x4fe956){return _0x4fe956[_0x16a1('0x27')](_0x59faed)[_0x16a1('0x28')](function(_0x18cc79){return _0x18cc79;});}return null;};}function removeEntity(_0x2c908d,_0xaa4549){return function(_0x3c82bb){if(_0x3c82bb){return _0x3c82bb[_0x16a1('0x29')]()[_0x16a1('0x28')](function(){_0x2c908d[_0x16a1('0x1d')](0xcc)[_0x16a1('0x2a')]();});}};}function handleEntityNotFound(_0x4c46d1,_0x461b63){return function(_0x3d6c47){if(!_0x3d6c47){_0x4c46d1['sendStatus'](0x194);}return _0x3d6c47;};}function handleError(_0x7d2454,_0x9d02da){_0x9d02da=_0x9d02da||0x1f4;return function(_0x3738e6){logger['error'](_0x3738e6[_0x16a1('0x2b')]);if(_0x3738e6[_0x16a1('0x2c')]){delete _0x3738e6[_0x16a1('0x2c')];}_0x7d2454[_0x16a1('0x1d')](_0x9d02da)['send'](_0x3738e6);};}exports[_0x16a1('0x2d')]=function(_0x55c248,_0x29efd1){var _0x155522={},_0x48687b={},_0x44e05f={'count':0x0,'rows':[]};var _0x101e9b=_[_0x16a1('0x2e')](db[_0x16a1('0x2f')]['rawAttributes'],function(_0x33c289){return{'name':_0x33c289['fieldName'],'type':_0x33c289['type']['key']};});_0x48687b[_0x16a1('0x30')]=_[_0x16a1('0x2e')](_0x101e9b,'name');_0x48687b[_0x16a1('0x31')]=_[_0x16a1('0x32')](_0x55c248[_0x16a1('0x31')]);_0x48687b['filters']=_[_0x16a1('0x33')](_0x48687b[_0x16a1('0x30')],_0x48687b['query']);_0x155522[_0x16a1('0x34')]=_[_0x16a1('0x33')](_0x48687b[_0x16a1('0x30')],qs[_0x16a1('0x35')](_0x55c248[_0x16a1('0x31')][_0x16a1('0x35')]));_0x155522[_0x16a1('0x34')]=_0x155522[_0x16a1('0x34')][_0x16a1('0x36')]?_0x155522[_0x16a1('0x34')]:_0x48687b[_0x16a1('0x30')];if(!_0x55c248['query'][_0x16a1('0x37')](_0x16a1('0x38'))){_0x155522[_0x16a1('0x21')]=qs['limit'](_0x55c248[_0x16a1('0x31')]['limit']);_0x155522[_0x16a1('0x1f')]=qs[_0x16a1('0x1f')](_0x55c248[_0x16a1('0x31')][_0x16a1('0x1f')]);}_0x155522[_0x16a1('0x39')]=qs['sort'](_0x55c248[_0x16a1('0x31')]['sort']);_0x155522[_0x16a1('0x3a')]=qs['filters'](_['pick'](_0x55c248[_0x16a1('0x31')],_0x48687b[_0x16a1('0x3b')]),_0x101e9b);if(_0x55c248['query'][_0x16a1('0x3c')]){_0x155522['where']=_[_0x16a1('0x3d')](_0x155522[_0x16a1('0x3a')],{'$or':_[_0x16a1('0x2e')](_0x101e9b,function(_0x56ccdb){if(_0x56ccdb[_0x16a1('0x3e')]!==_0x16a1('0x3f')){var _0xf61771={};_0xf61771[_0x56ccdb['name']]={'$like':'%'+_0x55c248['query'][_0x16a1('0x3c')]+'%'};return _0xf61771;}})});}_0x155522=_[_0x16a1('0x3d')]({},_0x155522,_0x55c248[_0x16a1('0x40')]);var _0x1959ee={'where':_0x155522['where']};return db['ServicenowAccount'][_0x16a1('0x20')](_0x1959ee)[_0x16a1('0x28')](function(_0x180a95){_0x44e05f[_0x16a1('0x20')]=_0x180a95;if(_0x55c248[_0x16a1('0x31')][_0x16a1('0x41')]){_0x155522[_0x16a1('0x42')]=[{'all':!![]}];}return db[_0x16a1('0x2f')][_0x16a1('0x43')](_0x155522);})[_0x16a1('0x28')](function(_0x59b76c){_0x44e05f['rows']=_0x59b76c;return _0x44e05f;})[_0x16a1('0x28')](respondWithFilteredResult(_0x29efd1,_0x155522))[_0x16a1('0x44')](handleError(_0x29efd1,null));};exports[_0x16a1('0x45')]=function(_0x1d63e3,_0x11ab08){var _0x5da0ef={'raw':![],'where':{'id':_0x1d63e3[_0x16a1('0x46')]['id']}},_0x10f13a={};_0x10f13a[_0x16a1('0x30')]=_['keys'](db[_0x16a1('0x2f')][_0x16a1('0x47')]);_0x10f13a[_0x16a1('0x31')]=_[_0x16a1('0x32')](_0x1d63e3[_0x16a1('0x31')]);_0x10f13a['filters']=_['intersection'](_0x10f13a['model'],_0x10f13a['query']);_0x5da0ef[_0x16a1('0x34')]=_[_0x16a1('0x33')](_0x10f13a[_0x16a1('0x30')],qs[_0x16a1('0x35')](_0x1d63e3['query'][_0x16a1('0x35')]));_0x5da0ef[_0x16a1('0x34')]=_0x5da0ef[_0x16a1('0x34')][_0x16a1('0x36')]?_0x5da0ef[_0x16a1('0x34')]:_0x10f13a[_0x16a1('0x30')];if(_0x1d63e3[_0x16a1('0x31')][_0x16a1('0x41')]){_0x5da0ef[_0x16a1('0x42')]=[{'all':!![]}];}_0x5da0ef=_[_0x16a1('0x3d')]({},_0x5da0ef,_0x1d63e3[_0x16a1('0x40')]);return db[_0x16a1('0x2f')]['find'](_0x5da0ef)[_0x16a1('0x28')](handleEntityNotFound(_0x11ab08,null))[_0x16a1('0x28')](respondWithResult(_0x11ab08,null))[_0x16a1('0x44')](handleError(_0x11ab08,null));};exports['create']=function(_0x34fc11,_0x4a2d42){return db[_0x16a1('0x2f')][_0x16a1('0x48')](_0x34fc11[_0x16a1('0x49')],{})['then'](respondWithResult(_0x4a2d42,0xc9))[_0x16a1('0x44')](handleError(_0x4a2d42,null));};exports[_0x16a1('0x27')]=function(_0x420f60,_0x194c59){if(_0x420f60[_0x16a1('0x49')]['id']){delete _0x420f60[_0x16a1('0x49')]['id'];}return db['ServicenowAccount'][_0x16a1('0x4a')]({'where':{'id':_0x420f60['params']['id']}})[_0x16a1('0x28')](handleEntityNotFound(_0x194c59,null))[_0x16a1('0x28')](saveUpdates(_0x420f60['body'],null))[_0x16a1('0x28')](respondWithResult(_0x194c59,null))['catch'](handleError(_0x194c59,null));};exports[_0x16a1('0x29')]=function(_0x24710f,_0x302309){return db['ServicenowAccount'][_0x16a1('0x4a')]({'where':{'id':_0x24710f['params']['id']}})[_0x16a1('0x28')](handleEntityNotFound(_0x302309,null))['then'](removeEntity(_0x302309,null))[_0x16a1('0x44')](handleError(_0x302309,null));};exports['getConfigurations']=function(_0x562f17,_0x44c31f,_0x3ccca5){var _0x48a332={};var _0x12dbd4={};var _0x1dcb90;var _0x1e415d;return db[_0x16a1('0x2f')][_0x16a1('0x4b')]({'where':{'id':_0x562f17[_0x16a1('0x46')]['id']}})[_0x16a1('0x28')](handleEntityNotFound(_0x44c31f,null))[_0x16a1('0x28')](function(_0x432f37){if(_0x432f37){_0x1dcb90=_0x432f37;_0x12dbd4['model']=_[_0x16a1('0x32')](db[_0x16a1('0x4c')][_0x16a1('0x47')]);_0x12dbd4['query']=_[_0x16a1('0x32')](_0x562f17[_0x16a1('0x31')]);_0x12dbd4[_0x16a1('0x3b')]=_[_0x16a1('0x33')](_0x12dbd4['model'],_0x12dbd4['query']);_0x48a332[_0x16a1('0x34')]=_[_0x16a1('0x33')](_0x12dbd4[_0x16a1('0x30')],qs[_0x16a1('0x35')](_0x562f17[_0x16a1('0x31')][_0x16a1('0x35')]));_0x48a332[_0x16a1('0x34')]=_0x48a332[_0x16a1('0x34')][_0x16a1('0x36')]?_0x48a332[_0x16a1('0x34')]:_0x12dbd4[_0x16a1('0x30')];_0x48a332['order']=qs[_0x16a1('0x4d')](_0x562f17[_0x16a1('0x31')][_0x16a1('0x4d')]);_0x48a332['where']=qs['filters'](_[_0x16a1('0x4e')](_0x562f17[_0x16a1('0x31')],_0x12dbd4[_0x16a1('0x3b')]));if(_0x562f17[_0x16a1('0x31')][_0x16a1('0x3c')]){_0x48a332[_0x16a1('0x3a')]=_[_0x16a1('0x3d')](_0x48a332[_0x16a1('0x3a')],{'$or':_[_0x16a1('0x2e')](_0x48a332[_0x16a1('0x34')],function(_0x27d820){var _0xa7cc2b={};_0xa7cc2b[_0x27d820]={'$like':'%'+_0x562f17[_0x16a1('0x31')][_0x16a1('0x3c')]+'%'};return _0xa7cc2b;})});}_0x48a332=_[_0x16a1('0x3d')]({},_0x48a332,_0x562f17[_0x16a1('0x40')]);return _0x1dcb90[_0x16a1('0x4f')](_0x48a332);}})[_0x16a1('0x28')](function(_0x334219){if(_0x334219){_0x1e415d=_0x334219[_0x16a1('0x36')];if(!_0x562f17[_0x16a1('0x31')][_0x16a1('0x37')](_0x16a1('0x38'))){_0x48a332[_0x16a1('0x21')]=qs[_0x16a1('0x21')](_0x562f17[_0x16a1('0x31')]['limit']);_0x48a332['offset']=qs[_0x16a1('0x1f')](_0x562f17[_0x16a1('0x31')][_0x16a1('0x1f')]);}return _0x1dcb90['getConfigurations'](_0x48a332);}})[_0x16a1('0x28')](function(_0x351e20){if(_0x351e20){return _0x351e20?{'count':_0x1e415d,'rows':_0x351e20}:null;}})[_0x16a1('0x28')](respondWithResult(_0x44c31f,null))['catch'](handleError(_0x44c31f,null));};exports[_0x16a1('0x50')]=function(_0x11183d,_0x2f98a1,_0x4a0248){if(_0x11183d[_0x16a1('0x49')]['id']){delete _0x11183d[_0x16a1('0x49')]['id'];}return db[_0x16a1('0x2f')][_0x16a1('0x4b')]({'where':{'id':_0x11183d[_0x16a1('0x46')]['id']}})[_0x16a1('0x28')](handleEntityNotFound(_0x2f98a1,null))['then'](function(_0x43797b){if(_0x43797b){_0x11183d[_0x16a1('0x49')][_0x16a1('0x51')]=_0x43797b['id'];_0x11183d['body'][_0x16a1('0x52')]=integrations[_0x16a1('0x53')](_0x11183d[_0x16a1('0x49')][_0x16a1('0x54')],_0x11183d['body'][_0x16a1('0x3e')]);_0x11183d[_0x16a1('0x49')]['Descriptions']=integrations[_0x16a1('0x55')](_0x11183d['body']['channel'],_0x11183d[_0x16a1('0x49')]['type']);return db[_0x16a1('0x4c')]['create'](_0x11183d['body'],{'include':[{'model':db[_0x16a1('0x56')],'as':_0x16a1('0x52')},{'model':db[_0x16a1('0x56')],'as':_0x16a1('0x57')}]});}return null;})[_0x16a1('0x28')](respondWithResult(_0x2f98a1,null))[_0x16a1('0x44')](handleError(_0x2f98a1,null));};exports[_0x16a1('0x58')]=function(_0x114d76,_0x4906ab,_0x2a81dd){var _0x1e7df2=[_0x16a1('0x59'),_0x16a1('0x5a'),'knowledge',_0x16a1('0x5b'),_0x16a1('0x5c'),_0x16a1('0x5d'),_0x16a1('0x5e'),'severity',_0x16a1('0x5f')];var _0x59d62d=['parent',_0x16a1('0x59'),'caused_by','watch_list','upon_reject',_0x16a1('0x60'),_0x16a1('0x61'),_0x16a1('0x5a'),'approval_history',_0x16a1('0x62'),_0x16a1('0x63'),_0x16a1('0x64'),'opened_by',_0x16a1('0x65'),_0x16a1('0x66'),_0x16a1('0x67'),_0x16a1('0x68'),_0x16a1('0x69'),_0x16a1('0x6a'),_0x16a1('0x39'),_0x16a1('0x6b'),_0x16a1('0x6c'),_0x16a1('0x6d'),_0x16a1('0x6e'),_0x16a1('0x6f'),_0x16a1('0x70'),_0x16a1('0x71'),_0x16a1('0x72'),'priority',_0x16a1('0x73'),_0x16a1('0x74'),'time_worked',_0x16a1('0x75'),'opened_at',_0x16a1('0x76'),_0x16a1('0x77'),'work_end',_0x16a1('0x78'),'resolved_at',_0x16a1('0x79'),_0x16a1('0x7a'),_0x16a1('0x5b'),_0x16a1('0x7b'),_0x16a1('0x7c'),_0x16a1('0x5c'),_0x16a1('0x7d'),_0x16a1('0x7e'),_0x16a1('0x7f'),_0x16a1('0x80'),'business_stc',_0x16a1('0x81'),_0x16a1('0x82'),_0x16a1('0x83'),_0x16a1('0x5d'),_0x16a1('0x84'),_0x16a1('0x85'),'closed_by',_0x16a1('0x86'),'parent_incident',_0x16a1('0x87'),_0x16a1('0x88'),_0x16a1('0x89'),'incident_state',_0x16a1('0x8a'),_0x16a1('0x8b'),_0x16a1('0x8c'),_0x16a1('0x8d'),'activity_due','assigned_to',_0x16a1('0x8e'),_0x16a1('0x8f'),_0x16a1('0x90'),_0x16a1('0x91'),_0x16a1('0x92'),_0x16a1('0x93'),_0x16a1('0x94'),_0x16a1('0x95'),_0x16a1('0x96'),_0x16a1('0x97'),_0x16a1('0x98'),_0x16a1('0x99'),'location','category'];var _0x54cdfc='';var _0xe3b2aa='';var _0x139846=[];var _0x259c81='';var _0xec09da='';var _0x3ff06a=[];var _0x508468='';var _0x5636c0='';var _0x50ee02={};var _0x14e970='';return db[_0x16a1('0x2f')][_0x16a1('0x4b')]({'where':{'id':_0x114d76[_0x16a1('0x46')]['id']},'attributes':['id',_0x16a1('0x9a'),'password',_0x16a1('0x9b'),'remoteUri',_0x16a1('0x9c')]})[_0x16a1('0x28')](handleEntityNotFound(_0x4906ab,null))[_0x16a1('0x28')](function(_0xa8f8d2){if(_0xa8f8d2){_0x14e970=_0xa8f8d2['remoteUri'];var _0x164d7e=_0x14e970[_0x16a1('0x9d')](-0x1);if(_0x164d7e==='/'){_0x14e970=_0x14e970['substring'](0x0,_0x14e970['lastIndexOf'](_0x164d7e));}_0x5636c0=util[_0x16a1('0x9e')]('%s/api/now/doc/table/schema/',_0x14e970);_0x508468=util[_0x16a1('0x9e')](_0x16a1('0x9f'),_0x14e970);_0x50ee02={'user':_0xa8f8d2['username'],'pass':_0xa8f8d2[_0x16a1('0xa0')]};var _0x53230d={'method':_0x16a1('0xa1'),'uri':_0x5636c0+_0x16a1('0xa2'),'auth':_0x50ee02,'json':!![]};return rp(_0x53230d);}})[_0x16a1('0x28')](function(_0x1def6c){if(_0x1def6c['result'][_0x16a1('0x36')]>0x0){_0x54cdfc=_0x1def6c[_0x16a1('0xa3')];}console[_0x16a1('0xa4')]('incident\x20table\x20objects',_0x54cdfc);_0x3ff06a=[];_0xe3b2aa=Object['assign']([],_0x54cdfc);_[_0x16a1('0xa5')](_0xe3b2aa,function(_0x2b4bae){return!_0x1e7df2[_0x16a1('0xa6')](_0x2b4bae[_0x16a1('0x2c')]);});_0xe3b2aa[_0x16a1('0xa7')](function(_0x20cf23){var _0x2ffe38=createFieldObject(_0x508468,_0x50ee02,_0x20cf23['internalType'],_0x20cf23[_0x16a1('0x2c')],_0x20cf23[_0x16a1('0xa8')],![]);_0x3ff06a[_0x16a1('0xa9')](_0x2ffe38);});return Promise[_0x16a1('0xaa')](_0x3ff06a);})[_0x16a1('0x28')](function(_0x2aa386){_0x139846=_0x2aa386;_0x259c81=Object[_0x16a1('0xab')]([],_0x54cdfc);console[_0x16a1('0xa4')](_0x16a1('0xac'),_0x54cdfc);_['remove'](_0x259c81,function(_0x1fc060){return _0x59d62d[_0x16a1('0xa6')](_0x1fc060['name']);});console[_0x16a1('0xa4')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x259c81);_0x3ff06a=[];_0x259c81[_0x16a1('0xa7')](function(_0x505a3e){var _0x1d7098=createFieldObject(_0x508468,_0x50ee02,_0x505a3e[_0x16a1('0xad')],_0x505a3e[_0x16a1('0x2c')],_0x505a3e[_0x16a1('0xa8')],!![]);_0x3ff06a['push'](_0x1d7098);});return Promise[_0x16a1('0xaa')](_0x3ff06a);})[_0x16a1('0x28')](function(_0x354d0a){_0xec09da=_0x354d0a;var _0x3cbac2=_0x139846[_0x16a1('0xae')](_0xec09da);return{'count':_0x3cbac2['length'],'rows':_0x3cbac2};})[_0x16a1('0x28')](respondWithResult(_0x4906ab,null))['catch'](function(_0x1b359c){console[_0x16a1('0xa4')](_0x16a1('0xaf')+_0x1b359c);var _0xda93e2=_0x114d76[_0x16a1('0x31')][_0x16a1('0xb0')]?0x1f4:_0x1b359c[_0x16a1('0xb1')]||0x1f4;logger[_0x16a1('0xb2')](_0x1b359c[_0x16a1('0x2b')]);delete _0x1b359c[_0x16a1('0x2c')];if(_0xda93e2===0x191){_0xda93e2=0x190;}_0x4906ab['status'](_0xda93e2)[_0x16a1('0xb3')](_0x114d76[_0x16a1('0x31')][_0x16a1('0xb0')]?{'message':_0x16a1('0xb4'),'statusCode':_0x1b359c['statusCode']}:_0x1b359c);});};function createFieldObject(_0x130198,_0x2edb6c,_0x474731,_0x8251b,_0x4606ed,_0xb345bc){return new Promise(function(_0x1d019a,_0x5ce707){var _0x27063d={'id':_0x8251b,'name':_0x4606ed,'custom':_0xb345bc};if(_0x474731==='boolean'){_0x27063d[_0x16a1('0x40')]=[{'name':'True','value':_0x16a1('0xb5')},{'name':'False','value':_0x16a1('0xb6')}];_0x1d019a(_0x27063d);}else{var _0x3e6748={'method':_0x16a1('0xa1'),'uri':_0x130198+'sys_choice?sysparm_query=name=incident^element='+_0x8251b,'auth':_0x2edb6c,'json':!![]};return rp(_0x3e6748)[_0x16a1('0x28')](function(_0x27c82c){var _0x497614=[];if(_0x27c82c[_0x16a1('0xa3')][_0x16a1('0x36')]>0x0){_0x27c82c[_0x16a1('0xa3')]['forEach'](function(_0x3f322b){if(_0x3f322b[_0x16a1('0xb7')]==='false'){var _0x3dc2bb={'name':_0x3f322b[_0x16a1('0xa8')],'value':_0x3f322b[_0x16a1('0xb8')]};_0x497614[_0x16a1('0xa9')](_0x3dc2bb);}});}_0x27063d[_0x16a1('0x40')]=_0x497614;if(_0x27063d['options']['length']>0x0){_0x1d019a(_0x27063d);}else{if(_0xb345bc==![]){_0x1d019a();}else{_0x1d019a(_0x27063d);}}});}});}
\ No newline at end of file
+var _0x96ab=['serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','inactive','false','value','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','nolimit','addConfiguration','Subjects','type','getDescriptions','channel','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','rfc','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','reopened_by','urgency','problem_id','reassignment_count','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri'];(function(_0x5817a4,_0x3779d6){var _0x36ced8=function(_0x8f4b07){while(--_0x8f4b07){_0x5817a4['push'](_0x5817a4['shift']());}};_0x36ced8(++_0x3779d6);}(_0x96ab,0xda));var _0xb96a=function(_0x213f4d,_0x5d01b6){_0x213f4d=_0x213f4d-0x0;var _0x3e4dc3=_0x96ab[_0x213f4d];return _0x3e4dc3;};'use strict';var emlformat=require(_0xb96a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb96a('0x1'));var rp=require(_0xb96a('0x2'));var moment=require(_0xb96a('0x3'));var BPromise=require(_0xb96a('0x4'));var Mustache=require(_0xb96a('0x5'));var util=require(_0xb96a('0x6'));var path=require(_0xb96a('0x7'));var sox=require(_0xb96a('0x8'));var csv=require('to-csv');var ejs=require(_0xb96a('0x9'));var fs=require('fs');var fs_extra=require(_0xb96a('0xa'));var _=require(_0xb96a('0xb'));var squel=require('squel');var crypto=require(_0xb96a('0xc'));var jsforce=require(_0xb96a('0xd'));var deskjs=require(_0xb96a('0xe'));var toCsv=require(_0xb96a('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb96a('0x10'));var authService=require(_0xb96a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb96a('0x12'));var hardwareService=require(_0xb96a('0x13'));var logger=require(_0xb96a('0x14'))(_0xb96a('0x15'));var utils=require(_0xb96a('0x16'));var config=require(_0xb96a('0x17'));var licenseUtil=require(_0xb96a('0x18'));var db=require(_0xb96a('0x19'))['db'];var integrations=require(_0xb96a('0x1a'));function respondWithStatusCode(_0x1134e5,_0x3d436b){_0x3d436b=_0x3d436b||0xcc;return function(_0x56114b){if(_0x56114b){return _0x1134e5['sendStatus'](_0x3d436b);}return _0x1134e5[_0xb96a('0x1b')](_0x3d436b)[_0xb96a('0x1c')]();};}function respondWithResult(_0x2bbe9d,_0x26132a){_0x26132a=_0x26132a||0xc8;return function(_0x2ef616){if(_0x2ef616){return _0x2bbe9d['status'](_0x26132a)[_0xb96a('0x1d')](_0x2ef616);}};}function respondWithFilteredResult(_0x57b91f,_0x30b86d){return function(_0x2fe9df){if(_0x2fe9df){var _0x3f6f9a=typeof _0x30b86d[_0xb96a('0x1e')]==='undefined'&&typeof _0x30b86d[_0xb96a('0x1f')]===_0xb96a('0x20');var _0x5ca532=_0x2fe9df['count'];var _0x1d871a=_0x3f6f9a?0x0:_0x30b86d[_0xb96a('0x1e')];var _0x53901b=_0x3f6f9a?_0x2fe9df[_0xb96a('0x21')]:_0x30b86d['offset']+_0x30b86d[_0xb96a('0x1f')];var _0x443498;if(_0x53901b>=_0x5ca532){_0x53901b=_0x5ca532;_0x443498=0xc8;}else{_0x443498=0xce;}_0x57b91f['status'](_0x443498);return _0x57b91f['set']('Content-Range',_0x1d871a+'-'+_0x53901b+'/'+_0x5ca532)[_0xb96a('0x1d')](_0x2fe9df);}return null;};}function patchUpdates(_0x426cde){return function(_0x58ca34){try{jsonpatch['apply'](_0x58ca34,_0x426cde,!![]);}catch(_0x2b8a86){return BPromise['reject'](_0x2b8a86);}return _0x58ca34[_0xb96a('0x22')]();};}function saveUpdates(_0x30d924,_0x5cc91a){return function(_0x28c0ba){if(_0x28c0ba){return _0x28c0ba[_0xb96a('0x23')](_0x30d924)[_0xb96a('0x24')](function(_0x2d3668){return _0x2d3668;});}return null;};}function removeEntity(_0x5a3bb0,_0x194388){return function(_0x5ce007){if(_0x5ce007){return _0x5ce007['destroy']()[_0xb96a('0x24')](function(){_0x5a3bb0[_0xb96a('0x1b')](0xcc)[_0xb96a('0x1c')]();});}};}function handleEntityNotFound(_0x361176,_0xce170b){return function(_0x4e33e0){if(!_0x4e33e0){_0x361176['sendStatus'](0x194);}return _0x4e33e0;};}function handleError(_0x8c9498,_0x21d465){_0x21d465=_0x21d465||0x1f4;return function(_0x19f177){logger[_0xb96a('0x25')](_0x19f177[_0xb96a('0x26')]);if(_0x19f177[_0xb96a('0x27')]){delete _0x19f177[_0xb96a('0x27')];}_0x8c9498['status'](_0x21d465)[_0xb96a('0x28')](_0x19f177);};}exports[_0xb96a('0x29')]=function(_0x1c394e,_0x201e85){var _0x463bab={},_0x2d6984={},_0x5b4305={'count':0x0,'rows':[]};var _0x28c432=_[_0xb96a('0x2a')](db[_0xb96a('0x2b')][_0xb96a('0x2c')],function(_0x380d3b){return{'name':_0x380d3b[_0xb96a('0x2d')],'type':_0x380d3b['type'][_0xb96a('0x2e')]};});_0x2d6984[_0xb96a('0x2f')]=_['map'](_0x28c432,'name');_0x2d6984[_0xb96a('0x30')]=_[_0xb96a('0x31')](_0x1c394e['query']);_0x2d6984[_0xb96a('0x32')]=_[_0xb96a('0x33')](_0x2d6984['model'],_0x2d6984['query']);_0x463bab[_0xb96a('0x34')]=_['intersection'](_0x2d6984[_0xb96a('0x2f')],qs[_0xb96a('0x35')](_0x1c394e['query'][_0xb96a('0x35')]));_0x463bab[_0xb96a('0x34')]=_0x463bab[_0xb96a('0x34')][_0xb96a('0x36')]?_0x463bab[_0xb96a('0x34')]:_0x2d6984['model'];if(!_0x1c394e['query']['hasOwnProperty']('nolimit')){_0x463bab[_0xb96a('0x1f')]=qs[_0xb96a('0x1f')](_0x1c394e['query']['limit']);_0x463bab[_0xb96a('0x1e')]=qs[_0xb96a('0x1e')](_0x1c394e['query'][_0xb96a('0x1e')]);}_0x463bab[_0xb96a('0x37')]=qs[_0xb96a('0x38')](_0x1c394e[_0xb96a('0x30')][_0xb96a('0x38')]);_0x463bab[_0xb96a('0x39')]=qs[_0xb96a('0x32')](_[_0xb96a('0x3a')](_0x1c394e['query'],_0x2d6984[_0xb96a('0x32')]),_0x28c432);if(_0x1c394e[_0xb96a('0x30')][_0xb96a('0x3b')]){_0x463bab[_0xb96a('0x39')]=_['merge'](_0x463bab[_0xb96a('0x39')],{'$or':_['map'](_0x28c432,function(_0x3d83dc){if(_0x3d83dc['type']!=='VIRTUAL'){var _0x62548f={};_0x62548f[_0x3d83dc[_0xb96a('0x27')]]={'$like':'%'+_0x1c394e[_0xb96a('0x30')][_0xb96a('0x3b')]+'%'};return _0x62548f;}})});}_0x463bab=_[_0xb96a('0x3c')]({},_0x463bab,_0x1c394e[_0xb96a('0x3d')]);var _0x4b5c84={'where':_0x463bab['where']};return db['ServicenowAccount'][_0xb96a('0x21')](_0x4b5c84)['then'](function(_0x290af1){_0x5b4305['count']=_0x290af1;if(_0x1c394e['query'][_0xb96a('0x3e')]){_0x463bab[_0xb96a('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x463bab);})[_0xb96a('0x24')](function(_0x24df16){_0x5b4305['rows']=_0x24df16;return _0x5b4305;})[_0xb96a('0x24')](respondWithFilteredResult(_0x201e85,_0x463bab))[_0xb96a('0x40')](handleError(_0x201e85,null));};exports[_0xb96a('0x41')]=function(_0x33db6e,_0x4425fe){var _0x2591ef={'raw':![],'where':{'id':_0x33db6e[_0xb96a('0x42')]['id']}},_0x4291e8={};_0x4291e8['model']=_[_0xb96a('0x31')](db[_0xb96a('0x2b')]['rawAttributes']);_0x4291e8[_0xb96a('0x30')]=_[_0xb96a('0x31')](_0x33db6e[_0xb96a('0x30')]);_0x4291e8[_0xb96a('0x32')]=_[_0xb96a('0x33')](_0x4291e8['model'],_0x4291e8['query']);_0x2591ef[_0xb96a('0x34')]=_[_0xb96a('0x33')](_0x4291e8[_0xb96a('0x2f')],qs[_0xb96a('0x35')](_0x33db6e['query'][_0xb96a('0x35')]));_0x2591ef['attributes']=_0x2591ef[_0xb96a('0x34')]['length']?_0x2591ef[_0xb96a('0x34')]:_0x4291e8[_0xb96a('0x2f')];if(_0x33db6e[_0xb96a('0x30')][_0xb96a('0x3e')]){_0x2591ef[_0xb96a('0x3f')]=[{'all':!![]}];}_0x2591ef=_[_0xb96a('0x3c')]({},_0x2591ef,_0x33db6e[_0xb96a('0x3d')]);return db[_0xb96a('0x2b')][_0xb96a('0x43')](_0x2591ef)[_0xb96a('0x24')](handleEntityNotFound(_0x4425fe,null))[_0xb96a('0x24')](respondWithResult(_0x4425fe,null))[_0xb96a('0x40')](handleError(_0x4425fe,null));};exports[_0xb96a('0x44')]=function(_0x39a3f4,_0x46ae9b){return db['ServicenowAccount'][_0xb96a('0x44')](_0x39a3f4[_0xb96a('0x45')],{})[_0xb96a('0x24')](respondWithResult(_0x46ae9b,0xc9))[_0xb96a('0x40')](handleError(_0x46ae9b,null));};exports[_0xb96a('0x23')]=function(_0x142186,_0x1e91a8){if(_0x142186[_0xb96a('0x45')]['id']){delete _0x142186[_0xb96a('0x45')]['id'];}return db[_0xb96a('0x2b')][_0xb96a('0x43')]({'where':{'id':_0x142186[_0xb96a('0x42')]['id']}})[_0xb96a('0x24')](handleEntityNotFound(_0x1e91a8,null))[_0xb96a('0x24')](saveUpdates(_0x142186[_0xb96a('0x45')],null))[_0xb96a('0x24')](respondWithResult(_0x1e91a8,null))[_0xb96a('0x40')](handleError(_0x1e91a8,null));};exports[_0xb96a('0x46')]=function(_0x43232d,_0xbae182){return db[_0xb96a('0x2b')]['find']({'where':{'id':_0x43232d[_0xb96a('0x42')]['id']}})['then'](handleEntityNotFound(_0xbae182,null))['then'](removeEntity(_0xbae182,null))[_0xb96a('0x40')](handleError(_0xbae182,null));};exports[_0xb96a('0x47')]=function(_0x3a0aec,_0x1fabd0,_0x336878){var _0x5036be={};var _0x4cef44={};var _0x50163e;var _0x10f0f0;return db[_0xb96a('0x2b')][_0xb96a('0x48')]({'where':{'id':_0x3a0aec['params']['id']}})[_0xb96a('0x24')](handleEntityNotFound(_0x1fabd0,null))[_0xb96a('0x24')](function(_0x109a58){if(_0x109a58){_0x50163e=_0x109a58;_0x4cef44['model']=_['keys'](db[_0xb96a('0x49')][_0xb96a('0x2c')]);_0x4cef44[_0xb96a('0x30')]=_[_0xb96a('0x31')](_0x3a0aec['query']);_0x4cef44[_0xb96a('0x32')]=_[_0xb96a('0x33')](_0x4cef44['model'],_0x4cef44['query']);_0x5036be['attributes']=_[_0xb96a('0x33')](_0x4cef44[_0xb96a('0x2f')],qs[_0xb96a('0x35')](_0x3a0aec['query'][_0xb96a('0x35')]));_0x5036be[_0xb96a('0x34')]=_0x5036be['attributes'][_0xb96a('0x36')]?_0x5036be['attributes']:_0x4cef44[_0xb96a('0x2f')];_0x5036be[_0xb96a('0x37')]=qs['sort'](_0x3a0aec['query']['sort']);_0x5036be[_0xb96a('0x39')]=qs['filters'](_[_0xb96a('0x3a')](_0x3a0aec['query'],_0x4cef44[_0xb96a('0x32')]));if(_0x3a0aec['query']['filter']){_0x5036be['where']=_[_0xb96a('0x3c')](_0x5036be[_0xb96a('0x39')],{'$or':_[_0xb96a('0x2a')](_0x5036be[_0xb96a('0x34')],function(_0x1c6f85){var _0x4adcfc={};_0x4adcfc[_0x1c6f85]={'$like':'%'+_0x3a0aec[_0xb96a('0x30')][_0xb96a('0x3b')]+'%'};return _0x4adcfc;})});}_0x5036be=_[_0xb96a('0x3c')]({},_0x5036be,_0x3a0aec[_0xb96a('0x3d')]);return _0x50163e['getConfigurations'](_0x5036be);}})[_0xb96a('0x24')](function(_0x1a834a){if(_0x1a834a){_0x10f0f0=_0x1a834a[_0xb96a('0x36')];if(!_0x3a0aec['query'][_0xb96a('0x4a')](_0xb96a('0x4b'))){_0x5036be[_0xb96a('0x1f')]=qs[_0xb96a('0x1f')](_0x3a0aec[_0xb96a('0x30')][_0xb96a('0x1f')]);_0x5036be[_0xb96a('0x1e')]=qs['offset'](_0x3a0aec['query'][_0xb96a('0x1e')]);}return _0x50163e['getConfigurations'](_0x5036be);}})['then'](function(_0xa46fc8){if(_0xa46fc8){return _0xa46fc8?{'count':_0x10f0f0,'rows':_0xa46fc8}:null;}})[_0xb96a('0x24')](respondWithResult(_0x1fabd0,null))[_0xb96a('0x40')](handleError(_0x1fabd0,null));};exports[_0xb96a('0x4c')]=function(_0x35fa14,_0xe3b6bd,_0x3e4f62){if(_0x35fa14[_0xb96a('0x45')]['id']){delete _0x35fa14['body']['id'];}return db['ServicenowAccount'][_0xb96a('0x48')]({'where':{'id':_0x35fa14[_0xb96a('0x42')]['id']}})[_0xb96a('0x24')](handleEntityNotFound(_0xe3b6bd,null))['then'](function(_0xee15c0){if(_0xee15c0){_0x35fa14['body']['AccountId']=_0xee15c0['id'];_0x35fa14['body'][_0xb96a('0x4d')]=integrations['getSubjects'](_0x35fa14[_0xb96a('0x45')]['channel'],_0x35fa14[_0xb96a('0x45')][_0xb96a('0x4e')]);_0x35fa14[_0xb96a('0x45')]['Descriptions']=integrations[_0xb96a('0x4f')](_0x35fa14[_0xb96a('0x45')][_0xb96a('0x50')],_0x35fa14[_0xb96a('0x45')][_0xb96a('0x4e')]);return db['ServicenowConfiguration'][_0xb96a('0x44')](_0x35fa14[_0xb96a('0x45')],{'include':[{'model':db['ServicenowField'],'as':_0xb96a('0x4d')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0xb96a('0x24')](respondWithResult(_0xe3b6bd,null))[_0xb96a('0x40')](handleError(_0xe3b6bd,null));};exports[_0xb96a('0x51')]=function(_0x4813fe,_0xa02830,_0x5219c3){var _0x5ed0a9=[_0xb96a('0x52'),_0xb96a('0x53'),_0xb96a('0x54'),_0xb96a('0x55'),_0xb96a('0x56'),_0xb96a('0x57'),_0xb96a('0x58'),_0xb96a('0x59'),_0xb96a('0x5a')];var _0x391cbe=[_0xb96a('0x5b'),'made_sla',_0xb96a('0x5c'),_0xb96a('0x5d'),_0xb96a('0x5e'),'sys_updated_on',_0xb96a('0x5f'),_0xb96a('0x53'),_0xb96a('0x60'),_0xb96a('0x61'),_0xb96a('0x62'),_0xb96a('0x63'),_0xb96a('0x64'),'user_input',_0xb96a('0x65'),_0xb96a('0x66'),_0xb96a('0x67'),_0xb96a('0x68'),'knowledge',_0xb96a('0x37'),_0xb96a('0x69'),_0xb96a('0x6a'),_0xb96a('0x6b'),'delivery_plan',_0xb96a('0x6c'),_0xb96a('0x6d'),_0xb96a('0x6e'),_0xb96a('0x6f'),_0xb96a('0x70'),'sys_domain_path',_0xb96a('0x71'),'time_worked',_0xb96a('0x72'),'opened_at',_0xb96a('0x73'),_0xb96a('0x74'),_0xb96a('0x75'),_0xb96a('0x76'),_0xb96a('0x77'),_0xb96a('0x78'),_0xb96a('0x79'),_0xb96a('0x55'),'work_notes',_0xb96a('0x7a'),_0xb96a('0x56'),_0xb96a('0x7b'),_0xb96a('0x7c'),_0xb96a('0x7d'),_0xb96a('0x7e'),_0xb96a('0x7f'),'additional_assignee_list',_0xb96a('0x80'),_0xb96a('0x81'),_0xb96a('0x57'),_0xb96a('0x82'),_0xb96a('0x83'),_0xb96a('0x84'),_0xb96a('0x85'),'parent_incident',_0xb96a('0x86'),'contact_type',_0xb96a('0x87'),_0xb96a('0x58'),_0xb96a('0x88'),_0xb96a('0x89'),'company',_0xb96a('0x8a'),'activity_due','assigned_to',_0xb96a('0x59'),_0xb96a('0x8b'),_0xb96a('0x8c'),_0xb96a('0x8d'),_0xb96a('0x8e'),_0xb96a('0x8f'),'sys_mod_count',_0xb96a('0x90'),_0xb96a('0x91'),_0xb96a('0x92'),_0xb96a('0x93'),_0xb96a('0x94'),_0xb96a('0x95'),_0xb96a('0x5a')];var _0x27273e='';var _0x1e2f38='';var _0x29d589=[];var _0x3143bc='';var _0x1fea43='';var _0x5a9fc8=[];var _0x197412='';var _0x25b4f6='';var _0x288023={};var _0x3d3654='';return db[_0xb96a('0x2b')]['findOne']({'where':{'id':_0x4813fe['params']['id']},'attributes':['id',_0xb96a('0x96'),_0xb96a('0x97'),_0xb96a('0x98'),_0xb96a('0x99'),_0xb96a('0x9a')]})['then'](handleEntityNotFound(_0xa02830,null))['then'](function(_0x3e5fae){if(_0x3e5fae){_0x3d3654=_0x3e5fae[_0xb96a('0x99')];var _0x3a19cf=_0x3d3654['slice'](-0x1);if(_0x3a19cf==='/'){_0x3d3654=_0x3d3654[_0xb96a('0x9b')](0x0,_0x3d3654[_0xb96a('0x9c')](_0x3a19cf));}_0x25b4f6=util[_0xb96a('0x9d')](_0xb96a('0x9e'),_0x3d3654);_0x197412=util['format']('%s/api/now/table/',_0x3d3654);_0x288023={'user':_0x3e5fae['username'],'pass':_0x3e5fae[_0xb96a('0x97')]};var _0x23c4b9={'method':_0xb96a('0x9f'),'uri':_0x25b4f6+_0xb96a('0xa0'),'auth':_0x288023,'json':!![]};return rp(_0x23c4b9);}})[_0xb96a('0x24')](function(_0x34145b){if(_0x34145b[_0xb96a('0xa1')]['length']>0x0){_0x27273e=_0x34145b[_0xb96a('0xa1')];}console[_0xb96a('0xa2')](_0xb96a('0xa3'),_0x27273e);_0x5a9fc8=[];_0x1e2f38=Object[_0xb96a('0xa4')]([],_0x27273e);_[_0xb96a('0xa5')](_0x1e2f38,function(_0x2035ac){return!_0x5ed0a9['includes'](_0x2035ac[_0xb96a('0x27')]);});_0x1e2f38[_0xb96a('0xa6')](function(_0x46e2d1){var _0x12576e=createFieldObject(_0x197412,_0x288023,_0x46e2d1[_0xb96a('0xa7')],_0x46e2d1[_0xb96a('0x27')],_0x46e2d1[_0xb96a('0xa8')],![]);_0x5a9fc8[_0xb96a('0xa9')](_0x12576e);});return Promise[_0xb96a('0xaa')](_0x5a9fc8);})[_0xb96a('0x24')](function(_0x1f0a5c){_0x29d589=_0x1f0a5c;_0x3143bc=Object['assign']([],_0x27273e);console[_0xb96a('0xa2')](_0xb96a('0xab'),_0x27273e);_[_0xb96a('0xa5')](_0x3143bc,function(_0x3f3df5){return _0x391cbe[_0xb96a('0xac')](_0x3f3df5['name']);});console[_0xb96a('0xa2')](_0xb96a('0xad'),_0x3143bc);_0x5a9fc8=[];_0x3143bc[_0xb96a('0xa6')](function(_0x2eb6d7){var _0x18a3fb=createFieldObject(_0x197412,_0x288023,_0x2eb6d7[_0xb96a('0xa7')],_0x2eb6d7[_0xb96a('0x27')],_0x2eb6d7[_0xb96a('0xa8')],!![]);_0x5a9fc8['push'](_0x18a3fb);});return Promise['all'](_0x5a9fc8);})[_0xb96a('0x24')](function(_0x3480ab){_0x1fea43=_0x3480ab;var _0xa3aefa=_0x29d589[_0xb96a('0xae')](_0x1fea43);return{'count':_0xa3aefa[_0xb96a('0x36')],'rows':_0xa3aefa};})['then'](respondWithResult(_0xa02830,null))[_0xb96a('0x40')](function(_0x1e0623){console[_0xb96a('0xa2')](_0xb96a('0xaf')+_0x1e0623);var _0x27039f=_0x4813fe['query'][_0xb96a('0xb0')]?0x1f4:_0x1e0623[_0xb96a('0xb1')]||0x1f4;logger['error'](_0x1e0623[_0xb96a('0x26')]);delete _0x1e0623['name'];if(_0x27039f===0x191){_0x27039f=0x190;}_0xa02830[_0xb96a('0x1b')](_0x27039f)[_0xb96a('0x28')](_0x4813fe[_0xb96a('0x30')][_0xb96a('0xb0')]?{'message':_0xb96a('0xb2'),'statusCode':_0x1e0623[_0xb96a('0xb1')]}:_0x1e0623);});};function createFieldObject(_0x15492c,_0x547b28,_0x23ee52,_0x3d8413,_0x10abdb,_0x113900){return new Promise(function(_0x34a03a,_0x4caf86){var _0x2c3c0c={'id':_0x3d8413,'name':_0x10abdb,'custom':_0x113900};if(_0x23ee52===_0xb96a('0xb3')){_0x2c3c0c[_0xb96a('0x3d')]=[{'name':_0xb96a('0xb4'),'value':_0xb96a('0xb5')},{'name':_0xb96a('0xb6'),'value':'false'}];_0x34a03a(_0x2c3c0c);}else{var _0x58360a={'method':_0xb96a('0x9f'),'uri':_0x15492c+'sys_choice?sysparm_query=name=incident^element='+_0x3d8413,'auth':_0x547b28,'json':!![]};return rp(_0x58360a)['then'](function(_0x160bcb){var _0x2af69f=[];if(_0x160bcb[_0xb96a('0xa1')][_0xb96a('0x36')]>0x0){_0x160bcb[_0xb96a('0xa1')][_0xb96a('0xa6')](function(_0x10be26){if(_0x10be26[_0xb96a('0xb7')]===_0xb96a('0xb8')){var _0x5b4131={'name':_0x10be26[_0xb96a('0xa8')],'value':_0x10be26[_0xb96a('0xb9')]};_0x2af69f['push'](_0x5b4131);}});}_0x2c3c0c[_0xb96a('0x3d')]=_0x2af69f;if(_0x2c3c0c[_0xb96a('0x3d')][_0xb96a('0x36')]>0x0){_0x34a03a(_0x2c3c0c);}else{if(_0x113900==![]){_0x34a03a();}else{_0x34a03a(_0x2c3c0c);}}});}});}
\ No newline at end of file
index 015254b..bade0a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','moment'];(function(_0x36638c,_0x4424b3){var _0x17f545=function(_0x1f26e5){while(--_0x1f26e5){_0x36638c['push'](_0x36638c['shift']());}};_0x17f545(++_0x4424b3);}(_0xe14b,0x93));var _0xbe14=function(_0x5e6310,_0x136d16){_0x5e6310=_0x5e6310-0x0;var _0x4900f9=_0xe14b[_0x5e6310];return _0x4900f9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));var integrations=require(_0xbe14('0x6'));module[_0xbe14('0x7')]=function(_0x1ff100,_0x1d9ade){return _0x1ff100[_0xbe14('0x8')](_0xbe14('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts'];(function(_0x20e196,_0x1b91a8){var _0x2f4a6e=function(_0x58b13d){while(--_0x58b13d){_0x20e196['push'](_0x20e196['shift']());}};_0x2f4a6e(++_0x1b91a8);}(_0x1261,0x144));var _0x1126=function(_0x393c55,_0x43b06c){_0x393c55=_0x393c55-0x0;var _0x4085fc=_0x1261[_0x393c55];return _0x4085fc;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4f4044..05eab45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b55=['request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','include','map','model','ShowServicenowAccount','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x259505,_0x5162d3){var _0x28622f=function(_0x2e5565){while(--_0x2e5565){_0x259505['push'](_0x259505['shift']());}};_0x28622f(++_0x5162d3);}(_0x6b55,0xeb));var _0x56b5=function(_0x3c0e19,_0x4c1f87){_0x3c0e19=_0x3c0e19-0x0;var _0x336227=_0x6b55[_0x3c0e19];return _0x336227;};'use strict';var _=require(_0x56b5('0x0'));var util=require(_0x56b5('0x1'));var moment=require(_0x56b5('0x2'));var BPromise=require('bluebird');var rs=require(_0x56b5('0x3'));var fs=require('fs');var Redis=require(_0x56b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56b5('0x5'));var config=require(_0x56b5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x56b5('0x7')][_0x56b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54d9a9,_0x428b77,_0x23dde9){return new BPromise(function(_0xe76687,_0x484a9b){return client[_0x56b5('0x9')](_0x54d9a9,_0x23dde9)[_0x56b5('0xa')](function(_0x5ae93a){logger[_0x56b5('0xb')](_0x56b5('0xc'),_0x428b77,_0x56b5('0xd'));logger[_0x56b5('0xe')](_0x56b5('0xf'),_0x428b77,_0x56b5('0xd'),JSON[_0x56b5('0x10')](_0x5ae93a));if(_0x5ae93a[_0x56b5('0x11')]){if(_0x5ae93a['error']['code']===0x1f4){logger[_0x56b5('0x11')](_0x56b5('0xc'),_0x428b77,_0x5ae93a[_0x56b5('0x11')][_0x56b5('0x12')]);return _0x484a9b(_0x5ae93a[_0x56b5('0x11')][_0x56b5('0x12')]);}logger[_0x56b5('0x11')](_0x56b5('0xc'),_0x428b77,_0x5ae93a[_0x56b5('0x11')][_0x56b5('0x12')]);return _0xe76687(_0x5ae93a[_0x56b5('0x11')]['message']);}else{logger[_0x56b5('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x428b77,'request\x20sent');_0xe76687(_0x5ae93a[_0x56b5('0x13')][_0x56b5('0x12')]);}})[_0x56b5('0x14')](function(_0x53e764){logger[_0x56b5('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x428b77,_0x53e764);_0x484a9b(_0x53e764);});});}exports[_0x56b5('0x15')]=function(_0x427e5f){var _0x4a0e76=this;return new Promise(function(_0x1b01a8,_0x9cfccb){return db[_0x56b5('0x16')]['findAll']({'raw':_0x427e5f[_0x56b5('0x17')]?_0x427e5f['options'][_0x56b5('0x18')]===undefined?!![]:![]:!![],'where':_0x427e5f[_0x56b5('0x17')]?_0x427e5f[_0x56b5('0x17')][_0x56b5('0x19')]||null:null,'attributes':_0x427e5f[_0x56b5('0x17')]?_0x427e5f['options'][_0x56b5('0x1a')]||null:null,'limit':_0x427e5f['options']?_0x427e5f[_0x56b5('0x17')]['limit']||null:null,'include':_0x427e5f['options']?_0x427e5f[_0x56b5('0x17')][_0x56b5('0x1b')]?_[_0x56b5('0x1c')](_0x427e5f['options']['include'],function(_0x13827c){return{'model':db[_0x13827c[_0x56b5('0x1d')]],'as':_0x13827c['as'],'attributes':_0x13827c[_0x56b5('0x1a')],'include':_0x13827c['include']?_[_0x56b5('0x1c')](_0x13827c[_0x56b5('0x1b')],function(_0x5cd509){return{'model':db[_0x5cd509[_0x56b5('0x1d')]],'as':_0x5cd509['as'],'attributes':_0x5cd509[_0x56b5('0x1a')],'include':_0x5cd509[_0x56b5('0x1b')]?_['map'](_0x5cd509[_0x56b5('0x1b')],function(_0x290128){return{'model':db[_0x290128[_0x56b5('0x1d')]],'as':_0x290128['as'],'attributes':_0x290128['attributes']};}):[]};}):[]};}):[]:[]})[_0x56b5('0xa')](function(_0x44e0dd){logger[_0x56b5('0xb')](_0x56b5('0x15'),_0x427e5f);logger[_0x56b5('0xe')]('GetServicenowAccount',_0x427e5f,JSON[_0x56b5('0x10')](_0x44e0dd));_0x1b01a8(_0x44e0dd);})[_0x56b5('0x14')](function(_0x2558cd){logger[_0x56b5('0x11')](_0x56b5('0x15'),_0x2558cd['message'],_0x427e5f);_0x9cfccb(_0x4a0e76[_0x56b5('0x11')](0x1f4,_0x2558cd[_0x56b5('0x12')]));});});};exports[_0x56b5('0x1e')]=function(_0x2d4dcd){var _0x5543bf=this;return new Promise(function(_0x4125cb,_0x98eb25){return db[_0x56b5('0x16')]['find']({'raw':_0x2d4dcd['options']?_0x2d4dcd[_0x56b5('0x17')][_0x56b5('0x18')]===undefined?!![]:![]:!![],'where':_0x2d4dcd[_0x56b5('0x17')]?_0x2d4dcd[_0x56b5('0x17')][_0x56b5('0x19')]||null:null,'attributes':_0x2d4dcd[_0x56b5('0x17')]?_0x2d4dcd[_0x56b5('0x17')]['attributes']||null:null,'include':_0x2d4dcd[_0x56b5('0x17')]?_0x2d4dcd[_0x56b5('0x17')][_0x56b5('0x1b')]?_[_0x56b5('0x1c')](_0x2d4dcd[_0x56b5('0x17')][_0x56b5('0x1b')],function(_0x2dab1b){return{'model':db[_0x2dab1b[_0x56b5('0x1d')]],'as':_0x2dab1b['as'],'attributes':_0x2dab1b[_0x56b5('0x1a')],'include':_0x2dab1b[_0x56b5('0x1b')]?_['map'](_0x2dab1b['include'],function(_0x544c8b){return{'model':db[_0x544c8b[_0x56b5('0x1d')]],'as':_0x544c8b['as'],'attributes':_0x544c8b[_0x56b5('0x1a')],'include':_0x544c8b[_0x56b5('0x1b')]?_['map'](_0x544c8b[_0x56b5('0x1b')],function(_0x42cd27){return{'model':db[_0x42cd27['model']],'as':_0x42cd27['as'],'attributes':_0x42cd27[_0x56b5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x56b5('0xa')](function(_0x2be1b4){logger[_0x56b5('0xb')](_0x56b5('0x1e'),_0x2d4dcd);logger[_0x56b5('0xe')](_0x56b5('0x1e'),_0x2d4dcd,JSON[_0x56b5('0x10')](_0x2be1b4));_0x4125cb(_0x2be1b4);})[_0x56b5('0x14')](function(_0x317195){logger[_0x56b5('0x11')](_0x56b5('0x1e'),_0x317195[_0x56b5('0x12')],_0x2d4dcd);_0x98eb25(_0x5543bf['error'](0x1f4,_0x317195[_0x56b5('0x12')]));});});};
\ No newline at end of file
+var _0x538c=['attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options','raw','where'];(function(_0x5f0e23,_0x4a97ce){var _0x2342fd=function(_0x20116c){while(--_0x20116c){_0x5f0e23['push'](_0x5f0e23['shift']());}};_0x2342fd(++_0x4a97ce);}(_0x538c,0xf6));var _0xc538=function(_0x49eb7b,_0x32faa4){_0x49eb7b=_0x49eb7b-0x0;var _0x26bea9=_0x538c[_0x49eb7b];return _0x26bea9;};'use strict';var _=require(_0xc538('0x0'));var util=require('util');var moment=require(_0xc538('0x1'));var BPromise=require(_0xc538('0x2'));var rs=require(_0xc538('0x3'));var fs=require('fs');var Redis=require(_0xc538('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc538('0x5'));var logger=require('../../config/logger')(_0xc538('0x6'));var config=require(_0xc538('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc538('0x8')][_0xc538('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dc1da,_0xd56746,_0x3de38d){return new BPromise(function(_0x527e97,_0x223da5){return client['request'](_0x3dc1da,_0x3de38d)[_0xc538('0xa')](function(_0x47885c){logger[_0xc538('0xb')](_0xc538('0xc'),_0xd56746,'request\x20sent');logger[_0xc538('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xd56746,_0xc538('0xe'),JSON[_0xc538('0xf')](_0x47885c));if(_0x47885c[_0xc538('0x10')]){if(_0x47885c[_0xc538('0x10')][_0xc538('0x11')]===0x1f4){logger[_0xc538('0x10')](_0xc538('0xc'),_0xd56746,_0x47885c[_0xc538('0x10')][_0xc538('0x12')]);return _0x223da5(_0x47885c[_0xc538('0x10')][_0xc538('0x12')]);}logger[_0xc538('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xd56746,_0x47885c[_0xc538('0x10')][_0xc538('0x12')]);return _0x527e97(_0x47885c[_0xc538('0x10')]['message']);}else{logger['info'](_0xc538('0xc'),_0xd56746,_0xc538('0xe'));_0x527e97(_0x47885c[_0xc538('0x13')][_0xc538('0x12')]);}})[_0xc538('0x14')](function(_0x48f42c){logger[_0xc538('0x10')](_0xc538('0xc'),_0xd56746,_0x48f42c);_0x223da5(_0x48f42c);});});}exports['GetServicenowAccount']=function(_0xa2059c){var _0x59337a=this;return new Promise(function(_0x525700,_0x4b7df2){return db[_0xc538('0x15')][_0xc538('0x16')]({'raw':_0xa2059c['options']?_0xa2059c[_0xc538('0x17')][_0xc538('0x18')]===undefined?!![]:![]:!![],'where':_0xa2059c['options']?_0xa2059c[_0xc538('0x17')][_0xc538('0x19')]||null:null,'attributes':_0xa2059c[_0xc538('0x17')]?_0xa2059c[_0xc538('0x17')][_0xc538('0x1a')]||null:null,'limit':_0xa2059c['options']?_0xa2059c[_0xc538('0x17')][_0xc538('0x1b')]||null:null,'include':_0xa2059c[_0xc538('0x17')]?_0xa2059c[_0xc538('0x17')][_0xc538('0x1c')]?_[_0xc538('0x1d')](_0xa2059c[_0xc538('0x17')][_0xc538('0x1c')],function(_0x4e0fcc){return{'model':db[_0x4e0fcc[_0xc538('0x1e')]],'as':_0x4e0fcc['as'],'attributes':_0x4e0fcc[_0xc538('0x1a')],'include':_0x4e0fcc[_0xc538('0x1c')]?_[_0xc538('0x1d')](_0x4e0fcc[_0xc538('0x1c')],function(_0x37448b){return{'model':db[_0x37448b[_0xc538('0x1e')]],'as':_0x37448b['as'],'attributes':_0x37448b[_0xc538('0x1a')],'include':_0x37448b[_0xc538('0x1c')]?_[_0xc538('0x1d')](_0x37448b['include'],function(_0x4cd55b){return{'model':db[_0x4cd55b[_0xc538('0x1e')]],'as':_0x4cd55b['as'],'attributes':_0x4cd55b[_0xc538('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc538('0xa')](function(_0x1eaec6){logger[_0xc538('0xb')](_0xc538('0x1f'),_0xa2059c);logger[_0xc538('0xd')](_0xc538('0x1f'),_0xa2059c,JSON[_0xc538('0xf')](_0x1eaec6));_0x525700(_0x1eaec6);})['catch'](function(_0x1810b7){logger[_0xc538('0x10')](_0xc538('0x1f'),_0x1810b7['message'],_0xa2059c);_0x4b7df2(_0x59337a['error'](0x1f4,_0x1810b7[_0xc538('0x12')]));});});};exports[_0xc538('0x20')]=function(_0xebad99){var _0x466fb3=this;return new Promise(function(_0x1227fe,_0x3aec35){return db[_0xc538('0x15')][_0xc538('0x21')]({'raw':_0xebad99[_0xc538('0x17')]?_0xebad99[_0xc538('0x17')][_0xc538('0x18')]===undefined?!![]:![]:!![],'where':_0xebad99[_0xc538('0x17')]?_0xebad99[_0xc538('0x17')][_0xc538('0x19')]||null:null,'attributes':_0xebad99[_0xc538('0x17')]?_0xebad99['options'][_0xc538('0x1a')]||null:null,'include':_0xebad99['options']?_0xebad99[_0xc538('0x17')][_0xc538('0x1c')]?_[_0xc538('0x1d')](_0xebad99[_0xc538('0x17')][_0xc538('0x1c')],function(_0x1e97d5){return{'model':db[_0x1e97d5[_0xc538('0x1e')]],'as':_0x1e97d5['as'],'attributes':_0x1e97d5['attributes'],'include':_0x1e97d5[_0xc538('0x1c')]?_[_0xc538('0x1d')](_0x1e97d5[_0xc538('0x1c')],function(_0x476de9){return{'model':db[_0x476de9[_0xc538('0x1e')]],'as':_0x476de9['as'],'attributes':_0x476de9[_0xc538('0x1a')],'include':_0x476de9[_0xc538('0x1c')]?_[_0xc538('0x1d')](_0x476de9[_0xc538('0x1c')],function(_0xdfaf7f){return{'model':db[_0xdfaf7f[_0xc538('0x1e')]],'as':_0xdfaf7f['as'],'attributes':_0xdfaf7f[_0xc538('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc538('0xa')](function(_0x1b7036){logger[_0xc538('0xb')](_0xc538('0x20'),_0xebad99);logger[_0xc538('0xd')](_0xc538('0x20'),_0xebad99,JSON['stringify'](_0x1b7036));_0x1227fe(_0x1b7036);})[_0xc538('0x14')](function(_0x1c47d8){logger[_0xc538('0x10')](_0xc538('0x20'),_0x1c47d8[_0xc538('0x12')],_0xebad99);_0x3aec35(_0x466fb3[_0xc538('0x10')](0x1f4,_0x1c47d8[_0xc538('0x12')]));});});};
\ No newline at end of file
index 0d2145e..15e4119 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0477=['util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','/:id','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer'];(function(_0x6d7c87,_0x44edf4){var _0x593c1c=function(_0x308a46){while(--_0x308a46){_0x6d7c87['push'](_0x6d7c87['shift']());}};_0x593c1c(++_0x44edf4);}(_0x0477,0x72));var _0x7047=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0x0477[_0x3522c8];return _0x22f498;};'use strict';var multer=require(_0x7047('0x0'));var util=require(_0x7047('0x1'));var path=require(_0x7047('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7047('0x3'));var auth=require(_0x7047('0x4'));var interaction=require(_0x7047('0x5'));var config=require('../../config/environment');var controller=require(_0x7047('0x6'));router['get']('/',auth[_0x7047('0x7')](),controller[_0x7047('0x8')]);router['get'](_0x7047('0x9'),auth[_0x7047('0x7')](),controller['show']);router[_0x7047('0xa')](_0x7047('0xb'),auth[_0x7047('0x7')](),controller[_0x7047('0xc')]);router[_0x7047('0xa')](_0x7047('0xd'),auth[_0x7047('0x7')](),controller[_0x7047('0xe')]);router['get'](_0x7047('0xf'),auth[_0x7047('0x7')](),controller[_0x7047('0x10')]);router[_0x7047('0x11')]('/',auth[_0x7047('0x7')](),controller['create']);router[_0x7047('0x12')](_0x7047('0x9'),auth[_0x7047('0x7')](),controller[_0x7047('0x13')]);router[_0x7047('0x14')](_0x7047('0x9'),auth['isAuthenticated'](),controller[_0x7047('0x15')]);module[_0x7047('0x16')]=router;
\ No newline at end of file
+var _0xee46=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee46,0xfc));var _0x6ee4=function(_0x555283,_0x3a228b){_0x555283=_0x555283-0x0;var _0x5df1f9=_0xee46[_0x555283];return _0x5df1f9;};'use strict';var multer=require('multer');var util=require(_0x6ee4('0x0'));var path=require(_0x6ee4('0x1'));var timeout=require(_0x6ee4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ee4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6ee4('0x4'));var config=require(_0x6ee4('0x5'));var controller=require(_0x6ee4('0x6'));router[_0x6ee4('0x7')]('/',auth[_0x6ee4('0x8')](),controller['index']);router[_0x6ee4('0x7')]('/:id',auth[_0x6ee4('0x8')](),controller[_0x6ee4('0x9')]);router[_0x6ee4('0x7')](_0x6ee4('0xa'),auth[_0x6ee4('0x8')](),controller['getFields']);router[_0x6ee4('0x7')](_0x6ee4('0xb'),auth[_0x6ee4('0x8')](),controller[_0x6ee4('0xc')]);router['get'](_0x6ee4('0xd'),auth[_0x6ee4('0x8')](),controller['getDescriptions']);router[_0x6ee4('0xe')]('/',auth[_0x6ee4('0x8')](),controller[_0x6ee4('0xf')]);router[_0x6ee4('0x10')](_0x6ee4('0x11'),auth[_0x6ee4('0x8')](),controller['update']);router[_0x6ee4('0x12')](_0x6ee4('0x11'),auth[_0x6ee4('0x8')](),controller[_0x6ee4('0x13')]);module[_0x6ee4('0x14')]=router;
\ No newline at end of file
index e6b330f..94841af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x339f=['sequelize','STRING'];(function(_0x5736b1,_0x663d38){var _0x1767d1=function(_0x4790bc){while(--_0x4790bc){_0x5736b1['push'](_0x5736b1['shift']());}};_0x1767d1(++_0x663d38);}(_0x339f,0x1ee));var _0xf339=function(_0x372a0e,_0x578f0c){_0x372a0e=_0x372a0e-0x0;var _0x22443e=_0x339f[_0x372a0e];return _0x22443e;};'use strict';var Sequelize=require(_0xf339('0x0'));module['exports']={'name':{'type':Sequelize[_0xf339('0x1')]},'description':{'type':Sequelize[_0xf339('0x1')]}};
\ No newline at end of file
+var _0x9f9a=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f9a,0x158));var _0xa9f9=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x9f9a[_0x34d346];return _0x122d76;};'use strict';var Sequelize=require(_0xa9f9('0x0'));module[_0xa9f9('0x1')]={'name':{'type':Sequelize[_0xa9f9('0x2')]},'description':{'type':Sequelize[_0xa9f9('0x2')]}};
\ No newline at end of file
index d0d965d..8778523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5359=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','include','findAll','rows','show','create','catch','body','find','destroy','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map'];(function(_0x5d2067,_0x274f75){var _0x28e996=function(_0x1029bf){while(--_0x1029bf){_0x5d2067['push'](_0x5d2067['shift']());}};_0x28e996(++_0x274f75);}(_0x5359,0x144));var _0x9535=function(_0x5dd64c,_0x4c249f){_0x5dd64c=_0x5dd64c-0x0;var _0x39afac=_0x5359[_0x5dd64c];return _0x39afac;};'use strict';var emlformat=require(_0x9535('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9535('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9535('0x2'));var Mustache=require(_0x9535('0x3'));var util=require(_0x9535('0x4'));var path=require(_0x9535('0x5'));var sox=require(_0x9535('0x6'));var csv=require(_0x9535('0x7'));var ejs=require(_0x9535('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9535('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9535('0xa'));var toCsv=require(_0x9535('0x7'));var querystring=require('querystring');var Papa=require(_0x9535('0xb'));var Redis=require(_0x9535('0xc'));var authService=require(_0x9535('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9535('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9535('0xf'))(_0x9535('0x10'));var utils=require(_0x9535('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35f30a,_0x42b527){_0x42b527=_0x42b527||0xcc;return function(_0x59adc6){if(_0x59adc6){return _0x35f30a[_0x9535('0x12')](_0x42b527);}return _0x35f30a['status'](_0x42b527)['end']();};}function respondWithResult(_0x260a48,_0x4483fa){_0x4483fa=_0x4483fa||0xc8;return function(_0x387445){if(_0x387445){return _0x260a48[_0x9535('0x13')](_0x4483fa)[_0x9535('0x14')](_0x387445);}};}function respondWithFilteredResult(_0x1b917d,_0x4e0c68){return function(_0x4c0609){if(_0x4c0609){var _0x4f2bb1=typeof _0x4e0c68['offset']===_0x9535('0x15')&&typeof _0x4e0c68[_0x9535('0x16')]===_0x9535('0x15');var _0xee5169=_0x4c0609[_0x9535('0x17')];var _0xcf2ec4=_0x4f2bb1?0x0:_0x4e0c68[_0x9535('0x18')];var _0x4c6408=_0x4f2bb1?_0x4c0609['count']:_0x4e0c68[_0x9535('0x18')]+_0x4e0c68['limit'];var _0x511c71;if(_0x4c6408>=_0xee5169){_0x4c6408=_0xee5169;_0x511c71=0xc8;}else{_0x511c71=0xce;}_0x1b917d['status'](_0x511c71);return _0x1b917d['set'](_0x9535('0x19'),_0xcf2ec4+'-'+_0x4c6408+'/'+_0xee5169)['json'](_0x4c0609);}return null;};}function patchUpdates(_0x3472b4){return function(_0x24f8d3){try{jsonpatch[_0x9535('0x1a')](_0x24f8d3,_0x3472b4,!![]);}catch(_0x2392a1){return BPromise[_0x9535('0x1b')](_0x2392a1);}return _0x24f8d3[_0x9535('0x1c')]();};}function saveUpdates(_0x210456,_0x8d3600){return function(_0xf608c4){if(_0xf608c4){return _0xf608c4[_0x9535('0x1d')](_0x210456)[_0x9535('0x1e')](function(_0x411080){return _0x411080;});}return null;};}function removeEntity(_0xd178d0,_0x3b3b7f){return function(_0x2e92a1){if(_0x2e92a1){return _0x2e92a1['destroy']()[_0x9535('0x1e')](function(){_0xd178d0[_0x9535('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d665c,_0x551f5b){return function(_0x14ebf3){if(!_0x14ebf3){_0x2d665c['sendStatus'](0x194);}return _0x14ebf3;};}function handleError(_0x53477e,_0x31f459){_0x31f459=_0x31f459||0x1f4;return function(_0x390b87){logger['error'](_0x390b87[_0x9535('0x1f')]);if(_0x390b87[_0x9535('0x20')]){delete _0x390b87[_0x9535('0x20')];}_0x53477e[_0x9535('0x13')](_0x31f459)[_0x9535('0x21')](_0x390b87);};}exports[_0x9535('0x22')]=function(_0x57fac1,_0x1ae1fe){var _0x4ed6bf={},_0x4a42a5={},_0xa4a245={'count':0x0,'rows':[]};var _0x2e1540=_['map'](db[_0x9535('0x23')][_0x9535('0x24')],function(_0x3319df){return{'name':_0x3319df[_0x9535('0x25')],'type':_0x3319df['type'][_0x9535('0x26')]};});_0x4a42a5[_0x9535('0x27')]=_[_0x9535('0x28')](_0x2e1540,'name');_0x4a42a5[_0x9535('0x29')]=_[_0x9535('0x2a')](_0x57fac1[_0x9535('0x29')]);_0x4a42a5[_0x9535('0x2b')]=_[_0x9535('0x2c')](_0x4a42a5[_0x9535('0x27')],_0x4a42a5[_0x9535('0x29')]);_0x4ed6bf[_0x9535('0x2d')]=_[_0x9535('0x2c')](_0x4a42a5[_0x9535('0x27')],qs[_0x9535('0x2e')](_0x57fac1[_0x9535('0x29')][_0x9535('0x2e')]));_0x4ed6bf[_0x9535('0x2d')]=_0x4ed6bf['attributes'][_0x9535('0x2f')]?_0x4ed6bf[_0x9535('0x2d')]:_0x4a42a5[_0x9535('0x27')];if(!_0x57fac1[_0x9535('0x29')][_0x9535('0x30')](_0x9535('0x31'))){_0x4ed6bf[_0x9535('0x16')]=qs[_0x9535('0x16')](_0x57fac1[_0x9535('0x29')][_0x9535('0x16')]);_0x4ed6bf[_0x9535('0x18')]=qs['offset'](_0x57fac1[_0x9535('0x29')]['offset']);}_0x4ed6bf[_0x9535('0x32')]=qs[_0x9535('0x33')](_0x57fac1[_0x9535('0x29')][_0x9535('0x33')]);_0x4ed6bf[_0x9535('0x34')]=qs[_0x9535('0x2b')](_[_0x9535('0x35')](_0x57fac1[_0x9535('0x29')],_0x4a42a5[_0x9535('0x2b')]),_0x2e1540);if(_0x57fac1['query'][_0x9535('0x36')]){_0x4ed6bf['where']=_['merge'](_0x4ed6bf[_0x9535('0x34')],{'$or':_['map'](_0x2e1540,function(_0x2b7234){if(_0x2b7234[_0x9535('0x37')]!=='VIRTUAL'){var _0x5de085={};_0x5de085[_0x2b7234[_0x9535('0x20')]]={'$like':'%'+_0x57fac1[_0x9535('0x29')][_0x9535('0x36')]+'%'};return _0x5de085;}})});}_0x4ed6bf=_[_0x9535('0x38')]({},_0x4ed6bf,_0x57fac1[_0x9535('0x39')]);var _0x2139cc={'where':_0x4ed6bf[_0x9535('0x34')]};return db[_0x9535('0x23')][_0x9535('0x17')](_0x2139cc)['then'](function(_0x682f59){_0xa4a245[_0x9535('0x17')]=_0x682f59;if(_0x57fac1[_0x9535('0x29')]['includeAll']){_0x4ed6bf[_0x9535('0x3a')]=[{'all':!![]}];}return db[_0x9535('0x23')][_0x9535('0x3b')](_0x4ed6bf);})['then'](function(_0x23d9a0){_0xa4a245[_0x9535('0x3c')]=_0x23d9a0;return _0xa4a245;})['then'](respondWithFilteredResult(_0x1ae1fe,_0x4ed6bf))['catch'](handleError(_0x1ae1fe,null));};exports[_0x9535('0x3d')]=function(_0x146074,_0x31dbee){var _0x131d37={'raw':![],'where':{'id':_0x146074['params']['id']}},_0x4ec78f={};_0x4ec78f[_0x9535('0x27')]=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0x4ec78f['query']=_[_0x9535('0x2a')](_0x146074[_0x9535('0x29')]);_0x4ec78f[_0x9535('0x2b')]=_[_0x9535('0x2c')](_0x4ec78f[_0x9535('0x27')],_0x4ec78f['query']);_0x131d37['attributes']=_[_0x9535('0x2c')](_0x4ec78f[_0x9535('0x27')],qs[_0x9535('0x2e')](_0x146074['query'][_0x9535('0x2e')]));_0x131d37['attributes']=_0x131d37[_0x9535('0x2d')]['length']?_0x131d37['attributes']:_0x4ec78f['model'];if(_0x146074[_0x9535('0x29')]['includeAll']){_0x131d37[_0x9535('0x3a')]=[{'all':!![]}];}_0x131d37=_[_0x9535('0x38')]({},_0x131d37,_0x146074[_0x9535('0x39')]);return db[_0x9535('0x23')]['find'](_0x131d37)[_0x9535('0x1e')](handleEntityNotFound(_0x31dbee,null))[_0x9535('0x1e')](respondWithResult(_0x31dbee,null))['catch'](handleError(_0x31dbee,null));};exports[_0x9535('0x3e')]=function(_0x43b366,_0xefbf){return db['ServicenowConfiguration']['create'](_0x43b366['body'],{})[_0x9535('0x1e')](respondWithResult(_0xefbf,0xc9))[_0x9535('0x3f')](handleError(_0xefbf,null));};exports['update']=function(_0xe1246b,_0x3d8921){if(_0xe1246b['body']['id']){delete _0xe1246b[_0x9535('0x40')]['id'];}return db[_0x9535('0x23')][_0x9535('0x41')]({'where':{'id':_0xe1246b['params']['id']}})['then'](handleEntityNotFound(_0x3d8921,null))[_0x9535('0x1e')](saveUpdates(_0xe1246b['body'],null))['then'](respondWithResult(_0x3d8921,null))['catch'](handleError(_0x3d8921,null));};exports[_0x9535('0x42')]=function(_0x30150f,_0x5ef640){return db['ServicenowConfiguration'][_0x9535('0x41')]({'where':{'id':_0x30150f[_0x9535('0x43')]['id']}})[_0x9535('0x1e')](handleEntityNotFound(_0x5ef640,null))[_0x9535('0x1e')](removeEntity(_0x5ef640,null))[_0x9535('0x3f')](handleError(_0x5ef640,null));};exports[_0x9535('0x44')]=function(_0x342a6b,_0x5e80de,_0x194c03){var _0x3e2b90={};var _0x2c0727={};var _0x5a26cf;var _0x120a34;return db['ServicenowConfiguration'][_0x9535('0x45')]({'where':{'id':_0x342a6b[_0x9535('0x43')]['id']}})[_0x9535('0x1e')](handleEntityNotFound(_0x5e80de,null))['then'](function(_0x1def47){if(_0x1def47){_0x5a26cf=_0x1def47;_0x2c0727[_0x9535('0x27')]=_[_0x9535('0x2a')](db[_0x9535('0x46')][_0x9535('0x24')]);_0x2c0727[_0x9535('0x29')]=_[_0x9535('0x2a')](_0x342a6b[_0x9535('0x29')]);_0x2c0727[_0x9535('0x2b')]=_[_0x9535('0x2c')](_0x2c0727[_0x9535('0x27')],_0x2c0727[_0x9535('0x29')]);_0x3e2b90[_0x9535('0x2d')]=_[_0x9535('0x2c')](_0x2c0727['model'],qs['fields'](_0x342a6b['query'][_0x9535('0x2e')]));_0x3e2b90[_0x9535('0x2d')]=_0x3e2b90[_0x9535('0x2d')][_0x9535('0x2f')]?_0x3e2b90[_0x9535('0x2d')]:_0x2c0727[_0x9535('0x27')];_0x3e2b90[_0x9535('0x32')]=qs[_0x9535('0x33')](_0x342a6b['query'][_0x9535('0x33')]);_0x3e2b90[_0x9535('0x34')]=qs[_0x9535('0x2b')](_['pick'](_0x342a6b[_0x9535('0x29')],_0x2c0727[_0x9535('0x2b')]));if(_0x342a6b[_0x9535('0x29')][_0x9535('0x36')]){_0x3e2b90[_0x9535('0x34')]=_['merge'](_0x3e2b90[_0x9535('0x34')],{'$or':_[_0x9535('0x28')](_0x3e2b90[_0x9535('0x2d')],function(_0x3e0b4b){var _0x3e0579={};_0x3e0579[_0x3e0b4b]={'$like':'%'+_0x342a6b[_0x9535('0x29')][_0x9535('0x36')]+'%'};return _0x3e0579;})});}_0x3e2b90=_[_0x9535('0x38')]({},_0x3e2b90,_0x342a6b[_0x9535('0x39')]);return _0x5a26cf['getFields'](_0x3e2b90);}})[_0x9535('0x1e')](function(_0x43ea5c){if(_0x43ea5c){_0x120a34=_0x43ea5c[_0x9535('0x2f')];if(!_0x342a6b['query'][_0x9535('0x30')](_0x9535('0x31'))){_0x3e2b90['limit']=qs['limit'](_0x342a6b[_0x9535('0x29')]['limit']);_0x3e2b90[_0x9535('0x18')]=qs[_0x9535('0x18')](_0x342a6b[_0x9535('0x29')][_0x9535('0x18')]);}return _0x5a26cf[_0x9535('0x44')](_0x3e2b90);}})['then'](function(_0x2298dc){if(_0x2298dc){return _0x2298dc?{'count':_0x120a34,'rows':_0x2298dc}:null;}})[_0x9535('0x1e')](respondWithResult(_0x5e80de,null))[_0x9535('0x3f')](handleError(_0x5e80de,null));};exports[_0x9535('0x47')]=function(_0x2d9569,_0x1f304e,_0xc8cc06){var _0x9b01d5={};var _0x2c67c7={};var _0x1752b1;var _0xb2f2ed;return db[_0x9535('0x23')][_0x9535('0x45')]({'where':{'id':_0x2d9569[_0x9535('0x43')]['id']}})[_0x9535('0x1e')](handleEntityNotFound(_0x1f304e,null))[_0x9535('0x1e')](function(_0x15648d){if(_0x15648d){_0x1752b1=_0x15648d;_0x2c67c7[_0x9535('0x27')]=_[_0x9535('0x2a')](db[_0x9535('0x46')]['rawAttributes']);_0x2c67c7['query']=_[_0x9535('0x2a')](_0x2d9569[_0x9535('0x29')]);_0x2c67c7['filters']=_[_0x9535('0x2c')](_0x2c67c7[_0x9535('0x27')],_0x2c67c7['query']);_0x9b01d5['attributes']=_[_0x9535('0x2c')](_0x2c67c7[_0x9535('0x27')],qs[_0x9535('0x2e')](_0x2d9569[_0x9535('0x29')]['fields']));_0x9b01d5[_0x9535('0x2d')]=_0x9b01d5[_0x9535('0x2d')][_0x9535('0x2f')]?_0x9b01d5[_0x9535('0x2d')]:_0x2c67c7[_0x9535('0x27')];_0x9b01d5[_0x9535('0x32')]=qs[_0x9535('0x33')](_0x2d9569[_0x9535('0x29')][_0x9535('0x33')]);_0x9b01d5[_0x9535('0x34')]=qs[_0x9535('0x2b')](_[_0x9535('0x35')](_0x2d9569[_0x9535('0x29')],_0x2c67c7[_0x9535('0x2b')]));if(_0x2d9569[_0x9535('0x29')]['filter']){_0x9b01d5[_0x9535('0x34')]=_[_0x9535('0x38')](_0x9b01d5[_0x9535('0x34')],{'$or':_['map'](_0x9b01d5[_0x9535('0x2d')],function(_0x463e00){var _0x1cea6b={};_0x1cea6b[_0x463e00]={'$like':'%'+_0x2d9569['query']['filter']+'%'};return _0x1cea6b;})});}_0x9b01d5=_[_0x9535('0x38')]({},_0x9b01d5,_0x2d9569[_0x9535('0x39')]);return _0x1752b1[_0x9535('0x47')](_0x9b01d5);}})['then'](function(_0x275229){if(_0x275229){_0xb2f2ed=_0x275229[_0x9535('0x2f')];if(!_0x2d9569[_0x9535('0x29')][_0x9535('0x30')](_0x9535('0x31'))){_0x9b01d5[_0x9535('0x16')]=qs[_0x9535('0x16')](_0x2d9569[_0x9535('0x29')]['limit']);_0x9b01d5['offset']=qs[_0x9535('0x18')](_0x2d9569[_0x9535('0x29')][_0x9535('0x18')]);}return _0x1752b1[_0x9535('0x47')](_0x9b01d5);}})[_0x9535('0x1e')](function(_0xb66e84){if(_0xb66e84){return _0xb66e84?{'count':_0xb2f2ed,'rows':_0xb66e84}:null;}})['then'](respondWithResult(_0x1f304e,null))[_0x9535('0x3f')](handleError(_0x1f304e,null));};exports[_0x9535('0x48')]=function(_0x134a94,_0x5a44ce,_0x554873){var _0x4b7f37={};var _0x5d82a5={};var _0x87dcb3;var _0x55f22c;return db[_0x9535('0x23')]['findOne']({'where':{'id':_0x134a94[_0x9535('0x43')]['id']}})[_0x9535('0x1e')](handleEntityNotFound(_0x5a44ce,null))[_0x9535('0x1e')](function(_0x58fcf6){if(_0x58fcf6){_0x87dcb3=_0x58fcf6;_0x5d82a5[_0x9535('0x27')]=_[_0x9535('0x2a')](db[_0x9535('0x46')][_0x9535('0x24')]);_0x5d82a5[_0x9535('0x29')]=_['keys'](_0x134a94[_0x9535('0x29')]);_0x5d82a5[_0x9535('0x2b')]=_[_0x9535('0x2c')](_0x5d82a5[_0x9535('0x27')],_0x5d82a5[_0x9535('0x29')]);_0x4b7f37[_0x9535('0x2d')]=_[_0x9535('0x2c')](_0x5d82a5[_0x9535('0x27')],qs['fields'](_0x134a94[_0x9535('0x29')][_0x9535('0x2e')]));_0x4b7f37[_0x9535('0x2d')]=_0x4b7f37[_0x9535('0x2d')]['length']?_0x4b7f37[_0x9535('0x2d')]:_0x5d82a5[_0x9535('0x27')];_0x4b7f37[_0x9535('0x32')]=qs[_0x9535('0x33')](_0x134a94[_0x9535('0x29')][_0x9535('0x33')]);_0x4b7f37[_0x9535('0x34')]=qs['filters'](_[_0x9535('0x35')](_0x134a94[_0x9535('0x29')],_0x5d82a5[_0x9535('0x2b')]));if(_0x134a94[_0x9535('0x29')]['filter']){_0x4b7f37[_0x9535('0x34')]=_['merge'](_0x4b7f37[_0x9535('0x34')],{'$or':_['map'](_0x4b7f37[_0x9535('0x2d')],function(_0x382211){var _0x4e6234={};_0x4e6234[_0x382211]={'$like':'%'+_0x134a94[_0x9535('0x29')]['filter']+'%'};return _0x4e6234;})});}_0x4b7f37=_[_0x9535('0x38')]({},_0x4b7f37,_0x134a94[_0x9535('0x39')]);return _0x87dcb3[_0x9535('0x48')](_0x4b7f37);}})['then'](function(_0x28b953){if(_0x28b953){_0x55f22c=_0x28b953[_0x9535('0x2f')];if(!_0x134a94[_0x9535('0x29')]['hasOwnProperty'](_0x9535('0x31'))){_0x4b7f37['limit']=qs[_0x9535('0x16')](_0x134a94[_0x9535('0x29')][_0x9535('0x16')]);_0x4b7f37[_0x9535('0x18')]=qs[_0x9535('0x18')](_0x134a94[_0x9535('0x29')]['offset']);}return _0x87dcb3['getDescriptions'](_0x4b7f37);}})[_0x9535('0x1e')](function(_0x2f10b1){if(_0x2f10b1){return _0x2f10b1?{'count':_0x55f22c,'rows':_0x2f10b1}:null;}})[_0x9535('0x1e')](respondWithResult(_0x5a44ce,null))[_0x9535('0x3f')](handleError(_0x5a44ce,null));};
\ No newline at end of file
+var _0xc2ed=['name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','catch','show','params','keys','rawAttributes','length','includeAll','find','create','body','getFields','ServicenowField','order','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack'];(function(_0x15e6fe,_0x1a5c39){var _0x34894d=function(_0x32eec2){while(--_0x32eec2){_0x15e6fe['push'](_0x15e6fe['shift']());}};_0x34894d(++_0x1a5c39);}(_0xc2ed,0x11c));var _0xdc2e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xc2ed[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0xdc2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc2e('0x1'));var jsonpatch=require(_0xdc2e('0x2'));var rp=require(_0xdc2e('0x3'));var moment=require(_0xdc2e('0x4'));var BPromise=require(_0xdc2e('0x5'));var Mustache=require(_0xdc2e('0x6'));var util=require(_0xdc2e('0x7'));var path=require(_0xdc2e('0x8'));var sox=require(_0xdc2e('0x9'));var csv=require(_0xdc2e('0xa'));var ejs=require(_0xdc2e('0xb'));var fs=require('fs');var fs_extra=require(_0xdc2e('0xc'));var _=require(_0xdc2e('0xd'));var squel=require(_0xdc2e('0xe'));var crypto=require('crypto');var jsforce=require(_0xdc2e('0xf'));var deskjs=require(_0xdc2e('0x10'));var toCsv=require(_0xdc2e('0xa'));var querystring=require(_0xdc2e('0x11'));var Papa=require(_0xdc2e('0x12'));var Redis=require(_0xdc2e('0x13'));var authService=require(_0xdc2e('0x14'));var qs=require(_0xdc2e('0x15'));var as=require(_0xdc2e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdc2e('0x17'));var utils=require(_0xdc2e('0x18'));var config=require(_0xdc2e('0x19'));var licenseUtil=require(_0xdc2e('0x1a'));var db=require(_0xdc2e('0x1b'))['db'];function respondWithStatusCode(_0x506a39,_0xa89dc4){_0xa89dc4=_0xa89dc4||0xcc;return function(_0x24f95f){if(_0x24f95f){return _0x506a39[_0xdc2e('0x1c')](_0xa89dc4);}return _0x506a39[_0xdc2e('0x1d')](_0xa89dc4)[_0xdc2e('0x1e')]();};}function respondWithResult(_0x4b7d0b,_0xbfc0b0){_0xbfc0b0=_0xbfc0b0||0xc8;return function(_0x36e2b3){if(_0x36e2b3){return _0x4b7d0b[_0xdc2e('0x1d')](_0xbfc0b0)[_0xdc2e('0x1f')](_0x36e2b3);}};}function respondWithFilteredResult(_0x2a3b76,_0x4c8a18){return function(_0x813684){if(_0x813684){var _0x3ecc91=typeof _0x4c8a18[_0xdc2e('0x20')]===_0xdc2e('0x21')&&typeof _0x4c8a18[_0xdc2e('0x22')]===_0xdc2e('0x21');var _0x8ce398=_0x813684[_0xdc2e('0x23')];var _0x175b6d=_0x3ecc91?0x0:_0x4c8a18[_0xdc2e('0x20')];var _0x241720=_0x3ecc91?_0x813684['count']:_0x4c8a18[_0xdc2e('0x20')]+_0x4c8a18[_0xdc2e('0x22')];var _0x5b3ae2;if(_0x241720>=_0x8ce398){_0x241720=_0x8ce398;_0x5b3ae2=0xc8;}else{_0x5b3ae2=0xce;}_0x2a3b76[_0xdc2e('0x1d')](_0x5b3ae2);return _0x2a3b76[_0xdc2e('0x24')]('Content-Range',_0x175b6d+'-'+_0x241720+'/'+_0x8ce398)[_0xdc2e('0x1f')](_0x813684);}return null;};}function patchUpdates(_0x147a74){return function(_0x17df3b){try{jsonpatch[_0xdc2e('0x25')](_0x17df3b,_0x147a74,!![]);}catch(_0x24651d){return BPromise[_0xdc2e('0x26')](_0x24651d);}return _0x17df3b[_0xdc2e('0x27')]();};}function saveUpdates(_0x492989,_0x49e99f){return function(_0x2a8fa4){if(_0x2a8fa4){return _0x2a8fa4['update'](_0x492989)[_0xdc2e('0x28')](function(_0x265078){return _0x265078;});}return null;};}function removeEntity(_0x268877,_0x33209e){return function(_0x4e1142){if(_0x4e1142){return _0x4e1142[_0xdc2e('0x29')]()[_0xdc2e('0x28')](function(){_0x268877['status'](0xcc)[_0xdc2e('0x1e')]();});}};}function handleEntityNotFound(_0x1f8502,_0xfa8b5){return function(_0x36671e){if(!_0x36671e){_0x1f8502['sendStatus'](0x194);}return _0x36671e;};}function handleError(_0x1ab404,_0x3cb9c2){_0x3cb9c2=_0x3cb9c2||0x1f4;return function(_0x166a95){logger[_0xdc2e('0x2a')](_0x166a95[_0xdc2e('0x2b')]);if(_0x166a95[_0xdc2e('0x2c')]){delete _0x166a95[_0xdc2e('0x2c')];}_0x1ab404[_0xdc2e('0x1d')](_0x3cb9c2)[_0xdc2e('0x2d')](_0x166a95);};}exports[_0xdc2e('0x2e')]=function(_0x11dc6c,_0x2352a4){var _0x1cbeb8={},_0xcc7b80={},_0x4ce5ce={'count':0x0,'rows':[]};var _0x252966=_[_0xdc2e('0x2f')](db['ServicenowConfiguration']['rawAttributes'],function(_0x4c70e5){return{'name':_0x4c70e5[_0xdc2e('0x30')],'type':_0x4c70e5[_0xdc2e('0x31')]['key']};});_0xcc7b80[_0xdc2e('0x32')]=_['map'](_0x252966,'name');_0xcc7b80[_0xdc2e('0x33')]=_['keys'](_0x11dc6c[_0xdc2e('0x33')]);_0xcc7b80[_0xdc2e('0x34')]=_[_0xdc2e('0x35')](_0xcc7b80[_0xdc2e('0x32')],_0xcc7b80['query']);_0x1cbeb8[_0xdc2e('0x36')]=_['intersection'](_0xcc7b80[_0xdc2e('0x32')],qs[_0xdc2e('0x37')](_0x11dc6c[_0xdc2e('0x33')]['fields']));_0x1cbeb8[_0xdc2e('0x36')]=_0x1cbeb8[_0xdc2e('0x36')]['length']?_0x1cbeb8[_0xdc2e('0x36')]:_0xcc7b80[_0xdc2e('0x32')];if(!_0x11dc6c[_0xdc2e('0x33')][_0xdc2e('0x38')](_0xdc2e('0x39'))){_0x1cbeb8[_0xdc2e('0x22')]=qs[_0xdc2e('0x22')](_0x11dc6c['query'][_0xdc2e('0x22')]);_0x1cbeb8[_0xdc2e('0x20')]=qs['offset'](_0x11dc6c['query'][_0xdc2e('0x20')]);}_0x1cbeb8['order']=qs[_0xdc2e('0x3a')](_0x11dc6c[_0xdc2e('0x33')][_0xdc2e('0x3a')]);_0x1cbeb8[_0xdc2e('0x3b')]=qs[_0xdc2e('0x34')](_[_0xdc2e('0x3c')](_0x11dc6c[_0xdc2e('0x33')],_0xcc7b80[_0xdc2e('0x34')]),_0x252966);if(_0x11dc6c['query'][_0xdc2e('0x3d')]){_0x1cbeb8['where']=_[_0xdc2e('0x3e')](_0x1cbeb8['where'],{'$or':_[_0xdc2e('0x2f')](_0x252966,function(_0x3d5186){if(_0x3d5186['type']!==_0xdc2e('0x3f')){var _0x422e44={};_0x422e44[_0x3d5186[_0xdc2e('0x2c')]]={'$like':'%'+_0x11dc6c['query'][_0xdc2e('0x3d')]+'%'};return _0x422e44;}})});}_0x1cbeb8=_[_0xdc2e('0x3e')]({},_0x1cbeb8,_0x11dc6c[_0xdc2e('0x40')]);var _0x50f960={'where':_0x1cbeb8[_0xdc2e('0x3b')]};return db['ServicenowConfiguration'][_0xdc2e('0x23')](_0x50f960)[_0xdc2e('0x28')](function(_0x51fed5){_0x4ce5ce[_0xdc2e('0x23')]=_0x51fed5;if(_0x11dc6c[_0xdc2e('0x33')]['includeAll']){_0x1cbeb8['include']=[{'all':!![]}];}return db[_0xdc2e('0x41')]['findAll'](_0x1cbeb8);})[_0xdc2e('0x28')](function(_0x232129){_0x4ce5ce['rows']=_0x232129;return _0x4ce5ce;})['then'](respondWithFilteredResult(_0x2352a4,_0x1cbeb8))[_0xdc2e('0x42')](handleError(_0x2352a4,null));};exports[_0xdc2e('0x43')]=function(_0x102543,_0x408c38){var _0x34cdf8={'raw':![],'where':{'id':_0x102543[_0xdc2e('0x44')]['id']}},_0x6d9f88={};_0x6d9f88[_0xdc2e('0x32')]=_[_0xdc2e('0x45')](db[_0xdc2e('0x41')][_0xdc2e('0x46')]);_0x6d9f88['query']=_[_0xdc2e('0x45')](_0x102543[_0xdc2e('0x33')]);_0x6d9f88[_0xdc2e('0x34')]=_['intersection'](_0x6d9f88[_0xdc2e('0x32')],_0x6d9f88[_0xdc2e('0x33')]);_0x34cdf8['attributes']=_[_0xdc2e('0x35')](_0x6d9f88['model'],qs['fields'](_0x102543[_0xdc2e('0x33')][_0xdc2e('0x37')]));_0x34cdf8[_0xdc2e('0x36')]=_0x34cdf8[_0xdc2e('0x36')][_0xdc2e('0x47')]?_0x34cdf8[_0xdc2e('0x36')]:_0x6d9f88[_0xdc2e('0x32')];if(_0x102543['query'][_0xdc2e('0x48')]){_0x34cdf8['include']=[{'all':!![]}];}_0x34cdf8=_['merge']({},_0x34cdf8,_0x102543['options']);return db['ServicenowConfiguration'][_0xdc2e('0x49')](_0x34cdf8)[_0xdc2e('0x28')](handleEntityNotFound(_0x408c38,null))[_0xdc2e('0x28')](respondWithResult(_0x408c38,null))[_0xdc2e('0x42')](handleError(_0x408c38,null));};exports['create']=function(_0x2bb783,_0x31dc59){return db['ServicenowConfiguration'][_0xdc2e('0x4a')](_0x2bb783[_0xdc2e('0x4b')],{})[_0xdc2e('0x28')](respondWithResult(_0x31dc59,0xc9))['catch'](handleError(_0x31dc59,null));};exports['update']=function(_0x2332e6,_0x53cf94){if(_0x2332e6[_0xdc2e('0x4b')]['id']){delete _0x2332e6[_0xdc2e('0x4b')]['id'];}return db['ServicenowConfiguration'][_0xdc2e('0x49')]({'where':{'id':_0x2332e6[_0xdc2e('0x44')]['id']}})[_0xdc2e('0x28')](handleEntityNotFound(_0x53cf94,null))[_0xdc2e('0x28')](saveUpdates(_0x2332e6[_0xdc2e('0x4b')],null))[_0xdc2e('0x28')](respondWithResult(_0x53cf94,null))[_0xdc2e('0x42')](handleError(_0x53cf94,null));};exports[_0xdc2e('0x29')]=function(_0x1dd194,_0x31f682){return db['ServicenowConfiguration'][_0xdc2e('0x49')]({'where':{'id':_0x1dd194[_0xdc2e('0x44')]['id']}})[_0xdc2e('0x28')](handleEntityNotFound(_0x31f682,null))['then'](removeEntity(_0x31f682,null))[_0xdc2e('0x42')](handleError(_0x31f682,null));};exports[_0xdc2e('0x4c')]=function(_0x3bec1e,_0x2bfad9,_0xe81488){var _0x32dbd2={};var _0x3ca086={};var _0x2fbf07;var _0x1b1f01;return db[_0xdc2e('0x41')]['findOne']({'where':{'id':_0x3bec1e['params']['id']}})[_0xdc2e('0x28')](handleEntityNotFound(_0x2bfad9,null))[_0xdc2e('0x28')](function(_0x17013e){if(_0x17013e){_0x2fbf07=_0x17013e;_0x3ca086[_0xdc2e('0x32')]=_[_0xdc2e('0x45')](db[_0xdc2e('0x4d')][_0xdc2e('0x46')]);_0x3ca086['query']=_[_0xdc2e('0x45')](_0x3bec1e['query']);_0x3ca086[_0xdc2e('0x34')]=_[_0xdc2e('0x35')](_0x3ca086[_0xdc2e('0x32')],_0x3ca086[_0xdc2e('0x33')]);_0x32dbd2[_0xdc2e('0x36')]=_['intersection'](_0x3ca086[_0xdc2e('0x32')],qs['fields'](_0x3bec1e[_0xdc2e('0x33')][_0xdc2e('0x37')]));_0x32dbd2[_0xdc2e('0x36')]=_0x32dbd2[_0xdc2e('0x36')]['length']?_0x32dbd2[_0xdc2e('0x36')]:_0x3ca086['model'];_0x32dbd2[_0xdc2e('0x4e')]=qs[_0xdc2e('0x3a')](_0x3bec1e[_0xdc2e('0x33')][_0xdc2e('0x3a')]);_0x32dbd2[_0xdc2e('0x3b')]=qs['filters'](_['pick'](_0x3bec1e['query'],_0x3ca086[_0xdc2e('0x34')]));if(_0x3bec1e[_0xdc2e('0x33')][_0xdc2e('0x3d')]){_0x32dbd2[_0xdc2e('0x3b')]=_[_0xdc2e('0x3e')](_0x32dbd2[_0xdc2e('0x3b')],{'$or':_[_0xdc2e('0x2f')](_0x32dbd2[_0xdc2e('0x36')],function(_0x4d31ab){var _0x232c03={};_0x232c03[_0x4d31ab]={'$like':'%'+_0x3bec1e[_0xdc2e('0x33')]['filter']+'%'};return _0x232c03;})});}_0x32dbd2=_['merge']({},_0x32dbd2,_0x3bec1e[_0xdc2e('0x40')]);return _0x2fbf07['getFields'](_0x32dbd2);}})[_0xdc2e('0x28')](function(_0x312fd2){if(_0x312fd2){_0x1b1f01=_0x312fd2[_0xdc2e('0x47')];if(!_0x3bec1e[_0xdc2e('0x33')]['hasOwnProperty']('nolimit')){_0x32dbd2[_0xdc2e('0x22')]=qs[_0xdc2e('0x22')](_0x3bec1e[_0xdc2e('0x33')][_0xdc2e('0x22')]);_0x32dbd2[_0xdc2e('0x20')]=qs[_0xdc2e('0x20')](_0x3bec1e[_0xdc2e('0x33')]['offset']);}return _0x2fbf07[_0xdc2e('0x4c')](_0x32dbd2);}})['then'](function(_0x40df1e){if(_0x40df1e){return _0x40df1e?{'count':_0x1b1f01,'rows':_0x40df1e}:null;}})[_0xdc2e('0x28')](respondWithResult(_0x2bfad9,null))[_0xdc2e('0x42')](handleError(_0x2bfad9,null));};exports[_0xdc2e('0x4f')]=function(_0xde7155,_0x2f60ee,_0x4bd62b){var _0x36b882={};var _0x4c2597={};var _0x5926ec;var _0x1d7dc7;return db[_0xdc2e('0x41')][_0xdc2e('0x50')]({'where':{'id':_0xde7155['params']['id']}})[_0xdc2e('0x28')](handleEntityNotFound(_0x2f60ee,null))[_0xdc2e('0x28')](function(_0x52fe34){if(_0x52fe34){_0x5926ec=_0x52fe34;_0x4c2597['model']=_[_0xdc2e('0x45')](db['ServicenowField'][_0xdc2e('0x46')]);_0x4c2597[_0xdc2e('0x33')]=_[_0xdc2e('0x45')](_0xde7155[_0xdc2e('0x33')]);_0x4c2597[_0xdc2e('0x34')]=_[_0xdc2e('0x35')](_0x4c2597[_0xdc2e('0x32')],_0x4c2597[_0xdc2e('0x33')]);_0x36b882[_0xdc2e('0x36')]=_[_0xdc2e('0x35')](_0x4c2597[_0xdc2e('0x32')],qs['fields'](_0xde7155[_0xdc2e('0x33')][_0xdc2e('0x37')]));_0x36b882[_0xdc2e('0x36')]=_0x36b882[_0xdc2e('0x36')][_0xdc2e('0x47')]?_0x36b882['attributes']:_0x4c2597[_0xdc2e('0x32')];_0x36b882['order']=qs[_0xdc2e('0x3a')](_0xde7155[_0xdc2e('0x33')][_0xdc2e('0x3a')]);_0x36b882[_0xdc2e('0x3b')]=qs[_0xdc2e('0x34')](_['pick'](_0xde7155[_0xdc2e('0x33')],_0x4c2597['filters']));if(_0xde7155[_0xdc2e('0x33')]['filter']){_0x36b882[_0xdc2e('0x3b')]=_[_0xdc2e('0x3e')](_0x36b882['where'],{'$or':_[_0xdc2e('0x2f')](_0x36b882[_0xdc2e('0x36')],function(_0x3865ab){var _0x3e4c71={};_0x3e4c71[_0x3865ab]={'$like':'%'+_0xde7155['query'][_0xdc2e('0x3d')]+'%'};return _0x3e4c71;})});}_0x36b882=_[_0xdc2e('0x3e')]({},_0x36b882,_0xde7155[_0xdc2e('0x40')]);return _0x5926ec[_0xdc2e('0x4f')](_0x36b882);}})[_0xdc2e('0x28')](function(_0x23ec89){if(_0x23ec89){_0x1d7dc7=_0x23ec89[_0xdc2e('0x47')];if(!_0xde7155['query'][_0xdc2e('0x38')](_0xdc2e('0x39'))){_0x36b882[_0xdc2e('0x22')]=qs[_0xdc2e('0x22')](_0xde7155['query']['limit']);_0x36b882[_0xdc2e('0x20')]=qs[_0xdc2e('0x20')](_0xde7155[_0xdc2e('0x33')]['offset']);}return _0x5926ec[_0xdc2e('0x4f')](_0x36b882);}})[_0xdc2e('0x28')](function(_0x95a1d2){if(_0x95a1d2){return _0x95a1d2?{'count':_0x1d7dc7,'rows':_0x95a1d2}:null;}})['then'](respondWithResult(_0x2f60ee,null))[_0xdc2e('0x42')](handleError(_0x2f60ee,null));};exports['getDescriptions']=function(_0x554cae,_0x2396da,_0x327357){var _0x536385={};var _0x65c2c7={};var _0x293032;var _0x4dcb8d;return db[_0xdc2e('0x41')]['findOne']({'where':{'id':_0x554cae['params']['id']}})[_0xdc2e('0x28')](handleEntityNotFound(_0x2396da,null))[_0xdc2e('0x28')](function(_0x4cdb87){if(_0x4cdb87){_0x293032=_0x4cdb87;_0x65c2c7[_0xdc2e('0x32')]=_[_0xdc2e('0x45')](db[_0xdc2e('0x4d')][_0xdc2e('0x46')]);_0x65c2c7['query']=_[_0xdc2e('0x45')](_0x554cae['query']);_0x65c2c7[_0xdc2e('0x34')]=_[_0xdc2e('0x35')](_0x65c2c7[_0xdc2e('0x32')],_0x65c2c7[_0xdc2e('0x33')]);_0x536385[_0xdc2e('0x36')]=_[_0xdc2e('0x35')](_0x65c2c7['model'],qs['fields'](_0x554cae[_0xdc2e('0x33')][_0xdc2e('0x37')]));_0x536385['attributes']=_0x536385['attributes'][_0xdc2e('0x47')]?_0x536385[_0xdc2e('0x36')]:_0x65c2c7[_0xdc2e('0x32')];_0x536385[_0xdc2e('0x4e')]=qs[_0xdc2e('0x3a')](_0x554cae['query'][_0xdc2e('0x3a')]);_0x536385[_0xdc2e('0x3b')]=qs[_0xdc2e('0x34')](_['pick'](_0x554cae[_0xdc2e('0x33')],_0x65c2c7[_0xdc2e('0x34')]));if(_0x554cae[_0xdc2e('0x33')][_0xdc2e('0x3d')]){_0x536385[_0xdc2e('0x3b')]=_[_0xdc2e('0x3e')](_0x536385[_0xdc2e('0x3b')],{'$or':_['map'](_0x536385[_0xdc2e('0x36')],function(_0x1f67ce){var _0x5dcf24={};_0x5dcf24[_0x1f67ce]={'$like':'%'+_0x554cae[_0xdc2e('0x33')][_0xdc2e('0x3d')]+'%'};return _0x5dcf24;})});}_0x536385=_['merge']({},_0x536385,_0x554cae[_0xdc2e('0x40')]);return _0x293032[_0xdc2e('0x51')](_0x536385);}})[_0xdc2e('0x28')](function(_0x3362ae){if(_0x3362ae){_0x4dcb8d=_0x3362ae[_0xdc2e('0x47')];if(!_0x554cae[_0xdc2e('0x33')]['hasOwnProperty'](_0xdc2e('0x39'))){_0x536385[_0xdc2e('0x22')]=qs[_0xdc2e('0x22')](_0x554cae[_0xdc2e('0x33')]['limit']);_0x536385[_0xdc2e('0x20')]=qs['offset'](_0x554cae[_0xdc2e('0x33')][_0xdc2e('0x20')]);}return _0x293032[_0xdc2e('0x51')](_0x536385);}})[_0xdc2e('0x28')](function(_0x1c4611){if(_0x1c4611){return _0x1c4611?{'count':_0x4dcb8d,'rows':_0x1c4611}:null;}})[_0xdc2e('0x28')](respondWithResult(_0x2396da,null))[_0xdc2e('0x42')](handleError(_0x2396da,null));};
\ No newline at end of file
index 50c1101..5fe3df7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c8d=['./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0c8d,0x79));var _0xd0c8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0c8d[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var logger=require(_0xd0c8('0x1'))(_0xd0c8('0x2'));var moment=require(_0xd0c8('0x3'));var BPromise=require(_0xd0c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd0c8('0x5'));module[_0xd0c8('0x6')]=function(_0xa4eeb2,_0x50484d){return _0xa4eeb2[_0xd0c8('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0xd0c8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdef9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x23275a,_0x31d737){var _0x433232=function(_0x32955a){while(--_0x32955a){_0x23275a['push'](_0x23275a['shift']());}};_0x433232(++_0x31d737);}(_0xdef9,0x1ed));var _0x9def=function(_0x33ff0c,_0x448c2a){_0x33ff0c=_0x33ff0c-0x0;var _0x44bdc2=_0xdef9[_0x33ff0c];return _0x44bdc2;};'use strict';var _=require(_0x9def('0x0'));var util=require(_0x9def('0x1'));var logger=require(_0x9def('0x2'))(_0x9def('0x3'));var moment=require(_0x9def('0x4'));var BPromise=require(_0x9def('0x5'));var rp=require(_0x9def('0x6'));var fs=require('fs');var path=require(_0x9def('0x7'));var rimraf=require(_0x9def('0x8'));var config=require(_0x9def('0x9'));var attributes=require(_0x9def('0xa'));module[_0x9def('0xb')]=function(_0x12a0d4,_0x1f1fa1){return _0x12a0d4[_0x9def('0xc')](_0x9def('0xd'),attributes,{'tableName':_0x9def('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a74094..96f4120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b4=['then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xd4818e,_0x4a85b3){var _0x2e0d15=function(_0x519dc3){while(--_0x519dc3){_0xd4818e['push'](_0xd4818e['shift']());}};_0x2e0d15(++_0x4a85b3);}(_0x32b4,0x73));var _0x432b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x32b4[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x432b('0x0'));var moment=require(_0x432b('0x1'));var BPromise=require(_0x432b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x432b('0x3'))['db'];var utils=require(_0x432b('0x4'));var logger=require(_0x432b('0x5'))(_0x432b('0x6'));var config=require(_0x432b('0x7'));var jayson=require(_0x432b('0x8'));var client=jayson[_0x432b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b4bc3,_0x1e0bf0,_0x4b25a1){return new BPromise(function(_0x29ce87,_0x4851ca){return client[_0x432b('0xa')](_0x2b4bc3,_0x4b25a1)[_0x432b('0xb')](function(_0x4ac365){logger['info'](_0x432b('0xc'),_0x1e0bf0,_0x432b('0xd'));logger[_0x432b('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1e0bf0,_0x432b('0xd'),JSON['stringify'](_0x4ac365));if(_0x4ac365['error']){if(_0x4ac365[_0x432b('0xf')][_0x432b('0x10')]===0x1f4){logger[_0x432b('0xf')](_0x432b('0xc'),_0x1e0bf0,_0x4ac365[_0x432b('0xf')][_0x432b('0x11')]);return _0x4851ca(_0x4ac365['error'][_0x432b('0x11')]);}logger[_0x432b('0xf')](_0x432b('0xc'),_0x1e0bf0,_0x4ac365[_0x432b('0xf')][_0x432b('0x11')]);return _0x29ce87(_0x4ac365[_0x432b('0xf')][_0x432b('0x11')]);}else{logger[_0x432b('0x12')](_0x432b('0xc'),_0x1e0bf0,'request\x20sent');_0x29ce87(_0x4ac365[_0x432b('0x13')][_0x432b('0x11')]);}})[_0x432b('0x14')](function(_0x11c30b){logger['error'](_0x432b('0xc'),_0x1e0bf0,_0x11c30b);_0x4851ca(_0x11c30b);});});}
\ No newline at end of file
+var _0xe367=['info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xe367,0x116));var _0x7e36=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe367[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x7e36('0x0'));var util=require(_0x7e36('0x1'));var moment=require(_0x7e36('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e36('0x3'));var fs=require('fs');var Redis=require(_0x7e36('0x4'));var db=require(_0x7e36('0x5'))['db'];var utils=require(_0x7e36('0x6'));var logger=require(_0x7e36('0x7'))(_0x7e36('0x8'));var config=require(_0x7e36('0x9'));var jayson=require(_0x7e36('0xa'));var client=jayson[_0x7e36('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c15eb,_0x414bb3,_0x1b0dfa){return new BPromise(function(_0x24fd32,_0x45630b){return client['request'](_0x4c15eb,_0x1b0dfa)[_0x7e36('0xc')](function(_0x4cac06){logger['info'](_0x7e36('0xd'),_0x414bb3,'request\x20sent');logger[_0x7e36('0xe')](_0x7e36('0xf'),_0x414bb3,_0x7e36('0x10'),JSON[_0x7e36('0x11')](_0x4cac06));if(_0x4cac06[_0x7e36('0x12')]){if(_0x4cac06['error'][_0x7e36('0x13')]===0x1f4){logger[_0x7e36('0x12')](_0x7e36('0xd'),_0x414bb3,_0x4cac06[_0x7e36('0x12')][_0x7e36('0x14')]);return _0x45630b(_0x4cac06[_0x7e36('0x12')][_0x7e36('0x14')]);}logger[_0x7e36('0x12')](_0x7e36('0xd'),_0x414bb3,_0x4cac06[_0x7e36('0x12')]['message']);return _0x24fd32(_0x4cac06[_0x7e36('0x12')][_0x7e36('0x14')]);}else{logger[_0x7e36('0x15')]('ServicenowConfiguration,\x20%s,\x20%s',_0x414bb3,_0x7e36('0x10'));_0x24fd32(_0x4cac06[_0x7e36('0x16')][_0x7e36('0x14')]);}})['catch'](function(_0x2ad7cf){logger['error'](_0x7e36('0xd'),_0x414bb3,_0x2ad7cf);_0x45630b(_0x2ad7cf);});});}
\ No newline at end of file
index ba57bf9..ba9ccb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb02d=['exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy'];(function(_0x1fabf6,_0x3094e1){var _0xec1fad=function(_0x5ccfde){while(--_0x5ccfde){_0x1fabf6['push'](_0x1fabf6['shift']());}};_0xec1fad(++_0x3094e1);}(_0xb02d,0x1d5));var _0xdb02=function(_0x235e13,_0x42396d){_0x235e13=_0x235e13-0x0;var _0x17c053=_0xb02d[_0x235e13];return _0x17c053;};'use strict';var multer=require(_0xdb02('0x0'));var util=require(_0xdb02('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb02('0x2')]();var fs_extra=require(_0xdb02('0x3'));var auth=require(_0xdb02('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdb02('0x5'));var controller=require(_0xdb02('0x6'));router['get']('/',auth[_0xdb02('0x7')](),controller[_0xdb02('0x8')]);router[_0xdb02('0x9')](_0xdb02('0xa'),auth[_0xdb02('0x7')](),controller[_0xdb02('0xb')]);router[_0xdb02('0xc')]('/',auth[_0xdb02('0x7')](),controller[_0xdb02('0xd')]);router[_0xdb02('0xe')](_0xdb02('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xdb02('0xf')]('/:id',auth[_0xdb02('0x7')](),controller[_0xdb02('0x10')]);module[_0xdb02('0x11')]=router;
\ No newline at end of file
+var _0x46ce=['/:id','show','post','create','put','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index'];(function(_0x44d44e,_0x4ddf86){var _0x10a772=function(_0x30d724){while(--_0x30d724){_0x44d44e['push'](_0x44d44e['shift']());}};_0x10a772(++_0x4ddf86);}(_0x46ce,0x138));var _0xe46c=function(_0x2d03d9,_0x1bb50c){_0x2d03d9=_0x2d03d9-0x0;var _0xbfed62=_0x46ce[_0x2d03d9];return _0xbfed62;};'use strict';var multer=require('multer');var util=require(_0xe46c('0x0'));var path=require(_0xe46c('0x1'));var timeout=require('connect-timeout');var express=require(_0xe46c('0x2'));var router=express['Router']();var fs_extra=require(_0xe46c('0x3'));var auth=require(_0xe46c('0x4'));var interaction=require(_0xe46c('0x5'));var config=require(_0xe46c('0x6'));var controller=require(_0xe46c('0x7'));router[_0xe46c('0x8')]('/',auth[_0xe46c('0x9')](),controller[_0xe46c('0xa')]);router[_0xe46c('0x8')](_0xe46c('0xb'),auth['isAuthenticated'](),controller[_0xe46c('0xc')]);router[_0xe46c('0xd')]('/',auth[_0xe46c('0x9')](),controller[_0xe46c('0xe')]);router[_0xe46c('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe46c('0x10')](_0xe46c('0xb'),auth[_0xe46c('0x9')](),controller[_0xe46c('0x11')]);module[_0xe46c('0x12')]=router;
\ No newline at end of file
index 295fc4f..c648b6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2831=['string','variable','customVariable','picklist','STRING','ENUM','sequelize'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x2831,0xca));var _0x1283=function(_0x29b6b6,_0x46b6c2){_0x29b6b6=_0x29b6b6-0x0;var _0x3943db=_0x2831[_0x29b6b6];return _0x3943db;};'use strict';var Sequelize=require(_0x1283('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1283('0x1'),_0x1283('0x2'),_0x1283('0x3'),'keyValue',_0x1283('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1283('0x5')]},'key':{'type':Sequelize[_0x1283('0x5')]},'keyType':{'type':Sequelize[_0x1283('0x6')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1283('0x5')]},'nameField':{'type':Sequelize[_0x1283('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1283('0x5')]}};
\ No newline at end of file
+var _0x9e08=['customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x9e08,0x17b));var _0x89e0=function(_0x5053d5,_0xc3e640){_0x5053d5=_0x5053d5-0x0;var _0x3ea50a=_0x9e08[_0x5053d5];return _0x3ea50a;};'use strict';var Sequelize=require(_0x89e0('0x0'));module[_0x89e0('0x1')]={'type':{'type':Sequelize[_0x89e0('0x2')](_0x89e0('0x3'),_0x89e0('0x4'),_0x89e0('0x5'),'keyValue','picklist'),'defaultValue':_0x89e0('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x89e0('0x6')]},'keyType':{'type':Sequelize[_0x89e0('0x2')](_0x89e0('0x3'),_0x89e0('0x4'),_0x89e0('0x5'))},'keyContent':{'type':Sequelize[_0x89e0('0x6')]},'idField':{'type':Sequelize[_0x89e0('0x6')]},'nameField':{'type':Sequelize[_0x89e0('0x6')]},'customField':{'type':Sequelize[_0x89e0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x89e0('0x6')]}};
\ No newline at end of file
index 4395f52..0eda4c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2797=['pick','type','VIRTUAL','merge','options','includeAll','include','rows','catch','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','hasOwnProperty','nolimit','sort','where'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0x2797,0x1c3));var _0x7279=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2797[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7279('0x0'));var rimraf=require(_0x7279('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7279('0x2'));var rp=require(_0x7279('0x3'));var moment=require('moment');var BPromise=require(_0x7279('0x4'));var Mustache=require(_0x7279('0x5'));var util=require(_0x7279('0x6'));var path=require(_0x7279('0x7'));var sox=require(_0x7279('0x8'));var csv=require(_0x7279('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7279('0xa'));var _=require(_0x7279('0xb'));var squel=require(_0x7279('0xc'));var crypto=require(_0x7279('0xd'));var jsforce=require(_0x7279('0xe'));var deskjs=require(_0x7279('0xf'));var toCsv=require(_0x7279('0x9'));var querystring=require(_0x7279('0x10'));var Papa=require(_0x7279('0x11'));var Redis=require(_0x7279('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7279('0x13'));var as=require(_0x7279('0x14'));var hardwareService=require(_0x7279('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7279('0x16'));var config=require(_0x7279('0x17'));var licenseUtil=require(_0x7279('0x18'));var db=require(_0x7279('0x19'))['db'];function respondWithStatusCode(_0x1e4410,_0x12dc6e){_0x12dc6e=_0x12dc6e||0xcc;return function(_0x2e073d){if(_0x2e073d){return _0x1e4410[_0x7279('0x1a')](_0x12dc6e);}return _0x1e4410[_0x7279('0x1b')](_0x12dc6e)[_0x7279('0x1c')]();};}function respondWithResult(_0x2a07ef,_0x1cec9f){_0x1cec9f=_0x1cec9f||0xc8;return function(_0x2ed7c9){if(_0x2ed7c9){return _0x2a07ef[_0x7279('0x1b')](_0x1cec9f)[_0x7279('0x1d')](_0x2ed7c9);}};}function respondWithFilteredResult(_0x392b49,_0x420e20){return function(_0x12ae9a){if(_0x12ae9a){var _0x5a9b40=typeof _0x420e20[_0x7279('0x1e')]===_0x7279('0x1f')&&typeof _0x420e20[_0x7279('0x20')]===_0x7279('0x1f');var _0x146581=_0x12ae9a[_0x7279('0x21')];var _0x492010=_0x5a9b40?0x0:_0x420e20[_0x7279('0x1e')];var _0xe184dc=_0x5a9b40?_0x12ae9a[_0x7279('0x21')]:_0x420e20['offset']+_0x420e20[_0x7279('0x20')];var _0x21280b;if(_0xe184dc>=_0x146581){_0xe184dc=_0x146581;_0x21280b=0xc8;}else{_0x21280b=0xce;}_0x392b49[_0x7279('0x1b')](_0x21280b);return _0x392b49[_0x7279('0x22')](_0x7279('0x23'),_0x492010+'-'+_0xe184dc+'/'+_0x146581)[_0x7279('0x1d')](_0x12ae9a);}return null;};}function patchUpdates(_0x264c75){return function(_0x3d481a){try{jsonpatch['apply'](_0x3d481a,_0x264c75,!![]);}catch(_0x1313fe){return BPromise['reject'](_0x1313fe);}return _0x3d481a[_0x7279('0x24')]();};}function saveUpdates(_0x52e485,_0x2d53b3){return function(_0x92fb89){if(_0x92fb89){return _0x92fb89[_0x7279('0x25')](_0x52e485)['then'](function(_0x5c39f9){return _0x5c39f9;});}return null;};}function removeEntity(_0x1ad0a8,_0x47065d){return function(_0x275dde){if(_0x275dde){return _0x275dde[_0x7279('0x26')]()[_0x7279('0x27')](function(){_0x1ad0a8[_0x7279('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cbc8,_0x35a2ee){return function(_0x368283){if(!_0x368283){_0x41cbc8[_0x7279('0x1a')](0x194);}return _0x368283;};}function handleError(_0x520627,_0x5339c7){_0x5339c7=_0x5339c7||0x1f4;return function(_0x292a1e){logger[_0x7279('0x28')](_0x292a1e[_0x7279('0x29')]);if(_0x292a1e['name']){delete _0x292a1e[_0x7279('0x2a')];}_0x520627['status'](_0x5339c7)[_0x7279('0x2b')](_0x292a1e);};}exports[_0x7279('0x2c')]=function(_0xf14112,_0x4fddfa){var _0x44c4a8={},_0x78f711={},_0x59acec={'count':0x0,'rows':[]};var _0x466d4c=_[_0x7279('0x2d')](db[_0x7279('0x2e')][_0x7279('0x2f')],function(_0x5d1a8b){return{'name':_0x5d1a8b[_0x7279('0x30')],'type':_0x5d1a8b['type'][_0x7279('0x31')]};});_0x78f711['model']=_['map'](_0x466d4c,_0x7279('0x2a'));_0x78f711[_0x7279('0x32')]=_[_0x7279('0x33')](_0xf14112[_0x7279('0x32')]);_0x78f711[_0x7279('0x34')]=_['intersection'](_0x78f711['model'],_0x78f711[_0x7279('0x32')]);_0x44c4a8['attributes']=_['intersection'](_0x78f711[_0x7279('0x35')],qs[_0x7279('0x36')](_0xf14112['query'][_0x7279('0x36')]));_0x44c4a8['attributes']=_0x44c4a8[_0x7279('0x37')]['length']?_0x44c4a8['attributes']:_0x78f711['model'];if(!_0xf14112[_0x7279('0x32')][_0x7279('0x38')](_0x7279('0x39'))){_0x44c4a8[_0x7279('0x20')]=qs[_0x7279('0x20')](_0xf14112['query'][_0x7279('0x20')]);_0x44c4a8[_0x7279('0x1e')]=qs['offset'](_0xf14112[_0x7279('0x32')][_0x7279('0x1e')]);}_0x44c4a8['order']=qs[_0x7279('0x3a')](_0xf14112[_0x7279('0x32')][_0x7279('0x3a')]);_0x44c4a8[_0x7279('0x3b')]=qs['filters'](_[_0x7279('0x3c')](_0xf14112[_0x7279('0x32')],_0x78f711[_0x7279('0x34')]),_0x466d4c);if(_0xf14112[_0x7279('0x32')]['filter']){_0x44c4a8[_0x7279('0x3b')]=_['merge'](_0x44c4a8[_0x7279('0x3b')],{'$or':_[_0x7279('0x2d')](_0x466d4c,function(_0x23c4ee){if(_0x23c4ee[_0x7279('0x3d')]!==_0x7279('0x3e')){var _0x130770={};_0x130770[_0x23c4ee['name']]={'$like':'%'+_0xf14112['query']['filter']+'%'};return _0x130770;}})});}_0x44c4a8=_[_0x7279('0x3f')]({},_0x44c4a8,_0xf14112[_0x7279('0x40')]);var _0x2587b4={'where':_0x44c4a8[_0x7279('0x3b')]};return db[_0x7279('0x2e')][_0x7279('0x21')](_0x2587b4)[_0x7279('0x27')](function(_0x3915c9){_0x59acec[_0x7279('0x21')]=_0x3915c9;if(_0xf14112['query'][_0x7279('0x41')]){_0x44c4a8[_0x7279('0x42')]=[{'all':!![]}];}return db[_0x7279('0x2e')]['findAll'](_0x44c4a8);})['then'](function(_0x2091b1){_0x59acec[_0x7279('0x43')]=_0x2091b1;return _0x59acec;})[_0x7279('0x27')](respondWithFilteredResult(_0x4fddfa,_0x44c4a8))['catch'](handleError(_0x4fddfa,null));};exports['show']=function(_0x50dcf5,_0x144b37){var _0x554c87={'raw':!![],'where':{'id':_0x50dcf5['params']['id']}},_0x550a27={};_0x550a27[_0x7279('0x35')]=_[_0x7279('0x33')](db[_0x7279('0x2e')][_0x7279('0x2f')]);_0x550a27[_0x7279('0x32')]=_[_0x7279('0x33')](_0x50dcf5[_0x7279('0x32')]);_0x550a27[_0x7279('0x34')]=_['intersection'](_0x550a27[_0x7279('0x35')],_0x550a27[_0x7279('0x32')]);_0x554c87['attributes']=_['intersection'](_0x550a27[_0x7279('0x35')],qs['fields'](_0x50dcf5[_0x7279('0x32')][_0x7279('0x36')]));_0x554c87[_0x7279('0x37')]=_0x554c87[_0x7279('0x37')]['length']?_0x554c87[_0x7279('0x37')]:_0x550a27[_0x7279('0x35')];if(_0x50dcf5[_0x7279('0x32')][_0x7279('0x41')]){_0x554c87[_0x7279('0x42')]=[{'all':!![]}];}_0x554c87=_['merge']({},_0x554c87,_0x50dcf5[_0x7279('0x40')]);return db['ServicenowField']['find'](_0x554c87)['then'](handleEntityNotFound(_0x144b37,null))[_0x7279('0x27')](respondWithResult(_0x144b37,null))[_0x7279('0x44')](handleError(_0x144b37,null));};exports['create']=function(_0x44e774,_0x962ec1){return db[_0x7279('0x2e')][_0x7279('0x45')](_0x44e774[_0x7279('0x46')],{})[_0x7279('0x27')](respondWithResult(_0x962ec1,0xc9))[_0x7279('0x44')](handleError(_0x962ec1,null));};exports[_0x7279('0x25')]=function(_0x234695,_0x12abdd){if(_0x234695[_0x7279('0x46')]['id']){delete _0x234695[_0x7279('0x46')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x234695['params']['id']}})[_0x7279('0x27')](handleEntityNotFound(_0x12abdd,null))[_0x7279('0x27')](saveUpdates(_0x234695[_0x7279('0x46')],null))[_0x7279('0x27')](respondWithResult(_0x12abdd,null))['catch'](handleError(_0x12abdd,null));};exports[_0x7279('0x26')]=function(_0x178c1c,_0x3c02e7){return db[_0x7279('0x2e')][_0x7279('0x47')]({'where':{'id':_0x178c1c[_0x7279('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c02e7,null))[_0x7279('0x27')](removeEntity(_0x3c02e7,null))[_0x7279('0x44')](handleError(_0x3c02e7,null));};
\ No newline at end of file
+var _0x4ca8=['catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x51107f,_0x42e420){var _0x4d2564=function(_0x13e2b4){while(--_0x13e2b4){_0x51107f['push'](_0x51107f['shift']());}};_0x4d2564(++_0x42e420);}(_0x4ca8,0x137));var _0x84ca=function(_0xd55703,_0x2753ba){_0xd55703=_0xd55703-0x0;var _0x43013c=_0x4ca8[_0xd55703];return _0x43013c;};'use strict';var emlformat=require(_0x84ca('0x0'));var rimraf=require(_0x84ca('0x1'));var zipdir=require(_0x84ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x84ca('0x3'));var BPromise=require(_0x84ca('0x4'));var Mustache=require(_0x84ca('0x5'));var util=require(_0x84ca('0x6'));var path=require('path');var sox=require(_0x84ca('0x7'));var csv=require(_0x84ca('0x8'));var ejs=require(_0x84ca('0x9'));var fs=require('fs');var fs_extra=require(_0x84ca('0xa'));var _=require(_0x84ca('0xb'));var squel=require(_0x84ca('0xc'));var crypto=require(_0x84ca('0xd'));var jsforce=require(_0x84ca('0xe'));var deskjs=require(_0x84ca('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x84ca('0x10'));var Redis=require(_0x84ca('0x11'));var authService=require(_0x84ca('0x12'));var qs=require(_0x84ca('0x13'));var as=require(_0x84ca('0x14'));var hardwareService=require(_0x84ca('0x15'));var logger=require(_0x84ca('0x16'))('api');var utils=require(_0x84ca('0x17'));var config=require(_0x84ca('0x18'));var licenseUtil=require(_0x84ca('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x317c00,_0x26cb12){_0x26cb12=_0x26cb12||0xcc;return function(_0x1643a0){if(_0x1643a0){return _0x317c00[_0x84ca('0x1a')](_0x26cb12);}return _0x317c00[_0x84ca('0x1b')](_0x26cb12)[_0x84ca('0x1c')]();};}function respondWithResult(_0x12db28,_0x25e4e3){_0x25e4e3=_0x25e4e3||0xc8;return function(_0x3108d3){if(_0x3108d3){return _0x12db28['status'](_0x25e4e3)[_0x84ca('0x1d')](_0x3108d3);}};}function respondWithFilteredResult(_0x2d3ce5,_0x1e25e2){return function(_0x13b9d8){if(_0x13b9d8){var _0x41d876=typeof _0x1e25e2[_0x84ca('0x1e')]===_0x84ca('0x1f')&&typeof _0x1e25e2[_0x84ca('0x20')]===_0x84ca('0x1f');var _0x390d4e=_0x13b9d8[_0x84ca('0x21')];var _0x7bbc95=_0x41d876?0x0:_0x1e25e2[_0x84ca('0x1e')];var _0x4f83f1=_0x41d876?_0x13b9d8[_0x84ca('0x21')]:_0x1e25e2['offset']+_0x1e25e2[_0x84ca('0x20')];var _0x3946f5;if(_0x4f83f1>=_0x390d4e){_0x4f83f1=_0x390d4e;_0x3946f5=0xc8;}else{_0x3946f5=0xce;}_0x2d3ce5['status'](_0x3946f5);return _0x2d3ce5['set'](_0x84ca('0x22'),_0x7bbc95+'-'+_0x4f83f1+'/'+_0x390d4e)[_0x84ca('0x1d')](_0x13b9d8);}return null;};}function patchUpdates(_0xa56762){return function(_0x172ca5){try{jsonpatch[_0x84ca('0x23')](_0x172ca5,_0xa56762,!![]);}catch(_0x5787ea){return BPromise[_0x84ca('0x24')](_0x5787ea);}return _0x172ca5[_0x84ca('0x25')]();};}function saveUpdates(_0x1f5088,_0x42fa97){return function(_0x2e0e73){if(_0x2e0e73){return _0x2e0e73[_0x84ca('0x26')](_0x1f5088)[_0x84ca('0x27')](function(_0x4c7ac9){return _0x4c7ac9;});}return null;};}function removeEntity(_0x47b1aa,_0x15f9e5){return function(_0x2aab2e){if(_0x2aab2e){return _0x2aab2e['destroy']()[_0x84ca('0x27')](function(){_0x47b1aa[_0x84ca('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de1c9,_0x1568df){return function(_0x3aa321){if(!_0x3aa321){_0x3de1c9[_0x84ca('0x1a')](0x194);}return _0x3aa321;};}function handleError(_0x13fff8,_0x536a2b){_0x536a2b=_0x536a2b||0x1f4;return function(_0x2090c7){logger[_0x84ca('0x28')](_0x2090c7[_0x84ca('0x29')]);if(_0x2090c7[_0x84ca('0x2a')]){delete _0x2090c7[_0x84ca('0x2a')];}_0x13fff8['status'](_0x536a2b)[_0x84ca('0x2b')](_0x2090c7);};}exports[_0x84ca('0x2c')]=function(_0x498ab2,_0x23fbec){var _0x4db847={},_0x2396d1={},_0x4a7574={'count':0x0,'rows':[]};var _0x32ff94=_[_0x84ca('0x2d')](db[_0x84ca('0x2e')][_0x84ca('0x2f')],function(_0x29447c){return{'name':_0x29447c[_0x84ca('0x30')],'type':_0x29447c[_0x84ca('0x31')][_0x84ca('0x32')]};});_0x2396d1[_0x84ca('0x33')]=_[_0x84ca('0x2d')](_0x32ff94,'name');_0x2396d1['query']=_[_0x84ca('0x34')](_0x498ab2['query']);_0x2396d1['filters']=_['intersection'](_0x2396d1[_0x84ca('0x33')],_0x2396d1[_0x84ca('0x35')]);_0x4db847[_0x84ca('0x36')]=_[_0x84ca('0x37')](_0x2396d1['model'],qs['fields'](_0x498ab2[_0x84ca('0x35')][_0x84ca('0x38')]));_0x4db847['attributes']=_0x4db847[_0x84ca('0x36')][_0x84ca('0x39')]?_0x4db847[_0x84ca('0x36')]:_0x2396d1['model'];if(!_0x498ab2[_0x84ca('0x35')][_0x84ca('0x3a')]('nolimit')){_0x4db847[_0x84ca('0x20')]=qs[_0x84ca('0x20')](_0x498ab2[_0x84ca('0x35')]['limit']);_0x4db847['offset']=qs[_0x84ca('0x1e')](_0x498ab2[_0x84ca('0x35')][_0x84ca('0x1e')]);}_0x4db847[_0x84ca('0x3b')]=qs['sort'](_0x498ab2['query']['sort']);_0x4db847[_0x84ca('0x3c')]=qs[_0x84ca('0x3d')](_['pick'](_0x498ab2['query'],_0x2396d1[_0x84ca('0x3d')]),_0x32ff94);if(_0x498ab2[_0x84ca('0x35')][_0x84ca('0x3e')]){_0x4db847['where']=_[_0x84ca('0x3f')](_0x4db847[_0x84ca('0x3c')],{'$or':_['map'](_0x32ff94,function(_0x63e80d){if(_0x63e80d[_0x84ca('0x31')]!==_0x84ca('0x40')){var _0x2cb57b={};_0x2cb57b[_0x63e80d[_0x84ca('0x2a')]]={'$like':'%'+_0x498ab2['query'][_0x84ca('0x3e')]+'%'};return _0x2cb57b;}})});}_0x4db847=_[_0x84ca('0x3f')]({},_0x4db847,_0x498ab2[_0x84ca('0x41')]);var _0x593876={'where':_0x4db847[_0x84ca('0x3c')]};return db['ServicenowField']['count'](_0x593876)[_0x84ca('0x27')](function(_0xa040f8){_0x4a7574[_0x84ca('0x21')]=_0xa040f8;if(_0x498ab2[_0x84ca('0x35')][_0x84ca('0x42')]){_0x4db847[_0x84ca('0x43')]=[{'all':!![]}];}return db[_0x84ca('0x2e')][_0x84ca('0x44')](_0x4db847);})[_0x84ca('0x27')](function(_0x565f54){_0x4a7574['rows']=_0x565f54;return _0x4a7574;})[_0x84ca('0x27')](respondWithFilteredResult(_0x23fbec,_0x4db847))[_0x84ca('0x45')](handleError(_0x23fbec,null));};exports[_0x84ca('0x46')]=function(_0x34bed5,_0x332a4e){var _0x57d328={'raw':!![],'where':{'id':_0x34bed5[_0x84ca('0x47')]['id']}},_0x216a09={};_0x216a09[_0x84ca('0x33')]=_['keys'](db[_0x84ca('0x2e')][_0x84ca('0x2f')]);_0x216a09[_0x84ca('0x35')]=_[_0x84ca('0x34')](_0x34bed5[_0x84ca('0x35')]);_0x216a09[_0x84ca('0x3d')]=_[_0x84ca('0x37')](_0x216a09['model'],_0x216a09['query']);_0x57d328[_0x84ca('0x36')]=_[_0x84ca('0x37')](_0x216a09['model'],qs['fields'](_0x34bed5[_0x84ca('0x35')][_0x84ca('0x38')]));_0x57d328[_0x84ca('0x36')]=_0x57d328[_0x84ca('0x36')]['length']?_0x57d328[_0x84ca('0x36')]:_0x216a09['model'];if(_0x34bed5[_0x84ca('0x35')]['includeAll']){_0x57d328[_0x84ca('0x43')]=[{'all':!![]}];}_0x57d328=_[_0x84ca('0x3f')]({},_0x57d328,_0x34bed5[_0x84ca('0x41')]);return db[_0x84ca('0x2e')][_0x84ca('0x48')](_0x57d328)[_0x84ca('0x27')](handleEntityNotFound(_0x332a4e,null))[_0x84ca('0x27')](respondWithResult(_0x332a4e,null))[_0x84ca('0x45')](handleError(_0x332a4e,null));};exports[_0x84ca('0x49')]=function(_0x4658a2,_0x5b3fb0){return db['ServicenowField'][_0x84ca('0x49')](_0x4658a2['body'],{})[_0x84ca('0x27')](respondWithResult(_0x5b3fb0,0xc9))[_0x84ca('0x45')](handleError(_0x5b3fb0,null));};exports[_0x84ca('0x26')]=function(_0x100c4e,_0x2d841e){if(_0x100c4e[_0x84ca('0x4a')]['id']){delete _0x100c4e[_0x84ca('0x4a')]['id'];}return db[_0x84ca('0x2e')][_0x84ca('0x48')]({'where':{'id':_0x100c4e[_0x84ca('0x47')]['id']}})[_0x84ca('0x27')](handleEntityNotFound(_0x2d841e,null))[_0x84ca('0x27')](saveUpdates(_0x100c4e[_0x84ca('0x4a')],null))[_0x84ca('0x27')](respondWithResult(_0x2d841e,null))[_0x84ca('0x45')](handleError(_0x2d841e,null));};exports[_0x84ca('0x4b')]=function(_0x3d375c,_0x56c004){return db['ServicenowField'][_0x84ca('0x48')]({'where':{'id':_0x3d375c[_0x84ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x56c004,null))['then'](removeEntity(_0x56c004,null))[_0x84ca('0x45')](handleError(_0x56c004,null));};
\ No newline at end of file
index 4b139dd..94d3990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4d9=['moment','bluebird','path','../../config/environment','./intServicenowField.attributes','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0xc4d9,0x1b6));var _0x9c4d=function(_0x3e3bd2,_0x517868){_0x3e3bd2=_0x3e3bd2-0x0;var _0x370287=_0xc4d9[_0x3e3bd2];return _0x370287;};'use strict';var _=require(_0x9c4d('0x0'));var util=require(_0x9c4d('0x1'));var logger=require(_0x9c4d('0x2'))(_0x9c4d('0x3'));var moment=require(_0x9c4d('0x4'));var BPromise=require(_0x9c4d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c4d('0x6'));var rimraf=require('rimraf');var config=require(_0x9c4d('0x7'));var attributes=require(_0x9c4d('0x8'));module['exports']=function(_0x7277ad,_0x34c923){return _0x7277ad['define'](_0x9c4d('0x9'),attributes,{'tableName':_0x9c4d('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x9c4d('0xb'),_0x9c4d('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd500=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xd500,0x1cb));var _0x0d50=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xd500[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0d50('0x0'));var util=require(_0x0d50('0x1'));var logger=require(_0x0d50('0x2'))(_0x0d50('0x3'));var moment=require(_0x0d50('0x4'));var BPromise=require(_0x0d50('0x5'));var rp=require(_0x0d50('0x6'));var fs=require('fs');var path=require(_0x0d50('0x7'));var rimraf=require(_0x0d50('0x8'));var config=require(_0x0d50('0x9'));var attributes=require(_0x0d50('0xa'));module[_0x0d50('0xb')]=function(_0x160a58,_0xc359ac){return _0x160a58[_0x0d50('0xc')]('ServicenowField',attributes,{'tableName':_0x0d50('0xd'),'paranoid':![],'indexes':[{'name':_0x0d50('0xe'),'fields':[_0x0d50('0xf'),_0x0d50('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 26b7116..944e12f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x30029e,_0x20e7f8){var _0x293639=function(_0xb759b8){while(--_0xb759b8){_0x30029e['push'](_0x30029e['shift']());}};_0x293639(++_0x20e7f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x2fbfdf,_0x2aae62){var _0x2f8030=function(_0x19d1bc){while(--_0x19d1bc){_0x2fbfdf['push'](_0x2fbfdf['shift']());}};_0x2f8030(++_0x2aae62);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x31dde9,_0x12e816){_0x31dde9=_0x31dde9-0x0;var _0x1fbf2d=_0xcb91[_0x31dde9];return _0x1fbf2d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
index 43fc914..69dcf56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x11e8e8,_0x37811f){var _0x3a2c46=function(_0xf3eb87){while(--_0xf3eb87){_0x11e8e8['push'](_0x11e8e8['shift']());}};_0x3a2c46(++_0x37811f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x309931,_0x47085e){var _0x4c6ecb=function(_0x3ce378){while(--_0x3ce378){_0x309931['push'](_0x309931['shift']());}};_0x4c6ecb(++_0x47085e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index ae51745..754280e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x40eb7e,_0x406357){var _0x3f45de=function(_0xec3a1c){while(--_0xec3a1c){_0x40eb7e['push'](_0x40eb7e['shift']());}};_0x3f45de(++_0x406357);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xb313c5,_0x1f2a4c){var _0x7c963e=function(_0x272508){while(--_0x272508){_0xb313c5['push'](_0xb313c5['shift']());}};_0x7c963e(++_0x1f2a4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 8356ae7..a38df5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b6a=['stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','%s%s','/service/v4_1/rest.php','JSON','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','apply','update','then','name','send','index','map','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','SugarcrmAccount','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','login'];(function(_0x20ff9e,_0x4e97d6){var _0x37b814=function(_0x5786a0){while(--_0x5786a0){_0x20ff9e['push'](_0x20ff9e['shift']());}};_0x37b814(++_0x4e97d6);}(_0x3b6a,0x184));var _0xa3b6=function(_0x2f88bf,_0x761a0e){_0x2f88bf=_0x2f88bf-0x0;var _0x1b451e=_0x3b6a[_0x2f88bf];return _0x1b451e;};'use strict';var emlformat=require(_0xa3b6('0x0'));var rimraf=require(_0xa3b6('0x1'));var zipdir=require(_0xa3b6('0x2'));var jsonpatch=require(_0xa3b6('0x3'));var rp=require(_0xa3b6('0x4'));var moment=require('moment');var BPromise=require(_0xa3b6('0x5'));var Mustache=require(_0xa3b6('0x6'));var util=require(_0xa3b6('0x7'));var path=require(_0xa3b6('0x8'));var sox=require(_0xa3b6('0x9'));var csv=require('to-csv');var ejs=require(_0xa3b6('0xa'));var fs=require('fs');var fs_extra=require(_0xa3b6('0xb'));var _=require(_0xa3b6('0xc'));var squel=require(_0xa3b6('0xd'));var crypto=require(_0xa3b6('0xe'));var jsforce=require(_0xa3b6('0xf'));var deskjs=require(_0xa3b6('0x10'));var toCsv=require(_0xa3b6('0x11'));var querystring=require(_0xa3b6('0x12'));var Papa=require(_0xa3b6('0x13'));var Redis=require(_0xa3b6('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xa3b6('0x15'));var as=require(_0xa3b6('0x16'));var hardwareService=require(_0xa3b6('0x17'));var logger=require(_0xa3b6('0x18'))(_0xa3b6('0x19'));var utils=require(_0xa3b6('0x1a'));var config=require(_0xa3b6('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa3b6('0x1c'))['db'];var integrations=require(_0xa3b6('0x1d'));function respondWithStatusCode(_0x33a7bf,_0x4140e1){_0x4140e1=_0x4140e1||0xcc;return function(_0x50dbd3){if(_0x50dbd3){return _0x33a7bf[_0xa3b6('0x1e')](_0x4140e1);}return _0x33a7bf['status'](_0x4140e1)[_0xa3b6('0x1f')]();};}function respondWithResult(_0x54dd57,_0x155b66){_0x155b66=_0x155b66||0xc8;return function(_0x21d7d3){if(_0x21d7d3){return _0x54dd57[_0xa3b6('0x20')](_0x155b66)[_0xa3b6('0x21')](_0x21d7d3);}};}function respondWithFilteredResult(_0x309592,_0x26a1c2){return function(_0x156726){if(_0x156726){var _0x22cdae=typeof _0x26a1c2[_0xa3b6('0x22')]===_0xa3b6('0x23')&&typeof _0x26a1c2['limit']===_0xa3b6('0x23');var _0x25e3ec=_0x156726['count'];var _0xdf1034=_0x22cdae?0x0:_0x26a1c2['offset'];var _0xbabdd1=_0x22cdae?_0x156726[_0xa3b6('0x24')]:_0x26a1c2[_0xa3b6('0x22')]+_0x26a1c2['limit'];var _0x1c8376;if(_0xbabdd1>=_0x25e3ec){_0xbabdd1=_0x25e3ec;_0x1c8376=0xc8;}else{_0x1c8376=0xce;}_0x309592[_0xa3b6('0x20')](_0x1c8376);return _0x309592['set']('Content-Range',_0xdf1034+'-'+_0xbabdd1+'/'+_0x25e3ec)[_0xa3b6('0x21')](_0x156726);}return null;};}function patchUpdates(_0x506124){return function(_0x4c8837){try{jsonpatch[_0xa3b6('0x25')](_0x4c8837,_0x506124,!![]);}catch(_0x47bfa2){return BPromise['reject'](_0x47bfa2);}return _0x4c8837['save']();};}function saveUpdates(_0x506e47,_0x44cf64){return function(_0x22e7f1){if(_0x22e7f1){return _0x22e7f1[_0xa3b6('0x26')](_0x506e47)[_0xa3b6('0x27')](function(_0x34978d){return _0x34978d;});}return null;};}function removeEntity(_0x19a02f,_0x47c96f){return function(_0x2e2ff9){if(_0x2e2ff9){return _0x2e2ff9['destroy']()[_0xa3b6('0x27')](function(){_0x19a02f[_0xa3b6('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bb662,_0x561934){return function(_0x269487){if(!_0x269487){_0x3bb662['sendStatus'](0x194);}return _0x269487;};}function handleError(_0x48356a,_0x56de55){_0x56de55=_0x56de55||0x1f4;return function(_0x309ea2){logger['error'](_0x309ea2['stack']);if(_0x309ea2[_0xa3b6('0x28')]){delete _0x309ea2[_0xa3b6('0x28')];}_0x48356a[_0xa3b6('0x20')](_0x56de55)[_0xa3b6('0x29')](_0x309ea2);};}exports[_0xa3b6('0x2a')]=function(_0x5b3599,_0xbf2c48){var _0x1f17b3={},_0x507b36={},_0x20ce5d={'count':0x0,'rows':[]};var _0x27062f=_[_0xa3b6('0x2b')](db['SugarcrmAccount'][_0xa3b6('0x2c')],function(_0x4d40ef){return{'name':_0x4d40ef['fieldName'],'type':_0x4d40ef[_0xa3b6('0x2d')][_0xa3b6('0x2e')]};});_0x507b36['model']=_[_0xa3b6('0x2b')](_0x27062f,_0xa3b6('0x28'));_0x507b36[_0xa3b6('0x2f')]=_[_0xa3b6('0x30')](_0x5b3599[_0xa3b6('0x2f')]);_0x507b36['filters']=_[_0xa3b6('0x31')](_0x507b36['model'],_0x507b36[_0xa3b6('0x2f')]);_0x1f17b3[_0xa3b6('0x32')]=_[_0xa3b6('0x31')](_0x507b36[_0xa3b6('0x33')],qs[_0xa3b6('0x34')](_0x5b3599['query']['fields']));_0x1f17b3[_0xa3b6('0x32')]=_0x1f17b3[_0xa3b6('0x32')][_0xa3b6('0x35')]?_0x1f17b3[_0xa3b6('0x32')]:_0x507b36[_0xa3b6('0x33')];if(!_0x5b3599[_0xa3b6('0x2f')][_0xa3b6('0x36')](_0xa3b6('0x37'))){_0x1f17b3[_0xa3b6('0x38')]=qs[_0xa3b6('0x38')](_0x5b3599[_0xa3b6('0x2f')][_0xa3b6('0x38')]);_0x1f17b3[_0xa3b6('0x22')]=qs[_0xa3b6('0x22')](_0x5b3599[_0xa3b6('0x2f')]['offset']);}_0x1f17b3[_0xa3b6('0x39')]=qs['sort'](_0x5b3599[_0xa3b6('0x2f')][_0xa3b6('0x3a')]);_0x1f17b3[_0xa3b6('0x3b')]=qs[_0xa3b6('0x3c')](_[_0xa3b6('0x3d')](_0x5b3599[_0xa3b6('0x2f')],_0x507b36[_0xa3b6('0x3c')]),_0x27062f);if(_0x5b3599[_0xa3b6('0x2f')][_0xa3b6('0x3e')]){_0x1f17b3[_0xa3b6('0x3b')]=_[_0xa3b6('0x3f')](_0x1f17b3[_0xa3b6('0x3b')],{'$or':_['map'](_0x27062f,function(_0x2931fd){if(_0x2931fd['type']!=='VIRTUAL'){var _0x1761be={};_0x1761be[_0x2931fd[_0xa3b6('0x28')]]={'$like':'%'+_0x5b3599[_0xa3b6('0x2f')][_0xa3b6('0x3e')]+'%'};return _0x1761be;}})});}_0x1f17b3=_[_0xa3b6('0x3f')]({},_0x1f17b3,_0x5b3599[_0xa3b6('0x40')]);var _0x4e350b={'where':_0x1f17b3[_0xa3b6('0x3b')]};return db[_0xa3b6('0x41')][_0xa3b6('0x24')](_0x4e350b)['then'](function(_0x2433a3){_0x20ce5d[_0xa3b6('0x24')]=_0x2433a3;if(_0x5b3599[_0xa3b6('0x2f')][_0xa3b6('0x42')]){_0x1f17b3['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xa3b6('0x43')](_0x1f17b3);})[_0xa3b6('0x27')](function(_0x30f596){_0x20ce5d[_0xa3b6('0x44')]=_0x30f596;return _0x20ce5d;})[_0xa3b6('0x27')](respondWithFilteredResult(_0xbf2c48,_0x1f17b3))[_0xa3b6('0x45')](handleError(_0xbf2c48,null));};exports[_0xa3b6('0x46')]=function(_0x202cdf,_0x2bd4ee){var _0x59d491={'raw':![],'where':{'id':_0x202cdf['params']['id']}},_0x4f2cbd={};_0x4f2cbd[_0xa3b6('0x33')]=_[_0xa3b6('0x30')](db[_0xa3b6('0x41')]['rawAttributes']);_0x4f2cbd[_0xa3b6('0x2f')]=_[_0xa3b6('0x30')](_0x202cdf[_0xa3b6('0x2f')]);_0x4f2cbd[_0xa3b6('0x3c')]=_[_0xa3b6('0x31')](_0x4f2cbd[_0xa3b6('0x33')],_0x4f2cbd['query']);_0x59d491[_0xa3b6('0x32')]=_[_0xa3b6('0x31')](_0x4f2cbd['model'],qs['fields'](_0x202cdf[_0xa3b6('0x2f')][_0xa3b6('0x34')]));_0x59d491[_0xa3b6('0x32')]=_0x59d491[_0xa3b6('0x32')][_0xa3b6('0x35')]?_0x59d491[_0xa3b6('0x32')]:_0x4f2cbd[_0xa3b6('0x33')];if(_0x202cdf[_0xa3b6('0x2f')][_0xa3b6('0x42')]){_0x59d491[_0xa3b6('0x47')]=[{'all':!![]}];}_0x59d491=_['merge']({},_0x59d491,_0x202cdf[_0xa3b6('0x40')]);return db[_0xa3b6('0x41')][_0xa3b6('0x48')](_0x59d491)[_0xa3b6('0x27')](handleEntityNotFound(_0x2bd4ee,null))[_0xa3b6('0x27')](respondWithResult(_0x2bd4ee,null))[_0xa3b6('0x45')](handleError(_0x2bd4ee,null));};exports[_0xa3b6('0x49')]=function(_0x235d23,_0x1274ee){return db[_0xa3b6('0x41')][_0xa3b6('0x49')](_0x235d23['body'],{})[_0xa3b6('0x27')](respondWithResult(_0x1274ee,0xc9))['catch'](handleError(_0x1274ee,null));};exports[_0xa3b6('0x26')]=function(_0x389ab1,_0x46879e){if(_0x389ab1[_0xa3b6('0x4a')]['id']){delete _0x389ab1['body']['id'];}return db[_0xa3b6('0x41')][_0xa3b6('0x48')]({'where':{'id':_0x389ab1[_0xa3b6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46879e,null))[_0xa3b6('0x27')](saveUpdates(_0x389ab1['body'],null))[_0xa3b6('0x27')](respondWithResult(_0x46879e,null))[_0xa3b6('0x45')](handleError(_0x46879e,null));};exports[_0xa3b6('0x4c')]=function(_0x460eb1,_0xe551d3){return db[_0xa3b6('0x41')][_0xa3b6('0x48')]({'where':{'id':_0x460eb1['params']['id']}})['then'](handleEntityNotFound(_0xe551d3,null))[_0xa3b6('0x27')](removeEntity(_0xe551d3,null))[_0xa3b6('0x45')](handleError(_0xe551d3,null));};exports[_0xa3b6('0x4d')]=function(_0x55f7c6,_0x4fa174,_0x269313){var _0x280970={};var _0x47dd0a={};var _0x599e19;var _0x168b0c;return db[_0xa3b6('0x41')][_0xa3b6('0x4e')]({'where':{'id':_0x55f7c6[_0xa3b6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fa174,null))[_0xa3b6('0x27')](function(_0x2ccf5e){if(_0x2ccf5e){_0x599e19=_0x2ccf5e;_0x47dd0a[_0xa3b6('0x33')]=_['keys'](db['SugarcrmConfiguration'][_0xa3b6('0x2c')]);_0x47dd0a['query']=_[_0xa3b6('0x30')](_0x55f7c6[_0xa3b6('0x2f')]);_0x47dd0a['filters']=_[_0xa3b6('0x31')](_0x47dd0a[_0xa3b6('0x33')],_0x47dd0a[_0xa3b6('0x2f')]);_0x280970[_0xa3b6('0x32')]=_[_0xa3b6('0x31')](_0x47dd0a[_0xa3b6('0x33')],qs[_0xa3b6('0x34')](_0x55f7c6[_0xa3b6('0x2f')]['fields']));_0x280970[_0xa3b6('0x32')]=_0x280970[_0xa3b6('0x32')][_0xa3b6('0x35')]?_0x280970[_0xa3b6('0x32')]:_0x47dd0a[_0xa3b6('0x33')];_0x280970[_0xa3b6('0x39')]=qs[_0xa3b6('0x3a')](_0x55f7c6['query']['sort']);_0x280970[_0xa3b6('0x3b')]=qs[_0xa3b6('0x3c')](_[_0xa3b6('0x3d')](_0x55f7c6['query'],_0x47dd0a['filters']));if(_0x55f7c6[_0xa3b6('0x2f')][_0xa3b6('0x3e')]){_0x280970[_0xa3b6('0x3b')]=_['merge'](_0x280970[_0xa3b6('0x3b')],{'$or':_[_0xa3b6('0x2b')](_0x280970['attributes'],function(_0x776bc5){var _0xc72b14={};_0xc72b14[_0x776bc5]={'$like':'%'+_0x55f7c6[_0xa3b6('0x2f')][_0xa3b6('0x3e')]+'%'};return _0xc72b14;})});}_0x280970=_[_0xa3b6('0x3f')]({},_0x280970,_0x55f7c6[_0xa3b6('0x40')]);return _0x599e19[_0xa3b6('0x4d')](_0x280970);}})[_0xa3b6('0x27')](function(_0x320743){if(_0x320743){_0x168b0c=_0x320743['length'];if(!_0x55f7c6[_0xa3b6('0x2f')][_0xa3b6('0x36')]('nolimit')){_0x280970['limit']=qs[_0xa3b6('0x38')](_0x55f7c6['query'][_0xa3b6('0x38')]);_0x280970[_0xa3b6('0x22')]=qs[_0xa3b6('0x22')](_0x55f7c6['query'][_0xa3b6('0x22')]);}return _0x599e19[_0xa3b6('0x4d')](_0x280970);}})[_0xa3b6('0x27')](function(_0x920dd2){if(_0x920dd2){return _0x920dd2?{'count':_0x168b0c,'rows':_0x920dd2}:null;}})['then'](respondWithResult(_0x4fa174,null))[_0xa3b6('0x45')](handleError(_0x4fa174,null));};exports['addConfiguration']=function(_0x4ada8a,_0x462585,_0x3b54d7){if(_0x4ada8a['body']['id']){delete _0x4ada8a[_0xa3b6('0x4a')]['id'];}return db[_0xa3b6('0x41')][_0xa3b6('0x4e')]({'where':{'id':_0x4ada8a['params']['id']}})[_0xa3b6('0x27')](handleEntityNotFound(_0x462585,null))['then'](function(_0x5d1261){if(_0x5d1261){_0x4ada8a['body'][_0xa3b6('0x4f')]=_0x5d1261['id'];_0x4ada8a['body'][_0xa3b6('0x50')]=integrations[_0xa3b6('0x51')](_0x4ada8a['body'][_0xa3b6('0x52')],_0x4ada8a['body'][_0xa3b6('0x2d')]);_0x4ada8a[_0xa3b6('0x4a')][_0xa3b6('0x53')]=integrations[_0xa3b6('0x54')](_0x4ada8a['body'][_0xa3b6('0x52')],_0x4ada8a[_0xa3b6('0x4a')]['type']);return db[_0xa3b6('0x55')][_0xa3b6('0x49')](_0x4ada8a['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xa3b6('0x50')},{'model':db[_0xa3b6('0x56')],'as':_0xa3b6('0x53')}]});}return null;})[_0xa3b6('0x27')](respondWithResult(_0x462585,null))[_0xa3b6('0x45')](handleError(_0x462585,null));};exports[_0xa3b6('0x57')]=function(_0x5db043,_0x57d1f2,_0x5baff5){var _0x59c51e='';var _0x343b76=['id',_0xa3b6('0x28'),_0xa3b6('0x58'),'created_by',_0xa3b6('0x59'),_0xa3b6('0x5a'),'duration_hours',_0xa3b6('0x5b'),_0xa3b6('0x5c'),_0xa3b6('0x5d'),_0xa3b6('0x5e'),_0xa3b6('0x5f')];return db[_0xa3b6('0x41')]['findOne']({'where':{'id':_0x5db043[_0xa3b6('0x4b')]['id']},'attributes':['id',_0xa3b6('0x60'),_0xa3b6('0x61'),_0xa3b6('0x62')]})[_0xa3b6('0x27')](handleEntityNotFound(_0x57d1f2,null))[_0xa3b6('0x27')](function(_0x585315){if(_0x585315){_0x59c51e=_0x585315['remoteUri'];var _0x3d1327=_0x59c51e['slice'](-0x1);if(_0x3d1327==='/'){_0x59c51e=_0x59c51e[_0xa3b6('0x63')](0x0,_0x59c51e[_0xa3b6('0x64')](_0x3d1327));}return rp({'method':_0xa3b6('0x65'),'uri':util[_0xa3b6('0x66')]('%s%s',_0x59c51e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa3b6('0x67'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa3b6('0x68')]({'user_auth':{'user_name':_0x585315[_0xa3b6('0x60')],'password':_0x585315[_0xa3b6('0x61')],'encryption':'PLAIN'},'application':_0xa3b6('0x69')})}});}})[_0xa3b6('0x27')](function(_0x51e6bb){if(_0x51e6bb&&_0x51e6bb[_0xa3b6('0x28')]!==_0xa3b6('0x6a')&&_0x51e6bb['name']!=='Password\x20Expired'){return rp({'method':_0xa3b6('0x65'),'uri':util['format'](_0xa3b6('0x6b'),_0x59c51e,_0xa3b6('0x6c')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xa3b6('0x6d'),'response_type':_0xa3b6('0x6d'),'rest_data':JSON[_0xa3b6('0x68')]({'session':_0x51e6bb['id'],'module_name':_0xa3b6('0x6e')})}})[_0xa3b6('0x27')](function(_0x1c86eb){if(_0x1c86eb){var _0x2d53cb=_[_0xa3b6('0x6f')](_0x1c86eb[_0xa3b6('0x70')]);_[_0xa3b6('0x71')](_0x2d53cb,function(_0x1ab004){return _0x343b76[_0xa3b6('0x72')](_0x1ab004[_0xa3b6('0x28')]);});return{'count':_0x2d53cb[_0xa3b6('0x35')],'rows':_[_0xa3b6('0x2b')](_0x2d53cb,function(_0x26db35){return{'id':_0x26db35['name'],'name':_0x26db35[_0xa3b6('0x73')],'custom':_[_0xa3b6('0x74')](_0x26db35['name'],'_c')?!![]:![],'options':_0x26db35[_0xa3b6('0x40')]?_[_0xa3b6('0x2b')](_[_0xa3b6('0x6f')](_0x26db35[_0xa3b6('0x40')]),function(_0x13ef95){return{'name':_0x13ef95[_0xa3b6('0x75')],'value':_0x13ef95[_0xa3b6('0x28')]};}):[]};})};}})[_0xa3b6('0x27')](respondWithResult(_0x57d1f2,null))[_0xa3b6('0x45')](function(_0x5ae3b3){var _0x8ec394=_0x5db043[_0xa3b6('0x2f')][_0xa3b6('0x76')]?0x1f4:_0x5ae3b3[_0xa3b6('0x77')]||0x1f4;logger[_0xa3b6('0x78')](_0xa3b6('0x79'),_0xa3b6('0x57'),_0x8ec394,JSON[_0xa3b6('0x68')](_0x5ae3b3));delete _0x5ae3b3['name'];if(_0x8ec394===0x191){_0x8ec394=0x190;}_0x57d1f2[_0xa3b6('0x20')](_0x8ec394)['send'](_0x5db043[_0xa3b6('0x2f')][_0xa3b6('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x5ae3b3[_0xa3b6('0x77')]}:_0x5ae3b3);});}else{var _0xc9d166=0x1f4;_0x57d1f2[_0xa3b6('0x20')](_0xc9d166)[_0xa3b6('0x29')]({'message':_0xa3b6('0x7a'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xdd5f=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','SugarcrmAccount','rawAttributes','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','name','merge','options','includeAll','include','rows','catch','show','fields','length','create','body','find','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','direction','username','password','remoteUri','slice','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','module_fields','remove','includes','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','lodash','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x48f80a,_0x3bb5d4){var _0x1327fb=function(_0x46293e){while(--_0x46293e){_0x48f80a['push'](_0x48f80a['shift']());}};_0x1327fb(++_0x3bb5d4);}(_0xdd5f,0xd5));var _0xfdd5=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xdd5f[_0x166d93];return _0xba708;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdd5('0x0'));var zipdir=require(_0xfdd5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfdd5('0x3'));var util=require(_0xfdd5('0x4'));var path=require(_0xfdd5('0x5'));var sox=require(_0xfdd5('0x6'));var csv=require(_0xfdd5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfdd5('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdd5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xfdd5('0x7'));var querystring=require(_0xfdd5('0xa'));var Papa=require('papaparse');var Redis=require(_0xfdd5('0xb'));var authService=require(_0xfdd5('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd5('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfdd5('0xe'))('api');var utils=require(_0xfdd5('0xf'));var config=require(_0xfdd5('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xfdd5('0x11'))['db'];var integrations=require(_0xfdd5('0x12'));function respondWithStatusCode(_0x2c1544,_0x21333b){_0x21333b=_0x21333b||0xcc;return function(_0x5eeb56){if(_0x5eeb56){return _0x2c1544[_0xfdd5('0x13')](_0x21333b);}return _0x2c1544[_0xfdd5('0x14')](_0x21333b)['end']();};}function respondWithResult(_0x66d7f3,_0x248fb5){_0x248fb5=_0x248fb5||0xc8;return function(_0x272a65){if(_0x272a65){return _0x66d7f3[_0xfdd5('0x14')](_0x248fb5)[_0xfdd5('0x15')](_0x272a65);}};}function respondWithFilteredResult(_0x1b1546,_0x4b83b1){return function(_0x671fbf){if(_0x671fbf){var _0x271bb7=typeof _0x4b83b1[_0xfdd5('0x16')]===_0xfdd5('0x17')&&typeof _0x4b83b1[_0xfdd5('0x18')]==='undefined';var _0x3e05f9=_0x671fbf['count'];var _0x46d416=_0x271bb7?0x0:_0x4b83b1[_0xfdd5('0x16')];var _0x1e0e63=_0x271bb7?_0x671fbf[_0xfdd5('0x19')]:_0x4b83b1[_0xfdd5('0x16')]+_0x4b83b1['limit'];var _0x34ca47;if(_0x1e0e63>=_0x3e05f9){_0x1e0e63=_0x3e05f9;_0x34ca47=0xc8;}else{_0x34ca47=0xce;}_0x1b1546[_0xfdd5('0x14')](_0x34ca47);return _0x1b1546['set'](_0xfdd5('0x1a'),_0x46d416+'-'+_0x1e0e63+'/'+_0x3e05f9)[_0xfdd5('0x15')](_0x671fbf);}return null;};}function patchUpdates(_0x1dd9e4){return function(_0x185c50){try{jsonpatch[_0xfdd5('0x1b')](_0x185c50,_0x1dd9e4,!![]);}catch(_0x5652d7){return BPromise[_0xfdd5('0x1c')](_0x5652d7);}return _0x185c50[_0xfdd5('0x1d')]();};}function saveUpdates(_0x2ac3e8,_0x1983cc){return function(_0x2113a7){if(_0x2113a7){return _0x2113a7[_0xfdd5('0x1e')](_0x2ac3e8)[_0xfdd5('0x1f')](function(_0x14f312){return _0x14f312;});}return null;};}function removeEntity(_0x3cc88e,_0x575a54){return function(_0x89711f){if(_0x89711f){return _0x89711f[_0xfdd5('0x20')]()[_0xfdd5('0x1f')](function(){_0x3cc88e[_0xfdd5('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x92bc21,_0x2e380f){return function(_0x5449c5){if(!_0x5449c5){_0x92bc21[_0xfdd5('0x13')](0x194);}return _0x5449c5;};}function handleError(_0x13a030,_0x36076e){_0x36076e=_0x36076e||0x1f4;return function(_0x140244){logger[_0xfdd5('0x21')](_0x140244['stack']);if(_0x140244['name']){delete _0x140244['name'];}_0x13a030[_0xfdd5('0x14')](_0x36076e)[_0xfdd5('0x22')](_0x140244);};}exports[_0xfdd5('0x23')]=function(_0x1d5892,_0x203292){var _0x7f30bf={},_0xce400e={},_0x243492={'count':0x0,'rows':[]};var _0x1bbdae=_[_0xfdd5('0x24')](db[_0xfdd5('0x25')][_0xfdd5('0x26')],function(_0x2ddee5){return{'name':_0x2ddee5['fieldName'],'type':_0x2ddee5['type']['key']};});_0xce400e[_0xfdd5('0x27')]=_[_0xfdd5('0x24')](_0x1bbdae,'name');_0xce400e[_0xfdd5('0x28')]=_[_0xfdd5('0x29')](_0x1d5892[_0xfdd5('0x28')]);_0xce400e[_0xfdd5('0x2a')]=_['intersection'](_0xce400e[_0xfdd5('0x27')],_0xce400e[_0xfdd5('0x28')]);_0x7f30bf['attributes']=_[_0xfdd5('0x2b')](_0xce400e[_0xfdd5('0x27')],qs['fields'](_0x1d5892[_0xfdd5('0x28')]['fields']));_0x7f30bf[_0xfdd5('0x2c')]=_0x7f30bf[_0xfdd5('0x2c')]['length']?_0x7f30bf[_0xfdd5('0x2c')]:_0xce400e[_0xfdd5('0x27')];if(!_0x1d5892[_0xfdd5('0x28')][_0xfdd5('0x2d')](_0xfdd5('0x2e'))){_0x7f30bf[_0xfdd5('0x18')]=qs[_0xfdd5('0x18')](_0x1d5892[_0xfdd5('0x28')]['limit']);_0x7f30bf[_0xfdd5('0x16')]=qs[_0xfdd5('0x16')](_0x1d5892[_0xfdd5('0x28')][_0xfdd5('0x16')]);}_0x7f30bf[_0xfdd5('0x2f')]=qs[_0xfdd5('0x30')](_0x1d5892[_0xfdd5('0x28')][_0xfdd5('0x30')]);_0x7f30bf['where']=qs[_0xfdd5('0x2a')](_[_0xfdd5('0x31')](_0x1d5892[_0xfdd5('0x28')],_0xce400e[_0xfdd5('0x2a')]),_0x1bbdae);if(_0x1d5892[_0xfdd5('0x28')][_0xfdd5('0x32')]){_0x7f30bf[_0xfdd5('0x33')]=_['merge'](_0x7f30bf[_0xfdd5('0x33')],{'$or':_[_0xfdd5('0x24')](_0x1bbdae,function(_0xd784cd){if(_0xd784cd[_0xfdd5('0x34')]!==_0xfdd5('0x35')){var _0x59be9d={};_0x59be9d[_0xd784cd[_0xfdd5('0x36')]]={'$like':'%'+_0x1d5892[_0xfdd5('0x28')][_0xfdd5('0x32')]+'%'};return _0x59be9d;}})});}_0x7f30bf=_[_0xfdd5('0x37')]({},_0x7f30bf,_0x1d5892[_0xfdd5('0x38')]);var _0x1a4e75={'where':_0x7f30bf['where']};return db['SugarcrmAccount'][_0xfdd5('0x19')](_0x1a4e75)[_0xfdd5('0x1f')](function(_0x1f6124){_0x243492[_0xfdd5('0x19')]=_0x1f6124;if(_0x1d5892[_0xfdd5('0x28')][_0xfdd5('0x39')]){_0x7f30bf[_0xfdd5('0x3a')]=[{'all':!![]}];}return db[_0xfdd5('0x25')]['findAll'](_0x7f30bf);})[_0xfdd5('0x1f')](function(_0x49a699){_0x243492[_0xfdd5('0x3b')]=_0x49a699;return _0x243492;})[_0xfdd5('0x1f')](respondWithFilteredResult(_0x203292,_0x7f30bf))[_0xfdd5('0x3c')](handleError(_0x203292,null));};exports[_0xfdd5('0x3d')]=function(_0x3275c3,_0x138b40){var _0x2e9144={'raw':![],'where':{'id':_0x3275c3['params']['id']}},_0x9bbece={};_0x9bbece['model']=_[_0xfdd5('0x29')](db[_0xfdd5('0x25')][_0xfdd5('0x26')]);_0x9bbece[_0xfdd5('0x28')]=_[_0xfdd5('0x29')](_0x3275c3[_0xfdd5('0x28')]);_0x9bbece[_0xfdd5('0x2a')]=_[_0xfdd5('0x2b')](_0x9bbece['model'],_0x9bbece[_0xfdd5('0x28')]);_0x2e9144['attributes']=_[_0xfdd5('0x2b')](_0x9bbece[_0xfdd5('0x27')],qs[_0xfdd5('0x3e')](_0x3275c3[_0xfdd5('0x28')][_0xfdd5('0x3e')]));_0x2e9144[_0xfdd5('0x2c')]=_0x2e9144[_0xfdd5('0x2c')][_0xfdd5('0x3f')]?_0x2e9144[_0xfdd5('0x2c')]:_0x9bbece['model'];if(_0x3275c3[_0xfdd5('0x28')][_0xfdd5('0x39')]){_0x2e9144[_0xfdd5('0x3a')]=[{'all':!![]}];}_0x2e9144=_[_0xfdd5('0x37')]({},_0x2e9144,_0x3275c3[_0xfdd5('0x38')]);return db[_0xfdd5('0x25')]['find'](_0x2e9144)[_0xfdd5('0x1f')](handleEntityNotFound(_0x138b40,null))[_0xfdd5('0x1f')](respondWithResult(_0x138b40,null))['catch'](handleError(_0x138b40,null));};exports[_0xfdd5('0x40')]=function(_0x41a6b5,_0x110518){return db['SugarcrmAccount'][_0xfdd5('0x40')](_0x41a6b5[_0xfdd5('0x41')],{})[_0xfdd5('0x1f')](respondWithResult(_0x110518,0xc9))[_0xfdd5('0x3c')](handleError(_0x110518,null));};exports[_0xfdd5('0x1e')]=function(_0x2332bb,_0x362836){if(_0x2332bb[_0xfdd5('0x41')]['id']){delete _0x2332bb[_0xfdd5('0x41')]['id'];}return db[_0xfdd5('0x25')][_0xfdd5('0x42')]({'where':{'id':_0x2332bb['params']['id']}})[_0xfdd5('0x1f')](handleEntityNotFound(_0x362836,null))[_0xfdd5('0x1f')](saveUpdates(_0x2332bb['body'],null))['then'](respondWithResult(_0x362836,null))[_0xfdd5('0x3c')](handleError(_0x362836,null));};exports[_0xfdd5('0x20')]=function(_0x23dca7,_0x476fc4){return db[_0xfdd5('0x25')][_0xfdd5('0x42')]({'where':{'id':_0x23dca7[_0xfdd5('0x43')]['id']}})[_0xfdd5('0x1f')](handleEntityNotFound(_0x476fc4,null))[_0xfdd5('0x1f')](removeEntity(_0x476fc4,null))[_0xfdd5('0x3c')](handleError(_0x476fc4,null));};exports[_0xfdd5('0x44')]=function(_0x2e70e3,_0x3a0d92,_0x2f8629){var _0x25a43d={};var _0x38fe1c={};var _0x161b96;var _0x27b43f;return db[_0xfdd5('0x25')][_0xfdd5('0x45')]({'where':{'id':_0x2e70e3[_0xfdd5('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a0d92,null))['then'](function(_0x595099){if(_0x595099){_0x161b96=_0x595099;_0x38fe1c[_0xfdd5('0x27')]=_['keys'](db[_0xfdd5('0x46')][_0xfdd5('0x26')]);_0x38fe1c[_0xfdd5('0x28')]=_[_0xfdd5('0x29')](_0x2e70e3[_0xfdd5('0x28')]);_0x38fe1c[_0xfdd5('0x2a')]=_[_0xfdd5('0x2b')](_0x38fe1c[_0xfdd5('0x27')],_0x38fe1c[_0xfdd5('0x28')]);_0x25a43d[_0xfdd5('0x2c')]=_[_0xfdd5('0x2b')](_0x38fe1c[_0xfdd5('0x27')],qs['fields'](_0x2e70e3[_0xfdd5('0x28')][_0xfdd5('0x3e')]));_0x25a43d[_0xfdd5('0x2c')]=_0x25a43d[_0xfdd5('0x2c')][_0xfdd5('0x3f')]?_0x25a43d['attributes']:_0x38fe1c[_0xfdd5('0x27')];_0x25a43d[_0xfdd5('0x2f')]=qs[_0xfdd5('0x30')](_0x2e70e3[_0xfdd5('0x28')][_0xfdd5('0x30')]);_0x25a43d['where']=qs[_0xfdd5('0x2a')](_[_0xfdd5('0x31')](_0x2e70e3[_0xfdd5('0x28')],_0x38fe1c['filters']));if(_0x2e70e3[_0xfdd5('0x28')][_0xfdd5('0x32')]){_0x25a43d[_0xfdd5('0x33')]=_['merge'](_0x25a43d[_0xfdd5('0x33')],{'$or':_[_0xfdd5('0x24')](_0x25a43d['attributes'],function(_0x2cedc6){var _0x1d6e1f={};_0x1d6e1f[_0x2cedc6]={'$like':'%'+_0x2e70e3[_0xfdd5('0x28')]['filter']+'%'};return _0x1d6e1f;})});}_0x25a43d=_['merge']({},_0x25a43d,_0x2e70e3['options']);return _0x161b96[_0xfdd5('0x44')](_0x25a43d);}})[_0xfdd5('0x1f')](function(_0x3c3daf){if(_0x3c3daf){_0x27b43f=_0x3c3daf['length'];if(!_0x2e70e3[_0xfdd5('0x28')][_0xfdd5('0x2d')](_0xfdd5('0x2e'))){_0x25a43d[_0xfdd5('0x18')]=qs[_0xfdd5('0x18')](_0x2e70e3[_0xfdd5('0x28')]['limit']);_0x25a43d[_0xfdd5('0x16')]=qs[_0xfdd5('0x16')](_0x2e70e3['query'][_0xfdd5('0x16')]);}return _0x161b96[_0xfdd5('0x44')](_0x25a43d);}})[_0xfdd5('0x1f')](function(_0x388a15){if(_0x388a15){return _0x388a15?{'count':_0x27b43f,'rows':_0x388a15}:null;}})[_0xfdd5('0x1f')](respondWithResult(_0x3a0d92,null))[_0xfdd5('0x3c')](handleError(_0x3a0d92,null));};exports[_0xfdd5('0x47')]=function(_0x58b715,_0x38351a,_0x41476c){if(_0x58b715['body']['id']){delete _0x58b715['body']['id'];}return db[_0xfdd5('0x25')][_0xfdd5('0x45')]({'where':{'id':_0x58b715[_0xfdd5('0x43')]['id']}})[_0xfdd5('0x1f')](handleEntityNotFound(_0x38351a,null))[_0xfdd5('0x1f')](function(_0x326b30){if(_0x326b30){_0x58b715[_0xfdd5('0x41')][_0xfdd5('0x48')]=_0x326b30['id'];_0x58b715['body'][_0xfdd5('0x49')]=integrations[_0xfdd5('0x4a')](_0x58b715['body'][_0xfdd5('0x4b')],_0x58b715[_0xfdd5('0x41')]['type']);_0x58b715[_0xfdd5('0x41')][_0xfdd5('0x4c')]=integrations['getDescriptions'](_0x58b715['body'][_0xfdd5('0x4b')],_0x58b715[_0xfdd5('0x41')]['type']);return db[_0xfdd5('0x46')][_0xfdd5('0x40')](_0x58b715[_0xfdd5('0x41')],{'include':[{'model':db[_0xfdd5('0x4d')],'as':_0xfdd5('0x49')},{'model':db[_0xfdd5('0x4d')],'as':_0xfdd5('0x4c')}]});}return null;})[_0xfdd5('0x1f')](respondWithResult(_0x38351a,null))['catch'](handleError(_0x38351a,null));};exports[_0xfdd5('0x4e')]=function(_0x461b72,_0x150d5b,_0x395b08){var _0x4d70c9='';var _0x13209d=['id',_0xfdd5('0x36'),_0xfdd5('0x4f'),_0xfdd5('0x50'),_0xfdd5('0x51'),_0xfdd5('0x52'),'duration_hours',_0xfdd5('0x53'),_0xfdd5('0x54'),'parent_type','parent_name',_0xfdd5('0x55')];return db[_0xfdd5('0x25')][_0xfdd5('0x45')]({'where':{'id':_0x461b72[_0xfdd5('0x43')]['id']},'attributes':['id',_0xfdd5('0x56'),_0xfdd5('0x57'),_0xfdd5('0x58')]})[_0xfdd5('0x1f')](handleEntityNotFound(_0x150d5b,null))[_0xfdd5('0x1f')](function(_0x12dc49){if(_0x12dc49){_0x4d70c9=_0x12dc49[_0xfdd5('0x58')];var _0x5e1de3=_0x4d70c9[_0xfdd5('0x59')](-0x1);if(_0x5e1de3==='/'){_0x4d70c9=_0x4d70c9['substring'](0x0,_0x4d70c9[_0xfdd5('0x5a')](_0x5e1de3));}return rp({'method':_0xfdd5('0x5b'),'uri':util['format'](_0xfdd5('0x5c'),_0x4d70c9,_0xfdd5('0x5d')),'json':!![],'form':{'method':_0xfdd5('0x5e'),'input_type':_0xfdd5('0x5f'),'response_type':_0xfdd5('0x5f'),'rest_data':JSON[_0xfdd5('0x60')]({'user_auth':{'user_name':_0x12dc49['username'],'password':_0x12dc49[_0xfdd5('0x57')],'encryption':_0xfdd5('0x61')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xfdd5('0x1f')](function(_0x2141d2){if(_0x2141d2&&_0x2141d2[_0xfdd5('0x36')]!==_0xfdd5('0x62')&&_0x2141d2[_0xfdd5('0x36')]!==_0xfdd5('0x63')){return rp({'method':_0xfdd5('0x5b'),'uri':util[_0xfdd5('0x64')]('%s%s',_0x4d70c9,_0xfdd5('0x5d')),'json':!![],'form':{'method':_0xfdd5('0x65'),'input_type':_0xfdd5('0x5f'),'response_type':_0xfdd5('0x5f'),'rest_data':JSON[_0xfdd5('0x60')]({'session':_0x2141d2['id'],'module_name':_0xfdd5('0x66')})}})[_0xfdd5('0x1f')](function(_0x3706ef){if(_0x3706ef){var _0x5986f6=_['values'](_0x3706ef[_0xfdd5('0x67')]);_[_0xfdd5('0x68')](_0x5986f6,function(_0x3ff128){return _0x13209d[_0xfdd5('0x69')](_0x3ff128[_0xfdd5('0x36')]);});return{'count':_0x5986f6[_0xfdd5('0x3f')],'rows':_[_0xfdd5('0x24')](_0x5986f6,function(_0x41dbfe){return{'id':_0x41dbfe[_0xfdd5('0x36')],'name':_0x41dbfe['label'],'custom':_[_0xfdd5('0x6a')](_0x41dbfe[_0xfdd5('0x36')],'_c')?!![]:![],'options':_0x41dbfe[_0xfdd5('0x38')]?_[_0xfdd5('0x24')](_[_0xfdd5('0x6b')](_0x41dbfe['options']),function(_0x4566ae){return{'name':_0x4566ae[_0xfdd5('0x6c')],'value':_0x4566ae[_0xfdd5('0x36')]};}):[]};})};}})[_0xfdd5('0x1f')](respondWithResult(_0x150d5b,null))['catch'](function(_0x467bd7){var _0x43832f=_0x461b72[_0xfdd5('0x28')][_0xfdd5('0x6d')]?0x1f4:_0x467bd7[_0xfdd5('0x6e')]||0x1f4;logger[_0xfdd5('0x21')](_0xfdd5('0x6f'),_0xfdd5('0x4e'),_0x43832f,JSON[_0xfdd5('0x60')](_0x467bd7));delete _0x467bd7[_0xfdd5('0x36')];if(_0x43832f===0x191){_0x43832f=0x190;}_0x150d5b[_0xfdd5('0x14')](_0x43832f)[_0xfdd5('0x22')](_0x461b72[_0xfdd5('0x28')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x467bd7[_0xfdd5('0x6e')]}:_0x467bd7);});}else{var _0x5d2516=0x1f4;_0x150d5b[_0xfdd5('0x14')](_0x5d2516)['send']({'message':_0xfdd5('0x70'),'statusCode':0x190});}});};
\ No newline at end of file
index 84dd026..38ae9e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c70=['rimraf','../../config/environment','../../components/integrations/configuration','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4ec584,_0x58e5b9){var _0x5e00d5=function(_0x3baed5){while(--_0x3baed5){_0x4ec584['push'](_0x4ec584['shift']());}};_0x5e00d5(++_0x58e5b9);}(_0x5c70,0x123));var _0x05c7=function(_0x38d64a,_0x80c937){_0x38d64a=_0x38d64a-0x0;var _0x47cc2e=_0x5c70[_0x38d64a];return _0x47cc2e;};'use strict';var _=require(_0x05c7('0x0'));var util=require(_0x05c7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x05c7('0x2'));var BPromise=require(_0x05c7('0x3'));var rp=require(_0x05c7('0x4'));var fs=require('fs');var path=require(_0x05c7('0x5'));var rimraf=require(_0x05c7('0x6'));var config=require(_0x05c7('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x05c7('0x8'));module['exports']=function(_0x1dd927,_0x401127){return _0x1dd927['define'](_0x05c7('0x9'),attributes,{'tableName':_0x05c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5480=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5f2929,_0x1c8de5){var _0x58a32c=function(_0x205cf5){while(--_0x205cf5){_0x5f2929['push'](_0x5f2929['shift']());}};_0x58a32c(++_0x1c8de5);}(_0x5480,0x18a));var _0x0548=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x5480[_0x295314];return _0x584b0c;};'use strict';var _=require(_0x0548('0x0'));var util=require(_0x0548('0x1'));var logger=require(_0x0548('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0548('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0548('0x4'));var rimraf=require(_0x0548('0x5'));var config=require('../../config/environment');var attributes=require(_0x0548('0x6'));var integrations=require(_0x0548('0x7'));module[_0x0548('0x8')]=function(_0x420166,_0x3d4401){return _0x420166['define']('SugarcrmAccount',attributes,{'tableName':_0x0548('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30740bb..a1c2eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12e5=['SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','stringify','then','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','message','SugarcrmAccount,\x20%s,\x20%s','catch','GetSugarcrmAccount'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x12e5,0x11c));var _0x512e=function(_0xaa213a,_0x5af1d3){_0xaa213a=_0xaa213a-0x0;var _0xa343c6=_0x12e5[_0xaa213a];return _0xa343c6;};'use strict';var _=require(_0x512e('0x0'));var util=require(_0x512e('0x1'));var moment=require(_0x512e('0x2'));var BPromise=require(_0x512e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x512e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x512e('0x5'));var logger=require(_0x512e('0x6'))(_0x512e('0x7'));var config=require(_0x512e('0x8'));var jayson=require(_0x512e('0x9'));var client=jayson[_0x512e('0xa')][_0x512e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c31cf,_0x566f92,_0x2366f6){return new BPromise(function(_0x10653b,_0x3f255f){return client[_0x512e('0xc')](_0x3c31cf,_0x2366f6)['then'](function(_0x4f314a){logger[_0x512e('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x566f92,_0x512e('0xe'));logger[_0x512e('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x566f92,_0x512e('0xe'),JSON['stringify'](_0x4f314a));if(_0x4f314a[_0x512e('0x10')]){if(_0x4f314a['error'][_0x512e('0x11')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x566f92,_0x4f314a[_0x512e('0x10')][_0x512e('0x12')]);return _0x3f255f(_0x4f314a[_0x512e('0x10')][_0x512e('0x12')]);}logger[_0x512e('0x10')](_0x512e('0x13'),_0x566f92,_0x4f314a['error'][_0x512e('0x12')]);return _0x10653b(_0x4f314a[_0x512e('0x10')][_0x512e('0x12')]);}else{logger[_0x512e('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x566f92,_0x512e('0xe'));_0x10653b(_0x4f314a['result'][_0x512e('0x12')]);}})[_0x512e('0x14')](function(_0x358284){logger[_0x512e('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x566f92,_0x358284);_0x3f255f(_0x358284);});});}exports[_0x512e('0x15')]=function(_0x408b0c){var _0x4dd81a=this;return new Promise(function(_0x237f18,_0x5ab812){return db[_0x512e('0x16')][_0x512e('0x17')]({'raw':_0x408b0c[_0x512e('0x18')]?_0x408b0c[_0x512e('0x18')][_0x512e('0x19')]===undefined?!![]:![]:!![],'where':_0x408b0c[_0x512e('0x18')]?_0x408b0c['options'][_0x512e('0x1a')]||null:null,'attributes':_0x408b0c[_0x512e('0x18')]?_0x408b0c[_0x512e('0x18')][_0x512e('0x1b')]||null:null,'limit':_0x408b0c[_0x512e('0x18')]?_0x408b0c['options']['limit']||null:null,'include':_0x408b0c[_0x512e('0x18')]?_0x408b0c[_0x512e('0x18')][_0x512e('0x1c')]?_[_0x512e('0x1d')](_0x408b0c['options'][_0x512e('0x1c')],function(_0x380633){return{'model':db[_0x380633[_0x512e('0x1e')]],'as':_0x380633['as'],'attributes':_0x380633[_0x512e('0x1b')],'include':_0x380633['include']?_['map'](_0x380633[_0x512e('0x1c')],function(_0x910828){return{'model':db[_0x910828[_0x512e('0x1e')]],'as':_0x910828['as'],'attributes':_0x910828['attributes'],'include':_0x910828[_0x512e('0x1c')]?_['map'](_0x910828[_0x512e('0x1c')],function(_0x4e717e){return{'model':db[_0x4e717e[_0x512e('0x1e')]],'as':_0x4e717e['as'],'attributes':_0x4e717e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x479713){logger[_0x512e('0xd')](_0x512e('0x15'),_0x408b0c);logger['debug'](_0x512e('0x15'),_0x408b0c,JSON[_0x512e('0x1f')](_0x479713));_0x237f18(_0x479713);})[_0x512e('0x14')](function(_0x474d3e){logger['error']('GetSugarcrmAccount',_0x474d3e[_0x512e('0x12')],_0x408b0c);_0x5ab812(_0x4dd81a[_0x512e('0x10')](0x1f4,_0x474d3e[_0x512e('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x542c79){var _0x40dea4=this;return new Promise(function(_0x136857,_0x118d42){return db[_0x512e('0x16')]['find']({'raw':_0x542c79[_0x512e('0x18')]?_0x542c79[_0x512e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x542c79[_0x512e('0x18')]?_0x542c79[_0x512e('0x18')][_0x512e('0x1a')]||null:null,'attributes':_0x542c79[_0x512e('0x18')]?_0x542c79[_0x512e('0x18')][_0x512e('0x1b')]||null:null,'include':_0x542c79[_0x512e('0x18')]?_0x542c79[_0x512e('0x18')][_0x512e('0x1c')]?_[_0x512e('0x1d')](_0x542c79[_0x512e('0x18')][_0x512e('0x1c')],function(_0x1818d4){return{'model':db[_0x1818d4[_0x512e('0x1e')]],'as':_0x1818d4['as'],'attributes':_0x1818d4[_0x512e('0x1b')],'include':_0x1818d4[_0x512e('0x1c')]?_['map'](_0x1818d4[_0x512e('0x1c')],function(_0x296d0b){return{'model':db[_0x296d0b['model']],'as':_0x296d0b['as'],'attributes':_0x296d0b[_0x512e('0x1b')],'include':_0x296d0b[_0x512e('0x1c')]?_['map'](_0x296d0b[_0x512e('0x1c')],function(_0x6c1de7){return{'model':db[_0x6c1de7[_0x512e('0x1e')]],'as':_0x6c1de7['as'],'attributes':_0x6c1de7[_0x512e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x512e('0x20')](function(_0x38d58e){logger[_0x512e('0xd')](_0x512e('0x21'),_0x542c79);logger[_0x512e('0xf')](_0x512e('0x21'),_0x542c79,JSON[_0x512e('0x1f')](_0x38d58e));_0x136857(_0x38d58e);})[_0x512e('0x14')](function(_0x5e13f3){logger[_0x512e('0x10')]('ShowSugarcrmAccount',_0x5e13f3[_0x512e('0x12')],_0x542c79);_0x118d42(_0x40dea4[_0x512e('0x10')](0x1f4,_0x5e13f3[_0x512e('0x12')]));});});};
\ No newline at end of file
+var _0x032d=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','catch','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SugarcrmAccount,\x20%s,\x20%s','debug'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x032d,0x7d));var _0xd032=function(_0x508ea3,_0x26d1a0){_0x508ea3=_0x508ea3-0x0;var _0x5199a7=_0x032d[_0x508ea3];return _0x5199a7;};'use strict';var _=require('lodash');var util=require(_0xd032('0x0'));var moment=require(_0xd032('0x1'));var BPromise=require(_0xd032('0x2'));var rs=require(_0xd032('0x3'));var fs=require('fs');var Redis=require(_0xd032('0x4'));var db=require(_0xd032('0x5'))['db'];var utils=require(_0xd032('0x6'));var logger=require(_0xd032('0x7'))(_0xd032('0x8'));var config=require(_0xd032('0x9'));var jayson=require(_0xd032('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x175833,_0x5f2d1e,_0x3b2885){return new BPromise(function(_0x48700f,_0x775a88){return client[_0xd032('0xb')](_0x175833,_0x3b2885)[_0xd032('0xc')](function(_0x31b831){logger['info'](_0xd032('0xd'),_0x5f2d1e,'request\x20sent');logger[_0xd032('0xe')](_0xd032('0xf'),_0x5f2d1e,_0xd032('0x10'),JSON[_0xd032('0x11')](_0x31b831));if(_0x31b831[_0xd032('0x12')]){if(_0x31b831[_0xd032('0x12')]['code']===0x1f4){logger[_0xd032('0x12')](_0xd032('0xd'),_0x5f2d1e,_0x31b831[_0xd032('0x12')][_0xd032('0x13')]);return _0x775a88(_0x31b831['error']['message']);}logger[_0xd032('0x12')](_0xd032('0xd'),_0x5f2d1e,_0x31b831[_0xd032('0x12')]['message']);return _0x48700f(_0x31b831[_0xd032('0x12')][_0xd032('0x13')]);}else{logger[_0xd032('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x5f2d1e,_0xd032('0x10'));_0x48700f(_0x31b831[_0xd032('0x15')][_0xd032('0x13')]);}})['catch'](function(_0x4014d0){logger[_0xd032('0x12')](_0xd032('0xd'),_0x5f2d1e,_0x4014d0);_0x775a88(_0x4014d0);});});}exports[_0xd032('0x16')]=function(_0x56f974){var _0x397dac=this;return new Promise(function(_0x3a4b84,_0x59cb61){return db[_0xd032('0x17')]['findAll']({'raw':_0x56f974[_0xd032('0x18')]?_0x56f974[_0xd032('0x18')][_0xd032('0x19')]===undefined?!![]:![]:!![],'where':_0x56f974[_0xd032('0x18')]?_0x56f974[_0xd032('0x18')][_0xd032('0x1a')]||null:null,'attributes':_0x56f974['options']?_0x56f974[_0xd032('0x18')][_0xd032('0x1b')]||null:null,'limit':_0x56f974['options']?_0x56f974[_0xd032('0x18')][_0xd032('0x1c')]||null:null,'include':_0x56f974[_0xd032('0x18')]?_0x56f974[_0xd032('0x18')][_0xd032('0x1d')]?_[_0xd032('0x1e')](_0x56f974['options'][_0xd032('0x1d')],function(_0x4a91f5){return{'model':db[_0x4a91f5[_0xd032('0x1f')]],'as':_0x4a91f5['as'],'attributes':_0x4a91f5[_0xd032('0x1b')],'include':_0x4a91f5[_0xd032('0x1d')]?_[_0xd032('0x1e')](_0x4a91f5[_0xd032('0x1d')],function(_0x4512d9){return{'model':db[_0x4512d9[_0xd032('0x1f')]],'as':_0x4512d9['as'],'attributes':_0x4512d9[_0xd032('0x1b')],'include':_0x4512d9['include']?_[_0xd032('0x1e')](_0x4512d9[_0xd032('0x1d')],function(_0x3573dd){return{'model':db[_0x3573dd['model']],'as':_0x3573dd['as'],'attributes':_0x3573dd[_0xd032('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd032('0xc')](function(_0x1717f7){logger[_0xd032('0x14')]('GetSugarcrmAccount',_0x56f974);logger[_0xd032('0xe')](_0xd032('0x16'),_0x56f974,JSON['stringify'](_0x1717f7));_0x3a4b84(_0x1717f7);})[_0xd032('0x20')](function(_0x4bccb0){logger[_0xd032('0x12')]('GetSugarcrmAccount',_0x4bccb0[_0xd032('0x13')],_0x56f974);_0x59cb61(_0x397dac[_0xd032('0x12')](0x1f4,_0x4bccb0['message']));});});};exports[_0xd032('0x21')]=function(_0x21b048){var _0x5a0d0e=this;return new Promise(function(_0x139998,_0x26a0b2){return db[_0xd032('0x17')][_0xd032('0x22')]({'raw':_0x21b048[_0xd032('0x18')]?_0x21b048[_0xd032('0x18')][_0xd032('0x19')]===undefined?!![]:![]:!![],'where':_0x21b048[_0xd032('0x18')]?_0x21b048[_0xd032('0x18')][_0xd032('0x1a')]||null:null,'attributes':_0x21b048[_0xd032('0x18')]?_0x21b048[_0xd032('0x18')]['attributes']||null:null,'include':_0x21b048[_0xd032('0x18')]?_0x21b048['options'][_0xd032('0x1d')]?_[_0xd032('0x1e')](_0x21b048[_0xd032('0x18')]['include'],function(_0x466f79){return{'model':db[_0x466f79[_0xd032('0x1f')]],'as':_0x466f79['as'],'attributes':_0x466f79[_0xd032('0x1b')],'include':_0x466f79[_0xd032('0x1d')]?_[_0xd032('0x1e')](_0x466f79[_0xd032('0x1d')],function(_0x18122f){return{'model':db[_0x18122f['model']],'as':_0x18122f['as'],'attributes':_0x18122f['attributes'],'include':_0x18122f[_0xd032('0x1d')]?_['map'](_0x18122f[_0xd032('0x1d')],function(_0x2f3249){return{'model':db[_0x2f3249[_0xd032('0x1f')]],'as':_0x2f3249['as'],'attributes':_0x2f3249['attributes']};}):[]};}):[]};}):[]:[]})[_0xd032('0xc')](function(_0x395849){logger[_0xd032('0x14')](_0xd032('0x21'),_0x21b048);logger[_0xd032('0xe')]('ShowSugarcrmAccount',_0x21b048,JSON[_0xd032('0x11')](_0x395849));_0x139998(_0x395849);})[_0xd032('0x20')](function(_0x32a7aa){logger[_0xd032('0x12')](_0xd032('0x21'),_0x32a7aa[_0xd032('0x13')],_0x21b048);_0x26a0b2(_0x5a0d0e['error'](0x1f4,_0x32a7aa[_0xd032('0x13')]));});});};
\ No newline at end of file
index 2f26625..5fcb3f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc98=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x48cb93,_0x3e25f8){var _0x22b26f=function(_0x2cb695){while(--_0x2cb695){_0x48cb93['push'](_0x48cb93['shift']());}};_0x22b26f(++_0x3e25f8);}(_0xcc98,0xb5));var _0x8cc9=function(_0x2354bb,_0x5cea3e){_0x2354bb=_0x2354bb-0x0;var _0x591a7b=_0xcc98[_0x2354bb];return _0x591a7b;};'use strict';var multer=require(_0x8cc9('0x0'));var util=require(_0x8cc9('0x1'));var path=require(_0x8cc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x8cc9('0x3'));var router=express[_0x8cc9('0x4')]();var fs_extra=require(_0x8cc9('0x5'));var auth=require(_0x8cc9('0x6'));var interaction=require(_0x8cc9('0x7'));var config=require('../../config/environment');var controller=require(_0x8cc9('0x8'));router[_0x8cc9('0x9')]('/',auth[_0x8cc9('0xa')](),controller[_0x8cc9('0xb')]);router[_0x8cc9('0x9')](_0x8cc9('0xc'),auth[_0x8cc9('0xa')](),controller[_0x8cc9('0xd')]);router[_0x8cc9('0x9')]('/:id/fields',auth[_0x8cc9('0xa')](),controller['getFields']);router[_0x8cc9('0x9')]('/:id/subjects',auth[_0x8cc9('0xa')](),controller['getSubjects']);router['get'](_0x8cc9('0xe'),auth[_0x8cc9('0xa')](),controller[_0x8cc9('0xf')]);router[_0x8cc9('0x10')]('/',auth[_0x8cc9('0xa')](),controller[_0x8cc9('0x11')]);router[_0x8cc9('0x12')](_0x8cc9('0xc'),auth[_0x8cc9('0xa')](),controller[_0x8cc9('0x13')]);router[_0x8cc9('0x14')](_0x8cc9('0xc'),auth['isAuthenticated'](),controller[_0x8cc9('0x15')]);module[_0x8cc9('0x16')]=router;
\ No newline at end of file
+var _0xd040=['index','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','post','create','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd040,0x1bd));var _0x0d04=function(_0x21f9a5,_0x34280d){_0x21f9a5=_0x21f9a5-0x0;var _0x3af273=_0xd040[_0x21f9a5];return _0x3af273;};'use strict';var multer=require(_0x0d04('0x0'));var util=require('util');var path=require(_0x0d04('0x1'));var timeout=require(_0x0d04('0x2'));var express=require(_0x0d04('0x3'));var router=express[_0x0d04('0x4')]();var fs_extra=require(_0x0d04('0x5'));var auth=require(_0x0d04('0x6'));var interaction=require(_0x0d04('0x7'));var config=require(_0x0d04('0x8'));var controller=require(_0x0d04('0x9'));router[_0x0d04('0xa')]('/',auth['isAuthenticated'](),controller[_0x0d04('0xb')]);router[_0x0d04('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0d04('0xc')]);router[_0x0d04('0xa')](_0x0d04('0xd'),auth['isAuthenticated'](),controller[_0x0d04('0xe')]);router[_0x0d04('0xa')](_0x0d04('0xf'),auth[_0x0d04('0x10')](),controller[_0x0d04('0x11')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x0d04('0x12')]('/',auth['isAuthenticated'](),controller[_0x0d04('0x13')]);router['put'](_0x0d04('0x14'),auth[_0x0d04('0x10')](),controller[_0x0d04('0x15')]);router['delete']('/:id',auth[_0x0d04('0x10')](),controller[_0x0d04('0x16')]);module[_0x0d04('0x17')]=router;
\ No newline at end of file
index 4be4e14..4e8fae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb296=['sequelize','exports','STRING'];(function(_0xeeb245,_0xb8dee5){var _0x5260f4=function(_0xb44a04){while(--_0xb44a04){_0xeeb245['push'](_0xeeb245['shift']());}};_0x5260f4(++_0xb8dee5);}(_0xb296,0x1e0));var _0x6b29=function(_0xea39a9,_0x3e528a){_0xea39a9=_0xea39a9-0x0;var _0x1e0409=_0xb296[_0xea39a9];return _0x1e0409;};'use strict';var Sequelize=require(_0x6b29('0x0'));module[_0x6b29('0x1')]={'name':{'type':Sequelize[_0x6b29('0x2')]},'description':{'type':Sequelize[_0x6b29('0x2')]}};
\ No newline at end of file
+var _0x7596=['STRING','sequelize','exports'];(function(_0x3340b6,_0x57bdc1){var _0x545de7=function(_0x594319){while(--_0x594319){_0x3340b6['push'](_0x3340b6['shift']());}};_0x545de7(++_0x57bdc1);}(_0x7596,0x1cf));var _0x6759=function(_0x5e761b,_0x355e38){_0x5e761b=_0x5e761b-0x0;var _0x98502c=_0x7596[_0x5e761b];return _0x98502c;};'use strict';var Sequelize=require(_0x6759('0x0'));module[_0x6759('0x1')]={'name':{'type':Sequelize[_0x6759('0x2')]},'description':{'type':Sequelize[_0x6759('0x2')]}};
\ No newline at end of file
index 221a432..f94b090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74d2=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','includeAll','catch','create','body','find','getFields','findOne','hasOwnProperty','getSubjects','SugarcrmField','getDescriptions','rimraf','zip-dir','fast-json-patch'];(function(_0x19a58d,_0x25cd60){var _0x4045c6=function(_0xb55452){while(--_0xb55452){_0x19a58d['push'](_0x19a58d['shift']());}};_0x4045c6(++_0x25cd60);}(_0x74d2,0x188));var _0x274d=function(_0x18daeb,_0x1b8ff3){_0x18daeb=_0x18daeb-0x0;var _0x425a30=_0x74d2[_0x18daeb];return _0x425a30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x274d('0x0'));var zipdir=require(_0x274d('0x1'));var jsonpatch=require(_0x274d('0x2'));var rp=require('request-promise');var moment=require(_0x274d('0x3'));var BPromise=require(_0x274d('0x4'));var Mustache=require(_0x274d('0x5'));var util=require(_0x274d('0x6'));var path=require(_0x274d('0x7'));var sox=require(_0x274d('0x8'));var csv=require(_0x274d('0x9'));var ejs=require(_0x274d('0xa'));var fs=require('fs');var fs_extra=require(_0x274d('0xb'));var _=require(_0x274d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x274d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x274d('0x9'));var querystring=require('querystring');var Papa=require(_0x274d('0xe'));var Redis=require(_0x274d('0xf'));var authService=require(_0x274d('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x274d('0x11'));var utils=require(_0x274d('0x12'));var config=require(_0x274d('0x13'));var licenseUtil=require(_0x274d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15d75b,_0x5f585a){_0x5f585a=_0x5f585a||0xcc;return function(_0x3512c7){if(_0x3512c7){return _0x15d75b[_0x274d('0x15')](_0x5f585a);}return _0x15d75b[_0x274d('0x16')](_0x5f585a)['end']();};}function respondWithResult(_0x234963,_0x31efda){_0x31efda=_0x31efda||0xc8;return function(_0x57c7c9){if(_0x57c7c9){return _0x234963['status'](_0x31efda)['json'](_0x57c7c9);}};}function respondWithFilteredResult(_0x1ad0ea,_0x164758){return function(_0x392876){if(_0x392876){var _0x3f9ba8=typeof _0x164758[_0x274d('0x17')]===_0x274d('0x18')&&typeof _0x164758[_0x274d('0x19')]===_0x274d('0x18');var _0x523b81=_0x392876['count'];var _0x1298cb=_0x3f9ba8?0x0:_0x164758[_0x274d('0x17')];var _0x21f768=_0x3f9ba8?_0x392876[_0x274d('0x1a')]:_0x164758[_0x274d('0x17')]+_0x164758[_0x274d('0x19')];var _0xfa62e3;if(_0x21f768>=_0x523b81){_0x21f768=_0x523b81;_0xfa62e3=0xc8;}else{_0xfa62e3=0xce;}_0x1ad0ea[_0x274d('0x16')](_0xfa62e3);return _0x1ad0ea['set'](_0x274d('0x1b'),_0x1298cb+'-'+_0x21f768+'/'+_0x523b81)[_0x274d('0x1c')](_0x392876);}return null;};}function patchUpdates(_0x21f3a7){return function(_0x63d90c){try{jsonpatch[_0x274d('0x1d')](_0x63d90c,_0x21f3a7,!![]);}catch(_0x28fdfb){return BPromise['reject'](_0x28fdfb);}return _0x63d90c[_0x274d('0x1e')]();};}function saveUpdates(_0x564c65,_0xd4ff4f){return function(_0xff1bf3){if(_0xff1bf3){return _0xff1bf3[_0x274d('0x1f')](_0x564c65)[_0x274d('0x20')](function(_0xa7cc5f){return _0xa7cc5f;});}return null;};}function removeEntity(_0x3e37b0,_0x4a9aed){return function(_0x202a5d){if(_0x202a5d){return _0x202a5d[_0x274d('0x21')]()[_0x274d('0x20')](function(){_0x3e37b0[_0x274d('0x16')](0xcc)[_0x274d('0x22')]();});}};}function handleEntityNotFound(_0xa8a416,_0x10c398){return function(_0x22a7e4){if(!_0x22a7e4){_0xa8a416['sendStatus'](0x194);}return _0x22a7e4;};}function handleError(_0x166fff,_0x4031eb){_0x4031eb=_0x4031eb||0x1f4;return function(_0x1e8ae7){logger[_0x274d('0x23')](_0x1e8ae7[_0x274d('0x24')]);if(_0x1e8ae7[_0x274d('0x25')]){delete _0x1e8ae7[_0x274d('0x25')];}_0x166fff['status'](_0x4031eb)[_0x274d('0x26')](_0x1e8ae7);};}exports[_0x274d('0x27')]=function(_0x3464d4,_0x266fce){var _0x16e759={},_0xcf0c2a={},_0x1c39d8={'count':0x0,'rows':[]};var _0x2b4b4d=_[_0x274d('0x28')](db[_0x274d('0x29')][_0x274d('0x2a')],function(_0x34baa9){return{'name':_0x34baa9[_0x274d('0x2b')],'type':_0x34baa9[_0x274d('0x2c')][_0x274d('0x2d')]};});_0xcf0c2a[_0x274d('0x2e')]=_[_0x274d('0x28')](_0x2b4b4d,_0x274d('0x25'));_0xcf0c2a[_0x274d('0x2f')]=_[_0x274d('0x30')](_0x3464d4[_0x274d('0x2f')]);_0xcf0c2a[_0x274d('0x31')]=_['intersection'](_0xcf0c2a[_0x274d('0x2e')],_0xcf0c2a['query']);_0x16e759[_0x274d('0x32')]=_[_0x274d('0x33')](_0xcf0c2a[_0x274d('0x2e')],qs[_0x274d('0x34')](_0x3464d4[_0x274d('0x2f')][_0x274d('0x34')]));_0x16e759[_0x274d('0x32')]=_0x16e759[_0x274d('0x32')]['length']?_0x16e759[_0x274d('0x32')]:_0xcf0c2a[_0x274d('0x2e')];if(!_0x3464d4[_0x274d('0x2f')]['hasOwnProperty'](_0x274d('0x35'))){_0x16e759[_0x274d('0x19')]=qs[_0x274d('0x19')](_0x3464d4[_0x274d('0x2f')][_0x274d('0x19')]);_0x16e759['offset']=qs[_0x274d('0x17')](_0x3464d4[_0x274d('0x2f')]['offset']);}_0x16e759[_0x274d('0x36')]=qs['sort'](_0x3464d4['query'][_0x274d('0x37')]);_0x16e759[_0x274d('0x38')]=qs[_0x274d('0x31')](_[_0x274d('0x39')](_0x3464d4[_0x274d('0x2f')],_0xcf0c2a['filters']),_0x2b4b4d);if(_0x3464d4[_0x274d('0x2f')]['filter']){_0x16e759[_0x274d('0x38')]=_[_0x274d('0x3a')](_0x16e759[_0x274d('0x38')],{'$or':_[_0x274d('0x28')](_0x2b4b4d,function(_0x456b0f){if(_0x456b0f[_0x274d('0x2c')]!==_0x274d('0x3b')){var _0x4dee80={};_0x4dee80[_0x456b0f[_0x274d('0x25')]]={'$like':'%'+_0x3464d4[_0x274d('0x2f')][_0x274d('0x3c')]+'%'};return _0x4dee80;}})});}_0x16e759=_[_0x274d('0x3a')]({},_0x16e759,_0x3464d4[_0x274d('0x3d')]);var _0x72ec10={'where':_0x16e759[_0x274d('0x38')]};return db[_0x274d('0x29')]['count'](_0x72ec10)[_0x274d('0x20')](function(_0x35352b){_0x1c39d8['count']=_0x35352b;if(_0x3464d4[_0x274d('0x2f')]['includeAll']){_0x16e759[_0x274d('0x3e')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x274d('0x3f')](_0x16e759);})[_0x274d('0x20')](function(_0x56dd36){_0x1c39d8[_0x274d('0x40')]=_0x56dd36;return _0x1c39d8;})[_0x274d('0x20')](respondWithFilteredResult(_0x266fce,_0x16e759))['catch'](handleError(_0x266fce,null));};exports[_0x274d('0x41')]=function(_0x330329,_0xfa0b3){var _0x4164cf={'raw':![],'where':{'id':_0x330329[_0x274d('0x42')]['id']}},_0x54f138={};_0x54f138[_0x274d('0x2e')]=_[_0x274d('0x30')](db[_0x274d('0x29')][_0x274d('0x2a')]);_0x54f138['query']=_[_0x274d('0x30')](_0x330329['query']);_0x54f138[_0x274d('0x31')]=_['intersection'](_0x54f138[_0x274d('0x2e')],_0x54f138[_0x274d('0x2f')]);_0x4164cf[_0x274d('0x32')]=_[_0x274d('0x33')](_0x54f138[_0x274d('0x2e')],qs[_0x274d('0x34')](_0x330329['query']['fields']));_0x4164cf['attributes']=_0x4164cf['attributes'][_0x274d('0x43')]?_0x4164cf['attributes']:_0x54f138['model'];if(_0x330329[_0x274d('0x2f')][_0x274d('0x44')]){_0x4164cf[_0x274d('0x3e')]=[{'all':!![]}];}_0x4164cf=_[_0x274d('0x3a')]({},_0x4164cf,_0x330329[_0x274d('0x3d')]);return db[_0x274d('0x29')]['find'](_0x4164cf)[_0x274d('0x20')](handleEntityNotFound(_0xfa0b3,null))[_0x274d('0x20')](respondWithResult(_0xfa0b3,null))[_0x274d('0x45')](handleError(_0xfa0b3,null));};exports[_0x274d('0x46')]=function(_0x59d65c,_0x139d3c){return db[_0x274d('0x29')][_0x274d('0x46')](_0x59d65c['body'],{})[_0x274d('0x20')](respondWithResult(_0x139d3c,0xc9))[_0x274d('0x45')](handleError(_0x139d3c,null));};exports['update']=function(_0x44fd6e,_0x1bc773){if(_0x44fd6e[_0x274d('0x47')]['id']){delete _0x44fd6e[_0x274d('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x274d('0x48')]({'where':{'id':_0x44fd6e[_0x274d('0x42')]['id']}})[_0x274d('0x20')](handleEntityNotFound(_0x1bc773,null))['then'](saveUpdates(_0x44fd6e[_0x274d('0x47')],null))[_0x274d('0x20')](respondWithResult(_0x1bc773,null))[_0x274d('0x45')](handleError(_0x1bc773,null));};exports[_0x274d('0x21')]=function(_0x92fdc9,_0x508687){return db[_0x274d('0x29')]['find']({'where':{'id':_0x92fdc9[_0x274d('0x42')]['id']}})['then'](handleEntityNotFound(_0x508687,null))[_0x274d('0x20')](removeEntity(_0x508687,null))['catch'](handleError(_0x508687,null));};exports[_0x274d('0x49')]=function(_0xeef4cc,_0x41d8a3,_0xd5cd83){var _0x334985={};var _0x514e96={};var _0x1bb183;var _0x1d671a;return db[_0x274d('0x29')][_0x274d('0x4a')]({'where':{'id':_0xeef4cc['params']['id']}})[_0x274d('0x20')](handleEntityNotFound(_0x41d8a3,null))[_0x274d('0x20')](function(_0x2bca5f){if(_0x2bca5f){_0x1bb183=_0x2bca5f;_0x514e96[_0x274d('0x2e')]=_[_0x274d('0x30')](db['SugarcrmField'][_0x274d('0x2a')]);_0x514e96[_0x274d('0x2f')]=_['keys'](_0xeef4cc['query']);_0x514e96[_0x274d('0x31')]=_[_0x274d('0x33')](_0x514e96[_0x274d('0x2e')],_0x514e96['query']);_0x334985[_0x274d('0x32')]=_[_0x274d('0x33')](_0x514e96[_0x274d('0x2e')],qs[_0x274d('0x34')](_0xeef4cc[_0x274d('0x2f')]['fields']));_0x334985['attributes']=_0x334985['attributes'][_0x274d('0x43')]?_0x334985[_0x274d('0x32')]:_0x514e96['model'];_0x334985['order']=qs[_0x274d('0x37')](_0xeef4cc[_0x274d('0x2f')][_0x274d('0x37')]);_0x334985[_0x274d('0x38')]=qs[_0x274d('0x31')](_[_0x274d('0x39')](_0xeef4cc[_0x274d('0x2f')],_0x514e96[_0x274d('0x31')]));if(_0xeef4cc['query'][_0x274d('0x3c')]){_0x334985[_0x274d('0x38')]=_['merge'](_0x334985[_0x274d('0x38')],{'$or':_[_0x274d('0x28')](_0x334985['attributes'],function(_0x39e0de){var _0x575e29={};_0x575e29[_0x39e0de]={'$like':'%'+_0xeef4cc['query'][_0x274d('0x3c')]+'%'};return _0x575e29;})});}_0x334985=_['merge']({},_0x334985,_0xeef4cc[_0x274d('0x3d')]);return _0x1bb183[_0x274d('0x49')](_0x334985);}})[_0x274d('0x20')](function(_0x24884f){if(_0x24884f){_0x1d671a=_0x24884f[_0x274d('0x43')];if(!_0xeef4cc[_0x274d('0x2f')][_0x274d('0x4b')]('nolimit')){_0x334985['limit']=qs['limit'](_0xeef4cc[_0x274d('0x2f')][_0x274d('0x19')]);_0x334985[_0x274d('0x17')]=qs[_0x274d('0x17')](_0xeef4cc['query']['offset']);}return _0x1bb183['getFields'](_0x334985);}})[_0x274d('0x20')](function(_0x416854){if(_0x416854){return _0x416854?{'count':_0x1d671a,'rows':_0x416854}:null;}})[_0x274d('0x20')](respondWithResult(_0x41d8a3,null))[_0x274d('0x45')](handleError(_0x41d8a3,null));};exports[_0x274d('0x4c')]=function(_0x5fefac,_0x45bbe2,_0x5b9e8c){var _0x1a94d2={};var _0x5b7ed5={};var _0x4d0111;var _0x51675e;return db['SugarcrmConfiguration'][_0x274d('0x4a')]({'where':{'id':_0x5fefac[_0x274d('0x42')]['id']}})[_0x274d('0x20')](handleEntityNotFound(_0x45bbe2,null))['then'](function(_0x21e003){if(_0x21e003){_0x4d0111=_0x21e003;_0x5b7ed5[_0x274d('0x2e')]=_['keys'](db[_0x274d('0x4d')]['rawAttributes']);_0x5b7ed5[_0x274d('0x2f')]=_['keys'](_0x5fefac[_0x274d('0x2f')]);_0x5b7ed5['filters']=_[_0x274d('0x33')](_0x5b7ed5[_0x274d('0x2e')],_0x5b7ed5['query']);_0x1a94d2[_0x274d('0x32')]=_[_0x274d('0x33')](_0x5b7ed5[_0x274d('0x2e')],qs[_0x274d('0x34')](_0x5fefac[_0x274d('0x2f')][_0x274d('0x34')]));_0x1a94d2[_0x274d('0x32')]=_0x1a94d2[_0x274d('0x32')]['length']?_0x1a94d2[_0x274d('0x32')]:_0x5b7ed5[_0x274d('0x2e')];_0x1a94d2[_0x274d('0x36')]=qs['sort'](_0x5fefac[_0x274d('0x2f')][_0x274d('0x37')]);_0x1a94d2['where']=qs[_0x274d('0x31')](_[_0x274d('0x39')](_0x5fefac[_0x274d('0x2f')],_0x5b7ed5['filters']));if(_0x5fefac[_0x274d('0x2f')][_0x274d('0x3c')]){_0x1a94d2['where']=_[_0x274d('0x3a')](_0x1a94d2[_0x274d('0x38')],{'$or':_[_0x274d('0x28')](_0x1a94d2[_0x274d('0x32')],function(_0x35af5c){var _0x2b4888={};_0x2b4888[_0x35af5c]={'$like':'%'+_0x5fefac[_0x274d('0x2f')][_0x274d('0x3c')]+'%'};return _0x2b4888;})});}_0x1a94d2=_[_0x274d('0x3a')]({},_0x1a94d2,_0x5fefac[_0x274d('0x3d')]);return _0x4d0111['getSubjects'](_0x1a94d2);}})[_0x274d('0x20')](function(_0x149cb0){if(_0x149cb0){_0x51675e=_0x149cb0['length'];if(!_0x5fefac['query'][_0x274d('0x4b')](_0x274d('0x35'))){_0x1a94d2[_0x274d('0x19')]=qs[_0x274d('0x19')](_0x5fefac[_0x274d('0x2f')][_0x274d('0x19')]);_0x1a94d2[_0x274d('0x17')]=qs['offset'](_0x5fefac[_0x274d('0x2f')][_0x274d('0x17')]);}return _0x4d0111[_0x274d('0x4c')](_0x1a94d2);}})['then'](function(_0xae84cc){if(_0xae84cc){return _0xae84cc?{'count':_0x51675e,'rows':_0xae84cc}:null;}})['then'](respondWithResult(_0x45bbe2,null))[_0x274d('0x45')](handleError(_0x45bbe2,null));};exports[_0x274d('0x4e')]=function(_0x357a01,_0x15f3f5,_0x27099a){var _0x1f48ed={};var _0x907061={};var _0xea32f2;var _0xf7c544;return db[_0x274d('0x29')]['findOne']({'where':{'id':_0x357a01[_0x274d('0x42')]['id']}})[_0x274d('0x20')](handleEntityNotFound(_0x15f3f5,null))[_0x274d('0x20')](function(_0x3ec957){if(_0x3ec957){_0xea32f2=_0x3ec957;_0x907061['model']=_[_0x274d('0x30')](db[_0x274d('0x4d')][_0x274d('0x2a')]);_0x907061[_0x274d('0x2f')]=_[_0x274d('0x30')](_0x357a01[_0x274d('0x2f')]);_0x907061[_0x274d('0x31')]=_[_0x274d('0x33')](_0x907061[_0x274d('0x2e')],_0x907061[_0x274d('0x2f')]);_0x1f48ed['attributes']=_[_0x274d('0x33')](_0x907061[_0x274d('0x2e')],qs[_0x274d('0x34')](_0x357a01[_0x274d('0x2f')][_0x274d('0x34')]));_0x1f48ed[_0x274d('0x32')]=_0x1f48ed[_0x274d('0x32')][_0x274d('0x43')]?_0x1f48ed[_0x274d('0x32')]:_0x907061[_0x274d('0x2e')];_0x1f48ed['order']=qs[_0x274d('0x37')](_0x357a01['query']['sort']);_0x1f48ed[_0x274d('0x38')]=qs[_0x274d('0x31')](_[_0x274d('0x39')](_0x357a01[_0x274d('0x2f')],_0x907061[_0x274d('0x31')]));if(_0x357a01[_0x274d('0x2f')][_0x274d('0x3c')]){_0x1f48ed['where']=_[_0x274d('0x3a')](_0x1f48ed[_0x274d('0x38')],{'$or':_[_0x274d('0x28')](_0x1f48ed[_0x274d('0x32')],function(_0x3727e5){var _0x212fc6={};_0x212fc6[_0x3727e5]={'$like':'%'+_0x357a01[_0x274d('0x2f')][_0x274d('0x3c')]+'%'};return _0x212fc6;})});}_0x1f48ed=_[_0x274d('0x3a')]({},_0x1f48ed,_0x357a01[_0x274d('0x3d')]);return _0xea32f2[_0x274d('0x4e')](_0x1f48ed);}})['then'](function(_0x5551a9){if(_0x5551a9){_0xf7c544=_0x5551a9[_0x274d('0x43')];if(!_0x357a01[_0x274d('0x2f')]['hasOwnProperty']('nolimit')){_0x1f48ed[_0x274d('0x19')]=qs[_0x274d('0x19')](_0x357a01[_0x274d('0x2f')][_0x274d('0x19')]);_0x1f48ed[_0x274d('0x17')]=qs[_0x274d('0x17')](_0x357a01[_0x274d('0x2f')][_0x274d('0x17')]);}return _0xea32f2[_0x274d('0x4e')](_0x1f48ed);}})[_0x274d('0x20')](function(_0x288560){if(_0x288560){return _0x288560?{'count':_0xf7c544,'rows':_0x288560}:null;}})['then'](respondWithResult(_0x15f3f5,null))[_0x274d('0x45')](handleError(_0x15f3f5,null));};
\ No newline at end of file
+var _0x76d2=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','update','body','find','getFields','findOne','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x55c864,_0x5cc07a){var _0x278e0b=function(_0x558fb9){while(--_0x558fb9){_0x55c864['push'](_0x55c864['shift']());}};_0x278e0b(++_0x5cc07a);}(_0x76d2,0x176));var _0x276d=function(_0x11739a,_0x5dd630){_0x11739a=_0x11739a-0x0;var _0x1ec6e5=_0x76d2[_0x11739a];return _0x1ec6e5;};'use strict';var emlformat=require(_0x276d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x276d('0x1'));var rp=require(_0x276d('0x2'));var moment=require(_0x276d('0x3'));var BPromise=require(_0x276d('0x4'));var Mustache=require(_0x276d('0x5'));var util=require(_0x276d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x276d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x276d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x276d('0x9'));var toCsv=require(_0x276d('0x7'));var querystring=require('querystring');var Papa=require(_0x276d('0xa'));var Redis=require(_0x276d('0xb'));var authService=require(_0x276d('0xc'));var qs=require(_0x276d('0xd'));var as=require(_0x276d('0xe'));var hardwareService=require(_0x276d('0xf'));var logger=require(_0x276d('0x10'))(_0x276d('0x11'));var utils=require(_0x276d('0x12'));var config=require(_0x276d('0x13'));var licenseUtil=require(_0x276d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a95c0,_0x487bb1){_0x487bb1=_0x487bb1||0xcc;return function(_0x2707d3){if(_0x2707d3){return _0x4a95c0[_0x276d('0x15')](_0x487bb1);}return _0x4a95c0[_0x276d('0x16')](_0x487bb1)['end']();};}function respondWithResult(_0x5528e7,_0x384609){_0x384609=_0x384609||0xc8;return function(_0x5d2ca0){if(_0x5d2ca0){return _0x5528e7[_0x276d('0x16')](_0x384609)[_0x276d('0x17')](_0x5d2ca0);}};}function respondWithFilteredResult(_0x50ad4e,_0x1cf80c){return function(_0x99139c){if(_0x99139c){var _0x2bcdc8=typeof _0x1cf80c[_0x276d('0x18')]===_0x276d('0x19')&&typeof _0x1cf80c[_0x276d('0x1a')]===_0x276d('0x19');var _0x215851=_0x99139c[_0x276d('0x1b')];var _0x467778=_0x2bcdc8?0x0:_0x1cf80c[_0x276d('0x18')];var _0x5ac9e4=_0x2bcdc8?_0x99139c[_0x276d('0x1b')]:_0x1cf80c[_0x276d('0x18')]+_0x1cf80c[_0x276d('0x1a')];var _0x441347;if(_0x5ac9e4>=_0x215851){_0x5ac9e4=_0x215851;_0x441347=0xc8;}else{_0x441347=0xce;}_0x50ad4e[_0x276d('0x16')](_0x441347);return _0x50ad4e[_0x276d('0x1c')](_0x276d('0x1d'),_0x467778+'-'+_0x5ac9e4+'/'+_0x215851)[_0x276d('0x17')](_0x99139c);}return null;};}function patchUpdates(_0x16c37e){return function(_0x5356dc){try{jsonpatch[_0x276d('0x1e')](_0x5356dc,_0x16c37e,!![]);}catch(_0x2051eb){return BPromise[_0x276d('0x1f')](_0x2051eb);}return _0x5356dc[_0x276d('0x20')]();};}function saveUpdates(_0x4e9013,_0x1939f6){return function(_0x1f4f1b){if(_0x1f4f1b){return _0x1f4f1b['update'](_0x4e9013)[_0x276d('0x21')](function(_0x488059){return _0x488059;});}return null;};}function removeEntity(_0xbdd695,_0x3f9ba5){return function(_0x48c3d2){if(_0x48c3d2){return _0x48c3d2[_0x276d('0x22')]()[_0x276d('0x21')](function(){_0xbdd695[_0x276d('0x16')](0xcc)[_0x276d('0x23')]();});}};}function handleEntityNotFound(_0xfe20b1,_0x329908){return function(_0x2721f3){if(!_0x2721f3){_0xfe20b1['sendStatus'](0x194);}return _0x2721f3;};}function handleError(_0x5e3707,_0x3c27a6){_0x3c27a6=_0x3c27a6||0x1f4;return function(_0xe23192){logger[_0x276d('0x24')](_0xe23192[_0x276d('0x25')]);if(_0xe23192['name']){delete _0xe23192['name'];}_0x5e3707[_0x276d('0x16')](_0x3c27a6)['send'](_0xe23192);};}exports[_0x276d('0x26')]=function(_0x44a994,_0x3c538f){var _0x590af4={},_0x2fe1b5={},_0x36ba6b={'count':0x0,'rows':[]};var _0x3bc269=_[_0x276d('0x27')](db[_0x276d('0x28')][_0x276d('0x29')],function(_0x3d6762){return{'name':_0x3d6762[_0x276d('0x2a')],'type':_0x3d6762[_0x276d('0x2b')][_0x276d('0x2c')]};});_0x2fe1b5[_0x276d('0x2d')]=_[_0x276d('0x27')](_0x3bc269,_0x276d('0x2e'));_0x2fe1b5['query']=_['keys'](_0x44a994[_0x276d('0x2f')]);_0x2fe1b5[_0x276d('0x30')]=_['intersection'](_0x2fe1b5[_0x276d('0x2d')],_0x2fe1b5['query']);_0x590af4[_0x276d('0x31')]=_[_0x276d('0x32')](_0x2fe1b5[_0x276d('0x2d')],qs['fields'](_0x44a994[_0x276d('0x2f')][_0x276d('0x33')]));_0x590af4[_0x276d('0x31')]=_0x590af4[_0x276d('0x31')][_0x276d('0x34')]?_0x590af4[_0x276d('0x31')]:_0x2fe1b5[_0x276d('0x2d')];if(!_0x44a994['query'][_0x276d('0x35')](_0x276d('0x36'))){_0x590af4['limit']=qs[_0x276d('0x1a')](_0x44a994[_0x276d('0x2f')]['limit']);_0x590af4[_0x276d('0x18')]=qs[_0x276d('0x18')](_0x44a994[_0x276d('0x2f')]['offset']);}_0x590af4[_0x276d('0x37')]=qs['sort'](_0x44a994[_0x276d('0x2f')][_0x276d('0x38')]);_0x590af4[_0x276d('0x39')]=qs[_0x276d('0x30')](_[_0x276d('0x3a')](_0x44a994[_0x276d('0x2f')],_0x2fe1b5['filters']),_0x3bc269);if(_0x44a994['query'][_0x276d('0x3b')]){_0x590af4['where']=_['merge'](_0x590af4[_0x276d('0x39')],{'$or':_[_0x276d('0x27')](_0x3bc269,function(_0x1a13aa){if(_0x1a13aa[_0x276d('0x2b')]!==_0x276d('0x3c')){var _0x219adc={};_0x219adc[_0x1a13aa['name']]={'$like':'%'+_0x44a994[_0x276d('0x2f')][_0x276d('0x3b')]+'%'};return _0x219adc;}})});}_0x590af4=_[_0x276d('0x3d')]({},_0x590af4,_0x44a994[_0x276d('0x3e')]);var _0xbf7db6={'where':_0x590af4['where']};return db[_0x276d('0x28')]['count'](_0xbf7db6)['then'](function(_0xd77bf){_0x36ba6b[_0x276d('0x1b')]=_0xd77bf;if(_0x44a994[_0x276d('0x2f')][_0x276d('0x3f')]){_0x590af4[_0x276d('0x40')]=[{'all':!![]}];}return db[_0x276d('0x28')][_0x276d('0x41')](_0x590af4);})['then'](function(_0x2063bf){_0x36ba6b[_0x276d('0x42')]=_0x2063bf;return _0x36ba6b;})[_0x276d('0x21')](respondWithFilteredResult(_0x3c538f,_0x590af4))[_0x276d('0x43')](handleError(_0x3c538f,null));};exports['show']=function(_0x502623,_0x45ea63){var _0x495f06={'raw':![],'where':{'id':_0x502623[_0x276d('0x44')]['id']}},_0x22e096={};_0x22e096[_0x276d('0x2d')]=_['keys'](db[_0x276d('0x28')][_0x276d('0x29')]);_0x22e096[_0x276d('0x2f')]=_[_0x276d('0x45')](_0x502623[_0x276d('0x2f')]);_0x22e096['filters']=_['intersection'](_0x22e096[_0x276d('0x2d')],_0x22e096[_0x276d('0x2f')]);_0x495f06[_0x276d('0x31')]=_[_0x276d('0x32')](_0x22e096['model'],qs[_0x276d('0x33')](_0x502623['query'][_0x276d('0x33')]));_0x495f06[_0x276d('0x31')]=_0x495f06[_0x276d('0x31')][_0x276d('0x34')]?_0x495f06[_0x276d('0x31')]:_0x22e096[_0x276d('0x2d')];if(_0x502623[_0x276d('0x2f')]['includeAll']){_0x495f06[_0x276d('0x40')]=[{'all':!![]}];}_0x495f06=_[_0x276d('0x3d')]({},_0x495f06,_0x502623[_0x276d('0x3e')]);return db[_0x276d('0x28')]['find'](_0x495f06)[_0x276d('0x21')](handleEntityNotFound(_0x45ea63,null))[_0x276d('0x21')](respondWithResult(_0x45ea63,null))[_0x276d('0x43')](handleError(_0x45ea63,null));};exports['create']=function(_0x764eed,_0x1fe3d1){return db['SugarcrmConfiguration'][_0x276d('0x46')](_0x764eed['body'],{})[_0x276d('0x21')](respondWithResult(_0x1fe3d1,0xc9))[_0x276d('0x43')](handleError(_0x1fe3d1,null));};exports[_0x276d('0x47')]=function(_0x2a5823,_0x43fe13){if(_0x2a5823[_0x276d('0x48')]['id']){delete _0x2a5823[_0x276d('0x48')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x2a5823[_0x276d('0x44')]['id']}})[_0x276d('0x21')](handleEntityNotFound(_0x43fe13,null))[_0x276d('0x21')](saveUpdates(_0x2a5823[_0x276d('0x48')],null))[_0x276d('0x21')](respondWithResult(_0x43fe13,null))[_0x276d('0x43')](handleError(_0x43fe13,null));};exports[_0x276d('0x22')]=function(_0x103fe8,_0x1bda13){return db['SugarcrmConfiguration'][_0x276d('0x49')]({'where':{'id':_0x103fe8[_0x276d('0x44')]['id']}})[_0x276d('0x21')](handleEntityNotFound(_0x1bda13,null))[_0x276d('0x21')](removeEntity(_0x1bda13,null))['catch'](handleError(_0x1bda13,null));};exports[_0x276d('0x4a')]=function(_0x24a9b0,_0x4d65e7,_0x2029e7){var _0xc2c86b={};var _0x28bce9={};var _0x25ad67;var _0x31d7f6;return db[_0x276d('0x28')][_0x276d('0x4b')]({'where':{'id':_0x24a9b0['params']['id']}})['then'](handleEntityNotFound(_0x4d65e7,null))[_0x276d('0x21')](function(_0x8a7a39){if(_0x8a7a39){_0x25ad67=_0x8a7a39;_0x28bce9['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x28bce9[_0x276d('0x2f')]=_['keys'](_0x24a9b0['query']);_0x28bce9[_0x276d('0x30')]=_[_0x276d('0x32')](_0x28bce9[_0x276d('0x2d')],_0x28bce9[_0x276d('0x2f')]);_0xc2c86b['attributes']=_[_0x276d('0x32')](_0x28bce9['model'],qs[_0x276d('0x33')](_0x24a9b0[_0x276d('0x2f')]['fields']));_0xc2c86b[_0x276d('0x31')]=_0xc2c86b[_0x276d('0x31')][_0x276d('0x34')]?_0xc2c86b[_0x276d('0x31')]:_0x28bce9[_0x276d('0x2d')];_0xc2c86b[_0x276d('0x37')]=qs[_0x276d('0x38')](_0x24a9b0['query'][_0x276d('0x38')]);_0xc2c86b['where']=qs[_0x276d('0x30')](_[_0x276d('0x3a')](_0x24a9b0['query'],_0x28bce9[_0x276d('0x30')]));if(_0x24a9b0['query']['filter']){_0xc2c86b[_0x276d('0x39')]=_[_0x276d('0x3d')](_0xc2c86b[_0x276d('0x39')],{'$or':_[_0x276d('0x27')](_0xc2c86b[_0x276d('0x31')],function(_0x3b5883){var _0x3bce5e={};_0x3bce5e[_0x3b5883]={'$like':'%'+_0x24a9b0[_0x276d('0x2f')]['filter']+'%'};return _0x3bce5e;})});}_0xc2c86b=_[_0x276d('0x3d')]({},_0xc2c86b,_0x24a9b0[_0x276d('0x3e')]);return _0x25ad67['getFields'](_0xc2c86b);}})[_0x276d('0x21')](function(_0x3169a5){if(_0x3169a5){_0x31d7f6=_0x3169a5[_0x276d('0x34')];if(!_0x24a9b0[_0x276d('0x2f')]['hasOwnProperty'](_0x276d('0x36'))){_0xc2c86b[_0x276d('0x1a')]=qs['limit'](_0x24a9b0[_0x276d('0x2f')][_0x276d('0x1a')]);_0xc2c86b[_0x276d('0x18')]=qs[_0x276d('0x18')](_0x24a9b0[_0x276d('0x2f')][_0x276d('0x18')]);}return _0x25ad67[_0x276d('0x4a')](_0xc2c86b);}})['then'](function(_0x3b6229){if(_0x3b6229){return _0x3b6229?{'count':_0x31d7f6,'rows':_0x3b6229}:null;}})[_0x276d('0x21')](respondWithResult(_0x4d65e7,null))[_0x276d('0x43')](handleError(_0x4d65e7,null));};exports[_0x276d('0x4c')]=function(_0x33048a,_0x54772f,_0x42b14f){var _0x5df9c7={};var _0xcdc7d5={};var _0x5c5e17;var _0x3d6440;return db[_0x276d('0x28')][_0x276d('0x4b')]({'where':{'id':_0x33048a[_0x276d('0x44')]['id']}})['then'](handleEntityNotFound(_0x54772f,null))[_0x276d('0x21')](function(_0x4ddd45){if(_0x4ddd45){_0x5c5e17=_0x4ddd45;_0xcdc7d5[_0x276d('0x2d')]=_['keys'](db['SugarcrmField'][_0x276d('0x29')]);_0xcdc7d5['query']=_['keys'](_0x33048a[_0x276d('0x2f')]);_0xcdc7d5[_0x276d('0x30')]=_[_0x276d('0x32')](_0xcdc7d5['model'],_0xcdc7d5[_0x276d('0x2f')]);_0x5df9c7['attributes']=_[_0x276d('0x32')](_0xcdc7d5[_0x276d('0x2d')],qs[_0x276d('0x33')](_0x33048a[_0x276d('0x2f')]['fields']));_0x5df9c7[_0x276d('0x31')]=_0x5df9c7[_0x276d('0x31')]['length']?_0x5df9c7['attributes']:_0xcdc7d5['model'];_0x5df9c7[_0x276d('0x37')]=qs[_0x276d('0x38')](_0x33048a[_0x276d('0x2f')]['sort']);_0x5df9c7[_0x276d('0x39')]=qs[_0x276d('0x30')](_[_0x276d('0x3a')](_0x33048a[_0x276d('0x2f')],_0xcdc7d5[_0x276d('0x30')]));if(_0x33048a[_0x276d('0x2f')][_0x276d('0x3b')]){_0x5df9c7[_0x276d('0x39')]=_[_0x276d('0x3d')](_0x5df9c7[_0x276d('0x39')],{'$or':_['map'](_0x5df9c7['attributes'],function(_0x4e303b){var _0x274c8b={};_0x274c8b[_0x4e303b]={'$like':'%'+_0x33048a['query']['filter']+'%'};return _0x274c8b;})});}_0x5df9c7=_[_0x276d('0x3d')]({},_0x5df9c7,_0x33048a[_0x276d('0x3e')]);return _0x5c5e17['getSubjects'](_0x5df9c7);}})[_0x276d('0x21')](function(_0x3f21fd){if(_0x3f21fd){_0x3d6440=_0x3f21fd[_0x276d('0x34')];if(!_0x33048a[_0x276d('0x2f')]['hasOwnProperty'](_0x276d('0x36'))){_0x5df9c7['limit']=qs[_0x276d('0x1a')](_0x33048a[_0x276d('0x2f')][_0x276d('0x1a')]);_0x5df9c7[_0x276d('0x18')]=qs[_0x276d('0x18')](_0x33048a['query'][_0x276d('0x18')]);}return _0x5c5e17[_0x276d('0x4c')](_0x5df9c7);}})[_0x276d('0x21')](function(_0x45ec76){if(_0x45ec76){return _0x45ec76?{'count':_0x3d6440,'rows':_0x45ec76}:null;}})[_0x276d('0x21')](respondWithResult(_0x54772f,null))[_0x276d('0x43')](handleError(_0x54772f,null));};exports[_0x276d('0x4d')]=function(_0x32fb0d,_0x39b72e,_0x1deb6d){var _0xd5238f={};var _0x250d93={};var _0x2bc39e;var _0x6f7110;return db[_0x276d('0x28')]['findOne']({'where':{'id':_0x32fb0d[_0x276d('0x44')]['id']}})['then'](handleEntityNotFound(_0x39b72e,null))['then'](function(_0x5d59e2){if(_0x5d59e2){_0x2bc39e=_0x5d59e2;_0x250d93['model']=_[_0x276d('0x45')](db['SugarcrmField']['rawAttributes']);_0x250d93['query']=_['keys'](_0x32fb0d[_0x276d('0x2f')]);_0x250d93[_0x276d('0x30')]=_[_0x276d('0x32')](_0x250d93[_0x276d('0x2d')],_0x250d93[_0x276d('0x2f')]);_0xd5238f[_0x276d('0x31')]=_['intersection'](_0x250d93[_0x276d('0x2d')],qs[_0x276d('0x33')](_0x32fb0d['query']['fields']));_0xd5238f[_0x276d('0x31')]=_0xd5238f[_0x276d('0x31')][_0x276d('0x34')]?_0xd5238f[_0x276d('0x31')]:_0x250d93[_0x276d('0x2d')];_0xd5238f[_0x276d('0x37')]=qs[_0x276d('0x38')](_0x32fb0d[_0x276d('0x2f')]['sort']);_0xd5238f[_0x276d('0x39')]=qs[_0x276d('0x30')](_[_0x276d('0x3a')](_0x32fb0d['query'],_0x250d93[_0x276d('0x30')]));if(_0x32fb0d[_0x276d('0x2f')][_0x276d('0x3b')]){_0xd5238f[_0x276d('0x39')]=_[_0x276d('0x3d')](_0xd5238f[_0x276d('0x39')],{'$or':_[_0x276d('0x27')](_0xd5238f['attributes'],function(_0x2c8d36){var _0x5b98f8={};_0x5b98f8[_0x2c8d36]={'$like':'%'+_0x32fb0d[_0x276d('0x2f')][_0x276d('0x3b')]+'%'};return _0x5b98f8;})});}_0xd5238f=_[_0x276d('0x3d')]({},_0xd5238f,_0x32fb0d['options']);return _0x2bc39e['getDescriptions'](_0xd5238f);}})[_0x276d('0x21')](function(_0x958567){if(_0x958567){_0x6f7110=_0x958567[_0x276d('0x34')];if(!_0x32fb0d[_0x276d('0x2f')][_0x276d('0x35')](_0x276d('0x36'))){_0xd5238f['limit']=qs[_0x276d('0x1a')](_0x32fb0d[_0x276d('0x2f')][_0x276d('0x1a')]);_0xd5238f[_0x276d('0x18')]=qs[_0x276d('0x18')](_0x32fb0d['query'][_0x276d('0x18')]);}return _0x2bc39e[_0x276d('0x4d')](_0xd5238f);}})['then'](function(_0x4e4535){if(_0x4e4535){return _0x4e4535?{'count':_0x6f7110,'rows':_0x4e4535}:null;}})['then'](respondWithResult(_0x39b72e,null))[_0x276d('0x43')](handleError(_0x39b72e,null));};
\ No newline at end of file
index ff3a2ef..de54ce3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9e5=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x400b88,_0x5f32f7){var _0x311c8e=function(_0x5aa274){while(--_0x5aa274){_0x400b88['push'](_0x400b88['shift']());}};_0x311c8e(++_0x5f32f7);}(_0xe9e5,0x1bf));var _0x5e9e=function(_0x40de19,_0x3d2ba3){_0x40de19=_0x40de19-0x0;var _0x38b0ae=_0xe9e5[_0x40de19];return _0x38b0ae;};'use strict';var _=require(_0x5e9e('0x0'));var util=require('util');var logger=require(_0x5e9e('0x1'))(_0x5e9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e9e('0x3'));var fs=require('fs');var path=require(_0x5e9e('0x4'));var rimraf=require(_0x5e9e('0x5'));var config=require(_0x5e9e('0x6'));var attributes=require(_0x5e9e('0x7'));module[_0x5e9e('0x8')]=function(_0x171a3d,_0x41e6d6){return _0x171a3d[_0x5e9e('0x9')](_0x5e9e('0xa'),attributes,{'tableName':_0x5e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e94=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x46cef1,_0x77d760){var _0x3a7780=function(_0x287afe){while(--_0x287afe){_0x46cef1['push'](_0x46cef1['shift']());}};_0x3a7780(++_0x77d760);}(_0x9e94,0xe0));var _0x49e9=function(_0x1b7aed,_0x281572){_0x1b7aed=_0x1b7aed-0x0;var _0x379e9f=_0x9e94[_0x1b7aed];return _0x379e9f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49e9('0x0'))('api');var moment=require(_0x49e9('0x1'));var BPromise=require(_0x49e9('0x2'));var rp=require(_0x49e9('0x3'));var fs=require('fs');var path=require(_0x49e9('0x4'));var rimraf=require(_0x49e9('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x49e9('0x6')]=function(_0x50169b,_0x38bf28){return _0x50169b[_0x49e9('0x7')](_0x49e9('0x8'),attributes,{'tableName':_0x49e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 815f652..786f68a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6ce=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x7c87f9,_0x542ea9){var _0x3a15a9=function(_0x3636ea){while(--_0x3636ea){_0x7c87f9['push'](_0x7c87f9['shift']());}};_0x3a15a9(++_0x542ea9);}(_0xd6ce,0x1b7));var _0xed6c=function(_0x7bc1d5,_0x5e39c8){_0x7bc1d5=_0x7bc1d5-0x0;var _0x158746=_0xd6ce[_0x7bc1d5];return _0x158746;};'use strict';var _=require(_0xed6c('0x0'));var util=require('util');var moment=require(_0xed6c('0x1'));var BPromise=require(_0xed6c('0x2'));var rs=require(_0xed6c('0x3'));var fs=require('fs');var Redis=require(_0xed6c('0x4'));var db=require(_0xed6c('0x5'))['db'];var utils=require(_0xed6c('0x6'));var logger=require(_0xed6c('0x7'))('rpc');var config=require(_0xed6c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed6c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dcbb1,_0x267ce6,_0x48d3ff){return new BPromise(function(_0x12639d,_0xa80540){return client[_0xed6c('0xa')](_0x5dcbb1,_0x48d3ff)[_0xed6c('0xb')](function(_0x2905e1){logger[_0xed6c('0xc')](_0xed6c('0xd'),_0x267ce6,_0xed6c('0xe'));logger['debug'](_0xed6c('0xf'),_0x267ce6,_0xed6c('0xe'),JSON['stringify'](_0x2905e1));if(_0x2905e1['error']){if(_0x2905e1[_0xed6c('0x10')]['code']===0x1f4){logger[_0xed6c('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x267ce6,_0x2905e1[_0xed6c('0x10')][_0xed6c('0x11')]);return _0xa80540(_0x2905e1[_0xed6c('0x10')]['message']);}logger['error'](_0xed6c('0xd'),_0x267ce6,_0x2905e1[_0xed6c('0x10')][_0xed6c('0x11')]);return _0x12639d(_0x2905e1[_0xed6c('0x10')][_0xed6c('0x11')]);}else{logger[_0xed6c('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x267ce6,_0xed6c('0xe'));_0x12639d(_0x2905e1['result'][_0xed6c('0x11')]);}})[_0xed6c('0x12')](function(_0x4e90a4){logger['error'](_0xed6c('0xd'),_0x267ce6,_0x4e90a4);_0xa80540(_0x4e90a4);});});}
\ No newline at end of file
+var _0xf759=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x389dd7,_0x5d3992){var _0x1ac061=function(_0x46c9aa){while(--_0x46c9aa){_0x389dd7['push'](_0x389dd7['shift']());}};_0x1ac061(++_0x5d3992);}(_0xf759,0x164));var _0x9f75=function(_0x49a015,_0x31c561){_0x49a015=_0x49a015-0x0;var _0x9d9e5c=_0xf759[_0x49a015];return _0x9d9e5c;};'use strict';var _=require(_0x9f75('0x0'));var util=require(_0x9f75('0x1'));var moment=require(_0x9f75('0x2'));var BPromise=require(_0x9f75('0x3'));var rs=require(_0x9f75('0x4'));var fs=require('fs');var Redis=require(_0x9f75('0x5'));var db=require(_0x9f75('0x6'))['db'];var utils=require(_0x9f75('0x7'));var logger=require(_0x9f75('0x8'))(_0x9f75('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f75('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323ced,_0x5b7f40,_0x468e7d){return new BPromise(function(_0x43f51c,_0x579df6){return client[_0x9f75('0xb')](_0x323ced,_0x468e7d)['then'](function(_0x1c5f16){logger[_0x9f75('0xc')](_0x9f75('0xd'),_0x5b7f40,'request\x20sent');logger[_0x9f75('0xe')](_0x9f75('0xf'),_0x5b7f40,_0x9f75('0x10'),JSON[_0x9f75('0x11')](_0x1c5f16));if(_0x1c5f16[_0x9f75('0x12')]){if(_0x1c5f16[_0x9f75('0x12')][_0x9f75('0x13')]===0x1f4){logger[_0x9f75('0x12')](_0x9f75('0xd'),_0x5b7f40,_0x1c5f16[_0x9f75('0x12')]['message']);return _0x579df6(_0x1c5f16[_0x9f75('0x12')][_0x9f75('0x14')]);}logger[_0x9f75('0x12')](_0x9f75('0xd'),_0x5b7f40,_0x1c5f16['error'][_0x9f75('0x14')]);return _0x43f51c(_0x1c5f16['error'][_0x9f75('0x14')]);}else{logger[_0x9f75('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5b7f40,'request\x20sent');_0x43f51c(_0x1c5f16['result'][_0x9f75('0x14')]);}})[_0x9f75('0x15')](function(_0x4fd70c){logger['error'](_0x9f75('0xd'),_0x5b7f40,_0x4fd70c);_0x579df6(_0x4fd70c);});});}
\ No newline at end of file
index c7e1cb2..9ac1e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9add=['put','/:id','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','create'];(function(_0x121a2b,_0x2b2e4f){var _0x79c3db=function(_0x48bc04){while(--_0x48bc04){_0x121a2b['push'](_0x121a2b['shift']());}};_0x79c3db(++_0x2b2e4f);}(_0x9add,0x182));var _0xd9ad=function(_0x5dddd0,_0x3732e6){_0x5dddd0=_0x5dddd0-0x0;var _0x343a06=_0x9add[_0x5dddd0];return _0x343a06;};'use strict';var multer=require('multer');var util=require(_0xd9ad('0x0'));var path=require('path');var timeout=require(_0xd9ad('0x1'));var express=require(_0xd9ad('0x2'));var router=express['Router']();var fs_extra=require(_0xd9ad('0x3'));var auth=require(_0xd9ad('0x4'));var interaction=require(_0xd9ad('0x5'));var config=require(_0xd9ad('0x6'));var controller=require(_0xd9ad('0x7'));router[_0xd9ad('0x8')]('/',auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xa')]);router[_0xd9ad('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd9ad('0xb')]);router['post']('/',auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xc')]);router[_0xd9ad('0xd')](_0xd9ad('0xe'),auth['isAuthenticated'](),controller[_0xd9ad('0xf')]);router[_0xd9ad('0x10')]('/:id',auth[_0xd9ad('0x9')](),controller[_0xd9ad('0x11')]);module[_0xd9ad('0x12')]=router;
\ No newline at end of file
+var _0xdcea=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x32f91b,_0x460016){var _0x3ee8f3=function(_0x39b27d){while(--_0x39b27d){_0x32f91b['push'](_0x32f91b['shift']());}};_0x3ee8f3(++_0x460016);}(_0xdcea,0x119));var _0xadce=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0xdcea[_0x1fb1c1];return _0x1622df;};'use strict';var multer=require(_0xadce('0x0'));var util=require(_0xadce('0x1'));var path=require(_0xadce('0x2'));var timeout=require(_0xadce('0x3'));var express=require(_0xadce('0x4'));var router=express[_0xadce('0x5')]();var fs_extra=require(_0xadce('0x6'));var auth=require(_0xadce('0x7'));var interaction=require(_0xadce('0x8'));var config=require(_0xadce('0x9'));var controller=require(_0xadce('0xa'));router[_0xadce('0xb')]('/',auth[_0xadce('0xc')](),controller[_0xadce('0xd')]);router[_0xadce('0xb')](_0xadce('0xe'),auth[_0xadce('0xc')](),controller['show']);router[_0xadce('0xf')]('/',auth[_0xadce('0xc')](),controller[_0xadce('0x10')]);router[_0xadce('0x11')](_0xadce('0xe'),auth[_0xadce('0xc')](),controller[_0xadce('0x12')]);router['delete'](_0xadce('0xe'),auth[_0xadce('0xc')](),controller['destroy']);module[_0xadce('0x13')]=router;
\ No newline at end of file
index 603b03d..465974b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a90=['variable','customVariable','keyValue','picklist','STRING','sequelize','ENUM','string'];(function(_0x3e7c5b,_0x3b1c48){var _0xe55f36=function(_0x538b5c){while(--_0x538b5c){_0x3e7c5b['push'](_0x3e7c5b['shift']());}};_0xe55f36(++_0x3b1c48);}(_0x7a90,0xa5));var _0x07a9=function(_0x5d1021,_0xb900b5){_0x5d1021=_0x5d1021-0x0;var _0xc32d44=_0x7a90[_0x5d1021];return _0xc32d44;};'use strict';var Sequelize=require(_0x07a9('0x0'));module['exports']={'type':{'type':Sequelize[_0x07a9('0x1')](_0x07a9('0x2'),_0x07a9('0x3'),_0x07a9('0x4'),_0x07a9('0x5'),_0x07a9('0x6')),'defaultValue':_0x07a9('0x2')},'content':{'type':Sequelize[_0x07a9('0x7')]},'key':{'type':Sequelize[_0x07a9('0x7')]},'keyType':{'type':Sequelize[_0x07a9('0x1')](_0x07a9('0x2'),_0x07a9('0x3'),_0x07a9('0x4'))},'keyContent':{'type':Sequelize[_0x07a9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x07a9('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x07a9('0x7')]}};
\ No newline at end of file
+var _0x816b=['exports','variable','customVariable','keyValue','picklist','string','STRING','sequelize'];(function(_0x30fdf9,_0x89096d){var _0x3c43bb=function(_0x40a755){while(--_0x40a755){_0x30fdf9['push'](_0x30fdf9['shift']());}};_0x3c43bb(++_0x89096d);}(_0x816b,0x19f));var _0xb816=function(_0x54e832,_0x13182c){_0x54e832=_0x54e832-0x0;var _0x47f980=_0x816b[_0x54e832];return _0x47f980;};'use strict';var Sequelize=require(_0xb816('0x0'));module[_0xb816('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xb816('0x2'),_0xb816('0x3'),_0xb816('0x4'),_0xb816('0x5')),'defaultValue':_0xb816('0x6')},'content':{'type':Sequelize[_0xb816('0x7')]},'key':{'type':Sequelize[_0xb816('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xb816('0x6'),_0xb816('0x2'),_0xb816('0x3'))},'keyContent':{'type':Sequelize[_0xb816('0x7')]},'idField':{'type':Sequelize[_0xb816('0x7')]},'nameField':{'type':Sequelize[_0xb816('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb816('0x7')]}};
\ No newline at end of file
index 3360653..d4355db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf52a=['limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','rows','catch','keys','include','options','find','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0xbe8942,_0x33e89e){var _0x30a5c7=function(_0x7e5f90){while(--_0x7e5f90){_0xbe8942['push'](_0xbe8942['shift']());}};_0x30a5c7(++_0x33e89e);}(_0xf52a,0xbd));var _0xaf52=function(_0x4e2331,_0x196c14){_0x4e2331=_0x4e2331-0x0;var _0x4a130e=_0xf52a[_0x4e2331];return _0x4a130e;};'use strict';var emlformat=require(_0xaf52('0x0'));var rimraf=require(_0xaf52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaf52('0x2'));var moment=require(_0xaf52('0x3'));var BPromise=require(_0xaf52('0x4'));var Mustache=require('mustache');var util=require(_0xaf52('0x5'));var path=require(_0xaf52('0x6'));var sox=require(_0xaf52('0x7'));var csv=require(_0xaf52('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaf52('0x9'));var deskjs=require(_0xaf52('0xa'));var toCsv=require(_0xaf52('0x8'));var querystring=require('querystring');var Papa=require(_0xaf52('0xb'));var Redis=require(_0xaf52('0xc'));var authService=require(_0xaf52('0xd'));var qs=require(_0xaf52('0xe'));var as=require(_0xaf52('0xf'));var hardwareService=require(_0xaf52('0x10'));var logger=require(_0xaf52('0x11'))(_0xaf52('0x12'));var utils=require('../../config/utils');var config=require(_0xaf52('0x13'));var licenseUtil=require(_0xaf52('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36296f,_0x5b28b7){_0x5b28b7=_0x5b28b7||0xcc;return function(_0x2ee79c){if(_0x2ee79c){return _0x36296f[_0xaf52('0x15')](_0x5b28b7);}return _0x36296f[_0xaf52('0x16')](_0x5b28b7)[_0xaf52('0x17')]();};}function respondWithResult(_0x2340e2,_0x4f2d5d){_0x4f2d5d=_0x4f2d5d||0xc8;return function(_0x1a7926){if(_0x1a7926){return _0x2340e2['status'](_0x4f2d5d)[_0xaf52('0x18')](_0x1a7926);}};}function respondWithFilteredResult(_0xb6b7e2,_0x68ba1e){return function(_0x362af8){if(_0x362af8){var _0x78d4af=typeof _0x68ba1e[_0xaf52('0x19')]===_0xaf52('0x1a')&&typeof _0x68ba1e[_0xaf52('0x1b')]===_0xaf52('0x1a');var _0x3957d4=_0x362af8['count'];var _0xe6cbdb=_0x78d4af?0x0:_0x68ba1e[_0xaf52('0x19')];var _0x1fb95c=_0x78d4af?_0x362af8['count']:_0x68ba1e[_0xaf52('0x19')]+_0x68ba1e[_0xaf52('0x1b')];var _0x33602c;if(_0x1fb95c>=_0x3957d4){_0x1fb95c=_0x3957d4;_0x33602c=0xc8;}else{_0x33602c=0xce;}_0xb6b7e2[_0xaf52('0x16')](_0x33602c);return _0xb6b7e2[_0xaf52('0x1c')](_0xaf52('0x1d'),_0xe6cbdb+'-'+_0x1fb95c+'/'+_0x3957d4)['json'](_0x362af8);}return null;};}function patchUpdates(_0x27a074){return function(_0x10f116){try{jsonpatch[_0xaf52('0x1e')](_0x10f116,_0x27a074,!![]);}catch(_0x59cedd){return BPromise[_0xaf52('0x1f')](_0x59cedd);}return _0x10f116[_0xaf52('0x20')]();};}function saveUpdates(_0x409b6a,_0x208089){return function(_0x2c5c7c){if(_0x2c5c7c){return _0x2c5c7c[_0xaf52('0x21')](_0x409b6a)['then'](function(_0x30cbd1){return _0x30cbd1;});}return null;};}function removeEntity(_0x5f28ec,_0x1a9d7d){return function(_0x5dff12){if(_0x5dff12){return _0x5dff12[_0xaf52('0x22')]()[_0xaf52('0x23')](function(){_0x5f28ec['status'](0xcc)[_0xaf52('0x17')]();});}};}function handleEntityNotFound(_0x1366ed,_0x4daa98){return function(_0x4d482b){if(!_0x4d482b){_0x1366ed[_0xaf52('0x15')](0x194);}return _0x4d482b;};}function handleError(_0x5e7d25,_0x4d82f0){_0x4d82f0=_0x4d82f0||0x1f4;return function(_0x20909b){logger['error'](_0x20909b[_0xaf52('0x24')]);if(_0x20909b[_0xaf52('0x25')]){delete _0x20909b[_0xaf52('0x25')];}_0x5e7d25[_0xaf52('0x16')](_0x4d82f0)[_0xaf52('0x26')](_0x20909b);};}exports[_0xaf52('0x27')]=function(_0x454021,_0x107b68){var _0x4709f4={},_0x34c299={},_0x44acc4={'count':0x0,'rows':[]};var _0x58be4d=_[_0xaf52('0x28')](db[_0xaf52('0x29')][_0xaf52('0x2a')],function(_0x5d7d78){return{'name':_0x5d7d78[_0xaf52('0x2b')],'type':_0x5d7d78[_0xaf52('0x2c')]['key']};});_0x34c299[_0xaf52('0x2d')]=_[_0xaf52('0x28')](_0x58be4d,_0xaf52('0x25'));_0x34c299[_0xaf52('0x2e')]=_['keys'](_0x454021[_0xaf52('0x2e')]);_0x34c299[_0xaf52('0x2f')]=_['intersection'](_0x34c299[_0xaf52('0x2d')],_0x34c299[_0xaf52('0x2e')]);_0x4709f4[_0xaf52('0x30')]=_[_0xaf52('0x31')](_0x34c299['model'],qs[_0xaf52('0x32')](_0x454021[_0xaf52('0x2e')]['fields']));_0x4709f4[_0xaf52('0x30')]=_0x4709f4[_0xaf52('0x30')][_0xaf52('0x33')]?_0x4709f4['attributes']:_0x34c299['model'];if(!_0x454021['query'][_0xaf52('0x34')](_0xaf52('0x35'))){_0x4709f4[_0xaf52('0x1b')]=qs[_0xaf52('0x1b')](_0x454021[_0xaf52('0x2e')][_0xaf52('0x1b')]);_0x4709f4[_0xaf52('0x19')]=qs[_0xaf52('0x19')](_0x454021[_0xaf52('0x2e')][_0xaf52('0x19')]);}_0x4709f4[_0xaf52('0x36')]=qs[_0xaf52('0x37')](_0x454021['query'][_0xaf52('0x37')]);_0x4709f4[_0xaf52('0x38')]=qs[_0xaf52('0x2f')](_[_0xaf52('0x39')](_0x454021[_0xaf52('0x2e')],_0x34c299[_0xaf52('0x2f')]),_0x58be4d);if(_0x454021['query'][_0xaf52('0x3a')]){_0x4709f4['where']=_[_0xaf52('0x3b')](_0x4709f4[_0xaf52('0x38')],{'$or':_[_0xaf52('0x28')](_0x58be4d,function(_0x325781){if(_0x325781[_0xaf52('0x2c')]!==_0xaf52('0x3c')){var _0x24a9fd={};_0x24a9fd[_0x325781[_0xaf52('0x25')]]={'$like':'%'+_0x454021[_0xaf52('0x2e')][_0xaf52('0x3a')]+'%'};return _0x24a9fd;}})});}_0x4709f4=_['merge']({},_0x4709f4,_0x454021['options']);var _0x232ace={'where':_0x4709f4['where']};return db['SugarcrmField'][_0xaf52('0x3d')](_0x232ace)['then'](function(_0x4e362a){_0x44acc4[_0xaf52('0x3d')]=_0x4e362a;if(_0x454021[_0xaf52('0x2e')][_0xaf52('0x3e')]){_0x4709f4['include']=[{'all':!![]}];}return db[_0xaf52('0x29')]['findAll'](_0x4709f4);})['then'](function(_0x5bc979){_0x44acc4[_0xaf52('0x3f')]=_0x5bc979;return _0x44acc4;})[_0xaf52('0x23')](respondWithFilteredResult(_0x107b68,_0x4709f4))[_0xaf52('0x40')](handleError(_0x107b68,null));};exports['show']=function(_0x4e6374,_0x1329d7){var _0x2ab0b7={'raw':!![],'where':{'id':_0x4e6374['params']['id']}},_0x135f57={};_0x135f57[_0xaf52('0x2d')]=_[_0xaf52('0x41')](db[_0xaf52('0x29')][_0xaf52('0x2a')]);_0x135f57[_0xaf52('0x2e')]=_[_0xaf52('0x41')](_0x4e6374[_0xaf52('0x2e')]);_0x135f57[_0xaf52('0x2f')]=_['intersection'](_0x135f57[_0xaf52('0x2d')],_0x135f57[_0xaf52('0x2e')]);_0x2ab0b7['attributes']=_[_0xaf52('0x31')](_0x135f57[_0xaf52('0x2d')],qs['fields'](_0x4e6374['query']['fields']));_0x2ab0b7['attributes']=_0x2ab0b7['attributes'][_0xaf52('0x33')]?_0x2ab0b7['attributes']:_0x135f57[_0xaf52('0x2d')];if(_0x4e6374['query']['includeAll']){_0x2ab0b7[_0xaf52('0x42')]=[{'all':!![]}];}_0x2ab0b7=_[_0xaf52('0x3b')]({},_0x2ab0b7,_0x4e6374[_0xaf52('0x43')]);return db[_0xaf52('0x29')][_0xaf52('0x44')](_0x2ab0b7)['then'](handleEntityNotFound(_0x1329d7,null))[_0xaf52('0x23')](respondWithResult(_0x1329d7,null))[_0xaf52('0x40')](handleError(_0x1329d7,null));};exports[_0xaf52('0x45')]=function(_0x52523e,_0x427e8d){return db[_0xaf52('0x29')][_0xaf52('0x45')](_0x52523e[_0xaf52('0x46')],{})['then'](respondWithResult(_0x427e8d,0xc9))[_0xaf52('0x40')](handleError(_0x427e8d,null));};exports['update']=function(_0x4544d9,_0x566a8d){if(_0x4544d9['body']['id']){delete _0x4544d9[_0xaf52('0x46')]['id'];}return db[_0xaf52('0x29')][_0xaf52('0x44')]({'where':{'id':_0x4544d9[_0xaf52('0x47')]['id']}})['then'](handleEntityNotFound(_0x566a8d,null))[_0xaf52('0x23')](saveUpdates(_0x4544d9['body'],null))[_0xaf52('0x23')](respondWithResult(_0x566a8d,null))[_0xaf52('0x40')](handleError(_0x566a8d,null));};exports['destroy']=function(_0x5c809d,_0x2cda59){return db[_0xaf52('0x29')][_0xaf52('0x44')]({'where':{'id':_0x5c809d[_0xaf52('0x47')]['id']}})[_0xaf52('0x23')](handleEntityNotFound(_0x2cda59,null))[_0xaf52('0x23')](removeEntity(_0x2cda59,null))[_0xaf52('0x40')](handleError(_0x2cda59,null));};
\ No newline at end of file
+var _0xf8c4=['moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','send','map','SugarcrmField','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x403044,_0x117002){var _0xdf3618=function(_0x46ac61){while(--_0x46ac61){_0x403044['push'](_0x403044['shift']());}};_0xdf3618(++_0x117002);}(_0xf8c4,0x169));var _0x4f8c=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0xf8c4[_0x36f243];return _0x426436;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f8c('0x0'));var zipdir=require(_0x4f8c('0x1'));var jsonpatch=require(_0x4f8c('0x2'));var rp=require(_0x4f8c('0x3'));var moment=require(_0x4f8c('0x4'));var BPromise=require(_0x4f8c('0x5'));var Mustache=require(_0x4f8c('0x6'));var util=require('util');var path=require(_0x4f8c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f8c('0x8'));var squel=require(_0x4f8c('0x9'));var crypto=require(_0x4f8c('0xa'));var jsforce=require(_0x4f8c('0xb'));var deskjs=require(_0x4f8c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4f8c('0xd'));var Papa=require(_0x4f8c('0xe'));var Redis=require(_0x4f8c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4f8c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f8c('0x11'));var logger=require(_0x4f8c('0x12'))(_0x4f8c('0x13'));var utils=require(_0x4f8c('0x14'));var config=require(_0x4f8c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42e30a,_0x4604ad){_0x4604ad=_0x4604ad||0xcc;return function(_0x4fcbbf){if(_0x4fcbbf){return _0x42e30a[_0x4f8c('0x16')](_0x4604ad);}return _0x42e30a[_0x4f8c('0x17')](_0x4604ad)['end']();};}function respondWithResult(_0x5a690c,_0x75b2d){_0x75b2d=_0x75b2d||0xc8;return function(_0x2f5ca2){if(_0x2f5ca2){return _0x5a690c[_0x4f8c('0x17')](_0x75b2d)[_0x4f8c('0x18')](_0x2f5ca2);}};}function respondWithFilteredResult(_0x5cd0a2,_0x4cc3f4){return function(_0x3dcf55){if(_0x3dcf55){var _0x51b7d4=typeof _0x4cc3f4['offset']===_0x4f8c('0x19')&&typeof _0x4cc3f4[_0x4f8c('0x1a')]===_0x4f8c('0x19');var _0x47ce3d=_0x3dcf55[_0x4f8c('0x1b')];var _0x189619=_0x51b7d4?0x0:_0x4cc3f4[_0x4f8c('0x1c')];var _0x42658d=_0x51b7d4?_0x3dcf55[_0x4f8c('0x1b')]:_0x4cc3f4['offset']+_0x4cc3f4[_0x4f8c('0x1a')];var _0xd2a9a0;if(_0x42658d>=_0x47ce3d){_0x42658d=_0x47ce3d;_0xd2a9a0=0xc8;}else{_0xd2a9a0=0xce;}_0x5cd0a2['status'](_0xd2a9a0);return _0x5cd0a2[_0x4f8c('0x1d')](_0x4f8c('0x1e'),_0x189619+'-'+_0x42658d+'/'+_0x47ce3d)[_0x4f8c('0x18')](_0x3dcf55);}return null;};}function patchUpdates(_0x380064){return function(_0x17edf4){try{jsonpatch[_0x4f8c('0x1f')](_0x17edf4,_0x380064,!![]);}catch(_0x5bdd7d){return BPromise[_0x4f8c('0x20')](_0x5bdd7d);}return _0x17edf4[_0x4f8c('0x21')]();};}function saveUpdates(_0x25cf6c,_0x11852a){return function(_0x196cec){if(_0x196cec){return _0x196cec[_0x4f8c('0x22')](_0x25cf6c)[_0x4f8c('0x23')](function(_0x3ca2c9){return _0x3ca2c9;});}return null;};}function removeEntity(_0x3eef75,_0x4a1345){return function(_0xac57df){if(_0xac57df){return _0xac57df[_0x4f8c('0x24')]()[_0x4f8c('0x23')](function(){_0x3eef75[_0x4f8c('0x17')](0xcc)[_0x4f8c('0x25')]();});}};}function handleEntityNotFound(_0x2de314,_0x64bef1){return function(_0x397ae4){if(!_0x397ae4){_0x2de314['sendStatus'](0x194);}return _0x397ae4;};}function handleError(_0x2d50ee,_0x2a1e8d){_0x2a1e8d=_0x2a1e8d||0x1f4;return function(_0x632b70){logger[_0x4f8c('0x26')](_0x632b70['stack']);if(_0x632b70['name']){delete _0x632b70['name'];}_0x2d50ee[_0x4f8c('0x17')](_0x2a1e8d)[_0x4f8c('0x27')](_0x632b70);};}exports['index']=function(_0x2b9222,_0x1bf1a3){var _0xc37b3={},_0x220247={},_0x1be99a={'count':0x0,'rows':[]};var _0x45302c=_[_0x4f8c('0x28')](db[_0x4f8c('0x29')][_0x4f8c('0x2a')],function(_0x152982){return{'name':_0x152982[_0x4f8c('0x2b')],'type':_0x152982['type'][_0x4f8c('0x2c')]};});_0x220247[_0x4f8c('0x2d')]=_['map'](_0x45302c,_0x4f8c('0x2e'));_0x220247[_0x4f8c('0x2f')]=_[_0x4f8c('0x30')](_0x2b9222[_0x4f8c('0x2f')]);_0x220247[_0x4f8c('0x31')]=_['intersection'](_0x220247['model'],_0x220247[_0x4f8c('0x2f')]);_0xc37b3['attributes']=_[_0x4f8c('0x32')](_0x220247[_0x4f8c('0x2d')],qs[_0x4f8c('0x33')](_0x2b9222[_0x4f8c('0x2f')]['fields']));_0xc37b3[_0x4f8c('0x34')]=_0xc37b3['attributes'][_0x4f8c('0x35')]?_0xc37b3[_0x4f8c('0x34')]:_0x220247[_0x4f8c('0x2d')];if(!_0x2b9222[_0x4f8c('0x2f')][_0x4f8c('0x36')](_0x4f8c('0x37'))){_0xc37b3[_0x4f8c('0x1a')]=qs['limit'](_0x2b9222['query'][_0x4f8c('0x1a')]);_0xc37b3['offset']=qs[_0x4f8c('0x1c')](_0x2b9222['query'][_0x4f8c('0x1c')]);}_0xc37b3['order']=qs[_0x4f8c('0x38')](_0x2b9222['query']['sort']);_0xc37b3['where']=qs[_0x4f8c('0x31')](_['pick'](_0x2b9222[_0x4f8c('0x2f')],_0x220247[_0x4f8c('0x31')]),_0x45302c);if(_0x2b9222[_0x4f8c('0x2f')]['filter']){_0xc37b3[_0x4f8c('0x39')]=_[_0x4f8c('0x3a')](_0xc37b3[_0x4f8c('0x39')],{'$or':_[_0x4f8c('0x28')](_0x45302c,function(_0x54b8aa){if(_0x54b8aa[_0x4f8c('0x3b')]!==_0x4f8c('0x3c')){var _0xf03a06={};_0xf03a06[_0x54b8aa['name']]={'$like':'%'+_0x2b9222[_0x4f8c('0x2f')][_0x4f8c('0x3d')]+'%'};return _0xf03a06;}})});}_0xc37b3=_[_0x4f8c('0x3a')]({},_0xc37b3,_0x2b9222[_0x4f8c('0x3e')]);var _0x55d96f={'where':_0xc37b3[_0x4f8c('0x39')]};return db[_0x4f8c('0x29')]['count'](_0x55d96f)[_0x4f8c('0x23')](function(_0x16642c){_0x1be99a['count']=_0x16642c;if(_0x2b9222[_0x4f8c('0x2f')][_0x4f8c('0x3f')]){_0xc37b3[_0x4f8c('0x40')]=[{'all':!![]}];}return db[_0x4f8c('0x29')][_0x4f8c('0x41')](_0xc37b3);})[_0x4f8c('0x23')](function(_0x20058b){_0x1be99a[_0x4f8c('0x42')]=_0x20058b;return _0x1be99a;})[_0x4f8c('0x23')](respondWithFilteredResult(_0x1bf1a3,_0xc37b3))[_0x4f8c('0x43')](handleError(_0x1bf1a3,null));};exports[_0x4f8c('0x44')]=function(_0x50b1e6,_0xcf324e){var _0x4699ed={'raw':!![],'where':{'id':_0x50b1e6['params']['id']}},_0x4f2e40={};_0x4f2e40[_0x4f8c('0x2d')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x4f2e40[_0x4f8c('0x2f')]=_[_0x4f8c('0x30')](_0x50b1e6[_0x4f8c('0x2f')]);_0x4f2e40[_0x4f8c('0x31')]=_['intersection'](_0x4f2e40[_0x4f8c('0x2d')],_0x4f2e40[_0x4f8c('0x2f')]);_0x4699ed[_0x4f8c('0x34')]=_[_0x4f8c('0x32')](_0x4f2e40[_0x4f8c('0x2d')],qs['fields'](_0x50b1e6[_0x4f8c('0x2f')]['fields']));_0x4699ed[_0x4f8c('0x34')]=_0x4699ed[_0x4f8c('0x34')][_0x4f8c('0x35')]?_0x4699ed[_0x4f8c('0x34')]:_0x4f2e40[_0x4f8c('0x2d')];if(_0x50b1e6['query'][_0x4f8c('0x3f')]){_0x4699ed[_0x4f8c('0x40')]=[{'all':!![]}];}_0x4699ed=_[_0x4f8c('0x3a')]({},_0x4699ed,_0x50b1e6[_0x4f8c('0x3e')]);return db[_0x4f8c('0x29')][_0x4f8c('0x45')](_0x4699ed)['then'](handleEntityNotFound(_0xcf324e,null))[_0x4f8c('0x23')](respondWithResult(_0xcf324e,null))[_0x4f8c('0x43')](handleError(_0xcf324e,null));};exports[_0x4f8c('0x46')]=function(_0xf491b5,_0x262a7e){return db['SugarcrmField']['create'](_0xf491b5[_0x4f8c('0x47')],{})[_0x4f8c('0x23')](respondWithResult(_0x262a7e,0xc9))[_0x4f8c('0x43')](handleError(_0x262a7e,null));};exports['update']=function(_0x534315,_0x5ad216){if(_0x534315[_0x4f8c('0x47')]['id']){delete _0x534315[_0x4f8c('0x47')]['id'];}return db['SugarcrmField'][_0x4f8c('0x45')]({'where':{'id':_0x534315[_0x4f8c('0x48')]['id']}})[_0x4f8c('0x23')](handleEntityNotFound(_0x5ad216,null))[_0x4f8c('0x23')](saveUpdates(_0x534315[_0x4f8c('0x47')],null))['then'](respondWithResult(_0x5ad216,null))['catch'](handleError(_0x5ad216,null));};exports[_0x4f8c('0x24')]=function(_0x4b82a5,_0x431dee){return db[_0x4f8c('0x29')][_0x4f8c('0x45')]({'where':{'id':_0x4b82a5['params']['id']}})[_0x4f8c('0x23')](handleEntityNotFound(_0x431dee,null))['then'](removeEntity(_0x431dee,null))[_0x4f8c('0x43')](handleError(_0x431dee,null));};
\ No newline at end of file
index b580293..d636ae0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b17=['./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x5b17,0x117));var _0x75b1=function(_0x2ebf4b,_0x345501){_0x2ebf4b=_0x2ebf4b-0x0;var _0x221815=_0x5b17[_0x2ebf4b];return _0x221815;};'use strict';var _=require(_0x75b1('0x0'));var util=require(_0x75b1('0x1'));var logger=require('../../config/logger')(_0x75b1('0x2'));var moment=require(_0x75b1('0x3'));var BPromise=require(_0x75b1('0x4'));var rp=require(_0x75b1('0x5'));var fs=require('fs');var path=require(_0x75b1('0x6'));var rimraf=require(_0x75b1('0x7'));var config=require(_0x75b1('0x8'));var attributes=require(_0x75b1('0x9'));module['exports']=function(_0x29d448,_0x420c35){return _0x29d448[_0x75b1('0xa')](_0x75b1('0xb'),attributes,{'tableName':_0x75b1('0xc'),'paranoid':![],'indexes':[{'name':_0x75b1('0xd'),'fields':[_0x75b1('0xe'),_0x75b1('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xccab=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xccab,0x1be));var _0xbcca=function(_0x276cf2,_0x55f712){_0x276cf2=_0x276cf2-0x0;var _0xbc2037=_0xccab[_0x276cf2];return _0xbc2037;};'use strict';var _=require(_0xbcca('0x0'));var util=require(_0xbcca('0x1'));var logger=require(_0xbcca('0x2'))('api');var moment=require(_0xbcca('0x3'));var BPromise=require(_0xbcca('0x4'));var rp=require(_0xbcca('0x5'));var fs=require('fs');var path=require(_0xbcca('0x6'));var rimraf=require(_0xbcca('0x7'));var config=require(_0xbcca('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0xbcca('0x9')]=function(_0x3ad742,_0x229bed){return _0x3ad742[_0xbcca('0xa')](_0xbcca('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xbcca('0xc'),'fields':[_0xbcca('0xd'),_0xbcca('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index b152bdb..b3d50bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab24=['client','request','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x333aa3,_0x532ee7){var _0x338a78=function(_0x156084){while(--_0x156084){_0x333aa3['push'](_0x333aa3['shift']());}};_0x338a78(++_0x532ee7);}(_0xab24,0x136));var _0x4ab2=function(_0x166e84,_0x3924fa){_0x166e84=_0x166e84-0x0;var _0x328845=_0xab24[_0x166e84];return _0x328845;};'use strict';var _=require(_0x4ab2('0x0'));var util=require(_0x4ab2('0x1'));var moment=require(_0x4ab2('0x2'));var BPromise=require(_0x4ab2('0x3'));var rs=require(_0x4ab2('0x4'));var fs=require('fs');var Redis=require(_0x4ab2('0x5'));var db=require(_0x4ab2('0x6'))['db'];var utils=require(_0x4ab2('0x7'));var logger=require('../../config/logger')(_0x4ab2('0x8'));var config=require('../../config/environment');var jayson=require(_0x4ab2('0x9'));var client=jayson[_0x4ab2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x391370,_0x9f5e8b,_0x17071a){return new BPromise(function(_0x9330f0,_0x2417b8){return client[_0x4ab2('0xb')](_0x391370,_0x17071a)['then'](function(_0x29f340){logger['info'](_0x4ab2('0xc'),_0x9f5e8b,_0x4ab2('0xd'));logger[_0x4ab2('0xe')](_0x4ab2('0xf'),_0x9f5e8b,_0x4ab2('0xd'),JSON[_0x4ab2('0x10')](_0x29f340));if(_0x29f340['error']){if(_0x29f340['error']['code']===0x1f4){logger[_0x4ab2('0x11')](_0x4ab2('0xc'),_0x9f5e8b,_0x29f340[_0x4ab2('0x11')]['message']);return _0x2417b8(_0x29f340[_0x4ab2('0x11')][_0x4ab2('0x12')]);}logger[_0x4ab2('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x9f5e8b,_0x29f340['error'][_0x4ab2('0x12')]);return _0x9330f0(_0x29f340[_0x4ab2('0x11')][_0x4ab2('0x12')]);}else{logger['info'](_0x4ab2('0xc'),_0x9f5e8b,_0x4ab2('0xd'));_0x9330f0(_0x29f340[_0x4ab2('0x13')]['message']);}})['catch'](function(_0x523653){logger[_0x4ab2('0x11')](_0x4ab2('0xc'),_0x9f5e8b,_0x523653);_0x2417b8(_0x523653);});});}
\ No newline at end of file
+var _0xe60a=['SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0xe60a,0xff));var _0xae60=function(_0x429739,_0x4b5178){_0x429739=_0x429739-0x0;var _0x1d1c49=_0xe60a[_0x429739];return _0x1d1c49;};'use strict';var _=require('lodash');var util=require(_0xae60('0x0'));var moment=require(_0xae60('0x1'));var BPromise=require('bluebird');var rs=require(_0xae60('0x2'));var fs=require('fs');var Redis=require(_0xae60('0x3'));var db=require(_0xae60('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xae60('0x5'))(_0xae60('0x6'));var config=require(_0xae60('0x7'));var jayson=require(_0xae60('0x8'));var client=jayson['client'][_0xae60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24ea80,_0x12b42f,_0x4689db){return new BPromise(function(_0x214524,_0x10b7b9){return client[_0xae60('0xa')](_0x24ea80,_0x4689db)['then'](function(_0x2e4ccc){logger['info'](_0xae60('0xb'),_0x12b42f,_0xae60('0xc'));logger[_0xae60('0xd')](_0xae60('0xe'),_0x12b42f,_0xae60('0xc'),JSON['stringify'](_0x2e4ccc));if(_0x2e4ccc[_0xae60('0xf')]){if(_0x2e4ccc[_0xae60('0xf')]['code']===0x1f4){logger[_0xae60('0xf')](_0xae60('0xb'),_0x12b42f,_0x2e4ccc[_0xae60('0xf')][_0xae60('0x10')]);return _0x10b7b9(_0x2e4ccc[_0xae60('0xf')]['message']);}logger[_0xae60('0xf')](_0xae60('0xb'),_0x12b42f,_0x2e4ccc[_0xae60('0xf')][_0xae60('0x10')]);return _0x214524(_0x2e4ccc['error']['message']);}else{logger['info'](_0xae60('0xb'),_0x12b42f,_0xae60('0xc'));_0x214524(_0x2e4ccc[_0xae60('0x11')]['message']);}})[_0xae60('0x12')](function(_0xd01b4){logger[_0xae60('0xf')](_0xae60('0xb'),_0x12b42f,_0xd01b4);_0x10b7b9(_0xd01b4);});});}
\ No newline at end of file
index d04d0dd..6fc5cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x319c=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','path'];(function(_0x72a4b3,_0x4f338f){var _0x465eaa=function(_0x29c2d3){while(--_0x29c2d3){_0x72a4b3['push'](_0x72a4b3['shift']());}};_0x465eaa(++_0x4f338f);}(_0x319c,0x1d9));var _0xc319=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x319c[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0xc319('0x0'));var util=require('util');var path=require(_0xc319('0x1'));var timeout=require(_0xc319('0x2'));var express=require(_0xc319('0x3'));var router=express['Router']();var fs_extra=require(_0xc319('0x4'));var auth=require(_0xc319('0x5'));var interaction=require(_0xc319('0x6'));var config=require(_0xc319('0x7'));var controller=require(_0xc319('0x8'));router[_0xc319('0x9')]('/',auth[_0xc319('0xa')](),controller[_0xc319('0xb')]);router[_0xc319('0x9')](_0xc319('0xc'),auth[_0xc319('0xa')](),controller[_0xc319('0xd')]);router[_0xc319('0x9')]('/:id/configurations',auth[_0xc319('0xa')](),controller[_0xc319('0xe')]);router[_0xc319('0x9')](_0xc319('0xf'),auth[_0xc319('0xa')](),controller[_0xc319('0x10')]);router[_0xc319('0x11')]('/',auth[_0xc319('0xa')](),controller[_0xc319('0x12')]);router[_0xc319('0x11')](_0xc319('0x13'),auth[_0xc319('0xa')](),controller[_0xc319('0x14')]);router[_0xc319('0x15')](_0xc319('0xc'),auth[_0xc319('0xa')](),controller['update']);router[_0xc319('0x16')](_0xc319('0xc'),auth[_0xc319('0xa')](),controller[_0xc319('0x17')]);module[_0xc319('0x18')]=router;
\ No newline at end of file
+var _0x6726=['getConfigurations','getFields','create','post','addConfiguration','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x4b583e,_0x2cff4c){var _0x552a0d=function(_0x2972f6){while(--_0x2972f6){_0x4b583e['push'](_0x4b583e['shift']());}};_0x552a0d(++_0x2cff4c);}(_0x6726,0xdb));var _0x6672=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0x6726[_0x1e5cc3];return _0x15c596;};'use strict';var multer=require('multer');var util=require(_0x6672('0x0'));var path=require(_0x6672('0x1'));var timeout=require('connect-timeout');var express=require(_0x6672('0x2'));var router=express[_0x6672('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6672('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6672('0x5'));var controller=require(_0x6672('0x6'));router[_0x6672('0x7')]('/',auth[_0x6672('0x8')](),controller['index']);router[_0x6672('0x7')](_0x6672('0x9'),auth[_0x6672('0x8')](),controller[_0x6672('0xa')]);router[_0x6672('0x7')](_0x6672('0xb'),auth[_0x6672('0x8')](),controller[_0x6672('0xc')]);router[_0x6672('0x7')]('/:id/fields',auth[_0x6672('0x8')](),controller[_0x6672('0xd')]);router['post']('/',auth[_0x6672('0x8')](),controller[_0x6672('0xe')]);router[_0x6672('0xf')](_0x6672('0xb'),auth[_0x6672('0x8')](),controller[_0x6672('0x10')]);router[_0x6672('0x11')](_0x6672('0x9'),auth[_0x6672('0x8')](),controller['update']);router[_0x6672('0x12')](_0x6672('0x9'),auth[_0x6672('0x8')](),controller[_0x6672('0x13')]);module[_0x6672('0x14')]=router;
\ No newline at end of file
index 6764a0f..455650c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24c6=['sequelize','STRING','HelpDesk'];(function(_0x53b89c,_0xd78df1){var _0x91826c=function(_0x2ad406){while(--_0x2ad406){_0x53b89c['push'](_0x53b89c['shift']());}};_0x91826c(++_0xd78df1);}(_0x24c6,0x78));var _0x624c=function(_0x2d91df,_0x245ce5){_0x2d91df=_0x2d91df-0x0;var _0x35ddf4=_0x24c6[_0x2d91df];return _0x35ddf4;};'use strict';var Sequelize=require(_0x624c('0x0'));module['exports']={'name':{'type':Sequelize[_0x624c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x624c('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x624c('0x2')},'remoteUri':{'type':Sequelize[_0x624c('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x624c('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x4f39=['exports','STRING','HelpDesk','sequelize'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x4f39,0x11f));var _0x94f3=function(_0x37eece,_0x331607){_0x37eece=_0x37eece-0x0;var _0x3ddec3=_0x4f39[_0x37eece];return _0x3ddec3;};'use strict';var Sequelize=require(_0x94f3('0x0'));module[_0x94f3('0x1')]={'name':{'type':Sequelize[_0x94f3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x94f3('0x2')]},'username':{'type':Sequelize[_0x94f3('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x94f3('0x2')],'allowNull':![],'defaultValue':_0x94f3('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x94f3('0x2')],'allowNull':![]}};
\ No newline at end of file
index f76768e..1511dc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa19a=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','error','name','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VtigerAccount','findAll','show','params','keys','length','create','body','catch','find','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','description','remoteUri','serverUrl','accessKey','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','result','token','sessionName','autogenerated','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment'];(function(_0x37ae2e,_0x35be3a){var _0x19c50f=function(_0x49732a){while(--_0x49732a){_0x37ae2e['push'](_0x37ae2e['shift']());}};_0x19c50f(++_0x35be3a);}(_0xa19a,0x77));var _0xaa19=function(_0x4a64c2,_0x1cb253){_0x4a64c2=_0x4a64c2-0x0;var _0x2be288=_0xa19a[_0x4a64c2];return _0x2be288;};'use strict';var emlformat=require(_0xaa19('0x0'));var rimraf=require(_0xaa19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa19('0x2'));var rp=require('request-promise');var moment=require(_0xaa19('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaa19('0x4'));var util=require(_0xaa19('0x5'));var path=require(_0xaa19('0x6'));var sox=require(_0xaa19('0x7'));var csv=require(_0xaa19('0x8'));var ejs=require(_0xaa19('0x9'));var fs=require('fs');var fs_extra=require(_0xaa19('0xa'));var _=require(_0xaa19('0xb'));var squel=require(_0xaa19('0xc'));var crypto=require(_0xaa19('0xd'));var jsforce=require(_0xaa19('0xe'));var deskjs=require(_0xaa19('0xf'));var toCsv=require(_0xaa19('0x8'));var querystring=require(_0xaa19('0x10'));var Papa=require(_0xaa19('0x11'));var Redis=require(_0xaa19('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xaa19('0x13'));var as=require(_0xaa19('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa19('0x15'));var utils=require(_0xaa19('0x16'));var config=require(_0xaa19('0x17'));var licenseUtil=require(_0xaa19('0x18'));var db=require(_0xaa19('0x19'))['db'];var integrations=require(_0xaa19('0x1a'));function respondWithStatusCode(_0x2a0506,_0x2d27f1){_0x2d27f1=_0x2d27f1||0xcc;return function(_0x5d7c02){if(_0x5d7c02){return _0x2a0506[_0xaa19('0x1b')](_0x2d27f1);}return _0x2a0506[_0xaa19('0x1c')](_0x2d27f1)[_0xaa19('0x1d')]();};}function respondWithResult(_0x48a90c,_0x5f16d0){_0x5f16d0=_0x5f16d0||0xc8;return function(_0x29979f){if(_0x29979f){return _0x48a90c[_0xaa19('0x1c')](_0x5f16d0)[_0xaa19('0x1e')](_0x29979f);}};}function respondWithFilteredResult(_0x3e193f,_0x4c043a){return function(_0x1c536e){if(_0x1c536e){var _0x258de3=typeof _0x4c043a['offset']===_0xaa19('0x1f')&&typeof _0x4c043a[_0xaa19('0x20')]==='undefined';var _0x1a31e9=_0x1c536e[_0xaa19('0x21')];var _0x9d78da=_0x258de3?0x0:_0x4c043a[_0xaa19('0x22')];var _0x24d8ed=_0x258de3?_0x1c536e[_0xaa19('0x21')]:_0x4c043a[_0xaa19('0x22')]+_0x4c043a[_0xaa19('0x20')];var _0x18e64a;if(_0x24d8ed>=_0x1a31e9){_0x24d8ed=_0x1a31e9;_0x18e64a=0xc8;}else{_0x18e64a=0xce;}_0x3e193f['status'](_0x18e64a);return _0x3e193f[_0xaa19('0x23')]('Content-Range',_0x9d78da+'-'+_0x24d8ed+'/'+_0x1a31e9)[_0xaa19('0x1e')](_0x1c536e);}return null;};}function patchUpdates(_0x174dd8){return function(_0x1d818a){try{jsonpatch[_0xaa19('0x24')](_0x1d818a,_0x174dd8,!![]);}catch(_0x3950e3){return BPromise[_0xaa19('0x25')](_0x3950e3);}return _0x1d818a[_0xaa19('0x26')]();};}function saveUpdates(_0x391b61,_0xb0e0aa){return function(_0x1a7531){if(_0x1a7531){return _0x1a7531[_0xaa19('0x27')](_0x391b61)['then'](function(_0x538c5f){return _0x538c5f;});}return null;};}function removeEntity(_0x1b4f1d,_0x4d0a3e){return function(_0x58eb4f){if(_0x58eb4f){return _0x58eb4f[_0xaa19('0x28')]()[_0xaa19('0x29')](function(){_0x1b4f1d[_0xaa19('0x1c')](0xcc)[_0xaa19('0x1d')]();});}};}function handleEntityNotFound(_0x32da65,_0x29a199){return function(_0x48e189){if(!_0x48e189){_0x32da65['sendStatus'](0x194);}return _0x48e189;};}function handleError(_0x4c3422,_0x32b689){_0x32b689=_0x32b689||0x1f4;return function(_0x14e0fd){logger[_0xaa19('0x2a')](_0x14e0fd['stack']);if(_0x14e0fd[_0xaa19('0x2b')]){delete _0x14e0fd[_0xaa19('0x2b')];}_0x4c3422['status'](_0x32b689)['send'](_0x14e0fd);};}exports[_0xaa19('0x2c')]=function(_0x49533f,_0x2b01bc){var _0x5ba141={},_0x5c1a9a={},_0x5730c8={'count':0x0,'rows':[]};var _0x16c018=_['map'](db['VtigerAccount'][_0xaa19('0x2d')],function(_0x1bf0a4){return{'name':_0x1bf0a4[_0xaa19('0x2e')],'type':_0x1bf0a4[_0xaa19('0x2f')]['key']};});_0x5c1a9a[_0xaa19('0x30')]=_[_0xaa19('0x31')](_0x16c018,_0xaa19('0x2b'));_0x5c1a9a[_0xaa19('0x32')]=_['keys'](_0x49533f[_0xaa19('0x32')]);_0x5c1a9a[_0xaa19('0x33')]=_['intersection'](_0x5c1a9a[_0xaa19('0x30')],_0x5c1a9a[_0xaa19('0x32')]);_0x5ba141['attributes']=_[_0xaa19('0x34')](_0x5c1a9a[_0xaa19('0x30')],qs['fields'](_0x49533f[_0xaa19('0x32')][_0xaa19('0x35')]));_0x5ba141[_0xaa19('0x36')]=_0x5ba141[_0xaa19('0x36')]['length']?_0x5ba141[_0xaa19('0x36')]:_0x5c1a9a[_0xaa19('0x30')];if(!_0x49533f[_0xaa19('0x32')][_0xaa19('0x37')](_0xaa19('0x38'))){_0x5ba141['limit']=qs[_0xaa19('0x20')](_0x49533f[_0xaa19('0x32')][_0xaa19('0x20')]);_0x5ba141[_0xaa19('0x22')]=qs[_0xaa19('0x22')](_0x49533f[_0xaa19('0x32')][_0xaa19('0x22')]);}_0x5ba141[_0xaa19('0x39')]=qs['sort'](_0x49533f[_0xaa19('0x32')][_0xaa19('0x3a')]);_0x5ba141[_0xaa19('0x3b')]=qs[_0xaa19('0x33')](_[_0xaa19('0x3c')](_0x49533f[_0xaa19('0x32')],_0x5c1a9a[_0xaa19('0x33')]),_0x16c018);if(_0x49533f[_0xaa19('0x32')][_0xaa19('0x3d')]){_0x5ba141[_0xaa19('0x3b')]=_[_0xaa19('0x3e')](_0x5ba141[_0xaa19('0x3b')],{'$or':_[_0xaa19('0x31')](_0x16c018,function(_0x48c3b9){if(_0x48c3b9[_0xaa19('0x2f')]!==_0xaa19('0x3f')){var _0x3d0c0d={};_0x3d0c0d[_0x48c3b9[_0xaa19('0x2b')]]={'$like':'%'+_0x49533f[_0xaa19('0x32')][_0xaa19('0x3d')]+'%'};return _0x3d0c0d;}})});}_0x5ba141=_[_0xaa19('0x3e')]({},_0x5ba141,_0x49533f[_0xaa19('0x40')]);var _0x395606={'where':_0x5ba141[_0xaa19('0x3b')]};return db['VtigerAccount'][_0xaa19('0x21')](_0x395606)[_0xaa19('0x29')](function(_0x2cefd0){_0x5730c8['count']=_0x2cefd0;if(_0x49533f[_0xaa19('0x32')][_0xaa19('0x41')]){_0x5ba141[_0xaa19('0x42')]=[{'all':!![]}];}return db[_0xaa19('0x43')][_0xaa19('0x44')](_0x5ba141);})[_0xaa19('0x29')](function(_0x2751df){_0x5730c8['rows']=_0x2751df;return _0x5730c8;})[_0xaa19('0x29')](respondWithFilteredResult(_0x2b01bc,_0x5ba141))['catch'](handleError(_0x2b01bc,null));};exports[_0xaa19('0x45')]=function(_0x2c0bd7,_0x2f2483){var _0x194887={'raw':![],'where':{'id':_0x2c0bd7[_0xaa19('0x46')]['id']}},_0x28ea97={};_0x28ea97[_0xaa19('0x30')]=_[_0xaa19('0x47')](db[_0xaa19('0x43')]['rawAttributes']);_0x28ea97[_0xaa19('0x32')]=_[_0xaa19('0x47')](_0x2c0bd7[_0xaa19('0x32')]);_0x28ea97[_0xaa19('0x33')]=_['intersection'](_0x28ea97[_0xaa19('0x30')],_0x28ea97[_0xaa19('0x32')]);_0x194887[_0xaa19('0x36')]=_['intersection'](_0x28ea97[_0xaa19('0x30')],qs[_0xaa19('0x35')](_0x2c0bd7[_0xaa19('0x32')][_0xaa19('0x35')]));_0x194887[_0xaa19('0x36')]=_0x194887[_0xaa19('0x36')][_0xaa19('0x48')]?_0x194887[_0xaa19('0x36')]:_0x28ea97['model'];if(_0x2c0bd7[_0xaa19('0x32')][_0xaa19('0x41')]){_0x194887[_0xaa19('0x42')]=[{'all':!![]}];}_0x194887=_[_0xaa19('0x3e')]({},_0x194887,_0x2c0bd7[_0xaa19('0x40')]);return db[_0xaa19('0x43')]['find'](_0x194887)[_0xaa19('0x29')](handleEntityNotFound(_0x2f2483,null))['then'](respondWithResult(_0x2f2483,null))['catch'](handleError(_0x2f2483,null));};exports[_0xaa19('0x49')]=function(_0x1e423e,_0x5a37b1){return db[_0xaa19('0x43')][_0xaa19('0x49')](_0x1e423e[_0xaa19('0x4a')],{})[_0xaa19('0x29')](respondWithResult(_0x5a37b1,0xc9))[_0xaa19('0x4b')](handleError(_0x5a37b1,null));};exports[_0xaa19('0x27')]=function(_0x2c7024,_0x5e1384){if(_0x2c7024[_0xaa19('0x4a')]['id']){delete _0x2c7024['body']['id'];}return db[_0xaa19('0x43')][_0xaa19('0x4c')]({'where':{'id':_0x2c7024[_0xaa19('0x46')]['id']}})[_0xaa19('0x29')](handleEntityNotFound(_0x5e1384,null))[_0xaa19('0x29')](saveUpdates(_0x2c7024[_0xaa19('0x4a')],null))[_0xaa19('0x29')](respondWithResult(_0x5e1384,null))[_0xaa19('0x4b')](handleError(_0x5e1384,null));};exports[_0xaa19('0x28')]=function(_0x4f692c,_0x115a72){return db[_0xaa19('0x43')]['find']({'where':{'id':_0x4f692c[_0xaa19('0x46')]['id']}})['then'](handleEntityNotFound(_0x115a72,null))[_0xaa19('0x29')](removeEntity(_0x115a72,null))[_0xaa19('0x4b')](handleError(_0x115a72,null));};exports['getConfigurations']=function(_0x7ea7e9,_0x1d728c,_0x2300d7){var _0xfa7bd5={};var _0xb240d1={};var _0x242e2d;var _0x48e6b;return db['VtigerAccount'][_0xaa19('0x4d')]({'where':{'id':_0x7ea7e9[_0xaa19('0x46')]['id']}})[_0xaa19('0x29')](handleEntityNotFound(_0x1d728c,null))[_0xaa19('0x29')](function(_0xd10e7){if(_0xd10e7){_0x242e2d=_0xd10e7;_0xb240d1[_0xaa19('0x30')]=_[_0xaa19('0x47')](db[_0xaa19('0x4e')]['rawAttributes']);_0xb240d1[_0xaa19('0x32')]=_['keys'](_0x7ea7e9[_0xaa19('0x32')]);_0xb240d1[_0xaa19('0x33')]=_[_0xaa19('0x34')](_0xb240d1[_0xaa19('0x30')],_0xb240d1[_0xaa19('0x32')]);_0xfa7bd5[_0xaa19('0x36')]=_[_0xaa19('0x34')](_0xb240d1[_0xaa19('0x30')],qs[_0xaa19('0x35')](_0x7ea7e9[_0xaa19('0x32')][_0xaa19('0x35')]));_0xfa7bd5[_0xaa19('0x36')]=_0xfa7bd5['attributes'][_0xaa19('0x48')]?_0xfa7bd5[_0xaa19('0x36')]:_0xb240d1[_0xaa19('0x30')];_0xfa7bd5[_0xaa19('0x39')]=qs[_0xaa19('0x3a')](_0x7ea7e9[_0xaa19('0x32')][_0xaa19('0x3a')]);_0xfa7bd5[_0xaa19('0x3b')]=qs[_0xaa19('0x33')](_[_0xaa19('0x3c')](_0x7ea7e9[_0xaa19('0x32')],_0xb240d1[_0xaa19('0x33')]));if(_0x7ea7e9[_0xaa19('0x32')][_0xaa19('0x3d')]){_0xfa7bd5[_0xaa19('0x3b')]=_[_0xaa19('0x3e')](_0xfa7bd5[_0xaa19('0x3b')],{'$or':_[_0xaa19('0x31')](_0xfa7bd5[_0xaa19('0x36')],function(_0xbe16a){var _0x5d496f={};_0x5d496f[_0xbe16a]={'$like':'%'+_0x7ea7e9[_0xaa19('0x32')][_0xaa19('0x3d')]+'%'};return _0x5d496f;})});}_0xfa7bd5=_[_0xaa19('0x3e')]({},_0xfa7bd5,_0x7ea7e9[_0xaa19('0x40')]);return _0x242e2d[_0xaa19('0x4f')](_0xfa7bd5);}})[_0xaa19('0x29')](function(_0x2496b9){if(_0x2496b9){_0x48e6b=_0x2496b9['length'];if(!_0x7ea7e9[_0xaa19('0x32')]['hasOwnProperty'](_0xaa19('0x38'))){_0xfa7bd5['limit']=qs['limit'](_0x7ea7e9[_0xaa19('0x32')]['limit']);_0xfa7bd5['offset']=qs[_0xaa19('0x22')](_0x7ea7e9[_0xaa19('0x32')][_0xaa19('0x22')]);}return _0x242e2d[_0xaa19('0x4f')](_0xfa7bd5);}})[_0xaa19('0x29')](function(_0x534a45){if(_0x534a45){return _0x534a45?{'count':_0x48e6b,'rows':_0x534a45}:null;}})[_0xaa19('0x29')](respondWithResult(_0x1d728c,null))['catch'](handleError(_0x1d728c,null));};exports[_0xaa19('0x50')]=function(_0x32d417,_0x163a52,_0x14a9f6){if(_0x32d417[_0xaa19('0x4a')]['id']){delete _0x32d417[_0xaa19('0x4a')]['id'];}return db[_0xaa19('0x43')][_0xaa19('0x4d')]({'where':{'id':_0x32d417['params']['id']}})[_0xaa19('0x29')](handleEntityNotFound(_0x163a52,null))[_0xaa19('0x29')](function(_0x41f290){if(_0x41f290){_0x32d417[_0xaa19('0x4a')][_0xaa19('0x51')]=_0x41f290['id'];_0x32d417[_0xaa19('0x4a')]['Subjects']=integrations['getSubjects'](_0x32d417[_0xaa19('0x4a')][_0xaa19('0x52')],_0x32d417[_0xaa19('0x4a')][_0xaa19('0x2f')]);_0x32d417['body'][_0xaa19('0x53')]=integrations[_0xaa19('0x54')](_0x32d417[_0xaa19('0x4a')][_0xaa19('0x52')],_0x32d417[_0xaa19('0x4a')]['type']);return db['VtigerConfiguration']['create'](_0x32d417[_0xaa19('0x4a')],{'include':[{'model':db[_0xaa19('0x55')],'as':_0xaa19('0x56')},{'model':db['VtigerField'],'as':_0xaa19('0x53')}]});}return null;})[_0xaa19('0x29')](respondWithResult(_0x163a52,null))['catch'](handleError(_0x163a52,null));};var md5=require(_0xaa19('0x57'));exports[_0xaa19('0x58')]=function(_0x2554ac,_0x46b4f7,_0x2b856e){var _0xb6d1fd=null;var _0x38a459=null;var _0x133ce1=null;var _0x5df38e=null;var _0x2715fc='';return db[_0xaa19('0x43')][_0xaa19('0x4d')]({'where':{'id':_0x2554ac[_0xaa19('0x46')]['id']},'attributes':['id',_0xaa19('0x2b'),_0xaa19('0x59'),_0xaa19('0x5a'),'moduleName',_0xaa19('0x5b'),_0xaa19('0x5c'),_0xaa19('0x5d')]})[_0xaa19('0x29')](handleEntityNotFound(_0x46b4f7,null))[_0xaa19('0x29')](function(_0x1fec87){if(_0x1fec87){_0xb6d1fd=_0x1fec87[_0xaa19('0x59')];_0x38a459=_0x1fec87[_0xaa19('0x5d')];_0x133ce1=_0x1fec87['moduleName'];_0x2715fc=_0x1fec87[_0xaa19('0x5b')];var _0x413481=_0x2715fc['slice'](-0x1);if(_0x413481==='/'){_0x2715fc=_0x2715fc['substring'](0x0,_0x2715fc[_0xaa19('0x5e')](_0x413481));}_0x5df38e=util[_0xaa19('0x5f')](_0xaa19('0x60'),_0x2715fc);var _0x3264f4={'method':_0xaa19('0x61'),'uri':_0x5df38e,'qs':{'operation':_0xaa19('0x62'),'username':_0x1fec87[_0xaa19('0x59')]},'json':!![]};return rp(_0x3264f4);}})[_0xaa19('0x29')](function(_0x1e2cfc){if(_0x1e2cfc[_0xaa19('0x63')]){var _0x47e9e3={'method':'POST','uri':_0x5df38e,'form':{'operation':_0xaa19('0x64'),'username':_0xb6d1fd,'accessKey':md5(_0x1e2cfc[_0xaa19('0x65')][_0xaa19('0x66')]+_0x38a459)},'json':!![]};return rp(_0x47e9e3);}})[_0xaa19('0x29')](function(_0x427cb7){if(_0x427cb7['success']){var _0x847ade={'method':'GET','uri':_0x5df38e,'qs':{'operation':'describe','username':_0xb6d1fd,'sessionName':_0x427cb7[_0xaa19('0x65')][_0xaa19('0x67')],'elementType':_0x133ce1},'json':!![]};return rp(_0x847ade);}})[_0xaa19('0x29')](function(_0x5594ca){if(_0x5594ca['success']){var _0x49c9d2=[_0xaa19('0x68'),'reference',_0xaa19('0x69')];_[_0xaa19('0x6a')](_0x5594ca[_0xaa19('0x65')][_0xaa19('0x35')],function(_0x5db788){return _0x49c9d2['includes'](_0x5db788['type'][_0xaa19('0x2b')]);});_[_0xaa19('0x6a')](_0x5594ca[_0xaa19('0x65')][_0xaa19('0x35')],function(_0xadaa1a){return _0xadaa1a[_0xaa19('0x6b')]===_0xaa19('0x6c');});return{'count':_0x5594ca[_0xaa19('0x65')]['fields'][_0xaa19('0x48')],'rows':_[_0xaa19('0x31')](_0x5594ca['result']['fields'],function(_0x2dd589){return{'id':_0x2dd589[_0xaa19('0x2b')],'name':_0x2dd589[_0xaa19('0x6d')],'custom':_[_0xaa19('0x6e')](_0x2dd589[_0xaa19('0x2b')],_0xaa19('0x6f'))?!![]:![],'options':_0x2dd589['type'][_0xaa19('0x2b')]===_0xaa19('0x70')&&_0x2dd589['type'][_0xaa19('0x71')][_0xaa19('0x48')]>0x0?_['map'](_0x2dd589[_0xaa19('0x2f')]['picklistValues'],function(_0x26d9c4){return{'name':_0x26d9c4[_0xaa19('0x6d')],'value':_0x26d9c4[_0xaa19('0x72')]};}):[]};})};}})[_0xaa19('0x29')](respondWithResult(_0x46b4f7,null))[_0xaa19('0x4b')](function(_0xfc10c3){console[_0xaa19('0x73')](_0xaa19('0x74')+_0xfc10c3);var _0x1bb366=_0x2554ac[_0xaa19('0x32')][_0xaa19('0x75')]?0x1f4:_0xfc10c3[_0xaa19('0x76')]||0x1f4;logger[_0xaa19('0x2a')](_0xaa19('0x77'),_0xaa19('0x58'),_0x1bb366,JSON[_0xaa19('0x78')](_0xfc10c3));delete _0xfc10c3[_0xaa19('0x2b')];if(_0x1bb366===0x191){_0x1bb366=0x190;}_0x46b4f7[_0xaa19('0x1c')](_0x1bb366)[_0xaa19('0x79')](_0x2554ac['query'][_0xaa19('0x75')]?{'message':_0xaa19('0x7a'),'statusCode':_0xfc10c3[_0xaa19('0x76')]}:_0xfc10c3);});};
\ No newline at end of file
+var _0x4a28=['catch','show','includeAll','create','body','find','params','getConfigurations','findOne','AccountId','Subjects','Descriptions','VtigerConfiguration','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','describe','sessionName','includes','remove','editable','label','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','undefined','offset','count','limit','set','apply','reject','update','then','sendStatus','error','name','VtigerAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4a28,0x199));var _0x84a2=function(_0x490427,_0x3c3b35){_0x490427=_0x490427-0x0;var _0x55f57f=_0x4a28[_0x490427];return _0x55f57f;};'use strict';var emlformat=require(_0x84a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x84a2('0x1'));var jsonpatch=require(_0x84a2('0x2'));var rp=require(_0x84a2('0x3'));var moment=require(_0x84a2('0x4'));var BPromise=require(_0x84a2('0x5'));var Mustache=require(_0x84a2('0x6'));var util=require(_0x84a2('0x7'));var path=require(_0x84a2('0x8'));var sox=require(_0x84a2('0x9'));var csv=require(_0x84a2('0xa'));var ejs=require(_0x84a2('0xb'));var fs=require('fs');var fs_extra=require(_0x84a2('0xc'));var _=require(_0x84a2('0xd'));var squel=require(_0x84a2('0xe'));var crypto=require(_0x84a2('0xf'));var jsforce=require(_0x84a2('0x10'));var deskjs=require(_0x84a2('0x11'));var toCsv=require(_0x84a2('0xa'));var querystring=require(_0x84a2('0x12'));var Papa=require(_0x84a2('0x13'));var Redis=require(_0x84a2('0x14'));var authService=require(_0x84a2('0x15'));var qs=require(_0x84a2('0x16'));var as=require(_0x84a2('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84a2('0x18'))(_0x84a2('0x19'));var utils=require(_0x84a2('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x84a2('0x1b'));var db=require(_0x84a2('0x1c'))['db'];var integrations=require(_0x84a2('0x1d'));function respondWithStatusCode(_0x3be91b,_0x2fd3fb){_0x2fd3fb=_0x2fd3fb||0xcc;return function(_0x644554){if(_0x644554){return _0x3be91b['sendStatus'](_0x2fd3fb);}return _0x3be91b['status'](_0x2fd3fb)[_0x84a2('0x1e')]();};}function respondWithResult(_0x35981a,_0xc433b6){_0xc433b6=_0xc433b6||0xc8;return function(_0x27d0e0){if(_0x27d0e0){return _0x35981a[_0x84a2('0x1f')](_0xc433b6)['json'](_0x27d0e0);}};}function respondWithFilteredResult(_0x1bb13c,_0x2c9f6b){return function(_0x3b4ee4){if(_0x3b4ee4){var _0x482068=typeof _0x2c9f6b['offset']===_0x84a2('0x20')&&typeof _0x2c9f6b['limit']===_0x84a2('0x20');var _0x1f976e=_0x3b4ee4['count'];var _0x2e00aa=_0x482068?0x0:_0x2c9f6b[_0x84a2('0x21')];var _0x23884c=_0x482068?_0x3b4ee4[_0x84a2('0x22')]:_0x2c9f6b['offset']+_0x2c9f6b[_0x84a2('0x23')];var _0x2ae89e;if(_0x23884c>=_0x1f976e){_0x23884c=_0x1f976e;_0x2ae89e=0xc8;}else{_0x2ae89e=0xce;}_0x1bb13c[_0x84a2('0x1f')](_0x2ae89e);return _0x1bb13c[_0x84a2('0x24')]('Content-Range',_0x2e00aa+'-'+_0x23884c+'/'+_0x1f976e)['json'](_0x3b4ee4);}return null;};}function patchUpdates(_0x2fc236){return function(_0x199c6f){try{jsonpatch[_0x84a2('0x25')](_0x199c6f,_0x2fc236,!![]);}catch(_0x2c69c8){return BPromise[_0x84a2('0x26')](_0x2c69c8);}return _0x199c6f['save']();};}function saveUpdates(_0x44b581,_0xf19d2c){return function(_0x108e9b){if(_0x108e9b){return _0x108e9b[_0x84a2('0x27')](_0x44b581)[_0x84a2('0x28')](function(_0x4c64fe){return _0x4c64fe;});}return null;};}function removeEntity(_0x41d55f,_0x256337){return function(_0x418b86){if(_0x418b86){return _0x418b86['destroy']()[_0x84a2('0x28')](function(){_0x41d55f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e30d,_0x4a75d0){return function(_0x9200d4){if(!_0x9200d4){_0x44e30d[_0x84a2('0x29')](0x194);}return _0x9200d4;};}function handleError(_0x5dbabc,_0x3111e2){_0x3111e2=_0x3111e2||0x1f4;return function(_0x1b515c){logger[_0x84a2('0x2a')](_0x1b515c['stack']);if(_0x1b515c['name']){delete _0x1b515c[_0x84a2('0x2b')];}_0x5dbabc['status'](_0x3111e2)['send'](_0x1b515c);};}exports['index']=function(_0x8aa204,_0x3e958b){var _0xec3262={},_0x47225c={},_0x174d6e={'count':0x0,'rows':[]};var _0x4a201c=_['map'](db[_0x84a2('0x2c')][_0x84a2('0x2d')],function(_0x3f4970){return{'name':_0x3f4970[_0x84a2('0x2e')],'type':_0x3f4970['type'][_0x84a2('0x2f')]};});_0x47225c[_0x84a2('0x30')]=_[_0x84a2('0x31')](_0x4a201c,_0x84a2('0x2b'));_0x47225c[_0x84a2('0x32')]=_[_0x84a2('0x33')](_0x8aa204[_0x84a2('0x32')]);_0x47225c[_0x84a2('0x34')]=_[_0x84a2('0x35')](_0x47225c['model'],_0x47225c[_0x84a2('0x32')]);_0xec3262[_0x84a2('0x36')]=_[_0x84a2('0x35')](_0x47225c[_0x84a2('0x30')],qs['fields'](_0x8aa204[_0x84a2('0x32')][_0x84a2('0x37')]));_0xec3262[_0x84a2('0x36')]=_0xec3262[_0x84a2('0x36')][_0x84a2('0x38')]?_0xec3262['attributes']:_0x47225c[_0x84a2('0x30')];if(!_0x8aa204[_0x84a2('0x32')][_0x84a2('0x39')](_0x84a2('0x3a'))){_0xec3262['limit']=qs[_0x84a2('0x23')](_0x8aa204['query'][_0x84a2('0x23')]);_0xec3262[_0x84a2('0x21')]=qs[_0x84a2('0x21')](_0x8aa204[_0x84a2('0x32')]['offset']);}_0xec3262[_0x84a2('0x3b')]=qs[_0x84a2('0x3c')](_0x8aa204[_0x84a2('0x32')][_0x84a2('0x3c')]);_0xec3262[_0x84a2('0x3d')]=qs[_0x84a2('0x34')](_[_0x84a2('0x3e')](_0x8aa204[_0x84a2('0x32')],_0x47225c['filters']),_0x4a201c);if(_0x8aa204[_0x84a2('0x32')][_0x84a2('0x3f')]){_0xec3262[_0x84a2('0x3d')]=_[_0x84a2('0x40')](_0xec3262[_0x84a2('0x3d')],{'$or':_[_0x84a2('0x31')](_0x4a201c,function(_0x1fd869){if(_0x1fd869[_0x84a2('0x41')]!==_0x84a2('0x42')){var _0x44f745={};_0x44f745[_0x1fd869[_0x84a2('0x2b')]]={'$like':'%'+_0x8aa204[_0x84a2('0x32')][_0x84a2('0x3f')]+'%'};return _0x44f745;}})});}_0xec3262=_[_0x84a2('0x40')]({},_0xec3262,_0x8aa204[_0x84a2('0x43')]);var _0x59d31b={'where':_0xec3262[_0x84a2('0x3d')]};return db['VtigerAccount'][_0x84a2('0x22')](_0x59d31b)[_0x84a2('0x28')](function(_0x5ce98f){_0x174d6e[_0x84a2('0x22')]=_0x5ce98f;if(_0x8aa204[_0x84a2('0x32')]['includeAll']){_0xec3262[_0x84a2('0x44')]=[{'all':!![]}];}return db['VtigerAccount'][_0x84a2('0x45')](_0xec3262);})[_0x84a2('0x28')](function(_0x58c2e2){_0x174d6e[_0x84a2('0x46')]=_0x58c2e2;return _0x174d6e;})[_0x84a2('0x28')](respondWithFilteredResult(_0x3e958b,_0xec3262))[_0x84a2('0x47')](handleError(_0x3e958b,null));};exports[_0x84a2('0x48')]=function(_0xe4f37a,_0x29b0a5){var _0x2c78fa={'raw':![],'where':{'id':_0xe4f37a['params']['id']}},_0x28efb1={};_0x28efb1[_0x84a2('0x30')]=_[_0x84a2('0x33')](db[_0x84a2('0x2c')][_0x84a2('0x2d')]);_0x28efb1[_0x84a2('0x32')]=_['keys'](_0xe4f37a[_0x84a2('0x32')]);_0x28efb1['filters']=_['intersection'](_0x28efb1[_0x84a2('0x30')],_0x28efb1[_0x84a2('0x32')]);_0x2c78fa[_0x84a2('0x36')]=_[_0x84a2('0x35')](_0x28efb1[_0x84a2('0x30')],qs[_0x84a2('0x37')](_0xe4f37a[_0x84a2('0x32')]['fields']));_0x2c78fa[_0x84a2('0x36')]=_0x2c78fa['attributes']['length']?_0x2c78fa[_0x84a2('0x36')]:_0x28efb1['model'];if(_0xe4f37a[_0x84a2('0x32')][_0x84a2('0x49')]){_0x2c78fa[_0x84a2('0x44')]=[{'all':!![]}];}_0x2c78fa=_['merge']({},_0x2c78fa,_0xe4f37a[_0x84a2('0x43')]);return db[_0x84a2('0x2c')]['find'](_0x2c78fa)[_0x84a2('0x28')](handleEntityNotFound(_0x29b0a5,null))[_0x84a2('0x28')](respondWithResult(_0x29b0a5,null))['catch'](handleError(_0x29b0a5,null));};exports[_0x84a2('0x4a')]=function(_0x114cbe,_0x3f6bee){return db[_0x84a2('0x2c')]['create'](_0x114cbe[_0x84a2('0x4b')],{})['then'](respondWithResult(_0x3f6bee,0xc9))[_0x84a2('0x47')](handleError(_0x3f6bee,null));};exports[_0x84a2('0x27')]=function(_0x10757b,_0x268bff){if(_0x10757b[_0x84a2('0x4b')]['id']){delete _0x10757b['body']['id'];}return db[_0x84a2('0x2c')][_0x84a2('0x4c')]({'where':{'id':_0x10757b[_0x84a2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x268bff,null))['then'](saveUpdates(_0x10757b['body'],null))[_0x84a2('0x28')](respondWithResult(_0x268bff,null))[_0x84a2('0x47')](handleError(_0x268bff,null));};exports['destroy']=function(_0x58a184,_0x2d4844){return db[_0x84a2('0x2c')][_0x84a2('0x4c')]({'where':{'id':_0x58a184['params']['id']}})['then'](handleEntityNotFound(_0x2d4844,null))['then'](removeEntity(_0x2d4844,null))[_0x84a2('0x47')](handleError(_0x2d4844,null));};exports[_0x84a2('0x4e')]=function(_0x2db255,_0x8d427c,_0x668699){var _0x476eed={};var _0x560ed7={};var _0xc5fafe;var _0x4e350a;return db['VtigerAccount'][_0x84a2('0x4f')]({'where':{'id':_0x2db255[_0x84a2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x8d427c,null))[_0x84a2('0x28')](function(_0x4fe261){if(_0x4fe261){_0xc5fafe=_0x4fe261;_0x560ed7[_0x84a2('0x30')]=_['keys'](db['VtigerConfiguration'][_0x84a2('0x2d')]);_0x560ed7[_0x84a2('0x32')]=_['keys'](_0x2db255[_0x84a2('0x32')]);_0x560ed7[_0x84a2('0x34')]=_[_0x84a2('0x35')](_0x560ed7[_0x84a2('0x30')],_0x560ed7[_0x84a2('0x32')]);_0x476eed['attributes']=_['intersection'](_0x560ed7['model'],qs[_0x84a2('0x37')](_0x2db255['query'][_0x84a2('0x37')]));_0x476eed['attributes']=_0x476eed[_0x84a2('0x36')]['length']?_0x476eed[_0x84a2('0x36')]:_0x560ed7['model'];_0x476eed[_0x84a2('0x3b')]=qs[_0x84a2('0x3c')](_0x2db255[_0x84a2('0x32')][_0x84a2('0x3c')]);_0x476eed[_0x84a2('0x3d')]=qs['filters'](_[_0x84a2('0x3e')](_0x2db255[_0x84a2('0x32')],_0x560ed7['filters']));if(_0x2db255[_0x84a2('0x32')]['filter']){_0x476eed[_0x84a2('0x3d')]=_[_0x84a2('0x40')](_0x476eed['where'],{'$or':_[_0x84a2('0x31')](_0x476eed[_0x84a2('0x36')],function(_0x3a7d5d){var _0x31e083={};_0x31e083[_0x3a7d5d]={'$like':'%'+_0x2db255[_0x84a2('0x32')][_0x84a2('0x3f')]+'%'};return _0x31e083;})});}_0x476eed=_['merge']({},_0x476eed,_0x2db255[_0x84a2('0x43')]);return _0xc5fafe[_0x84a2('0x4e')](_0x476eed);}})[_0x84a2('0x28')](function(_0x11e13c){if(_0x11e13c){_0x4e350a=_0x11e13c[_0x84a2('0x38')];if(!_0x2db255[_0x84a2('0x32')][_0x84a2('0x39')](_0x84a2('0x3a'))){_0x476eed['limit']=qs[_0x84a2('0x23')](_0x2db255[_0x84a2('0x32')][_0x84a2('0x23')]);_0x476eed[_0x84a2('0x21')]=qs[_0x84a2('0x21')](_0x2db255[_0x84a2('0x32')][_0x84a2('0x21')]);}return _0xc5fafe[_0x84a2('0x4e')](_0x476eed);}})[_0x84a2('0x28')](function(_0x4ea874){if(_0x4ea874){return _0x4ea874?{'count':_0x4e350a,'rows':_0x4ea874}:null;}})[_0x84a2('0x28')](respondWithResult(_0x8d427c,null))['catch'](handleError(_0x8d427c,null));};exports['addConfiguration']=function(_0x48b81b,_0x156197,_0x447b37){if(_0x48b81b[_0x84a2('0x4b')]['id']){delete _0x48b81b['body']['id'];}return db[_0x84a2('0x2c')][_0x84a2('0x4f')]({'where':{'id':_0x48b81b['params']['id']}})['then'](handleEntityNotFound(_0x156197,null))[_0x84a2('0x28')](function(_0x188c3){if(_0x188c3){_0x48b81b['body'][_0x84a2('0x50')]=_0x188c3['id'];_0x48b81b[_0x84a2('0x4b')][_0x84a2('0x51')]=integrations['getSubjects'](_0x48b81b[_0x84a2('0x4b')]['channel'],_0x48b81b[_0x84a2('0x4b')][_0x84a2('0x41')]);_0x48b81b['body'][_0x84a2('0x52')]=integrations['getDescriptions'](_0x48b81b[_0x84a2('0x4b')]['channel'],_0x48b81b[_0x84a2('0x4b')][_0x84a2('0x41')]);return db[_0x84a2('0x53')][_0x84a2('0x4a')](_0x48b81b[_0x84a2('0x4b')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x84a2('0x54')],'as':_0x84a2('0x52')}]});}return null;})[_0x84a2('0x28')](respondWithResult(_0x156197,null))[_0x84a2('0x47')](handleError(_0x156197,null));};var md5=require(_0x84a2('0x55'));exports['getFields']=function(_0x5aa515,_0x1ac369,_0x328efc){var _0x20c3c0=null;var _0x29a750=null;var _0x2d31bc=null;var _0x127234=null;var _0x200752='';return db[_0x84a2('0x2c')][_0x84a2('0x4f')]({'where':{'id':_0x5aa515[_0x84a2('0x4d')]['id']},'attributes':['id',_0x84a2('0x2b'),_0x84a2('0x56'),_0x84a2('0x57'),_0x84a2('0x58'),_0x84a2('0x59'),_0x84a2('0x5a'),'accessKey']})[_0x84a2('0x28')](handleEntityNotFound(_0x1ac369,null))['then'](function(_0x19320c){if(_0x19320c){_0x20c3c0=_0x19320c['username'];_0x29a750=_0x19320c[_0x84a2('0x5b')];_0x2d31bc=_0x19320c[_0x84a2('0x58')];_0x200752=_0x19320c['remoteUri'];var _0x3c0bd4=_0x200752['slice'](-0x1);if(_0x3c0bd4==='/'){_0x200752=_0x200752[_0x84a2('0x5c')](0x0,_0x200752[_0x84a2('0x5d')](_0x3c0bd4));}_0x127234=util[_0x84a2('0x5e')](_0x84a2('0x5f'),_0x200752);var _0x8876de={'method':_0x84a2('0x60'),'uri':_0x127234,'qs':{'operation':'getchallenge','username':_0x19320c[_0x84a2('0x56')]},'json':!![]};return rp(_0x8876de);}})[_0x84a2('0x28')](function(_0x1e100b){if(_0x1e100b[_0x84a2('0x61')]){var _0x144e66={'method':_0x84a2('0x62'),'uri':_0x127234,'form':{'operation':_0x84a2('0x63'),'username':_0x20c3c0,'accessKey':md5(_0x1e100b[_0x84a2('0x64')][_0x84a2('0x65')]+_0x29a750)},'json':!![]};return rp(_0x144e66);}})['then'](function(_0x1e9c21){if(_0x1e9c21[_0x84a2('0x61')]){var _0x1c9abe={'method':_0x84a2('0x60'),'uri':_0x127234,'qs':{'operation':_0x84a2('0x66'),'username':_0x20c3c0,'sessionName':_0x1e9c21[_0x84a2('0x64')][_0x84a2('0x67')],'elementType':_0x2d31bc},'json':!![]};return rp(_0x1c9abe);}})[_0x84a2('0x28')](function(_0x2260dc){if(_0x2260dc[_0x84a2('0x61')]){var _0x3bfed6=['autogenerated','reference','owner'];_['remove'](_0x2260dc[_0x84a2('0x64')][_0x84a2('0x37')],function(_0x549224){return _0x3bfed6[_0x84a2('0x68')](_0x549224['type'][_0x84a2('0x2b')]);});_[_0x84a2('0x69')](_0x2260dc[_0x84a2('0x64')][_0x84a2('0x37')],function(_0x2c22d7){return _0x2c22d7[_0x84a2('0x6a')]==='false';});return{'count':_0x2260dc['result'][_0x84a2('0x37')][_0x84a2('0x38')],'rows':_[_0x84a2('0x31')](_0x2260dc[_0x84a2('0x64')][_0x84a2('0x37')],function(_0x3d440e){return{'id':_0x3d440e[_0x84a2('0x2b')],'name':_0x3d440e[_0x84a2('0x6b')],'custom':_['startsWith'](_0x3d440e[_0x84a2('0x2b')],'cf_')?!![]:![],'options':_0x3d440e[_0x84a2('0x41')][_0x84a2('0x2b')]===_0x84a2('0x6c')&&_0x3d440e[_0x84a2('0x41')]['picklistValues'][_0x84a2('0x38')]>0x0?_[_0x84a2('0x31')](_0x3d440e['type'][_0x84a2('0x6d')],function(_0x5eb2ff){return{'name':_0x5eb2ff[_0x84a2('0x6b')],'value':_0x5eb2ff[_0x84a2('0x6e')]};}):[]};})};}})['then'](respondWithResult(_0x1ac369,null))['catch'](function(_0x2b82ef){console[_0x84a2('0x6f')](_0x84a2('0x70')+_0x2b82ef);var _0x61c405=_0x5aa515['query']['test']?0x1f4:_0x2b82ef[_0x84a2('0x71')]||0x1f4;logger[_0x84a2('0x2a')](_0x84a2('0x72'),_0x84a2('0x73'),_0x61c405,JSON[_0x84a2('0x74')](_0x2b82ef));delete _0x2b82ef[_0x84a2('0x2b')];if(_0x61c405===0x191){_0x61c405=0x190;}_0x1ac369[_0x84a2('0x1f')](_0x61c405)[_0x84a2('0x75')](_0x5aa515[_0x84a2('0x32')][_0x84a2('0x76')]?{'message':_0x84a2('0x77'),'statusCode':_0x2b82ef[_0x84a2('0x71')]}:_0x2b82ef);});};
\ No newline at end of file
index 959e9f0..413d661 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x193a=['moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','define','int_vtiger_accounts','util','../../config/logger','api'];(function(_0x3cf2dd,_0x279408){var _0x153585=function(_0x1053de){while(--_0x1053de){_0x3cf2dd['push'](_0x3cf2dd['shift']());}};_0x153585(++_0x279408);}(_0x193a,0xad));var _0xa193=function(_0x2baf32,_0x4bb3a3){_0x2baf32=_0x2baf32-0x0;var _0x5cb3c5=_0x193a[_0x2baf32];return _0x5cb3c5;};'use strict';var _=require('lodash');var util=require(_0xa193('0x0'));var logger=require(_0xa193('0x1'))(_0xa193('0x2'));var moment=require(_0xa193('0x3'));var BPromise=require(_0xa193('0x4'));var rp=require(_0xa193('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa193('0x6'));var config=require(_0xa193('0x7'));var attributes=require(_0xa193('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x202edd,_0x7a243d){return _0x202edd[_0xa193('0x9')]('VtigerAccount',attributes,{'tableName':_0xa193('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ba7=['./intVtigerAccount.attributes','../../components/integrations/configuration','int_vtiger_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x339b08,_0x303b4d){var _0xfcc406=function(_0x5af6de){while(--_0x5af6de){_0x339b08['push'](_0x339b08['shift']());}};_0xfcc406(++_0x303b4d);}(_0x4ba7,0x1b1));var _0x74ba=function(_0x7ca9f0,_0x5834a7){_0x7ca9f0=_0x7ca9f0-0x0;var _0x4dc51d=_0x4ba7[_0x7ca9f0];return _0x4dc51d;};'use strict';var _=require(_0x74ba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x74ba('0x1'));var moment=require('moment');var BPromise=require(_0x74ba('0x2'));var rp=require(_0x74ba('0x3'));var fs=require('fs');var path=require(_0x74ba('0x4'));var rimraf=require(_0x74ba('0x5'));var config=require(_0x74ba('0x6'));var attributes=require(_0x74ba('0x7'));var integrations=require(_0x74ba('0x8'));module['exports']=function(_0x385c50,_0x9b1e21){return _0x385c50['define']('VtigerAccount',attributes,{'tableName':_0x74ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d9f215a..2d06567 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','VtigerAccount','options','raw','where','attributes','include','model','map','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x51f7a3,_0x3f9940){var _0x174039=function(_0x4bf86e){while(--_0x4bf86e){_0x51f7a3['push'](_0x51f7a3['shift']());}};_0x174039(++_0x3f9940);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x4f2ab7,_0xb093c4){_0x4f2ab7=_0x4f2ab7-0x0;var _0xb6fac5=_0x6f7a[_0x4f2ab7];return _0xb6fac5;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}exports['GetVtigerAccount']=function(_0x4a8827){var _0xba7755=this;return new Promise(function(_0x5298ba,_0x378967){return db[_0xa6f7('0x1a')]['findAll']({'raw':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x4a8827['options']?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1e')]||null:null,'limit':_0x4a8827['options']?_0x4a8827['options']['limit']||null:null,'include':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')]['include']?_['map'](_0x4a8827['options'][_0xa6f7('0x1f')],function(_0xc77e8e){return{'model':db[_0xc77e8e[_0xa6f7('0x20')]],'as':_0xc77e8e['as'],'attributes':_0xc77e8e['attributes'],'include':_0xc77e8e['include']?_[_0xa6f7('0x21')](_0xc77e8e['include'],function(_0x47ef97){return{'model':db[_0x47ef97[_0xa6f7('0x20')]],'as':_0x47ef97['as'],'attributes':_0x47ef97['attributes'],'include':_0x47ef97[_0xa6f7('0x1f')]?_[_0xa6f7('0x21')](_0x47ef97[_0xa6f7('0x1f')],function(_0x2b4c6c){return{'model':db[_0x2b4c6c[_0xa6f7('0x20')]],'as':_0x2b4c6c['as'],'attributes':_0x2b4c6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c419b){logger[_0xa6f7('0xf')]('GetVtigerAccount',_0x4a8827);logger[_0xa6f7('0x10')](_0xa6f7('0x22'),_0x4a8827,JSON[_0xa6f7('0x12')](_0x1c419b));_0x5298ba(_0x1c419b);})[_0xa6f7('0x19')](function(_0x224f5a){logger[_0xa6f7('0x13')](_0xa6f7('0x22'),_0x224f5a[_0xa6f7('0x16')],_0x4a8827);_0x378967(_0xba7755[_0xa6f7('0x13')](0x1f4,_0x224f5a[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x23')]=function(_0x278bad){var _0x52f9c1=this;return new Promise(function(_0x442ccf,_0x42dc49){return db['VtigerAccount'][_0xa6f7('0x24')]({'raw':_0x278bad[_0xa6f7('0x1b')]?_0x278bad['options']['raw']===undefined?!![]:![]:!![],'where':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')]['attributes']||null:null,'include':_0x278bad['options']?_0x278bad[_0xa6f7('0x1b')]['include']?_[_0xa6f7('0x21')](_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1f')],function(_0x237e5d){return{'model':db[_0x237e5d[_0xa6f7('0x20')]],'as':_0x237e5d['as'],'attributes':_0x237e5d[_0xa6f7('0x1e')],'include':_0x237e5d['include']?_[_0xa6f7('0x21')](_0x237e5d[_0xa6f7('0x1f')],function(_0x1a5de5){return{'model':db[_0x1a5de5['model']],'as':_0x1a5de5['as'],'attributes':_0x1a5de5[_0xa6f7('0x1e')],'include':_0x1a5de5['include']?_[_0xa6f7('0x21')](_0x1a5de5[_0xa6f7('0x1f')],function(_0x45837c){return{'model':db[_0x45837c['model']],'as':_0x45837c['as'],'attributes':_0x45837c[_0xa6f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa6f7('0xe')](function(_0x3b3bc2){logger[_0xa6f7('0xf')](_0xa6f7('0x23'),_0x278bad);logger[_0xa6f7('0x10')]('ShowVtigerAccount',_0x278bad,JSON[_0xa6f7('0x12')](_0x3b3bc2));_0x442ccf(_0x3b3bc2);})[_0xa6f7('0x19')](function(_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x23'),_0xc25a1b[_0xa6f7('0x16')],_0x278bad);_0x42dc49(_0x52f9c1[_0xa6f7('0x13')](0x1f4,_0xc25a1b[_0xa6f7('0x16')]));});});};
\ No newline at end of file
+var _0xd87e=['stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x83b064,_0x44b4da){var _0x482c84=function(_0xf4006e){while(--_0xf4006e){_0x83b064['push'](_0x83b064['shift']());}};_0x482c84(++_0x44b4da);}(_0xd87e,0x1bf));var _0xed87=function(_0x1d97c0,_0x42db3c){_0x1d97c0=_0x1d97c0-0x0;var _0x5381df=_0xd87e[_0x1d97c0];return _0x5381df;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VtigerAccount,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')]({'raw':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x1a')]||null:null,'attributes':_0x2c386a['options']?_0x2c386a['options']['attributes']||null:null,'limit':_0x2c386a['options']?_0x2c386a[_0xed87('0x18')]['limit']||null:null,'include':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')]['include']?_[_0xed87('0x1b')](_0x2c386a['options'][_0xed87('0x1c')],function(_0x24962e){return{'model':db[_0x24962e[_0xed87('0x1d')]],'as':_0x24962e['as'],'attributes':_0x24962e[_0xed87('0x1e')],'include':_0x24962e[_0xed87('0x1c')]?_['map'](_0x24962e[_0xed87('0x1c')],function(_0x3c22b7){return{'model':db[_0x3c22b7[_0xed87('0x1d')]],'as':_0x3c22b7['as'],'attributes':_0x3c22b7[_0xed87('0x1e')],'include':_0x3c22b7[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x3c22b7[_0xed87('0x1c')],function(_0x4735b3){return{'model':db[_0x4735b3[_0xed87('0x1d')]],'as':_0x4735b3['as'],'attributes':_0x4735b3[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed87('0x9')](function(_0x341a35){logger[_0xed87('0xa')](_0xed87('0x15'),_0x2c386a);logger['debug'](_0xed87('0x15'),_0x2c386a,JSON[_0xed87('0xf')](_0x341a35));_0x5f4076(_0x341a35);})['catch'](function(_0x3dff74){logger[_0xed87('0x10')](_0xed87('0x15'),_0x3dff74['message'],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x3dff74[_0xed87('0x12')]));});});};exports[_0xed87('0x1f')]=function(_0x21ab8a){var _0x549a19=this;return new Promise(function(_0x37d45a,_0x3b87e3){return db[_0xed87('0x16')][_0xed87('0x20')]({'raw':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['where']||null:null,'attributes':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['attributes']||null:null,'include':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a['options'][_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x21ab8a[_0xed87('0x18')][_0xed87('0x1c')],function(_0x103b34){return{'model':db[_0x103b34[_0xed87('0x1d')]],'as':_0x103b34['as'],'attributes':_0x103b34[_0xed87('0x1e')],'include':_0x103b34[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x103b34[_0xed87('0x1c')],function(_0x35c9aa){return{'model':db[_0x35c9aa['model']],'as':_0x35c9aa['as'],'attributes':_0x35c9aa[_0xed87('0x1e')],'include':_0x35c9aa[_0xed87('0x1c')]?_['map'](_0x35c9aa[_0xed87('0x1c')],function(_0x54f6cb){return{'model':db[_0x54f6cb[_0xed87('0x1d')]],'as':_0x54f6cb['as'],'attributes':_0x54f6cb[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x443090){logger[_0xed87('0xa')](_0xed87('0x1f'),_0x21ab8a);logger[_0xed87('0xd')](_0xed87('0x1f'),_0x21ab8a,JSON['stringify'](_0x443090));_0x37d45a(_0x443090);})[_0xed87('0x14')](function(_0x525a11){logger[_0xed87('0x10')]('ShowVtigerAccount',_0x525a11[_0xed87('0x12')],_0x21ab8a);_0x3b87e3(_0x549a19[_0xed87('0x10')](0x1f4,_0x525a11[_0xed87('0x12')]));});});};
\ No newline at end of file
index 995b7a7..03a98e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7c2=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','exports','util','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc7c2,0x1a0));var _0x2c7c=function(_0x5cad4f,_0x30341f){_0x5cad4f=_0x5cad4f-0x0;var _0x1f9de3=_0xc7c2[_0x5cad4f];return _0x1f9de3;};'use strict';var multer=require('multer');var util=require(_0x2c7c('0x0'));var path=require(_0x2c7c('0x1'));var timeout=require(_0x2c7c('0x2'));var express=require(_0x2c7c('0x3'));var router=express[_0x2c7c('0x4')]();var fs_extra=require(_0x2c7c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2c7c('0x6'));var config=require(_0x2c7c('0x7'));var controller=require(_0x2c7c('0x8'));router[_0x2c7c('0x9')]('/',auth[_0x2c7c('0xa')](),controller['index']);router[_0x2c7c('0x9')](_0x2c7c('0xb'),auth[_0x2c7c('0xa')](),controller[_0x2c7c('0xc')]);router[_0x2c7c('0x9')]('/:id/fields',auth[_0x2c7c('0xa')](),controller[_0x2c7c('0xd')]);router[_0x2c7c('0x9')](_0x2c7c('0xe'),auth[_0x2c7c('0xa')](),controller[_0x2c7c('0xf')]);router[_0x2c7c('0x9')](_0x2c7c('0x10'),auth[_0x2c7c('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x2c7c('0xa')](),controller[_0x2c7c('0x11')]);router[_0x2c7c('0x12')]('/:id',auth[_0x2c7c('0xa')](),controller[_0x2c7c('0x13')]);router[_0x2c7c('0x14')](_0x2c7c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2c7c('0x15')]=router;
\ No newline at end of file
+var _0x6425=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x963be4,_0x227ef8){var _0x275db3=function(_0x6a2032){while(--_0x6a2032){_0x963be4['push'](_0x963be4['shift']());}};_0x275db3(++_0x227ef8);}(_0x6425,0x1ca));var _0x5642=function(_0x7e0691,_0x43a6fd){_0x7e0691=_0x7e0691-0x0;var _0x578ec8=_0x6425[_0x7e0691];return _0x578ec8;};'use strict';var multer=require(_0x5642('0x0'));var util=require(_0x5642('0x1'));var path=require(_0x5642('0x2'));var timeout=require(_0x5642('0x3'));var express=require('express');var router=express[_0x5642('0x4')]();var fs_extra=require(_0x5642('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5642('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x5642('0x7')]('/',auth[_0x5642('0x8')](),controller[_0x5642('0x9')]);router['get'](_0x5642('0xa'),auth['isAuthenticated'](),controller[_0x5642('0xb')]);router[_0x5642('0x7')]('/:id/fields',auth[_0x5642('0x8')](),controller[_0x5642('0xc')]);router[_0x5642('0x7')](_0x5642('0xd'),auth[_0x5642('0x8')](),controller['getSubjects']);router[_0x5642('0x7')]('/:id/descriptions',auth[_0x5642('0x8')](),controller[_0x5642('0xe')]);router[_0x5642('0xf')]('/',auth[_0x5642('0x8')](),controller[_0x5642('0x10')]);router[_0x5642('0x11')](_0x5642('0xa'),auth['isAuthenticated'](),controller[_0x5642('0x12')]);router[_0x5642('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5642('0x14')]);module[_0x5642('0x15')]=router;
\ No newline at end of file
index 971141c..079a67e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ff=['STRING','exports'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x22ff,0x131));var _0xf22f=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x22ff[_0x4688f3];return _0x470c84;};'use strict';var Sequelize=require('sequelize');module[_0xf22f('0x0')]={'name':{'type':Sequelize[_0xf22f('0x1')]},'description':{'type':Sequelize[_0xf22f('0x1')]}};
\ No newline at end of file
+var _0xf0ff=['sequelize','STRING'];(function(_0x4128a3,_0x1b8412){var _0x4bb083=function(_0x2010df){while(--_0x2010df){_0x4128a3['push'](_0x4128a3['shift']());}};_0x4bb083(++_0x1b8412);}(_0xf0ff,0xde));var _0xff0f=function(_0x57e4d4,_0x3bb690){_0x57e4d4=_0x57e4d4-0x0;var _0x3b0e1c=_0xf0ff[_0x57e4d4];return _0x3b0e1c;};'use strict';var Sequelize=require(_0xff0f('0x0'));module['exports']={'name':{'type':Sequelize[_0xff0f('0x1')]},'description':{'type':Sequelize[_0xff0f('0x1')]}};
\ No newline at end of file
index f6ff296..b8ae2e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb39=['send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','fields','find','create','catch','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','count','limit','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name'];(function(_0x27657c,_0x36813e){var _0x12324a=function(_0x3f6eea){while(--_0x3f6eea){_0x27657c['push'](_0x27657c['shift']());}};_0x12324a(++_0x36813e);}(_0xcb39,0x76));var _0x9cb3=function(_0x2074fb,_0x26707f){_0x2074fb=_0x2074fb-0x0;var _0x4c71d3=_0xcb39[_0x2074fb];return _0x4c71d3;};'use strict';var emlformat=require(_0x9cb3('0x0'));var rimraf=require(_0x9cb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9cb3('0x2'));var moment=require(_0x9cb3('0x3'));var BPromise=require(_0x9cb3('0x4'));var Mustache=require('mustache');var util=require(_0x9cb3('0x5'));var path=require('path');var sox=require(_0x9cb3('0x6'));var csv=require('to-csv');var ejs=require(_0x9cb3('0x7'));var fs=require('fs');var fs_extra=require(_0x9cb3('0x8'));var _=require(_0x9cb3('0x9'));var squel=require(_0x9cb3('0xa'));var crypto=require('crypto');var jsforce=require(_0x9cb3('0xb'));var deskjs=require(_0x9cb3('0xc'));var toCsv=require(_0x9cb3('0xd'));var querystring=require(_0x9cb3('0xe'));var Papa=require(_0x9cb3('0xf'));var Redis=require('ioredis');var authService=require(_0x9cb3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9cb3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cb3('0x12'))(_0x9cb3('0x13'));var utils=require(_0x9cb3('0x14'));var config=require(_0x9cb3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9cb3('0x16'))['db'];function respondWithStatusCode(_0x28a183,_0x22e0d3){_0x22e0d3=_0x22e0d3||0xcc;return function(_0x4f579d){if(_0x4f579d){return _0x28a183['sendStatus'](_0x22e0d3);}return _0x28a183[_0x9cb3('0x17')](_0x22e0d3)[_0x9cb3('0x18')]();};}function respondWithResult(_0x570e93,_0x8c6489){_0x8c6489=_0x8c6489||0xc8;return function(_0x4ca9ea){if(_0x4ca9ea){return _0x570e93[_0x9cb3('0x17')](_0x8c6489)[_0x9cb3('0x19')](_0x4ca9ea);}};}function respondWithFilteredResult(_0x3ea4f0,_0x21ddc0){return function(_0x3a517c){if(_0x3a517c){var _0x6e986c=typeof _0x21ddc0[_0x9cb3('0x1a')]==='undefined'&&typeof _0x21ddc0['limit']==='undefined';var _0x14c0fe=_0x3a517c[_0x9cb3('0x1b')];var _0x238227=_0x6e986c?0x0:_0x21ddc0[_0x9cb3('0x1a')];var _0x57e039=_0x6e986c?_0x3a517c[_0x9cb3('0x1b')]:_0x21ddc0[_0x9cb3('0x1a')]+_0x21ddc0[_0x9cb3('0x1c')];var _0x50b200;if(_0x57e039>=_0x14c0fe){_0x57e039=_0x14c0fe;_0x50b200=0xc8;}else{_0x50b200=0xce;}_0x3ea4f0['status'](_0x50b200);return _0x3ea4f0[_0x9cb3('0x1d')]('Content-Range',_0x238227+'-'+_0x57e039+'/'+_0x14c0fe)[_0x9cb3('0x19')](_0x3a517c);}return null;};}function patchUpdates(_0x172a42){return function(_0x3377c0){try{jsonpatch[_0x9cb3('0x1e')](_0x3377c0,_0x172a42,!![]);}catch(_0xca3734){return BPromise[_0x9cb3('0x1f')](_0xca3734);}return _0x3377c0[_0x9cb3('0x20')]();};}function saveUpdates(_0x1f9876,_0x44567f){return function(_0x300f1e){if(_0x300f1e){return _0x300f1e[_0x9cb3('0x21')](_0x1f9876)['then'](function(_0xe81187){return _0xe81187;});}return null;};}function removeEntity(_0x2d4b7c,_0x2865ca){return function(_0xc14df8){if(_0xc14df8){return _0xc14df8[_0x9cb3('0x22')]()[_0x9cb3('0x23')](function(){_0x2d4b7c[_0x9cb3('0x17')](0xcc)[_0x9cb3('0x18')]();});}};}function handleEntityNotFound(_0x3973e9,_0xe9bf31){return function(_0x10caba){if(!_0x10caba){_0x3973e9[_0x9cb3('0x24')](0x194);}return _0x10caba;};}function handleError(_0x2b6358,_0x28837c){_0x28837c=_0x28837c||0x1f4;return function(_0x4103c5){logger[_0x9cb3('0x25')](_0x4103c5[_0x9cb3('0x26')]);if(_0x4103c5['name']){delete _0x4103c5[_0x9cb3('0x27')];}_0x2b6358[_0x9cb3('0x17')](_0x28837c)[_0x9cb3('0x28')](_0x4103c5);};}exports[_0x9cb3('0x29')]=function(_0x5fc3a4,_0x3b77d3){var _0x98269d={},_0x58f2d5={},_0x48d8b9={'count':0x0,'rows':[]};var _0x29a14d=_[_0x9cb3('0x2a')](db[_0x9cb3('0x2b')][_0x9cb3('0x2c')],function(_0x43ab03){return{'name':_0x43ab03[_0x9cb3('0x2d')],'type':_0x43ab03[_0x9cb3('0x2e')][_0x9cb3('0x2f')]};});_0x58f2d5[_0x9cb3('0x30')]=_[_0x9cb3('0x2a')](_0x29a14d,_0x9cb3('0x27'));_0x58f2d5[_0x9cb3('0x31')]=_[_0x9cb3('0x32')](_0x5fc3a4['query']);_0x58f2d5[_0x9cb3('0x33')]=_[_0x9cb3('0x34')](_0x58f2d5['model'],_0x58f2d5['query']);_0x98269d['attributes']=_[_0x9cb3('0x34')](_0x58f2d5[_0x9cb3('0x30')],qs['fields'](_0x5fc3a4[_0x9cb3('0x31')]['fields']));_0x98269d[_0x9cb3('0x35')]=_0x98269d[_0x9cb3('0x35')][_0x9cb3('0x36')]?_0x98269d[_0x9cb3('0x35')]:_0x58f2d5[_0x9cb3('0x30')];if(!_0x5fc3a4[_0x9cb3('0x31')][_0x9cb3('0x37')](_0x9cb3('0x38'))){_0x98269d[_0x9cb3('0x1c')]=qs[_0x9cb3('0x1c')](_0x5fc3a4[_0x9cb3('0x31')]['limit']);_0x98269d[_0x9cb3('0x1a')]=qs['offset'](_0x5fc3a4['query']['offset']);}_0x98269d[_0x9cb3('0x39')]=qs[_0x9cb3('0x3a')](_0x5fc3a4[_0x9cb3('0x31')][_0x9cb3('0x3a')]);_0x98269d[_0x9cb3('0x3b')]=qs[_0x9cb3('0x33')](_[_0x9cb3('0x3c')](_0x5fc3a4['query'],_0x58f2d5[_0x9cb3('0x33')]),_0x29a14d);if(_0x5fc3a4[_0x9cb3('0x31')][_0x9cb3('0x3d')]){_0x98269d[_0x9cb3('0x3b')]=_[_0x9cb3('0x3e')](_0x98269d[_0x9cb3('0x3b')],{'$or':_[_0x9cb3('0x2a')](_0x29a14d,function(_0x5590d5){if(_0x5590d5['type']!==_0x9cb3('0x3f')){var _0x2fe1e5={};_0x2fe1e5[_0x5590d5[_0x9cb3('0x27')]]={'$like':'%'+_0x5fc3a4[_0x9cb3('0x31')]['filter']+'%'};return _0x2fe1e5;}})});}_0x98269d=_[_0x9cb3('0x3e')]({},_0x98269d,_0x5fc3a4[_0x9cb3('0x40')]);var _0x599434={'where':_0x98269d[_0x9cb3('0x3b')]};return db['VtigerConfiguration'][_0x9cb3('0x1b')](_0x599434)[_0x9cb3('0x23')](function(_0x1bd8fb){_0x48d8b9[_0x9cb3('0x1b')]=_0x1bd8fb;if(_0x5fc3a4[_0x9cb3('0x31')][_0x9cb3('0x41')]){_0x98269d['include']=[{'all':!![]}];}return db[_0x9cb3('0x2b')][_0x9cb3('0x42')](_0x98269d);})['then'](function(_0x5ad06f){_0x48d8b9['rows']=_0x5ad06f;return _0x48d8b9;})['then'](respondWithFilteredResult(_0x3b77d3,_0x98269d))['catch'](handleError(_0x3b77d3,null));};exports[_0x9cb3('0x43')]=function(_0x489887,_0x43175c){var _0x5a1061={'raw':![],'where':{'id':_0x489887[_0x9cb3('0x44')]['id']}},_0x463744={};_0x463744[_0x9cb3('0x30')]=_[_0x9cb3('0x32')](db['VtigerConfiguration'][_0x9cb3('0x2c')]);_0x463744[_0x9cb3('0x31')]=_[_0x9cb3('0x32')](_0x489887[_0x9cb3('0x31')]);_0x463744[_0x9cb3('0x33')]=_[_0x9cb3('0x34')](_0x463744[_0x9cb3('0x30')],_0x463744[_0x9cb3('0x31')]);_0x5a1061[_0x9cb3('0x35')]=_['intersection'](_0x463744[_0x9cb3('0x30')],qs[_0x9cb3('0x45')](_0x489887[_0x9cb3('0x31')][_0x9cb3('0x45')]));_0x5a1061[_0x9cb3('0x35')]=_0x5a1061[_0x9cb3('0x35')][_0x9cb3('0x36')]?_0x5a1061['attributes']:_0x463744['model'];if(_0x489887['query'][_0x9cb3('0x41')]){_0x5a1061['include']=[{'all':!![]}];}_0x5a1061=_[_0x9cb3('0x3e')]({},_0x5a1061,_0x489887[_0x9cb3('0x40')]);return db[_0x9cb3('0x2b')][_0x9cb3('0x46')](_0x5a1061)[_0x9cb3('0x23')](handleEntityNotFound(_0x43175c,null))[_0x9cb3('0x23')](respondWithResult(_0x43175c,null))['catch'](handleError(_0x43175c,null));};exports[_0x9cb3('0x47')]=function(_0x1d4755,_0xa567ac){return db[_0x9cb3('0x2b')]['create'](_0x1d4755['body'],{})[_0x9cb3('0x23')](respondWithResult(_0xa567ac,0xc9))[_0x9cb3('0x48')](handleError(_0xa567ac,null));};exports[_0x9cb3('0x21')]=function(_0x325f0b,_0x102ced){if(_0x325f0b[_0x9cb3('0x49')]['id']){delete _0x325f0b[_0x9cb3('0x49')]['id'];}return db[_0x9cb3('0x2b')][_0x9cb3('0x46')]({'where':{'id':_0x325f0b[_0x9cb3('0x44')]['id']}})['then'](handleEntityNotFound(_0x102ced,null))['then'](saveUpdates(_0x325f0b['body'],null))[_0x9cb3('0x23')](respondWithResult(_0x102ced,null))[_0x9cb3('0x48')](handleError(_0x102ced,null));};exports[_0x9cb3('0x22')]=function(_0x11c4a2,_0xabc84a){return db[_0x9cb3('0x2b')]['find']({'where':{'id':_0x11c4a2[_0x9cb3('0x44')]['id']}})[_0x9cb3('0x23')](handleEntityNotFound(_0xabc84a,null))['then'](removeEntity(_0xabc84a,null))['catch'](handleError(_0xabc84a,null));};exports[_0x9cb3('0x4a')]=function(_0xaf9957,_0x22e241,_0x3b8007){var _0x16eccb={};var _0x4823b2={};var _0x449a62;var _0x30e7f0;return db[_0x9cb3('0x2b')][_0x9cb3('0x4b')]({'where':{'id':_0xaf9957['params']['id']}})[_0x9cb3('0x23')](handleEntityNotFound(_0x22e241,null))['then'](function(_0x51c6aa){if(_0x51c6aa){_0x449a62=_0x51c6aa;_0x4823b2[_0x9cb3('0x30')]=_[_0x9cb3('0x32')](db[_0x9cb3('0x4c')]['rawAttributes']);_0x4823b2['query']=_[_0x9cb3('0x32')](_0xaf9957[_0x9cb3('0x31')]);_0x4823b2[_0x9cb3('0x33')]=_['intersection'](_0x4823b2[_0x9cb3('0x30')],_0x4823b2[_0x9cb3('0x31')]);_0x16eccb[_0x9cb3('0x35')]=_[_0x9cb3('0x34')](_0x4823b2[_0x9cb3('0x30')],qs['fields'](_0xaf9957[_0x9cb3('0x31')][_0x9cb3('0x45')]));_0x16eccb[_0x9cb3('0x35')]=_0x16eccb[_0x9cb3('0x35')][_0x9cb3('0x36')]?_0x16eccb['attributes']:_0x4823b2[_0x9cb3('0x30')];_0x16eccb[_0x9cb3('0x39')]=qs['sort'](_0xaf9957[_0x9cb3('0x31')][_0x9cb3('0x3a')]);_0x16eccb[_0x9cb3('0x3b')]=qs[_0x9cb3('0x33')](_[_0x9cb3('0x3c')](_0xaf9957[_0x9cb3('0x31')],_0x4823b2[_0x9cb3('0x33')]));if(_0xaf9957[_0x9cb3('0x31')][_0x9cb3('0x3d')]){_0x16eccb[_0x9cb3('0x3b')]=_[_0x9cb3('0x3e')](_0x16eccb[_0x9cb3('0x3b')],{'$or':_['map'](_0x16eccb[_0x9cb3('0x35')],function(_0x4fe9ba){var _0x332d7d={};_0x332d7d[_0x4fe9ba]={'$like':'%'+_0xaf9957[_0x9cb3('0x31')]['filter']+'%'};return _0x332d7d;})});}_0x16eccb=_[_0x9cb3('0x3e')]({},_0x16eccb,_0xaf9957['options']);return _0x449a62[_0x9cb3('0x4a')](_0x16eccb);}})[_0x9cb3('0x23')](function(_0x4ed899){if(_0x4ed899){_0x30e7f0=_0x4ed899[_0x9cb3('0x36')];if(!_0xaf9957[_0x9cb3('0x31')]['hasOwnProperty'](_0x9cb3('0x38'))){_0x16eccb['limit']=qs[_0x9cb3('0x1c')](_0xaf9957[_0x9cb3('0x31')][_0x9cb3('0x1c')]);_0x16eccb[_0x9cb3('0x1a')]=qs[_0x9cb3('0x1a')](_0xaf9957['query']['offset']);}return _0x449a62['getFields'](_0x16eccb);}})['then'](function(_0x55b2fb){if(_0x55b2fb){return _0x55b2fb?{'count':_0x30e7f0,'rows':_0x55b2fb}:null;}})[_0x9cb3('0x23')](respondWithResult(_0x22e241,null))[_0x9cb3('0x48')](handleError(_0x22e241,null));};exports['getSubjects']=function(_0x2e087a,_0x31d0a8,_0x1a49d5){var _0xbbd8be={};var _0x2cfba6={};var _0x528edc;var _0x387caf;return db[_0x9cb3('0x2b')]['findOne']({'where':{'id':_0x2e087a['params']['id']}})[_0x9cb3('0x23')](handleEntityNotFound(_0x31d0a8,null))[_0x9cb3('0x23')](function(_0x3146b0){if(_0x3146b0){_0x528edc=_0x3146b0;_0x2cfba6[_0x9cb3('0x30')]=_[_0x9cb3('0x32')](db[_0x9cb3('0x4c')][_0x9cb3('0x2c')]);_0x2cfba6[_0x9cb3('0x31')]=_[_0x9cb3('0x32')](_0x2e087a[_0x9cb3('0x31')]);_0x2cfba6['filters']=_['intersection'](_0x2cfba6['model'],_0x2cfba6[_0x9cb3('0x31')]);_0xbbd8be['attributes']=_[_0x9cb3('0x34')](_0x2cfba6[_0x9cb3('0x30')],qs['fields'](_0x2e087a[_0x9cb3('0x31')][_0x9cb3('0x45')]));_0xbbd8be[_0x9cb3('0x35')]=_0xbbd8be[_0x9cb3('0x35')][_0x9cb3('0x36')]?_0xbbd8be[_0x9cb3('0x35')]:_0x2cfba6[_0x9cb3('0x30')];_0xbbd8be[_0x9cb3('0x39')]=qs[_0x9cb3('0x3a')](_0x2e087a['query'][_0x9cb3('0x3a')]);_0xbbd8be[_0x9cb3('0x3b')]=qs[_0x9cb3('0x33')](_[_0x9cb3('0x3c')](_0x2e087a[_0x9cb3('0x31')],_0x2cfba6['filters']));if(_0x2e087a[_0x9cb3('0x31')][_0x9cb3('0x3d')]){_0xbbd8be[_0x9cb3('0x3b')]=_[_0x9cb3('0x3e')](_0xbbd8be[_0x9cb3('0x3b')],{'$or':_['map'](_0xbbd8be[_0x9cb3('0x35')],function(_0x40057f){var _0x20a8d0={};_0x20a8d0[_0x40057f]={'$like':'%'+_0x2e087a['query']['filter']+'%'};return _0x20a8d0;})});}_0xbbd8be=_['merge']({},_0xbbd8be,_0x2e087a[_0x9cb3('0x40')]);return _0x528edc[_0x9cb3('0x4d')](_0xbbd8be);}})['then'](function(_0x54c820){if(_0x54c820){_0x387caf=_0x54c820['length'];if(!_0x2e087a[_0x9cb3('0x31')][_0x9cb3('0x37')](_0x9cb3('0x38'))){_0xbbd8be['limit']=qs[_0x9cb3('0x1c')](_0x2e087a[_0x9cb3('0x31')][_0x9cb3('0x1c')]);_0xbbd8be[_0x9cb3('0x1a')]=qs[_0x9cb3('0x1a')](_0x2e087a[_0x9cb3('0x31')]['offset']);}return _0x528edc[_0x9cb3('0x4d')](_0xbbd8be);}})[_0x9cb3('0x23')](function(_0x3769a1){if(_0x3769a1){return _0x3769a1?{'count':_0x387caf,'rows':_0x3769a1}:null;}})['then'](respondWithResult(_0x31d0a8,null))[_0x9cb3('0x48')](handleError(_0x31d0a8,null));};exports['getDescriptions']=function(_0x333b97,_0x4f4507,_0x40ea11){var _0x3a82c2={};var _0x253ef9={};var _0x5eff92;var _0x39accb;return db[_0x9cb3('0x2b')][_0x9cb3('0x4b')]({'where':{'id':_0x333b97[_0x9cb3('0x44')]['id']}})[_0x9cb3('0x23')](handleEntityNotFound(_0x4f4507,null))[_0x9cb3('0x23')](function(_0x2442df){if(_0x2442df){_0x5eff92=_0x2442df;_0x253ef9[_0x9cb3('0x30')]=_[_0x9cb3('0x32')](db['VtigerField'][_0x9cb3('0x2c')]);_0x253ef9[_0x9cb3('0x31')]=_[_0x9cb3('0x32')](_0x333b97[_0x9cb3('0x31')]);_0x253ef9['filters']=_[_0x9cb3('0x34')](_0x253ef9['model'],_0x253ef9[_0x9cb3('0x31')]);_0x3a82c2[_0x9cb3('0x35')]=_[_0x9cb3('0x34')](_0x253ef9[_0x9cb3('0x30')],qs[_0x9cb3('0x45')](_0x333b97[_0x9cb3('0x31')][_0x9cb3('0x45')]));_0x3a82c2[_0x9cb3('0x35')]=_0x3a82c2['attributes'][_0x9cb3('0x36')]?_0x3a82c2['attributes']:_0x253ef9[_0x9cb3('0x30')];_0x3a82c2[_0x9cb3('0x39')]=qs[_0x9cb3('0x3a')](_0x333b97[_0x9cb3('0x31')][_0x9cb3('0x3a')]);_0x3a82c2[_0x9cb3('0x3b')]=qs[_0x9cb3('0x33')](_[_0x9cb3('0x3c')](_0x333b97[_0x9cb3('0x31')],_0x253ef9[_0x9cb3('0x33')]));if(_0x333b97[_0x9cb3('0x31')][_0x9cb3('0x3d')]){_0x3a82c2[_0x9cb3('0x3b')]=_[_0x9cb3('0x3e')](_0x3a82c2[_0x9cb3('0x3b')],{'$or':_[_0x9cb3('0x2a')](_0x3a82c2[_0x9cb3('0x35')],function(_0x3f0363){var _0xdcfe60={};_0xdcfe60[_0x3f0363]={'$like':'%'+_0x333b97[_0x9cb3('0x31')][_0x9cb3('0x3d')]+'%'};return _0xdcfe60;})});}_0x3a82c2=_['merge']({},_0x3a82c2,_0x333b97[_0x9cb3('0x40')]);return _0x5eff92[_0x9cb3('0x4e')](_0x3a82c2);}})[_0x9cb3('0x23')](function(_0x3975ef){if(_0x3975ef){_0x39accb=_0x3975ef['length'];if(!_0x333b97['query'][_0x9cb3('0x37')]('nolimit')){_0x3a82c2[_0x9cb3('0x1c')]=qs[_0x9cb3('0x1c')](_0x333b97[_0x9cb3('0x31')][_0x9cb3('0x1c')]);_0x3a82c2[_0x9cb3('0x1a')]=qs[_0x9cb3('0x1a')](_0x333b97[_0x9cb3('0x31')][_0x9cb3('0x1a')]);}return _0x5eff92[_0x9cb3('0x4e')](_0x3a82c2);}})[_0x9cb3('0x23')](function(_0x2c6b2c){if(_0x2c6b2c){return _0x2c6b2c?{'count':_0x39accb,'rows':_0x2c6b2c}:null;}})[_0x9cb3('0x23')](respondWithResult(_0x4f4507,null))[_0x9cb3('0x48')](handleError(_0x4f4507,null));};
\ No newline at end of file
+var _0xab1e=['Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','getFields','findOne','hasOwnProperty','nolimit','getSubjects','VtigerField','getDescriptions','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set'];(function(_0x4a3ce6,_0x4d3c57){var _0xd0ddec=function(_0x39c8de){while(--_0x39c8de){_0x4a3ce6['push'](_0x4a3ce6['shift']());}};_0xd0ddec(++_0x4d3c57);}(_0xab1e,0x81));var _0xeab1=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xab1e[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeab1('0x0'));var rp=require(_0xeab1('0x1'));var moment=require(_0xeab1('0x2'));var BPromise=require(_0xeab1('0x3'));var Mustache=require(_0xeab1('0x4'));var util=require('util');var path=require('path');var sox=require(_0xeab1('0x5'));var csv=require('to-csv');var ejs=require(_0xeab1('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeab1('0x7'));var squel=require('squel');var crypto=require(_0xeab1('0x8'));var jsforce=require(_0xeab1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xeab1('0xa'));var querystring=require(_0xeab1('0xb'));var Papa=require(_0xeab1('0xc'));var Redis=require(_0xeab1('0xd'));var authService=require(_0xeab1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xeab1('0xf'));var hardwareService=require(_0xeab1('0x10'));var logger=require(_0xeab1('0x11'))(_0xeab1('0x12'));var utils=require(_0xeab1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeab1('0x14'))['db'];function respondWithStatusCode(_0x29223b,_0x355008){_0x355008=_0x355008||0xcc;return function(_0x976065){if(_0x976065){return _0x29223b[_0xeab1('0x15')](_0x355008);}return _0x29223b[_0xeab1('0x16')](_0x355008)[_0xeab1('0x17')]();};}function respondWithResult(_0x36f7f0,_0x7cfc36){_0x7cfc36=_0x7cfc36||0xc8;return function(_0x5999da){if(_0x5999da){return _0x36f7f0[_0xeab1('0x16')](_0x7cfc36)['json'](_0x5999da);}};}function respondWithFilteredResult(_0x3b5e9f,_0x27943a){return function(_0x3b78aa){if(_0x3b78aa){var _0x5db354=typeof _0x27943a[_0xeab1('0x18')]==='undefined'&&typeof _0x27943a['limit']===_0xeab1('0x19');var _0x16796b=_0x3b78aa[_0xeab1('0x1a')];var _0x4cd042=_0x5db354?0x0:_0x27943a[_0xeab1('0x18')];var _0x584a55=_0x5db354?_0x3b78aa[_0xeab1('0x1a')]:_0x27943a[_0xeab1('0x18')]+_0x27943a[_0xeab1('0x1b')];var _0x3c84a9;if(_0x584a55>=_0x16796b){_0x584a55=_0x16796b;_0x3c84a9=0xc8;}else{_0x3c84a9=0xce;}_0x3b5e9f[_0xeab1('0x16')](_0x3c84a9);return _0x3b5e9f[_0xeab1('0x1c')](_0xeab1('0x1d'),_0x4cd042+'-'+_0x584a55+'/'+_0x16796b)[_0xeab1('0x1e')](_0x3b78aa);}return null;};}function patchUpdates(_0x392062){return function(_0x124acb){try{jsonpatch[_0xeab1('0x1f')](_0x124acb,_0x392062,!![]);}catch(_0x1755ac){return BPromise[_0xeab1('0x20')](_0x1755ac);}return _0x124acb[_0xeab1('0x21')]();};}function saveUpdates(_0x2da240,_0x174c2f){return function(_0xb63e05){if(_0xb63e05){return _0xb63e05[_0xeab1('0x22')](_0x2da240)[_0xeab1('0x23')](function(_0x30ea8c){return _0x30ea8c;});}return null;};}function removeEntity(_0x33d17d,_0x386512){return function(_0x513d29){if(_0x513d29){return _0x513d29[_0xeab1('0x24')]()[_0xeab1('0x23')](function(){_0x33d17d[_0xeab1('0x16')](0xcc)[_0xeab1('0x17')]();});}};}function handleEntityNotFound(_0x1447f1,_0x5d2893){return function(_0xb9466c){if(!_0xb9466c){_0x1447f1[_0xeab1('0x15')](0x194);}return _0xb9466c;};}function handleError(_0x317662,_0x3c614a){_0x3c614a=_0x3c614a||0x1f4;return function(_0x576d9a){logger[_0xeab1('0x25')](_0x576d9a['stack']);if(_0x576d9a[_0xeab1('0x26')]){delete _0x576d9a[_0xeab1('0x26')];}_0x317662['status'](_0x3c614a)[_0xeab1('0x27')](_0x576d9a);};}exports[_0xeab1('0x28')]=function(_0x565227,_0x1c3eb9){var _0x156290={},_0x3f67fb={},_0x1eda15={'count':0x0,'rows':[]};var _0x10f1a0=_[_0xeab1('0x29')](db[_0xeab1('0x2a')][_0xeab1('0x2b')],function(_0x4c300e){return{'name':_0x4c300e[_0xeab1('0x2c')],'type':_0x4c300e[_0xeab1('0x2d')][_0xeab1('0x2e')]};});_0x3f67fb[_0xeab1('0x2f')]=_[_0xeab1('0x29')](_0x10f1a0,_0xeab1('0x26'));_0x3f67fb[_0xeab1('0x30')]=_[_0xeab1('0x31')](_0x565227[_0xeab1('0x30')]);_0x3f67fb[_0xeab1('0x32')]=_['intersection'](_0x3f67fb['model'],_0x3f67fb[_0xeab1('0x30')]);_0x156290[_0xeab1('0x33')]=_[_0xeab1('0x34')](_0x3f67fb[_0xeab1('0x2f')],qs['fields'](_0x565227[_0xeab1('0x30')][_0xeab1('0x35')]));_0x156290[_0xeab1('0x33')]=_0x156290[_0xeab1('0x33')][_0xeab1('0x36')]?_0x156290[_0xeab1('0x33')]:_0x3f67fb['model'];if(!_0x565227[_0xeab1('0x30')]['hasOwnProperty']('nolimit')){_0x156290[_0xeab1('0x1b')]=qs[_0xeab1('0x1b')](_0x565227[_0xeab1('0x30')][_0xeab1('0x1b')]);_0x156290[_0xeab1('0x18')]=qs[_0xeab1('0x18')](_0x565227[_0xeab1('0x30')][_0xeab1('0x18')]);}_0x156290[_0xeab1('0x37')]=qs['sort'](_0x565227[_0xeab1('0x30')][_0xeab1('0x38')]);_0x156290[_0xeab1('0x39')]=qs[_0xeab1('0x32')](_[_0xeab1('0x3a')](_0x565227['query'],_0x3f67fb[_0xeab1('0x32')]),_0x10f1a0);if(_0x565227['query'][_0xeab1('0x3b')]){_0x156290['where']=_[_0xeab1('0x3c')](_0x156290['where'],{'$or':_[_0xeab1('0x29')](_0x10f1a0,function(_0x5ed715){if(_0x5ed715['type']!==_0xeab1('0x3d')){var _0x166b94={};_0x166b94[_0x5ed715['name']]={'$like':'%'+_0x565227['query'][_0xeab1('0x3b')]+'%'};return _0x166b94;}})});}_0x156290=_[_0xeab1('0x3c')]({},_0x156290,_0x565227[_0xeab1('0x3e')]);var _0x4e0eee={'where':_0x156290[_0xeab1('0x39')]};return db[_0xeab1('0x2a')][_0xeab1('0x1a')](_0x4e0eee)[_0xeab1('0x23')](function(_0x37a27e){_0x1eda15[_0xeab1('0x1a')]=_0x37a27e;if(_0x565227[_0xeab1('0x30')][_0xeab1('0x3f')]){_0x156290['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xeab1('0x40')](_0x156290);})[_0xeab1('0x23')](function(_0x2a599a){_0x1eda15[_0xeab1('0x41')]=_0x2a599a;return _0x1eda15;})[_0xeab1('0x23')](respondWithFilteredResult(_0x1c3eb9,_0x156290))[_0xeab1('0x42')](handleError(_0x1c3eb9,null));};exports[_0xeab1('0x43')]=function(_0x1b696e,_0x3f2be4){var _0x15711e={'raw':![],'where':{'id':_0x1b696e[_0xeab1('0x44')]['id']}},_0x474029={};_0x474029['model']=_[_0xeab1('0x31')](db[_0xeab1('0x2a')][_0xeab1('0x2b')]);_0x474029[_0xeab1('0x30')]=_['keys'](_0x1b696e[_0xeab1('0x30')]);_0x474029['filters']=_['intersection'](_0x474029[_0xeab1('0x2f')],_0x474029[_0xeab1('0x30')]);_0x15711e[_0xeab1('0x33')]=_[_0xeab1('0x34')](_0x474029[_0xeab1('0x2f')],qs[_0xeab1('0x35')](_0x1b696e[_0xeab1('0x30')][_0xeab1('0x35')]));_0x15711e[_0xeab1('0x33')]=_0x15711e[_0xeab1('0x33')]['length']?_0x15711e['attributes']:_0x474029['model'];if(_0x1b696e[_0xeab1('0x30')][_0xeab1('0x3f')]){_0x15711e['include']=[{'all':!![]}];}_0x15711e=_['merge']({},_0x15711e,_0x1b696e[_0xeab1('0x3e')]);return db[_0xeab1('0x2a')]['find'](_0x15711e)[_0xeab1('0x23')](handleEntityNotFound(_0x3f2be4,null))[_0xeab1('0x23')](respondWithResult(_0x3f2be4,null))['catch'](handleError(_0x3f2be4,null));};exports[_0xeab1('0x45')]=function(_0x5be3d9,_0x3676e2){return db[_0xeab1('0x2a')][_0xeab1('0x45')](_0x5be3d9[_0xeab1('0x46')],{})['then'](respondWithResult(_0x3676e2,0xc9))[_0xeab1('0x42')](handleError(_0x3676e2,null));};exports['update']=function(_0x3d5971,_0x513f8f){if(_0x3d5971[_0xeab1('0x46')]['id']){delete _0x3d5971['body']['id'];}return db[_0xeab1('0x2a')]['find']({'where':{'id':_0x3d5971[_0xeab1('0x44')]['id']}})[_0xeab1('0x23')](handleEntityNotFound(_0x513f8f,null))[_0xeab1('0x23')](saveUpdates(_0x3d5971[_0xeab1('0x46')],null))[_0xeab1('0x23')](respondWithResult(_0x513f8f,null))['catch'](handleError(_0x513f8f,null));};exports[_0xeab1('0x24')]=function(_0x4c8519,_0x277b0a){return db[_0xeab1('0x2a')][_0xeab1('0x47')]({'where':{'id':_0x4c8519[_0xeab1('0x44')]['id']}})[_0xeab1('0x23')](handleEntityNotFound(_0x277b0a,null))['then'](removeEntity(_0x277b0a,null))['catch'](handleError(_0x277b0a,null));};exports[_0xeab1('0x48')]=function(_0x27ac73,_0x672a7c,_0x32eb23){var _0x4093f5={};var _0x5e47e9={};var _0x4691c9;var _0x30f90d;return db[_0xeab1('0x2a')][_0xeab1('0x49')]({'where':{'id':_0x27ac73['params']['id']}})[_0xeab1('0x23')](handleEntityNotFound(_0x672a7c,null))[_0xeab1('0x23')](function(_0x40d174){if(_0x40d174){_0x4691c9=_0x40d174;_0x5e47e9['model']=_[_0xeab1('0x31')](db['VtigerField']['rawAttributes']);_0x5e47e9[_0xeab1('0x30')]=_['keys'](_0x27ac73[_0xeab1('0x30')]);_0x5e47e9['filters']=_[_0xeab1('0x34')](_0x5e47e9[_0xeab1('0x2f')],_0x5e47e9[_0xeab1('0x30')]);_0x4093f5[_0xeab1('0x33')]=_['intersection'](_0x5e47e9[_0xeab1('0x2f')],qs[_0xeab1('0x35')](_0x27ac73[_0xeab1('0x30')][_0xeab1('0x35')]));_0x4093f5[_0xeab1('0x33')]=_0x4093f5[_0xeab1('0x33')][_0xeab1('0x36')]?_0x4093f5[_0xeab1('0x33')]:_0x5e47e9['model'];_0x4093f5[_0xeab1('0x37')]=qs[_0xeab1('0x38')](_0x27ac73[_0xeab1('0x30')][_0xeab1('0x38')]);_0x4093f5['where']=qs[_0xeab1('0x32')](_['pick'](_0x27ac73[_0xeab1('0x30')],_0x5e47e9[_0xeab1('0x32')]));if(_0x27ac73[_0xeab1('0x30')][_0xeab1('0x3b')]){_0x4093f5[_0xeab1('0x39')]=_[_0xeab1('0x3c')](_0x4093f5['where'],{'$or':_[_0xeab1('0x29')](_0x4093f5['attributes'],function(_0x4428c8){var _0x30468d={};_0x30468d[_0x4428c8]={'$like':'%'+_0x27ac73[_0xeab1('0x30')][_0xeab1('0x3b')]+'%'};return _0x30468d;})});}_0x4093f5=_[_0xeab1('0x3c')]({},_0x4093f5,_0x27ac73['options']);return _0x4691c9[_0xeab1('0x48')](_0x4093f5);}})['then'](function(_0x2bcccc){if(_0x2bcccc){_0x30f90d=_0x2bcccc[_0xeab1('0x36')];if(!_0x27ac73[_0xeab1('0x30')][_0xeab1('0x4a')](_0xeab1('0x4b'))){_0x4093f5[_0xeab1('0x1b')]=qs[_0xeab1('0x1b')](_0x27ac73[_0xeab1('0x30')][_0xeab1('0x1b')]);_0x4093f5[_0xeab1('0x18')]=qs[_0xeab1('0x18')](_0x27ac73[_0xeab1('0x30')][_0xeab1('0x18')]);}return _0x4691c9[_0xeab1('0x48')](_0x4093f5);}})[_0xeab1('0x23')](function(_0x38bc49){if(_0x38bc49){return _0x38bc49?{'count':_0x30f90d,'rows':_0x38bc49}:null;}})[_0xeab1('0x23')](respondWithResult(_0x672a7c,null))[_0xeab1('0x42')](handleError(_0x672a7c,null));};exports[_0xeab1('0x4c')]=function(_0xb27a05,_0x2d2048,_0x1dec92){var _0x5eed0={};var _0x1dd4d3={};var _0x47b993;var _0x271bad;return db['VtigerConfiguration'][_0xeab1('0x49')]({'where':{'id':_0xb27a05[_0xeab1('0x44')]['id']}})[_0xeab1('0x23')](handleEntityNotFound(_0x2d2048,null))[_0xeab1('0x23')](function(_0x4f9207){if(_0x4f9207){_0x47b993=_0x4f9207;_0x1dd4d3[_0xeab1('0x2f')]=_[_0xeab1('0x31')](db[_0xeab1('0x4d')][_0xeab1('0x2b')]);_0x1dd4d3[_0xeab1('0x30')]=_[_0xeab1('0x31')](_0xb27a05[_0xeab1('0x30')]);_0x1dd4d3['filters']=_[_0xeab1('0x34')](_0x1dd4d3['model'],_0x1dd4d3[_0xeab1('0x30')]);_0x5eed0['attributes']=_['intersection'](_0x1dd4d3['model'],qs[_0xeab1('0x35')](_0xb27a05[_0xeab1('0x30')][_0xeab1('0x35')]));_0x5eed0[_0xeab1('0x33')]=_0x5eed0['attributes'][_0xeab1('0x36')]?_0x5eed0[_0xeab1('0x33')]:_0x1dd4d3[_0xeab1('0x2f')];_0x5eed0['order']=qs[_0xeab1('0x38')](_0xb27a05['query'][_0xeab1('0x38')]);_0x5eed0['where']=qs['filters'](_[_0xeab1('0x3a')](_0xb27a05[_0xeab1('0x30')],_0x1dd4d3['filters']));if(_0xb27a05[_0xeab1('0x30')][_0xeab1('0x3b')]){_0x5eed0[_0xeab1('0x39')]=_[_0xeab1('0x3c')](_0x5eed0['where'],{'$or':_[_0xeab1('0x29')](_0x5eed0['attributes'],function(_0x35dea5){var _0x3d2d62={};_0x3d2d62[_0x35dea5]={'$like':'%'+_0xb27a05['query']['filter']+'%'};return _0x3d2d62;})});}_0x5eed0=_[_0xeab1('0x3c')]({},_0x5eed0,_0xb27a05[_0xeab1('0x3e')]);return _0x47b993[_0xeab1('0x4c')](_0x5eed0);}})[_0xeab1('0x23')](function(_0x29cd12){if(_0x29cd12){_0x271bad=_0x29cd12[_0xeab1('0x36')];if(!_0xb27a05['query']['hasOwnProperty'](_0xeab1('0x4b'))){_0x5eed0['limit']=qs['limit'](_0xb27a05[_0xeab1('0x30')][_0xeab1('0x1b')]);_0x5eed0[_0xeab1('0x18')]=qs[_0xeab1('0x18')](_0xb27a05[_0xeab1('0x30')][_0xeab1('0x18')]);}return _0x47b993[_0xeab1('0x4c')](_0x5eed0);}})[_0xeab1('0x23')](function(_0x4a806e){if(_0x4a806e){return _0x4a806e?{'count':_0x271bad,'rows':_0x4a806e}:null;}})[_0xeab1('0x23')](respondWithResult(_0x2d2048,null))[_0xeab1('0x42')](handleError(_0x2d2048,null));};exports[_0xeab1('0x4e')]=function(_0x59cac6,_0xd79960,_0x1b8678){var _0xb6bebf={};var _0x5066fc={};var _0xca6fd7;var _0x7d96f4;return db[_0xeab1('0x2a')][_0xeab1('0x49')]({'where':{'id':_0x59cac6[_0xeab1('0x44')]['id']}})['then'](handleEntityNotFound(_0xd79960,null))[_0xeab1('0x23')](function(_0x4db595){if(_0x4db595){_0xca6fd7=_0x4db595;_0x5066fc[_0xeab1('0x2f')]=_[_0xeab1('0x31')](db[_0xeab1('0x4d')][_0xeab1('0x2b')]);_0x5066fc['query']=_['keys'](_0x59cac6['query']);_0x5066fc[_0xeab1('0x32')]=_[_0xeab1('0x34')](_0x5066fc['model'],_0x5066fc['query']);_0xb6bebf[_0xeab1('0x33')]=_[_0xeab1('0x34')](_0x5066fc[_0xeab1('0x2f')],qs[_0xeab1('0x35')](_0x59cac6[_0xeab1('0x30')][_0xeab1('0x35')]));_0xb6bebf[_0xeab1('0x33')]=_0xb6bebf[_0xeab1('0x33')]['length']?_0xb6bebf['attributes']:_0x5066fc[_0xeab1('0x2f')];_0xb6bebf['order']=qs[_0xeab1('0x38')](_0x59cac6['query'][_0xeab1('0x38')]);_0xb6bebf['where']=qs['filters'](_['pick'](_0x59cac6[_0xeab1('0x30')],_0x5066fc[_0xeab1('0x32')]));if(_0x59cac6['query'][_0xeab1('0x3b')]){_0xb6bebf[_0xeab1('0x39')]=_[_0xeab1('0x3c')](_0xb6bebf[_0xeab1('0x39')],{'$or':_[_0xeab1('0x29')](_0xb6bebf[_0xeab1('0x33')],function(_0xbab9e){var _0x314abd={};_0x314abd[_0xbab9e]={'$like':'%'+_0x59cac6['query'][_0xeab1('0x3b')]+'%'};return _0x314abd;})});}_0xb6bebf=_[_0xeab1('0x3c')]({},_0xb6bebf,_0x59cac6['options']);return _0xca6fd7[_0xeab1('0x4e')](_0xb6bebf);}})[_0xeab1('0x23')](function(_0xc1d1ce){if(_0xc1d1ce){_0x7d96f4=_0xc1d1ce['length'];if(!_0x59cac6[_0xeab1('0x30')]['hasOwnProperty']('nolimit')){_0xb6bebf[_0xeab1('0x1b')]=qs[_0xeab1('0x1b')](_0x59cac6[_0xeab1('0x30')]['limit']);_0xb6bebf['offset']=qs['offset'](_0x59cac6[_0xeab1('0x30')][_0xeab1('0x18')]);}return _0xca6fd7[_0xeab1('0x4e')](_0xb6bebf);}})[_0xeab1('0x23')](function(_0x2467af){if(_0x2467af){return _0x2467af?{'count':_0x7d96f4,'rows':_0x2467af}:null;}})[_0xeab1('0x23')](respondWithResult(_0xd79960,null))[_0xeab1('0x42')](handleError(_0xd79960,null));};
\ No newline at end of file
index d23189e..5ee8982 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeac5=['./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x470f9c,_0x1cfd6f){var _0x58db11=function(_0x1f1fde){while(--_0x1f1fde){_0x470f9c['push'](_0x470f9c['shift']());}};_0x58db11(++_0x1cfd6f);}(_0xeac5,0x100));var _0x5eac=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0xeac5[_0x4bd950];return _0x5dc59a;};'use strict';var _=require(_0x5eac('0x0'));var util=require(_0x5eac('0x1'));var logger=require(_0x5eac('0x2'))('api');var moment=require(_0x5eac('0x3'));var BPromise=require(_0x5eac('0x4'));var rp=require(_0x5eac('0x5'));var fs=require('fs');var path=require(_0x5eac('0x6'));var rimraf=require('rimraf');var config=require(_0x5eac('0x7'));var attributes=require(_0x5eac('0x8'));module[_0x5eac('0x9')]=function(_0x3fd7e1,_0x3d76f1){return _0x3fd7e1[_0x5eac('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x5eac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2f4e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x4510df,_0x51b8e0){var _0x43f7fe=function(_0x2d7125){while(--_0x2d7125){_0x4510df['push'](_0x4510df['shift']());}};_0x43f7fe(++_0x51b8e0);}(_0x2f4e,0x6a));var _0xe2f4=function(_0x2b4dec,_0x43a91f){_0x2b4dec=_0x2b4dec-0x0;var _0x1fc032=_0x2f4e[_0x2b4dec];return _0x1fc032;};'use strict';var _=require('lodash');var util=require(_0xe2f4('0x0'));var logger=require(_0xe2f4('0x1'))(_0xe2f4('0x2'));var moment=require(_0xe2f4('0x3'));var BPromise=require(_0xe2f4('0x4'));var rp=require(_0xe2f4('0x5'));var fs=require('fs');var path=require(_0xe2f4('0x6'));var rimraf=require(_0xe2f4('0x7'));var config=require(_0xe2f4('0x8'));var attributes=require(_0xe2f4('0x9'));module['exports']=function(_0x23b001,_0x1e45b7){return _0x23b001['define'](_0xe2f4('0xa'),attributes,{'tableName':_0xe2f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97d61b1..424af9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54d2=['jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5b0eef,_0x5deff1){var _0x36d3fd=function(_0x4a2ecd){while(--_0x4a2ecd){_0x5b0eef['push'](_0x5b0eef['shift']());}};_0x36d3fd(++_0x5deff1);}(_0x54d2,0x7c));var _0x254d=function(_0x2b9c1d,_0x11fdc5){_0x2b9c1d=_0x2b9c1d-0x0;var _0xecd312=_0x54d2[_0x2b9c1d];return _0xecd312;};'use strict';var _=require(_0x254d('0x0'));var util=require(_0x254d('0x1'));var moment=require('moment');var BPromise=require(_0x254d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x254d('0x3'));var db=require(_0x254d('0x4'))['db'];var utils=require(_0x254d('0x5'));var logger=require(_0x254d('0x6'))('rpc');var config=require(_0x254d('0x7'));var jayson=require(_0x254d('0x8'));var client=jayson['client'][_0x254d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5aaa62,_0x18c4ef,_0x412a8c){return new BPromise(function(_0x1689f8,_0x4b28d0){return client[_0x254d('0xa')](_0x5aaa62,_0x412a8c)[_0x254d('0xb')](function(_0x2e3489){logger[_0x254d('0xc')](_0x254d('0xd'),_0x18c4ef,_0x254d('0xe'));logger[_0x254d('0xf')](_0x254d('0x10'),_0x18c4ef,'request\x20sent',JSON[_0x254d('0x11')](_0x2e3489));if(_0x2e3489[_0x254d('0x12')]){if(_0x2e3489[_0x254d('0x12')]['code']===0x1f4){logger['error'](_0x254d('0xd'),_0x18c4ef,_0x2e3489['error'][_0x254d('0x13')]);return _0x4b28d0(_0x2e3489['error'][_0x254d('0x13')]);}logger['error'](_0x254d('0xd'),_0x18c4ef,_0x2e3489['error'][_0x254d('0x13')]);return _0x1689f8(_0x2e3489['error'][_0x254d('0x13')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x18c4ef,_0x254d('0xe'));_0x1689f8(_0x2e3489[_0x254d('0x14')]['message']);}})[_0x254d('0x15')](function(_0x5ed988){logger[_0x254d('0x12')](_0x254d('0xd'),_0x18c4ef,_0x5ed988);_0x4b28d0(_0x5ed988);});});}
\ No newline at end of file
+var _0x49de=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2bc4a9,_0x3df6cf){var _0x267bdd=function(_0x374541){while(--_0x374541){_0x2bc4a9['push'](_0x2bc4a9['shift']());}};_0x267bdd(++_0x3df6cf);}(_0x49de,0x80));var _0xe49d=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0x49de[_0x4370c7];return _0xce78a9;};'use strict';var _=require(_0xe49d('0x0'));var util=require(_0xe49d('0x1'));var moment=require(_0xe49d('0x2'));var BPromise=require(_0xe49d('0x3'));var rs=require(_0xe49d('0x4'));var fs=require('fs');var Redis=require(_0xe49d('0x5'));var db=require(_0xe49d('0x6'))['db'];var utils=require(_0xe49d('0x7'));var logger=require('../../config/logger')(_0xe49d('0x8'));var config=require(_0xe49d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe49d('0xa')][_0xe49d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fb727,_0x3ea577,_0x2e51d1){return new BPromise(function(_0x2f2042,_0x33e6b2){return client[_0xe49d('0xc')](_0x3fb727,_0x2e51d1)[_0xe49d('0xd')](function(_0x54d3b5){logger[_0xe49d('0xe')](_0xe49d('0xf'),_0x3ea577,_0xe49d('0x10'));logger[_0xe49d('0x11')](_0xe49d('0x12'),_0x3ea577,_0xe49d('0x10'),JSON[_0xe49d('0x13')](_0x54d3b5));if(_0x54d3b5[_0xe49d('0x14')]){if(_0x54d3b5[_0xe49d('0x14')][_0xe49d('0x15')]===0x1f4){logger[_0xe49d('0x14')](_0xe49d('0xf'),_0x3ea577,_0x54d3b5[_0xe49d('0x14')][_0xe49d('0x16')]);return _0x33e6b2(_0x54d3b5[_0xe49d('0x14')][_0xe49d('0x16')]);}logger[_0xe49d('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x3ea577,_0x54d3b5['error'][_0xe49d('0x16')]);return _0x2f2042(_0x54d3b5[_0xe49d('0x14')][_0xe49d('0x16')]);}else{logger['info'](_0xe49d('0xf'),_0x3ea577,_0xe49d('0x10'));_0x2f2042(_0x54d3b5[_0xe49d('0x17')][_0xe49d('0x16')]);}})[_0xe49d('0x18')](function(_0x458698){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x3ea577,_0x458698);_0x33e6b2(_0x458698);});});}
\ No newline at end of file
index 7050301..cea2e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eef=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eef,0x13c));var _0xf4ee=function(_0x5cd31d,_0x5e90e8){_0x5cd31d=_0x5cd31d-0x0;var _0x4d3387=_0x4eef[_0x5cd31d];return _0x4d3387;};'use strict';var multer=require(_0xf4ee('0x0'));var util=require(_0xf4ee('0x1'));var path=require(_0xf4ee('0x2'));var timeout=require(_0xf4ee('0x3'));var express=require(_0xf4ee('0x4'));var router=express[_0xf4ee('0x5')]();var fs_extra=require(_0xf4ee('0x6'));var auth=require(_0xf4ee('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf4ee('0x8'));var controller=require(_0xf4ee('0x9'));router[_0xf4ee('0xa')]('/',auth[_0xf4ee('0xb')](),controller[_0xf4ee('0xc')]);router[_0xf4ee('0xa')](_0xf4ee('0xd'),auth[_0xf4ee('0xb')](),controller[_0xf4ee('0xe')]);router['post']('/',auth[_0xf4ee('0xb')](),controller[_0xf4ee('0xf')]);router[_0xf4ee('0x10')](_0xf4ee('0xd'),auth[_0xf4ee('0xb')](),controller[_0xf4ee('0x11')]);router[_0xf4ee('0x12')](_0xf4ee('0xd'),auth[_0xf4ee('0xb')](),controller[_0xf4ee('0x13')]);module[_0xf4ee('0x14')]=router;
\ No newline at end of file
+var _0x0e59=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','create','put','isAuthenticated','update','delete','destroy','multer','path'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x0e59,0x174));var _0x90e5=function(_0x1da804,_0x5a416d){_0x1da804=_0x1da804-0x0;var _0x3adf6a=_0x0e59[_0x1da804];return _0x3adf6a;};'use strict';var multer=require(_0x90e5('0x0'));var util=require('util');var path=require(_0x90e5('0x1'));var timeout=require('connect-timeout');var express=require(_0x90e5('0x2'));var router=express[_0x90e5('0x3')]();var fs_extra=require(_0x90e5('0x4'));var auth=require(_0x90e5('0x5'));var interaction=require(_0x90e5('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x90e5('0x7')]('/',auth['isAuthenticated'](),controller[_0x90e5('0x8')]);router['get'](_0x90e5('0x9'),auth['isAuthenticated'](),controller[_0x90e5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x90e5('0xb')]);router[_0x90e5('0xc')](_0x90e5('0x9'),auth[_0x90e5('0xd')](),controller[_0x90e5('0xe')]);router[_0x90e5('0xf')]('/:id',auth[_0x90e5('0xd')](),controller[_0x90e5('0x10')]);module['exports']=router;
\ No newline at end of file
index 4a6323d..05d058d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22bc=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x2e4b89,_0x262929){var _0x8624f6=function(_0x4d3f45){while(--_0x4d3f45){_0x2e4b89['push'](_0x2e4b89['shift']());}};_0x8624f6(++_0x262929);}(_0x22bc,0x1c2));var _0xc22b=function(_0x141371,_0x138566){_0x141371=_0x141371-0x0;var _0x5df04f=_0x22bc[_0x141371];return _0x5df04f;};'use strict';var Sequelize=require(_0xc22b('0x0'));module[_0xc22b('0x1')]={'type':{'type':Sequelize[_0xc22b('0x2')](_0xc22b('0x3'),_0xc22b('0x4'),'customVariable',_0xc22b('0x5'),_0xc22b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc22b('0x7')]},'key':{'type':Sequelize[_0xc22b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc22b('0x3'),'variable',_0xc22b('0x8'))},'keyContent':{'type':Sequelize[_0xc22b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc22b('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc22b('0x7')]}};
\ No newline at end of file
+var _0x1f78=['exports','ENUM','variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize'];(function(_0x5930ae,_0x49f487){var _0x2c3069=function(_0x170a62){while(--_0x170a62){_0x5930ae['push'](_0x5930ae['shift']());}};_0x2c3069(++_0x49f487);}(_0x1f78,0x1dc));var _0x81f7=function(_0x2fbae3,_0x42cbf1){_0x2fbae3=_0x2fbae3-0x0;var _0xfab931=_0x1f78[_0x2fbae3];return _0xfab931;};'use strict';var Sequelize=require(_0x81f7('0x0'));module[_0x81f7('0x1')]={'type':{'type':Sequelize[_0x81f7('0x2')]('string',_0x81f7('0x3'),_0x81f7('0x4'),_0x81f7('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x81f7('0x6')]},'key':{'type':Sequelize[_0x81f7('0x6')]},'keyType':{'type':Sequelize[_0x81f7('0x2')](_0x81f7('0x7'),_0x81f7('0x3'),_0x81f7('0x4'))},'keyContent':{'type':Sequelize[_0x81f7('0x6')]},'idField':{'type':Sequelize[_0x81f7('0x6')]},'nameField':{'type':Sequelize[_0x81f7('0x6')]},'customField':{'type':Sequelize[_0x81f7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x81f7('0x6')]}};
\ No newline at end of file
index c881cba..001e603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82c4=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerField','then','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x483ba4,_0x43606a){var _0x4e2c41=function(_0x5e3219){while(--_0x5e3219){_0x483ba4['push'](_0x483ba4['shift']());}};_0x4e2c41(++_0x43606a);}(_0x82c4,0x8c));var _0x482c=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0x82c4[_0x11fb16];return _0x343de1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x482c('0x0'));var zipdir=require(_0x482c('0x1'));var jsonpatch=require(_0x482c('0x2'));var rp=require(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var Mustache=require(_0x482c('0x6'));var util=require(_0x482c('0x7'));var path=require(_0x482c('0x8'));var sox=require(_0x482c('0x9'));var csv=require(_0x482c('0xa'));var ejs=require(_0x482c('0xb'));var fs=require('fs');var fs_extra=require(_0x482c('0xc'));var _=require(_0x482c('0xd'));var squel=require('squel');var crypto=require(_0x482c('0xe'));var jsforce=require(_0x482c('0xf'));var deskjs=require(_0x482c('0x10'));var toCsv=require(_0x482c('0xa'));var querystring=require(_0x482c('0x11'));var Papa=require(_0x482c('0x12'));var Redis=require(_0x482c('0x13'));var authService=require(_0x482c('0x14'));var qs=require(_0x482c('0x15'));var as=require(_0x482c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x482c('0x17'))('api');var utils=require(_0x482c('0x18'));var config=require(_0x482c('0x19'));var licenseUtil=require(_0x482c('0x1a'));var db=require(_0x482c('0x1b'))['db'];function respondWithStatusCode(_0x1bc980,_0x4a437f){_0x4a437f=_0x4a437f||0xcc;return function(_0x595313){if(_0x595313){return _0x1bc980['sendStatus'](_0x4a437f);}return _0x1bc980[_0x482c('0x1c')](_0x4a437f)[_0x482c('0x1d')]();};}function respondWithResult(_0x48c6e6,_0x26c17b){_0x26c17b=_0x26c17b||0xc8;return function(_0x18a9d3){if(_0x18a9d3){return _0x48c6e6[_0x482c('0x1c')](_0x26c17b)[_0x482c('0x1e')](_0x18a9d3);}};}function respondWithFilteredResult(_0x26e638,_0x6aa333){return function(_0x27c351){if(_0x27c351){var _0x5e3844=typeof _0x6aa333[_0x482c('0x1f')]==='undefined'&&typeof _0x6aa333[_0x482c('0x20')]===_0x482c('0x21');var _0x5c90a4=_0x27c351[_0x482c('0x22')];var _0x1f662a=_0x5e3844?0x0:_0x6aa333[_0x482c('0x1f')];var _0xded28a=_0x5e3844?_0x27c351['count']:_0x6aa333['offset']+_0x6aa333[_0x482c('0x20')];var _0x544d84;if(_0xded28a>=_0x5c90a4){_0xded28a=_0x5c90a4;_0x544d84=0xc8;}else{_0x544d84=0xce;}_0x26e638[_0x482c('0x1c')](_0x544d84);return _0x26e638[_0x482c('0x23')](_0x482c('0x24'),_0x1f662a+'-'+_0xded28a+'/'+_0x5c90a4)[_0x482c('0x1e')](_0x27c351);}return null;};}function patchUpdates(_0x5e3a0f){return function(_0x153bf4){try{jsonpatch[_0x482c('0x25')](_0x153bf4,_0x5e3a0f,!![]);}catch(_0x32c990){return BPromise['reject'](_0x32c990);}return _0x153bf4[_0x482c('0x26')]();};}function saveUpdates(_0x432aa1,_0xd6fd52){return function(_0x5e6b58){if(_0x5e6b58){return _0x5e6b58[_0x482c('0x27')](_0x432aa1)['then'](function(_0x1b8ba7){return _0x1b8ba7;});}return null;};}function removeEntity(_0x3d949e,_0x5e439e){return function(_0x528848){if(_0x528848){return _0x528848['destroy']()['then'](function(){_0x3d949e[_0x482c('0x1c')](0xcc)[_0x482c('0x1d')]();});}};}function handleEntityNotFound(_0x387763,_0x4028c6){return function(_0x5110ec){if(!_0x5110ec){_0x387763[_0x482c('0x28')](0x194);}return _0x5110ec;};}function handleError(_0x59dd8c,_0x107385){_0x107385=_0x107385||0x1f4;return function(_0x18d939){logger['error'](_0x18d939[_0x482c('0x29')]);if(_0x18d939[_0x482c('0x2a')]){delete _0x18d939[_0x482c('0x2a')];}_0x59dd8c['status'](_0x107385)[_0x482c('0x2b')](_0x18d939);};}exports[_0x482c('0x2c')]=function(_0x104a58,_0x406d4a){var _0x2484be={},_0x227305={},_0x171e0a={'count':0x0,'rows':[]};var _0x4f474a=_[_0x482c('0x2d')](db['VtigerField'][_0x482c('0x2e')],function(_0x180a1e){return{'name':_0x180a1e[_0x482c('0x2f')],'type':_0x180a1e['type']['key']};});_0x227305[_0x482c('0x30')]=_[_0x482c('0x2d')](_0x4f474a,_0x482c('0x2a'));_0x227305[_0x482c('0x31')]=_['keys'](_0x104a58[_0x482c('0x31')]);_0x227305[_0x482c('0x32')]=_[_0x482c('0x33')](_0x227305[_0x482c('0x30')],_0x227305[_0x482c('0x31')]);_0x2484be[_0x482c('0x34')]=_[_0x482c('0x33')](_0x227305[_0x482c('0x30')],qs[_0x482c('0x35')](_0x104a58['query'][_0x482c('0x35')]));_0x2484be[_0x482c('0x34')]=_0x2484be[_0x482c('0x34')]['length']?_0x2484be[_0x482c('0x34')]:_0x227305[_0x482c('0x30')];if(!_0x104a58['query'][_0x482c('0x36')](_0x482c('0x37'))){_0x2484be[_0x482c('0x20')]=qs[_0x482c('0x20')](_0x104a58[_0x482c('0x31')][_0x482c('0x20')]);_0x2484be['offset']=qs[_0x482c('0x1f')](_0x104a58['query']['offset']);}_0x2484be[_0x482c('0x38')]=qs['sort'](_0x104a58['query'][_0x482c('0x39')]);_0x2484be[_0x482c('0x3a')]=qs['filters'](_[_0x482c('0x3b')](_0x104a58[_0x482c('0x31')],_0x227305['filters']),_0x4f474a);if(_0x104a58['query'][_0x482c('0x3c')]){_0x2484be[_0x482c('0x3a')]=_[_0x482c('0x3d')](_0x2484be[_0x482c('0x3a')],{'$or':_[_0x482c('0x2d')](_0x4f474a,function(_0x1b33ef){if(_0x1b33ef['type']!==_0x482c('0x3e')){var _0x54e5d1={};_0x54e5d1[_0x1b33ef['name']]={'$like':'%'+_0x104a58[_0x482c('0x31')][_0x482c('0x3c')]+'%'};return _0x54e5d1;}})});}_0x2484be=_[_0x482c('0x3d')]({},_0x2484be,_0x104a58[_0x482c('0x3f')]);var _0x128d31={'where':_0x2484be[_0x482c('0x3a')]};return db[_0x482c('0x40')]['count'](_0x128d31)[_0x482c('0x41')](function(_0x657746){_0x171e0a[_0x482c('0x22')]=_0x657746;if(_0x104a58['query'][_0x482c('0x42')]){_0x2484be['include']=[{'all':!![]}];}return db['VtigerField'][_0x482c('0x43')](_0x2484be);})[_0x482c('0x41')](function(_0x29158a){_0x171e0a[_0x482c('0x44')]=_0x29158a;return _0x171e0a;})[_0x482c('0x41')](respondWithFilteredResult(_0x406d4a,_0x2484be))[_0x482c('0x45')](handleError(_0x406d4a,null));};exports[_0x482c('0x46')]=function(_0x40ecf6,_0x5ed381){var _0x5d6173={'raw':!![],'where':{'id':_0x40ecf6[_0x482c('0x47')]['id']}},_0x2b9c1b={};_0x2b9c1b[_0x482c('0x30')]=_[_0x482c('0x48')](db[_0x482c('0x40')][_0x482c('0x2e')]);_0x2b9c1b[_0x482c('0x31')]=_[_0x482c('0x48')](_0x40ecf6[_0x482c('0x31')]);_0x2b9c1b['filters']=_['intersection'](_0x2b9c1b[_0x482c('0x30')],_0x2b9c1b[_0x482c('0x31')]);_0x5d6173[_0x482c('0x34')]=_[_0x482c('0x33')](_0x2b9c1b[_0x482c('0x30')],qs['fields'](_0x40ecf6[_0x482c('0x31')]['fields']));_0x5d6173[_0x482c('0x34')]=_0x5d6173['attributes']['length']?_0x5d6173[_0x482c('0x34')]:_0x2b9c1b[_0x482c('0x30')];if(_0x40ecf6['query']['includeAll']){_0x5d6173[_0x482c('0x49')]=[{'all':!![]}];}_0x5d6173=_[_0x482c('0x3d')]({},_0x5d6173,_0x40ecf6[_0x482c('0x3f')]);return db[_0x482c('0x40')][_0x482c('0x4a')](_0x5d6173)[_0x482c('0x41')](handleEntityNotFound(_0x5ed381,null))[_0x482c('0x41')](respondWithResult(_0x5ed381,null))[_0x482c('0x45')](handleError(_0x5ed381,null));};exports[_0x482c('0x4b')]=function(_0x56c994,_0x36123f){return db[_0x482c('0x40')][_0x482c('0x4b')](_0x56c994['body'],{})[_0x482c('0x41')](respondWithResult(_0x36123f,0xc9))['catch'](handleError(_0x36123f,null));};exports[_0x482c('0x27')]=function(_0x488ca9,_0x40e5a2){if(_0x488ca9[_0x482c('0x4c')]['id']){delete _0x488ca9[_0x482c('0x4c')]['id'];}return db[_0x482c('0x40')][_0x482c('0x4a')]({'where':{'id':_0x488ca9['params']['id']}})['then'](handleEntityNotFound(_0x40e5a2,null))[_0x482c('0x41')](saveUpdates(_0x488ca9['body'],null))[_0x482c('0x41')](respondWithResult(_0x40e5a2,null))['catch'](handleError(_0x40e5a2,null));};exports[_0x482c('0x4d')]=function(_0x56c1f5,_0x3948ca){return db[_0x482c('0x40')][_0x482c('0x4a')]({'where':{'id':_0x56c1f5['params']['id']}})[_0x482c('0x41')](handleEntityNotFound(_0x3948ca,null))['then'](removeEntity(_0x3948ca,null))[_0x482c('0x45')](handleError(_0x3948ca,null));};
\ No newline at end of file
+var _0xa5aa=['VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0xf3e31a,_0x3b9ea3){var _0x18333a=function(_0x33d86f){while(--_0x33d86f){_0xf3e31a['push'](_0xf3e31a['shift']());}};_0x18333a(++_0x3b9ea3);}(_0xa5aa,0xfd));var _0xaa5a=function(_0x5c28a1,_0x459ed3){_0x5c28a1=_0x5c28a1-0x0;var _0x25728b=_0xa5aa[_0x5c28a1];return _0x25728b;};'use strict';var emlformat=require(_0xaa5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa5a('0x1'));var jsonpatch=require(_0xaa5a('0x2'));var rp=require(_0xaa5a('0x3'));var moment=require(_0xaa5a('0x4'));var BPromise=require(_0xaa5a('0x5'));var Mustache=require(_0xaa5a('0x6'));var util=require(_0xaa5a('0x7'));var path=require('path');var sox=require(_0xaa5a('0x8'));var csv=require(_0xaa5a('0x9'));var ejs=require(_0xaa5a('0xa'));var fs=require('fs');var fs_extra=require(_0xaa5a('0xb'));var _=require(_0xaa5a('0xc'));var squel=require(_0xaa5a('0xd'));var crypto=require(_0xaa5a('0xe'));var jsforce=require(_0xaa5a('0xf'));var deskjs=require(_0xaa5a('0x10'));var toCsv=require(_0xaa5a('0x9'));var querystring=require(_0xaa5a('0x11'));var Papa=require(_0xaa5a('0x12'));var Redis=require(_0xaa5a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xaa5a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa5a('0x15'));var logger=require(_0xaa5a('0x16'))(_0xaa5a('0x17'));var utils=require('../../config/utils');var config=require(_0xaa5a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa5a('0x19'))['db'];function respondWithStatusCode(_0x44c826,_0x447a1c){_0x447a1c=_0x447a1c||0xcc;return function(_0x26f173){if(_0x26f173){return _0x44c826[_0xaa5a('0x1a')](_0x447a1c);}return _0x44c826['status'](_0x447a1c)[_0xaa5a('0x1b')]();};}function respondWithResult(_0x41684f,_0x3207ba){_0x3207ba=_0x3207ba||0xc8;return function(_0x13873e){if(_0x13873e){return _0x41684f[_0xaa5a('0x1c')](_0x3207ba)[_0xaa5a('0x1d')](_0x13873e);}};}function respondWithFilteredResult(_0x2f6707,_0x354e95){return function(_0x1fe0c1){if(_0x1fe0c1){var _0x35785c=typeof _0x354e95[_0xaa5a('0x1e')]===_0xaa5a('0x1f')&&typeof _0x354e95[_0xaa5a('0x20')]===_0xaa5a('0x1f');var _0x4adf8c=_0x1fe0c1[_0xaa5a('0x21')];var _0x44eda2=_0x35785c?0x0:_0x354e95[_0xaa5a('0x1e')];var _0x33ea08=_0x35785c?_0x1fe0c1[_0xaa5a('0x21')]:_0x354e95[_0xaa5a('0x1e')]+_0x354e95[_0xaa5a('0x20')];var _0x3d5e05;if(_0x33ea08>=_0x4adf8c){_0x33ea08=_0x4adf8c;_0x3d5e05=0xc8;}else{_0x3d5e05=0xce;}_0x2f6707[_0xaa5a('0x1c')](_0x3d5e05);return _0x2f6707[_0xaa5a('0x22')](_0xaa5a('0x23'),_0x44eda2+'-'+_0x33ea08+'/'+_0x4adf8c)['json'](_0x1fe0c1);}return null;};}function patchUpdates(_0x5c034d){return function(_0x3fa121){try{jsonpatch[_0xaa5a('0x24')](_0x3fa121,_0x5c034d,!![]);}catch(_0x5f4906){return BPromise[_0xaa5a('0x25')](_0x5f4906);}return _0x3fa121[_0xaa5a('0x26')]();};}function saveUpdates(_0x9993da,_0x3245f9){return function(_0x501ad9){if(_0x501ad9){return _0x501ad9[_0xaa5a('0x27')](_0x9993da)[_0xaa5a('0x28')](function(_0x21a5cf){return _0x21a5cf;});}return null;};}function removeEntity(_0x38fc85,_0x48fbc8){return function(_0x1ccc7a){if(_0x1ccc7a){return _0x1ccc7a[_0xaa5a('0x29')]()[_0xaa5a('0x28')](function(){_0x38fc85[_0xaa5a('0x1c')](0xcc)[_0xaa5a('0x1b')]();});}};}function handleEntityNotFound(_0x357be6,_0x32d608){return function(_0xa60fb){if(!_0xa60fb){_0x357be6['sendStatus'](0x194);}return _0xa60fb;};}function handleError(_0x4f83b7,_0x384558){_0x384558=_0x384558||0x1f4;return function(_0x56389f){logger[_0xaa5a('0x2a')](_0x56389f[_0xaa5a('0x2b')]);if(_0x56389f[_0xaa5a('0x2c')]){delete _0x56389f['name'];}_0x4f83b7[_0xaa5a('0x1c')](_0x384558)[_0xaa5a('0x2d')](_0x56389f);};}exports[_0xaa5a('0x2e')]=function(_0x432221,_0x46390e){var _0x3a281a={},_0x1baa37={},_0x12d837={'count':0x0,'rows':[]};var _0x44a0d2=_[_0xaa5a('0x2f')](db[_0xaa5a('0x30')]['rawAttributes'],function(_0x288937){return{'name':_0x288937[_0xaa5a('0x31')],'type':_0x288937[_0xaa5a('0x32')][_0xaa5a('0x33')]};});_0x1baa37[_0xaa5a('0x34')]=_[_0xaa5a('0x2f')](_0x44a0d2,_0xaa5a('0x2c'));_0x1baa37[_0xaa5a('0x35')]=_[_0xaa5a('0x36')](_0x432221[_0xaa5a('0x35')]);_0x1baa37[_0xaa5a('0x37')]=_[_0xaa5a('0x38')](_0x1baa37['model'],_0x1baa37[_0xaa5a('0x35')]);_0x3a281a[_0xaa5a('0x39')]=_[_0xaa5a('0x38')](_0x1baa37['model'],qs[_0xaa5a('0x3a')](_0x432221['query'][_0xaa5a('0x3a')]));_0x3a281a[_0xaa5a('0x39')]=_0x3a281a[_0xaa5a('0x39')]['length']?_0x3a281a['attributes']:_0x1baa37['model'];if(!_0x432221['query'][_0xaa5a('0x3b')](_0xaa5a('0x3c'))){_0x3a281a[_0xaa5a('0x20')]=qs['limit'](_0x432221[_0xaa5a('0x35')]['limit']);_0x3a281a[_0xaa5a('0x1e')]=qs[_0xaa5a('0x1e')](_0x432221[_0xaa5a('0x35')][_0xaa5a('0x1e')]);}_0x3a281a[_0xaa5a('0x3d')]=qs[_0xaa5a('0x3e')](_0x432221[_0xaa5a('0x35')][_0xaa5a('0x3e')]);_0x3a281a[_0xaa5a('0x3f')]=qs[_0xaa5a('0x37')](_[_0xaa5a('0x40')](_0x432221[_0xaa5a('0x35')],_0x1baa37['filters']),_0x44a0d2);if(_0x432221[_0xaa5a('0x35')][_0xaa5a('0x41')]){_0x3a281a[_0xaa5a('0x3f')]=_[_0xaa5a('0x42')](_0x3a281a[_0xaa5a('0x3f')],{'$or':_[_0xaa5a('0x2f')](_0x44a0d2,function(_0x2ab89b){if(_0x2ab89b[_0xaa5a('0x32')]!==_0xaa5a('0x43')){var _0x229f76={};_0x229f76[_0x2ab89b['name']]={'$like':'%'+_0x432221[_0xaa5a('0x35')][_0xaa5a('0x41')]+'%'};return _0x229f76;}})});}_0x3a281a=_[_0xaa5a('0x42')]({},_0x3a281a,_0x432221[_0xaa5a('0x44')]);var _0x4627b6={'where':_0x3a281a[_0xaa5a('0x3f')]};return db[_0xaa5a('0x30')][_0xaa5a('0x21')](_0x4627b6)[_0xaa5a('0x28')](function(_0x9354b8){_0x12d837[_0xaa5a('0x21')]=_0x9354b8;if(_0x432221[_0xaa5a('0x35')][_0xaa5a('0x45')]){_0x3a281a['include']=[{'all':!![]}];}return db[_0xaa5a('0x30')][_0xaa5a('0x46')](_0x3a281a);})[_0xaa5a('0x28')](function(_0x451319){_0x12d837[_0xaa5a('0x47')]=_0x451319;return _0x12d837;})[_0xaa5a('0x28')](respondWithFilteredResult(_0x46390e,_0x3a281a))[_0xaa5a('0x48')](handleError(_0x46390e,null));};exports[_0xaa5a('0x49')]=function(_0x26c23c,_0x4c98c8){var _0xc879b3={'raw':!![],'where':{'id':_0x26c23c['params']['id']}},_0x14186b={};_0x14186b[_0xaa5a('0x34')]=_[_0xaa5a('0x36')](db['VtigerField'][_0xaa5a('0x4a')]);_0x14186b['query']=_[_0xaa5a('0x36')](_0x26c23c[_0xaa5a('0x35')]);_0x14186b['filters']=_[_0xaa5a('0x38')](_0x14186b['model'],_0x14186b[_0xaa5a('0x35')]);_0xc879b3[_0xaa5a('0x39')]=_[_0xaa5a('0x38')](_0x14186b[_0xaa5a('0x34')],qs[_0xaa5a('0x3a')](_0x26c23c[_0xaa5a('0x35')][_0xaa5a('0x3a')]));_0xc879b3[_0xaa5a('0x39')]=_0xc879b3['attributes']['length']?_0xc879b3['attributes']:_0x14186b[_0xaa5a('0x34')];if(_0x26c23c[_0xaa5a('0x35')][_0xaa5a('0x45')]){_0xc879b3[_0xaa5a('0x4b')]=[{'all':!![]}];}_0xc879b3=_[_0xaa5a('0x42')]({},_0xc879b3,_0x26c23c[_0xaa5a('0x44')]);return db[_0xaa5a('0x30')][_0xaa5a('0x4c')](_0xc879b3)['then'](handleEntityNotFound(_0x4c98c8,null))[_0xaa5a('0x28')](respondWithResult(_0x4c98c8,null))[_0xaa5a('0x48')](handleError(_0x4c98c8,null));};exports[_0xaa5a('0x4d')]=function(_0x446e65,_0x39ad43){return db['VtigerField'][_0xaa5a('0x4d')](_0x446e65['body'],{})['then'](respondWithResult(_0x39ad43,0xc9))[_0xaa5a('0x48')](handleError(_0x39ad43,null));};exports[_0xaa5a('0x27')]=function(_0x40435d,_0x5a0998){if(_0x40435d[_0xaa5a('0x4e')]['id']){delete _0x40435d[_0xaa5a('0x4e')]['id'];}return db['VtigerField'][_0xaa5a('0x4c')]({'where':{'id':_0x40435d[_0xaa5a('0x4f')]['id']}})[_0xaa5a('0x28')](handleEntityNotFound(_0x5a0998,null))['then'](saveUpdates(_0x40435d[_0xaa5a('0x4e')],null))[_0xaa5a('0x28')](respondWithResult(_0x5a0998,null))['catch'](handleError(_0x5a0998,null));};exports[_0xaa5a('0x29')]=function(_0xcd558d,_0x26e22a){return db['VtigerField']['find']({'where':{'id':_0xcd558d['params']['id']}})['then'](handleEntityNotFound(_0x26e22a,null))[_0xaa5a('0x28')](removeEntity(_0x26e22a,null))[_0xaa5a('0x48')](handleError(_0x26e22a,null));};
\ No newline at end of file
index efe3340..3d70f5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11d4=['int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','api','moment','path','rimraf','../../config/environment','exports','define','VtigerField'];(function(_0x140931,_0x2ffeba){var _0x4718ab=function(_0x1f08f7){while(--_0x1f08f7){_0x140931['push'](_0x140931['shift']());}};_0x4718ab(++_0x2ffeba);}(_0x11d4,0x1b6));var _0x411d=function(_0x231c97,_0xc9b3e2){_0x231c97=_0x231c97-0x0;var _0x42c0f7=_0x11d4[_0x231c97];return _0x42c0f7;};'use strict';var _=require(_0x411d('0x0'));var util=require(_0x411d('0x1'));var logger=require('../../config/logger')(_0x411d('0x2'));var moment=require(_0x411d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x411d('0x4'));var rimraf=require(_0x411d('0x5'));var config=require(_0x411d('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x411d('0x7')]=function(_0x185043,_0x9b385e){return _0x185043[_0x411d('0x8')](_0x411d('0x9'),attributes,{'tableName':_0x411d('0xa'),'paranoid':![],'indexes':[{'name':_0x411d('0xb'),'fields':[_0x411d('0xc'),_0x411d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ab4=['path','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2ab4,0x1d9));var _0x42ab=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x2ab4[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x42ab('0x0'));var util=require(_0x42ab('0x1'));var logger=require(_0x42ab('0x2'))(_0x42ab('0x3'));var moment=require(_0x42ab('0x4'));var BPromise=require(_0x42ab('0x5'));var rp=require(_0x42ab('0x6'));var fs=require('fs');var path=require(_0x42ab('0x7'));var rimraf=require('rimraf');var config=require(_0x42ab('0x8'));var attributes=require(_0x42ab('0x9'));module[_0x42ab('0xa')]=function(_0x105698,_0x20597b){return _0x105698[_0x42ab('0xb')](_0x42ab('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x42ab('0xd'),'fields':['idField',_0x42ab('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a9a90b7..7da1a8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0028=['http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x40bad6,_0x1a5dc8){var _0xdfd3f2=function(_0x20f7ee){while(--_0x20f7ee){_0x40bad6['push'](_0x40bad6['shift']());}};_0xdfd3f2(++_0x1a5dc8);}(_0x0028,0x15b));var _0x8002=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x0028[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require('lodash');var util=require(_0x8002('0x0'));var moment=require('moment');var BPromise=require(_0x8002('0x1'));var rs=require(_0x8002('0x2'));var fs=require('fs');var Redis=require(_0x8002('0x3'));var db=require(_0x8002('0x4'))['db'];var utils=require(_0x8002('0x5'));var logger=require(_0x8002('0x6'))(_0x8002('0x7'));var config=require(_0x8002('0x8'));var jayson=require(_0x8002('0x9'));var client=jayson['client'][_0x8002('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c9228,_0x191ab1,_0x3f7656){return new BPromise(function(_0xe786c1,_0x20f5f6){return client['request'](_0x5c9228,_0x3f7656)[_0x8002('0xb')](function(_0x529877){logger[_0x8002('0xc')](_0x8002('0xd'),_0x191ab1,_0x8002('0xe'));logger[_0x8002('0xf')](_0x8002('0x10'),_0x191ab1,_0x8002('0xe'),JSON['stringify'](_0x529877));if(_0x529877[_0x8002('0x11')]){if(_0x529877[_0x8002('0x11')][_0x8002('0x12')]===0x1f4){logger[_0x8002('0x11')](_0x8002('0xd'),_0x191ab1,_0x529877['error']['message']);return _0x20f5f6(_0x529877[_0x8002('0x11')][_0x8002('0x13')]);}logger['error'](_0x8002('0xd'),_0x191ab1,_0x529877[_0x8002('0x11')][_0x8002('0x13')]);return _0xe786c1(_0x529877[_0x8002('0x11')][_0x8002('0x13')]);}else{logger[_0x8002('0xc')](_0x8002('0xd'),_0x191ab1,_0x8002('0xe'));_0xe786c1(_0x529877['result'][_0x8002('0x13')]);}})[_0x8002('0x14')](function(_0x48a89f){logger[_0x8002('0x11')](_0x8002('0xd'),_0x191ab1,_0x48a89f);_0x20f5f6(_0x48a89f);});});}
\ No newline at end of file
+var _0xbb85=['stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58387b,_0x1dd5f3){var _0x55d1ff=function(_0x5cf190){while(--_0x5cf190){_0x58387b['push'](_0x58387b['shift']());}};_0x55d1ff(++_0x1dd5f3);}(_0xbb85,0xa4));var _0x5bb8=function(_0x4acd19,_0xd77916){_0x4acd19=_0x4acd19-0x0;var _0x2c2c55=_0xbb85[_0x4acd19];return _0x2c2c55;};'use strict';var _=require('lodash');var util=require(_0x5bb8('0x0'));var moment=require('moment');var BPromise=require(_0x5bb8('0x1'));var rs=require(_0x5bb8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bb8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bb8('0x4'))(_0x5bb8('0x5'));var config=require('../../config/environment');var jayson=require(_0x5bb8('0x6'));var client=jayson[_0x5bb8('0x7')][_0x5bb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x447628,_0x2d7de6,_0x221e22){return new BPromise(function(_0x2d1a29,_0x316b11){return client['request'](_0x447628,_0x221e22)['then'](function(_0x4fc5e5){logger['info'](_0x5bb8('0x9'),_0x2d7de6,'request\x20sent');logger['debug'](_0x5bb8('0xa'),_0x2d7de6,_0x5bb8('0xb'),JSON[_0x5bb8('0xc')](_0x4fc5e5));if(_0x4fc5e5[_0x5bb8('0xd')]){if(_0x4fc5e5[_0x5bb8('0xd')]['code']===0x1f4){logger[_0x5bb8('0xd')](_0x5bb8('0x9'),_0x2d7de6,_0x4fc5e5[_0x5bb8('0xd')]['message']);return _0x316b11(_0x4fc5e5[_0x5bb8('0xd')][_0x5bb8('0xe')]);}logger[_0x5bb8('0xd')](_0x5bb8('0x9'),_0x2d7de6,_0x4fc5e5['error']['message']);return _0x2d1a29(_0x4fc5e5['error'][_0x5bb8('0xe')]);}else{logger['info'](_0x5bb8('0x9'),_0x2d7de6,_0x5bb8('0xb'));_0x2d1a29(_0x4fc5e5['result'][_0x5bb8('0xe')]);}})[_0x5bb8('0xf')](function(_0x45dd3b){logger[_0x5bb8('0xd')](_0x5bb8('0x9'),_0x2d7de6,_0x45dd3b);_0x316b11(_0x45dd3b);});});}
\ No newline at end of file
index 450428f..4d889ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa633=['getFields','create','post','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','/:id/fields'];(function(_0x373495,_0x3e46a3){var _0x671b65=function(_0x25611b){while(--_0x25611b){_0x373495['push'](_0x373495['shift']());}};_0x671b65(++_0x3e46a3);}(_0xa633,0x128));var _0x3a63=function(_0x3e07e8,_0x14762a){_0x3e07e8=_0x3e07e8-0x0;var _0x3eaa77=_0xa633[_0x3e07e8];return _0x3eaa77;};'use strict';var multer=require(_0x3a63('0x0'));var util=require(_0x3a63('0x1'));var path=require(_0x3a63('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a63('0x3'));var router=express[_0x3a63('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a63('0x5'));var interaction=require(_0x3a63('0x6'));var config=require(_0x3a63('0x7'));var controller=require(_0x3a63('0x8'));router['get']('/',auth[_0x3a63('0x9')](),controller[_0x3a63('0xa')]);router['get'](_0x3a63('0xb'),auth['isAuthenticated'](),controller[_0x3a63('0xc')]);router[_0x3a63('0xd')](_0x3a63('0xe'),auth[_0x3a63('0x9')](),controller['getConfigurations']);router[_0x3a63('0xd')](_0x3a63('0xf'),auth[_0x3a63('0x9')](),controller[_0x3a63('0x10')]);router['post']('/',auth[_0x3a63('0x9')](),controller[_0x3a63('0x11')]);router[_0x3a63('0x12')](_0x3a63('0xe'),auth[_0x3a63('0x9')](),controller[_0x3a63('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3a63('0x14')]);router[_0x3a63('0x15')](_0x3a63('0xb'),auth['isAuthenticated'](),controller[_0x3a63('0x16')]);module[_0x3a63('0x17')]=router;
\ No newline at end of file
+var _0xbe29=['post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x5d692e,_0x17cc29){var _0x1ce595=function(_0x53f184){while(--_0x53f184){_0x5d692e['push'](_0x5d692e['shift']());}};_0x1ce595(++_0x17cc29);}(_0xbe29,0x133));var _0x9be2=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xbe29[_0x4c260a];return _0x17bbdd;};'use strict';var multer=require(_0x9be2('0x0'));var util=require(_0x9be2('0x1'));var path=require(_0x9be2('0x2'));var timeout=require(_0x9be2('0x3'));var express=require(_0x9be2('0x4'));var router=express[_0x9be2('0x5')]();var fs_extra=require(_0x9be2('0x6'));var auth=require(_0x9be2('0x7'));var interaction=require(_0x9be2('0x8'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x9be2('0x9')](),controller[_0x9be2('0xa')]);router[_0x9be2('0xb')](_0x9be2('0xc'),auth[_0x9be2('0x9')](),controller[_0x9be2('0xd')]);router[_0x9be2('0xb')](_0x9be2('0xe'),auth[_0x9be2('0x9')](),controller[_0x9be2('0xf')]);router[_0x9be2('0xb')](_0x9be2('0x10'),auth[_0x9be2('0x9')](),controller[_0x9be2('0x11')]);router[_0x9be2('0x12')]('/',auth[_0x9be2('0x9')](),controller[_0x9be2('0x13')]);router[_0x9be2('0x12')](_0x9be2('0xe'),auth[_0x9be2('0x9')](),controller[_0x9be2('0x14')]);router['put'](_0x9be2('0xc'),auth[_0x9be2('0x9')](),controller[_0x9be2('0x15')]);router[_0x9be2('0x16')](_0x9be2('0xc'),auth['isAuthenticated'](),controller[_0x9be2('0x17')]);module[_0x9be2('0x18')]=router;
\ No newline at end of file
index 87a2dd9..324ff37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7db=['integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM','token','password'];(function(_0xc864d,_0x3443f2){var _0x4a1305=function(_0x162dd6){while(--_0x162dd6){_0xc864d['push'](_0xc864d['shift']());}};_0x4a1305(++_0x3443f2);}(_0xa7db,0xbf));var _0xba7d=function(_0x25588d,_0x201ba7){_0x25588d=_0x25588d-0x0;var _0xb687d2=_0xa7db[_0x25588d];return _0xb687d2;};'use strict';var Sequelize=require(_0xba7d('0x0'));module[_0xba7d('0x1')]={'name':{'type':Sequelize[_0xba7d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xba7d('0x2')]},'token':{'type':Sequelize[_0xba7d('0x2')]},'remoteUri':{'type':Sequelize[_0xba7d('0x2')],'unique':_0xba7d('0x3')},'authType':{'type':Sequelize[_0xba7d('0x4')]('password',_0xba7d('0x5')),'defaultValue':_0xba7d('0x6')},'serverUrl':{'type':Sequelize[_0xba7d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xba7d('0x4')](_0xba7d('0x7'),_0xba7d('0x8')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x8cad=['password','token','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0x8cad,0xfe));var _0xd8ca=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8cad[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0xd8ca('0x0'));module[_0xd8ca('0x1')]={'name':{'type':Sequelize[_0xd8ca('0x2')]},'description':{'type':Sequelize[_0xd8ca('0x2')]},'username':{'type':Sequelize[_0xd8ca('0x2')],'unique':_0xd8ca('0x3')},'password':{'type':Sequelize[_0xd8ca('0x2')]},'token':{'type':Sequelize[_0xd8ca('0x2')]},'remoteUri':{'type':Sequelize[_0xd8ca('0x2')],'unique':_0xd8ca('0x4')},'authType':{'type':Sequelize[_0xd8ca('0x5')](_0xd8ca('0x6'),_0xd8ca('0x7')),'defaultValue':_0xd8ca('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd8ca('0x5')](_0xd8ca('0x8'),_0xd8ca('0x9')),'defaultValue':_0xd8ca('0x8')}};
\ No newline at end of file
index 33d8b0e..87eaba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','ZendeskConfiguration','pick','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','%s:%s','toString','headers','%s/token:%s','base64','Sequelize','ValidationError','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include'];(function(_0x4f1f71,_0xf14f1b){var _0xe514d7=function(_0xfd76e7){while(--_0xfd76e7){_0x4f1f71['push'](_0x4f1f71['shift']());}};_0xe514d7(++_0xf14f1b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0baf('0x1b'));function respondWithStatusCode(_0xe4378c,_0x5db689){_0x5db689=_0x5db689||0xcc;return function(_0x13df17){if(_0x13df17){return _0xe4378c['sendStatus'](_0x5db689);}return _0xe4378c[_0x0baf('0x1c')](_0x5db689)['end']();};}function respondWithResult(_0x1c76a8,_0x1f50c3){_0x1f50c3=_0x1f50c3||0xc8;return function(_0x7fbf67){if(_0x7fbf67){return _0x1c76a8[_0x0baf('0x1c')](_0x1f50c3)[_0x0baf('0x1d')](_0x7fbf67);}};}function respondWithFilteredResult(_0x469599,_0x4f80a8){return function(_0x4cd79d){if(_0x4cd79d){var _0x2312c7=typeof _0x4f80a8[_0x0baf('0x1e')]===_0x0baf('0x1f')&&typeof _0x4f80a8[_0x0baf('0x20')]===_0x0baf('0x1f');var _0x288a98=_0x4cd79d['count'];var _0x63c820=_0x2312c7?0x0:_0x4f80a8[_0x0baf('0x1e')];var _0x1ef0e5=_0x2312c7?_0x4cd79d[_0x0baf('0x21')]:_0x4f80a8[_0x0baf('0x1e')]+_0x4f80a8[_0x0baf('0x20')];var _0x4ff793;if(_0x1ef0e5>=_0x288a98){_0x1ef0e5=_0x288a98;_0x4ff793=0xc8;}else{_0x4ff793=0xce;}_0x469599['status'](_0x4ff793);return _0x469599[_0x0baf('0x22')](_0x0baf('0x23'),_0x63c820+'-'+_0x1ef0e5+'/'+_0x288a98)[_0x0baf('0x1d')](_0x4cd79d);}return null;};}function patchUpdates(_0x1848e8){return function(_0x1fa92b){try{jsonpatch[_0x0baf('0x24')](_0x1fa92b,_0x1848e8,!![]);}catch(_0x210cd8){return BPromise[_0x0baf('0x25')](_0x210cd8);}return _0x1fa92b[_0x0baf('0x26')]();};}function saveUpdates(_0x15a2c3,_0x54f2fa){return function(_0x334bd6){if(_0x334bd6){return _0x334bd6['update'](_0x15a2c3)[_0x0baf('0x27')](function(_0x5dbf00){return _0x5dbf00;});}return null;};}function removeEntity(_0x4de74c,_0x2ef0aa){return function(_0x48a0e9){if(_0x48a0e9){return _0x48a0e9['destroy']()[_0x0baf('0x27')](function(){_0x4de74c[_0x0baf('0x1c')](0xcc)[_0x0baf('0x28')]();});}};}function handleEntityNotFound(_0x19d9fd,_0x3a1ba1){return function(_0x56b299){if(!_0x56b299){_0x19d9fd[_0x0baf('0x29')](0x194);}return _0x56b299;};}function handleError(_0x4681c5,_0x1ca35a){_0x1ca35a=_0x1ca35a||0x1f4;return function(_0x366e71){logger[_0x0baf('0x2a')](_0x366e71[_0x0baf('0x2b')]);if(_0x366e71[_0x0baf('0x2c')]){delete _0x366e71['name'];}_0x4681c5[_0x0baf('0x1c')](_0x1ca35a)[_0x0baf('0x2d')](_0x366e71);};}exports[_0x0baf('0x2e')]=function(_0x265915,_0x55c715){var _0x29dbdf={},_0x34a58a={},_0x5d9d7f={'count':0x0,'rows':[]};var _0x44ec31=_[_0x0baf('0x2f')](db[_0x0baf('0x30')][_0x0baf('0x31')],function(_0xd14f0f){return{'name':_0xd14f0f[_0x0baf('0x32')],'type':_0xd14f0f[_0x0baf('0x33')]['key']};});_0x34a58a[_0x0baf('0x34')]=_[_0x0baf('0x2f')](_0x44ec31,_0x0baf('0x2c'));_0x34a58a[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x265915[_0x0baf('0x35')]);_0x34a58a[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x34a58a[_0x0baf('0x34')],_0x34a58a[_0x0baf('0x35')]);_0x29dbdf[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x34a58a[_0x0baf('0x34')],qs[_0x0baf('0x3a')](_0x265915['query'][_0x0baf('0x3a')]));_0x29dbdf['attributes']=_0x29dbdf[_0x0baf('0x39')][_0x0baf('0x3b')]?_0x29dbdf[_0x0baf('0x39')]:_0x34a58a[_0x0baf('0x34')];if(!_0x265915['query'][_0x0baf('0x3c')](_0x0baf('0x3d'))){_0x29dbdf['limit']=qs[_0x0baf('0x20')](_0x265915[_0x0baf('0x35')][_0x0baf('0x20')]);_0x29dbdf[_0x0baf('0x1e')]=qs[_0x0baf('0x1e')](_0x265915[_0x0baf('0x35')][_0x0baf('0x1e')]);}_0x29dbdf[_0x0baf('0x3e')]=qs['sort'](_0x265915[_0x0baf('0x35')][_0x0baf('0x3f')]);_0x29dbdf['where']=qs[_0x0baf('0x37')](_['pick'](_0x265915['query'],_0x34a58a[_0x0baf('0x37')]),_0x44ec31);if(_0x265915[_0x0baf('0x35')]['filter']){_0x29dbdf['where']=_[_0x0baf('0x40')](_0x29dbdf[_0x0baf('0x41')],{'$or':_[_0x0baf('0x2f')](_0x44ec31,function(_0xb2d9ab){if(_0xb2d9ab[_0x0baf('0x33')]!==_0x0baf('0x42')){var _0x290464={};_0x290464[_0xb2d9ab[_0x0baf('0x2c')]]={'$like':'%'+_0x265915[_0x0baf('0x35')][_0x0baf('0x43')]+'%'};return _0x290464;}})});}_0x29dbdf=_[_0x0baf('0x40')]({},_0x29dbdf,_0x265915[_0x0baf('0x44')]);var _0x354cb1={'where':_0x29dbdf[_0x0baf('0x41')]};return db['ZendeskAccount'][_0x0baf('0x21')](_0x354cb1)[_0x0baf('0x27')](function(_0x4f1de9){_0x5d9d7f[_0x0baf('0x21')]=_0x4f1de9;if(_0x265915[_0x0baf('0x35')][_0x0baf('0x45')]){_0x29dbdf[_0x0baf('0x46')]=[{'all':!![]}];}return db[_0x0baf('0x30')][_0x0baf('0x47')](_0x29dbdf);})['then'](function(_0x23ad34){_0x5d9d7f[_0x0baf('0x48')]=_0x23ad34;return _0x5d9d7f;})['then'](respondWithFilteredResult(_0x55c715,_0x29dbdf))[_0x0baf('0x49')](handleError(_0x55c715,null));};exports[_0x0baf('0x4a')]=function(_0x45c6aa,_0x57903e){var _0x504031={'raw':![],'where':{'id':_0x45c6aa[_0x0baf('0x4b')]['id']}},_0x193fd3={};_0x193fd3[_0x0baf('0x34')]=_[_0x0baf('0x36')](db[_0x0baf('0x30')][_0x0baf('0x31')]);_0x193fd3[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x45c6aa[_0x0baf('0x35')]);_0x193fd3[_0x0baf('0x37')]=_['intersection'](_0x193fd3[_0x0baf('0x34')],_0x193fd3[_0x0baf('0x35')]);_0x504031[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x193fd3[_0x0baf('0x34')],qs['fields'](_0x45c6aa[_0x0baf('0x35')][_0x0baf('0x3a')]));_0x504031[_0x0baf('0x39')]=_0x504031[_0x0baf('0x39')][_0x0baf('0x3b')]?_0x504031['attributes']:_0x193fd3[_0x0baf('0x34')];if(_0x45c6aa[_0x0baf('0x35')][_0x0baf('0x45')]){_0x504031[_0x0baf('0x46')]=[{'all':!![]}];}_0x504031=_[_0x0baf('0x40')]({},_0x504031,_0x45c6aa[_0x0baf('0x44')]);return db[_0x0baf('0x30')]['find'](_0x504031)[_0x0baf('0x27')](handleEntityNotFound(_0x57903e,null))[_0x0baf('0x27')](respondWithResult(_0x57903e,null))[_0x0baf('0x49')](handleError(_0x57903e,null));};exports['create']=function(_0x3c9de3,_0x2222b6){return db[_0x0baf('0x30')][_0x0baf('0x4c')](_0x3c9de3[_0x0baf('0x4d')],{})[_0x0baf('0x27')](respondWithResult(_0x2222b6,0xc9))[_0x0baf('0x49')](handleError(_0x2222b6,null));};exports['update']=function(_0x22c451,_0x428c9b){if(_0x22c451[_0x0baf('0x4d')]['id']){delete _0x22c451[_0x0baf('0x4d')]['id'];}return db[_0x0baf('0x30')][_0x0baf('0x4e')]({'where':{'id':_0x22c451[_0x0baf('0x4b')]['id']}})[_0x0baf('0x27')](handleEntityNotFound(_0x428c9b,null))[_0x0baf('0x27')](saveUpdates(_0x22c451[_0x0baf('0x4d')],null))[_0x0baf('0x27')](respondWithResult(_0x428c9b,null))['catch'](handleError(_0x428c9b,null));};exports['destroy']=function(_0x354329,_0x3d6b19){return db[_0x0baf('0x30')][_0x0baf('0x4e')]({'where':{'id':_0x354329[_0x0baf('0x4b')]['id']}})[_0x0baf('0x27')](handleEntityNotFound(_0x3d6b19,null))[_0x0baf('0x27')](removeEntity(_0x3d6b19,null))['catch'](handleError(_0x3d6b19,null));};exports[_0x0baf('0x4f')]=function(_0x2ef4c1,_0xf2424,_0x16d9fb){var _0x3fdb41={};var _0x1e2671={};var _0x5e1849;var _0x3eebe5;return db['ZendeskAccount'][_0x0baf('0x50')]({'where':{'id':_0x2ef4c1['params']['id']}})[_0x0baf('0x27')](handleEntityNotFound(_0xf2424,null))['then'](function(_0x35b1a5){if(_0x35b1a5){_0x5e1849=_0x35b1a5;_0x1e2671['model']=_[_0x0baf('0x36')](db[_0x0baf('0x51')][_0x0baf('0x31')]);_0x1e2671[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x2ef4c1['query']);_0x1e2671[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x1e2671[_0x0baf('0x34')],_0x1e2671[_0x0baf('0x35')]);_0x3fdb41[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x1e2671['model'],qs[_0x0baf('0x3a')](_0x2ef4c1[_0x0baf('0x35')][_0x0baf('0x3a')]));_0x3fdb41[_0x0baf('0x39')]=_0x3fdb41[_0x0baf('0x39')][_0x0baf('0x3b')]?_0x3fdb41[_0x0baf('0x39')]:_0x1e2671['model'];_0x3fdb41['order']=qs[_0x0baf('0x3f')](_0x2ef4c1[_0x0baf('0x35')][_0x0baf('0x3f')]);_0x3fdb41[_0x0baf('0x41')]=qs[_0x0baf('0x37')](_[_0x0baf('0x52')](_0x2ef4c1[_0x0baf('0x35')],_0x1e2671[_0x0baf('0x37')]));if(_0x2ef4c1[_0x0baf('0x35')]['filter']){_0x3fdb41[_0x0baf('0x41')]=_[_0x0baf('0x40')](_0x3fdb41[_0x0baf('0x41')],{'$or':_[_0x0baf('0x2f')](_0x3fdb41[_0x0baf('0x39')],function(_0xebfc0c){var _0x26f5c9={};_0x26f5c9[_0xebfc0c]={'$like':'%'+_0x2ef4c1['query'][_0x0baf('0x43')]+'%'};return _0x26f5c9;})});}_0x3fdb41=_[_0x0baf('0x40')]({},_0x3fdb41,_0x2ef4c1[_0x0baf('0x44')]);return _0x5e1849[_0x0baf('0x4f')](_0x3fdb41);}})[_0x0baf('0x27')](function(_0x1a6d22){if(_0x1a6d22){_0x3eebe5=_0x1a6d22[_0x0baf('0x3b')];if(!_0x2ef4c1[_0x0baf('0x35')]['hasOwnProperty'](_0x0baf('0x3d'))){_0x3fdb41['limit']=qs[_0x0baf('0x20')](_0x2ef4c1['query']['limit']);_0x3fdb41[_0x0baf('0x1e')]=qs['offset'](_0x2ef4c1[_0x0baf('0x35')][_0x0baf('0x1e')]);}return _0x5e1849['getConfigurations'](_0x3fdb41);}})[_0x0baf('0x27')](function(_0xfb6708){if(_0xfb6708){return _0xfb6708?{'count':_0x3eebe5,'rows':_0xfb6708}:null;}})[_0x0baf('0x27')](respondWithResult(_0xf2424,null))['catch'](handleError(_0xf2424,null));};exports['addConfiguration']=function(_0x2438df,_0x7e8946,_0x6d789f){if(_0x2438df[_0x0baf('0x4d')]['id']){delete _0x2438df[_0x0baf('0x4d')]['id'];}return db['ZendeskAccount'][_0x0baf('0x50')]({'where':{'id':_0x2438df['params']['id']}})['then'](handleEntityNotFound(_0x7e8946,null))['then'](function(_0x427ed1){if(_0x427ed1){_0x2438df['body']['AccountId']=_0x427ed1['id'];_0x2438df[_0x0baf('0x4d')][_0x0baf('0x53')]=integrations[_0x0baf('0x54')](_0x2438df[_0x0baf('0x4d')][_0x0baf('0x55')],_0x2438df[_0x0baf('0x4d')]['type']);_0x2438df[_0x0baf('0x4d')][_0x0baf('0x56')]=integrations[_0x0baf('0x57')](_0x2438df[_0x0baf('0x4d')][_0x0baf('0x55')],_0x2438df[_0x0baf('0x4d')]['type']);return db[_0x0baf('0x51')][_0x0baf('0x4c')](_0x2438df[_0x0baf('0x4d')],{'include':[{'model':db['ZendeskField'],'as':_0x0baf('0x53')},{'model':db[_0x0baf('0x58')],'as':_0x0baf('0x56')}]});}return null;})[_0x0baf('0x27')](respondWithResult(_0x7e8946,null))[_0x0baf('0x49')](handleError(_0x7e8946,null));};exports[_0x0baf('0x59')]=function(_0x4cc046,_0x5874cc,_0x54353a){var _0x4b7caa='';return db[_0x0baf('0x30')][_0x0baf('0x50')]({'where':{'id':_0x4cc046[_0x0baf('0x4b')]['id']},'attributes':['id',_0x0baf('0x5a'),_0x0baf('0x5b'),_0x0baf('0x5c'),'authType','remoteUri']})[_0x0baf('0x27')](handleEntityNotFound(_0x5874cc,null))['then'](function(_0x22cd07){if(_0x22cd07){_0x4b7caa=_0x22cd07[_0x0baf('0x5d')];var _0x4cca39=_0x4b7caa[_0x0baf('0x5e')](-0x1);if(_0x4cca39==='/'){_0x4b7caa=_0x4b7caa[_0x0baf('0x5f')](0x0,_0x4b7caa[_0x0baf('0x60')](_0x4cca39));}var _0xb1d719={'method':_0x0baf('0x61'),'uri':util[_0x0baf('0x62')](_0x0baf('0x63'),_0x4b7caa,_0x0baf('0x64')),'json':!![]};switch(_0x22cd07[_0x0baf('0x65')]){case'password':_0xb1d719['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0x0baf('0x66'),_0x22cd07[_0x0baf('0x5a')],_0x22cd07[_0x0baf('0x5b')]))[_0x0baf('0x67')]('base64'))};break;case _0x0baf('0x5c'):_0xb1d719[_0x0baf('0x68')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x0baf('0x62')](_0x0baf('0x69'),_0x22cd07[_0x0baf('0x5a')],_0x22cd07[_0x0baf('0x5c')]))[_0x0baf('0x67')](_0x0baf('0x6a')))};break;default:throw new db[(_0x0baf('0x6b'))][(_0x0baf('0x6c'))]('Unknown\x20authentication\x20type');}return rp(_0xb1d719);}})[_0x0baf('0x27')](function(_0x1a3b7b){if(_0x1a3b7b){var _0x560c0f=[_0x0baf('0x6d'),_0x0baf('0x6e'),'group',_0x0baf('0x6f')];_[_0x0baf('0x70')](_0x1a3b7b[_0x0baf('0x64')],function(_0x2baede){return _0x560c0f[_0x0baf('0x71')](_0x2baede['type']);});return{'count':_0x1a3b7b['ticket_fields'][_0x0baf('0x3b')],'rows':_[_0x0baf('0x2f')](_0x1a3b7b['ticket_fields'],function(_0x28bc1c){return{'id':_0x28bc1c['id'],'name':_0x28bc1c[_0x0baf('0x72')]>0x7?_0x28bc1c[_0x0baf('0x73')]:_0x28bc1c['type'],'custom':_0x28bc1c[_0x0baf('0x72')]>0x7?!![]:![],'options':_0x28bc1c[_0x0baf('0x74')]?_0x28bc1c[_0x0baf('0x74')]:_0x28bc1c['custom_field_options']?_0x28bc1c[_0x0baf('0x75')]:[]};})};}})['then'](respondWithResult(_0x5874cc,null))[_0x0baf('0x49')](function(_0x3fee46){var _0x3fd039=_0x4cc046[_0x0baf('0x35')][_0x0baf('0x76')]?0x1f4:_0x3fee46['statusCode']||0x1f4;logger[_0x0baf('0x2a')](_0x0baf('0x77'),'getFields',_0x3fd039,JSON[_0x0baf('0x78')](_0x3fee46));delete _0x3fee46[_0x0baf('0x2c')];if(_0x3fd039===0x191){_0x3fd039=0x190;}_0x5874cc[_0x0baf('0x1c')](_0x3fd039)[_0x0baf('0x2d')](_0x4cc046[_0x0baf('0x35')][_0x0baf('0x76')]?{'message':_0x0baf('0x79'),'statusCode':_0x3fee46[_0x0baf('0x7a')]}:_0x3fee46);});};
\ No newline at end of file
+var _0xbc9d=['merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','find','create','update','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','getSubjects','channel','ZendeskField','Subjects','Descriptions','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','%s:%s','toString','base64','Basic\x20%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x5d3b98,_0x2822d2){_0x5d3b98=_0x5d3b98-0x0;var _0x51ef2f=_0xbc9d[_0x5d3b98];return _0x51ef2f;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];var integrations=require(_0xdbc9('0x19'));function respondWithStatusCode(_0x48bc83,_0x567e71){_0x567e71=_0x567e71||0xcc;return function(_0x3d0fdd){if(_0x3d0fdd){return _0x48bc83[_0xdbc9('0x1a')](_0x567e71);}return _0x48bc83[_0xdbc9('0x1b')](_0x567e71)[_0xdbc9('0x1c')]();};}function respondWithResult(_0x53495d,_0x4a9dcb){_0x4a9dcb=_0x4a9dcb||0xc8;return function(_0x2b7bd){if(_0x2b7bd){return _0x53495d[_0xdbc9('0x1b')](_0x4a9dcb)[_0xdbc9('0x1d')](_0x2b7bd);}};}function respondWithFilteredResult(_0x4c7b4f,_0x1b4616){return function(_0x1abee8){if(_0x1abee8){var _0x4fdb81=typeof _0x1b4616[_0xdbc9('0x1e')]===_0xdbc9('0x1f')&&typeof _0x1b4616[_0xdbc9('0x20')]===_0xdbc9('0x1f');var _0x1f22f4=_0x1abee8[_0xdbc9('0x21')];var _0x9f343d=_0x4fdb81?0x0:_0x1b4616[_0xdbc9('0x1e')];var _0x2ad952=_0x4fdb81?_0x1abee8[_0xdbc9('0x21')]:_0x1b4616['offset']+_0x1b4616[_0xdbc9('0x20')];var _0x497be2;if(_0x2ad952>=_0x1f22f4){_0x2ad952=_0x1f22f4;_0x497be2=0xc8;}else{_0x497be2=0xce;}_0x4c7b4f[_0xdbc9('0x1b')](_0x497be2);return _0x4c7b4f[_0xdbc9('0x22')]('Content-Range',_0x9f343d+'-'+_0x2ad952+'/'+_0x1f22f4)[_0xdbc9('0x1d')](_0x1abee8);}return null;};}function patchUpdates(_0x5367dc){return function(_0x569f32){try{jsonpatch['apply'](_0x569f32,_0x5367dc,!![]);}catch(_0x4f3b5d){return BPromise[_0xdbc9('0x23')](_0x4f3b5d);}return _0x569f32[_0xdbc9('0x24')]();};}function saveUpdates(_0x570ad9,_0x16dcf7){return function(_0x20563e){if(_0x20563e){return _0x20563e['update'](_0x570ad9)[_0xdbc9('0x25')](function(_0x6b788){return _0x6b788;});}return null;};}function removeEntity(_0x1b1c0d,_0x119230){return function(_0x3400e7){if(_0x3400e7){return _0x3400e7[_0xdbc9('0x26')]()[_0xdbc9('0x25')](function(){_0x1b1c0d[_0xdbc9('0x1b')](0xcc)[_0xdbc9('0x1c')]();});}};}function handleEntityNotFound(_0x4a868b,_0x550bef){return function(_0xe309ae){if(!_0xe309ae){_0x4a868b[_0xdbc9('0x1a')](0x194);}return _0xe309ae;};}function handleError(_0x1053ca,_0x24fdec){_0x24fdec=_0x24fdec||0x1f4;return function(_0x50c3ee){logger[_0xdbc9('0x27')](_0x50c3ee[_0xdbc9('0x28')]);if(_0x50c3ee['name']){delete _0x50c3ee['name'];}_0x1053ca[_0xdbc9('0x1b')](_0x24fdec)[_0xdbc9('0x29')](_0x50c3ee);};}exports[_0xdbc9('0x2a')]=function(_0x59bfd2,_0x13a432){var _0x539e57={},_0x561f8e={},_0x210a40={'count':0x0,'rows':[]};var _0x49da36=_['map'](db[_0xdbc9('0x2b')][_0xdbc9('0x2c')],function(_0x1cb557){return{'name':_0x1cb557['fieldName'],'type':_0x1cb557[_0xdbc9('0x2d')][_0xdbc9('0x2e')]};});_0x561f8e['model']=_['map'](_0x49da36,_0xdbc9('0x2f'));_0x561f8e[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x59bfd2[_0xdbc9('0x30')]);_0x561f8e[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x561f8e[_0xdbc9('0x34')],_0x561f8e['query']);_0x539e57[_0xdbc9('0x35')]=_[_0xdbc9('0x33')](_0x561f8e[_0xdbc9('0x34')],qs[_0xdbc9('0x36')](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x36')]));_0x539e57['attributes']=_0x539e57[_0xdbc9('0x35')]['length']?_0x539e57['attributes']:_0x561f8e['model'];if(!_0x59bfd2['query']['hasOwnProperty'](_0xdbc9('0x37'))){_0x539e57[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x59bfd2['query'][_0xdbc9('0x20')]);_0x539e57[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x1e')]);}_0x539e57[_0xdbc9('0x38')]=qs['sort'](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x39')]);_0x539e57[_0xdbc9('0x3a')]=qs['filters'](_[_0xdbc9('0x3b')](_0x59bfd2[_0xdbc9('0x30')],_0x561f8e[_0xdbc9('0x32')]),_0x49da36);if(_0x59bfd2[_0xdbc9('0x30')]['filter']){_0x539e57['where']=_[_0xdbc9('0x3c')](_0x539e57[_0xdbc9('0x3a')],{'$or':_[_0xdbc9('0x3d')](_0x49da36,function(_0x1ef970){if(_0x1ef970['type']!==_0xdbc9('0x3e')){var _0x3827be={};_0x3827be[_0x1ef970[_0xdbc9('0x2f')]]={'$like':'%'+_0x59bfd2['query'][_0xdbc9('0x3f')]+'%'};return _0x3827be;}})});}_0x539e57=_[_0xdbc9('0x3c')]({},_0x539e57,_0x59bfd2[_0xdbc9('0x40')]);var _0x523c79={'where':_0x539e57[_0xdbc9('0x3a')]};return db[_0xdbc9('0x2b')]['count'](_0x523c79)['then'](function(_0xfc34d5){_0x210a40[_0xdbc9('0x21')]=_0xfc34d5;if(_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x41')]){_0x539e57['include']=[{'all':!![]}];}return db[_0xdbc9('0x2b')][_0xdbc9('0x42')](_0x539e57);})['then'](function(_0x8445b8){_0x210a40[_0xdbc9('0x43')]=_0x8445b8;return _0x210a40;})['then'](respondWithFilteredResult(_0x13a432,_0x539e57))[_0xdbc9('0x44')](handleError(_0x13a432,null));};exports[_0xdbc9('0x45')]=function(_0x2adb23,_0x3415c3){var _0x3ed4de={'raw':![],'where':{'id':_0x2adb23[_0xdbc9('0x46')]['id']}},_0x1cd538={};_0x1cd538['model']=_['keys'](db[_0xdbc9('0x2b')][_0xdbc9('0x2c')]);_0x1cd538[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x2adb23[_0xdbc9('0x30')]);_0x1cd538[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x1cd538[_0xdbc9('0x34')],_0x1cd538[_0xdbc9('0x30')]);_0x3ed4de[_0xdbc9('0x35')]=_[_0xdbc9('0x33')](_0x1cd538['model'],qs['fields'](_0x2adb23[_0xdbc9('0x30')][_0xdbc9('0x36')]));_0x3ed4de[_0xdbc9('0x35')]=_0x3ed4de[_0xdbc9('0x35')][_0xdbc9('0x47')]?_0x3ed4de[_0xdbc9('0x35')]:_0x1cd538[_0xdbc9('0x34')];if(_0x2adb23[_0xdbc9('0x30')]['includeAll']){_0x3ed4de['include']=[{'all':!![]}];}_0x3ed4de=_[_0xdbc9('0x3c')]({},_0x3ed4de,_0x2adb23[_0xdbc9('0x40')]);return db[_0xdbc9('0x2b')][_0xdbc9('0x48')](_0x3ed4de)[_0xdbc9('0x25')](handleEntityNotFound(_0x3415c3,null))[_0xdbc9('0x25')](respondWithResult(_0x3415c3,null))[_0xdbc9('0x44')](handleError(_0x3415c3,null));};exports[_0xdbc9('0x49')]=function(_0x43e3ec,_0x589557){return db[_0xdbc9('0x2b')][_0xdbc9('0x49')](_0x43e3ec['body'],{})['then'](respondWithResult(_0x589557,0xc9))[_0xdbc9('0x44')](handleError(_0x589557,null));};exports[_0xdbc9('0x4a')]=function(_0x133a13,_0x49a55c){if(_0x133a13[_0xdbc9('0x4b')]['id']){delete _0x133a13[_0xdbc9('0x4b')]['id'];}return db[_0xdbc9('0x2b')][_0xdbc9('0x48')]({'where':{'id':_0x133a13['params']['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x49a55c,null))[_0xdbc9('0x25')](saveUpdates(_0x133a13[_0xdbc9('0x4b')],null))[_0xdbc9('0x25')](respondWithResult(_0x49a55c,null))['catch'](handleError(_0x49a55c,null));};exports[_0xdbc9('0x26')]=function(_0x36c70e,_0x3f49b7){return db[_0xdbc9('0x2b')][_0xdbc9('0x48')]({'where':{'id':_0x36c70e[_0xdbc9('0x46')]['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x3f49b7,null))[_0xdbc9('0x25')](removeEntity(_0x3f49b7,null))['catch'](handleError(_0x3f49b7,null));};exports[_0xdbc9('0x4c')]=function(_0x4d09e1,_0x3f493e,_0x4279bc){var _0x53771a={};var _0x561737={};var _0xc7335d;var _0x4b55df;return db[_0xdbc9('0x2b')][_0xdbc9('0x4d')]({'where':{'id':_0x4d09e1[_0xdbc9('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f493e,null))[_0xdbc9('0x25')](function(_0x1c52e6){if(_0x1c52e6){_0xc7335d=_0x1c52e6;_0x561737[_0xdbc9('0x34')]=_[_0xdbc9('0x31')](db[_0xdbc9('0x4e')][_0xdbc9('0x2c')]);_0x561737[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x4d09e1['query']);_0x561737['filters']=_['intersection'](_0x561737[_0xdbc9('0x34')],_0x561737[_0xdbc9('0x30')]);_0x53771a[_0xdbc9('0x35')]=_['intersection'](_0x561737['model'],qs[_0xdbc9('0x36')](_0x4d09e1[_0xdbc9('0x30')]['fields']));_0x53771a['attributes']=_0x53771a[_0xdbc9('0x35')][_0xdbc9('0x47')]?_0x53771a[_0xdbc9('0x35')]:_0x561737[_0xdbc9('0x34')];_0x53771a[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x4d09e1['query'][_0xdbc9('0x39')]);_0x53771a[_0xdbc9('0x3a')]=qs[_0xdbc9('0x32')](_['pick'](_0x4d09e1[_0xdbc9('0x30')],_0x561737[_0xdbc9('0x32')]));if(_0x4d09e1[_0xdbc9('0x30')]['filter']){_0x53771a[_0xdbc9('0x3a')]=_['merge'](_0x53771a[_0xdbc9('0x3a')],{'$or':_[_0xdbc9('0x3d')](_0x53771a[_0xdbc9('0x35')],function(_0x26ed1c){var _0x148061={};_0x148061[_0x26ed1c]={'$like':'%'+_0x4d09e1[_0xdbc9('0x30')]['filter']+'%'};return _0x148061;})});}_0x53771a=_[_0xdbc9('0x3c')]({},_0x53771a,_0x4d09e1['options']);return _0xc7335d[_0xdbc9('0x4c')](_0x53771a);}})[_0xdbc9('0x25')](function(_0x53fcd6){if(_0x53fcd6){_0x4b55df=_0x53fcd6[_0xdbc9('0x47')];if(!_0x4d09e1[_0xdbc9('0x30')]['hasOwnProperty']('nolimit')){_0x53771a[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x4d09e1[_0xdbc9('0x30')]['limit']);_0x53771a[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x4d09e1['query'][_0xdbc9('0x1e')]);}return _0xc7335d[_0xdbc9('0x4c')](_0x53771a);}})['then'](function(_0x4876f9){if(_0x4876f9){return _0x4876f9?{'count':_0x4b55df,'rows':_0x4876f9}:null;}})[_0xdbc9('0x25')](respondWithResult(_0x3f493e,null))[_0xdbc9('0x44')](handleError(_0x3f493e,null));};exports[_0xdbc9('0x4f')]=function(_0xa8b4d9,_0x3e93d3,_0x14cbf4){if(_0xa8b4d9[_0xdbc9('0x4b')]['id']){delete _0xa8b4d9[_0xdbc9('0x4b')]['id'];}return db['ZendeskAccount'][_0xdbc9('0x4d')]({'where':{'id':_0xa8b4d9[_0xdbc9('0x46')]['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x3e93d3,null))[_0xdbc9('0x25')](function(_0x38f7da){if(_0x38f7da){_0xa8b4d9[_0xdbc9('0x4b')][_0xdbc9('0x50')]=_0x38f7da['id'];_0xa8b4d9[_0xdbc9('0x4b')]['Subjects']=integrations[_0xdbc9('0x51')](_0xa8b4d9['body'][_0xdbc9('0x52')],_0xa8b4d9['body'][_0xdbc9('0x2d')]);_0xa8b4d9[_0xdbc9('0x4b')]['Descriptions']=integrations['getDescriptions'](_0xa8b4d9['body'][_0xdbc9('0x52')],_0xa8b4d9[_0xdbc9('0x4b')][_0xdbc9('0x2d')]);return db['ZendeskConfiguration'][_0xdbc9('0x49')](_0xa8b4d9[_0xdbc9('0x4b')],{'include':[{'model':db[_0xdbc9('0x53')],'as':_0xdbc9('0x54')},{'model':db[_0xdbc9('0x53')],'as':_0xdbc9('0x55')}]});}return null;})[_0xdbc9('0x25')](respondWithResult(_0x3e93d3,null))[_0xdbc9('0x44')](handleError(_0x3e93d3,null));};exports[_0xdbc9('0x56')]=function(_0x5e6522,_0x2787d9,_0x2c3223){var _0x511778='';return db['ZendeskAccount'][_0xdbc9('0x4d')]({'where':{'id':_0x5e6522[_0xdbc9('0x46')]['id']},'attributes':['id',_0xdbc9('0x57'),_0xdbc9('0x58'),_0xdbc9('0x59'),_0xdbc9('0x5a'),_0xdbc9('0x5b')]})['then'](handleEntityNotFound(_0x2787d9,null))[_0xdbc9('0x25')](function(_0x19af46){if(_0x19af46){_0x511778=_0x19af46[_0xdbc9('0x5b')];var _0x4a412e=_0x511778[_0xdbc9('0x5c')](-0x1);if(_0x4a412e==='/'){_0x511778=_0x511778[_0xdbc9('0x5d')](0x0,_0x511778[_0xdbc9('0x5e')](_0x4a412e));}var _0x2b4905={'method':_0xdbc9('0x5f'),'uri':util[_0xdbc9('0x60')](_0xdbc9('0x61'),_0x511778,_0xdbc9('0x62')),'json':!![]};switch(_0x19af46[_0xdbc9('0x5a')]){case _0xdbc9('0x58'):_0x2b4905[_0xdbc9('0x63')]={'Authorization':util[_0xdbc9('0x60')]('Basic\x20%s',new Buffer(util['format'](_0xdbc9('0x64'),_0x19af46['username'],_0x19af46['password']))[_0xdbc9('0x65')](_0xdbc9('0x66')))};break;case _0xdbc9('0x59'):_0x2b4905['headers']={'Authorization':util[_0xdbc9('0x60')](_0xdbc9('0x67'),new Buffer(util[_0xdbc9('0x60')]('%s/token:%s',_0x19af46[_0xdbc9('0x57')],_0x19af46[_0xdbc9('0x59')]))['toString'](_0xdbc9('0x66')))};break;default:throw new db[(_0xdbc9('0x68'))][(_0xdbc9('0x69'))](_0xdbc9('0x6a'));}return rp(_0x2b4905);}})[_0xdbc9('0x25')](function(_0x501754){if(_0x501754){var _0x4f984b=[_0xdbc9('0x6b'),_0xdbc9('0x6c'),'group',_0xdbc9('0x6d')];_[_0xdbc9('0x6e')](_0x501754[_0xdbc9('0x62')],function(_0x5802fc){return _0x4f984b[_0xdbc9('0x6f')](_0x5802fc[_0xdbc9('0x2d')]);});return{'count':_0x501754[_0xdbc9('0x62')][_0xdbc9('0x47')],'rows':_[_0xdbc9('0x3d')](_0x501754[_0xdbc9('0x62')],function(_0x1b053a){return{'id':_0x1b053a['id'],'name':_0x1b053a[_0xdbc9('0x70')]>0x7?_0x1b053a['title']:_0x1b053a[_0xdbc9('0x2d')],'custom':_0x1b053a[_0xdbc9('0x70')]>0x7?!![]:![],'options':_0x1b053a[_0xdbc9('0x71')]?_0x1b053a[_0xdbc9('0x71')]:_0x1b053a['custom_field_options']?_0x1b053a[_0xdbc9('0x72')]:[]};})};}})['then'](respondWithResult(_0x2787d9,null))['catch'](function(_0x34ebeb){var _0x3400d0=_0x5e6522['query'][_0xdbc9('0x73')]?0x1f4:_0x34ebeb[_0xdbc9('0x74')]||0x1f4;logger[_0xdbc9('0x27')](_0xdbc9('0x75'),_0xdbc9('0x56'),_0x3400d0,JSON[_0xdbc9('0x76')](_0x34ebeb));delete _0x34ebeb[_0xdbc9('0x2f')];if(_0x3400d0===0x191){_0x3400d0=0x190;}_0x2787d9['status'](_0x3400d0)['send'](_0x5e6522[_0xdbc9('0x30')][_0xdbc9('0x73')]?{'message':_0xdbc9('0x77'),'statusCode':_0x34ebeb['statusCode']}:_0x34ebeb);});};
\ No newline at end of file
index 7eb43e3..8e1ff01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9100=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','bluebird','request-promise'];(function(_0x41dcda,_0x21e8cc){var _0x4b0e10=function(_0x257462){while(--_0x257462){_0x41dcda['push'](_0x41dcda['shift']());}};_0x4b0e10(++_0x21e8cc);}(_0x9100,0x159));var _0x0910=function(_0x9e4aa8,_0x99b173){_0x9e4aa8=_0x9e4aa8-0x0;var _0x49e468=_0x9100[_0x9e4aa8];return _0x49e468;};'use strict';var _=require('lodash');var util=require(_0x0910('0x0'));var logger=require(_0x0910('0x1'))(_0x0910('0x2'));var moment=require('moment');var BPromise=require(_0x0910('0x3'));var rp=require(_0x0910('0x4'));var fs=require('fs');var path=require(_0x0910('0x5'));var rimraf=require(_0x0910('0x6'));var config=require(_0x0910('0x7'));var attributes=require(_0x0910('0x8'));var integrations=require(_0x0910('0x9'));module[_0x0910('0xa')]=function(_0x3c21e3,_0x3a3bf9){return _0x3c21e3[_0x0910('0xb')](_0x0910('0xc'),attributes,{'tableName':_0x0910('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd74b=['exports','define','int_zendesk_accounts','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x51ea93,_0x394bdb){var _0x1de85b=function(_0x81d557){while(--_0x81d557){_0x51ea93['push'](_0x51ea93['shift']());}};_0x1de85b(++_0x394bdb);}(_0xd74b,0x10b));var _0xbd74=function(_0xd75480,_0x1503d6){_0xd75480=_0xd75480-0x0;var _0xc2b538=_0xd74b[_0xd75480];return _0xc2b538;};'use strict';var _=require(_0xbd74('0x0'));var util=require(_0xbd74('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbd74('0x2'));var BPromise=require('bluebird');var rp=require(_0xbd74('0x3'));var fs=require('fs');var path=require(_0xbd74('0x4'));var rimraf=require(_0xbd74('0x5'));var config=require(_0xbd74('0x6'));var attributes=require(_0xbd74('0x7'));var integrations=require(_0xbd74('0x8'));module[_0xbd74('0x9')]=function(_0x55ab18,_0xdd9d05){return _0x55ab18[_0xbd74('0xa')]('ZendeskAccount',attributes,{'tableName':_0xbd74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c438e6f..484b9a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe88d=['catch','GetZendeskAccount','findAll','options','where','attributes','limit','include','map','model','debug','stringify','ShowZendeskAccount','ZendeskAccount','raw','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ZendeskAccount,\x20%s,\x20%s','message','result'];(function(_0x2d3ace,_0x1a8173){var _0x5247d4=function(_0x53788d){while(--_0x53788d){_0x2d3ace['push'](_0x2d3ace['shift']());}};_0x5247d4(++_0x1a8173);}(_0xe88d,0x11f));var _0xde88=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0xe88d[_0x38c699];return _0x3b1ded;};'use strict';var _=require('lodash');var util=require(_0xde88('0x0'));var moment=require('moment');var BPromise=require(_0xde88('0x1'));var rs=require(_0xde88('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde88('0x3'))['db'];var utils=require(_0xde88('0x4'));var logger=require(_0xde88('0x5'))(_0xde88('0x6'));var config=require('../../config/environment');var jayson=require(_0xde88('0x7'));var client=jayson[_0xde88('0x8')][_0xde88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e83b9,_0x4cbffb,_0x7d9101){return new BPromise(function(_0x79bb4b,_0x1da8b5){return client[_0xde88('0xa')](_0x3e83b9,_0x7d9101)[_0xde88('0xb')](function(_0x192318){logger[_0xde88('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x4cbffb,_0xde88('0xd'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x4cbffb,_0xde88('0xd'),JSON['stringify'](_0x192318));if(_0x192318[_0xde88('0xe')]){if(_0x192318['error'][_0xde88('0xf')]===0x1f4){logger[_0xde88('0xe')](_0xde88('0x10'),_0x4cbffb,_0x192318[_0xde88('0xe')][_0xde88('0x11')]);return _0x1da8b5(_0x192318['error']['message']);}logger[_0xde88('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x4cbffb,_0x192318[_0xde88('0xe')][_0xde88('0x11')]);return _0x79bb4b(_0x192318[_0xde88('0xe')][_0xde88('0x11')]);}else{logger[_0xde88('0xc')](_0xde88('0x10'),_0x4cbffb,_0xde88('0xd'));_0x79bb4b(_0x192318[_0xde88('0x12')][_0xde88('0x11')]);}})[_0xde88('0x13')](function(_0x1842e8){logger[_0xde88('0xe')](_0xde88('0x10'),_0x4cbffb,_0x1842e8);_0x1da8b5(_0x1842e8);});});}exports[_0xde88('0x14')]=function(_0x46996c){var _0x320125=this;return new Promise(function(_0x4b9b81,_0x278c47){return db['ZendeskAccount'][_0xde88('0x15')]({'raw':_0x46996c[_0xde88('0x16')]?_0x46996c[_0xde88('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x46996c[_0xde88('0x16')]?_0x46996c['options'][_0xde88('0x17')]||null:null,'attributes':_0x46996c['options']?_0x46996c[_0xde88('0x16')][_0xde88('0x18')]||null:null,'limit':_0x46996c[_0xde88('0x16')]?_0x46996c[_0xde88('0x16')][_0xde88('0x19')]||null:null,'include':_0x46996c[_0xde88('0x16')]?_0x46996c[_0xde88('0x16')][_0xde88('0x1a')]?_[_0xde88('0x1b')](_0x46996c['options'][_0xde88('0x1a')],function(_0x56450a){return{'model':db[_0x56450a['model']],'as':_0x56450a['as'],'attributes':_0x56450a[_0xde88('0x18')],'include':_0x56450a['include']?_[_0xde88('0x1b')](_0x56450a[_0xde88('0x1a')],function(_0x1c98d5){return{'model':db[_0x1c98d5[_0xde88('0x1c')]],'as':_0x1c98d5['as'],'attributes':_0x1c98d5['attributes'],'include':_0x1c98d5[_0xde88('0x1a')]?_['map'](_0x1c98d5[_0xde88('0x1a')],function(_0x435067){return{'model':db[_0x435067[_0xde88('0x1c')]],'as':_0x435067['as'],'attributes':_0x435067[_0xde88('0x18')]};}):[]};}):[]};}):[]:[]})[_0xde88('0xb')](function(_0x120251){logger[_0xde88('0xc')](_0xde88('0x14'),_0x46996c);logger[_0xde88('0x1d')](_0xde88('0x14'),_0x46996c,JSON[_0xde88('0x1e')](_0x120251));_0x4b9b81(_0x120251);})[_0xde88('0x13')](function(_0x262792){logger[_0xde88('0xe')]('GetZendeskAccount',_0x262792[_0xde88('0x11')],_0x46996c);_0x278c47(_0x320125[_0xde88('0xe')](0x1f4,_0x262792['message']));});});};exports[_0xde88('0x1f')]=function(_0xbabec1){var _0x21e2e9=this;return new Promise(function(_0x5ada30,_0xb3dfba){return db[_0xde88('0x20')]['find']({'raw':_0xbabec1['options']?_0xbabec1[_0xde88('0x16')][_0xde88('0x21')]===undefined?!![]:![]:!![],'where':_0xbabec1['options']?_0xbabec1[_0xde88('0x16')]['where']||null:null,'attributes':_0xbabec1[_0xde88('0x16')]?_0xbabec1['options'][_0xde88('0x18')]||null:null,'include':_0xbabec1[_0xde88('0x16')]?_0xbabec1['options'][_0xde88('0x1a')]?_[_0xde88('0x1b')](_0xbabec1[_0xde88('0x16')][_0xde88('0x1a')],function(_0x4bd1d0){return{'model':db[_0x4bd1d0['model']],'as':_0x4bd1d0['as'],'attributes':_0x4bd1d0['attributes'],'include':_0x4bd1d0['include']?_['map'](_0x4bd1d0[_0xde88('0x1a')],function(_0x27e8db){return{'model':db[_0x27e8db[_0xde88('0x1c')]],'as':_0x27e8db['as'],'attributes':_0x27e8db[_0xde88('0x18')],'include':_0x27e8db['include']?_['map'](_0x27e8db[_0xde88('0x1a')],function(_0x551c2e){return{'model':db[_0x551c2e[_0xde88('0x1c')]],'as':_0x551c2e['as'],'attributes':_0x551c2e['attributes']};}):[]};}):[]};}):[]:[]})[_0xde88('0xb')](function(_0x5ad284){logger[_0xde88('0xc')](_0xde88('0x1f'),_0xbabec1);logger['debug']('ShowZendeskAccount',_0xbabec1,JSON[_0xde88('0x1e')](_0x5ad284));_0x5ada30(_0x5ad284);})[_0xde88('0x13')](function(_0x404c88){logger[_0xde88('0xe')](_0xde88('0x1f'),_0x404c88[_0xde88('0x11')],_0xbabec1);_0xb3dfba(_0x21e2e9[_0xde88('0xe')](0x1f4,_0x404c88[_0xde88('0x11')]));});});};
\ No newline at end of file
+var _0xadf7=['request\x20sent','stringify','error','ZendeskAccount,\x20%s,\x20%s','message','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','debug','catch','ShowZendeskAccount','find','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0xadf7,0xe0));var _0x7adf=function(_0x4dbdd7,_0x463e3d){_0x4dbdd7=_0x4dbdd7-0x0;var _0x4d9a0d=_0xadf7[_0x4dbdd7];return _0x4d9a0d;};'use strict';var _=require(_0x7adf('0x0'));var util=require('util');var moment=require(_0x7adf('0x1'));var BPromise=require(_0x7adf('0x2'));var rs=require(_0x7adf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7adf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7adf('0x5'))(_0x7adf('0x6'));var config=require(_0x7adf('0x7'));var jayson=require(_0x7adf('0x8'));var client=jayson['client'][_0x7adf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3125a9,_0x29504d,_0x206c0b){return new BPromise(function(_0x331509,_0x39ca43){return client[_0x7adf('0xa')](_0x3125a9,_0x206c0b)[_0x7adf('0xb')](function(_0x353da6){logger[_0x7adf('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x29504d,'request\x20sent');logger['debug'](_0x7adf('0xd'),_0x29504d,_0x7adf('0xe'),JSON[_0x7adf('0xf')](_0x353da6));if(_0x353da6[_0x7adf('0x10')]){if(_0x353da6[_0x7adf('0x10')]['code']===0x1f4){logger[_0x7adf('0x10')](_0x7adf('0x11'),_0x29504d,_0x353da6[_0x7adf('0x10')]['message']);return _0x39ca43(_0x353da6[_0x7adf('0x10')][_0x7adf('0x12')]);}logger[_0x7adf('0x10')](_0x7adf('0x11'),_0x29504d,_0x353da6[_0x7adf('0x10')][_0x7adf('0x12')]);return _0x331509(_0x353da6[_0x7adf('0x10')][_0x7adf('0x12')]);}else{logger[_0x7adf('0xc')](_0x7adf('0x11'),_0x29504d,_0x7adf('0xe'));_0x331509(_0x353da6['result'][_0x7adf('0x12')]);}})['catch'](function(_0x302c95){logger['error'](_0x7adf('0x11'),_0x29504d,_0x302c95);_0x39ca43(_0x302c95);});});}exports[_0x7adf('0x13')]=function(_0x4b1c7c){var _0x360780=this;return new Promise(function(_0xecb8fb,_0x5333a9){return db[_0x7adf('0x14')][_0x7adf('0x15')]({'raw':_0x4b1c7c[_0x7adf('0x16')]?_0x4b1c7c[_0x7adf('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4b1c7c[_0x7adf('0x16')]?_0x4b1c7c['options'][_0x7adf('0x17')]||null:null,'attributes':_0x4b1c7c[_0x7adf('0x16')]?_0x4b1c7c['options'][_0x7adf('0x18')]||null:null,'limit':_0x4b1c7c[_0x7adf('0x16')]?_0x4b1c7c['options'][_0x7adf('0x19')]||null:null,'include':_0x4b1c7c[_0x7adf('0x16')]?_0x4b1c7c['options'][_0x7adf('0x1a')]?_[_0x7adf('0x1b')](_0x4b1c7c[_0x7adf('0x16')][_0x7adf('0x1a')],function(_0x25e779){return{'model':db[_0x25e779['model']],'as':_0x25e779['as'],'attributes':_0x25e779[_0x7adf('0x18')],'include':_0x25e779[_0x7adf('0x1a')]?_['map'](_0x25e779[_0x7adf('0x1a')],function(_0xe8dc33){return{'model':db[_0xe8dc33[_0x7adf('0x1c')]],'as':_0xe8dc33['as'],'attributes':_0xe8dc33[_0x7adf('0x18')],'include':_0xe8dc33[_0x7adf('0x1a')]?_[_0x7adf('0x1b')](_0xe8dc33[_0x7adf('0x1a')],function(_0x33b7bf){return{'model':db[_0x33b7bf['model']],'as':_0x33b7bf['as'],'attributes':_0x33b7bf[_0x7adf('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7adf('0xb')](function(_0x559803){logger[_0x7adf('0xc')]('GetZendeskAccount',_0x4b1c7c);logger[_0x7adf('0x1d')](_0x7adf('0x13'),_0x4b1c7c,JSON[_0x7adf('0xf')](_0x559803));_0xecb8fb(_0x559803);})[_0x7adf('0x1e')](function(_0x2066da){logger[_0x7adf('0x10')](_0x7adf('0x13'),_0x2066da[_0x7adf('0x12')],_0x4b1c7c);_0x5333a9(_0x360780[_0x7adf('0x10')](0x1f4,_0x2066da[_0x7adf('0x12')]));});});};exports[_0x7adf('0x1f')]=function(_0x3910f7){var _0x10d4cf=this;return new Promise(function(_0x60ec91,_0x28545d){return db['ZendeskAccount'][_0x7adf('0x20')]({'raw':_0x3910f7[_0x7adf('0x16')]?_0x3910f7['options'][_0x7adf('0x21')]===undefined?!![]:![]:!![],'where':_0x3910f7['options']?_0x3910f7[_0x7adf('0x16')][_0x7adf('0x17')]||null:null,'attributes':_0x3910f7[_0x7adf('0x16')]?_0x3910f7[_0x7adf('0x16')][_0x7adf('0x18')]||null:null,'include':_0x3910f7['options']?_0x3910f7[_0x7adf('0x16')]['include']?_[_0x7adf('0x1b')](_0x3910f7['options'][_0x7adf('0x1a')],function(_0x4c28e8){return{'model':db[_0x4c28e8[_0x7adf('0x1c')]],'as':_0x4c28e8['as'],'attributes':_0x4c28e8[_0x7adf('0x18')],'include':_0x4c28e8['include']?_['map'](_0x4c28e8[_0x7adf('0x1a')],function(_0x5aa078){return{'model':db[_0x5aa078[_0x7adf('0x1c')]],'as':_0x5aa078['as'],'attributes':_0x5aa078['attributes'],'include':_0x5aa078[_0x7adf('0x1a')]?_[_0x7adf('0x1b')](_0x5aa078[_0x7adf('0x1a')],function(_0x1cc2cf){return{'model':db[_0x1cc2cf['model']],'as':_0x1cc2cf['as'],'attributes':_0x1cc2cf[_0x7adf('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7adf('0xb')](function(_0x10ab41){logger[_0x7adf('0xc')]('ShowZendeskAccount',_0x3910f7);logger[_0x7adf('0x1d')](_0x7adf('0x1f'),_0x3910f7,JSON[_0x7adf('0xf')](_0x10ab41));_0x60ec91(_0x10ab41);})['catch'](function(_0x3e2a31){logger['error'](_0x7adf('0x1f'),_0x3e2a31['message'],_0x3910f7);_0x28545d(_0x10d4cf[_0x7adf('0x10')](0x1f4,_0x3e2a31[_0x7adf('0x12')]));});});};
\ No newline at end of file
index 11ce44f..6c52ece 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x2dfc5f,_0x2c6dee){var _0x105e42=function(_0x439246){while(--_0x439246){_0x2dfc5f['push'](_0x2dfc5f['shift']());}};_0x105e42(++_0x2c6dee);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e9e0d,_0xd86384){_0x4e9e0d=_0x4e9e0d-0x0;var _0x514622=_0xb10b[_0x4e9e0d];return _0x514622;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xb4ea77,_0x392f42){var _0x2075c6=function(_0x51abd9){while(--_0x51abd9){_0xb4ea77['push'](_0xb4ea77['shift']());}};_0x2075c6(++_0x392f42);}(_0xac4a,0x13f));var _0xaac4=function(_0x2a89a2,_0x244183){_0x2a89a2=_0x2a89a2-0x0;var _0x3ee297=_0xac4a[_0x2a89a2];return _0x3ee297;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router;
\ No newline at end of file
index 9e634b3..0e1b81f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe198=['STRING','sequelize','exports'];(function(_0x107f87,_0x2fc1b3){var _0x1a18fe=function(_0x4d737c){while(--_0x4d737c){_0x107f87['push'](_0x107f87['shift']());}};_0x1a18fe(++_0x2fc1b3);}(_0xe198,0x160));var _0x8e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe198[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8e19('0x0'));module[_0x8e19('0x1')]={'name':{'type':Sequelize[_0x8e19('0x2')]},'description':{'type':Sequelize[_0x8e19('0x2')]}};
\ No newline at end of file
+var _0xdb01=['STRING'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0xdb01,0x98));var _0x1db0=function(_0xfd183f,_0x21bbde){_0xfd183f=_0xfd183f-0x0;var _0x40b42e=_0xdb01[_0xfd183f];return _0x40b42e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1db0('0x0')]},'description':{'type':Sequelize[_0x1db0('0x0')]}};
\ No newline at end of file
index ed7eed0..8937b3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb8=['getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','map','type','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','getFields','findOne','ZendeskField','hasOwnProperty','nolimit','getSubjects','getDescriptions'];(function(_0x704ba5,_0x2cd0db){var _0x2b552f=function(_0x1f1b74){while(--_0x1f1b74){_0x704ba5['push'](_0x704ba5['shift']());}};_0x2b552f(++_0x2cd0db);}(_0xabb8,0x13c));var _0x8abb=function(_0x2a2a33,_0x3becbf){_0x2a2a33=_0x2a2a33-0x0;var _0x153d89=_0xabb8[_0x2a2a33];return _0x153d89;};'use strict';var emlformat=require(_0x8abb('0x0'));var rimraf=require(_0x8abb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8abb('0x2'));var moment=require('moment');var BPromise=require(_0x8abb('0x3'));var Mustache=require('mustache');var util=require(_0x8abb('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x8abb('0x5'));var ejs=require(_0x8abb('0x6'));var fs=require('fs');var fs_extra=require(_0x8abb('0x7'));var _=require(_0x8abb('0x8'));var squel=require(_0x8abb('0x9'));var crypto=require(_0x8abb('0xa'));var jsforce=require(_0x8abb('0xb'));var deskjs=require(_0x8abb('0xc'));var toCsv=require(_0x8abb('0x5'));var querystring=require('querystring');var Papa=require(_0x8abb('0xd'));var Redis=require('ioredis');var authService=require(_0x8abb('0xe'));var qs=require(_0x8abb('0xf'));var as=require(_0x8abb('0x10'));var hardwareService=require(_0x8abb('0x11'));var logger=require(_0x8abb('0x12'))(_0x8abb('0x13'));var utils=require('../../config/utils');var config=require(_0x8abb('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3136b7,_0x409ca1){_0x409ca1=_0x409ca1||0xcc;return function(_0xdc26a7){if(_0xdc26a7){return _0x3136b7[_0x8abb('0x15')](_0x409ca1);}return _0x3136b7[_0x8abb('0x16')](_0x409ca1)[_0x8abb('0x17')]();};}function respondWithResult(_0x31a312,_0x161002){_0x161002=_0x161002||0xc8;return function(_0x54869f){if(_0x54869f){return _0x31a312[_0x8abb('0x16')](_0x161002)[_0x8abb('0x18')](_0x54869f);}};}function respondWithFilteredResult(_0x532bb4,_0x34e58a){return function(_0x4917b8){if(_0x4917b8){var _0x273de5=typeof _0x34e58a[_0x8abb('0x19')]===_0x8abb('0x1a')&&typeof _0x34e58a[_0x8abb('0x1b')]===_0x8abb('0x1a');var _0x807a15=_0x4917b8[_0x8abb('0x1c')];var _0x4f144a=_0x273de5?0x0:_0x34e58a[_0x8abb('0x19')];var _0x54079c=_0x273de5?_0x4917b8['count']:_0x34e58a['offset']+_0x34e58a[_0x8abb('0x1b')];var _0x3ea360;if(_0x54079c>=_0x807a15){_0x54079c=_0x807a15;_0x3ea360=0xc8;}else{_0x3ea360=0xce;}_0x532bb4['status'](_0x3ea360);return _0x532bb4['set'](_0x8abb('0x1d'),_0x4f144a+'-'+_0x54079c+'/'+_0x807a15)[_0x8abb('0x18')](_0x4917b8);}return null;};}function patchUpdates(_0x270dd9){return function(_0x57c48b){try{jsonpatch['apply'](_0x57c48b,_0x270dd9,!![]);}catch(_0x349dce){return BPromise['reject'](_0x349dce);}return _0x57c48b['save']();};}function saveUpdates(_0x3b1cd8,_0x55ba4d){return function(_0x573b45){if(_0x573b45){return _0x573b45[_0x8abb('0x1e')](_0x3b1cd8)[_0x8abb('0x1f')](function(_0xe4dc40){return _0xe4dc40;});}return null;};}function removeEntity(_0x3079b0,_0x42388d){return function(_0x2ec38e){if(_0x2ec38e){return _0x2ec38e[_0x8abb('0x20')]()['then'](function(){_0x3079b0[_0x8abb('0x16')](0xcc)[_0x8abb('0x17')]();});}};}function handleEntityNotFound(_0x5e1239,_0x35e79a){return function(_0x3e21bd){if(!_0x3e21bd){_0x5e1239['sendStatus'](0x194);}return _0x3e21bd;};}function handleError(_0x29e372,_0x815dde){_0x815dde=_0x815dde||0x1f4;return function(_0x3b04b7){logger[_0x8abb('0x21')](_0x3b04b7['stack']);if(_0x3b04b7[_0x8abb('0x22')]){delete _0x3b04b7['name'];}_0x29e372[_0x8abb('0x16')](_0x815dde)[_0x8abb('0x23')](_0x3b04b7);};}exports[_0x8abb('0x24')]=function(_0x4205e0,_0x1b1ec5){var _0x2bb275={},_0x5edbe5={},_0x1c5697={'count':0x0,'rows':[]};var _0x5a2ca3=_['map'](db[_0x8abb('0x25')][_0x8abb('0x26')],function(_0x523d88){return{'name':_0x523d88[_0x8abb('0x27')],'type':_0x523d88['type']['key']};});_0x5edbe5[_0x8abb('0x28')]=_['map'](_0x5a2ca3,_0x8abb('0x22'));_0x5edbe5[_0x8abb('0x29')]=_[_0x8abb('0x2a')](_0x4205e0[_0x8abb('0x29')]);_0x5edbe5[_0x8abb('0x2b')]=_['intersection'](_0x5edbe5[_0x8abb('0x28')],_0x5edbe5[_0x8abb('0x29')]);_0x2bb275[_0x8abb('0x2c')]=_[_0x8abb('0x2d')](_0x5edbe5['model'],qs[_0x8abb('0x2e')](_0x4205e0[_0x8abb('0x29')][_0x8abb('0x2e')]));_0x2bb275['attributes']=_0x2bb275[_0x8abb('0x2c')][_0x8abb('0x2f')]?_0x2bb275[_0x8abb('0x2c')]:_0x5edbe5[_0x8abb('0x28')];if(!_0x4205e0['query']['hasOwnProperty']('nolimit')){_0x2bb275[_0x8abb('0x1b')]=qs['limit'](_0x4205e0['query']['limit']);_0x2bb275[_0x8abb('0x19')]=qs[_0x8abb('0x19')](_0x4205e0['query'][_0x8abb('0x19')]);}_0x2bb275[_0x8abb('0x30')]=qs[_0x8abb('0x31')](_0x4205e0['query'][_0x8abb('0x31')]);_0x2bb275[_0x8abb('0x32')]=qs[_0x8abb('0x2b')](_[_0x8abb('0x33')](_0x4205e0[_0x8abb('0x29')],_0x5edbe5['filters']),_0x5a2ca3);if(_0x4205e0['query'][_0x8abb('0x34')]){_0x2bb275[_0x8abb('0x32')]=_['merge'](_0x2bb275[_0x8abb('0x32')],{'$or':_[_0x8abb('0x35')](_0x5a2ca3,function(_0xc15cff){if(_0xc15cff[_0x8abb('0x36')]!=='VIRTUAL'){var _0x2136da={};_0x2136da[_0xc15cff['name']]={'$like':'%'+_0x4205e0[_0x8abb('0x29')][_0x8abb('0x34')]+'%'};return _0x2136da;}})});}_0x2bb275=_[_0x8abb('0x37')]({},_0x2bb275,_0x4205e0['options']);var _0x1f206b={'where':_0x2bb275[_0x8abb('0x32')]};return db[_0x8abb('0x25')][_0x8abb('0x1c')](_0x1f206b)[_0x8abb('0x1f')](function(_0x27b146){_0x1c5697['count']=_0x27b146;if(_0x4205e0['query'][_0x8abb('0x38')]){_0x2bb275[_0x8abb('0x39')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x8abb('0x3a')](_0x2bb275);})['then'](function(_0x34109d){_0x1c5697[_0x8abb('0x3b')]=_0x34109d;return _0x1c5697;})['then'](respondWithFilteredResult(_0x1b1ec5,_0x2bb275))['catch'](handleError(_0x1b1ec5,null));};exports[_0x8abb('0x3c')]=function(_0x3374cc,_0xa85e05){var _0x38a04c={'raw':![],'where':{'id':_0x3374cc[_0x8abb('0x3d')]['id']}},_0x576a9e={};_0x576a9e[_0x8abb('0x28')]=_[_0x8abb('0x2a')](db[_0x8abb('0x25')][_0x8abb('0x26')]);_0x576a9e[_0x8abb('0x29')]=_[_0x8abb('0x2a')](_0x3374cc[_0x8abb('0x29')]);_0x576a9e[_0x8abb('0x2b')]=_[_0x8abb('0x2d')](_0x576a9e[_0x8abb('0x28')],_0x576a9e['query']);_0x38a04c['attributes']=_['intersection'](_0x576a9e[_0x8abb('0x28')],qs[_0x8abb('0x2e')](_0x3374cc[_0x8abb('0x29')][_0x8abb('0x2e')]));_0x38a04c[_0x8abb('0x2c')]=_0x38a04c[_0x8abb('0x2c')][_0x8abb('0x2f')]?_0x38a04c[_0x8abb('0x2c')]:_0x576a9e[_0x8abb('0x28')];if(_0x3374cc[_0x8abb('0x29')][_0x8abb('0x38')]){_0x38a04c[_0x8abb('0x39')]=[{'all':!![]}];}_0x38a04c=_[_0x8abb('0x37')]({},_0x38a04c,_0x3374cc[_0x8abb('0x3e')]);return db[_0x8abb('0x25')][_0x8abb('0x3f')](_0x38a04c)[_0x8abb('0x1f')](handleEntityNotFound(_0xa85e05,null))['then'](respondWithResult(_0xa85e05,null))[_0x8abb('0x40')](handleError(_0xa85e05,null));};exports[_0x8abb('0x41')]=function(_0x217733,_0x88bb94){return db[_0x8abb('0x25')][_0x8abb('0x41')](_0x217733['body'],{})[_0x8abb('0x1f')](respondWithResult(_0x88bb94,0xc9))[_0x8abb('0x40')](handleError(_0x88bb94,null));};exports[_0x8abb('0x1e')]=function(_0x362289,_0x3dcd18){if(_0x362289[_0x8abb('0x42')]['id']){delete _0x362289['body']['id'];}return db[_0x8abb('0x25')][_0x8abb('0x3f')]({'where':{'id':_0x362289[_0x8abb('0x3d')]['id']}})[_0x8abb('0x1f')](handleEntityNotFound(_0x3dcd18,null))['then'](saveUpdates(_0x362289[_0x8abb('0x42')],null))[_0x8abb('0x1f')](respondWithResult(_0x3dcd18,null))[_0x8abb('0x40')](handleError(_0x3dcd18,null));};exports[_0x8abb('0x20')]=function(_0x3862e1,_0x3fcf32){return db[_0x8abb('0x25')]['find']({'where':{'id':_0x3862e1[_0x8abb('0x3d')]['id']}})[_0x8abb('0x1f')](handleEntityNotFound(_0x3fcf32,null))[_0x8abb('0x1f')](removeEntity(_0x3fcf32,null))[_0x8abb('0x40')](handleError(_0x3fcf32,null));};exports[_0x8abb('0x43')]=function(_0x3ec199,_0x58a8dd,_0x528864){var _0x1a3c03={};var _0x6fe0da={};var _0x4b1007;var _0xecbec3;return db['ZendeskConfiguration'][_0x8abb('0x44')]({'where':{'id':_0x3ec199['params']['id']}})[_0x8abb('0x1f')](handleEntityNotFound(_0x58a8dd,null))[_0x8abb('0x1f')](function(_0x36dc8c){if(_0x36dc8c){_0x4b1007=_0x36dc8c;_0x6fe0da[_0x8abb('0x28')]=_[_0x8abb('0x2a')](db[_0x8abb('0x45')]['rawAttributes']);_0x6fe0da[_0x8abb('0x29')]=_[_0x8abb('0x2a')](_0x3ec199['query']);_0x6fe0da[_0x8abb('0x2b')]=_[_0x8abb('0x2d')](_0x6fe0da[_0x8abb('0x28')],_0x6fe0da[_0x8abb('0x29')]);_0x1a3c03['attributes']=_['intersection'](_0x6fe0da[_0x8abb('0x28')],qs['fields'](_0x3ec199[_0x8abb('0x29')][_0x8abb('0x2e')]));_0x1a3c03[_0x8abb('0x2c')]=_0x1a3c03['attributes'][_0x8abb('0x2f')]?_0x1a3c03['attributes']:_0x6fe0da[_0x8abb('0x28')];_0x1a3c03[_0x8abb('0x30')]=qs[_0x8abb('0x31')](_0x3ec199[_0x8abb('0x29')][_0x8abb('0x31')]);_0x1a3c03['where']=qs[_0x8abb('0x2b')](_['pick'](_0x3ec199[_0x8abb('0x29')],_0x6fe0da[_0x8abb('0x2b')]));if(_0x3ec199['query']['filter']){_0x1a3c03['where']=_[_0x8abb('0x37')](_0x1a3c03[_0x8abb('0x32')],{'$or':_['map'](_0x1a3c03[_0x8abb('0x2c')],function(_0x2d0040){var _0x301ac7={};_0x301ac7[_0x2d0040]={'$like':'%'+_0x3ec199[_0x8abb('0x29')][_0x8abb('0x34')]+'%'};return _0x301ac7;})});}_0x1a3c03=_[_0x8abb('0x37')]({},_0x1a3c03,_0x3ec199['options']);return _0x4b1007['getFields'](_0x1a3c03);}})[_0x8abb('0x1f')](function(_0x20097c){if(_0x20097c){_0xecbec3=_0x20097c[_0x8abb('0x2f')];if(!_0x3ec199[_0x8abb('0x29')][_0x8abb('0x46')]('nolimit')){_0x1a3c03['limit']=qs[_0x8abb('0x1b')](_0x3ec199[_0x8abb('0x29')][_0x8abb('0x1b')]);_0x1a3c03[_0x8abb('0x19')]=qs[_0x8abb('0x19')](_0x3ec199[_0x8abb('0x29')][_0x8abb('0x19')]);}return _0x4b1007['getFields'](_0x1a3c03);}})[_0x8abb('0x1f')](function(_0x189437){if(_0x189437){return _0x189437?{'count':_0xecbec3,'rows':_0x189437}:null;}})['then'](respondWithResult(_0x58a8dd,null))[_0x8abb('0x40')](handleError(_0x58a8dd,null));};exports['getSubjects']=function(_0x47e1be,_0x42d605,_0x20938c){var _0x32d9cf={};var _0x23cf58={};var _0x2c462a;var _0x224bb2;return db[_0x8abb('0x25')]['findOne']({'where':{'id':_0x47e1be['params']['id']}})[_0x8abb('0x1f')](handleEntityNotFound(_0x42d605,null))['then'](function(_0x1334ff){if(_0x1334ff){_0x2c462a=_0x1334ff;_0x23cf58[_0x8abb('0x28')]=_[_0x8abb('0x2a')](db[_0x8abb('0x45')][_0x8abb('0x26')]);_0x23cf58[_0x8abb('0x29')]=_[_0x8abb('0x2a')](_0x47e1be['query']);_0x23cf58[_0x8abb('0x2b')]=_[_0x8abb('0x2d')](_0x23cf58['model'],_0x23cf58[_0x8abb('0x29')]);_0x32d9cf[_0x8abb('0x2c')]=_[_0x8abb('0x2d')](_0x23cf58[_0x8abb('0x28')],qs[_0x8abb('0x2e')](_0x47e1be[_0x8abb('0x29')][_0x8abb('0x2e')]));_0x32d9cf[_0x8abb('0x2c')]=_0x32d9cf['attributes'][_0x8abb('0x2f')]?_0x32d9cf[_0x8abb('0x2c')]:_0x23cf58[_0x8abb('0x28')];_0x32d9cf[_0x8abb('0x30')]=qs[_0x8abb('0x31')](_0x47e1be[_0x8abb('0x29')][_0x8abb('0x31')]);_0x32d9cf[_0x8abb('0x32')]=qs[_0x8abb('0x2b')](_[_0x8abb('0x33')](_0x47e1be[_0x8abb('0x29')],_0x23cf58['filters']));if(_0x47e1be[_0x8abb('0x29')][_0x8abb('0x34')]){_0x32d9cf[_0x8abb('0x32')]=_[_0x8abb('0x37')](_0x32d9cf[_0x8abb('0x32')],{'$or':_[_0x8abb('0x35')](_0x32d9cf[_0x8abb('0x2c')],function(_0xfd5b05){var _0x1669ef={};_0x1669ef[_0xfd5b05]={'$like':'%'+_0x47e1be[_0x8abb('0x29')][_0x8abb('0x34')]+'%'};return _0x1669ef;})});}_0x32d9cf=_[_0x8abb('0x37')]({},_0x32d9cf,_0x47e1be['options']);return _0x2c462a['getSubjects'](_0x32d9cf);}})[_0x8abb('0x1f')](function(_0x109435){if(_0x109435){_0x224bb2=_0x109435[_0x8abb('0x2f')];if(!_0x47e1be[_0x8abb('0x29')][_0x8abb('0x46')](_0x8abb('0x47'))){_0x32d9cf[_0x8abb('0x1b')]=qs[_0x8abb('0x1b')](_0x47e1be['query']['limit']);_0x32d9cf[_0x8abb('0x19')]=qs[_0x8abb('0x19')](_0x47e1be[_0x8abb('0x29')][_0x8abb('0x19')]);}return _0x2c462a[_0x8abb('0x48')](_0x32d9cf);}})[_0x8abb('0x1f')](function(_0x5064b5){if(_0x5064b5){return _0x5064b5?{'count':_0x224bb2,'rows':_0x5064b5}:null;}})[_0x8abb('0x1f')](respondWithResult(_0x42d605,null))['catch'](handleError(_0x42d605,null));};exports[_0x8abb('0x49')]=function(_0x4bc9e6,_0x3152cf,_0x1d29a8){var _0x11fcfa={};var _0x3f213c={};var _0x1b0ee4;var _0x162036;return db['ZendeskConfiguration'][_0x8abb('0x44')]({'where':{'id':_0x4bc9e6['params']['id']}})['then'](handleEntityNotFound(_0x3152cf,null))[_0x8abb('0x1f')](function(_0x130b06){if(_0x130b06){_0x1b0ee4=_0x130b06;_0x3f213c[_0x8abb('0x28')]=_[_0x8abb('0x2a')](db['ZendeskField'][_0x8abb('0x26')]);_0x3f213c[_0x8abb('0x29')]=_[_0x8abb('0x2a')](_0x4bc9e6['query']);_0x3f213c[_0x8abb('0x2b')]=_['intersection'](_0x3f213c[_0x8abb('0x28')],_0x3f213c[_0x8abb('0x29')]);_0x11fcfa['attributes']=_['intersection'](_0x3f213c[_0x8abb('0x28')],qs[_0x8abb('0x2e')](_0x4bc9e6[_0x8abb('0x29')][_0x8abb('0x2e')]));_0x11fcfa[_0x8abb('0x2c')]=_0x11fcfa[_0x8abb('0x2c')][_0x8abb('0x2f')]?_0x11fcfa[_0x8abb('0x2c')]:_0x3f213c[_0x8abb('0x28')];_0x11fcfa[_0x8abb('0x30')]=qs[_0x8abb('0x31')](_0x4bc9e6[_0x8abb('0x29')][_0x8abb('0x31')]);_0x11fcfa[_0x8abb('0x32')]=qs[_0x8abb('0x2b')](_[_0x8abb('0x33')](_0x4bc9e6['query'],_0x3f213c['filters']));if(_0x4bc9e6[_0x8abb('0x29')][_0x8abb('0x34')]){_0x11fcfa[_0x8abb('0x32')]=_[_0x8abb('0x37')](_0x11fcfa[_0x8abb('0x32')],{'$or':_[_0x8abb('0x35')](_0x11fcfa[_0x8abb('0x2c')],function(_0x4e4480){var _0x5e13b1={};_0x5e13b1[_0x4e4480]={'$like':'%'+_0x4bc9e6[_0x8abb('0x29')][_0x8abb('0x34')]+'%'};return _0x5e13b1;})});}_0x11fcfa=_[_0x8abb('0x37')]({},_0x11fcfa,_0x4bc9e6['options']);return _0x1b0ee4[_0x8abb('0x49')](_0x11fcfa);}})['then'](function(_0x2331be){if(_0x2331be){_0x162036=_0x2331be['length'];if(!_0x4bc9e6['query'][_0x8abb('0x46')](_0x8abb('0x47'))){_0x11fcfa[_0x8abb('0x1b')]=qs[_0x8abb('0x1b')](_0x4bc9e6[_0x8abb('0x29')][_0x8abb('0x1b')]);_0x11fcfa[_0x8abb('0x19')]=qs[_0x8abb('0x19')](_0x4bc9e6['query']['offset']);}return _0x1b0ee4[_0x8abb('0x49')](_0x11fcfa);}})[_0x8abb('0x1f')](function(_0x151a68){if(_0x151a68){return _0x151a68?{'count':_0x162036,'rows':_0x151a68}:null;}})['then'](respondWithResult(_0x3152cf,null))[_0x8abb('0x40')](handleError(_0x3152cf,null));};exports[_0x8abb('0x4a')]=function(_0xfe491c,_0x13445,_0x10228e){var _0x68fdbb={};var _0x523d0b={};var _0x4ad084;var _0x37aaad;return db[_0x8abb('0x25')][_0x8abb('0x44')]({'where':{'id':_0xfe491c[_0x8abb('0x3d')]['id']}})['then'](handleEntityNotFound(_0x13445,null))[_0x8abb('0x1f')](function(_0x4327ad){if(_0x4327ad){_0x4ad084=_0x4327ad;_0x523d0b[_0x8abb('0x28')]=_[_0x8abb('0x2a')](db[_0x8abb('0x4b')][_0x8abb('0x26')]);_0x523d0b[_0x8abb('0x29')]=_[_0x8abb('0x2a')](_0xfe491c['query']);_0x523d0b[_0x8abb('0x2b')]=_['intersection'](_0x523d0b['model'],_0x523d0b[_0x8abb('0x29')]);_0x68fdbb[_0x8abb('0x2c')]=_['intersection'](_0x523d0b['model'],qs[_0x8abb('0x2e')](_0xfe491c['query']['fields']));_0x68fdbb[_0x8abb('0x2c')]=_0x68fdbb[_0x8abb('0x2c')][_0x8abb('0x2f')]?_0x68fdbb['attributes']:_0x523d0b[_0x8abb('0x28')];_0x68fdbb[_0x8abb('0x30')]=qs[_0x8abb('0x31')](_0xfe491c[_0x8abb('0x29')]['sort']);_0x68fdbb['where']=qs[_0x8abb('0x2b')](_[_0x8abb('0x33')](_0xfe491c['query'],_0x523d0b[_0x8abb('0x2b')]));if(_0xfe491c['query']['filter']){_0x68fdbb[_0x8abb('0x32')]=_[_0x8abb('0x37')](_0x68fdbb['where'],{'$or':_[_0x8abb('0x35')](_0x68fdbb[_0x8abb('0x2c')],function(_0x379b58){var _0x198694={};_0x198694[_0x379b58]={'$like':'%'+_0xfe491c[_0x8abb('0x29')][_0x8abb('0x34')]+'%'};return _0x198694;})});}_0x68fdbb=_[_0x8abb('0x37')]({},_0x68fdbb,_0xfe491c[_0x8abb('0x3e')]);return _0x4ad084[_0x8abb('0x4a')](_0x68fdbb);}})['then'](function(_0x5d1376){if(_0x5d1376){_0x37aaad=_0x5d1376[_0x8abb('0x2f')];if(!_0xfe491c[_0x8abb('0x29')][_0x8abb('0x46')]('nolimit')){_0x68fdbb[_0x8abb('0x1b')]=qs[_0x8abb('0x1b')](_0xfe491c[_0x8abb('0x29')]['limit']);_0x68fdbb[_0x8abb('0x19')]=qs[_0x8abb('0x19')](_0xfe491c[_0x8abb('0x29')]['offset']);}return _0x4ad084[_0x8abb('0x4a')](_0x68fdbb);}})['then'](function(_0x355f69){if(_0x355f69){return _0x355f69?{'count':_0x37aaad,'rows':_0x355f69}:null;}})[_0x8abb('0x1f')](respondWithResult(_0x13445,null))[_0x8abb('0x40')](handleError(_0x13445,null));};exports['setTags']=function(_0x2981ed,_0x4936a3,_0x30b7e0){if(_0x2981ed[_0x8abb('0x42')]['id']){delete _0x2981ed['body']['id'];}return db[_0x8abb('0x25')][_0x8abb('0x44')]({'where':{'id':_0x2981ed[_0x8abb('0x3d')]['id']}})[_0x8abb('0x1f')](handleEntityNotFound(_0x4936a3,null))[_0x8abb('0x1f')](function(_0x21140a){if(_0x21140a){return _0x21140a[_0x8abb('0x4c')](_0x2981ed[_0x8abb('0x42')][_0x8abb('0x4d')]||[]);}return null;})['then'](respondWithResult(_0x4936a3,null))['catch'](handleError(_0x4936a3,null));};
\ No newline at end of file
+var _0x1038=['undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','ZendeskConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','rows','catch','params','keys','rawAttributes','include','merge','find','create','body','getFields','ZendeskField','pick','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x58690c,_0x3def58){var _0x43ba1b=function(_0x53d88d){while(--_0x53d88d){_0x58690c['push'](_0x58690c['shift']());}};_0x43ba1b(++_0x3def58);}(_0x1038,0xd9));var _0x8103=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x1038[_0x2a8860];return _0x2f47a4;};'use strict';var emlformat=require(_0x8103('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8103('0x1'));var rp=require('request-promise');var moment=require(_0x8103('0x2'));var BPromise=require(_0x8103('0x3'));var Mustache=require(_0x8103('0x4'));var util=require(_0x8103('0x5'));var path=require(_0x8103('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8103('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8103('0x8'));var crypto=require(_0x8103('0x9'));var jsforce=require(_0x8103('0xa'));var deskjs=require(_0x8103('0xb'));var toCsv=require(_0x8103('0xc'));var querystring=require('querystring');var Papa=require(_0x8103('0xd'));var Redis=require(_0x8103('0xe'));var authService=require(_0x8103('0xf'));var qs=require(_0x8103('0x10'));var as=require(_0x8103('0x11'));var hardwareService=require(_0x8103('0x12'));var logger=require(_0x8103('0x13'))(_0x8103('0x14'));var utils=require(_0x8103('0x15'));var config=require(_0x8103('0x16'));var licenseUtil=require(_0x8103('0x17'));var db=require(_0x8103('0x18'))['db'];function respondWithStatusCode(_0xb2f21e,_0x3d5a48){_0x3d5a48=_0x3d5a48||0xcc;return function(_0x4a353a){if(_0x4a353a){return _0xb2f21e[_0x8103('0x19')](_0x3d5a48);}return _0xb2f21e[_0x8103('0x1a')](_0x3d5a48)['end']();};}function respondWithResult(_0x414e61,_0x15981f){_0x15981f=_0x15981f||0xc8;return function(_0x2fd2a4){if(_0x2fd2a4){return _0x414e61['status'](_0x15981f)[_0x8103('0x1b')](_0x2fd2a4);}};}function respondWithFilteredResult(_0x5484a4,_0x418bb3){return function(_0x4f33c6){if(_0x4f33c6){var _0xb7408d=typeof _0x418bb3[_0x8103('0x1c')]===_0x8103('0x1d')&&typeof _0x418bb3[_0x8103('0x1e')]===_0x8103('0x1d');var _0x12f644=_0x4f33c6[_0x8103('0x1f')];var _0x95b0d7=_0xb7408d?0x0:_0x418bb3[_0x8103('0x1c')];var _0x166d0f=_0xb7408d?_0x4f33c6[_0x8103('0x1f')]:_0x418bb3['offset']+_0x418bb3[_0x8103('0x1e')];var _0x5377cc;if(_0x166d0f>=_0x12f644){_0x166d0f=_0x12f644;_0x5377cc=0xc8;}else{_0x5377cc=0xce;}_0x5484a4[_0x8103('0x1a')](_0x5377cc);return _0x5484a4[_0x8103('0x20')](_0x8103('0x21'),_0x95b0d7+'-'+_0x166d0f+'/'+_0x12f644)[_0x8103('0x1b')](_0x4f33c6);}return null;};}function patchUpdates(_0x4921c8){return function(_0x3b3e41){try{jsonpatch['apply'](_0x3b3e41,_0x4921c8,!![]);}catch(_0x4cea50){return BPromise[_0x8103('0x22')](_0x4cea50);}return _0x3b3e41[_0x8103('0x23')]();};}function saveUpdates(_0x59387a,_0x537cfd){return function(_0xc01915){if(_0xc01915){return _0xc01915[_0x8103('0x24')](_0x59387a)['then'](function(_0x32e015){return _0x32e015;});}return null;};}function removeEntity(_0xae7d5d,_0x5aef38){return function(_0x31f524){if(_0x31f524){return _0x31f524[_0x8103('0x25')]()[_0x8103('0x26')](function(){_0xae7d5d[_0x8103('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d3d0,_0x25de21){return function(_0x5077a5){if(!_0x5077a5){_0x21d3d0['sendStatus'](0x194);}return _0x5077a5;};}function handleError(_0x4bcfde,_0x2ad859){_0x2ad859=_0x2ad859||0x1f4;return function(_0x2082c1){logger['error'](_0x2082c1[_0x8103('0x27')]);if(_0x2082c1[_0x8103('0x28')]){delete _0x2082c1[_0x8103('0x28')];}_0x4bcfde[_0x8103('0x1a')](_0x2ad859)[_0x8103('0x29')](_0x2082c1);};}exports['index']=function(_0x47c9b0,_0x416425){var _0x3e5f3a={},_0x5c83d8={},_0x193338={'count':0x0,'rows':[]};var _0x434ad6=_[_0x8103('0x2a')](db[_0x8103('0x2b')]['rawAttributes'],function(_0x38d682){return{'name':_0x38d682[_0x8103('0x2c')],'type':_0x38d682[_0x8103('0x2d')][_0x8103('0x2e')]};});_0x5c83d8[_0x8103('0x2f')]=_['map'](_0x434ad6,'name');_0x5c83d8[_0x8103('0x30')]=_['keys'](_0x47c9b0[_0x8103('0x30')]);_0x5c83d8[_0x8103('0x31')]=_[_0x8103('0x32')](_0x5c83d8[_0x8103('0x2f')],_0x5c83d8[_0x8103('0x30')]);_0x3e5f3a[_0x8103('0x33')]=_[_0x8103('0x32')](_0x5c83d8[_0x8103('0x2f')],qs[_0x8103('0x34')](_0x47c9b0[_0x8103('0x30')][_0x8103('0x34')]));_0x3e5f3a[_0x8103('0x33')]=_0x3e5f3a[_0x8103('0x33')][_0x8103('0x35')]?_0x3e5f3a[_0x8103('0x33')]:_0x5c83d8[_0x8103('0x2f')];if(!_0x47c9b0[_0x8103('0x30')][_0x8103('0x36')](_0x8103('0x37'))){_0x3e5f3a[_0x8103('0x1e')]=qs[_0x8103('0x1e')](_0x47c9b0['query'][_0x8103('0x1e')]);_0x3e5f3a[_0x8103('0x1c')]=qs[_0x8103('0x1c')](_0x47c9b0[_0x8103('0x30')]['offset']);}_0x3e5f3a[_0x8103('0x38')]=qs['sort'](_0x47c9b0[_0x8103('0x30')][_0x8103('0x39')]);_0x3e5f3a[_0x8103('0x3a')]=qs['filters'](_['pick'](_0x47c9b0[_0x8103('0x30')],_0x5c83d8[_0x8103('0x31')]),_0x434ad6);if(_0x47c9b0['query'][_0x8103('0x3b')]){_0x3e5f3a[_0x8103('0x3a')]=_['merge'](_0x3e5f3a['where'],{'$or':_[_0x8103('0x2a')](_0x434ad6,function(_0x318927){if(_0x318927[_0x8103('0x2d')]!==_0x8103('0x3c')){var _0x4929e0={};_0x4929e0[_0x318927['name']]={'$like':'%'+_0x47c9b0[_0x8103('0x30')][_0x8103('0x3b')]+'%'};return _0x4929e0;}})});}_0x3e5f3a=_['merge']({},_0x3e5f3a,_0x47c9b0[_0x8103('0x3d')]);var _0x1a0103={'where':_0x3e5f3a[_0x8103('0x3a')]};return db['ZendeskConfiguration'][_0x8103('0x1f')](_0x1a0103)[_0x8103('0x26')](function(_0x322167){_0x193338['count']=_0x322167;if(_0x47c9b0[_0x8103('0x30')][_0x8103('0x3e')]){_0x3e5f3a['include']=[{'all':!![]}];}return db[_0x8103('0x2b')]['findAll'](_0x3e5f3a);})[_0x8103('0x26')](function(_0x4b1a40){_0x193338[_0x8103('0x3f')]=_0x4b1a40;return _0x193338;})[_0x8103('0x26')](respondWithFilteredResult(_0x416425,_0x3e5f3a))[_0x8103('0x40')](handleError(_0x416425,null));};exports['show']=function(_0x233ec4,_0x4e6ce4){var _0x2baa88={'raw':![],'where':{'id':_0x233ec4[_0x8103('0x41')]['id']}},_0x406863={};_0x406863[_0x8103('0x2f')]=_[_0x8103('0x42')](db['ZendeskConfiguration'][_0x8103('0x43')]);_0x406863[_0x8103('0x30')]=_[_0x8103('0x42')](_0x233ec4[_0x8103('0x30')]);_0x406863[_0x8103('0x31')]=_[_0x8103('0x32')](_0x406863['model'],_0x406863[_0x8103('0x30')]);_0x2baa88[_0x8103('0x33')]=_[_0x8103('0x32')](_0x406863[_0x8103('0x2f')],qs[_0x8103('0x34')](_0x233ec4[_0x8103('0x30')]['fields']));_0x2baa88[_0x8103('0x33')]=_0x2baa88[_0x8103('0x33')]['length']?_0x2baa88[_0x8103('0x33')]:_0x406863['model'];if(_0x233ec4[_0x8103('0x30')][_0x8103('0x3e')]){_0x2baa88[_0x8103('0x44')]=[{'all':!![]}];}_0x2baa88=_[_0x8103('0x45')]({},_0x2baa88,_0x233ec4[_0x8103('0x3d')]);return db[_0x8103('0x2b')][_0x8103('0x46')](_0x2baa88)['then'](handleEntityNotFound(_0x4e6ce4,null))[_0x8103('0x26')](respondWithResult(_0x4e6ce4,null))[_0x8103('0x40')](handleError(_0x4e6ce4,null));};exports['create']=function(_0x185dcf,_0x30af5f){return db[_0x8103('0x2b')][_0x8103('0x47')](_0x185dcf[_0x8103('0x48')],{})[_0x8103('0x26')](respondWithResult(_0x30af5f,0xc9))[_0x8103('0x40')](handleError(_0x30af5f,null));};exports[_0x8103('0x24')]=function(_0xdf8cad,_0x1dbd9b){if(_0xdf8cad[_0x8103('0x48')]['id']){delete _0xdf8cad[_0x8103('0x48')]['id'];}return db[_0x8103('0x2b')][_0x8103('0x46')]({'where':{'id':_0xdf8cad[_0x8103('0x41')]['id']}})[_0x8103('0x26')](handleEntityNotFound(_0x1dbd9b,null))[_0x8103('0x26')](saveUpdates(_0xdf8cad[_0x8103('0x48')],null))[_0x8103('0x26')](respondWithResult(_0x1dbd9b,null))['catch'](handleError(_0x1dbd9b,null));};exports[_0x8103('0x25')]=function(_0x2afb0d,_0x35568f){return db[_0x8103('0x2b')]['find']({'where':{'id':_0x2afb0d[_0x8103('0x41')]['id']}})['then'](handleEntityNotFound(_0x35568f,null))['then'](removeEntity(_0x35568f,null))[_0x8103('0x40')](handleError(_0x35568f,null));};exports[_0x8103('0x49')]=function(_0xfaaced,_0x6f6641,_0xff7c03){var _0x436609={};var _0xf1ae5a={};var _0xb24571;var _0x230543;return db[_0x8103('0x2b')]['findOne']({'where':{'id':_0xfaaced[_0x8103('0x41')]['id']}})[_0x8103('0x26')](handleEntityNotFound(_0x6f6641,null))[_0x8103('0x26')](function(_0x422d3f){if(_0x422d3f){_0xb24571=_0x422d3f;_0xf1ae5a[_0x8103('0x2f')]=_[_0x8103('0x42')](db[_0x8103('0x4a')][_0x8103('0x43')]);_0xf1ae5a['query']=_['keys'](_0xfaaced['query']);_0xf1ae5a[_0x8103('0x31')]=_[_0x8103('0x32')](_0xf1ae5a['model'],_0xf1ae5a['query']);_0x436609[_0x8103('0x33')]=_[_0x8103('0x32')](_0xf1ae5a['model'],qs['fields'](_0xfaaced[_0x8103('0x30')][_0x8103('0x34')]));_0x436609['attributes']=_0x436609[_0x8103('0x33')][_0x8103('0x35')]?_0x436609[_0x8103('0x33')]:_0xf1ae5a['model'];_0x436609[_0x8103('0x38')]=qs[_0x8103('0x39')](_0xfaaced[_0x8103('0x30')][_0x8103('0x39')]);_0x436609[_0x8103('0x3a')]=qs[_0x8103('0x31')](_[_0x8103('0x4b')](_0xfaaced['query'],_0xf1ae5a[_0x8103('0x31')]));if(_0xfaaced[_0x8103('0x30')][_0x8103('0x3b')]){_0x436609[_0x8103('0x3a')]=_[_0x8103('0x45')](_0x436609['where'],{'$or':_['map'](_0x436609[_0x8103('0x33')],function(_0x32987e){var _0x372e75={};_0x372e75[_0x32987e]={'$like':'%'+_0xfaaced['query'][_0x8103('0x3b')]+'%'};return _0x372e75;})});}_0x436609=_[_0x8103('0x45')]({},_0x436609,_0xfaaced['options']);return _0xb24571[_0x8103('0x49')](_0x436609);}})[_0x8103('0x26')](function(_0x3d9894){if(_0x3d9894){_0x230543=_0x3d9894['length'];if(!_0xfaaced[_0x8103('0x30')]['hasOwnProperty'](_0x8103('0x37'))){_0x436609[_0x8103('0x1e')]=qs[_0x8103('0x1e')](_0xfaaced['query']['limit']);_0x436609[_0x8103('0x1c')]=qs[_0x8103('0x1c')](_0xfaaced['query'][_0x8103('0x1c')]);}return _0xb24571['getFields'](_0x436609);}})[_0x8103('0x26')](function(_0x34b624){if(_0x34b624){return _0x34b624?{'count':_0x230543,'rows':_0x34b624}:null;}})[_0x8103('0x26')](respondWithResult(_0x6f6641,null))['catch'](handleError(_0x6f6641,null));};exports[_0x8103('0x4c')]=function(_0x56084a,_0x3e8c7c,_0x470acb){var _0x17d1d3={};var _0x40fd35={};var _0x5c7e49;var _0x11defa;return db[_0x8103('0x2b')][_0x8103('0x4d')]({'where':{'id':_0x56084a[_0x8103('0x41')]['id']}})[_0x8103('0x26')](handleEntityNotFound(_0x3e8c7c,null))['then'](function(_0x32c024){if(_0x32c024){_0x5c7e49=_0x32c024;_0x40fd35[_0x8103('0x2f')]=_[_0x8103('0x42')](db[_0x8103('0x4a')][_0x8103('0x43')]);_0x40fd35[_0x8103('0x30')]=_[_0x8103('0x42')](_0x56084a[_0x8103('0x30')]);_0x40fd35[_0x8103('0x31')]=_[_0x8103('0x32')](_0x40fd35[_0x8103('0x2f')],_0x40fd35[_0x8103('0x30')]);_0x17d1d3[_0x8103('0x33')]=_[_0x8103('0x32')](_0x40fd35['model'],qs[_0x8103('0x34')](_0x56084a['query']['fields']));_0x17d1d3[_0x8103('0x33')]=_0x17d1d3[_0x8103('0x33')][_0x8103('0x35')]?_0x17d1d3[_0x8103('0x33')]:_0x40fd35[_0x8103('0x2f')];_0x17d1d3[_0x8103('0x38')]=qs[_0x8103('0x39')](_0x56084a['query'][_0x8103('0x39')]);_0x17d1d3[_0x8103('0x3a')]=qs['filters'](_[_0x8103('0x4b')](_0x56084a[_0x8103('0x30')],_0x40fd35[_0x8103('0x31')]));if(_0x56084a[_0x8103('0x30')]['filter']){_0x17d1d3[_0x8103('0x3a')]=_['merge'](_0x17d1d3[_0x8103('0x3a')],{'$or':_['map'](_0x17d1d3[_0x8103('0x33')],function(_0x3ea554){var _0x36c921={};_0x36c921[_0x3ea554]={'$like':'%'+_0x56084a[_0x8103('0x30')][_0x8103('0x3b')]+'%'};return _0x36c921;})});}_0x17d1d3=_[_0x8103('0x45')]({},_0x17d1d3,_0x56084a[_0x8103('0x3d')]);return _0x5c7e49[_0x8103('0x4c')](_0x17d1d3);}})[_0x8103('0x26')](function(_0x4959e1){if(_0x4959e1){_0x11defa=_0x4959e1[_0x8103('0x35')];if(!_0x56084a[_0x8103('0x30')][_0x8103('0x36')](_0x8103('0x37'))){_0x17d1d3[_0x8103('0x1e')]=qs[_0x8103('0x1e')](_0x56084a['query']['limit']);_0x17d1d3[_0x8103('0x1c')]=qs[_0x8103('0x1c')](_0x56084a[_0x8103('0x30')][_0x8103('0x1c')]);}return _0x5c7e49[_0x8103('0x4c')](_0x17d1d3);}})[_0x8103('0x26')](function(_0x196720){if(_0x196720){return _0x196720?{'count':_0x11defa,'rows':_0x196720}:null;}})[_0x8103('0x26')](respondWithResult(_0x3e8c7c,null))[_0x8103('0x40')](handleError(_0x3e8c7c,null));};exports[_0x8103('0x4e')]=function(_0x457e9e,_0x7ca799,_0x568589){var _0x1bf462={};var _0x5d5c23={};var _0x20a5b8;var _0x5efa28;return db[_0x8103('0x2b')][_0x8103('0x4d')]({'where':{'id':_0x457e9e[_0x8103('0x41')]['id']}})['then'](handleEntityNotFound(_0x7ca799,null))[_0x8103('0x26')](function(_0x49f655){if(_0x49f655){_0x20a5b8=_0x49f655;_0x5d5c23['model']=_[_0x8103('0x42')](db[_0x8103('0x4a')]['rawAttributes']);_0x5d5c23[_0x8103('0x30')]=_[_0x8103('0x42')](_0x457e9e[_0x8103('0x30')]);_0x5d5c23[_0x8103('0x31')]=_[_0x8103('0x32')](_0x5d5c23['model'],_0x5d5c23['query']);_0x1bf462[_0x8103('0x33')]=_['intersection'](_0x5d5c23[_0x8103('0x2f')],qs['fields'](_0x457e9e[_0x8103('0x30')][_0x8103('0x34')]));_0x1bf462['attributes']=_0x1bf462[_0x8103('0x33')][_0x8103('0x35')]?_0x1bf462[_0x8103('0x33')]:_0x5d5c23[_0x8103('0x2f')];_0x1bf462['order']=qs['sort'](_0x457e9e[_0x8103('0x30')]['sort']);_0x1bf462[_0x8103('0x3a')]=qs[_0x8103('0x31')](_[_0x8103('0x4b')](_0x457e9e['query'],_0x5d5c23[_0x8103('0x31')]));if(_0x457e9e[_0x8103('0x30')][_0x8103('0x3b')]){_0x1bf462[_0x8103('0x3a')]=_[_0x8103('0x45')](_0x1bf462['where'],{'$or':_[_0x8103('0x2a')](_0x1bf462[_0x8103('0x33')],function(_0xee87f0){var _0xda0d63={};_0xda0d63[_0xee87f0]={'$like':'%'+_0x457e9e[_0x8103('0x30')][_0x8103('0x3b')]+'%'};return _0xda0d63;})});}_0x1bf462=_['merge']({},_0x1bf462,_0x457e9e[_0x8103('0x3d')]);return _0x20a5b8[_0x8103('0x4e')](_0x1bf462);}})[_0x8103('0x26')](function(_0x1344ce){if(_0x1344ce){_0x5efa28=_0x1344ce['length'];if(!_0x457e9e['query']['hasOwnProperty'](_0x8103('0x37'))){_0x1bf462[_0x8103('0x1e')]=qs[_0x8103('0x1e')](_0x457e9e[_0x8103('0x30')][_0x8103('0x1e')]);_0x1bf462['offset']=qs[_0x8103('0x1c')](_0x457e9e[_0x8103('0x30')]['offset']);}return _0x20a5b8[_0x8103('0x4e')](_0x1bf462);}})[_0x8103('0x26')](function(_0x176773){if(_0x176773){return _0x176773?{'count':_0x5efa28,'rows':_0x176773}:null;}})[_0x8103('0x26')](respondWithResult(_0x7ca799,null))[_0x8103('0x40')](handleError(_0x7ca799,null));};exports[_0x8103('0x4f')]=function(_0x28df4f,_0x497751,_0x118253){var _0x2c02f8={};var _0x580ec5={};var _0x398d32;var _0x18cd6c;return db[_0x8103('0x2b')][_0x8103('0x4d')]({'where':{'id':_0x28df4f[_0x8103('0x41')]['id']}})[_0x8103('0x26')](handleEntityNotFound(_0x497751,null))[_0x8103('0x26')](function(_0x212a1a){if(_0x212a1a){_0x398d32=_0x212a1a;_0x580ec5[_0x8103('0x2f')]=_[_0x8103('0x42')](db[_0x8103('0x50')]['rawAttributes']);_0x580ec5[_0x8103('0x30')]=_['keys'](_0x28df4f['query']);_0x580ec5[_0x8103('0x31')]=_['intersection'](_0x580ec5[_0x8103('0x2f')],_0x580ec5['query']);_0x2c02f8[_0x8103('0x33')]=_['intersection'](_0x580ec5[_0x8103('0x2f')],qs[_0x8103('0x34')](_0x28df4f[_0x8103('0x30')][_0x8103('0x34')]));_0x2c02f8[_0x8103('0x33')]=_0x2c02f8[_0x8103('0x33')]['length']?_0x2c02f8['attributes']:_0x580ec5[_0x8103('0x2f')];_0x2c02f8[_0x8103('0x38')]=qs[_0x8103('0x39')](_0x28df4f[_0x8103('0x30')]['sort']);_0x2c02f8[_0x8103('0x3a')]=qs[_0x8103('0x31')](_[_0x8103('0x4b')](_0x28df4f['query'],_0x580ec5['filters']));if(_0x28df4f[_0x8103('0x30')]['filter']){_0x2c02f8[_0x8103('0x3a')]=_[_0x8103('0x45')](_0x2c02f8[_0x8103('0x3a')],{'$or':_[_0x8103('0x2a')](_0x2c02f8[_0x8103('0x33')],function(_0x79ebf7){var _0x3d7e4={};_0x3d7e4[_0x79ebf7]={'$like':'%'+_0x28df4f[_0x8103('0x30')][_0x8103('0x3b')]+'%'};return _0x3d7e4;})});}_0x2c02f8=_[_0x8103('0x45')]({},_0x2c02f8,_0x28df4f['options']);return _0x398d32['getTags'](_0x2c02f8);}})[_0x8103('0x26')](function(_0x2fc97b){if(_0x2fc97b){_0x18cd6c=_0x2fc97b[_0x8103('0x35')];if(!_0x28df4f[_0x8103('0x30')][_0x8103('0x36')](_0x8103('0x37'))){_0x2c02f8[_0x8103('0x1e')]=qs['limit'](_0x28df4f[_0x8103('0x30')][_0x8103('0x1e')]);_0x2c02f8[_0x8103('0x1c')]=qs[_0x8103('0x1c')](_0x28df4f['query'][_0x8103('0x1c')]);}return _0x398d32['getTags'](_0x2c02f8);}})[_0x8103('0x26')](function(_0x40dc7d){if(_0x40dc7d){return _0x40dc7d?{'count':_0x18cd6c,'rows':_0x40dc7d}:null;}})[_0x8103('0x26')](respondWithResult(_0x497751,null))[_0x8103('0x40')](handleError(_0x497751,null));};exports[_0x8103('0x51')]=function(_0x2f62cd,_0x1ee2bf,_0x529cfd){if(_0x2f62cd[_0x8103('0x48')]['id']){delete _0x2f62cd[_0x8103('0x48')]['id'];}return db[_0x8103('0x2b')]['findOne']({'where':{'id':_0x2f62cd[_0x8103('0x41')]['id']}})['then'](handleEntityNotFound(_0x1ee2bf,null))['then'](function(_0x24bab0){if(_0x24bab0){return _0x24bab0[_0x8103('0x51')](_0x2f62cd[_0x8103('0x48')]['ids']||[]);}return null;})['then'](respondWithResult(_0x1ee2bf,null))[_0x8103('0x40')](handleError(_0x1ee2bf,null));};
\ No newline at end of file
index 0a6490c..a1b5a06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ec6=['int_zendesk_configurations','lodash','util','../../config/logger','moment','request-promise','rimraf','./intZendeskConfiguration.attributes','ZendeskConfiguration'];(function(_0xf32c6d,_0x372704){var _0x156c11=function(_0x34ef76){while(--_0x34ef76){_0xf32c6d['push'](_0xf32c6d['shift']());}};_0x156c11(++_0x372704);}(_0x5ec6,0x7f));var _0x65ec=function(_0x38c10d,_0x1244d5){_0x38c10d=_0x38c10d-0x0;var _0x432e83=_0x5ec6[_0x38c10d];return _0x432e83;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var logger=require(_0x65ec('0x2'))('api');var moment=require(_0x65ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x65ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65ec('0x5'));var config=require('../../config/environment');var attributes=require(_0x65ec('0x6'));module['exports']=function(_0x2fc973,_0xbb2e56){return _0x2fc973['define'](_0x65ec('0x7'),attributes,{'tableName':_0x65ec('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9348=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5a24d1,_0x1f89b7){var _0x345a50=function(_0x4ea04d){while(--_0x4ea04d){_0x5a24d1['push'](_0x5a24d1['shift']());}};_0x345a50(++_0x1f89b7);}(_0x9348,0x10d));var _0x8934=function(_0x470c47,_0x102f35){_0x470c47=_0x470c47-0x0;var _0x4e0955=_0x9348[_0x470c47];return _0x4e0955;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4dc0736..1c79fdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x139e=['ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x258d00,_0x3ea6df){var _0x1df06a=function(_0xf2507c){while(--_0xf2507c){_0x258d00['push'](_0x258d00['shift']());}};_0x1df06a(++_0x3ea6df);}(_0x139e,0x94));var _0xe139=function(_0x50ebb9,_0x312fa7){_0x50ebb9=_0x50ebb9-0x0;var _0x5965f3=_0x139e[_0x50ebb9];return _0x5965f3;};'use strict';var _=require('lodash');var util=require(_0xe139('0x0'));var moment=require(_0xe139('0x1'));var BPromise=require(_0xe139('0x2'));var rs=require(_0xe139('0x3'));var fs=require('fs');var Redis=require(_0xe139('0x4'));var db=require(_0xe139('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe139('0x6'))(_0xe139('0x7'));var config=require(_0xe139('0x8'));var jayson=require(_0xe139('0x9'));var client=jayson[_0xe139('0xa')][_0xe139('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x344f78,_0x450799,_0x1ffa8f){return new BPromise(function(_0x3a5a1,_0x41895a){return client[_0xe139('0xc')](_0x344f78,_0x1ffa8f)[_0xe139('0xd')](function(_0xbd7328){logger[_0xe139('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x450799,_0xe139('0xf'));logger[_0xe139('0x10')](_0xe139('0x11'),_0x450799,_0xe139('0xf'),JSON[_0xe139('0x12')](_0xbd7328));if(_0xbd7328[_0xe139('0x13')]){if(_0xbd7328[_0xe139('0x13')]['code']===0x1f4){logger[_0xe139('0x13')](_0xe139('0x14'),_0x450799,_0xbd7328['error'][_0xe139('0x15')]);return _0x41895a(_0xbd7328['error']['message']);}logger[_0xe139('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x450799,_0xbd7328[_0xe139('0x13')][_0xe139('0x15')]);return _0x3a5a1(_0xbd7328[_0xe139('0x13')][_0xe139('0x15')]);}else{logger[_0xe139('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x450799,_0xe139('0xf'));_0x3a5a1(_0xbd7328[_0xe139('0x16')][_0xe139('0x15')]);}})[_0xe139('0x17')](function(_0x38676e){logger[_0xe139('0x13')](_0xe139('0x14'),_0x450799,_0x38676e);_0x41895a(_0x38676e);});});}
\ No newline at end of file
+var _0x4445=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x380475,_0x522e21){var _0x5dbe09=function(_0x27d5dd){while(--_0x27d5dd){_0x380475['push'](_0x380475['shift']());}};_0x5dbe09(++_0x522e21);}(_0x4445,0xc5));var _0x5444=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0x4445[_0x590851];return _0x3b0115;};'use strict';var _=require(_0x5444('0x0'));var util=require(_0x5444('0x1'));var moment=require(_0x5444('0x2'));var BPromise=require(_0x5444('0x3'));var rs=require(_0x5444('0x4'));var fs=require('fs');var Redis=require(_0x5444('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5444('0x6'));var logger=require(_0x5444('0x7'))(_0x5444('0x8'));var config=require(_0x5444('0x9'));var jayson=require(_0x5444('0xa'));var client=jayson[_0x5444('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a79c1,_0x20df03,_0x21aebd){return new BPromise(function(_0x4ea405,_0x2f04e0){return client['request'](_0x4a79c1,_0x21aebd)['then'](function(_0xe3b359){logger[_0x5444('0xc')](_0x5444('0xd'),_0x20df03,_0x5444('0xe'));logger['debug'](_0x5444('0xf'),_0x20df03,_0x5444('0xe'),JSON[_0x5444('0x10')](_0xe3b359));if(_0xe3b359[_0x5444('0x11')]){if(_0xe3b359['error'][_0x5444('0x12')]===0x1f4){logger[_0x5444('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x20df03,_0xe3b359['error'][_0x5444('0x13')]);return _0x2f04e0(_0xe3b359[_0x5444('0x11')]['message']);}logger[_0x5444('0x11')](_0x5444('0xd'),_0x20df03,_0xe3b359['error'][_0x5444('0x13')]);return _0x4ea405(_0xe3b359[_0x5444('0x11')][_0x5444('0x13')]);}else{logger[_0x5444('0xc')](_0x5444('0xd'),_0x20df03,_0x5444('0xe'));_0x4ea405(_0xe3b359[_0x5444('0x14')][_0x5444('0x13')]);}})[_0x5444('0x15')](function(_0x3cac09){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x20df03,_0x3cac09);_0x2f04e0(_0x3cac09);});});}
\ No newline at end of file
index f0d4329..3297e22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8ba=['isAuthenticated','/:id','show','post','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZendeskField.controller','get'];(function(_0x53bfec,_0x19b181){var _0x5817b8=function(_0x19c255){while(--_0x19c255){_0x53bfec['push'](_0x53bfec['shift']());}};_0x5817b8(++_0x19b181);}(_0xe8ba,0xb8));var _0xae8b=function(_0x359812,_0x471534){_0x359812=_0x359812-0x0;var _0x2b30bf=_0xe8ba[_0x359812];return _0x2b30bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae8b('0x0'));var timeout=require(_0xae8b('0x1'));var express=require(_0xae8b('0x2'));var router=express[_0xae8b('0x3')]();var fs_extra=require(_0xae8b('0x4'));var auth=require(_0xae8b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xae8b('0x6'));router[_0xae8b('0x7')]('/',auth[_0xae8b('0x8')](),controller['index']);router[_0xae8b('0x7')](_0xae8b('0x9'),auth['isAuthenticated'](),controller[_0xae8b('0xa')]);router[_0xae8b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xae8b('0xc')](_0xae8b('0x9'),auth[_0xae8b('0x8')](),controller[_0xae8b('0xd')]);router[_0xae8b('0xe')](_0xae8b('0x9'),auth['isAuthenticated'](),controller[_0xae8b('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x006a=['show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id'];(function(_0x3cbbfb,_0x7f113d){var _0x97b20d=function(_0x4599c9){while(--_0x4599c9){_0x3cbbfb['push'](_0x3cbbfb['shift']());}};_0x97b20d(++_0x7f113d);}(_0x006a,0x8b));var _0xa006=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0x006a[_0x3dfeb9];return _0x412314;};'use strict';var multer=require(_0xa006('0x0'));var util=require(_0xa006('0x1'));var path=require(_0xa006('0x2'));var timeout=require(_0xa006('0x3'));var express=require(_0xa006('0x4'));var router=express[_0xa006('0x5')]();var fs_extra=require(_0xa006('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa006('0x7'));var config=require(_0xa006('0x8'));var controller=require(_0xa006('0x9'));router[_0xa006('0xa')]('/',auth[_0xa006('0xb')](),controller['index']);router[_0xa006('0xa')](_0xa006('0xc'),auth[_0xa006('0xb')](),controller[_0xa006('0xd')]);router[_0xa006('0xe')]('/',auth[_0xa006('0xb')](),controller[_0xa006('0xf')]);router['put'](_0xa006('0xc'),auth['isAuthenticated'](),controller[_0xa006('0x10')]);router[_0xa006('0x11')](_0xa006('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa006('0x12')]=router;
\ No newline at end of file
index e9341e8..1352af5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d39=['variable','picklist','string','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x18865e,_0x4d003f){var _0x13b632=function(_0x106e3f){while(--_0x106e3f){_0x18865e['push'](_0x18865e['shift']());}};_0x13b632(++_0x4d003f);}(_0x3d39,0x194));var _0x93d3=function(_0x33c9ce,_0x271ca8){_0x33c9ce=_0x33c9ce-0x0;var _0xc51b01=_0x3d39[_0x33c9ce];return _0xc51b01;};'use strict';var Sequelize=require(_0x93d3('0x0'));module['exports']={'type':{'type':Sequelize[_0x93d3('0x1')]('string',_0x93d3('0x2'),'customVariable','keyValue',_0x93d3('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x93d3('0x1')](_0x93d3('0x4'),_0x93d3('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x93d3('0x5')]},'idField':{'type':Sequelize[_0x93d3('0x5')]},'nameField':{'type':Sequelize[_0x93d3('0x5')]},'customField':{'type':Sequelize[_0x93d3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x93d3('0x5')]}};
\ No newline at end of file
+var _0x46bf=['STRING','BOOLEAN','exports','string','variable','customVariable','keyValue'];(function(_0x554f4a,_0xc0179){var _0x470d68=function(_0x2849ed){while(--_0x2849ed){_0x554f4a['push'](_0x554f4a['shift']());}};_0x470d68(++_0xc0179);}(_0x46bf,0x198));var _0xf46b=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x46bf[_0x420513];return _0x1b44ec;};'use strict';var Sequelize=require('sequelize');module[_0xf46b('0x0')]={'type':{'type':Sequelize['ENUM'](_0xf46b('0x1'),_0xf46b('0x2'),_0xf46b('0x3'),_0xf46b('0x4'),'picklist'),'defaultValue':_0xf46b('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf46b('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xf46b('0x3'))},'keyContent':{'type':Sequelize[_0xf46b('0x5')]},'idField':{'type':Sequelize[_0xf46b('0x5')]},'nameField':{'type':Sequelize[_0xf46b('0x5')]},'customField':{'type':Sequelize[_0xf46b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf46b('0x5')]}};
\ No newline at end of file
index 3649cc8..e996e75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xded5=['stack','name','map','ZendeskField','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','VIRTUAL','options','include','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x519669,_0xc308be){var _0x4ee58e=function(_0x3aa41b){while(--_0x3aa41b){_0x519669['push'](_0x519669['shift']());}};_0x4ee58e(++_0xc308be);}(_0xded5,0xba));var _0x5ded=function(_0x14b1b3,_0x4a4b6f){_0x14b1b3=_0x14b1b3-0x0;var _0x1db664=_0xded5[_0x14b1b3];return _0x1db664;};'use strict';var emlformat=require(_0x5ded('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ded('0x1'));var jsonpatch=require(_0x5ded('0x2'));var rp=require('request-promise');var moment=require(_0x5ded('0x3'));var BPromise=require(_0x5ded('0x4'));var Mustache=require(_0x5ded('0x5'));var util=require('util');var path=require(_0x5ded('0x6'));var sox=require(_0x5ded('0x7'));var csv=require('to-csv');var ejs=require(_0x5ded('0x8'));var fs=require('fs');var fs_extra=require(_0x5ded('0x9'));var _=require(_0x5ded('0xa'));var squel=require(_0x5ded('0xb'));var crypto=require(_0x5ded('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5ded('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5ded('0xe'));var Papa=require(_0x5ded('0xf'));var Redis=require(_0x5ded('0x10'));var authService=require(_0x5ded('0x11'));var qs=require(_0x5ded('0x12'));var as=require(_0x5ded('0x13'));var hardwareService=require(_0x5ded('0x14'));var logger=require(_0x5ded('0x15'))(_0x5ded('0x16'));var utils=require(_0x5ded('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5ded('0x18'));var db=require(_0x5ded('0x19'))['db'];function respondWithStatusCode(_0x2d5eb2,_0x22e911){_0x22e911=_0x22e911||0xcc;return function(_0x5b127c){if(_0x5b127c){return _0x2d5eb2[_0x5ded('0x1a')](_0x22e911);}return _0x2d5eb2[_0x5ded('0x1b')](_0x22e911)[_0x5ded('0x1c')]();};}function respondWithResult(_0x10ed21,_0x5319c0){_0x5319c0=_0x5319c0||0xc8;return function(_0x147a17){if(_0x147a17){return _0x10ed21[_0x5ded('0x1b')](_0x5319c0)[_0x5ded('0x1d')](_0x147a17);}};}function respondWithFilteredResult(_0x12cce0,_0x2f10f6){return function(_0x1491ba){if(_0x1491ba){var _0x1dcdf3=typeof _0x2f10f6[_0x5ded('0x1e')]===_0x5ded('0x1f')&&typeof _0x2f10f6['limit']===_0x5ded('0x1f');var _0x5167e3=_0x1491ba[_0x5ded('0x20')];var _0x289d35=_0x1dcdf3?0x0:_0x2f10f6[_0x5ded('0x1e')];var _0x2a64f2=_0x1dcdf3?_0x1491ba[_0x5ded('0x20')]:_0x2f10f6[_0x5ded('0x1e')]+_0x2f10f6['limit'];var _0x1dd08c;if(_0x2a64f2>=_0x5167e3){_0x2a64f2=_0x5167e3;_0x1dd08c=0xc8;}else{_0x1dd08c=0xce;}_0x12cce0[_0x5ded('0x1b')](_0x1dd08c);return _0x12cce0[_0x5ded('0x21')](_0x5ded('0x22'),_0x289d35+'-'+_0x2a64f2+'/'+_0x5167e3)['json'](_0x1491ba);}return null;};}function patchUpdates(_0x50a354){return function(_0x5951b2){try{jsonpatch[_0x5ded('0x23')](_0x5951b2,_0x50a354,!![]);}catch(_0x2a265b){return BPromise[_0x5ded('0x24')](_0x2a265b);}return _0x5951b2[_0x5ded('0x25')]();};}function saveUpdates(_0x4726cd,_0x495f0e){return function(_0xf0efad){if(_0xf0efad){return _0xf0efad[_0x5ded('0x26')](_0x4726cd)[_0x5ded('0x27')](function(_0x34b749){return _0x34b749;});}return null;};}function removeEntity(_0x40696c,_0x3df299){return function(_0x2891f9){if(_0x2891f9){return _0x2891f9[_0x5ded('0x28')]()[_0x5ded('0x27')](function(){_0x40696c['status'](0xcc)[_0x5ded('0x1c')]();});}};}function handleEntityNotFound(_0x2649a8,_0x8ab054){return function(_0x3d3c72){if(!_0x3d3c72){_0x2649a8['sendStatus'](0x194);}return _0x3d3c72;};}function handleError(_0x4925c3,_0x5aee80){_0x5aee80=_0x5aee80||0x1f4;return function(_0x1c84c2){logger[_0x5ded('0x29')](_0x1c84c2[_0x5ded('0x2a')]);if(_0x1c84c2['name']){delete _0x1c84c2[_0x5ded('0x2b')];}_0x4925c3['status'](_0x5aee80)['send'](_0x1c84c2);};}exports['index']=function(_0x166628,_0x53d289){var _0x3aa9fd={},_0x29e1fa={},_0x17659b={'count':0x0,'rows':[]};var _0x4ac418=_[_0x5ded('0x2c')](db[_0x5ded('0x2d')]['rawAttributes'],function(_0x944e2c){return{'name':_0x944e2c[_0x5ded('0x2e')],'type':_0x944e2c['type'][_0x5ded('0x2f')]};});_0x29e1fa[_0x5ded('0x30')]=_[_0x5ded('0x2c')](_0x4ac418,_0x5ded('0x2b'));_0x29e1fa[_0x5ded('0x31')]=_[_0x5ded('0x32')](_0x166628[_0x5ded('0x31')]);_0x29e1fa[_0x5ded('0x33')]=_[_0x5ded('0x34')](_0x29e1fa['model'],_0x29e1fa['query']);_0x3aa9fd['attributes']=_[_0x5ded('0x34')](_0x29e1fa[_0x5ded('0x30')],qs[_0x5ded('0x35')](_0x166628[_0x5ded('0x31')][_0x5ded('0x35')]));_0x3aa9fd[_0x5ded('0x36')]=_0x3aa9fd[_0x5ded('0x36')][_0x5ded('0x37')]?_0x3aa9fd[_0x5ded('0x36')]:_0x29e1fa[_0x5ded('0x30')];if(!_0x166628[_0x5ded('0x31')][_0x5ded('0x38')](_0x5ded('0x39'))){_0x3aa9fd[_0x5ded('0x3a')]=qs[_0x5ded('0x3a')](_0x166628['query']['limit']);_0x3aa9fd[_0x5ded('0x1e')]=qs['offset'](_0x166628[_0x5ded('0x31')][_0x5ded('0x1e')]);}_0x3aa9fd[_0x5ded('0x3b')]=qs[_0x5ded('0x3c')](_0x166628[_0x5ded('0x31')]['sort']);_0x3aa9fd['where']=qs[_0x5ded('0x33')](_['pick'](_0x166628[_0x5ded('0x31')],_0x29e1fa[_0x5ded('0x33')]),_0x4ac418);if(_0x166628['query'][_0x5ded('0x3d')]){_0x3aa9fd[_0x5ded('0x3e')]=_[_0x5ded('0x3f')](_0x3aa9fd['where'],{'$or':_['map'](_0x4ac418,function(_0x1f7fce){if(_0x1f7fce[_0x5ded('0x40')]!==_0x5ded('0x41')){var _0x4d777e={};_0x4d777e[_0x1f7fce['name']]={'$like':'%'+_0x166628['query'][_0x5ded('0x3d')]+'%'};return _0x4d777e;}})});}_0x3aa9fd=_[_0x5ded('0x3f')]({},_0x3aa9fd,_0x166628[_0x5ded('0x42')]);var _0x2577fa={'where':_0x3aa9fd[_0x5ded('0x3e')]};return db[_0x5ded('0x2d')]['count'](_0x2577fa)[_0x5ded('0x27')](function(_0x3f8941){_0x17659b[_0x5ded('0x20')]=_0x3f8941;if(_0x166628[_0x5ded('0x31')]['includeAll']){_0x3aa9fd[_0x5ded('0x43')]=[{'all':!![]}];}return db[_0x5ded('0x2d')]['findAll'](_0x3aa9fd);})[_0x5ded('0x27')](function(_0x2184bf){_0x17659b['rows']=_0x2184bf;return _0x17659b;})[_0x5ded('0x27')](respondWithFilteredResult(_0x53d289,_0x3aa9fd))[_0x5ded('0x44')](handleError(_0x53d289,null));};exports[_0x5ded('0x45')]=function(_0x18d74c,_0xe226ff){var _0x5c8b9c={'raw':!![],'where':{'id':_0x18d74c[_0x5ded('0x46')]['id']}},_0x41ab5a={};_0x41ab5a['model']=_[_0x5ded('0x32')](db[_0x5ded('0x2d')][_0x5ded('0x47')]);_0x41ab5a[_0x5ded('0x31')]=_['keys'](_0x18d74c[_0x5ded('0x31')]);_0x41ab5a[_0x5ded('0x33')]=_[_0x5ded('0x34')](_0x41ab5a['model'],_0x41ab5a['query']);_0x5c8b9c[_0x5ded('0x36')]=_[_0x5ded('0x34')](_0x41ab5a[_0x5ded('0x30')],qs[_0x5ded('0x35')](_0x18d74c['query'][_0x5ded('0x35')]));_0x5c8b9c[_0x5ded('0x36')]=_0x5c8b9c[_0x5ded('0x36')][_0x5ded('0x37')]?_0x5c8b9c[_0x5ded('0x36')]:_0x41ab5a[_0x5ded('0x30')];if(_0x18d74c[_0x5ded('0x31')][_0x5ded('0x48')]){_0x5c8b9c['include']=[{'all':!![]}];}_0x5c8b9c=_[_0x5ded('0x3f')]({},_0x5c8b9c,_0x18d74c[_0x5ded('0x42')]);return db['ZendeskField'][_0x5ded('0x49')](_0x5c8b9c)[_0x5ded('0x27')](handleEntityNotFound(_0xe226ff,null))[_0x5ded('0x27')](respondWithResult(_0xe226ff,null))[_0x5ded('0x44')](handleError(_0xe226ff,null));};exports[_0x5ded('0x4a')]=function(_0x13a288,_0x23fbe3){return db[_0x5ded('0x2d')][_0x5ded('0x4a')](_0x13a288[_0x5ded('0x4b')],{})[_0x5ded('0x27')](respondWithResult(_0x23fbe3,0xc9))[_0x5ded('0x44')](handleError(_0x23fbe3,null));};exports['update']=function(_0xeb302a,_0x3bf54f){if(_0xeb302a[_0x5ded('0x4b')]['id']){delete _0xeb302a[_0x5ded('0x4b')]['id'];}return db[_0x5ded('0x2d')][_0x5ded('0x49')]({'where':{'id':_0xeb302a[_0x5ded('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bf54f,null))[_0x5ded('0x27')](saveUpdates(_0xeb302a[_0x5ded('0x4b')],null))[_0x5ded('0x27')](respondWithResult(_0x3bf54f,null))[_0x5ded('0x44')](handleError(_0x3bf54f,null));};exports[_0x5ded('0x28')]=function(_0x38467c,_0x4271d3){return db[_0x5ded('0x2d')][_0x5ded('0x49')]({'where':{'id':_0x38467c[_0x5ded('0x46')]['id']}})['then'](handleEntityNotFound(_0x4271d3,null))[_0x5ded('0x27')](removeEntity(_0x4271d3,null))[_0x5ded('0x44')](handleError(_0x4271d3,null));};
\ No newline at end of file
+var _0x422f=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','stack','name','send','index','ZendeskField','key','model','map','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0xa408c5,_0x265651){var _0x47ec33=function(_0x4f12af){while(--_0x4f12af){_0xa408c5['push'](_0xa408c5['shift']());}};_0x47ec33(++_0x265651);}(_0x422f,0xd9));var _0xf422=function(_0x3c026d,_0x281623){_0x3c026d=_0x3c026d-0x0;var _0x30cbde=_0x422f[_0x3c026d];return _0x30cbde;};'use strict';var emlformat=require(_0xf422('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf422('0x1'));var jsonpatch=require(_0xf422('0x2'));var rp=require(_0xf422('0x3'));var moment=require(_0xf422('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf422('0x5'));var util=require(_0xf422('0x6'));var path=require(_0xf422('0x7'));var sox=require(_0xf422('0x8'));var csv=require('to-csv');var ejs=require(_0xf422('0x9'));var fs=require('fs');var fs_extra=require(_0xf422('0xa'));var _=require(_0xf422('0xb'));var squel=require(_0xf422('0xc'));var crypto=require(_0xf422('0xd'));var jsforce=require(_0xf422('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf422('0xf'));var querystring=require(_0xf422('0x10'));var Papa=require(_0xf422('0x11'));var Redis=require(_0xf422('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf422('0x13'));var as=require(_0xf422('0x14'));var hardwareService=require(_0xf422('0x15'));var logger=require(_0xf422('0x16'))(_0xf422('0x17'));var utils=require(_0xf422('0x18'));var config=require(_0xf422('0x19'));var licenseUtil=require(_0xf422('0x1a'));var db=require(_0xf422('0x1b'))['db'];function respondWithStatusCode(_0x25e76b,_0x13a632){_0x13a632=_0x13a632||0xcc;return function(_0x58fb19){if(_0x58fb19){return _0x25e76b[_0xf422('0x1c')](_0x13a632);}return _0x25e76b[_0xf422('0x1d')](_0x13a632)[_0xf422('0x1e')]();};}function respondWithResult(_0x2d6c82,_0x766974){_0x766974=_0x766974||0xc8;return function(_0x14c1c7){if(_0x14c1c7){return _0x2d6c82[_0xf422('0x1d')](_0x766974)[_0xf422('0x1f')](_0x14c1c7);}};}function respondWithFilteredResult(_0x5ce397,_0x1d7d62){return function(_0x1e29bb){if(_0x1e29bb){var _0x17d743=typeof _0x1d7d62[_0xf422('0x20')]===_0xf422('0x21')&&typeof _0x1d7d62[_0xf422('0x22')]===_0xf422('0x21');var _0x35b168=_0x1e29bb[_0xf422('0x23')];var _0x5498df=_0x17d743?0x0:_0x1d7d62[_0xf422('0x20')];var _0x345a15=_0x17d743?_0x1e29bb[_0xf422('0x23')]:_0x1d7d62['offset']+_0x1d7d62['limit'];var _0x10a74c;if(_0x345a15>=_0x35b168){_0x345a15=_0x35b168;_0x10a74c=0xc8;}else{_0x10a74c=0xce;}_0x5ce397[_0xf422('0x1d')](_0x10a74c);return _0x5ce397['set']('Content-Range',_0x5498df+'-'+_0x345a15+'/'+_0x35b168)[_0xf422('0x1f')](_0x1e29bb);}return null;};}function patchUpdates(_0x206b2d){return function(_0x3eea50){try{jsonpatch['apply'](_0x3eea50,_0x206b2d,!![]);}catch(_0x6ab0e9){return BPromise[_0xf422('0x24')](_0x6ab0e9);}return _0x3eea50[_0xf422('0x25')]();};}function saveUpdates(_0x28ac09,_0x53abd4){return function(_0x3c5ab9){if(_0x3c5ab9){return _0x3c5ab9[_0xf422('0x26')](_0x28ac09)['then'](function(_0x1f60f6){return _0x1f60f6;});}return null;};}function removeEntity(_0x2b6b47,_0x354347){return function(_0x2f679a){if(_0x2f679a){return _0x2f679a[_0xf422('0x27')]()['then'](function(){_0x2b6b47[_0xf422('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46753e,_0x319a65){return function(_0x13bcd9){if(!_0x13bcd9){_0x46753e['sendStatus'](0x194);}return _0x13bcd9;};}function handleError(_0x628496,_0x3ca259){_0x3ca259=_0x3ca259||0x1f4;return function(_0x2c6004){logger['error'](_0x2c6004[_0xf422('0x28')]);if(_0x2c6004[_0xf422('0x29')]){delete _0x2c6004[_0xf422('0x29')];}_0x628496[_0xf422('0x1d')](_0x3ca259)[_0xf422('0x2a')](_0x2c6004);};}exports[_0xf422('0x2b')]=function(_0x3f3524,_0x4d1e1b){var _0x18fbe7={},_0x7a29b3={},_0x2c5fd2={'count':0x0,'rows':[]};var _0x5b478f=_['map'](db[_0xf422('0x2c')]['rawAttributes'],function(_0x13b884){return{'name':_0x13b884['fieldName'],'type':_0x13b884['type'][_0xf422('0x2d')]};});_0x7a29b3[_0xf422('0x2e')]=_[_0xf422('0x2f')](_0x5b478f,_0xf422('0x29'));_0x7a29b3[_0xf422('0x30')]=_[_0xf422('0x31')](_0x3f3524[_0xf422('0x30')]);_0x7a29b3['filters']=_['intersection'](_0x7a29b3[_0xf422('0x2e')],_0x7a29b3[_0xf422('0x30')]);_0x18fbe7['attributes']=_[_0xf422('0x32')](_0x7a29b3[_0xf422('0x2e')],qs[_0xf422('0x33')](_0x3f3524[_0xf422('0x30')][_0xf422('0x33')]));_0x18fbe7['attributes']=_0x18fbe7[_0xf422('0x34')][_0xf422('0x35')]?_0x18fbe7[_0xf422('0x34')]:_0x7a29b3['model'];if(!_0x3f3524[_0xf422('0x30')]['hasOwnProperty']('nolimit')){_0x18fbe7['limit']=qs[_0xf422('0x22')](_0x3f3524[_0xf422('0x30')]['limit']);_0x18fbe7[_0xf422('0x20')]=qs[_0xf422('0x20')](_0x3f3524[_0xf422('0x30')][_0xf422('0x20')]);}_0x18fbe7[_0xf422('0x36')]=qs[_0xf422('0x37')](_0x3f3524[_0xf422('0x30')]['sort']);_0x18fbe7[_0xf422('0x38')]=qs[_0xf422('0x39')](_[_0xf422('0x3a')](_0x3f3524[_0xf422('0x30')],_0x7a29b3[_0xf422('0x39')]),_0x5b478f);if(_0x3f3524[_0xf422('0x30')][_0xf422('0x3b')]){_0x18fbe7[_0xf422('0x38')]=_[_0xf422('0x3c')](_0x18fbe7['where'],{'$or':_[_0xf422('0x2f')](_0x5b478f,function(_0x507761){if(_0x507761[_0xf422('0x3d')]!==_0xf422('0x3e')){var _0x211947={};_0x211947[_0x507761[_0xf422('0x29')]]={'$like':'%'+_0x3f3524['query'][_0xf422('0x3b')]+'%'};return _0x211947;}})});}_0x18fbe7=_['merge']({},_0x18fbe7,_0x3f3524[_0xf422('0x3f')]);var _0x7a4efe={'where':_0x18fbe7['where']};return db[_0xf422('0x2c')][_0xf422('0x23')](_0x7a4efe)[_0xf422('0x40')](function(_0xef7006){_0x2c5fd2[_0xf422('0x23')]=_0xef7006;if(_0x3f3524[_0xf422('0x30')][_0xf422('0x41')]){_0x18fbe7['include']=[{'all':!![]}];}return db[_0xf422('0x2c')][_0xf422('0x42')](_0x18fbe7);})[_0xf422('0x40')](function(_0x36e465){_0x2c5fd2[_0xf422('0x43')]=_0x36e465;return _0x2c5fd2;})[_0xf422('0x40')](respondWithFilteredResult(_0x4d1e1b,_0x18fbe7))[_0xf422('0x44')](handleError(_0x4d1e1b,null));};exports['show']=function(_0x2039b2,_0x5e1c4a){var _0x4c686c={'raw':!![],'where':{'id':_0x2039b2[_0xf422('0x45')]['id']}},_0x200bea={};_0x200bea[_0xf422('0x2e')]=_[_0xf422('0x31')](db[_0xf422('0x2c')][_0xf422('0x46')]);_0x200bea[_0xf422('0x30')]=_['keys'](_0x2039b2[_0xf422('0x30')]);_0x200bea[_0xf422('0x39')]=_['intersection'](_0x200bea[_0xf422('0x2e')],_0x200bea[_0xf422('0x30')]);_0x4c686c[_0xf422('0x34')]=_[_0xf422('0x32')](_0x200bea['model'],qs[_0xf422('0x33')](_0x2039b2[_0xf422('0x30')]['fields']));_0x4c686c[_0xf422('0x34')]=_0x4c686c[_0xf422('0x34')][_0xf422('0x35')]?_0x4c686c['attributes']:_0x200bea[_0xf422('0x2e')];if(_0x2039b2[_0xf422('0x30')][_0xf422('0x41')]){_0x4c686c[_0xf422('0x47')]=[{'all':!![]}];}_0x4c686c=_[_0xf422('0x3c')]({},_0x4c686c,_0x2039b2[_0xf422('0x3f')]);return db['ZendeskField']['find'](_0x4c686c)[_0xf422('0x40')](handleEntityNotFound(_0x5e1c4a,null))[_0xf422('0x40')](respondWithResult(_0x5e1c4a,null))[_0xf422('0x44')](handleError(_0x5e1c4a,null));};exports[_0xf422('0x48')]=function(_0x3e27dc,_0x5e85d1){return db[_0xf422('0x2c')]['create'](_0x3e27dc[_0xf422('0x49')],{})[_0xf422('0x40')](respondWithResult(_0x5e85d1,0xc9))[_0xf422('0x44')](handleError(_0x5e85d1,null));};exports['update']=function(_0x300932,_0x1db452){if(_0x300932[_0xf422('0x49')]['id']){delete _0x300932[_0xf422('0x49')]['id'];}return db[_0xf422('0x2c')][_0xf422('0x4a')]({'where':{'id':_0x300932[_0xf422('0x45')]['id']}})[_0xf422('0x40')](handleEntityNotFound(_0x1db452,null))['then'](saveUpdates(_0x300932[_0xf422('0x49')],null))['then'](respondWithResult(_0x1db452,null))['catch'](handleError(_0x1db452,null));};exports['destroy']=function(_0x2fc593,_0x459483){return db[_0xf422('0x2c')]['find']({'where':{'id':_0x2fc593[_0xf422('0x45')]['id']}})[_0xf422('0x40')](handleEntityNotFound(_0x459483,null))[_0xf422('0x40')](removeEntity(_0x459483,null))['catch'](handleError(_0x459483,null));};
\ No newline at end of file
index 6fc79ff..6934782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe69c=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0xe69c,0xcc));var _0xce69=function(_0xa711b,_0x81a280){_0xa711b=_0xa711b-0x0;var _0x1f061d=_0xe69c[_0xa711b];return _0x1f061d;};'use strict';var _=require(_0xce69('0x0'));var util=require(_0xce69('0x1'));var logger=require(_0xce69('0x2'))(_0xce69('0x3'));var moment=require('moment');var BPromise=require(_0xce69('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce69('0x5'));var rimraf=require(_0xce69('0x6'));var config=require(_0xce69('0x7'));var attributes=require(_0xce69('0x8'));module[_0xce69('0x9')]=function(_0x57db31,_0x2bfe61){return _0x57db31[_0xce69('0xa')](_0xce69('0xb'),attributes,{'tableName':_0xce69('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xce69('0xd'),_0xce69('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x86b4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util'];(function(_0x26d0b6,_0x503526){var _0x3d82fa=function(_0x2df83d){while(--_0x2df83d){_0x26d0b6['push'](_0x26d0b6['shift']());}};_0x3d82fa(++_0x503526);}(_0x86b4,0xbe));var _0x486b=function(_0x3f25db,_0x2fa43c){_0x3f25db=_0x3f25db-0x0;var _0x494162=_0x86b4[_0x3f25db];return _0x494162;};'use strict';var _=require(_0x486b('0x0'));var util=require(_0x486b('0x1'));var logger=require(_0x486b('0x2'))(_0x486b('0x3'));var moment=require(_0x486b('0x4'));var BPromise=require(_0x486b('0x5'));var rp=require(_0x486b('0x6'));var fs=require('fs');var path=require(_0x486b('0x7'));var rimraf=require(_0x486b('0x8'));var config=require('../../config/environment');var attributes=require(_0x486b('0x9'));module[_0x486b('0xa')]=function(_0x3bd867,_0x1a0264){return _0x3bd867[_0x486b('0xb')](_0x486b('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x486b('0xd'),'fields':[_0x486b('0xe'),_0x486b('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 94ad8a3..5cb0d3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ae7=['../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x1ac713,_0xb1993c){var _0x34a632=function(_0xba538a){while(--_0xba538a){_0x1ac713['push'](_0x1ac713['shift']());}};_0x34a632(++_0xb1993c);}(_0x0ae7,0x10b));var _0x70ae=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0ae7[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x70ae('0x0'));var util=require(_0x70ae('0x1'));var moment=require(_0x70ae('0x2'));var BPromise=require('bluebird');var rs=require(_0x70ae('0x3'));var fs=require('fs');var Redis=require(_0x70ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70ae('0x5'));var logger=require(_0x70ae('0x6'))('rpc');var config=require(_0x70ae('0x7'));var jayson=require(_0x70ae('0x8'));var client=jayson['client'][_0x70ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bccde,_0x25051a,_0x565ce2){return new BPromise(function(_0x3864e4,_0x1dba2b){return client[_0x70ae('0xa')](_0x1bccde,_0x565ce2)['then'](function(_0x3d4b50){logger[_0x70ae('0xb')](_0x70ae('0xc'),_0x25051a,_0x70ae('0xd'));logger[_0x70ae('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x25051a,_0x70ae('0xd'),JSON[_0x70ae('0xf')](_0x3d4b50));if(_0x3d4b50[_0x70ae('0x10')]){if(_0x3d4b50['error'][_0x70ae('0x11')]===0x1f4){logger[_0x70ae('0x10')]('ZendeskField,\x20%s,\x20%s',_0x25051a,_0x3d4b50['error'][_0x70ae('0x12')]);return _0x1dba2b(_0x3d4b50[_0x70ae('0x10')]['message']);}logger[_0x70ae('0x10')]('ZendeskField,\x20%s,\x20%s',_0x25051a,_0x3d4b50[_0x70ae('0x10')]['message']);return _0x3864e4(_0x3d4b50[_0x70ae('0x10')][_0x70ae('0x12')]);}else{logger[_0x70ae('0xb')](_0x70ae('0xc'),_0x25051a,_0x70ae('0xd'));_0x3864e4(_0x3d4b50[_0x70ae('0x13')]['message']);}})[_0x70ae('0x14')](function(_0xb52bb7){logger['error'](_0x70ae('0xc'),_0x25051a,_0xb52bb7);_0x1dba2b(_0xb52bb7);});});}
\ No newline at end of file
+var _0xe4d5=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4d5,0xa7));var _0x5e4d=function(_0x2b92ec,_0x18e0e3){_0x2b92ec=_0x2b92ec-0x0;var _0x12be46=_0xe4d5[_0x2b92ec];return _0x12be46;};'use strict';var _=require(_0x5e4d('0x0'));var util=require(_0x5e4d('0x1'));var moment=require('moment');var BPromise=require(_0x5e4d('0x2'));var rs=require(_0x5e4d('0x3'));var fs=require('fs');var Redis=require(_0x5e4d('0x4'));var db=require(_0x5e4d('0x5'))['db'];var utils=require(_0x5e4d('0x6'));var logger=require(_0x5e4d('0x7'))('rpc');var config=require(_0x5e4d('0x8'));var jayson=require(_0x5e4d('0x9'));var client=jayson[_0x5e4d('0xa')][_0x5e4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4eaa83,_0x1f1cd6,_0x1502ce){return new BPromise(function(_0x129a63,_0x168a26){return client[_0x5e4d('0xc')](_0x4eaa83,_0x1502ce)[_0x5e4d('0xd')](function(_0x1d09e5){logger[_0x5e4d('0xe')](_0x5e4d('0xf'),_0x1f1cd6,_0x5e4d('0x10'));logger[_0x5e4d('0x11')](_0x5e4d('0x12'),_0x1f1cd6,_0x5e4d('0x10'),JSON['stringify'](_0x1d09e5));if(_0x1d09e5[_0x5e4d('0x13')]){if(_0x1d09e5[_0x5e4d('0x13')][_0x5e4d('0x14')]===0x1f4){logger[_0x5e4d('0x13')](_0x5e4d('0xf'),_0x1f1cd6,_0x1d09e5['error'][_0x5e4d('0x15')]);return _0x168a26(_0x1d09e5[_0x5e4d('0x13')][_0x5e4d('0x15')]);}logger[_0x5e4d('0x13')](_0x5e4d('0xf'),_0x1f1cd6,_0x1d09e5[_0x5e4d('0x13')][_0x5e4d('0x15')]);return _0x129a63(_0x1d09e5[_0x5e4d('0x13')]['message']);}else{logger[_0x5e4d('0xe')](_0x5e4d('0xf'),_0x1f1cd6,_0x5e4d('0x10'));_0x129a63(_0x1d09e5[_0x5e4d('0x16')][_0x5e4d('0x15')]);}})[_0x5e4d('0x17')](function(_0x31f8db){logger['error'](_0x5e4d('0xf'),_0x1f1cd6,_0x31f8db);_0x168a26(_0x31f8db);});});}
\ No newline at end of file
index 0a1a8d9..33c6fcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d42=['post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3ea66e,_0x31f85b){var _0x33ee90=function(_0x43e3cf){while(--_0x43e3cf){_0x3ea66e['push'](_0x3ea66e['shift']());}};_0x33ee90(++_0x31f85b);}(_0x7d42,0xb0));var _0x27d4=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7d42[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x27d4('0x0'));var util=require(_0x27d4('0x1'));var path=require(_0x27d4('0x2'));var timeout=require(_0x27d4('0x3'));var express=require('express');var router=express[_0x27d4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x27d4('0x5'));var interaction=require(_0x27d4('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x27d4('0x7')](),controller[_0x27d4('0x8')]);router[_0x27d4('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x27d4('0x9')](_0x27d4('0xa'),auth[_0x27d4('0x7')](),controller[_0x27d4('0xb')]);router[_0x27d4('0x9')](_0x27d4('0xc'),auth[_0x27d4('0x7')](),controller[_0x27d4('0xd')]);router[_0x27d4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x27d4('0xe')](_0x27d4('0xa'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x27d4('0xf')]('/:id',auth[_0x27d4('0x7')](),controller[_0x27d4('0x10')]);router[_0x27d4('0x11')]('/:id',auth[_0x27d4('0x7')](),controller['destroy']);module[_0x27d4('0x12')]=router;
\ No newline at end of file
+var _0xdc7e=['get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller'];(function(_0x16bd7a,_0x52382c){var _0x538f85=function(_0x1101bc){while(--_0x1101bc){_0x16bd7a['push'](_0x16bd7a['shift']());}};_0x538f85(++_0x52382c);}(_0xdc7e,0x8b));var _0xedc7=function(_0x49e37d,_0x58c6e5){_0x49e37d=_0x49e37d-0x0;var _0x3252e3=_0xdc7e[_0x49e37d];return _0x3252e3;};'use strict';var multer=require(_0xedc7('0x0'));var util=require(_0xedc7('0x1'));var path=require(_0xedc7('0x2'));var timeout=require('connect-timeout');var express=require(_0xedc7('0x3'));var router=express['Router']();var fs_extra=require(_0xedc7('0x4'));var auth=require(_0xedc7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xedc7('0x6'));var controller=require(_0xedc7('0x7'));router[_0xedc7('0x8')]('/',auth[_0xedc7('0x9')](),controller['index']);router[_0xedc7('0x8')]('/:id',auth[_0xedc7('0x9')](),controller[_0xedc7('0xa')]);router[_0xedc7('0x8')](_0xedc7('0xb'),auth[_0xedc7('0x9')](),controller['getConfigurations']);router[_0xedc7('0x8')](_0xedc7('0xc'),auth['isAuthenticated'](),controller[_0xedc7('0xd')]);router[_0xedc7('0xe')]('/',auth[_0xedc7('0x9')](),controller[_0xedc7('0xf')]);router['post'](_0xedc7('0xb'),auth[_0xedc7('0x9')](),controller[_0xedc7('0x10')]);router[_0xedc7('0x11')](_0xedc7('0x12'),auth[_0xedc7('0x9')](),controller['update']);router[_0xedc7('0x13')](_0xedc7('0x12'),auth[_0xedc7('0x9')](),controller[_0xedc7('0x14')]);module['exports']=router;
\ No newline at end of file
index e3340de..37fdf3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['exports','STRING'];(function(_0x4de55d,_0x5d6cae){var _0x2bf61c=function(_0x5d16a5){while(--_0x5d16a5){_0x4de55d['push'](_0x4de55d['shift']());}};_0x2bf61c(++_0x5d6cae);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x179505,_0x13ad3d){_0x179505=_0x179505-0x0;var _0xb5f21b=_0x6f0d[_0x179505];return _0xb5f21b;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'name':{'type':Sequelize[_0xd6f0('0x1')]},'description':{'type':Sequelize[_0xd6f0('0x1')]},'host':{'type':Sequelize[_0xd6f0('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd6f0('0x1')]},'clientSecret':{'type':Sequelize[_0xd6f0('0x1')]},'serverUrl':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xd6f0('0x1')]},'refreshToken':{'type':Sequelize[_0xd6f0('0x1')]}};
\ No newline at end of file
+var _0x99e9=['exports','STRING'];(function(_0x32be2e,_0x5ba05a){var _0x4d47d2=function(_0x1d1d4e){while(--_0x1d1d4e){_0x32be2e['push'](_0x32be2e['shift']());}};_0x4d47d2(++_0x5ba05a);}(_0x99e9,0xb4));var _0x999e=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x99e9[_0x324fe8];return _0x4a1cd9;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'name':{'type':Sequelize[_0x999e('0x1')]},'description':{'type':Sequelize[_0x999e('0x1')]},'host':{'type':Sequelize[_0x999e('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x999e('0x1')]},'clientSecret':{'type':Sequelize[_0x999e('0x1')]},'serverUrl':{'type':Sequelize[_0x999e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x999e('0x1')]}};
\ No newline at end of file
index 3c562b2..8943552 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4472=['lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','host','zone','serverUrl','code','slice','substring','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','remove','includes','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x4472,0x75));var _0x2447=function(_0x363456,_0x19fdfd){_0x363456=_0x363456-0x0;var _0xac5af6=_0x4472[_0x363456];return _0xac5af6;};'use strict';var emlformat=require(_0x2447('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2447('0x1'));var jsonpatch=require(_0x2447('0x2'));var rp=require(_0x2447('0x3'));var moment=require(_0x2447('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2447('0x5'));var path=require(_0x2447('0x6'));var sox=require('sox');var csv=require(_0x2447('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2447('0x8'));var squel=require(_0x2447('0x9'));var crypto=require('crypto');var jsforce=require(_0x2447('0xa'));var deskjs=require(_0x2447('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2447('0xc'));var Papa=require(_0x2447('0xd'));var Redis=require('ioredis');var authService=require(_0x2447('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2447('0xf'));var hardwareService=require(_0x2447('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x2447('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2447('0x12'));var db=require(_0x2447('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x325a64,_0x46fa92){_0x46fa92=_0x46fa92||0xcc;return function(_0x1ec9c1){if(_0x1ec9c1){return _0x325a64[_0x2447('0x14')](_0x46fa92);}return _0x325a64[_0x2447('0x15')](_0x46fa92)[_0x2447('0x16')]();};}function respondWithResult(_0x669050,_0x575287){_0x575287=_0x575287||0xc8;return function(_0x4c52c5){if(_0x4c52c5){return _0x669050[_0x2447('0x15')](_0x575287)[_0x2447('0x17')](_0x4c52c5);}};}function respondWithFilteredResult(_0x2ce889,_0x1e0e5c){return function(_0x5eed74){if(_0x5eed74){var _0x2fade6=typeof _0x1e0e5c[_0x2447('0x18')]===_0x2447('0x19')&&typeof _0x1e0e5c[_0x2447('0x1a')]===_0x2447('0x19');var _0x5a2efc=_0x5eed74[_0x2447('0x1b')];var _0x28201e=_0x2fade6?0x0:_0x1e0e5c['offset'];var _0x412a76=_0x2fade6?_0x5eed74[_0x2447('0x1b')]:_0x1e0e5c['offset']+_0x1e0e5c['limit'];var _0x559efe;if(_0x412a76>=_0x5a2efc){_0x412a76=_0x5a2efc;_0x559efe=0xc8;}else{_0x559efe=0xce;}_0x2ce889[_0x2447('0x15')](_0x559efe);return _0x2ce889[_0x2447('0x1c')](_0x2447('0x1d'),_0x28201e+'-'+_0x412a76+'/'+_0x5a2efc)[_0x2447('0x17')](_0x5eed74);}return null;};}function patchUpdates(_0x2cf05b){return function(_0x4da73d){try{jsonpatch[_0x2447('0x1e')](_0x4da73d,_0x2cf05b,!![]);}catch(_0x26a375){return BPromise[_0x2447('0x1f')](_0x26a375);}return _0x4da73d[_0x2447('0x20')]();};}function saveUpdates(_0x432ff0,_0x922a9){return function(_0x5bffdb){if(_0x5bffdb){return _0x5bffdb[_0x2447('0x21')](_0x432ff0)[_0x2447('0x22')](function(_0x1c9f40){return _0x1c9f40;});}return null;};}function removeEntity(_0x8715ed,_0x485663){return function(_0x497d5e){if(_0x497d5e){return _0x497d5e[_0x2447('0x23')]()[_0x2447('0x22')](function(){_0x8715ed[_0x2447('0x15')](0xcc)[_0x2447('0x16')]();});}};}function handleEntityNotFound(_0x26b886,_0x536732){return function(_0x3601bb){if(!_0x3601bb){_0x26b886[_0x2447('0x14')](0x194);}return _0x3601bb;};}function handleError(_0x58e8cd,_0x5a8932){_0x5a8932=_0x5a8932||0x1f4;return function(_0x2ea7f7){logger['error'](_0x2ea7f7[_0x2447('0x24')]);if(_0x2ea7f7[_0x2447('0x25')]){delete _0x2ea7f7[_0x2447('0x25')];}_0x58e8cd[_0x2447('0x15')](_0x5a8932)[_0x2447('0x26')](_0x2ea7f7);};}exports[_0x2447('0x27')]=function(_0x2b3dfb,_0x1e0139){var _0x3d0851={},_0x3a8fc1={},_0x34abbb={'count':0x0,'rows':[]};var _0x4d3cfc=_[_0x2447('0x28')](db[_0x2447('0x29')][_0x2447('0x2a')],function(_0x2de369){return{'name':_0x2de369[_0x2447('0x2b')],'type':_0x2de369[_0x2447('0x2c')][_0x2447('0x2d')]};});_0x3a8fc1[_0x2447('0x2e')]=_[_0x2447('0x28')](_0x4d3cfc,_0x2447('0x25'));_0x3a8fc1[_0x2447('0x2f')]=_[_0x2447('0x30')](_0x2b3dfb[_0x2447('0x2f')]);_0x3a8fc1[_0x2447('0x31')]=_['intersection'](_0x3a8fc1[_0x2447('0x2e')],_0x3a8fc1[_0x2447('0x2f')]);_0x3d0851[_0x2447('0x32')]=_[_0x2447('0x33')](_0x3a8fc1[_0x2447('0x2e')],qs['fields'](_0x2b3dfb[_0x2447('0x2f')][_0x2447('0x34')]));_0x3d0851[_0x2447('0x32')]=_0x3d0851[_0x2447('0x32')][_0x2447('0x35')]?_0x3d0851[_0x2447('0x32')]:_0x3a8fc1['model'];if(!_0x2b3dfb[_0x2447('0x2f')][_0x2447('0x36')](_0x2447('0x37'))){_0x3d0851['limit']=qs['limit'](_0x2b3dfb['query'][_0x2447('0x1a')]);_0x3d0851[_0x2447('0x18')]=qs[_0x2447('0x18')](_0x2b3dfb[_0x2447('0x2f')][_0x2447('0x18')]);}_0x3d0851[_0x2447('0x38')]=qs[_0x2447('0x39')](_0x2b3dfb[_0x2447('0x2f')]['sort']);_0x3d0851['where']=qs[_0x2447('0x31')](_[_0x2447('0x3a')](_0x2b3dfb[_0x2447('0x2f')],_0x3a8fc1[_0x2447('0x31')]),_0x4d3cfc);if(_0x2b3dfb['query'][_0x2447('0x3b')]){_0x3d0851[_0x2447('0x3c')]=_[_0x2447('0x3d')](_0x3d0851[_0x2447('0x3c')],{'$or':_['map'](_0x4d3cfc,function(_0x27a593){if(_0x27a593['type']!=='VIRTUAL'){var _0x16eed9={};_0x16eed9[_0x27a593['name']]={'$like':'%'+_0x2b3dfb[_0x2447('0x2f')][_0x2447('0x3b')]+'%'};return _0x16eed9;}})});}_0x3d0851=_[_0x2447('0x3d')]({},_0x3d0851,_0x2b3dfb['options']);var _0x1ea2e4={'where':_0x3d0851[_0x2447('0x3c')]};return db[_0x2447('0x29')][_0x2447('0x1b')](_0x1ea2e4)[_0x2447('0x22')](function(_0x4d0ae5){_0x34abbb[_0x2447('0x1b')]=_0x4d0ae5;if(_0x2b3dfb[_0x2447('0x2f')][_0x2447('0x3e')]){_0x3d0851[_0x2447('0x3f')]=[{'all':!![]}];}return db[_0x2447('0x29')][_0x2447('0x40')](_0x3d0851);})[_0x2447('0x22')](function(_0x25b384){_0x34abbb[_0x2447('0x41')]=_0x25b384;return _0x34abbb;})['then'](respondWithFilteredResult(_0x1e0139,_0x3d0851))['catch'](handleError(_0x1e0139,null));};exports[_0x2447('0x42')]=function(_0x401257,_0x5a9644){var _0x5d238c={'raw':![],'where':{'id':_0x401257[_0x2447('0x43')]['id']}},_0x16c7f6={};_0x16c7f6[_0x2447('0x2e')]=_[_0x2447('0x30')](db[_0x2447('0x29')]['rawAttributes']);_0x16c7f6[_0x2447('0x2f')]=_[_0x2447('0x30')](_0x401257[_0x2447('0x2f')]);_0x16c7f6[_0x2447('0x31')]=_[_0x2447('0x33')](_0x16c7f6[_0x2447('0x2e')],_0x16c7f6[_0x2447('0x2f')]);_0x5d238c['attributes']=_[_0x2447('0x33')](_0x16c7f6[_0x2447('0x2e')],qs[_0x2447('0x34')](_0x401257[_0x2447('0x2f')][_0x2447('0x34')]));_0x5d238c[_0x2447('0x32')]=_0x5d238c[_0x2447('0x32')][_0x2447('0x35')]?_0x5d238c[_0x2447('0x32')]:_0x16c7f6[_0x2447('0x2e')];if(_0x401257[_0x2447('0x2f')][_0x2447('0x3e')]){_0x5d238c['include']=[{'all':!![]}];}_0x5d238c=_[_0x2447('0x3d')]({},_0x5d238c,_0x401257[_0x2447('0x44')]);return db[_0x2447('0x29')][_0x2447('0x45')](_0x5d238c)[_0x2447('0x22')](handleEntityNotFound(_0x5a9644,null))[_0x2447('0x22')](respondWithResult(_0x5a9644,null))[_0x2447('0x46')](handleError(_0x5a9644,null));};exports[_0x2447('0x47')]=function(_0x4f98ee,_0x677046){return db[_0x2447('0x29')][_0x2447('0x47')](_0x4f98ee[_0x2447('0x48')],{})['then'](respondWithResult(_0x677046,0xc9))[_0x2447('0x46')](handleError(_0x677046,null));};exports['update']=function(_0x119fc2,_0x2206ef){if(_0x119fc2[_0x2447('0x48')]['id']){delete _0x119fc2[_0x2447('0x48')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x119fc2[_0x2447('0x43')]['id']}})[_0x2447('0x22')](handleEntityNotFound(_0x2206ef,null))[_0x2447('0x22')](saveUpdates(_0x119fc2[_0x2447('0x48')],null))[_0x2447('0x22')](respondWithResult(_0x2206ef,null))[_0x2447('0x46')](handleError(_0x2206ef,null));};exports[_0x2447('0x23')]=function(_0x5d72f2,_0x37559f){return db[_0x2447('0x29')][_0x2447('0x45')]({'where':{'id':_0x5d72f2[_0x2447('0x43')]['id']}})[_0x2447('0x22')](handleEntityNotFound(_0x37559f,null))[_0x2447('0x22')](removeEntity(_0x37559f,null))[_0x2447('0x46')](handleError(_0x37559f,null));};exports[_0x2447('0x49')]=function(_0x5d9aab,_0x3dd61c,_0x583527){var _0x2dea15={};var _0x2d0086={};var _0x402425;var _0x3ab345;return db['ZohoAccount'][_0x2447('0x4a')]({'where':{'id':_0x5d9aab[_0x2447('0x43')]['id']}})[_0x2447('0x22')](handleEntityNotFound(_0x3dd61c,null))[_0x2447('0x22')](function(_0x191987){if(_0x191987){_0x402425=_0x191987;_0x2d0086['model']=_[_0x2447('0x30')](db[_0x2447('0x4b')][_0x2447('0x2a')]);_0x2d0086[_0x2447('0x2f')]=_[_0x2447('0x30')](_0x5d9aab['query']);_0x2d0086[_0x2447('0x31')]=_[_0x2447('0x33')](_0x2d0086[_0x2447('0x2e')],_0x2d0086[_0x2447('0x2f')]);_0x2dea15[_0x2447('0x32')]=_[_0x2447('0x33')](_0x2d0086['model'],qs['fields'](_0x5d9aab['query']['fields']));_0x2dea15['attributes']=_0x2dea15[_0x2447('0x32')][_0x2447('0x35')]?_0x2dea15[_0x2447('0x32')]:_0x2d0086[_0x2447('0x2e')];_0x2dea15[_0x2447('0x38')]=qs['sort'](_0x5d9aab[_0x2447('0x2f')]['sort']);_0x2dea15[_0x2447('0x3c')]=qs[_0x2447('0x31')](_[_0x2447('0x3a')](_0x5d9aab['query'],_0x2d0086[_0x2447('0x31')]));if(_0x5d9aab[_0x2447('0x2f')]['filter']){_0x2dea15[_0x2447('0x3c')]=_[_0x2447('0x3d')](_0x2dea15[_0x2447('0x3c')],{'$or':_[_0x2447('0x28')](_0x2dea15[_0x2447('0x32')],function(_0x2aa8c6){var _0x971fa9={};_0x971fa9[_0x2aa8c6]={'$like':'%'+_0x5d9aab[_0x2447('0x2f')][_0x2447('0x3b')]+'%'};return _0x971fa9;})});}_0x2dea15=_[_0x2447('0x3d')]({},_0x2dea15,_0x5d9aab[_0x2447('0x44')]);return _0x402425[_0x2447('0x49')](_0x2dea15);}})[_0x2447('0x22')](function(_0x5e6e16){if(_0x5e6e16){_0x3ab345=_0x5e6e16[_0x2447('0x35')];if(!_0x5d9aab['query'][_0x2447('0x36')]('nolimit')){_0x2dea15[_0x2447('0x1a')]=qs['limit'](_0x5d9aab[_0x2447('0x2f')]['limit']);_0x2dea15['offset']=qs[_0x2447('0x18')](_0x5d9aab[_0x2447('0x2f')]['offset']);}return _0x402425[_0x2447('0x49')](_0x2dea15);}})[_0x2447('0x22')](function(_0x1f088d){if(_0x1f088d){return _0x1f088d?{'count':_0x3ab345,'rows':_0x1f088d}:null;}})[_0x2447('0x22')](respondWithResult(_0x3dd61c,null))['catch'](handleError(_0x3dd61c,null));};exports[_0x2447('0x4c')]=function(_0x200461,_0x3f1c7a,_0x17759c){if(_0x200461['body']['id']){delete _0x200461[_0x2447('0x48')]['id'];}return db[_0x2447('0x29')][_0x2447('0x4a')]({'where':{'id':_0x200461[_0x2447('0x43')]['id']}})[_0x2447('0x22')](handleEntityNotFound(_0x3f1c7a,null))[_0x2447('0x22')](function(_0x53765a){if(_0x53765a){_0x200461[_0x2447('0x48')][_0x2447('0x4d')]=_0x53765a['id'];_0x200461[_0x2447('0x48')][_0x2447('0x4e')]=integrations['getSubjects'](_0x200461[_0x2447('0x48')][_0x2447('0x4f')],_0x200461['body']['type']);_0x200461[_0x2447('0x48')][_0x2447('0x50')]=integrations['getDescriptions'](_0x200461[_0x2447('0x48')][_0x2447('0x4f')],_0x200461[_0x2447('0x48')][_0x2447('0x2c')]);return db[_0x2447('0x4b')][_0x2447('0x47')](_0x200461[_0x2447('0x48')],{'include':[{'model':db[_0x2447('0x51')],'as':'Subjects'},{'model':db[_0x2447('0x51')],'as':'Descriptions'}]});}return null;})[_0x2447('0x22')](respondWithResult(_0x3f1c7a,null))[_0x2447('0x46')](handleError(_0x3f1c7a,null));};function getAccessToken(_0x230e7a){return new Promise(function(_0x425b53,_0x1463c9){var _0x26a271;switch(_0x230e7a['zone']){case'US':_0x26a271=_0x2447('0x52');break;case'AU':_0x26a271=_0x2447('0x53');break;case'EU':_0x26a271=_0x2447('0x54');break;case'IN':_0x26a271=_0x2447('0x55');break;case'CN':_0x26a271='https://accounts.zoho.com.cn';break;default:_0x26a271='https://accounts.zoho.eu';break;}var _0x52ba81={'method':_0x2447('0x56'),'uri':_0x26a271+_0x2447('0x57'),'qs':{'refresh_token':_0x230e7a[_0x2447('0x58')],'client_id':_0x230e7a['clientId'],'client_secret':_0x230e7a[_0x2447('0x59')],'grant_type':_0x2447('0x5a')},'json':!![]};return rp(_0x52ba81)[_0x2447('0x22')](function(_0x3f7e57){if(_0x3f7e57['access_token']){_0x425b53(_0x3f7e57[_0x2447('0x5b')]);}else{_0x1463c9('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2447('0x46')](function(_0x5959d2){_0x1463c9(_0x5959d2);});});}exports['getFields']=function(_0x359a65,_0x5b29ba,_0x5a1bd2){var _0x1118da,_0x43129f,_0x49da2a,_0x150ee0,_0x4a7d3f;return db[_0x2447('0x29')]['findOne']({'where':{'id':_0x359a65[_0x2447('0x43')]['id']},'attributes':['id',_0x2447('0x5c'),_0x2447('0x5d'),'clientId',_0x2447('0x59'),_0x2447('0x5e'),_0x2447('0x5f'),_0x2447('0x58')]})[_0x2447('0x22')](handleEntityNotFound(_0x5b29ba,null))['then'](function(_0x35b2a3){_0x4a7d3f=_0x35b2a3;_0x1118da=_0x4a7d3f[_0x2447('0x5c')];_0x43129f=_0x1118da==='zoho.eu'?'eu':'com';_0x49da2a=_0x4a7d3f[_0x2447('0x5e')];var _0xbd916f=_0x49da2a[_0x2447('0x60')](-0x1);if(_0xbd916f==='/'||_0xbd916f==='\x5c'||_0xbd916f===':'){_0x49da2a=_0x49da2a[_0x2447('0x61')](0x0,_0x49da2a[_0x2447('0x62')](_0xbd916f));}if(!_0x4a7d3f['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4a7d3f);})[_0x2447('0x22')](function(_0x3fbd8d){if(_0x3fbd8d){return rp({'method':'GET','uri':util[_0x2447('0x63')](_0x2447('0x64'),_0x43129f),'qs':{'module':_0x2447('0x65')},'headers':{'Authorization':_0x2447('0x66')+_0x3fbd8d},'json':!![]});}})['then'](function(_0x58cc13){if(_0x58cc13){if(_0x58cc13[_0x2447('0x67')]&&_0x58cc13['response'][_0x2447('0x68')]){throw new Error(_0x58cc13[_0x2447('0x67')][_0x2447('0x68')]['message']);}var _0x11c96e=[];var _0x2c968a=[];var _0x35f2bc=[_0x2447('0x69'),_0x2447('0x6a'),_0x2447('0x6b'),_0x2447('0x6c'),'Call_Duration',_0x2447('0x6d'),_0x2447('0x6e'),'Call_Type'];_0x2c968a=_[_0x2447('0x6f')](_0x58cc13[_0x2447('0x34')],function(_0x2b2f3a){return _0x35f2bc[_0x2447('0x70')](_0x2b2f3a['api_name']);});for(var _0x5d84dd=0x0;_0x5d84dd<_0x2c968a['length'];_0x5d84dd++){if(_0x2c968a[_0x5d84dd][_0x2447('0x71')]===![]){_0x11c96e[_0x2447('0x72')]({'id':_0x2c968a[_0x5d84dd]['id'],'name':_0x2c968a[_0x5d84dd]['display_label'],'custom':_0x2c968a[_0x5d84dd][_0x2447('0x73')],'options':_0x2c968a[_0x5d84dd][_0x2447('0x74')]===_0x2447('0x75')&&_0x2c968a[_0x5d84dd][_0x2447('0x76')][_0x2447('0x35')]>-0x1?_[_0x2447('0x28')](_0x2c968a[_0x5d84dd][_0x2447('0x76')],function(_0x924af9){return{'name':_0x924af9,'value':_0x924af9};}):[]});}}return{'count':_0x11c96e[_0x2447('0x35')],'rows':_0x11c96e};}else{return{'count':0x0,'rows':[]};}})[_0x2447('0x22')](respondWithResult(_0x5b29ba,null))['catch'](function(_0x3a910a){var _0x4b8846=_0x359a65[_0x2447('0x2f')][_0x2447('0x77')]?0x1f4:_0x3a910a[_0x2447('0x78')]||0x1f4;logger[_0x2447('0x68')](_0x2447('0x79'),_0x2447('0x7a'),_0x4b8846,JSON[_0x2447('0x7b')](_0x3a910a));delete _0x3a910a[_0x2447('0x25')];if(_0x4b8846===0x191){_0x4b8846=0x190;}_0x5b29ba[_0x2447('0x15')](_0x4b8846)['send'](_0x359a65[_0x2447('0x2f')]['test']?{'message':_0x2447('0x7c'),'statusCode':_0x3a910a[_0x2447('0x78')]}:_0x3a910a);});};
\ No newline at end of file
+var _0x56a1=['https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','options','catch','create','body','find','getConfigurations','findOne','ZohoConfiguration','intersection','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x56a1,0x1bd));var _0x156a=function(_0x5e2c70,_0x108e64){_0x5e2c70=_0x5e2c70-0x0;var _0x1e6cbc=_0x56a1[_0x5e2c70];return _0x1e6cbc;};'use strict';var emlformat=require(_0x156a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x156a('0x1'));var jsonpatch=require(_0x156a('0x2'));var rp=require(_0x156a('0x3'));var moment=require(_0x156a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x156a('0x5'));var util=require('util');var path=require(_0x156a('0x6'));var sox=require(_0x156a('0x7'));var csv=require('to-csv');var ejs=require(_0x156a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x156a('0x9'));var squel=require('squel');var crypto=require(_0x156a('0xa'));var jsforce=require(_0x156a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x156a('0xc'));var querystring=require(_0x156a('0xd'));var Papa=require(_0x156a('0xe'));var Redis=require(_0x156a('0xf'));var authService=require(_0x156a('0x10'));var qs=require(_0x156a('0x11'));var as=require(_0x156a('0x12'));var hardwareService=require(_0x156a('0x13'));var logger=require(_0x156a('0x14'))(_0x156a('0x15'));var utils=require(_0x156a('0x16'));var config=require(_0x156a('0x17'));var licenseUtil=require(_0x156a('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x156a('0x19'));function respondWithStatusCode(_0x9ccc4,_0x22015f){_0x22015f=_0x22015f||0xcc;return function(_0x19c1e5){if(_0x19c1e5){return _0x9ccc4[_0x156a('0x1a')](_0x22015f);}return _0x9ccc4[_0x156a('0x1b')](_0x22015f)['end']();};}function respondWithResult(_0x2468af,_0x5178ff){_0x5178ff=_0x5178ff||0xc8;return function(_0x5d03f5){if(_0x5d03f5){return _0x2468af[_0x156a('0x1b')](_0x5178ff)[_0x156a('0x1c')](_0x5d03f5);}};}function respondWithFilteredResult(_0x1552d9,_0x1ebc84){return function(_0x3ce475){if(_0x3ce475){var _0x49ac34=typeof _0x1ebc84[_0x156a('0x1d')]==='undefined'&&typeof _0x1ebc84[_0x156a('0x1e')]==='undefined';var _0x38ec10=_0x3ce475[_0x156a('0x1f')];var _0x6fd8de=_0x49ac34?0x0:_0x1ebc84[_0x156a('0x1d')];var _0x42ecf4=_0x49ac34?_0x3ce475[_0x156a('0x1f')]:_0x1ebc84[_0x156a('0x1d')]+_0x1ebc84[_0x156a('0x1e')];var _0x1051a4;if(_0x42ecf4>=_0x38ec10){_0x42ecf4=_0x38ec10;_0x1051a4=0xc8;}else{_0x1051a4=0xce;}_0x1552d9[_0x156a('0x1b')](_0x1051a4);return _0x1552d9[_0x156a('0x20')](_0x156a('0x21'),_0x6fd8de+'-'+_0x42ecf4+'/'+_0x38ec10)['json'](_0x3ce475);}return null;};}function patchUpdates(_0x7d7442){return function(_0x227509){try{jsonpatch[_0x156a('0x22')](_0x227509,_0x7d7442,!![]);}catch(_0x1db0db){return BPromise['reject'](_0x1db0db);}return _0x227509[_0x156a('0x23')]();};}function saveUpdates(_0x30e3bc,_0x208980){return function(_0x1d03c9){if(_0x1d03c9){return _0x1d03c9[_0x156a('0x24')](_0x30e3bc)[_0x156a('0x25')](function(_0x1ad1d8){return _0x1ad1d8;});}return null;};}function removeEntity(_0x48d1d7,_0x55b49e){return function(_0x4c25b3){if(_0x4c25b3){return _0x4c25b3[_0x156a('0x26')]()[_0x156a('0x25')](function(){_0x48d1d7[_0x156a('0x1b')](0xcc)[_0x156a('0x27')]();});}};}function handleEntityNotFound(_0xf7bb9c,_0x202124){return function(_0x2ead00){if(!_0x2ead00){_0xf7bb9c['sendStatus'](0x194);}return _0x2ead00;};}function handleError(_0x131fa2,_0x279ff7){_0x279ff7=_0x279ff7||0x1f4;return function(_0x537e12){logger['error'](_0x537e12['stack']);if(_0x537e12[_0x156a('0x28')]){delete _0x537e12[_0x156a('0x28')];}_0x131fa2[_0x156a('0x1b')](_0x279ff7)[_0x156a('0x29')](_0x537e12);};}exports[_0x156a('0x2a')]=function(_0x430c69,_0x50c8e9){var _0x35f8d8={},_0x29d26e={},_0x556948={'count':0x0,'rows':[]};var _0x1e6ef2=_[_0x156a('0x2b')](db[_0x156a('0x2c')][_0x156a('0x2d')],function(_0x586244){return{'name':_0x586244[_0x156a('0x2e')],'type':_0x586244[_0x156a('0x2f')][_0x156a('0x30')]};});_0x29d26e[_0x156a('0x31')]=_[_0x156a('0x2b')](_0x1e6ef2,_0x156a('0x28'));_0x29d26e[_0x156a('0x32')]=_[_0x156a('0x33')](_0x430c69[_0x156a('0x32')]);_0x29d26e[_0x156a('0x34')]=_['intersection'](_0x29d26e[_0x156a('0x31')],_0x29d26e[_0x156a('0x32')]);_0x35f8d8[_0x156a('0x35')]=_['intersection'](_0x29d26e[_0x156a('0x31')],qs['fields'](_0x430c69['query'][_0x156a('0x36')]));_0x35f8d8[_0x156a('0x35')]=_0x35f8d8[_0x156a('0x35')][_0x156a('0x37')]?_0x35f8d8[_0x156a('0x35')]:_0x29d26e[_0x156a('0x31')];if(!_0x430c69[_0x156a('0x32')][_0x156a('0x38')](_0x156a('0x39'))){_0x35f8d8[_0x156a('0x1e')]=qs['limit'](_0x430c69[_0x156a('0x32')][_0x156a('0x1e')]);_0x35f8d8['offset']=qs['offset'](_0x430c69[_0x156a('0x32')][_0x156a('0x1d')]);}_0x35f8d8[_0x156a('0x3a')]=qs['sort'](_0x430c69[_0x156a('0x32')][_0x156a('0x3b')]);_0x35f8d8[_0x156a('0x3c')]=qs[_0x156a('0x34')](_[_0x156a('0x3d')](_0x430c69['query'],_0x29d26e[_0x156a('0x34')]),_0x1e6ef2);if(_0x430c69[_0x156a('0x32')][_0x156a('0x3e')]){_0x35f8d8['where']=_[_0x156a('0x3f')](_0x35f8d8[_0x156a('0x3c')],{'$or':_['map'](_0x1e6ef2,function(_0x282b12){if(_0x282b12[_0x156a('0x2f')]!==_0x156a('0x40')){var _0x44f2f2={};_0x44f2f2[_0x282b12[_0x156a('0x28')]]={'$like':'%'+_0x430c69[_0x156a('0x32')][_0x156a('0x3e')]+'%'};return _0x44f2f2;}})});}_0x35f8d8=_[_0x156a('0x3f')]({},_0x35f8d8,_0x430c69['options']);var _0x3c393b={'where':_0x35f8d8[_0x156a('0x3c')]};return db[_0x156a('0x2c')][_0x156a('0x1f')](_0x3c393b)[_0x156a('0x25')](function(_0x398fe3){_0x556948[_0x156a('0x1f')]=_0x398fe3;if(_0x430c69['query'][_0x156a('0x41')]){_0x35f8d8['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x156a('0x42')](_0x35f8d8);})[_0x156a('0x25')](function(_0x170d2e){_0x556948[_0x156a('0x43')]=_0x170d2e;return _0x556948;})[_0x156a('0x25')](respondWithFilteredResult(_0x50c8e9,_0x35f8d8))['catch'](handleError(_0x50c8e9,null));};exports[_0x156a('0x44')]=function(_0x121218,_0x2f311a){var _0x53faa1={'raw':![],'where':{'id':_0x121218[_0x156a('0x45')]['id']}},_0x337355={};_0x337355[_0x156a('0x31')]=_[_0x156a('0x33')](db[_0x156a('0x2c')][_0x156a('0x2d')]);_0x337355['query']=_[_0x156a('0x33')](_0x121218['query']);_0x337355[_0x156a('0x34')]=_['intersection'](_0x337355[_0x156a('0x31')],_0x337355[_0x156a('0x32')]);_0x53faa1[_0x156a('0x35')]=_['intersection'](_0x337355[_0x156a('0x31')],qs[_0x156a('0x36')](_0x121218[_0x156a('0x32')][_0x156a('0x36')]));_0x53faa1[_0x156a('0x35')]=_0x53faa1['attributes'][_0x156a('0x37')]?_0x53faa1[_0x156a('0x35')]:_0x337355[_0x156a('0x31')];if(_0x121218[_0x156a('0x32')][_0x156a('0x41')]){_0x53faa1['include']=[{'all':!![]}];}_0x53faa1=_[_0x156a('0x3f')]({},_0x53faa1,_0x121218[_0x156a('0x46')]);return db[_0x156a('0x2c')]['find'](_0x53faa1)[_0x156a('0x25')](handleEntityNotFound(_0x2f311a,null))[_0x156a('0x25')](respondWithResult(_0x2f311a,null))[_0x156a('0x47')](handleError(_0x2f311a,null));};exports[_0x156a('0x48')]=function(_0x448111,_0x4d1bde){return db[_0x156a('0x2c')][_0x156a('0x48')](_0x448111[_0x156a('0x49')],{})[_0x156a('0x25')](respondWithResult(_0x4d1bde,0xc9))[_0x156a('0x47')](handleError(_0x4d1bde,null));};exports['update']=function(_0x40b319,_0x2dab84){if(_0x40b319[_0x156a('0x49')]['id']){delete _0x40b319[_0x156a('0x49')]['id'];}return db[_0x156a('0x2c')][_0x156a('0x4a')]({'where':{'id':_0x40b319[_0x156a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dab84,null))[_0x156a('0x25')](saveUpdates(_0x40b319[_0x156a('0x49')],null))['then'](respondWithResult(_0x2dab84,null))[_0x156a('0x47')](handleError(_0x2dab84,null));};exports[_0x156a('0x26')]=function(_0x4fc94d,_0x463b03){return db[_0x156a('0x2c')][_0x156a('0x4a')]({'where':{'id':_0x4fc94d[_0x156a('0x45')]['id']}})['then'](handleEntityNotFound(_0x463b03,null))['then'](removeEntity(_0x463b03,null))[_0x156a('0x47')](handleError(_0x463b03,null));};exports[_0x156a('0x4b')]=function(_0x4e0b6f,_0x121edc,_0x5b616f){var _0x26ccd5={};var _0x38f79e={};var _0x2035e0;var _0x389306;return db['ZohoAccount'][_0x156a('0x4c')]({'where':{'id':_0x4e0b6f[_0x156a('0x45')]['id']}})['then'](handleEntityNotFound(_0x121edc,null))[_0x156a('0x25')](function(_0x3c03e5){if(_0x3c03e5){_0x2035e0=_0x3c03e5;_0x38f79e['model']=_[_0x156a('0x33')](db[_0x156a('0x4d')][_0x156a('0x2d')]);_0x38f79e[_0x156a('0x32')]=_[_0x156a('0x33')](_0x4e0b6f[_0x156a('0x32')]);_0x38f79e[_0x156a('0x34')]=_['intersection'](_0x38f79e[_0x156a('0x31')],_0x38f79e[_0x156a('0x32')]);_0x26ccd5[_0x156a('0x35')]=_[_0x156a('0x4e')](_0x38f79e['model'],qs['fields'](_0x4e0b6f[_0x156a('0x32')][_0x156a('0x36')]));_0x26ccd5['attributes']=_0x26ccd5['attributes'][_0x156a('0x37')]?_0x26ccd5['attributes']:_0x38f79e[_0x156a('0x31')];_0x26ccd5[_0x156a('0x3a')]=qs[_0x156a('0x3b')](_0x4e0b6f[_0x156a('0x32')][_0x156a('0x3b')]);_0x26ccd5[_0x156a('0x3c')]=qs[_0x156a('0x34')](_[_0x156a('0x3d')](_0x4e0b6f[_0x156a('0x32')],_0x38f79e[_0x156a('0x34')]));if(_0x4e0b6f['query'][_0x156a('0x3e')]){_0x26ccd5[_0x156a('0x3c')]=_['merge'](_0x26ccd5[_0x156a('0x3c')],{'$or':_[_0x156a('0x2b')](_0x26ccd5[_0x156a('0x35')],function(_0x66dfc8){var _0xa93538={};_0xa93538[_0x66dfc8]={'$like':'%'+_0x4e0b6f[_0x156a('0x32')][_0x156a('0x3e')]+'%'};return _0xa93538;})});}_0x26ccd5=_[_0x156a('0x3f')]({},_0x26ccd5,_0x4e0b6f[_0x156a('0x46')]);return _0x2035e0[_0x156a('0x4b')](_0x26ccd5);}})['then'](function(_0x5b7e86){if(_0x5b7e86){_0x389306=_0x5b7e86[_0x156a('0x37')];if(!_0x4e0b6f[_0x156a('0x32')][_0x156a('0x38')](_0x156a('0x39'))){_0x26ccd5['limit']=qs[_0x156a('0x1e')](_0x4e0b6f[_0x156a('0x32')][_0x156a('0x1e')]);_0x26ccd5[_0x156a('0x1d')]=qs[_0x156a('0x1d')](_0x4e0b6f['query'][_0x156a('0x1d')]);}return _0x2035e0[_0x156a('0x4b')](_0x26ccd5);}})[_0x156a('0x25')](function(_0x45930f){if(_0x45930f){return _0x45930f?{'count':_0x389306,'rows':_0x45930f}:null;}})['then'](respondWithResult(_0x121edc,null))[_0x156a('0x47')](handleError(_0x121edc,null));};exports[_0x156a('0x4f')]=function(_0x48ab4f,_0x20f113,_0x42a37b){if(_0x48ab4f[_0x156a('0x49')]['id']){delete _0x48ab4f[_0x156a('0x49')]['id'];}return db[_0x156a('0x2c')]['findOne']({'where':{'id':_0x48ab4f[_0x156a('0x45')]['id']}})[_0x156a('0x25')](handleEntityNotFound(_0x20f113,null))[_0x156a('0x25')](function(_0x27d71b){if(_0x27d71b){_0x48ab4f[_0x156a('0x49')][_0x156a('0x50')]=_0x27d71b['id'];_0x48ab4f['body']['Subjects']=integrations[_0x156a('0x51')](_0x48ab4f[_0x156a('0x49')][_0x156a('0x52')],_0x48ab4f['body']['type']);_0x48ab4f[_0x156a('0x49')][_0x156a('0x53')]=integrations[_0x156a('0x54')](_0x48ab4f['body'][_0x156a('0x52')],_0x48ab4f[_0x156a('0x49')][_0x156a('0x2f')]);return db[_0x156a('0x4d')]['create'](_0x48ab4f[_0x156a('0x49')],{'include':[{'model':db[_0x156a('0x55')],'as':'Subjects'},{'model':db[_0x156a('0x55')],'as':_0x156a('0x53')}]});}return null;})[_0x156a('0x25')](respondWithResult(_0x20f113,null))[_0x156a('0x47')](handleError(_0x20f113,null));};function getAccessToken(_0x2faf57){return new Promise(function(_0x2d83fd,_0x5110a4){var _0x17b1ce;switch(_0x2faf57['zone']){case'US':_0x17b1ce=_0x156a('0x56');break;case'AU':_0x17b1ce='https://accounts.zoho.com.au';break;case'EU':_0x17b1ce=_0x156a('0x57');break;case'IN':_0x17b1ce=_0x156a('0x58');break;case'CN':_0x17b1ce='https://accounts.zoho.com.cn';break;default:_0x17b1ce=_0x156a('0x57');break;}var _0x55b192={'method':_0x156a('0x59'),'uri':_0x17b1ce+'/oauth/v2/token','qs':{'refresh_token':_0x2faf57[_0x156a('0x5a')],'client_id':_0x2faf57[_0x156a('0x5b')],'client_secret':_0x2faf57[_0x156a('0x5c')],'grant_type':_0x156a('0x5d')},'json':!![]};return rp(_0x55b192)['then'](function(_0x1dca91){if(_0x1dca91[_0x156a('0x5e')]){_0x2d83fd(_0x1dca91['access_token']);}else{_0x5110a4(_0x156a('0x5f'));}})['catch'](function(_0x1c84d3){_0x5110a4(_0x1c84d3);});});}exports[_0x156a('0x60')]=function(_0x576fe0,_0x54411f,_0x4f2806){var _0x3e1ee0,_0x207f5b,_0x2d17c5,_0x1720fa,_0x4b11a4;return db[_0x156a('0x2c')][_0x156a('0x4c')]({'where':{'id':_0x576fe0['params']['id']},'attributes':['id',_0x156a('0x61'),_0x156a('0x62'),_0x156a('0x5b'),'clientSecret',_0x156a('0x63'),_0x156a('0x64'),_0x156a('0x5a')]})[_0x156a('0x25')](handleEntityNotFound(_0x54411f,null))[_0x156a('0x25')](function(_0x274edf){_0x4b11a4=_0x274edf;_0x3e1ee0=_0x4b11a4[_0x156a('0x61')];_0x207f5b=_0x3e1ee0==='zoho.eu'?'eu':_0x156a('0x65');_0x2d17c5=_0x4b11a4[_0x156a('0x63')];var _0x12f765=_0x2d17c5['slice'](-0x1);if(_0x12f765==='/'||_0x12f765==='\x5c'||_0x12f765===':'){_0x2d17c5=_0x2d17c5[_0x156a('0x66')](0x0,_0x2d17c5[_0x156a('0x67')](_0x12f765));}if(!_0x4b11a4['refreshToken']){throw new Error(_0x156a('0x68'));}return getAccessToken(_0x4b11a4);})[_0x156a('0x25')](function(_0x52fb60){if(_0x52fb60){return rp({'method':_0x156a('0x69'),'uri':util[_0x156a('0x6a')](_0x156a('0x6b'),_0x207f5b),'qs':{'module':_0x156a('0x6c')},'headers':{'Authorization':_0x156a('0x6d')+_0x52fb60},'json':!![]});}})[_0x156a('0x25')](function(_0x661911){if(_0x661911){if(_0x661911[_0x156a('0x6e')]&&_0x661911[_0x156a('0x6e')][_0x156a('0x6f')]){throw new Error(_0x661911[_0x156a('0x6e')][_0x156a('0x6f')][_0x156a('0x70')]);}var _0x3eb2d2=[];var _0x51f801=[];var _0x2d4d66=[_0x156a('0x71'),_0x156a('0x72'),_0x156a('0x73'),_0x156a('0x74'),_0x156a('0x75'),_0x156a('0x76'),_0x156a('0x77'),'Call_Type'];_0x51f801=_[_0x156a('0x78')](_0x661911[_0x156a('0x36')],function(_0x474220){return _0x2d4d66['includes'](_0x474220[_0x156a('0x79')]);});for(var _0x51ac91=0x0;_0x51ac91<_0x51f801[_0x156a('0x37')];_0x51ac91++){if(_0x51f801[_0x51ac91][_0x156a('0x7a')]===![]){_0x3eb2d2['push']({'id':_0x51f801[_0x51ac91]['id'],'name':_0x51f801[_0x51ac91][_0x156a('0x7b')],'custom':_0x51f801[_0x51ac91][_0x156a('0x7c')],'options':_0x51f801[_0x51ac91][_0x156a('0x7d')]===_0x156a('0x7e')&&_0x51f801[_0x51ac91][_0x156a('0x7f')][_0x156a('0x37')]>-0x1?_[_0x156a('0x2b')](_0x51f801[_0x51ac91][_0x156a('0x7f')],function(_0x109997){return{'name':_0x109997,'value':_0x109997};}):[]});}}return{'count':_0x3eb2d2[_0x156a('0x37')],'rows':_0x3eb2d2};}else{return{'count':0x0,'rows':[]};}})[_0x156a('0x25')](respondWithResult(_0x54411f,null))['catch'](function(_0x1120ce){var _0x1345a7=_0x576fe0[_0x156a('0x32')][_0x156a('0x80')]?0x1f4:_0x1120ce[_0x156a('0x81')]||0x1f4;logger[_0x156a('0x6f')](_0x156a('0x82'),_0x156a('0x60'),_0x1345a7,JSON[_0x156a('0x83')](_0x1120ce));delete _0x1120ce[_0x156a('0x28')];if(_0x1345a7===0x191){_0x1345a7=0x190;}_0x54411f[_0x156a('0x1b')](_0x1345a7)[_0x156a('0x29')](_0x576fe0[_0x156a('0x32')][_0x156a('0x80')]?{'message':_0x156a('0x84'),'statusCode':_0x1120ce[_0x156a('0x81')]}:_0x1120ce);});};
\ No newline at end of file
index 5fea04b..31b694c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc1=['info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','slice','https://accounts.zoho.in','refreshToken','lodash','util','api','moment','bluebird','request-promise','path','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token'];(function(_0x4f2994,_0x3f4052){var _0x145625=function(_0x4daf53){while(--_0x4daf53){_0x4f2994['push'](_0x4f2994['shift']());}};_0x145625(++_0x3f4052);}(_0x8bc1,0x12a));var _0x18bc=function(_0x3278aa,_0x3af048){_0x3278aa=_0x3278aa-0x0;var _0xa0d4e=_0x8bc1[_0x3278aa];return _0xa0d4e;};'use strict';var _=require(_0x18bc('0x0'));var util=require(_0x18bc('0x1'));var logger=require('../../config/logger')(_0x18bc('0x2'));var moment=require(_0x18bc('0x3'));var BPromise=require(_0x18bc('0x4'));var rp=require(_0x18bc('0x5'));var fs=require('fs');var path=require(_0x18bc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x18bc('0x7'));var integrations=require(_0x18bc('0x8'));module[_0x18bc('0x9')]=function(_0x39d187,_0x845e1c){return _0x39d187[_0x18bc('0xa')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7c3156,_0x8c0c,_0x391e51){if(_0x7c3156[_0x18bc('0xb')](_0x18bc('0xc'))||_0x7c3156[_0x18bc('0xb')](_0x18bc('0xd'))||_0x7c3156['changed'](_0x18bc('0xe'))||_0x7c3156[_0x18bc('0xb')](_0x18bc('0xf'))||_0x7c3156[_0x18bc('0xb')](_0x18bc('0x10'))||_0x7c3156[_0x18bc('0xb')](_0x18bc('0x11'))){var _0x79c5a6,_0x4c38d3;_0x79c5a6=_0x7c3156[_0x18bc('0xd')];var _0x1627d2=_0x79c5a6['slice'](-0x1);if(_0x1627d2==='/'||_0x1627d2==='\x5c'||_0x1627d2===':'){_0x79c5a6=_0x79c5a6[_0x18bc('0x12')](0x0,_0x79c5a6[_0x18bc('0x13')](_0x1627d2));}switch(_0x7c3156[_0x18bc('0xc')]){case'US':_0x4c38d3='https://accounts.zoho.com';break;case'AU':_0x4c38d3=_0x18bc('0x14');break;case'IN':_0x4c38d3='https://accounts.zoho.in';break;case'CN':_0x4c38d3=_0x18bc('0x15');break;default:_0x4c38d3=_0x18bc('0x16');break;}var _0x237029={'method':_0x18bc('0x17'),'uri':_0x4c38d3+_0x18bc('0x18'),'form':{'grant_type':_0x18bc('0x19'),'client_id':_0x7c3156['clientId'],'client_secret':_0x7c3156[_0x18bc('0xf')],'redirect_uri':_0x7c3156[_0x18bc('0xd')],'code':_0x7c3156[_0x18bc('0x10')]},'headers':{'Content-Type':_0x18bc('0x1a')}};return rp(_0x237029)[_0x18bc('0x1b')](function(_0x9d2a79){var _0x34fb99=JSON[_0x18bc('0x1c')](_0x9d2a79);if(_0x34fb99[_0x18bc('0x1d')]){_0x7c3156['refreshToken']=_0x34fb99[_0x18bc('0x1d')];logger[_0x18bc('0x1e')](util['format'](_0x18bc('0x1f'),_0x7c3156[_0x18bc('0x20')],_0x7c3156['id']));}else{logger[_0x18bc('0x21')](util[_0x18bc('0x22')](_0x18bc('0x23'),_0x7c3156[_0x18bc('0x20')],_0x7c3156['id']),util[_0x18bc('0x24')](_0x34fb99,{'showHidden':![],'depth':null}));}return _0x391e51(null,_0x8c0c);})[_0x18bc('0x25')](function(_0xc779b9){logger[_0x18bc('0x21')](util[_0x18bc('0x22')](_0x18bc('0x23'),_0x7c3156[_0x18bc('0x20')],_0x7c3156['id']),util[_0x18bc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x391e51(_0xc779b9);});}else{return _0x391e51(null,_0x8c0c);}},'beforeUpdate':function(_0x4d5fad,_0x2f92c0,_0x27b1ef){if(_0x4d5fad[_0x18bc('0xb')]('zone')||_0x4d5fad['changed'](_0x18bc('0xd'))||_0x4d5fad[_0x18bc('0xb')](_0x18bc('0xe'))||_0x4d5fad[_0x18bc('0xb')](_0x18bc('0xf'))||_0x4d5fad[_0x18bc('0xb')](_0x18bc('0x10'))||_0x4d5fad[_0x18bc('0xb')](_0x18bc('0x11'))){var _0x258c2b,_0x39baaa;_0x258c2b=_0x4d5fad[_0x18bc('0xd')];var _0x774233=_0x258c2b[_0x18bc('0x26')](-0x1);if(_0x774233==='/'||_0x774233==='\x5c'||_0x774233===':'){_0x258c2b=_0x258c2b['substring'](0x0,_0x258c2b[_0x18bc('0x13')](_0x774233));}switch(_0x4d5fad['zone']){case'US':_0x39baaa='https://accounts.zoho.com';break;case'AU':_0x39baaa='https://accounts.zoho.com.au';break;case'IN':_0x39baaa=_0x18bc('0x27');break;case'CN':_0x39baaa=_0x18bc('0x15');break;default:_0x39baaa='https://accounts.zoho.eu';break;}var _0x5ebdb0={'method':'POST','uri':_0x39baaa+_0x18bc('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x4d5fad[_0x18bc('0xe')],'client_secret':_0x4d5fad[_0x18bc('0xf')],'redirect_uri':_0x4d5fad['serverUrl'],'code':_0x4d5fad['code']},'headers':{'Content-Type':_0x18bc('0x1a')}};return rp(_0x5ebdb0)['then'](function(_0x6f300d){var _0x34d02e=JSON[_0x18bc('0x1c')](_0x6f300d);if(_0x34d02e[_0x18bc('0x1d')]){_0x4d5fad[_0x18bc('0x28')]=_0x34d02e[_0x18bc('0x1d')];logger[_0x18bc('0x1e')](util[_0x18bc('0x22')](_0x18bc('0x1f'),_0x4d5fad[_0x18bc('0x20')],_0x4d5fad['id']));}else{logger[_0x18bc('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4d5fad[_0x18bc('0x20')],_0x4d5fad['id']),util['inspect'](_0x34d02e,{'showHidden':![],'depth':null}));}return _0x27b1ef(null,_0x2f92c0);})['catch'](function(_0x2a895e){logger['error'](util[_0x18bc('0x22')](_0x18bc('0x23'),_0x4d5fad['name'],_0x4d5fad['id']),util[_0x18bc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x27b1ef(_0x2a895e);});}else{return _0x27b1ef(null,_0x2f92c0);}}}});};
\ No newline at end of file
+var _0xac1f=['code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','then','refreshToken','catch','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId'];(function(_0xce3465,_0x2299f7){var _0x329e9e=function(_0x2eb64e){while(--_0x2eb64e){_0xce3465['push'](_0xce3465['shift']());}};_0x329e9e(++_0x2299f7);}(_0xac1f,0xc5));var _0xfac1=function(_0x49ca07,_0x2b01d0){_0x49ca07=_0x49ca07-0x0;var _0x15fcd6=_0xac1f[_0x49ca07];return _0x15fcd6;};'use strict';var _=require(_0xfac1('0x0'));var util=require(_0xfac1('0x1'));var logger=require(_0xfac1('0x2'))(_0xfac1('0x3'));var moment=require(_0xfac1('0x4'));var BPromise=require('bluebird');var rp=require(_0xfac1('0x5'));var fs=require('fs');var path=require(_0xfac1('0x6'));var rimraf=require(_0xfac1('0x7'));var config=require('../../config/environment');var attributes=require(_0xfac1('0x8'));var integrations=require(_0xfac1('0x9'));module[_0xfac1('0xa')]=function(_0x5645b1,_0x27051d){return _0x5645b1[_0xfac1('0xb')](_0xfac1('0xc'),attributes,{'tableName':_0xfac1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x468eeb,_0x280067,_0x46e6b5){if(_0x468eeb[_0xfac1('0xe')](_0xfac1('0xf'))||_0x468eeb[_0xfac1('0xe')](_0xfac1('0x10'))||_0x468eeb[_0xfac1('0xe')](_0xfac1('0x11'))||_0x468eeb[_0xfac1('0xe')]('clientSecret')||_0x468eeb[_0xfac1('0xe')](_0xfac1('0x12'))||_0x468eeb['changed'](_0xfac1('0x13'))){var _0x362d7a,_0x4ef694;_0x362d7a=_0x468eeb['serverUrl'];var _0x1fa044=_0x362d7a[_0xfac1('0x14')](-0x1);if(_0x1fa044==='/'||_0x1fa044==='\x5c'||_0x1fa044===':'){_0x362d7a=_0x362d7a[_0xfac1('0x15')](0x0,_0x362d7a[_0xfac1('0x16')](_0x1fa044));}switch(_0x468eeb[_0xfac1('0xf')]){case'US':_0x4ef694=_0xfac1('0x17');break;case'AU':_0x4ef694=_0xfac1('0x18');break;case'IN':_0x4ef694='https://accounts.zoho.in';break;case'CN':_0x4ef694='https://accounts.zoho.com.cn';break;default:_0x4ef694=_0xfac1('0x19');break;}var _0x5d95e1={'method':_0xfac1('0x1a'),'uri':_0x4ef694+_0xfac1('0x1b'),'form':{'grant_type':_0xfac1('0x1c'),'client_id':_0x468eeb['clientId'],'client_secret':_0x468eeb[_0xfac1('0x1d')],'redirect_uri':_0x468eeb['serverUrl'],'code':_0x468eeb[_0xfac1('0x12')]},'headers':{'Content-Type':_0xfac1('0x1e')}};return rp(_0x5d95e1)['then'](function(_0x1f03f3){var _0x5d8e55=JSON[_0xfac1('0x1f')](_0x1f03f3);if(_0x5d8e55[_0xfac1('0x20')]){_0x468eeb['refreshToken']=_0x5d8e55['refresh_token'];logger[_0xfac1('0x21')](util[_0xfac1('0x22')](_0xfac1('0x23'),_0x468eeb[_0xfac1('0x24')],_0x468eeb['id']));}else{logger['error'](util[_0xfac1('0x22')](_0xfac1('0x25'),_0x468eeb[_0xfac1('0x24')],_0x468eeb['id']),util[_0xfac1('0x26')](_0x5d8e55,{'showHidden':![],'depth':null}));}return _0x46e6b5(null,_0x280067);})['catch'](function(_0x2dc6f9){logger[_0xfac1('0x27')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x468eeb[_0xfac1('0x24')],_0x468eeb['id']),util[_0xfac1('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x46e6b5(_0x2dc6f9);});}else{return _0x46e6b5(null,_0x280067);}},'beforeUpdate':function(_0xade438,_0x2e4a6a,_0x4e8c0f){if(_0xade438[_0xfac1('0xe')](_0xfac1('0xf'))||_0xade438[_0xfac1('0xe')](_0xfac1('0x10'))||_0xade438[_0xfac1('0xe')](_0xfac1('0x11'))||_0xade438['changed']('clientSecret')||_0xade438[_0xfac1('0xe')](_0xfac1('0x12'))||_0xade438[_0xfac1('0xe')](_0xfac1('0x13'))){var _0x5796fe,_0xc90bdc;_0x5796fe=_0xade438[_0xfac1('0x10')];var _0x2588bc=_0x5796fe[_0xfac1('0x14')](-0x1);if(_0x2588bc==='/'||_0x2588bc==='\x5c'||_0x2588bc===':'){_0x5796fe=_0x5796fe[_0xfac1('0x15')](0x0,_0x5796fe['lastIndexOf'](_0x2588bc));}switch(_0xade438[_0xfac1('0xf')]){case'US':_0xc90bdc=_0xfac1('0x17');break;case'AU':_0xc90bdc='https://accounts.zoho.com.au';break;case'IN':_0xc90bdc='https://accounts.zoho.in';break;case'CN':_0xc90bdc='https://accounts.zoho.com.cn';break;default:_0xc90bdc='https://accounts.zoho.eu';break;}var _0x54d917={'method':_0xfac1('0x1a'),'uri':_0xc90bdc+_0xfac1('0x1b'),'form':{'grant_type':_0xfac1('0x1c'),'client_id':_0xade438[_0xfac1('0x11')],'client_secret':_0xade438[_0xfac1('0x1d')],'redirect_uri':_0xade438['serverUrl'],'code':_0xade438[_0xfac1('0x12')]},'headers':{'Content-Type':_0xfac1('0x1e')}};return rp(_0x54d917)[_0xfac1('0x28')](function(_0x28f667){var _0x5197d5=JSON[_0xfac1('0x1f')](_0x28f667);if(_0x5197d5['refresh_token']){_0xade438[_0xfac1('0x29')]=_0x5197d5[_0xfac1('0x20')];logger[_0xfac1('0x21')](util['format'](_0xfac1('0x23'),_0xade438[_0xfac1('0x24')],_0xade438['id']));}else{logger[_0xfac1('0x27')](util['format'](_0xfac1('0x25'),_0xade438[_0xfac1('0x24')],_0xade438['id']),util[_0xfac1('0x26')](_0x5197d5,{'showHidden':![],'depth':null}));}return _0x4e8c0f(null,_0x2e4a6a);})[_0xfac1('0x2a')](function(_0x2db5e4){logger['error'](util['format'](_0xfac1('0x25'),_0xade438[_0xfac1('0x24')],_0xade438['id']),util[_0xfac1('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x4e8c0f(_0x2db5e4);});}else{return _0x4e8c0f(null,_0x2e4a6a);}}}});};
\ No newline at end of file
index 53ba120..8c6c92c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c3=['then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','options','raw','where','attributes','limit','map','include','model','ShowZohoAccount','ZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x482d06,_0x1c7c4a){var _0x3bdd88=function(_0x476f12){while(--_0x476f12){_0x482d06['push'](_0x482d06['shift']());}};_0x3bdd88(++_0x1c7c4a);}(_0x55c3,0x189));var _0x355c=function(_0x57958e,_0xe0d7b7){_0x57958e=_0x57958e-0x0;var _0x116398=_0x55c3[_0x57958e];return _0x116398;};'use strict';var _=require('lodash');var util=require(_0x355c('0x0'));var moment=require(_0x355c('0x1'));var BPromise=require(_0x355c('0x2'));var rs=require(_0x355c('0x3'));var fs=require('fs');var Redis=require(_0x355c('0x4'));var db=require(_0x355c('0x5'))['db'];var utils=require(_0x355c('0x6'));var logger=require(_0x355c('0x7'))(_0x355c('0x8'));var config=require(_0x355c('0x9'));var jayson=require(_0x355c('0xa'));var client=jayson[_0x355c('0xb')][_0x355c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x167fb1,_0x4cd7f0,_0x567edb){return new BPromise(function(_0x3fe34b,_0x248f02){return client[_0x355c('0xd')](_0x167fb1,_0x567edb)[_0x355c('0xe')](function(_0x40ead2){logger[_0x355c('0xf')](_0x355c('0x10'),_0x4cd7f0,_0x355c('0x11'));logger[_0x355c('0x12')](_0x355c('0x13'),_0x4cd7f0,_0x355c('0x11'),JSON[_0x355c('0x14')](_0x40ead2));if(_0x40ead2[_0x355c('0x15')]){if(_0x40ead2[_0x355c('0x15')]['code']===0x1f4){logger[_0x355c('0x15')](_0x355c('0x10'),_0x4cd7f0,_0x40ead2['error'][_0x355c('0x16')]);return _0x248f02(_0x40ead2['error'][_0x355c('0x16')]);}logger[_0x355c('0x15')](_0x355c('0x10'),_0x4cd7f0,_0x40ead2[_0x355c('0x15')]['message']);return _0x3fe34b(_0x40ead2[_0x355c('0x15')]['message']);}else{logger['info'](_0x355c('0x10'),_0x4cd7f0,_0x355c('0x11'));_0x3fe34b(_0x40ead2[_0x355c('0x17')][_0x355c('0x16')]);}})[_0x355c('0x18')](function(_0x25369a){logger[_0x355c('0x15')](_0x355c('0x10'),_0x4cd7f0,_0x25369a);_0x248f02(_0x25369a);});});}exports[_0x355c('0x19')]=function(_0x559577){var _0xc051c7=this;return new Promise(function(_0x2610c5,_0x537586){return db['ZohoAccount']['findAll']({'raw':_0x559577['options']?_0x559577[_0x355c('0x1a')][_0x355c('0x1b')]===undefined?!![]:![]:!![],'where':_0x559577[_0x355c('0x1a')]?_0x559577['options'][_0x355c('0x1c')]||null:null,'attributes':_0x559577[_0x355c('0x1a')]?_0x559577[_0x355c('0x1a')][_0x355c('0x1d')]||null:null,'limit':_0x559577[_0x355c('0x1a')]?_0x559577[_0x355c('0x1a')][_0x355c('0x1e')]||null:null,'include':_0x559577[_0x355c('0x1a')]?_0x559577['options']['include']?_[_0x355c('0x1f')](_0x559577[_0x355c('0x1a')][_0x355c('0x20')],function(_0x5a378e){return{'model':db[_0x5a378e[_0x355c('0x21')]],'as':_0x5a378e['as'],'attributes':_0x5a378e['attributes'],'include':_0x5a378e[_0x355c('0x20')]?_[_0x355c('0x1f')](_0x5a378e[_0x355c('0x20')],function(_0x22e629){return{'model':db[_0x22e629[_0x355c('0x21')]],'as':_0x22e629['as'],'attributes':_0x22e629['attributes'],'include':_0x22e629[_0x355c('0x20')]?_[_0x355c('0x1f')](_0x22e629[_0x355c('0x20')],function(_0x3fa509){return{'model':db[_0x3fa509[_0x355c('0x21')]],'as':_0x3fa509['as'],'attributes':_0x3fa509['attributes']};}):[]};}):[]};}):[]:[]})[_0x355c('0xe')](function(_0x5e6345){logger[_0x355c('0xf')](_0x355c('0x19'),_0x559577);logger[_0x355c('0x12')](_0x355c('0x19'),_0x559577,JSON[_0x355c('0x14')](_0x5e6345));_0x2610c5(_0x5e6345);})[_0x355c('0x18')](function(_0x302391){logger['error'](_0x355c('0x19'),_0x302391[_0x355c('0x16')],_0x559577);_0x537586(_0xc051c7[_0x355c('0x15')](0x1f4,_0x302391[_0x355c('0x16')]));});});};exports[_0x355c('0x22')]=function(_0x4533cb){var _0x105b74=this;return new Promise(function(_0x3a1570,_0x4ce9b7){return db[_0x355c('0x23')][_0x355c('0x24')]({'raw':_0x4533cb[_0x355c('0x1a')]?_0x4533cb['options'][_0x355c('0x1b')]===undefined?!![]:![]:!![],'where':_0x4533cb['options']?_0x4533cb[_0x355c('0x1a')][_0x355c('0x1c')]||null:null,'attributes':_0x4533cb[_0x355c('0x1a')]?_0x4533cb['options'][_0x355c('0x1d')]||null:null,'include':_0x4533cb[_0x355c('0x1a')]?_0x4533cb['options'][_0x355c('0x20')]?_[_0x355c('0x1f')](_0x4533cb[_0x355c('0x1a')]['include'],function(_0x1ef90b){return{'model':db[_0x1ef90b['model']],'as':_0x1ef90b['as'],'attributes':_0x1ef90b[_0x355c('0x1d')],'include':_0x1ef90b[_0x355c('0x20')]?_[_0x355c('0x1f')](_0x1ef90b['include'],function(_0x956d3){return{'model':db[_0x956d3[_0x355c('0x21')]],'as':_0x956d3['as'],'attributes':_0x956d3[_0x355c('0x1d')],'include':_0x956d3['include']?_[_0x355c('0x1f')](_0x956d3['include'],function(_0x4615db){return{'model':db[_0x4615db[_0x355c('0x21')]],'as':_0x4615db['as'],'attributes':_0x4615db[_0x355c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x355c('0xe')](function(_0x31111d){logger['info']('ShowZohoAccount',_0x4533cb);logger[_0x355c('0x12')]('ShowZohoAccount',_0x4533cb,JSON['stringify'](_0x31111d));_0x3a1570(_0x31111d);})[_0x355c('0x18')](function(_0x1abaad){logger[_0x355c('0x15')]('ShowZohoAccount',_0x1abaad[_0x355c('0x16')],_0x4533cb);_0x4ce9b7(_0x105b74[_0x355c('0x15')](0x1f4,_0x1abaad[_0x355c('0x16')]));});});};
\ No newline at end of file
+var _0x3c91=['raw','where','attributes','limit','include','map','model','GetZohoAccount','debug','ShowZohoAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ZohoAccount','options'];(function(_0x2d70a5,_0x522bda){var _0x2cd65c=function(_0x170f57){while(--_0x170f57){_0x2d70a5['push'](_0x2d70a5['shift']());}};_0x2cd65c(++_0x522bda);}(_0x3c91,0x1af));var _0x13c9=function(_0x57d0f4,_0x138f21){_0x57d0f4=_0x57d0f4-0x0;var _0x125477=_0x3c91[_0x57d0f4];return _0x125477;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4332,_0x58b610,_0x44243f){return new BPromise(function(_0x196c2a,_0x5fd23){return client[_0x13c9('0xb')](_0x4c4332,_0x44243f)[_0x13c9('0xc')](function(_0x5370dd){logger['info'](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x58b610,_0x13c9('0xe'),JSON[_0x13c9('0xf')](_0x5370dd));if(_0x5370dd[_0x13c9('0x10')]){if(_0x5370dd[_0x13c9('0x10')][_0x13c9('0x11')]===0x1f4){logger[_0x13c9('0x10')](_0x13c9('0xd'),_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x5fd23(_0x5370dd['error']['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x196c2a(_0x5370dd[_0x13c9('0x10')]['message']);}else{logger[_0x13c9('0x13')](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));_0x196c2a(_0x5370dd[_0x13c9('0x14')][_0x13c9('0x12')]);}})[_0x13c9('0x15')](function(_0x238952){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x58b610,_0x238952);_0x5fd23(_0x238952);});});}exports['GetZohoAccount']=function(_0xd08fc0){var _0x1a6c06=this;return new Promise(function(_0x1dcaf7,_0x339e7f){return db[_0x13c9('0x16')]['findAll']({'raw':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x18')]===undefined?!![]:![]:!![],'where':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x19')]||null:null,'attributes':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0['options'][_0x13c9('0x1a')]||null:null,'limit':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x1b')]||null:null,'include':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x1c')],function(_0x5dfd9d){return{'model':db[_0x5dfd9d[_0x13c9('0x1e')]],'as':_0x5dfd9d['as'],'attributes':_0x5dfd9d[_0x13c9('0x1a')],'include':_0x5dfd9d[_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x5dfd9d[_0x13c9('0x1c')],function(_0x55b3d9){return{'model':db[_0x55b3d9[_0x13c9('0x1e')]],'as':_0x55b3d9['as'],'attributes':_0x55b3d9['attributes'],'include':_0x55b3d9['include']?_[_0x13c9('0x1d')](_0x55b3d9[_0x13c9('0x1c')],function(_0x3ca92a){return{'model':db[_0x3ca92a[_0x13c9('0x1e')]],'as':_0x3ca92a['as'],'attributes':_0x3ca92a[_0x13c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x13c9('0xc')](function(_0x3fcf1c){logger[_0x13c9('0x13')](_0x13c9('0x1f'),_0xd08fc0);logger[_0x13c9('0x20')]('GetZohoAccount',_0xd08fc0,JSON[_0x13c9('0xf')](_0x3fcf1c));_0x1dcaf7(_0x3fcf1c);})[_0x13c9('0x15')](function(_0x5d8997){logger[_0x13c9('0x10')](_0x13c9('0x1f'),_0x5d8997[_0x13c9('0x12')],_0xd08fc0);_0x339e7f(_0x1a6c06['error'](0x1f4,_0x5d8997['message']));});});};exports[_0x13c9('0x21')]=function(_0x35249b){var _0x1a1710=this;return new Promise(function(_0x4cb64a,_0x309606){return db[_0x13c9('0x16')][_0x13c9('0x22')]({'raw':_0x35249b[_0x13c9('0x17')]?_0x35249b[_0x13c9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x35249b[_0x13c9('0x17')]?_0x35249b[_0x13c9('0x17')][_0x13c9('0x19')]||null:null,'attributes':_0x35249b[_0x13c9('0x17')]?_0x35249b[_0x13c9('0x17')][_0x13c9('0x1a')]||null:null,'include':_0x35249b[_0x13c9('0x17')]?_0x35249b['options'][_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x35249b['options'][_0x13c9('0x1c')],function(_0x119b60){return{'model':db[_0x119b60[_0x13c9('0x1e')]],'as':_0x119b60['as'],'attributes':_0x119b60[_0x13c9('0x1a')],'include':_0x119b60[_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x119b60['include'],function(_0x4db35f){return{'model':db[_0x4db35f[_0x13c9('0x1e')]],'as':_0x4db35f['as'],'attributes':_0x4db35f[_0x13c9('0x1a')],'include':_0x4db35f[_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x4db35f['include'],function(_0x38d479){return{'model':db[_0x38d479[_0x13c9('0x1e')]],'as':_0x38d479['as'],'attributes':_0x38d479['attributes']};}):[]};}):[]};}):[]:[]})[_0x13c9('0xc')](function(_0x1cfdfc){logger[_0x13c9('0x13')]('ShowZohoAccount',_0x35249b);logger[_0x13c9('0x20')](_0x13c9('0x21'),_0x35249b,JSON[_0x13c9('0xf')](_0x1cfdfc));_0x4cb64a(_0x1cfdfc);})[_0x13c9('0x15')](function(_0x4e6cc3){logger['error'](_0x13c9('0x21'),_0x4e6cc3[_0x13c9('0x12')],_0x35249b);_0x309606(_0x1a1710['error'](0x1f4,_0x4e6cc3[_0x13c9('0x12')]));});});};
\ No newline at end of file
index 8a19148..3cdc841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5169=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','index','/:id','/:id/fields'];(function(_0x486215,_0x331114){var _0x2fcfa4=function(_0x3a92cc){while(--_0x3a92cc){_0x486215['push'](_0x486215['shift']());}};_0x2fcfa4(++_0x331114);}(_0x5169,0x187));var _0x9516=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5169[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9516('0x0'));var express=require('express');var router=express[_0x9516('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9516('0x2'));var config=require(_0x9516('0x3'));var controller=require('./intZohoConfiguration.controller');router[_0x9516('0x4')]('/',auth['isAuthenticated'](),controller[_0x9516('0x5')]);router[_0x9516('0x4')](_0x9516('0x6'),auth['isAuthenticated'](),controller['show']);router[_0x9516('0x4')](_0x9516('0x7'),auth[_0x9516('0x8')](),controller[_0x9516('0x9')]);router[_0x9516('0x4')](_0x9516('0xa'),auth[_0x9516('0x8')](),controller[_0x9516('0xb')]);router[_0x9516('0x4')](_0x9516('0xc'),auth[_0x9516('0x8')](),controller[_0x9516('0xd')]);router[_0x9516('0xe')]('/',auth[_0x9516('0x8')](),controller['create']);router[_0x9516('0xf')](_0x9516('0x6'),auth['isAuthenticated'](),controller['update']);router[_0x9516('0x10')]('/:id',auth[_0x9516('0x8')](),controller[_0x9516('0x11')]);module[_0x9516('0x12')]=router;
\ No newline at end of file
+var _0x99cc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x501c00,_0x1dc98b){var _0x5ad836=function(_0x21299f){while(--_0x21299f){_0x501c00['push'](_0x501c00['shift']());}};_0x5ad836(++_0x1dc98b);}(_0x99cc,0xa3));var _0xc99c=function(_0x1cd7b1,_0x2575c6){_0x1cd7b1=_0x1cd7b1-0x0;var _0x3abe81=_0x99cc[_0x1cd7b1];return _0x3abe81;};'use strict';var multer=require(_0xc99c('0x0'));var util=require(_0xc99c('0x1'));var path=require(_0xc99c('0x2'));var timeout=require(_0xc99c('0x3'));var express=require(_0xc99c('0x4'));var router=express[_0xc99c('0x5')]();var fs_extra=require(_0xc99c('0x6'));var auth=require(_0xc99c('0x7'));var interaction=require(_0xc99c('0x8'));var config=require(_0xc99c('0x9'));var controller=require('./intZohoConfiguration.controller');router[_0xc99c('0xa')]('/',auth[_0xc99c('0xb')](),controller[_0xc99c('0xc')]);router['get'](_0xc99c('0xd'),auth[_0xc99c('0xb')](),controller[_0xc99c('0xe')]);router[_0xc99c('0xa')]('/:id/fields',auth[_0xc99c('0xb')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xc99c('0xb')](),controller[_0xc99c('0xf')]);router[_0xc99c('0xa')](_0xc99c('0x10'),auth[_0xc99c('0xb')](),controller[_0xc99c('0x11')]);router[_0xc99c('0x12')]('/',auth[_0xc99c('0xb')](),controller[_0xc99c('0x13')]);router[_0xc99c('0x14')](_0xc99c('0xd'),auth[_0xc99c('0xb')](),controller['update']);router[_0xc99c('0x15')]('/:id',auth[_0xc99c('0xb')](),controller[_0xc99c('0x16')]);module[_0xc99c('0x17')]=router;
\ No newline at end of file
index 9c45032..5e9e51b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc47b=['lead','contact','nothing','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x272902,_0x17e222){var _0x480bfd=function(_0x5d8c56){while(--_0x5d8c56){_0x272902['push'](_0x272902['shift']());}};_0x480bfd(++_0x17e222);}(_0xc47b,0x14c));var _0xbc47=function(_0x2bd457,_0x3ba079){_0x2bd457=_0x2bd457-0x0;var _0x28bd7e=_0xc47b[_0x2bd457];return _0x28bd7e;};'use strict';var Sequelize=require(_0xbc47('0x0'));module[_0xbc47('0x1')]={'name':{'type':Sequelize[_0xbc47('0x2')]},'moduleCreate':{'type':Sequelize[_0xbc47('0x3')](_0xbc47('0x4'),_0xbc47('0x5'),_0xbc47('0x6')),'defaultValue':_0xbc47('0x4')},'moduleSearch':{'type':Sequelize[_0xbc47('0x3')]('contact_lead',_0xbc47('0x5'),_0xbc47('0x4')),'defaultValue':_0xbc47('0x7')},'description':{'type':Sequelize[_0xbc47('0x2')]}};
\ No newline at end of file
+var _0x058f=['ENUM','lead','nothing','contact_lead','contact','STRING','sequelize','exports'];(function(_0x5c68c7,_0x54ba85){var _0x4a94fc=function(_0x2fdd55){while(--_0x2fdd55){_0x5c68c7['push'](_0x5c68c7['shift']());}};_0x4a94fc(++_0x54ba85);}(_0x058f,0xc6));var _0xf058=function(_0x4cb99e,_0x1fc986){_0x4cb99e=_0x4cb99e-0x0;var _0x581ab8=_0x058f[_0x4cb99e];return _0x581ab8;};'use strict';var Sequelize=require(_0xf058('0x0'));module[_0xf058('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xf058('0x2')](_0xf058('0x3'),'contact',_0xf058('0x4')),'defaultValue':_0xf058('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf058('0x5'),_0xf058('0x6'),_0xf058('0x3')),'defaultValue':_0xf058('0x5')},'description':{'type':Sequelize[_0xf058('0x7')]}};
\ No newline at end of file
index c2d4f2f..dfef1e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6da=['ZohoConfiguration','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','ZohoField','order','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map'];(function(_0x4fb623,_0x55aa6b){var _0x5dcdf1=function(_0x5dd6e0){while(--_0x5dd6e0){_0x4fb623['push'](_0x4fb623['shift']());}};_0x5dcdf1(++_0x55aa6b);}(_0xb6da,0x75));var _0xab6d=function(_0x1edff9,_0x1918ea){_0x1edff9=_0x1edff9-0x0;var _0xb3c28f=_0xb6da[_0x1edff9];return _0xb3c28f;};'use strict';var emlformat=require(_0xab6d('0x0'));var rimraf=require(_0xab6d('0x1'));var zipdir=require(_0xab6d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab6d('0x3'));var BPromise=require(_0xab6d('0x4'));var Mustache=require(_0xab6d('0x5'));var util=require(_0xab6d('0x6'));var path=require(_0xab6d('0x7'));var sox=require('sox');var csv=require(_0xab6d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab6d('0x9'));var _=require(_0xab6d('0xa'));var squel=require(_0xab6d('0xb'));var crypto=require('crypto');var jsforce=require(_0xab6d('0xc'));var deskjs=require(_0xab6d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab6d('0xe'));var Redis=require(_0xab6d('0xf'));var authService=require(_0xab6d('0x10'));var qs=require(_0xab6d('0x11'));var as=require(_0xab6d('0x12'));var hardwareService=require(_0xab6d('0x13'));var logger=require(_0xab6d('0x14'))(_0xab6d('0x15'));var utils=require('../../config/utils');var config=require(_0xab6d('0x16'));var licenseUtil=require(_0xab6d('0x17'));var db=require(_0xab6d('0x18'))['db'];function respondWithStatusCode(_0x86dd46,_0x457b2f){_0x457b2f=_0x457b2f||0xcc;return function(_0x18d5ac){if(_0x18d5ac){return _0x86dd46[_0xab6d('0x19')](_0x457b2f);}return _0x86dd46[_0xab6d('0x1a')](_0x457b2f)['end']();};}function respondWithResult(_0x506138,_0x301b2f){_0x301b2f=_0x301b2f||0xc8;return function(_0xf8eb8e){if(_0xf8eb8e){return _0x506138[_0xab6d('0x1a')](_0x301b2f)[_0xab6d('0x1b')](_0xf8eb8e);}};}function respondWithFilteredResult(_0x3bdbde,_0xded223){return function(_0x4a49c1){if(_0x4a49c1){var _0x190b3b=typeof _0xded223['offset']==='undefined'&&typeof _0xded223[_0xab6d('0x1c')]==='undefined';var _0x1f51b5=_0x4a49c1['count'];var _0x493fd3=_0x190b3b?0x0:_0xded223[_0xab6d('0x1d')];var _0x22d8d9=_0x190b3b?_0x4a49c1[_0xab6d('0x1e')]:_0xded223[_0xab6d('0x1d')]+_0xded223['limit'];var _0x392f20;if(_0x22d8d9>=_0x1f51b5){_0x22d8d9=_0x1f51b5;_0x392f20=0xc8;}else{_0x392f20=0xce;}_0x3bdbde['status'](_0x392f20);return _0x3bdbde[_0xab6d('0x1f')](_0xab6d('0x20'),_0x493fd3+'-'+_0x22d8d9+'/'+_0x1f51b5)['json'](_0x4a49c1);}return null;};}function patchUpdates(_0x2ee04e){return function(_0x509447){try{jsonpatch['apply'](_0x509447,_0x2ee04e,!![]);}catch(_0x346195){return BPromise[_0xab6d('0x21')](_0x346195);}return _0x509447[_0xab6d('0x22')]();};}function saveUpdates(_0x57c85c,_0x56330d){return function(_0x47470c){if(_0x47470c){return _0x47470c[_0xab6d('0x23')](_0x57c85c)[_0xab6d('0x24')](function(_0x642711){return _0x642711;});}return null;};}function removeEntity(_0x1514d1,_0x4cf9b3){return function(_0x3ed0dc){if(_0x3ed0dc){return _0x3ed0dc[_0xab6d('0x25')]()[_0xab6d('0x24')](function(){_0x1514d1[_0xab6d('0x1a')](0xcc)[_0xab6d('0x26')]();});}};}function handleEntityNotFound(_0x4c649a,_0x5c3f65){return function(_0x42fba0){if(!_0x42fba0){_0x4c649a[_0xab6d('0x19')](0x194);}return _0x42fba0;};}function handleError(_0xc24ee4,_0xc23157){_0xc23157=_0xc23157||0x1f4;return function(_0x1b6835){logger[_0xab6d('0x27')](_0x1b6835[_0xab6d('0x28')]);if(_0x1b6835['name']){delete _0x1b6835[_0xab6d('0x29')];}_0xc24ee4[_0xab6d('0x1a')](_0xc23157)[_0xab6d('0x2a')](_0x1b6835);};}exports[_0xab6d('0x2b')]=function(_0x25d269,_0x35201e){var _0x1df6d9={},_0x33f55c={},_0x98e2f9={'count':0x0,'rows':[]};var _0x21900a=_[_0xab6d('0x2c')](db[_0xab6d('0x2d')]['rawAttributes'],function(_0x5da6ae){return{'name':_0x5da6ae['fieldName'],'type':_0x5da6ae[_0xab6d('0x2e')]['key']};});_0x33f55c[_0xab6d('0x2f')]=_[_0xab6d('0x2c')](_0x21900a,_0xab6d('0x29'));_0x33f55c[_0xab6d('0x30')]=_[_0xab6d('0x31')](_0x25d269[_0xab6d('0x30')]);_0x33f55c[_0xab6d('0x32')]=_[_0xab6d('0x33')](_0x33f55c[_0xab6d('0x2f')],_0x33f55c[_0xab6d('0x30')]);_0x1df6d9[_0xab6d('0x34')]=_[_0xab6d('0x33')](_0x33f55c[_0xab6d('0x2f')],qs[_0xab6d('0x35')](_0x25d269[_0xab6d('0x30')][_0xab6d('0x35')]));_0x1df6d9['attributes']=_0x1df6d9['attributes'][_0xab6d('0x36')]?_0x1df6d9[_0xab6d('0x34')]:_0x33f55c['model'];if(!_0x25d269[_0xab6d('0x30')][_0xab6d('0x37')](_0xab6d('0x38'))){_0x1df6d9['limit']=qs[_0xab6d('0x1c')](_0x25d269['query']['limit']);_0x1df6d9[_0xab6d('0x1d')]=qs[_0xab6d('0x1d')](_0x25d269[_0xab6d('0x30')][_0xab6d('0x1d')]);}_0x1df6d9['order']=qs[_0xab6d('0x39')](_0x25d269['query'][_0xab6d('0x39')]);_0x1df6d9[_0xab6d('0x3a')]=qs[_0xab6d('0x32')](_['pick'](_0x25d269[_0xab6d('0x30')],_0x33f55c[_0xab6d('0x32')]),_0x21900a);if(_0x25d269[_0xab6d('0x30')][_0xab6d('0x3b')]){_0x1df6d9[_0xab6d('0x3a')]=_[_0xab6d('0x3c')](_0x1df6d9[_0xab6d('0x3a')],{'$or':_[_0xab6d('0x2c')](_0x21900a,function(_0x467286){if(_0x467286[_0xab6d('0x2e')]!==_0xab6d('0x3d')){var _0x1c90ed={};_0x1c90ed[_0x467286[_0xab6d('0x29')]]={'$like':'%'+_0x25d269[_0xab6d('0x30')][_0xab6d('0x3b')]+'%'};return _0x1c90ed;}})});}_0x1df6d9=_['merge']({},_0x1df6d9,_0x25d269[_0xab6d('0x3e')]);var _0x5753aa={'where':_0x1df6d9[_0xab6d('0x3a')]};return db['ZohoConfiguration'][_0xab6d('0x1e')](_0x5753aa)['then'](function(_0x8433e7){_0x98e2f9[_0xab6d('0x1e')]=_0x8433e7;if(_0x25d269[_0xab6d('0x30')][_0xab6d('0x3f')]){_0x1df6d9[_0xab6d('0x40')]=[{'all':!![]}];}return db[_0xab6d('0x2d')][_0xab6d('0x41')](_0x1df6d9);})['then'](function(_0x234890){_0x98e2f9[_0xab6d('0x42')]=_0x234890;return _0x98e2f9;})[_0xab6d('0x24')](respondWithFilteredResult(_0x35201e,_0x1df6d9))[_0xab6d('0x43')](handleError(_0x35201e,null));};exports[_0xab6d('0x44')]=function(_0x46f955,_0x1fa8c1){var _0xa0d36={'raw':![],'where':{'id':_0x46f955[_0xab6d('0x45')]['id']}},_0x123b15={};_0x123b15[_0xab6d('0x2f')]=_[_0xab6d('0x31')](db[_0xab6d('0x2d')][_0xab6d('0x46')]);_0x123b15[_0xab6d('0x30')]=_['keys'](_0x46f955[_0xab6d('0x30')]);_0x123b15['filters']=_[_0xab6d('0x33')](_0x123b15[_0xab6d('0x2f')],_0x123b15[_0xab6d('0x30')]);_0xa0d36[_0xab6d('0x34')]=_[_0xab6d('0x33')](_0x123b15['model'],qs[_0xab6d('0x35')](_0x46f955[_0xab6d('0x30')][_0xab6d('0x35')]));_0xa0d36[_0xab6d('0x34')]=_0xa0d36[_0xab6d('0x34')]['length']?_0xa0d36['attributes']:_0x123b15[_0xab6d('0x2f')];if(_0x46f955[_0xab6d('0x30')][_0xab6d('0x3f')]){_0xa0d36[_0xab6d('0x40')]=[{'all':!![]}];}_0xa0d36=_[_0xab6d('0x3c')]({},_0xa0d36,_0x46f955['options']);return db[_0xab6d('0x2d')][_0xab6d('0x47')](_0xa0d36)[_0xab6d('0x24')](handleEntityNotFound(_0x1fa8c1,null))[_0xab6d('0x24')](respondWithResult(_0x1fa8c1,null))[_0xab6d('0x43')](handleError(_0x1fa8c1,null));};exports[_0xab6d('0x48')]=function(_0x4b2d0e,_0x5abf16){return db[_0xab6d('0x2d')][_0xab6d('0x48')](_0x4b2d0e[_0xab6d('0x49')],{})[_0xab6d('0x24')](respondWithResult(_0x5abf16,0xc9))[_0xab6d('0x43')](handleError(_0x5abf16,null));};exports[_0xab6d('0x23')]=function(_0x45fead,_0x387e0b){if(_0x45fead['body']['id']){delete _0x45fead[_0xab6d('0x49')]['id'];}return db[_0xab6d('0x2d')][_0xab6d('0x47')]({'where':{'id':_0x45fead[_0xab6d('0x45')]['id']}})[_0xab6d('0x24')](handleEntityNotFound(_0x387e0b,null))[_0xab6d('0x24')](saveUpdates(_0x45fead[_0xab6d('0x49')],null))[_0xab6d('0x24')](respondWithResult(_0x387e0b,null))[_0xab6d('0x43')](handleError(_0x387e0b,null));};exports['destroy']=function(_0xfcb355,_0x2bc5c5){return db[_0xab6d('0x2d')][_0xab6d('0x47')]({'where':{'id':_0xfcb355[_0xab6d('0x45')]['id']}})[_0xab6d('0x24')](handleEntityNotFound(_0x2bc5c5,null))[_0xab6d('0x24')](removeEntity(_0x2bc5c5,null))[_0xab6d('0x43')](handleError(_0x2bc5c5,null));};exports[_0xab6d('0x4a')]=function(_0x1f2467,_0x428eb0,_0x455be9){var _0x19fe70={};var _0x22e9bc={};var _0x10cd2c;var _0x433db4;return db['ZohoConfiguration'][_0xab6d('0x4b')]({'where':{'id':_0x1f2467[_0xab6d('0x45')]['id']}})[_0xab6d('0x24')](handleEntityNotFound(_0x428eb0,null))[_0xab6d('0x24')](function(_0x3c10d1){if(_0x3c10d1){_0x10cd2c=_0x3c10d1;_0x22e9bc['model']=_['keys'](db[_0xab6d('0x4c')][_0xab6d('0x46')]);_0x22e9bc[_0xab6d('0x30')]=_['keys'](_0x1f2467[_0xab6d('0x30')]);_0x22e9bc[_0xab6d('0x32')]=_[_0xab6d('0x33')](_0x22e9bc[_0xab6d('0x2f')],_0x22e9bc[_0xab6d('0x30')]);_0x19fe70[_0xab6d('0x34')]=_[_0xab6d('0x33')](_0x22e9bc['model'],qs[_0xab6d('0x35')](_0x1f2467[_0xab6d('0x30')]['fields']));_0x19fe70[_0xab6d('0x34')]=_0x19fe70[_0xab6d('0x34')]['length']?_0x19fe70['attributes']:_0x22e9bc['model'];_0x19fe70[_0xab6d('0x4d')]=qs[_0xab6d('0x39')](_0x1f2467[_0xab6d('0x30')][_0xab6d('0x39')]);_0x19fe70[_0xab6d('0x3a')]=qs[_0xab6d('0x32')](_['pick'](_0x1f2467[_0xab6d('0x30')],_0x22e9bc[_0xab6d('0x32')]));if(_0x1f2467[_0xab6d('0x30')][_0xab6d('0x3b')]){_0x19fe70[_0xab6d('0x3a')]=_[_0xab6d('0x3c')](_0x19fe70[_0xab6d('0x3a')],{'$or':_[_0xab6d('0x2c')](_0x19fe70[_0xab6d('0x34')],function(_0x554450){var _0x6cc149={};_0x6cc149[_0x554450]={'$like':'%'+_0x1f2467[_0xab6d('0x30')][_0xab6d('0x3b')]+'%'};return _0x6cc149;})});}_0x19fe70=_['merge']({},_0x19fe70,_0x1f2467['options']);return _0x10cd2c[_0xab6d('0x4a')](_0x19fe70);}})[_0xab6d('0x24')](function(_0x4d882f){if(_0x4d882f){_0x433db4=_0x4d882f['length'];if(!_0x1f2467[_0xab6d('0x30')][_0xab6d('0x37')](_0xab6d('0x38'))){_0x19fe70[_0xab6d('0x1c')]=qs['limit'](_0x1f2467[_0xab6d('0x30')][_0xab6d('0x1c')]);_0x19fe70[_0xab6d('0x1d')]=qs[_0xab6d('0x1d')](_0x1f2467[_0xab6d('0x30')]['offset']);}return _0x10cd2c['getFields'](_0x19fe70);}})['then'](function(_0x17ada7){if(_0x17ada7){return _0x17ada7?{'count':_0x433db4,'rows':_0x17ada7}:null;}})[_0xab6d('0x24')](respondWithResult(_0x428eb0,null))[_0xab6d('0x43')](handleError(_0x428eb0,null));};exports[_0xab6d('0x4e')]=function(_0x2de7ae,_0x473f87,_0x5f4235){var _0x4eaf55={};var _0x5e4340={};var _0x1948aa;var _0x4d406a;return db['ZohoConfiguration'][_0xab6d('0x4b')]({'where':{'id':_0x2de7ae[_0xab6d('0x45')]['id']}})['then'](handleEntityNotFound(_0x473f87,null))[_0xab6d('0x24')](function(_0x206bb4){if(_0x206bb4){_0x1948aa=_0x206bb4;_0x5e4340[_0xab6d('0x2f')]=_['keys'](db['ZohoField'][_0xab6d('0x46')]);_0x5e4340[_0xab6d('0x30')]=_['keys'](_0x2de7ae[_0xab6d('0x30')]);_0x5e4340['filters']=_[_0xab6d('0x33')](_0x5e4340[_0xab6d('0x2f')],_0x5e4340['query']);_0x4eaf55['attributes']=_[_0xab6d('0x33')](_0x5e4340[_0xab6d('0x2f')],qs[_0xab6d('0x35')](_0x2de7ae['query'][_0xab6d('0x35')]));_0x4eaf55[_0xab6d('0x34')]=_0x4eaf55[_0xab6d('0x34')]['length']?_0x4eaf55['attributes']:_0x5e4340[_0xab6d('0x2f')];_0x4eaf55['order']=qs[_0xab6d('0x39')](_0x2de7ae[_0xab6d('0x30')][_0xab6d('0x39')]);_0x4eaf55['where']=qs['filters'](_[_0xab6d('0x4f')](_0x2de7ae['query'],_0x5e4340[_0xab6d('0x32')]));if(_0x2de7ae[_0xab6d('0x30')][_0xab6d('0x3b')]){_0x4eaf55[_0xab6d('0x3a')]=_[_0xab6d('0x3c')](_0x4eaf55[_0xab6d('0x3a')],{'$or':_[_0xab6d('0x2c')](_0x4eaf55['attributes'],function(_0x2a0176){var _0x4d05ca={};_0x4d05ca[_0x2a0176]={'$like':'%'+_0x2de7ae[_0xab6d('0x30')]['filter']+'%'};return _0x4d05ca;})});}_0x4eaf55=_[_0xab6d('0x3c')]({},_0x4eaf55,_0x2de7ae[_0xab6d('0x3e')]);return _0x1948aa['getSubjects'](_0x4eaf55);}})['then'](function(_0x5a573d){if(_0x5a573d){_0x4d406a=_0x5a573d[_0xab6d('0x36')];if(!_0x2de7ae[_0xab6d('0x30')]['hasOwnProperty'](_0xab6d('0x38'))){_0x4eaf55[_0xab6d('0x1c')]=qs[_0xab6d('0x1c')](_0x2de7ae[_0xab6d('0x30')][_0xab6d('0x1c')]);_0x4eaf55['offset']=qs[_0xab6d('0x1d')](_0x2de7ae[_0xab6d('0x30')][_0xab6d('0x1d')]);}return _0x1948aa['getSubjects'](_0x4eaf55);}})[_0xab6d('0x24')](function(_0x24de42){if(_0x24de42){return _0x24de42?{'count':_0x4d406a,'rows':_0x24de42}:null;}})[_0xab6d('0x24')](respondWithResult(_0x473f87,null))[_0xab6d('0x43')](handleError(_0x473f87,null));};exports['getDescriptions']=function(_0x55afe4,_0x1175df,_0xc6d92d){var _0x416eb7={};var _0xca39a5={};var _0x651a58;var _0x53ae6c;return db[_0xab6d('0x2d')]['findOne']({'where':{'id':_0x55afe4[_0xab6d('0x45')]['id']}})[_0xab6d('0x24')](handleEntityNotFound(_0x1175df,null))[_0xab6d('0x24')](function(_0x806fd9){if(_0x806fd9){_0x651a58=_0x806fd9;_0xca39a5['model']=_[_0xab6d('0x31')](db[_0xab6d('0x4c')]['rawAttributes']);_0xca39a5[_0xab6d('0x30')]=_['keys'](_0x55afe4[_0xab6d('0x30')]);_0xca39a5['filters']=_[_0xab6d('0x33')](_0xca39a5[_0xab6d('0x2f')],_0xca39a5[_0xab6d('0x30')]);_0x416eb7['attributes']=_[_0xab6d('0x33')](_0xca39a5['model'],qs[_0xab6d('0x35')](_0x55afe4[_0xab6d('0x30')]['fields']));_0x416eb7['attributes']=_0x416eb7[_0xab6d('0x34')]['length']?_0x416eb7['attributes']:_0xca39a5['model'];_0x416eb7[_0xab6d('0x4d')]=qs['sort'](_0x55afe4[_0xab6d('0x30')][_0xab6d('0x39')]);_0x416eb7[_0xab6d('0x3a')]=qs[_0xab6d('0x32')](_[_0xab6d('0x4f')](_0x55afe4[_0xab6d('0x30')],_0xca39a5[_0xab6d('0x32')]));if(_0x55afe4['query']['filter']){_0x416eb7[_0xab6d('0x3a')]=_[_0xab6d('0x3c')](_0x416eb7['where'],{'$or':_['map'](_0x416eb7[_0xab6d('0x34')],function(_0x223871){var _0x3edf10={};_0x3edf10[_0x223871]={'$like':'%'+_0x55afe4[_0xab6d('0x30')][_0xab6d('0x3b')]+'%'};return _0x3edf10;})});}_0x416eb7=_['merge']({},_0x416eb7,_0x55afe4['options']);return _0x651a58[_0xab6d('0x50')](_0x416eb7);}})[_0xab6d('0x24')](function(_0x234e26){if(_0x234e26){_0x53ae6c=_0x234e26[_0xab6d('0x36')];if(!_0x55afe4[_0xab6d('0x30')][_0xab6d('0x37')](_0xab6d('0x38'))){_0x416eb7[_0xab6d('0x1c')]=qs[_0xab6d('0x1c')](_0x55afe4[_0xab6d('0x30')]['limit']);_0x416eb7[_0xab6d('0x1d')]=qs[_0xab6d('0x1d')](_0x55afe4[_0xab6d('0x30')]['offset']);}return _0x651a58[_0xab6d('0x50')](_0x416eb7);}})[_0xab6d('0x24')](function(_0x34da20){if(_0x34da20){return _0x34da20?{'count':_0x53ae6c,'rows':_0x34da20}:null;}})[_0xab6d('0x24')](respondWithResult(_0x1175df,null))[_0xab6d('0x43')](handleError(_0x1175df,null));};
\ No newline at end of file
+var _0x8c2f=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','count','limit','Content-Range','json','apply','reject','save','update','then','name','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','getFields','rawAttributes','getSubjects','findOne','ZohoField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x964643,_0x300870){var _0x41a870=function(_0x3bc428){while(--_0x3bc428){_0x964643['push'](_0x964643['shift']());}};_0x41a870(++_0x300870);}(_0x8c2f,0x94));var _0xf8c2=function(_0x20259c,_0xe43fb2){_0x20259c=_0x20259c-0x0;var _0x4d988e=_0x8c2f[_0x20259c];return _0x4d988e;};'use strict';var emlformat=require(_0xf8c2('0x0'));var rimraf=require(_0xf8c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8c2('0x2'));var rp=require(_0xf8c2('0x3'));var moment=require('moment');var BPromise=require(_0xf8c2('0x4'));var Mustache=require(_0xf8c2('0x5'));var util=require(_0xf8c2('0x6'));var path=require(_0xf8c2('0x7'));var sox=require(_0xf8c2('0x8'));var csv=require(_0xf8c2('0x9'));var ejs=require(_0xf8c2('0xa'));var fs=require('fs');var fs_extra=require(_0xf8c2('0xb'));var _=require(_0xf8c2('0xc'));var squel=require(_0xf8c2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf8c2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf8c2('0x9'));var querystring=require(_0xf8c2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf8c2('0x10'));var qs=require(_0xf8c2('0x11'));var as=require(_0xf8c2('0x12'));var hardwareService=require(_0xf8c2('0x13'));var logger=require(_0xf8c2('0x14'))(_0xf8c2('0x15'));var utils=require('../../config/utils');var config=require(_0xf8c2('0x16'));var licenseUtil=require(_0xf8c2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5846b4,_0x3e05fc){_0x3e05fc=_0x3e05fc||0xcc;return function(_0x497550){if(_0x497550){return _0x5846b4[_0xf8c2('0x18')](_0x3e05fc);}return _0x5846b4['status'](_0x3e05fc)[_0xf8c2('0x19')]();};}function respondWithResult(_0x17fa82,_0x52c7c1){_0x52c7c1=_0x52c7c1||0xc8;return function(_0x49fc6d){if(_0x49fc6d){return _0x17fa82[_0xf8c2('0x1a')](_0x52c7c1)['json'](_0x49fc6d);}};}function respondWithFilteredResult(_0x2aa80e,_0x464968){return function(_0x46522c){if(_0x46522c){var _0xb0386c=typeof _0x464968[_0xf8c2('0x1b')]==='undefined'&&typeof _0x464968['limit']==='undefined';var _0x5b8d8a=_0x46522c['count'];var _0x4970f5=_0xb0386c?0x0:_0x464968[_0xf8c2('0x1b')];var _0x4215e3=_0xb0386c?_0x46522c[_0xf8c2('0x1c')]:_0x464968[_0xf8c2('0x1b')]+_0x464968[_0xf8c2('0x1d')];var _0x30ba79;if(_0x4215e3>=_0x5b8d8a){_0x4215e3=_0x5b8d8a;_0x30ba79=0xc8;}else{_0x30ba79=0xce;}_0x2aa80e[_0xf8c2('0x1a')](_0x30ba79);return _0x2aa80e['set'](_0xf8c2('0x1e'),_0x4970f5+'-'+_0x4215e3+'/'+_0x5b8d8a)[_0xf8c2('0x1f')](_0x46522c);}return null;};}function patchUpdates(_0xd5adc2){return function(_0x4b1450){try{jsonpatch[_0xf8c2('0x20')](_0x4b1450,_0xd5adc2,!![]);}catch(_0x4cd77d){return BPromise[_0xf8c2('0x21')](_0x4cd77d);}return _0x4b1450[_0xf8c2('0x22')]();};}function saveUpdates(_0x5e1b0b,_0x42ce6b){return function(_0x15ee00){if(_0x15ee00){return _0x15ee00[_0xf8c2('0x23')](_0x5e1b0b)[_0xf8c2('0x24')](function(_0x3438bc){return _0x3438bc;});}return null;};}function removeEntity(_0x211118,_0x56e7e9){return function(_0x55e9ae){if(_0x55e9ae){return _0x55e9ae['destroy']()[_0xf8c2('0x24')](function(){_0x211118[_0xf8c2('0x1a')](0xcc)[_0xf8c2('0x19')]();});}};}function handleEntityNotFound(_0x34ba60,_0x29932c){return function(_0x1b46f0){if(!_0x1b46f0){_0x34ba60[_0xf8c2('0x18')](0x194);}return _0x1b46f0;};}function handleError(_0x4689ff,_0x575c71){_0x575c71=_0x575c71||0x1f4;return function(_0x52e4ce){logger['error'](_0x52e4ce['stack']);if(_0x52e4ce[_0xf8c2('0x25')]){delete _0x52e4ce['name'];}_0x4689ff[_0xf8c2('0x1a')](_0x575c71)['send'](_0x52e4ce);};}exports[_0xf8c2('0x26')]=function(_0x1c076c,_0x100f4c){var _0xc23de9={},_0xb6f7f6={},_0x348526={'count':0x0,'rows':[]};var _0x1a1ac7=_[_0xf8c2('0x27')](db[_0xf8c2('0x28')]['rawAttributes'],function(_0x3b4da5){return{'name':_0x3b4da5[_0xf8c2('0x29')],'type':_0x3b4da5[_0xf8c2('0x2a')][_0xf8c2('0x2b')]};});_0xb6f7f6[_0xf8c2('0x2c')]=_['map'](_0x1a1ac7,'name');_0xb6f7f6[_0xf8c2('0x2d')]=_[_0xf8c2('0x2e')](_0x1c076c[_0xf8c2('0x2d')]);_0xb6f7f6[_0xf8c2('0x2f')]=_[_0xf8c2('0x30')](_0xb6f7f6['model'],_0xb6f7f6[_0xf8c2('0x2d')]);_0xc23de9[_0xf8c2('0x31')]=_[_0xf8c2('0x30')](_0xb6f7f6[_0xf8c2('0x2c')],qs[_0xf8c2('0x32')](_0x1c076c[_0xf8c2('0x2d')][_0xf8c2('0x32')]));_0xc23de9[_0xf8c2('0x31')]=_0xc23de9['attributes'][_0xf8c2('0x33')]?_0xc23de9[_0xf8c2('0x31')]:_0xb6f7f6[_0xf8c2('0x2c')];if(!_0x1c076c['query'][_0xf8c2('0x34')](_0xf8c2('0x35'))){_0xc23de9['limit']=qs['limit'](_0x1c076c[_0xf8c2('0x2d')]['limit']);_0xc23de9[_0xf8c2('0x1b')]=qs[_0xf8c2('0x1b')](_0x1c076c['query'][_0xf8c2('0x1b')]);}_0xc23de9[_0xf8c2('0x36')]=qs[_0xf8c2('0x37')](_0x1c076c[_0xf8c2('0x2d')][_0xf8c2('0x37')]);_0xc23de9[_0xf8c2('0x38')]=qs['filters'](_[_0xf8c2('0x39')](_0x1c076c[_0xf8c2('0x2d')],_0xb6f7f6[_0xf8c2('0x2f')]),_0x1a1ac7);if(_0x1c076c['query'][_0xf8c2('0x3a')]){_0xc23de9[_0xf8c2('0x38')]=_[_0xf8c2('0x3b')](_0xc23de9[_0xf8c2('0x38')],{'$or':_[_0xf8c2('0x27')](_0x1a1ac7,function(_0x50b001){if(_0x50b001['type']!==_0xf8c2('0x3c')){var _0x14123f={};_0x14123f[_0x50b001['name']]={'$like':'%'+_0x1c076c[_0xf8c2('0x2d')]['filter']+'%'};return _0x14123f;}})});}_0xc23de9=_[_0xf8c2('0x3b')]({},_0xc23de9,_0x1c076c[_0xf8c2('0x3d')]);var _0x2b9475={'where':_0xc23de9[_0xf8c2('0x38')]};return db[_0xf8c2('0x28')][_0xf8c2('0x1c')](_0x2b9475)[_0xf8c2('0x24')](function(_0x28e2f7){_0x348526['count']=_0x28e2f7;if(_0x1c076c[_0xf8c2('0x2d')][_0xf8c2('0x3e')]){_0xc23de9[_0xf8c2('0x3f')]=[{'all':!![]}];}return db[_0xf8c2('0x28')][_0xf8c2('0x40')](_0xc23de9);})[_0xf8c2('0x24')](function(_0x225912){_0x348526['rows']=_0x225912;return _0x348526;})[_0xf8c2('0x24')](respondWithFilteredResult(_0x100f4c,_0xc23de9))[_0xf8c2('0x41')](handleError(_0x100f4c,null));};exports['show']=function(_0x2898c2,_0xbfcebe){var _0x1cc5a5={'raw':![],'where':{'id':_0x2898c2[_0xf8c2('0x42')]['id']}},_0x561ced={};_0x561ced[_0xf8c2('0x2c')]=_[_0xf8c2('0x2e')](db[_0xf8c2('0x28')]['rawAttributes']);_0x561ced[_0xf8c2('0x2d')]=_[_0xf8c2('0x2e')](_0x2898c2[_0xf8c2('0x2d')]);_0x561ced['filters']=_['intersection'](_0x561ced[_0xf8c2('0x2c')],_0x561ced['query']);_0x1cc5a5[_0xf8c2('0x31')]=_[_0xf8c2('0x30')](_0x561ced[_0xf8c2('0x2c')],qs['fields'](_0x2898c2[_0xf8c2('0x2d')][_0xf8c2('0x32')]));_0x1cc5a5[_0xf8c2('0x31')]=_0x1cc5a5[_0xf8c2('0x31')][_0xf8c2('0x33')]?_0x1cc5a5[_0xf8c2('0x31')]:_0x561ced[_0xf8c2('0x2c')];if(_0x2898c2[_0xf8c2('0x2d')][_0xf8c2('0x3e')]){_0x1cc5a5[_0xf8c2('0x3f')]=[{'all':!![]}];}_0x1cc5a5=_['merge']({},_0x1cc5a5,_0x2898c2['options']);return db[_0xf8c2('0x28')][_0xf8c2('0x43')](_0x1cc5a5)[_0xf8c2('0x24')](handleEntityNotFound(_0xbfcebe,null))[_0xf8c2('0x24')](respondWithResult(_0xbfcebe,null))['catch'](handleError(_0xbfcebe,null));};exports[_0xf8c2('0x44')]=function(_0x398e4e,_0x2eabb9){return db[_0xf8c2('0x28')]['create'](_0x398e4e[_0xf8c2('0x45')],{})[_0xf8c2('0x24')](respondWithResult(_0x2eabb9,0xc9))[_0xf8c2('0x41')](handleError(_0x2eabb9,null));};exports[_0xf8c2('0x23')]=function(_0x46b995,_0x32ee69){if(_0x46b995['body']['id']){delete _0x46b995[_0xf8c2('0x45')]['id'];}return db[_0xf8c2('0x28')][_0xf8c2('0x43')]({'where':{'id':_0x46b995['params']['id']}})[_0xf8c2('0x24')](handleEntityNotFound(_0x32ee69,null))[_0xf8c2('0x24')](saveUpdates(_0x46b995['body'],null))[_0xf8c2('0x24')](respondWithResult(_0x32ee69,null))['catch'](handleError(_0x32ee69,null));};exports['destroy']=function(_0x560bf5,_0xdc4fde){return db[_0xf8c2('0x28')]['find']({'where':{'id':_0x560bf5['params']['id']}})[_0xf8c2('0x24')](handleEntityNotFound(_0xdc4fde,null))['then'](removeEntity(_0xdc4fde,null))['catch'](handleError(_0xdc4fde,null));};exports[_0xf8c2('0x46')]=function(_0x5ab73c,_0x25ff46,_0x10f4b9){var _0x11fc8d={};var _0x561df4={};var _0x19845d;var _0x3b322e;return db[_0xf8c2('0x28')]['findOne']({'where':{'id':_0x5ab73c[_0xf8c2('0x42')]['id']}})[_0xf8c2('0x24')](handleEntityNotFound(_0x25ff46,null))[_0xf8c2('0x24')](function(_0x5333fd){if(_0x5333fd){_0x19845d=_0x5333fd;_0x561df4[_0xf8c2('0x2c')]=_['keys'](db['ZohoField'][_0xf8c2('0x47')]);_0x561df4[_0xf8c2('0x2d')]=_[_0xf8c2('0x2e')](_0x5ab73c['query']);_0x561df4[_0xf8c2('0x2f')]=_[_0xf8c2('0x30')](_0x561df4[_0xf8c2('0x2c')],_0x561df4[_0xf8c2('0x2d')]);_0x11fc8d[_0xf8c2('0x31')]=_[_0xf8c2('0x30')](_0x561df4[_0xf8c2('0x2c')],qs[_0xf8c2('0x32')](_0x5ab73c[_0xf8c2('0x2d')][_0xf8c2('0x32')]));_0x11fc8d[_0xf8c2('0x31')]=_0x11fc8d[_0xf8c2('0x31')][_0xf8c2('0x33')]?_0x11fc8d[_0xf8c2('0x31')]:_0x561df4[_0xf8c2('0x2c')];_0x11fc8d[_0xf8c2('0x36')]=qs[_0xf8c2('0x37')](_0x5ab73c[_0xf8c2('0x2d')][_0xf8c2('0x37')]);_0x11fc8d[_0xf8c2('0x38')]=qs[_0xf8c2('0x2f')](_[_0xf8c2('0x39')](_0x5ab73c[_0xf8c2('0x2d')],_0x561df4[_0xf8c2('0x2f')]));if(_0x5ab73c['query'][_0xf8c2('0x3a')]){_0x11fc8d['where']=_[_0xf8c2('0x3b')](_0x11fc8d[_0xf8c2('0x38')],{'$or':_['map'](_0x11fc8d[_0xf8c2('0x31')],function(_0x1cdcac){var _0x4523b1={};_0x4523b1[_0x1cdcac]={'$like':'%'+_0x5ab73c[_0xf8c2('0x2d')][_0xf8c2('0x3a')]+'%'};return _0x4523b1;})});}_0x11fc8d=_[_0xf8c2('0x3b')]({},_0x11fc8d,_0x5ab73c[_0xf8c2('0x3d')]);return _0x19845d[_0xf8c2('0x46')](_0x11fc8d);}})['then'](function(_0x384fbe){if(_0x384fbe){_0x3b322e=_0x384fbe[_0xf8c2('0x33')];if(!_0x5ab73c[_0xf8c2('0x2d')][_0xf8c2('0x34')](_0xf8c2('0x35'))){_0x11fc8d[_0xf8c2('0x1d')]=qs['limit'](_0x5ab73c['query'][_0xf8c2('0x1d')]);_0x11fc8d['offset']=qs[_0xf8c2('0x1b')](_0x5ab73c[_0xf8c2('0x2d')][_0xf8c2('0x1b')]);}return _0x19845d[_0xf8c2('0x46')](_0x11fc8d);}})[_0xf8c2('0x24')](function(_0x2be250){if(_0x2be250){return _0x2be250?{'count':_0x3b322e,'rows':_0x2be250}:null;}})[_0xf8c2('0x24')](respondWithResult(_0x25ff46,null))[_0xf8c2('0x41')](handleError(_0x25ff46,null));};exports[_0xf8c2('0x48')]=function(_0xc83aa5,_0x457d8c,_0x4e7883){var _0x3c0c15={};var _0x168e01={};var _0x14efee;var _0x8fb16e;return db[_0xf8c2('0x28')][_0xf8c2('0x49')]({'where':{'id':_0xc83aa5[_0xf8c2('0x42')]['id']}})[_0xf8c2('0x24')](handleEntityNotFound(_0x457d8c,null))[_0xf8c2('0x24')](function(_0x28f354){if(_0x28f354){_0x14efee=_0x28f354;_0x168e01['model']=_['keys'](db[_0xf8c2('0x4a')][_0xf8c2('0x47')]);_0x168e01['query']=_[_0xf8c2('0x2e')](_0xc83aa5[_0xf8c2('0x2d')]);_0x168e01[_0xf8c2('0x2f')]=_[_0xf8c2('0x30')](_0x168e01['model'],_0x168e01[_0xf8c2('0x2d')]);_0x3c0c15[_0xf8c2('0x31')]=_[_0xf8c2('0x30')](_0x168e01['model'],qs[_0xf8c2('0x32')](_0xc83aa5[_0xf8c2('0x2d')][_0xf8c2('0x32')]));_0x3c0c15[_0xf8c2('0x31')]=_0x3c0c15[_0xf8c2('0x31')][_0xf8c2('0x33')]?_0x3c0c15[_0xf8c2('0x31')]:_0x168e01[_0xf8c2('0x2c')];_0x3c0c15[_0xf8c2('0x36')]=qs[_0xf8c2('0x37')](_0xc83aa5['query'][_0xf8c2('0x37')]);_0x3c0c15[_0xf8c2('0x38')]=qs[_0xf8c2('0x2f')](_[_0xf8c2('0x39')](_0xc83aa5['query'],_0x168e01[_0xf8c2('0x2f')]));if(_0xc83aa5[_0xf8c2('0x2d')][_0xf8c2('0x3a')]){_0x3c0c15[_0xf8c2('0x38')]=_[_0xf8c2('0x3b')](_0x3c0c15[_0xf8c2('0x38')],{'$or':_[_0xf8c2('0x27')](_0x3c0c15[_0xf8c2('0x31')],function(_0x464445){var _0x35251b={};_0x35251b[_0x464445]={'$like':'%'+_0xc83aa5[_0xf8c2('0x2d')][_0xf8c2('0x3a')]+'%'};return _0x35251b;})});}_0x3c0c15=_['merge']({},_0x3c0c15,_0xc83aa5[_0xf8c2('0x3d')]);return _0x14efee[_0xf8c2('0x48')](_0x3c0c15);}})['then'](function(_0x9d9d19){if(_0x9d9d19){_0x8fb16e=_0x9d9d19[_0xf8c2('0x33')];if(!_0xc83aa5[_0xf8c2('0x2d')][_0xf8c2('0x34')]('nolimit')){_0x3c0c15['limit']=qs[_0xf8c2('0x1d')](_0xc83aa5[_0xf8c2('0x2d')][_0xf8c2('0x1d')]);_0x3c0c15[_0xf8c2('0x1b')]=qs[_0xf8c2('0x1b')](_0xc83aa5[_0xf8c2('0x2d')][_0xf8c2('0x1b')]);}return _0x14efee[_0xf8c2('0x48')](_0x3c0c15);}})[_0xf8c2('0x24')](function(_0xdb9358){if(_0xdb9358){return _0xdb9358?{'count':_0x8fb16e,'rows':_0xdb9358}:null;}})[_0xf8c2('0x24')](respondWithResult(_0x457d8c,null))['catch'](handleError(_0x457d8c,null));};exports[_0xf8c2('0x4b')]=function(_0x235a9b,_0x7b0e43,_0x54be33){var _0x205209={};var _0x50c216={};var _0x49d813;var _0x30b2ae;return db[_0xf8c2('0x28')][_0xf8c2('0x49')]({'where':{'id':_0x235a9b[_0xf8c2('0x42')]['id']}})[_0xf8c2('0x24')](handleEntityNotFound(_0x7b0e43,null))['then'](function(_0x382cbe){if(_0x382cbe){_0x49d813=_0x382cbe;_0x50c216['model']=_[_0xf8c2('0x2e')](db['ZohoField'][_0xf8c2('0x47')]);_0x50c216[_0xf8c2('0x2d')]=_['keys'](_0x235a9b['query']);_0x50c216['filters']=_['intersection'](_0x50c216[_0xf8c2('0x2c')],_0x50c216[_0xf8c2('0x2d')]);_0x205209[_0xf8c2('0x31')]=_[_0xf8c2('0x30')](_0x50c216[_0xf8c2('0x2c')],qs['fields'](_0x235a9b[_0xf8c2('0x2d')][_0xf8c2('0x32')]));_0x205209[_0xf8c2('0x31')]=_0x205209[_0xf8c2('0x31')][_0xf8c2('0x33')]?_0x205209[_0xf8c2('0x31')]:_0x50c216['model'];_0x205209['order']=qs['sort'](_0x235a9b['query'][_0xf8c2('0x37')]);_0x205209[_0xf8c2('0x38')]=qs[_0xf8c2('0x2f')](_['pick'](_0x235a9b[_0xf8c2('0x2d')],_0x50c216['filters']));if(_0x235a9b[_0xf8c2('0x2d')][_0xf8c2('0x3a')]){_0x205209[_0xf8c2('0x38')]=_[_0xf8c2('0x3b')](_0x205209['where'],{'$or':_[_0xf8c2('0x27')](_0x205209[_0xf8c2('0x31')],function(_0x446537){var _0x3fe09c={};_0x3fe09c[_0x446537]={'$like':'%'+_0x235a9b[_0xf8c2('0x2d')][_0xf8c2('0x3a')]+'%'};return _0x3fe09c;})});}_0x205209=_['merge']({},_0x205209,_0x235a9b[_0xf8c2('0x3d')]);return _0x49d813[_0xf8c2('0x4b')](_0x205209);}})[_0xf8c2('0x24')](function(_0x4c287b){if(_0x4c287b){_0x30b2ae=_0x4c287b[_0xf8c2('0x33')];if(!_0x235a9b['query'][_0xf8c2('0x34')]('nolimit')){_0x205209[_0xf8c2('0x1d')]=qs[_0xf8c2('0x1d')](_0x235a9b[_0xf8c2('0x2d')][_0xf8c2('0x1d')]);_0x205209[_0xf8c2('0x1b')]=qs[_0xf8c2('0x1b')](_0x235a9b[_0xf8c2('0x2d')][_0xf8c2('0x1b')]);}return _0x49d813[_0xf8c2('0x4b')](_0x205209);}})['then'](function(_0x1d74d4){if(_0x1d74d4){return _0x1d74d4?{'count':_0x30b2ae,'rows':_0x1d74d4}:null;}})[_0xf8c2('0x24')](respondWithResult(_0x7b0e43,null))[_0xf8c2('0x41')](handleError(_0x7b0e43,null));};
\ No newline at end of file
index 3fd5ec9..f50aabc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x413b=['int_zoho_configurations','util','api','moment','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration'];(function(_0x35902e,_0x100ee3){var _0x5e108c=function(_0x400f36){while(--_0x400f36){_0x35902e['push'](_0x35902e['shift']());}};_0x5e108c(++_0x100ee3);}(_0x413b,0x1b1));var _0xb413=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x413b[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xb413('0x0'));var logger=require('../../config/logger')(_0xb413('0x1'));var moment=require(_0xb413('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb413('0x3'));var attributes=require(_0xb413('0x4'));module[_0xb413('0x5')]=function(_0x464c39,_0x1f77fe){return _0x464c39['define'](_0xb413('0x6'),attributes,{'tableName':_0xb413('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cf0=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5cf0,0xab));var _0x05cf=function(_0xb17f54,_0x14e515){_0xb17f54=_0xb17f54-0x0;var _0x1a7a5c=_0x5cf0[_0xb17f54];return _0x1a7a5c;};'use strict';var _=require(_0x05cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x05cf('0x1'));var moment=require(_0x05cf('0x2'));var BPromise=require(_0x05cf('0x3'));var rp=require(_0x05cf('0x4'));var fs=require('fs');var path=require(_0x05cf('0x5'));var rimraf=require(_0x05cf('0x6'));var config=require(_0x05cf('0x7'));var attributes=require(_0x05cf('0x8'));module['exports']=function(_0x2e4620,_0x5ab7b4){return _0x2e4620['define']('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 72f76e9..2c99099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d36=['ioredis','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring'];(function(_0xc6b104,_0x1d805a){var _0x1c6fce=function(_0x1bfb3f){while(--_0x1bfb3f){_0xc6b104['push'](_0xc6b104['shift']());}};_0x1c6fce(++_0x1d805a);}(_0x9d36,0x1c7));var _0x69d3=function(_0x5bb03f,_0x3118b4){_0x5bb03f=_0x5bb03f-0x0;var _0x5b8751=_0x9d36[_0x5bb03f];return _0x5b8751;};'use strict';var _=require(_0x69d3('0x0'));var util=require(_0x69d3('0x1'));var moment=require(_0x69d3('0x2'));var BPromise=require(_0x69d3('0x3'));var rs=require(_0x69d3('0x4'));var fs=require('fs');var Redis=require(_0x69d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69d3('0x6'));var logger=require(_0x69d3('0x7'))('rpc');var config=require(_0x69d3('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x313c7b,_0x2d5c47,_0x219b28){return new BPromise(function(_0x56ed31,_0xab8d4c){return client[_0x69d3('0x9')](_0x313c7b,_0x219b28)[_0x69d3('0xa')](function(_0x41eb1f){logger[_0x69d3('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d5c47,_0x69d3('0xc'));logger[_0x69d3('0xd')](_0x69d3('0xe'),_0x2d5c47,_0x69d3('0xc'),JSON[_0x69d3('0xf')](_0x41eb1f));if(_0x41eb1f['error']){if(_0x41eb1f[_0x69d3('0x10')][_0x69d3('0x11')]===0x1f4){logger[_0x69d3('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d5c47,_0x41eb1f[_0x69d3('0x10')][_0x69d3('0x12')]);return _0xab8d4c(_0x41eb1f[_0x69d3('0x10')][_0x69d3('0x12')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2d5c47,_0x41eb1f[_0x69d3('0x10')][_0x69d3('0x12')]);return _0x56ed31(_0x41eb1f[_0x69d3('0x10')][_0x69d3('0x12')]);}else{logger[_0x69d3('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d5c47,_0x69d3('0xc'));_0x56ed31(_0x41eb1f['result']['message']);}})['catch'](function(_0x1078a1){logger[_0x69d3('0x10')](_0x69d3('0x13'),_0x2d5c47,_0x1078a1);_0xab8d4c(_0x1078a1);});});}
\ No newline at end of file
+var _0x77ea=['code','message','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x38230,_0x148d0c){var _0x522ec9=function(_0x21fefc){while(--_0x21fefc){_0x38230['push'](_0x38230['shift']());}};_0x522ec9(++_0x148d0c);}(_0x77ea,0xa6));var _0xa77e=function(_0x495a3b,_0x2d08d3){_0x495a3b=_0x495a3b-0x0;var _0x17c8ef=_0x77ea[_0x495a3b];return _0x17c8ef;};'use strict';var _=require(_0xa77e('0x0'));var util=require('util');var moment=require(_0xa77e('0x1'));var BPromise=require(_0xa77e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa77e('0x3'))['db'];var utils=require(_0xa77e('0x4'));var logger=require(_0xa77e('0x5'))(_0xa77e('0x6'));var config=require(_0xa77e('0x7'));var jayson=require(_0xa77e('0x8'));var client=jayson[_0xa77e('0x9')][_0xa77e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f2d,_0x51e9c3,_0x5b22c5){return new BPromise(function(_0xc20ed4,_0x5d934a){return client[_0xa77e('0xb')](_0x4b1f2d,_0x5b22c5)[_0xa77e('0xc')](function(_0x4e3bf8){logger['info'](_0xa77e('0xd'),_0x51e9c3,'request\x20sent');logger[_0xa77e('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x51e9c3,_0xa77e('0xf'),JSON[_0xa77e('0x10')](_0x4e3bf8));if(_0x4e3bf8[_0xa77e('0x11')]){if(_0x4e3bf8[_0xa77e('0x11')][_0xa77e('0x12')]===0x1f4){logger['error'](_0xa77e('0xd'),_0x51e9c3,_0x4e3bf8[_0xa77e('0x11')][_0xa77e('0x13')]);return _0x5d934a(_0x4e3bf8['error'][_0xa77e('0x13')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x51e9c3,_0x4e3bf8[_0xa77e('0x11')]['message']);return _0xc20ed4(_0x4e3bf8[_0xa77e('0x11')][_0xa77e('0x13')]);}else{logger[_0xa77e('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x51e9c3,_0xa77e('0xf'));_0xc20ed4(_0x4e3bf8[_0xa77e('0x15')][_0xa77e('0x13')]);}})[_0xa77e('0x16')](function(_0x22c8e8){logger['error'](_0xa77e('0xd'),_0x51e9c3,_0x22c8e8);_0x5d934a(_0x22c8e8);});});}
\ No newline at end of file
index 29c88b1..52dff98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55b6=['get','show','post','create','put','/:id','update','delete','exports','multer','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index'];(function(_0x3d8638,_0x3745c5){var _0x3eb888=function(_0x1b0010){while(--_0x1b0010){_0x3d8638['push'](_0x3d8638['shift']());}};_0x3eb888(++_0x3745c5);}(_0x55b6,0x15d));var _0x655b=function(_0x5f2872,_0x55cb6a){_0x5f2872=_0x5f2872-0x0;var _0x2c8260=_0x55b6[_0x5f2872];return _0x2c8260;};'use strict';var multer=require(_0x655b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x655b('0x1'));var router=express['Router']();var fs_extra=require(_0x655b('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x655b('0x3'));var config=require(_0x655b('0x4'));var controller=require(_0x655b('0x5'));router['get']('/',auth[_0x655b('0x6')](),controller[_0x655b('0x7')]);router[_0x655b('0x8')]('/:id',auth[_0x655b('0x6')](),controller[_0x655b('0x9')]);router[_0x655b('0xa')]('/',auth['isAuthenticated'](),controller[_0x655b('0xb')]);router[_0x655b('0xc')](_0x655b('0xd'),auth[_0x655b('0x6')](),controller[_0x655b('0xe')]);router[_0x655b('0xf')](_0x655b('0xd'),auth[_0x655b('0x6')](),controller['destroy']);module[_0x655b('0x10')]=router;
\ No newline at end of file
+var _0x85ac=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85ac,0xec));var _0xc85a=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x85ac[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0xc85a('0x0'));var util=require(_0xc85a('0x1'));var path=require(_0xc85a('0x2'));var timeout=require(_0xc85a('0x3'));var express=require('express');var router=express[_0xc85a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc85a('0x5'));var interaction=require(_0xc85a('0x6'));var config=require(_0xc85a('0x7'));var controller=require(_0xc85a('0x8'));router['get']('/',auth[_0xc85a('0x9')](),controller[_0xc85a('0xa')]);router['get'](_0xc85a('0xb'),auth[_0xc85a('0x9')](),controller[_0xc85a('0xc')]);router[_0xc85a('0xd')]('/',auth[_0xc85a('0x9')](),controller[_0xc85a('0xe')]);router[_0xc85a('0xf')]('/:id',auth[_0xc85a('0x9')](),controller[_0xc85a('0x10')]);router[_0xc85a('0x11')]('/:id',auth[_0xc85a('0x9')](),controller['destroy']);module[_0xc85a('0x12')]=router;
\ No newline at end of file
index fc9fa52..438f6c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7f1=['picklist','STRING','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x1abbaa,_0x1b7a38){var _0x40ed52=function(_0x44858f){while(--_0x44858f){_0x1abbaa['push'](_0x1abbaa['shift']());}};_0x40ed52(++_0x1b7a38);}(_0xa7f1,0x72));var _0x1a7f=function(_0x481f54,_0x3d47d9){_0x481f54=_0x481f54-0x0;var _0x288091=_0xa7f1[_0x481f54];return _0x288091;};'use strict';var Sequelize=require(_0x1a7f('0x0'));module['exports']={'type':{'type':Sequelize[_0x1a7f('0x1')](_0x1a7f('0x2'),_0x1a7f('0x3'),_0x1a7f('0x4'),_0x1a7f('0x5'),_0x1a7f('0x6')),'defaultValue':_0x1a7f('0x2')},'content':{'type':Sequelize[_0x1a7f('0x7')]},'key':{'type':Sequelize[_0x1a7f('0x7')]},'keyType':{'type':Sequelize[_0x1a7f('0x1')](_0x1a7f('0x2'),_0x1a7f('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1a7f('0x7')]},'idField':{'type':Sequelize[_0x1a7f('0x7')]},'nameField':{'type':Sequelize[_0x1a7f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a7f('0x7')]}};
\ No newline at end of file
+var _0x1e9a=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2f6943,_0x3d7518){var _0x260615=function(_0x3142b7){while(--_0x3142b7){_0x2f6943['push'](_0x2f6943['shift']());}};_0x260615(++_0x3d7518);}(_0x1e9a,0x1b4));var _0xa1e9=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x1e9a[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xa1e9('0x0'));module[_0xa1e9('0x1')]={'type':{'type':Sequelize[_0xa1e9('0x2')](_0xa1e9('0x3'),_0xa1e9('0x4'),_0xa1e9('0x5'),_0xa1e9('0x6'),_0xa1e9('0x7')),'defaultValue':_0xa1e9('0x3')},'content':{'type':Sequelize[_0xa1e9('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa1e9('0x2')](_0xa1e9('0x3'),_0xa1e9('0x4'),_0xa1e9('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa1e9('0x8')]},'customField':{'type':Sequelize[_0xa1e9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8315595..126073c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2932=['find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','stack','name','send','map','ZohoField','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','catch','show','params','keys','includeAll'];(function(_0x42f9a1,_0x229b92){var _0x2c3462=function(_0x54425c){while(--_0x54425c){_0x42f9a1['push'](_0x42f9a1['shift']());}};_0x2c3462(++_0x229b92);}(_0x2932,0x9c));var _0x2293=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x2932[_0x2ac71a];return _0x3ee904;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2293('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2293('0x1'));var rp=require(_0x2293('0x2'));var moment=require(_0x2293('0x3'));var BPromise=require(_0x2293('0x4'));var Mustache=require(_0x2293('0x5'));var util=require(_0x2293('0x6'));var path=require(_0x2293('0x7'));var sox=require('sox');var csv=require(_0x2293('0x8'));var ejs=require(_0x2293('0x9'));var fs=require('fs');var fs_extra=require(_0x2293('0xa'));var _=require(_0x2293('0xb'));var squel=require(_0x2293('0xc'));var crypto=require(_0x2293('0xd'));var jsforce=require(_0x2293('0xe'));var deskjs=require(_0x2293('0xf'));var toCsv=require(_0x2293('0x8'));var querystring=require(_0x2293('0x10'));var Papa=require(_0x2293('0x11'));var Redis=require(_0x2293('0x12'));var authService=require(_0x2293('0x13'));var qs=require(_0x2293('0x14'));var as=require(_0x2293('0x15'));var hardwareService=require(_0x2293('0x16'));var logger=require('../../config/logger')(_0x2293('0x17'));var utils=require(_0x2293('0x18'));var config=require(_0x2293('0x19'));var licenseUtil=require(_0x2293('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17f82b,_0x381a22){_0x381a22=_0x381a22||0xcc;return function(_0x303568){if(_0x303568){return _0x17f82b[_0x2293('0x1b')](_0x381a22);}return _0x17f82b[_0x2293('0x1c')](_0x381a22)[_0x2293('0x1d')]();};}function respondWithResult(_0x12f0d0,_0x25c21c){_0x25c21c=_0x25c21c||0xc8;return function(_0x3b544a){if(_0x3b544a){return _0x12f0d0[_0x2293('0x1c')](_0x25c21c)[_0x2293('0x1e')](_0x3b544a);}};}function respondWithFilteredResult(_0x40c59f,_0x1b8771){return function(_0x235a17){if(_0x235a17){var _0x51c58e=typeof _0x1b8771['offset']===_0x2293('0x1f')&&typeof _0x1b8771[_0x2293('0x20')]===_0x2293('0x1f');var _0x5e0ee2=_0x235a17[_0x2293('0x21')];var _0x5686cc=_0x51c58e?0x0:_0x1b8771[_0x2293('0x22')];var _0x2fafdd=_0x51c58e?_0x235a17[_0x2293('0x21')]:_0x1b8771['offset']+_0x1b8771[_0x2293('0x20')];var _0x423f01;if(_0x2fafdd>=_0x5e0ee2){_0x2fafdd=_0x5e0ee2;_0x423f01=0xc8;}else{_0x423f01=0xce;}_0x40c59f[_0x2293('0x1c')](_0x423f01);return _0x40c59f[_0x2293('0x23')](_0x2293('0x24'),_0x5686cc+'-'+_0x2fafdd+'/'+_0x5e0ee2)['json'](_0x235a17);}return null;};}function patchUpdates(_0x105f9d){return function(_0x4ad43e){try{jsonpatch[_0x2293('0x25')](_0x4ad43e,_0x105f9d,!![]);}catch(_0x34a380){return BPromise[_0x2293('0x26')](_0x34a380);}return _0x4ad43e[_0x2293('0x27')]();};}function saveUpdates(_0x2f70b3,_0x147535){return function(_0x16c9c8){if(_0x16c9c8){return _0x16c9c8['update'](_0x2f70b3)[_0x2293('0x28')](function(_0x11ebf1){return _0x11ebf1;});}return null;};}function removeEntity(_0x16fb39,_0x4da585){return function(_0x4d3abc){if(_0x4d3abc){return _0x4d3abc['destroy']()[_0x2293('0x28')](function(){_0x16fb39[_0x2293('0x1c')](0xcc)[_0x2293('0x1d')]();});}};}function handleEntityNotFound(_0x356939,_0x2835cf){return function(_0x34049d){if(!_0x34049d){_0x356939[_0x2293('0x1b')](0x194);}return _0x34049d;};}function handleError(_0x3b43b9,_0x423e26){_0x423e26=_0x423e26||0x1f4;return function(_0x154b7c){logger['error'](_0x154b7c[_0x2293('0x29')]);if(_0x154b7c['name']){delete _0x154b7c[_0x2293('0x2a')];}_0x3b43b9[_0x2293('0x1c')](_0x423e26)[_0x2293('0x2b')](_0x154b7c);};}exports['index']=function(_0x1c79a7,_0x75d7ec){var _0x59fbc7={},_0x3f5341={},_0x2bf576={'count':0x0,'rows':[]};var _0x3207f1=_[_0x2293('0x2c')](db[_0x2293('0x2d')][_0x2293('0x2e')],function(_0x569568){return{'name':_0x569568['fieldName'],'type':_0x569568[_0x2293('0x2f')][_0x2293('0x30')]};});_0x3f5341[_0x2293('0x31')]=_['map'](_0x3207f1,_0x2293('0x2a'));_0x3f5341['query']=_['keys'](_0x1c79a7['query']);_0x3f5341['filters']=_['intersection'](_0x3f5341[_0x2293('0x31')],_0x3f5341[_0x2293('0x32')]);_0x59fbc7[_0x2293('0x33')]=_[_0x2293('0x34')](_0x3f5341['model'],qs[_0x2293('0x35')](_0x1c79a7[_0x2293('0x32')][_0x2293('0x35')]));_0x59fbc7[_0x2293('0x33')]=_0x59fbc7[_0x2293('0x33')][_0x2293('0x36')]?_0x59fbc7[_0x2293('0x33')]:_0x3f5341[_0x2293('0x31')];if(!_0x1c79a7[_0x2293('0x32')][_0x2293('0x37')](_0x2293('0x38'))){_0x59fbc7[_0x2293('0x20')]=qs[_0x2293('0x20')](_0x1c79a7[_0x2293('0x32')][_0x2293('0x20')]);_0x59fbc7['offset']=qs[_0x2293('0x22')](_0x1c79a7[_0x2293('0x32')]['offset']);}_0x59fbc7[_0x2293('0x39')]=qs[_0x2293('0x3a')](_0x1c79a7['query'][_0x2293('0x3a')]);_0x59fbc7[_0x2293('0x3b')]=qs[_0x2293('0x3c')](_[_0x2293('0x3d')](_0x1c79a7[_0x2293('0x32')],_0x3f5341[_0x2293('0x3c')]),_0x3207f1);if(_0x1c79a7[_0x2293('0x32')][_0x2293('0x3e')]){_0x59fbc7[_0x2293('0x3b')]=_['merge'](_0x59fbc7[_0x2293('0x3b')],{'$or':_[_0x2293('0x2c')](_0x3207f1,function(_0x1d4b92){if(_0x1d4b92[_0x2293('0x2f')]!==_0x2293('0x3f')){var _0x502d43={};_0x502d43[_0x1d4b92[_0x2293('0x2a')]]={'$like':'%'+_0x1c79a7[_0x2293('0x32')]['filter']+'%'};return _0x502d43;}})});}_0x59fbc7=_[_0x2293('0x40')]({},_0x59fbc7,_0x1c79a7[_0x2293('0x41')]);var _0x38707a={'where':_0x59fbc7[_0x2293('0x3b')]};return db[_0x2293('0x2d')]['count'](_0x38707a)[_0x2293('0x28')](function(_0x22f9d1){_0x2bf576[_0x2293('0x21')]=_0x22f9d1;if(_0x1c79a7['query']['includeAll']){_0x59fbc7[_0x2293('0x42')]=[{'all':!![]}];}return db[_0x2293('0x2d')]['findAll'](_0x59fbc7);})[_0x2293('0x28')](function(_0x53fb0e){_0x2bf576['rows']=_0x53fb0e;return _0x2bf576;})[_0x2293('0x28')](respondWithFilteredResult(_0x75d7ec,_0x59fbc7))[_0x2293('0x43')](handleError(_0x75d7ec,null));};exports[_0x2293('0x44')]=function(_0x51d0c7,_0x527cf6){var _0x4996f1={'raw':!![],'where':{'id':_0x51d0c7[_0x2293('0x45')]['id']}},_0x15c6a4={};_0x15c6a4['model']=_[_0x2293('0x46')](db[_0x2293('0x2d')][_0x2293('0x2e')]);_0x15c6a4[_0x2293('0x32')]=_['keys'](_0x51d0c7[_0x2293('0x32')]);_0x15c6a4[_0x2293('0x3c')]=_[_0x2293('0x34')](_0x15c6a4[_0x2293('0x31')],_0x15c6a4[_0x2293('0x32')]);_0x4996f1['attributes']=_[_0x2293('0x34')](_0x15c6a4['model'],qs[_0x2293('0x35')](_0x51d0c7[_0x2293('0x32')][_0x2293('0x35')]));_0x4996f1['attributes']=_0x4996f1[_0x2293('0x33')]['length']?_0x4996f1[_0x2293('0x33')]:_0x15c6a4['model'];if(_0x51d0c7[_0x2293('0x32')][_0x2293('0x47')]){_0x4996f1['include']=[{'all':!![]}];}_0x4996f1=_[_0x2293('0x40')]({},_0x4996f1,_0x51d0c7[_0x2293('0x41')]);return db[_0x2293('0x2d')][_0x2293('0x48')](_0x4996f1)[_0x2293('0x28')](handleEntityNotFound(_0x527cf6,null))[_0x2293('0x28')](respondWithResult(_0x527cf6,null))[_0x2293('0x43')](handleError(_0x527cf6,null));};exports[_0x2293('0x49')]=function(_0x20eeb4,_0x38ca3a){return db[_0x2293('0x2d')][_0x2293('0x49')](_0x20eeb4[_0x2293('0x4a')],{})[_0x2293('0x28')](respondWithResult(_0x38ca3a,0xc9))[_0x2293('0x43')](handleError(_0x38ca3a,null));};exports['update']=function(_0x261e5e,_0x263dff){if(_0x261e5e['body']['id']){delete _0x261e5e[_0x2293('0x4a')]['id'];}return db[_0x2293('0x2d')][_0x2293('0x48')]({'where':{'id':_0x261e5e[_0x2293('0x45')]['id']}})[_0x2293('0x28')](handleEntityNotFound(_0x263dff,null))[_0x2293('0x28')](saveUpdates(_0x261e5e[_0x2293('0x4a')],null))[_0x2293('0x28')](respondWithResult(_0x263dff,null))['catch'](handleError(_0x263dff,null));};exports[_0x2293('0x4b')]=function(_0x16d81c,_0x16909e){return db[_0x2293('0x2d')][_0x2293('0x48')]({'where':{'id':_0x16d81c['params']['id']}})[_0x2293('0x28')](handleEntityNotFound(_0x16909e,null))['then'](removeEntity(_0x16909e,null))['catch'](handleError(_0x16909e,null));};
\ No newline at end of file
+var _0x2c3a=['../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','catch','show','includeAll','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x103ea0,_0x5e1754){var _0x2eb66c=function(_0x185ce3){while(--_0x185ce3){_0x103ea0['push'](_0x103ea0['shift']());}};_0x2eb66c(++_0x5e1754);}(_0x2c3a,0x7b));var _0xa2c3=function(_0x279c2b,_0x1510b4){_0x279c2b=_0x279c2b-0x0;var _0x31199f=_0x2c3a[_0x279c2b];return _0x31199f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2c3('0x0'));var zipdir=require(_0xa2c3('0x1'));var jsonpatch=require(_0xa2c3('0x2'));var rp=require(_0xa2c3('0x3'));var moment=require('moment');var BPromise=require(_0xa2c3('0x4'));var Mustache=require(_0xa2c3('0x5'));var util=require(_0xa2c3('0x6'));var path=require(_0xa2c3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa2c3('0x8'));var fs=require('fs');var fs_extra=require(_0xa2c3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2c3('0xa'));var jsforce=require(_0xa2c3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa2c3('0xc'));var querystring=require(_0xa2c3('0xd'));var Papa=require('papaparse');var Redis=require(_0xa2c3('0xe'));var authService=require(_0xa2c3('0xf'));var qs=require(_0xa2c3('0x10'));var as=require(_0xa2c3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa2c3('0x12'));var config=require(_0xa2c3('0x13'));var licenseUtil=require(_0xa2c3('0x14'));var db=require(_0xa2c3('0x15'))['db'];function respondWithStatusCode(_0x26148f,_0x12ba50){_0x12ba50=_0x12ba50||0xcc;return function(_0x4d7a23){if(_0x4d7a23){return _0x26148f[_0xa2c3('0x16')](_0x12ba50);}return _0x26148f[_0xa2c3('0x17')](_0x12ba50)[_0xa2c3('0x18')]();};}function respondWithResult(_0x1a1960,_0x50a40d){_0x50a40d=_0x50a40d||0xc8;return function(_0x2186f2){if(_0x2186f2){return _0x1a1960[_0xa2c3('0x17')](_0x50a40d)['json'](_0x2186f2);}};}function respondWithFilteredResult(_0x29fdcc,_0x498c26){return function(_0x5b992f){if(_0x5b992f){var _0x499e9a=typeof _0x498c26[_0xa2c3('0x19')]===_0xa2c3('0x1a')&&typeof _0x498c26['limit']==='undefined';var _0x5a842b=_0x5b992f[_0xa2c3('0x1b')];var _0x47d26e=_0x499e9a?0x0:_0x498c26[_0xa2c3('0x19')];var _0x54a4ba=_0x499e9a?_0x5b992f[_0xa2c3('0x1b')]:_0x498c26['offset']+_0x498c26[_0xa2c3('0x1c')];var _0x411fac;if(_0x54a4ba>=_0x5a842b){_0x54a4ba=_0x5a842b;_0x411fac=0xc8;}else{_0x411fac=0xce;}_0x29fdcc[_0xa2c3('0x17')](_0x411fac);return _0x29fdcc[_0xa2c3('0x1d')](_0xa2c3('0x1e'),_0x47d26e+'-'+_0x54a4ba+'/'+_0x5a842b)['json'](_0x5b992f);}return null;};}function patchUpdates(_0x247f7f){return function(_0x3b692e){try{jsonpatch[_0xa2c3('0x1f')](_0x3b692e,_0x247f7f,!![]);}catch(_0x21cd20){return BPromise[_0xa2c3('0x20')](_0x21cd20);}return _0x3b692e[_0xa2c3('0x21')]();};}function saveUpdates(_0x3d1f22,_0x5a8e36){return function(_0xddf486){if(_0xddf486){return _0xddf486['update'](_0x3d1f22)[_0xa2c3('0x22')](function(_0x5e4d4d){return _0x5e4d4d;});}return null;};}function removeEntity(_0x3192f5,_0x5d4f46){return function(_0x3ee7){if(_0x3ee7){return _0x3ee7[_0xa2c3('0x23')]()[_0xa2c3('0x22')](function(){_0x3192f5[_0xa2c3('0x17')](0xcc)[_0xa2c3('0x18')]();});}};}function handleEntityNotFound(_0x353b1d,_0x25349e){return function(_0x4e1ea1){if(!_0x4e1ea1){_0x353b1d['sendStatus'](0x194);}return _0x4e1ea1;};}function handleError(_0xfbd2aa,_0x2ace29){_0x2ace29=_0x2ace29||0x1f4;return function(_0x24a90f){logger[_0xa2c3('0x24')](_0x24a90f['stack']);if(_0x24a90f[_0xa2c3('0x25')]){delete _0x24a90f[_0xa2c3('0x25')];}_0xfbd2aa[_0xa2c3('0x17')](_0x2ace29)[_0xa2c3('0x26')](_0x24a90f);};}exports['index']=function(_0x57bb2b,_0x1b066d){var _0x4d8815={},_0x5cb5c9={},_0x46b73f={'count':0x0,'rows':[]};var _0x5335eb=_[_0xa2c3('0x27')](db[_0xa2c3('0x28')][_0xa2c3('0x29')],function(_0x104155){return{'name':_0x104155[_0xa2c3('0x2a')],'type':_0x104155[_0xa2c3('0x2b')][_0xa2c3('0x2c')]};});_0x5cb5c9[_0xa2c3('0x2d')]=_['map'](_0x5335eb,_0xa2c3('0x25'));_0x5cb5c9[_0xa2c3('0x2e')]=_[_0xa2c3('0x2f')](_0x57bb2b[_0xa2c3('0x2e')]);_0x5cb5c9[_0xa2c3('0x30')]=_[_0xa2c3('0x31')](_0x5cb5c9['model'],_0x5cb5c9[_0xa2c3('0x2e')]);_0x4d8815[_0xa2c3('0x32')]=_[_0xa2c3('0x31')](_0x5cb5c9[_0xa2c3('0x2d')],qs['fields'](_0x57bb2b[_0xa2c3('0x2e')][_0xa2c3('0x33')]));_0x4d8815['attributes']=_0x4d8815[_0xa2c3('0x32')][_0xa2c3('0x34')]?_0x4d8815[_0xa2c3('0x32')]:_0x5cb5c9['model'];if(!_0x57bb2b['query']['hasOwnProperty'](_0xa2c3('0x35'))){_0x4d8815[_0xa2c3('0x1c')]=qs['limit'](_0x57bb2b[_0xa2c3('0x2e')][_0xa2c3('0x1c')]);_0x4d8815[_0xa2c3('0x19')]=qs[_0xa2c3('0x19')](_0x57bb2b[_0xa2c3('0x2e')][_0xa2c3('0x19')]);}_0x4d8815[_0xa2c3('0x36')]=qs[_0xa2c3('0x37')](_0x57bb2b[_0xa2c3('0x2e')]['sort']);_0x4d8815[_0xa2c3('0x38')]=qs[_0xa2c3('0x30')](_['pick'](_0x57bb2b['query'],_0x5cb5c9['filters']),_0x5335eb);if(_0x57bb2b[_0xa2c3('0x2e')][_0xa2c3('0x39')]){_0x4d8815[_0xa2c3('0x38')]=_['merge'](_0x4d8815['where'],{'$or':_['map'](_0x5335eb,function(_0x227439){if(_0x227439[_0xa2c3('0x2b')]!==_0xa2c3('0x3a')){var _0x1fec3b={};_0x1fec3b[_0x227439[_0xa2c3('0x25')]]={'$like':'%'+_0x57bb2b['query'][_0xa2c3('0x39')]+'%'};return _0x1fec3b;}})});}_0x4d8815=_[_0xa2c3('0x3b')]({},_0x4d8815,_0x57bb2b[_0xa2c3('0x3c')]);var _0xbeba08={'where':_0x4d8815[_0xa2c3('0x38')]};return db['ZohoField'][_0xa2c3('0x1b')](_0xbeba08)[_0xa2c3('0x22')](function(_0x436f77){_0x46b73f[_0xa2c3('0x1b')]=_0x436f77;if(_0x57bb2b['query']['includeAll']){_0x4d8815[_0xa2c3('0x3d')]=[{'all':!![]}];}return db[_0xa2c3('0x28')][_0xa2c3('0x3e')](_0x4d8815);})['then'](function(_0x192fa){_0x46b73f['rows']=_0x192fa;return _0x46b73f;})[_0xa2c3('0x22')](respondWithFilteredResult(_0x1b066d,_0x4d8815))[_0xa2c3('0x3f')](handleError(_0x1b066d,null));};exports[_0xa2c3('0x40')]=function(_0x33b34b,_0x481515){var _0x9f0d12={'raw':!![],'where':{'id':_0x33b34b['params']['id']}},_0x3b80a4={};_0x3b80a4[_0xa2c3('0x2d')]=_[_0xa2c3('0x2f')](db[_0xa2c3('0x28')][_0xa2c3('0x29')]);_0x3b80a4[_0xa2c3('0x2e')]=_[_0xa2c3('0x2f')](_0x33b34b[_0xa2c3('0x2e')]);_0x3b80a4[_0xa2c3('0x30')]=_[_0xa2c3('0x31')](_0x3b80a4[_0xa2c3('0x2d')],_0x3b80a4[_0xa2c3('0x2e')]);_0x9f0d12['attributes']=_[_0xa2c3('0x31')](_0x3b80a4[_0xa2c3('0x2d')],qs[_0xa2c3('0x33')](_0x33b34b['query']['fields']));_0x9f0d12['attributes']=_0x9f0d12['attributes'][_0xa2c3('0x34')]?_0x9f0d12['attributes']:_0x3b80a4['model'];if(_0x33b34b[_0xa2c3('0x2e')][_0xa2c3('0x41')]){_0x9f0d12[_0xa2c3('0x3d')]=[{'all':!![]}];}_0x9f0d12=_[_0xa2c3('0x3b')]({},_0x9f0d12,_0x33b34b['options']);return db[_0xa2c3('0x28')][_0xa2c3('0x42')](_0x9f0d12)[_0xa2c3('0x22')](handleEntityNotFound(_0x481515,null))['then'](respondWithResult(_0x481515,null))[_0xa2c3('0x3f')](handleError(_0x481515,null));};exports[_0xa2c3('0x43')]=function(_0x200679,_0x567dcd){return db[_0xa2c3('0x28')]['create'](_0x200679[_0xa2c3('0x44')],{})[_0xa2c3('0x22')](respondWithResult(_0x567dcd,0xc9))[_0xa2c3('0x3f')](handleError(_0x567dcd,null));};exports['update']=function(_0x1aae02,_0x19d780){if(_0x1aae02[_0xa2c3('0x44')]['id']){delete _0x1aae02['body']['id'];}return db[_0xa2c3('0x28')][_0xa2c3('0x42')]({'where':{'id':_0x1aae02['params']['id']}})[_0xa2c3('0x22')](handleEntityNotFound(_0x19d780,null))[_0xa2c3('0x22')](saveUpdates(_0x1aae02[_0xa2c3('0x44')],null))[_0xa2c3('0x22')](respondWithResult(_0x19d780,null))[_0xa2c3('0x3f')](handleError(_0x19d780,null));};exports[_0xa2c3('0x23')]=function(_0x1764e9,_0x45f158){return db[_0xa2c3('0x28')][_0xa2c3('0x42')]({'where':{'id':_0x1764e9[_0xa2c3('0x45')]['id']}})[_0xa2c3('0x22')](handleEntityNotFound(_0x45f158,null))[_0xa2c3('0x22')](removeEntity(_0x45f158,null))['catch'](handleError(_0x45f158,null));};
\ No newline at end of file
index 31f0cbc..986988a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafb9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','int_zoho_fields','zoho_unique_index','idField'];(function(_0x19027a,_0x5d2416){var _0x48e494=function(_0x4ee351){while(--_0x4ee351){_0x19027a['push'](_0x19027a['shift']());}};_0x48e494(++_0x5d2416);}(_0xafb9,0x68));var _0x9afb=function(_0x3444dc,_0x33c3f0){_0x3444dc=_0x3444dc-0x0;var _0x226a26=_0xafb9[_0x3444dc];return _0x226a26;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('ZohoField',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[{'name':_0x9afb('0xb'),'fields':[_0x9afb('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbff5=['request-promise','rimraf','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x413451,_0x18e4dd){var _0x45a28a=function(_0x4e430f){while(--_0x4e430f){_0x413451['push'](_0x413451['shift']());}};_0x45a28a(++_0x18e4dd);}(_0xbff5,0x1bc));var _0x5bff=function(_0x2479e5,_0x2e8be5){_0x2479e5=_0x2479e5-0x0;var _0x36ec8d=_0xbff5[_0x2479e5];return _0x36ec8d;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var rp=require(_0x5bff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bff('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x5bff('0x8')]=function(_0x1d8650,_0x151add){return _0x1d8650[_0x5bff('0x9')](_0x5bff('0xa'),attributes,{'tableName':_0x5bff('0xb'),'paranoid':![],'indexes':[{'name':_0x5bff('0xc'),'fields':[_0x5bff('0xd'),_0x5bff('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5e02a61..b8deb44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfc=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4c8cff,_0x43082c){var _0x103890=function(_0x19ed33){while(--_0x19ed33){_0x4c8cff['push'](_0x4c8cff['shift']());}};_0x103890(++_0x43082c);}(_0xebfc,0x112));var _0xcebf=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xebfc[_0x273dc5];return _0x46dae7;};'use strict';var _=require(_0xcebf('0x0'));var util=require(_0xcebf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcebf('0x2'));var fs=require('fs');var Redis=require(_0xcebf('0x3'));var db=require(_0xcebf('0x4'))['db'];var utils=require(_0xcebf('0x5'));var logger=require('../../config/logger')(_0xcebf('0x6'));var config=require(_0xcebf('0x7'));var jayson=require(_0xcebf('0x8'));var client=jayson['client'][_0xcebf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x343692,_0xc3abb8,_0x3709af){return new BPromise(function(_0x255f96,_0x59c036){return client[_0xcebf('0xa')](_0x343692,_0x3709af)[_0xcebf('0xb')](function(_0x359738){logger[_0xcebf('0xc')](_0xcebf('0xd'),_0xc3abb8,_0xcebf('0xe'));logger[_0xcebf('0xf')](_0xcebf('0x10'),_0xc3abb8,_0xcebf('0xe'),JSON[_0xcebf('0x11')](_0x359738));if(_0x359738[_0xcebf('0x12')]){if(_0x359738[_0xcebf('0x12')]['code']===0x1f4){logger[_0xcebf('0x12')](_0xcebf('0xd'),_0xc3abb8,_0x359738[_0xcebf('0x12')]['message']);return _0x59c036(_0x359738[_0xcebf('0x12')][_0xcebf('0x13')]);}logger[_0xcebf('0x12')](_0xcebf('0xd'),_0xc3abb8,_0x359738[_0xcebf('0x12')][_0xcebf('0x13')]);return _0x255f96(_0x359738[_0xcebf('0x12')][_0xcebf('0x13')]);}else{logger[_0xcebf('0xc')](_0xcebf('0xd'),_0xc3abb8,_0xcebf('0xe'));_0x255f96(_0x359738['result'][_0xcebf('0x13')]);}})[_0xcebf('0x14')](function(_0x4a2262){logger[_0xcebf('0x12')](_0xcebf('0xd'),_0xc3abb8,_0x4a2262);_0x59c036(_0x4a2262);});});}
\ No newline at end of file
+var _0xbef9=['http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x39479f,_0x822ae4){var _0x4a6d96=function(_0x55bfba){while(--_0x55bfba){_0x39479f['push'](_0x39479f['shift']());}};_0x4a6d96(++_0x822ae4);}(_0xbef9,0x97));var _0x9bef=function(_0x82b3e3,_0x253fac){_0x82b3e3=_0x82b3e3-0x0;var _0xbde62c=_0xbef9[_0x82b3e3];return _0xbde62c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9bef('0x0'));var BPromise=require(_0x9bef('0x1'));var rs=require(_0x9bef('0x2'));var fs=require('fs');var Redis=require(_0x9bef('0x3'));var db=require(_0x9bef('0x4'))['db'];var utils=require(_0x9bef('0x5'));var logger=require(_0x9bef('0x6'))(_0x9bef('0x7'));var config=require(_0x9bef('0x8'));var jayson=require(_0x9bef('0x9'));var client=jayson['client'][_0x9bef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x297112,_0x4e2727,_0x446348){return new BPromise(function(_0x5665ad,_0x907d25){return client[_0x9bef('0xb')](_0x297112,_0x446348)[_0x9bef('0xc')](function(_0x25d583){logger[_0x9bef('0xd')](_0x9bef('0xe'),_0x4e2727,'request\x20sent');logger[_0x9bef('0xf')](_0x9bef('0x10'),_0x4e2727,'request\x20sent',JSON[_0x9bef('0x11')](_0x25d583));if(_0x25d583[_0x9bef('0x12')]){if(_0x25d583[_0x9bef('0x12')][_0x9bef('0x13')]===0x1f4){logger[_0x9bef('0x12')](_0x9bef('0xe'),_0x4e2727,_0x25d583[_0x9bef('0x12')][_0x9bef('0x14')]);return _0x907d25(_0x25d583[_0x9bef('0x12')]['message']);}logger[_0x9bef('0x12')]('ZohoField,\x20%s,\x20%s',_0x4e2727,_0x25d583['error'][_0x9bef('0x14')]);return _0x5665ad(_0x25d583[_0x9bef('0x12')][_0x9bef('0x14')]);}else{logger[_0x9bef('0xd')](_0x9bef('0xe'),_0x4e2727,'request\x20sent');_0x5665ad(_0x25d583[_0x9bef('0x15')][_0x9bef('0x14')]);}})[_0x9bef('0x16')](function(_0x269f21){logger['error'](_0x9bef('0xe'),_0x4e2727,_0x269f21);_0x907d25(_0x269f21);});});}
\ No newline at end of file
index baefdd7..7e35a25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2acec2,_0x12ebf1){var _0x19aa0d=function(_0x312e8e){while(--_0x312e8e){_0x2acec2['push'](_0x2acec2['shift']());}};_0x19aa0d(++_0x12ebf1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2224be,_0x1fe228){var _0x1dd508=function(_0x1604cd){while(--_0x1604cd){_0x2224be['push'](_0x2224be['shift']());}};_0x1dd508(++_0x1fe228);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0xcb91[_0x43a5c7];return _0x3b12a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index a3a258d..b26cedb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18e2=['app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x5eb6e6,_0x17f551){var _0x35c38b=function(_0xa3592){while(--_0xa3592){_0x5eb6e6['push'](_0x5eb6e6['shift']());}};_0x35c38b(++_0x17f551);}(_0x18e2,0x7c));var _0x218e=function(_0x50d993,_0x300507){_0x50d993=_0x50d993-0x0;var _0x5483d4=_0x18e2[_0x50d993];return _0x5483d4;};'use strict';var Sequelize=require(_0x218e('0x0'));module[_0x218e('0x1')]={'name':{'type':Sequelize[_0x218e('0x2')],'allowNull':![],'unique':_0x218e('0x3')},'version':{'type':Sequelize[_0x218e('0x2')],'allowNull':![],'unique':_0x218e('0x3')},'main':{'type':Sequelize[_0x218e('0x2')],'defaultValue':_0x218e('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x218e('0x2')]},'type':{'type':Sequelize[_0x218e('0x2')]},'size':{'type':Sequelize[_0x218e('0x5')]},'active':{'type':Sequelize[_0x218e('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x218e('0x2')],'unique':_0x218e('0x7')},'description':{'type':Sequelize[_0x218e('0x2')]},'title':{'type':Sequelize[_0x218e('0x2')]},'remoteUri':{'type':Sequelize[_0x218e('0x2')]},'link':{'type':Sequelize[_0x218e('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xe781=['exports','STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize'];(function(_0x99d288,_0x23b37a){var _0x44e2ba=function(_0x14a94){while(--_0x14a94){_0x99d288['push'](_0x99d288['shift']());}};_0x44e2ba(++_0x23b37a);}(_0xe781,0x141));var _0x1e78=function(_0xceab94,_0x3c4b46){_0xceab94=_0xceab94-0x0;var _0x343dc4=_0xe781[_0xceab94];return _0x343dc4;};'use strict';var Sequelize=require(_0x1e78('0x0'));module[_0x1e78('0x1')]={'name':{'type':Sequelize[_0x1e78('0x2')],'allowNull':![],'unique':_0x1e78('0x3')},'version':{'type':Sequelize[_0x1e78('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x1e78('0x2')],'defaultValue':_0x1e78('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x1e78('0x2')]},'type':{'type':Sequelize[_0x1e78('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x1e78('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x1e78('0x2')]},'logo':{'type':Sequelize[_0x1e78('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x1e78('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x1e78('0x2')]},'remoteUri':{'type':Sequelize[_0x1e78('0x2')]},'link':{'type':Sequelize[_0x1e78('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 93e2491..7b5cbc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf4=['VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type'];(function(_0x56953c,_0x408e39){var _0xceed1b=function(_0x1b5686){while(--_0x1b5686){_0x56953c['push'](_0x56953c['shift']());}};_0xceed1b(++_0x408e39);}(_0xacf4,0xe7));var _0x4acf=function(_0x2c5ff3,_0xf7e6b2){_0x2c5ff3=_0x2c5ff3-0x0;var _0x131838=_0xacf4[_0x2c5ff3];return _0x131838;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['Integration'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['Integration']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};
\ No newline at end of file
+var _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x321421,_0x555332){var _0x5374a4=function(_0x31158f){while(--_0x31158f){_0x321421['push'](_0x321421['shift']());}};_0x5374a4(++_0x555332);}(_0x5fab,0x177));var _0xb5fa=function(_0x2d2885,_0x667d70){_0x2d2885=_0x2d2885-0x0;var _0x2cea6=_0x5fab[_0x2d2885];return _0x2cea6;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));};
\ No newline at end of file
index 82ca733..e3e6e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44fc=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x44fc,0x1e5));var _0xc44f=function(_0x49b14d,_0x578d07){_0x49b14d=_0x49b14d-0x0;var _0x3d2488=_0x44fc[_0x49b14d];return _0x3d2488;};'use strict';var _=require(_0xc44f('0x0'));var util=require(_0xc44f('0x1'));var logger=require(_0xc44f('0x2'))('api');var moment=require(_0xc44f('0x3'));var BPromise=require(_0xc44f('0x4'));var rp=require(_0xc44f('0x5'));var fs=require('fs');var path=require(_0xc44f('0x6'));var rimraf=require(_0xc44f('0x7'));var config=require(_0xc44f('0x8'));var attributes=require(_0xc44f('0x9'));module[_0xc44f('0xa')]=function(_0x489a53,_0x427fb5){return _0x489a53[_0xc44f('0xb')](_0xc44f('0xc'),attributes,{'tableName':_0xc44f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0d5=['rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3554f3,_0x209792){var _0x4b1091=function(_0x2ca863){while(--_0x2ca863){_0x3554f3['push'](_0x3554f3['shift']());}};_0x4b1091(++_0x209792);}(_0xa0d5,0x132));var _0x5a0d=function(_0x435c89,_0x2b6da8){_0x435c89=_0x435c89-0x0;var _0x183449=_0xa0d5[_0x435c89];return _0x183449;};'use strict';var _=require(_0x5a0d('0x0'));var util=require(_0x5a0d('0x1'));var logger=require(_0x5a0d('0x2'))('api');var moment=require(_0x5a0d('0x3'));var BPromise=require(_0x5a0d('0x4'));var rp=require(_0x5a0d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a0d('0x6'));var config=require(_0x5a0d('0x7'));var attributes=require(_0x5a0d('0x8'));module[_0x5a0d('0x9')]=function(_0x372327,_0x21f338){return _0x372327[_0x5a0d('0xa')](_0x5a0d('0xb'),attributes,{'tableName':_0x5a0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d93a52..ccc4bbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xc2c7,0x134));var _0x7c2c=function(_0x594c32,_0x340a17){_0x594c32=_0x594c32-0x0;var _0x4abb76=_0xc2c7[_0x594c32];return _0x4abb76;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}
\ No newline at end of file
+var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0x524e,0x15e));var _0xe524=function(_0x1b5358,_0x30c4a1){_0x1b5358=_0x1b5358-0x0;var _0x45e663=_0x524e[_0x1b5358];return _0x45e663;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}
\ No newline at end of file
index 88c0706..a955686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','/:id','create','update','destroy','exports','util'];(function(_0xedd0fd,_0x1b8a3d){var _0x3a0841=function(_0x4fb204){while(--_0x4fb204){_0xedd0fd['push'](_0xedd0fd['shift']());}};_0x3a0841(++_0x1b8a3d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6d38[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xb'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router;
\ No newline at end of file
+var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x2f6d05,_0x1f536c){var _0x75f8e=function(_0x137025){while(--_0x137025){_0x2f6d05['push'](_0x2f6d05['shift']());}};_0x75f8e(++_0x1f536c);}(_0x9f0e,0x116));var _0xe9f0=function(_0x21c079,_0xea81cc){_0x21c079=_0x21c079-0x0;var _0x41fb56=_0x9f0e[_0x21c079];return _0x41fb56;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router;
\ No newline at end of file
index 9703c92..a07642e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb38=['DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','sequelize','exports','STRING','INTEGER'];(function(_0x507238,_0x2877da){var _0x2a5413=function(_0x4e1e0c){while(--_0x4e1e0c){_0x507238['push'](_0x507238['shift']());}};_0x2a5413(++_0x2877da);}(_0xbb38,0x182));var _0x8bb3=function(_0x2c5435,_0x1bbff8){_0x2c5435=_0x2c5435-0x0;var _0x1f7ffe=_0xbb38[_0x2c5435];return _0x1f7ffe;};'use strict';var Sequelize=require(_0x8bb3('0x0'));module[_0x8bb3('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x8bb3('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x8bb3('0x2')]},'integrationId':{'type':Sequelize[_0x8bb3('0x3')]},'contacts':{'type':Sequelize[_0x8bb3('0x2')]},'uniqueid':{'type':Sequelize[_0x8bb3('0x2')]},'calleridnum':{'type':Sequelize[_0x8bb3('0x2')]},'calleridname':{'type':Sequelize[_0x8bb3('0x2')]},'queue':{'type':Sequelize[_0x8bb3('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8bb3('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8bb3('0x4')]},'holdtime':{'type':Sequelize[_0x8bb3('0x3')]},'agentcomplete':{'type':Sequelize[_0x8bb3('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8bb3('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8bb3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8bb3('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x8bb3('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8bb3('0x4')]},'agentdump':{'type':Sequelize[_0x8bb3('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8bb3('0x4')]},'lastevent':{'type':Sequelize[_0x8bb3('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x8bb3('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8bb3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8bb3('0x2')]},'exten':{'type':Sequelize[_0x8bb3('0x2')]},'priority':{'type':Sequelize[_0x8bb3('0x2')]},'destchannel':{'type':Sequelize[_0x8bb3('0x2')]},'destchannelstate':{'type':Sequelize[_0x8bb3('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x8bb3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8bb3('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8bb3('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8bb3('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8bb3('0x2')]},'destexten':{'type':Sequelize[_0x8bb3('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8bb3('0x2')]},'messageId':{'type':Sequelize[_0x8bb3('0x2')]},'inReplyTo':{'type':Sequelize[_0x8bb3('0x2')]},'subject':{'type':Sequelize[_0x8bb3('0x2')]},'from':{'type':Sequelize[_0x8bb3('0x2')]},'to':{'type':Sequelize[_0x8bb3('0x2')]},'cc':{'type':Sequelize[_0x8bb3('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x8bb3('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x8bb3('0x7')](_0x8bb3('0x8'),_0x8bb3('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x8bb3('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x8bb3('0x2')]},'projectId':{'type':Sequelize[_0x8bb3('0x3')]}};
\ No newline at end of file
+var _0x2418=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x58b693,_0x14ee77){var _0x400350=function(_0x55a488){while(--_0x55a488){_0x58b693['push'](_0x58b693['shift']());}};_0x400350(++_0x14ee77);}(_0x2418,0x9f));var _0x8241=function(_0x11546e,_0x27140f){_0x11546e=_0x11546e-0x0;var _0x4ae4f0=_0x2418[_0x11546e];return _0x4ae4f0;};'use strict';var Sequelize=require(_0x8241('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x8241('0x1')]},'ticketId':{'type':Sequelize[_0x8241('0x1')]},'integrationId':{'type':Sequelize[_0x8241('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8241('0x1')]},'calleridnum':{'type':Sequelize[_0x8241('0x1')]},'calleridname':{'type':Sequelize[_0x8241('0x1')]},'queue':{'type':Sequelize[_0x8241('0x1')]},'interface':{'type':Sequelize[_0x8241('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8241('0x3')]},'holdtime':{'type':Sequelize[_0x8241('0x2')]},'agentcomplete':{'type':Sequelize[_0x8241('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8241('0x3')]},'talktime':{'type':Sequelize[_0x8241('0x2')]},'agentacw':{'type':Sequelize[_0x8241('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8241('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x8241('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8241('0x3')]},'agentdump':{'type':Sequelize[_0x8241('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8241('0x3')]},'lastevent':{'type':Sequelize[_0x8241('0x1')]},'channel':{'type':Sequelize[_0x8241('0x1')]},'channelstate':{'type':Sequelize[_0x8241('0x2')]},'channelstatedesc':{'type':Sequelize[_0x8241('0x1')]},'connectedlinenum':{'type':Sequelize[_0x8241('0x1')]},'connectedlinename':{'type':Sequelize[_0x8241('0x1')]},'language':{'type':Sequelize[_0x8241('0x1')]},'accountcode':{'type':Sequelize[_0x8241('0x1')]},'context':{'type':Sequelize[_0x8241('0x1')]},'exten':{'type':Sequelize[_0x8241('0x1')]},'priority':{'type':Sequelize[_0x8241('0x1')]},'destchannel':{'type':Sequelize[_0x8241('0x1')]},'destchannelstate':{'type':Sequelize[_0x8241('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x8241('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8241('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x8241('0x1')]},'destlanguage':{'type':Sequelize[_0x8241('0x1')]},'destaccountcode':{'type':Sequelize[_0x8241('0x1')]},'destcontext':{'type':Sequelize[_0x8241('0x1')]},'destexten':{'type':Sequelize[_0x8241('0x1')]},'destpriority':{'type':Sequelize[_0x8241('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x8241('0x1')]},'inReplyTo':{'type':Sequelize[_0x8241('0x1')]},'subject':{'type':Sequelize[_0x8241('0x1')]},'from':{'type':Sequelize[_0x8241('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x8241('0x1')]},'attachment':{'type':Sequelize[_0x8241('0x5')]},'html':{'type':Sequelize[_0x8241('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x8241('0x6'),_0x8241('0x7'),_0x8241('0x8'),_0x8241('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x8241('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index f93da74..f8c8468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc5=['Content-Range','apply','save','update','then','destroy','name','send','index','IntegrationReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit'];(function(_0x4f388b,_0x94be54){var _0x5a155c=function(_0x1a1fb8){while(--_0x1a1fb8){_0x4f388b['push'](_0x4f388b['shift']());}};_0x5a155c(++_0x94be54);}(_0x9bc5,0x14f));var _0x59bc=function(_0x4a85c9,_0x27c18f){_0x4a85c9=_0x4a85c9-0x0;var _0x3e2289=_0x9bc5[_0x4a85c9];return _0x3e2289;};'use strict';var emlformat=require(_0x59bc('0x0'));var rimraf=require(_0x59bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59bc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x59bc('0x3'));var Mustache=require(_0x59bc('0x4'));var util=require('util');var path=require(_0x59bc('0x5'));var sox=require(_0x59bc('0x6'));var csv=require(_0x59bc('0x7'));var ejs=require(_0x59bc('0x8'));var fs=require('fs');var fs_extra=require(_0x59bc('0x9'));var _=require('lodash');var squel=require(_0x59bc('0xa'));var crypto=require(_0x59bc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x59bc('0xc'));var toCsv=require(_0x59bc('0x7'));var querystring=require(_0x59bc('0xd'));var Papa=require(_0x59bc('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x59bc('0xf'));var hardwareService=require(_0x59bc('0x10'));var logger=require(_0x59bc('0x11'))(_0x59bc('0x12'));var utils=require(_0x59bc('0x13'));var config=require(_0x59bc('0x14'));var licenseUtil=require(_0x59bc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c36ce,_0x2573d1){_0x2573d1=_0x2573d1||0xcc;return function(_0x2ba4a1){if(_0x2ba4a1){return _0x1c36ce[_0x59bc('0x16')](_0x2573d1);}return _0x1c36ce[_0x59bc('0x17')](_0x2573d1)[_0x59bc('0x18')]();};}function respondWithResult(_0x5bb5f4,_0x2352e1){_0x2352e1=_0x2352e1||0xc8;return function(_0x17602b){if(_0x17602b){return _0x5bb5f4[_0x59bc('0x17')](_0x2352e1)[_0x59bc('0x19')](_0x17602b);}};}function respondWithFilteredResult(_0x2535ee,_0x2e1284){return function(_0x1724b6){if(_0x1724b6){var _0x2793b2=typeof _0x2e1284['offset']===_0x59bc('0x1a')&&typeof _0x2e1284['limit']===_0x59bc('0x1a');var _0x5dc553=_0x1724b6[_0x59bc('0x1b')];var _0x4846ad=_0x2793b2?0x0:_0x2e1284[_0x59bc('0x1c')];var _0x2ea9da=_0x2793b2?_0x1724b6['count']:_0x2e1284[_0x59bc('0x1c')]+_0x2e1284[_0x59bc('0x1d')];var _0x3a38a2;if(_0x2ea9da>=_0x5dc553){_0x2ea9da=_0x5dc553;_0x3a38a2=0xc8;}else{_0x3a38a2=0xce;}_0x2535ee['status'](_0x3a38a2);return _0x2535ee['set'](_0x59bc('0x1e'),_0x4846ad+'-'+_0x2ea9da+'/'+_0x5dc553)['json'](_0x1724b6);}return null;};}function patchUpdates(_0x216e4b){return function(_0x277fef){try{jsonpatch[_0x59bc('0x1f')](_0x277fef,_0x216e4b,!![]);}catch(_0x1901d5){return BPromise['reject'](_0x1901d5);}return _0x277fef[_0x59bc('0x20')]();};}function saveUpdates(_0x44587a,_0x1020c5){return function(_0x44208f){if(_0x44208f){return _0x44208f[_0x59bc('0x21')](_0x44587a)[_0x59bc('0x22')](function(_0x5a9b8f){return _0x5a9b8f;});}return null;};}function removeEntity(_0x18ca57,_0x7bc914){return function(_0x5bbaa5){if(_0x5bbaa5){return _0x5bbaa5[_0x59bc('0x23')]()[_0x59bc('0x22')](function(){_0x18ca57['status'](0xcc)[_0x59bc('0x18')]();});}};}function handleEntityNotFound(_0x2b91cc,_0x42f12a){return function(_0x308c37){if(!_0x308c37){_0x2b91cc['sendStatus'](0x194);}return _0x308c37;};}function handleError(_0x102fd0,_0x247732){_0x247732=_0x247732||0x1f4;return function(_0x1b733e){logger['error'](_0x1b733e['stack']);if(_0x1b733e[_0x59bc('0x24')]){delete _0x1b733e[_0x59bc('0x24')];}_0x102fd0['status'](_0x247732)[_0x59bc('0x25')](_0x1b733e);};}exports[_0x59bc('0x26')]=function(_0x4d2057,_0x362903){var _0xe4b55b={},_0x7175f3={},_0x2c2264={'count':0x0,'rows':[]};var _0x58c79d=_['map'](db[_0x59bc('0x27')]['rawAttributes'],function(_0x4c5edd){return{'name':_0x4c5edd[_0x59bc('0x28')],'type':_0x4c5edd[_0x59bc('0x29')][_0x59bc('0x2a')]};});_0x7175f3[_0x59bc('0x2b')]=_[_0x59bc('0x2c')](_0x58c79d,_0x59bc('0x24'));_0x7175f3['query']=_[_0x59bc('0x2d')](_0x4d2057[_0x59bc('0x2e')]);_0x7175f3[_0x59bc('0x2f')]=_[_0x59bc('0x30')](_0x7175f3[_0x59bc('0x2b')],_0x7175f3[_0x59bc('0x2e')]);_0xe4b55b[_0x59bc('0x31')]=_[_0x59bc('0x30')](_0x7175f3[_0x59bc('0x2b')],qs[_0x59bc('0x32')](_0x4d2057['query'][_0x59bc('0x32')]));_0xe4b55b[_0x59bc('0x31')]=_0xe4b55b[_0x59bc('0x31')][_0x59bc('0x33')]?_0xe4b55b[_0x59bc('0x31')]:_0x7175f3[_0x59bc('0x2b')];if(!_0x4d2057[_0x59bc('0x2e')][_0x59bc('0x34')](_0x59bc('0x35'))){_0xe4b55b[_0x59bc('0x1d')]=qs[_0x59bc('0x1d')](_0x4d2057[_0x59bc('0x2e')][_0x59bc('0x1d')]);_0xe4b55b[_0x59bc('0x1c')]=qs[_0x59bc('0x1c')](_0x4d2057[_0x59bc('0x2e')][_0x59bc('0x1c')]);}_0xe4b55b[_0x59bc('0x36')]=qs['sort'](_0x4d2057[_0x59bc('0x2e')][_0x59bc('0x37')]);_0xe4b55b[_0x59bc('0x38')]=qs[_0x59bc('0x2f')](_[_0x59bc('0x39')](_0x4d2057['query'],_0x7175f3['filters']),_0x58c79d);if(_0x4d2057[_0x59bc('0x2e')][_0x59bc('0x3a')]){_0xe4b55b['where']=_[_0x59bc('0x3b')](_0xe4b55b['where'],{'$or':_[_0x59bc('0x2c')](_0x58c79d,function(_0x57fc62){if(_0x57fc62[_0x59bc('0x29')]!==_0x59bc('0x3c')){var _0x228719={};_0x228719[_0x57fc62['name']]={'$like':'%'+_0x4d2057[_0x59bc('0x2e')]['filter']+'%'};return _0x228719;}})});}_0xe4b55b=_['merge']({},_0xe4b55b,_0x4d2057[_0x59bc('0x3d')]);var _0x31b317={'where':_0xe4b55b[_0x59bc('0x38')]};return db['IntegrationReport'][_0x59bc('0x1b')](_0x31b317)['then'](function(_0x6d6a75){_0x2c2264[_0x59bc('0x1b')]=_0x6d6a75;if(_0x4d2057[_0x59bc('0x2e')][_0x59bc('0x3e')]){_0xe4b55b[_0x59bc('0x3f')]=[{'all':!![]}];}return db[_0x59bc('0x27')][_0x59bc('0x40')](_0xe4b55b);})['then'](function(_0x1da004){_0x2c2264[_0x59bc('0x41')]=_0x1da004;return _0x2c2264;})[_0x59bc('0x22')](respondWithFilteredResult(_0x362903,_0xe4b55b))[_0x59bc('0x42')](handleError(_0x362903,null));};exports[_0x59bc('0x43')]=function(_0xb7d948,_0x3e4346){var _0x34d93a={'raw':![],'where':{'id':_0xb7d948[_0x59bc('0x44')]['id']}},_0x2b7d9e={};_0x2b7d9e[_0x59bc('0x2b')]=_[_0x59bc('0x2d')](db[_0x59bc('0x27')]['rawAttributes']);_0x2b7d9e[_0x59bc('0x2e')]=_[_0x59bc('0x2d')](_0xb7d948['query']);_0x2b7d9e['filters']=_[_0x59bc('0x30')](_0x2b7d9e[_0x59bc('0x2b')],_0x2b7d9e[_0x59bc('0x2e')]);_0x34d93a[_0x59bc('0x31')]=_['intersection'](_0x2b7d9e['model'],qs[_0x59bc('0x32')](_0xb7d948['query'][_0x59bc('0x32')]));_0x34d93a[_0x59bc('0x31')]=_0x34d93a[_0x59bc('0x31')][_0x59bc('0x33')]?_0x34d93a['attributes']:_0x2b7d9e[_0x59bc('0x2b')];if(_0xb7d948['query']['includeAll']){_0x34d93a[_0x59bc('0x3f')]=[{'all':!![]}];}_0x34d93a=_[_0x59bc('0x3b')]({},_0x34d93a,_0xb7d948['options']);return db['IntegrationReport'][_0x59bc('0x45')](_0x34d93a)[_0x59bc('0x22')](handleEntityNotFound(_0x3e4346,null))[_0x59bc('0x22')](respondWithResult(_0x3e4346,null))[_0x59bc('0x42')](handleError(_0x3e4346,null));};exports[_0x59bc('0x46')]=function(_0x7fd08,_0xf157ce){return db[_0x59bc('0x27')][_0x59bc('0x46')](_0x7fd08[_0x59bc('0x47')],{})[_0x59bc('0x22')](respondWithResult(_0xf157ce,0xc9))[_0x59bc('0x42')](handleError(_0xf157ce,null));};exports['update']=function(_0x31a1c1,_0x5bf7d6){if(_0x31a1c1[_0x59bc('0x47')]['id']){delete _0x31a1c1[_0x59bc('0x47')]['id'];}return db[_0x59bc('0x27')]['find']({'where':{'id':_0x31a1c1[_0x59bc('0x44')]['id']}})[_0x59bc('0x22')](handleEntityNotFound(_0x5bf7d6,null))[_0x59bc('0x22')](saveUpdates(_0x31a1c1[_0x59bc('0x47')],null))[_0x59bc('0x22')](respondWithResult(_0x5bf7d6,null))[_0x59bc('0x42')](handleError(_0x5bf7d6,null));};exports[_0x59bc('0x23')]=function(_0x240ca1,_0x18811d){return db[_0x59bc('0x27')]['find']({'where':{'id':_0x240ca1[_0x59bc('0x44')]['id']}})[_0x59bc('0x22')](handleEntityNotFound(_0x18811d,null))[_0x59bc('0x22')](removeEntity(_0x18811d,null))[_0x59bc('0x42')](handleError(_0x18811d,null));};exports[_0x59bc('0x48')]=function(_0x1ddc58,_0xcdd269){return db[_0x59bc('0x27')][_0x59bc('0x48')]()[_0x59bc('0x22')](respondWithResult(_0xcdd269,null))['catch'](handleError(_0xcdd269,null));};
\ No newline at end of file
+var _0x38bc=['to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x3dd88d,_0x279903){var _0x286285=function(_0x19f5b7){while(--_0x19f5b7){_0x3dd88d['push'](_0x3dd88d['shift']());}};_0x286285(++_0x279903);}(_0x38bc,0x88));var _0xc38b=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x38bc[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0xc38b('0x0'));var rimraf=require(_0xc38b('0x1'));var zipdir=require(_0xc38b('0x2'));var jsonpatch=require(_0xc38b('0x3'));var rp=require(_0xc38b('0x4'));var moment=require(_0xc38b('0x5'));var BPromise=require(_0xc38b('0x6'));var Mustache=require('mustache');var util=require(_0xc38b('0x7'));var path=require(_0xc38b('0x8'));var sox=require(_0xc38b('0x9'));var csv=require(_0xc38b('0xa'));var ejs=require(_0xc38b('0xb'));var fs=require('fs');var fs_extra=require(_0xc38b('0xc'));var _=require('lodash');var squel=require(_0xc38b('0xd'));var crypto=require(_0xc38b('0xe'));var jsforce=require(_0xc38b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc38b('0xa'));var querystring=require(_0xc38b('0x10'));var Papa=require(_0xc38b('0x11'));var Redis=require(_0xc38b('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc38b('0x13'));var hardwareService=require(_0xc38b('0x14'));var logger=require(_0xc38b('0x15'))(_0xc38b('0x16'));var utils=require(_0xc38b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc38b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x463c5d,_0x31dcd2){_0x31dcd2=_0x31dcd2||0xcc;return function(_0x11f841){if(_0x11f841){return _0x463c5d[_0xc38b('0x19')](_0x31dcd2);}return _0x463c5d[_0xc38b('0x1a')](_0x31dcd2)[_0xc38b('0x1b')]();};}function respondWithResult(_0x59e3f6,_0xe82e3a){_0xe82e3a=_0xe82e3a||0xc8;return function(_0x3acd56){if(_0x3acd56){return _0x59e3f6[_0xc38b('0x1a')](_0xe82e3a)[_0xc38b('0x1c')](_0x3acd56);}};}function respondWithFilteredResult(_0x4d6768,_0x30e3c7){return function(_0x4859d5){if(_0x4859d5){var _0x1a44bb=typeof _0x30e3c7['offset']===_0xc38b('0x1d')&&typeof _0x30e3c7[_0xc38b('0x1e')]===_0xc38b('0x1d');var _0x19e6c4=_0x4859d5[_0xc38b('0x1f')];var _0x56ebc7=_0x1a44bb?0x0:_0x30e3c7[_0xc38b('0x20')];var _0x1050e2=_0x1a44bb?_0x4859d5[_0xc38b('0x1f')]:_0x30e3c7['offset']+_0x30e3c7[_0xc38b('0x1e')];var _0x377584;if(_0x1050e2>=_0x19e6c4){_0x1050e2=_0x19e6c4;_0x377584=0xc8;}else{_0x377584=0xce;}_0x4d6768[_0xc38b('0x1a')](_0x377584);return _0x4d6768['set']('Content-Range',_0x56ebc7+'-'+_0x1050e2+'/'+_0x19e6c4)[_0xc38b('0x1c')](_0x4859d5);}return null;};}function patchUpdates(_0x2326aa){return function(_0x3ef421){try{jsonpatch[_0xc38b('0x21')](_0x3ef421,_0x2326aa,!![]);}catch(_0x1c6bfc){return BPromise[_0xc38b('0x22')](_0x1c6bfc);}return _0x3ef421[_0xc38b('0x23')]();};}function saveUpdates(_0x434a62,_0x553c0a){return function(_0xe790b3){if(_0xe790b3){return _0xe790b3[_0xc38b('0x24')](_0x434a62)[_0xc38b('0x25')](function(_0x2c8384){return _0x2c8384;});}return null;};}function removeEntity(_0xf77df6,_0x293c72){return function(_0x39efe3){if(_0x39efe3){return _0x39efe3['destroy']()[_0xc38b('0x25')](function(){_0xf77df6[_0xc38b('0x1a')](0xcc)[_0xc38b('0x1b')]();});}};}function handleEntityNotFound(_0x417bd5,_0x4b4799){return function(_0x23283e){if(!_0x23283e){_0x417bd5['sendStatus'](0x194);}return _0x23283e;};}function handleError(_0x3e84f6,_0x55df63){_0x55df63=_0x55df63||0x1f4;return function(_0x2a4738){logger[_0xc38b('0x26')](_0x2a4738[_0xc38b('0x27')]);if(_0x2a4738[_0xc38b('0x28')]){delete _0x2a4738[_0xc38b('0x28')];}_0x3e84f6['status'](_0x55df63)['send'](_0x2a4738);};}exports[_0xc38b('0x29')]=function(_0xd63c31,_0x504349){var _0x480761={},_0x3b9553={},_0x5e4919={'count':0x0,'rows':[]};var _0x3e7239=_[_0xc38b('0x2a')](db[_0xc38b('0x2b')][_0xc38b('0x2c')],function(_0x464d5a){return{'name':_0x464d5a[_0xc38b('0x2d')],'type':_0x464d5a['type']['key']};});_0x3b9553[_0xc38b('0x2e')]=_[_0xc38b('0x2a')](_0x3e7239,_0xc38b('0x28'));_0x3b9553[_0xc38b('0x2f')]=_['keys'](_0xd63c31[_0xc38b('0x2f')]);_0x3b9553[_0xc38b('0x30')]=_[_0xc38b('0x31')](_0x3b9553[_0xc38b('0x2e')],_0x3b9553[_0xc38b('0x2f')]);_0x480761[_0xc38b('0x32')]=_[_0xc38b('0x31')](_0x3b9553[_0xc38b('0x2e')],qs[_0xc38b('0x33')](_0xd63c31[_0xc38b('0x2f')][_0xc38b('0x33')]));_0x480761[_0xc38b('0x32')]=_0x480761['attributes'][_0xc38b('0x34')]?_0x480761['attributes']:_0x3b9553['model'];if(!_0xd63c31[_0xc38b('0x2f')][_0xc38b('0x35')]('nolimit')){_0x480761[_0xc38b('0x1e')]=qs['limit'](_0xd63c31[_0xc38b('0x2f')][_0xc38b('0x1e')]);_0x480761[_0xc38b('0x20')]=qs[_0xc38b('0x20')](_0xd63c31['query'][_0xc38b('0x20')]);}_0x480761[_0xc38b('0x36')]=qs[_0xc38b('0x37')](_0xd63c31[_0xc38b('0x2f')][_0xc38b('0x37')]);_0x480761[_0xc38b('0x38')]=qs[_0xc38b('0x30')](_['pick'](_0xd63c31[_0xc38b('0x2f')],_0x3b9553[_0xc38b('0x30')]),_0x3e7239);if(_0xd63c31[_0xc38b('0x2f')][_0xc38b('0x39')]){_0x480761['where']=_[_0xc38b('0x3a')](_0x480761['where'],{'$or':_[_0xc38b('0x2a')](_0x3e7239,function(_0x2d0693){if(_0x2d0693[_0xc38b('0x3b')]!==_0xc38b('0x3c')){var _0x423ae2={};_0x423ae2[_0x2d0693[_0xc38b('0x28')]]={'$like':'%'+_0xd63c31[_0xc38b('0x2f')][_0xc38b('0x39')]+'%'};return _0x423ae2;}})});}_0x480761=_[_0xc38b('0x3a')]({},_0x480761,_0xd63c31[_0xc38b('0x3d')]);var _0x3c3db8={'where':_0x480761['where']};return db[_0xc38b('0x2b')][_0xc38b('0x1f')](_0x3c3db8)[_0xc38b('0x25')](function(_0x263020){_0x5e4919[_0xc38b('0x1f')]=_0x263020;if(_0xd63c31[_0xc38b('0x2f')][_0xc38b('0x3e')]){_0x480761[_0xc38b('0x3f')]=[{'all':!![]}];}return db[_0xc38b('0x2b')][_0xc38b('0x40')](_0x480761);})[_0xc38b('0x25')](function(_0xfe3df0){_0x5e4919[_0xc38b('0x41')]=_0xfe3df0;return _0x5e4919;})[_0xc38b('0x25')](respondWithFilteredResult(_0x504349,_0x480761))[_0xc38b('0x42')](handleError(_0x504349,null));};exports['show']=function(_0x4bc8fd,_0x375398){var _0x194f03={'raw':![],'where':{'id':_0x4bc8fd['params']['id']}},_0x345c75={};_0x345c75[_0xc38b('0x2e')]=_[_0xc38b('0x43')](db[_0xc38b('0x2b')]['rawAttributes']);_0x345c75[_0xc38b('0x2f')]=_[_0xc38b('0x43')](_0x4bc8fd[_0xc38b('0x2f')]);_0x345c75[_0xc38b('0x30')]=_[_0xc38b('0x31')](_0x345c75[_0xc38b('0x2e')],_0x345c75[_0xc38b('0x2f')]);_0x194f03['attributes']=_[_0xc38b('0x31')](_0x345c75[_0xc38b('0x2e')],qs['fields'](_0x4bc8fd[_0xc38b('0x2f')][_0xc38b('0x33')]));_0x194f03[_0xc38b('0x32')]=_0x194f03[_0xc38b('0x32')][_0xc38b('0x34')]?_0x194f03[_0xc38b('0x32')]:_0x345c75[_0xc38b('0x2e')];if(_0x4bc8fd[_0xc38b('0x2f')][_0xc38b('0x3e')]){_0x194f03['include']=[{'all':!![]}];}_0x194f03=_[_0xc38b('0x3a')]({},_0x194f03,_0x4bc8fd[_0xc38b('0x3d')]);return db[_0xc38b('0x2b')]['find'](_0x194f03)[_0xc38b('0x25')](handleEntityNotFound(_0x375398,null))[_0xc38b('0x25')](respondWithResult(_0x375398,null))[_0xc38b('0x42')](handleError(_0x375398,null));};exports['create']=function(_0xae2cae,_0xdd292b){return db['IntegrationReport'][_0xc38b('0x44')](_0xae2cae[_0xc38b('0x45')],{})[_0xc38b('0x25')](respondWithResult(_0xdd292b,0xc9))[_0xc38b('0x42')](handleError(_0xdd292b,null));};exports[_0xc38b('0x24')]=function(_0xed6c3,_0x539f49){if(_0xed6c3[_0xc38b('0x45')]['id']){delete _0xed6c3[_0xc38b('0x45')]['id'];}return db[_0xc38b('0x2b')][_0xc38b('0x46')]({'where':{'id':_0xed6c3[_0xc38b('0x47')]['id']}})['then'](handleEntityNotFound(_0x539f49,null))[_0xc38b('0x25')](saveUpdates(_0xed6c3[_0xc38b('0x45')],null))[_0xc38b('0x25')](respondWithResult(_0x539f49,null))['catch'](handleError(_0x539f49,null));};exports['destroy']=function(_0x1233bb,_0x24f592){return db['IntegrationReport'][_0xc38b('0x46')]({'where':{'id':_0x1233bb[_0xc38b('0x47')]['id']}})[_0xc38b('0x25')](handleEntityNotFound(_0x24f592,null))[_0xc38b('0x25')](removeEntity(_0x24f592,null))[_0xc38b('0x42')](handleError(_0x24f592,null));};exports[_0xc38b('0x48')]=function(_0x43fa72,_0x16aee3){return db[_0xc38b('0x2b')]['describe']()[_0xc38b('0x25')](respondWithResult(_0x16aee3,null))[_0xc38b('0x42')](handleError(_0x16aee3,null));};
\ No newline at end of file
index 28a9f01..cbbc376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacb3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xacb3,0xc3));var _0x3acb=function(_0x354fc7,_0x10bd45){_0x354fc7=_0x354fc7-0x0;var _0x462135=_0xacb3[_0x354fc7];return _0x462135;};'use strict';var _=require(_0x3acb('0x0'));var util=require(_0x3acb('0x1'));var logger=require(_0x3acb('0x2'))(_0x3acb('0x3'));var moment=require(_0x3acb('0x4'));var BPromise=require(_0x3acb('0x5'));var rp=require(_0x3acb('0x6'));var fs=require('fs');var path=require(_0x3acb('0x7'));var rimraf=require(_0x3acb('0x8'));var config=require(_0x3acb('0x9'));var attributes=require(_0x3acb('0xa'));module[_0x3acb('0xb')]=function(_0x519ae5,_0x2eae9d){return _0x519ae5[_0x3acb('0xc')](_0x3acb('0xd'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98d0=['../../config/logger','api','bluebird','path','../../config/environment','exports','define','report_integration','lodash'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x98d0,0x15e));var _0x098d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x98d0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x098d('0x0'));var util=require('util');var logger=require(_0x098d('0x1'))(_0x098d('0x2'));var moment=require('moment');var BPromise=require(_0x098d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x098d('0x4'));var rimraf=require('rimraf');var config=require(_0x098d('0x5'));var attributes=require('./integrationReport.attributes');module[_0x098d('0x6')]=function(_0x41736d,_0x4a69fd){return _0x41736d[_0x098d('0x7')]('IntegrationReport',attributes,{'tableName':_0x098d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f45bd93..00972ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}
\ No newline at end of file
+var _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x48be66,_0x5dee34){var _0x2a5a59=function(_0xf8770b){while(--_0xf8770b){_0x48be66['push'](_0x48be66['shift']());}};_0x2a5a59(++_0x5dee34);}(_0x57ca,0x108));var _0xa57c=function(_0x43c996,_0x56d407){_0x43c996=_0x43c996-0x0;var _0xec8904=_0x57ca[_0x43c996];return _0xec8904;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}
\ No newline at end of file
index 1515e2f..d911be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e64=['addIntervals','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many'];(function(_0x272d6f,_0x3a6bb7){var _0xc89689=function(_0xcce23d){while(--_0xcce23d){_0x272d6f['push'](_0x272d6f['shift']());}};_0xc89689(++_0x3a6bb7);}(_0x6e64,0x10f));var _0x46e6=function(_0x319ee5,_0x410f03){_0x319ee5=_0x319ee5-0x0;var _0xe96ccd=_0x6e64[_0x319ee5];return _0xe96ccd;};'use strict';var multer=require(_0x46e6('0x0'));var util=require(_0x46e6('0x1'));var path=require(_0x46e6('0x2'));var timeout=require(_0x46e6('0x3'));var express=require('express');var router=express[_0x46e6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46e6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x46e6('0x6'));var controller=require(_0x46e6('0x7'));router[_0x46e6('0x8')]('/',auth[_0x46e6('0x9')](),controller[_0x46e6('0xa')]);router[_0x46e6('0x8')]('/:id',auth[_0x46e6('0x9')](),controller[_0x46e6('0xb')]);router[_0x46e6('0x8')](_0x46e6('0xc'),auth[_0x46e6('0x9')](),controller[_0x46e6('0xd')]);router[_0x46e6('0xe')]('/',auth[_0x46e6('0x9')](),controller[_0x46e6('0xf')]);router[_0x46e6('0xe')]('/:id/sub_intervals',auth[_0x46e6('0x9')](),controller['addInterval']);router['post'](_0x46e6('0x10'),auth[_0x46e6('0x9')](),controller[_0x46e6('0x11')]);router[_0x46e6('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x46e6('0x13')]);router[_0x46e6('0x14')](_0x46e6('0x15'),auth[_0x46e6('0x9')](),controller[_0x46e6('0x16')]);module[_0x46e6('0x17')]=router;
\ No newline at end of file
+var _0x3975=['show','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id'];(function(_0x308ce1,_0x817b19){var _0x2af753=function(_0x4acfcd){while(--_0x4acfcd){_0x308ce1['push'](_0x308ce1['shift']());}};_0x2af753(++_0x817b19);}(_0x3975,0x197));var _0x5397=function(_0x5d4e37,_0x6ee8b9){_0x5d4e37=_0x5d4e37-0x0;var _0x3badc5=_0x3975[_0x5d4e37];return _0x3badc5;};'use strict';var multer=require(_0x5397('0x0'));var util=require(_0x5397('0x1'));var path=require('path');var timeout=require(_0x5397('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5397('0x3'));var auth=require(_0x5397('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5397('0x5'));var controller=require(_0x5397('0x6'));router[_0x5397('0x7')]('/',auth[_0x5397('0x8')](),controller[_0x5397('0x9')]);router[_0x5397('0x7')](_0x5397('0xa'),auth[_0x5397('0x8')](),controller[_0x5397('0xb')]);router['get']('/:id/sub_intervals',auth[_0x5397('0x8')](),controller['getIntervals']);router[_0x5397('0xc')]('/',auth['isAuthenticated'](),controller[_0x5397('0xd')]);router[_0x5397('0xc')](_0x5397('0xe'),auth[_0x5397('0x8')](),controller[_0x5397('0xf')]);router[_0x5397('0xc')](_0x5397('0x10'),auth[_0x5397('0x8')](),controller[_0x5397('0x11')]);router[_0x5397('0x12')](_0x5397('0xa'),auth['isAuthenticated'](),controller[_0x5397('0x13')]);router[_0x5397('0x14')]('/:id',auth[_0x5397('0x8')](),controller['destroy']);module[_0x5397('0x15')]=router;
\ No newline at end of file
index 5a55152..803ad34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x971c=['STRING','sequelize','exports'];(function(_0x5f3362,_0x132e46){var _0x310b57=function(_0x433b97){while(--_0x433b97){_0x5f3362['push'](_0x5f3362['shift']());}};_0x310b57(++_0x132e46);}(_0x971c,0x172));var _0xc971=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x971c[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xc971('0x0'));module[_0xc971('0x1')]={'name':{'type':Sequelize[_0xc971('0x2')]},'description':{'type':Sequelize[_0xc971('0x2')]},'interval':{'type':Sequelize[_0xc971('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x36ab=['exports','STRING'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x36ab,0x18a));var _0xb36a=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x36ab[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require('sequelize');module[_0xb36a('0x0')]={'name':{'type':Sequelize[_0xb36a('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb36a('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 4565320..5c10949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf93=['where','type','VIRTUAL','filter','merge','options','Interval','include','findAll','rows','show','params','includeAll','catch','create','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','findOne','order','pick','getIntervals','addIntervals','transaction','bulkCreate','zip-dir','moment','bluebird','mustache','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','Intervals','destroy','error','name','send','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters'];(function(_0x26481b,_0x20c100){var _0x2dd2f8=function(_0x535a3a){while(--_0x535a3a){_0x26481b['push'](_0x26481b['shift']());}};_0x2dd2f8(++_0x20c100);}(_0xcf93,0x168));var _0x3cf9=function(_0x2952a5,_0x3904a3){_0x2952a5=_0x2952a5-0x0;var _0x380ea4=_0xcf93[_0x2952a5];return _0x380ea4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3cf9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3cf9('0x1'));var BPromise=require(_0x3cf9('0x2'));var Mustache=require(_0x3cf9('0x3'));var util=require('util');var path=require(_0x3cf9('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3cf9('0x5'));var _=require('lodash');var squel=require(_0x3cf9('0x6'));var crypto=require(_0x3cf9('0x7'));var jsforce=require(_0x3cf9('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x3cf9('0x9'));var querystring=require(_0x3cf9('0xa'));var Papa=require(_0x3cf9('0xb'));var Redis=require(_0x3cf9('0xc'));var authService=require(_0x3cf9('0xd'));var qs=require(_0x3cf9('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cf9('0xf'))(_0x3cf9('0x10'));var utils=require(_0x3cf9('0x11'));var config=require(_0x3cf9('0x12'));var licenseUtil=require(_0x3cf9('0x13'));var db=require(_0x3cf9('0x14'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x331e64,_0x3dbe73){_0x3dbe73=_0x3dbe73||0xcc;return function(_0x484637){if(_0x484637){return _0x331e64[_0x3cf9('0x15')](_0x3dbe73);}return _0x331e64['status'](_0x3dbe73)[_0x3cf9('0x16')]();};}function respondWithResult(_0x26e9dd,_0x4e12b3){_0x4e12b3=_0x4e12b3||0xc8;return function(_0x377d1e){if(_0x377d1e){return _0x26e9dd[_0x3cf9('0x17')](_0x4e12b3)['json'](_0x377d1e);}};}function respondWithFilteredResult(_0xe1c083,_0x5ead98){return function(_0xa24311){if(_0xa24311){var _0x4438cd=typeof _0x5ead98[_0x3cf9('0x18')]===_0x3cf9('0x19')&&typeof _0x5ead98['limit']==='undefined';var _0x4a47e1=_0xa24311[_0x3cf9('0x1a')];var _0x47711d=_0x4438cd?0x0:_0x5ead98[_0x3cf9('0x18')];var _0x203dbe=_0x4438cd?_0xa24311['count']:_0x5ead98[_0x3cf9('0x18')]+_0x5ead98[_0x3cf9('0x1b')];var _0x19b2e0;if(_0x203dbe>=_0x4a47e1){_0x203dbe=_0x4a47e1;_0x19b2e0=0xc8;}else{_0x19b2e0=0xce;}_0xe1c083[_0x3cf9('0x17')](_0x19b2e0);return _0xe1c083[_0x3cf9('0x1c')](_0x3cf9('0x1d'),_0x47711d+'-'+_0x203dbe+'/'+_0x4a47e1)['json'](_0xa24311);}return null;};}function patchUpdates(_0x44a0f3){return function(_0x401374){try{jsonpatch[_0x3cf9('0x1e')](_0x401374,_0x44a0f3,!![]);}catch(_0x536664){return BPromise[_0x3cf9('0x1f')](_0x536664);}return _0x401374['save']();};}function saveUpdates(_0x1cde30,_0x2d9fd1){return function(_0x2b249d){if(_0x2b249d){return _0x2b249d[_0x3cf9('0x20')](_0x1cde30)[_0x3cf9('0x21')](function(_0xc84874){return _0xc84874;});}return null;};}function removeEntity(_0x16a6ed,_0x387502){return function(_0x530758){if(_0x530758){return _0x530758['destroy']()[_0x3cf9('0x21')](function(){var _0x3ef56b=_0x530758[_0x3cf9('0x22')]({'plain':!![]});var _0x30159e=_0x3cf9('0x23');return db['UserProfileResource'][_0x3cf9('0x24')]({'where':{'type':_0x30159e,'resourceId':_0x3ef56b['id']}})[_0x3cf9('0x21')](function(){return _0x530758;});})[_0x3cf9('0x21')](function(){_0x16a6ed[_0x3cf9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d45a,_0x3abebd){return function(_0x164c72){if(!_0x164c72){_0x44d45a[_0x3cf9('0x15')](0x194);}return _0x164c72;};}function handleError(_0x16a577,_0x382b3a){_0x382b3a=_0x382b3a||0x1f4;return function(_0x25ee42){logger[_0x3cf9('0x25')](_0x25ee42['stack']);if(_0x25ee42[_0x3cf9('0x26')]){delete _0x25ee42[_0x3cf9('0x26')];}_0x16a577['status'](_0x382b3a)[_0x3cf9('0x27')](_0x25ee42);};}exports['index']=function(_0x39e002,_0x57fbef){var _0x470299={},_0x5b8480={},_0x1f4058={'count':0x0,'rows':[]};var _0x5d9a01=_[_0x3cf9('0x28')](db['Interval'][_0x3cf9('0x29')],function(_0xd56ee0){return{'name':_0xd56ee0[_0x3cf9('0x2a')],'type':_0xd56ee0['type'][_0x3cf9('0x2b')]};});_0x5b8480[_0x3cf9('0x2c')]=_[_0x3cf9('0x28')](_0x5d9a01,_0x3cf9('0x26'));_0x5b8480['query']=_[_0x3cf9('0x2d')](_0x39e002[_0x3cf9('0x2e')]);_0x5b8480['filters']=_[_0x3cf9('0x2f')](_0x5b8480[_0x3cf9('0x2c')],_0x5b8480[_0x3cf9('0x2e')]);_0x470299['attributes']=_[_0x3cf9('0x2f')](_0x5b8480[_0x3cf9('0x2c')],qs['fields'](_0x39e002[_0x3cf9('0x2e')][_0x3cf9('0x30')]));_0x470299[_0x3cf9('0x31')]=_0x470299[_0x3cf9('0x31')][_0x3cf9('0x32')]?_0x470299[_0x3cf9('0x31')]:_0x5b8480['model'];if(!_0x39e002['query'][_0x3cf9('0x33')](_0x3cf9('0x34'))){_0x470299[_0x3cf9('0x1b')]=qs[_0x3cf9('0x1b')](_0x39e002[_0x3cf9('0x2e')][_0x3cf9('0x1b')]);_0x470299[_0x3cf9('0x18')]=qs[_0x3cf9('0x18')](_0x39e002[_0x3cf9('0x2e')][_0x3cf9('0x18')]);}_0x470299['order']=qs[_0x3cf9('0x35')](_0x39e002[_0x3cf9('0x2e')][_0x3cf9('0x35')]);_0x470299['where']=qs[_0x3cf9('0x36')](_['pick'](_0x39e002[_0x3cf9('0x2e')],_0x5b8480[_0x3cf9('0x36')]),_0x5d9a01);if(_0x39e002[_0x3cf9('0x2e')]['filter']){_0x470299[_0x3cf9('0x37')]=_['merge'](_0x470299[_0x3cf9('0x37')],{'$or':_['map'](_0x5d9a01,function(_0x112f29){if(_0x112f29[_0x3cf9('0x38')]!==_0x3cf9('0x39')){var _0x49abc9={};_0x49abc9[_0x112f29[_0x3cf9('0x26')]]={'$like':'%'+_0x39e002['query'][_0x3cf9('0x3a')]+'%'};return _0x49abc9;}})});}_0x470299=_[_0x3cf9('0x3b')]({},_0x470299,_0x39e002[_0x3cf9('0x3c')]);var _0x3944a3={'where':_0x470299[_0x3cf9('0x37')]};return db[_0x3cf9('0x3d')][_0x3cf9('0x1a')](_0x3944a3)[_0x3cf9('0x21')](function(_0x40c8f4){_0x1f4058['count']=_0x40c8f4;if(_0x39e002[_0x3cf9('0x2e')]['includeAll']){_0x470299[_0x3cf9('0x3e')]=[{'all':!![]}];}return db[_0x3cf9('0x3d')][_0x3cf9('0x3f')](_0x470299);})[_0x3cf9('0x21')](function(_0x45071a){_0x1f4058[_0x3cf9('0x40')]=_0x45071a;return _0x1f4058;})[_0x3cf9('0x21')](respondWithFilteredResult(_0x57fbef,_0x470299))['catch'](handleError(_0x57fbef,null));};exports[_0x3cf9('0x41')]=function(_0xca8539,_0x56193c){var _0x2f5d47={'raw':!![],'where':{'id':_0xca8539[_0x3cf9('0x42')]['id']}},_0x1ebe36={};_0x1ebe36['model']=_[_0x3cf9('0x2d')](db[_0x3cf9('0x3d')]['rawAttributes']);_0x1ebe36['query']=_[_0x3cf9('0x2d')](_0xca8539['query']);_0x1ebe36['filters']=_['intersection'](_0x1ebe36[_0x3cf9('0x2c')],_0x1ebe36[_0x3cf9('0x2e')]);_0x2f5d47['attributes']=_[_0x3cf9('0x2f')](_0x1ebe36[_0x3cf9('0x2c')],qs[_0x3cf9('0x30')](_0xca8539['query'][_0x3cf9('0x30')]));_0x2f5d47['attributes']=_0x2f5d47[_0x3cf9('0x31')][_0x3cf9('0x32')]?_0x2f5d47[_0x3cf9('0x31')]:_0x1ebe36[_0x3cf9('0x2c')];if(_0xca8539['query'][_0x3cf9('0x43')]){_0x2f5d47[_0x3cf9('0x3e')]=[{'all':!![]}];}_0x2f5d47=_[_0x3cf9('0x3b')]({},_0x2f5d47,_0xca8539[_0x3cf9('0x3c')]);return db[_0x3cf9('0x3d')]['find'](_0x2f5d47)[_0x3cf9('0x21')](handleEntityNotFound(_0x56193c,null))[_0x3cf9('0x21')](respondWithResult(_0x56193c,null))[_0x3cf9('0x44')](handleError(_0x56193c,null));};exports['create']=function(_0x33117a,_0x543f88){return db[_0x3cf9('0x3d')][_0x3cf9('0x45')](_0x33117a['body'],{})['then'](function(_0x4b0ff8){var _0x54d1b1=_0x33117a[_0x3cf9('0x46')][_0x3cf9('0x22')]({'plain':!![]});if(!_0x54d1b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54d1b1['role']===_0x3cf9('0x46')){var _0x49a900=_0x4b0ff8[_0x3cf9('0x22')]({'plain':!![]});var _0x528023=_0x3cf9('0x23');return db[_0x3cf9('0x47')][_0x3cf9('0x48')]({'where':{'name':_0x528023,'userProfileId':_0x54d1b1['userProfileId']},'raw':!![]})['then'](function(_0x2ef779){if(_0x2ef779&&_0x2ef779['autoAssociation']===0x0){return db['UserProfileResource'][_0x3cf9('0x45')]({'name':_0x49a900[_0x3cf9('0x26')],'resourceId':_0x49a900['id'],'type':_0x2ef779[_0x3cf9('0x26')],'sectionId':_0x2ef779['id']},{})[_0x3cf9('0x21')](function(){return _0x4b0ff8;});}else{return _0x4b0ff8;}})[_0x3cf9('0x44')](function(_0x25a95e){logger[_0x3cf9('0x25')](_0x3cf9('0x49'),_0x25a95e);throw _0x25a95e;});}return _0x4b0ff8;})['then'](respondWithResult(_0x543f88,0xc9))[_0x3cf9('0x44')](handleError(_0x543f88,null));};exports['update']=function(_0x2906d4,_0x5d27bb){if(_0x2906d4[_0x3cf9('0x4a')]['id']){delete _0x2906d4['body']['id'];}return db[_0x3cf9('0x3d')][_0x3cf9('0x48')]({'where':{'id':_0x2906d4[_0x3cf9('0x42')]['id']}})[_0x3cf9('0x21')](handleEntityNotFound(_0x5d27bb,null))[_0x3cf9('0x21')](saveUpdates(_0x2906d4[_0x3cf9('0x4a')],null))[_0x3cf9('0x21')](respondWithResult(_0x5d27bb,null))[_0x3cf9('0x44')](handleError(_0x5d27bb,null));};exports[_0x3cf9('0x24')]=function(_0x2042cc,_0x2b0c01){return db['Interval'][_0x3cf9('0x48')]({'where':{'id':_0x2042cc[_0x3cf9('0x42')]['id']}})[_0x3cf9('0x21')](handleEntityNotFound(_0x2b0c01,null))[_0x3cf9('0x21')](removeEntity(_0x2b0c01,null))[_0x3cf9('0x44')](handleError(_0x2b0c01,null));};exports[_0x3cf9('0x4b')]=function(_0x2226ae,_0x4cd1b3,_0x50f9a7){if(_0x2226ae[_0x3cf9('0x4a')]['id']){delete _0x2226ae[_0x3cf9('0x4a')]['id'];}return db[_0x3cf9('0x3d')][_0x3cf9('0x48')]({'where':{'id':_0x2226ae[_0x3cf9('0x42')]['id']}})[_0x3cf9('0x21')](handleEntityNotFound(_0x4cd1b3,null))[_0x3cf9('0x21')](function(_0x5edca0){if(_0x5edca0){_0x2226ae[_0x3cf9('0x4a')]['IntervalId']=_0x5edca0['id'];return db[_0x3cf9('0x3d')]['create'](_0x2226ae['body']);}})[_0x3cf9('0x21')](respondWithResult(_0x4cd1b3,null))[_0x3cf9('0x44')](handleError(_0x4cd1b3,null));};exports['getIntervals']=function(_0x48fd51,_0x34758b,_0x183aa0){var _0x5477c4={};var _0x5afeee={};var _0xba6ee6;var _0xb89b3f;return db[_0x3cf9('0x3d')][_0x3cf9('0x4c')]({'where':{'id':_0x48fd51[_0x3cf9('0x42')]['id']}})[_0x3cf9('0x21')](handleEntityNotFound(_0x34758b,null))['then'](function(_0x26519a){if(_0x26519a){_0xba6ee6=_0x26519a;_0x5afeee[_0x3cf9('0x2c')]=_[_0x3cf9('0x2d')](db[_0x3cf9('0x3d')][_0x3cf9('0x29')]);_0x5afeee[_0x3cf9('0x2e')]=_[_0x3cf9('0x2d')](_0x48fd51[_0x3cf9('0x2e')]);_0x5afeee['filters']=_['intersection'](_0x5afeee['model'],_0x5afeee['query']);_0x5477c4[_0x3cf9('0x31')]=_['intersection'](_0x5afeee[_0x3cf9('0x2c')],qs[_0x3cf9('0x30')](_0x48fd51[_0x3cf9('0x2e')]['fields']));_0x5477c4[_0x3cf9('0x31')]=_0x5477c4[_0x3cf9('0x31')]['length']?_0x5477c4['attributes']:_0x5afeee[_0x3cf9('0x2c')];_0x5477c4[_0x3cf9('0x4d')]=qs['sort'](_0x48fd51[_0x3cf9('0x2e')][_0x3cf9('0x35')]);_0x5477c4['where']=qs[_0x3cf9('0x36')](_[_0x3cf9('0x4e')](_0x48fd51[_0x3cf9('0x2e')],_0x5afeee[_0x3cf9('0x36')]));if(_0x48fd51[_0x3cf9('0x2e')]['filter']){_0x5477c4[_0x3cf9('0x37')]=_[_0x3cf9('0x3b')](_0x5477c4['where'],{'$or':_['map'](_0x5477c4[_0x3cf9('0x31')],function(_0x4a6304){var _0x751ce7={};_0x751ce7[_0x4a6304]={'$like':'%'+_0x48fd51[_0x3cf9('0x2e')][_0x3cf9('0x3a')]+'%'};return _0x751ce7;})});}_0x5477c4=_[_0x3cf9('0x3b')]({},_0x5477c4,_0x48fd51[_0x3cf9('0x3c')]);return _0xba6ee6[_0x3cf9('0x4f')](_0x5477c4);}})[_0x3cf9('0x21')](function(_0x43957a){if(_0x43957a){_0xb89b3f=_0x43957a[_0x3cf9('0x32')];if(!_0x48fd51[_0x3cf9('0x2e')][_0x3cf9('0x33')]('nolimit')){_0x5477c4[_0x3cf9('0x1b')]=qs['limit'](_0x48fd51[_0x3cf9('0x2e')][_0x3cf9('0x1b')]);_0x5477c4['offset']=qs[_0x3cf9('0x18')](_0x48fd51[_0x3cf9('0x2e')]['offset']);}return _0xba6ee6[_0x3cf9('0x4f')](_0x5477c4);}})[_0x3cf9('0x21')](function(_0x339acc){if(_0x339acc){return _0x339acc?{'count':_0xb89b3f,'rows':_0x339acc}:null;}})[_0x3cf9('0x21')](respondWithResult(_0x34758b,null))[_0x3cf9('0x44')](handleError(_0x34758b,null));};exports[_0x3cf9('0x50')]=function(_0x53b166,_0x3270b5,_0xd62663){return db[_0x3cf9('0x3d')]['findOne']({'where':{'id':_0x53b166[_0x3cf9('0x42')]['id']}})['then'](handleEntityNotFound(_0x3270b5,null))[_0x3cf9('0x21')](function(_0x1d926e){if(_0x1d926e){return db['sequelize'][_0x3cf9('0x51')](function(_0x5ed83e){return db['Interval'][_0x3cf9('0x24')]({'where':{'IntervalId':_0x53b166['params']['id']},'transaction':_0x5ed83e})[_0x3cf9('0x21')](function(_0x53f6d5){var _0x303948=_['map'](_0x53b166[_0x3cf9('0x4a')],function(_0x3dba9e){delete _0x3dba9e['id'];_0x3dba9e['IntervalId']=_0x53b166[_0x3cf9('0x42')]['id'];return _0x3dba9e;});return db['Interval'][_0x3cf9('0x52')](_0x303948,{'transaction':_0x5ed83e});});})[_0x3cf9('0x21')](function(){return db[_0x3cf9('0x3d')][_0x3cf9('0x3f')]({'where':{'IntervalId':_0x53b166['params']['id']}});});}})[_0x3cf9('0x21')](respondWithResult(_0x3270b5,null))[_0x3cf9('0x44')](handleError(_0x3270b5,null));};
\ No newline at end of file
+var _0xd8fb=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/extensions/rewrite','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','Intervals','status','sendStatus','error','stack','name','map','Interval','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xd8fb,0x1b1));var _0xbd8f=function(_0x32363d,_0x5ebdd9){_0x32363d=_0x32363d-0x0;var _0x7b46b=_0xd8fb[_0x32363d];return _0x7b46b;};'use strict';var emlformat=require(_0xbd8f('0x0'));var rimraf=require(_0xbd8f('0x1'));var zipdir=require(_0xbd8f('0x2'));var jsonpatch=require(_0xbd8f('0x3'));var rp=require(_0xbd8f('0x4'));var moment=require(_0xbd8f('0x5'));var BPromise=require(_0xbd8f('0x6'));var Mustache=require('mustache');var util=require(_0xbd8f('0x7'));var path=require(_0xbd8f('0x8'));var sox=require(_0xbd8f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8f('0xa'));var _=require(_0xbd8f('0xb'));var squel=require(_0xbd8f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbd8f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbd8f('0xe'));var Papa=require(_0xbd8f('0xf'));var Redis=require(_0xbd8f('0x10'));var authService=require(_0xbd8f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbd8f('0x12'));var hardwareService=require(_0xbd8f('0x13'));var logger=require(_0xbd8f('0x14'))('api');var utils=require(_0xbd8f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbd8f('0x16'));var db=require('../../mysqldb')['db'];var extensions=require(_0xbd8f('0x17'));function respondWithStatusCode(_0x3b35cc,_0x5f55bf){_0x5f55bf=_0x5f55bf||0xcc;return function(_0x551e49){if(_0x551e49){return _0x3b35cc['sendStatus'](_0x5f55bf);}return _0x3b35cc['status'](_0x5f55bf)['end']();};}function respondWithResult(_0x3acff1,_0x4573f8){_0x4573f8=_0x4573f8||0xc8;return function(_0x57435b){if(_0x57435b){return _0x3acff1['status'](_0x4573f8)[_0xbd8f('0x18')](_0x57435b);}};}function respondWithFilteredResult(_0x1697cd,_0x352ea9){return function(_0x2fc10f){if(_0x2fc10f){var _0x931ebf=typeof _0x352ea9[_0xbd8f('0x19')]==='undefined'&&typeof _0x352ea9['limit']===_0xbd8f('0x1a');var _0x4420c9=_0x2fc10f[_0xbd8f('0x1b')];var _0x447276=_0x931ebf?0x0:_0x352ea9[_0xbd8f('0x19')];var _0x5620a2=_0x931ebf?_0x2fc10f[_0xbd8f('0x1b')]:_0x352ea9[_0xbd8f('0x19')]+_0x352ea9['limit'];var _0x127965;if(_0x5620a2>=_0x4420c9){_0x5620a2=_0x4420c9;_0x127965=0xc8;}else{_0x127965=0xce;}_0x1697cd['status'](_0x127965);return _0x1697cd['set'](_0xbd8f('0x1c'),_0x447276+'-'+_0x5620a2+'/'+_0x4420c9)[_0xbd8f('0x18')](_0x2fc10f);}return null;};}function patchUpdates(_0x37ed76){return function(_0x1dc194){try{jsonpatch[_0xbd8f('0x1d')](_0x1dc194,_0x37ed76,!![]);}catch(_0x35702d){return BPromise['reject'](_0x35702d);}return _0x1dc194[_0xbd8f('0x1e')]();};}function saveUpdates(_0x45dd32,_0x15af79){return function(_0x49b984){if(_0x49b984){return _0x49b984[_0xbd8f('0x1f')](_0x45dd32)[_0xbd8f('0x20')](function(_0x51fcc6){return _0x51fcc6;});}return null;};}function removeEntity(_0x3cb347,_0x2ae4f0){return function(_0x3842c8){if(_0x3842c8){return _0x3842c8[_0xbd8f('0x21')]()[_0xbd8f('0x20')](function(){var _0x1f28b3=_0x3842c8['get']({'plain':!![]});var _0x3479aa=_0xbd8f('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x3479aa,'resourceId':_0x1f28b3['id']}})[_0xbd8f('0x20')](function(){return _0x3842c8;});})[_0xbd8f('0x20')](function(){_0x3cb347[_0xbd8f('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d78c9,_0x22bc2d){return function(_0x28ba94){if(!_0x28ba94){_0x2d78c9[_0xbd8f('0x24')](0x194);}return _0x28ba94;};}function handleError(_0x181fc7,_0x274ad0){_0x274ad0=_0x274ad0||0x1f4;return function(_0xfe54c4){logger[_0xbd8f('0x25')](_0xfe54c4[_0xbd8f('0x26')]);if(_0xfe54c4['name']){delete _0xfe54c4[_0xbd8f('0x27')];}_0x181fc7[_0xbd8f('0x23')](_0x274ad0)['send'](_0xfe54c4);};}exports['index']=function(_0xc910e,_0xb2e819){var _0x364214={},_0x12d53c={},_0x353758={'count':0x0,'rows':[]};var _0x6b79bd=_[_0xbd8f('0x28')](db[_0xbd8f('0x29')]['rawAttributes'],function(_0x410147){return{'name':_0x410147[_0xbd8f('0x2a')],'type':_0x410147[_0xbd8f('0x2b')][_0xbd8f('0x2c')]};});_0x12d53c['model']=_[_0xbd8f('0x28')](_0x6b79bd,_0xbd8f('0x27'));_0x12d53c[_0xbd8f('0x2d')]=_[_0xbd8f('0x2e')](_0xc910e[_0xbd8f('0x2d')]);_0x12d53c['filters']=_[_0xbd8f('0x2f')](_0x12d53c[_0xbd8f('0x30')],_0x12d53c[_0xbd8f('0x2d')]);_0x364214[_0xbd8f('0x31')]=_[_0xbd8f('0x2f')](_0x12d53c[_0xbd8f('0x30')],qs[_0xbd8f('0x32')](_0xc910e[_0xbd8f('0x2d')][_0xbd8f('0x32')]));_0x364214[_0xbd8f('0x31')]=_0x364214[_0xbd8f('0x31')]['length']?_0x364214[_0xbd8f('0x31')]:_0x12d53c[_0xbd8f('0x30')];if(!_0xc910e['query']['hasOwnProperty'](_0xbd8f('0x33'))){_0x364214[_0xbd8f('0x34')]=qs[_0xbd8f('0x34')](_0xc910e[_0xbd8f('0x2d')][_0xbd8f('0x34')]);_0x364214[_0xbd8f('0x19')]=qs[_0xbd8f('0x19')](_0xc910e[_0xbd8f('0x2d')][_0xbd8f('0x19')]);}_0x364214[_0xbd8f('0x35')]=qs[_0xbd8f('0x36')](_0xc910e[_0xbd8f('0x2d')][_0xbd8f('0x36')]);_0x364214[_0xbd8f('0x37')]=qs[_0xbd8f('0x38')](_[_0xbd8f('0x39')](_0xc910e['query'],_0x12d53c['filters']),_0x6b79bd);if(_0xc910e[_0xbd8f('0x2d')]['filter']){_0x364214['where']=_[_0xbd8f('0x3a')](_0x364214['where'],{'$or':_[_0xbd8f('0x28')](_0x6b79bd,function(_0xdaa916){if(_0xdaa916[_0xbd8f('0x2b')]!==_0xbd8f('0x3b')){var _0x5784e1={};_0x5784e1[_0xdaa916[_0xbd8f('0x27')]]={'$like':'%'+_0xc910e[_0xbd8f('0x2d')][_0xbd8f('0x3c')]+'%'};return _0x5784e1;}})});}_0x364214=_[_0xbd8f('0x3a')]({},_0x364214,_0xc910e[_0xbd8f('0x3d')]);var _0x4df7c7={'where':_0x364214[_0xbd8f('0x37')]};return db[_0xbd8f('0x29')][_0xbd8f('0x1b')](_0x4df7c7)[_0xbd8f('0x20')](function(_0x2d9352){_0x353758[_0xbd8f('0x1b')]=_0x2d9352;if(_0xc910e[_0xbd8f('0x2d')][_0xbd8f('0x3e')]){_0x364214[_0xbd8f('0x3f')]=[{'all':!![]}];}return db[_0xbd8f('0x29')][_0xbd8f('0x40')](_0x364214);})[_0xbd8f('0x20')](function(_0x410826){_0x353758[_0xbd8f('0x41')]=_0x410826;return _0x353758;})['then'](respondWithFilteredResult(_0xb2e819,_0x364214))['catch'](handleError(_0xb2e819,null));};exports[_0xbd8f('0x42')]=function(_0x42a0d8,_0x28e1c4){var _0x11e320={'raw':!![],'where':{'id':_0x42a0d8[_0xbd8f('0x43')]['id']}},_0x26dee3={};_0x26dee3[_0xbd8f('0x30')]=_[_0xbd8f('0x2e')](db[_0xbd8f('0x29')][_0xbd8f('0x44')]);_0x26dee3['query']=_['keys'](_0x42a0d8['query']);_0x26dee3[_0xbd8f('0x38')]=_[_0xbd8f('0x2f')](_0x26dee3[_0xbd8f('0x30')],_0x26dee3['query']);_0x11e320[_0xbd8f('0x31')]=_['intersection'](_0x26dee3[_0xbd8f('0x30')],qs['fields'](_0x42a0d8[_0xbd8f('0x2d')]['fields']));_0x11e320[_0xbd8f('0x31')]=_0x11e320[_0xbd8f('0x31')][_0xbd8f('0x45')]?_0x11e320['attributes']:_0x26dee3[_0xbd8f('0x30')];if(_0x42a0d8[_0xbd8f('0x2d')]['includeAll']){_0x11e320[_0xbd8f('0x3f')]=[{'all':!![]}];}_0x11e320=_[_0xbd8f('0x3a')]({},_0x11e320,_0x42a0d8[_0xbd8f('0x3d')]);return db[_0xbd8f('0x29')][_0xbd8f('0x46')](_0x11e320)[_0xbd8f('0x20')](handleEntityNotFound(_0x28e1c4,null))['then'](respondWithResult(_0x28e1c4,null))[_0xbd8f('0x47')](handleError(_0x28e1c4,null));};exports[_0xbd8f('0x48')]=function(_0x4bafe1,_0x26279e){return db['Interval'][_0xbd8f('0x48')](_0x4bafe1[_0xbd8f('0x49')],{})[_0xbd8f('0x20')](function(_0x188519){var _0x21db5e=_0x4bafe1[_0xbd8f('0x4a')]['get']({'plain':!![]});if(!_0x21db5e)throw new Error(_0xbd8f('0x4b'));if(_0x21db5e[_0xbd8f('0x4c')]==='user'){var _0xceb5a6=_0x188519[_0xbd8f('0x4d')]({'plain':!![]});var _0xca251d=_0xbd8f('0x22');return db[_0xbd8f('0x4e')]['find']({'where':{'name':_0xca251d,'userProfileId':_0x21db5e[_0xbd8f('0x4f')]},'raw':!![]})['then'](function(_0x496545){if(_0x496545&&_0x496545[_0xbd8f('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0xceb5a6['name'],'resourceId':_0xceb5a6['id'],'type':_0x496545['name'],'sectionId':_0x496545['id']},{})['then'](function(){return _0x188519;});}else{return _0x188519;}})['catch'](function(_0x56037f){logger['error'](_0xbd8f('0x51'),_0x56037f);throw _0x56037f;});}return _0x188519;})['then'](respondWithResult(_0x26279e,0xc9))[_0xbd8f('0x47')](handleError(_0x26279e,null));};exports[_0xbd8f('0x1f')]=function(_0xe51f37,_0x579eca){if(_0xe51f37[_0xbd8f('0x49')]['id']){delete _0xe51f37['body']['id'];}return db[_0xbd8f('0x29')][_0xbd8f('0x46')]({'where':{'id':_0xe51f37['params']['id']}})[_0xbd8f('0x20')](handleEntityNotFound(_0x579eca,null))[_0xbd8f('0x20')](saveUpdates(_0xe51f37[_0xbd8f('0x49')],null))[_0xbd8f('0x20')](respondWithResult(_0x579eca,null))[_0xbd8f('0x47')](handleError(_0x579eca,null));};exports[_0xbd8f('0x21')]=function(_0xdee5b8,_0x15caba){return db[_0xbd8f('0x29')][_0xbd8f('0x46')]({'where':{'id':_0xdee5b8[_0xbd8f('0x43')]['id']}})['then'](handleEntityNotFound(_0x15caba,null))[_0xbd8f('0x20')](removeEntity(_0x15caba,null))[_0xbd8f('0x47')](handleError(_0x15caba,null));};exports[_0xbd8f('0x52')]=function(_0x29e505,_0x17aa34,_0x41bf47){if(_0x29e505['body']['id']){delete _0x29e505[_0xbd8f('0x49')]['id'];}return db['Interval']['find']({'where':{'id':_0x29e505[_0xbd8f('0x43')]['id']}})[_0xbd8f('0x20')](handleEntityNotFound(_0x17aa34,null))[_0xbd8f('0x20')](function(_0x535e27){if(_0x535e27){_0x29e505[_0xbd8f('0x49')][_0xbd8f('0x53')]=_0x535e27['id'];return db['Interval']['create'](_0x29e505[_0xbd8f('0x49')]);}})[_0xbd8f('0x20')](respondWithResult(_0x17aa34,null))['catch'](handleError(_0x17aa34,null));};exports[_0xbd8f('0x54')]=function(_0x1712cd,_0x3e2d48,_0x312840){var _0x63bba={};var _0x1c1a85={};var _0x149bbe;var _0x371a79;return db[_0xbd8f('0x29')][_0xbd8f('0x55')]({'where':{'id':_0x1712cd[_0xbd8f('0x43')]['id']}})[_0xbd8f('0x20')](handleEntityNotFound(_0x3e2d48,null))[_0xbd8f('0x20')](function(_0x1fd69c){if(_0x1fd69c){_0x149bbe=_0x1fd69c;_0x1c1a85[_0xbd8f('0x30')]=_[_0xbd8f('0x2e')](db[_0xbd8f('0x29')][_0xbd8f('0x44')]);_0x1c1a85[_0xbd8f('0x2d')]=_[_0xbd8f('0x2e')](_0x1712cd[_0xbd8f('0x2d')]);_0x1c1a85[_0xbd8f('0x38')]=_[_0xbd8f('0x2f')](_0x1c1a85[_0xbd8f('0x30')],_0x1c1a85[_0xbd8f('0x2d')]);_0x63bba[_0xbd8f('0x31')]=_[_0xbd8f('0x2f')](_0x1c1a85[_0xbd8f('0x30')],qs[_0xbd8f('0x32')](_0x1712cd[_0xbd8f('0x2d')]['fields']));_0x63bba[_0xbd8f('0x31')]=_0x63bba[_0xbd8f('0x31')]['length']?_0x63bba[_0xbd8f('0x31')]:_0x1c1a85[_0xbd8f('0x30')];_0x63bba[_0xbd8f('0x35')]=qs[_0xbd8f('0x36')](_0x1712cd['query'][_0xbd8f('0x36')]);_0x63bba[_0xbd8f('0x37')]=qs[_0xbd8f('0x38')](_[_0xbd8f('0x39')](_0x1712cd[_0xbd8f('0x2d')],_0x1c1a85[_0xbd8f('0x38')]));if(_0x1712cd[_0xbd8f('0x2d')][_0xbd8f('0x3c')]){_0x63bba[_0xbd8f('0x37')]=_[_0xbd8f('0x3a')](_0x63bba[_0xbd8f('0x37')],{'$or':_['map'](_0x63bba[_0xbd8f('0x31')],function(_0x29a572){var _0x35ec9c={};_0x35ec9c[_0x29a572]={'$like':'%'+_0x1712cd['query'][_0xbd8f('0x3c')]+'%'};return _0x35ec9c;})});}_0x63bba=_['merge']({},_0x63bba,_0x1712cd[_0xbd8f('0x3d')]);return _0x149bbe[_0xbd8f('0x54')](_0x63bba);}})[_0xbd8f('0x20')](function(_0xc0ccf1){if(_0xc0ccf1){_0x371a79=_0xc0ccf1['length'];if(!_0x1712cd['query'][_0xbd8f('0x56')]('nolimit')){_0x63bba[_0xbd8f('0x34')]=qs[_0xbd8f('0x34')](_0x1712cd[_0xbd8f('0x2d')][_0xbd8f('0x34')]);_0x63bba[_0xbd8f('0x19')]=qs['offset'](_0x1712cd[_0xbd8f('0x2d')]['offset']);}return _0x149bbe['getIntervals'](_0x63bba);}})[_0xbd8f('0x20')](function(_0x17e645){if(_0x17e645){return _0x17e645?{'count':_0x371a79,'rows':_0x17e645}:null;}})['then'](respondWithResult(_0x3e2d48,null))[_0xbd8f('0x47')](handleError(_0x3e2d48,null));};exports[_0xbd8f('0x57')]=function(_0x42d852,_0x525b89,_0x35da04){return db['Interval'][_0xbd8f('0x55')]({'where':{'id':_0x42d852[_0xbd8f('0x43')]['id']}})[_0xbd8f('0x20')](handleEntityNotFound(_0x525b89,null))[_0xbd8f('0x20')](function(_0xf5a7f0){if(_0xf5a7f0){return db['sequelize'][_0xbd8f('0x58')](function(_0xc6929){return db[_0xbd8f('0x29')][_0xbd8f('0x21')]({'where':{'IntervalId':_0x42d852['params']['id']},'transaction':_0xc6929})['then'](function(_0x2b4d67){var _0x543deb=_[_0xbd8f('0x28')](_0x42d852[_0xbd8f('0x49')],function(_0x21891e){delete _0x21891e['id'];_0x21891e[_0xbd8f('0x53')]=_0x42d852[_0xbd8f('0x43')]['id'];return _0x21891e;});return db[_0xbd8f('0x29')][_0xbd8f('0x59')](_0x543deb,{'transaction':_0xc6929});});})[_0xbd8f('0x20')](function(){return db['Interval'][_0xbd8f('0x40')]({'where':{'IntervalId':_0x42d852['params']['id']}});});}})[_0xbd8f('0x20')](respondWithResult(_0x525b89,null))[_0xbd8f('0x47')](handleError(_0x525b89,null));};
\ No newline at end of file
index 185947a..8a63b08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d23=['rimraf','../../config/environment','./interval.attributes','exports','define','Interval','rewrite','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x5d23,0x6f));var _0x35d2=function(_0x22decd,_0x316eeb){_0x22decd=_0x22decd-0x0;var _0x5b8cf6=_0x5d23[_0x22decd];return _0x5b8cf6;};'use strict';var _=require(_0x35d2('0x0'));var util=require('util');var logger=require(_0x35d2('0x1'))(_0x35d2('0x2'));var moment=require(_0x35d2('0x3'));var BPromise=require(_0x35d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35d2('0x5'));var rimraf=require(_0x35d2('0x6'));var config=require(_0x35d2('0x7'));var attributes=require(_0x35d2('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0x35d2('0x9')]=function(_0x4edb41,_0x35030a){return _0x4edb41[_0x35d2('0xa')](_0x35d2('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x273300,_0x4b8059){extensions['rewrite'](_0x4edb41,_0x273300);},'afterBulkCreate':function(_0x33258a,_0x224623,_0x5ab2e8){_0x5ab2e8();extensions['rewrite'](_0x4edb41,_0x33258a[0x0]);},'afterUpdate':function(_0x153761,_0x49a351){extensions[_0x35d2('0xc')](_0x4edb41,_0x153761);},'afterDestroy':function(_0x38a7ea,_0x33d38e){extensions['rewrite'](_0x4edb41,_0x38a7ea);}}});};
\ No newline at end of file
+var _0x1544=['rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','api','moment','bluebird','request-promise','path'];(function(_0x513795,_0x1de034){var _0xd484e=function(_0x4ead81){while(--_0x4ead81){_0x513795['push'](_0x513795['shift']());}};_0xd484e(++_0x1de034);}(_0x1544,0x6a));var _0x4154=function(_0x1dfef9,_0x2f9407){_0x1dfef9=_0x1dfef9-0x0;var _0x532254=_0x1544[_0x1dfef9];return _0x532254;};'use strict';var _=require(_0x4154('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4154('0x1'));var moment=require(_0x4154('0x2'));var BPromise=require(_0x4154('0x3'));var rp=require(_0x4154('0x4'));var fs=require('fs');var path=require(_0x4154('0x5'));var rimraf=require(_0x4154('0x6'));var config=require(_0x4154('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0x4154('0x8'));module[_0x4154('0x9')]=function(_0x1abc54,_0x48d079){return _0x1abc54[_0x4154('0xa')](_0x4154('0xb'),attributes,{'tableName':_0x4154('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e88ef,_0x1bcaae){extensions[_0x4154('0xd')](_0x1abc54,_0x4e88ef);},'afterBulkCreate':function(_0x52be72,_0x456a4f,_0x969e8d){_0x969e8d();extensions[_0x4154('0xd')](_0x1abc54,_0x52be72[0x0]);},'afterUpdate':function(_0x2dd7c1,_0x15ec87){extensions['rewrite'](_0x1abc54,_0x2dd7c1);},'afterDestroy':function(_0x50dbf0,_0x25320f){extensions[_0x4154('0xd')](_0x1abc54,_0x50dbf0);}}});};
\ No newline at end of file
index 8e534ab..1ab583d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
index b4db25d..97fd8c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0xb9c64,_0x117e2e){var _0x5a7b94=function(_0x30b47e){while(--_0x30b47e){_0xb9c64['push'](_0xb9c64['shift']());}};_0x5a7b94(++_0x117e2e);}(_0xdb28,0x106));var _0x8db2=function(_0x4e9691,_0x40b6f1){_0x4e9691=_0x4e9691-0x0;var _0x3ebb65=_0xdb28[_0x4e9691];return _0x3ebb65;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
+var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x2f7a8d,_0x2721e8){var _0x4bdb61=function(_0x17aaff){while(--_0x17aaff){_0x2f7a8d['push'](_0x2f7a8d['shift']());}};_0x4bdb61(++_0x2721e8);}(_0xadb5,0xad));var _0x5adb=function(_0x240373,_0x46ed8b){_0x240373=_0x240373-0x0;var _0x21a554=_0xadb5[_0x240373];return _0x21a554;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
index 423570b..6407080 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a45=['Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','POST','application/json','base64','request','utf8','end','statusCode','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','socket','remoteAddress','bluebird','../../config/logger','api','key','MOTGUI','Report','description','stringify','issuetype'];(function(_0x3d3590,_0x23bd12){var _0x1348ff=function(_0x26a61a){while(--_0x26a61a){_0x3d3590['push'](_0x3d3590['shift']());}};_0x1348ff(++_0x23bd12);}(_0x3a45,0x101));var _0x53a4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3a45[_0x4a9fb1];return _0x348672;};'use strict';var BPromise=require(_0x53a4('0x0'));var https=require('https');var logger=require(_0x53a4('0x1'))(_0x53a4('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x1c64c,_0x4bc463){var _0x17c7c0={'fields':{'project':{'key':_0x1c64c[_0x53a4('0x3')]||_0x53a4('0x4')},'summary':(_0x1c64c['summary']||_0x53a4('0x5'))+'\x20from\x20'+_0x1c64c['ip'],'description':_0x1c64c[_0x53a4('0x6')]||JSON[_0x53a4('0x7')](_0x1c64c),'issuetype':{'name':_0x1c64c[_0x53a4('0x8')]||_0x53a4('0x9')}}};_0x17c7c0[_0x53a4('0xa')]['customfield_11500']=_0x1c64c[_0x53a4('0xb')];_0x17c7c0[_0x53a4('0xa')][_0x53a4('0xc')]=_0x1c64c[_0x53a4('0xd')];_0x17c7c0['fields'][_0x53a4('0xe')]=_0x1c64c[_0x53a4('0xf')];_0x17c7c0[_0x53a4('0xa')][_0x53a4('0x10')]=_0x1c64c[_0x53a4('0x11')];_0x17c7c0[_0x53a4('0xa')]['customfield_11504']=_0x1c64c['reason'];_0x17c7c0['fields']['customfield_10102']=_0x1c64c['ip'];var _0x4fa812={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x53a4('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x53a4('0x13'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x53a4('0x14'))}};var _0x52f351=JSON[_0x53a4('0x7')](_0x17c7c0);var _0x24c4a4=https[_0x53a4('0x15')](_0x4fa812,function(_0x45889c){_0x45889c['setEncoding'](_0x53a4('0x16'));var _0x4be014='';_0x45889c['on']('data',function(_0xf67305){_0x4be014+=_0xf67305;});_0x45889c['on'](_0x53a4('0x17'),function(){if(_0x4bc463){return _0x4bc463['status'](_0x45889c[_0x53a4('0x18')])[_0x53a4('0x19')](JSON['parse'](_0x4be014));}});});_0x24c4a4['on'](_0x53a4('0x1a'),function(_0x567944){if(_0x4bc463){return _0x4bc463[_0x53a4('0x1b')](0x1f4)[_0x53a4('0x19')]({'errors':[{'message':_0x53a4('0x1c'),'type':_0x53a4('0x1d')}]});}});_0x24c4a4[_0x53a4('0x1e')](_0x52f351);_0x24c4a4[_0x53a4('0x17')]();}exports[_0x53a4('0x1f')]=openIssue;exports[_0x53a4('0x20')]=function(_0x58725a,_0x2e7eda){_0x58725a[_0x53a4('0x21')]['ip']=_0x58725a[_0x53a4('0x22')][_0x53a4('0x23')]||_0x58725a['connection']['remoteAddress']||_0x58725a[_0x53a4('0x24')][_0x53a4('0x25')]||_0x58725a['connection'][_0x53a4('0x24')][_0x53a4('0x25')];return openIssue(_0x58725a['body'],_0x2e7eda);};
\ No newline at end of file
+var _0x05b3=['customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','end','send','headers','connection','socket','remoteAddress','https','../../config/logger','support','key','MOTGUI','Report','\x20from\x20','stringify','Bug','fields','email','oldToken','customfield_11502','newToken','name'];(function(_0x1ba0c9,_0x422297){var _0x147c78=function(_0x250f09){while(--_0x250f09){_0x1ba0c9['push'](_0x1ba0c9['shift']());}};_0x147c78(++_0x422297);}(_0x05b3,0x177));var _0x305b=function(_0x361026,_0x2375e2){_0x361026=_0x361026-0x0;var _0x37028e=_0x05b3[_0x361026];return _0x37028e;};'use strict';var BPromise=require('bluebird');var https=require(_0x305b('0x0'));var logger=require(_0x305b('0x1'))('api');var USERNAME=_0x305b('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0xa7a6c7,_0xcb3f76){var _0x44bc6c={'fields':{'project':{'key':_0xa7a6c7[_0x305b('0x3')]||_0x305b('0x4')},'summary':(_0xa7a6c7['summary']||_0x305b('0x5'))+_0x305b('0x6')+_0xa7a6c7['ip'],'description':_0xa7a6c7['description']||JSON[_0x305b('0x7')](_0xa7a6c7),'issuetype':{'name':_0xa7a6c7['issuetype']||_0x305b('0x8')}}};_0x44bc6c[_0x305b('0x9')]['customfield_11500']=_0xa7a6c7[_0x305b('0xa')];_0x44bc6c['fields']['customfield_11501']=_0xa7a6c7[_0x305b('0xb')];_0x44bc6c['fields'][_0x305b('0xc')]=_0xa7a6c7[_0x305b('0xd')];_0x44bc6c[_0x305b('0x9')]['customfield_11503']=_0xa7a6c7[_0x305b('0xe')];_0x44bc6c[_0x305b('0x9')][_0x305b('0xf')]=_0xa7a6c7[_0x305b('0x10')];_0x44bc6c[_0x305b('0x9')][_0x305b('0x11')]=_0xa7a6c7['ip'];var _0x372e1f={'host':_0x305b('0x12'),'port':0x1bb,'path':_0x305b('0x13'),'method':_0x305b('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x305b('0x15'),'Authorization':_0x305b('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x305b('0x17')](_0x305b('0x18'))}};var _0x1d5516=JSON['stringify'](_0x44bc6c);var _0xa407b5=https['request'](_0x372e1f,function(_0x13368c){_0x13368c[_0x305b('0x19')](_0x305b('0x1a'));var _0x511b35='';_0x13368c['on'](_0x305b('0x1b'),function(_0x567dc3){_0x511b35+=_0x567dc3;});_0x13368c['on']('end',function(){if(_0xcb3f76){return _0xcb3f76[_0x305b('0x1c')](_0x13368c[_0x305b('0x1d')])[_0x305b('0x1e')](JSON['parse'](_0x511b35));}});});_0xa407b5['on']('error',function(_0x5c992b){if(_0xcb3f76){return _0xcb3f76[_0x305b('0x1c')](0x1f4)[_0x305b('0x1e')]({'errors':[{'message':_0x305b('0x1f'),'type':'api.jira'}]});}});_0xa407b5[_0x305b('0x20')](_0x1d5516);_0xa407b5[_0x305b('0x21')]();}exports['openIssue']=openIssue;exports[_0x305b('0x22')]=function(_0x1f8bf1,_0x422d0b){_0x1f8bf1['body']['ip']=_0x1f8bf1[_0x305b('0x23')]['x-forwarded-for']||_0x1f8bf1[_0x305b('0x24')]['remoteAddress']||_0x1f8bf1[_0x305b('0x25')]['remoteAddress']||_0x1f8bf1[_0x305b('0x24')]['socket'][_0x305b('0x26')];return openIssue(_0x1f8bf1['body'],_0x422d0b);};
\ No newline at end of file
index 98b1ab8..5c789f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get','describe','show','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3e49dd,_0xe8125f){var _0x5369b1=function(_0x388705){while(--_0x388705){_0x3e49dd['push'](_0x3e49dd['shift']());}};_0x5369b1(++_0xe8125f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0xbdb7[_0x186d17];return _0x5d4b89;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')]('/',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')](_0x7bdb('0x12'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0x14')]);module[_0x7bdb('0x15')]=router;
\ No newline at end of file
+var _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x17ba,0xab));var _0xa17b=function(_0x73ee05,_0x70bdc9){_0x73ee05=_0x73ee05-0x0;var _0x35b34f=_0x17ba[_0x73ee05];return _0x35b34f;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router;
\ No newline at end of file
index 5edd65d..95cadb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x1ec7db,_0x1ebf79){_0x1ec7db=_0x1ec7db-0x0;var _0x3cdf7b=_0x7a54[_0x1ec7db];return _0x3cdf7b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x1bae2c,_0x2c82ce){_0x1bae2c=_0x1bae2c-0x0;var _0x565b80=_0x7a54[_0x1bae2c];return _0x565b80;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index ee39311..aef1d64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f94=['JscriptyAnswerReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','filter','merge','options','include','findAll','rows','catch','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x4b470b,_0x421e8a){var _0x48225f=function(_0x28affb){while(--_0x28affb){_0x4b470b['push'](_0x4b470b['shift']());}};_0x48225f(++_0x421e8a);}(_0x7f94,0x65));var _0x47f9=function(_0x50612e,_0x9678a1){_0x50612e=_0x50612e-0x0;var _0x1fdf71=_0x7f94[_0x50612e];return _0x1fdf71;};'use strict';var emlformat=require(_0x47f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x47f9('0x1'));var jsonpatch=require(_0x47f9('0x2'));var rp=require(_0x47f9('0x3'));var moment=require(_0x47f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47f9('0x5'));var util=require(_0x47f9('0x6'));var path=require(_0x47f9('0x7'));var sox=require(_0x47f9('0x8'));var csv=require(_0x47f9('0x9'));var ejs=require(_0x47f9('0xa'));var fs=require('fs');var fs_extra=require(_0x47f9('0xb'));var _=require('lodash');var squel=require(_0x47f9('0xc'));var crypto=require(_0x47f9('0xd'));var jsforce=require(_0x47f9('0xe'));var deskjs=require(_0x47f9('0xf'));var toCsv=require(_0x47f9('0x9'));var querystring=require(_0x47f9('0x10'));var Papa=require(_0x47f9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47f9('0x12'));var logger=require(_0x47f9('0x13'))(_0x47f9('0x14'));var utils=require(_0x47f9('0x15'));var config=require(_0x47f9('0x16'));var licenseUtil=require(_0x47f9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a8bac,_0x1002f7){_0x1002f7=_0x1002f7||0xcc;return function(_0x49c33c){if(_0x49c33c){return _0x5a8bac['sendStatus'](_0x1002f7);}return _0x5a8bac['status'](_0x1002f7)[_0x47f9('0x18')]();};}function respondWithResult(_0x43e4db,_0x4d44dd){_0x4d44dd=_0x4d44dd||0xc8;return function(_0x166860){if(_0x166860){return _0x43e4db[_0x47f9('0x19')](_0x4d44dd)[_0x47f9('0x1a')](_0x166860);}};}function respondWithFilteredResult(_0x2a6444,_0x48cc81){return function(_0x3320d1){if(_0x3320d1){var _0x3703e1=typeof _0x48cc81[_0x47f9('0x1b')]===_0x47f9('0x1c')&&typeof _0x48cc81[_0x47f9('0x1d')]==='undefined';var _0x56775f=_0x3320d1['count'];var _0xd80474=_0x3703e1?0x0:_0x48cc81[_0x47f9('0x1b')];var _0x32bb57=_0x3703e1?_0x3320d1[_0x47f9('0x1e')]:_0x48cc81[_0x47f9('0x1b')]+_0x48cc81[_0x47f9('0x1d')];var _0x29700e;if(_0x32bb57>=_0x56775f){_0x32bb57=_0x56775f;_0x29700e=0xc8;}else{_0x29700e=0xce;}_0x2a6444[_0x47f9('0x19')](_0x29700e);return _0x2a6444[_0x47f9('0x1f')](_0x47f9('0x20'),_0xd80474+'-'+_0x32bb57+'/'+_0x56775f)[_0x47f9('0x1a')](_0x3320d1);}return null;};}function patchUpdates(_0x328d14){return function(_0x397dd5){try{jsonpatch['apply'](_0x397dd5,_0x328d14,!![]);}catch(_0x4d35bf){return BPromise[_0x47f9('0x21')](_0x4d35bf);}return _0x397dd5['save']();};}function saveUpdates(_0x2e2b69,_0x29b7f8){return function(_0x2ecf99){if(_0x2ecf99){return _0x2ecf99[_0x47f9('0x22')](_0x2e2b69)[_0x47f9('0x23')](function(_0x11ef91){return _0x11ef91;});}return null;};}function removeEntity(_0x6a49d,_0x3c4778){return function(_0x4fd2b1){if(_0x4fd2b1){return _0x4fd2b1[_0x47f9('0x24')]()[_0x47f9('0x23')](function(){_0x6a49d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26bd84,_0x4c16e0){return function(_0x76077d){if(!_0x76077d){_0x26bd84['sendStatus'](0x194);}return _0x76077d;};}function handleError(_0x26174a,_0x1a8c4b){_0x1a8c4b=_0x1a8c4b||0x1f4;return function(_0x5dbdda){logger[_0x47f9('0x25')](_0x5dbdda[_0x47f9('0x26')]);if(_0x5dbdda[_0x47f9('0x27')]){delete _0x5dbdda[_0x47f9('0x27')];}_0x26174a[_0x47f9('0x19')](_0x1a8c4b)[_0x47f9('0x28')](_0x5dbdda);};}exports[_0x47f9('0x29')]=function(_0x52927a,_0x53e951){var _0x4c37d2={},_0x481ccb={},_0x1a5b58={'count':0x0,'rows':[]};var _0x5818a6=_[_0x47f9('0x2a')](db[_0x47f9('0x2b')][_0x47f9('0x2c')],function(_0xaf0fea){return{'name':_0xaf0fea[_0x47f9('0x2d')],'type':_0xaf0fea[_0x47f9('0x2e')]['key']};});_0x481ccb['model']=_[_0x47f9('0x2a')](_0x5818a6,_0x47f9('0x27'));_0x481ccb['query']=_[_0x47f9('0x2f')](_0x52927a[_0x47f9('0x30')]);_0x481ccb[_0x47f9('0x31')]=_[_0x47f9('0x32')](_0x481ccb[_0x47f9('0x33')],_0x481ccb[_0x47f9('0x30')]);_0x4c37d2[_0x47f9('0x34')]=_[_0x47f9('0x32')](_0x481ccb[_0x47f9('0x33')],qs[_0x47f9('0x35')](_0x52927a[_0x47f9('0x30')][_0x47f9('0x35')]));_0x4c37d2[_0x47f9('0x34')]=_0x4c37d2['attributes'][_0x47f9('0x36')]?_0x4c37d2[_0x47f9('0x34')]:_0x481ccb['model'];if(!_0x52927a[_0x47f9('0x30')][_0x47f9('0x37')]('nolimit')){_0x4c37d2[_0x47f9('0x1d')]=qs['limit'](_0x52927a[_0x47f9('0x30')][_0x47f9('0x1d')]);_0x4c37d2[_0x47f9('0x1b')]=qs['offset'](_0x52927a[_0x47f9('0x30')][_0x47f9('0x1b')]);}_0x4c37d2[_0x47f9('0x38')]=qs[_0x47f9('0x39')](_0x52927a[_0x47f9('0x30')]['sort']);_0x4c37d2['where']=qs['filters'](_[_0x47f9('0x3a')](_0x52927a[_0x47f9('0x30')],_0x481ccb[_0x47f9('0x31')]),_0x5818a6);if(_0x52927a['query']['filter']){_0x4c37d2[_0x47f9('0x3b')]=_['merge'](_0x4c37d2[_0x47f9('0x3b')],{'$or':_['map'](_0x5818a6,function(_0x563492){if(_0x563492[_0x47f9('0x2e')]!=='VIRTUAL'){var _0xfe4480={};_0xfe4480[_0x563492[_0x47f9('0x27')]]={'$like':'%'+_0x52927a[_0x47f9('0x30')][_0x47f9('0x3c')]+'%'};return _0xfe4480;}})});}_0x4c37d2=_[_0x47f9('0x3d')]({},_0x4c37d2,_0x52927a[_0x47f9('0x3e')]);var _0x27ca33={'where':_0x4c37d2['where']};return db['JscriptyAnswerReport'][_0x47f9('0x1e')](_0x27ca33)[_0x47f9('0x23')](function(_0x118db1){_0x1a5b58[_0x47f9('0x1e')]=_0x118db1;if(_0x52927a[_0x47f9('0x30')]['includeAll']){_0x4c37d2[_0x47f9('0x3f')]=[{'all':!![]}];}return db[_0x47f9('0x2b')][_0x47f9('0x40')](_0x4c37d2);})[_0x47f9('0x23')](function(_0x3128bc){_0x1a5b58[_0x47f9('0x41')]=_0x3128bc;return _0x1a5b58;})[_0x47f9('0x23')](respondWithFilteredResult(_0x53e951,_0x4c37d2))[_0x47f9('0x42')](handleError(_0x53e951,null));};exports['show']=function(_0x311975,_0xc61254){var _0x55443d={'raw':!![],'where':{'id':_0x311975['params']['id']}},_0x587a7f={};_0x587a7f[_0x47f9('0x33')]=_[_0x47f9('0x2f')](db[_0x47f9('0x2b')][_0x47f9('0x2c')]);_0x587a7f[_0x47f9('0x30')]=_[_0x47f9('0x2f')](_0x311975[_0x47f9('0x30')]);_0x587a7f[_0x47f9('0x31')]=_[_0x47f9('0x32')](_0x587a7f[_0x47f9('0x33')],_0x587a7f['query']);_0x55443d['attributes']=_['intersection'](_0x587a7f[_0x47f9('0x33')],qs['fields'](_0x311975[_0x47f9('0x30')][_0x47f9('0x35')]));_0x55443d['attributes']=_0x55443d[_0x47f9('0x34')][_0x47f9('0x36')]?_0x55443d['attributes']:_0x587a7f[_0x47f9('0x33')];if(_0x311975[_0x47f9('0x30')]['includeAll']){_0x55443d[_0x47f9('0x3f')]=[{'all':!![]}];}_0x55443d=_[_0x47f9('0x3d')]({},_0x55443d,_0x311975[_0x47f9('0x3e')]);return db[_0x47f9('0x2b')][_0x47f9('0x43')](_0x55443d)[_0x47f9('0x23')](handleEntityNotFound(_0xc61254,null))[_0x47f9('0x23')](respondWithResult(_0xc61254,null))[_0x47f9('0x42')](handleError(_0xc61254,null));};exports[_0x47f9('0x44')]=function(_0x411695,_0x38d61d){return db[_0x47f9('0x2b')][_0x47f9('0x44')](_0x411695[_0x47f9('0x45')],{})[_0x47f9('0x23')](respondWithResult(_0x38d61d,0xc9))['catch'](handleError(_0x38d61d,null));};exports[_0x47f9('0x22')]=function(_0x1c6e21,_0x58fc09){if(_0x1c6e21[_0x47f9('0x45')]['id']){delete _0x1c6e21[_0x47f9('0x45')]['id'];}return db[_0x47f9('0x2b')]['find']({'where':{'id':_0x1c6e21['params']['id']}})[_0x47f9('0x23')](handleEntityNotFound(_0x58fc09,null))['then'](saveUpdates(_0x1c6e21[_0x47f9('0x45')],null))['then'](respondWithResult(_0x58fc09,null))['catch'](handleError(_0x58fc09,null));};exports[_0x47f9('0x24')]=function(_0x2bd2c7,_0x1b1029){return db[_0x47f9('0x2b')]['find']({'where':{'id':_0x2bd2c7[_0x47f9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b1029,null))['then'](removeEntity(_0x1b1029,null))[_0x47f9('0x42')](handleError(_0x1b1029,null));};exports[_0x47f9('0x47')]=function(_0x43eb5b,_0x3d796c){return db[_0x47f9('0x2b')][_0x47f9('0x47')]()['then'](respondWithResult(_0x3d796c,null))[_0x47f9('0x42')](handleError(_0x3d796c,null));};
\ No newline at end of file
+var _0x6c32=['offset','limit','undefined','count','set','apply','update','then','destroy','error','send','index','map','fieldName','type','name','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x1e1b8a,_0x37df03){var _0x390a6f=function(_0x1afb84){while(--_0x1afb84){_0x1e1b8a['push'](_0x1e1b8a['shift']());}};_0x390a6f(++_0x37df03);}(_0x6c32,0xb5));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x26c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26c3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26c3('0x2'));var moment=require('moment');var BPromise=require(_0x26c3('0x3'));var Mustache=require(_0x26c3('0x4'));var util=require('util');var path=require('path');var sox=require(_0x26c3('0x5'));var csv=require(_0x26c3('0x6'));var ejs=require(_0x26c3('0x7'));var fs=require('fs');var fs_extra=require(_0x26c3('0x8'));var _=require(_0x26c3('0x9'));var squel=require(_0x26c3('0xa'));var crypto=require(_0x26c3('0xb'));var jsforce=require(_0x26c3('0xc'));var deskjs=require(_0x26c3('0xd'));var toCsv=require(_0x26c3('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26c3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x26c3('0xf'));var as=require(_0x26c3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26c3('0x11'))(_0x26c3('0x12'));var utils=require(_0x26c3('0x13'));var config=require(_0x26c3('0x14'));var licenseUtil=require(_0x26c3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41a6c2,_0x3be1d4){_0x3be1d4=_0x3be1d4||0xcc;return function(_0x3e00f4){if(_0x3e00f4){return _0x41a6c2[_0x26c3('0x16')](_0x3be1d4);}return _0x41a6c2[_0x26c3('0x17')](_0x3be1d4)[_0x26c3('0x18')]();};}function respondWithResult(_0x1a8ea5,_0x278214){_0x278214=_0x278214||0xc8;return function(_0x5443cd){if(_0x5443cd){return _0x1a8ea5['status'](_0x278214)[_0x26c3('0x19')](_0x5443cd);}};}function respondWithFilteredResult(_0xd612e7,_0xd2f9a7){return function(_0x2e8f6b){if(_0x2e8f6b){var _0xad4e1e=typeof _0xd2f9a7[_0x26c3('0x1a')]==='undefined'&&typeof _0xd2f9a7[_0x26c3('0x1b')]===_0x26c3('0x1c');var _0x4db301=_0x2e8f6b[_0x26c3('0x1d')];var _0x4de336=_0xad4e1e?0x0:_0xd2f9a7[_0x26c3('0x1a')];var _0x570b03=_0xad4e1e?_0x2e8f6b[_0x26c3('0x1d')]:_0xd2f9a7[_0x26c3('0x1a')]+_0xd2f9a7[_0x26c3('0x1b')];var _0x26ae49;if(_0x570b03>=_0x4db301){_0x570b03=_0x4db301;_0x26ae49=0xc8;}else{_0x26ae49=0xce;}_0xd612e7['status'](_0x26ae49);return _0xd612e7[_0x26c3('0x1e')]('Content-Range',_0x4de336+'-'+_0x570b03+'/'+_0x4db301)[_0x26c3('0x19')](_0x2e8f6b);}return null;};}function patchUpdates(_0x48ea4a){return function(_0x1c77e6){try{jsonpatch[_0x26c3('0x1f')](_0x1c77e6,_0x48ea4a,!![]);}catch(_0x8819f2){return BPromise['reject'](_0x8819f2);}return _0x1c77e6['save']();};}function saveUpdates(_0x524ac1,_0x25f771){return function(_0xba4076){if(_0xba4076){return _0xba4076[_0x26c3('0x20')](_0x524ac1)[_0x26c3('0x21')](function(_0x3db905){return _0x3db905;});}return null;};}function removeEntity(_0x582b5e,_0x39c6fb){return function(_0x4a5220){if(_0x4a5220){return _0x4a5220[_0x26c3('0x22')]()[_0x26c3('0x21')](function(){_0x582b5e[_0x26c3('0x17')](0xcc)[_0x26c3('0x18')]();});}};}function handleEntityNotFound(_0x3aa515,_0x37373c){return function(_0xf8aee0){if(!_0xf8aee0){_0x3aa515[_0x26c3('0x16')](0x194);}return _0xf8aee0;};}function handleError(_0xd14177,_0x3ab3d6){_0x3ab3d6=_0x3ab3d6||0x1f4;return function(_0x15380c){logger[_0x26c3('0x23')](_0x15380c['stack']);if(_0x15380c['name']){delete _0x15380c['name'];}_0xd14177[_0x26c3('0x17')](_0x3ab3d6)[_0x26c3('0x24')](_0x15380c);};}exports[_0x26c3('0x25')]=function(_0xa1cf3d,_0x31d3f4){var _0x48f0dd={},_0x3aa957={},_0x3ef628={'count':0x0,'rows':[]};var _0x150d1c=_[_0x26c3('0x26')](db['JscriptyAnswerReport']['rawAttributes'],function(_0xc900d2){return{'name':_0xc900d2[_0x26c3('0x27')],'type':_0xc900d2[_0x26c3('0x28')]['key']};});_0x3aa957['model']=_[_0x26c3('0x26')](_0x150d1c,_0x26c3('0x29'));_0x3aa957[_0x26c3('0x2a')]=_['keys'](_0xa1cf3d[_0x26c3('0x2a')]);_0x3aa957['filters']=_[_0x26c3('0x2b')](_0x3aa957['model'],_0x3aa957[_0x26c3('0x2a')]);_0x48f0dd['attributes']=_['intersection'](_0x3aa957[_0x26c3('0x2c')],qs[_0x26c3('0x2d')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x2d')]));_0x48f0dd[_0x26c3('0x2e')]=_0x48f0dd[_0x26c3('0x2e')][_0x26c3('0x2f')]?_0x48f0dd['attributes']:_0x3aa957['model'];if(!_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x30')]('nolimit')){_0x48f0dd[_0x26c3('0x1b')]=qs[_0x26c3('0x1b')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x1b')]);_0x48f0dd['offset']=qs['offset'](_0xa1cf3d['query'][_0x26c3('0x1a')]);}_0x48f0dd[_0x26c3('0x31')]=qs[_0x26c3('0x32')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x32')]);_0x48f0dd[_0x26c3('0x33')]=qs[_0x26c3('0x34')](_[_0x26c3('0x35')](_0xa1cf3d[_0x26c3('0x2a')],_0x3aa957[_0x26c3('0x34')]),_0x150d1c);if(_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x36')]){_0x48f0dd[_0x26c3('0x33')]=_[_0x26c3('0x37')](_0x48f0dd[_0x26c3('0x33')],{'$or':_[_0x26c3('0x26')](_0x150d1c,function(_0x3de84e){if(_0x3de84e['type']!==_0x26c3('0x38')){var _0x304766={};_0x304766[_0x3de84e[_0x26c3('0x29')]]={'$like':'%'+_0xa1cf3d[_0x26c3('0x2a')]['filter']+'%'};return _0x304766;}})});}_0x48f0dd=_[_0x26c3('0x37')]({},_0x48f0dd,_0xa1cf3d[_0x26c3('0x39')]);var _0x36e291={'where':_0x48f0dd[_0x26c3('0x33')]};return db[_0x26c3('0x3a')][_0x26c3('0x1d')](_0x36e291)[_0x26c3('0x21')](function(_0x1f2a3d){_0x3ef628[_0x26c3('0x1d')]=_0x1f2a3d;if(_0xa1cf3d['query'][_0x26c3('0x3b')]){_0x48f0dd[_0x26c3('0x3c')]=[{'all':!![]}];}return db[_0x26c3('0x3a')][_0x26c3('0x3d')](_0x48f0dd);})[_0x26c3('0x21')](function(_0x5e5b7f){_0x3ef628[_0x26c3('0x3e')]=_0x5e5b7f;return _0x3ef628;})['then'](respondWithFilteredResult(_0x31d3f4,_0x48f0dd))[_0x26c3('0x3f')](handleError(_0x31d3f4,null));};exports['show']=function(_0x25f5ed,_0x2d69ac){var _0x26d8cf={'raw':!![],'where':{'id':_0x25f5ed[_0x26c3('0x40')]['id']}},_0x46f552={};_0x46f552[_0x26c3('0x2c')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x46f552[_0x26c3('0x2a')]=_['keys'](_0x25f5ed[_0x26c3('0x2a')]);_0x46f552['filters']=_[_0x26c3('0x2b')](_0x46f552[_0x26c3('0x2c')],_0x46f552[_0x26c3('0x2a')]);_0x26d8cf['attributes']=_[_0x26c3('0x2b')](_0x46f552['model'],qs[_0x26c3('0x2d')](_0x25f5ed[_0x26c3('0x2a')][_0x26c3('0x2d')]));_0x26d8cf[_0x26c3('0x2e')]=_0x26d8cf[_0x26c3('0x2e')][_0x26c3('0x2f')]?_0x26d8cf[_0x26c3('0x2e')]:_0x46f552[_0x26c3('0x2c')];if(_0x25f5ed[_0x26c3('0x2a')][_0x26c3('0x3b')]){_0x26d8cf[_0x26c3('0x3c')]=[{'all':!![]}];}_0x26d8cf=_[_0x26c3('0x37')]({},_0x26d8cf,_0x25f5ed[_0x26c3('0x39')]);return db[_0x26c3('0x3a')][_0x26c3('0x41')](_0x26d8cf)[_0x26c3('0x21')](handleEntityNotFound(_0x2d69ac,null))[_0x26c3('0x21')](respondWithResult(_0x2d69ac,null))[_0x26c3('0x3f')](handleError(_0x2d69ac,null));};exports[_0x26c3('0x42')]=function(_0x1bb4ac,_0x41ba28){return db[_0x26c3('0x3a')][_0x26c3('0x42')](_0x1bb4ac[_0x26c3('0x43')],{})[_0x26c3('0x21')](respondWithResult(_0x41ba28,0xc9))[_0x26c3('0x3f')](handleError(_0x41ba28,null));};exports[_0x26c3('0x20')]=function(_0x18349e,_0x22e31a){if(_0x18349e[_0x26c3('0x43')]['id']){delete _0x18349e[_0x26c3('0x43')]['id'];}return db[_0x26c3('0x3a')][_0x26c3('0x41')]({'where':{'id':_0x18349e['params']['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x22e31a,null))[_0x26c3('0x21')](saveUpdates(_0x18349e[_0x26c3('0x43')],null))['then'](respondWithResult(_0x22e31a,null))[_0x26c3('0x3f')](handleError(_0x22e31a,null));};exports[_0x26c3('0x22')]=function(_0x4262be,_0x6f844){return db['JscriptyAnswerReport'][_0x26c3('0x41')]({'where':{'id':_0x4262be[_0x26c3('0x40')]['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x6f844,null))[_0x26c3('0x21')](removeEntity(_0x6f844,null))[_0x26c3('0x3f')](handleError(_0x6f844,null));};exports[_0x26c3('0x44')]=function(_0x15a716,_0x4d6865){return db['JscriptyAnswerReport'][_0x26c3('0x44')]()[_0x26c3('0x21')](respondWithResult(_0x4d6865,null))['catch'](handleError(_0x4d6865,null));};
\ No newline at end of file
index db3796d..6b2f909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x817a=['JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./jscriptyAnswerReport.attributes'];(function(_0x5c2c4e,_0x13c251){var _0x734fff=function(_0x22dfed){while(--_0x22dfed){_0x5c2c4e['push'](_0x5c2c4e['shift']());}};_0x734fff(++_0x13c251);}(_0x817a,0x124));var _0xa817=function(_0x16d43b,_0x3b2885){_0x16d43b=_0x16d43b-0x0;var _0x167843=_0x817a[_0x16d43b];return _0x167843;};'use strict';var _=require(_0xa817('0x0'));var util=require('util');var logger=require(_0xa817('0x1'))(_0xa817('0x2'));var moment=require(_0xa817('0x3'));var BPromise=require(_0xa817('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa817('0x5'));var rimraf=require(_0xa817('0x6'));var config=require('../../config/environment');var attributes=require(_0xa817('0x7'));module['exports']=function(_0x215396,_0x4c973c){return _0x215396['define'](_0xa817('0x8'),attributes,{'tableName':_0xa817('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3b0=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xf3b0,0x1ae));var _0x0f3b=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0xf3b0[_0xf89c3];return _0x274fc8;};'use strict';var _=require(_0x0f3b('0x0'));var util=require('util');var logger=require(_0x0f3b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0f3b('0x2'));var rp=require(_0x0f3b('0x3'));var fs=require('fs');var path=require(_0x0f3b('0x4'));var rimraf=require(_0x0f3b('0x5'));var config=require(_0x0f3b('0x6'));var attributes=require(_0x0f3b('0x7'));module[_0x0f3b('0x8')]=function(_0x2e0aab,_0x27ce9b){return _0x2e0aab[_0x0f3b('0x9')](_0x0f3b('0xa'),attributes,{'tableName':_0x0f3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc94e50..e1e1e20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48df=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','info'];(function(_0x5e79e5,_0x15dd63){var _0x423f77=function(_0x157c97){while(--_0x157c97){_0x5e79e5['push'](_0x5e79e5['shift']());}};_0x423f77(++_0x15dd63);}(_0x48df,0xc2));var _0xf48d=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x48df[_0x4d35f3];return _0x382fea;};'use strict';var _=require(_0xf48d('0x0'));var util=require('util');var moment=require(_0xf48d('0x1'));var BPromise=require(_0xf48d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf48d('0x3'));var db=require(_0xf48d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf48d('0x5'))(_0xf48d('0x6'));var config=require('../../config/environment');var jayson=require(_0xf48d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e777d,_0x3c3b91,_0x4b0f2e){return new BPromise(function(_0x1e0125,_0x5c7328){return client[_0xf48d('0x8')](_0x5e777d,_0x4b0f2e)['then'](function(_0x422301){logger[_0xf48d('0x9')](_0xf48d('0xa'),_0x3c3b91,_0xf48d('0xb'));logger[_0xf48d('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3c3b91,'request\x20sent',JSON['stringify'](_0x422301));if(_0x422301[_0xf48d('0xd')]){if(_0x422301['error'][_0xf48d('0xe')]===0x1f4){logger['error'](_0xf48d('0xa'),_0x3c3b91,_0x422301[_0xf48d('0xd')][_0xf48d('0xf')]);return _0x5c7328(_0x422301[_0xf48d('0xd')]['message']);}logger[_0xf48d('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c3b91,_0x422301[_0xf48d('0xd')][_0xf48d('0xf')]);return _0x1e0125(_0x422301[_0xf48d('0xd')][_0xf48d('0xf')]);}else{logger[_0xf48d('0x9')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c3b91,'request\x20sent');_0x1e0125(_0x422301[_0xf48d('0x10')][_0xf48d('0xf')]);}})['catch'](function(_0x1332e3){logger[_0xf48d('0xd')](_0xf48d('0xa'),_0x3c3b91,_0x1332e3);_0x5c7328(_0x1332e3);});});}
\ No newline at end of file
+var _0xed69=['info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3a60e5,_0x175cdb){var _0x545998=function(_0x2ad4b7){while(--_0x2ad4b7){_0x3a60e5['push'](_0x3a60e5['shift']());}};_0x545998(++_0x175cdb);}(_0xed69,0x184));var _0x9ed6=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0xed69[_0x21d36e];return _0x4cc307;};'use strict';var _=require('lodash');var util=require(_0x9ed6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ed6('0x1'))['db'];var utils=require(_0x9ed6('0x2'));var logger=require(_0x9ed6('0x3'))(_0x9ed6('0x4'));var config=require(_0x9ed6('0x5'));var jayson=require(_0x9ed6('0x6'));var client=jayson[_0x9ed6('0x7')][_0x9ed6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8b16d5,_0x22a20b,_0xc2deb2){return new BPromise(function(_0x2aeb52,_0x2bf054){return client[_0x9ed6('0x9')](_0x8b16d5,_0xc2deb2)[_0x9ed6('0xa')](function(_0x18e881){logger[_0x9ed6('0xb')](_0x9ed6('0xc'),_0x22a20b,'request\x20sent');logger[_0x9ed6('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x22a20b,_0x9ed6('0xe'),JSON['stringify'](_0x18e881));if(_0x18e881[_0x9ed6('0xf')]){if(_0x18e881['error'][_0x9ed6('0x10')]===0x1f4){logger[_0x9ed6('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x22a20b,_0x18e881['error'][_0x9ed6('0x11')]);return _0x2bf054(_0x18e881['error'][_0x9ed6('0x11')]);}logger['error'](_0x9ed6('0xc'),_0x22a20b,_0x18e881[_0x9ed6('0xf')]['message']);return _0x2aeb52(_0x18e881[_0x9ed6('0xf')][_0x9ed6('0x11')]);}else{logger[_0x9ed6('0xb')](_0x9ed6('0xc'),_0x22a20b,_0x9ed6('0xe'));_0x2aeb52(_0x18e881[_0x9ed6('0x12')][_0x9ed6('0x11')]);}})['catch'](function(_0x4b4b17){logger[_0x9ed6('0xf')](_0x9ed6('0xc'),_0x22a20b,_0x4b4b17);_0x2bf054(_0x4b4b17);});});}
\ No newline at end of file
index 49c24cc..7091dd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f1a=['/:id/summary','30s','getSummary','post','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers'];(function(_0xd2ec03,_0x1e01c4){var _0x167ea2=function(_0x270c14){while(--_0x270c14){_0xd2ec03['push'](_0xd2ec03['shift']());}};_0x167ea2(++_0x1e01c4);}(_0x1f1a,0xb0));var _0xa1f1=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1f1a[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0xa1f1('0x0'));var path=require(_0xa1f1('0x1'));var timeout=require(_0xa1f1('0x2'));var express=require(_0xa1f1('0x3'));var router=express['Router']();var fs_extra=require(_0xa1f1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa1f1('0x5'));var controller=require(_0xa1f1('0x6'));router['get']('/',auth[_0xa1f1('0x7')](),controller[_0xa1f1('0x8')]);router[_0xa1f1('0x9')](_0xa1f1('0xa'),auth[_0xa1f1('0x7')](),controller[_0xa1f1('0xb')]);router[_0xa1f1('0x9')](_0xa1f1('0xc'),auth[_0xa1f1('0x7')](),controller[_0xa1f1('0xd')]);router['get'](_0xa1f1('0xe'),auth[_0xa1f1('0x7')](),controller[_0xa1f1('0xf')]);router['get'](_0xa1f1('0x10'),auth[_0xa1f1('0x7')](),timeout(_0xa1f1('0x11')),controller[_0xa1f1('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa1f1('0x13')]('/:id/clone',auth[_0xa1f1('0x7')](),controller['clone']);router[_0xa1f1('0x14')](_0xa1f1('0xa'),auth[_0xa1f1('0x7')](),controller['update']);router[_0xa1f1('0x15')](_0xa1f1('0xa'),auth['isAuthenticated'](),controller[_0xa1f1('0x16')]);module[_0xa1f1('0x17')]=router;
\ No newline at end of file
+var _0x4140=['../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','exports','multer','util','path','express'];(function(_0x304035,_0x599db6){var _0x1c78df=function(_0x5334ae){while(--_0x5334ae){_0x304035['push'](_0x304035['shift']());}};_0x1c78df(++_0x599db6);}(_0x4140,0x1f4));var _0x0414=function(_0x20edd4,_0x7c30f2){_0x20edd4=_0x20edd4-0x0;var _0xc4a1e4=_0x4140[_0x20edd4];return _0xc4a1e4;};'use strict';var multer=require(_0x0414('0x0'));var util=require(_0x0414('0x1'));var path=require(_0x0414('0x2'));var timeout=require('connect-timeout');var express=require(_0x0414('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0414('0x4'));var controller=require(_0x0414('0x5'));router[_0x0414('0x6')]('/',auth['isAuthenticated'](),controller[_0x0414('0x7')]);router[_0x0414('0x6')]('/:id',auth[_0x0414('0x8')](),controller['show']);router[_0x0414('0x6')](_0x0414('0x9'),auth['isAuthenticated'](),controller[_0x0414('0xa')]);router[_0x0414('0x6')](_0x0414('0xb'),auth[_0x0414('0x8')](),controller[_0x0414('0xc')]);router[_0x0414('0x6')](_0x0414('0xd'),auth[_0x0414('0x8')](),timeout(_0x0414('0xe')),controller[_0x0414('0xf')]);router[_0x0414('0x10')]('/',auth[_0x0414('0x8')](),controller[_0x0414('0x11')]);router[_0x0414('0x10')](_0x0414('0x12'),auth[_0x0414('0x8')](),controller[_0x0414('0x13')]);router[_0x0414('0x14')](_0x0414('0x15'),auth[_0x0414('0x8')](),controller[_0x0414('0x16')]);router['delete'](_0x0414('0x15'),auth[_0x0414('0x8')](),controller['destroy']);module[_0x0414('0x17')]=router;
\ No newline at end of file
index 5998d3c..9970873 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2145=['lodash','util','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','format','name','getDataValue','description','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2145,0xff));var _0x5214=function(_0x4055f5,_0x5b5311){_0x4055f5=_0x4055f5-0x0;var _0x49621c=_0x2145[_0x4055f5];return _0x49621c;};'use strict';var Sequelize=require(_0x5214('0x0'));var _=require(_0x5214('0x1'));var util=require(_0x5214('0x2'));module[_0x5214('0x3')]={'name':{'type':Sequelize[_0x5214('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x5214('0x4')]},'formData':{'type':Sequelize[_0x5214('0x5')](_0x5214('0x6')),'set':function(_0x2078a9){if(_[_0x5214('0x7')](_0x2078a9)){this[_0x5214('0x8')](_0x5214('0x9'),JSON[_0x5214('0xa')](_0x2078a9));}else if(_['isString'](_0x2078a9)){this[_0x5214('0x8')]('formData',_0x2078a9);}else{this[_0x5214('0x8')](_0x5214('0x9'),util[_0x5214('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x5214('0xc'))||'',this[_0x5214('0xd')](_0x5214('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5214('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5214('0xf')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6c87=['lodash','util','name','STRING','TEXT','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x6c87,0x10a));var _0x76c8=function(_0x1d0bdd,_0x52c6d1){_0x1d0bdd=_0x1d0bdd-0x0;var _0x205377=_0x6c87[_0x1d0bdd];return _0x205377;};'use strict';var Sequelize=require('sequelize');var _=require(_0x76c8('0x0'));var util=require(_0x76c8('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x76c8('0x2')},'description':{'type':Sequelize[_0x76c8('0x3')]},'formData':{'type':Sequelize[_0x76c8('0x4')](_0x76c8('0x5')),'set':function(_0x4ce191){if(_['isObjectLike'](_0x4ce191)){this[_0x76c8('0x6')](_0x76c8('0x7'),JSON[_0x76c8('0x8')](_0x4ce191));}else if(_[_0x76c8('0x9')](_0x4ce191)){this[_0x76c8('0x6')](_0x76c8('0x7'),_0x4ce191);}else{this[_0x76c8('0x6')]('formData',util[_0x76c8('0xa')](_0x76c8('0xb'),this[_0x76c8('0xc')](_0x76c8('0x2'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x76c8('0xd')],'defaultValue':![]}};
\ No newline at end of file
index 0b58e36..1ee59f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d6=['attributes','model','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','catch','params','fields','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','role','findOne','ProjectId','JscriptySessionReport','findAll','rows','getAnswers','JscriptyAnswerReport','nolimit','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','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','sendStatus','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','Content-Range','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','map','query','keys','intersection'];(function(_0x10e288,_0xa23d06){var _0x4634ab=function(_0x522bd0){while(--_0x522bd0){_0x10e288['push'](_0x10e288['shift']());}};_0x4634ab(++_0xa23d06);}(_0x30d6,0x1b0));var _0x630d=function(_0xe70f6c,_0x3b734d){_0xe70f6c=_0xe70f6c-0x0;var _0x29d959=_0x30d6[_0xe70f6c];return _0x29d959;};'use strict';var emlformat=require(_0x630d('0x0'));var rimraf=require(_0x630d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x630d('0x2'));var rp=require('request-promise');var moment=require(_0x630d('0x3'));var BPromise=require(_0x630d('0x4'));var Mustache=require(_0x630d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x630d('0x6'));var csv=require(_0x630d('0x7'));var ejs=require(_0x630d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x630d('0x9'));var squel=require(_0x630d('0xa'));var crypto=require(_0x630d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x630d('0x7'));var querystring=require(_0x630d('0xc'));var Papa=require(_0x630d('0xd'));var Redis=require(_0x630d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x630d('0xf'));var as=require(_0x630d('0x10'));var hardwareService=require(_0x630d('0x11'));var logger=require(_0x630d('0x12'))(_0x630d('0x13'));var utils=require(_0x630d('0x14'));var config=require(_0x630d('0x15'));var licenseUtil=require(_0x630d('0x16'));var db=require(_0x630d('0x17'))['db'];function respondWithStatusCode(_0x3c86ef,_0x4e67c4){_0x4e67c4=_0x4e67c4||0xcc;return function(_0x1f458a){if(_0x1f458a){return _0x3c86ef['sendStatus'](_0x4e67c4);}return _0x3c86ef[_0x630d('0x18')](_0x4e67c4)[_0x630d('0x19')]();};}function respondWithResult(_0x51808f,_0x23e4e4){_0x23e4e4=_0x23e4e4||0xc8;return function(_0x1cc36b){if(_0x1cc36b){return _0x51808f[_0x630d('0x18')](_0x23e4e4)[_0x630d('0x1a')](_0x1cc36b);}};}function respondWithFilteredResult(_0x1c3f36,_0x82d90){return function(_0x162263){if(_0x162263){var _0x156687=typeof _0x82d90['offset']===_0x630d('0x1b')&&typeof _0x82d90['limit']===_0x630d('0x1b');var _0x48d0af=_0x162263['count'];var _0x227d62=_0x156687?0x0:_0x82d90[_0x630d('0x1c')];var _0x57066b=_0x156687?_0x162263[_0x630d('0x1d')]:_0x82d90[_0x630d('0x1c')]+_0x82d90['limit'];var _0x3443b1;if(_0x57066b>=_0x48d0af){_0x57066b=_0x48d0af;_0x3443b1=0xc8;}else{_0x3443b1=0xce;}_0x1c3f36['status'](_0x3443b1);return _0x1c3f36['set'](_0x630d('0x1e'),_0x227d62+'-'+_0x57066b+'/'+_0x48d0af)['json'](_0x162263);}return null;};}function patchUpdates(_0x2d960f){return function(_0xa7c90e){try{jsonpatch['apply'](_0xa7c90e,_0x2d960f,!![]);}catch(_0x9d16e6){return BPromise[_0x630d('0x1f')](_0x9d16e6);}return _0xa7c90e[_0x630d('0x20')]();};}function saveUpdates(_0x52d152,_0x4f5334){return function(_0x4c27b2){if(_0x4c27b2){return _0x4c27b2[_0x630d('0x21')](_0x52d152)[_0x630d('0x22')](function(_0x324f51){return _0x324f51;});}return null;};}function removeEntity(_0x56743e,_0x1e178e){return function(_0x1bae23){if(_0x1bae23){return _0x1bae23[_0x630d('0x23')]()[_0x630d('0x22')](function(){var _0x5ae2a1=_0x1bae23[_0x630d('0x24')]({'plain':!![]});var _0x10fb6e=_0x630d('0x25');return db[_0x630d('0x26')][_0x630d('0x23')]({'where':{'type':_0x10fb6e,'resourceId':_0x5ae2a1['id']}})[_0x630d('0x22')](function(){return _0x1bae23;});})[_0x630d('0x22')](function(){_0x56743e['status'](0xcc)[_0x630d('0x19')]();});}};}function handleEntityNotFound(_0x5c5d36,_0xd198d5){return function(_0x5346da){if(!_0x5346da){_0x5c5d36['sendStatus'](0x194);}return _0x5346da;};}function handleError(_0x368a88,_0x274a40){_0x274a40=_0x274a40||0x1f4;return function(_0x3d62dd){logger['error'](_0x3d62dd[_0x630d('0x27')]);if(_0x3d62dd['name']){delete _0x3d62dd[_0x630d('0x28')];}_0x368a88[_0x630d('0x18')](_0x274a40)[_0x630d('0x29')](_0x3d62dd);};}exports[_0x630d('0x2a')]=function(_0x20fc93,_0x8db5c1){var _0x2a9269={},_0x2d6d26={},_0x357f46={'count':0x0,'rows':[]};var _0x33ad60=_['map'](db[_0x630d('0x2b')][_0x630d('0x2c')],function(_0x2120e8){return{'name':_0x2120e8[_0x630d('0x2d')],'type':_0x2120e8[_0x630d('0x2e')][_0x630d('0x2f')]};});_0x2d6d26['model']=_[_0x630d('0x30')](_0x33ad60,_0x630d('0x28'));_0x2d6d26[_0x630d('0x31')]=_[_0x630d('0x32')](_0x20fc93[_0x630d('0x31')]);_0x2d6d26['filters']=_[_0x630d('0x33')](_0x2d6d26['model'],_0x2d6d26[_0x630d('0x31')]);_0x2a9269[_0x630d('0x34')]=_[_0x630d('0x33')](_0x2d6d26[_0x630d('0x35')],qs['fields'](_0x20fc93[_0x630d('0x31')]['fields']));_0x2a9269[_0x630d('0x34')]=_0x2a9269[_0x630d('0x34')][_0x630d('0x36')]?_0x2a9269[_0x630d('0x34')]:_0x2d6d26['model'];if(!_0x20fc93[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x2a9269[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x20fc93[_0x630d('0x31')]['limit']);_0x2a9269[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x20fc93[_0x630d('0x31')]['offset']);}_0x2a9269[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x20fc93['query'][_0x630d('0x3a')]);_0x2a9269[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x20fc93[_0x630d('0x31')],_0x2d6d26[_0x630d('0x3c')]),_0x33ad60);if(_0x20fc93[_0x630d('0x31')][_0x630d('0x3e')]){_0x2a9269[_0x630d('0x3b')]=_['merge'](_0x2a9269[_0x630d('0x3b')],{'$or':_['map'](_0x33ad60,function(_0x13ed13){if(_0x13ed13[_0x630d('0x2e')]!==_0x630d('0x3f')){var _0x4a4f31={};_0x4a4f31[_0x13ed13[_0x630d('0x28')]]={'$like':'%'+_0x20fc93[_0x630d('0x31')][_0x630d('0x3e')]+'%'};return _0x4a4f31;}})});}_0x2a9269=_[_0x630d('0x40')]({},_0x2a9269,_0x20fc93['options']);var _0x25711={'where':_0x2a9269[_0x630d('0x3b')]};return db[_0x630d('0x2b')][_0x630d('0x1d')](_0x25711)[_0x630d('0x22')](function(_0x4402de){_0x357f46['count']=_0x4402de;if(_0x20fc93[_0x630d('0x31')][_0x630d('0x41')]){_0x2a9269['include']=[{'all':!![]}];}return db[_0x630d('0x2b')]['findAll'](_0x2a9269);})[_0x630d('0x22')](function(_0x4e4223){_0x357f46['rows']=_0x4e4223;return _0x357f46;})[_0x630d('0x22')](respondWithFilteredResult(_0x8db5c1,_0x2a9269))[_0x630d('0x42')](handleError(_0x8db5c1,null));};exports['show']=function(_0x319650,_0x400cb5){var _0x5b35a0={'raw':![],'where':{'id':_0x319650[_0x630d('0x43')]['id']}},_0x2d5580={};_0x2d5580[_0x630d('0x35')]=_['keys'](db[_0x630d('0x2b')][_0x630d('0x2c')]);_0x2d5580[_0x630d('0x31')]=_[_0x630d('0x32')](_0x319650['query']);_0x2d5580[_0x630d('0x3c')]=_['intersection'](_0x2d5580['model'],_0x2d5580[_0x630d('0x31')]);_0x5b35a0[_0x630d('0x34')]=_[_0x630d('0x33')](_0x2d5580[_0x630d('0x35')],qs[_0x630d('0x44')](_0x319650[_0x630d('0x31')][_0x630d('0x44')]));_0x5b35a0[_0x630d('0x34')]=_0x5b35a0['attributes']['length']?_0x5b35a0[_0x630d('0x34')]:_0x2d5580[_0x630d('0x35')];if(_0x319650[_0x630d('0x31')][_0x630d('0x41')]){_0x5b35a0[_0x630d('0x45')]=[{'all':!![]}];}_0x5b35a0=_['merge']({},_0x5b35a0,_0x319650[_0x630d('0x46')]);return db['JscriptyProject'][_0x630d('0x47')](_0x5b35a0)[_0x630d('0x22')](handleEntityNotFound(_0x400cb5,null))[_0x630d('0x22')](respondWithResult(_0x400cb5,null))[_0x630d('0x42')](handleError(_0x400cb5,null));};exports['create']=function(_0x2c81c6,_0x17d3fe){return db[_0x630d('0x2b')][_0x630d('0x48')](_0x2c81c6['body'],{})['then'](function(_0x522b8e){var _0x432716=_0x2c81c6[_0x630d('0x49')][_0x630d('0x24')]({'plain':!![]});if(!_0x432716)throw new Error(_0x630d('0x4a'));if(_0x432716['role']===_0x630d('0x49')){var _0x3a225a=_0x522b8e[_0x630d('0x24')]({'plain':!![]});var _0x4c84dc=_0x630d('0x25');return db[_0x630d('0x4b')]['find']({'where':{'name':_0x4c84dc,'userProfileId':_0x432716[_0x630d('0x4c')]},'raw':!![]})['then'](function(_0x1d25aa){if(_0x1d25aa&&_0x1d25aa[_0x630d('0x4d')]===0x0){return db[_0x630d('0x26')][_0x630d('0x48')]({'name':_0x3a225a[_0x630d('0x28')],'resourceId':_0x3a225a['id'],'type':_0x1d25aa[_0x630d('0x28')],'sectionId':_0x1d25aa['id']},{})['then'](function(){return _0x522b8e;});}else{return _0x522b8e;}})[_0x630d('0x42')](function(_0x4ce602){logger[_0x630d('0x4e')](_0x630d('0x4f'),_0x4ce602);throw _0x4ce602;});}return _0x522b8e;})[_0x630d('0x22')](respondWithResult(_0x17d3fe,0xc9))[_0x630d('0x42')](handleError(_0x17d3fe,null));};exports[_0x630d('0x50')]=function(_0x4bc6cb,_0x5cf1e9){var _0xab862b={'where':{'id':_0x4bc6cb[_0x630d('0x43')]['id']}},_0xacf4de={};_0xacf4de[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x2b')][_0x630d('0x2c')]);_0xab862b[_0x630d('0x34')]=_['intersection'](_0xacf4de[_0x630d('0x35')],qs[_0x630d('0x44')](_0x4bc6cb[_0x630d('0x31')][_0x630d('0x44')]));_0xab862b[_0x630d('0x34')]=_0xab862b[_0x630d('0x34')]['length']?_0xab862b[_0x630d('0x34')]:_0xacf4de['model'];if(_0x4bc6cb[_0x630d('0x31')][_0x630d('0x41')]){_0xab862b[_0x630d('0x45')]=[{'all':!![]}];}_0xab862b=_[_0x630d('0x40')]({},_0xab862b,_0x4bc6cb[_0x630d('0x46')]);return db['JscriptyProject'][_0x630d('0x47')](_0xab862b)[_0x630d('0x22')](handleEntityNotFound(_0x5cf1e9,null))[_0x630d('0x22')](function(_0x27307a){if(_0x27307a){var _0x234804=_0x27307a[_0x630d('0x24')]({'plain':!![]});_0x234804=qs['omit'](_0x234804,['id',_0x630d('0x51'),_0x630d('0x52')]);_0x4bc6cb[_0x630d('0x53')]=_['omit'](_0x4bc6cb[_0x630d('0x53')],['id','createdAt',_0x630d('0x52')]);return db[_0x630d('0x2b')][_0x630d('0x48')](_[_0x630d('0x40')](_0x234804,_0x4bc6cb[_0x630d('0x53')]),{'include':_0x4bc6cb[_0x630d('0x31')][_0x630d('0x41')]?[{'all':!![]}]:undefined})[_0x630d('0x22')](function(_0x518cbe){var _0x296851=_0x4bc6cb['user'][_0x630d('0x24')]({'plain':!![]});if(!_0x296851)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x296851[_0x630d('0x54')]==='user'){var _0x304a9a=_0x518cbe['get']({'plain':!![]});var _0x49c8d7=_0x630d('0x25');return db[_0x630d('0x4b')]['find']({'where':{'name':_0x49c8d7,'userProfileId':_0x296851['userProfileId']},'raw':!![]})['then'](function(_0x22c547){if(_0x22c547&&_0x22c547[_0x630d('0x4d')]===0x0){return db[_0x630d('0x26')]['create']({'name':_0x304a9a['name'],'resourceId':_0x304a9a['id'],'type':_0x22c547[_0x630d('0x28')],'sectionId':_0x22c547['id']},{})[_0x630d('0x22')](function(){return _0x518cbe;});}else{return _0x518cbe;}})[_0x630d('0x42')](function(_0x2cd222){logger[_0x630d('0x4e')](_0x630d('0x4f'),_0x2cd222);throw _0x2cd222;});}return _0x518cbe;});}})[_0x630d('0x22')](respondWithResult(_0x5cf1e9,0xc9))[_0x630d('0x42')](handleError(_0x5cf1e9,null));};exports['update']=function(_0x55f5cf,_0x4c6c25){if(_0x55f5cf[_0x630d('0x53')]['id']){delete _0x55f5cf[_0x630d('0x53')]['id'];}return db['JscriptyProject'][_0x630d('0x47')]({'where':{'id':_0x55f5cf['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x4c6c25,null))[_0x630d('0x22')](saveUpdates(_0x55f5cf[_0x630d('0x53')],null))[_0x630d('0x22')](respondWithResult(_0x4c6c25,null))[_0x630d('0x42')](handleError(_0x4c6c25,null));};exports[_0x630d('0x23')]=function(_0x114772,_0x3bad41){return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0x114772[_0x630d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3bad41,null))['then'](removeEntity(_0x3bad41,null))[_0x630d('0x42')](handleError(_0x3bad41,null));};exports['getSessions']=function(_0x104c4f,_0x40688a,_0x417f33){var _0x23e4ba={'raw':!![],'where':{}};var _0x57a7e9={};var _0xdf5bde={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x104c4f[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x40688a,null))[_0x630d('0x22')](function(_0x5588c1){if(_0x5588c1){_0x57a7e9['model']=_[_0x630d('0x32')](db['JscriptySessionReport'][_0x630d('0x2c')]);_0x57a7e9[_0x630d('0x31')]=_[_0x630d('0x32')](_0x104c4f[_0x630d('0x31')]);_0x57a7e9[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x57a7e9[_0x630d('0x35')],_0x57a7e9[_0x630d('0x31')]);_0x23e4ba[_0x630d('0x34')]=_['intersection'](_0x57a7e9['model'],qs[_0x630d('0x44')](_0x104c4f['query']['fields']));_0x23e4ba[_0x630d('0x34')]=_0x23e4ba['attributes']['length']?_0x23e4ba['attributes']:_0x57a7e9[_0x630d('0x35')];if(!_0x104c4f[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x23e4ba['limit']=qs[_0x630d('0x38')](_0x104c4f['query'][_0x630d('0x38')]);_0x23e4ba[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x104c4f[_0x630d('0x31')][_0x630d('0x1c')]);}_0x23e4ba['order']=qs[_0x630d('0x3a')](_0x104c4f[_0x630d('0x31')][_0x630d('0x3a')]);_0x23e4ba[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x104c4f[_0x630d('0x31')],_0x57a7e9['filters']));_0x23e4ba['where'][_0x630d('0x56')]=_0x5588c1['id'];if(_0x104c4f[_0x630d('0x31')]['filter']){_0x23e4ba[_0x630d('0x3b')]=_['merge'](_0x23e4ba[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x23e4ba[_0x630d('0x34')],function(_0x3aacfa){var _0x7dcfd2={};_0x7dcfd2[_0x3aacfa]={'$like':'%'+_0x104c4f[_0x630d('0x31')]['filter']+'%'};return _0x7dcfd2;})});}_0x23e4ba=_['merge']({},_0x23e4ba,_0x104c4f[_0x630d('0x46')]);return db[_0x630d('0x57')]['count']({'where':_0x23e4ba['where']})['then'](function(_0x58ef6f){_0xdf5bde[_0x630d('0x1d')]=_0x58ef6f;if(_0x104c4f[_0x630d('0x31')][_0x630d('0x41')]){_0x23e4ba['include']=[{'all':!![]}];}return db[_0x630d('0x57')][_0x630d('0x58')](_0x23e4ba);})[_0x630d('0x22')](function(_0x83e0fb){_0xdf5bde[_0x630d('0x59')]=_0x83e0fb;return _0xdf5bde;});}})['then'](respondWithFilteredResult(_0x40688a,_0x23e4ba))[_0x630d('0x42')](handleError(_0x40688a,null));};exports[_0x630d('0x5a')]=function(_0x1cfd6a,_0x7d9941,_0x31f39e){var _0x3f7aff={'raw':!![],'where':{}};var _0x5047a0={};var _0x30a9b4={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x1cfd6a[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x7d9941,null))['then'](function(_0x327aba){if(_0x327aba){_0x5047a0['model']=_[_0x630d('0x32')](db[_0x630d('0x5b')][_0x630d('0x2c')]);_0x5047a0[_0x630d('0x31')]=_[_0x630d('0x32')](_0x1cfd6a[_0x630d('0x31')]);_0x5047a0[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x5047a0[_0x630d('0x35')],_0x5047a0[_0x630d('0x31')]);_0x3f7aff[_0x630d('0x34')]=_[_0x630d('0x33')](_0x5047a0[_0x630d('0x35')],qs['fields'](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x44')]));_0x3f7aff[_0x630d('0x34')]=_0x3f7aff[_0x630d('0x34')]['length']?_0x3f7aff[_0x630d('0x34')]:_0x5047a0[_0x630d('0x35')];if(!_0x1cfd6a['query'][_0x630d('0x37')](_0x630d('0x5c'))){_0x3f7aff[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x38')]);_0x3f7aff[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x1c')]);}_0x3f7aff[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3a')]);_0x3f7aff[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x1cfd6a[_0x630d('0x31')],_0x5047a0[_0x630d('0x3c')]));_0x3f7aff[_0x630d('0x3b')]['ProjectId']=_0x327aba['id'];if(_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3e')]){_0x3f7aff[_0x630d('0x3b')]=_[_0x630d('0x40')](_0x3f7aff[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x3f7aff[_0x630d('0x34')],function(_0xcf5dc4){var _0x32e12d={};_0x32e12d[_0xcf5dc4]={'$like':'%'+_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3e')]+'%'};return _0x32e12d;})});}_0x3f7aff=_[_0x630d('0x40')]({},_0x3f7aff,_0x1cfd6a[_0x630d('0x46')]);return db['JscriptyAnswerReport'][_0x630d('0x1d')]({'where':_0x3f7aff[_0x630d('0x3b')]})[_0x630d('0x22')](function(_0x2bb5f5){_0x30a9b4[_0x630d('0x1d')]=_0x2bb5f5;if(_0x1cfd6a['query']['includeAll']){_0x3f7aff[_0x630d('0x45')]=[{'all':!![]}];}return db[_0x630d('0x5b')][_0x630d('0x58')](_0x3f7aff);})[_0x630d('0x22')](function(_0x347fd1){_0x30a9b4[_0x630d('0x59')]=_0x347fd1;return _0x30a9b4;});}})['then'](respondWithFilteredResult(_0x7d9941,_0x3f7aff))[_0x630d('0x42')](handleError(_0x7d9941,null));};function char(_0x3cd911){return'number'===typeof _0x3cd911?String[_0x630d('0x5d')]['apply'](null,arguments):_0x3cd911;}function needsEncapsulation(_0x36b585){return!!_0x36b585&&(_0x36b585[_0x630d('0x5e')]()[_0x630d('0x5f')](char(0xd))>=0x0||_0x36b585[_0x630d('0x5e')]()[_0x630d('0x5f')](char(0xa))>=0x0||_0x36b585['toString']()[_0x630d('0x5f')](char(0x2c))>=0x0||_0x36b585[_0x630d('0x5e')]()[_0x630d('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x4136e1){var _0x2c2ba0=char(0x22),_0x110581='\x5c'+char(0x22),_0x2a7d9f=_0x4136e1['toString']()[_0x630d('0x60')](new RegExp(_0x2c2ba0,'g'),_0x110581);return _0x2c2ba0+_0x2a7d9f+_0x2c2ba0;}exports[_0x630d('0x61')]=function(_0x331f26,_0x55a1aa,_0x547261){var _0x12cacc,_0x53576e;var _0x28be3f={'where':{'ProjectId':_0x331f26[_0x630d('0x43')]['id']}};if(_0x331f26[_0x630d('0x31')][_0x630d('0x62')]){_0x28be3f['where'][_0x630d('0x63')]=JSON[_0x630d('0x64')](_0x331f26[_0x630d('0x31')]['startTime']);}return db[_0x630d('0x57')][_0x630d('0x58')](_0x28be3f)[_0x630d('0x22')](handleEntityNotFound(_0x55a1aa,null))['then'](function(_0x4e2e8d){if(_0x4e2e8d){_0x12cacc=_0x4e2e8d;return db[_0x630d('0x65')][_0x630d('0x58')]({'where':{'SessionId':{'$in':_[_0x630d('0x30')](_0x12cacc,'id')},'ProjectId':_0x331f26[_0x630d('0x43')]['id']},'order':_0x630d('0x66')});}})[_0x630d('0x22')](handleEntityNotFound(_0x55a1aa,null))[_0x630d('0x22')](function(_0x1a47b7){if(_0x1a47b7){_0x53576e=_0x1a47b7;var _0x2500fe={};for(var _0x267bc3=0x0,_0x4661d3=_0x53576e[_0x630d('0x36')];_0x267bc3<_0x4661d3;_0x267bc3++){if(!_0x2500fe[_0x630d('0x37')](_0x53576e[_0x267bc3]['questionId'])){_0x2500fe[_0x53576e[_0x267bc3][_0x630d('0x67')]]=needsEncapsulation(_0x53576e[_0x267bc3][_0x630d('0x68')])?encapsulate(_0x53576e[_0x267bc3][_0x630d('0x68')]):_0x53576e[_0x267bc3][_0x630d('0x68')];}}var _0x553700=[],_0x1ecf9d={};for(var _0x41f4db=0x0,_0x2bd943=_0x12cacc[_0x630d('0x36')];_0x41f4db<_0x2bd943;_0x41f4db++){_0x1ecf9d={'ProjectId':_0x331f26[_0x630d('0x43')]['id'],'SessionId':_0x12cacc[_0x41f4db]['id'],'StartTime':moment(_0x12cacc[_0x41f4db][_0x630d('0x63')])[_0x630d('0x69')](_0x630d('0x6a'))};for(var _0x845ad0=0x0,_0x4bdfbe=_0x53576e[_0x630d('0x36')];_0x845ad0<_0x4bdfbe;_0x845ad0++){if(_0x53576e[_0x845ad0][_0x630d('0x6b')]==_0x12cacc[_0x41f4db]['id']&&_0x2500fe[_0x630d('0x37')](_0x53576e[_0x845ad0][_0x630d('0x67')])){_0x1ecf9d[_0x2500fe[_0x53576e[_0x845ad0][_0x630d('0x67')]]]=_0x53576e[_0x845ad0][_0x630d('0x6c')];}}for(var _0x4ba2e5 in _0x2500fe){if(!_0x1ecf9d[_0x630d('0x37')](_0x2500fe[_0x4ba2e5])){_0x1ecf9d[_0x2500fe[_0x4ba2e5]]=null;}}_0x553700[_0x630d('0x6d')](_0x1ecf9d);}return _0x553700;}})[_0x630d('0x22')](function(_0x3e8471){if(!_[_0x630d('0x6e')](_0x3e8471)){var _0x4806de=toCsv(_0x3e8471);var _0x144c0b=Date[_0x630d('0x6f')]();fs[_0x630d('0x70')](util['format'](_0x630d('0x71'),_0x331f26[_0x630d('0x43')]['id'],_0x144c0b),_0x4806de);_0x55a1aa[_0x630d('0x72')]('Content-disposition',_0x630d('0x73')+util['format'](_0x630d('0x74'),_0x331f26[_0x630d('0x43')]['id'],_0x144c0b));_0x55a1aa[_0x630d('0x72')](_0x630d('0x75'),_0x630d('0x76'));return _0x55a1aa[_0x630d('0x77')](util[_0x630d('0x69')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x331f26['params']['id'],_0x144c0b));}else{return _0x55a1aa[_0x630d('0x78')](0xcc);}})[_0x630d('0x42')](handleError(_0x55a1aa,null));};
\ No newline at end of file
+var _0x7382=['params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','rimraf','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','JscriptyProject','includeAll','include','findAll','rows','catch','show'];(function(_0x2ffa17,_0x35b3a8){var _0x3a783b=function(_0x16d13d){while(--_0x16d13d){_0x2ffa17['push'](_0x2ffa17['shift']());}};_0x3a783b(++_0x35b3a8);}(_0x7382,0x111));var _0x2738=function(_0x4664f9,_0x51d771){_0x4664f9=_0x4664f9-0x0;var _0x2021c4=_0x7382[_0x4664f9];return _0x2021c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2738('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2738('0x1'));var util=require(_0x2738('0x2'));var path=require(_0x2738('0x3'));var sox=require(_0x2738('0x4'));var csv=require(_0x2738('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2738('0x6'));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('0x5'));var querystring=require('querystring');var Papa=require(_0x2738('0xb'));var Redis=require(_0x2738('0xc'));var authService=require(_0x2738('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2738('0xe'));var hardwareService=require(_0x2738('0xf'));var logger=require(_0x2738('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2738('0x11'));var licenseUtil=require(_0x2738('0x12'));var db=require(_0x2738('0x13'))['db'];function respondWithStatusCode(_0x217902,_0x15dcde){_0x15dcde=_0x15dcde||0xcc;return function(_0x39214a){if(_0x39214a){return _0x217902[_0x2738('0x14')](_0x15dcde);}return _0x217902[_0x2738('0x15')](_0x15dcde)[_0x2738('0x16')]();};}function respondWithResult(_0x3ccb48,_0x384fd3){_0x384fd3=_0x384fd3||0xc8;return function(_0x5dfa58){if(_0x5dfa58){return _0x3ccb48[_0x2738('0x15')](_0x384fd3)[_0x2738('0x17')](_0x5dfa58);}};}function respondWithFilteredResult(_0x4fe443,_0x222f9e){return function(_0x4f3c03){if(_0x4f3c03){var _0xba2b73=typeof _0x222f9e['offset']===_0x2738('0x18')&&typeof _0x222f9e['limit']===_0x2738('0x18');var _0x6c3d05=_0x4f3c03[_0x2738('0x19')];var _0x3c6810=_0xba2b73?0x0:_0x222f9e[_0x2738('0x1a')];var _0x1e0f57=_0xba2b73?_0x4f3c03[_0x2738('0x19')]:_0x222f9e[_0x2738('0x1a')]+_0x222f9e['limit'];var _0x4407c1;if(_0x1e0f57>=_0x6c3d05){_0x1e0f57=_0x6c3d05;_0x4407c1=0xc8;}else{_0x4407c1=0xce;}_0x4fe443['status'](_0x4407c1);return _0x4fe443[_0x2738('0x1b')](_0x2738('0x1c'),_0x3c6810+'-'+_0x1e0f57+'/'+_0x6c3d05)['json'](_0x4f3c03);}return null;};}function patchUpdates(_0x5a1d61){return function(_0x1543b0){try{jsonpatch[_0x2738('0x1d')](_0x1543b0,_0x5a1d61,!![]);}catch(_0x234913){return BPromise[_0x2738('0x1e')](_0x234913);}return _0x1543b0[_0x2738('0x1f')]();};}function saveUpdates(_0x2cbd7a,_0x18e1d8){return function(_0x38ad0d){if(_0x38ad0d){return _0x38ad0d[_0x2738('0x20')](_0x2cbd7a)[_0x2738('0x21')](function(_0x2ea043){return _0x2ea043;});}return null;};}function removeEntity(_0x502fcb,_0x347d10){return function(_0x537c5f){if(_0x537c5f){return _0x537c5f['destroy']()[_0x2738('0x21')](function(){var _0x2d8c5b=_0x537c5f[_0x2738('0x22')]({'plain':!![]});var _0x25c6e0=_0x2738('0x23');return db[_0x2738('0x24')][_0x2738('0x25')]({'where':{'type':_0x25c6e0,'resourceId':_0x2d8c5b['id']}})[_0x2738('0x21')](function(){return _0x537c5f;});})['then'](function(){_0x502fcb[_0x2738('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x159183,_0x26fcd4){return function(_0x513fb5){if(!_0x513fb5){_0x159183[_0x2738('0x14')](0x194);}return _0x513fb5;};}function handleError(_0x1ec10b,_0x5f05b8){_0x5f05b8=_0x5f05b8||0x1f4;return function(_0x5e7be4){logger['error'](_0x5e7be4['stack']);if(_0x5e7be4[_0x2738('0x26')]){delete _0x5e7be4[_0x2738('0x26')];}_0x1ec10b[_0x2738('0x15')](_0x5f05b8)[_0x2738('0x27')](_0x5e7be4);};}exports[_0x2738('0x28')]=function(_0x2b317c,_0x53562a){var _0x351f46={},_0x57c313={},_0x1a7395={'count':0x0,'rows':[]};var _0x1bd1a0=_[_0x2738('0x29')](db['JscriptyProject'][_0x2738('0x2a')],function(_0x401024){return{'name':_0x401024[_0x2738('0x2b')],'type':_0x401024[_0x2738('0x2c')][_0x2738('0x2d')]};});_0x57c313['model']=_[_0x2738('0x29')](_0x1bd1a0,'name');_0x57c313['query']=_[_0x2738('0x2e')](_0x2b317c[_0x2738('0x2f')]);_0x57c313[_0x2738('0x30')]=_[_0x2738('0x31')](_0x57c313['model'],_0x57c313[_0x2738('0x2f')]);_0x351f46[_0x2738('0x32')]=_[_0x2738('0x31')](_0x57c313[_0x2738('0x33')],qs[_0x2738('0x34')](_0x2b317c['query']['fields']));_0x351f46[_0x2738('0x32')]=_0x351f46['attributes'][_0x2738('0x35')]?_0x351f46[_0x2738('0x32')]:_0x57c313[_0x2738('0x33')];if(!_0x2b317c[_0x2738('0x2f')][_0x2738('0x36')](_0x2738('0x37'))){_0x351f46[_0x2738('0x38')]=qs[_0x2738('0x38')](_0x2b317c[_0x2738('0x2f')][_0x2738('0x38')]);_0x351f46[_0x2738('0x1a')]=qs[_0x2738('0x1a')](_0x2b317c[_0x2738('0x2f')][_0x2738('0x1a')]);}_0x351f46[_0x2738('0x39')]=qs['sort'](_0x2b317c[_0x2738('0x2f')][_0x2738('0x3a')]);_0x351f46[_0x2738('0x3b')]=qs[_0x2738('0x30')](_[_0x2738('0x3c')](_0x2b317c[_0x2738('0x2f')],_0x57c313['filters']),_0x1bd1a0);if(_0x2b317c[_0x2738('0x2f')][_0x2738('0x3d')]){_0x351f46[_0x2738('0x3b')]=_['merge'](_0x351f46[_0x2738('0x3b')],{'$or':_[_0x2738('0x29')](_0x1bd1a0,function(_0x57ce79){if(_0x57ce79['type']!==_0x2738('0x3e')){var _0x4830aa={};_0x4830aa[_0x57ce79[_0x2738('0x26')]]={'$like':'%'+_0x2b317c[_0x2738('0x2f')][_0x2738('0x3d')]+'%'};return _0x4830aa;}})});}_0x351f46=_[_0x2738('0x3f')]({},_0x351f46,_0x2b317c[_0x2738('0x40')]);var _0x110daa={'where':_0x351f46[_0x2738('0x3b')]};return db[_0x2738('0x41')]['count'](_0x110daa)[_0x2738('0x21')](function(_0x243664){_0x1a7395[_0x2738('0x19')]=_0x243664;if(_0x2b317c[_0x2738('0x2f')][_0x2738('0x42')]){_0x351f46[_0x2738('0x43')]=[{'all':!![]}];}return db[_0x2738('0x41')][_0x2738('0x44')](_0x351f46);})[_0x2738('0x21')](function(_0x1ac73e){_0x1a7395[_0x2738('0x45')]=_0x1ac73e;return _0x1a7395;})[_0x2738('0x21')](respondWithFilteredResult(_0x53562a,_0x351f46))[_0x2738('0x46')](handleError(_0x53562a,null));};exports[_0x2738('0x47')]=function(_0x16fbe0,_0x9696b3){var _0x171dbd={'raw':![],'where':{'id':_0x16fbe0[_0x2738('0x48')]['id']}},_0x4e03a9={};_0x4e03a9['model']=_['keys'](db[_0x2738('0x41')][_0x2738('0x2a')]);_0x4e03a9['query']=_[_0x2738('0x2e')](_0x16fbe0[_0x2738('0x2f')]);_0x4e03a9[_0x2738('0x30')]=_[_0x2738('0x31')](_0x4e03a9[_0x2738('0x33')],_0x4e03a9['query']);_0x171dbd[_0x2738('0x32')]=_[_0x2738('0x31')](_0x4e03a9[_0x2738('0x33')],qs[_0x2738('0x34')](_0x16fbe0[_0x2738('0x2f')][_0x2738('0x34')]));_0x171dbd[_0x2738('0x32')]=_0x171dbd[_0x2738('0x32')][_0x2738('0x35')]?_0x171dbd[_0x2738('0x32')]:_0x4e03a9[_0x2738('0x33')];if(_0x16fbe0[_0x2738('0x2f')]['includeAll']){_0x171dbd['include']=[{'all':!![]}];}_0x171dbd=_['merge']({},_0x171dbd,_0x16fbe0[_0x2738('0x40')]);return db[_0x2738('0x41')][_0x2738('0x49')](_0x171dbd)[_0x2738('0x21')](handleEntityNotFound(_0x9696b3,null))[_0x2738('0x21')](respondWithResult(_0x9696b3,null))[_0x2738('0x46')](handleError(_0x9696b3,null));};exports[_0x2738('0x4a')]=function(_0x43ff7d,_0x5108bd){return db[_0x2738('0x41')][_0x2738('0x4a')](_0x43ff7d[_0x2738('0x4b')],{})[_0x2738('0x21')](function(_0x54e571){var _0x4b7634=_0x43ff7d[_0x2738('0x4c')][_0x2738('0x22')]({'plain':!![]});if(!_0x4b7634)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b7634[_0x2738('0x4d')]===_0x2738('0x4c')){var _0x3c5bcc=_0x54e571[_0x2738('0x22')]({'plain':!![]});var _0x41efba=_0x2738('0x23');return db[_0x2738('0x4e')]['find']({'where':{'name':_0x41efba,'userProfileId':_0x4b7634[_0x2738('0x4f')]},'raw':!![]})[_0x2738('0x21')](function(_0x2b47b7){if(_0x2b47b7&&_0x2b47b7[_0x2738('0x50')]===0x0){return db[_0x2738('0x24')]['create']({'name':_0x3c5bcc[_0x2738('0x26')],'resourceId':_0x3c5bcc['id'],'type':_0x2b47b7[_0x2738('0x26')],'sectionId':_0x2b47b7['id']},{})[_0x2738('0x21')](function(){return _0x54e571;});}else{return _0x54e571;}})[_0x2738('0x46')](function(_0x2eab76){logger[_0x2738('0x51')](_0x2738('0x52'),_0x2eab76);throw _0x2eab76;});}return _0x54e571;})[_0x2738('0x21')](respondWithResult(_0x5108bd,0xc9))[_0x2738('0x46')](handleError(_0x5108bd,null));};exports[_0x2738('0x53')]=function(_0x262a2c,_0x2276fe){var _0x32b616={'where':{'id':_0x262a2c[_0x2738('0x48')]['id']}},_0x4b9d54={};_0x4b9d54['model']=_[_0x2738('0x2e')](db[_0x2738('0x41')]['rawAttributes']);_0x32b616[_0x2738('0x32')]=_[_0x2738('0x31')](_0x4b9d54[_0x2738('0x33')],qs['fields'](_0x262a2c[_0x2738('0x2f')][_0x2738('0x34')]));_0x32b616['attributes']=_0x32b616[_0x2738('0x32')][_0x2738('0x35')]?_0x32b616[_0x2738('0x32')]:_0x4b9d54[_0x2738('0x33')];if(_0x262a2c[_0x2738('0x2f')][_0x2738('0x42')]){_0x32b616['include']=[{'all':!![]}];}_0x32b616=_[_0x2738('0x3f')]({},_0x32b616,_0x262a2c['options']);return db[_0x2738('0x41')][_0x2738('0x49')](_0x32b616)[_0x2738('0x21')](handleEntityNotFound(_0x2276fe,null))[_0x2738('0x21')](function(_0x83959d){if(_0x83959d){var _0x377e72=_0x83959d['get']({'plain':!![]});_0x377e72=qs[_0x2738('0x54')](_0x377e72,['id','createdAt','updatedAt']);_0x262a2c[_0x2738('0x4b')]=_[_0x2738('0x54')](_0x262a2c[_0x2738('0x4b')],['id',_0x2738('0x55'),_0x2738('0x56')]);return db[_0x2738('0x41')][_0x2738('0x4a')](_[_0x2738('0x3f')](_0x377e72,_0x262a2c['body']),{'include':_0x262a2c[_0x2738('0x2f')][_0x2738('0x42')]?[{'all':!![]}]:undefined})[_0x2738('0x21')](function(_0x508fc2){var _0x44cc3b=_0x262a2c[_0x2738('0x4c')][_0x2738('0x22')]({'plain':!![]});if(!_0x44cc3b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44cc3b[_0x2738('0x4d')]==='user'){var _0x3e66ae=_0x508fc2['get']({'plain':!![]});var _0x5487d6=_0x2738('0x23');return db[_0x2738('0x4e')][_0x2738('0x49')]({'where':{'name':_0x5487d6,'userProfileId':_0x44cc3b[_0x2738('0x4f')]},'raw':!![]})[_0x2738('0x21')](function(_0x269033){if(_0x269033&&_0x269033[_0x2738('0x50')]===0x0){return db[_0x2738('0x24')][_0x2738('0x4a')]({'name':_0x3e66ae['name'],'resourceId':_0x3e66ae['id'],'type':_0x269033[_0x2738('0x26')],'sectionId':_0x269033['id']},{})['then'](function(){return _0x508fc2;});}else{return _0x508fc2;}})[_0x2738('0x46')](function(_0x53b69d){logger[_0x2738('0x51')](_0x2738('0x52'),_0x53b69d);throw _0x53b69d;});}return _0x508fc2;});}})['then'](respondWithResult(_0x2276fe,0xc9))[_0x2738('0x46')](handleError(_0x2276fe,null));};exports[_0x2738('0x20')]=function(_0x4a1028,_0x54af46){if(_0x4a1028[_0x2738('0x4b')]['id']){delete _0x4a1028[_0x2738('0x4b')]['id'];}return db[_0x2738('0x41')]['find']({'where':{'id':_0x4a1028[_0x2738('0x48')]['id']}})[_0x2738('0x21')](handleEntityNotFound(_0x54af46,null))[_0x2738('0x21')](saveUpdates(_0x4a1028['body'],null))['then'](respondWithResult(_0x54af46,null))[_0x2738('0x46')](handleError(_0x54af46,null));};exports[_0x2738('0x25')]=function(_0x4d4dd1,_0x40b0c7){return db['JscriptyProject'][_0x2738('0x49')]({'where':{'id':_0x4d4dd1[_0x2738('0x48')]['id']}})[_0x2738('0x21')](handleEntityNotFound(_0x40b0c7,null))['then'](removeEntity(_0x40b0c7,null))['catch'](handleError(_0x40b0c7,null));};exports[_0x2738('0x57')]=function(_0x343506,_0x1395e6,_0xd7dedc){var _0x3db203={'raw':!![],'where':{}};var _0x11b034={};var _0x596d6a={'count':0x0,'rows':[]};return db[_0x2738('0x41')][_0x2738('0x58')]({'where':{'id':_0x343506[_0x2738('0x48')]['id']}})[_0x2738('0x21')](handleEntityNotFound(_0x1395e6,null))[_0x2738('0x21')](function(_0x94b464){if(_0x94b464){_0x11b034[_0x2738('0x33')]=_['keys'](db[_0x2738('0x59')][_0x2738('0x2a')]);_0x11b034[_0x2738('0x2f')]=_[_0x2738('0x2e')](_0x343506['query']);_0x11b034['filters']=_[_0x2738('0x31')](_0x11b034[_0x2738('0x33')],_0x11b034[_0x2738('0x2f')]);_0x3db203[_0x2738('0x32')]=_['intersection'](_0x11b034[_0x2738('0x33')],qs[_0x2738('0x34')](_0x343506[_0x2738('0x2f')]['fields']));_0x3db203[_0x2738('0x32')]=_0x3db203[_0x2738('0x32')][_0x2738('0x35')]?_0x3db203[_0x2738('0x32')]:_0x11b034[_0x2738('0x33')];if(!_0x343506[_0x2738('0x2f')][_0x2738('0x36')](_0x2738('0x37'))){_0x3db203[_0x2738('0x38')]=qs[_0x2738('0x38')](_0x343506[_0x2738('0x2f')][_0x2738('0x38')]);_0x3db203[_0x2738('0x1a')]=qs['offset'](_0x343506['query']['offset']);}_0x3db203['order']=qs[_0x2738('0x3a')](_0x343506[_0x2738('0x2f')]['sort']);_0x3db203[_0x2738('0x3b')]=qs[_0x2738('0x30')](_[_0x2738('0x3c')](_0x343506['query'],_0x11b034[_0x2738('0x30')]));_0x3db203[_0x2738('0x3b')][_0x2738('0x5a')]=_0x94b464['id'];if(_0x343506[_0x2738('0x2f')]['filter']){_0x3db203[_0x2738('0x3b')]=_['merge'](_0x3db203[_0x2738('0x3b')],{'$or':_[_0x2738('0x29')](_0x3db203[_0x2738('0x32')],function(_0x4d6588){var _0xe2b5f5={};_0xe2b5f5[_0x4d6588]={'$like':'%'+_0x343506[_0x2738('0x2f')][_0x2738('0x3d')]+'%'};return _0xe2b5f5;})});}_0x3db203=_[_0x2738('0x3f')]({},_0x3db203,_0x343506['options']);return db[_0x2738('0x59')][_0x2738('0x19')]({'where':_0x3db203[_0x2738('0x3b')]})['then'](function(_0x39ce3b){_0x596d6a['count']=_0x39ce3b;if(_0x343506[_0x2738('0x2f')]['includeAll']){_0x3db203[_0x2738('0x43')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2738('0x44')](_0x3db203);})[_0x2738('0x21')](function(_0x13f746){_0x596d6a[_0x2738('0x45')]=_0x13f746;return _0x596d6a;});}})[_0x2738('0x21')](respondWithFilteredResult(_0x1395e6,_0x3db203))[_0x2738('0x46')](handleError(_0x1395e6,null));};exports[_0x2738('0x5b')]=function(_0x5820f6,_0x3de720,_0x3a962f){var _0x50d848={'raw':!![],'where':{}};var _0x573434={};var _0xd330df={'count':0x0,'rows':[]};return db[_0x2738('0x41')][_0x2738('0x58')]({'where':{'id':_0x5820f6[_0x2738('0x48')]['id']}})[_0x2738('0x21')](handleEntityNotFound(_0x3de720,null))['then'](function(_0x30133e){if(_0x30133e){_0x573434[_0x2738('0x33')]=_['keys'](db['JscriptyAnswerReport'][_0x2738('0x2a')]);_0x573434[_0x2738('0x2f')]=_[_0x2738('0x2e')](_0x5820f6[_0x2738('0x2f')]);_0x573434[_0x2738('0x30')]=_[_0x2738('0x31')](_0x573434[_0x2738('0x33')],_0x573434['query']);_0x50d848[_0x2738('0x32')]=_[_0x2738('0x31')](_0x573434[_0x2738('0x33')],qs[_0x2738('0x34')](_0x5820f6[_0x2738('0x2f')][_0x2738('0x34')]));_0x50d848[_0x2738('0x32')]=_0x50d848[_0x2738('0x32')][_0x2738('0x35')]?_0x50d848[_0x2738('0x32')]:_0x573434[_0x2738('0x33')];if(!_0x5820f6[_0x2738('0x2f')]['hasOwnProperty'](_0x2738('0x37'))){_0x50d848[_0x2738('0x38')]=qs[_0x2738('0x38')](_0x5820f6[_0x2738('0x2f')][_0x2738('0x38')]);_0x50d848['offset']=qs[_0x2738('0x1a')](_0x5820f6[_0x2738('0x2f')][_0x2738('0x1a')]);}_0x50d848[_0x2738('0x39')]=qs['sort'](_0x5820f6[_0x2738('0x2f')][_0x2738('0x3a')]);_0x50d848[_0x2738('0x3b')]=qs['filters'](_[_0x2738('0x3c')](_0x5820f6[_0x2738('0x2f')],_0x573434[_0x2738('0x30')]));_0x50d848['where'][_0x2738('0x5a')]=_0x30133e['id'];if(_0x5820f6[_0x2738('0x2f')]['filter']){_0x50d848[_0x2738('0x3b')]=_[_0x2738('0x3f')](_0x50d848[_0x2738('0x3b')],{'$or':_[_0x2738('0x29')](_0x50d848[_0x2738('0x32')],function(_0x5d032e){var _0x2f0a35={};_0x2f0a35[_0x5d032e]={'$like':'%'+_0x5820f6[_0x2738('0x2f')]['filter']+'%'};return _0x2f0a35;})});}_0x50d848=_[_0x2738('0x3f')]({},_0x50d848,_0x5820f6[_0x2738('0x40')]);return db['JscriptyAnswerReport'][_0x2738('0x19')]({'where':_0x50d848[_0x2738('0x3b')]})[_0x2738('0x21')](function(_0x5741d5){_0xd330df[_0x2738('0x19')]=_0x5741d5;if(_0x5820f6[_0x2738('0x2f')][_0x2738('0x42')]){_0x50d848[_0x2738('0x43')]=[{'all':!![]}];}return db[_0x2738('0x5c')][_0x2738('0x44')](_0x50d848);})[_0x2738('0x21')](function(_0x11e689){_0xd330df['rows']=_0x11e689;return _0xd330df;});}})[_0x2738('0x21')](respondWithFilteredResult(_0x3de720,_0x50d848))['catch'](handleError(_0x3de720,null));};function char(_0x3c4bd5){return _0x2738('0x5d')===typeof _0x3c4bd5?String[_0x2738('0x5e')][_0x2738('0x1d')](null,arguments):_0x3c4bd5;}function needsEncapsulation(_0x536f60){return!!_0x536f60&&(_0x536f60[_0x2738('0x5f')]()[_0x2738('0x60')](char(0xd))>=0x0||_0x536f60[_0x2738('0x5f')]()[_0x2738('0x60')](char(0xa))>=0x0||_0x536f60[_0x2738('0x5f')]()[_0x2738('0x60')](char(0x2c))>=0x0||_0x536f60[_0x2738('0x5f')]()[_0x2738('0x60')](char(0x22))>=0x0);}function encapsulate(_0x4543b6){var _0x257a15=char(0x22),_0x4fa1f='\x5c'+char(0x22),_0x549f7a=_0x4543b6[_0x2738('0x5f')]()['replace'](new RegExp(_0x257a15,'g'),_0x4fa1f);return _0x257a15+_0x549f7a+_0x257a15;}exports[_0x2738('0x61')]=function(_0x61c4fd,_0x59c0ec,_0x3b2355){var _0x550579,_0x16992f;var _0x1321eb={'where':{'ProjectId':_0x61c4fd['params']['id']}};if(_0x61c4fd['query'][_0x2738('0x62')]){_0x1321eb[_0x2738('0x3b')][_0x2738('0x63')]=JSON['parse'](_0x61c4fd[_0x2738('0x2f')][_0x2738('0x62')]);}return db['JscriptySessionReport'][_0x2738('0x44')](_0x1321eb)[_0x2738('0x21')](handleEntityNotFound(_0x59c0ec,null))[_0x2738('0x21')](function(_0x10180e){if(_0x10180e){_0x550579=_0x10180e;return db['JscriptyQuestionReport'][_0x2738('0x44')]({'where':{'SessionId':{'$in':_[_0x2738('0x29')](_0x550579,'id')},'ProjectId':_0x61c4fd[_0x2738('0x48')]['id']},'order':'-createdAt'});}})[_0x2738('0x21')](handleEntityNotFound(_0x59c0ec,null))[_0x2738('0x21')](function(_0x5b558b){if(_0x5b558b){_0x16992f=_0x5b558b;var _0x15e0b8={};for(var _0x1dbab3=0x0,_0x34fab5=_0x16992f[_0x2738('0x35')];_0x1dbab3<_0x34fab5;_0x1dbab3++){if(!_0x15e0b8[_0x2738('0x36')](_0x16992f[_0x1dbab3][_0x2738('0x64')])){_0x15e0b8[_0x16992f[_0x1dbab3][_0x2738('0x64')]]=needsEncapsulation(_0x16992f[_0x1dbab3]['question'])?encapsulate(_0x16992f[_0x1dbab3]['question']):_0x16992f[_0x1dbab3][_0x2738('0x65')];}}var _0x2c4e17=[],_0x5c84ef={};for(var _0x3a6fdd=0x0,_0x4b729d=_0x550579['length'];_0x3a6fdd<_0x4b729d;_0x3a6fdd++){_0x5c84ef={'ProjectId':_0x61c4fd[_0x2738('0x48')]['id'],'SessionId':_0x550579[_0x3a6fdd]['id'],'StartTime':moment(_0x550579[_0x3a6fdd][_0x2738('0x63')])[_0x2738('0x66')](_0x2738('0x67'))};for(var _0x332ab9=0x0,_0xdb285b=_0x16992f[_0x2738('0x35')];_0x332ab9<_0xdb285b;_0x332ab9++){if(_0x16992f[_0x332ab9][_0x2738('0x68')]==_0x550579[_0x3a6fdd]['id']&&_0x15e0b8[_0x2738('0x36')](_0x16992f[_0x332ab9][_0x2738('0x64')])){_0x5c84ef[_0x15e0b8[_0x16992f[_0x332ab9][_0x2738('0x64')]]]=_0x16992f[_0x332ab9][_0x2738('0x69')];}}for(var _0x4b9553 in _0x15e0b8){if(!_0x5c84ef[_0x2738('0x36')](_0x15e0b8[_0x4b9553])){_0x5c84ef[_0x15e0b8[_0x4b9553]]=null;}}_0x2c4e17['push'](_0x5c84ef);}return _0x2c4e17;}})[_0x2738('0x21')](function(_0x287bd7){if(!_[_0x2738('0x6a')](_0x287bd7)){var _0x4fc400=toCsv(_0x287bd7);var _0x596108=Date['now']();fs[_0x2738('0x6b')](util[_0x2738('0x66')](_0x2738('0x6c'),_0x61c4fd['params']['id'],_0x596108),_0x4fc400);_0x59c0ec[_0x2738('0x6d')](_0x2738('0x6e'),_0x2738('0x6f')+util['format'](_0x2738('0x70'),_0x61c4fd[_0x2738('0x48')]['id'],_0x596108));_0x59c0ec[_0x2738('0x6d')](_0x2738('0x71'),_0x2738('0x72'));return _0x59c0ec['download'](util['format'](_0x2738('0x6c'),_0x61c4fd[_0x2738('0x48')]['id'],_0x596108));}else{return _0x59c0ec[_0x2738('0x14')](0xcc);}})[_0x2738('0x46')](handleError(_0x59c0ec,null));};
\ No newline at end of file
index 676031d..694b484 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f90=['rimraf','./jscriptyProject.attributes','exports','define','lodash','util','../../config/logger','api','moment','path'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x7f90,0xf4));var _0x07f9=function(_0x3f08c9,_0x557d0b){_0x3f08c9=_0x3f08c9-0x0;var _0x4c3250=_0x7f90[_0x3f08c9];return _0x4c3250;};'use strict';var _=require(_0x07f9('0x0'));var util=require(_0x07f9('0x1'));var logger=require(_0x07f9('0x2'))(_0x07f9('0x3'));var moment=require(_0x07f9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07f9('0x5'));var rimraf=require(_0x07f9('0x6'));var config=require('../../config/environment');var attributes=require(_0x07f9('0x7'));module[_0x07f9('0x8')]=function(_0x46f86e,_0x449544){return _0x46f86e[_0x07f9('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c88=['./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x9d39e9,_0x3aebc9){var _0x4ac75b=function(_0x25bb25){while(--_0x25bb25){_0x9d39e9['push'](_0x9d39e9['shift']());}};_0x4ac75b(++_0x3aebc9);}(_0x1c88,0x1a9));var _0x81c8=function(_0x1c461e,_0x1b98ff){_0x1c461e=_0x1c461e-0x0;var _0x1dce4f=_0x1c88[_0x1c461e];return _0x1dce4f;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var logger=require(_0x81c8('0x1'))(_0x81c8('0x2'));var moment=require(_0x81c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x81c8('0x4'));var rimraf=require(_0x81c8('0x5'));var config=require(_0x81c8('0x6'));var attributes=require(_0x81c8('0x7'));module[_0x81c8('0x8')]=function(_0x3e5721,_0x3f4e27){return _0x3e5721[_0x81c8('0x9')](_0x81c8('0xa'),attributes,{'tableName':_0x81c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1168d9e..4caeb2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xac4a,0x13f));var _0xaac4=function(_0x331959,_0x306e80){_0x331959=_0x331959-0x0;var _0x35f8d5=_0xac4a[_0x331959];return _0x35f8d5;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x48798b,_0x449bcb){var _0x3c581c=function(_0x481696){while(--_0x481696){_0x48798b['push'](_0x48798b['shift']());}};_0x3c581c(++_0x449bcb);}(_0xe706,0xa3));var _0x6e70=function(_0x159c68,_0xc544c9){_0x159c68=_0x159c68-0x0;var _0x32792f=_0xe706[_0x159c68];return _0x32792f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
index b839208..a9fb0c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ad=['/describe','/:id','show','post','create','put','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x34ef8e,_0x5a9507){var _0x339bf3=function(_0x33cd72){while(--_0x33cd72){_0x34ef8e['push'](_0x34ef8e['shift']());}};_0x339bf3(++_0x5a9507);}(_0xe2ad,0x138));var _0xde2a=function(_0x521ca2,_0xeddb59){_0x521ca2=_0x521ca2-0x0;var _0x4b278a=_0xe2ad[_0x521ca2];return _0x4b278a;};'use strict';var multer=require('multer');var util=require(_0xde2a('0x0'));var path=require(_0xde2a('0x1'));var timeout=require(_0xde2a('0x2'));var express=require(_0xde2a('0x3'));var router=express['Router']();var fs_extra=require(_0xde2a('0x4'));var auth=require(_0xde2a('0x5'));var interaction=require(_0xde2a('0x6'));var config=require(_0xde2a('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xde2a('0x8')]('/',auth[_0xde2a('0x9')](),controller[_0xde2a('0xa')]);router['get'](_0xde2a('0xb'),auth[_0xde2a('0x9')](),controller['describe']);router['get'](_0xde2a('0xc'),auth[_0xde2a('0x9')](),controller[_0xde2a('0xd')]);router[_0xde2a('0xe')]('/',auth[_0xde2a('0x9')](),controller[_0xde2a('0xf')]);router[_0xde2a('0x10')](_0xde2a('0xc'),auth['isAuthenticated'](),controller[_0xde2a('0x11')]);router[_0xde2a('0x12')]('/:id',auth[_0xde2a('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfc5f=['/describe','isAuthenticated','/:id','show','create','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get'];(function(_0x18209b,_0x524148){var _0x4c88b9=function(_0x225678){while(--_0x225678){_0x18209b['push'](_0x18209b['shift']());}};_0x4c88b9(++_0x524148);}(_0xfc5f,0x1ee));var _0xffc5=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xfc5f[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xffc5('0x0'));var timeout=require(_0xffc5('0x1'));var express=require(_0xffc5('0x2'));var router=express['Router']();var fs_extra=require(_0xffc5('0x3'));var auth=require(_0xffc5('0x4'));var interaction=require(_0xffc5('0x5'));var config=require(_0xffc5('0x6'));var controller=require(_0xffc5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xffc5('0x8')]);router[_0xffc5('0x9')](_0xffc5('0xa'),auth[_0xffc5('0xb')](),controller['describe']);router[_0xffc5('0x9')](_0xffc5('0xc'),auth['isAuthenticated'](),controller[_0xffc5('0xd')]);router['post']('/',auth[_0xffc5('0xb')](),controller[_0xffc5('0xe')]);router['put'](_0xffc5('0xc'),auth[_0xffc5('0xb')](),controller[_0xffc5('0xf')]);router['delete'](_0xffc5('0xc'),auth[_0xffc5('0xb')](),controller[_0xffc5('0x10')]);module[_0xffc5('0x11')]=router;
\ No newline at end of file
index d3359ba..1a48750 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7a54,0x106));var _0x47a5=function(_0x591bae,_0x3833d4){_0x591bae=_0x591bae-0x0;var _0x3271a5=_0x7a54[_0x591bae];return _0x3271a5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x5b1aea,_0x5abea5){_0x5b1aea=_0x5b1aea-0x0;var _0x26af4d=_0x7a54[_0x5b1aea];return _0x26af4d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 64ebda0..bc8afad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca1b=['end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','JscriptyQuestionReport','include','rows','show','params','length','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xca1b,0xc4));var _0xbca1=function(_0x420c35,_0x1abbd6){_0x420c35=_0x420c35-0x0;var _0x55c394=_0xca1b[_0x420c35];return _0x55c394;};'use strict';var emlformat=require(_0xbca1('0x0'));var rimraf=require(_0xbca1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbca1('0x2'));var rp=require('request-promise');var moment=require(_0xbca1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbca1('0x4'));var util=require(_0xbca1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xbca1('0x6'));var ejs=require(_0xbca1('0x7'));var fs=require('fs');var fs_extra=require(_0xbca1('0x8'));var _=require(_0xbca1('0x9'));var squel=require(_0xbca1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbca1('0xb'));var toCsv=require(_0xbca1('0x6'));var querystring=require(_0xbca1('0xc'));var Papa=require('papaparse');var Redis=require(_0xbca1('0xd'));var authService=require(_0xbca1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbca1('0xf'));var hardwareService=require(_0xbca1('0x10'));var logger=require('../../config/logger')(_0xbca1('0x11'));var utils=require('../../config/utils');var config=require(_0xbca1('0x12'));var licenseUtil=require(_0xbca1('0x13'));var db=require(_0xbca1('0x14'))['db'];function respondWithStatusCode(_0x5389a6,_0x2f3309){_0x2f3309=_0x2f3309||0xcc;return function(_0x2b44a9){if(_0x2b44a9){return _0x5389a6[_0xbca1('0x15')](_0x2f3309);}return _0x5389a6[_0xbca1('0x16')](_0x2f3309)[_0xbca1('0x17')]();};}function respondWithResult(_0x261fd3,_0xd9337){_0xd9337=_0xd9337||0xc8;return function(_0x65d7e4){if(_0x65d7e4){return _0x261fd3[_0xbca1('0x16')](_0xd9337)[_0xbca1('0x18')](_0x65d7e4);}};}function respondWithFilteredResult(_0x36f301,_0x497fb1){return function(_0x22a7ae){if(_0x22a7ae){var _0x42d167=typeof _0x497fb1[_0xbca1('0x19')]===_0xbca1('0x1a')&&typeof _0x497fb1[_0xbca1('0x1b')]===_0xbca1('0x1a');var _0xcb05d3=_0x22a7ae[_0xbca1('0x1c')];var _0x1b0fd6=_0x42d167?0x0:_0x497fb1[_0xbca1('0x19')];var _0x2d2f43=_0x42d167?_0x22a7ae['count']:_0x497fb1['offset']+_0x497fb1[_0xbca1('0x1b')];var _0x309e6c;if(_0x2d2f43>=_0xcb05d3){_0x2d2f43=_0xcb05d3;_0x309e6c=0xc8;}else{_0x309e6c=0xce;}_0x36f301[_0xbca1('0x16')](_0x309e6c);return _0x36f301[_0xbca1('0x1d')]('Content-Range',_0x1b0fd6+'-'+_0x2d2f43+'/'+_0xcb05d3)[_0xbca1('0x18')](_0x22a7ae);}return null;};}function patchUpdates(_0x48dfde){return function(_0x523dc6){try{jsonpatch[_0xbca1('0x1e')](_0x523dc6,_0x48dfde,!![]);}catch(_0x55e087){return BPromise[_0xbca1('0x1f')](_0x55e087);}return _0x523dc6[_0xbca1('0x20')]();};}function saveUpdates(_0x3dbfea,_0x3bcc49){return function(_0x4b9873){if(_0x4b9873){return _0x4b9873['update'](_0x3dbfea)[_0xbca1('0x21')](function(_0x1ce99c){return _0x1ce99c;});}return null;};}function removeEntity(_0x20a3e0,_0x360a18){return function(_0x328489){if(_0x328489){return _0x328489['destroy']()['then'](function(){_0x20a3e0[_0xbca1('0x16')](0xcc)[_0xbca1('0x17')]();});}};}function handleEntityNotFound(_0x24bc2e,_0x373e1c){return function(_0x110d39){if(!_0x110d39){_0x24bc2e[_0xbca1('0x15')](0x194);}return _0x110d39;};}function handleError(_0x1c6cc3,_0x147d81){_0x147d81=_0x147d81||0x1f4;return function(_0x205a95){logger[_0xbca1('0x22')](_0x205a95[_0xbca1('0x23')]);if(_0x205a95[_0xbca1('0x24')]){delete _0x205a95[_0xbca1('0x24')];}_0x1c6cc3[_0xbca1('0x16')](_0x147d81)[_0xbca1('0x25')](_0x205a95);};}exports[_0xbca1('0x26')]=function(_0x2d15cb,_0x743db0){var _0x1f6c16={},_0x4bd80a={},_0x587cb1={'count':0x0,'rows':[]};var _0x5dd459=_[_0xbca1('0x27')](db['JscriptyQuestionReport'][_0xbca1('0x28')],function(_0x5878d6){return{'name':_0x5878d6[_0xbca1('0x29')],'type':_0x5878d6[_0xbca1('0x2a')][_0xbca1('0x2b')]};});_0x4bd80a[_0xbca1('0x2c')]=_[_0xbca1('0x27')](_0x5dd459,_0xbca1('0x24'));_0x4bd80a[_0xbca1('0x2d')]=_[_0xbca1('0x2e')](_0x2d15cb['query']);_0x4bd80a['filters']=_['intersection'](_0x4bd80a[_0xbca1('0x2c')],_0x4bd80a[_0xbca1('0x2d')]);_0x1f6c16[_0xbca1('0x2f')]=_[_0xbca1('0x30')](_0x4bd80a['model'],qs[_0xbca1('0x31')](_0x2d15cb['query']['fields']));_0x1f6c16['attributes']=_0x1f6c16[_0xbca1('0x2f')]['length']?_0x1f6c16['attributes']:_0x4bd80a[_0xbca1('0x2c')];if(!_0x2d15cb['query'][_0xbca1('0x32')](_0xbca1('0x33'))){_0x1f6c16[_0xbca1('0x1b')]=qs[_0xbca1('0x1b')](_0x2d15cb[_0xbca1('0x2d')]['limit']);_0x1f6c16[_0xbca1('0x19')]=qs['offset'](_0x2d15cb['query'][_0xbca1('0x19')]);}_0x1f6c16[_0xbca1('0x34')]=qs[_0xbca1('0x35')](_0x2d15cb[_0xbca1('0x2d')][_0xbca1('0x35')]);_0x1f6c16[_0xbca1('0x36')]=qs[_0xbca1('0x37')](_[_0xbca1('0x38')](_0x2d15cb[_0xbca1('0x2d')],_0x4bd80a['filters']),_0x5dd459);if(_0x2d15cb['query'][_0xbca1('0x39')]){_0x1f6c16['where']=_['merge'](_0x1f6c16[_0xbca1('0x36')],{'$or':_[_0xbca1('0x27')](_0x5dd459,function(_0x4433b0){if(_0x4433b0[_0xbca1('0x2a')]!==_0xbca1('0x3a')){var _0x46476d={};_0x46476d[_0x4433b0[_0xbca1('0x24')]]={'$like':'%'+_0x2d15cb[_0xbca1('0x2d')]['filter']+'%'};return _0x46476d;}})});}_0x1f6c16=_[_0xbca1('0x3b')]({},_0x1f6c16,_0x2d15cb[_0xbca1('0x3c')]);var _0x4df8c2={'where':_0x1f6c16[_0xbca1('0x36')]};return db[_0xbca1('0x3d')][_0xbca1('0x1c')](_0x4df8c2)[_0xbca1('0x21')](function(_0x576d35){_0x587cb1['count']=_0x576d35;if(_0x2d15cb[_0xbca1('0x2d')]['includeAll']){_0x1f6c16[_0xbca1('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x1f6c16);})[_0xbca1('0x21')](function(_0x15c3bc){_0x587cb1[_0xbca1('0x3f')]=_0x15c3bc;return _0x587cb1;})[_0xbca1('0x21')](respondWithFilteredResult(_0x743db0,_0x1f6c16))['catch'](handleError(_0x743db0,null));};exports[_0xbca1('0x40')]=function(_0x5eb616,_0x3a4984){var _0x39f405={'raw':!![],'where':{'id':_0x5eb616[_0xbca1('0x41')]['id']}},_0x486a73={};_0x486a73[_0xbca1('0x2c')]=_[_0xbca1('0x2e')](db[_0xbca1('0x3d')][_0xbca1('0x28')]);_0x486a73[_0xbca1('0x2d')]=_[_0xbca1('0x2e')](_0x5eb616['query']);_0x486a73['filters']=_['intersection'](_0x486a73[_0xbca1('0x2c')],_0x486a73[_0xbca1('0x2d')]);_0x39f405[_0xbca1('0x2f')]=_[_0xbca1('0x30')](_0x486a73[_0xbca1('0x2c')],qs[_0xbca1('0x31')](_0x5eb616[_0xbca1('0x2d')]['fields']));_0x39f405['attributes']=_0x39f405['attributes'][_0xbca1('0x42')]?_0x39f405['attributes']:_0x486a73['model'];if(_0x5eb616[_0xbca1('0x2d')]['includeAll']){_0x39f405[_0xbca1('0x3e')]=[{'all':!![]}];}_0x39f405=_[_0xbca1('0x3b')]({},_0x39f405,_0x5eb616[_0xbca1('0x3c')]);return db[_0xbca1('0x3d')][_0xbca1('0x43')](_0x39f405)[_0xbca1('0x21')](handleEntityNotFound(_0x3a4984,null))[_0xbca1('0x21')](respondWithResult(_0x3a4984,null))[_0xbca1('0x44')](handleError(_0x3a4984,null));};exports[_0xbca1('0x45')]=function(_0x5e47d6,_0x437282){return db[_0xbca1('0x3d')][_0xbca1('0x45')](_0x5e47d6[_0xbca1('0x46')],{})['then'](respondWithResult(_0x437282,0xc9))[_0xbca1('0x44')](handleError(_0x437282,null));};exports[_0xbca1('0x47')]=function(_0x2579f9,_0x54067a){if(_0x2579f9['body']['id']){delete _0x2579f9['body']['id'];}return db['JscriptyQuestionReport'][_0xbca1('0x43')]({'where':{'id':_0x2579f9[_0xbca1('0x41')]['id']}})[_0xbca1('0x21')](handleEntityNotFound(_0x54067a,null))['then'](saveUpdates(_0x2579f9[_0xbca1('0x46')],null))[_0xbca1('0x21')](respondWithResult(_0x54067a,null))['catch'](handleError(_0x54067a,null));};exports['destroy']=function(_0x245339,_0x3aa648){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x245339['params']['id']}})[_0xbca1('0x21')](handleEntityNotFound(_0x3aa648,null))[_0xbca1('0x21')](removeEntity(_0x3aa648,null))['catch'](handleError(_0x3aa648,null));};exports[_0xbca1('0x48')]=function(_0x4082af,_0x415ea5){return db['JscriptyQuestionReport'][_0xbca1('0x48')]()[_0xbca1('0x21')](respondWithResult(_0x415ea5,null))['catch'](handleError(_0x415ea5,null));};
\ No newline at end of file
+var _0x6628=['sort','where','pick','filter','VIRTUAL','merge','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x3f1530,_0x1890bb){var _0x20949c=function(_0x20345c){while(--_0x20345c){_0x3f1530['push'](_0x3f1530['shift']());}};_0x20949c(++_0x1890bb);}(_0x6628,0x1a0));var _0x8662=function(_0x1029a2,_0x10538f){_0x1029a2=_0x1029a2-0x0;var _0xcbaa29=_0x6628[_0x1029a2];return _0xcbaa29;};'use strict';var emlformat=require(_0x8662('0x0'));var rimraf=require(_0x8662('0x1'));var zipdir=require(_0x8662('0x2'));var jsonpatch=require(_0x8662('0x3'));var rp=require('request-promise');var moment=require(_0x8662('0x4'));var BPromise=require(_0x8662('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8662('0x6'));var sox=require(_0x8662('0x7'));var csv=require(_0x8662('0x8'));var ejs=require(_0x8662('0x9'));var fs=require('fs');var fs_extra=require(_0x8662('0xa'));var _=require(_0x8662('0xb'));var squel=require(_0x8662('0xc'));var crypto=require(_0x8662('0xd'));var jsforce=require(_0x8662('0xe'));var deskjs=require(_0x8662('0xf'));var toCsv=require(_0x8662('0x8'));var querystring=require(_0x8662('0x10'));var Papa=require(_0x8662('0x11'));var Redis=require(_0x8662('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8662('0x13'));var as=require(_0x8662('0x14'));var hardwareService=require(_0x8662('0x15'));var logger=require(_0x8662('0x16'))('api');var utils=require(_0x8662('0x17'));var config=require(_0x8662('0x18'));var licenseUtil=require(_0x8662('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2efb79,_0x2fc1b0){_0x2fc1b0=_0x2fc1b0||0xcc;return function(_0x40812c){if(_0x40812c){return _0x2efb79[_0x8662('0x1a')](_0x2fc1b0);}return _0x2efb79[_0x8662('0x1b')](_0x2fc1b0)[_0x8662('0x1c')]();};}function respondWithResult(_0x133af3,_0xa22c75){_0xa22c75=_0xa22c75||0xc8;return function(_0x228722){if(_0x228722){return _0x133af3['status'](_0xa22c75)[_0x8662('0x1d')](_0x228722);}};}function respondWithFilteredResult(_0x371e63,_0x544d30){return function(_0x1e665f){if(_0x1e665f){var _0x26a307=typeof _0x544d30['offset']==='undefined'&&typeof _0x544d30[_0x8662('0x1e')]==='undefined';var _0x21e2a5=_0x1e665f[_0x8662('0x1f')];var _0x3ea0a9=_0x26a307?0x0:_0x544d30[_0x8662('0x20')];var _0x4d761f=_0x26a307?_0x1e665f['count']:_0x544d30[_0x8662('0x20')]+_0x544d30[_0x8662('0x1e')];var _0x137d39;if(_0x4d761f>=_0x21e2a5){_0x4d761f=_0x21e2a5;_0x137d39=0xc8;}else{_0x137d39=0xce;}_0x371e63[_0x8662('0x1b')](_0x137d39);return _0x371e63[_0x8662('0x21')](_0x8662('0x22'),_0x3ea0a9+'-'+_0x4d761f+'/'+_0x21e2a5)[_0x8662('0x1d')](_0x1e665f);}return null;};}function patchUpdates(_0x45a50e){return function(_0x1c7804){try{jsonpatch[_0x8662('0x23')](_0x1c7804,_0x45a50e,!![]);}catch(_0xb575cf){return BPromise[_0x8662('0x24')](_0xb575cf);}return _0x1c7804[_0x8662('0x25')]();};}function saveUpdates(_0x3723f5,_0x1938bb){return function(_0x2a0753){if(_0x2a0753){return _0x2a0753[_0x8662('0x26')](_0x3723f5)[_0x8662('0x27')](function(_0x1d8ab6){return _0x1d8ab6;});}return null;};}function removeEntity(_0x4b9730,_0x1c5bf8){return function(_0x3448f6){if(_0x3448f6){return _0x3448f6['destroy']()['then'](function(){_0x4b9730['status'](0xcc)[_0x8662('0x1c')]();});}};}function handleEntityNotFound(_0x1e9457,_0x52c33d){return function(_0x568a7c){if(!_0x568a7c){_0x1e9457[_0x8662('0x1a')](0x194);}return _0x568a7c;};}function handleError(_0x4da849,_0x50282e){_0x50282e=_0x50282e||0x1f4;return function(_0x14a6e5){logger['error'](_0x14a6e5[_0x8662('0x28')]);if(_0x14a6e5[_0x8662('0x29')]){delete _0x14a6e5[_0x8662('0x29')];}_0x4da849[_0x8662('0x1b')](_0x50282e)[_0x8662('0x2a')](_0x14a6e5);};}exports[_0x8662('0x2b')]=function(_0x58fa13,_0xab39bf){var _0x5ccf71={},_0x37d086={},_0x3c4dd3={'count':0x0,'rows':[]};var _0x1c375a=_[_0x8662('0x2c')](db['JscriptyQuestionReport'][_0x8662('0x2d')],function(_0x21de11){return{'name':_0x21de11[_0x8662('0x2e')],'type':_0x21de11[_0x8662('0x2f')]['key']};});_0x37d086[_0x8662('0x30')]=_[_0x8662('0x2c')](_0x1c375a,'name');_0x37d086[_0x8662('0x31')]=_[_0x8662('0x32')](_0x58fa13[_0x8662('0x31')]);_0x37d086[_0x8662('0x33')]=_[_0x8662('0x34')](_0x37d086[_0x8662('0x30')],_0x37d086['query']);_0x5ccf71[_0x8662('0x35')]=_[_0x8662('0x34')](_0x37d086[_0x8662('0x30')],qs[_0x8662('0x36')](_0x58fa13[_0x8662('0x31')][_0x8662('0x36')]));_0x5ccf71[_0x8662('0x35')]=_0x5ccf71[_0x8662('0x35')]['length']?_0x5ccf71['attributes']:_0x37d086[_0x8662('0x30')];if(!_0x58fa13[_0x8662('0x31')][_0x8662('0x37')](_0x8662('0x38'))){_0x5ccf71[_0x8662('0x1e')]=qs['limit'](_0x58fa13[_0x8662('0x31')]['limit']);_0x5ccf71[_0x8662('0x20')]=qs[_0x8662('0x20')](_0x58fa13[_0x8662('0x31')][_0x8662('0x20')]);}_0x5ccf71[_0x8662('0x39')]=qs[_0x8662('0x3a')](_0x58fa13['query'][_0x8662('0x3a')]);_0x5ccf71[_0x8662('0x3b')]=qs['filters'](_[_0x8662('0x3c')](_0x58fa13[_0x8662('0x31')],_0x37d086[_0x8662('0x33')]),_0x1c375a);if(_0x58fa13[_0x8662('0x31')][_0x8662('0x3d')]){_0x5ccf71[_0x8662('0x3b')]=_['merge'](_0x5ccf71[_0x8662('0x3b')],{'$or':_['map'](_0x1c375a,function(_0x58814e){if(_0x58814e['type']!==_0x8662('0x3e')){var _0x3785b7={};_0x3785b7[_0x58814e[_0x8662('0x29')]]={'$like':'%'+_0x58fa13['query'][_0x8662('0x3d')]+'%'};return _0x3785b7;}})});}_0x5ccf71=_[_0x8662('0x3f')]({},_0x5ccf71,_0x58fa13[_0x8662('0x40')]);var _0xb41e3c={'where':_0x5ccf71[_0x8662('0x3b')]};return db[_0x8662('0x41')][_0x8662('0x1f')](_0xb41e3c)[_0x8662('0x27')](function(_0x1f65a0){_0x3c4dd3[_0x8662('0x1f')]=_0x1f65a0;if(_0x58fa13['query'][_0x8662('0x42')]){_0x5ccf71[_0x8662('0x43')]=[{'all':!![]}];}return db[_0x8662('0x41')][_0x8662('0x44')](_0x5ccf71);})[_0x8662('0x27')](function(_0x321ce9){_0x3c4dd3[_0x8662('0x45')]=_0x321ce9;return _0x3c4dd3;})[_0x8662('0x27')](respondWithFilteredResult(_0xab39bf,_0x5ccf71))[_0x8662('0x46')](handleError(_0xab39bf,null));};exports[_0x8662('0x47')]=function(_0x33eaa,_0x186ce3){var _0x53ceaf={'raw':!![],'where':{'id':_0x33eaa[_0x8662('0x48')]['id']}},_0x1d2394={};_0x1d2394['model']=_[_0x8662('0x32')](db['JscriptyQuestionReport'][_0x8662('0x2d')]);_0x1d2394['query']=_['keys'](_0x33eaa['query']);_0x1d2394[_0x8662('0x33')]=_[_0x8662('0x34')](_0x1d2394[_0x8662('0x30')],_0x1d2394[_0x8662('0x31')]);_0x53ceaf[_0x8662('0x35')]=_[_0x8662('0x34')](_0x1d2394[_0x8662('0x30')],qs['fields'](_0x33eaa[_0x8662('0x31')]['fields']));_0x53ceaf['attributes']=_0x53ceaf[_0x8662('0x35')][_0x8662('0x49')]?_0x53ceaf[_0x8662('0x35')]:_0x1d2394[_0x8662('0x30')];if(_0x33eaa[_0x8662('0x31')][_0x8662('0x42')]){_0x53ceaf[_0x8662('0x43')]=[{'all':!![]}];}_0x53ceaf=_[_0x8662('0x3f')]({},_0x53ceaf,_0x33eaa[_0x8662('0x40')]);return db[_0x8662('0x41')]['find'](_0x53ceaf)['then'](handleEntityNotFound(_0x186ce3,null))['then'](respondWithResult(_0x186ce3,null))[_0x8662('0x46')](handleError(_0x186ce3,null));};exports['create']=function(_0xda7566,_0x210f1a){return db[_0x8662('0x41')][_0x8662('0x4a')](_0xda7566[_0x8662('0x4b')],{})['then'](respondWithResult(_0x210f1a,0xc9))[_0x8662('0x46')](handleError(_0x210f1a,null));};exports[_0x8662('0x26')]=function(_0x224486,_0x3a2c9a){if(_0x224486[_0x8662('0x4b')]['id']){delete _0x224486[_0x8662('0x4b')]['id'];}return db[_0x8662('0x41')][_0x8662('0x4c')]({'where':{'id':_0x224486['params']['id']}})[_0x8662('0x27')](handleEntityNotFound(_0x3a2c9a,null))[_0x8662('0x27')](saveUpdates(_0x224486['body'],null))[_0x8662('0x27')](respondWithResult(_0x3a2c9a,null))[_0x8662('0x46')](handleError(_0x3a2c9a,null));};exports[_0x8662('0x4d')]=function(_0x1cdd93,_0x6c615){return db[_0x8662('0x41')][_0x8662('0x4c')]({'where':{'id':_0x1cdd93[_0x8662('0x48')]['id']}})[_0x8662('0x27')](handleEntityNotFound(_0x6c615,null))[_0x8662('0x27')](removeEntity(_0x6c615,null))['catch'](handleError(_0x6c615,null));};exports['describe']=function(_0x5f31da,_0x4198fb){return db[_0x8662('0x41')][_0x8662('0x4e')]()[_0x8662('0x27')](respondWithResult(_0x4198fb,null))[_0x8662('0x46')](handleError(_0x4198fb,null));};
\ No newline at end of file
index c7f4ac5..d21f0e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52f0=['util','api','moment','bluebird','request-promise','path','../../config/environment','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x273fad,_0x349382){var _0x513edb=function(_0x55cef7){while(--_0x55cef7){_0x273fad['push'](_0x273fad['shift']());}};_0x513edb(++_0x349382);}(_0x52f0,0x10e));var _0x052f=function(_0x22d53d,_0x339808){_0x22d53d=_0x22d53d-0x0;var _0x40dd91=_0x52f0[_0x22d53d];return _0x40dd91;};'use strict';var _=require('lodash');var util=require(_0x052f('0x0'));var logger=require('../../config/logger')(_0x052f('0x1'));var moment=require(_0x052f('0x2'));var BPromise=require(_0x052f('0x3'));var rp=require(_0x052f('0x4'));var fs=require('fs');var path=require(_0x052f('0x5'));var rimraf=require('rimraf');var config=require(_0x052f('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x33a39a,_0x427ec2){return _0x33a39a[_0x052f('0x7')](_0x052f('0x8'),attributes,{'tableName':_0x052f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe034=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util'];(function(_0x2a24f1,_0x1ce780){var _0x41ad0=function(_0x5c4492){while(--_0x5c4492){_0x2a24f1['push'](_0x2a24f1['shift']());}};_0x41ad0(++_0x1ce780);}(_0xe034,0xe2));var _0x4e03=function(_0x16c66b,_0x3b5420){_0x16c66b=_0x16c66b-0x0;var _0xa73f8c=_0xe034[_0x16c66b];return _0xa73f8c;};'use strict';var _=require(_0x4e03('0x0'));var util=require(_0x4e03('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4e03('0x2'));var BPromise=require(_0x4e03('0x3'));var rp=require(_0x4e03('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e03('0x5'));var config=require(_0x4e03('0x6'));var attributes=require(_0x4e03('0x7'));module[_0x4e03('0x8')]=function(_0x550ba9,_0x10f16b){return _0x550ba9[_0x4e03('0x9')](_0x4e03('0xa'),attributes,{'tableName':_0x4e03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2b65d23..aa1ad57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0801=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x20a618,_0x3d1a7b){var _0x3be658=function(_0x2cef18){while(--_0x2cef18){_0x20a618['push'](_0x20a618['shift']());}};_0x3be658(++_0x3d1a7b);}(_0x0801,0x11a));var _0x1080=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0801[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x1080('0x0'));var util=require(_0x1080('0x1'));var moment=require(_0x1080('0x2'));var BPromise=require(_0x1080('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1080('0x4'));var db=require(_0x1080('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1080('0x6'))(_0x1080('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1080('0x8')][_0x1080('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30fb00,_0x7d2aba,_0x412eb7){return new BPromise(function(_0x1735f5,_0x99e621){return client[_0x1080('0xa')](_0x30fb00,_0x412eb7)[_0x1080('0xb')](function(_0x391d9d){logger['info'](_0x1080('0xc'),_0x7d2aba,_0x1080('0xd'));logger['debug'](_0x1080('0xe'),_0x7d2aba,_0x1080('0xd'),JSON[_0x1080('0xf')](_0x391d9d));if(_0x391d9d[_0x1080('0x10')]){if(_0x391d9d[_0x1080('0x10')][_0x1080('0x11')]===0x1f4){logger[_0x1080('0x10')](_0x1080('0xc'),_0x7d2aba,_0x391d9d[_0x1080('0x10')][_0x1080('0x12')]);return _0x99e621(_0x391d9d[_0x1080('0x10')][_0x1080('0x12')]);}logger['error'](_0x1080('0xc'),_0x7d2aba,_0x391d9d[_0x1080('0x10')][_0x1080('0x12')]);return _0x1735f5(_0x391d9d[_0x1080('0x10')][_0x1080('0x12')]);}else{logger[_0x1080('0x13')](_0x1080('0xc'),_0x7d2aba,_0x1080('0xd'));_0x1735f5(_0x391d9d['result']['message']);}})[_0x1080('0x14')](function(_0xe4add5){logger[_0x1080('0x10')](_0x1080('0xc'),_0x7d2aba,_0xe4add5);_0x99e621(_0xe4add5);});});}
\ No newline at end of file
+var _0x5ac7=['../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x5ac7,0x1c7));var _0x75ac=function(_0x5af494,_0x4c0718){_0x5af494=_0x5af494-0x0;var _0x513c98=_0x5ac7[_0x5af494];return _0x513c98;};'use strict';var _=require(_0x75ac('0x0'));var util=require('util');var moment=require(_0x75ac('0x1'));var BPromise=require(_0x75ac('0x2'));var rs=require(_0x75ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x75ac('0x4'));var logger=require(_0x75ac('0x5'))(_0x75ac('0x6'));var config=require(_0x75ac('0x7'));var jayson=require(_0x75ac('0x8'));var client=jayson[_0x75ac('0x9')][_0x75ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bb677,_0x6f56a4,_0x4d65de){return new BPromise(function(_0x4b4790,_0x3f8ac1){return client[_0x75ac('0xb')](_0x1bb677,_0x4d65de)['then'](function(_0x3c563e){logger[_0x75ac('0xc')](_0x75ac('0xd'),_0x6f56a4,_0x75ac('0xe'));logger['debug'](_0x75ac('0xf'),_0x6f56a4,'request\x20sent',JSON[_0x75ac('0x10')](_0x3c563e));if(_0x3c563e[_0x75ac('0x11')]){if(_0x3c563e[_0x75ac('0x11')][_0x75ac('0x12')]===0x1f4){logger[_0x75ac('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x6f56a4,_0x3c563e[_0x75ac('0x11')]['message']);return _0x3f8ac1(_0x3c563e[_0x75ac('0x11')][_0x75ac('0x13')]);}logger[_0x75ac('0x11')](_0x75ac('0xd'),_0x6f56a4,_0x3c563e[_0x75ac('0x11')][_0x75ac('0x13')]);return _0x4b4790(_0x3c563e[_0x75ac('0x11')][_0x75ac('0x13')]);}else{logger[_0x75ac('0xc')](_0x75ac('0xd'),_0x6f56a4,_0x75ac('0xe'));_0x4b4790(_0x3c563e['result'][_0x75ac('0x13')]);}})[_0x75ac('0x14')](function(_0x573a4f){logger[_0x75ac('0x11')](_0x75ac('0xd'),_0x6f56a4,_0x573a4f);_0x3f8ac1(_0x573a4f);});});}
\ No newline at end of file
index d8417ac..5fe7c99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3195=['./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x456b77,_0x4fed12){var _0x118bb6=function(_0x2ea238){while(--_0x2ea238){_0x456b77['push'](_0x456b77['shift']());}};_0x118bb6(++_0x4fed12);}(_0x3195,0x13a));var _0x5319=function(_0x42c445,_0x26afd6){_0x42c445=_0x42c445-0x0;var _0x3ff4d7=_0x3195[_0x42c445];return _0x3ff4d7;};'use strict';var multer=require(_0x5319('0x0'));var util=require(_0x5319('0x1'));var path=require(_0x5319('0x2'));var timeout=require(_0x5319('0x3'));var express=require(_0x5319('0x4'));var router=express['Router']();var fs_extra=require(_0x5319('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5319('0x6'));var config=require(_0x5319('0x7'));var controller=require(_0x5319('0x8'));router[_0x5319('0x9')]('/',auth[_0x5319('0xa')](),controller[_0x5319('0xb')]);router['get'](_0x5319('0xc'),auth[_0x5319('0xa')](),controller['describe']);router[_0x5319('0x9')](_0x5319('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x5319('0x9')](_0x5319('0xe'),auth[_0x5319('0xa')](),controller[_0x5319('0xf')]);router[_0x5319('0x10')]('/',auth[_0x5319('0xa')](),controller[_0x5319('0x11')]);router[_0x5319('0x12')](_0x5319('0xd'),auth[_0x5319('0xa')](),controller[_0x5319('0x13')]);router[_0x5319('0x14')](_0x5319('0xd'),auth[_0x5319('0xa')](),controller[_0x5319('0x15')]);module[_0x5319('0x16')]=router;
\ No newline at end of file
+var _0xbf1f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/:id','show','/:id/questions','getQuestions','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbf1f,0x96));var _0xfbf1=function(_0x5a75e7,_0x3ad506){_0x5a75e7=_0x5a75e7-0x0;var _0x15c695=_0xbf1f[_0x5a75e7];return _0x15c695;};'use strict';var multer=require(_0xfbf1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfbf1('0x1'));var express=require(_0xfbf1('0x2'));var router=express[_0xfbf1('0x3')]();var fs_extra=require(_0xfbf1('0x4'));var auth=require(_0xfbf1('0x5'));var interaction=require(_0xfbf1('0x6'));var config=require(_0xfbf1('0x7'));var controller=require(_0xfbf1('0x8'));router[_0xfbf1('0x9')]('/',auth[_0xfbf1('0xa')](),controller[_0xfbf1('0xb')]);router[_0xfbf1('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xfbf1('0x9')](_0xfbf1('0xc'),auth[_0xfbf1('0xa')](),controller[_0xfbf1('0xd')]);router[_0xfbf1('0x9')](_0xfbf1('0xe'),auth[_0xfbf1('0xa')](),controller[_0xfbf1('0xf')]);router[_0xfbf1('0x10')]('/',auth[_0xfbf1('0xa')](),controller[_0xfbf1('0x11')]);router['put'](_0xfbf1('0xc'),auth[_0xfbf1('0xa')](),controller[_0xfbf1('0x12')]);router[_0xfbf1('0x13')](_0xfbf1('0xc'),auth[_0xfbf1('0xa')](),controller[_0xfbf1('0x14')]);module[_0xfbf1('0x15')]=router;
\ No newline at end of file
index e5eb9e0..f60b023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0272=['starttime','endtime','STRING','moment','sequelize','DATE','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0272,0x15a));var _0x2027=function(_0x7cc49a,_0x3c86df){_0x7cc49a=_0x7cc49a-0x0;var _0x30e0a2=_0x0272[_0x7cc49a];return _0x30e0a2;};'use strict';var moment=require(_0x2027('0x0'));var Sequelize=require(_0x2027('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x2027('0x2')],'set':function(_0x2cf50c){this[_0x2027('0x3')](_0x2027('0x4'),_0x2cf50c);this[_0x2027('0x3')](_0x2027('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x2027('0x2')]},'membername':{'type':Sequelize[_0x2027('0x6')]},'projectname':{'type':Sequelize[_0x2027('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2027('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb2a5=['exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize'];(function(_0x5c48a4,_0xb15edc){var _0x5a9cc3=function(_0x556c67){while(--_0x556c67){_0x5c48a4['push'](_0x5c48a4['shift']());}};_0x5a9cc3(++_0xb15edc);}(_0xb2a5,0x1ac));var _0x5b2a=function(_0xfc7242,_0x17be03){_0xfc7242=_0xfc7242-0x0;var _0x5000c6=_0xb2a5[_0xfc7242];return _0x5000c6;};'use strict';var moment=require(_0x5b2a('0x0'));var Sequelize=require(_0x5b2a('0x1'));module[_0x5b2a('0x2')]={'starttime':{'type':Sequelize[_0x5b2a('0x3')],'set':function(_0x10525c){this[_0x5b2a('0x4')](_0x5b2a('0x5'),_0x10525c);this[_0x5b2a('0x4')](_0x5b2a('0x6'),moment()[_0x5b2a('0x7')](_0x5b2a('0x8')));}},'endtime':{'type':Sequelize[_0x5b2a('0x3')]},'membername':{'type':Sequelize[_0x5b2a('0x9')]},'projectname':{'type':Sequelize[_0x5b2a('0x9')]},'queue':{'type':Sequelize[_0x5b2a('0x9')]},'uniqueid':{'type':Sequelize[_0x5b2a('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5b2a('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 4ed0c8f..25670ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61da=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','end','error','stack','send','index','map','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','JscriptySessionReport','includeAll','rows','catch','include','options','find','create','body','params','describe','getQuestions','JscriptyQuestionReport','SessionId','findAll','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x61da,0x12e));var _0xa61d=function(_0x1c8251,_0x2709b9){_0x1c8251=_0x1c8251-0x0;var _0x2dd832=_0x61da[_0x1c8251];return _0x2dd832;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa61d('0x0'));var zipdir=require(_0xa61d('0x1'));var jsonpatch=require(_0xa61d('0x2'));var rp=require('request-promise');var moment=require(_0xa61d('0x3'));var BPromise=require(_0xa61d('0x4'));var Mustache=require(_0xa61d('0x5'));var util=require(_0xa61d('0x6'));var path=require(_0xa61d('0x7'));var sox=require('sox');var csv=require(_0xa61d('0x8'));var ejs=require(_0xa61d('0x9'));var fs=require('fs');var fs_extra=require(_0xa61d('0xa'));var _=require(_0xa61d('0xb'));var squel=require(_0xa61d('0xc'));var crypto=require(_0xa61d('0xd'));var jsforce=require(_0xa61d('0xe'));var deskjs=require(_0xa61d('0xf'));var toCsv=require(_0xa61d('0x8'));var querystring=require(_0xa61d('0x10'));var Papa=require(_0xa61d('0x11'));var Redis=require(_0xa61d('0x12'));var authService=require(_0xa61d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa61d('0x14'));var hardwareService=require(_0xa61d('0x15'));var logger=require(_0xa61d('0x16'))(_0xa61d('0x17'));var utils=require('../../config/utils');var config=require(_0xa61d('0x18'));var licenseUtil=require(_0xa61d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12b5f2,_0x3c8a44){_0x3c8a44=_0x3c8a44||0xcc;return function(_0x2dc0a5){if(_0x2dc0a5){return _0x12b5f2[_0xa61d('0x1a')](_0x3c8a44);}return _0x12b5f2[_0xa61d('0x1b')](_0x3c8a44)['end']();};}function respondWithResult(_0x570a3c,_0x303528){_0x303528=_0x303528||0xc8;return function(_0x3ed9ce){if(_0x3ed9ce){return _0x570a3c[_0xa61d('0x1b')](_0x303528)[_0xa61d('0x1c')](_0x3ed9ce);}};}function respondWithFilteredResult(_0x9fec96,_0x2d71cf){return function(_0x418afb){if(_0x418afb){var _0x5c5236=typeof _0x2d71cf[_0xa61d('0x1d')]===_0xa61d('0x1e')&&typeof _0x2d71cf[_0xa61d('0x1f')]===_0xa61d('0x1e');var _0x578bcb=_0x418afb[_0xa61d('0x20')];var _0x2bea44=_0x5c5236?0x0:_0x2d71cf[_0xa61d('0x1d')];var _0x4a1275=_0x5c5236?_0x418afb[_0xa61d('0x20')]:_0x2d71cf['offset']+_0x2d71cf[_0xa61d('0x1f')];var _0x27741a;if(_0x4a1275>=_0x578bcb){_0x4a1275=_0x578bcb;_0x27741a=0xc8;}else{_0x27741a=0xce;}_0x9fec96[_0xa61d('0x1b')](_0x27741a);return _0x9fec96[_0xa61d('0x21')](_0xa61d('0x22'),_0x2bea44+'-'+_0x4a1275+'/'+_0x578bcb)['json'](_0x418afb);}return null;};}function patchUpdates(_0x1c6cda){return function(_0x372cd4){try{jsonpatch[_0xa61d('0x23')](_0x372cd4,_0x1c6cda,!![]);}catch(_0x15e880){return BPromise['reject'](_0x15e880);}return _0x372cd4['save']();};}function saveUpdates(_0x33947c,_0x369f43){return function(_0x248131){if(_0x248131){return _0x248131[_0xa61d('0x24')](_0x33947c)['then'](function(_0x41dd13){return _0x41dd13;});}return null;};}function removeEntity(_0x38aba9,_0x579211){return function(_0x1faee0){if(_0x1faee0){return _0x1faee0[_0xa61d('0x25')]()[_0xa61d('0x26')](function(){_0x38aba9[_0xa61d('0x1b')](0xcc)[_0xa61d('0x27')]();});}};}function handleEntityNotFound(_0x253506,_0x1ea954){return function(_0x1f4d93){if(!_0x1f4d93){_0x253506['sendStatus'](0x194);}return _0x1f4d93;};}function handleError(_0xb7db1b,_0xec41b6){_0xec41b6=_0xec41b6||0x1f4;return function(_0x414ad7){logger[_0xa61d('0x28')](_0x414ad7[_0xa61d('0x29')]);if(_0x414ad7['name']){delete _0x414ad7['name'];}_0xb7db1b['status'](_0xec41b6)[_0xa61d('0x2a')](_0x414ad7);};}exports[_0xa61d('0x2b')]=function(_0x1320bf,_0x518212){var _0x464349={},_0x3b91c4={},_0x50068d={'count':0x0,'rows':[]};var _0x51abdd=_[_0xa61d('0x2c')](db['JscriptySessionReport'][_0xa61d('0x2d')],function(_0x54f0dd){return{'name':_0x54f0dd['fieldName'],'type':_0x54f0dd['type'][_0xa61d('0x2e')]};});_0x3b91c4[_0xa61d('0x2f')]=_['map'](_0x51abdd,_0xa61d('0x30'));_0x3b91c4[_0xa61d('0x31')]=_[_0xa61d('0x32')](_0x1320bf[_0xa61d('0x31')]);_0x3b91c4[_0xa61d('0x33')]=_[_0xa61d('0x34')](_0x3b91c4[_0xa61d('0x2f')],_0x3b91c4['query']);_0x464349[_0xa61d('0x35')]=_[_0xa61d('0x34')](_0x3b91c4[_0xa61d('0x2f')],qs[_0xa61d('0x36')](_0x1320bf[_0xa61d('0x31')]['fields']));_0x464349[_0xa61d('0x35')]=_0x464349['attributes'][_0xa61d('0x37')]?_0x464349[_0xa61d('0x35')]:_0x3b91c4[_0xa61d('0x2f')];if(!_0x1320bf[_0xa61d('0x31')][_0xa61d('0x38')](_0xa61d('0x39'))){_0x464349[_0xa61d('0x1f')]=qs[_0xa61d('0x1f')](_0x1320bf[_0xa61d('0x31')][_0xa61d('0x1f')]);_0x464349[_0xa61d('0x1d')]=qs[_0xa61d('0x1d')](_0x1320bf['query']['offset']);}_0x464349[_0xa61d('0x3a')]=qs[_0xa61d('0x3b')](_0x1320bf['query']['sort']);_0x464349[_0xa61d('0x3c')]=qs[_0xa61d('0x33')](_[_0xa61d('0x3d')](_0x1320bf['query'],_0x3b91c4[_0xa61d('0x33')]),_0x51abdd);if(_0x1320bf['query'][_0xa61d('0x3e')]){_0x464349[_0xa61d('0x3c')]=_[_0xa61d('0x3f')](_0x464349[_0xa61d('0x3c')],{'$or':_[_0xa61d('0x2c')](_0x51abdd,function(_0x82e681){if(_0x82e681[_0xa61d('0x40')]!=='VIRTUAL'){var _0x57a17c={};_0x57a17c[_0x82e681[_0xa61d('0x30')]]={'$like':'%'+_0x1320bf[_0xa61d('0x31')][_0xa61d('0x3e')]+'%'};return _0x57a17c;}})});}_0x464349=_[_0xa61d('0x3f')]({},_0x464349,_0x1320bf['options']);var _0x49d754={'where':_0x464349[_0xa61d('0x3c')]};return db[_0xa61d('0x41')][_0xa61d('0x20')](_0x49d754)[_0xa61d('0x26')](function(_0x42c73f){_0x50068d['count']=_0x42c73f;if(_0x1320bf[_0xa61d('0x31')][_0xa61d('0x42')]){_0x464349['include']=[{'all':!![]}];}return db[_0xa61d('0x41')]['findAll'](_0x464349);})[_0xa61d('0x26')](function(_0xb4264){_0x50068d[_0xa61d('0x43')]=_0xb4264;return _0x50068d;})[_0xa61d('0x26')](respondWithFilteredResult(_0x518212,_0x464349))[_0xa61d('0x44')](handleError(_0x518212,null));};exports['show']=function(_0x30b85b,_0xc3870f){var _0x501a1f={'raw':!![],'where':{'id':_0x30b85b['params']['id']}},_0x1bf44e={};_0x1bf44e[_0xa61d('0x2f')]=_[_0xa61d('0x32')](db[_0xa61d('0x41')][_0xa61d('0x2d')]);_0x1bf44e[_0xa61d('0x31')]=_[_0xa61d('0x32')](_0x30b85b['query']);_0x1bf44e[_0xa61d('0x33')]=_[_0xa61d('0x34')](_0x1bf44e[_0xa61d('0x2f')],_0x1bf44e[_0xa61d('0x31')]);_0x501a1f[_0xa61d('0x35')]=_['intersection'](_0x1bf44e[_0xa61d('0x2f')],qs[_0xa61d('0x36')](_0x30b85b[_0xa61d('0x31')][_0xa61d('0x36')]));_0x501a1f[_0xa61d('0x35')]=_0x501a1f[_0xa61d('0x35')][_0xa61d('0x37')]?_0x501a1f[_0xa61d('0x35')]:_0x1bf44e[_0xa61d('0x2f')];if(_0x30b85b[_0xa61d('0x31')][_0xa61d('0x42')]){_0x501a1f[_0xa61d('0x45')]=[{'all':!![]}];}_0x501a1f=_['merge']({},_0x501a1f,_0x30b85b[_0xa61d('0x46')]);return db['JscriptySessionReport'][_0xa61d('0x47')](_0x501a1f)['then'](handleEntityNotFound(_0xc3870f,null))[_0xa61d('0x26')](respondWithResult(_0xc3870f,null))[_0xa61d('0x44')](handleError(_0xc3870f,null));};exports[_0xa61d('0x48')]=function(_0x54c661,_0x469e41){return db['JscriptySessionReport'][_0xa61d('0x48')](_0x54c661['body'],{})['then'](respondWithResult(_0x469e41,0xc9))[_0xa61d('0x44')](handleError(_0x469e41,null));};exports[_0xa61d('0x24')]=function(_0x28c99c,_0xbf32d6){if(_0x28c99c['body']['id']){delete _0x28c99c[_0xa61d('0x49')]['id'];}return db[_0xa61d('0x41')][_0xa61d('0x47')]({'where':{'id':_0x28c99c[_0xa61d('0x4a')]['id']}})[_0xa61d('0x26')](handleEntityNotFound(_0xbf32d6,null))['then'](saveUpdates(_0x28c99c[_0xa61d('0x49')],null))['then'](respondWithResult(_0xbf32d6,null))[_0xa61d('0x44')](handleError(_0xbf32d6,null));};exports[_0xa61d('0x25')]=function(_0x35cf65,_0x5bf924){return db[_0xa61d('0x41')][_0xa61d('0x47')]({'where':{'id':_0x35cf65['params']['id']}})[_0xa61d('0x26')](handleEntityNotFound(_0x5bf924,null))[_0xa61d('0x26')](removeEntity(_0x5bf924,null))['catch'](handleError(_0x5bf924,null));};exports[_0xa61d('0x4b')]=function(_0x49fc77,_0x325b43){return db['JscriptySessionReport'][_0xa61d('0x4b')]()[_0xa61d('0x26')](respondWithResult(_0x325b43,null))['catch'](handleError(_0x325b43,null));};exports[_0xa61d('0x4c')]=function(_0x5dca1b,_0x18b1d9,_0x2dc362){var _0x4ec033={'raw':!![],'where':{}};var _0x45274d={};var _0x216122={'count':0x0,'rows':[]};return db[_0xa61d('0x41')]['findOne']({'where':{'id':_0x5dca1b[_0xa61d('0x4a')]['id']}})[_0xa61d('0x26')](handleEntityNotFound(_0x18b1d9,null))[_0xa61d('0x26')](function(_0x4e7036){if(_0x4e7036){_0x45274d[_0xa61d('0x2f')]=_[_0xa61d('0x32')](db[_0xa61d('0x4d')][_0xa61d('0x2d')]);_0x45274d[_0xa61d('0x31')]=_[_0xa61d('0x32')](_0x5dca1b['query']);_0x45274d[_0xa61d('0x33')]=_['intersection'](_0x45274d[_0xa61d('0x2f')],_0x45274d['query']);_0x4ec033[_0xa61d('0x35')]=_['intersection'](_0x45274d['model'],qs[_0xa61d('0x36')](_0x5dca1b['query']['fields']));_0x4ec033[_0xa61d('0x35')]=_0x4ec033[_0xa61d('0x35')][_0xa61d('0x37')]?_0x4ec033['attributes']:_0x45274d[_0xa61d('0x2f')];if(!_0x5dca1b[_0xa61d('0x31')][_0xa61d('0x38')]('nolimit')){_0x4ec033['limit']=qs[_0xa61d('0x1f')](_0x5dca1b[_0xa61d('0x31')][_0xa61d('0x1f')]);_0x4ec033[_0xa61d('0x1d')]=qs[_0xa61d('0x1d')](_0x5dca1b[_0xa61d('0x31')][_0xa61d('0x1d')]);}_0x4ec033[_0xa61d('0x3a')]=qs[_0xa61d('0x3b')](_0x5dca1b['query'][_0xa61d('0x3b')]);_0x4ec033['where']=qs[_0xa61d('0x33')](_[_0xa61d('0x3d')](_0x5dca1b[_0xa61d('0x31')],_0x45274d[_0xa61d('0x33')]));_0x4ec033[_0xa61d('0x3c')][_0xa61d('0x4e')]=_0x4e7036['id'];if(_0x5dca1b[_0xa61d('0x31')][_0xa61d('0x3e')]){_0x4ec033[_0xa61d('0x3c')]=_[_0xa61d('0x3f')](_0x4ec033[_0xa61d('0x3c')],{'$or':_[_0xa61d('0x2c')](_0x4ec033['attributes'],function(_0x59063a){var _0x36eaa2={};_0x36eaa2[_0x59063a]={'$like':'%'+_0x5dca1b['query'][_0xa61d('0x3e')]+'%'};return _0x36eaa2;})});}_0x4ec033=_[_0xa61d('0x3f')]({},_0x4ec033,_0x5dca1b['options']);return db[_0xa61d('0x4d')][_0xa61d('0x20')]({'where':_0x4ec033[_0xa61d('0x3c')]})['then'](function(_0x2a9ee3){_0x216122[_0xa61d('0x20')]=_0x2a9ee3;if(_0x5dca1b['query'][_0xa61d('0x42')]){_0x4ec033[_0xa61d('0x45')]=[{'all':!![]}];}return db[_0xa61d('0x4d')][_0xa61d('0x4f')](_0x4ec033);})['then'](function(_0x2b77ed){_0x216122[_0xa61d('0x43')]=_0x2b77ed;return _0x216122;});}})[_0xa61d('0x26')](respondWithFilteredResult(_0x18b1d9,_0x4ec033))[_0xa61d('0x44')](handleError(_0x18b1d9,null));};
\ No newline at end of file
+var _0x53e9=['apply','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','type','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','JscriptySessionReport','includeAll','findAll','rows','catch','show','params','length','find','create','body','describe','getQuestions','JscriptyQuestionReport','pick','SessionId','options','include','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x33156e,_0x14e9b0){var _0x4d6423=function(_0x158b75){while(--_0x158b75){_0x33156e['push'](_0x33156e['shift']());}};_0x4d6423(++_0x14e9b0);}(_0x53e9,0x7d));var _0x953e=function(_0x428956,_0x2abae6){_0x428956=_0x428956-0x0;var _0x536b4d=_0x53e9[_0x428956];return _0x536b4d;};'use strict';var emlformat=require(_0x953e('0x0'));var rimraf=require(_0x953e('0x1'));var zipdir=require(_0x953e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x953e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x953e('0x4'));var util=require(_0x953e('0x5'));var path=require(_0x953e('0x6'));var sox=require(_0x953e('0x7'));var csv=require(_0x953e('0x8'));var ejs=require(_0x953e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x953e('0xa'));var squel=require(_0x953e('0xb'));var crypto=require(_0x953e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x953e('0xd'));var Papa=require(_0x953e('0xe'));var Redis=require(_0x953e('0xf'));var authService=require(_0x953e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x953e('0x11'));var hardwareService=require(_0x953e('0x12'));var logger=require(_0x953e('0x13'))(_0x953e('0x14'));var utils=require(_0x953e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x953e('0x16'));var db=require(_0x953e('0x17'))['db'];function respondWithStatusCode(_0x2605fe,_0x4bd7e0){_0x4bd7e0=_0x4bd7e0||0xcc;return function(_0x10965d){if(_0x10965d){return _0x2605fe[_0x953e('0x18')](_0x4bd7e0);}return _0x2605fe[_0x953e('0x19')](_0x4bd7e0)['end']();};}function respondWithResult(_0x13957f,_0x9ddfb8){_0x9ddfb8=_0x9ddfb8||0xc8;return function(_0x4ff4a9){if(_0x4ff4a9){return _0x13957f[_0x953e('0x19')](_0x9ddfb8)[_0x953e('0x1a')](_0x4ff4a9);}};}function respondWithFilteredResult(_0x138a81,_0x3af8a1){return function(_0x39c6){if(_0x39c6){var _0x20efb3=typeof _0x3af8a1[_0x953e('0x1b')]===_0x953e('0x1c')&&typeof _0x3af8a1[_0x953e('0x1d')]===_0x953e('0x1c');var _0x5c94bc=_0x39c6[_0x953e('0x1e')];var _0x10453c=_0x20efb3?0x0:_0x3af8a1['offset'];var _0x2ea73d=_0x20efb3?_0x39c6[_0x953e('0x1e')]:_0x3af8a1[_0x953e('0x1b')]+_0x3af8a1[_0x953e('0x1d')];var _0x3c3ca9;if(_0x2ea73d>=_0x5c94bc){_0x2ea73d=_0x5c94bc;_0x3c3ca9=0xc8;}else{_0x3c3ca9=0xce;}_0x138a81[_0x953e('0x19')](_0x3c3ca9);return _0x138a81['set']('Content-Range',_0x10453c+'-'+_0x2ea73d+'/'+_0x5c94bc)[_0x953e('0x1a')](_0x39c6);}return null;};}function patchUpdates(_0x27ab83){return function(_0x19c0f0){try{jsonpatch[_0x953e('0x1f')](_0x19c0f0,_0x27ab83,!![]);}catch(_0xa6eb13){return BPromise[_0x953e('0x20')](_0xa6eb13);}return _0x19c0f0['save']();};}function saveUpdates(_0x3c3a0a,_0x1965ff){return function(_0xccaa67){if(_0xccaa67){return _0xccaa67[_0x953e('0x21')](_0x3c3a0a)[_0x953e('0x22')](function(_0x354c16){return _0x354c16;});}return null;};}function removeEntity(_0x4e68e9,_0x455edf){return function(_0x4aa9e2){if(_0x4aa9e2){return _0x4aa9e2[_0x953e('0x23')]()[_0x953e('0x22')](function(){_0x4e68e9[_0x953e('0x19')](0xcc)[_0x953e('0x24')]();});}};}function handleEntityNotFound(_0x12c525,_0x11a0fb){return function(_0x33d022){if(!_0x33d022){_0x12c525[_0x953e('0x18')](0x194);}return _0x33d022;};}function handleError(_0x12ed96,_0x5e4dbc){_0x5e4dbc=_0x5e4dbc||0x1f4;return function(_0x2a5a11){logger[_0x953e('0x25')](_0x2a5a11[_0x953e('0x26')]);if(_0x2a5a11[_0x953e('0x27')]){delete _0x2a5a11[_0x953e('0x27')];}_0x12ed96[_0x953e('0x19')](_0x5e4dbc)[_0x953e('0x28')](_0x2a5a11);};}exports[_0x953e('0x29')]=function(_0x35d572,_0x3fcdd1){var _0x314a86={},_0x29a8c1={},_0x24a360={'count':0x0,'rows':[]};var _0x522eb8=_['map'](db['JscriptySessionReport'][_0x953e('0x2a')],function(_0x190033){return{'name':_0x190033['fieldName'],'type':_0x190033[_0x953e('0x2b')]['key']};});_0x29a8c1['model']=_[_0x953e('0x2c')](_0x522eb8,_0x953e('0x27'));_0x29a8c1[_0x953e('0x2d')]=_[_0x953e('0x2e')](_0x35d572[_0x953e('0x2d')]);_0x29a8c1[_0x953e('0x2f')]=_['intersection'](_0x29a8c1[_0x953e('0x30')],_0x29a8c1['query']);_0x314a86['attributes']=_[_0x953e('0x31')](_0x29a8c1[_0x953e('0x30')],qs[_0x953e('0x32')](_0x35d572[_0x953e('0x2d')]['fields']));_0x314a86['attributes']=_0x314a86[_0x953e('0x33')]['length']?_0x314a86['attributes']:_0x29a8c1[_0x953e('0x30')];if(!_0x35d572[_0x953e('0x2d')][_0x953e('0x34')](_0x953e('0x35'))){_0x314a86[_0x953e('0x1d')]=qs[_0x953e('0x1d')](_0x35d572[_0x953e('0x2d')][_0x953e('0x1d')]);_0x314a86[_0x953e('0x1b')]=qs[_0x953e('0x1b')](_0x35d572[_0x953e('0x2d')][_0x953e('0x1b')]);}_0x314a86[_0x953e('0x36')]=qs[_0x953e('0x37')](_0x35d572[_0x953e('0x2d')][_0x953e('0x37')]);_0x314a86[_0x953e('0x38')]=qs[_0x953e('0x2f')](_['pick'](_0x35d572['query'],_0x29a8c1[_0x953e('0x2f')]),_0x522eb8);if(_0x35d572[_0x953e('0x2d')][_0x953e('0x39')]){_0x314a86[_0x953e('0x38')]=_[_0x953e('0x3a')](_0x314a86[_0x953e('0x38')],{'$or':_[_0x953e('0x2c')](_0x522eb8,function(_0x560520){if(_0x560520[_0x953e('0x2b')]!==_0x953e('0x3b')){var _0x293a42={};_0x293a42[_0x560520[_0x953e('0x27')]]={'$like':'%'+_0x35d572['query'][_0x953e('0x39')]+'%'};return _0x293a42;}})});}_0x314a86=_[_0x953e('0x3a')]({},_0x314a86,_0x35d572['options']);var _0x3bbb45={'where':_0x314a86[_0x953e('0x38')]};return db[_0x953e('0x3c')][_0x953e('0x1e')](_0x3bbb45)[_0x953e('0x22')](function(_0x2c963d){_0x24a360[_0x953e('0x1e')]=_0x2c963d;if(_0x35d572[_0x953e('0x2d')][_0x953e('0x3d')]){_0x314a86['include']=[{'all':!![]}];}return db[_0x953e('0x3c')][_0x953e('0x3e')](_0x314a86);})[_0x953e('0x22')](function(_0x216a07){_0x24a360[_0x953e('0x3f')]=_0x216a07;return _0x24a360;})[_0x953e('0x22')](respondWithFilteredResult(_0x3fcdd1,_0x314a86))[_0x953e('0x40')](handleError(_0x3fcdd1,null));};exports[_0x953e('0x41')]=function(_0x134b84,_0x1272bd){var _0x53714c={'raw':!![],'where':{'id':_0x134b84[_0x953e('0x42')]['id']}},_0x32b418={};_0x32b418['model']=_[_0x953e('0x2e')](db[_0x953e('0x3c')]['rawAttributes']);_0x32b418[_0x953e('0x2d')]=_[_0x953e('0x2e')](_0x134b84[_0x953e('0x2d')]);_0x32b418[_0x953e('0x2f')]=_['intersection'](_0x32b418[_0x953e('0x30')],_0x32b418['query']);_0x53714c[_0x953e('0x33')]=_['intersection'](_0x32b418['model'],qs[_0x953e('0x32')](_0x134b84['query'][_0x953e('0x32')]));_0x53714c['attributes']=_0x53714c[_0x953e('0x33')][_0x953e('0x43')]?_0x53714c[_0x953e('0x33')]:_0x32b418[_0x953e('0x30')];if(_0x134b84[_0x953e('0x2d')]['includeAll']){_0x53714c['include']=[{'all':!![]}];}_0x53714c=_[_0x953e('0x3a')]({},_0x53714c,_0x134b84['options']);return db['JscriptySessionReport'][_0x953e('0x44')](_0x53714c)['then'](handleEntityNotFound(_0x1272bd,null))['then'](respondWithResult(_0x1272bd,null))[_0x953e('0x40')](handleError(_0x1272bd,null));};exports[_0x953e('0x45')]=function(_0x5e162d,_0x1e95f6){return db[_0x953e('0x3c')][_0x953e('0x45')](_0x5e162d[_0x953e('0x46')],{})[_0x953e('0x22')](respondWithResult(_0x1e95f6,0xc9))['catch'](handleError(_0x1e95f6,null));};exports[_0x953e('0x21')]=function(_0x353fd2,_0x507668){if(_0x353fd2[_0x953e('0x46')]['id']){delete _0x353fd2['body']['id'];}return db[_0x953e('0x3c')][_0x953e('0x44')]({'where':{'id':_0x353fd2[_0x953e('0x42')]['id']}})['then'](handleEntityNotFound(_0x507668,null))[_0x953e('0x22')](saveUpdates(_0x353fd2[_0x953e('0x46')],null))[_0x953e('0x22')](respondWithResult(_0x507668,null))[_0x953e('0x40')](handleError(_0x507668,null));};exports['destroy']=function(_0xa174a9,_0x62b69a){return db[_0x953e('0x3c')][_0x953e('0x44')]({'where':{'id':_0xa174a9['params']['id']}})[_0x953e('0x22')](handleEntityNotFound(_0x62b69a,null))[_0x953e('0x22')](removeEntity(_0x62b69a,null))[_0x953e('0x40')](handleError(_0x62b69a,null));};exports[_0x953e('0x47')]=function(_0x555d27,_0x1c1489){return db[_0x953e('0x3c')][_0x953e('0x47')]()[_0x953e('0x22')](respondWithResult(_0x1c1489,null))['catch'](handleError(_0x1c1489,null));};exports[_0x953e('0x48')]=function(_0x4eafc0,_0xb26acc,_0x41651a){var _0x1d2e27={'raw':!![],'where':{}};var _0x1ced00={};var _0x30724c={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x4eafc0[_0x953e('0x42')]['id']}})[_0x953e('0x22')](handleEntityNotFound(_0xb26acc,null))[_0x953e('0x22')](function(_0x228bb9){if(_0x228bb9){_0x1ced00[_0x953e('0x30')]=_[_0x953e('0x2e')](db[_0x953e('0x49')][_0x953e('0x2a')]);_0x1ced00[_0x953e('0x2d')]=_[_0x953e('0x2e')](_0x4eafc0[_0x953e('0x2d')]);_0x1ced00[_0x953e('0x2f')]=_['intersection'](_0x1ced00[_0x953e('0x30')],_0x1ced00['query']);_0x1d2e27[_0x953e('0x33')]=_[_0x953e('0x31')](_0x1ced00['model'],qs[_0x953e('0x32')](_0x4eafc0['query'][_0x953e('0x32')]));_0x1d2e27[_0x953e('0x33')]=_0x1d2e27[_0x953e('0x33')]['length']?_0x1d2e27[_0x953e('0x33')]:_0x1ced00['model'];if(!_0x4eafc0[_0x953e('0x2d')][_0x953e('0x34')](_0x953e('0x35'))){_0x1d2e27[_0x953e('0x1d')]=qs['limit'](_0x4eafc0['query'][_0x953e('0x1d')]);_0x1d2e27[_0x953e('0x1b')]=qs['offset'](_0x4eafc0[_0x953e('0x2d')][_0x953e('0x1b')]);}_0x1d2e27[_0x953e('0x36')]=qs[_0x953e('0x37')](_0x4eafc0['query'][_0x953e('0x37')]);_0x1d2e27[_0x953e('0x38')]=qs[_0x953e('0x2f')](_[_0x953e('0x4a')](_0x4eafc0[_0x953e('0x2d')],_0x1ced00[_0x953e('0x2f')]));_0x1d2e27[_0x953e('0x38')][_0x953e('0x4b')]=_0x228bb9['id'];if(_0x4eafc0[_0x953e('0x2d')][_0x953e('0x39')]){_0x1d2e27['where']=_[_0x953e('0x3a')](_0x1d2e27[_0x953e('0x38')],{'$or':_[_0x953e('0x2c')](_0x1d2e27[_0x953e('0x33')],function(_0x2064e0){var _0x28a6f5={};_0x28a6f5[_0x2064e0]={'$like':'%'+_0x4eafc0[_0x953e('0x2d')][_0x953e('0x39')]+'%'};return _0x28a6f5;})});}_0x1d2e27=_['merge']({},_0x1d2e27,_0x4eafc0[_0x953e('0x4c')]);return db[_0x953e('0x49')]['count']({'where':_0x1d2e27[_0x953e('0x38')]})[_0x953e('0x22')](function(_0x13eeff){_0x30724c['count']=_0x13eeff;if(_0x4eafc0['query'][_0x953e('0x3d')]){_0x1d2e27[_0x953e('0x4d')]=[{'all':!![]}];}return db[_0x953e('0x49')][_0x953e('0x3e')](_0x1d2e27);})[_0x953e('0x22')](function(_0x32b585){_0x30724c[_0x953e('0x3f')]=_0x32b585;return _0x30724c;});}})[_0x953e('0x22')](respondWithFilteredResult(_0xb26acc,_0x1d2e27))['catch'](handleError(_0xb26acc,null));};
\ No newline at end of file
index c46fbb3..8d38772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','moment','request-promise'];(function(_0x1fe2c6,_0x1dfb55){var _0x12423d=function(_0x4f2da9){while(--_0x4f2da9){_0x1fe2c6['push'](_0x1fe2c6['shift']());}};_0x12423d(++_0x1dfb55);}(_0xf072,0x1cf));var _0x2f07=function(_0x3e0ef1,_0x2bcf8f){_0x3e0ef1=_0x3e0ef1-0x0;var _0x2f7942=_0xf072[_0x3e0ef1];return _0x2f7942;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var logger=require(_0x2f07('0x2'))('api');var moment=require(_0x2f07('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f07('0x4'));var fs=require('fs');var path=require(_0x2f07('0x5'));var rimraf=require(_0x2f07('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f07('0x7'));module[_0x2f07('0x8')]=function(_0x3643bb,_0x2e6422){return _0x3643bb[_0x2f07('0x9')](_0x2f07('0xa'),attributes,{'tableName':_0x2f07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa630=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','moment','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x2262ad,_0x2c9f44){_0x2262ad=_0x2262ad-0x0;var _0x4c90ac=_0xa630[_0x2262ad];return _0x4c90ac;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));module[_0x0a63('0x7')]=function(_0x37b4c9,_0x4b7474){return _0x37b4c9[_0x0a63('0x8')](_0x0a63('0x9'),attributes,{'tableName':_0x0a63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b874b18..34ec4d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf2=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment'];(function(_0x58d2dc,_0x2e5bbc){var _0x1edaa3=function(_0x3eda3d){while(--_0x3eda3d){_0x58d2dc['push'](_0x58d2dc['shift']());}};_0x1edaa3(++_0x2e5bbc);}(_0xcaf2,0x8a));var _0x2caf=function(_0x1194ad,_0x435140){_0x1194ad=_0x1194ad-0x0;var _0x5f374d=_0xcaf2[_0x1194ad];return _0x5f374d;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}
\ No newline at end of file
+var _0xffd6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xffd6,0x97));var _0x6ffd=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xffd6[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});}
\ No newline at end of file
index 40e15a5..b16c2e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23fe=['../../components/interaction/service','../../config/environment','./license.controller','get','isAuthenticated','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1652b7,_0xcd7dd5){var _0x54632e=function(_0x46b463){while(--_0x46b463){_0x1652b7['push'](_0x1652b7['shift']());}};_0x54632e(++_0xcd7dd5);}(_0x23fe,0x102));var _0xe23f=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x23fe[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0xe23f('0x0'));var util=require(_0xe23f('0x1'));var path=require('path');var timeout=require(_0xe23f('0x2'));var express=require(_0xe23f('0x3'));var router=express[_0xe23f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe23f('0x5'));var interaction=require(_0xe23f('0x6'));var config=require(_0xe23f('0x7'));var controller=require(_0xe23f('0x8'));router[_0xe23f('0x9')]('/',controller['index']);router['put']('/:id',auth[_0xe23f('0xa')](),controller['update']);module[_0xe23f('0xb')]=router;
\ No newline at end of file
+var _0xd484=['../../components/auth/service','./license.controller','get','index','/:id','isAuthenticated','update','exports','multer','util','path','express','fs-extra'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd484,0xff));var _0x4d48=function(_0x83f707,_0x5c6424){_0x83f707=_0x83f707-0x0;var _0x50e13f=_0xd484[_0x83f707];return _0x50e13f;};'use strict';var multer=require(_0x4d48('0x0'));var util=require(_0x4d48('0x1'));var path=require(_0x4d48('0x2'));var timeout=require('connect-timeout');var express=require(_0x4d48('0x3'));var router=express['Router']();var fs_extra=require(_0x4d48('0x4'));var auth=require(_0x4d48('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4d48('0x6'));router[_0x4d48('0x7')]('/',controller[_0x4d48('0x8')]);router['put'](_0x4d48('0x9'),auth[_0x4d48('0xa')](),controller[_0x4d48('0xb')]);module[_0x4d48('0xc')]=router;
\ No newline at end of file
index a6b4d3e..f7f9003 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02d2=['sequelize','TEXT','STRING','INTEGER'];(function(_0x2578dd,_0x19684e){var _0x53e73b=function(_0x1e94a7){while(--_0x1e94a7){_0x2578dd['push'](_0x2578dd['shift']());}};_0x53e73b(++_0x19684e);}(_0x02d2,0xe4));var _0x202d=function(_0x4dbf3e,_0x3c35da){_0x4dbf3e=_0x4dbf3e-0x0;var _0x213eca=_0x02d2[_0x4dbf3e];return _0x213eca;};'use strict';var Sequelize=require(_0x202d('0x0'));module['exports']={'license':{'type':Sequelize[_0x202d('0x1')]},'data1':{'type':Sequelize[_0x202d('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x202d('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xae2b=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x539ea6,_0x3698de){var _0x2bf16e=function(_0x3c4b61){while(--_0x3c4b61){_0x539ea6['push'](_0x539ea6['shift']());}};_0x2bf16e(++_0x3698de);}(_0xae2b,0xa8));var _0xbae2=function(_0x212efb,_0x9513eb){_0x212efb=_0x212efb-0x0;var _0x48d7e2=_0xae2b[_0x212efb];return _0x48d7e2;};'use strict';var Sequelize=require(_0xbae2('0x0'));module[_0xbae2('0x1')]={'license':{'type':Sequelize[_0xbae2('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xbae2('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xbae2('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 581a970..28f1f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['query','filters','intersection','attributes','merge','getLicense','body','find','params','key','catch','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','model','keys','License'];(function(_0x16f4df,_0x370d4b){var _0x179a0a=function(_0x5b0aa8){while(--_0x5b0aa8){_0x16f4df['push'](_0x16f4df['shift']());}};_0x179a0a(++_0x370d4b);}(_0xadb5,0xad));var _0x5adb=function(_0x1511b7,_0x50758f){_0x1511b7=_0x1511b7-0x0;var _0x37df8b=_0xadb5[_0x1511b7];return _0x37df8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}var utilLicense=require(_0x5adb('0x17'));exports['index']=function(_0x49992e,_0x5d457e){var _0x39bddd={'raw':!![],'where':{'id':0x1}},_0x1eac55={};_0x1eac55[_0x5adb('0x28')]=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes']);_0x1eac55[_0x5adb('0x2b')]=_[_0x5adb('0x29')](_0x49992e[_0x5adb('0x2b')]);_0x1eac55[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0x1eac55[_0x5adb('0x28')],_0x1eac55[_0x5adb('0x2b')]);_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x2d')](_0x1eac55[_0x5adb('0x28')],qs['fields'](_0x49992e[_0x5adb('0x2b')]['fields']));_0x39bddd[_0x5adb('0x2e')]=_0x39bddd[_0x5adb('0x2e')]['length']?_0x39bddd[_0x5adb('0x2e')]:_0x1eac55[_0x5adb('0x28')];_0x39bddd=_[_0x5adb('0x2f')]({},_0x39bddd,_0x49992e['options']);return utilLicense[_0x5adb('0x30')](_0x39bddd)[_0x5adb('0x22')](respondWithResult(_0x5d457e,null))['catch'](handleError(_0x5d457e,null));};exports['update']=function(_0x1ed9ea,_0x49dd03){if(_0x1ed9ea[_0x5adb('0x31')]['id']){delete _0x1ed9ea[_0x5adb('0x31')]['id'];}return db[_0x5adb('0x2a')][_0x5adb('0x32')]({'where':{'id':_0x1ed9ea[_0x5adb('0x33')]['id']}})['then'](handleEntityNotFound(_0x49dd03,null))[_0x5adb('0x22')](function(_0x215b88){var _0x1c3a5c=_0x215b88['get']({'plain':!![]});return utilLicense['checkLicense'](_0x1c3a5c,_0x1ed9ea[_0x5adb('0x31')][_0x5adb('0x34')]);})['then'](function(_0x2355bc){if(!_0x2355bc['demo']){return saveUpdates(_0x1ed9ea[_0x5adb('0x31')],null);}return _0x2355bc;})['then'](respondWithResult(_0x49dd03,null))[_0x5adb('0x35')](handleError(_0x49dd03,null));};
\ No newline at end of file
+var _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x5c773b,_0x2e445d){var _0x2c2f92=function(_0x55952a){while(--_0x55952a){_0x5c773b['push'](_0x5c773b['shift']());}};_0x2c2f92(++_0x2e445d);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b19db,_0x2abd3c){_0x2b19db=_0x2b19db-0x0;var _0x134739=_0x2ef3[_0x2b19db];return _0x134739;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));};
\ No newline at end of file
index bf34fee..a76e359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22a9=['request-promise','path','rimraf','../../config/environment','exports','License','license','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x22a9,0x17b));var _0x922a=function(_0x43b3b4,_0x3a4c3f){_0x43b3b4=_0x43b3b4-0x0;var _0x2c61c9=_0x22a9[_0x43b3b4];return _0x2c61c9;};'use strict';var _=require(_0x922a('0x0'));var util=require('util');var logger=require(_0x922a('0x1'))(_0x922a('0x2'));var moment=require(_0x922a('0x3'));var BPromise=require(_0x922a('0x4'));var rp=require(_0x922a('0x5'));var fs=require('fs');var path=require(_0x922a('0x6'));var rimraf=require(_0x922a('0x7'));var config=require(_0x922a('0x8'));var attributes=require('./license.attributes');module[_0x922a('0x9')]=function(_0x3ae2f9,_0x2b4b63){return _0x3ae2f9['define'](_0x922a('0xa'),attributes,{'tableName':_0x922a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc0f=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','define','License','license'];(function(_0x45a7c8,_0x360eac){var _0x255ca5=function(_0x2c4e2d){while(--_0x2c4e2d){_0x45a7c8['push'](_0x45a7c8['shift']());}};_0x255ca5(++_0x360eac);}(_0xbc0f,0x1a0));var _0xfbc0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbc0f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xfbc0('0x0'));var logger=require(_0xfbc0('0x1'))(_0xfbc0('0x2'));var moment=require(_0xfbc0('0x3'));var BPromise=require(_0xfbc0('0x4'));var rp=require(_0xfbc0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbc0('0x6'));var config=require(_0xfbc0('0x7'));var attributes=require(_0xfbc0('0x8'));module[_0xfbc0('0x9')]=function(_0x9c2cf7,_0x5d96b3){return _0x9c2cf7[_0xfbc0('0xa')](_0xfbc0('0xb'),attributes,{'tableName':_0xfbc0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7777487..13a66f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x009f=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x41f3c8,_0x5976b4){var _0x58d4f7=function(_0x325cc8){while(--_0x325cc8){_0x41f3c8['push'](_0x41f3c8['shift']());}};_0x58d4f7(++_0x5976b4);}(_0x009f,0x1e2));var _0xf009=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0x009f[_0x49cb71];return _0x3a50fd;};'use strict';var _=require(_0xf009('0x0'));var util=require(_0xf009('0x1'));var moment=require(_0xf009('0x2'));var BPromise=require(_0xf009('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf009('0x4'));var db=require(_0xf009('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf009('0x6'))(_0xf009('0x7'));var config=require(_0xf009('0x8'));var jayson=require(_0xf009('0x9'));var client=jayson[_0xf009('0xa')][_0xf009('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52f2fa,_0x92eddd,_0x3b51e4){return new BPromise(function(_0x5a4a30,_0x2096e7){return client[_0xf009('0xc')](_0x52f2fa,_0x3b51e4)[_0xf009('0xd')](function(_0x1b990a){logger[_0xf009('0xe')](_0xf009('0xf'),_0x92eddd,_0xf009('0x10'));logger[_0xf009('0x11')](_0xf009('0x12'),_0x92eddd,_0xf009('0x10'),JSON[_0xf009('0x13')](_0x1b990a));if(_0x1b990a['error']){if(_0x1b990a[_0xf009('0x14')][_0xf009('0x15')]===0x1f4){logger['error'](_0xf009('0xf'),_0x92eddd,_0x1b990a[_0xf009('0x14')]['message']);return _0x2096e7(_0x1b990a[_0xf009('0x14')][_0xf009('0x16')]);}logger[_0xf009('0x14')](_0xf009('0xf'),_0x92eddd,_0x1b990a[_0xf009('0x14')][_0xf009('0x16')]);return _0x5a4a30(_0x1b990a[_0xf009('0x14')][_0xf009('0x16')]);}else{logger[_0xf009('0xe')](_0xf009('0xf'),_0x92eddd,_0xf009('0x10'));_0x5a4a30(_0x1b990a['result'][_0xf009('0x16')]);}})[_0xf009('0x17')](function(_0x1ffe65){logger[_0xf009('0x14')]('License,\x20%s,\x20%s',_0x92eddd,_0x1ffe65);_0x2096e7(_0x1ffe65);});});}
\ No newline at end of file
+var _0xde7b=['request','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc65ae2,_0x53119a){var _0x2432ea=function(_0x3f70f3){while(--_0x3f70f3){_0xc65ae2['push'](_0xc65ae2['shift']());}};_0x2432ea(++_0x53119a);}(_0xde7b,0x16a));var _0xbde7=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xde7b[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xbde7('0x0'));var util=require(_0xbde7('0x1'));var moment=require('moment');var BPromise=require(_0xbde7('0x2'));var rs=require(_0xbde7('0x3'));var fs=require('fs');var Redis=require(_0xbde7('0x4'));var db=require(_0xbde7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde7('0x6'))(_0xbde7('0x7'));var config=require(_0xbde7('0x8'));var jayson=require(_0xbde7('0x9'));var client=jayson[_0xbde7('0xa')][_0xbde7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e9a70,_0x1c61a2,_0x2d97b5){return new BPromise(function(_0xf4382f,_0x1183a1){return client[_0xbde7('0xc')](_0x1e9a70,_0x2d97b5)['then'](function(_0x387065){logger[_0xbde7('0xd')](_0xbde7('0xe'),_0x1c61a2,_0xbde7('0xf'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x1c61a2,'request\x20sent',JSON[_0xbde7('0x10')](_0x387065));if(_0x387065[_0xbde7('0x11')]){if(_0x387065['error'][_0xbde7('0x12')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x1c61a2,_0x387065[_0xbde7('0x11')][_0xbde7('0x13')]);return _0x1183a1(_0x387065['error'][_0xbde7('0x13')]);}logger['error'](_0xbde7('0xe'),_0x1c61a2,_0x387065[_0xbde7('0x11')][_0xbde7('0x13')]);return _0xf4382f(_0x387065[_0xbde7('0x11')][_0xbde7('0x13')]);}else{logger[_0xbde7('0xd')]('License,\x20%s,\x20%s',_0x1c61a2,_0xbde7('0xf'));_0xf4382f(_0x387065[_0xbde7('0x14')][_0xbde7('0x13')]);}})[_0xbde7('0x15')](function(_0x176366){logger[_0xbde7('0x11')](_0xbde7('0xe'),_0x1c61a2,_0x176366);_0x1183a1(_0x176366);});});}
\ No newline at end of file
index 5aa1153..087670c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c50=['post','/:id/dispositions','addDisposition','create','addImap','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','/:id/users','getAgents'];(function(_0x2e1c9c,_0x4a94a2){var _0x31ab33=function(_0x594dca){while(--_0x594dca){_0x2e1c9c['push'](_0x2e1c9c['shift']());}};_0x31ab33(++_0x4a94a2);}(_0x3c50,0x94));var _0x03c5=function(_0x4c6a73,_0x5ab45c){_0x4c6a73=_0x4c6a73-0x0;var _0x42170f=_0x3c50[_0x4c6a73];return _0x42170f;};'use strict';var multer=require(_0x03c5('0x0'));var util=require('util');var path=require(_0x03c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x03c5('0x2'));var auth=require(_0x03c5('0x3'));var interaction=require(_0x03c5('0x4'));var config=require(_0x03c5('0x5'));var controller=require(_0x03c5('0x6'));router[_0x03c5('0x7')]('/',auth['isAuthenticated'](),controller[_0x03c5('0x8')]);router[_0x03c5('0x7')](_0x03c5('0x9'),auth[_0x03c5('0xa')](),controller[_0x03c5('0xb')]);router[_0x03c5('0x7')](_0x03c5('0xc'),auth[_0x03c5('0xa')](),controller[_0x03c5('0xd')]);router[_0x03c5('0x7')]('/:id/dispositions',auth[_0x03c5('0xa')](),controller[_0x03c5('0xe')]);router[_0x03c5('0x7')](_0x03c5('0xf'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x10')]);router[_0x03c5('0x7')](_0x03c5('0x11'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x12')]);router[_0x03c5('0x7')](_0x03c5('0x13'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x14')]);router['get'](_0x03c5('0x15'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x16')]);router[_0x03c5('0x7')](_0x03c5('0x17'),auth[_0x03c5('0xa')](),controller['getApplications']);router[_0x03c5('0x7')](_0x03c5('0x18'),auth[_0x03c5('0xa')](),controller['getMessages']);router[_0x03c5('0x7')](_0x03c5('0x19'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x03c5('0x7')](_0x03c5('0x1a'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x1b')]);router[_0x03c5('0x1c')](_0x03c5('0x1d'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x1e')]);router[_0x03c5('0x1c')](_0x03c5('0xf'),auth[_0x03c5('0xa')](),controller['addAnswer']);router[_0x03c5('0x1c')]('/',auth[_0x03c5('0xa')](),controller[_0x03c5('0x1f')]);router[_0x03c5('0x1c')](_0x03c5('0x11'),auth['isAuthenticated'](),controller[_0x03c5('0x20')]);router[_0x03c5('0x1c')](_0x03c5('0x13'),auth[_0x03c5('0xa')](),controller['addSmtp']);router[_0x03c5('0x1c')](_0x03c5('0x15'),auth['isAuthenticated'](),controller[_0x03c5('0x21')]);router[_0x03c5('0x1c')](_0x03c5('0x17'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x22')]);router[_0x03c5('0x1c')](_0x03c5('0x23'),auth[_0x03c5('0xa')](),controller['send']);router[_0x03c5('0x1c')](_0x03c5('0x1a'),auth['isAuthenticated'](),controller[_0x03c5('0x24')]);router['put'](_0x03c5('0xc'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x25')]);router[_0x03c5('0x26')](_0x03c5('0x1d'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x27')]);router[_0x03c5('0x26')]('/:id/canned_answers',auth[_0x03c5('0xa')](),controller[_0x03c5('0x28')]);router[_0x03c5('0x26')](_0x03c5('0x11'),auth['isAuthenticated'](),controller[_0x03c5('0x29')]);router['delete'](_0x03c5('0x13'),auth[_0x03c5('0xa')](),controller[_0x03c5('0x2a')]);router[_0x03c5('0x26')](_0x03c5('0xc'),auth[_0x03c5('0xa')](),controller['destroy']);router[_0x03c5('0x26')](_0x03c5('0x1a'),auth[_0x03c5('0xa')](),controller['removeAgents']);module[_0x03c5('0x2b')]=router;
\ No newline at end of file
+var _0xdccc=['index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','/:id/canned_answers','addAnswer','create','addSmtp','addInteraction','/:id/send','send','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x33d53c,_0x4bc8de){var _0x1d633f=function(_0x50278e){while(--_0x50278e){_0x33d53c['push'](_0x33d53c['shift']());}};_0x1d633f(++_0x4bc8de);}(_0xdccc,0x139));var _0xcdcc=function(_0x123348,_0x4e9a62){_0x123348=_0x123348-0x0;var _0x5afa04=_0xdccc[_0x123348];return _0x5afa04;};'use strict';var multer=require(_0xcdcc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcdcc('0x1'));var express=require(_0xcdcc('0x2'));var router=express[_0xcdcc('0x3')]();var fs_extra=require(_0xcdcc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcdcc('0x5'));var config=require(_0xcdcc('0x6'));var controller=require('./mailAccount.controller');router[_0xcdcc('0x7')]('/',auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x9')]);router[_0xcdcc('0x7')](_0xcdcc('0xa'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0xb')]);router[_0xcdcc('0x7')](_0xcdcc('0xc'),auth[_0xcdcc('0x8')](),controller['show']);router[_0xcdcc('0x7')](_0xcdcc('0xd'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0xe')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xcdcc('0x7')](_0xcdcc('0xf'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x10')]);router['get'](_0xcdcc('0x11'),auth['isAuthenticated'](),controller[_0xcdcc('0x12')]);router[_0xcdcc('0x7')](_0xcdcc('0x13'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x14')]);router[_0xcdcc('0x7')](_0xcdcc('0x15'),auth[_0xcdcc('0x8')](),controller['getApplications']);router[_0xcdcc('0x7')](_0xcdcc('0x16'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x17')]);router[_0xcdcc('0x7')](_0xcdcc('0x18'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x19')]);router['get']('/:id/users',auth[_0xcdcc('0x8')](),controller['getAgents']);router[_0xcdcc('0x1a')](_0xcdcc('0xd'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x1b')]);router[_0xcdcc('0x1a')](_0xcdcc('0x1c'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x1d')]);router[_0xcdcc('0x1a')]('/',auth['isAuthenticated'](),controller[_0xcdcc('0x1e')]);router[_0xcdcc('0x1a')](_0xcdcc('0xf'),auth[_0xcdcc('0x8')](),controller['addImap']);router[_0xcdcc('0x1a')]('/:id/out_servers',auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x1f')]);router[_0xcdcc('0x1a')](_0xcdcc('0x13'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x20')]);router[_0xcdcc('0x1a')](_0xcdcc('0x15'),auth[_0xcdcc('0x8')](),controller['addApplications']);router[_0xcdcc('0x1a')](_0xcdcc('0x21'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x22')]);router[_0xcdcc('0x1a')](_0xcdcc('0x23'),auth['isAuthenticated'](),controller[_0xcdcc('0x24')]);router[_0xcdcc('0x25')](_0xcdcc('0xc'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x26')]);router[_0xcdcc('0x27')](_0xcdcc('0xd'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x28')]);router[_0xcdcc('0x27')](_0xcdcc('0x1c'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x29')]);router['delete'](_0xcdcc('0xf'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x2a')]);router[_0xcdcc('0x27')](_0xcdcc('0x11'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0xcdcc('0x27')](_0xcdcc('0xc'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x2b')]);router[_0xcdcc('0x27')](_0xcdcc('0x23'),auth[_0xcdcc('0x8')](),controller[_0xcdcc('0x2c')]);module[_0xcdcc('0x2d')]=router;
\ No newline at end of file
index 7bc05da..f07f498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf452=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0xca718d,_0x3ee019){var _0x999025=function(_0x53233e){while(--_0x53233e){_0xca718d['push'](_0xca718d['shift']());}};_0x999025(++_0x3ee019);}(_0xf452,0x13b));var _0x2f45=function(_0x5cd9c6,_0xd68ded){_0x5cd9c6=_0x5cd9c6-0x0;var _0x31ac15=_0xf452[_0x5cd9c6];return _0x31ac15;};'use strict';var Sequelize=require(_0x2f45('0x0'));module[_0x2f45('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2f45('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2f45('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x2f45('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x2f45('0x4')]},'markAsUnread':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2f45('0x2')],'allowNull':![],'defaultValue':_0x2f45('0x5')},'fontSize':{'type':Sequelize[_0x2f45('0x6')](0x2)[_0x2f45('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2f45('0x4')],'defaultValue':function(){return _0x2f45('0x8');}},'notificationSound':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2f45('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2f45('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2f45('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2f45('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x2f45('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1dc74f){if(!_0x1dc74f)this[_0x2f45('0xa')](_0x2f45('0xb'),null);this[_0x2f45('0xa')](_0x2f45('0xc'),_0x1dc74f);}}};
\ No newline at end of file
+var _0x1e69=['mandatoryDispositionPauseId','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e69,0x85));var _0x91e6=function(_0x29c934,_0x3c30e2){_0x29c934=_0x29c934-0x0;var _0x4302de=_0x1e69[_0x29c934];return _0x4302de;};'use strict';var Sequelize=require('sequelize');module[_0x91e6('0x0')]={'description':{'type':Sequelize[_0x91e6('0x1')]},'name':{'type':Sequelize[_0x91e6('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x91e6('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x91e6('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x91e6('0x3')]},'markAsUnread':{'type':Sequelize[_0x91e6('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x91e6('0x1')],'allowNull':![],'defaultValue':_0x91e6('0x4')},'fontSize':{'type':Sequelize[_0x91e6('0x5')](0x2)[_0x91e6('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x91e6('0x3')],'defaultValue':function(){return _0x91e6('0x7');}},'notificationSound':{'type':Sequelize[_0x91e6('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x91e6('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x91e6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x91e6('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x91e6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x91e6('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x91e6('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x91e6('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x159280){if(!_0x159280)this[_0x91e6('0x9')](_0x91e6('0xa'),null);this[_0x91e6('0x9')]('mandatoryDisposition',_0x159280);}}};
\ No newline at end of file
index 8eec79a..c19efb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaff=['end','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','get','MailAccounts','stack','name','send','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','keys','intersection','model','attributes','fields','length','query','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','MailAccount','findAll','show','params','Imap','MailServerOut','includeAll','include','find','body','describe','addDisposition','Disposition','create','findOne','MailAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','email','ListId','isNil','active','description','cauthentication','user','cuser','password','pass','cpassword','host','port','cservice','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','omit','Contact','User','Owner','fullname','internal','Tags','color','tag','MailInteraction','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','List','Contacts','updatedAt','attachments','join','basename','service','authentication','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','messageId','from','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','sendStatus','status'];(function(_0x85aaeb,_0x24dfdf){var _0x17f3ae=function(_0x44bcd5){while(--_0x44bcd5){_0x85aaeb['push'](_0x85aaeb['shift']());}};_0x17f3ae(++_0x24dfdf);}(_0xcaff,0x96));var _0xfcaf=function(_0x18a747,_0x585174){_0x18a747=_0x18a747-0x0;var _0x53a9de=_0xcaff[_0x18a747];return _0x53a9de;};'use strict';var emlformat=require(_0xfcaf('0x0'));var rimraf=require(_0xfcaf('0x1'));var zipdir=require(_0xfcaf('0x2'));var jsonpatch=require(_0xfcaf('0x3'));var rp=require(_0xfcaf('0x4'));var moment=require(_0xfcaf('0x5'));var BPromise=require(_0xfcaf('0x6'));var Mustache=require(_0xfcaf('0x7'));var util=require(_0xfcaf('0x8'));var path=require(_0xfcaf('0x9'));var sox=require(_0xfcaf('0xa'));var csv=require(_0xfcaf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcaf('0xc'));var _=require(_0xfcaf('0xd'));var squel=require(_0xfcaf('0xe'));var crypto=require(_0xfcaf('0xf'));var jsforce=require(_0xfcaf('0x10'));var deskjs=require(_0xfcaf('0x11'));var toCsv=require(_0xfcaf('0xb'));var querystring=require(_0xfcaf('0x12'));var Papa=require(_0xfcaf('0x13'));var htmlToText=require('html-to-text');var juice=require(_0xfcaf('0x14'));var Redis=require(_0xfcaf('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xfcaf('0x16'));var as=require(_0xfcaf('0x17'));var hardwareService=require(_0xfcaf('0x18'));var logger=require(_0xfcaf('0x19'))('api');var utils=require(_0xfcaf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfcaf('0x1b')]=_[_0xfcaf('0x1c')](config[_0xfcaf('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcaf('0x1d'))(new Redis(config[_0xfcaf('0x1b')]));require(_0xfcaf('0x1e'))[_0xfcaf('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfcaf('0x20')][_0xfcaf('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x18171a,_0x1d15b5,_0x1602ab,_0x1c856f){return new BPromise(function(_0x11a756,_0x2751ed){var _0x40464d=_0x1c856f||client;return _0x40464d[_0xfcaf('0x22')](_0x18171a,_0x1602ab)[_0xfcaf('0x23')](function(_0x2eae4b){logger[_0xfcaf('0x24')]('MailAccount,\x20%s,\x20%s',_0x1d15b5,_0xfcaf('0x25'));logger[_0xfcaf('0x26')](_0xfcaf('0x27'),_0x1d15b5,'request\x20sent',JSON[_0xfcaf('0x28')](_0x2eae4b));if(_0x2eae4b[_0xfcaf('0x29')]){if(_0x2eae4b['error'][_0xfcaf('0x2a')]===0x1f4){logger['error'](_0xfcaf('0x2b'),_0x1d15b5,_0x2eae4b[_0xfcaf('0x29')][_0xfcaf('0x2c')]);return _0x2751ed(_0x2eae4b[_0xfcaf('0x29')][_0xfcaf('0x2c')]);}logger['error'](_0xfcaf('0x2b'),_0x1d15b5,_0x2eae4b['error'][_0xfcaf('0x2c')]);return _0x11a756(_0x2eae4b[_0xfcaf('0x29')][_0xfcaf('0x2c')]);}else{logger[_0xfcaf('0x24')](_0xfcaf('0x2b'),_0x1d15b5,_0xfcaf('0x25'));_0x11a756(_0x2eae4b['result']['message']);}})[_0xfcaf('0x2d')](function(_0x39c250){logger['error']('MailAccount,\x20%s,\x20%s',_0x1d15b5,_0x39c250);_0x2751ed(_0x39c250);});});}function respondWithStatusCode(_0x40bfeb,_0xc845e8){_0xc845e8=_0xc845e8||0xcc;return function(_0x82455d){if(_0x82455d){return _0x40bfeb[_0xfcaf('0x2e')](_0xc845e8);}return _0x40bfeb[_0xfcaf('0x2f')](_0xc845e8)[_0xfcaf('0x30')]();};}function respondWithResult(_0x376970,_0x483aab){_0x483aab=_0x483aab||0xc8;return function(_0x1c5015){if(_0x1c5015){return _0x376970[_0xfcaf('0x2f')](_0x483aab)[_0xfcaf('0x31')](_0x1c5015);}};}function respondWithFilteredResult(_0x5d63dc,_0x443be2){return function(_0x282b42){if(_0x282b42){var _0xa2c451=typeof _0x443be2['offset']===_0xfcaf('0x32')&&typeof _0x443be2[_0xfcaf('0x33')]===_0xfcaf('0x32');var _0x541d2d=_0x282b42['count'];var _0x2ccae4=_0xa2c451?0x0:_0x443be2[_0xfcaf('0x34')];var _0x30dacb=_0xa2c451?_0x282b42[_0xfcaf('0x35')]:_0x443be2[_0xfcaf('0x34')]+_0x443be2[_0xfcaf('0x33')];var _0x5d22b5;if(_0x30dacb>=_0x541d2d){_0x30dacb=_0x541d2d;_0x5d22b5=0xc8;}else{_0x5d22b5=0xce;}_0x5d63dc[_0xfcaf('0x2f')](_0x5d22b5);return _0x5d63dc[_0xfcaf('0x36')]('Content-Range',_0x2ccae4+'-'+_0x30dacb+'/'+_0x541d2d)[_0xfcaf('0x31')](_0x282b42);}return null;};}function patchUpdates(_0x16390e){return function(_0x4fbe8a){try{jsonpatch[_0xfcaf('0x37')](_0x4fbe8a,_0x16390e,!![]);}catch(_0x114b8d){return BPromise[_0xfcaf('0x38')](_0x114b8d);}return _0x4fbe8a[_0xfcaf('0x39')]();};}function saveUpdates(_0x3c19ed,_0x119264){return function(_0x8abb09){if(_0x8abb09){return _0x8abb09[_0xfcaf('0x3a')](_0x3c19ed)['then'](function(_0x5b807a){return _0x5b807a;});}return null;};}function removeEntity(_0xb4d663,_0x56a39c){return function(_0x2063ec){if(_0x2063ec){return _0x2063ec[_0xfcaf('0x3b')]()['then'](function(){var _0x166594=_0x2063ec[_0xfcaf('0x3c')]({'plain':!![]});var _0xd3904a=_0xfcaf('0x3d');return db['UserProfileResource'][_0xfcaf('0x3b')]({'where':{'type':_0xd3904a,'resourceId':_0x166594['id']}})[_0xfcaf('0x23')](function(){return _0x2063ec;});})['then'](function(){_0xb4d663['status'](0xcc)[_0xfcaf('0x30')]();});}};}function handleEntityNotFound(_0x31f439,_0x515c37){return function(_0x44c4de){if(!_0x44c4de){_0x31f439['sendStatus'](0x194);}return _0x44c4de;};}function handleError(_0x4779cf,_0x8ab82){_0x8ab82=_0x8ab82||0x1f4;return function(_0x54350a){logger[_0xfcaf('0x29')](_0x54350a[_0xfcaf('0x3e')]);if(_0x54350a[_0xfcaf('0x3f')]){delete _0x54350a[_0xfcaf('0x3f')];}_0x4779cf['status'](_0x8ab82)[_0xfcaf('0x40')](_0x54350a);};}exports[_0xfcaf('0x41')]=function(_0x33fa6f,_0x411c42){var _0x1249f7={'include':[{'model':db[_0xfcaf('0x42')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xfcaf('0x43')},{'model':db[_0xfcaf('0x44')],'as':_0xfcaf('0x45')}]},_0x83af1a={},_0x374224={'count':0x0,'rows':[]};var _0x202378=_[_0xfcaf('0x46')](db['MailAccount'][_0xfcaf('0x47')],function(_0x11a697){return{'name':_0x11a697[_0xfcaf('0x48')],'type':_0x11a697[_0xfcaf('0x49')][_0xfcaf('0x4a')]};});_0x83af1a['model']=_[_0xfcaf('0x46')](_0x202378,_0xfcaf('0x3f'));_0x83af1a['query']=_[_0xfcaf('0x4b')](_0x33fa6f['query']);_0x83af1a['filters']=_[_0xfcaf('0x4c')](_0x83af1a[_0xfcaf('0x4d')],_0x83af1a['query']);_0x1249f7[_0xfcaf('0x4e')]=_[_0xfcaf('0x4c')](_0x83af1a['model'],qs[_0xfcaf('0x4f')](_0x33fa6f['query'][_0xfcaf('0x4f')]));_0x1249f7[_0xfcaf('0x4e')]=_0x1249f7[_0xfcaf('0x4e')][_0xfcaf('0x50')]?_0x1249f7[_0xfcaf('0x4e')]:_0x83af1a['model'];if(!_0x33fa6f[_0xfcaf('0x51')][_0xfcaf('0x52')]('nolimit')){_0x1249f7[_0xfcaf('0x33')]=qs[_0xfcaf('0x33')](_0x33fa6f[_0xfcaf('0x51')]['limit']);_0x1249f7[_0xfcaf('0x34')]=qs[_0xfcaf('0x34')](_0x33fa6f['query'][_0xfcaf('0x34')]);}_0x1249f7[_0xfcaf('0x53')]=qs[_0xfcaf('0x54')](_0x33fa6f[_0xfcaf('0x51')]['sort']);_0x1249f7['where']=qs['filters'](_[_0xfcaf('0x55')](_0x33fa6f['query'],_0x83af1a[_0xfcaf('0x56')]),_0x202378);if(_0x33fa6f[_0xfcaf('0x51')][_0xfcaf('0x57')]){_0x1249f7[_0xfcaf('0x58')]=_[_0xfcaf('0x59')](_0x1249f7[_0xfcaf('0x58')],{'$or':_[_0xfcaf('0x46')](_0x202378,function(_0x288a7b){if(_0x288a7b[_0xfcaf('0x49')]!==_0xfcaf('0x5a')){var _0x44b247={};_0x44b247[_0x288a7b[_0xfcaf('0x3f')]]={'$like':'%'+_0x33fa6f[_0xfcaf('0x51')][_0xfcaf('0x57')]+'%'};return _0x44b247;}})});}_0x1249f7=_[_0xfcaf('0x59')]({},_0x1249f7,_0x33fa6f[_0xfcaf('0x5b')]);var _0x487401={'where':_0x1249f7['where']};return db[_0xfcaf('0x5c')]['count'](_0x487401)['then'](function(_0x4e6c8b){_0x374224['count']=_0x4e6c8b;if(_0x33fa6f['query']['includeAll']){_0x1249f7['include']=[{'all':!![]}];}return db[_0xfcaf('0x5c')][_0xfcaf('0x5d')](_0x1249f7);})[_0xfcaf('0x23')](function(_0x1d1c17){_0x374224['rows']=_0x1d1c17;return _0x374224;})[_0xfcaf('0x23')](respondWithFilteredResult(_0x411c42,_0x1249f7))[_0xfcaf('0x2d')](handleError(_0x411c42,null));};exports[_0xfcaf('0x5e')]=function(_0x57a745,_0xba4252){var _0x3e4bdc={'raw':![],'where':{'id':_0x57a745[_0xfcaf('0x5f')]['id']},'include':[{'model':db[_0xfcaf('0x42')],'as':_0xfcaf('0x60')},{'model':db[_0xfcaf('0x61')],'as':_0xfcaf('0x43')},{'model':db[_0xfcaf('0x44')],'as':_0xfcaf('0x45')}]},_0x5204b9={};_0x5204b9['model']=_[_0xfcaf('0x4b')](db['MailAccount'][_0xfcaf('0x47')]);_0x5204b9[_0xfcaf('0x51')]=_[_0xfcaf('0x4b')](_0x57a745[_0xfcaf('0x51')]);_0x5204b9[_0xfcaf('0x56')]=_[_0xfcaf('0x4c')](_0x5204b9[_0xfcaf('0x4d')],_0x5204b9['query']);_0x3e4bdc['attributes']=_[_0xfcaf('0x4c')](_0x5204b9[_0xfcaf('0x4d')],qs[_0xfcaf('0x4f')](_0x57a745[_0xfcaf('0x51')][_0xfcaf('0x4f')]));_0x3e4bdc['attributes']=_0x3e4bdc[_0xfcaf('0x4e')][_0xfcaf('0x50')]?_0x3e4bdc[_0xfcaf('0x4e')]:_0x5204b9[_0xfcaf('0x4d')];if(_0x57a745['query'][_0xfcaf('0x62')]){_0x3e4bdc[_0xfcaf('0x63')]=[{'all':!![]}];}_0x3e4bdc=_['merge']({},_0x3e4bdc,_0x57a745[_0xfcaf('0x5b')]);return db[_0xfcaf('0x5c')][_0xfcaf('0x64')](_0x3e4bdc)[_0xfcaf('0x23')](handleEntityNotFound(_0xba4252,null))[_0xfcaf('0x23')](respondWithResult(_0xba4252,null))[_0xfcaf('0x2d')](handleError(_0xba4252,null));};exports[_0xfcaf('0x3a')]=function(_0x1389be,_0x6c7547){if(_0x1389be['body']['id']){delete _0x1389be['body']['id'];}return db[_0xfcaf('0x5c')]['find']({'where':{'id':_0x1389be['params']['id']},'include':[{'model':db[_0xfcaf('0x42')],'as':'Imap'},{'model':db[_0xfcaf('0x61')],'as':_0xfcaf('0x43')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xfcaf('0x23')](handleEntityNotFound(_0x6c7547,null))[_0xfcaf('0x23')](saveUpdates(_0x1389be[_0xfcaf('0x65')],null))[_0xfcaf('0x23')](function(_0x4c304e){if(_0x4c304e&&_0x1389be[_0xfcaf('0x65')]['Imap']){return db[_0xfcaf('0x42')]['update'](_0x1389be[_0xfcaf('0x65')]['Imap'],{'where':{'MailAccountId':_0x4c304e['id']}})[_0xfcaf('0x23')](function(){return _0x4c304e;});}return _0x4c304e;})[_0xfcaf('0x23')](function(_0x59fc76){if(_0x59fc76&&_0x1389be[_0xfcaf('0x65')][_0xfcaf('0x43')]){return db[_0xfcaf('0x61')][_0xfcaf('0x3a')](_0x1389be[_0xfcaf('0x65')][_0xfcaf('0x43')],{'where':{'MailAccountId':_0x59fc76['id']}})[_0xfcaf('0x23')](function(){return _0x59fc76;});}return _0x59fc76;})[_0xfcaf('0x23')](respondWithResult(_0x6c7547,null))['catch'](handleError(_0x6c7547,null));};exports['describe']=function(_0x4e890e,_0x38688f){return db['MailAccount'][_0xfcaf('0x66')]()['then'](respondWithResult(_0x38688f,null))['catch'](handleError(_0x38688f,null));};exports[_0xfcaf('0x67')]=function(_0x4119d6,_0x35851f,_0x1dc0f8){if(_0x4119d6[_0xfcaf('0x65')]['id']){delete _0x4119d6[_0xfcaf('0x65')]['id'];}return db[_0xfcaf('0x5c')][_0xfcaf('0x64')]({'where':{'id':_0x4119d6['params']['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x35851f,null))[_0xfcaf('0x23')](function(_0x3d9c18){if(_0x3d9c18){_0x4119d6[_0xfcaf('0x65')]['MailAccountId']=_0x3d9c18['id'];return db[_0xfcaf('0x68')][_0xfcaf('0x69')](_0x4119d6[_0xfcaf('0x65')]);}})['then'](respondWithResult(_0x35851f,null))[_0xfcaf('0x2d')](handleError(_0x35851f,null));};exports['getDispositions']=function(_0x564b31,_0x288e4,_0x102faa){var _0x37f2a6={'raw':![],'where':{}};var _0x2f52ef={};var _0x2d94d6={'count':0x0,'rows':[]};return db['MailAccount'][_0xfcaf('0x6a')]({'where':{'id':_0x564b31['params']['id']}})['then'](handleEntityNotFound(_0x288e4,null))[_0xfcaf('0x23')](function(_0x4d5ee9){if(_0x4d5ee9){_0x2f52ef[_0xfcaf('0x4d')]=_[_0xfcaf('0x4b')](db[_0xfcaf('0x68')][_0xfcaf('0x47')]);_0x2f52ef[_0xfcaf('0x51')]=_[_0xfcaf('0x4b')](_0x564b31['query']);_0x2f52ef[_0xfcaf('0x56')]=_[_0xfcaf('0x4c')](_0x2f52ef[_0xfcaf('0x4d')],_0x2f52ef['query']);_0x37f2a6[_0xfcaf('0x4e')]=_[_0xfcaf('0x4c')](_0x2f52ef[_0xfcaf('0x4d')],qs[_0xfcaf('0x4f')](_0x564b31[_0xfcaf('0x51')][_0xfcaf('0x4f')]));_0x37f2a6[_0xfcaf('0x4e')]=_0x37f2a6[_0xfcaf('0x4e')]['length']?_0x37f2a6['attributes']:_0x2f52ef[_0xfcaf('0x4d')];if(!_0x564b31[_0xfcaf('0x51')][_0xfcaf('0x52')]('nolimit')){_0x37f2a6[_0xfcaf('0x33')]=qs['limit'](_0x564b31['query'][_0xfcaf('0x33')]);_0x37f2a6[_0xfcaf('0x34')]=qs[_0xfcaf('0x34')](_0x564b31[_0xfcaf('0x51')][_0xfcaf('0x34')]);}_0x37f2a6[_0xfcaf('0x53')]=qs[_0xfcaf('0x54')](_0x564b31[_0xfcaf('0x51')][_0xfcaf('0x54')]);_0x37f2a6[_0xfcaf('0x58')]=qs[_0xfcaf('0x56')](_[_0xfcaf('0x55')](_0x564b31[_0xfcaf('0x51')],_0x2f52ef[_0xfcaf('0x56')]));_0x37f2a6['where'][_0xfcaf('0x6b')]=_0x4d5ee9['id'];if(_0x564b31[_0xfcaf('0x51')][_0xfcaf('0x57')]){_0x37f2a6['where']=_['merge'](_0x37f2a6[_0xfcaf('0x58')],{'$or':_[_0xfcaf('0x46')](_0x37f2a6[_0xfcaf('0x4e')],function(_0x1b9a5b){var _0x21ce61={};_0x21ce61[_0x1b9a5b]={'$like':'%'+_0x564b31[_0xfcaf('0x51')][_0xfcaf('0x57')]+'%'};return _0x21ce61;})});}_0x37f2a6=_['merge']({},_0x37f2a6,_0x564b31[_0xfcaf('0x5b')]);return db[_0xfcaf('0x68')][_0xfcaf('0x35')]({'where':_0x37f2a6[_0xfcaf('0x58')]})[_0xfcaf('0x23')](function(_0x12c331){_0x2d94d6[_0xfcaf('0x35')]=_0x12c331;if(_0x564b31[_0xfcaf('0x51')][_0xfcaf('0x62')]){_0x37f2a6['include']=[{'all':!![]}];}return db['Disposition'][_0xfcaf('0x5d')](_0x37f2a6);})[_0xfcaf('0x23')](function(_0x5b4678){_0x2d94d6[_0xfcaf('0x6c')]=_0x5b4678;return _0x2d94d6;});}})[_0xfcaf('0x23')](respondWithFilteredResult(_0x288e4,_0x37f2a6))[_0xfcaf('0x2d')](handleError(_0x288e4,null));};exports[_0xfcaf('0x6d')]=function(_0x223cf5,_0x2c9a3e,_0x1a5c38){return db['MailAccount'][_0xfcaf('0x64')]({'where':{'id':_0x223cf5[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x2c9a3e,null))[_0xfcaf('0x23')](function(_0x1b3b22){if(_0x1b3b22){return _0x1b3b22[_0xfcaf('0x6d')](_0x223cf5['query'][_0xfcaf('0x6e')]);}})[_0xfcaf('0x23')](respondWithStatusCode(_0x2c9a3e,null))['catch'](handleError(_0x2c9a3e,null));};exports[_0xfcaf('0x6f')]=function(_0x50acee,_0x2c45d7,_0x5c1c73){if(_0x50acee[_0xfcaf('0x65')]['id']){delete _0x50acee[_0xfcaf('0x65')]['id'];}return db['MailAccount'][_0xfcaf('0x64')]({'where':{'id':_0x50acee[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x2c45d7,null))['then'](function(_0x2f20b5){if(_0x2f20b5){_0x50acee[_0xfcaf('0x65')]['MailAccountId']=_0x2f20b5['id'];return db[_0xfcaf('0x70')][_0xfcaf('0x69')](_0x50acee[_0xfcaf('0x65')]);}})[_0xfcaf('0x23')](respondWithResult(_0x2c45d7,null))['catch'](handleError(_0x2c45d7,null));};exports[_0xfcaf('0x71')]=function(_0x13afde,_0x4d59e5,_0x403a7e){var _0x29471f={'raw':![],'where':{}};var _0x402751={};var _0x356675={'count':0x0,'rows':[]};return db[_0xfcaf('0x5c')]['findOne']({'where':{'id':_0x13afde[_0xfcaf('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4d59e5,null))[_0xfcaf('0x23')](function(_0x1ff822){if(_0x1ff822){_0x402751[_0xfcaf('0x4d')]=_[_0xfcaf('0x4b')](db[_0xfcaf('0x70')][_0xfcaf('0x47')]);_0x402751[_0xfcaf('0x51')]=_[_0xfcaf('0x4b')](_0x13afde[_0xfcaf('0x51')]);_0x402751['filters']=_['intersection'](_0x402751[_0xfcaf('0x4d')],_0x402751['query']);_0x29471f[_0xfcaf('0x4e')]=_[_0xfcaf('0x4c')](_0x402751[_0xfcaf('0x4d')],qs[_0xfcaf('0x4f')](_0x13afde[_0xfcaf('0x51')]['fields']));_0x29471f[_0xfcaf('0x4e')]=_0x29471f[_0xfcaf('0x4e')][_0xfcaf('0x50')]?_0x29471f[_0xfcaf('0x4e')]:_0x402751[_0xfcaf('0x4d')];if(!_0x13afde['query'][_0xfcaf('0x52')](_0xfcaf('0x72'))){_0x29471f[_0xfcaf('0x33')]=qs['limit'](_0x13afde[_0xfcaf('0x51')][_0xfcaf('0x33')]);_0x29471f[_0xfcaf('0x34')]=qs[_0xfcaf('0x34')](_0x13afde[_0xfcaf('0x51')][_0xfcaf('0x34')]);}_0x29471f[_0xfcaf('0x53')]=qs[_0xfcaf('0x54')](_0x13afde[_0xfcaf('0x51')][_0xfcaf('0x54')]);_0x29471f['where']=qs[_0xfcaf('0x56')](_[_0xfcaf('0x55')](_0x13afde[_0xfcaf('0x51')],_0x402751[_0xfcaf('0x56')]));_0x29471f[_0xfcaf('0x58')]['MailAccountId']=_0x1ff822['id'];if(_0x13afde[_0xfcaf('0x51')]['filter']){_0x29471f['where']=_[_0xfcaf('0x59')](_0x29471f[_0xfcaf('0x58')],{'$or':_[_0xfcaf('0x46')](_0x29471f[_0xfcaf('0x4e')],function(_0x744418){var _0x268382={};_0x268382[_0x744418]={'$like':'%'+_0x13afde[_0xfcaf('0x51')][_0xfcaf('0x57')]+'%'};return _0x268382;})});}_0x29471f=_['merge']({},_0x29471f,_0x13afde[_0xfcaf('0x5b')]);return db[_0xfcaf('0x70')][_0xfcaf('0x35')]({'where':_0x29471f['where']})[_0xfcaf('0x23')](function(_0x1bd481){_0x356675[_0xfcaf('0x35')]=_0x1bd481;if(_0x13afde[_0xfcaf('0x51')][_0xfcaf('0x62')]){_0x29471f[_0xfcaf('0x63')]=[{'all':!![]}];}return db[_0xfcaf('0x70')][_0xfcaf('0x5d')](_0x29471f);})[_0xfcaf('0x23')](function(_0xe430e){_0x356675[_0xfcaf('0x6c')]=_0xe430e;return _0x356675;});}})[_0xfcaf('0x23')](respondWithFilteredResult(_0x4d59e5,_0x29471f))[_0xfcaf('0x2d')](handleError(_0x4d59e5,null));};exports['removeAnswers']=function(_0x117b39,_0x3774ac,_0x22087b){return db[_0xfcaf('0x5c')]['find']({'where':{'id':_0x117b39['params']['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x3774ac,null))[_0xfcaf('0x23')](function(_0x5e52b6){if(_0x5e52b6){return _0x5e52b6[_0xfcaf('0x73')](_0x117b39[_0xfcaf('0x51')][_0xfcaf('0x6e')]);}})[_0xfcaf('0x23')](respondWithStatusCode(_0x3774ac,null))[_0xfcaf('0x2d')](handleError(_0x3774ac,null));};exports[_0xfcaf('0x69')]=function(_0x2b126c,_0x399e8c){var _0xa2f7c9={'name':_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x3f')],'key':_0x2b126c[_0xfcaf('0x65')]['key'],'email':_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x74')],'ListId':_0x2b126c['body'][_0xfcaf('0x75')],'active':!_[_0xfcaf('0x76')](_0x2b126c['body']['active'])?_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x77')]:!![],'description':_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x78')]||null,'Imap':{},'Smtp':{}};if(_[_0xfcaf('0x76')](_0x2b126c[_0xfcaf('0x65')]['cservice'])){if(_0x2b126c['body'][_0xfcaf('0x79')]){_0xa2f7c9[_0xfcaf('0x60')][_0xfcaf('0x7a')]=_0xa2f7c9[_0xfcaf('0x43')]['user']=_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x7b')];_0xa2f7c9[_0xfcaf('0x60')][_0xfcaf('0x7c')]=_0xa2f7c9[_0xfcaf('0x43')][_0xfcaf('0x7d')]=_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x7e')];}else{_0xa2f7c9['Imap']['authentication']=_0xa2f7c9['Smtp']['authentication']=![];}_0xa2f7c9['Imap']['host']=_0x2b126c['body'][_0xfcaf('0x60')][_0xfcaf('0x7f')];_0xa2f7c9[_0xfcaf('0x60')][_0xfcaf('0x80')]=_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x60')]['port'];_0xa2f7c9[_0xfcaf('0x43')][_0xfcaf('0x7f')]=_0x2b126c['body'][_0xfcaf('0x43')]['host'];_0xa2f7c9[_0xfcaf('0x43')][_0xfcaf('0x80')]=_0x2b126c[_0xfcaf('0x65')]['Smtp'][_0xfcaf('0x80')];}else{_0xa2f7c9['Imap']['service']=_0xa2f7c9['Smtp']['service']=_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x81')];_0xa2f7c9['Imap'][_0xfcaf('0x7a')]=_0xa2f7c9[_0xfcaf('0x43')]['user']=_0x2b126c[_0xfcaf('0x65')][_0xfcaf('0x7b')];_0xa2f7c9[_0xfcaf('0x60')][_0xfcaf('0x7c')]=_0xa2f7c9[_0xfcaf('0x43')]['pass']=_0x2b126c[_0xfcaf('0x65')]['cpassword'];}return db[_0xfcaf('0x5c')][_0xfcaf('0x69')](_0xa2f7c9,{'include':[{'model':db[_0xfcaf('0x61')],'as':_0xfcaf('0x43')},{'model':db['MailServerIn'],'as':_0xfcaf('0x60')}]})[_0xfcaf('0x23')](function(_0x147a07){var _0x3b5362=_0x2b126c[_0xfcaf('0x7a')]['get']({'plain':!![]});if(!_0x3b5362)throw new Error(_0xfcaf('0x82'));if(_0x3b5362[_0xfcaf('0x83')]===_0xfcaf('0x7a')){var _0x285289=_0x147a07[_0xfcaf('0x3c')]({'plain':!![]});return db[_0xfcaf('0x84')][_0xfcaf('0x64')]({'where':{'name':_0xfcaf('0x3d'),'userProfileId':_0x3b5362['userProfileId']},'raw':!![]})[_0xfcaf('0x23')](function(_0x4e4240){if(_0x4e4240&&_0x4e4240[_0xfcaf('0x85')]===0x0){return db['UserProfileResource'][_0xfcaf('0x69')]({'name':_0x285289[_0xfcaf('0x3f')],'resourceId':_0x285289['id'],'type':_0x4e4240['name'],'sectionId':_0x4e4240['id']},{})['then'](function(){return _0x147a07;});}else{return _0x147a07;}})[_0xfcaf('0x2d')](function(_0x2d9988){logger[_0xfcaf('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d9988);throw _0x2d9988;});}return _0x147a07;})[_0xfcaf('0x23')](respondWithResult(_0x399e8c,0xc9))['catch'](handleError(_0x399e8c,null));};exports['getImap']=function(_0x37dda6,_0x2cfdc0,_0x3bb157){return db[_0xfcaf('0x5c')][_0xfcaf('0x6a')]({'where':{'id':_0x37dda6['params']['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x2cfdc0,null))[_0xfcaf('0x23')](function(_0xfb6c80){if(_0xfb6c80){return _0xfb6c80[_0xfcaf('0x86')]();}return null;})[_0xfcaf('0x23')](respondWithResult(_0x2cfdc0,null))[_0xfcaf('0x2d')](handleError(_0x2cfdc0,null));};exports[_0xfcaf('0x87')]=function(_0x2525c4,_0x2a5d94,_0x14c361){if(_0x2525c4[_0xfcaf('0x65')]['id']){delete _0x2525c4[_0xfcaf('0x65')]['id'];}return db[_0xfcaf('0x5c')]['find']({'where':{'id':_0x2525c4[_0xfcaf('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2a5d94,null))['then'](function(_0x3cd7eb){if(_0x3cd7eb){_0x2525c4[_0xfcaf('0x65')]['MailAccountId']=_0x3cd7eb['id'];return db[_0xfcaf('0x42')]['create'](_0x2525c4[_0xfcaf('0x65')]);}})['then'](respondWithResult(_0x2a5d94,null))[_0xfcaf('0x2d')](handleError(_0x2a5d94,null));};exports[_0xfcaf('0x88')]=function(_0x3bdca0,_0x4c17e2,_0x4f1666){return db['MailAccount'][_0xfcaf('0x6a')]({'where':{'id':_0x3bdca0['params']['id']}})['then'](handleEntityNotFound(_0x4c17e2,null))[_0xfcaf('0x23')](function(_0x4b2fbf){if(_0x4b2fbf){return _0x4b2fbf[_0xfcaf('0x89')](null);}return null;})[_0xfcaf('0x23')](respondWithStatusCode(_0x4c17e2,null))[_0xfcaf('0x2d')](handleError(_0x4c17e2,null));};exports[_0xfcaf('0x8a')]=function(_0x3d7fa6,_0x55df43,_0xb67a85){return db['MailAccount'][_0xfcaf('0x6a')]({'where':{'id':_0x3d7fa6[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x55df43,null))[_0xfcaf('0x23')](function(_0x479528){if(_0x479528){return _0x479528[_0xfcaf('0x8a')]();}return null;})[_0xfcaf('0x23')](respondWithResult(_0x55df43,null))[_0xfcaf('0x2d')](handleError(_0x55df43,null));};exports[_0xfcaf('0x8b')]=function(_0x22fc4a,_0x443910,_0x115958){if(_0x22fc4a['body']['id']){delete _0x22fc4a['body']['id'];}return db[_0xfcaf('0x5c')][_0xfcaf('0x64')]({'where':{'id':_0x22fc4a[_0xfcaf('0x5f')]['id']}})['then'](handleEntityNotFound(_0x443910,null))[_0xfcaf('0x23')](function(_0x12d49b){if(_0x12d49b){_0x22fc4a[_0xfcaf('0x65')][_0xfcaf('0x6b')]=_0x12d49b['id'];return db[_0xfcaf('0x61')][_0xfcaf('0x69')](_0x22fc4a['body']);}})[_0xfcaf('0x23')](respondWithResult(_0x443910,null))[_0xfcaf('0x2d')](handleError(_0x443910,null));};exports['removeSmtp']=function(_0xf5f43d,_0x112329,_0x4d3627){return db[_0xfcaf('0x5c')][_0xfcaf('0x6a')]({'where':{'id':_0xf5f43d[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x112329,null))[_0xfcaf('0x23')](function(_0x650eda){if(_0x650eda){return _0x650eda[_0xfcaf('0x8c')](null);}return null;})[_0xfcaf('0x23')](respondWithStatusCode(_0x112329,null))['catch'](handleError(_0x112329,null));};exports[_0xfcaf('0x8d')]=function(_0x23a897,_0x33df13,_0x12db75){return db['MailInteraction']['find']({'where':{'id':_0x23a897[_0xfcaf('0x5f')]['id']}})['then'](handleEntityNotFound(_0x33df13,null))[_0xfcaf('0x23')](function(_0x597975){if(_0x597975){return _0x597975[_0xfcaf('0x8d')](_0x23a897['body']['ids'],_[_0xfcaf('0x8e')](_0x23a897['body'],[_0xfcaf('0x6e'),'id'])||{});}})[_0xfcaf('0x23')](respondWithResult(_0x33df13,null))[_0xfcaf('0x2d')](handleError(_0x33df13,null));};exports['getInteractions']=function(_0x49e3d7,_0xb032e5,_0x40bf20){var _0x543c0a={'raw':![],'where':{}};var _0x574a81={};var _0x21b497={'count':0x0,'rows':[]};return db['MailAccount'][_0xfcaf('0x6a')]({'where':{'id':_0x49e3d7[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0xb032e5,null))['then'](function(_0x14d89f){if(_0x14d89f){_0x574a81['model']=_['keys'](db['MailInteraction'][_0xfcaf('0x47')]);_0x574a81['query']=_['keys'](_0x49e3d7[_0xfcaf('0x51')]);_0x574a81[_0xfcaf('0x56')]=_[_0xfcaf('0x4c')](_0x574a81[_0xfcaf('0x4d')],_0x574a81['query']);_0x543c0a['attributes']=_['intersection'](_0x574a81[_0xfcaf('0x4d')],qs['fields'](_0x49e3d7['query'][_0xfcaf('0x4f')]));_0x543c0a[_0xfcaf('0x4e')]=_0x543c0a[_0xfcaf('0x4e')][_0xfcaf('0x50')]?_0x543c0a[_0xfcaf('0x4e')]:_0x574a81[_0xfcaf('0x4d')];if(!_0x49e3d7['query'][_0xfcaf('0x52')](_0xfcaf('0x72'))){_0x543c0a[_0xfcaf('0x33')]=qs['limit'](_0x49e3d7[_0xfcaf('0x51')][_0xfcaf('0x33')]);_0x543c0a['offset']=qs[_0xfcaf('0x34')](_0x49e3d7[_0xfcaf('0x51')][_0xfcaf('0x34')]);}_0x543c0a[_0xfcaf('0x53')]=qs[_0xfcaf('0x54')](_0x49e3d7[_0xfcaf('0x51')][_0xfcaf('0x54')]);_0x543c0a[_0xfcaf('0x58')]=qs[_0xfcaf('0x56')](_['pick'](_0x49e3d7['query'],_0x574a81['filters']));_0x543c0a['where']['MailAccountId']=_0x14d89f['id'];if(_0x49e3d7[_0xfcaf('0x51')][_0xfcaf('0x57')]){_0x543c0a[_0xfcaf('0x58')]=_['merge'](_0x543c0a[_0xfcaf('0x58')],{'$or':_['map'](_0x543c0a['attributes'],function(_0x49e18e){var _0x34449f={};_0x34449f[_0x49e18e]={'$like':'%'+_0x49e3d7[_0xfcaf('0x51')][_0xfcaf('0x57')]+'%'};return _0x34449f;})});}_0x543c0a=_[_0xfcaf('0x59')]({},_0x543c0a,_0x49e3d7['options']);return db['MailInteraction'][_0xfcaf('0x35')]({'where':_0x543c0a[_0xfcaf('0x58')]})[_0xfcaf('0x23')](function(_0x353d1e){_0x21b497[_0xfcaf('0x35')]=_0x353d1e;if(_0x49e3d7[_0xfcaf('0x51')][_0xfcaf('0x62')]){_0x543c0a[_0xfcaf('0x63')]=[{'model':db['CmContact'],'as':_0xfcaf('0x8f'),'required':![]},{'model':db[_0xfcaf('0x90')],'as':_0xfcaf('0x91'),'attributes':[_0xfcaf('0x3f'),_0xfcaf('0x92'),_0xfcaf('0x93')],'required':![]},{'model':db['Tag'],'as':_0xfcaf('0x94'),'attributes':['id',_0xfcaf('0x3f'),_0xfcaf('0x95')],'where':_0x49e3d7['query']['tag']?{'id':_0x49e3d7[_0xfcaf('0x51')][_0xfcaf('0x96')]}:undefined,'required':_0x49e3d7[_0xfcaf('0x51')]['tag']?!![]:![]}];}return db[_0xfcaf('0x97')][_0xfcaf('0x5d')](_0x543c0a);})[_0xfcaf('0x23')](function(_0xc1d801){_0x21b497[_0xfcaf('0x6c')]=_0xc1d801;return _0x21b497;});}})['then'](respondWithFilteredResult(_0xb032e5,_0x543c0a))['catch'](handleError(_0xb032e5,null));};exports[_0xfcaf('0x98')]=function addApplications(_0x88742e,_0x1ce70c){var _0x2e67d8=_0x88742e[_0xfcaf('0x5f')]['id'];var _0x41e456=_0x88742e['body'];var _0x13c55b=0xc8;var _0x35d5cf=null;return db[_0xfcaf('0x99')][_0xfcaf('0x9a')]({'isolationLevel':db[_0xfcaf('0x99')]['Transaction'][_0xfcaf('0x9b')][_0xfcaf('0x9c')]},function(_0x55ead5){return db[_0xfcaf('0x5c')][_0xfcaf('0x6a')]({'where':{'id':_0x2e67d8},'transaction':_0x55ead5})['then'](function(_0x1663fc){if(_0x1663fc){return db[_0xfcaf('0x9d')][_0xfcaf('0x3b')]({'where':{'MailAccountId':_0x2e67d8},'transaction':_0x55ead5})[_0xfcaf('0x23')](function(){var _0x26f7ca=_[_0xfcaf('0x46')](_0x41e456,function(_0x370c89){_0x370c89['MailAccountId']=_0x2e67d8;return _0x370c89;});return db[_0xfcaf('0x9d')][_0xfcaf('0x9e')](_0x26f7ca,{'transaction':_0x55ead5});});}else{_0x13c55b=0x194;_0x35d5cf=[];}});})[_0xfcaf('0x23')](function(){if(_0x13c55b!==0x194){return db[_0xfcaf('0x9d')][_0xfcaf('0x9f')]({'where':{'MailAccountId':_0x2e67d8},'order':_0xfcaf('0xa0')})[_0xfcaf('0x23')](function(_0x4d467b){_0x35d5cf=_0x4d467b;});}})[_0xfcaf('0x2d')](function(_0x4cf84a){_0x13c55b=0x1f4;logger[_0xfcaf('0x29')](_0x4cf84a[_0xfcaf('0x3e')]);if(_0x4cf84a[_0xfcaf('0x3f')]){delete _0x4cf84a[_0xfcaf('0x3f')];}_0x35d5cf=_0x4cf84a;})['finally'](function(){if(_0x35d5cf===null){_0x1ce70c[_0xfcaf('0x2e')](_0x13c55b);}else{if(_0x13c55b===0x1f4){_0x1ce70c[_0xfcaf('0x2f')](_0x13c55b)[_0xfcaf('0x40')](_0x35d5cf);}else{_0x1ce70c['status'](_0x13c55b)['json'](_0x35d5cf);}}});};exports[_0xfcaf('0xa1')]=function(_0x2764aa,_0xee5116,_0x4d3a10){var _0x20db16={};var _0x4a0056={};var _0x5c4fca;var _0x1d4ce3;return db[_0xfcaf('0x5c')][_0xfcaf('0x6a')]({'where':{'id':_0x2764aa['params']['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0xee5116,null))[_0xfcaf('0x23')](function(_0x123394){if(_0x123394){_0x5c4fca=_0x123394;_0x4a0056['model']=_[_0xfcaf('0x4b')](db[_0xfcaf('0x9d')][_0xfcaf('0x47')]);_0x4a0056[_0xfcaf('0x51')]=_[_0xfcaf('0x4b')](_0x2764aa[_0xfcaf('0x51')]);_0x4a0056['filters']=_[_0xfcaf('0x4c')](_0x4a0056['model'],_0x4a0056[_0xfcaf('0x51')]);_0x20db16[_0xfcaf('0x4e')]=_[_0xfcaf('0x4c')](_0x4a0056['model'],qs[_0xfcaf('0x4f')](_0x2764aa[_0xfcaf('0x51')]['fields']));_0x20db16[_0xfcaf('0x4e')]=_0x20db16[_0xfcaf('0x4e')][_0xfcaf('0x50')]?_0x20db16['attributes']:_0x4a0056[_0xfcaf('0x4d')];_0x20db16[_0xfcaf('0x53')]=qs[_0xfcaf('0x54')](_0x2764aa['query'][_0xfcaf('0x54')]);_0x20db16[_0xfcaf('0x58')]=qs[_0xfcaf('0x56')](_[_0xfcaf('0x55')](_0x2764aa['query'],_0x4a0056[_0xfcaf('0x56')]));if(_0x2764aa['query'][_0xfcaf('0x57')]){_0x20db16[_0xfcaf('0x58')]=_[_0xfcaf('0x59')](_0x20db16['where'],{'$or':_[_0xfcaf('0x46')](_0x20db16[_0xfcaf('0x4e')],function(_0x48e43a){var _0x558da2={};_0x558da2[_0x48e43a]={'$like':'%'+_0x2764aa['query'][_0xfcaf('0x57')]+'%'};return _0x558da2;})});}_0x20db16=_['merge']({},_0x20db16,_0x2764aa['options']);return _0x5c4fca[_0xfcaf('0xa1')](_0x20db16);}})[_0xfcaf('0x23')](function(_0x3e5c62){if(_0x3e5c62){_0x1d4ce3=_0x3e5c62['length'];if(!_0x2764aa[_0xfcaf('0x51')][_0xfcaf('0x52')](_0xfcaf('0x72'))){_0x20db16[_0xfcaf('0x33')]=qs[_0xfcaf('0x33')](_0x2764aa['query'][_0xfcaf('0x33')]);_0x20db16[_0xfcaf('0x34')]=qs[_0xfcaf('0x34')](_0x2764aa[_0xfcaf('0x51')][_0xfcaf('0x34')]);}return _0x5c4fca['getApplications'](_0x20db16);}})['then'](function(_0x39bee2){if(_0x39bee2){return _0x39bee2?{'count':_0x1d4ce3,'rows':_0x39bee2}:null;}})[_0xfcaf('0x23')](respondWithResult(_0xee5116,null))[_0xfcaf('0x2d')](handleError(_0xee5116,null));};exports['getMessages']=function(_0x27e673,_0x35d898,_0x39367b){var _0x1b1a09={'raw':!![],'where':{}};var _0x1cb2ee={};var _0x5112ee={'count':0x0,'rows':[]};return db[_0xfcaf('0x5c')]['findOne']({'where':{'id':_0x27e673[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x35d898,null))[_0xfcaf('0x23')](function(_0x11240f){if(_0x11240f){_0x1cb2ee[_0xfcaf('0x4d')]=_[_0xfcaf('0x4b')](db[_0xfcaf('0xa2')][_0xfcaf('0x47')]);_0x1cb2ee[_0xfcaf('0x51')]=_[_0xfcaf('0x4b')](_0x27e673[_0xfcaf('0x51')]);_0x1cb2ee[_0xfcaf('0x56')]=_[_0xfcaf('0x4c')](_0x1cb2ee[_0xfcaf('0x4d')],_0x1cb2ee['query']);_0x1b1a09[_0xfcaf('0x4e')]=_[_0xfcaf('0x4c')](_0x1cb2ee[_0xfcaf('0x4d')],qs[_0xfcaf('0x4f')](_0x27e673[_0xfcaf('0x51')][_0xfcaf('0x4f')]));_0x1b1a09[_0xfcaf('0x4e')]=_0x1b1a09[_0xfcaf('0x4e')][_0xfcaf('0x50')]?_0x1b1a09[_0xfcaf('0x4e')]:_0x1cb2ee['model'];if(!_0x27e673[_0xfcaf('0x51')][_0xfcaf('0x52')](_0xfcaf('0x72'))){_0x1b1a09['limit']=qs[_0xfcaf('0x33')](_0x27e673[_0xfcaf('0x51')][_0xfcaf('0x33')]);_0x1b1a09[_0xfcaf('0x34')]=qs[_0xfcaf('0x34')](_0x27e673[_0xfcaf('0x51')][_0xfcaf('0x34')]);}_0x1b1a09[_0xfcaf('0x53')]=qs[_0xfcaf('0x54')](_0x27e673[_0xfcaf('0x51')][_0xfcaf('0x54')]);_0x1b1a09[_0xfcaf('0x58')]=qs[_0xfcaf('0x56')](_[_0xfcaf('0x55')](_0x27e673[_0xfcaf('0x51')],_0x1cb2ee['filters']));_0x1b1a09[_0xfcaf('0x58')][_0xfcaf('0x6b')]=_0x11240f['id'];if(_0x27e673[_0xfcaf('0x51')]['filter']){_0x1b1a09['where']=_[_0xfcaf('0x59')](_0x1b1a09[_0xfcaf('0x58')],{'$or':_[_0xfcaf('0x46')](_0x1b1a09['attributes'],function(_0x409937){var _0x4558d0={};_0x4558d0[_0x409937]={'$like':'%'+_0x27e673[_0xfcaf('0x51')][_0xfcaf('0x57')]+'%'};return _0x4558d0;})});}if(_0x27e673[_0xfcaf('0x51')][_0xfcaf('0xa3')]){var _0x281ef5=_0x27e673[_0xfcaf('0x51')][_0xfcaf('0xa3')][_0xfcaf('0xa4')](',');var _0x40ecb6={};_0x40ecb6[_0x281ef5[0x0]]={'$gte':moment(_0x281ef5[0x1])[_0xfcaf('0xa5')](_0xfcaf('0xa6'))};_0x1b1a09['where']=_[_0xfcaf('0x59')](_0x1b1a09[_0xfcaf('0x58')],_0x40ecb6);}_0x1b1a09=_[_0xfcaf('0x59')]({},_0x1b1a09,_0x27e673[_0xfcaf('0x5b')]);return db[_0xfcaf('0xa2')][_0xfcaf('0x35')]({'where':_0x1b1a09[_0xfcaf('0x58')]})[_0xfcaf('0x23')](function(_0x15aa8d){_0x5112ee[_0xfcaf('0x35')]=_0x15aa8d;if(_0x27e673[_0xfcaf('0x51')][_0xfcaf('0x62')]){_0x1b1a09[_0xfcaf('0x63')]=[{'all':!![]}];}return db[_0xfcaf('0xa2')][_0xfcaf('0x5d')](_0x1b1a09);})[_0xfcaf('0x23')](function(_0x47d729){if(_0x27e673[_0xfcaf('0x51')]['inlineCss']===_0xfcaf('0xa7')){for(var _0x2fc830=0x0;_0x2fc830<_0x47d729[_0xfcaf('0x50')];_0x2fc830++){_0x47d729[_0x2fc830][_0xfcaf('0x65')]=juice(_0x47d729[_0x2fc830][_0xfcaf('0x65')]);}}_0x5112ee[_0xfcaf('0x6c')]=_0x47d729;return _0x5112ee;});}})['then'](respondWithFilteredResult(_0x35d898,_0x1b1a09))['catch'](handleError(_0x35d898,null));};exports[_0xfcaf('0x40')]=function(_0x38d99a,_0xa7209e,_0x1e9629){var _0x7ae3bf,_0x1e008b={},_0x44949e;if(_0x38d99a[_0xfcaf('0x65')]['to']){_0x44949e=_0x38d99a[_0xfcaf('0x65')]['to'][_0xfcaf('0xa4')](',')[0x0];}return db[_0xfcaf('0x5c')]['find']({'where':{'id':_0x38d99a[_0xfcaf('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xfcaf('0xa8'),'include':[{'model':db['CmContact'],'as':_0xfcaf('0xa9'),'where':{'email':_0x44949e},'limit':0x1,'order':[[_0xfcaf('0xaa'),'DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xfcaf('0x23')](handleEntityNotFound(_0xa7209e,null))['then'](function(_0x4fe1ed){if(_0x4fe1ed){_0x7ae3bf=_0x4fe1ed;if(_0x4fe1ed[_0xfcaf('0x43')]){if(_['isNil'](_0x38d99a[_0xfcaf('0x65')]['from'])){_0x38d99a[_0xfcaf('0x65')]['from']=util['format']('%s\x20<%s>',_0x4fe1ed[_0xfcaf('0x3f')],_0x4fe1ed[_0xfcaf('0x74')]||_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0x7a')]);}if(_0x38d99a[_0xfcaf('0x65')]['attachments']&&_0x38d99a[_0xfcaf('0x65')]['attachments'][_0xfcaf('0x50')]){for(var _0x544d32=0x0;_0x544d32<_0x38d99a[_0xfcaf('0x65')][_0xfcaf('0xab')][_0xfcaf('0x50')];_0x544d32+=0x1){_0x38d99a['body'][_0xfcaf('0xab')][_0x544d32]={'filename':_0x38d99a['body'][_0xfcaf('0xab')][_0x544d32]['name'],'path':path[_0xfcaf('0xac')](config['root'],'server/files/attachments',_0x38d99a[_0xfcaf('0x65')][_0xfcaf('0xab')][_0x544d32][_0xfcaf('0xad')])};}}var _0x556239={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4fe1ed['Smtp'][_0xfcaf('0xae')])){if(_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0xaf')]){_0x556239[_0xfcaf('0xb0')]={'user':_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0x7a')],'pass':_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0x7d')]};}_0x556239['host']=_0x4fe1ed[_0xfcaf('0x43')]['host'];_0x556239['port']=_0x4fe1ed['Smtp'][_0xfcaf('0x80')];_0x556239[_0xfcaf('0xb1')]=_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0xb1')];}else{_0x556239[_0xfcaf('0xae')]=_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0xae')];_0x556239[_0xfcaf('0xb0')]={'user':_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0x7a')],'pass':_0x4fe1ed[_0xfcaf('0x43')][_0xfcaf('0x7d')]};}return respondWithRpcPromise(_0xfcaf('0xb2'),_0xfcaf('0xb3'),{'account':_0x556239,'message':_0x38d99a[_0xfcaf('0x65')]});}else{throw new Error(_0xfcaf('0xb4'));}}})[_0xfcaf('0x23')](function(_0x40db34){if(_0x40db34){_0x1e008b=_0x40db34;if(_0x7ae3bf[_0xfcaf('0xa8')]){if(_0x7ae3bf[_0xfcaf('0xa8')][_0xfcaf('0xa9')][_0xfcaf('0x50')]){return _0x7ae3bf[_0xfcaf('0xa8')][_0xfcaf('0xa9')][0x0];}else{return db[_0xfcaf('0xb5')][_0xfcaf('0x69')](_['defaults'](_0x38d99a['body'],{'firstName':_0x38d99a[_0xfcaf('0x65')]['to'],'email':_0x38d99a['body']['to'],'phone':_0x38d99a[_0xfcaf('0x65')]['to'],'ListId':_0x7ae3bf['ListId']}));}}else{throw new Error(_0xfcaf('0xb4'));}}})[_0xfcaf('0x23')](function(_0x838894){if(_0x838894){var _0xc83724={'UserId':_0x38d99a[_0xfcaf('0x7a')]['id'],'ContactId':_0x838894['id'],'MailAccountId':_0x7ae3bf['id'],'inReplyTo':_0x1e008b[_0xfcaf('0xb6')],'to':_0x38d99a['body'][_0xfcaf('0xb7')],'cc':_0x38d99a[_0xfcaf('0x65')]['cc'],'subject':_0x38d99a[_0xfcaf('0x65')][_0xfcaf('0xb8')],'attach':_0x38d99a[_0xfcaf('0x65')][_0xfcaf('0xb9')],'firstMsgDirection':_0xfcaf('0xba'),'lastMsgAt':moment()[_0xfcaf('0xa5')](_0xfcaf('0xa6')),'lastMsgDirection':_0xfcaf('0xba'),'Messages':[_[_0xfcaf('0x59')](_0x38d99a['body'],{'messageId':_0x1e008b[_0xfcaf('0xb6')],'sentAt':moment()[_0xfcaf('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x7ae3bf['id'],'UserId':_0x38d99a[_0xfcaf('0x7a')]['id'],'ContactId':_0x838894['id']})]};if(_0x38d99a['body'][_0xfcaf('0xbb')]){_0xc83724=_['merge'](_0xc83724,_0x38d99a['body'][_0xfcaf('0xbb')]);}return db['MailInteraction'][_0xfcaf('0x69')](_0xc83724,{'include':[{'model':db[_0xfcaf('0xa2')],'as':_0xfcaf('0xbc')}]});}})['then'](respondWithResult(_0xa7209e,null))[_0xfcaf('0x2d')](handleError(_0xa7209e,null));};exports[_0xfcaf('0xbd')]=function(_0x1a6c33,_0x35d3e1,_0x49655e){return db[_0xfcaf('0x5c')][_0xfcaf('0x64')]({'where':{'id':_0x1a6c33[_0xfcaf('0x5f')]['id']},'include':[{'model':db[_0xfcaf('0x61')],'as':_0xfcaf('0x43'),'raw':!![]}]})[_0xfcaf('0x23')](handleEntityNotFound(_0x35d3e1,null))[_0xfcaf('0x23')](function(_0x2880e9){if(_0x2880e9&&_0x2880e9[_0xfcaf('0x43')]){var _0x87534={'id':_0x2880e9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2880e9[_0xfcaf('0x43')]['service']){_0x87534[_0xfcaf('0xae')]=_0x2880e9['Smtp'][_0xfcaf('0xae')];}else{_0x87534['host']=_0x2880e9[_0xfcaf('0x43')][_0xfcaf('0x7f')];_0x87534['port']=_0x2880e9[_0xfcaf('0x43')][_0xfcaf('0x80')];_0x87534[_0xfcaf('0xb1')]=_0x2880e9[_0xfcaf('0x43')]['secure'];}if(_0x2880e9[_0xfcaf('0x43')]['authentication']){_0x87534[_0xfcaf('0xb0')]={'user':_0x2880e9[_0xfcaf('0x43')][_0xfcaf('0x7a')],'pass':_0x2880e9['Smtp']['pass']};}return respondWithRpcPromise(_0xfcaf('0xbe'),_0xfcaf('0xbd'),{'account':_0x87534});}})['then'](respondWithResult(_0x35d3e1,null))[_0xfcaf('0x2d')](handleError(_0x35d3e1,null));};exports[_0xfcaf('0x3b')]=function(_0x49fdac,_0x18f778){return db[_0xfcaf('0x5c')][_0xfcaf('0x64')]({'where':{'id':_0x49fdac[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x18f778,null))[_0xfcaf('0x23')](function(_0x32a113){if(_0x32a113&&_0x32a113[_0xfcaf('0xae')]){throw new db['Sequelize'][(_0xfcaf('0xbf'))](_0xfcaf('0xc0'));}return _0x32a113;})[_0xfcaf('0x23')](removeEntity(_0x18f778,null))[_0xfcaf('0x2d')](handleError(_0x18f778,null));};exports[_0xfcaf('0xc1')]=function(_0x2c3d3a,_0x2f77de,_0x21b5bf){return db['MailAccount'][_0xfcaf('0x64')]({'where':{'id':_0x2c3d3a[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x2f77de,null))['then'](function(_0x29354f){if(_0x29354f){return _0x29354f[_0xfcaf('0xc1')](_0x2c3d3a[_0xfcaf('0x65')]['ids'],_[_0xfcaf('0x8e')](_0x2c3d3a[_0xfcaf('0x65')],['ids','id'])||{})['spread'](function(_0x1adc36){for(var _0x476b5a=0x0;_0x476b5a<_0x2c3d3a[_0xfcaf('0x65')][_0xfcaf('0x6e')][_0xfcaf('0x50')];_0x476b5a+=0x1){socket[_0xfcaf('0xc2')]('userMailAccount:save',{'UserId':Number(_0x2c3d3a[_0xfcaf('0x65')][_0xfcaf('0x6e')][_0x476b5a]),'MailAccountId':Number(_0x2c3d3a[_0xfcaf('0x5f')]['id'])});}return _0x1adc36;});}})['then'](respondWithResult(_0x2f77de,null))[_0xfcaf('0x2d')](handleError(_0x2f77de,null));};exports[_0xfcaf('0xc3')]=function(_0x2f076,_0x3aa7b0,_0x3b8029){return db[_0xfcaf('0x5c')]['find']({'where':{'id':_0x2f076['params']['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0x3aa7b0,null))['then'](function(_0x1d79d8){if(_0x1d79d8){return _0x1d79d8[_0xfcaf('0xc3')](_0x2f076[_0xfcaf('0x51')][_0xfcaf('0x6e')])[_0xfcaf('0x23')](function(){if(_['isArray'](_0x2f076['query'][_0xfcaf('0x6e')])){for(var _0x5cc5ca=0x0;_0x5cc5ca<_0x2f076[_0xfcaf('0x51')][_0xfcaf('0x6e')]['length'];_0x5cc5ca+=0x1){socket[_0xfcaf('0xc2')](_0xfcaf('0xc4'),{'UserId':Number(_0x2f076['query'][_0xfcaf('0x6e')][_0x5cc5ca]),'MailAccountId':Number(_0x2f076[_0xfcaf('0x5f')]['id'])});}}else{socket[_0xfcaf('0xc2')](_0xfcaf('0xc4'),{'UserId':Number(_0x2f076[_0xfcaf('0x51')]['ids']),'MailAccountId':Number(_0x2f076['params']['id'])});}});}})[_0xfcaf('0x23')](respondWithStatusCode(_0x3aa7b0,null))[_0xfcaf('0x2d')](handleError(_0x3aa7b0,null));};exports['getAgents']=function(_0x44e240,_0xbc4afd,_0x342d11){var _0x48d7fa={};var _0x2a6116={};var _0x2506b2;var _0x5b83a0;return db[_0xfcaf('0x5c')][_0xfcaf('0x6a')]({'where':{'id':_0x44e240[_0xfcaf('0x5f')]['id']}})[_0xfcaf('0x23')](handleEntityNotFound(_0xbc4afd,null))[_0xfcaf('0x23')](function(_0x110d3c){if(_0x110d3c){_0x2506b2=_0x110d3c;_0x2a6116[_0xfcaf('0x4d')]=_[_0xfcaf('0x4b')](db[_0xfcaf('0x90')][_0xfcaf('0x47')]);_0x2a6116['query']=_[_0xfcaf('0x4b')](_0x44e240['query']);_0x2a6116[_0xfcaf('0x56')]=_[_0xfcaf('0x4c')](_0x2a6116['model'],_0x2a6116[_0xfcaf('0x51')]);_0x48d7fa['attributes']=_[_0xfcaf('0x4c')](_0x2a6116[_0xfcaf('0x4d')],qs['fields'](_0x44e240[_0xfcaf('0x51')][_0xfcaf('0x4f')]));_0x48d7fa[_0xfcaf('0x4e')]=_0x48d7fa[_0xfcaf('0x4e')][_0xfcaf('0x50')]?_0x48d7fa['attributes']:_0x2a6116[_0xfcaf('0x4d')];_0x48d7fa['order']=qs[_0xfcaf('0x54')](_0x44e240[_0xfcaf('0x51')][_0xfcaf('0x54')]);_0x48d7fa['where']=qs[_0xfcaf('0x56')](_[_0xfcaf('0x55')](_0x44e240[_0xfcaf('0x51')],_0x2a6116['filters']));if(_0x44e240[_0xfcaf('0x51')]['filter']){_0x48d7fa['where']=_['merge'](_0x48d7fa[_0xfcaf('0x58')],{'$or':_['map'](_0x48d7fa['attributes'],function(_0xcd112){var _0x4453cd={};_0x4453cd[_0xcd112]={'$like':'%'+_0x44e240[_0xfcaf('0x51')][_0xfcaf('0x57')]+'%'};return _0x4453cd;})});}_0x48d7fa=_[_0xfcaf('0x59')]({},_0x48d7fa,_0x44e240[_0xfcaf('0x5b')]);return _0x2506b2[_0xfcaf('0xc5')](_0x48d7fa);}})['then'](function(_0x5c47ec){if(_0x5c47ec){_0x5b83a0=_0x5c47ec[_0xfcaf('0x50')];if(!_0x44e240['query'][_0xfcaf('0x52')](_0xfcaf('0x72'))){_0x48d7fa[_0xfcaf('0x33')]=qs[_0xfcaf('0x33')](_0x44e240[_0xfcaf('0x51')][_0xfcaf('0x33')]);_0x48d7fa[_0xfcaf('0x34')]=qs[_0xfcaf('0x34')](_0x44e240[_0xfcaf('0x51')][_0xfcaf('0x34')]);}return _0x2506b2[_0xfcaf('0xc5')](_0x48d7fa);}})[_0xfcaf('0x23')](function(_0x1a1ed0){if(_0x1a1ed0){return _0x1a1ed0?{'count':_0x5b83a0,'rows':_0x1a1ed0}:null;}})[_0xfcaf('0x23')](respondWithResult(_0xbc4afd,null))[_0xfcaf('0x2d')](handleError(_0xbc4afd,null));};
\ No newline at end of file
+var _0xc420=['options','count','includeAll','include','findAll','rows','show','keys','length','find','body','MailServerIn','describe','addDisposition','params','MailAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','create','getAnswers','CannedAnswer','removeAnswers','ids','key','email','ListId','isNil','active','description','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','send','getApplications','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','CmList','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','juice','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','MailAccounts','stack','name','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x2542d1,_0xdb7645){var _0xec2ce7=function(_0x27c486){while(--_0x27c486){_0x2542d1['push'](_0x2542d1['shift']());}};_0xec2ce7(++_0xdb7645);}(_0xc420,0x143));var _0x0c42=function(_0x3be827,_0x675497){_0x3be827=_0x3be827-0x0;var _0x265d5d=_0xc420[_0x3be827];return _0x265d5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c42('0x0'));var zipdir=require(_0x0c42('0x1'));var jsonpatch=require(_0x0c42('0x2'));var rp=require(_0x0c42('0x3'));var moment=require(_0x0c42('0x4'));var BPromise=require(_0x0c42('0x5'));var Mustache=require(_0x0c42('0x6'));var util=require(_0x0c42('0x7'));var path=require('path');var sox=require(_0x0c42('0x8'));var csv=require(_0x0c42('0x9'));var ejs=require(_0x0c42('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c42('0xb'));var squel=require('squel');var crypto=require(_0x0c42('0xc'));var jsforce=require(_0x0c42('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c42('0xe'));var htmlToText=require('html-to-text');var juice=require(_0x0c42('0xf'));var Redis=require(_0x0c42('0x10'));var authService=require(_0x0c42('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0c42('0x12'));var hardwareService=require(_0x0c42('0x13'));var logger=require(_0x0c42('0x14'))(_0x0c42('0x15'));var utils=require(_0x0c42('0x16'));var config=require(_0x0c42('0x17'));var licenseUtil=require(_0x0c42('0x18'));var db=require('../../mysqldb')['db'];config[_0x0c42('0x19')]=_[_0x0c42('0x1a')](config[_0x0c42('0x19')],{'host':_0x0c42('0x1b'),'port':0x18eb});var socket=require(_0x0c42('0x1c'))(new Redis(config[_0x0c42('0x19')]));require(_0x0c42('0x1d'))[_0x0c42('0x1e')](socket);var jayson=require(_0x0c42('0x1f'));var client=jayson[_0x0c42('0x20')][_0x0c42('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x4da891,_0x42d5c3,_0x355b9a,_0x34c4a6){return new BPromise(function(_0x3b6703,_0x5b30a2){var _0x3835ef=_0x34c4a6||client;return _0x3835ef[_0x0c42('0x22')](_0x4da891,_0x355b9a)[_0x0c42('0x23')](function(_0x3c50a6){logger[_0x0c42('0x24')](_0x0c42('0x25'),_0x42d5c3,_0x0c42('0x26'));logger[_0x0c42('0x27')](_0x0c42('0x28'),_0x42d5c3,_0x0c42('0x26'),JSON[_0x0c42('0x29')](_0x3c50a6));if(_0x3c50a6['error']){if(_0x3c50a6[_0x0c42('0x2a')][_0x0c42('0x2b')]===0x1f4){logger['error'](_0x0c42('0x25'),_0x42d5c3,_0x3c50a6[_0x0c42('0x2a')]['message']);return _0x5b30a2(_0x3c50a6[_0x0c42('0x2a')][_0x0c42('0x2c')]);}logger[_0x0c42('0x2a')](_0x0c42('0x25'),_0x42d5c3,_0x3c50a6['error'][_0x0c42('0x2c')]);return _0x3b6703(_0x3c50a6[_0x0c42('0x2a')][_0x0c42('0x2c')]);}else{logger[_0x0c42('0x24')](_0x0c42('0x25'),_0x42d5c3,_0x0c42('0x26'));_0x3b6703(_0x3c50a6[_0x0c42('0x2d')]['message']);}})[_0x0c42('0x2e')](function(_0x53135f){logger['error'](_0x0c42('0x25'),_0x42d5c3,_0x53135f);_0x5b30a2(_0x53135f);});});}function respondWithStatusCode(_0x16e147,_0x551cec){_0x551cec=_0x551cec||0xcc;return function(_0x36fdcf){if(_0x36fdcf){return _0x16e147[_0x0c42('0x2f')](_0x551cec);}return _0x16e147[_0x0c42('0x30')](_0x551cec)[_0x0c42('0x31')]();};}function respondWithResult(_0x40efd7,_0xc53c7f){_0xc53c7f=_0xc53c7f||0xc8;return function(_0xb9be84){if(_0xb9be84){return _0x40efd7[_0x0c42('0x30')](_0xc53c7f)['json'](_0xb9be84);}};}function respondWithFilteredResult(_0x2b6d10,_0x3090c8){return function(_0xe3346){if(_0xe3346){var _0x7331f=typeof _0x3090c8[_0x0c42('0x32')]===_0x0c42('0x33')&&typeof _0x3090c8[_0x0c42('0x34')]==='undefined';var _0x379faf=_0xe3346['count'];var _0x341284=_0x7331f?0x0:_0x3090c8['offset'];var _0x50e653=_0x7331f?_0xe3346['count']:_0x3090c8['offset']+_0x3090c8[_0x0c42('0x34')];var _0x5cc673;if(_0x50e653>=_0x379faf){_0x50e653=_0x379faf;_0x5cc673=0xc8;}else{_0x5cc673=0xce;}_0x2b6d10['status'](_0x5cc673);return _0x2b6d10[_0x0c42('0x35')](_0x0c42('0x36'),_0x341284+'-'+_0x50e653+'/'+_0x379faf)[_0x0c42('0x37')](_0xe3346);}return null;};}function patchUpdates(_0x4a01a0){return function(_0x1c7ed5){try{jsonpatch[_0x0c42('0x38')](_0x1c7ed5,_0x4a01a0,!![]);}catch(_0x4b39eb){return BPromise[_0x0c42('0x39')](_0x4b39eb);}return _0x1c7ed5[_0x0c42('0x3a')]();};}function saveUpdates(_0x4c6d8a,_0x2aad30){return function(_0xd58c40){if(_0xd58c40){return _0xd58c40[_0x0c42('0x3b')](_0x4c6d8a)[_0x0c42('0x23')](function(_0x45d393){return _0x45d393;});}return null;};}function removeEntity(_0x4348c8,_0x34da9f){return function(_0x2ee244){if(_0x2ee244){return _0x2ee244[_0x0c42('0x3c')]()[_0x0c42('0x23')](function(){var _0x5b6c51=_0x2ee244[_0x0c42('0x3d')]({'plain':!![]});var _0x4aea7f=_0x0c42('0x3e');return db['UserProfileResource'][_0x0c42('0x3c')]({'where':{'type':_0x4aea7f,'resourceId':_0x5b6c51['id']}})[_0x0c42('0x23')](function(){return _0x2ee244;});})[_0x0c42('0x23')](function(){_0x4348c8[_0x0c42('0x30')](0xcc)[_0x0c42('0x31')]();});}};}function handleEntityNotFound(_0x5076e2,_0x342f38){return function(_0x1f3025){if(!_0x1f3025){_0x5076e2[_0x0c42('0x2f')](0x194);}return _0x1f3025;};}function handleError(_0x583ef4,_0x6cce09){_0x6cce09=_0x6cce09||0x1f4;return function(_0x2c36ab){logger[_0x0c42('0x2a')](_0x2c36ab[_0x0c42('0x3f')]);if(_0x2c36ab[_0x0c42('0x40')]){delete _0x2c36ab[_0x0c42('0x40')];}_0x583ef4[_0x0c42('0x30')](_0x6cce09)['send'](_0x2c36ab);};}exports[_0x0c42('0x41')]=function(_0x1ff62e,_0x17d576){var _0x27ad46={'include':[{'model':db['MailServerIn'],'as':_0x0c42('0x42')},{'model':db[_0x0c42('0x43')],'as':_0x0c42('0x44')},{'model':db[_0x0c42('0x45')],'as':_0x0c42('0x46')}]},_0xf2bcbb={},_0x271aeb={'count':0x0,'rows':[]};var _0x4d52db=_[_0x0c42('0x47')](db[_0x0c42('0x48')][_0x0c42('0x49')],function(_0x4fbf17){return{'name':_0x4fbf17[_0x0c42('0x4a')],'type':_0x4fbf17[_0x0c42('0x4b')]['key']};});_0xf2bcbb[_0x0c42('0x4c')]=_[_0x0c42('0x47')](_0x4d52db,_0x0c42('0x40'));_0xf2bcbb[_0x0c42('0x4d')]=_['keys'](_0x1ff62e[_0x0c42('0x4d')]);_0xf2bcbb[_0x0c42('0x4e')]=_[_0x0c42('0x4f')](_0xf2bcbb[_0x0c42('0x4c')],_0xf2bcbb['query']);_0x27ad46[_0x0c42('0x50')]=_[_0x0c42('0x4f')](_0xf2bcbb[_0x0c42('0x4c')],qs[_0x0c42('0x51')](_0x1ff62e['query'][_0x0c42('0x51')]));_0x27ad46[_0x0c42('0x50')]=_0x27ad46['attributes']['length']?_0x27ad46[_0x0c42('0x50')]:_0xf2bcbb[_0x0c42('0x4c')];if(!_0x1ff62e['query'][_0x0c42('0x52')](_0x0c42('0x53'))){_0x27ad46[_0x0c42('0x34')]=qs['limit'](_0x1ff62e[_0x0c42('0x4d')][_0x0c42('0x34')]);_0x27ad46['offset']=qs[_0x0c42('0x32')](_0x1ff62e[_0x0c42('0x4d')][_0x0c42('0x32')]);}_0x27ad46[_0x0c42('0x54')]=qs[_0x0c42('0x55')](_0x1ff62e[_0x0c42('0x4d')][_0x0c42('0x55')]);_0x27ad46[_0x0c42('0x56')]=qs['filters'](_[_0x0c42('0x57')](_0x1ff62e[_0x0c42('0x4d')],_0xf2bcbb['filters']),_0x4d52db);if(_0x1ff62e[_0x0c42('0x4d')]['filter']){_0x27ad46[_0x0c42('0x56')]=_[_0x0c42('0x58')](_0x27ad46[_0x0c42('0x56')],{'$or':_[_0x0c42('0x47')](_0x4d52db,function(_0x2932b3){if(_0x2932b3[_0x0c42('0x4b')]!==_0x0c42('0x59')){var _0x466181={};_0x466181[_0x2932b3[_0x0c42('0x40')]]={'$like':'%'+_0x1ff62e[_0x0c42('0x4d')][_0x0c42('0x5a')]+'%'};return _0x466181;}})});}_0x27ad46=_[_0x0c42('0x58')]({},_0x27ad46,_0x1ff62e[_0x0c42('0x5b')]);var _0x12f6dc={'where':_0x27ad46[_0x0c42('0x56')]};return db[_0x0c42('0x48')]['count'](_0x12f6dc)[_0x0c42('0x23')](function(_0x15690b){_0x271aeb[_0x0c42('0x5c')]=_0x15690b;if(_0x1ff62e[_0x0c42('0x4d')][_0x0c42('0x5d')]){_0x27ad46[_0x0c42('0x5e')]=[{'all':!![]}];}return db[_0x0c42('0x48')][_0x0c42('0x5f')](_0x27ad46);})['then'](function(_0x2c876c){_0x271aeb[_0x0c42('0x60')]=_0x2c876c;return _0x271aeb;})[_0x0c42('0x23')](respondWithFilteredResult(_0x17d576,_0x27ad46))[_0x0c42('0x2e')](handleError(_0x17d576,null));};exports[_0x0c42('0x61')]=function(_0x379b25,_0x12939f){var _0x368a42={'raw':![],'where':{'id':_0x379b25['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x0c42('0x42')},{'model':db[_0x0c42('0x43')],'as':_0x0c42('0x44')},{'model':db[_0x0c42('0x45')],'as':_0x0c42('0x46')}]},_0x2887a6={};_0x2887a6[_0x0c42('0x4c')]=_[_0x0c42('0x62')](db['MailAccount'][_0x0c42('0x49')]);_0x2887a6[_0x0c42('0x4d')]=_[_0x0c42('0x62')](_0x379b25[_0x0c42('0x4d')]);_0x2887a6[_0x0c42('0x4e')]=_['intersection'](_0x2887a6['model'],_0x2887a6[_0x0c42('0x4d')]);_0x368a42['attributes']=_['intersection'](_0x2887a6[_0x0c42('0x4c')],qs[_0x0c42('0x51')](_0x379b25[_0x0c42('0x4d')]['fields']));_0x368a42['attributes']=_0x368a42[_0x0c42('0x50')][_0x0c42('0x63')]?_0x368a42[_0x0c42('0x50')]:_0x2887a6[_0x0c42('0x4c')];if(_0x379b25[_0x0c42('0x4d')][_0x0c42('0x5d')]){_0x368a42[_0x0c42('0x5e')]=[{'all':!![]}];}_0x368a42=_[_0x0c42('0x58')]({},_0x368a42,_0x379b25[_0x0c42('0x5b')]);return db['MailAccount'][_0x0c42('0x64')](_0x368a42)[_0x0c42('0x23')](handleEntityNotFound(_0x12939f,null))[_0x0c42('0x23')](respondWithResult(_0x12939f,null))[_0x0c42('0x2e')](handleError(_0x12939f,null));};exports['update']=function(_0xfa4c82,_0x50bd6a){if(_0xfa4c82[_0x0c42('0x65')]['id']){delete _0xfa4c82['body']['id'];}return db[_0x0c42('0x48')][_0x0c42('0x64')]({'where':{'id':_0xfa4c82['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x0c42('0x42')},{'model':db[_0x0c42('0x43')],'as':_0x0c42('0x44')},{'model':db[_0x0c42('0x45')],'as':_0x0c42('0x46')}]})['then'](handleEntityNotFound(_0x50bd6a,null))['then'](saveUpdates(_0xfa4c82[_0x0c42('0x65')],null))[_0x0c42('0x23')](function(_0x5cb8bc){if(_0x5cb8bc&&_0xfa4c82['body']['Imap']){return db[_0x0c42('0x66')][_0x0c42('0x3b')](_0xfa4c82[_0x0c42('0x65')]['Imap'],{'where':{'MailAccountId':_0x5cb8bc['id']}})['then'](function(){return _0x5cb8bc;});}return _0x5cb8bc;})[_0x0c42('0x23')](function(_0xb2ac6b){if(_0xb2ac6b&&_0xfa4c82['body'][_0x0c42('0x44')]){return db['MailServerOut']['update'](_0xfa4c82[_0x0c42('0x65')][_0x0c42('0x44')],{'where':{'MailAccountId':_0xb2ac6b['id']}})[_0x0c42('0x23')](function(){return _0xb2ac6b;});}return _0xb2ac6b;})[_0x0c42('0x23')](respondWithResult(_0x50bd6a,null))[_0x0c42('0x2e')](handleError(_0x50bd6a,null));};exports[_0x0c42('0x67')]=function(_0x2a1d3c,_0x2a515b){return db['MailAccount'][_0x0c42('0x67')]()['then'](respondWithResult(_0x2a515b,null))[_0x0c42('0x2e')](handleError(_0x2a515b,null));};exports[_0x0c42('0x68')]=function(_0x55fed3,_0x3c9d03,_0x20b22f){if(_0x55fed3[_0x0c42('0x65')]['id']){delete _0x55fed3['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x55fed3[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x3c9d03,null))['then'](function(_0x734936){if(_0x734936){_0x55fed3['body'][_0x0c42('0x6a')]=_0x734936['id'];return db['Disposition']['create'](_0x55fed3[_0x0c42('0x65')]);}})[_0x0c42('0x23')](respondWithResult(_0x3c9d03,null))[_0x0c42('0x2e')](handleError(_0x3c9d03,null));};exports[_0x0c42('0x6b')]=function(_0x54cd10,_0x25091d,_0x538c4a){var _0xe2a21c={'raw':![],'where':{}};var _0x5ac762={};var _0x3391ae={'count':0x0,'rows':[]};return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x54cd10[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x25091d,null))[_0x0c42('0x23')](function(_0x5a6f11){if(_0x5a6f11){_0x5ac762[_0x0c42('0x4c')]=_[_0x0c42('0x62')](db['Disposition'][_0x0c42('0x49')]);_0x5ac762[_0x0c42('0x4d')]=_[_0x0c42('0x62')](_0x54cd10[_0x0c42('0x4d')]);_0x5ac762[_0x0c42('0x4e')]=_[_0x0c42('0x4f')](_0x5ac762[_0x0c42('0x4c')],_0x5ac762[_0x0c42('0x4d')]);_0xe2a21c[_0x0c42('0x50')]=_['intersection'](_0x5ac762[_0x0c42('0x4c')],qs[_0x0c42('0x51')](_0x54cd10['query'][_0x0c42('0x51')]));_0xe2a21c[_0x0c42('0x50')]=_0xe2a21c[_0x0c42('0x50')][_0x0c42('0x63')]?_0xe2a21c[_0x0c42('0x50')]:_0x5ac762[_0x0c42('0x4c')];if(!_0x54cd10[_0x0c42('0x4d')]['hasOwnProperty'](_0x0c42('0x53'))){_0xe2a21c[_0x0c42('0x34')]=qs[_0x0c42('0x34')](_0x54cd10['query']['limit']);_0xe2a21c[_0x0c42('0x32')]=qs['offset'](_0x54cd10['query'][_0x0c42('0x32')]);}_0xe2a21c[_0x0c42('0x54')]=qs[_0x0c42('0x55')](_0x54cd10[_0x0c42('0x4d')][_0x0c42('0x55')]);_0xe2a21c[_0x0c42('0x56')]=qs['filters'](_[_0x0c42('0x57')](_0x54cd10[_0x0c42('0x4d')],_0x5ac762[_0x0c42('0x4e')]));_0xe2a21c[_0x0c42('0x56')]['MailAccountId']=_0x5a6f11['id'];if(_0x54cd10['query'][_0x0c42('0x5a')]){_0xe2a21c[_0x0c42('0x56')]=_[_0x0c42('0x58')](_0xe2a21c[_0x0c42('0x56')],{'$or':_['map'](_0xe2a21c[_0x0c42('0x50')],function(_0x33e7b0){var _0x19caf8={};_0x19caf8[_0x33e7b0]={'$like':'%'+_0x54cd10['query'][_0x0c42('0x5a')]+'%'};return _0x19caf8;})});}_0xe2a21c=_['merge']({},_0xe2a21c,_0x54cd10[_0x0c42('0x5b')]);return db[_0x0c42('0x6d')][_0x0c42('0x5c')]({'where':_0xe2a21c[_0x0c42('0x56')]})[_0x0c42('0x23')](function(_0x3e7350){_0x3391ae[_0x0c42('0x5c')]=_0x3e7350;if(_0x54cd10[_0x0c42('0x4d')][_0x0c42('0x5d')]){_0xe2a21c[_0x0c42('0x5e')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xe2a21c);})[_0x0c42('0x23')](function(_0x57504){_0x3391ae[_0x0c42('0x60')]=_0x57504;return _0x3391ae;});}})[_0x0c42('0x23')](respondWithFilteredResult(_0x25091d,_0xe2a21c))[_0x0c42('0x2e')](handleError(_0x25091d,null));};exports[_0x0c42('0x6e')]=function(_0x1f5b7e,_0x3888bb,_0x44f2e3){return db['MailAccount'][_0x0c42('0x64')]({'where':{'id':_0x1f5b7e['params']['id']}})['then'](handleEntityNotFound(_0x3888bb,null))[_0x0c42('0x23')](function(_0x11143a){if(_0x11143a){return _0x11143a['removeDispositions'](_0x1f5b7e[_0x0c42('0x4d')]['ids']);}})[_0x0c42('0x23')](respondWithStatusCode(_0x3888bb,null))[_0x0c42('0x2e')](handleError(_0x3888bb,null));};exports[_0x0c42('0x6f')]=function(_0x1072c7,_0x3c5c48,_0x35bef3){if(_0x1072c7[_0x0c42('0x65')]['id']){delete _0x1072c7[_0x0c42('0x65')]['id'];}return db['MailAccount'][_0x0c42('0x64')]({'where':{'id':_0x1072c7['params']['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x3c5c48,null))['then'](function(_0x230191){if(_0x230191){_0x1072c7[_0x0c42('0x65')][_0x0c42('0x6a')]=_0x230191['id'];return db['CannedAnswer'][_0x0c42('0x70')](_0x1072c7[_0x0c42('0x65')]);}})[_0x0c42('0x23')](respondWithResult(_0x3c5c48,null))[_0x0c42('0x2e')](handleError(_0x3c5c48,null));};exports[_0x0c42('0x71')]=function(_0x1b9aeb,_0x172092,_0x11ef22){var _0x493216={'raw':![],'where':{}};var _0x41b059={};var _0x48da3f={'count':0x0,'rows':[]};return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x1b9aeb[_0x0c42('0x69')]['id']}})['then'](handleEntityNotFound(_0x172092,null))[_0x0c42('0x23')](function(_0x596d08){if(_0x596d08){_0x41b059[_0x0c42('0x4c')]=_['keys'](db[_0x0c42('0x72')][_0x0c42('0x49')]);_0x41b059[_0x0c42('0x4d')]=_[_0x0c42('0x62')](_0x1b9aeb[_0x0c42('0x4d')]);_0x41b059['filters']=_['intersection'](_0x41b059[_0x0c42('0x4c')],_0x41b059[_0x0c42('0x4d')]);_0x493216['attributes']=_[_0x0c42('0x4f')](_0x41b059[_0x0c42('0x4c')],qs[_0x0c42('0x51')](_0x1b9aeb[_0x0c42('0x4d')][_0x0c42('0x51')]));_0x493216[_0x0c42('0x50')]=_0x493216['attributes'][_0x0c42('0x63')]?_0x493216[_0x0c42('0x50')]:_0x41b059[_0x0c42('0x4c')];if(!_0x1b9aeb[_0x0c42('0x4d')]['hasOwnProperty'](_0x0c42('0x53'))){_0x493216['limit']=qs[_0x0c42('0x34')](_0x1b9aeb['query'][_0x0c42('0x34')]);_0x493216[_0x0c42('0x32')]=qs[_0x0c42('0x32')](_0x1b9aeb[_0x0c42('0x4d')][_0x0c42('0x32')]);}_0x493216[_0x0c42('0x54')]=qs['sort'](_0x1b9aeb[_0x0c42('0x4d')]['sort']);_0x493216['where']=qs[_0x0c42('0x4e')](_[_0x0c42('0x57')](_0x1b9aeb[_0x0c42('0x4d')],_0x41b059[_0x0c42('0x4e')]));_0x493216[_0x0c42('0x56')][_0x0c42('0x6a')]=_0x596d08['id'];if(_0x1b9aeb[_0x0c42('0x4d')]['filter']){_0x493216[_0x0c42('0x56')]=_[_0x0c42('0x58')](_0x493216[_0x0c42('0x56')],{'$or':_['map'](_0x493216[_0x0c42('0x50')],function(_0x2f7ffd){var _0x2789f3={};_0x2789f3[_0x2f7ffd]={'$like':'%'+_0x1b9aeb[_0x0c42('0x4d')][_0x0c42('0x5a')]+'%'};return _0x2789f3;})});}_0x493216=_[_0x0c42('0x58')]({},_0x493216,_0x1b9aeb[_0x0c42('0x5b')]);return db[_0x0c42('0x72')]['count']({'where':_0x493216[_0x0c42('0x56')]})[_0x0c42('0x23')](function(_0x16a4c0){_0x48da3f[_0x0c42('0x5c')]=_0x16a4c0;if(_0x1b9aeb[_0x0c42('0x4d')]['includeAll']){_0x493216[_0x0c42('0x5e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0c42('0x5f')](_0x493216);})[_0x0c42('0x23')](function(_0x34aac5){_0x48da3f[_0x0c42('0x60')]=_0x34aac5;return _0x48da3f;});}})[_0x0c42('0x23')](respondWithFilteredResult(_0x172092,_0x493216))[_0x0c42('0x2e')](handleError(_0x172092,null));};exports[_0x0c42('0x73')]=function(_0x5044f6,_0xe578b7,_0x411533){return db[_0x0c42('0x48')][_0x0c42('0x64')]({'where':{'id':_0x5044f6[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0xe578b7,null))[_0x0c42('0x23')](function(_0x1d1f7f){if(_0x1d1f7f){return _0x1d1f7f[_0x0c42('0x73')](_0x5044f6[_0x0c42('0x4d')][_0x0c42('0x74')]);}})['then'](respondWithStatusCode(_0xe578b7,null))[_0x0c42('0x2e')](handleError(_0xe578b7,null));};exports[_0x0c42('0x70')]=function(_0x4e6693,_0x1c8d1b){var _0x53602a={'name':_0x4e6693[_0x0c42('0x65')][_0x0c42('0x40')],'key':_0x4e6693['body'][_0x0c42('0x75')],'email':_0x4e6693['body'][_0x0c42('0x76')],'ListId':_0x4e6693[_0x0c42('0x65')][_0x0c42('0x77')],'active':!_[_0x0c42('0x78')](_0x4e6693[_0x0c42('0x65')][_0x0c42('0x79')])?_0x4e6693['body'][_0x0c42('0x79')]:!![],'description':_0x4e6693[_0x0c42('0x65')][_0x0c42('0x7a')]||null,'Imap':{},'Smtp':{}};if(_[_0x0c42('0x78')](_0x4e6693['body'][_0x0c42('0x7b')])){if(_0x4e6693['body']['cauthentication']){_0x53602a[_0x0c42('0x42')][_0x0c42('0x7c')]=_0x53602a[_0x0c42('0x44')][_0x0c42('0x7c')]=_0x4e6693['body'][_0x0c42('0x7d')];_0x53602a[_0x0c42('0x42')][_0x0c42('0x7e')]=_0x53602a[_0x0c42('0x44')][_0x0c42('0x7f')]=_0x4e6693['body'][_0x0c42('0x80')];}else{_0x53602a['Imap'][_0x0c42('0x81')]=_0x53602a[_0x0c42('0x44')][_0x0c42('0x81')]=![];}_0x53602a[_0x0c42('0x42')][_0x0c42('0x82')]=_0x4e6693[_0x0c42('0x65')][_0x0c42('0x42')][_0x0c42('0x82')];_0x53602a[_0x0c42('0x42')][_0x0c42('0x83')]=_0x4e6693['body']['Imap']['port'];_0x53602a[_0x0c42('0x44')]['host']=_0x4e6693[_0x0c42('0x65')][_0x0c42('0x44')][_0x0c42('0x82')];_0x53602a['Smtp']['port']=_0x4e6693[_0x0c42('0x65')]['Smtp'][_0x0c42('0x83')];}else{_0x53602a[_0x0c42('0x42')][_0x0c42('0x84')]=_0x53602a[_0x0c42('0x44')]['service']=_0x4e6693[_0x0c42('0x65')][_0x0c42('0x7b')];_0x53602a[_0x0c42('0x42')]['user']=_0x53602a[_0x0c42('0x44')][_0x0c42('0x7c')]=_0x4e6693[_0x0c42('0x65')][_0x0c42('0x7d')];_0x53602a[_0x0c42('0x42')][_0x0c42('0x7e')]=_0x53602a[_0x0c42('0x44')][_0x0c42('0x7f')]=_0x4e6693[_0x0c42('0x65')][_0x0c42('0x80')];}return db[_0x0c42('0x48')][_0x0c42('0x70')](_0x53602a,{'include':[{'model':db[_0x0c42('0x43')],'as':_0x0c42('0x44')},{'model':db[_0x0c42('0x66')],'as':_0x0c42('0x42')}]})['then'](function(_0x434ef5){var _0x519ae9=_0x4e6693[_0x0c42('0x7c')][_0x0c42('0x3d')]({'plain':!![]});if(!_0x519ae9)throw new Error(_0x0c42('0x85'));if(_0x519ae9[_0x0c42('0x86')]==='user'){var _0x185fde=_0x434ef5[_0x0c42('0x3d')]({'plain':!![]});return db['UserProfileSection'][_0x0c42('0x64')]({'where':{'name':_0x0c42('0x3e'),'userProfileId':_0x519ae9[_0x0c42('0x87')]},'raw':!![]})['then'](function(_0x89c351){if(_0x89c351&&_0x89c351[_0x0c42('0x88')]===0x0){return db['UserProfileResource'][_0x0c42('0x70')]({'name':_0x185fde['name'],'resourceId':_0x185fde['id'],'type':_0x89c351['name'],'sectionId':_0x89c351['id']},{})[_0x0c42('0x23')](function(){return _0x434ef5;});}else{return _0x434ef5;}})[_0x0c42('0x2e')](function(_0x4fc173){logger[_0x0c42('0x2a')](_0x0c42('0x89'),_0x4fc173);throw _0x4fc173;});}return _0x434ef5;})['then'](respondWithResult(_0x1c8d1b,0xc9))['catch'](handleError(_0x1c8d1b,null));};exports['getImap']=function(_0x3e6b26,_0x4c50a0,_0x5be3ca){return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x3e6b26[_0x0c42('0x69')]['id']}})['then'](handleEntityNotFound(_0x4c50a0,null))[_0x0c42('0x23')](function(_0x522f61){if(_0x522f61){return _0x522f61[_0x0c42('0x8a')]();}return null;})[_0x0c42('0x23')](respondWithResult(_0x4c50a0,null))[_0x0c42('0x2e')](handleError(_0x4c50a0,null));};exports['addImap']=function(_0x5eb4b4,_0x57d363,_0x408cfa){if(_0x5eb4b4[_0x0c42('0x65')]['id']){delete _0x5eb4b4['body']['id'];}return db[_0x0c42('0x48')][_0x0c42('0x64')]({'where':{'id':_0x5eb4b4[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x57d363,null))[_0x0c42('0x23')](function(_0x539e10){if(_0x539e10){_0x5eb4b4[_0x0c42('0x65')][_0x0c42('0x6a')]=_0x539e10['id'];return db[_0x0c42('0x66')][_0x0c42('0x70')](_0x5eb4b4[_0x0c42('0x65')]);}})['then'](respondWithResult(_0x57d363,null))[_0x0c42('0x2e')](handleError(_0x57d363,null));};exports['removeImap']=function(_0x5323cd,_0x5ebcb5,_0x27bd56){return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x5323cd['params']['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x5ebcb5,null))['then'](function(_0x494e65){if(_0x494e65){return _0x494e65[_0x0c42('0x8b')](null);}return null;})[_0x0c42('0x23')](respondWithStatusCode(_0x5ebcb5,null))[_0x0c42('0x2e')](handleError(_0x5ebcb5,null));};exports['getSmtp']=function(_0x23ab17,_0x565230,_0x325e54){return db['MailAccount'][_0x0c42('0x6c')]({'where':{'id':_0x23ab17[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x565230,null))[_0x0c42('0x23')](function(_0x542f1e){if(_0x542f1e){return _0x542f1e[_0x0c42('0x8c')]();}return null;})[_0x0c42('0x23')](respondWithResult(_0x565230,null))[_0x0c42('0x2e')](handleError(_0x565230,null));};exports['addSmtp']=function(_0xb97114,_0x22cba5,_0xb1743){if(_0xb97114[_0x0c42('0x65')]['id']){delete _0xb97114[_0x0c42('0x65')]['id'];}return db['MailAccount'][_0x0c42('0x64')]({'where':{'id':_0xb97114[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x22cba5,null))[_0x0c42('0x23')](function(_0x10e114){if(_0x10e114){_0xb97114['body'][_0x0c42('0x6a')]=_0x10e114['id'];return db[_0x0c42('0x43')][_0x0c42('0x70')](_0xb97114[_0x0c42('0x65')]);}})[_0x0c42('0x23')](respondWithResult(_0x22cba5,null))['catch'](handleError(_0x22cba5,null));};exports[_0x0c42('0x8d')]=function(_0x274534,_0x360842,_0xc63cb3){return db[_0x0c42('0x48')]['findOne']({'where':{'id':_0x274534[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x360842,null))[_0x0c42('0x23')](function(_0xc109a7){if(_0xc109a7){return _0xc109a7[_0x0c42('0x8e')](null);}return null;})[_0x0c42('0x23')](respondWithStatusCode(_0x360842,null))[_0x0c42('0x2e')](handleError(_0x360842,null));};exports[_0x0c42('0x8f')]=function(_0x199861,_0x15c4bd,_0x633b57){return db[_0x0c42('0x90')][_0x0c42('0x64')]({'where':{'id':_0x199861['params']['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x15c4bd,null))['then'](function(_0x32a0aa){if(_0x32a0aa){return _0x32a0aa[_0x0c42('0x8f')](_0x199861[_0x0c42('0x65')][_0x0c42('0x74')],_[_0x0c42('0x91')](_0x199861[_0x0c42('0x65')],['ids','id'])||{});}})[_0x0c42('0x23')](respondWithResult(_0x15c4bd,null))['catch'](handleError(_0x15c4bd,null));};exports[_0x0c42('0x92')]=function(_0x41a775,_0x26b90e,_0x40c7fe){var _0x589953={'raw':![],'where':{}};var _0x46ec6e={};var _0x20cd89={'count':0x0,'rows':[]};return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x41a775['params']['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x26b90e,null))[_0x0c42('0x23')](function(_0x2e9df6){if(_0x2e9df6){_0x46ec6e['model']=_[_0x0c42('0x62')](db[_0x0c42('0x90')][_0x0c42('0x49')]);_0x46ec6e[_0x0c42('0x4d')]=_[_0x0c42('0x62')](_0x41a775[_0x0c42('0x4d')]);_0x46ec6e[_0x0c42('0x4e')]=_[_0x0c42('0x4f')](_0x46ec6e[_0x0c42('0x4c')],_0x46ec6e[_0x0c42('0x4d')]);_0x589953[_0x0c42('0x50')]=_[_0x0c42('0x4f')](_0x46ec6e[_0x0c42('0x4c')],qs[_0x0c42('0x51')](_0x41a775[_0x0c42('0x4d')][_0x0c42('0x51')]));_0x589953[_0x0c42('0x50')]=_0x589953[_0x0c42('0x50')][_0x0c42('0x63')]?_0x589953[_0x0c42('0x50')]:_0x46ec6e[_0x0c42('0x4c')];if(!_0x41a775[_0x0c42('0x4d')][_0x0c42('0x52')]('nolimit')){_0x589953[_0x0c42('0x34')]=qs[_0x0c42('0x34')](_0x41a775[_0x0c42('0x4d')]['limit']);_0x589953['offset']=qs[_0x0c42('0x32')](_0x41a775['query']['offset']);}_0x589953[_0x0c42('0x54')]=qs[_0x0c42('0x55')](_0x41a775[_0x0c42('0x4d')][_0x0c42('0x55')]);_0x589953['where']=qs[_0x0c42('0x4e')](_['pick'](_0x41a775[_0x0c42('0x4d')],_0x46ec6e['filters']));_0x589953['where']['MailAccountId']=_0x2e9df6['id'];if(_0x41a775[_0x0c42('0x4d')]['filter']){_0x589953['where']=_[_0x0c42('0x58')](_0x589953[_0x0c42('0x56')],{'$or':_[_0x0c42('0x47')](_0x589953['attributes'],function(_0x5712c4){var _0x4b98bc={};_0x4b98bc[_0x5712c4]={'$like':'%'+_0x41a775['query']['filter']+'%'};return _0x4b98bc;})});}_0x589953=_[_0x0c42('0x58')]({},_0x589953,_0x41a775[_0x0c42('0x5b')]);return db[_0x0c42('0x90')][_0x0c42('0x5c')]({'where':_0x589953[_0x0c42('0x56')]})[_0x0c42('0x23')](function(_0x14f2d5){_0x20cd89[_0x0c42('0x5c')]=_0x14f2d5;if(_0x41a775['query'][_0x0c42('0x5d')]){_0x589953[_0x0c42('0x5e')]=[{'model':db['CmContact'],'as':_0x0c42('0x93'),'required':![]},{'model':db[_0x0c42('0x94')],'as':_0x0c42('0x95'),'attributes':['name',_0x0c42('0x96'),'internal'],'required':![]},{'model':db[_0x0c42('0x97')],'as':_0x0c42('0x98'),'attributes':['id',_0x0c42('0x40'),_0x0c42('0x99')],'where':_0x41a775[_0x0c42('0x4d')][_0x0c42('0x9a')]?{'id':_0x41a775[_0x0c42('0x4d')][_0x0c42('0x9a')]}:undefined,'required':_0x41a775[_0x0c42('0x4d')][_0x0c42('0x9a')]?!![]:![]}];}return db[_0x0c42('0x90')]['findAll'](_0x589953);})[_0x0c42('0x23')](function(_0x59ee97){_0x20cd89[_0x0c42('0x60')]=_0x59ee97;return _0x20cd89;});}})[_0x0c42('0x23')](respondWithFilteredResult(_0x26b90e,_0x589953))[_0x0c42('0x2e')](handleError(_0x26b90e,null));};exports['addApplications']=function addApplications(_0x174032,_0xbb1165){var _0x520956=_0x174032[_0x0c42('0x69')]['id'];var _0x58d97c=_0x174032['body'];var _0x22c9dd=0xc8;var _0x58a562=null;return db['sequelize'][_0x0c42('0x9b')]({'isolationLevel':db[_0x0c42('0x9c')]['Transaction'][_0x0c42('0x9d')][_0x0c42('0x9e')]},function(_0x22c3a0){return db['MailAccount'][_0x0c42('0x6c')]({'where':{'id':_0x520956},'transaction':_0x22c3a0})[_0x0c42('0x23')](function(_0x3373b1){if(_0x3373b1){return db[_0x0c42('0x9f')][_0x0c42('0x3c')]({'where':{'MailAccountId':_0x520956},'transaction':_0x22c3a0})['then'](function(){var _0xff4be7=_['map'](_0x58d97c,function(_0x52d36f){_0x52d36f['MailAccountId']=_0x520956;return _0x52d36f;});return db[_0x0c42('0x9f')]['bulkCreate'](_0xff4be7,{'transaction':_0x22c3a0});});}else{_0x22c9dd=0x194;_0x58a562=[];}});})['then'](function(){if(_0x22c9dd!==0x194){return db['MailApplication'][_0x0c42('0xa0')]({'where':{'MailAccountId':_0x520956},'order':_0x0c42('0xa1')})[_0x0c42('0x23')](function(_0x3c4019){_0x58a562=_0x3c4019;});}})[_0x0c42('0x2e')](function(_0x216956){_0x22c9dd=0x1f4;logger[_0x0c42('0x2a')](_0x216956[_0x0c42('0x3f')]);if(_0x216956[_0x0c42('0x40')]){delete _0x216956[_0x0c42('0x40')];}_0x58a562=_0x216956;})[_0x0c42('0xa2')](function(){if(_0x58a562===null){_0xbb1165[_0x0c42('0x2f')](_0x22c9dd);}else{if(_0x22c9dd===0x1f4){_0xbb1165[_0x0c42('0x30')](_0x22c9dd)[_0x0c42('0xa3')](_0x58a562);}else{_0xbb1165[_0x0c42('0x30')](_0x22c9dd)[_0x0c42('0x37')](_0x58a562);}}});};exports[_0x0c42('0xa4')]=function(_0x3e9d09,_0x5e4a17,_0x57e2a5){var _0x7c34d0={};var _0x48b78a={};var _0x5cea15;var _0xcbbdc9;return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x3e9d09[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x5e4a17,null))['then'](function(_0x461da0){if(_0x461da0){_0x5cea15=_0x461da0;_0x48b78a[_0x0c42('0x4c')]=_[_0x0c42('0x62')](db[_0x0c42('0x9f')][_0x0c42('0x49')]);_0x48b78a['query']=_[_0x0c42('0x62')](_0x3e9d09[_0x0c42('0x4d')]);_0x48b78a[_0x0c42('0x4e')]=_[_0x0c42('0x4f')](_0x48b78a['model'],_0x48b78a[_0x0c42('0x4d')]);_0x7c34d0[_0x0c42('0x50')]=_[_0x0c42('0x4f')](_0x48b78a[_0x0c42('0x4c')],qs[_0x0c42('0x51')](_0x3e9d09[_0x0c42('0x4d')][_0x0c42('0x51')]));_0x7c34d0[_0x0c42('0x50')]=_0x7c34d0[_0x0c42('0x50')]['length']?_0x7c34d0[_0x0c42('0x50')]:_0x48b78a['model'];_0x7c34d0['order']=qs[_0x0c42('0x55')](_0x3e9d09['query']['sort']);_0x7c34d0[_0x0c42('0x56')]=qs['filters'](_[_0x0c42('0x57')](_0x3e9d09[_0x0c42('0x4d')],_0x48b78a[_0x0c42('0x4e')]));if(_0x3e9d09[_0x0c42('0x4d')][_0x0c42('0x5a')]){_0x7c34d0['where']=_['merge'](_0x7c34d0[_0x0c42('0x56')],{'$or':_[_0x0c42('0x47')](_0x7c34d0['attributes'],function(_0x2f0afa){var _0x431077={};_0x431077[_0x2f0afa]={'$like':'%'+_0x3e9d09[_0x0c42('0x4d')][_0x0c42('0x5a')]+'%'};return _0x431077;})});}_0x7c34d0=_['merge']({},_0x7c34d0,_0x3e9d09[_0x0c42('0x5b')]);return _0x5cea15['getApplications'](_0x7c34d0);}})['then'](function(_0x4ce393){if(_0x4ce393){_0xcbbdc9=_0x4ce393['length'];if(!_0x3e9d09['query']['hasOwnProperty'](_0x0c42('0x53'))){_0x7c34d0[_0x0c42('0x34')]=qs[_0x0c42('0x34')](_0x3e9d09[_0x0c42('0x4d')][_0x0c42('0x34')]);_0x7c34d0[_0x0c42('0x32')]=qs[_0x0c42('0x32')](_0x3e9d09[_0x0c42('0x4d')]['offset']);}return _0x5cea15[_0x0c42('0xa4')](_0x7c34d0);}})['then'](function(_0x1705e1){if(_0x1705e1){return _0x1705e1?{'count':_0xcbbdc9,'rows':_0x1705e1}:null;}})[_0x0c42('0x23')](respondWithResult(_0x5e4a17,null))[_0x0c42('0x2e')](handleError(_0x5e4a17,null));};exports['getMessages']=function(_0x1cf89c,_0x11adcd,_0x2a311d){var _0x17ccf8={'raw':!![],'where':{}};var _0x2bacb4={};var _0x583d1e={'count':0x0,'rows':[]};return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x1cf89c['params']['id']}})['then'](handleEntityNotFound(_0x11adcd,null))[_0x0c42('0x23')](function(_0x5d32ba){if(_0x5d32ba){_0x2bacb4[_0x0c42('0x4c')]=_[_0x0c42('0x62')](db['MailMessage'][_0x0c42('0x49')]);_0x2bacb4[_0x0c42('0x4d')]=_[_0x0c42('0x62')](_0x1cf89c[_0x0c42('0x4d')]);_0x2bacb4[_0x0c42('0x4e')]=_[_0x0c42('0x4f')](_0x2bacb4['model'],_0x2bacb4['query']);_0x17ccf8['attributes']=_[_0x0c42('0x4f')](_0x2bacb4[_0x0c42('0x4c')],qs[_0x0c42('0x51')](_0x1cf89c[_0x0c42('0x4d')][_0x0c42('0x51')]));_0x17ccf8[_0x0c42('0x50')]=_0x17ccf8[_0x0c42('0x50')]['length']?_0x17ccf8['attributes']:_0x2bacb4['model'];if(!_0x1cf89c[_0x0c42('0x4d')][_0x0c42('0x52')]('nolimit')){_0x17ccf8['limit']=qs['limit'](_0x1cf89c[_0x0c42('0x4d')][_0x0c42('0x34')]);_0x17ccf8[_0x0c42('0x32')]=qs[_0x0c42('0x32')](_0x1cf89c[_0x0c42('0x4d')]['offset']);}_0x17ccf8[_0x0c42('0x54')]=qs[_0x0c42('0x55')](_0x1cf89c['query']['sort']);_0x17ccf8[_0x0c42('0x56')]=qs[_0x0c42('0x4e')](_[_0x0c42('0x57')](_0x1cf89c[_0x0c42('0x4d')],_0x2bacb4[_0x0c42('0x4e')]));_0x17ccf8[_0x0c42('0x56')]['MailAccountId']=_0x5d32ba['id'];if(_0x1cf89c[_0x0c42('0x4d')][_0x0c42('0x5a')]){_0x17ccf8[_0x0c42('0x56')]=_[_0x0c42('0x58')](_0x17ccf8[_0x0c42('0x56')],{'$or':_[_0x0c42('0x47')](_0x17ccf8[_0x0c42('0x50')],function(_0x55cef0){var _0x1dbd8c={};_0x1dbd8c[_0x55cef0]={'$like':'%'+_0x1cf89c[_0x0c42('0x4d')]['filter']+'%'};return _0x1dbd8c;})});}if(_0x1cf89c[_0x0c42('0x4d')][_0x0c42('0xa5')]){var _0xf18c58=_0x1cf89c['query'][_0x0c42('0xa5')]['split'](',');var _0x397e75={};_0x397e75[_0xf18c58[0x0]]={'$gte':moment(_0xf18c58[0x1])[_0x0c42('0xa6')](_0x0c42('0xa7'))};_0x17ccf8['where']=_[_0x0c42('0x58')](_0x17ccf8[_0x0c42('0x56')],_0x397e75);}_0x17ccf8=_[_0x0c42('0x58')]({},_0x17ccf8,_0x1cf89c[_0x0c42('0x5b')]);return db[_0x0c42('0xa8')][_0x0c42('0x5c')]({'where':_0x17ccf8[_0x0c42('0x56')]})[_0x0c42('0x23')](function(_0xd8322f){_0x583d1e[_0x0c42('0x5c')]=_0xd8322f;if(_0x1cf89c[_0x0c42('0x4d')][_0x0c42('0x5d')]){_0x17ccf8[_0x0c42('0x5e')]=[{'all':!![]}];}return db[_0x0c42('0xa8')]['findAll'](_0x17ccf8);})['then'](function(_0x414c96){if(_0x1cf89c[_0x0c42('0x4d')][_0x0c42('0xa9')]===_0x0c42('0xaa')){for(var _0x31b7bd=0x0;_0x31b7bd<_0x414c96[_0x0c42('0x63')];_0x31b7bd++){_0x414c96[_0x31b7bd][_0x0c42('0x65')]=juice(_0x414c96[_0x31b7bd][_0x0c42('0x65')]);}}_0x583d1e[_0x0c42('0x60')]=_0x414c96;return _0x583d1e;});}})[_0x0c42('0x23')](respondWithFilteredResult(_0x11adcd,_0x17ccf8))[_0x0c42('0x2e')](handleError(_0x11adcd,null));};exports['send']=function(_0x510f02,_0x220fcf,_0x1c765b){var _0xb4eac0,_0x270c1a={},_0x32b331;if(_0x510f02[_0x0c42('0x65')]['to']){_0x32b331=_0x510f02[_0x0c42('0x65')]['to'][_0x0c42('0xab')](',')[0x0];}return db[_0x0c42('0x48')][_0x0c42('0x64')]({'where':{'id':_0x510f02[_0x0c42('0x69')]['id']},'include':[{'model':db[_0x0c42('0xac')],'as':_0x0c42('0xad'),'include':[{'model':db[_0x0c42('0xae')],'as':_0x0c42('0xaf'),'where':{'email':_0x32b331},'limit':0x1,'order':[[_0x0c42('0xb0'),_0x0c42('0xb1')]]}]},{'model':db[_0x0c42('0x43')],'as':_0x0c42('0x44'),'raw':!![]}]})['then'](handleEntityNotFound(_0x220fcf,null))[_0x0c42('0x23')](function(_0x26a1f8){if(_0x26a1f8){_0xb4eac0=_0x26a1f8;if(_0x26a1f8[_0x0c42('0x44')]){if(_['isNil'](_0x510f02[_0x0c42('0x65')]['from'])){_0x510f02['body'][_0x0c42('0xb2')]=util[_0x0c42('0xa6')](_0x0c42('0xb3'),_0x26a1f8['name'],_0x26a1f8['email']||_0x26a1f8[_0x0c42('0x44')]['user']);}if(_0x510f02['body'][_0x0c42('0xb4')]&&_0x510f02[_0x0c42('0x65')][_0x0c42('0xb4')]['length']){for(var _0x14d614=0x0;_0x14d614<_0x510f02['body']['attachments'][_0x0c42('0x63')];_0x14d614+=0x1){_0x510f02[_0x0c42('0x65')][_0x0c42('0xb4')][_0x14d614]={'filename':_0x510f02[_0x0c42('0x65')][_0x0c42('0xb4')][_0x14d614][_0x0c42('0x40')],'path':path[_0x0c42('0xb5')](config[_0x0c42('0xb6')],_0x0c42('0xb7'),_0x510f02[_0x0c42('0x65')][_0x0c42('0xb4')][_0x14d614][_0x0c42('0xb8')])};}}var _0xa7c63d={'tls':{'rejectUnauthorized':![]}};if(_[_0x0c42('0x78')](_0x26a1f8[_0x0c42('0x44')][_0x0c42('0x84')])){if(_0x26a1f8[_0x0c42('0x44')]['authentication']){_0xa7c63d[_0x0c42('0xb9')]={'user':_0x26a1f8[_0x0c42('0x44')]['user'],'pass':_0x26a1f8[_0x0c42('0x44')][_0x0c42('0x7f')]};}_0xa7c63d[_0x0c42('0x82')]=_0x26a1f8[_0x0c42('0x44')]['host'];_0xa7c63d[_0x0c42('0x83')]=_0x26a1f8[_0x0c42('0x44')][_0x0c42('0x83')];_0xa7c63d[_0x0c42('0xba')]=_0x26a1f8[_0x0c42('0x44')][_0x0c42('0xba')];}else{_0xa7c63d['service']=_0x26a1f8[_0x0c42('0x44')][_0x0c42('0x84')];_0xa7c63d[_0x0c42('0xb9')]={'user':_0x26a1f8[_0x0c42('0x44')][_0x0c42('0x7c')],'pass':_0x26a1f8['Smtp']['pass']};}return respondWithRpcPromise(_0x0c42('0xbb'),_0x0c42('0xbc'),{'account':_0xa7c63d,'message':_0x510f02['body']});}else{throw new Error(_0x0c42('0xbd'));}}})[_0x0c42('0x23')](function(_0x140c9c){if(_0x140c9c){_0x270c1a=_0x140c9c;if(_0xb4eac0['List']){if(_0xb4eac0[_0x0c42('0xad')]['Contacts'][_0x0c42('0x63')]){return _0xb4eac0[_0x0c42('0xad')]['Contacts'][0x0];}else{return db[_0x0c42('0xae')][_0x0c42('0x70')](_[_0x0c42('0x1a')](_0x510f02[_0x0c42('0x65')],{'firstName':_0x510f02[_0x0c42('0x65')]['to'],'email':_0x510f02[_0x0c42('0x65')]['to'],'phone':_0x510f02[_0x0c42('0x65')]['to'],'ListId':_0xb4eac0[_0x0c42('0x77')]}));}}else{throw new Error(_0x0c42('0xbd'));}}})['then'](function(_0x3577e7){if(_0x3577e7){var _0x3e834a={'UserId':_0x510f02[_0x0c42('0x7c')]['id'],'ContactId':_0x3577e7['id'],'MailAccountId':_0xb4eac0['id'],'inReplyTo':_0x270c1a[_0x0c42('0xbe')],'to':_0x510f02[_0x0c42('0x65')]['from'],'cc':_0x510f02[_0x0c42('0x65')]['cc'],'subject':_0x510f02['body'][_0x0c42('0xbf')],'attach':_0x510f02[_0x0c42('0x65')][_0x0c42('0xc0')],'firstMsgDirection':_0x0c42('0xc1'),'lastMsgAt':moment()[_0x0c42('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x0c42('0xc1'),'Messages':[_['merge'](_0x510f02[_0x0c42('0x65')],{'messageId':_0x270c1a['messageId'],'sentAt':moment()[_0x0c42('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xb4eac0['id'],'UserId':_0x510f02[_0x0c42('0x7c')]['id'],'ContactId':_0x3577e7['id']})]};if(_0x510f02['body'][_0x0c42('0xc2')]){_0x3e834a=_[_0x0c42('0x58')](_0x3e834a,_0x510f02['body']['Interaction']);}return db[_0x0c42('0x90')]['create'](_0x3e834a,{'include':[{'model':db[_0x0c42('0xa8')],'as':_0x0c42('0xc3')}]});}})['then'](respondWithResult(_0x220fcf,null))['catch'](handleError(_0x220fcf,null));};exports[_0x0c42('0xc4')]=function(_0x487276,_0x5aeb13,_0x15eb0a){return db[_0x0c42('0x48')][_0x0c42('0x64')]({'where':{'id':_0x487276[_0x0c42('0x69')]['id']},'include':[{'model':db[_0x0c42('0x43')],'as':_0x0c42('0x44'),'raw':!![]}]})['then'](handleEntityNotFound(_0x5aeb13,null))[_0x0c42('0x23')](function(_0x4110cb){if(_0x4110cb&&_0x4110cb[_0x0c42('0x44')]){var _0x48dee0={'id':_0x4110cb['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4110cb[_0x0c42('0x44')][_0x0c42('0x84')]){_0x48dee0['service']=_0x4110cb[_0x0c42('0x44')][_0x0c42('0x84')];}else{_0x48dee0[_0x0c42('0x82')]=_0x4110cb['Smtp']['host'];_0x48dee0[_0x0c42('0x83')]=_0x4110cb[_0x0c42('0x44')][_0x0c42('0x83')];_0x48dee0[_0x0c42('0xba')]=_0x4110cb['Smtp'][_0x0c42('0xba')];}if(_0x4110cb[_0x0c42('0x44')][_0x0c42('0x81')]){_0x48dee0[_0x0c42('0xb9')]={'user':_0x4110cb['Smtp'][_0x0c42('0x7c')],'pass':_0x4110cb[_0x0c42('0x44')]['pass']};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x48dee0});}})[_0x0c42('0x23')](respondWithResult(_0x5aeb13,null))[_0x0c42('0x2e')](handleError(_0x5aeb13,null));};exports['destroy']=function(_0x4f8690,_0x1ccfb2){return db[_0x0c42('0x48')]['find']({'where':{'id':_0x4f8690['params']['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x1ccfb2,null))[_0x0c42('0x23')](function(_0x2818c6){if(_0x2818c6&&_0x2818c6['service']){throw new db[(_0x0c42('0xc5'))][(_0x0c42('0xc6'))](_0x0c42('0xc7'));}return _0x2818c6;})[_0x0c42('0x23')](removeEntity(_0x1ccfb2,null))[_0x0c42('0x2e')](handleError(_0x1ccfb2,null));};exports[_0x0c42('0xc8')]=function(_0x354282,_0xdfc16,_0x39e33a){return db[_0x0c42('0x48')][_0x0c42('0x64')]({'where':{'id':_0x354282[_0x0c42('0x69')]['id']}})['then'](handleEntityNotFound(_0xdfc16,null))[_0x0c42('0x23')](function(_0x17fb32){if(_0x17fb32){return _0x17fb32[_0x0c42('0xc8')](_0x354282[_0x0c42('0x65')][_0x0c42('0x74')],_[_0x0c42('0x91')](_0x354282['body'],[_0x0c42('0x74'),'id'])||{})[_0x0c42('0xc9')](function(_0x12665b){for(var _0x33553a=0x0;_0x33553a<_0x354282[_0x0c42('0x65')][_0x0c42('0x74')]['length'];_0x33553a+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x354282[_0x0c42('0x65')][_0x0c42('0x74')][_0x33553a]),'MailAccountId':Number(_0x354282[_0x0c42('0x69')]['id'])});}return _0x12665b;});}})['then'](respondWithResult(_0xdfc16,null))['catch'](handleError(_0xdfc16,null));};exports[_0x0c42('0xca')]=function(_0x41d53b,_0x10853b,_0x31e482){return db[_0x0c42('0x48')][_0x0c42('0x64')]({'where':{'id':_0x41d53b['params']['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0x10853b,null))[_0x0c42('0x23')](function(_0x1a3753){if(_0x1a3753){return _0x1a3753[_0x0c42('0xca')](_0x41d53b[_0x0c42('0x4d')][_0x0c42('0x74')])[_0x0c42('0x23')](function(){if(_[_0x0c42('0xcb')](_0x41d53b['query'][_0x0c42('0x74')])){for(var _0xf52800=0x0;_0xf52800<_0x41d53b[_0x0c42('0x4d')][_0x0c42('0x74')][_0x0c42('0x63')];_0xf52800+=0x1){socket[_0x0c42('0xcc')](_0x0c42('0xcd'),{'UserId':Number(_0x41d53b[_0x0c42('0x4d')][_0x0c42('0x74')][_0xf52800]),'MailAccountId':Number(_0x41d53b['params']['id'])});}}else{socket[_0x0c42('0xcc')](_0x0c42('0xcd'),{'UserId':Number(_0x41d53b[_0x0c42('0x4d')][_0x0c42('0x74')]),'MailAccountId':Number(_0x41d53b[_0x0c42('0x69')]['id'])});}});}})[_0x0c42('0x23')](respondWithStatusCode(_0x10853b,null))[_0x0c42('0x2e')](handleError(_0x10853b,null));};exports[_0x0c42('0xce')]=function(_0x5c4f32,_0xfb4da4,_0x2b216d){var _0x3bbc1f={};var _0x2b992b={};var _0x454c46;var _0x40ea22;return db[_0x0c42('0x48')][_0x0c42('0x6c')]({'where':{'id':_0x5c4f32[_0x0c42('0x69')]['id']}})[_0x0c42('0x23')](handleEntityNotFound(_0xfb4da4,null))[_0x0c42('0x23')](function(_0x293f58){if(_0x293f58){_0x454c46=_0x293f58;_0x2b992b[_0x0c42('0x4c')]=_[_0x0c42('0x62')](db['User'][_0x0c42('0x49')]);_0x2b992b['query']=_[_0x0c42('0x62')](_0x5c4f32[_0x0c42('0x4d')]);_0x2b992b[_0x0c42('0x4e')]=_[_0x0c42('0x4f')](_0x2b992b[_0x0c42('0x4c')],_0x2b992b['query']);_0x3bbc1f[_0x0c42('0x50')]=_['intersection'](_0x2b992b[_0x0c42('0x4c')],qs['fields'](_0x5c4f32[_0x0c42('0x4d')][_0x0c42('0x51')]));_0x3bbc1f[_0x0c42('0x50')]=_0x3bbc1f[_0x0c42('0x50')][_0x0c42('0x63')]?_0x3bbc1f[_0x0c42('0x50')]:_0x2b992b['model'];_0x3bbc1f[_0x0c42('0x54')]=qs[_0x0c42('0x55')](_0x5c4f32[_0x0c42('0x4d')][_0x0c42('0x55')]);_0x3bbc1f[_0x0c42('0x56')]=qs[_0x0c42('0x4e')](_[_0x0c42('0x57')](_0x5c4f32[_0x0c42('0x4d')],_0x2b992b[_0x0c42('0x4e')]));if(_0x5c4f32[_0x0c42('0x4d')][_0x0c42('0x5a')]){_0x3bbc1f[_0x0c42('0x56')]=_[_0x0c42('0x58')](_0x3bbc1f[_0x0c42('0x56')],{'$or':_[_0x0c42('0x47')](_0x3bbc1f[_0x0c42('0x50')],function(_0x215cb6){var _0x2c9237={};_0x2c9237[_0x215cb6]={'$like':'%'+_0x5c4f32[_0x0c42('0x4d')][_0x0c42('0x5a')]+'%'};return _0x2c9237;})});}_0x3bbc1f=_[_0x0c42('0x58')]({},_0x3bbc1f,_0x5c4f32[_0x0c42('0x5b')]);return _0x454c46['getAgents'](_0x3bbc1f);}})[_0x0c42('0x23')](function(_0xe96a69){if(_0xe96a69){_0x40ea22=_0xe96a69[_0x0c42('0x63')];if(!_0x5c4f32['query'][_0x0c42('0x52')]('nolimit')){_0x3bbc1f[_0x0c42('0x34')]=qs[_0x0c42('0x34')](_0x5c4f32[_0x0c42('0x4d')][_0x0c42('0x34')]);_0x3bbc1f[_0x0c42('0x32')]=qs[_0x0c42('0x32')](_0x5c4f32[_0x0c42('0x4d')][_0x0c42('0x32')]);}return _0x454c46[_0x0c42('0xce')](_0x3bbc1f);}})[_0x0c42('0x23')](function(_0x3c1c2a){if(_0x3c1c2a){return _0x3c1c2a?{'count':_0x40ea22,'rows':_0x3c1c2a}:null;}})['then'](respondWithResult(_0xfb4da4,null))[_0x0c42('0x2e')](handleError(_0xfb4da4,null));};
\ No newline at end of file
index c392ef5..09e5998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcd5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdcd5,0x110));var _0x5dcd=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0xdcd5[_0x4a96d2];return _0x38af04;};'use strict';var EventEmitter=require(_0x5dcd('0x0'));var MailAccount=require(_0x5dcd('0x1'))['db'][_0x5dcd('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5dcd('0x3')](0x0);var events={'afterCreate':_0x5dcd('0x4'),'afterUpdate':_0x5dcd('0x5'),'afterDestroy':_0x5dcd('0x6')};function emitEvent(_0x5447ba){return function(_0x1c13f5,_0x245dc8,_0x3e2af0){MailAccountEvents[_0x5dcd('0x7')](_0x5447ba+':'+_0x1c13f5['id'],_0x1c13f5);MailAccountEvents[_0x5dcd('0x7')](_0x5447ba,_0x1c13f5);_0x3e2af0(null);};}for(var e in events){if(events[_0x5dcd('0x8')](e)){var event=events[e];MailAccount[_0x5dcd('0x9')](e,emitEvent(event));}}module[_0x5dcd('0xa')]=MailAccountEvents;
\ No newline at end of file
+var _0xaeba=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','remove'];(function(_0x2c3f08,_0x380f2b){var _0x4ea2ab=function(_0x4b198a){while(--_0x4b198a){_0x2c3f08['push'](_0x2c3f08['shift']());}};_0x4ea2ab(++_0x380f2b);}(_0xaeba,0x1cf));var _0xaaeb=function(_0x550712,_0x42749c){_0x550712=_0x550712-0x0;var _0x23f2b8=_0xaeba[_0x550712];return _0x23f2b8;};'use strict';var EventEmitter=require(_0xaaeb('0x0'));var MailAccount=require(_0xaaeb('0x1'))['db'][_0xaaeb('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xaaeb('0x3'),'afterDestroy':_0xaaeb('0x4')};function emitEvent(_0x398800){return function(_0x491014,_0x3132df,_0x1f9314){MailAccountEvents['emit'](_0x398800+':'+_0x491014['id'],_0x491014);MailAccountEvents[_0xaaeb('0x5')](_0x398800,_0x491014);_0x1f9314(null);};}for(var e in events){if(events[_0xaaeb('0x6')](e)){var event=events[e];MailAccount[_0xaaeb('0x7')](e,emitEvent(event));}}module[_0xaaeb('0x8')]=MailAccountEvents;
\ No newline at end of file
index cd9688a..7f6681f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3a5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','mail_accounts','lodash','../../config/logger'];(function(_0x537bcd,_0x13bae1){var _0x6cc881=function(_0x3d470f){while(--_0x3d470f){_0x537bcd['push'](_0x537bcd['shift']());}};_0x6cc881(++_0x13bae1);}(_0xb3a5,0x1a2));var _0x5b3a=function(_0x4cf6ac,_0x4f3b6b){_0x4cf6ac=_0x4cf6ac-0x0;var _0xe56a48=_0xb3a5[_0x4cf6ac];return _0xe56a48;};'use strict';var _=require(_0x5b3a('0x0'));var util=require('util');var logger=require(_0x5b3a('0x1'))(_0x5b3a('0x2'));var moment=require(_0x5b3a('0x3'));var BPromise=require(_0x5b3a('0x4'));var rp=require(_0x5b3a('0x5'));var fs=require('fs');var path=require(_0x5b3a('0x6'));var rimraf=require(_0x5b3a('0x7'));var config=require(_0x5b3a('0x8'));var attributes=require(_0x5b3a('0x9'));module['exports']=function(_0x47e627,_0x5d842c){return _0x47e627[_0x5b3a('0xa')]('MailAccount',attributes,{'tableName':_0x5b3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4af6=['moment','bluebird','request-promise','../../config/environment','./mailAccount.attributes','exports','lodash','../../config/logger','api'];(function(_0x1f8df4,_0x5f3061){var _0x838117=function(_0x1d6d3c){while(--_0x1d6d3c){_0x1f8df4['push'](_0x1f8df4['shift']());}};_0x838117(++_0x5f3061);}(_0x4af6,0x1b6));var _0x64af=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4af6[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x64af('0x0'));var util=require('util');var logger=require(_0x64af('0x1'))(_0x64af('0x2'));var moment=require(_0x64af('0x3'));var BPromise=require(_0x64af('0x4'));var rp=require(_0x64af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x64af('0x6'));var attributes=require(_0x64af('0x7'));module[_0x64af('0x8')]=function(_0xaadef5,_0x3ac3eb){return _0xaadef5['define']('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5560f40..c1dbbd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bb6=['MailMessage','contact','originTo','originCc','ChatWebsiteId','originChannel','UserId','User','unshift','name','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailAccount.socket','register','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','List','omit','applications','priority','asc','autoclose','length','close','*,*,*,*','create','List\x20not\x20found','generate','messageId','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','spread','update','subject','format','interaction','get','created'];(function(_0x3e3dfd,_0x4bc620){var _0x50f585=function(_0x43cf7c){while(--_0x43cf7c){_0x3e3dfd['push'](_0x3e3dfd['shift']());}};_0x50f585(++_0x4bc620);}(_0x4bb6,0x1a0));var _0x64bb=function(_0x329098,_0x460312){_0x329098=_0x329098-0x0;var _0x4d2c47=_0x4bb6[_0x329098];return _0x4d2c47;};'use strict';var _=require(_0x64bb('0x0'));var util=require('util');var moment=require(_0x64bb('0x1'));var BPromise=require(_0x64bb('0x2'));var rs=require(_0x64bb('0x3'));var fs=require('fs');var Redis=require(_0x64bb('0x4'));var db=require(_0x64bb('0x5'))['db'];var utils=require(_0x64bb('0x6'));var logger=require('../../config/logger')(_0x64bb('0x7'));var config=require(_0x64bb('0x8'));var jayson=require(_0x64bb('0x9'));var client=jayson['client'][_0x64bb('0xa')]({'port':0x232c});config['redis']=_[_0x64bb('0xb')](config[_0x64bb('0xc')],{'host':_0x64bb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64bb('0xc')]));require(_0x64bb('0xe'))[_0x64bb('0xf')](socket);function respondWithRpcPromise(_0x2e8bb0,_0x547821,_0x2abc63){return new BPromise(function(_0x20dd49,_0x346250){return client['request'](_0x2e8bb0,_0x2abc63)['then'](function(_0x25fa06){logger[_0x64bb('0x10')](_0x64bb('0x11'),_0x547821,_0x64bb('0x12'));logger[_0x64bb('0x13')](_0x64bb('0x14'),_0x547821,'request\x20sent',JSON[_0x64bb('0x15')](_0x25fa06));if(_0x25fa06[_0x64bb('0x16')]){if(_0x25fa06[_0x64bb('0x16')][_0x64bb('0x17')]===0x1f4){logger[_0x64bb('0x16')]('MailAccount,\x20%s,\x20%s',_0x547821,_0x25fa06[_0x64bb('0x16')]['message']);return _0x346250(_0x25fa06[_0x64bb('0x16')][_0x64bb('0x18')]);}logger[_0x64bb('0x16')](_0x64bb('0x11'),_0x547821,_0x25fa06[_0x64bb('0x16')]['message']);return _0x20dd49(_0x25fa06[_0x64bb('0x16')][_0x64bb('0x18')]);}else{logger[_0x64bb('0x10')](_0x64bb('0x11'),_0x547821,'request\x20sent');_0x20dd49(_0x25fa06['result']['message']);}})[_0x64bb('0x19')](function(_0x5071cc){logger[_0x64bb('0x16')]('MailAccount,\x20%s,\x20%s',_0x547821,_0x5071cc);_0x346250(_0x5071cc);});});}exports[_0x64bb('0x1a')]=function(_0x3fbb17){var _0x2120a4=this;return new Promise(function(_0x534e5b,_0x493fef){return db[_0x64bb('0x1b')][_0x64bb('0x1c')]({'raw':_0x3fbb17[_0x64bb('0x1d')]?_0x3fbb17[_0x64bb('0x1d')][_0x64bb('0x1e')]===undefined?!![]:![]:!![],'where':_0x3fbb17[_0x64bb('0x1d')]?_0x3fbb17[_0x64bb('0x1d')][_0x64bb('0x1f')]||null:null,'attributes':_0x3fbb17[_0x64bb('0x1d')]?_0x3fbb17[_0x64bb('0x1d')][_0x64bb('0x20')]||null:null,'limit':_0x3fbb17['options']?_0x3fbb17[_0x64bb('0x1d')][_0x64bb('0x21')]||null:null,'include':_0x3fbb17['options']?_0x3fbb17['options'][_0x64bb('0x22')]?_[_0x64bb('0x23')](_0x3fbb17[_0x64bb('0x1d')][_0x64bb('0x22')],function(_0x3d1c19){return{'model':db[_0x3d1c19[_0x64bb('0x24')]],'as':_0x3d1c19['as'],'attributes':_0x3d1c19['attributes'],'include':_0x3d1c19['include']?_[_0x64bb('0x23')](_0x3d1c19['include'],function(_0x33b65c){return{'model':db[_0x33b65c['model']],'as':_0x33b65c['as'],'attributes':_0x33b65c[_0x64bb('0x20')],'include':_0x33b65c['include']?_[_0x64bb('0x23')](_0x33b65c[_0x64bb('0x22')],function(_0x96934){return{'model':db[_0x96934[_0x64bb('0x24')]],'as':_0x96934['as'],'attributes':_0x96934['attributes']};}):[]};}):[]};}):[]:[]})[_0x64bb('0x25')](function(_0x549f1b){logger[_0x64bb('0x10')]('GetMailAccount',_0x3fbb17);logger[_0x64bb('0x13')](_0x64bb('0x1a'),_0x3fbb17,JSON['stringify'](_0x549f1b));_0x534e5b(_0x549f1b);})[_0x64bb('0x19')](function(_0x8db78d){logger['error'](_0x64bb('0x1a'),_0x8db78d['message'],_0x3fbb17);_0x493fef(_0x2120a4[_0x64bb('0x16')](0x1f4,_0x8db78d[_0x64bb('0x18')]));});});};exports[_0x64bb('0x26')]=function(_0x2a1424){var _0x25214d=this;return new Promise(function(_0x9a43d3,_0x35293f){return db['MailAccount'][_0x64bb('0x27')]({'raw':_0x2a1424['options']?_0x2a1424[_0x64bb('0x1d')][_0x64bb('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a1424[_0x64bb('0x1d')]?_0x2a1424[_0x64bb('0x1d')][_0x64bb('0x1f')]||null:null,'attributes':_0x2a1424[_0x64bb('0x1d')]?_0x2a1424[_0x64bb('0x1d')][_0x64bb('0x20')]||null:null,'include':_0x2a1424[_0x64bb('0x1d')]?_0x2a1424[_0x64bb('0x1d')]['include']?_[_0x64bb('0x23')](_0x2a1424[_0x64bb('0x1d')][_0x64bb('0x22')],function(_0x46175c){return{'model':db[_0x46175c[_0x64bb('0x24')]],'as':_0x46175c['as'],'attributes':_0x46175c[_0x64bb('0x20')],'include':_0x46175c['include']?_['map'](_0x46175c[_0x64bb('0x22')],function(_0x23899c){return{'model':db[_0x23899c['model']],'as':_0x23899c['as'],'attributes':_0x23899c[_0x64bb('0x20')],'include':_0x23899c[_0x64bb('0x22')]?_[_0x64bb('0x23')](_0x23899c['include'],function(_0x88a080){return{'model':db[_0x88a080['model']],'as':_0x88a080['as'],'attributes':_0x88a080['attributes']};}):[]};}):[]};}):[]:[]})[_0x64bb('0x25')](function(_0x2ffc47){logger[_0x64bb('0x10')]('ShowMailAccount',_0x2a1424);logger['debug'](_0x64bb('0x26'),_0x2a1424,JSON[_0x64bb('0x15')](_0x2ffc47));_0x9a43d3(_0x2ffc47);})[_0x64bb('0x19')](function(_0x30dc2b){logger[_0x64bb('0x16')]('ShowMailAccount',_0x30dc2b['message'],_0x2a1424);_0x35293f(_0x25214d[_0x64bb('0x16')](0x1f4,_0x30dc2b[_0x64bb('0x18')]));});});};exports[_0x64bb('0x28')]=function(_0x5462df){var _0x2d029d=this;return new Promise(function(_0x4996f0,_0x1d88f0){var _0x239d33={'body':_0x5462df[_0x64bb('0x29')],'channel':_0x64bb('0x2a')};var _0x183b18=_[_0x64bb('0x2b')](_[_0x64bb('0x2c')](db[_0x64bb('0x2d')][_0x64bb('0x2e')]),['createdAt','updatedAt',_0x64bb('0x2f'),_0x64bb('0x30')]);var _0x2da8b3=![];if(_0x5462df[_0x64bb('0x29')]['id']){delete _0x5462df[_0x64bb('0x29')]['id'];}if(_['isNil'](_0x5462df['body']['from'])){return _0x1d88f0(_0x2d029d[_0x64bb('0x16')](0x1f4,_0x64bb('0x31')));}if(_['isNil'](_0x5462df['body'][_0x64bb('0x29')])||_0x5462df['body'][_0x64bb('0x29')]===''){return _0x1d88f0(_0x2d029d[_0x64bb('0x16')](0x1f4,_0x64bb('0x32')));}if(_[_0x64bb('0x33')](_0x5462df[_0x64bb('0x29')][_0x64bb('0x34')])){return _0x1d88f0(_0x2d029d[_0x64bb('0x16')](0x1f4,_0x64bb('0x35')+_0x183b18));}if(!_[_0x64bb('0x36')](_0x183b18,_0x5462df[_0x64bb('0x29')][_0x64bb('0x34')])){return _0x1d88f0(_0x2d029d[_0x64bb('0x16')](0x1f4,_0x64bb('0x37')+_0x183b18));}var _0x450934={};_0x450934[_0x5462df[_0x64bb('0x29')]['mapKey']]=_0x5462df[_0x64bb('0x29')][_0x64bb('0x38')];return db[_0x64bb('0x1b')][_0x64bb('0x27')]({'where':{'id':_0x5462df[_0x64bb('0x39')]['id']},'include':[{'model':db[_0x64bb('0x3a')],'as':'List','include':[{'model':db['CmContact'],'as':_0x64bb('0x3b'),'where':_0x450934,'limit':0x1,'order':[[_0x64bb('0x3c'),_0x64bb('0x3d')]]}]},{'model':db[_0x64bb('0x3e')],'as':_0x64bb('0x3f')},{'model':db[_0x64bb('0x40')],'as':'Smtp'}]})[_0x64bb('0x25')](function(_0x498dc0){if(_0x498dc0&&_0x498dc0[_0x64bb('0x41')]){var _0x5442e=_0x498dc0['get']({'plain':!![]});_0x239d33['account']=_[_0x64bb('0x42')](_0x5442e,[_0x64bb('0x3f'),_0x64bb('0x41')]);_0x239d33[_0x64bb('0x43')]=_0x5442e[_0x64bb('0x3f')];_0x239d33['list']=_0x5442e[_0x64bb('0x41')];_0x239d33[_0x64bb('0x43')]=_['orderBy'](_0x239d33[_0x64bb('0x43')],[_0x64bb('0x44')],[_0x64bb('0x45')]);if(_0x239d33[_0x64bb('0x39')]&&_0x239d33[_0x64bb('0x39')][_0x64bb('0x46')]){_0x239d33[_0x64bb('0x43')]['push']({'id':0x0,'priority':_0x239d33[_0x64bb('0x43')][_0x64bb('0x47')]+0x1,'app':_0x64bb('0x48'),'appdata':'autoclose','interval':_0x64bb('0x49')});}if(_0x239d33['account']['Applications']){delete _0x239d33[_0x64bb('0x39')][_0x64bb('0x3f')];}if(_0x239d33[_0x64bb('0x39')][_0x64bb('0x41')]){delete _0x239d33[_0x64bb('0x39')]['List'];}if(_0x5442e[_0x64bb('0x41')][_0x64bb('0x3b')][_0x64bb('0x47')]){return _0x5442e[_0x64bb('0x41')]['Contacts'][0x0];}var _0x561c25=_[_0x64bb('0xb')](_0x5462df[_0x64bb('0x29')],{'firstName':_0x5462df[_0x64bb('0x29')][_0x64bb('0x38')],'ListId':_0x5442e['ListId']});_0x561c25[_0x5462df[_0x64bb('0x29')][_0x64bb('0x34')]]=_0x5462df[_0x64bb('0x29')]['from'];return db[_0x64bb('0x2d')][_0x64bb('0x4a')](_0x561c25);}else{throw new Error(_0x64bb('0x4b'));}})[_0x64bb('0x25')](function(_0x31f930){_0x239d33['contact']=_0x31f930;if(_0x31f930){if(!_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['messageId']){_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['messageId']=rs[_0x64bb('0x4c')]()+'\x20'+_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')][_0x64bb('0x38')];}var _0x230af8={'ContactId':_0x31f930['id'],'MailAccountId':_0x5462df[_0x64bb('0x39')]['id'],'inReplyTo':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')][_0x64bb('0x4d')],'to':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')][_0x64bb('0x38')],'cc':_0x5462df['body'][_0x64bb('0x18')]['cc'],'subject':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['subject'],'attach':_0x5462df['body'][_0x64bb('0x18')][_0x64bb('0x4e')],'lastMsgAt':moment()['format'](_0x64bb('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x5462df['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x64bb('0x50'),'attributes':['messageId'],'where':{'messageId':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')][_0x64bb('0x51')]}}]})[_0x64bb('0x25')](function(_0x707cd1){if(_0x707cd1){return[_0x707cd1,![]];}return db['MailInteraction'][_0x64bb('0x4a')](_0x230af8)[_0x64bb('0x25')](function(_0x23127c){return[_0x23127c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x64bb('0x52')](function(_0x2d9f8e,_0x1d63e8){if(_0x2d9f8e){_0x2da8b3=_0x1d63e8;if(!_0x1d63e8){return _0x2d9f8e[_0x64bb('0x53')]({'inReplyTo':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')][_0x64bb('0x4d')],'to':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['from'],'cc':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['cc'],'subject':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')][_0x64bb('0x54')],'attach':_0x2d9f8e[_0x64bb('0x4e')]?_0x2d9f8e[_0x64bb('0x4e')]:_0x5462df[_0x64bb('0x29')]['message'][_0x64bb('0x4e')],'substatus':null,'substatusAt':moment()[_0x64bb('0x55')](_0x64bb('0x4f')),'lastMsgAt':moment()['format'](_0x64bb('0x4f')),'lastMsgDirection':'in'});}else{return _0x2d9f8e;}}})[_0x64bb('0x25')](function(_0x54a850){_0x239d33[_0x64bb('0x56')]=_0x54a850[_0x64bb('0x57')]({'plain':!![]});_0x239d33['interaction'][_0x64bb('0x58')]=_0x2da8b3;return db[_0x64bb('0x59')][_0x64bb('0x4a')]({'body':_0x5462df['body'][_0x64bb('0x29')],'MailAccountId':_0x5462df[_0x64bb('0x39')]['id'],'MailInteractionId':_0x54a850['id'],'direction':'in','ContactId':_0x239d33[_0x64bb('0x5a')]['id'],'messageId':_0x5462df[_0x64bb('0x29')]['message']['messageId'],'from':_0x5462df[_0x64bb('0x29')]['message'][_0x64bb('0x38')],'to':_0x5462df['body'][_0x64bb('0x18')]['to'],'cc':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['cc'],'subject':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['subject'],'attach':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['attach'],'Attachments':_0x5462df[_0x64bb('0x29')][_0x64bb('0x18')]['attachments'],'originTo':_0x5462df['body']['message'][_0x64bb('0x5b')],'originCc':_0x5462df['body']['message'][_0x64bb('0x5c')],'bcc':_0x5462df['body'][_0x64bb('0x18')]['bcc'],'ChatWebsiteId':_0x5462df['body'][_0x64bb('0x18')][_0x64bb('0x5d')]||null,'originChannel':_0x5462df[_0x64bb('0x29')]['message'][_0x64bb('0x5e')]||'Email','ChatOfflineMessageId':_0x5462df['body'][_0x64bb('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x64bb('0x25')](function(_0x17bc6a){_0x239d33[_0x64bb('0x18')]=_0x17bc6a;if(_0x239d33[_0x64bb('0x56')][_0x64bb('0x5f')]){return db[_0x64bb('0x60')]['find']({'attributes':['id','name'],'where':{'id':_0x239d33[_0x64bb('0x56')][_0x64bb('0x5f')]}})[_0x64bb('0x25')](function(_0x2f0d4e){if(_0x2f0d4e){_0x239d33[_0x64bb('0x43')][_0x64bb('0x61')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2f0d4e[_0x64bb('0x62')]+','+(_0x239d33[_0x64bb('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x64bb('0x49')});}return respondWithRpcPromise(_0x64bb('0x63'),'startRouting',_0x239d33);});}return respondWithRpcPromise(_0x64bb('0x63'),_0x64bb('0x64'),_0x239d33);})[_0x64bb('0x25')](function(_0x68341c){_0x4996f0(_0x68341c);})[_0x64bb('0x19')](function(_0x47fe7b){_0x1d88f0(_0x2d029d[_0x64bb('0x16')](0x1f4,_0x47fe7b['message']));});});};
\ No newline at end of file
+var _0xe1c0=['agent','name','startRouting','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','request\x20sent','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowMailAccount','find','stringify','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','asc','length','close','autoclose','*,*,*,*','from','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','update','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','UserId','User','unshift'];(function(_0x145c99,_0x3fdb01){var _0x52a05f=function(_0x36feb0){while(--_0x36feb0){_0x145c99['push'](_0x145c99['shift']());}};_0x52a05f(++_0x3fdb01);}(_0xe1c0,0x1b4));var _0x0e1c=function(_0x26de49,_0x4523a9){_0x26de49=_0x26de49-0x0;var _0x7bbb7c=_0xe1c0[_0x26de49];return _0x7bbb7c;};'use strict';var _=require(_0x0e1c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e1c('0x1'));var rs=require(_0x0e1c('0x2'));var fs=require('fs');var Redis=require(_0x0e1c('0x3'));var db=require(_0x0e1c('0x4'))['db'];var utils=require(_0x0e1c('0x5'));var logger=require(_0x0e1c('0x6'))(_0x0e1c('0x7'));var config=require(_0x0e1c('0x8'));var jayson=require(_0x0e1c('0x9'));var client=jayson[_0x0e1c('0xa')][_0x0e1c('0xb')]({'port':0x232c});config[_0x0e1c('0xc')]=_[_0x0e1c('0xd')](config['redis'],{'host':_0x0e1c('0xe'),'port':0x18eb});var socket=require(_0x0e1c('0xf'))(new Redis(config['redis']));require(_0x0e1c('0x10'))[_0x0e1c('0x11')](socket);function respondWithRpcPromise(_0x215127,_0x454fda,_0x231c42){return new BPromise(function(_0x52c70c,_0x59b9f7){return client[_0x0e1c('0x12')](_0x215127,_0x231c42)['then'](function(_0x2fd9d1){logger[_0x0e1c('0x13')]('MailAccount,\x20%s,\x20%s',_0x454fda,'request\x20sent');logger[_0x0e1c('0x14')](_0x0e1c('0x15'),_0x454fda,'request\x20sent',JSON['stringify'](_0x2fd9d1));if(_0x2fd9d1[_0x0e1c('0x16')]){if(_0x2fd9d1['error'][_0x0e1c('0x17')]===0x1f4){logger[_0x0e1c('0x16')](_0x0e1c('0x18'),_0x454fda,_0x2fd9d1[_0x0e1c('0x16')][_0x0e1c('0x19')]);return _0x59b9f7(_0x2fd9d1[_0x0e1c('0x16')][_0x0e1c('0x19')]);}logger[_0x0e1c('0x16')]('MailAccount,\x20%s,\x20%s',_0x454fda,_0x2fd9d1[_0x0e1c('0x16')]['message']);return _0x52c70c(_0x2fd9d1[_0x0e1c('0x16')][_0x0e1c('0x19')]);}else{logger[_0x0e1c('0x13')]('MailAccount,\x20%s,\x20%s',_0x454fda,_0x0e1c('0x1a'));_0x52c70c(_0x2fd9d1['result'][_0x0e1c('0x19')]);}})[_0x0e1c('0x1b')](function(_0x182c8e){logger[_0x0e1c('0x16')]('MailAccount,\x20%s,\x20%s',_0x454fda,_0x182c8e);_0x59b9f7(_0x182c8e);});});}exports[_0x0e1c('0x1c')]=function(_0x1eb194){var _0x81ef3c=this;return new Promise(function(_0x455f77,_0x477f63){return db[_0x0e1c('0x1d')][_0x0e1c('0x1e')]({'raw':_0x1eb194[_0x0e1c('0x1f')]?_0x1eb194[_0x0e1c('0x1f')][_0x0e1c('0x20')]===undefined?!![]:![]:!![],'where':_0x1eb194[_0x0e1c('0x1f')]?_0x1eb194['options'][_0x0e1c('0x21')]||null:null,'attributes':_0x1eb194[_0x0e1c('0x1f')]?_0x1eb194['options'][_0x0e1c('0x22')]||null:null,'limit':_0x1eb194[_0x0e1c('0x1f')]?_0x1eb194[_0x0e1c('0x1f')][_0x0e1c('0x23')]||null:null,'include':_0x1eb194['options']?_0x1eb194['options']['include']?_[_0x0e1c('0x24')](_0x1eb194[_0x0e1c('0x1f')][_0x0e1c('0x25')],function(_0x3ab9f8){return{'model':db[_0x3ab9f8[_0x0e1c('0x26')]],'as':_0x3ab9f8['as'],'attributes':_0x3ab9f8[_0x0e1c('0x22')],'include':_0x3ab9f8[_0x0e1c('0x25')]?_[_0x0e1c('0x24')](_0x3ab9f8[_0x0e1c('0x25')],function(_0xd8c7f7){return{'model':db[_0xd8c7f7['model']],'as':_0xd8c7f7['as'],'attributes':_0xd8c7f7[_0x0e1c('0x22')],'include':_0xd8c7f7[_0x0e1c('0x25')]?_['map'](_0xd8c7f7[_0x0e1c('0x25')],function(_0x5d8a99){return{'model':db[_0x5d8a99[_0x0e1c('0x26')]],'as':_0x5d8a99['as'],'attributes':_0x5d8a99[_0x0e1c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0e1c('0x27')](function(_0x387b07){logger[_0x0e1c('0x13')]('GetMailAccount',_0x1eb194);logger['debug'](_0x0e1c('0x1c'),_0x1eb194,JSON['stringify'](_0x387b07));_0x455f77(_0x387b07);})[_0x0e1c('0x1b')](function(_0x3b56c0){logger[_0x0e1c('0x16')](_0x0e1c('0x1c'),_0x3b56c0['message'],_0x1eb194);_0x477f63(_0x81ef3c[_0x0e1c('0x16')](0x1f4,_0x3b56c0[_0x0e1c('0x19')]));});});};exports[_0x0e1c('0x28')]=function(_0x1fa588){var _0x134962=this;return new Promise(function(_0x28969f,_0x317e7e){return db[_0x0e1c('0x1d')][_0x0e1c('0x29')]({'raw':_0x1fa588[_0x0e1c('0x1f')]?_0x1fa588[_0x0e1c('0x1f')][_0x0e1c('0x20')]===undefined?!![]:![]:!![],'where':_0x1fa588['options']?_0x1fa588['options'][_0x0e1c('0x21')]||null:null,'attributes':_0x1fa588['options']?_0x1fa588['options'][_0x0e1c('0x22')]||null:null,'include':_0x1fa588[_0x0e1c('0x1f')]?_0x1fa588[_0x0e1c('0x1f')][_0x0e1c('0x25')]?_['map'](_0x1fa588[_0x0e1c('0x1f')][_0x0e1c('0x25')],function(_0x334b4b){return{'model':db[_0x334b4b[_0x0e1c('0x26')]],'as':_0x334b4b['as'],'attributes':_0x334b4b[_0x0e1c('0x22')],'include':_0x334b4b['include']?_[_0x0e1c('0x24')](_0x334b4b['include'],function(_0x3c039b){return{'model':db[_0x3c039b['model']],'as':_0x3c039b['as'],'attributes':_0x3c039b[_0x0e1c('0x22')],'include':_0x3c039b[_0x0e1c('0x25')]?_[_0x0e1c('0x24')](_0x3c039b['include'],function(_0x3189dd){return{'model':db[_0x3189dd[_0x0e1c('0x26')]],'as':_0x3189dd['as'],'attributes':_0x3189dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e1c('0x27')](function(_0xf272d6){logger[_0x0e1c('0x13')]('ShowMailAccount',_0x1fa588);logger[_0x0e1c('0x14')]('ShowMailAccount',_0x1fa588,JSON[_0x0e1c('0x2a')](_0xf272d6));_0x28969f(_0xf272d6);})['catch'](function(_0x7c77bb){logger[_0x0e1c('0x16')](_0x0e1c('0x28'),_0x7c77bb['message'],_0x1fa588);_0x317e7e(_0x134962[_0x0e1c('0x16')](0x1f4,_0x7c77bb['message']));});});};exports[_0x0e1c('0x2b')]=function(_0x22e0c9){var _0x138ba1=this;return new Promise(function(_0xfbf315,_0x3f5004){var _0x1f0600={'body':_0x22e0c9[_0x0e1c('0x2c')],'channel':_0x0e1c('0x2d')};var _0x10bb84=_[_0x0e1c('0x2e')](_['keys'](db[_0x0e1c('0x2f')][_0x0e1c('0x30')]),[_0x0e1c('0x31'),_0x0e1c('0x32'),_0x0e1c('0x33'),_0x0e1c('0x34')]);var _0x5aa60b=![];if(_0x22e0c9[_0x0e1c('0x2c')]['id']){delete _0x22e0c9[_0x0e1c('0x2c')]['id'];}if(_[_0x0e1c('0x35')](_0x22e0c9[_0x0e1c('0x2c')]['from'])){return _0x3f5004(_0x138ba1[_0x0e1c('0x16')](0x1f4,_0x0e1c('0x36')));}if(_[_0x0e1c('0x35')](_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x2c')])||_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x2c')]===''){return _0x3f5004(_0x138ba1[_0x0e1c('0x16')](0x1f4,_0x0e1c('0x37')));}if(_[_0x0e1c('0x35')](_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x38')])){return _0x3f5004(_0x138ba1['error'](0x1f4,_0x0e1c('0x39')+_0x10bb84));}if(!_['includes'](_0x10bb84,_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x38')])){return _0x3f5004(_0x138ba1[_0x0e1c('0x16')](0x1f4,_0x0e1c('0x3a')+_0x10bb84));}var _0xf5b3a3={};_0xf5b3a3[_0x22e0c9['body'][_0x0e1c('0x38')]]=_0x22e0c9[_0x0e1c('0x2c')]['from'];return db['MailAccount'][_0x0e1c('0x29')]({'where':{'id':_0x22e0c9[_0x0e1c('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0x0e1c('0x3c'),'include':[{'model':db[_0x0e1c('0x2f')],'as':_0x0e1c('0x3d'),'where':_0xf5b3a3,'limit':0x1,'order':[[_0x0e1c('0x32'),_0x0e1c('0x3e')]]}]},{'model':db[_0x0e1c('0x3f')],'as':_0x0e1c('0x40')},{'model':db[_0x0e1c('0x41')],'as':_0x0e1c('0x42')}]})[_0x0e1c('0x27')](function(_0x4aaba0){if(_0x4aaba0&&_0x4aaba0[_0x0e1c('0x3c')]){var _0x4612a5=_0x4aaba0[_0x0e1c('0x43')]({'plain':!![]});_0x1f0600[_0x0e1c('0x3b')]=_[_0x0e1c('0x44')](_0x4612a5,[_0x0e1c('0x40'),_0x0e1c('0x3c')]);_0x1f0600[_0x0e1c('0x45')]=_0x4612a5[_0x0e1c('0x40')];_0x1f0600[_0x0e1c('0x46')]=_0x4612a5[_0x0e1c('0x3c')];_0x1f0600[_0x0e1c('0x45')]=_[_0x0e1c('0x47')](_0x1f0600[_0x0e1c('0x45')],[_0x0e1c('0x48')],[_0x0e1c('0x49')]);if(_0x1f0600['account']&&_0x1f0600['account']['autoclose']){_0x1f0600[_0x0e1c('0x45')]['push']({'id':0x0,'priority':_0x1f0600[_0x0e1c('0x45')][_0x0e1c('0x4a')]+0x1,'app':_0x0e1c('0x4b'),'appdata':_0x0e1c('0x4c'),'interval':_0x0e1c('0x4d')});}if(_0x1f0600[_0x0e1c('0x3b')][_0x0e1c('0x40')]){delete _0x1f0600['account'][_0x0e1c('0x40')];}if(_0x1f0600['account'][_0x0e1c('0x3c')]){delete _0x1f0600['account']['List'];}if(_0x4612a5[_0x0e1c('0x3c')]['Contacts'][_0x0e1c('0x4a')]){return _0x4612a5['List'][_0x0e1c('0x3d')][0x0];}var _0x1ddce6=_[_0x0e1c('0xd')](_0x22e0c9[_0x0e1c('0x2c')],{'firstName':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x4e')],'ListId':_0x4612a5[_0x0e1c('0x34')]});_0x1ddce6[_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x38')]]=_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x4e')];return db['CmContact'][_0x0e1c('0x4f')](_0x1ddce6);}else{throw new Error(_0x0e1c('0x50'));}})[_0x0e1c('0x27')](function(_0x2489af){_0x1f0600[_0x0e1c('0x51')]=_0x2489af;if(_0x2489af){if(!_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x52')]){_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x52')]=rs[_0x0e1c('0x53')]()+'\x20'+_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x4e')];}var _0x3c90d3={'ContactId':_0x2489af['id'],'MailAccountId':_0x22e0c9['account']['id'],'inReplyTo':_0x22e0c9[_0x0e1c('0x2c')]['message'][_0x0e1c('0x52')],'to':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x4e')],'cc':_0x22e0c9['body'][_0x0e1c('0x19')]['cc'],'subject':_0x22e0c9['body']['message'][_0x0e1c('0x54')],'attach':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x55')],'lastMsgAt':moment()[_0x0e1c('0x56')](_0x0e1c('0x57')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x0e1c('0x29')]({'where':{'closed':![],'MailAccountId':_0x22e0c9[_0x0e1c('0x3b')]['id']},'include':[{'model':db[_0x0e1c('0x58')],'as':_0x0e1c('0x59'),'attributes':[_0x0e1c('0x52')],'where':{'messageId':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x5a')]}}]})['then'](function(_0x9a377a){if(_0x9a377a){return[_0x9a377a,![]];}return db[_0x0e1c('0x5b')][_0x0e1c('0x4f')](_0x3c90d3)[_0x0e1c('0x27')](function(_0x54f147){return[_0x54f147,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5b84a4,_0x17ae42){if(_0x5b84a4){_0x5aa60b=_0x17ae42;if(!_0x17ae42){return _0x5b84a4[_0x0e1c('0x5c')]({'inReplyTo':_0x22e0c9['body'][_0x0e1c('0x19')]['messageId'],'to':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x4e')],'cc':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')]['cc'],'subject':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x54')],'attach':_0x5b84a4[_0x0e1c('0x55')]?_0x5b84a4['attach']:_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x55')],'substatus':null,'substatusAt':moment()[_0x0e1c('0x56')](_0x0e1c('0x57')),'lastMsgAt':moment()[_0x0e1c('0x56')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x5b84a4;}}})[_0x0e1c('0x27')](function(_0x36bce7){_0x1f0600[_0x0e1c('0x5d')]=_0x36bce7['get']({'plain':!![]});_0x1f0600[_0x0e1c('0x5d')]['created']=_0x5aa60b;return db[_0x0e1c('0x58')][_0x0e1c('0x4f')]({'body':_0x22e0c9[_0x0e1c('0x2c')]['body'],'MailAccountId':_0x22e0c9[_0x0e1c('0x3b')]['id'],'MailInteractionId':_0x36bce7['id'],'direction':'in','ContactId':_0x1f0600[_0x0e1c('0x51')]['id'],'messageId':_0x22e0c9[_0x0e1c('0x2c')]['message']['messageId'],'from':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x4e')],'to':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')]['to'],'cc':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')]['cc'],'subject':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')]['subject'],'attach':_0x22e0c9[_0x0e1c('0x2c')]['message'][_0x0e1c('0x55')],'Attachments':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')][_0x0e1c('0x5e')],'originTo':_0x22e0c9['body'][_0x0e1c('0x19')][_0x0e1c('0x5f')],'originCc':_0x22e0c9['body'][_0x0e1c('0x19')][_0x0e1c('0x60')],'bcc':_0x22e0c9['body']['message'][_0x0e1c('0x61')],'ChatWebsiteId':_0x22e0c9['body'][_0x0e1c('0x19')][_0x0e1c('0x62')]||null,'originChannel':_0x22e0c9['body'][_0x0e1c('0x19')]['originChannel']||_0x0e1c('0x63'),'ChatOfflineMessageId':_0x22e0c9[_0x0e1c('0x2c')][_0x0e1c('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x0e1c('0x64')],'as':'Attachments'}]});})[_0x0e1c('0x27')](function(_0x20ed7c){_0x1f0600[_0x0e1c('0x19')]=_0x20ed7c;if(_0x1f0600[_0x0e1c('0x5d')][_0x0e1c('0x65')]){return db[_0x0e1c('0x66')]['find']({'attributes':['id','name'],'where':{'id':_0x1f0600[_0x0e1c('0x5d')][_0x0e1c('0x65')]}})[_0x0e1c('0x27')](function(_0x32aedf){if(_0x32aedf){_0x1f0600[_0x0e1c('0x45')][_0x0e1c('0x67')]({'id':0x0,'priority':0x0,'app':_0x0e1c('0x68'),'appdata':_0x32aedf[_0x0e1c('0x69')]+','+(_0x1f0600[_0x0e1c('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0x0e1c('0x4d')});}return respondWithRpcPromise('Start',_0x0e1c('0x6a'),_0x1f0600);});}return respondWithRpcPromise(_0x0e1c('0x6b'),_0x0e1c('0x6a'),_0x1f0600);})[_0x0e1c('0x27')](function(_0x56557c){_0xfbf315(_0x56557c);})[_0x0e1c('0x1b')](function(_0x3a5460){_0x3f5004(_0x138ba1[_0x0e1c('0x16')](0x1f4,_0x3a5460[_0x0e1c('0x19')]));});});};
\ No newline at end of file
index bb293a8..386fd95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eb6=['update','length','./mailAccount.events','save','remove'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x4eb6,0x1bf));var _0x64eb=function(_0x564e4e,_0x24c76f){_0x564e4e=_0x564e4e-0x0;var _0x3a4ce9=_0x4eb6[_0x564e4e];return _0x3a4ce9;};'use strict';var MailAccountEvents=require(_0x64eb('0x0'));var events=[_0x64eb('0x1'),_0x64eb('0x2'),_0x64eb('0x3')];function createListener(_0x16c87e,_0x1cd19e){return function(_0x21b9ac){_0x1cd19e['emit'](_0x16c87e,_0x21b9ac);};}function removeListener(_0x166f46,_0x357b36){return function(){MailAccountEvents['removeListener'](_0x166f46,_0x357b36);};}exports['register']=function(_0x11a856){for(var _0x48a7e5=0x0,_0x526570=events[_0x64eb('0x4')];_0x48a7e5<_0x526570;_0x48a7e5++){var _0x3915c5=events[_0x48a7e5];var _0x4ed177=createListener('mailAccount:'+_0x3915c5,_0x11a856);MailAccountEvents['on'](_0x3915c5,_0x4ed177);}};
\ No newline at end of file
+var _0xfaff=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x5cb139,_0x1a5f77){var _0x816e2b=function(_0x1ad50f){while(--_0x1ad50f){_0x5cb139['push'](_0x5cb139['shift']());}};_0x816e2b(++_0x1a5f77);}(_0xfaff,0x12e));var _0xffaf=function(_0x50648a,_0x40242a){_0x50648a=_0x50648a-0x0;var _0x1bf190=_0xfaff[_0x50648a];return _0x1bf190;};'use strict';var MailAccountEvents=require(_0xffaf('0x0'));var events=[_0xffaf('0x1'),_0xffaf('0x2'),_0xffaf('0x3')];function createListener(_0xc92db7,_0x5465b5){return function(_0x499816){_0x5465b5[_0xffaf('0x4')](_0xc92db7,_0x499816);};}function removeListener(_0x442058,_0x1b9eac){return function(){MailAccountEvents[_0xffaf('0x5')](_0x442058,_0x1b9eac);};}exports[_0xffaf('0x6')]=function(_0x28f157){for(var _0x2f9e28=0x0,_0x4107e2=events[_0xffaf('0x7')];_0x2f9e28<_0x4107e2;_0x2f9e28++){var _0xc5281a=events[_0x2f9e28];var _0x3f4d97=createListener(_0xffaf('0x8')+_0xc5281a,_0x28f157);MailAccountEvents['on'](_0xc5281a,_0x3f4d97);}};
\ No newline at end of file
index c51e37b..b7abb65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c7=['fs-extra','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x346c48,_0x2b0f17){var _0x2a27cd=function(_0x56fbef){while(--_0x56fbef){_0x346c48['push'](_0x346c48['shift']());}};_0x2a27cd(++_0x2b0f17);}(_0x13c7,0x1c8));var _0x713c=function(_0x245cfe,_0x4e4faa){_0x245cfe=_0x245cfe-0x0;var _0x56a1e7=_0x13c7[_0x245cfe];return _0x56a1e7;};'use strict';var multer=require(_0x713c('0x0'));var util=require(_0x713c('0x1'));var path=require(_0x713c('0x2'));var timeout=require(_0x713c('0x3'));var express=require(_0x713c('0x4'));var router=express[_0x713c('0x5')]();var fs_extra=require(_0x713c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x713c('0x7'));var config=require('../../config/environment');var controller=require(_0x713c('0x8'));router['get'](_0x713c('0x9'),auth[_0x713c('0xa')](),controller[_0x713c('0xb')]);router['put'](_0x713c('0x9'),auth['isAuthenticated'](),controller[_0x713c('0xc')]);router['delete'](_0x713c('0x9'),auth[_0x713c('0xa')](),controller['destroy']);module[_0x713c('0xd')]=router;
\ No newline at end of file
+var _0x90eb=['../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3c0990,_0x3bc924){var _0x55421e=function(_0x26b79b){while(--_0x26b79b){_0x3c0990['push'](_0x3c0990['shift']());}};_0x55421e(++_0x3bc924);}(_0x90eb,0x81));var _0xb90e=function(_0x4bd1b5,_0x100961){_0x4bd1b5=_0x4bd1b5-0x0;var _0x4c50ec=_0x90eb[_0x4bd1b5];return _0x4c50ec;};'use strict';var multer=require(_0xb90e('0x0'));var util=require(_0xb90e('0x1'));var path=require(_0xb90e('0x2'));var timeout=require(_0xb90e('0x3'));var express=require(_0xb90e('0x4'));var router=express[_0xb90e('0x5')]();var fs_extra=require(_0xb90e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb90e('0x7'));var config=require('../../config/environment');var controller=require(_0xb90e('0x8'));router['get'](_0xb90e('0x9'),auth[_0xb90e('0xa')](),controller[_0xb90e('0xb')]);router[_0xb90e('0xc')](_0xb90e('0x9'),auth[_0xb90e('0xa')](),controller[_0xb90e('0xd')]);router[_0xb90e('0xe')](_0xb90e('0x9'),auth[_0xb90e('0xa')](),controller[_0xb90e('0xf')]);module[_0xb90e('0x10')]=router;
\ No newline at end of file
index 1769353..52c89de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc7c=['TEXT','*,*,*,*','exports','STRING','noop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc7c,0x18d));var _0xcfc7=function(_0x2c3ead,_0x2c60d6){_0x2c3ead=_0x2c3ead-0x0;var _0x39616e=_0xfc7c[_0x2c3ead];return _0x39616e;};'use strict';var Sequelize=require('sequelize');module[_0xcfc7('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcfc7('0x1')],'allowNull':![],'defaultValue':_0xcfc7('0x2')},'appdata':{'type':Sequelize[_0xcfc7('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcfc7('0x1')],'defaultValue':_0xcfc7('0x4')}};
\ No newline at end of file
+var _0x87cb=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x87cb,0xe3));var _0xb87c=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x87cb[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xb87c('0x0'));module[_0xb87c('0x1')]={'priority':{'type':Sequelize[_0xb87c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb87c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb87c('0x3')]},'interval':{'type':Sequelize[_0xb87c('0x3')],'defaultValue':_0xb87c('0x4')}};
\ No newline at end of file
index 2b412c9..1ac0c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x774a25,_0x46f547){var _0x3dc2fd=function(_0x27de02){while(--_0x27de02){_0x774a25['push'](_0x774a25['shift']());}};_0x3dc2fd(++_0x46f547);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));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('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));};
\ No newline at end of file
+var _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x200b26,_0x3603ec){var _0x10b9ef=function(_0x180e17){while(--_0x180e17){_0x200b26['push'](_0x200b26['shift']());}};_0x10b9ef(++_0x3603ec);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1691d3,_0x26a6a3){_0x1691d3=_0x1691d3-0x0;var _0x1ac3ae=_0xf4eb[_0x1691d3];return _0x1ac3ae;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));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('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));};
\ No newline at end of file
index e9da954..aa5cc8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ae0=['moment','bluebird','path','rimraf','../../config/environment','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x4f14a5,_0x47560b){var _0x24c58b=function(_0x3556a4){while(--_0x3556a4){_0x4f14a5['push'](_0x4f14a5['shift']());}};_0x24c58b(++_0x47560b);}(_0x7ae0,0x65));var _0x07ae=function(_0x4d803f,_0x28c973){_0x4d803f=_0x4d803f-0x0;var _0x26e266=_0x7ae0[_0x4d803f];return _0x26e266;};'use strict';var _=require(_0x07ae('0x0'));var util=require(_0x07ae('0x1'));var logger=require('../../config/logger')(_0x07ae('0x2'));var moment=require(_0x07ae('0x3'));var BPromise=require(_0x07ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07ae('0x5'));var rimraf=require(_0x07ae('0x6'));var config=require(_0x07ae('0x7'));var attributes=require('./mailApplication.attributes');module[_0x07ae('0x8')]=function(_0xccf450,_0x67a490){return _0xccf450[_0x07ae('0x9')]('MailApplication',attributes,{'tableName':_0x07ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07ae('0xb'),'collate':_0x07ae('0xc')});};
\ No newline at end of file
+var _0x9d09=['define','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes'];(function(_0x3e3b99,_0x28b068){var _0x26af96=function(_0x14dd61){while(--_0x14dd61){_0x3e3b99['push'](_0x3e3b99['shift']());}};_0x26af96(++_0x28b068);}(_0x9d09,0x184));var _0x99d0=function(_0x351182,_0x36445e){_0x351182=_0x351182-0x0;var _0x179760=_0x9d09[_0x351182];return _0x179760;};'use strict';var _=require('lodash');var util=require(_0x99d0('0x0'));var logger=require('../../config/logger')(_0x99d0('0x1'));var moment=require(_0x99d0('0x2'));var BPromise=require(_0x99d0('0x3'));var rp=require(_0x99d0('0x4'));var fs=require('fs');var path=require(_0x99d0('0x5'));var rimraf=require(_0x99d0('0x6'));var config=require('../../config/environment');var attributes=require(_0x99d0('0x7'));module['exports']=function(_0x2a72c5,_0x4e1938){return _0x2a72c5[_0x99d0('0x8')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99d0('0x9'),'collate':_0x99d0('0xa')});};
\ No newline at end of file
index 6fca1d9..0537074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc734=['where','attributes','limit','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','body','options'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0xc734,0xce));var _0x4c73=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0xc734[_0x53f0db];return _0xae0a5c;};'use strict';var _=require('lodash');var util=require(_0x4c73('0x0'));var moment=require(_0x4c73('0x1'));var BPromise=require(_0x4c73('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c73('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c73('0x4'));var logger=require(_0x4c73('0x5'))(_0x4c73('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c73('0x7'));var client=jayson[_0x4c73('0x8')][_0x4c73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x531ae0,_0x288e3e,_0x1ed46e){return new BPromise(function(_0x5277b5,_0x337e8e){return client[_0x4c73('0xa')](_0x531ae0,_0x1ed46e)[_0x4c73('0xb')](function(_0x2bda43){logger[_0x4c73('0xc')](_0x4c73('0xd'),_0x288e3e,_0x4c73('0xe'));logger[_0x4c73('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x288e3e,_0x4c73('0xe'),JSON[_0x4c73('0x10')](_0x2bda43));if(_0x2bda43[_0x4c73('0x11')]){if(_0x2bda43[_0x4c73('0x11')][_0x4c73('0x12')]===0x1f4){logger[_0x4c73('0x11')](_0x4c73('0xd'),_0x288e3e,_0x2bda43['error'][_0x4c73('0x13')]);return _0x337e8e(_0x2bda43[_0x4c73('0x11')][_0x4c73('0x13')]);}logger['error'](_0x4c73('0xd'),_0x288e3e,_0x2bda43['error'][_0x4c73('0x13')]);return _0x5277b5(_0x2bda43[_0x4c73('0x11')][_0x4c73('0x13')]);}else{logger[_0x4c73('0xc')](_0x4c73('0xd'),_0x288e3e,_0x4c73('0xe'));_0x5277b5(_0x2bda43[_0x4c73('0x14')][_0x4c73('0x13')]);}})[_0x4c73('0x15')](function(_0x433d7c){logger[_0x4c73('0x11')](_0x4c73('0xd'),_0x288e3e,_0x433d7c);_0x337e8e(_0x433d7c);});});}exports[_0x4c73('0x16')]=function(_0x4f7747){var _0x43f0c6=this;return new Promise(function(_0x8ac7b8,_0x36be86){return db[_0x4c73('0x17')]['update'](_0x4f7747[_0x4c73('0x18')],{'raw':_0x4f7747[_0x4c73('0x19')]?_0x4f7747[_0x4c73('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7747['options']?_0x4f7747[_0x4c73('0x19')][_0x4c73('0x1a')]||null:null,'attributes':_0x4f7747[_0x4c73('0x19')]?_0x4f7747['options'][_0x4c73('0x1b')]||null:null,'limit':_0x4f7747[_0x4c73('0x19')]?_0x4f7747[_0x4c73('0x19')][_0x4c73('0x1c')]||null:null})[_0x4c73('0xb')](function(_0x2a5e2b){logger[_0x4c73('0xc')](_0x4c73('0x16'),_0x4f7747);logger[_0x4c73('0xf')]('UpdateMailApplication',_0x4f7747,JSON[_0x4c73('0x10')](_0x2a5e2b));_0x8ac7b8(_0x2a5e2b);})[_0x4c73('0x15')](function(_0x194994){logger[_0x4c73('0x11')]('UpdateMailApplication',_0x194994[_0x4c73('0x13')],_0x4f7747);_0x36be86(_0x43f0c6[_0x4c73('0x11')](0x1f4,_0x194994[_0x4c73('0x13')]));});});};
\ No newline at end of file
+var _0xca71=['raw','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateMailApplication','update','body','options'];(function(_0x22818b,_0x3c8c44){var _0x5e9a47=function(_0x4f47ac){while(--_0x4f47ac){_0x22818b['push'](_0x22818b['shift']());}};_0x5e9a47(++_0x3c8c44);}(_0xca71,0x101));var _0x1ca7=function(_0x3c0ccd,_0x1e1335){_0x3c0ccd=_0x3c0ccd-0x0;var _0x23231c=_0xca71[_0x3c0ccd];return _0x23231c;};'use strict';var _=require(_0x1ca7('0x0'));var util=require(_0x1ca7('0x1'));var moment=require(_0x1ca7('0x2'));var BPromise=require(_0x1ca7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ca7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ca7('0x5'));var logger=require(_0x1ca7('0x6'))('rpc');var config=require(_0x1ca7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ca7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50c5d3,_0x1d1eaa,_0xcbb576){return new BPromise(function(_0x19da31,_0x5b0d34){return client[_0x1ca7('0x9')](_0x50c5d3,_0xcbb576)[_0x1ca7('0xa')](function(_0x1c301b){logger['info'](_0x1ca7('0xb'),_0x1d1eaa,_0x1ca7('0xc'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x1d1eaa,_0x1ca7('0xc'),JSON[_0x1ca7('0xd')](_0x1c301b));if(_0x1c301b[_0x1ca7('0xe')]){if(_0x1c301b[_0x1ca7('0xe')][_0x1ca7('0xf')]===0x1f4){logger[_0x1ca7('0xe')](_0x1ca7('0xb'),_0x1d1eaa,_0x1c301b[_0x1ca7('0xe')][_0x1ca7('0x10')]);return _0x5b0d34(_0x1c301b[_0x1ca7('0xe')][_0x1ca7('0x10')]);}logger[_0x1ca7('0xe')](_0x1ca7('0xb'),_0x1d1eaa,_0x1c301b[_0x1ca7('0xe')][_0x1ca7('0x10')]);return _0x19da31(_0x1c301b[_0x1ca7('0xe')]['message']);}else{logger[_0x1ca7('0x11')](_0x1ca7('0xb'),_0x1d1eaa,_0x1ca7('0xc'));_0x19da31(_0x1c301b['result'][_0x1ca7('0x10')]);}})[_0x1ca7('0x12')](function(_0x303a11){logger[_0x1ca7('0xe')](_0x1ca7('0xb'),_0x1d1eaa,_0x303a11);_0x5b0d34(_0x303a11);});});}exports[_0x1ca7('0x13')]=function(_0x488d73){var _0x48a8a5=this;return new Promise(function(_0x5986ab,_0x853c2d){return db['MailApplication'][_0x1ca7('0x14')](_0x488d73[_0x1ca7('0x15')],{'raw':_0x488d73[_0x1ca7('0x16')]?_0x488d73[_0x1ca7('0x16')][_0x1ca7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x488d73[_0x1ca7('0x16')]?_0x488d73[_0x1ca7('0x16')][_0x1ca7('0x18')]||null:null,'attributes':_0x488d73['options']?_0x488d73[_0x1ca7('0x16')][_0x1ca7('0x19')]||null:null,'limit':_0x488d73['options']?_0x488d73[_0x1ca7('0x16')][_0x1ca7('0x1a')]||null:null})[_0x1ca7('0xa')](function(_0x3cc256){logger[_0x1ca7('0x11')](_0x1ca7('0x13'),_0x488d73);logger[_0x1ca7('0x1b')](_0x1ca7('0x13'),_0x488d73,JSON[_0x1ca7('0xd')](_0x3cc256));_0x5986ab(_0x3cc256);})[_0x1ca7('0x12')](function(_0x529dfa){logger[_0x1ca7('0xe')](_0x1ca7('0x13'),_0x529dfa[_0x1ca7('0x10')],_0x488d73);_0x853c2d(_0x48a8a5[_0x1ca7('0xe')](0x1f4,_0x529dfa[_0x1ca7('0x10')]));});});};
\ No newline at end of file
index 1ea4790..4f53286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea7a=['get','index','/describe','describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','delete','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x214a7b,_0x4e7847){var _0x36c004=function(_0x2e5d7a){while(--_0x2e5d7a){_0x214a7b['push'](_0x214a7b['shift']());}};_0x36c004(++_0x4e7847);}(_0xea7a,0xbb));var _0xaea7=function(_0x208538,_0x1ffa23){_0x208538=_0x208538-0x0;var _0x1be9e6=_0xea7a[_0x208538];return _0x1be9e6;};'use strict';var express=require(_0xaea7('0x0'));var router=express[_0xaea7('0x1')]();var auth=require(_0xaea7('0x2'));var interaction=require(_0xaea7('0x3'));var controller=require(_0xaea7('0x4'));router[_0xaea7('0x5')]('/',auth['isAuthenticated'](),controller[_0xaea7('0x6')]);router[_0xaea7('0x5')](_0xaea7('0x7'),auth['isAuthenticated'](),controller[_0xaea7('0x8')]);router[_0xaea7('0x5')](_0xaea7('0x9'),auth['isAuthenticated'](),controller[_0xaea7('0xa')]);router['get'](_0xaea7('0xb'),auth[_0xaea7('0xc')](),controller[_0xaea7('0xd')]);router[_0xaea7('0x5')](_0xaea7('0xe'),auth[_0xaea7('0xc')](),controller[_0xaea7('0xf')]);router[_0xaea7('0x10')]('/',auth[_0xaea7('0xc')](),controller[_0xaea7('0x11')]);router['post'](_0xaea7('0xb'),auth[_0xaea7('0xc')](),controller['addMessage']);router['post'](_0xaea7('0x12'),auth[_0xaea7('0xc')](),interaction[_0xaea7('0x13')](_0xaea7('0x14'),_0xaea7('0x15')),controller['addTags']);router['put'](_0xaea7('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0xaea7('0x14'),'mailinteraction:update'),controller['update']);router[_0xaea7('0x16')]('/:id',auth[_0xaea7('0xc')](),interaction[_0xaea7('0x13')](_0xaea7('0x14'),'mailinteraction:destroy'),controller['destroy']);router['delete'](_0xaea7('0x12'),auth[_0xaea7('0xc')](),controller[_0xaea7('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xd1e3=['delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','mail','update'];(function(_0x5339ff,_0x4edf83){var _0x247525=function(_0x3e3a67){while(--_0x3e3a67){_0x5339ff['push'](_0x5339ff['shift']());}};_0x247525(++_0x4edf83);}(_0xd1e3,0x14a));var _0x3d1e=function(_0x176f46,_0x1ae7d4){_0x176f46=_0x176f46-0x0;var _0x3e6691=_0xd1e3[_0x176f46];return _0x3e6691;};'use strict';var express=require('express');var router=express[_0x3d1e('0x0')]();var auth=require(_0x3d1e('0x1'));var interaction=require(_0x3d1e('0x2'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x3d1e('0x3')](),controller[_0x3d1e('0x4')]);router['get'](_0x3d1e('0x5'),auth[_0x3d1e('0x3')](),controller[_0x3d1e('0x6')]);router[_0x3d1e('0x7')](_0x3d1e('0x8'),auth[_0x3d1e('0x3')](),controller['show']);router['get'](_0x3d1e('0x9'),auth[_0x3d1e('0x3')](),controller[_0x3d1e('0xa')]);router[_0x3d1e('0x7')]('/:id/download',auth[_0x3d1e('0x3')](),controller[_0x3d1e('0xb')]);router[_0x3d1e('0xc')]('/',auth[_0x3d1e('0x3')](),controller['create']);router['post'](_0x3d1e('0x9'),auth[_0x3d1e('0x3')](),controller[_0x3d1e('0xd')]);router[_0x3d1e('0xc')](_0x3d1e('0xe'),auth['isAuthenticated'](),interaction[_0x3d1e('0xf')]('mail',_0x3d1e('0x10')),controller['addTags']);router[_0x3d1e('0x11')](_0x3d1e('0x8'),auth[_0x3d1e('0x3')](),interaction[_0x3d1e('0xf')](_0x3d1e('0x12'),'mailinteraction:update'),controller[_0x3d1e('0x13')]);router[_0x3d1e('0x14')](_0x3d1e('0x8'),auth['isAuthenticated'](),interaction[_0x3d1e('0xf')](_0x3d1e('0x12'),_0x3d1e('0x15')),controller[_0x3d1e('0x16')]);router[_0x3d1e('0x14')](_0x3d1e('0xe'),auth[_0x3d1e('0x3')](),controller[_0x3d1e('0x17')]);module[_0x3d1e('0x18')]=router;
\ No newline at end of file
index 5369ee6..a8f1b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc592=['long','DATE','ENUM','out','sequelize','iconv','BOOLEAN','STRING'];(function(_0x3d8dcd,_0x32a653){var _0x3891f8=function(_0x5b8d8b){while(--_0x5b8d8b){_0x3d8dcd['push'](_0x3d8dcd['shift']());}};_0x3891f8(++_0x32a653);}(_0xc592,0x18c));var _0x2c59=function(_0x30b48f,_0x5d0001){_0x30b48f=_0x30b48f-0x0;var _0x79eff3=_0xc592[_0x30b48f];return _0x79eff3;};'use strict';var Sequelize=require(_0x2c59('0x0'));var iconv=require(_0x2c59('0x1'));module['exports']={'closed':{'type':Sequelize[_0x2c59('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2c59('0x3')]},'secondDisposition':{'type':Sequelize[_0x2c59('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2c59('0x3')]},'note':{'type':Sequelize[_0x2c59('0x3')]},'inReplyTo':{'type':Sequelize[_0x2c59('0x3')](0x1fe)},'to':{'type':Sequelize[_0x2c59('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x2c59('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x2c59('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2c59('0x5')]},'substatus':{'type':Sequelize[_0x2c59('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x2c59('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x2c59('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2c59('0x6')]('in',_0x2c59('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2c59('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xca10=['TEXT','long','ENUM','sequelize','iconv','BOOLEAN','DATE','STRING'];(function(_0x3b3125,_0x4e228b){var _0x3f1823=function(_0xe3553){while(--_0xe3553){_0x3b3125['push'](_0x3b3125['shift']());}};_0x3f1823(++_0x4e228b);}(_0xca10,0xc3));var _0x0ca1=function(_0x255021,_0x4a7b8f){_0x255021=_0x255021-0x0;var _0x431921=_0xca10[_0x255021];return _0x431921;};'use strict';var Sequelize=require(_0x0ca1('0x0'));var iconv=require(_0x0ca1('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0ca1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0ca1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0ca1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0ca1('0x4')]},'note':{'type':Sequelize[_0x0ca1('0x4')]},'inReplyTo':{'type':Sequelize[_0x0ca1('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x0ca1('0x5')](_0x0ca1('0x6'))},'subject':{'type':Sequelize[_0x0ca1('0x5')]()},'attach':{'type':Sequelize[_0x0ca1('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0ca1('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x0ca1('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0ca1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0ca1('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0ca1('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 4b30b8f..4679649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5281=['start','text','compact','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','isEmpty','i.MailAccountId\x20IS\x20NULL','sequelize','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','toString','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','all','rows','show','params','intersection','options','create','body','destroy','describe','addMessage','ids','omit','MailMessage','sort','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','inlineCss','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','join','root','files','attachments','transcript-%d-%s.zip','Attachments','Messages','subject','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','readFileSync','build','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','stack','name','send','Users','fullname','Tags','TagIds','forEach','push','out','plainBody','-id','lastMsgText','trimStart','catch','map','MailInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','split','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId'];(function(_0x4ae1ba,_0x594e3){var _0x222780=function(_0x28e56b){while(--_0x28e56b){_0x4ae1ba['push'](_0x4ae1ba['shift']());}};_0x222780(++_0x594e3);}(_0x5281,0x16b));var _0x1528=function(_0x170f0d,_0x30b951){_0x170f0d=_0x170f0d-0x0;var _0x5e5124=_0x5281[_0x170f0d];return _0x5e5124;};'use strict';var emlformat=require(_0x1528('0x0'));var rimraf=require(_0x1528('0x1'));var zipdir=require(_0x1528('0x2'));var moment=require(_0x1528('0x3'));var BPromise=require(_0x1528('0x4'));var util=require(_0x1528('0x5'));var path=require('path');var fs=require('fs');var _=require(_0x1528('0x6'));var squel=require(_0x1528('0x7'));var juice=require(_0x1528('0x8'));var Redis=require(_0x1528('0x9'));var qs=require(_0x1528('0xa'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x1528('0xb'))(_0x1528('0xc'));var config=require('../../config/environment');var db=require(_0x1528('0xd'))['db'];var htmlEntities=require(_0x1528('0xe'));config[_0x1528('0xf')]=_[_0x1528('0x10')](config[_0x1528('0xf')],{'host':_0x1528('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1528('0xf')]));require(_0x1528('0x12'))['register'](socket);function respondWithStatusCode(_0x37278b,_0x402e5d){_0x402e5d=_0x402e5d||0xcc;return function(_0x5d6247){if(_0x5d6247){return _0x37278b[_0x1528('0x13')](_0x402e5d);}return _0x37278b[_0x1528('0x14')](_0x402e5d)[_0x1528('0x15')]();};}function respondWithResult(_0x5181b6,_0x1b8596){_0x1b8596=_0x1b8596||0xc8;return function(_0xf131c8){if(_0xf131c8){return _0x5181b6[_0x1528('0x14')](_0x1b8596)[_0x1528('0x16')](_0xf131c8);}};}function respondWithFilteredResult(_0x534f26,_0x37b913){return function(_0x4d3917){if(_0x4d3917){var _0x4cd31a=typeof _0x37b913[_0x1528('0x17')]===_0x1528('0x18')&&typeof _0x37b913[_0x1528('0x19')]==='undefined';var _0x396c86=_0x4d3917['count'];var _0x2f7b60=_0x4cd31a?0x0:_0x37b913[_0x1528('0x17')];var _0x2e607c=_0x4cd31a?_0x4d3917[_0x1528('0x1a')]:_0x37b913[_0x1528('0x17')]+_0x37b913['limit'];var _0x194c41;if(_0x2e607c>=_0x396c86){_0x2e607c=_0x396c86;_0x194c41=0xc8;}else{_0x194c41=0xce;}_0x534f26[_0x1528('0x14')](_0x194c41);return _0x534f26['set'](_0x1528('0x1b'),_0x2f7b60+'-'+_0x2e607c+'/'+_0x396c86)[_0x1528('0x16')](_0x4d3917);}return null;};}function saveUpdates(_0x720d06){return function(_0x1ab23f){if(_0x1ab23f){return _0x1ab23f[_0x1528('0x1c')](_0x720d06)[_0x1528('0x1d')](function(_0x4bc83e){return _0x4bc83e;});}return null;};}function removeEntity(_0x2b80ee){return function(_0x1c4723){if(_0x1c4723){return _0x1c4723['destroy']()[_0x1528('0x1d')](function(){_0x2b80ee['status'](0xcc)[_0x1528('0x15')]();});}};}function handleEntityNotFound(_0x36a124){return function(_0x347e46){if(!_0x347e46){_0x36a124['sendStatus'](0x194);}return _0x347e46;};}function handleError(_0x48a58d,_0x559232){_0x559232=_0x559232||0x1f4;return function(_0x51212a){logger['error'](_0x51212a[_0x1528('0x1e')]);if(_0x51212a[_0x1528('0x1f')]){delete _0x51212a[_0x1528('0x1f')];}_0x48a58d[_0x1528('0x14')](_0x559232)[_0x1528('0x20')](_0x51212a);};}function getInteractionUsers(_0x5a351f,_0xf2d1b2){return new BPromise(function(_0x5286bb,_0x3051a0){try{if(_0xf2d1b2[_0x5a351f['id']]){_0x5a351f[_0x1528('0x21')]=_['map'](_0xf2d1b2[_0x5a351f['id']],function(_0x19464d){return{'id':_0x19464d['id'],'fullname':_0x19464d[_0x1528('0x22')]};});}}catch(_0x47375f){_0x3051a0(_0x47375f);}_0x5286bb(_0x5a351f);});}function getInteractionTags(_0x5d7616,_0x1a6e6b){return new BPromise(function(_0x5f4d35,_0x540ed5){try{if(_0x5d7616['TagIds']){_0x5d7616[_0x1528('0x23')]=[];_0x5d7616[_0x1528('0x24')]['split'](',')[_0x1528('0x25')](function(_0x152520){_0x5d7616['Tags'][_0x1528('0x26')](_0x1a6e6b[_0x152520]);});}delete _0x5d7616[_0x1528('0x24')];}catch(_0x5af998){_0x540ed5(_0x5af998);}_0x5f4d35(_0x5d7616);});}function getLastMessageText(_0x46fa3a){return new BPromise(function(_0x2eb57d,_0x55bb8b){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x46fa3a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1528('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x1528('0x28')],'order':_0x1528('0x29'),'raw':!![]})[_0x1528('0x1d')](function(_0x5ce736){if(_0x5ce736&&_0x5ce736['plainBody']){_0x46fa3a[_0x1528('0x2a')]=_[_0x1528('0x2b')](_0x5ce736[_0x1528('0x28')]);}_0x2eb57d(_0x46fa3a);})[_0x1528('0x2c')](function(_0x51f820){_0x55bb8b(_0x51f820);});});}function updateMailInteraction(_0x292c2e,_0x5a1371,_0x5a75b7,_0x11121f){return new BPromise(function(_0x40fd78,_0x331a02){return getInteractionUsers(_0x292c2e,_0x5a75b7)[_0x1528('0x1d')](function(_0x433c54){return getInteractionTags(_0x433c54,_0x5a1371);})[_0x1528('0x1d')](function(_0x1d572a){if(_0x11121f){_0x40fd78(getLastMessageText(_0x1d572a));}else{_0x40fd78(_0x1d572a);}})[_0x1528('0x2c')](function(_0x340ffb){_0x331a02(_0x340ffb);});});}exports['index']=function(_0xd1eae8,_0x41bea6){var _0x4637eb={},_0x30a691={},_0x29247b={'count':0x0,'rows':[]};var _0x43778a=_[_0x1528('0x2d')](db[_0x1528('0x2e')][_0x1528('0x2f')],function(_0x42f0ef){return{'name':_0x42f0ef[_0x1528('0x30')],'type':_0x42f0ef[_0x1528('0x31')][_0x1528('0x32')]};});_0x30a691[_0x1528('0x33')]=_[_0x1528('0x2d')](_0x43778a,_0x1528('0x1f'));_0x30a691[_0x1528('0x34')]=_[_0x1528('0x35')](_0xd1eae8[_0x1528('0x34')]);_0x30a691[_0x1528('0x36')]=_['intersection'](_0x30a691['model'],_0x30a691[_0x1528('0x34')]);_0x4637eb[_0x1528('0x37')]=_['intersection'](_0x30a691[_0x1528('0x33')],qs[_0x1528('0x38')](_0xd1eae8['query']['fields']));_0x4637eb['attributes']=_0x4637eb[_0x1528('0x37')][_0x1528('0x39')]?_0x4637eb['attributes']:_0x30a691[_0x1528('0x33')];if(!_0xd1eae8[_0x1528('0x34')][_0x1528('0x3a')](_0x1528('0x3b'))){_0x4637eb[_0x1528('0x19')]=qs[_0x1528('0x19')](_0xd1eae8[_0x1528('0x34')][_0x1528('0x19')]);_0x4637eb[_0x1528('0x17')]=qs[_0x1528('0x17')](_0xd1eae8[_0x1528('0x34')][_0x1528('0x17')]);}_0x4637eb[_0x1528('0x3c')]=qs['sort'](_0xd1eae8[_0x1528('0x34')]['sort']);_0x4637eb[_0x1528('0x3d')]=qs[_0x1528('0x36')](_[_0x1528('0x3e')](_0xd1eae8[_0x1528('0x34')],_0x30a691[_0x1528('0x36')]),_0x43778a);var _0x4f1878=[];var _0x32ea2a=squel[_0x1528('0x3f')]()[_0x1528('0x40')]('id')[_0x1528('0x40')]('name')[_0x1528('0x40')](_0x1528('0x41'))[_0x1528('0x42')](_0x1528('0x43'));var _0x377844=squel['select']()[_0x1528('0x40')](_0x1528('0x44'))[_0x1528('0x40')](_0x1528('0x45'))[_0x1528('0x40')]('ui.MailInteractionId')[_0x1528('0x42')]('user_has_mail_interactions','ui')['left_join'](_0x1528('0x46'),'u',_0x1528('0x47'));var _0x26a252=squel[_0x1528('0x3f')]()[_0x1528('0x42')]('mail_interactions','i')[_0x1528('0x48')](_0x1528('0x49'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1528('0x48')]('users','o',_0x1528('0x4a'))[_0x1528('0x48')]('mail_accounts','a',_0x1528('0x4b'))['left_join'](_0x1528('0x4c'),'me',_0x1528('0x4d'))['left_join'](_0x1528('0x4e'),'it',_0x1528('0x4f'))[_0x1528('0x48')](_0x1528('0x43'),'t','t.id\x20=\x20it.TagId');var _0x431f97=squel['expr']();var _0x4e9d6e=[];var _0x1b4d3f=squel[_0x1528('0x50')]();var _0x45decb;if(_0xd1eae8[_0x1528('0x34')][_0x1528('0x51')]){_0x45decb=as[_0x1528('0x52')](_0xd1eae8['query'][_0x1528('0x51')]);var _0x1b75c4=_0x45decb[_0x1528('0x53')];for(var _0x1f1f2a=0x0;_0x1f1f2a<_0x45decb[_0x1528('0x54')][_0x1528('0x39')];_0x1f1f2a++){var _0x3d5ba5=_0x45decb[_0x1528('0x54')][_0x1f1f2a];var _0x437cb6='i';var _0x3202ef=_[_0x1528('0x55')](_0x43778a,['name',_0x3d5ba5[_0x1528('0x40')]]);if(!_0x3202ef){switch(_0x3d5ba5[_0x1528('0x40')]){case _0x1528('0x56'):if(_0x3d5ba5[_0x1528('0x57')]==0x1){_0x26a252['having']('`'+_0x3d5ba5['field']+_0x1528('0x58'));}else{_0x26a252[_0x1528('0x59')]('`'+_0x3d5ba5[_0x1528('0x40')]+_0x1528('0x5a'));}break;case _0x1528('0x5b'):if(_0x3d5ba5[_0x1528('0x5c')]===_0x1528('0x5d')){if(_0x3d5ba5[_0x1528('0x57')]['split']('\x20')['length']>0x1){_0x431f97[_0x1b75c4](_0x1528('0x5e'),qs[_0x1528('0x5f')](_0x3d5ba5[_0x1528('0x57')]),null);}else{var _0x1512eb='%'+_0x3d5ba5[_0x1528('0x57')]+'%';_0x431f97[_0x1b75c4](_0x1528('0x60'),_0x1512eb,_0x1512eb,_0x1512eb);}}else{_0x3202ef=_['find'](_0x43778a,['name',_0x1528('0x61')]);_0x3d5ba5['field']=_0x1528('0x61');_0x5d874f=as[_0x1528('0x62')](_0x437cb6,_0x3202ef[_0x1528('0x31')],_0x3d5ba5);_0x431f97[_0x1b75c4](_0x5d874f['text'],_0x5d874f[_0x1528('0x57')]['start'],_0x5d874f[_0x1528('0x57')]['end']);}break;case _0x1528('0x63'):var _0x559bda=_0x3d5ba5[_0x1528('0x57')][_0x1528('0x64')](',')[_0x1528('0x2d')](function(_0x419c26){return Number(_0x419c26);});_0x559bda[_0x1528('0x25')](function(_0x225da1){_0x1b4d3f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x225da1+',%');});_0x4e9d6e=_[_0x1528('0x65')](_0x4e9d6e,_0x559bda);break;case _0x1528('0x66'):if(_0x3d5ba5[_0x1528('0x5c')]==='$substring'){_0x431f97[_0x1b75c4](_0x1528('0x67'),'%'+_0x3d5ba5[_0x1528('0x57')]+'%',null);}else{_0x3202ef=_[_0x1528('0x55')](_0x43778a,['name','UserId']);_0x3d5ba5[_0x1528('0x40')]=_0x1528('0x68');_0x5d874f=as[_0x1528('0x62')](_0x437cb6,_0x3202ef[_0x1528('0x31')],_0x3d5ba5);_0x431f97[_0x1b75c4](_0x5d874f['text'],_0x5d874f[_0x1528('0x57')][_0x1528('0x69')],_0x5d874f[_0x1528('0x57')]['end']);}break;case _0x1528('0x28'):_0x5d874f=as['buildExpression']('me',null,_0x3d5ba5);_0x431f97[_0x1b75c4](_0x5d874f['text'],_0x5d874f[_0x1528('0x57')]['start'],_0x5d874f[_0x1528('0x57')][_0x1528('0x15')]);break;}}else{var _0x5d874f=as[_0x1528('0x62')](_0x437cb6,_0x3202ef[_0x1528('0x31')],_0x3d5ba5);_0x431f97[_0x1b75c4](_0x5d874f[_0x1528('0x6a')],_0x5d874f[_0x1528('0x57')][_0x1528('0x69')],_0x5d874f[_0x1528('0x57')][_0x1528('0x15')]);}}}else{var _0x387b3d=_(_0xd1eae8[_0x1528('0x34')])[_0x1528('0x35')]()[_0x1528('0x2d')](function(_0x4664a6){return _['some'](_0x43778a,[_0x1528('0x1f'),_0x4664a6])?_0x4664a6:undefined;})[_0x1528('0x6b')]()['value']();if(!_['isEmpty'](_0x387b3d)){_0x387b3d[_0x1528('0x25')](function(_0x2ba79b){if(_0x2ba79b==='MailAccountId'){_0x26a252[_0x1528('0x3d')](_0x1528('0x6c'),[][_0x1528('0x6d')](_0xd1eae8[_0x1528('0x34')][_0x2ba79b]));}else if(_0x2ba79b===_0x1528('0x6e')){var _0x4ce6b4=JSON[_0x1528('0x6f')](_0xd1eae8[_0x1528('0x34')][_0x2ba79b])[_0x1528('0x70')];var _0x384637=JSON[_0x1528('0x6f')](_0xd1eae8['query'][_0x2ba79b])[_0x1528('0x71')];_0x26a252[_0x1528('0x3d')](_0x1528('0x72'),_0x4ce6b4,_0x384637);}else{if(_0xd1eae8[_0x1528('0x34')][_0x2ba79b]===_0x1528('0x73')){_0x26a252[_0x1528('0x3d')]('i.'+_0x2ba79b+_0x1528('0x74'));}else{_0x26a252[_0x1528('0x3d')]('i.'+_0x2ba79b+_0x1528('0x75'),_0xd1eae8[_0x1528('0x34')][_0x2ba79b]);}}});}if(_0xd1eae8[_0x1528('0x34')][_0x1528('0x76')]){if(_0xd1eae8['query']['read']==0x1){_0x26a252[_0x1528('0x59')]('`unreadMessages`\x20=\x200');}else{_0x26a252[_0x1528('0x59')](_0x1528('0x77'));}}if(_0xd1eae8[_0x1528('0x34')][_0x1528('0x78')]){_0x4e9d6e=_[_0x1528('0x79')](_0xd1eae8[_0x1528('0x34')]['tag'])?_0xd1eae8[_0x1528('0x34')][_0x1528('0x78')]:new Array(_0xd1eae8[_0x1528('0x34')][_0x1528('0x78')]);_0x4e9d6e[_0x1528('0x25')](function(_0x21046a){_0x1b4d3f['or'](_0x1528('0x7a'),'%,'+_0x21046a+',%');});}if(_0xd1eae8[_0x1528('0x34')][_0x1528('0x7b')]){var _0x39a90f=_0xd1eae8[_0x1528('0x34')]['filter'][_0x1528('0x7c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1528('0x7d')](_0x39a90f)){_0x431f97['or'](_0x1528('0x7e'),_0x39a90f+'%');}else if(qs[_0x1528('0x7f')](_0x39a90f)){_0x431f97['or'](_0x1528('0x80'),_0x39a90f+'%');}else{_0x431f97['or'](_0x1528('0x81'),qs['getFullTextValue'](_0x39a90f))['or'](_0x1528('0x82'),qs[_0x1528('0x5f')](_0x39a90f));}}}_0x26a252[_0x1528('0x3d')](_0x431f97);_0x26a252[_0x1528('0x83')](_0x1528('0x84'));var _0xc84e19={'type':db[_0x1528('0x85')][_0x1528('0x86')][_0x1528('0x87')],'raw':!![]};var _0x36fe0b=_0x26a252[_0x1528('0x88')]();_0x36fe0b[_0x1528('0x40')](_0x1528('0x84'));_0x36fe0b['field'](_0x1528('0x89'),'unreadMessages');if(_0x4637eb[_0x1528('0x3c')]){_0x4637eb['order']['forEach'](function(_0x1e3e33){var _0x1e9644=_0x1e3e33[0x0]===_0x1528('0x8a')?_0x1e3e33[0x0]:'i.'+_0x1e3e33[0x0];_0x26a252[_0x1528('0x3c')](_0x1e9644,_0x1e3e33[0x1]===_0x1528('0x8b')?![]:!![]);});}if(!_['isEmpty'](_0x4e9d6e)){_0x26a252[_0x1528('0x59')](_0x1b4d3f);_0x36fe0b['where'](_0x1528('0x8c'),_0x4e9d6e);}BPromise[_0x1528('0x8d')]()[_0x1528('0x1d')](function(){if(!_0x45decb){if(_0xd1eae8[_0x1528('0x34')][_0x1528('0x8e')])return;_0x36fe0b[_0x1528('0x3d')](_0x1528('0x8f'));_0x26a252[_0x1528('0x3d')](_0x1528('0x8f'));return;}if(_0xd1eae8[_0x1528('0x90')][_0x1528('0x91')]!==_0x1528('0x92'))return;return _0xd1eae8['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x1528('0x1d')](function(_0x4bba08){if(_[_0x1528('0x93')](_0x4bba08)){_0x36fe0b[_0x1528('0x3d')](_0x1528('0x94'));_0x26a252[_0x1528('0x3d')](_0x1528('0x94'));}else{_0x36fe0b[_0x1528('0x3d')](_0x1528('0x6c'),_[_0x1528('0x2d')](_0x4bba08,'id'));_0x26a252[_0x1528('0x3d')](_0x1528('0x6c'),_[_0x1528('0x2d')](_0x4bba08,'id'));}});})[_0x1528('0x1d')](function(){if(_0xd1eae8['user']['role']===_0x1528('0x92')&&!_0x45decb&&!_0xd1eae8['query'][_0x1528('0x8e')])return[];return db[_0x1528('0x95')]['query'](_0x36fe0b['toString'](),_0xc84e19);})[_0x1528('0x1d')](function(_0xb11bed){_0x29247b['count']=_0xb11bed[_0x1528('0x39')];if(_0x29247b[_0x1528('0x1a')]===0x0)return[];return db[_0x1528('0x95')][_0x1528('0x34')](_0x32ea2a['toString'](),_0xc84e19)[_0x1528('0x1d')](function(_0x2184eb){_0x4f1878=_['keyBy'](_0x2184eb,'id');_0xc84e19=_[_0x1528('0x96')](_0xc84e19,{'model':db[_0x1528('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd1eae8[_0x1528('0x34')][_0x1528('0x38')]){_0x4637eb[_0x1528('0x37')][_0x1528('0x25')](function(_0x2bf26d){_0x26a252['field']('i.'+_0x2bf26d);});}else{_0x26a252['field'](_0x1528('0x89'),'unreadMessages');_0x26a252['field'](_0x1528('0x97'),_0x1528('0x98'));_0x26a252['field']('a.mandatoryDisposition',_0x1528('0x99'));_0x26a252['field'](_0x1528('0x9a'),'contactName');_0x26a252['field'](_0x1528('0x84'));_0x26a252[_0x1528('0x40')](_0x1528('0x9b'));_0x26a252[_0x1528('0x40')](_0x1528('0x9c'));_0x26a252[_0x1528('0x40')](_0x1528('0x9d'));_0x26a252[_0x1528('0x40')]('i.closedAt');_0x26a252[_0x1528('0x40')](_0x1528('0x9e'));_0x26a252['field']('i.lastMsgAt');_0x26a252[_0x1528('0x40')](_0x1528('0x9f'));_0x26a252['field'](_0x1528('0xa0'));_0x26a252['field'](_0x1528('0xa1'));_0x26a252['field'](_0x1528('0xa2'));_0x26a252[_0x1528('0x40')]('i.thirdDisposition');_0x26a252[_0x1528('0x40')](_0x1528('0xa3'));_0x26a252[_0x1528('0x40')](_0x1528('0xa4'));_0x26a252['field'](_0x1528('0xa5'));_0x26a252['field'](_0x1528('0xa6'));_0x26a252[_0x1528('0x40')](_0x1528('0xa7'));_0x26a252['field'](_0x1528('0xa8'),_0x1528('0xa9'));_0x26a252[_0x1528('0x40')]('c.lastName',_0x1528('0xaa'));_0x26a252[_0x1528('0x40')](_0x1528('0xab'),_0x1528('0xac'));_0x26a252[_0x1528('0x40')](_0x1528('0xad'),'Contact.phone');_0x26a252[_0x1528('0x40')](_0x1528('0xae'),_0x1528('0xaf'));_0x26a252['field'](_0x1528('0xb0'),'Contact.fax');_0x26a252['field'](_0x1528('0xb1'),_0x1528('0xb2'));_0x26a252['field'](_0x1528('0xb3'),_0x1528('0xb4'));_0x26a252[_0x1528('0x40')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1528('0x24'));}if(_0x4637eb[_0x1528('0x19')])_0x26a252[_0x1528('0x19')](_0x4637eb[_0x1528('0x19')]);if(_0x4637eb[_0x1528('0x17')])_0x26a252[_0x1528('0x17')](_0x4637eb['offset']);return db[_0x1528('0x95')]['query'](_0x26a252[_0x1528('0xb5')](),_0xc84e19);})['then'](function(_0x47d3e7){if(_0x47d3e7[_0x1528('0x39')]>0x0)_0x377844[_0x1528('0x3d')](_0x1528('0xb6'),_[_0x1528('0x2d')](_0x47d3e7,'id'));return db[_0x1528('0x95')]['query'](_0x377844['toString'](),_0xc84e19)[_0x1528('0x1d')](function(_0x1d3bf4){var _0x1f65af=_[_0x1528('0xb7')](_0x1d3bf4,_0x1528('0xb8'));var _0x521672=[];return db[_0x1528('0xb9')][_0x1528('0xba')]({'attributes':[_0x1528('0xbb')],'raw':!![]})[_0x1528('0x1d')](function(_0x391e50){var _0x39320c=_0x391e50[_0x1528('0xbb')];_0x47d3e7[_0x1528('0x25')](function(_0x22a642){_0x521672[_0x1528('0x26')](updateMailInteraction(_0x22a642,_0x4f1878,_0x1f65af,_0x39320c));});return BPromise[_0x1528('0xbc')](_0x521672);});});});})[_0x1528('0x1d')](function(_0x3690e9){_0x29247b[_0x1528('0xbd')]=_0x3690e9;return _0x29247b;})['then'](respondWithFilteredResult(_0x41bea6,_0x4637eb))['catch'](handleError(_0x41bea6,null));};exports[_0x1528('0xbe')]=function(_0xcca31d,_0x572e53){var _0xd91834={'raw':![],'where':{'id':_0xcca31d[_0x1528('0xbf')]['id']}},_0x5ad432={};_0x5ad432[_0x1528('0x33')]=_[_0x1528('0x35')](db[_0x1528('0x2e')][_0x1528('0x2f')]);_0x5ad432[_0x1528('0x34')]=_[_0x1528('0x35')](_0xcca31d[_0x1528('0x34')]);_0x5ad432['filters']=_[_0x1528('0xc0')](_0x5ad432[_0x1528('0x33')],_0x5ad432['query']);_0xd91834[_0x1528('0x37')]=_['intersection'](_0x5ad432[_0x1528('0x33')],qs[_0x1528('0x38')](_0xcca31d[_0x1528('0x34')][_0x1528('0x38')]));_0xd91834[_0x1528('0x37')]=_0xd91834[_0x1528('0x37')][_0x1528('0x39')]?_0xd91834[_0x1528('0x37')]:_0x5ad432[_0x1528('0x33')];if(_0xcca31d[_0x1528('0x34')]['includeAll']){_0xd91834['include']=[{'all':!![]}];}_0xd91834=_[_0x1528('0x96')]({},_0xd91834,_0xcca31d[_0x1528('0xc1')]);return db[_0x1528('0x2e')]['find'](_0xd91834)[_0x1528('0x1d')](handleEntityNotFound(_0x572e53,null))[_0x1528('0x1d')](respondWithResult(_0x572e53,null))['catch'](handleError(_0x572e53,null));};exports[_0x1528('0xc2')]=function(_0x2e4910,_0x6c71a6){return db[_0x1528('0x2e')][_0x1528('0xc2')](_0x2e4910[_0x1528('0xc3')],{})[_0x1528('0x1d')](respondWithResult(_0x6c71a6,0xc9))['catch'](handleError(_0x6c71a6,null));};exports[_0x1528('0x1c')]=function(_0x4365cd,_0x33dd49){if(_0x4365cd['body']['id']){delete _0x4365cd[_0x1528('0xc3')]['id'];}return db['MailInteraction'][_0x1528('0x55')]({'where':{'id':_0x4365cd[_0x1528('0xbf')]['id']}})['then'](handleEntityNotFound(_0x33dd49,null))[_0x1528('0x1d')](saveUpdates(_0x4365cd['body'],null))[_0x1528('0x1d')](respondWithResult(_0x33dd49,null))[_0x1528('0x2c')](handleError(_0x33dd49,null));};exports[_0x1528('0xc4')]=function(_0x319fae,_0x43faf2){return db[_0x1528('0x2e')][_0x1528('0x55')]({'where':{'id':_0x319fae[_0x1528('0xbf')]['id']}})['then'](handleEntityNotFound(_0x43faf2,null))[_0x1528('0x1d')](removeEntity(_0x43faf2,null))[_0x1528('0x2c')](handleError(_0x43faf2,null));};exports[_0x1528('0xc5')]=function(_0x1c39fc,_0x4388e8){return db[_0x1528('0x2e')][_0x1528('0xc5')]()[_0x1528('0x1d')](respondWithResult(_0x4388e8,null))[_0x1528('0x2c')](handleError(_0x4388e8,null));};exports[_0x1528('0xc6')]=function(_0x5cd4d5,_0x547785){return db['MailMessage'][_0x1528('0x55')]({'where':{'id':_0x5cd4d5[_0x1528('0xbf')]['id']}})[_0x1528('0x1d')](handleEntityNotFound(_0x547785,null))['then'](function(_0xae413d){if(_0xae413d){return _0xae413d[_0x1528('0xc6')](_0x5cd4d5[_0x1528('0xc3')][_0x1528('0xc7')],_[_0x1528('0xc8')](_0x5cd4d5['body'],[_0x1528('0xc7'),'id'])||{});}})['then'](respondWithResult(_0x547785,null))['catch'](handleError(_0x547785,null));};exports['getMessages']=function(_0x761225,_0x2d83f3){var _0x4eaa8f={'raw':![],'where':{}};var _0x96f634={};var _0xd1e4d9={'count':0x0,'rows':[]};return db[_0x1528('0x2e')][_0x1528('0xba')]({'where':{'id':_0x761225[_0x1528('0xbf')]['id']}})[_0x1528('0x1d')](handleEntityNotFound(_0x2d83f3,null))[_0x1528('0x1d')](function(_0xce3f58){if(_0xce3f58){_0x96f634[_0x1528('0x33')]=_[_0x1528('0x35')](db[_0x1528('0xc9')][_0x1528('0x2f')]);_0x96f634[_0x1528('0x34')]=_[_0x1528('0x35')](_0x761225[_0x1528('0x34')]);_0x96f634[_0x1528('0x36')]=_[_0x1528('0xc0')](_0x96f634['model'],_0x96f634['query']);_0x4eaa8f[_0x1528('0x37')]=_[_0x1528('0xc0')](_0x96f634[_0x1528('0x33')],qs[_0x1528('0x38')](_0x761225['query'][_0x1528('0x38')]));_0x4eaa8f[_0x1528('0x37')]=_0x4eaa8f['attributes'][_0x1528('0x39')]?_0x4eaa8f['attributes']:_0x96f634[_0x1528('0x33')];if(!_0x761225['query'][_0x1528('0x3a')](_0x1528('0x3b'))){_0x4eaa8f[_0x1528('0x19')]=qs['limit'](_0x761225[_0x1528('0x34')][_0x1528('0x19')]);_0x4eaa8f[_0x1528('0x17')]=qs[_0x1528('0x17')](_0x761225['query'][_0x1528('0x17')]);}_0x4eaa8f[_0x1528('0x3c')]=qs[_0x1528('0xca')](_0x761225[_0x1528('0x34')]['sort']);_0x4eaa8f[_0x1528('0x3d')]=qs[_0x1528('0x36')](_[_0x1528('0x3e')](_0x761225[_0x1528('0x34')],_0x96f634[_0x1528('0x36')]));_0x4eaa8f[_0x1528('0x3d')][_0x1528('0xb8')]=_0xce3f58['id'];if(_0x761225[_0x1528('0x34')]['filter']){_0x4eaa8f[_0x1528('0x3d')]=_[_0x1528('0x96')](_0x4eaa8f['where'],{'$or':_[_0x1528('0x2d')](_0x4eaa8f[_0x1528('0x37')],function(_0x18489b){var _0xc65ed0={};_0xc65ed0[_0x18489b]={'$like':'%'+_0x761225[_0x1528('0x34')][_0x1528('0x7b')]+'%'};return _0xc65ed0;})});}if(_0x761225[_0x1528('0x34')][_0x1528('0x70')]){var _0x370961=_0x761225['query'][_0x1528('0x70')]['split'](',');var _0x25c1ad={};_0x25c1ad[_0x370961[0x0]]={'$gte':moment(_0x370961[0x1])[_0x1528('0xcb')](_0x1528('0xcc'))};_0x4eaa8f[_0x1528('0x3d')]=_['merge'](_0x4eaa8f[_0x1528('0x3d')],_0x25c1ad);}_0x4eaa8f=_[_0x1528('0x96')]({},_0x4eaa8f,_0x761225[_0x1528('0xc1')]);return db[_0x1528('0xc9')][_0x1528('0x1a')]({'where':_0x4eaa8f[_0x1528('0x3d')]})[_0x1528('0x1d')](function(_0x361c9f){_0xd1e4d9[_0x1528('0x1a')]=_0x361c9f;if(_0x761225[_0x1528('0x34')][_0x1528('0xcd')]){_0x4eaa8f[_0x1528('0xce')]=[{'all':!![]}];}return db['MailMessage'][_0x1528('0xcf')](_0x4eaa8f);})[_0x1528('0x1d')](function(_0x207e22){if(_0x761225[_0x1528('0x34')][_0x1528('0xd0')]==='true'){for(var _0x25a410=0x0;_0x25a410<_0x207e22[_0x1528('0x39')];_0x25a410++){_0x207e22[_0x25a410][_0x1528('0xc3')]=juice(_0x207e22[_0x25a410][_0x1528('0xc3')]);}}_0xd1e4d9[_0x1528('0xbd')]=_0x207e22;return _0xd1e4d9;});}})['then'](respondWithFilteredResult(_0x2d83f3,_0x4eaa8f))[_0x1528('0x2c')](handleError(_0x2d83f3,null));};exports[_0x1528('0xd1')]=function(_0x40f9e1,_0x20ff1e){return db[_0x1528('0x2e')][_0x1528('0x55')]({'where':{'id':_0x40f9e1['params']['id']}})[_0x1528('0x1d')](handleEntityNotFound(_0x20ff1e,null))[_0x1528('0x1d')](function(_0x18d6d7){if(_0x18d6d7){return _0x18d6d7[_0x1528('0xd2')](_0x40f9e1[_0x1528('0xc3')][_0x1528('0xc7')],_[_0x1528('0xc8')](_0x40f9e1[_0x1528('0xc3')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x1528('0xcf')]({'attributes':['id',_0x1528('0x1f'),_0x1528('0x41')],'where':{'id':_0x40f9e1[_0x1528('0xc3')][_0x1528('0xc7')]}});})[_0x1528('0x1d')](function(_0x58879c){socket[_0x1528('0xd3')](_0x1528('0xd4'),{'id':Number(_0x40f9e1[_0x1528('0xbf')]['id']),'tags':_0x58879c||[]});return{'id':Number(_0x40f9e1[_0x1528('0xbf')]['id']),'tags':_0x58879c||[]};});}})[_0x1528('0x1d')](respondWithResult(_0x20ff1e,null))[_0x1528('0x2c')](handleError(_0x20ff1e,null));};exports[_0x1528('0xd5')]=function(_0x575e29,_0x4e8171){return db[_0x1528('0x2e')][_0x1528('0x55')]({'where':{'id':_0x575e29[_0x1528('0xbf')]['id']}})[_0x1528('0x1d')](handleEntityNotFound(_0x4e8171,null))['then'](function(_0x2932f7){if(_0x2932f7){return _0x2932f7[_0x1528('0xd5')](_0x575e29[_0x1528('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x4e8171,null))[_0x1528('0x2c')](handleError(_0x4e8171,null));};exports['download']=function(_0x11f741,_0x1f2328){var _0x518a8a=moment()[_0x1528('0xd6')]()[_0x1528('0xb5')]();var _0x9f6f88=path[_0x1528('0xd7')](config['root'],'server','files','tmp');var _0x40532d=path['join'](config[_0x1528('0xd8')],'server',_0x1528('0xd9'),_0x1528('0xda'));var _0x1b05ce=path['join'](_0x9f6f88,_0x518a8a);var _0x48aefd=util['format'](_0x1528('0xdb'),_0x11f741[_0x1528('0xbf')]['id'],_0x518a8a);var _0x2f1acf=path[_0x1528('0xd7')](_0x9f6f88,_0x48aefd);var _0x3421f3=[];if(_0x11f741[_0x1528('0x34')][_0x1528('0xda')]){_0x3421f3[_0x1528('0x26')]({'model':db['Attachment'],'as':_0x1528('0xdc'),'raw':!![]});}var _0x5ac33a=[{'model':db['MailMessage'],'as':_0x1528('0xdd'),'attributes':['id',_0x1528('0xc3'),_0x1528('0x42'),'to','cc','bcc',_0x1528('0xde'),_0x1528('0x6e')],'where':{'secret':![]},'order':qs[_0x1528('0xca')]('id'),'include':_0x3421f3}];return db[_0x1528('0x2e')]['find']({'where':{'id':_0x11f741['params']['id']},'include':_0x5ac33a})[_0x1528('0x1d')](handleEntityNotFound(_0x1f2328,null))['then'](function(_0xfbb4d1){if(_0xfbb4d1&&_0xfbb4d1[_0x1528('0xdd')]){var _0x123f40=_0xfbb4d1['get']({'plain':!![]});fs[_0x1528('0xdf')](_0x1b05ce);return BPromise[_0x1528('0xe0')](_0x123f40[_0x1528('0xdd')],function(_0x215f6b,_0x3d9feb){var _0x3fdde5={'from':_0x215f6b[_0x1528('0x42')],'to':_0x215f6b['to'],'subject':_0x215f6b[_0x1528('0xde')],'html':htmlEntities['decode'](_0x215f6b[_0x1528('0xc3')]),'headers':{'Date':moment(_0x215f6b[_0x1528('0x6e')])[_0x1528('0xcb')](_0x1528('0xe1'))},'attachments':[]};if(_0x215f6b['cc']){_0x3fdde5[_0x1528('0xe2')]['Cc']=_0x215f6b['cc'];}if(_0x215f6b[_0x1528('0xe3')]){_0x3fdde5[_0x1528('0xe2')]['Bcc']=_0x215f6b[_0x1528('0xe3')];}return new BPromise(function(_0x4b0b0b,_0xd3ee57){if(_0x215f6b[_0x1528('0xdc')]){for(var _0x5cc088=0x0;_0x5cc088<_0x215f6b[_0x1528('0xdc')][_0x1528('0x39')];_0x5cc088++){var _0x2b211d=_0x215f6b[_0x1528('0xdc')][_0x5cc088];var _0x2a07d3=path[_0x1528('0xd7')](_0x40532d,_0x2b211d['basename']);if(fs[_0x1528('0xe4')](_0x2a07d3)){_0x3fdde5[_0x1528('0xda')][_0x1528('0x26')]({'name':_0x2b211d['name'],'contentType':_0x2b211d[_0x1528('0x31')],'data':fs[_0x1528('0xe5')](_0x2a07d3)});}}}emlformat[_0x1528('0xe6')](_0x3fdde5,function(_0x52e113,_0x2f6785){if(_0x52e113)return _0xd3ee57(_0x52e113);fs['writeFileSync'](path[_0x1528('0xd7')](_0x1b05ce,util['format'](_0x1528('0xe7'),_0x3d9feb)),_0x2f6785);return _0x4b0b0b(_0x2f6785);});});})[_0x1528('0x1d')](function(){return new BPromise(function(_0x3bfdf1,_0x9d4bca){zipdir(_0x1b05ce,{'saveTo':_0x2f1acf},function(_0x15fb76,_0x4480e4){if(_0x15fb76)return _0x9d4bca(_0x15fb76);return _0x3bfdf1(_0x4480e4);});})[_0x1528('0x1d')](function(){return new BPromise(function(_0x1cb195,_0x6b96ac){rimraf(_0x1b05ce,function(_0x2ff735){if(_0x2ff735)_0x6b96ac(_0x2ff735);return _0x1cb195();});});})['then'](function(){return _0x1f2328[_0x1528('0xe8')](_0x2f1acf,_0x48aefd,function(_0x2d6e17){if(!_0x2d6e17)fs[_0x1528('0xe9')](_0x2f1acf);});});});}else{return _0x1f2328[_0x1528('0x13')](0xc8);}})['catch'](handleError(_0x1f2328,null));};
\ No newline at end of file
+var _0x10dc=['juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','destroy','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','plainBody','-id','then','lastMsgText','catch','index','MailInteraction','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','mail_interactions','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','role','toString','count','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','Contact.mobile','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','enableEmailPreview','all','rows','show','params','includeAll','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','findAll','inlineCss','true','setTags','spread','emit','mailInteractionTags:save','removeTags','unix','join','server','files','tmp','root','attachments','format','transcript-%d-%s.zip','Attachments','Messages','bcc','get','mkdirSync','each','subject','decode','headers','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','moment','bluebird','util','path','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10dc,0xe0));var _0xc10d=function(_0x590cd0,_0x11bfd4){_0x590cd0=_0x590cd0-0x0;var _0x208eb0=_0x10dc[_0x590cd0];return _0x208eb0;};'use strict';var emlformat=require(_0xc10d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xc10d('0x1'));var BPromise=require(_0xc10d('0x2'));var util=require(_0xc10d('0x3'));var path=require(_0xc10d('0x4'));var fs=require('fs');var _=require(_0xc10d('0x5'));var squel=require(_0xc10d('0x6'));var juice=require(_0xc10d('0x7'));var Redis=require(_0xc10d('0x8'));var qs=require(_0xc10d('0x9'));var as=require(_0xc10d('0xa'));var logger=require(_0xc10d('0xb'))(_0xc10d('0xc'));var config=require(_0xc10d('0xd'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xc10d('0xe'));config[_0xc10d('0xf')]=_['defaults'](config[_0xc10d('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xc10d('0x10'))(new Redis(config[_0xc10d('0xf')]));require(_0xc10d('0x11'))[_0xc10d('0x12')](socket);function respondWithStatusCode(_0x4a5033,_0x1da94b){_0x1da94b=_0x1da94b||0xcc;return function(_0x1a1655){if(_0x1a1655){return _0x4a5033[_0xc10d('0x13')](_0x1da94b);}return _0x4a5033[_0xc10d('0x14')](_0x1da94b)[_0xc10d('0x15')]();};}function respondWithResult(_0x1cbe84,_0x3cbc17){_0x3cbc17=_0x3cbc17||0xc8;return function(_0x3dd73d){if(_0x3dd73d){return _0x1cbe84[_0xc10d('0x14')](_0x3cbc17)[_0xc10d('0x16')](_0x3dd73d);}};}function respondWithFilteredResult(_0xe471c4,_0x56f85c){return function(_0x2efbac){if(_0x2efbac){var _0x1710ba=typeof _0x56f85c[_0xc10d('0x17')]==='undefined'&&typeof _0x56f85c[_0xc10d('0x18')]===_0xc10d('0x19');var _0x600a23=_0x2efbac['count'];var _0x3ff1dd=_0x1710ba?0x0:_0x56f85c[_0xc10d('0x17')];var _0xc3144c=_0x1710ba?_0x2efbac['count']:_0x56f85c[_0xc10d('0x17')]+_0x56f85c['limit'];var _0x4ee7cb;if(_0xc3144c>=_0x600a23){_0xc3144c=_0x600a23;_0x4ee7cb=0xc8;}else{_0x4ee7cb=0xce;}_0xe471c4['status'](_0x4ee7cb);return _0xe471c4[_0xc10d('0x1a')](_0xc10d('0x1b'),_0x3ff1dd+'-'+_0xc3144c+'/'+_0x600a23)[_0xc10d('0x16')](_0x2efbac);}return null;};}function saveUpdates(_0x2c71c4){return function(_0x2c47e2){if(_0x2c47e2){return _0x2c47e2[_0xc10d('0x1c')](_0x2c71c4)['then'](function(_0x59aa7c){return _0x59aa7c;});}return null;};}function removeEntity(_0x90a528){return function(_0x36c9e1){if(_0x36c9e1){return _0x36c9e1[_0xc10d('0x1d')]()['then'](function(){_0x90a528['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c157b){return function(_0x30b317){if(!_0x30b317){_0x4c157b[_0xc10d('0x13')](0x194);}return _0x30b317;};}function handleError(_0x22896a,_0x418ead){_0x418ead=_0x418ead||0x1f4;return function(_0x3f1281){logger['error'](_0x3f1281[_0xc10d('0x1e')]);if(_0x3f1281[_0xc10d('0x1f')]){delete _0x3f1281[_0xc10d('0x1f')];}_0x22896a['status'](_0x418ead)['send'](_0x3f1281);};}function getInteractionUsers(_0x2fdc7a,_0x169d12){return new BPromise(function(_0xdcb4fa,_0x99e39f){try{if(_0x169d12[_0x2fdc7a['id']]){_0x2fdc7a[_0xc10d('0x20')]=_[_0xc10d('0x21')](_0x169d12[_0x2fdc7a['id']],function(_0x104326){return{'id':_0x104326['id'],'fullname':_0x104326[_0xc10d('0x22')]};});}}catch(_0x335fcf){_0x99e39f(_0x335fcf);}_0xdcb4fa(_0x2fdc7a);});}function getInteractionTags(_0x364b44,_0x26799c){return new BPromise(function(_0x170be7,_0x3140f7){try{if(_0x364b44[_0xc10d('0x23')]){_0x364b44[_0xc10d('0x24')]=[];_0x364b44[_0xc10d('0x23')][_0xc10d('0x25')](',')[_0xc10d('0x26')](function(_0xa6a553){_0x364b44[_0xc10d('0x24')][_0xc10d('0x27')](_0x26799c[_0xa6a553]);});}delete _0x364b44['TagIds'];}catch(_0x509f6b){_0x3140f7(_0x509f6b);}_0x170be7(_0x364b44);});}function getLastMessageText(_0x399752){return new BPromise(function(_0x4d8073,_0x5c3f9c){return db[_0xc10d('0x28')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x399752['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc10d('0x29')],'order':_0xc10d('0x2a'),'raw':!![]})[_0xc10d('0x2b')](function(_0x196adc){if(_0x196adc&&_0x196adc['plainBody']){_0x399752[_0xc10d('0x2c')]=_['trimStart'](_0x196adc['plainBody']);}_0x4d8073(_0x399752);})[_0xc10d('0x2d')](function(_0x10d20f){_0x5c3f9c(_0x10d20f);});});}function updateMailInteraction(_0xd123a0,_0x24265c,_0xf6def2,_0x53131b){return new BPromise(function(_0x555c0d,_0xa436e7){return getInteractionUsers(_0xd123a0,_0xf6def2)[_0xc10d('0x2b')](function(_0x59fc61){return getInteractionTags(_0x59fc61,_0x24265c);})[_0xc10d('0x2b')](function(_0x3a633d){if(_0x53131b){_0x555c0d(getLastMessageText(_0x3a633d));}else{_0x555c0d(_0x3a633d);}})['catch'](function(_0x155c84){_0xa436e7(_0x155c84);});});}exports[_0xc10d('0x2e')]=function(_0x10ff85,_0x18ec18){var _0x298fb7={},_0xdb61ae={},_0x1eb68d={'count':0x0,'rows':[]};var _0x543c4c=_[_0xc10d('0x21')](db[_0xc10d('0x2f')][_0xc10d('0x30')],function(_0x865842){return{'name':_0x865842[_0xc10d('0x31')],'type':_0x865842['type']['key']};});_0xdb61ae[_0xc10d('0x32')]=_[_0xc10d('0x21')](_0x543c4c,_0xc10d('0x1f'));_0xdb61ae[_0xc10d('0x33')]=_['keys'](_0x10ff85[_0xc10d('0x33')]);_0xdb61ae[_0xc10d('0x34')]=_[_0xc10d('0x35')](_0xdb61ae[_0xc10d('0x32')],_0xdb61ae[_0xc10d('0x33')]);_0x298fb7['attributes']=_[_0xc10d('0x35')](_0xdb61ae[_0xc10d('0x32')],qs[_0xc10d('0x36')](_0x10ff85['query']['fields']));_0x298fb7[_0xc10d('0x37')]=_0x298fb7[_0xc10d('0x37')][_0xc10d('0x38')]?_0x298fb7[_0xc10d('0x37')]:_0xdb61ae[_0xc10d('0x32')];if(!_0x10ff85[_0xc10d('0x33')][_0xc10d('0x39')](_0xc10d('0x3a'))){_0x298fb7['limit']=qs[_0xc10d('0x18')](_0x10ff85[_0xc10d('0x33')]['limit']);_0x298fb7[_0xc10d('0x17')]=qs[_0xc10d('0x17')](_0x10ff85[_0xc10d('0x33')][_0xc10d('0x17')]);}_0x298fb7[_0xc10d('0x3b')]=qs[_0xc10d('0x3c')](_0x10ff85[_0xc10d('0x33')][_0xc10d('0x3c')]);_0x298fb7[_0xc10d('0x3d')]=qs[_0xc10d('0x34')](_[_0xc10d('0x3e')](_0x10ff85[_0xc10d('0x33')],_0xdb61ae[_0xc10d('0x34')]),_0x543c4c);var _0x59e6ac=[];var _0x551f6f=squel[_0xc10d('0x3f')]()[_0xc10d('0x40')]('id')[_0xc10d('0x40')](_0xc10d('0x1f'))[_0xc10d('0x40')](_0xc10d('0x41'))[_0xc10d('0x42')](_0xc10d('0x43'));var _0x5865b6=squel[_0xc10d('0x3f')]()[_0xc10d('0x40')](_0xc10d('0x44'))['field'](_0xc10d('0x45'))[_0xc10d('0x40')](_0xc10d('0x46'))['from']('user_has_mail_interactions','ui')[_0xc10d('0x47')](_0xc10d('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x5e5e9c=squel[_0xc10d('0x3f')]()[_0xc10d('0x42')](_0xc10d('0x49'),'i')[_0xc10d('0x47')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xc10d('0x47')]('users','o','o.id\x20=\x20i.UserId')['left_join']('mail_accounts','a',_0xc10d('0x4a'))[_0xc10d('0x47')](_0xc10d('0x4b'),'me',_0xc10d('0x4c'))['left_join'](_0xc10d('0x4d'),'it',_0xc10d('0x4e'))[_0xc10d('0x47')](_0xc10d('0x43'),'t',_0xc10d('0x4f'));var _0x3b8a14=squel[_0xc10d('0x50')]();var _0x5356f3=[];var _0x1a91b1=squel[_0xc10d('0x50')]();var _0x53c3c0;if(_0x10ff85['query'][_0xc10d('0x51')]){_0x53c3c0=as[_0xc10d('0x52')](_0x10ff85[_0xc10d('0x33')][_0xc10d('0x51')]);var _0x1f9482=_0x53c3c0[_0xc10d('0x53')];for(var _0x3b41ed=0x0;_0x3b41ed<_0x53c3c0[_0xc10d('0x54')]['length'];_0x3b41ed++){var _0x77157d=_0x53c3c0[_0xc10d('0x54')][_0x3b41ed];var _0x1af190='i';var _0x3b7c7e=_[_0xc10d('0x55')](_0x543c4c,[_0xc10d('0x1f'),_0x77157d[_0xc10d('0x40')]]);if(!_0x3b7c7e){switch(_0x77157d[_0xc10d('0x40')]){case _0xc10d('0x56'):if(_0x77157d[_0xc10d('0x57')]==0x1){_0x5e5e9c[_0xc10d('0x58')]('`'+_0x77157d['field']+_0xc10d('0x59'));}else{_0x5e5e9c[_0xc10d('0x58')]('`'+_0x77157d[_0xc10d('0x40')]+_0xc10d('0x5a'));}break;case _0xc10d('0x5b'):if(_0x77157d[_0xc10d('0x5c')]===_0xc10d('0x5d')){if(_0x77157d[_0xc10d('0x57')][_0xc10d('0x25')]('\x20')[_0xc10d('0x38')]>0x1){_0x3b8a14[_0x1f9482](_0xc10d('0x5e'),qs[_0xc10d('0x5f')](_0x77157d[_0xc10d('0x57')]),null);}else{var _0x35d1e2='%'+_0x77157d[_0xc10d('0x57')]+'%';_0x3b8a14[_0x1f9482](_0xc10d('0x60'),_0x35d1e2,_0x35d1e2,_0x35d1e2);}}else{_0x3b7c7e=_[_0xc10d('0x55')](_0x543c4c,[_0xc10d('0x1f'),'ContactId']);_0x77157d['field']=_0xc10d('0x61');_0x7f5163=as[_0xc10d('0x62')](_0x1af190,_0x3b7c7e[_0xc10d('0x63')],_0x77157d);_0x3b8a14[_0x1f9482](_0x7f5163[_0xc10d('0x64')],_0x7f5163[_0xc10d('0x57')][_0xc10d('0x65')],_0x7f5163[_0xc10d('0x57')]['end']);}break;case _0xc10d('0x66'):var _0x299905=_0x77157d[_0xc10d('0x57')][_0xc10d('0x25')](',')['map'](function(_0x2eaac0){return Number(_0x2eaac0);});_0x299905[_0xc10d('0x26')](function(_0x1253cf){_0x1a91b1['or'](_0xc10d('0x67'),'%,'+_0x1253cf+',%');});_0x5356f3=_['union'](_0x5356f3,_0x299905);break;case'User':if(_0x77157d['operator']===_0xc10d('0x5d')){_0x3b8a14[_0x1f9482](_0xc10d('0x68'),'%'+_0x77157d[_0xc10d('0x57')]+'%',null);}else{_0x3b7c7e=_[_0xc10d('0x55')](_0x543c4c,[_0xc10d('0x1f'),_0xc10d('0x69')]);_0x77157d[_0xc10d('0x40')]='UserId';_0x7f5163=as[_0xc10d('0x62')](_0x1af190,_0x3b7c7e[_0xc10d('0x63')],_0x77157d);_0x3b8a14[_0x1f9482](_0x7f5163[_0xc10d('0x64')],_0x7f5163[_0xc10d('0x57')][_0xc10d('0x65')],_0x7f5163[_0xc10d('0x57')][_0xc10d('0x15')]);}break;case'plainBody':_0x7f5163=as[_0xc10d('0x62')]('me',null,_0x77157d);_0x3b8a14[_0x1f9482](_0x7f5163[_0xc10d('0x64')],_0x7f5163[_0xc10d('0x57')][_0xc10d('0x65')],_0x7f5163['value']['end']);break;}}else{var _0x7f5163=as[_0xc10d('0x62')](_0x1af190,_0x3b7c7e[_0xc10d('0x63')],_0x77157d);_0x3b8a14[_0x1f9482](_0x7f5163[_0xc10d('0x64')],_0x7f5163[_0xc10d('0x57')][_0xc10d('0x65')],_0x7f5163[_0xc10d('0x57')][_0xc10d('0x15')]);}}}else{var _0x22d2b1=_(_0x10ff85[_0xc10d('0x33')])[_0xc10d('0x6a')]()[_0xc10d('0x21')](function(_0x3c3e62){return _[_0xc10d('0x6b')](_0x543c4c,['name',_0x3c3e62])?_0x3c3e62:undefined;})[_0xc10d('0x6c')]()[_0xc10d('0x57')]();if(!_[_0xc10d('0x6d')](_0x22d2b1)){_0x22d2b1[_0xc10d('0x26')](function(_0x5ddd19){if(_0x5ddd19===_0xc10d('0x6e')){_0x5e5e9c['where'](_0xc10d('0x6f'),[]['concat'](_0x10ff85[_0xc10d('0x33')][_0x5ddd19]));}else if(_0x5ddd19===_0xc10d('0x70')){var _0x4abf45=JSON[_0xc10d('0x71')](_0x10ff85[_0xc10d('0x33')][_0x5ddd19])[_0xc10d('0x72')];var _0x4e4b7f=JSON[_0xc10d('0x71')](_0x10ff85[_0xc10d('0x33')][_0x5ddd19])[_0xc10d('0x73')];_0x5e5e9c[_0xc10d('0x3d')](_0xc10d('0x74'),_0x4abf45,_0x4e4b7f);}else{if(_0x10ff85[_0xc10d('0x33')][_0x5ddd19]===_0xc10d('0x75')){_0x5e5e9c[_0xc10d('0x3d')]('i.'+_0x5ddd19+_0xc10d('0x76'));}else{_0x5e5e9c[_0xc10d('0x3d')]('i.'+_0x5ddd19+_0xc10d('0x77'),_0x10ff85[_0xc10d('0x33')][_0x5ddd19]);}}});}if(_0x10ff85[_0xc10d('0x33')]['read']){if(_0x10ff85['query'][_0xc10d('0x78')]==0x1){_0x5e5e9c[_0xc10d('0x58')](_0xc10d('0x79'));}else{_0x5e5e9c[_0xc10d('0x58')](_0xc10d('0x7a'));}}if(_0x10ff85['query'][_0xc10d('0x7b')]){_0x5356f3=_[_0xc10d('0x7c')](_0x10ff85['query'][_0xc10d('0x7b')])?_0x10ff85[_0xc10d('0x33')]['tag']:new Array(_0x10ff85[_0xc10d('0x33')][_0xc10d('0x7b')]);_0x5356f3[_0xc10d('0x26')](function(_0x32dc48){_0x1a91b1['or'](_0xc10d('0x67'),'%,'+_0x32dc48+',%');});}if(_0x10ff85[_0xc10d('0x33')][_0xc10d('0x7d')]){var _0x3a3178=_0x10ff85[_0xc10d('0x33')][_0xc10d('0x7d')][_0xc10d('0x7e')]('\x5c','\x5c\x5c')[_0xc10d('0x7e')](/'/g,'\x27\x27');if(qs[_0xc10d('0x7f')](_0x3a3178)){_0x3b8a14['or'](_0xc10d('0x80'),_0x3a3178+'%');}else if(qs[_0xc10d('0x81')](_0x3a3178)){_0x3b8a14['or'](_0xc10d('0x82'),_0x3a3178+'%');}else{_0x3b8a14['or'](_0xc10d('0x83'),qs[_0xc10d('0x5f')](_0x3a3178))['or'](_0xc10d('0x84'),qs[_0xc10d('0x5f')](_0x3a3178));}}}_0x5e5e9c[_0xc10d('0x3d')](_0x3b8a14);_0x5e5e9c[_0xc10d('0x85')](_0xc10d('0x86'));var _0x267a88={'type':db[_0xc10d('0x87')][_0xc10d('0x88')][_0xc10d('0x89')],'raw':!![]};var _0x308cf2=_0x5e5e9c[_0xc10d('0x8a')]();_0x308cf2[_0xc10d('0x40')](_0xc10d('0x86'));_0x308cf2['field'](_0xc10d('0x8b'),'unreadMessages');if(_0x298fb7[_0xc10d('0x3b')]){_0x298fb7[_0xc10d('0x3b')][_0xc10d('0x26')](function(_0x314372){var _0x5785c7=_0x314372[0x0]===_0xc10d('0x8c')?_0x314372[0x0]:'i.'+_0x314372[0x0];_0x5e5e9c['order'](_0x5785c7,_0x314372[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5356f3)){_0x5e5e9c['having'](_0x1a91b1);_0x308cf2[_0xc10d('0x3d')](_0xc10d('0x8d'),_0x5356f3);}BPromise['resolve']()[_0xc10d('0x2b')](function(){if(!_0x53c3c0){if(_0x10ff85[_0xc10d('0x33')][_0xc10d('0x6e')])return;_0x308cf2[_0xc10d('0x3d')](_0xc10d('0x8e'));_0x5e5e9c['where'](_0xc10d('0x8e'));return;}if(_0x10ff85[_0xc10d('0x8f')]['role']!==_0xc10d('0x90'))return;return _0x10ff85[_0xc10d('0x8f')][_0xc10d('0x91')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2c821a){if(_['isEmpty'](_0x2c821a)){_0x308cf2[_0xc10d('0x3d')]('i.MailAccountId\x20IS\x20NULL');_0x5e5e9c[_0xc10d('0x3d')]('i.MailAccountId\x20IS\x20NULL');}else{_0x308cf2[_0xc10d('0x3d')](_0xc10d('0x6f'),_[_0xc10d('0x21')](_0x2c821a,'id'));_0x5e5e9c[_0xc10d('0x3d')]('i.MailAccountId\x20IN\x20?',_['map'](_0x2c821a,'id'));}});})['then'](function(){if(_0x10ff85[_0xc10d('0x8f')][_0xc10d('0x92')]==='agent'&&!_0x53c3c0&&!_0x10ff85[_0xc10d('0x33')]['MailAccountId'])return[];return db['sequelize']['query'](_0x308cf2[_0xc10d('0x93')](),_0x267a88);})[_0xc10d('0x2b')](function(_0x4e7a42){_0x1eb68d['count']=_0x4e7a42[_0xc10d('0x38')];if(_0x1eb68d[_0xc10d('0x94')]===0x0)return[];return db[_0xc10d('0x95')][_0xc10d('0x33')](_0x551f6f[_0xc10d('0x93')](),_0x267a88)['then'](function(_0x2fe4d4){_0x59e6ac=_[_0xc10d('0x96')](_0x2fe4d4,'id');_0x267a88=_[_0xc10d('0x97')](_0x267a88,{'model':db[_0xc10d('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10ff85[_0xc10d('0x33')]['fields']){_0x298fb7[_0xc10d('0x37')][_0xc10d('0x26')](function(_0x12a948){_0x5e5e9c[_0xc10d('0x40')]('i.'+_0x12a948);});}else{_0x5e5e9c[_0xc10d('0x40')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc10d('0x56'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0x98'),_0xc10d('0x99'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0x9a'),_0xc10d('0x9b'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0x9c'),_0xc10d('0x8c'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0x86'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0x9d'));_0x5e5e9c['field'](_0xc10d('0x9e'));_0x5e5e9c[_0xc10d('0x40')]('i.closed');_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0x9f'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa0'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa1'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa2'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa3'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa4'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa5'));_0x5e5e9c['field']('i.thirdDisposition');_0x5e5e9c[_0xc10d('0x40')]('i.substatus');_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa6'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xa7'));_0x5e5e9c['field'](_0xc10d('0xa8'));_0x5e5e9c[_0xc10d('0x40')]('i.UserId');_0x5e5e9c[_0xc10d('0x40')]('c.firstName',_0xc10d('0xa9'));_0x5e5e9c['field'](_0xc10d('0xaa'),'Contact.lastName');_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xab'),'Contact.email');_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xac'),_0xc10d('0xad'));_0x5e5e9c[_0xc10d('0x40')]('c.mobile',_0xc10d('0xae'));_0x5e5e9c[_0xc10d('0x40')]('c.fax','Contact.fax');_0x5e5e9c['field'](_0xc10d('0xaf'),'Owner.fullname');_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xb0'),_0xc10d('0xb1'));_0x5e5e9c[_0xc10d('0x40')](_0xc10d('0xb2'),_0xc10d('0x23'));}if(_0x298fb7[_0xc10d('0x18')])_0x5e5e9c[_0xc10d('0x18')](_0x298fb7[_0xc10d('0x18')]);if(_0x298fb7[_0xc10d('0x17')])_0x5e5e9c[_0xc10d('0x17')](_0x298fb7['offset']);return db[_0xc10d('0x95')]['query'](_0x5e5e9c['toString'](),_0x267a88);})['then'](function(_0x2ed4e5){if(_0x2ed4e5[_0xc10d('0x38')]>0x0)_0x5865b6[_0xc10d('0x3d')](_0xc10d('0xb3'),_[_0xc10d('0x21')](_0x2ed4e5,'id'));return db[_0xc10d('0x95')][_0xc10d('0x33')](_0x5865b6[_0xc10d('0x93')](),_0x267a88)[_0xc10d('0x2b')](function(_0x566101){var _0x14ea9a=_[_0xc10d('0xb4')](_0x566101,'MailInteractionId');var _0x3152b9=[];return db['Setting']['findOne']({'attributes':[_0xc10d('0xb5')],'raw':!![]})[_0xc10d('0x2b')](function(_0x388ba3){var _0x2c2298=_0x388ba3[_0xc10d('0xb5')];_0x2ed4e5[_0xc10d('0x26')](function(_0x207a28){_0x3152b9[_0xc10d('0x27')](updateMailInteraction(_0x207a28,_0x59e6ac,_0x14ea9a,_0x2c2298));});return BPromise[_0xc10d('0xb6')](_0x3152b9);});});});})[_0xc10d('0x2b')](function(_0xca4f92){_0x1eb68d[_0xc10d('0xb7')]=_0xca4f92;return _0x1eb68d;})[_0xc10d('0x2b')](respondWithFilteredResult(_0x18ec18,_0x298fb7))[_0xc10d('0x2d')](handleError(_0x18ec18,null));};exports[_0xc10d('0xb8')]=function(_0x2891a3,_0x4c7070){var _0x24073c={'raw':![],'where':{'id':_0x2891a3[_0xc10d('0xb9')]['id']}},_0x2fc1c5={};_0x2fc1c5[_0xc10d('0x32')]=_[_0xc10d('0x6a')](db['MailInteraction']['rawAttributes']);_0x2fc1c5[_0xc10d('0x33')]=_[_0xc10d('0x6a')](_0x2891a3[_0xc10d('0x33')]);_0x2fc1c5[_0xc10d('0x34')]=_[_0xc10d('0x35')](_0x2fc1c5[_0xc10d('0x32')],_0x2fc1c5[_0xc10d('0x33')]);_0x24073c['attributes']=_[_0xc10d('0x35')](_0x2fc1c5[_0xc10d('0x32')],qs[_0xc10d('0x36')](_0x2891a3[_0xc10d('0x33')][_0xc10d('0x36')]));_0x24073c[_0xc10d('0x37')]=_0x24073c['attributes']['length']?_0x24073c[_0xc10d('0x37')]:_0x2fc1c5[_0xc10d('0x32')];if(_0x2891a3[_0xc10d('0x33')][_0xc10d('0xba')]){_0x24073c['include']=[{'all':!![]}];}_0x24073c=_[_0xc10d('0x97')]({},_0x24073c,_0x2891a3[_0xc10d('0xbb')]);return db[_0xc10d('0x2f')][_0xc10d('0x55')](_0x24073c)[_0xc10d('0x2b')](handleEntityNotFound(_0x4c7070,null))['then'](respondWithResult(_0x4c7070,null))[_0xc10d('0x2d')](handleError(_0x4c7070,null));};exports[_0xc10d('0xbc')]=function(_0x312fa5,_0x4438d7){return db['MailInteraction'][_0xc10d('0xbc')](_0x312fa5['body'],{})[_0xc10d('0x2b')](respondWithResult(_0x4438d7,0xc9))[_0xc10d('0x2d')](handleError(_0x4438d7,null));};exports[_0xc10d('0x1c')]=function(_0x219b56,_0x5d694c){if(_0x219b56[_0xc10d('0xbd')]['id']){delete _0x219b56[_0xc10d('0xbd')]['id'];}return db[_0xc10d('0x2f')][_0xc10d('0x55')]({'where':{'id':_0x219b56[_0xc10d('0xb9')]['id']}})[_0xc10d('0x2b')](handleEntityNotFound(_0x5d694c,null))[_0xc10d('0x2b')](saveUpdates(_0x219b56['body'],null))[_0xc10d('0x2b')](respondWithResult(_0x5d694c,null))[_0xc10d('0x2d')](handleError(_0x5d694c,null));};exports['destroy']=function(_0x1ad70e,_0x7f86bd){return db[_0xc10d('0x2f')][_0xc10d('0x55')]({'where':{'id':_0x1ad70e[_0xc10d('0xb9')]['id']}})[_0xc10d('0x2b')](handleEntityNotFound(_0x7f86bd,null))[_0xc10d('0x2b')](removeEntity(_0x7f86bd,null))[_0xc10d('0x2d')](handleError(_0x7f86bd,null));};exports['describe']=function(_0x5ab2fa,_0x152ba1){return db[_0xc10d('0x2f')][_0xc10d('0xbe')]()[_0xc10d('0x2b')](respondWithResult(_0x152ba1,null))[_0xc10d('0x2d')](handleError(_0x152ba1,null));};exports[_0xc10d('0xbf')]=function(_0xd08fff,_0xe2319b){return db['MailMessage'][_0xc10d('0x55')]({'where':{'id':_0xd08fff[_0xc10d('0xb9')]['id']}})['then'](handleEntityNotFound(_0xe2319b,null))[_0xc10d('0x2b')](function(_0x4f362f){if(_0x4f362f){return _0x4f362f[_0xc10d('0xbf')](_0xd08fff[_0xc10d('0xbd')][_0xc10d('0xc0')],_[_0xc10d('0xc1')](_0xd08fff[_0xc10d('0xbd')],['ids','id'])||{});}})['then'](respondWithResult(_0xe2319b,null))[_0xc10d('0x2d')](handleError(_0xe2319b,null));};exports[_0xc10d('0xc2')]=function(_0x5772d,_0x110a23){var _0x2e5063={'raw':![],'where':{}};var _0x11939e={};var _0x54ee2c={'count':0x0,'rows':[]};return db[_0xc10d('0x2f')][_0xc10d('0xc3')]({'where':{'id':_0x5772d['params']['id']}})[_0xc10d('0x2b')](handleEntityNotFound(_0x110a23,null))[_0xc10d('0x2b')](function(_0x43a206){if(_0x43a206){_0x11939e[_0xc10d('0x32')]=_[_0xc10d('0x6a')](db['MailMessage'][_0xc10d('0x30')]);_0x11939e[_0xc10d('0x33')]=_[_0xc10d('0x6a')](_0x5772d[_0xc10d('0x33')]);_0x11939e['filters']=_[_0xc10d('0x35')](_0x11939e[_0xc10d('0x32')],_0x11939e['query']);_0x2e5063[_0xc10d('0x37')]=_['intersection'](_0x11939e['model'],qs[_0xc10d('0x36')](_0x5772d[_0xc10d('0x33')][_0xc10d('0x36')]));_0x2e5063[_0xc10d('0x37')]=_0x2e5063[_0xc10d('0x37')][_0xc10d('0x38')]?_0x2e5063[_0xc10d('0x37')]:_0x11939e[_0xc10d('0x32')];if(!_0x5772d[_0xc10d('0x33')][_0xc10d('0x39')](_0xc10d('0x3a'))){_0x2e5063[_0xc10d('0x18')]=qs[_0xc10d('0x18')](_0x5772d[_0xc10d('0x33')][_0xc10d('0x18')]);_0x2e5063['offset']=qs['offset'](_0x5772d['query']['offset']);}_0x2e5063[_0xc10d('0x3b')]=qs[_0xc10d('0x3c')](_0x5772d['query'][_0xc10d('0x3c')]);_0x2e5063[_0xc10d('0x3d')]=qs['filters'](_[_0xc10d('0x3e')](_0x5772d[_0xc10d('0x33')],_0x11939e['filters']));_0x2e5063[_0xc10d('0x3d')][_0xc10d('0xc4')]=_0x43a206['id'];if(_0x5772d[_0xc10d('0x33')][_0xc10d('0x7d')]){_0x2e5063[_0xc10d('0x3d')]=_[_0xc10d('0x97')](_0x2e5063[_0xc10d('0x3d')],{'$or':_[_0xc10d('0x21')](_0x2e5063[_0xc10d('0x37')],function(_0x375b18){var _0x20a93e={};_0x20a93e[_0x375b18]={'$like':'%'+_0x5772d[_0xc10d('0x33')][_0xc10d('0x7d')]+'%'};return _0x20a93e;})});}if(_0x5772d[_0xc10d('0x33')]['$gte']){var _0x5c3b50=_0x5772d[_0xc10d('0x33')][_0xc10d('0x72')][_0xc10d('0x25')](',');var _0x476c9d={};_0x476c9d[_0x5c3b50[0x0]]={'$gte':moment(_0x5c3b50[0x1])['format'](_0xc10d('0xc5'))};_0x2e5063[_0xc10d('0x3d')]=_[_0xc10d('0x97')](_0x2e5063[_0xc10d('0x3d')],_0x476c9d);}_0x2e5063=_[_0xc10d('0x97')]({},_0x2e5063,_0x5772d[_0xc10d('0xbb')]);return db['MailMessage']['count']({'where':_0x2e5063[_0xc10d('0x3d')]})[_0xc10d('0x2b')](function(_0xb9d40b){_0x54ee2c[_0xc10d('0x94')]=_0xb9d40b;if(_0x5772d[_0xc10d('0x33')]['includeAll']){_0x2e5063[_0xc10d('0xc6')]=[{'all':!![]}];}return db['MailMessage'][_0xc10d('0xc7')](_0x2e5063);})[_0xc10d('0x2b')](function(_0x3c6f17){if(_0x5772d['query'][_0xc10d('0xc8')]===_0xc10d('0xc9')){for(var _0x423c3d=0x0;_0x423c3d<_0x3c6f17['length'];_0x423c3d++){_0x3c6f17[_0x423c3d][_0xc10d('0xbd')]=juice(_0x3c6f17[_0x423c3d]['body']);}}_0x54ee2c[_0xc10d('0xb7')]=_0x3c6f17;return _0x54ee2c;});}})[_0xc10d('0x2b')](respondWithFilteredResult(_0x110a23,_0x2e5063))[_0xc10d('0x2d')](handleError(_0x110a23,null));};exports['addTags']=function(_0x7295ac,_0x5341ac){return db['MailInteraction'][_0xc10d('0x55')]({'where':{'id':_0x7295ac[_0xc10d('0xb9')]['id']}})[_0xc10d('0x2b')](handleEntityNotFound(_0x5341ac,null))[_0xc10d('0x2b')](function(_0x24b187){if(_0x24b187){return _0x24b187[_0xc10d('0xca')](_0x7295ac[_0xc10d('0xbd')][_0xc10d('0xc0')],_[_0xc10d('0xc1')](_0x7295ac['body'],[_0xc10d('0xc0'),'id'])||{})[_0xc10d('0xcb')](function(){return db[_0xc10d('0x66')]['findAll']({'attributes':['id',_0xc10d('0x1f'),_0xc10d('0x41')],'where':{'id':_0x7295ac[_0xc10d('0xbd')]['ids']}});})[_0xc10d('0x2b')](function(_0x2794ef){socket[_0xc10d('0xcc')](_0xc10d('0xcd'),{'id':Number(_0x7295ac[_0xc10d('0xb9')]['id']),'tags':_0x2794ef||[]});return{'id':Number(_0x7295ac[_0xc10d('0xb9')]['id']),'tags':_0x2794ef||[]};});}})[_0xc10d('0x2b')](respondWithResult(_0x5341ac,null))['catch'](handleError(_0x5341ac,null));};exports['removeTags']=function(_0x44580c,_0x1706b3){return db[_0xc10d('0x2f')][_0xc10d('0x55')]({'where':{'id':_0x44580c['params']['id']}})['then'](handleEntityNotFound(_0x1706b3,null))['then'](function(_0x4387fb){if(_0x4387fb){return _0x4387fb[_0xc10d('0xce')](_0x44580c[_0xc10d('0x33')][_0xc10d('0xc0')]);}})[_0xc10d('0x2b')](respondWithStatusCode(_0x1706b3,null))[_0xc10d('0x2d')](handleError(_0x1706b3,null));};exports['download']=function(_0x3b166c,_0x751ab3){var _0x143c79=moment()[_0xc10d('0xcf')]()[_0xc10d('0x93')]();var _0x4a9aa7=path[_0xc10d('0xd0')](config['root'],_0xc10d('0xd1'),_0xc10d('0xd2'),_0xc10d('0xd3'));var _0x12b13d=path[_0xc10d('0xd0')](config[_0xc10d('0xd4')],_0xc10d('0xd1'),_0xc10d('0xd2'),_0xc10d('0xd5'));var _0x190334=path[_0xc10d('0xd0')](_0x4a9aa7,_0x143c79);var _0x53ac30=util[_0xc10d('0xd6')](_0xc10d('0xd7'),_0x3b166c[_0xc10d('0xb9')]['id'],_0x143c79);var _0x552db=path[_0xc10d('0xd0')](_0x4a9aa7,_0x53ac30);var _0x342bf2=[];if(_0x3b166c[_0xc10d('0x33')][_0xc10d('0xd5')]){_0x342bf2[_0xc10d('0x27')]({'model':db['Attachment'],'as':_0xc10d('0xd8'),'raw':!![]});}var _0x1b2c6f=[{'model':db[_0xc10d('0x28')],'as':_0xc10d('0xd9'),'attributes':['id',_0xc10d('0xbd'),'from','to','cc',_0xc10d('0xda'),'subject',_0xc10d('0x70')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x342bf2}];return db[_0xc10d('0x2f')][_0xc10d('0x55')]({'where':{'id':_0x3b166c['params']['id']},'include':_0x1b2c6f})['then'](handleEntityNotFound(_0x751ab3,null))['then'](function(_0x4dc6f0){if(_0x4dc6f0&&_0x4dc6f0['Messages']){var _0x7f0c62=_0x4dc6f0[_0xc10d('0xdb')]({'plain':!![]});fs[_0xc10d('0xdc')](_0x190334);return BPromise[_0xc10d('0xdd')](_0x7f0c62[_0xc10d('0xd9')],function(_0x4dc0b1,_0x3edac0){var _0x443db4={'from':_0x4dc0b1[_0xc10d('0x42')],'to':_0x4dc0b1['to'],'subject':_0x4dc0b1[_0xc10d('0xde')],'html':htmlEntities[_0xc10d('0xdf')](_0x4dc0b1[_0xc10d('0xbd')]),'headers':{'Date':moment(_0x4dc0b1[_0xc10d('0x70')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4dc0b1['cc']){_0x443db4[_0xc10d('0xe0')]['Cc']=_0x4dc0b1['cc'];}if(_0x4dc0b1[_0xc10d('0xda')]){_0x443db4[_0xc10d('0xe0')]['Bcc']=_0x4dc0b1['bcc'];}return new BPromise(function(_0x3c2b7e,_0x1138e7){if(_0x4dc0b1[_0xc10d('0xd8')]){for(var _0x5904cb=0x0;_0x5904cb<_0x4dc0b1[_0xc10d('0xd8')][_0xc10d('0x38')];_0x5904cb++){var _0x31398f=_0x4dc0b1[_0xc10d('0xd8')][_0x5904cb];var _0x448485=path['join'](_0x12b13d,_0x31398f['basename']);if(fs[_0xc10d('0xe1')](_0x448485)){_0x443db4['attachments'][_0xc10d('0x27')]({'name':_0x31398f[_0xc10d('0x1f')],'contentType':_0x31398f['type'],'data':fs[_0xc10d('0xe2')](_0x448485)});}}}emlformat[_0xc10d('0xe3')](_0x443db4,function(_0x584b5a,_0x1f7115){if(_0x584b5a)return _0x1138e7(_0x584b5a);fs[_0xc10d('0xe4')](path[_0xc10d('0xd0')](_0x190334,util[_0xc10d('0xd6')](_0xc10d('0xe5'),_0x3edac0)),_0x1f7115);return _0x3c2b7e(_0x1f7115);});});})[_0xc10d('0x2b')](function(){return new BPromise(function(_0x279622,_0xffb7a3){zipdir(_0x190334,{'saveTo':_0x552db},function(_0x3addb1,_0x55fb4a){if(_0x3addb1)return _0xffb7a3(_0x3addb1);return _0x279622(_0x55fb4a);});})[_0xc10d('0x2b')](function(){return new BPromise(function(_0x5ae318,_0x3adce2){rimraf(_0x190334,function(_0x217c7c){if(_0x217c7c)_0x3adce2(_0x217c7c);return _0x5ae318();});});})[_0xc10d('0x2b')](function(){return _0x751ab3['download'](_0x552db,_0x53ac30,function(_0x519a31){if(!_0x519a31)fs[_0xc10d('0xe6')](_0x552db);});});});}else{return _0x751ab3[_0xc10d('0x13')](0xc8);}})['catch'](handleError(_0x751ab3,null));};
\ No newline at end of file
index 939a447..af47597 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe05a=['MailMessage','setMaxListeners','save','update','remove','Users','then','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','MailInteraction'];(function(_0xbf84ff,_0xb1f7c9){var _0xb48258=function(_0x429cd1){while(--_0x429cd1){_0xbf84ff['push'](_0xbf84ff['shift']());}};_0xb48258(++_0xb1f7c9);}(_0xe05a,0x13d));var _0xae05=function(_0x482d74,_0x586df0){_0x482d74=_0x482d74-0x0;var _0xef1b60=_0xe05a[_0x482d74];return _0xef1b60;};'use strict';var EventEmitter=require(_0xae05('0x0'));var MailInteraction=require(_0xae05('0x1'))['db'][_0xae05('0x2')];var MailMessage=require(_0xae05('0x1'))['db'][_0xae05('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xae05('0x4')](0x0);var events={'afterCreate':_0xae05('0x5'),'afterUpdate':_0xae05('0x6'),'afterDestroy':_0xae05('0x7')};function emitEvent(_0x22d686){return function(_0x479e2e,_0x1c2940,_0x33ff61){_0x479e2e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3b894c){_0x479e2e['setDataValue'](_0xae05('0x8'),_0x3b894c['map'](function(_0x5528f5){return{'id':_0x5528f5['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x479e2e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xae05('0x9')](function(_0x528a5a){_0x479e2e[_0xae05('0xa')](_0xae05('0xb'),_0x528a5a[_0xae05('0xc')]);MailInteractionEvents['emit'](_0x22d686+':'+_0x479e2e['id'],_0x479e2e);MailInteractionEvents[_0xae05('0xd')](_0x22d686,_0x479e2e);_0x33ff61(null);})['catch'](_0x33ff61(null));};}for(var e in events){if(events[_0xae05('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xae05('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0xf0cd=['../../mysqldb','MailMessage','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hook','exports','events','MailInteraction'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf0cd,0x1d2));var _0xdf0c=function(_0x52fc0e,_0x376039){_0x52fc0e=_0x52fc0e-0x0;var _0x2a2265=_0xf0cd[_0x52fc0e];return _0x2a2265;};'use strict';var EventEmitter=require(_0xdf0c('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xdf0c('0x1')];var MailMessage=require(_0xdf0c('0x2'))['db'][_0xdf0c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf0c('0x4'),'afterDestroy':_0xdf0c('0x5')};function emitEvent(_0x57258f){return function(_0xa4cc7b,_0x39bc4b,_0xe52494){_0xa4cc7b[_0xdf0c('0x6')]({'attributes':['id'],'raw':!![]})[_0xdf0c('0x7')](function(_0x3ded03){_0xa4cc7b['setDataValue'](_0xdf0c('0x8'),_0x3ded03[_0xdf0c('0x9')](function(_0x1ef73b){return{'id':_0x1ef73b['id']};}));return MailMessage[_0xdf0c('0xa')]({'where':{'MailInteractionId':_0xa4cc7b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf0c('0x7')](function(_0x5e038c){_0xa4cc7b[_0xdf0c('0xb')](_0xdf0c('0xc'),_0x5e038c[_0xdf0c('0xd')]);MailInteractionEvents[_0xdf0c('0xe')](_0x57258f+':'+_0xa4cc7b['id'],_0xa4cc7b);MailInteractionEvents[_0xdf0c('0xe')](_0x57258f,_0xa4cc7b);_0xe52494(null);})[_0xdf0c('0xf')](_0xe52494(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xdf0c('0x10')](e,emitEvent(event));}}module[_0xdf0c('0x11')]=MailInteractionEvents;
\ No newline at end of file
index 3165e4b..98977a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e16=['get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatusAt','closedAt'];(function(_0x5d2611,_0x1b6c90){var _0x14fb5c=function(_0x2e7d5d){while(--_0x2e7d5d){_0x5d2611['push'](_0x5d2611['shift']());}};_0x14fb5c(++_0x1b6c90);}(_0x5e16,0x1ab));var _0x65e1=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x5e16[_0x119280];return _0x481797;};'use strict';var _=require(_0x65e1('0x0'));var util=require(_0x65e1('0x1'));var logger=require(_0x65e1('0x2'))(_0x65e1('0x3'));var moment=require(_0x65e1('0x4'));var BPromise=require(_0x65e1('0x5'));var rp=require(_0x65e1('0x6'));var fs=require('fs');var path=require(_0x65e1('0x7'));var rimraf=require('rimraf');var config=require(_0x65e1('0x8'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x4fbe9c,_0x15590b){return _0x4fbe9c[_0x65e1('0x9')](_0x65e1('0xa'),attributes,{'tableName':_0x65e1('0xb'),'paranoid':![],'indexes':[{'name':_0x65e1('0xc'),'fields':['subject','to'],'type':_0x65e1('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x119062,_0x4bc829,_0x344d55){if(_0x119062[_0x65e1('0xe')]){_0x119062['substatusAt']=moment()[_0x65e1('0xf')](_0x65e1('0x10'));}if(_0x119062[_0x65e1('0x11')]){_0x119062['closedAt']=moment()['format'](_0x65e1('0x10'));}_0x344d55(null,_0x4bc829);},'beforeUpdate':function(_0x240dec,_0x345a0e,_0xbd4fd5){if(_0x240dec[_0x65e1('0x12')](_0x65e1('0xe'))){_0x240dec[_0x65e1('0x13')]=_0x240dec['substatus']?moment()[_0x65e1('0xf')](_0x65e1('0x10')):null;}if(_0x240dec[_0x65e1('0x12')]('closed')){_0x240dec[_0x65e1('0x14')]=moment()['format'](_0x65e1('0x10'));_0x240dec['substatus']=null;_0x240dec['substatusAt']=null;}_0xbd4fd5(null,_0x240dec);},'afterUpdate':function(_0x2e307,_0x55c819,_0xefee65){var _0x5b028d=_0x4fbe9c['models'];var _0x1eacb5=_0x2e307[_0x65e1('0x15')]({'plain':!![]});if(_0x1eacb5[_0x65e1('0x11')]){return _0x5b028d[_0x65e1('0x16')][_0x65e1('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x1eacb5['id']}})[_0x65e1('0x18')](function(){_0xefee65();})[_0x65e1('0x19')](function(_0xcfe303){_0xefee65(_0xcfe303);});}else{_0xefee65();}}},'charset':_0x65e1('0x1a'),'collate':_0x65e1('0x1b')});};
\ No newline at end of file
+var _0xf943=['MailMessage','update','then','catch','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models','get'];(function(_0x191c1c,_0x37ea16){var _0x18c788=function(_0x4352a2){while(--_0x4352a2){_0x191c1c['push'](_0x191c1c['shift']());}};_0x18c788(++_0x37ea16);}(_0xf943,0x162));var _0x3f94=function(_0x402b7b,_0x4bc2e9){_0x402b7b=_0x402b7b-0x0;var _0x3a4c31=_0xf943[_0x402b7b];return _0x3a4c31;};'use strict';var _=require(_0x3f94('0x0'));var util=require(_0x3f94('0x1'));var logger=require(_0x3f94('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3f94('0x3'));var rp=require(_0x3f94('0x4'));var fs=require('fs');var path=require(_0x3f94('0x5'));var rimraf=require(_0x3f94('0x6'));var config=require(_0x3f94('0x7'));var attributes=require(_0x3f94('0x8'));module[_0x3f94('0x9')]=function(_0x53c08c,_0x52fcaa){return _0x53c08c['define']('MailInteraction',attributes,{'tableName':_0x3f94('0xa'),'paranoid':![],'indexes':[{'name':_0x3f94('0xb'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7806c2,_0x48ed05,_0x382627){if(_0x7806c2[_0x3f94('0xc')]){_0x7806c2[_0x3f94('0xd')]=moment()[_0x3f94('0xe')](_0x3f94('0xf'));}if(_0x7806c2[_0x3f94('0x10')]){_0x7806c2['closedAt']=moment()[_0x3f94('0xe')](_0x3f94('0xf'));}_0x382627(null,_0x48ed05);},'beforeUpdate':function(_0x5d3930,_0x49ebd0,_0x97cdde){if(_0x5d3930[_0x3f94('0x11')](_0x3f94('0xc'))){_0x5d3930[_0x3f94('0xd')]=_0x5d3930[_0x3f94('0xc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5d3930[_0x3f94('0x11')](_0x3f94('0x10'))){_0x5d3930[_0x3f94('0x12')]=moment()[_0x3f94('0xe')](_0x3f94('0xf'));_0x5d3930[_0x3f94('0xc')]=null;_0x5d3930[_0x3f94('0xd')]=null;}_0x97cdde(null,_0x5d3930);},'afterUpdate':function(_0x1e475c,_0x168279,_0x47ed9a){var _0x28e7eb=_0x53c08c[_0x3f94('0x13')];var _0x37373c=_0x1e475c[_0x3f94('0x14')]({'plain':!![]});if(_0x37373c['closed']){return _0x28e7eb[_0x3f94('0x15')][_0x3f94('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x37373c['id']}})[_0x3f94('0x17')](function(){_0x47ed9a();})[_0x3f94('0x18')](function(_0x386b26){_0x47ed9a(_0x386b26);});}else{_0x47ed9a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 6bdbde5..70c69ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09f6=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','options','where','attributes','limit','debug','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x39ba11,_0x159817){var _0x481575=function(_0x48b17d){while(--_0x48b17d){_0x39ba11['push'](_0x39ba11['shift']());}};_0x481575(++_0x159817);}(_0x09f6,0xfd));var _0x609f=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x09f6[_0x344adc];return _0x4014b2;};'use strict';var _=require(_0x609f('0x0'));var util=require('util');var moment=require(_0x609f('0x1'));var BPromise=require(_0x609f('0x2'));var rs=require(_0x609f('0x3'));var fs=require('fs');var Redis=require(_0x609f('0x4'));var db=require(_0x609f('0x5'))['db'];var utils=require(_0x609f('0x6'));var logger=require(_0x609f('0x7'))(_0x609f('0x8'));var config=require(_0x609f('0x9'));var jayson=require(_0x609f('0xa'));var client=jayson[_0x609f('0xb')][_0x609f('0xc')]({'port':0x232a});config[_0x609f('0xd')]=_[_0x609f('0xe')](config['redis'],{'host':_0x609f('0xf'),'port':0x18eb});var socket=require(_0x609f('0x10'))(new Redis(config[_0x609f('0xd')]));require(_0x609f('0x11'))[_0x609f('0x12')](socket);function respondWithRpcPromise(_0x2db6b6,_0x5ca439,_0xf73a3e){return new BPromise(function(_0x5837b7,_0x49ba02){return client['request'](_0x2db6b6,_0xf73a3e)[_0x609f('0x13')](function(_0x5b589c){logger[_0x609f('0x14')](_0x609f('0x15'),_0x5ca439,_0x609f('0x16'));logger['debug'](_0x609f('0x17'),_0x5ca439,_0x609f('0x16'),JSON[_0x609f('0x18')](_0x5b589c));if(_0x5b589c['error']){if(_0x5b589c[_0x609f('0x19')][_0x609f('0x1a')]===0x1f4){logger[_0x609f('0x19')](_0x609f('0x15'),_0x5ca439,_0x5b589c[_0x609f('0x19')][_0x609f('0x1b')]);return _0x49ba02(_0x5b589c['error']['message']);}logger[_0x609f('0x19')](_0x609f('0x15'),_0x5ca439,_0x5b589c[_0x609f('0x19')][_0x609f('0x1b')]);return _0x5837b7(_0x5b589c[_0x609f('0x19')]['message']);}else{logger[_0x609f('0x14')](_0x609f('0x15'),_0x5ca439,'request\x20sent');_0x5837b7(_0x5b589c[_0x609f('0x1c')]['message']);}})[_0x609f('0x1d')](function(_0x4e7b29){logger[_0x609f('0x19')](_0x609f('0x15'),_0x5ca439,_0x4e7b29);_0x49ba02(_0x4e7b29);});});}exports[_0x609f('0x1e')]=function(_0xdb7330){var _0xf1cd82=this;return new Promise(function(_0x3afeb8,_0x35d3cb){return db[_0x609f('0x1f')]['update'](_0xdb7330['body'],{'raw':_0xdb7330['options']?_0xdb7330[_0x609f('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdb7330[_0x609f('0x20')]?_0xdb7330[_0x609f('0x20')][_0x609f('0x21')]||null:null,'attributes':_0xdb7330[_0x609f('0x20')]?_0xdb7330[_0x609f('0x20')][_0x609f('0x22')]||null:null,'limit':_0xdb7330[_0x609f('0x20')]?_0xdb7330[_0x609f('0x20')][_0x609f('0x23')]||null:null})['then'](function(_0x110671){logger[_0x609f('0x14')](_0x609f('0x1e'),_0xdb7330);logger[_0x609f('0x24')](_0x609f('0x1e'),_0xdb7330,JSON[_0x609f('0x18')](_0x110671));_0x3afeb8(_0x110671);})[_0x609f('0x1d')](function(_0x63b2f9){logger['error'](_0x609f('0x1e'),_0x63b2f9[_0x609f('0x1b')],_0xdb7330);_0x35d3cb(_0xf1cd82[_0x609f('0x19')](0x1f4,_0x63b2f9[_0x609f('0x1b')]));});});};exports['AddTagsToMailInteraction']=function(_0x4d3db7){return new Promise(function(_0x4d778e,_0x3c6c30){return db[_0x609f('0x1f')]['find']({'where':_0x4d3db7['options']?_0x4d3db7[_0x609f('0x20')][_0x609f('0x21')]||null:null})[_0x609f('0x13')](function(_0x201e75){if(_0x201e75){return _0x201e75[_0x609f('0x25')](_0x4d3db7[_0x609f('0x26')][_0x609f('0x27')],_[_0x609f('0x28')](_0x4d3db7[_0x609f('0x26')],[_0x609f('0x27'),'id'])||{});}})[_0x609f('0x29')](function(_0x556503){logger[_0x609f('0x14')](_0x609f('0x2a'),_0x4d3db7);logger[_0x609f('0x24')]('AddTags',_0x4d3db7,JSON[_0x609f('0x18')](_0x556503));_0x4d778e(_0x556503);})[_0x609f('0x1d')](function(_0x18a733){logger[_0x609f('0x19')](_0x609f('0x2a'),_0x18a733[_0x609f('0x1b')],_0x4d3db7);_0x3c6c30(_this[_0x609f('0x19')](0x1f4,_0x18a733[_0x609f('0x1b')]));});});};
\ No newline at end of file
+var _0xd69e=['AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/environment','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','UpdateMailInteraction','MailInteraction','update','options','where','attributes','limit','stringify'];(function(_0x3be92a,_0x76d0f9){var _0x338f56=function(_0x56b8d8){while(--_0x56b8d8){_0x3be92a['push'](_0x3be92a['shift']());}};_0x338f56(++_0x76d0f9);}(_0xd69e,0xa0));var _0xed69=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd69e[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var moment=require(_0xed69('0x2'));var BPromise=require('bluebird');var rs=require(_0xed69('0x3'));var fs=require('fs');var Redis=require(_0xed69('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xed69('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xed69('0x6')]({'port':0x232a});config[_0xed69('0x7')]=_[_0xed69('0x8')](config[_0xed69('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xed69('0x9'))(new Redis(config['redis']));require(_0xed69('0xa'))[_0xed69('0xb')](socket);function respondWithRpcPromise(_0x47da53,_0x2dc08a,_0x1eb1f8){return new BPromise(function(_0x4ebc85,_0x51e609){return client['request'](_0x47da53,_0x1eb1f8)[_0xed69('0xc')](function(_0x218c3c){logger['info'](_0xed69('0xd'),_0x2dc08a,'request\x20sent');logger[_0xed69('0xe')](_0xed69('0xf'),_0x2dc08a,_0xed69('0x10'),JSON['stringify'](_0x218c3c));if(_0x218c3c['error']){if(_0x218c3c[_0xed69('0x11')][_0xed69('0x12')]===0x1f4){logger[_0xed69('0x11')](_0xed69('0xd'),_0x2dc08a,_0x218c3c[_0xed69('0x11')]['message']);return _0x51e609(_0x218c3c[_0xed69('0x11')][_0xed69('0x13')]);}logger[_0xed69('0x11')](_0xed69('0xd'),_0x2dc08a,_0x218c3c[_0xed69('0x11')][_0xed69('0x13')]);return _0x4ebc85(_0x218c3c[_0xed69('0x11')][_0xed69('0x13')]);}else{logger[_0xed69('0x14')](_0xed69('0xd'),_0x2dc08a,'request\x20sent');_0x4ebc85(_0x218c3c['result']['message']);}})[_0xed69('0x15')](function(_0x2cd704){logger[_0xed69('0x11')]('MailInteraction,\x20%s,\x20%s',_0x2dc08a,_0x2cd704);_0x51e609(_0x2cd704);});});}exports[_0xed69('0x16')]=function(_0x11c1fc){var _0x589f07=this;return new Promise(function(_0x3ed869,_0x10285d){return db[_0xed69('0x17')][_0xed69('0x18')](_0x11c1fc['body'],{'raw':_0x11c1fc[_0xed69('0x19')]?_0x11c1fc[_0xed69('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11c1fc[_0xed69('0x19')]?_0x11c1fc[_0xed69('0x19')][_0xed69('0x1a')]||null:null,'attributes':_0x11c1fc[_0xed69('0x19')]?_0x11c1fc[_0xed69('0x19')][_0xed69('0x1b')]||null:null,'limit':_0x11c1fc['options']?_0x11c1fc[_0xed69('0x19')][_0xed69('0x1c')]||null:null})[_0xed69('0xc')](function(_0x371c0b){logger[_0xed69('0x14')](_0xed69('0x16'),_0x11c1fc);logger[_0xed69('0xe')](_0xed69('0x16'),_0x11c1fc,JSON[_0xed69('0x1d')](_0x371c0b));_0x3ed869(_0x371c0b);})[_0xed69('0x15')](function(_0x360fa5){logger['error']('UpdateMailInteraction',_0x360fa5[_0xed69('0x13')],_0x11c1fc);_0x10285d(_0x589f07[_0xed69('0x11')](0x1f4,_0x360fa5[_0xed69('0x13')]));});});};exports[_0xed69('0x1e')]=function(_0xbb7904){return new Promise(function(_0x21be83,_0x5b6ee3){return db[_0xed69('0x17')][_0xed69('0x1f')]({'where':_0xbb7904[_0xed69('0x19')]?_0xbb7904['options']['where']||null:null})[_0xed69('0xc')](function(_0x54474b){if(_0x54474b){return _0x54474b[_0xed69('0x20')](_0xbb7904[_0xed69('0x21')][_0xed69('0x22')],_[_0xed69('0x23')](_0xbb7904[_0xed69('0x21')],[_0xed69('0x22'),'id'])||{});}})[_0xed69('0x24')](function(_0x4bae2f){logger[_0xed69('0x14')](_0xed69('0x25'),_0xbb7904);logger[_0xed69('0xe')](_0xed69('0x25'),_0xbb7904,JSON[_0xed69('0x1d')](_0x4bae2f));_0x21be83(_0x4bae2f);})[_0xed69('0x15')](function(_0x36f1f3){logger['error']('AddTags',_0x36f1f3[_0xed69('0x13')],_0xbb7904);_0x5b6ee3(_this[_0xed69('0x11')](0x1f4,_0x36f1f3[_0xed69('0x13')]));});});};
\ No newline at end of file
index 3133e6d..236f960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xface=['mailInteraction:','save','remove','update','removeListener'];(function(_0x39e15b,_0x555185){var _0x4e5766=function(_0x45ef45){while(--_0x45ef45){_0x39e15b['push'](_0x39e15b['shift']());}};_0x4e5766(++_0x555185);}(_0xface,0x17d));var _0xefac=function(_0x5a5562,_0x5a16ae){_0x5a5562=_0x5a5562-0x0;var _0x50caa5=_0xface[_0x5a5562];return _0x50caa5;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xefac('0x0'),_0xefac('0x1'),_0xefac('0x2')];function createListener(_0x213815,_0x41a90b){return function(_0x34b185){_0x41a90b['emit'](_0x213815,_0x34b185);};}function removeListener(_0x54c611,_0x4ece3c){return function(){MailInteractionEvents[_0xefac('0x3')](_0x54c611,_0x4ece3c);};}exports['register']=function(_0x56232f){for(var _0x56f981=0x0,_0x414459=events['length'];_0x56f981<_0x414459;_0x56f981++){var _0x263218=events[_0x56f981];var _0x19032a=createListener(_0xefac('0x4')+_0x263218,_0x56232f);MailInteractionEvents['on'](_0x263218,_0x19032a);}};
\ No newline at end of file
+var _0x8951=['removeListener','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x4ed8ca,_0x4f58fe){var _0x37f902=function(_0x1f6193){while(--_0x1f6193){_0x4ed8ca['push'](_0x4ed8ca['shift']());}};_0x37f902(++_0x4f58fe);}(_0x8951,0x173));var _0x1895=function(_0xdf7b6,_0x1cb44c){_0xdf7b6=_0xdf7b6-0x0;var _0x13396c=_0x8951[_0xdf7b6];return _0x13396c;};'use strict';var MailInteractionEvents=require(_0x1895('0x0'));var events=[_0x1895('0x1'),_0x1895('0x2'),_0x1895('0x3')];function createListener(_0x5198d6,_0x3ad454){return function(_0x1f6104){_0x3ad454[_0x1895('0x4')](_0x5198d6,_0x1f6104);};}function removeListener(_0x17186a,_0x4ef243){return function(){MailInteractionEvents[_0x1895('0x5')](_0x17186a,_0x4ef243);};}exports['register']=function(_0x389296){for(var _0xca6271=0x0,_0x3f8206=events[_0x1895('0x6')];_0xca6271<_0x3f8206;_0xca6271++){var _0x2d3746=events[_0xca6271];var _0x530999=createListener(_0x1895('0x7')+_0x2d3746,_0x389296);MailInteractionEvents['on'](_0x2d3746,_0x530999);}};
\ No newline at end of file
index 490808a..d9ee5b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46aa=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','download','post','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer'];(function(_0x918032,_0x17345c){var _0x254421=function(_0xae15fd){while(--_0xae15fd){_0x918032['push'](_0x918032['shift']());}};_0x254421(++_0x17345c);}(_0x46aa,0x90));var _0xa46a=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x46aa[_0x42bdad];return _0x122626;};'use strict';var multer=require(_0xa46a('0x0'));var util=require(_0xa46a('0x1'));var path=require(_0xa46a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa46a('0x3')]();var fs_extra=require(_0xa46a('0x4'));var auth=require(_0xa46a('0x5'));var interaction=require(_0xa46a('0x6'));var config=require(_0xa46a('0x7'));var controller=require(_0xa46a('0x8'));router['get']('/',auth[_0xa46a('0x9')](),controller['index']);router[_0xa46a('0xa')](_0xa46a('0xb'),auth[_0xa46a('0x9')](),controller[_0xa46a('0xc')]);router[_0xa46a('0xa')](_0xa46a('0xd'),auth[_0xa46a('0x9')](),controller[_0xa46a('0xe')]);router[_0xa46a('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xa46a('0xf')]);router[_0xa46a('0x10')]('/',auth[_0xa46a('0x9')](),interaction[_0xa46a('0x11')](_0xa46a('0x12'),_0xa46a('0x13')),controller[_0xa46a('0x14')]);router['put'](_0xa46a('0xd'),auth[_0xa46a('0x9')](),controller[_0xa46a('0x15')]);router[_0xa46a('0x16')](_0xa46a('0x17'),auth[_0xa46a('0x9')](),controller[_0xa46a('0x18')]);router[_0xa46a('0x16')](_0xa46a('0x19'),auth['isAuthenticated'](),controller[_0xa46a('0x1a')]);router[_0xa46a('0x1b')](_0xa46a('0xd'),auth[_0xa46a('0x9')](),controller['destroy']);module[_0xa46a('0x1c')]=router;
\ No newline at end of file
+var _0xe1e3=['delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','mailmessage:create','put','accept','/:id/reject'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x2f8bc3,_0x597499){_0x2f8bc3=_0x2f8bc3-0x0;var _0x10cca2=_0xe1e3[_0x2f8bc3];return _0x10cca2;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var path=require('path');var timeout=require(_0x3e1e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e1e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var controller=require(_0x3e1e('0x6'));router[_0x3e1e('0x7')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x9')]);router['get'](_0x3e1e('0xa'),auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xb')]);router[_0x3e1e('0x7')](_0x3e1e('0xc'),auth[_0x3e1e('0x8')](),controller['show']);router['get']('/:id/download',auth[_0x3e1e('0x8')](),controller['download']);router[_0x3e1e('0xd')]('/',auth[_0x3e1e('0x8')](),interaction[_0x3e1e('0xe')]('mail',_0x3e1e('0xf')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3e1e('0x10')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3e1e('0x11')]);router[_0x3e1e('0x10')](_0x3e1e('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0x3e1e('0x13')](_0x3e1e('0xc'),auth['isAuthenticated'](),controller[_0x3e1e('0x14')]);module[_0x3e1e('0x15')]=router;
\ No newline at end of file
index 827193a..6904bec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c64=['BOOLEAN','Email','Chat','sequelize','lodash','long','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c64,0xff));var _0x47c6=function(_0x3430ab,_0x30bcd4){_0x3430ab=_0x3430ab-0x0;var _0x3d442b=_0x7c64[_0x3430ab];return _0x3d442b;};'use strict';var Sequelize=require(_0x47c6('0x0'));var _=require(_0x47c6('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x47c6('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x47c6('0x3')](_0x47c6('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x47c6('0x5')]('in',_0x47c6('0x6')),'defaultValue':_0x47c6('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x47c6('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x47c6('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x47c6('0x2'))},'bcc':{'type':Sequelize[_0x47c6('0x3')](_0x47c6('0x2'))},'subject':{'type':Sequelize[_0x47c6('0x3')]},'sentAt':{'type':Sequelize[_0x47c6('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x47c6('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x47c6('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x47c6('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x47c6('0x2'))},'originChannel':{'type':Sequelize[_0x47c6('0x5')](_0x47c6('0xa'),_0x47c6('0xb')),'defaultValue':_0x47c6('0xa'),'allowNull':![]}};
\ No newline at end of file
+var _0x9e07=['medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email','Chat','sequelize','lodash','exports','long','TEXT'];(function(_0x5a4d98,_0xc4a766){var _0x1325e9=function(_0x55b280){while(--_0x55b280){_0x5a4d98['push'](_0x5a4d98['shift']());}};_0x1325e9(++_0xc4a766);}(_0x9e07,0xb1));var _0x79e0=function(_0x2ad859,_0x5f4c2e){_0x2ad859=_0x2ad859-0x0;var _0x14c9ca=_0x9e07[_0x2ad859];return _0x14c9ca;};'use strict';var Sequelize=require(_0x79e0('0x0'));var _=require(_0x79e0('0x1'));module[_0x79e0('0x2')]={'body':{'type':Sequelize['TEXT'](_0x79e0('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x79e0('0x4')](_0x79e0('0x5'))},'read':{'type':Sequelize[_0x79e0('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x79e0('0x7')),'defaultValue':_0x79e0('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x79e0('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x79e0('0x4')](_0x79e0('0x3'))},'cc':{'type':Sequelize[_0x79e0('0x4')]('long')},'bcc':{'type':Sequelize[_0x79e0('0x4')](_0x79e0('0x3'))},'subject':{'type':Sequelize[_0x79e0('0x4')]},'sentAt':{'type':Sequelize[_0x79e0('0x9')]},'attach':{'type':Sequelize[_0x79e0('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x79e0('0x9')]},'originTo':{'type':Sequelize[_0x79e0('0x4')](_0x79e0('0x3'))},'originCc':{'type':Sequelize[_0x79e0('0x4')](_0x79e0('0x3'))},'originChannel':{'type':Sequelize[_0x79e0('0xb')](_0x79e0('0xc'),_0x79e0('0xd')),'defaultValue':_0x79e0('0xc'),'allowNull':![]}};
\ No newline at end of file
index 67ccb1f..4227cdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d1c=['code','message','result','catch','offset','undefined','limit','status','set','Content-Range','json','destroy','end','sendStatus','stack','name','index','MailMessage','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','findAll','rows','params','rawAttributes','keys','merge','find','update','body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','Contacts','updatedAt','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','service','pass','attachments','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','sendMail','messageId','format','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','channel','motionChannel','fromString','EventManager','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','email','interface','event','rejectmessage','download','unix','toString','join','files','message-%s.eml','bcc','createdAt','Attachment','Attachments','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','unlinkSync','eml-format','util','path','lodash','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1bbde7,_0x1bad73){var _0x34a127=function(_0x3b8660){while(--_0x3b8660){_0x1bbde7['push'](_0x1bbde7['shift']());}};_0x34a127(++_0x1bad73);}(_0x1d1c,0x130));var _0xc1d1=function(_0x3eeca9,_0x57d14b){_0x3eeca9=_0x3eeca9-0x0;var _0x2c8cdb=_0x1d1c[_0x3eeca9];return _0x2c8cdb;};'use strict';var emlformat=require(_0xc1d1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xc1d1('0x1'));var path=require(_0xc1d1('0x2'));var fs=require('fs');var _=require(_0xc1d1('0x3'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0xc1d1('0x4'))(_0xc1d1('0x5'));var interaction_log=require(_0xc1d1('0x4'))('mail-interactions');var config=require(_0xc1d1('0x6'));var db=require(_0xc1d1('0x7'))['db'];config['redis']=_[_0xc1d1('0x8')](config[_0xc1d1('0x9')],{'host':_0xc1d1('0xa'),'port':0x18eb});var socket=require(_0xc1d1('0xb'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0xc1d1('0xc'))[_0xc1d1('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc1d1('0xe')][_0xc1d1('0xf')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0xc1d1('0xe')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3194a7,_0x133b01,_0x2aea76,_0x2207c7){return new BPromise(function(_0xf3dbc6,_0x5bc005){var _0x3718c4=_0x2207c7||client;return _0x3718c4['request'](_0x3194a7,_0x2aea76)[_0xc1d1('0x10')](function(_0xae4b59){logger[_0xc1d1('0x11')](_0xc1d1('0x12'),_0x133b01,_0xc1d1('0x13'));logger[_0xc1d1('0x14')](_0xc1d1('0x15'),_0x133b01,_0xc1d1('0x13'),JSON[_0xc1d1('0x16')](_0xae4b59));if(_0xae4b59[_0xc1d1('0x17')]){if(_0xae4b59[_0xc1d1('0x17')][_0xc1d1('0x18')]===0x1f4){logger['error'](_0xc1d1('0x12'),_0x133b01,_0xae4b59[_0xc1d1('0x17')][_0xc1d1('0x19')]);return _0x5bc005(_0xae4b59[_0xc1d1('0x17')][_0xc1d1('0x19')]);}logger['error'](_0xc1d1('0x12'),_0x133b01,_0xae4b59[_0xc1d1('0x17')][_0xc1d1('0x19')]);return _0xf3dbc6(_0xae4b59[_0xc1d1('0x17')][_0xc1d1('0x19')]);}else{logger[_0xc1d1('0x11')](_0xc1d1('0x12'),_0x133b01,_0xc1d1('0x13'));_0xf3dbc6(_0xae4b59[_0xc1d1('0x1a')][_0xc1d1('0x19')]);}})[_0xc1d1('0x1b')](function(_0x5d92e0){logger[_0xc1d1('0x17')](_0xc1d1('0x12'),_0x133b01,_0x5d92e0);_0x5bc005(_0x5d92e0);});});}function respondWithResult(_0x374ca1,_0x5920f9){_0x5920f9=_0x5920f9||0xc8;return function(_0x9afee){if(_0x9afee){return _0x374ca1['status'](_0x5920f9)['json'](_0x9afee);}};}function respondWithFilteredResult(_0x38732e,_0x271190){return function(_0x3caa4e){if(_0x3caa4e){var _0x5d967b=typeof _0x271190[_0xc1d1('0x1c')]===_0xc1d1('0x1d')&&typeof _0x271190[_0xc1d1('0x1e')]===_0xc1d1('0x1d');var _0xbd3740=_0x3caa4e['count'];var _0x5079d1=_0x5d967b?0x0:_0x271190[_0xc1d1('0x1c')];var _0x18c6a7=_0x5d967b?_0x3caa4e['count']:_0x271190[_0xc1d1('0x1c')]+_0x271190[_0xc1d1('0x1e')];var _0x189cda;if(_0x18c6a7>=_0xbd3740){_0x18c6a7=_0xbd3740;_0x189cda=0xc8;}else{_0x189cda=0xce;}_0x38732e[_0xc1d1('0x1f')](_0x189cda);return _0x38732e[_0xc1d1('0x20')](_0xc1d1('0x21'),_0x5079d1+'-'+_0x18c6a7+'/'+_0xbd3740)[_0xc1d1('0x22')](_0x3caa4e);}return null;};}function saveUpdates(_0x53f0a6){return function(_0x3b944b){if(_0x3b944b){return _0x3b944b['update'](_0x53f0a6)[_0xc1d1('0x10')](function(_0x59b108){return _0x59b108;});}return null;};}function removeEntity(_0x24f6ad){return function(_0x100917){if(_0x100917){return _0x100917[_0xc1d1('0x23')]()[_0xc1d1('0x10')](function(){_0x24f6ad['status'](0xcc)[_0xc1d1('0x24')]();});}};}function handleEntityNotFound(_0x4423f5){return function(_0x7b91e7){if(!_0x7b91e7){_0x4423f5[_0xc1d1('0x25')](0x194);}return _0x7b91e7;};}function handleError(_0x3d7644,_0x598d0a){_0x598d0a=_0x598d0a||0x1f4;return function(_0x20f538){logger[_0xc1d1('0x17')](_0x20f538[_0xc1d1('0x26')]);if(_0x20f538[_0xc1d1('0x27')]){delete _0x20f538[_0xc1d1('0x27')];}_0x3d7644[_0xc1d1('0x1f')](_0x598d0a)['send'](_0x20f538);};}exports[_0xc1d1('0x28')]=function(_0x14a902,_0x5023c6){var _0x20b5f4={},_0x2b164a={},_0x503015={'count':0x0,'rows':[]};var _0x2ec712=_['map'](db[_0xc1d1('0x29')]['rawAttributes'],function(_0x59cab0){return{'name':_0x59cab0[_0xc1d1('0x2a')],'type':_0x59cab0[_0xc1d1('0x2b')][_0xc1d1('0x2c')]};});_0x2b164a[_0xc1d1('0x2d')]=_[_0xc1d1('0x2e')](_0x2ec712,_0xc1d1('0x27'));_0x2b164a[_0xc1d1('0x2f')]=_['keys'](_0x14a902[_0xc1d1('0x2f')]);_0x2b164a[_0xc1d1('0x30')]=_[_0xc1d1('0x31')](_0x2b164a[_0xc1d1('0x2d')],_0x2b164a[_0xc1d1('0x2f')]);_0x20b5f4['attributes']=_[_0xc1d1('0x31')](_0x2b164a[_0xc1d1('0x2d')],qs[_0xc1d1('0x32')](_0x14a902[_0xc1d1('0x2f')]['fields']));_0x20b5f4[_0xc1d1('0x33')]=_0x20b5f4[_0xc1d1('0x33')][_0xc1d1('0x34')]?_0x20b5f4[_0xc1d1('0x33')]:_0x2b164a[_0xc1d1('0x2d')];if(!_0x14a902[_0xc1d1('0x2f')][_0xc1d1('0x35')](_0xc1d1('0x36'))){_0x20b5f4['limit']=qs[_0xc1d1('0x1e')](_0x14a902[_0xc1d1('0x2f')]['limit']);_0x20b5f4[_0xc1d1('0x1c')]=qs[_0xc1d1('0x1c')](_0x14a902['query']['offset']);}_0x20b5f4[_0xc1d1('0x37')]=qs[_0xc1d1('0x38')](_0x14a902['query']['sort']);_0x20b5f4[_0xc1d1('0x39')]=qs[_0xc1d1('0x30')](_[_0xc1d1('0x3a')](_0x14a902['query'],_0x2b164a[_0xc1d1('0x30')]),_0x2ec712);if(_0x14a902[_0xc1d1('0x2f')][_0xc1d1('0x3b')]){_0x20b5f4['where']=_['merge'](_0x20b5f4['where'],{'$or':_[_0xc1d1('0x2e')](_0x2ec712,function(_0x3b84af){if(_0x3b84af[_0xc1d1('0x2b')]!==_0xc1d1('0x3c')){var _0xeb3932={};_0xeb3932[_0x3b84af[_0xc1d1('0x27')]]={'$like':'%'+_0x14a902['query'][_0xc1d1('0x3b')]+'%'};return _0xeb3932;}})});}_0x20b5f4=_['merge']({},_0x20b5f4,_0x14a902[_0xc1d1('0x3d')]);var _0x57a95e={'where':_0x20b5f4[_0xc1d1('0x39')]};return db['MailMessage'][_0xc1d1('0x3e')](_0x57a95e)[_0xc1d1('0x10')](function(_0x2f660e){_0x503015['count']=_0x2f660e;if(_0x14a902[_0xc1d1('0x2f')][_0xc1d1('0x3f')]){_0x20b5f4['include']=[{'all':!![]}];}return db[_0xc1d1('0x29')][_0xc1d1('0x40')](_0x20b5f4);})[_0xc1d1('0x10')](function(_0xd26ac1){_0x503015[_0xc1d1('0x41')]=_0xd26ac1;return _0x503015;})[_0xc1d1('0x10')](respondWithFilteredResult(_0x5023c6,_0x20b5f4))[_0xc1d1('0x1b')](handleError(_0x5023c6,null));};exports['show']=function(_0x1786ba,_0x5cdb03){var _0x1a5a1f={'raw':!![],'where':{'id':_0x1786ba[_0xc1d1('0x42')]['id']}},_0xcf2327={};_0xcf2327[_0xc1d1('0x2d')]=_['keys'](db[_0xc1d1('0x29')][_0xc1d1('0x43')]);_0xcf2327[_0xc1d1('0x2f')]=_[_0xc1d1('0x44')](_0x1786ba['query']);_0xcf2327['filters']=_['intersection'](_0xcf2327[_0xc1d1('0x2d')],_0xcf2327[_0xc1d1('0x2f')]);_0x1a5a1f[_0xc1d1('0x33')]=_['intersection'](_0xcf2327[_0xc1d1('0x2d')],qs[_0xc1d1('0x32')](_0x1786ba[_0xc1d1('0x2f')][_0xc1d1('0x32')]));_0x1a5a1f[_0xc1d1('0x33')]=_0x1a5a1f[_0xc1d1('0x33')][_0xc1d1('0x34')]?_0x1a5a1f[_0xc1d1('0x33')]:_0xcf2327[_0xc1d1('0x2d')];if(_0x1786ba[_0xc1d1('0x2f')]['includeAll']){_0x1a5a1f['include']=[{'all':!![]}];}_0x1a5a1f=_[_0xc1d1('0x45')]({},_0x1a5a1f,_0x1786ba[_0xc1d1('0x3d')]);return db[_0xc1d1('0x29')][_0xc1d1('0x46')](_0x1a5a1f)[_0xc1d1('0x10')](handleEntityNotFound(_0x5cdb03,null))[_0xc1d1('0x10')](respondWithResult(_0x5cdb03,null))[_0xc1d1('0x1b')](handleError(_0x5cdb03,null));};exports[_0xc1d1('0x47')]=function(_0x4a54c1,_0x4a3e7f){if(_0x4a54c1['body']['id']){delete _0x4a54c1[_0xc1d1('0x48')]['id'];}return db[_0xc1d1('0x29')][_0xc1d1('0x46')]({'where':{'id':_0x4a54c1[_0xc1d1('0x42')]['id']}})[_0xc1d1('0x10')](handleEntityNotFound(_0x4a3e7f,null))[_0xc1d1('0x10')](saveUpdates(_0x4a54c1['body'],null))[_0xc1d1('0x10')](respondWithResult(_0x4a3e7f,null))[_0xc1d1('0x1b')](handleError(_0x4a3e7f,null));};exports['destroy']=function(_0x5aa970,_0x2c23ef){return db['MailMessage'][_0xc1d1('0x46')]({'where':{'id':_0x5aa970[_0xc1d1('0x42')]['id']}})[_0xc1d1('0x10')](handleEntityNotFound(_0x2c23ef,null))[_0xc1d1('0x10')](removeEntity(_0x2c23ef,null))[_0xc1d1('0x1b')](handleError(_0x2c23ef,null));};exports[_0xc1d1('0x49')]=function(_0x519875,_0x221331){return db[_0xc1d1('0x29')]['describe']()[_0xc1d1('0x10')](respondWithResult(_0x221331,null))['catch'](handleError(_0x221331,null));};exports[_0xc1d1('0x4a')]=function(_0x48fdc3,_0x58ee92){return db[_0xc1d1('0x29')]['create'](_0x48fdc3[_0xc1d1('0x48')])['then'](function(_0x119082){if(_0x119082){if(_0x119082[_0xc1d1('0x4b')]===_0xc1d1('0x4c')&&!_0x119082[_0xc1d1('0x4d')]){var _0x58a9dd,_0x9411e9,_0x4bf0ca;if(_0x48fdc3['body']['to']){_0x9411e9=_0x48fdc3[_0xc1d1('0x48')]['to'][_0xc1d1('0x4e')](',')[0x0];}return db[_0xc1d1('0x4f')]['findOne']({'where':{'id':_0x119082[_0xc1d1('0x50')]},'include':[{'model':db[_0xc1d1('0x51')],'as':_0xc1d1('0x52'),'include':[{'model':db['CmContact'],'as':_0xc1d1('0x53'),'where':{'email':_0x9411e9},'limit':0x1,'order':[[_0xc1d1('0x54'),'DESC']]}]},{'model':db[_0xc1d1('0x55')],'as':_0xc1d1('0x56'),'raw':!![]}]})[_0xc1d1('0x10')](function(_0x57c3d4){_0x58a9dd=_0x57c3d4;if(_0x58a9dd&&_0x58a9dd[_0xc1d1('0x56')]){var _0x1d658e={'tls':{'rejectUnauthorized':![]}};if(_[_0xc1d1('0x57')](_0x58a9dd[_0xc1d1('0x56')]['service'])){_0x1d658e['host']=_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x58')];_0x1d658e[_0xc1d1('0x59')]=_0x58a9dd['Smtp'][_0xc1d1('0x59')];_0x1d658e[_0xc1d1('0x5a')]=_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x5a')];if(_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x5b')]){_0x1d658e[_0xc1d1('0x5c')]={'user':_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x5d')],'pass':_0x58a9dd[_0xc1d1('0x56')]['pass']};}}else{_0x1d658e[_0xc1d1('0x5e')]=_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x5e')];_0x1d658e[_0xc1d1('0x5c')]={'user':_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x5d')],'pass':_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x5f')]};_0x1d658e[_0xc1d1('0x5a')]=_0x58a9dd[_0xc1d1('0x56')][_0xc1d1('0x5a')];}if(_0x48fdc3['body'][_0xc1d1('0x60')]&&_0x48fdc3[_0xc1d1('0x48')][_0xc1d1('0x60')]['length']){for(var _0x2ecfaa=0x0;_0x2ecfaa<_0x48fdc3[_0xc1d1('0x48')][_0xc1d1('0x60')][_0xc1d1('0x34')];_0x2ecfaa+=0x1){_0x48fdc3[_0xc1d1('0x48')][_0xc1d1('0x60')][_0x2ecfaa]={'filename':_0x48fdc3[_0xc1d1('0x48')][_0xc1d1('0x60')][_0x2ecfaa][_0xc1d1('0x27')],'path':path['join'](config[_0xc1d1('0x61')],_0xc1d1('0x62'),_0x48fdc3[_0xc1d1('0x48')][_0xc1d1('0x60')][_0x2ecfaa][_0xc1d1('0x63')])};}}_0x4bf0ca={'account':_0x1d658e,'message':_0x48fdc3[_0xc1d1('0x48')]};return;}})[_0xc1d1('0x10')](function(){if(_0x58a9dd[_0xc1d1('0x52')]){if(_0x58a9dd[_0xc1d1('0x52')][_0xc1d1('0x53')][_0xc1d1('0x34')]){return _0x58a9dd[_0xc1d1('0x52')][_0xc1d1('0x53')][0x0];}else{return db[_0xc1d1('0x64')][_0xc1d1('0x4a')](_[_0xc1d1('0x8')](_0x48fdc3[_0xc1d1('0x48')],{'firstName':_0x48fdc3[_0xc1d1('0x48')]['to'],'email':_0x48fdc3[_0xc1d1('0x48')]['to'],'phone':_0x48fdc3['body']['to'],'ListId':_0x58a9dd[_0xc1d1('0x65')]}));}}else{throw new Error(_0xc1d1('0x66'));}})[_0xc1d1('0x10')](function(){if(_0x4bf0ca){return respondWithRpcPromise('SendMail',_0xc1d1('0x67'),_0x4bf0ca,client9003)[_0xc1d1('0x10')](function(_0x18f48e){return _0x119082[_0xc1d1('0x47')]({'read':!![],'messageId':_0x18f48e[_0xc1d1('0x68')],'sentAt':moment()[_0xc1d1('0x69')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xc1d1('0x1b')](function(_0x1c5e43){logger['error']('%s',JSON[_0xc1d1('0x16')](_0x1c5e43));return _0x119082;});}return _0x119082;});}return _0x119082;}})[_0xc1d1('0x10')](respondWithResult(_0x58ee92,0xc9))[_0xc1d1('0x1b')](handleError(_0x58ee92,null));};exports[_0xc1d1('0x6a')]=function(_0x56a84b,_0x21f7a6){var _0xe8c968={'agent':{},'channel':'mail'};if(_0x56a84b[_0xc1d1('0x48')]['id']){delete _0x56a84b[_0xc1d1('0x48')]['id'];}_0x56a84b['body'][_0xc1d1('0x6b')]=!![];_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x6c')]=moment()[_0xc1d1('0x69')]('YYYY-MM-DD\x20HH:mm:ss');_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x6d')]=_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x6d')]||_0x56a84b[_0xc1d1('0x5d')]['id'];_0xe8c968[_0xc1d1('0x6e')]['id']=_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x6d')];return db['MailMessage'][_0xc1d1('0x46')]({'where':{'id':_0x56a84b[_0xc1d1('0x42')]['id'],'UserId':null}})[_0xc1d1('0x10')](handleEntityNotFound(_0x21f7a6,null))['then'](saveUpdates(_0x56a84b[_0xc1d1('0x48')],null))[_0xc1d1('0x10')](function(_0x3808eb){if(_0x3808eb){_0xe8c968[_0xc1d1('0x19')]=_0x3808eb[_0xc1d1('0x6f')]({'plain':!![]});return db[_0xc1d1('0x70')][_0xc1d1('0x46')]({'where':{'id':_0x3808eb[_0xc1d1('0x71')]}});}return null;})[_0xc1d1('0x10')](handleEntityNotFound(_0x21f7a6,null))['then'](function(_0x9c9ace){if(_0x9c9ace){return _0x9c9ace['update']({'UserId':_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x6d')],'read1stAt':_[_0xc1d1('0x57')](_0x9c9ace[_0xc1d1('0x72')])?moment()[_0xc1d1('0x69')](_0xc1d1('0x73')):undefined});}return null;})[_0xc1d1('0x10')](function(_0x2db326){if(_0x2db326){_0xe8c968[_0xc1d1('0x74')]=_0x2db326[_0xc1d1('0x6f')]({'plain':!![]});interaction_log['info'](_0xc1d1('0x75'),_0x56a84b[_0xc1d1('0x5d')]['id'],_0x56a84b['user'][_0xc1d1('0x27')],_0x56a84b['user'][_0xc1d1('0x76')],_0xe8c968['interaction']['id'],_0x56a84b[_0xc1d1('0x48')]?JSON['stringify'](_0x56a84b[_0xc1d1('0x48')]):_0xc1d1('0x77'));return respondWithRpcPromise(_0xc1d1('0x78'),_0xc1d1('0x79'),_0xe8c968);}return null;})[_0xc1d1('0x10')](function(_0x5e49c9){var _0x33da4b=_0xc1d1('0x7a')+_0x5e49c9[_0xc1d1('0x19')][_0xc1d1('0x7b')];return db[_0xc1d1('0x7c')][_0xc1d1('0x2f')](_0x33da4b,{'type':db[_0xc1d1('0x7d')][_0xc1d1('0x7e')][_0xc1d1('0x7f')],'raw':!![]})['then'](function(_0x53da28){return _0x53da28;});})['then'](function(_0x41fcfd){if(_0x41fcfd){_0xe8c968[_0xc1d1('0x19')][_0xc1d1('0x80')]=_0x41fcfd[0x0];if(!_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x6d')])return;return db[_0xc1d1('0x81')]['find']({'where':{'id':_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x6d')],'role':_0xc1d1('0x6e')},'attributes':['id',_0xc1d1('0x27'),_0xc1d1('0x82'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x47ff25){if(!_0x47ff25)return null;_0xe8c968[_0xc1d1('0x19')]['agent']=_0x47ff25;return _0xe8c968;})[_0xc1d1('0x10')](function(_0x4d6b00){if(_0x4d6b00){if(_0x56a84b[_0xc1d1('0x48')][_0xc1d1('0x83')]){_0xe8c968[_0xc1d1('0x19')]['interface']=util[_0xc1d1('0x69')]('SIP/%s',_0x56a84b[_0xc1d1('0x5d')]['name']);_0xe8c968[_0xc1d1('0x19')][_0xc1d1('0x84')]=_0xe8c968[_0xc1d1('0x84')];_0xe8c968[_0xc1d1('0x19')][_0xc1d1('0x85')]=_0xe8c968[_0xc1d1('0x84')];_0xe8c968['message']['event']=_0xc1d1('0x6a');_0xe8c968[_0xc1d1('0x19')][_0xc1d1('0x48')]=htmlToText[_0xc1d1('0x86')](_0xe8c968[_0xc1d1('0x19')]['body']);return respondWithRpcPromise(_0xc1d1('0x87'),_0xc1d1('0x87'),{'event':'acceptmessage','message':_0xe8c968['message']},client9002)[_0xc1d1('0x10')](function(){return _0xe8c968;});}return _0xe8c968;}return null;})[_0xc1d1('0x10')](respondWithResult(_0x21f7a6,null))[_0xc1d1('0x1b')](handleError(_0x21f7a6,null));};exports[_0xc1d1('0x88')]=function(_0x3fb622,_0x10d852){var _0x582317={'agent':{},'channel':_0xc1d1('0x89')};if(_0x3fb622[_0xc1d1('0x48')]['id']){delete _0x3fb622[_0xc1d1('0x48')]['id'];}_0x3fb622[_0xc1d1('0x48')][_0xc1d1('0x6d')]=_0x3fb622[_0xc1d1('0x48')][_0xc1d1('0x6d')]||_0x3fb622[_0xc1d1('0x5d')]['id'];_0x582317['agent']['id']=_0x3fb622[_0xc1d1('0x48')][_0xc1d1('0x6d')];return db[_0xc1d1('0x29')][_0xc1d1('0x46')]({'where':{'id':_0x3fb622[_0xc1d1('0x42')]['id'],'UserId':null}})[_0xc1d1('0x10')](handleEntityNotFound(_0x10d852,null))['then'](function(_0x5f1635){if(_0x5f1635){_0x582317['message']=_0x5f1635[_0xc1d1('0x6f')]({'plain':!![]});return db[_0xc1d1('0x70')][_0xc1d1('0x46')]({'where':{'id':_0x5f1635[_0xc1d1('0x71')]}});}return null;})[_0xc1d1('0x10')](handleEntityNotFound(_0x10d852,null))[_0xc1d1('0x10')](function(_0x521723){if(_0x521723){_0x582317[_0xc1d1('0x74')]=_0x521723[_0xc1d1('0x6f')]({'plain':!![]});interaction_log['info'](_0xc1d1('0x8a'),_0x3fb622[_0xc1d1('0x5d')]['id'],_0x3fb622['user']['name'],_0x3fb622[_0xc1d1('0x5d')][_0xc1d1('0x76')],_0x582317[_0xc1d1('0x74')]['id'],_0x3fb622[_0xc1d1('0x48')]?JSON[_0xc1d1('0x16')](_0x3fb622[_0xc1d1('0x48')]):_0xc1d1('0x77'));return respondWithRpcPromise('RejectMessage',_0xc1d1('0x8b'),_0x582317);}return null;})['then'](function(_0x503132){var _0x454333='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x503132[_0xc1d1('0x19')][_0xc1d1('0x7b')];return db[_0xc1d1('0x7c')][_0xc1d1('0x2f')](_0x454333,{'type':db[_0xc1d1('0x7d')][_0xc1d1('0x7e')]['SELECT'],'raw':!![]})[_0xc1d1('0x10')](function(_0x255eae){return _0x255eae;});})['then'](function(_0x5ba722){if(_0x5ba722){_0x582317[_0xc1d1('0x19')]['contact']=_0x5ba722[0x0];if(!_0x3fb622[_0xc1d1('0x48')][_0xc1d1('0x6d')])return;return db[_0xc1d1('0x81')]['find']({'where':{'id':_0x3fb622[_0xc1d1('0x48')][_0xc1d1('0x6d')],'role':_0xc1d1('0x6e')},'attributes':['id',_0xc1d1('0x27'),_0xc1d1('0x82'),_0xc1d1('0x8c'),'internal'],'raw':!![]});}return null;})[_0xc1d1('0x10')](function(_0x240d09){if(!_0x240d09)return null;_0x582317[_0xc1d1('0x19')]['agent']=_0x240d09;return _0x582317;})[_0xc1d1('0x10')](function(_0x35f575){if(_0x35f575){_0x35f575[_0xc1d1('0x19')][_0xc1d1('0x8d')]=util[_0xc1d1('0x69')]('SIP/%s',_0x3fb622[_0xc1d1('0x5d')][_0xc1d1('0x27')]);_0x35f575['message'][_0xc1d1('0x84')]=_0x582317[_0xc1d1('0x84')];_0x35f575[_0xc1d1('0x19')][_0xc1d1('0x85')]=_0x582317[_0xc1d1('0x84')];_0x35f575[_0xc1d1('0x19')][_0xc1d1('0x8e')]='reject';_0x35f575[_0xc1d1('0x19')]['body']=htmlToText[_0xc1d1('0x86')](_0x582317['message'][_0xc1d1('0x48')]);respondWithRpcPromise(_0xc1d1('0x87'),_0xc1d1('0x87'),{'event':_0xc1d1('0x8f'),'message':_0x35f575[_0xc1d1('0x19')]},client9002);return _0x582317;}return null;})[_0xc1d1('0x10')](respondWithResult(_0x10d852,null))[_0xc1d1('0x1b')](handleError(_0x10d852,null));};exports[_0xc1d1('0x90')]=function(_0x44b5f3,_0x4625b1){var _0x2ea321=moment()[_0xc1d1('0x91')]()[_0xc1d1('0x92')]();var _0x564c1e=path[_0xc1d1('0x93')](config[_0xc1d1('0x61')],'server','files','tmp');var _0x493e53=path['join'](config[_0xc1d1('0x61')],'server',_0xc1d1('0x94'),_0xc1d1('0x60'));var _0xa4586b=util['format'](_0xc1d1('0x95'),_0x2ea321);return db[_0xc1d1('0x29')][_0xc1d1('0x46')]({'where':{'id':_0x44b5f3[_0xc1d1('0x42')]['id']},'attributes':['id','body','from','to','cc',_0xc1d1('0x96'),'subject',_0xc1d1('0x97')],'include':_0x44b5f3[_0xc1d1('0x2f')]['attachments']?[{'model':db[_0xc1d1('0x98')],'as':_0xc1d1('0x99')}]:undefined})[_0xc1d1('0x10')](handleEntityNotFound(_0x4625b1,null))['then'](function(_0x42e7e7){if(_0x42e7e7){var _0x222b27=_0x42e7e7;var _0xeccc3f={'from':_0x222b27[_0xc1d1('0x9a')],'to':_0x222b27['to'],'subject':_0x222b27[_0xc1d1('0x9b')],'html':htmlEntities[_0xc1d1('0x9c')](_0x222b27[_0xc1d1('0x48')]),'headers':{'Date':moment(_0x222b27[_0xc1d1('0x97')])[_0xc1d1('0x69')](_0xc1d1('0x9d'))},'attachments':[]};if(_0x42e7e7['cc']){_0xeccc3f['headers']['Cc']=_0x42e7e7['cc'];}if(_0x42e7e7[_0xc1d1('0x96')]){_0xeccc3f[_0xc1d1('0x9e')][_0xc1d1('0x9f')]=_0x42e7e7[_0xc1d1('0x96')];}return new BPromise(function(_0x2559ca,_0x55f12c){if(_0x42e7e7[_0xc1d1('0x99')]){for(var _0x1f4a4d=0x0;_0x1f4a4d<_0x42e7e7[_0xc1d1('0x99')][_0xc1d1('0x34')];_0x1f4a4d++){var _0x19d409=_0x42e7e7[_0xc1d1('0x99')][_0x1f4a4d];var _0xe715b2=path[_0xc1d1('0x93')](_0x493e53,_0x19d409[_0xc1d1('0x63')]);if(fs[_0xc1d1('0xa0')](_0xe715b2)){_0xeccc3f['attachments'][_0xc1d1('0xa1')]({'name':_0x19d409[_0xc1d1('0x27')],'contentType':_0x19d409[_0xc1d1('0x2b')],'data':fs[_0xc1d1('0xa2')](_0xe715b2)});}}}emlformat['build'](_0xeccc3f,function(_0x3cd1e5,_0x117928){if(_0x3cd1e5)return _0x55f12c(_0x3cd1e5);fs['writeFileSync'](path[_0xc1d1('0x93')](_0x564c1e,_0xa4586b),_0x117928);return _0x2559ca(_0x117928);});});}})['then'](function(_0x17fb55){if(_0x17fb55){return _0x4625b1[_0xc1d1('0x90')](path[_0xc1d1('0x93')](_0x564c1e,_0xa4586b),_0xa4586b,function(_0x41576a){if(!_0x41576a)fs[_0xc1d1('0xa3')](path[_0xc1d1('0x93')](_0x564c1e,_0xa4586b));});}})['catch'](handleError(_0x4625b1,null));};
\ No newline at end of file
+var _0x0f75=['localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','name','index','MailMessage','rawAttributes','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','out','split','findOne','MailAccountId','CmList','List','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','basename','Contacts','CmContact','defaults','ListId','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','format','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','reject','role','RejectMessage','rejectMessage','sequelize','contact','event','rejectmessage','download','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis'];(function(_0x5d6e04,_0x5a408a){var _0x17dfed=function(_0x1c6bb4){while(--_0x1c6bb4){_0x5d6e04['push'](_0x5d6e04['shift']());}};_0x17dfed(++_0x5a408a);}(_0x0f75,0x1e4));var _0x50f7=function(_0x1881ee,_0x2569d8){_0x1881ee=_0x1881ee-0x0;var _0x3b8547=_0x0f75[_0x1881ee];return _0x3b8547;};'use strict';var emlformat=require(_0x50f7('0x0'));var moment=require(_0x50f7('0x1'));var BPromise=require(_0x50f7('0x2'));var util=require(_0x50f7('0x3'));var path=require(_0x50f7('0x4'));var fs=require('fs');var _=require(_0x50f7('0x5'));var Redis=require(_0x50f7('0x6'));var htmlToText=require('html-to-text');var qs=require(_0x50f7('0x7'));var logger=require('../../config/logger')(_0x50f7('0x8'));var interaction_log=require(_0x50f7('0x9'))(_0x50f7('0xa'));var config=require(_0x50f7('0xb'));var db=require(_0x50f7('0xc'))['db'];config[_0x50f7('0xd')]=_['defaults'](config[_0x50f7('0xd')],{'host':_0x50f7('0xe'),'port':0x18eb});var socket=require(_0x50f7('0xf'))(new Redis(config[_0x50f7('0xd')]));var htmlEntities=require(_0x50f7('0x10'));require(_0x50f7('0x11'))[_0x50f7('0x12')](socket);var jayson=require(_0x50f7('0x13'));var client=jayson[_0x50f7('0x14')][_0x50f7('0x15')]({'port':0x232c});var client9003=jayson[_0x50f7('0x14')]['http']({'port':0x232b});var client9002=jayson[_0x50f7('0x14')][_0x50f7('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x291d99,_0x5d9a40,_0x4fc91d,_0x7c3f1b){return new BPromise(function(_0x424da1,_0x4a0e58){var _0x2216b9=_0x7c3f1b||client;return _0x2216b9[_0x50f7('0x16')](_0x291d99,_0x4fc91d)[_0x50f7('0x17')](function(_0x11a11e){logger[_0x50f7('0x18')](_0x50f7('0x19'),_0x5d9a40,_0x50f7('0x1a'));logger[_0x50f7('0x1b')](_0x50f7('0x1c'),_0x5d9a40,_0x50f7('0x1a'),JSON[_0x50f7('0x1d')](_0x11a11e));if(_0x11a11e[_0x50f7('0x1e')]){if(_0x11a11e[_0x50f7('0x1e')][_0x50f7('0x1f')]===0x1f4){logger[_0x50f7('0x1e')]('MailMessage,\x20%s,\x20%s',_0x5d9a40,_0x11a11e['error']['message']);return _0x4a0e58(_0x11a11e[_0x50f7('0x1e')][_0x50f7('0x20')]);}logger[_0x50f7('0x1e')](_0x50f7('0x19'),_0x5d9a40,_0x11a11e[_0x50f7('0x1e')][_0x50f7('0x20')]);return _0x424da1(_0x11a11e[_0x50f7('0x1e')]['message']);}else{logger[_0x50f7('0x18')](_0x50f7('0x19'),_0x5d9a40,_0x50f7('0x1a'));_0x424da1(_0x11a11e[_0x50f7('0x21')][_0x50f7('0x20')]);}})[_0x50f7('0x22')](function(_0x59e44a){logger[_0x50f7('0x1e')]('MailMessage,\x20%s,\x20%s',_0x5d9a40,_0x59e44a);_0x4a0e58(_0x59e44a);});});}function respondWithResult(_0x44c0b4,_0x492215){_0x492215=_0x492215||0xc8;return function(_0x8634c4){if(_0x8634c4){return _0x44c0b4[_0x50f7('0x23')](_0x492215)[_0x50f7('0x24')](_0x8634c4);}};}function respondWithFilteredResult(_0x468923,_0x584ac8){return function(_0x43ebf3){if(_0x43ebf3){var _0x1b9938=typeof _0x584ac8[_0x50f7('0x25')]===_0x50f7('0x26')&&typeof _0x584ac8[_0x50f7('0x27')]===_0x50f7('0x26');var _0x2e01b0=_0x43ebf3[_0x50f7('0x28')];var _0x39a7ff=_0x1b9938?0x0:_0x584ac8[_0x50f7('0x25')];var _0x5c3930=_0x1b9938?_0x43ebf3['count']:_0x584ac8['offset']+_0x584ac8[_0x50f7('0x27')];var _0x3c9be3;if(_0x5c3930>=_0x2e01b0){_0x5c3930=_0x2e01b0;_0x3c9be3=0xc8;}else{_0x3c9be3=0xce;}_0x468923['status'](_0x3c9be3);return _0x468923[_0x50f7('0x29')](_0x50f7('0x2a'),_0x39a7ff+'-'+_0x5c3930+'/'+_0x2e01b0)[_0x50f7('0x24')](_0x43ebf3);}return null;};}function saveUpdates(_0x2261b7){return function(_0x408c7a){if(_0x408c7a){return _0x408c7a[_0x50f7('0x2b')](_0x2261b7)[_0x50f7('0x17')](function(_0x53cbad){return _0x53cbad;});}return null;};}function removeEntity(_0x17cd2e){return function(_0x41f465){if(_0x41f465){return _0x41f465[_0x50f7('0x2c')]()[_0x50f7('0x17')](function(){_0x17cd2e[_0x50f7('0x23')](0xcc)[_0x50f7('0x2d')]();});}};}function handleEntityNotFound(_0x58ff7e){return function(_0x40d59f){if(!_0x40d59f){_0x58ff7e[_0x50f7('0x2e')](0x194);}return _0x40d59f;};}function handleError(_0x5799cf,_0x3a806e){_0x3a806e=_0x3a806e||0x1f4;return function(_0x25a0fa){logger[_0x50f7('0x1e')](_0x25a0fa['stack']);if(_0x25a0fa[_0x50f7('0x2f')]){delete _0x25a0fa['name'];}_0x5799cf[_0x50f7('0x23')](_0x3a806e)['send'](_0x25a0fa);};}exports[_0x50f7('0x30')]=function(_0x25061d,_0x26ecd3){var _0x3d3b4a={},_0x3106e3={},_0x58346f={'count':0x0,'rows':[]};var _0x405064=_['map'](db[_0x50f7('0x31')][_0x50f7('0x32')],function(_0x12fb07){return{'name':_0x12fb07['fieldName'],'type':_0x12fb07['type']['key']};});_0x3106e3[_0x50f7('0x33')]=_['map'](_0x405064,'name');_0x3106e3['query']=_[_0x50f7('0x34')](_0x25061d['query']);_0x3106e3['filters']=_[_0x50f7('0x35')](_0x3106e3[_0x50f7('0x33')],_0x3106e3['query']);_0x3d3b4a['attributes']=_[_0x50f7('0x35')](_0x3106e3[_0x50f7('0x33')],qs['fields'](_0x25061d[_0x50f7('0x36')][_0x50f7('0x37')]));_0x3d3b4a[_0x50f7('0x38')]=_0x3d3b4a[_0x50f7('0x38')][_0x50f7('0x39')]?_0x3d3b4a[_0x50f7('0x38')]:_0x3106e3[_0x50f7('0x33')];if(!_0x25061d[_0x50f7('0x36')][_0x50f7('0x3a')]('nolimit')){_0x3d3b4a[_0x50f7('0x27')]=qs[_0x50f7('0x27')](_0x25061d[_0x50f7('0x36')][_0x50f7('0x27')]);_0x3d3b4a['offset']=qs[_0x50f7('0x25')](_0x25061d['query'][_0x50f7('0x25')]);}_0x3d3b4a[_0x50f7('0x3b')]=qs[_0x50f7('0x3c')](_0x25061d['query'][_0x50f7('0x3c')]);_0x3d3b4a[_0x50f7('0x3d')]=qs[_0x50f7('0x3e')](_[_0x50f7('0x3f')](_0x25061d[_0x50f7('0x36')],_0x3106e3['filters']),_0x405064);if(_0x25061d[_0x50f7('0x36')][_0x50f7('0x40')]){_0x3d3b4a[_0x50f7('0x3d')]=_[_0x50f7('0x41')](_0x3d3b4a[_0x50f7('0x3d')],{'$or':_['map'](_0x405064,function(_0x29812c){if(_0x29812c[_0x50f7('0x42')]!==_0x50f7('0x43')){var _0x34f7fc={};_0x34f7fc[_0x29812c[_0x50f7('0x2f')]]={'$like':'%'+_0x25061d[_0x50f7('0x36')][_0x50f7('0x40')]+'%'};return _0x34f7fc;}})});}_0x3d3b4a=_[_0x50f7('0x41')]({},_0x3d3b4a,_0x25061d[_0x50f7('0x44')]);var _0x867c45={'where':_0x3d3b4a['where']};return db[_0x50f7('0x31')][_0x50f7('0x28')](_0x867c45)[_0x50f7('0x17')](function(_0x17fc70){_0x58346f[_0x50f7('0x28')]=_0x17fc70;if(_0x25061d[_0x50f7('0x36')][_0x50f7('0x45')]){_0x3d3b4a[_0x50f7('0x46')]=[{'all':!![]}];}return db['MailMessage'][_0x50f7('0x47')](_0x3d3b4a);})[_0x50f7('0x17')](function(_0x4932bb){_0x58346f[_0x50f7('0x48')]=_0x4932bb;return _0x58346f;})[_0x50f7('0x17')](respondWithFilteredResult(_0x26ecd3,_0x3d3b4a))[_0x50f7('0x22')](handleError(_0x26ecd3,null));};exports[_0x50f7('0x49')]=function(_0x31ee2d,_0x562c84){var _0x4cd88b={'raw':!![],'where':{'id':_0x31ee2d[_0x50f7('0x4a')]['id']}},_0x1d3637={};_0x1d3637[_0x50f7('0x33')]=_['keys'](db['MailMessage'][_0x50f7('0x32')]);_0x1d3637[_0x50f7('0x36')]=_['keys'](_0x31ee2d[_0x50f7('0x36')]);_0x1d3637['filters']=_[_0x50f7('0x35')](_0x1d3637[_0x50f7('0x33')],_0x1d3637[_0x50f7('0x36')]);_0x4cd88b[_0x50f7('0x38')]=_[_0x50f7('0x35')](_0x1d3637['model'],qs[_0x50f7('0x37')](_0x31ee2d['query']['fields']));_0x4cd88b['attributes']=_0x4cd88b[_0x50f7('0x38')][_0x50f7('0x39')]?_0x4cd88b['attributes']:_0x1d3637[_0x50f7('0x33')];if(_0x31ee2d[_0x50f7('0x36')]['includeAll']){_0x4cd88b[_0x50f7('0x46')]=[{'all':!![]}];}_0x4cd88b=_[_0x50f7('0x41')]({},_0x4cd88b,_0x31ee2d[_0x50f7('0x44')]);return db[_0x50f7('0x31')][_0x50f7('0x4b')](_0x4cd88b)[_0x50f7('0x17')](handleEntityNotFound(_0x562c84,null))[_0x50f7('0x17')](respondWithResult(_0x562c84,null))[_0x50f7('0x22')](handleError(_0x562c84,null));};exports['update']=function(_0x3bef5b,_0x53f49f){if(_0x3bef5b[_0x50f7('0x4c')]['id']){delete _0x3bef5b[_0x50f7('0x4c')]['id'];}return db[_0x50f7('0x31')]['find']({'where':{'id':_0x3bef5b[_0x50f7('0x4a')]['id']}})[_0x50f7('0x17')](handleEntityNotFound(_0x53f49f,null))[_0x50f7('0x17')](saveUpdates(_0x3bef5b[_0x50f7('0x4c')],null))[_0x50f7('0x17')](respondWithResult(_0x53f49f,null))[_0x50f7('0x22')](handleError(_0x53f49f,null));};exports[_0x50f7('0x2c')]=function(_0x4e7f57,_0x28bc05){return db['MailMessage']['find']({'where':{'id':_0x4e7f57[_0x50f7('0x4a')]['id']}})[_0x50f7('0x17')](handleEntityNotFound(_0x28bc05,null))[_0x50f7('0x17')](removeEntity(_0x28bc05,null))[_0x50f7('0x22')](handleError(_0x28bc05,null));};exports['describe']=function(_0x393b72,_0x53b86b){return db[_0x50f7('0x31')][_0x50f7('0x4d')]()[_0x50f7('0x17')](respondWithResult(_0x53b86b,null))[_0x50f7('0x22')](handleError(_0x53b86b,null));};exports[_0x50f7('0x4e')]=function(_0x1f67af,_0xf21b4){return db[_0x50f7('0x31')][_0x50f7('0x4e')](_0x1f67af['body'])['then'](function(_0x7dda2f){if(_0x7dda2f){if(_0x7dda2f['direction']===_0x50f7('0x4f')&&!_0x7dda2f['secret']){var _0x4abd0f,_0x4b78a5,_0x32dab5;if(_0x1f67af[_0x50f7('0x4c')]['to']){_0x4b78a5=_0x1f67af[_0x50f7('0x4c')]['to'][_0x50f7('0x50')](',')[0x0];}return db['MailAccount'][_0x50f7('0x51')]({'where':{'id':_0x7dda2f[_0x50f7('0x52')]},'include':[{'model':db[_0x50f7('0x53')],'as':_0x50f7('0x54'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x4b78a5},'limit':0x1,'order':[[_0x50f7('0x55'),_0x50f7('0x56')]]}]},{'model':db[_0x50f7('0x57')],'as':_0x50f7('0x58'),'raw':!![]}]})['then'](function(_0x40af4f){_0x4abd0f=_0x40af4f;if(_0x4abd0f&&_0x4abd0f['Smtp']){var _0x36dd10={'tls':{'rejectUnauthorized':![]}};if(_[_0x50f7('0x59')](_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x5a')])){_0x36dd10['host']=_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x5b')];_0x36dd10[_0x50f7('0x5c')]=_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x5c')];_0x36dd10[_0x50f7('0x5d')]=_0x4abd0f['Smtp']['secure'];if(_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x5e')]){_0x36dd10[_0x50f7('0x5f')]={'user':_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x60')],'pass':_0x4abd0f[_0x50f7('0x58')]['pass']};}}else{_0x36dd10[_0x50f7('0x5a')]=_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x5a')];_0x36dd10[_0x50f7('0x5f')]={'user':_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x60')],'pass':_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x61')]};_0x36dd10[_0x50f7('0x5d')]=_0x4abd0f[_0x50f7('0x58')][_0x50f7('0x5d')];}if(_0x1f67af['body'][_0x50f7('0x62')]&&_0x1f67af[_0x50f7('0x4c')][_0x50f7('0x62')][_0x50f7('0x39')]){for(var _0x413c3b=0x0;_0x413c3b<_0x1f67af['body']['attachments'][_0x50f7('0x39')];_0x413c3b+=0x1){_0x1f67af[_0x50f7('0x4c')]['attachments'][_0x413c3b]={'filename':_0x1f67af[_0x50f7('0x4c')][_0x50f7('0x62')][_0x413c3b]['name'],'path':path[_0x50f7('0x63')](config['root'],'server/files/attachments',_0x1f67af[_0x50f7('0x4c')][_0x50f7('0x62')][_0x413c3b][_0x50f7('0x64')])};}}_0x32dab5={'account':_0x36dd10,'message':_0x1f67af[_0x50f7('0x4c')]};return;}})[_0x50f7('0x17')](function(){if(_0x4abd0f[_0x50f7('0x54')]){if(_0x4abd0f[_0x50f7('0x54')][_0x50f7('0x65')][_0x50f7('0x39')]){return _0x4abd0f[_0x50f7('0x54')][_0x50f7('0x65')][0x0];}else{return db[_0x50f7('0x66')][_0x50f7('0x4e')](_[_0x50f7('0x67')](_0x1f67af[_0x50f7('0x4c')],{'firstName':_0x1f67af[_0x50f7('0x4c')]['to'],'email':_0x1f67af[_0x50f7('0x4c')]['to'],'phone':_0x1f67af[_0x50f7('0x4c')]['to'],'ListId':_0x4abd0f[_0x50f7('0x68')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x50f7('0x17')](function(){if(_0x32dab5){return respondWithRpcPromise('SendMail',_0x50f7('0x69'),_0x32dab5,client9003)[_0x50f7('0x17')](function(_0x6ddf73){return _0x7dda2f[_0x50f7('0x2b')]({'read':!![],'messageId':_0x6ddf73[_0x50f7('0x6a')],'sentAt':moment()['format'](_0x50f7('0x6b'))});})['catch'](function(_0x4a0ad2){logger['error']('%s',JSON['stringify'](_0x4a0ad2));return _0x7dda2f;});}return _0x7dda2f;});}return _0x7dda2f;}})['then'](respondWithResult(_0xf21b4,0xc9))[_0x50f7('0x22')](handleError(_0xf21b4,null));};exports[_0x50f7('0x6c')]=function(_0x10b50f,_0xef44e7){var _0x3c4309={'agent':{},'channel':_0x50f7('0x6d')};if(_0x10b50f[_0x50f7('0x4c')]['id']){delete _0x10b50f[_0x50f7('0x4c')]['id'];}_0x10b50f[_0x50f7('0x4c')]['read']=!![];_0x10b50f[_0x50f7('0x4c')]['readAt']=moment()[_0x50f7('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');_0x10b50f[_0x50f7('0x4c')]['UserId']=_0x10b50f[_0x50f7('0x4c')][_0x50f7('0x6f')]||_0x10b50f[_0x50f7('0x60')]['id'];_0x3c4309[_0x50f7('0x70')]['id']=_0x10b50f['body'][_0x50f7('0x6f')];return db['MailMessage'][_0x50f7('0x4b')]({'where':{'id':_0x10b50f[_0x50f7('0x4a')]['id'],'UserId':null}})[_0x50f7('0x17')](handleEntityNotFound(_0xef44e7,null))[_0x50f7('0x17')](saveUpdates(_0x10b50f['body'],null))['then'](function(_0x1f0c76){if(_0x1f0c76){_0x3c4309['message']=_0x1f0c76[_0x50f7('0x71')]({'plain':!![]});return db[_0x50f7('0x72')][_0x50f7('0x4b')]({'where':{'id':_0x1f0c76[_0x50f7('0x73')]}});}return null;})['then'](handleEntityNotFound(_0xef44e7,null))['then'](function(_0x52648a){if(_0x52648a){return _0x52648a['update']({'UserId':_0x10b50f[_0x50f7('0x4c')][_0x50f7('0x6f')],'read1stAt':_[_0x50f7('0x59')](_0x52648a[_0x50f7('0x74')])?moment()[_0x50f7('0x6e')](_0x50f7('0x6b')):undefined});}return null;})[_0x50f7('0x17')](function(_0x540ef3){if(_0x540ef3){_0x3c4309['interaction']=_0x540ef3[_0x50f7('0x71')]({'plain':!![]});interaction_log['info'](_0x50f7('0x75'),_0x10b50f[_0x50f7('0x60')]['id'],_0x10b50f[_0x50f7('0x60')][_0x50f7('0x2f')],_0x10b50f[_0x50f7('0x60')]['role'],_0x3c4309[_0x50f7('0x76')]['id'],_0x10b50f[_0x50f7('0x4c')]?JSON['stringify'](_0x10b50f[_0x50f7('0x4c')]):_0x50f7('0x77'));return respondWithRpcPromise('AcceptMessage',_0x50f7('0x78'),_0x3c4309);}return null;})[_0x50f7('0x17')](function(_0x562abc){var _0x410431=_0x50f7('0x79')+_0x562abc[_0x50f7('0x20')][_0x50f7('0x7a')];return db['sequelize'][_0x50f7('0x36')](_0x410431,{'type':db[_0x50f7('0x7b')][_0x50f7('0x7c')][_0x50f7('0x7d')],'raw':!![]})['then'](function(_0x47132b){return _0x47132b;});})[_0x50f7('0x17')](function(_0x3cf057){if(_0x3cf057){_0x3c4309['message']['contact']=_0x3cf057[0x0];if(!_0x10b50f[_0x50f7('0x4c')][_0x50f7('0x6f')])return;return db[_0x50f7('0x7e')][_0x50f7('0x4b')]({'where':{'id':_0x10b50f['body']['UserId'],'role':_0x50f7('0x70')},'attributes':['id',_0x50f7('0x2f'),_0x50f7('0x7f'),_0x50f7('0x80'),_0x50f7('0x81')],'raw':!![]});}return null;})[_0x50f7('0x17')](function(_0x50956c){if(!_0x50956c)return null;_0x3c4309[_0x50f7('0x20')][_0x50f7('0x70')]=_0x50956c;return _0x3c4309;})[_0x50f7('0x17')](function(_0x3efe2c){if(_0x3efe2c){if(_0x10b50f[_0x50f7('0x4c')][_0x50f7('0x82')]){_0x3c4309[_0x50f7('0x20')][_0x50f7('0x83')]=util[_0x50f7('0x6e')](_0x50f7('0x84'),_0x10b50f['user'][_0x50f7('0x2f')]);_0x3c4309[_0x50f7('0x20')][_0x50f7('0x85')]=_0x3c4309[_0x50f7('0x85')];_0x3c4309[_0x50f7('0x20')][_0x50f7('0x86')]=_0x3c4309['channel'];_0x3c4309[_0x50f7('0x20')]['event']=_0x50f7('0x6c');_0x3c4309[_0x50f7('0x20')]['body']=htmlToText[_0x50f7('0x87')](_0x3c4309[_0x50f7('0x20')][_0x50f7('0x4c')]);return respondWithRpcPromise(_0x50f7('0x88'),_0x50f7('0x88'),{'event':'acceptmessage','message':_0x3c4309['message']},client9002)[_0x50f7('0x17')](function(){return _0x3c4309;});}return _0x3c4309;}return null;})[_0x50f7('0x17')](respondWithResult(_0xef44e7,null))[_0x50f7('0x22')](handleError(_0xef44e7,null));};exports[_0x50f7('0x89')]=function(_0xe3f72c,_0x5dac87){var _0x3695d2={'agent':{},'channel':_0x50f7('0x6d')};if(_0xe3f72c[_0x50f7('0x4c')]['id']){delete _0xe3f72c[_0x50f7('0x4c')]['id'];}_0xe3f72c[_0x50f7('0x4c')][_0x50f7('0x6f')]=_0xe3f72c['body'][_0x50f7('0x6f')]||_0xe3f72c[_0x50f7('0x60')]['id'];_0x3695d2[_0x50f7('0x70')]['id']=_0xe3f72c[_0x50f7('0x4c')][_0x50f7('0x6f')];return db[_0x50f7('0x31')]['find']({'where':{'id':_0xe3f72c[_0x50f7('0x4a')]['id'],'UserId':null}})[_0x50f7('0x17')](handleEntityNotFound(_0x5dac87,null))[_0x50f7('0x17')](function(_0x1aae74){if(_0x1aae74){_0x3695d2['message']=_0x1aae74[_0x50f7('0x71')]({'plain':!![]});return db[_0x50f7('0x72')][_0x50f7('0x4b')]({'where':{'id':_0x1aae74[_0x50f7('0x73')]}});}return null;})[_0x50f7('0x17')](handleEntityNotFound(_0x5dac87,null))[_0x50f7('0x17')](function(_0x2e9189){if(_0x2e9189){_0x3695d2[_0x50f7('0x76')]=_0x2e9189[_0x50f7('0x71')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe3f72c[_0x50f7('0x60')]['id'],_0xe3f72c['user'][_0x50f7('0x2f')],_0xe3f72c['user'][_0x50f7('0x8a')],_0x3695d2['interaction']['id'],_0xe3f72c['body']?JSON['stringify'](_0xe3f72c[_0x50f7('0x4c')]):_0x50f7('0x77'));return respondWithRpcPromise(_0x50f7('0x8b'),_0x50f7('0x8c'),_0x3695d2);}return null;})['then'](function(_0x149893){var _0x526b9b=_0x50f7('0x79')+_0x149893[_0x50f7('0x20')][_0x50f7('0x7a')];return db[_0x50f7('0x8d')][_0x50f7('0x36')](_0x526b9b,{'type':db[_0x50f7('0x7b')][_0x50f7('0x7c')][_0x50f7('0x7d')],'raw':!![]})['then'](function(_0x333c74){return _0x333c74;});})[_0x50f7('0x17')](function(_0x246169){if(_0x246169){_0x3695d2[_0x50f7('0x20')][_0x50f7('0x8e')]=_0x246169[0x0];if(!_0xe3f72c['body']['UserId'])return;return db[_0x50f7('0x7e')][_0x50f7('0x4b')]({'where':{'id':_0xe3f72c[_0x50f7('0x4c')]['UserId'],'role':_0x50f7('0x70')},'attributes':['id',_0x50f7('0x2f'),_0x50f7('0x7f'),_0x50f7('0x80'),_0x50f7('0x81')],'raw':!![]});}return null;})[_0x50f7('0x17')](function(_0x594013){if(!_0x594013)return null;_0x3695d2[_0x50f7('0x20')][_0x50f7('0x70')]=_0x594013;return _0x3695d2;})[_0x50f7('0x17')](function(_0xdb8e31){if(_0xdb8e31){_0xdb8e31[_0x50f7('0x20')][_0x50f7('0x83')]=util[_0x50f7('0x6e')](_0x50f7('0x84'),_0xe3f72c[_0x50f7('0x60')][_0x50f7('0x2f')]);_0xdb8e31[_0x50f7('0x20')][_0x50f7('0x85')]=_0x3695d2[_0x50f7('0x85')];_0xdb8e31[_0x50f7('0x20')][_0x50f7('0x86')]=_0x3695d2[_0x50f7('0x85')];_0xdb8e31['message'][_0x50f7('0x8f')]=_0x50f7('0x89');_0xdb8e31['message'][_0x50f7('0x4c')]=htmlToText[_0x50f7('0x87')](_0x3695d2[_0x50f7('0x20')]['body']);respondWithRpcPromise('EventManager',_0x50f7('0x88'),{'event':_0x50f7('0x90'),'message':_0xdb8e31[_0x50f7('0x20')]},client9002);return _0x3695d2;}return null;})[_0x50f7('0x17')](respondWithResult(_0x5dac87,null))[_0x50f7('0x22')](handleError(_0x5dac87,null));};exports[_0x50f7('0x91')]=function(_0x516c84,_0x5456a0){var _0xcd09c5=moment()['unix']()[_0x50f7('0x92')]();var _0x5d22b4=path[_0x50f7('0x63')](config[_0x50f7('0x93')],_0x50f7('0x94'),_0x50f7('0x95'),_0x50f7('0x96'));var _0x3bc68a=path['join'](config[_0x50f7('0x93')],_0x50f7('0x94'),'files',_0x50f7('0x62'));var _0x4c9759=util['format'](_0x50f7('0x97'),_0xcd09c5);return db['MailMessage'][_0x50f7('0x4b')]({'where':{'id':_0x516c84[_0x50f7('0x4a')]['id']},'attributes':['id',_0x50f7('0x4c'),_0x50f7('0x98'),'to','cc',_0x50f7('0x99'),_0x50f7('0x9a'),_0x50f7('0x9b')],'include':_0x516c84['query'][_0x50f7('0x62')]?[{'model':db[_0x50f7('0x9c')],'as':_0x50f7('0x9d')}]:undefined})['then'](handleEntityNotFound(_0x5456a0,null))[_0x50f7('0x17')](function(_0x524b0a){if(_0x524b0a){var _0x411091=_0x524b0a;var _0x1ba872={'from':_0x411091[_0x50f7('0x98')],'to':_0x411091['to'],'subject':_0x411091[_0x50f7('0x9a')],'html':htmlEntities[_0x50f7('0x9e')](_0x411091['body']),'headers':{'Date':moment(_0x411091[_0x50f7('0x9b')])[_0x50f7('0x6e')](_0x50f7('0x9f'))},'attachments':[]};if(_0x524b0a['cc']){_0x1ba872[_0x50f7('0xa0')]['Cc']=_0x524b0a['cc'];}if(_0x524b0a[_0x50f7('0x99')]){_0x1ba872[_0x50f7('0xa0')][_0x50f7('0xa1')]=_0x524b0a[_0x50f7('0x99')];}return new BPromise(function(_0x41c318,_0x4ed51f){if(_0x524b0a['Attachments']){for(var _0xd2fa86=0x0;_0xd2fa86<_0x524b0a['Attachments']['length'];_0xd2fa86++){var _0x133688=_0x524b0a[_0x50f7('0x9d')][_0xd2fa86];var _0x4fbaff=path[_0x50f7('0x63')](_0x3bc68a,_0x133688['basename']);if(fs['existsSync'](_0x4fbaff)){_0x1ba872[_0x50f7('0x62')][_0x50f7('0xa2')]({'name':_0x133688[_0x50f7('0x2f')],'contentType':_0x133688[_0x50f7('0x42')],'data':fs[_0x50f7('0xa3')](_0x4fbaff)});}}}emlformat[_0x50f7('0xa4')](_0x1ba872,function(_0x19ef54,_0xe62505){if(_0x19ef54)return _0x4ed51f(_0x19ef54);fs['writeFileSync'](path['join'](_0x5d22b4,_0x4c9759),_0xe62505);return _0x41c318(_0xe62505);});});}})[_0x50f7('0x17')](function(_0x3fa026){if(_0x3fa026){return _0x5456a0[_0x50f7('0x91')](path[_0x50f7('0x63')](_0x5d22b4,_0x4c9759),_0x4c9759,function(_0x2dd351){if(!_0x2dd351)fs[_0x50f7('0xa5')](path[_0x50f7('0x63')](_0x5d22b4,_0x4c9759));});}})[_0x50f7('0x22')](handleError(_0x5456a0,null));};
\ No newline at end of file
index 93ec801..2704f67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc351=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x17b0d4,_0x377add){var _0x2d02c7=function(_0x56e627){while(--_0x56e627){_0x17b0d4['push'](_0x17b0d4['shift']());}};_0x2d02c7(++_0x377add);}(_0xc351,0x102));var _0x1c35=function(_0x61909f,_0x1afdea){_0x61909f=_0x61909f-0x0;var _0x4ad05e=_0xc351[_0x61909f];return _0x4ad05e;};'use strict';var EventEmitter=require(_0x1c35('0x0'));var MailMessage=require(_0x1c35('0x1'))['db'][_0x1c35('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1c35('0x3')](0x0);var events={'afterCreate':_0x1c35('0x4'),'afterUpdate':_0x1c35('0x5'),'afterDestroy':_0x1c35('0x6')};function emitEvent(_0x121947){return function(_0x2d053a,_0x13e17d,_0x57dfd1){MailMessageEvents['emit'](_0x121947+':'+_0x2d053a['id'],_0x2d053a);MailMessageEvents[_0x1c35('0x7')](_0x121947,_0x2d053a);_0x57dfd1(null);};}for(var e in events){if(events[_0x1c35('0x8')](e)){var event=events[e];MailMessage[_0x1c35('0x9')](e,emitEvent(event));}}module[_0x1c35('0xa')]=MailMessageEvents;
\ No newline at end of file
+var _0x8939=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','update'];(function(_0x239cbe,_0x45cea0){var _0x1695a7=function(_0x2c0726){while(--_0x2c0726){_0x239cbe['push'](_0x239cbe['shift']());}};_0x1695a7(++_0x45cea0);}(_0x8939,0x1a3));var _0x9893=function(_0x597817,_0x2e9fdf){_0x597817=_0x597817-0x0;var _0x3bac6e=_0x8939[_0x597817];return _0x3bac6e;};'use strict';var EventEmitter=require(_0x9893('0x0'));var MailMessage=require(_0x9893('0x1'))['db'][_0x9893('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9893('0x3'),'afterDestroy':_0x9893('0x4')};function emitEvent(_0x3a62d6){return function(_0x3dc438,_0x1670dc,_0x57d1fa){MailMessageEvents[_0x9893('0x5')](_0x3a62d6+':'+_0x3dc438['id'],_0x3dc438);MailMessageEvents['emit'](_0x3a62d6,_0x3dc438);_0x57d1fa(null);};}for(var e in events){if(events[_0x9893('0x6')](e)){var event=events[e];MailMessage[_0x9893('0x7')](e,emitEvent(event));}}module[_0x9893('0x8')]=MailMessageEvents;
\ No newline at end of file
index c6d1cf3..9401238 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0824=['rimraf','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','html-to-text'];(function(_0x234971,_0x4327a1){var _0x2b72f6=function(_0x4b3bd9){while(--_0x4b3bd9){_0x234971['push'](_0x234971['shift']());}};_0x2b72f6(++_0x4327a1);}(_0x0824,0x13a));var _0x4082=function(_0x5635a5,_0x2a19c3){_0x5635a5=_0x5635a5-0x0;var _0x216de1=_0x0824[_0x5635a5];return _0x216de1;};'use strict';var _=require('lodash');var util=require(_0x4082('0x0'));var logger=require('../../config/logger')(_0x4082('0x1'));var moment=require(_0x4082('0x2'));var BPromise=require('bluebird');var rp=require(_0x4082('0x3'));var htmlToText=require(_0x4082('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4082('0x5'));var config=require(_0x4082('0x6'));var attributes=require(_0x4082('0x7'));module['exports']=function(_0x3b0aa2,_0x48083d){return _0x3b0aa2[_0x4082('0x8')]('MailMessage',attributes,{'tableName':_0x4082('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4082('0xa')]},{'name':_0x4082('0xb'),'fields':[_0x4082('0xc'),_0x4082('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40470c,_0x3b9e61,_0x3d8c90){if(_0x40470c[_0x4082('0xe')]){_0x40470c[_0x4082('0xc')]=htmlToText[_0x4082('0xf')](_0x40470c[_0x4082('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d8c90(null,_0x3b9e61);},'afterCreate':function(_0xadc79a,_0x414798,_0xe6ba85){var _0x2d9eb2=_0x3b0aa2['models'];var _0x3519cf=_0xadc79a[_0x4082('0x10')]({'plain':!![]});if(_0x3519cf[_0x4082('0x11')][_0x4082('0x12')]()==='in'||_0x3519cf['direction'][_0x4082('0x12')]()===_0x4082('0x13')&&!_0x3519cf[_0x4082('0x14')]&&!_[_0x4082('0x15')](_0x3519cf['UserId'])){_0x2d9eb2[_0x4082('0x16')][_0x4082('0x17')]({'where':{'id':_0x3519cf[_0x4082('0x18')]}})['then'](function(_0x2ea64e){if(_0x2ea64e){_0x2ea64e['update']({'lastMsgAt':_0x3519cf[_0x4082('0x19')],'lastMsgDirection':_0x3519cf[_0x4082('0x11')][_0x4082('0x12')]()});}})['catch'](function(_0x1719df){console[_0x4082('0x1a')](_0x1719df);});}_0xe6ba85();}},'charset':_0x4082('0x1b'),'collate':_0x4082('0x1c')});};
\ No newline at end of file
+var _0xd51c=['isNil','UserId','MailInteraction','then','createdAt','direction','error','lodash','util','../../config/logger','api','moment','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','toLowerCase','out','secret'];(function(_0x2f6d98,_0x235365){var _0x2d7cc9=function(_0x4dced7){while(--_0x4dced7){_0x2f6d98['push'](_0x2f6d98['shift']());}};_0x2d7cc9(++_0x235365);}(_0xd51c,0x9d));var _0xcd51=function(_0xf9f239,_0x30c0df){_0xf9f239=_0xf9f239-0x0;var _0x536d3d=_0xd51c[_0xf9f239];return _0x536d3d;};'use strict';var _=require(_0xcd51('0x0'));var util=require(_0xcd51('0x1'));var logger=require(_0xcd51('0x2'))(_0xcd51('0x3'));var moment=require(_0xcd51('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0xcd51('0x5'));var fs=require('fs');var path=require(_0xcd51('0x6'));var rimraf=require(_0xcd51('0x7'));var config=require('../../config/environment');var attributes=require(_0xcd51('0x8'));module[_0xcd51('0x9')]=function(_0x490097,_0x5e0a9c){return _0x490097[_0xcd51('0xa')](_0xcd51('0xb'),attributes,{'tableName':_0xcd51('0xc'),'paranoid':![],'indexes':[{'name':_0xcd51('0xd'),'fields':[_0xcd51('0xd')]},{'name':_0xcd51('0xe'),'fields':[_0xcd51('0xf'),_0xcd51('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6a39c7,_0x55edc7,_0x3d39b0){if(_0x6a39c7[_0xcd51('0x11')]){_0x6a39c7['plainBody']=htmlToText['fromString'](_0x6a39c7[_0xcd51('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d39b0(null,_0x55edc7);},'afterCreate':function(_0x217243,_0x1aaf9d,_0x30fa26){var _0x3df310=_0x490097[_0xcd51('0x12')];var _0x54b90c=_0x217243[_0xcd51('0x13')]({'plain':!![]});if(_0x54b90c['direction'][_0xcd51('0x14')]()==='in'||_0x54b90c['direction'][_0xcd51('0x14')]()===_0xcd51('0x15')&&!_0x54b90c[_0xcd51('0x16')]&&!_[_0xcd51('0x17')](_0x54b90c[_0xcd51('0x18')])){_0x3df310[_0xcd51('0x19')]['findOne']({'where':{'id':_0x54b90c['MailInteractionId']}})[_0xcd51('0x1a')](function(_0x3cab93){if(_0x3cab93){_0x3cab93['update']({'lastMsgAt':_0x54b90c[_0xcd51('0x1b')],'lastMsgDirection':_0x54b90c[_0xcd51('0x1c')]['toLowerCase']()});}})['catch'](function(_0x10a8cb){console[_0xcd51('0x1d')](_0x10a8cb);});}_0x30fa26();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index a149346..e08d6db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb4=['result','catch','CreateMailMessage','MailMessage','create','body','options','raw','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6cb4,0xff));var _0x46cb=function(_0x565d70,_0x307f5f){_0x565d70=_0x565d70-0x0;var _0x532576=_0x6cb4[_0x565d70];return _0x532576;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});config[_0x46cb('0xb')]=_[_0x46cb('0xc')](config[_0x46cb('0xb')],{'host':_0x46cb('0xd'),'port':0x18eb});var socket=require(_0x46cb('0xe'))(new Redis(config[_0x46cb('0xb')]));require('./mailMessage.socket')[_0x46cb('0xf')](socket);function respondWithRpcPromise(_0x34f9e9,_0x48101c,_0x206f10){return new BPromise(function(_0x106a87,_0x4a60b2){return client[_0x46cb('0x10')](_0x34f9e9,_0x206f10)[_0x46cb('0x11')](function(_0x570cfd){logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,_0x46cb('0x12'));logger[_0x46cb('0x13')](_0x46cb('0x14'),_0x48101c,_0x46cb('0x12'),JSON['stringify'](_0x570cfd));if(_0x570cfd[_0x46cb('0x15')]){if(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x16')]===0x1f4){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);return _0x4a60b2(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);}logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd['error'][_0x46cb('0x18')]);return _0x106a87(_0x570cfd['error'][_0x46cb('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,'request\x20sent');_0x106a87(_0x570cfd[_0x46cb('0x19')][_0x46cb('0x18')]);}})[_0x46cb('0x1a')](function(_0xcc8e2){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0xcc8e2);_0x4a60b2(_0xcc8e2);});});}exports[_0x46cb('0x1b')]=function(_0x32e9fe){var _0x90cd50=this;return new Promise(function(_0xfc9064,_0x149483){return db[_0x46cb('0x1c')][_0x46cb('0x1d')](_0x32e9fe[_0x46cb('0x1e')],{'raw':_0x32e9fe[_0x46cb('0x1f')]?_0x32e9fe[_0x46cb('0x1f')][_0x46cb('0x20')]===undefined?!![]:![]:!![]})[_0x46cb('0x11')](function(_0x41ecd2){logger[_0x46cb('0x21')](_0x46cb('0x1b'),_0x32e9fe);logger[_0x46cb('0x13')](_0x46cb('0x1b'),_0x32e9fe,JSON[_0x46cb('0x22')](_0x41ecd2));_0xfc9064(_0x41ecd2);})[_0x46cb('0x1a')](function(_0x5a1338){logger['error'](_0x46cb('0x1b'),_0x5a1338[_0x46cb('0x18')],_0x32e9fe);_0x149483(_0x90cd50[_0x46cb('0x15')](0x1f4,_0x5a1338[_0x46cb('0x18')]));});});};
\ No newline at end of file
+var _0x351d=['rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x19026d,_0x368886){var _0x26048b=function(_0x2c3115){while(--_0x2c3115){_0x19026d['push'](_0x19026d['shift']());}};_0x26048b(++_0x368886);}(_0x351d,0x90));var _0xd351=function(_0xc7339e,_0x5190c0){_0xc7339e=_0xc7339e-0x0;var _0x43814b=_0x351d[_0xc7339e];return _0x43814b;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});config['redis']=_[_0xd351('0xa')](config[_0xd351('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd351('0xc'))(new Redis(config[_0xd351('0xb')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x44bf81,_0x4904b4,_0x34cfc7){return new BPromise(function(_0x39b8c8,_0x5949a4){return client[_0xd351('0xd')](_0x44bf81,_0x34cfc7)[_0xd351('0xe')](function(_0x4ebca1){logger[_0xd351('0xf')]('MailMessage,\x20%s,\x20%s',_0x4904b4,'request\x20sent');logger[_0xd351('0x10')](_0xd351('0x11'),_0x4904b4,_0xd351('0x12'),JSON[_0xd351('0x13')](_0x4ebca1));if(_0x4ebca1['error']){if(_0x4ebca1[_0xd351('0x14')][_0xd351('0x15')]===0x1f4){logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);return _0x5949a4(_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);}logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1['error']['message']);return _0x39b8c8(_0x4ebca1[_0xd351('0x14')]['message']);}else{logger[_0xd351('0xf')](_0xd351('0x16'),_0x4904b4,_0xd351('0x12'));_0x39b8c8(_0x4ebca1['result'][_0xd351('0x17')]);}})[_0xd351('0x18')](function(_0x77985a){logger[_0xd351('0x14')]('MailMessage,\x20%s,\x20%s',_0x4904b4,_0x77985a);_0x5949a4(_0x77985a);});});}exports[_0xd351('0x19')]=function(_0x4abbed){var _0x48fa9b=this;return new Promise(function(_0x37d3ac,_0x4a427b){return db[_0xd351('0x1a')][_0xd351('0x1b')](_0x4abbed[_0xd351('0x1c')],{'raw':_0x4abbed[_0xd351('0x1d')]?_0x4abbed[_0xd351('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xd351('0xe')](function(_0xbbc58){logger[_0xd351('0xf')]('CreateMailMessage',_0x4abbed);logger[_0xd351('0x10')](_0xd351('0x19'),_0x4abbed,JSON[_0xd351('0x13')](_0xbbc58));_0x37d3ac(_0xbbc58);})['catch'](function(_0x1ce279){logger[_0xd351('0x14')](_0xd351('0x19'),_0x1ce279[_0xd351('0x17')],_0x4abbed);_0x4a427b(_0x48fa9b['error'](0x1f4,_0x1ce279[_0xd351('0x17')]));});});};
\ No newline at end of file
index eafdf9f..5577013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38a5=['length','./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x3cad1a,_0x4a92c5){var _0x4b768d=function(_0x2b9e6f){while(--_0x2b9e6f){_0x3cad1a['push'](_0x3cad1a['shift']());}};_0x4b768d(++_0x4a92c5);}(_0x38a5,0x69));var _0x538a=function(_0x43af7c,_0x72c731){_0x43af7c=_0x43af7c-0x0;var _0x30331e=_0x38a5[_0x43af7c];return _0x30331e;};'use strict';var MailMessageEvents=require(_0x538a('0x0'));var events=[_0x538a('0x1'),_0x538a('0x2'),_0x538a('0x3')];function createListener(_0x4d5f33,_0x50b5e2){return function(_0x2c3a52){_0x50b5e2[_0x538a('0x4')](_0x4d5f33,_0x2c3a52);};}function removeListener(_0x31a6bd,_0x22163a){return function(){MailMessageEvents[_0x538a('0x5')](_0x31a6bd,_0x22163a);};}exports[_0x538a('0x6')]=function(_0x16ab09){for(var _0x1e3587=0x0,_0x3fcf5b=events[_0x538a('0x7')];_0x1e3587<_0x3fcf5b;_0x1e3587++){var _0x3d4e22=events[_0x1e3587];var _0x6eed8e=createListener('mailMessage:'+_0x3d4e22,_0x16ab09);MailMessageEvents['on'](_0x3d4e22,_0x6eed8e);}};
\ No newline at end of file
+var _0xb03a=['./mailMessage.events','save','remove','update','removeListener','register','length','mailMessage:'];(function(_0x5baf40,_0x76eec1){var _0x512e6d=function(_0x27ee98){while(--_0x27ee98){_0x5baf40['push'](_0x5baf40['shift']());}};_0x512e6d(++_0x76eec1);}(_0xb03a,0x1d0));var _0xab03=function(_0x52aa3a,_0xfc1e40){_0x52aa3a=_0x52aa3a-0x0;var _0x560604=_0xb03a[_0x52aa3a];return _0x560604;};'use strict';var MailMessageEvents=require(_0xab03('0x0'));var events=[_0xab03('0x1'),_0xab03('0x2'),_0xab03('0x3')];function createListener(_0x2abe79,_0x455f68){return function(_0x2230fe){_0x455f68['emit'](_0x2abe79,_0x2230fe);};}function removeListener(_0x7c20de,_0x50d648){return function(){MailMessageEvents[_0xab03('0x4')](_0x7c20de,_0x50d648);};}exports[_0xab03('0x5')]=function(_0x85be97){for(var _0x3d7a98=0x0,_0x39506b=events[_0xab03('0x6')];_0x3d7a98<_0x39506b;_0x3d7a98++){var _0x5e9bae=events[_0x3d7a98];var _0x29df9b=createListener(_0xab03('0x7')+_0x5e9bae,_0x85be97);MailMessageEvents['on'](_0x5e9bae,_0x29df9b);}};
\ No newline at end of file
index 8b7785e..e38b2f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb66=['put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','addTeams','post','/:id/users'];(function(_0x4da360,_0x311a79){var _0xcc485=function(_0x571fa5){while(--_0x571fa5){_0x4da360['push'](_0x4da360['shift']());}};_0xcc485(++_0x311a79);}(_0xeb66,0x166));var _0x6eb6=function(_0x23ee9a,_0x57a843){_0x23ee9a=_0x23ee9a-0x0;var _0x204b39=_0xeb66[_0x23ee9a];return _0x204b39;};'use strict';var multer=require(_0x6eb6('0x0'));var util=require('util');var path=require(_0x6eb6('0x1'));var timeout=require(_0x6eb6('0x2'));var express=require(_0x6eb6('0x3'));var router=express[_0x6eb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6eb6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6eb6('0x6'));router[_0x6eb6('0x7')]('/',auth[_0x6eb6('0x8')](),controller[_0x6eb6('0x9')]);router[_0x6eb6('0x7')]('/describe',auth[_0x6eb6('0x8')](),controller[_0x6eb6('0xa')]);router[_0x6eb6('0x7')](_0x6eb6('0xb'),auth['isAuthenticated'](),controller[_0x6eb6('0xc')]);router[_0x6eb6('0x7')](_0x6eb6('0xd'),auth['isAuthenticated'](),controller[_0x6eb6('0xe')]);router[_0x6eb6('0x7')](_0x6eb6('0xf'),auth[_0x6eb6('0x8')](),controller[_0x6eb6('0x10')]);router[_0x6eb6('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x6eb6('0x8')](),controller['create']);router['post'](_0x6eb6('0xf'),auth[_0x6eb6('0x8')](),controller[_0x6eb6('0x11')]);router[_0x6eb6('0x12')](_0x6eb6('0x13'),auth[_0x6eb6('0x8')](),controller['addAgents']);router[_0x6eb6('0x14')]('/:id',auth[_0x6eb6('0x8')](),controller[_0x6eb6('0x15')]);router[_0x6eb6('0x16')]('/:id',auth[_0x6eb6('0x8')](),controller[_0x6eb6('0x17')]);router[_0x6eb6('0x16')](_0x6eb6('0xf'),auth['isAuthenticated'](),controller[_0x6eb6('0x18')]);router[_0x6eb6('0x16')](_0x6eb6('0x13'),auth[_0x6eb6('0x8')](),controller[_0x6eb6('0x19')]);module[_0x6eb6('0x1a')]=router;
\ No newline at end of file
+var _0x9b45=['isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','put','delete','/:id/teams','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get'];(function(_0x37bcd8,_0x27bed9){var _0x422480=function(_0x510db3){while(--_0x510db3){_0x37bcd8['push'](_0x37bcd8['shift']());}};_0x422480(++_0x27bed9);}(_0x9b45,0xfa));var _0x59b4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9b45[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x59b4('0x0'));var util=require(_0x59b4('0x1'));var path=require(_0x59b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x59b4('0x3'));var router=express[_0x59b4('0x4')]();var fs_extra=require(_0x59b4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x59b4('0x6'));var config=require(_0x59b4('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x59b4('0x8')]);router[_0x59b4('0x9')]('/describe',auth[_0x59b4('0xa')](),controller[_0x59b4('0xb')]);router[_0x59b4('0x9')](_0x59b4('0xc'),auth[_0x59b4('0xa')](),controller[_0x59b4('0xd')]);router[_0x59b4('0x9')](_0x59b4('0xe'),auth['isAuthenticated'](),controller[_0x59b4('0xf')]);router[_0x59b4('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x59b4('0x10')]);router[_0x59b4('0x9')](_0x59b4('0x11'),auth[_0x59b4('0xa')](),controller[_0x59b4('0x12')]);router[_0x59b4('0x13')]('/',auth['isAuthenticated'](),controller[_0x59b4('0x14')]);router[_0x59b4('0x13')]('/:id/teams',auth[_0x59b4('0xa')](),controller['addTeams']);router[_0x59b4('0x13')](_0x59b4('0x11'),auth[_0x59b4('0xa')](),controller['addAgents']);router[_0x59b4('0x15')](_0x59b4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x59b4('0x16')](_0x59b4('0xc'),auth[_0x59b4('0xa')](),controller['destroy']);router[_0x59b4('0x16')](_0x59b4('0x17'),auth[_0x59b4('0xa')](),controller[_0x59b4('0x18')]);router[_0x59b4('0x16')](_0x59b4('0x11'),auth[_0x59b4('0xa')](),controller['removeAgents']);module[_0x59b4('0x19')]=router;
\ No newline at end of file
index e039610..78a7c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8d7=['rrmemory','beepall','sequelize','exports','name','ENUM'];(function(_0x16c95e,_0x31eb55){var _0x303e86=function(_0x315a63){while(--_0x315a63){_0x16c95e['push'](_0x16c95e['shift']());}};_0x303e86(++_0x31eb55);}(_0xe8d7,0x92));var _0x7e8d=function(_0x231b71,_0x53f4b7){_0x231b71=_0x231b71-0x0;var _0x68bd0f=_0xe8d7[_0x231b71];return _0x68bd0f;};'use strict';var Sequelize=require(_0x7e8d('0x0'));module[_0x7e8d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7e8d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7e8d('0x3')](_0x7e8d('0x4'),_0x7e8d('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x4c14=['exports','STRING','INTEGER','rrmemory','beepall','sequelize'];(function(_0x56e901,_0x41ab5a){var _0x58ef6c=function(_0x43cedf){while(--_0x43cedf){_0x56e901['push'](_0x56e901['shift']());}};_0x58ef6c(++_0x41ab5a);}(_0x4c14,0xbf));var _0x44c1=function(_0x584f0d,_0xf1893a){_0x584f0d=_0x584f0d-0x0;var _0x25ad89=_0x4c14[_0x584f0d];return _0x25ad89;};'use strict';var Sequelize=require(_0x44c1('0x0'));module[_0x44c1('0x1')]={'name':{'type':Sequelize[_0x44c1('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x44c1('0x2')]},'timeout':{'type':Sequelize[_0x44c1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x44c1('0x4'),_0x44c1('0x5'),'roundrobin')}};
\ No newline at end of file
index 6d43a2b..75696a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc044=['stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','UserMailQueue','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','rows','%s/%s','SIP','findOne','pick','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','MailQueues','then','end','error'];(function(_0x218c64,_0x294438){var _0x4a2d46=function(_0x41b3e8){while(--_0x41b3e8){_0x218c64['push'](_0x218c64['shift']());}};_0x4a2d46(++_0x294438);}(_0xc044,0x172));var _0x4c04=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc044[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x4c04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c04('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c04('0x2'));var moment=require(_0x4c04('0x3'));var BPromise=require(_0x4c04('0x4'));var Mustache=require(_0x4c04('0x5'));var util=require('util');var path=require(_0x4c04('0x6'));var sox=require('sox');var csv=require(_0x4c04('0x7'));var ejs=require(_0x4c04('0x8'));var fs=require('fs');var fs_extra=require(_0x4c04('0x9'));var _=require(_0x4c04('0xa'));var squel=require('squel');var crypto=require(_0x4c04('0xb'));var jsforce=require(_0x4c04('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4c04('0x7'));var querystring=require(_0x4c04('0xd'));var Papa=require(_0x4c04('0xe'));var Redis=require('ioredis');var authService=require(_0x4c04('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4c04('0x10'));var hardwareService=require(_0x4c04('0x11'));var logger=require(_0x4c04('0x12'))(_0x4c04('0x13'));var utils=require(_0x4c04('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4c04('0x15'));var db=require(_0x4c04('0x16'))['db'];config[_0x4c04('0x17')]=_[_0x4c04('0x18')](config[_0x4c04('0x17')],{'host':_0x4c04('0x19'),'port':0x18eb});var socket=require(_0x4c04('0x1a'))(new Redis(config[_0x4c04('0x17')]));require('./mailQueue.socket')[_0x4c04('0x1b')](socket);function respondWithStatusCode(_0x5c78f0,_0x1d2bb3){_0x1d2bb3=_0x1d2bb3||0xcc;return function(_0x2fe780){if(_0x2fe780){return _0x5c78f0[_0x4c04('0x1c')](_0x1d2bb3);}return _0x5c78f0[_0x4c04('0x1d')](_0x1d2bb3)['end']();};}function respondWithResult(_0x44b4ba,_0xa0dacf){_0xa0dacf=_0xa0dacf||0xc8;return function(_0x34167e){if(_0x34167e){return _0x44b4ba[_0x4c04('0x1d')](_0xa0dacf)['json'](_0x34167e);}};}function respondWithFilteredResult(_0x526947,_0x381120){return function(_0x5878d4){if(_0x5878d4){var _0x34303f=typeof _0x381120[_0x4c04('0x1e')]===_0x4c04('0x1f')&&typeof _0x381120[_0x4c04('0x20')]===_0x4c04('0x1f');var _0x14c11b=_0x5878d4[_0x4c04('0x21')];var _0x416d4f=_0x34303f?0x0:_0x381120['offset'];var _0x56b392=_0x34303f?_0x5878d4[_0x4c04('0x21')]:_0x381120[_0x4c04('0x1e')]+_0x381120[_0x4c04('0x20')];var _0x49a115;if(_0x56b392>=_0x14c11b){_0x56b392=_0x14c11b;_0x49a115=0xc8;}else{_0x49a115=0xce;}_0x526947[_0x4c04('0x1d')](_0x49a115);return _0x526947[_0x4c04('0x22')](_0x4c04('0x23'),_0x416d4f+'-'+_0x56b392+'/'+_0x14c11b)[_0x4c04('0x24')](_0x5878d4);}return null;};}function patchUpdates(_0x3234a8){return function(_0x283aa8){try{jsonpatch[_0x4c04('0x25')](_0x283aa8,_0x3234a8,!![]);}catch(_0x1fead3){return BPromise[_0x4c04('0x26')](_0x1fead3);}return _0x283aa8[_0x4c04('0x27')]();};}function saveUpdates(_0x4f5ea9,_0x2b62b8){return function(_0x13db39){if(_0x13db39){return _0x13db39[_0x4c04('0x28')](_0x4f5ea9)['then'](function(_0x5f922e){return _0x5f922e;});}return null;};}function removeEntity(_0x5657ca,_0x2a218b){return function(_0x2b4800){if(_0x2b4800){return _0x2b4800[_0x4c04('0x29')]()['then'](function(){var _0x41aa86=_0x2b4800[_0x4c04('0x2a')]({'plain':!![]});var _0x48d1e2=_0x4c04('0x2b');return db['UserProfileResource'][_0x4c04('0x29')]({'where':{'type':_0x48d1e2,'resourceId':_0x41aa86['id']}})[_0x4c04('0x2c')](function(){return _0x2b4800;});})[_0x4c04('0x2c')](function(){_0x5657ca[_0x4c04('0x1d')](0xcc)[_0x4c04('0x2d')]();});}};}function handleEntityNotFound(_0x4fbe54,_0x21402a){return function(_0x864f1c){if(!_0x864f1c){_0x4fbe54['sendStatus'](0x194);}return _0x864f1c;};}function handleError(_0x2bf18c,_0x227b5e){_0x227b5e=_0x227b5e||0x1f4;return function(_0x23ea40){logger[_0x4c04('0x2e')](_0x23ea40[_0x4c04('0x2f')]);if(_0x23ea40[_0x4c04('0x30')]){delete _0x23ea40['name'];}_0x2bf18c[_0x4c04('0x1d')](_0x227b5e)[_0x4c04('0x31')](_0x23ea40);};}exports[_0x4c04('0x32')]=function(_0x304326,_0x290d16){var _0x480853={},_0x10b855={},_0x5dc9ad={'count':0x0,'rows':[]};var _0x30bff7=_[_0x4c04('0x33')](db[_0x4c04('0x34')][_0x4c04('0x35')],function(_0x17c23d){return{'name':_0x17c23d[_0x4c04('0x36')],'type':_0x17c23d['type'][_0x4c04('0x37')]};});_0x10b855[_0x4c04('0x38')]=_[_0x4c04('0x33')](_0x30bff7,_0x4c04('0x30'));_0x10b855[_0x4c04('0x39')]=_[_0x4c04('0x3a')](_0x304326[_0x4c04('0x39')]);_0x10b855[_0x4c04('0x3b')]=_[_0x4c04('0x3c')](_0x10b855[_0x4c04('0x38')],_0x10b855[_0x4c04('0x39')]);_0x480853['attributes']=_[_0x4c04('0x3c')](_0x10b855[_0x4c04('0x38')],qs[_0x4c04('0x3d')](_0x304326[_0x4c04('0x39')]['fields']));_0x480853[_0x4c04('0x3e')]=_0x480853[_0x4c04('0x3e')]['length']?_0x480853[_0x4c04('0x3e')]:_0x10b855[_0x4c04('0x38')];if(!_0x304326['query'][_0x4c04('0x3f')](_0x4c04('0x40'))){_0x480853[_0x4c04('0x20')]=qs[_0x4c04('0x20')](_0x304326[_0x4c04('0x39')][_0x4c04('0x20')]);_0x480853[_0x4c04('0x1e')]=qs['offset'](_0x304326['query']['offset']);}_0x480853[_0x4c04('0x41')]=qs['sort'](_0x304326[_0x4c04('0x39')][_0x4c04('0x42')]);_0x480853[_0x4c04('0x43')]=qs[_0x4c04('0x3b')](_['pick'](_0x304326['query'],_0x10b855['filters']),_0x30bff7);if(_0x304326[_0x4c04('0x39')][_0x4c04('0x44')]){_0x480853['where']=_[_0x4c04('0x45')](_0x480853[_0x4c04('0x43')],{'$or':_[_0x4c04('0x33')](_0x30bff7,function(_0x2f2d25){if(_0x2f2d25['type']!==_0x4c04('0x46')){var _0x6da4c2={};_0x6da4c2[_0x2f2d25['name']]={'$like':'%'+_0x304326[_0x4c04('0x39')][_0x4c04('0x44')]+'%'};return _0x6da4c2;}})});}_0x480853=_[_0x4c04('0x45')]({},_0x480853,_0x304326[_0x4c04('0x47')]);var _0x43e9be={'where':_0x480853[_0x4c04('0x43')]};return db[_0x4c04('0x34')]['count'](_0x43e9be)[_0x4c04('0x2c')](function(_0x46f9ac){_0x5dc9ad[_0x4c04('0x21')]=_0x46f9ac;if(_0x304326[_0x4c04('0x39')][_0x4c04('0x48')]){_0x480853['include']=[{'all':!![]}];}return db[_0x4c04('0x34')][_0x4c04('0x49')](_0x480853);})['then'](function(_0x49e4c0){_0x5dc9ad['rows']=_0x49e4c0;return _0x5dc9ad;})['then'](respondWithFilteredResult(_0x290d16,_0x480853))['catch'](handleError(_0x290d16,null));};exports['show']=function(_0x3c47ac,_0x16beb5){var _0xdab1f9={'raw':!![],'where':{'id':_0x3c47ac['params']['id']}},_0x950fad={};_0x950fad['model']=_[_0x4c04('0x3a')](db[_0x4c04('0x34')][_0x4c04('0x35')]);_0x950fad[_0x4c04('0x39')]=_[_0x4c04('0x3a')](_0x3c47ac[_0x4c04('0x39')]);_0x950fad[_0x4c04('0x3b')]=_[_0x4c04('0x3c')](_0x950fad['model'],_0x950fad[_0x4c04('0x39')]);_0xdab1f9[_0x4c04('0x3e')]=_[_0x4c04('0x3c')](_0x950fad[_0x4c04('0x38')],qs['fields'](_0x3c47ac[_0x4c04('0x39')][_0x4c04('0x3d')]));_0xdab1f9[_0x4c04('0x3e')]=_0xdab1f9[_0x4c04('0x3e')][_0x4c04('0x4a')]?_0xdab1f9['attributes']:_0x950fad[_0x4c04('0x38')];if(_0x3c47ac['query']['includeAll']){_0xdab1f9[_0x4c04('0x4b')]=[{'all':!![]}];}_0xdab1f9=_['merge']({},_0xdab1f9,_0x3c47ac['options']);return db[_0x4c04('0x34')][_0x4c04('0x4c')](_0xdab1f9)[_0x4c04('0x2c')](handleEntityNotFound(_0x16beb5,null))[_0x4c04('0x2c')](respondWithResult(_0x16beb5,null))[_0x4c04('0x4d')](handleError(_0x16beb5,null));};exports[_0x4c04('0x4e')]=function(_0x48ddf6,_0x5bfc79){return db[_0x4c04('0x34')][_0x4c04('0x4e')](_0x48ddf6[_0x4c04('0x4f')],{})[_0x4c04('0x2c')](function(_0x41b3b1){var _0x5a9b2c=_0x48ddf6[_0x4c04('0x50')][_0x4c04('0x2a')]({'plain':!![]});if(!_0x5a9b2c)throw new Error(_0x4c04('0x51'));if(_0x5a9b2c[_0x4c04('0x52')]===_0x4c04('0x50')){var _0x4b93d7=_0x41b3b1[_0x4c04('0x2a')]({'plain':!![]});var _0x2d493c='MailQueues';return db[_0x4c04('0x53')][_0x4c04('0x4c')]({'where':{'name':_0x2d493c,'userProfileId':_0x5a9b2c[_0x4c04('0x54')]},'raw':!![]})['then'](function(_0x16209d){if(_0x16209d&&_0x16209d[_0x4c04('0x55')]===0x0){return db['UserProfileResource'][_0x4c04('0x4e')]({'name':_0x4b93d7[_0x4c04('0x30')],'resourceId':_0x4b93d7['id'],'type':_0x16209d['name'],'sectionId':_0x16209d['id']},{})[_0x4c04('0x2c')](function(){return _0x41b3b1;});}else{return _0x41b3b1;}})['catch'](function(_0x32d74f){logger[_0x4c04('0x2e')](_0x4c04('0x56'),_0x32d74f);throw _0x32d74f;});}return _0x41b3b1;})[_0x4c04('0x2c')](respondWithResult(_0x5bfc79,0xc9))[_0x4c04('0x4d')](handleError(_0x5bfc79,null));};exports[_0x4c04('0x28')]=function(_0x120240,_0x163ced){if(_0x120240[_0x4c04('0x4f')]['id']){delete _0x120240[_0x4c04('0x4f')]['id'];}return db[_0x4c04('0x34')]['find']({'where':{'id':_0x120240['params']['id']}})[_0x4c04('0x2c')](handleEntityNotFound(_0x163ced,null))[_0x4c04('0x2c')](saveUpdates(_0x120240['body'],null))[_0x4c04('0x2c')](respondWithResult(_0x163ced,null))[_0x4c04('0x4d')](handleError(_0x163ced,null));};exports['destroy']=function(_0x157c7e,_0x54f5e8){return db[_0x4c04('0x34')][_0x4c04('0x4c')]({'where':{'id':_0x157c7e['params']['id']}})[_0x4c04('0x2c')](handleEntityNotFound(_0x54f5e8,null))['then'](removeEntity(_0x54f5e8,null))[_0x4c04('0x4d')](handleError(_0x54f5e8,null));};exports[_0x4c04('0x57')]=function(_0x12fb52,_0x559c0c){return db[_0x4c04('0x34')][_0x4c04('0x57')]()[_0x4c04('0x2c')](respondWithResult(_0x559c0c,null))[_0x4c04('0x4d')](handleError(_0x559c0c,null));};exports[_0x4c04('0x58')]=function(_0x1c383a,_0x45817f,_0x1491f8){var _0x4bae13={'raw':!![],'where':{}},_0x239182={},_0x15b150;return db[_0x4c04('0x34')]['findOne']({'where':{'id':_0x1c383a[_0x4c04('0x59')]['id']}})['then'](handleEntityNotFound(_0x45817f,null))[_0x4c04('0x2c')](function(_0x3aad46){if(_0x3aad46){_0x15b150=_0x3aad46['get']({'plain':!![]});_0x239182['model']=_[_0x4c04('0x3a')](db[_0x4c04('0x5a')][_0x4c04('0x35')]);_0x239182[_0x4c04('0x39')]=_[_0x4c04('0x3a')](_0x1c383a[_0x4c04('0x39')]);_0x239182[_0x4c04('0x3b')]=_[_0x4c04('0x3c')](_0x239182[_0x4c04('0x38')],_0x239182[_0x4c04('0x39')]);_0x4bae13[_0x4c04('0x3e')]=_[_0x4c04('0x3c')](_0x239182[_0x4c04('0x38')],qs[_0x4c04('0x3d')](_0x1c383a[_0x4c04('0x39')][_0x4c04('0x3d')]));_0x4bae13[_0x4c04('0x3e')]=_0x4bae13[_0x4c04('0x3e')]['length']?_0x4bae13[_0x4c04('0x3e')]:_0x239182['model'];if(!_0x1c383a[_0x4c04('0x39')][_0x4c04('0x3f')]('nolimit')){_0x4bae13[_0x4c04('0x20')]=qs['limit'](_0x1c383a[_0x4c04('0x39')][_0x4c04('0x20')]);_0x4bae13[_0x4c04('0x1e')]=qs[_0x4c04('0x1e')](_0x1c383a[_0x4c04('0x39')][_0x4c04('0x1e')]);}_0x4bae13['order']=qs[_0x4c04('0x42')](_0x1c383a[_0x4c04('0x39')][_0x4c04('0x42')]);_0x4bae13[_0x4c04('0x43')]=qs[_0x4c04('0x3b')](_['pick'](_0x1c383a[_0x4c04('0x39')],_0x239182[_0x4c04('0x3b')]));_0x4bae13['where']['MailQueueId']=_0x3aad46['id'];if(_0x1c383a[_0x4c04('0x39')]['filter']){_0x4bae13[_0x4c04('0x43')]=_[_0x4c04('0x45')](_0x4bae13[_0x4c04('0x43')],{'$or':_[_0x4c04('0x33')](_0x4bae13[_0x4c04('0x3e')],function(_0x290f98){var _0x4e9de8={};_0x4e9de8[_0x290f98]={'$like':'%'+_0x1c383a['query'][_0x4c04('0x44')]+'%'};return _0x4e9de8;})});}_0x4bae13=_[_0x4c04('0x45')]({},_0x4bae13,_0x1c383a[_0x4c04('0x47')]);return db['UserMailQueue'][_0x4c04('0x49')](_0x4bae13);}})[_0x4c04('0x2c')](function(_0x141168){if(_0x141168){return db[_0x4c04('0x5b')][_0x4c04('0x5c')]({'where':{'id':_[_0x4c04('0x33')](_0x141168,_0x4c04('0x5d')),'role':'agent'},'attributes':['id',_0x4c04('0x30'),_0x4c04('0x5e'),_0x4c04('0x5f'),_0x4c04('0x60')]});}})[_0x4c04('0x2c')](function(_0x211559){if(_0x211559){return{'count':_0x211559[_0x4c04('0x21')],'rows':_[_0x4c04('0x33')](_0x211559[_0x4c04('0x61')],function(_0x5e128b){return{'membername':_0x5e128b[_0x4c04('0x30')],'UserId':_0x5e128b['id'],'queue_name':_0x15b150[_0x4c04('0x30')],'MailQueueId':_0x15b150['id'],'interface':util['format'](_0x4c04('0x62'),_0x4c04('0x63'),_0x5e128b['name']),'penalty':0x0,'paused':_0x5e128b[_0x4c04('0x5e')],'createdAt':_0x5e128b[_0x4c04('0x60')],'updatedAt':_0x5e128b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4c04('0x2c')](respondWithFilteredResult(_0x45817f,_0x4bae13))['catch'](handleError(_0x45817f,null));};exports['getTeams']=function(_0x4c6518,_0x19d462,_0x46fee3){var _0x6b2ec6={};var _0x281817={};var _0x3729e6;var _0x3ea4eb;return db['MailQueue'][_0x4c04('0x64')]({'where':{'id':_0x4c6518[_0x4c04('0x59')]['id']}})[_0x4c04('0x2c')](handleEntityNotFound(_0x19d462,null))[_0x4c04('0x2c')](function(_0xdec642){if(_0xdec642){_0x3729e6=_0xdec642;_0x281817[_0x4c04('0x38')]=_['keys'](db['Team']['rawAttributes']);_0x281817['query']=_[_0x4c04('0x3a')](_0x4c6518[_0x4c04('0x39')]);_0x281817['filters']=_[_0x4c04('0x3c')](_0x281817[_0x4c04('0x38')],_0x281817[_0x4c04('0x39')]);_0x6b2ec6['attributes']=_[_0x4c04('0x3c')](_0x281817[_0x4c04('0x38')],qs[_0x4c04('0x3d')](_0x4c6518['query'][_0x4c04('0x3d')]));_0x6b2ec6['attributes']=_0x6b2ec6[_0x4c04('0x3e')]['length']?_0x6b2ec6['attributes']:_0x281817[_0x4c04('0x38')];_0x6b2ec6['order']=qs[_0x4c04('0x42')](_0x4c6518[_0x4c04('0x39')][_0x4c04('0x42')]);_0x6b2ec6[_0x4c04('0x43')]=qs['filters'](_[_0x4c04('0x65')](_0x4c6518[_0x4c04('0x39')],_0x281817[_0x4c04('0x3b')]));if(_0x4c6518['query'][_0x4c04('0x44')]){_0x6b2ec6[_0x4c04('0x43')]=_['merge'](_0x6b2ec6['where'],{'$or':_[_0x4c04('0x33')](_0x6b2ec6[_0x4c04('0x3e')],function(_0x31b0cd){var _0x599fe5={};_0x599fe5[_0x31b0cd]={'$like':'%'+_0x4c6518['query'][_0x4c04('0x44')]+'%'};return _0x599fe5;})});}_0x6b2ec6=_['merge']({},_0x6b2ec6,_0x4c6518[_0x4c04('0x47')]);return _0x3729e6['getTeams'](_0x6b2ec6);}})[_0x4c04('0x2c')](function(_0x1e4ba6){if(_0x1e4ba6){_0x3ea4eb=_0x1e4ba6[_0x4c04('0x4a')];if(!_0x4c6518[_0x4c04('0x39')][_0x4c04('0x3f')](_0x4c04('0x40'))){_0x6b2ec6[_0x4c04('0x20')]=qs[_0x4c04('0x20')](_0x4c6518['query'][_0x4c04('0x20')]);_0x6b2ec6['offset']=qs['offset'](_0x4c6518[_0x4c04('0x39')]['offset']);}return _0x3729e6['getTeams'](_0x6b2ec6);}})[_0x4c04('0x2c')](function(_0x369472){if(_0x369472){return _0x369472?{'count':_0x3ea4eb,'rows':_0x369472}:null;}})['then'](respondWithResult(_0x19d462,null))['catch'](handleError(_0x19d462,null));};exports[_0x4c04('0x66')]=function(_0x3131ed,_0x5490a,_0x54c64b){var _0x338d3d=_0x3131ed['body'][_0x4c04('0x67')];return db[_0x4c04('0x68')]['findAll']({'where':{'id':_0x338d3d},'attributes':['id'],'include':[{'model':db[_0x4c04('0x5b')],'as':_0x4c04('0x69'),'attributes':['id',_0x4c04('0x30'),'online',_0x4c04('0x6a'),_0x4c04('0x6b')],'raw':!![]}]})['then'](function(_0x33fa14){if(_0x33fa14){var _0x4ae2d9=_[_0x4c04('0x6c')](_0x33fa14,function(_0x497e32){var _0x3602fe=_0x497e32[_0x4c04('0x2a')]({'plain':!![]});return _0x3602fe[_0x4c04('0x69')];});return db[_0x4c04('0x34')][_0x4c04('0x4c')]({'where':{'id':_0x3131ed['params']['id']}})[_0x4c04('0x2c')](function(_0x38b1e1){return db[_0x4c04('0x6d')]['transaction'](function(_0xd8ac0){return _0x38b1e1[_0x4c04('0x66')](_0x338d3d,{'transaction':_0xd8ac0})[_0x4c04('0x2c')](function(){return BPromise[_0x4c04('0x6e')](_0x4ae2d9,function(_0x135d21){return db[_0x4c04('0x5a')][_0x4c04('0x6f')]({'where':{'UserId':_0x135d21['id'],'MailQueueId':_0x3131ed[_0x4c04('0x59')]['id']},'transaction':_0xd8ac0});});})[_0x4c04('0x2c')](function(){_0x4ae2d9[_0x4c04('0x70')](function(_0x56c0f6){socket[_0x4c04('0x71')](_0x4c04('0x72'),{'UserId':_0x56c0f6['id'],'MailQueueId':_0x38b1e1['id']});});});});});}})['then'](respondWithStatusCode(_0x5490a,null))['catch'](handleError(_0x5490a,null));};exports[_0x4c04('0x73')]=function(_0x3d5ccd,_0x77a259,_0x3eb1ed){return db[_0x4c04('0x68')][_0x4c04('0x49')]({'where':{'id':_0x3d5ccd[_0x4c04('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4c04('0x5b')],'as':_0x4c04('0x69'),'attributes':['id'],'raw':!![]}]})[_0x4c04('0x2c')](handleEntityNotFound(_0x77a259,null))[_0x4c04('0x2c')](function(_0x4ed7b1){var _0x4325bd=_[_0x4c04('0x33')](_0x4ed7b1,'id');var _0x5a9b48=[];var _0x381b3b=[];var _0x2e4b7f=squel[_0x4c04('0x74')]();_0x2e4b7f[_0x4c04('0x75')]('tq.TeamId')[_0x4c04('0x76')](_0x4c04('0x77'),'tq')[_0x4c04('0x78')]('user_has_teams','ut',_0x4c04('0x79'))[_0x4c04('0x43')]('MailQueueId\x20=\x20?',_0x3d5ccd[_0x4c04('0x59')]['id']);for(var _0x3d1e30=0x0;_0x3d1e30<_0x4ed7b1[_0x4c04('0x4a')];_0x3d1e30+=0x1){let _0x1d59c2=_0x4ed7b1[_0x3d1e30];for(var _0x48900f=0x0;_0x48900f<_0x1d59c2[_0x4c04('0x69')][_0x4c04('0x4a')];_0x48900f+=0x1){let _0x5db2de=_0x1d59c2[_0x4c04('0x69')][_0x48900f];var _0x2f8483=_0x2e4b7f[_0x4c04('0x7a')]();_0x2f8483['where']('ut.UserId\x20=\x20?',_0x5db2de['id']);_0x381b3b[_0x4c04('0x7b')](db['sequelize']['query'](_0x2f8483[_0x4c04('0x7c')](),{'type':db[_0x4c04('0x6d')][_0x4c04('0x7d')]['SELECT']})[_0x4c04('0x2c')](function(_0x4ff979){if(_0x4ff979[_0x4c04('0x4a')]===0x1){return _0x5db2de['id'];}else{var _0x4a7340=_[_0x4c04('0x7e')](_[_0x4c04('0x33')](_0x4ff979,_0x4c04('0x7f')),function(_0x499a30){return _['includes'](_0x4325bd,_0x499a30);});if(_0x4a7340){return _0x5db2de['id'];}}}));}}return BPromise['all'](_0x381b3b)[_0x4c04('0x2c')](function(_0x92e6ac){_0x5a9b48=_(_0x5a9b48)[_0x4c04('0x80')](_0x92e6ac)[_0x4c04('0x81')]()[_0x4c04('0x82')]();return db[_0x4c04('0x34')][_0x4c04('0x4c')]({'where':{'id':_0x3d5ccd[_0x4c04('0x59')]['id']}})[_0x4c04('0x2c')](function(_0xc97393){return db[_0x4c04('0x6d')][_0x4c04('0x83')](function(_0x26a8f0){return _0xc97393[_0x4c04('0x73')](_0x3d5ccd['query'][_0x4c04('0x67')],{'transaction':_0x26a8f0})[_0x4c04('0x2c')](function(){if(!_[_0x4c04('0x84')](_0x5a9b48)){return _0xc97393[_0x4c04('0x85')](_0x5a9b48,{'transaction':_0x26a8f0});}})[_0x4c04('0x2c')](function(){_0x5a9b48[_0x4c04('0x70')](function(_0x311ef2){socket['emit'](_0x4c04('0x86'),{'UserId':_0x311ef2,'MailQueueId':_0xc97393['id']});});});});});});})[_0x4c04('0x2c')](respondWithStatusCode(_0x77a259,null))[_0x4c04('0x4d')](handleError(_0x77a259,null));};exports['addAgents']=function(_0xfc0b5f,_0x383957,_0x3d91f9){return db['MailQueue']['find']({'where':{'id':_0xfc0b5f[_0x4c04('0x59')]['id']}})[_0x4c04('0x2c')](handleEntityNotFound(_0x383957,null))[_0x4c04('0x2c')](function(_0x565cb3){if(_0x565cb3){return _0x565cb3['addAgents'](_0xfc0b5f[_0x4c04('0x4f')][_0x4c04('0x67')],_[_0x4c04('0x87')](_0xfc0b5f['body'],['ids','id'])||{})[_0x4c04('0x88')](function(_0x138fff){for(var _0x538c3b=0x0;_0x538c3b<_0xfc0b5f[_0x4c04('0x4f')][_0x4c04('0x67')][_0x4c04('0x4a')];_0x538c3b+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0xfc0b5f['body'][_0x4c04('0x67')][_0x538c3b]),'MailQueueId':Number(_0xfc0b5f[_0x4c04('0x59')]['id'])});}return _0x138fff;});}})[_0x4c04('0x2c')](respondWithResult(_0x383957,null))[_0x4c04('0x4d')](handleError(_0x383957,null));};exports['removeAgents']=function(_0x2231ef,_0xfb234a,_0x58632e){return db[_0x4c04('0x34')][_0x4c04('0x4c')]({'where':{'id':_0x2231ef['params']['id']}})[_0x4c04('0x2c')](handleEntityNotFound(_0xfb234a,null))[_0x4c04('0x2c')](function(_0x1c7881){if(_0x1c7881){return _0x1c7881[_0x4c04('0x85')](_0x2231ef[_0x4c04('0x39')]['ids'])['then'](function(){if(_[_0x4c04('0x89')](_0x2231ef[_0x4c04('0x39')][_0x4c04('0x67')])){for(var _0x9126b5=0x0;_0x9126b5<_0x2231ef[_0x4c04('0x39')][_0x4c04('0x67')][_0x4c04('0x4a')];_0x9126b5+=0x1){socket[_0x4c04('0x71')]('userMailQueue:remove',{'UserId':Number(_0x2231ef[_0x4c04('0x39')][_0x4c04('0x67')][_0x9126b5]),'MailQueueId':Number(_0x2231ef[_0x4c04('0x59')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x2231ef[_0x4c04('0x39')][_0x4c04('0x67')]),'MailQueueId':Number(_0x2231ef[_0x4c04('0x59')]['id'])});}});}})[_0x4c04('0x2c')](respondWithStatusCode(_0xfb234a,null))[_0x4c04('0x4d')](handleError(_0xfb234a,null));};exports[_0x4c04('0x8a')]=function(_0x4c3910,_0x32024e,_0x1c1497){var _0x5f2c7a={};var _0x24695c={};var _0x3a329f;var _0x17e46b;return db[_0x4c04('0x34')][_0x4c04('0x64')]({'where':{'id':_0x4c3910[_0x4c04('0x59')]['id']}})[_0x4c04('0x2c')](handleEntityNotFound(_0x32024e,null))['then'](function(_0x514bd3){if(_0x514bd3){_0x3a329f=_0x514bd3;_0x24695c['model']=_[_0x4c04('0x3a')](db[_0x4c04('0x5b')][_0x4c04('0x35')]);_0x24695c[_0x4c04('0x39')]=_[_0x4c04('0x3a')](_0x4c3910[_0x4c04('0x39')]);_0x24695c['filters']=_['intersection'](_0x24695c[_0x4c04('0x38')],_0x24695c['query']);_0x5f2c7a[_0x4c04('0x3e')]=_[_0x4c04('0x3c')](_0x24695c[_0x4c04('0x38')],qs[_0x4c04('0x3d')](_0x4c3910[_0x4c04('0x39')][_0x4c04('0x3d')]));_0x5f2c7a['attributes']=_0x5f2c7a[_0x4c04('0x3e')]['length']?_0x5f2c7a['attributes']:_0x24695c[_0x4c04('0x38')];_0x5f2c7a[_0x4c04('0x41')]=qs[_0x4c04('0x42')](_0x4c3910[_0x4c04('0x39')][_0x4c04('0x42')]);_0x5f2c7a[_0x4c04('0x43')]=qs[_0x4c04('0x3b')](_[_0x4c04('0x65')](_0x4c3910[_0x4c04('0x39')],_0x24695c['filters']));if(_0x4c3910['query']['filter']){_0x5f2c7a[_0x4c04('0x43')]=_['merge'](_0x5f2c7a[_0x4c04('0x43')],{'$or':_[_0x4c04('0x33')](_0x5f2c7a[_0x4c04('0x3e')],function(_0x5a1c5e){var _0x290300={};_0x290300[_0x5a1c5e]={'$like':'%'+_0x4c3910[_0x4c04('0x39')][_0x4c04('0x44')]+'%'};return _0x290300;})});}_0x5f2c7a=_[_0x4c04('0x45')]({},_0x5f2c7a,_0x4c3910[_0x4c04('0x47')]);return _0x3a329f[_0x4c04('0x8a')](_0x5f2c7a);}})[_0x4c04('0x2c')](function(_0x231218){if(_0x231218){_0x17e46b=_0x231218['length'];if(!_0x4c3910[_0x4c04('0x39')][_0x4c04('0x3f')]('nolimit')){_0x5f2c7a[_0x4c04('0x20')]=qs[_0x4c04('0x20')](_0x4c3910[_0x4c04('0x39')][_0x4c04('0x20')]);_0x5f2c7a[_0x4c04('0x1e')]=qs[_0x4c04('0x1e')](_0x4c3910[_0x4c04('0x39')][_0x4c04('0x1e')]);}return _0x3a329f[_0x4c04('0x8a')](_0x5f2c7a);}})[_0x4c04('0x2c')](function(_0x2c9d8d){if(_0x2c9d8d){return _0x2c9d8d?{'count':_0x17e46b,'rows':_0x2c9d8d}:null;}})[_0x4c04('0x2c')](respondWithResult(_0x32024e,null))['catch'](handleError(_0x32024e,null));};
\ No newline at end of file
+var _0x9d11=['SIP','getTeams','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','Team','select','field','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./mailQueue.socket','register','sendStatus','status','json','offset','limit','count','apply','reject','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','MailQueue','includeAll','include','rows','show','params','find','create','body','user','UserProfileSection','autoAssociation','catch','update','describe','getMembers','findOne','UserMailQueue','keys','MailQueueId','findAll','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','%s/%s'];(function(_0x5be652,_0x129d44){var _0x3c89da=function(_0x2f01ac){while(--_0x2f01ac){_0x5be652['push'](_0x5be652['shift']());}};_0x3c89da(++_0x129d44);}(_0x9d11,0xb7));var _0x19d1=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x9d11[_0xe8129c];return _0x709fc5;};'use strict';var emlformat=require(_0x19d1('0x0'));var rimraf=require(_0x19d1('0x1'));var zipdir=require(_0x19d1('0x2'));var jsonpatch=require(_0x19d1('0x3'));var rp=require('request-promise');var moment=require(_0x19d1('0x4'));var BPromise=require(_0x19d1('0x5'));var Mustache=require(_0x19d1('0x6'));var util=require(_0x19d1('0x7'));var path=require(_0x19d1('0x8'));var sox=require(_0x19d1('0x9'));var csv=require('to-csv');var ejs=require(_0x19d1('0xa'));var fs=require('fs');var fs_extra=require(_0x19d1('0xb'));var _=require('lodash');var squel=require(_0x19d1('0xc'));var crypto=require(_0x19d1('0xd'));var jsforce=require(_0x19d1('0xe'));var deskjs=require(_0x19d1('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x19d1('0x10'));var Redis=require(_0x19d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x19d1('0x12'));var as=require(_0x19d1('0x13'));var hardwareService=require(_0x19d1('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x19d1('0x15'));var licenseUtil=require(_0x19d1('0x16'));var db=require(_0x19d1('0x17'))['db'];config[_0x19d1('0x18')]=_['defaults'](config['redis'],{'host':_0x19d1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x19d1('0x1a'))[_0x19d1('0x1b')](socket);function respondWithStatusCode(_0x116b36,_0x5d4581){_0x5d4581=_0x5d4581||0xcc;return function(_0x202433){if(_0x202433){return _0x116b36[_0x19d1('0x1c')](_0x5d4581);}return _0x116b36[_0x19d1('0x1d')](_0x5d4581)['end']();};}function respondWithResult(_0xc896b8,_0x31e645){_0x31e645=_0x31e645||0xc8;return function(_0x3b7417){if(_0x3b7417){return _0xc896b8['status'](_0x31e645)[_0x19d1('0x1e')](_0x3b7417);}};}function respondWithFilteredResult(_0x3beea5,_0x45dbf1){return function(_0x3df779){if(_0x3df779){var _0x3144eb=typeof _0x45dbf1[_0x19d1('0x1f')]==='undefined'&&typeof _0x45dbf1[_0x19d1('0x20')]==='undefined';var _0x4902c4=_0x3df779[_0x19d1('0x21')];var _0x100779=_0x3144eb?0x0:_0x45dbf1[_0x19d1('0x1f')];var _0x3a491a=_0x3144eb?_0x3df779[_0x19d1('0x21')]:_0x45dbf1['offset']+_0x45dbf1['limit'];var _0x3e89cf;if(_0x3a491a>=_0x4902c4){_0x3a491a=_0x4902c4;_0x3e89cf=0xc8;}else{_0x3e89cf=0xce;}_0x3beea5[_0x19d1('0x1d')](_0x3e89cf);return _0x3beea5['set']('Content-Range',_0x100779+'-'+_0x3a491a+'/'+_0x4902c4)[_0x19d1('0x1e')](_0x3df779);}return null;};}function patchUpdates(_0x46d9df){return function(_0x113104){try{jsonpatch[_0x19d1('0x22')](_0x113104,_0x46d9df,!![]);}catch(_0x22820e){return BPromise[_0x19d1('0x23')](_0x22820e);}return _0x113104['save']();};}function saveUpdates(_0x19f04d,_0x226a66){return function(_0x1e8de8){if(_0x1e8de8){return _0x1e8de8['update'](_0x19f04d)[_0x19d1('0x24')](function(_0x1bb261){return _0x1bb261;});}return null;};}function removeEntity(_0x27d3cc,_0x95544d){return function(_0x18155a){if(_0x18155a){return _0x18155a[_0x19d1('0x25')]()[_0x19d1('0x24')](function(){var _0x2d83a6=_0x18155a[_0x19d1('0x26')]({'plain':!![]});var _0x208082=_0x19d1('0x27');return db[_0x19d1('0x28')][_0x19d1('0x25')]({'where':{'type':_0x208082,'resourceId':_0x2d83a6['id']}})[_0x19d1('0x24')](function(){return _0x18155a;});})[_0x19d1('0x24')](function(){_0x27d3cc[_0x19d1('0x1d')](0xcc)[_0x19d1('0x29')]();});}};}function handleEntityNotFound(_0x596a2a,_0x2b186e){return function(_0x1e0431){if(!_0x1e0431){_0x596a2a[_0x19d1('0x1c')](0x194);}return _0x1e0431;};}function handleError(_0x45cf52,_0x1489db){_0x1489db=_0x1489db||0x1f4;return function(_0x180922){logger[_0x19d1('0x2a')](_0x180922[_0x19d1('0x2b')]);if(_0x180922['name']){delete _0x180922[_0x19d1('0x2c')];}_0x45cf52[_0x19d1('0x1d')](_0x1489db)[_0x19d1('0x2d')](_0x180922);};}exports[_0x19d1('0x2e')]=function(_0x5ee534,_0x1d65ab){var _0xc27c85={},_0x29f813={},_0x4b365e={'count':0x0,'rows':[]};var _0x273261=_[_0x19d1('0x2f')](db['MailQueue'][_0x19d1('0x30')],function(_0x4cc8a4){return{'name':_0x4cc8a4[_0x19d1('0x31')],'type':_0x4cc8a4[_0x19d1('0x32')]['key']};});_0x29f813[_0x19d1('0x33')]=_[_0x19d1('0x2f')](_0x273261,_0x19d1('0x2c'));_0x29f813[_0x19d1('0x34')]=_['keys'](_0x5ee534[_0x19d1('0x34')]);_0x29f813['filters']=_[_0x19d1('0x35')](_0x29f813[_0x19d1('0x33')],_0x29f813[_0x19d1('0x34')]);_0xc27c85[_0x19d1('0x36')]=_['intersection'](_0x29f813['model'],qs[_0x19d1('0x37')](_0x5ee534[_0x19d1('0x34')][_0x19d1('0x37')]));_0xc27c85['attributes']=_0xc27c85[_0x19d1('0x36')][_0x19d1('0x38')]?_0xc27c85[_0x19d1('0x36')]:_0x29f813['model'];if(!_0x5ee534[_0x19d1('0x34')]['hasOwnProperty'](_0x19d1('0x39'))){_0xc27c85[_0x19d1('0x20')]=qs[_0x19d1('0x20')](_0x5ee534[_0x19d1('0x34')]['limit']);_0xc27c85[_0x19d1('0x1f')]=qs['offset'](_0x5ee534[_0x19d1('0x34')][_0x19d1('0x1f')]);}_0xc27c85[_0x19d1('0x3a')]=qs[_0x19d1('0x3b')](_0x5ee534['query'][_0x19d1('0x3b')]);_0xc27c85[_0x19d1('0x3c')]=qs[_0x19d1('0x3d')](_[_0x19d1('0x3e')](_0x5ee534[_0x19d1('0x34')],_0x29f813[_0x19d1('0x3d')]),_0x273261);if(_0x5ee534[_0x19d1('0x34')][_0x19d1('0x3f')]){_0xc27c85['where']=_[_0x19d1('0x40')](_0xc27c85[_0x19d1('0x3c')],{'$or':_['map'](_0x273261,function(_0x1092ba){if(_0x1092ba[_0x19d1('0x32')]!==_0x19d1('0x41')){var _0x47829e={};_0x47829e[_0x1092ba['name']]={'$like':'%'+_0x5ee534['query']['filter']+'%'};return _0x47829e;}})});}_0xc27c85=_['merge']({},_0xc27c85,_0x5ee534[_0x19d1('0x42')]);var _0x50d05d={'where':_0xc27c85['where']};return db[_0x19d1('0x43')][_0x19d1('0x21')](_0x50d05d)[_0x19d1('0x24')](function(_0x562d9f){_0x4b365e['count']=_0x562d9f;if(_0x5ee534['query'][_0x19d1('0x44')]){_0xc27c85[_0x19d1('0x45')]=[{'all':!![]}];}return db[_0x19d1('0x43')]['findAll'](_0xc27c85);})['then'](function(_0x18a863){_0x4b365e[_0x19d1('0x46')]=_0x18a863;return _0x4b365e;})[_0x19d1('0x24')](respondWithFilteredResult(_0x1d65ab,_0xc27c85))['catch'](handleError(_0x1d65ab,null));};exports[_0x19d1('0x47')]=function(_0x20e576,_0x9268a1){var _0x5ad2bb={'raw':!![],'where':{'id':_0x20e576[_0x19d1('0x48')]['id']}},_0x3bef76={};_0x3bef76[_0x19d1('0x33')]=_['keys'](db[_0x19d1('0x43')][_0x19d1('0x30')]);_0x3bef76[_0x19d1('0x34')]=_['keys'](_0x20e576[_0x19d1('0x34')]);_0x3bef76['filters']=_['intersection'](_0x3bef76[_0x19d1('0x33')],_0x3bef76[_0x19d1('0x34')]);_0x5ad2bb[_0x19d1('0x36')]=_[_0x19d1('0x35')](_0x3bef76['model'],qs[_0x19d1('0x37')](_0x20e576[_0x19d1('0x34')]['fields']));_0x5ad2bb[_0x19d1('0x36')]=_0x5ad2bb[_0x19d1('0x36')]['length']?_0x5ad2bb[_0x19d1('0x36')]:_0x3bef76[_0x19d1('0x33')];if(_0x20e576[_0x19d1('0x34')][_0x19d1('0x44')]){_0x5ad2bb['include']=[{'all':!![]}];}_0x5ad2bb=_[_0x19d1('0x40')]({},_0x5ad2bb,_0x20e576[_0x19d1('0x42')]);return db[_0x19d1('0x43')][_0x19d1('0x49')](_0x5ad2bb)[_0x19d1('0x24')](handleEntityNotFound(_0x9268a1,null))['then'](respondWithResult(_0x9268a1,null))['catch'](handleError(_0x9268a1,null));};exports['create']=function(_0x4dd703,_0x465a6e){return db[_0x19d1('0x43')][_0x19d1('0x4a')](_0x4dd703[_0x19d1('0x4b')],{})['then'](function(_0x58c29f){var _0x141354=_0x4dd703[_0x19d1('0x4c')][_0x19d1('0x26')]({'plain':!![]});if(!_0x141354)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x141354['role']===_0x19d1('0x4c')){var _0x11daa5=_0x58c29f[_0x19d1('0x26')]({'plain':!![]});var _0x143703=_0x19d1('0x27');return db[_0x19d1('0x4d')][_0x19d1('0x49')]({'where':{'name':_0x143703,'userProfileId':_0x141354['userProfileId']},'raw':!![]})[_0x19d1('0x24')](function(_0x5114ab){if(_0x5114ab&&_0x5114ab[_0x19d1('0x4e')]===0x0){return db['UserProfileResource'][_0x19d1('0x4a')]({'name':_0x11daa5[_0x19d1('0x2c')],'resourceId':_0x11daa5['id'],'type':_0x5114ab[_0x19d1('0x2c')],'sectionId':_0x5114ab['id']},{})[_0x19d1('0x24')](function(){return _0x58c29f;});}else{return _0x58c29f;}})[_0x19d1('0x4f')](function(_0x5f4158){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f4158);throw _0x5f4158;});}return _0x58c29f;})[_0x19d1('0x24')](respondWithResult(_0x465a6e,0xc9))[_0x19d1('0x4f')](handleError(_0x465a6e,null));};exports[_0x19d1('0x50')]=function(_0x3f405e,_0x48a06a){if(_0x3f405e[_0x19d1('0x4b')]['id']){delete _0x3f405e[_0x19d1('0x4b')]['id'];}return db[_0x19d1('0x43')][_0x19d1('0x49')]({'where':{'id':_0x3f405e[_0x19d1('0x48')]['id']}})[_0x19d1('0x24')](handleEntityNotFound(_0x48a06a,null))['then'](saveUpdates(_0x3f405e['body'],null))[_0x19d1('0x24')](respondWithResult(_0x48a06a,null))[_0x19d1('0x4f')](handleError(_0x48a06a,null));};exports[_0x19d1('0x25')]=function(_0x5de604,_0x31b9ed){return db['MailQueue'][_0x19d1('0x49')]({'where':{'id':_0x5de604[_0x19d1('0x48')]['id']}})[_0x19d1('0x24')](handleEntityNotFound(_0x31b9ed,null))[_0x19d1('0x24')](removeEntity(_0x31b9ed,null))['catch'](handleError(_0x31b9ed,null));};exports[_0x19d1('0x51')]=function(_0x3cce2e,_0x1c299f){return db['MailQueue'][_0x19d1('0x51')]()[_0x19d1('0x24')](respondWithResult(_0x1c299f,null))[_0x19d1('0x4f')](handleError(_0x1c299f,null));};exports[_0x19d1('0x52')]=function(_0x5c29e1,_0x23689e,_0x133dcf){var _0x55a06f={'raw':!![],'where':{}},_0xea1c73={},_0x12e754;return db[_0x19d1('0x43')][_0x19d1('0x53')]({'where':{'id':_0x5c29e1[_0x19d1('0x48')]['id']}})[_0x19d1('0x24')](handleEntityNotFound(_0x23689e,null))[_0x19d1('0x24')](function(_0x19e12d){if(_0x19e12d){_0x12e754=_0x19e12d[_0x19d1('0x26')]({'plain':!![]});_0xea1c73['model']=_['keys'](db[_0x19d1('0x54')][_0x19d1('0x30')]);_0xea1c73[_0x19d1('0x34')]=_[_0x19d1('0x55')](_0x5c29e1['query']);_0xea1c73[_0x19d1('0x3d')]=_[_0x19d1('0x35')](_0xea1c73[_0x19d1('0x33')],_0xea1c73[_0x19d1('0x34')]);_0x55a06f[_0x19d1('0x36')]=_['intersection'](_0xea1c73[_0x19d1('0x33')],qs['fields'](_0x5c29e1[_0x19d1('0x34')][_0x19d1('0x37')]));_0x55a06f[_0x19d1('0x36')]=_0x55a06f[_0x19d1('0x36')][_0x19d1('0x38')]?_0x55a06f['attributes']:_0xea1c73['model'];if(!_0x5c29e1[_0x19d1('0x34')]['hasOwnProperty']('nolimit')){_0x55a06f[_0x19d1('0x20')]=qs[_0x19d1('0x20')](_0x5c29e1['query'][_0x19d1('0x20')]);_0x55a06f[_0x19d1('0x1f')]=qs['offset'](_0x5c29e1['query'][_0x19d1('0x1f')]);}_0x55a06f[_0x19d1('0x3a')]=qs[_0x19d1('0x3b')](_0x5c29e1[_0x19d1('0x34')]['sort']);_0x55a06f[_0x19d1('0x3c')]=qs[_0x19d1('0x3d')](_[_0x19d1('0x3e')](_0x5c29e1[_0x19d1('0x34')],_0xea1c73['filters']));_0x55a06f[_0x19d1('0x3c')][_0x19d1('0x56')]=_0x19e12d['id'];if(_0x5c29e1[_0x19d1('0x34')][_0x19d1('0x3f')]){_0x55a06f[_0x19d1('0x3c')]=_[_0x19d1('0x40')](_0x55a06f[_0x19d1('0x3c')],{'$or':_[_0x19d1('0x2f')](_0x55a06f[_0x19d1('0x36')],function(_0x1eea5c){var _0x14847e={};_0x14847e[_0x1eea5c]={'$like':'%'+_0x5c29e1[_0x19d1('0x34')][_0x19d1('0x3f')]+'%'};return _0x14847e;})});}_0x55a06f=_['merge']({},_0x55a06f,_0x5c29e1[_0x19d1('0x42')]);return db[_0x19d1('0x54')][_0x19d1('0x57')](_0x55a06f);}})[_0x19d1('0x24')](function(_0x2c0db6){if(_0x2c0db6){return db[_0x19d1('0x58')][_0x19d1('0x59')]({'where':{'id':_[_0x19d1('0x2f')](_0x2c0db6,_0x19d1('0x5a')),'role':'agent'},'attributes':['id','name',_0x19d1('0x5b'),_0x19d1('0x5c'),_0x19d1('0x5d')]});}})[_0x19d1('0x24')](function(_0x5354fd){if(_0x5354fd){return{'count':_0x5354fd['count'],'rows':_[_0x19d1('0x2f')](_0x5354fd[_0x19d1('0x46')],function(_0x98704f){return{'membername':_0x98704f['name'],'UserId':_0x98704f['id'],'queue_name':_0x12e754[_0x19d1('0x2c')],'MailQueueId':_0x12e754['id'],'interface':util['format'](_0x19d1('0x5e'),_0x19d1('0x5f'),_0x98704f[_0x19d1('0x2c')]),'penalty':0x0,'paused':_0x98704f[_0x19d1('0x5b')],'createdAt':_0x98704f[_0x19d1('0x5d')],'updatedAt':_0x98704f[_0x19d1('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x19d1('0x24')](respondWithFilteredResult(_0x23689e,_0x55a06f))['catch'](handleError(_0x23689e,null));};exports[_0x19d1('0x60')]=function(_0x148d91,_0x5c8890,_0xb2cf3f){var _0x2d5db8={};var _0x16e659={};var _0x46f059;var _0x15dd7a;return db[_0x19d1('0x43')][_0x19d1('0x53')]({'where':{'id':_0x148d91[_0x19d1('0x48')]['id']}})[_0x19d1('0x24')](handleEntityNotFound(_0x5c8890,null))[_0x19d1('0x24')](function(_0x206c7c){if(_0x206c7c){_0x46f059=_0x206c7c;_0x16e659[_0x19d1('0x33')]=_[_0x19d1('0x55')](db['Team']['rawAttributes']);_0x16e659[_0x19d1('0x34')]=_[_0x19d1('0x55')](_0x148d91['query']);_0x16e659[_0x19d1('0x3d')]=_['intersection'](_0x16e659[_0x19d1('0x33')],_0x16e659[_0x19d1('0x34')]);_0x2d5db8[_0x19d1('0x36')]=_[_0x19d1('0x35')](_0x16e659[_0x19d1('0x33')],qs[_0x19d1('0x37')](_0x148d91[_0x19d1('0x34')][_0x19d1('0x37')]));_0x2d5db8[_0x19d1('0x36')]=_0x2d5db8[_0x19d1('0x36')]['length']?_0x2d5db8[_0x19d1('0x36')]:_0x16e659['model'];_0x2d5db8[_0x19d1('0x3a')]=qs[_0x19d1('0x3b')](_0x148d91[_0x19d1('0x34')][_0x19d1('0x3b')]);_0x2d5db8[_0x19d1('0x3c')]=qs[_0x19d1('0x3d')](_[_0x19d1('0x3e')](_0x148d91['query'],_0x16e659[_0x19d1('0x3d')]));if(_0x148d91[_0x19d1('0x34')][_0x19d1('0x3f')]){_0x2d5db8[_0x19d1('0x3c')]=_[_0x19d1('0x40')](_0x2d5db8[_0x19d1('0x3c')],{'$or':_[_0x19d1('0x2f')](_0x2d5db8[_0x19d1('0x36')],function(_0x362a8c){var _0x549788={};_0x549788[_0x362a8c]={'$like':'%'+_0x148d91[_0x19d1('0x34')]['filter']+'%'};return _0x549788;})});}_0x2d5db8=_['merge']({},_0x2d5db8,_0x148d91['options']);return _0x46f059['getTeams'](_0x2d5db8);}})[_0x19d1('0x24')](function(_0xcb7fa0){if(_0xcb7fa0){_0x15dd7a=_0xcb7fa0[_0x19d1('0x38')];if(!_0x148d91[_0x19d1('0x34')][_0x19d1('0x61')]('nolimit')){_0x2d5db8[_0x19d1('0x20')]=qs[_0x19d1('0x20')](_0x148d91[_0x19d1('0x34')][_0x19d1('0x20')]);_0x2d5db8[_0x19d1('0x1f')]=qs[_0x19d1('0x1f')](_0x148d91[_0x19d1('0x34')][_0x19d1('0x1f')]);}return _0x46f059['getTeams'](_0x2d5db8);}})[_0x19d1('0x24')](function(_0x4c7b77){if(_0x4c7b77){return _0x4c7b77?{'count':_0x15dd7a,'rows':_0x4c7b77}:null;}})[_0x19d1('0x24')](respondWithResult(_0x5c8890,null))[_0x19d1('0x4f')](handleError(_0x5c8890,null));};exports[_0x19d1('0x62')]=function(_0x4e0484,_0x56eef2,_0x3ac9a4){var _0x3fb28e=_0x4e0484[_0x19d1('0x4b')][_0x19d1('0x63')];return db['Team'][_0x19d1('0x57')]({'where':{'id':_0x3fb28e},'attributes':['id'],'include':[{'model':db[_0x19d1('0x58')],'as':_0x19d1('0x64'),'attributes':['id',_0x19d1('0x2c'),_0x19d1('0x65'),_0x19d1('0x66'),_0x19d1('0x67')],'raw':!![]}]})[_0x19d1('0x24')](function(_0x53a8d2){if(_0x53a8d2){var _0x2f164d=_[_0x19d1('0x68')](_0x53a8d2,function(_0x12b1c4){var _0x1578b9=_0x12b1c4['get']({'plain':!![]});return _0x1578b9[_0x19d1('0x64')];});return db[_0x19d1('0x43')][_0x19d1('0x49')]({'where':{'id':_0x4e0484['params']['id']}})[_0x19d1('0x24')](function(_0x967ce1){return db[_0x19d1('0x69')][_0x19d1('0x6a')](function(_0x20a004){return _0x967ce1['addTeams'](_0x3fb28e,{'transaction':_0x20a004})[_0x19d1('0x24')](function(){return BPromise[_0x19d1('0x6b')](_0x2f164d,function(_0x5700ac){return db[_0x19d1('0x54')]['findOrCreate']({'where':{'UserId':_0x5700ac['id'],'MailQueueId':_0x4e0484['params']['id']},'transaction':_0x20a004});});})[_0x19d1('0x24')](function(){_0x2f164d[_0x19d1('0x6c')](function(_0x30427a){socket[_0x19d1('0x6d')](_0x19d1('0x6e'),{'UserId':_0x30427a['id'],'MailQueueId':_0x967ce1['id']});});});});});}})['then'](respondWithStatusCode(_0x56eef2,null))[_0x19d1('0x4f')](handleError(_0x56eef2,null));};exports[_0x19d1('0x6f')]=function(_0x283a22,_0x311e7b,_0x58bfea){return db[_0x19d1('0x70')]['findAll']({'where':{'id':_0x283a22['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x19d1('0x64'),'attributes':['id'],'raw':!![]}]})[_0x19d1('0x24')](handleEntityNotFound(_0x311e7b,null))[_0x19d1('0x24')](function(_0x1ceca6){var _0xe84d10=_[_0x19d1('0x2f')](_0x1ceca6,'id');var _0x6a05df=[];var _0x36d7cb=[];var _0x45de21=squel[_0x19d1('0x71')]();_0x45de21[_0x19d1('0x72')]('tq.TeamId')[_0x19d1('0x73')](_0x19d1('0x74'),'tq')[_0x19d1('0x75')]('user_has_teams','ut',_0x19d1('0x76'))[_0x19d1('0x3c')](_0x19d1('0x77'),_0x283a22[_0x19d1('0x48')]['id']);for(var _0x3e37ed=0x0;_0x3e37ed<_0x1ceca6[_0x19d1('0x38')];_0x3e37ed+=0x1){let _0x2c3202=_0x1ceca6[_0x3e37ed];for(var _0x2fc483=0x0;_0x2fc483<_0x2c3202['Agents'][_0x19d1('0x38')];_0x2fc483+=0x1){let _0x37eabd=_0x2c3202[_0x19d1('0x64')][_0x2fc483];var _0x2d98cb=_0x45de21[_0x19d1('0x78')]();_0x2d98cb[_0x19d1('0x3c')](_0x19d1('0x79'),_0x37eabd['id']);_0x36d7cb['push'](db[_0x19d1('0x69')][_0x19d1('0x34')](_0x2d98cb[_0x19d1('0x7a')](),{'type':db['sequelize']['QueryTypes'][_0x19d1('0x7b')]})[_0x19d1('0x24')](function(_0x3961e2){if(_0x3961e2[_0x19d1('0x38')]===0x1){return _0x37eabd['id'];}else{var _0x542568=_[_0x19d1('0x7c')](_[_0x19d1('0x2f')](_0x3961e2,_0x19d1('0x7d')),function(_0x4e71d5){return _[_0x19d1('0x7e')](_0xe84d10,_0x4e71d5);});if(_0x542568){return _0x37eabd['id'];}}}));}}return BPromise[_0x19d1('0x7f')](_0x36d7cb)[_0x19d1('0x24')](function(_0x30c1ee){_0x6a05df=_(_0x6a05df)[_0x19d1('0x80')](_0x30c1ee)[_0x19d1('0x81')]()[_0x19d1('0x82')]();return db[_0x19d1('0x43')][_0x19d1('0x49')]({'where':{'id':_0x283a22[_0x19d1('0x48')]['id']}})[_0x19d1('0x24')](function(_0x1e1717){return db['sequelize'][_0x19d1('0x6a')](function(_0x5b1da5){return _0x1e1717[_0x19d1('0x6f')](_0x283a22['query'][_0x19d1('0x63')],{'transaction':_0x5b1da5})[_0x19d1('0x24')](function(){if(!_[_0x19d1('0x83')](_0x6a05df)){return _0x1e1717[_0x19d1('0x84')](_0x6a05df,{'transaction':_0x5b1da5});}})['then'](function(){_0x6a05df[_0x19d1('0x6c')](function(_0x267cfe){socket[_0x19d1('0x6d')]('userMailQueue:remove',{'UserId':_0x267cfe,'MailQueueId':_0x1e1717['id']});});});});});});})['then'](respondWithStatusCode(_0x311e7b,null))['catch'](handleError(_0x311e7b,null));};exports[_0x19d1('0x85')]=function(_0x55b8b0,_0x553dde,_0x390639){return db[_0x19d1('0x43')][_0x19d1('0x49')]({'where':{'id':_0x55b8b0[_0x19d1('0x48')]['id']}})[_0x19d1('0x24')](handleEntityNotFound(_0x553dde,null))['then'](function(_0x20f05d){if(_0x20f05d){return _0x20f05d[_0x19d1('0x85')](_0x55b8b0[_0x19d1('0x4b')][_0x19d1('0x63')],_[_0x19d1('0x86')](_0x55b8b0[_0x19d1('0x4b')],[_0x19d1('0x63'),'id'])||{})[_0x19d1('0x87')](function(_0x4eca2f){for(var _0x39fe2e=0x0;_0x39fe2e<_0x55b8b0['body'][_0x19d1('0x63')][_0x19d1('0x38')];_0x39fe2e+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x55b8b0[_0x19d1('0x4b')]['ids'][_0x39fe2e]),'MailQueueId':Number(_0x55b8b0['params']['id'])});}return _0x4eca2f;});}})[_0x19d1('0x24')](respondWithResult(_0x553dde,null))[_0x19d1('0x4f')](handleError(_0x553dde,null));};exports[_0x19d1('0x84')]=function(_0x50c79f,_0x207963,_0x37d615){return db['MailQueue'][_0x19d1('0x49')]({'where':{'id':_0x50c79f[_0x19d1('0x48')]['id']}})['then'](handleEntityNotFound(_0x207963,null))[_0x19d1('0x24')](function(_0x1d7809){if(_0x1d7809){return _0x1d7809[_0x19d1('0x84')](_0x50c79f['query'][_0x19d1('0x63')])[_0x19d1('0x24')](function(){if(_[_0x19d1('0x88')](_0x50c79f[_0x19d1('0x34')]['ids'])){for(var _0x4ed098=0x0;_0x4ed098<_0x50c79f[_0x19d1('0x34')][_0x19d1('0x63')][_0x19d1('0x38')];_0x4ed098+=0x1){socket[_0x19d1('0x6d')](_0x19d1('0x89'),{'UserId':Number(_0x50c79f[_0x19d1('0x34')][_0x19d1('0x63')][_0x4ed098]),'MailQueueId':Number(_0x50c79f[_0x19d1('0x48')]['id'])});}}else{socket[_0x19d1('0x6d')](_0x19d1('0x89'),{'UserId':Number(_0x50c79f[_0x19d1('0x34')]['ids']),'MailQueueId':Number(_0x50c79f[_0x19d1('0x48')]['id'])});}});}})[_0x19d1('0x24')](respondWithStatusCode(_0x207963,null))[_0x19d1('0x4f')](handleError(_0x207963,null));};exports[_0x19d1('0x8a')]=function(_0x3f4aae,_0x12cdfe,_0x42ec2b){var _0x2a86f5={};var _0x3bfa9f={};var _0x57f24d;var _0x4b15f4;return db[_0x19d1('0x43')][_0x19d1('0x53')]({'where':{'id':_0x3f4aae[_0x19d1('0x48')]['id']}})[_0x19d1('0x24')](handleEntityNotFound(_0x12cdfe,null))['then'](function(_0x3b0813){if(_0x3b0813){_0x57f24d=_0x3b0813;_0x3bfa9f[_0x19d1('0x33')]=_[_0x19d1('0x55')](db['User']['rawAttributes']);_0x3bfa9f[_0x19d1('0x34')]=_[_0x19d1('0x55')](_0x3f4aae[_0x19d1('0x34')]);_0x3bfa9f[_0x19d1('0x3d')]=_['intersection'](_0x3bfa9f['model'],_0x3bfa9f[_0x19d1('0x34')]);_0x2a86f5[_0x19d1('0x36')]=_[_0x19d1('0x35')](_0x3bfa9f[_0x19d1('0x33')],qs['fields'](_0x3f4aae[_0x19d1('0x34')][_0x19d1('0x37')]));_0x2a86f5[_0x19d1('0x36')]=_0x2a86f5['attributes']['length']?_0x2a86f5[_0x19d1('0x36')]:_0x3bfa9f[_0x19d1('0x33')];_0x2a86f5[_0x19d1('0x3a')]=qs['sort'](_0x3f4aae[_0x19d1('0x34')][_0x19d1('0x3b')]);_0x2a86f5[_0x19d1('0x3c')]=qs[_0x19d1('0x3d')](_['pick'](_0x3f4aae['query'],_0x3bfa9f[_0x19d1('0x3d')]));if(_0x3f4aae[_0x19d1('0x34')][_0x19d1('0x3f')]){_0x2a86f5[_0x19d1('0x3c')]=_[_0x19d1('0x40')](_0x2a86f5[_0x19d1('0x3c')],{'$or':_[_0x19d1('0x2f')](_0x2a86f5[_0x19d1('0x36')],function(_0x54a39e){var _0x2f4054={};_0x2f4054[_0x54a39e]={'$like':'%'+_0x3f4aae[_0x19d1('0x34')]['filter']+'%'};return _0x2f4054;})});}_0x2a86f5=_[_0x19d1('0x40')]({},_0x2a86f5,_0x3f4aae[_0x19d1('0x42')]);return _0x57f24d[_0x19d1('0x8a')](_0x2a86f5);}})[_0x19d1('0x24')](function(_0x2b4a6a){if(_0x2b4a6a){_0x4b15f4=_0x2b4a6a['length'];if(!_0x3f4aae[_0x19d1('0x34')][_0x19d1('0x61')](_0x19d1('0x39'))){_0x2a86f5['limit']=qs[_0x19d1('0x20')](_0x3f4aae[_0x19d1('0x34')][_0x19d1('0x20')]);_0x2a86f5[_0x19d1('0x1f')]=qs['offset'](_0x3f4aae['query'][_0x19d1('0x1f')]);}return _0x57f24d[_0x19d1('0x8a')](_0x2a86f5);}})[_0x19d1('0x24')](function(_0x1151fb){if(_0x1151fb){return _0x1151fb?{'count':_0x4b15f4,'rows':_0x1151fb}:null;}})[_0x19d1('0x24')](respondWithResult(_0x12cdfe,null))[_0x19d1('0x4f')](handleError(_0x12cdfe,null));};
\ No newline at end of file
index 1455e19..f77f3fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4b9=['emit','exports','events','../../mysqldb','MailQueue','save','update','remove'];(function(_0x4244f6,_0x5ae824){var _0x2f4b3=function(_0x4363b8){while(--_0x4363b8){_0x4244f6['push'](_0x4244f6['shift']());}};_0x2f4b3(++_0x5ae824);}(_0xf4b9,0x1da));var _0x9f4b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf4b9[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0x9f4b('0x0'));var MailQueue=require(_0x9f4b('0x1'))['db'][_0x9f4b('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9f4b('0x3'),'afterUpdate':_0x9f4b('0x4'),'afterDestroy':_0x9f4b('0x5')};function emitEvent(_0x4a45e8){return function(_0x40baa6,_0x29916c,_0x435d7f){MailQueueEvents[_0x9f4b('0x6')](_0x4a45e8+':'+_0x40baa6['id'],_0x40baa6);MailQueueEvents['emit'](_0x4a45e8,_0x40baa6);_0x435d7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x9f4b('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0x1757=['exports','events','../../mysqldb','MailQueue','save','update','remove','hasOwnProperty','hook'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0x1757,0x19f));var _0x7175=function(_0x341fd1,_0x55dcb8){_0x341fd1=_0x341fd1-0x0;var _0x1a9391=_0x1757[_0x341fd1];return _0x1a9391;};'use strict';var EventEmitter=require(_0x7175('0x0'));var MailQueue=require(_0x7175('0x1'))['db'][_0x7175('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7175('0x3'),'afterUpdate':_0x7175('0x4'),'afterDestroy':_0x7175('0x5')};function emitEvent(_0x1f48fe){return function(_0x1ea723,_0x5f5bee,_0x52d550){MailQueueEvents['emit'](_0x1f48fe+':'+_0x1ea723['id'],_0x1ea723);MailQueueEvents['emit'](_0x1f48fe,_0x1ea723);_0x52d550(null);};}for(var e in events){if(events[_0x7175('0x6')](e)){var event=events[e];MailQueue[_0x7175('0x7')](e,emitEvent(event));}}module[_0x7175('0x8')]=MailQueueEvents;
\ No newline at end of file
index a6ad66b..5f3aaea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf41=['MailQueue','mail_queues','util','../../config/logger','api','bluebird','path','rimraf','./mailQueue.attributes','exports','define'];(function(_0x1d882d,_0x53b8ea){var _0x75058=function(_0x4ce5a9){while(--_0x4ce5a9){_0x1d882d['push'](_0x1d882d['shift']());}};_0x75058(++_0x53b8ea);}(_0xdf41,0x86));var _0x1df4=function(_0x247948,_0x10a562){_0x247948=_0x247948-0x0;var _0x8ec99e=_0xdf41[_0x247948];return _0x8ec99e;};'use strict';var _=require('lodash');var util=require(_0x1df4('0x0'));var logger=require(_0x1df4('0x1'))(_0x1df4('0x2'));var moment=require('moment');var BPromise=require(_0x1df4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1df4('0x4'));var rimraf=require(_0x1df4('0x5'));var config=require('../../config/environment');var attributes=require(_0x1df4('0x6'));module[_0x1df4('0x7')]=function(_0x15ce4c,_0x33d39d){return _0x15ce4c[_0x1df4('0x8')](_0x1df4('0x9'),attributes,{'tableName':_0x1df4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x08c9=['define','MailQueue','mail_queues','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x36098d,_0x1d2870){var _0x2cb9d9=function(_0x212b7e){while(--_0x212b7e){_0x36098d['push'](_0x36098d['shift']());}};_0x2cb9d9(++_0x1d2870);}(_0x08c9,0xb3));var _0x908c=function(_0x3b32c4,_0x5b8b9b){_0x3b32c4=_0x3b32c4-0x0;var _0x38f622=_0x08c9[_0x3b32c4];return _0x38f622;};'use strict';var _=require(_0x908c('0x0'));var util=require('util');var logger=require(_0x908c('0x1'))('api');var moment=require(_0x908c('0x2'));var BPromise=require(_0x908c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x908c('0x4'));var config=require(_0x908c('0x5'));var attributes=require(_0x908c('0x6'));module[_0x908c('0x7')]=function(_0x489344,_0x139af1){return _0x489344[_0x908c('0x8')](_0x908c('0x9'),attributes,{'tableName':_0x908c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 324d4a9..8a19716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41d2=['code','message','info','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailQueue.socket','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb7f306,_0x1c76dd){var _0x1198dc=function(_0x1b82e6){while(--_0x1b82e6){_0xb7f306['push'](_0xb7f306['shift']());}};_0x1198dc(++_0x1c76dd);}(_0x41d2,0x138));var _0x241d=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0x41d2[_0x2077c2];return _0x312f9f;};'use strict';var _=require(_0x241d('0x0'));var util=require(_0x241d('0x1'));var moment=require(_0x241d('0x2'));var BPromise=require(_0x241d('0x3'));var rs=require(_0x241d('0x4'));var fs=require('fs');var Redis=require(_0x241d('0x5'));var db=require(_0x241d('0x6'))['db'];var utils=require(_0x241d('0x7'));var logger=require(_0x241d('0x8'))(_0x241d('0x9'));var config=require('../../config/environment');var jayson=require(_0x241d('0xa'));var client=jayson[_0x241d('0xb')][_0x241d('0xc')]({'port':0x232a});config['redis']=_[_0x241d('0xd')](config[_0x241d('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x241d('0xf'))(new Redis(config[_0x241d('0xe')]));require(_0x241d('0x10'))['register'](socket);function respondWithRpcPromise(_0x3d3da5,_0x37ba17,_0x2e943c){return new BPromise(function(_0xbae080,_0x60d8c9){return client[_0x241d('0x11')](_0x3d3da5,_0x2e943c)['then'](function(_0x16944f){logger['info'](_0x241d('0x12'),_0x37ba17,_0x241d('0x13'));logger[_0x241d('0x14')](_0x241d('0x15'),_0x37ba17,'request\x20sent',JSON[_0x241d('0x16')](_0x16944f));if(_0x16944f['error']){if(_0x16944f[_0x241d('0x17')][_0x241d('0x18')]===0x1f4){logger[_0x241d('0x17')](_0x241d('0x12'),_0x37ba17,_0x16944f[_0x241d('0x17')][_0x241d('0x19')]);return _0x60d8c9(_0x16944f[_0x241d('0x17')][_0x241d('0x19')]);}logger['error'](_0x241d('0x12'),_0x37ba17,_0x16944f[_0x241d('0x17')][_0x241d('0x19')]);return _0xbae080(_0x16944f[_0x241d('0x17')][_0x241d('0x19')]);}else{logger[_0x241d('0x1a')]('MailQueue,\x20%s,\x20%s',_0x37ba17,'request\x20sent');_0xbae080(_0x16944f[_0x241d('0x1b')][_0x241d('0x19')]);}})[_0x241d('0x1c')](function(_0xe34e86){logger[_0x241d('0x17')]('MailQueue,\x20%s,\x20%s',_0x37ba17,_0xe34e86);_0x60d8c9(_0xe34e86);});});}exports[_0x241d('0x1d')]=function(_0x421ce0){var _0x20f8d2=this;return new Promise(function(_0x3a7f50,_0x1e2274){return db['MailQueue'][_0x241d('0x1e')]({'raw':_0x421ce0['options']?_0x421ce0[_0x241d('0x1f')][_0x241d('0x20')]===undefined?!![]:![]:!![],'where':_0x421ce0[_0x241d('0x1f')]?_0x421ce0[_0x241d('0x1f')][_0x241d('0x21')]||null:null,'attributes':_0x421ce0[_0x241d('0x1f')]?_0x421ce0[_0x241d('0x1f')][_0x241d('0x22')]||null:null,'limit':_0x421ce0[_0x241d('0x1f')]?_0x421ce0['options'][_0x241d('0x23')]||null:null,'include':_0x421ce0['options']?_0x421ce0[_0x241d('0x1f')]['include']?_[_0x241d('0x24')](_0x421ce0[_0x241d('0x1f')][_0x241d('0x25')],function(_0x314bd8){return{'model':db[_0x314bd8[_0x241d('0x26')]],'as':_0x314bd8['as'],'attributes':_0x314bd8[_0x241d('0x22')],'include':_0x314bd8[_0x241d('0x25')]?_[_0x241d('0x24')](_0x314bd8['include'],function(_0x3ec710){return{'model':db[_0x3ec710[_0x241d('0x26')]],'as':_0x3ec710['as'],'attributes':_0x3ec710['attributes'],'include':_0x3ec710['include']?_[_0x241d('0x24')](_0x3ec710[_0x241d('0x25')],function(_0x5d93df){return{'model':db[_0x5d93df[_0x241d('0x26')]],'as':_0x5d93df['as'],'attributes':_0x5d93df[_0x241d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x241d('0x27')](function(_0xe721a6){logger[_0x241d('0x1a')]('GetMailQueue',_0x421ce0);logger['debug'](_0x241d('0x1d'),_0x421ce0,JSON[_0x241d('0x16')](_0xe721a6));_0x3a7f50(_0xe721a6);})[_0x241d('0x1c')](function(_0x13180e){logger[_0x241d('0x17')](_0x241d('0x1d'),_0x13180e[_0x241d('0x19')],_0x421ce0);_0x1e2274(_0x20f8d2['error'](0x1f4,_0x13180e[_0x241d('0x19')]));});});};exports[_0x241d('0x28')]=function(_0x3957d4){var _0x1f6126=this;return new Promise(function(_0x5b1312,_0x201002){return db['MailQueue'][_0x241d('0x29')]({'raw':_0x3957d4[_0x241d('0x1f')]?_0x3957d4[_0x241d('0x1f')][_0x241d('0x20')]===undefined?!![]:![]:!![],'where':_0x3957d4[_0x241d('0x1f')]?_0x3957d4[_0x241d('0x1f')][_0x241d('0x21')]||null:null,'attributes':_0x3957d4['options']?_0x3957d4['options'][_0x241d('0x22')]||null:null,'include':_0x3957d4['options']?_0x3957d4[_0x241d('0x1f')]['include']?_[_0x241d('0x24')](_0x3957d4[_0x241d('0x1f')][_0x241d('0x25')],function(_0x57ba0c){return{'model':db[_0x57ba0c['model']],'as':_0x57ba0c['as'],'attributes':_0x57ba0c[_0x241d('0x22')],'include':_0x57ba0c['include']?_['map'](_0x57ba0c['include'],function(_0x5cafd1){return{'model':db[_0x5cafd1[_0x241d('0x26')]],'as':_0x5cafd1['as'],'attributes':_0x5cafd1[_0x241d('0x22')],'include':_0x5cafd1[_0x241d('0x25')]?_[_0x241d('0x24')](_0x5cafd1[_0x241d('0x25')],function(_0x420bcf){return{'model':db[_0x420bcf['model']],'as':_0x420bcf['as'],'attributes':_0x420bcf['attributes']};}):[]};}):[]};}):[]:[]})[_0x241d('0x27')](function(_0x3846fa){logger[_0x241d('0x1a')]('ShowMailQueue',_0x3957d4);logger[_0x241d('0x14')](_0x241d('0x28'),_0x3957d4,JSON[_0x241d('0x16')](_0x3846fa));_0x5b1312(_0x3846fa);})[_0x241d('0x1c')](function(_0x2f6c59){logger[_0x241d('0x17')](_0x241d('0x28'),_0x2f6c59[_0x241d('0x19')],_0x3957d4);_0x201002(_0x1f6126[_0x241d('0x17')](0x1f4,_0x2f6c59['message']));});});};
\ No newline at end of file
+var _0x3df4=['map','model','stringify','ShowMailQueue','find','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','request\x20sent','debug','error','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','MailQueue','options','raw','attributes','include'];(function(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0x3df4,0x102));var _0x43df=function(_0x34ce2f,_0x5d48ff){_0x34ce2f=_0x34ce2f-0x0;var _0x58daf0=_0x3df4[_0x34ce2f];return _0x58daf0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43df('0x0'));var BPromise=require(_0x43df('0x1'));var rs=require(_0x43df('0x2'));var fs=require('fs');var Redis=require(_0x43df('0x3'));var db=require(_0x43df('0x4'))['db'];var utils=require(_0x43df('0x5'));var logger=require(_0x43df('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x43df('0x7'));var client=jayson[_0x43df('0x8')][_0x43df('0x9')]({'port':0x232a});config[_0x43df('0xa')]=_['defaults'](config['redis'],{'host':_0x43df('0xb'),'port':0x18eb});var socket=require(_0x43df('0xc'))(new Redis(config[_0x43df('0xa')]));require(_0x43df('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ed094,_0x4c5eaf,_0x15f2b0){return new BPromise(function(_0x694bb9,_0xc90b79){return client[_0x43df('0xe')](_0x1ed094,_0x15f2b0)[_0x43df('0xf')](function(_0x28c326){logger[_0x43df('0x10')]('MailQueue,\x20%s,\x20%s',_0x4c5eaf,_0x43df('0x11'));logger[_0x43df('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x4c5eaf,_0x43df('0x11'),JSON['stringify'](_0x28c326));if(_0x28c326[_0x43df('0x13')]){if(_0x28c326[_0x43df('0x13')]['code']===0x1f4){logger[_0x43df('0x13')]('MailQueue,\x20%s,\x20%s',_0x4c5eaf,_0x28c326['error'][_0x43df('0x14')]);return _0xc90b79(_0x28c326[_0x43df('0x13')]['message']);}logger[_0x43df('0x13')]('MailQueue,\x20%s,\x20%s',_0x4c5eaf,_0x28c326[_0x43df('0x13')][_0x43df('0x14')]);return _0x694bb9(_0x28c326[_0x43df('0x13')][_0x43df('0x14')]);}else{logger[_0x43df('0x10')](_0x43df('0x15'),_0x4c5eaf,'request\x20sent');_0x694bb9(_0x28c326[_0x43df('0x16')][_0x43df('0x14')]);}})[_0x43df('0x17')](function(_0x45f137){logger['error'](_0x43df('0x15'),_0x4c5eaf,_0x45f137);_0xc90b79(_0x45f137);});});}exports[_0x43df('0x18')]=function(_0x121786){var _0x4ab87c=this;return new Promise(function(_0x560a39,_0x4303c5){return db[_0x43df('0x19')]['findAll']({'raw':_0x121786[_0x43df('0x1a')]?_0x121786[_0x43df('0x1a')][_0x43df('0x1b')]===undefined?!![]:![]:!![],'where':_0x121786['options']?_0x121786[_0x43df('0x1a')]['where']||null:null,'attributes':_0x121786[_0x43df('0x1a')]?_0x121786['options'][_0x43df('0x1c')]||null:null,'limit':_0x121786[_0x43df('0x1a')]?_0x121786[_0x43df('0x1a')]['limit']||null:null,'include':_0x121786[_0x43df('0x1a')]?_0x121786['options'][_0x43df('0x1d')]?_[_0x43df('0x1e')](_0x121786[_0x43df('0x1a')][_0x43df('0x1d')],function(_0x84521){return{'model':db[_0x84521[_0x43df('0x1f')]],'as':_0x84521['as'],'attributes':_0x84521[_0x43df('0x1c')],'include':_0x84521[_0x43df('0x1d')]?_[_0x43df('0x1e')](_0x84521[_0x43df('0x1d')],function(_0x2aa723){return{'model':db[_0x2aa723['model']],'as':_0x2aa723['as'],'attributes':_0x2aa723[_0x43df('0x1c')],'include':_0x2aa723[_0x43df('0x1d')]?_[_0x43df('0x1e')](_0x2aa723[_0x43df('0x1d')],function(_0x250fda){return{'model':db[_0x250fda[_0x43df('0x1f')]],'as':_0x250fda['as'],'attributes':_0x250fda[_0x43df('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x43df('0xf')](function(_0x1eed39){logger['info']('GetMailQueue',_0x121786);logger[_0x43df('0x12')](_0x43df('0x18'),_0x121786,JSON[_0x43df('0x20')](_0x1eed39));_0x560a39(_0x1eed39);})[_0x43df('0x17')](function(_0x2c6b4d){logger['error'](_0x43df('0x18'),_0x2c6b4d[_0x43df('0x14')],_0x121786);_0x4303c5(_0x4ab87c[_0x43df('0x13')](0x1f4,_0x2c6b4d[_0x43df('0x14')]));});});};exports[_0x43df('0x21')]=function(_0x228a27){var _0x2fe4f5=this;return new Promise(function(_0x2b72ef,_0x1a6ece){return db[_0x43df('0x19')][_0x43df('0x22')]({'raw':_0x228a27[_0x43df('0x1a')]?_0x228a27[_0x43df('0x1a')][_0x43df('0x1b')]===undefined?!![]:![]:!![],'where':_0x228a27['options']?_0x228a27['options'][_0x43df('0x23')]||null:null,'attributes':_0x228a27['options']?_0x228a27[_0x43df('0x1a')][_0x43df('0x1c')]||null:null,'include':_0x228a27[_0x43df('0x1a')]?_0x228a27[_0x43df('0x1a')]['include']?_[_0x43df('0x1e')](_0x228a27[_0x43df('0x1a')][_0x43df('0x1d')],function(_0x5071a4){return{'model':db[_0x5071a4[_0x43df('0x1f')]],'as':_0x5071a4['as'],'attributes':_0x5071a4[_0x43df('0x1c')],'include':_0x5071a4[_0x43df('0x1d')]?_[_0x43df('0x1e')](_0x5071a4['include'],function(_0xb5876b){return{'model':db[_0xb5876b[_0x43df('0x1f')]],'as':_0xb5876b['as'],'attributes':_0xb5876b[_0x43df('0x1c')],'include':_0xb5876b[_0x43df('0x1d')]?_[_0x43df('0x1e')](_0xb5876b[_0x43df('0x1d')],function(_0x5ed6f0){return{'model':db[_0x5ed6f0['model']],'as':_0x5ed6f0['as'],'attributes':_0x5ed6f0[_0x43df('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e7b51){logger['info']('ShowMailQueue',_0x228a27);logger[_0x43df('0x12')](_0x43df('0x21'),_0x228a27,JSON[_0x43df('0x20')](_0x4e7b51));_0x2b72ef(_0x4e7b51);})[_0x43df('0x17')](function(_0x48dd3c){logger[_0x43df('0x13')](_0x43df('0x21'),_0x48dd3c['message'],_0x228a27);_0x1a6ece(_0x2fe4f5[_0x43df('0x13')](0x1f4,_0x48dd3c[_0x43df('0x14')]));});});};
\ No newline at end of file
index e30b724..4d64b6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6da9=['removeListener','register','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x6da9,0x161));var _0x96da=function(_0x27d828,_0x50e021){_0x27d828=_0x27d828-0x0;var _0x4fc42d=_0x6da9[_0x27d828];return _0x4fc42d;};'use strict';var MailQueueEvents=require(_0x96da('0x0'));var events=[_0x96da('0x1'),_0x96da('0x2'),_0x96da('0x3')];function createListener(_0x2f8572,_0x1a6b56){return function(_0x39f5b6){_0x1a6b56['emit'](_0x2f8572,_0x39f5b6);};}function removeListener(_0x5d07cd,_0x4fd3b8){return function(){MailQueueEvents[_0x96da('0x4')](_0x5d07cd,_0x4fd3b8);};}exports[_0x96da('0x5')]=function(_0x26fdbb){for(var _0x5c4924=0x0,_0x1bc4b0=events['length'];_0x5c4924<_0x1bc4b0;_0x5c4924++){var _0x161249=events[_0x5c4924];var _0x45ee2f=createListener(_0x96da('0x6')+_0x161249,_0x26fdbb);MailQueueEvents['on'](_0x161249,_0x45ee2f);}};
\ No newline at end of file
+var _0x4e95=['remove','update','emit','mailQueue:','save'];(function(_0x37e775,_0x3bb1c6){var _0x3c1ab5=function(_0x2f2077){while(--_0x2f2077){_0x37e775['push'](_0x37e775['shift']());}};_0x3c1ab5(++_0x3bb1c6);}(_0x4e95,0xe0));var _0x54e9=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x4e95[_0x44bcb0];return _0xfaf881;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x54e9('0x0'),_0x54e9('0x1'),_0x54e9('0x2')];function createListener(_0x57aef1,_0x416691){return function(_0x1a7987){_0x416691[_0x54e9('0x3')](_0x57aef1,_0x1a7987);};}function removeListener(_0x2c8c0f,_0xacf8db){return function(){MailQueueEvents['removeListener'](_0x2c8c0f,_0xacf8db);};}exports['register']=function(_0x124328){for(var _0x2886d3=0x0,_0x53e07d=events['length'];_0x2886d3<_0x53e07d;_0x2886d3++){var _0xbc4af=events[_0x2886d3];var _0xbddc11=createListener(_0x54e9('0x4')+_0xbc4af,_0x124328);MailQueueEvents['on'](_0xbc4af,_0xbddc11);}};
\ No newline at end of file
index 380d9d3..c4d4a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fa4=['get','/describe','isAuthenticated','describe','/:id','show','post','create','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9fa4,0x1ba));var _0x49fa=function(_0x3b1a62,_0x4df7c4){_0x3b1a62=_0x3b1a62-0x0;var _0x5e9ab3=_0x9fa4[_0x3b1a62];return _0x5e9ab3;};'use strict';var multer=require('multer');var util=require(_0x49fa('0x0'));var path=require(_0x49fa('0x1'));var timeout=require('connect-timeout');var express=require(_0x49fa('0x2'));var router=express[_0x49fa('0x3')]();var fs_extra=require(_0x49fa('0x4'));var auth=require(_0x49fa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x49fa('0x6'));var controller=require(_0x49fa('0x7'));router[_0x49fa('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x49fa('0x8')](_0x49fa('0x9'),auth[_0x49fa('0xa')](),controller[_0x49fa('0xb')]);router[_0x49fa('0x8')](_0x49fa('0xc'),auth[_0x49fa('0xa')](),controller[_0x49fa('0xd')]);router[_0x49fa('0xe')]('/',auth[_0x49fa('0xa')](),controller[_0x49fa('0xf')]);router['put'](_0x49fa('0xc'),auth[_0x49fa('0xa')](),controller[_0x49fa('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x49fa('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x3736=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','path'];(function(_0x30b052,_0x1ff988){var _0x50cc88=function(_0x3e4c05){while(--_0x3e4c05){_0x30b052['push'](_0x30b052['shift']());}};_0x50cc88(++_0x1ff988);}(_0x3736,0x131));var _0x6373=function(_0x38305b,_0x1ea0e3){_0x38305b=_0x38305b-0x0;var _0xb1a5e3=_0x3736[_0x38305b];return _0xb1a5e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6373('0x0'));var timeout=require(_0x6373('0x1'));var express=require(_0x6373('0x2'));var router=express[_0x6373('0x3')]();var fs_extra=require(_0x6373('0x4'));var auth=require(_0x6373('0x5'));var interaction=require(_0x6373('0x6'));var config=require('../../config/environment');var controller=require(_0x6373('0x7'));router[_0x6373('0x8')]('/',auth[_0x6373('0x9')](),controller[_0x6373('0xa')]);router[_0x6373('0x8')](_0x6373('0xb'),auth[_0x6373('0x9')](),controller['describe']);router[_0x6373('0x8')](_0x6373('0xc'),auth['isAuthenticated'](),controller[_0x6373('0xd')]);router[_0x6373('0xe')]('/',auth[_0x6373('0x9')](),controller[_0x6373('0xf')]);router[_0x6373('0x10')](_0x6373('0xc'),auth[_0x6373('0x9')](),controller['update']);router[_0x6373('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1a470fd..75a3df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59b9=['DATE','moment','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x59b9,0x1bd));var _0x959b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x59b9[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x959b('0x0'));var Sequelize=require('sequelize');module[_0x959b('0x1')]={'uniqueid':{'type':Sequelize[_0x959b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x959b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x959b('0x3')]},'reason':{'type':Sequelize[_0x959b('0x2')]}};
\ No newline at end of file
+var _0x03e2=['STRING','DATE'];(function(_0x180552,_0x29ec8a){var _0x33f29=function(_0x341c08){while(--_0x341c08){_0x180552['push'](_0x180552['shift']());}};_0x33f29(++_0x29ec8a);}(_0x03e2,0x13c));var _0x203e=function(_0x11b05e,_0x144a80){_0x11b05e=_0x11b05e-0x0;var _0x276c25=_0x03e2[_0x11b05e];return _0x276c25;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x203e('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x203e('0x0')]},'joinAt':{'type':Sequelize[_0x203e('0x1')]},'leaveAt':{'type':Sequelize[_0x203e('0x1')]},'acceptAt':{'type':Sequelize[_0x203e('0x1')]},'exitAt':{'type':Sequelize[_0x203e('0x1')]},'reason':{'type':Sequelize[_0x203e('0x0')]}};
\ No newline at end of file
index 9ae75ed..ff176a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x2f1626,_0x53736b){var _0x4d65fe=function(_0x5a9f95){while(--_0x5a9f95){_0x2f1626['push'](_0x2f1626['shift']());}};_0x4d65fe(++_0x53736b);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['MailQueueReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));};
\ No newline at end of file
+var _0x0adf=['find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','MailQueueReport','count','includeAll','include','findAll','rows','catch','show','params','fields'];(function(_0xee1ec9,_0x2f0599){var _0x102a53=function(_0x4e5f7f){while(--_0x4e5f7f){_0xee1ec9['push'](_0xee1ec9['shift']());}};_0x102a53(++_0x2f0599);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x3d1f87,_0x4c14d7){_0x3d1f87=_0x3d1f87-0x0;var _0x4c4a98=_0x0adf[_0x3d1f87];return _0x4c4a98;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require(_0xf0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require(_0xf0ad('0x5'));var Mustache=require(_0xf0ad('0x6'));var util=require(_0xf0ad('0x7'));var path=require(_0xf0ad('0x8'));var sox=require(_0xf0ad('0x9'));var csv=require('to-csv');var ejs=require(_0xf0ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0x10'));var querystring=require(_0xf0ad('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require(_0xf0ad('0x16'))(_0xf0ad('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];function respondWithStatusCode(_0x3646a2,_0x238c3b){_0x238c3b=_0x238c3b||0xcc;return function(_0x597c40){if(_0x597c40){return _0x3646a2[_0xf0ad('0x1a')](_0x238c3b);}return _0x3646a2[_0xf0ad('0x1b')](_0x238c3b)['end']();};}function respondWithResult(_0x49df92,_0x5332e9){_0x5332e9=_0x5332e9||0xc8;return function(_0x221d7b){if(_0x221d7b){return _0x49df92['status'](_0x5332e9)[_0xf0ad('0x1c')](_0x221d7b);}};}function respondWithFilteredResult(_0x313ad6,_0xfa544c){return function(_0xfa829e){if(_0xfa829e){var _0x237dd9=typeof _0xfa544c['offset']===_0xf0ad('0x1d')&&typeof _0xfa544c[_0xf0ad('0x1e')]===_0xf0ad('0x1d');var _0x1c9fac=_0xfa829e['count'];var _0x4e9970=_0x237dd9?0x0:_0xfa544c[_0xf0ad('0x1f')];var _0x46fb20=_0x237dd9?_0xfa829e['count']:_0xfa544c[_0xf0ad('0x1f')]+_0xfa544c[_0xf0ad('0x1e')];var _0x9a95bf;if(_0x46fb20>=_0x1c9fac){_0x46fb20=_0x1c9fac;_0x9a95bf=0xc8;}else{_0x9a95bf=0xce;}_0x313ad6[_0xf0ad('0x1b')](_0x9a95bf);return _0x313ad6['set']('Content-Range',_0x4e9970+'-'+_0x46fb20+'/'+_0x1c9fac)[_0xf0ad('0x1c')](_0xfa829e);}return null;};}function patchUpdates(_0x2da425){return function(_0x37b968){try{jsonpatch[_0xf0ad('0x20')](_0x37b968,_0x2da425,!![]);}catch(_0x2ac8ba){return BPromise[_0xf0ad('0x21')](_0x2ac8ba);}return _0x37b968['save']();};}function saveUpdates(_0x33c95d,_0x16e62a){return function(_0x31635b){if(_0x31635b){return _0x31635b[_0xf0ad('0x22')](_0x33c95d)[_0xf0ad('0x23')](function(_0x88b47b){return _0x88b47b;});}return null;};}function removeEntity(_0xb91769,_0x276322){return function(_0x3fc97e){if(_0x3fc97e){return _0x3fc97e[_0xf0ad('0x24')]()[_0xf0ad('0x23')](function(){_0xb91769[_0xf0ad('0x1b')](0xcc)[_0xf0ad('0x25')]();});}};}function handleEntityNotFound(_0x456f81,_0x879f89){return function(_0x557f90){if(!_0x557f90){_0x456f81[_0xf0ad('0x1a')](0x194);}return _0x557f90;};}function handleError(_0x1507a3,_0x248794){_0x248794=_0x248794||0x1f4;return function(_0x7377d7){logger[_0xf0ad('0x26')](_0x7377d7[_0xf0ad('0x27')]);if(_0x7377d7['name']){delete _0x7377d7[_0xf0ad('0x28')];}_0x1507a3[_0xf0ad('0x1b')](_0x248794)[_0xf0ad('0x29')](_0x7377d7);};}exports[_0xf0ad('0x2a')]=function(_0x1b6880,_0x1ac25c){var _0x267b7a={},_0x1bee71={},_0x2386e8={'count':0x0,'rows':[]};var _0x39c46c=_[_0xf0ad('0x2b')](db['MailQueueReport'][_0xf0ad('0x2c')],function(_0x5f5115){return{'name':_0x5f5115[_0xf0ad('0x2d')],'type':_0x5f5115['type'][_0xf0ad('0x2e')]};});_0x1bee71[_0xf0ad('0x2f')]=_[_0xf0ad('0x2b')](_0x39c46c,_0xf0ad('0x28'));_0x1bee71[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x1b6880[_0xf0ad('0x30')]);_0x1bee71[_0xf0ad('0x32')]=_['intersection'](_0x1bee71['model'],_0x1bee71[_0xf0ad('0x30')]);_0x267b7a[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1bee71[_0xf0ad('0x2f')],qs['fields'](_0x1b6880[_0xf0ad('0x30')]['fields']));_0x267b7a[_0xf0ad('0x33')]=_0x267b7a['attributes'][_0xf0ad('0x35')]?_0x267b7a['attributes']:_0x1bee71[_0xf0ad('0x2f')];if(!_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x36')](_0xf0ad('0x37'))){_0x267b7a[_0xf0ad('0x1e')]=qs[_0xf0ad('0x1e')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x1e')]);_0x267b7a['offset']=qs[_0xf0ad('0x1f')](_0x1b6880['query'][_0xf0ad('0x1f')]);}_0x267b7a['order']=qs[_0xf0ad('0x38')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x38')]);_0x267b7a[_0xf0ad('0x39')]=qs[_0xf0ad('0x32')](_['pick'](_0x1b6880[_0xf0ad('0x30')],_0x1bee71[_0xf0ad('0x32')]),_0x39c46c);if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]){_0x267b7a[_0xf0ad('0x39')]=_[_0xf0ad('0x3b')](_0x267b7a[_0xf0ad('0x39')],{'$or':_['map'](_0x39c46c,function(_0x2e0c7a){if(_0x2e0c7a[_0xf0ad('0x3c')]!==_0xf0ad('0x3d')){var _0x189f67={};_0x189f67[_0x2e0c7a[_0xf0ad('0x28')]]={'$like':'%'+_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]+'%'};return _0x189f67;}})});}_0x267b7a=_[_0xf0ad('0x3b')]({},_0x267b7a,_0x1b6880[_0xf0ad('0x3e')]);var _0x5dd631={'where':_0x267b7a[_0xf0ad('0x39')]};return db[_0xf0ad('0x3f')][_0xf0ad('0x40')](_0x5dd631)['then'](function(_0x510f54){_0x2386e8['count']=_0x510f54;if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x267b7a[_0xf0ad('0x42')]=[{'all':!![]}];}return db[_0xf0ad('0x3f')][_0xf0ad('0x43')](_0x267b7a);})[_0xf0ad('0x23')](function(_0x39083d){_0x2386e8[_0xf0ad('0x44')]=_0x39083d;return _0x2386e8;})[_0xf0ad('0x23')](respondWithFilteredResult(_0x1ac25c,_0x267b7a))[_0xf0ad('0x45')](handleError(_0x1ac25c,null));};exports[_0xf0ad('0x46')]=function(_0x516a72,_0x4ea947){var _0x5cd1dc={'raw':!![],'where':{'id':_0x516a72[_0xf0ad('0x47')]['id']}},_0x1c0609={};_0x1c0609['model']=_[_0xf0ad('0x31')](db[_0xf0ad('0x3f')]['rawAttributes']);_0x1c0609[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x516a72[_0xf0ad('0x30')]);_0x1c0609[_0xf0ad('0x32')]=_['intersection'](_0x1c0609[_0xf0ad('0x2f')],_0x1c0609[_0xf0ad('0x30')]);_0x5cd1dc[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1c0609[_0xf0ad('0x2f')],qs[_0xf0ad('0x48')](_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x48')]));_0x5cd1dc[_0xf0ad('0x33')]=_0x5cd1dc[_0xf0ad('0x33')][_0xf0ad('0x35')]?_0x5cd1dc['attributes']:_0x1c0609[_0xf0ad('0x2f')];if(_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x5cd1dc['include']=[{'all':!![]}];}_0x5cd1dc=_['merge']({},_0x5cd1dc,_0x516a72[_0xf0ad('0x3e')]);return db[_0xf0ad('0x3f')][_0xf0ad('0x49')](_0x5cd1dc)[_0xf0ad('0x23')](handleEntityNotFound(_0x4ea947,null))[_0xf0ad('0x23')](respondWithResult(_0x4ea947,null))[_0xf0ad('0x45')](handleError(_0x4ea947,null));};exports[_0xf0ad('0x4a')]=function(_0x561f2a,_0x1e35ce){return db['MailQueueReport'][_0xf0ad('0x4a')](_0x561f2a[_0xf0ad('0x4b')],{})[_0xf0ad('0x23')](respondWithResult(_0x1e35ce,0xc9))[_0xf0ad('0x45')](handleError(_0x1e35ce,null));};exports[_0xf0ad('0x22')]=function(_0x5b18a7,_0x4e8ef5){if(_0x5b18a7[_0xf0ad('0x4b')]['id']){delete _0x5b18a7[_0xf0ad('0x4b')]['id'];}return db[_0xf0ad('0x3f')][_0xf0ad('0x49')]({'where':{'id':_0x5b18a7[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x4e8ef5,null))[_0xf0ad('0x23')](saveUpdates(_0x5b18a7['body'],null))[_0xf0ad('0x23')](respondWithResult(_0x4e8ef5,null))[_0xf0ad('0x45')](handleError(_0x4e8ef5,null));};exports[_0xf0ad('0x24')]=function(_0xda0e52,_0x2cb082){return db['MailQueueReport'][_0xf0ad('0x49')]({'where':{'id':_0xda0e52[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x2cb082,null))[_0xf0ad('0x23')](removeEntity(_0x2cb082,null))[_0xf0ad('0x45')](handleError(_0x2cb082,null));};exports[_0xf0ad('0x4c')]=function(_0x3d156d,_0x5e75d0){return db[_0xf0ad('0x3f')][_0xf0ad('0x4c')]()[_0xf0ad('0x23')](respondWithResult(_0x5e75d0,null))['catch'](handleError(_0x5e75d0,null));};
\ No newline at end of file
index 3602c75..b6291b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfded=['define','report_mail_queue','uniqueid','moment','bluebird','request-promise','rimraf','./mailQueueReport.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfded,0x1c5));var _0xdfde=function(_0x352108,_0xb5cdc3){_0x352108=_0x352108-0x0;var _0x2c901c=_0xfded[_0x352108];return _0x2c901c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdfde('0x0'));var BPromise=require(_0xdfde('0x1'));var rp=require(_0xdfde('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdfde('0x3'));var config=require('../../config/environment');var attributes=require(_0xdfde('0x4'));module[_0xdfde('0x5')]=function(_0xcce2dc,_0x15af61){return _0xcce2dc[_0xdfde('0x6')]('MailQueueReport',attributes,{'tableName':_0xdfde('0x7'),'paranoid':![],'indexes':[{'name':_0xdfde('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdeac=['exports','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xdeac,0xfa));var _0xcdea=function(_0x54ac20,_0x3a5081){_0x54ac20=_0x54ac20-0x0;var _0x56e273=_0xdeac[_0x54ac20];return _0x56e273;};'use strict';var _=require(_0xcdea('0x0'));var util=require(_0xcdea('0x1'));var logger=require(_0xcdea('0x2'))(_0xcdea('0x3'));var moment=require(_0xcdea('0x4'));var BPromise=require(_0xcdea('0x5'));var rp=require(_0xcdea('0x6'));var fs=require('fs');var path=require(_0xcdea('0x7'));var rimraf=require(_0xcdea('0x8'));var config=require(_0xcdea('0x9'));var attributes=require('./mailQueueReport.attributes');module[_0xcdea('0xa')]=function(_0x238489,_0x2ae602){return _0x238489['define'](_0xcdea('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xcdea('0xc'),'fields':[_0xcdea('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index eac147c..c33eb4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x29a8d9,_0x596abb){var _0x40e6a3=function(_0x3ba70b){while(--_0x3ba70b){_0x29a8d9['push'](_0x29a8d9['shift']());}};_0x40e6a3(++_0x596abb);}(_0xdb28,0x106));var _0x8db2=function(_0x5859cf,_0x3f2d36){_0x5859cf=_0x5859cf-0x0;var _0x16a186=_0xdb28[_0x5859cf];return _0x16a186;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});};
\ No newline at end of file
+var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xdb28,0x106));var _0x8db2=function(_0x1d228a,_0x2b9fa7){_0x1d228a=_0x1d228a-0x0;var _0xa57e6e=_0xdb28[_0x1d228a];return _0xa57e6e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});};
\ No newline at end of file
index 60ff72e..8994eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2472a6,_0x5f2d82){var _0x5c04b9=function(_0x184f77){while(--_0x184f77){_0x2472a6['push'](_0x2472a6['shift']());}};_0x5c04b9(++_0x5f2d82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2262ec,_0x289dc0){var _0x36e12e=function(_0xc79f5f){while(--_0xc79f5f){_0x2262ec['push'](_0x2262ec['shift']());}};_0x36e12e(++_0x289dc0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index d164efe..28fa1fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x049e=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x3ddda7,_0x39eaf3){var _0x38f5b4=function(_0x49be31){while(--_0x49be31){_0x3ddda7['push'](_0x3ddda7['shift']());}};_0x38f5b4(++_0x39eaf3);}(_0x049e,0x16a));var _0xe049=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x049e[_0x174ef5];return _0x1cc379;};'use strict';var Sequelize=require(_0xe049('0x0'));module[_0xe049('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe049('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xe049('0x2')]},'password':{'type':Sequelize[_0xe049('0x2')]},'port':{'type':Sequelize[_0xe049('0x3')]},'tls':{'type':Sequelize[_0xe049('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xe049('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xe049('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe049('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe049('0x2')]}};
\ No newline at end of file
+var _0xf403=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0xb9c8c4,_0x144314){var _0x59e950=function(_0x436157){while(--_0x436157){_0xb9c8c4['push'](_0xb9c8c4['shift']());}};_0x59e950(++_0x144314);}(_0xf403,0x1d3));var _0x3f40=function(_0x47eec1,_0x42ea2c){_0x47eec1=_0x47eec1-0x0;var _0xc630df=_0xf403[_0x47eec1];return _0xc630df;};'use strict';var Sequelize=require(_0x3f40('0x0'));module['exports']={'description':{'type':Sequelize[_0x3f40('0x1')]},'host':{'type':Sequelize[_0x3f40('0x1')]},'authentication':{'type':Sequelize[_0x3f40('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3f40('0x1')]},'password':{'type':Sequelize[_0x3f40('0x1')]},'port':{'type':Sequelize[_0x3f40('0x3')]},'tls':{'type':Sequelize[_0x3f40('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3f40('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3f40('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3f40('0x1')]}};
\ No newline at end of file
index 7da9fe1..fb2f20e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b89=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x4b89,0xff));var _0x94b8=function(_0x296d9d,_0x4d286b){_0x296d9d=_0x296d9d-0x0;var _0x53f5d0=_0x4b89[_0x296d9d];return _0x53f5d0;};'use strict';var _=require(_0x94b8('0x0'));var util=require(_0x94b8('0x1'));var logger=require(_0x94b8('0x2'))(_0x94b8('0x3'));var moment=require(_0x94b8('0x4'));var BPromise=require(_0x94b8('0x5'));var rp=require(_0x94b8('0x6'));var fs=require('fs');var path=require(_0x94b8('0x7'));var rimraf=require(_0x94b8('0x8'));var config=require(_0x94b8('0x9'));var attributes=require(_0x94b8('0xa'));module[_0x94b8('0xb')]=function(_0x4be25f,_0x4b7c3f){return _0x4be25f[_0x94b8('0xc')](_0x94b8('0xd'),attributes,{'tableName':_0x94b8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ee4=['util','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash'];(function(_0x122338,_0x36d113){var _0x514ad9=function(_0x1a63eb){while(--_0x1a63eb){_0x122338['push'](_0x122338['shift']());}};_0x514ad9(++_0x36d113);}(_0x0ee4,0xfc));var _0x40ee=function(_0x2313ee,_0x443e40){_0x2313ee=_0x2313ee-0x0;var _0x4d088c=_0x0ee4[_0x2313ee];return _0x4d088c;};'use strict';var _=require(_0x40ee('0x0'));var util=require(_0x40ee('0x1'));var logger=require('../../config/logger')(_0x40ee('0x2'));var moment=require('moment');var BPromise=require(_0x40ee('0x3'));var rp=require(_0x40ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40ee('0x5'));var config=require(_0x40ee('0x6'));var attributes=require(_0x40ee('0x7'));module[_0x40ee('0x8')]=function(_0x431ad3,_0x3cdd5f){return _0x431ad3[_0x40ee('0x9')](_0x40ee('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5406a3f..78d9ba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea85=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetMailServerIn','MailServerIn','options','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5bfe77,_0x19db75){var _0x4a9609=function(_0x10cc8c){while(--_0x10cc8c){_0x5bfe77['push'](_0x5bfe77['shift']());}};_0x4a9609(++_0x19db75);}(_0xea85,0x1cd));var _0x5ea8=function(_0x3e9a48,_0xb43982){_0x3e9a48=_0x3e9a48-0x0;var _0x318f34=_0xea85[_0x3e9a48];return _0x318f34;};'use strict';var _=require(_0x5ea8('0x0'));var util=require('util');var moment=require(_0x5ea8('0x1'));var BPromise=require(_0x5ea8('0x2'));var rs=require(_0x5ea8('0x3'));var fs=require('fs');var Redis=require(_0x5ea8('0x4'));var db=require(_0x5ea8('0x5'))['db'];var utils=require(_0x5ea8('0x6'));var logger=require(_0x5ea8('0x7'))(_0x5ea8('0x8'));var config=require(_0x5ea8('0x9'));var jayson=require(_0x5ea8('0xa'));var client=jayson[_0x5ea8('0xb')][_0x5ea8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x322848,_0x25aa3c,_0xa604ff){return new BPromise(function(_0x53baa9,_0x27938b){return client[_0x5ea8('0xd')](_0x322848,_0xa604ff)[_0x5ea8('0xe')](function(_0x16d173){logger['info'](_0x5ea8('0xf'),_0x25aa3c,_0x5ea8('0x10'));logger[_0x5ea8('0x11')](_0x5ea8('0x12'),_0x25aa3c,_0x5ea8('0x10'),JSON[_0x5ea8('0x13')](_0x16d173));if(_0x16d173[_0x5ea8('0x14')]){if(_0x16d173[_0x5ea8('0x14')][_0x5ea8('0x15')]===0x1f4){logger[_0x5ea8('0x14')](_0x5ea8('0xf'),_0x25aa3c,_0x16d173['error'][_0x5ea8('0x16')]);return _0x27938b(_0x16d173['error'][_0x5ea8('0x16')]);}logger[_0x5ea8('0x14')](_0x5ea8('0xf'),_0x25aa3c,_0x16d173[_0x5ea8('0x14')][_0x5ea8('0x16')]);return _0x53baa9(_0x16d173[_0x5ea8('0x14')][_0x5ea8('0x16')]);}else{logger[_0x5ea8('0x17')](_0x5ea8('0xf'),_0x25aa3c,_0x5ea8('0x10'));_0x53baa9(_0x16d173['result']['message']);}})[_0x5ea8('0x18')](function(_0x28a8b0){logger[_0x5ea8('0x14')](_0x5ea8('0xf'),_0x25aa3c,_0x28a8b0);_0x27938b(_0x28a8b0);});});}exports[_0x5ea8('0x19')]=function(_0x39e233){var _0x33fbe3=this;return new Promise(function(_0x5955e8,_0x2a8be0){return db[_0x5ea8('0x1a')]['findAll']({'raw':_0x39e233[_0x5ea8('0x1b')]?_0x39e233[_0x5ea8('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x39e233[_0x5ea8('0x1b')]?_0x39e233[_0x5ea8('0x1b')][_0x5ea8('0x1c')]||null:null,'attributes':_0x39e233['options']?_0x39e233[_0x5ea8('0x1b')][_0x5ea8('0x1d')]||null:null,'limit':_0x39e233[_0x5ea8('0x1b')]?_0x39e233[_0x5ea8('0x1b')][_0x5ea8('0x1e')]||null:null,'include':_0x39e233[_0x5ea8('0x1b')]?_0x39e233[_0x5ea8('0x1b')][_0x5ea8('0x1f')]?_[_0x5ea8('0x20')](_0x39e233[_0x5ea8('0x1b')]['include'],function(_0x329a07){return{'model':db[_0x329a07['model']],'as':_0x329a07['as'],'attributes':_0x329a07[_0x5ea8('0x1d')],'include':_0x329a07[_0x5ea8('0x1f')]?_['map'](_0x329a07[_0x5ea8('0x1f')],function(_0x249697){return{'model':db[_0x249697[_0x5ea8('0x21')]],'as':_0x249697['as'],'attributes':_0x249697[_0x5ea8('0x1d')],'include':_0x249697[_0x5ea8('0x1f')]?_['map'](_0x249697[_0x5ea8('0x1f')],function(_0x12c6c6){return{'model':db[_0x12c6c6[_0x5ea8('0x21')]],'as':_0x12c6c6['as'],'attributes':_0x12c6c6[_0x5ea8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5ea8('0xe')](function(_0x1a17b0){logger[_0x5ea8('0x17')](_0x5ea8('0x19'),_0x39e233);logger['debug']('GetMailServerIn',_0x39e233,JSON[_0x5ea8('0x13')](_0x1a17b0));_0x5955e8(_0x1a17b0);})[_0x5ea8('0x18')](function(_0x508eed){logger['error'](_0x5ea8('0x19'),_0x508eed[_0x5ea8('0x16')],_0x39e233);_0x2a8be0(_0x33fbe3[_0x5ea8('0x14')](0x1f4,_0x508eed['message']));});});};
\ No newline at end of file
+var _0x8c7f=['result','catch','GetMailServerIn','MailServerIn','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x54ce4a,_0x502cba){var _0x279dce=function(_0x217ed8){while(--_0x217ed8){_0x54ce4a['push'](_0x54ce4a['shift']());}};_0x279dce(++_0x502cba);}(_0x8c7f,0xb2));var _0xf8c7=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8c7f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xf8c7('0x0'));var util=require(_0xf8c7('0x1'));var moment=require(_0xf8c7('0x2'));var BPromise=require(_0xf8c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8c7('0x5'));var logger=require('../../config/logger')(_0xf8c7('0x6'));var config=require(_0xf8c7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf8c7('0x8')][_0xf8c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37aa27,_0x8ca51b,_0x57d4a4){return new BPromise(function(_0x1de77e,_0x102707){return client[_0xf8c7('0xa')](_0x37aa27,_0x57d4a4)['then'](function(_0x349e28){logger[_0xf8c7('0xb')](_0xf8c7('0xc'),_0x8ca51b,_0xf8c7('0xd'));logger[_0xf8c7('0xe')](_0xf8c7('0xf'),_0x8ca51b,_0xf8c7('0xd'),JSON[_0xf8c7('0x10')](_0x349e28));if(_0x349e28[_0xf8c7('0x11')]){if(_0x349e28[_0xf8c7('0x11')][_0xf8c7('0x12')]===0x1f4){logger[_0xf8c7('0x11')]('MailServerIn,\x20%s,\x20%s',_0x8ca51b,_0x349e28['error'][_0xf8c7('0x13')]);return _0x102707(_0x349e28['error']['message']);}logger[_0xf8c7('0x11')](_0xf8c7('0xc'),_0x8ca51b,_0x349e28[_0xf8c7('0x11')][_0xf8c7('0x13')]);return _0x1de77e(_0x349e28[_0xf8c7('0x11')][_0xf8c7('0x13')]);}else{logger[_0xf8c7('0xb')](_0xf8c7('0xc'),_0x8ca51b,_0xf8c7('0xd'));_0x1de77e(_0x349e28[_0xf8c7('0x14')][_0xf8c7('0x13')]);}})[_0xf8c7('0x15')](function(_0x3dba7e){logger[_0xf8c7('0x11')]('MailServerIn,\x20%s,\x20%s',_0x8ca51b,_0x3dba7e);_0x102707(_0x3dba7e);});});}exports[_0xf8c7('0x16')]=function(_0x201a4a){var _0x41f99c=this;return new Promise(function(_0x2dd97f,_0x1e6cee){return db[_0xf8c7('0x17')]['findAll']({'raw':_0x201a4a[_0xf8c7('0x18')]?_0x201a4a['options'][_0xf8c7('0x19')]===undefined?!![]:![]:!![],'where':_0x201a4a[_0xf8c7('0x18')]?_0x201a4a[_0xf8c7('0x18')][_0xf8c7('0x1a')]||null:null,'attributes':_0x201a4a[_0xf8c7('0x18')]?_0x201a4a[_0xf8c7('0x18')]['attributes']||null:null,'limit':_0x201a4a['options']?_0x201a4a[_0xf8c7('0x18')][_0xf8c7('0x1b')]||null:null,'include':_0x201a4a[_0xf8c7('0x18')]?_0x201a4a[_0xf8c7('0x18')][_0xf8c7('0x1c')]?_[_0xf8c7('0x1d')](_0x201a4a['options'][_0xf8c7('0x1c')],function(_0x1be3e9){return{'model':db[_0x1be3e9[_0xf8c7('0x1e')]],'as':_0x1be3e9['as'],'attributes':_0x1be3e9['attributes'],'include':_0x1be3e9['include']?_[_0xf8c7('0x1d')](_0x1be3e9[_0xf8c7('0x1c')],function(_0x45216e){return{'model':db[_0x45216e[_0xf8c7('0x1e')]],'as':_0x45216e['as'],'attributes':_0x45216e[_0xf8c7('0x1f')],'include':_0x45216e[_0xf8c7('0x1c')]?_['map'](_0x45216e[_0xf8c7('0x1c')],function(_0x5240cd){return{'model':db[_0x5240cd['model']],'as':_0x5240cd['as'],'attributes':_0x5240cd[_0xf8c7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf8c7('0x20')](function(_0x1467e9){logger[_0xf8c7('0xb')](_0xf8c7('0x16'),_0x201a4a);logger['debug'](_0xf8c7('0x16'),_0x201a4a,JSON[_0xf8c7('0x10')](_0x1467e9));_0x2dd97f(_0x1467e9);})['catch'](function(_0x3beb75){logger[_0xf8c7('0x11')](_0xf8c7('0x16'),_0x3beb75['message'],_0x201a4a);_0x1e6cee(_0x41f99c[_0xf8c7('0x11')](0x1f4,_0x3beb75[_0xf8c7('0x13')]));});});};
\ No newline at end of file
index b9dadd0..9f30620 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x20aaa3,_0x5eb276){_0x20aaa3=_0x20aaa3-0x0;var _0x3457e4=_0x7a54[_0x20aaa3];return _0x3457e4;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7a54,0x106));var _0x47a5=function(_0x381cc6,_0x210ba7){_0x381cc6=_0x381cc6-0x0;var _0x52a067=_0x7a54[_0x381cc6];return _0x52a067;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
index 586e0f1..e998e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae7=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x29b997,_0x3f7266){var _0x18fe58=function(_0x11ba28){while(--_0x11ba28){_0x29b997['push'](_0x29b997['shift']());}};_0x18fe58(++_0x3f7266);}(_0x1ae7,0xe0));var _0x71ae=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x1ae7[_0x3ce3c];return _0x55a2c9;};'use strict';var Sequelize=require(_0x71ae('0x0'));module[_0x71ae('0x1')]={'description':{'type':Sequelize[_0x71ae('0x2')]},'host':{'type':Sequelize[_0x71ae('0x2')]},'user':{'type':Sequelize[_0x71ae('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x71ae('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x71ae('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x9c17=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9c17,0x1e5));var _0x79c1=function(_0x3ae24a,_0x7d32f9){_0x3ae24a=_0x3ae24a-0x0;var _0x18690f=_0x9c17[_0x3ae24a];return _0x18690f;};'use strict';var Sequelize=require(_0x79c1('0x0'));module['exports']={'description':{'type':Sequelize[_0x79c1('0x1')]},'host':{'type':Sequelize[_0x79c1('0x1')]},'user':{'type':Sequelize[_0x79c1('0x1')]},'pass':{'type':Sequelize[_0x79c1('0x1')]},'port':{'type':Sequelize[_0x79c1('0x2')]},'secure':{'type':Sequelize[_0x79c1('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x79c1('0x1')]},'authentication':{'type':Sequelize[_0x79c1('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 5f9a0ee..61d65d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e82=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x4077b8,_0x2c7e2c){var _0x318dc6=function(_0x340a60){while(--_0x340a60){_0x4077b8['push'](_0x4077b8['shift']());}};_0x318dc6(++_0x2c7e2c);}(_0x8e82,0x84));var _0x28e8=function(_0x258eeb,_0x23138d){_0x258eeb=_0x258eeb-0x0;var _0x2d2334=_0x8e82[_0x258eeb];return _0x2d2334;};'use strict';var emlformat=require(_0x28e8('0x0'));var rimraf=require(_0x28e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x28e8('0x2'));var moment=require('moment');var BPromise=require(_0x28e8('0x3'));var Mustache=require('mustache');var util=require(_0x28e8('0x4'));var path=require(_0x28e8('0x5'));var sox=require(_0x28e8('0x6'));var csv=require(_0x28e8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28e8('0x8'));var squel=require(_0x28e8('0x9'));var crypto=require('crypto');var jsforce=require(_0x28e8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x28e8('0x7'));var querystring=require(_0x28e8('0xb'));var Papa=require(_0x28e8('0xc'));var Redis=require(_0x28e8('0xd'));var authService=require(_0x28e8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x28e8('0xf'));var hardwareService=require(_0x28e8('0x10'));var logger=require(_0x28e8('0x11'))(_0x28e8('0x12'));var utils=require(_0x28e8('0x13'));var config=require(_0x28e8('0x14'));var licenseUtil=require(_0x28e8('0x15'));var db=require(_0x28e8('0x16'))['db'];function respondWithStatusCode(_0x51fe35,_0x3dd311){_0x3dd311=_0x3dd311||0xcc;return function(_0x3c94ed){if(_0x3c94ed){return _0x51fe35[_0x28e8('0x17')](_0x3dd311);}return _0x51fe35['status'](_0x3dd311)[_0x28e8('0x18')]();};}function respondWithResult(_0x32b84e,_0x3fe826){_0x3fe826=_0x3fe826||0xc8;return function(_0x51fed6){if(_0x51fed6){return _0x32b84e[_0x28e8('0x19')](_0x3fe826)[_0x28e8('0x1a')](_0x51fed6);}};}function respondWithFilteredResult(_0x5aa13a,_0x1208f3){return function(_0x3987bc){if(_0x3987bc){var _0x5b2d90=typeof _0x1208f3[_0x28e8('0x1b')]===_0x28e8('0x1c')&&typeof _0x1208f3[_0x28e8('0x1d')]===_0x28e8('0x1c');var _0x14962f=_0x3987bc[_0x28e8('0x1e')];var _0x3de116=_0x5b2d90?0x0:_0x1208f3[_0x28e8('0x1b')];var _0x8ace4e=_0x5b2d90?_0x3987bc[_0x28e8('0x1e')]:_0x1208f3[_0x28e8('0x1b')]+_0x1208f3[_0x28e8('0x1d')];var _0x3b2753;if(_0x8ace4e>=_0x14962f){_0x8ace4e=_0x14962f;_0x3b2753=0xc8;}else{_0x3b2753=0xce;}_0x5aa13a[_0x28e8('0x19')](_0x3b2753);return _0x5aa13a[_0x28e8('0x1f')](_0x28e8('0x20'),_0x3de116+'-'+_0x8ace4e+'/'+_0x14962f)[_0x28e8('0x1a')](_0x3987bc);}return null;};}function patchUpdates(_0x12dc20){return function(_0x5583f6){try{jsonpatch['apply'](_0x5583f6,_0x12dc20,!![]);}catch(_0x4a1869){return BPromise['reject'](_0x4a1869);}return _0x5583f6[_0x28e8('0x21')]();};}function saveUpdates(_0x2b2a84,_0x189593){return function(_0x222147){if(_0x222147){return _0x222147['update'](_0x2b2a84)[_0x28e8('0x22')](function(_0x14f184){return _0x14f184;});}return null;};}function removeEntity(_0x650015,_0x234048){return function(_0x23e7ca){if(_0x23e7ca){return _0x23e7ca[_0x28e8('0x23')]()[_0x28e8('0x22')](function(){_0x650015['status'](0xcc)[_0x28e8('0x18')]();});}};}function handleEntityNotFound(_0x40997d,_0x37e411){return function(_0x16aa05){if(!_0x16aa05){_0x40997d[_0x28e8('0x17')](0x194);}return _0x16aa05;};}function handleError(_0x164ea8,_0x387f07){_0x387f07=_0x387f07||0x1f4;return function(_0x4454df){logger['error'](_0x4454df[_0x28e8('0x24')]);if(_0x4454df['name']){delete _0x4454df[_0x28e8('0x25')];}_0x164ea8[_0x28e8('0x19')](_0x387f07)['send'](_0x4454df);};}exports[_0x28e8('0x26')]=function(_0x24cfc2,_0x27998f){var _0x557ea5={},_0x39c35d={},_0x2d0f22={'count':0x0,'rows':[]};var _0xd9e589=_[_0x28e8('0x27')](db[_0x28e8('0x28')][_0x28e8('0x29')],function(_0x2320ac){return{'name':_0x2320ac[_0x28e8('0x2a')],'type':_0x2320ac[_0x28e8('0x2b')][_0x28e8('0x2c')]};});_0x39c35d['model']=_['map'](_0xd9e589,_0x28e8('0x25'));_0x39c35d[_0x28e8('0x2d')]=_[_0x28e8('0x2e')](_0x24cfc2[_0x28e8('0x2d')]);_0x39c35d[_0x28e8('0x2f')]=_[_0x28e8('0x30')](_0x39c35d['model'],_0x39c35d[_0x28e8('0x2d')]);_0x557ea5[_0x28e8('0x31')]=_[_0x28e8('0x30')](_0x39c35d['model'],qs['fields'](_0x24cfc2[_0x28e8('0x2d')][_0x28e8('0x32')]));_0x557ea5[_0x28e8('0x31')]=_0x557ea5['attributes'][_0x28e8('0x33')]?_0x557ea5[_0x28e8('0x31')]:_0x39c35d[_0x28e8('0x34')];if(!_0x24cfc2[_0x28e8('0x2d')]['hasOwnProperty']('nolimit')){_0x557ea5['limit']=qs[_0x28e8('0x1d')](_0x24cfc2[_0x28e8('0x2d')][_0x28e8('0x1d')]);_0x557ea5['offset']=qs['offset'](_0x24cfc2[_0x28e8('0x2d')]['offset']);}_0x557ea5[_0x28e8('0x35')]=qs[_0x28e8('0x36')](_0x24cfc2[_0x28e8('0x2d')][_0x28e8('0x36')]);_0x557ea5[_0x28e8('0x37')]=qs[_0x28e8('0x2f')](_[_0x28e8('0x38')](_0x24cfc2[_0x28e8('0x2d')],_0x39c35d['filters']),_0xd9e589);if(_0x24cfc2[_0x28e8('0x2d')][_0x28e8('0x39')]){_0x557ea5[_0x28e8('0x37')]=_[_0x28e8('0x3a')](_0x557ea5[_0x28e8('0x37')],{'$or':_[_0x28e8('0x27')](_0xd9e589,function(_0xc1374f){if(_0xc1374f[_0x28e8('0x2b')]!==_0x28e8('0x3b')){var _0x2f47ad={};_0x2f47ad[_0xc1374f[_0x28e8('0x25')]]={'$like':'%'+_0x24cfc2[_0x28e8('0x2d')][_0x28e8('0x39')]+'%'};return _0x2f47ad;}})});}_0x557ea5=_[_0x28e8('0x3a')]({},_0x557ea5,_0x24cfc2[_0x28e8('0x3c')]);var _0x5b3784={'where':_0x557ea5[_0x28e8('0x37')]};return db[_0x28e8('0x28')][_0x28e8('0x1e')](_0x5b3784)[_0x28e8('0x22')](function(_0x4d7f22){_0x2d0f22[_0x28e8('0x1e')]=_0x4d7f22;if(_0x24cfc2[_0x28e8('0x2d')]['includeAll']){_0x557ea5[_0x28e8('0x3d')]=[{'all':!![]}];}return db[_0x28e8('0x28')][_0x28e8('0x3e')](_0x557ea5);})[_0x28e8('0x22')](function(_0x28ac4f){_0x2d0f22['rows']=_0x28ac4f;return _0x2d0f22;})[_0x28e8('0x22')](respondWithFilteredResult(_0x27998f,_0x557ea5))[_0x28e8('0x3f')](handleError(_0x27998f,null));};exports[_0x28e8('0x40')]=function(_0x52b001,_0x439033){var _0x4b83a1={'raw':!![],'where':{'id':_0x52b001[_0x28e8('0x41')]['id']}},_0x123ff9={};_0x123ff9[_0x28e8('0x34')]=_['keys'](db[_0x28e8('0x28')]['rawAttributes']);_0x123ff9[_0x28e8('0x2d')]=_[_0x28e8('0x2e')](_0x52b001[_0x28e8('0x2d')]);_0x123ff9[_0x28e8('0x2f')]=_[_0x28e8('0x30')](_0x123ff9['model'],_0x123ff9[_0x28e8('0x2d')]);_0x4b83a1[_0x28e8('0x31')]=_[_0x28e8('0x30')](_0x123ff9[_0x28e8('0x34')],qs['fields'](_0x52b001[_0x28e8('0x2d')][_0x28e8('0x32')]));_0x4b83a1[_0x28e8('0x31')]=_0x4b83a1['attributes'][_0x28e8('0x33')]?_0x4b83a1['attributes']:_0x123ff9[_0x28e8('0x34')];if(_0x52b001[_0x28e8('0x2d')][_0x28e8('0x42')]){_0x4b83a1[_0x28e8('0x3d')]=[{'all':!![]}];}_0x4b83a1=_['merge']({},_0x4b83a1,_0x52b001[_0x28e8('0x3c')]);return db['MailServerOut'][_0x28e8('0x43')](_0x4b83a1)['then'](handleEntityNotFound(_0x439033,null))[_0x28e8('0x22')](respondWithResult(_0x439033,null))['catch'](handleError(_0x439033,null));};exports[_0x28e8('0x44')]=function(_0x2d41df,_0x1fe91f){return db[_0x28e8('0x28')][_0x28e8('0x44')](_0x2d41df[_0x28e8('0x45')],{})[_0x28e8('0x22')](respondWithResult(_0x1fe91f,0xc9))[_0x28e8('0x3f')](handleError(_0x1fe91f,null));};exports['update']=function(_0x443d84,_0x4fa83a){if(_0x443d84[_0x28e8('0x45')]['id']){delete _0x443d84['body']['id'];}return db[_0x28e8('0x28')][_0x28e8('0x43')]({'where':{'id':_0x443d84[_0x28e8('0x41')]['id']}})['then'](handleEntityNotFound(_0x4fa83a,null))[_0x28e8('0x22')](saveUpdates(_0x443d84[_0x28e8('0x45')],null))['then'](respondWithResult(_0x4fa83a,null))['catch'](handleError(_0x4fa83a,null));};exports[_0x28e8('0x23')]=function(_0x3ad91d,_0x56103f){return db[_0x28e8('0x28')][_0x28e8('0x43')]({'where':{'id':_0x3ad91d[_0x28e8('0x41')]['id']}})[_0x28e8('0x22')](handleEntityNotFound(_0x56103f,null))[_0x28e8('0x22')](removeEntity(_0x56103f,null))[_0x28e8('0x3f')](handleError(_0x56103f,null));};
\ No newline at end of file
+var _0x85bf=['../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','reject','update','then','destroy','stack','name','send','map','MailServerOut','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x2441a4,_0x43703b){var _0x4a192c=function(_0x97664c){while(--_0x97664c){_0x2441a4['push'](_0x2441a4['shift']());}};_0x4a192c(++_0x43703b);}(_0x85bf,0x151));var _0xf85b=function(_0x23f2a7,_0x3bc14f){_0x23f2a7=_0x23f2a7-0x0;var _0x547933=_0x85bf[_0x23f2a7];return _0x547933;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf85b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf85b('0x1'));var rp=require(_0xf85b('0x2'));var moment=require(_0xf85b('0x3'));var BPromise=require(_0xf85b('0x4'));var Mustache=require(_0xf85b('0x5'));var util=require('util');var path=require(_0xf85b('0x6'));var sox=require(_0xf85b('0x7'));var csv=require('to-csv');var ejs=require(_0xf85b('0x8'));var fs=require('fs');var fs_extra=require(_0xf85b('0x9'));var _=require(_0xf85b('0xa'));var squel=require(_0xf85b('0xb'));var crypto=require(_0xf85b('0xc'));var jsforce=require(_0xf85b('0xd'));var deskjs=require(_0xf85b('0xe'));var toCsv=require(_0xf85b('0xf'));var querystring=require(_0xf85b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf85b('0x11'));var qs=require(_0xf85b('0x12'));var as=require(_0xf85b('0x13'));var hardwareService=require(_0xf85b('0x14'));var logger=require('../../config/logger')(_0xf85b('0x15'));var utils=require(_0xf85b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf85b('0x17'));var db=require(_0xf85b('0x18'))['db'];function respondWithStatusCode(_0x30a480,_0x294e26){_0x294e26=_0x294e26||0xcc;return function(_0x1e6680){if(_0x1e6680){return _0x30a480['sendStatus'](_0x294e26);}return _0x30a480[_0xf85b('0x19')](_0x294e26)[_0xf85b('0x1a')]();};}function respondWithResult(_0x46d3fa,_0x2a06cf){_0x2a06cf=_0x2a06cf||0xc8;return function(_0x5e4034){if(_0x5e4034){return _0x46d3fa[_0xf85b('0x19')](_0x2a06cf)['json'](_0x5e4034);}};}function respondWithFilteredResult(_0xb3aee5,_0x1c8964){return function(_0xd7371b){if(_0xd7371b){var _0x4a55fe=typeof _0x1c8964[_0xf85b('0x1b')]===_0xf85b('0x1c')&&typeof _0x1c8964['limit']===_0xf85b('0x1c');var _0x5a4a40=_0xd7371b[_0xf85b('0x1d')];var _0x406fa9=_0x4a55fe?0x0:_0x1c8964[_0xf85b('0x1b')];var _0x3a5ccc=_0x4a55fe?_0xd7371b['count']:_0x1c8964[_0xf85b('0x1b')]+_0x1c8964['limit'];var _0x38861c;if(_0x3a5ccc>=_0x5a4a40){_0x3a5ccc=_0x5a4a40;_0x38861c=0xc8;}else{_0x38861c=0xce;}_0xb3aee5['status'](_0x38861c);return _0xb3aee5[_0xf85b('0x1e')](_0xf85b('0x1f'),_0x406fa9+'-'+_0x3a5ccc+'/'+_0x5a4a40)[_0xf85b('0x20')](_0xd7371b);}return null;};}function patchUpdates(_0x3303c6){return function(_0x208989){try{jsonpatch['apply'](_0x208989,_0x3303c6,!![]);}catch(_0x1cee72){return BPromise[_0xf85b('0x21')](_0x1cee72);}return _0x208989['save']();};}function saveUpdates(_0x129859,_0x5b82bd){return function(_0x21e07f){if(_0x21e07f){return _0x21e07f[_0xf85b('0x22')](_0x129859)[_0xf85b('0x23')](function(_0x557886){return _0x557886;});}return null;};}function removeEntity(_0x452ba3,_0x18f68e){return function(_0xb2c808){if(_0xb2c808){return _0xb2c808[_0xf85b('0x24')]()[_0xf85b('0x23')](function(){_0x452ba3['status'](0xcc)[_0xf85b('0x1a')]();});}};}function handleEntityNotFound(_0x5ec4e7,_0x229aa5){return function(_0x58ccf1){if(!_0x58ccf1){_0x5ec4e7['sendStatus'](0x194);}return _0x58ccf1;};}function handleError(_0x1fbe2b,_0x403e6a){_0x403e6a=_0x403e6a||0x1f4;return function(_0x3d7e6f){logger['error'](_0x3d7e6f[_0xf85b('0x25')]);if(_0x3d7e6f[_0xf85b('0x26')]){delete _0x3d7e6f[_0xf85b('0x26')];}_0x1fbe2b[_0xf85b('0x19')](_0x403e6a)[_0xf85b('0x27')](_0x3d7e6f);};}exports['index']=function(_0x5482eb,_0x19b4e0){var _0x2993a9={},_0x3fdbba={},_0x15909d={'count':0x0,'rows':[]};var _0x48ae88=_[_0xf85b('0x28')](db[_0xf85b('0x29')][_0xf85b('0x2a')],function(_0x5049c6){return{'name':_0x5049c6[_0xf85b('0x2b')],'type':_0x5049c6['type'][_0xf85b('0x2c')]};});_0x3fdbba[_0xf85b('0x2d')]=_[_0xf85b('0x28')](_0x48ae88,'name');_0x3fdbba[_0xf85b('0x2e')]=_['keys'](_0x5482eb['query']);_0x3fdbba[_0xf85b('0x2f')]=_[_0xf85b('0x30')](_0x3fdbba[_0xf85b('0x2d')],_0x3fdbba[_0xf85b('0x2e')]);_0x2993a9['attributes']=_[_0xf85b('0x30')](_0x3fdbba[_0xf85b('0x2d')],qs[_0xf85b('0x31')](_0x5482eb['query'][_0xf85b('0x31')]));_0x2993a9['attributes']=_0x2993a9[_0xf85b('0x32')]['length']?_0x2993a9[_0xf85b('0x32')]:_0x3fdbba[_0xf85b('0x2d')];if(!_0x5482eb[_0xf85b('0x2e')]['hasOwnProperty'](_0xf85b('0x33'))){_0x2993a9[_0xf85b('0x34')]=qs[_0xf85b('0x34')](_0x5482eb['query'][_0xf85b('0x34')]);_0x2993a9[_0xf85b('0x1b')]=qs[_0xf85b('0x1b')](_0x5482eb[_0xf85b('0x2e')]['offset']);}_0x2993a9[_0xf85b('0x35')]=qs[_0xf85b('0x36')](_0x5482eb[_0xf85b('0x2e')]['sort']);_0x2993a9[_0xf85b('0x37')]=qs[_0xf85b('0x2f')](_[_0xf85b('0x38')](_0x5482eb[_0xf85b('0x2e')],_0x3fdbba[_0xf85b('0x2f')]),_0x48ae88);if(_0x5482eb[_0xf85b('0x2e')][_0xf85b('0x39')]){_0x2993a9[_0xf85b('0x37')]=_[_0xf85b('0x3a')](_0x2993a9['where'],{'$or':_[_0xf85b('0x28')](_0x48ae88,function(_0x7d4e5c){if(_0x7d4e5c[_0xf85b('0x3b')]!==_0xf85b('0x3c')){var _0x39b829={};_0x39b829[_0x7d4e5c[_0xf85b('0x26')]]={'$like':'%'+_0x5482eb[_0xf85b('0x2e')][_0xf85b('0x39')]+'%'};return _0x39b829;}})});}_0x2993a9=_['merge']({},_0x2993a9,_0x5482eb['options']);var _0x2f2c7d={'where':_0x2993a9['where']};return db[_0xf85b('0x29')][_0xf85b('0x1d')](_0x2f2c7d)[_0xf85b('0x23')](function(_0x39477a){_0x15909d['count']=_0x39477a;if(_0x5482eb[_0xf85b('0x2e')]['includeAll']){_0x2993a9[_0xf85b('0x3d')]=[{'all':!![]}];}return db[_0xf85b('0x29')][_0xf85b('0x3e')](_0x2993a9);})[_0xf85b('0x23')](function(_0x23f095){_0x15909d[_0xf85b('0x3f')]=_0x23f095;return _0x15909d;})[_0xf85b('0x23')](respondWithFilteredResult(_0x19b4e0,_0x2993a9))[_0xf85b('0x40')](handleError(_0x19b4e0,null));};exports[_0xf85b('0x41')]=function(_0x5f5a0d,_0x215420){var _0x1aa643={'raw':!![],'where':{'id':_0x5f5a0d[_0xf85b('0x42')]['id']}},_0x300806={};_0x300806[_0xf85b('0x2d')]=_[_0xf85b('0x43')](db[_0xf85b('0x29')]['rawAttributes']);_0x300806[_0xf85b('0x2e')]=_[_0xf85b('0x43')](_0x5f5a0d[_0xf85b('0x2e')]);_0x300806[_0xf85b('0x2f')]=_[_0xf85b('0x30')](_0x300806[_0xf85b('0x2d')],_0x300806['query']);_0x1aa643[_0xf85b('0x32')]=_[_0xf85b('0x30')](_0x300806[_0xf85b('0x2d')],qs[_0xf85b('0x31')](_0x5f5a0d[_0xf85b('0x2e')][_0xf85b('0x31')]));_0x1aa643[_0xf85b('0x32')]=_0x1aa643[_0xf85b('0x32')]['length']?_0x1aa643[_0xf85b('0x32')]:_0x300806['model'];if(_0x5f5a0d[_0xf85b('0x2e')]['includeAll']){_0x1aa643[_0xf85b('0x3d')]=[{'all':!![]}];}_0x1aa643=_['merge']({},_0x1aa643,_0x5f5a0d[_0xf85b('0x44')]);return db[_0xf85b('0x29')][_0xf85b('0x45')](_0x1aa643)[_0xf85b('0x23')](handleEntityNotFound(_0x215420,null))[_0xf85b('0x23')](respondWithResult(_0x215420,null))[_0xf85b('0x40')](handleError(_0x215420,null));};exports[_0xf85b('0x46')]=function(_0x335c37,_0x157a8d){return db[_0xf85b('0x29')]['create'](_0x335c37[_0xf85b('0x47')],{})[_0xf85b('0x23')](respondWithResult(_0x157a8d,0xc9))[_0xf85b('0x40')](handleError(_0x157a8d,null));};exports[_0xf85b('0x22')]=function(_0x4ff54f,_0xa268a8){if(_0x4ff54f[_0xf85b('0x47')]['id']){delete _0x4ff54f[_0xf85b('0x47')]['id'];}return db[_0xf85b('0x29')]['find']({'where':{'id':_0x4ff54f[_0xf85b('0x42')]['id']}})[_0xf85b('0x23')](handleEntityNotFound(_0xa268a8,null))[_0xf85b('0x23')](saveUpdates(_0x4ff54f[_0xf85b('0x47')],null))[_0xf85b('0x23')](respondWithResult(_0xa268a8,null))[_0xf85b('0x40')](handleError(_0xa268a8,null));};exports[_0xf85b('0x24')]=function(_0x8395ea,_0x54946c){return db['MailServerOut']['find']({'where':{'id':_0x8395ea[_0xf85b('0x42')]['id']}})[_0xf85b('0x23')](handleEntityNotFound(_0x54946c,null))[_0xf85b('0x23')](removeEntity(_0x54946c,null))[_0xf85b('0x40')](handleError(_0x54946c,null));};
\ No newline at end of file
index f92b855..2cbbc64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9fd=['./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x120dd4,_0x752ea0){var _0x13225c=function(_0x3d2354){while(--_0x3d2354){_0x120dd4['push'](_0x120dd4['shift']());}};_0x13225c(++_0x752ea0);}(_0xb9fd,0x1f2));var _0xdb9f=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xb9fd[_0x528575];return _0x3063b7;};'use strict';var _=require(_0xdb9f('0x0'));var util=require(_0xdb9f('0x1'));var logger=require('../../config/logger')(_0xdb9f('0x2'));var moment=require(_0xdb9f('0x3'));var BPromise=require(_0xdb9f('0x4'));var rp=require(_0xdb9f('0x5'));var fs=require('fs');var path=require(_0xdb9f('0x6'));var rimraf=require(_0xdb9f('0x7'));var config=require(_0xdb9f('0x8'));var attributes=require(_0xdb9f('0x9'));module[_0xdb9f('0xa')]=function(_0xa9663d,_0x220224){return _0xa9663d['define'](_0xdb9f('0xb'),attributes,{'tableName':_0xdb9f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x306a=['lodash','util','api','moment','bluebird','path','rimraf','exports','define','MailServerOut','mail_servers_out'];(function(_0x1cee2b,_0x1a5546){var _0x5ca146=function(_0xf35cce){while(--_0xf35cce){_0x1cee2b['push'](_0x1cee2b['shift']());}};_0x5ca146(++_0x1a5546);}(_0x306a,0x1c3));var _0xa306=function(_0x349883,_0x53efaa){_0x349883=_0x349883-0x0;var _0x47871e=_0x306a[_0x349883];return _0x47871e;};'use strict';var _=require(_0xa306('0x0'));var util=require(_0xa306('0x1'));var logger=require('../../config/logger')(_0xa306('0x2'));var moment=require(_0xa306('0x3'));var BPromise=require(_0xa306('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa306('0x5'));var rimraf=require(_0xa306('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0xa306('0x7')]=function(_0x36b8d1,_0xd88763){return _0x36b8d1[_0xa306('0x8')](_0xa306('0x9'),attributes,{'tableName':_0xa306('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 294bd17..fe84d0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0xdfa649,_0x3d9723){_0xdfa649=_0xdfa649-0x0;var _0x3919db=_0x7a54[_0xdfa649];return _0x3919db;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x45d76c,_0x4c8e64){var _0x322fef=function(_0x5d813f){while(--_0x5d813f){_0x45d76c['push'](_0x45d76c['shift']());}};_0x322fef(++_0x4c8e64);}(_0xdb28,0x106));var _0x8db2=function(_0x52b445,_0x25ddf9){_0x52b445=_0x52b445-0x0;var _0x1dabc4=_0xdb28[_0x52b445];return _0x1dabc4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index 8086d40..0f41ccd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd19a=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','destroy','exports','util'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xd19a,0xaa));var _0xad19=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd19a[_0x4e676e];return _0x336a3c;};'use strict';var multer=require('multer');var util=require(_0xad19('0x0'));var path=require(_0xad19('0x1'));var timeout=require('connect-timeout');var express=require(_0xad19('0x2'));var router=express[_0xad19('0x3')]();var fs_extra=require(_0xad19('0x4'));var auth=require(_0xad19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xad19('0x6'));var controller=require('./mailSubstatus.controller');router[_0xad19('0x7')]('/',auth[_0xad19('0x8')](),controller[_0xad19('0x9')]);router[_0xad19('0x7')](_0xad19('0xa'),auth[_0xad19('0x8')](),controller[_0xad19('0xb')]);router[_0xad19('0x7')](_0xad19('0xc'),auth[_0xad19('0x8')](),controller[_0xad19('0xd')]);router[_0xad19('0xe')]('/',auth[_0xad19('0x8')](),controller[_0xad19('0xf')]);router['put'](_0xad19('0xc'),auth[_0xad19('0x8')](),controller['update']);router[_0xad19('0x10')](_0xad19('0xc'),auth[_0xad19('0x8')](),controller[_0xad19('0x11')]);module[_0xad19('0x12')]=router;
\ No newline at end of file
+var _0xc56a=['./mailSubstatus.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x21a71a,_0x4090f9){var _0x3019a5=function(_0xad7fb4){while(--_0xad7fb4){_0x21a71a['push'](_0x21a71a['shift']());}};_0x3019a5(++_0x4090f9);}(_0xc56a,0x104));var _0xac56=function(_0x436bd3,_0x28c6c8){_0x436bd3=_0x436bd3-0x0;var _0x3e181c=_0xc56a[_0x436bd3];return _0x3e181c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xac56('0x0'));var timeout=require(_0xac56('0x1'));var express=require(_0xac56('0x2'));var router=express[_0xac56('0x3')]();var fs_extra=require(_0xac56('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac56('0x5'));var config=require('../../config/environment');var controller=require(_0xac56('0x6'));router[_0xac56('0x7')]('/',auth['isAuthenticated'](),controller[_0xac56('0x8')]);router[_0xac56('0x7')](_0xac56('0x9'),auth['isAuthenticated'](),controller[_0xac56('0xa')]);router[_0xac56('0x7')](_0xac56('0xb'),auth[_0xac56('0xc')](),controller[_0xac56('0xd')]);router[_0xac56('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xac56('0xf')](_0xac56('0xb'),auth[_0xac56('0xc')](),controller['update']);router[_0xac56('0x10')](_0xac56('0xb'),auth[_0xac56('0xc')](),controller[_0xac56('0x11')]);module[_0xac56('0x12')]=router;
\ No newline at end of file
index 4972067..1764f3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0618=['name','STRING','sequelize','exports'];(function(_0x34bb68,_0x5b0079){var _0x3db9fb=function(_0x2c87bd){while(--_0x2c87bd){_0x34bb68['push'](_0x34bb68['shift']());}};_0x3db9fb(++_0x5b0079);}(_0x0618,0x1c6));var _0x8061=function(_0x1307f9,_0x43802d){_0x1307f9=_0x1307f9-0x0;var _0x115fa1=_0x0618[_0x1307f9];return _0x115fa1;};'use strict';var Sequelize=require(_0x8061('0x0'));module[_0x8061('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8061('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8061('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','name','sequelize'];(function(_0x1a697d,_0x3a9dcb){var _0x4699b9=function(_0xd1b5e1){while(--_0xd1b5e1){_0x1a697d['push'](_0x1a697d['shift']());}};_0x4699b9(++_0x3a9dcb);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x481c0f,_0xb4f447){_0x481c0f=_0x481c0f-0x0;var _0xa20beb=_0x3eea[_0x481c0f];return _0xa20beb;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'unique':_0xa3ee('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa3ee('0x1')]}};
\ No newline at end of file
index 27b4e3e..74ce4b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3e=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x182e40,_0x447764){var _0x363f3b=function(_0x5ab197){while(--_0x5ab197){_0x182e40['push'](_0x182e40['shift']());}};_0x363f3b(++_0x447764);}(_0x2f3e,0x1b5));var _0xe2f3=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x2f3e[_0x267c52];return _0x46c47b;};'use strict';var emlformat=require(_0xe2f3('0x0'));var rimraf=require(_0xe2f3('0x1'));var zipdir=require(_0xe2f3('0x2'));var jsonpatch=require(_0xe2f3('0x3'));var rp=require('request-promise');var moment=require(_0xe2f3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2f3('0x5'));var util=require(_0xe2f3('0x6'));var path=require(_0xe2f3('0x7'));var sox=require(_0xe2f3('0x8'));var csv=require(_0xe2f3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2f3('0xa'));var _=require(_0xe2f3('0xb'));var squel=require(_0xe2f3('0xc'));var crypto=require(_0xe2f3('0xd'));var jsforce=require(_0xe2f3('0xe'));var deskjs=require(_0xe2f3('0xf'));var toCsv=require(_0xe2f3('0x9'));var querystring=require(_0xe2f3('0x10'));var Papa=require(_0xe2f3('0x11'));var Redis=require(_0xe2f3('0x12'));var authService=require(_0xe2f3('0x13'));var qs=require(_0xe2f3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2f3('0x15'));var logger=require(_0xe2f3('0x16'))(_0xe2f3('0x17'));var utils=require(_0xe2f3('0x18'));var config=require(_0xe2f3('0x19'));var licenseUtil=require(_0xe2f3('0x1a'));var db=require(_0xe2f3('0x1b'))['db'];function respondWithStatusCode(_0x4ede24,_0x152f0e){_0x152f0e=_0x152f0e||0xcc;return function(_0x1c2133){if(_0x1c2133){return _0x4ede24[_0xe2f3('0x1c')](_0x152f0e);}return _0x4ede24[_0xe2f3('0x1d')](_0x152f0e)[_0xe2f3('0x1e')]();};}function respondWithResult(_0x599d8d,_0x3552bb){_0x3552bb=_0x3552bb||0xc8;return function(_0x3ab7f9){if(_0x3ab7f9){return _0x599d8d[_0xe2f3('0x1d')](_0x3552bb)[_0xe2f3('0x1f')](_0x3ab7f9);}};}function respondWithFilteredResult(_0x1bc7d6,_0x395419){return function(_0x54debb){if(_0x54debb){var _0xaa0420=typeof _0x395419[_0xe2f3('0x20')]===_0xe2f3('0x21')&&typeof _0x395419[_0xe2f3('0x22')]===_0xe2f3('0x21');var _0x426d7e=_0x54debb[_0xe2f3('0x23')];var _0x33568a=_0xaa0420?0x0:_0x395419[_0xe2f3('0x20')];var _0x211cec=_0xaa0420?_0x54debb[_0xe2f3('0x23')]:_0x395419[_0xe2f3('0x20')]+_0x395419[_0xe2f3('0x22')];var _0x6d5a82;if(_0x211cec>=_0x426d7e){_0x211cec=_0x426d7e;_0x6d5a82=0xc8;}else{_0x6d5a82=0xce;}_0x1bc7d6[_0xe2f3('0x1d')](_0x6d5a82);return _0x1bc7d6[_0xe2f3('0x24')](_0xe2f3('0x25'),_0x33568a+'-'+_0x211cec+'/'+_0x426d7e)[_0xe2f3('0x1f')](_0x54debb);}return null;};}function patchUpdates(_0x469768){return function(_0x321449){try{jsonpatch[_0xe2f3('0x26')](_0x321449,_0x469768,!![]);}catch(_0xf4c59f){return BPromise[_0xe2f3('0x27')](_0xf4c59f);}return _0x321449[_0xe2f3('0x28')]();};}function saveUpdates(_0x36dff3,_0x467145){return function(_0x1c66c5){if(_0x1c66c5){return _0x1c66c5[_0xe2f3('0x29')](_0x36dff3)['then'](function(_0x4492ba){return _0x4492ba;});}return null;};}function removeEntity(_0x46018f,_0x3270bb){return function(_0x32c729){if(_0x32c729){return _0x32c729[_0xe2f3('0x2a')]()['then'](function(){_0x46018f[_0xe2f3('0x1d')](0xcc)[_0xe2f3('0x1e')]();});}};}function handleEntityNotFound(_0x13d578,_0x5c2d3c){return function(_0x1a8c0e){if(!_0x1a8c0e){_0x13d578[_0xe2f3('0x1c')](0x194);}return _0x1a8c0e;};}function handleError(_0x4922e3,_0x5a42d4){_0x5a42d4=_0x5a42d4||0x1f4;return function(_0x424bf4){logger['error'](_0x424bf4[_0xe2f3('0x2b')]);if(_0x424bf4['name']){delete _0x424bf4[_0xe2f3('0x2c')];}_0x4922e3['status'](_0x5a42d4)['send'](_0x424bf4);};}exports[_0xe2f3('0x2d')]=function(_0x148a00,_0x1678c8){var _0x2f387c={},_0x7ec37a={},_0x3f31c9={'count':0x0,'rows':[]};var _0x3e9fe4=_[_0xe2f3('0x2e')](db[_0xe2f3('0x2f')][_0xe2f3('0x30')],function(_0x23d2b8){return{'name':_0x23d2b8[_0xe2f3('0x31')],'type':_0x23d2b8[_0xe2f3('0x32')]['key']};});_0x7ec37a[_0xe2f3('0x33')]=_[_0xe2f3('0x2e')](_0x3e9fe4,_0xe2f3('0x2c'));_0x7ec37a[_0xe2f3('0x34')]=_[_0xe2f3('0x35')](_0x148a00[_0xe2f3('0x34')]);_0x7ec37a[_0xe2f3('0x36')]=_[_0xe2f3('0x37')](_0x7ec37a['model'],_0x7ec37a[_0xe2f3('0x34')]);_0x2f387c[_0xe2f3('0x38')]=_[_0xe2f3('0x37')](_0x7ec37a[_0xe2f3('0x33')],qs['fields'](_0x148a00[_0xe2f3('0x34')][_0xe2f3('0x39')]));_0x2f387c['attributes']=_0x2f387c['attributes'][_0xe2f3('0x3a')]?_0x2f387c[_0xe2f3('0x38')]:_0x7ec37a[_0xe2f3('0x33')];if(!_0x148a00[_0xe2f3('0x34')][_0xe2f3('0x3b')](_0xe2f3('0x3c'))){_0x2f387c[_0xe2f3('0x22')]=qs[_0xe2f3('0x22')](_0x148a00[_0xe2f3('0x34')][_0xe2f3('0x22')]);_0x2f387c['offset']=qs[_0xe2f3('0x20')](_0x148a00[_0xe2f3('0x34')]['offset']);}_0x2f387c['order']=qs[_0xe2f3('0x3d')](_0x148a00[_0xe2f3('0x34')][_0xe2f3('0x3d')]);_0x2f387c[_0xe2f3('0x3e')]=qs['filters'](_[_0xe2f3('0x3f')](_0x148a00['query'],_0x7ec37a[_0xe2f3('0x36')]),_0x3e9fe4);if(_0x148a00[_0xe2f3('0x34')][_0xe2f3('0x40')]){_0x2f387c['where']=_[_0xe2f3('0x41')](_0x2f387c[_0xe2f3('0x3e')],{'$or':_[_0xe2f3('0x2e')](_0x3e9fe4,function(_0x96cab3){if(_0x96cab3[_0xe2f3('0x32')]!==_0xe2f3('0x42')){var _0x14a717={};_0x14a717[_0x96cab3[_0xe2f3('0x2c')]]={'$like':'%'+_0x148a00['query']['filter']+'%'};return _0x14a717;}})});}_0x2f387c=_['merge']({},_0x2f387c,_0x148a00['options']);var _0x4573a4={'where':_0x2f387c['where']};return db[_0xe2f3('0x2f')]['count'](_0x4573a4)[_0xe2f3('0x43')](function(_0x4dd70e){_0x3f31c9[_0xe2f3('0x23')]=_0x4dd70e;if(_0x148a00[_0xe2f3('0x34')][_0xe2f3('0x44')]){_0x2f387c[_0xe2f3('0x45')]=[{'all':!![]}];}return db[_0xe2f3('0x2f')][_0xe2f3('0x46')](_0x2f387c);})[_0xe2f3('0x43')](function(_0x55a75f){_0x3f31c9[_0xe2f3('0x47')]=_0x55a75f;return _0x3f31c9;})[_0xe2f3('0x43')](respondWithFilteredResult(_0x1678c8,_0x2f387c))[_0xe2f3('0x48')](handleError(_0x1678c8,null));};exports['show']=function(_0x2205ba,_0x1a36e8){var _0x195064={'raw':!![],'where':{'id':_0x2205ba['params']['id']}},_0xd15cf7={};_0xd15cf7['model']=_['keys'](db['MailSubstatus']['rawAttributes']);_0xd15cf7['query']=_['keys'](_0x2205ba[_0xe2f3('0x34')]);_0xd15cf7[_0xe2f3('0x36')]=_[_0xe2f3('0x37')](_0xd15cf7[_0xe2f3('0x33')],_0xd15cf7[_0xe2f3('0x34')]);_0x195064['attributes']=_[_0xe2f3('0x37')](_0xd15cf7[_0xe2f3('0x33')],qs[_0xe2f3('0x39')](_0x2205ba[_0xe2f3('0x34')]['fields']));_0x195064['attributes']=_0x195064[_0xe2f3('0x38')][_0xe2f3('0x3a')]?_0x195064['attributes']:_0xd15cf7[_0xe2f3('0x33')];if(_0x2205ba[_0xe2f3('0x34')][_0xe2f3('0x44')]){_0x195064[_0xe2f3('0x45')]=[{'all':!![]}];}_0x195064=_['merge']({},_0x195064,_0x2205ba['options']);return db[_0xe2f3('0x2f')][_0xe2f3('0x49')](_0x195064)['then'](handleEntityNotFound(_0x1a36e8,null))[_0xe2f3('0x43')](respondWithResult(_0x1a36e8,null))['catch'](handleError(_0x1a36e8,null));};exports[_0xe2f3('0x4a')]=function(_0x463227,_0x625c4e){return db[_0xe2f3('0x2f')][_0xe2f3('0x4a')](_0x463227[_0xe2f3('0x4b')],{})['then'](respondWithResult(_0x625c4e,0xc9))[_0xe2f3('0x48')](handleError(_0x625c4e,null));};exports[_0xe2f3('0x29')]=function(_0xa27cfc,_0x3e5fa3){if(_0xa27cfc['body']['id']){delete _0xa27cfc[_0xe2f3('0x4b')]['id'];}return db[_0xe2f3('0x2f')]['find']({'where':{'id':_0xa27cfc['params']['id']}})[_0xe2f3('0x43')](handleEntityNotFound(_0x3e5fa3,null))['then'](saveUpdates(_0xa27cfc[_0xe2f3('0x4b')],null))['then'](respondWithResult(_0x3e5fa3,null))[_0xe2f3('0x48')](handleError(_0x3e5fa3,null));};exports[_0xe2f3('0x2a')]=function(_0x159b7f,_0x303765){return db[_0xe2f3('0x2f')][_0xe2f3('0x49')]({'where':{'id':_0x159b7f[_0xe2f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x303765,null))[_0xe2f3('0x43')](removeEntity(_0x303765,null))['catch'](handleError(_0x303765,null));};exports[_0xe2f3('0x4d')]=function(_0x131284,_0x49a021){return db['MailSubstatus'][_0xe2f3('0x4d')]()[_0xe2f3('0x43')](respondWithResult(_0x49a021,null))[_0xe2f3('0x48')](handleError(_0x49a021,null));};
\ No newline at end of file
+var _0x1e44=['offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','include','catch','show','params','includeAll','merge','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1e44,0x1a9));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x41e4('0x0'));var rimraf=require(_0x41e4('0x1'));var zipdir=require(_0x41e4('0x2'));var jsonpatch=require(_0x41e4('0x3'));var rp=require(_0x41e4('0x4'));var moment=require(_0x41e4('0x5'));var BPromise=require(_0x41e4('0x6'));var Mustache=require(_0x41e4('0x7'));var util=require('util');var path=require(_0x41e4('0x8'));var sox=require(_0x41e4('0x9'));var csv=require(_0x41e4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x41e4('0xb'));var _=require(_0x41e4('0xc'));var squel=require(_0x41e4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x41e4('0xe'));var toCsv=require(_0x41e4('0xa'));var querystring=require(_0x41e4('0xf'));var Papa=require('papaparse');var Redis=require(_0x41e4('0x10'));var authService=require(_0x41e4('0x11'));var qs=require(_0x41e4('0x12'));var as=require(_0x41e4('0x13'));var hardwareService=require(_0x41e4('0x14'));var logger=require(_0x41e4('0x15'))(_0x41e4('0x16'));var utils=require(_0x41e4('0x17'));var config=require(_0x41e4('0x18'));var licenseUtil=require(_0x41e4('0x19'));var db=require(_0x41e4('0x1a'))['db'];function respondWithStatusCode(_0x4f5314,_0x4abbc2){_0x4abbc2=_0x4abbc2||0xcc;return function(_0x943f06){if(_0x943f06){return _0x4f5314[_0x41e4('0x1b')](_0x4abbc2);}return _0x4f5314[_0x41e4('0x1c')](_0x4abbc2)[_0x41e4('0x1d')]();};}function respondWithResult(_0x3d9d28,_0x2492b2){_0x2492b2=_0x2492b2||0xc8;return function(_0x24b8a7){if(_0x24b8a7){return _0x3d9d28[_0x41e4('0x1c')](_0x2492b2)[_0x41e4('0x1e')](_0x24b8a7);}};}function respondWithFilteredResult(_0x1c78e6,_0xe643a0){return function(_0x46ac53){if(_0x46ac53){var _0x520377=typeof _0xe643a0[_0x41e4('0x1f')]===_0x41e4('0x20')&&typeof _0xe643a0[_0x41e4('0x21')]===_0x41e4('0x20');var _0x507576=_0x46ac53[_0x41e4('0x22')];var _0xe68e30=_0x520377?0x0:_0xe643a0[_0x41e4('0x1f')];var _0x474941=_0x520377?_0x46ac53['count']:_0xe643a0[_0x41e4('0x1f')]+_0xe643a0[_0x41e4('0x21')];var _0xdc98a1;if(_0x474941>=_0x507576){_0x474941=_0x507576;_0xdc98a1=0xc8;}else{_0xdc98a1=0xce;}_0x1c78e6['status'](_0xdc98a1);return _0x1c78e6[_0x41e4('0x23')](_0x41e4('0x24'),_0xe68e30+'-'+_0x474941+'/'+_0x507576)[_0x41e4('0x1e')](_0x46ac53);}return null;};}function patchUpdates(_0x12c08c){return function(_0x31b507){try{jsonpatch[_0x41e4('0x25')](_0x31b507,_0x12c08c,!![]);}catch(_0x21c061){return BPromise['reject'](_0x21c061);}return _0x31b507['save']();};}function saveUpdates(_0x5f4bcd,_0x2c121a){return function(_0x38c7bb){if(_0x38c7bb){return _0x38c7bb[_0x41e4('0x26')](_0x5f4bcd)['then'](function(_0x3c4740){return _0x3c4740;});}return null;};}function removeEntity(_0x1e0287,_0x19855f){return function(_0x1beb6b){if(_0x1beb6b){return _0x1beb6b['destroy']()[_0x41e4('0x27')](function(){_0x1e0287[_0x41e4('0x1c')](0xcc)[_0x41e4('0x1d')]();});}};}function handleEntityNotFound(_0x2e3633,_0x44c932){return function(_0x233dae){if(!_0x233dae){_0x2e3633[_0x41e4('0x1b')](0x194);}return _0x233dae;};}function handleError(_0x23bfa3,_0x893f0d){_0x893f0d=_0x893f0d||0x1f4;return function(_0x20ce7c){logger[_0x41e4('0x28')](_0x20ce7c[_0x41e4('0x29')]);if(_0x20ce7c[_0x41e4('0x2a')]){delete _0x20ce7c[_0x41e4('0x2a')];}_0x23bfa3[_0x41e4('0x1c')](_0x893f0d)['send'](_0x20ce7c);};}exports[_0x41e4('0x2b')]=function(_0x4f0679,_0x20b962){var _0x462ef9={},_0x3b3d4d={},_0x15b7e1={'count':0x0,'rows':[]};var _0x27d7c0=_[_0x41e4('0x2c')](db[_0x41e4('0x2d')][_0x41e4('0x2e')],function(_0x2951ba){return{'name':_0x2951ba[_0x41e4('0x2f')],'type':_0x2951ba[_0x41e4('0x30')]['key']};});_0x3b3d4d[_0x41e4('0x31')]=_['map'](_0x27d7c0,_0x41e4('0x2a'));_0x3b3d4d['query']=_[_0x41e4('0x32')](_0x4f0679[_0x41e4('0x33')]);_0x3b3d4d[_0x41e4('0x34')]=_[_0x41e4('0x35')](_0x3b3d4d[_0x41e4('0x31')],_0x3b3d4d[_0x41e4('0x33')]);_0x462ef9[_0x41e4('0x36')]=_[_0x41e4('0x35')](_0x3b3d4d[_0x41e4('0x31')],qs[_0x41e4('0x37')](_0x4f0679[_0x41e4('0x33')][_0x41e4('0x37')]));_0x462ef9[_0x41e4('0x36')]=_0x462ef9[_0x41e4('0x36')][_0x41e4('0x38')]?_0x462ef9[_0x41e4('0x36')]:_0x3b3d4d[_0x41e4('0x31')];if(!_0x4f0679[_0x41e4('0x33')][_0x41e4('0x39')](_0x41e4('0x3a'))){_0x462ef9['limit']=qs[_0x41e4('0x21')](_0x4f0679[_0x41e4('0x33')][_0x41e4('0x21')]);_0x462ef9['offset']=qs[_0x41e4('0x1f')](_0x4f0679[_0x41e4('0x33')][_0x41e4('0x1f')]);}_0x462ef9['order']=qs[_0x41e4('0x3b')](_0x4f0679['query'][_0x41e4('0x3b')]);_0x462ef9[_0x41e4('0x3c')]=qs[_0x41e4('0x34')](_[_0x41e4('0x3d')](_0x4f0679[_0x41e4('0x33')],_0x3b3d4d[_0x41e4('0x34')]),_0x27d7c0);if(_0x4f0679[_0x41e4('0x33')][_0x41e4('0x3e')]){_0x462ef9['where']=_['merge'](_0x462ef9['where'],{'$or':_[_0x41e4('0x2c')](_0x27d7c0,function(_0x41aad5){if(_0x41aad5[_0x41e4('0x30')]!==_0x41e4('0x3f')){var _0xfe0f83={};_0xfe0f83[_0x41aad5['name']]={'$like':'%'+_0x4f0679['query'][_0x41e4('0x3e')]+'%'};return _0xfe0f83;}})});}_0x462ef9=_['merge']({},_0x462ef9,_0x4f0679['options']);var _0x5d6fe9={'where':_0x462ef9[_0x41e4('0x3c')]};return db[_0x41e4('0x2d')][_0x41e4('0x22')](_0x5d6fe9)[_0x41e4('0x27')](function(_0x2c7262){_0x15b7e1['count']=_0x2c7262;if(_0x4f0679[_0x41e4('0x33')]['includeAll']){_0x462ef9[_0x41e4('0x40')]=[{'all':!![]}];}return db[_0x41e4('0x2d')]['findAll'](_0x462ef9);})['then'](function(_0x1d3cf2){_0x15b7e1['rows']=_0x1d3cf2;return _0x15b7e1;})[_0x41e4('0x27')](respondWithFilteredResult(_0x20b962,_0x462ef9))[_0x41e4('0x41')](handleError(_0x20b962,null));};exports[_0x41e4('0x42')]=function(_0x1d64dc,_0x570593){var _0x4dfd63={'raw':!![],'where':{'id':_0x1d64dc[_0x41e4('0x43')]['id']}},_0x525385={};_0x525385[_0x41e4('0x31')]=_[_0x41e4('0x32')](db[_0x41e4('0x2d')][_0x41e4('0x2e')]);_0x525385['query']=_[_0x41e4('0x32')](_0x1d64dc[_0x41e4('0x33')]);_0x525385[_0x41e4('0x34')]=_[_0x41e4('0x35')](_0x525385[_0x41e4('0x31')],_0x525385[_0x41e4('0x33')]);_0x4dfd63[_0x41e4('0x36')]=_[_0x41e4('0x35')](_0x525385[_0x41e4('0x31')],qs['fields'](_0x1d64dc[_0x41e4('0x33')][_0x41e4('0x37')]));_0x4dfd63[_0x41e4('0x36')]=_0x4dfd63[_0x41e4('0x36')][_0x41e4('0x38')]?_0x4dfd63[_0x41e4('0x36')]:_0x525385[_0x41e4('0x31')];if(_0x1d64dc[_0x41e4('0x33')][_0x41e4('0x44')]){_0x4dfd63['include']=[{'all':!![]}];}_0x4dfd63=_[_0x41e4('0x45')]({},_0x4dfd63,_0x1d64dc[_0x41e4('0x46')]);return db['MailSubstatus'][_0x41e4('0x47')](_0x4dfd63)[_0x41e4('0x27')](handleEntityNotFound(_0x570593,null))[_0x41e4('0x27')](respondWithResult(_0x570593,null))[_0x41e4('0x41')](handleError(_0x570593,null));};exports[_0x41e4('0x48')]=function(_0x7c2ae0,_0x1d51cb){return db[_0x41e4('0x2d')]['create'](_0x7c2ae0[_0x41e4('0x49')],{})[_0x41e4('0x27')](respondWithResult(_0x1d51cb,0xc9))['catch'](handleError(_0x1d51cb,null));};exports['update']=function(_0x5295b7,_0x3ebb53){if(_0x5295b7[_0x41e4('0x49')]['id']){delete _0x5295b7[_0x41e4('0x49')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x5295b7[_0x41e4('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ebb53,null))['then'](saveUpdates(_0x5295b7[_0x41e4('0x49')],null))[_0x41e4('0x27')](respondWithResult(_0x3ebb53,null))[_0x41e4('0x41')](handleError(_0x3ebb53,null));};exports[_0x41e4('0x4a')]=function(_0x241632,_0x10ff82){return db[_0x41e4('0x2d')][_0x41e4('0x47')]({'where':{'id':_0x241632[_0x41e4('0x43')]['id']}})[_0x41e4('0x27')](handleEntityNotFound(_0x10ff82,null))[_0x41e4('0x27')](removeEntity(_0x10ff82,null))[_0x41e4('0x41')](handleError(_0x10ff82,null));};exports[_0x41e4('0x4b')]=function(_0x3dcb7b,_0x4078bb){return db[_0x41e4('0x2d')][_0x41e4('0x4b')]()[_0x41e4('0x27')](respondWithResult(_0x4078bb,null))[_0x41e4('0x41')](handleError(_0x4078bb,null));};
\ No newline at end of file
index 8530adf..dee762d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x334d=['path','rimraf','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x28df65,_0x3ec4a8){var _0x14c567=function(_0x8da78f){while(--_0x8da78f){_0x28df65['push'](_0x28df65['shift']());}};_0x14c567(++_0x3ec4a8);}(_0x334d,0x11a));var _0xd334=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x334d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd334('0x0'));var util=require(_0xd334('0x1'));var logger=require(_0xd334('0x2'))(_0xd334('0x3'));var moment=require(_0xd334('0x4'));var BPromise=require(_0xd334('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd334('0x6'));var rimraf=require(_0xd334('0x7'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0xd334('0x8')]=function(_0x506005,_0x389d3b){return _0x506005[_0xd334('0x9')](_0xd334('0xa'),attributes,{'tableName':_0xd334('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4996=['define','MailSubstatus','mail_substatuses','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports'];(function(_0x3fe8ce,_0x5cd02f){var _0xce0a81=function(_0x214bb6){while(--_0x214bb6){_0x3fe8ce['push'](_0x3fe8ce['shift']());}};_0xce0a81(++_0x5cd02f);}(_0x4996,0x1a3));var _0x6499=function(_0xc2c89,_0x22c701){_0xc2c89=_0xc2c89-0x0;var _0x4f9032=_0x4996[_0xc2c89];return _0x4f9032;};'use strict';var _=require(_0x6499('0x0'));var util=require('util');var logger=require(_0x6499('0x1'))(_0x6499('0x2'));var moment=require('moment');var BPromise=require(_0x6499('0x3'));var rp=require(_0x6499('0x4'));var fs=require('fs');var path=require(_0x6499('0x5'));var rimraf=require(_0x6499('0x6'));var config=require(_0x6499('0x7'));var attributes=require(_0x6499('0x8'));module[_0x6499('0x9')]=function(_0x26f859,_0x2c1a43){return _0x26f859[_0x6499('0xa')](_0x6499('0xb'),attributes,{'tableName':_0x6499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a5393b..9f862db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f76=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x55d1cc,_0x4dcbb1){var _0xe558e9=function(_0x43dd8f){while(--_0x43dd8f){_0x55d1cc['push'](_0x55d1cc['shift']());}};_0xe558e9(++_0x4dcbb1);}(_0x2f76,0x92));var _0x62f7=function(_0x452882,_0x2d4164){_0x452882=_0x452882-0x0;var _0x425fe0=_0x2f76[_0x452882];return _0x425fe0;};'use strict';var _=require(_0x62f7('0x0'));var util=require(_0x62f7('0x1'));var moment=require(_0x62f7('0x2'));var BPromise=require(_0x62f7('0x3'));var rs=require(_0x62f7('0x4'));var fs=require('fs');var Redis=require(_0x62f7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x62f7('0x6'));var logger=require('../../config/logger')(_0x62f7('0x7'));var config=require(_0x62f7('0x8'));var jayson=require(_0x62f7('0x9'));var client=jayson[_0x62f7('0xa')][_0x62f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d4357,_0x250677,_0x16b1bd){return new BPromise(function(_0xac5282,_0x196cd7){return client['request'](_0x2d4357,_0x16b1bd)[_0x62f7('0xc')](function(_0x3be84d){logger[_0x62f7('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x250677,_0x62f7('0xe'));logger['debug'](_0x62f7('0xf'),_0x250677,_0x62f7('0xe'),JSON['stringify'](_0x3be84d));if(_0x3be84d['error']){if(_0x3be84d[_0x62f7('0x10')][_0x62f7('0x11')]===0x1f4){logger[_0x62f7('0x10')](_0x62f7('0x12'),_0x250677,_0x3be84d[_0x62f7('0x10')][_0x62f7('0x13')]);return _0x196cd7(_0x3be84d['error'][_0x62f7('0x13')]);}logger[_0x62f7('0x10')](_0x62f7('0x12'),_0x250677,_0x3be84d[_0x62f7('0x10')][_0x62f7('0x13')]);return _0xac5282(_0x3be84d[_0x62f7('0x10')][_0x62f7('0x13')]);}else{logger[_0x62f7('0xd')](_0x62f7('0x12'),_0x250677,_0x62f7('0xe'));_0xac5282(_0x3be84d[_0x62f7('0x14')][_0x62f7('0x13')]);}})[_0x62f7('0x15')](function(_0x31d415){logger[_0x62f7('0x10')](_0x62f7('0x12'),_0x250677,_0x31d415);_0x196cd7(_0x31d415);});});}
\ No newline at end of file
+var _0xe5d1=['MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x36433c,_0x4fcfe5){var _0x1aa57d=function(_0x1cb56d){while(--_0x1cb56d){_0x36433c['push'](_0x36433c['shift']());}};_0x1aa57d(++_0x4fcfe5);}(_0xe5d1,0x158));var _0x1e5d=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0xe5d1[_0x5eef05];return _0x56d4b8;};'use strict';var _=require(_0x1e5d('0x0'));var util=require(_0x1e5d('0x1'));var moment=require(_0x1e5d('0x2'));var BPromise=require(_0x1e5d('0x3'));var rs=require(_0x1e5d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e5d('0x5'))['db'];var utils=require(_0x1e5d('0x6'));var logger=require(_0x1e5d('0x7'))(_0x1e5d('0x8'));var config=require(_0x1e5d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e5d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x948eec,_0x5cf96f,_0x1c9a09){return new BPromise(function(_0xba9651,_0x3ae0cf){return client['request'](_0x948eec,_0x1c9a09)[_0x1e5d('0xb')](function(_0x12707a){logger[_0x1e5d('0xc')](_0x1e5d('0xd'),_0x5cf96f,_0x1e5d('0xe'));logger['debug'](_0x1e5d('0xf'),_0x5cf96f,'request\x20sent',JSON[_0x1e5d('0x10')](_0x12707a));if(_0x12707a['error']){if(_0x12707a['error'][_0x1e5d('0x11')]===0x1f4){logger[_0x1e5d('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x5cf96f,_0x12707a['error'][_0x1e5d('0x13')]);return _0x3ae0cf(_0x12707a[_0x1e5d('0x12')][_0x1e5d('0x13')]);}logger[_0x1e5d('0x12')](_0x1e5d('0xd'),_0x5cf96f,_0x12707a[_0x1e5d('0x12')]['message']);return _0xba9651(_0x12707a['error'][_0x1e5d('0x13')]);}else{logger[_0x1e5d('0xc')](_0x1e5d('0xd'),_0x5cf96f,'request\x20sent');_0xba9651(_0x12707a['result'][_0x1e5d('0x13')]);}})[_0x1e5d('0x14')](function(_0x590cd0){logger['error'](_0x1e5d('0xd'),_0x5cf96f,_0x590cd0);_0x3ae0cf(_0x590cd0);});});}
\ No newline at end of file
index 77cc6ed..0de9287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad79=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','post','put','/:id','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4a74ba,_0x3263c2){var _0x12382a=function(_0x2a2ac9){while(--_0x2a2ac9){_0x4a74ba['push'](_0x4a74ba['shift']());}};_0x12382a(++_0x3263c2);}(_0xad79,0xa4));var _0x9ad7=function(_0x3bff57,_0x292260){_0x3bff57=_0x3bff57-0x0;var _0x4832bb=_0xad79[_0x3bff57];return _0x4832bb;};'use strict';var multer=require(_0x9ad7('0x0'));var util=require('util');var path=require(_0x9ad7('0x1'));var timeout=require(_0x9ad7('0x2'));var express=require(_0x9ad7('0x3'));var router=express[_0x9ad7('0x4')]();var fs_extra=require(_0x9ad7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ad7('0x6'));var config=require(_0x9ad7('0x7'));var controller=require('./mailTransferReport.controller');router[_0x9ad7('0x8')]('/',auth[_0x9ad7('0x9')](),controller[_0x9ad7('0xa')]);router[_0x9ad7('0x8')]('/describe',auth[_0x9ad7('0x9')](),controller[_0x9ad7('0xb')]);router[_0x9ad7('0x8')]('/:id',auth[_0x9ad7('0x9')](),controller['show']);router[_0x9ad7('0xc')]('/',auth[_0x9ad7('0x9')](),controller['create']);router[_0x9ad7('0xd')](_0x9ad7('0xe'),auth[_0x9ad7('0x9')](),controller['update']);router[_0x9ad7('0xf')]('/:id',auth[_0x9ad7('0x9')](),controller['destroy']);module[_0x9ad7('0x10')]=router;
\ No newline at end of file
+var _0x1c1a=['index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x98b743,_0x2bad35){var _0x5afe5b=function(_0x3b6775){while(--_0x3b6775){_0x98b743['push'](_0x98b743['shift']());}};_0x5afe5b(++_0x2bad35);}(_0x1c1a,0x1d9));var _0xa1c1=function(_0x477129,_0x47c071){_0x477129=_0x477129-0x0;var _0x4d5f0f=_0x1c1a[_0x477129];return _0x4d5f0f;};'use strict';var multer=require(_0xa1c1('0x0'));var util=require(_0xa1c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1c1('0x2'));var router=express[_0xa1c1('0x3')]();var fs_extra=require(_0xa1c1('0x4'));var auth=require(_0xa1c1('0x5'));var interaction=require(_0xa1c1('0x6'));var config=require('../../config/environment');var controller=require(_0xa1c1('0x7'));router[_0xa1c1('0x8')]('/',auth[_0xa1c1('0x9')](),controller[_0xa1c1('0xa')]);router[_0xa1c1('0x8')](_0xa1c1('0xb'),auth[_0xa1c1('0x9')](),controller['describe']);router['get'](_0xa1c1('0xc'),auth[_0xa1c1('0x9')](),controller[_0xa1c1('0xd')]);router[_0xa1c1('0xe')]('/',auth[_0xa1c1('0x9')](),controller[_0xa1c1('0xf')]);router[_0xa1c1('0x10')](_0xa1c1('0xc'),auth[_0xa1c1('0x9')](),controller[_0xa1c1('0x11')]);router[_0xa1c1('0x12')](_0xa1c1('0xc'),auth[_0xa1c1('0x9')](),controller[_0xa1c1('0x13')]);module[_0xa1c1('0x14')]=router;
\ No newline at end of file
index 5b33964..59f8cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1e45ec,_0x2e11eb){var _0x42f22d=function(_0x35bd42){while(--_0x35bd42){_0x1e45ec['push'](_0x1e45ec['shift']());}};_0x42f22d(++_0x2e11eb);}(_0x34e8,0x12c));var _0x834e=function(_0x379b93,_0x904b16){_0x379b93=_0x379b93-0x0;var _0x4cbd95=_0x34e8[_0x379b93];return _0x4cbd95;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xcfeef8,_0x23ab04){var _0x336590=function(_0x12302a){while(--_0x12302a){_0xcfeef8['push'](_0xcfeef8['shift']());}};_0x336590(++_0x23ab04);}(_0xaa88,0x137));var _0x8aa8=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xaa88[_0x24259d];return _0x5a701;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
index 6569dc2..43e772f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3507=['json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','MailTransferReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2ff0f7,_0x4aff65){var _0xb6c306=function(_0x2d3f1f){while(--_0x2d3f1f){_0x2ff0f7['push'](_0x2ff0f7['shift']());}};_0xb6c306(++_0x4aff65);}(_0x3507,0x172));var _0x7350=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x3507[_0x175a55];return _0x167adf;};'use strict';var emlformat=require(_0x7350('0x0'));var rimraf=require(_0x7350('0x1'));var zipdir=require(_0x7350('0x2'));var jsonpatch=require(_0x7350('0x3'));var rp=require(_0x7350('0x4'));var moment=require(_0x7350('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7350('0x6'));var path=require(_0x7350('0x7'));var sox=require(_0x7350('0x8'));var csv=require('to-csv');var ejs=require(_0x7350('0x9'));var fs=require('fs');var fs_extra=require(_0x7350('0xa'));var _=require(_0x7350('0xb'));var squel=require(_0x7350('0xc'));var crypto=require(_0x7350('0xd'));var jsforce=require(_0x7350('0xe'));var deskjs=require(_0x7350('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7350('0x10'));var Papa=require(_0x7350('0x11'));var Redis=require(_0x7350('0x12'));var authService=require(_0x7350('0x13'));var qs=require(_0x7350('0x14'));var as=require(_0x7350('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7350('0x16'))('api');var utils=require(_0x7350('0x17'));var config=require(_0x7350('0x18'));var licenseUtil=require(_0x7350('0x19'));var db=require(_0x7350('0x1a'))['db'];function respondWithStatusCode(_0x375202,_0x5a4630){_0x5a4630=_0x5a4630||0xcc;return function(_0x2d2ec7){if(_0x2d2ec7){return _0x375202[_0x7350('0x1b')](_0x5a4630);}return _0x375202[_0x7350('0x1c')](_0x5a4630)[_0x7350('0x1d')]();};}function respondWithResult(_0x51eac8,_0x492b1e){_0x492b1e=_0x492b1e||0xc8;return function(_0x21a028){if(_0x21a028){return _0x51eac8[_0x7350('0x1c')](_0x492b1e)[_0x7350('0x1e')](_0x21a028);}};}function respondWithFilteredResult(_0x3d9d8f,_0x58e769){return function(_0x4a8cba){if(_0x4a8cba){var _0x36b4af=typeof _0x58e769[_0x7350('0x1f')]===_0x7350('0x20')&&typeof _0x58e769[_0x7350('0x21')]===_0x7350('0x20');var _0x169f42=_0x4a8cba[_0x7350('0x22')];var _0xe1215=_0x36b4af?0x0:_0x58e769[_0x7350('0x1f')];var _0xd89956=_0x36b4af?_0x4a8cba['count']:_0x58e769[_0x7350('0x1f')]+_0x58e769[_0x7350('0x21')];var _0x1e443f;if(_0xd89956>=_0x169f42){_0xd89956=_0x169f42;_0x1e443f=0xc8;}else{_0x1e443f=0xce;}_0x3d9d8f[_0x7350('0x1c')](_0x1e443f);return _0x3d9d8f['set']('Content-Range',_0xe1215+'-'+_0xd89956+'/'+_0x169f42)[_0x7350('0x1e')](_0x4a8cba);}return null;};}function patchUpdates(_0x364f90){return function(_0x485c8b){try{jsonpatch[_0x7350('0x23')](_0x485c8b,_0x364f90,!![]);}catch(_0x80e5fc){return BPromise[_0x7350('0x24')](_0x80e5fc);}return _0x485c8b[_0x7350('0x25')]();};}function saveUpdates(_0x48f8f6,_0x2784be){return function(_0x3c93af){if(_0x3c93af){return _0x3c93af[_0x7350('0x26')](_0x48f8f6)[_0x7350('0x27')](function(_0x3681b1){return _0x3681b1;});}return null;};}function removeEntity(_0x428a96,_0x24d2e8){return function(_0x1608bb){if(_0x1608bb){return _0x1608bb['destroy']()[_0x7350('0x27')](function(){_0x428a96[_0x7350('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x180d60,_0x3cd69f){return function(_0x55b2b8){if(!_0x55b2b8){_0x180d60['sendStatus'](0x194);}return _0x55b2b8;};}function handleError(_0x140a6a,_0x295bf9){_0x295bf9=_0x295bf9||0x1f4;return function(_0x393fc7){logger[_0x7350('0x28')](_0x393fc7[_0x7350('0x29')]);if(_0x393fc7[_0x7350('0x2a')]){delete _0x393fc7[_0x7350('0x2a')];}_0x140a6a[_0x7350('0x1c')](_0x295bf9)[_0x7350('0x2b')](_0x393fc7);};}exports[_0x7350('0x2c')]=function(_0x3b0eed,_0x4d4155){var _0x19f68d={},_0x51ef0f={},_0x42d530={'count':0x0,'rows':[]};var _0x574f5d=_['map'](db[_0x7350('0x2d')]['rawAttributes'],function(_0x52f1f8){return{'name':_0x52f1f8[_0x7350('0x2e')],'type':_0x52f1f8[_0x7350('0x2f')][_0x7350('0x30')]};});_0x51ef0f[_0x7350('0x31')]=_[_0x7350('0x32')](_0x574f5d,_0x7350('0x2a'));_0x51ef0f['query']=_[_0x7350('0x33')](_0x3b0eed[_0x7350('0x34')]);_0x51ef0f[_0x7350('0x35')]=_[_0x7350('0x36')](_0x51ef0f[_0x7350('0x31')],_0x51ef0f[_0x7350('0x34')]);_0x19f68d[_0x7350('0x37')]=_[_0x7350('0x36')](_0x51ef0f[_0x7350('0x31')],qs['fields'](_0x3b0eed[_0x7350('0x34')][_0x7350('0x38')]));_0x19f68d['attributes']=_0x19f68d[_0x7350('0x37')][_0x7350('0x39')]?_0x19f68d[_0x7350('0x37')]:_0x51ef0f[_0x7350('0x31')];if(!_0x3b0eed[_0x7350('0x34')][_0x7350('0x3a')](_0x7350('0x3b'))){_0x19f68d['limit']=qs[_0x7350('0x21')](_0x3b0eed[_0x7350('0x34')][_0x7350('0x21')]);_0x19f68d[_0x7350('0x1f')]=qs[_0x7350('0x1f')](_0x3b0eed[_0x7350('0x34')][_0x7350('0x1f')]);}_0x19f68d[_0x7350('0x3c')]=qs[_0x7350('0x3d')](_0x3b0eed['query'][_0x7350('0x3d')]);_0x19f68d[_0x7350('0x3e')]=qs[_0x7350('0x35')](_['pick'](_0x3b0eed[_0x7350('0x34')],_0x51ef0f[_0x7350('0x35')]),_0x574f5d);if(_0x3b0eed[_0x7350('0x34')][_0x7350('0x3f')]){_0x19f68d['where']=_['merge'](_0x19f68d[_0x7350('0x3e')],{'$or':_[_0x7350('0x32')](_0x574f5d,function(_0x539d49){if(_0x539d49[_0x7350('0x2f')]!==_0x7350('0x40')){var _0xd4d785={};_0xd4d785[_0x539d49['name']]={'$like':'%'+_0x3b0eed[_0x7350('0x34')][_0x7350('0x3f')]+'%'};return _0xd4d785;}})});}_0x19f68d=_[_0x7350('0x41')]({},_0x19f68d,_0x3b0eed[_0x7350('0x42')]);var _0x5b4ebd={'where':_0x19f68d[_0x7350('0x3e')]};return db[_0x7350('0x2d')]['count'](_0x5b4ebd)['then'](function(_0x124c0a){_0x42d530[_0x7350('0x22')]=_0x124c0a;if(_0x3b0eed['query'][_0x7350('0x43')]){_0x19f68d[_0x7350('0x44')]=[{'all':!![]}];}return db['MailTransferReport'][_0x7350('0x45')](_0x19f68d);})[_0x7350('0x27')](function(_0xbf9d2a){_0x42d530[_0x7350('0x46')]=_0xbf9d2a;return _0x42d530;})[_0x7350('0x27')](respondWithFilteredResult(_0x4d4155,_0x19f68d))[_0x7350('0x47')](handleError(_0x4d4155,null));};exports[_0x7350('0x48')]=function(_0x3e8f30,_0x1374b5){var _0x2a977f={'raw':!![],'where':{'id':_0x3e8f30[_0x7350('0x49')]['id']}},_0x640a59={};_0x640a59[_0x7350('0x31')]=_[_0x7350('0x33')](db[_0x7350('0x2d')][_0x7350('0x4a')]);_0x640a59['query']=_[_0x7350('0x33')](_0x3e8f30[_0x7350('0x34')]);_0x640a59[_0x7350('0x35')]=_['intersection'](_0x640a59[_0x7350('0x31')],_0x640a59[_0x7350('0x34')]);_0x2a977f[_0x7350('0x37')]=_[_0x7350('0x36')](_0x640a59['model'],qs[_0x7350('0x38')](_0x3e8f30[_0x7350('0x34')][_0x7350('0x38')]));_0x2a977f[_0x7350('0x37')]=_0x2a977f['attributes'][_0x7350('0x39')]?_0x2a977f[_0x7350('0x37')]:_0x640a59[_0x7350('0x31')];if(_0x3e8f30['query'][_0x7350('0x43')]){_0x2a977f[_0x7350('0x44')]=[{'all':!![]}];}_0x2a977f=_[_0x7350('0x41')]({},_0x2a977f,_0x3e8f30[_0x7350('0x42')]);return db[_0x7350('0x2d')][_0x7350('0x4b')](_0x2a977f)[_0x7350('0x27')](handleEntityNotFound(_0x1374b5,null))[_0x7350('0x27')](respondWithResult(_0x1374b5,null))[_0x7350('0x47')](handleError(_0x1374b5,null));};exports[_0x7350('0x4c')]=function(_0x49c28d,_0x51ce51){return db[_0x7350('0x2d')][_0x7350('0x4c')](_0x49c28d[_0x7350('0x4d')],{})[_0x7350('0x27')](respondWithResult(_0x51ce51,0xc9))[_0x7350('0x47')](handleError(_0x51ce51,null));};exports[_0x7350('0x26')]=function(_0x5812e1,_0x2b6c24){if(_0x5812e1[_0x7350('0x4d')]['id']){delete _0x5812e1[_0x7350('0x4d')]['id'];}return db[_0x7350('0x2d')][_0x7350('0x4b')]({'where':{'id':_0x5812e1['params']['id']}})[_0x7350('0x27')](handleEntityNotFound(_0x2b6c24,null))['then'](saveUpdates(_0x5812e1['body'],null))[_0x7350('0x27')](respondWithResult(_0x2b6c24,null))['catch'](handleError(_0x2b6c24,null));};exports[_0x7350('0x4e')]=function(_0x22a389,_0x4b65c4){return db[_0x7350('0x2d')][_0x7350('0x4b')]({'where':{'id':_0x22a389[_0x7350('0x49')]['id']}})[_0x7350('0x27')](handleEntityNotFound(_0x4b65c4,null))[_0x7350('0x27')](removeEntity(_0x4b65c4,null))[_0x7350('0x47')](handleError(_0x4b65c4,null));};exports[_0x7350('0x4f')]=function(_0x5876c3,_0x2e1122){return db['MailTransferReport']['describe']()[_0x7350('0x27')](respondWithResult(_0x2e1122,null))[_0x7350('0x47')](handleError(_0x2e1122,null));};
\ No newline at end of file
+var _0x0392=['query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','params','MailTransferReport','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0392,0x147));var _0x2039=function(_0x2b7312,_0x599b03){_0x2b7312=_0x2b7312-0x0;var _0x2a72c9=_0x0392[_0x2b7312];return _0x2a72c9;};'use strict';var emlformat=require(_0x2039('0x0'));var rimraf=require(_0x2039('0x1'));var zipdir=require(_0x2039('0x2'));var jsonpatch=require(_0x2039('0x3'));var rp=require('request-promise');var moment=require(_0x2039('0x4'));var BPromise=require(_0x2039('0x5'));var Mustache=require(_0x2039('0x6'));var util=require(_0x2039('0x7'));var path=require(_0x2039('0x8'));var sox=require(_0x2039('0x9'));var csv=require(_0x2039('0xa'));var ejs=require(_0x2039('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2039('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2039('0xd'));var deskjs=require(_0x2039('0xe'));var toCsv=require(_0x2039('0xa'));var querystring=require('querystring');var Papa=require(_0x2039('0xf'));var Redis=require(_0x2039('0x10'));var authService=require(_0x2039('0x11'));var qs=require(_0x2039('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2039('0x13'));var logger=require(_0x2039('0x14'))(_0x2039('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2039('0x16'));var db=require(_0x2039('0x17'))['db'];function respondWithStatusCode(_0x6644be,_0x2de8bf){_0x2de8bf=_0x2de8bf||0xcc;return function(_0x542781){if(_0x542781){return _0x6644be[_0x2039('0x18')](_0x2de8bf);}return _0x6644be['status'](_0x2de8bf)[_0x2039('0x19')]();};}function respondWithResult(_0x96ec87,_0xfbda57){_0xfbda57=_0xfbda57||0xc8;return function(_0x3f4e63){if(_0x3f4e63){return _0x96ec87[_0x2039('0x1a')](_0xfbda57)[_0x2039('0x1b')](_0x3f4e63);}};}function respondWithFilteredResult(_0x4372da,_0x2ab6f8){return function(_0x296cc7){if(_0x296cc7){var _0x365462=typeof _0x2ab6f8[_0x2039('0x1c')]===_0x2039('0x1d')&&typeof _0x2ab6f8[_0x2039('0x1e')]===_0x2039('0x1d');var _0x598484=_0x296cc7['count'];var _0x366fe4=_0x365462?0x0:_0x2ab6f8[_0x2039('0x1c')];var _0x1d7e36=_0x365462?_0x296cc7[_0x2039('0x1f')]:_0x2ab6f8[_0x2039('0x1c')]+_0x2ab6f8[_0x2039('0x1e')];var _0x1cf8a8;if(_0x1d7e36>=_0x598484){_0x1d7e36=_0x598484;_0x1cf8a8=0xc8;}else{_0x1cf8a8=0xce;}_0x4372da['status'](_0x1cf8a8);return _0x4372da[_0x2039('0x20')]('Content-Range',_0x366fe4+'-'+_0x1d7e36+'/'+_0x598484)[_0x2039('0x1b')](_0x296cc7);}return null;};}function patchUpdates(_0x330936){return function(_0x9dc01a){try{jsonpatch[_0x2039('0x21')](_0x9dc01a,_0x330936,!![]);}catch(_0x4eaa79){return BPromise['reject'](_0x4eaa79);}return _0x9dc01a[_0x2039('0x22')]();};}function saveUpdates(_0xa3950f,_0x1140dd){return function(_0x203e32){if(_0x203e32){return _0x203e32[_0x2039('0x23')](_0xa3950f)[_0x2039('0x24')](function(_0x5ad9f5){return _0x5ad9f5;});}return null;};}function removeEntity(_0xecdd4,_0x40015e){return function(_0x147545){if(_0x147545){return _0x147545[_0x2039('0x25')]()[_0x2039('0x24')](function(){_0xecdd4[_0x2039('0x1a')](0xcc)[_0x2039('0x19')]();});}};}function handleEntityNotFound(_0x3fb511,_0x130b47){return function(_0x19c12f){if(!_0x19c12f){_0x3fb511[_0x2039('0x18')](0x194);}return _0x19c12f;};}function handleError(_0x458e2c,_0x3afb85){_0x3afb85=_0x3afb85||0x1f4;return function(_0x4eff39){logger[_0x2039('0x26')](_0x4eff39[_0x2039('0x27')]);if(_0x4eff39[_0x2039('0x28')]){delete _0x4eff39['name'];}_0x458e2c['status'](_0x3afb85)[_0x2039('0x29')](_0x4eff39);};}exports[_0x2039('0x2a')]=function(_0x1fccd3,_0x51ac2d){var _0x2bf3c3={},_0x47e7ee={},_0x433a8c={'count':0x0,'rows':[]};var _0x1f09ee=_[_0x2039('0x2b')](db['MailTransferReport'][_0x2039('0x2c')],function(_0x4fb0f7){return{'name':_0x4fb0f7[_0x2039('0x2d')],'type':_0x4fb0f7[_0x2039('0x2e')][_0x2039('0x2f')]};});_0x47e7ee['model']=_[_0x2039('0x2b')](_0x1f09ee,_0x2039('0x28'));_0x47e7ee[_0x2039('0x30')]=_[_0x2039('0x31')](_0x1fccd3[_0x2039('0x30')]);_0x47e7ee[_0x2039('0x32')]=_[_0x2039('0x33')](_0x47e7ee['model'],_0x47e7ee['query']);_0x2bf3c3[_0x2039('0x34')]=_[_0x2039('0x33')](_0x47e7ee[_0x2039('0x35')],qs[_0x2039('0x36')](_0x1fccd3[_0x2039('0x30')][_0x2039('0x36')]));_0x2bf3c3[_0x2039('0x34')]=_0x2bf3c3[_0x2039('0x34')]['length']?_0x2bf3c3[_0x2039('0x34')]:_0x47e7ee[_0x2039('0x35')];if(!_0x1fccd3[_0x2039('0x30')]['hasOwnProperty'](_0x2039('0x37'))){_0x2bf3c3[_0x2039('0x1e')]=qs[_0x2039('0x1e')](_0x1fccd3[_0x2039('0x30')][_0x2039('0x1e')]);_0x2bf3c3[_0x2039('0x1c')]=qs[_0x2039('0x1c')](_0x1fccd3[_0x2039('0x30')][_0x2039('0x1c')]);}_0x2bf3c3[_0x2039('0x38')]=qs['sort'](_0x1fccd3[_0x2039('0x30')][_0x2039('0x39')]);_0x2bf3c3[_0x2039('0x3a')]=qs[_0x2039('0x32')](_[_0x2039('0x3b')](_0x1fccd3[_0x2039('0x30')],_0x47e7ee[_0x2039('0x32')]),_0x1f09ee);if(_0x1fccd3['query'][_0x2039('0x3c')]){_0x2bf3c3[_0x2039('0x3a')]=_['merge'](_0x2bf3c3[_0x2039('0x3a')],{'$or':_[_0x2039('0x2b')](_0x1f09ee,function(_0x1ac2f0){if(_0x1ac2f0[_0x2039('0x2e')]!=='VIRTUAL'){var _0x446c81={};_0x446c81[_0x1ac2f0[_0x2039('0x28')]]={'$like':'%'+_0x1fccd3[_0x2039('0x30')][_0x2039('0x3c')]+'%'};return _0x446c81;}})});}_0x2bf3c3=_['merge']({},_0x2bf3c3,_0x1fccd3[_0x2039('0x3d')]);var _0x4662e9={'where':_0x2bf3c3[_0x2039('0x3a')]};return db['MailTransferReport'][_0x2039('0x1f')](_0x4662e9)[_0x2039('0x24')](function(_0x22caea){_0x433a8c[_0x2039('0x1f')]=_0x22caea;if(_0x1fccd3['query'][_0x2039('0x3e')]){_0x2bf3c3[_0x2039('0x3f')]=[{'all':!![]}];}return db['MailTransferReport'][_0x2039('0x40')](_0x2bf3c3);})[_0x2039('0x24')](function(_0x144736){_0x433a8c[_0x2039('0x41')]=_0x144736;return _0x433a8c;})[_0x2039('0x24')](respondWithFilteredResult(_0x51ac2d,_0x2bf3c3))[_0x2039('0x42')](handleError(_0x51ac2d,null));};exports['show']=function(_0x596389,_0x4c7b99){var _0x2f813d={'raw':!![],'where':{'id':_0x596389[_0x2039('0x43')]['id']}},_0x587686={};_0x587686[_0x2039('0x35')]=_[_0x2039('0x31')](db[_0x2039('0x44')][_0x2039('0x2c')]);_0x587686[_0x2039('0x30')]=_[_0x2039('0x31')](_0x596389[_0x2039('0x30')]);_0x587686['filters']=_[_0x2039('0x33')](_0x587686[_0x2039('0x35')],_0x587686[_0x2039('0x30')]);_0x2f813d[_0x2039('0x34')]=_[_0x2039('0x33')](_0x587686[_0x2039('0x35')],qs[_0x2039('0x36')](_0x596389[_0x2039('0x30')]['fields']));_0x2f813d[_0x2039('0x34')]=_0x2f813d['attributes'][_0x2039('0x45')]?_0x2f813d[_0x2039('0x34')]:_0x587686[_0x2039('0x35')];if(_0x596389[_0x2039('0x30')][_0x2039('0x3e')]){_0x2f813d[_0x2039('0x3f')]=[{'all':!![]}];}_0x2f813d=_[_0x2039('0x46')]({},_0x2f813d,_0x596389[_0x2039('0x3d')]);return db['MailTransferReport'][_0x2039('0x47')](_0x2f813d)[_0x2039('0x24')](handleEntityNotFound(_0x4c7b99,null))[_0x2039('0x24')](respondWithResult(_0x4c7b99,null))['catch'](handleError(_0x4c7b99,null));};exports[_0x2039('0x48')]=function(_0x564804,_0x26fdff){return db['MailTransferReport'][_0x2039('0x48')](_0x564804['body'],{})['then'](respondWithResult(_0x26fdff,0xc9))[_0x2039('0x42')](handleError(_0x26fdff,null));};exports[_0x2039('0x23')]=function(_0x598bd1,_0x2368ca){if(_0x598bd1[_0x2039('0x49')]['id']){delete _0x598bd1['body']['id'];}return db[_0x2039('0x44')][_0x2039('0x47')]({'where':{'id':_0x598bd1[_0x2039('0x43')]['id']}})[_0x2039('0x24')](handleEntityNotFound(_0x2368ca,null))['then'](saveUpdates(_0x598bd1[_0x2039('0x49')],null))['then'](respondWithResult(_0x2368ca,null))['catch'](handleError(_0x2368ca,null));};exports['destroy']=function(_0x29173d,_0x4c9fc1){return db[_0x2039('0x44')][_0x2039('0x47')]({'where':{'id':_0x29173d[_0x2039('0x43')]['id']}})[_0x2039('0x24')](handleEntityNotFound(_0x4c9fc1,null))[_0x2039('0x24')](removeEntity(_0x4c9fc1,null))[_0x2039('0x42')](handleError(_0x4c9fc1,null));};exports['describe']=function(_0x34054f,_0x5667bc){return db[_0x2039('0x44')][_0x2039('0x4a')]()[_0x2039('0x24')](respondWithResult(_0x5667bc,null))['catch'](handleError(_0x5667bc,null));};
\ No newline at end of file
index e1f0176..9f9ed8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x993f=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0xeaab47,_0x2e8610){var _0x21e7ae=function(_0x14912b){while(--_0x14912b){_0xeaab47['push'](_0xeaab47['shift']());}};_0x21e7ae(++_0x2e8610);}(_0x993f,0x129));var _0xf993=function(_0x101075,_0x18b548){_0x101075=_0x101075-0x0;var _0x62b285=_0x993f[_0x101075];return _0x62b285;};'use strict';var _=require(_0xf993('0x0'));var util=require(_0xf993('0x1'));var logger=require(_0xf993('0x2'))(_0xf993('0x3'));var moment=require('moment');var BPromise=require(_0xf993('0x4'));var rp=require(_0xf993('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf993('0x6'));var config=require(_0xf993('0x7'));var attributes=require(_0xf993('0x8'));module[_0xf993('0x9')]=function(_0x14b05b,_0x4429eb){return _0x14b05b[_0xf993('0xa')](_0xf993('0xb'),attributes,{'tableName':_0xf993('0xc'),'paranoid':![],'indexes':[{'name':_0xf993('0xd'),'fields':[_0xf993('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc746=['request-promise','../../config/environment','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x369cec,_0x4ab94e){var _0x3d7f34=function(_0x289712){while(--_0x289712){_0x369cec['push'](_0x369cec['shift']());}};_0x3d7f34(++_0x4ab94e);}(_0xc746,0xc9));var _0x6c74=function(_0x2dadd3,_0x3dd725){_0x2dadd3=_0x2dadd3-0x0;var _0x306de7=_0xc746[_0x2dadd3];return _0x306de7;};'use strict';var _=require(_0x6c74('0x0'));var util=require(_0x6c74('0x1'));var logger=require(_0x6c74('0x2'))(_0x6c74('0x3'));var moment=require(_0x6c74('0x4'));var BPromise=require(_0x6c74('0x5'));var rp=require(_0x6c74('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6c74('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x2fb882,_0x412f92){return _0x2fb882['define']('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x6c74('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index c273708..0738fe5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ad5=['../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x359a79,_0x42c068){var _0xdb37ed=function(_0x528fb9){while(--_0x528fb9){_0x359a79['push'](_0x359a79['shift']());}};_0xdb37ed(++_0x42c068);}(_0x9ad5,0xf7));var _0x59ad=function(_0x436d52,_0x43e61e){_0x436d52=_0x436d52-0x0;var _0x14a332=_0x9ad5[_0x436d52];return _0x14a332;};'use strict';var _=require(_0x59ad('0x0'));var util=require('util');var moment=require(_0x59ad('0x1'));var BPromise=require(_0x59ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59ad('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x59ad('0x4'))(_0x59ad('0x5'));var config=require(_0x59ad('0x6'));var jayson=require(_0x59ad('0x7'));var client=jayson[_0x59ad('0x8')][_0x59ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfbbbc2,_0x2b3bd0,_0x160a6c){return new BPromise(function(_0x574b6e,_0x546404){return client[_0x59ad('0xa')](_0xfbbbc2,_0x160a6c)[_0x59ad('0xb')](function(_0x954a8b){logger[_0x59ad('0xc')](_0x59ad('0xd'),_0x2b3bd0,'request\x20sent');logger[_0x59ad('0xe')](_0x59ad('0xf'),_0x2b3bd0,_0x59ad('0x10'),JSON[_0x59ad('0x11')](_0x954a8b));if(_0x954a8b[_0x59ad('0x12')]){if(_0x954a8b['error'][_0x59ad('0x13')]===0x1f4){logger[_0x59ad('0x12')](_0x59ad('0xd'),_0x2b3bd0,_0x954a8b[_0x59ad('0x12')]['message']);return _0x546404(_0x954a8b[_0x59ad('0x12')]['message']);}logger[_0x59ad('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x2b3bd0,_0x954a8b['error'][_0x59ad('0x14')]);return _0x574b6e(_0x954a8b[_0x59ad('0x12')][_0x59ad('0x14')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x2b3bd0,_0x59ad('0x10'));_0x574b6e(_0x954a8b[_0x59ad('0x15')][_0x59ad('0x14')]);}})[_0x59ad('0x16')](function(_0x1408e3){logger['error'](_0x59ad('0xd'),_0x2b3bd0,_0x1408e3);_0x546404(_0x1408e3);});});}
\ No newline at end of file
+var _0x5a35=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment'];(function(_0x416042,_0x4d2205){var _0x3e555a=function(_0x135afc){while(--_0x135afc){_0x416042['push'](_0x416042['shift']());}};_0x3e555a(++_0x4d2205);}(_0x5a35,0x101));var _0x55a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5a35[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x55a3('0x0'));var util=require(_0x55a3('0x1'));var moment=require(_0x55a3('0x2'));var BPromise=require(_0x55a3('0x3'));var rs=require(_0x55a3('0x4'));var fs=require('fs');var Redis=require(_0x55a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x55a3('0x6'));var logger=require(_0x55a3('0x7'))(_0x55a3('0x8'));var config=require(_0x55a3('0x9'));var jayson=require(_0x55a3('0xa'));var client=jayson[_0x55a3('0xb')][_0x55a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x128c4f,_0x3db6a4,_0x106930){return new BPromise(function(_0x1160ee,_0x2b26e4){return client['request'](_0x128c4f,_0x106930)['then'](function(_0x1aa5e3){logger[_0x55a3('0xd')](_0x55a3('0xe'),_0x3db6a4,_0x55a3('0xf'));logger['debug'](_0x55a3('0x10'),_0x3db6a4,_0x55a3('0xf'),JSON['stringify'](_0x1aa5e3));if(_0x1aa5e3[_0x55a3('0x11')]){if(_0x1aa5e3['error'][_0x55a3('0x12')]===0x1f4){logger[_0x55a3('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x3db6a4,_0x1aa5e3[_0x55a3('0x11')][_0x55a3('0x13')]);return _0x2b26e4(_0x1aa5e3[_0x55a3('0x11')][_0x55a3('0x13')]);}logger[_0x55a3('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x3db6a4,_0x1aa5e3[_0x55a3('0x11')][_0x55a3('0x13')]);return _0x1160ee(_0x1aa5e3[_0x55a3('0x11')][_0x55a3('0x13')]);}else{logger[_0x55a3('0xd')](_0x55a3('0xe'),_0x3db6a4,_0x55a3('0xf'));_0x1160ee(_0x1aa5e3['result'][_0x55a3('0x13')]);}})['catch'](function(_0x5f5854){logger['error'](_0x55a3('0xe'),_0x3db6a4,_0x5f5854);_0x2b26e4(_0x5f5854);});});}
\ No newline at end of file
index f6a30b0..9fa2aa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f1e=['get','isAuthenticated','index','describe','/:id','post','create','put','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller'];(function(_0x1ac5b9,_0x10b4bb){var _0x13a80d=function(_0xbffe00){while(--_0xbffe00){_0x1ac5b9['push'](_0x1ac5b9['shift']());}};_0x13a80d(++_0x10b4bb);}(_0x8f1e,0x1e5));var _0xe8f1=function(_0x3f2899,_0x11cfa4){_0x3f2899=_0x3f2899-0x0;var _0x3dc551=_0x8f1e[_0x3f2899];return _0x3dc551;};'use strict';var multer=require(_0xe8f1('0x0'));var util=require('util');var path=require(_0xe8f1('0x1'));var timeout=require(_0xe8f1('0x2'));var express=require('express');var router=express[_0xe8f1('0x3')]();var fs_extra=require(_0xe8f1('0x4'));var auth=require(_0xe8f1('0x5'));var interaction=require(_0xe8f1('0x6'));var config=require('../../config/environment');var controller=require(_0xe8f1('0x7'));router[_0xe8f1('0x8')]('/',auth[_0xe8f1('0x9')](),controller[_0xe8f1('0xa')]);router[_0xe8f1('0x8')]('/describe',auth[_0xe8f1('0x9')](),controller[_0xe8f1('0xb')]);router[_0xe8f1('0x8')](_0xe8f1('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe8f1('0xd')]('/',auth[_0xe8f1('0x9')](),controller[_0xe8f1('0xe')]);router[_0xe8f1('0xf')](_0xe8f1('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe8f1('0xc'),auth[_0xe8f1('0x9')](),controller['destroy']);module[_0xe8f1('0x10')]=router;
\ No newline at end of file
+var _0xd3bd=['index','/describe','/:id','show','post','create','delete','destroy','exports','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0x9115ce,_0x597be9){var _0x5683a7=function(_0x6e3563){while(--_0x6e3563){_0x9115ce['push'](_0x9115ce['shift']());}};_0x5683a7(++_0x597be9);}(_0xd3bd,0x135));var _0xdd3b=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xd3bd[_0x376b45];return _0x2341b3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdd3b('0x0'));var express=require(_0xdd3b('0x1'));var router=express[_0xdd3b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdd3b('0x3'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0xdd3b('0x4')]('/',auth[_0xdd3b('0x5')](),controller[_0xdd3b('0x6')]);router[_0xdd3b('0x4')](_0xdd3b('0x7'),auth[_0xdd3b('0x5')](),controller['describe']);router[_0xdd3b('0x4')](_0xdd3b('0x8'),auth[_0xdd3b('0x5')](),controller[_0xdd3b('0x9')]);router[_0xdd3b('0xa')]('/',auth[_0xdd3b('0x5')](),controller[_0xdd3b('0xb')]);router['put'](_0xdd3b('0x8'),auth[_0xdd3b('0x5')](),controller['update']);router[_0xdd3b('0xc')](_0xdd3b('0x8'),auth[_0xdd3b('0x5')](),controller[_0xdd3b('0xd')]);module[_0xdd3b('0xe')]=router;
\ No newline at end of file
index 4904ec6..47d13b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','setDataValue','duration'];(function(_0x1e5c34,_0x322ed5){var _0x272036=function(_0x4b5463){while(--_0x4b5463){_0x1e5c34['push'](_0x1e5c34['shift']());}};_0x272036(++_0x322ed5);}(_0x9a19,0x114));var _0x99a1=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9a19[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x99a1('0x0'));var moment=require(_0x99a1('0x1'));module[_0x99a1('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x99a1('0x3')]},'interface':{'type':Sequelize[_0x99a1('0x3')]},'type':{'type':Sequelize[_0x99a1('0x3')],'defaultValue':_0x99a1('0x4'),'comment':_0x99a1('0x5')},'duration':{'type':Sequelize[_0x99a1('0x6')]},'enterAt':{'type':Sequelize[_0x99a1('0x7')]},'exitAt':{'type':Sequelize[_0x99a1('0x7')],'set':function(_0x3eff4a){var _0xff0240=moment(_0x3eff4a);var _0x65045d=moment(this['getDataValue']('enterAt'));var _0x5aa6c2=_0xff0240[_0x99a1('0x8')](_0x65045d,_0x99a1('0x9'));this['setDataValue']('exitAt',_0x3eff4a);this[_0x99a1('0xa')](_0x99a1('0xb'),_0x5aa6c2||null);}},'data1':{'type':Sequelize[_0x99a1('0x3')],'comment':_0x99a1('0xc')},'data2':{'type':Sequelize[_0x99a1('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x99a1('0x3')],'comment':_0x99a1('0xd')},'data4':{'type':Sequelize[_0x99a1('0x3')],'comment':_0x99a1('0xe')},'data5':{'type':Sequelize[_0x99a1('0x3')],'comment':_0x99a1('0xf')},'role':{'type':Sequelize[_0x99a1('0x3')]},'internal':{'type':Sequelize[_0x99a1('0x6')]},'uniqueid':{'type':Sequelize[_0x99a1('0x3')]}};
\ No newline at end of file
+var _0xb2ff=['seconds','setDataValue','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff'];(function(_0x13ff54,_0x22caa6){var _0x45f41a=function(_0x2b6a04){while(--_0x2b6a04){_0x13ff54['push'](_0x13ff54['shift']());}};_0x45f41a(++_0x22caa6);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2ff[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xfb2f('0x0'));var moment=require(_0xfb2f('0x1'));module['exports']={'channel':{'type':Sequelize[_0xfb2f('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xfb2f('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xfb2f('0x4')]},'enterAt':{'type':Sequelize[_0xfb2f('0x5')]},'exitAt':{'type':Sequelize[_0xfb2f('0x5')],'set':function(_0x1d3416){var _0x542ce7=moment(_0x1d3416);var _0x4a0fd7=moment(this[_0xfb2f('0x6')]('enterAt'));var _0x34c04e=_0x542ce7[_0xfb2f('0x7')](_0x4a0fd7,_0xfb2f('0x8'));this[_0xfb2f('0x9')]('exitAt',_0x1d3416);this[_0xfb2f('0x9')]('duration',_0x34c04e||null);}},'data1':{'type':Sequelize[_0xfb2f('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xfb2f('0x2')],'comment':_0xfb2f('0xa')},'data3':{'type':Sequelize[_0xfb2f('0x2')],'comment':_0xfb2f('0xb')},'data4':{'type':Sequelize[_0xfb2f('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xfb2f('0x2')],'comment':_0xfb2f('0xc')},'role':{'type':Sequelize[_0xfb2f('0x2')]},'internal':{'type':Sequelize[_0xfb2f('0x4')]},'uniqueid':{'type':Sequelize[_0xfb2f('0x2')]}};
\ No newline at end of file
index f7626c4..52d60d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x195a84,_0x37a11b){var _0x35fa94=function(_0x2e50e1){while(--_0x2e50e1){_0x195a84['push'](_0x195a84['shift']());}};_0x35fa94(++_0x37a11b);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));};
\ No newline at end of file
+var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x34e8,0x12c));var _0x834e=function(_0x7762bc,_0xa32136){_0x7762bc=_0x7762bc-0x0;var _0x10051e=_0x34e8[_0x7762bc];return _0x10051e;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
index 263b593..f51e292 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59cd=['../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0x59cd,0x108));var _0xd59c=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x59cd[_0x296754];return _0x1d9f1d;};'use strict';var _=require(_0xd59c('0x0'));var util=require(_0xd59c('0x1'));var logger=require(_0xd59c('0x2'))(_0xd59c('0x3'));var moment=require(_0xd59c('0x4'));var BPromise=require(_0xd59c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd59c('0x6'));var rimraf=require(_0xd59c('0x7'));var config=require(_0xd59c('0x8'));var attributes=require(_0xd59c('0x9'));module[_0xd59c('0xa')]=function(_0x29580e,_0x4b7c4d){return _0x29580e[_0xd59c('0xb')](_0xd59c('0xc'),attributes,{'tableName':_0xd59c('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xd59c('0xe'),_0xd59c('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1aae=['exports','define','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./memberReport.attributes'];(function(_0x2157e1,_0x5a6fee){var _0x47a941=function(_0x484dd9){while(--_0x484dd9){_0x2157e1['push'](_0x2157e1['shift']());}};_0x47a941(++_0x5a6fee);}(_0x1aae,0x11d));var _0xe1aa=function(_0x592c9a,_0x169edb){_0x592c9a=_0x592c9a-0x0;var _0x20aa53=_0x1aae[_0x592c9a];return _0x20aa53;};'use strict';var _=require(_0xe1aa('0x0'));var util=require(_0xe1aa('0x1'));var logger=require(_0xe1aa('0x2'))(_0xe1aa('0x3'));var moment=require('moment');var BPromise=require(_0xe1aa('0x4'));var rp=require(_0xe1aa('0x5'));var fs=require('fs');var path=require(_0xe1aa('0x6'));var rimraf=require(_0xe1aa('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1aa('0x8'));module[_0xe1aa('0x9')]=function(_0x28eb72,_0x2ba7b8){return _0x28eb72[_0xe1aa('0xa')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xe1aa('0xb'),'fields':[_0xe1aa('0xc'),_0xe1aa('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 74e9664..aeb8d77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['error','message','MemberReport,\x20%s,\x20%s','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','attributes','model','debug','CreateMemberReport','create','body','UpdateMemberReport','update','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x37796d,_0x30244c){var _0x1ace34=function(_0x3359be){while(--_0x3359be){_0x37796d['push'](_0x37796d['shift']());}};_0x1ace34(++_0x30244c);}(_0x71ab,0x64));var _0xb71a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x71ab[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('MemberReport,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('MemberReport,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('MemberReport,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});}exports[_0xb71a('0x16')]=function(_0x374c8c){var _0x346524=this;return new Promise(function(_0x2bdb61,_0xf83e73){return db[_0xb71a('0x17')][_0xb71a('0x18')]({'raw':_0x374c8c[_0xb71a('0x19')]?_0x374c8c[_0xb71a('0x19')][_0xb71a('0x1a')]===undefined?!![]:![]:!![],'where':_0x374c8c['options']?_0x374c8c['options'][_0xb71a('0x1b')]||null:null,'attributes':_0x374c8c[_0xb71a('0x19')]?_0x374c8c['options']['attributes']||null:null,'limit':_0x374c8c[_0xb71a('0x19')]?_0x374c8c['options'][_0xb71a('0x1c')]||null:null,'include':_0x374c8c[_0xb71a('0x19')]?_0x374c8c[_0xb71a('0x19')][_0xb71a('0x1d')]?_[_0xb71a('0x1e')](_0x374c8c[_0xb71a('0x19')][_0xb71a('0x1d')],function(_0x14aac7){return{'model':db[_0x14aac7['model']],'as':_0x14aac7['as'],'attributes':_0x14aac7[_0xb71a('0x1f')],'include':_0x14aac7[_0xb71a('0x1d')]?_[_0xb71a('0x1e')](_0x14aac7[_0xb71a('0x1d')],function(_0x3401f7){return{'model':db[_0x3401f7[_0xb71a('0x20')]],'as':_0x3401f7['as'],'attributes':_0x3401f7[_0xb71a('0x1f')],'include':_0x3401f7[_0xb71a('0x1d')]?_[_0xb71a('0x1e')](_0x3401f7[_0xb71a('0x1d')],function(_0x45b849){return{'model':db[_0x45b849[_0xb71a('0x20')]],'as':_0x45b849['as'],'attributes':_0x45b849[_0xb71a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e8ea6){logger[_0xb71a('0xd')](_0xb71a('0x16'),_0x374c8c);logger[_0xb71a('0x21')](_0xb71a('0x16'),_0x374c8c,JSON[_0xb71a('0x10')](_0x2e8ea6));_0x2bdb61(_0x2e8ea6);})[_0xb71a('0x15')](function(_0x25364c){logger[_0xb71a('0x11')](_0xb71a('0x16'),_0x25364c[_0xb71a('0x12')],_0x374c8c);_0xf83e73(_0x346524['error'](0x1f4,_0x25364c['message']));});});};exports[_0xb71a('0x22')]=function(_0x5c2a45){var _0x70299a=this;return new Promise(function(_0x1b1aa8,_0x4d9e1a){return db[_0xb71a('0x17')][_0xb71a('0x23')](_0x5c2a45[_0xb71a('0x24')],{'raw':_0x5c2a45[_0xb71a('0x19')]?_0x5c2a45[_0xb71a('0x19')][_0xb71a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x204f99){logger[_0xb71a('0xd')](_0xb71a('0x22'),_0x5c2a45);logger[_0xb71a('0x21')]('CreateMemberReport',_0x5c2a45,JSON[_0xb71a('0x10')](_0x204f99));_0x1b1aa8(_0x204f99);})[_0xb71a('0x15')](function(_0x3e1261){logger[_0xb71a('0x11')](_0xb71a('0x22'),_0x3e1261[_0xb71a('0x12')],_0x5c2a45);_0x4d9e1a(_0x70299a[_0xb71a('0x11')](0x1f4,_0x3e1261[_0xb71a('0x12')]));});});};exports[_0xb71a('0x25')]=function(_0x3f5531){var _0x47e7da=this;return new Promise(function(_0x5a0920,_0x10332c){return db[_0xb71a('0x17')][_0xb71a('0x26')](_0x3f5531[_0xb71a('0x24')],{'raw':_0x3f5531[_0xb71a('0x19')]?_0x3f5531[_0xb71a('0x19')][_0xb71a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f5531['options']?_0x3f5531[_0xb71a('0x19')]['where']||null:null,'attributes':_0x3f5531[_0xb71a('0x19')]?_0x3f5531[_0xb71a('0x19')][_0xb71a('0x1f')]||null:null,'limit':_0x3f5531[_0xb71a('0x19')]?_0x3f5531['options'][_0xb71a('0x1c')]||null:null})[_0xb71a('0xc')](function(_0x4694fd){logger[_0xb71a('0xd')](_0xb71a('0x25'),_0x3f5531);logger[_0xb71a('0x21')](_0xb71a('0x25'),_0x3f5531,JSON[_0xb71a('0x10')](_0x4694fd));_0x5a0920(_0x4694fd);})[_0xb71a('0x15')](function(_0x59c61a){logger[_0xb71a('0x11')]('UpdateMemberReport',_0x59c61a[_0xb71a('0x12')],_0x3f5531);_0x10332c(_0x47e7da[_0xb71a('0x11')](0x1f4,_0x59c61a[_0xb71a('0x12')]));});});};
\ No newline at end of file
+var _0xc9b9=['GetMemberReport','MemberReport','findAll','options','attributes','limit','include','map','model','CreateMemberReport','body','raw','UpdateMemberReport','update','where','moment','bluebird','randomstring','rpc','http','request','then','info','request\x20sent','debug','stringify','code','MemberReport,\x20%s,\x20%s','error','message','result','catch'];(function(_0x385ef6,_0x5818da){var _0x51df52=function(_0x4a4937){while(--_0x4a4937){_0x385ef6['push'](_0x385ef6['shift']());}};_0x51df52(++_0x5818da);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0xc9b9[_0x366e99];return _0x180bbe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c9b('0x0'));var BPromise=require(_0x9c9b('0x1'));var rs=require(_0x9c9b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9c9b('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9c9b('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x15d94b,_0x13060c,_0x193305){return new BPromise(function(_0xbbd998,_0x5e0081){return client[_0x9c9b('0x5')](_0x15d94b,_0x193305)[_0x9c9b('0x6')](function(_0x2a2178){logger[_0x9c9b('0x7')]('MemberReport,\x20%s,\x20%s',_0x13060c,_0x9c9b('0x8'));logger[_0x9c9b('0x9')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x13060c,_0x9c9b('0x8'),JSON[_0x9c9b('0xa')](_0x2a2178));if(_0x2a2178['error']){if(_0x2a2178['error'][_0x9c9b('0xb')]===0x1f4){logger['error'](_0x9c9b('0xc'),_0x13060c,_0x2a2178[_0x9c9b('0xd')]['message']);return _0x5e0081(_0x2a2178['error']['message']);}logger['error'](_0x9c9b('0xc'),_0x13060c,_0x2a2178[_0x9c9b('0xd')]['message']);return _0xbbd998(_0x2a2178[_0x9c9b('0xd')][_0x9c9b('0xe')]);}else{logger['info'](_0x9c9b('0xc'),_0x13060c,_0x9c9b('0x8'));_0xbbd998(_0x2a2178[_0x9c9b('0xf')][_0x9c9b('0xe')]);}})[_0x9c9b('0x10')](function(_0x299221){logger[_0x9c9b('0xd')](_0x9c9b('0xc'),_0x13060c,_0x299221);_0x5e0081(_0x299221);});});}exports[_0x9c9b('0x11')]=function(_0x4cab0f){var _0x28884a=this;return new Promise(function(_0x1fa270,_0x863d77){return db[_0x9c9b('0x12')][_0x9c9b('0x13')]({'raw':_0x4cab0f[_0x9c9b('0x14')]?_0x4cab0f[_0x9c9b('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4cab0f['options']?_0x4cab0f[_0x9c9b('0x14')]['where']||null:null,'attributes':_0x4cab0f[_0x9c9b('0x14')]?_0x4cab0f[_0x9c9b('0x14')][_0x9c9b('0x15')]||null:null,'limit':_0x4cab0f[_0x9c9b('0x14')]?_0x4cab0f[_0x9c9b('0x14')][_0x9c9b('0x16')]||null:null,'include':_0x4cab0f[_0x9c9b('0x14')]?_0x4cab0f[_0x9c9b('0x14')][_0x9c9b('0x17')]?_[_0x9c9b('0x18')](_0x4cab0f['options'][_0x9c9b('0x17')],function(_0xdb4f5a){return{'model':db[_0xdb4f5a[_0x9c9b('0x19')]],'as':_0xdb4f5a['as'],'attributes':_0xdb4f5a[_0x9c9b('0x15')],'include':_0xdb4f5a[_0x9c9b('0x17')]?_['map'](_0xdb4f5a[_0x9c9b('0x17')],function(_0x26f1dc){return{'model':db[_0x26f1dc[_0x9c9b('0x19')]],'as':_0x26f1dc['as'],'attributes':_0x26f1dc[_0x9c9b('0x15')],'include':_0x26f1dc[_0x9c9b('0x17')]?_[_0x9c9b('0x18')](_0x26f1dc[_0x9c9b('0x17')],function(_0x46192b){return{'model':db[_0x46192b['model']],'as':_0x46192b['as'],'attributes':_0x46192b[_0x9c9b('0x15')]};}):[]};}):[]};}):[]:[]})[_0x9c9b('0x6')](function(_0x267dbf){logger[_0x9c9b('0x7')](_0x9c9b('0x11'),_0x4cab0f);logger['debug'](_0x9c9b('0x11'),_0x4cab0f,JSON['stringify'](_0x267dbf));_0x1fa270(_0x267dbf);})[_0x9c9b('0x10')](function(_0x3c0c62){logger[_0x9c9b('0xd')](_0x9c9b('0x11'),_0x3c0c62[_0x9c9b('0xe')],_0x4cab0f);_0x863d77(_0x28884a[_0x9c9b('0xd')](0x1f4,_0x3c0c62[_0x9c9b('0xe')]));});});};exports[_0x9c9b('0x1a')]=function(_0xa07d03){var _0x5731ce=this;return new Promise(function(_0x22771f,_0x5ef104){return db[_0x9c9b('0x12')]['create'](_0xa07d03[_0x9c9b('0x1b')],{'raw':_0xa07d03[_0x9c9b('0x14')]?_0xa07d03['options'][_0x9c9b('0x1c')]===undefined?!![]:![]:!![]})[_0x9c9b('0x6')](function(_0x41d12b){logger['info'](_0x9c9b('0x1a'),_0xa07d03);logger['debug']('CreateMemberReport',_0xa07d03,JSON[_0x9c9b('0xa')](_0x41d12b));_0x22771f(_0x41d12b);})['catch'](function(_0x14c4a1){logger[_0x9c9b('0xd')](_0x9c9b('0x1a'),_0x14c4a1[_0x9c9b('0xe')],_0xa07d03);_0x5ef104(_0x5731ce['error'](0x1f4,_0x14c4a1['message']));});});};exports[_0x9c9b('0x1d')]=function(_0x147a23){var _0x5239d0=this;return new Promise(function(_0x22480a,_0xe7201e){return db[_0x9c9b('0x12')][_0x9c9b('0x1e')](_0x147a23['body'],{'raw':_0x147a23['options']?_0x147a23[_0x9c9b('0x14')][_0x9c9b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x147a23['options']?_0x147a23[_0x9c9b('0x14')][_0x9c9b('0x1f')]||null:null,'attributes':_0x147a23[_0x9c9b('0x14')]?_0x147a23['options'][_0x9c9b('0x15')]||null:null,'limit':_0x147a23[_0x9c9b('0x14')]?_0x147a23[_0x9c9b('0x14')][_0x9c9b('0x16')]||null:null})[_0x9c9b('0x6')](function(_0x107390){logger['info']('UpdateMemberReport',_0x147a23);logger['debug'](_0x9c9b('0x1d'),_0x147a23,JSON[_0x9c9b('0xa')](_0x107390));_0x22480a(_0x107390);})[_0x9c9b('0x10')](function(_0x42a21e){logger['error']('UpdateMemberReport',_0x42a21e[_0x9c9b('0xe')],_0x147a23);_0xe7201e(_0x5239d0[_0x9c9b('0xd')](0x1f4,_0x42a21e[_0x9c9b('0xe')]));});});};
\ No newline at end of file
index ab2f8a5..ac6f9ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e9=['get','index','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e9,0x193));var _0x970e=function(_0x4ea2eb,_0x5f2aa3){_0x4ea2eb=_0x4ea2eb-0x0;var _0x17443f=_0x70e9[_0x4ea2eb];return _0x17443f;};'use strict';var multer=require('multer');var util=require(_0x970e('0x0'));var path=require(_0x970e('0x1'));var timeout=require('connect-timeout');var express=require(_0x970e('0x2'));var router=express[_0x970e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x970e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x970e('0x5'));var controller=require(_0x970e('0x6'));router[_0x970e('0x7')]('/',controller[_0x970e('0x8')]);module[_0x970e('0x9')]=router;
\ No newline at end of file
+var _0x9bb8=['../../config/environment','./migration.controller','index','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x9bb8,0x160));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x89bb('0x0'));var util=require('util');var path=require(_0x89bb('0x1'));var timeout=require(_0x89bb('0x2'));var express=require(_0x89bb('0x3'));var router=express[_0x89bb('0x4')]();var fs_extra=require(_0x89bb('0x5'));var auth=require(_0x89bb('0x6'));var interaction=require(_0x89bb('0x7'));var config=require(_0x89bb('0x8'));var controller=require(_0x89bb('0x9'));router['get']('/',controller[_0x89bb('0xa')]);module[_0x89bb('0xb')]=router;
\ No newline at end of file
index 4d7e9f8..1f87195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2139=['STRING','version','sequelize','exports'];(function(_0x2d758e,_0x2bd153){var _0x2ea733=function(_0x952476){while(--_0x952476){_0x2d758e['push'](_0x2d758e['shift']());}};_0x2ea733(++_0x2bd153);}(_0x2139,0x1ca));var _0x9213=function(_0x5be0f7,_0x435f97){_0x5be0f7=_0x5be0f7-0x0;var _0x224e5c=_0x2139[_0x5be0f7];return _0x224e5c;};'use strict';var Sequelize=require(_0x9213('0x0'));module[_0x9213('0x1')]={'version':{'type':Sequelize[_0x9213('0x2')],'unique':_0x9213('0x3')}};
\ No newline at end of file
+var _0x8f1f=['STRING','version','sequelize','exports'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x8f1f,0xb2));var _0xf8f1=function(_0x220774,_0x2d8962){_0x220774=_0x220774-0x0;var _0x53b647=_0x8f1f[_0x220774];return _0x53b647;};'use strict';var Sequelize=require(_0xf8f1('0x0'));module[_0xf8f1('0x1')]={'version':{'type':Sequelize[_0xf8f1('0x2')],'unique':_0xf8f1('0x3')}};
\ No newline at end of file
index 80adbcb..652dd14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10b3=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xf2602c,_0x4d4fcb){var _0x221e53=function(_0x4bed75){while(--_0x4bed75){_0xf2602c['push'](_0xf2602c['shift']());}};_0x221e53(++_0x4d4fcb);}(_0x10b3,0xcb));var _0x310b=function(_0x2f0c28,_0x1bfd77){_0x2f0c28=_0x2f0c28-0x0;var _0x450686=_0x10b3[_0x2f0c28];return _0x450686;};'use strict';var emlformat=require(_0x310b('0x0'));var rimraf=require(_0x310b('0x1'));var zipdir=require(_0x310b('0x2'));var jsonpatch=require(_0x310b('0x3'));var rp=require(_0x310b('0x4'));var moment=require(_0x310b('0x5'));var BPromise=require(_0x310b('0x6'));var Mustache=require(_0x310b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x310b('0x8'));var csv=require(_0x310b('0x9'));var ejs=require(_0x310b('0xa'));var fs=require('fs');var fs_extra=require(_0x310b('0xb'));var _=require(_0x310b('0xc'));var squel=require(_0x310b('0xd'));var crypto=require(_0x310b('0xe'));var jsforce=require(_0x310b('0xf'));var deskjs=require(_0x310b('0x10'));var toCsv=require(_0x310b('0x9'));var querystring=require(_0x310b('0x11'));var Papa=require(_0x310b('0x12'));var Redis=require(_0x310b('0x13'));var authService=require(_0x310b('0x14'));var qs=require(_0x310b('0x15'));var as=require(_0x310b('0x16'));var hardwareService=require(_0x310b('0x17'));var logger=require(_0x310b('0x18'))(_0x310b('0x19'));var utils=require('../../config/utils');var config=require(_0x310b('0x1a'));var licenseUtil=require(_0x310b('0x1b'));var db=require(_0x310b('0x1c'))['db'];function respondWithStatusCode(_0x53199b,_0x3e9890){_0x3e9890=_0x3e9890||0xcc;return function(_0x273342){if(_0x273342){return _0x53199b['sendStatus'](_0x3e9890);}return _0x53199b[_0x310b('0x1d')](_0x3e9890)[_0x310b('0x1e')]();};}function respondWithResult(_0x39d528,_0x36bbd5){_0x36bbd5=_0x36bbd5||0xc8;return function(_0x418f5c){if(_0x418f5c){return _0x39d528['status'](_0x36bbd5)[_0x310b('0x1f')](_0x418f5c);}};}function respondWithFilteredResult(_0x461f59,_0x5e62fc){return function(_0x2fce7b){if(_0x2fce7b){var _0x504631=typeof _0x5e62fc[_0x310b('0x20')]===_0x310b('0x21')&&typeof _0x5e62fc[_0x310b('0x22')]===_0x310b('0x21');var _0x6c8d30=_0x2fce7b[_0x310b('0x23')];var _0x13acbb=_0x504631?0x0:_0x5e62fc[_0x310b('0x20')];var _0x2fc321=_0x504631?_0x2fce7b[_0x310b('0x23')]:_0x5e62fc[_0x310b('0x20')]+_0x5e62fc[_0x310b('0x22')];var _0x4f9407;if(_0x2fc321>=_0x6c8d30){_0x2fc321=_0x6c8d30;_0x4f9407=0xc8;}else{_0x4f9407=0xce;}_0x461f59['status'](_0x4f9407);return _0x461f59[_0x310b('0x24')](_0x310b('0x25'),_0x13acbb+'-'+_0x2fc321+'/'+_0x6c8d30)[_0x310b('0x1f')](_0x2fce7b);}return null;};}function patchUpdates(_0x22dfff){return function(_0x9754a6){try{jsonpatch[_0x310b('0x26')](_0x9754a6,_0x22dfff,!![]);}catch(_0x1a3c79){return BPromise[_0x310b('0x27')](_0x1a3c79);}return _0x9754a6[_0x310b('0x28')]();};}function saveUpdates(_0x518c9c,_0x2d264c){return function(_0x4eb602){if(_0x4eb602){return _0x4eb602[_0x310b('0x29')](_0x518c9c)[_0x310b('0x2a')](function(_0x4368dc){return _0x4368dc;});}return null;};}function removeEntity(_0x4bf7f7,_0x22cbff){return function(_0x200bd5){if(_0x200bd5){return _0x200bd5[_0x310b('0x2b')]()[_0x310b('0x2a')](function(){_0x4bf7f7[_0x310b('0x1d')](0xcc)[_0x310b('0x1e')]();});}};}function handleEntityNotFound(_0x798100,_0x272289){return function(_0x38e4aa){if(!_0x38e4aa){_0x798100[_0x310b('0x2c')](0x194);}return _0x38e4aa;};}function handleError(_0x19f14d,_0x144967){_0x144967=_0x144967||0x1f4;return function(_0x509614){logger[_0x310b('0x2d')](_0x509614[_0x310b('0x2e')]);if(_0x509614['name']){delete _0x509614[_0x310b('0x2f')];}_0x19f14d[_0x310b('0x1d')](_0x144967)[_0x310b('0x30')](_0x509614);};}exports[_0x310b('0x31')]=function(_0x265810,_0x104732){var _0x1f7043={},_0x5e4ae9={},_0x556c13={'count':0x0,'rows':[]};var _0x12ae9e=_[_0x310b('0x32')](db[_0x310b('0x33')][_0x310b('0x34')],function(_0x363850){return{'name':_0x363850[_0x310b('0x35')],'type':_0x363850[_0x310b('0x36')][_0x310b('0x37')]};});_0x5e4ae9[_0x310b('0x38')]=_[_0x310b('0x32')](_0x12ae9e,_0x310b('0x2f'));_0x5e4ae9['query']=_[_0x310b('0x39')](_0x265810[_0x310b('0x3a')]);_0x5e4ae9['filters']=_[_0x310b('0x3b')](_0x5e4ae9['model'],_0x5e4ae9['query']);_0x1f7043[_0x310b('0x3c')]=_['intersection'](_0x5e4ae9[_0x310b('0x38')],qs['fields'](_0x265810[_0x310b('0x3a')][_0x310b('0x3d')]));_0x1f7043[_0x310b('0x3c')]=_0x1f7043[_0x310b('0x3c')][_0x310b('0x3e')]?_0x1f7043[_0x310b('0x3c')]:_0x5e4ae9[_0x310b('0x38')];if(!_0x265810[_0x310b('0x3a')][_0x310b('0x3f')](_0x310b('0x40'))){_0x1f7043['limit']=qs[_0x310b('0x22')](_0x265810[_0x310b('0x3a')][_0x310b('0x22')]);_0x1f7043[_0x310b('0x20')]=qs[_0x310b('0x20')](_0x265810[_0x310b('0x3a')]['offset']);}_0x1f7043[_0x310b('0x41')]=qs[_0x310b('0x42')](_0x265810['query']['sort']);_0x1f7043[_0x310b('0x43')]=qs[_0x310b('0x44')](_[_0x310b('0x45')](_0x265810[_0x310b('0x3a')],_0x5e4ae9[_0x310b('0x44')]),_0x12ae9e);if(_0x265810[_0x310b('0x3a')][_0x310b('0x46')]){_0x1f7043[_0x310b('0x43')]=_[_0x310b('0x47')](_0x1f7043[_0x310b('0x43')],{'$or':_[_0x310b('0x32')](_0x12ae9e,function(_0x5269f){if(_0x5269f['type']!=='VIRTUAL'){var _0x2f26ad={};_0x2f26ad[_0x5269f[_0x310b('0x2f')]]={'$like':'%'+_0x265810['query'][_0x310b('0x46')]+'%'};return _0x2f26ad;}})});}_0x1f7043=_[_0x310b('0x47')]({},_0x1f7043,_0x265810[_0x310b('0x48')]);var _0x1133e0={'where':_0x1f7043['where']};return db[_0x310b('0x33')][_0x310b('0x23')](_0x1133e0)[_0x310b('0x2a')](function(_0x2a18f0){_0x556c13['count']=_0x2a18f0;if(_0x265810[_0x310b('0x3a')][_0x310b('0x49')]){_0x1f7043['include']=[{'all':!![]}];}return db[_0x310b('0x33')]['findAll'](_0x1f7043);})[_0x310b('0x2a')](function(_0x4a138f){_0x556c13[_0x310b('0x4a')]=_0x4a138f;return _0x556c13;})[_0x310b('0x2a')](respondWithFilteredResult(_0x104732,_0x1f7043))['catch'](handleError(_0x104732,null));};
\ No newline at end of file
+var _0xbb0d=['undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','Migration','type','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset'];(function(_0x57c651,_0x55bd96){var _0x312d17=function(_0x42e62e){while(--_0x42e62e){_0x57c651['push'](_0x57c651['shift']());}};_0x312d17(++_0x55bd96);}(_0xbb0d,0x188));var _0xdbb0=function(_0x3fd665,_0x1df849){_0x3fd665=_0x3fd665-0x0;var _0x37053a=_0xbb0d[_0x3fd665];return _0x37053a;};'use strict';var emlformat=require(_0xdbb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbb0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbb0('0x2'));var moment=require(_0xdbb0('0x3'));var BPromise=require(_0xdbb0('0x4'));var Mustache=require(_0xdbb0('0x5'));var util=require(_0xdbb0('0x6'));var path=require('path');var sox=require(_0xdbb0('0x7'));var csv=require(_0xdbb0('0x8'));var ejs=require(_0xdbb0('0x9'));var fs=require('fs');var fs_extra=require(_0xdbb0('0xa'));var _=require(_0xdbb0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdbb0('0xc'));var deskjs=require(_0xdbb0('0xd'));var toCsv=require(_0xdbb0('0x8'));var querystring=require(_0xdbb0('0xe'));var Papa=require(_0xdbb0('0xf'));var Redis=require(_0xdbb0('0x10'));var authService=require(_0xdbb0('0x11'));var qs=require(_0xdbb0('0x12'));var as=require(_0xdbb0('0x13'));var hardwareService=require(_0xdbb0('0x14'));var logger=require(_0xdbb0('0x15'))(_0xdbb0('0x16'));var utils=require('../../config/utils');var config=require(_0xdbb0('0x17'));var licenseUtil=require(_0xdbb0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b44da,_0x372bf0){_0x372bf0=_0x372bf0||0xcc;return function(_0x2610de){if(_0x2610de){return _0x4b44da['sendStatus'](_0x372bf0);}return _0x4b44da[_0xdbb0('0x19')](_0x372bf0)[_0xdbb0('0x1a')]();};}function respondWithResult(_0x13b9d1,_0x50217d){_0x50217d=_0x50217d||0xc8;return function(_0x5dd01e){if(_0x5dd01e){return _0x13b9d1[_0xdbb0('0x19')](_0x50217d)['json'](_0x5dd01e);}};}function respondWithFilteredResult(_0x40902e,_0x3205b8){return function(_0x4f551b){if(_0x4f551b){var _0x1fea49=typeof _0x3205b8[_0xdbb0('0x1b')]===_0xdbb0('0x1c')&&typeof _0x3205b8[_0xdbb0('0x1d')]==='undefined';var _0x2405e5=_0x4f551b['count'];var _0x3ccbbd=_0x1fea49?0x0:_0x3205b8[_0xdbb0('0x1b')];var _0xbc620a=_0x1fea49?_0x4f551b[_0xdbb0('0x1e')]:_0x3205b8[_0xdbb0('0x1b')]+_0x3205b8[_0xdbb0('0x1d')];var _0x2e463f;if(_0xbc620a>=_0x2405e5){_0xbc620a=_0x2405e5;_0x2e463f=0xc8;}else{_0x2e463f=0xce;}_0x40902e[_0xdbb0('0x19')](_0x2e463f);return _0x40902e['set'](_0xdbb0('0x1f'),_0x3ccbbd+'-'+_0xbc620a+'/'+_0x2405e5)[_0xdbb0('0x20')](_0x4f551b);}return null;};}function patchUpdates(_0x22183d){return function(_0x18a4cb){try{jsonpatch[_0xdbb0('0x21')](_0x18a4cb,_0x22183d,!![]);}catch(_0x422d1f){return BPromise[_0xdbb0('0x22')](_0x422d1f);}return _0x18a4cb[_0xdbb0('0x23')]();};}function saveUpdates(_0x44e61a,_0xcaaeaa){return function(_0x1c61a9){if(_0x1c61a9){return _0x1c61a9[_0xdbb0('0x24')](_0x44e61a)[_0xdbb0('0x25')](function(_0x49d196){return _0x49d196;});}return null;};}function removeEntity(_0x340b62,_0x5d4bac){return function(_0x45887e){if(_0x45887e){return _0x45887e[_0xdbb0('0x26')]()['then'](function(){_0x340b62[_0xdbb0('0x19')](0xcc)[_0xdbb0('0x1a')]();});}};}function handleEntityNotFound(_0x39ce26,_0x257ae2){return function(_0x331cf3){if(!_0x331cf3){_0x39ce26[_0xdbb0('0x27')](0x194);}return _0x331cf3;};}function handleError(_0x40e87,_0x56921c){_0x56921c=_0x56921c||0x1f4;return function(_0x3d17bc){logger[_0xdbb0('0x28')](_0x3d17bc[_0xdbb0('0x29')]);if(_0x3d17bc['name']){delete _0x3d17bc['name'];}_0x40e87['status'](_0x56921c)[_0xdbb0('0x2a')](_0x3d17bc);};}exports[_0xdbb0('0x2b')]=function(_0x1f56a4,_0x459253){var _0x11f320={},_0x71daad={},_0x46ca3c={'count':0x0,'rows':[]};var _0x19a2c4=_[_0xdbb0('0x2c')](db[_0xdbb0('0x2d')]['rawAttributes'],function(_0x3802c1){return{'name':_0x3802c1['fieldName'],'type':_0x3802c1[_0xdbb0('0x2e')]['key']};});_0x71daad[_0xdbb0('0x2f')]=_[_0xdbb0('0x2c')](_0x19a2c4,_0xdbb0('0x30'));_0x71daad[_0xdbb0('0x31')]=_['keys'](_0x1f56a4[_0xdbb0('0x31')]);_0x71daad[_0xdbb0('0x32')]=_[_0xdbb0('0x33')](_0x71daad[_0xdbb0('0x2f')],_0x71daad['query']);_0x11f320[_0xdbb0('0x34')]=_[_0xdbb0('0x33')](_0x71daad[_0xdbb0('0x2f')],qs[_0xdbb0('0x35')](_0x1f56a4[_0xdbb0('0x31')][_0xdbb0('0x35')]));_0x11f320[_0xdbb0('0x34')]=_0x11f320['attributes'][_0xdbb0('0x36')]?_0x11f320[_0xdbb0('0x34')]:_0x71daad[_0xdbb0('0x2f')];if(!_0x1f56a4['query'][_0xdbb0('0x37')](_0xdbb0('0x38'))){_0x11f320[_0xdbb0('0x1d')]=qs['limit'](_0x1f56a4['query']['limit']);_0x11f320[_0xdbb0('0x1b')]=qs['offset'](_0x1f56a4[_0xdbb0('0x31')][_0xdbb0('0x1b')]);}_0x11f320[_0xdbb0('0x39')]=qs[_0xdbb0('0x3a')](_0x1f56a4[_0xdbb0('0x31')][_0xdbb0('0x3a')]);_0x11f320['where']=qs['filters'](_[_0xdbb0('0x3b')](_0x1f56a4[_0xdbb0('0x31')],_0x71daad['filters']),_0x19a2c4);if(_0x1f56a4[_0xdbb0('0x31')][_0xdbb0('0x3c')]){_0x11f320['where']=_[_0xdbb0('0x3d')](_0x11f320['where'],{'$or':_[_0xdbb0('0x2c')](_0x19a2c4,function(_0x36e017){if(_0x36e017['type']!==_0xdbb0('0x3e')){var _0xf36573={};_0xf36573[_0x36e017[_0xdbb0('0x30')]]={'$like':'%'+_0x1f56a4['query'][_0xdbb0('0x3c')]+'%'};return _0xf36573;}})});}_0x11f320=_[_0xdbb0('0x3d')]({},_0x11f320,_0x1f56a4[_0xdbb0('0x3f')]);var _0x2ba152={'where':_0x11f320[_0xdbb0('0x40')]};return db[_0xdbb0('0x2d')][_0xdbb0('0x1e')](_0x2ba152)[_0xdbb0('0x25')](function(_0x4ad674){_0x46ca3c[_0xdbb0('0x1e')]=_0x4ad674;if(_0x1f56a4[_0xdbb0('0x31')][_0xdbb0('0x41')]){_0x11f320[_0xdbb0('0x42')]=[{'all':!![]}];}return db['Migration'][_0xdbb0('0x43')](_0x11f320);})['then'](function(_0x4cd53c){_0x46ca3c[_0xdbb0('0x44')]=_0x4cd53c;return _0x46ca3c;})[_0xdbb0('0x25')](respondWithFilteredResult(_0x459253,_0x11f320))[_0xdbb0('0x45')](handleError(_0x459253,null));};
\ No newline at end of file
index c863526..00424c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6db3=['path','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x50528e,_0x5ae7de){var _0xb53771=function(_0x171db7){while(--_0x171db7){_0x50528e['push'](_0x50528e['shift']());}};_0xb53771(++_0x5ae7de);}(_0x6db3,0x1c7));var _0x36db=function(_0x4394f7,_0x43ee7b){_0x4394f7=_0x4394f7-0x0;var _0x340a66=_0x6db3[_0x4394f7];return _0x340a66;};'use strict';var _=require(_0x36db('0x0'));var util=require(_0x36db('0x1'));var logger=require(_0x36db('0x2'))(_0x36db('0x3'));var moment=require(_0x36db('0x4'));var BPromise=require(_0x36db('0x5'));var rp=require(_0x36db('0x6'));var fs=require('fs');var path=require(_0x36db('0x7'));var rimraf=require('rimraf');var config=require(_0x36db('0x8'));var attributes=require(_0x36db('0x9'));module[_0x36db('0xa')]=function(_0x2fcf8e,_0x21d2ee){return _0x2fcf8e[_0x36db('0xb')](_0x36db('0xc'),attributes,{'tableName':_0x36db('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x987e=['util','api','path','rimraf','define','Migration','migrations','lodash'];(function(_0x19fe78,_0x185b56){var _0x2b30a4=function(_0x289ec4){while(--_0x289ec4){_0x19fe78['push'](_0x19fe78['shift']());}};_0x2b30a4(++_0x185b56);}(_0x987e,0x9f));var _0xe987=function(_0x3a020a,_0x4fd50e){_0x3a020a=_0x3a020a-0x0;var _0x17089d=_0x987e[_0x3a020a];return _0x17089d;};'use strict';var _=require(_0xe987('0x0'));var util=require(_0xe987('0x1'));var logger=require('../../config/logger')(_0xe987('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe987('0x3'));var rimraf=require(_0xe987('0x4'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x536a7d,_0xc91ef9){return _0x536a7d[_0xe987('0x5')](_0xe987('0x6'),attributes,{'tableName':_0xe987('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30608b2..039b725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb7=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2b81d0,_0x4f0bad){var _0x4060d3=function(_0x34691b){while(--_0x34691b){_0x2b81d0['push'](_0x2b81d0['shift']());}};_0x4060d3(++_0x4f0bad);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7deb('0x0'));var util=require(_0x7deb('0x1'));var moment=require(_0x7deb('0x2'));var BPromise=require('bluebird');var rs=require(_0x7deb('0x3'));var fs=require('fs');var Redis=require(_0x7deb('0x4'));var db=require(_0x7deb('0x5'))['db'];var utils=require(_0x7deb('0x6'));var logger=require(_0x7deb('0x7'))('rpc');var config=require(_0x7deb('0x8'));var jayson=require(_0x7deb('0x9'));var client=jayson[_0x7deb('0xa')][_0x7deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d4de9,_0x1a5058,_0x4e3d14){return new BPromise(function(_0xfa72b7,_0x366e44){return client[_0x7deb('0xc')](_0x1d4de9,_0x4e3d14)[_0x7deb('0xd')](function(_0x5bdde4){logger[_0x7deb('0xe')]('Migration,\x20%s,\x20%s',_0x1a5058,'request\x20sent');logger[_0x7deb('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x1a5058,_0x7deb('0x10'),JSON[_0x7deb('0x11')](_0x5bdde4));if(_0x5bdde4[_0x7deb('0x12')]){if(_0x5bdde4['error'][_0x7deb('0x13')]===0x1f4){logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')]['message']);return _0x366e44(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);return _0xfa72b7(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}else{logger[_0x7deb('0xe')](_0x7deb('0x14'),_0x1a5058,_0x7deb('0x10'));_0xfa72b7(_0x5bdde4[_0x7deb('0x16')][_0x7deb('0x15')]);}})[_0x7deb('0x17')](function(_0xbe8e2a){logger['error'](_0x7deb('0x14'),_0x1a5058,_0xbe8e2a);_0x366e44(_0xbe8e2a);});});}
\ No newline at end of file
+var _0x1be1=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x1be1,0x192));var _0x11be=function(_0x1c6cec,_0xf05f05){_0x1c6cec=_0x1c6cec-0x0;var _0x3ec10b=_0x1be1[_0x1c6cec];return _0x3ec10b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('Migration,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('Migration,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}
\ No newline at end of file
index 0017f62..c2559f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71a1=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x71a1,0x1eb));var _0x171a=function(_0x2f3973,_0x1ca4b3){_0x2f3973=_0x2f3973-0x0;var _0x54649c=_0x71a1[_0x2f3973];return _0x54649c;};'use strict';var multer=require(_0x171a('0x0'));var util=require(_0x171a('0x1'));var path=require(_0x171a('0x2'));var timeout=require(_0x171a('0x3'));var express=require(_0x171a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x171a('0x5'));var interaction=require(_0x171a('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x171a('0x7')]('/',auth[_0x171a('0x8')](),controller['index']);router[_0x171a('0x7')](_0x171a('0x9'),auth[_0x171a('0x8')](),controller[_0x171a('0xa')]);router[_0x171a('0xb')]('/',auth[_0x171a('0x8')](),controller[_0x171a('0xc')]);router[_0x171a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x171a('0xe')]);router[_0x171a('0xf')](_0x171a('0x9'),auth[_0x171a('0x8')](),controller[_0x171a('0x10')]);module[_0x171a('0x11')]=router;
\ No newline at end of file
+var _0x81c6=['destroy','util','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','post','create','delete'];(function(_0xf315b3,_0x2ea5e5){var _0x152a01=function(_0x1e20fc){while(--_0x1e20fc){_0xf315b3['push'](_0xf315b3['shift']());}};_0x152a01(++_0x2ea5e5);}(_0x81c6,0x1d5));var _0x681c=function(_0x20e882,_0x16185c){_0x20e882=_0x20e882-0x0;var _0x3e0dbe=_0x81c6[_0x20e882];return _0x3e0dbe;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var fs_extra=require(_0x681c('0x2'));var auth=require(_0x681c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x681c('0x4'));var controller=require(_0x681c('0x5'));router[_0x681c('0x6')]('/',auth[_0x681c('0x7')](),controller['index']);router[_0x681c('0x6')](_0x681c('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x681c('0x9')]('/',auth[_0x681c('0x7')](),controller[_0x681c('0xa')]);router['put']('/:id',auth[_0x681c('0x7')](),controller['update']);router[_0x681c('0xb')](_0x681c('0x8'),auth[_0x681c('0x7')](),controller[_0x681c('0xc')]);module['exports']=router;
\ No newline at end of file
index 0af430a..55a3566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b84=['STRING','exports','localnet','stun','turn'];(function(_0x1fb4ff,_0x172d25){var _0x3f2d20=function(_0x358d44){while(--_0x358d44){_0x1fb4ff['push'](_0x1fb4ff['shift']());}};_0x3f2d20(++_0x172d25);}(_0x5b84,0x141));var _0x45b8=function(_0x49045f,_0x20d842){_0x49045f=_0x49045f-0x0;var _0x587715=_0x5b84[_0x49045f];return _0x587715;};'use strict';var Sequelize=require('sequelize');module[_0x45b8('0x0')]={'type':{'type':Sequelize['ENUM'](_0x45b8('0x1'),'externip',_0x45b8('0x2'),_0x45b8('0x3'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x45b8('0x4')]},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfe28=['STRING','sequelize','exports','localnet','stun','turn'];(function(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0xfe28,0x133));var _0x8fe2=function(_0x5a69d3,_0x1ec8ab){_0x5a69d3=_0x5a69d3-0x0;var _0x4af772=_0xfe28[_0x5a69d3];return _0x4af772;};'use strict';var Sequelize=require(_0x8fe2('0x0'));module[_0x8fe2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8fe2('0x2'),'externip',_0x8fe2('0x3'),_0x8fe2('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8fe2('0x5')]},'password':{'type':Sequelize[_0x8fe2('0x5')]}};
\ No newline at end of file
index c01052a..7565441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x698c=['body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','TURN','server/files/templates/network.ejs','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','http','request','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','Network,\x20%s,\x20%s','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Network','includeAll','include','findAll','rows','show','params','keys','filters','catch','create','sequelize','transaction'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x698c,0xf3));var _0xc698=function(_0xc37617,_0x166c57){_0xc37617=_0xc37617-0x0;var _0x1b2f6c=_0x698c[_0xc37617];return _0x1b2f6c;};'use strict';var emlformat=require(_0xc698('0x0'));var rimraf=require(_0xc698('0x1'));var zipdir=require(_0xc698('0x2'));var jsonpatch=require(_0xc698('0x3'));var rp=require(_0xc698('0x4'));var moment=require(_0xc698('0x5'));var BPromise=require(_0xc698('0x6'));var Mustache=require(_0xc698('0x7'));var util=require(_0xc698('0x8'));var path=require(_0xc698('0x9'));var sox=require(_0xc698('0xa'));var csv=require(_0xc698('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc698('0xc'));var _=require(_0xc698('0xd'));var squel=require(_0xc698('0xe'));var crypto=require(_0xc698('0xf'));var jsforce=require(_0xc698('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc698('0xb'));var querystring=require(_0xc698('0x11'));var Papa=require('papaparse');var Redis=require(_0xc698('0x12'));var authService=require(_0xc698('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc698('0x14'));var hardwareService=require(_0xc698('0x15'));var logger=require(_0xc698('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc698('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc698('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xc698('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x581294,_0x20e7a,_0x5a5ec5,_0x192821){return new BPromise(function(_0x5c2328,_0x1a9947){var _0x13b280=_0x192821||client;return _0x13b280[_0xc698('0x1a')](_0x581294,_0x5a5ec5)['then'](function(_0x49d6b0){logger[_0xc698('0x1b')]('Network,\x20%s,\x20%s',_0x20e7a,_0xc698('0x1c'));logger[_0xc698('0x1d')](_0xc698('0x1e'),_0x20e7a,_0xc698('0x1c'),JSON['stringify'](_0x49d6b0));if(_0x49d6b0[_0xc698('0x1f')]){if(_0x49d6b0['error'][_0xc698('0x20')]===0x1f4){logger[_0xc698('0x1f')]('Network,\x20%s,\x20%s',_0x20e7a,_0x49d6b0[_0xc698('0x1f')][_0xc698('0x21')]);return _0x1a9947(_0x49d6b0['error'][_0xc698('0x21')]);}logger[_0xc698('0x1f')](_0xc698('0x22'),_0x20e7a,_0x49d6b0[_0xc698('0x1f')]['message']);return _0x5c2328(_0x49d6b0[_0xc698('0x1f')][_0xc698('0x21')]);}else{logger[_0xc698('0x1b')](_0xc698('0x22'),_0x20e7a,_0xc698('0x1c'));_0x5c2328(_0x49d6b0[_0xc698('0x23')][_0xc698('0x21')]);}})['catch'](function(_0x49ca7a){logger[_0xc698('0x1f')](_0xc698('0x22'),_0x20e7a,_0x49ca7a);_0x1a9947(_0x49ca7a);});});}function respondWithStatusCode(_0x3dc938,_0x5215c5){_0x5215c5=_0x5215c5||0xcc;return function(_0x116e09){if(_0x116e09){return _0x3dc938[_0xc698('0x24')](_0x5215c5);}return _0x3dc938[_0xc698('0x25')](_0x5215c5)[_0xc698('0x26')]();};}function respondWithResult(_0x453431,_0x2fce3a){_0x2fce3a=_0x2fce3a||0xc8;return function(_0x4b0c41){if(_0x4b0c41){return _0x453431[_0xc698('0x25')](_0x2fce3a)[_0xc698('0x27')](_0x4b0c41);}};}function respondWithFilteredResult(_0x357532,_0x30e414){return function(_0x58bdeb){if(_0x58bdeb){var _0x19c298=typeof _0x30e414[_0xc698('0x28')]===_0xc698('0x29')&&typeof _0x30e414[_0xc698('0x2a')]===_0xc698('0x29');var _0x58af40=_0x58bdeb[_0xc698('0x2b')];var _0xf1527=_0x19c298?0x0:_0x30e414['offset'];var _0x4d2cd1=_0x19c298?_0x58bdeb[_0xc698('0x2b')]:_0x30e414[_0xc698('0x28')]+_0x30e414['limit'];var _0x1beb0b;if(_0x4d2cd1>=_0x58af40){_0x4d2cd1=_0x58af40;_0x1beb0b=0xc8;}else{_0x1beb0b=0xce;}_0x357532[_0xc698('0x25')](_0x1beb0b);return _0x357532[_0xc698('0x2c')](_0xc698('0x2d'),_0xf1527+'-'+_0x4d2cd1+'/'+_0x58af40)['json'](_0x58bdeb);}return null;};}function patchUpdates(_0x58f12b){return function(_0x34e668){try{jsonpatch[_0xc698('0x2e')](_0x34e668,_0x58f12b,!![]);}catch(_0x53d0e9){return BPromise[_0xc698('0x2f')](_0x53d0e9);}return _0x34e668[_0xc698('0x30')]();};}function saveUpdates(_0x19983c,_0x162650){return function(_0x1bc78f){if(_0x1bc78f){return _0x1bc78f['update'](_0x19983c)[_0xc698('0x31')](function(_0x5ae4ba){return _0x5ae4ba;});}return null;};}function removeEntity(_0x4f25e1,_0x3ddf2f){return function(_0x2e59ca){if(_0x2e59ca){return _0x2e59ca[_0xc698('0x32')]()['then'](function(){_0x4f25e1['status'](0xcc)[_0xc698('0x26')]();});}};}function handleEntityNotFound(_0x52ab56,_0x2dcc6a){return function(_0x1923e1){if(!_0x1923e1){_0x52ab56[_0xc698('0x24')](0x194);}return _0x1923e1;};}function handleError(_0x92be61,_0x33c18d){_0x33c18d=_0x33c18d||0x1f4;return function(_0x2a38f8){logger[_0xc698('0x1f')](_0x2a38f8[_0xc698('0x33')]);if(_0x2a38f8[_0xc698('0x34')]){delete _0x2a38f8[_0xc698('0x34')];}_0x92be61[_0xc698('0x25')](_0x33c18d)[_0xc698('0x35')](_0x2a38f8);};}exports[_0xc698('0x36')]=function(_0x1bb41c,_0xfcd62c){var _0x53608f={},_0x588193={},_0x40fdad={'count':0x0,'rows':[]};var _0x584360=_[_0xc698('0x37')](db['Network'][_0xc698('0x38')],function(_0x1781c1){return{'name':_0x1781c1['fieldName'],'type':_0x1781c1[_0xc698('0x39')]['key']};});_0x588193[_0xc698('0x3a')]=_[_0xc698('0x37')](_0x584360,_0xc698('0x34'));_0x588193[_0xc698('0x3b')]=_['keys'](_0x1bb41c[_0xc698('0x3b')]);_0x588193['filters']=_[_0xc698('0x3c')](_0x588193[_0xc698('0x3a')],_0x588193[_0xc698('0x3b')]);_0x53608f[_0xc698('0x3d')]=_['intersection'](_0x588193[_0xc698('0x3a')],qs[_0xc698('0x3e')](_0x1bb41c['query']['fields']));_0x53608f[_0xc698('0x3d')]=_0x53608f[_0xc698('0x3d')][_0xc698('0x3f')]?_0x53608f[_0xc698('0x3d')]:_0x588193[_0xc698('0x3a')];if(!_0x1bb41c[_0xc698('0x3b')][_0xc698('0x40')](_0xc698('0x41'))){_0x53608f[_0xc698('0x2a')]=qs['limit'](_0x1bb41c[_0xc698('0x3b')]['limit']);_0x53608f['offset']=qs['offset'](_0x1bb41c[_0xc698('0x3b')][_0xc698('0x28')]);}_0x53608f[_0xc698('0x42')]=qs[_0xc698('0x43')](_0x1bb41c['query'][_0xc698('0x43')]);_0x53608f[_0xc698('0x44')]=qs['filters'](_[_0xc698('0x45')](_0x1bb41c[_0xc698('0x3b')],_0x588193['filters']),_0x584360);if(_0x1bb41c[_0xc698('0x3b')][_0xc698('0x46')]){_0x53608f[_0xc698('0x44')]=_[_0xc698('0x47')](_0x53608f['where'],{'$or':_[_0xc698('0x37')](_0x584360,function(_0x2881d5){if(_0x2881d5[_0xc698('0x39')]!==_0xc698('0x48')){var _0x5ccec8={};_0x5ccec8[_0x2881d5[_0xc698('0x34')]]={'$like':'%'+_0x1bb41c[_0xc698('0x3b')][_0xc698('0x46')]+'%'};return _0x5ccec8;}})});}_0x53608f=_[_0xc698('0x47')]({},_0x53608f,_0x1bb41c[_0xc698('0x49')]);var _0xdf9aec={'where':_0x53608f['where']};return db[_0xc698('0x4a')][_0xc698('0x2b')](_0xdf9aec)[_0xc698('0x31')](function(_0x5d0fb0){_0x40fdad[_0xc698('0x2b')]=_0x5d0fb0;if(_0x1bb41c['query'][_0xc698('0x4b')]){_0x53608f[_0xc698('0x4c')]=[{'all':!![]}];}return db['Network'][_0xc698('0x4d')](_0x53608f);})[_0xc698('0x31')](function(_0x45b9d2){_0x40fdad[_0xc698('0x4e')]=_0x45b9d2;return _0x40fdad;})[_0xc698('0x31')](respondWithFilteredResult(_0xfcd62c,_0x53608f))['catch'](handleError(_0xfcd62c,null));};exports[_0xc698('0x4f')]=function(_0x205c70,_0x290e5a){var _0x1dcab3={'raw':!![],'where':{'id':_0x205c70[_0xc698('0x50')]['id']}},_0x557f37={};_0x557f37[_0xc698('0x3a')]=_[_0xc698('0x51')](db[_0xc698('0x4a')][_0xc698('0x38')]);_0x557f37[_0xc698('0x3b')]=_[_0xc698('0x51')](_0x205c70[_0xc698('0x3b')]);_0x557f37[_0xc698('0x52')]=_[_0xc698('0x3c')](_0x557f37[_0xc698('0x3a')],_0x557f37[_0xc698('0x3b')]);_0x1dcab3['attributes']=_[_0xc698('0x3c')](_0x557f37[_0xc698('0x3a')],qs[_0xc698('0x3e')](_0x205c70[_0xc698('0x3b')]['fields']));_0x1dcab3['attributes']=_0x1dcab3[_0xc698('0x3d')][_0xc698('0x3f')]?_0x1dcab3[_0xc698('0x3d')]:_0x557f37[_0xc698('0x3a')];if(_0x205c70[_0xc698('0x3b')][_0xc698('0x4b')]){_0x1dcab3[_0xc698('0x4c')]=[{'all':!![]}];}_0x1dcab3=_[_0xc698('0x47')]({},_0x1dcab3,_0x205c70[_0xc698('0x49')]);return db['Network']['find'](_0x1dcab3)[_0xc698('0x31')](handleEntityNotFound(_0x290e5a,null))[_0xc698('0x31')](respondWithResult(_0x290e5a,null))[_0xc698('0x53')](handleError(_0x290e5a,null));};exports[_0xc698('0x54')]=function(_0x71507f,_0x545246,_0x1e81be){var _0xec77ab;return db[_0xc698('0x55')][_0xc698('0x56')](function(_0x501ae8){return db[_0xc698('0x4a')][_0xc698('0x54')](_0x71507f[_0xc698('0x57')],{'raw':!![]})[_0xc698('0x31')](function(_0x47921c){_0xec77ab=_0x47921c;return db[_0xc698('0x4a')][_0xc698('0x4d')]({'where':{'type':_0x71507f[_0xc698('0x57')]['type']},'raw':!![]});})['then'](function(_0x13980b){if(_0xec77ab['type'][_0xc698('0x58')]()==_0xc698('0x59')){var _0x3c56de=fs[_0xc698('0x5a')](path[_0xc698('0x5b')](config[_0xc698('0x5c')],_0xc698('0x5d')),_0xc698('0x5e'));var _0x4b4fa3=ejs[_0xc698('0x5f')](_0x3c56de,{'networks':_0x13980b||[]});fs[_0xc698('0x60')](_0xc698('0x61'),_0x4b4fa3);return respondWithRpcPromise(_0xc698('0x62'),'create',{'module':_0xc698('0x63')});}else if(_0xec77ab[_0xc698('0x39')]['toUpperCase']()=='TURN'){var _0x171499=fs[_0xc698('0x5a')](path[_0xc698('0x5b')](config[_0xc698('0x5c')],_0xc698('0x64')),'utf8');var _0x19b481=ejs['render'](_0x171499,{'networks':_0x13980b||[]});fs['writeFileSync'](_0xc698('0x65'),_0x19b481);return respondWithRpcPromise(_0xc698('0x62'),_0xc698('0x54'),{'module':_0xc698('0x63')});}else{var _0x2088b1=fs[_0xc698('0x5a')](path[_0xc698('0x5b')](config[_0xc698('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x4813c6=ejs[_0xc698('0x5f')](_0x2088b1,{'networks':_0x13980b||[]});fs[_0xc698('0x60')](util[_0xc698('0x66')](_0xc698('0x67'),_0x71507f['body'][_0xc698('0x39')][_0xc698('0x68')]()),_0x4813c6);return respondWithRpcPromise(_0xc698('0x62'),'create',{'module':_0xc698('0x69')});}return null;})[_0xc698('0x31')](function(){return _0xec77ab;});})['then'](respondWithResult(_0x545246,0xc9))[_0xc698('0x53')](handleError(_0x545246,null));};exports[_0xc698('0x6a')]=function(_0x5c8f7a,_0x1f1e1a,_0x4323c7){var _0x24cac6;return db[_0xc698('0x55')]['transaction'](function(_0x3e0c6e){return db['Network']['find']({'where':{'id':_0x5c8f7a[_0xc698('0x50')]['id']}})[_0xc698('0x31')](handleEntityNotFound(_0x1f1e1a,null))[_0xc698('0x31')](saveUpdates(_0x5c8f7a['body'],null))[_0xc698('0x31')](function(_0x5544e0){if(_0x5544e0){_0x24cac6=_0x5544e0;return db[_0xc698('0x4a')][_0xc698('0x4d')]({'where':{'type':_0x24cac6['type']},'raw':!![]});}return null;})['then'](function(_0x12811f){if(_0x24cac6[_0xc698('0x39')][_0xc698('0x58')]()==_0xc698('0x59')){var _0x2e29c5=fs[_0xc698('0x5a')](path[_0xc698('0x5b')](config[_0xc698('0x5c')],_0xc698('0x5d')),_0xc698('0x5e'));var _0x30bcba=ejs['render'](_0x2e29c5,{'networks':_0x12811f||[]});fs[_0xc698('0x60')](_0xc698('0x61'),_0x30bcba);return respondWithRpcPromise(_0xc698('0x62'),_0xc698('0x6a'),{'module':'res_stun_monitor.so'});}else if(_0x24cac6['type'][_0xc698('0x58')]()==_0xc698('0x6b')){var _0x48e2e4=fs[_0xc698('0x5a')](path[_0xc698('0x5b')](config[_0xc698('0x5c')],_0xc698('0x64')),'utf8');var _0x4c6846=ejs['render'](_0x48e2e4,{'networks':_0x12811f||[]});fs['writeFileSync'](_0xc698('0x65'),_0x4c6846);return respondWithRpcPromise(_0xc698('0x62'),_0xc698('0x6a'),{'module':'res_stun_monitor.so'});}else{var _0x51232f=fs[_0xc698('0x5a')](path['join'](config['root'],_0xc698('0x6c')),_0xc698('0x5e'));var _0x1707e4=ejs['render'](_0x51232f,{'networks':_0x12811f||[]});fs[_0xc698('0x60')](util[_0xc698('0x66')](_0xc698('0x67'),_0x5c8f7a[_0xc698('0x57')][_0xc698('0x39')][_0xc698('0x68')]()),_0x1707e4);return respondWithRpcPromise('Reload','update',{'module':_0xc698('0x69')});}return null;})[_0xc698('0x31')](function(_0x5ed6cb){if(_0x5ed6cb){return _0x24cac6;}return null;});})[_0xc698('0x31')](respondWithResult(_0x1f1e1a,null))[_0xc698('0x53')](handleError(_0x1f1e1a,null));};exports[_0xc698('0x32')]=function(_0x2bf09e,_0x26c64b,_0x4a92ec){var _0x382f7f;return db[_0xc698('0x4a')][_0xc698('0x6d')]({'where':{'id':_0x2bf09e['params']['id']}})[_0xc698('0x31')](function(_0x28b809){_0x382f7f=_0x28b809;return _0x28b809;})['then'](handleEntityNotFound(_0x26c64b,null))[_0xc698('0x31')](removeEntity(_0x26c64b,null))[_0xc698('0x31')](function(){if(_0x382f7f){return db[_0xc698('0x4a')]['findAll']({'where':{'type':_0x382f7f['type']},'raw':!![]});}})[_0xc698('0x31')](function(_0x5d0223){if(_0x382f7f[_0xc698('0x39')][_0xc698('0x58')]()==_0xc698('0x59')){var _0x28bef7=fs['readFileSync'](path[_0xc698('0x5b')](config[_0xc698('0x5c')],_0xc698('0x5d')),'utf8');var _0x3c035c=ejs[_0xc698('0x5f')](_0x28bef7,{'networks':_0x5d0223||[]});fs['writeFileSync'](_0xc698('0x61'),_0x3c035c);return respondWithRpcPromise(_0xc698('0x62'),_0xc698('0x32'),{'module':_0xc698('0x63')});}else if(_0x382f7f[_0xc698('0x39')][_0xc698('0x58')]()=='TURN'){var _0x1ce93a=fs[_0xc698('0x5a')](path[_0xc698('0x5b')](config[_0xc698('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xc698('0x5e'));var _0x9def4=ejs[_0xc698('0x5f')](_0x1ce93a,{'networks':_0x5d0223||[]});fs['writeFileSync'](_0xc698('0x65'),_0x9def4);return respondWithRpcPromise(_0xc698('0x62'),_0xc698('0x32'),{'module':_0xc698('0x63')});}else{var _0xcc96dd=fs[_0xc698('0x5a')](path['join'](config[_0xc698('0x5c')],_0xc698('0x6c')),_0xc698('0x5e'));var _0x443b34=ejs[_0xc698('0x5f')](_0xcc96dd,{'networks':_0x5d0223||[]});fs[_0xc698('0x60')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x2bf09e[_0xc698('0x57')]['type']['toLowerCase']()),_0x443b34);return respondWithRpcPromise(_0xc698('0x62'),_0xc698('0x32'),{'module':'chan_sip.so'});}return null;})[_0xc698('0x53')](handleError(_0x26c64b,null));};
\ No newline at end of file
+var _0xe644=['server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','create','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','root','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','client','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','Network','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','include','options','find','sequelize','transaction','body','findAll','toUpperCase','STUN','readFileSync','join'];(function(_0x4dc7e5,_0x20553f){var _0x39fbfc=function(_0x51f67d){while(--_0x51f67d){_0x4dc7e5['push'](_0x4dc7e5['shift']());}};_0x39fbfc(++_0x20553f);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4e64('0x0'));var rimraf=require(_0x4e64('0x1'));var zipdir=require(_0x4e64('0x2'));var jsonpatch=require(_0x4e64('0x3'));var rp=require(_0x4e64('0x4'));var moment=require(_0x4e64('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4e64('0x6'));var util=require(_0x4e64('0x7'));var path=require(_0x4e64('0x8'));var sox=require(_0x4e64('0x9'));var csv=require(_0x4e64('0xa'));var ejs=require(_0x4e64('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e64('0xc'));var squel=require(_0x4e64('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4e64('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4e64('0xf'));var Redis=require(_0x4e64('0x10'));var authService=require(_0x4e64('0x11'));var qs=require(_0x4e64('0x12'));var as=require(_0x4e64('0x13'));var hardwareService=require(_0x4e64('0x14'));var logger=require('../../config/logger')(_0x4e64('0x15'));var utils=require(_0x4e64('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4e64('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x4e64('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7d1ad,_0xae8481,_0x9333fa,_0x2aa800){return new BPromise(function(_0x352eca,_0xb36502){var _0x207ed2=_0x2aa800||client;return _0x207ed2['request'](_0x7d1ad,_0x9333fa)[_0x4e64('0x19')](function(_0x5573af){logger[_0x4e64('0x1a')]('Network,\x20%s,\x20%s',_0xae8481,_0x4e64('0x1b'));logger[_0x4e64('0x1c')](_0x4e64('0x1d'),_0xae8481,_0x4e64('0x1b'),JSON[_0x4e64('0x1e')](_0x5573af));if(_0x5573af[_0x4e64('0x1f')]){if(_0x5573af[_0x4e64('0x1f')][_0x4e64('0x20')]===0x1f4){logger[_0x4e64('0x1f')](_0x4e64('0x21'),_0xae8481,_0x5573af['error'][_0x4e64('0x22')]);return _0xb36502(_0x5573af[_0x4e64('0x1f')]['message']);}logger[_0x4e64('0x1f')]('Network,\x20%s,\x20%s',_0xae8481,_0x5573af['error'][_0x4e64('0x22')]);return _0x352eca(_0x5573af[_0x4e64('0x1f')][_0x4e64('0x22')]);}else{logger['info'](_0x4e64('0x21'),_0xae8481,'request\x20sent');_0x352eca(_0x5573af[_0x4e64('0x23')][_0x4e64('0x22')]);}})[_0x4e64('0x24')](function(_0x4edbf9){logger[_0x4e64('0x1f')](_0x4e64('0x21'),_0xae8481,_0x4edbf9);_0xb36502(_0x4edbf9);});});}function respondWithStatusCode(_0x2431eb,_0x27d33e){_0x27d33e=_0x27d33e||0xcc;return function(_0x445864){if(_0x445864){return _0x2431eb[_0x4e64('0x25')](_0x27d33e);}return _0x2431eb[_0x4e64('0x26')](_0x27d33e)['end']();};}function respondWithResult(_0x83bebc,_0x29b4f8){_0x29b4f8=_0x29b4f8||0xc8;return function(_0x394a80){if(_0x394a80){return _0x83bebc['status'](_0x29b4f8)[_0x4e64('0x27')](_0x394a80);}};}function respondWithFilteredResult(_0x2f9637,_0x3a39ab){return function(_0x457023){if(_0x457023){var _0x45b458=typeof _0x3a39ab['offset']===_0x4e64('0x28')&&typeof _0x3a39ab[_0x4e64('0x29')]===_0x4e64('0x28');var _0x194f33=_0x457023[_0x4e64('0x2a')];var _0x1057d0=_0x45b458?0x0:_0x3a39ab[_0x4e64('0x2b')];var _0x14e389=_0x45b458?_0x457023['count']:_0x3a39ab[_0x4e64('0x2b')]+_0x3a39ab[_0x4e64('0x29')];var _0x45ef44;if(_0x14e389>=_0x194f33){_0x14e389=_0x194f33;_0x45ef44=0xc8;}else{_0x45ef44=0xce;}_0x2f9637[_0x4e64('0x26')](_0x45ef44);return _0x2f9637[_0x4e64('0x2c')](_0x4e64('0x2d'),_0x1057d0+'-'+_0x14e389+'/'+_0x194f33)[_0x4e64('0x27')](_0x457023);}return null;};}function patchUpdates(_0x4c4559){return function(_0x67698d){try{jsonpatch[_0x4e64('0x2e')](_0x67698d,_0x4c4559,!![]);}catch(_0x3cfd17){return BPromise[_0x4e64('0x2f')](_0x3cfd17);}return _0x67698d[_0x4e64('0x30')]();};}function saveUpdates(_0x3d6cec,_0x366905){return function(_0x5a9a36){if(_0x5a9a36){return _0x5a9a36[_0x4e64('0x31')](_0x3d6cec)[_0x4e64('0x19')](function(_0x1a4523){return _0x1a4523;});}return null;};}function removeEntity(_0x5a8ba7,_0x10f739){return function(_0x4c87b8){if(_0x4c87b8){return _0x4c87b8[_0x4e64('0x32')]()[_0x4e64('0x19')](function(){_0x5a8ba7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5417ad,_0x1b40ed){return function(_0x4caff1){if(!_0x4caff1){_0x5417ad[_0x4e64('0x25')](0x194);}return _0x4caff1;};}function handleError(_0x22b20d,_0x18c61a){_0x18c61a=_0x18c61a||0x1f4;return function(_0x18ca6c){logger[_0x4e64('0x1f')](_0x18ca6c[_0x4e64('0x33')]);if(_0x18ca6c[_0x4e64('0x34')]){delete _0x18ca6c['name'];}_0x22b20d[_0x4e64('0x26')](_0x18c61a)['send'](_0x18ca6c);};}exports[_0x4e64('0x35')]=function(_0x508d8b,_0x4d41c9){var _0x557270={},_0x14b80={},_0x5153bb={'count':0x0,'rows':[]};var _0x5679be=_[_0x4e64('0x36')](db[_0x4e64('0x37')][_0x4e64('0x38')],function(_0x189769){return{'name':_0x189769[_0x4e64('0x39')],'type':_0x189769[_0x4e64('0x3a')][_0x4e64('0x3b')]};});_0x14b80['model']=_['map'](_0x5679be,'name');_0x14b80[_0x4e64('0x3c')]=_[_0x4e64('0x3d')](_0x508d8b[_0x4e64('0x3c')]);_0x14b80[_0x4e64('0x3e')]=_['intersection'](_0x14b80[_0x4e64('0x3f')],_0x14b80[_0x4e64('0x3c')]);_0x557270[_0x4e64('0x40')]=_[_0x4e64('0x41')](_0x14b80[_0x4e64('0x3f')],qs['fields'](_0x508d8b['query'][_0x4e64('0x42')]));_0x557270['attributes']=_0x557270[_0x4e64('0x40')][_0x4e64('0x43')]?_0x557270[_0x4e64('0x40')]:_0x14b80[_0x4e64('0x3f')];if(!_0x508d8b[_0x4e64('0x3c')][_0x4e64('0x44')](_0x4e64('0x45'))){_0x557270['limit']=qs[_0x4e64('0x29')](_0x508d8b[_0x4e64('0x3c')][_0x4e64('0x29')]);_0x557270[_0x4e64('0x2b')]=qs[_0x4e64('0x2b')](_0x508d8b[_0x4e64('0x3c')][_0x4e64('0x2b')]);}_0x557270[_0x4e64('0x46')]=qs['sort'](_0x508d8b[_0x4e64('0x3c')][_0x4e64('0x47')]);_0x557270['where']=qs[_0x4e64('0x3e')](_[_0x4e64('0x48')](_0x508d8b['query'],_0x14b80[_0x4e64('0x3e')]),_0x5679be);if(_0x508d8b[_0x4e64('0x3c')][_0x4e64('0x49')]){_0x557270[_0x4e64('0x4a')]=_[_0x4e64('0x4b')](_0x557270['where'],{'$or':_[_0x4e64('0x36')](_0x5679be,function(_0x276e6f){if(_0x276e6f[_0x4e64('0x3a')]!==_0x4e64('0x4c')){var _0x383e01={};_0x383e01[_0x276e6f[_0x4e64('0x34')]]={'$like':'%'+_0x508d8b[_0x4e64('0x3c')][_0x4e64('0x49')]+'%'};return _0x383e01;}})});}_0x557270=_['merge']({},_0x557270,_0x508d8b['options']);var _0x407f51={'where':_0x557270[_0x4e64('0x4a')]};return db[_0x4e64('0x37')]['count'](_0x407f51)[_0x4e64('0x19')](function(_0xff6e17){_0x5153bb[_0x4e64('0x2a')]=_0xff6e17;if(_0x508d8b[_0x4e64('0x3c')][_0x4e64('0x4d')]){_0x557270['include']=[{'all':!![]}];}return db[_0x4e64('0x37')]['findAll'](_0x557270);})[_0x4e64('0x19')](function(_0x3a5fad){_0x5153bb[_0x4e64('0x4e')]=_0x3a5fad;return _0x5153bb;})[_0x4e64('0x19')](respondWithFilteredResult(_0x4d41c9,_0x557270))['catch'](handleError(_0x4d41c9,null));};exports[_0x4e64('0x4f')]=function(_0x2e96c7,_0x2d7efc){var _0x38a885={'raw':!![],'where':{'id':_0x2e96c7['params']['id']}},_0x32db0b={};_0x32db0b[_0x4e64('0x3f')]=_[_0x4e64('0x3d')](db[_0x4e64('0x37')][_0x4e64('0x38')]);_0x32db0b[_0x4e64('0x3c')]=_[_0x4e64('0x3d')](_0x2e96c7['query']);_0x32db0b[_0x4e64('0x3e')]=_[_0x4e64('0x41')](_0x32db0b[_0x4e64('0x3f')],_0x32db0b['query']);_0x38a885[_0x4e64('0x40')]=_[_0x4e64('0x41')](_0x32db0b['model'],qs[_0x4e64('0x42')](_0x2e96c7['query'][_0x4e64('0x42')]));_0x38a885['attributes']=_0x38a885[_0x4e64('0x40')]['length']?_0x38a885[_0x4e64('0x40')]:_0x32db0b[_0x4e64('0x3f')];if(_0x2e96c7[_0x4e64('0x3c')][_0x4e64('0x4d')]){_0x38a885[_0x4e64('0x50')]=[{'all':!![]}];}_0x38a885=_[_0x4e64('0x4b')]({},_0x38a885,_0x2e96c7[_0x4e64('0x51')]);return db['Network'][_0x4e64('0x52')](_0x38a885)[_0x4e64('0x19')](handleEntityNotFound(_0x2d7efc,null))[_0x4e64('0x19')](respondWithResult(_0x2d7efc,null))['catch'](handleError(_0x2d7efc,null));};exports['create']=function(_0x9ddc22,_0x5390b9,_0x198346){var _0x1530e5;return db[_0x4e64('0x53')][_0x4e64('0x54')](function(_0x8997bb){return db['Network']['create'](_0x9ddc22[_0x4e64('0x55')],{'raw':!![]})[_0x4e64('0x19')](function(_0xbdecb9){_0x1530e5=_0xbdecb9;return db[_0x4e64('0x37')][_0x4e64('0x56')]({'where':{'type':_0x9ddc22[_0x4e64('0x55')][_0x4e64('0x3a')]},'raw':!![]});})[_0x4e64('0x19')](function(_0x5ae46a){if(_0x1530e5[_0x4e64('0x3a')][_0x4e64('0x57')]()==_0x4e64('0x58')){var _0x49da0c=fs[_0x4e64('0x59')](path[_0x4e64('0x5a')](config['root'],_0x4e64('0x5b')),_0x4e64('0x5c'));var _0xb1ef5f=ejs[_0x4e64('0x5d')](_0x49da0c,{'networks':_0x5ae46a||[]});fs[_0x4e64('0x5e')](_0x4e64('0x5f'),_0xb1ef5f);return respondWithRpcPromise('Reload',_0x4e64('0x60'),{'module':_0x4e64('0x61')});}else if(_0x1530e5[_0x4e64('0x3a')]['toUpperCase']()==_0x4e64('0x62')){var _0x22f2e5=fs[_0x4e64('0x59')](path[_0x4e64('0x5a')](config['root'],_0x4e64('0x63')),_0x4e64('0x5c'));var _0x57b9bf=ejs[_0x4e64('0x5d')](_0x22f2e5,{'networks':_0x5ae46a||[]});fs[_0x4e64('0x5e')](_0x4e64('0x64'),_0x57b9bf);return respondWithRpcPromise(_0x4e64('0x65'),_0x4e64('0x60'),{'module':_0x4e64('0x61')});}else{var _0x404258=fs[_0x4e64('0x59')](path['join'](config[_0x4e64('0x66')],_0x4e64('0x67')),'utf8');var _0x98382f=ejs[_0x4e64('0x5d')](_0x404258,{'networks':_0x5ae46a||[]});fs[_0x4e64('0x5e')](util[_0x4e64('0x68')](_0x4e64('0x69'),_0x9ddc22['body'][_0x4e64('0x3a')][_0x4e64('0x6a')]()),_0x98382f);return respondWithRpcPromise('Reload',_0x4e64('0x60'),{'module':_0x4e64('0x6b')});}return null;})[_0x4e64('0x19')](function(){return _0x1530e5;});})[_0x4e64('0x19')](respondWithResult(_0x5390b9,0xc9))[_0x4e64('0x24')](handleError(_0x5390b9,null));};exports[_0x4e64('0x31')]=function(_0x52a947,_0x1ea82b,_0x291fe8){var _0xceff61;return db['sequelize'][_0x4e64('0x54')](function(_0xbb1aeb){return db[_0x4e64('0x37')]['find']({'where':{'id':_0x52a947[_0x4e64('0x6c')]['id']}})[_0x4e64('0x19')](handleEntityNotFound(_0x1ea82b,null))['then'](saveUpdates(_0x52a947['body'],null))['then'](function(_0x3f2a81){if(_0x3f2a81){_0xceff61=_0x3f2a81;return db[_0x4e64('0x37')][_0x4e64('0x56')]({'where':{'type':_0xceff61[_0x4e64('0x3a')]},'raw':!![]});}return null;})[_0x4e64('0x19')](function(_0x5e454e){if(_0xceff61[_0x4e64('0x3a')][_0x4e64('0x57')]()==_0x4e64('0x58')){var _0x4669a5=fs[_0x4e64('0x59')](path[_0x4e64('0x5a')](config[_0x4e64('0x66')],_0x4e64('0x5b')),'utf8');var _0x5d0eda=ejs[_0x4e64('0x5d')](_0x4669a5,{'networks':_0x5e454e||[]});fs[_0x4e64('0x5e')](_0x4e64('0x5f'),_0x5d0eda);return respondWithRpcPromise(_0x4e64('0x65'),_0x4e64('0x31'),{'module':_0x4e64('0x61')});}else if(_0xceff61['type'][_0x4e64('0x57')]()==_0x4e64('0x62')){var _0xa11a15=fs[_0x4e64('0x59')](path['join'](config['root'],_0x4e64('0x63')),_0x4e64('0x5c'));var _0x1dc7c6=ejs['render'](_0xa11a15,{'networks':_0x5e454e||[]});fs[_0x4e64('0x5e')](_0x4e64('0x64'),_0x1dc7c6);return respondWithRpcPromise(_0x4e64('0x65'),'update',{'module':_0x4e64('0x61')});}else{var _0x1cd145=fs[_0x4e64('0x59')](path[_0x4e64('0x5a')](config[_0x4e64('0x66')],_0x4e64('0x67')),_0x4e64('0x5c'));var _0x334b3c=ejs[_0x4e64('0x5d')](_0x1cd145,{'networks':_0x5e454e||[]});fs['writeFileSync'](util[_0x4e64('0x68')]('/etc/asterisk/sip_xcally_%s.conf',_0x52a947[_0x4e64('0x55')][_0x4e64('0x3a')][_0x4e64('0x6a')]()),_0x334b3c);return respondWithRpcPromise(_0x4e64('0x65'),_0x4e64('0x31'),{'module':_0x4e64('0x6b')});}return null;})[_0x4e64('0x19')](function(_0xfa1ad0){if(_0xfa1ad0){return _0xceff61;}return null;});})[_0x4e64('0x19')](respondWithResult(_0x1ea82b,null))[_0x4e64('0x24')](handleError(_0x1ea82b,null));};exports[_0x4e64('0x32')]=function(_0x4a4964,_0x1f1cb8,_0x3db5ff){var _0x264e8a;return db[_0x4e64('0x37')]['find']({'where':{'id':_0x4a4964['params']['id']}})[_0x4e64('0x19')](function(_0x35b37d){_0x264e8a=_0x35b37d;return _0x35b37d;})['then'](handleEntityNotFound(_0x1f1cb8,null))[_0x4e64('0x19')](removeEntity(_0x1f1cb8,null))['then'](function(){if(_0x264e8a){return db[_0x4e64('0x37')][_0x4e64('0x56')]({'where':{'type':_0x264e8a[_0x4e64('0x3a')]},'raw':!![]});}})[_0x4e64('0x19')](function(_0x588927){if(_0x264e8a[_0x4e64('0x3a')]['toUpperCase']()=='STUN'){var _0x4d33cc=fs[_0x4e64('0x59')](path[_0x4e64('0x5a')](config['root'],_0x4e64('0x5b')),_0x4e64('0x5c'));var _0x132a0=ejs[_0x4e64('0x5d')](_0x4d33cc,{'networks':_0x588927||[]});fs['writeFileSync'](_0x4e64('0x5f'),_0x132a0);return respondWithRpcPromise('Reload',_0x4e64('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x264e8a['type'][_0x4e64('0x57')]()==_0x4e64('0x62')){var _0x207966=fs[_0x4e64('0x59')](path[_0x4e64('0x5a')](config[_0x4e64('0x66')],_0x4e64('0x63')),_0x4e64('0x5c'));var _0x19bc95=ejs[_0x4e64('0x5d')](_0x207966,{'networks':_0x588927||[]});fs[_0x4e64('0x5e')]('/etc/asterisk/turn_xcally.conf',_0x19bc95);return respondWithRpcPromise(_0x4e64('0x65'),_0x4e64('0x32'),{'module':_0x4e64('0x61')});}else{var _0x2b2e64=fs[_0x4e64('0x59')](path['join'](config[_0x4e64('0x66')],'server/files/templates/network.ejs'),'utf8');var _0x7a8300=ejs[_0x4e64('0x5d')](_0x2b2e64,{'networks':_0x588927||[]});fs[_0x4e64('0x5e')](util['format'](_0x4e64('0x69'),_0x4a4964[_0x4e64('0x55')]['type']['toLowerCase']()),_0x7a8300);return respondWithRpcPromise(_0x4e64('0x65'),_0x4e64('0x32'),{'module':_0x4e64('0x6b')});}return null;})['catch'](handleError(_0x1f1cb8,null));};
\ No newline at end of file
index 973546a..51af9bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe28e=['rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x13e7c9,_0x4e8d97){var _0x39a95f=function(_0x30cb72){while(--_0x30cb72){_0x13e7c9['push'](_0x13e7c9['shift']());}};_0x39a95f(++_0x4e8d97);}(_0xe28e,0x1ba));var _0xee28=function(_0x599a2a,_0x2a698e){_0x599a2a=_0x599a2a-0x0;var _0x465f7e=_0xe28e[_0x599a2a];return _0x465f7e;};'use strict';var _=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var logger=require(_0xee28('0x2'))(_0xee28('0x3'));var moment=require(_0xee28('0x4'));var BPromise=require(_0xee28('0x5'));var rp=require(_0xee28('0x6'));var fs=require('fs');var path=require(_0xee28('0x7'));var rimraf=require(_0xee28('0x8'));var config=require(_0xee28('0x9'));var attributes=require(_0xee28('0xa'));module[_0xee28('0xb')]=function(_0x162d3f,_0x48e72f){return _0x162d3f[_0xee28('0xc')](_0xee28('0xd'),attributes,{'tableName':_0xee28('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x74f0=['define','Network','network','util','moment','bluebird','request-promise','path','./network.attributes','exports'];(function(_0x4ed8d0,_0x3958df){var _0x52514e=function(_0x397a5f){while(--_0x397a5f){_0x4ed8d0['push'](_0x4ed8d0['shift']());}};_0x52514e(++_0x3958df);}(_0x74f0,0xf3));var _0x074f=function(_0x4a1353,_0x2fbe86){_0x4a1353=_0x4a1353-0x0;var _0x3805cc=_0x74f0[_0x4a1353];return _0x3805cc;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x074f('0x1'));var BPromise=require(_0x074f('0x2'));var rp=require(_0x074f('0x3'));var fs=require('fs');var path=require(_0x074f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x074f('0x5'));module[_0x074f('0x6')]=function(_0x203f47,_0x126607){return _0x203f47[_0x074f('0x7')](_0x074f('0x8'),attributes,{'tableName':_0x074f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6210205..8f05f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x130417,_0x349dcc){var _0x53c4dc=function(_0x33bdd5){while(--_0x33bdd5){_0x130417['push'](_0x130417['shift']());}};_0x53c4dc(++_0x349dcc);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x27ea43,_0x2642f){_0x27ea43=_0x27ea43-0x0;var _0x444024=_0x7a54[_0x27ea43];return _0x444024;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index be47588..25f0381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c57=['connect-timeout','Router','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','/:id/applications','addApplications','/:id/send','send','put','delete','removeDispositions','removeAnswers','exports','multer','util','path'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x6c57,0xe4));var _0x76c5=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6c57[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x76c5('0x0'));var util=require(_0x76c5('0x1'));var path=require(_0x76c5('0x2'));var timeout=require(_0x76c5('0x3'));var express=require('express');var router=express[_0x76c5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x76c5('0x5')]('/',auth[_0x76c5('0x6')](),controller['index']);router[_0x76c5('0x5')](_0x76c5('0x7'),auth[_0x76c5('0x6')](),controller[_0x76c5('0x8')]);router[_0x76c5('0x5')](_0x76c5('0x9'),auth[_0x76c5('0x6')](),controller[_0x76c5('0xa')]);router[_0x76c5('0x5')](_0x76c5('0xb'),auth[_0x76c5('0x6')](),controller[_0x76c5('0xc')]);router['get'](_0x76c5('0xd'),auth[_0x76c5('0x6')](),controller[_0x76c5('0xe')]);router[_0x76c5('0x5')]('/:id/applications',auth[_0x76c5('0x6')](),controller[_0x76c5('0xf')]);router[_0x76c5('0x5')](_0x76c5('0x10'),auth[_0x76c5('0x6')](),controller[_0x76c5('0x11')]);router['get'](_0x76c5('0x12'),auth[_0x76c5('0x6')](),controller[_0x76c5('0x13')]);router[_0x76c5('0x14')]('/',auth[_0x76c5('0x6')](),controller[_0x76c5('0x15')]);router['post'](_0x76c5('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x76c5('0x14')](_0x76c5('0xd'),auth[_0x76c5('0x6')](),controller[_0x76c5('0x16')]);router['post'](_0x76c5('0x17'),controller['notify']);router[_0x76c5('0x14')](_0x76c5('0x18'),auth['isAuthenticated'](),controller[_0x76c5('0x19')]);router[_0x76c5('0x14')](_0x76c5('0x12'),auth[_0x76c5('0x6')](),controller['addAgents']);router[_0x76c5('0x14')](_0x76c5('0x1a'),auth[_0x76c5('0x6')](),controller[_0x76c5('0x1b')]);router[_0x76c5('0x1c')](_0x76c5('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x76c5('0x9'),auth['isAuthenticated'](),controller['destroy']);router[_0x76c5('0x1d')](_0x76c5('0xb'),auth[_0x76c5('0x6')](),controller[_0x76c5('0x1e')]);router[_0x76c5('0x1d')]('/:id/canned_answers',auth[_0x76c5('0x6')](),controller[_0x76c5('0x1f')]);router[_0x76c5('0x1d')](_0x76c5('0x12'),auth[_0x76c5('0x6')](),controller['removeAgents']);module[_0x76c5('0x20')]=router;
\ No newline at end of file
+var _0xb4f0=['index','isAuthenticated','describe','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x1c4da0,_0x23e837){var _0x490200=function(_0x23297a){while(--_0x23297a){_0x1c4da0['push'](_0x1c4da0['shift']());}};_0x490200(++_0x23e837);}(_0xb4f0,0x185));var _0x0b4f=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0xb4f0[_0x3cbe1c];return _0x5ee08b;};'use strict';var multer=require('multer');var util=require(_0x0b4f('0x0'));var path=require(_0x0b4f('0x1'));var timeout=require(_0x0b4f('0x2'));var express=require(_0x0b4f('0x3'));var router=express[_0x0b4f('0x4')]();var fs_extra=require(_0x0b4f('0x5'));var auth=require(_0x0b4f('0x6'));var interaction=require(_0x0b4f('0x7'));var config=require(_0x0b4f('0x8'));var controller=require(_0x0b4f('0x9'));router[_0x0b4f('0xa')]('/',auth['isAuthenticated'](),controller[_0x0b4f('0xb')]);router['get']('/describe',auth[_0x0b4f('0xc')](),controller[_0x0b4f('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0b4f('0xa')](_0x0b4f('0xe'),auth[_0x0b4f('0xc')](),controller['getDispositions']);router['get'](_0x0b4f('0xf'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x10')]);router['get'](_0x0b4f('0x11'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x12')]);router[_0x0b4f('0xa')](_0x0b4f('0x13'),auth['isAuthenticated'](),controller[_0x0b4f('0x14')]);router[_0x0b4f('0xa')](_0x0b4f('0x15'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x16')]);router[_0x0b4f('0x17')]('/',auth['isAuthenticated'](),controller[_0x0b4f('0x18')]);router[_0x0b4f('0x17')](_0x0b4f('0xe'),auth[_0x0b4f('0xc')](),controller['addDisposition']);router['post'](_0x0b4f('0xf'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x19')]);router[_0x0b4f('0x17')](_0x0b4f('0x1a'),controller[_0x0b4f('0x1b')]);router[_0x0b4f('0x17')](_0x0b4f('0x11'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x1c')]);router[_0x0b4f('0x17')](_0x0b4f('0x15'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x1d')]);router[_0x0b4f('0x17')](_0x0b4f('0x1e'),auth['isAuthenticated'](),controller[_0x0b4f('0x1f')]);router[_0x0b4f('0x20')](_0x0b4f('0x21'),auth[_0x0b4f('0xc')](),controller['update']);router[_0x0b4f('0x22')](_0x0b4f('0x21'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x23')]);router[_0x0b4f('0x22')](_0x0b4f('0xe'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x24')]);router[_0x0b4f('0x22')](_0x0b4f('0xf'),auth[_0x0b4f('0xc')](),controller[_0x0b4f('0x25')]);router[_0x0b4f('0x22')](_0x0b4f('0x15'),auth['isAuthenticated'](),controller[_0x0b4f('0x26')]);module[_0x0b4f('0x27')]=router;
\ No newline at end of file
index d41804e..5257908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd449=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT','BOOLEAN','INTEGER'];(function(_0x31b40d,_0x121d62){var _0x7905fd=function(_0x1ad7b1){while(--_0x1ad7b1){_0x31b40d['push'](_0x31b40d['shift']());}};_0x7905fd(++_0x121d62);}(_0xd449,0x7a));var _0x9d44=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xd449[_0x51c819];return _0x15c5d2;};'use strict';var Sequelize=require(_0x9d44('0x0'));var rs=require(_0x9d44('0x1'));module[_0x9d44('0x2')]={'name':{'type':Sequelize[_0x9d44('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9d44('0x3')],'defaultValue':function(){return rs[_0x9d44('0x4')]();}},'replyUri':{'type':Sequelize[_0x9d44('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9d44('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9d44('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9d44('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9d44('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9d44('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9d44('0x3')]},'queueTransfer':{'type':Sequelize[_0x9d44('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9d44('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9d44('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x9d44('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9d44('0x9'),'set':function(_0x1db26c){if(!_0x1db26c)this[_0x9d44('0xa')](_0x9d44('0xb'),null);this['setDataValue'](_0x9d44('0xc'),_0x1db26c);}}};
\ No newline at end of file
+var _0xb85f=['mandatoryDisposition','randomstring','STRING','name','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x11bab9,_0x39a3de){var _0x20c4f9=function(_0x403f06){while(--_0x403f06){_0x11bab9['push'](_0x11bab9['shift']());}};_0x20c4f9(++_0x39a3de);}(_0xb85f,0x1c9));var _0xfb85=function(_0x4b74ba,_0x1e1a05){_0x4b74ba=_0x4b74ba-0x0;var _0x4277c0=_0xb85f[_0x4b74ba];return _0x4277c0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfb85('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb85('0x1')],'unique':_0xfb85('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xfb85('0x1')]},'token':{'type':Sequelize[_0xfb85('0x1')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xfb85('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfb85('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb85('0x3')],'defaultValue':function(){return _0xfb85('0x4');}},'notificationSound':{'type':Sequelize[_0xfb85('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb85('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xfb85('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb85('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb85('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xfb85('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xfb85('0x5')],'defaultValue':![],'comment':_0xfb85('0x8'),'set':function(_0x5f4f35){if(!_0x5f4f35)this[_0xfb85('0x9')](_0xfb85('0xa'),null);this[_0xfb85('0x9')](_0xfb85('0xb'),_0x5f4f35);}}};
\ No newline at end of file
index c2d531a..f8dd15b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa14d=['model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','include','findAll','show','params','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','DESC','Applications','account','applications','list','orderBy','priority','asc','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','User','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key'];(function(_0x3d198d,_0x28e7d6){var _0x2fa4f7=function(_0x1fc962){while(--_0x1fc962){_0x3d198d['push'](_0x3d198d['shift']());}};_0x2fa4f7(++_0x28e7d6);}(_0xa14d,0x7e));var _0xda14=function(_0x43ba25,_0x5255f0){_0x43ba25=_0x43ba25-0x0;var _0x363307=_0xa14d[_0x43ba25];return _0x363307;};'use strict';var emlformat=require(_0xda14('0x0'));var rimraf=require(_0xda14('0x1'));var zipdir=require(_0xda14('0x2'));var jsonpatch=require(_0xda14('0x3'));var rp=require(_0xda14('0x4'));var moment=require(_0xda14('0x5'));var BPromise=require(_0xda14('0x6'));var Mustache=require(_0xda14('0x7'));var util=require(_0xda14('0x8'));var path=require('path');var sox=require(_0xda14('0x9'));var csv=require(_0xda14('0xa'));var ejs=require(_0xda14('0xb'));var fs=require('fs');var fs_extra=require(_0xda14('0xc'));var _=require('lodash');var squel=require(_0xda14('0xd'));var crypto=require(_0xda14('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xda14('0xf'));var toCsv=require(_0xda14('0xa'));var querystring=require(_0xda14('0x10'));var Papa=require(_0xda14('0x11'));var Redis=require(_0xda14('0x12'));var authService=require(_0xda14('0x13'));var qs=require(_0xda14('0x14'));var as=require(_0xda14('0x15'));var hardwareService=require(_0xda14('0x16'));var logger=require(_0xda14('0x17'))(_0xda14('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xda14('0x19'));var db=require(_0xda14('0x1a'))['db'];config['redis']=_[_0xda14('0x1b')](config['redis'],{'host':_0xda14('0x1c'),'port':0x18eb});var socket=require(_0xda14('0x1d'))(new Redis(config[_0xda14('0x1e')]));require(_0xda14('0x1f'))[_0xda14('0x20')](socket);var jayson=require(_0xda14('0x21'));var client=jayson['client'][_0xda14('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xda14('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x8f4363,_0x2587f8,_0x4e2332,_0x2e9c32){return new BPromise(function(_0xe4b9e,_0x2ad68c){var _0x3ae5fa=_0x2e9c32||client;return _0x3ae5fa[_0xda14('0x23')](_0x8f4363,_0x4e2332)[_0xda14('0x24')](function(_0x5e4b55){logger[_0xda14('0x25')](_0xda14('0x26'),_0x2587f8,_0xda14('0x27'));logger[_0xda14('0x28')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2587f8,_0xda14('0x27'),JSON[_0xda14('0x29')](_0x5e4b55));if(_0x5e4b55[_0xda14('0x2a')]){if(_0x5e4b55[_0xda14('0x2a')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2587f8,_0x5e4b55[_0xda14('0x2a')]['message']);return _0x2ad68c(_0x5e4b55['error'][_0xda14('0x2b')]);}logger[_0xda14('0x2a')](_0xda14('0x26'),_0x2587f8,_0x5e4b55[_0xda14('0x2a')]['message']);return _0xe4b9e(_0x5e4b55[_0xda14('0x2a')][_0xda14('0x2b')]);}else{logger[_0xda14('0x25')](_0xda14('0x26'),_0x2587f8,'request\x20sent');_0xe4b9e(_0x5e4b55['result']['message']);}})[_0xda14('0x2c')](function(_0x429242){logger[_0xda14('0x2a')](_0xda14('0x26'),_0x2587f8,_0x429242);_0x2ad68c(_0x429242);});});}function respondWithStatusCode(_0x5bad9b,_0x33400f){_0x33400f=_0x33400f||0xcc;return function(_0x2fd9eb){if(_0x2fd9eb){return _0x5bad9b[_0xda14('0x2d')](_0x33400f);}return _0x5bad9b[_0xda14('0x2e')](_0x33400f)[_0xda14('0x2f')]();};}function respondWithResult(_0x39d104,_0x28c2eb){_0x28c2eb=_0x28c2eb||0xc8;return function(_0x1db4a3){if(_0x1db4a3){return _0x39d104['status'](_0x28c2eb)[_0xda14('0x30')](_0x1db4a3);}};}function respondWithFilteredResult(_0xaa2ce7,_0x2cfdfc){return function(_0x568296){if(_0x568296){var _0x36e5be=typeof _0x2cfdfc[_0xda14('0x31')]===_0xda14('0x32')&&typeof _0x2cfdfc[_0xda14('0x33')]==='undefined';var _0x5f19ec=_0x568296[_0xda14('0x34')];var _0x2e5941=_0x36e5be?0x0:_0x2cfdfc[_0xda14('0x31')];var _0x33ceb9=_0x36e5be?_0x568296[_0xda14('0x34')]:_0x2cfdfc['offset']+_0x2cfdfc[_0xda14('0x33')];var _0x3ba28b;if(_0x33ceb9>=_0x5f19ec){_0x33ceb9=_0x5f19ec;_0x3ba28b=0xc8;}else{_0x3ba28b=0xce;}_0xaa2ce7[_0xda14('0x2e')](_0x3ba28b);return _0xaa2ce7[_0xda14('0x35')](_0xda14('0x36'),_0x2e5941+'-'+_0x33ceb9+'/'+_0x5f19ec)[_0xda14('0x30')](_0x568296);}return null;};}function patchUpdates(_0x57b324){return function(_0x48e632){try{jsonpatch[_0xda14('0x37')](_0x48e632,_0x57b324,!![]);}catch(_0x2b0acf){return BPromise[_0xda14('0x38')](_0x2b0acf);}return _0x48e632[_0xda14('0x39')]();};}function saveUpdates(_0x3bc980,_0x37c8e5){return function(_0x5bb073){if(_0x5bb073){return _0x5bb073[_0xda14('0x3a')](_0x3bc980)[_0xda14('0x24')](function(_0x2b1124){return _0x2b1124;});}return null;};}function removeEntity(_0x23ab1f,_0x4fe380){return function(_0x31c4fc){if(_0x31c4fc){return _0x31c4fc[_0xda14('0x3b')]()[_0xda14('0x24')](function(){var _0x22387d=_0x31c4fc[_0xda14('0x3c')]({'plain':!![]});var _0x1fffe1='OpenchannelAccounts';return db[_0xda14('0x3d')]['destroy']({'where':{'type':_0x1fffe1,'resourceId':_0x22387d['id']}})[_0xda14('0x24')](function(){return _0x31c4fc;});})[_0xda14('0x24')](function(){_0x23ab1f[_0xda14('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa46b,_0x4fbe66){return function(_0x5c1bf3){if(!_0x5c1bf3){_0x5aa46b['sendStatus'](0x194);}return _0x5c1bf3;};}function handleError(_0x20442d,_0x4e72a3){_0x4e72a3=_0x4e72a3||0x1f4;return function(_0x2568a0){logger[_0xda14('0x2a')](_0x2568a0['stack']);if(_0x2568a0[_0xda14('0x3e')]){delete _0x2568a0[_0xda14('0x3e')];}_0x20442d[_0xda14('0x2e')](_0x4e72a3)[_0xda14('0x3f')](_0x2568a0);};}exports[_0xda14('0x40')]=function(_0x1de09c,_0x4f87f4){var _0x1ce3d5={'include':[{'model':db[_0xda14('0x41')],'as':_0xda14('0x42')}]},_0x592848={},_0x6f09bd={'count':0x0,'rows':[]};var _0x227a5d=_[_0xda14('0x43')](db['OpenchannelAccount'][_0xda14('0x44')],function(_0x2b76fc){return{'name':_0x2b76fc[_0xda14('0x45')],'type':_0x2b76fc[_0xda14('0x46')][_0xda14('0x47')]};});_0x592848[_0xda14('0x48')]=_[_0xda14('0x43')](_0x227a5d,_0xda14('0x3e'));_0x592848['query']=_[_0xda14('0x49')](_0x1de09c['query']);_0x592848[_0xda14('0x4a')]=_[_0xda14('0x4b')](_0x592848['model'],_0x592848[_0xda14('0x4c')]);_0x1ce3d5[_0xda14('0x4d')]=_[_0xda14('0x4b')](_0x592848[_0xda14('0x48')],qs[_0xda14('0x4e')](_0x1de09c[_0xda14('0x4c')][_0xda14('0x4e')]));_0x1ce3d5[_0xda14('0x4d')]=_0x1ce3d5[_0xda14('0x4d')][_0xda14('0x4f')]?_0x1ce3d5[_0xda14('0x4d')]:_0x592848[_0xda14('0x48')];if(!_0x1de09c[_0xda14('0x4c')][_0xda14('0x50')](_0xda14('0x51'))){_0x1ce3d5[_0xda14('0x33')]=qs[_0xda14('0x33')](_0x1de09c[_0xda14('0x4c')][_0xda14('0x33')]);_0x1ce3d5[_0xda14('0x31')]=qs[_0xda14('0x31')](_0x1de09c[_0xda14('0x4c')][_0xda14('0x31')]);}_0x1ce3d5[_0xda14('0x52')]=qs[_0xda14('0x53')](_0x1de09c['query'][_0xda14('0x53')]);_0x1ce3d5[_0xda14('0x54')]=qs['filters'](_[_0xda14('0x55')](_0x1de09c[_0xda14('0x4c')],_0x592848[_0xda14('0x4a')]),_0x227a5d);if(_0x1de09c[_0xda14('0x4c')][_0xda14('0x56')]){_0x1ce3d5['where']=_[_0xda14('0x57')](_0x1ce3d5['where'],{'$or':_['map'](_0x227a5d,function(_0x2f2467){if(_0x2f2467[_0xda14('0x46')]!==_0xda14('0x58')){var _0x273ab3={};_0x273ab3[_0x2f2467[_0xda14('0x3e')]]={'$like':'%'+_0x1de09c[_0xda14('0x4c')][_0xda14('0x56')]+'%'};return _0x273ab3;}})});}_0x1ce3d5=_[_0xda14('0x57')]({},_0x1ce3d5,_0x1de09c[_0xda14('0x59')]);var _0xc5a0b7={'where':_0x1ce3d5[_0xda14('0x54')]};return db[_0xda14('0x5a')][_0xda14('0x34')](_0xc5a0b7)[_0xda14('0x24')](function(_0x45ee80){_0x6f09bd[_0xda14('0x34')]=_0x45ee80;if(_0x1de09c[_0xda14('0x4c')]['includeAll']){_0x1ce3d5[_0xda14('0x5b')]=[{'all':!![]}];}return db[_0xda14('0x5a')][_0xda14('0x5c')](_0x1ce3d5);})['then'](function(_0x1e5eb8){_0x6f09bd['rows']=_0x1e5eb8;return _0x6f09bd;})[_0xda14('0x24')](respondWithFilteredResult(_0x4f87f4,_0x1ce3d5))['catch'](handleError(_0x4f87f4,null));};exports[_0xda14('0x5d')]=function(_0x59ce70,_0xc2c27b){var _0x31b7b1={'raw':![],'where':{'id':_0x59ce70[_0xda14('0x5e')]['id']},'include':[{'model':db[_0xda14('0x41')],'as':'mandatoryDispositionPause'}]},_0x45e3bb={};_0x45e3bb[_0xda14('0x48')]=_['keys'](db[_0xda14('0x5a')][_0xda14('0x44')]);_0x45e3bb[_0xda14('0x4c')]=_[_0xda14('0x49')](_0x59ce70[_0xda14('0x4c')]);_0x45e3bb[_0xda14('0x4a')]=_[_0xda14('0x4b')](_0x45e3bb[_0xda14('0x48')],_0x45e3bb['query']);_0x31b7b1[_0xda14('0x4d')]=_[_0xda14('0x4b')](_0x45e3bb[_0xda14('0x48')],qs['fields'](_0x59ce70[_0xda14('0x4c')][_0xda14('0x4e')]));_0x31b7b1[_0xda14('0x4d')]=_0x31b7b1[_0xda14('0x4d')][_0xda14('0x4f')]?_0x31b7b1[_0xda14('0x4d')]:_0x45e3bb[_0xda14('0x48')];if(_0x59ce70[_0xda14('0x4c')][_0xda14('0x5f')]){_0x31b7b1[_0xda14('0x5b')]=[{'all':!![]}];}_0x31b7b1=_[_0xda14('0x57')]({},_0x31b7b1,_0x59ce70[_0xda14('0x59')]);return db[_0xda14('0x5a')][_0xda14('0x60')](_0x31b7b1)[_0xda14('0x24')](handleEntityNotFound(_0xc2c27b,null))[_0xda14('0x24')](respondWithResult(_0xc2c27b,null))[_0xda14('0x2c')](handleError(_0xc2c27b,null));};exports['create']=function(_0xa499d9,_0x976b46){return db[_0xda14('0x5a')]['create'](_0xa499d9[_0xda14('0x61')],{})['then'](function(_0x5a5167){var _0xcad1e5=_0xa499d9['user']['get']({'plain':!![]});if(!_0xcad1e5)throw new Error(_0xda14('0x62'));if(_0xcad1e5[_0xda14('0x63')]===_0xda14('0x64')){var _0x36acc9=_0x5a5167[_0xda14('0x3c')]({'plain':!![]});var _0x1be355='OpenchannelAccounts';return db[_0xda14('0x65')][_0xda14('0x60')]({'where':{'name':_0x1be355,'userProfileId':_0xcad1e5[_0xda14('0x66')]},'raw':!![]})[_0xda14('0x24')](function(_0x11e78c){if(_0x11e78c&&_0x11e78c[_0xda14('0x67')]===0x0){return db[_0xda14('0x3d')][_0xda14('0x68')]({'name':_0x36acc9['name'],'resourceId':_0x36acc9['id'],'type':_0x11e78c[_0xda14('0x3e')],'sectionId':_0x11e78c['id']},{})[_0xda14('0x24')](function(){return _0x5a5167;});}else{return _0x5a5167;}})[_0xda14('0x2c')](function(_0x5911a2){logger[_0xda14('0x2a')](_0xda14('0x69'),_0x5911a2);throw _0x5911a2;});}return _0x5a5167;})[_0xda14('0x24')](respondWithResult(_0x976b46,0xc9))[_0xda14('0x2c')](handleError(_0x976b46,null));};exports[_0xda14('0x3a')]=function(_0x40d52e,_0x20e45d){if(_0x40d52e[_0xda14('0x61')]['id']){delete _0x40d52e[_0xda14('0x61')]['id'];}return db[_0xda14('0x5a')][_0xda14('0x60')]({'where':{'id':_0x40d52e[_0xda14('0x5e')]['id']},'include':[{'model':db[_0xda14('0x41')],'as':'mandatoryDispositionPause'}]})[_0xda14('0x24')](handleEntityNotFound(_0x20e45d,null))[_0xda14('0x24')](saveUpdates(_0x40d52e[_0xda14('0x61')],null))['then'](respondWithResult(_0x20e45d,null))[_0xda14('0x2c')](handleError(_0x20e45d,null));};exports[_0xda14('0x3b')]=function(_0x5011d9,_0x491e40){return db[_0xda14('0x5a')][_0xda14('0x60')]({'where':{'id':_0x5011d9['params']['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x491e40,null))[_0xda14('0x24')](removeEntity(_0x491e40,null))[_0xda14('0x2c')](handleError(_0x491e40,null));};exports['describe']=function(_0x236ad6,_0x3a383a){return db[_0xda14('0x5a')][_0xda14('0x6a')]()[_0xda14('0x24')](respondWithResult(_0x3a383a,null))[_0xda14('0x2c')](handleError(_0x3a383a,null));};exports['addDisposition']=function(_0x26eab8,_0x4b5141,_0x26a835){if(_0x26eab8[_0xda14('0x61')]['id']){delete _0x26eab8[_0xda14('0x61')]['id'];}return db[_0xda14('0x5a')]['find']({'where':{'id':_0x26eab8[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x4b5141,null))[_0xda14('0x24')](function(_0x1501c2){if(_0x1501c2){_0x26eab8['body'][_0xda14('0x6b')]=_0x1501c2['id'];return db['Disposition'][_0xda14('0x68')](_0x26eab8[_0xda14('0x61')]);}})[_0xda14('0x24')](respondWithResult(_0x4b5141,null))['catch'](handleError(_0x4b5141,null));};exports[_0xda14('0x6c')]=function(_0x5d3953,_0x1736ac,_0x467be7){var _0x5240cc={'raw':![],'where':{}};var _0x4efb85={};var _0x474c50={'count':0x0,'rows':[]};return db[_0xda14('0x5a')][_0xda14('0x6d')]({'where':{'id':_0x5d3953[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x1736ac,null))['then'](function(_0x5496f7){if(_0x5496f7){_0x4efb85['model']=_[_0xda14('0x49')](db[_0xda14('0x6e')][_0xda14('0x44')]);_0x4efb85[_0xda14('0x4c')]=_[_0xda14('0x49')](_0x5d3953['query']);_0x4efb85[_0xda14('0x4a')]=_[_0xda14('0x4b')](_0x4efb85[_0xda14('0x48')],_0x4efb85[_0xda14('0x4c')]);_0x5240cc[_0xda14('0x4d')]=_[_0xda14('0x4b')](_0x4efb85['model'],qs[_0xda14('0x4e')](_0x5d3953[_0xda14('0x4c')][_0xda14('0x4e')]));_0x5240cc[_0xda14('0x4d')]=_0x5240cc['attributes'][_0xda14('0x4f')]?_0x5240cc[_0xda14('0x4d')]:_0x4efb85['model'];if(!_0x5d3953['query'][_0xda14('0x50')](_0xda14('0x51'))){_0x5240cc[_0xda14('0x33')]=qs['limit'](_0x5d3953[_0xda14('0x4c')][_0xda14('0x33')]);_0x5240cc[_0xda14('0x31')]=qs['offset'](_0x5d3953[_0xda14('0x4c')][_0xda14('0x31')]);}_0x5240cc[_0xda14('0x52')]=qs[_0xda14('0x53')](_0x5d3953[_0xda14('0x4c')][_0xda14('0x53')]);_0x5240cc[_0xda14('0x54')]=qs['filters'](_[_0xda14('0x55')](_0x5d3953[_0xda14('0x4c')],_0x4efb85['filters']));_0x5240cc[_0xda14('0x54')][_0xda14('0x6b')]=_0x5496f7['id'];if(_0x5d3953[_0xda14('0x4c')]['filter']){_0x5240cc[_0xda14('0x54')]=_[_0xda14('0x57')](_0x5240cc[_0xda14('0x54')],{'$or':_[_0xda14('0x43')](_0x5240cc[_0xda14('0x4d')],function(_0x4455af){var _0xa80d2a={};_0xa80d2a[_0x4455af]={'$like':'%'+_0x5d3953['query'][_0xda14('0x56')]+'%'};return _0xa80d2a;})});}_0x5240cc=_[_0xda14('0x57')]({},_0x5240cc,_0x5d3953['options']);return db[_0xda14('0x6e')][_0xda14('0x34')]({'where':_0x5240cc[_0xda14('0x54')]})[_0xda14('0x24')](function(_0x1093ba){_0x474c50[_0xda14('0x34')]=_0x1093ba;if(_0x5d3953['query']['includeAll']){_0x5240cc['include']=[{'all':!![]}];}return db[_0xda14('0x6e')][_0xda14('0x5c')](_0x5240cc);})[_0xda14('0x24')](function(_0x489783){_0x474c50[_0xda14('0x6f')]=_0x489783;return _0x474c50;});}})[_0xda14('0x24')](respondWithFilteredResult(_0x1736ac,_0x5240cc))[_0xda14('0x2c')](handleError(_0x1736ac,null));};exports[_0xda14('0x70')]=function(_0x136569,_0x826b73,_0x36a80e){return db['OpenchannelAccount'][_0xda14('0x60')]({'where':{'id':_0x136569['params']['id']}})['then'](handleEntityNotFound(_0x826b73,null))['then'](function(_0x3f4686){if(_0x3f4686){return _0x3f4686[_0xda14('0x70')](_0x136569[_0xda14('0x4c')][_0xda14('0x71')]);}})[_0xda14('0x24')](respondWithStatusCode(_0x826b73,null))[_0xda14('0x2c')](handleError(_0x826b73,null));};exports[_0xda14('0x72')]=function(_0x130161,_0x5da0f4,_0x37b36f){if(_0x130161['body']['id']){delete _0x130161[_0xda14('0x61')]['id'];}return db['OpenchannelAccount'][_0xda14('0x60')]({'where':{'id':_0x130161['params']['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x5da0f4,null))[_0xda14('0x24')](function(_0x2182e6){if(_0x2182e6){_0x130161[_0xda14('0x61')][_0xda14('0x6b')]=_0x2182e6['id'];return db[_0xda14('0x73')][_0xda14('0x68')](_0x130161[_0xda14('0x61')]);}})[_0xda14('0x24')](respondWithResult(_0x5da0f4,null))[_0xda14('0x2c')](handleError(_0x5da0f4,null));};exports[_0xda14('0x74')]=function(_0x12d9c3,_0x1bef8c,_0x5e8f92){var _0x10613c={'raw':![],'where':{}};var _0x446a2d={};var _0x5e4758={'count':0x0,'rows':[]};return db[_0xda14('0x5a')][_0xda14('0x6d')]({'where':{'id':_0x12d9c3[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x1bef8c,null))[_0xda14('0x24')](function(_0xc861c8){if(_0xc861c8){_0x446a2d[_0xda14('0x48')]=_[_0xda14('0x49')](db[_0xda14('0x73')]['rawAttributes']);_0x446a2d['query']=_[_0xda14('0x49')](_0x12d9c3[_0xda14('0x4c')]);_0x446a2d['filters']=_[_0xda14('0x4b')](_0x446a2d[_0xda14('0x48')],_0x446a2d[_0xda14('0x4c')]);_0x10613c[_0xda14('0x4d')]=_[_0xda14('0x4b')](_0x446a2d[_0xda14('0x48')],qs[_0xda14('0x4e')](_0x12d9c3[_0xda14('0x4c')][_0xda14('0x4e')]));_0x10613c[_0xda14('0x4d')]=_0x10613c['attributes']['length']?_0x10613c[_0xda14('0x4d')]:_0x446a2d[_0xda14('0x48')];if(!_0x12d9c3[_0xda14('0x4c')][_0xda14('0x50')]('nolimit')){_0x10613c[_0xda14('0x33')]=qs[_0xda14('0x33')](_0x12d9c3['query'][_0xda14('0x33')]);_0x10613c[_0xda14('0x31')]=qs['offset'](_0x12d9c3[_0xda14('0x4c')][_0xda14('0x31')]);}_0x10613c[_0xda14('0x52')]=qs[_0xda14('0x53')](_0x12d9c3[_0xda14('0x4c')]['sort']);_0x10613c['where']=qs['filters'](_['pick'](_0x12d9c3[_0xda14('0x4c')],_0x446a2d['filters']));_0x10613c['where'][_0xda14('0x6b')]=_0xc861c8['id'];if(_0x12d9c3[_0xda14('0x4c')][_0xda14('0x56')]){_0x10613c[_0xda14('0x54')]=_['merge'](_0x10613c[_0xda14('0x54')],{'$or':_['map'](_0x10613c[_0xda14('0x4d')],function(_0x144820){var _0x3b5dd4={};_0x3b5dd4[_0x144820]={'$like':'%'+_0x12d9c3['query'][_0xda14('0x56')]+'%'};return _0x3b5dd4;})});}_0x10613c=_[_0xda14('0x57')]({},_0x10613c,_0x12d9c3[_0xda14('0x59')]);return db[_0xda14('0x73')][_0xda14('0x34')]({'where':_0x10613c[_0xda14('0x54')]})['then'](function(_0x44dcf5){_0x5e4758[_0xda14('0x34')]=_0x44dcf5;if(_0x12d9c3[_0xda14('0x4c')]['includeAll']){_0x10613c['include']=[{'all':!![]}];}return db[_0xda14('0x73')][_0xda14('0x5c')](_0x10613c);})[_0xda14('0x24')](function(_0x2b131a){_0x5e4758[_0xda14('0x6f')]=_0x2b131a;return _0x5e4758;});}})[_0xda14('0x24')](respondWithFilteredResult(_0x1bef8c,_0x10613c))['catch'](handleError(_0x1bef8c,null));};exports[_0xda14('0x75')]=function(_0x5da2fd,_0x15c50a,_0x1cff60){return db[_0xda14('0x5a')]['find']({'where':{'id':_0x5da2fd['params']['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x15c50a,null))[_0xda14('0x24')](function(_0x394566){if(_0x394566){return _0x394566[_0xda14('0x75')](_0x5da2fd['query']['ids']);}})[_0xda14('0x24')](respondWithStatusCode(_0x15c50a,null))[_0xda14('0x2c')](handleError(_0x15c50a,null));};exports['notify']=function(_0x34e93b,_0x1865bf,_0x3cd44f){var _0x35d974={'body':_0x34e93b[_0xda14('0x61')],'channel':'openchannel'};var _0x3f1874=[];var _0x29706f=[];var _0x56b6f0={};var _0x117046=![];return db['CmContact'][_0xda14('0x6a')]()['then'](function(_0x15c434){if(!_0x15c434){throw new db[(_0xda14('0x76'))][(_0xda14('0x77'))](_0xda14('0x78'));}_0x3f1874=_[_0xda14('0x79')](_[_0xda14('0x49')](_0x15c434),[_0xda14('0x7a'),'updatedAt']);_0x29706f=_['difference'](_['keys'](_0x15c434),[_0xda14('0x7a'),_0xda14('0x7b'),_0xda14('0x7c'),'ListId']);if(_0x34e93b['body']['id']){delete _0x34e93b[_0xda14('0x61')]['id'];}if(_['isNil'](_0x34e93b[_0xda14('0x61')]['from'])){throw new db[(_0xda14('0x76'))][(_0xda14('0x77'))](_0xda14('0x7d'));}if(_[_0xda14('0x7e')](_0x34e93b[_0xda14('0x61')][_0xda14('0x61')])||_0x34e93b[_0xda14('0x61')][_0xda14('0x61')]===''){throw new db[(_0xda14('0x76'))][(_0xda14('0x77'))](_0xda14('0x7f'));}if(_[_0xda14('0x7e')](_0x34e93b[_0xda14('0x61')][_0xda14('0x80')])){throw new db[(_0xda14('0x76'))][(_0xda14('0x77'))](_0xda14('0x81')+_0x29706f);}if(!_[_0xda14('0x82')](_0x29706f,_0x34e93b[_0xda14('0x61')][_0xda14('0x80')])){throw new db[(_0xda14('0x76'))]['ValidationError'](_0xda14('0x83')+_0x29706f);}_0x56b6f0[_0x34e93b[_0xda14('0x61')][_0xda14('0x80')]]=_0x34e93b['body'][_0xda14('0x84')];})[_0xda14('0x24')](function(){return db[_0xda14('0x5a')][_0xda14('0x60')]({'where':{'id':_0x34e93b[_0xda14('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0xda14('0x85'),'include':[{'model':db[_0xda14('0x86')],'as':'Contacts','where':_0x56b6f0,'limit':0x1,'order':[[_0xda14('0x7b'),_0xda14('0x87')]]}]},{'model':db['OpenchannelApplication'],'as':_0xda14('0x88')}]});})['then'](handleEntityNotFound(_0x1865bf,null))[_0xda14('0x24')](function(_0x4ebc4e){if(_0x4ebc4e&&_0x4ebc4e['List']){_0x35d974[_0xda14('0x89')]=_0x4ebc4e;_0x35d974[_0xda14('0x8a')]=_0x4ebc4e[_0xda14('0x88')];_0x35d974[_0xda14('0x8b')]=_0x4ebc4e['List'];_0x35d974[_0xda14('0x8a')]=_[_0xda14('0x8c')](_0x35d974[_0xda14('0x8a')],[_0xda14('0x8d')],[_0xda14('0x8e')]);if(_0x35d974[_0xda14('0x89')][_0xda14('0x88')]){delete _0x35d974[_0xda14('0x89')][_0xda14('0x88')];}if(_0x35d974[_0xda14('0x89')]['List']&&_0x35d974[_0xda14('0x89')][_0xda14('0x85')][_0xda14('0x8f')]['length']){return _0x35d974[_0xda14('0x89')][_0xda14('0x85')]['Contacts'][0x0];}var _0xec306=_[_0xda14('0x1b')](_0x34e93b['body'],{'firstName':_0x34e93b[_0xda14('0x61')][_0xda14('0x84')],'ListId':_0x4ebc4e[_0xda14('0x90')]});_0xec306[_0x34e93b['body'][_0xda14('0x80')]]=_0x34e93b[_0xda14('0x61')]['from'];return db['CmContact']['create'](_0xec306,{'fields':_0x3f1874,'raw':!![]});}})['then'](handleEntityNotFound(_0x1865bf,null))[_0xda14('0x24')](function(_0x285956){_0x35d974[_0xda14('0x91')]=_0x285956;if(_0x285956){var _0x4d5876={'ContactId':_0x285956['id'],'OpenchannelAccountId':_0x34e93b[_0xda14('0x5e')]['id'],'from':(_0x285956[_0xda14('0x92')]||'')+'\x20'+(_0x285956[_0xda14('0x93')]||'')};var _0x2a140b={'OpenchannelAccountId':_0x34e93b[_0xda14('0x5e')]['id'],'closed':![]};if(_0x34e93b[_0xda14('0x61')][_0xda14('0x94')]){_0x2a140b[_0xda14('0x94')]=_0x34e93b[_0xda14('0x61')][_0xda14('0x94')];return db[_0xda14('0x95')][_0xda14('0x60')]({'where':_0x2a140b})[_0xda14('0x24')](function(_0x2e44b7){if(_0x2e44b7){return[_0x2e44b7,![]];}_0x4d5876['threadId']=_0x34e93b[_0xda14('0x61')][_0xda14('0x94')];_0x4d5876[_0xda14('0x96')]=_0x34e93b[_0xda14('0x61')][_0xda14('0x96')];return db['OpenchannelInteraction'][_0xda14('0x68')](_0x4d5876)['then'](function(_0x21e934){return[_0x21e934,!![]];});});}else{_0x2a140b[_0xda14('0x94')]=null;}_0x2a140b[_0xda14('0x97')]=_0x285956['id'];return db[_0xda14('0x95')][_0xda14('0x60')]({'where':_0x2a140b})[_0xda14('0x24')](function(_0xfe6e76){if(_0xfe6e76){return[_0xfe6e76,![]];}return db[_0xda14('0x95')][_0xda14('0x68')](_0x4d5876)['then'](function(_0x28b2ec){return[_0x28b2ec,!![]];});});}})[_0xda14('0x98')](function(_0x382f4a,_0x217c31){if(_0x382f4a){_0x117046=_0x217c31;if(!_0x217c31){var _0x245d9f={'from':(_0x35d974[_0xda14('0x91')][_0xda14('0x92')]||'')+'\x20'+(_0x35d974[_0xda14('0x91')][_0xda14('0x93')]||'')};if(_0x34e93b[_0xda14('0x61')][_0xda14('0x94')]&&_0x34e93b['body'][_0xda14('0x99')]&&_0x34e93b[_0xda14('0x61')][_0xda14('0x94')]!=_0x34e93b[_0xda14('0x61')][_0xda14('0x99')]){_0x245d9f[_0xda14('0x94')]=_0x34e93b[_0xda14('0x61')][_0xda14('0x99')];}return _0x382f4a[_0xda14('0x3a')](_0x245d9f);}else{return _0x382f4a;}}})[_0xda14('0x24')](function(_0x3b38c8){_0x35d974[_0xda14('0x9a')]=_0x3b38c8[_0xda14('0x3c')]({'plain':!![]});_0x35d974[_0xda14('0x9a')][_0xda14('0x9b')]=_0x117046;if(_0x35d974['interaction'][_0xda14('0x9b')]){if(_0x35d974[_0xda14('0x89')][_0xda14('0x9c')]){_0x35d974['applications'][_0xda14('0x9d')]({'id':0x0,'priority':_0x35d974[_0xda14('0x8a')][_0xda14('0x4f')]+0x1,'app':_0xda14('0x9e'),'appdata':_0xda14('0x9f'),'interval':_0xda14('0xa0')});}}return db['OpenchannelMessage'][_0xda14('0x68')]({'body':_0x34e93b[_0xda14('0x61')]['body'],'OpenchannelAccountId':_0x34e93b['params']['id'],'OpenchannelInteractionId':_0x3b38c8['id'],'direction':'in','ContactId':_0x35d974[_0xda14('0x91')]['id'],'AttachmentId':_0x34e93b[_0xda14('0x61')][_0xda14('0xa1')]});})[_0xda14('0x24')](function(_0x3df608){_0x35d974[_0xda14('0x2b')]=_0x3df608;if(_0x35d974[_0xda14('0x9a')][_0xda14('0xa2')]){return db['User']['find']({'attributes':['id',_0xda14('0x3e')],'where':{'id':_0x35d974[_0xda14('0x9a')][_0xda14('0xa2')]}})[_0xda14('0x24')](function(_0x1b195e){if(_0x1b195e){_0x35d974[_0xda14('0x8a')][_0xda14('0xa3')]({'id':0x0,'priority':0x0,'app':_0xda14('0xa4'),'appdata':_0x1b195e[_0xda14('0x3e')]+','+(_0x35d974[_0xda14('0x89')][_0xda14('0xa5')]||0xa),'interval':_0xda14('0xa0')});_0x35d974[_0xda14('0xa6')]=![];}return respondWithRpcPromise(_0xda14('0xa7'),_0xda14('0xa8'),_0x35d974);});}return respondWithRpcPromise(_0xda14('0xa7'),'startRouting',_0x35d974);})[_0xda14('0x24')](function(_0x1ea1c0){respondWithRpcPromise(_0xda14('0xa9'),_0xda14('0xa9'),{'event':'notify','message':_0x1ea1c0},client9002);return _0x1ea1c0;})[_0xda14('0x24')](respondWithResult(_0x1865bf,null))[_0xda14('0x2c')](handleError(_0x1865bf,null));};exports[_0xda14('0xaa')]=function(_0x51fbbd,_0xa8b263){var _0x12c4d1=_0x51fbbd['params']['id'];var _0x28f2a7=_0x51fbbd[_0xda14('0x61')];var _0x143579=0xc8;var _0x3347c2=null;return db[_0xda14('0xab')][_0xda14('0xac')]({'isolationLevel':db[_0xda14('0xab')][_0xda14('0xad')][_0xda14('0xae')]['READ_COMMITTED']},function(_0x13c716){return db['OpenchannelAccount'][_0xda14('0x6d')]({'where':{'id':_0x12c4d1},'transaction':_0x13c716})[_0xda14('0x24')](function(_0x3adbcc){if(_0x3adbcc){return db[_0xda14('0xaf')][_0xda14('0x3b')]({'where':{'OpenchannelAccountId':_0x12c4d1},'transaction':_0x13c716})[_0xda14('0x24')](function(){var _0x41b375=_['map'](_0x28f2a7,function(_0x54ebff){_0x54ebff[_0xda14('0x6b')]=_0x12c4d1;return _0x54ebff;});return db[_0xda14('0xaf')][_0xda14('0xb0')](_0x41b375,{'transaction':_0x13c716});});}else{_0x143579=0x194;_0x3347c2=[];}});})['then'](function(){if(_0x143579!==0x194){return db[_0xda14('0xaf')][_0xda14('0xb1')]({'where':{'OpenchannelAccountId':_0x12c4d1},'order':_0xda14('0x8d')})[_0xda14('0x24')](function(_0x4f123a){_0x3347c2=_0x4f123a;});}})['catch'](function(_0xa7bb03){_0x143579=0x1f4;logger[_0xda14('0x2a')](_0xa7bb03['stack']);if(_0xa7bb03[_0xda14('0x3e')]){delete _0xa7bb03['name'];}_0x3347c2=_0xa7bb03;})[_0xda14('0xb2')](function(){if(_0x3347c2===null){_0xa8b263['sendStatus'](_0x143579);}else{if(_0x143579===0x1f4){_0xa8b263[_0xda14('0x2e')](_0x143579)['send'](_0x3347c2);}else{_0xa8b263['status'](_0x143579)[_0xda14('0x30')](_0x3347c2);}}});};exports[_0xda14('0xb3')]=function(_0x364bf7,_0x1f898a,_0x3b06a4){var _0x5f0fbe={};var _0x4f2262={};var _0x436fa5;var _0x100146;return db[_0xda14('0x5a')][_0xda14('0x6d')]({'where':{'id':_0x364bf7['params']['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x1f898a,null))[_0xda14('0x24')](function(_0x14eac0){if(_0x14eac0){_0x436fa5=_0x14eac0;_0x4f2262[_0xda14('0x48')]=_['keys'](db[_0xda14('0xaf')][_0xda14('0x44')]);_0x4f2262[_0xda14('0x4c')]=_['keys'](_0x364bf7[_0xda14('0x4c')]);_0x4f2262['filters']=_[_0xda14('0x4b')](_0x4f2262[_0xda14('0x48')],_0x4f2262[_0xda14('0x4c')]);_0x5f0fbe[_0xda14('0x4d')]=_['intersection'](_0x4f2262['model'],qs[_0xda14('0x4e')](_0x364bf7[_0xda14('0x4c')]['fields']));_0x5f0fbe['attributes']=_0x5f0fbe[_0xda14('0x4d')][_0xda14('0x4f')]?_0x5f0fbe[_0xda14('0x4d')]:_0x4f2262[_0xda14('0x48')];_0x5f0fbe[_0xda14('0x52')]=qs[_0xda14('0x53')](_0x364bf7[_0xda14('0x4c')][_0xda14('0x53')]);_0x5f0fbe['where']=qs[_0xda14('0x4a')](_[_0xda14('0x55')](_0x364bf7['query'],_0x4f2262[_0xda14('0x4a')]));if(_0x364bf7[_0xda14('0x4c')][_0xda14('0x56')]){_0x5f0fbe[_0xda14('0x54')]=_[_0xda14('0x57')](_0x5f0fbe[_0xda14('0x54')],{'$or':_[_0xda14('0x43')](_0x5f0fbe[_0xda14('0x4d')],function(_0x32e5e4){var _0x5ee0fd={};_0x5ee0fd[_0x32e5e4]={'$like':'%'+_0x364bf7[_0xda14('0x4c')]['filter']+'%'};return _0x5ee0fd;})});}_0x5f0fbe=_[_0xda14('0x57')]({},_0x5f0fbe,_0x364bf7[_0xda14('0x59')]);return _0x436fa5[_0xda14('0xb3')](_0x5f0fbe);}})['then'](function(_0x31e8c4){if(_0x31e8c4){_0x100146=_0x31e8c4[_0xda14('0x4f')];if(!_0x364bf7[_0xda14('0x4c')][_0xda14('0x50')](_0xda14('0x51'))){_0x5f0fbe[_0xda14('0x33')]=qs[_0xda14('0x33')](_0x364bf7[_0xda14('0x4c')][_0xda14('0x33')]);_0x5f0fbe[_0xda14('0x31')]=qs[_0xda14('0x31')](_0x364bf7[_0xda14('0x4c')][_0xda14('0x31')]);}return _0x436fa5[_0xda14('0xb3')](_0x5f0fbe);}})[_0xda14('0x24')](function(_0x2288d2){if(_0x2288d2){return _0x2288d2?{'count':_0x100146,'rows':_0x2288d2}:null;}})[_0xda14('0x24')](respondWithResult(_0x1f898a,null))[_0xda14('0x2c')](handleError(_0x1f898a,null));};exports[_0xda14('0xb4')]=function(_0x51e16a,_0x4c1f4e,_0x5eeff4){var _0x18b400={'raw':![],'where':{}};var _0x74ac17={};var _0x22dcea={'count':0x0,'rows':[]};return db[_0xda14('0x5a')][_0xda14('0x6d')]({'where':{'id':_0x51e16a[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x4c1f4e,null))[_0xda14('0x24')](function(_0x410497){if(_0x410497){_0x74ac17[_0xda14('0x48')]=_[_0xda14('0x49')](db[_0xda14('0x95')][_0xda14('0x44')]);_0x74ac17[_0xda14('0x4c')]=_['keys'](_0x51e16a[_0xda14('0x4c')]);_0x74ac17[_0xda14('0x4a')]=_[_0xda14('0x4b')](_0x74ac17[_0xda14('0x48')],_0x74ac17[_0xda14('0x4c')]);_0x18b400[_0xda14('0x4d')]=_[_0xda14('0x4b')](_0x74ac17[_0xda14('0x48')],qs[_0xda14('0x4e')](_0x51e16a[_0xda14('0x4c')][_0xda14('0x4e')]));_0x18b400[_0xda14('0x4d')]=_0x18b400[_0xda14('0x4d')][_0xda14('0x4f')]?_0x18b400['attributes']:_0x74ac17[_0xda14('0x48')];if(!_0x51e16a[_0xda14('0x4c')]['hasOwnProperty'](_0xda14('0x51'))){_0x18b400[_0xda14('0x33')]=qs['limit'](_0x51e16a['query'][_0xda14('0x33')]);_0x18b400[_0xda14('0x31')]=qs[_0xda14('0x31')](_0x51e16a['query'][_0xda14('0x31')]);}_0x18b400['order']=qs[_0xda14('0x53')](_0x51e16a['query'][_0xda14('0x53')]);_0x18b400[_0xda14('0x54')]=qs['filters'](_[_0xda14('0x55')](_0x51e16a[_0xda14('0x4c')],_0x74ac17[_0xda14('0x4a')]));_0x18b400[_0xda14('0x54')][_0xda14('0x6b')]=_0x410497['id'];if(_0x51e16a[_0xda14('0x4c')]['filter']){_0x18b400[_0xda14('0x54')]=_['merge'](_0x18b400[_0xda14('0x54')],{'$or':_['map'](_0x18b400['attributes'],function(_0x293e55){var _0x206291={};_0x206291[_0x293e55]={'$like':'%'+_0x51e16a[_0xda14('0x4c')][_0xda14('0x56')]+'%'};return _0x206291;})});}_0x18b400=_[_0xda14('0x57')]({},_0x18b400,_0x51e16a[_0xda14('0x59')]);return db[_0xda14('0x95')][_0xda14('0x34')]({'where':_0x18b400[_0xda14('0x54')]})['then'](function(_0x4ab9c3){_0x22dcea[_0xda14('0x34')]=_0x4ab9c3;if(_0x51e16a[_0xda14('0x4c')]['includeAll']){_0x18b400[_0xda14('0x5b')]=[{'model':db[_0xda14('0x86')],'as':'Contact','required':![]},{'model':db[_0xda14('0xb5')],'as':'Owner','attributes':[_0xda14('0x3e'),'fullname',_0xda14('0xb6')],'required':![]},{'model':db[_0xda14('0xb7')],'as':_0xda14('0xb8'),'attributes':['id',_0xda14('0x3e'),'color'],'where':_0x51e16a[_0xda14('0x4c')][_0xda14('0xb9')]?{'id':_0x51e16a['query'][_0xda14('0xb9')]}:undefined,'required':_0x51e16a[_0xda14('0x4c')]['tag']?!![]:![]}];}return db[_0xda14('0x95')][_0xda14('0x5c')](_0x18b400);})[_0xda14('0x24')](function(_0x11f4e3){_0x22dcea[_0xda14('0x6f')]=_0x11f4e3;return _0x22dcea;});}})[_0xda14('0x24')](respondWithFilteredResult(_0x4c1f4e,_0x18b400))[_0xda14('0x2c')](handleError(_0x4c1f4e,null));};exports[_0xda14('0xba')]=function(_0x35d5ee,_0x2163b7,_0x55522e){return db[_0xda14('0x5a')][_0xda14('0x60')]({'where':{'id':_0x35d5ee[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x2163b7,null))[_0xda14('0x24')](function(_0x53c72d){if(_0x53c72d){return _0x53c72d[_0xda14('0xba')](_0x35d5ee[_0xda14('0x61')][_0xda14('0x71')],_[_0xda14('0xbb')](_0x35d5ee[_0xda14('0x61')],[_0xda14('0x71'),'id'])||{})[_0xda14('0x98')](function(_0x1de90f){for(var _0x52ba0e=0x0;_0x52ba0e<_0x35d5ee['body'][_0xda14('0x71')]['length'];_0x52ba0e+=0x1){socket[_0xda14('0xbc')](_0xda14('0xbd'),{'UserId':Number(_0x35d5ee['body'][_0xda14('0x71')][_0x52ba0e]),'OpenchannelAccountId':Number(_0x35d5ee['params']['id'])});}return _0x1de90f;});}})[_0xda14('0x24')](respondWithResult(_0x2163b7,null))[_0xda14('0x2c')](handleError(_0x2163b7,null));};exports[_0xda14('0xbe')]=function(_0x1a3a1a,_0x150453,_0x379b77){return db[_0xda14('0x5a')]['find']({'where':{'id':_0x1a3a1a[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x150453,null))[_0xda14('0x24')](function(_0x33c3e0){if(_0x33c3e0){return _0x33c3e0['removeAgents'](_0x1a3a1a[_0xda14('0x4c')][_0xda14('0x71')])['then'](function(){if(_['isArray'](_0x1a3a1a[_0xda14('0x4c')][_0xda14('0x71')])){for(var _0x4308db=0x0;_0x4308db<_0x1a3a1a['query'][_0xda14('0x71')][_0xda14('0x4f')];_0x4308db+=0x1){socket[_0xda14('0xbc')](_0xda14('0xbf'),{'UserId':Number(_0x1a3a1a[_0xda14('0x4c')][_0xda14('0x71')][_0x4308db]),'OpenchannelAccountId':Number(_0x1a3a1a['params']['id'])});}}else{socket[_0xda14('0xbc')](_0xda14('0xbf'),{'UserId':Number(_0x1a3a1a['query'][_0xda14('0x71')]),'OpenchannelAccountId':Number(_0x1a3a1a[_0xda14('0x5e')]['id'])});}});}})[_0xda14('0x24')](respondWithStatusCode(_0x150453,null))[_0xda14('0x2c')](handleError(_0x150453,null));};exports[_0xda14('0xc0')]=function(_0x244028,_0x243ba1,_0x1e6eff){var _0x1a7f2d={};var _0x1b9a59={};var _0x51e6c6;var _0x474062;return db[_0xda14('0x5a')][_0xda14('0x6d')]({'where':{'id':_0x244028[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x243ba1,null))['then'](function(_0x54e76e){if(_0x54e76e){_0x51e6c6=_0x54e76e;_0x1b9a59['model']=_[_0xda14('0x49')](db[_0xda14('0xb5')][_0xda14('0x44')]);_0x1b9a59['query']=_[_0xda14('0x49')](_0x244028[_0xda14('0x4c')]);_0x1b9a59[_0xda14('0x4a')]=_[_0xda14('0x4b')](_0x1b9a59[_0xda14('0x48')],_0x1b9a59[_0xda14('0x4c')]);_0x1a7f2d[_0xda14('0x4d')]=_[_0xda14('0x4b')](_0x1b9a59['model'],qs[_0xda14('0x4e')](_0x244028[_0xda14('0x4c')][_0xda14('0x4e')]));_0x1a7f2d[_0xda14('0x4d')]=_0x1a7f2d[_0xda14('0x4d')][_0xda14('0x4f')]?_0x1a7f2d[_0xda14('0x4d')]:_0x1b9a59[_0xda14('0x48')];_0x1a7f2d['order']=qs[_0xda14('0x53')](_0x244028[_0xda14('0x4c')][_0xda14('0x53')]);_0x1a7f2d[_0xda14('0x54')]=qs[_0xda14('0x4a')](_[_0xda14('0x55')](_0x244028[_0xda14('0x4c')],_0x1b9a59['filters']));if(_0x244028['query']['filter']){_0x1a7f2d[_0xda14('0x54')]=_[_0xda14('0x57')](_0x1a7f2d[_0xda14('0x54')],{'$or':_['map'](_0x1a7f2d[_0xda14('0x4d')],function(_0x22c365){var _0x502857={};_0x502857[_0x22c365]={'$like':'%'+_0x244028['query'][_0xda14('0x56')]+'%'};return _0x502857;})});}_0x1a7f2d=_[_0xda14('0x57')]({},_0x1a7f2d,_0x244028[_0xda14('0x59')]);return _0x51e6c6[_0xda14('0xc0')](_0x1a7f2d);}})['then'](function(_0x2543cd){if(_0x2543cd){_0x474062=_0x2543cd['length'];if(!_0x244028['query'][_0xda14('0x50')](_0xda14('0x51'))){_0x1a7f2d[_0xda14('0x33')]=qs[_0xda14('0x33')](_0x244028[_0xda14('0x4c')]['limit']);_0x1a7f2d[_0xda14('0x31')]=qs[_0xda14('0x31')](_0x244028['query'][_0xda14('0x31')]);}return _0x51e6c6[_0xda14('0xc0')](_0x1a7f2d);}})[_0xda14('0x24')](function(_0x4a1d16){if(_0x4a1d16){return _0x4a1d16?{'count':_0x474062,'rows':_0x4a1d16}:null;}})[_0xda14('0x24')](respondWithResult(_0x243ba1,null))[_0xda14('0x2c')](handleError(_0x243ba1,null));};exports[_0xda14('0x3f')]=function(_0x28d4d2,_0x4d5cf1,_0x1fbffb){var _0x2c0557,_0x21591b,_0x302731;if(_['isNil'](_0x28d4d2[_0xda14('0x61')][_0xda14('0x61')])||_0x28d4d2[_0xda14('0x61')][_0xda14('0x61')]===''){throw new db[(_0xda14('0x76'))][(_0xda14('0x77'))](_0xda14('0x7f'));}if(_[_0xda14('0x7e')](_0x28d4d2[_0xda14('0x61')]['to'])){}_0x2c0557=_0x28d4d2[_0xda14('0x61')]['to'];return db[_0xda14('0x5a')]['findOne']({'where':{'id':_0x28d4d2[_0xda14('0x5e')]['id']}})[_0xda14('0x24')](handleEntityNotFound(_0x4d5cf1,null))[_0xda14('0x24')](function(_0x3c67e3){if(_0x3c67e3){return db[_0xda14('0x5a')][_0xda14('0x60')]({'where':{'id':_0x3c67e3['id']},'include':[{'model':db[_0xda14('0xc1')],'as':_0xda14('0x85'),'include':[{'model':db[_0xda14('0x86')],'as':'Contacts','where':{[_0x3c67e3['mapKey']]:_0x2c0557},'limit':0x1,'order':[[_0xda14('0x7b'),_0xda14('0x87')]]}]}]})[_0xda14('0x24')](handleEntityNotFound(_0x4d5cf1,null))['then'](function(_0x52fdd7){if(_0x52fdd7&&_0x52fdd7[_0xda14('0x85')]){_0x21591b=_0x52fdd7[_0xda14('0x3c')]({'plain':!![]});if(_0x21591b['List']&&_0x21591b[_0xda14('0x85')]['Contacts']['length']){return _0x21591b['List']['Contacts'][0x0];}return db['CmContact'][_0xda14('0x68')](_[_0xda14('0x1b')](_0x28d4d2[_0xda14('0x61')],{'firstName':_0x2c0557,[_0x52fdd7['mapKey']]:_0x2c0557,'phone':_0x2c0557,'ListId':_0x21591b[_0xda14('0x90')]}));}})[_0xda14('0x24')](handleEntityNotFound(_0x4d5cf1,null))[_0xda14('0x24')](function(_0x1abdac){if(_0x1abdac){_0x302731=_0x1abdac;return db['OpenchannelInteraction'][_0xda14('0x60')]({'where':{'ContactId':_0x302731['id'],'closed':![],'OpenchannelAccountId':_0x21591b['id']}})[_0xda14('0x24')](function(_0x1529b6){if(_0x1529b6){return[_0x1529b6,![]];}return db[_0xda14('0x95')][_0xda14('0x68')]({'UserId':_0x28d4d2[_0xda14('0x64')]['id'],'ContactId':_0x302731['id'],'OpenchannelAccountId':_0x21591b['id'],'lastMsgDirection':_0xda14('0xc2'),'Messages':[_[_0xda14('0x57')](_0x28d4d2[_0xda14('0x61')],{'read':![],'body':_0x28d4d2[_0xda14('0x61')][_0xda14('0x61')],'OpenchannelAccountId':_0x21591b['id'],'UserId':_0x28d4d2['user']['id'],'ContactId':_0x302731['id']})]},{'include':[{'model':db[_0xda14('0xc3')],'as':_0xda14('0xc4')}]})[_0xda14('0x24')](function(_0xbe6099){return[_0xbe6099,!![]];});});}})['spread'](function(_0x36a132,_0x5d5986){if(_0x5d5986){return _0x36a132;}return db[_0xda14('0xc3')][_0xda14('0x68')](_[_0xda14('0x57')](_0x28d4d2[_0xda14('0x61')],{'read':![],'body':_0x28d4d2[_0xda14('0x61')][_0xda14('0x61')],'OpenchannelAccountId':_0x21591b['id'],'OpenchannelInteractionId':_0x36a132['id'],'UserId':_0x28d4d2['user']['id'],'ContactId':_0x302731['id']}))[_0xda14('0x24')](function(_0x167936){_0x36a132[_0xda14('0xc5')][_0xda14('0xc4')]=[];_0x36a132['dataValues'][_0xda14('0xc4')][_0xda14('0x9d')](_0x167936[_0xda14('0xc5')]);return _0x36a132;});});}})[_0xda14('0x24')](respondWithResult(_0x4d5cf1,null))[_0xda14('0x2c')](handleError(_0x4d5cf1,null));};
\ No newline at end of file
+var _0x092e=['sort','where','pick','filter','merge','VIRTUAL','options','include','OpenchannelAccount','findAll','rows','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','includeAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','applications','list','orderBy','priority','account','defaults','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','contact','messageId','interaction','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','OpenchannelAccounts','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x330254,_0x5223c1){var _0x1a9e49=function(_0x51a25e){while(--_0x51a25e){_0x330254['push'](_0x330254['shift']());}};_0x1a9e49(++_0x5223c1);}(_0x092e,0x6e));var _0xe092=function(_0x4ebc3f,_0x2fab23){_0x4ebc3f=_0x4ebc3f-0x0;var _0x309762=_0x092e[_0x4ebc3f];return _0x309762;};'use strict';var emlformat=require(_0xe092('0x0'));var rimraf=require(_0xe092('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe092('0x2'));var rp=require(_0xe092('0x3'));var moment=require(_0xe092('0x4'));var BPromise=require(_0xe092('0x5'));var Mustache=require(_0xe092('0x6'));var util=require('util');var path=require(_0xe092('0x7'));var sox=require(_0xe092('0x8'));var csv=require(_0xe092('0x9'));var ejs=require(_0xe092('0xa'));var fs=require('fs');var fs_extra=require(_0xe092('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe092('0xc'));var deskjs=require(_0xe092('0xd'));var toCsv=require(_0xe092('0x9'));var querystring=require(_0xe092('0xe'));var Papa=require(_0xe092('0xf'));var Redis=require('ioredis');var authService=require(_0xe092('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe092('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe092('0x12'))('api');var utils=require(_0xe092('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe092('0x14'));var db=require('../../mysqldb')['db'];config[_0xe092('0x15')]=_['defaults'](config[_0xe092('0x15')],{'host':_0xe092('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe092('0x17'))[_0xe092('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe092('0x19')][_0xe092('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xe092('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x229bd3,_0x520b83,_0x14198d,_0x53d7b7){return new BPromise(function(_0x4779f3,_0x3512e1){var _0x149325=_0x53d7b7||client;return _0x149325[_0xe092('0x1b')](_0x229bd3,_0x14198d)[_0xe092('0x1c')](function(_0xc28cff){logger[_0xe092('0x1d')](_0xe092('0x1e'),_0x520b83,'request\x20sent');logger[_0xe092('0x1f')](_0xe092('0x20'),_0x520b83,'request\x20sent',JSON[_0xe092('0x21')](_0xc28cff));if(_0xc28cff[_0xe092('0x22')]){if(_0xc28cff[_0xe092('0x22')][_0xe092('0x23')]===0x1f4){logger[_0xe092('0x22')](_0xe092('0x1e'),_0x520b83,_0xc28cff[_0xe092('0x22')][_0xe092('0x24')]);return _0x3512e1(_0xc28cff[_0xe092('0x22')][_0xe092('0x24')]);}logger[_0xe092('0x22')](_0xe092('0x1e'),_0x520b83,_0xc28cff[_0xe092('0x22')][_0xe092('0x24')]);return _0x4779f3(_0xc28cff[_0xe092('0x22')][_0xe092('0x24')]);}else{logger[_0xe092('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x520b83,'request\x20sent');_0x4779f3(_0xc28cff[_0xe092('0x25')][_0xe092('0x24')]);}})[_0xe092('0x26')](function(_0x2ab386){logger[_0xe092('0x22')](_0xe092('0x1e'),_0x520b83,_0x2ab386);_0x3512e1(_0x2ab386);});});}function respondWithStatusCode(_0x5efc10,_0x26ee61){_0x26ee61=_0x26ee61||0xcc;return function(_0x13dc91){if(_0x13dc91){return _0x5efc10[_0xe092('0x27')](_0x26ee61);}return _0x5efc10[_0xe092('0x28')](_0x26ee61)['end']();};}function respondWithResult(_0x291459,_0x141ae1){_0x141ae1=_0x141ae1||0xc8;return function(_0x3c0598){if(_0x3c0598){return _0x291459[_0xe092('0x28')](_0x141ae1)[_0xe092('0x29')](_0x3c0598);}};}function respondWithFilteredResult(_0x4a7972,_0x3df37a){return function(_0x230892){if(_0x230892){var _0x655e72=typeof _0x3df37a[_0xe092('0x2a')]===_0xe092('0x2b')&&typeof _0x3df37a[_0xe092('0x2c')]==='undefined';var _0x507173=_0x230892[_0xe092('0x2d')];var _0x4e09a8=_0x655e72?0x0:_0x3df37a[_0xe092('0x2a')];var _0x1bab63=_0x655e72?_0x230892[_0xe092('0x2d')]:_0x3df37a[_0xe092('0x2a')]+_0x3df37a[_0xe092('0x2c')];var _0x143458;if(_0x1bab63>=_0x507173){_0x1bab63=_0x507173;_0x143458=0xc8;}else{_0x143458=0xce;}_0x4a7972[_0xe092('0x28')](_0x143458);return _0x4a7972['set'](_0xe092('0x2e'),_0x4e09a8+'-'+_0x1bab63+'/'+_0x507173)[_0xe092('0x29')](_0x230892);}return null;};}function patchUpdates(_0x4dcf4b){return function(_0x26cb1a){try{jsonpatch[_0xe092('0x2f')](_0x26cb1a,_0x4dcf4b,!![]);}catch(_0x1d75e2){return BPromise[_0xe092('0x30')](_0x1d75e2);}return _0x26cb1a[_0xe092('0x31')]();};}function saveUpdates(_0x39d6f2,_0xc37a82){return function(_0x2ad593){if(_0x2ad593){return _0x2ad593[_0xe092('0x32')](_0x39d6f2)[_0xe092('0x1c')](function(_0x5a0002){return _0x5a0002;});}return null;};}function removeEntity(_0x3f0102,_0x3da799){return function(_0x397791){if(_0x397791){return _0x397791['destroy']()['then'](function(){var _0x32c628=_0x397791[_0xe092('0x33')]({'plain':!![]});var _0xd1dda2=_0xe092('0x34');return db['UserProfileResource'][_0xe092('0x35')]({'where':{'type':_0xd1dda2,'resourceId':_0x32c628['id']}})[_0xe092('0x1c')](function(){return _0x397791;});})[_0xe092('0x1c')](function(){_0x3f0102[_0xe092('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270cb5,_0xaccd1d){return function(_0x20833b){if(!_0x20833b){_0x270cb5[_0xe092('0x27')](0x194);}return _0x20833b;};}function handleError(_0x14562f,_0x215340){_0x215340=_0x215340||0x1f4;return function(_0x38d6c9){logger[_0xe092('0x22')](_0x38d6c9[_0xe092('0x36')]);if(_0x38d6c9[_0xe092('0x37')]){delete _0x38d6c9[_0xe092('0x37')];}_0x14562f[_0xe092('0x28')](_0x215340)[_0xe092('0x38')](_0x38d6c9);};}exports[_0xe092('0x39')]=function(_0xa39c1,_0x4ebc84){var _0x54335d={'include':[{'model':db[_0xe092('0x3a')],'as':_0xe092('0x3b')}]},_0x1835d1={},_0x461b23={'count':0x0,'rows':[]};var _0x5d62a2=_['map'](db['OpenchannelAccount'][_0xe092('0x3c')],function(_0x2e1b1c){return{'name':_0x2e1b1c[_0xe092('0x3d')],'type':_0x2e1b1c[_0xe092('0x3e')][_0xe092('0x3f')]};});_0x1835d1[_0xe092('0x40')]=_[_0xe092('0x41')](_0x5d62a2,'name');_0x1835d1[_0xe092('0x42')]=_['keys'](_0xa39c1['query']);_0x1835d1[_0xe092('0x43')]=_[_0xe092('0x44')](_0x1835d1['model'],_0x1835d1[_0xe092('0x42')]);_0x54335d[_0xe092('0x45')]=_[_0xe092('0x44')](_0x1835d1[_0xe092('0x40')],qs[_0xe092('0x46')](_0xa39c1[_0xe092('0x42')][_0xe092('0x46')]));_0x54335d[_0xe092('0x45')]=_0x54335d[_0xe092('0x45')][_0xe092('0x47')]?_0x54335d[_0xe092('0x45')]:_0x1835d1[_0xe092('0x40')];if(!_0xa39c1[_0xe092('0x42')][_0xe092('0x48')](_0xe092('0x49'))){_0x54335d[_0xe092('0x2c')]=qs['limit'](_0xa39c1['query'][_0xe092('0x2c')]);_0x54335d[_0xe092('0x2a')]=qs[_0xe092('0x2a')](_0xa39c1[_0xe092('0x42')][_0xe092('0x2a')]);}_0x54335d[_0xe092('0x4a')]=qs[_0xe092('0x4b')](_0xa39c1[_0xe092('0x42')][_0xe092('0x4b')]);_0x54335d[_0xe092('0x4c')]=qs[_0xe092('0x43')](_[_0xe092('0x4d')](_0xa39c1[_0xe092('0x42')],_0x1835d1[_0xe092('0x43')]),_0x5d62a2);if(_0xa39c1[_0xe092('0x42')][_0xe092('0x4e')]){_0x54335d[_0xe092('0x4c')]=_[_0xe092('0x4f')](_0x54335d[_0xe092('0x4c')],{'$or':_[_0xe092('0x41')](_0x5d62a2,function(_0x8660cb){if(_0x8660cb[_0xe092('0x3e')]!==_0xe092('0x50')){var _0x26570e={};_0x26570e[_0x8660cb[_0xe092('0x37')]]={'$like':'%'+_0xa39c1[_0xe092('0x42')][_0xe092('0x4e')]+'%'};return _0x26570e;}})});}_0x54335d=_[_0xe092('0x4f')]({},_0x54335d,_0xa39c1[_0xe092('0x51')]);var _0x2ea676={'where':_0x54335d[_0xe092('0x4c')]};return db['OpenchannelAccount'][_0xe092('0x2d')](_0x2ea676)[_0xe092('0x1c')](function(_0x2a9b55){_0x461b23['count']=_0x2a9b55;if(_0xa39c1[_0xe092('0x42')]['includeAll']){_0x54335d[_0xe092('0x52')]=[{'all':!![]}];}return db[_0xe092('0x53')][_0xe092('0x54')](_0x54335d);})['then'](function(_0x490b83){_0x461b23[_0xe092('0x55')]=_0x490b83;return _0x461b23;})[_0xe092('0x1c')](respondWithFilteredResult(_0x4ebc84,_0x54335d))['catch'](handleError(_0x4ebc84,null));};exports['show']=function(_0xb58ecb,_0x3aba27){var _0x158ca6={'raw':![],'where':{'id':_0xb58ecb[_0xe092('0x56')]['id']},'include':[{'model':db[_0xe092('0x3a')],'as':'mandatoryDispositionPause'}]},_0x55902e={};_0x55902e[_0xe092('0x40')]=_[_0xe092('0x57')](db[_0xe092('0x53')][_0xe092('0x3c')]);_0x55902e[_0xe092('0x42')]=_[_0xe092('0x57')](_0xb58ecb['query']);_0x55902e[_0xe092('0x43')]=_['intersection'](_0x55902e[_0xe092('0x40')],_0x55902e[_0xe092('0x42')]);_0x158ca6['attributes']=_['intersection'](_0x55902e['model'],qs[_0xe092('0x46')](_0xb58ecb[_0xe092('0x42')][_0xe092('0x46')]));_0x158ca6[_0xe092('0x45')]=_0x158ca6['attributes'][_0xe092('0x47')]?_0x158ca6[_0xe092('0x45')]:_0x55902e[_0xe092('0x40')];if(_0xb58ecb[_0xe092('0x42')]['includeAll']){_0x158ca6[_0xe092('0x52')]=[{'all':!![]}];}_0x158ca6=_[_0xe092('0x4f')]({},_0x158ca6,_0xb58ecb[_0xe092('0x51')]);return db[_0xe092('0x53')][_0xe092('0x58')](_0x158ca6)[_0xe092('0x1c')](handleEntityNotFound(_0x3aba27,null))[_0xe092('0x1c')](respondWithResult(_0x3aba27,null))['catch'](handleError(_0x3aba27,null));};exports['create']=function(_0x2b2984,_0x34faa4){return db[_0xe092('0x53')][_0xe092('0x59')](_0x2b2984[_0xe092('0x5a')],{})[_0xe092('0x1c')](function(_0x5b748d){var _0x17307b=_0x2b2984[_0xe092('0x5b')][_0xe092('0x33')]({'plain':!![]});if(!_0x17307b)throw new Error(_0xe092('0x5c'));if(_0x17307b['role']===_0xe092('0x5b')){var _0xb6a2d9=_0x5b748d[_0xe092('0x33')]({'plain':!![]});var _0x1b8552='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x1b8552,'userProfileId':_0x17307b['userProfileId']},'raw':!![]})[_0xe092('0x1c')](function(_0x426744){if(_0x426744&&_0x426744[_0xe092('0x5d')]===0x0){return db[_0xe092('0x5e')]['create']({'name':_0xb6a2d9['name'],'resourceId':_0xb6a2d9['id'],'type':_0x426744[_0xe092('0x37')],'sectionId':_0x426744['id']},{})[_0xe092('0x1c')](function(){return _0x5b748d;});}else{return _0x5b748d;}})[_0xe092('0x26')](function(_0x2f1d98){logger['error'](_0xe092('0x5f'),_0x2f1d98);throw _0x2f1d98;});}return _0x5b748d;})[_0xe092('0x1c')](respondWithResult(_0x34faa4,0xc9))[_0xe092('0x26')](handleError(_0x34faa4,null));};exports[_0xe092('0x32')]=function(_0x2e1735,_0x4b97b2){if(_0x2e1735[_0xe092('0x5a')]['id']){delete _0x2e1735['body']['id'];}return db[_0xe092('0x53')]['find']({'where':{'id':_0x2e1735[_0xe092('0x56')]['id']},'include':[{'model':db[_0xe092('0x3a')],'as':_0xe092('0x3b')}]})[_0xe092('0x1c')](handleEntityNotFound(_0x4b97b2,null))[_0xe092('0x1c')](saveUpdates(_0x2e1735['body'],null))[_0xe092('0x1c')](respondWithResult(_0x4b97b2,null))[_0xe092('0x26')](handleError(_0x4b97b2,null));};exports[_0xe092('0x35')]=function(_0x159139,_0x5397ca){return db['OpenchannelAccount'][_0xe092('0x58')]({'where':{'id':_0x159139[_0xe092('0x56')]['id']}})[_0xe092('0x1c')](handleEntityNotFound(_0x5397ca,null))[_0xe092('0x1c')](removeEntity(_0x5397ca,null))['catch'](handleError(_0x5397ca,null));};exports[_0xe092('0x60')]=function(_0x446ee7,_0x41edc0){return db[_0xe092('0x53')][_0xe092('0x60')]()[_0xe092('0x1c')](respondWithResult(_0x41edc0,null))['catch'](handleError(_0x41edc0,null));};exports[_0xe092('0x61')]=function(_0x74347f,_0x2cd92f,_0x49f2e3){if(_0x74347f['body']['id']){delete _0x74347f[_0xe092('0x5a')]['id'];}return db[_0xe092('0x53')][_0xe092('0x58')]({'where':{'id':_0x74347f[_0xe092('0x56')]['id']}})[_0xe092('0x1c')](handleEntityNotFound(_0x2cd92f,null))['then'](function(_0x12770a){if(_0x12770a){_0x74347f['body'][_0xe092('0x62')]=_0x12770a['id'];return db[_0xe092('0x63')]['create'](_0x74347f[_0xe092('0x5a')]);}})['then'](respondWithResult(_0x2cd92f,null))['catch'](handleError(_0x2cd92f,null));};exports[_0xe092('0x64')]=function(_0x21cc67,_0x5335c9,_0x2160f1){var _0x244c42={'raw':![],'where':{}};var _0x848329={};var _0x10d5aa={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe092('0x65')]({'where':{'id':_0x21cc67[_0xe092('0x56')]['id']}})['then'](handleEntityNotFound(_0x5335c9,null))[_0xe092('0x1c')](function(_0xa22058){if(_0xa22058){_0x848329['model']=_['keys'](db[_0xe092('0x63')][_0xe092('0x3c')]);_0x848329[_0xe092('0x42')]=_[_0xe092('0x57')](_0x21cc67[_0xe092('0x42')]);_0x848329[_0xe092('0x43')]=_[_0xe092('0x44')](_0x848329[_0xe092('0x40')],_0x848329[_0xe092('0x42')]);_0x244c42[_0xe092('0x45')]=_[_0xe092('0x44')](_0x848329[_0xe092('0x40')],qs[_0xe092('0x46')](_0x21cc67[_0xe092('0x42')][_0xe092('0x46')]));_0x244c42[_0xe092('0x45')]=_0x244c42[_0xe092('0x45')][_0xe092('0x47')]?_0x244c42[_0xe092('0x45')]:_0x848329[_0xe092('0x40')];if(!_0x21cc67[_0xe092('0x42')][_0xe092('0x48')](_0xe092('0x49'))){_0x244c42['limit']=qs[_0xe092('0x2c')](_0x21cc67[_0xe092('0x42')][_0xe092('0x2c')]);_0x244c42[_0xe092('0x2a')]=qs['offset'](_0x21cc67[_0xe092('0x42')][_0xe092('0x2a')]);}_0x244c42[_0xe092('0x4a')]=qs['sort'](_0x21cc67[_0xe092('0x42')]['sort']);_0x244c42[_0xe092('0x4c')]=qs[_0xe092('0x43')](_[_0xe092('0x4d')](_0x21cc67['query'],_0x848329['filters']));_0x244c42[_0xe092('0x4c')]['OpenchannelAccountId']=_0xa22058['id'];if(_0x21cc67['query']['filter']){_0x244c42['where']=_[_0xe092('0x4f')](_0x244c42[_0xe092('0x4c')],{'$or':_[_0xe092('0x41')](_0x244c42[_0xe092('0x45')],function(_0x2e8e8b){var _0x254255={};_0x254255[_0x2e8e8b]={'$like':'%'+_0x21cc67['query'][_0xe092('0x4e')]+'%'};return _0x254255;})});}_0x244c42=_[_0xe092('0x4f')]({},_0x244c42,_0x21cc67[_0xe092('0x51')]);return db['Disposition'][_0xe092('0x2d')]({'where':_0x244c42[_0xe092('0x4c')]})[_0xe092('0x1c')](function(_0x1634ea){_0x10d5aa[_0xe092('0x2d')]=_0x1634ea;if(_0x21cc67['query'][_0xe092('0x66')]){_0x244c42[_0xe092('0x52')]=[{'all':!![]}];}return db[_0xe092('0x63')][_0xe092('0x54')](_0x244c42);})[_0xe092('0x1c')](function(_0x305a8d){_0x10d5aa[_0xe092('0x55')]=_0x305a8d;return _0x10d5aa;});}})['then'](respondWithFilteredResult(_0x5335c9,_0x244c42))[_0xe092('0x26')](handleError(_0x5335c9,null));};exports[_0xe092('0x67')]=function(_0x2c10d7,_0x31004a,_0x1311a1){return db[_0xe092('0x53')]['find']({'where':{'id':_0x2c10d7[_0xe092('0x56')]['id']}})[_0xe092('0x1c')](handleEntityNotFound(_0x31004a,null))['then'](function(_0x5eb538){if(_0x5eb538){return _0x5eb538[_0xe092('0x67')](_0x2c10d7[_0xe092('0x42')][_0xe092('0x68')]);}})[_0xe092('0x1c')](respondWithStatusCode(_0x31004a,null))[_0xe092('0x26')](handleError(_0x31004a,null));};exports[_0xe092('0x69')]=function(_0x7713c8,_0xbd8ee7,_0x15ccc4){if(_0x7713c8[_0xe092('0x5a')]['id']){delete _0x7713c8[_0xe092('0x5a')]['id'];}return db[_0xe092('0x53')]['find']({'where':{'id':_0x7713c8[_0xe092('0x56')]['id']}})['then'](handleEntityNotFound(_0xbd8ee7,null))[_0xe092('0x1c')](function(_0x596242){if(_0x596242){_0x7713c8[_0xe092('0x5a')][_0xe092('0x62')]=_0x596242['id'];return db['CannedAnswer']['create'](_0x7713c8[_0xe092('0x5a')]);}})[_0xe092('0x1c')](respondWithResult(_0xbd8ee7,null))[_0xe092('0x26')](handleError(_0xbd8ee7,null));};exports[_0xe092('0x6a')]=function(_0x1025d9,_0x4b1e35,_0x290216){var _0xcb878a={'raw':![],'where':{}};var _0x2cec20={};var _0x46e5ea={'count':0x0,'rows':[]};return db[_0xe092('0x53')][_0xe092('0x65')]({'where':{'id':_0x1025d9[_0xe092('0x56')]['id']}})[_0xe092('0x1c')](handleEntityNotFound(_0x4b1e35,null))[_0xe092('0x1c')](function(_0x72f879){if(_0x72f879){_0x2cec20[_0xe092('0x40')]=_[_0xe092('0x57')](db['CannedAnswer'][_0xe092('0x3c')]);_0x2cec20['query']=_[_0xe092('0x57')](_0x1025d9[_0xe092('0x42')]);_0x2cec20[_0xe092('0x43')]=_[_0xe092('0x44')](_0x2cec20[_0xe092('0x40')],_0x2cec20[_0xe092('0x42')]);_0xcb878a[_0xe092('0x45')]=_[_0xe092('0x44')](_0x2cec20[_0xe092('0x40')],qs[_0xe092('0x46')](_0x1025d9[_0xe092('0x42')][_0xe092('0x46')]));_0xcb878a['attributes']=_0xcb878a['attributes'][_0xe092('0x47')]?_0xcb878a[_0xe092('0x45')]:_0x2cec20[_0xe092('0x40')];if(!_0x1025d9[_0xe092('0x42')]['hasOwnProperty'](_0xe092('0x49'))){_0xcb878a[_0xe092('0x2c')]=qs[_0xe092('0x2c')](_0x1025d9[_0xe092('0x42')]['limit']);_0xcb878a[_0xe092('0x2a')]=qs[_0xe092('0x2a')](_0x1025d9[_0xe092('0x42')][_0xe092('0x2a')]);}_0xcb878a[_0xe092('0x4a')]=qs[_0xe092('0x4b')](_0x1025d9[_0xe092('0x42')]['sort']);_0xcb878a['where']=qs['filters'](_[_0xe092('0x4d')](_0x1025d9[_0xe092('0x42')],_0x2cec20[_0xe092('0x43')]));_0xcb878a[_0xe092('0x4c')][_0xe092('0x62')]=_0x72f879['id'];if(_0x1025d9['query'][_0xe092('0x4e')]){_0xcb878a[_0xe092('0x4c')]=_[_0xe092('0x4f')](_0xcb878a[_0xe092('0x4c')],{'$or':_['map'](_0xcb878a[_0xe092('0x45')],function(_0x7dbf31){var _0x2a78a1={};_0x2a78a1[_0x7dbf31]={'$like':'%'+_0x1025d9['query']['filter']+'%'};return _0x2a78a1;})});}_0xcb878a=_[_0xe092('0x4f')]({},_0xcb878a,_0x1025d9[_0xe092('0x51')]);return db['CannedAnswer']['count']({'where':_0xcb878a[_0xe092('0x4c')]})[_0xe092('0x1c')](function(_0x5d15dc){_0x46e5ea['count']=_0x5d15dc;if(_0x1025d9[_0xe092('0x42')]['includeAll']){_0xcb878a[_0xe092('0x52')]=[{'all':!![]}];}return db[_0xe092('0x6b')][_0xe092('0x54')](_0xcb878a);})[_0xe092('0x1c')](function(_0x24c402){_0x46e5ea[_0xe092('0x55')]=_0x24c402;return _0x46e5ea;});}})[_0xe092('0x1c')](respondWithFilteredResult(_0x4b1e35,_0xcb878a))[_0xe092('0x26')](handleError(_0x4b1e35,null));};exports[_0xe092('0x6c')]=function(_0x27fcb8,_0x281dc8,_0x3ad698){return db[_0xe092('0x53')]['find']({'where':{'id':_0x27fcb8['params']['id']}})[_0xe092('0x1c')](handleEntityNotFound(_0x281dc8,null))[_0xe092('0x1c')](function(_0x5c5eb5){if(_0x5c5eb5){return _0x5c5eb5[_0xe092('0x6c')](_0x27fcb8[_0xe092('0x42')][_0xe092('0x68')]);}})[_0xe092('0x1c')](respondWithStatusCode(_0x281dc8,null))['catch'](handleError(_0x281dc8,null));};exports['notify']=function(_0x5009a8,_0x934be1,_0x26891c){var _0x33662d={'body':_0x5009a8[_0xe092('0x5a')],'channel':_0xe092('0x6d')};var _0x57edf5=[];var _0x1db4f5=[];var _0x48a63a={};var _0x1ac7fc=![];return db[_0xe092('0x6e')][_0xe092('0x60')]()['then'](function(_0x1ec6bf){if(!_0x1ec6bf){throw new db[(_0xe092('0x6f'))][(_0xe092('0x70'))](_0xe092('0x71'));}_0x57edf5=_[_0xe092('0x72')](_['keys'](_0x1ec6bf),[_0xe092('0x73'),'updatedAt']);_0x1db4f5=_['difference'](_[_0xe092('0x57')](_0x1ec6bf),[_0xe092('0x73'),_0xe092('0x74'),_0xe092('0x75'),_0xe092('0x76')]);if(_0x5009a8[_0xe092('0x5a')]['id']){delete _0x5009a8[_0xe092('0x5a')]['id'];}if(_[_0xe092('0x77')](_0x5009a8[_0xe092('0x5a')][_0xe092('0x78')])){throw new db[(_0xe092('0x6f'))][(_0xe092('0x70'))](_0xe092('0x79'));}if(_[_0xe092('0x77')](_0x5009a8[_0xe092('0x5a')][_0xe092('0x5a')])||_0x5009a8[_0xe092('0x5a')]['body']===''){throw new db[(_0xe092('0x6f'))][(_0xe092('0x70'))](_0xe092('0x7a'));}if(_[_0xe092('0x77')](_0x5009a8[_0xe092('0x5a')][_0xe092('0x7b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1db4f5);}if(!_[_0xe092('0x7c')](_0x1db4f5,_0x5009a8[_0xe092('0x5a')]['mapKey'])){throw new db[(_0xe092('0x6f'))][(_0xe092('0x70'))](_0xe092('0x7d')+_0x1db4f5);}_0x48a63a[_0x5009a8[_0xe092('0x5a')]['mapKey']]=_0x5009a8[_0xe092('0x5a')][_0xe092('0x78')];})[_0xe092('0x1c')](function(){return db['OpenchannelAccount'][_0xe092('0x58')]({'where':{'id':_0x5009a8[_0xe092('0x56')]['id']},'include':[{'model':db[_0xe092('0x7e')],'as':_0xe092('0x7f'),'include':[{'model':db[_0xe092('0x6e')],'as':_0xe092('0x80'),'where':_0x48a63a,'limit':0x1,'order':[[_0xe092('0x74'),_0xe092('0x81')]]}]},{'model':db['OpenchannelApplication'],'as':_0xe092('0x82')}]});})[_0xe092('0x1c')](handleEntityNotFound(_0x934be1,null))[_0xe092('0x1c')](function(_0x39da44){if(_0x39da44&&_0x39da44[_0xe092('0x7f')]){_0x33662d['account']=_0x39da44;_0x33662d[_0xe092('0x83')]=_0x39da44[_0xe092('0x82')];_0x33662d[_0xe092('0x84')]=_0x39da44[_0xe092('0x7f')];_0x33662d[_0xe092('0x83')]=_[_0xe092('0x85')](_0x33662d[_0xe092('0x83')],[_0xe092('0x86')],['asc']);if(_0x33662d[_0xe092('0x87')][_0xe092('0x82')]){delete _0x33662d[_0xe092('0x87')][_0xe092('0x82')];}if(_0x33662d[_0xe092('0x87')][_0xe092('0x7f')]&&_0x33662d[_0xe092('0x87')][_0xe092('0x7f')]['Contacts'][_0xe092('0x47')]){return _0x33662d[_0xe092('0x87')][_0xe092('0x7f')][_0xe092('0x80')][0x0];}var _0x59fe11=_[_0xe092('0x88')](_0x5009a8['body'],{'firstName':_0x5009a8[_0xe092('0x5a')][_0xe092('0x78')],'ListId':_0x39da44[_0xe092('0x76')]});_0x59fe11[_0x5009a8['body']['mapKey']]=_0x5009a8[_0xe092('0x5a')][_0xe092('0x78')];return db[_0xe092('0x6e')][_0xe092('0x59')](_0x59fe11,{'fields':_0x57edf5,'raw':!![]});}})[_0xe092('0x1c')](handleEntityNotFound(_0x934be1,null))['then'](function(_0x1d8d35){_0x33662d['contact']=_0x1d8d35;if(_0x1d8d35){var _0xfbc2f3={'ContactId':_0x1d8d35['id'],'OpenchannelAccountId':_0x5009a8[_0xe092('0x56')]['id'],'from':(_0x1d8d35[_0xe092('0x89')]||'')+'\x20'+(_0x1d8d35[_0xe092('0x8a')]||'')};var _0x528e06={'OpenchannelAccountId':_0x5009a8[_0xe092('0x56')]['id'],'closed':![]};if(_0x5009a8[_0xe092('0x5a')][_0xe092('0x8b')]){_0x528e06['threadId']=_0x5009a8['body'][_0xe092('0x8b')];return db[_0xe092('0x8c')]['find']({'where':_0x528e06})[_0xe092('0x1c')](function(_0x1f1210){if(_0x1f1210){return[_0x1f1210,![]];}_0xfbc2f3[_0xe092('0x8b')]=_0x5009a8['body'][_0xe092('0x8b')];_0xfbc2f3['externalUrl']=_0x5009a8[_0xe092('0x5a')][_0xe092('0x8d')];return db[_0xe092('0x8c')]['create'](_0xfbc2f3)[_0xe092('0x1c')](function(_0x6e0779){return[_0x6e0779,!![]];});});}else{_0x528e06[_0xe092('0x8b')]=null;}_0x528e06['ContactId']=_0x1d8d35['id'];return db['OpenchannelInteraction'][_0xe092('0x58')]({'where':_0x528e06})[_0xe092('0x1c')](function(_0x54362c){if(_0x54362c){return[_0x54362c,![]];}return db[_0xe092('0x8c')][_0xe092('0x59')](_0xfbc2f3)[_0xe092('0x1c')](function(_0x2e8503){return[_0x2e8503,!![]];});});}})['spread'](function(_0x49dc34,_0xdc2f44){if(_0x49dc34){_0x1ac7fc=_0xdc2f44;if(!_0xdc2f44){var _0x4451de={'from':(_0x33662d[_0xe092('0x8e')]['firstName']||'')+'\x20'+(_0x33662d[_0xe092('0x8e')]['lastName']||'')};if(_0x5009a8[_0xe092('0x5a')][_0xe092('0x8b')]&&_0x5009a8[_0xe092('0x5a')][_0xe092('0x8f')]&&_0x5009a8[_0xe092('0x5a')][_0xe092('0x8b')]!=_0x5009a8['body'][_0xe092('0x8f')]){_0x4451de[_0xe092('0x8b')]=_0x5009a8[_0xe092('0x5a')][_0xe092('0x8f')];}return _0x49dc34[_0xe092('0x32')](_0x4451de);}else{return _0x49dc34;}}})[_0xe092('0x1c')](function(_0x5018fa){_0x33662d[_0xe092('0x90')]=_0x5018fa[_0xe092('0x33')]({'plain':!![]});_0x33662d['interaction']['created']=_0x1ac7fc;if(_0x33662d[_0xe092('0x90')]['created']){if(_0x33662d['account'][_0xe092('0x91')]){_0x33662d['applications'][_0xe092('0x92')]({'id':0x0,'priority':_0x33662d[_0xe092('0x83')]['length']+0x1,'app':_0xe092('0x93'),'appdata':_0xe092('0x94'),'interval':_0xe092('0x95')});}}return db['OpenchannelMessage'][_0xe092('0x59')]({'body':_0x5009a8[_0xe092('0x5a')][_0xe092('0x5a')],'OpenchannelAccountId':_0x5009a8[_0xe092('0x56')]['id'],'OpenchannelInteractionId':_0x5018fa['id'],'direction':'in','ContactId':_0x33662d[_0xe092('0x8e')]['id'],'AttachmentId':_0x5009a8['body'][_0xe092('0x96')]});})[_0xe092('0x1c')](function(_0x449f3f){_0x33662d[_0xe092('0x24')]=_0x449f3f;if(_0x33662d[_0xe092('0x90')][_0xe092('0x97')]){return db[_0xe092('0x98')][_0xe092('0x58')]({'attributes':['id',_0xe092('0x37')],'where':{'id':_0x33662d[_0xe092('0x90')][_0xe092('0x97')]}})['then'](function(_0x2964b0){if(_0x2964b0){_0x33662d[_0xe092('0x83')][_0xe092('0x99')]({'id':0x0,'priority':0x0,'app':_0xe092('0x9a'),'appdata':_0x2964b0[_0xe092('0x37')]+','+(_0x33662d['account'][_0xe092('0x9b')]||0xa),'interval':'*,*,*,*'});_0x33662d['forcedOwnership']=![];}return respondWithRpcPromise(_0xe092('0x9c'),_0xe092('0x9d'),_0x33662d);});}return respondWithRpcPromise(_0xe092('0x9c'),_0xe092('0x9d'),_0x33662d);})['then'](function(_0x3a6516){respondWithRpcPromise(_0xe092('0x9e'),_0xe092('0x9e'),{'event':'notify','message':_0x3a6516},client9002);return _0x3a6516;})['then'](respondWithResult(_0x934be1,null))[_0xe092('0x26')](handleError(_0x934be1,null));};exports['addApplications']=function(_0xbc75b6,_0x40a172){var _0x4c6b5a=_0xbc75b6[_0xe092('0x56')]['id'];var _0x4f6795=_0xbc75b6[_0xe092('0x5a')];var _0x1653df=0xc8;var _0x59ecf7=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xe092('0x9f')][_0xe092('0xa0')][_0xe092('0xa1')]['READ_COMMITTED']},function(_0x1e36f0){return db[_0xe092('0x53')]['findOne']({'where':{'id':_0x4c6b5a},'transaction':_0x1e36f0})['then'](function(_0x39fe0e){if(_0x39fe0e){return db[_0xe092('0xa2')][_0xe092('0x35')]({'where':{'OpenchannelAccountId':_0x4c6b5a},'transaction':_0x1e36f0})[_0xe092('0x1c')](function(){var _0x5c163c=_[_0xe092('0x41')](_0x4f6795,function(_0x144d67){_0x144d67[_0xe092('0x62')]=_0x4c6b5a;return _0x144d67;});return db[_0xe092('0xa2')][_0xe092('0xa3')](_0x5c163c,{'transaction':_0x1e36f0});});}else{_0x1653df=0x194;_0x59ecf7=[];}});})['then'](function(){if(_0x1653df!==0x194){return db[_0xe092('0xa2')][_0xe092('0xa4')]({'where':{'OpenchannelAccountId':_0x4c6b5a},'order':_0xe092('0x86')})[_0xe092('0x1c')](function(_0x1d336b){_0x59ecf7=_0x1d336b;});}})[_0xe092('0x26')](function(_0x4b17f3){_0x1653df=0x1f4;logger[_0xe092('0x22')](_0x4b17f3[_0xe092('0x36')]);if(_0x4b17f3[_0xe092('0x37')]){delete _0x4b17f3[_0xe092('0x37')];}_0x59ecf7=_0x4b17f3;})[_0xe092('0xa5')](function(){if(_0x59ecf7===null){_0x40a172[_0xe092('0x27')](_0x1653df);}else{if(_0x1653df===0x1f4){_0x40a172[_0xe092('0x28')](_0x1653df)['send'](_0x59ecf7);}else{_0x40a172['status'](_0x1653df)[_0xe092('0x29')](_0x59ecf7);}}});};exports[_0xe092('0xa6')]=function(_0x550aad,_0x2cdf7d,_0x25839c){var _0xad6ec3={};var _0x458d3b={};var _0x53f750;var _0x59a8df;return db['OpenchannelAccount'][_0xe092('0x65')]({'where':{'id':_0x550aad[_0xe092('0x56')]['id']}})['then'](handleEntityNotFound(_0x2cdf7d,null))[_0xe092('0x1c')](function(_0x3db5fc){if(_0x3db5fc){_0x53f750=_0x3db5fc;_0x458d3b['model']=_[_0xe092('0x57')](db[_0xe092('0xa2')][_0xe092('0x3c')]);_0x458d3b[_0xe092('0x42')]=_[_0xe092('0x57')](_0x550aad['query']);_0x458d3b['filters']=_[_0xe092('0x44')](_0x458d3b[_0xe092('0x40')],_0x458d3b['query']);_0xad6ec3['attributes']=_[_0xe092('0x44')](_0x458d3b[_0xe092('0x40')],qs[_0xe092('0x46')](_0x550aad['query'][_0xe092('0x46')]));_0xad6ec3[_0xe092('0x45')]=_0xad6ec3[_0xe092('0x45')][_0xe092('0x47')]?_0xad6ec3[_0xe092('0x45')]:_0x458d3b[_0xe092('0x40')];_0xad6ec3[_0xe092('0x4a')]=qs[_0xe092('0x4b')](_0x550aad['query'][_0xe092('0x4b')]);_0xad6ec3[_0xe092('0x4c')]=qs[_0xe092('0x43')](_[_0xe092('0x4d')](_0x550aad[_0xe092('0x42')],_0x458d3b[_0xe092('0x43')]));if(_0x550aad[_0xe092('0x42')][_0xe092('0x4e')]){_0xad6ec3[_0xe092('0x4c')]=_['merge'](_0xad6ec3[_0xe092('0x4c')],{'$or':_[_0xe092('0x41')](_0xad6ec3[_0xe092('0x45')],function(_0x588a6a){var _0x4320ba={};_0x4320ba[_0x588a6a]={'$like':'%'+_0x550aad[_0xe092('0x42')]['filter']+'%'};return _0x4320ba;})});}_0xad6ec3=_['merge']({},_0xad6ec3,_0x550aad['options']);return _0x53f750[_0xe092('0xa6')](_0xad6ec3);}})[_0xe092('0x1c')](function(_0x23a152){if(_0x23a152){_0x59a8df=_0x23a152[_0xe092('0x47')];if(!_0x550aad[_0xe092('0x42')]['hasOwnProperty']('nolimit')){_0xad6ec3[_0xe092('0x2c')]=qs[_0xe092('0x2c')](_0x550aad['query'][_0xe092('0x2c')]);_0xad6ec3[_0xe092('0x2a')]=qs[_0xe092('0x2a')](_0x550aad['query'][_0xe092('0x2a')]);}return _0x53f750[_0xe092('0xa6')](_0xad6ec3);}})[_0xe092('0x1c')](function(_0x46e4c0){if(_0x46e4c0){return _0x46e4c0?{'count':_0x59a8df,'rows':_0x46e4c0}:null;}})[_0xe092('0x1c')](respondWithResult(_0x2cdf7d,null))[_0xe092('0x26')](handleError(_0x2cdf7d,null));};exports[_0xe092('0xa7')]=function(_0x4ffe5b,_0x18f76a,_0x49407b){var _0xf9e5b9={'raw':![],'where':{}};var _0x1dc154={};var _0x1cc8eb={'count':0x0,'rows':[]};return db[_0xe092('0x53')][_0xe092('0x65')]({'where':{'id':_0x4ffe5b['params']['id']}})[_0xe092('0x1c')](handleEntityNotFound(_0x18f76a,null))['then'](function(_0x5bf400){if(_0x5bf400){_0x1dc154[_0xe092('0x40')]=_['keys'](db[_0xe092('0x8c')]['rawAttributes']);_0x1dc154[_0xe092('0x42')]=_[_0xe092('0x57')](_0x4ffe5b[_0xe092('0x42')]);_0x1dc154[_0xe092('0x43')]=_['intersection'](_0x1dc154[_0xe092('0x40')],_0x1dc154['query']);_0xf9e5b9[_0xe092('0x45')]=_[_0xe092('0x44')](_0x1dc154[_0xe092('0x40')],qs['fields'](_0x4ffe5b['query']['fields']));_0xf9e5b9[_0xe092('0x45')]=_0xf9e5b9[_0xe092('0x45')][_0xe092('0x47')]?_0xf9e5b9['attributes']:_0x1dc154[_0xe092('0x40')];if(!_0x4ffe5b[_0xe092('0x42')][_0xe092('0x48')](_0xe092('0x49'))){_0xf9e5b9[_0xe092('0x2c')]=qs[_0xe092('0x2c')](_0x4ffe5b[_0xe092('0x42')][_0xe092('0x2c')]);_0xf9e5b9['offset']=qs[_0xe092('0x2a')](_0x4ffe5b[_0xe092('0x42')][_0xe092('0x2a')]);}_0xf9e5b9['order']=qs['sort'](_0x4ffe5b[_0xe092('0x42')][_0xe092('0x4b')]);_0xf9e5b9[_0xe092('0x4c')]=qs[_0xe092('0x43')](_['pick'](_0x4ffe5b['query'],_0x1dc154['filters']));_0xf9e5b9[_0xe092('0x4c')]['OpenchannelAccountId']=_0x5bf400['id'];if(_0x4ffe5b['query']['filter']){_0xf9e5b9['where']=_[_0xe092('0x4f')](_0xf9e5b9['where'],{'$or':_[_0xe092('0x41')](_0xf9e5b9[_0xe092('0x45')],function(_0x506b97){var _0x1789a4={};_0x1789a4[_0x506b97]={'$like':'%'+_0x4ffe5b[_0xe092('0x42')][_0xe092('0x4e')]+'%'};return _0x1789a4;})});}_0xf9e5b9=_[_0xe092('0x4f')]({},_0xf9e5b9,_0x4ffe5b[_0xe092('0x51')]);return db[_0xe092('0x8c')][_0xe092('0x2d')]({'where':_0xf9e5b9[_0xe092('0x4c')]})[_0xe092('0x1c')](function(_0x4a94d5){_0x1cc8eb['count']=_0x4a94d5;if(_0x4ffe5b[_0xe092('0x42')][_0xe092('0x66')]){_0xf9e5b9[_0xe092('0x52')]=[{'model':db[_0xe092('0x6e')],'as':_0xe092('0xa8'),'required':![]},{'model':db[_0xe092('0x98')],'as':_0xe092('0xa9'),'attributes':[_0xe092('0x37'),_0xe092('0xaa'),'internal'],'required':![]},{'model':db[_0xe092('0xab')],'as':'Tags','attributes':['id',_0xe092('0x37'),'color'],'where':_0x4ffe5b['query'][_0xe092('0xac')]?{'id':_0x4ffe5b[_0xe092('0x42')][_0xe092('0xac')]}:undefined,'required':_0x4ffe5b[_0xe092('0x42')][_0xe092('0xac')]?!![]:![]}];}return db[_0xe092('0x8c')][_0xe092('0x54')](_0xf9e5b9);})['then'](function(_0x347f83){_0x1cc8eb[_0xe092('0x55')]=_0x347f83;return _0x1cc8eb;});}})[_0xe092('0x1c')](respondWithFilteredResult(_0x18f76a,_0xf9e5b9))[_0xe092('0x26')](handleError(_0x18f76a,null));};exports[_0xe092('0xad')]=function(_0x3fa3e8,_0x182c0d,_0x34198d){return db['OpenchannelAccount'][_0xe092('0x58')]({'where':{'id':_0x3fa3e8['params']['id']}})['then'](handleEntityNotFound(_0x182c0d,null))[_0xe092('0x1c')](function(_0x18e9a3){if(_0x18e9a3){return _0x18e9a3[_0xe092('0xad')](_0x3fa3e8[_0xe092('0x5a')][_0xe092('0x68')],_['omit'](_0x3fa3e8['body'],[_0xe092('0x68'),'id'])||{})[_0xe092('0xae')](function(_0x6c4722){for(var _0x35862e=0x0;_0x35862e<_0x3fa3e8[_0xe092('0x5a')][_0xe092('0x68')][_0xe092('0x47')];_0x35862e+=0x1){socket[_0xe092('0xaf')](_0xe092('0xb0'),{'UserId':Number(_0x3fa3e8[_0xe092('0x5a')]['ids'][_0x35862e]),'OpenchannelAccountId':Number(_0x3fa3e8[_0xe092('0x56')]['id'])});}return _0x6c4722;});}})[_0xe092('0x1c')](respondWithResult(_0x182c0d,null))[_0xe092('0x26')](handleError(_0x182c0d,null));};exports['removeAgents']=function(_0x2d6879,_0x177b8f,_0x93c345){return db[_0xe092('0x53')][_0xe092('0x58')]({'where':{'id':_0x2d6879[_0xe092('0x56')]['id']}})['then'](handleEntityNotFound(_0x177b8f,null))['then'](function(_0x35126e){if(_0x35126e){return _0x35126e[_0xe092('0xb1')](_0x2d6879['query']['ids'])[_0xe092('0x1c')](function(){if(_[_0xe092('0xb2')](_0x2d6879[_0xe092('0x42')][_0xe092('0x68')])){for(var _0xdff95e=0x0;_0xdff95e<_0x2d6879['query']['ids'][_0xe092('0x47')];_0xdff95e+=0x1){socket[_0xe092('0xaf')](_0xe092('0xb3'),{'UserId':Number(_0x2d6879[_0xe092('0x42')][_0xe092('0x68')][_0xdff95e]),'OpenchannelAccountId':Number(_0x2d6879[_0xe092('0x56')]['id'])});}}else{socket[_0xe092('0xaf')](_0xe092('0xb3'),{'UserId':Number(_0x2d6879[_0xe092('0x42')][_0xe092('0x68')]),'OpenchannelAccountId':Number(_0x2d6879[_0xe092('0x56')]['id'])});}});}})[_0xe092('0x1c')](respondWithStatusCode(_0x177b8f,null))[_0xe092('0x26')](handleError(_0x177b8f,null));};exports[_0xe092('0xb4')]=function(_0x167139,_0x41e4c3,_0x2745f3){var _0x47124a={};var _0x1cdb2d={};var _0x5b409d;var _0x3c17b4;return db['OpenchannelAccount'][_0xe092('0x65')]({'where':{'id':_0x167139[_0xe092('0x56')]['id']}})[_0xe092('0x1c')](handleEntityNotFound(_0x41e4c3,null))[_0xe092('0x1c')](function(_0x4dafb6){if(_0x4dafb6){_0x5b409d=_0x4dafb6;_0x1cdb2d['model']=_[_0xe092('0x57')](db[_0xe092('0x98')][_0xe092('0x3c')]);_0x1cdb2d[_0xe092('0x42')]=_['keys'](_0x167139[_0xe092('0x42')]);_0x1cdb2d[_0xe092('0x43')]=_['intersection'](_0x1cdb2d[_0xe092('0x40')],_0x1cdb2d[_0xe092('0x42')]);_0x47124a['attributes']=_[_0xe092('0x44')](_0x1cdb2d[_0xe092('0x40')],qs[_0xe092('0x46')](_0x167139[_0xe092('0x42')]['fields']));_0x47124a[_0xe092('0x45')]=_0x47124a[_0xe092('0x45')][_0xe092('0x47')]?_0x47124a['attributes']:_0x1cdb2d[_0xe092('0x40')];_0x47124a[_0xe092('0x4a')]=qs[_0xe092('0x4b')](_0x167139['query'][_0xe092('0x4b')]);_0x47124a[_0xe092('0x4c')]=qs[_0xe092('0x43')](_['pick'](_0x167139['query'],_0x1cdb2d[_0xe092('0x43')]));if(_0x167139[_0xe092('0x42')][_0xe092('0x4e')]){_0x47124a['where']=_[_0xe092('0x4f')](_0x47124a[_0xe092('0x4c')],{'$or':_[_0xe092('0x41')](_0x47124a[_0xe092('0x45')],function(_0x329f0e){var _0x349c06={};_0x349c06[_0x329f0e]={'$like':'%'+_0x167139[_0xe092('0x42')][_0xe092('0x4e')]+'%'};return _0x349c06;})});}_0x47124a=_[_0xe092('0x4f')]({},_0x47124a,_0x167139[_0xe092('0x51')]);return _0x5b409d[_0xe092('0xb4')](_0x47124a);}})[_0xe092('0x1c')](function(_0x4ac519){if(_0x4ac519){_0x3c17b4=_0x4ac519[_0xe092('0x47')];if(!_0x167139['query'][_0xe092('0x48')](_0xe092('0x49'))){_0x47124a[_0xe092('0x2c')]=qs[_0xe092('0x2c')](_0x167139[_0xe092('0x42')][_0xe092('0x2c')]);_0x47124a[_0xe092('0x2a')]=qs['offset'](_0x167139[_0xe092('0x42')][_0xe092('0x2a')]);}return _0x5b409d[_0xe092('0xb4')](_0x47124a);}})['then'](function(_0x48abe7){if(_0x48abe7){return _0x48abe7?{'count':_0x3c17b4,'rows':_0x48abe7}:null;}})[_0xe092('0x1c')](respondWithResult(_0x41e4c3,null))[_0xe092('0x26')](handleError(_0x41e4c3,null));};exports[_0xe092('0x38')]=function(_0x5f2e3d,_0xd6dadb,_0xdbea4b){var _0x47bb5e,_0x32bad2,_0x33d7ea;if(_[_0xe092('0x77')](_0x5f2e3d[_0xe092('0x5a')][_0xe092('0x5a')])||_0x5f2e3d[_0xe092('0x5a')][_0xe092('0x5a')]===''){throw new db[(_0xe092('0x6f'))][(_0xe092('0x70'))](_0xe092('0x7a'));}if(_[_0xe092('0x77')](_0x5f2e3d[_0xe092('0x5a')]['to'])){}_0x47bb5e=_0x5f2e3d[_0xe092('0x5a')]['to'];return db[_0xe092('0x53')][_0xe092('0x65')]({'where':{'id':_0x5f2e3d[_0xe092('0x56')]['id']}})['then'](handleEntityNotFound(_0xd6dadb,null))[_0xe092('0x1c')](function(_0x2c0012){if(_0x2c0012){return db['OpenchannelAccount']['find']({'where':{'id':_0x2c0012['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xe092('0x80'),'where':{[_0x2c0012[_0xe092('0x7b')]]:_0x47bb5e},'limit':0x1,'order':[[_0xe092('0x74'),_0xe092('0x81')]]}]}]})[_0xe092('0x1c')](handleEntityNotFound(_0xd6dadb,null))[_0xe092('0x1c')](function(_0x3eb8b5){if(_0x3eb8b5&&_0x3eb8b5[_0xe092('0x7f')]){_0x32bad2=_0x3eb8b5[_0xe092('0x33')]({'plain':!![]});if(_0x32bad2[_0xe092('0x7f')]&&_0x32bad2[_0xe092('0x7f')][_0xe092('0x80')][_0xe092('0x47')]){return _0x32bad2['List'][_0xe092('0x80')][0x0];}return db['CmContact'][_0xe092('0x59')](_[_0xe092('0x88')](_0x5f2e3d[_0xe092('0x5a')],{'firstName':_0x47bb5e,[_0x3eb8b5[_0xe092('0x7b')]]:_0x47bb5e,'phone':_0x47bb5e,'ListId':_0x32bad2['ListId']}));}})[_0xe092('0x1c')](handleEntityNotFound(_0xd6dadb,null))[_0xe092('0x1c')](function(_0x3f6591){if(_0x3f6591){_0x33d7ea=_0x3f6591;return db['OpenchannelInteraction'][_0xe092('0x58')]({'where':{'ContactId':_0x33d7ea['id'],'closed':![],'OpenchannelAccountId':_0x32bad2['id']}})[_0xe092('0x1c')](function(_0x28b11d){if(_0x28b11d){return[_0x28b11d,![]];}return db[_0xe092('0x8c')][_0xe092('0x59')]({'UserId':_0x5f2e3d['user']['id'],'ContactId':_0x33d7ea['id'],'OpenchannelAccountId':_0x32bad2['id'],'lastMsgDirection':_0xe092('0xb5'),'Messages':[_[_0xe092('0x4f')](_0x5f2e3d['body'],{'read':![],'body':_0x5f2e3d[_0xe092('0x5a')][_0xe092('0x5a')],'OpenchannelAccountId':_0x32bad2['id'],'UserId':_0x5f2e3d[_0xe092('0x5b')]['id'],'ContactId':_0x33d7ea['id']})]},{'include':[{'model':db[_0xe092('0xb6')],'as':_0xe092('0xb7')}]})[_0xe092('0x1c')](function(_0x628799){return[_0x628799,!![]];});});}})[_0xe092('0xae')](function(_0x50d56d,_0x65cc9){if(_0x65cc9){return _0x50d56d;}return db[_0xe092('0xb6')][_0xe092('0x59')](_['merge'](_0x5f2e3d[_0xe092('0x5a')],{'read':![],'body':_0x5f2e3d[_0xe092('0x5a')][_0xe092('0x5a')],'OpenchannelAccountId':_0x32bad2['id'],'OpenchannelInteractionId':_0x50d56d['id'],'UserId':_0x5f2e3d[_0xe092('0x5b')]['id'],'ContactId':_0x33d7ea['id']}))[_0xe092('0x1c')](function(_0x47ca15){_0x50d56d[_0xe092('0xb8')][_0xe092('0xb7')]=[];_0x50d56d[_0xe092('0xb8')][_0xe092('0xb7')][_0xe092('0x92')](_0x47ca15[_0xe092('0xb8')]);return _0x50d56d;});});}})[_0xe092('0x1c')](respondWithResult(_0xd6dadb,null))['catch'](handleError(_0xd6dadb,null));};
\ No newline at end of file
index 46a2eae..46f0339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x4bcbf9,_0x3adf8a){var _0x49e292=function(_0x3494ee){while(--_0x3494ee){_0x4bcbf9['push'](_0x4bcbf9['shift']());}};_0x49e292(++_0x3adf8a);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x383494,_0x2070d2){_0x383494=_0x383494-0x0;var _0x2485e5=_0xbdb7[_0x383494];return _0x2485e5;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var OpenchannelAccount=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){OpenchannelAccountEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);OpenchannelAccountEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];OpenchannelAccount[_0x7bdb('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x9bde=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0x9bde,0xe1));var _0xe9bd=function(_0x31cef8,_0x1af54d){_0x31cef8=_0x31cef8-0x0;var _0x3c5318=_0x9bde[_0x31cef8];return _0x3c5318;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xe9bd('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe9bd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9bd('0x2'),'afterDestroy':_0xe9bd('0x3')};function emitEvent(_0x131f6a){return function(_0x1c1b34,_0x10822d,_0x1a4d14){OpenchannelAccountEvents[_0xe9bd('0x4')](_0x131f6a+':'+_0x1c1b34['id'],_0x1c1b34);OpenchannelAccountEvents['emit'](_0x131f6a,_0x1c1b34);_0x1a4d14(null);};}for(var e in events){if(events[_0xe9bd('0x5')](e)){var event=events[e];OpenchannelAccount[_0xe9bd('0x6')](e,emitEvent(event));}}module[_0xe9bd('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index 080256b..5b5da41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4a4bdc,_0x5ed845){var _0x516627=function(_0x57431d){while(--_0x57431d){_0x4a4bdc['push'](_0x4a4bdc['shift']());}};_0x516627(++_0x5ed845);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xadf6b3,_0xd8726a){var _0x4c43a9=function(_0x4d347e){while(--_0x4d347e){_0xadf6b3['push'](_0xadf6b3['shift']());}};_0x4c43a9(++_0xd8726a);}(_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 logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 997cf36..0274c5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6215=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info'];(function(_0x1941c4,_0x5286d0){var _0x44a40f=function(_0x244d53){while(--_0x244d53){_0x1941c4['push'](_0x1941c4['shift']());}};_0x44a40f(++_0x5286d0);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var moment=require(_0x5621('0x2'));var BPromise=require('bluebird');var rs=require(_0x5621('0x3'));var fs=require('fs');var Redis=require(_0x5621('0x4'));var db=require(_0x5621('0x5'))['db'];var utils=require(_0x5621('0x6'));var logger=require(_0x5621('0x7'))(_0x5621('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5621('0x9')]=_[_0x5621('0xa')](config[_0x5621('0x9')],{'host':_0x5621('0xb'),'port':0x18eb});var socket=require(_0x5621('0xc'))(new Redis(config['redis']));require(_0x5621('0xd'))[_0x5621('0xe')](socket);function respondWithRpcPromise(_0x3aa022,_0x418114,_0x53625c){return new BPromise(function(_0x1f4148,_0x10bb32){return client[_0x5621('0xf')](_0x3aa022,_0x53625c)['then'](function(_0x2b0f51){logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));logger[_0x5621('0x13')](_0x5621('0x14'),_0x418114,_0x5621('0x12'),JSON[_0x5621('0x15')](_0x2b0f51));if(_0x2b0f51[_0x5621('0x16')]){if(_0x2b0f51[_0x5621('0x16')]['code']===0x1f4){logger[_0x5621('0x16')](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')]['message']);return _0x10bb32(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}logger['error'](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);return _0x1f4148(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}else{logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));_0x1f4148(_0x2b0f51[_0x5621('0x18')][_0x5621('0x17')]);}})['catch'](function(_0x1111b2){logger[_0x5621('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x418114,_0x1111b2);_0x10bb32(_0x1111b2);});});}
\ No newline at end of file
+var _0x0427=['./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1ad7f7,_0x79ad4e){var _0x2508fe=function(_0x13d713){while(--_0x13d713){_0x1ad7f7['push'](_0x1ad7f7['shift']());}};_0x2508fe(++_0x79ad4e);}(_0x0427,0x137));var _0x7042=function(_0x9f9ba3,_0x3a928a){_0x9f9ba3=_0x9f9ba3-0x0;var _0x21aeef=_0x0427[_0x9f9ba3];return _0x21aeef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7042('0x0'));var BPromise=require(_0x7042('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7042('0x2'));var db=require(_0x7042('0x3'))['db'];var utils=require(_0x7042('0x4'));var logger=require(_0x7042('0x5'))(_0x7042('0x6'));var config=require(_0x7042('0x7'));var jayson=require(_0x7042('0x8'));var client=jayson['client'][_0x7042('0x9')]({'port':0x232a});config[_0x7042('0xa')]=_[_0x7042('0xb')](config[_0x7042('0xa')],{'host':_0x7042('0xc'),'port':0x18eb});var socket=require(_0x7042('0xd'))(new Redis(config[_0x7042('0xa')]));require(_0x7042('0xe'))[_0x7042('0xf')](socket);function respondWithRpcPromise(_0x5a29aa,_0x326210,_0x5c3f0f){return new BPromise(function(_0x5cf853,_0x50eefb){return client['request'](_0x5a29aa,_0x5c3f0f)[_0x7042('0x10')](function(_0x5636e8){logger[_0x7042('0x11')](_0x7042('0x12'),_0x326210,_0x7042('0x13'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x326210,_0x7042('0x13'),JSON[_0x7042('0x14')](_0x5636e8));if(_0x5636e8[_0x7042('0x15')]){if(_0x5636e8[_0x7042('0x15')][_0x7042('0x16')]===0x1f4){logger[_0x7042('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x326210,_0x5636e8[_0x7042('0x15')][_0x7042('0x17')]);return _0x50eefb(_0x5636e8[_0x7042('0x15')]['message']);}logger[_0x7042('0x15')](_0x7042('0x12'),_0x326210,_0x5636e8['error'][_0x7042('0x17')]);return _0x5cf853(_0x5636e8['error']['message']);}else{logger[_0x7042('0x11')](_0x7042('0x12'),_0x326210,_0x7042('0x13'));_0x5cf853(_0x5636e8[_0x7042('0x18')][_0x7042('0x17')]);}})['catch'](function(_0x438084){logger[_0x7042('0x15')](_0x7042('0x12'),_0x326210,_0x438084);_0x50eefb(_0x438084);});});}
\ No newline at end of file
index d2ccac9..9a2a89a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c4d=['emit','removeListener','length','save','remove','update'];(function(_0x7ae231,_0x9776ee){var _0x3ea196=function(_0x1bbd29){while(--_0x1bbd29){_0x7ae231['push'](_0x7ae231['shift']());}};_0x3ea196(++_0x9776ee);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x4f7ffb,_0x5b7c6c){_0x4f7ffb=_0x4f7ffb-0x0;var _0x5cd465=_0x1c4d[_0x4f7ffb];return _0x5cd465;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xd1c4('0x0'),_0xd1c4('0x1'),_0xd1c4('0x2')];function createListener(_0x4f505c,_0xcc8012){return function(_0x3e30ce){_0xcc8012[_0xd1c4('0x3')](_0x4f505c,_0x3e30ce);};}function removeListener(_0x3bbe05,_0x4ca0df){return function(){OpenchannelAccountEvents[_0xd1c4('0x4')](_0x3bbe05,_0x4ca0df);};}exports['register']=function(_0x406eb6){for(var _0x12e793=0x0,_0x41cc76=events[_0xd1c4('0x5')];_0x12e793<_0x41cc76;_0x12e793++){var _0x429dc6=events[_0x12e793];var _0xc9284c=createListener('openchannelAccount:'+_0x429dc6,_0x406eb6);OpenchannelAccountEvents['on'](_0x429dc6,_0xc9284c);}};
\ No newline at end of file
+var _0x63eb=['./openchannelAccount.events','save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x546ca4,_0x2f0016){var _0x47e1bd=function(_0x1fbb51){while(--_0x1fbb51){_0x546ca4['push'](_0x546ca4['shift']());}};_0x47e1bd(++_0x2f0016);}(_0x63eb,0x90));var _0xb63e=function(_0x44eaec,_0xee3437){_0x44eaec=_0x44eaec-0x0;var _0x4730e7=_0x63eb[_0x44eaec];return _0x4730e7;};'use strict';var OpenchannelAccountEvents=require(_0xb63e('0x0'));var events=[_0xb63e('0x1'),_0xb63e('0x2'),_0xb63e('0x3')];function createListener(_0x3aa2dc,_0x2968ac){return function(_0x4e6d10){_0x2968ac[_0xb63e('0x4')](_0x3aa2dc,_0x4e6d10);};}function removeListener(_0x341ff1,_0x3a40f6){return function(){OpenchannelAccountEvents[_0xb63e('0x5')](_0x341ff1,_0x3a40f6);};}exports[_0xb63e('0x6')]=function(_0x3d043b){for(var _0x1c5849=0x0,_0x456ca3=events[_0xb63e('0x7')];_0x1c5849<_0x456ca3;_0x1c5849++){var _0x2f1729=events[_0x1c5849];var _0xe4f423=createListener(_0xb63e('0x8')+_0x2f1729,_0x3d043b);OpenchannelAccountEvents['on'](_0x2f1729,_0xe4f423);}};
\ No newline at end of file
index 74bd406..ea33edf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6f4=['index','/:id','show','post','update','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf6f4,0x1d8));var _0x4f6f=function(_0x15a1c7,_0x4c65f7){_0x15a1c7=_0x15a1c7-0x0;var _0x2f7e59=_0xf6f4[_0x15a1c7];return _0x2f7e59;};'use strict';var multer=require(_0x4f6f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f6f('0x1'));var express=require(_0x4f6f('0x2'));var router=express['Router']();var fs_extra=require(_0x4f6f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4f6f('0x4'));var config=require(_0x4f6f('0x5'));var controller=require(_0x4f6f('0x6'));router['get']('/',auth[_0x4f6f('0x7')](),controller[_0x4f6f('0x8')]);router['get'](_0x4f6f('0x9'),auth['isAuthenticated'](),controller[_0x4f6f('0xa')]);router[_0x4f6f('0xb')]('/',auth[_0x4f6f('0x7')](),controller['create']);router['put'](_0x4f6f('0x9'),auth[_0x4f6f('0x7')](),controller[_0x4f6f('0xc')]);router[_0x4f6f('0xd')](_0x4f6f('0x9'),auth[_0x4f6f('0x7')](),controller[_0x4f6f('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x54b8=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated'];(function(_0x4d7668,_0x369a28){var _0x304ecb=function(_0x3e732d){while(--_0x3e732d){_0x4d7668['push'](_0x4d7668['shift']());}};_0x304ecb(++_0x369a28);}(_0x54b8,0x114));var _0x854b=function(_0xf3ce6a,_0x1b58b0){_0xf3ce6a=_0xf3ce6a-0x0;var _0x1c1655=_0x54b8[_0xf3ce6a];return _0x1c1655;};'use strict';var multer=require(_0x854b('0x0'));var util=require(_0x854b('0x1'));var path=require(_0x854b('0x2'));var timeout=require(_0x854b('0x3'));var express=require(_0x854b('0x4'));var router=express[_0x854b('0x5')]();var fs_extra=require(_0x854b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x854b('0x7'));var config=require(_0x854b('0x8'));var controller=require(_0x854b('0x9'));router[_0x854b('0xa')]('/',auth[_0x854b('0xb')](),controller['index']);router[_0x854b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x854b('0xc')]);router['post']('/',auth[_0x854b('0xb')](),controller[_0x854b('0xd')]);router['put'](_0x854b('0xe'),auth[_0x854b('0xb')](),controller[_0x854b('0xf')]);router[_0x854b('0x10')](_0x854b('0xe'),auth[_0x854b('0xb')](),controller[_0x854b('0x11')]);module['exports']=router;
\ No newline at end of file
index 2503433..91dfe6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6092=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x52340c,_0x5ef838){var _0x2cdcdb=function(_0x4edb84){while(--_0x4edb84){_0x52340c['push'](_0x52340c['shift']());}};_0x2cdcdb(++_0x5ef838);}(_0x6092,0xc6));var _0x2609=function(_0x1ce670,_0x2def00){_0x1ce670=_0x1ce670-0x0;var _0x225342=_0x6092[_0x1ce670];return _0x225342;};'use strict';var Sequelize=require(_0x2609('0x0'));module[_0x2609('0x1')]={'priority':{'type':Sequelize[_0x2609('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2609('0x3')],'allowNull':![],'defaultValue':_0x2609('0x4')},'appdata':{'type':Sequelize[_0x2609('0x5')]()},'description':{'type':Sequelize[_0x2609('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2609('0x6')}};
\ No newline at end of file
+var _0xfdcb=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfdcb,0x170));var _0xbfdc=function(_0xc144be,_0x385142){_0xc144be=_0xc144be-0x0;var _0x4ffd89=_0xfdcb[_0xc144be];return _0x4ffd89;};'use strict';var Sequelize=require(_0xbfdc('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbfdc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbfdc('0x2')],'allowNull':![],'defaultValue':_0xbfdc('0x3')},'appdata':{'type':Sequelize[_0xbfdc('0x4')]()},'description':{'type':Sequelize[_0xbfdc('0x2')]},'interval':{'type':Sequelize[_0xbfdc('0x2')],'defaultValue':_0xbfdc('0x5')}};
\ No newline at end of file
index 8bd311f..9c679cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x050d=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','save','update','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','includeAll','include','rows','params','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x72bcf9,_0x501170){var _0x1d4889=function(_0x37abe5){while(--_0x37abe5){_0x72bcf9['push'](_0x72bcf9['shift']());}};_0x1d4889(++_0x501170);}(_0x050d,0x162));var _0xd050=function(_0x170571,_0x3eda7a){_0x170571=_0x170571-0x0;var _0xc20d35=_0x050d[_0x170571];return _0xc20d35;};'use strict';var emlformat=require(_0xd050('0x0'));var rimraf=require(_0xd050('0x1'));var zipdir=require(_0xd050('0x2'));var jsonpatch=require(_0xd050('0x3'));var rp=require(_0xd050('0x4'));var moment=require(_0xd050('0x5'));var BPromise=require(_0xd050('0x6'));var Mustache=require(_0xd050('0x7'));var util=require(_0xd050('0x8'));var path=require('path');var sox=require(_0xd050('0x9'));var csv=require(_0xd050('0xa'));var ejs=require(_0xd050('0xb'));var fs=require('fs');var fs_extra=require(_0xd050('0xc'));var _=require(_0xd050('0xd'));var squel=require(_0xd050('0xe'));var crypto=require(_0xd050('0xf'));var jsforce=require(_0xd050('0x10'));var deskjs=require(_0xd050('0x11'));var toCsv=require(_0xd050('0xa'));var querystring=require(_0xd050('0x12'));var Papa=require(_0xd050('0x13'));var Redis=require(_0xd050('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd050('0x15'));var as=require(_0xd050('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd050('0x17'))(_0xd050('0x18'));var utils=require(_0xd050('0x19'));var config=require(_0xd050('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd050('0x1b'))['db'];function respondWithStatusCode(_0x459d4c,_0x25bb45){_0x25bb45=_0x25bb45||0xcc;return function(_0x256ef0){if(_0x256ef0){return _0x459d4c[_0xd050('0x1c')](_0x25bb45);}return _0x459d4c['status'](_0x25bb45)[_0xd050('0x1d')]();};}function respondWithResult(_0x2f6c06,_0x1d5882){_0x1d5882=_0x1d5882||0xc8;return function(_0x1db50c){if(_0x1db50c){return _0x2f6c06['status'](_0x1d5882)[_0xd050('0x1e')](_0x1db50c);}};}function respondWithFilteredResult(_0x5577c2,_0x166163){return function(_0x500d1a){if(_0x500d1a){var _0x463fa9=typeof _0x166163[_0xd050('0x1f')]===_0xd050('0x20')&&typeof _0x166163[_0xd050('0x21')]===_0xd050('0x20');var _0x24e9f1=_0x500d1a['count'];var _0x19bc5b=_0x463fa9?0x0:_0x166163['offset'];var _0x19653b=_0x463fa9?_0x500d1a[_0xd050('0x22')]:_0x166163['offset']+_0x166163[_0xd050('0x21')];var _0x5b5208;if(_0x19653b>=_0x24e9f1){_0x19653b=_0x24e9f1;_0x5b5208=0xc8;}else{_0x5b5208=0xce;}_0x5577c2[_0xd050('0x23')](_0x5b5208);return _0x5577c2[_0xd050('0x24')]('Content-Range',_0x19bc5b+'-'+_0x19653b+'/'+_0x24e9f1)[_0xd050('0x1e')](_0x500d1a);}return null;};}function patchUpdates(_0x4d83d4){return function(_0x53fe18){try{jsonpatch['apply'](_0x53fe18,_0x4d83d4,!![]);}catch(_0x47f830){return BPromise['reject'](_0x47f830);}return _0x53fe18[_0xd050('0x25')]();};}function saveUpdates(_0x38536d,_0x17b990){return function(_0x333b1c){if(_0x333b1c){return _0x333b1c[_0xd050('0x26')](_0x38536d)[_0xd050('0x27')](function(_0x530556){return _0x530556;});}return null;};}function removeEntity(_0xcad71d,_0x2dc7b7){return function(_0x3aa5ee){if(_0x3aa5ee){return _0x3aa5ee['destroy']()['then'](function(){_0xcad71d[_0xd050('0x23')](0xcc)[_0xd050('0x1d')]();});}};}function handleEntityNotFound(_0x162d9f,_0x1069ea){return function(_0x280db2){if(!_0x280db2){_0x162d9f['sendStatus'](0x194);}return _0x280db2;};}function handleError(_0x38e0ae,_0x35416e){_0x35416e=_0x35416e||0x1f4;return function(_0x3dad9e){logger[_0xd050('0x28')](_0x3dad9e[_0xd050('0x29')]);if(_0x3dad9e[_0xd050('0x2a')]){delete _0x3dad9e[_0xd050('0x2a')];}_0x38e0ae['status'](_0x35416e)[_0xd050('0x2b')](_0x3dad9e);};}exports[_0xd050('0x2c')]=function(_0x1621e5,_0x4e0d7c){var _0xd0b76a={},_0x5456da={},_0x1af745={'count':0x0,'rows':[]};var _0x1ca4bf=_[_0xd050('0x2d')](db[_0xd050('0x2e')][_0xd050('0x2f')],function(_0x54aae7){return{'name':_0x54aae7[_0xd050('0x30')],'type':_0x54aae7[_0xd050('0x31')]['key']};});_0x5456da['model']=_[_0xd050('0x2d')](_0x1ca4bf,'name');_0x5456da[_0xd050('0x32')]=_['keys'](_0x1621e5[_0xd050('0x32')]);_0x5456da['filters']=_['intersection'](_0x5456da[_0xd050('0x33')],_0x5456da['query']);_0xd0b76a['attributes']=_[_0xd050('0x34')](_0x5456da[_0xd050('0x33')],qs['fields'](_0x1621e5[_0xd050('0x32')][_0xd050('0x35')]));_0xd0b76a[_0xd050('0x36')]=_0xd0b76a[_0xd050('0x36')][_0xd050('0x37')]?_0xd0b76a[_0xd050('0x36')]:_0x5456da['model'];if(!_0x1621e5[_0xd050('0x32')][_0xd050('0x38')](_0xd050('0x39'))){_0xd0b76a[_0xd050('0x21')]=qs['limit'](_0x1621e5[_0xd050('0x32')]['limit']);_0xd0b76a[_0xd050('0x1f')]=qs[_0xd050('0x1f')](_0x1621e5['query'][_0xd050('0x1f')]);}_0xd0b76a[_0xd050('0x3a')]=qs['sort'](_0x1621e5[_0xd050('0x32')][_0xd050('0x3b')]);_0xd0b76a[_0xd050('0x3c')]=qs[_0xd050('0x3d')](_[_0xd050('0x3e')](_0x1621e5[_0xd050('0x32')],_0x5456da['filters']),_0x1ca4bf);if(_0x1621e5[_0xd050('0x32')]['filter']){_0xd0b76a[_0xd050('0x3c')]=_[_0xd050('0x3f')](_0xd0b76a[_0xd050('0x3c')],{'$or':_['map'](_0x1ca4bf,function(_0x419bc0){if(_0x419bc0['type']!=='VIRTUAL'){var _0x5608c1={};_0x5608c1[_0x419bc0[_0xd050('0x2a')]]={'$like':'%'+_0x1621e5[_0xd050('0x32')]['filter']+'%'};return _0x5608c1;}})});}_0xd0b76a=_[_0xd050('0x3f')]({},_0xd0b76a,_0x1621e5[_0xd050('0x40')]);var _0x2cbaf8={'where':_0xd0b76a[_0xd050('0x3c')]};return db[_0xd050('0x2e')][_0xd050('0x22')](_0x2cbaf8)['then'](function(_0x52d928){_0x1af745[_0xd050('0x22')]=_0x52d928;if(_0x1621e5[_0xd050('0x32')][_0xd050('0x41')]){_0xd0b76a[_0xd050('0x42')]=[{'all':!![]}];}return db[_0xd050('0x2e')]['findAll'](_0xd0b76a);})[_0xd050('0x27')](function(_0x10a43e){_0x1af745[_0xd050('0x43')]=_0x10a43e;return _0x1af745;})[_0xd050('0x27')](respondWithFilteredResult(_0x4e0d7c,_0xd0b76a))['catch'](handleError(_0x4e0d7c,null));};exports['show']=function(_0x4903f4,_0x455141){var _0x23f15b={'raw':!![],'where':{'id':_0x4903f4[_0xd050('0x44')]['id']}},_0xb3d92={};_0xb3d92[_0xd050('0x33')]=_['keys'](db[_0xd050('0x2e')]['rawAttributes']);_0xb3d92[_0xd050('0x32')]=_['keys'](_0x4903f4[_0xd050('0x32')]);_0xb3d92[_0xd050('0x3d')]=_[_0xd050('0x34')](_0xb3d92[_0xd050('0x33')],_0xb3d92[_0xd050('0x32')]);_0x23f15b[_0xd050('0x36')]=_[_0xd050('0x34')](_0xb3d92['model'],qs[_0xd050('0x35')](_0x4903f4['query']['fields']));_0x23f15b[_0xd050('0x36')]=_0x23f15b[_0xd050('0x36')]['length']?_0x23f15b[_0xd050('0x36')]:_0xb3d92[_0xd050('0x33')];if(_0x4903f4[_0xd050('0x32')][_0xd050('0x41')]){_0x23f15b[_0xd050('0x42')]=[{'all':!![]}];}_0x23f15b=_[_0xd050('0x3f')]({},_0x23f15b,_0x4903f4[_0xd050('0x40')]);return db[_0xd050('0x2e')][_0xd050('0x45')](_0x23f15b)[_0xd050('0x27')](handleEntityNotFound(_0x455141,null))[_0xd050('0x27')](respondWithResult(_0x455141,null))[_0xd050('0x46')](handleError(_0x455141,null));};exports['create']=function(_0x5c6ba6,_0x5eb6d9){return db['OpenchannelApplication'][_0xd050('0x47')](_0x5c6ba6[_0xd050('0x48')],{})[_0xd050('0x27')](respondWithResult(_0x5eb6d9,0xc9))[_0xd050('0x46')](handleError(_0x5eb6d9,null));};exports[_0xd050('0x26')]=function(_0x335227,_0x2c8f35){if(_0x335227[_0xd050('0x48')]['id']){delete _0x335227[_0xd050('0x48')]['id'];}return db[_0xd050('0x2e')][_0xd050('0x45')]({'where':{'id':_0x335227[_0xd050('0x44')]['id']}})[_0xd050('0x27')](handleEntityNotFound(_0x2c8f35,null))[_0xd050('0x27')](saveUpdates(_0x335227[_0xd050('0x48')],null))[_0xd050('0x27')](respondWithResult(_0x2c8f35,null))[_0xd050('0x46')](handleError(_0x2c8f35,null));};exports[_0xd050('0x49')]=function(_0x38e4c9,_0x51ba49){return db[_0xd050('0x2e')][_0xd050('0x45')]({'where':{'id':_0x38e4c9[_0xd050('0x44')]['id']}})[_0xd050('0x27')](handleEntityNotFound(_0x51ba49,null))[_0xd050('0x27')](removeEntity(_0x51ba49,null))[_0xd050('0x46')](handleError(_0x51ba49,null));};
\ No newline at end of file
+var _0x4144=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','error','name','send','index','map','OpenchannelApplication','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','destroy','eml-format','rimraf'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4144,0x112));var _0x4414=function(_0x4690cb,_0x5997a6){_0x4690cb=_0x4690cb-0x0;var _0x44d31d=_0x4144[_0x4690cb];return _0x44d31d;};'use strict';var emlformat=require(_0x4414('0x0'));var rimraf=require(_0x4414('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4414('0x2'));var moment=require(_0x4414('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4414('0x4'));var util=require(_0x4414('0x5'));var path=require(_0x4414('0x6'));var sox=require(_0x4414('0x7'));var csv=require(_0x4414('0x8'));var ejs=require(_0x4414('0x9'));var fs=require('fs');var fs_extra=require(_0x4414('0xa'));var _=require(_0x4414('0xb'));var squel=require(_0x4414('0xc'));var crypto=require(_0x4414('0xd'));var jsforce=require(_0x4414('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4414('0x8'));var querystring=require('querystring');var Papa=require(_0x4414('0xf'));var Redis=require(_0x4414('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4414('0x11'));var hardwareService=require(_0x4414('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4414('0x13'));var licenseUtil=require(_0x4414('0x14'));var db=require(_0x4414('0x15'))['db'];function respondWithStatusCode(_0x3b40ab,_0x135679){_0x135679=_0x135679||0xcc;return function(_0x23027d){if(_0x23027d){return _0x3b40ab['sendStatus'](_0x135679);}return _0x3b40ab[_0x4414('0x16')](_0x135679)[_0x4414('0x17')]();};}function respondWithResult(_0x25967b,_0x4c1c55){_0x4c1c55=_0x4c1c55||0xc8;return function(_0x51ff02){if(_0x51ff02){return _0x25967b[_0x4414('0x16')](_0x4c1c55)['json'](_0x51ff02);}};}function respondWithFilteredResult(_0x4a5b44,_0xc7ba0c){return function(_0xc726dd){if(_0xc726dd){var _0x144dc8=typeof _0xc7ba0c[_0x4414('0x18')]===_0x4414('0x19')&&typeof _0xc7ba0c['limit']===_0x4414('0x19');var _0x29a9e6=_0xc726dd[_0x4414('0x1a')];var _0x5d156c=_0x144dc8?0x0:_0xc7ba0c[_0x4414('0x18')];var _0x24f42b=_0x144dc8?_0xc726dd['count']:_0xc7ba0c[_0x4414('0x18')]+_0xc7ba0c[_0x4414('0x1b')];var _0x456d73;if(_0x24f42b>=_0x29a9e6){_0x24f42b=_0x29a9e6;_0x456d73=0xc8;}else{_0x456d73=0xce;}_0x4a5b44[_0x4414('0x16')](_0x456d73);return _0x4a5b44['set']('Content-Range',_0x5d156c+'-'+_0x24f42b+'/'+_0x29a9e6)[_0x4414('0x1c')](_0xc726dd);}return null;};}function patchUpdates(_0x21e961){return function(_0x2ac672){try{jsonpatch[_0x4414('0x1d')](_0x2ac672,_0x21e961,!![]);}catch(_0x44a279){return BPromise[_0x4414('0x1e')](_0x44a279);}return _0x2ac672[_0x4414('0x1f')]();};}function saveUpdates(_0x220747,_0x2d41f1){return function(_0x419316){if(_0x419316){return _0x419316[_0x4414('0x20')](_0x220747)[_0x4414('0x21')](function(_0x2add2b){return _0x2add2b;});}return null;};}function removeEntity(_0xec08d6,_0x2a7b87){return function(_0x2a71e0){if(_0x2a71e0){return _0x2a71e0['destroy']()[_0x4414('0x21')](function(){_0xec08d6[_0x4414('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38e9dd,_0x410142){return function(_0x56397a){if(!_0x56397a){_0x38e9dd['sendStatus'](0x194);}return _0x56397a;};}function handleError(_0x32944e,_0x39d2c5){_0x39d2c5=_0x39d2c5||0x1f4;return function(_0x2421f9){logger[_0x4414('0x22')](_0x2421f9['stack']);if(_0x2421f9[_0x4414('0x23')]){delete _0x2421f9['name'];}_0x32944e['status'](_0x39d2c5)[_0x4414('0x24')](_0x2421f9);};}exports[_0x4414('0x25')]=function(_0x1f19cb,_0x57ff04){var _0x57ae5f={},_0x4a7946={},_0x2ebd2a={'count':0x0,'rows':[]};var _0x4cf3a=_[_0x4414('0x26')](db[_0x4414('0x27')]['rawAttributes'],function(_0x11a1dd){return{'name':_0x11a1dd[_0x4414('0x28')],'type':_0x11a1dd['type'][_0x4414('0x29')]};});_0x4a7946[_0x4414('0x2a')]=_[_0x4414('0x26')](_0x4cf3a,_0x4414('0x23'));_0x4a7946['query']=_[_0x4414('0x2b')](_0x1f19cb[_0x4414('0x2c')]);_0x4a7946[_0x4414('0x2d')]=_[_0x4414('0x2e')](_0x4a7946[_0x4414('0x2a')],_0x4a7946['query']);_0x57ae5f[_0x4414('0x2f')]=_[_0x4414('0x2e')](_0x4a7946[_0x4414('0x2a')],qs[_0x4414('0x30')](_0x1f19cb['query'][_0x4414('0x30')]));_0x57ae5f[_0x4414('0x2f')]=_0x57ae5f[_0x4414('0x2f')][_0x4414('0x31')]?_0x57ae5f[_0x4414('0x2f')]:_0x4a7946[_0x4414('0x2a')];if(!_0x1f19cb['query'][_0x4414('0x32')](_0x4414('0x33'))){_0x57ae5f[_0x4414('0x1b')]=qs[_0x4414('0x1b')](_0x1f19cb[_0x4414('0x2c')][_0x4414('0x1b')]);_0x57ae5f['offset']=qs['offset'](_0x1f19cb[_0x4414('0x2c')][_0x4414('0x18')]);}_0x57ae5f[_0x4414('0x34')]=qs[_0x4414('0x35')](_0x1f19cb[_0x4414('0x2c')][_0x4414('0x35')]);_0x57ae5f[_0x4414('0x36')]=qs[_0x4414('0x2d')](_[_0x4414('0x37')](_0x1f19cb['query'],_0x4a7946[_0x4414('0x2d')]),_0x4cf3a);if(_0x1f19cb[_0x4414('0x2c')]['filter']){_0x57ae5f['where']=_['merge'](_0x57ae5f['where'],{'$or':_[_0x4414('0x26')](_0x4cf3a,function(_0x258890){if(_0x258890['type']!=='VIRTUAL'){var _0x142f9b={};_0x142f9b[_0x258890[_0x4414('0x23')]]={'$like':'%'+_0x1f19cb['query']['filter']+'%'};return _0x142f9b;}})});}_0x57ae5f=_['merge']({},_0x57ae5f,_0x1f19cb[_0x4414('0x38')]);var _0x4998b9={'where':_0x57ae5f[_0x4414('0x36')]};return db[_0x4414('0x27')]['count'](_0x4998b9)['then'](function(_0xdbe4a8){_0x2ebd2a[_0x4414('0x1a')]=_0xdbe4a8;if(_0x1f19cb[_0x4414('0x2c')][_0x4414('0x39')]){_0x57ae5f[_0x4414('0x3a')]=[{'all':!![]}];}return db[_0x4414('0x27')][_0x4414('0x3b')](_0x57ae5f);})[_0x4414('0x21')](function(_0x3f47a3){_0x2ebd2a[_0x4414('0x3c')]=_0x3f47a3;return _0x2ebd2a;})['then'](respondWithFilteredResult(_0x57ff04,_0x57ae5f))[_0x4414('0x3d')](handleError(_0x57ff04,null));};exports[_0x4414('0x3e')]=function(_0x29b7d1,_0x328350){var _0x135d01={'raw':!![],'where':{'id':_0x29b7d1['params']['id']}},_0x153613={};_0x153613['model']=_[_0x4414('0x2b')](db[_0x4414('0x27')]['rawAttributes']);_0x153613[_0x4414('0x2c')]=_[_0x4414('0x2b')](_0x29b7d1[_0x4414('0x2c')]);_0x153613[_0x4414('0x2d')]=_[_0x4414('0x2e')](_0x153613[_0x4414('0x2a')],_0x153613[_0x4414('0x2c')]);_0x135d01[_0x4414('0x2f')]=_['intersection'](_0x153613[_0x4414('0x2a')],qs[_0x4414('0x30')](_0x29b7d1['query'][_0x4414('0x30')]));_0x135d01[_0x4414('0x2f')]=_0x135d01[_0x4414('0x2f')][_0x4414('0x31')]?_0x135d01[_0x4414('0x2f')]:_0x153613['model'];if(_0x29b7d1[_0x4414('0x2c')][_0x4414('0x39')]){_0x135d01[_0x4414('0x3a')]=[{'all':!![]}];}_0x135d01=_[_0x4414('0x3f')]({},_0x135d01,_0x29b7d1['options']);return db[_0x4414('0x27')][_0x4414('0x40')](_0x135d01)['then'](handleEntityNotFound(_0x328350,null))[_0x4414('0x21')](respondWithResult(_0x328350,null))['catch'](handleError(_0x328350,null));};exports[_0x4414('0x41')]=function(_0x190d7c,_0x335423){return db[_0x4414('0x27')][_0x4414('0x41')](_0x190d7c[_0x4414('0x42')],{})[_0x4414('0x21')](respondWithResult(_0x335423,0xc9))[_0x4414('0x3d')](handleError(_0x335423,null));};exports['update']=function(_0x259423,_0x52e04e){if(_0x259423[_0x4414('0x42')]['id']){delete _0x259423['body']['id'];}return db[_0x4414('0x27')][_0x4414('0x40')]({'where':{'id':_0x259423[_0x4414('0x43')]['id']}})['then'](handleEntityNotFound(_0x52e04e,null))[_0x4414('0x21')](saveUpdates(_0x259423[_0x4414('0x42')],null))['then'](respondWithResult(_0x52e04e,null))[_0x4414('0x3d')](handleError(_0x52e04e,null));};exports[_0x4414('0x44')]=function(_0x5030ab,_0x5f59d0){return db['OpenchannelApplication']['find']({'where':{'id':_0x5030ab[_0x4414('0x43')]['id']}})[_0x4414('0x21')](handleEntityNotFound(_0x5f59d0,null))[_0x4414('0x21')](removeEntity(_0x5f59d0,null))[_0x4414('0x3d')](handleError(_0x5f59d0,null));};
\ No newline at end of file
index bc9b28c..3e321f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff0a=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4'];(function(_0x48f9f7,_0x50f3f6){var _0x58ea38=function(_0x1fe550){while(--_0x1fe550){_0x48f9f7['push'](_0x48f9f7['shift']());}};_0x58ea38(++_0x50f3f6);}(_0xff0a,0x1a1));var _0xaff0=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xff0a[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xaff0('0x0'));var util=require('util');var logger=require(_0xaff0('0x1'))(_0xaff0('0x2'));var moment=require('moment');var BPromise=require(_0xaff0('0x3'));var rp=require(_0xaff0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaff0('0x5'));var config=require(_0xaff0('0x6'));var attributes=require(_0xaff0('0x7'));module[_0xaff0('0x8')]=function(_0x373eac,_0xd03897){return _0x373eac[_0xaff0('0x9')]('OpenchannelApplication',attributes,{'tableName':_0xaff0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaff0('0xb'),'collate':_0xaff0('0xc')});};
\ No newline at end of file
+var _0x6872=['../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','lodash'];(function(_0x2c34b9,_0x564466){var _0x40f844=function(_0x3da196){while(--_0x3da196){_0x2c34b9['push'](_0x2c34b9['shift']());}};_0x40f844(++_0x564466);}(_0x6872,0x1d5));var _0x2687=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x6872[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x2687('0x0'));var util=require('util');var logger=require(_0x2687('0x1'))(_0x2687('0x2'));var moment=require('moment');var BPromise=require(_0x2687('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2687('0x4'));var config=require(_0x2687('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x2687('0x6')]=function(_0x1ebad8,_0x1d6f0c){return _0x1ebad8[_0x2687('0x7')](_0x2687('0x8'),attributes,{'tableName':_0x2687('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index e246c68..8e0119e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30b5=['attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','UpdateOpenchannelApplication','options','raw','where'];(function(_0x14bd88,_0x52a17a){var _0x52d52a=function(_0x4f0c04){while(--_0x4f0c04){_0x14bd88['push'](_0x14bd88['shift']());}};_0x52d52a(++_0x52a17a);}(_0x30b5,0x16a));var _0x530b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x30b5[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x530b('0x0'));var util=require('util');var moment=require(_0x530b('0x1'));var BPromise=require(_0x530b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x530b('0x3'));var db=require(_0x530b('0x4'))['db'];var utils=require(_0x530b('0x5'));var logger=require(_0x530b('0x6'))('rpc');var config=require(_0x530b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x530b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x291cff,_0x392027,_0x5a286f){return new BPromise(function(_0x429ef8,_0x4acf98){return client['request'](_0x291cff,_0x5a286f)[_0x530b('0x9')](function(_0x2cb7e8){logger[_0x530b('0xa')](_0x530b('0xb'),_0x392027,'request\x20sent');logger[_0x530b('0xc')](_0x530b('0xd'),_0x392027,'request\x20sent',JSON['stringify'](_0x2cb7e8));if(_0x2cb7e8['error']){if(_0x2cb7e8['error']['code']===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x392027,_0x2cb7e8[_0x530b('0xe')]['message']);return _0x4acf98(_0x2cb7e8['error'][_0x530b('0xf')]);}logger[_0x530b('0xe')](_0x530b('0xb'),_0x392027,_0x2cb7e8[_0x530b('0xe')][_0x530b('0xf')]);return _0x429ef8(_0x2cb7e8[_0x530b('0xe')][_0x530b('0xf')]);}else{logger[_0x530b('0xa')](_0x530b('0xb'),_0x392027,_0x530b('0x10'));_0x429ef8(_0x2cb7e8['result'][_0x530b('0xf')]);}})[_0x530b('0x11')](function(_0x3be5b){logger[_0x530b('0xe')](_0x530b('0xb'),_0x392027,_0x3be5b);_0x4acf98(_0x3be5b);});});}exports[_0x530b('0x12')]=function(_0x460529){var _0x41de63=this;return new Promise(function(_0x3487a9,_0x15be86){return db['OpenchannelApplication']['update'](_0x460529['body'],{'raw':_0x460529[_0x530b('0x13')]?_0x460529[_0x530b('0x13')][_0x530b('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x460529[_0x530b('0x13')]?_0x460529[_0x530b('0x13')][_0x530b('0x15')]||null:null,'attributes':_0x460529['options']?_0x460529[_0x530b('0x13')][_0x530b('0x16')]||null:null,'limit':_0x460529[_0x530b('0x13')]?_0x460529[_0x530b('0x13')][_0x530b('0x17')]||null:null})[_0x530b('0x9')](function(_0x4a2346){logger['info'](_0x530b('0x12'),_0x460529);logger['debug'](_0x530b('0x12'),_0x460529,JSON['stringify'](_0x4a2346));_0x3487a9(_0x4a2346);})[_0x530b('0x11')](function(_0x3a1e03){logger['error']('UpdateOpenchannelApplication',_0x3a1e03[_0x530b('0xf')],_0x460529);_0x15be86(_0x41de63[_0x530b('0xe')](0x1f4,_0x3a1e03[_0x530b('0xf')]));});});};
\ No newline at end of file
+var _0x284a=['http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','info','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x5af6d9,_0x5b3d80){var _0x3e5012=function(_0xdf4831){while(--_0xdf4831){_0x5af6d9['push'](_0x5af6d9['shift']());}};_0x3e5012(++_0x5b3d80);}(_0x284a,0x19a));var _0xa284=function(_0x491ef6,_0x2c25fb){_0x491ef6=_0x491ef6-0x0;var _0x146118=_0x284a[_0x491ef6];return _0x146118;};'use strict';var _=require(_0xa284('0x0'));var util=require(_0xa284('0x1'));var moment=require('moment');var BPromise=require(_0xa284('0x2'));var rs=require(_0xa284('0x3'));var fs=require('fs');var Redis=require(_0xa284('0x4'));var db=require(_0xa284('0x5'))['db'];var utils=require(_0xa284('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa284('0x7'));var jayson=require(_0xa284('0x8'));var client=jayson[_0xa284('0x9')][_0xa284('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ef85b,_0x489b1f,_0x4eccb6){return new BPromise(function(_0x4138f2,_0x42f536){return client[_0xa284('0xb')](_0x2ef85b,_0x4eccb6)[_0xa284('0xc')](function(_0x23fc8a){logger['info'](_0xa284('0xd'),_0x489b1f,_0xa284('0xe'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x489b1f,_0xa284('0xe'),JSON[_0xa284('0xf')](_0x23fc8a));if(_0x23fc8a['error']){if(_0x23fc8a[_0xa284('0x10')][_0xa284('0x11')]===0x1f4){logger[_0xa284('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x489b1f,_0x23fc8a['error'][_0xa284('0x12')]);return _0x42f536(_0x23fc8a[_0xa284('0x10')][_0xa284('0x12')]);}logger[_0xa284('0x10')](_0xa284('0xd'),_0x489b1f,_0x23fc8a['error'][_0xa284('0x12')]);return _0x4138f2(_0x23fc8a[_0xa284('0x10')][_0xa284('0x12')]);}else{logger['info'](_0xa284('0xd'),_0x489b1f,_0xa284('0xe'));_0x4138f2(_0x23fc8a[_0xa284('0x13')][_0xa284('0x12')]);}})[_0xa284('0x14')](function(_0x3ae9ac){logger[_0xa284('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x489b1f,_0x3ae9ac);_0x42f536(_0x3ae9ac);});});}exports[_0xa284('0x15')]=function(_0x5c77f0){var _0x445eb4=this;return new Promise(function(_0x17d386,_0x262689){return db[_0xa284('0x16')][_0xa284('0x17')](_0x5c77f0[_0xa284('0x18')],{'raw':_0x5c77f0['options']?_0x5c77f0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c77f0[_0xa284('0x19')]?_0x5c77f0['options'][_0xa284('0x1a')]||null:null,'attributes':_0x5c77f0[_0xa284('0x19')]?_0x5c77f0['options'][_0xa284('0x1b')]||null:null,'limit':_0x5c77f0[_0xa284('0x19')]?_0x5c77f0['options']['limit']||null:null})['then'](function(_0x340a24){logger[_0xa284('0x1c')](_0xa284('0x15'),_0x5c77f0);logger[_0xa284('0x1d')]('UpdateOpenchannelApplication',_0x5c77f0,JSON['stringify'](_0x340a24));_0x17d386(_0x340a24);})['catch'](function(_0x54da39){logger[_0xa284('0x10')](_0xa284('0x15'),_0x54da39[_0xa284('0x12')],_0x5c77f0);_0x262689(_0x445eb4[_0xa284('0x10')](0x1f4,_0x54da39[_0xa284('0x12')]));});});};
\ No newline at end of file
index aa8d9d2..774696a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ff4=['index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','update','openchannelinteraction:destroy','destroy','removeTags','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated'];(function(_0x1d13cb,_0x291bae){var _0x32384f=function(_0x4d49ed){while(--_0x4d49ed){_0x1d13cb['push'](_0x1d13cb['shift']());}};_0x32384f(++_0x291bae);}(_0x7ff4,0x18d));var _0x47ff=function(_0x50edc5,_0x398cab){_0x50edc5=_0x50edc5-0x0;var _0x514768=_0x7ff4[_0x50edc5];return _0x514768;};'use strict';var multer=require('multer');var util=require(_0x47ff('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x47ff('0x1'));var router=express[_0x47ff('0x2')]();var fs_extra=require(_0x47ff('0x3'));var auth=require(_0x47ff('0x4'));var interaction=require(_0x47ff('0x5'));var config=require(_0x47ff('0x6'));var controller=require(_0x47ff('0x7'));router['get']('/',auth[_0x47ff('0x8')](),controller[_0x47ff('0x9')]);router[_0x47ff('0xa')]('/describe',auth[_0x47ff('0x8')](),controller['describe']);router[_0x47ff('0xa')](_0x47ff('0xb'),auth[_0x47ff('0x8')](),controller[_0x47ff('0xc')]);router[_0x47ff('0xa')](_0x47ff('0xd'),auth[_0x47ff('0x8')](),controller[_0x47ff('0xe')]);router[_0x47ff('0xa')](_0x47ff('0xf'),auth[_0x47ff('0x8')](),controller[_0x47ff('0x10')]);router[_0x47ff('0x11')]('/',auth[_0x47ff('0x8')](),controller[_0x47ff('0x12')]);router[_0x47ff('0x11')](_0x47ff('0xd'),auth[_0x47ff('0x8')](),controller[_0x47ff('0x13')]);router[_0x47ff('0x11')](_0x47ff('0x14'),auth[_0x47ff('0x8')](),interaction['tracked'](_0x47ff('0x15'),_0x47ff('0x16')),controller[_0x47ff('0x17')]);router['put'](_0x47ff('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x47ff('0x15'),'openchannelinteraction:update'),controller[_0x47ff('0x18')]);router['delete'](_0x47ff('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x47ff('0x15'),_0x47ff('0x19')),controller[_0x47ff('0x1a')]);router['delete'](_0x47ff('0x14'),auth['isAuthenticated'](),controller[_0x47ff('0x1b')]);module[_0x47ff('0x1c')]=router;
\ No newline at end of file
+var _0x04b2=['../../components/auth/service','../../config/environment','get','index','describe','isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x04b2,0xb4));var _0x204b=function(_0x5c37ed,_0x15f133){_0x5c37ed=_0x5c37ed-0x0;var _0x2c4e9f=_0x04b2[_0x5c37ed];return _0x2c4e9f;};'use strict';var multer=require(_0x204b('0x0'));var util=require(_0x204b('0x1'));var path=require(_0x204b('0x2'));var timeout=require(_0x204b('0x3'));var express=require(_0x204b('0x4'));var router=express[_0x204b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x204b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x204b('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x204b('0x8')]('/',auth['isAuthenticated'](),controller[_0x204b('0x9')]);router[_0x204b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x204b('0xa')]);router[_0x204b('0x8')]('/:id',auth[_0x204b('0xb')](),controller[_0x204b('0xc')]);router[_0x204b('0x8')](_0x204b('0xd'),auth[_0x204b('0xb')](),controller['getMessages']);router[_0x204b('0x8')](_0x204b('0xe'),auth[_0x204b('0xb')](),controller[_0x204b('0xf')]);router[_0x204b('0x10')]('/',auth[_0x204b('0xb')](),controller[_0x204b('0x11')]);router[_0x204b('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0x204b('0x12')]);router[_0x204b('0x10')](_0x204b('0x13'),auth[_0x204b('0xb')](),interaction[_0x204b('0x14')](_0x204b('0x15'),_0x204b('0x16')),controller[_0x204b('0x17')]);router['put'](_0x204b('0x18'),auth['isAuthenticated'](),interaction[_0x204b('0x14')](_0x204b('0x15'),_0x204b('0x19')),controller[_0x204b('0x1a')]);router[_0x204b('0x1b')](_0x204b('0x18'),auth['isAuthenticated'](),interaction[_0x204b('0x14')](_0x204b('0x15'),_0x204b('0x1c')),controller[_0x204b('0x1d')]);router[_0x204b('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x204b('0x1e')]);module['exports']=router;
\ No newline at end of file
index b94a406..53a3f5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x692c=['BOOLEAN','DATE','STRING','ENUM','sequelize','exports'];(function(_0x40c7e8,_0x172c0d){var _0x4dcffa=function(_0x592f46){while(--_0x592f46){_0x40c7e8['push'](_0x40c7e8['shift']());}};_0x4dcffa(++_0x172c0d);}(_0x692c,0x6a));var _0xc692=function(_0x5a3e26,_0x3af242){_0x5a3e26=_0x5a3e26-0x0;var _0x516bdb=_0x692c[_0x5a3e26];return _0x516bdb;};'use strict';var Sequelize=require(_0xc692('0x0'));module[_0xc692('0x1')]={'closed':{'type':Sequelize[_0xc692('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc692('0x3')]},'disposition':{'type':Sequelize[_0xc692('0x4')]},'secondDisposition':{'type':Sequelize[_0xc692('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc692('0x4')]},'read1stAt':{'type':Sequelize[_0xc692('0x3')]},'threadId':{'type':Sequelize[_0xc692('0x4')]},'externalUrl':{'type':Sequelize[_0xc692('0x4')]},'lastMsgAt':{'type':Sequelize[_0xc692('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc692('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xc692('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe096=['STRING','sequelize','exports','BOOLEAN','DATE'];(function(_0x11932b,_0x691165){var _0x30547e=function(_0x2f5641){while(--_0x2f5641){_0x11932b['push'](_0x11932b['shift']());}};_0x30547e(++_0x691165);}(_0xe096,0x13c));var _0x6e09=function(_0x167b19,_0x56081a){_0x167b19=_0x167b19-0x0;var _0x1fcca2=_0xe096[_0x167b19];return _0x1fcca2;};'use strict';var Sequelize=require(_0x6e09('0x0'));module[_0x6e09('0x1')]={'closed':{'type':Sequelize[_0x6e09('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e09('0x3')]},'disposition':{'type':Sequelize[_0x6e09('0x4')]},'secondDisposition':{'type':Sequelize[_0x6e09('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6e09('0x4')]},'note':{'type':Sequelize[_0x6e09('0x4')]},'read1stAt':{'type':Sequelize[_0x6e09('0x3')]},'threadId':{'type':Sequelize[_0x6e09('0x4')]},'externalUrl':{'type':Sequelize[_0x6e09('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6e09('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index b5a5fc2..80efc40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3205=['transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','reject','save','then','error','stack','name','send','map','fullname','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','left_join','cm_contacts','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','rawAttributes','includeAll','merge','options','catch','create','update','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','nolimit','sort','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','emit','openchannelInteractionTags:save','download','unix','join','server','files','tmp','root','attachments','CmContact','firstName','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','createWriteStream','out','System','lastName','renderFile','views'];(function(_0x491ff4,_0x1c83fd){var _0x223621=function(_0x71f8b3){while(--_0x71f8b3){_0x491ff4['push'](_0x491ff4['shift']());}};_0x223621(++_0x1c83fd);}(_0x3205,0x1e4));var _0x5320=function(_0x39aeb2,_0x34a253){_0x39aeb2=_0x39aeb2-0x0;var _0x5c9c15=_0x3205[_0x39aeb2];return _0x5c9c15;};'use strict';var emlformat=require(_0x5320('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5320('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5320('0x2'));var BPromise=require(_0x5320('0x3'));var Mustache=require(_0x5320('0x4'));var util=require(_0x5320('0x5'));var path=require(_0x5320('0x6'));var sox=require(_0x5320('0x7'));var csv=require(_0x5320('0x8'));var ejs=require(_0x5320('0x9'));var fs=require('fs');var fs_extra=require(_0x5320('0xa'));var _=require(_0x5320('0xb'));var squel=require(_0x5320('0xc'));var crypto=require(_0x5320('0xd'));var jsforce=require(_0x5320('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5320('0x8'));var querystring=require(_0x5320('0xf'));var Papa=require(_0x5320('0x10'));var Redis=require(_0x5320('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5320('0x12'));var as=require(_0x5320('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5320('0x14'))(_0x5320('0x15'));var utils=require('../../config/utils');var config=require(_0x5320('0x16'));var licenseUtil=require(_0x5320('0x17'));var db=require(_0x5320('0x18'))['db'];config[_0x5320('0x19')]=_[_0x5320('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5320('0x1b'))(new Redis(config[_0x5320('0x19')]));require(_0x5320('0x1c'))[_0x5320('0x1d')](socket);function respondWithStatusCode(_0x38cf06,_0x5c6c78){_0x5c6c78=_0x5c6c78||0xcc;return function(_0x4e48c3){if(_0x4e48c3){return _0x38cf06[_0x5320('0x1e')](_0x5c6c78);}return _0x38cf06['status'](_0x5c6c78)[_0x5320('0x1f')]();};}function respondWithResult(_0x411da8,_0x55472d){_0x55472d=_0x55472d||0xc8;return function(_0x1f5b63){if(_0x1f5b63){return _0x411da8[_0x5320('0x20')](_0x55472d)['json'](_0x1f5b63);}};}function respondWithFilteredResult(_0x4d2f3f,_0x1255f0){return function(_0x59e8d8){if(_0x59e8d8){var _0x122448=typeof _0x1255f0['offset']===_0x5320('0x21')&&typeof _0x1255f0[_0x5320('0x22')]==='undefined';var _0x3ed97a=_0x59e8d8[_0x5320('0x23')];var _0x2ac40b=_0x122448?0x0:_0x1255f0['offset'];var _0x1ccd1f=_0x122448?_0x59e8d8['count']:_0x1255f0[_0x5320('0x24')]+_0x1255f0[_0x5320('0x22')];var _0x3de80e;if(_0x1ccd1f>=_0x3ed97a){_0x1ccd1f=_0x3ed97a;_0x3de80e=0xc8;}else{_0x3de80e=0xce;}_0x4d2f3f[_0x5320('0x20')](_0x3de80e);return _0x4d2f3f[_0x5320('0x25')]('Content-Range',_0x2ac40b+'-'+_0x1ccd1f+'/'+_0x3ed97a)['json'](_0x59e8d8);}return null;};}function patchUpdates(_0x30e946){return function(_0x37d5df){try{jsonpatch['apply'](_0x37d5df,_0x30e946,!![]);}catch(_0x4f28f5){return BPromise[_0x5320('0x26')](_0x4f28f5);}return _0x37d5df[_0x5320('0x27')]();};}function saveUpdates(_0x3d3888,_0x420454){return function(_0x32cd3a){if(_0x32cd3a){return _0x32cd3a['update'](_0x3d3888)[_0x5320('0x28')](function(_0x2f740d){return _0x2f740d;});}return null;};}function removeEntity(_0x27c4ee,_0x5da60c){return function(_0x8682f2){if(_0x8682f2){return _0x8682f2['destroy']()[_0x5320('0x28')](function(){_0x27c4ee[_0x5320('0x20')](0xcc)[_0x5320('0x1f')]();});}};}function handleEntityNotFound(_0x93bc2a,_0x50d200){return function(_0x3b034c){if(!_0x3b034c){_0x93bc2a[_0x5320('0x1e')](0x194);}return _0x3b034c;};}function handleError(_0x2cd321,_0x472320){_0x472320=_0x472320||0x1f4;return function(_0xc98b14){logger[_0x5320('0x29')](_0xc98b14[_0x5320('0x2a')]);if(_0xc98b14[_0x5320('0x2b')]){delete _0xc98b14[_0x5320('0x2b')];}_0x2cd321[_0x5320('0x20')](_0x472320)[_0x5320('0x2c')](_0xc98b14);};}function getInteractionUsers(_0x3abd9e,_0x4de265){return new BPromise(function(_0x108757,_0x3db73d){try{if(_0x4de265[_0x3abd9e['id']]){_0x3abd9e['Users']=_[_0x5320('0x2d')](_0x4de265[_0x3abd9e['id']],function(_0x1ae0ba){return{'id':_0x1ae0ba['id'],'fullname':_0x1ae0ba[_0x5320('0x2e')]};});}}catch(_0x139d1b){_0x3db73d(_0x139d1b);}_0x108757(_0x3abd9e);});}function getInteractionTags(_0x15f236,_0x3e0453){return new BPromise(function(_0x4b8024,_0x29b5e4){try{if(_0x15f236[_0x5320('0x2f')]){_0x15f236['Tags']=[];_0x15f236[_0x5320('0x2f')][_0x5320('0x30')](',')[_0x5320('0x31')](function(_0xae33a0){_0x15f236[_0x5320('0x32')][_0x5320('0x33')](_0x3e0453[_0xae33a0]);});}delete _0x15f236['TagIds'];}catch(_0x4f484d){_0x29b5e4(_0x4f484d);}_0x4b8024(_0x15f236);});}function updateOpenchannelInteraction(_0x30e5f4,_0x413420,_0x4127a4){return new BPromise(function(_0x2f3302,_0x111156){return getInteractionUsers(_0x30e5f4,_0x4127a4)['then'](function(_0x2ba5bf){return getInteractionTags(_0x2ba5bf,_0x413420);})[_0x5320('0x28')](function(_0x4c3ee4){_0x2f3302(_0x4c3ee4);})['catch'](function(_0x4e4513){_0x111156(_0x4e4513);});});}exports[_0x5320('0x34')]=function(_0x326dc0,_0x266f62){var _0x53ee48={},_0x14f4d4={},_0x54b1a9={'count':0x0,'rows':[]};var _0x230206=_[_0x5320('0x2d')](db[_0x5320('0x35')]['rawAttributes'],function(_0x3f6095){return{'name':_0x3f6095[_0x5320('0x36')],'type':_0x3f6095['type'][_0x5320('0x37')]};});_0x14f4d4[_0x5320('0x38')]=_[_0x5320('0x2d')](_0x230206,'name');_0x14f4d4['query']=_[_0x5320('0x39')](_0x326dc0[_0x5320('0x3a')]);_0x14f4d4[_0x5320('0x3b')]=_[_0x5320('0x3c')](_0x14f4d4[_0x5320('0x38')],_0x14f4d4[_0x5320('0x3a')]);_0x53ee48['attributes']=_[_0x5320('0x3c')](_0x14f4d4['model'],qs[_0x5320('0x3d')](_0x326dc0[_0x5320('0x3a')][_0x5320('0x3d')]));_0x53ee48[_0x5320('0x3e')]=_0x53ee48[_0x5320('0x3e')][_0x5320('0x3f')]?_0x53ee48[_0x5320('0x3e')]:_0x14f4d4[_0x5320('0x38')];if(!_0x326dc0['query'][_0x5320('0x40')]('nolimit')){_0x53ee48['limit']=qs[_0x5320('0x22')](_0x326dc0[_0x5320('0x3a')][_0x5320('0x22')]);_0x53ee48[_0x5320('0x24')]=qs['offset'](_0x326dc0[_0x5320('0x3a')][_0x5320('0x24')]);}_0x53ee48[_0x5320('0x41')]=qs['sort'](_0x326dc0[_0x5320('0x3a')]['sort']);_0x53ee48['where']=qs['filters'](_['pick'](_0x326dc0[_0x5320('0x3a')],_0x14f4d4[_0x5320('0x3b')]),_0x230206);var _0x173e7c=[];var _0x827005=squel['select']()[_0x5320('0x42')]('id')[_0x5320('0x42')](_0x5320('0x2b'))[_0x5320('0x42')](_0x5320('0x43'))[_0x5320('0x44')](_0x5320('0x45'));var _0x921e9f=squel['select']()[_0x5320('0x42')](_0x5320('0x46'))[_0x5320('0x42')](_0x5320('0x47'))['field'](_0x5320('0x48'))['from'](_0x5320('0x49'),'ui')['left_join'](_0x5320('0x4a'),'u',_0x5320('0x4b'));var _0x4c8d32=squel[_0x5320('0x4c')]()[_0x5320('0x44')](_0x5320('0x4d'),'i')[_0x5320('0x4e')](_0x5320('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5320('0x4e')](_0x5320('0x4a'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x5320('0x50'),'a',_0x5320('0x51'))['left_join'](_0x5320('0x52'),'me',_0x5320('0x53'))[_0x5320('0x4e')](_0x5320('0x54'),'it',_0x5320('0x55'))[_0x5320('0x4e')](_0x5320('0x45'),'t',_0x5320('0x56'));var _0x509075=squel[_0x5320('0x57')]();var _0x6542ae=[];var _0x2d1922=squel[_0x5320('0x57')]();var _0x10be38;if(_0x326dc0[_0x5320('0x3a')][_0x5320('0x58')]){_0x10be38=as[_0x5320('0x59')](_0x326dc0[_0x5320('0x3a')][_0x5320('0x58')]);var _0x558e86=_0x10be38[_0x5320('0x5a')];for(var _0x532de4=0x0;_0x532de4<_0x10be38[_0x5320('0x5b')][_0x5320('0x3f')];_0x532de4++){var _0x2ef035=_0x10be38[_0x5320('0x5b')][_0x532de4];var _0x563a5c='i';var _0x99b1a4=_[_0x5320('0x5c')](_0x230206,[_0x5320('0x2b'),_0x2ef035[_0x5320('0x42')]]);if(!_0x99b1a4){switch(_0x2ef035[_0x5320('0x42')]){case'unreadMessages':if(_0x2ef035[_0x5320('0x5d')]==0x1){_0x4c8d32[_0x5320('0x5e')]('`'+_0x2ef035['field']+_0x5320('0x5f'));}else{_0x4c8d32[_0x5320('0x5e')]('`'+_0x2ef035[_0x5320('0x42')]+_0x5320('0x60'));}break;case _0x5320('0x61'):if(_0x2ef035[_0x5320('0x62')]===_0x5320('0x63')){if(_0x2ef035[_0x5320('0x5d')][_0x5320('0x30')]('\x20')['length']>0x1){_0x509075[_0x558e86](_0x5320('0x64'),qs[_0x5320('0x65')](_0x2ef035[_0x5320('0x5d')]),null);}else{var _0x54878b='%'+_0x2ef035[_0x5320('0x5d')]+'%';_0x509075[_0x558e86](_0x5320('0x66'),_0x54878b,_0x54878b,_0x54878b);}}else{_0x99b1a4=_['find'](_0x230206,['name',_0x5320('0x67')]);_0x2ef035['field']=_0x5320('0x67');_0x329d7f=as[_0x5320('0x68')](_0x563a5c,_0x99b1a4[_0x5320('0x69')],_0x2ef035);_0x509075[_0x558e86](_0x329d7f[_0x5320('0x6a')],_0x329d7f[_0x5320('0x5d')][_0x5320('0x6b')],_0x329d7f[_0x5320('0x5d')][_0x5320('0x1f')]);}break;case'Tag':var _0x4f8b8e=_0x2ef035[_0x5320('0x5d')][_0x5320('0x30')](',')[_0x5320('0x2d')](function(_0x3bad22){return Number(_0x3bad22);});_0x4f8b8e[_0x5320('0x31')](function(_0x5e7a42){_0x2d1922['or'](_0x5320('0x6c'),'%,'+_0x5e7a42+',%');});_0x6542ae=_[_0x5320('0x6d')](_0x6542ae,_0x4f8b8e);break;case _0x5320('0x6e'):if(_0x2ef035[_0x5320('0x62')]===_0x5320('0x63')){_0x509075[_0x558e86](_0x5320('0x6f'),'%'+_0x2ef035[_0x5320('0x5d')]+'%',null);}else{_0x99b1a4=_['find'](_0x230206,['name',_0x5320('0x70')]);_0x2ef035[_0x5320('0x42')]=_0x5320('0x70');_0x329d7f=as[_0x5320('0x68')](_0x563a5c,_0x99b1a4[_0x5320('0x69')],_0x2ef035);_0x509075[_0x558e86](_0x329d7f[_0x5320('0x6a')],_0x329d7f['value']['start'],_0x329d7f['value'][_0x5320('0x1f')]);}break;case _0x5320('0x71'):_0x329d7f=as['buildExpression']('me',null,_0x2ef035);_0x509075[_0x558e86](_0x329d7f[_0x5320('0x6a')],_0x329d7f[_0x5320('0x5d')][_0x5320('0x6b')],_0x329d7f[_0x5320('0x5d')]['end']);break;}}else{var _0x329d7f=as[_0x5320('0x68')](_0x563a5c,_0x99b1a4[_0x5320('0x69')],_0x2ef035);_0x509075[_0x558e86](_0x329d7f[_0x5320('0x6a')],_0x329d7f[_0x5320('0x5d')]['start'],_0x329d7f[_0x5320('0x5d')][_0x5320('0x1f')]);}}}else{var _0x42fb7f=_(_0x326dc0[_0x5320('0x3a')])[_0x5320('0x39')]()[_0x5320('0x2d')](function(_0x37e19c){return _[_0x5320('0x72')](_0x230206,[_0x5320('0x2b'),_0x37e19c])?_0x37e19c:undefined;})[_0x5320('0x73')]()[_0x5320('0x5d')]();if(!_[_0x5320('0x74')](_0x42fb7f)){_0x42fb7f[_0x5320('0x31')](function(_0x404ddc){if(_0x404ddc===_0x5320('0x75')){_0x4c8d32['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x5320('0x76')](_0x326dc0[_0x5320('0x3a')][_0x404ddc]));}else if(_0x404ddc===_0x5320('0x77')){var _0xdc12b4=JSON[_0x5320('0x78')](_0x326dc0[_0x5320('0x3a')][_0x404ddc])[_0x5320('0x79')];var _0x54a66f=JSON['parse'](_0x326dc0[_0x5320('0x3a')][_0x404ddc])[_0x5320('0x7a')];_0x4c8d32['where'](_0x5320('0x7b'),_0xdc12b4,_0x54a66f);}else{if(_0x326dc0[_0x5320('0x3a')][_0x404ddc]===_0x5320('0x7c')){_0x4c8d32[_0x5320('0x7d')]('i.'+_0x404ddc+_0x5320('0x7e'));}else{_0x4c8d32[_0x5320('0x7d')]('i.'+_0x404ddc+_0x5320('0x7f'),_0x326dc0[_0x5320('0x3a')][_0x404ddc]);}}});}if(_0x326dc0['query'][_0x5320('0x80')]){if(_0x326dc0[_0x5320('0x3a')][_0x5320('0x80')]==0x1){_0x4c8d32[_0x5320('0x5e')](_0x5320('0x81'));}else{_0x4c8d32[_0x5320('0x5e')](_0x5320('0x82'));}}if(_0x326dc0[_0x5320('0x3a')][_0x5320('0x83')]){_0x6542ae=_[_0x5320('0x84')](_0x326dc0['query'][_0x5320('0x83')])?_0x326dc0[_0x5320('0x3a')][_0x5320('0x83')]:new Array(_0x326dc0[_0x5320('0x3a')][_0x5320('0x83')]);_0x6542ae[_0x5320('0x31')](function(_0x3656aa){_0x2d1922['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3656aa+',%');});}if(_0x326dc0['query'][_0x5320('0x85')]){var _0x2ef68d=_0x326dc0['query'][_0x5320('0x85')][_0x5320('0x86')]('\x5c','\x5c\x5c')[_0x5320('0x86')](/'/g,'\x27\x27');if(qs[_0x5320('0x87')](_0x2ef68d)){_0x509075['or'](_0x5320('0x88'),_0x2ef68d+'%');}else{_0x509075['or'](_0x5320('0x89'),qs[_0x5320('0x65')](_0x2ef68d))['or']('i.from\x20LIKE\x20?',_0x2ef68d+'%')['or'](_0x5320('0x8a'),_0x2ef68d+'%');}}}_0x4c8d32[_0x5320('0x7d')](_0x509075);_0x4c8d32['group'](_0x5320('0x8b'));var _0x389dbc={'type':db[_0x5320('0x8c')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5c7485=_0x4c8d32['clone']();_0x5c7485[_0x5320('0x42')](_0x5320('0x8b'));_0x5c7485[_0x5320('0x42')](_0x5320('0x8d'),_0x5320('0x8e'));if(_0x53ee48[_0x5320('0x41')]){_0x53ee48['order'][_0x5320('0x31')](function(_0x46545e){var _0x54a27a=_0x46545e[0x0]===_0x5320('0x8f')?_0x46545e[0x0]:'i.'+_0x46545e[0x0];_0x4c8d32[_0x5320('0x41')](_0x54a27a,_0x46545e[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x6542ae)){_0x4c8d32[_0x5320('0x5e')](_0x2d1922);_0x5c7485[_0x5320('0x7d')]('t.id\x20IN\x20?',_0x6542ae);}BPromise['resolve']()[_0x5320('0x28')](function(){if(!_0x10be38){if(_0x326dc0[_0x5320('0x3a')][_0x5320('0x75')])return;_0x5c7485[_0x5320('0x7d')](_0x5320('0x90'));_0x4c8d32[_0x5320('0x7d')](_0x5320('0x90'));return;}if(_0x326dc0[_0x5320('0x91')]['role']!==_0x5320('0x92'))return;return _0x326dc0['user'][_0x5320('0x93')]({'attributes':['id'],'raw':!![]})[_0x5320('0x28')](function(_0x3c5428){if(_[_0x5320('0x74')](_0x3c5428)){_0x5c7485[_0x5320('0x7d')](_0x5320('0x94'));_0x4c8d32[_0x5320('0x7d')](_0x5320('0x94'));}else{_0x5c7485[_0x5320('0x7d')](_0x5320('0x95'),_['map'](_0x3c5428,'id'));_0x4c8d32[_0x5320('0x7d')](_0x5320('0x95'),_['map'](_0x3c5428,'id'));}});})['then'](function(){if(_0x326dc0[_0x5320('0x91')]['role']==='agent'&&!_0x10be38&&!_0x326dc0[_0x5320('0x3a')]['OpenchannelAccountId'])return[];return db[_0x5320('0x96')][_0x5320('0x3a')](_0x5c7485['toString'](),_0x389dbc);})[_0x5320('0x28')](function(_0x2e0a56){_0x54b1a9[_0x5320('0x23')]=_0x2e0a56[_0x5320('0x3f')];if(_0x54b1a9[_0x5320('0x23')]===0x0)return[];return db[_0x5320('0x96')]['query'](_0x827005[_0x5320('0x97')](),_0x389dbc)['then'](function(_0x913079){_0x173e7c=_[_0x5320('0x98')](_0x913079,'id');_0x389dbc=_['merge'](_0x389dbc,{'model':db[_0x5320('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x326dc0[_0x5320('0x3a')]['fields']){_0x53ee48[_0x5320('0x3e')][_0x5320('0x31')](function(_0x23676d){_0x4c8d32[_0x5320('0x42')]('i.'+_0x23676d);});}else{_0x4c8d32[_0x5320('0x42')](_0x5320('0x8d'),'unreadMessages');_0x4c8d32['field'](_0x5320('0x99'),_0x5320('0x9a'));_0x4c8d32[_0x5320('0x42')](_0x5320('0x9b'),_0x5320('0x9c'));_0x4c8d32['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x5320('0x8f'));_0x4c8d32[_0x5320('0x42')](_0x5320('0x9d'));_0x4c8d32[_0x5320('0x42')](_0x5320('0x9e'),'Contact.firstName');_0x4c8d32[_0x5320('0x42')]('c.lastName',_0x5320('0x9f'));_0x4c8d32[_0x5320('0x42')](_0x5320('0xa0'),'Contact.email');_0x4c8d32['field'](_0x5320('0xa1'),_0x5320('0xa2'));_0x4c8d32[_0x5320('0x42')](_0x5320('0xa3'),'Contact.mobile');_0x4c8d32[_0x5320('0x42')](_0x5320('0xa4'),_0x5320('0xa5'));_0x4c8d32[_0x5320('0x42')](_0x5320('0xa6'),'Owner.fullname');_0x4c8d32[_0x5320('0x42')]('o.internal',_0x5320('0xa7'));_0x4c8d32[_0x5320('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x53ee48[_0x5320('0x22')])_0x4c8d32['limit'](_0x53ee48['limit']);if(_0x53ee48['offset'])_0x4c8d32['offset'](_0x53ee48['offset']);return db['sequelize'][_0x5320('0x3a')](_0x4c8d32[_0x5320('0x97')](),_0x389dbc);})[_0x5320('0x28')](function(_0x314a28){if(_0x314a28[_0x5320('0x3f')]>0x0)_0x921e9f['where'](_0x5320('0xa8'),_['map'](_0x314a28,'id'));return db[_0x5320('0x96')][_0x5320('0x3a')](_0x921e9f[_0x5320('0x97')](),_0x389dbc)[_0x5320('0x28')](function(_0x3d7a65){var _0x5be6ad=_[_0x5320('0xa9')](_0x3d7a65,_0x5320('0xaa'));var _0x5bb718=[];_0x314a28[_0x5320('0x31')](function(_0x255355){_0x5bb718[_0x5320('0x33')](updateOpenchannelInteraction(_0x255355,_0x173e7c,_0x5be6ad));});return BPromise[_0x5320('0xab')](_0x5bb718);});});})[_0x5320('0x28')](function(_0x5c22ff){_0x54b1a9[_0x5320('0xac')]=_0x5c22ff;return _0x54b1a9;})['then'](respondWithFilteredResult(_0x266f62,_0x53ee48))['catch'](handleError(_0x266f62,null));};exports['show']=function(_0x442f5e,_0x19d173){var _0x5d0be5={};if(_0x442f5e[_0x5320('0x3a')][_0x5320('0x69')]&&_0x442f5e['query']['type']===_0x5320('0x44')){_0x5d0be5[_0x5320('0x44')]=_0x442f5e['params']['id'];}else{_0x5d0be5['id']=_0x442f5e[_0x5320('0xad')]['id'];}var _0x3dbdd0={'raw':![],'where':_0x5d0be5},_0x33a525={};_0x33a525[_0x5320('0x38')]=_[_0x5320('0x39')](db['OpenchannelInteraction'][_0x5320('0xae')]);_0x33a525[_0x5320('0x3a')]=_[_0x5320('0x39')](_0x442f5e[_0x5320('0x3a')]);_0x33a525[_0x5320('0x3b')]=_[_0x5320('0x3c')](_0x33a525[_0x5320('0x38')],_0x33a525['query']);_0x3dbdd0['attributes']=_[_0x5320('0x3c')](_0x33a525['model'],qs[_0x5320('0x3d')](_0x442f5e[_0x5320('0x3a')][_0x5320('0x3d')]));_0x3dbdd0[_0x5320('0x3e')]=_0x3dbdd0['attributes'][_0x5320('0x3f')]?_0x3dbdd0[_0x5320('0x3e')]:_0x33a525[_0x5320('0x38')];if(_0x442f5e[_0x5320('0x3a')][_0x5320('0xaf')]){_0x3dbdd0['include']=[{'all':!![]}];}_0x3dbdd0=_[_0x5320('0xb0')]({},_0x3dbdd0,_0x442f5e[_0x5320('0xb1')]);return db['OpenchannelInteraction'][_0x5320('0x5c')](_0x3dbdd0)['then'](handleEntityNotFound(_0x19d173,null))[_0x5320('0x28')](respondWithResult(_0x19d173,null))[_0x5320('0xb2')](handleError(_0x19d173,null));};exports[_0x5320('0xb3')]=function(_0x1364cc,_0x43b806){return db[_0x5320('0x35')][_0x5320('0xb3')](_0x1364cc['body'],{})[_0x5320('0x28')](respondWithResult(_0x43b806,0xc9))['catch'](handleError(_0x43b806,null));};exports[_0x5320('0xb4')]=function(_0xb0d19b,_0x140691){if(_0xb0d19b[_0x5320('0x71')]['id']){delete _0xb0d19b[_0x5320('0x71')]['id'];}return db['OpenchannelInteraction'][_0x5320('0x5c')]({'where':{'id':_0xb0d19b['params']['id']}})['then'](handleEntityNotFound(_0x140691,null))[_0x5320('0x28')](saveUpdates(_0xb0d19b[_0x5320('0x71')],null))[_0x5320('0x28')](respondWithResult(_0x140691,null))[_0x5320('0xb2')](handleError(_0x140691,null));};exports[_0x5320('0xb5')]=function(_0x121981,_0x14f13b){return db[_0x5320('0x35')][_0x5320('0x5c')]({'where':{'id':_0x121981[_0x5320('0xad')]['id']}})['then'](handleEntityNotFound(_0x14f13b,null))[_0x5320('0x28')](removeEntity(_0x14f13b,null))[_0x5320('0xb2')](handleError(_0x14f13b,null));};exports['describe']=function(_0x7eeb5b,_0x5e391b){return db[_0x5320('0x35')][_0x5320('0xb6')]()['then'](respondWithResult(_0x5e391b,null))[_0x5320('0xb2')](handleError(_0x5e391b,null));};exports[_0x5320('0xb7')]=function(_0xb786,_0x1e4718,_0x2fc40f){return db[_0x5320('0xb8')][_0x5320('0x5c')]({'where':{'id':_0xb786[_0x5320('0xad')]['id']}})[_0x5320('0x28')](handleEntityNotFound(_0x1e4718,null))['then'](function(_0x2ba9d5){if(_0x2ba9d5){return _0x2ba9d5[_0x5320('0xb7')](_0xb786[_0x5320('0x71')][_0x5320('0xb9')],_['omit'](_0xb786[_0x5320('0x71')],[_0x5320('0xb9'),'id'])||{});}})[_0x5320('0x28')](respondWithResult(_0x1e4718,null))['catch'](handleError(_0x1e4718,null));};exports[_0x5320('0xba')]=function(_0x3f12b8,_0xffc35a,_0x543f43){var _0xbf2c65={'raw':![],'where':{}};var _0x27513b={};var _0x367328={'count':0x0,'rows':[]};return db[_0x5320('0x35')][_0x5320('0xbb')]({'where':{'id':_0x3f12b8[_0x5320('0xad')]['id']}})['then'](handleEntityNotFound(_0xffc35a,null))[_0x5320('0x28')](function(_0x503564){if(_0x503564){_0x27513b[_0x5320('0x38')]=_['keys'](db[_0x5320('0xb8')][_0x5320('0xae')]);_0x27513b[_0x5320('0x3a')]=_[_0x5320('0x39')](_0x3f12b8['query']);_0x27513b['filters']=_[_0x5320('0x3c')](_0x27513b[_0x5320('0x38')],_0x27513b[_0x5320('0x3a')]);_0xbf2c65['attributes']=_[_0x5320('0x3c')](_0x27513b['model'],qs['fields'](_0x3f12b8[_0x5320('0x3a')][_0x5320('0x3d')]));_0xbf2c65[_0x5320('0x3e')]=_0xbf2c65[_0x5320('0x3e')][_0x5320('0x3f')]?_0xbf2c65['attributes']:_0x27513b[_0x5320('0x38')];if(!_0x3f12b8[_0x5320('0x3a')][_0x5320('0x40')](_0x5320('0xbc'))){_0xbf2c65[_0x5320('0x22')]=qs['limit'](_0x3f12b8[_0x5320('0x3a')][_0x5320('0x22')]);_0xbf2c65[_0x5320('0x24')]=qs['offset'](_0x3f12b8['query'][_0x5320('0x24')]);}_0xbf2c65[_0x5320('0x41')]=qs[_0x5320('0xbd')](_0x3f12b8['query'][_0x5320('0xbd')]);_0xbf2c65['where']=qs[_0x5320('0x3b')](_[_0x5320('0xbe')](_0x3f12b8[_0x5320('0x3a')],_0x27513b[_0x5320('0x3b')]));_0xbf2c65[_0x5320('0x7d')][_0x5320('0xaa')]=_0x503564['id'];if(_0x3f12b8[_0x5320('0x3a')][_0x5320('0x85')]){_0xbf2c65[_0x5320('0x7d')]=_[_0x5320('0xb0')](_0xbf2c65[_0x5320('0x7d')],{'$or':_['map'](_0xbf2c65[_0x5320('0x3e')],function(_0x5e39c1){var _0x219c54={};_0x219c54[_0x5e39c1]={'$like':'%'+_0x3f12b8['query'][_0x5320('0x85')]+'%'};return _0x219c54;})});}if(_0x3f12b8['query']['$gte']){var _0x3b607b=_0x3f12b8[_0x5320('0x3a')][_0x5320('0x79')][_0x5320('0x30')](',');var _0x3d3417={};_0x3d3417[_0x3b607b[0x0]]={'$gte':moment(_0x3b607b[0x1])[_0x5320('0xbf')](_0x5320('0xc0'))};_0xbf2c65['where']=_['merge'](_0xbf2c65['where'],_0x3d3417);}_0xbf2c65=_[_0x5320('0xb0')]({},_0xbf2c65,_0x3f12b8[_0x5320('0xb1')]);return db[_0x5320('0xb8')][_0x5320('0x23')]({'where':_0xbf2c65[_0x5320('0x7d')]})['then'](function(_0x21d96e){_0x367328['count']=_0x21d96e;if(_0x3f12b8['query'][_0x5320('0xaf')]){_0xbf2c65['include']=[{'all':!![]}];}return db[_0x5320('0xb8')][_0x5320('0xc1')](_0xbf2c65);})[_0x5320('0x28')](function(_0x19b723){_0x367328[_0x5320('0xac')]=_0x19b723;return _0x367328;});}})[_0x5320('0x28')](respondWithFilteredResult(_0xffc35a,_0xbf2c65))[_0x5320('0xb2')](handleError(_0xffc35a,null));};exports[_0x5320('0xc2')]=function(_0x1d5f44,_0x4bc456,_0x17e0a0){return db[_0x5320('0x35')][_0x5320('0x5c')]({'where':{'id':_0x1d5f44[_0x5320('0xad')]['id']}})['then'](handleEntityNotFound(_0x4bc456,null))[_0x5320('0x28')](function(_0xfa90f4){if(_0xfa90f4){return _0xfa90f4[_0x5320('0xc3')](_0x1d5f44[_0x5320('0x71')][_0x5320('0xb9')],_['omit'](_0x1d5f44[_0x5320('0x71')],[_0x5320('0xb9'),'id'])||{})['spread'](function(){return db[_0x5320('0xc4')][_0x5320('0xc1')]({'attributes':['id',_0x5320('0x2b'),_0x5320('0x43')],'where':{'id':_0x1d5f44['body']['ids']}});})['then'](function(_0x45f8bf){socket[_0x5320('0xc5')](_0x5320('0xc6'),{'id':Number(_0x1d5f44['params']['id']),'tags':_0x45f8bf||[]});return{'id':Number(_0x1d5f44[_0x5320('0xad')]['id']),'tags':_0x45f8bf||[]};});}})[_0x5320('0x28')](respondWithResult(_0x4bc456,null))[_0x5320('0xb2')](handleError(_0x4bc456,null));};exports['removeTags']=function(_0x3c09e9,_0x43d9c9,_0x1de073){return db['OpenchannelInteraction'][_0x5320('0x5c')]({'where':{'id':_0x3c09e9[_0x5320('0xad')]['id']}})[_0x5320('0x28')](handleEntityNotFound(_0x43d9c9,null))[_0x5320('0x28')](function(_0x2f4a67){if(_0x2f4a67){return _0x2f4a67['removeTags'](_0x3c09e9['query']['ids']);}})[_0x5320('0x28')](respondWithStatusCode(_0x43d9c9,null))[_0x5320('0xb2')](handleError(_0x43d9c9,null));};exports[_0x5320('0xc7')]=function(_0x12592c,_0x99fa66){var _0x2848bc=moment()[_0x5320('0xc8')]()[_0x5320('0x97')]();var _0x78af01=path[_0x5320('0xc9')](config['root'],_0x5320('0xca'),_0x5320('0xcb'),_0x5320('0xcc'));var _0xdffef6=path[_0x5320('0xc9')](config[_0x5320('0xcd')],_0x5320('0xca'),'files',_0x5320('0xce'));var _0x2b58cb=path[_0x5320('0xc9')](_0x78af01,_0x2848bc);var _0x3f0c23=util[_0x5320('0xbf')]('transcript-%d-%s.zip',_0x12592c[_0x5320('0xad')]['id'],_0x2848bc);var _0x269ea5=path[_0x5320('0xc9')](_0x78af01,_0x3f0c23);var _0xaf3bd=[];_0xaf3bd[_0x5320('0x33')]({'model':db[_0x5320('0x6e')],'as':_0x5320('0x6e'),'attributes':['id',_0x5320('0x2e')],'raw':!![]});_0xaf3bd[_0x5320('0x33')]({'model':db[_0x5320('0xcf')],'as':_0x5320('0x61'),'attributes':['id',_0x5320('0xd0'),'lastName'],'raw':!![]});if(_0x12592c[_0x5320('0x3a')][_0x5320('0xce')]){_0xaf3bd[_0x5320('0x33')]({'model':db['Attachment'],'as':_0x5320('0xd1'),'raw':!![]});}var _0x326767=[{'model':db[_0x5320('0xb8')],'as':_0x5320('0xd2'),'attributes':['id',_0x5320('0x71'),'createdAt',_0x5320('0xd3'),_0x5320('0xd4'),_0x5320('0x80')],'include':_0xaf3bd}];_0x326767[_0x5320('0x33')]({'model':db[_0x5320('0xd5')],'as':'Account','attributes':['id',_0x5320('0x2b')]});_0x326767['push']({'model':db[_0x5320('0x6e')],'as':_0x5320('0xd6'),'attributes':['id',_0x5320('0x2e')]});return db[_0x5320('0x35')]['find']({'where':{'id':_0x12592c[_0x5320('0xad')]['id']},'include':_0x326767})[_0x5320('0x28')](handleEntityNotFound(_0x99fa66,null))['then'](function(_0x379ad4){if(_0x379ad4){var _0x2de03a=_0x379ad4[_0x5320('0xd7')]({'plain':!![]});fs[_0x5320('0xd8')](_0x2b58cb);var _0x3e7d24={'channel':_0x5320('0xd9'),'account':_0x2de03a[_0x5320('0xda')][_0x5320('0x2b')],'agent':_0x2de03a['Owner']?_0x2de03a['Owner'][_0x5320('0x2e')]:_0x5320('0xdb'),'createdAt':moment(_0x2de03a[_0x5320('0x77')])[_0x5320('0xbf')](_0x5320('0xc0'))[_0x5320('0x97')](),'closedAt':_0x2de03a['closed']?moment(_0x2de03a[_0x5320('0xdc')])[_0x5320('0xbf')](_0x5320('0xc0'))[_0x5320('0x97')]():'','disposition':_0x2de03a[_0x5320('0xdd')],'visibility':_0x2de03a[_0x5320('0xde')]?'Public':_0x5320('0xdf'),'messages':_(_0x2de03a[_0x5320('0xd2')])[_0x5320('0x85')]({'secret':![]})[_0x5320('0x2d')](function(_0x204a90){if(_0x204a90['Attachment']){var _0x268d23=path['join'](_0xdffef6,_0x204a90['Attachment'][_0x5320('0xe0')]);if(fs[_0x5320('0xe1')](_0x268d23)){fs[_0x5320('0xe2')](_0x268d23)['pipe'](fs[_0x5320('0xe3')](path[_0x5320('0xc9')](_0x2b58cb,_0x204a90[_0x5320('0xd1')][_0x5320('0xe0')])));}}return{'date':moment(_0x204a90[_0x5320('0x77')])[_0x5320('0xbf')](_0x5320('0xc0'))['toString'](),'sender':_0x204a90[_0x5320('0xd3')]===_0x5320('0xe4')?_0x204a90['User']?_0x204a90[_0x5320('0x6e')]['fullname']:_0x5320('0xe5'):_0x204a90[_0x5320('0x61')]['firstName']+(_0x204a90['Contact'][_0x5320('0xe6')]?'\x20'+_0x204a90[_0x5320('0x61')][_0x5320('0xe6')]:''),'body':_0x204a90[_0x5320('0xd1')]?_0x204a90[_0x5320('0xd1')]['basename']:_0x204a90[_0x5320('0x71')],'direction':_0x204a90['direction']===_0x5320('0xe4')?'A':'C','secret':_0x204a90[_0x5320('0xd4')],'read':_0x204a90['read'],'attachment':_0x204a90['Attachment']};})['value']()};return ejs[_0x5320('0xe7')](path[_0x5320('0xc9')](config[_0x5320('0xcd')],'server',_0x5320('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x3e7d24})[_0x5320('0x28')](function(_0x54041d){var _0x553878=path[_0x5320('0xc9')](_0x2b58cb,_0x5320('0xe9')+_0x2de03a['id']+'-'+_0x2848bc+_0x5320('0xea'));var _0x48b3e2={'path':_0x553878,'channel':_0x5320('0xd9'),'interactionId':_0x2de03a['id']};return pdf[_0x5320('0xeb')](_0x54041d,_0x48b3e2);})[_0x5320('0x28')](function(){return new BPromise(function(_0x1cb9d8,_0x511e2c){zipdir(_0x2b58cb,{'saveTo':_0x269ea5},function(_0x3b6f19,_0x196b6c){if(_0x3b6f19)return _0x511e2c(_0x3b6f19);return _0x1cb9d8(_0x196b6c);});})[_0x5320('0x28')](function(){return new BPromise(function(_0x4ed7a5,_0x77ad07){rimraf(_0x2b58cb,function(_0x38cff0){if(_0x38cff0)_0x77ad07(_0x38cff0);return _0x4ed7a5();});});})[_0x5320('0x28')](function(){return _0x99fa66[_0x5320('0xc7')](_0x269ea5,_0x3f0c23,function(_0x20cee0){if(_0x20cee0){console[_0x5320('0xec')](_0x5320('0xed'),_0x20cee0);}else{fs[_0x5320('0xee')](_0x269ea5);}});});});}else{return _0x99fa66['sendStatus'](0xc8);}})['catch'](handleError(_0x99fa66,null));};
\ No newline at end of file
+var _0x830e=['fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','Tags','TagIds','split','push','catch','OpenchannelInteraction','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','select','tools_tags','field','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','params','rawAttributes','includeAll','include','options','create','body','describe','OpenchannelMessage','addMessage','ids','omit','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','root','server','tmp','files','attachments','transcript-%d-%s.zip','join','CmContact','lastName','Attachment','Messages','direction','secret','Account','User','Owner','fullname','Openchannel','closed','closedAt','disposition','threadId','Public','Private','basename','pipe','createWriteStream','System','out','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x1a57f6,_0x1e2042){var _0x43c28d=function(_0x338d6f){while(--_0x338d6f){_0x1a57f6['push'](_0x1a57f6['shift']());}};_0x43c28d(++_0x1e2042);}(_0x830e,0x1c4));var _0xe830=function(_0x874735,_0x2cc436){_0x874735=_0x874735-0x0;var _0xa46579=_0x830e[_0x874735];return _0xa46579;};'use strict';var emlformat=require(_0xe830('0x0'));var rimraf=require(_0xe830('0x1'));var zipdir=require(_0xe830('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe830('0x3'));var moment=require(_0xe830('0x4'));var BPromise=require(_0xe830('0x5'));var Mustache=require(_0xe830('0x6'));var util=require(_0xe830('0x7'));var path=require(_0xe830('0x8'));var sox=require(_0xe830('0x9'));var csv=require(_0xe830('0xa'));var ejs=require(_0xe830('0xb'));var fs=require('fs');var fs_extra=require(_0xe830('0xc'));var _=require(_0xe830('0xd'));var squel=require(_0xe830('0xe'));var crypto=require('crypto');var jsforce=require(_0xe830('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe830('0xa'));var querystring=require(_0xe830('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe830('0x11'));var qs=require(_0xe830('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe830('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe830('0x14'));var db=require(_0xe830('0x15'))['db'];config[_0xe830('0x16')]=_[_0xe830('0x17')](config[_0xe830('0x16')],{'host':_0xe830('0x18'),'port':0x18eb});var socket=require(_0xe830('0x19'))(new Redis(config['redis']));require(_0xe830('0x1a'))[_0xe830('0x1b')](socket);function respondWithStatusCode(_0x26d100,_0x3dcfdb){_0x3dcfdb=_0x3dcfdb||0xcc;return function(_0x3adc98){if(_0x3adc98){return _0x26d100[_0xe830('0x1c')](_0x3dcfdb);}return _0x26d100[_0xe830('0x1d')](_0x3dcfdb)[_0xe830('0x1e')]();};}function respondWithResult(_0x516e88,_0x3ff9a1){_0x3ff9a1=_0x3ff9a1||0xc8;return function(_0x191ef){if(_0x191ef){return _0x516e88[_0xe830('0x1d')](_0x3ff9a1)[_0xe830('0x1f')](_0x191ef);}};}function respondWithFilteredResult(_0x107b4c,_0x31df83){return function(_0x5617f9){if(_0x5617f9){var _0xfe665c=typeof _0x31df83[_0xe830('0x20')]==='undefined'&&typeof _0x31df83[_0xe830('0x21')]===_0xe830('0x22');var _0x5950e2=_0x5617f9[_0xe830('0x23')];var _0x4d501b=_0xfe665c?0x0:_0x31df83[_0xe830('0x20')];var _0x4f4382=_0xfe665c?_0x5617f9['count']:_0x31df83[_0xe830('0x20')]+_0x31df83['limit'];var _0x214764;if(_0x4f4382>=_0x5950e2){_0x4f4382=_0x5950e2;_0x214764=0xc8;}else{_0x214764=0xce;}_0x107b4c[_0xe830('0x1d')](_0x214764);return _0x107b4c[_0xe830('0x24')](_0xe830('0x25'),_0x4d501b+'-'+_0x4f4382+'/'+_0x5950e2)[_0xe830('0x1f')](_0x5617f9);}return null;};}function patchUpdates(_0x3dbfe1){return function(_0x1d5913){try{jsonpatch[_0xe830('0x26')](_0x1d5913,_0x3dbfe1,!![]);}catch(_0x4427f3){return BPromise['reject'](_0x4427f3);}return _0x1d5913[_0xe830('0x27')]();};}function saveUpdates(_0x2e50be,_0x17119d){return function(_0x3f7f16){if(_0x3f7f16){return _0x3f7f16[_0xe830('0x28')](_0x2e50be)[_0xe830('0x29')](function(_0x2dc20e){return _0x2dc20e;});}return null;};}function removeEntity(_0x4f0564,_0x17c36f){return function(_0x16f2e3){if(_0x16f2e3){return _0x16f2e3[_0xe830('0x2a')]()[_0xe830('0x29')](function(){_0x4f0564['status'](0xcc)[_0xe830('0x1e')]();});}};}function handleEntityNotFound(_0x54b400,_0xb16ce0){return function(_0x33ac57){if(!_0x33ac57){_0x54b400['sendStatus'](0x194);}return _0x33ac57;};}function handleError(_0x29e546,_0x4ad6a9){_0x4ad6a9=_0x4ad6a9||0x1f4;return function(_0x3b229d){logger[_0xe830('0x2b')](_0x3b229d[_0xe830('0x2c')]);if(_0x3b229d[_0xe830('0x2d')]){delete _0x3b229d[_0xe830('0x2d')];}_0x29e546[_0xe830('0x1d')](_0x4ad6a9)[_0xe830('0x2e')](_0x3b229d);};}function getInteractionUsers(_0xb2ffe0,_0x4a9d9c){return new BPromise(function(_0x58867d,_0xfd5acb){try{if(_0x4a9d9c[_0xb2ffe0['id']]){_0xb2ffe0[_0xe830('0x2f')]=_[_0xe830('0x30')](_0x4a9d9c[_0xb2ffe0['id']],function(_0x5643bc){return{'id':_0x5643bc['id'],'fullname':_0x5643bc['fullname']};});}}catch(_0x5ec428){_0xfd5acb(_0x5ec428);}_0x58867d(_0xb2ffe0);});}function getInteractionTags(_0x4f020f,_0x12fde1){return new BPromise(function(_0x3cbdc0,_0x1c46a7){try{if(_0x4f020f['TagIds']){_0x4f020f[_0xe830('0x31')]=[];_0x4f020f[_0xe830('0x32')][_0xe830('0x33')](',')['forEach'](function(_0x2d7734){_0x4f020f[_0xe830('0x31')][_0xe830('0x34')](_0x12fde1[_0x2d7734]);});}delete _0x4f020f['TagIds'];}catch(_0x1e263a){_0x1c46a7(_0x1e263a);}_0x3cbdc0(_0x4f020f);});}function updateOpenchannelInteraction(_0x5243e1,_0x14da9d,_0x3623e1){return new BPromise(function(_0x58bcd5,_0x50e1ba){return getInteractionUsers(_0x5243e1,_0x3623e1)[_0xe830('0x29')](function(_0x1f6c42){return getInteractionTags(_0x1f6c42,_0x14da9d);})[_0xe830('0x29')](function(_0x10cf50){_0x58bcd5(_0x10cf50);})[_0xe830('0x35')](function(_0x1c555c){_0x50e1ba(_0x1c555c);});});}exports['index']=function(_0x43b61c,_0x4f8425){var _0x5030d6={},_0x2800b6={},_0x54ee49={'count':0x0,'rows':[]};var _0x57a659=_[_0xe830('0x30')](db[_0xe830('0x36')]['rawAttributes'],function(_0x5045ff){return{'name':_0x5045ff['fieldName'],'type':_0x5045ff[_0xe830('0x37')][_0xe830('0x38')]};});_0x2800b6[_0xe830('0x39')]=_[_0xe830('0x30')](_0x57a659,_0xe830('0x2d'));_0x2800b6['query']=_[_0xe830('0x3a')](_0x43b61c['query']);_0x2800b6[_0xe830('0x3b')]=_[_0xe830('0x3c')](_0x2800b6[_0xe830('0x39')],_0x2800b6[_0xe830('0x3d')]);_0x5030d6[_0xe830('0x3e')]=_[_0xe830('0x3c')](_0x2800b6[_0xe830('0x39')],qs['fields'](_0x43b61c['query'][_0xe830('0x3f')]));_0x5030d6['attributes']=_0x5030d6[_0xe830('0x3e')][_0xe830('0x40')]?_0x5030d6[_0xe830('0x3e')]:_0x2800b6[_0xe830('0x39')];if(!_0x43b61c[_0xe830('0x3d')][_0xe830('0x41')]('nolimit')){_0x5030d6[_0xe830('0x21')]=qs[_0xe830('0x21')](_0x43b61c[_0xe830('0x3d')]['limit']);_0x5030d6[_0xe830('0x20')]=qs['offset'](_0x43b61c[_0xe830('0x3d')][_0xe830('0x20')]);}_0x5030d6['order']=qs[_0xe830('0x42')](_0x43b61c[_0xe830('0x3d')]['sort']);_0x5030d6[_0xe830('0x43')]=qs[_0xe830('0x3b')](_[_0xe830('0x44')](_0x43b61c[_0xe830('0x3d')],_0x2800b6['filters']),_0x57a659);var _0x3ad8f0=[];var _0x1c4340=squel[_0xe830('0x45')]()['field']('id')['field'](_0xe830('0x2d'))['field']('color')['from'](_0xe830('0x46'));var _0x36e4a9=squel[_0xe830('0x45')]()[_0xe830('0x47')]('u.id')[_0xe830('0x47')](_0xe830('0x48'))[_0xe830('0x47')](_0xe830('0x49'))[_0xe830('0x4a')](_0xe830('0x4b'),'ui')[_0xe830('0x4c')](_0xe830('0x4d'),'u',_0xe830('0x4e'));var _0x12a37c=squel[_0xe830('0x45')]()[_0xe830('0x4a')](_0xe830('0x4f'),'i')[_0xe830('0x4c')](_0xe830('0x50'),'c',_0xe830('0x51'))[_0xe830('0x4c')](_0xe830('0x4d'),'o','o.id\x20=\x20i.UserId')[_0xe830('0x4c')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0xe830('0x4c')](_0xe830('0x52'),'me',_0xe830('0x53'))[_0xe830('0x4c')](_0xe830('0x54'),'it',_0xe830('0x55'))[_0xe830('0x4c')](_0xe830('0x46'),'t',_0xe830('0x56'));var _0x9bb8f6=squel['expr']();var _0x139c69=[];var _0x47e17d=squel[_0xe830('0x57')]();var _0x498a64;if(_0x43b61c[_0xe830('0x3d')]['search']){_0x498a64=as[_0xe830('0x58')](_0x43b61c[_0xe830('0x3d')][_0xe830('0x59')]);var _0x1fa7a2=_0x498a64[_0xe830('0x5a')];for(var _0x2e75bc=0x0;_0x2e75bc<_0x498a64['conditions'][_0xe830('0x40')];_0x2e75bc++){var _0x18aa15=_0x498a64['conditions'][_0x2e75bc];var _0x3c8b6a='i';var _0x5c9b54=_[_0xe830('0x5b')](_0x57a659,[_0xe830('0x2d'),_0x18aa15['field']]);if(!_0x5c9b54){switch(_0x18aa15['field']){case _0xe830('0x5c'):if(_0x18aa15[_0xe830('0x5d')]==0x1){_0x12a37c[_0xe830('0x5e')]('`'+_0x18aa15[_0xe830('0x47')]+'`\x20=\x200');}else{_0x12a37c[_0xe830('0x5e')]('`'+_0x18aa15['field']+_0xe830('0x5f'));}break;case _0xe830('0x60'):if(_0x18aa15['operator']===_0xe830('0x61')){if(_0x18aa15[_0xe830('0x5d')][_0xe830('0x33')]('\x20')[_0xe830('0x40')]>0x1){_0x9bb8f6[_0x1fa7a2](_0xe830('0x62'),qs['getFullTextValue'](_0x18aa15['value']),null);}else{var _0x29e02e='%'+_0x18aa15[_0xe830('0x5d')]+'%';_0x9bb8f6[_0x1fa7a2](_0xe830('0x63'),_0x29e02e,_0x29e02e,_0x29e02e);}}else{_0x5c9b54=_[_0xe830('0x5b')](_0x57a659,[_0xe830('0x2d'),_0xe830('0x64')]);_0x18aa15[_0xe830('0x47')]=_0xe830('0x64');_0x489c75=as[_0xe830('0x65')](_0x3c8b6a,_0x5c9b54['type'],_0x18aa15);_0x9bb8f6[_0x1fa7a2](_0x489c75[_0xe830('0x66')],_0x489c75[_0xe830('0x5d')][_0xe830('0x67')],_0x489c75[_0xe830('0x5d')][_0xe830('0x1e')]);}break;case _0xe830('0x68'):var _0x459894=_0x18aa15[_0xe830('0x5d')][_0xe830('0x33')](',')['map'](function(_0x172dcd){return Number(_0x172dcd);});_0x459894[_0xe830('0x69')](function(_0x65694a){_0x47e17d['or'](_0xe830('0x6a'),'%,'+_0x65694a+',%');});_0x139c69=_[_0xe830('0x6b')](_0x139c69,_0x459894);break;case'User':if(_0x18aa15['operator']===_0xe830('0x61')){_0x9bb8f6[_0x1fa7a2](_0xe830('0x6c'),'%'+_0x18aa15[_0xe830('0x5d')]+'%',null);}else{_0x5c9b54=_[_0xe830('0x5b')](_0x57a659,['name',_0xe830('0x6d')]);_0x18aa15[_0xe830('0x47')]='UserId';_0x489c75=as[_0xe830('0x65')](_0x3c8b6a,_0x5c9b54[_0xe830('0x37')],_0x18aa15);_0x9bb8f6[_0x1fa7a2](_0x489c75[_0xe830('0x66')],_0x489c75[_0xe830('0x5d')][_0xe830('0x67')],_0x489c75[_0xe830('0x5d')][_0xe830('0x1e')]);}break;case'body':_0x489c75=as[_0xe830('0x65')]('me',null,_0x18aa15);_0x9bb8f6[_0x1fa7a2](_0x489c75['text'],_0x489c75[_0xe830('0x5d')]['start'],_0x489c75[_0xe830('0x5d')]['end']);break;}}else{var _0x489c75=as[_0xe830('0x65')](_0x3c8b6a,_0x5c9b54[_0xe830('0x37')],_0x18aa15);_0x9bb8f6[_0x1fa7a2](_0x489c75['text'],_0x489c75[_0xe830('0x5d')][_0xe830('0x67')],_0x489c75[_0xe830('0x5d')]['end']);}}}else{var _0x23420c=_(_0x43b61c['query'])[_0xe830('0x3a')]()[_0xe830('0x30')](function(_0x24a4eb){return _[_0xe830('0x6e')](_0x57a659,[_0xe830('0x2d'),_0x24a4eb])?_0x24a4eb:undefined;})[_0xe830('0x6f')]()['value']();if(!_[_0xe830('0x70')](_0x23420c)){_0x23420c[_0xe830('0x69')](function(_0xe42b25){if(_0xe42b25==='OpenchannelAccountId'){_0x12a37c[_0xe830('0x43')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xe830('0x71')](_0x43b61c['query'][_0xe42b25]));}else if(_0xe42b25===_0xe830('0x72')){var _0x589244=JSON[_0xe830('0x73')](_0x43b61c[_0xe830('0x3d')][_0xe42b25])[_0xe830('0x74')];var _0x2487a6=JSON[_0xe830('0x73')](_0x43b61c[_0xe830('0x3d')][_0xe42b25])[_0xe830('0x75')];_0x12a37c[_0xe830('0x43')](_0xe830('0x76'),_0x589244,_0x2487a6);}else{if(_0x43b61c[_0xe830('0x3d')][_0xe42b25]==='null'){_0x12a37c[_0xe830('0x43')]('i.'+_0xe42b25+_0xe830('0x77'));}else{_0x12a37c['where']('i.'+_0xe42b25+_0xe830('0x78'),_0x43b61c[_0xe830('0x3d')][_0xe42b25]);}}});}if(_0x43b61c[_0xe830('0x3d')][_0xe830('0x79')]){if(_0x43b61c[_0xe830('0x3d')][_0xe830('0x79')]==0x1){_0x12a37c['having'](_0xe830('0x7a'));}else{_0x12a37c[_0xe830('0x5e')](_0xe830('0x7b'));}}if(_0x43b61c[_0xe830('0x3d')][_0xe830('0x7c')]){_0x139c69=_['isArray'](_0x43b61c['query'][_0xe830('0x7c')])?_0x43b61c[_0xe830('0x3d')][_0xe830('0x7c')]:new Array(_0x43b61c[_0xe830('0x3d')][_0xe830('0x7c')]);_0x139c69[_0xe830('0x69')](function(_0x3d19ab){_0x47e17d['or'](_0xe830('0x6a'),'%,'+_0x3d19ab+',%');});}if(_0x43b61c[_0xe830('0x3d')][_0xe830('0x7d')]){var _0x218cf1=_0x43b61c[_0xe830('0x3d')]['filter'][_0xe830('0x7e')]('\x5c','\x5c\x5c')[_0xe830('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x218cf1)){_0x9bb8f6['or'](_0xe830('0x7f'),_0x218cf1+'%');}else{_0x9bb8f6['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe830('0x80')](_0x218cf1))['or'](_0xe830('0x81'),_0x218cf1+'%')['or'](_0xe830('0x82'),_0x218cf1+'%');}}}_0x12a37c['where'](_0x9bb8f6);_0x12a37c[_0xe830('0x83')]('i.id');var _0x5e4bb0={'type':db[_0xe830('0x84')]['QueryTypes'][_0xe830('0x85')],'raw':!![]};var _0x5ac7c7=_0x12a37c[_0xe830('0x86')]();_0x5ac7c7[_0xe830('0x47')](_0xe830('0x87'));_0x5ac7c7[_0xe830('0x47')](_0xe830('0x88'),'unreadMessages');if(_0x5030d6[_0xe830('0x89')]){_0x5030d6['order']['forEach'](function(_0x3ae61e){var _0x542545=_0x3ae61e[0x0]==='contactName'?_0x3ae61e[0x0]:'i.'+_0x3ae61e[0x0];_0x12a37c[_0xe830('0x89')](_0x542545,_0x3ae61e[0x1]===_0xe830('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x139c69)){_0x12a37c[_0xe830('0x5e')](_0x47e17d);_0x5ac7c7[_0xe830('0x43')]('t.id\x20IN\x20?',_0x139c69);}BPromise[_0xe830('0x8b')]()[_0xe830('0x29')](function(){if(!_0x498a64){if(_0x43b61c[_0xe830('0x3d')][_0xe830('0x8c')])return;_0x5ac7c7[_0xe830('0x43')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x12a37c[_0xe830('0x43')](_0xe830('0x8d'));return;}if(_0x43b61c['user'][_0xe830('0x8e')]!==_0xe830('0x8f'))return;return _0x43b61c[_0xe830('0x90')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xe830('0x29')](function(_0x5884b4){if(_[_0xe830('0x70')](_0x5884b4)){_0x5ac7c7[_0xe830('0x43')](_0xe830('0x91'));_0x12a37c[_0xe830('0x43')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5ac7c7[_0xe830('0x43')](_0xe830('0x92'),_[_0xe830('0x30')](_0x5884b4,'id'));_0x12a37c['where'](_0xe830('0x92'),_['map'](_0x5884b4,'id'));}});})['then'](function(){if(_0x43b61c[_0xe830('0x90')]['role']===_0xe830('0x8f')&&!_0x498a64&&!_0x43b61c[_0xe830('0x3d')][_0xe830('0x8c')])return[];return db[_0xe830('0x93')]['query'](_0x5ac7c7[_0xe830('0x94')](),_0x5e4bb0);})['then'](function(_0xd5abf1){_0x54ee49['count']=_0xd5abf1[_0xe830('0x40')];if(_0x54ee49[_0xe830('0x23')]===0x0)return[];return db[_0xe830('0x93')][_0xe830('0x3d')](_0x1c4340[_0xe830('0x94')](),_0x5e4bb0)[_0xe830('0x29')](function(_0xe3f22a){_0x3ad8f0=_[_0xe830('0x95')](_0xe3f22a,'id');_0x5e4bb0=_[_0xe830('0x96')](_0x5e4bb0,{'model':db[_0xe830('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43b61c[_0xe830('0x3d')][_0xe830('0x3f')]){_0x5030d6['attributes'][_0xe830('0x69')](function(_0x118973){_0x12a37c[_0xe830('0x47')]('i.'+_0x118973);});}else{_0x12a37c[_0xe830('0x47')](_0xe830('0x88'),_0xe830('0x5c'));_0x12a37c[_0xe830('0x47')](_0xe830('0x97'),_0xe830('0x98'));_0x12a37c[_0xe830('0x47')](_0xe830('0x99'),'Account.mandatoryDisposition');_0x12a37c[_0xe830('0x47')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xe830('0x9a'));_0x12a37c['field'](_0xe830('0x9b'));_0x12a37c[_0xe830('0x47')](_0xe830('0x9c'),_0xe830('0x9d'));_0x12a37c['field']('c.lastName','Contact.lastName');_0x12a37c['field'](_0xe830('0x9e'),'Contact.email');_0x12a37c[_0xe830('0x47')](_0xe830('0x9f'),'Contact.phone');_0x12a37c[_0xe830('0x47')](_0xe830('0xa0'),'Contact.mobile');_0x12a37c[_0xe830('0x47')](_0xe830('0xa1'),_0xe830('0xa2'));_0x12a37c[_0xe830('0x47')](_0xe830('0xa3'),_0xe830('0xa4'));_0x12a37c['field'](_0xe830('0xa5'),_0xe830('0xa6'));_0x12a37c['field'](_0xe830('0xa7'),_0xe830('0x32'));}if(_0x5030d6[_0xe830('0x21')])_0x12a37c['limit'](_0x5030d6[_0xe830('0x21')]);if(_0x5030d6[_0xe830('0x20')])_0x12a37c[_0xe830('0x20')](_0x5030d6[_0xe830('0x20')]);return db[_0xe830('0x93')]['query'](_0x12a37c[_0xe830('0x94')](),_0x5e4bb0);})[_0xe830('0x29')](function(_0x30a028){if(_0x30a028[_0xe830('0x40')]>0x0)_0x36e4a9[_0xe830('0x43')](_0xe830('0xa8'),_['map'](_0x30a028,'id'));return db[_0xe830('0x93')][_0xe830('0x3d')](_0x36e4a9[_0xe830('0x94')](),_0x5e4bb0)[_0xe830('0x29')](function(_0x4d806b){var _0x5985e8=_[_0xe830('0xa9')](_0x4d806b,_0xe830('0xaa'));var _0x5836e3=[];_0x30a028[_0xe830('0x69')](function(_0x502e74){_0x5836e3[_0xe830('0x34')](updateOpenchannelInteraction(_0x502e74,_0x3ad8f0,_0x5985e8));});return BPromise['all'](_0x5836e3);});});})[_0xe830('0x29')](function(_0x4ebdf4){_0x54ee49[_0xe830('0xab')]=_0x4ebdf4;return _0x54ee49;})['then'](respondWithFilteredResult(_0x4f8425,_0x5030d6))['catch'](handleError(_0x4f8425,null));};exports['show']=function(_0x4876ca,_0x5542b8){var _0x1850d6={};if(_0x4876ca[_0xe830('0x3d')][_0xe830('0x37')]&&_0x4876ca[_0xe830('0x3d')]['type']==='from'){_0x1850d6[_0xe830('0x4a')]=_0x4876ca[_0xe830('0xac')]['id'];}else{_0x1850d6['id']=_0x4876ca['params']['id'];}var _0x1c9641={'raw':![],'where':_0x1850d6},_0x2331d5={};_0x2331d5['model']=_[_0xe830('0x3a')](db[_0xe830('0x36')][_0xe830('0xad')]);_0x2331d5[_0xe830('0x3d')]=_[_0xe830('0x3a')](_0x4876ca[_0xe830('0x3d')]);_0x2331d5[_0xe830('0x3b')]=_['intersection'](_0x2331d5['model'],_0x2331d5['query']);_0x1c9641[_0xe830('0x3e')]=_[_0xe830('0x3c')](_0x2331d5[_0xe830('0x39')],qs[_0xe830('0x3f')](_0x4876ca[_0xe830('0x3d')][_0xe830('0x3f')]));_0x1c9641['attributes']=_0x1c9641['attributes'][_0xe830('0x40')]?_0x1c9641[_0xe830('0x3e')]:_0x2331d5[_0xe830('0x39')];if(_0x4876ca[_0xe830('0x3d')][_0xe830('0xae')]){_0x1c9641[_0xe830('0xaf')]=[{'all':!![]}];}_0x1c9641=_[_0xe830('0x96')]({},_0x1c9641,_0x4876ca[_0xe830('0xb0')]);return db['OpenchannelInteraction'][_0xe830('0x5b')](_0x1c9641)[_0xe830('0x29')](handleEntityNotFound(_0x5542b8,null))[_0xe830('0x29')](respondWithResult(_0x5542b8,null))['catch'](handleError(_0x5542b8,null));};exports[_0xe830('0xb1')]=function(_0x21196d,_0x37a52a){return db[_0xe830('0x36')][_0xe830('0xb1')](_0x21196d['body'],{})[_0xe830('0x29')](respondWithResult(_0x37a52a,0xc9))[_0xe830('0x35')](handleError(_0x37a52a,null));};exports[_0xe830('0x28')]=function(_0x55ec0d,_0xe8f88b){if(_0x55ec0d[_0xe830('0xb2')]['id']){delete _0x55ec0d[_0xe830('0xb2')]['id'];}return db[_0xe830('0x36')][_0xe830('0x5b')]({'where':{'id':_0x55ec0d[_0xe830('0xac')]['id']}})[_0xe830('0x29')](handleEntityNotFound(_0xe8f88b,null))[_0xe830('0x29')](saveUpdates(_0x55ec0d[_0xe830('0xb2')],null))[_0xe830('0x29')](respondWithResult(_0xe8f88b,null))[_0xe830('0x35')](handleError(_0xe8f88b,null));};exports['destroy']=function(_0x2c820e,_0x1fab72){return db[_0xe830('0x36')][_0xe830('0x5b')]({'where':{'id':_0x2c820e[_0xe830('0xac')]['id']}})[_0xe830('0x29')](handleEntityNotFound(_0x1fab72,null))['then'](removeEntity(_0x1fab72,null))[_0xe830('0x35')](handleError(_0x1fab72,null));};exports[_0xe830('0xb3')]=function(_0x5d5718,_0x8e6dd8){return db['OpenchannelInteraction'][_0xe830('0xb3')]()['then'](respondWithResult(_0x8e6dd8,null))[_0xe830('0x35')](handleError(_0x8e6dd8,null));};exports['addMessage']=function(_0x2578e6,_0x42d1a2,_0x3df338){return db[_0xe830('0xb4')][_0xe830('0x5b')]({'where':{'id':_0x2578e6[_0xe830('0xac')]['id']}})['then'](handleEntityNotFound(_0x42d1a2,null))[_0xe830('0x29')](function(_0x4413f8){if(_0x4413f8){return _0x4413f8[_0xe830('0xb5')](_0x2578e6['body'][_0xe830('0xb6')],_[_0xe830('0xb7')](_0x2578e6[_0xe830('0xb2')],['ids','id'])||{});}})[_0xe830('0x29')](respondWithResult(_0x42d1a2,null))[_0xe830('0x35')](handleError(_0x42d1a2,null));};exports['getMessages']=function(_0x4f44a6,_0x1acc57,_0x3e53de){var _0x193d53={'raw':![],'where':{}};var _0x177402={};var _0x3cc09a={'count':0x0,'rows':[]};return db[_0xe830('0x36')][_0xe830('0xb8')]({'where':{'id':_0x4f44a6['params']['id']}})[_0xe830('0x29')](handleEntityNotFound(_0x1acc57,null))[_0xe830('0x29')](function(_0x5898b0){if(_0x5898b0){_0x177402[_0xe830('0x39')]=_[_0xe830('0x3a')](db['OpenchannelMessage'][_0xe830('0xad')]);_0x177402[_0xe830('0x3d')]=_[_0xe830('0x3a')](_0x4f44a6[_0xe830('0x3d')]);_0x177402[_0xe830('0x3b')]=_[_0xe830('0x3c')](_0x177402[_0xe830('0x39')],_0x177402[_0xe830('0x3d')]);_0x193d53[_0xe830('0x3e')]=_[_0xe830('0x3c')](_0x177402['model'],qs[_0xe830('0x3f')](_0x4f44a6[_0xe830('0x3d')][_0xe830('0x3f')]));_0x193d53[_0xe830('0x3e')]=_0x193d53['attributes'][_0xe830('0x40')]?_0x193d53[_0xe830('0x3e')]:_0x177402[_0xe830('0x39')];if(!_0x4f44a6['query'][_0xe830('0x41')](_0xe830('0xb9'))){_0x193d53[_0xe830('0x21')]=qs[_0xe830('0x21')](_0x4f44a6[_0xe830('0x3d')][_0xe830('0x21')]);_0x193d53['offset']=qs[_0xe830('0x20')](_0x4f44a6[_0xe830('0x3d')][_0xe830('0x20')]);}_0x193d53['order']=qs[_0xe830('0x42')](_0x4f44a6['query'][_0xe830('0x42')]);_0x193d53['where']=qs[_0xe830('0x3b')](_[_0xe830('0x44')](_0x4f44a6[_0xe830('0x3d')],_0x177402[_0xe830('0x3b')]));_0x193d53[_0xe830('0x43')][_0xe830('0xaa')]=_0x5898b0['id'];if(_0x4f44a6[_0xe830('0x3d')][_0xe830('0x7d')]){_0x193d53['where']=_[_0xe830('0x96')](_0x193d53[_0xe830('0x43')],{'$or':_[_0xe830('0x30')](_0x193d53['attributes'],function(_0x35a9a9){var _0x217c11={};_0x217c11[_0x35a9a9]={'$like':'%'+_0x4f44a6['query']['filter']+'%'};return _0x217c11;})});}if(_0x4f44a6[_0xe830('0x3d')][_0xe830('0x74')]){var _0x8ec295=_0x4f44a6[_0xe830('0x3d')][_0xe830('0x74')][_0xe830('0x33')](',');var _0x3971ed={};_0x3971ed[_0x8ec295[0x0]]={'$gte':moment(_0x8ec295[0x1])[_0xe830('0xba')](_0xe830('0xbb'))};_0x193d53[_0xe830('0x43')]=_[_0xe830('0x96')](_0x193d53['where'],_0x3971ed);}_0x193d53=_[_0xe830('0x96')]({},_0x193d53,_0x4f44a6[_0xe830('0xb0')]);return db['OpenchannelMessage'][_0xe830('0x23')]({'where':_0x193d53[_0xe830('0x43')]})[_0xe830('0x29')](function(_0x4718b0){_0x3cc09a[_0xe830('0x23')]=_0x4718b0;if(_0x4f44a6['query'][_0xe830('0xae')]){_0x193d53['include']=[{'all':!![]}];}return db[_0xe830('0xb4')][_0xe830('0xbc')](_0x193d53);})[_0xe830('0x29')](function(_0xb4341e){_0x3cc09a['rows']=_0xb4341e;return _0x3cc09a;});}})[_0xe830('0x29')](respondWithFilteredResult(_0x1acc57,_0x193d53))[_0xe830('0x35')](handleError(_0x1acc57,null));};exports['addTags']=function(_0x1c7887,_0x171b7f,_0x2039df){return db[_0xe830('0x36')][_0xe830('0x5b')]({'where':{'id':_0x1c7887['params']['id']}})[_0xe830('0x29')](handleEntityNotFound(_0x171b7f,null))[_0xe830('0x29')](function(_0x3049a5){if(_0x3049a5){return _0x3049a5[_0xe830('0xbd')](_0x1c7887['body'][_0xe830('0xb6')],_[_0xe830('0xb7')](_0x1c7887[_0xe830('0xb2')],[_0xe830('0xb6'),'id'])||{})[_0xe830('0xbe')](function(){return db[_0xe830('0x68')][_0xe830('0xbc')]({'attributes':['id',_0xe830('0x2d'),_0xe830('0xbf')],'where':{'id':_0x1c7887[_0xe830('0xb2')][_0xe830('0xb6')]}});})['then'](function(_0x582183){socket[_0xe830('0xc0')](_0xe830('0xc1'),{'id':Number(_0x1c7887[_0xe830('0xac')]['id']),'tags':_0x582183||[]});return{'id':Number(_0x1c7887[_0xe830('0xac')]['id']),'tags':_0x582183||[]};});}})[_0xe830('0x29')](respondWithResult(_0x171b7f,null))[_0xe830('0x35')](handleError(_0x171b7f,null));};exports['removeTags']=function(_0x5b79eb,_0x50010b,_0x1277f7){return db[_0xe830('0x36')][_0xe830('0x5b')]({'where':{'id':_0x5b79eb[_0xe830('0xac')]['id']}})[_0xe830('0x29')](handleEntityNotFound(_0x50010b,null))['then'](function(_0x54b164){if(_0x54b164){return _0x54b164[_0xe830('0xc2')](_0x5b79eb[_0xe830('0x3d')][_0xe830('0xb6')]);}})[_0xe830('0x29')](respondWithStatusCode(_0x50010b,null))[_0xe830('0x35')](handleError(_0x50010b,null));};exports[_0xe830('0xc3')]=function(_0x5d755a,_0x3180bc){var _0x18d66d=moment()['unix']()[_0xe830('0x94')]();var _0x4bad55=path['join'](config[_0xe830('0xc4')],_0xe830('0xc5'),'files',_0xe830('0xc6'));var _0x1eb184=path['join'](config[_0xe830('0xc4')],_0xe830('0xc5'),_0xe830('0xc7'),_0xe830('0xc8'));var _0x99ffca=path['join'](_0x4bad55,_0x18d66d);var _0x32d4cf=util['format'](_0xe830('0xc9'),_0x5d755a[_0xe830('0xac')]['id'],_0x18d66d);var _0xa14720=path[_0xe830('0xca')](_0x4bad55,_0x32d4cf);var _0x1a4de1=[];_0x1a4de1['push']({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1a4de1[_0xe830('0x34')]({'model':db[_0xe830('0xcb')],'as':'Contact','attributes':['id','firstName',_0xe830('0xcc')],'raw':!![]});if(_0x5d755a[_0xe830('0x3d')]['attachments']){_0x1a4de1['push']({'model':db[_0xe830('0xcd')],'as':_0xe830('0xcd'),'raw':!![]});}var _0x41b4fb=[{'model':db[_0xe830('0xb4')],'as':_0xe830('0xce'),'attributes':['id',_0xe830('0xb2'),_0xe830('0x72'),_0xe830('0xcf'),_0xe830('0xd0'),_0xe830('0x79')],'include':_0x1a4de1}];_0x41b4fb['push']({'model':db['OpenchannelAccount'],'as':_0xe830('0xd1'),'attributes':['id',_0xe830('0x2d')]});_0x41b4fb['push']({'model':db[_0xe830('0xd2')],'as':_0xe830('0xd3'),'attributes':['id',_0xe830('0xd4')]});return db[_0xe830('0x36')][_0xe830('0x5b')]({'where':{'id':_0x5d755a[_0xe830('0xac')]['id']},'include':_0x41b4fb})[_0xe830('0x29')](handleEntityNotFound(_0x3180bc,null))[_0xe830('0x29')](function(_0x3ecfc1){if(_0x3ecfc1){var _0x4334e4=_0x3ecfc1['get']({'plain':!![]});fs['mkdirSync'](_0x99ffca);var _0x2861df={'channel':_0xe830('0xd5'),'account':_0x4334e4[_0xe830('0xd1')][_0xe830('0x2d')],'agent':_0x4334e4[_0xe830('0xd3')]?_0x4334e4[_0xe830('0xd3')][_0xe830('0xd4')]:'N.A.','createdAt':moment(_0x4334e4[_0xe830('0x72')])[_0xe830('0xba')](_0xe830('0xbb'))[_0xe830('0x94')](),'closedAt':_0x4334e4[_0xe830('0xd6')]?moment(_0x4334e4[_0xe830('0xd7')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe830('0x94')]():'','disposition':_0x4334e4[_0xe830('0xd8')],'visibility':_0x4334e4[_0xe830('0xd9')]?_0xe830('0xda'):_0xe830('0xdb'),'messages':_(_0x4334e4[_0xe830('0xce')])[_0xe830('0x7d')]({'secret':![]})[_0xe830('0x30')](function(_0x1d56f8){if(_0x1d56f8[_0xe830('0xcd')]){var _0x477cde=path['join'](_0x1eb184,_0x1d56f8['Attachment'][_0xe830('0xdc')]);if(fs['existsSync'](_0x477cde)){fs['createReadStream'](_0x477cde)[_0xe830('0xdd')](fs[_0xe830('0xde')](path[_0xe830('0xca')](_0x99ffca,_0x1d56f8[_0xe830('0xcd')][_0xe830('0xdc')])));}}return{'date':moment(_0x1d56f8['createdAt'])[_0xe830('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe830('0x94')](),'sender':_0x1d56f8['direction']==='out'?_0x1d56f8[_0xe830('0xd2')]?_0x1d56f8[_0xe830('0xd2')][_0xe830('0xd4')]:_0xe830('0xdf'):_0x1d56f8[_0xe830('0x60')]['firstName']+(_0x1d56f8[_0xe830('0x60')]['lastName']?'\x20'+_0x1d56f8['Contact']['lastName']:''),'body':_0x1d56f8['Attachment']?_0x1d56f8[_0xe830('0xcd')][_0xe830('0xdc')]:_0x1d56f8[_0xe830('0xb2')],'direction':_0x1d56f8[_0xe830('0xcf')]===_0xe830('0xe0')?'A':'C','secret':_0x1d56f8[_0xe830('0xd0')],'read':_0x1d56f8[_0xe830('0x79')],'attachment':_0x1d56f8[_0xe830('0xcd')]};})[_0xe830('0x5d')]()};return ejs['renderFile'](path[_0xe830('0xca')](config[_0xe830('0xc4')],_0xe830('0xc5'),_0xe830('0xe1'),_0xe830('0xe2')),{'interaction':_0x2861df})[_0xe830('0x29')](function(_0x16b89f){var _0x215be0=path['join'](_0x99ffca,'transcript-'+_0x4334e4['id']+'-'+_0x18d66d+_0xe830('0xe3'));var _0x154336={'path':_0x215be0,'channel':_0xe830('0xd5'),'interactionId':_0x4334e4['id']};return pdf[_0xe830('0xe4')](_0x16b89f,_0x154336);})[_0xe830('0x29')](function(){return new BPromise(function(_0xbf588b,_0x1ec589){zipdir(_0x99ffca,{'saveTo':_0xa14720},function(_0x312b0d,_0x2247b0){if(_0x312b0d)return _0x1ec589(_0x312b0d);return _0xbf588b(_0x2247b0);});})[_0xe830('0x29')](function(){return new BPromise(function(_0x5b9b9b,_0x445fc1){rimraf(_0x99ffca,function(_0x527d3a){if(_0x527d3a)_0x445fc1(_0x527d3a);return _0x5b9b9b();});});})[_0xe830('0x29')](function(){return _0x3180bc[_0xe830('0xc3')](_0xa14720,_0x32d4cf,function(_0x19e1a2){if(_0x19e1a2){console[_0xe830('0xe5')](_0xe830('0xe6'),_0x19e1a2);}else{fs[_0xe830('0xe7')](_0xa14720);}});});});}else{return _0x3180bc[_0xe830('0x1c')](0xc8);}})[_0xe830('0x35')](handleError(_0x3180bc,null));};
\ No newline at end of file
index 1117590..f75c244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e31=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction'];(function(_0x3e2e2a,_0x46ca63){var _0x49a0b3=function(_0x314cc2){while(--_0x314cc2){_0x3e2e2a['push'](_0x3e2e2a['shift']());}};_0x49a0b3(++_0x46ca63);}(_0x3e31,0x156));var _0x13e3=function(_0x250dce,_0x4e3e2d){_0x250dce=_0x250dce-0x0;var _0x3ec78f=_0x3e31[_0x250dce];return _0x3ec78f;};'use strict';var EventEmitter=require(_0x13e3('0x0'));var OpenchannelInteraction=require(_0x13e3('0x1'))['db'][_0x13e3('0x2')];var OpenchannelMessage=require(_0x13e3('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x13e3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x13e3('0x4'),'afterDestroy':_0x13e3('0x5')};function emitEvent(_0x55413f){return function(_0xbc9d5c,_0x1ea484,_0x4db071){_0xbc9d5c[_0x13e3('0x6')]({'attributes':['id'],'raw':!![]})[_0x13e3('0x7')](function(_0x316456){_0xbc9d5c[_0x13e3('0x8')](_0x13e3('0x9'),_0x316456['map'](function(_0x3c93b4){return{'id':_0x3c93b4['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0xbc9d5c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x13e3('0x7')](function(_0x29db0c){_0xbc9d5c[_0x13e3('0x8')](_0x13e3('0xa'),_0x29db0c['length']);OpenchannelInteractionEvents[_0x13e3('0xb')](_0x55413f+':'+_0xbc9d5c['id'],_0xbc9d5c);OpenchannelInteractionEvents[_0x13e3('0xb')](_0x55413f,_0xbc9d5c);_0x4db071(null);})['catch'](_0x4db071(null));};}for(var e in events){if(events[_0x13e3('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x13e3('0xd')](e,emitEvent(event));}}module[_0x13e3('0xe')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x09a8=['OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09a8,0x19d));var _0x809a=function(_0x29cfc3,_0x59cdc9){_0x29cfc3=_0x29cfc3-0x0;var _0x363869=_0x09a8[_0x29cfc3];return _0x363869;};'use strict';var EventEmitter=require(_0x809a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x809a('0x1')];var OpenchannelMessage=require(_0x809a('0x2'))['db'][_0x809a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x809a('0x4')](0x0);var events={'afterCreate':_0x809a('0x5'),'afterUpdate':_0x809a('0x6'),'afterDestroy':_0x809a('0x7')};function emitEvent(_0x2b92ac){return function(_0x41cd6d,_0x45e0db,_0x6d0e7d){_0x41cd6d[_0x809a('0x8')]({'attributes':['id'],'raw':!![]})[_0x809a('0x9')](function(_0x2071a1){_0x41cd6d[_0x809a('0xa')](_0x809a('0xb'),_0x2071a1['map'](function(_0x5d9c30){return{'id':_0x5d9c30['id']};}));return OpenchannelMessage[_0x809a('0xc')]({'where':{'OpenchannelInteractionId':_0x41cd6d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x809a('0x9')](function(_0x2231f6){_0x41cd6d[_0x809a('0xa')](_0x809a('0xd'),_0x2231f6['length']);OpenchannelInteractionEvents[_0x809a('0xe')](_0x2b92ac+':'+_0x41cd6d['id'],_0x41cd6d);OpenchannelInteractionEvents[_0x809a('0xe')](_0x2b92ac,_0x41cd6d);_0x6d0e7d(null);})[_0x809a('0xf')](_0x6d0e7d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x809a('0x10')](e,emitEvent(event));}}module[_0x809a('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 8abb0fc..0dd8fa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3827=['request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird'];(function(_0x4de881,_0x560b6d){var _0x5e858b=function(_0x4ad385){while(--_0x4ad385){_0x4de881['push'](_0x4de881['shift']());}};_0x5e858b(++_0x560b6d);}(_0x3827,0x1db));var _0x7382=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x3827[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x7382('0x0'));var util=require(_0x7382('0x1'));var logger=require(_0x7382('0x2'))(_0x7382('0x3'));var moment=require('moment');var BPromise=require(_0x7382('0x4'));var rp=require(_0x7382('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7382('0x6'));var config=require(_0x7382('0x7'));var attributes=require(_0x7382('0x8'));module[_0x7382('0x9')]=function(_0x525bc0,_0x42bcd1){return _0x525bc0[_0x7382('0xa')](_0x7382('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7382('0xc'),'hooks':{'beforeUpdate':function(_0x5766b7,_0x346e09,_0x100ce1){if(_0x5766b7[_0x7382('0xd')]('closed')){_0x5766b7['closedAt']=moment()[_0x7382('0xe')](_0x7382('0xf'));}_0x100ce1(null,_0x5766b7);}}});};
\ No newline at end of file
+var _0x1d76=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt'];(function(_0x3f1a5f,_0x38c351){var _0x3ee771=function(_0x37843f){while(--_0x37843f){_0x3f1a5f['push'](_0x3f1a5f['shift']());}};_0x3ee771(++_0x38c351);}(_0x1d76,0x1c4));var _0x61d7=function(_0x109b6c,_0x28d39d){_0x109b6c=_0x109b6c-0x0;var _0x3084f9=_0x1d76[_0x109b6c];return _0x3084f9;};'use strict';var _=require(_0x61d7('0x0'));var util=require(_0x61d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x61d7('0x2'));var BPromise=require(_0x61d7('0x3'));var rp=require(_0x61d7('0x4'));var fs=require('fs');var path=require(_0x61d7('0x5'));var rimraf=require(_0x61d7('0x6'));var config=require(_0x61d7('0x7'));var attributes=require(_0x61d7('0x8'));module[_0x61d7('0x9')]=function(_0x1ee484,_0x2a3426){return _0x1ee484[_0x61d7('0xa')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61d7('0xb'),'collate':_0x61d7('0xc'),'hooks':{'beforeUpdate':function(_0x5d34be,_0x34f868,_0x196dbd){if(_0x5d34be[_0x61d7('0xd')](_0x61d7('0xe'))){_0x5d34be[_0x61d7('0xf')]=moment()[_0x61d7('0x10')](_0x61d7('0x11'));}_0x196dbd(null,_0x5d34be);}}});};
\ No newline at end of file
index 744cf1c..fc4b029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ac5=['options','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body'];(function(_0x208c16,_0x39ca4e){var _0x5b6727=function(_0x5e88b1){while(--_0x5e88b1){_0x208c16['push'](_0x208c16['shift']());}};_0x5b6727(++_0x39ca4e);}(_0x6ac5,0x19e));var _0x56ac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ac5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x56ac('0x0'));var util=require('util');var moment=require(_0x56ac('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56ac('0x2'));var db=require(_0x56ac('0x3'))['db'];var utils=require(_0x56ac('0x4'));var logger=require(_0x56ac('0x5'))(_0x56ac('0x6'));var config=require('../../config/environment');var jayson=require(_0x56ac('0x7'));var client=jayson[_0x56ac('0x8')][_0x56ac('0x9')]({'port':0x232a});config[_0x56ac('0xa')]=_[_0x56ac('0xb')](config[_0x56ac('0xa')],{'host':_0x56ac('0xc'),'port':0x18eb});var socket=require(_0x56ac('0xd'))(new Redis(config[_0x56ac('0xa')]));require('./openchannelInteraction.socket')[_0x56ac('0xe')](socket);function respondWithRpcPromise(_0x1810ca,_0x51a3a5,_0x34daa2){return new BPromise(function(_0x570c8a,_0x273bf9){return client[_0x56ac('0xf')](_0x1810ca,_0x34daa2)[_0x56ac('0x10')](function(_0x454253){logger[_0x56ac('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x51a3a5,'request\x20sent');logger[_0x56ac('0x12')](_0x56ac('0x13'),_0x51a3a5,_0x56ac('0x14'),JSON['stringify'](_0x454253));if(_0x454253['error']){if(_0x454253[_0x56ac('0x15')][_0x56ac('0x16')]===0x1f4){logger[_0x56ac('0x15')](_0x56ac('0x17'),_0x51a3a5,_0x454253['error'][_0x56ac('0x18')]);return _0x273bf9(_0x454253[_0x56ac('0x15')]['message']);}logger['error'](_0x56ac('0x17'),_0x51a3a5,_0x454253['error'][_0x56ac('0x18')]);return _0x570c8a(_0x454253['error'][_0x56ac('0x18')]);}else{logger[_0x56ac('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x51a3a5,_0x56ac('0x14'));_0x570c8a(_0x454253[_0x56ac('0x19')]['message']);}})[_0x56ac('0x1a')](function(_0x3118c7){logger[_0x56ac('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x51a3a5,_0x3118c7);_0x273bf9(_0x3118c7);});});}exports[_0x56ac('0x1b')]=function(_0x42e205){var _0x37a561=this;return new Promise(function(_0x36349b,_0x27ba01){return db[_0x56ac('0x1c')]['update'](_0x42e205[_0x56ac('0x1d')],{'raw':_0x42e205[_0x56ac('0x1e')]?_0x42e205['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42e205['options']?_0x42e205[_0x56ac('0x1e')][_0x56ac('0x1f')]||null:null,'attributes':_0x42e205[_0x56ac('0x1e')]?_0x42e205[_0x56ac('0x1e')][_0x56ac('0x20')]||null:null,'limit':_0x42e205['options']?_0x42e205[_0x56ac('0x1e')][_0x56ac('0x21')]||null:null})[_0x56ac('0x10')](function(_0x50f93b){logger[_0x56ac('0x11')]('UpdateOpenchannelInteraction',_0x42e205);logger['debug'](_0x56ac('0x1b'),_0x42e205,JSON[_0x56ac('0x22')](_0x50f93b));_0x36349b(_0x50f93b);})[_0x56ac('0x1a')](function(_0x32424e){logger[_0x56ac('0x15')](_0x56ac('0x1b'),_0x32424e[_0x56ac('0x18')],_0x42e205);_0x27ba01(_0x37a561[_0x56ac('0x15')](0x1f4,_0x32424e['message']));});});};exports[_0x56ac('0x23')]=function(_0xf8d4d7){return new Promise(function(_0x597229,_0x13a8c8){return db[_0x56ac('0x1c')]['find']({'where':_0xf8d4d7['options']?_0xf8d4d7[_0x56ac('0x1e')][_0x56ac('0x1f')]||null:null})[_0x56ac('0x10')](function(_0x5a7739){if(_0x5a7739){return _0x5a7739['addTags'](_0xf8d4d7[_0x56ac('0x1d')]['ids'],_['omit'](_0xf8d4d7[_0x56ac('0x1d')],['ids','id'])||{});}})['spread'](function(_0x254fba){logger['info'](_0x56ac('0x24'),_0xf8d4d7);logger['debug'](_0x56ac('0x24'),_0xf8d4d7,JSON['stringify'](_0x254fba));_0x597229(_0x254fba);})[_0x56ac('0x1a')](function(_0x2c0e8d){logger[_0x56ac('0x15')](_0x56ac('0x24'),_0x2c0e8d[_0x56ac('0x18')],_0xf8d4d7);_0x13a8c8(_this[_0x56ac('0x15')](0x1f4,_0x2c0e8d[_0x56ac('0x18')]));});});};
\ No newline at end of file
+var _0xe148=['message','request\x20sent','result','catch','OpenchannelInteraction','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x297f95,_0x205afc){var _0x5e4680=function(_0x396bf2){while(--_0x396bf2){_0x297f95['push'](_0x297f95['shift']());}};_0x5e4680(++_0x205afc);}(_0xe148,0x139));var _0x8e14=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0xe148[_0x4f08dd];return _0x3017ee;};'use strict';var _=require(_0x8e14('0x0'));var util=require(_0x8e14('0x1'));var moment=require(_0x8e14('0x2'));var BPromise=require(_0x8e14('0x3'));var rs=require(_0x8e14('0x4'));var fs=require('fs');var Redis=require(_0x8e14('0x5'));var db=require(_0x8e14('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e14('0x7'));var config=require(_0x8e14('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8e14('0x9')][_0x8e14('0xa')]({'port':0x232a});config[_0x8e14('0xb')]=_[_0x8e14('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e14('0xb')]));require(_0x8e14('0xd'))['register'](socket);function respondWithRpcPromise(_0x72218a,_0x1e4570,_0xc9ccd3){return new BPromise(function(_0x1053ed,_0x65e345){return client[_0x8e14('0xe')](_0x72218a,_0xc9ccd3)[_0x8e14('0xf')](function(_0x17ba95){logger[_0x8e14('0x10')](_0x8e14('0x11'),_0x1e4570,'request\x20sent');logger[_0x8e14('0x12')](_0x8e14('0x13'),_0x1e4570,'request\x20sent',JSON[_0x8e14('0x14')](_0x17ba95));if(_0x17ba95[_0x8e14('0x15')]){if(_0x17ba95[_0x8e14('0x15')][_0x8e14('0x16')]===0x1f4){logger[_0x8e14('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e4570,_0x17ba95[_0x8e14('0x15')][_0x8e14('0x17')]);return _0x65e345(_0x17ba95[_0x8e14('0x15')][_0x8e14('0x17')]);}logger[_0x8e14('0x15')](_0x8e14('0x11'),_0x1e4570,_0x17ba95[_0x8e14('0x15')][_0x8e14('0x17')]);return _0x1053ed(_0x17ba95[_0x8e14('0x15')][_0x8e14('0x17')]);}else{logger[_0x8e14('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e4570,_0x8e14('0x18'));_0x1053ed(_0x17ba95[_0x8e14('0x19')][_0x8e14('0x17')]);}})[_0x8e14('0x1a')](function(_0x3ec1fa){logger[_0x8e14('0x15')](_0x8e14('0x11'),_0x1e4570,_0x3ec1fa);_0x65e345(_0x3ec1fa);});});}exports['UpdateOpenchannelInteraction']=function(_0x44f948){var _0x511770=this;return new Promise(function(_0x206b20,_0x333301){return db[_0x8e14('0x1b')]['update'](_0x44f948[_0x8e14('0x1c')],{'raw':_0x44f948['options']?_0x44f948[_0x8e14('0x1d')][_0x8e14('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f948[_0x8e14('0x1d')]?_0x44f948[_0x8e14('0x1d')][_0x8e14('0x1f')]||null:null,'attributes':_0x44f948['options']?_0x44f948[_0x8e14('0x1d')][_0x8e14('0x20')]||null:null,'limit':_0x44f948[_0x8e14('0x1d')]?_0x44f948['options'][_0x8e14('0x21')]||null:null})[_0x8e14('0xf')](function(_0x2f8b5e){logger[_0x8e14('0x10')](_0x8e14('0x22'),_0x44f948);logger[_0x8e14('0x12')]('UpdateOpenchannelInteraction',_0x44f948,JSON[_0x8e14('0x14')](_0x2f8b5e));_0x206b20(_0x2f8b5e);})[_0x8e14('0x1a')](function(_0x12eedf){logger['error'](_0x8e14('0x22'),_0x12eedf[_0x8e14('0x17')],_0x44f948);_0x333301(_0x511770['error'](0x1f4,_0x12eedf['message']));});});};exports[_0x8e14('0x23')]=function(_0xb24fe0){return new Promise(function(_0x48800d,_0x3fb258){return db[_0x8e14('0x1b')][_0x8e14('0x24')]({'where':_0xb24fe0[_0x8e14('0x1d')]?_0xb24fe0[_0x8e14('0x1d')]['where']||null:null})[_0x8e14('0xf')](function(_0x6804a7){if(_0x6804a7){return _0x6804a7[_0x8e14('0x25')](_0xb24fe0[_0x8e14('0x1c')][_0x8e14('0x26')],_[_0x8e14('0x27')](_0xb24fe0['body'],[_0x8e14('0x26'),'id'])||{});}})[_0x8e14('0x28')](function(_0x470b6b){logger[_0x8e14('0x10')](_0x8e14('0x29'),_0xb24fe0);logger[_0x8e14('0x12')](_0x8e14('0x29'),_0xb24fe0,JSON[_0x8e14('0x14')](_0x470b6b));_0x48800d(_0x470b6b);})[_0x8e14('0x1a')](function(_0x220d96){logger[_0x8e14('0x15')]('AddTags',_0x220d96[_0x8e14('0x17')],_0xb24fe0);_0x3fb258(_this[_0x8e14('0x15')](0x1f4,_0x220d96[_0x8e14('0x17')]));});});};
\ No newline at end of file
index 1e40237..cb64050 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x300c=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x294c5d,_0x222b6a){var _0x1dc2a6=function(_0x2a21ad){while(--_0x2a21ad){_0x294c5d['push'](_0x294c5d['shift']());}};_0x1dc2a6(++_0x222b6a);}(_0x300c,0x17a));var _0xc300=function(_0x165a8,_0x5bfb8b){_0x165a8=_0x165a8-0x0;var _0x2dfb5c=_0x300c[_0x165a8];return _0x2dfb5c;};'use strict';var OpenchannelInteractionEvents=require(_0xc300('0x0'));var events=[_0xc300('0x1'),_0xc300('0x2'),_0xc300('0x3')];function createListener(_0x20b751,_0x150f9a){return function(_0x581c1d){_0x150f9a[_0xc300('0x4')](_0x20b751,_0x581c1d);};}function removeListener(_0x38b947,_0x417ccb){return function(){OpenchannelInteractionEvents[_0xc300('0x5')](_0x38b947,_0x417ccb);};}exports[_0xc300('0x6')]=function(_0x428a35){for(var _0x4fbdde=0x0,_0x3033e1=events[_0xc300('0x7')];_0x4fbdde<_0x3033e1;_0x4fbdde++){var _0x59444f=events[_0x4fbdde];var _0x4bcbd1=createListener(_0xc300('0x8')+_0x59444f,_0x428a35);OpenchannelInteractionEvents['on'](_0x59444f,_0x4bcbd1);}};
\ No newline at end of file
+var _0x90fb=['openchannelInteraction:','remove','update','emit','register','length'];(function(_0x1e63f8,_0x55ad9e){var _0x34b1f1=function(_0x4a9315){while(--_0x4a9315){_0x1e63f8['push'](_0x1e63f8['shift']());}};_0x34b1f1(++_0x55ad9e);}(_0x90fb,0x19f));var _0xb90f=function(_0x53b50e,_0xc49361){_0x53b50e=_0x53b50e-0x0;var _0x3f8625=_0x90fb[_0x53b50e];return _0x3f8625;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0xb90f('0x0'),_0xb90f('0x1')];function createListener(_0x246053,_0x10581f){return function(_0x5cfd3b){_0x10581f[_0xb90f('0x2')](_0x246053,_0x5cfd3b);};}function removeListener(_0x590aca,_0x44c013){return function(){OpenchannelInteractionEvents['removeListener'](_0x590aca,_0x44c013);};}exports[_0xb90f('0x3')]=function(_0x2f35d4){for(var _0x255ce3=0x0,_0x21bcb0=events[_0xb90f('0x4')];_0x255ce3<_0x21bcb0;_0x255ce3++){var _0x1a8708=events[_0x255ce3];var _0x2b7b81=createListener(_0xb90f('0x5')+_0x1a8708,_0x2f35d4);OpenchannelInteractionEvents['on'](_0x1a8708,_0x2b7b81);}};
\ No newline at end of file
index bab959e..a969716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x1f5cdc,_0x52a22b){var _0x2e5db6=function(_0xba24cd){while(--_0xba24cd){_0x1f5cdc['push'](_0x1f5cdc['shift']());}};_0x2e5db6(++_0x52a22b);}(_0xe706,0xa3));var _0x6e70=function(_0x1765dc,_0x17d194){_0x1765dc=_0x1765dc-0x0;var _0x5e7800=_0xe706[_0x1765dc];return _0x5e7800;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x14cde2,_0xf5788a){var _0x4ad50c=function(_0x263091){while(--_0x263091){_0x14cde2['push'](_0x14cde2['shift']());}};_0x4ad50c(++_0xf5788a);}(_0xedd9,0xfc));var _0x9edd=function(_0xf321ee,_0xee4435){_0xf321ee=_0xf321ee-0x0;var _0x496e93=_0xedd9[_0xf321ee];return _0x496e93;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router;
\ No newline at end of file
index d556d81..8dea246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x173d=['exports','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x134796,_0x5aeb0d){var _0x388846=function(_0x4d44b6){while(--_0x4d44b6){_0x134796['push'](_0x134796['shift']());}};_0x388846(++_0x5aeb0d);}(_0x173d,0x108));var _0xd173=function(_0x294123,_0x435472){_0x294123=_0x294123-0x0;var _0x542051=_0x173d[_0x294123];return _0x542051;};'use strict';var Sequelize=require('sequelize');module[_0xd173('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd173('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd173('0x2')]('in',_0xd173('0x3')),'defaultValue':_0xd173('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd173('0x4')]},'providerName':{'type':Sequelize[_0xd173('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0b70=['ENUM','out','STRING','exports','medium','BOOLEAN'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x0b70,0x159));var _0x00b7=function(_0x45f42e,_0x417bb){_0x45f42e=_0x45f42e-0x0;var _0x5704b6=_0x0b70[_0x45f42e];return _0x5704b6;};'use strict';var Sequelize=require('sequelize');module[_0x00b7('0x0')]={'body':{'type':Sequelize['TEXT'](_0x00b7('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x00b7('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x00b7('0x3')]('in',_0x00b7('0x4')),'defaultValue':_0x00b7('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x00b7('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 29522d0..ec7781f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fbe=['to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','end','sendStatus','name','send','index','map','OpenchannelMessage','fieldName','type','model','query','keys','filters','intersection','fields','length','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','rawAttributes','attributes','find','create','body','update','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','isNil','read1stAt','interaction','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','OpenchannelInteraction','stringify','null','RejectMessage','ContactId','User','interface','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util'];(function(_0x5d13dc,_0x59bad2){var _0x4fdeca=function(_0x46d816){while(--_0x46d816){_0x5d13dc['push'](_0x5d13dc['shift']());}};_0x4fdeca(++_0x59bad2);}(_0x1fbe,0xef));var _0xe1fb=function(_0x32f776,_0x1bf7e6){_0x32f776=_0x32f776-0x0;var _0xa9f55=_0x1fbe[_0x32f776];return _0xa9f55;};'use strict';var emlformat=require(_0xe1fb('0x0'));var rimraf=require(_0xe1fb('0x1'));var zipdir=require(_0xe1fb('0x2'));var jsonpatch=require(_0xe1fb('0x3'));var rp=require('request-promise');var moment=require(_0xe1fb('0x4'));var BPromise=require(_0xe1fb('0x5'));var Mustache=require('mustache');var util=require(_0xe1fb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe1fb('0x7'));var ejs=require(_0xe1fb('0x8'));var fs=require('fs');var fs_extra=require(_0xe1fb('0x9'));var _=require('lodash');var squel=require(_0xe1fb('0xa'));var crypto=require('crypto');var jsforce=require(_0xe1fb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe1fb('0x7'));var querystring=require(_0xe1fb('0xc'));var Papa=require(_0xe1fb('0xd'));var Redis=require(_0xe1fb('0xe'));var authService=require(_0xe1fb('0xf'));var qs=require(_0xe1fb('0x10'));var as=require(_0xe1fb('0x11'));var hardwareService=require(_0xe1fb('0x12'));var logger=require(_0xe1fb('0x13'))(_0xe1fb('0x14'));var utils=require('../../config/utils');var config=require(_0xe1fb('0x15'));var licenseUtil=require(_0xe1fb('0x16'));var db=require(_0xe1fb('0x17'))['db'];config[_0xe1fb('0x18')]=_[_0xe1fb('0x19')](config[_0xe1fb('0x18')],{'host':_0xe1fb('0x1a'),'port':0x18eb});var socket=require(_0xe1fb('0x1b'))(new Redis(config[_0xe1fb('0x18')]));require(_0xe1fb('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe1fb('0x1d')][_0xe1fb('0x1e')]({'port':0x232c});var client9002=jayson[_0xe1fb('0x1d')][_0xe1fb('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4b85f2,_0x4fe122,_0x16fe1b,_0x69d573){return new BPromise(function(_0x1de365,_0x32668d){var _0x13733a=_0x69d573||client;return _0x13733a['request'](_0x4b85f2,_0x16fe1b)[_0xe1fb('0x1f')](function(_0x5e7ee7){logger[_0xe1fb('0x20')](_0xe1fb('0x21'),_0x4fe122,_0xe1fb('0x22'));logger[_0xe1fb('0x23')](_0xe1fb('0x24'),_0x4fe122,_0xe1fb('0x22'),JSON['stringify'](_0x5e7ee7));if(_0x5e7ee7[_0xe1fb('0x25')]){if(_0x5e7ee7[_0xe1fb('0x25')]['code']===0x1f4){logger['error'](_0xe1fb('0x21'),_0x4fe122,_0x5e7ee7[_0xe1fb('0x25')][_0xe1fb('0x26')]);return _0x32668d(_0x5e7ee7[_0xe1fb('0x25')][_0xe1fb('0x26')]);}logger[_0xe1fb('0x25')](_0xe1fb('0x21'),_0x4fe122,_0x5e7ee7['error'][_0xe1fb('0x26')]);return _0x1de365(_0x5e7ee7[_0xe1fb('0x25')]['message']);}else{logger[_0xe1fb('0x20')](_0xe1fb('0x21'),_0x4fe122,_0xe1fb('0x22'));_0x1de365(_0x5e7ee7[_0xe1fb('0x27')][_0xe1fb('0x26')]);}})[_0xe1fb('0x28')](function(_0x325971){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x4fe122,_0x325971);_0x32668d(_0x325971);});});}function respondWithStatusCode(_0x5252a7,_0x42bf39){_0x42bf39=_0x42bf39||0xcc;return function(_0x5aab71){if(_0x5aab71){return _0x5252a7['sendStatus'](_0x42bf39);}return _0x5252a7[_0xe1fb('0x29')](_0x42bf39)['end']();};}function respondWithResult(_0x382c18,_0x21a6d1){_0x21a6d1=_0x21a6d1||0xc8;return function(_0x2e2c51){if(_0x2e2c51){return _0x382c18[_0xe1fb('0x29')](_0x21a6d1)[_0xe1fb('0x2a')](_0x2e2c51);}};}function respondWithFilteredResult(_0x26c547,_0x335594){return function(_0x57fde4){if(_0x57fde4){var _0x36f8df=typeof _0x335594[_0xe1fb('0x2b')]==='undefined'&&typeof _0x335594[_0xe1fb('0x2c')]==='undefined';var _0x4f51dc=_0x57fde4[_0xe1fb('0x2d')];var _0x3e3b89=_0x36f8df?0x0:_0x335594[_0xe1fb('0x2b')];var _0x1394d9=_0x36f8df?_0x57fde4[_0xe1fb('0x2d')]:_0x335594['offset']+_0x335594[_0xe1fb('0x2c')];var _0x55b3bc;if(_0x1394d9>=_0x4f51dc){_0x1394d9=_0x4f51dc;_0x55b3bc=0xc8;}else{_0x55b3bc=0xce;}_0x26c547[_0xe1fb('0x29')](_0x55b3bc);return _0x26c547[_0xe1fb('0x2e')](_0xe1fb('0x2f'),_0x3e3b89+'-'+_0x1394d9+'/'+_0x4f51dc)['json'](_0x57fde4);}return null;};}function patchUpdates(_0x1459e){return function(_0x3c93b0){try{jsonpatch[_0xe1fb('0x30')](_0x3c93b0,_0x1459e,!![]);}catch(_0x428b8b){return BPromise[_0xe1fb('0x31')](_0x428b8b);}return _0x3c93b0[_0xe1fb('0x32')]();};}function saveUpdates(_0x2dae39,_0x152e8b){return function(_0x5e3548){if(_0x5e3548){return _0x5e3548['update'](_0x2dae39)['then'](function(_0x499e94){return _0x499e94;});}return null;};}function removeEntity(_0x5440de,_0x3465f7){return function(_0x457cf8){if(_0x457cf8){return _0x457cf8[_0xe1fb('0x33')]()[_0xe1fb('0x1f')](function(){_0x5440de[_0xe1fb('0x29')](0xcc)[_0xe1fb('0x34')]();});}};}function handleEntityNotFound(_0x54091a,_0x52c04b){return function(_0x539f1b){if(!_0x539f1b){_0x54091a[_0xe1fb('0x35')](0x194);}return _0x539f1b;};}function handleError(_0x26842f,_0x738217){_0x738217=_0x738217||0x1f4;return function(_0x18f40d){logger['error'](_0x18f40d['stack']);if(_0x18f40d['name']){delete _0x18f40d[_0xe1fb('0x36')];}_0x26842f[_0xe1fb('0x29')](_0x738217)[_0xe1fb('0x37')](_0x18f40d);};}exports[_0xe1fb('0x38')]=function(_0x3ead47,_0x4b49f2){var _0x25d828={},_0x2805d0={},_0x3dc534={'count':0x0,'rows':[]};var _0x1477d2=_[_0xe1fb('0x39')](db[_0xe1fb('0x3a')]['rawAttributes'],function(_0x32845a){return{'name':_0x32845a[_0xe1fb('0x3b')],'type':_0x32845a[_0xe1fb('0x3c')]['key']};});_0x2805d0[_0xe1fb('0x3d')]=_[_0xe1fb('0x39')](_0x1477d2,_0xe1fb('0x36'));_0x2805d0[_0xe1fb('0x3e')]=_[_0xe1fb('0x3f')](_0x3ead47[_0xe1fb('0x3e')]);_0x2805d0[_0xe1fb('0x40')]=_[_0xe1fb('0x41')](_0x2805d0[_0xe1fb('0x3d')],_0x2805d0['query']);_0x25d828['attributes']=_[_0xe1fb('0x41')](_0x2805d0['model'],qs[_0xe1fb('0x42')](_0x3ead47[_0xe1fb('0x3e')][_0xe1fb('0x42')]));_0x25d828['attributes']=_0x25d828['attributes'][_0xe1fb('0x43')]?_0x25d828['attributes']:_0x2805d0['model'];if(!_0x3ead47[_0xe1fb('0x3e')]['hasOwnProperty']('nolimit')){_0x25d828['limit']=qs[_0xe1fb('0x2c')](_0x3ead47[_0xe1fb('0x3e')]['limit']);_0x25d828[_0xe1fb('0x2b')]=qs['offset'](_0x3ead47['query']['offset']);}_0x25d828['order']=qs['sort'](_0x3ead47[_0xe1fb('0x3e')]['sort']);_0x25d828['where']=qs[_0xe1fb('0x40')](_['pick'](_0x3ead47[_0xe1fb('0x3e')],_0x2805d0[_0xe1fb('0x40')]),_0x1477d2);if(_0x3ead47[_0xe1fb('0x3e')][_0xe1fb('0x44')]){_0x25d828['where']=_['merge'](_0x25d828[_0xe1fb('0x45')],{'$or':_[_0xe1fb('0x39')](_0x1477d2,function(_0x36ab5c){if(_0x36ab5c[_0xe1fb('0x3c')]!==_0xe1fb('0x46')){var _0x5a3494={};_0x5a3494[_0x36ab5c['name']]={'$like':'%'+_0x3ead47['query'][_0xe1fb('0x44')]+'%'};return _0x5a3494;}})});}_0x25d828=_[_0xe1fb('0x47')]({},_0x25d828,_0x3ead47[_0xe1fb('0x48')]);var _0x29be0b={'where':_0x25d828[_0xe1fb('0x45')]};return db[_0xe1fb('0x3a')][_0xe1fb('0x2d')](_0x29be0b)[_0xe1fb('0x1f')](function(_0x5dcaed){_0x3dc534[_0xe1fb('0x2d')]=_0x5dcaed;if(_0x3ead47[_0xe1fb('0x3e')][_0xe1fb('0x49')]){_0x25d828[_0xe1fb('0x4a')]=[{'all':!![]}];}return db[_0xe1fb('0x3a')][_0xe1fb('0x4b')](_0x25d828);})[_0xe1fb('0x1f')](function(_0x57591f){_0x3dc534['rows']=_0x57591f;return _0x3dc534;})[_0xe1fb('0x1f')](respondWithFilteredResult(_0x4b49f2,_0x25d828))[_0xe1fb('0x28')](handleError(_0x4b49f2,null));};exports[_0xe1fb('0x4c')]=function(_0x32a0b0,_0x5d1ed6){var _0x1e4a25={'raw':!![],'where':{'id':_0x32a0b0[_0xe1fb('0x4d')]['id']}},_0x11437f={};_0x11437f[_0xe1fb('0x3d')]=_[_0xe1fb('0x3f')](db[_0xe1fb('0x3a')][_0xe1fb('0x4e')]);_0x11437f[_0xe1fb('0x3e')]=_['keys'](_0x32a0b0['query']);_0x11437f[_0xe1fb('0x40')]=_[_0xe1fb('0x41')](_0x11437f[_0xe1fb('0x3d')],_0x11437f[_0xe1fb('0x3e')]);_0x1e4a25[_0xe1fb('0x4f')]=_[_0xe1fb('0x41')](_0x11437f[_0xe1fb('0x3d')],qs[_0xe1fb('0x42')](_0x32a0b0['query'][_0xe1fb('0x42')]));_0x1e4a25[_0xe1fb('0x4f')]=_0x1e4a25[_0xe1fb('0x4f')]['length']?_0x1e4a25[_0xe1fb('0x4f')]:_0x11437f[_0xe1fb('0x3d')];if(_0x32a0b0[_0xe1fb('0x3e')]['includeAll']){_0x1e4a25[_0xe1fb('0x4a')]=[{'all':!![]}];}_0x1e4a25=_[_0xe1fb('0x47')]({},_0x1e4a25,_0x32a0b0['options']);return db[_0xe1fb('0x3a')][_0xe1fb('0x50')](_0x1e4a25)[_0xe1fb('0x1f')](handleEntityNotFound(_0x5d1ed6,null))['then'](respondWithResult(_0x5d1ed6,null))[_0xe1fb('0x28')](handleError(_0x5d1ed6,null));};exports['create']=function(_0x3cf294,_0x12026c){return db[_0xe1fb('0x3a')][_0xe1fb('0x51')](_0x3cf294[_0xe1fb('0x52')],{})[_0xe1fb('0x1f')](respondWithResult(_0x12026c,0xc9))[_0xe1fb('0x28')](handleError(_0x12026c,null));};exports[_0xe1fb('0x53')]=function(_0x38d9d1,_0x45b83b){if(_0x38d9d1['body']['id']){delete _0x38d9d1[_0xe1fb('0x52')]['id'];}return db[_0xe1fb('0x3a')]['find']({'where':{'id':_0x38d9d1[_0xe1fb('0x4d')]['id']}})[_0xe1fb('0x1f')](handleEntityNotFound(_0x45b83b,null))[_0xe1fb('0x1f')](saveUpdates(_0x38d9d1[_0xe1fb('0x52')],null))[_0xe1fb('0x1f')](respondWithResult(_0x45b83b,null))[_0xe1fb('0x28')](handleError(_0x45b83b,null));};exports[_0xe1fb('0x33')]=function(_0xcfa25,_0x22581f){return db['OpenchannelMessage'][_0xe1fb('0x50')]({'where':{'id':_0xcfa25[_0xe1fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x22581f,null))[_0xe1fb('0x1f')](removeEntity(_0x22581f,null))['catch'](handleError(_0x22581f,null));};exports[_0xe1fb('0x54')]=function(_0xab7e5e,_0x426147){return db[_0xe1fb('0x3a')][_0xe1fb('0x54')]()['then'](respondWithResult(_0x426147,null))[_0xe1fb('0x28')](handleError(_0x426147,null));};var interaction_log=require(_0xe1fb('0x13'))(_0xe1fb('0x55'));exports[_0xe1fb('0x56')]=function(_0x3e2ee3,_0x1e7c1f,_0x3e4fdd){var _0x22e234={'agent':{},'channel':_0xe1fb('0x57')};if(_0x3e2ee3['body']['id']){delete _0x3e2ee3['body']['id'];}_0x3e2ee3[_0xe1fb('0x52')][_0xe1fb('0x58')]=!![];_0x3e2ee3['body'][_0xe1fb('0x59')]=moment()[_0xe1fb('0x5a')](_0xe1fb('0x5b'));_0x3e2ee3['body'][_0xe1fb('0x5c')]=_0x3e2ee3[_0xe1fb('0x52')][_0xe1fb('0x5c')]||_0x3e2ee3[_0xe1fb('0x5d')]['id'];_0x22e234['agent']['id']=_0x3e2ee3[_0xe1fb('0x52')][_0xe1fb('0x5c')];return db[_0xe1fb('0x3a')]['find']({'where':{'id':_0x3e2ee3['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e7c1f,null))[_0xe1fb('0x1f')](saveUpdates(_0x3e2ee3[_0xe1fb('0x52')],null))['then'](function(_0x34b090){if(_0x34b090){_0x22e234[_0xe1fb('0x26')]=_0x34b090[_0xe1fb('0x5e')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x34b090[_0xe1fb('0x5f')]}});}return null;})[_0xe1fb('0x1f')](handleEntityNotFound(_0x1e7c1f,null))[_0xe1fb('0x1f')](function(_0x526948){if(_0x526948){return _0x526948['update']({'UserId':_0x3e2ee3[_0xe1fb('0x52')][_0xe1fb('0x5c')],'read1stAt':_[_0xe1fb('0x60')](_0x526948[_0xe1fb('0x61')])?moment()[_0xe1fb('0x5a')](_0xe1fb('0x5b')):undefined});}return null;})[_0xe1fb('0x1f')](function(_0x548bd1){if(_0x548bd1){_0x22e234[_0xe1fb('0x62')]=_0x548bd1[_0xe1fb('0x5e')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3e2ee3['user']['id'],_0x3e2ee3[_0xe1fb('0x5d')][_0xe1fb('0x36')],_0x3e2ee3[_0xe1fb('0x5d')][_0xe1fb('0x63')],_0x22e234[_0xe1fb('0x62')]['id'],_0x3e2ee3[_0xe1fb('0x52')]?JSON['stringify'](_0x3e2ee3[_0xe1fb('0x52')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x22e234);}return null;})['then'](function(_0x4d49b4){var _0x311399=_0xe1fb('0x64')+_0x4d49b4[_0xe1fb('0x26')]['ContactId'];return db['sequelize'][_0xe1fb('0x3e')](_0x311399,{'type':db[_0xe1fb('0x65')][_0xe1fb('0x66')][_0xe1fb('0x67')],'raw':!![]})[_0xe1fb('0x1f')](function(_0xb6613b){return _0xb6613b;});})[_0xe1fb('0x1f')](function(_0x462998){if(_0x462998){_0x22e234[_0xe1fb('0x26')]['contact']=_0x462998[0x0];if(!_0x3e2ee3[_0xe1fb('0x52')]['UserId'])return;return db['User'][_0xe1fb('0x50')]({'where':{'id':_0x3e2ee3[_0xe1fb('0x52')][_0xe1fb('0x5c')],'role':_0xe1fb('0x68')},'attributes':['id',_0xe1fb('0x36'),_0xe1fb('0x69'),_0xe1fb('0x6a'),_0xe1fb('0x6b')],'raw':!![]});}return null;})[_0xe1fb('0x1f')](function(_0x1fdf4e){if(!_0x1fdf4e)return null;_0x22e234['message']['agent']=_0x1fdf4e;return _0x22e234;})[_0xe1fb('0x1f')](function(_0x5cfd64){if(_0x5cfd64){if(_0x3e2ee3['body'][_0xe1fb('0x6c')]){_0x22e234[_0xe1fb('0x26')]['interface']=util[_0xe1fb('0x5a')](_0xe1fb('0x6d'),_0x3e2ee3[_0xe1fb('0x5d')][_0xe1fb('0x36')]);_0x22e234[_0xe1fb('0x26')][_0xe1fb('0x6e')]=_0x22e234['channel'];_0x22e234[_0xe1fb('0x26')][_0xe1fb('0x6f')]=_0x22e234['channel'];_0x22e234[_0xe1fb('0x26')]['event']=_0xe1fb('0x56');return respondWithRpcPromise('EventManager',_0xe1fb('0x70'),{'event':_0xe1fb('0x71'),'message':_0x22e234[_0xe1fb('0x26')]},client9002)['then'](function(){return _0x22e234;});}return _0x22e234;}return null;})[_0xe1fb('0x1f')](respondWithResult(_0x1e7c1f,null))[_0xe1fb('0x28')](handleError(_0x1e7c1f,null));};var interaction_log=require(_0xe1fb('0x13'))(_0xe1fb('0x55'));exports['reject']=function(_0x4b3ad2,_0xc5c0c5,_0x1bb113){var _0x284973={'agent':{},'channel':_0xe1fb('0x57')};if(_0x4b3ad2[_0xe1fb('0x52')]['id']){delete _0x4b3ad2[_0xe1fb('0x52')]['id'];}_0x4b3ad2[_0xe1fb('0x52')][_0xe1fb('0x5c')]=_0x4b3ad2[_0xe1fb('0x52')][_0xe1fb('0x5c')]||_0x4b3ad2[_0xe1fb('0x5d')]['id'];_0x284973[_0xe1fb('0x68')]['id']=_0x4b3ad2[_0xe1fb('0x52')][_0xe1fb('0x5c')];return db['OpenchannelMessage']['find']({'where':{'id':_0x4b3ad2[_0xe1fb('0x4d')]['id'],'UserId':null}})[_0xe1fb('0x1f')](handleEntityNotFound(_0xc5c0c5,null))[_0xe1fb('0x1f')](function(_0x2951d0){if(_0x2951d0){_0x284973['message']=_0x2951d0[_0xe1fb('0x5e')]({'plain':!![]});return db[_0xe1fb('0x72')][_0xe1fb('0x50')]({'where':{'id':_0x2951d0[_0xe1fb('0x5f')]}});}return null;})[_0xe1fb('0x1f')](handleEntityNotFound(_0xc5c0c5,null))['then'](function(_0x1d8391){if(_0x1d8391){_0x284973[_0xe1fb('0x62')]=_0x1d8391[_0xe1fb('0x5e')]({'plain':!![]});interaction_log[_0xe1fb('0x20')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b3ad2['user']['id'],_0x4b3ad2[_0xe1fb('0x5d')][_0xe1fb('0x36')],_0x4b3ad2[_0xe1fb('0x5d')][_0xe1fb('0x63')],_0x284973[_0xe1fb('0x62')]['id'],_0x4b3ad2['body']?JSON[_0xe1fb('0x73')](_0x4b3ad2[_0xe1fb('0x52')]):_0xe1fb('0x74'));return respondWithRpcPromise(_0xe1fb('0x75'),'rejectMessage',_0x284973);}return null;})[_0xe1fb('0x1f')](function(_0x5bcf99){var _0x33c864=_0xe1fb('0x64')+_0x5bcf99[_0xe1fb('0x26')][_0xe1fb('0x76')];return db['sequelize']['query'](_0x33c864,{'type':db[_0xe1fb('0x65')][_0xe1fb('0x66')][_0xe1fb('0x67')],'raw':!![]})['then'](function(_0x2afcdd){return _0x2afcdd;});})[_0xe1fb('0x1f')](function(_0x326f2c){if(_0x326f2c){_0x284973[_0xe1fb('0x26')]['contact']=_0x326f2c[0x0];if(!_0x4b3ad2[_0xe1fb('0x52')][_0xe1fb('0x5c')])return;return db[_0xe1fb('0x77')]['find']({'where':{'id':_0x4b3ad2[_0xe1fb('0x52')][_0xe1fb('0x5c')],'role':'agent'},'attributes':['id','name',_0xe1fb('0x69'),'email','internal'],'raw':!![]});}return null;})[_0xe1fb('0x1f')](function(_0x131ef1){if(!_0x131ef1)return null;_0x284973[_0xe1fb('0x26')]['agent']=_0x131ef1;return _0x284973;})[_0xe1fb('0x1f')](function(_0x52f007){if(_0x52f007){_0x52f007[_0xe1fb('0x26')][_0xe1fb('0x78')]=util[_0xe1fb('0x5a')]('SIP/%s',_0x4b3ad2[_0xe1fb('0x5d')]['name']);_0x52f007[_0xe1fb('0x26')][_0xe1fb('0x6e')]=_0x284973[_0xe1fb('0x6e')];_0x52f007['message'][_0xe1fb('0x6f')]=_0x284973[_0xe1fb('0x6e')];_0x52f007['message'][_0xe1fb('0x79')]=_0xe1fb('0x31');respondWithRpcPromise('EventManager',_0xe1fb('0x70'),{'event':_0xe1fb('0x7a'),'message':_0x52f007[_0xe1fb('0x26')]},client9002);return _0x284973;}return null;})[_0xe1fb('0x1f')](respondWithResult(_0xc5c0c5,null))[_0xe1fb('0x28')](handleError(_0xc5c0c5,null));};
\ No newline at end of file
+var _0x91f0=['acceptMessage','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','openchannel','OpenchannelInteraction','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','motionChannel','rejectmessage','eml-format','rimraf','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','update','destroy','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelMessage','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','accept','read','format','UserId','user','agent','get','OpenchannelInteractionId','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage'];(function(_0x4ce2b7,_0x5d3264){var _0x29e660=function(_0x2918d9){while(--_0x2918d9){_0x4ce2b7['push'](_0x4ce2b7['shift']());}};_0x29e660(++_0x5d3264);}(_0x91f0,0x11a));var _0x091f=function(_0x2001a1,_0x5dfa92){_0x2001a1=_0x2001a1-0x0;var _0x2d719c=_0x91f0[_0x2001a1];return _0x2d719c;};'use strict';var emlformat=require(_0x091f('0x0'));var rimraf=require(_0x091f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x091f('0x2'));var moment=require(_0x091f('0x3'));var BPromise=require(_0x091f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x091f('0x5'));var sox=require('sox');var csv=require(_0x091f('0x6'));var ejs=require(_0x091f('0x7'));var fs=require('fs');var fs_extra=require(_0x091f('0x8'));var _=require(_0x091f('0x9'));var squel=require(_0x091f('0xa'));var crypto=require('crypto');var jsforce=require(_0x091f('0xb'));var deskjs=require(_0x091f('0xc'));var toCsv=require(_0x091f('0x6'));var querystring=require(_0x091f('0xd'));var Papa=require(_0x091f('0xe'));var Redis=require(_0x091f('0xf'));var authService=require(_0x091f('0x10'));var qs=require(_0x091f('0x11'));var as=require(_0x091f('0x12'));var hardwareService=require(_0x091f('0x13'));var logger=require(_0x091f('0x14'))('api');var utils=require(_0x091f('0x15'));var config=require(_0x091f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x091f('0x17'))['db'];config[_0x091f('0x18')]=_['defaults'](config[_0x091f('0x18')],{'host':_0x091f('0x19'),'port':0x18eb});var socket=require(_0x091f('0x1a'))(new Redis(config[_0x091f('0x18')]));require(_0x091f('0x1b'))[_0x091f('0x1c')](socket);var jayson=require(_0x091f('0x1d'));var client=jayson[_0x091f('0x1e')][_0x091f('0x1f')]({'port':0x232c});var client9002=jayson[_0x091f('0x1e')][_0x091f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x29c171,_0x2ef0d8,_0x24f930,_0x2d10db){return new BPromise(function(_0x36f382,_0x21c145){var _0x5cb163=_0x2d10db||client;return _0x5cb163[_0x091f('0x20')](_0x29c171,_0x24f930)[_0x091f('0x21')](function(_0x3fddd8){logger['info'](_0x091f('0x22'),_0x2ef0d8,_0x091f('0x23'));logger[_0x091f('0x24')](_0x091f('0x25'),_0x2ef0d8,'request\x20sent',JSON[_0x091f('0x26')](_0x3fddd8));if(_0x3fddd8[_0x091f('0x27')]){if(_0x3fddd8['error'][_0x091f('0x28')]===0x1f4){logger[_0x091f('0x27')](_0x091f('0x22'),_0x2ef0d8,_0x3fddd8[_0x091f('0x27')]['message']);return _0x21c145(_0x3fddd8[_0x091f('0x27')][_0x091f('0x29')]);}logger[_0x091f('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x2ef0d8,_0x3fddd8['error'][_0x091f('0x29')]);return _0x36f382(_0x3fddd8['error'][_0x091f('0x29')]);}else{logger[_0x091f('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x2ef0d8,'request\x20sent');_0x36f382(_0x3fddd8[_0x091f('0x2b')]['message']);}})[_0x091f('0x2c')](function(_0x7a9c96){logger[_0x091f('0x27')](_0x091f('0x22'),_0x2ef0d8,_0x7a9c96);_0x21c145(_0x7a9c96);});});}function respondWithStatusCode(_0x9250f6,_0x17a77b){_0x17a77b=_0x17a77b||0xcc;return function(_0x22d708){if(_0x22d708){return _0x9250f6[_0x091f('0x2d')](_0x17a77b);}return _0x9250f6[_0x091f('0x2e')](_0x17a77b)[_0x091f('0x2f')]();};}function respondWithResult(_0x123a12,_0x28047e){_0x28047e=_0x28047e||0xc8;return function(_0x33db84){if(_0x33db84){return _0x123a12[_0x091f('0x2e')](_0x28047e)['json'](_0x33db84);}};}function respondWithFilteredResult(_0x3dd054,_0x3b5157){return function(_0x145a03){if(_0x145a03){var _0x4825e7=typeof _0x3b5157[_0x091f('0x30')]===_0x091f('0x31')&&typeof _0x3b5157[_0x091f('0x32')]===_0x091f('0x31');var _0x505bc0=_0x145a03['count'];var _0x417698=_0x4825e7?0x0:_0x3b5157[_0x091f('0x30')];var _0x1a5bf5=_0x4825e7?_0x145a03['count']:_0x3b5157[_0x091f('0x30')]+_0x3b5157['limit'];var _0x4b8800;if(_0x1a5bf5>=_0x505bc0){_0x1a5bf5=_0x505bc0;_0x4b8800=0xc8;}else{_0x4b8800=0xce;}_0x3dd054[_0x091f('0x2e')](_0x4b8800);return _0x3dd054['set'](_0x091f('0x33'),_0x417698+'-'+_0x1a5bf5+'/'+_0x505bc0)[_0x091f('0x34')](_0x145a03);}return null;};}function patchUpdates(_0x5c2ab2){return function(_0x38c046){try{jsonpatch[_0x091f('0x35')](_0x38c046,_0x5c2ab2,!![]);}catch(_0x6ee21b){return BPromise[_0x091f('0x36')](_0x6ee21b);}return _0x38c046[_0x091f('0x37')]();};}function saveUpdates(_0x7b30cd,_0x401051){return function(_0x2a354c){if(_0x2a354c){return _0x2a354c[_0x091f('0x38')](_0x7b30cd)[_0x091f('0x21')](function(_0xabb4f1){return _0xabb4f1;});}return null;};}function removeEntity(_0x191b99,_0x3d0726){return function(_0x1e13be){if(_0x1e13be){return _0x1e13be[_0x091f('0x39')]()[_0x091f('0x21')](function(){_0x191b99[_0x091f('0x2e')](0xcc)[_0x091f('0x2f')]();});}};}function handleEntityNotFound(_0x415a73,_0x5f0932){return function(_0x36625d){if(!_0x36625d){_0x415a73[_0x091f('0x2d')](0x194);}return _0x36625d;};}function handleError(_0x289813,_0x27b193){_0x27b193=_0x27b193||0x1f4;return function(_0x112170){logger[_0x091f('0x27')](_0x112170['stack']);if(_0x112170[_0x091f('0x3a')]){delete _0x112170[_0x091f('0x3a')];}_0x289813[_0x091f('0x2e')](_0x27b193)[_0x091f('0x3b')](_0x112170);};}exports[_0x091f('0x3c')]=function(_0x2a6769,_0xa211b4){var _0x2574c4={},_0x31029e={},_0x590dd3={'count':0x0,'rows':[]};var _0x4d06d1=_['map'](db['OpenchannelMessage'][_0x091f('0x3d')],function(_0x197ce2){return{'name':_0x197ce2[_0x091f('0x3e')],'type':_0x197ce2[_0x091f('0x3f')]['key']};});_0x31029e['model']=_[_0x091f('0x40')](_0x4d06d1,_0x091f('0x3a'));_0x31029e[_0x091f('0x41')]=_[_0x091f('0x42')](_0x2a6769[_0x091f('0x41')]);_0x31029e[_0x091f('0x43')]=_[_0x091f('0x44')](_0x31029e[_0x091f('0x45')],_0x31029e[_0x091f('0x41')]);_0x2574c4['attributes']=_[_0x091f('0x44')](_0x31029e[_0x091f('0x45')],qs[_0x091f('0x46')](_0x2a6769[_0x091f('0x41')]['fields']));_0x2574c4[_0x091f('0x47')]=_0x2574c4[_0x091f('0x47')][_0x091f('0x48')]?_0x2574c4['attributes']:_0x31029e[_0x091f('0x45')];if(!_0x2a6769[_0x091f('0x41')][_0x091f('0x49')]('nolimit')){_0x2574c4[_0x091f('0x32')]=qs[_0x091f('0x32')](_0x2a6769[_0x091f('0x41')][_0x091f('0x32')]);_0x2574c4[_0x091f('0x30')]=qs[_0x091f('0x30')](_0x2a6769[_0x091f('0x41')][_0x091f('0x30')]);}_0x2574c4['order']=qs[_0x091f('0x4a')](_0x2a6769[_0x091f('0x41')][_0x091f('0x4a')]);_0x2574c4[_0x091f('0x4b')]=qs['filters'](_[_0x091f('0x4c')](_0x2a6769['query'],_0x31029e[_0x091f('0x43')]),_0x4d06d1);if(_0x2a6769['query']['filter']){_0x2574c4[_0x091f('0x4b')]=_[_0x091f('0x4d')](_0x2574c4[_0x091f('0x4b')],{'$or':_[_0x091f('0x40')](_0x4d06d1,function(_0x56dbc5){if(_0x56dbc5[_0x091f('0x3f')]!==_0x091f('0x4e')){var _0x1695cf={};_0x1695cf[_0x56dbc5[_0x091f('0x3a')]]={'$like':'%'+_0x2a6769[_0x091f('0x41')][_0x091f('0x4f')]+'%'};return _0x1695cf;}})});}_0x2574c4=_[_0x091f('0x4d')]({},_0x2574c4,_0x2a6769[_0x091f('0x50')]);var _0x220919={'where':_0x2574c4[_0x091f('0x4b')]};return db[_0x091f('0x51')][_0x091f('0x52')](_0x220919)['then'](function(_0x38bb69){_0x590dd3[_0x091f('0x52')]=_0x38bb69;if(_0x2a6769[_0x091f('0x41')][_0x091f('0x53')]){_0x2574c4[_0x091f('0x54')]=[{'all':!![]}];}return db[_0x091f('0x51')][_0x091f('0x55')](_0x2574c4);})['then'](function(_0x32aaa6){_0x590dd3[_0x091f('0x56')]=_0x32aaa6;return _0x590dd3;})[_0x091f('0x21')](respondWithFilteredResult(_0xa211b4,_0x2574c4))['catch'](handleError(_0xa211b4,null));};exports[_0x091f('0x57')]=function(_0x49c898,_0x36595a){var _0x4fd0a9={'raw':!![],'where':{'id':_0x49c898[_0x091f('0x58')]['id']}},_0x2da457={};_0x2da457[_0x091f('0x45')]=_[_0x091f('0x42')](db[_0x091f('0x51')][_0x091f('0x3d')]);_0x2da457['query']=_['keys'](_0x49c898[_0x091f('0x41')]);_0x2da457[_0x091f('0x43')]=_[_0x091f('0x44')](_0x2da457[_0x091f('0x45')],_0x2da457['query']);_0x4fd0a9['attributes']=_[_0x091f('0x44')](_0x2da457[_0x091f('0x45')],qs[_0x091f('0x46')](_0x49c898[_0x091f('0x41')][_0x091f('0x46')]));_0x4fd0a9[_0x091f('0x47')]=_0x4fd0a9['attributes'][_0x091f('0x48')]?_0x4fd0a9['attributes']:_0x2da457[_0x091f('0x45')];if(_0x49c898[_0x091f('0x41')][_0x091f('0x53')]){_0x4fd0a9['include']=[{'all':!![]}];}_0x4fd0a9=_['merge']({},_0x4fd0a9,_0x49c898[_0x091f('0x50')]);return db[_0x091f('0x51')][_0x091f('0x59')](_0x4fd0a9)[_0x091f('0x21')](handleEntityNotFound(_0x36595a,null))[_0x091f('0x21')](respondWithResult(_0x36595a,null))['catch'](handleError(_0x36595a,null));};exports[_0x091f('0x5a')]=function(_0x284e18,_0x2625f1){return db[_0x091f('0x51')][_0x091f('0x5a')](_0x284e18['body'],{})[_0x091f('0x21')](respondWithResult(_0x2625f1,0xc9))['catch'](handleError(_0x2625f1,null));};exports[_0x091f('0x38')]=function(_0x1d2b75,_0x1100b8){if(_0x1d2b75['body']['id']){delete _0x1d2b75['body']['id'];}return db[_0x091f('0x51')][_0x091f('0x59')]({'where':{'id':_0x1d2b75[_0x091f('0x58')]['id']}})['then'](handleEntityNotFound(_0x1100b8,null))[_0x091f('0x21')](saveUpdates(_0x1d2b75[_0x091f('0x5b')],null))[_0x091f('0x21')](respondWithResult(_0x1100b8,null))[_0x091f('0x2c')](handleError(_0x1100b8,null));};exports[_0x091f('0x39')]=function(_0x195783,_0x3b6a3a){return db[_0x091f('0x51')]['find']({'where':{'id':_0x195783[_0x091f('0x58')]['id']}})[_0x091f('0x21')](handleEntityNotFound(_0x3b6a3a,null))['then'](removeEntity(_0x3b6a3a,null))[_0x091f('0x2c')](handleError(_0x3b6a3a,null));};exports['describe']=function(_0x13329f,_0x939d06){return db[_0x091f('0x51')][_0x091f('0x5c')]()['then'](respondWithResult(_0x939d06,null))[_0x091f('0x2c')](handleError(_0x939d06,null));};var interaction_log=require(_0x091f('0x14'))('openchannel-interactions');exports[_0x091f('0x5d')]=function(_0x3e493d,_0x7ef575,_0x4e920a){var _0x160aa6={'agent':{},'channel':'openchannel'};if(_0x3e493d[_0x091f('0x5b')]['id']){delete _0x3e493d[_0x091f('0x5b')]['id'];}_0x3e493d[_0x091f('0x5b')][_0x091f('0x5e')]=!![];_0x3e493d[_0x091f('0x5b')]['readAt']=moment()[_0x091f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e493d['body'][_0x091f('0x60')]=_0x3e493d[_0x091f('0x5b')][_0x091f('0x60')]||_0x3e493d[_0x091f('0x61')]['id'];_0x160aa6[_0x091f('0x62')]['id']=_0x3e493d[_0x091f('0x5b')][_0x091f('0x60')];return db[_0x091f('0x51')][_0x091f('0x59')]({'where':{'id':_0x3e493d[_0x091f('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7ef575,null))[_0x091f('0x21')](saveUpdates(_0x3e493d[_0x091f('0x5b')],null))['then'](function(_0x23f1ab){if(_0x23f1ab){_0x160aa6[_0x091f('0x29')]=_0x23f1ab[_0x091f('0x63')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x23f1ab[_0x091f('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x7ef575,null))['then'](function(_0x36505b){if(_0x36505b){return _0x36505b[_0x091f('0x38')]({'UserId':_0x3e493d[_0x091f('0x5b')][_0x091f('0x60')],'read1stAt':_['isNil'](_0x36505b['read1stAt'])?moment()[_0x091f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4f7f8f){if(_0x4f7f8f){_0x160aa6['interaction']=_0x4f7f8f[_0x091f('0x63')]({'plain':!![]});interaction_log[_0x091f('0x2a')](_0x091f('0x65'),_0x3e493d[_0x091f('0x61')]['id'],_0x3e493d[_0x091f('0x61')]['name'],_0x3e493d['user'][_0x091f('0x66')],_0x160aa6[_0x091f('0x67')]['id'],_0x3e493d['body']?JSON[_0x091f('0x26')](_0x3e493d['body']):'null');return respondWithRpcPromise(_0x091f('0x68'),_0x091f('0x69'),_0x160aa6);}return null;})[_0x091f('0x21')](function(_0x20938e){var _0xdf7cbd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20938e[_0x091f('0x29')][_0x091f('0x6a')];return db['sequelize']['query'](_0xdf7cbd,{'type':db['Sequelize'][_0x091f('0x6b')][_0x091f('0x6c')],'raw':!![]})['then'](function(_0x40b512){return _0x40b512;});})[_0x091f('0x21')](function(_0x352f4d){if(_0x352f4d){_0x160aa6[_0x091f('0x29')][_0x091f('0x6d')]=_0x352f4d[0x0];if(!_0x3e493d[_0x091f('0x5b')][_0x091f('0x60')])return;return db['User'][_0x091f('0x59')]({'where':{'id':_0x3e493d[_0x091f('0x5b')][_0x091f('0x60')],'role':_0x091f('0x62')},'attributes':['id','name',_0x091f('0x6e'),_0x091f('0x6f'),_0x091f('0x70')],'raw':!![]});}return null;})[_0x091f('0x21')](function(_0x3b36ba){if(!_0x3b36ba)return null;_0x160aa6[_0x091f('0x29')][_0x091f('0x62')]=_0x3b36ba;return _0x160aa6;})['then'](function(_0x2f2768){if(_0x2f2768){if(_0x3e493d[_0x091f('0x5b')]['manual']){_0x160aa6[_0x091f('0x29')][_0x091f('0x71')]=util[_0x091f('0x5f')](_0x091f('0x72'),_0x3e493d['user']['name']);_0x160aa6[_0x091f('0x29')]['channel']=_0x160aa6[_0x091f('0x73')];_0x160aa6['message']['motionChannel']=_0x160aa6[_0x091f('0x73')];_0x160aa6['message'][_0x091f('0x74')]=_0x091f('0x5d');return respondWithRpcPromise(_0x091f('0x75'),'EventManager',{'event':_0x091f('0x76'),'message':_0x160aa6[_0x091f('0x29')]},client9002)[_0x091f('0x21')](function(){return _0x160aa6;});}return _0x160aa6;}return null;})['then'](respondWithResult(_0x7ef575,null))[_0x091f('0x2c')](handleError(_0x7ef575,null));};var interaction_log=require(_0x091f('0x14'))(_0x091f('0x77'));exports[_0x091f('0x36')]=function(_0x3b4d08,_0x9dac7b,_0x4dabe5){var _0x1b3d24={'agent':{},'channel':_0x091f('0x78')};if(_0x3b4d08[_0x091f('0x5b')]['id']){delete _0x3b4d08['body']['id'];}_0x3b4d08['body'][_0x091f('0x60')]=_0x3b4d08['body'][_0x091f('0x60')]||_0x3b4d08[_0x091f('0x61')]['id'];_0x1b3d24['agent']['id']=_0x3b4d08[_0x091f('0x5b')]['UserId'];return db[_0x091f('0x51')]['find']({'where':{'id':_0x3b4d08['params']['id'],'UserId':null}})[_0x091f('0x21')](handleEntityNotFound(_0x9dac7b,null))[_0x091f('0x21')](function(_0x24c208){if(_0x24c208){_0x1b3d24[_0x091f('0x29')]=_0x24c208[_0x091f('0x63')]({'plain':!![]});return db[_0x091f('0x79')][_0x091f('0x59')]({'where':{'id':_0x24c208[_0x091f('0x64')]}});}return null;})[_0x091f('0x21')](handleEntityNotFound(_0x9dac7b,null))[_0x091f('0x21')](function(_0x3d2a97){if(_0x3d2a97){_0x1b3d24[_0x091f('0x67')]=_0x3d2a97[_0x091f('0x63')]({'plain':!![]});interaction_log[_0x091f('0x2a')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b4d08[_0x091f('0x61')]['id'],_0x3b4d08[_0x091f('0x61')][_0x091f('0x3a')],_0x3b4d08[_0x091f('0x61')][_0x091f('0x66')],_0x1b3d24[_0x091f('0x67')]['id'],_0x3b4d08[_0x091f('0x5b')]?JSON[_0x091f('0x26')](_0x3b4d08['body']):_0x091f('0x7a'));return respondWithRpcPromise(_0x091f('0x7b'),'rejectMessage',_0x1b3d24);}return null;})[_0x091f('0x21')](function(_0x22cd71){var _0x3a1135=_0x091f('0x7c')+_0x22cd71[_0x091f('0x29')][_0x091f('0x6a')];return db[_0x091f('0x7d')]['query'](_0x3a1135,{'type':db['Sequelize'][_0x091f('0x6b')]['SELECT'],'raw':!![]})[_0x091f('0x21')](function(_0x37488e){return _0x37488e;});})[_0x091f('0x21')](function(_0x180e5f){if(_0x180e5f){_0x1b3d24[_0x091f('0x29')][_0x091f('0x6d')]=_0x180e5f[0x0];if(!_0x3b4d08[_0x091f('0x5b')][_0x091f('0x60')])return;return db[_0x091f('0x7e')]['find']({'where':{'id':_0x3b4d08[_0x091f('0x5b')][_0x091f('0x60')],'role':'agent'},'attributes':['id',_0x091f('0x3a'),_0x091f('0x6e'),'email',_0x091f('0x70')],'raw':!![]});}return null;})['then'](function(_0x456107){if(!_0x456107)return null;_0x1b3d24[_0x091f('0x29')][_0x091f('0x62')]=_0x456107;return _0x1b3d24;})[_0x091f('0x21')](function(_0x4993c1){if(_0x4993c1){_0x4993c1[_0x091f('0x29')][_0x091f('0x71')]=util[_0x091f('0x5f')](_0x091f('0x72'),_0x3b4d08[_0x091f('0x61')][_0x091f('0x3a')]);_0x4993c1['message'][_0x091f('0x73')]=_0x1b3d24[_0x091f('0x73')];_0x4993c1['message'][_0x091f('0x7f')]=_0x1b3d24[_0x091f('0x73')];_0x4993c1['message'][_0x091f('0x74')]='reject';respondWithRpcPromise(_0x091f('0x75'),_0x091f('0x75'),{'event':_0x091f('0x80'),'message':_0x4993c1[_0x091f('0x29')]},client9002);return _0x1b3d24;}return null;})[_0x091f('0x21')](respondWithResult(_0x9dac7b,null))['catch'](handleError(_0x9dac7b,null));};
\ No newline at end of file
index 9360a1e..6ea9820 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0118=['save','remove','emit','hasOwnProperty','hook','events','OpenchannelMessage','setMaxListeners'];(function(_0x15cd46,_0x163193){var _0x49ae24=function(_0x27023f){while(--_0x27023f){_0x15cd46['push'](_0x15cd46['shift']());}};_0x49ae24(++_0x163193);}(_0x0118,0x115));var _0x8011=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0118[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x8011('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x8011('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8011('0x2')](0x0);var events={'afterCreate':_0x8011('0x3'),'afterUpdate':'update','afterDestroy':_0x8011('0x4')};function emitEvent(_0x214357){return function(_0x2e9bf0,_0x53b9bc,_0x189447){OpenchannelMessageEvents[_0x8011('0x5')](_0x214357+':'+_0x2e9bf0['id'],_0x2e9bf0);OpenchannelMessageEvents[_0x8011('0x5')](_0x214357,_0x2e9bf0);_0x189447(null);};}for(var e in events){if(events[_0x8011('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8011('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x6482=['OpenchannelMessage','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1eb310,_0x570fd8){var _0x12000a=function(_0xa5c42d){while(--_0xa5c42d){_0x1eb310['push'](_0x1eb310['shift']());}};_0x12000a(++_0x570fd8);}(_0x6482,0x1ce));var _0x2648=function(_0x2ff8f1,_0x114dea){_0x2ff8f1=_0x2ff8f1-0x0;var _0x34bc96=_0x6482[_0x2ff8f1];return _0x34bc96;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x2648('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2648('0x1'),'afterDestroy':_0x2648('0x2')};function emitEvent(_0x1e4b30){return function(_0x56640d,_0x18bc50,_0x164d58){OpenchannelMessageEvents[_0x2648('0x3')](_0x1e4b30+':'+_0x56640d['id'],_0x56640d);OpenchannelMessageEvents[_0x2648('0x3')](_0x1e4b30,_0x56640d);_0x164d58(null);};}for(var e in events){if(events[_0x2648('0x4')](e)){var event=events[e];OpenchannelMessage[_0x2648('0x5')](e,emitEvent(event));}}module[_0x2648('0x6')]=OpenchannelMessageEvents;
\ No newline at end of file
index df7d2a1..a0b3d80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','direction','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4_unicode_ci'];(function(_0x26ea33,_0xcbb9f7){var _0x171c05=function(_0x5d9a85){while(--_0x5d9a85){_0x26ea33['push'](_0x26ea33['shift']());}};_0x171c05(++_0xcbb9f7);}(_0x8f4c,0x113));var _0xc8f4=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x8f4c[_0x51fe5f];return _0x4abce9;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xc')],'type':_0xc8f4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39ed63,_0x34f05f,_0x599de3){var _0x38c41b=_0x5208da[_0xc8f4('0xe')];var _0x2fba62=_0x39ed63[_0xc8f4('0xf')]({'plain':!![]});if(_0x2fba62['direction'][_0xc8f4('0x10')]()==='in'||_0x2fba62['direction'][_0xc8f4('0x10')]()===_0xc8f4('0x11')&&!_0x2fba62[_0xc8f4('0x12')]&&!_[_0xc8f4('0x13')](_0x2fba62[_0xc8f4('0x14')])){_0x38c41b['OpenchannelInteraction'][_0xc8f4('0x15')]({'where':{'id':_0x2fba62[_0xc8f4('0x16')]}})[_0xc8f4('0x17')](function(_0x14bc11){if(_0x14bc11){_0x14bc11[_0xc8f4('0x18')]({'lastMsgAt':_0x2fba62[_0xc8f4('0x19')],'lastMsgDirection':_0x2fba62['direction'][_0xc8f4('0x10')]()});}})[_0xc8f4('0x1a')](function(_0x1518a6){console[_0xc8f4('0x1b')](_0x1518a6);});}if(_0x2fba62[_0xc8f4('0x1c')]==='out'&&!_0x2fba62[_0xc8f4('0x12')]){var _0x4d2b77;_0x38c41b['CmContact'][_0xc8f4('0x1d')]()[_0xc8f4('0x17')](function(_0x108076){return _0x38c41b[_0xc8f4('0x1e')][_0xc8f4('0x1f')]({'where':{'id':_0x2fba62[_0xc8f4('0x20')]},'include':[{'model':_0x38c41b[_0xc8f4('0x21')],'as':_0xc8f4('0x22'),'where':{'id':_0x2fba62[_0xc8f4('0x16')]},'limit':0x1,'include':[{'model':_0x38c41b[_0xc8f4('0x23')],'as':_0xc8f4('0x24'),'attributes':_[_0xc8f4('0x25')](_0x108076)}]}]});})[_0xc8f4('0x17')](function(_0x5f3264){_0x4d2b77=_0x5f3264[_0xc8f4('0xf')]({'plain':!![]});if(_0x4d2b77&&_0x4d2b77[_0xc8f4('0x26')]){logger[_0xc8f4('0x27')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x2b'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x4d2b77['Interactions']&&_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x2c')]){_0x2fba62[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x4d2b77['Interactions'][0x0],_0xc8f4('0x24'));_0x2fba62['Contact']=_0x4d2b77[_0xc8f4('0x22')][0x0]['Contact'];}var _0x34f05f={'method':_0xc8f4('0x2f'),'uri':encodeURI(_0x4d2b77['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34f05f[_0xc8f4('0x30')]){case _0xc8f4('0x31'):_0x34f05f['qs']=_0x2fba62;break;case _0xc8f4('0x2f'):_0x34f05f[_0xc8f4('0xc')]=_0x2fba62;break;}return rp(_0x34f05f)['then'](function(_0x3db490){logger[_0xc8f4('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x32'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x3db490[_0xc8f4('0xc')][_0xc8f4('0x33')]&&_0x3db490['body'][_0xc8f4('0x33')]!=_0x2fba62[_0xc8f4('0x2d')][_0xc8f4('0x33')]){return _0x38c41b['OpenchannelInteraction'][_0xc8f4('0x18')]({'threadId':_0x3db490[_0xc8f4('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x2fba62['Interaction']['id']}});}else{return;}})['then'](function(){return _0x39ed63[_0xc8f4('0x18')]({'read':!![]});})[_0xc8f4('0x1a')](function(_0x2e9a2a){logger[_0xc8f4('0x1b')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x34')](_0x2e9a2a,{'showHidden':![],'depth':null}));_0x599de3();});}else{_0x599de3();}})[_0xc8f4('0x35')](function(){_0x599de3();});}else{_0x599de3();}}},'charset':'utf8mb4','collate':_0xc8f4('0x36')});};
\ No newline at end of file
+var _0x36ee=['request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','error','CmContact','then','find','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','POST','method','GET','body','format','threadId','update','Interaction','inspect','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird'];(function(_0x39fcd7,_0x2082ee){var _0x1f3e84=function(_0x2f0eb0){while(--_0x2f0eb0){_0x39fcd7['push'](_0x39fcd7['shift']());}};_0x1f3e84(++_0x2082ee);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe36e('0x0'))('api');var moment=require(_0xe36e('0x1'));var BPromise=require(_0xe36e('0x2'));var rp=require(_0xe36e('0x3'));var fs=require('fs');var path=require(_0xe36e('0x4'));var rimraf=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var attributes=require(_0xe36e('0x7'));module[_0xe36e('0x8')]=function(_0x25a07d,_0x190404){return _0x25a07d[_0xe36e('0x9')](_0xe36e('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xe36e('0xb'),'fields':['body'],'type':_0xe36e('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x123c16,_0x46f239,_0x47ce3a){var _0xf119e4=_0x25a07d['models'];var _0x2e968d=_0x123c16[_0xe36e('0xd')]({'plain':!![]});if(_0x2e968d[_0xe36e('0xe')][_0xe36e('0xf')]()==='in'||_0x2e968d[_0xe36e('0xe')][_0xe36e('0xf')]()===_0xe36e('0x10')&&!_0x2e968d[_0xe36e('0x11')]&&!_['isNil'](_0x2e968d[_0xe36e('0x12')])){_0xf119e4[_0xe36e('0x13')][_0xe36e('0x14')]({'where':{'id':_0x2e968d[_0xe36e('0x15')]}})['then'](function(_0x3e264a){if(_0x3e264a){_0x3e264a['update']({'lastMsgAt':_0x2e968d['createdAt'],'lastMsgDirection':_0x2e968d[_0xe36e('0xe')][_0xe36e('0xf')]()});}})[_0xe36e('0x16')](function(_0x278135){console[_0xe36e('0x17')](_0x278135);});}if(_0x2e968d[_0xe36e('0xe')]===_0xe36e('0x10')&&!_0x2e968d[_0xe36e('0x11')]){var _0x387c37;_0xf119e4[_0xe36e('0x18')]['describe']()[_0xe36e('0x19')](function(_0x2184ae){return _0xf119e4['OpenchannelAccount'][_0xe36e('0x1a')]({'where':{'id':_0x2e968d['OpenchannelAccountId']},'include':[{'model':_0xf119e4[_0xe36e('0x13')],'as':_0xe36e('0x1b'),'where':{'id':_0x2e968d['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xf119e4[_0xe36e('0x18')],'as':_0xe36e('0x1c'),'attributes':_[_0xe36e('0x1d')](_0x2184ae)}]}]});})['then'](function(_0x21e95e){_0x387c37=_0x21e95e[_0xe36e('0xd')]({'plain':!![]});if(_0x387c37&&_0x387c37[_0xe36e('0x1e')]){logger[_0xe36e('0x1f')](_0xe36e('0x20'),_0xe36e('0x21'),util['format'](_0xe36e('0x22'),_0x2e968d['id'],_0x387c37[_0xe36e('0x1e')]));if(_0x387c37[_0xe36e('0x1b')]&&_0x387c37[_0xe36e('0x1b')][_0xe36e('0x23')]){_0x2e968d['Interaction']=_['omit'](_0x387c37[_0xe36e('0x1b')][0x0],_0xe36e('0x1c'));_0x2e968d[_0xe36e('0x1c')]=_0x387c37[_0xe36e('0x1b')][0x0][_0xe36e('0x1c')];}var _0x46f239={'method':_0xe36e('0x24'),'uri':encodeURI(_0x387c37['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46f239[_0xe36e('0x25')]){case _0xe36e('0x26'):_0x46f239['qs']=_0x2e968d;break;case _0xe36e('0x24'):_0x46f239[_0xe36e('0x27')]=_0x2e968d;break;}return rp(_0x46f239)['then'](function(_0x2d757c){logger['info'](_0xe36e('0x20'),'afterCreate',util[_0xe36e('0x28')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2e968d['id'],_0x387c37[_0xe36e('0x1e')]));if(_0x2d757c['body'][_0xe36e('0x29')]&&_0x2d757c['body']['threadId']!=_0x2e968d['Interaction']['threadId']){return _0xf119e4[_0xe36e('0x13')][_0xe36e('0x2a')]({'threadId':_0x2d757c['body']['threadId']},{'logging':!![],'where':{'id':_0x2e968d[_0xe36e('0x2b')]['id']}});}else{return;}})[_0xe36e('0x19')](function(){return _0x123c16[_0xe36e('0x2a')]({'read':!![]});})[_0xe36e('0x16')](function(_0x3d826e){logger[_0xe36e('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xe36e('0x21'),util[_0xe36e('0x2c')](_0x3d826e,{'showHidden':![],'depth':null}));_0x47ce3a();});}else{_0x47ce3a();}})['finally'](function(){_0x47ce3a();});}else{_0x47ce3a();}}},'charset':_0xe36e('0x2d'),'collate':_0xe36e('0x2e')});};
\ No newline at end of file
index 6a073fa..ed70cdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4857bc,_0x43b6aa){var _0x54f650=function(_0x442f35){while(--_0x442f35){_0x4857bc['push'](_0x4857bc['shift']());}};_0x54f650(++_0x43b6aa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x33274b,_0x10f65b){_0x33274b=_0x33274b-0x0;var _0x1e4978=_0x5f2f[_0x33274b];return _0x1e4978;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});};
\ No newline at end of file
+var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x5a4962,_0x42e69a){var _0x3a156f=function(_0x33d726){while(--_0x33d726){_0x5a4962['push'](_0x5a4962['shift']());}};_0x3a156f(++_0x42e69a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});};
\ No newline at end of file
index fc45888..26e02c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf350=['./openchannelMessage.events','update','emit'];(function(_0x42ac53,_0xe2600){var _0x237fb0=function(_0x1040a6){while(--_0x1040a6){_0x42ac53['push'](_0x42ac53['shift']());}};_0x237fb0(++_0xe2600);}(_0xf350,0x105));var _0x0f35=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf350[_0x4565bf];return _0x5610ba;};'use strict';var OpenchannelMessageEvents=require(_0x0f35('0x0'));var events=['save','remove',_0x0f35('0x1')];function createListener(_0x1c3ffe,_0xd06af5){return function(_0x363a5f){_0xd06af5[_0x0f35('0x2')](_0x1c3ffe,_0x363a5f);};}function removeListener(_0x42652f,_0x25060b){return function(){OpenchannelMessageEvents['removeListener'](_0x42652f,_0x25060b);};}exports['register']=function(_0x557c1d){for(var _0x348399=0x0,_0x2c61c4=events['length'];_0x348399<_0x2c61c4;_0x348399++){var _0x544342=events[_0x348399];var _0x2c716b=createListener('openchannelMessage:'+_0x544342,_0x557c1d);OpenchannelMessageEvents['on'](_0x544342,_0x2c716b);}};
\ No newline at end of file
+var _0x7163=['removeListener','length','openchannelMessage:','./openchannelMessage.events','update','emit'];(function(_0x28ae00,_0x2efedd){var _0x56c41c=function(_0x54b9f6){while(--_0x54b9f6){_0x28ae00['push'](_0x28ae00['shift']());}};_0x56c41c(++_0x2efedd);}(_0x7163,0x1ef));var _0x3716=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x7163[_0x49d41c];return _0xb64c5f;};'use strict';var OpenchannelMessageEvents=require(_0x3716('0x0'));var events=['save','remove',_0x3716('0x1')];function createListener(_0x396758,_0x138388){return function(_0x58e0ce){_0x138388[_0x3716('0x2')](_0x396758,_0x58e0ce);};}function removeListener(_0x3da057,_0x1ec9df){return function(){OpenchannelMessageEvents[_0x3716('0x3')](_0x3da057,_0x1ec9df);};}exports['register']=function(_0x5c81bb){for(var _0x3112a7=0x0,_0x4549b2=events[_0x3716('0x4')];_0x3112a7<_0x4549b2;_0x3112a7++){var _0x14bfe0=events[_0x3112a7];var _0x3c84bf=createListener(_0x3716('0x5')+_0x14bfe0,_0x5c81bb);OpenchannelMessageEvents['on'](_0x14bfe0,_0x3c84bf);}};
\ No newline at end of file
index bfb3897..436ddf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ce=['describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe'];(function(_0x40df09,_0x385c19){var _0x8d156c=function(_0x5cb5a9){while(--_0x5cb5a9){_0x40df09['push'](_0x40df09['shift']());}};_0x8d156c(++_0x385c19);}(_0x80ce,0x1e0));var _0xe80c=function(_0x4de879,_0x2212b1){_0x4de879=_0x4de879-0x0;var _0x3659a2=_0x80ce[_0x4de879];return _0x3659a2;};'use strict';var multer=require(_0xe80c('0x0'));var util=require(_0xe80c('0x1'));var path=require(_0xe80c('0x2'));var timeout=require(_0xe80c('0x3'));var express=require('express');var router=express[_0xe80c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe80c('0x5'));var interaction=require(_0xe80c('0x6'));var config=require(_0xe80c('0x7'));var controller=require(_0xe80c('0x8'));router['get']('/',auth[_0xe80c('0x9')](),controller[_0xe80c('0xa')]);router[_0xe80c('0xb')](_0xe80c('0xc'),auth['isAuthenticated'](),controller[_0xe80c('0xd')]);router[_0xe80c('0xb')](_0xe80c('0xe'),auth[_0xe80c('0x9')](),controller['show']);router['get'](_0xe80c('0xf'),auth[_0xe80c('0x9')](),controller[_0xe80c('0x10')]);router['get'](_0xe80c('0x11'),auth['isAuthenticated'](),controller[_0xe80c('0x12')]);router[_0xe80c('0xb')](_0xe80c('0x13'),auth[_0xe80c('0x9')](),controller[_0xe80c('0x14')]);router[_0xe80c('0x15')]('/',auth[_0xe80c('0x9')](),controller[_0xe80c('0x16')]);router[_0xe80c('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe80c('0x17')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xe80c('0x18')]('/:id',auth[_0xe80c('0x9')](),controller['update']);router[_0xe80c('0x19')]('/:id',auth[_0xe80c('0x9')](),controller[_0xe80c('0x1a')]);router['delete']('/:id/teams',auth[_0xe80c('0x9')](),controller[_0xe80c('0x1b')]);router[_0xe80c('0x19')]('/:id/users',auth[_0xe80c('0x9')](),controller['removeAgents']);module[_0xe80c('0x1c')]=router;
\ No newline at end of file
+var _0xbd33=['/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','destroy','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','getMembers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd33,0x76));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x3bd3('0x0'));var util=require(_0x3bd3('0x1'));var path=require(_0x3bd3('0x2'));var timeout=require(_0x3bd3('0x3'));var express=require(_0x3bd3('0x4'));var router=express[_0x3bd3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3bd3('0x6'));var interaction=require(_0x3bd3('0x7'));var config=require(_0x3bd3('0x8'));var controller=require(_0x3bd3('0x9'));router[_0x3bd3('0xa')]('/',auth['isAuthenticated'](),controller[_0x3bd3('0xb')]);router[_0x3bd3('0xa')](_0x3bd3('0xc'),auth[_0x3bd3('0xd')](),controller[_0x3bd3('0xe')]);router[_0x3bd3('0xa')](_0x3bd3('0xf'),auth[_0x3bd3('0xd')](),controller['show']);router[_0x3bd3('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x3bd3('0x10')]);router[_0x3bd3('0xa')](_0x3bd3('0x11'),auth['isAuthenticated'](),controller[_0x3bd3('0x12')]);router[_0x3bd3('0xa')](_0x3bd3('0x13'),auth[_0x3bd3('0xd')](),controller[_0x3bd3('0x14')]);router[_0x3bd3('0x15')]('/',auth[_0x3bd3('0xd')](),controller['create']);router[_0x3bd3('0x15')](_0x3bd3('0x11'),auth[_0x3bd3('0xd')](),controller[_0x3bd3('0x16')]);router['post'](_0x3bd3('0x13'),auth['isAuthenticated'](),controller[_0x3bd3('0x17')]);router['put'](_0x3bd3('0xf'),auth[_0x3bd3('0xd')](),controller[_0x3bd3('0x18')]);router['delete'](_0x3bd3('0xf'),auth['isAuthenticated'](),controller[_0x3bd3('0x19')]);router[_0x3bd3('0x1a')]('/:id/teams',auth[_0x3bd3('0xd')](),controller['removeTeams']);router['delete'](_0x3bd3('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index f7a64b6..6daf9ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa93c=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x119f6f,_0xe175e9){var _0xf9334e=function(_0x3d998c){while(--_0x3d998c){_0x119f6f['push'](_0x119f6f['shift']());}};_0xf9334e(++_0xe175e9);}(_0xa93c,0x1b8));var _0xca93=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0xa93c[_0xf31767];return _0x24bd0c;};'use strict';var Sequelize=require(_0xca93('0x0'));module[_0xca93('0x1')]={'name':{'type':Sequelize[_0xca93('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xca93('0x2')]},'timeout':{'type':Sequelize[_0xca93('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xca93('0x4')](_0xca93('0x5'),'beepall',_0xca93('0x6'))}};
\ No newline at end of file
+var _0x247d=['exports','STRING','name','INTEGER','rrmemory','sequelize'];(function(_0x50d43b,_0x5ec81a){var _0x40fb92=function(_0xa6ba2c){while(--_0xa6ba2c){_0x50d43b['push'](_0x50d43b['shift']());}};_0x40fb92(++_0x5ec81a);}(_0x247d,0x1bb));var _0xd247=function(_0x5111ce,_0x222c68){_0x5111ce=_0x5111ce-0x0;var _0x26ca18=_0x247d[_0x5111ce];return _0x26ca18;};'use strict';var Sequelize=require(_0xd247('0x0'));module[_0xd247('0x1')]={'name':{'type':Sequelize[_0xd247('0x2')],'unique':_0xd247('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd247('0x2')]},'timeout':{'type':Sequelize[_0xd247('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd247('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
index f5dd030..7a11278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87b1=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','socket.io-emitter','sendStatus','end','status','json','offset','count','limit','apply','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','describe','getMembers','findOne','UserOpenchannelQueue','length','User','findAndCountAll','UserId','agent','format','%s/%s','SIP','openchannelPause','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','TeamId','all','union','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','order'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0x87b1,0x192));var _0x187b=function(_0x39a8de,_0x135be6){_0x39a8de=_0x39a8de-0x0;var _0x440106=_0x87b1[_0x39a8de];return _0x440106;};'use strict';var emlformat=require(_0x187b('0x0'));var rimraf=require(_0x187b('0x1'));var zipdir=require(_0x187b('0x2'));var jsonpatch=require(_0x187b('0x3'));var rp=require(_0x187b('0x4'));var moment=require(_0x187b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x187b('0x6'));var util=require('util');var path=require(_0x187b('0x7'));var sox=require(_0x187b('0x8'));var csv=require(_0x187b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x187b('0xa'));var _=require(_0x187b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x187b('0xc'));var deskjs=require(_0x187b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x187b('0xe'));var Redis=require(_0x187b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x187b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x187b('0x11'));var logger=require(_0x187b('0x12'))(_0x187b('0x13'));var utils=require(_0x187b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x187b('0x15'));var db=require('../../mysqldb')['db'];config[_0x187b('0x16')]=_['defaults'](config[_0x187b('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x187b('0x17'))(new Redis(config[_0x187b('0x16')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x2485b5,_0x36f76c){_0x36f76c=_0x36f76c||0xcc;return function(_0x5ccd72){if(_0x5ccd72){return _0x2485b5[_0x187b('0x18')](_0x36f76c);}return _0x2485b5['status'](_0x36f76c)[_0x187b('0x19')]();};}function respondWithResult(_0x1ebeee,_0x528da7){_0x528da7=_0x528da7||0xc8;return function(_0x2e46be){if(_0x2e46be){return _0x1ebeee[_0x187b('0x1a')](_0x528da7)[_0x187b('0x1b')](_0x2e46be);}};}function respondWithFilteredResult(_0x2d28c9,_0x588eb3){return function(_0x1c7b70){if(_0x1c7b70){var _0x27e138=typeof _0x588eb3[_0x187b('0x1c')]==='undefined'&&typeof _0x588eb3['limit']==='undefined';var _0x246a4e=_0x1c7b70[_0x187b('0x1d')];var _0x2253aa=_0x27e138?0x0:_0x588eb3[_0x187b('0x1c')];var _0x1bb19d=_0x27e138?_0x1c7b70[_0x187b('0x1d')]:_0x588eb3[_0x187b('0x1c')]+_0x588eb3[_0x187b('0x1e')];var _0x5c8989;if(_0x1bb19d>=_0x246a4e){_0x1bb19d=_0x246a4e;_0x5c8989=0xc8;}else{_0x5c8989=0xce;}_0x2d28c9[_0x187b('0x1a')](_0x5c8989);return _0x2d28c9['set']('Content-Range',_0x2253aa+'-'+_0x1bb19d+'/'+_0x246a4e)[_0x187b('0x1b')](_0x1c7b70);}return null;};}function patchUpdates(_0x24fe1f){return function(_0x4c5c52){try{jsonpatch[_0x187b('0x1f')](_0x4c5c52,_0x24fe1f,!![]);}catch(_0x4d5ef7){return BPromise['reject'](_0x4d5ef7);}return _0x4c5c52['save']();};}function saveUpdates(_0x54ceef,_0x46a25c){return function(_0x1e5d67){if(_0x1e5d67){return _0x1e5d67['update'](_0x54ceef)[_0x187b('0x20')](function(_0xbd094a){return _0xbd094a;});}return null;};}function removeEntity(_0x1bdfcb,_0x54c0d5){return function(_0x46497f){if(_0x46497f){return _0x46497f[_0x187b('0x21')]()[_0x187b('0x20')](function(){var _0x4f25a1=_0x46497f[_0x187b('0x22')]({'plain':!![]});var _0x1d4c56=_0x187b('0x23');return db[_0x187b('0x24')]['destroy']({'where':{'type':_0x1d4c56,'resourceId':_0x4f25a1['id']}})['then'](function(){return _0x46497f;});})[_0x187b('0x20')](function(){_0x1bdfcb[_0x187b('0x1a')](0xcc)[_0x187b('0x19')]();});}};}function handleEntityNotFound(_0x11aea0,_0x2d56ed){return function(_0x1aca77){if(!_0x1aca77){_0x11aea0[_0x187b('0x18')](0x194);}return _0x1aca77;};}function handleError(_0x615d1e,_0x37fba6){_0x37fba6=_0x37fba6||0x1f4;return function(_0x56c4f4){logger[_0x187b('0x25')](_0x56c4f4[_0x187b('0x26')]);if(_0x56c4f4[_0x187b('0x27')]){delete _0x56c4f4[_0x187b('0x27')];}_0x615d1e[_0x187b('0x1a')](_0x37fba6)[_0x187b('0x28')](_0x56c4f4);};}exports[_0x187b('0x29')]=function(_0x52dc3b,_0x2f8481){var _0x370420={},_0xe127a4={},_0xd96cdb={'count':0x0,'rows':[]};var _0x445181=_[_0x187b('0x2a')](db[_0x187b('0x2b')][_0x187b('0x2c')],function(_0x1d9bde){return{'name':_0x1d9bde[_0x187b('0x2d')],'type':_0x1d9bde[_0x187b('0x2e')][_0x187b('0x2f')]};});_0xe127a4[_0x187b('0x30')]=_[_0x187b('0x2a')](_0x445181,_0x187b('0x27'));_0xe127a4[_0x187b('0x31')]=_[_0x187b('0x32')](_0x52dc3b[_0x187b('0x31')]);_0xe127a4['filters']=_[_0x187b('0x33')](_0xe127a4[_0x187b('0x30')],_0xe127a4['query']);_0x370420[_0x187b('0x34')]=_[_0x187b('0x33')](_0xe127a4['model'],qs[_0x187b('0x35')](_0x52dc3b['query'][_0x187b('0x35')]));_0x370420['attributes']=_0x370420['attributes']['length']?_0x370420['attributes']:_0xe127a4[_0x187b('0x30')];if(!_0x52dc3b[_0x187b('0x31')][_0x187b('0x36')](_0x187b('0x37'))){_0x370420[_0x187b('0x1e')]=qs['limit'](_0x52dc3b[_0x187b('0x31')]['limit']);_0x370420[_0x187b('0x1c')]=qs['offset'](_0x52dc3b['query'][_0x187b('0x1c')]);}_0x370420['order']=qs[_0x187b('0x38')](_0x52dc3b[_0x187b('0x31')]['sort']);_0x370420[_0x187b('0x39')]=qs[_0x187b('0x3a')](_[_0x187b('0x3b')](_0x52dc3b['query'],_0xe127a4['filters']),_0x445181);if(_0x52dc3b[_0x187b('0x31')][_0x187b('0x3c')]){_0x370420[_0x187b('0x39')]=_['merge'](_0x370420[_0x187b('0x39')],{'$or':_['map'](_0x445181,function(_0x8d89c0){if(_0x8d89c0['type']!==_0x187b('0x3d')){var _0x4b30d8={};_0x4b30d8[_0x8d89c0[_0x187b('0x27')]]={'$like':'%'+_0x52dc3b[_0x187b('0x31')][_0x187b('0x3c')]+'%'};return _0x4b30d8;}})});}_0x370420=_[_0x187b('0x3e')]({},_0x370420,_0x52dc3b[_0x187b('0x3f')]);var _0x276261={'where':_0x370420[_0x187b('0x39')]};return db['OpenchannelQueue'][_0x187b('0x1d')](_0x276261)['then'](function(_0xa4b827){_0xd96cdb[_0x187b('0x1d')]=_0xa4b827;if(_0x52dc3b['query'][_0x187b('0x40')]){_0x370420['include']=[{'all':!![]}];}return db[_0x187b('0x2b')][_0x187b('0x41')](_0x370420);})[_0x187b('0x20')](function(_0x560b04){_0xd96cdb[_0x187b('0x42')]=_0x560b04;return _0xd96cdb;})['then'](respondWithFilteredResult(_0x2f8481,_0x370420))[_0x187b('0x43')](handleError(_0x2f8481,null));};exports[_0x187b('0x44')]=function(_0x15b344,_0x5ce763){var _0x14de08={'raw':!![],'where':{'id':_0x15b344[_0x187b('0x45')]['id']}},_0x89e84f={};_0x89e84f[_0x187b('0x30')]=_['keys'](db['OpenchannelQueue'][_0x187b('0x2c')]);_0x89e84f[_0x187b('0x31')]=_[_0x187b('0x32')](_0x15b344['query']);_0x89e84f[_0x187b('0x3a')]=_[_0x187b('0x33')](_0x89e84f[_0x187b('0x30')],_0x89e84f['query']);_0x14de08[_0x187b('0x34')]=_[_0x187b('0x33')](_0x89e84f['model'],qs['fields'](_0x15b344['query'][_0x187b('0x35')]));_0x14de08[_0x187b('0x34')]=_0x14de08[_0x187b('0x34')]['length']?_0x14de08[_0x187b('0x34')]:_0x89e84f[_0x187b('0x30')];if(_0x15b344[_0x187b('0x31')][_0x187b('0x40')]){_0x14de08[_0x187b('0x46')]=[{'all':!![]}];}_0x14de08=_[_0x187b('0x3e')]({},_0x14de08,_0x15b344[_0x187b('0x3f')]);return db[_0x187b('0x2b')][_0x187b('0x47')](_0x14de08)[_0x187b('0x20')](handleEntityNotFound(_0x5ce763,null))[_0x187b('0x20')](respondWithResult(_0x5ce763,null))[_0x187b('0x43')](handleError(_0x5ce763,null));};exports[_0x187b('0x48')]=function(_0x5833e3,_0x41e486){return db[_0x187b('0x2b')][_0x187b('0x48')](_0x5833e3[_0x187b('0x49')],{})[_0x187b('0x20')](function(_0x429ac1){var _0x558e2c=_0x5833e3[_0x187b('0x4a')][_0x187b('0x22')]({'plain':!![]});if(!_0x558e2c)throw new Error(_0x187b('0x4b'));if(_0x558e2c['role']===_0x187b('0x4a')){var _0x121f2d=_0x429ac1['get']({'plain':!![]});var _0x1f6001=_0x187b('0x23');return db[_0x187b('0x4c')][_0x187b('0x47')]({'where':{'name':_0x1f6001,'userProfileId':_0x558e2c[_0x187b('0x4d')]},'raw':!![]})['then'](function(_0x448eeb){if(_0x448eeb&&_0x448eeb[_0x187b('0x4e')]===0x0){return db['UserProfileResource'][_0x187b('0x48')]({'name':_0x121f2d[_0x187b('0x27')],'resourceId':_0x121f2d['id'],'type':_0x448eeb[_0x187b('0x27')],'sectionId':_0x448eeb['id']},{})[_0x187b('0x20')](function(){return _0x429ac1;});}else{return _0x429ac1;}})[_0x187b('0x43')](function(_0x597b9e){logger[_0x187b('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x597b9e);throw _0x597b9e;});}return _0x429ac1;})['then'](respondWithResult(_0x41e486,0xc9))[_0x187b('0x43')](handleError(_0x41e486,null));};exports[_0x187b('0x4f')]=function(_0x1752db,_0x220153){if(_0x1752db['body']['id']){delete _0x1752db['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x1752db['params']['id']}})['then'](handleEntityNotFound(_0x220153,null))['then'](saveUpdates(_0x1752db['body'],null))[_0x187b('0x20')](respondWithResult(_0x220153,null))[_0x187b('0x43')](handleError(_0x220153,null));};exports['destroy']=function(_0x2a79d4,_0x2f13ac){return db[_0x187b('0x2b')][_0x187b('0x47')]({'where':{'id':_0x2a79d4['params']['id']}})[_0x187b('0x20')](handleEntityNotFound(_0x2f13ac,null))[_0x187b('0x20')](removeEntity(_0x2f13ac,null))['catch'](handleError(_0x2f13ac,null));};exports[_0x187b('0x50')]=function(_0x505283,_0x42b121){return db[_0x187b('0x2b')][_0x187b('0x50')]()[_0x187b('0x20')](respondWithResult(_0x42b121,null))[_0x187b('0x43')](handleError(_0x42b121,null));};exports[_0x187b('0x51')]=function(_0x2d40e0,_0x7c50bb,_0x525676){var _0x415b3d={'raw':!![],'where':{}},_0x415120={},_0x59aa7a;return db[_0x187b('0x2b')][_0x187b('0x52')]({'where':{'id':_0x2d40e0['params']['id']}})[_0x187b('0x20')](handleEntityNotFound(_0x7c50bb,null))['then'](function(_0x440b6b){if(_0x440b6b){_0x59aa7a=_0x440b6b[_0x187b('0x22')]({'plain':!![]});_0x415120[_0x187b('0x30')]=_[_0x187b('0x32')](db[_0x187b('0x53')][_0x187b('0x2c')]);_0x415120['query']=_['keys'](_0x2d40e0['query']);_0x415120[_0x187b('0x3a')]=_[_0x187b('0x33')](_0x415120['model'],_0x415120[_0x187b('0x31')]);_0x415b3d['attributes']=_[_0x187b('0x33')](_0x415120['model'],qs['fields'](_0x2d40e0[_0x187b('0x31')][_0x187b('0x35')]));_0x415b3d[_0x187b('0x34')]=_0x415b3d[_0x187b('0x34')][_0x187b('0x54')]?_0x415b3d[_0x187b('0x34')]:_0x415120[_0x187b('0x30')];if(!_0x2d40e0[_0x187b('0x31')]['hasOwnProperty']('nolimit')){_0x415b3d[_0x187b('0x1e')]=qs[_0x187b('0x1e')](_0x2d40e0[_0x187b('0x31')]['limit']);_0x415b3d['offset']=qs[_0x187b('0x1c')](_0x2d40e0[_0x187b('0x31')][_0x187b('0x1c')]);}_0x415b3d['order']=qs[_0x187b('0x38')](_0x2d40e0[_0x187b('0x31')][_0x187b('0x38')]);_0x415b3d['where']=qs[_0x187b('0x3a')](_[_0x187b('0x3b')](_0x2d40e0[_0x187b('0x31')],_0x415120[_0x187b('0x3a')]));_0x415b3d[_0x187b('0x39')]['OpenchannelQueueId']=_0x440b6b['id'];if(_0x2d40e0[_0x187b('0x31')][_0x187b('0x3c')]){_0x415b3d[_0x187b('0x39')]=_['merge'](_0x415b3d['where'],{'$or':_[_0x187b('0x2a')](_0x415b3d[_0x187b('0x34')],function(_0x128d0e){var _0xad2cc4={};_0xad2cc4[_0x128d0e]={'$like':'%'+_0x2d40e0[_0x187b('0x31')]['filter']+'%'};return _0xad2cc4;})});}_0x415b3d=_[_0x187b('0x3e')]({},_0x415b3d,_0x2d40e0[_0x187b('0x3f')]);return db[_0x187b('0x53')][_0x187b('0x41')](_0x415b3d);}})[_0x187b('0x20')](function(_0x433c75){if(_0x433c75){return db[_0x187b('0x55')][_0x187b('0x56')]({'where':{'id':_['map'](_0x433c75,_0x187b('0x57')),'role':_0x187b('0x58')},'attributes':['id',_0x187b('0x27'),'openchannelPause','updatedAt','createdAt']});}})['then'](function(_0x37171c){if(_0x37171c){return{'count':_0x37171c[_0x187b('0x1d')],'rows':_[_0x187b('0x2a')](_0x37171c[_0x187b('0x42')],function(_0x274ebb){return{'membername':_0x274ebb['name'],'UserId':_0x274ebb['id'],'queue_name':_0x59aa7a[_0x187b('0x27')],'OpenchannelQueueId':_0x59aa7a['id'],'interface':util[_0x187b('0x59')](_0x187b('0x5a'),_0x187b('0x5b'),_0x274ebb[_0x187b('0x27')]),'penalty':0x0,'paused':_0x274ebb[_0x187b('0x5c')],'createdAt':_0x274ebb[_0x187b('0x5d')],'updatedAt':_0x274ebb[_0x187b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x7c50bb,_0x415b3d))[_0x187b('0x43')](handleError(_0x7c50bb,null));};exports[_0x187b('0x5f')]=function(_0x5882d1,_0x21347c,_0x16f81d){var _0x107f29={};var _0x57126c={};var _0x1dc548;var _0x3697a1;return db[_0x187b('0x2b')][_0x187b('0x52')]({'where':{'id':_0x5882d1[_0x187b('0x45')]['id']}})[_0x187b('0x20')](handleEntityNotFound(_0x21347c,null))['then'](function(_0x2d4c4d){if(_0x2d4c4d){_0x1dc548=_0x2d4c4d;_0x57126c['model']=_[_0x187b('0x32')](db[_0x187b('0x60')][_0x187b('0x2c')]);_0x57126c[_0x187b('0x31')]=_[_0x187b('0x32')](_0x5882d1[_0x187b('0x31')]);_0x57126c[_0x187b('0x3a')]=_[_0x187b('0x33')](_0x57126c[_0x187b('0x30')],_0x57126c[_0x187b('0x31')]);_0x107f29['attributes']=_[_0x187b('0x33')](_0x57126c['model'],qs[_0x187b('0x35')](_0x5882d1[_0x187b('0x31')]['fields']));_0x107f29[_0x187b('0x34')]=_0x107f29[_0x187b('0x34')]['length']?_0x107f29[_0x187b('0x34')]:_0x57126c[_0x187b('0x30')];_0x107f29['order']=qs[_0x187b('0x38')](_0x5882d1[_0x187b('0x31')][_0x187b('0x38')]);_0x107f29[_0x187b('0x39')]=qs[_0x187b('0x3a')](_[_0x187b('0x3b')](_0x5882d1[_0x187b('0x31')],_0x57126c[_0x187b('0x3a')]));if(_0x5882d1[_0x187b('0x31')][_0x187b('0x3c')]){_0x107f29[_0x187b('0x39')]=_[_0x187b('0x3e')](_0x107f29['where'],{'$or':_[_0x187b('0x2a')](_0x107f29[_0x187b('0x34')],function(_0x3e4006){var _0x2fcf14={};_0x2fcf14[_0x3e4006]={'$like':'%'+_0x5882d1[_0x187b('0x31')]['filter']+'%'};return _0x2fcf14;})});}_0x107f29=_[_0x187b('0x3e')]({},_0x107f29,_0x5882d1['options']);return _0x1dc548['getTeams'](_0x107f29);}})[_0x187b('0x20')](function(_0x3272dc){if(_0x3272dc){_0x3697a1=_0x3272dc['length'];if(!_0x5882d1[_0x187b('0x31')][_0x187b('0x36')](_0x187b('0x37'))){_0x107f29[_0x187b('0x1e')]=qs[_0x187b('0x1e')](_0x5882d1[_0x187b('0x31')][_0x187b('0x1e')]);_0x107f29[_0x187b('0x1c')]=qs['offset'](_0x5882d1[_0x187b('0x31')]['offset']);}return _0x1dc548[_0x187b('0x5f')](_0x107f29);}})[_0x187b('0x20')](function(_0x3be568){if(_0x3be568){return _0x3be568?{'count':_0x3697a1,'rows':_0x3be568}:null;}})[_0x187b('0x20')](respondWithResult(_0x21347c,null))[_0x187b('0x43')](handleError(_0x21347c,null));};exports[_0x187b('0x61')]=function(_0x1bf276,_0x40c702,_0x484b85){var _0xc413e8=_0x1bf276[_0x187b('0x49')][_0x187b('0x62')];return db[_0x187b('0x60')]['findAll']({'where':{'id':_0xc413e8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x187b('0x63'),'attributes':['id',_0x187b('0x27'),_0x187b('0x64'),_0x187b('0x65'),_0x187b('0x66')],'raw':!![]}]})[_0x187b('0x20')](function(_0x1a3666){if(_0x1a3666){var _0x5ec34a=_[_0x187b('0x67')](_0x1a3666,function(_0x25e2ab){var _0x290ae8=_0x25e2ab[_0x187b('0x22')]({'plain':!![]});return _0x290ae8[_0x187b('0x63')];});return db[_0x187b('0x2b')][_0x187b('0x47')]({'where':{'id':_0x1bf276[_0x187b('0x45')]['id']}})[_0x187b('0x20')](function(_0x4a9906){return db[_0x187b('0x68')][_0x187b('0x69')](function(_0x3f3048){return _0x4a9906['addTeams'](_0xc413e8,{'transaction':_0x3f3048})['then'](function(){return BPromise['each'](_0x5ec34a,function(_0x142585){return db[_0x187b('0x53')]['findOrCreate']({'where':{'UserId':_0x142585['id'],'OpenchannelQueueId':_0x1bf276[_0x187b('0x45')]['id']},'transaction':_0x3f3048});});})[_0x187b('0x20')](function(){_0x5ec34a[_0x187b('0x6a')](function(_0x135a53){socket['emit'](_0x187b('0x6b'),{'UserId':_0x135a53['id'],'OpenchannelQueueId':_0x4a9906['id']});});});});});}})[_0x187b('0x20')](respondWithStatusCode(_0x40c702,null))['catch'](handleError(_0x40c702,null));};exports[_0x187b('0x6c')]=function(_0x133f34,_0x28e8ed,_0x2d2400){return db[_0x187b('0x60')]['findAll']({'where':{'id':_0x133f34['query'][_0x187b('0x62')]},'attributes':['id'],'include':[{'model':db[_0x187b('0x55')],'as':_0x187b('0x63'),'attributes':['id'],'raw':!![]}]})[_0x187b('0x20')](handleEntityNotFound(_0x28e8ed,null))[_0x187b('0x20')](function(_0x3c4017){var _0x1eed03=_[_0x187b('0x2a')](_0x3c4017,'id');var _0x88ba10=[];var _0x809a23=[];var _0x55a751=squel['select']();_0x55a751[_0x187b('0x6d')](_0x187b('0x6e'))[_0x187b('0x6f')](_0x187b('0x70'),'tq')[_0x187b('0x71')]('user_has_teams','ut',_0x187b('0x72'))[_0x187b('0x39')](_0x187b('0x73'),_0x133f34[_0x187b('0x45')]['id']);for(var _0x51ef6d=0x0;_0x51ef6d<_0x3c4017[_0x187b('0x54')];_0x51ef6d+=0x1){let _0xa67bf0=_0x3c4017[_0x51ef6d];for(var _0x4383c7=0x0;_0x4383c7<_0xa67bf0[_0x187b('0x63')][_0x187b('0x54')];_0x4383c7+=0x1){let _0x5e0f0b=_0xa67bf0[_0x187b('0x63')][_0x4383c7];var _0x483e28=_0x55a751[_0x187b('0x74')]();_0x483e28[_0x187b('0x39')]('ut.UserId\x20=\x20?',_0x5e0f0b['id']);_0x809a23[_0x187b('0x75')](db['sequelize'][_0x187b('0x31')](_0x483e28[_0x187b('0x76')](),{'type':db[_0x187b('0x68')]['QueryTypes'][_0x187b('0x77')]})['then'](function(_0x54ddeb){if(_0x54ddeb[_0x187b('0x54')]===0x1){return _0x5e0f0b['id'];}else{var _0x130db5=_['every'](_['map'](_0x54ddeb,_0x187b('0x78')),function(_0x1ab853){return _['includes'](_0x1eed03,_0x1ab853);});if(_0x130db5){return _0x5e0f0b['id'];}}}));}}return BPromise[_0x187b('0x79')](_0x809a23)[_0x187b('0x20')](function(_0x5a2e55){_0x88ba10=_(_0x88ba10)[_0x187b('0x7a')](_0x5a2e55)['compact']()[_0x187b('0x7b')]();return db[_0x187b('0x2b')][_0x187b('0x47')]({'where':{'id':_0x133f34[_0x187b('0x45')]['id']}})[_0x187b('0x20')](function(_0xb63be9){return db[_0x187b('0x68')][_0x187b('0x69')](function(_0x3c0932){return _0xb63be9[_0x187b('0x6c')](_0x133f34[_0x187b('0x31')][_0x187b('0x62')],{'transaction':_0x3c0932})['then'](function(){if(!_[_0x187b('0x7c')](_0x88ba10)){return _0xb63be9[_0x187b('0x7d')](_0x88ba10,{'transaction':_0x3c0932});}})[_0x187b('0x20')](function(){_0x88ba10['forEach'](function(_0x1f947c){socket[_0x187b('0x7e')](_0x187b('0x7f'),{'UserId':_0x1f947c,'OpenchannelQueueId':_0xb63be9['id']});});});});});});})['then'](respondWithStatusCode(_0x28e8ed,null))[_0x187b('0x43')](handleError(_0x28e8ed,null));};exports[_0x187b('0x80')]=function(_0x1b578c,_0x292288,_0x198a86){return db[_0x187b('0x2b')]['find']({'where':{'id':_0x1b578c['params']['id']}})[_0x187b('0x20')](handleEntityNotFound(_0x292288,null))['then'](function(_0x1c403d){if(_0x1c403d){return _0x1c403d[_0x187b('0x80')](_0x1b578c['body']['ids'],_[_0x187b('0x81')](_0x1b578c['body'],[_0x187b('0x62'),'id'])||{})[_0x187b('0x82')](function(_0x5cbb13){for(var _0x587d39=0x0;_0x587d39<_0x1b578c[_0x187b('0x49')][_0x187b('0x62')][_0x187b('0x54')];_0x587d39+=0x1){socket[_0x187b('0x7e')](_0x187b('0x6b'),{'UserId':Number(_0x1b578c['body'][_0x187b('0x62')][_0x587d39]),'OpenchannelQueueId':Number(_0x1b578c['params']['id'])});}return _0x5cbb13;});}})[_0x187b('0x20')](respondWithResult(_0x292288,null))[_0x187b('0x43')](handleError(_0x292288,null));};exports[_0x187b('0x7d')]=function(_0x50f524,_0x289410,_0x1fefa6){return db[_0x187b('0x2b')]['find']({'where':{'id':_0x50f524[_0x187b('0x45')]['id']}})['then'](handleEntityNotFound(_0x289410,null))['then'](function(_0xcbc8f7){if(_0xcbc8f7){return _0xcbc8f7['removeAgents'](_0x50f524[_0x187b('0x31')]['ids'])[_0x187b('0x20')](function(){if(_[_0x187b('0x83')](_0x50f524[_0x187b('0x31')][_0x187b('0x62')])){for(var _0x1ecf87=0x0;_0x1ecf87<_0x50f524[_0x187b('0x31')][_0x187b('0x62')][_0x187b('0x54')];_0x1ecf87+=0x1){socket['emit'](_0x187b('0x7f'),{'UserId':Number(_0x50f524['query'][_0x187b('0x62')][_0x1ecf87]),'OpenchannelQueueId':Number(_0x50f524[_0x187b('0x45')]['id'])});}}else{socket[_0x187b('0x7e')](_0x187b('0x7f'),{'UserId':Number(_0x50f524[_0x187b('0x31')][_0x187b('0x62')]),'OpenchannelQueueId':Number(_0x50f524['params']['id'])});}});}})[_0x187b('0x20')](respondWithStatusCode(_0x289410,null))[_0x187b('0x43')](handleError(_0x289410,null));};exports[_0x187b('0x84')]=function(_0x1aa2d2,_0x305c15,_0x2bb205){var _0x1953f8={};var _0x2a8efd={};var _0x594bf3;var _0x365e4f;return db[_0x187b('0x2b')][_0x187b('0x52')]({'where':{'id':_0x1aa2d2[_0x187b('0x45')]['id']}})[_0x187b('0x20')](handleEntityNotFound(_0x305c15,null))[_0x187b('0x20')](function(_0x508718){if(_0x508718){_0x594bf3=_0x508718;_0x2a8efd[_0x187b('0x30')]=_[_0x187b('0x32')](db['User']['rawAttributes']);_0x2a8efd[_0x187b('0x31')]=_['keys'](_0x1aa2d2[_0x187b('0x31')]);_0x2a8efd['filters']=_[_0x187b('0x33')](_0x2a8efd['model'],_0x2a8efd[_0x187b('0x31')]);_0x1953f8[_0x187b('0x34')]=_[_0x187b('0x33')](_0x2a8efd['model'],qs[_0x187b('0x35')](_0x1aa2d2[_0x187b('0x31')]['fields']));_0x1953f8[_0x187b('0x34')]=_0x1953f8[_0x187b('0x34')][_0x187b('0x54')]?_0x1953f8[_0x187b('0x34')]:_0x2a8efd['model'];_0x1953f8[_0x187b('0x85')]=qs[_0x187b('0x38')](_0x1aa2d2[_0x187b('0x31')][_0x187b('0x38')]);_0x1953f8[_0x187b('0x39')]=qs[_0x187b('0x3a')](_['pick'](_0x1aa2d2[_0x187b('0x31')],_0x2a8efd[_0x187b('0x3a')]));if(_0x1aa2d2[_0x187b('0x31')][_0x187b('0x3c')]){_0x1953f8[_0x187b('0x39')]=_[_0x187b('0x3e')](_0x1953f8[_0x187b('0x39')],{'$or':_[_0x187b('0x2a')](_0x1953f8[_0x187b('0x34')],function(_0x4290da){var _0x109637={};_0x109637[_0x4290da]={'$like':'%'+_0x1aa2d2[_0x187b('0x31')][_0x187b('0x3c')]+'%'};return _0x109637;})});}_0x1953f8=_[_0x187b('0x3e')]({},_0x1953f8,_0x1aa2d2[_0x187b('0x3f')]);return _0x594bf3[_0x187b('0x84')](_0x1953f8);}})[_0x187b('0x20')](function(_0xc1530b){if(_0xc1530b){_0x365e4f=_0xc1530b[_0x187b('0x54')];if(!_0x1aa2d2[_0x187b('0x31')][_0x187b('0x36')](_0x187b('0x37'))){_0x1953f8['limit']=qs[_0x187b('0x1e')](_0x1aa2d2['query'][_0x187b('0x1e')]);_0x1953f8[_0x187b('0x1c')]=qs[_0x187b('0x1c')](_0x1aa2d2[_0x187b('0x31')]['offset']);}return _0x594bf3[_0x187b('0x84')](_0x1953f8);}})[_0x187b('0x20')](function(_0x33b549){if(_0x33b549){return _0x33b549?{'count':_0x365e4f,'rows':_0x33b549}:null;}})[_0x187b('0x20')](respondWithResult(_0x305c15,null))[_0x187b('0x43')](handleError(_0x305c15,null));};
\ No newline at end of file
+var _0xa064=['sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','intersection','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','pick','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','interface','transaction','each','emit','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','compact','removeTeams','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register'];(function(_0x18c6ca,_0xe39ee7){var _0x445129=function(_0x37bb1c){while(--_0x37bb1c){_0x18c6ca['push'](_0x18c6ca['shift']());}};_0x445129(++_0xe39ee7);}(_0xa064,0x6f));var _0x4a06=function(_0x4b8df0,_0x5c59f1){_0x4b8df0=_0x4b8df0-0x0;var _0x2ad3fe=_0xa064[_0x4b8df0];return _0x2ad3fe;};'use strict';var emlformat=require(_0x4a06('0x0'));var rimraf=require(_0x4a06('0x1'));var zipdir=require(_0x4a06('0x2'));var jsonpatch=require(_0x4a06('0x3'));var rp=require(_0x4a06('0x4'));var moment=require(_0x4a06('0x5'));var BPromise=require(_0x4a06('0x6'));var Mustache=require(_0x4a06('0x7'));var util=require(_0x4a06('0x8'));var path=require(_0x4a06('0x9'));var sox=require('sox');var csv=require(_0x4a06('0xa'));var ejs=require(_0x4a06('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a06('0xc'));var squel=require('squel');var crypto=require(_0x4a06('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a06('0xa'));var querystring=require(_0x4a06('0xe'));var Papa=require(_0x4a06('0xf'));var Redis=require(_0x4a06('0x10'));var authService=require(_0x4a06('0x11'));var qs=require(_0x4a06('0x12'));var as=require(_0x4a06('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a06('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4a06('0x15'))['db'];config[_0x4a06('0x16')]=_[_0x4a06('0x17')](config['redis'],{'host':_0x4a06('0x18'),'port':0x18eb});var socket=require(_0x4a06('0x19'))(new Redis(config[_0x4a06('0x16')]));require(_0x4a06('0x1a'))[_0x4a06('0x1b')](socket);function respondWithStatusCode(_0xdb4bb3,_0x3ea0fb){_0x3ea0fb=_0x3ea0fb||0xcc;return function(_0x4c1ab2){if(_0x4c1ab2){return _0xdb4bb3[_0x4a06('0x1c')](_0x3ea0fb);}return _0xdb4bb3[_0x4a06('0x1d')](_0x3ea0fb)[_0x4a06('0x1e')]();};}function respondWithResult(_0x2162be,_0x16cc5d){_0x16cc5d=_0x16cc5d||0xc8;return function(_0x108e3a){if(_0x108e3a){return _0x2162be['status'](_0x16cc5d)[_0x4a06('0x1f')](_0x108e3a);}};}function respondWithFilteredResult(_0x2ba85f,_0x5ad873){return function(_0xd54e04){if(_0xd54e04){var _0x5a90ce=typeof _0x5ad873['offset']===_0x4a06('0x20')&&typeof _0x5ad873[_0x4a06('0x21')]===_0x4a06('0x20');var _0xa98038=_0xd54e04['count'];var _0x5cb650=_0x5a90ce?0x0:_0x5ad873['offset'];var _0x4e42b7=_0x5a90ce?_0xd54e04['count']:_0x5ad873[_0x4a06('0x22')]+_0x5ad873[_0x4a06('0x21')];var _0x5ad56d;if(_0x4e42b7>=_0xa98038){_0x4e42b7=_0xa98038;_0x5ad56d=0xc8;}else{_0x5ad56d=0xce;}_0x2ba85f[_0x4a06('0x1d')](_0x5ad56d);return _0x2ba85f[_0x4a06('0x23')](_0x4a06('0x24'),_0x5cb650+'-'+_0x4e42b7+'/'+_0xa98038)[_0x4a06('0x1f')](_0xd54e04);}return null;};}function patchUpdates(_0x55d0b2){return function(_0x7e8202){try{jsonpatch['apply'](_0x7e8202,_0x55d0b2,!![]);}catch(_0x2b1763){return BPromise['reject'](_0x2b1763);}return _0x7e8202[_0x4a06('0x25')]();};}function saveUpdates(_0x113414,_0x5c8a89){return function(_0x2507e3){if(_0x2507e3){return _0x2507e3[_0x4a06('0x26')](_0x113414)[_0x4a06('0x27')](function(_0x36efe9){return _0x36efe9;});}return null;};}function removeEntity(_0x10a291,_0x428d10){return function(_0x533c7a){if(_0x533c7a){return _0x533c7a[_0x4a06('0x28')]()[_0x4a06('0x27')](function(){var _0x47e0ae=_0x533c7a[_0x4a06('0x29')]({'plain':!![]});var _0x3719b1=_0x4a06('0x2a');return db[_0x4a06('0x2b')][_0x4a06('0x28')]({'where':{'type':_0x3719b1,'resourceId':_0x47e0ae['id']}})[_0x4a06('0x27')](function(){return _0x533c7a;});})[_0x4a06('0x27')](function(){_0x10a291[_0x4a06('0x1d')](0xcc)[_0x4a06('0x1e')]();});}};}function handleEntityNotFound(_0x1f4adf,_0x2985d9){return function(_0x58c987){if(!_0x58c987){_0x1f4adf[_0x4a06('0x1c')](0x194);}return _0x58c987;};}function handleError(_0x40d296,_0x513922){_0x513922=_0x513922||0x1f4;return function(_0x439072){logger[_0x4a06('0x2c')](_0x439072[_0x4a06('0x2d')]);if(_0x439072[_0x4a06('0x2e')]){delete _0x439072[_0x4a06('0x2e')];}_0x40d296['status'](_0x513922)['send'](_0x439072);};}exports['index']=function(_0xdaf5ef,_0x7da216){var _0x4e6d86={},_0x3f1e8c={},_0x3fb767={'count':0x0,'rows':[]};var _0x436891=_[_0x4a06('0x2f')](db[_0x4a06('0x30')][_0x4a06('0x31')],function(_0x4754e5){return{'name':_0x4754e5[_0x4a06('0x32')],'type':_0x4754e5[_0x4a06('0x33')][_0x4a06('0x34')]};});_0x3f1e8c[_0x4a06('0x35')]=_[_0x4a06('0x2f')](_0x436891,_0x4a06('0x2e'));_0x3f1e8c[_0x4a06('0x36')]=_[_0x4a06('0x37')](_0xdaf5ef[_0x4a06('0x36')]);_0x3f1e8c['filters']=_['intersection'](_0x3f1e8c[_0x4a06('0x35')],_0x3f1e8c['query']);_0x4e6d86[_0x4a06('0x38')]=_['intersection'](_0x3f1e8c[_0x4a06('0x35')],qs[_0x4a06('0x39')](_0xdaf5ef['query'][_0x4a06('0x39')]));_0x4e6d86['attributes']=_0x4e6d86[_0x4a06('0x38')][_0x4a06('0x3a')]?_0x4e6d86[_0x4a06('0x38')]:_0x3f1e8c[_0x4a06('0x35')];if(!_0xdaf5ef[_0x4a06('0x36')][_0x4a06('0x3b')]('nolimit')){_0x4e6d86[_0x4a06('0x21')]=qs[_0x4a06('0x21')](_0xdaf5ef[_0x4a06('0x36')][_0x4a06('0x21')]);_0x4e6d86[_0x4a06('0x22')]=qs[_0x4a06('0x22')](_0xdaf5ef[_0x4a06('0x36')][_0x4a06('0x22')]);}_0x4e6d86[_0x4a06('0x3c')]=qs[_0x4a06('0x3d')](_0xdaf5ef[_0x4a06('0x36')]['sort']);_0x4e6d86['where']=qs[_0x4a06('0x3e')](_['pick'](_0xdaf5ef[_0x4a06('0x36')],_0x3f1e8c['filters']),_0x436891);if(_0xdaf5ef[_0x4a06('0x36')][_0x4a06('0x3f')]){_0x4e6d86[_0x4a06('0x40')]=_[_0x4a06('0x41')](_0x4e6d86[_0x4a06('0x40')],{'$or':_[_0x4a06('0x2f')](_0x436891,function(_0x6a74d7){if(_0x6a74d7[_0x4a06('0x33')]!==_0x4a06('0x42')){var _0x66c7fc={};_0x66c7fc[_0x6a74d7['name']]={'$like':'%'+_0xdaf5ef[_0x4a06('0x36')]['filter']+'%'};return _0x66c7fc;}})});}_0x4e6d86=_[_0x4a06('0x41')]({},_0x4e6d86,_0xdaf5ef[_0x4a06('0x43')]);var _0x530078={'where':_0x4e6d86[_0x4a06('0x40')]};return db[_0x4a06('0x30')][_0x4a06('0x44')](_0x530078)[_0x4a06('0x27')](function(_0xeff4a){_0x3fb767[_0x4a06('0x44')]=_0xeff4a;if(_0xdaf5ef['query'][_0x4a06('0x45')]){_0x4e6d86['include']=[{'all':!![]}];}return db[_0x4a06('0x30')][_0x4a06('0x46')](_0x4e6d86);})[_0x4a06('0x27')](function(_0xc0e986){_0x3fb767[_0x4a06('0x47')]=_0xc0e986;return _0x3fb767;})[_0x4a06('0x27')](respondWithFilteredResult(_0x7da216,_0x4e6d86))['catch'](handleError(_0x7da216,null));};exports[_0x4a06('0x48')]=function(_0x1a2d97,_0x1c49e6){var _0x181590={'raw':!![],'where':{'id':_0x1a2d97[_0x4a06('0x49')]['id']}},_0x1f278f={};_0x1f278f[_0x4a06('0x35')]=_['keys'](db['OpenchannelQueue'][_0x4a06('0x31')]);_0x1f278f[_0x4a06('0x36')]=_[_0x4a06('0x37')](_0x1a2d97[_0x4a06('0x36')]);_0x1f278f[_0x4a06('0x3e')]=_[_0x4a06('0x4a')](_0x1f278f[_0x4a06('0x35')],_0x1f278f[_0x4a06('0x36')]);_0x181590[_0x4a06('0x38')]=_[_0x4a06('0x4a')](_0x1f278f[_0x4a06('0x35')],qs[_0x4a06('0x39')](_0x1a2d97[_0x4a06('0x36')][_0x4a06('0x39')]));_0x181590['attributes']=_0x181590[_0x4a06('0x38')][_0x4a06('0x3a')]?_0x181590[_0x4a06('0x38')]:_0x1f278f['model'];if(_0x1a2d97[_0x4a06('0x36')][_0x4a06('0x45')]){_0x181590[_0x4a06('0x4b')]=[{'all':!![]}];}_0x181590=_[_0x4a06('0x41')]({},_0x181590,_0x1a2d97['options']);return db[_0x4a06('0x30')][_0x4a06('0x4c')](_0x181590)['then'](handleEntityNotFound(_0x1c49e6,null))[_0x4a06('0x27')](respondWithResult(_0x1c49e6,null))[_0x4a06('0x4d')](handleError(_0x1c49e6,null));};exports[_0x4a06('0x4e')]=function(_0x51e209,_0x2a50ec){return db[_0x4a06('0x30')][_0x4a06('0x4e')](_0x51e209[_0x4a06('0x4f')],{})['then'](function(_0x1d858f){var _0xb1936a=_0x51e209[_0x4a06('0x50')][_0x4a06('0x29')]({'plain':!![]});if(!_0xb1936a)throw new Error(_0x4a06('0x51'));if(_0xb1936a[_0x4a06('0x52')]===_0x4a06('0x50')){var _0xbb3bd9=_0x1d858f[_0x4a06('0x29')]({'plain':!![]});var _0x23f4bf='OpenchannelQueues';return db[_0x4a06('0x53')][_0x4a06('0x4c')]({'where':{'name':_0x23f4bf,'userProfileId':_0xb1936a[_0x4a06('0x54')]},'raw':!![]})['then'](function(_0x483898){if(_0x483898&&_0x483898[_0x4a06('0x55')]===0x0){return db[_0x4a06('0x2b')][_0x4a06('0x4e')]({'name':_0xbb3bd9[_0x4a06('0x2e')],'resourceId':_0xbb3bd9['id'],'type':_0x483898[_0x4a06('0x2e')],'sectionId':_0x483898['id']},{})[_0x4a06('0x27')](function(){return _0x1d858f;});}else{return _0x1d858f;}})[_0x4a06('0x4d')](function(_0x3ce3ab){logger[_0x4a06('0x2c')](_0x4a06('0x56'),_0x3ce3ab);throw _0x3ce3ab;});}return _0x1d858f;})[_0x4a06('0x27')](respondWithResult(_0x2a50ec,0xc9))['catch'](handleError(_0x2a50ec,null));};exports[_0x4a06('0x26')]=function(_0x2f0175,_0x3ff48a){if(_0x2f0175[_0x4a06('0x4f')]['id']){delete _0x2f0175[_0x4a06('0x4f')]['id'];}return db[_0x4a06('0x30')]['find']({'where':{'id':_0x2f0175[_0x4a06('0x49')]['id']}})[_0x4a06('0x27')](handleEntityNotFound(_0x3ff48a,null))['then'](saveUpdates(_0x2f0175[_0x4a06('0x4f')],null))[_0x4a06('0x27')](respondWithResult(_0x3ff48a,null))[_0x4a06('0x4d')](handleError(_0x3ff48a,null));};exports['destroy']=function(_0x2e4434,_0x5458b2){return db[_0x4a06('0x30')]['find']({'where':{'id':_0x2e4434[_0x4a06('0x49')]['id']}})['then'](handleEntityNotFound(_0x5458b2,null))['then'](removeEntity(_0x5458b2,null))[_0x4a06('0x4d')](handleError(_0x5458b2,null));};exports[_0x4a06('0x57')]=function(_0x254bd3,_0x53bea2){return db[_0x4a06('0x30')][_0x4a06('0x57')]()[_0x4a06('0x27')](respondWithResult(_0x53bea2,null))[_0x4a06('0x4d')](handleError(_0x53bea2,null));};exports[_0x4a06('0x58')]=function(_0x319b85,_0x9624da,_0x5d6f89){var _0x4b7d7c={'raw':!![],'where':{}},_0x349acd={},_0x353a86;return db[_0x4a06('0x30')][_0x4a06('0x59')]({'where':{'id':_0x319b85[_0x4a06('0x49')]['id']}})[_0x4a06('0x27')](handleEntityNotFound(_0x9624da,null))['then'](function(_0x222ec0){if(_0x222ec0){_0x353a86=_0x222ec0[_0x4a06('0x29')]({'plain':!![]});_0x349acd[_0x4a06('0x35')]=_[_0x4a06('0x37')](db[_0x4a06('0x5a')][_0x4a06('0x31')]);_0x349acd[_0x4a06('0x36')]=_[_0x4a06('0x37')](_0x319b85[_0x4a06('0x36')]);_0x349acd[_0x4a06('0x3e')]=_[_0x4a06('0x4a')](_0x349acd[_0x4a06('0x35')],_0x349acd['query']);_0x4b7d7c[_0x4a06('0x38')]=_[_0x4a06('0x4a')](_0x349acd[_0x4a06('0x35')],qs[_0x4a06('0x39')](_0x319b85['query'][_0x4a06('0x39')]));_0x4b7d7c['attributes']=_0x4b7d7c[_0x4a06('0x38')][_0x4a06('0x3a')]?_0x4b7d7c[_0x4a06('0x38')]:_0x349acd[_0x4a06('0x35')];if(!_0x319b85[_0x4a06('0x36')][_0x4a06('0x3b')](_0x4a06('0x5b'))){_0x4b7d7c[_0x4a06('0x21')]=qs[_0x4a06('0x21')](_0x319b85[_0x4a06('0x36')][_0x4a06('0x21')]);_0x4b7d7c[_0x4a06('0x22')]=qs[_0x4a06('0x22')](_0x319b85['query']['offset']);}_0x4b7d7c[_0x4a06('0x3c')]=qs[_0x4a06('0x3d')](_0x319b85[_0x4a06('0x36')][_0x4a06('0x3d')]);_0x4b7d7c[_0x4a06('0x40')]=qs['filters'](_[_0x4a06('0x5c')](_0x319b85[_0x4a06('0x36')],_0x349acd['filters']));_0x4b7d7c[_0x4a06('0x40')][_0x4a06('0x5d')]=_0x222ec0['id'];if(_0x319b85['query'][_0x4a06('0x3f')]){_0x4b7d7c['where']=_[_0x4a06('0x41')](_0x4b7d7c[_0x4a06('0x40')],{'$or':_[_0x4a06('0x2f')](_0x4b7d7c[_0x4a06('0x38')],function(_0x437dbe){var _0x21ce72={};_0x21ce72[_0x437dbe]={'$like':'%'+_0x319b85[_0x4a06('0x36')][_0x4a06('0x3f')]+'%'};return _0x21ce72;})});}_0x4b7d7c=_[_0x4a06('0x41')]({},_0x4b7d7c,_0x319b85[_0x4a06('0x43')]);return db[_0x4a06('0x5a')][_0x4a06('0x46')](_0x4b7d7c);}})[_0x4a06('0x27')](function(_0x4e6994){if(_0x4e6994){return db[_0x4a06('0x5e')][_0x4a06('0x5f')]({'where':{'id':_[_0x4a06('0x2f')](_0x4e6994,'UserId'),'role':_0x4a06('0x60')},'attributes':['id','name',_0x4a06('0x61'),'updatedAt','createdAt']});}})[_0x4a06('0x27')](function(_0x63e8d7){if(_0x63e8d7){return{'count':_0x63e8d7[_0x4a06('0x44')],'rows':_['map'](_0x63e8d7[_0x4a06('0x47')],function(_0x865b50){return{'membername':_0x865b50[_0x4a06('0x2e')],'UserId':_0x865b50['id'],'queue_name':_0x353a86[_0x4a06('0x2e')],'OpenchannelQueueId':_0x353a86['id'],'interface':util['format'](_0x4a06('0x62'),_0x4a06('0x63'),_0x865b50['name']),'penalty':0x0,'paused':_0x865b50[_0x4a06('0x61')],'createdAt':_0x865b50['createdAt'],'updatedAt':_0x865b50[_0x4a06('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4a06('0x27')](respondWithFilteredResult(_0x9624da,_0x4b7d7c))[_0x4a06('0x4d')](handleError(_0x9624da,null));};exports['getTeams']=function(_0x38ef3d,_0x150a23,_0x27ab6e){var _0x11ac2d={};var _0x2ff120={};var _0x5a26d5;var _0x2f8919;return db['OpenchannelQueue'][_0x4a06('0x59')]({'where':{'id':_0x38ef3d[_0x4a06('0x49')]['id']}})[_0x4a06('0x27')](handleEntityNotFound(_0x150a23,null))[_0x4a06('0x27')](function(_0x5cfdc5){if(_0x5cfdc5){_0x5a26d5=_0x5cfdc5;_0x2ff120['model']=_[_0x4a06('0x37')](db[_0x4a06('0x65')]['rawAttributes']);_0x2ff120[_0x4a06('0x36')]=_['keys'](_0x38ef3d[_0x4a06('0x36')]);_0x2ff120[_0x4a06('0x3e')]=_[_0x4a06('0x4a')](_0x2ff120[_0x4a06('0x35')],_0x2ff120[_0x4a06('0x36')]);_0x11ac2d['attributes']=_[_0x4a06('0x4a')](_0x2ff120[_0x4a06('0x35')],qs['fields'](_0x38ef3d['query']['fields']));_0x11ac2d['attributes']=_0x11ac2d[_0x4a06('0x38')][_0x4a06('0x3a')]?_0x11ac2d['attributes']:_0x2ff120[_0x4a06('0x35')];_0x11ac2d[_0x4a06('0x3c')]=qs[_0x4a06('0x3d')](_0x38ef3d[_0x4a06('0x36')]['sort']);_0x11ac2d[_0x4a06('0x40')]=qs[_0x4a06('0x3e')](_['pick'](_0x38ef3d[_0x4a06('0x36')],_0x2ff120[_0x4a06('0x3e')]));if(_0x38ef3d['query'][_0x4a06('0x3f')]){_0x11ac2d['where']=_[_0x4a06('0x41')](_0x11ac2d[_0x4a06('0x40')],{'$or':_[_0x4a06('0x2f')](_0x11ac2d[_0x4a06('0x38')],function(_0x4bf710){var _0x148910={};_0x148910[_0x4bf710]={'$like':'%'+_0x38ef3d[_0x4a06('0x36')][_0x4a06('0x3f')]+'%'};return _0x148910;})});}_0x11ac2d=_['merge']({},_0x11ac2d,_0x38ef3d[_0x4a06('0x43')]);return _0x5a26d5['getTeams'](_0x11ac2d);}})[_0x4a06('0x27')](function(_0xda0b80){if(_0xda0b80){_0x2f8919=_0xda0b80[_0x4a06('0x3a')];if(!_0x38ef3d[_0x4a06('0x36')][_0x4a06('0x3b')](_0x4a06('0x5b'))){_0x11ac2d[_0x4a06('0x21')]=qs[_0x4a06('0x21')](_0x38ef3d['query'][_0x4a06('0x21')]);_0x11ac2d[_0x4a06('0x22')]=qs['offset'](_0x38ef3d[_0x4a06('0x36')][_0x4a06('0x22')]);}return _0x5a26d5[_0x4a06('0x66')](_0x11ac2d);}})[_0x4a06('0x27')](function(_0x1949e9){if(_0x1949e9){return _0x1949e9?{'count':_0x2f8919,'rows':_0x1949e9}:null;}})['then'](respondWithResult(_0x150a23,null))[_0x4a06('0x4d')](handleError(_0x150a23,null));};exports[_0x4a06('0x67')]=function(_0x2a9741,_0xb15699,_0x32d4f0){var _0x3fd202=_0x2a9741[_0x4a06('0x4f')][_0x4a06('0x68')];return db[_0x4a06('0x65')]['findAll']({'where':{'id':_0x3fd202},'attributes':['id'],'include':[{'model':db[_0x4a06('0x5e')],'as':_0x4a06('0x69'),'attributes':['id','name',_0x4a06('0x6a'),'voicePause',_0x4a06('0x6b')],'raw':!![]}]})[_0x4a06('0x27')](function(_0x4fe672){if(_0x4fe672){var _0x5b29f4=_['flatMap'](_0x4fe672,function(_0x390e7b){var _0x3ece4c=_0x390e7b[_0x4a06('0x29')]({'plain':!![]});return _0x3ece4c[_0x4a06('0x69')];});return db[_0x4a06('0x30')]['find']({'where':{'id':_0x2a9741[_0x4a06('0x49')]['id']}})['then'](function(_0x1c1c82){return db['sequelize'][_0x4a06('0x6c')](function(_0x1ff3ab){return _0x1c1c82[_0x4a06('0x67')](_0x3fd202,{'transaction':_0x1ff3ab})[_0x4a06('0x27')](function(){return BPromise[_0x4a06('0x6d')](_0x5b29f4,function(_0x346a11){return db[_0x4a06('0x5a')]['findOrCreate']({'where':{'UserId':_0x346a11['id'],'OpenchannelQueueId':_0x2a9741['params']['id']},'transaction':_0x1ff3ab});});})[_0x4a06('0x27')](function(){_0x5b29f4['forEach'](function(_0xae881){socket[_0x4a06('0x6e')]('userOpenchannelQueue:save',{'UserId':_0xae881['id'],'OpenchannelQueueId':_0x1c1c82['id']});});});});});}})[_0x4a06('0x27')](respondWithStatusCode(_0xb15699,null))[_0x4a06('0x4d')](handleError(_0xb15699,null));};exports['removeTeams']=function(_0x131b7a,_0x13a737,_0x31d239){return db[_0x4a06('0x65')][_0x4a06('0x46')]({'where':{'id':_0x131b7a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4a06('0x5e')],'as':_0x4a06('0x69'),'attributes':['id'],'raw':!![]}]})[_0x4a06('0x27')](handleEntityNotFound(_0x13a737,null))['then'](function(_0x13a8f0){var _0x2855e8=_[_0x4a06('0x2f')](_0x13a8f0,'id');var _0x4e9725=[];var _0x9c366b=[];var _0x301fcc=squel[_0x4a06('0x6f')]();_0x301fcc[_0x4a06('0x70')](_0x4a06('0x71'))[_0x4a06('0x72')]('team_has_openchannel_queues','tq')[_0x4a06('0x73')](_0x4a06('0x74'),'ut',_0x4a06('0x75'))['where'](_0x4a06('0x76'),_0x131b7a['params']['id']);for(var _0x2a9941=0x0;_0x2a9941<_0x13a8f0['length'];_0x2a9941+=0x1){let _0x5aa2b8=_0x13a8f0[_0x2a9941];for(var _0x383f7e=0x0;_0x383f7e<_0x5aa2b8[_0x4a06('0x69')][_0x4a06('0x3a')];_0x383f7e+=0x1){let _0xc43fd6=_0x5aa2b8[_0x4a06('0x69')][_0x383f7e];var _0x3f63da=_0x301fcc[_0x4a06('0x77')]();_0x3f63da[_0x4a06('0x40')](_0x4a06('0x78'),_0xc43fd6['id']);_0x9c366b[_0x4a06('0x79')](db[_0x4a06('0x7a')][_0x4a06('0x36')](_0x3f63da[_0x4a06('0x7b')](),{'type':db[_0x4a06('0x7a')][_0x4a06('0x7c')][_0x4a06('0x7d')]})[_0x4a06('0x27')](function(_0x5ef6b9){if(_0x5ef6b9[_0x4a06('0x3a')]===0x1){return _0xc43fd6['id'];}else{var _0x196c8b=_['every'](_[_0x4a06('0x2f')](_0x5ef6b9,_0x4a06('0x7e')),function(_0xbccd42){return _['includes'](_0x2855e8,_0xbccd42);});if(_0x196c8b){return _0xc43fd6['id'];}}}));}}return BPromise[_0x4a06('0x7f')](_0x9c366b)[_0x4a06('0x27')](function(_0x911482){_0x4e9725=_(_0x4e9725)[_0x4a06('0x80')](_0x911482)[_0x4a06('0x81')]()['value']();return db[_0x4a06('0x30')][_0x4a06('0x4c')]({'where':{'id':_0x131b7a[_0x4a06('0x49')]['id']}})[_0x4a06('0x27')](function(_0x5a3703){return db[_0x4a06('0x7a')][_0x4a06('0x6c')](function(_0x29b1f5){return _0x5a3703[_0x4a06('0x82')](_0x131b7a[_0x4a06('0x36')]['ids'],{'transaction':_0x29b1f5})[_0x4a06('0x27')](function(){if(!_[_0x4a06('0x83')](_0x4e9725)){return _0x5a3703['removeAgents'](_0x4e9725,{'transaction':_0x29b1f5});}})[_0x4a06('0x27')](function(){_0x4e9725[_0x4a06('0x84')](function(_0x24bbc1){socket[_0x4a06('0x6e')](_0x4a06('0x85'),{'UserId':_0x24bbc1,'OpenchannelQueueId':_0x5a3703['id']});});});});});});})[_0x4a06('0x27')](respondWithStatusCode(_0x13a737,null))[_0x4a06('0x4d')](handleError(_0x13a737,null));};exports['addAgents']=function(_0x20a9b1,_0x391f5c,_0x1ca9de){return db[_0x4a06('0x30')][_0x4a06('0x4c')]({'where':{'id':_0x20a9b1[_0x4a06('0x49')]['id']}})[_0x4a06('0x27')](handleEntityNotFound(_0x391f5c,null))['then'](function(_0x4096b6){if(_0x4096b6){return _0x4096b6[_0x4a06('0x86')](_0x20a9b1[_0x4a06('0x4f')][_0x4a06('0x68')],_[_0x4a06('0x87')](_0x20a9b1['body'],[_0x4a06('0x68'),'id'])||{})[_0x4a06('0x88')](function(_0x3f51f5){for(var _0xd123d8=0x0;_0xd123d8<_0x20a9b1[_0x4a06('0x4f')][_0x4a06('0x68')][_0x4a06('0x3a')];_0xd123d8+=0x1){socket[_0x4a06('0x6e')]('userOpenchannelQueue:save',{'UserId':Number(_0x20a9b1['body'][_0x4a06('0x68')][_0xd123d8]),'OpenchannelQueueId':Number(_0x20a9b1['params']['id'])});}return _0x3f51f5;});}})[_0x4a06('0x27')](respondWithResult(_0x391f5c,null))[_0x4a06('0x4d')](handleError(_0x391f5c,null));};exports[_0x4a06('0x89')]=function(_0xa8cad9,_0x4d00b9,_0xcdebdb){return db['OpenchannelQueue'][_0x4a06('0x4c')]({'where':{'id':_0xa8cad9[_0x4a06('0x49')]['id']}})[_0x4a06('0x27')](handleEntityNotFound(_0x4d00b9,null))[_0x4a06('0x27')](function(_0x33ba94){if(_0x33ba94){return _0x33ba94[_0x4a06('0x89')](_0xa8cad9[_0x4a06('0x36')][_0x4a06('0x68')])['then'](function(){if(_['isArray'](_0xa8cad9[_0x4a06('0x36')][_0x4a06('0x68')])){for(var _0xdad245=0x0;_0xdad245<_0xa8cad9[_0x4a06('0x36')][_0x4a06('0x68')][_0x4a06('0x3a')];_0xdad245+=0x1){socket[_0x4a06('0x6e')](_0x4a06('0x85'),{'UserId':Number(_0xa8cad9[_0x4a06('0x36')][_0x4a06('0x68')][_0xdad245]),'OpenchannelQueueId':Number(_0xa8cad9[_0x4a06('0x49')]['id'])});}}else{socket[_0x4a06('0x6e')](_0x4a06('0x85'),{'UserId':Number(_0xa8cad9['query'][_0x4a06('0x68')]),'OpenchannelQueueId':Number(_0xa8cad9['params']['id'])});}});}})[_0x4a06('0x27')](respondWithStatusCode(_0x4d00b9,null))['catch'](handleError(_0x4d00b9,null));};exports[_0x4a06('0x8a')]=function(_0x4eb2ab,_0xc2f473,_0x161b1f){var _0x5dc7bb={};var _0x129087={};var _0x2dfa38;var _0x510317;return db[_0x4a06('0x30')][_0x4a06('0x59')]({'where':{'id':_0x4eb2ab[_0x4a06('0x49')]['id']}})[_0x4a06('0x27')](handleEntityNotFound(_0xc2f473,null))['then'](function(_0x3d4e67){if(_0x3d4e67){_0x2dfa38=_0x3d4e67;_0x129087[_0x4a06('0x35')]=_['keys'](db[_0x4a06('0x5e')][_0x4a06('0x31')]);_0x129087['query']=_[_0x4a06('0x37')](_0x4eb2ab[_0x4a06('0x36')]);_0x129087[_0x4a06('0x3e')]=_[_0x4a06('0x4a')](_0x129087[_0x4a06('0x35')],_0x129087[_0x4a06('0x36')]);_0x5dc7bb[_0x4a06('0x38')]=_['intersection'](_0x129087[_0x4a06('0x35')],qs[_0x4a06('0x39')](_0x4eb2ab[_0x4a06('0x36')]['fields']));_0x5dc7bb[_0x4a06('0x38')]=_0x5dc7bb[_0x4a06('0x38')][_0x4a06('0x3a')]?_0x5dc7bb[_0x4a06('0x38')]:_0x129087[_0x4a06('0x35')];_0x5dc7bb[_0x4a06('0x3c')]=qs[_0x4a06('0x3d')](_0x4eb2ab[_0x4a06('0x36')][_0x4a06('0x3d')]);_0x5dc7bb[_0x4a06('0x40')]=qs[_0x4a06('0x3e')](_[_0x4a06('0x5c')](_0x4eb2ab[_0x4a06('0x36')],_0x129087[_0x4a06('0x3e')]));if(_0x4eb2ab[_0x4a06('0x36')]['filter']){_0x5dc7bb[_0x4a06('0x40')]=_[_0x4a06('0x41')](_0x5dc7bb[_0x4a06('0x40')],{'$or':_[_0x4a06('0x2f')](_0x5dc7bb['attributes'],function(_0x1d4824){var _0xc73b0b={};_0xc73b0b[_0x1d4824]={'$like':'%'+_0x4eb2ab[_0x4a06('0x36')][_0x4a06('0x3f')]+'%'};return _0xc73b0b;})});}_0x5dc7bb=_[_0x4a06('0x41')]({},_0x5dc7bb,_0x4eb2ab['options']);return _0x2dfa38[_0x4a06('0x8a')](_0x5dc7bb);}})[_0x4a06('0x27')](function(_0x3422af){if(_0x3422af){_0x510317=_0x3422af['length'];if(!_0x4eb2ab[_0x4a06('0x36')][_0x4a06('0x3b')]('nolimit')){_0x5dc7bb[_0x4a06('0x21')]=qs[_0x4a06('0x21')](_0x4eb2ab[_0x4a06('0x36')]['limit']);_0x5dc7bb[_0x4a06('0x22')]=qs['offset'](_0x4eb2ab['query'][_0x4a06('0x22')]);}return _0x2dfa38[_0x4a06('0x8a')](_0x5dc7bb);}})[_0x4a06('0x27')](function(_0x21cf28){if(_0x21cf28){return _0x21cf28?{'count':_0x510317,'rows':_0x21cf28}:null;}})[_0x4a06('0x27')](respondWithResult(_0xc2f473,null))[_0x4a06('0x4d')](handleError(_0xc2f473,null));};
\ No newline at end of file
index 7f81236..7c51ae9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7607=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','save'];(function(_0x5ebe34,_0x421337){var _0x36a3ee=function(_0x1d3306){while(--_0x1d3306){_0x5ebe34['push'](_0x5ebe34['shift']());}};_0x36a3ee(++_0x421337);}(_0x7607,0x182));var _0x7760=function(_0x269f30,_0x4336ea){_0x269f30=_0x269f30-0x0;var _0x3b38c0=_0x7607[_0x269f30];return _0x3b38c0;};'use strict';var EventEmitter=require(_0x7760('0x0'));var OpenchannelQueue=require(_0x7760('0x1'))['db'][_0x7760('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7760('0x3'),'afterUpdate':_0x7760('0x4'),'afterDestroy':_0x7760('0x5')};function emitEvent(_0x2ffe7c){return function(_0x1e6d39,_0x220ed1,_0x3130d7){OpenchannelQueueEvents[_0x7760('0x6')](_0x2ffe7c+':'+_0x1e6d39['id'],_0x1e6d39);OpenchannelQueueEvents['emit'](_0x2ffe7c,_0x1e6d39);_0x3130d7(null);};}for(var e in events){if(events[_0x7760('0x7')](e)){var event=events[e];OpenchannelQueue[_0x7760('0x8')](e,emitEvent(event));}}module[_0x7760('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x9b9f=['save','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelQueue'];(function(_0x5329d2,_0x5aeac2){var _0x2f8780=function(_0x1a5d1e){while(--_0x1a5d1e){_0x5329d2['push'](_0x5329d2['shift']());}};_0x2f8780(++_0x5aeac2);}(_0x9b9f,0x73));var _0xf9b9=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0x9b9f[_0x36bf88];return _0x332914;};'use strict';var EventEmitter=require(_0xf9b9('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xf9b9('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf9b9('0x2'),'afterUpdate':_0xf9b9('0x3'),'afterDestroy':_0xf9b9('0x4')};function emitEvent(_0x43fb14){return function(_0x14fd3e,_0x5e7f2d,_0x354105){OpenchannelQueueEvents['emit'](_0x43fb14+':'+_0x14fd3e['id'],_0x14fd3e);OpenchannelQueueEvents[_0xf9b9('0x5')](_0x43fb14,_0x14fd3e);_0x354105(null);};}for(var e in events){if(events[_0xf9b9('0x6')](e)){var event=events[e];OpenchannelQueue[_0xf9b9('0x7')](e,emitEvent(event));}}module[_0xf9b9('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index dd528da..4a83ff8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f8c=['../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x362772,_0x56b2a9){var _0x49afb6=function(_0x5740e3){while(--_0x5740e3){_0x362772['push'](_0x362772['shift']());}};_0x49afb6(++_0x56b2a9);}(_0x2f8c,0x1c0));var _0xc2f8=function(_0x3afb99,_0x420e4f){_0x3afb99=_0x3afb99-0x0;var _0x5d92df=_0x2f8c[_0x3afb99];return _0x5d92df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc2f8('0x0'))(_0xc2f8('0x1'));var moment=require(_0xc2f8('0x2'));var BPromise=require(_0xc2f8('0x3'));var rp=require(_0xc2f8('0x4'));var fs=require('fs');var path=require(_0xc2f8('0x5'));var rimraf=require(_0xc2f8('0x6'));var config=require(_0xc2f8('0x7'));var attributes=require(_0xc2f8('0x8'));module[_0xc2f8('0x9')]=function(_0x19885e,_0x53598d){return _0x19885e[_0xc2f8('0xa')](_0xc2f8('0xb'),attributes,{'tableName':_0xc2f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6097=['api','moment','request-promise','path','rimraf','../../config/environment','exports','OpenchannelQueue','openchannel_queues','lodash','../../config/logger'];(function(_0x7385a1,_0x42ad75){var _0x384a30=function(_0x5d5ebc){while(--_0x5d5ebc){_0x7385a1['push'](_0x7385a1['shift']());}};_0x384a30(++_0x42ad75);}(_0x6097,0x6c));var _0x7609=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0x6097[_0x838813];return _0x2bd32d;};'use strict';var _=require(_0x7609('0x0'));var util=require('util');var logger=require(_0x7609('0x1'))(_0x7609('0x2'));var moment=require(_0x7609('0x3'));var BPromise=require('bluebird');var rp=require(_0x7609('0x4'));var fs=require('fs');var path=require(_0x7609('0x5'));var rimraf=require(_0x7609('0x6'));var config=require(_0x7609('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x7609('0x8')]=function(_0x39458c,_0x59102e){return _0x39458c['define'](_0x7609('0x9'),attributes,{'tableName':_0x7609('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77b81b1..a6e9422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aa3=['OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','options','raw','where','attributes','limit','include','model','GetOpenchannelQueue','catch','ShowOpenchannelQueue','OpenchannelQueue','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelQueue.socket','request','then'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x0aa3,0x1e9));var _0x30aa=function(_0x2febc1,_0x2dc51f){_0x2febc1=_0x2febc1-0x0;var _0x23129f=_0x0aa3[_0x2febc1];return _0x23129f;};'use strict';var _=require(_0x30aa('0x0'));var util=require(_0x30aa('0x1'));var moment=require(_0x30aa('0x2'));var BPromise=require(_0x30aa('0x3'));var rs=require(_0x30aa('0x4'));var fs=require('fs');var Redis=require(_0x30aa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x30aa('0x6'));var logger=require(_0x30aa('0x7'))(_0x30aa('0x8'));var config=require(_0x30aa('0x9'));var jayson=require(_0x30aa('0xa'));var client=jayson[_0x30aa('0xb')][_0x30aa('0xc')]({'port':0x232a});config[_0x30aa('0xd')]=_[_0x30aa('0xe')](config[_0x30aa('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x30aa('0xd')]));require(_0x30aa('0xf'))['register'](socket);function respondWithRpcPromise(_0x41650d,_0x553505,_0x546b54){return new BPromise(function(_0x3bda6,_0x216389){return client[_0x30aa('0x10')](_0x41650d,_0x546b54)[_0x30aa('0x11')](function(_0x10a1d8){logger['info'](_0x30aa('0x12'),_0x553505,_0x30aa('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x553505,_0x30aa('0x13'),JSON[_0x30aa('0x14')](_0x10a1d8));if(_0x10a1d8['error']){if(_0x10a1d8[_0x30aa('0x15')][_0x30aa('0x16')]===0x1f4){logger['error'](_0x30aa('0x12'),_0x553505,_0x10a1d8[_0x30aa('0x15')][_0x30aa('0x17')]);return _0x216389(_0x10a1d8[_0x30aa('0x15')][_0x30aa('0x17')]);}logger[_0x30aa('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x553505,_0x10a1d8[_0x30aa('0x15')][_0x30aa('0x17')]);return _0x3bda6(_0x10a1d8[_0x30aa('0x15')][_0x30aa('0x17')]);}else{logger[_0x30aa('0x18')](_0x30aa('0x12'),_0x553505,_0x30aa('0x13'));_0x3bda6(_0x10a1d8[_0x30aa('0x19')]['message']);}})['catch'](function(_0x139166){logger[_0x30aa('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x553505,_0x139166);_0x216389(_0x139166);});});}exports['GetOpenchannelQueue']=function(_0xb90515){var _0x1e7dbf=this;return new Promise(function(_0x181584,_0x22438a){return db['OpenchannelQueue']['findAll']({'raw':_0xb90515[_0x30aa('0x1a')]?_0xb90515[_0x30aa('0x1a')][_0x30aa('0x1b')]===undefined?!![]:![]:!![],'where':_0xb90515[_0x30aa('0x1a')]?_0xb90515[_0x30aa('0x1a')][_0x30aa('0x1c')]||null:null,'attributes':_0xb90515[_0x30aa('0x1a')]?_0xb90515[_0x30aa('0x1a')][_0x30aa('0x1d')]||null:null,'limit':_0xb90515[_0x30aa('0x1a')]?_0xb90515['options'][_0x30aa('0x1e')]||null:null,'include':_0xb90515['options']?_0xb90515[_0x30aa('0x1a')][_0x30aa('0x1f')]?_['map'](_0xb90515[_0x30aa('0x1a')][_0x30aa('0x1f')],function(_0x2348ba){return{'model':db[_0x2348ba['model']],'as':_0x2348ba['as'],'attributes':_0x2348ba[_0x30aa('0x1d')],'include':_0x2348ba[_0x30aa('0x1f')]?_['map'](_0x2348ba[_0x30aa('0x1f')],function(_0x58ba2a){return{'model':db[_0x58ba2a[_0x30aa('0x20')]],'as':_0x58ba2a['as'],'attributes':_0x58ba2a['attributes'],'include':_0x58ba2a[_0x30aa('0x1f')]?_['map'](_0x58ba2a[_0x30aa('0x1f')],function(_0x56ca0c){return{'model':db[_0x56ca0c[_0x30aa('0x20')]],'as':_0x56ca0c['as'],'attributes':_0x56ca0c[_0x30aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x30aa('0x11')](function(_0x590675){logger[_0x30aa('0x18')](_0x30aa('0x21'),_0xb90515);logger['debug'](_0x30aa('0x21'),_0xb90515,JSON['stringify'](_0x590675));_0x181584(_0x590675);})[_0x30aa('0x22')](function(_0x3942d2){logger[_0x30aa('0x15')]('GetOpenchannelQueue',_0x3942d2[_0x30aa('0x17')],_0xb90515);_0x22438a(_0x1e7dbf[_0x30aa('0x15')](0x1f4,_0x3942d2['message']));});});};exports[_0x30aa('0x23')]=function(_0x16a641){var _0x3677c8=this;return new Promise(function(_0x82fafc,_0x4c5ca8){return db[_0x30aa('0x24')]['find']({'raw':_0x16a641['options']?_0x16a641[_0x30aa('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x16a641[_0x30aa('0x1a')]?_0x16a641[_0x30aa('0x1a')][_0x30aa('0x1c')]||null:null,'attributes':_0x16a641[_0x30aa('0x1a')]?_0x16a641[_0x30aa('0x1a')][_0x30aa('0x1d')]||null:null,'include':_0x16a641[_0x30aa('0x1a')]?_0x16a641[_0x30aa('0x1a')]['include']?_['map'](_0x16a641[_0x30aa('0x1a')]['include'],function(_0x5cd036){return{'model':db[_0x5cd036['model']],'as':_0x5cd036['as'],'attributes':_0x5cd036['attributes'],'include':_0x5cd036[_0x30aa('0x1f')]?_['map'](_0x5cd036['include'],function(_0x16266c){return{'model':db[_0x16266c[_0x30aa('0x20')]],'as':_0x16266c['as'],'attributes':_0x16266c[_0x30aa('0x1d')],'include':_0x16266c['include']?_[_0x30aa('0x25')](_0x16266c[_0x30aa('0x1f')],function(_0x21a61a){return{'model':db[_0x21a61a[_0x30aa('0x20')]],'as':_0x21a61a['as'],'attributes':_0x21a61a[_0x30aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x30aa('0x11')](function(_0x37cb39){logger[_0x30aa('0x18')](_0x30aa('0x23'),_0x16a641);logger[_0x30aa('0x26')](_0x30aa('0x23'),_0x16a641,JSON['stringify'](_0x37cb39));_0x82fafc(_0x37cb39);})['catch'](function(_0x39123d){logger['error'](_0x30aa('0x23'),_0x39123d[_0x30aa('0x17')],_0x16a641);_0x4c5ca8(_0x3677c8['error'](0x1f4,_0x39123d[_0x30aa('0x17')]));});});};
\ No newline at end of file
+var _0x6362=['error','OpenchannelQueue,\x20%s,\x20%s','message','catch','findAll','options','attributes','limit','include','map','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','debug','request\x20sent'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x6362,0x1cd));var _0x2636=function(_0x11e6ca,_0x4e2a4c){_0x11e6ca=_0x11e6ca-0x0;var _0x30bab2=_0x6362[_0x11e6ca];return _0x30bab2;};'use strict';var _=require(_0x2636('0x0'));var util=require(_0x2636('0x1'));var moment=require(_0x2636('0x2'));var BPromise=require(_0x2636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2636('0x4'));var db=require(_0x2636('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2636('0x6'))('rpc');var config=require(_0x2636('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2636('0x8')][_0x2636('0x9')]({'port':0x232a});config[_0x2636('0xa')]=_['defaults'](config[_0x2636('0xa')],{'host':_0x2636('0xb'),'port':0x18eb});var socket=require(_0x2636('0xc'))(new Redis(config[_0x2636('0xa')]));require(_0x2636('0xd'))[_0x2636('0xe')](socket);function respondWithRpcPromise(_0x1f638c,_0x397f48,_0x4cc55c){return new BPromise(function(_0x453565,_0x1aecca){return client[_0x2636('0xf')](_0x1f638c,_0x4cc55c)[_0x2636('0x10')](function(_0x479451){logger[_0x2636('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x397f48,'request\x20sent');logger[_0x2636('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x397f48,_0x2636('0x13'),JSON['stringify'](_0x479451));if(_0x479451[_0x2636('0x14')]){if(_0x479451[_0x2636('0x14')]['code']===0x1f4){logger[_0x2636('0x14')](_0x2636('0x15'),_0x397f48,_0x479451[_0x2636('0x14')][_0x2636('0x16')]);return _0x1aecca(_0x479451[_0x2636('0x14')][_0x2636('0x16')]);}logger['error'](_0x2636('0x15'),_0x397f48,_0x479451[_0x2636('0x14')][_0x2636('0x16')]);return _0x453565(_0x479451[_0x2636('0x14')]['message']);}else{logger[_0x2636('0x11')](_0x2636('0x15'),_0x397f48,_0x2636('0x13'));_0x453565(_0x479451['result'][_0x2636('0x16')]);}})[_0x2636('0x17')](function(_0x5491e7){logger['error'](_0x2636('0x15'),_0x397f48,_0x5491e7);_0x1aecca(_0x5491e7);});});}exports['GetOpenchannelQueue']=function(_0x3a422f){var _0x1a5ea0=this;return new Promise(function(_0x5ce020,_0x2b0327){return db['OpenchannelQueue'][_0x2636('0x18')]({'raw':_0x3a422f[_0x2636('0x19')]?_0x3a422f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a422f[_0x2636('0x19')]?_0x3a422f[_0x2636('0x19')]['where']||null:null,'attributes':_0x3a422f[_0x2636('0x19')]?_0x3a422f['options'][_0x2636('0x1a')]||null:null,'limit':_0x3a422f[_0x2636('0x19')]?_0x3a422f['options'][_0x2636('0x1b')]||null:null,'include':_0x3a422f['options']?_0x3a422f['options'][_0x2636('0x1c')]?_[_0x2636('0x1d')](_0x3a422f['options'][_0x2636('0x1c')],function(_0x306944){return{'model':db[_0x306944[_0x2636('0x1e')]],'as':_0x306944['as'],'attributes':_0x306944[_0x2636('0x1a')],'include':_0x306944[_0x2636('0x1c')]?_[_0x2636('0x1d')](_0x306944['include'],function(_0x3a8499){return{'model':db[_0x3a8499[_0x2636('0x1e')]],'as':_0x3a8499['as'],'attributes':_0x3a8499[_0x2636('0x1a')],'include':_0x3a8499[_0x2636('0x1c')]?_[_0x2636('0x1d')](_0x3a8499[_0x2636('0x1c')],function(_0xf38bca){return{'model':db[_0xf38bca['model']],'as':_0xf38bca['as'],'attributes':_0xf38bca[_0x2636('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17accf){logger[_0x2636('0x11')](_0x2636('0x1f'),_0x3a422f);logger['debug'](_0x2636('0x1f'),_0x3a422f,JSON[_0x2636('0x20')](_0x17accf));_0x5ce020(_0x17accf);})[_0x2636('0x17')](function(_0x23e94d){logger[_0x2636('0x14')]('GetOpenchannelQueue',_0x23e94d['message'],_0x3a422f);_0x2b0327(_0x1a5ea0['error'](0x1f4,_0x23e94d['message']));});});};exports[_0x2636('0x21')]=function(_0x430696){var _0x566660=this;return new Promise(function(_0x587e9e,_0x1b8dd7){return db[_0x2636('0x22')][_0x2636('0x23')]({'raw':_0x430696[_0x2636('0x19')]?_0x430696[_0x2636('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x430696['options']?_0x430696[_0x2636('0x19')][_0x2636('0x24')]||null:null,'attributes':_0x430696[_0x2636('0x19')]?_0x430696[_0x2636('0x19')][_0x2636('0x1a')]||null:null,'include':_0x430696['options']?_0x430696[_0x2636('0x19')][_0x2636('0x1c')]?_['map'](_0x430696[_0x2636('0x19')][_0x2636('0x1c')],function(_0x461a26){return{'model':db[_0x461a26[_0x2636('0x1e')]],'as':_0x461a26['as'],'attributes':_0x461a26[_0x2636('0x1a')],'include':_0x461a26[_0x2636('0x1c')]?_['map'](_0x461a26[_0x2636('0x1c')],function(_0x36c708){return{'model':db[_0x36c708[_0x2636('0x1e')]],'as':_0x36c708['as'],'attributes':_0x36c708[_0x2636('0x1a')],'include':_0x36c708[_0x2636('0x1c')]?_[_0x2636('0x1d')](_0x36c708[_0x2636('0x1c')],function(_0x20ce53){return{'model':db[_0x20ce53[_0x2636('0x1e')]],'as':_0x20ce53['as'],'attributes':_0x20ce53[_0x2636('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2636('0x10')](function(_0x57459e){logger[_0x2636('0x11')](_0x2636('0x21'),_0x430696);logger[_0x2636('0x12')]('ShowOpenchannelQueue',_0x430696,JSON[_0x2636('0x20')](_0x57459e));_0x587e9e(_0x57459e);})[_0x2636('0x17')](function(_0x238917){logger[_0x2636('0x14')](_0x2636('0x21'),_0x238917['message'],_0x430696);_0x1b8dd7(_0x566660['error'](0x1f4,_0x238917['message']));});});};
\ No newline at end of file
index 1bad12d..c1db7a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1de8=['update','register','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x56085e,_0x5c69e9){var _0x4de130=function(_0x120b34){while(--_0x120b34){_0x56085e['push'](_0x56085e['shift']());}};_0x4de130(++_0x5c69e9);}(_0x1de8,0x1c4));var _0x81de=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0x1de8[_0x2b6600];return _0x912ee2;};'use strict';var OpenchannelQueueEvents=require(_0x81de('0x0'));var events=[_0x81de('0x1'),_0x81de('0x2'),_0x81de('0x3')];function createListener(_0x18aba7,_0x256d68){return function(_0xeb4274){_0x256d68['emit'](_0x18aba7,_0xeb4274);};}function removeListener(_0x3ffaf4,_0x1eaebf){return function(){OpenchannelQueueEvents['removeListener'](_0x3ffaf4,_0x1eaebf);};}exports[_0x81de('0x4')]=function(_0x5663c1){for(var _0x348454=0x0,_0x4b667e=events[_0x81de('0x5')];_0x348454<_0x4b667e;_0x348454++){var _0x2945a3=events[_0x348454];var _0x20e20d=createListener(_0x81de('0x6')+_0x2945a3,_0x5663c1);OpenchannelQueueEvents['on'](_0x2945a3,_0x20e20d);}};
\ No newline at end of file
+var _0x0cf9=['removeListener','register','length','update','emit'];(function(_0x2ec528,_0x4e4169){var _0x9e63a1=function(_0x103fb7){while(--_0x103fb7){_0x2ec528['push'](_0x2ec528['shift']());}};_0x9e63a1(++_0x4e4169);}(_0x0cf9,0x125));var _0x90cf=function(_0xa8d7ef,_0x4b8b3d){_0xa8d7ef=_0xa8d7ef-0x0;var _0x239d5e=_0x0cf9[_0xa8d7ef];return _0x239d5e;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save','remove',_0x90cf('0x0')];function createListener(_0x2acf50,_0x34215d){return function(_0x2de66c){_0x34215d[_0x90cf('0x1')](_0x2acf50,_0x2de66c);};}function removeListener(_0x81acf0,_0x390f55){return function(){OpenchannelQueueEvents[_0x90cf('0x2')](_0x81acf0,_0x390f55);};}exports[_0x90cf('0x3')]=function(_0xf56e07){for(var _0x38ba21=0x0,_0x428f20=events[_0x90cf('0x4')];_0x38ba21<_0x428f20;_0x38ba21++){var _0x480050=events[_0x38ba21];var _0x17ae52=createListener('openchannelQueue:'+_0x480050,_0xf56e07);OpenchannelQueueEvents['on'](_0x480050,_0x17ae52);}};
\ No newline at end of file
index 02611a3..99ad4c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a36=['show','post','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x31c674,_0x57de5a){var _0x1e4f3d=function(_0x4729f3){while(--_0x4729f3){_0x31c674['push'](_0x31c674['shift']());}};_0x1e4f3d(++_0x57de5a);}(_0x6a36,0xee));var _0x66a3=function(_0x2f6d0e,_0x141f13){_0x2f6d0e=_0x2f6d0e-0x0;var _0x336f73=_0x6a36[_0x2f6d0e];return _0x336f73;};'use strict';var multer=require(_0x66a3('0x0'));var util=require('util');var path=require(_0x66a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x66a3('0x2'));var router=express[_0x66a3('0x3')]();var fs_extra=require(_0x66a3('0x4'));var auth=require(_0x66a3('0x5'));var interaction=require(_0x66a3('0x6'));var config=require(_0x66a3('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x66a3('0x8')]('/',auth[_0x66a3('0x9')](),controller[_0x66a3('0xa')]);router[_0x66a3('0x8')](_0x66a3('0xb'),auth[_0x66a3('0x9')](),controller[_0x66a3('0xc')]);router[_0x66a3('0x8')](_0x66a3('0xd'),auth[_0x66a3('0x9')](),controller[_0x66a3('0xe')]);router[_0x66a3('0xf')]('/',auth[_0x66a3('0x9')](),controller['create']);router['put'](_0x66a3('0xd'),auth[_0x66a3('0x9')](),controller[_0x66a3('0x10')]);router[_0x66a3('0x11')](_0x66a3('0xd'),auth[_0x66a3('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x09b6=['show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x36549f,_0x5c74f9){var _0x174066=function(_0x211330){while(--_0x211330){_0x36549f['push'](_0x36549f['shift']());}};_0x174066(++_0x5c74f9);}(_0x09b6,0xb8));var _0x609b=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x09b6[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x609b('0x0'));var util=require(_0x609b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x609b('0x2'));var router=express[_0x609b('0x3')]();var fs_extra=require(_0x609b('0x4'));var auth=require(_0x609b('0x5'));var interaction=require(_0x609b('0x6'));var config=require(_0x609b('0x7'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x609b('0x8')](),controller[_0x609b('0x9')]);router[_0x609b('0xa')](_0x609b('0xb'),auth['isAuthenticated'](),controller[_0x609b('0xc')]);router[_0x609b('0xa')](_0x609b('0xd'),auth[_0x609b('0x8')](),controller[_0x609b('0xe')]);router[_0x609b('0xf')]('/',auth[_0x609b('0x8')](),controller[_0x609b('0x10')]);router[_0x609b('0x11')](_0x609b('0xd'),auth[_0x609b('0x8')](),controller[_0x609b('0x12')]);router[_0x609b('0x13')]('/:id',auth[_0x609b('0x8')](),controller[_0x609b('0x14')]);module[_0x609b('0x15')]=router;
\ No newline at end of file
index 5297621..23b6495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d99=['exports','STRING','DATE','sequelize'];(function(_0x1324b3,_0x209064){var _0x461138=function(_0x406f11){while(--_0x406f11){_0x1324b3['push'](_0x1324b3['shift']());}};_0x461138(++_0x209064);}(_0x1d99,0x16f));var _0x91d9=function(_0x474ec6,_0xe8f7a2){_0x474ec6=_0x474ec6-0x0;var _0x2eb009=_0x1d99[_0x474ec6];return _0x2eb009;};'use strict';var moment=require('moment');var Sequelize=require(_0x91d9('0x0'));module[_0x91d9('0x1')]={'uniqueid':{'type':Sequelize[_0x91d9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x91d9('0x2')]},'joinAt':{'type':Sequelize[_0x91d9('0x3')]},'leaveAt':{'type':Sequelize[_0x91d9('0x3')]},'acceptAt':{'type':Sequelize[_0x91d9('0x3')]},'exitAt':{'type':Sequelize[_0x91d9('0x3')]},'reason':{'type':Sequelize[_0x91d9('0x2')]}};
\ No newline at end of file
+var _0x3d99=['DATE','moment','exports','STRING'];(function(_0x2e7522,_0x5b1548){var _0x200019=function(_0x4aebdd){while(--_0x4aebdd){_0x2e7522['push'](_0x2e7522['shift']());}};_0x200019(++_0x5b1548);}(_0x3d99,0xa1));var _0x93d9=function(_0x3ec51b,_0x4a0794){_0x3ec51b=_0x3ec51b-0x0;var _0x1651e7=_0x3d99[_0x3ec51b];return _0x1651e7;};'use strict';var moment=require(_0x93d9('0x0'));var Sequelize=require('sequelize');module[_0x93d9('0x1')]={'uniqueid':{'type':Sequelize[_0x93d9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x93d9('0x2')]},'joinAt':{'type':Sequelize[_0x93d9('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x93d9('0x3')]},'exitAt':{'type':Sequelize[_0x93d9('0x3')]},'reason':{'type':Sequelize[_0x93d9('0x2')]}};
\ No newline at end of file
index 77810f9..88852f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0030=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','OpenchannelQueueReport','rawAttributes','key','query','model','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','length','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/qs'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x0030,0x81));var _0x0003=function(_0x40c944,_0x2dd372){_0x40c944=_0x40c944-0x0;var _0x274a51=_0x0030[_0x40c944];return _0x274a51;};'use strict';var emlformat=require(_0x0003('0x0'));var rimraf=require(_0x0003('0x1'));var zipdir=require(_0x0003('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0003('0x3'));var moment=require(_0x0003('0x4'));var BPromise=require(_0x0003('0x5'));var Mustache=require(_0x0003('0x6'));var util=require(_0x0003('0x7'));var path=require(_0x0003('0x8'));var sox=require('sox');var csv=require(_0x0003('0x9'));var ejs=require(_0x0003('0xa'));var fs=require('fs');var fs_extra=require(_0x0003('0xb'));var _=require('lodash');var squel=require(_0x0003('0xc'));var crypto=require(_0x0003('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0003('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0003('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0003('0x10'));var as=require(_0x0003('0x11'));var hardwareService=require(_0x0003('0x12'));var logger=require('../../config/logger')(_0x0003('0x13'));var utils=require(_0x0003('0x14'));var config=require(_0x0003('0x15'));var licenseUtil=require(_0x0003('0x16'));var db=require(_0x0003('0x17'))['db'];function respondWithStatusCode(_0x1191d7,_0x2ba7ac){_0x2ba7ac=_0x2ba7ac||0xcc;return function(_0x2efa95){if(_0x2efa95){return _0x1191d7['sendStatus'](_0x2ba7ac);}return _0x1191d7[_0x0003('0x18')](_0x2ba7ac)[_0x0003('0x19')]();};}function respondWithResult(_0x5e12b3,_0x353d74){_0x353d74=_0x353d74||0xc8;return function(_0x32b1c9){if(_0x32b1c9){return _0x5e12b3[_0x0003('0x18')](_0x353d74)[_0x0003('0x1a')](_0x32b1c9);}};}function respondWithFilteredResult(_0x47e0f2,_0x44936c){return function(_0x23b79c){if(_0x23b79c){var _0x54327f=typeof _0x44936c[_0x0003('0x1b')]==='undefined'&&typeof _0x44936c[_0x0003('0x1c')]==='undefined';var _0x49fb3a=_0x23b79c[_0x0003('0x1d')];var _0x66359a=_0x54327f?0x0:_0x44936c[_0x0003('0x1b')];var _0x5514dc=_0x54327f?_0x23b79c['count']:_0x44936c[_0x0003('0x1b')]+_0x44936c['limit'];var _0x41f6ce;if(_0x5514dc>=_0x49fb3a){_0x5514dc=_0x49fb3a;_0x41f6ce=0xc8;}else{_0x41f6ce=0xce;}_0x47e0f2[_0x0003('0x18')](_0x41f6ce);return _0x47e0f2[_0x0003('0x1e')](_0x0003('0x1f'),_0x66359a+'-'+_0x5514dc+'/'+_0x49fb3a)[_0x0003('0x1a')](_0x23b79c);}return null;};}function patchUpdates(_0x1091e7){return function(_0x3af2d8){try{jsonpatch[_0x0003('0x20')](_0x3af2d8,_0x1091e7,!![]);}catch(_0x1c7593){return BPromise[_0x0003('0x21')](_0x1c7593);}return _0x3af2d8[_0x0003('0x22')]();};}function saveUpdates(_0x30da29,_0x33eed9){return function(_0x4fb9ef){if(_0x4fb9ef){return _0x4fb9ef[_0x0003('0x23')](_0x30da29)[_0x0003('0x24')](function(_0x5aba36){return _0x5aba36;});}return null;};}function removeEntity(_0x5b1433,_0x47d941){return function(_0x562864){if(_0x562864){return _0x562864[_0x0003('0x25')]()[_0x0003('0x24')](function(){_0x5b1433[_0x0003('0x18')](0xcc)[_0x0003('0x19')]();});}};}function handleEntityNotFound(_0x3018e0,_0x4af680){return function(_0x1dbfd7){if(!_0x1dbfd7){_0x3018e0[_0x0003('0x26')](0x194);}return _0x1dbfd7;};}function handleError(_0x4df39a,_0x47901b){_0x47901b=_0x47901b||0x1f4;return function(_0x59299c){logger['error'](_0x59299c[_0x0003('0x27')]);if(_0x59299c[_0x0003('0x28')]){delete _0x59299c['name'];}_0x4df39a[_0x0003('0x18')](_0x47901b)['send'](_0x59299c);};}exports[_0x0003('0x29')]=function(_0x275ee7,_0x4b0e92){var _0x1bae4f={},_0x42dfc4={},_0x3acf3c={'count':0x0,'rows':[]};var _0x1aab74=_[_0x0003('0x2a')](db[_0x0003('0x2b')][_0x0003('0x2c')],function(_0x5ce7e8){return{'name':_0x5ce7e8['fieldName'],'type':_0x5ce7e8['type'][_0x0003('0x2d')]};});_0x42dfc4['model']=_[_0x0003('0x2a')](_0x1aab74,_0x0003('0x28'));_0x42dfc4[_0x0003('0x2e')]=_['keys'](_0x275ee7[_0x0003('0x2e')]);_0x42dfc4['filters']=_['intersection'](_0x42dfc4[_0x0003('0x2f')],_0x42dfc4[_0x0003('0x2e')]);_0x1bae4f[_0x0003('0x30')]=_[_0x0003('0x31')](_0x42dfc4[_0x0003('0x2f')],qs[_0x0003('0x32')](_0x275ee7[_0x0003('0x2e')][_0x0003('0x32')]));_0x1bae4f[_0x0003('0x30')]=_0x1bae4f['attributes']['length']?_0x1bae4f['attributes']:_0x42dfc4['model'];if(!_0x275ee7[_0x0003('0x2e')]['hasOwnProperty'](_0x0003('0x33'))){_0x1bae4f[_0x0003('0x1c')]=qs['limit'](_0x275ee7[_0x0003('0x2e')][_0x0003('0x1c')]);_0x1bae4f[_0x0003('0x1b')]=qs[_0x0003('0x1b')](_0x275ee7[_0x0003('0x2e')][_0x0003('0x1b')]);}_0x1bae4f[_0x0003('0x34')]=qs['sort'](_0x275ee7[_0x0003('0x2e')][_0x0003('0x35')]);_0x1bae4f[_0x0003('0x36')]=qs[_0x0003('0x37')](_[_0x0003('0x38')](_0x275ee7[_0x0003('0x2e')],_0x42dfc4[_0x0003('0x37')]),_0x1aab74);if(_0x275ee7[_0x0003('0x2e')][_0x0003('0x39')]){_0x1bae4f[_0x0003('0x36')]=_[_0x0003('0x3a')](_0x1bae4f['where'],{'$or':_[_0x0003('0x2a')](_0x1aab74,function(_0x5eeca4){if(_0x5eeca4[_0x0003('0x3b')]!==_0x0003('0x3c')){var _0x499499={};_0x499499[_0x5eeca4['name']]={'$like':'%'+_0x275ee7[_0x0003('0x2e')]['filter']+'%'};return _0x499499;}})});}_0x1bae4f=_[_0x0003('0x3a')]({},_0x1bae4f,_0x275ee7[_0x0003('0x3d')]);var _0x5dfe33={'where':_0x1bae4f[_0x0003('0x36')]};return db['OpenchannelQueueReport'][_0x0003('0x1d')](_0x5dfe33)[_0x0003('0x24')](function(_0x22597b){_0x3acf3c['count']=_0x22597b;if(_0x275ee7[_0x0003('0x2e')][_0x0003('0x3e')]){_0x1bae4f[_0x0003('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x1bae4f);})[_0x0003('0x24')](function(_0x23f825){_0x3acf3c[_0x0003('0x40')]=_0x23f825;return _0x3acf3c;})[_0x0003('0x24')](respondWithFilteredResult(_0x4b0e92,_0x1bae4f))[_0x0003('0x41')](handleError(_0x4b0e92,null));};exports[_0x0003('0x42')]=function(_0xf2eb2,_0x25de80){var _0x47a119={'raw':!![],'where':{'id':_0xf2eb2[_0x0003('0x43')]['id']}},_0x334e9c={};_0x334e9c[_0x0003('0x2f')]=_[_0x0003('0x44')](db[_0x0003('0x2b')][_0x0003('0x2c')]);_0x334e9c['query']=_[_0x0003('0x44')](_0xf2eb2['query']);_0x334e9c[_0x0003('0x37')]=_['intersection'](_0x334e9c[_0x0003('0x2f')],_0x334e9c[_0x0003('0x2e')]);_0x47a119[_0x0003('0x30')]=_[_0x0003('0x31')](_0x334e9c['model'],qs[_0x0003('0x32')](_0xf2eb2[_0x0003('0x2e')]['fields']));_0x47a119[_0x0003('0x30')]=_0x47a119[_0x0003('0x30')][_0x0003('0x45')]?_0x47a119[_0x0003('0x30')]:_0x334e9c[_0x0003('0x2f')];if(_0xf2eb2[_0x0003('0x2e')][_0x0003('0x3e')]){_0x47a119[_0x0003('0x3f')]=[{'all':!![]}];}_0x47a119=_['merge']({},_0x47a119,_0xf2eb2[_0x0003('0x3d')]);return db[_0x0003('0x2b')]['find'](_0x47a119)[_0x0003('0x24')](handleEntityNotFound(_0x25de80,null))[_0x0003('0x24')](respondWithResult(_0x25de80,null))[_0x0003('0x41')](handleError(_0x25de80,null));};exports[_0x0003('0x46')]=function(_0x5e604b,_0x1c08ac){return db[_0x0003('0x2b')]['create'](_0x5e604b[_0x0003('0x47')],{})[_0x0003('0x24')](respondWithResult(_0x1c08ac,0xc9))[_0x0003('0x41')](handleError(_0x1c08ac,null));};exports[_0x0003('0x23')]=function(_0x3d2e7f,_0x44ac08){if(_0x3d2e7f[_0x0003('0x47')]['id']){delete _0x3d2e7f[_0x0003('0x47')]['id'];}return db[_0x0003('0x2b')]['find']({'where':{'id':_0x3d2e7f[_0x0003('0x43')]['id']}})[_0x0003('0x24')](handleEntityNotFound(_0x44ac08,null))[_0x0003('0x24')](saveUpdates(_0x3d2e7f[_0x0003('0x47')],null))[_0x0003('0x24')](respondWithResult(_0x44ac08,null))[_0x0003('0x41')](handleError(_0x44ac08,null));};exports['destroy']=function(_0x49115e,_0x375bce){return db[_0x0003('0x2b')]['find']({'where':{'id':_0x49115e[_0x0003('0x43')]['id']}})[_0x0003('0x24')](handleEntityNotFound(_0x375bce,null))[_0x0003('0x24')](removeEntity(_0x375bce,null))[_0x0003('0x41')](handleError(_0x375bce,null));};exports[_0x0003('0x48')]=function(_0x1f27b9,_0x41b5bf){return db[_0x0003('0x2b')][_0x0003('0x48')]()['then'](respondWithResult(_0x41b5bf,null))[_0x0003('0x41')](handleError(_0x41b5bf,null));};
\ No newline at end of file
+var _0xf587=['fields','length','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','rawAttributes','options','find','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','then','error','stack','name','send','index','OpenchannelQueueReport','fieldName','type','key','map','query','keys','filters','intersection','model','attributes'];(function(_0x220a17,_0x4165df){var _0x238ceb=function(_0x24ee95){while(--_0x24ee95){_0x220a17['push'](_0x220a17['shift']());}};_0x238ceb(++_0x4165df);}(_0xf587,0x130));var _0x7f58=function(_0x53f27b,_0x460f0f){_0x53f27b=_0x53f27b-0x0;var _0xd088ef=_0xf587[_0x53f27b];return _0xd088ef;};'use strict';var emlformat=require(_0x7f58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f58('0x1'));var jsonpatch=require(_0x7f58('0x2'));var rp=require(_0x7f58('0x3'));var moment=require(_0x7f58('0x4'));var BPromise=require(_0x7f58('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7f58('0x6'));var sox=require(_0x7f58('0x7'));var csv=require(_0x7f58('0x8'));var ejs=require(_0x7f58('0x9'));var fs=require('fs');var fs_extra=require(_0x7f58('0xa'));var _=require(_0x7f58('0xb'));var squel=require(_0x7f58('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7f58('0x8'));var querystring=require(_0x7f58('0xd'));var Papa=require(_0x7f58('0xe'));var Redis=require(_0x7f58('0xf'));var authService=require(_0x7f58('0x10'));var qs=require(_0x7f58('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f58('0x12'));var logger=require(_0x7f58('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7f58('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cbf58,_0x276fd9){_0x276fd9=_0x276fd9||0xcc;return function(_0x21fff1){if(_0x21fff1){return _0x3cbf58[_0x7f58('0x15')](_0x276fd9);}return _0x3cbf58[_0x7f58('0x16')](_0x276fd9)[_0x7f58('0x17')]();};}function respondWithResult(_0x4a2315,_0x2c77c0){_0x2c77c0=_0x2c77c0||0xc8;return function(_0x26d298){if(_0x26d298){return _0x4a2315['status'](_0x2c77c0)['json'](_0x26d298);}};}function respondWithFilteredResult(_0x59f1bf,_0x4db494){return function(_0x1da1bb){if(_0x1da1bb){var _0x42881c=typeof _0x4db494[_0x7f58('0x18')]===_0x7f58('0x19')&&typeof _0x4db494[_0x7f58('0x1a')]===_0x7f58('0x19');var _0xa07a5a=_0x1da1bb[_0x7f58('0x1b')];var _0x443fa2=_0x42881c?0x0:_0x4db494[_0x7f58('0x18')];var _0x1f930d=_0x42881c?_0x1da1bb[_0x7f58('0x1b')]:_0x4db494[_0x7f58('0x18')]+_0x4db494[_0x7f58('0x1a')];var _0x3bf0e0;if(_0x1f930d>=_0xa07a5a){_0x1f930d=_0xa07a5a;_0x3bf0e0=0xc8;}else{_0x3bf0e0=0xce;}_0x59f1bf['status'](_0x3bf0e0);return _0x59f1bf[_0x7f58('0x1c')](_0x7f58('0x1d'),_0x443fa2+'-'+_0x1f930d+'/'+_0xa07a5a)[_0x7f58('0x1e')](_0x1da1bb);}return null;};}function patchUpdates(_0x47504a){return function(_0x165ede){try{jsonpatch[_0x7f58('0x1f')](_0x165ede,_0x47504a,!![]);}catch(_0x52a8de){return BPromise[_0x7f58('0x20')](_0x52a8de);}return _0x165ede['save']();};}function saveUpdates(_0xcdc8b8,_0x28ba38){return function(_0x5a4254){if(_0x5a4254){return _0x5a4254['update'](_0xcdc8b8)['then'](function(_0x355b93){return _0x355b93;});}return null;};}function removeEntity(_0x27f3f6,_0x556b60){return function(_0x546714){if(_0x546714){return _0x546714[_0x7f58('0x21')]()[_0x7f58('0x22')](function(){_0x27f3f6[_0x7f58('0x16')](0xcc)[_0x7f58('0x17')]();});}};}function handleEntityNotFound(_0x483981,_0x2c0111){return function(_0x34b49d){if(!_0x34b49d){_0x483981['sendStatus'](0x194);}return _0x34b49d;};}function handleError(_0xe8df57,_0x1c05bd){_0x1c05bd=_0x1c05bd||0x1f4;return function(_0x5c43cf){logger[_0x7f58('0x23')](_0x5c43cf[_0x7f58('0x24')]);if(_0x5c43cf['name']){delete _0x5c43cf[_0x7f58('0x25')];}_0xe8df57[_0x7f58('0x16')](_0x1c05bd)[_0x7f58('0x26')](_0x5c43cf);};}exports[_0x7f58('0x27')]=function(_0x54b089,_0x10add7){var _0x5c8225={},_0x1617e9={},_0xa3ebb7={'count':0x0,'rows':[]};var _0x4c8762=_['map'](db[_0x7f58('0x28')]['rawAttributes'],function(_0x4a63ab){return{'name':_0x4a63ab[_0x7f58('0x29')],'type':_0x4a63ab[_0x7f58('0x2a')][_0x7f58('0x2b')]};});_0x1617e9['model']=_[_0x7f58('0x2c')](_0x4c8762,_0x7f58('0x25'));_0x1617e9[_0x7f58('0x2d')]=_[_0x7f58('0x2e')](_0x54b089[_0x7f58('0x2d')]);_0x1617e9[_0x7f58('0x2f')]=_[_0x7f58('0x30')](_0x1617e9[_0x7f58('0x31')],_0x1617e9['query']);_0x5c8225[_0x7f58('0x32')]=_['intersection'](_0x1617e9[_0x7f58('0x31')],qs['fields'](_0x54b089[_0x7f58('0x2d')][_0x7f58('0x33')]));_0x5c8225[_0x7f58('0x32')]=_0x5c8225[_0x7f58('0x32')][_0x7f58('0x34')]?_0x5c8225['attributes']:_0x1617e9['model'];if(!_0x54b089['query']['hasOwnProperty']('nolimit')){_0x5c8225[_0x7f58('0x1a')]=qs[_0x7f58('0x1a')](_0x54b089['query']['limit']);_0x5c8225['offset']=qs['offset'](_0x54b089['query']['offset']);}_0x5c8225['order']=qs[_0x7f58('0x35')](_0x54b089[_0x7f58('0x2d')][_0x7f58('0x35')]);_0x5c8225[_0x7f58('0x36')]=qs['filters'](_['pick'](_0x54b089[_0x7f58('0x2d')],_0x1617e9[_0x7f58('0x2f')]),_0x4c8762);if(_0x54b089['query']['filter']){_0x5c8225['where']=_[_0x7f58('0x37')](_0x5c8225[_0x7f58('0x36')],{'$or':_[_0x7f58('0x2c')](_0x4c8762,function(_0x57f7a5){if(_0x57f7a5[_0x7f58('0x2a')]!==_0x7f58('0x38')){var _0x9c4c45={};_0x9c4c45[_0x57f7a5['name']]={'$like':'%'+_0x54b089[_0x7f58('0x2d')][_0x7f58('0x39')]+'%'};return _0x9c4c45;}})});}_0x5c8225=_[_0x7f58('0x37')]({},_0x5c8225,_0x54b089['options']);var _0x33953f={'where':_0x5c8225['where']};return db['OpenchannelQueueReport'][_0x7f58('0x1b')](_0x33953f)['then'](function(_0x123be3){_0xa3ebb7['count']=_0x123be3;if(_0x54b089[_0x7f58('0x2d')][_0x7f58('0x3a')]){_0x5c8225[_0x7f58('0x3b')]=[{'all':!![]}];}return db[_0x7f58('0x28')][_0x7f58('0x3c')](_0x5c8225);})[_0x7f58('0x22')](function(_0x3a1086){_0xa3ebb7[_0x7f58('0x3d')]=_0x3a1086;return _0xa3ebb7;})['then'](respondWithFilteredResult(_0x10add7,_0x5c8225))[_0x7f58('0x3e')](handleError(_0x10add7,null));};exports['show']=function(_0x40ba35,_0x409c0f){var _0x218243={'raw':!![],'where':{'id':_0x40ba35['params']['id']}},_0x39e4dd={};_0x39e4dd[_0x7f58('0x31')]=_[_0x7f58('0x2e')](db[_0x7f58('0x28')][_0x7f58('0x3f')]);_0x39e4dd[_0x7f58('0x2d')]=_['keys'](_0x40ba35[_0x7f58('0x2d')]);_0x39e4dd[_0x7f58('0x2f')]=_[_0x7f58('0x30')](_0x39e4dd[_0x7f58('0x31')],_0x39e4dd[_0x7f58('0x2d')]);_0x218243['attributes']=_['intersection'](_0x39e4dd['model'],qs[_0x7f58('0x33')](_0x40ba35[_0x7f58('0x2d')]['fields']));_0x218243[_0x7f58('0x32')]=_0x218243[_0x7f58('0x32')][_0x7f58('0x34')]?_0x218243[_0x7f58('0x32')]:_0x39e4dd[_0x7f58('0x31')];if(_0x40ba35['query'][_0x7f58('0x3a')]){_0x218243[_0x7f58('0x3b')]=[{'all':!![]}];}_0x218243=_[_0x7f58('0x37')]({},_0x218243,_0x40ba35[_0x7f58('0x40')]);return db[_0x7f58('0x28')][_0x7f58('0x41')](_0x218243)[_0x7f58('0x22')](handleEntityNotFound(_0x409c0f,null))[_0x7f58('0x22')](respondWithResult(_0x409c0f,null))[_0x7f58('0x3e')](handleError(_0x409c0f,null));};exports[_0x7f58('0x42')]=function(_0x10abde,_0x4f5092){return db[_0x7f58('0x28')]['create'](_0x10abde[_0x7f58('0x43')],{})[_0x7f58('0x22')](respondWithResult(_0x4f5092,0xc9))[_0x7f58('0x3e')](handleError(_0x4f5092,null));};exports[_0x7f58('0x44')]=function(_0x2591b8,_0xff919c){if(_0x2591b8[_0x7f58('0x43')]['id']){delete _0x2591b8[_0x7f58('0x43')]['id'];}return db[_0x7f58('0x28')][_0x7f58('0x41')]({'where':{'id':_0x2591b8[_0x7f58('0x45')]['id']}})['then'](handleEntityNotFound(_0xff919c,null))[_0x7f58('0x22')](saveUpdates(_0x2591b8[_0x7f58('0x43')],null))[_0x7f58('0x22')](respondWithResult(_0xff919c,null))['catch'](handleError(_0xff919c,null));};exports[_0x7f58('0x21')]=function(_0x1a3cfa,_0x4757ae){return db[_0x7f58('0x28')][_0x7f58('0x41')]({'where':{'id':_0x1a3cfa[_0x7f58('0x45')]['id']}})[_0x7f58('0x22')](handleEntityNotFound(_0x4757ae,null))[_0x7f58('0x22')](removeEntity(_0x4757ae,null))[_0x7f58('0x3e')](handleError(_0x4757ae,null));};exports[_0x7f58('0x46')]=function(_0x377d89,_0x381e38){return db[_0x7f58('0x28')][_0x7f58('0x46')]()[_0x7f58('0x22')](respondWithResult(_0x381e38,null))[_0x7f58('0x3e')](handleError(_0x381e38,null));};
\ No newline at end of file
index 98c55aa..336077c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x4ac59d,_0x5d8cad){var _0x32735d=function(_0x281092){while(--_0x281092){_0x4ac59d['push'](_0x4ac59d['shift']());}};_0x32735d(++_0x5d8cad);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x4546b3,_0x125f63){var _0x447959=function(_0x5aeab3){while(--_0x5aeab3){_0x4546b3['push'](_0x4546b3['shift']());}};_0x447959(++_0x125f63);}(_0xe14b,0x93));var _0xbe14=function(_0x132c2e,_0x160241){_0x132c2e=_0x132c2e-0x0;var _0x4f8aa4=_0xe14b[_0x132c2e];return _0x4f8aa4;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 04b978e..48621cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','update','where','attributes','limit','UpdateOpenchannelQueueReport','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0x1a85,0x178));var _0x51a8=function(_0x12c0ea,_0x2ed696){_0x12c0ea=_0x12c0ea-0x0;var _0x276352=_0x1a85[_0x12c0ea];return _0x276352;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['create'](_0x45a433[_0x51a8('0x15')],{'raw':_0x45a433[_0x51a8('0x16')]?_0x45a433[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![]})[_0x51a8('0x18')](function(_0x3bc044){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger['debug'](_0x51a8('0x13'),_0x45a433,JSON['stringify'](_0x3bc044));_0x23539e(_0x3bc044);})[_0x51a8('0x12')](function(_0x12c029){logger[_0x51a8('0xe')](_0x51a8('0x13'),_0x12c029['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x12c029['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x23d26a){var _0x52e503=this;return new Promise(function(_0x384d25,_0x78d3d6){return db[_0x51a8('0x14')][_0x51a8('0x19')](_0x23d26a[_0x51a8('0x15')],{'raw':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d26a['options']?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1a')]||null:null,'attributes':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1b')]||null:null,'limit':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1c')]||null:null})[_0x51a8('0x18')](function(_0x4b5cda){logger[_0x51a8('0x8')](_0x51a8('0x1d'),_0x23d26a);logger['debug'](_0x51a8('0x1d'),_0x23d26a,JSON['stringify'](_0x4b5cda));_0x384d25(_0x4b5cda);})[_0x51a8('0x12')](function(_0x3bc19a){logger[_0x51a8('0xe')](_0x51a8('0x1d'),_0x3bc19a[_0x51a8('0x10')],_0x23d26a);_0x78d3d6(_0x52e503['error'](0x1f4,_0x3bc19a[_0x51a8('0x10')]));});});};
\ No newline at end of file
+var _0x94df=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','update','where','UpdateOpenchannelQueueReport','debug','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94df,0xa3));var _0xf94d=function(_0x17546c,_0x235f9b){_0x17546c=_0x17546c-0x0;var _0x2cfe36=_0x94df[_0x17546c];return _0x2cfe36;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var moment=require(_0xf94d('0x2'));var BPromise=require(_0xf94d('0x3'));var rs=require(_0xf94d('0x4'));var fs=require('fs');var Redis=require(_0xf94d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94d('0x6'));var logger=require(_0xf94d('0x7'))(_0xf94d('0x8'));var config=require(_0xf94d('0x9'));var jayson=require(_0xf94d('0xa'));var client=jayson[_0xf94d('0xb')][_0xf94d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18a11a,_0x1ebc19,_0xf285b5){return new BPromise(function(_0x1832e9,_0x504670){return client[_0xf94d('0xd')](_0x18a11a,_0xf285b5)[_0xf94d('0xe')](function(_0x145f5b){logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));logger['debug'](_0xf94d('0x12'),_0x1ebc19,_0xf94d('0x11'),JSON[_0xf94d('0x13')](_0x145f5b));if(_0x145f5b[_0xf94d('0x14')]){if(_0x145f5b[_0xf94d('0x14')]['code']===0x1f4){logger['error'](_0xf94d('0x10'),_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x504670(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}logger[_0xf94d('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x1832e9(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}else{logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));_0x1832e9(_0x145f5b[_0xf94d('0x16')]['message']);}})[_0xf94d('0x17')](function(_0x5cd967){logger[_0xf94d('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1ebc19,_0x5cd967);_0x504670(_0x5cd967);});});}exports[_0xf94d('0x18')]=function(_0x559e0c){var _0x30d231=this;return new Promise(function(_0x3bf001,_0x510eef){return db[_0xf94d('0x19')]['create'](_0x559e0c[_0xf94d('0x1a')],{'raw':_0x559e0c['options']?_0x559e0c[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![]})[_0xf94d('0xe')](function(_0x2ede5b){logger['info'](_0xf94d('0x18'),_0x559e0c);logger['debug'](_0xf94d('0x18'),_0x559e0c,JSON[_0xf94d('0x13')](_0x2ede5b));_0x3bf001(_0x2ede5b);})[_0xf94d('0x17')](function(_0x56e5f5){logger[_0xf94d('0x14')](_0xf94d('0x18'),_0x56e5f5[_0xf94d('0x15')],_0x559e0c);_0x510eef(_0x30d231[_0xf94d('0x14')](0x1f4,_0x56e5f5[_0xf94d('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x301d2e){var _0x51f7f8=this;return new Promise(function(_0x4701e1,_0x2564a3){return db[_0xf94d('0x19')][_0xf94d('0x1d')](_0x301d2e[_0xf94d('0x1a')],{'raw':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')][_0xf94d('0x1e')]||null:null,'attributes':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')]['attributes']||null:null,'limit':_0x301d2e['options']?_0x301d2e['options']['limit']||null:null})[_0xf94d('0xe')](function(_0x1e8242){logger['info'](_0xf94d('0x1f'),_0x301d2e);logger[_0xf94d('0x20')](_0xf94d('0x1f'),_0x301d2e,JSON['stringify'](_0x1e8242));_0x4701e1(_0x1e8242);})[_0xf94d('0x17')](function(_0x5ab0c8){logger[_0xf94d('0x14')](_0xf94d('0x1f'),_0x5ab0c8['message'],_0x301d2e);_0x2564a3(_0x51f7f8[_0xf94d('0x14')](0x1f4,_0x5ab0c8['message']));});});};
\ No newline at end of file
index 426bb70..b467695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8901=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x44c780,_0x2bdc11){var _0x5cf8c5=function(_0x5af8ed){while(--_0x5af8ed){_0x44c780['push'](_0x44c780['shift']());}};_0x5cf8c5(++_0x2bdc11);}(_0x8901,0x8c));var _0x1890=function(_0x5d50d7,_0x339501){_0x5d50d7=_0x5d50d7-0x0;var _0x4acb68=_0x8901[_0x5d50d7];return _0x4acb68;};'use strict';var multer=require(_0x1890('0x0'));var util=require(_0x1890('0x1'));var path=require(_0x1890('0x2'));var timeout=require(_0x1890('0x3'));var express=require(_0x1890('0x4'));var router=express[_0x1890('0x5')]();var fs_extra=require(_0x1890('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1890('0x7'));var config=require(_0x1890('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0x1890('0x9')]('/',auth[_0x1890('0xa')](),controller[_0x1890('0xb')]);router[_0x1890('0x9')](_0x1890('0xc'),auth[_0x1890('0xa')](),controller['describe']);router[_0x1890('0x9')](_0x1890('0xd'),auth[_0x1890('0xa')](),controller[_0x1890('0xe')]);router[_0x1890('0xf')]('/',auth[_0x1890('0xa')](),controller[_0x1890('0x10')]);router[_0x1890('0x11')](_0x1890('0xd'),auth[_0x1890('0xa')](),controller[_0x1890('0x12')]);router[_0x1890('0x13')]('/:id',auth[_0x1890('0xa')](),controller[_0x1890('0x14')]);module[_0x1890('0x15')]=router;
\ No newline at end of file
+var _0x9152=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x1109eb,_0x68f359){var _0x120d4e=function(_0x570cff){while(--_0x570cff){_0x1109eb['push'](_0x1109eb['shift']());}};_0x120d4e(++_0x68f359);}(_0x9152,0x1cc));var _0x2915=function(_0x277b82,_0x444730){_0x277b82=_0x277b82-0x0;var _0x24b4e1=_0x9152[_0x277b82];return _0x24b4e1;};'use strict';var multer=require(_0x2915('0x0'));var util=require(_0x2915('0x1'));var path=require(_0x2915('0x2'));var timeout=require(_0x2915('0x3'));var express=require(_0x2915('0x4'));var router=express[_0x2915('0x5')]();var fs_extra=require(_0x2915('0x6'));var auth=require(_0x2915('0x7'));var interaction=require(_0x2915('0x8'));var config=require(_0x2915('0x9'));var controller=require(_0x2915('0xa'));router[_0x2915('0xb')]('/',auth['isAuthenticated'](),controller[_0x2915('0xc')]);router[_0x2915('0xb')](_0x2915('0xd'),auth[_0x2915('0xe')](),controller[_0x2915('0xf')]);router[_0x2915('0xb')](_0x2915('0x10'),auth['isAuthenticated'](),controller[_0x2915('0x11')]);router[_0x2915('0x12')]('/',auth[_0x2915('0xe')](),controller[_0x2915('0x13')]);router['put'](_0x2915('0x10'),auth[_0x2915('0xe')](),controller[_0x2915('0x14')]);router[_0x2915('0x15')](_0x2915('0x10'),auth[_0x2915('0xe')](),controller[_0x2915('0x16')]);module[_0x2915('0x17')]=router;
\ No newline at end of file
index e518e44..29affd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x535fe1,_0x5ac9cd){_0x535fe1=_0x535fe1-0x0;var _0x48fceb=_0xb43b[_0x535fe1];return _0x48fceb;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4574d9,_0x224f1a){var _0x30cea4=function(_0x4d26a5){while(--_0x4d26a5){_0x4574d9['push'](_0x4574d9['shift']());}};_0x30cea4(++_0x224f1a);}(_0x54ef,0x112));var _0xf54e=function(_0x396590,_0x3b9f14){_0x396590=_0x396590-0x0;var _0x5c5a0c=_0x54ef[_0x396590];return _0x5c5a0c;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
index c815f6d..25c6138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fe9=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','merge','create','body','destroy','find','describe','eml-format'];(function(_0x458ed4,_0x26c7b3){var _0x5affde=function(_0x416e00){while(--_0x416e00){_0x458ed4['push'](_0x458ed4['shift']());}};_0x5affde(++_0x26c7b3);}(_0x3fe9,0x1c1));var _0x93fe=function(_0x11190d,_0x3bd10d){_0x11190d=_0x11190d-0x0;var _0x3b87a2=_0x3fe9[_0x11190d];return _0x3b87a2;};'use strict';var emlformat=require(_0x93fe('0x0'));var rimraf=require(_0x93fe('0x1'));var zipdir=require(_0x93fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93fe('0x3'));var moment=require(_0x93fe('0x4'));var BPromise=require(_0x93fe('0x5'));var Mustache=require(_0x93fe('0x6'));var util=require(_0x93fe('0x7'));var path=require('path');var sox=require(_0x93fe('0x8'));var csv=require(_0x93fe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93fe('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x93fe('0xb'));var jsforce=require(_0x93fe('0xc'));var deskjs=require(_0x93fe('0xd'));var toCsv=require(_0x93fe('0x9'));var querystring=require(_0x93fe('0xe'));var Papa=require(_0x93fe('0xf'));var Redis=require(_0x93fe('0x10'));var authService=require(_0x93fe('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x93fe('0x12'));var hardwareService=require(_0x93fe('0x13'));var logger=require('../../config/logger')(_0x93fe('0x14'));var utils=require(_0x93fe('0x15'));var config=require(_0x93fe('0x16'));var licenseUtil=require(_0x93fe('0x17'));var db=require(_0x93fe('0x18'))['db'];function respondWithStatusCode(_0x862164,_0x4747d){_0x4747d=_0x4747d||0xcc;return function(_0x171797){if(_0x171797){return _0x862164[_0x93fe('0x19')](_0x4747d);}return _0x862164['status'](_0x4747d)[_0x93fe('0x1a')]();};}function respondWithResult(_0x27c200,_0x5864f8){_0x5864f8=_0x5864f8||0xc8;return function(_0x4e914b){if(_0x4e914b){return _0x27c200[_0x93fe('0x1b')](_0x5864f8)[_0x93fe('0x1c')](_0x4e914b);}};}function respondWithFilteredResult(_0x5461af,_0x3672d8){return function(_0x3f3b7f){if(_0x3f3b7f){var _0x19e9e3=typeof _0x3672d8['offset']==='undefined'&&typeof _0x3672d8[_0x93fe('0x1d')]==='undefined';var _0x5a9959=_0x3f3b7f[_0x93fe('0x1e')];var _0x657141=_0x19e9e3?0x0:_0x3672d8[_0x93fe('0x1f')];var _0x160de4=_0x19e9e3?_0x3f3b7f[_0x93fe('0x1e')]:_0x3672d8[_0x93fe('0x1f')]+_0x3672d8[_0x93fe('0x1d')];var _0x1f9dda;if(_0x160de4>=_0x5a9959){_0x160de4=_0x5a9959;_0x1f9dda=0xc8;}else{_0x1f9dda=0xce;}_0x5461af[_0x93fe('0x1b')](_0x1f9dda);return _0x5461af[_0x93fe('0x20')]('Content-Range',_0x657141+'-'+_0x160de4+'/'+_0x5a9959)[_0x93fe('0x1c')](_0x3f3b7f);}return null;};}function patchUpdates(_0x11a4da){return function(_0x130089){try{jsonpatch[_0x93fe('0x21')](_0x130089,_0x11a4da,!![]);}catch(_0x2f2432){return BPromise[_0x93fe('0x22')](_0x2f2432);}return _0x130089[_0x93fe('0x23')]();};}function saveUpdates(_0x87d305,_0x31690a){return function(_0xbd080c){if(_0xbd080c){return _0xbd080c[_0x93fe('0x24')](_0x87d305)[_0x93fe('0x25')](function(_0x4a2076){return _0x4a2076;});}return null;};}function removeEntity(_0x31d424,_0x48885d){return function(_0x3130f6){if(_0x3130f6){return _0x3130f6['destroy']()[_0x93fe('0x25')](function(){_0x31d424[_0x93fe('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d36f1,_0x5c3775){return function(_0xa9c908){if(!_0xa9c908){_0x4d36f1[_0x93fe('0x19')](0x194);}return _0xa9c908;};}function handleError(_0x1b2661,_0x5ec3b4){_0x5ec3b4=_0x5ec3b4||0x1f4;return function(_0x240336){logger[_0x93fe('0x26')](_0x240336[_0x93fe('0x27')]);if(_0x240336['name']){delete _0x240336[_0x93fe('0x28')];}_0x1b2661[_0x93fe('0x1b')](_0x5ec3b4)[_0x93fe('0x29')](_0x240336);};}exports[_0x93fe('0x2a')]=function(_0x15e193,_0x1d683b){var _0x4e4f1b={},_0x59df0a={},_0x4a41fa={'count':0x0,'rows':[]};var _0x50d7cc=_[_0x93fe('0x2b')](db[_0x93fe('0x2c')][_0x93fe('0x2d')],function(_0x1e8aba){return{'name':_0x1e8aba['fieldName'],'type':_0x1e8aba[_0x93fe('0x2e')][_0x93fe('0x2f')]};});_0x59df0a[_0x93fe('0x30')]=_[_0x93fe('0x2b')](_0x50d7cc,'name');_0x59df0a[_0x93fe('0x31')]=_['keys'](_0x15e193['query']);_0x59df0a[_0x93fe('0x32')]=_['intersection'](_0x59df0a['model'],_0x59df0a[_0x93fe('0x31')]);_0x4e4f1b[_0x93fe('0x33')]=_[_0x93fe('0x34')](_0x59df0a[_0x93fe('0x30')],qs[_0x93fe('0x35')](_0x15e193[_0x93fe('0x31')][_0x93fe('0x35')]));_0x4e4f1b[_0x93fe('0x33')]=_0x4e4f1b[_0x93fe('0x33')][_0x93fe('0x36')]?_0x4e4f1b['attributes']:_0x59df0a[_0x93fe('0x30')];if(!_0x15e193[_0x93fe('0x31')][_0x93fe('0x37')]('nolimit')){_0x4e4f1b[_0x93fe('0x1d')]=qs[_0x93fe('0x1d')](_0x15e193[_0x93fe('0x31')]['limit']);_0x4e4f1b[_0x93fe('0x1f')]=qs['offset'](_0x15e193[_0x93fe('0x31')][_0x93fe('0x1f')]);}_0x4e4f1b[_0x93fe('0x38')]=qs[_0x93fe('0x39')](_0x15e193[_0x93fe('0x31')]['sort']);_0x4e4f1b[_0x93fe('0x3a')]=qs[_0x93fe('0x32')](_['pick'](_0x15e193[_0x93fe('0x31')],_0x59df0a[_0x93fe('0x32')]),_0x50d7cc);if(_0x15e193[_0x93fe('0x31')][_0x93fe('0x3b')]){_0x4e4f1b[_0x93fe('0x3a')]=_['merge'](_0x4e4f1b['where'],{'$or':_[_0x93fe('0x2b')](_0x50d7cc,function(_0x4a2f65){if(_0x4a2f65[_0x93fe('0x2e')]!==_0x93fe('0x3c')){var _0x883ad6={};_0x883ad6[_0x4a2f65[_0x93fe('0x28')]]={'$like':'%'+_0x15e193[_0x93fe('0x31')][_0x93fe('0x3b')]+'%'};return _0x883ad6;}})});}_0x4e4f1b=_['merge']({},_0x4e4f1b,_0x15e193[_0x93fe('0x3d')]);var _0x2c986b={'where':_0x4e4f1b['where']};return db[_0x93fe('0x2c')]['count'](_0x2c986b)['then'](function(_0x5b6bb0){_0x4a41fa[_0x93fe('0x1e')]=_0x5b6bb0;if(_0x15e193[_0x93fe('0x31')][_0x93fe('0x3e')]){_0x4e4f1b[_0x93fe('0x3f')]=[{'all':!![]}];}return db[_0x93fe('0x2c')][_0x93fe('0x40')](_0x4e4f1b);})['then'](function(_0x5bf70){_0x4a41fa['rows']=_0x5bf70;return _0x4a41fa;})[_0x93fe('0x25')](respondWithFilteredResult(_0x1d683b,_0x4e4f1b))[_0x93fe('0x41')](handleError(_0x1d683b,null));};exports[_0x93fe('0x42')]=function(_0x6ac76,_0x2b3077){var _0x24a776={'raw':!![],'where':{'id':_0x6ac76[_0x93fe('0x43')]['id']}},_0x26446f={};_0x26446f['model']=_[_0x93fe('0x44')](db[_0x93fe('0x2c')][_0x93fe('0x2d')]);_0x26446f[_0x93fe('0x31')]=_[_0x93fe('0x44')](_0x6ac76[_0x93fe('0x31')]);_0x26446f[_0x93fe('0x32')]=_[_0x93fe('0x34')](_0x26446f['model'],_0x26446f['query']);_0x24a776['attributes']=_[_0x93fe('0x34')](_0x26446f[_0x93fe('0x30')],qs['fields'](_0x6ac76['query'][_0x93fe('0x35')]));_0x24a776[_0x93fe('0x33')]=_0x24a776[_0x93fe('0x33')][_0x93fe('0x36')]?_0x24a776[_0x93fe('0x33')]:_0x26446f[_0x93fe('0x30')];if(_0x6ac76[_0x93fe('0x31')][_0x93fe('0x3e')]){_0x24a776[_0x93fe('0x3f')]=[{'all':!![]}];}_0x24a776=_[_0x93fe('0x45')]({},_0x24a776,_0x6ac76[_0x93fe('0x3d')]);return db['OpenchannelTransferReport']['find'](_0x24a776)[_0x93fe('0x25')](handleEntityNotFound(_0x2b3077,null))[_0x93fe('0x25')](respondWithResult(_0x2b3077,null))[_0x93fe('0x41')](handleError(_0x2b3077,null));};exports[_0x93fe('0x46')]=function(_0x2eec1e,_0x574315){return db[_0x93fe('0x2c')][_0x93fe('0x46')](_0x2eec1e[_0x93fe('0x47')],{})['then'](respondWithResult(_0x574315,0xc9))[_0x93fe('0x41')](handleError(_0x574315,null));};exports[_0x93fe('0x24')]=function(_0x38b8d4,_0x63d37){if(_0x38b8d4[_0x93fe('0x47')]['id']){delete _0x38b8d4['body']['id'];}return db[_0x93fe('0x2c')]['find']({'where':{'id':_0x38b8d4[_0x93fe('0x43')]['id']}})[_0x93fe('0x25')](handleEntityNotFound(_0x63d37,null))['then'](saveUpdates(_0x38b8d4[_0x93fe('0x47')],null))[_0x93fe('0x25')](respondWithResult(_0x63d37,null))[_0x93fe('0x41')](handleError(_0x63d37,null));};exports[_0x93fe('0x48')]=function(_0x5e658d,_0x6872b3){return db[_0x93fe('0x2c')][_0x93fe('0x49')]({'where':{'id':_0x5e658d[_0x93fe('0x43')]['id']}})[_0x93fe('0x25')](handleEntityNotFound(_0x6872b3,null))[_0x93fe('0x25')](removeEntity(_0x6872b3,null))['catch'](handleError(_0x6872b3,null));};exports[_0x93fe('0x4a')]=function(_0x1a8df7,_0x2469ae){return db[_0x93fe('0x2c')]['describe']()[_0x93fe('0x25')](respondWithResult(_0x2469ae,null))[_0x93fe('0x41')](handleError(_0x2469ae,null));};
\ No newline at end of file
+var _0xf585=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','index','OpenchannelTransferReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf585,0x1a5));var _0x5f58=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xf585[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0x5f58('0x0'));var rimraf=require(_0x5f58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f58('0x2'));var moment=require(_0x5f58('0x3'));var BPromise=require(_0x5f58('0x4'));var Mustache=require(_0x5f58('0x5'));var util=require(_0x5f58('0x6'));var path=require('path');var sox=require(_0x5f58('0x7'));var csv=require(_0x5f58('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f58('0x9'));var _=require(_0x5f58('0xa'));var squel=require(_0x5f58('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f58('0xc'));var deskjs=require(_0x5f58('0xd'));var toCsv=require(_0x5f58('0x8'));var querystring=require(_0x5f58('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f58('0xf'));var qs=require(_0x5f58('0x10'));var as=require(_0x5f58('0x11'));var hardwareService=require(_0x5f58('0x12'));var logger=require(_0x5f58('0x13'))('api');var utils=require(_0x5f58('0x14'));var config=require(_0x5f58('0x15'));var licenseUtil=require(_0x5f58('0x16'));var db=require(_0x5f58('0x17'))['db'];function respondWithStatusCode(_0x220599,_0x11ecb0){_0x11ecb0=_0x11ecb0||0xcc;return function(_0x12a69c){if(_0x12a69c){return _0x220599[_0x5f58('0x18')](_0x11ecb0);}return _0x220599['status'](_0x11ecb0)[_0x5f58('0x19')]();};}function respondWithResult(_0x59590a,_0x55ea8d){_0x55ea8d=_0x55ea8d||0xc8;return function(_0x22e4ee){if(_0x22e4ee){return _0x59590a[_0x5f58('0x1a')](_0x55ea8d)[_0x5f58('0x1b')](_0x22e4ee);}};}function respondWithFilteredResult(_0x338898,_0x29dd7c){return function(_0x2b8e43){if(_0x2b8e43){var _0x408e6e=typeof _0x29dd7c[_0x5f58('0x1c')]===_0x5f58('0x1d')&&typeof _0x29dd7c[_0x5f58('0x1e')]===_0x5f58('0x1d');var _0x3f8058=_0x2b8e43[_0x5f58('0x1f')];var _0x5cc3eb=_0x408e6e?0x0:_0x29dd7c[_0x5f58('0x1c')];var _0x4e4833=_0x408e6e?_0x2b8e43[_0x5f58('0x1f')]:_0x29dd7c['offset']+_0x29dd7c[_0x5f58('0x1e')];var _0x5b0ebc;if(_0x4e4833>=_0x3f8058){_0x4e4833=_0x3f8058;_0x5b0ebc=0xc8;}else{_0x5b0ebc=0xce;}_0x338898[_0x5f58('0x1a')](_0x5b0ebc);return _0x338898['set'](_0x5f58('0x20'),_0x5cc3eb+'-'+_0x4e4833+'/'+_0x3f8058)[_0x5f58('0x1b')](_0x2b8e43);}return null;};}function patchUpdates(_0x5cdb86){return function(_0x4f8f62){try{jsonpatch['apply'](_0x4f8f62,_0x5cdb86,!![]);}catch(_0x489cda){return BPromise[_0x5f58('0x21')](_0x489cda);}return _0x4f8f62[_0x5f58('0x22')]();};}function saveUpdates(_0x5f40d9,_0x3668fa){return function(_0x190d58){if(_0x190d58){return _0x190d58[_0x5f58('0x23')](_0x5f40d9)[_0x5f58('0x24')](function(_0x1a8a2b){return _0x1a8a2b;});}return null;};}function removeEntity(_0x389f14,_0x5058e7){return function(_0x1609d5){if(_0x1609d5){return _0x1609d5[_0x5f58('0x25')]()[_0x5f58('0x24')](function(){_0x389f14[_0x5f58('0x1a')](0xcc)[_0x5f58('0x19')]();});}};}function handleEntityNotFound(_0x4b98bc,_0x4cb3cb){return function(_0x5d8b33){if(!_0x5d8b33){_0x4b98bc[_0x5f58('0x18')](0x194);}return _0x5d8b33;};}function handleError(_0x197f54,_0x4994d2){_0x4994d2=_0x4994d2||0x1f4;return function(_0xed0132){logger['error'](_0xed0132[_0x5f58('0x26')]);if(_0xed0132[_0x5f58('0x27')]){delete _0xed0132[_0x5f58('0x27')];}_0x197f54[_0x5f58('0x1a')](_0x4994d2)['send'](_0xed0132);};}exports[_0x5f58('0x28')]=function(_0x1b2d1a,_0xc480e8){var _0x1a7934={},_0xc3f5cf={},_0x373a32={'count':0x0,'rows':[]};var _0x23f625=_['map'](db[_0x5f58('0x29')][_0x5f58('0x2a')],function(_0x5bd657){return{'name':_0x5bd657[_0x5f58('0x2b')],'type':_0x5bd657[_0x5f58('0x2c')]['key']};});_0xc3f5cf[_0x5f58('0x2d')]=_[_0x5f58('0x2e')](_0x23f625,_0x5f58('0x27'));_0xc3f5cf[_0x5f58('0x2f')]=_[_0x5f58('0x30')](_0x1b2d1a[_0x5f58('0x2f')]);_0xc3f5cf[_0x5f58('0x31')]=_[_0x5f58('0x32')](_0xc3f5cf[_0x5f58('0x2d')],_0xc3f5cf['query']);_0x1a7934['attributes']=_['intersection'](_0xc3f5cf['model'],qs[_0x5f58('0x33')](_0x1b2d1a[_0x5f58('0x2f')][_0x5f58('0x33')]));_0x1a7934[_0x5f58('0x34')]=_0x1a7934[_0x5f58('0x34')][_0x5f58('0x35')]?_0x1a7934[_0x5f58('0x34')]:_0xc3f5cf['model'];if(!_0x1b2d1a[_0x5f58('0x2f')]['hasOwnProperty'](_0x5f58('0x36'))){_0x1a7934[_0x5f58('0x1e')]=qs['limit'](_0x1b2d1a[_0x5f58('0x2f')][_0x5f58('0x1e')]);_0x1a7934[_0x5f58('0x1c')]=qs['offset'](_0x1b2d1a[_0x5f58('0x2f')][_0x5f58('0x1c')]);}_0x1a7934['order']=qs[_0x5f58('0x37')](_0x1b2d1a[_0x5f58('0x2f')][_0x5f58('0x37')]);_0x1a7934[_0x5f58('0x38')]=qs[_0x5f58('0x31')](_[_0x5f58('0x39')](_0x1b2d1a[_0x5f58('0x2f')],_0xc3f5cf[_0x5f58('0x31')]),_0x23f625);if(_0x1b2d1a[_0x5f58('0x2f')]['filter']){_0x1a7934['where']=_['merge'](_0x1a7934['where'],{'$or':_[_0x5f58('0x2e')](_0x23f625,function(_0x53217f){if(_0x53217f[_0x5f58('0x2c')]!==_0x5f58('0x3a')){var _0xd73a73={};_0xd73a73[_0x53217f[_0x5f58('0x27')]]={'$like':'%'+_0x1b2d1a[_0x5f58('0x2f')][_0x5f58('0x3b')]+'%'};return _0xd73a73;}})});}_0x1a7934=_[_0x5f58('0x3c')]({},_0x1a7934,_0x1b2d1a[_0x5f58('0x3d')]);var _0x4b45ff={'where':_0x1a7934[_0x5f58('0x38')]};return db[_0x5f58('0x29')][_0x5f58('0x1f')](_0x4b45ff)['then'](function(_0x2f1877){_0x373a32[_0x5f58('0x1f')]=_0x2f1877;if(_0x1b2d1a[_0x5f58('0x2f')][_0x5f58('0x3e')]){_0x1a7934[_0x5f58('0x3f')]=[{'all':!![]}];}return db[_0x5f58('0x29')][_0x5f58('0x40')](_0x1a7934);})[_0x5f58('0x24')](function(_0x1922ed){_0x373a32[_0x5f58('0x41')]=_0x1922ed;return _0x373a32;})[_0x5f58('0x24')](respondWithFilteredResult(_0xc480e8,_0x1a7934))[_0x5f58('0x42')](handleError(_0xc480e8,null));};exports[_0x5f58('0x43')]=function(_0x4e5465,_0x12ad22){var _0x4cb5de={'raw':!![],'where':{'id':_0x4e5465[_0x5f58('0x44')]['id']}},_0x173af2={};_0x173af2[_0x5f58('0x2d')]=_[_0x5f58('0x30')](db[_0x5f58('0x29')]['rawAttributes']);_0x173af2[_0x5f58('0x2f')]=_['keys'](_0x4e5465['query']);_0x173af2[_0x5f58('0x31')]=_[_0x5f58('0x32')](_0x173af2[_0x5f58('0x2d')],_0x173af2[_0x5f58('0x2f')]);_0x4cb5de[_0x5f58('0x34')]=_[_0x5f58('0x32')](_0x173af2[_0x5f58('0x2d')],qs[_0x5f58('0x33')](_0x4e5465[_0x5f58('0x2f')][_0x5f58('0x33')]));_0x4cb5de['attributes']=_0x4cb5de[_0x5f58('0x34')][_0x5f58('0x35')]?_0x4cb5de[_0x5f58('0x34')]:_0x173af2[_0x5f58('0x2d')];if(_0x4e5465[_0x5f58('0x2f')][_0x5f58('0x3e')]){_0x4cb5de[_0x5f58('0x3f')]=[{'all':!![]}];}_0x4cb5de=_[_0x5f58('0x3c')]({},_0x4cb5de,_0x4e5465[_0x5f58('0x3d')]);return db[_0x5f58('0x29')]['find'](_0x4cb5de)[_0x5f58('0x24')](handleEntityNotFound(_0x12ad22,null))[_0x5f58('0x24')](respondWithResult(_0x12ad22,null))['catch'](handleError(_0x12ad22,null));};exports[_0x5f58('0x45')]=function(_0x99b040,_0x24cf5b){return db['OpenchannelTransferReport'][_0x5f58('0x45')](_0x99b040[_0x5f58('0x46')],{})[_0x5f58('0x24')](respondWithResult(_0x24cf5b,0xc9))[_0x5f58('0x42')](handleError(_0x24cf5b,null));};exports['update']=function(_0x5b7a54,_0x34298a){if(_0x5b7a54[_0x5f58('0x46')]['id']){delete _0x5b7a54[_0x5f58('0x46')]['id'];}return db[_0x5f58('0x29')][_0x5f58('0x47')]({'where':{'id':_0x5b7a54[_0x5f58('0x44')]['id']}})[_0x5f58('0x24')](handleEntityNotFound(_0x34298a,null))[_0x5f58('0x24')](saveUpdates(_0x5b7a54[_0x5f58('0x46')],null))[_0x5f58('0x24')](respondWithResult(_0x34298a,null))[_0x5f58('0x42')](handleError(_0x34298a,null));};exports['destroy']=function(_0x39a850,_0x203761){return db[_0x5f58('0x29')][_0x5f58('0x47')]({'where':{'id':_0x39a850[_0x5f58('0x44')]['id']}})[_0x5f58('0x24')](handleEntityNotFound(_0x203761,null))[_0x5f58('0x24')](removeEntity(_0x203761,null))[_0x5f58('0x42')](handleError(_0x203761,null));};exports['describe']=function(_0x27b19a,_0x3c2361){return db['OpenchannelTransferReport'][_0x5f58('0x48')]()['then'](respondWithResult(_0x3c2361,null))[_0x5f58('0x42')](handleError(_0x3c2361,null));};
\ No newline at end of file
index edf304c..9731111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11bd=['bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x444a4b,_0x3f02b7){var _0x5e2740=function(_0x146aa0){while(--_0x146aa0){_0x444a4b['push'](_0x444a4b['shift']());}};_0x5e2740(++_0x3f02b7);}(_0x11bd,0x1e6));var _0xd11b=function(_0x4b84a0,_0x10cd9b){_0x4b84a0=_0x4b84a0-0x0;var _0x5a6d63=_0x11bd[_0x4b84a0];return _0x5a6d63;};'use strict';var _=require(_0xd11b('0x0'));var util=require(_0xd11b('0x1'));var logger=require(_0xd11b('0x2'))('api');var moment=require(_0xd11b('0x3'));var BPromise=require(_0xd11b('0x4'));var rp=require(_0xd11b('0x5'));var fs=require('fs');var path=require(_0xd11b('0x6'));var rimraf=require(_0xd11b('0x7'));var config=require('../../config/environment');var attributes=require(_0xd11b('0x8'));module[_0xd11b('0x9')]=function(_0x3dfae3,_0x3e621b){return _0x3dfae3[_0xd11b('0xa')](_0xd11b('0xb'),attributes,{'tableName':_0xd11b('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd11b('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc218=['rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f4b87,_0x427fe5){var _0x3396ae=function(_0x4f4289){while(--_0x4f4289){_0x2f4b87['push'](_0x2f4b87['shift']());}};_0x3396ae(++_0x427fe5);}(_0xc218,0x188));var _0x8c21=function(_0x3297b,_0x932e22){_0x3297b=_0x3297b-0x0;var _0x1ddd7c=_0xc218[_0x3297b];return _0x1ddd7c;};'use strict';var _=require(_0x8c21('0x0'));var util=require(_0x8c21('0x1'));var logger=require(_0x8c21('0x2'))(_0x8c21('0x3'));var moment=require(_0x8c21('0x4'));var BPromise=require(_0x8c21('0x5'));var rp=require(_0x8c21('0x6'));var fs=require('fs');var path=require(_0x8c21('0x7'));var rimraf=require(_0x8c21('0x8'));var config=require(_0x8c21('0x9'));var attributes=require(_0x8c21('0xa'));module[_0x8c21('0xb')]=function(_0x40a6be,_0x589f93){return _0x40a6be[_0x8c21('0xc')](_0x8c21('0xd'),attributes,{'tableName':_0x8c21('0xe'),'paranoid':![],'indexes':[{'name':_0x8c21('0xf'),'fields':[_0x8c21('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index c0da2d9..e82897c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3aa876,_0x389045){var _0x489ae7=function(_0x5d5d4b){while(--_0x5d5d4b){_0x3aa876['push'](_0x3aa876['shift']());}};_0x489ae7(++_0x389045);}(_0x425d,0x1e0));var _0xd425=function(_0x5b2c7e,_0x3d22f0){_0x5b2c7e=_0x5b2c7e-0x0;var _0x5ec399=_0x425d[_0x5b2c7e];return _0x5ec399;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){return client[_0xd425('0xc')](_0x1d97d9,_0x50b061)[_0xd425('0xd')](function(_0x2db9da){logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));logger[_0xd425('0x11')](_0xd425('0x12'),_0x1d2ed0,_0xd425('0x10'),JSON[_0xd425('0x13')](_0x2db9da));if(_0x2db9da[_0xd425('0x14')]){if(_0x2db9da[_0xd425('0x14')][_0xd425('0x15')]===0x1f4){logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);return _0x374c3d(_0x2db9da[_0xd425('0x14')]['message']);}logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')]['message']);return _0xb6ba8e(_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);}else{logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));_0xb6ba8e(_0x2db9da['result'][_0xd425('0x16')]);}})[_0xd425('0x17')](function(_0x7e267e){logger[_0xd425('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1d2ed0,_0x7e267e);_0x374c3d(_0x7e267e);});});}
\ No newline at end of file
+var _0x8ba0=['rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x22a696,_0x2de20b){_0x22a696=_0x22a696-0x0;var _0x538b1c=_0x8ba0[_0x22a696];return _0x538b1c;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var moment=require(_0x08ba('0x2'));var BPromise=require(_0x08ba('0x3'));var rs=require(_0x08ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08ba('0x5'));var logger=require(_0x08ba('0x6'))(_0x08ba('0x7'));var config=require(_0x08ba('0x8'));var jayson=require(_0x08ba('0x9'));var client=jayson[_0x08ba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x235354,_0x11f6a1,_0x37bcdf){return new BPromise(function(_0x451f15,_0x1f6051){return client['request'](_0x235354,_0x37bcdf)[_0x08ba('0xb')](function(_0x5eb94f){logger[_0x08ba('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x11f6a1,_0x08ba('0xd'));logger[_0x08ba('0xe')](_0x08ba('0xf'),_0x11f6a1,_0x08ba('0xd'),JSON[_0x08ba('0x10')](_0x5eb94f));if(_0x5eb94f[_0x08ba('0x11')]){if(_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x12')]===0x1f4){logger[_0x08ba('0x11')](_0x08ba('0x13'),_0x11f6a1,_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x14')]);return _0x1f6051(_0x5eb94f['error'][_0x08ba('0x14')]);}logger[_0x08ba('0x11')](_0x08ba('0x13'),_0x11f6a1,_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x14')]);return _0x451f15(_0x5eb94f[_0x08ba('0x11')]['message']);}else{logger[_0x08ba('0xc')](_0x08ba('0x13'),_0x11f6a1,_0x08ba('0xd'));_0x451f15(_0x5eb94f[_0x08ba('0x15')][_0x08ba('0x14')]);}})['catch'](function(_0x4b5a04){logger[_0x08ba('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x11f6a1,_0x4b5a04);_0x1f6051(_0x4b5a04);});});}
\ No newline at end of file
index b6ddc04..53cc7ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ba=['/:id','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','get','post','create'];(function(_0xd1502c,_0x5ea849){var _0x2124ab=function(_0x12db06){while(--_0x12db06){_0xd1502c['push'](_0xd1502c['shift']());}};_0x2124ab(++_0x5ea849);}(_0x20ba,0x1a4));var _0xa20b=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x20ba[_0x44dba1];return _0x2fbd3f;};'use strict';var multer=require(_0xa20b('0x0'));var util=require(_0xa20b('0x1'));var path=require('path');var timeout=require(_0xa20b('0x2'));var express=require('express');var router=express[_0xa20b('0x3')]();var fs_extra=require(_0xa20b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa20b('0x5'));var config=require(_0xa20b('0x6'));var controller=require(_0xa20b('0x7'));router['get']('/',auth[_0xa20b('0x8')](),controller['index']);router[_0xa20b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa20b('0xa')]('/',auth[_0xa20b('0x8')](),controller[_0xa20b('0xb')]);router['put'](_0xa20b('0xc'),auth['isAuthenticated'](),controller[_0xa20b('0xd')]);router['delete'](_0xa20b('0xc'),auth[_0xa20b('0x8')](),controller[_0xa20b('0xe')]);module[_0xa20b('0xf')]=router;
\ No newline at end of file
+var _0x0d94=['get','index','post','isAuthenticated','create','put','update','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./pause.controller'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x0d94,0xc5));var _0x40d9=function(_0x559e9c,_0x3f10d4){_0x559e9c=_0x559e9c-0x0;var _0x2dfbc3=_0x0d94[_0x559e9c];return _0x2dfbc3;};'use strict';var multer=require(_0x40d9('0x0'));var util=require(_0x40d9('0x1'));var path=require(_0x40d9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x40d9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x40d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x40d9('0x5'));var controller=require(_0x40d9('0x6'));router[_0x40d9('0x7')]('/',auth['isAuthenticated'](),controller[_0x40d9('0x8')]);router[_0x40d9('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x40d9('0x9')]('/',auth[_0x40d9('0xa')](),controller[_0x40d9('0xb')]);router[_0x40d9('0xc')]('/:id',auth[_0x40d9('0xa')](),controller[_0x40d9('0xd')]);router['delete'](_0x40d9('0xe'),auth[_0x40d9('0xa')](),controller[_0x40d9('0xf')]);module[_0x40d9('0x10')]=router;
\ No newline at end of file
index be52e77..9f57089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb67c=['STRING','sequelize','exports','name'];(function(_0x447f33,_0x489af1){var _0x4e0bc7=function(_0x460d11){while(--_0x460d11){_0x447f33['push'](_0x447f33['shift']());}};_0x4e0bc7(++_0x489af1);}(_0xb67c,0xe9));var _0xcb67=function(_0x5edafc,_0x22002c){_0x5edafc=_0x5edafc-0x0;var _0x1fa600=_0xb67c[_0x5edafc];return _0x1fa600;};'use strict';var Sequelize=require(_0xcb67('0x0'));module[_0xcb67('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcb67('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcb67('0x3')]}};
\ No newline at end of file
+var _0x9640=['exports','STRING','sequelize'];(function(_0x258530,_0xbf9d9b){var _0x4dd0c8=function(_0x23d58c){while(--_0x23d58c){_0x258530['push'](_0x258530['shift']());}};_0x4dd0c8(++_0xbf9d9b);}(_0x9640,0x1a9));var _0x0964=function(_0x2c06e,_0x15e0ea){_0x2c06e=_0x2c06e-0x0;var _0x552e4b=_0x9640[_0x2c06e];return _0x552e4b;};'use strict';var Sequelize=require(_0x0964('0x0'));module[_0x0964('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0964('0x2')]}};
\ No newline at end of file
index bfadb9f..b94c30d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd76=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','filter','includeAll','include','findAll','params','keys','length','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','error','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x1911d3,_0x3e3cdc){var _0x3af258=function(_0x1be791){while(--_0x1be791){_0x1911d3['push'](_0x1911d3['shift']());}};_0x3af258(++_0x3e3cdc);}(_0xbd76,0x137));var _0x6bd7=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xbd76[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0x6bd7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bd7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bd7('0x2'));var moment=require(_0x6bd7('0x3'));var BPromise=require(_0x6bd7('0x4'));var Mustache=require(_0x6bd7('0x5'));var util=require(_0x6bd7('0x6'));var path=require(_0x6bd7('0x7'));var sox=require(_0x6bd7('0x8'));var csv=require(_0x6bd7('0x9'));var ejs=require(_0x6bd7('0xa'));var fs=require('fs');var fs_extra=require(_0x6bd7('0xb'));var _=require(_0x6bd7('0xc'));var squel=require(_0x6bd7('0xd'));var crypto=require(_0x6bd7('0xe'));var jsforce=require(_0x6bd7('0xf'));var deskjs=require(_0x6bd7('0x10'));var toCsv=require(_0x6bd7('0x9'));var querystring=require(_0x6bd7('0x11'));var Papa=require(_0x6bd7('0x12'));var Redis=require('ioredis');var authService=require(_0x6bd7('0x13'));var qs=require(_0x6bd7('0x14'));var as=require(_0x6bd7('0x15'));var hardwareService=require(_0x6bd7('0x16'));var logger=require(_0x6bd7('0x17'))('api');var utils=require(_0x6bd7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6bd7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x239eb4,_0x2b3d57){_0x2b3d57=_0x2b3d57||0xcc;return function(_0x395d0e){if(_0x395d0e){return _0x239eb4[_0x6bd7('0x1a')](_0x2b3d57);}return _0x239eb4[_0x6bd7('0x1b')](_0x2b3d57)[_0x6bd7('0x1c')]();};}function respondWithResult(_0xcd22ea,_0x32c88c){_0x32c88c=_0x32c88c||0xc8;return function(_0x248052){if(_0x248052){return _0xcd22ea[_0x6bd7('0x1b')](_0x32c88c)[_0x6bd7('0x1d')](_0x248052);}};}function respondWithFilteredResult(_0x380907,_0x411b35){return function(_0x3cedc4){if(_0x3cedc4){var _0x3649c3=typeof _0x411b35[_0x6bd7('0x1e')]===_0x6bd7('0x1f')&&typeof _0x411b35[_0x6bd7('0x20')]===_0x6bd7('0x1f');var _0x4428f4=_0x3cedc4[_0x6bd7('0x21')];var _0x39b837=_0x3649c3?0x0:_0x411b35[_0x6bd7('0x1e')];var _0x4f8f7f=_0x3649c3?_0x3cedc4[_0x6bd7('0x21')]:_0x411b35[_0x6bd7('0x1e')]+_0x411b35[_0x6bd7('0x20')];var _0x20b29a;if(_0x4f8f7f>=_0x4428f4){_0x4f8f7f=_0x4428f4;_0x20b29a=0xc8;}else{_0x20b29a=0xce;}_0x380907['status'](_0x20b29a);return _0x380907[_0x6bd7('0x22')](_0x6bd7('0x23'),_0x39b837+'-'+_0x4f8f7f+'/'+_0x4428f4)[_0x6bd7('0x1d')](_0x3cedc4);}return null;};}function patchUpdates(_0xe846e7){return function(_0x5c0dbf){try{jsonpatch[_0x6bd7('0x24')](_0x5c0dbf,_0xe846e7,!![]);}catch(_0x2b0b87){return BPromise[_0x6bd7('0x25')](_0x2b0b87);}return _0x5c0dbf[_0x6bd7('0x26')]();};}function saveUpdates(_0xf7fb8e,_0x114c05){return function(_0x4a0c83){if(_0x4a0c83){return _0x4a0c83[_0x6bd7('0x27')](_0xf7fb8e)[_0x6bd7('0x28')](function(_0x438635){return _0x438635;});}return null;};}function removeEntity(_0x434a8b,_0x9dc8b8){return function(_0x169bd2){if(_0x169bd2){return _0x169bd2[_0x6bd7('0x29')]()['then'](function(){var _0x105c43=_0x169bd2['get']({'plain':!![]});var _0x3de979='Pauses';return db[_0x6bd7('0x2a')][_0x6bd7('0x29')]({'where':{'type':_0x3de979,'resourceId':_0x105c43['id']}})[_0x6bd7('0x28')](function(){return _0x169bd2;});})['then'](function(){_0x434a8b[_0x6bd7('0x1b')](0xcc)[_0x6bd7('0x1c')]();});}};}function handleEntityNotFound(_0x5e92d6,_0x4690c4){return function(_0x27795f){if(!_0x27795f){_0x5e92d6[_0x6bd7('0x1a')](0x194);}return _0x27795f;};}function handleError(_0x50fe40,_0x14cbc8){_0x14cbc8=_0x14cbc8||0x1f4;return function(_0x7b6185){logger['error'](_0x7b6185[_0x6bd7('0x2b')]);if(_0x7b6185['name']){delete _0x7b6185[_0x6bd7('0x2c')];}_0x50fe40[_0x6bd7('0x1b')](_0x14cbc8)[_0x6bd7('0x2d')](_0x7b6185);};}exports['index']=function(_0x224ddf,_0x1bba0f){var _0x2e1c90={},_0x580a16={},_0x52dd3c={'count':0x0,'rows':[]};var _0x5a7f91=_[_0x6bd7('0x2e')](db[_0x6bd7('0x2f')][_0x6bd7('0x30')],function(_0x42f244){return{'name':_0x42f244[_0x6bd7('0x31')],'type':_0x42f244[_0x6bd7('0x32')][_0x6bd7('0x33')]};});_0x580a16[_0x6bd7('0x34')]=_[_0x6bd7('0x2e')](_0x5a7f91,'name');_0x580a16['query']=_['keys'](_0x224ddf[_0x6bd7('0x35')]);_0x580a16['filters']=_[_0x6bd7('0x36')](_0x580a16['model'],_0x580a16['query']);_0x2e1c90[_0x6bd7('0x37')]=_[_0x6bd7('0x36')](_0x580a16[_0x6bd7('0x34')],qs[_0x6bd7('0x38')](_0x224ddf[_0x6bd7('0x35')][_0x6bd7('0x38')]));_0x2e1c90['attributes']=_0x2e1c90['attributes']['length']?_0x2e1c90['attributes']:_0x580a16[_0x6bd7('0x34')];if(!_0x224ddf[_0x6bd7('0x35')]['hasOwnProperty'](_0x6bd7('0x39'))){_0x2e1c90[_0x6bd7('0x20')]=qs['limit'](_0x224ddf[_0x6bd7('0x35')][_0x6bd7('0x20')]);_0x2e1c90['offset']=qs['offset'](_0x224ddf[_0x6bd7('0x35')][_0x6bd7('0x1e')]);}_0x2e1c90[_0x6bd7('0x3a')]=qs['sort'](_0x224ddf[_0x6bd7('0x35')][_0x6bd7('0x3b')]);_0x2e1c90[_0x6bd7('0x3c')]=qs[_0x6bd7('0x3d')](_[_0x6bd7('0x3e')](_0x224ddf[_0x6bd7('0x35')],_0x580a16[_0x6bd7('0x3d')]),_0x5a7f91);if(_0x224ddf[_0x6bd7('0x35')]['filter']){_0x2e1c90[_0x6bd7('0x3c')]=_[_0x6bd7('0x3f')](_0x2e1c90[_0x6bd7('0x3c')],{'$or':_['map'](_0x5a7f91,function(_0xf97373){if(_0xf97373[_0x6bd7('0x32')]!=='VIRTUAL'){var _0x1df754={};_0x1df754[_0xf97373[_0x6bd7('0x2c')]]={'$like':'%'+_0x224ddf[_0x6bd7('0x35')][_0x6bd7('0x40')]+'%'};return _0x1df754;}})});}_0x2e1c90=_[_0x6bd7('0x3f')]({},_0x2e1c90,_0x224ddf['options']);var _0x35b9c3={'where':_0x2e1c90[_0x6bd7('0x3c')]};return db['Pause'][_0x6bd7('0x21')](_0x35b9c3)['then'](function(_0x539981){_0x52dd3c[_0x6bd7('0x21')]=_0x539981;if(_0x224ddf['query'][_0x6bd7('0x41')]){_0x2e1c90[_0x6bd7('0x42')]=[{'all':!![]}];}return db[_0x6bd7('0x2f')][_0x6bd7('0x43')](_0x2e1c90);})[_0x6bd7('0x28')](function(_0x367fc4){_0x52dd3c['rows']=_0x367fc4;return _0x52dd3c;})[_0x6bd7('0x28')](respondWithFilteredResult(_0x1bba0f,_0x2e1c90))['catch'](handleError(_0x1bba0f,null));};exports['show']=function(_0x29ccba,_0x26217d){var _0x3fa9ac={'raw':!![],'where':{'id':_0x29ccba[_0x6bd7('0x44')]['id']}},_0x45f57a={};_0x45f57a[_0x6bd7('0x34')]=_[_0x6bd7('0x45')](db[_0x6bd7('0x2f')]['rawAttributes']);_0x45f57a[_0x6bd7('0x35')]=_[_0x6bd7('0x45')](_0x29ccba[_0x6bd7('0x35')]);_0x45f57a['filters']=_[_0x6bd7('0x36')](_0x45f57a[_0x6bd7('0x34')],_0x45f57a['query']);_0x3fa9ac['attributes']=_[_0x6bd7('0x36')](_0x45f57a['model'],qs[_0x6bd7('0x38')](_0x29ccba[_0x6bd7('0x35')]['fields']));_0x3fa9ac['attributes']=_0x3fa9ac[_0x6bd7('0x37')][_0x6bd7('0x46')]?_0x3fa9ac[_0x6bd7('0x37')]:_0x45f57a[_0x6bd7('0x34')];if(_0x29ccba[_0x6bd7('0x35')]['includeAll']){_0x3fa9ac[_0x6bd7('0x42')]=[{'all':!![]}];}_0x3fa9ac=_[_0x6bd7('0x3f')]({},_0x3fa9ac,_0x29ccba[_0x6bd7('0x47')]);return db['Pause'][_0x6bd7('0x48')](_0x3fa9ac)[_0x6bd7('0x28')](handleEntityNotFound(_0x26217d,null))[_0x6bd7('0x28')](respondWithResult(_0x26217d,null))[_0x6bd7('0x49')](handleError(_0x26217d,null));};exports[_0x6bd7('0x4a')]=function(_0x1dcad7,_0x162276){return db['Pause']['create'](_0x1dcad7[_0x6bd7('0x4b')],{})[_0x6bd7('0x28')](function(_0x5298f6){var _0x1c1bcd=_0x1dcad7[_0x6bd7('0x4c')][_0x6bd7('0x4d')]({'plain':!![]});if(!_0x1c1bcd)throw new Error(_0x6bd7('0x4e'));if(_0x1c1bcd[_0x6bd7('0x4f')]===_0x6bd7('0x4c')){var _0xd7aa77=_0x5298f6[_0x6bd7('0x4d')]({'plain':!![]});var _0xd8c439=_0x6bd7('0x50');return db[_0x6bd7('0x51')][_0x6bd7('0x48')]({'where':{'name':_0xd8c439,'userProfileId':_0x1c1bcd[_0x6bd7('0x52')]},'raw':!![]})[_0x6bd7('0x28')](function(_0x3dd422){if(_0x3dd422&&_0x3dd422['autoAssociation']===0x0){return db[_0x6bd7('0x2a')][_0x6bd7('0x4a')]({'name':_0xd7aa77['name'],'resourceId':_0xd7aa77['id'],'type':_0x3dd422[_0x6bd7('0x2c')],'sectionId':_0x3dd422['id']},{})['then'](function(){return _0x5298f6;});}else{return _0x5298f6;}})[_0x6bd7('0x49')](function(_0x32a9c8){logger[_0x6bd7('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a9c8);throw _0x32a9c8;});}return _0x5298f6;})[_0x6bd7('0x28')](respondWithResult(_0x162276,0xc9))[_0x6bd7('0x49')](handleError(_0x162276,null));};exports[_0x6bd7('0x27')]=function(_0x53579a,_0x59d406){if(_0x53579a[_0x6bd7('0x4b')]['id']){delete _0x53579a[_0x6bd7('0x4b')]['id'];}return db['Pause']['find']({'where':{'id':_0x53579a[_0x6bd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x59d406,null))[_0x6bd7('0x28')](saveUpdates(_0x53579a[_0x6bd7('0x4b')],null))[_0x6bd7('0x28')](respondWithResult(_0x59d406,null))[_0x6bd7('0x49')](handleError(_0x59d406,null));};exports[_0x6bd7('0x29')]=function(_0x3afcde,_0x2d5979){return db[_0x6bd7('0x2f')][_0x6bd7('0x48')]({'where':{'id':_0x3afcde[_0x6bd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d5979,null))[_0x6bd7('0x28')](removeEntity(_0x2d5979,null))['catch'](handleError(_0x2d5979,null));};
\ No newline at end of file
+var _0x72fc=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','Pauses','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0xce06d0,_0xe944b9){var _0x360347=function(_0x565311){while(--_0x565311){_0xce06d0['push'](_0xce06d0['shift']());}};_0x360347(++_0xe944b9);}(_0x72fc,0x128));var _0xc72f=function(_0x2d1ae9,_0x7627e){_0x2d1ae9=_0x2d1ae9-0x0;var _0x3a7ba6=_0x72fc[_0x2d1ae9];return _0x3a7ba6;};'use strict';var emlformat=require(_0xc72f('0x0'));var rimraf=require(_0xc72f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc72f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc72f('0x3'));var Mustache=require(_0xc72f('0x4'));var util=require(_0xc72f('0x5'));var path=require('path');var sox=require(_0xc72f('0x6'));var csv=require(_0xc72f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc72f('0x8'));var _=require('lodash');var squel=require(_0xc72f('0x9'));var crypto=require(_0xc72f('0xa'));var jsforce=require(_0xc72f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc72f('0x7'));var querystring=require(_0xc72f('0xc'));var Papa=require(_0xc72f('0xd'));var Redis=require(_0xc72f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc72f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc72f('0x10'));var utils=require(_0xc72f('0x11'));var config=require(_0xc72f('0x12'));var licenseUtil=require(_0xc72f('0x13'));var db=require(_0xc72f('0x14'))['db'];function respondWithStatusCode(_0x1e98c0,_0x5d6f1a){_0x5d6f1a=_0x5d6f1a||0xcc;return function(_0x3795fc){if(_0x3795fc){return _0x1e98c0[_0xc72f('0x15')](_0x5d6f1a);}return _0x1e98c0[_0xc72f('0x16')](_0x5d6f1a)['end']();};}function respondWithResult(_0x3c1f62,_0xc91835){_0xc91835=_0xc91835||0xc8;return function(_0x50cd12){if(_0x50cd12){return _0x3c1f62[_0xc72f('0x16')](_0xc91835)[_0xc72f('0x17')](_0x50cd12);}};}function respondWithFilteredResult(_0x39d667,_0x4a0242){return function(_0x2e7e3d){if(_0x2e7e3d){var _0x3d2587=typeof _0x4a0242['offset']===_0xc72f('0x18')&&typeof _0x4a0242[_0xc72f('0x19')]===_0xc72f('0x18');var _0x5a40f7=_0x2e7e3d[_0xc72f('0x1a')];var _0x580f31=_0x3d2587?0x0:_0x4a0242[_0xc72f('0x1b')];var _0x6e9cda=_0x3d2587?_0x2e7e3d[_0xc72f('0x1a')]:_0x4a0242[_0xc72f('0x1b')]+_0x4a0242['limit'];var _0x5f46d1;if(_0x6e9cda>=_0x5a40f7){_0x6e9cda=_0x5a40f7;_0x5f46d1=0xc8;}else{_0x5f46d1=0xce;}_0x39d667[_0xc72f('0x16')](_0x5f46d1);return _0x39d667[_0xc72f('0x1c')](_0xc72f('0x1d'),_0x580f31+'-'+_0x6e9cda+'/'+_0x5a40f7)[_0xc72f('0x17')](_0x2e7e3d);}return null;};}function patchUpdates(_0x122b2d){return function(_0x58e1e0){try{jsonpatch[_0xc72f('0x1e')](_0x58e1e0,_0x122b2d,!![]);}catch(_0xd34601){return BPromise[_0xc72f('0x1f')](_0xd34601);}return _0x58e1e0[_0xc72f('0x20')]();};}function saveUpdates(_0xd5ab0b,_0x5ec0f7){return function(_0xb5e1ed){if(_0xb5e1ed){return _0xb5e1ed[_0xc72f('0x21')](_0xd5ab0b)['then'](function(_0x1e3542){return _0x1e3542;});}return null;};}function removeEntity(_0x5bb681,_0x318308){return function(_0x39a0ec){if(_0x39a0ec){return _0x39a0ec[_0xc72f('0x22')]()[_0xc72f('0x23')](function(){var _0x3d8e40=_0x39a0ec[_0xc72f('0x24')]({'plain':!![]});var _0x3f81bb='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x3f81bb,'resourceId':_0x3d8e40['id']}})['then'](function(){return _0x39a0ec;});})[_0xc72f('0x23')](function(){_0x5bb681[_0xc72f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49d860,_0x1ce937){return function(_0x1db957){if(!_0x1db957){_0x49d860['sendStatus'](0x194);}return _0x1db957;};}function handleError(_0x5e3a16,_0x530dbd){_0x530dbd=_0x530dbd||0x1f4;return function(_0x796562){logger[_0xc72f('0x25')](_0x796562[_0xc72f('0x26')]);if(_0x796562[_0xc72f('0x27')]){delete _0x796562['name'];}_0x5e3a16[_0xc72f('0x16')](_0x530dbd)[_0xc72f('0x28')](_0x796562);};}exports[_0xc72f('0x29')]=function(_0x2b12ce,_0x4964e3){var _0x119c81={},_0x334186={},_0x38cb4b={'count':0x0,'rows':[]};var _0x471d59=_[_0xc72f('0x2a')](db[_0xc72f('0x2b')][_0xc72f('0x2c')],function(_0x52d163){return{'name':_0x52d163[_0xc72f('0x2d')],'type':_0x52d163[_0xc72f('0x2e')][_0xc72f('0x2f')]};});_0x334186[_0xc72f('0x30')]=_[_0xc72f('0x2a')](_0x471d59,_0xc72f('0x27'));_0x334186[_0xc72f('0x31')]=_[_0xc72f('0x32')](_0x2b12ce[_0xc72f('0x31')]);_0x334186[_0xc72f('0x33')]=_[_0xc72f('0x34')](_0x334186['model'],_0x334186[_0xc72f('0x31')]);_0x119c81[_0xc72f('0x35')]=_[_0xc72f('0x34')](_0x334186[_0xc72f('0x30')],qs[_0xc72f('0x36')](_0x2b12ce[_0xc72f('0x31')][_0xc72f('0x36')]));_0x119c81[_0xc72f('0x35')]=_0x119c81['attributes'][_0xc72f('0x37')]?_0x119c81[_0xc72f('0x35')]:_0x334186[_0xc72f('0x30')];if(!_0x2b12ce[_0xc72f('0x31')][_0xc72f('0x38')]('nolimit')){_0x119c81['limit']=qs['limit'](_0x2b12ce['query'][_0xc72f('0x19')]);_0x119c81['offset']=qs[_0xc72f('0x1b')](_0x2b12ce[_0xc72f('0x31')][_0xc72f('0x1b')]);}_0x119c81[_0xc72f('0x39')]=qs[_0xc72f('0x3a')](_0x2b12ce[_0xc72f('0x31')][_0xc72f('0x3a')]);_0x119c81[_0xc72f('0x3b')]=qs[_0xc72f('0x33')](_['pick'](_0x2b12ce[_0xc72f('0x31')],_0x334186[_0xc72f('0x33')]),_0x471d59);if(_0x2b12ce['query'][_0xc72f('0x3c')]){_0x119c81['where']=_[_0xc72f('0x3d')](_0x119c81['where'],{'$or':_[_0xc72f('0x2a')](_0x471d59,function(_0x519231){if(_0x519231[_0xc72f('0x2e')]!==_0xc72f('0x3e')){var _0x57b609={};_0x57b609[_0x519231[_0xc72f('0x27')]]={'$like':'%'+_0x2b12ce[_0xc72f('0x31')][_0xc72f('0x3c')]+'%'};return _0x57b609;}})});}_0x119c81=_[_0xc72f('0x3d')]({},_0x119c81,_0x2b12ce[_0xc72f('0x3f')]);var _0x201b8d={'where':_0x119c81[_0xc72f('0x3b')]};return db[_0xc72f('0x2b')]['count'](_0x201b8d)[_0xc72f('0x23')](function(_0x5f0f06){_0x38cb4b['count']=_0x5f0f06;if(_0x2b12ce[_0xc72f('0x31')][_0xc72f('0x40')]){_0x119c81['include']=[{'all':!![]}];}return db[_0xc72f('0x2b')][_0xc72f('0x41')](_0x119c81);})['then'](function(_0x8e465c){_0x38cb4b[_0xc72f('0x42')]=_0x8e465c;return _0x38cb4b;})[_0xc72f('0x23')](respondWithFilteredResult(_0x4964e3,_0x119c81))[_0xc72f('0x43')](handleError(_0x4964e3,null));};exports['show']=function(_0x2393b9,_0x134167){var _0x2c18cc={'raw':!![],'where':{'id':_0x2393b9[_0xc72f('0x44')]['id']}},_0x558830={};_0x558830[_0xc72f('0x30')]=_[_0xc72f('0x32')](db[_0xc72f('0x2b')]['rawAttributes']);_0x558830['query']=_[_0xc72f('0x32')](_0x2393b9['query']);_0x558830[_0xc72f('0x33')]=_[_0xc72f('0x34')](_0x558830[_0xc72f('0x30')],_0x558830[_0xc72f('0x31')]);_0x2c18cc[_0xc72f('0x35')]=_[_0xc72f('0x34')](_0x558830[_0xc72f('0x30')],qs[_0xc72f('0x36')](_0x2393b9['query'][_0xc72f('0x36')]));_0x2c18cc['attributes']=_0x2c18cc['attributes'][_0xc72f('0x37')]?_0x2c18cc[_0xc72f('0x35')]:_0x558830[_0xc72f('0x30')];if(_0x2393b9[_0xc72f('0x31')]['includeAll']){_0x2c18cc[_0xc72f('0x45')]=[{'all':!![]}];}_0x2c18cc=_['merge']({},_0x2c18cc,_0x2393b9[_0xc72f('0x3f')]);return db[_0xc72f('0x2b')][_0xc72f('0x46')](_0x2c18cc)[_0xc72f('0x23')](handleEntityNotFound(_0x134167,null))['then'](respondWithResult(_0x134167,null))[_0xc72f('0x43')](handleError(_0x134167,null));};exports[_0xc72f('0x47')]=function(_0x17f401,_0x200578){return db[_0xc72f('0x2b')]['create'](_0x17f401[_0xc72f('0x48')],{})[_0xc72f('0x23')](function(_0x3cf77a){var _0x556f8e=_0x17f401[_0xc72f('0x49')][_0xc72f('0x24')]({'plain':!![]});if(!_0x556f8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x556f8e['role']===_0xc72f('0x49')){var _0x4d08ba=_0x3cf77a[_0xc72f('0x24')]({'plain':!![]});var _0x5b2f27=_0xc72f('0x4a');return db['UserProfileSection'][_0xc72f('0x46')]({'where':{'name':_0x5b2f27,'userProfileId':_0x556f8e[_0xc72f('0x4b')]},'raw':!![]})[_0xc72f('0x23')](function(_0x5da5c9){if(_0x5da5c9&&_0x5da5c9[_0xc72f('0x4c')]===0x0){return db[_0xc72f('0x4d')]['create']({'name':_0x4d08ba[_0xc72f('0x27')],'resourceId':_0x4d08ba['id'],'type':_0x5da5c9['name'],'sectionId':_0x5da5c9['id']},{})[_0xc72f('0x23')](function(){return _0x3cf77a;});}else{return _0x3cf77a;}})[_0xc72f('0x43')](function(_0x236d67){logger[_0xc72f('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x236d67);throw _0x236d67;});}return _0x3cf77a;})['then'](respondWithResult(_0x200578,0xc9))[_0xc72f('0x43')](handleError(_0x200578,null));};exports[_0xc72f('0x21')]=function(_0x1999b9,_0x55adc8){if(_0x1999b9['body']['id']){delete _0x1999b9[_0xc72f('0x48')]['id'];}return db[_0xc72f('0x2b')][_0xc72f('0x46')]({'where':{'id':_0x1999b9[_0xc72f('0x44')]['id']}})[_0xc72f('0x23')](handleEntityNotFound(_0x55adc8,null))['then'](saveUpdates(_0x1999b9[_0xc72f('0x48')],null))['then'](respondWithResult(_0x55adc8,null))[_0xc72f('0x43')](handleError(_0x55adc8,null));};exports[_0xc72f('0x22')]=function(_0x2af02d,_0x3d4c1e){return db[_0xc72f('0x2b')][_0xc72f('0x46')]({'where':{'id':_0x2af02d[_0xc72f('0x44')]['id']}})[_0xc72f('0x23')](handleEntityNotFound(_0x3d4c1e,null))[_0xc72f('0x23')](removeEntity(_0x3d4c1e,null))[_0xc72f('0x43')](handleError(_0x3d4c1e,null));};
\ No newline at end of file
index 32fe083..992232a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x10dd5c,_0x24ae9b){var _0x4a9c29=function(_0x407b37){while(--_0x407b37){_0x10dd5c['push'](_0x10dd5c['shift']());}};_0x4a9c29(++_0x24ae9b);}(_0x53ec,0x192));var _0xc53e=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0x53ec[_0x3f1861];return _0x7ca70a;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x1ee0e3,_0x5c9162){var _0x2b0e0b=function(_0x19d579){while(--_0x19d579){_0x1ee0e3['push'](_0x1ee0e3['shift']());}};_0x2b0e0b(++_0x5c9162);}(_0xf494,0x1c6));var _0x4f49=function(_0x25bcf8,_0x523bfe){_0x25bcf8=_0x25bcf8-0x0;var _0x3e59d5=_0xf494[_0x25bcf8];return _0x3e59d5;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d766426..ff923e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x5ae8bf,_0x25d7cd){var _0x16eeeb=function(_0x174493){while(--_0x174493){_0x5ae8bf['push'](_0x5ae8bf['shift']());}};_0x16eeeb(++_0x25d7cd);}(_0x7a54,0x106));var _0x47a5=function(_0x94240e,_0x5b5ed9){_0x94240e=_0x94240e-0x0;var _0x5a14aa=_0x7a54[_0x94240e];return _0x5a14aa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4bfd36,_0x614e02){var _0x75c9f7=function(_0x4bbae9){while(--_0x4bbae9){_0x4bfd36['push'](_0x4bfd36['shift']());}};_0x75c9f7(++_0x614e02);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ae89c,_0x4bc1d3){_0x3ae89c=_0x3ae89c-0x0;var _0x54df34=_0xb10b[_0x3ae89c];return _0x54df34;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
index e4a238a..4d602bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','root','server/files/plugins','originalname','replace','format'];(function(_0x5dcd32,_0x3ee744){var _0x71f839=function(_0x4c2c83){while(--_0x4c2c83){_0x5dcd32['push'](_0x5dcd32['shift']());}};_0x71f839(++_0x3ee744);}(_0x4ea3,0x70));var _0x34ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4ea3[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),controller[_0x34ea('0xb')]);router['get'](_0x34ea('0xc'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);router['get'](_0x34ea('0xe'),auth[_0x34ea('0x8')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bd8b6,_0x346287,_0x167667){_0x167667(null,path['join'](config[_0x34ea('0xf')],_0x34ea('0x10')));},'filename':function(_0x10135f,_0x233b11,_0x60725f){_0x233b11[_0x34ea('0x11')]=_0x233b11[_0x34ea('0x11')][_0x34ea('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x60725f(null,util[_0x34ea('0x13')](_0x34ea('0x14'),path[_0x34ea('0x15')](_0x233b11['originalname'],path[_0x34ea('0x16')](_0x233b11[_0x34ea('0x11')])),Date[_0x34ea('0x17')](),path[_0x34ea('0x16')](_0x233b11[_0x34ea('0x11')])));}})});router['post']('/',upload[_0x34ea('0x18')](_0x34ea('0x19')),controller[_0x34ea('0x1a')]);router[_0x34ea('0x1b')]('/webhook',controller[_0x34ea('0x1c')]);router[_0x34ea('0x1d')](_0x34ea('0xc'),auth['isAuthenticated'](),controller[_0x34ea('0x1e')]);router[_0x34ea('0x1f')](_0x34ea('0xc'),auth[_0x34ea('0x8')](),controller['delete']);module[_0x34ea('0x20')]=router;
\ No newline at end of file
+var _0xc6d8=['format','%s-%s%s','basename','extname','now','single','file','post','put','update','delete','exports','multer','path','express','fs-extra','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','/:id/download','download','diskStorage','root','originalname','replace'];(function(_0x2a8026,_0x40a2bf){var _0xe641eb=function(_0x394c31){while(--_0x394c31){_0x2a8026['push'](_0x2a8026['shift']());}};_0xe641eb(++_0x40a2bf);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4218d0,_0x18aa4c){_0x4218d0=_0x4218d0-0x0;var _0x2c142c=_0xc6d8[_0x4218d0];return _0x2c142c;};'use strict';var multer=require(_0x8c6d('0x0'));var util=require('util');var path=require(_0x8c6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c6d('0x2'));var router=express['Router']();var fs_extra=require(_0x8c6d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c6d('0x4'));var controller=require(_0x8c6d('0x5'));router[_0x8c6d('0x6')]('/',auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x8')]);router[_0x8c6d('0x6')](_0x8c6d('0x9'),controller['webhookGet']);router[_0x8c6d('0x6')](_0x8c6d('0xa'),auth[_0x8c6d('0x7')](),controller['show']);router[_0x8c6d('0x6')](_0x8c6d('0xb'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0xc')]);var upload=multer({'storage':multer[_0x8c6d('0xd')]({'destination':function(_0x43a7ab,_0x60cd5c,_0x392a6b){_0x392a6b(null,path['join'](config[_0x8c6d('0xe')],'server/files/plugins'));},'filename':function(_0x4c0878,_0x22d0fb,_0x890e85){_0x22d0fb[_0x8c6d('0xf')]=_0x22d0fb[_0x8c6d('0xf')][_0x8c6d('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x890e85(null,util[_0x8c6d('0x11')](_0x8c6d('0x12'),path[_0x8c6d('0x13')](_0x22d0fb[_0x8c6d('0xf')],path[_0x8c6d('0x14')](_0x22d0fb['originalname'])),Date[_0x8c6d('0x15')](),path['extname'](_0x22d0fb[_0x8c6d('0xf')])));}})});router['post']('/',upload[_0x8c6d('0x16')](_0x8c6d('0x17')),controller['upload']);router[_0x8c6d('0x18')](_0x8c6d('0x9'),controller['webhookPost']);router[_0x8c6d('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x8c6d('0x1a')]);router['delete'](_0x8c6d('0xa'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x1b')]);module[_0x8c6d('0x1c')]=router;
\ No newline at end of file
index 4e42993..6b30d1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23e7=['ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x23e7,0x1c6));var _0x723e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x23e7[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x723e('0x0'));module[_0x723e('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x723e('0x2')](_0x723e('0x3'),_0x723e('0x4'))},'description':{'type':Sequelize[_0x723e('0x5')]},'version':{'type':Sequelize[_0x723e('0x5')]},'path':{'type':Sequelize[_0x723e('0x6')],'comment':_0x723e('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x723e('0x2')](_0x723e('0x8'),_0x723e('0x9'),'always','never'),'defaultValue':_0x723e('0xa'),'comment':_0x723e('0xb')},'icon':{'type':Sequelize[_0x723e('0x6')]},'adminUrl':{'type':Sequelize[_0x723e('0x6')]},'agentUrl':{'type':Sequelize[_0x723e('0x6')]},'scriptName':{'type':Sequelize[_0x723e('0x6')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc13d=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','never','always','sequelize','exports','STRING','ENUM','html','script','TEXT'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc13d,0x1a6));var _0xdc13=function(_0x52a073,_0x225c33){_0x52a073=_0x52a073-0x0;var _0x14c817=_0xc13d[_0x52a073];return _0x14c817;};'use strict';var Sequelize=require(_0xdc13('0x0'));module[_0xdc13('0x1')]={'name':{'type':Sequelize[_0xdc13('0x2')]},'type':{'type':Sequelize[_0xdc13('0x3')](_0xdc13('0x4'),_0xdc13('0x5'))},'description':{'type':Sequelize[_0xdc13('0x6')]},'version':{'type':Sequelize[_0xdc13('0x6')]},'path':{'type':Sequelize[_0xdc13('0x2')],'comment':_0xdc13('0x7')},'active':{'type':Sequelize[_0xdc13('0x8')],'defaultValue':0x0,'comment':_0xdc13('0x9')},'sidebar':{'type':Sequelize[_0xdc13('0x3')](_0xdc13('0xa'),'agentOnly','always',_0xdc13('0xb')),'defaultValue':_0xdc13('0xc'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xdc13('0x2')]},'adminUrl':{'type':Sequelize[_0xdc13('0x2')]},'agentUrl':{'type':Sequelize[_0xdc13('0x2')]},'scriptName':{'type':Sequelize[_0xdc13('0x2')]},'scriptPath':{'type':Sequelize[_0xdc13('0x2')]}};
\ No newline at end of file
index cae4d57..10d5528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe32=['Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','views','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','body','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','method','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','stack','index','map','Plugin','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','find','catch','download','path','root','server/files/plugins','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','pipe','glob','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','finalize','existsSync'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbe32,0xfc));var _0x2be3=function(_0x84b41f,_0x535f2a){_0x84b41f=_0x84b41f-0x0;var _0x14a9af=_0xbe32[_0x84b41f];return _0x14a9af;};'use strict';var emlformat=require(_0x2be3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2be3('0x1'));var rp=require(_0x2be3('0x2'));var moment=require('moment');var BPromise=require(_0x2be3('0x3'));var Mustache=require('mustache');var util=require(_0x2be3('0x4'));var path=require('path');var sox=require(_0x2be3('0x5'));var csv=require(_0x2be3('0x6'));var ejs=require(_0x2be3('0x7'));var fs=require('fs');var fs_extra=require(_0x2be3('0x8'));var _=require(_0x2be3('0x9'));var squel=require('squel');var crypto=require(_0x2be3('0xa'));var jsforce=require(_0x2be3('0xb'));var deskjs=require(_0x2be3('0xc'));var toCsv=require(_0x2be3('0x6'));var querystring=require(_0x2be3('0xd'));var Papa=require('papaparse');var extract=require(_0x2be3('0xe'));var rimraf=require(_0x2be3('0xf'));var archiver=require(_0x2be3('0x10'));var Redis=require(_0x2be3('0x11'));var authService=require(_0x2be3('0x12'));var qs=require(_0x2be3('0x13'));var as=require(_0x2be3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2be3('0x15'))('api');var utils=require(_0x2be3('0x16'));var config=require(_0x2be3('0x17'));var licenseUtil=require(_0x2be3('0x18'));var db=require(_0x2be3('0x19'))['db'];config[_0x2be3('0x1a')]=_[_0x2be3('0x1b')](config[_0x2be3('0x1a')],{'host':_0x2be3('0x1c'),'port':0x18eb});var socket=require(_0x2be3('0x1d'))(new Redis(config[_0x2be3('0x1a')]));require('./plugin.socket')[_0x2be3('0x1e')](socket);function respondWithStatusCode(_0x1b0a02,_0x24dd49){_0x24dd49=_0x24dd49||0xcc;return function(_0x3078eb){if(_0x3078eb){return _0x1b0a02[_0x2be3('0x1f')](_0x24dd49);}return _0x1b0a02[_0x2be3('0x20')](_0x24dd49)[_0x2be3('0x21')]();};}function respondWithResult(_0x270199,_0x41f08c){_0x41f08c=_0x41f08c||0xc8;return function(_0x1ffa68){if(_0x1ffa68){return _0x270199[_0x2be3('0x20')](_0x41f08c)[_0x2be3('0x22')](_0x1ffa68);}};}function respondWithFilteredResult(_0x2242b4,_0xae6ee3){return function(_0x17a293){if(_0x17a293){var _0x52c3bc=typeof _0xae6ee3[_0x2be3('0x23')]===_0x2be3('0x24')&&typeof _0xae6ee3[_0x2be3('0x25')]===_0x2be3('0x24');var _0x310358=_0x17a293[_0x2be3('0x26')];var _0x3811eb=_0x52c3bc?0x0:_0xae6ee3[_0x2be3('0x23')];var _0x3de280=_0x52c3bc?_0x17a293[_0x2be3('0x26')]:_0xae6ee3[_0x2be3('0x23')]+_0xae6ee3[_0x2be3('0x25')];var _0x5c1e4e;if(_0x3de280>=_0x310358){_0x3de280=_0x310358;_0x5c1e4e=0xc8;}else{_0x5c1e4e=0xce;}_0x2242b4[_0x2be3('0x20')](_0x5c1e4e);return _0x2242b4[_0x2be3('0x27')](_0x2be3('0x28'),_0x3811eb+'-'+_0x3de280+'/'+_0x310358)[_0x2be3('0x22')](_0x17a293);}return null;};}function patchUpdates(_0x43f261){return function(_0x39841e){try{jsonpatch[_0x2be3('0x29')](_0x39841e,_0x43f261,!![]);}catch(_0x2c9acc){return BPromise[_0x2be3('0x2a')](_0x2c9acc);}return _0x39841e['save']();};}function saveUpdates(_0xcc20fa,_0xf406f2){return function(_0x43103d){if(_0x43103d){return _0x43103d[_0x2be3('0x2b')](_0xcc20fa)[_0x2be3('0x2c')](function(_0x5b43ba){return _0x5b43ba;});}return null;};}function removeEntity(_0x10923e,_0x2369ac){return function(_0x2f58c0){if(_0x2f58c0){return _0x2f58c0[_0x2be3('0x2d')]()[_0x2be3('0x2c')](function(){var _0x329c9e=_0x2f58c0['get']({'plain':!![]});var _0x196453='Plugins';return db[_0x2be3('0x2e')]['destroy']({'where':{'type':_0x196453,'resourceId':_0x329c9e['id']}})[_0x2be3('0x2c')](function(){return _0x2f58c0;});})['then'](function(){_0x10923e[_0x2be3('0x20')](0xcc)[_0x2be3('0x21')]();});}};}function handleEntityNotFound(_0x4f6b9d,_0x10ba26){return function(_0xbf6e0b){if(!_0xbf6e0b){_0x4f6b9d[_0x2be3('0x1f')](0x194);}return _0xbf6e0b;};}function handleError(_0x12f61f,_0x4dca4a){_0x4dca4a=_0x4dca4a||0x1f4;return function(_0x3ecc79){logger[_0x2be3('0x2f')](_0x3ecc79[_0x2be3('0x30')]);if(_0x3ecc79['name']){delete _0x3ecc79['name'];}_0x12f61f['status'](_0x4dca4a)['send'](_0x3ecc79);};}exports[_0x2be3('0x31')]=function(_0x1bfafb,_0xa22907){var _0x34e84b={},_0x5c6772={},_0x39db36={'count':0x0,'rows':[]};var _0x3ec819=_[_0x2be3('0x32')](db[_0x2be3('0x33')][_0x2be3('0x34')],function(_0xe9a3fb){return{'name':_0xe9a3fb[_0x2be3('0x35')],'type':_0xe9a3fb[_0x2be3('0x36')][_0x2be3('0x37')]};});_0x5c6772[_0x2be3('0x38')]=_['map'](_0x3ec819,_0x2be3('0x39'));_0x5c6772[_0x2be3('0x3a')]=_[_0x2be3('0x3b')](_0x1bfafb[_0x2be3('0x3a')]);_0x5c6772[_0x2be3('0x3c')]=_[_0x2be3('0x3d')](_0x5c6772[_0x2be3('0x38')],_0x5c6772[_0x2be3('0x3a')]);_0x34e84b[_0x2be3('0x3e')]=_[_0x2be3('0x3d')](_0x5c6772[_0x2be3('0x38')],qs[_0x2be3('0x3f')](_0x1bfafb['query'][_0x2be3('0x3f')]));_0x34e84b['attributes']=_0x34e84b[_0x2be3('0x3e')][_0x2be3('0x40')]?_0x34e84b[_0x2be3('0x3e')]:_0x5c6772[_0x2be3('0x38')];if(!_0x1bfafb[_0x2be3('0x3a')]['hasOwnProperty'](_0x2be3('0x41'))){_0x34e84b[_0x2be3('0x25')]=qs[_0x2be3('0x25')](_0x1bfafb['query'][_0x2be3('0x25')]);_0x34e84b[_0x2be3('0x23')]=qs[_0x2be3('0x23')](_0x1bfafb[_0x2be3('0x3a')][_0x2be3('0x23')]);}_0x34e84b['order']=qs[_0x2be3('0x42')](_0x1bfafb['query'][_0x2be3('0x42')]);_0x34e84b['where']=qs[_0x2be3('0x3c')](_[_0x2be3('0x43')](_0x1bfafb[_0x2be3('0x3a')],_0x5c6772[_0x2be3('0x3c')]),_0x3ec819);if(_0x1bfafb[_0x2be3('0x3a')]['filter']){_0x34e84b[_0x2be3('0x44')]=_[_0x2be3('0x45')](_0x34e84b[_0x2be3('0x44')],{'$or':_[_0x2be3('0x32')](_0x3ec819,function(_0x43e588){if(_0x43e588[_0x2be3('0x36')]!==_0x2be3('0x46')){var _0x21b358={};_0x21b358[_0x43e588[_0x2be3('0x39')]]={'$like':'%'+_0x1bfafb[_0x2be3('0x3a')][_0x2be3('0x47')]+'%'};return _0x21b358;}})});}_0x34e84b=_[_0x2be3('0x45')]({},_0x34e84b,_0x1bfafb['options']);var _0x2ab246={'where':_0x34e84b[_0x2be3('0x44')]};return db[_0x2be3('0x33')][_0x2be3('0x26')](_0x2ab246)['then'](function(_0x8d4541){_0x39db36['count']=_0x8d4541;if(_0x1bfafb['query'][_0x2be3('0x48')]){_0x34e84b[_0x2be3('0x49')]=[{'all':!![]}];}return db['Plugin'][_0x2be3('0x4a')](_0x34e84b);})[_0x2be3('0x2c')](function(_0x20988e){_0x39db36[_0x2be3('0x4b')]=_0x20988e;return _0x39db36;})[_0x2be3('0x2c')](respondWithFilteredResult(_0xa22907,_0x34e84b))['catch'](handleError(_0xa22907,null));};exports[_0x2be3('0x4c')]=function(_0x3161f3,_0x3a2150){var _0x5acaf0={'raw':!![],'where':{'id':_0x3161f3[_0x2be3('0x4d')]['id']}},_0x1c1452={};_0x1c1452[_0x2be3('0x38')]=_[_0x2be3('0x3b')](db[_0x2be3('0x33')][_0x2be3('0x34')]);_0x1c1452[_0x2be3('0x3a')]=_[_0x2be3('0x3b')](_0x3161f3[_0x2be3('0x3a')]);_0x1c1452[_0x2be3('0x3c')]=_[_0x2be3('0x3d')](_0x1c1452[_0x2be3('0x38')],_0x1c1452[_0x2be3('0x3a')]);_0x5acaf0[_0x2be3('0x3e')]=_[_0x2be3('0x3d')](_0x1c1452['model'],qs[_0x2be3('0x3f')](_0x3161f3[_0x2be3('0x3a')][_0x2be3('0x3f')]));_0x5acaf0[_0x2be3('0x3e')]=_0x5acaf0[_0x2be3('0x3e')][_0x2be3('0x40')]?_0x5acaf0[_0x2be3('0x3e')]:_0x1c1452[_0x2be3('0x38')];if(_0x3161f3[_0x2be3('0x3a')][_0x2be3('0x48')]){_0x5acaf0[_0x2be3('0x49')]=[{'all':!![]}];}_0x5acaf0=_['merge']({},_0x5acaf0,_0x3161f3['options']);return db[_0x2be3('0x33')][_0x2be3('0x4e')](_0x5acaf0)[_0x2be3('0x2c')](handleEntityNotFound(_0x3a2150,null))[_0x2be3('0x2c')](respondWithResult(_0x3a2150,null))[_0x2be3('0x4f')](handleError(_0x3a2150,null));};exports[_0x2be3('0x50')]=function(_0x10e852,_0x11978e,_0x412a5a){return db[_0x2be3('0x33')][_0x2be3('0x4e')]({'where':{'id':_0x10e852[_0x2be3('0x4d')]['id']},'attributes':[_0x2be3('0x39'),_0x2be3('0x51')],'raw':!![]})[_0x2be3('0x2c')](handleEntityNotFound(_0x11978e,null))['then'](function(_0x1f06d6){if(_0x1f06d6){var _0xe9967d=path['join'](config[_0x2be3('0x52')],_0x2be3('0x53'),util['format'](_0x2be3('0x54'),path['basename'](_0x1f06d6['path'])));var _0x31813c=fs[_0x2be3('0x55')](_0xe9967d);var _0x86804=archiver(_0x2be3('0x56'),{'zlib':{'level':0x9}});_0x86804['on'](_0x2be3('0x57'),function(_0x3d45b8){if(_0x3d45b8[_0x2be3('0x58')]===_0x2be3('0x59')){logger['error'](_0x3d45b8);}else{throw new db[(_0x2be3('0x5a'))][(_0x2be3('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x86804['on'](_0x2be3('0x2f'),function(_0x403922){throw new db['Sequelize'][(_0x2be3('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x86804[_0x2be3('0x5c')](_0x31813c);_0x86804[_0x2be3('0x5d')](_0x2be3('0x5e'),{'cwd':path[_0x2be3('0x5f')](config['root'],_0x2be3('0x53'),path[_0x2be3('0x60')](_0x1f06d6[_0x2be3('0x51')])),'ignore':[path[_0x2be3('0x5f')](path[_0x2be3('0x61')](_0x1f06d6[_0x2be3('0x51')]),_0x2be3('0x62')),path[_0x2be3('0x5f')](path[_0x2be3('0x61')](_0x1f06d6[_0x2be3('0x51')]),_0x2be3('0x63'))],'nodir':!![]})[_0x2be3('0x64')]();_0x31813c['on']('close',function(){if(!fs[_0x2be3('0x65')](_0xe9967d)){throw new db['Sequelize']['Error'](_0x2be3('0x66'));}return _0x11978e[_0x2be3('0x50')](_0xe9967d,util[_0x2be3('0x67')](_0x2be3('0x54'),path['basename'](_0x1f06d6[_0x2be3('0x51')])),function(_0x268bcb){if(_0x268bcb){throw new db[(_0x2be3('0x5a'))]['Error'](_0x2be3('0x68'));}fs[_0x2be3('0x69')](_0xe9967d);logger[_0x2be3('0x6a')](_0x2be3('0x6b'));logger[_0x2be3('0x6a')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x11978e,null));};exports[_0x2be3('0x6c')]=function(_0x2c9f86,_0x1896d4,_0x5eba02){var _0x5e0adf=path['basename'](_0x2c9f86[_0x2be3('0x6d')]['filename'],path[_0x2be3('0x6e')](_0x2c9f86[_0x2be3('0x6d')][_0x2be3('0x6f')]));var _0x3354f8=path[_0x2be3('0x5f')](config[_0x2be3('0x52')],_0x2be3('0x53'),_0x2c9f86[_0x2be3('0x6d')]['filename']);var _0x3a24ec=path[_0x2be3('0x5f')](config[_0x2be3('0x52')],_0x2be3('0x53'),_0x5e0adf);logger['info'](_0x2be3('0x70'),_0x3354f8);logger[_0x2be3('0x6a')](_0x2be3('0x71'),_0x3a24ec);try{fs[_0x2be3('0x72')](_0x3354f8,parseInt(_0x2be3('0x73'),0x8));extract(_0x3354f8,{'dir':_0x3a24ec},function(_0x5af327){if(_0x5af327){logger[_0x2be3('0x2f')](_0x5af327);handleError(_0x5af327,!![]);};var _0x59c67a=fs[_0x2be3('0x74')](_0x3a24ec);if(_0x59c67a['length']>0x1){removeReferences(_0x3354f8,_0x3a24ec);logger[_0x2be3('0x2f')](_0x2be3('0x75'));return _0x5eba02(new Error('Invalid\x20plugin\x20structure'));}var _0x30df37=fs[_0x2be3('0x76')](path[_0x2be3('0x5f')](_0x3a24ec,_0x59c67a[0x0]));if(_0x30df37[_0x2be3('0x77')]()){removeReferences(_0x3354f8,_0x3a24ec);logger[_0x2be3('0x2f')](_0x2be3('0x75'));return _0x5eba02(new Error(_0x2be3('0x75')));}if(_0x30df37[_0x2be3('0x78')]()){var _0x35cc64=fs[_0x2be3('0x74')](path[_0x2be3('0x5f')](_0x3a24ec,_0x59c67a[0x0]));if(_0x35cc64[_0x2be3('0x40')]===0x0){removeReferences(_0x3354f8,_0x3a24ec);logger[_0x2be3('0x2f')]('Invalid\x20plugin\x20structure');return _0x5eba02(new Error('Invalid\x20plugin\x20structure'));}var _0x33d60c=_0x35cc64[_0x2be3('0x79')](function(_0x4e588b){return _0x4e588b===_0x2be3('0x7a');});if(!_0x33d60c){return _0x5eba02(new Error(_0x2be3('0x7b')));}var _0x3a2b96=fs[_0x2be3('0x7c')](path[_0x2be3('0x5f')](_0x3a24ec,_0x59c67a[0x0],'manifest.json'));var _0x39840e=JSON['parse'](_0x3a2b96);if(_0x2be3('0x24')==typeof _0x39840e[_0x2be3('0x39')]){return _0x5eba02(new Error(_0x2be3('0x7d')));}if(_0x2be3('0x24')==typeof _0x39840e[_0x2be3('0x36')]){return _0x5eba02(new Error(_0x2be3('0x7e')));}if('undefined'==typeof _0x39840e['version']){return _0x5eba02(new Error(_0x2be3('0x7f')));}if('undefined'==typeof _0x39840e[_0x2be3('0x80')]){return _0x5eba02(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x39840e[_0x2be3('0x36')]===_0x2be3('0x81')){if('undefined'==typeof _0x39840e[_0x2be3('0x80')]['views']){return _0x5eba02(new Error(_0x2be3('0x82')));}if('undefined'==typeof _0x39840e[_0x2be3('0x80')]['views'][_0x2be3('0x83')]&&_0x2be3('0x24')==typeof _0x39840e[_0x2be3('0x80')]['views']['agent']){return _0x5eba02(new Error(_0x2be3('0x84')));}}else if(_0x39840e[_0x2be3('0x36')]==='script'){if(_0x2be3('0x24')==typeof _0x39840e[_0x2be3('0x80')]['scriptName']){return _0x5eba02(new Error(_0x2be3('0x85')));}if(_0x2be3('0x24')==typeof _0x39840e[_0x2be3('0x80')][_0x2be3('0x86')]){return _0x5eba02(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5eba02(new Error(_0x2be3('0x87')));}var _0x258e85=_0x39840e[_0x2be3('0x39')];var _0x591bc8=_0x39840e[_0x2be3('0x88')];var _0x17ef00=_0x39840e[_0x2be3('0x36')];var _0x3fae1b=_0x39840e[_0x2be3('0x89')]?_0x39840e[_0x2be3('0x89')]:_0x2be3('0x8a');var _0x37be66=_0x39840e['icon']?_0x39840e[_0x2be3('0x8b')]:_0x2be3('0x8c');var _0x5d3827='';var _0x49ea1e='';var _0x21ae19='';var _0x526f08='';var _0x20f36e=_0x39840e[_0x2be3('0x8d')];if(_0x17ef00===_0x2be3('0x81')){if(_0x2be3('0x24')!=typeof _0x39840e[_0x2be3('0x80')][_0x2be3('0x8e')]['admin']){var _0x2f3935=_0x39840e[_0x2be3('0x80')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2f3935)){_0x5d3827=path[_0x2be3('0x5f')](_0x2be3('0x8f'),_0x5e0adf,_0x59c67a[0x0],_0x2f3935);}else{_0x5d3827=_0x2f3935;}}else{logger[_0x2be3('0x6a')](_0x2be3('0x90'));}if('undefined'!=typeof _0x39840e['parameters'][_0x2be3('0x8e')][_0x2be3('0x91')]){var _0x119c1b=_0x39840e[_0x2be3('0x80')][_0x2be3('0x8e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x2be3('0x92')](_0x119c1b)){_0x49ea1e=path[_0x2be3('0x5f')](_0x2be3('0x8f'),_0x5e0adf,_0x59c67a[0x0],_0x119c1b);}else{_0x49ea1e=_0x119c1b;}}else{logger[_0x2be3('0x6a')](_0x2be3('0x93'));}}else if(_0x17ef00===_0x2be3('0x94')){_0x21ae19=_0x39840e['parameters'][_0x2be3('0x95')];_0x526f08=_0x39840e[_0x2be3('0x80')][_0x2be3('0x86')];if(_0x2be3('0x24')!=typeof _0x39840e[_0x2be3('0x80')]['views']){if('undefined'!=typeof _0x39840e[_0x2be3('0x80')][_0x2be3('0x8e')][_0x2be3('0x83')]){var _0x2f3935=_0x39840e[_0x2be3('0x80')][_0x2be3('0x8e')][_0x2be3('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x2be3('0x92')](_0x2f3935)){_0x5d3827=path['join']('plugins',_0x5e0adf,_0x59c67a[0x0],_0x2f3935);}else{_0x5d3827=_0x2f3935;}}if(_0x2be3('0x24')!=typeof _0x39840e['parameters'][_0x2be3('0x8e')]['agent']){var _0x119c1b=_0x39840e[_0x2be3('0x80')][_0x2be3('0x8e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x2be3('0x92')](_0x119c1b)){_0x49ea1e=path[_0x2be3('0x5f')](_0x2be3('0x8f'),_0x5e0adf,_0x59c67a[0x0],_0x119c1b);}else{_0x49ea1e=_0x119c1b;}}}}var _0x2f3bea={'name':_0x258e85,'description':_0x591bc8,'path':path[_0x2be3('0x5f')](_0x5e0adf,_0x59c67a[0x0]),'type':_0x17ef00,'sidebar':_0x3fae1b,'icon':_0x37be66,'adminUrl':_0x5d3827,'agentUrl':_0x49ea1e,'scriptName':_0x21ae19,'scriptPath':_0x526f08,'version':_0x20f36e};removeReferences(_0x3354f8,null);return db[_0x2be3('0x33')]['create'](_0x2f3bea)[_0x2be3('0x2c')](function(_0x549c46){var _0x429658={'role':_0x2c9f86['body'][_0x2be3('0x96')],'userProfileId':_0x2c9f86['body'][_0x2be3('0x97')]};if(!_0x429658)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x429658['role']===_0x2be3('0x98')){var _0x595d46=_0x549c46['get']({'plain':!![]});return db[_0x2be3('0x99')]['find']({'where':{'name':_0x2be3('0x9a'),'userProfileId':_0x429658[_0x2be3('0x97')]},'raw':!![]})[_0x2be3('0x2c')](function(_0x5829e8){if(_0x5829e8&&_0x5829e8[_0x2be3('0x9b')]===0x0){return db[_0x2be3('0x2e')][_0x2be3('0x9c')]({'name':_0x595d46[_0x2be3('0x39')],'resourceId':_0x595d46['id'],'type':_0x5829e8[_0x2be3('0x39')],'sectionId':_0x5829e8['id']},{})[_0x2be3('0x2c')](function(){return _0x549c46;});}else{return _0x549c46;}})[_0x2be3('0x4f')](function(_0xf4d3a7){logger[_0x2be3('0x2f')](_0x2be3('0x9d'),_0xf4d3a7);throw _0xf4d3a7;});}return _0x549c46;})[_0x2be3('0x2c')](respondWithResult(_0x1896d4,null))[_0x2be3('0x4f')](handleError(_0x1896d4,null));}});}catch(_0x5d7eed){_0x1896d4[_0x2be3('0x20')](0x1f4)[_0x2be3('0x9e')](_0x5d7eed);}};function removeReferences(_0x3f6ab4,_0x10b0d4){try{if(_0x3f6ab4){fs[_0x2be3('0x69')](_0x3f6ab4);logger['info'](_0x2be3('0x9f'));}if(_0x10b0d4){rimraf(_0x10b0d4,function(){});logger[_0x2be3('0x6a')](_0x2be3('0xa0'));}}catch(_0x40bd86){logger['error'](_0x40bd86);}}exports[_0x2be3('0x2b')]=function(_0x4e253f,_0x466f9f,_0x165b01){return db['Plugin'][_0x2be3('0x4e')]({'where':{'id':_0x4e253f['params']['id']}})[_0x2be3('0x2c')](handleEntityNotFound(_0x466f9f,null))[_0x2be3('0x2c')](saveUpdates(_0x4e253f[_0x2be3('0xa1')],null))['then'](respondWithResult(_0x466f9f,null))[_0x2be3('0x4f')](handleError(_0x466f9f,null));};exports['delete']=function(_0x13699a,_0x5905b4,_0x1ee2ea){return db[_0x2be3('0x33')][_0x2be3('0x4e')]({'where':{'id':_0x13699a[_0x2be3('0x4d')]['id']}})['then'](function(_0x295e6a){if(_0x295e6a){return _0x295e6a[_0x2be3('0x2d')]();}})[_0x2be3('0x2c')](function(_0xdc8686){rimraf(path['join'](config[_0x2be3('0x52')],_0x2be3('0x53'),path[_0x2be3('0x60')](_0xdc8686[_0x2be3('0x51')])),function(){});return _0xdc8686;})['then'](handleEntityNotFound(_0x5905b4,null))['then'](respondWithStatusCode(_0x5905b4,null))[_0x2be3('0x4f')](handleError(_0x5905b4,null));};exports[_0x2be3('0xa2')]=function(_0x2a0d0b,_0x3e8f5e,_0x5a5550){return BPromise[_0x2be3('0xa3')]()['then'](function(){if(!_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0x51')]){throw new Error(_0x2be3('0xa4'));}if(!_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0xa5')]){throw new Error(_0x2be3('0xa6'));}var _0x18f300=_0x2a0d0b['query'][_0x2be3('0xa7')]?_0x2a0d0b['query'][_0x2be3('0xa7')]+':'+_0x2a0d0b[_0x2be3('0x3a')]['port']:_0x2be3('0xa8')+_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0xa5')];var _0x4fbbe2=_0x2a0d0b['query'][_0x2be3('0x22')]?_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0x22')]:!![];var _0x331928=_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0xa9')]?_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0xa9')]:null;var _0x3e36ae={'method':_0x2a0d0b['method'],'uri':util[_0x2be3('0x67')](_0x2be3('0xaa'),_0x18f300,_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0x51')]),'json':_0x4fbbe2,'resolveWithFullResponse':!![],'encoding':_0x331928,'qs':_0x2a0d0b[_0x2be3('0x3a')]};if(_0x2a0d0b[_0x2be3('0xab')]){_0x3e36ae[_0x2be3('0xab')]=_0x2a0d0b[_0x2be3('0xab')];if(_0x3e36ae[_0x2be3('0xab')][_0x2be3('0xac')]){delete _0x3e36ae[_0x2be3('0xab')]['content-length'];}}if(_0x3e36ae['headers'][_0x2be3('0xad')]){delete _0x3e36ae['headers']['content-type'];}return rp(_0x3e36ae);})[_0x2be3('0x2c')](function(_0x2fd1ba){if(_0x2fd1ba){_0x3e8f5e[_0x2be3('0x27')](_0x2fd1ba[_0x2be3('0xab')]);logger[_0x2be3('0x6a')](_0x2fd1ba[_0x2be3('0xa1')]);if(_[_0x2be3('0xae')](_0x2a0d0b[_0x2be3('0x3a')][_0x2be3('0x51')],_0x2be3('0x50'))&&_0x2fd1ba[_0x2be3('0xaf')]==0x1f4){return _0x3e8f5e['sendStatus'](_0x2fd1ba[_0x2be3('0xaf')]);}else{return _0x3e8f5e[_0x2be3('0x20')](_0x2fd1ba[_0x2be3('0xaf')])[_0x2be3('0x9e')](_0x2fd1ba['body']);}}else{return _0x3e8f5e[_0x2be3('0x1f')](0xc8);}})[_0x2be3('0x4f')](handleError(_0x3e8f5e,null));};exports['webhookPost']=function(_0x2541a6,_0x452b74,_0x3692fd){return BPromise['resolve']()['then'](function(){if(!_0x2541a6['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2541a6[_0x2be3('0x3a')]['port']){throw new Error(_0x2be3('0xa6'));}var _0x26783b=_0x2541a6[_0x2be3('0x3a')][_0x2be3('0xa7')]?_0x2541a6[_0x2be3('0x3a')][_0x2be3('0xa7')]+':'+_0x2541a6[_0x2be3('0x3a')]['port']:'http://localhost:'+_0x2541a6[_0x2be3('0x3a')][_0x2be3('0xa5')];var _0x5e703b=_0x2541a6[_0x2be3('0x3a')]['json']?_0x2541a6['query']['json']:!![];var _0x47a5ac=_0x2541a6[_0x2be3('0x3a')][_0x2be3('0xa9')]?_0x2541a6[_0x2be3('0x3a')]['encoding']:null;var _0x2bcaab={'method':_0x2541a6[_0x2be3('0xb0')],'uri':util[_0x2be3('0x67')](_0x2be3('0xaa'),_0x26783b,_0x2541a6[_0x2be3('0x3a')]['path']),'json':_0x5e703b,'resolveWithFullResponse':!![],'encoding':_0x47a5ac,'body':_0x2541a6[_0x2be3('0xa1')]};if(_0x2541a6['headers']){_0x2bcaab[_0x2be3('0xab')]=_0x2541a6[_0x2be3('0xab')];if(_0x2bcaab[_0x2be3('0xab')][_0x2be3('0xac')]){delete _0x2bcaab[_0x2be3('0xab')][_0x2be3('0xac')];}}if(_0x2bcaab['headers']['content-type']){delete _0x2bcaab[_0x2be3('0xab')]['content-type'];}return rp(_0x2bcaab);})[_0x2be3('0x2c')](function(_0x566571){if(_0x566571){_0x452b74['set'](_0x566571[_0x2be3('0xab')]);logger[_0x2be3('0x6a')](_0x566571['body']);return _0x452b74[_0x2be3('0x20')](_0x566571[_0x2be3('0xaf')])[_0x2be3('0x9e')](_0x566571[_0x2be3('0xa1')]);}else{return _0x452b74[_0x2be3('0x1f')](0xc8);}})[_0x2be3('0x4f')](handleError(_0x452b74,null));};
\ No newline at end of file
+var _0xb5dd=['admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','update','destroy','UserProfileResource','then','error','stack','map','Plugin','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','join','root','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','server/files/plugins','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing'];(function(_0x48478f,_0x537acd){var _0x10af50=function(_0x4cf0ac){while(--_0x4cf0ac){_0x48478f['push'](_0x48478f['shift']());}};_0x10af50(++_0x537acd);}(_0xb5dd,0xde));var _0xdb5d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb5dd[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xdb5d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb5d('0x1'));var jsonpatch=require(_0xdb5d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb5d('0x3'));var Mustache=require('mustache');var util=require(_0xdb5d('0x4'));var path=require(_0xdb5d('0x5'));var sox=require(_0xdb5d('0x6'));var csv=require(_0xdb5d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb5d('0x8'));var _=require(_0xdb5d('0x9'));var squel=require(_0xdb5d('0xa'));var crypto=require(_0xdb5d('0xb'));var jsforce=require(_0xdb5d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdb5d('0xd'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0xdb5d('0xe'));var Redis=require(_0xdb5d('0xf'));var authService=require(_0xdb5d('0x10'));var qs=require(_0xdb5d('0x11'));var as=require(_0xdb5d('0x12'));var hardwareService=require(_0xdb5d('0x13'));var logger=require(_0xdb5d('0x14'))(_0xdb5d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb5d('0x16'))['db'];config['redis']=_[_0xdb5d('0x17')](config[_0xdb5d('0x18')],{'host':_0xdb5d('0x19'),'port':0x18eb});var socket=require(_0xdb5d('0x1a'))(new Redis(config[_0xdb5d('0x18')]));require(_0xdb5d('0x1b'))['register'](socket);function respondWithStatusCode(_0x11fe02,_0x4283fa){_0x4283fa=_0x4283fa||0xcc;return function(_0x9cc558){if(_0x9cc558){return _0x11fe02[_0xdb5d('0x1c')](_0x4283fa);}return _0x11fe02['status'](_0x4283fa)[_0xdb5d('0x1d')]();};}function respondWithResult(_0x77f8f,_0x1ceb15){_0x1ceb15=_0x1ceb15||0xc8;return function(_0x2685ad){if(_0x2685ad){return _0x77f8f[_0xdb5d('0x1e')](_0x1ceb15)[_0xdb5d('0x1f')](_0x2685ad);}};}function respondWithFilteredResult(_0x3f841a,_0x4b49a3){return function(_0x51190c){if(_0x51190c){var _0x74eb04=typeof _0x4b49a3['offset']===_0xdb5d('0x20')&&typeof _0x4b49a3['limit']===_0xdb5d('0x20');var _0x4ea667=_0x51190c[_0xdb5d('0x21')];var _0x201411=_0x74eb04?0x0:_0x4b49a3['offset'];var _0x5a630e=_0x74eb04?_0x51190c[_0xdb5d('0x21')]:_0x4b49a3[_0xdb5d('0x22')]+_0x4b49a3[_0xdb5d('0x23')];var _0x7fbf62;if(_0x5a630e>=_0x4ea667){_0x5a630e=_0x4ea667;_0x7fbf62=0xc8;}else{_0x7fbf62=0xce;}_0x3f841a[_0xdb5d('0x1e')](_0x7fbf62);return _0x3f841a['set']('Content-Range',_0x201411+'-'+_0x5a630e+'/'+_0x4ea667)[_0xdb5d('0x1f')](_0x51190c);}return null;};}function patchUpdates(_0x18d091){return function(_0x41015f){try{jsonpatch[_0xdb5d('0x24')](_0x41015f,_0x18d091,!![]);}catch(_0x3d0a23){return BPromise[_0xdb5d('0x25')](_0x3d0a23);}return _0x41015f['save']();};}function saveUpdates(_0x1483b5,_0xb44600){return function(_0x191492){if(_0x191492){return _0x191492[_0xdb5d('0x26')](_0x1483b5)['then'](function(_0x2d73ab){return _0x2d73ab;});}return null;};}function removeEntity(_0x3d24b6,_0x1c4150){return function(_0x3e7239){if(_0x3e7239){return _0x3e7239[_0xdb5d('0x27')]()['then'](function(){var _0x5c3890=_0x3e7239['get']({'plain':!![]});var _0xb7f585='Plugins';return db[_0xdb5d('0x28')][_0xdb5d('0x27')]({'where':{'type':_0xb7f585,'resourceId':_0x5c3890['id']}})[_0xdb5d('0x29')](function(){return _0x3e7239;});})['then'](function(){_0x3d24b6[_0xdb5d('0x1e')](0xcc)[_0xdb5d('0x1d')]();});}};}function handleEntityNotFound(_0x1959fe,_0x466a4d){return function(_0x9cde6){if(!_0x9cde6){_0x1959fe[_0xdb5d('0x1c')](0x194);}return _0x9cde6;};}function handleError(_0x51049a,_0x489de9){_0x489de9=_0x489de9||0x1f4;return function(_0x49d21e){logger[_0xdb5d('0x2a')](_0x49d21e[_0xdb5d('0x2b')]);if(_0x49d21e['name']){delete _0x49d21e['name'];}_0x51049a[_0xdb5d('0x1e')](_0x489de9)['send'](_0x49d21e);};}exports['index']=function(_0x2546b9,_0x15b046){var _0x2a3e8f={},_0x3a683b={},_0x717d21={'count':0x0,'rows':[]};var _0x15c7da=_[_0xdb5d('0x2c')](db[_0xdb5d('0x2d')]['rawAttributes'],function(_0x1b043a){return{'name':_0x1b043a[_0xdb5d('0x2e')],'type':_0x1b043a['type']['key']};});_0x3a683b[_0xdb5d('0x2f')]=_['map'](_0x15c7da,_0xdb5d('0x30'));_0x3a683b[_0xdb5d('0x31')]=_[_0xdb5d('0x32')](_0x2546b9['query']);_0x3a683b[_0xdb5d('0x33')]=_[_0xdb5d('0x34')](_0x3a683b[_0xdb5d('0x2f')],_0x3a683b[_0xdb5d('0x31')]);_0x2a3e8f[_0xdb5d('0x35')]=_['intersection'](_0x3a683b[_0xdb5d('0x2f')],qs[_0xdb5d('0x36')](_0x2546b9[_0xdb5d('0x31')]['fields']));_0x2a3e8f[_0xdb5d('0x35')]=_0x2a3e8f['attributes'][_0xdb5d('0x37')]?_0x2a3e8f[_0xdb5d('0x35')]:_0x3a683b[_0xdb5d('0x2f')];if(!_0x2546b9[_0xdb5d('0x31')][_0xdb5d('0x38')](_0xdb5d('0x39'))){_0x2a3e8f[_0xdb5d('0x23')]=qs['limit'](_0x2546b9[_0xdb5d('0x31')][_0xdb5d('0x23')]);_0x2a3e8f[_0xdb5d('0x22')]=qs['offset'](_0x2546b9[_0xdb5d('0x31')][_0xdb5d('0x22')]);}_0x2a3e8f[_0xdb5d('0x3a')]=qs[_0xdb5d('0x3b')](_0x2546b9[_0xdb5d('0x31')][_0xdb5d('0x3b')]);_0x2a3e8f[_0xdb5d('0x3c')]=qs[_0xdb5d('0x33')](_['pick'](_0x2546b9['query'],_0x3a683b['filters']),_0x15c7da);if(_0x2546b9[_0xdb5d('0x31')]['filter']){_0x2a3e8f[_0xdb5d('0x3c')]=_[_0xdb5d('0x3d')](_0x2a3e8f[_0xdb5d('0x3c')],{'$or':_[_0xdb5d('0x2c')](_0x15c7da,function(_0x15df65){if(_0x15df65[_0xdb5d('0x3e')]!=='VIRTUAL'){var _0x5bec98={};_0x5bec98[_0x15df65[_0xdb5d('0x30')]]={'$like':'%'+_0x2546b9[_0xdb5d('0x31')][_0xdb5d('0x3f')]+'%'};return _0x5bec98;}})});}_0x2a3e8f=_[_0xdb5d('0x3d')]({},_0x2a3e8f,_0x2546b9[_0xdb5d('0x40')]);var _0x42c003={'where':_0x2a3e8f[_0xdb5d('0x3c')]};return db[_0xdb5d('0x2d')][_0xdb5d('0x21')](_0x42c003)[_0xdb5d('0x29')](function(_0x589e8f){_0x717d21['count']=_0x589e8f;if(_0x2546b9['query'][_0xdb5d('0x41')]){_0x2a3e8f[_0xdb5d('0x42')]=[{'all':!![]}];}return db[_0xdb5d('0x2d')][_0xdb5d('0x43')](_0x2a3e8f);})[_0xdb5d('0x29')](function(_0x1bb5ef){_0x717d21[_0xdb5d('0x44')]=_0x1bb5ef;return _0x717d21;})[_0xdb5d('0x29')](respondWithFilteredResult(_0x15b046,_0x2a3e8f))[_0xdb5d('0x45')](handleError(_0x15b046,null));};exports[_0xdb5d('0x46')]=function(_0x642e98,_0x4460a7){var _0x1960d9={'raw':!![],'where':{'id':_0x642e98[_0xdb5d('0x47')]['id']}},_0x531331={};_0x531331['model']=_['keys'](db[_0xdb5d('0x2d')][_0xdb5d('0x48')]);_0x531331[_0xdb5d('0x31')]=_[_0xdb5d('0x32')](_0x642e98[_0xdb5d('0x31')]);_0x531331['filters']=_[_0xdb5d('0x34')](_0x531331[_0xdb5d('0x2f')],_0x531331[_0xdb5d('0x31')]);_0x1960d9[_0xdb5d('0x35')]=_['intersection'](_0x531331['model'],qs['fields'](_0x642e98[_0xdb5d('0x31')]['fields']));_0x1960d9[_0xdb5d('0x35')]=_0x1960d9['attributes']['length']?_0x1960d9[_0xdb5d('0x35')]:_0x531331[_0xdb5d('0x2f')];if(_0x642e98['query'][_0xdb5d('0x41')]){_0x1960d9[_0xdb5d('0x42')]=[{'all':!![]}];}_0x1960d9=_[_0xdb5d('0x3d')]({},_0x1960d9,_0x642e98[_0xdb5d('0x40')]);return db['Plugin'][_0xdb5d('0x49')](_0x1960d9)[_0xdb5d('0x29')](handleEntityNotFound(_0x4460a7,null))[_0xdb5d('0x29')](respondWithResult(_0x4460a7,null))[_0xdb5d('0x45')](handleError(_0x4460a7,null));};exports['download']=function(_0x2500b7,_0x2d1e75,_0x51458c){return db['Plugin']['find']({'where':{'id':_0x2500b7[_0xdb5d('0x47')]['id']},'attributes':[_0xdb5d('0x30'),_0xdb5d('0x5')],'raw':!![]})[_0xdb5d('0x29')](handleEntityNotFound(_0x2d1e75,null))[_0xdb5d('0x29')](function(_0x108461){if(_0x108461){var _0x2b91ff=path[_0xdb5d('0x4a')](config[_0xdb5d('0x4b')],'server/files/plugins',util[_0xdb5d('0x4c')](_0xdb5d('0x4d'),path[_0xdb5d('0x4e')](_0x108461[_0xdb5d('0x5')])));var _0x19b810=fs[_0xdb5d('0x4f')](_0x2b91ff);var _0x18203e=archiver(_0xdb5d('0x50'),{'zlib':{'level':0x9}});_0x18203e['on'](_0xdb5d('0x51'),function(_0x2e5eb9){if(_0x2e5eb9['code']===_0xdb5d('0x52')){logger[_0xdb5d('0x2a')](_0x2e5eb9);}else{throw new db[(_0xdb5d('0x53'))][(_0xdb5d('0x54'))](_0xdb5d('0x55'));}});_0x18203e['on'](_0xdb5d('0x2a'),function(_0x525401){throw new db['Sequelize'][(_0xdb5d('0x54'))](_0xdb5d('0x55'));});_0x18203e[_0xdb5d('0x56')](_0x19b810);_0x18203e['glob']('**/*',{'cwd':path[_0xdb5d('0x4a')](config[_0xdb5d('0x4b')],_0xdb5d('0x57'),path['dirname'](_0x108461[_0xdb5d('0x5')])),'ignore':[path[_0xdb5d('0x4a')](path[_0xdb5d('0x4e')](_0x108461[_0xdb5d('0x5')]),_0xdb5d('0x58')),path[_0xdb5d('0x4a')](path[_0xdb5d('0x4e')](_0x108461[_0xdb5d('0x5')]),_0xdb5d('0x59'))],'nodir':!![]})[_0xdb5d('0x5a')]();_0x19b810['on'](_0xdb5d('0x5b'),function(){if(!fs[_0xdb5d('0x5c')](_0x2b91ff)){throw new db[(_0xdb5d('0x53'))][(_0xdb5d('0x54'))](_0xdb5d('0x5d'));}return _0x2d1e75[_0xdb5d('0x5e')](_0x2b91ff,util['format'](_0xdb5d('0x4d'),path[_0xdb5d('0x4e')](_0x108461[_0xdb5d('0x5')])),function(_0x5a94b5){if(_0x5a94b5){throw new db['Sequelize'][(_0xdb5d('0x54'))](_0xdb5d('0x5f'));}fs[_0xdb5d('0x60')](_0x2b91ff);logger[_0xdb5d('0x61')](_0xdb5d('0x62'));logger[_0xdb5d('0x61')](_0xdb5d('0x63'));});});}return null;})[_0xdb5d('0x45')](handleError(_0x2d1e75,null));};exports['upload']=function(_0x1b5a09,_0x5174e4,_0x5836fa){var _0x2464a5=path[_0xdb5d('0x4e')](_0x1b5a09['file'][_0xdb5d('0x64')],path[_0xdb5d('0x65')](_0x1b5a09[_0xdb5d('0x66')][_0xdb5d('0x64')]));var _0x43578c=path['join'](config[_0xdb5d('0x4b')],'server/files/plugins',_0x1b5a09[_0xdb5d('0x66')]['filename']);var _0x35319d=path[_0xdb5d('0x4a')](config['root'],'server/files/plugins',_0x2464a5);logger[_0xdb5d('0x61')](_0xdb5d('0x67'),_0x43578c);logger['info'](_0xdb5d('0x68'),_0x35319d);try{fs[_0xdb5d('0x69')](_0x43578c,parseInt(_0xdb5d('0x6a'),0x8));extract(_0x43578c,{'dir':_0x35319d},function(_0x139bf2){if(_0x139bf2){logger[_0xdb5d('0x2a')](_0x139bf2);handleError(_0x139bf2,!![]);};var _0x5baa7e=fs['readdirSync'](_0x35319d);if(_0x5baa7e[_0xdb5d('0x37')]>0x1){removeReferences(_0x43578c,_0x35319d);logger['error'](_0xdb5d('0x6b'));return _0x5836fa(new Error(_0xdb5d('0x6b')));}var _0x6fd37c=fs[_0xdb5d('0x6c')](path['join'](_0x35319d,_0x5baa7e[0x0]));if(_0x6fd37c[_0xdb5d('0x6d')]()){removeReferences(_0x43578c,_0x35319d);logger['error'](_0xdb5d('0x6b'));return _0x5836fa(new Error(_0xdb5d('0x6b')));}if(_0x6fd37c[_0xdb5d('0x6e')]()){var _0x588512=fs[_0xdb5d('0x6f')](path[_0xdb5d('0x4a')](_0x35319d,_0x5baa7e[0x0]));if(_0x588512[_0xdb5d('0x37')]===0x0){removeReferences(_0x43578c,_0x35319d);logger[_0xdb5d('0x2a')](_0xdb5d('0x6b'));return _0x5836fa(new Error(_0xdb5d('0x6b')));}var _0x4364c9=_0x588512[_0xdb5d('0x70')](function(_0x1d19a8){return _0x1d19a8===_0xdb5d('0x71');});if(!_0x4364c9){return _0x5836fa(new Error(_0xdb5d('0x72')));}var _0x479f24=fs[_0xdb5d('0x73')](path[_0xdb5d('0x4a')](_0x35319d,_0x5baa7e[0x0],'manifest.json'));var _0x279763=JSON['parse'](_0x479f24);if(_0xdb5d('0x20')==typeof _0x279763[_0xdb5d('0x30')]){return _0x5836fa(new Error(_0xdb5d('0x74')));}if('undefined'==typeof _0x279763[_0xdb5d('0x3e')]){return _0x5836fa(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x279763[_0xdb5d('0x75')]){return _0x5836fa(new Error(_0xdb5d('0x76')));}if(_0xdb5d('0x20')==typeof _0x279763[_0xdb5d('0x77')]){return _0x5836fa(new Error(_0xdb5d('0x78')));}if(_0x279763[_0xdb5d('0x3e')]===_0xdb5d('0x79')){if('undefined'==typeof _0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')]){return _0x5836fa(new Error(_0xdb5d('0x7b')));}if(_0xdb5d('0x20')==typeof _0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')][_0xdb5d('0x7c')]&&_0xdb5d('0x20')==typeof _0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')][_0xdb5d('0x7d')]){return _0x5836fa(new Error(_0xdb5d('0x7e')));}}else if(_0x279763[_0xdb5d('0x3e')]===_0xdb5d('0x7f')){if(_0xdb5d('0x20')==typeof _0x279763[_0xdb5d('0x77')][_0xdb5d('0x80')]){return _0x5836fa(new Error(_0xdb5d('0x81')));}if(_0xdb5d('0x20')==typeof _0x279763[_0xdb5d('0x77')][_0xdb5d('0x82')]){return _0x5836fa(new Error(_0xdb5d('0x83')));}}else{return _0x5836fa(new Error(_0xdb5d('0x84')));}var _0x3595f4=_0x279763[_0xdb5d('0x30')];var _0x577494=_0x279763[_0xdb5d('0x85')];var _0x2ebd0f=_0x279763[_0xdb5d('0x3e')];var _0x5bc2b8=_0x279763[_0xdb5d('0x86')]?_0x279763['sidebar']:'always';var _0x1bb576=_0x279763[_0xdb5d('0x87')]?_0x279763[_0xdb5d('0x87')]:_0xdb5d('0x88');var _0x35cded='';var _0x388140='';var _0x169bf2='';var _0x3b8c82='';var _0x26d12b=_0x279763[_0xdb5d('0x75')];if(_0x2ebd0f==='html'){if(_0xdb5d('0x20')!=typeof _0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')][_0xdb5d('0x7c')]){var _0x53b3d6=_0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xdb5d('0x89')](_0x53b3d6)){_0x35cded=path[_0xdb5d('0x4a')](_0xdb5d('0x8a'),_0x2464a5,_0x5baa7e[0x0],_0x53b3d6);}else{_0x35cded=_0x53b3d6;}}else{logger[_0xdb5d('0x61')](_0xdb5d('0x8b'));}if('undefined'!=typeof _0x279763[_0xdb5d('0x77')]['views'][_0xdb5d('0x7d')]){var _0x1087ae=_0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1087ae)){_0x388140=path[_0xdb5d('0x4a')](_0xdb5d('0x8a'),_0x2464a5,_0x5baa7e[0x0],_0x1087ae);}else{_0x388140=_0x1087ae;}}else{logger[_0xdb5d('0x61')](_0xdb5d('0x8c'));}}else if(_0x2ebd0f===_0xdb5d('0x7f')){_0x169bf2=_0x279763['parameters'][_0xdb5d('0x80')];_0x3b8c82=_0x279763[_0xdb5d('0x77')]['scriptPath'];if(_0xdb5d('0x20')!=typeof _0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')]){if(_0xdb5d('0x20')!=typeof _0x279763['parameters']['views'][_0xdb5d('0x7c')]){var _0x53b3d6=_0x279763[_0xdb5d('0x77')]['views'][_0xdb5d('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xdb5d('0x89')](_0x53b3d6)){_0x35cded=path[_0xdb5d('0x4a')]('plugins',_0x2464a5,_0x5baa7e[0x0],_0x53b3d6);}else{_0x35cded=_0x53b3d6;}}if(_0xdb5d('0x20')!=typeof _0x279763['parameters'][_0xdb5d('0x7a')][_0xdb5d('0x7d')]){var _0x1087ae=_0x279763[_0xdb5d('0x77')][_0xdb5d('0x7a')][_0xdb5d('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1087ae)){_0x388140=path[_0xdb5d('0x4a')](_0xdb5d('0x8a'),_0x2464a5,_0x5baa7e[0x0],_0x1087ae);}else{_0x388140=_0x1087ae;}}}}var _0x1546c0={'name':_0x3595f4,'description':_0x577494,'path':path['join'](_0x2464a5,_0x5baa7e[0x0]),'type':_0x2ebd0f,'sidebar':_0x5bc2b8,'icon':_0x1bb576,'adminUrl':_0x35cded,'agentUrl':_0x388140,'scriptName':_0x169bf2,'scriptPath':_0x3b8c82,'version':_0x26d12b};removeReferences(_0x43578c,null);return db[_0xdb5d('0x2d')][_0xdb5d('0x8d')](_0x1546c0)['then'](function(_0x505efe){var _0x51491b={'role':_0x1b5a09['body'][_0xdb5d('0x8e')],'userProfileId':_0x1b5a09[_0xdb5d('0x8f')][_0xdb5d('0x90')]};if(!_0x51491b)throw new Error(_0xdb5d('0x91'));if(_0x51491b[_0xdb5d('0x8e')]===_0xdb5d('0x92')){var _0x1385b3=_0x505efe[_0xdb5d('0x93')]({'plain':!![]});return db[_0xdb5d('0x94')][_0xdb5d('0x49')]({'where':{'name':_0xdb5d('0x95'),'userProfileId':_0x51491b[_0xdb5d('0x90')]},'raw':!![]})[_0xdb5d('0x29')](function(_0x38df89){if(_0x38df89&&_0x38df89[_0xdb5d('0x96')]===0x0){return db[_0xdb5d('0x28')][_0xdb5d('0x8d')]({'name':_0x1385b3['name'],'resourceId':_0x1385b3['id'],'type':_0x38df89[_0xdb5d('0x30')],'sectionId':_0x38df89['id']},{})[_0xdb5d('0x29')](function(){return _0x505efe;});}else{return _0x505efe;}})[_0xdb5d('0x45')](function(_0x3e15fd){logger['error'](_0xdb5d('0x97'),_0x3e15fd);throw _0x3e15fd;});}return _0x505efe;})['then'](respondWithResult(_0x5174e4,null))[_0xdb5d('0x45')](handleError(_0x5174e4,null));}});}catch(_0x457c62){_0x5174e4['status'](0x1f4)[_0xdb5d('0x98')](_0x457c62);}};function removeReferences(_0x622063,_0x3cfc16){try{if(_0x622063){fs['unlinkSync'](_0x622063);logger['info']('Zip\x20archive\x20removed');}if(_0x3cfc16){rimraf(_0x3cfc16,function(){});logger[_0xdb5d('0x61')](_0xdb5d('0x99'));}}catch(_0x5b2508){logger[_0xdb5d('0x2a')](_0x5b2508);}}exports[_0xdb5d('0x26')]=function(_0x4541ac,_0x555408,_0x672c7){return db[_0xdb5d('0x2d')][_0xdb5d('0x49')]({'where':{'id':_0x4541ac['params']['id']}})[_0xdb5d('0x29')](handleEntityNotFound(_0x555408,null))['then'](saveUpdates(_0x4541ac['body'],null))[_0xdb5d('0x29')](respondWithResult(_0x555408,null))[_0xdb5d('0x45')](handleError(_0x555408,null));};exports[_0xdb5d('0x9a')]=function(_0x14e1c0,_0x438334,_0x3cb2ec){return db[_0xdb5d('0x2d')][_0xdb5d('0x49')]({'where':{'id':_0x14e1c0['params']['id']}})[_0xdb5d('0x29')](function(_0x5032d2){if(_0x5032d2){return _0x5032d2[_0xdb5d('0x27')]();}})[_0xdb5d('0x29')](function(_0x292ea1){rimraf(path[_0xdb5d('0x4a')](config[_0xdb5d('0x4b')],'server/files/plugins',path[_0xdb5d('0x9b')](_0x292ea1[_0xdb5d('0x5')])),function(){});return _0x292ea1;})[_0xdb5d('0x29')](handleEntityNotFound(_0x438334,null))[_0xdb5d('0x29')](respondWithStatusCode(_0x438334,null))[_0xdb5d('0x45')](handleError(_0x438334,null));};exports[_0xdb5d('0x9c')]=function(_0x593570,_0x22f019,_0x4bfe2e){return BPromise[_0xdb5d('0x9d')]()[_0xdb5d('0x29')](function(){if(!_0x593570[_0xdb5d('0x31')][_0xdb5d('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x593570[_0xdb5d('0x31')][_0xdb5d('0x9e')]){throw new Error(_0xdb5d('0x9f'));}var _0x201c3d=_0x593570[_0xdb5d('0x31')][_0xdb5d('0xa0')]?_0x593570[_0xdb5d('0x31')][_0xdb5d('0xa0')]+':'+_0x593570['query'][_0xdb5d('0x9e')]:_0xdb5d('0xa1')+_0x593570[_0xdb5d('0x31')]['port'];var _0x5949ba=_0x593570[_0xdb5d('0x31')][_0xdb5d('0x1f')]?_0x593570[_0xdb5d('0x31')][_0xdb5d('0x1f')]:!![];var _0x2debd8=_0x593570['query'][_0xdb5d('0xa2')]?_0x593570[_0xdb5d('0x31')][_0xdb5d('0xa2')]:null;var _0x18c495={'method':_0x593570[_0xdb5d('0xa3')],'uri':util['format']('%s%s',_0x201c3d,_0x593570[_0xdb5d('0x31')]['path']),'json':_0x5949ba,'resolveWithFullResponse':!![],'encoding':_0x2debd8,'qs':_0x593570['query']};if(_0x593570[_0xdb5d('0xa4')]){_0x18c495[_0xdb5d('0xa4')]=_0x593570['headers'];if(_0x18c495[_0xdb5d('0xa4')][_0xdb5d('0xa5')]){delete _0x18c495['headers'][_0xdb5d('0xa5')];}}if(_0x18c495[_0xdb5d('0xa4')][_0xdb5d('0xa6')]){delete _0x18c495['headers']['content-type'];}return rp(_0x18c495);})[_0xdb5d('0x29')](function(_0xedff95){if(_0xedff95){_0x22f019[_0xdb5d('0xa7')](_0xedff95['headers']);logger[_0xdb5d('0x61')](_0xedff95['body']);if(_[_0xdb5d('0xa8')](_0x593570[_0xdb5d('0x31')]['path'],_0xdb5d('0x5e'))&&_0xedff95[_0xdb5d('0xa9')]==0x1f4){return _0x22f019['sendStatus'](_0xedff95[_0xdb5d('0xa9')]);}else{return _0x22f019['status'](_0xedff95[_0xdb5d('0xa9')])[_0xdb5d('0x98')](_0xedff95[_0xdb5d('0x8f')]);}}else{return _0x22f019['sendStatus'](0xc8);}})[_0xdb5d('0x45')](handleError(_0x22f019,null));};exports[_0xdb5d('0xaa')]=function(_0x21ec97,_0x335943,_0x13f845){return BPromise[_0xdb5d('0x9d')]()[_0xdb5d('0x29')](function(){if(!_0x21ec97[_0xdb5d('0x31')][_0xdb5d('0x5')]){throw new Error(_0xdb5d('0xab'));}if(!_0x21ec97[_0xdb5d('0x31')]['port']){throw new Error(_0xdb5d('0x9f'));}var _0x359423=_0x21ec97[_0xdb5d('0x31')][_0xdb5d('0xa0')]?_0x21ec97[_0xdb5d('0x31')][_0xdb5d('0xa0')]+':'+_0x21ec97[_0xdb5d('0x31')][_0xdb5d('0x9e')]:_0xdb5d('0xa1')+_0x21ec97['query'][_0xdb5d('0x9e')];var _0x342a3f=_0x21ec97[_0xdb5d('0x31')]['json']?_0x21ec97[_0xdb5d('0x31')][_0xdb5d('0x1f')]:!![];var _0x29a2f1=_0x21ec97['query']['encoding']?_0x21ec97[_0xdb5d('0x31')][_0xdb5d('0xa2')]:null;var _0x4ac366={'method':_0x21ec97[_0xdb5d('0xa3')],'uri':util[_0xdb5d('0x4c')](_0xdb5d('0xac'),_0x359423,_0x21ec97[_0xdb5d('0x31')][_0xdb5d('0x5')]),'json':_0x342a3f,'resolveWithFullResponse':!![],'encoding':_0x29a2f1,'body':_0x21ec97['body']};if(_0x21ec97[_0xdb5d('0xa4')]){_0x4ac366[_0xdb5d('0xa4')]=_0x21ec97[_0xdb5d('0xa4')];if(_0x4ac366[_0xdb5d('0xa4')][_0xdb5d('0xa5')]){delete _0x4ac366[_0xdb5d('0xa4')]['content-length'];}}if(_0x4ac366[_0xdb5d('0xa4')][_0xdb5d('0xa6')]){delete _0x4ac366['headers'][_0xdb5d('0xa6')];}return rp(_0x4ac366);})[_0xdb5d('0x29')](function(_0x4d72f7){if(_0x4d72f7){_0x335943[_0xdb5d('0xa7')](_0x4d72f7[_0xdb5d('0xa4')]);logger['info'](_0x4d72f7[_0xdb5d('0x8f')]);return _0x335943[_0xdb5d('0x1e')](_0x4d72f7[_0xdb5d('0xa9')])['send'](_0x4d72f7['body']);}else{return _0x335943[_0xdb5d('0x1c')](0xc8);}})['catch'](handleError(_0x335943,null));};
\ No newline at end of file
index c63e5e4..5be45ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf0=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4a914f,_0x247258){var _0x4a88fc=function(_0x3fa243){while(--_0x3fa243){_0x4a914f['push'](_0x4a914f['shift']());}};_0x4a88fc(++_0x247258);}(_0xfcf0,0x138));var _0x0fcf=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0xfcf0[_0x5ad220];return _0xdec77d;};'use strict';var EventEmitter=require(_0x0fcf('0x0'));var Plugin=require(_0x0fcf('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x0fcf('0x2')](0x0);var events={'afterCreate':_0x0fcf('0x3'),'afterUpdate':_0x0fcf('0x4'),'afterDestroy':_0x0fcf('0x5')};function emitEvent(_0x5c865e){return function(_0x2fe6d8,_0x265968,_0x3bd34d){PluginEvents[_0x0fcf('0x6')](_0x5c865e+':'+_0x2fe6d8['id'],_0x2fe6d8);PluginEvents[_0x0fcf('0x6')](_0x5c865e,_0x2fe6d8);_0x3bd34d(null);};}for(var e in events){if(events[_0x0fcf('0x7')](e)){var event=events[e];Plugin[_0x0fcf('0x8')](e,emitEvent(event));}}module[_0x0fcf('0x9')]=PluginEvents;
\ No newline at end of file
+var _0x66da=['../../mysqldb','Plugin','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x261969,_0x7411e0){var _0x1a0ab3=function(_0x45f055){while(--_0x45f055){_0x261969['push'](_0x261969['shift']());}};_0x1a0ab3(++_0x7411e0);}(_0x66da,0x16f));var _0xa66d=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x66da[_0x187d80];return _0x498a77;};'use strict';var EventEmitter=require(_0xa66d('0x0'));var Plugin=require(_0xa66d('0x1'))['db'][_0xa66d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa66d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17b831){return function(_0x950036,_0x1326e8,_0x436606){PluginEvents[_0xa66d('0x4')](_0x17b831+':'+_0x950036['id'],_0x950036);PluginEvents['emit'](_0x17b831,_0x950036);_0x436606(null);};}for(var e in events){if(events[_0xa66d('0x5')](e)){var event=events[e];Plugin[_0xa66d('0x6')](e,emitEvent(event));}}module[_0xa66d('0x7')]=PluginEvents;
\ No newline at end of file
index 4d44a70..a90b9d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa29e=['Plugin','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./plugin.attributes','exports'];(function(_0x3a902a,_0xca8442){var _0x24f2d5=function(_0xb6799a){while(--_0xb6799a){_0x3a902a['push'](_0x3a902a['shift']());}};_0x24f2d5(++_0xca8442);}(_0xa29e,0x199));var _0xea29=function(_0xf5276f,_0x1387b7){_0xf5276f=_0xf5276f-0x0;var _0x4e7834=_0xa29e[_0xf5276f];return _0x4e7834;};'use strict';var _=require(_0xea29('0x0'));var util=require(_0xea29('0x1'));var logger=require(_0xea29('0x2'))(_0xea29('0x3'));var moment=require('moment');var BPromise=require(_0xea29('0x4'));var rp=require(_0xea29('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea29('0x6'));var attributes=require(_0xea29('0x7'));module[_0xea29('0x8')]=function(_0x28053d,_0x32c1bc){return _0x28053d['define'](_0xea29('0x9'),attributes,{'tableName':_0xea29('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfe6=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','plugins','util'];(function(_0x2a2cc7,_0x16059f){var _0x182485=function(_0x3f4231){while(--_0x3f4231){_0x2a2cc7['push'](_0x2a2cc7['shift']());}};_0x182485(++_0x16059f);}(_0xbfe6,0xa4));var _0x6bfe=function(_0x2d8d09,_0x253e60){_0x2d8d09=_0x2d8d09-0x0;var _0x244ec6=_0xbfe6[_0x2d8d09];return _0x244ec6;};'use strict';var _=require('lodash');var util=require(_0x6bfe('0x0'));var logger=require(_0x6bfe('0x1'))(_0x6bfe('0x2'));var moment=require(_0x6bfe('0x3'));var BPromise=require(_0x6bfe('0x4'));var rp=require(_0x6bfe('0x5'));var fs=require('fs');var path=require(_0x6bfe('0x6'));var rimraf=require('rimraf');var config=require(_0x6bfe('0x7'));var attributes=require('./plugin.attributes');module[_0x6bfe('0x8')]=function(_0x2b9bbe,_0x47dfe9){return _0x2b9bbe[_0x6bfe('0x9')]('Plugin',attributes,{'tableName':_0x6bfe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 36bcd7e..4c22ede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59a6=['code','message','catch','CreatePlugin','Plugin','create','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2f3848,_0x803952){var _0x15a129=function(_0x2f410c){while(--_0x2f410c){_0x2f3848['push'](_0x2f3848['shift']());}};_0x15a129(++_0x803952);}(_0x59a6,0x148));var _0x659a=function(_0x5ade19,_0x574a49){_0x5ade19=_0x5ade19-0x0;var _0x1ceb74=_0x59a6[_0x5ade19];return _0x1ceb74;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x659a('0x0'));var BPromise=require(_0x659a('0x1'));var rs=require(_0x659a('0x2'));var fs=require('fs');var Redis=require(_0x659a('0x3'));var db=require(_0x659a('0x4'))['db'];var utils=require(_0x659a('0x5'));var logger=require('../../config/logger')(_0x659a('0x6'));var config=require(_0x659a('0x7'));var jayson=require(_0x659a('0x8'));var client=jayson[_0x659a('0x9')][_0x659a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x659a('0xb')],{'host':_0x659a('0xc'),'port':0x18eb});var socket=require(_0x659a('0xd'))(new Redis(config[_0x659a('0xb')]));require(_0x659a('0xe'))[_0x659a('0xf')](socket);function respondWithRpcPromise(_0x3f55db,_0x201dc7,_0x3333e0){return new BPromise(function(_0x4bb624,_0x31d235){return client[_0x659a('0x10')](_0x3f55db,_0x3333e0)[_0x659a('0x11')](function(_0x41f9aa){logger[_0x659a('0x12')](_0x659a('0x13'),_0x201dc7,'request\x20sent');logger[_0x659a('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x201dc7,_0x659a('0x15'),JSON[_0x659a('0x16')](_0x41f9aa));if(_0x41f9aa[_0x659a('0x17')]){if(_0x41f9aa[_0x659a('0x17')][_0x659a('0x18')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x201dc7,_0x41f9aa[_0x659a('0x17')][_0x659a('0x19')]);return _0x31d235(_0x41f9aa[_0x659a('0x17')][_0x659a('0x19')]);}logger[_0x659a('0x17')](_0x659a('0x13'),_0x201dc7,_0x41f9aa[_0x659a('0x17')]['message']);return _0x4bb624(_0x41f9aa[_0x659a('0x17')][_0x659a('0x19')]);}else{logger[_0x659a('0x12')](_0x659a('0x13'),_0x201dc7,_0x659a('0x15'));_0x4bb624(_0x41f9aa['result'][_0x659a('0x19')]);}})[_0x659a('0x1a')](function(_0x409d3c){logger[_0x659a('0x17')](_0x659a('0x13'),_0x201dc7,_0x409d3c);_0x31d235(_0x409d3c);});});}exports[_0x659a('0x1b')]=function(_0x5523dd){var _0x2532d0=this;return new Promise(function(_0x7b00c,_0x433f60){return db[_0x659a('0x1c')][_0x659a('0x1d')](_0x5523dd['body'],{'raw':_0x5523dd[_0x659a('0x1e')]?_0x5523dd[_0x659a('0x1e')][_0x659a('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5bf581){logger[_0x659a('0x12')](_0x659a('0x1b'),_0x5523dd);logger[_0x659a('0x14')](_0x659a('0x1b'),_0x5523dd,JSON[_0x659a('0x16')](_0x5bf581));_0x7b00c(_0x5bf581);})[_0x659a('0x1a')](function(_0x44c694){logger[_0x659a('0x17')](_0x659a('0x1b'),_0x44c694['message'],_0x5523dd);_0x433f60(_0x2532d0[_0x659a('0x17')](0x1f4,_0x44c694['message']));});});};
\ No newline at end of file
+var _0x5446=['create','options','then','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./plugin.socket','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreatePlugin'];(function(_0x23ee7d,_0x3d8105){var _0x3a5298=function(_0x3c1a2f){while(--_0x3c1a2f){_0x23ee7d['push'](_0x23ee7d['shift']());}};_0x3a5298(++_0x3d8105);}(_0x5446,0xab));var _0x6544=function(_0x1e970c,_0x32dfd6){_0x1e970c=_0x1e970c-0x0;var _0x21f924=_0x5446[_0x1e970c];return _0x21f924;};'use strict';var _=require(_0x6544('0x0'));var util=require('util');var moment=require(_0x6544('0x1'));var BPromise=require(_0x6544('0x2'));var rs=require(_0x6544('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6544('0x4'));var logger=require('../../config/logger')(_0x6544('0x5'));var config=require(_0x6544('0x6'));var jayson=require(_0x6544('0x7'));var client=jayson[_0x6544('0x8')][_0x6544('0x9')]({'port':0x232a});config[_0x6544('0xa')]=_[_0x6544('0xb')](config[_0x6544('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6544('0xa')]));require(_0x6544('0xc'))['register'](socket);function respondWithRpcPromise(_0x43e98b,_0x476520,_0x3f26c0){return new BPromise(function(_0x313845,_0x18f27c){return client[_0x6544('0xd')](_0x43e98b,_0x3f26c0)['then'](function(_0xb54feb){logger['info'](_0x6544('0xe'),_0x476520,_0x6544('0xf'));logger[_0x6544('0x10')](_0x6544('0x11'),_0x476520,'request\x20sent',JSON[_0x6544('0x12')](_0xb54feb));if(_0xb54feb[_0x6544('0x13')]){if(_0xb54feb[_0x6544('0x13')][_0x6544('0x14')]===0x1f4){logger['error'](_0x6544('0xe'),_0x476520,_0xb54feb['error']['message']);return _0x18f27c(_0xb54feb[_0x6544('0x13')]['message']);}logger[_0x6544('0x13')](_0x6544('0xe'),_0x476520,_0xb54feb[_0x6544('0x13')][_0x6544('0x15')]);return _0x313845(_0xb54feb[_0x6544('0x13')]['message']);}else{logger[_0x6544('0x16')](_0x6544('0xe'),_0x476520,_0x6544('0xf'));_0x313845(_0xb54feb['result']['message']);}})[_0x6544('0x17')](function(_0x14ef31){logger['error'](_0x6544('0xe'),_0x476520,_0x14ef31);_0x18f27c(_0x14ef31);});});}exports[_0x6544('0x18')]=function(_0x320aa3){var _0xcdea0e=this;return new Promise(function(_0xb54f35,_0x17dd9f){return db['Plugin'][_0x6544('0x19')](_0x320aa3['body'],{'raw':_0x320aa3['options']?_0x320aa3[_0x6544('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x6544('0x1b')](function(_0x40f3e1){logger['info'](_0x6544('0x18'),_0x320aa3);logger['debug'](_0x6544('0x18'),_0x320aa3,JSON[_0x6544('0x12')](_0x40f3e1));_0xb54f35(_0x40f3e1);})['catch'](function(_0x19c7f5){logger[_0x6544('0x13')](_0x6544('0x18'),_0x19c7f5[_0x6544('0x15')],_0x320aa3);_0x17dd9f(_0xcdea0e['error'](0x1f4,_0x19c7f5[_0x6544('0x15')]));});});};
\ No newline at end of file
index 7bd30e6..1144e2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbad9=['save','remove','update','removeListener','register','length','plugin:','./plugin.events'];(function(_0x29a397,_0x27a66b){var _0x3cc951=function(_0x3eaa8a){while(--_0x3eaa8a){_0x29a397['push'](_0x29a397['shift']());}};_0x3cc951(++_0x27a66b);}(_0xbad9,0xd7));var _0x9bad=function(_0x23b5d2,_0x5676ae){_0x23b5d2=_0x23b5d2-0x0;var _0x444386=_0xbad9[_0x23b5d2];return _0x444386;};'use strict';var PluginEvents=require(_0x9bad('0x0'));var events=[_0x9bad('0x1'),_0x9bad('0x2'),_0x9bad('0x3')];function createListener(_0xa200bb,_0x3f3067){return function(_0xd45d4e){_0x3f3067['emit'](_0xa200bb,_0xd45d4e);};}function removeListener(_0x2a972d,_0x3e4b22){return function(){PluginEvents[_0x9bad('0x4')](_0x2a972d,_0x3e4b22);};}exports[_0x9bad('0x5')]=function(_0x1ceb63){for(var _0xc4f542=0x0,_0x1508d1=events[_0x9bad('0x6')];_0xc4f542<_0x1508d1;_0xc4f542++){var _0x1a75f9=events[_0xc4f542];var _0x37db7e=createListener(_0x9bad('0x7')+_0x1a75f9,_0x1ceb63);PluginEvents['on'](_0x1a75f9,_0x37db7e);}};
\ No newline at end of file
+var _0x68b8=['save','remove','update','emit','removeListener','plugin:'];(function(_0x6c256f,_0x3f3d26){var _0xf93c7f=function(_0x588ed9){while(--_0x588ed9){_0x6c256f['push'](_0x6c256f['shift']());}};_0xf93c7f(++_0x3f3d26);}(_0x68b8,0x17a));var _0x868b=function(_0x44c37d,_0x19119f){_0x44c37d=_0x44c37d-0x0;var _0x29e087=_0x68b8[_0x44c37d];return _0x29e087;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x868b('0x0'),_0x868b('0x1'),_0x868b('0x2')];function createListener(_0x4317e3,_0x1cc484){return function(_0x3d58eb){_0x1cc484[_0x868b('0x3')](_0x4317e3,_0x3d58eb);};}function removeListener(_0x4f81e1,_0x3272ca){return function(){PluginEvents[_0x868b('0x4')](_0x4f81e1,_0x3272ca);};}exports['register']=function(_0x305c4c){for(var _0x3fee63=0x0,_0x13236d=events['length'];_0x3fee63<_0x13236d;_0x3fee63++){var _0xead1cc=events[_0x3fee63];var _0x33facf=createListener(_0x868b('0x5')+_0xead1cc,_0x305c4c);PluginEvents['on'](_0xead1cc,_0x33facf);}};
\ No newline at end of file
index b050279..6572743 100644 (file)
@@ -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(_0x41c175,_0x195e72){var _0x3a2cc7=function(_0x4a4a19){while(--_0x4a4a19){_0x41c175['push'](_0x41c175['shift']());}};_0x3a2cc7(++_0x195e72);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x74a721,_0x36c6d4){var _0x571d77=function(_0x5cc3df){while(--_0x5cc3df){_0x74a721['push'](_0x74a721['shift']());}};_0x571d77(++_0x36c6d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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
index 5ec459e..0d9b64a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','json','error','stack','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty'];(function(_0x2e7755,_0x4bfe8d){var _0x28090d=function(_0x1b4060){while(--_0x1b4060){_0x2e7755['push'](_0x2e7755['shift']());}};_0x28090d(++_0x4bfe8d);}(_0x153f,0x15b));var _0xf153=function(_0x1480e8,_0x126b52){_0x1480e8=_0x1480e8-0x0;var _0x19ff0c=_0x153f[_0x1480e8];return _0x19ff0c;};'use strict';var _=require(_0xf153('0x0'));var pm2=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));var path=require(_0xf153('0x4'));var exec=require(_0xf153('0x5'))[_0xf153('0x6')];var BPromise=require('bluebird');function handleEntityNotFound(_0x364e65,_0x5c49c7){return function(_0x1f9ead){if(!_0x1f9ead){_0x364e65[_0xf153('0x7')](0x194);;}return _0x1f9ead;};}function respondWithResult(_0x342a45,_0xafd987){_0xafd987=_0xafd987||0xc8;return function(_0x21f432){if(_0x21f432){return _0x342a45['status'](_0xafd987)[_0xf153('0x8')](_0x21f432);}return null;};}function handleError(_0x143497,_0x224f88){_0x224f88=_0x224f88||0x1f4;return function(_0x5f6cb5){logger[_0xf153('0x9')](_0x5f6cb5[_0xf153('0xa')]);if(_0x5f6cb5[_0xf153('0xb')]){delete _0x5f6cb5[_0xf153('0xb')];}_0x143497[_0xf153('0xc')](_0x224f88)[_0xf153('0xd')](_0x5f6cb5);};}function execChildProcess(){return new BPromise(function(_0x5c8ae9,_0x2b76eb){exec(_0xf153('0xe'),function(_0x2bea70,_0x493324,_0x3a8838){logger[_0xf153('0xf')](_0x493324);logger[_0xf153('0xf')](_0x3a8838);if(_0x2bea70){logger[_0xf153('0x9')](_0x2bea70);return _0x2b76eb(_0x2bea70);}return _0x5c8ae9(_0x493324);});});}exports[_0xf153('0x10')]=function(_0x107d31,_0x3f915c){return pm2[_0xf153('0x11')]()[_0xf153('0x12')](function(_0x4c5283){if(_0x4c5283){var _0x18be7e=_[_0xf153('0x13')](_0x4c5283,function(_0x2b666e){return _0x2b666e[_0xf153('0xb')]===_0xf153('0x14')||_0x2b666e[_0xf153('0xb')]===_0xf153('0x15');});return{'rows':_0x18be7e,'count':_0x18be7e[_0xf153('0x16')]};}return null;})['then'](respondWithResult(_0x3f915c,null))[_0xf153('0x17')](handleError(_0x3f915c,null));};exports['show']=function(_0x37093a,_0x2c62b6){return pm2[_0xf153('0x18')](_0x37093a[_0xf153('0x19')]['id'])['then'](respondWithResult(_0x2c62b6,null))[_0xf153('0x12')](handleEntityNotFound(_0x2c62b6,null))[_0xf153('0x17')](handleError(_0x2c62b6,null));};exports[_0xf153('0x1a')]=function(_0x14b83f,_0x15230c){if(_0x14b83f[_0xf153('0x1b')][_0xf153('0xb')]&&_0x14b83f[_0xf153('0x1b')][_0xf153('0x1c')]){var _0x1dd340=path[_0xf153('0x1d')](__dirname,_0xf153('0x1e'),_0x14b83f['body'][_0xf153('0x1c')]);var _0x395f28=process[_0xf153('0x1f')]();process[_0xf153('0x20')](path[_0xf153('0x21')](_0x1dd340));return execChildProcess()[_0xf153('0x12')](function(_0x465d88){process[_0xf153('0x20')](_0x395f28);return pm2[_0xf153('0x22')]({'name':_0x14b83f[_0xf153('0x1b')][_0xf153('0xb')],'script':_0x1dd340});})[_0xf153('0x12')](function(_0x35cfe3){pm2[_0xf153('0x23')]();return _0x35cfe3[0x0];})[_0xf153('0x12')](respondWithResult(_0x15230c,0xc9))[_0xf153('0x17')](handleError(_0x15230c,null));}else{return _0x15230c[_0xf153('0xc')](0x1f4)[_0xf153('0xd')]({'message':_0xf153('0x24')});}};exports[_0xf153('0x25')]=function(_0x48ebdc,_0x6d62ef){if(_0x48ebdc[_0xf153('0x1b')]['id']){delete _0x48ebdc['body']['id'];}var _0x16cdcd={'online':_0xf153('0x26'),'stopped':'stop'};if(_0x16cdcd[_0xf153('0x27')](_0x48ebdc[_0xf153('0x1b')][_0xf153('0xc')])){return pm2[_0x16cdcd[_0x48ebdc[_0xf153('0x1b')][_0xf153('0xc')]]](_0x48ebdc[_0xf153('0x19')]['id'])[_0xf153('0x12')](respondWithResult(_0x6d62ef,0xc8))[_0xf153('0x17')](handleError(_0x6d62ef,null));}else{return _0x6d62ef[_0xf153('0xc')](0x1f4)[_0xf153('0xd')]({'message':_0xf153('0x28')});}};exports[_0xf153('0x29')]=function(_0x5b5237,_0x258fb0){if(_0x5b5237[_0xf153('0x1b')]['id']){delete _0x5b5237[_0xf153('0x1b')]['id'];}if(_0x5b5237[_0xf153('0x19')]['id']){return pm2['delete'](_0x5b5237['params']['id'])[_0xf153('0x12')](function(_0x4c6ea0){pm2['dump']();return _0x4c6ea0[0x0];})[_0xf153('0x12')](respondWithResult(_0x258fb0,null))['catch'](handleError(_0x258fb0,null));}else{return _0x258fb0[_0xf153('0xc')](0x1f4)['send']({'message':_0xf153('0x2a')});}};
\ No newline at end of file
+var _0x702d=['../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','params','create','body','join','../../files/plugins','script','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash'];(function(_0x1238fc,_0x404d1f){var _0x66d410=function(_0x22b1bc){while(--_0x22b1bc){_0x1238fc['push'](_0x1238fc['shift']());}};_0x66d410(++_0x404d1f);}(_0x702d,0x147));var _0xd702=function(_0x132b2b,_0xda9f8f){_0x132b2b=_0x132b2b-0x0;var _0x1c7ab=_0x702d[_0x132b2b];return _0x1c7ab;};'use strict';var _=require(_0xd702('0x0'));var pm2=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var path=require(_0xd702('0x4'));var exec=require('child_process')[_0xd702('0x5')];var BPromise=require(_0xd702('0x6'));function handleEntityNotFound(_0x27b260,_0x1c5a32){return function(_0x481ee0){if(!_0x481ee0){_0x27b260[_0xd702('0x7')](0x194);;}return _0x481ee0;};}function respondWithResult(_0x544e94,_0x1aecfc){_0x1aecfc=_0x1aecfc||0xc8;return function(_0x3a2c03){if(_0x3a2c03){return _0x544e94[_0xd702('0x8')](_0x1aecfc)['json'](_0x3a2c03);}return null;};}function handleError(_0x12bb75,_0x53bd02){_0x53bd02=_0x53bd02||0x1f4;return function(_0x39c49e){logger[_0xd702('0x9')](_0x39c49e[_0xd702('0xa')]);if(_0x39c49e[_0xd702('0xb')]){delete _0x39c49e[_0xd702('0xb')];}_0x12bb75[_0xd702('0x8')](_0x53bd02)[_0xd702('0xc')](_0x39c49e);};}function execChildProcess(){return new BPromise(function(_0x1988eb,_0x5907cf){exec(_0xd702('0xd'),function(_0x58805a,_0x4a3439,_0x3e9439){logger[_0xd702('0xe')](_0x4a3439);logger[_0xd702('0xe')](_0x3e9439);if(_0x58805a){logger['error'](_0x58805a);return _0x5907cf(_0x58805a);}return _0x1988eb(_0x4a3439);});});}exports[_0xd702('0xf')]=function(_0x128add,_0x1ed8a3){return pm2[_0xd702('0x10')]()[_0xd702('0x11')](function(_0x181ff2){if(_0x181ff2){var _0x59dd33=_[_0xd702('0x12')](_0x181ff2,function(_0x3ea0ab){return _0x3ea0ab['name']===_0xd702('0x13')||_0x3ea0ab['name']===_0xd702('0x14');});return{'rows':_0x59dd33,'count':_0x59dd33[_0xd702('0x15')]};}return null;})['then'](respondWithResult(_0x1ed8a3,null))[_0xd702('0x16')](handleError(_0x1ed8a3,null));};exports[_0xd702('0x17')]=function(_0x2a87f2,_0x4fdbbd){return pm2['describe'](_0x2a87f2[_0xd702('0x18')]['id'])['then'](respondWithResult(_0x4fdbbd,null))[_0xd702('0x11')](handleEntityNotFound(_0x4fdbbd,null))[_0xd702('0x16')](handleError(_0x4fdbbd,null));};exports[_0xd702('0x19')]=function(_0x265b1b,_0x4cf326){if(_0x265b1b[_0xd702('0x1a')][_0xd702('0xb')]&&_0x265b1b['body']['script']){var _0x536ca8=path[_0xd702('0x1b')](__dirname,_0xd702('0x1c'),_0x265b1b['body'][_0xd702('0x1d')]);var _0x5d91fd=process[_0xd702('0x1e')]();process['chdir'](path['dirname'](_0x536ca8));return execChildProcess()['then'](function(_0x21c00e){process[_0xd702('0x1f')](_0x5d91fd);return pm2[_0xd702('0x20')]({'name':_0x265b1b['body'][_0xd702('0xb')],'script':_0x536ca8});})[_0xd702('0x11')](function(_0x10599a){pm2[_0xd702('0x21')]();return _0x10599a[0x0];})[_0xd702('0x11')](respondWithResult(_0x4cf326,0xc9))[_0xd702('0x16')](handleError(_0x4cf326,null));}else{return _0x4cf326[_0xd702('0x8')](0x1f4)[_0xd702('0xc')]({'message':_0xd702('0x22')});}};exports['update']=function(_0x116b2f,_0x322cb8){if(_0x116b2f[_0xd702('0x1a')]['id']){delete _0x116b2f[_0xd702('0x1a')]['id'];}var _0xbe4518={'online':_0xd702('0x23'),'stopped':_0xd702('0x24')};if(_0xbe4518[_0xd702('0x25')](_0x116b2f['body']['status'])){return pm2[_0xbe4518[_0x116b2f[_0xd702('0x1a')][_0xd702('0x8')]]](_0x116b2f['params']['id'])[_0xd702('0x11')](respondWithResult(_0x322cb8,0xc8))[_0xd702('0x16')](handleError(_0x322cb8,null));}else{return _0x322cb8[_0xd702('0x8')](0x1f4)[_0xd702('0xc')]({'message':'Unknown\x20status'});}};exports[_0xd702('0x26')]=function(_0x313281,_0x1630ed){if(_0x313281[_0xd702('0x1a')]['id']){delete _0x313281[_0xd702('0x1a')]['id'];}if(_0x313281['params']['id']){return pm2[_0xd702('0x27')](_0x313281[_0xd702('0x18')]['id'])[_0xd702('0x11')](function(_0x5abfea){pm2[_0xd702('0x21')]();return _0x5abfea[0x0];})['then'](respondWithResult(_0x1630ed,null))['catch'](handleError(_0x1630ed,null));}else{return _0x1630ed[_0xd702('0x8')](0x1f4)[_0xd702('0xc')]({'message':_0xd702('0x28')});}};
\ No newline at end of file
index c6b2f30..06a8ffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaa5=['getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x2aa8ae,_0x10963b){var _0xca728f=function(_0x41c525){while(--_0x41c525){_0x2aa8ae['push'](_0x2aa8ae['shift']());}};_0xca728f(++_0x10963b);}(_0xaaa5,0x12d));var _0x5aaa=function(_0x8c29d4,_0x22fdfe){_0x8c29d4=_0x8c29d4-0x0;var _0x24ff66=_0xaaa5[_0x8c29d4];return _0x24ff66;};'use strict';var express=require(_0x5aaa('0x0'));var router=express[_0x5aaa('0x1')]();var auth=require(_0x5aaa('0x2'));var controller=require(_0x5aaa('0x3'));router[_0x5aaa('0x4')](_0x5aaa('0x5'),auth[_0x5aaa('0x6')](),controller[_0x5aaa('0x7')]);router[_0x5aaa('0x4')](_0x5aaa('0x8'),auth[_0x5aaa('0x6')](),controller[_0x5aaa('0x9')]);module[_0x5aaa('0xa')]=router;
\ No newline at end of file
+var _0xe9b3=['getQueues','exports','Router','/agents','isAuthenticated','getAgents','get','/queues'];(function(_0x2b659a,_0x210043){var _0x39946e=function(_0x3a0e19){while(--_0x3a0e19){_0x2b659a['push'](_0x2b659a['shift']());}};_0x39946e(++_0x210043);}(_0xe9b3,0x72));var _0x3e9b=function(_0x56f40e,_0x1d1b32){_0x56f40e=_0x56f40e-0x0;var _0x1b04a9=_0xe9b3[_0x56f40e];return _0x1b04a9;};'use strict';var express=require('express');var router=express[_0x3e9b('0x0')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get'](_0x3e9b('0x1'),auth[_0x3e9b('0x2')](),controller[_0x3e9b('0x3')]);router[_0x3e9b('0x4')](_0x3e9b('0x5'),auth[_0x3e9b('0x2')](),controller[_0x3e9b('0x6')]);module[_0x3e9b('0x7')]=router;
\ No newline at end of file
index 7963d22..9b41b4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d58=['whatsappPause','every','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','unknown','*pause','getAgents','userpic','lastLoginAt','internal','address','faxPause','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','chatPause','resolve','fieldName','type','key','query','role','getOptions','raw','user','userProfileId','agent','nolimit','sort','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','pauseType','getQueues','chat','sms','openchannel','whatsapp','includes','channel','toLowerCase','Invalid\x20channel','rawAttributes','QueueCampaigns','Queues','UserProfile','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','http','client','offset','undefined','limit','count','status','set','Content-Range','json','stack','name','send','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','pTalking','originated','dialActive','dialMethod','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','find','pick','filter','queue','busy','some','toString','getMembers','length','UserId','accountcode','online','voiceStatus','push','User','Queue','Pause','findAll','idle','ringing','isNil','mailPause','openchannelPause','smsPause','voicePause'];(function(_0xfa75b5,_0x5cbe19){var _0x1c1911=function(_0x1e106c){while(--_0x1e106c){_0xfa75b5['push'](_0xfa75b5['shift']());}};_0x1c1911(++_0x5cbe19);}(_0x6d58,0x17a));var _0x86d5=function(_0x24e9be,_0x20dfad){_0x24e9be=_0x24e9be-0x0;var _0x4b069f=_0x6d58[_0x24e9be];return _0x4b069f;};'use strict';var util=require(_0x86d5('0x0'));var _=require(_0x86d5('0x1'));var jayson=require(_0x86d5('0x2'));var qs=require(_0x86d5('0x3'));var logger=require(_0x86d5('0x4'))(_0x86d5('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x86d5('0x6')]({'port':0x232a});var routingClient=jayson[_0x86d5('0x7')]['http']({'port':0x232c});function respondWithFilteredResult(_0x362b29,_0x873633){return function(_0x178f8a){if(_0x178f8a){var _0x128d21=typeof _0x873633[_0x86d5('0x8')]===_0x86d5('0x9')&&typeof _0x873633[_0x86d5('0xa')]===_0x86d5('0x9');var _0x1d1ad2=_0x178f8a[_0x86d5('0xb')];var _0x56ae41=_0x128d21?0x0:_0x873633[_0x86d5('0x8')];var _0x5f3364=_0x128d21?_0x178f8a[_0x86d5('0xb')]:_0x873633[_0x86d5('0x8')]+_0x873633[_0x86d5('0xa')];var _0xc67176;if(_0x5f3364>=_0x1d1ad2){_0x5f3364=_0x1d1ad2;_0xc67176=0xc8;}else{_0xc67176=0xce;}_0x362b29[_0x86d5('0xc')](_0xc67176);return _0x362b29[_0x86d5('0xd')](_0x86d5('0xe'),_0x56ae41+'-'+_0x5f3364+'/'+_0x1d1ad2)[_0x86d5('0xf')](_0x178f8a);}return null;};}function handleError(_0x1e3c06,_0x539772){_0x539772=_0x539772||0x1f4;return function(_0x14307a){logger['error'](_0x14307a[_0x86d5('0x10')]);if(_0x14307a[_0x86d5('0x11')]){delete _0x14307a[_0x86d5('0x11')];}_0x1e3c06['status'](_0x539772)[_0x86d5('0x12')](_0x14307a);};}function getRealtimeAgents(){return new Promise(function(_0x2329ae,_0x53b300){return amiClient['request']('Agents',{})[_0x86d5('0x13')](function(_0xa90d52){if(_0xa90d52[_0x86d5('0x14')])throw new Error(_0x86d5('0x15'));var _0x579d4b=_0xa90d52[_0x86d5('0x16')];return routingClient[_0x86d5('0x17')](_0x86d5('0x18'),{})['then'](function(_0x32ace7){if(_0x32ace7[_0x86d5('0x14')])throw new Error(_0x86d5('0x19'));var _0x2636e4=_0x32ace7['result'];return _0x2329ae(_[_0x86d5('0x1a')]({},_0x579d4b,_0x2636e4));});})[_0x86d5('0x1b')](function(_0x4ff49b){_0x53b300(_0x4ff49b);});});}function getRealtimeQueues(_0x1251e7,_0x51925b){return new Promise(function(_0x2221a0,_0xdc325c){var _0x546a4c=_0x51925b===_0x86d5('0x1c')?amiClient:routingClient;return _0x546a4c[_0x86d5('0x17')](_[_0x86d5('0x1d')](_0x51925b)+'Queues',_0x1251e7)['then'](function(_0x1c1739){if(_0x1c1739[_0x86d5('0x14')])throw new Error(util[_0x86d5('0x1e')](_0x86d5('0x1f'),_0x51925b));return _0x2221a0(_0x1c1739[_0x86d5('0x16')]);})[_0x86d5('0x1b')](function(_0x3f2755){_0xdc325c(_0x3f2755);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x11e137,_0x2baaae){return amiClient[_0x86d5('0x17')]('VoiceQueuesChannels',{})['then'](function(_0x155563){if(_0x155563[_0x86d5('0x14')])throw new Error(_0x86d5('0x20'));return _0x11e137(_0x155563[_0x86d5('0x16')]);})[_0x86d5('0x1b')](function(_0x57905e){_0x2baaae(_0x57905e);});});}function initializeQueues(_0x42c74c,_0x341972,_0xf4b2f6,_0x3016c0){var _0x361667=[_0x86d5('0x21'),_0x86d5('0x22'),_0x86d5('0x23'),_0x86d5('0x24'),_0x86d5('0x25')];if(_0xf4b2f6===_0x86d5('0x1c')&&_0x3016c0===_0x86d5('0x26')){_0x361667['push'](_0x86d5('0x27'),_0x86d5('0x28'),'message',_0x86d5('0x29'),_0x86d5('0x2a'),'Trunk','startPredictive',_0x86d5('0x2b'),'erlangCalls',_0x86d5('0x2c'),_0x86d5('0x2d'),_0x86d5('0x2e'),_0x86d5('0x2f'),_0x86d5('0x30'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x86d5('0x31'),_0x86d5('0x32'),_0x86d5('0x33'),_0x86d5('0x34'),_0x86d5('0x35'),_0x86d5('0x36'));}return _0x42c74c[_0x86d5('0x37')](function(_0x2e6e67){var _0x12e669=_0x2e6e67[_0x86d5('0x38')]({'plain':!![]});_0x12e669[_0x86d5('0x39')]=[];_0x12e669['paused']=0x0;_0x12e669[_0x86d5('0x3a')]=0x0;_0x12e669[_0x86d5('0x21')]=0x0;_0x12e669[_0x86d5('0x22')]=0x0;_0x12e669['waiting']=0x0;if(_0xf4b2f6==='voice'){_0x12e669['talking']=0x0;_0x12e669['busy']=0x0;if(_0x3016c0===_0x86d5('0x26')){_0x12e669[_0x86d5('0x27')]=0x0;_0x12e669['originated']=0x0;}}var _0x4eab60=_[_0x86d5('0x3b')](_0x341972,['id',_0x12e669['id']]);if(_0x4eab60)_[_0x86d5('0x1a')](_0x12e669,_[_0x86d5('0x3c')](_0x4eab60,_0x361667));return _0x12e669;});}function updateAgentVoiceStatus(_0x51053c,_0x39abdf,_0x61ef86){var _0x4c24da=_[_0x86d5('0x3d')](_0x61ef86,[_0x86d5('0x3e'),_0x39abdf[_0x86d5('0x11')]]);if(_0x4c24da['length']===0x0)return _0x51053c[_0x86d5('0x3f')]=!![];if(_[_0x86d5('0x40')](_0x4c24da,['connectedlinenum',_0x51053c['internal'][_0x86d5('0x41')]()]))return _0x51053c['talking']=!![];if(!_0x51053c['talking'])return _0x51053c[_0x86d5('0x3f')]=!![];}function getVoiceQueueAgents(_0x6ff2e1,_0xc64e84,_0x2f5303,_0x205e5d){var _0x282f5b=_['find'](_0xc64e84,['id',_0x6ff2e1['id']]);if(!_0x282f5b)return _0x6ff2e1;return _0x282f5b[_0x86d5('0x42')]({'raw':!![]})[_0x86d5('0x13')](function(_0x125c34){for(var _0x4e8335=0x0;_0x4e8335<_0x125c34[_0x86d5('0x43')];_0x4e8335++){var _0x556a63=_[_0x86d5('0x3b')](_0x2f5303,['id',_0x125c34[_0x4e8335][_0x86d5('0x44')]]);if(!_0x556a63){_0x556a63={'id':_0x125c34[_0x4e8335][_0x86d5('0x44')],'name':_0x125c34[_0x4e8335][_0x86d5('0x44')],'accountcode':'','online':![]};}var _0x390cab={'id':_0x556a63['id'],'name':_0x556a63['name'],'internal':_0x556a63[_0x86d5('0x45')],'online':Boolean(_0x556a63[_0x86d5('0x46')]),'paused':Boolean(_0x125c34[_0x4e8335][_0x86d5('0x25')])};if(_0x556a63[_0x86d5('0x47')]===_0x86d5('0x24'))updateAgentVoiceStatus(_0x390cab,_0x6ff2e1,_0x205e5d);if(_0x390cab[_0x86d5('0x46')])_0x6ff2e1[_0x86d5('0x3a')]++;if(_0x390cab[_0x86d5('0x3f')])_0x6ff2e1[_0x86d5('0x3f')]++;if(_0x390cab[_0x86d5('0x25')]&&!_0x390cab['busy']&&!_0x390cab[_0x86d5('0x24')])_0x6ff2e1[_0x86d5('0x25')]++;_0x6ff2e1[_0x86d5('0x39')][_0x86d5('0x48')](_0x390cab);}return _0x6ff2e1;});}function getQueueAgents(_0x2c4ebd,_0x26ceeb,_0x4b05ab){var _0x3debb6=_0x86d5('0x49')+_['startCase'](_0x4b05ab)+_0x86d5('0x4a');var _0x8be14d=_0x4b05ab+_0x86d5('0x4b');return db[_0x3debb6][_0x86d5('0x4c')]({'where':{[_[_0x86d5('0x1d')](_0x4b05ab)+'QueueId']:_0x2c4ebd['id']},'raw':!![]})['then'](function(_0x631b33){for(var _0x4b534d=0x0;_0x4b534d<_0x631b33[_0x86d5('0x43')];_0x4b534d++){var _0x3f4a91=_[_0x86d5('0x3b')](_0x26ceeb,['id',_0x631b33[_0x4b534d][_0x86d5('0x44')]]);if(!_0x3f4a91){_0x3f4a91={'id':_0x631b33[_0x4b534d][_0x86d5('0x44')],'name':_0x631b33[_0x4b534d][_0x86d5('0x44')],'online':![],['pauseField']:![]};}var _0x255c45={'id':_0x3f4a91['id'],'name':_0x3f4a91[_0x86d5('0x11')],'online':Boolean(_0x3f4a91['online']),'paused':Boolean(_0x3f4a91[_0x8be14d])};if(_0x255c45[_0x86d5('0x46')])_0x2c4ebd[_0x86d5('0x3a')]++;_0x2c4ebd['agents'][_0x86d5('0x48')](_0x255c45);}return _0x2c4ebd;});}function isIdle(_0x237564){return _0x237564===_0x86d5('0x4d')||_0x237564==='unknown'||_0x237564==='unavailable'||_0x237564===_0x86d5('0x4e')||_[_0x86d5('0x4f')](_0x237564);}function isAgentPaused(_0x5e959f,_0x7890e6){var _0x6e4a61=[_0x5e959f['chatPause'],_0x5e959f['faxPause'],_0x5e959f[_0x86d5('0x50')],_0x5e959f[_0x86d5('0x51')],_0x5e959f[_0x86d5('0x52')],_0x5e959f[_0x86d5('0x53')],_0x5e959f[_0x86d5('0x54')]];if(!_0x7890e6)return _[_0x86d5('0x55')](_0x6e4a61);var _0x4255ad=_[_0x86d5('0x3d')](_0x6e4a61);return _0x4255ad['length']>0x0&&_0x4255ad[_0x86d5('0x43')]<_0x6e4a61[_0x86d5('0x43')]?!![]:![];}function isAgentIdle(_0xfd1b9f){if(_0xfd1b9f[_0x86d5('0x47')]!==_0x86d5('0x4d')&&_0xfd1b9f['voicePause']){_0xfd1b9f[_0x86d5('0x47')]=_0x86d5('0x56');return![];}return _[_0x86d5('0x55')]([_0xfd1b9f[_0x86d5('0x57')],_0xfd1b9f['faxStatus'],_0xfd1b9f[_0x86d5('0x58')],_0xfd1b9f[_0x86d5('0x59')],_0xfd1b9f[_0x86d5('0x5a')],_0xfd1b9f[_0x86d5('0x47')],_0xfd1b9f[_0x86d5('0x5b')]],isIdle);}function getAgentStatus(_0x3ecf8b){var _0x4b5ed8=_0x86d5('0x5c');if(isAgentPaused(_0x3ecf8b))_0x4b5ed8=_0x86d5('0x56');else if(isAgentPaused(_0x3ecf8b,!![]))_0x4b5ed8=_0x86d5('0x5d');else if(isAgentIdle(_0x3ecf8b))_0x4b5ed8=_0x86d5('0x4d');else _0x4b5ed8='busy';return _0x4b5ed8;}exports[_0x86d5('0x5e')]=function(_0x38dfdb,_0x3f3521){var _0x437e19={'count':0x0,'rows':[]},_0x323d77={},_0x339f4d,_0x489f57,_0xca1621=[_0x86d5('0x5f'),'online',_0x86d5('0x60'),'lastPauseAt','pauseType','lastPauseAt',_0x86d5('0x61'),_0x86d5('0x62'),'chatPause',_0x86d5('0x51'),_0x86d5('0x50'),_0x86d5('0x52'),_0x86d5('0x54'),_0x86d5('0x63'),_0x86d5('0x53'),_0x86d5('0x64'),_0x86d5('0x65'),'mailCapacity',_0x86d5('0x66'),_0x86d5('0x67'),'faxCapacity',_0x86d5('0x68'),_0x86d5('0x69'),'mailCurrentCapacity',_0x86d5('0x6a'),_0x86d5('0x6b'),_0x86d5('0x6c'),_0x86d5('0x57'),_0x86d5('0x59'),_0x86d5('0x58'),_0x86d5('0x5a'),_0x86d5('0x5b'),'faxStatus','voiceStatus','chatStatusTime',_0x86d5('0x6d'),_0x86d5('0x6e'),_0x86d5('0x6f'),_0x86d5('0x70'),_0x86d5('0x71'),_0x86d5('0x72'),_0x86d5('0x3e'),_0x86d5('0x73'),_0x86d5('0x74'),'phoneBarEnableScreenRecordingByAgent',_0x86d5('0x75'),_0x86d5('0x76')],_0x90701f=[_0x86d5('0x77'),'openchannelPause',_0x86d5('0x50'),_0x86d5('0x52'),_0x86d5('0x54'),'faxPause',_0x86d5('0x53'),_0x86d5('0x46')];Promise[_0x86d5('0x78')]()['then'](function(){var _0x14d25f=_[_0x86d5('0x37')](db[_0x86d5('0x49')]['rawAttributes'],function(_0xbf85fd){return{'name':_0xbf85fd[_0x86d5('0x79')],'type':_0xbf85fd[_0x86d5('0x7a')][_0x86d5('0x7b')]};});_0x38dfdb[_0x86d5('0x7c')][_0x86d5('0x7d')]='agent';_0x38dfdb['query'][_0x86d5('0x46')]=!![];_0x323d77=qs[_0x86d5('0x7e')](_0x14d25f,_0x38dfdb);_0x323d77[_0x86d5('0x7f')]=!![];if(_0x38dfdb['user'][_0x86d5('0x7d')]===_0x86d5('0x80')){var _0x379911={'params':{'id':_0x38dfdb[_0x86d5('0x80')][_0x86d5('0x81')]},'query':{'section':_0x86d5('0x18'),'role':_0x86d5('0x82'),'online':!![],'nolimit':_0x38dfdb['query'][_0x86d5('0x83')],'sort':_0x38dfdb[_0x86d5('0x7c')][_0x86d5('0x84')],'filter':_0x38dfdb[_0x86d5('0x7c')][_0x86d5('0x3d')]},'raw':!![]};return db['UserProfile'][_0x86d5('0x85')](_0x379911);}return db[_0x86d5('0x49')][_0x86d5('0x86')](_0x323d77);})['then'](function(_0x28cc08){_0x437e19['count']=_0x28cc08[_0x86d5('0xb')];_0x339f4d=_0x28cc08[_0x86d5('0x87')];return getRealtimeAgents();})['then'](function(_0x187a03){_0x489f57=_0x187a03[_0x86d5('0x87')];return _0x339f4d[_0x86d5('0x37')](function(_0x55ee70){var _0x4a3e96=_[_0x86d5('0x3b')](_0x489f57,['id',_0x55ee70['id']]);if(_0x4a3e96)_['merge'](_0x55ee70,_[_0x86d5('0x3c')](_[_0x86d5('0x88')](_0x4a3e96,_0x90701f),_0xca1621));_0x55ee70[_0x86d5('0x89')]=getAgentStatus(_0x55ee70);return _0x55ee70;});})['then'](function(_0x436754){if(_0x38dfdb[_0x86d5('0x7c')][_0x86d5('0x8a')]){var _0x446786=_[_0x86d5('0x3d')](_0x436754,[_0x86d5('0x89'),_0x38dfdb['query'][_0x86d5('0x8a')]]);if(_0x38dfdb['query'][_0x86d5('0x8b')]){_0x446786=_[_0x86d5('0x3d')](_0x446786,[_0x86d5('0x8c'),_0x38dfdb['query'][_0x86d5('0x8b')]]);}}_0x437e19[_0x86d5('0x87')]=_0x446786||_0x436754;return _0x437e19;})['then'](respondWithFilteredResult(_0x3f3521,_0x323d77))[_0x86d5('0x1b')](handleError(_0x3f3521,null));};exports[_0x86d5('0x8d')]=function(_0x334266,_0x201130){var _0x363646=['mail',_0x86d5('0x8e'),_0x86d5('0x8f'),_0x86d5('0x90'),'fax',_0x86d5('0x91'),_0x86d5('0x1c')];var _0x250d7f={'count':0x0,'rows':[]},_0x1787ce={},_0x15267c,_0x36bf28,_0x5a330a,_0x3d53bc,_0x3d3975;Promise['resolve']()[_0x86d5('0x13')](function(){if(_0x334266[_0x86d5('0x7c')]['channel']){if(!_[_0x86d5('0x92')](_0x363646,_0x334266[_0x86d5('0x7c')][_0x86d5('0x93')][_0x86d5('0x94')]()))throw new Error(_0x86d5('0x95'));_0x15267c=_0x334266[_0x86d5('0x7c')][_0x86d5('0x93')]['toLowerCase']();}var _0x10e634=_[_0x86d5('0x1d')](_0x15267c)+_0x86d5('0x4a');var _0x3522c4=_[_0x86d5('0x37')](db[_0x10e634][_0x86d5('0x96')],function(_0x489d50){return{'name':_0x489d50[_0x86d5('0x79')],'type':_0x489d50[_0x86d5('0x7a')][_0x86d5('0x7b')]};});_0x1787ce=qs[_0x86d5('0x7e')](_0x3522c4,_0x334266);if(_0x334266[_0x86d5('0x80')][_0x86d5('0x7d')]===_0x86d5('0x80')){var _0x1882db={'params':{'id':_0x334266[_0x86d5('0x80')][_0x86d5('0x81')]},'query':{'section':_0x15267c==='voice'&&_0x334266[_0x86d5('0x7c')][_0x86d5('0x7a')]===_0x86d5('0x26')?_0x86d5('0x97'):_['startCase'](_0x15267c)+_0x86d5('0x98'),'type':_0x334266[_0x86d5('0x7c')][_0x86d5('0x7a')],'nolimit':!![],'sort':_0x86d5('0x11'),'filter':_0x334266[_0x86d5('0x7c')][_0x86d5('0x3d')]}};return db[_0x86d5('0x99')][_0x86d5('0x85')](_0x1882db);}return db[_0x10e634][_0x86d5('0x86')](_0x1787ce);})[_0x86d5('0x13')](function(_0x33b1bb){_0x250d7f[_0x86d5('0xb')]=_0x33b1bb[_0x86d5('0xb')];_0x36bf28=_0x33b1bb[_0x86d5('0x87')];return getRealtimeQueues(_0x334266,_0x15267c);})['then'](function(_0x172417){_0x3d53bc=_0x172417['rows'];return getRealtimeAgents();})[_0x86d5('0x13')](function(_0x5dec4e){_0x5a330a=_0x5dec4e[_0x86d5('0x87')];if(_0x15267c!=_0x86d5('0x1c'))return;return getRealtimeVoiceQueueChannels();})[_0x86d5('0x13')](function(_0x4e6101){_0x3d3975=_0x4e6101?_0x4e6101['rows']:[];return initializeQueues(_0x36bf28,_0x3d53bc,_0x15267c,_0x334266[_0x86d5('0x7c')]['type']);})['then'](function(_0x5b3398){var _0x1e4cfe=_0x5b3398[_0x86d5('0x37')](function(_0x425cb9){if(_0x15267c===_0x86d5('0x1c'))return getVoiceQueueAgents(_0x425cb9,_0x36bf28,_0x5a330a,_0x3d3975);else return getQueueAgents(_0x425cb9,_0x5a330a,_0x15267c);});return Promise['all'](_0x1e4cfe);})[_0x86d5('0x13')](function(_0x447f8d){_0x250d7f[_0x86d5('0x87')]=_0x447f8d;return _0x250d7f;})['then'](respondWithFilteredResult(_0x201130,_0x1787ce))[_0x86d5('0x1b')](handleError(_0x201130,null));};
\ No newline at end of file
+var _0x6d23=['Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','map','get','agents','busy','pick','filter','queue','some','connectedlinenum','internal','find','length','UserId','accountcode','online','voiceStatus','loggedInDb','User','Queue','Pause','findAll','QueueId','unknown','unavailable','ringing','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','idle','userpic','lastLoginAt','lastPauseAt','pauseType','address','openchannelPause','chatCapacity','mailCapacity','chatCurrentCapacity','openchannelCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','fieldName','query','agent','getOptions','raw','user','role','userProfileId','sort','UserProfile','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','chat','openchannel','fax','whatsapp','includes','channel','toLowerCase','Invalid\x20channel','type','key','QueueCampaigns','Queues','getResources','all','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','status','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive'];(function(_0x319e1c,_0x3b4634){var _0x49c88d=function(_0x4574cb){while(--_0x4574cb){_0x319e1c['push'](_0x319e1c['shift']());}};_0x49c88d(++_0x3b4634);}(_0x6d23,0x6b));var _0x36d2=function(_0x4e3638,_0x105cdf){_0x4e3638=_0x4e3638-0x0;var _0x589559=_0x6d23[_0x4e3638];return _0x589559;};'use strict';var util=require(_0x36d2('0x0'));var _=require(_0x36d2('0x1'));var jayson=require('jayson/promise');var qs=require(_0x36d2('0x2'));var logger=require(_0x36d2('0x3'))(_0x36d2('0x4'));var db=require(_0x36d2('0x5'))['db'];var amiClient=jayson[_0x36d2('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0x36d2('0x6')][_0x36d2('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x5cddbf,_0x7e13ef){return function(_0x584992){if(_0x584992){var _0x3909b4=typeof _0x7e13ef['offset']===_0x36d2('0x8')&&typeof _0x7e13ef[_0x36d2('0x9')]===_0x36d2('0x8');var _0x11619b=_0x584992[_0x36d2('0xa')];var _0x301f4f=_0x3909b4?0x0:_0x7e13ef['offset'];var _0x1e0053=_0x3909b4?_0x584992[_0x36d2('0xa')]:_0x7e13ef[_0x36d2('0xb')]+_0x7e13ef['limit'];var _0x47c769;if(_0x1e0053>=_0x11619b){_0x1e0053=_0x11619b;_0x47c769=0xc8;}else{_0x47c769=0xce;}_0x5cddbf[_0x36d2('0xc')](_0x47c769);return _0x5cddbf['set'](_0x36d2('0xd'),_0x301f4f+'-'+_0x1e0053+'/'+_0x11619b)[_0x36d2('0xe')](_0x584992);}return null;};}function handleError(_0x268bd9,_0x52cf9d){_0x52cf9d=_0x52cf9d||0x1f4;return function(_0x365dce){logger[_0x36d2('0xf')](_0x365dce[_0x36d2('0x10')]);if(_0x365dce['name']){delete _0x365dce[_0x36d2('0x11')];}_0x268bd9[_0x36d2('0xc')](_0x52cf9d)[_0x36d2('0x12')](_0x365dce);};}function getRealtimeAgents(){return new Promise(function(_0x569e43,_0x5d11fd){return amiClient[_0x36d2('0x13')](_0x36d2('0x14'),{})[_0x36d2('0x15')](function(_0xe28140){if(_0xe28140[_0x36d2('0xf')])throw new Error(_0x36d2('0x16'));var _0x5d82da=_0xe28140[_0x36d2('0x17')];return routingClient['request'](_0x36d2('0x14'),{})[_0x36d2('0x15')](function(_0x110838){if(_0x110838['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0xe50b3b=_0x110838[_0x36d2('0x17')];return _0x569e43(_[_0x36d2('0x18')]({},_0x5d82da,_0xe50b3b));});})['catch'](function(_0x4dfa64){_0x5d11fd(_0x4dfa64);});});}function getRealtimeQueues(_0xc15cdd,_0x5e286b){return new Promise(function(_0x195148,_0x3c15a8){var _0x210c94=_0x5e286b===_0x36d2('0x19')?amiClient:routingClient;return _0x210c94[_0x36d2('0x13')](_[_0x36d2('0x1a')](_0x5e286b)+'Queues',_0xc15cdd)[_0x36d2('0x15')](function(_0x2892a4){if(_0x2892a4[_0x36d2('0xf')])throw new Error(util[_0x36d2('0x1b')](_0x36d2('0x1c'),_0x5e286b));return _0x195148(_0x2892a4[_0x36d2('0x17')]);})[_0x36d2('0x1d')](function(_0x45551e){_0x3c15a8(_0x45551e);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4711ed,_0x437f2f){return amiClient[_0x36d2('0x13')](_0x36d2('0x1e'),{})[_0x36d2('0x15')](function(_0x256216){if(_0x256216[_0x36d2('0xf')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x4711ed(_0x256216[_0x36d2('0x17')]);})[_0x36d2('0x1d')](function(_0x447ac8){_0x437f2f(_0x447ac8);});});}function initializeQueues(_0x4bf23a,_0x53dbc2,_0x2ddaed,_0x216423){var _0x5c145f=[_0x36d2('0x1f'),_0x36d2('0x20'),_0x36d2('0x21'),_0x36d2('0x22'),_0x36d2('0x23')];if(_0x2ddaed===_0x36d2('0x19')&&_0x216423===_0x36d2('0x24')){_0x5c145f[_0x36d2('0x25')](_0x36d2('0x26'),_0x36d2('0x27'),_0x36d2('0x28'),_0x36d2('0x29'),'dialMethod',_0x36d2('0x2a'),_0x36d2('0x2b'),_0x36d2('0x2c'),_0x36d2('0x2d'),_0x36d2('0x2e'),_0x36d2('0x2f'),_0x36d2('0x30'),_0x36d2('0x31'),'dialPredictiveIntervalMaxThreshold',_0x36d2('0x32'),_0x36d2('0x33'),_0x36d2('0x34'),_0x36d2('0x35'),_0x36d2('0x36'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x36d2('0x37'));}return _0x4bf23a[_0x36d2('0x38')](function(_0x1135c8){var _0x249bba=_0x1135c8[_0x36d2('0x39')]({'plain':!![]});_0x249bba[_0x36d2('0x3a')]=[];_0x249bba['paused']=0x0;_0x249bba['loggedInDb']=0x0;_0x249bba[_0x36d2('0x1f')]=0x0;_0x249bba[_0x36d2('0x20')]=0x0;_0x249bba[_0x36d2('0x21')]=0x0;if(_0x2ddaed===_0x36d2('0x19')){_0x249bba[_0x36d2('0x22')]=0x0;_0x249bba[_0x36d2('0x3b')]=0x0;if(_0x216423===_0x36d2('0x24')){_0x249bba[_0x36d2('0x26')]=0x0;_0x249bba['originated']=0x0;}}var _0x408deb=_['find'](_0x53dbc2,['id',_0x249bba['id']]);if(_0x408deb)_[_0x36d2('0x18')](_0x249bba,_[_0x36d2('0x3c')](_0x408deb,_0x5c145f));return _0x249bba;});}function updateAgentVoiceStatus(_0x31f0a8,_0x5c3179,_0x5f26e4){var _0x4cf774=_[_0x36d2('0x3d')](_0x5f26e4,[_0x36d2('0x3e'),_0x5c3179[_0x36d2('0x11')]]);if(_0x4cf774['length']===0x0)return _0x31f0a8[_0x36d2('0x3b')]=!![];if(_[_0x36d2('0x3f')](_0x4cf774,[_0x36d2('0x40'),_0x31f0a8[_0x36d2('0x41')]['toString']()]))return _0x31f0a8['talking']=!![];if(!_0x31f0a8['talking'])return _0x31f0a8[_0x36d2('0x3b')]=!![];}function getVoiceQueueAgents(_0xbcea9b,_0x5076f4,_0x31a978,_0x4825b1){var _0x33a9de=_[_0x36d2('0x42')](_0x5076f4,['id',_0xbcea9b['id']]);if(!_0x33a9de)return _0xbcea9b;return _0x33a9de['getMembers']({'raw':!![]})[_0x36d2('0x15')](function(_0x53278e){for(var _0x1d0777=0x0;_0x1d0777<_0x53278e[_0x36d2('0x43')];_0x1d0777++){var _0x2e17c4=_['find'](_0x31a978,['id',_0x53278e[_0x1d0777]['UserId']]);if(!_0x2e17c4){_0x2e17c4={'id':_0x53278e[_0x1d0777][_0x36d2('0x44')],'name':_0x53278e[_0x1d0777][_0x36d2('0x44')],'accountcode':'','online':![]};}var _0xf9d2b0={'id':_0x2e17c4['id'],'name':_0x2e17c4[_0x36d2('0x11')],'internal':_0x2e17c4[_0x36d2('0x45')],'online':Boolean(_0x2e17c4[_0x36d2('0x46')]),'paused':Boolean(_0x53278e[_0x1d0777][_0x36d2('0x23')])};if(_0x2e17c4[_0x36d2('0x47')]==='talking')updateAgentVoiceStatus(_0xf9d2b0,_0xbcea9b,_0x4825b1);if(_0xf9d2b0[_0x36d2('0x46')])_0xbcea9b[_0x36d2('0x48')]++;if(_0xf9d2b0[_0x36d2('0x3b')])_0xbcea9b[_0x36d2('0x3b')]++;if(_0xf9d2b0[_0x36d2('0x23')]&&!_0xf9d2b0['busy']&&!_0xf9d2b0[_0x36d2('0x22')])_0xbcea9b[_0x36d2('0x23')]++;_0xbcea9b[_0x36d2('0x3a')][_0x36d2('0x25')](_0xf9d2b0);}return _0xbcea9b;});}function getQueueAgents(_0x268858,_0x2b6f9b,_0x2a0e8c){var _0x3ec89a=_0x36d2('0x49')+_[_0x36d2('0x1a')](_0x2a0e8c)+_0x36d2('0x4a');var _0x333b62=_0x2a0e8c+_0x36d2('0x4b');return db[_0x3ec89a][_0x36d2('0x4c')]({'where':{[_[_0x36d2('0x1a')](_0x2a0e8c)+_0x36d2('0x4d')]:_0x268858['id']},'raw':!![]})[_0x36d2('0x15')](function(_0x4064bd){for(var _0x5f36db=0x0;_0x5f36db<_0x4064bd[_0x36d2('0x43')];_0x5f36db++){var _0x2c641d=_[_0x36d2('0x42')](_0x2b6f9b,['id',_0x4064bd[_0x5f36db][_0x36d2('0x44')]]);if(!_0x2c641d){_0x2c641d={'id':_0x4064bd[_0x5f36db][_0x36d2('0x44')],'name':_0x4064bd[_0x5f36db][_0x36d2('0x44')],'online':![],['pauseField']:![]};}var _0x9631ea={'id':_0x2c641d['id'],'name':_0x2c641d[_0x36d2('0x11')],'online':Boolean(_0x2c641d[_0x36d2('0x46')]),'paused':Boolean(_0x2c641d[_0x333b62])};if(_0x9631ea[_0x36d2('0x46')])_0x268858[_0x36d2('0x48')]++;_0x268858[_0x36d2('0x3a')][_0x36d2('0x25')](_0x9631ea);}return _0x268858;});}function isIdle(_0x3102fd){return _0x3102fd==='idle'||_0x3102fd===_0x36d2('0x4e')||_0x3102fd===_0x36d2('0x4f')||_0x3102fd===_0x36d2('0x50')||_['isNil'](_0x3102fd);}function isAgentPaused(_0x4436e4,_0xe69cdc){var _0xd8190b=[_0x4436e4[_0x36d2('0x51')],_0x4436e4[_0x36d2('0x52')],_0x4436e4[_0x36d2('0x53')],_0x4436e4['openchannelPause'],_0x4436e4[_0x36d2('0x54')],_0x4436e4[_0x36d2('0x55')],_0x4436e4[_0x36d2('0x56')]];if(!_0xe69cdc)return _[_0x36d2('0x57')](_0xd8190b);var _0xd070b7=_[_0x36d2('0x3d')](_0xd8190b);return _0xd070b7[_0x36d2('0x43')]>0x0&&_0xd070b7[_0x36d2('0x43')]<_0xd8190b[_0x36d2('0x43')]?!![]:![];}function isAgentIdle(_0x401ccb){if(_0x401ccb[_0x36d2('0x47')]!=='idle'&&_0x401ccb[_0x36d2('0x55')]){_0x401ccb['voiceStatus']=_0x36d2('0x58');return![];}return _[_0x36d2('0x57')]([_0x401ccb[_0x36d2('0x59')],_0x401ccb[_0x36d2('0x5a')],_0x401ccb['mailStatus'],_0x401ccb[_0x36d2('0x5b')],_0x401ccb[_0x36d2('0x5c')],_0x401ccb[_0x36d2('0x47')],_0x401ccb[_0x36d2('0x5d')]],isIdle);}function getAgentStatus(_0x27fb4f){var _0x337e35=_0x36d2('0x4e');if(isAgentPaused(_0x27fb4f))_0x337e35=_0x36d2('0x58');else if(isAgentPaused(_0x27fb4f,!![]))_0x337e35=_0x36d2('0x5e');else if(isAgentIdle(_0x27fb4f))_0x337e35=_0x36d2('0x5f');else _0x337e35=_0x36d2('0x3b');return _0x337e35;}exports['getAgents']=function(_0x2ad2bb,_0x3f5048){var _0x44497a={'count':0x0,'rows':[]},_0x121c70={},_0x48740e,_0x5161e5,_0x129f76=[_0x36d2('0x60'),_0x36d2('0x46'),_0x36d2('0x61'),_0x36d2('0x62'),_0x36d2('0x63'),'lastPauseAt','internal',_0x36d2('0x64'),_0x36d2('0x51'),_0x36d2('0x65'),_0x36d2('0x53'),'smsPause',_0x36d2('0x56'),'faxPause','voicePause',_0x36d2('0x66'),'openchannelCapacity',_0x36d2('0x67'),'smsCapacity','whatsappCapacity','faxCapacity',_0x36d2('0x68'),_0x36d2('0x69'),'mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity',_0x36d2('0x6a'),_0x36d2('0x59'),'openchannelStatus',_0x36d2('0x6b'),_0x36d2('0x5c'),_0x36d2('0x5d'),_0x36d2('0x5a'),_0x36d2('0x47'),_0x36d2('0x6c'),_0x36d2('0x6d'),_0x36d2('0x6e'),'smsStatusTime',_0x36d2('0x6f'),_0x36d2('0x70'),'voiceStatusTime',_0x36d2('0x3e'),_0x36d2('0x71'),_0x36d2('0x72'),_0x36d2('0x73'),_0x36d2('0x74'),_0x36d2('0x75')],_0x570ecc=[_0x36d2('0x51'),_0x36d2('0x65'),'mailPause',_0x36d2('0x54'),_0x36d2('0x56'),_0x36d2('0x52'),'voicePause','online'];Promise[_0x36d2('0x76')]()[_0x36d2('0x15')](function(){var _0x5dc023=_[_0x36d2('0x38')](db['User']['rawAttributes'],function(_0x55774d){return{'name':_0x55774d[_0x36d2('0x77')],'type':_0x55774d['type']['key']};});_0x2ad2bb[_0x36d2('0x78')]['role']=_0x36d2('0x79');_0x2ad2bb[_0x36d2('0x78')][_0x36d2('0x46')]=!![];_0x121c70=qs[_0x36d2('0x7a')](_0x5dc023,_0x2ad2bb);_0x121c70[_0x36d2('0x7b')]=!![];if(_0x2ad2bb[_0x36d2('0x7c')][_0x36d2('0x7d')]===_0x36d2('0x7c')){var _0x267983={'params':{'id':_0x2ad2bb['user'][_0x36d2('0x7e')]},'query':{'section':'Agents','role':_0x36d2('0x79'),'online':!![],'nolimit':_0x2ad2bb[_0x36d2('0x78')]['nolimit'],'sort':_0x2ad2bb[_0x36d2('0x78')][_0x36d2('0x7f')],'filter':_0x2ad2bb['query'][_0x36d2('0x3d')]},'raw':!![]};return db[_0x36d2('0x80')]['getResources'](_0x267983);}return db[_0x36d2('0x49')][_0x36d2('0x81')](_0x121c70);})[_0x36d2('0x15')](function(_0x4a4343){_0x44497a[_0x36d2('0xa')]=_0x4a4343[_0x36d2('0xa')];_0x48740e=_0x4a4343['rows'];return getRealtimeAgents();})[_0x36d2('0x15')](function(_0x22768f){_0x5161e5=_0x22768f[_0x36d2('0x82')];return _0x48740e[_0x36d2('0x38')](function(_0x4d001c){var _0x250a7d=_[_0x36d2('0x42')](_0x5161e5,['id',_0x4d001c['id']]);if(_0x250a7d)_[_0x36d2('0x18')](_0x4d001c,_['pick'](_[_0x36d2('0x83')](_0x250a7d,_0x570ecc),_0x129f76));_0x4d001c[_0x36d2('0x84')]=getAgentStatus(_0x4d001c);return _0x4d001c;});})[_0x36d2('0x15')](function(_0x53972f){if(_0x2ad2bb['query']['globalStatusFilter']){var _0x6264a3=_[_0x36d2('0x3d')](_0x53972f,['globalStatus',_0x2ad2bb[_0x36d2('0x78')][_0x36d2('0x85')]]);if(_0x2ad2bb[_0x36d2('0x78')][_0x36d2('0x86')]){_0x6264a3=_[_0x36d2('0x3d')](_0x6264a3,[_0x36d2('0x63'),_0x2ad2bb[_0x36d2('0x78')][_0x36d2('0x86')]]);}}_0x44497a[_0x36d2('0x82')]=_0x6264a3||_0x53972f;return _0x44497a;})[_0x36d2('0x15')](respondWithFilteredResult(_0x3f5048,_0x121c70))[_0x36d2('0x1d')](handleError(_0x3f5048,null));};exports['getQueues']=function(_0x52b529,_0x4bd7ef){var _0x5a52a5=['mail',_0x36d2('0x87'),'sms',_0x36d2('0x88'),_0x36d2('0x89'),_0x36d2('0x8a'),_0x36d2('0x19')];var _0x59c4e6={'count':0x0,'rows':[]},_0x3d65a1={},_0x980bb,_0x24fdff,_0x4bc00b,_0x4bc286,_0x200db8;Promise[_0x36d2('0x76')]()[_0x36d2('0x15')](function(){if(_0x52b529[_0x36d2('0x78')]['channel']){if(!_[_0x36d2('0x8b')](_0x5a52a5,_0x52b529[_0x36d2('0x78')][_0x36d2('0x8c')][_0x36d2('0x8d')]()))throw new Error(_0x36d2('0x8e'));_0x980bb=_0x52b529[_0x36d2('0x78')]['channel'][_0x36d2('0x8d')]();}var _0x334173=_[_0x36d2('0x1a')](_0x980bb)+_0x36d2('0x4a');var _0x1d5ec9=_[_0x36d2('0x38')](db[_0x334173]['rawAttributes'],function(_0xc9f2d9){return{'name':_0xc9f2d9['fieldName'],'type':_0xc9f2d9[_0x36d2('0x8f')][_0x36d2('0x90')]};});_0x3d65a1=qs['getOptions'](_0x1d5ec9,_0x52b529);if(_0x52b529[_0x36d2('0x7c')]['role']===_0x36d2('0x7c')){var _0x4b9c68={'params':{'id':_0x52b529[_0x36d2('0x7c')]['userProfileId']},'query':{'section':_0x980bb===_0x36d2('0x19')&&_0x52b529[_0x36d2('0x78')][_0x36d2('0x8f')]==='outbound'?_0x36d2('0x91'):_[_0x36d2('0x1a')](_0x980bb)+_0x36d2('0x92'),'type':_0x52b529[_0x36d2('0x78')][_0x36d2('0x8f')],'nolimit':!![],'sort':'name','filter':_0x52b529[_0x36d2('0x78')][_0x36d2('0x3d')]}};return db[_0x36d2('0x80')][_0x36d2('0x93')](_0x4b9c68);}return db[_0x334173][_0x36d2('0x81')](_0x3d65a1);})['then'](function(_0x43c43a){_0x59c4e6[_0x36d2('0xa')]=_0x43c43a['count'];_0x24fdff=_0x43c43a[_0x36d2('0x82')];return getRealtimeQueues(_0x52b529,_0x980bb);})[_0x36d2('0x15')](function(_0x2ec67d){_0x4bc286=_0x2ec67d[_0x36d2('0x82')];return getRealtimeAgents();})[_0x36d2('0x15')](function(_0xf8fb11){_0x4bc00b=_0xf8fb11[_0x36d2('0x82')];if(_0x980bb!=_0x36d2('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0x36d2('0x15')](function(_0x47ef1f){_0x200db8=_0x47ef1f?_0x47ef1f[_0x36d2('0x82')]:[];return initializeQueues(_0x24fdff,_0x4bc286,_0x980bb,_0x52b529[_0x36d2('0x78')][_0x36d2('0x8f')]);})[_0x36d2('0x15')](function(_0x28bf5e){var _0xeb290a=_0x28bf5e[_0x36d2('0x38')](function(_0x2d3706){if(_0x980bb===_0x36d2('0x19'))return getVoiceQueueAgents(_0x2d3706,_0x24fdff,_0x4bc00b,_0x200db8);else return getQueueAgents(_0x2d3706,_0x4bc00b,_0x980bb);});return Promise[_0x36d2('0x94')](_0xeb290a);})['then'](function(_0x309641){_0x59c4e6[_0x36d2('0x82')]=_0x309641;return _0x59c4e6;})[_0x36d2('0x15')](respondWithFilteredResult(_0x4bd7ef,_0x3d65a1))[_0x36d2('0x1d')](handleError(_0x4bd7ef,null));};
\ No newline at end of file
index 8460336..3ffadc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5bd804,_0x5dfaf3){var _0x43e2c0=function(_0x3850e1){while(--_0x3850e1){_0x5bd804['push'](_0x5bd804['shift']());}};_0x43e2c0(++_0x5dfaf3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0xcb91[_0x4b9978];return _0x42f0e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x52ded2,_0x12f434){var _0x2675fc=function(_0x5d5761){while(--_0x5d5761){_0x52ded2['push'](_0x52ded2['shift']());}};_0x2675fc(++_0x12f434);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index af0aabb..93d759c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca9=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ca9,0x9c));var _0x98ca=function(_0x303893,_0x568e45){_0x303893=_0x303893-0x0;var _0x14a86a=_0x8ca9[_0x303893];return _0x14a86a;};'use strict';var Sequelize=require(_0x98ca('0x0'));module[_0x98ca('0x1')]={'state':{'type':Sequelize[_0x98ca('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x98ca('0x3')]},'scheduledat':{'type':Sequelize[_0x98ca('0x4')]},'uniqueid':{'type':Sequelize[_0x98ca('0x3')]},'starttime':{'type':Sequelize[_0x98ca('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x98ca('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x98ca('0x3')]}};
\ No newline at end of file
+var _0x0dd6=['DATE','INTEGER','STRING'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x0dd6,0xca));var _0x60dd=function(_0x4cb213,_0x2b29d3){_0x4cb213=_0x4cb213-0x0;var _0x2a9c7b=_0x0dd6[_0x4cb213];return _0x2a9c7b;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x60dd('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x60dd('0x1')]},'scheduledat':{'type':Sequelize[_0x60dd('0x2')]},'uniqueid':{'type':Sequelize[_0x60dd('0x1')]},'starttime':{'type':Sequelize[_0x60dd('0x2')]},'responsetime':{'type':Sequelize[_0x60dd('0x2')]},'ringtime':{'type':Sequelize[_0x60dd('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x60dd('0x1')]},'campaigntype':{'type':Sequelize[_0x60dd('0x1')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fc49d7b..986d530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4601=['../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x473a79,_0x5e608b){var _0x5a91b3=function(_0x302411){while(--_0x302411){_0x473a79['push'](_0x473a79['shift']());}};_0x5a91b3(++_0x5e608b);}(_0x4601,0x154));var _0x1460=function(_0x442230,_0x1ecad1){_0x442230=_0x442230-0x0;var _0x5673ac=_0x4601[_0x442230];return _0x5673ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1460('0x0'))(_0x1460('0x1'));var moment=require('moment');var BPromise=require(_0x1460('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1460('0x3'));var rimraf=require('rimraf');var config=require(_0x1460('0x4'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x1d1847,_0x5b5f6b){return _0x1d1847['define']('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9d0=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','../../config/logger','api','request-promise'];(function(_0x168a40,_0x5e9d63){var _0x1a9f3c=function(_0x5982ec){while(--_0x5982ec){_0x168a40['push'](_0x168a40['shift']());}};_0x1a9f3c(++_0x5e9d63);}(_0xa9d0,0xc2));var _0x0a9d=function(_0x8e7d1f,_0x3103ab){_0x8e7d1f=_0x8e7d1f-0x0;var _0x459348=_0xa9d0[_0x8e7d1f];return _0x459348;};'use strict';var _=require(_0x0a9d('0x0'));var util=require('util');var logger=require(_0x0a9d('0x1'))(_0x0a9d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a9d('0x3'));var fs=require('fs');var path=require(_0x0a9d('0x4'));var rimraf=require(_0x0a9d('0x5'));var config=require(_0x0a9d('0x6'));var attributes=require(_0x0a9d('0x7'));module[_0x0a9d('0x8')]=function(_0x1b5358,_0x19112d){return _0x1b5358[_0x0a9d('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x0a9d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5b05268..54269da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f23=['create','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ReportAgentPreview'];(function(_0x586c03,_0x58e318){var _0x1e934d=function(_0x379d0c){while(--_0x379d0c){_0x586c03['push'](_0x586c03['shift']());}};_0x1e934d(++_0x58e318);}(_0x8f23,0x1e5));var _0x38f2=function(_0x2b91b0,_0x3a6361){_0x2b91b0=_0x2b91b0-0x0;var _0x1a75c0=_0x8f23[_0x2b91b0];return _0x1a75c0;};'use strict';var _=require(_0x38f2('0x0'));var util=require(_0x38f2('0x1'));var moment=require(_0x38f2('0x2'));var BPromise=require(_0x38f2('0x3'));var rs=require(_0x38f2('0x4'));var fs=require('fs');var Redis=require(_0x38f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38f2('0x6'))(_0x38f2('0x7'));var config=require(_0x38f2('0x8'));var jayson=require(_0x38f2('0x9'));var client=jayson[_0x38f2('0xa')][_0x38f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x374473,_0x13958a,_0x4e27a2){return new BPromise(function(_0x19f604,_0x296aba){return client[_0x38f2('0xc')](_0x374473,_0x4e27a2)[_0x38f2('0xd')](function(_0x44a3c4){logger[_0x38f2('0xe')](_0x38f2('0xf'),_0x13958a,_0x38f2('0x10'));logger[_0x38f2('0x11')](_0x38f2('0x12'),_0x13958a,_0x38f2('0x10'),JSON[_0x38f2('0x13')](_0x44a3c4));if(_0x44a3c4['error']){if(_0x44a3c4[_0x38f2('0x14')]['code']===0x1f4){logger[_0x38f2('0x14')](_0x38f2('0xf'),_0x13958a,_0x44a3c4[_0x38f2('0x14')][_0x38f2('0x15')]);return _0x296aba(_0x44a3c4['error'][_0x38f2('0x15')]);}logger['error'](_0x38f2('0xf'),_0x13958a,_0x44a3c4[_0x38f2('0x14')]['message']);return _0x19f604(_0x44a3c4[_0x38f2('0x14')][_0x38f2('0x15')]);}else{logger[_0x38f2('0xe')](_0x38f2('0xf'),_0x13958a,_0x38f2('0x10'));_0x19f604(_0x44a3c4[_0x38f2('0x16')][_0x38f2('0x15')]);}})[_0x38f2('0x17')](function(_0x2723d9){logger[_0x38f2('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x13958a,_0x2723d9);_0x296aba(_0x2723d9);});});}exports['CreateReportAgentPreview']=function(_0xa35f35){var _0x28650e=this;return new Promise(function(_0x3265dd,_0xc967c1){return db[_0x38f2('0x18')][_0x38f2('0x19')](_0xa35f35[_0x38f2('0x1a')],{'raw':_0xa35f35[_0x38f2('0x1b')]?_0xa35f35['options'][_0x38f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x32b7e1){logger[_0x38f2('0xe')](_0x38f2('0x1d'),_0xa35f35);logger[_0x38f2('0x11')]('CreateReportAgentPreview',_0xa35f35,JSON[_0x38f2('0x13')](_0x32b7e1));_0x3265dd(_0x32b7e1);})[_0x38f2('0x17')](function(_0x7564ab){logger['error'](_0x38f2('0x1d'),_0x7564ab['message'],_0xa35f35);_0xc967c1(_0x28650e['error'](0x1f4,_0x7564ab[_0x38f2('0x15')]));});});};
\ No newline at end of file
+var _0xb97a=['raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','catch','CreateReportAgentPreview','create','body','options'];(function(_0xad57c9,_0x4472df){var _0x455ddc=function(_0x9a99dc){while(--_0x9a99dc){_0xad57c9['push'](_0xad57c9['shift']());}};_0x455ddc(++_0x4472df);}(_0xb97a,0xf4));var _0xab97=function(_0x3698f9,_0x4dafb9){_0x3698f9=_0x3698f9-0x0;var _0x2f8f39=_0xb97a[_0x3698f9];return _0x2f8f39;};'use strict';var _=require('lodash');var util=require(_0xab97('0x0'));var moment=require(_0xab97('0x1'));var BPromise=require(_0xab97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab97('0x3'));var db=require(_0xab97('0x4'))['db'];var utils=require(_0xab97('0x5'));var logger=require('../../config/logger')(_0xab97('0x6'));var config=require(_0xab97('0x7'));var jayson=require(_0xab97('0x8'));var client=jayson[_0xab97('0x9')][_0xab97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30c070,_0x21c0a1,_0x3b62c7){return new BPromise(function(_0x3e108e,_0x143f0a){return client[_0xab97('0xb')](_0x30c070,_0x3b62c7)[_0xab97('0xc')](function(_0x1f70ea){logger[_0xab97('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x21c0a1,_0xab97('0xe'));logger[_0xab97('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x21c0a1,_0xab97('0xe'),JSON[_0xab97('0x10')](_0x1f70ea));if(_0x1f70ea[_0xab97('0x11')]){if(_0x1f70ea[_0xab97('0x11')][_0xab97('0x12')]===0x1f4){logger[_0xab97('0x11')](_0xab97('0x13'),_0x21c0a1,_0x1f70ea[_0xab97('0x11')][_0xab97('0x14')]);return _0x143f0a(_0x1f70ea[_0xab97('0x11')][_0xab97('0x14')]);}logger[_0xab97('0x11')](_0xab97('0x13'),_0x21c0a1,_0x1f70ea[_0xab97('0x11')][_0xab97('0x14')]);return _0x3e108e(_0x1f70ea['error'][_0xab97('0x14')]);}else{logger['info'](_0xab97('0x13'),_0x21c0a1,_0xab97('0xe'));_0x3e108e(_0x1f70ea['result']['message']);}})[_0xab97('0x15')](function(_0x11181f){logger[_0xab97('0x11')](_0xab97('0x13'),_0x21c0a1,_0x11181f);_0x143f0a(_0x11181f);});});}exports[_0xab97('0x16')]=function(_0x150fd7){var _0xfaf80e=this;return new Promise(function(_0xb22791,_0x156afc){return db['ReportAgentPreview'][_0xab97('0x17')](_0x150fd7[_0xab97('0x18')],{'raw':_0x150fd7[_0xab97('0x19')]?_0x150fd7['options'][_0xab97('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x45ba4a){logger[_0xab97('0xd')](_0xab97('0x16'),_0x150fd7);logger[_0xab97('0xf')](_0xab97('0x16'),_0x150fd7,JSON[_0xab97('0x10')](_0x45ba4a));_0xb22791(_0x45ba4a);})[_0xab97('0x15')](function(_0x313aad){logger[_0xab97('0x11')](_0xab97('0x16'),_0x313aad['message'],_0x150fd7);_0x156afc(_0xfaf80e[_0xab97('0x11')](0x1f4,_0x313aad[_0xab97('0x14')]));});});};
\ No newline at end of file
index 06c3af2..54641f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93ed=['mailAccounts','/openchannel/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','showWhatsappQueues','multer','util','path','express','Router','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts'];(function(_0x3496b0,_0xc98450){var _0x472725=function(_0x2d6dff){while(--_0x2d6dff){_0x3496b0['push'](_0x3496b0['shift']());}};_0x472725(++_0xc98450);}(_0x93ed,0xfe));var _0xd93e=function(_0x455679,_0x4fb020){_0x455679=_0x455679-0x0;var _0x3d0be2=_0x93ed[_0x455679];return _0x3d0be2;};'use strict';var multer=require(_0xd93e('0x0'));var util=require(_0xd93e('0x1'));var path=require(_0xd93e('0x2'));var express=require(_0xd93e('0x3'));var router=express[_0xd93e('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xd93e('0x5'));router['get'](_0xd93e('0x6'),auth[_0xd93e('0x7')](),controller['voiceChannels']);router[_0xd93e('0x8')](_0xd93e('0x9'),auth[_0xd93e('0x7')](),controller[_0xd93e('0xa')]);router[_0xd93e('0x8')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0xd93e('0xb')]);router[_0xd93e('0x8')](_0xd93e('0xc'),auth[_0xd93e('0x7')](),controller['voiceQueues']);router['get'](_0xd93e('0xd'),auth['isAuthenticated'](),controller[_0xd93e('0xe')]);router[_0xd93e('0x8')](_0xd93e('0xf'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x10')]);router['get'](_0xd93e('0x11'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x12')]);router[_0xd93e('0x8')](_0xd93e('0x13'),auth['isAuthenticated'](),controller['openchannelQueues']);router['get']('/sms/queues',auth[_0xd93e('0x7')](),controller[_0xd93e('0x14')]);router[_0xd93e('0x8')]('/whatsapp/queues',auth[_0xd93e('0x7')](),controller['whatsappQueues']);router[_0xd93e('0x8')](_0xd93e('0x15'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x16')]);router[_0xd93e('0x8')](_0xd93e('0x17'),auth[_0xd93e('0x7')](),controller['voiceQueuesPreview']);router['get']('/voice/queues/channels',auth[_0xd93e('0x7')](),controller[_0xd93e('0x18')]);router[_0xd93e('0x8')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0xd93e('0x19')]);router[_0xd93e('0x8')](_0xd93e('0x1a'),auth[_0xd93e('0x7')](),controller['voiceQueuesChannelHangup']);router[_0xd93e('0x8')](_0xd93e('0x1b'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x1c')]);router[_0xd93e('0x8')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xd93e('0x1d')]);router[_0xd93e('0x1e')](_0xd93e('0x1f'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x20')]);router[_0xd93e('0x8')](_0xd93e('0x21'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x22')]);router[_0xd93e('0x8')](_0xd93e('0x23'),auth['isAuthenticated'](),controller[_0xd93e('0x24')]);router['get']('/agents',auth[_0xd93e('0x7')](),controller[_0xd93e('0x25')]);router['put'](_0xd93e('0x26'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x27')]);router['get'](_0xd93e('0x28'),auth[_0xd93e('0x7')](),controller['telephones']);router[_0xd93e('0x8')](_0xd93e('0x29'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x2a')]);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0xd93e('0x2b')]);router[_0xd93e('0x8')](_0xd93e('0x2c'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x2d')]);router[_0xd93e('0x8')]('/chat/queues/waitinginteractions',auth[_0xd93e('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xd93e('0x8')](_0xd93e('0x2e'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x2f')]);router[_0xd93e('0x8')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0xd93e('0x7')](),controller[_0xd93e('0x30')]);router[_0xd93e('0x8')]('/sms/queues/waitinginteractions',auth[_0xd93e('0x7')](),controller['smsQueuesWaitingInteractions']);router['get'](_0xd93e('0x31'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x32')]);router[_0xd93e('0x8')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xd93e('0x33')]);router[_0xd93e('0x34')](_0xd93e('0x35'),auth['isAuthenticated'](),controller[_0xd93e('0x36')](_0xd93e('0x37')));router['get']('/mail/queues/:id',auth['isAuthenticated'](),controller[_0xd93e('0x38')]);router[_0xd93e('0x34')](_0xd93e('0x39'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x36')](_0xd93e('0x3a')));router[_0xd93e('0x8')]('/chat/queues/:id',auth[_0xd93e('0x7')](),controller['showChatQueues']);router[_0xd93e('0x34')]('/fax/queues/:id/notify',auth[_0xd93e('0x7')](),controller[_0xd93e('0x36')]('fax'));router[_0xd93e('0x8')](_0xd93e('0x3b'),auth['isAuthenticated'](),controller[_0xd93e('0x3c')]);router[_0xd93e('0x34')](_0xd93e('0x3d'),auth['isAuthenticated'](),controller['queueNotify']('openchannel'));router[_0xd93e('0x8')](_0xd93e('0x3e'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x3f')]);router[_0xd93e('0x34')](_0xd93e('0x40'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x36')]('sms'));router[_0xd93e('0x34')]('/whatsapp/queues/:id/notify',auth[_0xd93e('0x7')](),controller[_0xd93e('0x36')]('whatsapp'));router[_0xd93e('0x8')](_0xd93e('0x41'),auth[_0xd93e('0x7')](),controller[_0xd93e('0x42')]);router[_0xd93e('0x8')]('/whatsapp/queues/:id',auth[_0xd93e('0x7')](),controller[_0xd93e('0x43')]);router[_0xd93e('0x34')]('/agents/:id/notify',auth[_0xd93e('0x7')](),controller['agentNotify']);module['exports']=router;
\ No newline at end of file
+var _0x17f3=['voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor'];(function(_0x2107ef,_0x489c18){var _0x54d014=function(_0x19f7af){while(--_0x19f7af){_0x2107ef['push'](_0x2107ef['shift']());}};_0x54d014(++_0x489c18);}(_0x17f3,0x188));var _0x317f=function(_0x5ee398,_0x213a7e){_0x5ee398=_0x5ee398-0x0;var _0x5cb2e9=_0x17f3[_0x5ee398];return _0x5cb2e9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require('express');var router=express[_0x317f('0x0')]();var auth=require(_0x317f('0x1'));var controller=require('./rpc.controller');router[_0x317f('0x2')](_0x317f('0x3'),auth[_0x317f('0x4')](),controller[_0x317f('0x5')]);router[_0x317f('0x2')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x317f('0x6')]);router[_0x317f('0x2')](_0x317f('0x7'),auth[_0x317f('0x4')](),controller[_0x317f('0x8')]);router[_0x317f('0x2')]('/voice/queues',auth['isAuthenticated'](),controller[_0x317f('0x9')]);router[_0x317f('0x2')](_0x317f('0xa'),auth[_0x317f('0x4')](),controller[_0x317f('0xb')]);router[_0x317f('0x2')](_0x317f('0xc'),auth[_0x317f('0x4')](),controller[_0x317f('0xd')]);router[_0x317f('0x2')](_0x317f('0xe'),auth[_0x317f('0x4')](),controller[_0x317f('0xf')]);router[_0x317f('0x2')](_0x317f('0x10'),auth[_0x317f('0x4')](),controller[_0x317f('0x11')]);router[_0x317f('0x2')](_0x317f('0x12'),auth['isAuthenticated'](),controller[_0x317f('0x13')]);router[_0x317f('0x2')](_0x317f('0x14'),auth['isAuthenticated'](),controller[_0x317f('0x15')]);router[_0x317f('0x2')](_0x317f('0x16'),auth[_0x317f('0x4')](),controller[_0x317f('0x17')]);router[_0x317f('0x2')](_0x317f('0x18'),auth[_0x317f('0x4')](),controller['voiceQueuesPreview']);router[_0x317f('0x2')](_0x317f('0x19'),auth[_0x317f('0x4')](),controller[_0x317f('0x1a')]);router[_0x317f('0x2')](_0x317f('0x1b'),auth[_0x317f('0x4')](),controller[_0x317f('0x1c')]);router[_0x317f('0x2')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x317f('0x1d')]);router[_0x317f('0x2')](_0x317f('0x1e'),auth[_0x317f('0x4')](),controller['voiceQueuesChannelRedirect']);router[_0x317f('0x2')](_0x317f('0x1f'),auth[_0x317f('0x4')](),controller[_0x317f('0x20')]);router[_0x317f('0x21')](_0x317f('0x1f'),auth[_0x317f('0x4')](),controller[_0x317f('0x22')]);router['get'](_0x317f('0x23'),auth[_0x317f('0x4')](),controller[_0x317f('0x24')]);router[_0x317f('0x2')](_0x317f('0x25'),auth['isAuthenticated'](),controller[_0x317f('0x26')]);router[_0x317f('0x2')](_0x317f('0x27'),auth[_0x317f('0x4')](),controller['agents']);router[_0x317f('0x21')](_0x317f('0x28'),auth[_0x317f('0x4')](),controller[_0x317f('0x29')]);router['get'](_0x317f('0x2a'),auth[_0x317f('0x4')](),controller[_0x317f('0x2b')]);router[_0x317f('0x2')](_0x317f('0x2c'),auth[_0x317f('0x4')](),controller[_0x317f('0x2d')]);router[_0x317f('0x2')](_0x317f('0x2e'),auth[_0x317f('0x4')](),controller[_0x317f('0x2f')]);router[_0x317f('0x2')](_0x317f('0x30'),auth[_0x317f('0x4')](),controller[_0x317f('0x31')]);router[_0x317f('0x2')]('/chat/queues/waitinginteractions',auth[_0x317f('0x4')](),controller[_0x317f('0x32')]);router[_0x317f('0x2')](_0x317f('0x33'),auth[_0x317f('0x4')](),controller['mailQueuesWaitingInteractions']);router[_0x317f('0x2')](_0x317f('0x34'),auth[_0x317f('0x4')](),controller[_0x317f('0x35')]);router[_0x317f('0x2')](_0x317f('0x36'),auth[_0x317f('0x4')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x317f('0x2')](_0x317f('0x37'),auth[_0x317f('0x4')](),controller[_0x317f('0x38')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x317f('0x4')](),controller[_0x317f('0x39')]);router[_0x317f('0x2')](_0x317f('0x3a'),auth[_0x317f('0x4')](),controller[_0x317f('0x3b')]);router[_0x317f('0x3c')](_0x317f('0x3d'),auth[_0x317f('0x4')](),controller[_0x317f('0x3e')](_0x317f('0x3f')));router[_0x317f('0x2')](_0x317f('0x40'),auth[_0x317f('0x4')](),controller['showMailQueues']);router[_0x317f('0x3c')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x317f('0x3e')](_0x317f('0x41')));router[_0x317f('0x2')](_0x317f('0x42'),auth['isAuthenticated'](),controller[_0x317f('0x43')]);router[_0x317f('0x3c')]('/fax/queues/:id/notify',auth[_0x317f('0x4')](),controller[_0x317f('0x3e')]('fax'));router[_0x317f('0x2')]('/fax/queues/:id',auth[_0x317f('0x4')](),controller['showFaxQueues']);router['post'](_0x317f('0x44'),auth['isAuthenticated'](),controller[_0x317f('0x3e')](_0x317f('0x45')));router[_0x317f('0x2')](_0x317f('0x46'),auth['isAuthenticated'](),controller[_0x317f('0x47')]);router[_0x317f('0x3c')](_0x317f('0x48'),auth[_0x317f('0x4')](),controller[_0x317f('0x3e')](_0x317f('0x49')));router[_0x317f('0x3c')]('/whatsapp/queues/:id/notify',auth[_0x317f('0x4')](),controller[_0x317f('0x3e')]('whatsapp'));router[_0x317f('0x2')](_0x317f('0x4a'),auth[_0x317f('0x4')](),controller[_0x317f('0x4b')]);router[_0x317f('0x2')](_0x317f('0x4c'),auth[_0x317f('0x4')](),controller[_0x317f('0x4d')]);router[_0x317f('0x3c')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x317f('0x4e')]);module[_0x317f('0x4f')]=router;
\ No newline at end of file
index f7880af..c0e61e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['telephones','Telephones','trunks','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','queue','MessageId','InteractionId','From','QueueId','Start','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','error','code','message','result','json','sendStatus','stack','status','send','isNil','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','catch','VoiceQueues','showVoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity'];(function(_0x16d61b,_0x2adf01){var _0xd01838=function(_0x1b38a6){while(--_0x1b38a6){_0x16d61b['push'](_0x16d61b['shift']());}};_0xd01838(++_0x2adf01);}(_0x24ca,0x1bc));var _0xa24c=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x24ca[_0x80d733];return _0x435868;};'use strict';var BPromise=require(_0xa24c('0x0'));var moment=require('moment');var _=require(_0xa24c('0x1'));var util=require(_0xa24c('0x2'));var db=require(_0xa24c('0x3'))['db'];var logger=require('../../config/logger')(_0xa24c('0x4'));var jayson=require(_0xa24c('0x5'));var amiClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232a});var mailClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232b});var routingClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){var _0x3a5727=_0x9a5013?_0x9a5013:amiClient;return _0x3a5727[_0xa24c('0x8')](_0x2dd348,_0x257264)['then'](function(_0x399f32){if(_0x399f32[_0xa24c('0x9')]){if(_0x399f32[_0xa24c('0x9')][_0xa24c('0xa')]===0x1f4){return _0x42d89c(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}return _0x481196(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}else{_0x481196(_0x399f32[_0xa24c('0xc')]);}})['catch'](function(_0x43bcd3){_0x42d89c(_0x43bcd3);});});}function respondWithResult(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xc8;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['status'](_0xcee4fe)[_0xa24c('0xd')](_0x2c2af8);}return _0x11090c[_0xa24c('0xe')](0x194);};}function handleError(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0x1f4;return function(_0x1cb08e){logger[_0xa24c('0x9')](_0x1cb08e[_0xa24c('0xf')]);if(_0x1cb08e['name']){delete _0x1cb08e['name'];}_0x26ff28[_0xa24c('0x10')](_0x2fcd8b)[_0xa24c('0x11')](_0x1cb08e);};}function findById(_0x49ce53){return function(_0x5babb5){if(!_[_0xa24c('0x12')](_0x49ce53)&&!_[_0xa24c('0x12')](_0x5babb5)&&!_['isNil'](_0x5babb5[_0xa24c('0x13')])){return _['find'](_0x5babb5[_0xa24c('0x13')],function(_0x2a610a){return _0x2a610a['id']==_0x49ce53;});}return null;};}exports[_0xa24c('0x14')]=function(_0xefdbd9,_0x4ff97c){return respondWithRpcPromise(_0xa24c('0x15'),_0xefdbd9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x4ff97c,null))['catch'](handleError(_0x4ff97c,null));};exports['voiceChannelMixMonitor']=function(_0x506424,_0x4cd77e){return respondWithRpcPromise(_0xa24c('0x18'),_[_0xa24c('0x19')](_0x506424[_0xa24c('0x16')],_0x506424[_0xa24c('0x1a')]))['then'](respondWithResult(_0x4cd77e,null))[_0xa24c('0x1b')](handleError(_0x4cd77e,null));};exports['voiceChannelStopMixMonitor']=function(_0x224bca,_0xb81d97){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa24c('0x19')](_0x224bca[_0xa24c('0x16')],_0x224bca[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0xb81d97,null))[_0xa24c('0x1b')](handleError(_0xb81d97,null));};exports['voiceQueues']=function(_0xec9167,_0x5cc9cb){return respondWithRpcPromise(_0xa24c('0x1c'),_0xec9167[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x5cc9cb,null))['catch'](handleError(_0x5cc9cb,null));};exports[_0xa24c('0x1d')]=function(_0x31c4d9,_0x14fd5a){return respondWithRpcPromise(_0xa24c('0x1c'),_0x31c4d9[_0xa24c('0x16')])[_0xa24c('0x17')](findById(_0x31c4d9[_0xa24c('0x1a')]['id']))['then'](respondWithResult(_0x14fd5a,null))[_0xa24c('0x1b')](handleError(_0x14fd5a,null));};exports[_0xa24c('0x1e')]=function(_0x152120,_0x12dbdc){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xa24c('0x19')](_0x152120[_0xa24c('0x1f')],_0x152120[_0xa24c('0x1a')]))['then'](respondWithResult(_0x12dbdc,null))[_0xa24c('0x1b')](handleError(_0x12dbdc,null));};exports[_0xa24c('0x20')]=function(_0x253d83,_0x4ae35c){return respondWithRpcPromise(_0xa24c('0x21'),_['merge'](_0x253d83[_0xa24c('0x16')],_0x253d83[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x4ae35c,null))['catch'](handleError(_0x4ae35c,null));};exports[_0xa24c('0x22')]=function(_0x53f90,_0x1d0379){return respondWithRpcPromise('VoiceQueuesChannels',_0x53f90[_0xa24c('0x16')])['then'](respondWithResult(_0x1d0379,null))[_0xa24c('0x1b')](handleError(_0x1d0379,null));};exports[_0xa24c('0x23')]=function(_0x592198,_0x5680f5){return respondWithRpcPromise(_0xa24c('0x24'),_[_0xa24c('0x19')](_0x592198[_0xa24c('0x16')],_0x592198[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x5680f5,null))[_0xa24c('0x1b')](handleError(_0x5680f5,null));};exports[_0xa24c('0x25')]=function(_0x4b4dc2,_0x39f146){return respondWithRpcPromise(_0xa24c('0x26'),_[_0xa24c('0x19')](_0x4b4dc2[_0xa24c('0x16')],_0x4b4dc2[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x39f146,null))[_0xa24c('0x1b')](handleError(_0x39f146,null));};exports[_0xa24c('0x27')]=function(_0x1ea166,_0x129bb9){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xa24c('0x19')](_0x1ea166[_0xa24c('0x16')],_0x1ea166[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x129bb9,null))['catch'](handleError(_0x129bb9,null));};exports['outbound']=function(_0x19a65f,_0x56ef4d){return respondWithRpcPromise(_0xa24c('0x28'),_0x19a65f[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x56ef4d,null))[_0xa24c('0x1b')](handleError(_0x56ef4d,null));};exports[_0xa24c('0x29')]=function(_0x4c0fb9,_0x532875){return respondWithRpcPromise(_0xa24c('0x2a'),_0x4c0fb9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x532875,null))[_0xa24c('0x1b')](handleError(_0x532875,null));};exports[_0xa24c('0x2b')]=function(_0x472912,_0x5080d0){var _0x56f392;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912[_0xa24c('0x16')])[_0xa24c('0x17')](function(_0x2101f8){_0x56f392=_0x2101f8;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912['query'],routingClient);})[_0xa24c('0x17')](function(_0x7895e){return _['merge']({},_0x7895e,_0x56f392);})['then'](respondWithResult(_0x5080d0,null))[_0xa24c('0x1b')](handleError(_0x5080d0,null));};exports[_0xa24c('0x2d')]=function(_0x231eea,_0x537849){if(_0x231eea['body']&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]&&_0x231eea[_0xa24c('0x2f')]&&_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')]){for(var _0x1b7faf in _0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]){if(_0x231eea['body']['interaction'][_0xa24c('0x31')](_0x1b7faf)){db[_0xa24c('0x32')][_0xa24c('0x33')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea['user'][_0xa24c('0x30')],'type':_0xa24c('0x34'),'exitAt':null,'uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')]?{'$notIn':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]}:{'$ne':null}}})[_0xa24c('0x17')](function(_0x4bbf93){var _0xb8c7a5=moment()[_0xa24c('0x36')](_0xa24c('0x37'));for(var _0x5aa2b2=0x0,_0x3a85cb=_0x4bbf93[_0xa24c('0x35')];_0x5aa2b2<_0x3a85cb;_0x5aa2b2+=0x1){_0x4bbf93[_0x5aa2b2][_0xa24c('0x38')]({'exitAt':_0xb8c7a5});}});for(var _0x31f05b=0x0;_0x31f05b<_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')];_0x31f05b+=0x1){db[_0xa24c('0x32')][_0xa24c('0x39')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'type':'INTERACTION','uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0x31f05b],'exitAt':null},'defaults':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'interface':_[_0xa24c('0x12')](_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3a')])?util[_0xa24c('0x36')](_0xa24c('0x3b'),_0x231eea['user']['name']):_0x231eea[_0xa24c('0x2f')]['interface'],'type':_0xa24c('0x34'),'enterAt':moment()[_0xa24c('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xa24c('0x3c'),'internal':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3d')],'uniqueid':_0x231eea['body']['interaction'][_0x1b7faf][_0x31f05b]}});}}}}return respondWithRpcPromise(_0xa24c('0x3e'),{'id':_0x231eea['params']['id'],'capacity':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x3f')]},routingClient)[_0xa24c('0x17')](respondWithResult(_0x537849,null))[_0xa24c('0x1b')](handleError(_0x537849,null));};exports[_0xa24c('0x40')]=function(_0x1fa739,_0x3f3ce6){return respondWithRpcPromise(_0xa24c('0x41'),_0x1fa739[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x3f3ce6,null))['catch'](handleError(_0x3f3ce6,null));};exports[_0xa24c('0x42')]=function(_0x2759c1,_0x233f8e){return respondWithRpcPromise('Trunks',_0x2759c1['query'])['then'](respondWithResult(_0x233f8e,null))[_0xa24c('0x1b')](handleError(_0x233f8e,null));};exports['campaigns']=function(_0x4757ff,_0x21d0fc){return respondWithRpcPromise('Campaigns',_0x4757ff[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x21d0fc,null))[_0xa24c('0x1b')](handleError(_0x21d0fc,null));};exports[_0xa24c('0x43')]=function(_0x162a11,_0x3a72e3){return respondWithRpcPromise(_0xa24c('0x44'),_0x162a11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x3a72e3,null))[_0xa24c('0x1b')](handleError(_0x3a72e3,null));};exports['showChatQueues']=function(_0x5abd45,_0x565f0a){return respondWithRpcPromise('ChatQueues',_0x5abd45['query'],routingClient)[_0xa24c('0x17')](findById(_0x5abd45['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x565f0a,null))[_0xa24c('0x1b')](handleError(_0x565f0a,null));};exports[_0xa24c('0x45')]=function(_0x1a5f17,_0xa371d2){return respondWithRpcPromise(_0xa24c('0x46'),_0x1a5f17[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0xa371d2,null))[_0xa24c('0x1b')](handleError(_0xa371d2,null));};exports[_0xa24c('0x47')]=function(_0x303b7d,_0x37dbbd){return respondWithRpcPromise(_0xa24c('0x46'),_0x303b7d[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0x303b7d['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x37dbbd,null))[_0xa24c('0x1b')](handleError(_0x37dbbd,null));};exports['mailAccounts']=function(_0x1e08bb,_0x179ae1){return respondWithRpcPromise(_0xa24c('0x48'),_0x1e08bb[_0xa24c('0x16')],mailClient)['then'](respondWithResult(_0x179ae1,null))['catch'](handleError(_0x179ae1,null));};exports[_0xa24c('0x49')]=function(_0x5e9631,_0x486040){return respondWithRpcPromise(_0xa24c('0x4a'),_0x5e9631[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x486040,null))[_0xa24c('0x1b')](handleError(_0x486040,null));};exports['showOpenchannelQueues']=function(_0x48a7b2,_0x29b836){return respondWithRpcPromise('OpenchannelQueues',_0x48a7b2['query'],routingClient)[_0xa24c('0x17')](findById(_0x48a7b2[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x29b836,null))['catch'](handleError(_0x29b836,null));};exports[_0xa24c('0x4b')]=function(_0x128e5b,_0x5c3285){return respondWithRpcPromise(_0xa24c('0x4c'),_0x128e5b[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x5c3285,null))['catch'](handleError(_0x5c3285,null));};exports[_0xa24c('0x4d')]=function(_0x34e261,_0x21439a){return respondWithRpcPromise(_0xa24c('0x4c'),_0x34e261[_0xa24c('0x16')],routingClient)['then'](findById(_0x34e261[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x21439a,null))[_0xa24c('0x1b')](handleError(_0x21439a,null));};exports[_0xa24c('0x4e')]=function(_0xab5260,_0x2ca3fa){return respondWithRpcPromise(_0xa24c('0x4f'),_0xab5260['query'],routingClient)[_0xa24c('0x17')](respondWithResult(_0x2ca3fa,null))[_0xa24c('0x1b')](handleError(_0x2ca3fa,null));};exports['showWhatsappQueues']=function(_0xb1048a,_0x3e455b){return respondWithRpcPromise(_0xa24c('0x4f'),_0xb1048a[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xb1048a[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x3e455b,null))[_0xa24c('0x1b')](handleError(_0x3e455b,null));};exports[_0xa24c('0x50')]=function(_0x32ddc3,_0x50141e){return respondWithRpcPromise(_0xa24c('0x51'),_0x32ddc3[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x50141e,null))['catch'](handleError(_0x50141e,null));};exports[_0xa24c('0x52')]=function(_0xfd57fb,_0x2cc592){return respondWithRpcPromise('FaxQueues',_0xfd57fb[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xfd57fb[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x2cc592,null))[_0xa24c('0x1b')](handleError(_0x2cc592,null));};exports[_0xa24c('0x53')]=function(_0x4f9b56,_0x4c374d){return respondWithRpcPromise(_0xa24c('0x54'),_0x4f9b56['query'])[_0xa24c('0x17')](respondWithResult(_0x4c374d,null))[_0xa24c('0x1b')](handleError(_0x4c374d,null));};exports[_0xa24c('0x55')]=function(_0x4073c5,_0x12d715){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4073c5[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x12d715,null))[_0xa24c('0x1b')](handleError(_0x12d715,null));};exports[_0xa24c('0x56')]=function(_0x987aca,_0x389c08){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x987aca[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x389c08,null))[_0xa24c('0x1b')](handleError(_0x389c08,null));};exports[_0xa24c('0x57')]=function(_0x5ebdd1,_0x403bf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ebdd1[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x403bf1,null))[_0xa24c('0x1b')](handleError(_0x403bf1,null));};exports[_0xa24c('0x58')]=function(_0x5726e1,_0x2e612d){return respondWithRpcPromise(_0xa24c('0x59'),_0x5726e1['query'],routingClient)[_0xa24c('0x17')](function(_0x168a8b){if(_0x5726e1[_0xa24c('0x16')][_0xa24c('0x5a')]!==undefined){var _0x8bd3fb=_(_0x168a8b[_0xa24c('0x13')])[_0xa24c('0x5b')]([_0x5726e1[_0xa24c('0x16')]['type'],_0x5726e1[_0xa24c('0x1a')]['id']])[_0xa24c('0x5c')](_0xa24c('0x5d'))[_0xa24c('0x5e')]()[_0xa24c('0x5f')]();return _0x168a8b[_0xa24c('0x13')][_0xa24c('0x5b')](function(_0x13dbef){return _0x8bd3fb[_0xa24c('0x60')](_0x13dbef[_0xa24c('0x5d')])>-0x1;});}else{return _0x168a8b[_0xa24c('0x13')]['filter'](function(_0x283c5b){return _0x283c5b[_0xa24c('0x5d')]===parseInt(_0x5726e1['params']['id']);});}})[_0xa24c('0x17')](respondWithResult(_0x2e612d,null))[_0xa24c('0x1b')](handleError(_0x2e612d,null));};exports[_0xa24c('0x61')]=function(_0x4f0f11,_0x5b4468){return respondWithRpcPromise(_0xa24c('0x62'),_0x4f0f11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x5b4468,null))[_0xa24c('0x1b')](handleError(_0x5b4468,null));};exports[_0xa24c('0x63')]=function(_0x106178,_0x27a666){return respondWithRpcPromise(_0xa24c('0x64'),_0x106178[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x27a666,null))['catch'](handleError(_0x27a666,null));};exports['faxQueuesWaitingInteractions']=function(_0x263dab,_0x521894){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x263dab[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x521894,null))[_0xa24c('0x1b')](handleError(_0x521894,null));};exports[_0xa24c('0x65')]=function(_0x84ddcc){return function(_0x45b2fe,_0x16f93a){var _0x170b65,_0x2544fc;var _0x4ee10d=_[_0xa24c('0x66')](_0x84ddcc);var _0xa077c8=_0x84ddcc===_0xa24c('0x67')?_0xa24c('0x68'):_0xa24c('0x69');return db[_0x4ee10d+_0xa24c('0x6a')][_0xa24c('0x6b')]({'raw':!![],'where':{'id':_0x45b2fe[_0xa24c('0x1a')]['id']}})[_0xa24c('0x17')](function(_0x3c5495){if(_[_0xa24c('0x12')](_0x3c5495)){throw new Error(_0x4ee10d+_0xa24c('0x6c'));}_0x170b65=_0x3c5495;return db[_0x4ee10d+'Message'][_0xa24c('0x6b')]({'where':{'id':_0x45b2fe[_0xa24c('0x1f')]['messageId']},'include':[{'model':db[_0x4ee10d+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x4ee10d+_0xa077c8],'as':_0xa24c('0x69')}]});})['then'](function(_0x549e07){if(_[_0xa24c('0x12')](_0x549e07)){throw new Error(_0x4ee10d+'\x20Message\x20not\x20found');}_0x2544fc=_0x549e07;return _0x549e07[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4c108f={'uniqueid':_0x84ddcc+'.'+_0x2544fc['id']+'.'+_0x2544fc['Interaction']['id'],'FromUserId':_0x45b2fe[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f')};_0x4c108f[_0x4ee10d+_0xa24c('0x70')]=_0x2544fc['id'];_0x4c108f[_0x4ee10d+_0xa24c('0x71')]=_0x2544fc['Interaction']['id'];_0x4c108f[_0xa24c('0x72')+_0x4ee10d+_0xa077c8+'Id']=_0x2544fc[_0xa24c('0x69')]['id'];_0x4c108f['To'+_0x4ee10d+_0xa24c('0x73')]=_0x170b65['id'];return db[_0x4ee10d+'TransferReport']['create'](_0x4c108f);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x84ddcc,'interaction':_0x2544fc[_0xa24c('0x6d')],'message':_0x2544fc,'account':_0x2544fc['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x170b65[_0xa24c('0x30')]+','+(_0x2544fc['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x16f93a,null))[_0xa24c('0x1b')](handleError(_0x16f93a,null));};};exports[_0xa24c('0x75')]=function(_0xd23eb3,_0x890e15){var _0x12836d,_0x280fa2;if(_[_0xa24c('0x12')](_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x76')])){throw new Error(_0xa24c('0x77'));}var _0x24b28c=_0xd23eb3['body'][_0xa24c('0x76')];var _0x292c22=_['capitalize'](_0x24b28c);var _0x2fd4a2=_0x24b28c==='chat'?'Website':'Account';return db[_0xa24c('0x78')]['findOne']({'raw':!![],'where':{'id':_0xd23eb3[_0xa24c('0x1a')]['id'],'role':'agent'}})[_0xa24c('0x17')](function(_0x144c3b){if(_['isNil'](_0x144c3b)){throw new Error(_0xa24c('0x79'));}_0x12836d=_0x144c3b;return db[_0x292c22+'Message'][_0xa24c('0x6b')]({'where':{'id':_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x7a')]},'include':[{'model':db[_0x292c22+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x292c22+_0x2fd4a2],'as':'Account'}]});})[_0xa24c('0x17')](function(_0x5774d2){if(_[_0xa24c('0x12')](_0x5774d2)){throw new Error(_0x292c22+_0xa24c('0x7b'));}_0x280fa2=_0x5774d2;return _0x5774d2[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4b848d={'uniqueid':_0x24b28c+'.'+_0x280fa2['id']+'.'+_0x280fa2[_0xa24c('0x6d')]['id'],'FromUserId':_0xd23eb3[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f'),'ToUserId':_0x12836d['id']};_0x4b848d[_0x292c22+_0xa24c('0x70')]=_0x280fa2['id'];_0x4b848d[_0x292c22+'InteractionId']=_0x280fa2[_0xa24c('0x6d')]['id'];_0x4b848d[_0xa24c('0x72')+_0x292c22+_0x2fd4a2+'Id']=_0x280fa2[_0xa24c('0x69')]['id'];return db[_0x292c22+_0xa24c('0x7c')][_0xa24c('0x7d')](_0x4b848d);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x24b28c,'interaction':_0x280fa2[_0xa24c('0x6d')],'message':_0x280fa2,'account':_0x280fa2[_0xa24c('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa24c('0x3c'),'appdata':_0x12836d[_0xa24c('0x30')]+','+(_0x280fa2[_0xa24c('0x69')][_0xa24c('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x890e15,null))[_0xa24c('0x1b')](handleError(_0x890e15,null));};
\ No newline at end of file
+var _0x3e74=['http','client','then','error','code','message','result','sendStatus','stack','name','status','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','jayson/promise'];(function(_0x4f8dfe,_0x5d7794){var _0x3931e8=function(_0x6d9f22){while(--_0x6d9f22){_0x4f8dfe['push'](_0x4f8dfe['shift']());}};_0x3931e8(++_0x5d7794);}(_0x3e74,0x175));var _0x43e7=function(_0xb65e52,_0x568973){_0xb65e52=_0xb65e52-0x0;var _0xa598f=_0x3e74[_0xb65e52];return _0xa598f;};'use strict';var BPromise=require(_0x43e7('0x0'));var moment=require('moment');var _=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var db=require(_0x43e7('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x43e7('0x4'));var amiClient=jayson['client'][_0x43e7('0x5')]({'port':0x232a});var mailClient=jayson[_0x43e7('0x6')][_0x43e7('0x5')]({'port':0x232b});var routingClient=jayson[_0x43e7('0x6')][_0x43e7('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){var _0x21f491=_0x3491d6?_0x3491d6:amiClient;return _0x21f491['request'](_0x503698,_0x45a0d1)[_0x43e7('0x7')](function(_0x554d44){if(_0x554d44['error']){if(_0x554d44[_0x43e7('0x8')][_0x43e7('0x9')]===0x1f4){return _0x8528fc(_0x554d44['error'][_0x43e7('0xa')]);}return _0x2ede2d(_0x554d44['error'][_0x43e7('0xa')]);}else{_0x2ede2d(_0x554d44[_0x43e7('0xb')]);}})['catch'](function(_0x3eb206){_0x8528fc(_0x3eb206);});});}function respondWithResult(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xc8;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['status'](_0x2718d3)['json'](_0x3bb83f);}return _0xc960ea[_0x43e7('0xc')](0x194);};}function handleError(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0x1f4;return function(_0x51b974){logger['error'](_0x51b974[_0x43e7('0xd')]);if(_0x51b974[_0x43e7('0xe')]){delete _0x51b974[_0x43e7('0xe')];}_0x21fdd3[_0x43e7('0xf')](_0x44b0bd)['send'](_0x51b974);};}function findById(_0x5c4eaa){return function(_0xdf16c){if(!_[_0x43e7('0x10')](_0x5c4eaa)&&!_[_0x43e7('0x10')](_0xdf16c)&&!_['isNil'](_0xdf16c['rows'])){return _[_0x43e7('0x11')](_0xdf16c[_0x43e7('0x12')],function(_0x9037d3){return _0x9037d3['id']==_0x5c4eaa;});}return null;};}exports[_0x43e7('0x13')]=function(_0x3776f5,_0x1f24fb){return respondWithRpcPromise(_0x43e7('0x14'),_0x3776f5[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x1f24fb,null))[_0x43e7('0x16')](handleError(_0x1f24fb,null));};exports[_0x43e7('0x17')]=function(_0x177ee1,_0x4b5d64){return respondWithRpcPromise(_0x43e7('0x18'),_[_0x43e7('0x19')](_0x177ee1['query'],_0x177ee1[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x4b5d64,null))[_0x43e7('0x16')](handleError(_0x4b5d64,null));};exports[_0x43e7('0x1b')]=function(_0x4077fb,_0x2f4cb4){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x43e7('0x19')](_0x4077fb['query'],_0x4077fb['params']))[_0x43e7('0x7')](respondWithResult(_0x2f4cb4,null))[_0x43e7('0x16')](handleError(_0x2f4cb4,null));};exports['voiceQueues']=function(_0x1f0673,_0x4ca5cf){return respondWithRpcPromise(_0x43e7('0x1c'),_0x1f0673['query'])[_0x43e7('0x7')](respondWithResult(_0x4ca5cf,null))[_0x43e7('0x16')](handleError(_0x4ca5cf,null));};exports[_0x43e7('0x1d')]=function(_0x405f85,_0x51f4d7){return respondWithRpcPromise('VoiceQueues',_0x405f85[_0x43e7('0x15')])['then'](findById(_0x405f85[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x51f4d7,null))[_0x43e7('0x16')](handleError(_0x51f4d7,null));};exports[_0x43e7('0x1e')]=function(_0x5087d7,_0x33a1a5){return respondWithRpcPromise(_0x43e7('0x1f'),_[_0x43e7('0x19')](_0x5087d7[_0x43e7('0x20')],_0x5087d7[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x33a1a5,null))[_0x43e7('0x16')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x21')]=function(_0x3bf475,_0x35dbcd){return respondWithRpcPromise(_0x43e7('0x22'),_[_0x43e7('0x19')](_0x3bf475[_0x43e7('0x15')],_0x3bf475[_0x43e7('0x1a')]))['then'](respondWithResult(_0x35dbcd,null))[_0x43e7('0x16')](handleError(_0x35dbcd,null));};exports[_0x43e7('0x23')]=function(_0x3b8f78,_0x183c81){return respondWithRpcPromise(_0x43e7('0x24'),_0x3b8f78['query'])[_0x43e7('0x7')](respondWithResult(_0x183c81,null))[_0x43e7('0x16')](handleError(_0x183c81,null));};exports[_0x43e7('0x25')]=function(_0x3f280d,_0x4c61b9){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x3f280d[_0x43e7('0x15')],_0x3f280d[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x4c61b9,null))[_0x43e7('0x16')](handleError(_0x4c61b9,null));};exports[_0x43e7('0x26')]=function(_0xde7ed,_0x485c6c){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0xde7ed['query'],_0xde7ed['params']))['then'](respondWithResult(_0x485c6c,null))['catch'](handleError(_0x485c6c,null));};exports[_0x43e7('0x27')]=function(_0x49cda6,_0x2b4bfd){return respondWithRpcPromise(_0x43e7('0x28'),_[_0x43e7('0x19')](_0x49cda6[_0x43e7('0x15')],_0x49cda6[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x2b4bfd,null))[_0x43e7('0x16')](handleError(_0x2b4bfd,null));};exports['outbound']=function(_0x5332d9,_0x5d84f4){return respondWithRpcPromise(_0x43e7('0x29'),_0x5332d9[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x5d84f4,null))[_0x43e7('0x16')](handleError(_0x5d84f4,null));};exports[_0x43e7('0x2a')]=function(_0x1ed538,_0x1d4589){return respondWithRpcPromise(_0x43e7('0x2b'),_0x1ed538['query'])[_0x43e7('0x7')](respondWithResult(_0x1d4589,null))[_0x43e7('0x16')](handleError(_0x1d4589,null));};exports['agents']=function(_0x2d54c1,_0x4c0c7a){var _0x44d8e4;return respondWithRpcPromise(_0x43e7('0x2c'),_0x2d54c1[_0x43e7('0x15')])[_0x43e7('0x7')](function(_0x35ac85){_0x44d8e4=_0x35ac85;return respondWithRpcPromise(_0x43e7('0x2c'),_0x2d54c1['query'],routingClient);})['then'](function(_0x30dfa9){return _[_0x43e7('0x19')]({},_0x30dfa9,_0x44d8e4);})[_0x43e7('0x7')](respondWithResult(_0x4c0c7a,null))[_0x43e7('0x16')](handleError(_0x4c0c7a,null));};exports[_0x43e7('0x2d')]=function(_0x4a4a85,_0x32a451){if(_0x4a4a85[_0x43e7('0x20')]&&_0x4a4a85['body'][_0x43e7('0x2e')]&&_0x4a4a85['user']&&_0x4a4a85[_0x43e7('0x2f')]['name']){for(var _0x3d81ae in _0x4a4a85[_0x43e7('0x20')][_0x43e7('0x2e')]){if(_0x4a4a85[_0x43e7('0x20')]['interaction']['hasOwnProperty'](_0x3d81ae)){db[_0x43e7('0x30')][_0x43e7('0x31')]({'where':{'channel':_0x3d81ae,'membername':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0xe')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4a4a85['body']['interaction'][_0x3d81ae]&&_0x4a4a85[_0x43e7('0x20')]['interaction'][_0x3d81ae][_0x43e7('0x32')]?{'$notIn':_0x4a4a85['body']['interaction'][_0x3d81ae]}:{'$ne':null}}})[_0x43e7('0x7')](function(_0x5ee1c5){var _0x2de14f=moment()[_0x43e7('0x33')](_0x43e7('0x34'));for(var _0x99b9e1=0x0,_0x4fc5e8=_0x5ee1c5[_0x43e7('0x32')];_0x99b9e1<_0x4fc5e8;_0x99b9e1+=0x1){_0x5ee1c5[_0x99b9e1][_0x43e7('0x35')]({'exitAt':_0x2de14f});}});for(var _0x23a611=0x0;_0x23a611<_0x4a4a85[_0x43e7('0x20')][_0x43e7('0x2e')][_0x3d81ae][_0x43e7('0x32')];_0x23a611+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x3d81ae,'membername':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0xe')],'type':_0x43e7('0x36'),'uniqueid':_0x4a4a85['body']['interaction'][_0x3d81ae][_0x23a611],'exitAt':null},'defaults':{'channel':_0x3d81ae,'membername':_0x4a4a85['user'][_0x43e7('0xe')],'interface':_[_0x43e7('0x10')](_0x4a4a85['user'][_0x43e7('0x37')])?util[_0x43e7('0x33')](_0x43e7('0x38'),_0x4a4a85['user']['name']):_0x4a4a85['user']['interface'],'type':_0x43e7('0x36'),'enterAt':moment()[_0x43e7('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x43e7('0x39'),'internal':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0x3a')],'uniqueid':_0x4a4a85[_0x43e7('0x20')]['interaction'][_0x3d81ae][_0x23a611]}});}}}}return respondWithRpcPromise(_0x43e7('0x3b'),{'id':_0x4a4a85['params']['id'],'capacity':_0x4a4a85['body'][_0x43e7('0x3c')]},routingClient)[_0x43e7('0x7')](respondWithResult(_0x32a451,null))[_0x43e7('0x16')](handleError(_0x32a451,null));};exports[_0x43e7('0x3d')]=function(_0x13503c,_0x2351cf){return respondWithRpcPromise(_0x43e7('0x3e'),_0x13503c[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x2351cf,null))[_0x43e7('0x16')](handleError(_0x2351cf,null));};exports['trunks']=function(_0x119d34,_0x46c910){return respondWithRpcPromise('Trunks',_0x119d34[_0x43e7('0x15')])['then'](respondWithResult(_0x46c910,null))[_0x43e7('0x16')](handleError(_0x46c910,null));};exports[_0x43e7('0x3f')]=function(_0x34e2ec,_0x1f561f){return respondWithRpcPromise(_0x43e7('0x40'),_0x34e2ec['query'])['then'](respondWithResult(_0x1f561f,null))[_0x43e7('0x16')](handleError(_0x1f561f,null));};exports[_0x43e7('0x41')]=function(_0x399942,_0x29c53d){return respondWithRpcPromise(_0x43e7('0x42'),_0x399942[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x29c53d,null))[_0x43e7('0x16')](handleError(_0x29c53d,null));};exports[_0x43e7('0x43')]=function(_0x24e758,_0x312306){return respondWithRpcPromise('ChatQueues',_0x24e758[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x24e758['params']['id']))[_0x43e7('0x7')](respondWithResult(_0x312306,null))[_0x43e7('0x16')](handleError(_0x312306,null));};exports[_0x43e7('0x44')]=function(_0x558d54,_0x5d63c6){return respondWithRpcPromise(_0x43e7('0x45'),_0x558d54[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x5d63c6,null))[_0x43e7('0x16')](handleError(_0x5d63c6,null));};exports['showMailQueues']=function(_0x49a6ce,_0x1fa3f6){return respondWithRpcPromise(_0x43e7('0x45'),_0x49a6ce[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x49a6ce[_0x43e7('0x1a')]['id']))['then'](respondWithResult(_0x1fa3f6,null))[_0x43e7('0x16')](handleError(_0x1fa3f6,null));};exports[_0x43e7('0x46')]=function(_0x4d89bd,_0x20283b){return respondWithRpcPromise(_0x43e7('0x47'),_0x4d89bd[_0x43e7('0x15')],mailClient)['then'](respondWithResult(_0x20283b,null))['catch'](handleError(_0x20283b,null));};exports['openchannelQueues']=function(_0x2ada55,_0x4058ce){return respondWithRpcPromise(_0x43e7('0x48'),_0x2ada55[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x4058ce,null))['catch'](handleError(_0x4058ce,null));};exports[_0x43e7('0x49')]=function(_0x8b50bb,_0x140438){return respondWithRpcPromise(_0x43e7('0x48'),_0x8b50bb['query'],routingClient)[_0x43e7('0x7')](findById(_0x8b50bb[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x140438,null))[_0x43e7('0x16')](handleError(_0x140438,null));};exports[_0x43e7('0x4a')]=function(_0xd41e79,_0x4665db){return respondWithRpcPromise(_0x43e7('0x4b'),_0xd41e79[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x4665db,null))[_0x43e7('0x16')](handleError(_0x4665db,null));};exports['showSmsQueues']=function(_0x5f3824,_0x2b0711){return respondWithRpcPromise('SmsQueues',_0x5f3824['query'],routingClient)['then'](findById(_0x5f3824[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x2b0711,null))['catch'](handleError(_0x2b0711,null));};exports[_0x43e7('0x4c')]=function(_0x135791,_0x1d8438){return respondWithRpcPromise('WhatsappQueues',_0x135791[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x1d8438,null))[_0x43e7('0x16')](handleError(_0x1d8438,null));};exports[_0x43e7('0x4d')]=function(_0x2f43d7,_0x472a19){return respondWithRpcPromise(_0x43e7('0x4e'),_0x2f43d7['query'],routingClient)[_0x43e7('0x7')](findById(_0x2f43d7[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x472a19,null))['catch'](handleError(_0x472a19,null));};exports['faxQueues']=function(_0x30377a,_0x5c3ad8){return respondWithRpcPromise('FaxQueues',_0x30377a[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x5c3ad8,null))['catch'](handleError(_0x5c3ad8,null));};exports[_0x43e7('0x4f')]=function(_0x28b21d,_0x1e2fed){return respondWithRpcPromise(_0x43e7('0x50'),_0x28b21d[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x28b21d[_0x43e7('0x1a')]['id']))['then'](respondWithResult(_0x1e2fed,null))[_0x43e7('0x16')](handleError(_0x1e2fed,null));};exports[_0x43e7('0x51')]=function(_0x4e5956,_0x418213){return respondWithRpcPromise('FaxAccounts',_0x4e5956[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x418213,null))[_0x43e7('0x16')](handleError(_0x418213,null));};exports[_0x43e7('0x52')]=function(_0x506361,_0x2d25b5){return respondWithRpcPromise(_0x43e7('0x53'),_0x506361[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x2d25b5,null))[_0x43e7('0x16')](handleError(_0x2d25b5,null));};exports[_0x43e7('0x54')]=function(_0x219dc6,_0x703a30){return respondWithRpcPromise(_0x43e7('0x55'),_0x219dc6['query'],routingClient)[_0x43e7('0x7')](respondWithResult(_0x703a30,null))[_0x43e7('0x16')](handleError(_0x703a30,null));};exports[_0x43e7('0x56')]=function(_0x2499ef,_0x433d3c){return respondWithRpcPromise(_0x43e7('0x57'),_0x2499ef[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x433d3c,null))['catch'](handleError(_0x433d3c,null));};exports[_0x43e7('0x58')]=function(_0x536477,_0x550036){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x536477[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](function(_0x230fda){if(_0x536477[_0x43e7('0x15')][_0x43e7('0x59')]!==undefined){var _0x1ae0c8=_(_0x230fda['rows'])[_0x43e7('0x5a')]([_0x536477[_0x43e7('0x15')][_0x43e7('0x59')],_0x536477['params']['id']])[_0x43e7('0x5b')](_0x43e7('0x5c'))[_0x43e7('0x5d')]()[_0x43e7('0x5e')]();return _0x230fda[_0x43e7('0x12')][_0x43e7('0x5a')](function(_0x1d4a29){return _0x1ae0c8[_0x43e7('0x5f')](_0x1d4a29['queue_id'])>-0x1;});}else{return _0x230fda['rows']['filter'](function(_0x156074){return _0x156074[_0x43e7('0x5c')]===parseInt(_0x536477['params']['id']);});}})[_0x43e7('0x7')](respondWithResult(_0x550036,null))[_0x43e7('0x16')](handleError(_0x550036,null));};exports[_0x43e7('0x60')]=function(_0x8e60f1,_0x5a5565){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x8e60f1['query'],routingClient)[_0x43e7('0x7')](respondWithResult(_0x5a5565,null))[_0x43e7('0x16')](handleError(_0x5a5565,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x58cbb7,_0x21adf7){return respondWithRpcPromise(_0x43e7('0x61'),_0x58cbb7[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x21adf7,null))[_0x43e7('0x16')](handleError(_0x21adf7,null));};exports[_0x43e7('0x62')]=function(_0x401654,_0xb04082){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x401654[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0xb04082,null))[_0x43e7('0x16')](handleError(_0xb04082,null));};exports[_0x43e7('0x63')]=function(_0x24a168){return function(_0x90667c,_0xa7cb2c){var _0x45adef,_0x126133;var _0x5e8d4e=_[_0x43e7('0x64')](_0x24a168);var _0x40257e=_0x24a168===_0x43e7('0x65')?_0x43e7('0x66'):'Account';return db[_0x5e8d4e+'Queue']['findOne']({'raw':!![],'where':{'id':_0x90667c[_0x43e7('0x1a')]['id']}})['then'](function(_0x240f0d){if(_[_0x43e7('0x10')](_0x240f0d)){throw new Error(_0x5e8d4e+_0x43e7('0x67'));}_0x45adef=_0x240f0d;return db[_0x5e8d4e+_0x43e7('0x68')][_0x43e7('0x69')]({'where':{'id':_0x90667c[_0x43e7('0x20')][_0x43e7('0x6a')]},'include':[{'model':db[_0x5e8d4e+_0x43e7('0x6b')],'as':_0x43e7('0x6b')},{'model':db[_0x5e8d4e+_0x40257e],'as':_0x43e7('0x6c')}]});})[_0x43e7('0x7')](function(_0x5b3565){if(_[_0x43e7('0x10')](_0x5b3565)){throw new Error(_0x5e8d4e+_0x43e7('0x6d'));}_0x126133=_0x5b3565;return _0x5b3565[_0x43e7('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x43e7('0x7')](function(){var _0x206e54={'uniqueid':_0x24a168+'.'+_0x126133['id']+'.'+_0x126133['Interaction']['id'],'FromUserId':_0x90667c['user']['id'],'type':_0x43e7('0x6f')};_0x206e54[_0x5e8d4e+_0x43e7('0x70')]=_0x126133['id'];_0x206e54[_0x5e8d4e+'InteractionId']=_0x126133[_0x43e7('0x6b')]['id'];_0x206e54[_0x43e7('0x71')+_0x5e8d4e+_0x40257e+'Id']=_0x126133['Account']['id'];_0x206e54['To'+_0x5e8d4e+'QueueId']=_0x45adef['id'];return db[_0x5e8d4e+_0x43e7('0x72')][_0x43e7('0x73')](_0x206e54);})[_0x43e7('0x7')](function(){return respondWithRpcPromise(_0x43e7('0x74'),{'channel':_0x24a168,'interaction':_0x126133[_0x43e7('0x6b')],'message':_0x126133,'account':_0x126133['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x45adef[_0x43e7('0xe')]+','+(_0x126133[_0x43e7('0x6c')][_0x43e7('0x75')]||0x12c),'interval':_0x43e7('0x76')}]},routingClient);})['then'](respondWithResult(_0xa7cb2c,null))[_0x43e7('0x16')](handleError(_0xa7cb2c,null));};};exports[_0x43e7('0x77')]=function(_0x1ed590,_0x15ee83){var _0x5bc060,_0x3a4962;if(_[_0x43e7('0x10')](_0x1ed590[_0x43e7('0x20')][_0x43e7('0x78')])){throw new Error(_0x43e7('0x79'));}var _0x4ef289=_0x1ed590[_0x43e7('0x20')][_0x43e7('0x78')];var _0x509d8d=_[_0x43e7('0x64')](_0x4ef289);var _0x2ca6fb=_0x4ef289===_0x43e7('0x65')?_0x43e7('0x66'):'Account';return db[_0x43e7('0x7a')]['findOne']({'raw':!![],'where':{'id':_0x1ed590[_0x43e7('0x1a')]['id'],'role':_0x43e7('0x39')}})[_0x43e7('0x7')](function(_0x2614ff){if(_[_0x43e7('0x10')](_0x2614ff)){throw new Error(_0x43e7('0x7b'));}_0x5bc060=_0x2614ff;return db[_0x509d8d+_0x43e7('0x68')][_0x43e7('0x69')]({'where':{'id':_0x1ed590[_0x43e7('0x20')]['messageId']},'include':[{'model':db[_0x509d8d+_0x43e7('0x6b')],'as':_0x43e7('0x6b')},{'model':db[_0x509d8d+_0x2ca6fb],'as':_0x43e7('0x6c')}]});})[_0x43e7('0x7')](function(_0x56593f){if(_['isNil'](_0x56593f)){throw new Error(_0x509d8d+_0x43e7('0x6d'));}_0x3a4962=_0x56593f;return _0x56593f[_0x43e7('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x43e7('0x7')](function(){var _0x4d30f7={'uniqueid':_0x4ef289+'.'+_0x3a4962['id']+'.'+_0x3a4962[_0x43e7('0x6b')]['id'],'FromUserId':_0x1ed590['user']['id'],'type':'queue','ToUserId':_0x5bc060['id']};_0x4d30f7[_0x509d8d+'MessageId']=_0x3a4962['id'];_0x4d30f7[_0x509d8d+_0x43e7('0x7c')]=_0x3a4962['Interaction']['id'];_0x4d30f7[_0x43e7('0x71')+_0x509d8d+_0x2ca6fb+'Id']=_0x3a4962[_0x43e7('0x6c')]['id'];return db[_0x509d8d+_0x43e7('0x72')][_0x43e7('0x73')](_0x4d30f7);})[_0x43e7('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x4ef289,'interaction':_0x3a4962['Interaction'],'message':_0x3a4962,'account':_0x3a4962[_0x43e7('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x43e7('0x39'),'appdata':_0x5bc060['name']+','+(_0x3a4962[_0x43e7('0x6c')][_0x43e7('0x7d')]||0x12c),'interval':_0x43e7('0x76')}]},routingClient);})[_0x43e7('0x7')](respondWithResult(_0x15ee83,null))[_0x43e7('0x16')](handleError(_0x15ee83,null));};
\ No newline at end of file
index 9339240..b412862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eb4=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','index','get','/:id','isAuthenticated','show','run','post','create','put','update'];(function(_0x161630,_0x5502b6){var _0x2f82fe=function(_0x5a9b58){while(--_0x5a9b58){_0x161630['push'](_0x161630['shift']());}};_0x2f82fe(++_0x5502b6);}(_0x3eb4,0x6a));var _0x43eb=function(_0x4d3e16,_0x130093){_0x4d3e16=_0x4d3e16-0x0;var _0x5dd92e=_0x3eb4[_0x4d3e16];return _0x5dd92e;};'use strict';var multer=require(_0x43eb('0x0'));var util=require(_0x43eb('0x1'));var path=require('path');var timeout=require(_0x43eb('0x2'));var express=require(_0x43eb('0x3'));var router=express[_0x43eb('0x4')]();var fs_extra=require(_0x43eb('0x5'));var auth=require(_0x43eb('0x6'));var interaction=require(_0x43eb('0x7'));var config=require(_0x43eb('0x8'));var controller=require(_0x43eb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x43eb('0xa')]);router[_0x43eb('0xb')](_0x43eb('0xc'),auth[_0x43eb('0xd')](),controller[_0x43eb('0xe')]);router[_0x43eb('0xb')]('/:id/run',auth[_0x43eb('0xd')](),controller[_0x43eb('0xf')]);router[_0x43eb('0x10')]('/',auth[_0x43eb('0xd')](),controller[_0x43eb('0x11')]);router[_0x43eb('0x12')](_0x43eb('0xc'),auth[_0x43eb('0xd')](),controller[_0x43eb('0x13')]);router['delete']('/:id',auth[_0x43eb('0xd')](),controller[_0x43eb('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x2713=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','run','post','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x1f250e,_0x401a7f){var _0x45532a=function(_0x4cd174){while(--_0x4cd174){_0x1f250e['push'](_0x1f250e['shift']());}};_0x45532a(++_0x401a7f);}(_0x2713,0x150));var _0x3271=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2713[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3271('0x0'));var util=require('util');var path=require(_0x3271('0x1'));var timeout=require(_0x3271('0x2'));var express=require(_0x3271('0x3'));var router=express[_0x3271('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3271('0x5'));var interaction=require(_0x3271('0x6'));var config=require(_0x3271('0x7'));var controller=require(_0x3271('0x8'));router[_0x3271('0x9')]('/',auth[_0x3271('0xa')](),controller[_0x3271('0xb')]);router[_0x3271('0x9')](_0x3271('0xc'),auth[_0x3271('0xa')](),controller[_0x3271('0xd')]);router[_0x3271('0x9')]('/:id/run',auth[_0x3271('0xa')](),controller[_0x3271('0xe')]);router[_0x3271('0xf')]('/',auth[_0x3271('0xa')](),controller['create']);router[_0x3271('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3271('0x11')]);router[_0x3271('0x12')](_0x3271('0xc'),auth['isAuthenticated'](),controller[_0x3271('0x13')]);module['exports']=router;
\ No newline at end of file
index 354b458..adf875f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fa2=['weeks','days','hours','minutes','xlsx','csv','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months'];(function(_0x54efe6,_0x2adc63){var _0x4e0ee4=function(_0x4a7a46){while(--_0x4a7a46){_0x54efe6['push'](_0x54efe6['shift']());}};_0x4e0ee4(++_0x2adc63);}(_0x3fa2,0xed));var _0x23fa=function(_0x467916,_0xa30c33){_0x467916=_0x467916-0x0;var _0x1261c5=_0x3fa2[_0x467916];return _0x1261c5;};'use strict';var Sequelize=require('sequelize');module[_0x23fa('0x0')]={'name':{'type':Sequelize[_0x23fa('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x23fa('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x23fa('0x1')],'allowNull':![],'defaultValue':_0x23fa('0x3')},'startAt':{'type':Sequelize[_0x23fa('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x23fa('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x23fa('0x6')](_0x23fa('0x7'),_0x23fa('0x8'),_0x23fa('0x9'),_0x23fa('0xa'),_0x23fa('0xb'),_0x23fa('0xc'),_0x23fa('0xd')),'allowNull':![],'defaultValue':_0x23fa('0xb')},'output':{'type':Sequelize[_0x23fa('0x6')]('csv','pdf',_0x23fa('0xe')),'allowNull':![],'defaultValue':_0x23fa('0xf')},'type':{'type':Sequelize['ENUM'](_0x23fa('0x10'),_0x23fa('0x11')),'allowNull':![],'defaultValue':_0x23fa('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x23fa('0x1')]},'cc':{'type':Sequelize[_0x23fa('0x12')]},'bcc':{'type':Sequelize[_0x23fa('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x23fa('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1dd8=['pdf','xlsx','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','quarters','weeks','days','minutes','csv'];(function(_0x65a751,_0x659479){var _0x175af1=function(_0x40aa29){while(--_0x40aa29){_0x65a751['push'](_0x65a751['shift']());}};_0x175af1(++_0x659479);}(_0x1dd8,0x126));var _0x81dd=function(_0x123a99,_0x5f0db9){_0x123a99=_0x123a99-0x0;var _0x3ba390=_0x1dd8[_0x123a99];return _0x3ba390;};'use strict';var Sequelize=require(_0x81dd('0x0'));module[_0x81dd('0x1')]={'name':{'type':Sequelize[_0x81dd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x81dd('0x2')]},'active':{'type':Sequelize[_0x81dd('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x81dd('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x81dd('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x81dd('0x6')]('years',_0x81dd('0x7'),'months',_0x81dd('0x8'),_0x81dd('0x9'),'hours',_0x81dd('0xa')),'allowNull':![],'defaultValue':_0x81dd('0x9')},'output':{'type':Sequelize[_0x81dd('0x6')](_0x81dd('0xb'),_0x81dd('0xc'),_0x81dd('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x81dd('0x6')]('custom',_0x81dd('0xe')),'allowNull':![],'defaultValue':_0x81dd('0xf')},'sendMail':{'type':Sequelize[_0x81dd('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x81dd('0x2')]},'cc':{'type':Sequelize[_0x81dd('0x10')]},'bcc':{'type':Sequelize[_0x81dd('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x81dd('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index c7073bf..11d1d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfefc=['sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','map','Schedule','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xfefc,0x116));var _0xcfef=function(_0x36167e,_0xc4c355){_0x36167e=_0x36167e-0x0;var _0x2a9128=_0xfefc[_0x36167e];return _0x2a9128;};'use strict';var emlformat=require(_0xcfef('0x0'));var rimraf=require(_0xcfef('0x1'));var zipdir=require(_0xcfef('0x2'));var jsonpatch=require(_0xcfef('0x3'));var rp=require('request-promise');var moment=require(_0xcfef('0x4'));var BPromise=require(_0xcfef('0x5'));var Mustache=require(_0xcfef('0x6'));var util=require(_0xcfef('0x7'));var path=require(_0xcfef('0x8'));var sox=require(_0xcfef('0x9'));var csv=require('to-csv');var ejs=require(_0xcfef('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfef('0xb'));var squel=require(_0xcfef('0xc'));var crypto=require(_0xcfef('0xd'));var jsforce=require(_0xcfef('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcfef('0xf'));var querystring=require('querystring');var Papa=require(_0xcfef('0x10'));var Redis=require(_0xcfef('0x11'));var authService=require(_0xcfef('0x12'));var qs=require(_0xcfef('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcfef('0x14'));var logger=require(_0xcfef('0x15'))(_0xcfef('0x16'));var utils=require(_0xcfef('0x17'));var config=require(_0xcfef('0x18'));var licenseUtil=require(_0xcfef('0x19'));var db=require(_0xcfef('0x1a'))['db'];function respondWithStatusCode(_0x27e131,_0x4a1484){_0x4a1484=_0x4a1484||0xcc;return function(_0x682691){if(_0x682691){return _0x27e131[_0xcfef('0x1b')](_0x4a1484);}return _0x27e131[_0xcfef('0x1c')](_0x4a1484)['end']();};}function respondWithResult(_0x3863ef,_0x343dcc){_0x343dcc=_0x343dcc||0xc8;return function(_0x3e3d49){if(_0x3e3d49){return _0x3863ef['status'](_0x343dcc)['json'](_0x3e3d49);}};}function respondWithFilteredResult(_0x388e52,_0x448af5){return function(_0x4f3b82){if(_0x4f3b82){var _0xdbad90=typeof _0x448af5[_0xcfef('0x1d')]===_0xcfef('0x1e')&&typeof _0x448af5[_0xcfef('0x1f')]==='undefined';var _0x129cd0=_0x4f3b82[_0xcfef('0x20')];var _0x297bc1=_0xdbad90?0x0:_0x448af5[_0xcfef('0x1d')];var _0x2bd977=_0xdbad90?_0x4f3b82['count']:_0x448af5['offset']+_0x448af5[_0xcfef('0x1f')];var _0x28d0d2;if(_0x2bd977>=_0x129cd0){_0x2bd977=_0x129cd0;_0x28d0d2=0xc8;}else{_0x28d0d2=0xce;}_0x388e52[_0xcfef('0x1c')](_0x28d0d2);return _0x388e52[_0xcfef('0x21')](_0xcfef('0x22'),_0x297bc1+'-'+_0x2bd977+'/'+_0x129cd0)[_0xcfef('0x23')](_0x4f3b82);}return null;};}function patchUpdates(_0x10fd9d){return function(_0x4d225c){try{jsonpatch[_0xcfef('0x24')](_0x4d225c,_0x10fd9d,!![]);}catch(_0x12c246){return BPromise[_0xcfef('0x25')](_0x12c246);}return _0x4d225c[_0xcfef('0x26')]();};}function saveUpdates(_0x49ff9e,_0x47e608){return function(_0x12c525){if(_0x12c525){return _0x12c525['update'](_0x49ff9e)[_0xcfef('0x27')](function(_0x261007){return _0x261007;});}return null;};}function removeEntity(_0x45c7e2,_0x4f36f6){return function(_0x187ab8){if(_0x187ab8){return _0x187ab8[_0xcfef('0x28')]()['then'](function(){var _0x585e0d=_0x187ab8[_0xcfef('0x29')]({'plain':!![]});var _0x56ccb2='Scheduler';return db[_0xcfef('0x2a')]['destroy']({'where':{'type':_0x56ccb2,'resourceId':_0x585e0d['id']}})[_0xcfef('0x27')](function(){return _0x187ab8;});})[_0xcfef('0x27')](function(){_0x45c7e2[_0xcfef('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8bf1,_0x26eb15){return function(_0x2e42a9){if(!_0x2e42a9){_0x3c8bf1['sendStatus'](0x194);}return _0x2e42a9;};}function handleError(_0x12fb46,_0xbb02f1){_0xbb02f1=_0xbb02f1||0x1f4;return function(_0xbfa00f){logger['error'](_0xbfa00f['stack']);if(_0xbfa00f[_0xcfef('0x2b')]){delete _0xbfa00f[_0xcfef('0x2b')];}_0x12fb46['status'](_0xbb02f1)[_0xcfef('0x2c')](_0xbfa00f);};}exports[_0xcfef('0x2d')]=function(_0x304157,_0x4802bc){var _0x413e8d={},_0x50cdd6={},_0x567ea4={'count':0x0,'rows':[]};var _0x599440=_[_0xcfef('0x2e')](db[_0xcfef('0x2f')][_0xcfef('0x30')],function(_0x3d6e0d){return{'name':_0x3d6e0d['fieldName'],'type':_0x3d6e0d['type']['key']};});_0x50cdd6['model']=_[_0xcfef('0x2e')](_0x599440,_0xcfef('0x2b'));_0x50cdd6[_0xcfef('0x31')]=_[_0xcfef('0x32')](_0x304157['query']);_0x50cdd6[_0xcfef('0x33')]=_[_0xcfef('0x34')](_0x50cdd6[_0xcfef('0x35')],_0x50cdd6[_0xcfef('0x31')]);_0x413e8d[_0xcfef('0x36')]=_[_0xcfef('0x34')](_0x50cdd6[_0xcfef('0x35')],qs[_0xcfef('0x37')](_0x304157[_0xcfef('0x31')][_0xcfef('0x37')]));_0x413e8d[_0xcfef('0x36')]=_0x413e8d[_0xcfef('0x36')][_0xcfef('0x38')]?_0x413e8d[_0xcfef('0x36')]:_0x50cdd6[_0xcfef('0x35')];if(!_0x304157[_0xcfef('0x31')][_0xcfef('0x39')]('nolimit')){_0x413e8d[_0xcfef('0x1f')]=qs[_0xcfef('0x1f')](_0x304157[_0xcfef('0x31')][_0xcfef('0x1f')]);_0x413e8d[_0xcfef('0x1d')]=qs['offset'](_0x304157[_0xcfef('0x31')][_0xcfef('0x1d')]);}_0x413e8d['order']=qs[_0xcfef('0x3a')](_0x304157[_0xcfef('0x31')]['sort']);_0x413e8d[_0xcfef('0x3b')]=qs[_0xcfef('0x33')](_[_0xcfef('0x3c')](_0x304157[_0xcfef('0x31')],_0x50cdd6[_0xcfef('0x33')]),_0x599440);if(_0x304157['query']['filter']){_0x413e8d[_0xcfef('0x3b')]=_['merge'](_0x413e8d[_0xcfef('0x3b')],{'$or':_[_0xcfef('0x2e')](_0x599440,function(_0x310ddd){if(_0x310ddd[_0xcfef('0x3d')]!==_0xcfef('0x3e')){var _0x18622e={};_0x18622e[_0x310ddd[_0xcfef('0x2b')]]={'$like':'%'+_0x304157['query']['filter']+'%'};return _0x18622e;}})});}_0x413e8d=_[_0xcfef('0x3f')]({},_0x413e8d,_0x304157[_0xcfef('0x40')]);var _0x48ca10={'where':_0x413e8d[_0xcfef('0x3b')]};return db['Schedule'][_0xcfef('0x20')](_0x48ca10)[_0xcfef('0x27')](function(_0x308ae4){_0x567ea4['count']=_0x308ae4;if(_0x304157['query'][_0xcfef('0x41')]){_0x413e8d[_0xcfef('0x42')]=[{'all':!![]}];}return db[_0xcfef('0x2f')][_0xcfef('0x43')](_0x413e8d);})[_0xcfef('0x27')](function(_0x2d986e){_0x567ea4[_0xcfef('0x44')]=_0x2d986e;return _0x567ea4;})[_0xcfef('0x27')](respondWithFilteredResult(_0x4802bc,_0x413e8d))[_0xcfef('0x45')](handleError(_0x4802bc,null));};exports[_0xcfef('0x46')]=function(_0x41fc93,_0x319232){var _0x4733a2={'raw':![],'where':{'id':_0x41fc93[_0xcfef('0x47')]['id']}},_0xc1a484={};_0xc1a484[_0xcfef('0x35')]=_[_0xcfef('0x32')](db[_0xcfef('0x2f')]['rawAttributes']);_0xc1a484['query']=_[_0xcfef('0x32')](_0x41fc93['query']);_0xc1a484['filters']=_[_0xcfef('0x34')](_0xc1a484[_0xcfef('0x35')],_0xc1a484[_0xcfef('0x31')]);_0x4733a2['attributes']=_[_0xcfef('0x34')](_0xc1a484[_0xcfef('0x35')],qs['fields'](_0x41fc93[_0xcfef('0x31')][_0xcfef('0x37')]));_0x4733a2[_0xcfef('0x36')]=_0x4733a2[_0xcfef('0x36')][_0xcfef('0x38')]?_0x4733a2['attributes']:_0xc1a484[_0xcfef('0x35')];if(_0x41fc93[_0xcfef('0x31')][_0xcfef('0x41')]){_0x4733a2[_0xcfef('0x42')]=[{'all':!![]}];}_0x4733a2=_[_0xcfef('0x3f')]({},_0x4733a2,_0x41fc93['options']);return db[_0xcfef('0x2f')][_0xcfef('0x48')](_0x4733a2)[_0xcfef('0x27')](handleEntityNotFound(_0x319232,null))[_0xcfef('0x27')](respondWithResult(_0x319232,null))[_0xcfef('0x45')](handleError(_0x319232,null));};exports[_0xcfef('0x49')]=function(_0x2106a7,_0x2b8c2f){return db['Schedule'][_0xcfef('0x49')](_0x2106a7['body'],{})[_0xcfef('0x27')](function(_0x448115){var _0xc84d6a=_0x2106a7['user']['get']({'plain':!![]});if(!_0xc84d6a)throw new Error(_0xcfef('0x4a'));if(_0xc84d6a[_0xcfef('0x4b')]===_0xcfef('0x4c')){var _0x7abe92=_0x448115[_0xcfef('0x29')]({'plain':!![]});var _0x1a5fee=_0xcfef('0x4d');return db[_0xcfef('0x4e')]['find']({'where':{'name':_0x1a5fee,'userProfileId':_0xc84d6a['userProfileId']},'raw':!![]})[_0xcfef('0x27')](function(_0x17eb63){if(_0x17eb63&&_0x17eb63[_0xcfef('0x4f')]===0x0){return db[_0xcfef('0x2a')][_0xcfef('0x49')]({'name':_0x7abe92['name'],'resourceId':_0x7abe92['id'],'type':_0x17eb63['name'],'sectionId':_0x17eb63['id']},{})[_0xcfef('0x27')](function(){return _0x448115;});}else{return _0x448115;}})[_0xcfef('0x45')](function(_0x1c95a2){logger['error'](_0xcfef('0x50'),_0x1c95a2);throw _0x1c95a2;});}return _0x448115;})[_0xcfef('0x27')](respondWithResult(_0x2b8c2f,0xc9))[_0xcfef('0x45')](handleError(_0x2b8c2f,null));};exports['update']=function(_0x52a567,_0x1530ca){if(_0x52a567[_0xcfef('0x51')]['id']){delete _0x52a567[_0xcfef('0x51')]['id'];}return db[_0xcfef('0x2f')][_0xcfef('0x48')]({'where':{'id':_0x52a567[_0xcfef('0x47')]['id']}})['then'](handleEntityNotFound(_0x1530ca,null))[_0xcfef('0x27')](saveUpdates(_0x52a567['body'],null))[_0xcfef('0x27')](respondWithResult(_0x1530ca,null))['catch'](handleError(_0x1530ca,null));};exports[_0xcfef('0x28')]=function(_0x35e4cb,_0x17fc37){return db['Schedule'][_0xcfef('0x48')]({'where':{'id':_0x35e4cb[_0xcfef('0x47')]['id']}})[_0xcfef('0x27')](handleEntityNotFound(_0x17fc37,null))['then'](removeEntity(_0x17fc37,null))[_0xcfef('0x45')](handleError(_0x17fc37,null));};exports[_0xcfef('0x52')]=function(_0x5a74c0,_0x4e7e9e,_0x27a691){var _0x56277b=require(_0xcfef('0x53'));return db[_0xcfef('0x2f')][_0xcfef('0x48')]({'where':{'id':_0x5a74c0['params']['id']},'raw':!![]})[_0xcfef('0x27')](handleEntityNotFound(_0x4e7e9e,null))[_0xcfef('0x27')](function(){_0x56277b[_0xcfef('0x52')](_0x5a74c0[_0xcfef('0x47')]['id']);})[_0xcfef('0x27')](respondWithStatusCode(_0x4e7e9e,null))[_0xcfef('0x45')](handleError(_0x4e7e9e,null));};
\ No newline at end of file
+var _0xdf4b=['include','findAll','rows','show','rawAttributes','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','reject','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','Schedule','includeAll'];(function(_0x5f4ce0,_0x36e419){var _0x464016=function(_0x4fe264){while(--_0x4fe264){_0x5f4ce0['push'](_0x5f4ce0['shift']());}};_0x464016(++_0x36e419);}(_0xdf4b,0x10f));var _0xbdf4=function(_0x542b86,_0x2b80d5){_0x542b86=_0x542b86-0x0;var _0x4e705d=_0xdf4b[_0x542b86];return _0x4e705d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdf4('0x0'));var zipdir=require(_0xbdf4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbdf4('0x2'));var moment=require(_0xbdf4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbdf4('0x4'));var util=require(_0xbdf4('0x5'));var path=require(_0xbdf4('0x6'));var sox=require(_0xbdf4('0x7'));var csv=require(_0xbdf4('0x8'));var ejs=require(_0xbdf4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbdf4('0xa'));var crypto=require('crypto');var jsforce=require(_0xbdf4('0xb'));var deskjs=require(_0xbdf4('0xc'));var toCsv=require(_0xbdf4('0x8'));var querystring=require(_0xbdf4('0xd'));var Papa=require(_0xbdf4('0xe'));var Redis=require(_0xbdf4('0xf'));var authService=require(_0xbdf4('0x10'));var qs=require(_0xbdf4('0x11'));var as=require(_0xbdf4('0x12'));var hardwareService=require(_0xbdf4('0x13'));var logger=require('../../config/logger')(_0xbdf4('0x14'));var utils=require('../../config/utils');var config=require(_0xbdf4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbdf4('0x16'))['db'];function respondWithStatusCode(_0x57bc88,_0x1b3da1){_0x1b3da1=_0x1b3da1||0xcc;return function(_0x4a4b3f){if(_0x4a4b3f){return _0x57bc88['sendStatus'](_0x1b3da1);}return _0x57bc88[_0xbdf4('0x17')](_0x1b3da1)[_0xbdf4('0x18')]();};}function respondWithResult(_0x36b605,_0xac176d){_0xac176d=_0xac176d||0xc8;return function(_0x40a113){if(_0x40a113){return _0x36b605['status'](_0xac176d)[_0xbdf4('0x19')](_0x40a113);}};}function respondWithFilteredResult(_0x59b19c,_0x113a61){return function(_0x4f2a6a){if(_0x4f2a6a){var _0x2c59e6=typeof _0x113a61['offset']===_0xbdf4('0x1a')&&typeof _0x113a61[_0xbdf4('0x1b')]===_0xbdf4('0x1a');var _0x39d14f=_0x4f2a6a[_0xbdf4('0x1c')];var _0x551be2=_0x2c59e6?0x0:_0x113a61[_0xbdf4('0x1d')];var _0x43bc03=_0x2c59e6?_0x4f2a6a[_0xbdf4('0x1c')]:_0x113a61['offset']+_0x113a61['limit'];var _0xa24ffa;if(_0x43bc03>=_0x39d14f){_0x43bc03=_0x39d14f;_0xa24ffa=0xc8;}else{_0xa24ffa=0xce;}_0x59b19c['status'](_0xa24ffa);return _0x59b19c['set'](_0xbdf4('0x1e'),_0x551be2+'-'+_0x43bc03+'/'+_0x39d14f)[_0xbdf4('0x19')](_0x4f2a6a);}return null;};}function patchUpdates(_0x223c52){return function(_0x4b2ca0){try{jsonpatch['apply'](_0x4b2ca0,_0x223c52,!![]);}catch(_0x3e5a5f){return BPromise[_0xbdf4('0x1f')](_0x3e5a5f);}return _0x4b2ca0['save']();};}function saveUpdates(_0xaf6e25,_0x36922f){return function(_0x54c592){if(_0x54c592){return _0x54c592[_0xbdf4('0x20')](_0xaf6e25)[_0xbdf4('0x21')](function(_0x26c160){return _0x26c160;});}return null;};}function removeEntity(_0x1fff2f,_0x4989c7){return function(_0x427b3d){if(_0x427b3d){return _0x427b3d[_0xbdf4('0x22')]()[_0xbdf4('0x21')](function(){var _0x4ef46d=_0x427b3d[_0xbdf4('0x23')]({'plain':!![]});var _0x18f8e2=_0xbdf4('0x24');return db[_0xbdf4('0x25')][_0xbdf4('0x22')]({'where':{'type':_0x18f8e2,'resourceId':_0x4ef46d['id']}})[_0xbdf4('0x21')](function(){return _0x427b3d;});})[_0xbdf4('0x21')](function(){_0x1fff2f[_0xbdf4('0x17')](0xcc)[_0xbdf4('0x18')]();});}};}function handleEntityNotFound(_0x30b9c4,_0xf01238){return function(_0x4fdaec){if(!_0x4fdaec){_0x30b9c4[_0xbdf4('0x26')](0x194);}return _0x4fdaec;};}function handleError(_0x40ce3a,_0x2325a8){_0x2325a8=_0x2325a8||0x1f4;return function(_0x11b01c){logger['error'](_0x11b01c[_0xbdf4('0x27')]);if(_0x11b01c[_0xbdf4('0x28')]){delete _0x11b01c[_0xbdf4('0x28')];}_0x40ce3a['status'](_0x2325a8)[_0xbdf4('0x29')](_0x11b01c);};}exports[_0xbdf4('0x2a')]=function(_0x5a84ea,_0x3970ec){var _0x37a0ba={},_0x1268ca={},_0x4bf13e={'count':0x0,'rows':[]};var _0x33299d=_[_0xbdf4('0x2b')](db['Schedule']['rawAttributes'],function(_0x482385){return{'name':_0x482385[_0xbdf4('0x2c')],'type':_0x482385[_0xbdf4('0x2d')]['key']};});_0x1268ca[_0xbdf4('0x2e')]=_[_0xbdf4('0x2b')](_0x33299d,'name');_0x1268ca[_0xbdf4('0x2f')]=_[_0xbdf4('0x30')](_0x5a84ea[_0xbdf4('0x2f')]);_0x1268ca['filters']=_[_0xbdf4('0x31')](_0x1268ca['model'],_0x1268ca[_0xbdf4('0x2f')]);_0x37a0ba[_0xbdf4('0x32')]=_[_0xbdf4('0x31')](_0x1268ca[_0xbdf4('0x2e')],qs[_0xbdf4('0x33')](_0x5a84ea[_0xbdf4('0x2f')][_0xbdf4('0x33')]));_0x37a0ba[_0xbdf4('0x32')]=_0x37a0ba['attributes'][_0xbdf4('0x34')]?_0x37a0ba[_0xbdf4('0x32')]:_0x1268ca[_0xbdf4('0x2e')];if(!_0x5a84ea['query'][_0xbdf4('0x35')](_0xbdf4('0x36'))){_0x37a0ba['limit']=qs[_0xbdf4('0x1b')](_0x5a84ea[_0xbdf4('0x2f')][_0xbdf4('0x1b')]);_0x37a0ba['offset']=qs[_0xbdf4('0x1d')](_0x5a84ea[_0xbdf4('0x2f')][_0xbdf4('0x1d')]);}_0x37a0ba[_0xbdf4('0x37')]=qs[_0xbdf4('0x38')](_0x5a84ea[_0xbdf4('0x2f')]['sort']);_0x37a0ba[_0xbdf4('0x39')]=qs['filters'](_[_0xbdf4('0x3a')](_0x5a84ea['query'],_0x1268ca[_0xbdf4('0x3b')]),_0x33299d);if(_0x5a84ea['query'][_0xbdf4('0x3c')]){_0x37a0ba[_0xbdf4('0x39')]=_['merge'](_0x37a0ba[_0xbdf4('0x39')],{'$or':_[_0xbdf4('0x2b')](_0x33299d,function(_0x5121c0){if(_0x5121c0[_0xbdf4('0x2d')]!=='VIRTUAL'){var _0xb61530={};_0xb61530[_0x5121c0[_0xbdf4('0x28')]]={'$like':'%'+_0x5a84ea[_0xbdf4('0x2f')][_0xbdf4('0x3c')]+'%'};return _0xb61530;}})});}_0x37a0ba=_[_0xbdf4('0x3d')]({},_0x37a0ba,_0x5a84ea[_0xbdf4('0x3e')]);var _0x2a3519={'where':_0x37a0ba[_0xbdf4('0x39')]};return db[_0xbdf4('0x3f')][_0xbdf4('0x1c')](_0x2a3519)[_0xbdf4('0x21')](function(_0x4241d0){_0x4bf13e[_0xbdf4('0x1c')]=_0x4241d0;if(_0x5a84ea[_0xbdf4('0x2f')][_0xbdf4('0x40')]){_0x37a0ba[_0xbdf4('0x41')]=[{'all':!![]}];}return db[_0xbdf4('0x3f')][_0xbdf4('0x42')](_0x37a0ba);})[_0xbdf4('0x21')](function(_0x1f7cd7){_0x4bf13e[_0xbdf4('0x43')]=_0x1f7cd7;return _0x4bf13e;})[_0xbdf4('0x21')](respondWithFilteredResult(_0x3970ec,_0x37a0ba))['catch'](handleError(_0x3970ec,null));};exports[_0xbdf4('0x44')]=function(_0x4bced2,_0xe29e5f){var _0x5c5855={'raw':![],'where':{'id':_0x4bced2['params']['id']}},_0x3a6933={};_0x3a6933['model']=_[_0xbdf4('0x30')](db[_0xbdf4('0x3f')][_0xbdf4('0x45')]);_0x3a6933['query']=_[_0xbdf4('0x30')](_0x4bced2[_0xbdf4('0x2f')]);_0x3a6933[_0xbdf4('0x3b')]=_[_0xbdf4('0x31')](_0x3a6933[_0xbdf4('0x2e')],_0x3a6933[_0xbdf4('0x2f')]);_0x5c5855['attributes']=_[_0xbdf4('0x31')](_0x3a6933[_0xbdf4('0x2e')],qs[_0xbdf4('0x33')](_0x4bced2['query']['fields']));_0x5c5855[_0xbdf4('0x32')]=_0x5c5855['attributes'][_0xbdf4('0x34')]?_0x5c5855[_0xbdf4('0x32')]:_0x3a6933[_0xbdf4('0x2e')];if(_0x4bced2[_0xbdf4('0x2f')][_0xbdf4('0x40')]){_0x5c5855['include']=[{'all':!![]}];}_0x5c5855=_[_0xbdf4('0x3d')]({},_0x5c5855,_0x4bced2['options']);return db['Schedule'][_0xbdf4('0x46')](_0x5c5855)['then'](handleEntityNotFound(_0xe29e5f,null))['then'](respondWithResult(_0xe29e5f,null))[_0xbdf4('0x47')](handleError(_0xe29e5f,null));};exports['create']=function(_0x4f44bf,_0x1130d7){return db[_0xbdf4('0x3f')]['create'](_0x4f44bf[_0xbdf4('0x48')],{})[_0xbdf4('0x21')](function(_0x4e337c){var _0x3aa229=_0x4f44bf[_0xbdf4('0x49')]['get']({'plain':!![]});if(!_0x3aa229)throw new Error(_0xbdf4('0x4a'));if(_0x3aa229[_0xbdf4('0x4b')]===_0xbdf4('0x49')){var _0x1bdfdd=_0x4e337c[_0xbdf4('0x23')]({'plain':!![]});var _0x32beab='Scheduler';return db['UserProfileSection'][_0xbdf4('0x46')]({'where':{'name':_0x32beab,'userProfileId':_0x3aa229[_0xbdf4('0x4c')]},'raw':!![]})['then'](function(_0xd30303){if(_0xd30303&&_0xd30303[_0xbdf4('0x4d')]===0x0){return db[_0xbdf4('0x25')][_0xbdf4('0x4e')]({'name':_0x1bdfdd['name'],'resourceId':_0x1bdfdd['id'],'type':_0xd30303[_0xbdf4('0x28')],'sectionId':_0xd30303['id']},{})[_0xbdf4('0x21')](function(){return _0x4e337c;});}else{return _0x4e337c;}})[_0xbdf4('0x47')](function(_0x454df7){logger[_0xbdf4('0x4f')](_0xbdf4('0x50'),_0x454df7);throw _0x454df7;});}return _0x4e337c;})['then'](respondWithResult(_0x1130d7,0xc9))[_0xbdf4('0x47')](handleError(_0x1130d7,null));};exports[_0xbdf4('0x20')]=function(_0x27d96a,_0x44785c){if(_0x27d96a['body']['id']){delete _0x27d96a['body']['id'];}return db[_0xbdf4('0x3f')][_0xbdf4('0x46')]({'where':{'id':_0x27d96a[_0xbdf4('0x51')]['id']}})[_0xbdf4('0x21')](handleEntityNotFound(_0x44785c,null))['then'](saveUpdates(_0x27d96a['body'],null))[_0xbdf4('0x21')](respondWithResult(_0x44785c,null))[_0xbdf4('0x47')](handleError(_0x44785c,null));};exports['destroy']=function(_0x5974d4,_0x4a1e7f){return db['Schedule'][_0xbdf4('0x46')]({'where':{'id':_0x5974d4[_0xbdf4('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a1e7f,null))[_0xbdf4('0x21')](removeEntity(_0x4a1e7f,null))['catch'](handleError(_0x4a1e7f,null));};exports[_0xbdf4('0x52')]=function(_0x4362b5,_0x509506,_0x5c02d6){var _0x1e5d02=require(_0xbdf4('0x53'));return db['Schedule'][_0xbdf4('0x46')]({'where':{'id':_0x4362b5[_0xbdf4('0x51')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x509506,null))[_0xbdf4('0x21')](function(){_0x1e5d02[_0xbdf4('0x52')](_0x4362b5['params']['id']);})[_0xbdf4('0x21')](respondWithStatusCode(_0x509506,null))[_0xbdf4('0x47')](handleError(_0x509506,null));};
\ No newline at end of file
index 54474f6..8bd385b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6ed=['path','rimraf','../../config/environment','exports','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x536d3a,_0x31e052){var _0x51e1e0=function(_0x13ec1c){while(--_0x13ec1c){_0x536d3a['push'](_0x536d3a['shift']());}};_0x51e1e0(++_0x31e052);}(_0xf6ed,0x1da));var _0xdf6e=function(_0xb1dda1,_0x4a4ecd){_0xb1dda1=_0xb1dda1-0x0;var _0x31652a=_0xf6ed[_0xb1dda1];return _0x31652a;};'use strict';var _=require(_0xdf6e('0x0'));var util=require(_0xdf6e('0x1'));var logger=require(_0xdf6e('0x2'))(_0xdf6e('0x3'));var moment=require(_0xdf6e('0x4'));var BPromise=require(_0xdf6e('0x5'));var rp=require(_0xdf6e('0x6'));var fs=require('fs');var path=require(_0xdf6e('0x7'));var rimraf=require(_0xdf6e('0x8'));var config=require(_0xdf6e('0x9'));var attributes=require('./schedule.attributes');module[_0xdf6e('0xa')]=function(_0x7e85c,_0x572f05){return _0x7e85c['define'](_0xdf6e('0xb'),attributes,{'tableName':_0xdf6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf960=['moment','request-promise','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','util','api'];(function(_0x4a1c16,_0xdbc6d6){var _0x65c1d1=function(_0x195879){while(--_0x195879){_0x4a1c16['push'](_0x4a1c16['shift']());}};_0x65c1d1(++_0xdbc6d6);}(_0xf960,0x12a));var _0x0f96=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0xf960[_0x495b3d];return _0x4cb329;};'use strict';var _=require('lodash');var util=require(_0x0f96('0x0'));var logger=require('../../config/logger')(_0x0f96('0x1'));var moment=require(_0x0f96('0x2'));var BPromise=require('bluebird');var rp=require(_0x0f96('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f96('0x4'));var attributes=require(_0x0f96('0x5'));module[_0x0f96('0x6')]=function(_0x2d43de,_0x6e12a){return _0x2d43de[_0x0f96('0x7')](_0x0f96('0x8'),attributes,{'tableName':_0x0f96('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9c0a491..32bae04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d68=['code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error'];(function(_0x5e88b5,_0x3f3530){var _0x1f6667=function(_0x1deaab){while(--_0x1deaab){_0x5e88b5['push'](_0x5e88b5['shift']());}};_0x1f6667(++_0x3f3530);}(_0x6d68,0x9d));var _0x86d6=function(_0x3660cc,_0x2aeede){_0x3660cc=_0x3660cc-0x0;var _0xf1ed7e=_0x6d68[_0x3660cc];return _0xf1ed7e;};'use strict';var _=require(_0x86d6('0x0'));var util=require('util');var moment=require(_0x86d6('0x1'));var BPromise=require(_0x86d6('0x2'));var rs=require(_0x86d6('0x3'));var fs=require('fs');var Redis=require(_0x86d6('0x4'));var db=require(_0x86d6('0x5'))['db'];var utils=require(_0x86d6('0x6'));var logger=require(_0x86d6('0x7'))(_0x86d6('0x8'));var config=require(_0x86d6('0x9'));var jayson=require(_0x86d6('0xa'));var client=jayson[_0x86d6('0xb')][_0x86d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4897bc,_0x382d85,_0x59f944){return new BPromise(function(_0x1b92ba,_0x38f814){return client[_0x86d6('0xd')](_0x4897bc,_0x59f944)['then'](function(_0x46b89a){logger[_0x86d6('0xe')](_0x86d6('0xf'),_0x382d85,_0x86d6('0x10'));logger['debug'](_0x86d6('0x11'),_0x382d85,'request\x20sent',JSON['stringify'](_0x46b89a));if(_0x46b89a['error']){if(_0x46b89a[_0x86d6('0x12')][_0x86d6('0x13')]===0x1f4){logger[_0x86d6('0x12')](_0x86d6('0xf'),_0x382d85,_0x46b89a[_0x86d6('0x12')]['message']);return _0x38f814(_0x46b89a[_0x86d6('0x12')][_0x86d6('0x14')]);}logger['error'](_0x86d6('0xf'),_0x382d85,_0x46b89a[_0x86d6('0x12')][_0x86d6('0x14')]);return _0x1b92ba(_0x46b89a['error'][_0x86d6('0x14')]);}else{logger[_0x86d6('0xe')]('Schedule,\x20%s,\x20%s',_0x382d85,_0x86d6('0x10'));_0x1b92ba(_0x46b89a[_0x86d6('0x15')]['message']);}})['catch'](function(_0x1a8727){logger[_0x86d6('0x12')]('Schedule,\x20%s,\x20%s',_0x382d85,_0x1a8727);_0x38f814(_0x1a8727);});});}
\ No newline at end of file
+var _0x1346=['../../mysqldb','rpc','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x246827,_0x439fec){var _0x2bc575=function(_0x3606b9){while(--_0x3606b9){_0x246827['push'](_0x246827['shift']());}};_0x2bc575(++_0x439fec);}(_0x1346,0x14f));var _0x6134=function(_0x26629d,_0x29f187){_0x26629d=_0x26629d-0x0;var _0x5a24e6=_0x1346[_0x26629d];return _0x5a24e6;};'use strict';var _=require('lodash');var util=require(_0x6134('0x0'));var moment=require(_0x6134('0x1'));var BPromise=require(_0x6134('0x2'));var rs=require(_0x6134('0x3'));var fs=require('fs');var Redis=require(_0x6134('0x4'));var db=require(_0x6134('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6134('0x6'));var config=require('../../config/environment');var jayson=require(_0x6134('0x7'));var client=jayson[_0x6134('0x8')][_0x6134('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36368c,_0x27c2e7,_0x48aed6){return new BPromise(function(_0x5af85f,_0x56557b){return client['request'](_0x36368c,_0x48aed6)[_0x6134('0xa')](function(_0x303841){logger[_0x6134('0xb')](_0x6134('0xc'),_0x27c2e7,_0x6134('0xd'));logger['debug'](_0x6134('0xe'),_0x27c2e7,_0x6134('0xd'),JSON[_0x6134('0xf')](_0x303841));if(_0x303841['error']){if(_0x303841['error']['code']===0x1f4){logger[_0x6134('0x10')](_0x6134('0xc'),_0x27c2e7,_0x303841[_0x6134('0x10')][_0x6134('0x11')]);return _0x56557b(_0x303841[_0x6134('0x10')][_0x6134('0x11')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x27c2e7,_0x303841[_0x6134('0x10')][_0x6134('0x11')]);return _0x5af85f(_0x303841[_0x6134('0x10')][_0x6134('0x11')]);}else{logger[_0x6134('0xb')](_0x6134('0xc'),_0x27c2e7,_0x6134('0xd'));_0x5af85f(_0x303841[_0x6134('0x12')][_0x6134('0x11')]);}})[_0x6134('0x13')](function(_0xb3058a){logger[_0x6134('0x10')](_0x6134('0xc'),_0x27c2e7,_0xb3058a);_0x56557b(_0xb3058a);});});}
\ No newline at end of file
index 3891916..f4df629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66af=['index','/describe','/:id','show','/:id/download','download','post','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x72feae,_0x7c2439){var _0x2879fa=function(_0x1fb924){while(--_0x1fb924){_0x72feae['push'](_0x72feae['shift']());}};_0x2879fa(++_0x7c2439);}(_0x66af,0x1a8));var _0xf66a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x66af[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf66a('0x0'));var timeout=require(_0xf66a('0x1'));var express=require(_0xf66a('0x2'));var router=express[_0xf66a('0x3')]();var fs_extra=require(_0xf66a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf66a('0x5'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0xf66a('0x6')]('/',auth[_0xf66a('0x7')](),controller[_0xf66a('0x8')]);router['get'](_0xf66a('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xf66a('0x6')](_0xf66a('0xa'),auth[_0xf66a('0x7')](),controller[_0xf66a('0xb')]);router[_0xf66a('0x6')](_0xf66a('0xc'),auth[_0xf66a('0x7')](),controller[_0xf66a('0xd')]);router[_0xf66a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf66a('0xf')](_0xf66a('0xa'),auth[_0xf66a('0x7')](),controller['update']);router[_0xf66a('0x10')](_0xf66a('0xa'),auth[_0xf66a('0x7')](),controller['destroy']);module[_0xf66a('0x11')]=router;
\ No newline at end of file
+var _0x0d2b=['post','put','update','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','download'];(function(_0x1109e2,_0x2597eb){var _0x24e51b=function(_0xe33e93){while(--_0xe33e93){_0x1109e2['push'](_0x1109e2['shift']());}};_0x24e51b(++_0x2597eb);}(_0x0d2b,0x1b4));var _0xb0d2=function(_0x1dd78e,_0x5b4224){_0x1dd78e=_0x1dd78e-0x0;var _0x2f57b8=_0x0d2b[_0x1dd78e];return _0x2f57b8;};'use strict';var multer=require(_0xb0d2('0x0'));var util=require(_0xb0d2('0x1'));var path=require(_0xb0d2('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0d2('0x3'));var router=express['Router']();var fs_extra=require(_0xb0d2('0x4'));var auth=require(_0xb0d2('0x5'));var interaction=require(_0xb0d2('0x6'));var config=require(_0xb0d2('0x7'));var controller=require('./screenRecording.controller');router[_0xb0d2('0x8')]('/',auth[_0xb0d2('0x9')](),controller[_0xb0d2('0xa')]);router[_0xb0d2('0x8')]('/describe',auth[_0xb0d2('0x9')](),controller[_0xb0d2('0xb')]);router[_0xb0d2('0x8')](_0xb0d2('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb0d2('0x8')]('/:id/download',auth[_0xb0d2('0x9')](),controller[_0xb0d2('0xd')]);router[_0xb0d2('0xe')]('/',auth[_0xb0d2('0x9')](),controller['create']);router[_0xb0d2('0xf')](_0xb0d2('0xc'),auth[_0xb0d2('0x9')](),controller[_0xb0d2('0x10')]);router['delete'](_0xb0d2('0xc'),auth[_0xb0d2('0x9')](),controller[_0xb0d2('0x11')]);module['exports']=router;
\ No newline at end of file
index 8a5be5f..6bdeb34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x866a=['setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','replace'];(function(_0x453627,_0x437b9a){var _0x55b43b=function(_0x3c91a0){while(--_0x3c91a0){_0x453627['push'](_0x453627['shift']());}};_0x55b43b(++_0x437b9a);}(_0x866a,0x156));var _0xa866=function(_0x2d57a9,_0x5ae060){_0x2d57a9=_0x2d57a9-0x0;var _0x1b9671=_0x866a[_0x2d57a9];return _0x1b9671;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa866('0x0'));var path=require(_0xa866('0x1'));var config=require(_0xa866('0x2'));module[_0xa866('0x3')]={'format':{'type':Sequelize[_0xa866('0x4')],'get':function(){return this['getDataValue'](_0xa866('0x5'))?path[_0xa866('0x6')](this[_0xa866('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xa866('0x8')]},'channel':{'type':Sequelize[_0xa866('0x8')]},'value':{'type':Sequelize[_0xa866('0x8')],'set':function(_0x288582){var _0x3d1380=_0x288582[_0xa866('0x9')](/\\/g,'/');this[_0xa866('0xa')](_0xa866('0x5'),_0x3d1380);}},'rating':{'type':Sequelize[_0xa866('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa866('0xb')],'set':function(_0x525ce6){this[_0xa866('0xa')](_0xa866('0xc'),moment()[_0xa866('0xd')](_0x525ce6,'ms'));this['setDataValue'](_0xa866('0xe'),moment());this[_0xa866('0xa')](_0xa866('0xf'),_0x525ce6);}},'startedAt':{'type':Sequelize[_0xa866('0x10')],'get':function(){return moment(this[_0xa866('0x7')](_0xa866('0xc')))['format'](_0xa866('0x11'))[_0xa866('0x12')]();}},'closedAt':{'type':Sequelize[_0xa866('0x10')],'get':function(){return moment(this[_0xa866('0x7')]('closedAt'))[_0xa866('0x13')]('MM-DD-YYYY\x20HH:mm')[_0xa866('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa866('0x7')](_0xa866('0x14')))[_0xa866('0x13')]('MM-DD-YYYY\x20HH:mm')[_0xa866('0x12')]();}},'updatedAt':{'type':Sequelize[_0xa866('0x10')],'get':function(){return moment(this[_0xa866('0x7')](_0xa866('0x15')))[_0xa866('0x13')](_0xa866('0x11'))[_0xa866('0x12')]();}}};
\ No newline at end of file
+var _0x1189=['subtract','closedAt','duration','format','toString','DATE','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt'];(function(_0x45fac5,_0x18a94e){var _0x3a2aa8=function(_0x31f88e){while(--_0x31f88e){_0x45fac5['push'](_0x45fac5['shift']());}};_0x3a2aa8(++_0x18a94e);}(_0x1189,0x17f));var _0x9118=function(_0x57c07a,_0x25fc27){_0x57c07a=_0x57c07a-0x0;var _0x19d4d2=_0x1189[_0x57c07a];return _0x19d4d2;};'use strict';var Sequelize=require(_0x9118('0x0'));var moment=require(_0x9118('0x1'));var path=require(_0x9118('0x2'));var config=require(_0x9118('0x3'));module['exports']={'format':{'type':Sequelize[_0x9118('0x4')],'get':function(){return this[_0x9118('0x5')](_0x9118('0x6'))?path[_0x9118('0x7')](this[_0x9118('0x5')](_0x9118('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x9118('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x9118('0x8')],'set':function(_0x370bec){var _0x21251a=_0x370bec[_0x9118('0x9')](/\\/g,'/');this[_0x9118('0xa')](_0x9118('0x6'),_0x21251a);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9118('0xb')],'set':function(_0x227eea){this[_0x9118('0xa')](_0x9118('0xc'),moment()[_0x9118('0xd')](_0x227eea,'ms'));this[_0x9118('0xa')](_0x9118('0xe'),moment());this['setDataValue'](_0x9118('0xf'),_0x227eea);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x9118('0xc')))[_0x9118('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x9118('0x11')]();}},'closedAt':{'type':Sequelize[_0x9118('0x12')],'get':function(){return moment(this[_0x9118('0x5')](_0x9118('0xe')))[_0x9118('0x10')](_0x9118('0x13'))[_0x9118('0x11')]();}},'createdAt':{'type':Sequelize[_0x9118('0x12')],'get':function(){return moment(this[_0x9118('0x5')](_0x9118('0x14')))[_0x9118('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x9118('0x12')],'get':function(){return moment(this['getDataValue'](_0x9118('0x15')))[_0x9118('0x10')](_0x9118('0x13'))[_0x9118('0x11')]();}}};
\ No newline at end of file
index b3e6974..1836012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x33a8f3,_0x362516){var _0x547760=function(_0x5b19ab){while(--_0x5b19ab){_0x33a8f3['push'](_0x33a8f3['shift']());}};_0x547760(++_0x362516);}(_0xb138,0x1dd));var _0x8b13=function(_0x3b9490,_0x2d7527){_0x3b9490=_0x3b9490-0x0;var _0x115374=_0xb138[_0x3b9490];return _0x115374;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));};
\ No newline at end of file
+var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));};
\ No newline at end of file
index 3501d19..648fb4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d73=['moment','bluebird','request-promise','path','rimraf','../../config/environment','ScreenRecording','interactionid','lodash','util','../../config/logger','api'];(function(_0x4c7ee1,_0x4f69a8){var _0x2bf643=function(_0x3093bd){while(--_0x3093bd){_0x4c7ee1['push'](_0x4c7ee1['shift']());}};_0x2bf643(++_0x4f69a8);}(_0x1d73,0x1c4));var _0x31d7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1d73[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x31d7('0x0'));var util=require(_0x31d7('0x1'));var logger=require(_0x31d7('0x2'))(_0x31d7('0x3'));var moment=require(_0x31d7('0x4'));var BPromise=require(_0x31d7('0x5'));var rp=require(_0x31d7('0x6'));var fs=require('fs');var path=require(_0x31d7('0x7'));var rimraf=require(_0x31d7('0x8'));var config=require(_0x31d7('0x9'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x25c3c1,_0x92bd04){return _0x25c3c1['define'](_0x31d7('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x31d7('0xb'),'fields':[_0x31d7('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d64=['api','moment','bluebird','request-promise','rimraf','exports','ScreenRecording','interactionid','../../config/logger'];(function(_0x2a65e5,_0x3ce826){var _0x2fc50d=function(_0x25446e){while(--_0x25446e){_0x2a65e5['push'](_0x2a65e5['shift']());}};_0x2fc50d(++_0x3ce826);}(_0x4d64,0x155));var _0x44d6=function(_0x48e8d3,_0xe67faa){_0x48e8d3=_0x48e8d3-0x0;var _0x5e9cec=_0x4d64[_0x48e8d3];return _0x5e9cec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44d6('0x0'))(_0x44d6('0x1'));var moment=require(_0x44d6('0x2'));var BPromise=require(_0x44d6('0x3'));var rp=require(_0x44d6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44d6('0x5'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0x44d6('0x6')]=function(_0x8bddb4,_0x420423){return _0x8bddb4['define'](_0x44d6('0x7'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x44d6('0x8'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
index 01e8cf8..0ae8b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2954=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x114add,_0xcf6c40){var _0x4d01a5=function(_0x4d62cf){while(--_0x4d62cf){_0x114add['push'](_0x114add['shift']());}};_0x4d01a5(++_0xcf6c40);}(_0x2954,0x12a));var _0x4295=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x2954[_0x43d16c];return _0x208cce;};'use strict';var _=require(_0x4295('0x0'));var util=require(_0x4295('0x1'));var moment=require(_0x4295('0x2'));var BPromise=require(_0x4295('0x3'));var rs=require(_0x4295('0x4'));var fs=require('fs');var Redis=require(_0x4295('0x5'));var db=require(_0x4295('0x6'))['db'];var utils=require(_0x4295('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4295('0x8'));var client=jayson[_0x4295('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51e0c2,_0x18e117,_0x3f1864){return new BPromise(function(_0x5a8373,_0x4f0930){return client[_0x4295('0xa')](_0x51e0c2,_0x3f1864)[_0x4295('0xb')](function(_0x26f1d9){logger['info'](_0x4295('0xc'),_0x18e117,_0x4295('0xd'));logger[_0x4295('0xe')](_0x4295('0xf'),_0x18e117,_0x4295('0xd'),JSON[_0x4295('0x10')](_0x26f1d9));if(_0x26f1d9['error']){if(_0x26f1d9[_0x4295('0x11')][_0x4295('0x12')]===0x1f4){logger[_0x4295('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x18e117,_0x26f1d9[_0x4295('0x11')]['message']);return _0x4f0930(_0x26f1d9['error'][_0x4295('0x13')]);}logger[_0x4295('0x11')](_0x4295('0xc'),_0x18e117,_0x26f1d9[_0x4295('0x11')]['message']);return _0x5a8373(_0x26f1d9[_0x4295('0x11')]['message']);}else{logger['info'](_0x4295('0xc'),_0x18e117,_0x4295('0xd'));_0x5a8373(_0x26f1d9['result'][_0x4295('0x13')]);}})[_0x4295('0x14')](function(_0x54d24b){logger[_0x4295('0x11')](_0x4295('0xc'),_0x18e117,_0x54d24b);_0x4f0930(_0x54d24b);});});}
\ No newline at end of file
+var _0xfd1a=['rpc','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2fe58d,_0x36c8da){var _0x2d7de1=function(_0x3b5ce4){while(--_0x3b5ce4){_0x2fe58d['push'](_0x2fe58d['shift']());}};_0x2d7de1(++_0x36c8da);}(_0xfd1a,0x7d));var _0xafd1=function(_0x297879,_0x34cab5){_0x297879=_0x297879-0x0;var _0x10554f=_0xfd1a[_0x297879];return _0x10554f;};'use strict';var _=require(_0xafd1('0x0'));var util=require('util');var moment=require(_0xafd1('0x1'));var BPromise=require('bluebird');var rs=require(_0xafd1('0x2'));var fs=require('fs');var Redis=require(_0xafd1('0x3'));var db=require(_0xafd1('0x4'))['db'];var utils=require(_0xafd1('0x5'));var logger=require(_0xafd1('0x6'))(_0xafd1('0x7'));var config=require('../../config/environment');var jayson=require(_0xafd1('0x8'));var client=jayson[_0xafd1('0x9')][_0xafd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x565bfe,_0x1637b7,_0x3ae679){return new BPromise(function(_0x4ed255,_0x1db973){return client['request'](_0x565bfe,_0x3ae679)[_0xafd1('0xb')](function(_0x3a5b43){logger[_0xafd1('0xc')](_0xafd1('0xd'),_0x1637b7,_0xafd1('0xe'));logger[_0xafd1('0xf')](_0xafd1('0x10'),_0x1637b7,_0xafd1('0xe'),JSON[_0xafd1('0x11')](_0x3a5b43));if(_0x3a5b43[_0xafd1('0x12')]){if(_0x3a5b43['error'][_0xafd1('0x13')]===0x1f4){logger[_0xafd1('0x12')](_0xafd1('0xd'),_0x1637b7,_0x3a5b43[_0xafd1('0x12')][_0xafd1('0x14')]);return _0x1db973(_0x3a5b43[_0xafd1('0x12')][_0xafd1('0x14')]);}logger['error'](_0xafd1('0xd'),_0x1637b7,_0x3a5b43[_0xafd1('0x12')][_0xafd1('0x14')]);return _0x4ed255(_0x3a5b43['error'][_0xafd1('0x14')]);}else{logger[_0xafd1('0xc')](_0xafd1('0xd'),_0x1637b7,_0xafd1('0xe'));_0x4ed255(_0x3a5b43[_0xafd1('0x15')]['message']);}})['catch'](function(_0x3a85b5){logger[_0xafd1('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x1637b7,_0x3a85b5);_0x1db973(_0x3a85b5);});});}
\ No newline at end of file
index bbc1de0..e5eb669 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf304=['/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','addLogo','file','addLogoLogin','preferred','addPreferred','addFavicon','put','update','exports','multer','util','path','Router','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id','/:id/logo','getLogo'];(function(_0x3bff7c,_0x19852f){var _0x2bdc17=function(_0x5ba93a){while(--_0x5ba93a){_0x3bff7c['push'](_0x3bff7c['shift']());}};_0x2bdc17(++_0x19852f);}(_0xf304,0x133));var _0x4f30=function(_0x15a99d,_0x4486ea){_0x15a99d=_0x15a99d-0x0;var _0x2cb908=_0xf304[_0x15a99d];return _0x2cb908;};'use strict';var multer=require(_0x4f30('0x0'));var util=require(_0x4f30('0x1'));var path=require(_0x4f30('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4f30('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4f30('0x4'));var controller=require(_0x4f30('0x5'));router[_0x4f30('0x6')]('/',auth[_0x4f30('0x7')](),controller['index']);router[_0x4f30('0x6')](_0x4f30('0x8'),controller[_0x4f30('0x9')]);router[_0x4f30('0x6')](_0x4f30('0xa'),controller['show']);router[_0x4f30('0x6')](_0x4f30('0xb'),controller[_0x4f30('0xc')]);router['get'](_0x4f30('0xd'),controller[_0x4f30('0xe')]);router[_0x4f30('0x6')](_0x4f30('0xf'),controller[_0x4f30('0x10')]);router[_0x4f30('0x6')](_0x4f30('0x11'),controller[_0x4f30('0x12')]);router[_0x4f30('0x6')](_0x4f30('0x13'),controller['getFavicon']);var upload=multer({'storage':multer[_0x4f30('0x14')]({'destination':function(_0x20ed5f,_0x2a5484,_0x344e47){_0x344e47(null,path[_0x4f30('0x15')](config[_0x4f30('0x16')],_0x4f30('0x17')));},'filename':function(_0x50abea,_0x3f039d,_0x242867){_0x242867(null,util[_0x4f30('0x18')](_0x4f30('0x19'),_0x4f30('0x1a'),path[_0x4f30('0x1b')](_0x3f039d[_0x4f30('0x1c')])));}})});router[_0x4f30('0x1d')](_0x4f30('0xb'),upload[_0x4f30('0x1e')]('file'),controller[_0x4f30('0x1f')]);var upload=multer({'storage':multer[_0x4f30('0x14')]({'destination':function(_0x54d77c,_0x41eb26,_0x2f13dd){_0x2f13dd(null,path[_0x4f30('0x15')](config[_0x4f30('0x16')],_0x4f30('0x17')));},'filename':function(_0x26c88d,_0x4c4d03,_0x147512){_0x147512(null,util[_0x4f30('0x18')]('%s%s','logologin',path[_0x4f30('0x1b')](_0x4c4d03[_0x4f30('0x1c')])));}})});router[_0x4f30('0x1d')](_0x4f30('0xd'),upload[_0x4f30('0x1e')](_0x4f30('0x20')),controller[_0x4f30('0x21')]);var upload=multer({'storage':multer[_0x4f30('0x14')]({'destination':function(_0x1f53c7,_0x2c5849,_0x4fc6af){_0x4fc6af(null,path[_0x4f30('0x15')](config[_0x4f30('0x16')],_0x4f30('0x17')));},'filename':function(_0xf43999,_0x2978ce,_0x4cd0c0){_0x4cd0c0(null,util[_0x4f30('0x18')]('%s%s',_0x4f30('0x22'),path[_0x4f30('0x1b')](_0x2978ce[_0x4f30('0x1c')])));}})});router['post'](_0x4f30('0x11'),upload[_0x4f30('0x1e')](_0x4f30('0x20')),controller[_0x4f30('0x23')]);var upload=multer({'storage':multer[_0x4f30('0x14')]({'destination':function(_0x46fad5,_0xd2d74c,_0x587aad){_0x587aad(null,path['join'](config[_0x4f30('0x16')],'server/files/images/logos/'));},'filename':function(_0x4c20c6,_0x17e5ea,_0xd59aa0){_0xd59aa0(null,util['format'](_0x4f30('0x19'),'favicon',path[_0x4f30('0x1b')](_0x17e5ea[_0x4f30('0x1c')])));}})});router['post']('/:id/favicon',upload[_0x4f30('0x1e')](_0x4f30('0x20')),controller[_0x4f30('0x24')]);router[_0x4f30('0x25')](_0x4f30('0xa'),auth[_0x4f30('0x7')](),controller[_0x4f30('0x26')]);module[_0x4f30('0x27')]=router;
\ No newline at end of file
+var _0x3221=['root','%s%s','logologin','post','addLogoLogin','preferred','addPreferred','/:id/favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','fs-extra','./setting.controller','get','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','server/files/images/logos/','format','logo','extname','originalname','single','file','addLogo'];(function(_0x489bf9,_0x4f8c27){var _0xa555af=function(_0x24981c){while(--_0x24981c){_0x489bf9['push'](_0x489bf9['shift']());}};_0xa555af(++_0x4f8c27);}(_0x3221,0x1c5));var _0x1322=function(_0x3a7bde,_0x46df2a){_0x3a7bde=_0x3a7bde-0x0;var _0x19cf48=_0x3221[_0x3a7bde];return _0x19cf48;};'use strict';var multer=require(_0x1322('0x0'));var util=require(_0x1322('0x1'));var path=require(_0x1322('0x2'));var timeout=require(_0x1322('0x3'));var express=require(_0x1322('0x4'));var router=express['Router']();var fs_extra=require(_0x1322('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1322('0x6'));router[_0x1322('0x7')]('/',auth['isAuthenticated'](),controller[_0x1322('0x8')]);router[_0x1322('0x7')](_0x1322('0x9'),controller[_0x1322('0xa')]);router[_0x1322('0x7')](_0x1322('0xb'),controller[_0x1322('0xc')]);router[_0x1322('0x7')](_0x1322('0xd'),controller[_0x1322('0xe')]);router['get'](_0x1322('0xf'),controller[_0x1322('0x10')]);router[_0x1322('0x7')](_0x1322('0x11'),controller['gdpr']);router[_0x1322('0x7')](_0x1322('0x12'),controller[_0x1322('0x13')]);router[_0x1322('0x7')]('/:id/favicon',controller[_0x1322('0x14')]);var upload=multer({'storage':multer[_0x1322('0x15')]({'destination':function(_0x22a66e,_0x43ce15,_0x47fca3){_0x47fca3(null,path[_0x1322('0x16')](config['root'],_0x1322('0x17')));},'filename':function(_0x5f184d,_0x54b908,_0x23067c){_0x23067c(null,util[_0x1322('0x18')]('%s%s',_0x1322('0x19'),path[_0x1322('0x1a')](_0x54b908[_0x1322('0x1b')])));}})});router['post']('/:id/logo',upload[_0x1322('0x1c')](_0x1322('0x1d')),controller[_0x1322('0x1e')]);var upload=multer({'storage':multer[_0x1322('0x15')]({'destination':function(_0x54f12f,_0x4c0a79,_0x4b3f4d){_0x4b3f4d(null,path[_0x1322('0x16')](config[_0x1322('0x1f')],_0x1322('0x17')));},'filename':function(_0x447573,_0x56db6e,_0x3acd50){_0x3acd50(null,util[_0x1322('0x18')](_0x1322('0x20'),_0x1322('0x21'),path[_0x1322('0x1a')](_0x56db6e[_0x1322('0x1b')])));}})});router[_0x1322('0x22')](_0x1322('0xf'),upload[_0x1322('0x1c')](_0x1322('0x1d')),controller[_0x1322('0x23')]);var upload=multer({'storage':multer[_0x1322('0x15')]({'destination':function(_0x1bae7c,_0x3700bb,_0x5e0d28){_0x5e0d28(null,path[_0x1322('0x16')](config[_0x1322('0x1f')],'server/files/images/logos/'));},'filename':function(_0x3d4264,_0x485de0,_0x153539){_0x153539(null,util[_0x1322('0x18')]('%s%s',_0x1322('0x24'),path[_0x1322('0x1a')](_0x485de0[_0x1322('0x1b')])));}})});router[_0x1322('0x22')](_0x1322('0x12'),upload[_0x1322('0x1c')](_0x1322('0x1d')),controller[_0x1322('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x265aba,_0x48871d,_0x3fed12){_0x3fed12(null,path['join'](config[_0x1322('0x1f')],_0x1322('0x17')));},'filename':function(_0x2a97f2,_0x1ddcdc,_0x206a73){_0x206a73(null,util[_0x1322('0x18')](_0x1322('0x20'),'favicon',path['extname'](_0x1ddcdc[_0x1322('0x1b')])));}})});router[_0x1322('0x22')](_0x1322('0x26'),upload[_0x1322('0x1c')]('file'),controller[_0x1322('0x27')]);router[_0x1322('0x28')](_0x1322('0xb'),auth[_0x1322('0x29')](),controller[_0x1322('0x2a')]);module[_0x1322('0x2b')]=router;
\ No newline at end of file
index eb174d5..5682fe1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff6=['sequelize','exports','min_internal','STRING','BOOLEAN','INTEGER','alternate','UNSIGNED'];(function(_0x30ebe4,_0x4d7a2d){var _0x3725df=function(_0x30064f){while(--_0x30064f){_0x30ebe4['push'](_0x30ebe4['shift']());}};_0x3725df(++_0x4d7a2d);}(_0x5ff6,0x100));var _0x65ff=function(_0x561deb,_0x2c4d13){_0x561deb=_0x561deb-0x0;var _0x3c9f1d=_0x5ff6[_0x561deb];return _0x3c9f1d;};'use strict';var Sequelize=require(_0x65ff('0x0'));module[_0x65ff('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x65ff('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x65ff('0x3')]},'defaultLogo':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x65ff('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x65ff('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x65ff('0x3')]},'turnusername':{'type':Sequelize[_0x65ff('0x3')]},'turnpassword':{'type':Sequelize[_0x65ff('0x3')]},'pageTitle':{'type':Sequelize[_0x65ff('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x65ff('0x5')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x65ff('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x65ff('0x3')],'defaultValue':_0x65ff('0x6')},'chatTimeout':{'type':Sequelize[_0x65ff('0x5')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x65ff('0x3')]},'defaultPreferred':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x65ff('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x65ff('0x5')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x65ff('0x5')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x65ff('0x3')]},'sentiment':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x65ff('0x5')]},'sentimentRegion':{'type':Sequelize[_0x65ff('0x3')]},'language':{'type':Sequelize[_0x65ff('0x3')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x65ff('0x5')](0x2)[_0x65ff('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x65ff('0x5')](0x2)[_0x65ff('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x65ff('0x5')](0x2)[_0x65ff('0x7')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x65ff('0x5')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x65ff('0x5')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x65ff('0x5')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'viewHelpSection':{'type':Sequelize[_0x65ff('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xf63b=['UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x38a3f3,_0x2513e3){var _0x3f9a06=function(_0x3abac7){while(--_0x3abac7){_0x38a3f3['push'](_0x38a3f3['shift']());}};_0x3f9a06(++_0x2513e3);}(_0xf63b,0xc7));var _0xbf63=function(_0x29c7d7,_0x3b2231){_0x29c7d7=_0x29c7d7-0x0;var _0x42b8d7=_0xf63b[_0x29c7d7];return _0x42b8d7;};'use strict';var Sequelize=require(_0xbf63('0x0'));module[_0xbf63('0x1')]={'min_internal':{'type':Sequelize[_0xbf63('0x2')](0xb),'unique':_0xbf63('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xbf63('0x2')](0xb),'unique':_0xbf63('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xbf63('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xbf63('0x5')],'defaultValue':_0xbf63('0x6')},'logo':{'type':Sequelize[_0xbf63('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xbf63('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xbf63('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xbf63('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xbf63('0x5')]},'pageTitle':{'type':Sequelize[_0xbf63('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xbf63('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xbf63('0x5')],'defaultValue':_0xbf63('0x8')},'enableEmailPreview':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xbf63('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xbf63('0x5')]},'defaultPreferred':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xbf63('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xbf63('0x5')]},'defaultFavicon':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xbf63('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xbf63('0x2')]},'sentimentRegion':{'type':Sequelize[_0xbf63('0x5')]},'language':{'type':Sequelize[_0xbf63('0x5')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xbf63('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xbf63('0x2')](0x2)[_0xbf63('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0xbf63('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xbf63('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xbf63('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'viewHelpSection':{'type':Sequelize[_0xbf63('0x7')],'defaultValue':!![]}};
\ No newline at end of file
index ceeb27d..f5aa411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5447=['send','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','name','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','Setting','body','find','params','addLogo','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','addPreferred','default_preferred.png','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5447,0xf1));var _0x7544=function(_0x134f6b,_0x4658ca){_0x134f6b=_0x134f6b-0x0;var _0x592354=_0x5447[_0x134f6b];return _0x592354;};'use strict';var emlformat=require(_0x7544('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7544('0x1'));var jsonpatch=require(_0x7544('0x2'));var rp=require('request-promise');var moment=require(_0x7544('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7544('0x4'));var util=require(_0x7544('0x5'));var path=require(_0x7544('0x6'));var sox=require(_0x7544('0x7'));var csv=require(_0x7544('0x8'));var ejs=require(_0x7544('0x9'));var fs=require('fs');var fs_extra=require(_0x7544('0xa'));var _=require(_0x7544('0xb'));var squel=require(_0x7544('0xc'));var crypto=require(_0x7544('0xd'));var jsforce=require(_0x7544('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7544('0x8'));var querystring=require(_0x7544('0xf'));var Papa=require(_0x7544('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7544('0x11'));var hardwareService=require(_0x7544('0x12'));var logger=require(_0x7544('0x13'))(_0x7544('0x14'));var utils=require(_0x7544('0x15'));var config=require(_0x7544('0x16'));var licenseUtil=require(_0x7544('0x17'));var db=require(_0x7544('0x18'))['db'];var jayson=require(_0x7544('0x19'));var client=jayson[_0x7544('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473444,_0x49c6a2,_0x325357,_0x1f32e9){return new BPromise(function(_0x55769c,_0x2d1ca4){var _0x23eb1b=_0x1f32e9||client;return _0x23eb1b[_0x7544('0x1b')](_0x473444,_0x325357)[_0x7544('0x1c')](function(_0xcee864){logger[_0x7544('0x1d')](_0x7544('0x1e'),_0x49c6a2,_0x7544('0x1f'));logger['debug'](_0x7544('0x20'),_0x49c6a2,_0x7544('0x1f'),JSON['stringify'](_0xcee864));if(_0xcee864[_0x7544('0x21')]){if(_0xcee864[_0x7544('0x21')]['code']===0x1f4){logger[_0x7544('0x21')](_0x7544('0x1e'),_0x49c6a2,_0xcee864[_0x7544('0x21')][_0x7544('0x22')]);return _0x2d1ca4(_0xcee864[_0x7544('0x21')][_0x7544('0x22')]);}logger[_0x7544('0x21')](_0x7544('0x1e'),_0x49c6a2,_0xcee864[_0x7544('0x21')][_0x7544('0x22')]);return _0x55769c(_0xcee864[_0x7544('0x21')][_0x7544('0x22')]);}else{logger[_0x7544('0x1d')](_0x7544('0x1e'),_0x49c6a2,_0x7544('0x1f'));_0x55769c(_0xcee864[_0x7544('0x23')][_0x7544('0x22')]);}})[_0x7544('0x24')](function(_0x1ea87e){logger[_0x7544('0x21')](_0x7544('0x1e'),_0x49c6a2,_0x1ea87e);_0x2d1ca4(_0x1ea87e);});});}function respondWithStatusCode(_0x11850d,_0x1a9492){_0x1a9492=_0x1a9492||0xcc;return function(_0x3e281c){if(_0x3e281c){return _0x11850d[_0x7544('0x25')](_0x1a9492);}return _0x11850d[_0x7544('0x26')](_0x1a9492)[_0x7544('0x27')]();};}function respondWithResult(_0x4c3545,_0x133a01){_0x133a01=_0x133a01||0xc8;return function(_0x24a086){if(_0x24a086){return _0x4c3545[_0x7544('0x26')](_0x133a01)['json'](_0x24a086);}};}function respondWithFilteredResult(_0x46b36b,_0x4d72a3){return function(_0x548ce9){if(_0x548ce9){var _0x1be6a5=typeof _0x4d72a3[_0x7544('0x28')]===_0x7544('0x29')&&typeof _0x4d72a3[_0x7544('0x2a')]===_0x7544('0x29');var _0x4fb8a3=_0x548ce9[_0x7544('0x2b')];var _0x130ae0=_0x1be6a5?0x0:_0x4d72a3[_0x7544('0x28')];var _0x2004d6=_0x1be6a5?_0x548ce9['count']:_0x4d72a3[_0x7544('0x28')]+_0x4d72a3[_0x7544('0x2a')];var _0x14ef31;if(_0x2004d6>=_0x4fb8a3){_0x2004d6=_0x4fb8a3;_0x14ef31=0xc8;}else{_0x14ef31=0xce;}_0x46b36b['status'](_0x14ef31);return _0x46b36b[_0x7544('0x2c')]('Content-Range',_0x130ae0+'-'+_0x2004d6+'/'+_0x4fb8a3)[_0x7544('0x2d')](_0x548ce9);}return null;};}function patchUpdates(_0x2cbe3a){return function(_0x512fc7){try{jsonpatch[_0x7544('0x2e')](_0x512fc7,_0x2cbe3a,!![]);}catch(_0x3769e0){return BPromise[_0x7544('0x2f')](_0x3769e0);}return _0x512fc7[_0x7544('0x30')]();};}function saveUpdates(_0x2c5133,_0x4b1fb5){return function(_0x39852a){if(_0x39852a){return _0x39852a[_0x7544('0x31')](_0x2c5133)[_0x7544('0x1c')](function(_0x147e2){return _0x147e2;});}return null;};}function removeEntity(_0x569d29,_0x17213b){return function(_0x325554){if(_0x325554){return _0x325554[_0x7544('0x32')]()[_0x7544('0x1c')](function(){_0x569d29[_0x7544('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa9b234,_0x31b6f9){return function(_0x2d3f44){if(!_0x2d3f44){_0xa9b234['sendStatus'](0x194);}return _0x2d3f44;};}function handleError(_0x1d466e,_0x41ff45){_0x41ff45=_0x41ff45||0x1f4;return function(_0x4afcf8){logger['error'](_0x4afcf8[_0x7544('0x33')]);if(_0x4afcf8[_0x7544('0x34')]){delete _0x4afcf8['name'];}_0x1d466e[_0x7544('0x26')](_0x41ff45)['send'](_0x4afcf8);};}exports['index']=function(_0x239b49,_0x594713){var _0x1c8392={},_0x3679de={},_0x52b0da={'count':0x0,'rows':[]};var _0x7c0c3e=_['map'](db['Setting'][_0x7544('0x35')],function(_0x4aaef0){return{'name':_0x4aaef0[_0x7544('0x36')],'type':_0x4aaef0[_0x7544('0x37')]['key']};});_0x3679de[_0x7544('0x38')]=_['map'](_0x7c0c3e,_0x7544('0x34'));_0x3679de[_0x7544('0x39')]=_[_0x7544('0x3a')](_0x239b49['query']);_0x3679de[_0x7544('0x3b')]=_['intersection'](_0x3679de['model'],_0x3679de[_0x7544('0x39')]);_0x1c8392[_0x7544('0x3c')]=_[_0x7544('0x3d')](_0x3679de[_0x7544('0x38')],qs[_0x7544('0x3e')](_0x239b49[_0x7544('0x39')]['fields']));_0x1c8392[_0x7544('0x3c')]=_0x1c8392[_0x7544('0x3c')][_0x7544('0x3f')]?_0x1c8392[_0x7544('0x3c')]:_0x3679de['model'];if(!_0x239b49[_0x7544('0x39')][_0x7544('0x40')](_0x7544('0x41'))){_0x1c8392[_0x7544('0x2a')]=qs[_0x7544('0x2a')](_0x239b49[_0x7544('0x39')][_0x7544('0x2a')]);_0x1c8392[_0x7544('0x28')]=qs['offset'](_0x239b49['query'][_0x7544('0x28')]);}_0x1c8392[_0x7544('0x42')]=qs[_0x7544('0x43')](_0x239b49[_0x7544('0x39')][_0x7544('0x43')]);_0x1c8392[_0x7544('0x44')]=qs['filters'](_['pick'](_0x239b49[_0x7544('0x39')],_0x3679de[_0x7544('0x3b')]),_0x7c0c3e);if(_0x239b49[_0x7544('0x39')][_0x7544('0x45')]){_0x1c8392['where']=_['merge'](_0x1c8392[_0x7544('0x44')],{'$or':_[_0x7544('0x46')](_0x7c0c3e,function(_0x194810){if(_0x194810[_0x7544('0x37')]!==_0x7544('0x47')){var _0x340817={};_0x340817[_0x194810['name']]={'$like':'%'+_0x239b49[_0x7544('0x39')]['filter']+'%'};return _0x340817;}})});}_0x1c8392=_[_0x7544('0x48')]({},_0x1c8392,_0x239b49[_0x7544('0x49')]);var _0x6ab0e={'where':_0x1c8392['where']};return db['Setting'][_0x7544('0x2b')](_0x6ab0e)['then'](function(_0x38a138){_0x52b0da[_0x7544('0x2b')]=_0x38a138;if(_0x239b49[_0x7544('0x39')][_0x7544('0x4a')]){_0x1c8392[_0x7544('0x4b')]=[{'all':!![]}];}return db['Setting'][_0x7544('0x4c')](_0x1c8392);})[_0x7544('0x1c')](function(_0x46f8fa){_0x52b0da[_0x7544('0x4d')]=_0x46f8fa;return _0x52b0da;})[_0x7544('0x1c')](respondWithFilteredResult(_0x594713,_0x1c8392))['catch'](handleError(_0x594713,null));};exports[_0x7544('0x4e')]=function(_0x2494dd,_0x5f4f7c){var _0x25a180={'raw':![],'where':{'id':_0x2494dd['params']['id']}},_0x23220c={};_0x23220c[_0x7544('0x38')]=_[_0x7544('0x3a')](db[_0x7544('0x4f')][_0x7544('0x35')]);_0x23220c[_0x7544('0x39')]=_[_0x7544('0x3a')](_0x2494dd[_0x7544('0x39')]);_0x23220c[_0x7544('0x3b')]=_['intersection'](_0x23220c[_0x7544('0x38')],_0x23220c[_0x7544('0x39')]);_0x25a180[_0x7544('0x3c')]=_[_0x7544('0x3d')](_0x23220c['model'],qs['fields'](_0x2494dd['query'][_0x7544('0x3e')]));_0x25a180[_0x7544('0x3c')]=_0x25a180['attributes'][_0x7544('0x3f')]?_0x25a180[_0x7544('0x3c')]:_0x23220c[_0x7544('0x38')];if(_0x2494dd[_0x7544('0x39')][_0x7544('0x4a')]){_0x25a180[_0x7544('0x4b')]=[{'all':!![]}];}_0x25a180=_[_0x7544('0x48')]({},_0x25a180,_0x2494dd[_0x7544('0x49')]);return db['Setting']['find'](_0x25a180)[_0x7544('0x1c')](handleEntityNotFound(_0x5f4f7c,null))[_0x7544('0x1c')](respondWithResult(_0x5f4f7c,null))[_0x7544('0x24')](handleError(_0x5f4f7c,null));};exports[_0x7544('0x31')]=function(_0x233c18,_0x5c844a){if(_0x233c18[_0x7544('0x50')]['id']){delete _0x233c18[_0x7544('0x50')]['id'];}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0x233c18[_0x7544('0x52')]['id']}})[_0x7544('0x1c')](handleEntityNotFound(_0x5c844a,null))[_0x7544('0x1c')](saveUpdates(_0x233c18['body'],null))[_0x7544('0x1c')](respondWithResult(_0x5c844a,null))[_0x7544('0x24')](handleError(_0x5c844a,null));};exports[_0x7544('0x53')]=function(_0x49de13,_0x578155,_0x4357e7){if(_0x49de13[_0x7544('0x54')]&&_0x49de13[_0x7544('0x54')][_0x7544('0x55')]){_0x49de13[_0x7544('0x50')][_0x7544('0x56')]=_0x49de13[_0x7544('0x54')][_0x7544('0x55')];}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0x49de13[_0x7544('0x52')]['id']}})[_0x7544('0x1c')](handleEntityNotFound(_0x578155,null))[_0x7544('0x1c')](saveUpdates(_0x49de13[_0x7544('0x50')],null))[_0x7544('0x1c')](respondWithResult(_0x578155,null))['catch'](handleError(_0x578155,null));};exports['addLogoLogin']=function(_0xc56985,_0x3711aa,_0xc4adab){if(_0xc56985[_0x7544('0x54')]&&_0xc56985[_0x7544('0x54')][_0x7544('0x55')]){_0xc56985[_0x7544('0x50')][_0x7544('0x57')]=_0xc56985[_0x7544('0x54')][_0x7544('0x55')];}return db['Setting'][_0x7544('0x51')]({'where':{'id':_0xc56985[_0x7544('0x52')]['id']}})['then'](handleEntityNotFound(_0x3711aa,null))[_0x7544('0x1c')](saveUpdates(_0xc56985['body'],null))[_0x7544('0x1c')](respondWithResult(_0x3711aa,null))[_0x7544('0x24')](handleError(_0x3711aa,null));};var utilLicense=require(_0x7544('0x17'));exports[_0x7544('0x58')]=function(_0xcd0623,_0x34c58e,_0x58bc2e){var _0x15ca9f=_0x7544('0x59');var _0x2e1f3d={'custom':![]};return utilLicense[_0x7544('0x5a')]()[_0x7544('0x1c')](function(_0x48260b){if(_0x48260b){_0x2e1f3d=_0x48260b;}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0xcd0623[_0x7544('0x52')]['id']},'attributes':[_0x7544('0x56'),'loginLogo',_0x7544('0x5b'),_0x7544('0x5c'),_0x7544('0x5d'),'defaultLoginLogo','defaultPreferred',_0x7544('0x5e')],'raw':!![]});})[_0x7544('0x1c')](handleEntityNotFound(_0x34c58e,null))['then'](function(_0x39d571){if(_0x39d571){var _0x152887=_0x39d571[_0x7544('0x56')]&&fs[_0x7544('0x5f')](path[_0x7544('0x60')](config[_0x7544('0x61')],_0x15ca9f,_['toLower'](_0x39d571[_0x7544('0x56')])))?path[_0x7544('0x60')](config[_0x7544('0x61')],_0x15ca9f,_[_0x7544('0x62')](_0x39d571[_0x7544('0x56')])):path['join'](config[_0x7544('0x61')],_0x15ca9f,_[_0x7544('0x62')](_0x7544('0x63')));var _0x587ca8=_0x7544('0x64')+_['upperFirst'](_0x7544('0x56'));if(_0x39d571[_0x587ca8]||!_0x2e1f3d[_0x7544('0x65')]){_0x152887=path[_0x7544('0x60')](config[_0x7544('0x61')],_0x15ca9f,_[_0x7544('0x62')](_0x7544('0x63')));}if(!fs[_0x7544('0x5f')](_0x152887)){throw new db[(_0x7544('0x66'))][(_0x7544('0x67'))](_[_0x7544('0x68')]('logo')+_0x7544('0x69'));}return _0x34c58e[_0x7544('0x6a')](_0x152887);}})[_0x7544('0x24')](handleError(_0x34c58e,null));};var utilLicense=require('../../config/license/util');exports[_0x7544('0x6b')]=function(_0x56eb59,_0x2e7789,_0x5133a0){var _0x3af4d6=_0x7544('0x59');var _0x948ed1={'custom':![]};return utilLicense[_0x7544('0x5a')]()[_0x7544('0x1c')](function(_0x30e413){if(_0x30e413){_0x948ed1=_0x30e413;}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0x56eb59[_0x7544('0x52')]['id']},'attributes':[_0x7544('0x56'),'loginLogo',_0x7544('0x5b'),_0x7544('0x5c'),_0x7544('0x5d'),_0x7544('0x6c'),_0x7544('0x6d'),_0x7544('0x5e')],'raw':!![]});})[_0x7544('0x1c')](handleEntityNotFound(_0x2e7789,null))[_0x7544('0x1c')](function(_0x390e23){if(_0x390e23){var _0x4cf323=_0x390e23[_0x7544('0x57')]&&fs[_0x7544('0x5f')](path[_0x7544('0x60')](config[_0x7544('0x61')],_0x3af4d6,_[_0x7544('0x62')](_0x390e23[_0x7544('0x57')])))?path[_0x7544('0x60')](config['root'],_0x3af4d6,_[_0x7544('0x62')](_0x390e23[_0x7544('0x57')])):path[_0x7544('0x60')](config[_0x7544('0x61')],_0x3af4d6,_[_0x7544('0x62')](_0x7544('0x6e')));var _0x5e3271=_0x7544('0x64')+_[_0x7544('0x68')]('loginLogo');if(_0x390e23[_0x5e3271]||!_0x948ed1['custom']){_0x4cf323=path[_0x7544('0x60')](config['root'],_0x3af4d6,_[_0x7544('0x62')](_0x7544('0x6e')));}if(!fs[_0x7544('0x5f')](_0x4cf323)){throw new db[(_0x7544('0x66'))][(_0x7544('0x67'))](_[_0x7544('0x68')]('loginLogo')+_0x7544('0x69'));}return _0x2e7789[_0x7544('0x6a')](_0x4cf323);}})['catch'](handleError(_0x2e7789,null));};exports['gdpr']=function(_0x5bc657,_0x2c71d3){return db[_0x7544('0x4f')]['find']({'where':{'id':_0x5bc657[_0x7544('0x52')]['id']},'attributes':['securePassword']})[_0x7544('0x1c')](respondWithResult(_0x2c71d3,null))['catch'](handleError(_0x2c71d3,null));};exports[_0x7544('0x6f')]=function(_0x2ccdd2,_0x508e2b,_0x470880){if(_0x2ccdd2[_0x7544('0x54')]&&_0x2ccdd2['file'][_0x7544('0x55')]){_0x2ccdd2[_0x7544('0x50')][_0x7544('0x5b')]=_0x2ccdd2[_0x7544('0x54')][_0x7544('0x55')];}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0x2ccdd2[_0x7544('0x52')]['id']}})[_0x7544('0x1c')](handleEntityNotFound(_0x508e2b,null))[_0x7544('0x1c')](saveUpdates(_0x2ccdd2[_0x7544('0x50')],null))['then'](respondWithResult(_0x508e2b,null))['catch'](handleError(_0x508e2b,null));};var utilLicense=require(_0x7544('0x17'));exports['getPreferred']=function(_0x578e24,_0x39a469,_0x246c33){var _0x3aceb2='server/files/images/logos';var _0x3fd902={'custom':![]};return utilLicense['getLicense']()[_0x7544('0x1c')](function(_0x54009a){if(_0x54009a){_0x3fd902=_0x54009a;}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0x578e24[_0x7544('0x52')]['id']},'attributes':[_0x7544('0x56'),_0x7544('0x57'),'preferred',_0x7544('0x5c'),_0x7544('0x5d'),_0x7544('0x6c'),'defaultPreferred',_0x7544('0x5e')],'raw':!![]});})[_0x7544('0x1c')](handleEntityNotFound(_0x39a469,null))[_0x7544('0x1c')](function(_0x4d0905){if(_0x4d0905){var _0x47669a=_0x4d0905[_0x7544('0x5b')]&&fs[_0x7544('0x5f')](path[_0x7544('0x60')](config['root'],_0x3aceb2,_[_0x7544('0x62')](_0x4d0905[_0x7544('0x5b')])))?path[_0x7544('0x60')](config[_0x7544('0x61')],_0x3aceb2,_[_0x7544('0x62')](_0x4d0905[_0x7544('0x5b')])):path[_0x7544('0x60')](config[_0x7544('0x61')],_0x3aceb2,_['toLower'](_0x7544('0x70')));var _0xea0177=_0x7544('0x64')+_[_0x7544('0x68')](_0x7544('0x5b'));if(_0x4d0905[_0xea0177]||!_0x3fd902['custom']||!_0x3fd902[_0x7544('0x5b')]){_0x47669a=path[_0x7544('0x60')](config[_0x7544('0x61')],_0x3aceb2,_['toLower'](_0x7544('0x70')));}if(!fs['existsSync'](_0x47669a)){throw new db[(_0x7544('0x66'))][(_0x7544('0x67'))](_[_0x7544('0x68')](_0x7544('0x5b'))+_0x7544('0x69'));}return _0x39a469[_0x7544('0x6a')](_0x47669a);}})[_0x7544('0x24')](handleError(_0x39a469,null));};exports['addFavicon']=function(_0x52d7e5,_0x5dd5b2,_0x4aba0d){if(_0x52d7e5[_0x7544('0x54')]&&_0x52d7e5[_0x7544('0x54')]['filename']){_0x52d7e5[_0x7544('0x50')][_0x7544('0x5c')]=_0x52d7e5[_0x7544('0x54')][_0x7544('0x55')];}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0x52d7e5[_0x7544('0x52')]['id']}})['then'](handleEntityNotFound(_0x5dd5b2,null))['then'](saveUpdates(_0x52d7e5[_0x7544('0x50')],null))[_0x7544('0x1c')](respondWithResult(_0x5dd5b2,null))[_0x7544('0x24')](handleError(_0x5dd5b2,null));};var utilLicense=require(_0x7544('0x17'));exports['getFavicon']=function(_0x10c631,_0xc04bc8,_0x3f5e5e){var _0xa9fcf4=_0x7544('0x59');var _0x30247c={'custom':![]};return utilLicense[_0x7544('0x5a')]()[_0x7544('0x1c')](function(_0xf5251f){if(_0xf5251f){_0x30247c=_0xf5251f;}return db[_0x7544('0x4f')][_0x7544('0x51')]({'where':{'id':_0x10c631[_0x7544('0x52')]['id']},'attributes':[_0x7544('0x56'),_0x7544('0x57'),_0x7544('0x5b'),_0x7544('0x5c'),_0x7544('0x5d'),_0x7544('0x6c'),'defaultPreferred',_0x7544('0x5e')],'raw':!![]});})[_0x7544('0x1c')](handleEntityNotFound(_0xc04bc8,null))[_0x7544('0x1c')](function(_0x1815b2){if(_0x1815b2){var _0xa91481=_0x1815b2[_0x7544('0x5c')]&&fs[_0x7544('0x5f')](path[_0x7544('0x60')](config[_0x7544('0x61')],_0xa9fcf4,_[_0x7544('0x62')](_0x1815b2[_0x7544('0x5c')])))?path[_0x7544('0x60')](config[_0x7544('0x61')],_0xa9fcf4,_['toLower'](_0x1815b2[_0x7544('0x5c')])):path[_0x7544('0x60')](config[_0x7544('0x61')],_0xa9fcf4,_['toLower']('default_favicon.ico'));var _0x3b4629=_0x7544('0x64')+_['upperFirst'](_0x7544('0x5c'));if(_0x1815b2[_0x3b4629]||!_0x30247c[_0x7544('0x65')]){_0xa91481=path['join'](config['root'],_0xa9fcf4,_[_0x7544('0x62')](_0x7544('0x71')));}if(!fs[_0x7544('0x5f')](_0xa91481)){throw new db[(_0x7544('0x66'))][(_0x7544('0x67'))](_[_0x7544('0x68')](_0x7544('0x5c'))+'\x20not\x20found');}return _0xc04bc8[_0x7544('0x6a')](_0xa91481);}})[_0x7544('0x24')](handleError(_0xc04bc8,null));};exports[_0x7544('0x72')]=function(_0xa0088c,_0x596ce8){var _0x85c451={'offset':moment()[_0x7544('0x73')]()};_0x85c451[_0x7544('0x74')]=moment()['utcOffset'](_0x85c451[_0x7544('0x28')])[_0x7544('0x75')](_0x7544('0x76'));return _0x596ce8[_0x7544('0x26')](0xc8)[_0x7544('0x77')](_0x85c451);};
\ No newline at end of file
+var _0x02a4=['api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','catch','end','json','offset','undefined','limit','count','status','set','Content-Range','update','sendStatus','name','send','index','map','Setting','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','rawAttributes','keys','include','options','find','body','params','addLogo','logo','file','filename','loginLogo','../../config/license/util','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','getLogoLogin','server/files/images/logos','defaultFavicon','upperFirst','\x20not\x20found','download','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x02a4,0x1c0));var _0x402a=function(_0x22b24e,_0xe12d39){_0x22b24e=_0x22b24e-0x0;var _0x12189d=_0x02a4[_0x22b24e];return _0x12189d;};'use strict';var emlformat=require(_0x402a('0x0'));var rimraf=require(_0x402a('0x1'));var zipdir=require(_0x402a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x402a('0x3'));var moment=require('moment');var BPromise=require(_0x402a('0x4'));var Mustache=require('mustache');var util=require(_0x402a('0x5'));var path=require(_0x402a('0x6'));var sox=require('sox');var csv=require(_0x402a('0x7'));var ejs=require(_0x402a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x402a('0x9'));var squel=require(_0x402a('0xa'));var crypto=require(_0x402a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x402a('0xc'));var toCsv=require(_0x402a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x402a('0xd'));var qs=require(_0x402a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x402a('0xf'))(_0x402a('0x10'));var utils=require(_0x402a('0x11'));var config=require(_0x402a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x402a('0x13'))['db'];var jayson=require(_0x402a('0x14'));var client=jayson['client'][_0x402a('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x4ff182,_0x50738a,_0x5d039e,_0x41540d){return new BPromise(function(_0x9be424,_0x27d856){var _0x539098=_0x41540d||client;return _0x539098[_0x402a('0x16')](_0x4ff182,_0x5d039e)[_0x402a('0x17')](function(_0x46a0b3){logger[_0x402a('0x18')]('Setting,\x20%s,\x20%s',_0x50738a,_0x402a('0x19'));logger[_0x402a('0x1a')](_0x402a('0x1b'),_0x50738a,_0x402a('0x19'),JSON['stringify'](_0x46a0b3));if(_0x46a0b3[_0x402a('0x1c')]){if(_0x46a0b3['error'][_0x402a('0x1d')]===0x1f4){logger[_0x402a('0x1c')](_0x402a('0x1e'),_0x50738a,_0x46a0b3[_0x402a('0x1c')]['message']);return _0x27d856(_0x46a0b3[_0x402a('0x1c')][_0x402a('0x1f')]);}logger[_0x402a('0x1c')]('Setting,\x20%s,\x20%s',_0x50738a,_0x46a0b3['error'][_0x402a('0x1f')]);return _0x9be424(_0x46a0b3[_0x402a('0x1c')][_0x402a('0x1f')]);}else{logger[_0x402a('0x18')](_0x402a('0x1e'),_0x50738a,_0x402a('0x19'));_0x9be424(_0x46a0b3['result'][_0x402a('0x1f')]);}})[_0x402a('0x20')](function(_0x3dff31){logger[_0x402a('0x1c')](_0x402a('0x1e'),_0x50738a,_0x3dff31);_0x27d856(_0x3dff31);});});}function respondWithStatusCode(_0x3cbab3,_0x49888e){_0x49888e=_0x49888e||0xcc;return function(_0x4d7064){if(_0x4d7064){return _0x3cbab3['sendStatus'](_0x49888e);}return _0x3cbab3['status'](_0x49888e)[_0x402a('0x21')]();};}function respondWithResult(_0x1b455d,_0x2bb90e){_0x2bb90e=_0x2bb90e||0xc8;return function(_0x205fe8){if(_0x205fe8){return _0x1b455d['status'](_0x2bb90e)[_0x402a('0x22')](_0x205fe8);}};}function respondWithFilteredResult(_0x527de9,_0x428b9a){return function(_0x3595bb){if(_0x3595bb){var _0x1eb87d=typeof _0x428b9a[_0x402a('0x23')]===_0x402a('0x24')&&typeof _0x428b9a[_0x402a('0x25')]===_0x402a('0x24');var _0x3ddb31=_0x3595bb[_0x402a('0x26')];var _0x32f7f9=_0x1eb87d?0x0:_0x428b9a[_0x402a('0x23')];var _0x548a9d=_0x1eb87d?_0x3595bb[_0x402a('0x26')]:_0x428b9a[_0x402a('0x23')]+_0x428b9a[_0x402a('0x25')];var _0x47ec76;if(_0x548a9d>=_0x3ddb31){_0x548a9d=_0x3ddb31;_0x47ec76=0xc8;}else{_0x47ec76=0xce;}_0x527de9[_0x402a('0x27')](_0x47ec76);return _0x527de9[_0x402a('0x28')](_0x402a('0x29'),_0x32f7f9+'-'+_0x548a9d+'/'+_0x3ddb31)[_0x402a('0x22')](_0x3595bb);}return null;};}function patchUpdates(_0x370dd1){return function(_0x315c62){try{jsonpatch['apply'](_0x315c62,_0x370dd1,!![]);}catch(_0x65980){return BPromise['reject'](_0x65980);}return _0x315c62['save']();};}function saveUpdates(_0x9fbd00,_0xac43dc){return function(_0x3ccfe1){if(_0x3ccfe1){return _0x3ccfe1[_0x402a('0x2a')](_0x9fbd00)[_0x402a('0x17')](function(_0x253937){return _0x253937;});}return null;};}function removeEntity(_0x21c00e,_0x44f6c2){return function(_0x2c75f6){if(_0x2c75f6){return _0x2c75f6['destroy']()[_0x402a('0x17')](function(){_0x21c00e[_0x402a('0x27')](0xcc)[_0x402a('0x21')]();});}};}function handleEntityNotFound(_0x461fa9,_0x3ebc4a){return function(_0x3c8484){if(!_0x3c8484){_0x461fa9[_0x402a('0x2b')](0x194);}return _0x3c8484;};}function handleError(_0x2797f2,_0xbe6b1e){_0xbe6b1e=_0xbe6b1e||0x1f4;return function(_0x1aacbf){logger[_0x402a('0x1c')](_0x1aacbf['stack']);if(_0x1aacbf[_0x402a('0x2c')]){delete _0x1aacbf[_0x402a('0x2c')];}_0x2797f2[_0x402a('0x27')](_0xbe6b1e)[_0x402a('0x2d')](_0x1aacbf);};}exports[_0x402a('0x2e')]=function(_0x1d5790,_0x1bfff1){var _0x4b967c={},_0x42a7e2={},_0x199ae1={'count':0x0,'rows':[]};var _0x5ac519=_[_0x402a('0x2f')](db[_0x402a('0x30')]['rawAttributes'],function(_0x24ae96){return{'name':_0x24ae96[_0x402a('0x31')],'type':_0x24ae96[_0x402a('0x32')][_0x402a('0x33')]};});_0x42a7e2[_0x402a('0x34')]=_[_0x402a('0x2f')](_0x5ac519,_0x402a('0x2c'));_0x42a7e2[_0x402a('0x35')]=_['keys'](_0x1d5790[_0x402a('0x35')]);_0x42a7e2[_0x402a('0x36')]=_[_0x402a('0x37')](_0x42a7e2[_0x402a('0x34')],_0x42a7e2['query']);_0x4b967c['attributes']=_[_0x402a('0x37')](_0x42a7e2[_0x402a('0x34')],qs[_0x402a('0x38')](_0x1d5790[_0x402a('0x35')][_0x402a('0x38')]));_0x4b967c[_0x402a('0x39')]=_0x4b967c['attributes'][_0x402a('0x3a')]?_0x4b967c[_0x402a('0x39')]:_0x42a7e2[_0x402a('0x34')];if(!_0x1d5790[_0x402a('0x35')][_0x402a('0x3b')](_0x402a('0x3c'))){_0x4b967c['limit']=qs['limit'](_0x1d5790[_0x402a('0x35')]['limit']);_0x4b967c['offset']=qs[_0x402a('0x23')](_0x1d5790[_0x402a('0x35')]['offset']);}_0x4b967c[_0x402a('0x3d')]=qs[_0x402a('0x3e')](_0x1d5790[_0x402a('0x35')]['sort']);_0x4b967c[_0x402a('0x3f')]=qs[_0x402a('0x36')](_[_0x402a('0x40')](_0x1d5790[_0x402a('0x35')],_0x42a7e2[_0x402a('0x36')]),_0x5ac519);if(_0x1d5790[_0x402a('0x35')][_0x402a('0x41')]){_0x4b967c[_0x402a('0x3f')]=_[_0x402a('0x42')](_0x4b967c[_0x402a('0x3f')],{'$or':_['map'](_0x5ac519,function(_0x1c4be9){if(_0x1c4be9[_0x402a('0x32')]!=='VIRTUAL'){var _0x51c16c={};_0x51c16c[_0x1c4be9['name']]={'$like':'%'+_0x1d5790[_0x402a('0x35')][_0x402a('0x41')]+'%'};return _0x51c16c;}})});}_0x4b967c=_[_0x402a('0x42')]({},_0x4b967c,_0x1d5790['options']);var _0x12ed76={'where':_0x4b967c[_0x402a('0x3f')]};return db['Setting'][_0x402a('0x26')](_0x12ed76)['then'](function(_0xae2c8c){_0x199ae1[_0x402a('0x26')]=_0xae2c8c;if(_0x1d5790[_0x402a('0x35')][_0x402a('0x43')]){_0x4b967c['include']=[{'all':!![]}];}return db['Setting'][_0x402a('0x44')](_0x4b967c);})[_0x402a('0x17')](function(_0x36f96b){_0x199ae1[_0x402a('0x45')]=_0x36f96b;return _0x199ae1;})[_0x402a('0x17')](respondWithFilteredResult(_0x1bfff1,_0x4b967c))[_0x402a('0x20')](handleError(_0x1bfff1,null));};exports['show']=function(_0x587235,_0x5ef9f2){var _0x3ab364={'raw':![],'where':{'id':_0x587235['params']['id']}},_0x188347={};_0x188347[_0x402a('0x34')]=_['keys'](db[_0x402a('0x30')][_0x402a('0x46')]);_0x188347[_0x402a('0x35')]=_[_0x402a('0x47')](_0x587235[_0x402a('0x35')]);_0x188347[_0x402a('0x36')]=_[_0x402a('0x37')](_0x188347['model'],_0x188347[_0x402a('0x35')]);_0x3ab364[_0x402a('0x39')]=_['intersection'](_0x188347['model'],qs[_0x402a('0x38')](_0x587235['query']['fields']));_0x3ab364[_0x402a('0x39')]=_0x3ab364[_0x402a('0x39')]['length']?_0x3ab364['attributes']:_0x188347['model'];if(_0x587235[_0x402a('0x35')][_0x402a('0x43')]){_0x3ab364[_0x402a('0x48')]=[{'all':!![]}];}_0x3ab364=_[_0x402a('0x42')]({},_0x3ab364,_0x587235[_0x402a('0x49')]);return db[_0x402a('0x30')][_0x402a('0x4a')](_0x3ab364)['then'](handleEntityNotFound(_0x5ef9f2,null))[_0x402a('0x17')](respondWithResult(_0x5ef9f2,null))[_0x402a('0x20')](handleError(_0x5ef9f2,null));};exports[_0x402a('0x2a')]=function(_0x1c55a5,_0x6ccb1f){if(_0x1c55a5[_0x402a('0x4b')]['id']){delete _0x1c55a5[_0x402a('0x4b')]['id'];}return db[_0x402a('0x30')]['find']({'where':{'id':_0x1c55a5[_0x402a('0x4c')]['id']}})[_0x402a('0x17')](handleEntityNotFound(_0x6ccb1f,null))[_0x402a('0x17')](saveUpdates(_0x1c55a5[_0x402a('0x4b')],null))[_0x402a('0x17')](respondWithResult(_0x6ccb1f,null))[_0x402a('0x20')](handleError(_0x6ccb1f,null));};exports[_0x402a('0x4d')]=function(_0x1e7276,_0x4efdaf,_0x794637){if(_0x1e7276['file']&&_0x1e7276['file']['filename']){_0x1e7276[_0x402a('0x4b')][_0x402a('0x4e')]=_0x1e7276[_0x402a('0x4f')]['filename'];}return db[_0x402a('0x30')][_0x402a('0x4a')]({'where':{'id':_0x1e7276[_0x402a('0x4c')]['id']}})[_0x402a('0x17')](handleEntityNotFound(_0x4efdaf,null))[_0x402a('0x17')](saveUpdates(_0x1e7276[_0x402a('0x4b')],null))['then'](respondWithResult(_0x4efdaf,null))[_0x402a('0x20')](handleError(_0x4efdaf,null));};exports['addLogoLogin']=function(_0x5656cf,_0xe2c5a8,_0x41ec61){if(_0x5656cf['file']&&_0x5656cf[_0x402a('0x4f')][_0x402a('0x50')]){_0x5656cf['body'][_0x402a('0x51')]=_0x5656cf[_0x402a('0x4f')][_0x402a('0x50')];}return db[_0x402a('0x30')]['find']({'where':{'id':_0x5656cf[_0x402a('0x4c')]['id']}})[_0x402a('0x17')](handleEntityNotFound(_0xe2c5a8,null))['then'](saveUpdates(_0x5656cf['body'],null))[_0x402a('0x17')](respondWithResult(_0xe2c5a8,null))[_0x402a('0x20')](handleError(_0xe2c5a8,null));};var utilLicense=require(_0x402a('0x52'));exports[_0x402a('0x53')]=function(_0x314636,_0x53e293,_0x309f4a){var _0x4bde74='server/files/images/logos';var _0x4600c7={'custom':![]};return utilLicense[_0x402a('0x54')]()[_0x402a('0x17')](function(_0xa9ed2c){if(_0xa9ed2c){_0x4600c7=_0xa9ed2c;}return db[_0x402a('0x30')][_0x402a('0x4a')]({'where':{'id':_0x314636[_0x402a('0x4c')]['id']},'attributes':['logo',_0x402a('0x51'),_0x402a('0x55'),_0x402a('0x56'),_0x402a('0x57'),_0x402a('0x58'),_0x402a('0x59'),'defaultFavicon'],'raw':!![]});})[_0x402a('0x17')](handleEntityNotFound(_0x53e293,null))[_0x402a('0x17')](function(_0x1518a7){if(_0x1518a7){var _0x1f387a=_0x1518a7['logo']&&fs[_0x402a('0x5a')](path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x4bde74,_[_0x402a('0x5d')](_0x1518a7[_0x402a('0x4e')])))?path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x4bde74,_['toLower'](_0x1518a7[_0x402a('0x4e')])):path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x4bde74,_[_0x402a('0x5d')](_0x402a('0x5e')));var _0x6069c4=_0x402a('0x5f')+_['upperFirst'](_0x402a('0x4e'));if(_0x1518a7[_0x6069c4]||!_0x4600c7[_0x402a('0x60')]){_0x1f387a=path['join'](config[_0x402a('0x5c')],_0x4bde74,_[_0x402a('0x5d')]('default_logo.svg'));}if(!fs[_0x402a('0x5a')](_0x1f387a)){throw new db[(_0x402a('0x61'))][(_0x402a('0x62'))](_['upperFirst']('logo')+'\x20not\x20found');}return _0x53e293['download'](_0x1f387a);}})[_0x402a('0x20')](handleError(_0x53e293,null));};var utilLicense=require(_0x402a('0x52'));exports[_0x402a('0x63')]=function(_0x20e71d,_0x1ea334,_0xe65c80){var _0x206035=_0x402a('0x64');var _0x5605fe={'custom':![]};return utilLicense[_0x402a('0x54')]()[_0x402a('0x17')](function(_0x1338af){if(_0x1338af){_0x5605fe=_0x1338af;}return db[_0x402a('0x30')]['find']({'where':{'id':_0x20e71d[_0x402a('0x4c')]['id']},'attributes':['logo',_0x402a('0x51'),_0x402a('0x55'),_0x402a('0x56'),_0x402a('0x57'),'defaultLoginLogo',_0x402a('0x59'),_0x402a('0x65')],'raw':!![]});})['then'](handleEntityNotFound(_0x1ea334,null))[_0x402a('0x17')](function(_0x1c50ed){if(_0x1c50ed){var _0x10e8bc=_0x1c50ed[_0x402a('0x51')]&&fs[_0x402a('0x5a')](path['join'](config[_0x402a('0x5c')],_0x206035,_[_0x402a('0x5d')](_0x1c50ed[_0x402a('0x51')])))?path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x206035,_[_0x402a('0x5d')](_0x1c50ed[_0x402a('0x51')])):path[_0x402a('0x5b')](config['root'],_0x206035,_[_0x402a('0x5d')]('default_loginLogo.svg'));var _0x3c3fbf='default'+_['upperFirst'](_0x402a('0x51'));if(_0x1c50ed[_0x3c3fbf]||!_0x5605fe[_0x402a('0x60')]){_0x10e8bc=path['join'](config['root'],_0x206035,_[_0x402a('0x5d')]('default_loginLogo.svg'));}if(!fs[_0x402a('0x5a')](_0x10e8bc)){throw new db[(_0x402a('0x61'))]['ValidationError'](_[_0x402a('0x66')](_0x402a('0x51'))+_0x402a('0x67'));}return _0x1ea334[_0x402a('0x68')](_0x10e8bc);}})[_0x402a('0x20')](handleError(_0x1ea334,null));};exports['gdpr']=function(_0xa5db49,_0xdc2250){return db[_0x402a('0x30')][_0x402a('0x4a')]({'where':{'id':_0xa5db49[_0x402a('0x4c')]['id']},'attributes':[_0x402a('0x69')]})[_0x402a('0x17')](respondWithResult(_0xdc2250,null))[_0x402a('0x20')](handleError(_0xdc2250,null));};exports[_0x402a('0x6a')]=function(_0x5db5ba,_0x243882,_0x502d6d){if(_0x5db5ba[_0x402a('0x4f')]&&_0x5db5ba[_0x402a('0x4f')][_0x402a('0x50')]){_0x5db5ba['body']['preferred']=_0x5db5ba['file'][_0x402a('0x50')];}return db[_0x402a('0x30')][_0x402a('0x4a')]({'where':{'id':_0x5db5ba[_0x402a('0x4c')]['id']}})[_0x402a('0x17')](handleEntityNotFound(_0x243882,null))[_0x402a('0x17')](saveUpdates(_0x5db5ba[_0x402a('0x4b')],null))['then'](respondWithResult(_0x243882,null))[_0x402a('0x20')](handleError(_0x243882,null));};var utilLicense=require(_0x402a('0x52'));exports[_0x402a('0x6b')]=function(_0x23c067,_0x122ce1,_0x21460a){var _0x219232='server/files/images/logos';var _0x547dd8={'custom':![]};return utilLicense[_0x402a('0x54')]()[_0x402a('0x17')](function(_0x1c3167){if(_0x1c3167){_0x547dd8=_0x1c3167;}return db[_0x402a('0x30')][_0x402a('0x4a')]({'where':{'id':_0x23c067['params']['id']},'attributes':[_0x402a('0x4e'),_0x402a('0x51'),_0x402a('0x55'),'favicon',_0x402a('0x57'),_0x402a('0x58'),_0x402a('0x59'),_0x402a('0x65')],'raw':!![]});})['then'](handleEntityNotFound(_0x122ce1,null))[_0x402a('0x17')](function(_0x1a4fd9){if(_0x1a4fd9){var _0x6c220e=_0x1a4fd9['preferred']&&fs[_0x402a('0x5a')](path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x219232,_[_0x402a('0x5d')](_0x1a4fd9[_0x402a('0x55')])))?path[_0x402a('0x5b')](config['root'],_0x219232,_['toLower'](_0x1a4fd9[_0x402a('0x55')])):path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x219232,_[_0x402a('0x5d')](_0x402a('0x6c')));var _0x235c91=_0x402a('0x5f')+_[_0x402a('0x66')]('preferred');if(_0x1a4fd9[_0x235c91]||!_0x547dd8['custom']||!_0x547dd8[_0x402a('0x55')]){_0x6c220e=path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x219232,_['toLower'](_0x402a('0x6c')));}if(!fs[_0x402a('0x5a')](_0x6c220e)){throw new db[(_0x402a('0x61'))]['ValidationError'](_['upperFirst'](_0x402a('0x55'))+'\x20not\x20found');}return _0x122ce1[_0x402a('0x68')](_0x6c220e);}})[_0x402a('0x20')](handleError(_0x122ce1,null));};exports[_0x402a('0x6d')]=function(_0x5f37d1,_0x15970c,_0x18bc37){if(_0x5f37d1[_0x402a('0x4f')]&&_0x5f37d1[_0x402a('0x4f')][_0x402a('0x50')]){_0x5f37d1[_0x402a('0x4b')][_0x402a('0x56')]=_0x5f37d1[_0x402a('0x4f')][_0x402a('0x50')];}return db['Setting']['find']({'where':{'id':_0x5f37d1[_0x402a('0x4c')]['id']}})[_0x402a('0x17')](handleEntityNotFound(_0x15970c,null))[_0x402a('0x17')](saveUpdates(_0x5f37d1[_0x402a('0x4b')],null))[_0x402a('0x17')](respondWithResult(_0x15970c,null))[_0x402a('0x20')](handleError(_0x15970c,null));};var utilLicense=require(_0x402a('0x52'));exports[_0x402a('0x6e')]=function(_0x16d31b,_0xb2ea3f,_0x4658c2){var _0x365df4=_0x402a('0x64');var _0x5a2eb4={'custom':![]};return utilLicense[_0x402a('0x54')]()[_0x402a('0x17')](function(_0x5e40fd){if(_0x5e40fd){_0x5a2eb4=_0x5e40fd;}return db[_0x402a('0x30')][_0x402a('0x4a')]({'where':{'id':_0x16d31b[_0x402a('0x4c')]['id']},'attributes':['logo',_0x402a('0x51'),_0x402a('0x55'),_0x402a('0x56'),'defaultLogo',_0x402a('0x58'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x402a('0x17')](handleEntityNotFound(_0xb2ea3f,null))[_0x402a('0x17')](function(_0x4b697c){if(_0x4b697c){var _0x3d6a20=_0x4b697c[_0x402a('0x56')]&&fs['existsSync'](path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x365df4,_[_0x402a('0x5d')](_0x4b697c[_0x402a('0x56')])))?path[_0x402a('0x5b')](config['root'],_0x365df4,_['toLower'](_0x4b697c[_0x402a('0x56')])):path['join'](config['root'],_0x365df4,_[_0x402a('0x5d')]('default_favicon.ico'));var _0x1b587d=_0x402a('0x5f')+_['upperFirst'](_0x402a('0x56'));if(_0x4b697c[_0x1b587d]||!_0x5a2eb4[_0x402a('0x60')]){_0x3d6a20=path[_0x402a('0x5b')](config[_0x402a('0x5c')],_0x365df4,_[_0x402a('0x5d')]('default_favicon.ico'));}if(!fs[_0x402a('0x5a')](_0x3d6a20)){throw new db['Sequelize'][(_0x402a('0x62'))](_[_0x402a('0x66')](_0x402a('0x56'))+_0x402a('0x67'));}return _0xb2ea3f[_0x402a('0x68')](_0x3d6a20);}})['catch'](handleError(_0xb2ea3f,null));};exports[_0x402a('0x6f')]=function(_0xc29df3,_0x319f1e){var _0x24d368={'offset':moment()[_0x402a('0x70')]()};_0x24d368[_0x402a('0x71')]=moment()[_0x402a('0x70')](_0x24d368['offset'])[_0x402a('0x72')](_0x402a('0x73'));return _0x319f1e[_0x402a('0x27')](0xc8)[_0x402a('0x2d')](_0x24d368);};
\ No newline at end of file
index 729a46c..21aa86e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x4337bc,_0xcf4835){var _0x19b13e=function(_0x5d738f){while(--_0x5d738f){_0x4337bc['push'](_0x4337bc['shift']());}};_0x19b13e(++_0xcf4835);}(_0x34e8,0x12c));var _0x834e=function(_0x3b25b2,_0x45daea){_0x3b25b2=_0x3b25b2-0x0;var _0x117d3a=_0x34e8[_0x3b25b2];return _0x117d3a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x10fd85,_0x3dc68a){var _0x27fc2a=function(_0x468b1a){while(--_0x468b1a){_0x10fd85['push'](_0x10fd85['shift']());}};_0x27fc2a(++_0x3dc68a);}(_0xe14b,0x93));var _0xbe14=function(_0x4c7f54,_0x35e499){_0x4c7f54=_0x4c7f54-0x0;var _0x485cac=_0xe14b[_0x4c7f54];return _0x485cac;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ea2e02..57fbfc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec13=['catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','result'];(function(_0xddccb1,_0x468b7a){var _0x44ad80=function(_0x38ac38){while(--_0x38ac38){_0xddccb1['push'](_0xddccb1['shift']());}};_0x44ad80(++_0x468b7a);}(_0xec13,0x113));var _0x3ec1=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xec13[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x3ec1('0x0'));var util=require(_0x3ec1('0x1'));var moment=require(_0x3ec1('0x2'));var BPromise=require(_0x3ec1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ec1('0x4'));var db=require(_0x3ec1('0x5'))['db'];var utils=require(_0x3ec1('0x6'));var logger=require(_0x3ec1('0x7'))(_0x3ec1('0x8'));var config=require(_0x3ec1('0x9'));var jayson=require(_0x3ec1('0xa'));var client=jayson[_0x3ec1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50e54b,_0x1ce6a0,_0x456dc7){return new BPromise(function(_0xb659ae,_0x1ee211){return client[_0x3ec1('0xc')](_0x50e54b,_0x456dc7)[_0x3ec1('0xd')](function(_0x114c6f){logger[_0x3ec1('0xe')]('Setting,\x20%s,\x20%s',_0x1ce6a0,'request\x20sent');logger[_0x3ec1('0xf')](_0x3ec1('0x10'),_0x1ce6a0,'request\x20sent',JSON['stringify'](_0x114c6f));if(_0x114c6f[_0x3ec1('0x11')]){if(_0x114c6f['error'][_0x3ec1('0x12')]===0x1f4){logger[_0x3ec1('0x11')](_0x3ec1('0x13'),_0x1ce6a0,_0x114c6f['error']['message']);return _0x1ee211(_0x114c6f[_0x3ec1('0x11')][_0x3ec1('0x14')]);}logger['error'](_0x3ec1('0x13'),_0x1ce6a0,_0x114c6f['error'][_0x3ec1('0x14')]);return _0xb659ae(_0x114c6f[_0x3ec1('0x11')][_0x3ec1('0x14')]);}else{logger[_0x3ec1('0xe')]('Setting,\x20%s,\x20%s',_0x1ce6a0,'request\x20sent');_0xb659ae(_0x114c6f[_0x3ec1('0x15')][_0x3ec1('0x14')]);}})[_0x3ec1('0x16')](function(_0x5ca7cb){logger['error'](_0x3ec1('0x13'),_0x1ce6a0,_0x5ca7cb);_0x1ee211(_0x5ca7cb);});});}exports[_0x3ec1('0x17')]=function(_0x2c06cb){var _0x5d6ba1=this;return new Promise(function(_0x464f97,_0x14d1c6){return db[_0x3ec1('0x18')][_0x3ec1('0x19')]({'raw':_0x2c06cb[_0x3ec1('0x1a')]?_0x2c06cb['options'][_0x3ec1('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c06cb[_0x3ec1('0x1a')]?_0x2c06cb[_0x3ec1('0x1a')][_0x3ec1('0x1c')]||null:null,'attributes':_0x2c06cb[_0x3ec1('0x1a')]?_0x2c06cb['options'][_0x3ec1('0x1d')]||null:null,'include':_0x2c06cb[_0x3ec1('0x1a')]?_0x2c06cb[_0x3ec1('0x1a')][_0x3ec1('0x1e')]?_['map'](_0x2c06cb[_0x3ec1('0x1a')][_0x3ec1('0x1e')],function(_0x494dea){return{'model':db[_0x494dea[_0x3ec1('0x1f')]],'as':_0x494dea['as'],'attributes':_0x494dea[_0x3ec1('0x1d')],'include':_0x494dea[_0x3ec1('0x1e')]?_[_0x3ec1('0x20')](_0x494dea['include'],function(_0x3daa51){return{'model':db[_0x3daa51[_0x3ec1('0x1f')]],'as':_0x3daa51['as'],'attributes':_0x3daa51[_0x3ec1('0x1d')],'include':_0x3daa51[_0x3ec1('0x1e')]?_[_0x3ec1('0x20')](_0x3daa51['include'],function(_0x50842c){return{'model':db[_0x50842c[_0x3ec1('0x1f')]],'as':_0x50842c['as'],'attributes':_0x50842c['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ec1('0xd')](function(_0xced5a6){logger['info']('ShowSetting',_0x2c06cb);logger['debug'](_0x3ec1('0x17'),_0x2c06cb,JSON['stringify'](_0xced5a6));_0x464f97(_0xced5a6);})[_0x3ec1('0x16')](function(_0x10f21f){logger[_0x3ec1('0x11')]('ShowSetting',_0x10f21f[_0x3ec1('0x14')],_0x2c06cb);_0x14d1c6(_0x5d6ba1[_0x3ec1('0x11')](0x1f4,_0x10f21f['message']));});});};
\ No newline at end of file
+var _0xc2b1=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','request\x20sent','catch','ShowSetting','find','options','raw','where','attributes','include','model','then','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x58a0e0,_0x28632a){var _0x427bbe=function(_0x45751a){while(--_0x45751a){_0x58a0e0['push'](_0x58a0e0['shift']());}};_0x427bbe(++_0x28632a);}(_0xc2b1,0xe3));var _0x1c2b=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xc2b1[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0x1c2b('0x0'));var moment=require(_0x1c2b('0x1'));var BPromise=require(_0x1c2b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c2b('0x3'));var db=require(_0x1c2b('0x4'))['db'];var utils=require(_0x1c2b('0x5'));var logger=require(_0x1c2b('0x6'))(_0x1c2b('0x7'));var config=require(_0x1c2b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1c2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x512a63,_0x37126d,_0xf68890){return new BPromise(function(_0x3b960a,_0x33a140){return client[_0x1c2b('0xa')](_0x512a63,_0xf68890)['then'](function(_0x700678){logger[_0x1c2b('0xb')]('Setting,\x20%s,\x20%s',_0x37126d,'request\x20sent');logger[_0x1c2b('0xc')](_0x1c2b('0xd'),_0x37126d,'request\x20sent',JSON[_0x1c2b('0xe')](_0x700678));if(_0x700678[_0x1c2b('0xf')]){if(_0x700678['error']['code']===0x1f4){logger[_0x1c2b('0xf')](_0x1c2b('0x10'),_0x37126d,_0x700678['error'][_0x1c2b('0x11')]);return _0x33a140(_0x700678['error']['message']);}logger[_0x1c2b('0xf')]('Setting,\x20%s,\x20%s',_0x37126d,_0x700678['error'][_0x1c2b('0x11')]);return _0x3b960a(_0x700678['error'][_0x1c2b('0x11')]);}else{logger['info'](_0x1c2b('0x10'),_0x37126d,_0x1c2b('0x12'));_0x3b960a(_0x700678['result']['message']);}})[_0x1c2b('0x13')](function(_0xfc30a0){logger[_0x1c2b('0xf')](_0x1c2b('0x10'),_0x37126d,_0xfc30a0);_0x33a140(_0xfc30a0);});});}exports[_0x1c2b('0x14')]=function(_0x542414){var _0x4b2b14=this;return new Promise(function(_0x12b933,_0x652d1b){return db['Setting'][_0x1c2b('0x15')]({'raw':_0x542414['options']?_0x542414[_0x1c2b('0x16')][_0x1c2b('0x17')]===undefined?!![]:![]:!![],'where':_0x542414['options']?_0x542414['options'][_0x1c2b('0x18')]||null:null,'attributes':_0x542414['options']?_0x542414['options'][_0x1c2b('0x19')]||null:null,'include':_0x542414[_0x1c2b('0x16')]?_0x542414[_0x1c2b('0x16')][_0x1c2b('0x1a')]?_['map'](_0x542414[_0x1c2b('0x16')][_0x1c2b('0x1a')],function(_0x3c2904){return{'model':db[_0x3c2904[_0x1c2b('0x1b')]],'as':_0x3c2904['as'],'attributes':_0x3c2904[_0x1c2b('0x19')],'include':_0x3c2904[_0x1c2b('0x1a')]?_['map'](_0x3c2904[_0x1c2b('0x1a')],function(_0x3ad3b7){return{'model':db[_0x3ad3b7[_0x1c2b('0x1b')]],'as':_0x3ad3b7['as'],'attributes':_0x3ad3b7[_0x1c2b('0x19')],'include':_0x3ad3b7[_0x1c2b('0x1a')]?_['map'](_0x3ad3b7['include'],function(_0x17625e){return{'model':db[_0x17625e[_0x1c2b('0x1b')]],'as':_0x17625e['as'],'attributes':_0x17625e[_0x1c2b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1c2b('0x1c')](function(_0x21034b){logger[_0x1c2b('0xb')](_0x1c2b('0x14'),_0x542414);logger[_0x1c2b('0xc')](_0x1c2b('0x14'),_0x542414,JSON['stringify'](_0x21034b));_0x12b933(_0x21034b);})[_0x1c2b('0x13')](function(_0x6b600c){logger[_0x1c2b('0xf')](_0x1c2b('0x14'),_0x6b600c[_0x1c2b('0x11')],_0x542414);_0x652d1b(_0x4b2b14[_0x1c2b('0xf')](0x1f4,_0x6b600c[_0x1c2b('0x11')]));});});};
\ No newline at end of file
index 500d594..1ff6af5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x4320a7,_0x239a92){var _0x3700bf=function(_0x2c3db0){while(--_0x2c3db0){_0x4320a7['push'](_0x4320a7['shift']());}};_0x3700bf(++_0x239a92);}(_0x814b,0x1a2));var _0xb814=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0x814b[_0x2d3a4d];return _0x3a94a3;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router;
\ No newline at end of file
+var _0x55ca=['describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0x55ca,0x126));var _0xa55c=function(_0x14490c,_0x50e8ab){_0x14490c=_0x14490c-0x0;var _0x2f6825=_0x55ca[_0x14490c];return _0x2f6825;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getApplications']);router['get'](_0xa55c('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xa55c('0x12'),controller[_0xa55c('0x13')]);router[_0xa55c('0x7')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x17')](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);router[_0xa55c('0x17')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller['addAnswer']);router[_0xa55c('0x17')](_0xa55c('0x19'),controller[_0xa55c('0x1a')]);router[_0xa55c('0x17')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['addApplications']);router['post'](_0xa55c('0x1b'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1c')]);router['post'](_0xa55c('0x12'),controller[_0xa55c('0x1d')]);router['post'](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1e')]);router[_0xa55c('0x1f')](_0xa55c('0xb'),auth['isAuthenticated'](),controller[_0xa55c('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x21')]);router['delete'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x22')]);router[_0xa55c('0x23')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x24')]);router[_0xa55c('0x23')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x25')]);module['exports']=router;
\ No newline at end of file
index ad6b520..a831b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf42e=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0xe8631c,_0x4598ba){var _0x4319af=function(_0x4e8994){while(--_0x4e8994){_0xe8631c['push'](_0xe8631c['shift']());}};_0x4319af(++_0x4598ba);}(_0xf42e,0xdb));var _0xef42=function(_0x41508a,_0x2374c8){_0x41508a=_0x41508a-0x0;var _0x3d2063=_0xf42e[_0x41508a];return _0x3d2063;};'use strict';var Sequelize=require(_0xef42('0x0'));var rs=require(_0xef42('0x1'));module[_0xef42('0x2')]={'name':{'type':Sequelize[_0xef42('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xef42('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xef42('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xef42('0x4')]();}},'phone':{'type':Sequelize[_0xef42('0x3')]},'type':{'type':Sequelize['ENUM'](_0xef42('0x5'),_0xef42('0x6'),_0xef42('0x7'),_0xef42('0x8'),_0xef42('0x9'),_0xef42('0xa'),_0xef42('0xb'),_0xef42('0xc'),_0xef42('0xd'),_0xef42('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xef42('0x3')]},'authToken':{'type':Sequelize[_0xef42('0x3')]},'smsMethod':{'type':Sequelize[_0xef42('0xf')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xef42('0x3')]},'applicationId':{'type':Sequelize[_0xef42('0x3')]},'accountId':{'type':Sequelize[_0xef42('0x3')]},'senderString':{'type':Sequelize[_0xef42('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xef42('0x10')],'defaultValue':function(){return _0xef42('0x11');}},'notificationSound':{'type':Sequelize[_0xef42('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xef42('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xef42('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xef42('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xef42('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef42('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xef42('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xef42('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xef42('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a10f8){if(!_0x2a10f8)this[_0xef42('0x15')](_0xef42('0x16'),null);this[_0xef42('0x15')](_0xef42('0x17'),_0x2a10f8);}}};
\ No newline at end of file
+var _0x83df=['sequelize','randomstring','STRING','ENUM','twilio','skebby','connectel','plivo','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x83df,0xbe));var _0xf83d=function(_0x346caa,_0x46888d){_0x346caa=_0x346caa-0x0;var _0x1f4548=_0x83df[_0x346caa];return _0x1f4548;};'use strict';var Sequelize=require(_0xf83d('0x0'));var rs=require(_0xf83d('0x1'));module['exports']={'name':{'type':Sequelize[_0xf83d('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xf83d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xf83d('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xf83d('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf83d('0x3')](_0xf83d('0x4'),_0xf83d('0x5'),_0xf83d('0x6'),'clicksend',_0xf83d('0x7'),'clickatell','bandwidth','csc',_0xf83d('0x8'),_0xf83d('0x9'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xf83d('0x2')]},'authToken':{'type':Sequelize[_0xf83d('0x2')]},'smsMethod':{'type':Sequelize[_0xf83d('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0xf83d('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xf83d('0x2')]},'applicationId':{'type':Sequelize[_0xf83d('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xf83d('0x2')]},'deliveryReport':{'type':Sequelize[_0xf83d('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0xf83d('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf83d('0xb')],'defaultValue':function(){return _0xf83d('0xc');}},'notificationSound':{'type':Sequelize[_0xf83d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf83d('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf83d('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf83d('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf83d('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf83d('0xd')],'comment':_0xf83d('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf83d('0xf'),'set':function(_0x266dca){if(!_0x266dca)this[_0xf83d('0x10')](_0xf83d('0x11'),null);this[_0xf83d('0x10')](_0xf83d('0x12'),_0x266dca);}}};
\ No newline at end of file
index 3bc8dfe..d4d5faf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6607=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','SmsAccountId','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','SmsApplication','applications','orderBy','priority','account','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','connectel','clicksend','message_id','plivo','Text','results','segmentedMessage','clickatell','fromNumber','text','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','omit','defaults','contact','SmsInteraction','interaction','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','requestid','statusInt','status_code','infobip','groupName','redif','DELIVERED','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','state','message-id','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','Pause','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId'];(function(_0x418651,_0x3e2f50){var _0xc47a57=function(_0xc81a0a){while(--_0xc81a0a){_0x418651['push'](_0x418651['shift']());}};_0xc47a57(++_0x3e2f50);}(_0x6607,0x80));var _0x7660=function(_0x47599a,_0x10c87c){_0x47599a=_0x47599a-0x0;var _0x46d22c=_0x6607[_0x47599a];return _0x46d22c;};'use strict';var emlformat=require(_0x7660('0x0'));var rimraf=require(_0x7660('0x1'));var zipdir=require(_0x7660('0x2'));var jsonpatch=require(_0x7660('0x3'));var rp=require(_0x7660('0x4'));var moment=require(_0x7660('0x5'));var BPromise=require(_0x7660('0x6'));var Mustache=require(_0x7660('0x7'));var util=require(_0x7660('0x8'));var path=require(_0x7660('0x9'));var sox=require('sox');var csv=require(_0x7660('0xa'));var ejs=require(_0x7660('0xb'));var fs=require('fs');var fs_extra=require(_0x7660('0xc'));var _=require(_0x7660('0xd'));var squel=require('squel');var crypto=require(_0x7660('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7660('0xf'));var toCsv=require(_0x7660('0xa'));var querystring=require(_0x7660('0x10'));var Papa=require(_0x7660('0x11'));var Redis=require(_0x7660('0x12'));var authService=require(_0x7660('0x13'));var qs=require(_0x7660('0x14'));var as=require(_0x7660('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7660('0x16'));var utils=require(_0x7660('0x17'));var config=require(_0x7660('0x18'));var licenseUtil=require(_0x7660('0x19'));var db=require(_0x7660('0x1a'))['db'];config[_0x7660('0x1b')]=_['defaults'](config['redis'],{'host':_0x7660('0x1c'),'port':0x18eb});var socket=require(_0x7660('0x1d'))(new Redis(config[_0x7660('0x1b')]));require('./smsAccount.socket')[_0x7660('0x1e')](socket);var jayson=require(_0x7660('0x1f'));var client=jayson[_0x7660('0x20')][_0x7660('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x260aa4,_0x32b43e,_0x213a96,_0x294f8c){return new BPromise(function(_0x381439,_0x48026a){var _0xdbacba=_0x294f8c||client;return _0xdbacba[_0x7660('0x22')](_0x260aa4,_0x213a96)[_0x7660('0x23')](function(_0x549624){logger[_0x7660('0x24')](_0x7660('0x25'),_0x32b43e,_0x7660('0x26'));logger[_0x7660('0x27')](_0x7660('0x28'),_0x32b43e,_0x7660('0x26'),JSON['stringify'](_0x549624));if(_0x549624[_0x7660('0x29')]){if(_0x549624[_0x7660('0x29')]['code']===0x1f4){logger['error'](_0x7660('0x25'),_0x32b43e,_0x549624[_0x7660('0x29')]['message']);return _0x48026a(_0x549624[_0x7660('0x29')][_0x7660('0x2a')]);}logger[_0x7660('0x29')](_0x7660('0x25'),_0x32b43e,_0x549624[_0x7660('0x29')][_0x7660('0x2a')]);return _0x381439(_0x549624[_0x7660('0x29')][_0x7660('0x2a')]);}else{logger[_0x7660('0x24')](_0x7660('0x25'),_0x32b43e,_0x7660('0x26'));_0x381439(_0x549624[_0x7660('0x2b')][_0x7660('0x2a')]);}})['catch'](function(_0x269a4c){logger[_0x7660('0x29')](_0x7660('0x25'),_0x32b43e,_0x269a4c);_0x48026a(_0x269a4c);});});}function respondWithStatusCode(_0x304d12,_0x4c8f7b){_0x4c8f7b=_0x4c8f7b||0xcc;return function(_0x3c16ee){if(_0x3c16ee){return _0x304d12[_0x7660('0x2c')](_0x4c8f7b);}return _0x304d12[_0x7660('0x2d')](_0x4c8f7b)[_0x7660('0x2e')]();};}function respondWithResult(_0x277211,_0x57f507){_0x57f507=_0x57f507||0xc8;return function(_0x100f7f){if(_0x100f7f){return _0x277211[_0x7660('0x2d')](_0x57f507)[_0x7660('0x2f')](_0x100f7f);}};}function respondWithFilteredResult(_0x5a219a,_0x595631){return function(_0x1e5d08){if(_0x1e5d08){var _0x3299d7=typeof _0x595631[_0x7660('0x30')]==='undefined'&&typeof _0x595631[_0x7660('0x31')]===_0x7660('0x32');var _0x18fd52=_0x1e5d08[_0x7660('0x33')];var _0x239e67=_0x3299d7?0x0:_0x595631[_0x7660('0x30')];var _0x564442=_0x3299d7?_0x1e5d08[_0x7660('0x33')]:_0x595631[_0x7660('0x30')]+_0x595631[_0x7660('0x31')];var _0x18798c;if(_0x564442>=_0x18fd52){_0x564442=_0x18fd52;_0x18798c=0xc8;}else{_0x18798c=0xce;}_0x5a219a[_0x7660('0x2d')](_0x18798c);return _0x5a219a[_0x7660('0x34')]('Content-Range',_0x239e67+'-'+_0x564442+'/'+_0x18fd52)[_0x7660('0x2f')](_0x1e5d08);}return null;};}function patchUpdates(_0x19cde0){return function(_0x894a5b){try{jsonpatch[_0x7660('0x35')](_0x894a5b,_0x19cde0,!![]);}catch(_0x980364){return BPromise[_0x7660('0x36')](_0x980364);}return _0x894a5b[_0x7660('0x37')]();};}function saveUpdates(_0x3749fe,_0x2232f8){return function(_0x438696){if(_0x438696){return _0x438696[_0x7660('0x38')](_0x3749fe)['then'](function(_0x599881){return _0x599881;});}return null;};}function removeEntity(_0x174e9e,_0x5245bf){return function(_0x153508){if(_0x153508){return _0x153508[_0x7660('0x39')]()[_0x7660('0x23')](function(){var _0x4feb14=_0x153508[_0x7660('0x3a')]({'plain':!![]});var _0x460979=_0x7660('0x3b');return db['UserProfileResource'][_0x7660('0x39')]({'where':{'type':_0x460979,'resourceId':_0x4feb14['id']}})[_0x7660('0x23')](function(){return _0x153508;});})[_0x7660('0x23')](function(){_0x174e9e['status'](0xcc)[_0x7660('0x2e')]();});}};}function handleEntityNotFound(_0x3edc33,_0x128633){return function(_0x448c07){if(!_0x448c07){_0x3edc33[_0x7660('0x2c')](0x194);}return _0x448c07;};}function handleError(_0x4e29d4,_0x2e33a0){_0x2e33a0=_0x2e33a0||0x1f4;return function(_0x291c79){logger[_0x7660('0x29')](_0x291c79[_0x7660('0x3c')]);if(_0x291c79[_0x7660('0x3d')]){delete _0x291c79[_0x7660('0x3d')];}_0x4e29d4[_0x7660('0x2d')](_0x2e33a0)['send'](_0x291c79);};}exports[_0x7660('0x3e')]=function(_0x39dc7c,_0x2266b9){var _0x19a8ff={'include':[{'model':db['Pause'],'as':_0x7660('0x3f')}]},_0x72f5c5={},_0x3875a5={'count':0x0,'rows':[]};var _0x216b58=_[_0x7660('0x40')](db[_0x7660('0x41')][_0x7660('0x42')],function(_0x1593b1){return{'name':_0x1593b1[_0x7660('0x43')],'type':_0x1593b1[_0x7660('0x44')][_0x7660('0x45')]};});_0x72f5c5[_0x7660('0x46')]=_['map'](_0x216b58,_0x7660('0x3d'));_0x72f5c5[_0x7660('0x47')]=_[_0x7660('0x48')](_0x39dc7c['query']);_0x72f5c5['filters']=_['intersection'](_0x72f5c5[_0x7660('0x46')],_0x72f5c5[_0x7660('0x47')]);_0x19a8ff[_0x7660('0x49')]=_[_0x7660('0x4a')](_0x72f5c5[_0x7660('0x46')],qs['fields'](_0x39dc7c['query'][_0x7660('0x4b')]));_0x19a8ff['attributes']=_0x19a8ff[_0x7660('0x49')][_0x7660('0x4c')]?_0x19a8ff[_0x7660('0x49')]:_0x72f5c5[_0x7660('0x46')];if(!_0x39dc7c[_0x7660('0x47')][_0x7660('0x4d')](_0x7660('0x4e'))){_0x19a8ff[_0x7660('0x31')]=qs['limit'](_0x39dc7c[_0x7660('0x47')][_0x7660('0x31')]);_0x19a8ff['offset']=qs[_0x7660('0x30')](_0x39dc7c[_0x7660('0x47')][_0x7660('0x30')]);}_0x19a8ff[_0x7660('0x4f')]=qs[_0x7660('0x50')](_0x39dc7c[_0x7660('0x47')][_0x7660('0x50')]);_0x19a8ff['where']=qs['filters'](_[_0x7660('0x51')](_0x39dc7c['query'],_0x72f5c5[_0x7660('0x52')]),_0x216b58);if(_0x39dc7c[_0x7660('0x47')][_0x7660('0x53')]){_0x19a8ff['where']=_[_0x7660('0x54')](_0x19a8ff[_0x7660('0x55')],{'$or':_['map'](_0x216b58,function(_0x392584){if(_0x392584[_0x7660('0x44')]!==_0x7660('0x56')){var _0xec9adb={};_0xec9adb[_0x392584[_0x7660('0x3d')]]={'$like':'%'+_0x39dc7c[_0x7660('0x47')][_0x7660('0x53')]+'%'};return _0xec9adb;}})});}_0x19a8ff=_[_0x7660('0x54')]({},_0x19a8ff,_0x39dc7c[_0x7660('0x57')]);var _0x38a8ed={'where':_0x19a8ff['where']};return db[_0x7660('0x41')][_0x7660('0x33')](_0x38a8ed)[_0x7660('0x23')](function(_0x44f43b){_0x3875a5[_0x7660('0x33')]=_0x44f43b;if(_0x39dc7c[_0x7660('0x47')][_0x7660('0x58')]){_0x19a8ff['include']=[{'all':!![]}];}return db['SmsAccount'][_0x7660('0x59')](_0x19a8ff);})[_0x7660('0x23')](function(_0x279630){_0x3875a5[_0x7660('0x5a')]=_0x279630;return _0x3875a5;})[_0x7660('0x23')](respondWithFilteredResult(_0x2266b9,_0x19a8ff))[_0x7660('0x5b')](handleError(_0x2266b9,null));};exports[_0x7660('0x5c')]=function(_0x36ce1c,_0x1e7d9d){var _0x59e8c0={'raw':![],'where':{'id':_0x36ce1c['params']['id']},'include':[{'model':db[_0x7660('0x5d')],'as':_0x7660('0x3f')}]},_0x3e0490={};_0x3e0490[_0x7660('0x46')]=_['keys'](db['SmsAccount']['rawAttributes']);_0x3e0490[_0x7660('0x47')]=_[_0x7660('0x48')](_0x36ce1c[_0x7660('0x47')]);_0x3e0490[_0x7660('0x52')]=_['intersection'](_0x3e0490[_0x7660('0x46')],_0x3e0490['query']);_0x59e8c0[_0x7660('0x49')]=_[_0x7660('0x4a')](_0x3e0490['model'],qs[_0x7660('0x4b')](_0x36ce1c[_0x7660('0x47')][_0x7660('0x4b')]));_0x59e8c0[_0x7660('0x49')]=_0x59e8c0['attributes']['length']?_0x59e8c0[_0x7660('0x49')]:_0x3e0490[_0x7660('0x46')];if(_0x36ce1c[_0x7660('0x47')]['includeAll']){_0x59e8c0[_0x7660('0x5e')]=[{'all':!![]}];}_0x59e8c0=_['merge']({},_0x59e8c0,_0x36ce1c[_0x7660('0x57')]);return db[_0x7660('0x41')]['find'](_0x59e8c0)[_0x7660('0x23')](handleEntityNotFound(_0x1e7d9d,null))[_0x7660('0x23')](respondWithResult(_0x1e7d9d,null))[_0x7660('0x5b')](handleError(_0x1e7d9d,null));};exports[_0x7660('0x5f')]=function(_0x21c74d,_0x405052){return db[_0x7660('0x41')][_0x7660('0x5f')](_0x21c74d[_0x7660('0x60')],{})[_0x7660('0x23')](function(_0x278e51){var _0x543e2c=_0x21c74d['user'][_0x7660('0x3a')]({'plain':!![]});if(!_0x543e2c)throw new Error(_0x7660('0x61'));if(_0x543e2c[_0x7660('0x62')]===_0x7660('0x63')){var _0x2c745b=_0x278e51[_0x7660('0x3a')]({'plain':!![]});var _0x48cd75='SmsAccounts';return db[_0x7660('0x64')][_0x7660('0x65')]({'where':{'name':_0x48cd75,'userProfileId':_0x543e2c[_0x7660('0x66')]},'raw':!![]})[_0x7660('0x23')](function(_0x3aed6f){if(_0x3aed6f&&_0x3aed6f[_0x7660('0x67')]===0x0){return db[_0x7660('0x68')][_0x7660('0x5f')]({'name':_0x2c745b[_0x7660('0x3d')],'resourceId':_0x2c745b['id'],'type':_0x3aed6f['name'],'sectionId':_0x3aed6f['id']},{})[_0x7660('0x23')](function(){return _0x278e51;});}else{return _0x278e51;}})[_0x7660('0x5b')](function(_0x3cdba8){logger[_0x7660('0x29')](_0x7660('0x69'),_0x3cdba8);throw _0x3cdba8;});}return _0x278e51;})['then'](respondWithResult(_0x405052,0xc9))[_0x7660('0x5b')](handleError(_0x405052,null));};exports[_0x7660('0x38')]=function(_0x8bd246,_0x28177e){if(_0x8bd246[_0x7660('0x60')]['id']){delete _0x8bd246[_0x7660('0x60')]['id'];}return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0x8bd246['params']['id']},'include':[{'model':db[_0x7660('0x5d')],'as':_0x7660('0x3f')}]})[_0x7660('0x23')](handleEntityNotFound(_0x28177e,null))['then'](saveUpdates(_0x8bd246[_0x7660('0x60')],null))['then'](respondWithResult(_0x28177e,null))['catch'](handleError(_0x28177e,null));};exports[_0x7660('0x39')]=function(_0x43754a,_0x5163f0){return db[_0x7660('0x41')]['find']({'where':{'id':_0x43754a[_0x7660('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5163f0,null))[_0x7660('0x23')](removeEntity(_0x5163f0,null))[_0x7660('0x5b')](handleError(_0x5163f0,null));};exports['describe']=function(_0x4ecd58,_0x58035e){return db[_0x7660('0x41')]['describe']()['then'](respondWithResult(_0x58035e,null))[_0x7660('0x5b')](handleError(_0x58035e,null));};exports[_0x7660('0x6b')]=function(_0x53e3f9,_0x48ffd,_0x2c8aa3){if(_0x53e3f9[_0x7660('0x60')]['id']){delete _0x53e3f9[_0x7660('0x60')]['id'];}return db['SmsAccount'][_0x7660('0x65')]({'where':{'id':_0x53e3f9['params']['id']}})[_0x7660('0x23')](handleEntityNotFound(_0x48ffd,null))[_0x7660('0x23')](function(_0x4c3dec){if(_0x4c3dec){_0x53e3f9[_0x7660('0x60')][_0x7660('0x6c')]=_0x4c3dec['id'];return db['Disposition'][_0x7660('0x5f')](_0x53e3f9['body']);}})[_0x7660('0x23')](respondWithResult(_0x48ffd,null))[_0x7660('0x5b')](handleError(_0x48ffd,null));};exports[_0x7660('0x6d')]=function(_0x62ac4c,_0x420b75,_0x408699){var _0x729489={'raw':![],'where':{}};var _0x4fc4ca={};var _0x4962d4={'count':0x0,'rows':[]};return db[_0x7660('0x41')][_0x7660('0x6e')]({'where':{'id':_0x62ac4c['params']['id']}})[_0x7660('0x23')](handleEntityNotFound(_0x420b75,null))['then'](function(_0x5ec9d1){if(_0x5ec9d1){_0x4fc4ca[_0x7660('0x46')]=_[_0x7660('0x48')](db['Disposition'][_0x7660('0x42')]);_0x4fc4ca[_0x7660('0x47')]=_[_0x7660('0x48')](_0x62ac4c[_0x7660('0x47')]);_0x4fc4ca['filters']=_[_0x7660('0x4a')](_0x4fc4ca[_0x7660('0x46')],_0x4fc4ca[_0x7660('0x47')]);_0x729489[_0x7660('0x49')]=_['intersection'](_0x4fc4ca[_0x7660('0x46')],qs[_0x7660('0x4b')](_0x62ac4c[_0x7660('0x47')]['fields']));_0x729489['attributes']=_0x729489[_0x7660('0x49')][_0x7660('0x4c')]?_0x729489[_0x7660('0x49')]:_0x4fc4ca['model'];if(!_0x62ac4c['query'][_0x7660('0x4d')](_0x7660('0x4e'))){_0x729489[_0x7660('0x31')]=qs['limit'](_0x62ac4c[_0x7660('0x47')]['limit']);_0x729489[_0x7660('0x30')]=qs[_0x7660('0x30')](_0x62ac4c[_0x7660('0x47')][_0x7660('0x30')]);}_0x729489['order']=qs[_0x7660('0x50')](_0x62ac4c[_0x7660('0x47')]['sort']);_0x729489['where']=qs['filters'](_['pick'](_0x62ac4c[_0x7660('0x47')],_0x4fc4ca['filters']));_0x729489[_0x7660('0x55')][_0x7660('0x6c')]=_0x5ec9d1['id'];if(_0x62ac4c[_0x7660('0x47')][_0x7660('0x53')]){_0x729489[_0x7660('0x55')]=_['merge'](_0x729489[_0x7660('0x55')],{'$or':_[_0x7660('0x40')](_0x729489['attributes'],function(_0x5cb9b7){var _0x318e3a={};_0x318e3a[_0x5cb9b7]={'$like':'%'+_0x62ac4c[_0x7660('0x47')][_0x7660('0x53')]+'%'};return _0x318e3a;})});}_0x729489=_[_0x7660('0x54')]({},_0x729489,_0x62ac4c['options']);return db['Disposition'][_0x7660('0x33')]({'where':_0x729489[_0x7660('0x55')]})[_0x7660('0x23')](function(_0x4e5720){_0x4962d4['count']=_0x4e5720;if(_0x62ac4c[_0x7660('0x47')][_0x7660('0x58')]){_0x729489[_0x7660('0x5e')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x729489);})[_0x7660('0x23')](function(_0x162e52){_0x4962d4[_0x7660('0x5a')]=_0x162e52;return _0x4962d4;});}})[_0x7660('0x23')](respondWithFilteredResult(_0x420b75,_0x729489))[_0x7660('0x5b')](handleError(_0x420b75,null));};exports[_0x7660('0x6f')]=function(_0x1f0b5a,_0x4d5ec5,_0x54ddff){return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0x1f0b5a[_0x7660('0x6a')]['id']}})['then'](handleEntityNotFound(_0x4d5ec5,null))[_0x7660('0x23')](function(_0x4e5118){if(_0x4e5118){return _0x4e5118[_0x7660('0x6f')](_0x1f0b5a[_0x7660('0x47')][_0x7660('0x70')]);}})[_0x7660('0x23')](respondWithStatusCode(_0x4d5ec5,null))[_0x7660('0x5b')](handleError(_0x4d5ec5,null));};exports['addAnswer']=function(_0xc79525,_0x2f81ae,_0x4897e6){if(_0xc79525['body']['id']){delete _0xc79525[_0x7660('0x60')]['id'];}return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0xc79525['params']['id']}})[_0x7660('0x23')](handleEntityNotFound(_0x2f81ae,null))['then'](function(_0x488f38){if(_0x488f38){_0xc79525[_0x7660('0x60')][_0x7660('0x6c')]=_0x488f38['id'];return db['CannedAnswer'][_0x7660('0x5f')](_0xc79525[_0x7660('0x60')]);}})['then'](respondWithResult(_0x2f81ae,null))[_0x7660('0x5b')](handleError(_0x2f81ae,null));};exports[_0x7660('0x71')]=function(_0x56b7d1,_0x28db30,_0x336c52){var _0x4f4088={'raw':![],'where':{}};var _0x12d477={};var _0x336544={'count':0x0,'rows':[]};return db[_0x7660('0x41')][_0x7660('0x6e')]({'where':{'id':_0x56b7d1[_0x7660('0x6a')]['id']}})['then'](handleEntityNotFound(_0x28db30,null))[_0x7660('0x23')](function(_0x99c212){if(_0x99c212){_0x12d477[_0x7660('0x46')]=_[_0x7660('0x48')](db['CannedAnswer'][_0x7660('0x42')]);_0x12d477['query']=_['keys'](_0x56b7d1[_0x7660('0x47')]);_0x12d477[_0x7660('0x52')]=_[_0x7660('0x4a')](_0x12d477[_0x7660('0x46')],_0x12d477[_0x7660('0x47')]);_0x4f4088[_0x7660('0x49')]=_[_0x7660('0x4a')](_0x12d477[_0x7660('0x46')],qs[_0x7660('0x4b')](_0x56b7d1[_0x7660('0x47')][_0x7660('0x4b')]));_0x4f4088['attributes']=_0x4f4088[_0x7660('0x49')][_0x7660('0x4c')]?_0x4f4088['attributes']:_0x12d477[_0x7660('0x46')];if(!_0x56b7d1[_0x7660('0x47')]['hasOwnProperty'](_0x7660('0x4e'))){_0x4f4088[_0x7660('0x31')]=qs['limit'](_0x56b7d1[_0x7660('0x47')][_0x7660('0x31')]);_0x4f4088[_0x7660('0x30')]=qs[_0x7660('0x30')](_0x56b7d1[_0x7660('0x47')][_0x7660('0x30')]);}_0x4f4088[_0x7660('0x4f')]=qs[_0x7660('0x50')](_0x56b7d1[_0x7660('0x47')][_0x7660('0x50')]);_0x4f4088[_0x7660('0x55')]=qs['filters'](_[_0x7660('0x51')](_0x56b7d1[_0x7660('0x47')],_0x12d477[_0x7660('0x52')]));_0x4f4088[_0x7660('0x55')][_0x7660('0x6c')]=_0x99c212['id'];if(_0x56b7d1[_0x7660('0x47')][_0x7660('0x53')]){_0x4f4088[_0x7660('0x55')]=_[_0x7660('0x54')](_0x4f4088[_0x7660('0x55')],{'$or':_[_0x7660('0x40')](_0x4f4088[_0x7660('0x49')],function(_0x44a875){var _0x1f5796={};_0x1f5796[_0x44a875]={'$like':'%'+_0x56b7d1[_0x7660('0x47')][_0x7660('0x53')]+'%'};return _0x1f5796;})});}_0x4f4088=_[_0x7660('0x54')]({},_0x4f4088,_0x56b7d1['options']);return db[_0x7660('0x72')]['count']({'where':_0x4f4088['where']})[_0x7660('0x23')](function(_0x4f4054){_0x336544[_0x7660('0x33')]=_0x4f4054;if(_0x56b7d1[_0x7660('0x47')][_0x7660('0x58')]){_0x4f4088[_0x7660('0x5e')]=[{'all':!![]}];}return db[_0x7660('0x72')][_0x7660('0x59')](_0x4f4088);})[_0x7660('0x23')](function(_0x4d6337){_0x336544[_0x7660('0x5a')]=_0x4d6337;return _0x336544;});}})[_0x7660('0x23')](respondWithFilteredResult(_0x28db30,_0x4f4088))[_0x7660('0x5b')](handleError(_0x28db30,null));};exports[_0x7660('0x73')]=function(_0x433c2e,_0x55ab40,_0xa96226){return db[_0x7660('0x41')]['find']({'where':{'id':_0x433c2e[_0x7660('0x6a')]['id']}})[_0x7660('0x23')](handleEntityNotFound(_0x55ab40,null))[_0x7660('0x23')](function(_0x4c29d7){if(_0x4c29d7){return _0x4c29d7[_0x7660('0x73')](_0x433c2e[_0x7660('0x47')][_0x7660('0x70')]);}})[_0x7660('0x23')](respondWithStatusCode(_0x55ab40,null))[_0x7660('0x5b')](handleError(_0x55ab40,null));};exports['notify']=function(_0x385da4,_0x30ce59,_0x2e8cc0){var _0x4ccdfe={'channel':'sms'};var _0x25b623=[];var _0xc52c2d=[];var _0x31b069={};return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0x385da4[_0x7660('0x6a')]['id']},'include':[{'model':db[_0x7660('0x74')],'as':'Applications'}]})[_0x7660('0x23')](handleEntityNotFound(_0x30ce59,null))[_0x7660('0x23')](function(_0x3642cc){_0x4ccdfe['account']=_0x3642cc;_0x4ccdfe[_0x7660('0x75')]=_[_0x7660('0x76')](_0x3642cc['Applications'],[_0x7660('0x77')],['asc']);if(_0x4ccdfe['account']['Applications']){delete _0x4ccdfe[_0x7660('0x78')][_0x7660('0x79')];}return db[_0x7660('0x7a')]['describe']();})[_0x7660('0x23')](function(_0x541857){if(!_0x541857){throw new db[(_0x7660('0x7b'))][(_0x7660('0x7c'))](_0x7660('0x7d'));}_0x25b623=_[_0x7660('0x7e')](_[_0x7660('0x48')](_0x541857),[_0x7660('0x7f'),'updatedAt']);_0xc52c2d=_[_0x7660('0x7e')](_[_0x7660('0x48')](_0x541857),[_0x7660('0x7f'),_0x7660('0x80'),_0x7660('0x81'),'ListId']);_0x4ccdfe[_0x7660('0x60')]={'mapKey':_0x7660('0x82')};if(_0x4ccdfe['account'][_0x7660('0x44')]){switch(_0x4ccdfe[_0x7660('0x78')][_0x7660('0x44')]){case _0x7660('0x83'):_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')]=_0x385da4[_0x7660('0x60')][_0x7660('0x85')];_0x4ccdfe[_0x7660('0x60')]['body']=_0x385da4[_0x7660('0x60')][_0x7660('0x86')];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x87')]=_0x385da4[_0x7660('0x60')][_0x7660('0x88')];break;case _0x7660('0x89'):_0x4ccdfe[_0x7660('0x60')]['from']='+'+_0x385da4['body'][_0x7660('0x8a')];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x60')]=_0x385da4[_0x7660('0x60')]['text'];break;case _0x7660('0x8b'):_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')]=_0x385da4[_0x7660('0x60')]['from'];_0x4ccdfe['body']['body']=_0x385da4['body'][_0x7660('0x2a')];break;case _0x7660('0x8c'):_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')]=_0x385da4[_0x7660('0x60')][_0x7660('0x84')];_0x4ccdfe['body'][_0x7660('0x60')]=_0x385da4[_0x7660('0x60')]['body'];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x87')]=_0x385da4['body'][_0x7660('0x8d')];break;case _0x7660('0x8e'):_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')]=_0x385da4[_0x7660('0x60')][_0x7660('0x85')];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x60')]=_0x385da4[_0x7660('0x60')][_0x7660('0x8f')];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x87')]=_0x385da4[_0x7660('0x60')]['MessageUUID'];break;case'infobip':_0x4ccdfe[_0x7660('0x60')]['from']='+'+_0x385da4['body']['results'][0x0][_0x7660('0x84')];_0x4ccdfe['body'][_0x7660('0x60')]=_0x385da4['body']['results'][0x0]['text'];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x87')]=_0x385da4['body'][_0x7660('0x90')][0x0][_0x7660('0x87')];break;case'csc':_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')]=_0x385da4[_0x7660('0x60')]['originatingAddress'];_0x4ccdfe['body'][_0x7660('0x60')]=_0x385da4['body'][_0x7660('0x91')][_0x7660('0x2a')];break;case _0x7660('0x92'):_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')]=_0x385da4[_0x7660('0x60')][_0x7660('0x93')];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x60')]=_0x385da4[_0x7660('0x60')][_0x7660('0x94')];_0x4ccdfe[_0x7660('0x60')]['messageId']=_0x385da4[_0x7660('0x60')][_0x7660('0x95')];break;case _0x7660('0x96'):_0x4ccdfe[_0x7660('0x60')][_0x7660('0x87')]=_0x385da4[_0x7660('0x60')][0x0][_0x7660('0x2a')]['id'];_0x4ccdfe[_0x7660('0x60')]['from']=_0x385da4['body'][0x0][_0x7660('0x2a')][_0x7660('0x84')];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x60')]=_0x385da4['body'][0x0][_0x7660('0x2a')][_0x7660('0x94')];break;case _0x7660('0x97'):_0x4ccdfe['body'][_0x7660('0x84')]=_0x385da4['body']['from'];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x60')]=_0x385da4[_0x7660('0x60')]['message'];_0x4ccdfe[_0x7660('0x60')][_0x7660('0x87')]=_0x385da4[_0x7660('0x60')][_0x7660('0x98')];break;}}if(_0x4ccdfe['body']['id']){delete _0x4ccdfe[_0x7660('0x60')]['id'];}if(_['isNil'](_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')])){throw new db[(_0x7660('0x7b'))]['ValidationError'](_0x7660('0x99'));}if(_[_0x7660('0x9a')](_0x4ccdfe[_0x7660('0x60')][_0x7660('0x60')])||_0x4ccdfe[_0x7660('0x60')]['body']===''){throw new db[(_0x7660('0x7b'))]['ValidationError'](_0x7660('0x9b'));}if(_[_0x7660('0x9a')](_0x4ccdfe['body'][_0x7660('0x9c')])){throw new db[(_0x7660('0x7b'))][(_0x7660('0x7c'))](_0x7660('0x9d')+_0xc52c2d);}if(!_[_0x7660('0x9e')](_0xc52c2d,_0x4ccdfe[_0x7660('0x60')][_0x7660('0x9c')])){throw new db[(_0x7660('0x7b'))]['ValidationError'](_0x7660('0x9f')+_0xc52c2d);}_0x31b069[_0x4ccdfe[_0x7660('0x60')][_0x7660('0x9c')]]=_0x4ccdfe['body'][_0x7660('0x84')];return db[_0x7660('0xa0')][_0x7660('0x65')]({'where':{'id':_0x4ccdfe['account'][_0x7660('0xa1')]},'include':[{'model':db[_0x7660('0x7a')],'as':_0x7660('0xa2'),'where':_0x31b069,'limit':0x1,'order':[[_0x7660('0x80'),'DESC']]}]});})[_0x7660('0x23')](handleEntityNotFound(_0x30ce59,null))['then'](function(_0x25accb){if(_0x25accb){_0x4ccdfe['list']=_[_0x7660('0xa3')](_0x25accb,['Contacts']);if(_0x25accb[_0x7660('0xa2')][_0x7660('0x4c')]){return _0x25accb[_0x7660('0xa2')][0x0];}var _0x48a4f3=_[_0x7660('0xa4')](_0x4ccdfe['body'],{'firstName':_0x4ccdfe['body']['from'],'ListId':_0x25accb['id']});_0x48a4f3[_0x4ccdfe['body'][_0x7660('0x9c')]]=_0x4ccdfe['body']['from'];return db[_0x7660('0x7a')]['create'](_0x48a4f3,{'fields':_0x25b623,'raw':!![]});}})[_0x7660('0x23')](handleEntityNotFound(_0x30ce59,null))['then'](function(_0x15055f){if(_0x15055f){_0x4ccdfe[_0x7660('0xa5')]=_0x15055f;var _0x5a3a84={'ContactId':_0x15055f['id'],'phone':_0x4ccdfe[_0x7660('0x60')][_0x7660('0x84')],'SmsAccountId':_0x385da4[_0x7660('0x6a')]['id']};var _0x34ab53={'ContactId':_0x15055f['id'],'SmsAccountId':_0x385da4[_0x7660('0x6a')]['id'],'closed':![]};return db[_0x7660('0xa6')][_0x7660('0x65')]({'where':_0x34ab53})[_0x7660('0x23')](function(_0x53529c){if(_0x53529c){return[_0x53529c,![]];}return db[_0x7660('0xa6')][_0x7660('0x5f')](_0x5a3a84)[_0x7660('0x23')](function(_0x39aa3b){return[_0x39aa3b,!![]];});});}})['spread'](function(_0x3b701f,_0x5afbe6){_0x4ccdfe[_0x7660('0xa7')]=_0x3b701f[_0x7660('0x3a')]({'plain':!![]});_0x4ccdfe[_0x7660('0xa7')]['created']=![];if(_0x5afbe6){if(_0x4ccdfe[_0x7660('0x78')]['autoclose']){_0x4ccdfe['applications'][_0x7660('0xa8')]({'id':0x0,'priority':_0x4ccdfe[_0x7660('0x75')][_0x7660('0x4c')]+0x1,'app':_0x7660('0xa9'),'appdata':_0x7660('0xaa'),'interval':_0x7660('0xab')});}_0x4ccdfe[_0x7660('0xa7')]['created']=!![];}return db['SmsMessage'][_0x7660('0x5f')]({'phone':_0x4ccdfe[_0x7660('0x60')]['from'],'messageId':_0x4ccdfe['body'][_0x7660('0x87')],'body':_0x4ccdfe[_0x7660('0x60')][_0x7660('0x60')],'SmsAccountId':_0x385da4['params']['id'],'SmsInteractionId':_0x3b701f['id'],'direction':'in','ContactId':_0x3b701f[_0x7660('0xac')],'AttachmentId':_0x4ccdfe[_0x7660('0x60')][_0x7660('0xad')]});})[_0x7660('0x23')](function(_0x44130b){_0x4ccdfe['message']=_0x44130b;if(_0x4ccdfe[_0x7660('0xa7')]['UserId']){return db['User'][_0x7660('0x65')]({'attributes':['id',_0x7660('0x3d')],'where':{'id':_0x4ccdfe['interaction'][_0x7660('0xae')]}})['then'](function(_0x4d79bd){if(_0x4d79bd){_0x4ccdfe[_0x7660('0x75')][_0x7660('0xaf')]({'id':0x0,'priority':0x0,'app':_0x7660('0xb0'),'appdata':_0x4d79bd[_0x7660('0x3d')]+','+(_0x4ccdfe[_0x7660('0x78')][_0x7660('0xb1')]||0xa),'interval':_0x7660('0xab')});}return respondWithRpcPromise(_0x7660('0xb2'),'startRouting',_0x4ccdfe);});}return respondWithRpcPromise(_0x7660('0xb2'),_0x7660('0xb3'),_0x4ccdfe);})[_0x7660('0x23')](function(_0x25082e){if(_0x25082e){var _0xb381d2=0xc8;var _0x2d26e3='receiveMessage';logger[_0x7660('0x24')](_0x7660('0x28'),_0x2d26e3,_0xb381d2,_0x7660('0xb4'));logger['debug'](_0x7660('0xb5'),_0x2d26e3,_0xb381d2,_0x7660('0xb4'),JSON[_0x7660('0xb6')](_0x25082e));if(_0x4ccdfe[_0x7660('0x78')][_0x7660('0x44')]===_0x7660('0x83')){return _0x30ce59['status'](_0xb381d2)[_0x7660('0x34')](_0x7660('0xb7'),_0x7660('0xb8'))[_0x7660('0xb9')](_0x7660('0xba'));}else{return _0x30ce59[_0x7660('0x2d')](_0xb381d2)[_0x7660('0x2f')](_0x25082e);}}})[_0x7660('0x5b')](handleError(_0x30ce59,null));};exports[_0x7660('0xbb')]=function(_0x1e95c6,_0x48a2c2){var _0x51ee39=_0x1e95c6[_0x7660('0x6a')]['id'];var _0x2e4333=_0x1e95c6['body'];var _0x24b0af=0xc8;var _0x300fd8=null;return db[_0x7660('0xbc')][_0x7660('0xbd')]({'isolationLevel':db[_0x7660('0xbc')][_0x7660('0xbe')][_0x7660('0xbf')]['READ_COMMITTED']},function(_0x46790d){return db['SmsAccount'][_0x7660('0x6e')]({'where':{'id':_0x51ee39},'transaction':_0x46790d})[_0x7660('0x23')](function(_0x1b9b58){if(_0x1b9b58){return db[_0x7660('0x74')][_0x7660('0x39')]({'where':{'SmsAccountId':_0x51ee39},'transaction':_0x46790d})[_0x7660('0x23')](function(){var _0x5e1930=_['map'](_0x2e4333,function(_0x1f2ed6){_0x1f2ed6[_0x7660('0x6c')]=_0x51ee39;return _0x1f2ed6;});return db['SmsApplication'][_0x7660('0xc0')](_0x5e1930,{'transaction':_0x46790d});});}else{_0x24b0af=0x194;_0x300fd8=[];}});})['then'](function(){if(_0x24b0af!==0x194){return db['SmsApplication'][_0x7660('0xc1')]({'where':{'SmsAccountId':_0x51ee39},'order':_0x7660('0x77')})[_0x7660('0x23')](function(_0x586fd2){_0x300fd8=_0x586fd2;});}})['catch'](function(_0x485a91){_0x24b0af=0x1f4;logger[_0x7660('0x29')](_0x485a91[_0x7660('0x3c')]);if(_0x485a91['name']){delete _0x485a91[_0x7660('0x3d')];}_0x300fd8=_0x485a91;})[_0x7660('0xc2')](function(){if(_0x300fd8===null){_0x48a2c2['sendStatus'](_0x24b0af);}else{if(_0x24b0af===0x1f4){_0x48a2c2[_0x7660('0x2d')](_0x24b0af)[_0x7660('0xb9')](_0x300fd8);}else{_0x48a2c2['status'](_0x24b0af)['json'](_0x300fd8);}}});};exports[_0x7660('0xc3')]=function(_0x129b9e,_0x4b447d,_0x57ba97){var _0x5b1ef9={};var _0x17ca24={};var _0x26928d;var _0x42d0e3;return db[_0x7660('0x41')]['findOne']({'where':{'id':_0x129b9e['params']['id']}})[_0x7660('0x23')](handleEntityNotFound(_0x4b447d,null))[_0x7660('0x23')](function(_0xc18c07){if(_0xc18c07){_0x26928d=_0xc18c07;_0x17ca24[_0x7660('0x46')]=_[_0x7660('0x48')](db[_0x7660('0x74')][_0x7660('0x42')]);_0x17ca24[_0x7660('0x47')]=_[_0x7660('0x48')](_0x129b9e[_0x7660('0x47')]);_0x17ca24[_0x7660('0x52')]=_['intersection'](_0x17ca24[_0x7660('0x46')],_0x17ca24[_0x7660('0x47')]);_0x5b1ef9[_0x7660('0x49')]=_[_0x7660('0x4a')](_0x17ca24['model'],qs['fields'](_0x129b9e[_0x7660('0x47')][_0x7660('0x4b')]));_0x5b1ef9[_0x7660('0x49')]=_0x5b1ef9[_0x7660('0x49')][_0x7660('0x4c')]?_0x5b1ef9[_0x7660('0x49')]:_0x17ca24[_0x7660('0x46')];_0x5b1ef9[_0x7660('0x4f')]=qs[_0x7660('0x50')](_0x129b9e['query']['sort']);_0x5b1ef9[_0x7660('0x55')]=qs[_0x7660('0x52')](_[_0x7660('0x51')](_0x129b9e[_0x7660('0x47')],_0x17ca24[_0x7660('0x52')]));if(_0x129b9e['query'][_0x7660('0x53')]){_0x5b1ef9[_0x7660('0x55')]=_[_0x7660('0x54')](_0x5b1ef9[_0x7660('0x55')],{'$or':_[_0x7660('0x40')](_0x5b1ef9[_0x7660('0x49')],function(_0x3196a1){var _0x44790b={};_0x44790b[_0x3196a1]={'$like':'%'+_0x129b9e[_0x7660('0x47')][_0x7660('0x53')]+'%'};return _0x44790b;})});}_0x5b1ef9=_[_0x7660('0x54')]({},_0x5b1ef9,_0x129b9e[_0x7660('0x57')]);return _0x26928d['getApplications'](_0x5b1ef9);}})[_0x7660('0x23')](function(_0x3e203b){if(_0x3e203b){_0x42d0e3=_0x3e203b[_0x7660('0x4c')];if(!_0x129b9e[_0x7660('0x47')][_0x7660('0x4d')](_0x7660('0x4e'))){_0x5b1ef9['limit']=qs[_0x7660('0x31')](_0x129b9e['query'][_0x7660('0x31')]);_0x5b1ef9[_0x7660('0x30')]=qs[_0x7660('0x30')](_0x129b9e['query'][_0x7660('0x30')]);}return _0x26928d['getApplications'](_0x5b1ef9);}})[_0x7660('0x23')](function(_0xbdd5ce){if(_0xbdd5ce){return _0xbdd5ce?{'count':_0x42d0e3,'rows':_0xbdd5ce}:null;}})[_0x7660('0x23')](respondWithResult(_0x4b447d,null))['catch'](handleError(_0x4b447d,null));};exports[_0x7660('0xc4')]=function(_0x4f0263,_0x14b4f5,_0x126424){var _0x514ee2={'raw':![],'where':{}};var _0x66cc95={};var _0xc17959={'count':0x0,'rows':[]};return db[_0x7660('0x41')][_0x7660('0x6e')]({'where':{'id':_0x4f0263[_0x7660('0x6a')]['id']}})['then'](handleEntityNotFound(_0x14b4f5,null))[_0x7660('0x23')](function(_0x314071){if(_0x314071){_0x66cc95[_0x7660('0x46')]=_[_0x7660('0x48')](db[_0x7660('0xa6')]['rawAttributes']);_0x66cc95['query']=_['keys'](_0x4f0263['query']);_0x66cc95[_0x7660('0x52')]=_[_0x7660('0x4a')](_0x66cc95[_0x7660('0x46')],_0x66cc95['query']);_0x514ee2[_0x7660('0x49')]=_[_0x7660('0x4a')](_0x66cc95[_0x7660('0x46')],qs['fields'](_0x4f0263[_0x7660('0x47')][_0x7660('0x4b')]));_0x514ee2[_0x7660('0x49')]=_0x514ee2[_0x7660('0x49')][_0x7660('0x4c')]?_0x514ee2['attributes']:_0x66cc95['model'];if(!_0x4f0263[_0x7660('0x47')][_0x7660('0x4d')]('nolimit')){_0x514ee2[_0x7660('0x31')]=qs[_0x7660('0x31')](_0x4f0263[_0x7660('0x47')][_0x7660('0x31')]);_0x514ee2[_0x7660('0x30')]=qs[_0x7660('0x30')](_0x4f0263[_0x7660('0x47')][_0x7660('0x30')]);}_0x514ee2[_0x7660('0x4f')]=qs[_0x7660('0x50')](_0x4f0263[_0x7660('0x47')][_0x7660('0x50')]);_0x514ee2[_0x7660('0x55')]=qs['filters'](_[_0x7660('0x51')](_0x4f0263['query'],_0x66cc95[_0x7660('0x52')]));_0x514ee2[_0x7660('0x55')][_0x7660('0x6c')]=_0x314071['id'];if(_0x4f0263[_0x7660('0x47')][_0x7660('0x53')]){_0x514ee2[_0x7660('0x55')]=_['merge'](_0x514ee2[_0x7660('0x55')],{'$or':_[_0x7660('0x40')](_0x514ee2[_0x7660('0x49')],function(_0x4e786a){var _0x37ab10={};_0x37ab10[_0x4e786a]={'$like':'%'+_0x4f0263[_0x7660('0x47')][_0x7660('0x53')]+'%'};return _0x37ab10;})});}_0x514ee2=_[_0x7660('0x54')]({},_0x514ee2,_0x4f0263[_0x7660('0x57')]);return db[_0x7660('0xa6')][_0x7660('0x33')]({'where':_0x514ee2[_0x7660('0x55')]})['then'](function(_0x122418){_0xc17959[_0x7660('0x33')]=_0x122418;if(_0x4f0263['query']['includeAll']){_0x514ee2[_0x7660('0x5e')]=[{'model':db[_0x7660('0x7a')],'as':_0x7660('0xc5'),'required':![]},{'model':db[_0x7660('0xc6')],'as':'Owner','attributes':[_0x7660('0x3d'),_0x7660('0xc7'),_0x7660('0xc8')],'required':![]},{'model':db[_0x7660('0xc9')],'as':_0x7660('0xca'),'attributes':['id','name',_0x7660('0xcb')],'where':_0x4f0263[_0x7660('0x47')][_0x7660('0xcc')]?{'id':_0x4f0263[_0x7660('0x47')]['tag']}:undefined,'required':_0x4f0263[_0x7660('0x47')][_0x7660('0xcc')]?!![]:![]}];}return db['SmsInteraction'][_0x7660('0x59')](_0x514ee2);})[_0x7660('0x23')](function(_0x4c5611){_0xc17959['rows']=_0x4c5611;return _0xc17959;});}})[_0x7660('0x23')](respondWithFilteredResult(_0x14b4f5,_0x514ee2))[_0x7660('0x5b')](handleError(_0x14b4f5,null));};exports[_0x7660('0xb9')]=function(_0x6c335e,_0x49cf1c,_0x4fdfee){var _0x3843f6,_0x4f8327,_0x472315;if(_['isNil'](_0x6c335e[_0x7660('0x60')]['body'])||_0x6c335e[_0x7660('0x60')][_0x7660('0x60')]===''){throw new db['Sequelize'][(_0x7660('0x7c'))](_0x7660('0x9b'));}if(_['isNil'](_0x6c335e[_0x7660('0x60')]['to'])){throw new db[(_0x7660('0x7b'))]['ValidationError'](_0x7660('0xcd'));}_0x3843f6=_0x6c335e[_0x7660('0x60')]['to'];return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0x6c335e['params']['id']},'include':[{'model':db[_0x7660('0xa0')],'as':'List','include':[{'model':db[_0x7660('0x7a')],'as':_0x7660('0xa2'),'where':{'mobile':_0x3843f6},'limit':0x1,'order':[[_0x7660('0x80'),'DESC']]}]}]})[_0x7660('0x23')](handleEntityNotFound(_0x49cf1c,null))['then'](function(_0x15bfc3){if(_0x15bfc3&&_0x15bfc3[_0x7660('0xce')]){_0x4f8327=_0x15bfc3[_0x7660('0x3a')]({'plain':!![]});if(_0x4f8327[_0x7660('0xce')]&&_0x4f8327[_0x7660('0xce')][_0x7660('0xa2')][_0x7660('0x4c')]){return _0x4f8327[_0x7660('0xce')][_0x7660('0xa2')][0x0];}return db[_0x7660('0x7a')][_0x7660('0x5f')](_[_0x7660('0xa4')](_0x6c335e[_0x7660('0x60')],{'firstName':_0x3843f6,'mobile':_0x3843f6,'phone':_0x3843f6,'ListId':_0x4f8327['ListId']}));}})[_0x7660('0x23')](handleEntityNotFound(_0x49cf1c,null))[_0x7660('0x23')](function(_0x59e6a0){if(_0x59e6a0){_0x472315=_0x59e6a0;return db[_0x7660('0xa6')][_0x7660('0x65')]({'where':{'ContactId':_0x472315['id'],'closed':![],'SmsAccountId':_0x4f8327['id']}})[_0x7660('0x23')](function(_0xb6f01a){if(_0xb6f01a){return[_0xb6f01a,![]];}return db['SmsInteraction'][_0x7660('0x5f')]({'UserId':_0x6c335e['user']['id'],'ContactId':_0x472315['id'],'SmsAccountId':_0x4f8327['id'],'phone':_0x3843f6,'firstMsgDirection':'out','Messages':[_[_0x7660('0x54')](_0x6c335e[_0x7660('0x60')],{'read':![],'body':_0x6c335e[_0x7660('0x60')][_0x7660('0x60')],'phone':_0x3843f6,'SmsAccountId':_0x4f8327['id'],'UserId':_0x6c335e[_0x7660('0x63')]['id'],'ContactId':_0x472315['id']})]},{'include':[{'model':db[_0x7660('0xcf')],'as':_0x7660('0xd0')}]})['then'](function(_0x1cabee){return[_0x1cabee,!![]];});});}})[_0x7660('0xd1')](function(_0x1e793d,_0x2df405){if(_0x2df405){return _0x1e793d;}return db[_0x7660('0xcf')][_0x7660('0x5f')](_[_0x7660('0x54')](_0x6c335e[_0x7660('0x60')],{'read':![],'body':_0x6c335e['body']['body'],'phone':_0x3843f6,'SmsAccountId':_0x4f8327['id'],'SmsInteractionId':_0x1e793d['id'],'UserId':_0x6c335e['user']['id'],'ContactId':_0x472315['id']}))['then'](function(_0x311fba){_0x1e793d['dataValues'][_0x7660('0xd0')]=[];_0x1e793d[_0x7660('0xd2')][_0x7660('0xd0')][_0x7660('0xa8')](_0x311fba[_0x7660('0xd2')]);return _0x1e793d;});})[_0x7660('0x23')](respondWithResult(_0x49cf1c,null))[_0x7660('0x5b')](handleError(_0x49cf1c,null));};exports['status']=function(_0x49b5e8,_0x18b433,_0x3aef84){if(_0x49b5e8[_0x7660('0x60')]['id']){delete _0x49b5e8[_0x7660('0x60')]['id'];}var _0x5ea48e,_0x23a68e,_0x1ed4a5;return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0x49b5e8['params']['id']}})['then'](handleEntityNotFound(_0x18b433,null))[_0x7660('0x23')](function(_0x19eb4d){if(_0x19eb4d){_0x1ed4a5=_0x19eb4d;logger[_0x7660('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7660('0x2d'),_0x7660('0xd3'),_0x19eb4d[_0x7660('0x44')],util[_0x7660('0xd4')](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));switch(_0x19eb4d[_0x7660('0x44')]){case _0x7660('0x89'):if(_0x49b5e8['body']['skebby_dispatch_id']&&_0x49b5e8['body'][_0x7660('0x2d')]){_0x23a68e=_0x49b5e8[_0x7660('0x60')]['status'];return db['SmsMessage'][_0x7660('0x65')]({'where':{'messageId':_0x49b5e8[_0x7660('0x60')]['skebby_dispatch_id']}});}break;case _0x7660('0x8b'):if(_0x49b5e8[_0x7660('0x60')][_0x7660('0xd5')]&&_0x49b5e8[_0x7660('0x60')][_0x7660('0xd6')]){_0x23a68e=_0x49b5e8[_0x7660('0x60')]['statusInt'];return db[_0x7660('0xcf')][_0x7660('0x65')]({'where':{'messageId':_0x49b5e8[_0x7660('0x60')][_0x7660('0xd5')]}});}break;case _0x7660('0x8c'):if(_0x49b5e8[_0x7660('0x60')][_0x7660('0x8d')]&&_0x49b5e8['body']['status_code']){_0x23a68e=_0x49b5e8['body'][_0x7660('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x49b5e8[_0x7660('0x60')][_0x7660('0x8d')]}});}break;case _0x7660('0xd8'):var _0x171d44=_0x49b5e8['body'][_0x7660('0x90')][0x0];if(_0x171d44[_0x7660('0x87')]&&_0x171d44['status'][_0x7660('0xd9')]==='DELIVERED'){_0x23a68e=_0x171d44[_0x7660('0x2d')]['groupName'];return db[_0x7660('0xcf')][_0x7660('0x65')]({'where':{'messageId':_0x171d44[_0x7660('0x87')]}});}break;case _0x7660('0x92'):if(_0x49b5e8['body'][_0x7660('0x87')]&&_0x49b5e8[_0x7660('0x60')][_0x7660('0x2d')]){_0x23a68e=_0x49b5e8[_0x7660('0x60')][_0x7660('0x2d')];return db[_0x7660('0xcf')]['find']({'where':{'messageId':_0x49b5e8['body'][_0x7660('0x87')]}});}break;case _0x7660('0x96'):if(_0x49b5e8[_0x7660('0x60')][0x0]['message']['id']){_0x23a68e=_0x49b5e8[_0x7660('0x60')][0x0]['type'];return db[_0x7660('0xcf')][_0x7660('0x65')]({'where':{'messageId':_0x49b5e8[_0x7660('0x60')][0x0][_0x7660('0x2a')]['id']}});}break;case'intelepeer':if(_0x49b5e8['body'][_0x7660('0xda')]&&_0x49b5e8[_0x7660('0x60')][_0x7660('0x2d')]){_0x23a68e=_0x49b5e8[_0x7660('0x60')][_0x7660('0x2d')];return db[_0x7660('0xcf')][_0x7660('0x65')]({'where':{'messageId':_0x49b5e8[_0x7660('0x60')][_0x7660('0xda')]}});}break;}}})[_0x7660('0x23')](handleEntityNotFound(_0x18b433,null))[_0x7660('0x23')](function(_0x1596a9){if(_0x1596a9){_0x5ea48e=_0x1596a9;switch(_0x1ed4a5[_0x7660('0x44')]){case _0x7660('0x89'):if(_0x23a68e===_0x7660('0xdb')){return _0x5ea48e[_0x7660('0x38')]({'read':!![]});}else{logger[_0x7660('0x29')](_0x7660('0x28'),'status',_0x7660('0x89'),util[_0x7660('0xd4')](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));}break;case _0x7660('0x8b'):if(_0x23a68e==='1'){return _0x5ea48e[_0x7660('0x38')]({'read':!![]});}else{logger[_0x7660('0x29')](_0x7660('0x28'),'status',_0x7660('0x89'),util[_0x7660('0xd4')](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x49b5e8[_0x7660('0x60')]['error_code']&&_0x23a68e>=0xc8&&_0x23a68e<=0xce){return _0x5ea48e[_0x7660('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7660('0x2d'),_0x7660('0x8c'),util[_0x7660('0xd4')](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));}break;case _0x7660('0xd8'):var _0x38a0b4=_0x49b5e8[_0x7660('0x60')]['results'][0x0];if(_0x38a0b4['status'][_0x7660('0xd9')]===_0x7660('0xdb')){return _0x5ea48e[_0x7660('0x38')]({'read':!![]});}else{logger['error'](_0x7660('0x28'),'status','infobip',util['inspect'](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));}break;case _0x7660('0x92'):if(_0x23a68e==_0x7660('0xdc')||_0x23a68e=='RECEIVED_BY_RECIPIENT'){return _0x5ea48e[_0x7660('0x38')]({'read':!![]});}else{logger[_0x7660('0x29')](_0x7660('0x28'),_0x7660('0x2d'),_0x7660('0x92'),util[_0x7660('0xd4')](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));}break;case _0x7660('0x96'):if(_0x23a68e==_0x7660('0xdd')){return _0x5ea48e[_0x7660('0x38')]({'read':!![]});}else{logger[_0x7660('0x29')](_0x7660('0x28'),_0x7660('0x2d'),'bandwidth',util[_0x7660('0xd4')](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x23a68e===_0x7660('0xde')||_0x23a68e===_0x7660('0xdf')){return _0x5ea48e[_0x7660('0x38')]({'read':!![]});}else{logger[_0x7660('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7660('0x2d'),'intelepeer',util['inspect'](_0x49b5e8[_0x7660('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x5ea48e;}})[_0x7660('0x23')](respondWithResult(_0x18b433,null))[_0x7660('0x5b')](handleError(_0x18b433,null));};exports['statusGet']=function(_0x538f29,_0x44bfab,_0x242609){var _0x4e881a,_0x198cd4,_0x58e1c7;return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0x538f29[_0x7660('0x6a')]['id']}})[_0x7660('0x23')](handleEntityNotFound(_0x44bfab,null))['then'](function(_0x2d7735){if(_0x2d7735){_0x58e1c7=_0x2d7735;logger[_0x7660('0x27')](_0x7660('0x28'),_0x7660('0x2d'),'received\x20delivery\x20report\x20from',_0x2d7735[_0x7660('0x44')],util[_0x7660('0xd4')](_0x538f29['query'],{'showHidden':![],'depth':null}));switch(_0x2d7735['type']){case'csc':if(_0x538f29[_0x7660('0x47')]['message-id']&&_0x538f29[_0x7660('0x47')][_0x7660('0xe0')]){_0x198cd4=_0x538f29[_0x7660('0x47')][_0x7660('0xe0')];return db['SmsMessage']['find']({'where':{'messageId':_0x538f29['query'][_0x7660('0xe1')]}});}break;}}})[_0x7660('0x23')](handleEntityNotFound(_0x44bfab,null))[_0x7660('0x23')](function(_0x2027c0){if(_0x2027c0){_0x4e881a=_0x2027c0;switch(_0x58e1c7[_0x7660('0x44')]){case'csc':if(_0x198cd4==='2'||_0x198cd4==='6'){return _0x4e881a['update']({'read':!![]});}else{logger[_0x7660('0x29')](_0x7660('0x28'),_0x7660('0x2d'),'csc',util[_0x7660('0xd4')](_0x538f29[_0x7660('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x4e881a;}})[_0x7660('0x23')](respondWithResult(_0x44bfab,null))[_0x7660('0x5b')](handleError(_0x44bfab,null));};exports['addAgents']=function(_0x37a14f,_0xde02f3,_0x230ff0){return db[_0x7660('0x41')][_0x7660('0x65')]({'where':{'id':_0x37a14f[_0x7660('0x6a')]['id']}})[_0x7660('0x23')](handleEntityNotFound(_0xde02f3,null))[_0x7660('0x23')](function(_0x3ede82){if(_0x3ede82){return _0x3ede82['addAgents'](_0x37a14f[_0x7660('0x60')][_0x7660('0x70')],_[_0x7660('0xa3')](_0x37a14f[_0x7660('0x60')],[_0x7660('0x70'),'id'])||{})[_0x7660('0xd1')](function(_0x314352){for(var _0x485758=0x0;_0x485758<_0x37a14f[_0x7660('0x60')][_0x7660('0x70')][_0x7660('0x4c')];_0x485758+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x37a14f[_0x7660('0x60')][_0x7660('0x70')][_0x485758]),'SmsAccountId':Number(_0x37a14f[_0x7660('0x6a')]['id'])});}return _0x314352;});}})['then'](respondWithResult(_0xde02f3,null))['catch'](handleError(_0xde02f3,null));};exports[_0x7660('0xe2')]=function(_0x273a8d,_0x5e3f04,_0x3cc2fb){return db['SmsAccount'][_0x7660('0x65')]({'where':{'id':_0x273a8d[_0x7660('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5e3f04,null))[_0x7660('0x23')](function(_0x1a22a5){if(_0x1a22a5){return _0x1a22a5['removeAgents'](_0x273a8d['query'][_0x7660('0x70')])[_0x7660('0x23')](function(){if(_[_0x7660('0xe3')](_0x273a8d[_0x7660('0x47')][_0x7660('0x70')])){for(var _0x2f23ff=0x0;_0x2f23ff<_0x273a8d['query'][_0x7660('0x70')][_0x7660('0x4c')];_0x2f23ff+=0x1){socket['emit'](_0x7660('0xe4'),{'UserId':Number(_0x273a8d[_0x7660('0x47')][_0x7660('0x70')][_0x2f23ff]),'SmsAccountId':Number(_0x273a8d[_0x7660('0x6a')]['id'])});}}else{socket[_0x7660('0xe5')](_0x7660('0xe4'),{'UserId':Number(_0x273a8d[_0x7660('0x47')][_0x7660('0x70')]),'SmsAccountId':Number(_0x273a8d[_0x7660('0x6a')]['id'])});}});}})[_0x7660('0x23')](respondWithStatusCode(_0x5e3f04,null))[_0x7660('0x5b')](handleError(_0x5e3f04,null));};exports[_0x7660('0xe6')]=function(_0x3d0036,_0x2742d1,_0x1098ef){var _0x1b8101={};var _0x1d0eb1={};var _0x41ac1d;var _0x173222;return db[_0x7660('0x41')][_0x7660('0x6e')]({'where':{'id':_0x3d0036['params']['id']}})[_0x7660('0x23')](handleEntityNotFound(_0x2742d1,null))['then'](function(_0x49492c){if(_0x49492c){_0x41ac1d=_0x49492c;_0x1d0eb1[_0x7660('0x46')]=_[_0x7660('0x48')](db[_0x7660('0xc6')][_0x7660('0x42')]);_0x1d0eb1['query']=_[_0x7660('0x48')](_0x3d0036[_0x7660('0x47')]);_0x1d0eb1[_0x7660('0x52')]=_[_0x7660('0x4a')](_0x1d0eb1[_0x7660('0x46')],_0x1d0eb1['query']);_0x1b8101[_0x7660('0x49')]=_[_0x7660('0x4a')](_0x1d0eb1[_0x7660('0x46')],qs['fields'](_0x3d0036[_0x7660('0x47')][_0x7660('0x4b')]));_0x1b8101[_0x7660('0x49')]=_0x1b8101[_0x7660('0x49')]['length']?_0x1b8101[_0x7660('0x49')]:_0x1d0eb1[_0x7660('0x46')];_0x1b8101['order']=qs[_0x7660('0x50')](_0x3d0036[_0x7660('0x47')][_0x7660('0x50')]);_0x1b8101['where']=qs[_0x7660('0x52')](_[_0x7660('0x51')](_0x3d0036[_0x7660('0x47')],_0x1d0eb1['filters']));if(_0x3d0036['query'][_0x7660('0x53')]){_0x1b8101[_0x7660('0x55')]=_[_0x7660('0x54')](_0x1b8101[_0x7660('0x55')],{'$or':_[_0x7660('0x40')](_0x1b8101[_0x7660('0x49')],function(_0x52a282){var _0x25ca69={};_0x25ca69[_0x52a282]={'$like':'%'+_0x3d0036[_0x7660('0x47')]['filter']+'%'};return _0x25ca69;})});}_0x1b8101=_[_0x7660('0x54')]({},_0x1b8101,_0x3d0036['options']);return _0x41ac1d[_0x7660('0xe6')](_0x1b8101);}})[_0x7660('0x23')](function(_0x1da44c){if(_0x1da44c){_0x173222=_0x1da44c[_0x7660('0x4c')];if(!_0x3d0036[_0x7660('0x47')]['hasOwnProperty'](_0x7660('0x4e'))){_0x1b8101[_0x7660('0x31')]=qs[_0x7660('0x31')](_0x3d0036[_0x7660('0x47')][_0x7660('0x31')]);_0x1b8101[_0x7660('0x30')]=qs[_0x7660('0x30')](_0x3d0036['query']['offset']);}return _0x41ac1d[_0x7660('0xe6')](_0x1b8101);}})[_0x7660('0x23')](function(_0x5293d1){if(_0x5293d1){return _0x5293d1?{'count':_0x173222,'rows':_0x5293d1}:null;}})[_0x7660('0x23')](respondWithResult(_0x2742d1,null))[_0x7660('0x5b')](handleError(_0x2742d1,null));};
\ No newline at end of file
+var _0x525a=['Messages','dataValues','SmsMessage','skebby_dispatch_id','requestid','statusInt','status_code','groupName','clickatell','redif','DELIVERED','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','end','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','From','Body','skebby','from','sender','text','connectel','clicksend','messageId','message_id','plivo','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','replyMessageId','intelepeer','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','spread','interaction','autoclose','push','unmanaged','*,*,*,*','created','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','stack','getApplications','getInteractions','SmsInteraction','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','user'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x525a,0xff));var _0xa525=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0x525a[_0x4bfade];return _0x272465;};'use strict';var emlformat=require(_0xa525('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa525('0x1'));var jsonpatch=require(_0xa525('0x2'));var rp=require(_0xa525('0x3'));var moment=require('moment');var BPromise=require(_0xa525('0x4'));var Mustache=require(_0xa525('0x5'));var util=require('util');var path=require(_0xa525('0x6'));var sox=require(_0xa525('0x7'));var csv=require('to-csv');var ejs=require(_0xa525('0x8'));var fs=require('fs');var fs_extra=require(_0xa525('0x9'));var _=require(_0xa525('0xa'));var squel=require(_0xa525('0xb'));var crypto=require(_0xa525('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa525('0xd'));var toCsv=require(_0xa525('0xe'));var querystring=require(_0xa525('0xf'));var Papa=require('papaparse');var Redis=require(_0xa525('0x10'));var authService=require(_0xa525('0x11'));var qs=require(_0xa525('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa525('0x13'))(_0xa525('0x14'));var utils=require(_0xa525('0x15'));var config=require(_0xa525('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa525('0x17'))['db'];config['redis']=_[_0xa525('0x18')](config[_0xa525('0x19')],{'host':_0xa525('0x1a'),'port':0x18eb});var socket=require(_0xa525('0x1b'))(new Redis(config[_0xa525('0x19')]));require(_0xa525('0x1c'))['register'](socket);var jayson=require(_0xa525('0x1d'));var client=jayson[_0xa525('0x1e')][_0xa525('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xb9fe9,_0x39ac09,_0x58d6b1,_0x53f416){return new BPromise(function(_0x436ac1,_0x5bae21){var _0x3acdd8=_0x53f416||client;return _0x3acdd8[_0xa525('0x20')](_0xb9fe9,_0x58d6b1)['then'](function(_0x4fa7d4){logger[_0xa525('0x21')](_0xa525('0x22'),_0x39ac09,_0xa525('0x23'));logger[_0xa525('0x24')](_0xa525('0x25'),_0x39ac09,_0xa525('0x23'),JSON['stringify'](_0x4fa7d4));if(_0x4fa7d4['error']){if(_0x4fa7d4['error']['code']===0x1f4){logger[_0xa525('0x26')](_0xa525('0x22'),_0x39ac09,_0x4fa7d4[_0xa525('0x26')][_0xa525('0x27')]);return _0x5bae21(_0x4fa7d4[_0xa525('0x26')]['message']);}logger[_0xa525('0x26')](_0xa525('0x22'),_0x39ac09,_0x4fa7d4[_0xa525('0x26')][_0xa525('0x27')]);return _0x436ac1(_0x4fa7d4['error'][_0xa525('0x27')]);}else{logger[_0xa525('0x21')](_0xa525('0x22'),_0x39ac09,'request\x20sent');_0x436ac1(_0x4fa7d4[_0xa525('0x28')][_0xa525('0x27')]);}})[_0xa525('0x29')](function(_0x4518d7){logger['error']('SmsAccount,\x20%s,\x20%s',_0x39ac09,_0x4518d7);_0x5bae21(_0x4518d7);});});}function respondWithStatusCode(_0x4f25ef,_0x543a9a){_0x543a9a=_0x543a9a||0xcc;return function(_0xaa93b0){if(_0xaa93b0){return _0x4f25ef[_0xa525('0x2a')](_0x543a9a);}return _0x4f25ef['status'](_0x543a9a)['end']();};}function respondWithResult(_0x7ec96e,_0x198614){_0x198614=_0x198614||0xc8;return function(_0x28c85a){if(_0x28c85a){return _0x7ec96e['status'](_0x198614)[_0xa525('0x2b')](_0x28c85a);}};}function respondWithFilteredResult(_0x14ae9a,_0x3586c8){return function(_0x1c2402){if(_0x1c2402){var _0xf5c654=typeof _0x3586c8[_0xa525('0x2c')]===_0xa525('0x2d')&&typeof _0x3586c8[_0xa525('0x2e')]===_0xa525('0x2d');var _0x356259=_0x1c2402[_0xa525('0x2f')];var _0x5421f5=_0xf5c654?0x0:_0x3586c8[_0xa525('0x2c')];var _0x526b12=_0xf5c654?_0x1c2402[_0xa525('0x2f')]:_0x3586c8['offset']+_0x3586c8[_0xa525('0x2e')];var _0x502359;if(_0x526b12>=_0x356259){_0x526b12=_0x356259;_0x502359=0xc8;}else{_0x502359=0xce;}_0x14ae9a[_0xa525('0x30')](_0x502359);return _0x14ae9a[_0xa525('0x31')](_0xa525('0x32'),_0x5421f5+'-'+_0x526b12+'/'+_0x356259)[_0xa525('0x2b')](_0x1c2402);}return null;};}function patchUpdates(_0x4dd04a){return function(_0x138835){try{jsonpatch[_0xa525('0x33')](_0x138835,_0x4dd04a,!![]);}catch(_0x876880){return BPromise[_0xa525('0x34')](_0x876880);}return _0x138835[_0xa525('0x35')]();};}function saveUpdates(_0x30705d,_0x128cde){return function(_0x1c954c){if(_0x1c954c){return _0x1c954c[_0xa525('0x36')](_0x30705d)[_0xa525('0x37')](function(_0x2128ee){return _0x2128ee;});}return null;};}function removeEntity(_0x48fb29,_0xc2d033){return function(_0x5c5138){if(_0x5c5138){return _0x5c5138[_0xa525('0x38')]()[_0xa525('0x37')](function(){var _0x2c905e=_0x5c5138[_0xa525('0x39')]({'plain':!![]});var _0x235845=_0xa525('0x3a');return db[_0xa525('0x3b')][_0xa525('0x38')]({'where':{'type':_0x235845,'resourceId':_0x2c905e['id']}})[_0xa525('0x37')](function(){return _0x5c5138;});})['then'](function(){_0x48fb29[_0xa525('0x30')](0xcc)[_0xa525('0x3c')]();});}};}function handleEntityNotFound(_0x9f5a28,_0x276677){return function(_0x1ccf7c){if(!_0x1ccf7c){_0x9f5a28[_0xa525('0x2a')](0x194);}return _0x1ccf7c;};}function handleError(_0x22a229,_0x41fcc9){_0x41fcc9=_0x41fcc9||0x1f4;return function(_0x248b9b){logger[_0xa525('0x26')](_0x248b9b['stack']);if(_0x248b9b[_0xa525('0x3d')]){delete _0x248b9b[_0xa525('0x3d')];}_0x22a229[_0xa525('0x30')](_0x41fcc9)[_0xa525('0x3e')](_0x248b9b);};}exports['index']=function(_0x3dbf25,_0x26e5f0){var _0x4075eb={'include':[{'model':db[_0xa525('0x3f')],'as':_0xa525('0x40')}]},_0x2b0b75={},_0x1697ba={'count':0x0,'rows':[]};var _0x3a55de=_[_0xa525('0x41')](db[_0xa525('0x42')][_0xa525('0x43')],function(_0xac6aae){return{'name':_0xac6aae['fieldName'],'type':_0xac6aae['type']['key']};});_0x2b0b75[_0xa525('0x44')]=_[_0xa525('0x41')](_0x3a55de,_0xa525('0x3d'));_0x2b0b75['query']=_[_0xa525('0x45')](_0x3dbf25[_0xa525('0x46')]);_0x2b0b75[_0xa525('0x47')]=_[_0xa525('0x48')](_0x2b0b75[_0xa525('0x44')],_0x2b0b75[_0xa525('0x46')]);_0x4075eb[_0xa525('0x49')]=_['intersection'](_0x2b0b75['model'],qs[_0xa525('0x4a')](_0x3dbf25[_0xa525('0x46')][_0xa525('0x4a')]));_0x4075eb[_0xa525('0x49')]=_0x4075eb[_0xa525('0x49')][_0xa525('0x4b')]?_0x4075eb[_0xa525('0x49')]:_0x2b0b75[_0xa525('0x44')];if(!_0x3dbf25['query']['hasOwnProperty'](_0xa525('0x4c'))){_0x4075eb[_0xa525('0x2e')]=qs[_0xa525('0x2e')](_0x3dbf25['query']['limit']);_0x4075eb[_0xa525('0x2c')]=qs[_0xa525('0x2c')](_0x3dbf25[_0xa525('0x46')][_0xa525('0x2c')]);}_0x4075eb[_0xa525('0x4d')]=qs[_0xa525('0x4e')](_0x3dbf25[_0xa525('0x46')][_0xa525('0x4e')]);_0x4075eb[_0xa525('0x4f')]=qs[_0xa525('0x47')](_['pick'](_0x3dbf25['query'],_0x2b0b75[_0xa525('0x47')]),_0x3a55de);if(_0x3dbf25[_0xa525('0x46')][_0xa525('0x50')]){_0x4075eb['where']=_[_0xa525('0x51')](_0x4075eb['where'],{'$or':_[_0xa525('0x41')](_0x3a55de,function(_0x4887ea){if(_0x4887ea[_0xa525('0x52')]!==_0xa525('0x53')){var _0x456bff={};_0x456bff[_0x4887ea[_0xa525('0x3d')]]={'$like':'%'+_0x3dbf25[_0xa525('0x46')]['filter']+'%'};return _0x456bff;}})});}_0x4075eb=_[_0xa525('0x51')]({},_0x4075eb,_0x3dbf25['options']);var _0x2d08ee={'where':_0x4075eb['where']};return db[_0xa525('0x42')][_0xa525('0x2f')](_0x2d08ee)['then'](function(_0x2a4fdb){_0x1697ba[_0xa525('0x2f')]=_0x2a4fdb;if(_0x3dbf25['query'][_0xa525('0x54')]){_0x4075eb[_0xa525('0x55')]=[{'all':!![]}];}return db[_0xa525('0x42')][_0xa525('0x56')](_0x4075eb);})[_0xa525('0x37')](function(_0x557df5){_0x1697ba[_0xa525('0x57')]=_0x557df5;return _0x1697ba;})[_0xa525('0x37')](respondWithFilteredResult(_0x26e5f0,_0x4075eb))[_0xa525('0x29')](handleError(_0x26e5f0,null));};exports['show']=function(_0xb3a1f7,_0x24fd51){var _0x19bbb4={'raw':![],'where':{'id':_0xb3a1f7[_0xa525('0x58')]['id']},'include':[{'model':db[_0xa525('0x3f')],'as':_0xa525('0x40')}]},_0x4ae3e0={};_0x4ae3e0[_0xa525('0x44')]=_[_0xa525('0x45')](db[_0xa525('0x42')][_0xa525('0x43')]);_0x4ae3e0[_0xa525('0x46')]=_['keys'](_0xb3a1f7[_0xa525('0x46')]);_0x4ae3e0['filters']=_[_0xa525('0x48')](_0x4ae3e0[_0xa525('0x44')],_0x4ae3e0[_0xa525('0x46')]);_0x19bbb4[_0xa525('0x49')]=_[_0xa525('0x48')](_0x4ae3e0['model'],qs[_0xa525('0x4a')](_0xb3a1f7['query']['fields']));_0x19bbb4['attributes']=_0x19bbb4[_0xa525('0x49')][_0xa525('0x4b')]?_0x19bbb4['attributes']:_0x4ae3e0[_0xa525('0x44')];if(_0xb3a1f7[_0xa525('0x46')][_0xa525('0x54')]){_0x19bbb4['include']=[{'all':!![]}];}_0x19bbb4=_[_0xa525('0x51')]({},_0x19bbb4,_0xb3a1f7[_0xa525('0x59')]);return db['SmsAccount'][_0xa525('0x5a')](_0x19bbb4)[_0xa525('0x37')](handleEntityNotFound(_0x24fd51,null))[_0xa525('0x37')](respondWithResult(_0x24fd51,null))[_0xa525('0x29')](handleError(_0x24fd51,null));};exports['create']=function(_0x34421a,_0x331438){return db['SmsAccount'][_0xa525('0x5b')](_0x34421a[_0xa525('0x5c')],{})[_0xa525('0x37')](function(_0x932fd9){var _0x2dd78a=_0x34421a['user'][_0xa525('0x39')]({'plain':!![]});if(!_0x2dd78a)throw new Error(_0xa525('0x5d'));if(_0x2dd78a[_0xa525('0x5e')]==='user'){var _0x5827b1=_0x932fd9[_0xa525('0x39')]({'plain':!![]});var _0x5ca646=_0xa525('0x3a');return db[_0xa525('0x5f')]['find']({'where':{'name':_0x5ca646,'userProfileId':_0x2dd78a['userProfileId']},'raw':!![]})[_0xa525('0x37')](function(_0x5a27ae){if(_0x5a27ae&&_0x5a27ae[_0xa525('0x60')]===0x0){return db[_0xa525('0x3b')]['create']({'name':_0x5827b1['name'],'resourceId':_0x5827b1['id'],'type':_0x5a27ae[_0xa525('0x3d')],'sectionId':_0x5a27ae['id']},{})['then'](function(){return _0x932fd9;});}else{return _0x932fd9;}})['catch'](function(_0xcb2a23){logger[_0xa525('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcb2a23);throw _0xcb2a23;});}return _0x932fd9;})[_0xa525('0x37')](respondWithResult(_0x331438,0xc9))[_0xa525('0x29')](handleError(_0x331438,null));};exports['update']=function(_0x275087,_0x50157b){if(_0x275087[_0xa525('0x5c')]['id']){delete _0x275087['body']['id'];}return db[_0xa525('0x42')][_0xa525('0x5a')]({'where':{'id':_0x275087[_0xa525('0x58')]['id']},'include':[{'model':db[_0xa525('0x3f')],'as':_0xa525('0x40')}]})[_0xa525('0x37')](handleEntityNotFound(_0x50157b,null))['then'](saveUpdates(_0x275087[_0xa525('0x5c')],null))[_0xa525('0x37')](respondWithResult(_0x50157b,null))[_0xa525('0x29')](handleError(_0x50157b,null));};exports[_0xa525('0x38')]=function(_0x4789a6,_0x2a7cf1){return db[_0xa525('0x42')][_0xa525('0x5a')]({'where':{'id':_0x4789a6[_0xa525('0x58')]['id']}})['then'](handleEntityNotFound(_0x2a7cf1,null))['then'](removeEntity(_0x2a7cf1,null))[_0xa525('0x29')](handleError(_0x2a7cf1,null));};exports[_0xa525('0x61')]=function(_0x13e99d,_0x4da8cd){return db[_0xa525('0x42')][_0xa525('0x61')]()[_0xa525('0x37')](respondWithResult(_0x4da8cd,null))[_0xa525('0x29')](handleError(_0x4da8cd,null));};exports[_0xa525('0x62')]=function(_0x344abd,_0x243407,_0xd60fc8){if(_0x344abd[_0xa525('0x5c')]['id']){delete _0x344abd[_0xa525('0x5c')]['id'];}return db[_0xa525('0x42')][_0xa525('0x5a')]({'where':{'id':_0x344abd[_0xa525('0x58')]['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x243407,null))[_0xa525('0x37')](function(_0x5592e5){if(_0x5592e5){_0x344abd[_0xa525('0x5c')][_0xa525('0x63')]=_0x5592e5['id'];return db[_0xa525('0x64')][_0xa525('0x5b')](_0x344abd[_0xa525('0x5c')]);}})[_0xa525('0x37')](respondWithResult(_0x243407,null))[_0xa525('0x29')](handleError(_0x243407,null));};exports[_0xa525('0x65')]=function(_0x4c4dde,_0x550e14,_0x413de1){var _0x31c020={'raw':![],'where':{}};var _0x24a1a8={};var _0x3aae20={'count':0x0,'rows':[]};return db[_0xa525('0x42')][_0xa525('0x66')]({'where':{'id':_0x4c4dde[_0xa525('0x58')]['id']}})['then'](handleEntityNotFound(_0x550e14,null))[_0xa525('0x37')](function(_0x30886d){if(_0x30886d){_0x24a1a8[_0xa525('0x44')]=_[_0xa525('0x45')](db[_0xa525('0x64')][_0xa525('0x43')]);_0x24a1a8[_0xa525('0x46')]=_[_0xa525('0x45')](_0x4c4dde[_0xa525('0x46')]);_0x24a1a8[_0xa525('0x47')]=_[_0xa525('0x48')](_0x24a1a8['model'],_0x24a1a8[_0xa525('0x46')]);_0x31c020[_0xa525('0x49')]=_[_0xa525('0x48')](_0x24a1a8['model'],qs[_0xa525('0x4a')](_0x4c4dde[_0xa525('0x46')]['fields']));_0x31c020[_0xa525('0x49')]=_0x31c020['attributes']['length']?_0x31c020[_0xa525('0x49')]:_0x24a1a8['model'];if(!_0x4c4dde[_0xa525('0x46')][_0xa525('0x67')](_0xa525('0x4c'))){_0x31c020['limit']=qs['limit'](_0x4c4dde[_0xa525('0x46')][_0xa525('0x2e')]);_0x31c020[_0xa525('0x2c')]=qs[_0xa525('0x2c')](_0x4c4dde[_0xa525('0x46')][_0xa525('0x2c')]);}_0x31c020['order']=qs[_0xa525('0x4e')](_0x4c4dde[_0xa525('0x46')]['sort']);_0x31c020['where']=qs[_0xa525('0x47')](_[_0xa525('0x68')](_0x4c4dde[_0xa525('0x46')],_0x24a1a8[_0xa525('0x47')]));_0x31c020[_0xa525('0x4f')]['SmsAccountId']=_0x30886d['id'];if(_0x4c4dde[_0xa525('0x46')][_0xa525('0x50')]){_0x31c020[_0xa525('0x4f')]=_[_0xa525('0x51')](_0x31c020[_0xa525('0x4f')],{'$or':_[_0xa525('0x41')](_0x31c020[_0xa525('0x49')],function(_0x4f5b19){var _0x52795d={};_0x52795d[_0x4f5b19]={'$like':'%'+_0x4c4dde[_0xa525('0x46')][_0xa525('0x50')]+'%'};return _0x52795d;})});}_0x31c020=_[_0xa525('0x51')]({},_0x31c020,_0x4c4dde['options']);return db[_0xa525('0x64')][_0xa525('0x2f')]({'where':_0x31c020[_0xa525('0x4f')]})[_0xa525('0x37')](function(_0x45f45f){_0x3aae20[_0xa525('0x2f')]=_0x45f45f;if(_0x4c4dde[_0xa525('0x46')][_0xa525('0x54')]){_0x31c020[_0xa525('0x55')]=[{'all':!![]}];}return db[_0xa525('0x64')]['findAll'](_0x31c020);})[_0xa525('0x37')](function(_0x31c855){_0x3aae20['rows']=_0x31c855;return _0x3aae20;});}})[_0xa525('0x37')](respondWithFilteredResult(_0x550e14,_0x31c020))[_0xa525('0x29')](handleError(_0x550e14,null));};exports[_0xa525('0x69')]=function(_0x47e036,_0x33b1d4,_0x91336){return db[_0xa525('0x42')][_0xa525('0x5a')]({'where':{'id':_0x47e036[_0xa525('0x58')]['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x33b1d4,null))['then'](function(_0x2067c0){if(_0x2067c0){return _0x2067c0[_0xa525('0x69')](_0x47e036[_0xa525('0x46')][_0xa525('0x6a')]);}})[_0xa525('0x37')](respondWithStatusCode(_0x33b1d4,null))[_0xa525('0x29')](handleError(_0x33b1d4,null));};exports[_0xa525('0x6b')]=function(_0x2106aa,_0x3d8399,_0x530368){if(_0x2106aa['body']['id']){delete _0x2106aa[_0xa525('0x5c')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2106aa['params']['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x3d8399,null))[_0xa525('0x37')](function(_0x4eeb0e){if(_0x4eeb0e){_0x2106aa['body'][_0xa525('0x63')]=_0x4eeb0e['id'];return db[_0xa525('0x6c')][_0xa525('0x5b')](_0x2106aa[_0xa525('0x5c')]);}})[_0xa525('0x37')](respondWithResult(_0x3d8399,null))[_0xa525('0x29')](handleError(_0x3d8399,null));};exports[_0xa525('0x6d')]=function(_0x1c627b,_0x2f1ad6,_0x31b54e){var _0x4034a9={'raw':![],'where':{}};var _0x776a7f={};var _0x4344b7={'count':0x0,'rows':[]};return db[_0xa525('0x42')][_0xa525('0x66')]({'where':{'id':_0x1c627b[_0xa525('0x58')]['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x2f1ad6,null))[_0xa525('0x37')](function(_0x4b6282){if(_0x4b6282){_0x776a7f[_0xa525('0x44')]=_['keys'](db[_0xa525('0x6c')][_0xa525('0x43')]);_0x776a7f[_0xa525('0x46')]=_[_0xa525('0x45')](_0x1c627b[_0xa525('0x46')]);_0x776a7f[_0xa525('0x47')]=_[_0xa525('0x48')](_0x776a7f[_0xa525('0x44')],_0x776a7f['query']);_0x4034a9[_0xa525('0x49')]=_[_0xa525('0x48')](_0x776a7f[_0xa525('0x44')],qs['fields'](_0x1c627b[_0xa525('0x46')]['fields']));_0x4034a9[_0xa525('0x49')]=_0x4034a9[_0xa525('0x49')][_0xa525('0x4b')]?_0x4034a9[_0xa525('0x49')]:_0x776a7f[_0xa525('0x44')];if(!_0x1c627b['query'][_0xa525('0x67')](_0xa525('0x4c'))){_0x4034a9[_0xa525('0x2e')]=qs[_0xa525('0x2e')](_0x1c627b['query'][_0xa525('0x2e')]);_0x4034a9['offset']=qs['offset'](_0x1c627b[_0xa525('0x46')]['offset']);}_0x4034a9[_0xa525('0x4d')]=qs['sort'](_0x1c627b[_0xa525('0x46')]['sort']);_0x4034a9[_0xa525('0x4f')]=qs[_0xa525('0x47')](_[_0xa525('0x68')](_0x1c627b[_0xa525('0x46')],_0x776a7f[_0xa525('0x47')]));_0x4034a9[_0xa525('0x4f')][_0xa525('0x63')]=_0x4b6282['id'];if(_0x1c627b['query'][_0xa525('0x50')]){_0x4034a9[_0xa525('0x4f')]=_[_0xa525('0x51')](_0x4034a9[_0xa525('0x4f')],{'$or':_[_0xa525('0x41')](_0x4034a9[_0xa525('0x49')],function(_0x1b64cb){var _0x3f1811={};_0x3f1811[_0x1b64cb]={'$like':'%'+_0x1c627b[_0xa525('0x46')]['filter']+'%'};return _0x3f1811;})});}_0x4034a9=_[_0xa525('0x51')]({},_0x4034a9,_0x1c627b[_0xa525('0x59')]);return db[_0xa525('0x6c')][_0xa525('0x2f')]({'where':_0x4034a9[_0xa525('0x4f')]})[_0xa525('0x37')](function(_0x1d75a2){_0x4344b7['count']=_0x1d75a2;if(_0x1c627b[_0xa525('0x46')][_0xa525('0x54')]){_0x4034a9[_0xa525('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa525('0x56')](_0x4034a9);})[_0xa525('0x37')](function(_0x179a18){_0x4344b7[_0xa525('0x57')]=_0x179a18;return _0x4344b7;});}})[_0xa525('0x37')](respondWithFilteredResult(_0x2f1ad6,_0x4034a9))[_0xa525('0x29')](handleError(_0x2f1ad6,null));};exports['removeAnswers']=function(_0x5efbde,_0x58fa92,_0x29565f){return db['SmsAccount']['find']({'where':{'id':_0x5efbde[_0xa525('0x58')]['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x58fa92,null))[_0xa525('0x37')](function(_0x48abaf){if(_0x48abaf){return _0x48abaf[_0xa525('0x6e')](_0x5efbde['query']['ids']);}})[_0xa525('0x37')](respondWithStatusCode(_0x58fa92,null))['catch'](handleError(_0x58fa92,null));};exports[_0xa525('0x6f')]=function(_0x358981,_0xc3f1b2,_0x23d5a2){var _0x10197e={'channel':'sms'};var _0x4c44cc=[];var _0x26be13=[];var _0x58385b={};return db[_0xa525('0x42')]['find']({'where':{'id':_0x358981[_0xa525('0x58')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xa525('0x70')}]})[_0xa525('0x37')](handleEntityNotFound(_0xc3f1b2,null))[_0xa525('0x37')](function(_0x1e0f12){_0x10197e[_0xa525('0x71')]=_0x1e0f12;_0x10197e[_0xa525('0x72')]=_[_0xa525('0x73')](_0x1e0f12['Applications'],['priority'],[_0xa525('0x74')]);if(_0x10197e['account']['Applications']){delete _0x10197e[_0xa525('0x71')][_0xa525('0x70')];}return db[_0xa525('0x75')][_0xa525('0x61')]();})['then'](function(_0x556bdc){if(!_0x556bdc){throw new db[(_0xa525('0x76'))][(_0xa525('0x77'))](_0xa525('0x78'));}_0x4c44cc=_['difference'](_[_0xa525('0x45')](_0x556bdc),[_0xa525('0x79'),_0xa525('0x7a')]);_0x26be13=_[_0xa525('0x7b')](_[_0xa525('0x45')](_0x556bdc),[_0xa525('0x79'),_0xa525('0x7a'),_0xa525('0x7c'),_0xa525('0x7d')]);_0x10197e[_0xa525('0x5c')]={'mapKey':_0xa525('0x7e')};if(_0x10197e[_0xa525('0x71')][_0xa525('0x52')]){switch(_0x10197e['account']['type']){case _0xa525('0x7f'):_0x10197e[_0xa525('0x5c')]['from']=_0x358981['body'][_0xa525('0x80')];_0x10197e[_0xa525('0x5c')]['body']=_0x358981['body'][_0xa525('0x81')];_0x10197e[_0xa525('0x5c')]['messageId']=_0x358981['body']['MessageSid'];break;case _0xa525('0x82'):_0x10197e[_0xa525('0x5c')][_0xa525('0x83')]='+'+_0x358981[_0xa525('0x5c')][_0xa525('0x84')];_0x10197e[_0xa525('0x5c')][_0xa525('0x5c')]=_0x358981[_0xa525('0x5c')][_0xa525('0x85')];break;case _0xa525('0x86'):_0x10197e[_0xa525('0x5c')][_0xa525('0x83')]=_0x358981[_0xa525('0x5c')][_0xa525('0x83')];_0x10197e[_0xa525('0x5c')][_0xa525('0x5c')]=_0x358981['body']['message'];break;case _0xa525('0x87'):_0x10197e[_0xa525('0x5c')][_0xa525('0x83')]=_0x358981['body']['from'];_0x10197e['body'][_0xa525('0x5c')]=_0x358981[_0xa525('0x5c')]['body'];_0x10197e['body'][_0xa525('0x88')]=_0x358981['body'][_0xa525('0x89')];break;case _0xa525('0x8a'):_0x10197e['body'][_0xa525('0x83')]=_0x358981[_0xa525('0x5c')]['From'];_0x10197e[_0xa525('0x5c')][_0xa525('0x5c')]=_0x358981[_0xa525('0x5c')]['Text'];_0x10197e[_0xa525('0x5c')][_0xa525('0x88')]=_0x358981[_0xa525('0x5c')][_0xa525('0x8b')];break;case _0xa525('0x8c'):_0x10197e['body'][_0xa525('0x83')]='+'+_0x358981['body'][_0xa525('0x8d')][0x0][_0xa525('0x83')];_0x10197e[_0xa525('0x5c')][_0xa525('0x5c')]=_0x358981[_0xa525('0x5c')][_0xa525('0x8d')][0x0][_0xa525('0x85')];_0x10197e[_0xa525('0x5c')]['messageId']=_0x358981[_0xa525('0x5c')][_0xa525('0x8d')][0x0][_0xa525('0x88')];break;case _0xa525('0x8e'):_0x10197e[_0xa525('0x5c')][_0xa525('0x83')]=_0x358981['body']['originatingAddress'];_0x10197e['body'][_0xa525('0x5c')]=_0x358981[_0xa525('0x5c')][_0xa525('0x8f')][_0xa525('0x27')];break;case'clickatell':_0x10197e[_0xa525('0x5c')][_0xa525('0x83')]=_0x358981['body'][_0xa525('0x90')];_0x10197e[_0xa525('0x5c')]['body']=_0x358981['body'][_0xa525('0x85')];_0x10197e[_0xa525('0x5c')][_0xa525('0x88')]=_0x358981[_0xa525('0x5c')][_0xa525('0x91')];break;case'bandwidth':_0x10197e['body'][_0xa525('0x88')]=_0x358981[_0xa525('0x5c')][0x0]['message']['id'];_0x10197e[_0xa525('0x5c')]['from']=_0x358981[_0xa525('0x5c')][0x0][_0xa525('0x27')][_0xa525('0x83')];_0x10197e['body']['body']=_0x358981[_0xa525('0x5c')][0x0][_0xa525('0x27')][_0xa525('0x85')];break;case _0xa525('0x92'):_0x10197e[_0xa525('0x5c')][_0xa525('0x83')]=_0x358981[_0xa525('0x5c')][_0xa525('0x83')];_0x10197e['body'][_0xa525('0x5c')]=_0x358981[_0xa525('0x5c')][_0xa525('0x27')];_0x10197e[_0xa525('0x5c')][_0xa525('0x88')]=_0x358981[_0xa525('0x5c')]['refid'];break;}}if(_0x10197e[_0xa525('0x5c')]['id']){delete _0x10197e[_0xa525('0x5c')]['id'];}if(_[_0xa525('0x93')](_0x10197e['body'][_0xa525('0x83')])){throw new db[(_0xa525('0x76'))][(_0xa525('0x77'))](_0xa525('0x94'));}if(_['isNil'](_0x10197e[_0xa525('0x5c')][_0xa525('0x5c')])||_0x10197e[_0xa525('0x5c')]['body']===''){throw new db[(_0xa525('0x76'))][(_0xa525('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa525('0x93')](_0x10197e['body']['mapKey'])){throw new db[(_0xa525('0x76'))][(_0xa525('0x77'))](_0xa525('0x95')+_0x26be13);}if(!_[_0xa525('0x96')](_0x26be13,_0x10197e[_0xa525('0x5c')][_0xa525('0x97')])){throw new db[(_0xa525('0x76'))][(_0xa525('0x77'))](_0xa525('0x98')+_0x26be13);}_0x58385b[_0x10197e[_0xa525('0x5c')][_0xa525('0x97')]]=_0x10197e[_0xa525('0x5c')][_0xa525('0x83')];return db[_0xa525('0x99')][_0xa525('0x5a')]({'where':{'id':_0x10197e[_0xa525('0x71')][_0xa525('0x7d')]},'include':[{'model':db['CmContact'],'as':_0xa525('0x9a'),'where':_0x58385b,'limit':0x1,'order':[[_0xa525('0x7a'),'DESC']]}]});})['then'](handleEntityNotFound(_0xc3f1b2,null))[_0xa525('0x37')](function(_0x256ce3){if(_0x256ce3){_0x10197e[_0xa525('0x9b')]=_[_0xa525('0x9c')](_0x256ce3,['Contacts']);if(_0x256ce3[_0xa525('0x9a')]['length']){return _0x256ce3[_0xa525('0x9a')][0x0];}var _0x48228e=_[_0xa525('0x18')](_0x10197e[_0xa525('0x5c')],{'firstName':_0x10197e['body']['from'],'ListId':_0x256ce3['id']});_0x48228e[_0x10197e[_0xa525('0x5c')][_0xa525('0x97')]]=_0x10197e['body']['from'];return db[_0xa525('0x75')][_0xa525('0x5b')](_0x48228e,{'fields':_0x4c44cc,'raw':!![]});}})[_0xa525('0x37')](handleEntityNotFound(_0xc3f1b2,null))['then'](function(_0x366d69){if(_0x366d69){_0x10197e['contact']=_0x366d69;var _0x220f54={'ContactId':_0x366d69['id'],'phone':_0x10197e['body'][_0xa525('0x83')],'SmsAccountId':_0x358981[_0xa525('0x58')]['id']};var _0x126d2d={'ContactId':_0x366d69['id'],'SmsAccountId':_0x358981[_0xa525('0x58')]['id'],'closed':![]};return db['SmsInteraction'][_0xa525('0x5a')]({'where':_0x126d2d})[_0xa525('0x37')](function(_0x2e1577){if(_0x2e1577){return[_0x2e1577,![]];}return db['SmsInteraction'][_0xa525('0x5b')](_0x220f54)[_0xa525('0x37')](function(_0x33ad7c){return[_0x33ad7c,!![]];});});}})[_0xa525('0x9d')](function(_0x3783de,_0x5d152c){_0x10197e[_0xa525('0x9e')]=_0x3783de[_0xa525('0x39')]({'plain':!![]});_0x10197e[_0xa525('0x9e')]['created']=![];if(_0x5d152c){if(_0x10197e['account'][_0xa525('0x9f')]){_0x10197e[_0xa525('0x72')][_0xa525('0xa0')]({'id':0x0,'priority':_0x10197e[_0xa525('0x72')]['length']+0x1,'app':'close','appdata':_0xa525('0xa1'),'interval':_0xa525('0xa2')});}_0x10197e[_0xa525('0x9e')][_0xa525('0xa3')]=!![];}return db['SmsMessage'][_0xa525('0x5b')]({'phone':_0x10197e[_0xa525('0x5c')][_0xa525('0x83')],'messageId':_0x10197e[_0xa525('0x5c')][_0xa525('0x88')],'body':_0x10197e[_0xa525('0x5c')]['body'],'SmsAccountId':_0x358981['params']['id'],'SmsInteractionId':_0x3783de['id'],'direction':'in','ContactId':_0x3783de['ContactId'],'AttachmentId':_0x10197e['body'][_0xa525('0xa4')]});})[_0xa525('0x37')](function(_0x3157c0){_0x10197e[_0xa525('0x27')]=_0x3157c0;if(_0x10197e[_0xa525('0x9e')]['UserId']){return db['User']['find']({'attributes':['id',_0xa525('0x3d')],'where':{'id':_0x10197e['interaction'][_0xa525('0xa5')]}})['then'](function(_0x563ba0){if(_0x563ba0){_0x10197e[_0xa525('0x72')][_0xa525('0xa6')]({'id':0x0,'priority':0x0,'app':_0xa525('0xa7'),'appdata':_0x563ba0['name']+','+(_0x10197e['account'][_0xa525('0xa8')]||0xa),'interval':_0xa525('0xa2')});}return respondWithRpcPromise(_0xa525('0xa9'),_0xa525('0xaa'),_0x10197e);});}return respondWithRpcPromise(_0xa525('0xa9'),_0xa525('0xaa'),_0x10197e);})[_0xa525('0x37')](function(_0x175a8f){if(_0x175a8f){var _0x1b02e4=0xc8;var _0x451105=_0xa525('0xab');logger[_0xa525('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x451105,_0x1b02e4,_0xa525('0xac'));logger['debug'](_0xa525('0xad'),_0x451105,_0x1b02e4,_0xa525('0xac'),JSON['stringify'](_0x175a8f));if(_0x10197e[_0xa525('0x71')]['type']===_0xa525('0x7f')){return _0xc3f1b2[_0xa525('0x30')](_0x1b02e4)['set'](_0xa525('0xae'),_0xa525('0xaf'))['send'](_0xa525('0xb0'));}else{return _0xc3f1b2[_0xa525('0x30')](_0x1b02e4)[_0xa525('0x2b')](_0x175a8f);}}})[_0xa525('0x29')](handleError(_0xc3f1b2,null));};exports['addApplications']=function(_0x1c2eef,_0x54b8ff){var _0x2376a2=_0x1c2eef[_0xa525('0x58')]['id'];var _0x191d23=_0x1c2eef[_0xa525('0x5c')];var _0x38caec=0xc8;var _0x27ec0d=null;return db[_0xa525('0xb1')][_0xa525('0xb2')]({'isolationLevel':db[_0xa525('0xb1')][_0xa525('0xb3')]['ISOLATION_LEVELS'][_0xa525('0xb4')]},function(_0x1216da){return db[_0xa525('0x42')][_0xa525('0x66')]({'where':{'id':_0x2376a2},'transaction':_0x1216da})['then'](function(_0x3d2b3a){if(_0x3d2b3a){return db[_0xa525('0xb5')]['destroy']({'where':{'SmsAccountId':_0x2376a2},'transaction':_0x1216da})[_0xa525('0x37')](function(){var _0x54b44a=_['map'](_0x191d23,function(_0xc13698){_0xc13698[_0xa525('0x63')]=_0x2376a2;return _0xc13698;});return db['SmsApplication'][_0xa525('0xb6')](_0x54b44a,{'transaction':_0x1216da});});}else{_0x38caec=0x194;_0x27ec0d=[];}});})[_0xa525('0x37')](function(){if(_0x38caec!==0x194){return db[_0xa525('0xb5')]['findAndCountAll']({'where':{'SmsAccountId':_0x2376a2},'order':'priority'})[_0xa525('0x37')](function(_0x4452b1){_0x27ec0d=_0x4452b1;});}})[_0xa525('0x29')](function(_0x64f126){_0x38caec=0x1f4;logger[_0xa525('0x26')](_0x64f126[_0xa525('0xb7')]);if(_0x64f126['name']){delete _0x64f126[_0xa525('0x3d')];}_0x27ec0d=_0x64f126;})['finally'](function(){if(_0x27ec0d===null){_0x54b8ff[_0xa525('0x2a')](_0x38caec);}else{if(_0x38caec===0x1f4){_0x54b8ff[_0xa525('0x30')](_0x38caec)[_0xa525('0x3e')](_0x27ec0d);}else{_0x54b8ff['status'](_0x38caec)[_0xa525('0x2b')](_0x27ec0d);}}});};exports[_0xa525('0xb8')]=function(_0x384fab,_0x354cf8,_0x5d5dc0){var _0x431387={};var _0x2cee78={};var _0x23aab7;var _0x7a9e95;return db['SmsAccount'][_0xa525('0x66')]({'where':{'id':_0x384fab[_0xa525('0x58')]['id']}})['then'](handleEntityNotFound(_0x354cf8,null))[_0xa525('0x37')](function(_0x3b37c3){if(_0x3b37c3){_0x23aab7=_0x3b37c3;_0x2cee78[_0xa525('0x44')]=_['keys'](db['SmsApplication'][_0xa525('0x43')]);_0x2cee78[_0xa525('0x46')]=_[_0xa525('0x45')](_0x384fab['query']);_0x2cee78[_0xa525('0x47')]=_[_0xa525('0x48')](_0x2cee78[_0xa525('0x44')],_0x2cee78[_0xa525('0x46')]);_0x431387[_0xa525('0x49')]=_[_0xa525('0x48')](_0x2cee78[_0xa525('0x44')],qs[_0xa525('0x4a')](_0x384fab[_0xa525('0x46')][_0xa525('0x4a')]));_0x431387[_0xa525('0x49')]=_0x431387[_0xa525('0x49')]['length']?_0x431387[_0xa525('0x49')]:_0x2cee78[_0xa525('0x44')];_0x431387[_0xa525('0x4d')]=qs[_0xa525('0x4e')](_0x384fab[_0xa525('0x46')]['sort']);_0x431387['where']=qs['filters'](_[_0xa525('0x68')](_0x384fab[_0xa525('0x46')],_0x2cee78[_0xa525('0x47')]));if(_0x384fab[_0xa525('0x46')]['filter']){_0x431387['where']=_['merge'](_0x431387[_0xa525('0x4f')],{'$or':_['map'](_0x431387[_0xa525('0x49')],function(_0x19b6be){var _0x3d4801={};_0x3d4801[_0x19b6be]={'$like':'%'+_0x384fab[_0xa525('0x46')]['filter']+'%'};return _0x3d4801;})});}_0x431387=_[_0xa525('0x51')]({},_0x431387,_0x384fab[_0xa525('0x59')]);return _0x23aab7[_0xa525('0xb8')](_0x431387);}})[_0xa525('0x37')](function(_0x1ed389){if(_0x1ed389){_0x7a9e95=_0x1ed389['length'];if(!_0x384fab[_0xa525('0x46')][_0xa525('0x67')](_0xa525('0x4c'))){_0x431387[_0xa525('0x2e')]=qs[_0xa525('0x2e')](_0x384fab[_0xa525('0x46')][_0xa525('0x2e')]);_0x431387[_0xa525('0x2c')]=qs[_0xa525('0x2c')](_0x384fab[_0xa525('0x46')]['offset']);}return _0x23aab7[_0xa525('0xb8')](_0x431387);}})[_0xa525('0x37')](function(_0x4db345){if(_0x4db345){return _0x4db345?{'count':_0x7a9e95,'rows':_0x4db345}:null;}})['then'](respondWithResult(_0x354cf8,null))[_0xa525('0x29')](handleError(_0x354cf8,null));};exports[_0xa525('0xb9')]=function(_0x4a41fa,_0x3c2b63,_0x5b0304){var _0x187ef9={'raw':![],'where':{}};var _0x221944={};var _0x1ee9da={'count':0x0,'rows':[]};return db[_0xa525('0x42')][_0xa525('0x66')]({'where':{'id':_0x4a41fa[_0xa525('0x58')]['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x3c2b63,null))[_0xa525('0x37')](function(_0x44adf4){if(_0x44adf4){_0x221944[_0xa525('0x44')]=_[_0xa525('0x45')](db['SmsInteraction']['rawAttributes']);_0x221944[_0xa525('0x46')]=_['keys'](_0x4a41fa[_0xa525('0x46')]);_0x221944[_0xa525('0x47')]=_['intersection'](_0x221944[_0xa525('0x44')],_0x221944[_0xa525('0x46')]);_0x187ef9['attributes']=_[_0xa525('0x48')](_0x221944[_0xa525('0x44')],qs[_0xa525('0x4a')](_0x4a41fa[_0xa525('0x46')][_0xa525('0x4a')]));_0x187ef9['attributes']=_0x187ef9[_0xa525('0x49')][_0xa525('0x4b')]?_0x187ef9[_0xa525('0x49')]:_0x221944[_0xa525('0x44')];if(!_0x4a41fa['query'][_0xa525('0x67')](_0xa525('0x4c'))){_0x187ef9[_0xa525('0x2e')]=qs[_0xa525('0x2e')](_0x4a41fa[_0xa525('0x46')][_0xa525('0x2e')]);_0x187ef9['offset']=qs[_0xa525('0x2c')](_0x4a41fa[_0xa525('0x46')][_0xa525('0x2c')]);}_0x187ef9[_0xa525('0x4d')]=qs['sort'](_0x4a41fa[_0xa525('0x46')][_0xa525('0x4e')]);_0x187ef9[_0xa525('0x4f')]=qs['filters'](_[_0xa525('0x68')](_0x4a41fa[_0xa525('0x46')],_0x221944[_0xa525('0x47')]));_0x187ef9[_0xa525('0x4f')][_0xa525('0x63')]=_0x44adf4['id'];if(_0x4a41fa[_0xa525('0x46')][_0xa525('0x50')]){_0x187ef9[_0xa525('0x4f')]=_['merge'](_0x187ef9[_0xa525('0x4f')],{'$or':_[_0xa525('0x41')](_0x187ef9[_0xa525('0x49')],function(_0x5df049){var _0x558ad2={};_0x558ad2[_0x5df049]={'$like':'%'+_0x4a41fa[_0xa525('0x46')][_0xa525('0x50')]+'%'};return _0x558ad2;})});}_0x187ef9=_[_0xa525('0x51')]({},_0x187ef9,_0x4a41fa[_0xa525('0x59')]);return db[_0xa525('0xba')]['count']({'where':_0x187ef9[_0xa525('0x4f')]})[_0xa525('0x37')](function(_0x5330c5){_0x1ee9da[_0xa525('0x2f')]=_0x5330c5;if(_0x4a41fa['query']['includeAll']){_0x187ef9[_0xa525('0x55')]=[{'model':db[_0xa525('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xa525('0x3d'),'fullname',_0xa525('0xbb')],'required':![]},{'model':db[_0xa525('0xbc')],'as':_0xa525('0xbd'),'attributes':['id',_0xa525('0x3d'),_0xa525('0xbe')],'where':_0x4a41fa[_0xa525('0x46')][_0xa525('0xbf')]?{'id':_0x4a41fa[_0xa525('0x46')][_0xa525('0xbf')]}:undefined,'required':_0x4a41fa[_0xa525('0x46')][_0xa525('0xbf')]?!![]:![]}];}return db[_0xa525('0xba')]['findAll'](_0x187ef9);})[_0xa525('0x37')](function(_0x55b245){_0x1ee9da['rows']=_0x55b245;return _0x1ee9da;});}})[_0xa525('0x37')](respondWithFilteredResult(_0x3c2b63,_0x187ef9))[_0xa525('0x29')](handleError(_0x3c2b63,null));};exports[_0xa525('0x3e')]=function(_0x780c9a,_0x32a680,_0x44cce6){var _0x1be80c,_0x5c3e94,_0x312c54;if(_[_0xa525('0x93')](_0x780c9a[_0xa525('0x5c')][_0xa525('0x5c')])||_0x780c9a[_0xa525('0x5c')][_0xa525('0x5c')]===''){throw new db[(_0xa525('0x76'))]['ValidationError'](_0xa525('0xc0'));}if(_[_0xa525('0x93')](_0x780c9a[_0xa525('0x5c')]['to'])){throw new db[(_0xa525('0x76'))][(_0xa525('0x77'))](_0xa525('0xc1'));}_0x1be80c=_0x780c9a[_0xa525('0x5c')]['to'];return db[_0xa525('0x42')][_0xa525('0x5a')]({'where':{'id':_0x780c9a[_0xa525('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xa525('0xc2'),'include':[{'model':db[_0xa525('0x75')],'as':_0xa525('0x9a'),'where':{'mobile':_0x1be80c},'limit':0x1,'order':[[_0xa525('0x7a'),_0xa525('0xc3')]]}]}]})['then'](handleEntityNotFound(_0x32a680,null))[_0xa525('0x37')](function(_0x4b61d3){if(_0x4b61d3&&_0x4b61d3['List']){_0x5c3e94=_0x4b61d3[_0xa525('0x39')]({'plain':!![]});if(_0x5c3e94[_0xa525('0xc2')]&&_0x5c3e94[_0xa525('0xc2')][_0xa525('0x9a')][_0xa525('0x4b')]){return _0x5c3e94[_0xa525('0xc2')][_0xa525('0x9a')][0x0];}return db[_0xa525('0x75')][_0xa525('0x5b')](_[_0xa525('0x18')](_0x780c9a[_0xa525('0x5c')],{'firstName':_0x1be80c,'mobile':_0x1be80c,'phone':_0x1be80c,'ListId':_0x5c3e94[_0xa525('0x7d')]}));}})[_0xa525('0x37')](handleEntityNotFound(_0x32a680,null))[_0xa525('0x37')](function(_0x39fc57){if(_0x39fc57){_0x312c54=_0x39fc57;return db[_0xa525('0xba')][_0xa525('0x5a')]({'where':{'ContactId':_0x312c54['id'],'closed':![],'SmsAccountId':_0x5c3e94['id']}})[_0xa525('0x37')](function(_0x1776f3){if(_0x1776f3){return[_0x1776f3,![]];}return db['SmsInteraction'][_0xa525('0x5b')]({'UserId':_0x780c9a[_0xa525('0xc4')]['id'],'ContactId':_0x312c54['id'],'SmsAccountId':_0x5c3e94['id'],'phone':_0x1be80c,'firstMsgDirection':'out','Messages':[_[_0xa525('0x51')](_0x780c9a[_0xa525('0x5c')],{'read':![],'body':_0x780c9a[_0xa525('0x5c')]['body'],'phone':_0x1be80c,'SmsAccountId':_0x5c3e94['id'],'UserId':_0x780c9a['user']['id'],'ContactId':_0x312c54['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xa525('0xc5')}]})[_0xa525('0x37')](function(_0x3ece69){return[_0x3ece69,!![]];});});}})[_0xa525('0x9d')](function(_0x27445f,_0x50d2cc){if(_0x50d2cc){return _0x27445f;}return db['SmsMessage'][_0xa525('0x5b')](_['merge'](_0x780c9a['body'],{'read':![],'body':_0x780c9a[_0xa525('0x5c')][_0xa525('0x5c')],'phone':_0x1be80c,'SmsAccountId':_0x5c3e94['id'],'SmsInteractionId':_0x27445f['id'],'UserId':_0x780c9a[_0xa525('0xc4')]['id'],'ContactId':_0x312c54['id']}))[_0xa525('0x37')](function(_0x5cd497){_0x27445f[_0xa525('0xc6')][_0xa525('0xc5')]=[];_0x27445f['dataValues'][_0xa525('0xc5')][_0xa525('0xa0')](_0x5cd497[_0xa525('0xc6')]);return _0x27445f;});})[_0xa525('0x37')](respondWithResult(_0x32a680,null))[_0xa525('0x29')](handleError(_0x32a680,null));};exports[_0xa525('0x30')]=function(_0x5e3cda,_0x5b71ad,_0x401d5d){if(_0x5e3cda[_0xa525('0x5c')]['id']){delete _0x5e3cda[_0xa525('0x5c')]['id'];}var _0x519bb7,_0x2a052c,_0x18e583;return db[_0xa525('0x42')][_0xa525('0x5a')]({'where':{'id':_0x5e3cda[_0xa525('0x58')]['id']}})['then'](handleEntityNotFound(_0x5b71ad,null))[_0xa525('0x37')](function(_0x1d47b2){if(_0x1d47b2){_0x18e583=_0x1d47b2;logger[_0xa525('0x24')](_0xa525('0x25'),_0xa525('0x30'),'received\x20delivery\x20report\x20from',_0x1d47b2[_0xa525('0x52')],util['inspect'](_0x5e3cda['body'],{'showHidden':![],'depth':null}));switch(_0x1d47b2[_0xa525('0x52')]){case _0xa525('0x82'):if(_0x5e3cda[_0xa525('0x5c')]['skebby_dispatch_id']&&_0x5e3cda[_0xa525('0x5c')]['status']){_0x2a052c=_0x5e3cda[_0xa525('0x5c')][_0xa525('0x30')];return db[_0xa525('0xc7')]['find']({'where':{'messageId':_0x5e3cda[_0xa525('0x5c')][_0xa525('0xc8')]}});}break;case _0xa525('0x86'):if(_0x5e3cda[_0xa525('0x5c')][_0xa525('0xc9')]&&_0x5e3cda[_0xa525('0x5c')][_0xa525('0xca')]){_0x2a052c=_0x5e3cda[_0xa525('0x5c')]['statusInt'];return db['SmsMessage'][_0xa525('0x5a')]({'where':{'messageId':_0x5e3cda['body'][_0xa525('0xc9')]}});}break;case _0xa525('0x87'):if(_0x5e3cda[_0xa525('0x5c')][_0xa525('0x89')]&&_0x5e3cda[_0xa525('0x5c')][_0xa525('0xcb')]){_0x2a052c=_0x5e3cda[_0xa525('0x5c')]['status_code'];return db[_0xa525('0xc7')][_0xa525('0x5a')]({'where':{'messageId':_0x5e3cda[_0xa525('0x5c')][_0xa525('0x89')]}});}break;case _0xa525('0x8c'):var _0x46657b=_0x5e3cda[_0xa525('0x5c')][_0xa525('0x8d')][0x0];if(_0x46657b['messageId']&&_0x46657b[_0xa525('0x30')][_0xa525('0xcc')]==='DELIVERED'){_0x2a052c=_0x46657b[_0xa525('0x30')][_0xa525('0xcc')];return db[_0xa525('0xc7')][_0xa525('0x5a')]({'where':{'messageId':_0x46657b[_0xa525('0x88')]}});}break;case _0xa525('0xcd'):if(_0x5e3cda['body'][_0xa525('0x88')]&&_0x5e3cda['body'][_0xa525('0x30')]){_0x2a052c=_0x5e3cda[_0xa525('0x5c')][_0xa525('0x30')];return db[_0xa525('0xc7')][_0xa525('0x5a')]({'where':{'messageId':_0x5e3cda[_0xa525('0x5c')][_0xa525('0x88')]}});}break;case'bandwidth':if(_0x5e3cda[_0xa525('0x5c')][0x0][_0xa525('0x27')]['id']){_0x2a052c=_0x5e3cda[_0xa525('0x5c')][0x0][_0xa525('0x52')];return db['SmsMessage']['find']({'where':{'messageId':_0x5e3cda[_0xa525('0x5c')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x5e3cda['body'][_0xa525('0xce')]&&_0x5e3cda[_0xa525('0x5c')][_0xa525('0x30')]){_0x2a052c=_0x5e3cda[_0xa525('0x5c')]['status'];return db[_0xa525('0xc7')][_0xa525('0x5a')]({'where':{'messageId':_0x5e3cda[_0xa525('0x5c')]['redif']}});}break;}}})[_0xa525('0x37')](handleEntityNotFound(_0x5b71ad,null))[_0xa525('0x37')](function(_0x44d550){if(_0x44d550){_0x519bb7=_0x44d550;switch(_0x18e583[_0xa525('0x52')]){case _0xa525('0x82'):if(_0x2a052c===_0xa525('0xcf')){return _0x519bb7['update']({'read':!![]});}else{logger[_0xa525('0x26')](_0xa525('0x25'),'status',_0xa525('0x82'),util['inspect'](_0x5e3cda[_0xa525('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa525('0x86'):if(_0x2a052c==='1'){return _0x519bb7['update']({'read':!![]});}else{logger[_0xa525('0x26')](_0xa525('0x25'),_0xa525('0x30'),'skebby',util[_0xa525('0xd0')](_0x5e3cda['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5e3cda[_0xa525('0x5c')][_0xa525('0xd1')]&&_0x2a052c>=0xc8&&_0x2a052c<=0xce){return _0x519bb7['update']({'read':!![]});}else{logger[_0xa525('0x26')](_0xa525('0x25'),_0xa525('0x30'),'clicksend',util[_0xa525('0xd0')](_0x5e3cda[_0xa525('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x65c74b=_0x5e3cda['body'][_0xa525('0x8d')][0x0];if(_0x65c74b[_0xa525('0x30')][_0xa525('0xcc')]===_0xa525('0xcf')){return _0x519bb7[_0xa525('0x36')]({'read':!![]});}else{logger['error'](_0xa525('0x25'),'status',_0xa525('0x8c'),util[_0xa525('0xd0')](_0x5e3cda[_0xa525('0x5c')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2a052c==_0xa525('0xd2')||_0x2a052c==_0xa525('0xd3')){return _0x519bb7[_0xa525('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa525('0x30'),_0xa525('0xcd'),util[_0xa525('0xd0')](_0x5e3cda[_0xa525('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa525('0xd4'):if(_0x2a052c==_0xa525('0xd5')){return _0x519bb7['update']({'read':!![]});}else{logger['error'](_0xa525('0x25'),'status',_0xa525('0xd4'),util['inspect'](_0x5e3cda['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2a052c===_0xa525('0xd6')||_0x2a052c==='ACCEPTD'){return _0x519bb7[_0xa525('0x36')]({'read':!![]});}else{logger['error'](_0xa525('0x25'),_0xa525('0x30'),_0xa525('0x92'),util['inspect'](_0x5e3cda[_0xa525('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x519bb7;}})[_0xa525('0x37')](respondWithResult(_0x5b71ad,null))[_0xa525('0x29')](handleError(_0x5b71ad,null));};exports[_0xa525('0xd7')]=function(_0x3ad8db,_0x3aac40,_0x364577){var _0x5e0788,_0x169f6b,_0x1a9837;return db['SmsAccount'][_0xa525('0x5a')]({'where':{'id':_0x3ad8db['params']['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x3aac40,null))[_0xa525('0x37')](function(_0x3c967c){if(_0x3c967c){_0x1a9837=_0x3c967c;logger[_0xa525('0x24')](_0xa525('0x25'),_0xa525('0x30'),_0xa525('0xd8'),_0x3c967c[_0xa525('0x52')],util[_0xa525('0xd0')](_0x3ad8db[_0xa525('0x46')],{'showHidden':![],'depth':null}));switch(_0x3c967c['type']){case'csc':if(_0x3ad8db[_0xa525('0x46')][_0xa525('0xd9')]&&_0x3ad8db[_0xa525('0x46')]['state']){_0x169f6b=_0x3ad8db[_0xa525('0x46')][_0xa525('0xda')];return db[_0xa525('0xc7')][_0xa525('0x5a')]({'where':{'messageId':_0x3ad8db['query'][_0xa525('0xd9')]}});}break;}}})['then'](handleEntityNotFound(_0x3aac40,null))['then'](function(_0x4fea93){if(_0x4fea93){_0x5e0788=_0x4fea93;switch(_0x1a9837[_0xa525('0x52')]){case _0xa525('0x8e'):if(_0x169f6b==='2'||_0x169f6b==='6'){return _0x5e0788[_0xa525('0x36')]({'read':!![]});}else{logger[_0xa525('0x26')](_0xa525('0x25'),_0xa525('0x30'),'csc',util[_0xa525('0xd0')](_0x3ad8db[_0xa525('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x5e0788;}})[_0xa525('0x37')](respondWithResult(_0x3aac40,null))['catch'](handleError(_0x3aac40,null));};exports[_0xa525('0xdb')]=function(_0xd91597,_0x231e16,_0x5ded00){return db[_0xa525('0x42')][_0xa525('0x5a')]({'where':{'id':_0xd91597['params']['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x231e16,null))['then'](function(_0x33dcac){if(_0x33dcac){return _0x33dcac[_0xa525('0xdb')](_0xd91597[_0xa525('0x5c')][_0xa525('0x6a')],_[_0xa525('0x9c')](_0xd91597['body'],['ids','id'])||{})[_0xa525('0x9d')](function(_0x2bca76){for(var _0x50837e=0x0;_0x50837e<_0xd91597[_0xa525('0x5c')][_0xa525('0x6a')][_0xa525('0x4b')];_0x50837e+=0x1){socket[_0xa525('0xdc')](_0xa525('0xdd'),{'UserId':Number(_0xd91597[_0xa525('0x5c')][_0xa525('0x6a')][_0x50837e]),'SmsAccountId':Number(_0xd91597[_0xa525('0x58')]['id'])});}return _0x2bca76;});}})[_0xa525('0x37')](respondWithResult(_0x231e16,null))[_0xa525('0x29')](handleError(_0x231e16,null));};exports[_0xa525('0xde')]=function(_0x3efe32,_0x13100a,_0xe8f76a){return db['SmsAccount']['find']({'where':{'id':_0x3efe32[_0xa525('0x58')]['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x13100a,null))[_0xa525('0x37')](function(_0x4ca9e8){if(_0x4ca9e8){return _0x4ca9e8[_0xa525('0xde')](_0x3efe32['query'][_0xa525('0x6a')])[_0xa525('0x37')](function(){if(_['isArray'](_0x3efe32[_0xa525('0x46')][_0xa525('0x6a')])){for(var _0xee8689=0x0;_0xee8689<_0x3efe32[_0xa525('0x46')][_0xa525('0x6a')][_0xa525('0x4b')];_0xee8689+=0x1){socket['emit'](_0xa525('0xdf'),{'UserId':Number(_0x3efe32[_0xa525('0x46')][_0xa525('0x6a')][_0xee8689]),'SmsAccountId':Number(_0x3efe32[_0xa525('0x58')]['id'])});}}else{socket[_0xa525('0xdc')](_0xa525('0xdf'),{'UserId':Number(_0x3efe32[_0xa525('0x46')]['ids']),'SmsAccountId':Number(_0x3efe32[_0xa525('0x58')]['id'])});}});}})[_0xa525('0x37')](respondWithStatusCode(_0x13100a,null))[_0xa525('0x29')](handleError(_0x13100a,null));};exports[_0xa525('0xe0')]=function(_0xeefc04,_0x50fe86,_0x7118fc){var _0x2c75d5={};var _0x45d79b={};var _0x594668;var _0x248bcf;return db[_0xa525('0x42')][_0xa525('0x66')]({'where':{'id':_0xeefc04[_0xa525('0x58')]['id']}})[_0xa525('0x37')](handleEntityNotFound(_0x50fe86,null))[_0xa525('0x37')](function(_0x5164e2){if(_0x5164e2){_0x594668=_0x5164e2;_0x45d79b[_0xa525('0x44')]=_[_0xa525('0x45')](db[_0xa525('0xe1')][_0xa525('0x43')]);_0x45d79b[_0xa525('0x46')]=_[_0xa525('0x45')](_0xeefc04[_0xa525('0x46')]);_0x45d79b[_0xa525('0x47')]=_[_0xa525('0x48')](_0x45d79b[_0xa525('0x44')],_0x45d79b['query']);_0x2c75d5['attributes']=_[_0xa525('0x48')](_0x45d79b[_0xa525('0x44')],qs[_0xa525('0x4a')](_0xeefc04['query']['fields']));_0x2c75d5[_0xa525('0x49')]=_0x2c75d5[_0xa525('0x49')][_0xa525('0x4b')]?_0x2c75d5[_0xa525('0x49')]:_0x45d79b[_0xa525('0x44')];_0x2c75d5[_0xa525('0x4d')]=qs[_0xa525('0x4e')](_0xeefc04['query'][_0xa525('0x4e')]);_0x2c75d5['where']=qs[_0xa525('0x47')](_[_0xa525('0x68')](_0xeefc04[_0xa525('0x46')],_0x45d79b[_0xa525('0x47')]));if(_0xeefc04[_0xa525('0x46')][_0xa525('0x50')]){_0x2c75d5[_0xa525('0x4f')]=_[_0xa525('0x51')](_0x2c75d5['where'],{'$or':_[_0xa525('0x41')](_0x2c75d5[_0xa525('0x49')],function(_0x4ee412){var _0x44595c={};_0x44595c[_0x4ee412]={'$like':'%'+_0xeefc04[_0xa525('0x46')][_0xa525('0x50')]+'%'};return _0x44595c;})});}_0x2c75d5=_['merge']({},_0x2c75d5,_0xeefc04['options']);return _0x594668[_0xa525('0xe0')](_0x2c75d5);}})[_0xa525('0x37')](function(_0x3b0245){if(_0x3b0245){_0x248bcf=_0x3b0245['length'];if(!_0xeefc04[_0xa525('0x46')][_0xa525('0x67')](_0xa525('0x4c'))){_0x2c75d5[_0xa525('0x2e')]=qs[_0xa525('0x2e')](_0xeefc04[_0xa525('0x46')][_0xa525('0x2e')]);_0x2c75d5['offset']=qs['offset'](_0xeefc04[_0xa525('0x46')][_0xa525('0x2c')]);}return _0x594668[_0xa525('0xe0')](_0x2c75d5);}})['then'](function(_0x23d60e){if(_0x23d60e){return _0x23d60e?{'count':_0x248bcf,'rows':_0x23d60e}:null;}})[_0xa525('0x37')](respondWithResult(_0x50fe86,null))['catch'](handleError(_0x50fe86,null));};
\ No newline at end of file
index b7772df..115ae53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a2d=['emit','hook','exports','SmsAccount','setMaxListeners','save'];(function(_0x385467,_0x298239){var _0x5ed67e=function(_0x4b252c){while(--_0x4b252c){_0x385467['push'](_0x385467['shift']());}};_0x5ed67e(++_0x298239);}(_0x0a2d,0x18f));var _0xd0a2=function(_0x483c6d,_0x2df362){_0x483c6d=_0x483c6d-0x0;var _0x463f8d=_0x0a2d[_0x483c6d];return _0x463f8d;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xd0a2('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd0a2('0x1')](0x0);var events={'afterCreate':_0xd0a2('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x424b14){return function(_0x9f4af8,_0x510c0c,_0x55bb78){SmsAccountEvents[_0xd0a2('0x3')](_0x424b14+':'+_0x9f4af8['id'],_0x9f4af8);SmsAccountEvents['emit'](_0x424b14,_0x9f4af8);_0x55bb78(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xd0a2('0x4')](e,emitEvent(event));}}module[_0xd0a2('0x5')]=SmsAccountEvents;
\ No newline at end of file
+var _0x218c=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x218c,0xd4));var _0xc218=function(_0x7b28fe,_0x14b077){_0x7b28fe=_0x7b28fe-0x0;var _0x3eea1b=_0x218c[_0x7b28fe];return _0x3eea1b;};'use strict';var EventEmitter=require(_0xc218('0x0'));var SmsAccount=require(_0xc218('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc218('0x2')](0x0);var events={'afterCreate':_0xc218('0x3'),'afterUpdate':_0xc218('0x4'),'afterDestroy':_0xc218('0x5')};function emitEvent(_0x4eb5c5){return function(_0x1c4d39,_0x38f04a,_0x167fd3){SmsAccountEvents[_0xc218('0x6')](_0x4eb5c5+':'+_0x1c4d39['id'],_0x1c4d39);SmsAccountEvents[_0xc218('0x6')](_0x4eb5c5,_0x1c4d39);_0x167fd3(null);};}for(var e in events){if(events[_0xc218('0x7')](e)){var event=events[e];SmsAccount[_0xc218('0x8')](e,emitEvent(event));}}module[_0xc218('0x9')]=SmsAccountEvents;
\ No newline at end of file
index 35ce8d0..0455a75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ce7=['../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0x6ce7,0x102));var _0x76ce=function(_0xf346ed,_0xbbe147){_0xf346ed=_0xf346ed-0x0;var _0x49e92b=_0x6ce7[_0xf346ed];return _0x49e92b;};'use strict';var _=require(_0x76ce('0x0'));var util=require(_0x76ce('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x76ce('0x2'));var rp=require(_0x76ce('0x3'));var fs=require('fs');var path=require(_0x76ce('0x4'));var rimraf=require(_0x76ce('0x5'));var config=require(_0x76ce('0x6'));var attributes=require(_0x76ce('0x7'));module[_0x76ce('0x8')]=function(_0x15f626,_0x58390b){return _0x15f626['define'](_0x76ce('0x9'),attributes,{'tableName':_0x76ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x743b=['moment','request-promise','path','rimraf','exports','define','sms_accounts','util','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x743b,0x103));var _0xb743=function(_0x1d7c3d,_0x422ef4){_0x1d7c3d=_0x1d7c3d-0x0;var _0x44d21a=_0x743b[_0x1d7c3d];return _0x44d21a;};'use strict';var _=require('lodash');var util=require(_0xb743('0x0'));var logger=require(_0xb743('0x1'))('api');var moment=require(_0xb743('0x2'));var BPromise=require('bluebird');var rp=require(_0xb743('0x3'));var fs=require('fs');var path=require(_0xb743('0x4'));var rimraf=require(_0xb743('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xb743('0x6')]=function(_0x49399d,_0x3db0d4){return _0x49399d[_0xb743('0x7')]('SmsAccount',attributes,{'tableName':_0xb743('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 387b39c..5547ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc204=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSmsAccount','SmsAccount','find','options','where','attributes','map','model','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ba0bc,_0x52cc3b){var _0x41189d=function(_0x4fd026){while(--_0x4fd026){_0x5ba0bc['push'](_0x5ba0bc['shift']());}};_0x41189d(++_0x52cc3b);}(_0xc204,0x144));var _0x4c20=function(_0x404ea8,_0x540787){_0x404ea8=_0x404ea8-0x0;var _0x3a91bb=_0xc204[_0x404ea8];return _0x3a91bb;};'use strict';var _=require(_0x4c20('0x0'));var util=require(_0x4c20('0x1'));var moment=require(_0x4c20('0x2'));var BPromise=require(_0x4c20('0x3'));var rs=require(_0x4c20('0x4'));var fs=require('fs');var Redis=require(_0x4c20('0x5'));var db=require(_0x4c20('0x6'))['db'];var utils=require(_0x4c20('0x7'));var logger=require(_0x4c20('0x8'))(_0x4c20('0x9'));var config=require(_0x4c20('0xa'));var jayson=require(_0x4c20('0xb'));var client=jayson[_0x4c20('0xc')]['http']({'port':0x232a});config[_0x4c20('0xd')]=_[_0x4c20('0xe')](config[_0x4c20('0xd')],{'host':_0x4c20('0xf'),'port':0x18eb});var socket=require(_0x4c20('0x10'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x4c20('0x11')](socket);function respondWithRpcPromise(_0xb01693,_0x31a8ca,_0x1862a1){return new BPromise(function(_0x714dc3,_0x2acee5){return client[_0x4c20('0x12')](_0xb01693,_0x1862a1)['then'](function(_0x4262e8){logger[_0x4c20('0x13')](_0x4c20('0x14'),_0x31a8ca,_0x4c20('0x15'));logger[_0x4c20('0x16')](_0x4c20('0x17'),_0x31a8ca,_0x4c20('0x15'),JSON[_0x4c20('0x18')](_0x4262e8));if(_0x4262e8[_0x4c20('0x19')]){if(_0x4262e8[_0x4c20('0x19')]['code']===0x1f4){logger[_0x4c20('0x19')](_0x4c20('0x14'),_0x31a8ca,_0x4262e8[_0x4c20('0x19')][_0x4c20('0x1a')]);return _0x2acee5(_0x4262e8[_0x4c20('0x19')][_0x4c20('0x1a')]);}logger[_0x4c20('0x19')](_0x4c20('0x14'),_0x31a8ca,_0x4262e8['error'][_0x4c20('0x1a')]);return _0x714dc3(_0x4262e8['error'][_0x4c20('0x1a')]);}else{logger[_0x4c20('0x13')](_0x4c20('0x14'),_0x31a8ca,_0x4c20('0x15'));_0x714dc3(_0x4262e8[_0x4c20('0x1b')]['message']);}})['catch'](function(_0x5c00b2){logger[_0x4c20('0x19')]('SmsAccount,\x20%s,\x20%s',_0x31a8ca,_0x5c00b2);_0x2acee5(_0x5c00b2);});});}exports[_0x4c20('0x1c')]=function(_0x5cdc4f){var _0xf5a162=this;return new Promise(function(_0x8d0f61,_0xfdcd67){return db[_0x4c20('0x1d')][_0x4c20('0x1e')]({'raw':_0x5cdc4f[_0x4c20('0x1f')]?_0x5cdc4f[_0x4c20('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5cdc4f[_0x4c20('0x1f')]?_0x5cdc4f[_0x4c20('0x1f')][_0x4c20('0x20')]||null:null,'attributes':_0x5cdc4f[_0x4c20('0x1f')]?_0x5cdc4f[_0x4c20('0x1f')][_0x4c20('0x21')]||null:null,'include':_0x5cdc4f[_0x4c20('0x1f')]?_0x5cdc4f[_0x4c20('0x1f')]['include']?_[_0x4c20('0x22')](_0x5cdc4f[_0x4c20('0x1f')]['include'],function(_0x42fe3d){return{'model':db[_0x42fe3d[_0x4c20('0x23')]],'as':_0x42fe3d['as'],'attributes':_0x42fe3d[_0x4c20('0x21')],'include':_0x42fe3d[_0x4c20('0x24')]?_[_0x4c20('0x22')](_0x42fe3d[_0x4c20('0x24')],function(_0x4be53d){return{'model':db[_0x4be53d[_0x4c20('0x23')]],'as':_0x4be53d['as'],'attributes':_0x4be53d[_0x4c20('0x21')],'include':_0x4be53d['include']?_[_0x4c20('0x22')](_0x4be53d['include'],function(_0x3ce2af){return{'model':db[_0x3ce2af[_0x4c20('0x23')]],'as':_0x3ce2af['as'],'attributes':_0x3ce2af[_0x4c20('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36078a){logger[_0x4c20('0x13')]('ShowSmsAccount',_0x5cdc4f);logger[_0x4c20('0x16')](_0x4c20('0x1c'),_0x5cdc4f,JSON['stringify'](_0x36078a));_0x8d0f61(_0x36078a);})['catch'](function(_0x12e4b6){logger[_0x4c20('0x19')](_0x4c20('0x1c'),_0x12e4b6[_0x4c20('0x1a')],_0x5cdc4f);_0xfdcd67(_0xf5a162[_0x4c20('0x19')](0x1f4,_0x12e4b6[_0x4c20('0x1a')]));});});};
\ No newline at end of file
+var _0xe2e7=['redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSmsAccount','find','options','attributes','include','map','model','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27a3ac,_0x4c1d2e){var _0xd3a561=function(_0x68667d){while(--_0x68667d){_0x27a3ac['push'](_0x27a3ac['shift']());}};_0xd3a561(++_0x4c1d2e);}(_0xe2e7,0xea));var _0x7e2e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe2e7[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e2e('0x0'));var BPromise=require(_0x7e2e('0x1'));var rs=require(_0x7e2e('0x2'));var fs=require('fs');var Redis=require(_0x7e2e('0x3'));var db=require(_0x7e2e('0x4'))['db'];var utils=require(_0x7e2e('0x5'));var logger=require(_0x7e2e('0x6'))(_0x7e2e('0x7'));var config=require(_0x7e2e('0x8'));var jayson=require(_0x7e2e('0x9'));var client=jayson[_0x7e2e('0xa')]['http']({'port':0x232a});config[_0x7e2e('0xb')]=_[_0x7e2e('0xc')](config[_0x7e2e('0xb')],{'host':_0x7e2e('0xd'),'port':0x18eb});var socket=require(_0x7e2e('0xe'))(new Redis(config['redis']));require(_0x7e2e('0xf'))['register'](socket);function respondWithRpcPromise(_0xd9baa3,_0x590ebb,_0x570bd4){return new BPromise(function(_0x56dfb7,_0x4ba64f){return client[_0x7e2e('0x10')](_0xd9baa3,_0x570bd4)[_0x7e2e('0x11')](function(_0x481c92){logger[_0x7e2e('0x12')](_0x7e2e('0x13'),_0x590ebb,_0x7e2e('0x14'));logger['debug'](_0x7e2e('0x15'),_0x590ebb,_0x7e2e('0x14'),JSON[_0x7e2e('0x16')](_0x481c92));if(_0x481c92['error']){if(_0x481c92['error']['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x590ebb,_0x481c92[_0x7e2e('0x17')][_0x7e2e('0x18')]);return _0x4ba64f(_0x481c92[_0x7e2e('0x17')][_0x7e2e('0x18')]);}logger[_0x7e2e('0x17')](_0x7e2e('0x13'),_0x590ebb,_0x481c92[_0x7e2e('0x17')][_0x7e2e('0x18')]);return _0x56dfb7(_0x481c92[_0x7e2e('0x17')]['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x590ebb,_0x7e2e('0x14'));_0x56dfb7(_0x481c92[_0x7e2e('0x19')][_0x7e2e('0x18')]);}})[_0x7e2e('0x1a')](function(_0x5442d2){logger[_0x7e2e('0x17')]('SmsAccount,\x20%s,\x20%s',_0x590ebb,_0x5442d2);_0x4ba64f(_0x5442d2);});});}exports[_0x7e2e('0x1b')]=function(_0x414439){var _0xaaf966=this;return new Promise(function(_0x599018,_0x1bb805){return db['SmsAccount'][_0x7e2e('0x1c')]({'raw':_0x414439[_0x7e2e('0x1d')]?_0x414439[_0x7e2e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x414439[_0x7e2e('0x1d')]?_0x414439[_0x7e2e('0x1d')]['where']||null:null,'attributes':_0x414439[_0x7e2e('0x1d')]?_0x414439[_0x7e2e('0x1d')][_0x7e2e('0x1e')]||null:null,'include':_0x414439[_0x7e2e('0x1d')]?_0x414439[_0x7e2e('0x1d')][_0x7e2e('0x1f')]?_['map'](_0x414439['options'][_0x7e2e('0x1f')],function(_0x4aae5e){return{'model':db[_0x4aae5e['model']],'as':_0x4aae5e['as'],'attributes':_0x4aae5e[_0x7e2e('0x1e')],'include':_0x4aae5e[_0x7e2e('0x1f')]?_[_0x7e2e('0x20')](_0x4aae5e[_0x7e2e('0x1f')],function(_0x275b1d){return{'model':db[_0x275b1d[_0x7e2e('0x21')]],'as':_0x275b1d['as'],'attributes':_0x275b1d['attributes'],'include':_0x275b1d[_0x7e2e('0x1f')]?_[_0x7e2e('0x20')](_0x275b1d[_0x7e2e('0x1f')],function(_0x1501f9){return{'model':db[_0x1501f9[_0x7e2e('0x21')]],'as':_0x1501f9['as'],'attributes':_0x1501f9[_0x7e2e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7e2e('0x11')](function(_0x1ece55){logger['info'](_0x7e2e('0x1b'),_0x414439);logger[_0x7e2e('0x22')](_0x7e2e('0x1b'),_0x414439,JSON[_0x7e2e('0x16')](_0x1ece55));_0x599018(_0x1ece55);})['catch'](function(_0x51e631){logger[_0x7e2e('0x17')](_0x7e2e('0x1b'),_0x51e631[_0x7e2e('0x18')],_0x414439);_0x1bb805(_0xaaf966[_0x7e2e('0x17')](0x1f4,_0x51e631[_0x7e2e('0x18')]));});});};
\ No newline at end of file
index b33a7b1..0134ace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 83a379e..2e0e1a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x259aaf,_0x5dbec1){var _0x366663=function(_0x24a61a){while(--_0x24a61a){_0x259aaf['push'](_0x259aaf['shift']());}};_0x366663(++_0x5dbec1);}(_0x3e74,0x175));var _0x43e7=function(_0x21bf0f,_0x13de36){_0x21bf0f=_0x21bf0f-0x0;var _0x448ec5=_0x3e74[_0x21bf0f];return _0x448ec5;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router;
\ No newline at end of file
+var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x11d051,_0x4132dc){var _0x5bed72=function(_0x56f939){while(--_0x56f939){_0x11d051['push'](_0x11d051['shift']());}};_0x5bed72(++_0x4132dc);}(_0x55ca,0x126));var _0xa55c=function(_0x1d453f,_0x5793a9){_0x1d453f=_0x1d453f-0x0;var _0x50996a=_0x55ca[_0x1d453f];return _0x50996a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router;
\ No newline at end of file
index ba16c58..22ba9b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6b6=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x48e8a9,_0x46ef74){var _0x3f3293=function(_0x3ab61f){while(--_0x3ab61f){_0x48e8a9['push'](_0x48e8a9['shift']());}};_0x3f3293(++_0x46ef74);}(_0xf6b6,0x19a));var _0x6f6b=function(_0x56fd29,_0x410ac3){_0x56fd29=_0x56fd29-0x0;var _0x3ee16f=_0xf6b6[_0x56fd29];return _0x3ee16f;};'use strict';var Sequelize=require(_0x6f6b('0x0'));module[_0x6f6b('0x1')]={'priority':{'type':Sequelize[_0x6f6b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6f6b('0x3')],'allowNull':![],'defaultValue':_0x6f6b('0x4')},'appdata':{'type':Sequelize[_0x6f6b('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6f6b('0x3')],'defaultValue':_0x6f6b('0x6')}};
\ No newline at end of file
+var _0x4fc5=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x2343ad,_0xd01de0){var _0x1b6817=function(_0x5cc3df){while(--_0x5cc3df){_0x2343ad['push'](_0x2343ad['shift']());}};_0x1b6817(++_0xd01de0);}(_0x4fc5,0x99));var _0x54fc=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x4fc5[_0x3a99f4];return _0xea0b42;};'use strict';var Sequelize=require(_0x54fc('0x0'));module[_0x54fc('0x1')]={'priority':{'type':Sequelize[_0x54fc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x54fc('0x3')],'allowNull':![],'defaultValue':_0x54fc('0x4')},'appdata':{'type':Sequelize[_0x54fc('0x5')]()},'description':{'type':Sequelize[_0x54fc('0x3')]},'interval':{'type':Sequelize[_0x54fc('0x3')],'defaultValue':_0x54fc('0x6')}};
\ No newline at end of file
index 4849b00..a2db1c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x609a=['filter','merge','map','VIRTUAL','includeAll','include','SmsApplication','findAll','rows','params','keys','rawAttributes','options','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x2e5758,_0x2569c4){var _0x202185=function(_0x273d90){while(--_0x273d90){_0x2e5758['push'](_0x2e5758['shift']());}};_0x202185(++_0x2569c4);}(_0x609a,0x1ba));var _0xa609=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x609a[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa609('0x0'));var zipdir=require(_0xa609('0x1'));var jsonpatch=require(_0xa609('0x2'));var rp=require(_0xa609('0x3'));var moment=require(_0xa609('0x4'));var BPromise=require(_0xa609('0x5'));var Mustache=require('mustache');var util=require(_0xa609('0x6'));var path=require(_0xa609('0x7'));var sox=require(_0xa609('0x8'));var csv=require(_0xa609('0x9'));var ejs=require(_0xa609('0xa'));var fs=require('fs');var fs_extra=require(_0xa609('0xb'));var _=require(_0xa609('0xc'));var squel=require(_0xa609('0xd'));var crypto=require('crypto');var jsforce=require(_0xa609('0xe'));var deskjs=require(_0xa609('0xf'));var toCsv=require(_0xa609('0x9'));var querystring=require(_0xa609('0x10'));var Papa=require(_0xa609('0x11'));var Redis=require(_0xa609('0x12'));var authService=require(_0xa609('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa609('0x14'));var logger=require('../../config/logger')(_0xa609('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa609('0x16'));var db=require(_0xa609('0x17'))['db'];function respondWithStatusCode(_0x2d0147,_0x47d154){_0x47d154=_0x47d154||0xcc;return function(_0x535068){if(_0x535068){return _0x2d0147['sendStatus'](_0x47d154);}return _0x2d0147['status'](_0x47d154)['end']();};}function respondWithResult(_0x3608a9,_0x39befb){_0x39befb=_0x39befb||0xc8;return function(_0x115097){if(_0x115097){return _0x3608a9[_0xa609('0x18')](_0x39befb)[_0xa609('0x19')](_0x115097);}};}function respondWithFilteredResult(_0x30bea8,_0x50e551){return function(_0x29e3c5){if(_0x29e3c5){var _0x451070=typeof _0x50e551[_0xa609('0x1a')]===_0xa609('0x1b')&&typeof _0x50e551[_0xa609('0x1c')]===_0xa609('0x1b');var _0x2977e=_0x29e3c5[_0xa609('0x1d')];var _0x37853c=_0x451070?0x0:_0x50e551['offset'];var _0x188303=_0x451070?_0x29e3c5[_0xa609('0x1d')]:_0x50e551[_0xa609('0x1a')]+_0x50e551['limit'];var _0x2078d1;if(_0x188303>=_0x2977e){_0x188303=_0x2977e;_0x2078d1=0xc8;}else{_0x2078d1=0xce;}_0x30bea8[_0xa609('0x18')](_0x2078d1);return _0x30bea8[_0xa609('0x1e')](_0xa609('0x1f'),_0x37853c+'-'+_0x188303+'/'+_0x2977e)['json'](_0x29e3c5);}return null;};}function patchUpdates(_0x3132da){return function(_0x6188c3){try{jsonpatch[_0xa609('0x20')](_0x6188c3,_0x3132da,!![]);}catch(_0x2a046b){return BPromise['reject'](_0x2a046b);}return _0x6188c3[_0xa609('0x21')]();};}function saveUpdates(_0x4e7ec0,_0x28c61f){return function(_0x1bed75){if(_0x1bed75){return _0x1bed75[_0xa609('0x22')](_0x4e7ec0)[_0xa609('0x23')](function(_0xb2668b){return _0xb2668b;});}return null;};}function removeEntity(_0x38669c,_0x38d34b){return function(_0x564b6a){if(_0x564b6a){return _0x564b6a[_0xa609('0x24')]()[_0xa609('0x23')](function(){_0x38669c[_0xa609('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35aa76,_0x4a97f9){return function(_0xae2389){if(!_0xae2389){_0x35aa76[_0xa609('0x25')](0x194);}return _0xae2389;};}function handleError(_0x3a502b,_0x52abfd){_0x52abfd=_0x52abfd||0x1f4;return function(_0x2756cb){logger[_0xa609('0x26')](_0x2756cb[_0xa609('0x27')]);if(_0x2756cb[_0xa609('0x28')]){delete _0x2756cb[_0xa609('0x28')];}_0x3a502b['status'](_0x52abfd)[_0xa609('0x29')](_0x2756cb);};}exports['index']=function(_0x459517,_0x8cf86e){var _0x33d824={},_0x596235={},_0xa175a4={'count':0x0,'rows':[]};var _0x54854f=_['map'](db['SmsApplication']['rawAttributes'],function(_0x2031d3){return{'name':_0x2031d3['fieldName'],'type':_0x2031d3['type'][_0xa609('0x2a')]};});_0x596235[_0xa609('0x2b')]=_['map'](_0x54854f,_0xa609('0x28'));_0x596235[_0xa609('0x2c')]=_['keys'](_0x459517[_0xa609('0x2c')]);_0x596235[_0xa609('0x2d')]=_['intersection'](_0x596235[_0xa609('0x2b')],_0x596235['query']);_0x33d824[_0xa609('0x2e')]=_[_0xa609('0x2f')](_0x596235[_0xa609('0x2b')],qs[_0xa609('0x30')](_0x459517[_0xa609('0x2c')][_0xa609('0x30')]));_0x33d824[_0xa609('0x2e')]=_0x33d824[_0xa609('0x2e')][_0xa609('0x31')]?_0x33d824[_0xa609('0x2e')]:_0x596235[_0xa609('0x2b')];if(!_0x459517[_0xa609('0x2c')][_0xa609('0x32')]('nolimit')){_0x33d824[_0xa609('0x1c')]=qs[_0xa609('0x1c')](_0x459517[_0xa609('0x2c')][_0xa609('0x1c')]);_0x33d824[_0xa609('0x1a')]=qs[_0xa609('0x1a')](_0x459517[_0xa609('0x2c')][_0xa609('0x1a')]);}_0x33d824[_0xa609('0x33')]=qs[_0xa609('0x34')](_0x459517[_0xa609('0x2c')][_0xa609('0x34')]);_0x33d824[_0xa609('0x35')]=qs[_0xa609('0x2d')](_[_0xa609('0x36')](_0x459517[_0xa609('0x2c')],_0x596235[_0xa609('0x2d')]),_0x54854f);if(_0x459517[_0xa609('0x2c')][_0xa609('0x37')]){_0x33d824[_0xa609('0x35')]=_[_0xa609('0x38')](_0x33d824[_0xa609('0x35')],{'$or':_[_0xa609('0x39')](_0x54854f,function(_0x50f1b9){if(_0x50f1b9['type']!==_0xa609('0x3a')){var _0x1792bd={};_0x1792bd[_0x50f1b9[_0xa609('0x28')]]={'$like':'%'+_0x459517[_0xa609('0x2c')][_0xa609('0x37')]+'%'};return _0x1792bd;}})});}_0x33d824=_[_0xa609('0x38')]({},_0x33d824,_0x459517['options']);var _0x1850e8={'where':_0x33d824['where']};return db['SmsApplication']['count'](_0x1850e8)[_0xa609('0x23')](function(_0x34bd8b){_0xa175a4[_0xa609('0x1d')]=_0x34bd8b;if(_0x459517[_0xa609('0x2c')][_0xa609('0x3b')]){_0x33d824[_0xa609('0x3c')]=[{'all':!![]}];}return db[_0xa609('0x3d')][_0xa609('0x3e')](_0x33d824);})['then'](function(_0x71dba2){_0xa175a4[_0xa609('0x3f')]=_0x71dba2;return _0xa175a4;})[_0xa609('0x23')](respondWithFilteredResult(_0x8cf86e,_0x33d824))['catch'](handleError(_0x8cf86e,null));};exports['show']=function(_0x1855ce,_0x5f47b7){var _0xc49fa5={'raw':!![],'where':{'id':_0x1855ce[_0xa609('0x40')]['id']}},_0x139ff0={};_0x139ff0[_0xa609('0x2b')]=_[_0xa609('0x41')](db[_0xa609('0x3d')][_0xa609('0x42')]);_0x139ff0[_0xa609('0x2c')]=_[_0xa609('0x41')](_0x1855ce['query']);_0x139ff0[_0xa609('0x2d')]=_['intersection'](_0x139ff0[_0xa609('0x2b')],_0x139ff0[_0xa609('0x2c')]);_0xc49fa5[_0xa609('0x2e')]=_[_0xa609('0x2f')](_0x139ff0[_0xa609('0x2b')],qs[_0xa609('0x30')](_0x1855ce[_0xa609('0x2c')][_0xa609('0x30')]));_0xc49fa5['attributes']=_0xc49fa5[_0xa609('0x2e')][_0xa609('0x31')]?_0xc49fa5[_0xa609('0x2e')]:_0x139ff0[_0xa609('0x2b')];if(_0x1855ce[_0xa609('0x2c')][_0xa609('0x3b')]){_0xc49fa5[_0xa609('0x3c')]=[{'all':!![]}];}_0xc49fa5=_[_0xa609('0x38')]({},_0xc49fa5,_0x1855ce[_0xa609('0x43')]);return db[_0xa609('0x3d')]['find'](_0xc49fa5)[_0xa609('0x23')](handleEntityNotFound(_0x5f47b7,null))[_0xa609('0x23')](respondWithResult(_0x5f47b7,null))['catch'](handleError(_0x5f47b7,null));};exports[_0xa609('0x44')]=function(_0x2b0d8b,_0x8d8452){return db[_0xa609('0x3d')]['create'](_0x2b0d8b[_0xa609('0x45')],{})[_0xa609('0x23')](respondWithResult(_0x8d8452,0xc9))[_0xa609('0x46')](handleError(_0x8d8452,null));};exports[_0xa609('0x22')]=function(_0x4ef9aa,_0x3bd32d){if(_0x4ef9aa[_0xa609('0x45')]['id']){delete _0x4ef9aa[_0xa609('0x45')]['id'];}return db[_0xa609('0x3d')]['find']({'where':{'id':_0x4ef9aa[_0xa609('0x40')]['id']}})[_0xa609('0x23')](handleEntityNotFound(_0x3bd32d,null))[_0xa609('0x23')](saveUpdates(_0x4ef9aa[_0xa609('0x45')],null))[_0xa609('0x23')](respondWithResult(_0x3bd32d,null))[_0xa609('0x46')](handleError(_0x3bd32d,null));};exports[_0xa609('0x24')]=function(_0x5db209,_0x22a61e){return db[_0xa609('0x3d')]['find']({'where':{'id':_0x5db209['params']['id']}})[_0xa609('0x23')](handleEntityNotFound(_0x22a61e,null))[_0xa609('0x23')](removeEntity(_0x22a61e,null))[_0xa609('0x46')](handleError(_0x22a61e,null));};
\ No newline at end of file
+var _0x294e=['update','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsApplication','includeAll','findAll','rows','catch','show','include','create','body'];(function(_0x1f54d8,_0x90e6b9){var _0x379fd5=function(_0x559cad){while(--_0x559cad){_0x1f54d8['push'](_0x1f54d8['shift']());}};_0x379fd5(++_0x90e6b9);}(_0x294e,0x17f));var _0xe294=function(_0x278f0b,_0x543928){_0x278f0b=_0x278f0b-0x0;var _0x6bc3e5=_0x294e[_0x278f0b];return _0x6bc3e5;};'use strict';var emlformat=require(_0xe294('0x0'));var rimraf=require(_0xe294('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe294('0x2'));var rp=require(_0xe294('0x3'));var moment=require(_0xe294('0x4'));var BPromise=require(_0xe294('0x5'));var Mustache=require(_0xe294('0x6'));var util=require('util');var path=require(_0xe294('0x7'));var sox=require('sox');var csv=require(_0xe294('0x8'));var ejs=require(_0xe294('0x9'));var fs=require('fs');var fs_extra=require(_0xe294('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe294('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe294('0xc'));var toCsv=require(_0xe294('0x8'));var querystring=require(_0xe294('0xd'));var Papa=require(_0xe294('0xe'));var Redis=require('ioredis');var authService=require(_0xe294('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe294('0x10'));var hardwareService=require(_0xe294('0x11'));var logger=require('../../config/logger')(_0xe294('0x12'));var utils=require(_0xe294('0x13'));var config=require(_0xe294('0x14'));var licenseUtil=require(_0xe294('0x15'));var db=require(_0xe294('0x16'))['db'];function respondWithStatusCode(_0x409de0,_0x1bfc47){_0x1bfc47=_0x1bfc47||0xcc;return function(_0x54d110){if(_0x54d110){return _0x409de0[_0xe294('0x17')](_0x1bfc47);}return _0x409de0[_0xe294('0x18')](_0x1bfc47)[_0xe294('0x19')]();};}function respondWithResult(_0x178282,_0x22a8b2){_0x22a8b2=_0x22a8b2||0xc8;return function(_0xdb6862){if(_0xdb6862){return _0x178282[_0xe294('0x18')](_0x22a8b2)[_0xe294('0x1a')](_0xdb6862);}};}function respondWithFilteredResult(_0x26b4a6,_0xdcd0eb){return function(_0x20a6b7){if(_0x20a6b7){var _0x1a1f3e=typeof _0xdcd0eb[_0xe294('0x1b')]==='undefined'&&typeof _0xdcd0eb['limit']===_0xe294('0x1c');var _0x37d140=_0x20a6b7[_0xe294('0x1d')];var _0x912324=_0x1a1f3e?0x0:_0xdcd0eb[_0xe294('0x1b')];var _0x3f8473=_0x1a1f3e?_0x20a6b7[_0xe294('0x1d')]:_0xdcd0eb['offset']+_0xdcd0eb[_0xe294('0x1e')];var _0x11279c;if(_0x3f8473>=_0x37d140){_0x3f8473=_0x37d140;_0x11279c=0xc8;}else{_0x11279c=0xce;}_0x26b4a6[_0xe294('0x18')](_0x11279c);return _0x26b4a6[_0xe294('0x1f')](_0xe294('0x20'),_0x912324+'-'+_0x3f8473+'/'+_0x37d140)['json'](_0x20a6b7);}return null;};}function patchUpdates(_0x4e988e){return function(_0x31b35c){try{jsonpatch[_0xe294('0x21')](_0x31b35c,_0x4e988e,!![]);}catch(_0x5eb547){return BPromise[_0xe294('0x22')](_0x5eb547);}return _0x31b35c[_0xe294('0x23')]();};}function saveUpdates(_0x58bfd,_0x2e49d1){return function(_0x145ac8){if(_0x145ac8){return _0x145ac8['update'](_0x58bfd)[_0xe294('0x24')](function(_0x324386){return _0x324386;});}return null;};}function removeEntity(_0x59e748,_0x251ecb){return function(_0x445f03){if(_0x445f03){return _0x445f03[_0xe294('0x25')]()[_0xe294('0x24')](function(){_0x59e748[_0xe294('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233282,_0x453d3a){return function(_0x1df47b){if(!_0x1df47b){_0x233282[_0xe294('0x17')](0x194);}return _0x1df47b;};}function handleError(_0x15450c,_0x119a1c){_0x119a1c=_0x119a1c||0x1f4;return function(_0x336550){logger[_0xe294('0x26')](_0x336550[_0xe294('0x27')]);if(_0x336550['name']){delete _0x336550[_0xe294('0x28')];}_0x15450c[_0xe294('0x18')](_0x119a1c)[_0xe294('0x29')](_0x336550);};}exports['index']=function(_0x22fb3e,_0x2689e6){var _0x60ab3={},_0x637d6d={},_0x446b80={'count':0x0,'rows':[]};var _0x21eafb=_[_0xe294('0x2a')](db['SmsApplication'][_0xe294('0x2b')],function(_0x4c3028){return{'name':_0x4c3028[_0xe294('0x2c')],'type':_0x4c3028[_0xe294('0x2d')][_0xe294('0x2e')]};});_0x637d6d[_0xe294('0x2f')]=_[_0xe294('0x2a')](_0x21eafb,_0xe294('0x28'));_0x637d6d[_0xe294('0x30')]=_[_0xe294('0x31')](_0x22fb3e[_0xe294('0x30')]);_0x637d6d[_0xe294('0x32')]=_[_0xe294('0x33')](_0x637d6d[_0xe294('0x2f')],_0x637d6d[_0xe294('0x30')]);_0x60ab3['attributes']=_['intersection'](_0x637d6d[_0xe294('0x2f')],qs['fields'](_0x22fb3e['query'][_0xe294('0x34')]));_0x60ab3[_0xe294('0x35')]=_0x60ab3[_0xe294('0x35')]['length']?_0x60ab3[_0xe294('0x35')]:_0x637d6d[_0xe294('0x2f')];if(!_0x22fb3e[_0xe294('0x30')][_0xe294('0x36')](_0xe294('0x37'))){_0x60ab3[_0xe294('0x1e')]=qs['limit'](_0x22fb3e['query'][_0xe294('0x1e')]);_0x60ab3[_0xe294('0x1b')]=qs['offset'](_0x22fb3e[_0xe294('0x30')]['offset']);}_0x60ab3[_0xe294('0x38')]=qs['sort'](_0x22fb3e[_0xe294('0x30')][_0xe294('0x39')]);_0x60ab3[_0xe294('0x3a')]=qs[_0xe294('0x32')](_[_0xe294('0x3b')](_0x22fb3e[_0xe294('0x30')],_0x637d6d[_0xe294('0x32')]),_0x21eafb);if(_0x22fb3e['query'][_0xe294('0x3c')]){_0x60ab3[_0xe294('0x3a')]=_[_0xe294('0x3d')](_0x60ab3[_0xe294('0x3a')],{'$or':_['map'](_0x21eafb,function(_0x1194dd){if(_0x1194dd[_0xe294('0x2d')]!==_0xe294('0x3e')){var _0x5bdbcc={};_0x5bdbcc[_0x1194dd[_0xe294('0x28')]]={'$like':'%'+_0x22fb3e[_0xe294('0x30')][_0xe294('0x3c')]+'%'};return _0x5bdbcc;}})});}_0x60ab3=_[_0xe294('0x3d')]({},_0x60ab3,_0x22fb3e[_0xe294('0x3f')]);var _0x251c93={'where':_0x60ab3[_0xe294('0x3a')]};return db[_0xe294('0x40')][_0xe294('0x1d')](_0x251c93)[_0xe294('0x24')](function(_0x1575d6){_0x446b80['count']=_0x1575d6;if(_0x22fb3e[_0xe294('0x30')][_0xe294('0x41')]){_0x60ab3['include']=[{'all':!![]}];}return db[_0xe294('0x40')][_0xe294('0x42')](_0x60ab3);})[_0xe294('0x24')](function(_0x53b543){_0x446b80[_0xe294('0x43')]=_0x53b543;return _0x446b80;})['then'](respondWithFilteredResult(_0x2689e6,_0x60ab3))[_0xe294('0x44')](handleError(_0x2689e6,null));};exports[_0xe294('0x45')]=function(_0x19d4fa,_0x52527b){var _0x53ca25={'raw':!![],'where':{'id':_0x19d4fa['params']['id']}},_0x2126e6={};_0x2126e6[_0xe294('0x2f')]=_[_0xe294('0x31')](db['SmsApplication'][_0xe294('0x2b')]);_0x2126e6[_0xe294('0x30')]=_[_0xe294('0x31')](_0x19d4fa[_0xe294('0x30')]);_0x2126e6['filters']=_[_0xe294('0x33')](_0x2126e6[_0xe294('0x2f')],_0x2126e6[_0xe294('0x30')]);_0x53ca25[_0xe294('0x35')]=_[_0xe294('0x33')](_0x2126e6[_0xe294('0x2f')],qs['fields'](_0x19d4fa[_0xe294('0x30')]['fields']));_0x53ca25[_0xe294('0x35')]=_0x53ca25[_0xe294('0x35')]['length']?_0x53ca25[_0xe294('0x35')]:_0x2126e6[_0xe294('0x2f')];if(_0x19d4fa[_0xe294('0x30')][_0xe294('0x41')]){_0x53ca25[_0xe294('0x46')]=[{'all':!![]}];}_0x53ca25=_[_0xe294('0x3d')]({},_0x53ca25,_0x19d4fa['options']);return db['SmsApplication']['find'](_0x53ca25)['then'](handleEntityNotFound(_0x52527b,null))[_0xe294('0x24')](respondWithResult(_0x52527b,null))[_0xe294('0x44')](handleError(_0x52527b,null));};exports[_0xe294('0x47')]=function(_0x1be52b,_0x38d409){return db[_0xe294('0x40')][_0xe294('0x47')](_0x1be52b[_0xe294('0x48')],{})['then'](respondWithResult(_0x38d409,0xc9))[_0xe294('0x44')](handleError(_0x38d409,null));};exports[_0xe294('0x49')]=function(_0x4e23fd,_0x353f60){if(_0x4e23fd[_0xe294('0x48')]['id']){delete _0x4e23fd['body']['id'];}return db[_0xe294('0x40')][_0xe294('0x4a')]({'where':{'id':_0x4e23fd[_0xe294('0x4b')]['id']}})[_0xe294('0x24')](handleEntityNotFound(_0x353f60,null))[_0xe294('0x24')](saveUpdates(_0x4e23fd[_0xe294('0x48')],null))['then'](respondWithResult(_0x353f60,null))[_0xe294('0x44')](handleError(_0x353f60,null));};exports[_0xe294('0x25')]=function(_0x326399,_0x5b9ac4){return db[_0xe294('0x40')]['find']({'where':{'id':_0x326399[_0xe294('0x4b')]['id']}})[_0xe294('0x24')](handleEntityNotFound(_0x5b9ac4,null))['then'](removeEntity(_0x5b9ac4,null))['catch'](handleError(_0x5b9ac4,null));};
\ No newline at end of file
index cc4822f..f80afb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x890e=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','SmsApplication'];(function(_0x5da841,_0x192e74){var _0x119ce7=function(_0x216f00){while(--_0x216f00){_0x5da841['push'](_0x5da841['shift']());}};_0x119ce7(++_0x192e74);}(_0x890e,0xce));var _0xe890=function(_0x18d0e7,_0x531fed){_0x18d0e7=_0x18d0e7-0x0;var _0xf4d32a=_0x890e[_0x18d0e7];return _0xf4d32a;};'use strict';var _=require(_0xe890('0x0'));var util=require(_0xe890('0x1'));var logger=require(_0xe890('0x2'))('api');var moment=require(_0xe890('0x3'));var BPromise=require(_0xe890('0x4'));var rp=require(_0xe890('0x5'));var fs=require('fs');var path=require(_0xe890('0x6'));var rimraf=require('rimraf');var config=require(_0xe890('0x7'));var attributes=require(_0xe890('0x8'));module['exports']=function(_0x2730f2,_0xc41221){return _0x2730f2['define'](_0xe890('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe890('0xa'),'collate':_0xe890('0xb')});};
\ No newline at end of file
+var _0x1f16=['exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x2ce39c,_0x283ea1){var _0x2f5c74=function(_0x40129a){while(--_0x40129a){_0x2ce39c['push'](_0x2ce39c['shift']());}};_0x2f5c74(++_0x283ea1);}(_0x1f16,0x190));var _0x61f1=function(_0xcbda08,_0x523f37){_0xcbda08=_0xcbda08-0x0;var _0x3f8713=_0x1f16[_0xcbda08];return _0x3f8713;};'use strict';var _=require(_0x61f1('0x0'));var util=require('util');var logger=require(_0x61f1('0x1'))(_0x61f1('0x2'));var moment=require('moment');var BPromise=require(_0x61f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61f1('0x4'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x61f1('0x5')]=function(_0x31ccf6,_0x16b91d){return _0x31ccf6['define'](_0x61f1('0x6'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61f1('0x7'),'collate':_0x61f1('0x8')});};
\ No newline at end of file
index d2779e1..1216915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x707d=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x456ce4,_0x57e3e9){var _0x2d929c=function(_0xdc57bc){while(--_0xdc57bc){_0x456ce4['push'](_0x456ce4['shift']());}};_0x2d929c(++_0x57e3e9);}(_0x707d,0x18b));var _0xd707=function(_0x40e5f9,_0x2f37f0){_0x40e5f9=_0x40e5f9-0x0;var _0x340312=_0x707d[_0x40e5f9];return _0x340312;};'use strict';var _=require(_0xd707('0x0'));var util=require(_0xd707('0x1'));var moment=require(_0xd707('0x2'));var BPromise=require(_0xd707('0x3'));var rs=require(_0xd707('0x4'));var fs=require('fs');var Redis=require(_0xd707('0x5'));var db=require(_0xd707('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd707('0x7'))(_0xd707('0x8'));var config=require(_0xd707('0x9'));var jayson=require(_0xd707('0xa'));var client=jayson['client'][_0xd707('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3de790,_0x5661e6,_0x4af63f){return new BPromise(function(_0xf596b4,_0x11edc8){return client['request'](_0x3de790,_0x4af63f)[_0xd707('0xc')](function(_0x249b0d){logger['info'](_0xd707('0xd'),_0x5661e6,_0xd707('0xe'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5661e6,_0xd707('0xe'),JSON[_0xd707('0xf')](_0x249b0d));if(_0x249b0d[_0xd707('0x10')]){if(_0x249b0d['error'][_0xd707('0x11')]===0x1f4){logger[_0xd707('0x10')](_0xd707('0xd'),_0x5661e6,_0x249b0d['error']['message']);return _0x11edc8(_0x249b0d[_0xd707('0x10')][_0xd707('0x12')]);}logger['error'](_0xd707('0xd'),_0x5661e6,_0x249b0d[_0xd707('0x10')]['message']);return _0xf596b4(_0x249b0d[_0xd707('0x10')][_0xd707('0x12')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5661e6,_0xd707('0xe'));_0xf596b4(_0x249b0d['result'][_0xd707('0x12')]);}})[_0xd707('0x13')](function(_0x479aea){logger[_0xd707('0x10')](_0xd707('0xd'),_0x5661e6,_0x479aea);_0x11edc8(_0x479aea);});});}
\ No newline at end of file
+var _0xd506=['catch','lodash','../../config/logger','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x264cc8,_0x47234c){var _0x4938ee=function(_0x26ac83){while(--_0x26ac83){_0x264cc8['push'](_0x264cc8['shift']());}};_0x4938ee(++_0x47234c);}(_0xd506,0x197));var _0x6d50=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xd506[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x6d50('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d50('0x1'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d50('0x2')][_0x6d50('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x1b0af3,_0x4cf512,_0x9565b6){return new BPromise(function(_0xce67b6,_0x2dacde){return client['request'](_0x1b0af3,_0x9565b6)[_0x6d50('0x4')](function(_0x5012ed){logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,_0x6d50('0x7'));logger[_0x6d50('0x8')](_0x6d50('0x9'),_0x4cf512,_0x6d50('0x7'),JSON['stringify'](_0x5012ed));if(_0x5012ed['error']){if(_0x5012ed['error'][_0x6d50('0xa')]===0x1f4){logger[_0x6d50('0xb')](_0x6d50('0x6'),_0x4cf512,_0x5012ed[_0x6d50('0xb')]['message']);return _0x2dacde(_0x5012ed[_0x6d50('0xb')]['message']);}logger[_0x6d50('0xb')]('SmsApplication,\x20%s,\x20%s',_0x4cf512,_0x5012ed['error']['message']);return _0xce67b6(_0x5012ed[_0x6d50('0xb')]['message']);}else{logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,'request\x20sent');_0xce67b6(_0x5012ed['result'][_0x6d50('0xc')]);}})[_0x6d50('0xd')](function(_0x38068e){logger['error'](_0x6d50('0x6'),_0x4cf512,_0x38068e);_0x2dacde(_0x38068e);});});}
\ No newline at end of file
index a37363b..0dbea84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['smsinteraction:update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','post','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x757a,0xde));var _0xa757=function(_0x41683b,_0xceda86){_0x41683b=_0x41683b-0x0;var _0xbb01d2=_0x757a[_0x41683b];return _0xbb01d2;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa757('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x12')),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x15')),controller['update']);router[_0xa757('0x16')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction['tracked']('sms',_0xa757('0x17')),controller[_0xa757('0x18')]);router[_0xa757('0x16')](_0xa757('0x19'),auth[_0xa757('0x9')](),controller[_0xa757('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x3c75db,_0x4ce47e){var _0x3f7c3a=function(_0x372e2c){while(--_0x372e2c){_0x3c75db['push'](_0x3c75db['shift']());}};_0x3f7c3a(++_0x4ce47e);}(_0x3c81,0x102));var _0x13c8=function(_0x2dc4a5,_0x2bd73d){_0x2dc4a5=_0x2dc4a5-0x0;var _0x1d858d=_0x3c81[_0x2dc4a5];return _0x1d858d;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router;
\ No newline at end of file
index 39cd7a3..d6dce70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda19=['ENUM','out','BOOLEAN','moment','exports','DATE','STRING'];(function(_0x4f8254,_0x3f5462){var _0x45b5f3=function(_0xd1ad2c){while(--_0xd1ad2c){_0x4f8254['push'](_0x4f8254['shift']());}};_0x45b5f3(++_0x3f5462);}(_0xda19,0xd5));var _0x9da1=function(_0x5f5a47,_0x763a98){_0x5f5a47=_0x5f5a47-0x0;var _0x21cfef=_0xda19[_0x5f5a47];return _0x21cfef;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9da1('0x0'));module[_0x9da1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9da1('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9da1('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9da1('0x3')]},'phone':{'type':Sequelize[_0x9da1('0x3')]},'read1stAt':{'type':Sequelize[_0x9da1('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9da1('0x4')]('in',_0x9da1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9da1('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9da1('0x4')]('in',_0x9da1('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9da1('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6011=['BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x6011,0x196));var _0x1601=function(_0x28199e,_0x4c7a5e){_0x28199e=_0x28199e-0x0;var _0xfd8d7a=_0x6011[_0x28199e];return _0xfd8d7a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1601('0x0')]},'secondDisposition':{'type':Sequelize[_0x1601('0x0')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1601('0x0')]},'phone':{'type':Sequelize[_0x1601('0x0')]},'read1stAt':{'type':Sequelize[_0x1601('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x1601('0x2')]('in',_0x1601('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1601('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x1601('0x2')]('in',_0x1601('0x3')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1601('0x4')],'defaultValue':![]}};
\ No newline at end of file
index b6486f8..4fe61f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe407=['rows','params','include','merge','options','create','describe','SmsMessage','ids','omit','findOne','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','findAll','emit','removeTags','download','unix','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','User','CmContact','lastName','Messages','direction','secret','SmsAccount','Owner','get','Account','N.A.','closed','closedAt','disposition','out','Contact','firstName','renderFile','views','transcript-','.pdf','Sms','log','err','unlinkSync','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','then','catch','SmsInteraction','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','color','tools_tags','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','all'];(function(_0x2bacc3,_0x2bd9f2){var _0x83ab9a=function(_0x1fe737){while(--_0x1fe737){_0x2bacc3['push'](_0x2bacc3['shift']());}};_0x83ab9a(++_0x2bd9f2);}(_0xe407,0x11c));var _0x7e40=function(_0xa32ed,_0x3f9f64){_0xa32ed=_0xa32ed-0x0;var _0x5d66fc=_0xe407[_0xa32ed];return _0x5d66fc;};'use strict';var emlformat=require(_0x7e40('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7e40('0x1'));var moment=require(_0x7e40('0x2'));var BPromise=require(_0x7e40('0x3'));var Mustache=require(_0x7e40('0x4'));var util=require('util');var path=require(_0x7e40('0x5'));var sox=require(_0x7e40('0x6'));var csv=require(_0x7e40('0x7'));var ejs=require(_0x7e40('0x8'));var fs=require('fs');var fs_extra=require(_0x7e40('0x9'));var _=require(_0x7e40('0xa'));var squel=require(_0x7e40('0xb'));var crypto=require('crypto');var jsforce=require(_0x7e40('0xc'));var deskjs=require(_0x7e40('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7e40('0xe'));var Papa=require(_0x7e40('0xf'));var Redis=require(_0x7e40('0x10'));var authService=require(_0x7e40('0x11'));var qs=require(_0x7e40('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x7e40('0x13'));var hardwareService=require(_0x7e40('0x14'));var logger=require('../../config/logger')(_0x7e40('0x15'));var utils=require(_0x7e40('0x16'));var config=require(_0x7e40('0x17'));var licenseUtil=require(_0x7e40('0x18'));var db=require('../../mysqldb')['db'];config[_0x7e40('0x19')]=_[_0x7e40('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e40('0x1b'))(new Redis(config[_0x7e40('0x19')]));require(_0x7e40('0x1c'))['register'](socket);function respondWithStatusCode(_0x1b36de,_0x523d7e){_0x523d7e=_0x523d7e||0xcc;return function(_0x4dbb87){if(_0x4dbb87){return _0x1b36de[_0x7e40('0x1d')](_0x523d7e);}return _0x1b36de[_0x7e40('0x1e')](_0x523d7e)[_0x7e40('0x1f')]();};}function respondWithResult(_0x4a2572,_0x681851){_0x681851=_0x681851||0xc8;return function(_0x28d4f3){if(_0x28d4f3){return _0x4a2572[_0x7e40('0x1e')](_0x681851)[_0x7e40('0x20')](_0x28d4f3);}};}function respondWithFilteredResult(_0x75e5ea,_0x19396a){return function(_0x36321b){if(_0x36321b){var _0x1c1f56=typeof _0x19396a['offset']===_0x7e40('0x21')&&typeof _0x19396a[_0x7e40('0x22')]===_0x7e40('0x21');var _0x2601b3=_0x36321b[_0x7e40('0x23')];var _0x5240ee=_0x1c1f56?0x0:_0x19396a[_0x7e40('0x24')];var _0x81d97a=_0x1c1f56?_0x36321b[_0x7e40('0x23')]:_0x19396a[_0x7e40('0x24')]+_0x19396a[_0x7e40('0x22')];var _0x19a25d;if(_0x81d97a>=_0x2601b3){_0x81d97a=_0x2601b3;_0x19a25d=0xc8;}else{_0x19a25d=0xce;}_0x75e5ea['status'](_0x19a25d);return _0x75e5ea[_0x7e40('0x25')](_0x7e40('0x26'),_0x5240ee+'-'+_0x81d97a+'/'+_0x2601b3)[_0x7e40('0x20')](_0x36321b);}return null;};}function patchUpdates(_0x592667){return function(_0x3f42a4){try{jsonpatch[_0x7e40('0x27')](_0x3f42a4,_0x592667,!![]);}catch(_0x43b2c5){return BPromise[_0x7e40('0x28')](_0x43b2c5);}return _0x3f42a4[_0x7e40('0x29')]();};}function saveUpdates(_0x4f036a,_0x19377c){return function(_0x58fc0b){if(_0x58fc0b){return _0x58fc0b[_0x7e40('0x2a')](_0x4f036a)['then'](function(_0x253115){return _0x253115;});}return null;};}function removeEntity(_0x3f63e6,_0x4ce526){return function(_0x58d71e){if(_0x58d71e){return _0x58d71e[_0x7e40('0x2b')]()['then'](function(){_0x3f63e6[_0x7e40('0x1e')](0xcc)[_0x7e40('0x1f')]();});}};}function handleEntityNotFound(_0x59e597,_0x368444){return function(_0x47925d){if(!_0x47925d){_0x59e597[_0x7e40('0x1d')](0x194);}return _0x47925d;};}function handleError(_0x310a15,_0xb9e9a5){_0xb9e9a5=_0xb9e9a5||0x1f4;return function(_0x3f51fa){logger[_0x7e40('0x2c')](_0x3f51fa[_0x7e40('0x2d')]);if(_0x3f51fa[_0x7e40('0x2e')]){delete _0x3f51fa[_0x7e40('0x2e')];}_0x310a15[_0x7e40('0x1e')](_0xb9e9a5)[_0x7e40('0x2f')](_0x3f51fa);};}function getInteractionUsers(_0x8624c6,_0x5946be){return new BPromise(function(_0xc9ad37,_0x1eaddf){try{if(_0x5946be[_0x8624c6['id']]){_0x8624c6[_0x7e40('0x30')]=_[_0x7e40('0x31')](_0x5946be[_0x8624c6['id']],function(_0x5f0f67){return{'id':_0x5f0f67['id'],'fullname':_0x5f0f67[_0x7e40('0x32')]};});}}catch(_0x4fc486){_0x1eaddf(_0x4fc486);}_0xc9ad37(_0x8624c6);});}function getInteractionTags(_0x44f9d5,_0x183766){return new BPromise(function(_0x4f01fd,_0x26934e){try{if(_0x44f9d5[_0x7e40('0x33')]){_0x44f9d5[_0x7e40('0x34')]=[];_0x44f9d5[_0x7e40('0x33')][_0x7e40('0x35')](',')[_0x7e40('0x36')](function(_0x472095){_0x44f9d5[_0x7e40('0x34')][_0x7e40('0x37')](_0x183766[_0x472095]);});}delete _0x44f9d5[_0x7e40('0x33')];}catch(_0x31fa82){_0x26934e(_0x31fa82);}_0x4f01fd(_0x44f9d5);});}function updateSmsInteraction(_0x149f19,_0x493d15,_0x4a0744){return new BPromise(function(_0x729a10,_0x3d41bd){return getInteractionUsers(_0x149f19,_0x4a0744)[_0x7e40('0x38')](function(_0x1513ec){return getInteractionTags(_0x1513ec,_0x493d15);})[_0x7e40('0x38')](function(_0x4fc975){_0x729a10(_0x4fc975);})[_0x7e40('0x39')](function(_0x58e5a7){_0x3d41bd(_0x58e5a7);});});}exports['index']=function(_0x3339d9,_0x263e8b){var _0x42601c={},_0x4c8590={},_0x51ed3a={'count':0x0,'rows':[]};var _0x55064d=_[_0x7e40('0x31')](db[_0x7e40('0x3a')][_0x7e40('0x3b')],function(_0x35ce12){return{'name':_0x35ce12[_0x7e40('0x3c')],'type':_0x35ce12[_0x7e40('0x3d')][_0x7e40('0x3e')]};});_0x4c8590[_0x7e40('0x3f')]=_[_0x7e40('0x31')](_0x55064d,_0x7e40('0x2e'));_0x4c8590[_0x7e40('0x40')]=_['keys'](_0x3339d9[_0x7e40('0x40')]);_0x4c8590['filters']=_[_0x7e40('0x41')](_0x4c8590[_0x7e40('0x3f')],_0x4c8590[_0x7e40('0x40')]);_0x42601c[_0x7e40('0x42')]=_['intersection'](_0x4c8590[_0x7e40('0x3f')],qs['fields'](_0x3339d9[_0x7e40('0x40')][_0x7e40('0x43')]));_0x42601c['attributes']=_0x42601c['attributes'][_0x7e40('0x44')]?_0x42601c[_0x7e40('0x42')]:_0x4c8590[_0x7e40('0x3f')];if(!_0x3339d9[_0x7e40('0x40')][_0x7e40('0x45')](_0x7e40('0x46'))){_0x42601c[_0x7e40('0x22')]=qs[_0x7e40('0x22')](_0x3339d9[_0x7e40('0x40')]['limit']);_0x42601c[_0x7e40('0x24')]=qs['offset'](_0x3339d9[_0x7e40('0x40')][_0x7e40('0x24')]);}_0x42601c[_0x7e40('0x47')]=qs[_0x7e40('0x48')](_0x3339d9['query'][_0x7e40('0x48')]);_0x42601c['where']=qs[_0x7e40('0x49')](_[_0x7e40('0x4a')](_0x3339d9[_0x7e40('0x40')],_0x4c8590[_0x7e40('0x49')]),_0x55064d);var _0x5420c4=[];var _0x1d1b6a=squel[_0x7e40('0x4b')]()[_0x7e40('0x4c')]('id')['field'](_0x7e40('0x2e'))[_0x7e40('0x4c')](_0x7e40('0x4d'))['from'](_0x7e40('0x4e'));var _0x50e68d=squel['select']()[_0x7e40('0x4c')]('u.id')['field'](_0x7e40('0x4f'))['field'](_0x7e40('0x50'))[_0x7e40('0x51')](_0x7e40('0x52'),'ui')[_0x7e40('0x53')]('users','u',_0x7e40('0x54'));var _0x1b1259=squel[_0x7e40('0x4b')]()[_0x7e40('0x51')]('sms_interactions','i')[_0x7e40('0x53')]('cm_contacts','c',_0x7e40('0x55'))['left_join']('users','o',_0x7e40('0x56'))[_0x7e40('0x53')](_0x7e40('0x57'),'a',_0x7e40('0x58'))[_0x7e40('0x53')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x7e40('0x53')](_0x7e40('0x59'),'it',_0x7e40('0x5a'))[_0x7e40('0x53')](_0x7e40('0x4e'),'t',_0x7e40('0x5b'));var _0xda2ad9=squel[_0x7e40('0x5c')]();var _0x362cc7=[];var _0x56bdf8=squel[_0x7e40('0x5c')]();var _0x48c208;if(_0x3339d9[_0x7e40('0x40')][_0x7e40('0x5d')]){_0x48c208=as[_0x7e40('0x5e')](_0x3339d9[_0x7e40('0x40')]['search']);var _0x50db86=_0x48c208[_0x7e40('0x5f')];for(var _0x494d38=0x0;_0x494d38<_0x48c208[_0x7e40('0x60')]['length'];_0x494d38++){var _0x380c9e=_0x48c208[_0x7e40('0x60')][_0x494d38];var _0x3cae64='i';var _0x10d376=_[_0x7e40('0x61')](_0x55064d,['name',_0x380c9e[_0x7e40('0x4c')]]);if(!_0x10d376){switch(_0x380c9e[_0x7e40('0x4c')]){case _0x7e40('0x62'):if(_0x380c9e['value']==0x1){_0x1b1259[_0x7e40('0x63')]('`'+_0x380c9e['field']+_0x7e40('0x64'));}else{_0x1b1259['having']('`'+_0x380c9e[_0x7e40('0x4c')]+_0x7e40('0x65'));}break;case'Contact':if(_0x380c9e[_0x7e40('0x66')]===_0x7e40('0x67')){if(_0x380c9e[_0x7e40('0x68')][_0x7e40('0x35')]('\x20')[_0x7e40('0x44')]>0x1){_0xda2ad9[_0x50db86]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7e40('0x69')](_0x380c9e['value']),null);}else{var _0x14d169='%'+_0x380c9e[_0x7e40('0x68')]+'%';_0xda2ad9[_0x50db86](_0x7e40('0x6a'),_0x14d169,_0x14d169,_0x14d169);}}else{_0x10d376=_['find'](_0x55064d,[_0x7e40('0x2e'),_0x7e40('0x6b')]);_0x380c9e[_0x7e40('0x4c')]=_0x7e40('0x6b');_0x7b957a=as[_0x7e40('0x6c')](_0x3cae64,_0x10d376[_0x7e40('0x3d')],_0x380c9e);_0xda2ad9[_0x50db86](_0x7b957a[_0x7e40('0x6d')],_0x7b957a[_0x7e40('0x68')]['start'],_0x7b957a[_0x7e40('0x68')][_0x7e40('0x1f')]);}break;case _0x7e40('0x6e'):var _0x1a1d14=_0x380c9e['value'][_0x7e40('0x35')](',')['map'](function(_0x34c87a){return Number(_0x34c87a);});_0x1a1d14[_0x7e40('0x36')](function(_0x11e630){_0x56bdf8['or'](_0x7e40('0x6f'),'%,'+_0x11e630+',%');});_0x362cc7=_[_0x7e40('0x70')](_0x362cc7,_0x1a1d14);break;case'User':if(_0x380c9e[_0x7e40('0x66')]==='$substring'){_0xda2ad9[_0x50db86](_0x7e40('0x71'),'%'+_0x380c9e['value']+'%',null);}else{_0x10d376=_[_0x7e40('0x61')](_0x55064d,[_0x7e40('0x2e'),_0x7e40('0x72')]);_0x380c9e[_0x7e40('0x4c')]='UserId';_0x7b957a=as[_0x7e40('0x6c')](_0x3cae64,_0x10d376[_0x7e40('0x3d')],_0x380c9e);_0xda2ad9[_0x50db86](_0x7b957a['text'],_0x7b957a[_0x7e40('0x68')][_0x7e40('0x73')],_0x7b957a['value'][_0x7e40('0x1f')]);}break;case _0x7e40('0x74'):_0x7b957a=as[_0x7e40('0x6c')]('me',null,_0x380c9e);_0xda2ad9[_0x50db86](_0x7b957a[_0x7e40('0x6d')],_0x7b957a[_0x7e40('0x68')][_0x7e40('0x73')],_0x7b957a[_0x7e40('0x68')]['end']);break;}}else{var _0x7b957a=as[_0x7e40('0x6c')](_0x3cae64,_0x10d376[_0x7e40('0x3d')],_0x380c9e);_0xda2ad9[_0x50db86](_0x7b957a[_0x7e40('0x6d')],_0x7b957a[_0x7e40('0x68')][_0x7e40('0x73')],_0x7b957a['value']['end']);}}}else{var _0x80df46=_(_0x3339d9[_0x7e40('0x40')])[_0x7e40('0x75')]()[_0x7e40('0x31')](function(_0x5ba11b){return _[_0x7e40('0x76')](_0x55064d,['name',_0x5ba11b])?_0x5ba11b:undefined;})[_0x7e40('0x77')]()[_0x7e40('0x68')]();if(!_[_0x7e40('0x78')](_0x80df46)){_0x80df46[_0x7e40('0x36')](function(_0x12370e){if(_0x12370e===_0x7e40('0x79')){_0x1b1259['where'](_0x7e40('0x7a'),[][_0x7e40('0x7b')](_0x3339d9['query'][_0x12370e]));}else if(_0x12370e===_0x7e40('0x7c')){var _0x223e0c=JSON['parse'](_0x3339d9['query'][_0x12370e])[_0x7e40('0x7d')];var _0x2b33e9=JSON[_0x7e40('0x7e')](_0x3339d9[_0x7e40('0x40')][_0x12370e])[_0x7e40('0x7f')];_0x1b1259[_0x7e40('0x80')](_0x7e40('0x81'),_0x223e0c,_0x2b33e9);}else{if(_0x3339d9[_0x7e40('0x40')][_0x12370e]===_0x7e40('0x82')){_0x1b1259[_0x7e40('0x80')]('i.'+_0x12370e+_0x7e40('0x83'));}else{_0x1b1259[_0x7e40('0x80')]('i.'+_0x12370e+'\x20=\x20?',_0x3339d9[_0x7e40('0x40')][_0x12370e]);}}});}if(_0x3339d9['query'][_0x7e40('0x84')]){if(_0x3339d9[_0x7e40('0x40')][_0x7e40('0x84')]==0x1){_0x1b1259['having']('`unreadMessages`\x20=\x200');}else{_0x1b1259[_0x7e40('0x63')](_0x7e40('0x85'));}}if(_0x3339d9[_0x7e40('0x40')][_0x7e40('0x86')]){_0x362cc7=_[_0x7e40('0x87')](_0x3339d9[_0x7e40('0x40')][_0x7e40('0x86')])?_0x3339d9[_0x7e40('0x40')]['tag']:new Array(_0x3339d9[_0x7e40('0x40')][_0x7e40('0x86')]);_0x362cc7[_0x7e40('0x36')](function(_0x2d1704){_0x56bdf8['or'](_0x7e40('0x6f'),'%,'+_0x2d1704+',%');});}if(_0x3339d9[_0x7e40('0x40')][_0x7e40('0x88')]){var _0x3d9382=_0x3339d9[_0x7e40('0x40')]['filter'][_0x7e40('0x89')]('\x5c','\x5c\x5c')[_0x7e40('0x89')](/'/g,'\x27\x27');if(qs[_0x7e40('0x8a')](_0x3d9382)){_0xda2ad9['or'](_0x7e40('0x8b'),_0x3d9382+'%')['or'](_0x7e40('0x8c'),_0x3d9382+'%');}else{_0xda2ad9['or'](_0x7e40('0x8d'),qs[_0x7e40('0x69')](_0x3d9382))['or'](_0x7e40('0x8e'),_0x3d9382+'%');}}}_0x1b1259[_0x7e40('0x80')](_0xda2ad9);_0x1b1259[_0x7e40('0x8f')]('i.id');var _0x4e89f4={'type':db[_0x7e40('0x90')][_0x7e40('0x91')][_0x7e40('0x92')],'raw':!![]};var _0x456093=_0x1b1259[_0x7e40('0x93')]();_0x456093[_0x7e40('0x4c')]('i.id');_0x456093['field'](_0x7e40('0x94'),_0x7e40('0x62'));if(_0x42601c[_0x7e40('0x47')]){_0x42601c['order'][_0x7e40('0x36')](function(_0x3c353e){var _0x23ca16=_0x3c353e[0x0]===_0x7e40('0x95')?_0x3c353e[0x0]:'i.'+_0x3c353e[0x0];_0x1b1259[_0x7e40('0x47')](_0x23ca16,_0x3c353e[0x1]===_0x7e40('0x96')?![]:!![]);});}if(!_[_0x7e40('0x78')](_0x362cc7)){_0x1b1259['having'](_0x56bdf8);_0x456093[_0x7e40('0x80')]('t.id\x20IN\x20?',_0x362cc7);}BPromise['resolve']()[_0x7e40('0x38')](function(){if(!_0x48c208){if(_0x3339d9[_0x7e40('0x40')][_0x7e40('0x79')])return;_0x456093['where'](_0x7e40('0x97'));_0x1b1259[_0x7e40('0x80')](_0x7e40('0x97'));return;}if(_0x3339d9[_0x7e40('0x98')][_0x7e40('0x99')]!=='agent')return;return _0x3339d9[_0x7e40('0x98')][_0x7e40('0x9a')]({'attributes':['id'],'raw':!![]})[_0x7e40('0x38')](function(_0x434037){if(_[_0x7e40('0x78')](_0x434037)){_0x456093[_0x7e40('0x80')](_0x7e40('0x9b'));_0x1b1259['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x456093[_0x7e40('0x80')](_0x7e40('0x7a'),_[_0x7e40('0x31')](_0x434037,'id'));_0x1b1259['where'](_0x7e40('0x7a'),_['map'](_0x434037,'id'));}});})['then'](function(){if(_0x3339d9[_0x7e40('0x98')][_0x7e40('0x99')]==='agent'&&!_0x48c208&&!_0x3339d9[_0x7e40('0x40')][_0x7e40('0x79')])return[];return db[_0x7e40('0x9c')][_0x7e40('0x40')](_0x456093['toString'](),_0x4e89f4);})[_0x7e40('0x38')](function(_0x201b43){_0x51ed3a['count']=_0x201b43[_0x7e40('0x44')];if(_0x51ed3a['count']===0x0)return[];return db[_0x7e40('0x9c')]['query'](_0x1d1b6a[_0x7e40('0x9d')](),_0x4e89f4)[_0x7e40('0x38')](function(_0x4e4892){_0x5420c4=_[_0x7e40('0x9e')](_0x4e4892,'id');_0x4e89f4=_['merge'](_0x4e89f4,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3339d9['query'][_0x7e40('0x43')]){_0x42601c['attributes'][_0x7e40('0x36')](function(_0x1aee91){_0x1b1259[_0x7e40('0x4c')]('i.'+_0x1aee91);});}else{_0x1b1259['field'](_0x7e40('0x94'),_0x7e40('0x62'));_0x1b1259['field'](_0x7e40('0x9f'),_0x7e40('0xa0'));_0x1b1259[_0x7e40('0x4c')](_0x7e40('0xa1'),_0x7e40('0xa2'));_0x1b1259[_0x7e40('0x4c')](_0x7e40('0xa3'),_0x7e40('0x95'));_0x1b1259['field'](_0x7e40('0xa4'));_0x1b1259[_0x7e40('0x4c')](_0x7e40('0xa5'),_0x7e40('0xa6'));_0x1b1259[_0x7e40('0x4c')](_0x7e40('0xa7'),_0x7e40('0xa8'));_0x1b1259['field']('c.email','Contact.email');_0x1b1259[_0x7e40('0x4c')](_0x7e40('0xa9'),_0x7e40('0xaa'));_0x1b1259['field']('c.mobile',_0x7e40('0xab'));_0x1b1259[_0x7e40('0x4c')]('c.fax','Contact.fax');_0x1b1259[_0x7e40('0x4c')](_0x7e40('0xac'),_0x7e40('0xad'));_0x1b1259[_0x7e40('0x4c')](_0x7e40('0xae'),_0x7e40('0xaf'));_0x1b1259['field'](_0x7e40('0xb0'),_0x7e40('0x33'));}if(_0x42601c[_0x7e40('0x22')])_0x1b1259[_0x7e40('0x22')](_0x42601c[_0x7e40('0x22')]);if(_0x42601c[_0x7e40('0x24')])_0x1b1259[_0x7e40('0x24')](_0x42601c['offset']);return db[_0x7e40('0x9c')][_0x7e40('0x40')](_0x1b1259['toString'](),_0x4e89f4);})[_0x7e40('0x38')](function(_0x16d26){if(_0x16d26['length']>0x0)_0x50e68d[_0x7e40('0x80')]('ui.SmsInteractionId\x20IN\x20?',_[_0x7e40('0x31')](_0x16d26,'id'));return db[_0x7e40('0x9c')][_0x7e40('0x40')](_0x50e68d[_0x7e40('0x9d')](),_0x4e89f4)['then'](function(_0x3f794a){var _0x218783=_['groupBy'](_0x3f794a,'SmsInteractionId');var _0x56880e=[];_0x16d26['forEach'](function(_0x2c0e9f){_0x56880e[_0x7e40('0x37')](updateSmsInteraction(_0x2c0e9f,_0x5420c4,_0x218783));});return BPromise[_0x7e40('0xb1')](_0x56880e);});});})['then'](function(_0x9f2d08){_0x51ed3a[_0x7e40('0xb2')]=_0x9f2d08;return _0x51ed3a;})[_0x7e40('0x38')](respondWithFilteredResult(_0x263e8b,_0x42601c))[_0x7e40('0x39')](handleError(_0x263e8b,null));};exports['show']=function(_0x1c353c,_0x129c0d){var _0x5e3c53={'raw':![],'where':{'id':_0x1c353c[_0x7e40('0xb3')]['id']}},_0x278f38={};_0x278f38['model']=_['keys'](db[_0x7e40('0x3a')][_0x7e40('0x3b')]);_0x278f38[_0x7e40('0x40')]=_[_0x7e40('0x75')](_0x1c353c['query']);_0x278f38[_0x7e40('0x49')]=_[_0x7e40('0x41')](_0x278f38[_0x7e40('0x3f')],_0x278f38[_0x7e40('0x40')]);_0x5e3c53[_0x7e40('0x42')]=_[_0x7e40('0x41')](_0x278f38['model'],qs[_0x7e40('0x43')](_0x1c353c[_0x7e40('0x40')][_0x7e40('0x43')]));_0x5e3c53[_0x7e40('0x42')]=_0x5e3c53[_0x7e40('0x42')]['length']?_0x5e3c53[_0x7e40('0x42')]:_0x278f38['model'];if(_0x1c353c[_0x7e40('0x40')]['includeAll']){_0x5e3c53[_0x7e40('0xb4')]=[{'all':!![]}];}_0x5e3c53=_[_0x7e40('0xb5')]({},_0x5e3c53,_0x1c353c[_0x7e40('0xb6')]);return db[_0x7e40('0x3a')][_0x7e40('0x61')](_0x5e3c53)[_0x7e40('0x38')](handleEntityNotFound(_0x129c0d,null))['then'](respondWithResult(_0x129c0d,null))[_0x7e40('0x39')](handleError(_0x129c0d,null));};exports[_0x7e40('0xb7')]=function(_0x3ce10a,_0x43ee31){return db['SmsInteraction'][_0x7e40('0xb7')](_0x3ce10a[_0x7e40('0x74')],{})[_0x7e40('0x38')](respondWithResult(_0x43ee31,0xc9))[_0x7e40('0x39')](handleError(_0x43ee31,null));};exports[_0x7e40('0x2a')]=function(_0x43ab8b,_0x18d3bc){if(_0x43ab8b['body']['id']){delete _0x43ab8b[_0x7e40('0x74')]['id'];}return db[_0x7e40('0x3a')]['find']({'where':{'id':_0x43ab8b['params']['id']}})['then'](handleEntityNotFound(_0x18d3bc,null))[_0x7e40('0x38')](saveUpdates(_0x43ab8b[_0x7e40('0x74')],null))[_0x7e40('0x38')](respondWithResult(_0x18d3bc,null))[_0x7e40('0x39')](handleError(_0x18d3bc,null));};exports[_0x7e40('0x2b')]=function(_0x2e6a25,_0xff3961){return db[_0x7e40('0x3a')][_0x7e40('0x61')]({'where':{'id':_0x2e6a25[_0x7e40('0xb3')]['id']}})[_0x7e40('0x38')](handleEntityNotFound(_0xff3961,null))['then'](removeEntity(_0xff3961,null))[_0x7e40('0x39')](handleError(_0xff3961,null));};exports[_0x7e40('0xb8')]=function(_0x304848,_0x331ed9){return db[_0x7e40('0x3a')]['describe']()[_0x7e40('0x38')](respondWithResult(_0x331ed9,null))['catch'](handleError(_0x331ed9,null));};exports['addMessage']=function(_0x12b42e,_0x3d9ece,_0x520e4a){return db[_0x7e40('0xb9')][_0x7e40('0x61')]({'where':{'id':_0x12b42e[_0x7e40('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3d9ece,null))[_0x7e40('0x38')](function(_0x43db21){if(_0x43db21){return _0x43db21['addMessage'](_0x12b42e[_0x7e40('0x74')][_0x7e40('0xba')],_[_0x7e40('0xbb')](_0x12b42e[_0x7e40('0x74')],[_0x7e40('0xba'),'id'])||{});}})[_0x7e40('0x38')](respondWithResult(_0x3d9ece,null))[_0x7e40('0x39')](handleError(_0x3d9ece,null));};exports['getMessages']=function(_0x4de2bb,_0x5440ff,_0x4937e6){var _0x56f290={'raw':![],'where':{}};var _0x164898={};var _0x1b15f9={'count':0x0,'rows':[]};return db[_0x7e40('0x3a')][_0x7e40('0xbc')]({'where':{'id':_0x4de2bb[_0x7e40('0xb3')]['id']}})[_0x7e40('0x38')](handleEntityNotFound(_0x5440ff,null))[_0x7e40('0x38')](function(_0xbf20f2){if(_0xbf20f2){_0x164898[_0x7e40('0x3f')]=_[_0x7e40('0x75')](db[_0x7e40('0xb9')]['rawAttributes']);_0x164898['query']=_[_0x7e40('0x75')](_0x4de2bb[_0x7e40('0x40')]);_0x164898[_0x7e40('0x49')]=_[_0x7e40('0x41')](_0x164898[_0x7e40('0x3f')],_0x164898[_0x7e40('0x40')]);_0x56f290['attributes']=_[_0x7e40('0x41')](_0x164898['model'],qs[_0x7e40('0x43')](_0x4de2bb[_0x7e40('0x40')][_0x7e40('0x43')]));_0x56f290[_0x7e40('0x42')]=_0x56f290['attributes']['length']?_0x56f290[_0x7e40('0x42')]:_0x164898['model'];if(!_0x4de2bb[_0x7e40('0x40')][_0x7e40('0x45')](_0x7e40('0x46'))){_0x56f290[_0x7e40('0x22')]=qs[_0x7e40('0x22')](_0x4de2bb['query'][_0x7e40('0x22')]);_0x56f290[_0x7e40('0x24')]=qs[_0x7e40('0x24')](_0x4de2bb[_0x7e40('0x40')][_0x7e40('0x24')]);}_0x56f290[_0x7e40('0x47')]=qs[_0x7e40('0x48')](_0x4de2bb['query'][_0x7e40('0x48')]);_0x56f290[_0x7e40('0x80')]=qs[_0x7e40('0x49')](_['pick'](_0x4de2bb[_0x7e40('0x40')],_0x164898[_0x7e40('0x49')]));_0x56f290[_0x7e40('0x80')][_0x7e40('0xbd')]=_0xbf20f2['id'];if(_0x4de2bb[_0x7e40('0x40')]['filter']){_0x56f290[_0x7e40('0x80')]=_[_0x7e40('0xb5')](_0x56f290[_0x7e40('0x80')],{'$or':_[_0x7e40('0x31')](_0x56f290[_0x7e40('0x42')],function(_0x61e56a){var _0x34618a={};_0x34618a[_0x61e56a]={'$like':'%'+_0x4de2bb[_0x7e40('0x40')][_0x7e40('0x88')]+'%'};return _0x34618a;})});}if(_0x4de2bb[_0x7e40('0x40')][_0x7e40('0x7d')]){var _0x22ef28=_0x4de2bb[_0x7e40('0x40')]['$gte'][_0x7e40('0x35')](',');var _0x5401e2={};_0x5401e2[_0x22ef28[0x0]]={'$gte':moment(_0x22ef28[0x1])['format'](_0x7e40('0xbe'))};_0x56f290[_0x7e40('0x80')]=_['merge'](_0x56f290[_0x7e40('0x80')],_0x5401e2);}_0x56f290=_[_0x7e40('0xb5')]({},_0x56f290,_0x4de2bb[_0x7e40('0xb6')]);return db[_0x7e40('0xb9')]['count']({'where':_0x56f290[_0x7e40('0x80')]})[_0x7e40('0x38')](function(_0x29cea1){_0x1b15f9[_0x7e40('0x23')]=_0x29cea1;if(_0x4de2bb[_0x7e40('0x40')]['includeAll']){_0x56f290['include']=[{'all':!![]}];}return db[_0x7e40('0xb9')]['findAll'](_0x56f290);})[_0x7e40('0x38')](function(_0x3eab0f){_0x1b15f9[_0x7e40('0xb2')]=_0x3eab0f;return _0x1b15f9;});}})['then'](respondWithFilteredResult(_0x5440ff,_0x56f290))[_0x7e40('0x39')](handleError(_0x5440ff,null));};exports[_0x7e40('0xbf')]=function(_0x504c66,_0x4b80b4,_0x319656){return db[_0x7e40('0x3a')][_0x7e40('0x61')]({'where':{'id':_0x504c66[_0x7e40('0xb3')]['id']}})[_0x7e40('0x38')](handleEntityNotFound(_0x4b80b4,null))['then'](function(_0x11393d){if(_0x11393d){return _0x11393d['setTags'](_0x504c66[_0x7e40('0x74')]['ids'],_[_0x7e40('0xbb')](_0x504c66[_0x7e40('0x74')],['ids','id'])||{})[_0x7e40('0xc0')](function(){return db['Tag'][_0x7e40('0xc1')]({'attributes':['id',_0x7e40('0x2e'),'color'],'where':{'id':_0x504c66[_0x7e40('0x74')][_0x7e40('0xba')]}});})[_0x7e40('0x38')](function(_0x3b21f4){socket[_0x7e40('0xc2')]('smsInteractionTags:save',{'id':Number(_0x504c66[_0x7e40('0xb3')]['id']),'tags':_0x3b21f4||[]});return{'id':Number(_0x504c66['params']['id']),'tags':_0x3b21f4||[]};});}})[_0x7e40('0x38')](respondWithResult(_0x4b80b4,null))[_0x7e40('0x39')](handleError(_0x4b80b4,null));};exports[_0x7e40('0xc3')]=function(_0x45c300,_0x14beb6,_0xbeb710){return db[_0x7e40('0x3a')]['find']({'where':{'id':_0x45c300['params']['id']}})['then'](handleEntityNotFound(_0x14beb6,null))[_0x7e40('0x38')](function(_0x2bcae3){if(_0x2bcae3){return _0x2bcae3[_0x7e40('0xc3')](_0x45c300[_0x7e40('0x40')]['ids']);}})[_0x7e40('0x38')](respondWithStatusCode(_0x14beb6,null))[_0x7e40('0x39')](handleError(_0x14beb6,null));};exports[_0x7e40('0xc4')]=function(_0x23de2f,_0x238043){var _0x47692d=moment()[_0x7e40('0xc5')]()['toString']();var _0x779a0c=path[_0x7e40('0xc6')](config[_0x7e40('0xc7')],'server',_0x7e40('0xc8'),_0x7e40('0xc9'));var _0x22cae7=path['join'](config[_0x7e40('0xc7')],_0x7e40('0xca'),_0x7e40('0xc8'),_0x7e40('0xcb'));var _0x3dc6f7=path['join'](_0x779a0c,_0x47692d);var _0x4655b9=util[_0x7e40('0xcc')](_0x7e40('0xcd'),_0x23de2f[_0x7e40('0xb3')]['id'],_0x47692d);var _0x54a262=path[_0x7e40('0xc6')](_0x779a0c,_0x4655b9);var _0xc539ea=[];_0xc539ea[_0x7e40('0x37')]({'model':db[_0x7e40('0xce')],'as':_0x7e40('0xce'),'attributes':['id',_0x7e40('0x32')],'raw':!![]});_0xc539ea[_0x7e40('0x37')]({'model':db[_0x7e40('0xcf')],'as':'Contact','attributes':['id','firstName',_0x7e40('0xd0')],'raw':!![]});var _0x2f0198=[{'model':db[_0x7e40('0xb9')],'as':_0x7e40('0xd1'),'attributes':['id',_0x7e40('0x74'),_0x7e40('0x7c'),_0x7e40('0xd2'),_0x7e40('0xd3'),'read'],'include':_0xc539ea}];_0x2f0198[_0x7e40('0x37')]({'model':db[_0x7e40('0xd4')],'as':'Account','attributes':['id',_0x7e40('0x2e')]});_0x2f0198[_0x7e40('0x37')]({'model':db['User'],'as':_0x7e40('0xd5'),'attributes':['id',_0x7e40('0x32')]});return db[_0x7e40('0x3a')][_0x7e40('0x61')]({'where':{'id':_0x23de2f['params']['id']},'include':_0x2f0198})[_0x7e40('0x38')](handleEntityNotFound(_0x238043,null))[_0x7e40('0x38')](function(_0x165380){if(_0x165380){var _0x47ca06=_0x165380[_0x7e40('0xd6')]({'plain':!![]});fs['mkdirSync'](_0x3dc6f7);var _0x507a40={'channel':'Sms','account':_0x47ca06[_0x7e40('0xd7')][_0x7e40('0x2e')],'agent':_0x47ca06[_0x7e40('0xd5')]?_0x47ca06[_0x7e40('0xd5')][_0x7e40('0x32')]:_0x7e40('0xd8'),'createdAt':moment(_0x47ca06['createdAt'])[_0x7e40('0xcc')](_0x7e40('0xbe'))['toString'](),'closedAt':_0x47ca06[_0x7e40('0xd9')]?moment(_0x47ca06[_0x7e40('0xda')])[_0x7e40('0xcc')](_0x7e40('0xbe'))[_0x7e40('0x9d')]():'','disposition':_0x47ca06[_0x7e40('0xdb')],'messages':_(_0x47ca06[_0x7e40('0xd1')])['filter']({'secret':![]})[_0x7e40('0x31')](function(_0x58999d){return{'date':moment(_0x58999d['createdAt'])[_0x7e40('0xcc')](_0x7e40('0xbe'))[_0x7e40('0x9d')](),'sender':_0x58999d[_0x7e40('0xd2')]===_0x7e40('0xdc')?_0x58999d['User']?_0x58999d[_0x7e40('0xce')]['fullname']:'System':_0x58999d[_0x7e40('0xdd')][_0x7e40('0xde')]+(_0x58999d[_0x7e40('0xdd')]['lastName']?'\x20'+_0x58999d[_0x7e40('0xdd')]['lastName']:''),'body':_0x58999d[_0x7e40('0x74')],'direction':_0x58999d[_0x7e40('0xd2')]==='out'?'A':'C','secret':_0x58999d[_0x7e40('0xd3')],'read':_0x58999d[_0x7e40('0x84')]};})['value']()};return ejs[_0x7e40('0xdf')](path[_0x7e40('0xc6')](config[_0x7e40('0xc7')],'server',_0x7e40('0xe0'),'downloadInteraction.ejs'),{'interaction':_0x507a40})[_0x7e40('0x38')](function(_0xbfb65c){var _0x2a2237=path[_0x7e40('0xc6')](_0x3dc6f7,_0x7e40('0xe1')+_0x47ca06['id']+'-'+_0x47692d+_0x7e40('0xe2'));var _0x1608b7={'path':_0x2a2237,'channel':_0x7e40('0xe3'),'interactionId':_0x47ca06['id']};return pdf['createPdfFromHTML'](_0xbfb65c,_0x1608b7);})[_0x7e40('0x38')](function(){return new BPromise(function(_0x26fb3d,_0x22fb6f){zipdir(_0x3dc6f7,{'saveTo':_0x54a262},function(_0x5e5719,_0x3f03c0){if(_0x5e5719)return _0x22fb6f(_0x5e5719);return _0x26fb3d(_0x3f03c0);});})[_0x7e40('0x38')](function(){return new BPromise(function(_0x351146,_0x4a166f){rimraf(_0x3dc6f7,function(_0x110308){if(_0x110308)_0x4a166f(_0x110308);return _0x351146();});});})['then'](function(){return _0x238043[_0x7e40('0xc4')](_0x54a262,_0x4655b9,function(_0xfcc2c9){if(_0xfcc2c9){console[_0x7e40('0xe4')](_0x7e40('0xe5'),_0xfcc2c9);}else{fs[_0x7e40('0xe6')](_0x54a262);}});});});}else{return _0x238043[_0x7e40('0x1d')](0xc8);}})[_0x7e40('0x39')](handleError(_0x238043,null));};
\ No newline at end of file
+var _0x6867=['unlinkSync','rimraf','zip-dir','moment','bluebird','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','error','name','send','Users','TagIds','Tags','split','push','then','catch','index','map','SmsInteraction','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','forEach','union','User','$substring','UserId','start','some','compact','isEmpty','SmsAccountId','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','i.id','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','role','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','show','params','rawAttributes','includeAll','include','options','create','body','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','findAll','emit','removeTags','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','fullname','Contact','lastName','createdAt','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt','Messages','out','System','firstName','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','download','log','err'];(function(_0x56d407,_0x472e3d){var _0x50619b=function(_0x4f6105){while(--_0x4f6105){_0x56d407['push'](_0x56d407['shift']());}};_0x50619b(++_0x472e3d);}(_0x6867,0x1b5));var _0x7686=function(_0x13e4d6,_0x4d647f){_0x13e4d6=_0x13e4d6-0x0;var _0x395c06=_0x6867[_0x13e4d6];return _0x395c06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7686('0x0'));var zipdir=require(_0x7686('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7686('0x2'));var BPromise=require(_0x7686('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7686('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7686('0x5'));var crypto=require(_0x7686('0x6'));var jsforce=require(_0x7686('0x7'));var deskjs=require(_0x7686('0x8'));var toCsv=require('to-csv');var querystring=require(_0x7686('0x9'));var Papa=require(_0x7686('0xa'));var Redis=require(_0x7686('0xb'));var authService=require(_0x7686('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x7686('0xd'));var hardwareService=require(_0x7686('0xe'));var logger=require(_0x7686('0xf'))(_0x7686('0x10'));var utils=require(_0x7686('0x11'));var config=require(_0x7686('0x12'));var licenseUtil=require(_0x7686('0x13'));var db=require(_0x7686('0x14'))['db'];config[_0x7686('0x15')]=_[_0x7686('0x16')](config[_0x7686('0x15')],{'host':_0x7686('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7686('0x15')]));require(_0x7686('0x18'))[_0x7686('0x19')](socket);function respondWithStatusCode(_0x1298fd,_0xb5dbbe){_0xb5dbbe=_0xb5dbbe||0xcc;return function(_0x4b4a93){if(_0x4b4a93){return _0x1298fd[_0x7686('0x1a')](_0xb5dbbe);}return _0x1298fd[_0x7686('0x1b')](_0xb5dbbe)[_0x7686('0x1c')]();};}function respondWithResult(_0x53cfbe,_0x555187){_0x555187=_0x555187||0xc8;return function(_0x43e73e){if(_0x43e73e){return _0x53cfbe['status'](_0x555187)[_0x7686('0x1d')](_0x43e73e);}};}function respondWithFilteredResult(_0xedf529,_0x9bfe17){return function(_0x4dac0e){if(_0x4dac0e){var _0x99fc16=typeof _0x9bfe17[_0x7686('0x1e')]==='undefined'&&typeof _0x9bfe17[_0x7686('0x1f')]===_0x7686('0x20');var _0x3e7d22=_0x4dac0e[_0x7686('0x21')];var _0x5ea9f3=_0x99fc16?0x0:_0x9bfe17[_0x7686('0x1e')];var _0xd095a6=_0x99fc16?_0x4dac0e[_0x7686('0x21')]:_0x9bfe17[_0x7686('0x1e')]+_0x9bfe17[_0x7686('0x1f')];var _0x18635f;if(_0xd095a6>=_0x3e7d22){_0xd095a6=_0x3e7d22;_0x18635f=0xc8;}else{_0x18635f=0xce;}_0xedf529[_0x7686('0x1b')](_0x18635f);return _0xedf529['set'](_0x7686('0x22'),_0x5ea9f3+'-'+_0xd095a6+'/'+_0x3e7d22)[_0x7686('0x1d')](_0x4dac0e);}return null;};}function patchUpdates(_0x3de4c6){return function(_0x359c99){try{jsonpatch[_0x7686('0x23')](_0x359c99,_0x3de4c6,!![]);}catch(_0x2e56f4){return BPromise['reject'](_0x2e56f4);}return _0x359c99[_0x7686('0x24')]();};}function saveUpdates(_0x2eb7eb,_0x4fb463){return function(_0x20b036){if(_0x20b036){return _0x20b036[_0x7686('0x25')](_0x2eb7eb)['then'](function(_0x41446a){return _0x41446a;});}return null;};}function removeEntity(_0x2fe4b8,_0x4f54b0){return function(_0x147846){if(_0x147846){return _0x147846[_0x7686('0x26')]()['then'](function(){_0x2fe4b8[_0x7686('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24f4ee,_0x193472){return function(_0x40cc21){if(!_0x40cc21){_0x24f4ee[_0x7686('0x1a')](0x194);}return _0x40cc21;};}function handleError(_0x23851b,_0x1404d3){_0x1404d3=_0x1404d3||0x1f4;return function(_0xbd948a){logger[_0x7686('0x27')](_0xbd948a['stack']);if(_0xbd948a[_0x7686('0x28')]){delete _0xbd948a[_0x7686('0x28')];}_0x23851b['status'](_0x1404d3)[_0x7686('0x29')](_0xbd948a);};}function getInteractionUsers(_0x24320c,_0x3f6b97){return new BPromise(function(_0x1ec1ba,_0x5ca0fe){try{if(_0x3f6b97[_0x24320c['id']]){_0x24320c[_0x7686('0x2a')]=_['map'](_0x3f6b97[_0x24320c['id']],function(_0x3be683){return{'id':_0x3be683['id'],'fullname':_0x3be683['fullname']};});}}catch(_0x49f5e8){_0x5ca0fe(_0x49f5e8);}_0x1ec1ba(_0x24320c);});}function getInteractionTags(_0x32a768,_0x2b17d5){return new BPromise(function(_0x2976a9,_0x12ce27){try{if(_0x32a768[_0x7686('0x2b')]){_0x32a768[_0x7686('0x2c')]=[];_0x32a768[_0x7686('0x2b')][_0x7686('0x2d')](',')['forEach'](function(_0x15129b){_0x32a768[_0x7686('0x2c')][_0x7686('0x2e')](_0x2b17d5[_0x15129b]);});}delete _0x32a768[_0x7686('0x2b')];}catch(_0x5a49f4){_0x12ce27(_0x5a49f4);}_0x2976a9(_0x32a768);});}function updateSmsInteraction(_0x5c4080,_0x4bb594,_0x1740ee){return new BPromise(function(_0x379d18,_0x5c1170){return getInteractionUsers(_0x5c4080,_0x1740ee)[_0x7686('0x2f')](function(_0x3575f5){return getInteractionTags(_0x3575f5,_0x4bb594);})['then'](function(_0x389248){_0x379d18(_0x389248);})[_0x7686('0x30')](function(_0x8e02df){_0x5c1170(_0x8e02df);});});}exports[_0x7686('0x31')]=function(_0xef9c84,_0xe4a6a5){var _0x4d9716={},_0x306996={},_0x2352cb={'count':0x0,'rows':[]};var _0x38836b=_[_0x7686('0x32')](db[_0x7686('0x33')]['rawAttributes'],function(_0x5d308a){return{'name':_0x5d308a[_0x7686('0x34')],'type':_0x5d308a[_0x7686('0x35')]['key']};});_0x306996[_0x7686('0x36')]=_[_0x7686('0x32')](_0x38836b,_0x7686('0x28'));_0x306996[_0x7686('0x37')]=_[_0x7686('0x38')](_0xef9c84['query']);_0x306996[_0x7686('0x39')]=_[_0x7686('0x3a')](_0x306996['model'],_0x306996[_0x7686('0x37')]);_0x4d9716['attributes']=_['intersection'](_0x306996[_0x7686('0x36')],qs['fields'](_0xef9c84[_0x7686('0x37')][_0x7686('0x3b')]));_0x4d9716['attributes']=_0x4d9716[_0x7686('0x3c')]['length']?_0x4d9716[_0x7686('0x3c')]:_0x306996[_0x7686('0x36')];if(!_0xef9c84[_0x7686('0x37')]['hasOwnProperty'](_0x7686('0x3d'))){_0x4d9716[_0x7686('0x1f')]=qs[_0x7686('0x1f')](_0xef9c84[_0x7686('0x37')][_0x7686('0x1f')]);_0x4d9716['offset']=qs['offset'](_0xef9c84['query'][_0x7686('0x1e')]);}_0x4d9716[_0x7686('0x3e')]=qs[_0x7686('0x3f')](_0xef9c84[_0x7686('0x37')]['sort']);_0x4d9716[_0x7686('0x40')]=qs['filters'](_['pick'](_0xef9c84[_0x7686('0x37')],_0x306996[_0x7686('0x39')]),_0x38836b);var _0x4f64b9=[];var _0x3161e4=squel[_0x7686('0x41')]()[_0x7686('0x42')]('id')[_0x7686('0x42')](_0x7686('0x28'))['field'](_0x7686('0x43'))[_0x7686('0x44')](_0x7686('0x45'));var _0x1ede4=squel['select']()['field'](_0x7686('0x46'))['field']('u.fullname')['field']('ui.SmsInteractionId')['from']('user_has_sms_interactions','ui')['left_join'](_0x7686('0x47'),'u',_0x7686('0x48'));var _0xb3668d=squel[_0x7686('0x41')]()['from'](_0x7686('0x49'),'i')[_0x7686('0x4a')](_0x7686('0x4b'),'c',_0x7686('0x4c'))[_0x7686('0x4a')](_0x7686('0x47'),'o',_0x7686('0x4d'))[_0x7686('0x4a')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x7686('0x4e'),'me',_0x7686('0x4f'))[_0x7686('0x4a')](_0x7686('0x50'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x7686('0x4a')](_0x7686('0x45'),'t','t.id\x20=\x20it.TagId');var _0x30cc90=squel[_0x7686('0x51')]();var _0x2bd89e=[];var _0x104d74=squel[_0x7686('0x51')]();var _0x5c0608;if(_0xef9c84[_0x7686('0x37')][_0x7686('0x52')]){_0x5c0608=as['parseSearch'](_0xef9c84[_0x7686('0x37')][_0x7686('0x52')]);var _0x314186=_0x5c0608[_0x7686('0x53')];for(var _0x186c1a=0x0;_0x186c1a<_0x5c0608[_0x7686('0x54')][_0x7686('0x55')];_0x186c1a++){var _0x508fb6=_0x5c0608[_0x7686('0x54')][_0x186c1a];var _0x2045bc='i';var _0x2e2ebd=_[_0x7686('0x56')](_0x38836b,[_0x7686('0x28'),_0x508fb6[_0x7686('0x42')]]);if(!_0x2e2ebd){switch(_0x508fb6[_0x7686('0x42')]){case _0x7686('0x57'):if(_0x508fb6[_0x7686('0x58')]==0x1){_0xb3668d['having']('`'+_0x508fb6[_0x7686('0x42')]+_0x7686('0x59'));}else{_0xb3668d[_0x7686('0x5a')]('`'+_0x508fb6[_0x7686('0x42')]+_0x7686('0x5b'));}break;case'Contact':if(_0x508fb6[_0x7686('0x5c')]==='$substring'){if(_0x508fb6[_0x7686('0x58')][_0x7686('0x2d')]('\x20')[_0x7686('0x55')]>0x1){_0x30cc90[_0x314186]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7686('0x5d')](_0x508fb6[_0x7686('0x58')]),null);}else{var _0x1b25c2='%'+_0x508fb6[_0x7686('0x58')]+'%';_0x30cc90[_0x314186](_0x7686('0x5e'),_0x1b25c2,_0x1b25c2,_0x1b25c2);}}else{_0x2e2ebd=_[_0x7686('0x56')](_0x38836b,[_0x7686('0x28'),_0x7686('0x5f')]);_0x508fb6['field']='ContactId';_0x11bffb=as[_0x7686('0x60')](_0x2045bc,_0x2e2ebd[_0x7686('0x35')],_0x508fb6);_0x30cc90[_0x314186](_0x11bffb[_0x7686('0x61')],_0x11bffb[_0x7686('0x58')]['start'],_0x11bffb[_0x7686('0x58')][_0x7686('0x1c')]);}break;case _0x7686('0x62'):var _0x58e5b9=_0x508fb6[_0x7686('0x58')][_0x7686('0x2d')](',')[_0x7686('0x32')](function(_0x4180dd){return Number(_0x4180dd);});_0x58e5b9[_0x7686('0x63')](function(_0x280cae){_0x104d74['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x280cae+',%');});_0x2bd89e=_[_0x7686('0x64')](_0x2bd89e,_0x58e5b9);break;case _0x7686('0x65'):if(_0x508fb6[_0x7686('0x5c')]===_0x7686('0x66')){_0x30cc90[_0x314186]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x508fb6[_0x7686('0x58')]+'%',null);}else{_0x2e2ebd=_[_0x7686('0x56')](_0x38836b,[_0x7686('0x28'),_0x7686('0x67')]);_0x508fb6[_0x7686('0x42')]=_0x7686('0x67');_0x11bffb=as['buildExpression'](_0x2045bc,_0x2e2ebd[_0x7686('0x35')],_0x508fb6);_0x30cc90[_0x314186](_0x11bffb['text'],_0x11bffb[_0x7686('0x58')][_0x7686('0x68')],_0x11bffb[_0x7686('0x58')][_0x7686('0x1c')]);}break;case'body':_0x11bffb=as[_0x7686('0x60')]('me',null,_0x508fb6);_0x30cc90[_0x314186](_0x11bffb[_0x7686('0x61')],_0x11bffb[_0x7686('0x58')][_0x7686('0x68')],_0x11bffb[_0x7686('0x58')][_0x7686('0x1c')]);break;}}else{var _0x11bffb=as[_0x7686('0x60')](_0x2045bc,_0x2e2ebd[_0x7686('0x35')],_0x508fb6);_0x30cc90[_0x314186](_0x11bffb['text'],_0x11bffb[_0x7686('0x58')]['start'],_0x11bffb['value'][_0x7686('0x1c')]);}}}else{var _0x3cdde5=_(_0xef9c84['query'])[_0x7686('0x38')]()[_0x7686('0x32')](function(_0x201089){return _[_0x7686('0x69')](_0x38836b,['name',_0x201089])?_0x201089:undefined;})[_0x7686('0x6a')]()[_0x7686('0x58')]();if(!_[_0x7686('0x6b')](_0x3cdde5)){_0x3cdde5['forEach'](function(_0xcc8c92){if(_0xcc8c92===_0x7686('0x6c')){_0xb3668d[_0x7686('0x40')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0xef9c84['query'][_0xcc8c92]));}else if(_0xcc8c92==='createdAt'){var _0x3f6624=JSON[_0x7686('0x6d')](_0xef9c84[_0x7686('0x37')][_0xcc8c92])[_0x7686('0x6e')];var _0xc14d6a=JSON['parse'](_0xef9c84[_0x7686('0x37')][_0xcc8c92])[_0x7686('0x6f')];_0xb3668d['where'](_0x7686('0x70'),_0x3f6624,_0xc14d6a);}else{if(_0xef9c84[_0x7686('0x37')][_0xcc8c92]===_0x7686('0x71')){_0xb3668d[_0x7686('0x40')]('i.'+_0xcc8c92+'\x20IS\x20NULL');}else{_0xb3668d['where']('i.'+_0xcc8c92+_0x7686('0x72'),_0xef9c84['query'][_0xcc8c92]);}}});}if(_0xef9c84[_0x7686('0x37')][_0x7686('0x73')]){if(_0xef9c84[_0x7686('0x37')][_0x7686('0x73')]==0x1){_0xb3668d[_0x7686('0x5a')](_0x7686('0x74'));}else{_0xb3668d[_0x7686('0x5a')]('`unreadMessages`\x20>\x200');}}if(_0xef9c84[_0x7686('0x37')]['tag']){_0x2bd89e=_[_0x7686('0x75')](_0xef9c84[_0x7686('0x37')][_0x7686('0x76')])?_0xef9c84[_0x7686('0x37')][_0x7686('0x76')]:new Array(_0xef9c84[_0x7686('0x37')][_0x7686('0x76')]);_0x2bd89e['forEach'](function(_0x53573d){_0x104d74['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x53573d+',%');});}if(_0xef9c84['query']['filter']){var _0x55ee65=_0xef9c84['query'][_0x7686('0x77')][_0x7686('0x78')]('\x5c','\x5c\x5c')[_0x7686('0x78')](/'/g,'\x27\x27');if(qs[_0x7686('0x79')](_0x55ee65)){_0x30cc90['or'](_0x7686('0x7a'),_0x55ee65+'%')['or'](_0x7686('0x7b'),_0x55ee65+'%');}else{_0x30cc90['or'](_0x7686('0x7c'),qs['getFullTextValue'](_0x55ee65))['or'](_0x7686('0x7d'),_0x55ee65+'%');}}}_0xb3668d[_0x7686('0x40')](_0x30cc90);_0xb3668d[_0x7686('0x7e')]('i.id');var _0x76a638={'type':db[_0x7686('0x7f')]['QueryTypes'][_0x7686('0x80')],'raw':!![]};var _0x34808b=_0xb3668d['clone']();_0x34808b[_0x7686('0x42')](_0x7686('0x81'));_0x34808b[_0x7686('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7686('0x57'));if(_0x4d9716[_0x7686('0x3e')]){_0x4d9716['order'][_0x7686('0x63')](function(_0x342623){var _0x1cf5eb=_0x342623[0x0]==='contactName'?_0x342623[0x0]:'i.'+_0x342623[0x0];_0xb3668d[_0x7686('0x3e')](_0x1cf5eb,_0x342623[0x1]===_0x7686('0x82')?![]:!![]);});}if(!_['isEmpty'](_0x2bd89e)){_0xb3668d[_0x7686('0x5a')](_0x104d74);_0x34808b[_0x7686('0x40')]('t.id\x20IN\x20?',_0x2bd89e);}BPromise[_0x7686('0x83')]()[_0x7686('0x2f')](function(){if(!_0x5c0608){if(_0xef9c84[_0x7686('0x37')][_0x7686('0x6c')])return;_0x34808b[_0x7686('0x40')](_0x7686('0x84'));_0xb3668d[_0x7686('0x40')](_0x7686('0x84'));return;}if(_0xef9c84[_0x7686('0x85')]['role']!==_0x7686('0x86'))return;return _0xef9c84[_0x7686('0x85')][_0x7686('0x87')]({'attributes':['id'],'raw':!![]})['then'](function(_0x522eda){if(_[_0x7686('0x6b')](_0x522eda)){_0x34808b[_0x7686('0x40')]('i.SmsAccountId\x20IS\x20NULL');_0xb3668d[_0x7686('0x40')](_0x7686('0x88'));}else{_0x34808b[_0x7686('0x40')](_0x7686('0x89'),_[_0x7686('0x32')](_0x522eda,'id'));_0xb3668d['where'](_0x7686('0x89'),_[_0x7686('0x32')](_0x522eda,'id'));}});})[_0x7686('0x2f')](function(){if(_0xef9c84[_0x7686('0x85')][_0x7686('0x8a')]==='agent'&&!_0x5c0608&&!_0xef9c84[_0x7686('0x37')][_0x7686('0x6c')])return[];return db[_0x7686('0x8b')]['query'](_0x34808b['toString'](),_0x76a638);})[_0x7686('0x2f')](function(_0x5d03e1){_0x2352cb['count']=_0x5d03e1[_0x7686('0x55')];if(_0x2352cb[_0x7686('0x21')]===0x0)return[];return db[_0x7686('0x8b')]['query'](_0x3161e4[_0x7686('0x8c')](),_0x76a638)[_0x7686('0x2f')](function(_0xf42b1d){_0x4f64b9=_['keyBy'](_0xf42b1d,'id');_0x76a638=_[_0x7686('0x8d')](_0x76a638,{'model':db[_0x7686('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xef9c84['query']['fields']){_0x4d9716[_0x7686('0x3c')][_0x7686('0x63')](function(_0x3d6413){_0xb3668d[_0x7686('0x42')]('i.'+_0x3d6413);});}else{_0xb3668d[_0x7686('0x42')](_0x7686('0x8e'),_0x7686('0x57'));_0xb3668d[_0x7686('0x42')]('a.key',_0x7686('0x8f'));_0xb3668d[_0x7686('0x42')]('a.mandatoryDisposition',_0x7686('0x90'));_0xb3668d[_0x7686('0x42')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0xb3668d['field']('i.*');_0xb3668d[_0x7686('0x42')]('c.firstName',_0x7686('0x91'));_0xb3668d[_0x7686('0x42')]('c.lastName',_0x7686('0x92'));_0xb3668d['field'](_0x7686('0x93'),_0x7686('0x94'));_0xb3668d['field']('c.phone',_0x7686('0x95'));_0xb3668d[_0x7686('0x42')](_0x7686('0x96'),_0x7686('0x97'));_0xb3668d['field'](_0x7686('0x98'),_0x7686('0x99'));_0xb3668d[_0x7686('0x42')](_0x7686('0x9a'),_0x7686('0x9b'));_0xb3668d['field'](_0x7686('0x9c'),_0x7686('0x9d'));_0xb3668d[_0x7686('0x42')](_0x7686('0x9e'),_0x7686('0x2b'));}if(_0x4d9716[_0x7686('0x1f')])_0xb3668d[_0x7686('0x1f')](_0x4d9716[_0x7686('0x1f')]);if(_0x4d9716[_0x7686('0x1e')])_0xb3668d[_0x7686('0x1e')](_0x4d9716[_0x7686('0x1e')]);return db[_0x7686('0x8b')][_0x7686('0x37')](_0xb3668d['toString'](),_0x76a638);})[_0x7686('0x2f')](function(_0x217eb8){if(_0x217eb8[_0x7686('0x55')]>0x0)_0x1ede4[_0x7686('0x40')]('ui.SmsInteractionId\x20IN\x20?',_[_0x7686('0x32')](_0x217eb8,'id'));return db[_0x7686('0x8b')]['query'](_0x1ede4['toString'](),_0x76a638)[_0x7686('0x2f')](function(_0x5e3e29){var _0x53aa04=_[_0x7686('0x9f')](_0x5e3e29,_0x7686('0xa0'));var _0x33dc34=[];_0x217eb8[_0x7686('0x63')](function(_0x53a00b){_0x33dc34[_0x7686('0x2e')](updateSmsInteraction(_0x53a00b,_0x4f64b9,_0x53aa04));});return BPromise['all'](_0x33dc34);});});})[_0x7686('0x2f')](function(_0x2ad435){_0x2352cb['rows']=_0x2ad435;return _0x2352cb;})[_0x7686('0x2f')](respondWithFilteredResult(_0xe4a6a5,_0x4d9716))[_0x7686('0x30')](handleError(_0xe4a6a5,null));};exports[_0x7686('0xa1')]=function(_0x38247e,_0x3ec099){var _0x2e9b86={'raw':![],'where':{'id':_0x38247e[_0x7686('0xa2')]['id']}},_0x50bac0={};_0x50bac0[_0x7686('0x36')]=_[_0x7686('0x38')](db[_0x7686('0x33')][_0x7686('0xa3')]);_0x50bac0[_0x7686('0x37')]=_[_0x7686('0x38')](_0x38247e['query']);_0x50bac0[_0x7686('0x39')]=_[_0x7686('0x3a')](_0x50bac0[_0x7686('0x36')],_0x50bac0[_0x7686('0x37')]);_0x2e9b86[_0x7686('0x3c')]=_['intersection'](_0x50bac0[_0x7686('0x36')],qs['fields'](_0x38247e['query'][_0x7686('0x3b')]));_0x2e9b86[_0x7686('0x3c')]=_0x2e9b86[_0x7686('0x3c')]['length']?_0x2e9b86[_0x7686('0x3c')]:_0x50bac0['model'];if(_0x38247e[_0x7686('0x37')][_0x7686('0xa4')]){_0x2e9b86[_0x7686('0xa5')]=[{'all':!![]}];}_0x2e9b86=_[_0x7686('0x8d')]({},_0x2e9b86,_0x38247e[_0x7686('0xa6')]);return db[_0x7686('0x33')][_0x7686('0x56')](_0x2e9b86)[_0x7686('0x2f')](handleEntityNotFound(_0x3ec099,null))[_0x7686('0x2f')](respondWithResult(_0x3ec099,null))['catch'](handleError(_0x3ec099,null));};exports[_0x7686('0xa7')]=function(_0x2755e2,_0x316fed){return db[_0x7686('0x33')][_0x7686('0xa7')](_0x2755e2[_0x7686('0xa8')],{})[_0x7686('0x2f')](respondWithResult(_0x316fed,0xc9))[_0x7686('0x30')](handleError(_0x316fed,null));};exports[_0x7686('0x25')]=function(_0x1853cf,_0x59e039){if(_0x1853cf['body']['id']){delete _0x1853cf['body']['id'];}return db[_0x7686('0x33')][_0x7686('0x56')]({'where':{'id':_0x1853cf[_0x7686('0xa2')]['id']}})[_0x7686('0x2f')](handleEntityNotFound(_0x59e039,null))[_0x7686('0x2f')](saveUpdates(_0x1853cf[_0x7686('0xa8')],null))[_0x7686('0x2f')](respondWithResult(_0x59e039,null))[_0x7686('0x30')](handleError(_0x59e039,null));};exports[_0x7686('0x26')]=function(_0x528ccc,_0x5e4859){return db[_0x7686('0x33')][_0x7686('0x56')]({'where':{'id':_0x528ccc[_0x7686('0xa2')]['id']}})[_0x7686('0x2f')](handleEntityNotFound(_0x5e4859,null))['then'](removeEntity(_0x5e4859,null))[_0x7686('0x30')](handleError(_0x5e4859,null));};exports[_0x7686('0xa9')]=function(_0x47b2f1,_0x4e95c6){return db[_0x7686('0x33')][_0x7686('0xa9')]()['then'](respondWithResult(_0x4e95c6,null))['catch'](handleError(_0x4e95c6,null));};exports['addMessage']=function(_0x1acd51,_0x3bdbd2,_0x5a79f6){return db[_0x7686('0xaa')][_0x7686('0x56')]({'where':{'id':_0x1acd51[_0x7686('0xa2')]['id']}})[_0x7686('0x2f')](handleEntityNotFound(_0x3bdbd2,null))[_0x7686('0x2f')](function(_0x22e7a9){if(_0x22e7a9){return _0x22e7a9[_0x7686('0xab')](_0x1acd51['body'][_0x7686('0xac')],_[_0x7686('0xad')](_0x1acd51[_0x7686('0xa8')],['ids','id'])||{});}})[_0x7686('0x2f')](respondWithResult(_0x3bdbd2,null))[_0x7686('0x30')](handleError(_0x3bdbd2,null));};exports[_0x7686('0xae')]=function(_0x5a3ec8,_0x131e5c,_0x9c675c){var _0x33c875={'raw':![],'where':{}};var _0x508f15={};var _0xf0283a={'count':0x0,'rows':[]};return db[_0x7686('0x33')][_0x7686('0xaf')]({'where':{'id':_0x5a3ec8[_0x7686('0xa2')]['id']}})[_0x7686('0x2f')](handleEntityNotFound(_0x131e5c,null))[_0x7686('0x2f')](function(_0x577162){if(_0x577162){_0x508f15[_0x7686('0x36')]=_[_0x7686('0x38')](db['SmsMessage'][_0x7686('0xa3')]);_0x508f15[_0x7686('0x37')]=_['keys'](_0x5a3ec8[_0x7686('0x37')]);_0x508f15[_0x7686('0x39')]=_[_0x7686('0x3a')](_0x508f15[_0x7686('0x36')],_0x508f15[_0x7686('0x37')]);_0x33c875[_0x7686('0x3c')]=_[_0x7686('0x3a')](_0x508f15[_0x7686('0x36')],qs[_0x7686('0x3b')](_0x5a3ec8[_0x7686('0x37')][_0x7686('0x3b')]));_0x33c875[_0x7686('0x3c')]=_0x33c875['attributes'][_0x7686('0x55')]?_0x33c875['attributes']:_0x508f15['model'];if(!_0x5a3ec8[_0x7686('0x37')][_0x7686('0xb0')](_0x7686('0x3d'))){_0x33c875[_0x7686('0x1f')]=qs[_0x7686('0x1f')](_0x5a3ec8['query'][_0x7686('0x1f')]);_0x33c875[_0x7686('0x1e')]=qs[_0x7686('0x1e')](_0x5a3ec8[_0x7686('0x37')][_0x7686('0x1e')]);}_0x33c875['order']=qs[_0x7686('0x3f')](_0x5a3ec8['query']['sort']);_0x33c875['where']=qs[_0x7686('0x39')](_[_0x7686('0xb1')](_0x5a3ec8[_0x7686('0x37')],_0x508f15[_0x7686('0x39')]));_0x33c875['where'][_0x7686('0xa0')]=_0x577162['id'];if(_0x5a3ec8[_0x7686('0x37')][_0x7686('0x77')]){_0x33c875[_0x7686('0x40')]=_[_0x7686('0x8d')](_0x33c875[_0x7686('0x40')],{'$or':_[_0x7686('0x32')](_0x33c875[_0x7686('0x3c')],function(_0x45b4a1){var _0xeca7a3={};_0xeca7a3[_0x45b4a1]={'$like':'%'+_0x5a3ec8[_0x7686('0x37')]['filter']+'%'};return _0xeca7a3;})});}if(_0x5a3ec8[_0x7686('0x37')][_0x7686('0x6e')]){var _0x5375f3=_0x5a3ec8[_0x7686('0x37')]['$gte']['split'](',');var _0x33b8c8={};_0x33b8c8[_0x5375f3[0x0]]={'$gte':moment(_0x5375f3[0x1])['format'](_0x7686('0xb2'))};_0x33c875['where']=_[_0x7686('0x8d')](_0x33c875['where'],_0x33b8c8);}_0x33c875=_['merge']({},_0x33c875,_0x5a3ec8['options']);return db[_0x7686('0xaa')][_0x7686('0x21')]({'where':_0x33c875[_0x7686('0x40')]})[_0x7686('0x2f')](function(_0x25d7b5){_0xf0283a[_0x7686('0x21')]=_0x25d7b5;if(_0x5a3ec8[_0x7686('0x37')]['includeAll']){_0x33c875[_0x7686('0xa5')]=[{'all':!![]}];}return db[_0x7686('0xaa')]['findAll'](_0x33c875);})[_0x7686('0x2f')](function(_0x5bda19){_0xf0283a[_0x7686('0xb3')]=_0x5bda19;return _0xf0283a;});}})[_0x7686('0x2f')](respondWithFilteredResult(_0x131e5c,_0x33c875))['catch'](handleError(_0x131e5c,null));};exports['addTags']=function(_0x355b04,_0xa21f44,_0x91fdda){return db[_0x7686('0x33')][_0x7686('0x56')]({'where':{'id':_0x355b04[_0x7686('0xa2')]['id']}})['then'](handleEntityNotFound(_0xa21f44,null))[_0x7686('0x2f')](function(_0x30d23b){if(_0x30d23b){return _0x30d23b[_0x7686('0xb4')](_0x355b04[_0x7686('0xa8')]['ids'],_[_0x7686('0xad')](_0x355b04[_0x7686('0xa8')],[_0x7686('0xac'),'id'])||{})['spread'](function(){return db['Tag'][_0x7686('0xb5')]({'attributes':['id','name','color'],'where':{'id':_0x355b04['body'][_0x7686('0xac')]}});})[_0x7686('0x2f')](function(_0x3570d5){socket[_0x7686('0xb6')]('smsInteractionTags:save',{'id':Number(_0x355b04[_0x7686('0xa2')]['id']),'tags':_0x3570d5||[]});return{'id':Number(_0x355b04['params']['id']),'tags':_0x3570d5||[]};});}})[_0x7686('0x2f')](respondWithResult(_0xa21f44,null))[_0x7686('0x30')](handleError(_0xa21f44,null));};exports[_0x7686('0xb7')]=function(_0x1fbab2,_0xb8213c,_0x554ced){return db[_0x7686('0x33')][_0x7686('0x56')]({'where':{'id':_0x1fbab2[_0x7686('0xa2')]['id']}})[_0x7686('0x2f')](handleEntityNotFound(_0xb8213c,null))['then'](function(_0x54bff4){if(_0x54bff4){return _0x54bff4['removeTags'](_0x1fbab2[_0x7686('0x37')]['ids']);}})[_0x7686('0x2f')](respondWithStatusCode(_0xb8213c,null))[_0x7686('0x30')](handleError(_0xb8213c,null));};exports['download']=function(_0x58a990,_0x3b9a19){var _0xa53ecf=moment()['unix']()[_0x7686('0x8c')]();var _0x4c11c1=path[_0x7686('0xb8')](config[_0x7686('0xb9')],'server',_0x7686('0xba'),_0x7686('0xbb'));var _0x427bec=path['join'](config['root'],_0x7686('0xbc'),_0x7686('0xba'),_0x7686('0xbd'));var _0x2dc1ab=path[_0x7686('0xb8')](_0x4c11c1,_0xa53ecf);var _0x5b892a=util[_0x7686('0xbe')](_0x7686('0xbf'),_0x58a990[_0x7686('0xa2')]['id'],_0xa53ecf);var _0x50aeb1=path[_0x7686('0xb8')](_0x4c11c1,_0x5b892a);var _0x4eb534=[];_0x4eb534[_0x7686('0x2e')]({'model':db[_0x7686('0x65')],'as':_0x7686('0x65'),'attributes':['id',_0x7686('0xc0')],'raw':!![]});_0x4eb534[_0x7686('0x2e')]({'model':db['CmContact'],'as':_0x7686('0xc1'),'attributes':['id','firstName',_0x7686('0xc2')],'raw':!![]});var _0x22c849=[{'model':db[_0x7686('0xaa')],'as':'Messages','attributes':['id','body',_0x7686('0xc3'),_0x7686('0xc4'),_0x7686('0xc5'),_0x7686('0x73')],'include':_0x4eb534}];_0x22c849['push']({'model':db[_0x7686('0xc6')],'as':_0x7686('0xc7'),'attributes':['id',_0x7686('0x28')]});_0x22c849[_0x7686('0x2e')]({'model':db[_0x7686('0x65')],'as':_0x7686('0xc8'),'attributes':['id','fullname']});return db[_0x7686('0x33')][_0x7686('0x56')]({'where':{'id':_0x58a990[_0x7686('0xa2')]['id']},'include':_0x22c849})[_0x7686('0x2f')](handleEntityNotFound(_0x3b9a19,null))[_0x7686('0x2f')](function(_0x2af345){if(_0x2af345){var _0x21fad4=_0x2af345[_0x7686('0xc9')]({'plain':!![]});fs[_0x7686('0xca')](_0x2dc1ab);var _0x67948d={'channel':_0x7686('0xcb'),'account':_0x21fad4['Account'][_0x7686('0x28')],'agent':_0x21fad4[_0x7686('0xc8')]?_0x21fad4[_0x7686('0xc8')][_0x7686('0xc0')]:_0x7686('0xcc'),'createdAt':moment(_0x21fad4[_0x7686('0xc3')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7686('0x8c')](),'closedAt':_0x21fad4['closed']?moment(_0x21fad4[_0x7686('0xcd')])[_0x7686('0xbe')](_0x7686('0xb2'))[_0x7686('0x8c')]():'','disposition':_0x21fad4['disposition'],'messages':_(_0x21fad4[_0x7686('0xce')])['filter']({'secret':![]})[_0x7686('0x32')](function(_0x4ceaa7){return{'date':moment(_0x4ceaa7[_0x7686('0xc3')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7686('0x8c')](),'sender':_0x4ceaa7[_0x7686('0xc4')]===_0x7686('0xcf')?_0x4ceaa7[_0x7686('0x65')]?_0x4ceaa7[_0x7686('0x65')]['fullname']:_0x7686('0xd0'):_0x4ceaa7[_0x7686('0xc1')][_0x7686('0xd1')]+(_0x4ceaa7[_0x7686('0xc1')][_0x7686('0xc2')]?'\x20'+_0x4ceaa7[_0x7686('0xc1')]['lastName']:''),'body':_0x4ceaa7[_0x7686('0xa8')],'direction':_0x4ceaa7[_0x7686('0xc4')]==='out'?'A':'C','secret':_0x4ceaa7[_0x7686('0xc5')],'read':_0x4ceaa7[_0x7686('0x73')]};})[_0x7686('0x58')]()};return ejs[_0x7686('0xd2')](path['join'](config[_0x7686('0xb9')],_0x7686('0xbc'),_0x7686('0xd3'),_0x7686('0xd4')),{'interaction':_0x67948d})[_0x7686('0x2f')](function(_0x5f01c3){var _0x1de4b9=path[_0x7686('0xb8')](_0x2dc1ab,'transcript-'+_0x21fad4['id']+'-'+_0xa53ecf+'.pdf');var _0x29078b={'path':_0x1de4b9,'channel':'Sms','interactionId':_0x21fad4['id']};return pdf[_0x7686('0xd5')](_0x5f01c3,_0x29078b);})[_0x7686('0x2f')](function(){return new BPromise(function(_0x460589,_0x1f4150){zipdir(_0x2dc1ab,{'saveTo':_0x50aeb1},function(_0x41a297,_0x346a79){if(_0x41a297)return _0x1f4150(_0x41a297);return _0x460589(_0x346a79);});})[_0x7686('0x2f')](function(){return new BPromise(function(_0x9a12c7,_0x48f3a1){rimraf(_0x2dc1ab,function(_0x341e24){if(_0x341e24)_0x48f3a1(_0x341e24);return _0x9a12c7();});});})['then'](function(){return _0x3b9a19[_0x7686('0xd6')](_0x50aeb1,_0x5b892a,function(_0xd795cf){if(_0xd795cf){console[_0x7686('0xd7')](_0x7686('0xd8'),_0xd795cf);}else{fs[_0x7686('0xd9')](_0x50aeb1);}});});});}else{return _0x3b9a19[_0x7686('0x1a')](0xc8);}})[_0x7686('0x30')](handleError(_0x3b9a19,null));};
\ No newline at end of file
index bf7c205..2928f09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbb=['catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x6e5e34,_0x2c5142){var _0x3167a9=function(_0x8f3136){while(--_0x8f3136){_0x6e5e34['push'](_0x6e5e34['shift']());}};_0x3167a9(++_0x2c5142);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x31566f,_0x10b463){_0x31566f=_0x31566f-0x0;var _0x1af9da=_0xfcbb[_0x31566f];return _0x1af9da;};'use strict';var EventEmitter=require(_0xbfcb('0x0'));var SmsInteraction=require(_0xbfcb('0x1'))['db'][_0xbfcb('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xbfcb('0x3')](0x0);var events={'afterCreate':_0xbfcb('0x4'),'afterUpdate':_0xbfcb('0x5'),'afterDestroy':_0xbfcb('0x6')};function emitEvent(_0x1d8b50){return function(_0x5c5a1a,_0x5201d3,_0x32c2aa){_0x5c5a1a[_0xbfcb('0x7')]({'attributes':['id'],'raw':!![]})[_0xbfcb('0x8')](function(_0x2df839){_0x5c5a1a[_0xbfcb('0x9')](_0xbfcb('0xa'),_0x2df839[_0xbfcb('0xb')](function(_0x571001){return{'id':_0x571001['id']};}));return SmsMessage[_0xbfcb('0xc')]({'where':{'SmsInteractionId':_0x5c5a1a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfcb('0x8')](function(_0x346685){_0x5c5a1a['setDataValue'](_0xbfcb('0xd'),_0x346685[_0xbfcb('0xe')]);SmsInteractionEvents[_0xbfcb('0xf')](_0x1d8b50+':'+_0x5c5a1a['id'],_0x5c5a1a);SmsInteractionEvents[_0xbfcb('0xf')](_0x1d8b50,_0x5c5a1a);_0x32c2aa(null);})[_0xbfcb('0x10')](_0x32c2aa(null));};}for(var e in events){if(events[_0xbfcb('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xbfcb('0x12')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x5b12=['exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3399af,_0x39e8d6){var _0x172852=function(_0x2a0b13){while(--_0x2a0b13){_0x3399af['push'](_0x3399af['shift']());}};_0x172852(++_0x39e8d6);}(_0x5b12,0xa3));var _0x25b1=function(_0x1880c0,_0x286553){_0x1880c0=_0x1880c0-0x0;var _0x27901b=_0x5b12[_0x1880c0];return _0x27901b;};'use strict';var EventEmitter=require(_0x25b1('0x0'));var SmsInteraction=require(_0x25b1('0x1'))['db'][_0x25b1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x25b1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25b1('0x4'),'afterUpdate':_0x25b1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31f3fc){return function(_0x56378e,_0x5248c2,_0x35d90b){_0x56378e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1f715d){_0x56378e[_0x25b1('0x6')](_0x25b1('0x7'),_0x1f715d[_0x25b1('0x8')](function(_0x1ed594){return{'id':_0x1ed594['id']};}));return SmsMessage[_0x25b1('0x9')]({'where':{'SmsInteractionId':_0x56378e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x25b1('0xa')](function(_0x6235e2){_0x56378e['setDataValue'](_0x25b1('0xb'),_0x6235e2[_0x25b1('0xc')]);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc+':'+_0x56378e['id'],_0x56378e);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc,_0x56378e);_0x35d90b(null);})[_0x25b1('0xe')](_0x35d90b(null));};}for(var e in events){if(events[_0x25b1('0xf')](e)){var event=events[e];SmsInteraction[_0x25b1('0x10')](e,emitEvent(event));}}module[_0x25b1('0x11')]=SmsInteractionEvents;
\ No newline at end of file
index 2d2ef49..9a81810 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc50=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','sms_interactions','closedAt','format','lodash'];(function(_0x1ad80a,_0x504004){var _0x251f36=function(_0x31ed2c){while(--_0x31ed2c){_0x1ad80a['push'](_0x1ad80a['shift']());}};_0x251f36(++_0x504004);}(_0xdc50,0x19f));var _0x0dc5=function(_0x13dee3,_0x5d09f7){_0x13dee3=_0x13dee3-0x0;var _0x57c28d=_0xdc50[_0x13dee3];return _0x57c28d;};'use strict';var _=require(_0x0dc5('0x0'));var util=require(_0x0dc5('0x1'));var logger=require('../../config/logger')(_0x0dc5('0x2'));var moment=require(_0x0dc5('0x3'));var BPromise=require(_0x0dc5('0x4'));var rp=require(_0x0dc5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0dc5('0x6'));var config=require(_0x0dc5('0x7'));var attributes=require('./smsInteraction.attributes');module[_0x0dc5('0x8')]=function(_0x75cc9c,_0x41e472){return _0x75cc9c[_0x0dc5('0x9')]('SmsInteraction',attributes,{'tableName':_0x0dc5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c5113,_0x3cab31,_0x11e410){if(_0x3c5113['changed']('closed')){_0x3c5113[_0x0dc5('0xb')]=moment()[_0x0dc5('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x11e410(null,_0x3c5113);}}});};
\ No newline at end of file
+var _0xa548=['rimraf','exports','define','SmsInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3fbdf6,_0x47945b){var _0x1d948f=function(_0x387863){while(--_0x387863){_0x3fbdf6['push'](_0x3fbdf6['shift']());}};_0x1d948f(++_0x47945b);}(_0xa548,0xe4));var _0x8a54=function(_0x3cdc2c,_0x365575){_0x3cdc2c=_0x3cdc2c-0x0;var _0x99fa7=_0xa548[_0x3cdc2c];return _0x99fa7;};'use strict';var _=require('lodash');var util=require(_0x8a54('0x0'));var logger=require(_0x8a54('0x1'))(_0x8a54('0x2'));var moment=require(_0x8a54('0x3'));var BPromise=require('bluebird');var rp=require(_0x8a54('0x4'));var fs=require('fs');var path=require(_0x8a54('0x5'));var rimraf=require(_0x8a54('0x6'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x8a54('0x7')]=function(_0x50d16e,_0x106d33){return _0x50d16e[_0x8a54('0x8')](_0x8a54('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bd8ef,_0x3e92af,_0x472229){if(_0x2bd8ef[_0x8a54('0xa')](_0x8a54('0xb'))){_0x2bd8ef['closedAt']=moment()['format'](_0x8a54('0xc'));}_0x472229(null,_0x2bd8ef);}}});};
\ No newline at end of file
index 2c73689..8157cba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc765=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','limit','AddTagsToSmsInteraction','addTags','ids','omit','AddTags','lodash'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc765,0xf5));var _0x5c76=function(_0x1dae75,_0x2a9f5d){_0x1dae75=_0x1dae75-0x0;var _0x1325bd=_0xc765[_0x1dae75];return _0x1325bd;};'use strict';var _=require(_0x5c76('0x0'));var util=require(_0x5c76('0x1'));var moment=require(_0x5c76('0x2'));var BPromise=require(_0x5c76('0x3'));var rs=require(_0x5c76('0x4'));var fs=require('fs');var Redis=require(_0x5c76('0x5'));var db=require(_0x5c76('0x6'))['db'];var utils=require(_0x5c76('0x7'));var logger=require('../../config/logger')(_0x5c76('0x8'));var config=require(_0x5c76('0x9'));var jayson=require(_0x5c76('0xa'));var client=jayson[_0x5c76('0xb')][_0x5c76('0xc')]({'port':0x232a});config[_0x5c76('0xd')]=_[_0x5c76('0xe')](config[_0x5c76('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c76('0xf'))(new Redis(config[_0x5c76('0xd')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4942f1,_0x5be470,_0x117269){return new BPromise(function(_0x4cdd15,_0x147b59){return client[_0x5c76('0x10')](_0x4942f1,_0x117269)[_0x5c76('0x11')](function(_0xea10cf){logger[_0x5c76('0x12')](_0x5c76('0x13'),_0x5be470,_0x5c76('0x14'));logger[_0x5c76('0x15')](_0x5c76('0x16'),_0x5be470,_0x5c76('0x14'),JSON[_0x5c76('0x17')](_0xea10cf));if(_0xea10cf['error']){if(_0xea10cf['error'][_0x5c76('0x18')]===0x1f4){logger[_0x5c76('0x19')](_0x5c76('0x13'),_0x5be470,_0xea10cf[_0x5c76('0x19')]['message']);return _0x147b59(_0xea10cf[_0x5c76('0x19')]['message']);}logger['error'](_0x5c76('0x13'),_0x5be470,_0xea10cf['error'][_0x5c76('0x1a')]);return _0x4cdd15(_0xea10cf[_0x5c76('0x19')][_0x5c76('0x1a')]);}else{logger['info'](_0x5c76('0x13'),_0x5be470,_0x5c76('0x14'));_0x4cdd15(_0xea10cf[_0x5c76('0x1b')][_0x5c76('0x1a')]);}})[_0x5c76('0x1c')](function(_0x2b749e){logger[_0x5c76('0x19')](_0x5c76('0x13'),_0x5be470,_0x2b749e);_0x147b59(_0x2b749e);});});}exports[_0x5c76('0x1d')]=function(_0x40982a){var _0x1046bd=this;return new Promise(function(_0x2a6c7c,_0x4d9ff){return db[_0x5c76('0x1e')][_0x5c76('0x1f')](_0x40982a[_0x5c76('0x20')],{'raw':_0x40982a['options']?_0x40982a[_0x5c76('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40982a[_0x5c76('0x21')]?_0x40982a[_0x5c76('0x21')][_0x5c76('0x22')]||null:null,'attributes':_0x40982a[_0x5c76('0x21')]?_0x40982a[_0x5c76('0x21')]['attributes']||null:null,'limit':_0x40982a['options']?_0x40982a[_0x5c76('0x21')][_0x5c76('0x23')]||null:null})[_0x5c76('0x11')](function(_0x5e9249){logger[_0x5c76('0x12')](_0x5c76('0x1d'),_0x40982a);logger[_0x5c76('0x15')](_0x5c76('0x1d'),_0x40982a,JSON['stringify'](_0x5e9249));_0x2a6c7c(_0x5e9249);})[_0x5c76('0x1c')](function(_0x5b6ccd){logger[_0x5c76('0x19')]('UpdateSmsInteraction',_0x5b6ccd[_0x5c76('0x1a')],_0x40982a);_0x4d9ff(_0x1046bd[_0x5c76('0x19')](0x1f4,_0x5b6ccd['message']));});});};exports[_0x5c76('0x24')]=function(_0x51d4d8){return new Promise(function(_0x523a3a,_0x1384c4){return db['SmsInteraction']['find']({'where':_0x51d4d8[_0x5c76('0x21')]?_0x51d4d8['options'][_0x5c76('0x22')]||null:null})[_0x5c76('0x11')](function(_0x361896){if(_0x361896){return _0x361896[_0x5c76('0x25')](_0x51d4d8['body'][_0x5c76('0x26')],_[_0x5c76('0x27')](_0x51d4d8[_0x5c76('0x20')],['ids','id'])||{});}})['spread'](function(_0x32fcd7){logger[_0x5c76('0x12')](_0x5c76('0x28'),_0x51d4d8);logger[_0x5c76('0x15')](_0x5c76('0x28'),_0x51d4d8,JSON[_0x5c76('0x17')](_0x32fcd7));_0x523a3a(_0x32fcd7);})[_0x5c76('0x1c')](function(_0x565302){logger[_0x5c76('0x19')](_0x5c76('0x28'),_0x565302[_0x5c76('0x1a')],_0x51d4d8);_0x1384c4(_this[_0x5c76('0x19')](0x1f4,_0x565302['message']));});});};
\ No newline at end of file
+var _0xe8f4=['SmsInteraction','body','options','where','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsInteraction.socket','register','request','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction'];(function(_0x6ec2d2,_0x3a15c4){var _0x7c3c19=function(_0x557f99){while(--_0x557f99){_0x6ec2d2['push'](_0x6ec2d2['shift']());}};_0x7c3c19(++_0x3a15c4);}(_0xe8f4,0x177));var _0x4e8f=function(_0x5052d5,_0x3f54cd){_0x5052d5=_0x5052d5-0x0;var _0x44dc52=_0xe8f4[_0x5052d5];return _0x44dc52;};'use strict';var _=require(_0x4e8f('0x0'));var util=require(_0x4e8f('0x1'));var moment=require(_0x4e8f('0x2'));var BPromise=require(_0x4e8f('0x3'));var rs=require(_0x4e8f('0x4'));var fs=require('fs');var Redis=require(_0x4e8f('0x5'));var db=require(_0x4e8f('0x6'))['db'];var utils=require(_0x4e8f('0x7'));var logger=require(_0x4e8f('0x8'))(_0x4e8f('0x9'));var config=require(_0x4e8f('0xa'));var jayson=require(_0x4e8f('0xb'));var client=jayson[_0x4e8f('0xc')][_0x4e8f('0xd')]({'port':0x232a});config['redis']=_[_0x4e8f('0xe')](config[_0x4e8f('0xf')],{'host':_0x4e8f('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4e8f('0x11'))[_0x4e8f('0x12')](socket);function respondWithRpcPromise(_0x2f452a,_0x185fe6,_0x2299d6){return new BPromise(function(_0x541d04,_0xfc0525){return client[_0x4e8f('0x13')](_0x2f452a,_0x2299d6)['then'](function(_0x1a0e4c){logger[_0x4e8f('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x185fe6,_0x4e8f('0x15'));logger['debug'](_0x4e8f('0x16'),_0x185fe6,'request\x20sent',JSON[_0x4e8f('0x17')](_0x1a0e4c));if(_0x1a0e4c[_0x4e8f('0x18')]){if(_0x1a0e4c[_0x4e8f('0x18')]['code']===0x1f4){logger[_0x4e8f('0x18')](_0x4e8f('0x19'),_0x185fe6,_0x1a0e4c[_0x4e8f('0x18')][_0x4e8f('0x1a')]);return _0xfc0525(_0x1a0e4c[_0x4e8f('0x18')]['message']);}logger['error'](_0x4e8f('0x19'),_0x185fe6,_0x1a0e4c[_0x4e8f('0x18')][_0x4e8f('0x1a')]);return _0x541d04(_0x1a0e4c['error'][_0x4e8f('0x1a')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x185fe6,_0x4e8f('0x15'));_0x541d04(_0x1a0e4c[_0x4e8f('0x1b')][_0x4e8f('0x1a')]);}})[_0x4e8f('0x1c')](function(_0x82023f){logger[_0x4e8f('0x18')](_0x4e8f('0x19'),_0x185fe6,_0x82023f);_0xfc0525(_0x82023f);});});}exports[_0x4e8f('0x1d')]=function(_0x50f611){var _0x4fd277=this;return new Promise(function(_0x765999,_0x26e15c){return db[_0x4e8f('0x1e')]['update'](_0x50f611[_0x4e8f('0x1f')],{'raw':_0x50f611[_0x4e8f('0x20')]?_0x50f611['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50f611['options']?_0x50f611[_0x4e8f('0x20')][_0x4e8f('0x21')]||null:null,'attributes':_0x50f611[_0x4e8f('0x20')]?_0x50f611[_0x4e8f('0x20')][_0x4e8f('0x22')]||null:null,'limit':_0x50f611[_0x4e8f('0x20')]?_0x50f611['options'][_0x4e8f('0x23')]||null:null})[_0x4e8f('0x24')](function(_0x1799f7){logger[_0x4e8f('0x14')](_0x4e8f('0x1d'),_0x50f611);logger['debug'](_0x4e8f('0x1d'),_0x50f611,JSON[_0x4e8f('0x17')](_0x1799f7));_0x765999(_0x1799f7);})['catch'](function(_0x5dba64){logger[_0x4e8f('0x18')](_0x4e8f('0x1d'),_0x5dba64['message'],_0x50f611);_0x26e15c(_0x4fd277[_0x4e8f('0x18')](0x1f4,_0x5dba64['message']));});});};exports[_0x4e8f('0x25')]=function(_0x13186c){return new Promise(function(_0xada456,_0x366531){return db[_0x4e8f('0x1e')][_0x4e8f('0x26')]({'where':_0x13186c['options']?_0x13186c[_0x4e8f('0x20')][_0x4e8f('0x21')]||null:null})[_0x4e8f('0x24')](function(_0x28ac63){if(_0x28ac63){return _0x28ac63[_0x4e8f('0x27')](_0x13186c[_0x4e8f('0x1f')][_0x4e8f('0x28')],_[_0x4e8f('0x29')](_0x13186c[_0x4e8f('0x1f')],['ids','id'])||{});}})[_0x4e8f('0x2a')](function(_0xef022d){logger[_0x4e8f('0x14')](_0x4e8f('0x2b'),_0x13186c);logger[_0x4e8f('0x2c')](_0x4e8f('0x2b'),_0x13186c,JSON['stringify'](_0xef022d));_0xada456(_0xef022d);})['catch'](function(_0x47f75c){logger[_0x4e8f('0x18')](_0x4e8f('0x2b'),_0x47f75c[_0x4e8f('0x1a')],_0x13186c);_0x366531(_this[_0x4e8f('0x18')](0x1f4,_0x47f75c[_0x4e8f('0x1a')]));});});};
\ No newline at end of file
index ece1233..b958315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b13=['save','remove','update','register','smsInteraction:','./smsInteraction.events'];(function(_0x1a4580,_0x376302){var _0x3a1ead=function(_0x5c0034){while(--_0x5c0034){_0x1a4580['push'](_0x1a4580['shift']());}};_0x3a1ead(++_0x376302);}(_0x9b13,0x1eb));var _0x39b1=function(_0x277893,_0x232cb7){_0x277893=_0x277893-0x0;var _0x4e7470=_0x9b13[_0x277893];return _0x4e7470;};'use strict';var SmsInteractionEvents=require(_0x39b1('0x0'));var events=[_0x39b1('0x1'),_0x39b1('0x2'),_0x39b1('0x3')];function createListener(_0x3d4709,_0xf0f46d){return function(_0x35d701){_0xf0f46d['emit'](_0x3d4709,_0x35d701);};}function removeListener(_0x312174,_0x21dfa4){return function(){SmsInteractionEvents['removeListener'](_0x312174,_0x21dfa4);};}exports[_0x39b1('0x4')]=function(_0x9ba945){for(var _0x28f286=0x0,_0xf61d5a=events['length'];_0x28f286<_0xf61d5a;_0x28f286++){var _0x2f2d00=events[_0x28f286];var _0x12cd8c=createListener(_0x39b1('0x5')+_0x2f2d00,_0x9ba945);SmsInteractionEvents['on'](_0x2f2d00,_0x12cd8c);}};
\ No newline at end of file
+var _0x17ac=['emit','register','length','smsInteraction:','./smsInteraction.events','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x17ac,0x12a));var _0xc17a=function(_0x29e87d,_0x1c08a4){_0x29e87d=_0x29e87d-0x0;var _0xeb6662=_0x17ac[_0x29e87d];return _0xeb6662;};'use strict';var SmsInteractionEvents=require(_0xc17a('0x0'));var events=['save',_0xc17a('0x1'),'update'];function createListener(_0x45ada3,_0x2017ca){return function(_0x5e5e09){_0x2017ca[_0xc17a('0x2')](_0x45ada3,_0x5e5e09);};}function removeListener(_0x51532e,_0x21b6b7){return function(){SmsInteractionEvents['removeListener'](_0x51532e,_0x21b6b7);};}exports[_0xc17a('0x3')]=function(_0x4db73d){for(var _0x138d58=0x0,_0x550954=events[_0xc17a('0x4')];_0x138d58<_0x550954;_0x138d58++){var _0x1c79c4=events[_0x138d58];var _0x2886b4=createListener(_0xc17a('0x5')+_0x1c79c4,_0x4db73d);SmsInteractionEvents['on'](_0x1c79c4,_0x2886b4);}};
\ No newline at end of file
index de6b091..8485cb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea17=['describe','/:id','post','tracked','sms','status','put','update','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xea17,0xa3));var _0x7ea1=function(_0x417145,_0x57d625){_0x417145=_0x417145-0x0;var _0x4c0882=_0xea17[_0x417145];return _0x4c0882;};'use strict';var multer=require(_0x7ea1('0x0'));var util=require(_0x7ea1('0x1'));var path=require(_0x7ea1('0x2'));var timeout=require(_0x7ea1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7ea1('0x4'));var auth=require(_0x7ea1('0x5'));var interaction=require(_0x7ea1('0x6'));var config=require('../../config/environment');var controller=require(_0x7ea1('0x7'));router[_0x7ea1('0x8')]('/',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xa')]);router[_0x7ea1('0x8')](_0x7ea1('0xb'),auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xc')]);router['get'](_0x7ea1('0xd'),auth[_0x7ea1('0x9')](),controller['show']);router[_0x7ea1('0xe')]('/',auth['isAuthenticated'](),interaction[_0x7ea1('0xf')](_0x7ea1('0x10'),'smsmessage:create'),controller['create']);router[_0x7ea1('0xe')]('/:id/status',controller[_0x7ea1('0x11')]);router[_0x7ea1('0x12')](_0x7ea1('0xd'),auth['isAuthenticated'](),controller[_0x7ea1('0x13')]);router[_0x7ea1('0x12')]('/:id/accept',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x14')]);router['put'](_0x7ea1('0x15'),auth[_0x7ea1('0x9')](),controller['reject']);router[_0x7ea1('0x16')](_0x7ea1('0xd'),auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x17')]);module[_0x7ea1('0x18')]=router;
\ No newline at end of file
+var _0x395d=['smsmessage:create','create','post','status','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','sms'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x395d,0x1cb));var _0xd395=function(_0x23f7f9,_0x11d194){_0x23f7f9=_0x23f7f9-0x0;var _0x4b8ad0=_0x395d[_0x23f7f9];return _0x4b8ad0;};'use strict';var multer=require(_0xd395('0x0'));var util=require(_0xd395('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd395('0x2'));var router=express[_0xd395('0x3')]();var fs_extra=require(_0xd395('0x4'));var auth=require(_0xd395('0x5'));var interaction=require(_0xd395('0x6'));var config=require(_0xd395('0x7'));var controller=require('./smsMessage.controller');router[_0xd395('0x8')]('/',auth['isAuthenticated'](),controller[_0xd395('0x9')]);router[_0xd395('0x8')](_0xd395('0xa'),auth[_0xd395('0xb')](),controller[_0xd395('0xc')]);router[_0xd395('0x8')](_0xd395('0xd'),auth[_0xd395('0xb')](),controller[_0xd395('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xd395('0xf')](_0xd395('0x10'),_0xd395('0x11')),controller[_0xd395('0x12')]);router[_0xd395('0x13')]('/:id/status',controller[_0xd395('0x14')]);router[_0xd395('0x15')](_0xd395('0xd'),auth[_0xd395('0xb')](),controller[_0xd395('0x16')]);router[_0xd395('0x15')](_0xd395('0x17'),auth[_0xd395('0xb')](),controller[_0xd395('0x18')]);router[_0xd395('0x15')]('/:id/reject',auth[_0xd395('0xb')](),controller[_0xd395('0x19')]);router['delete'](_0xd395('0xd'),auth[_0xd395('0xb')](),controller[_0xd395('0x1a')]);module[_0xd395('0x1b')]=router;
\ No newline at end of file
index 875680a..dadd2c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f2f=['ENUM','out','STRING','DATE','exports','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f2f,0x11c));var _0xf7f2=function(_0x1653b1,_0x35b7d1){_0x1653b1=_0x1653b1-0x0;var _0x3e0b17=_0x7f2f[_0x1653b1];return _0x3e0b17;};'use strict';var Sequelize=require('sequelize');module[_0xf7f2('0x0')]={'body':{'type':Sequelize[_0xf7f2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf7f2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf7f2('0x3')]('in',_0xf7f2('0x4')),'defaultValue':_0xf7f2('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf7f2('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf7f2('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf7f2('0x5')]},'providerResponse':{'type':Sequelize[_0xf7f2('0x1')]}};
\ No newline at end of file
+var _0x155e=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x2f2cb4,_0x391378){var _0x149341=function(_0x511a23){while(--_0x511a23){_0x2f2cb4['push'](_0x2f2cb4['shift']());}};_0x149341(++_0x391378);}(_0x155e,0x9c));var _0xe155=function(_0x11f720,_0x2d5f9d){_0x11f720=_0x11f720-0x0;var _0x2ccbec=_0x155e[_0x11f720];return _0x2ccbec;};'use strict';var Sequelize=require(_0xe155('0x0'));module[_0xe155('0x1')]={'body':{'type':Sequelize[_0xe155('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe155('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe155('0x4')]('in','out'),'defaultValue':_0xe155('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe155('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe155('0x7')]},'secret':{'type':Sequelize[_0xe155('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe155('0x2')]}};
\ No newline at end of file
index 2a7ee0a..d9d8d77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fae=['includeAll','findAll','rows','catch','length','find','create','body','params','describe','sms-interactions','accept','sms','readAt','format','UserId','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','debug','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','rimraf','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','register','client','http','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsMessage'];(function(_0x2f8c99,_0x1970d0){var _0x47eb13=function(_0x56a94f){while(--_0x56a94f){_0x2f8c99['push'](_0x2f8c99['shift']());}};_0x47eb13(++_0x1970d0);}(_0x6fae,0x15b));var _0xe6fa=function(_0x215d0b,_0x14ec67){_0x215d0b=_0x215d0b-0x0;var _0x31211a=_0x6fae[_0x215d0b];return _0x31211a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6fa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe6fa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe6fa('0x2'));var util=require(_0xe6fa('0x3'));var path=require(_0xe6fa('0x4'));var sox=require('sox');var csv=require(_0xe6fa('0x5'));var ejs=require(_0xe6fa('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6fa('0x7'));var squel=require(_0xe6fa('0x8'));var crypto=require(_0xe6fa('0x9'));var jsforce=require(_0xe6fa('0xa'));var deskjs=require(_0xe6fa('0xb'));var toCsv=require(_0xe6fa('0x5'));var querystring=require(_0xe6fa('0xc'));var Papa=require(_0xe6fa('0xd'));var Redis=require(_0xe6fa('0xe'));var authService=require(_0xe6fa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe6fa('0x10'));var hardwareService=require(_0xe6fa('0x11'));var logger=require(_0xe6fa('0x12'))(_0xe6fa('0x13'));var utils=require(_0xe6fa('0x14'));var config=require(_0xe6fa('0x15'));var licenseUtil=require(_0xe6fa('0x16'));var db=require(_0xe6fa('0x17'))['db'];config[_0xe6fa('0x18')]=_['defaults'](config[_0xe6fa('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xe6fa('0x19'))(new Redis(config['redis']));require(_0xe6fa('0x1a'))[_0xe6fa('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe6fa('0x1c')][_0xe6fa('0x1d')]({'port':0x232c});var client9002=jayson[_0xe6fa('0x1c')][_0xe6fa('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1d6eb0,_0x55b749,_0x3670ce,_0x3c88b5){return new BPromise(function(_0x1eb45e,_0x2dc570){var _0x577ae=_0x3c88b5||client;return _0x577ae['request'](_0x1d6eb0,_0x3670ce)['then'](function(_0x29a3a6){logger['info'](_0xe6fa('0x1e'),_0x55b749,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x55b749,_0xe6fa('0x1f'),JSON[_0xe6fa('0x20')](_0x29a3a6));if(_0x29a3a6[_0xe6fa('0x21')]){if(_0x29a3a6[_0xe6fa('0x21')][_0xe6fa('0x22')]===0x1f4){logger['error'](_0xe6fa('0x1e'),_0x55b749,_0x29a3a6['error'][_0xe6fa('0x23')]);return _0x2dc570(_0x29a3a6[_0xe6fa('0x21')][_0xe6fa('0x23')]);}logger[_0xe6fa('0x21')](_0xe6fa('0x1e'),_0x55b749,_0x29a3a6['error']['message']);return _0x1eb45e(_0x29a3a6[_0xe6fa('0x21')]['message']);}else{logger[_0xe6fa('0x24')](_0xe6fa('0x1e'),_0x55b749,'request\x20sent');_0x1eb45e(_0x29a3a6[_0xe6fa('0x25')]['message']);}})['catch'](function(_0x1c4f63){logger[_0xe6fa('0x21')](_0xe6fa('0x1e'),_0x55b749,_0x1c4f63);_0x2dc570(_0x1c4f63);});});}function respondWithStatusCode(_0x280d62,_0x47aba7){_0x47aba7=_0x47aba7||0xcc;return function(_0x3bfb57){if(_0x3bfb57){return _0x280d62[_0xe6fa('0x26')](_0x47aba7);}return _0x280d62[_0xe6fa('0x27')](_0x47aba7)[_0xe6fa('0x28')]();};}function respondWithResult(_0x1d5bf0,_0x398b72){_0x398b72=_0x398b72||0xc8;return function(_0x203d11){if(_0x203d11){return _0x1d5bf0[_0xe6fa('0x27')](_0x398b72)['json'](_0x203d11);}};}function respondWithFilteredResult(_0x6297ed,_0x16e0b7){return function(_0x555511){if(_0x555511){var _0x221fdb=typeof _0x16e0b7[_0xe6fa('0x29')]===_0xe6fa('0x2a')&&typeof _0x16e0b7[_0xe6fa('0x2b')]===_0xe6fa('0x2a');var _0x27ca70=_0x555511[_0xe6fa('0x2c')];var _0x43506a=_0x221fdb?0x0:_0x16e0b7[_0xe6fa('0x29')];var _0x12a849=_0x221fdb?_0x555511[_0xe6fa('0x2c')]:_0x16e0b7[_0xe6fa('0x29')]+_0x16e0b7[_0xe6fa('0x2b')];var _0x4eb671;if(_0x12a849>=_0x27ca70){_0x12a849=_0x27ca70;_0x4eb671=0xc8;}else{_0x4eb671=0xce;}_0x6297ed[_0xe6fa('0x27')](_0x4eb671);return _0x6297ed['set'](_0xe6fa('0x2d'),_0x43506a+'-'+_0x12a849+'/'+_0x27ca70)[_0xe6fa('0x2e')](_0x555511);}return null;};}function patchUpdates(_0x26ccfd){return function(_0x4e8bc7){try{jsonpatch[_0xe6fa('0x2f')](_0x4e8bc7,_0x26ccfd,!![]);}catch(_0x50838b){return BPromise[_0xe6fa('0x30')](_0x50838b);}return _0x4e8bc7[_0xe6fa('0x31')]();};}function saveUpdates(_0x564e3c,_0x2f4689){return function(_0xe83ef3){if(_0xe83ef3){return _0xe83ef3[_0xe6fa('0x32')](_0x564e3c)[_0xe6fa('0x33')](function(_0x3214a9){return _0x3214a9;});}return null;};}function removeEntity(_0x47ac1d,_0x8e94c1){return function(_0xed48c9){if(_0xed48c9){return _0xed48c9[_0xe6fa('0x34')]()[_0xe6fa('0x33')](function(){_0x47ac1d[_0xe6fa('0x27')](0xcc)[_0xe6fa('0x28')]();});}};}function handleEntityNotFound(_0x53a7ba,_0x4de349){return function(_0xe2f43a){if(!_0xe2f43a){_0x53a7ba['sendStatus'](0x194);}return _0xe2f43a;};}function handleError(_0x239ea4,_0x2ab8c6){_0x2ab8c6=_0x2ab8c6||0x1f4;return function(_0x12cc8e){logger[_0xe6fa('0x21')](_0x12cc8e[_0xe6fa('0x35')]);if(_0x12cc8e[_0xe6fa('0x36')]){delete _0x12cc8e[_0xe6fa('0x36')];}_0x239ea4[_0xe6fa('0x27')](_0x2ab8c6)[_0xe6fa('0x37')](_0x12cc8e);};}exports['index']=function(_0x18855e,_0x1a08ab){var _0x21b158={},_0x1a2202={},_0x263fdf={'count':0x0,'rows':[]};var _0x30f97c=_['map'](db['SmsMessage'][_0xe6fa('0x38')],function(_0x6ea742){return{'name':_0x6ea742[_0xe6fa('0x39')],'type':_0x6ea742[_0xe6fa('0x3a')][_0xe6fa('0x3b')]};});_0x1a2202[_0xe6fa('0x3c')]=_[_0xe6fa('0x3d')](_0x30f97c,_0xe6fa('0x36'));_0x1a2202['query']=_[_0xe6fa('0x3e')](_0x18855e[_0xe6fa('0x3f')]);_0x1a2202[_0xe6fa('0x40')]=_['intersection'](_0x1a2202['model'],_0x1a2202[_0xe6fa('0x3f')]);_0x21b158[_0xe6fa('0x41')]=_[_0xe6fa('0x42')](_0x1a2202['model'],qs[_0xe6fa('0x43')](_0x18855e[_0xe6fa('0x3f')]['fields']));_0x21b158[_0xe6fa('0x41')]=_0x21b158['attributes']['length']?_0x21b158['attributes']:_0x1a2202['model'];if(!_0x18855e['query'][_0xe6fa('0x44')](_0xe6fa('0x45'))){_0x21b158[_0xe6fa('0x2b')]=qs[_0xe6fa('0x2b')](_0x18855e[_0xe6fa('0x3f')][_0xe6fa('0x2b')]);_0x21b158['offset']=qs[_0xe6fa('0x29')](_0x18855e[_0xe6fa('0x3f')][_0xe6fa('0x29')]);}_0x21b158[_0xe6fa('0x46')]=qs[_0xe6fa('0x47')](_0x18855e['query']['sort']);_0x21b158[_0xe6fa('0x48')]=qs[_0xe6fa('0x40')](_[_0xe6fa('0x49')](_0x18855e[_0xe6fa('0x3f')],_0x1a2202[_0xe6fa('0x40')]),_0x30f97c);if(_0x18855e['query']['filter']){_0x21b158['where']=_[_0xe6fa('0x4a')](_0x21b158[_0xe6fa('0x48')],{'$or':_['map'](_0x30f97c,function(_0x5b2ce3){if(_0x5b2ce3['type']!==_0xe6fa('0x4b')){var _0x56b2c7={};_0x56b2c7[_0x5b2ce3[_0xe6fa('0x36')]]={'$like':'%'+_0x18855e[_0xe6fa('0x3f')][_0xe6fa('0x4c')]+'%'};return _0x56b2c7;}})});}_0x21b158=_[_0xe6fa('0x4a')]({},_0x21b158,_0x18855e[_0xe6fa('0x4d')]);var _0x4c25f5={'where':_0x21b158[_0xe6fa('0x48')]};return db[_0xe6fa('0x4e')][_0xe6fa('0x2c')](_0x4c25f5)['then'](function(_0x4ae56a){_0x263fdf['count']=_0x4ae56a;if(_0x18855e[_0xe6fa('0x3f')][_0xe6fa('0x4f')]){_0x21b158['include']=[{'all':!![]}];}return db[_0xe6fa('0x4e')][_0xe6fa('0x50')](_0x21b158);})['then'](function(_0x4b99bb){_0x263fdf[_0xe6fa('0x51')]=_0x4b99bb;return _0x263fdf;})[_0xe6fa('0x33')](respondWithFilteredResult(_0x1a08ab,_0x21b158))[_0xe6fa('0x52')](handleError(_0x1a08ab,null));};exports['show']=function(_0x9e654,_0x13a805){var _0xc5b109={'raw':!![],'where':{'id':_0x9e654['params']['id']}},_0x519e2f={};_0x519e2f[_0xe6fa('0x3c')]=_[_0xe6fa('0x3e')](db['SmsMessage'][_0xe6fa('0x38')]);_0x519e2f[_0xe6fa('0x3f')]=_[_0xe6fa('0x3e')](_0x9e654[_0xe6fa('0x3f')]);_0x519e2f[_0xe6fa('0x40')]=_[_0xe6fa('0x42')](_0x519e2f[_0xe6fa('0x3c')],_0x519e2f['query']);_0xc5b109[_0xe6fa('0x41')]=_[_0xe6fa('0x42')](_0x519e2f['model'],qs[_0xe6fa('0x43')](_0x9e654['query'][_0xe6fa('0x43')]));_0xc5b109[_0xe6fa('0x41')]=_0xc5b109[_0xe6fa('0x41')][_0xe6fa('0x53')]?_0xc5b109[_0xe6fa('0x41')]:_0x519e2f[_0xe6fa('0x3c')];if(_0x9e654[_0xe6fa('0x3f')][_0xe6fa('0x4f')]){_0xc5b109['include']=[{'all':!![]}];}_0xc5b109=_['merge']({},_0xc5b109,_0x9e654[_0xe6fa('0x4d')]);return db['SmsMessage'][_0xe6fa('0x54')](_0xc5b109)[_0xe6fa('0x33')](handleEntityNotFound(_0x13a805,null))[_0xe6fa('0x33')](respondWithResult(_0x13a805,null))[_0xe6fa('0x52')](handleError(_0x13a805,null));};exports[_0xe6fa('0x55')]=function(_0x173584,_0x10c058){return db[_0xe6fa('0x4e')][_0xe6fa('0x55')](_0x173584['body'],{})['then'](respondWithResult(_0x10c058,0xc9))[_0xe6fa('0x52')](handleError(_0x10c058,null));};exports['update']=function(_0xb289bf,_0x3659ce){if(_0xb289bf[_0xe6fa('0x56')]['id']){delete _0xb289bf[_0xe6fa('0x56')]['id'];}return db['SmsMessage'][_0xe6fa('0x54')]({'where':{'id':_0xb289bf[_0xe6fa('0x57')]['id']}})[_0xe6fa('0x33')](handleEntityNotFound(_0x3659ce,null))['then'](saveUpdates(_0xb289bf['body'],null))['then'](respondWithResult(_0x3659ce,null))[_0xe6fa('0x52')](handleError(_0x3659ce,null));};exports[_0xe6fa('0x34')]=function(_0x14bf07,_0x19c076){return db[_0xe6fa('0x4e')][_0xe6fa('0x54')]({'where':{'id':_0x14bf07[_0xe6fa('0x57')]['id']}})[_0xe6fa('0x33')](handleEntityNotFound(_0x19c076,null))['then'](removeEntity(_0x19c076,null))[_0xe6fa('0x52')](handleError(_0x19c076,null));};exports[_0xe6fa('0x58')]=function(_0x544dc6,_0x5e2e31){return db[_0xe6fa('0x4e')][_0xe6fa('0x58')]()['then'](respondWithResult(_0x5e2e31,null))[_0xe6fa('0x52')](handleError(_0x5e2e31,null));};var interaction_log=require('../../config/logger')(_0xe6fa('0x59'));exports[_0xe6fa('0x5a')]=function(_0x280efe,_0x28e3af,_0x2cfa87){var _0x16956d={'agent':{},'channel':_0xe6fa('0x5b')};if(_0x280efe['body']['id']){delete _0x280efe['body']['id'];}_0x280efe['body']['read']=!![];_0x280efe[_0xe6fa('0x56')][_0xe6fa('0x5c')]=moment()[_0xe6fa('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x280efe[_0xe6fa('0x56')]['UserId']=_0x280efe['body'][_0xe6fa('0x5e')]||_0x280efe['user']['id'];_0x16956d[_0xe6fa('0x5f')]['id']=_0x280efe[_0xe6fa('0x56')][_0xe6fa('0x5e')];return db[_0xe6fa('0x4e')][_0xe6fa('0x54')]({'where':{'id':_0x280efe['params']['id'],'UserId':null}})[_0xe6fa('0x33')](handleEntityNotFound(_0x28e3af,null))[_0xe6fa('0x33')](saveUpdates(_0x280efe['body'],null))[_0xe6fa('0x33')](function(_0x57c41a){if(_0x57c41a){_0x16956d[_0xe6fa('0x23')]=_0x57c41a['get']({'plain':!![]});return db[_0xe6fa('0x60')]['find']({'where':{'id':_0x57c41a[_0xe6fa('0x61')]}});}return null;})[_0xe6fa('0x33')](handleEntityNotFound(_0x28e3af,null))[_0xe6fa('0x33')](function(_0x57ef30){if(_0x57ef30){return _0x57ef30[_0xe6fa('0x32')]({'UserId':_0x280efe[_0xe6fa('0x56')][_0xe6fa('0x5e')],'read1stAt':_[_0xe6fa('0x62')](_0x57ef30[_0xe6fa('0x63')])?moment()['format'](_0xe6fa('0x64')):undefined});}return null;})[_0xe6fa('0x33')](function(_0x284fcd){if(_0x284fcd){_0x16956d[_0xe6fa('0x65')]=_0x284fcd[_0xe6fa('0x66')]({'plain':!![]});interaction_log[_0xe6fa('0x24')](_0xe6fa('0x67'),_0x280efe[_0xe6fa('0x68')]['id'],_0x280efe[_0xe6fa('0x68')][_0xe6fa('0x36')],_0x280efe[_0xe6fa('0x68')]['role'],_0x16956d[_0xe6fa('0x65')]['id'],_0x280efe[_0xe6fa('0x56')]?JSON[_0xe6fa('0x20')](_0x280efe[_0xe6fa('0x56')]):_0xe6fa('0x69'));return respondWithRpcPromise(_0xe6fa('0x6a'),_0xe6fa('0x6b'),_0x16956d);}return null;})[_0xe6fa('0x33')](function(_0x51b50c){var _0x3fa7f7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x51b50c[_0xe6fa('0x23')]['ContactId'];return db[_0xe6fa('0x6c')]['query'](_0x3fa7f7,{'type':db[_0xe6fa('0x6d')]['QueryTypes'][_0xe6fa('0x6e')],'raw':!![]})[_0xe6fa('0x33')](function(_0x41038f){return _0x41038f;});})[_0xe6fa('0x33')](function(_0x54dcb0){if(_0x54dcb0){_0x16956d[_0xe6fa('0x23')][_0xe6fa('0x6f')]=_0x54dcb0[0x0];if(!_0x280efe['body']['UserId'])return;return db[_0xe6fa('0x70')][_0xe6fa('0x54')]({'where':{'id':_0x280efe['body']['UserId'],'role':'agent'},'attributes':['id',_0xe6fa('0x36'),_0xe6fa('0x71'),'email',_0xe6fa('0x72')],'raw':!![]});}return null;})['then'](function(_0x1832fe){if(!_0x1832fe)return null;_0x16956d[_0xe6fa('0x23')][_0xe6fa('0x5f')]=_0x1832fe;return _0x16956d;})[_0xe6fa('0x33')](function(_0x35c3f3){if(_0x35c3f3){if(_0x280efe['body'][_0xe6fa('0x73')]){_0x16956d[_0xe6fa('0x23')]['interface']=util[_0xe6fa('0x5d')](_0xe6fa('0x74'),_0x280efe[_0xe6fa('0x68')]['name']);_0x16956d['message']['channel']=_0x16956d[_0xe6fa('0x75')];_0x16956d[_0xe6fa('0x23')][_0xe6fa('0x76')]=_0x16956d[_0xe6fa('0x75')];_0x16956d[_0xe6fa('0x23')][_0xe6fa('0x77')]='accept';return respondWithRpcPromise(_0xe6fa('0x78'),_0xe6fa('0x78'),{'event':_0xe6fa('0x79'),'message':_0x16956d[_0xe6fa('0x23')]},client9002)[_0xe6fa('0x33')](function(){return _0x16956d;});}return _0x16956d;}return null;})[_0xe6fa('0x33')](respondWithResult(_0x28e3af,null))[_0xe6fa('0x52')](handleError(_0x28e3af,null));};var interaction_log=require(_0xe6fa('0x12'))(_0xe6fa('0x59'));exports['reject']=function(_0x2a03a2,_0x3fa848,_0x251b39){var _0x4e4aa8={'agent':{},'channel':_0xe6fa('0x5b')};if(_0x2a03a2[_0xe6fa('0x56')]['id']){delete _0x2a03a2[_0xe6fa('0x56')]['id'];}_0x2a03a2['body'][_0xe6fa('0x5e')]=_0x2a03a2['body']['UserId']||_0x2a03a2[_0xe6fa('0x68')]['id'];_0x4e4aa8[_0xe6fa('0x5f')]['id']=_0x2a03a2[_0xe6fa('0x56')][_0xe6fa('0x5e')];return db['SmsMessage'][_0xe6fa('0x54')]({'where':{'id':_0x2a03a2['params']['id'],'UserId':null}})[_0xe6fa('0x33')](handleEntityNotFound(_0x3fa848,null))[_0xe6fa('0x33')](function(_0x382989){if(_0x382989){_0x4e4aa8[_0xe6fa('0x23')]=_0x382989[_0xe6fa('0x66')]({'plain':!![]});return db[_0xe6fa('0x60')][_0xe6fa('0x54')]({'where':{'id':_0x382989[_0xe6fa('0x61')]}});}return null;})[_0xe6fa('0x33')](handleEntityNotFound(_0x3fa848,null))[_0xe6fa('0x33')](function(_0x3c0de7){if(_0x3c0de7){_0x4e4aa8[_0xe6fa('0x65')]=_0x3c0de7['get']({'plain':!![]});interaction_log[_0xe6fa('0x24')](_0xe6fa('0x7a'),_0x2a03a2['user']['id'],_0x2a03a2['user'][_0xe6fa('0x36')],_0x2a03a2[_0xe6fa('0x68')]['role'],_0x4e4aa8[_0xe6fa('0x65')]['id'],_0x2a03a2[_0xe6fa('0x56')]?JSON[_0xe6fa('0x20')](_0x2a03a2[_0xe6fa('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xe6fa('0x7b'),_0x4e4aa8);}return null;})[_0xe6fa('0x33')](function(_0x46b38a){var _0x1a8ab1=_0xe6fa('0x7c')+_0x46b38a[_0xe6fa('0x23')][_0xe6fa('0x7d')];return db[_0xe6fa('0x6c')]['query'](_0x1a8ab1,{'type':db[_0xe6fa('0x6d')][_0xe6fa('0x7e')]['SELECT'],'raw':!![]})['then'](function(_0x5530c5){return _0x5530c5;});})[_0xe6fa('0x33')](function(_0x120786){if(_0x120786){_0x4e4aa8[_0xe6fa('0x23')][_0xe6fa('0x6f')]=_0x120786[0x0];if(!_0x2a03a2[_0xe6fa('0x56')][_0xe6fa('0x5e')])return;return db[_0xe6fa('0x70')][_0xe6fa('0x54')]({'where':{'id':_0x2a03a2[_0xe6fa('0x56')][_0xe6fa('0x5e')],'role':'agent'},'attributes':['id',_0xe6fa('0x36'),_0xe6fa('0x71'),'email',_0xe6fa('0x72')],'raw':!![]});}return null;})[_0xe6fa('0x33')](function(_0x237648){if(!_0x237648)return null;_0x4e4aa8['message'][_0xe6fa('0x5f')]=_0x237648;return _0x4e4aa8;})[_0xe6fa('0x33')](function(_0x1e2de6){if(_0x1e2de6){_0x1e2de6[_0xe6fa('0x23')]['interface']=util['format'](_0xe6fa('0x74'),_0x2a03a2[_0xe6fa('0x68')][_0xe6fa('0x36')]);_0x1e2de6[_0xe6fa('0x23')][_0xe6fa('0x75')]=_0x4e4aa8['channel'];_0x1e2de6[_0xe6fa('0x23')][_0xe6fa('0x76')]=_0x4e4aa8[_0xe6fa('0x75')];_0x1e2de6[_0xe6fa('0x23')][_0xe6fa('0x77')]=_0xe6fa('0x30');respondWithRpcPromise(_0xe6fa('0x78'),_0xe6fa('0x78'),{'event':'rejectmessage','message':_0x1e2de6['message']},client9002);return _0x4e4aa8;}return null;})[_0xe6fa('0x33')](respondWithResult(_0x3fa848,null))[_0xe6fa('0x52')](handleError(_0x3fa848,null));};exports['status']=function(_0x3c0392,_0x2df527,_0x3df904){if(_0x3c0392[_0xe6fa('0x56')]['id']){delete _0x3c0392[_0xe6fa('0x56')]['id'];}var _0xdfa87c;return db[_0xe6fa('0x4e')][_0xe6fa('0x54')]({'where':{'id':_0x3c0392[_0xe6fa('0x57')]['id']}})['then'](handleEntityNotFound(_0x2df527,null))[_0xe6fa('0x33')](function(_0x10dbe4){if(_0x10dbe4){_0xdfa87c=_0x10dbe4;return db['SmsAccount']['find']({'where':{'id':_0x10dbe4['SmsAccountId']}});}})[_0xe6fa('0x33')](handleEntityNotFound(_0x2df527,null))[_0xe6fa('0x33')](function(_0x4aae01){if(_0x4aae01){logger[_0xe6fa('0x7f')](_0xe6fa('0x80'),_0xe6fa('0x27'),'received\x20delivery\x20report\x20from',_0x4aae01[_0xe6fa('0x3a')],util[_0xe6fa('0x81')](_0x3c0392[_0xe6fa('0x56')],{'showHidden':![],'depth':null}));switch(_0x4aae01[_0xe6fa('0x3a')]){case'twilio':if(_0x3c0392['body']['MessageSid']&&_0x3c0392[_0xe6fa('0x56')][_0xe6fa('0x82')]===_0xdfa87c['messageId']){return _0xdfa87c[_0xe6fa('0x32')]({'read':!![]});}else{logger[_0xe6fa('0x21')](_0xe6fa('0x83'),_0xe6fa('0x27'),'twilio',util[_0xe6fa('0x81')](_0x3c0392[_0xe6fa('0x56')],{'showHidden':![],'depth':null}));}break;case _0xe6fa('0x84'):if(_0x3c0392[_0xe6fa('0x56')]['MessageUUID']&&_0x3c0392[_0xe6fa('0x56')][_0xe6fa('0x85')]===_0xdfa87c['messageId']&&_[_0xe6fa('0x86')]([_0xe6fa('0x87'),_0xe6fa('0x88')],_0x3c0392[_0xe6fa('0x56')][_0xe6fa('0x89')])>=0x0){return _0xdfa87c[_0xe6fa('0x32')]({'read':!![]});}else{logger[_0xe6fa('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe6fa('0x27'),_0xe6fa('0x8a'),util['inspect'](_0x3c0392[_0xe6fa('0x56')],{'showHidden':![],'depth':null}));}break;case _0xe6fa('0x8b'):var _0xa10c09=_0x3c0392['body']['results'][0x0];if(_0xa10c09[_0xe6fa('0x27')][_0xe6fa('0x8c')]===_0xe6fa('0x8d')){return _0xdfa87c[_0xe6fa('0x32')]({'read':!![]});}else{logger[_0xe6fa('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe6fa('0x27'),'infobip',util[_0xe6fa('0x81')](_0x3c0392['body'],{'showHidden':![],'depth':null}));}break;}return _0xdfa87c;}})[_0xe6fa('0x33')](respondWithResult(_0x2df527,null))[_0xe6fa('0x52')](handleError(_0x2df527,null));};
\ No newline at end of file
+var _0x6fc2=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','message','error','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','SmsMessage','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','keys','find','create','body','update','describe','accept','sms','readAt','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','role','interaction','AcceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','groupName','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring'];(function(_0x26869d,_0x87fdad){var _0x118e2c=function(_0x4d05dc){while(--_0x4d05dc){_0x26869d['push'](_0x26869d['shift']());}};_0x118e2c(++_0x87fdad);}(_0x6fc2,0x117));var _0x26fc=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x6fc2[_0x47aa64];return _0x549c7a;};'use strict';var emlformat=require(_0x26fc('0x0'));var rimraf=require(_0x26fc('0x1'));var zipdir=require(_0x26fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26fc('0x3'));var moment=require(_0x26fc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x26fc('0x5'));var sox=require(_0x26fc('0x6'));var csv=require('to-csv');var ejs=require(_0x26fc('0x7'));var fs=require('fs');var fs_extra=require(_0x26fc('0x8'));var _=require(_0x26fc('0x9'));var squel=require(_0x26fc('0xa'));var crypto=require('crypto');var jsforce=require(_0x26fc('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x26fc('0xc'));var Papa=require(_0x26fc('0xd'));var Redis=require(_0x26fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x26fc('0xf'));var as=require(_0x26fc('0x10'));var hardwareService=require(_0x26fc('0x11'));var logger=require(_0x26fc('0x12'))(_0x26fc('0x13'));var utils=require(_0x26fc('0x14'));var config=require(_0x26fc('0x15'));var licenseUtil=require(_0x26fc('0x16'));var db=require(_0x26fc('0x17'))['db'];config[_0x26fc('0x18')]=_[_0x26fc('0x19')](config[_0x26fc('0x18')],{'host':_0x26fc('0x1a'),'port':0x18eb});var socket=require(_0x26fc('0x1b'))(new Redis(config[_0x26fc('0x18')]));require(_0x26fc('0x1c'))['register'](socket);var jayson=require(_0x26fc('0x1d'));var client=jayson[_0x26fc('0x1e')][_0x26fc('0x1f')]({'port':0x232c});var client9002=jayson[_0x26fc('0x1e')][_0x26fc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x29afb9,_0x1e42de,_0x383f2f,_0x351926){return new BPromise(function(_0x54f0e5,_0x2d5a7c){var _0x56b4e7=_0x351926||client;return _0x56b4e7[_0x26fc('0x20')](_0x29afb9,_0x383f2f)[_0x26fc('0x21')](function(_0x2732a4){logger[_0x26fc('0x22')]('SmsMessage,\x20%s,\x20%s',_0x1e42de,_0x26fc('0x23'));logger[_0x26fc('0x24')](_0x26fc('0x25'),_0x1e42de,_0x26fc('0x23'),JSON[_0x26fc('0x26')](_0x2732a4));if(_0x2732a4['error']){if(_0x2732a4['error']['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1e42de,_0x2732a4['error'][_0x26fc('0x27')]);return _0x2d5a7c(_0x2732a4['error'][_0x26fc('0x27')]);}logger[_0x26fc('0x28')]('SmsMessage,\x20%s,\x20%s',_0x1e42de,_0x2732a4[_0x26fc('0x28')][_0x26fc('0x27')]);return _0x54f0e5(_0x2732a4[_0x26fc('0x28')][_0x26fc('0x27')]);}else{logger[_0x26fc('0x22')](_0x26fc('0x29'),_0x1e42de,'request\x20sent');_0x54f0e5(_0x2732a4[_0x26fc('0x2a')][_0x26fc('0x27')]);}})[_0x26fc('0x2b')](function(_0x3e51fc){logger[_0x26fc('0x28')](_0x26fc('0x29'),_0x1e42de,_0x3e51fc);_0x2d5a7c(_0x3e51fc);});});}function respondWithStatusCode(_0x430a98,_0x5b9dba){_0x5b9dba=_0x5b9dba||0xcc;return function(_0x3c5dcc){if(_0x3c5dcc){return _0x430a98[_0x26fc('0x2c')](_0x5b9dba);}return _0x430a98[_0x26fc('0x2d')](_0x5b9dba)[_0x26fc('0x2e')]();};}function respondWithResult(_0x57851e,_0x12ecb7){_0x12ecb7=_0x12ecb7||0xc8;return function(_0x4f968a){if(_0x4f968a){return _0x57851e[_0x26fc('0x2d')](_0x12ecb7)[_0x26fc('0x2f')](_0x4f968a);}};}function respondWithFilteredResult(_0x3bff70,_0x32088c){return function(_0x2bde13){if(_0x2bde13){var _0x14ecff=typeof _0x32088c[_0x26fc('0x30')]===_0x26fc('0x31')&&typeof _0x32088c['limit']==='undefined';var _0x47b642=_0x2bde13[_0x26fc('0x32')];var _0x4b7ee4=_0x14ecff?0x0:_0x32088c['offset'];var _0x20e995=_0x14ecff?_0x2bde13[_0x26fc('0x32')]:_0x32088c[_0x26fc('0x30')]+_0x32088c[_0x26fc('0x33')];var _0x200ba9;if(_0x20e995>=_0x47b642){_0x20e995=_0x47b642;_0x200ba9=0xc8;}else{_0x200ba9=0xce;}_0x3bff70[_0x26fc('0x2d')](_0x200ba9);return _0x3bff70[_0x26fc('0x34')](_0x26fc('0x35'),_0x4b7ee4+'-'+_0x20e995+'/'+_0x47b642)[_0x26fc('0x2f')](_0x2bde13);}return null;};}function patchUpdates(_0x2466ab){return function(_0x51e478){try{jsonpatch[_0x26fc('0x36')](_0x51e478,_0x2466ab,!![]);}catch(_0x3e51b0){return BPromise[_0x26fc('0x37')](_0x3e51b0);}return _0x51e478[_0x26fc('0x38')]();};}function saveUpdates(_0x2fde81,_0x190092){return function(_0x143a56){if(_0x143a56){return _0x143a56['update'](_0x2fde81)[_0x26fc('0x21')](function(_0x5c0265){return _0x5c0265;});}return null;};}function removeEntity(_0x9a1edf,_0xbe2fdd){return function(_0xbe82bf){if(_0xbe82bf){return _0xbe82bf[_0x26fc('0x39')]()[_0x26fc('0x21')](function(){_0x9a1edf['status'](0xcc)[_0x26fc('0x2e')]();});}};}function handleEntityNotFound(_0x4664ec,_0x47c4df){return function(_0x1cf6f0){if(!_0x1cf6f0){_0x4664ec['sendStatus'](0x194);}return _0x1cf6f0;};}function handleError(_0x440451,_0x4264a0){_0x4264a0=_0x4264a0||0x1f4;return function(_0xb7b0a6){logger[_0x26fc('0x28')](_0xb7b0a6[_0x26fc('0x3a')]);if(_0xb7b0a6[_0x26fc('0x3b')]){delete _0xb7b0a6['name'];}_0x440451['status'](_0x4264a0)[_0x26fc('0x3c')](_0xb7b0a6);};}exports[_0x26fc('0x3d')]=function(_0x31a2fe,_0x1205e8){var _0x4c69e4={},_0x235861={},_0x3909fc={'count':0x0,'rows':[]};var _0x58ebb0=_[_0x26fc('0x3e')](db[_0x26fc('0x3f')]['rawAttributes'],function(_0x53836){return{'name':_0x53836[_0x26fc('0x40')],'type':_0x53836[_0x26fc('0x41')]['key']};});_0x235861[_0x26fc('0x42')]=_[_0x26fc('0x3e')](_0x58ebb0,'name');_0x235861[_0x26fc('0x43')]=_['keys'](_0x31a2fe[_0x26fc('0x43')]);_0x235861[_0x26fc('0x44')]=_[_0x26fc('0x45')](_0x235861[_0x26fc('0x42')],_0x235861[_0x26fc('0x43')]);_0x4c69e4[_0x26fc('0x46')]=_[_0x26fc('0x45')](_0x235861[_0x26fc('0x42')],qs[_0x26fc('0x47')](_0x31a2fe[_0x26fc('0x43')][_0x26fc('0x47')]));_0x4c69e4[_0x26fc('0x46')]=_0x4c69e4['attributes'][_0x26fc('0x48')]?_0x4c69e4[_0x26fc('0x46')]:_0x235861[_0x26fc('0x42')];if(!_0x31a2fe[_0x26fc('0x43')][_0x26fc('0x49')](_0x26fc('0x4a'))){_0x4c69e4[_0x26fc('0x33')]=qs['limit'](_0x31a2fe['query'][_0x26fc('0x33')]);_0x4c69e4[_0x26fc('0x30')]=qs['offset'](_0x31a2fe[_0x26fc('0x43')][_0x26fc('0x30')]);}_0x4c69e4[_0x26fc('0x4b')]=qs['sort'](_0x31a2fe[_0x26fc('0x43')][_0x26fc('0x4c')]);_0x4c69e4[_0x26fc('0x4d')]=qs[_0x26fc('0x44')](_[_0x26fc('0x4e')](_0x31a2fe[_0x26fc('0x43')],_0x235861[_0x26fc('0x44')]),_0x58ebb0);if(_0x31a2fe[_0x26fc('0x43')][_0x26fc('0x4f')]){_0x4c69e4[_0x26fc('0x4d')]=_[_0x26fc('0x50')](_0x4c69e4['where'],{'$or':_[_0x26fc('0x3e')](_0x58ebb0,function(_0x26b10d){if(_0x26b10d['type']!==_0x26fc('0x51')){var _0x354ec0={};_0x354ec0[_0x26b10d[_0x26fc('0x3b')]]={'$like':'%'+_0x31a2fe['query'][_0x26fc('0x4f')]+'%'};return _0x354ec0;}})});}_0x4c69e4=_[_0x26fc('0x50')]({},_0x4c69e4,_0x31a2fe[_0x26fc('0x52')]);var _0x3138e6={'where':_0x4c69e4[_0x26fc('0x4d')]};return db['SmsMessage'][_0x26fc('0x32')](_0x3138e6)[_0x26fc('0x21')](function(_0x5de812){_0x3909fc[_0x26fc('0x32')]=_0x5de812;if(_0x31a2fe[_0x26fc('0x43')][_0x26fc('0x53')]){_0x4c69e4['include']=[{'all':!![]}];}return db[_0x26fc('0x3f')][_0x26fc('0x54')](_0x4c69e4);})[_0x26fc('0x21')](function(_0x5de799){_0x3909fc['rows']=_0x5de799;return _0x3909fc;})[_0x26fc('0x21')](respondWithFilteredResult(_0x1205e8,_0x4c69e4))[_0x26fc('0x2b')](handleError(_0x1205e8,null));};exports[_0x26fc('0x55')]=function(_0x1cf350,_0x1be427){var _0x52e606={'raw':!![],'where':{'id':_0x1cf350[_0x26fc('0x56')]['id']}},_0x5f1c7c={};_0x5f1c7c['model']=_['keys'](db[_0x26fc('0x3f')][_0x26fc('0x57')]);_0x5f1c7c[_0x26fc('0x43')]=_[_0x26fc('0x58')](_0x1cf350[_0x26fc('0x43')]);_0x5f1c7c[_0x26fc('0x44')]=_[_0x26fc('0x45')](_0x5f1c7c[_0x26fc('0x42')],_0x5f1c7c[_0x26fc('0x43')]);_0x52e606[_0x26fc('0x46')]=_['intersection'](_0x5f1c7c[_0x26fc('0x42')],qs[_0x26fc('0x47')](_0x1cf350[_0x26fc('0x43')]['fields']));_0x52e606[_0x26fc('0x46')]=_0x52e606['attributes']['length']?_0x52e606[_0x26fc('0x46')]:_0x5f1c7c['model'];if(_0x1cf350['query'][_0x26fc('0x53')]){_0x52e606['include']=[{'all':!![]}];}_0x52e606=_[_0x26fc('0x50')]({},_0x52e606,_0x1cf350[_0x26fc('0x52')]);return db['SmsMessage'][_0x26fc('0x59')](_0x52e606)[_0x26fc('0x21')](handleEntityNotFound(_0x1be427,null))[_0x26fc('0x21')](respondWithResult(_0x1be427,null))[_0x26fc('0x2b')](handleError(_0x1be427,null));};exports[_0x26fc('0x5a')]=function(_0x14d99f,_0x4e9327){return db[_0x26fc('0x3f')]['create'](_0x14d99f[_0x26fc('0x5b')],{})[_0x26fc('0x21')](respondWithResult(_0x4e9327,0xc9))[_0x26fc('0x2b')](handleError(_0x4e9327,null));};exports[_0x26fc('0x5c')]=function(_0x3db60c,_0x2f8611){if(_0x3db60c[_0x26fc('0x5b')]['id']){delete _0x3db60c['body']['id'];}return db[_0x26fc('0x3f')][_0x26fc('0x59')]({'where':{'id':_0x3db60c[_0x26fc('0x56')]['id']}})[_0x26fc('0x21')](handleEntityNotFound(_0x2f8611,null))[_0x26fc('0x21')](saveUpdates(_0x3db60c[_0x26fc('0x5b')],null))['then'](respondWithResult(_0x2f8611,null))[_0x26fc('0x2b')](handleError(_0x2f8611,null));};exports[_0x26fc('0x39')]=function(_0x25573d,_0x566751){return db[_0x26fc('0x3f')][_0x26fc('0x59')]({'where':{'id':_0x25573d['params']['id']}})[_0x26fc('0x21')](handleEntityNotFound(_0x566751,null))[_0x26fc('0x21')](removeEntity(_0x566751,null))[_0x26fc('0x2b')](handleError(_0x566751,null));};exports[_0x26fc('0x5d')]=function(_0x1773f0,_0x7c55b2){return db[_0x26fc('0x3f')]['describe']()[_0x26fc('0x21')](respondWithResult(_0x7c55b2,null))['catch'](handleError(_0x7c55b2,null));};var interaction_log=require(_0x26fc('0x12'))('sms-interactions');exports[_0x26fc('0x5e')]=function(_0x5548c0,_0x14e4b7,_0x2405ec){var _0x49f685={'agent':{},'channel':_0x26fc('0x5f')};if(_0x5548c0[_0x26fc('0x5b')]['id']){delete _0x5548c0[_0x26fc('0x5b')]['id'];}_0x5548c0['body']['read']=!![];_0x5548c0['body'][_0x26fc('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5548c0[_0x26fc('0x5b')][_0x26fc('0x61')]=_0x5548c0['body']['UserId']||_0x5548c0[_0x26fc('0x62')]['id'];_0x49f685[_0x26fc('0x63')]['id']=_0x5548c0[_0x26fc('0x5b')][_0x26fc('0x61')];return db['SmsMessage'][_0x26fc('0x59')]({'where':{'id':_0x5548c0['params']['id'],'UserId':null}})[_0x26fc('0x21')](handleEntityNotFound(_0x14e4b7,null))['then'](saveUpdates(_0x5548c0['body'],null))[_0x26fc('0x21')](function(_0x44b79b){if(_0x44b79b){_0x49f685[_0x26fc('0x27')]=_0x44b79b[_0x26fc('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x26fc('0x59')]({'where':{'id':_0x44b79b[_0x26fc('0x65')]}});}return null;})[_0x26fc('0x21')](handleEntityNotFound(_0x14e4b7,null))[_0x26fc('0x21')](function(_0x298310){if(_0x298310){return _0x298310[_0x26fc('0x5c')]({'UserId':_0x5548c0[_0x26fc('0x5b')]['UserId'],'read1stAt':_[_0x26fc('0x66')](_0x298310[_0x26fc('0x67')])?moment()[_0x26fc('0x68')](_0x26fc('0x69')):undefined});}return null;})[_0x26fc('0x21')](function(_0x2de0b9){if(_0x2de0b9){_0x49f685['interaction']=_0x2de0b9[_0x26fc('0x64')]({'plain':!![]});interaction_log[_0x26fc('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5548c0[_0x26fc('0x62')]['id'],_0x5548c0[_0x26fc('0x62')][_0x26fc('0x3b')],_0x5548c0[_0x26fc('0x62')][_0x26fc('0x6a')],_0x49f685[_0x26fc('0x6b')]['id'],_0x5548c0[_0x26fc('0x5b')]?JSON['stringify'](_0x5548c0[_0x26fc('0x5b')]):'null');return respondWithRpcPromise(_0x26fc('0x6c'),'acceptMessage',_0x49f685);}return null;})[_0x26fc('0x21')](function(_0x3f9416){var _0x6bbd55='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f9416[_0x26fc('0x27')][_0x26fc('0x6d')];return db[_0x26fc('0x6e')][_0x26fc('0x43')](_0x6bbd55,{'type':db['Sequelize'][_0x26fc('0x6f')][_0x26fc('0x70')],'raw':!![]})[_0x26fc('0x21')](function(_0x11d5a6){return _0x11d5a6;});})['then'](function(_0x281a2d){if(_0x281a2d){_0x49f685[_0x26fc('0x27')][_0x26fc('0x71')]=_0x281a2d[0x0];if(!_0x5548c0[_0x26fc('0x5b')][_0x26fc('0x61')])return;return db['User'][_0x26fc('0x59')]({'where':{'id':_0x5548c0[_0x26fc('0x5b')][_0x26fc('0x61')],'role':'agent'},'attributes':['id','name',_0x26fc('0x72'),_0x26fc('0x73'),_0x26fc('0x74')],'raw':!![]});}return null;})[_0x26fc('0x21')](function(_0x499768){if(!_0x499768)return null;_0x49f685['message'][_0x26fc('0x63')]=_0x499768;return _0x49f685;})[_0x26fc('0x21')](function(_0x25d5b3){if(_0x25d5b3){if(_0x5548c0[_0x26fc('0x5b')]['manual']){_0x49f685[_0x26fc('0x27')][_0x26fc('0x75')]=util[_0x26fc('0x68')](_0x26fc('0x76'),_0x5548c0[_0x26fc('0x62')][_0x26fc('0x3b')]);_0x49f685[_0x26fc('0x27')][_0x26fc('0x77')]=_0x49f685['channel'];_0x49f685[_0x26fc('0x27')][_0x26fc('0x78')]=_0x49f685[_0x26fc('0x77')];_0x49f685[_0x26fc('0x27')][_0x26fc('0x79')]=_0x26fc('0x5e');return respondWithRpcPromise('EventManager',_0x26fc('0x7a'),{'event':'acceptmessage','message':_0x49f685[_0x26fc('0x27')]},client9002)[_0x26fc('0x21')](function(){return _0x49f685;});}return _0x49f685;}return null;})[_0x26fc('0x21')](respondWithResult(_0x14e4b7,null))[_0x26fc('0x2b')](handleError(_0x14e4b7,null));};var interaction_log=require(_0x26fc('0x12'))('sms-interactions');exports[_0x26fc('0x37')]=function(_0x348748,_0x15a3fb,_0x25f322){var _0x1b875c={'agent':{},'channel':_0x26fc('0x5f')};if(_0x348748[_0x26fc('0x5b')]['id']){delete _0x348748['body']['id'];}_0x348748[_0x26fc('0x5b')]['UserId']=_0x348748['body'][_0x26fc('0x61')]||_0x348748[_0x26fc('0x62')]['id'];_0x1b875c[_0x26fc('0x63')]['id']=_0x348748['body']['UserId'];return db[_0x26fc('0x3f')]['find']({'where':{'id':_0x348748['params']['id'],'UserId':null}})[_0x26fc('0x21')](handleEntityNotFound(_0x15a3fb,null))[_0x26fc('0x21')](function(_0x550c08){if(_0x550c08){_0x1b875c[_0x26fc('0x27')]=_0x550c08[_0x26fc('0x64')]({'plain':!![]});return db[_0x26fc('0x7b')][_0x26fc('0x59')]({'where':{'id':_0x550c08['SmsInteractionId']}});}return null;})[_0x26fc('0x21')](handleEntityNotFound(_0x15a3fb,null))[_0x26fc('0x21')](function(_0x5b097e){if(_0x5b097e){_0x1b875c['interaction']=_0x5b097e[_0x26fc('0x64')]({'plain':!![]});interaction_log[_0x26fc('0x22')](_0x26fc('0x7c'),_0x348748['user']['id'],_0x348748[_0x26fc('0x62')]['name'],_0x348748[_0x26fc('0x62')][_0x26fc('0x6a')],_0x1b875c['interaction']['id'],_0x348748[_0x26fc('0x5b')]?JSON[_0x26fc('0x26')](_0x348748[_0x26fc('0x5b')]):'null');return respondWithRpcPromise(_0x26fc('0x7d'),_0x26fc('0x7e'),_0x1b875c);}return null;})['then'](function(_0x462136){var _0x160871=_0x26fc('0x7f')+_0x462136[_0x26fc('0x27')][_0x26fc('0x6d')];return db[_0x26fc('0x6e')]['query'](_0x160871,{'type':db[_0x26fc('0x80')]['QueryTypes'][_0x26fc('0x70')],'raw':!![]})[_0x26fc('0x21')](function(_0x5f112f){return _0x5f112f;});})['then'](function(_0xe0304f){if(_0xe0304f){_0x1b875c[_0x26fc('0x27')][_0x26fc('0x71')]=_0xe0304f[0x0];if(!_0x348748[_0x26fc('0x5b')][_0x26fc('0x61')])return;return db[_0x26fc('0x81')][_0x26fc('0x59')]({'where':{'id':_0x348748[_0x26fc('0x5b')][_0x26fc('0x61')],'role':_0x26fc('0x63')},'attributes':['id','name','fullname',_0x26fc('0x73'),_0x26fc('0x74')],'raw':!![]});}return null;})['then'](function(_0x7de4c2){if(!_0x7de4c2)return null;_0x1b875c[_0x26fc('0x27')][_0x26fc('0x63')]=_0x7de4c2;return _0x1b875c;})[_0x26fc('0x21')](function(_0x5b5171){if(_0x5b5171){_0x5b5171[_0x26fc('0x27')][_0x26fc('0x75')]=util['format'](_0x26fc('0x76'),_0x348748[_0x26fc('0x62')][_0x26fc('0x3b')]);_0x5b5171['message']['channel']=_0x1b875c[_0x26fc('0x77')];_0x5b5171[_0x26fc('0x27')]['motionChannel']=_0x1b875c[_0x26fc('0x77')];_0x5b5171[_0x26fc('0x27')][_0x26fc('0x79')]='reject';respondWithRpcPromise(_0x26fc('0x7a'),_0x26fc('0x7a'),{'event':_0x26fc('0x82'),'message':_0x5b5171[_0x26fc('0x27')]},client9002);return _0x1b875c;}return null;})['then'](respondWithResult(_0x15a3fb,null))['catch'](handleError(_0x15a3fb,null));};exports[_0x26fc('0x2d')]=function(_0x2589f8,_0x3e857b,_0x3160be){if(_0x2589f8['body']['id']){delete _0x2589f8[_0x26fc('0x5b')]['id'];}var _0x5a58c6;return db[_0x26fc('0x3f')][_0x26fc('0x59')]({'where':{'id':_0x2589f8['params']['id']}})[_0x26fc('0x21')](handleEntityNotFound(_0x3e857b,null))[_0x26fc('0x21')](function(_0x9052a8){if(_0x9052a8){_0x5a58c6=_0x9052a8;return db['SmsAccount'][_0x26fc('0x59')]({'where':{'id':_0x9052a8[_0x26fc('0x83')]}});}})[_0x26fc('0x21')](handleEntityNotFound(_0x3e857b,null))[_0x26fc('0x21')](function(_0x327518){if(_0x327518){logger[_0x26fc('0x24')](_0x26fc('0x25'),_0x26fc('0x2d'),_0x26fc('0x84'),_0x327518['type'],util[_0x26fc('0x85')](_0x2589f8[_0x26fc('0x5b')],{'showHidden':![],'depth':null}));switch(_0x327518['type']){case _0x26fc('0x86'):if(_0x2589f8[_0x26fc('0x5b')][_0x26fc('0x87')]&&_0x2589f8['body'][_0x26fc('0x87')]===_0x5a58c6[_0x26fc('0x88')]){return _0x5a58c6['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x26fc('0x2d'),_0x26fc('0x86'),util['inspect'](_0x2589f8[_0x26fc('0x5b')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2589f8[_0x26fc('0x5b')][_0x26fc('0x89')]&&_0x2589f8[_0x26fc('0x5b')][_0x26fc('0x89')]===_0x5a58c6[_0x26fc('0x88')]&&_[_0x26fc('0x8a')]([_0x26fc('0x8b'),_0x26fc('0x8c')],_0x2589f8['body'][_0x26fc('0x8d')])>=0x0){return _0x5a58c6[_0x26fc('0x5c')]({'read':!![]});}else{logger[_0x26fc('0x28')](_0x26fc('0x8e'),'status','plivio',util[_0x26fc('0x85')](_0x2589f8[_0x26fc('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x26fc('0x8f'):var _0xaa15d6=_0x2589f8['body'][_0x26fc('0x90')][0x0];if(_0xaa15d6[_0x26fc('0x2d')][_0x26fc('0x91')]==='DELIVERED'){return _0x5a58c6[_0x26fc('0x5c')]({'read':!![]});}else{logger[_0x26fc('0x28')](_0x26fc('0x8e'),'status',_0x26fc('0x8f'),util['inspect'](_0x2589f8['body'],{'showHidden':![],'depth':null}));}break;}return _0x5a58c6;}})[_0x26fc('0x21')](respondWithResult(_0x3e857b,null))[_0x26fc('0x2b')](handleError(_0x3e857b,null));};
\ No newline at end of file
index 54c3424..ab79b87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c0=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x25bbca,_0x12e89d){var _0x230068=function(_0x24762f){while(--_0x24762f){_0x25bbca['push'](_0x25bbca['shift']());}};_0x230068(++_0x12e89d);}(_0xd7c0,0x170));var _0x0d7c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd7c0[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x0d7c('0x0'))['db'][_0x0d7c('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0d7c('0x2')](0x0);var events={'afterCreate':_0x0d7c('0x3'),'afterUpdate':_0x0d7c('0x4'),'afterDestroy':_0x0d7c('0x5')};function emitEvent(_0x152abe){return function(_0x205e8a,_0x236934,_0x477983){SmsMessageEvents[_0x0d7c('0x6')](_0x152abe+':'+_0x205e8a['id'],_0x205e8a);SmsMessageEvents[_0x0d7c('0x6')](_0x152abe,_0x205e8a);_0x477983(null);};}for(var e in events){if(events[_0x0d7c('0x7')](e)){var event=events[e];SmsMessage[_0x0d7c('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
+var _0x1382=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x226c6d,_0x4f9826){var _0x5495b5=function(_0x58955c){while(--_0x58955c){_0x226c6d['push'](_0x226c6d['shift']());}};_0x5495b5(++_0x4f9826);}(_0x1382,0xd2));var _0x2138=function(_0x4b921b,_0x3cc071){_0x4b921b=_0x4b921b-0x0;var _0x49379f=_0x1382[_0x4b921b];return _0x49379f;};'use strict';var EventEmitter=require(_0x2138('0x0'));var SmsMessage=require(_0x2138('0x1'))['db'][_0x2138('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2138('0x3')](0x0);var events={'afterCreate':_0x2138('0x4'),'afterUpdate':_0x2138('0x5'),'afterDestroy':'remove'};function emitEvent(_0x19f09d){return function(_0x30a37,_0x5c0020,_0x2deeec){SmsMessageEvents[_0x2138('0x6')](_0x19f09d+':'+_0x30a37['id'],_0x30a37);SmsMessageEvents[_0x2138('0x6')](_0x19f09d,_0x30a37);_0x2deeec(null);};}for(var e in events){if(events[_0x2138('0x7')](e)){var event=events[e];SmsMessage[_0x2138('0x8')](e,emitEvent(event));}}module[_0x2138('0x9')]=SmsMessageEvents;
\ No newline at end of file
index 125e30c..1758bf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21d8=['authId','remote','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','apiKey','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','GET','/external/get/send.php?','id_sms','clickatell','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','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','password','body','smsMethod','sender','&password=','POST','user_key','session_key','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend'];(function(_0x3b96e5,_0x124abe){var _0x8facbe=function(_0x5a95ac){while(--_0x5a95ac){_0x3b96e5['push'](_0x3b96e5['shift']());}};_0x8facbe(++_0x124abe);}(_0x21d8,0xac));var _0x821d=function(_0xcbdfca,_0x2e68ab){_0xcbdfca=_0xcbdfca-0x0;var _0x3d1405=_0x21d8[_0xcbdfca];return _0x3d1405;};'use strict';var _=require(_0x821d('0x0'));var util=require(_0x821d('0x1'));var logger=require(_0x821d('0x2'))('api');var moment=require(_0x821d('0x3'));var BPromise=require(_0x821d('0x4'));var rp=require(_0x821d('0x5'));var fs=require('fs');var path=require(_0x821d('0x6'));var rimraf=require(_0x821d('0x7'));var config=require(_0x821d('0x8'));var attributes=require(_0x821d('0x9'));module[_0x821d('0xa')]=function(_0x33c9dc,_0x57851c){return _0x33c9dc[_0x821d('0xb')](_0x821d('0xc'),attributes,{'tableName':_0x821d('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x821d('0xe')]},{'name':_0x821d('0xf'),'fields':['body'],'type':_0x821d('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31f614,_0x34ca8a,_0x3dfaa8){var _0x16bec6=_0x33c9dc[_0x821d('0x11')];var _0x4ef7a4=_0x31f614[_0x821d('0x12')]({'plain':!![]});if(_0x4ef7a4[_0x821d('0x13')][_0x821d('0x14')]()==='in'||_0x4ef7a4['direction'][_0x821d('0x14')]()===_0x821d('0x15')&&!_0x4ef7a4['secret']&&!_[_0x821d('0x16')](_0x4ef7a4[_0x821d('0x17')])&&!_['isNil'](_0x4ef7a4[_0x821d('0x18')])){_0x16bec6['SmsInteraction'][_0x821d('0x19')]({'where':{'id':_0x4ef7a4[_0x821d('0x18')]}})[_0x821d('0x1a')](function(_0x9dc860){if(_0x9dc860){_0x9dc860[_0x821d('0x1b')]({'lastMsgAt':_0x4ef7a4[_0x821d('0x1c')],'lastMsgDirection':_0x4ef7a4['direction'][_0x821d('0x14')]()});}})[_0x821d('0x1d')](function(_0x4db14b){console[_0x821d('0x1e')](_0x4db14b);});}if(_0x4ef7a4['direction']===_0x821d('0x15')&&!_0x4ef7a4['secret']){var _0x36e24a;_0x16bec6[_0x821d('0x1f')][_0x821d('0x20')]({'where':{'id':_0x4ef7a4[_0x821d('0x21')]},'raw':!![]})[_0x821d('0x1a')](function(_0x5c6c56){_0x36e24a=_0x5c6c56;if(_0x36e24a&&_0x36e24a[_0x821d('0x22')]){switch(_0x36e24a[_0x821d('0x22')]){case _0x821d('0x23'):var _0x40ab2a=require(_0x821d('0x23'));if(_0x36e24a[_0x821d('0x24')]&&_0x36e24a[_0x821d('0x25')]&&_0x36e24a[_0x821d('0x26')]){var _0x3ed901=new _0x40ab2a(_0x36e24a[_0x821d('0x24')],_0x36e24a['authToken']);_0x3ed901[_0x821d('0x27')][_0x821d('0x28')]({'body':_0x4ef7a4['body'],'to':_0x4ef7a4[_0x821d('0x26')],'from':_0x36e24a[_0x821d('0x26')],'statusCallback':_0x36e24a['remote']+_0x821d('0x29')+_0x4ef7a4['id']+_0x821d('0x2a')+_0x36e24a[_0x821d('0x2b')]})[_0x821d('0x1a')](function(_0x1dc0d3){if(_0x1dc0d3[_0x821d('0x2c')]){return _0x31f614[_0x821d('0x1b')]({'messageId':_0x1dc0d3[_0x821d('0x2c')]});}})[_0x821d('0x1d')](function(_0x19bdd4){logger['error'](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x23'),util[_0x821d('0x2f')](_0x19bdd4,{'showHidden':![],'depth':null}));});}else{logger[_0x821d('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x821d('0x2e'),_0x821d('0x23'),_0x821d('0x30'));}break;case _0x821d('0x31'):var _0x9a384a=_0x821d('0x32');if(_0x36e24a[_0x821d('0x33')]&&_0x36e24a[_0x821d('0x34')]){var _0xfd55df={'recipient':[_0x4ef7a4[_0x821d('0x26')]],'message':_0x4ef7a4[_0x821d('0x35')],'message_type':_0x36e24a[_0x821d('0x36')]};if(_0x36e24a['smsMethod']&&_0x36e24a[_0x821d('0x36')]!=='SI'){_0xfd55df[_0x821d('0x37')]=_0x36e24a[_0x821d('0x26')];}var _0x2a4494={'url':_0x9a384a+'login?username='+_0x36e24a[_0x821d('0x33')]+_0x821d('0x38')+_0x36e24a[_0x821d('0x34')],'method':'GET'};rp(_0x2a4494)['then'](function(_0xe06c22){var _0x551123=_0xe06c22['split'](';');var _0x134a2e={'user_key':_0x551123[0x0],'session_key':_0x551123[0x1]};_0x2a4494={'url':_0x9a384a+'sms','method':_0x821d('0x39'),'headers':{'user_key':_0x134a2e[_0x821d('0x3a')],'Session_key':_0x134a2e[_0x821d('0x3b')]},'json':!![],'body':_0xfd55df};return rp(_0x2a4494);})['then'](function(_0x4a2b7f){if(_0x4a2b7f['total_sent']>=0x1){var _0x12eca5={'messageId':_0x4a2b7f[_0x821d('0x3c')]};if(_0x36e24a[_0x821d('0x36')]!=='GP'||!_0x36e24a[_0x821d('0x3d')]){_0x12eca5['read']=!![];}return _0x31f614[_0x821d('0x1b')](_0x12eca5);}else{return logger[_0x821d('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x821d('0x2e'),_0x821d('0x31'),util[_0x821d('0x2f')](_0x4a2b7f,{'showHidden':![],'depth':null}));}})[_0x821d('0x1d')](function(_0x1439db){return logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),'skebby',util[_0x821d('0x2f')](_0x1439db,{'showHidden':![],'depth':null}));});}else{logger[_0x821d('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x821d('0x31'),_0x821d('0x3e'));}break;case _0x821d('0x3f'):if(_0x36e24a[_0x821d('0x25')]){var _0xe1ff32={'recipient':_0x4ef7a4[_0x821d('0x26')],'message':_0x4ef7a4[_0x821d('0x35')],'sender':_0x36e24a[_0x821d('0x40')]||_0x36e24a['phone'],'authorization':_0x36e24a[_0x821d('0x25')]};var _0x34ca8a={'method':_0x821d('0x39'),'uri':_0x821d('0x41'),'body':_0xe1ff32,'json':!![]};rp(_0x34ca8a)[_0x821d('0x1a')](function(_0x2b4822){var _0x374929={'messageId':_0x2b4822[_0x821d('0x42')]};if(!_0x36e24a['deliveryReport']){_0x374929[_0x821d('0x43')]=!![];}return _0x31f614[_0x821d('0x1b')](_0x374929);})['catch'](function(_0x207d76){logger[_0x821d('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x821d('0x3f'),util[_0x821d('0x2f')](_0x207d76,{'showHidden':![],'depth':null}));});}else{logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x36e24a[_0x821d('0x33')]&&_0x36e24a[_0x821d('0x34')]){var _0xe1ff32={'messages':[{'source':_0x821d('0x44'),'to':_0x4ef7a4['phone'],'body':_0x4ef7a4[_0x821d('0x35')],'from':_0x36e24a[_0x821d('0x40')]||_0x36e24a[_0x821d('0x26')]}]};var _0x51d70a=util[_0x821d('0x45')]('%s:%s',_0x36e24a[_0x821d('0x33')],_0x36e24a[_0x821d('0x34')]);var _0x34ca8a={'method':_0x821d('0x39'),'uri':_0x821d('0x46'),'body':_0xe1ff32,'headers':{'Authorization':util[_0x821d('0x45')](_0x821d('0x47'),new Buffer(_0x51d70a)[_0x821d('0x48')](_0x821d('0x49')))},'json':!![]};rp(_0x34ca8a)[_0x821d('0x1a')](function(_0x553c16){if(_0x553c16[_0x821d('0x4a')]>=0xc8&&_0x553c16[_0x821d('0x4a')]<=0xce){if(_0x553c16[_0x821d('0x4b')]&&_0x553c16[_0x821d('0x4b')][_0x821d('0x4c')]>0x0){var _0x204e7f=_[_0x821d('0x4d')](_0x553c16[_0x821d('0x4b')]['messages']);var _0x181e99={'messageId':_0x204e7f[_0x821d('0x4e')]};if(!_0x36e24a[_0x821d('0x3d')]){_0x181e99[_0x821d('0x43')]=!![];}return _0x31f614['update'](_0x181e99);}else{logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x4f'),util[_0x821d('0x2f')](_0x553c16,{'showHidden':![],'depth':null}));}}else{logger[_0x821d('0x1e')](_0x821d('0x2d'),'afterCreate',_0x821d('0x4f'),util[_0x821d('0x2f')](_0x553c16,{'showHidden':![],'depth':null}));}})[_0x821d('0x1d')](function(_0x355037){logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x4f'),util['inspect'](_0x355037,{'showHidden':![],'depth':null}));});}else{logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x36e24a[_0x821d('0x50')]&&_0x36e24a[_0x821d('0x25')]){var _0xe1ff32={'dst':_0x4ef7a4[_0x821d('0x26')],'text':_0x4ef7a4[_0x821d('0x35')],'src':_0x36e24a['senderString']||_0x36e24a[_0x821d('0x26')],'url':_0x36e24a[_0x821d('0x51')]+_0x821d('0x29')+_0x4ef7a4['id']+_0x821d('0x2a')+_0x36e24a[_0x821d('0x2b')]};var _0x51d70a=util[_0x821d('0x45')](_0x821d('0x52'),_0x36e24a[_0x821d('0x50')],_0x36e24a[_0x821d('0x25')]);var _0x34ca8a={'method':'POST','uri':util['format'](_0x821d('0x53'),_0x36e24a['authId']),'body':_0xe1ff32,'headers':{'Authorization':util[_0x821d('0x45')](_0x821d('0x47'),new Buffer(_0x51d70a)[_0x821d('0x48')]('base64'))},'json':!![]};rp(_0x34ca8a)['then'](function(_0x59fcb0){var _0x16dc6a={'messageId':_0x59fcb0[_0x821d('0x54')][0x0]};return _0x31f614[_0x821d('0x1b')](_0x16dc6a);})[_0x821d('0x1d')](function(_0x5cb50f){logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x55'),util['inspect'](_0x5cb50f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x821d('0x2d'),'afterCreate',_0x821d('0x55'),_0x821d('0x56'));}break;case _0x821d('0x57'):if(_0x36e24a[_0x821d('0x33')]&&_0x36e24a[_0x821d('0x34')]){if(_0x36e24a[_0x821d('0x58')]){var _0x16e392={'method':_0x821d('0x39'),'uri':_0x36e24a[_0x821d('0x58')]+_0x821d('0x59'),'body':{'username':_0x36e24a['username'],'password':_0x36e24a[_0x821d('0x34')]},'json':!![]};return rp(_0x16e392)[_0x821d('0x1a')](function(_0x2c9bb6){var _0x37954b={'method':'POST','uri':_0x36e24a[_0x821d('0x58')]+_0x821d('0x5a'),'body':{'messages':[{'from':_0x36e24a['phone'],'destinations':[{'to':_0x4ef7a4[_0x821d('0x26')]}],'text':_0x4ef7a4[_0x821d('0x35')],'notifyUrl':_0x36e24a[_0x821d('0x51')]+_0x821d('0x29')+_0x4ef7a4['id']+_0x821d('0x2a')+_0x36e24a['token'],'notifyContentType':_0x821d('0x5b'),'callbackData':_0x36e24a[_0x821d('0x26')]+';'+_0x4ef7a4['body']}]},'headers':{'Authorization':_0x821d('0x5c')+_0x2c9bb6[_0x821d('0x2b')]},'json':!![]};return rp(_0x37954b)['then'](function(_0x75213){if(_0x75213[_0x821d('0x27')]){var _0x1fb7e9={'messageId':_0x75213[_0x821d('0x27')][0x0][_0x821d('0xe')]};if(!_0x36e24a[_0x821d('0x3d')]){_0x1fb7e9[_0x821d('0x43')]=!![];}return _0x31f614[_0x821d('0x1b')](_0x1fb7e9);}else{return logger[_0x821d('0x1e')](_0x821d('0x2d'),'afterCreate',_0x821d('0x57'),util[_0x821d('0x2f')](_0x75213,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x51794c){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x821d('0x2e'),_0x821d('0x57'),util['inspect'](_0x51794c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x821d('0x2d'),'afterCreate',_0x821d('0x57'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),'infobip',_0x821d('0x3e'));}break;case _0x821d('0x5d'):var _0x6ed33f=require(_0x821d('0x5e'));if(_0x36e24a[_0x821d('0x5f')]){var _0x3780e0={};_0x3780e0['login']=_0x36e24a['username'];_0x3780e0[_0x821d('0x26')]=_0x4ef7a4[_0x821d('0x26')];_0x3780e0[_0x821d('0x37')]=_0x36e24a[_0x821d('0x26')];_0x3780e0[_0x821d('0x60')]=_0x4ef7a4[_0x821d('0x35')];_0x3780e0[_0x821d('0x61')]=+new Date();var _0x417481='';var _0x1cb7be='';var _0x2a34f7=Object[_0x821d('0x62')](_0x3780e0);_0x2a34f7[_0x821d('0x63')]();for(var _0x4d184e=0x0;_0x4d184e<_0x2a34f7[_0x821d('0x64')];_0x4d184e++){if(_0x417481!=''){_0x417481+='&';}_0x417481+=_0x2a34f7[_0x4d184e]+'='+encodeURIComponent(_0x3780e0[_0x2a34f7[_0x4d184e]]);_0x1cb7be+=_0x3780e0[_0x2a34f7[_0x4d184e]];}_0x1cb7be+=_0x36e24a['apiKey'];_0x1cb7be=_0x6ed33f[_0x821d('0x65')](_0x821d('0x66'))[_0x821d('0x1b')](_0x1cb7be)[_0x821d('0x67')]('hex');if(_0x417481!==''){_0x417481+='&';}_0x417481+=_0x821d('0x68')+_0x1cb7be;var _0x2a4494={'method':_0x821d('0x69'),'uri':_0x36e24a[_0x821d('0x58')]+_0x821d('0x6a')+_0x417481,'json':!![]};return rp(_0x2a4494)[_0x821d('0x1a')](function(_0x21667f){var _0x39c70e=Object['keys'](_0x21667f);if(_0x21667f[_0x39c70e[0x0]][_0x821d('0x1e')]&&parseInt(_0x21667f[_0x39c70e[0x0]]['error'])===0x0){var _0x11617b={'messageId':_0x21667f[_0x39c70e[0x0]][_0x821d('0x6b')]};if(!_0x36e24a[_0x821d('0x3d')]){_0x11617b['read']=!![];}return _0x31f614[_0x821d('0x1b')](_0x11617b);}else{return logger['error'](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x5d'),util[_0x821d('0x2f')](_0x21667f[_0x821d('0x1e')],{'showHidden':![],'depth':null}));}})[_0x821d('0x1d')](function(_0x53d79f){return logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x5d'),util[_0x821d('0x2f')](_0x53d79f,{'showHidden':![],'depth':null}));});}else{logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x5d'),'Missing\x20parameters:\x20apiKey');}break;case _0x821d('0x6c'):if(_0x36e24a[_0x821d('0x5f')]){var _0x25c9bf={'method':_0x821d('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x36e24a[_0x821d('0x5f')]},'body':{'content':_0x4ef7a4[_0x821d('0x35')],'to':[_0x4ef7a4[_0x821d('0x26')]],'from':_0x36e24a[_0x821d('0x26')],'binary':![],'clientMessageId':'uuid','charset':_0x821d('0x6d')},'json':!![]};rp(_0x25c9bf)['then'](function(_0x320ffe){if(!_0x320ffe[_0x821d('0x1e')]){var _0x386b6e={'messageId':_0x320ffe[_0x821d('0x27')][0x0]['apiMessageId']};if(!_0x36e24a['deliveryReport']){_0x386b6e['read']=!![];}return _0x31f614[_0x821d('0x1b')](_0x386b6e);}else{return logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x6c'),util['inspect'](_0x320ffe[_0x821d('0x1e')],{'showHidden':![],'depth':null}));}})[_0x821d('0x1d')](function(_0x52725e){return logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x6c'),util[_0x821d('0x2f')](_0x52725e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x6c'),_0x821d('0x6e'));}break;case _0x821d('0x6f'):if(_0x36e24a[_0x821d('0x33')]&&_0x36e24a[_0x821d('0x34')]){var _0x51d70a=util[_0x821d('0x45')](_0x821d('0x52'),_0x36e24a['username'],_0x36e24a['password']);var _0x34ca8a={'method':_0x821d('0x39'),'uri':_0x821d('0x70')+_0x36e24a[_0x821d('0x71')]+_0x821d('0x72'),'body':{'to':[_0x4ef7a4[_0x821d('0x26')]],'text':_0x4ef7a4['body'],'from':_0x36e24a['phone'],'applicationId':_0x36e24a[_0x821d('0x73')]},'headers':{'Authorization':util[_0x821d('0x45')](_0x821d('0x47'),new Buffer(_0x51d70a)['toString'](_0x821d('0x49')))},'json':!![]};rp(_0x34ca8a)[_0x821d('0x1a')](function(_0x591a9e){if(_0x591a9e['id']){var _0x44ef65={'messageId':_0x591a9e['id']};return _0x31f614['update'](_0x44ef65);}else{logger[_0x821d('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x821d('0x2e'),_0x821d('0x6f'),util['inspect'](_0x591a9e,{'showHidden':![],'depth':null}));}})[_0x821d('0x1d')](function(_0x4542ae){logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x6f'),util['inspect'](_0x4542ae,{'showHidden':![],'depth':null}));});}else{logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x6f'),_0x821d('0x3e'));}break;case _0x821d('0x74'):if(_0x36e24a[_0x821d('0x5f')]){var _0x13565e={};var _0x2a4494={'method':_0x821d('0x39'),'uri':_0x821d('0x75'),'headers':{'Authorization':_0x821d('0x76')+_0x36e24a[_0x821d('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x36e24a[_0x821d('0x26')],'to':_0x4ef7a4[_0x821d('0x26')],'text':_0x4ef7a4[_0x821d('0x35')]},'json':!![]};return rp(_0x2a4494)['then'](function(_0xe4b214){if(_0xe4b214['code']==0xca){_0x13565e[_0x821d('0x77')]=_0xe4b214;var _0x16824d={'method':_0x821d('0x39'),'uri':_0x821d('0x78'),'headers':{'Authorization':'Bearer\x20'+_0x36e24a[_0x821d('0x5f')],'Content-Type':_0x821d('0x5b')},'body':{'refid':_0x13565e['message'][_0x821d('0x79')]},'json':!![]};return rp(_0x16824d)['then'](function(_0x14f44d){_0x13565e[_0x821d('0x7a')]=_0x14f44d;var _0x4cab29={'messageId':_0x13565e['message'][_0x821d('0x79')],'read':!![]};return _0x31f614[_0x821d('0x1b')](_0x4cab29);});}else{return logger[_0x821d('0x1e')](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x74'),util[_0x821d('0x2f')](_0xe4b214,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5ebeea){return logger[_0x821d('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x821d('0x74'),util[_0x821d('0x2f')](_0x5ebeea,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x821d('0x2d'),_0x821d('0x2e'),_0x821d('0x74'),_0x821d('0x7b'));}break;}}})[_0x821d('0x7c')](function(){_0x3dfaa8();});}else{_0x3dfaa8();}}},'charset':_0x821d('0x7d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4bf6=['remote','/api/sms/messages/','token','sid','error','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','GET','user_key','session_key','total_sent','internal_order_id','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','deliveryReport','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','baseUrl','/sms/2/text/advanced','IBSSO\x20','infobip','crypto','login','sender','text','keys','sort','apiKey','createHash','md5','digest','hex','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4bf6,0xcf));var _0x64bf=function(_0x1dfe46,_0x2c2367){_0x1dfe46=_0x1dfe46-0x0;var _0x46e367=_0x4bf6[_0x1dfe46];return _0x46e367;};'use strict';var _=require(_0x64bf('0x0'));var util=require(_0x64bf('0x1'));var logger=require(_0x64bf('0x2'))(_0x64bf('0x3'));var moment=require(_0x64bf('0x4'));var BPromise=require(_0x64bf('0x5'));var rp=require(_0x64bf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64bf('0x7'));var config=require(_0x64bf('0x8'));var attributes=require(_0x64bf('0x9'));module[_0x64bf('0xa')]=function(_0x553e15,_0x3c36c6){return _0x553e15['define'](_0x64bf('0xb'),attributes,{'tableName':_0x64bf('0xc'),'paranoid':![],'indexes':[{'name':_0x64bf('0xd'),'fields':[_0x64bf('0xd')]},{'name':_0x64bf('0xe'),'fields':['body'],'type':_0x64bf('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6778c5,_0x3abfae,_0x7f2f04){var _0x2c4469=_0x553e15[_0x64bf('0x10')];var _0xfba346=_0x6778c5['get']({'plain':!![]});if(_0xfba346[_0x64bf('0x11')][_0x64bf('0x12')]()==='in'||_0xfba346[_0x64bf('0x11')]['toLowerCase']()===_0x64bf('0x13')&&!_0xfba346[_0x64bf('0x14')]&&!_[_0x64bf('0x15')](_0xfba346['UserId'])&&!_[_0x64bf('0x15')](_0xfba346[_0x64bf('0x16')])){_0x2c4469[_0x64bf('0x17')][_0x64bf('0x18')]({'where':{'id':_0xfba346[_0x64bf('0x16')]}})[_0x64bf('0x19')](function(_0x7f25c3){if(_0x7f25c3){_0x7f25c3[_0x64bf('0x1a')]({'lastMsgAt':_0xfba346[_0x64bf('0x1b')],'lastMsgDirection':_0xfba346[_0x64bf('0x11')][_0x64bf('0x12')]()});}})[_0x64bf('0x1c')](function(_0x2e6463){console['error'](_0x2e6463);});}if(_0xfba346[_0x64bf('0x11')]===_0x64bf('0x13')&&!_0xfba346[_0x64bf('0x14')]){var _0x3ea94e;_0x2c4469[_0x64bf('0x1d')]['find']({'where':{'id':_0xfba346[_0x64bf('0x1e')]},'raw':!![]})[_0x64bf('0x19')](function(_0x498f0e){_0x3ea94e=_0x498f0e;if(_0x3ea94e&&_0x3ea94e[_0x64bf('0x1f')]){switch(_0x3ea94e[_0x64bf('0x1f')]){case _0x64bf('0x20'):var _0x552c1d=require(_0x64bf('0x20'));if(_0x3ea94e[_0x64bf('0x21')]&&_0x3ea94e[_0x64bf('0x22')]&&_0x3ea94e[_0x64bf('0x23')]){var _0x3deff3=new _0x552c1d(_0x3ea94e[_0x64bf('0x21')],_0x3ea94e[_0x64bf('0x22')]);_0x3deff3[_0x64bf('0x24')][_0x64bf('0x25')]({'body':_0xfba346[_0x64bf('0x26')],'to':_0xfba346[_0x64bf('0x23')],'from':_0x3ea94e['phone'],'statusCallback':_0x3ea94e[_0x64bf('0x27')]+_0x64bf('0x28')+_0xfba346['id']+'/status?token='+_0x3ea94e[_0x64bf('0x29')]})['then'](function(_0x481ecf){if(_0x481ecf[_0x64bf('0x2a')]){return _0x6778c5[_0x64bf('0x1a')]({'messageId':_0x481ecf[_0x64bf('0x2a')]});}})[_0x64bf('0x1c')](function(_0x56dbe8){logger[_0x64bf('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64bf('0x2c'),'twilio',util[_0x64bf('0x2d')](_0x56dbe8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64bf('0x2c'),_0x64bf('0x20'),_0x64bf('0x2e'));}break;case _0x64bf('0x2f'):var _0x3f8d9d=_0x64bf('0x30');if(_0x3ea94e['username']&&_0x3ea94e[_0x64bf('0x31')]){var _0x46c2a5={'recipient':[_0xfba346['phone']],'message':_0xfba346[_0x64bf('0x26')],'message_type':_0x3ea94e[_0x64bf('0x32')]};if(_0x3ea94e[_0x64bf('0x32')]&&_0x3ea94e[_0x64bf('0x32')]!=='SI'){_0x46c2a5['sender']=_0x3ea94e['phone'];}var _0x52864b={'url':_0x3f8d9d+_0x64bf('0x33')+_0x3ea94e[_0x64bf('0x34')]+'&password='+_0x3ea94e[_0x64bf('0x31')],'method':_0x64bf('0x35')};rp(_0x52864b)[_0x64bf('0x19')](function(_0x15aaea){var _0x3bb93a=_0x15aaea['split'](';');var _0x2ef47c={'user_key':_0x3bb93a[0x0],'session_key':_0x3bb93a[0x1]};_0x52864b={'url':_0x3f8d9d+'sms','method':'POST','headers':{'user_key':_0x2ef47c[_0x64bf('0x36')],'Session_key':_0x2ef47c[_0x64bf('0x37')]},'json':!![],'body':_0x46c2a5};return rp(_0x52864b);})[_0x64bf('0x19')](function(_0x5ddb72){if(_0x5ddb72[_0x64bf('0x38')]>=0x1){var _0x4018a3={'messageId':_0x5ddb72[_0x64bf('0x39')]};if(_0x3ea94e[_0x64bf('0x32')]!=='GP'||!_0x3ea94e['deliveryReport']){_0x4018a3['read']=!![];}return _0x6778c5[_0x64bf('0x1a')](_0x4018a3);}else{return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x2f'),util[_0x64bf('0x2d')](_0x5ddb72,{'showHidden':![],'depth':null}));}})[_0x64bf('0x1c')](function(_0x230cba){return logger[_0x64bf('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64bf('0x2c'),_0x64bf('0x2f'),util['inspect'](_0x230cba,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),'skebby',_0x64bf('0x3b'));}break;case _0x64bf('0x3c'):if(_0x3ea94e[_0x64bf('0x22')]){var _0x199b47={'recipient':_0xfba346['phone'],'message':_0xfba346['body'],'sender':_0x3ea94e[_0x64bf('0x3d')]||_0x3ea94e[_0x64bf('0x23')],'authorization':_0x3ea94e[_0x64bf('0x22')]};var _0x3abfae={'method':_0x64bf('0x3e'),'uri':_0x64bf('0x3f'),'body':_0x199b47,'json':!![]};rp(_0x3abfae)['then'](function(_0x1efaab){var _0x24238a={'messageId':_0x1efaab['requestid']};if(!_0x3ea94e[_0x64bf('0x40')]){_0x24238a[_0x64bf('0x41')]=!![];}return _0x6778c5[_0x64bf('0x1a')](_0x24238a);})['catch'](function(_0x28190e){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64bf('0x2c'),_0x64bf('0x3c'),util['inspect'](_0x28190e,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),'afterCreate',_0x64bf('0x3c'),_0x64bf('0x42'));}break;case'clicksend':if(_0x3ea94e[_0x64bf('0x34')]&&_0x3ea94e[_0x64bf('0x31')]){var _0x199b47={'messages':[{'source':_0x64bf('0x43'),'to':_0xfba346[_0x64bf('0x23')],'body':_0xfba346['body'],'from':_0x3ea94e['senderString']||_0x3ea94e[_0x64bf('0x23')]}]};var _0x5e7e80=util[_0x64bf('0x44')](_0x64bf('0x45'),_0x3ea94e[_0x64bf('0x34')],_0x3ea94e[_0x64bf('0x31')]);var _0x3abfae={'method':_0x64bf('0x3e'),'uri':_0x64bf('0x46'),'body':_0x199b47,'headers':{'Authorization':util[_0x64bf('0x44')](_0x64bf('0x47'),new Buffer(_0x5e7e80)[_0x64bf('0x48')](_0x64bf('0x49')))},'json':!![]};rp(_0x3abfae)[_0x64bf('0x19')](function(_0x7b2ad){if(_0x7b2ad[_0x64bf('0x4a')]>=0xc8&&_0x7b2ad[_0x64bf('0x4a')]<=0xce){if(_0x7b2ad[_0x64bf('0x4b')]&&_0x7b2ad['data'][_0x64bf('0x4c')]>0x0){var _0x223176=_['head'](_0x7b2ad['data'][_0x64bf('0x24')]);var _0x1fdb15={'messageId':_0x223176[_0x64bf('0x4d')]};if(!_0x3ea94e['deliveryReport']){_0x1fdb15[_0x64bf('0x41')]=!![];}return _0x6778c5[_0x64bf('0x1a')](_0x1fdb15);}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),'afterCreate','clickSend',util['inspect'](_0x7b2ad,{'showHidden':![],'depth':null}));}}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),'afterCreate',_0x64bf('0x4e'),util[_0x64bf('0x2d')](_0x7b2ad,{'showHidden':![],'depth':null}));}})[_0x64bf('0x1c')](function(_0x17cc25){logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),'clickSend',util[_0x64bf('0x2d')](_0x17cc25,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x4e'),_0x64bf('0x3b'));}break;case'plivo':if(_0x3ea94e['authId']&&_0x3ea94e[_0x64bf('0x22')]){var _0x199b47={'dst':_0xfba346['phone'],'text':_0xfba346[_0x64bf('0x26')],'src':_0x3ea94e[_0x64bf('0x3d')]||_0x3ea94e[_0x64bf('0x23')],'url':_0x3ea94e['remote']+_0x64bf('0x28')+_0xfba346['id']+_0x64bf('0x4f')+_0x3ea94e['token']};var _0x5e7e80=util[_0x64bf('0x44')](_0x64bf('0x45'),_0x3ea94e[_0x64bf('0x50')],_0x3ea94e['authToken']);var _0x3abfae={'method':'POST','uri':util[_0x64bf('0x44')](_0x64bf('0x51'),_0x3ea94e['authId']),'body':_0x199b47,'headers':{'Authorization':util['format'](_0x64bf('0x47'),new Buffer(_0x5e7e80)[_0x64bf('0x48')](_0x64bf('0x49')))},'json':!![]};rp(_0x3abfae)[_0x64bf('0x19')](function(_0x11db99){var _0x1aae56={'messageId':_0x11db99[_0x64bf('0x52')][0x0]};return _0x6778c5[_0x64bf('0x1a')](_0x1aae56);})[_0x64bf('0x1c')](function(_0x10c664){logger['error'](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x53'),util[_0x64bf('0x2d')](_0x10c664,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x53'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x3ea94e['username']&&_0x3ea94e[_0x64bf('0x31')]){if(_0x3ea94e['baseUrl']){var _0x417a0c={'method':_0x64bf('0x3e'),'uri':_0x3ea94e[_0x64bf('0x54')]+'/auth/1/session','body':{'username':_0x3ea94e[_0x64bf('0x34')],'password':_0x3ea94e['password']},'json':!![]};return rp(_0x417a0c)['then'](function(_0x28e625){var _0x596543={'method':_0x64bf('0x3e'),'uri':_0x3ea94e[_0x64bf('0x54')]+_0x64bf('0x55'),'body':{'messages':[{'from':_0x3ea94e[_0x64bf('0x23')],'destinations':[{'to':_0xfba346[_0x64bf('0x23')]}],'text':_0xfba346[_0x64bf('0x26')],'notifyUrl':_0x3ea94e[_0x64bf('0x27')]+_0x64bf('0x28')+_0xfba346['id']+_0x64bf('0x4f')+_0x3ea94e[_0x64bf('0x29')],'notifyContentType':'application/json','callbackData':_0x3ea94e[_0x64bf('0x23')]+';'+_0xfba346['body']}]},'headers':{'Authorization':_0x64bf('0x56')+_0x28e625[_0x64bf('0x29')]},'json':!![]};return rp(_0x596543)[_0x64bf('0x19')](function(_0x40bba7){if(_0x40bba7[_0x64bf('0x24')]){var _0x56171f={'messageId':_0x40bba7[_0x64bf('0x24')][0x0]['messageId']};if(!_0x3ea94e[_0x64bf('0x40')]){_0x56171f[_0x64bf('0x41')]=!![];}return _0x6778c5[_0x64bf('0x1a')](_0x56171f);}else{return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),'afterCreate',_0x64bf('0x57'),util['inspect'](_0x40bba7,{'showHidden':![],'depth':null}));}});})[_0x64bf('0x1c')](function(_0x43b5ec){return logger[_0x64bf('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64bf('0x2c'),_0x64bf('0x57'),util[_0x64bf('0x2d')](_0x43b5ec,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x57'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),'infobip',_0x64bf('0x3b'));}break;case'csc':var _0x2a6c50=require(_0x64bf('0x58'));if(_0x3ea94e['apiKey']){var _0x4b207f={};_0x4b207f[_0x64bf('0x59')]=_0x3ea94e[_0x64bf('0x34')];_0x4b207f[_0x64bf('0x23')]=_0xfba346[_0x64bf('0x23')];_0x4b207f[_0x64bf('0x5a')]=_0x3ea94e[_0x64bf('0x23')];_0x4b207f[_0x64bf('0x5b')]=_0xfba346[_0x64bf('0x26')];_0x4b207f['timestamp']=+new Date();var _0x50c996='';var _0x6b633e='';var _0xe0b6b3=Object[_0x64bf('0x5c')](_0x4b207f);_0xe0b6b3[_0x64bf('0x5d')]();for(var _0x563912=0x0;_0x563912<_0xe0b6b3['length'];_0x563912++){if(_0x50c996!=''){_0x50c996+='&';}_0x50c996+=_0xe0b6b3[_0x563912]+'='+encodeURIComponent(_0x4b207f[_0xe0b6b3[_0x563912]]);_0x6b633e+=_0x4b207f[_0xe0b6b3[_0x563912]];}_0x6b633e+=_0x3ea94e[_0x64bf('0x5e')];_0x6b633e=_0x2a6c50[_0x64bf('0x5f')](_0x64bf('0x60'))['update'](_0x6b633e)[_0x64bf('0x61')](_0x64bf('0x62'));if(_0x50c996!==''){_0x50c996+='&';}_0x50c996+='signature='+_0x6b633e;var _0x52864b={'method':_0x64bf('0x35'),'uri':_0x3ea94e['baseUrl']+_0x64bf('0x63')+_0x50c996,'json':!![]};return rp(_0x52864b)[_0x64bf('0x19')](function(_0x451281){var _0x444188=Object[_0x64bf('0x5c')](_0x451281);if(_0x451281[_0x444188[0x0]][_0x64bf('0x2b')]&&parseInt(_0x451281[_0x444188[0x0]][_0x64bf('0x2b')])===0x0){var _0x245a96={'messageId':_0x451281[_0x444188[0x0]]['id_sms']};if(!_0x3ea94e[_0x64bf('0x40')]){_0x245a96[_0x64bf('0x41')]=!![];}return _0x6778c5['update'](_0x245a96);}else{return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x64'),util[_0x64bf('0x2d')](_0x451281[_0x64bf('0x2b')],{'showHidden':![],'depth':null}));}})[_0x64bf('0x1c')](function(_0x6abb74){return logger['error'](_0x64bf('0x3a'),_0x64bf('0x2c'),'csc',util[_0x64bf('0x2d')](_0x6abb74,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),'afterCreate',_0x64bf('0x64'),_0x64bf('0x65'));}break;case _0x64bf('0x66'):if(_0x3ea94e[_0x64bf('0x5e')]){var _0x48186c={'method':_0x64bf('0x3e'),'uri':_0x64bf('0x67'),'headers':{'Authorization':_0x3ea94e[_0x64bf('0x5e')]},'body':{'content':_0xfba346[_0x64bf('0x26')],'to':[_0xfba346[_0x64bf('0x23')]],'from':_0x3ea94e[_0x64bf('0x23')],'binary':![],'clientMessageId':_0x64bf('0x68'),'charset':_0x64bf('0x69')},'json':!![]};rp(_0x48186c)[_0x64bf('0x19')](function(_0x53f58d){if(!_0x53f58d[_0x64bf('0x2b')]){var _0x34f024={'messageId':_0x53f58d['messages'][0x0]['apiMessageId']};if(!_0x3ea94e[_0x64bf('0x40')]){_0x34f024[_0x64bf('0x41')]=!![];}return _0x6778c5[_0x64bf('0x1a')](_0x34f024);}else{return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x66'),util['inspect'](_0x53f58d[_0x64bf('0x2b')],{'showHidden':![],'depth':null}));}})[_0x64bf('0x1c')](function(_0x4005dd){return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),'afterCreate','clickatell',util[_0x64bf('0x2d')](_0x4005dd,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x66'),_0x64bf('0x65'));}break;case _0x64bf('0x6a'):if(_0x3ea94e[_0x64bf('0x34')]&&_0x3ea94e[_0x64bf('0x31')]){var _0x5e7e80=util[_0x64bf('0x44')]('%s:%s',_0x3ea94e['username'],_0x3ea94e[_0x64bf('0x31')]);var _0x3abfae={'method':_0x64bf('0x3e'),'uri':_0x64bf('0x6b')+_0x3ea94e[_0x64bf('0x6c')]+_0x64bf('0x6d'),'body':{'to':[_0xfba346[_0x64bf('0x23')]],'text':_0xfba346[_0x64bf('0x26')],'from':_0x3ea94e[_0x64bf('0x23')],'applicationId':_0x3ea94e[_0x64bf('0x6e')]},'headers':{'Authorization':util[_0x64bf('0x44')](_0x64bf('0x47'),new Buffer(_0x5e7e80)['toString'](_0x64bf('0x49')))},'json':!![]};rp(_0x3abfae)[_0x64bf('0x19')](function(_0x2e4a8d){if(_0x2e4a8d['id']){var _0x48fe47={'messageId':_0x2e4a8d['id']};return _0x6778c5[_0x64bf('0x1a')](_0x48fe47);}else{logger[_0x64bf('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0x64bf('0x2d')](_0x2e4a8d,{'showHidden':![],'depth':null}));}})[_0x64bf('0x1c')](function(_0x57bc8f){logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x6a'),util['inspect'](_0x57bc8f,{'showHidden':![],'depth':null}));});}else{logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x6a'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x3ea94e[_0x64bf('0x5e')]){var _0x259f6f={};var _0x52864b={'method':_0x64bf('0x3e'),'uri':_0x64bf('0x6f'),'headers':{'Authorization':_0x64bf('0x70')+_0x3ea94e[_0x64bf('0x5e')],'Content-Type':_0x64bf('0x71')},'body':{'from':_0x3ea94e[_0x64bf('0x23')],'to':_0xfba346['phone'],'text':_0xfba346[_0x64bf('0x26')]},'json':!![]};return rp(_0x52864b)[_0x64bf('0x19')](function(_0x2724e3){if(_0x2724e3[_0x64bf('0x72')]==0xca){_0x259f6f[_0x64bf('0x73')]=_0x2724e3;var _0x2c0bdb={'method':_0x64bf('0x3e'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x3ea94e[_0x64bf('0x5e')],'Content-Type':'application/json'},'body':{'refid':_0x259f6f[_0x64bf('0x73')][_0x64bf('0x74')]},'json':!![]};return rp(_0x2c0bdb)[_0x64bf('0x19')](function(_0x44205b){_0x259f6f[_0x64bf('0x75')]=_0x44205b;var _0x182fc0={'messageId':_0x259f6f['message']['refid'],'read':!![]};return _0x6778c5[_0x64bf('0x1a')](_0x182fc0);});}else{return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),'intelepeer',util[_0x64bf('0x2d')](_0x2724e3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x120c21){return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),'intelepeer',util['inspect'](_0x120c21,{'showHidden':![],'depth':null}));});}else{return logger[_0x64bf('0x2b')](_0x64bf('0x3a'),_0x64bf('0x2c'),_0x64bf('0x76'),_0x64bf('0x77'));}break;}}})[_0x64bf('0x78')](function(){_0x7f2f04();});}else{_0x7f2f04();}}},'charset':_0x64bf('0x79'),'collate':_0x64bf('0x7a')});};
\ No newline at end of file
index 200296e..bc4db4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa185=['request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x164e94,_0x382f1b){var _0x4b15c6=function(_0x292c55){while(--_0x292c55){_0x164e94['push'](_0x164e94['shift']());}};_0x4b15c6(++_0x382f1b);}(_0xa185,0x1ed));var _0x5a18=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa185[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5a18('0x0'));var util=require(_0x5a18('0x1'));var moment=require(_0x5a18('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a18('0x3'));var fs=require('fs');var Redis=require(_0x5a18('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a18('0x5'));var logger=require('../../config/logger')(_0x5a18('0x6'));var config=require(_0x5a18('0x7'));var jayson=require(_0x5a18('0x8'));var client=jayson[_0x5a18('0x9')][_0x5a18('0xa')]({'port':0x232a});config[_0x5a18('0xb')]=_['defaults'](config[_0x5a18('0xb')],{'host':_0x5a18('0xc'),'port':0x18eb});var socket=require(_0x5a18('0xd'))(new Redis(config[_0x5a18('0xb')]));require('./smsMessage.socket')[_0x5a18('0xe')](socket);function respondWithRpcPromise(_0x30a52b,_0x3b5130,_0x582494){return new BPromise(function(_0x4a27af,_0x402c09){return client[_0x5a18('0xf')](_0x30a52b,_0x582494)[_0x5a18('0x10')](function(_0x292e08){logger[_0x5a18('0x11')](_0x5a18('0x12'),_0x3b5130,_0x5a18('0x13'));logger[_0x5a18('0x14')](_0x5a18('0x15'),_0x3b5130,_0x5a18('0x13'),JSON[_0x5a18('0x16')](_0x292e08));if(_0x292e08[_0x5a18('0x17')]){if(_0x292e08['error']['code']===0x1f4){logger['error'](_0x5a18('0x12'),_0x3b5130,_0x292e08[_0x5a18('0x17')]['message']);return _0x402c09(_0x292e08[_0x5a18('0x17')][_0x5a18('0x18')]);}logger[_0x5a18('0x17')]('SmsMessage,\x20%s,\x20%s',_0x3b5130,_0x292e08['error']['message']);return _0x4a27af(_0x292e08[_0x5a18('0x17')][_0x5a18('0x18')]);}else{logger[_0x5a18('0x11')](_0x5a18('0x12'),_0x3b5130,'request\x20sent');_0x4a27af(_0x292e08[_0x5a18('0x19')][_0x5a18('0x18')]);}})[_0x5a18('0x1a')](function(_0x323eb7){logger[_0x5a18('0x17')](_0x5a18('0x12'),_0x3b5130,_0x323eb7);_0x402c09(_0x323eb7);});});}exports[_0x5a18('0x1b')]=function(_0x5bf5f4){var _0x2c9ccd=this;return new Promise(function(_0x390d10,_0x31dc45){return db[_0x5a18('0x1c')][_0x5a18('0x1d')](_0x5bf5f4['body'],{'raw':_0x5bf5f4['options']?_0x5bf5f4[_0x5a18('0x1e')][_0x5a18('0x1f')]===undefined?!![]:![]:!![]})[_0x5a18('0x10')](function(_0x206be3){logger[_0x5a18('0x11')](_0x5a18('0x1b'),_0x5bf5f4);logger['debug']('CreateSmsMessage',_0x5bf5f4,JSON[_0x5a18('0x16')](_0x206be3));_0x390d10(_0x206be3);})[_0x5a18('0x1a')](function(_0x2b3b85){logger['error'](_0x5a18('0x1b'),_0x2b3b85[_0x5a18('0x18')],_0x5bf5f4);_0x31dc45(_0x2c9ccd[_0x5a18('0x17')](0x1f4,_0x2b3b85['message']));});});};
\ No newline at end of file
+var _0x467e=['error','code','message','info','result','catch','CreateSmsMessage','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5eabe6,_0x96455a){var _0x2f9d4e=function(_0x3c2774){while(--_0x3c2774){_0x5eabe6['push'](_0x5eabe6['shift']());}};_0x2f9d4e(++_0x96455a);}(_0x467e,0x102));var _0xe467=function(_0x493a97,_0x50a93e){_0x493a97=_0x493a97-0x0;var _0x51f171=_0x467e[_0x493a97];return _0x51f171;};'use strict';var _=require('lodash');var util=require(_0xe467('0x0'));var moment=require(_0xe467('0x1'));var BPromise=require(_0xe467('0x2'));var rs=require(_0xe467('0x3'));var fs=require('fs');var Redis=require(_0xe467('0x4'));var db=require(_0xe467('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe467('0x6'))(_0xe467('0x7'));var config=require('../../config/environment');var jayson=require(_0xe467('0x8'));var client=jayson['client'][_0xe467('0x9')]({'port':0x232a});config[_0xe467('0xa')]=_[_0xe467('0xb')](config['redis'],{'host':_0xe467('0xc'),'port':0x18eb});var socket=require(_0xe467('0xd'))(new Redis(config[_0xe467('0xa')]));require(_0xe467('0xe'))['register'](socket);function respondWithRpcPromise(_0x42f623,_0x118abe,_0x603653){return new BPromise(function(_0x4a164d,_0x519c73){return client[_0xe467('0xf')](_0x42f623,_0x603653)[_0xe467('0x10')](function(_0x167c32){logger['info'](_0xe467('0x11'),_0x118abe,'request\x20sent');logger[_0xe467('0x12')](_0xe467('0x13'),_0x118abe,'request\x20sent',JSON[_0xe467('0x14')](_0x167c32));if(_0x167c32[_0xe467('0x15')]){if(_0x167c32[_0xe467('0x15')][_0xe467('0x16')]===0x1f4){logger[_0xe467('0x15')](_0xe467('0x11'),_0x118abe,_0x167c32[_0xe467('0x15')][_0xe467('0x17')]);return _0x519c73(_0x167c32[_0xe467('0x15')][_0xe467('0x17')]);}logger[_0xe467('0x15')](_0xe467('0x11'),_0x118abe,_0x167c32[_0xe467('0x15')]['message']);return _0x4a164d(_0x167c32['error'][_0xe467('0x17')]);}else{logger[_0xe467('0x18')](_0xe467('0x11'),_0x118abe,'request\x20sent');_0x4a164d(_0x167c32[_0xe467('0x19')][_0xe467('0x17')]);}})[_0xe467('0x1a')](function(_0x1c9468){logger[_0xe467('0x15')]('SmsMessage,\x20%s,\x20%s',_0x118abe,_0x1c9468);_0x519c73(_0x1c9468);});});}exports[_0xe467('0x1b')]=function(_0x2d6d6d){var _0x4cd4ff=this;return new Promise(function(_0x46c541,_0xa11c0d){return db['SmsMessage'][_0xe467('0x1c')](_0x2d6d6d['body'],{'raw':_0x2d6d6d[_0xe467('0x1d')]?_0x2d6d6d[_0xe467('0x1d')][_0xe467('0x1e')]===undefined?!![]:![]:!![]})[_0xe467('0x10')](function(_0x515725){logger[_0xe467('0x18')](_0xe467('0x1b'),_0x2d6d6d);logger[_0xe467('0x12')]('CreateSmsMessage',_0x2d6d6d,JSON[_0xe467('0x14')](_0x515725));_0x46c541(_0x515725);})[_0xe467('0x1a')](function(_0x3911d7){logger[_0xe467('0x15')](_0xe467('0x1b'),_0x3911d7['message'],_0x2d6d6d);_0xa11c0d(_0x4cd4ff[_0xe467('0x15')](0x1f4,_0x3911d7[_0xe467('0x17')]));});});};
\ No newline at end of file
index 9f47e97..3b0a07a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa91=['removeListener','register','length','smsMessage:','save','remove','update','emit'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xaa91,0x1e4));var _0x1aa9=function(_0x3e804c,_0x5f17ae){_0x3e804c=_0x3e804c-0x0;var _0x3ff94f=_0xaa91[_0x3e804c];return _0x3ff94f;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x1aa9('0x0'),_0x1aa9('0x1'),_0x1aa9('0x2')];function createListener(_0x4fa230,_0x47bf32){return function(_0x9fc749){_0x47bf32[_0x1aa9('0x3')](_0x4fa230,_0x9fc749);};}function removeListener(_0x583fa3,_0x209822){return function(){SmsMessageEvents[_0x1aa9('0x4')](_0x583fa3,_0x209822);};}exports[_0x1aa9('0x5')]=function(_0xc53f61){for(var _0x29634e=0x0,_0x5dd02b=events[_0x1aa9('0x6')];_0x29634e<_0x5dd02b;_0x29634e++){var _0x110a16=events[_0x29634e];var _0x1d4b79=createListener(_0x1aa9('0x7')+_0x110a16,_0xc53f61);SmsMessageEvents['on'](_0x110a16,_0x1d4b79);}};
\ No newline at end of file
+var _0x8941=['register','length','smsMessage:','save','remove','update','emit','removeListener'];(function(_0x7de913,_0x138bac){var _0x394086=function(_0xc81b28){while(--_0xc81b28){_0x7de913['push'](_0x7de913['shift']());}};_0x394086(++_0x138bac);}(_0x8941,0x6b));var _0x1894=function(_0x4f59f2,_0x284b8e){_0x4f59f2=_0x4f59f2-0x0;var _0x519e56=_0x8941[_0x4f59f2];return _0x519e56;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x1894('0x0'),_0x1894('0x1'),_0x1894('0x2')];function createListener(_0x319789,_0xc74fff){return function(_0x1ce850){_0xc74fff[_0x1894('0x3')](_0x319789,_0x1ce850);};}function removeListener(_0x3244cc,_0x445ac2){return function(){SmsMessageEvents[_0x1894('0x4')](_0x3244cc,_0x445ac2);};}exports[_0x1894('0x5')]=function(_0x1aee64){for(var _0x4185dd=0x0,_0x22de3b=events[_0x1894('0x6')];_0x4185dd<_0x22de3b;_0x4185dd++){var _0x4ec7e2=events[_0x4185dd];var _0x5db295=createListener(_0x1894('0x7')+_0x4ec7e2,_0x1aee64);SmsMessageEvents['on'](_0x4ec7e2,_0x5db295);}};
\ No newline at end of file
index b5aade6..8de4bc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3722=['put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents'];(function(_0x4bc068,_0x3770c1){var _0x50c165=function(_0xec977e){while(--_0xec977e){_0x4bc068['push'](_0x4bc068['shift']());}};_0x50c165(++_0x3770c1);}(_0x3722,0x171));var _0x2372=function(_0x505a12,_0x14ee8a){_0x505a12=_0x505a12-0x0;var _0x2abdaf=_0x3722[_0x505a12];return _0x2abdaf;};'use strict';var multer=require(_0x2372('0x0'));var util=require(_0x2372('0x1'));var path=require(_0x2372('0x2'));var timeout=require(_0x2372('0x3'));var express=require(_0x2372('0x4'));var router=express[_0x2372('0x5')]();var fs_extra=require(_0x2372('0x6'));var auth=require(_0x2372('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2372('0x8'));var controller=require(_0x2372('0x9'));router[_0x2372('0xa')]('/',auth[_0x2372('0xb')](),controller[_0x2372('0xc')]);router[_0x2372('0xa')](_0x2372('0xd'),auth['isAuthenticated'](),controller[_0x2372('0xe')]);router[_0x2372('0xa')](_0x2372('0xf'),auth[_0x2372('0xb')](),controller[_0x2372('0x10')]);router['get'](_0x2372('0x11'),auth[_0x2372('0xb')](),controller[_0x2372('0x12')]);router['get'](_0x2372('0x13'),auth['isAuthenticated'](),controller[_0x2372('0x14')]);router[_0x2372('0xa')](_0x2372('0x15'),auth['isAuthenticated'](),controller[_0x2372('0x16')]);router[_0x2372('0x17')]('/',auth[_0x2372('0xb')](),controller[_0x2372('0x18')]);router['post'](_0x2372('0x13'),auth[_0x2372('0xb')](),controller[_0x2372('0x19')]);router[_0x2372('0x17')](_0x2372('0x15'),auth['isAuthenticated'](),controller[_0x2372('0x1a')]);router[_0x2372('0x1b')](_0x2372('0xf'),auth[_0x2372('0xb')](),controller[_0x2372('0x1c')]);router['delete'](_0x2372('0xf'),auth[_0x2372('0xb')](),controller['destroy']);router[_0x2372('0x1d')](_0x2372('0x13'),auth[_0x2372('0xb')](),controller[_0x2372('0x1e')]);router['delete'](_0x2372('0x15'),auth[_0x2372('0xb')](),controller[_0x2372('0x1f')]);module[_0x2372('0x20')]=router;
\ No newline at end of file
+var _0x7b89=['update','delete','destroy','removeAgents','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','/:id'];(function(_0x124b77,_0x2a4938){var _0x2e3ef2=function(_0x2e65bc){while(--_0x2e65bc){_0x124b77['push'](_0x124b77['shift']());}};_0x2e3ef2(++_0x2a4938);}(_0x7b89,0xad));var _0x97b8=function(_0x305ac0,_0x1621fc){_0x305ac0=_0x305ac0-0x0;var _0x14ba35=_0x7b89[_0x305ac0];return _0x14ba35;};'use strict';var multer=require(_0x97b8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x97b8('0x1')]();var fs_extra=require(_0x97b8('0x2'));var auth=require(_0x97b8('0x3'));var interaction=require(_0x97b8('0x4'));var config=require(_0x97b8('0x5'));var controller=require(_0x97b8('0x6'));router['get']('/',auth[_0x97b8('0x7')](),controller[_0x97b8('0x8')]);router[_0x97b8('0x9')](_0x97b8('0xa'),auth['isAuthenticated'](),controller[_0x97b8('0xb')]);router[_0x97b8('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x97b8('0x9')](_0x97b8('0xc'),auth['isAuthenticated'](),controller[_0x97b8('0xd')]);router[_0x97b8('0x9')]('/:id/teams',auth[_0x97b8('0x7')](),controller[_0x97b8('0xe')]);router[_0x97b8('0x9')](_0x97b8('0xf'),auth[_0x97b8('0x7')](),controller[_0x97b8('0x10')]);router[_0x97b8('0x11')]('/',auth[_0x97b8('0x7')](),controller[_0x97b8('0x12')]);router[_0x97b8('0x11')](_0x97b8('0x13'),auth[_0x97b8('0x7')](),controller[_0x97b8('0x14')]);router[_0x97b8('0x11')](_0x97b8('0xf'),auth['isAuthenticated'](),controller['addAgents']);router[_0x97b8('0x15')](_0x97b8('0x16'),auth[_0x97b8('0x7')](),controller[_0x97b8('0x17')]);router[_0x97b8('0x18')](_0x97b8('0x16'),auth['isAuthenticated'](),controller[_0x97b8('0x19')]);router['delete'](_0x97b8('0x13'),auth[_0x97b8('0x7')](),controller['removeTeams']);router[_0x97b8('0x18')](_0x97b8('0xf'),auth['isAuthenticated'](),controller[_0x97b8('0x1a')]);module[_0x97b8('0x1b')]=router;
\ No newline at end of file
index 3263680..6384659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e65=['INTEGER','beepall','roundrobin','STRING','name'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0x7e65,0x85));var _0x57e6=function(_0x43463f,_0x3a5f81){_0x43463f=_0x43463f-0x0;var _0x39631=_0x7e65[_0x43463f];return _0x39631;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x57e6('0x0')],'unique':_0x57e6('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x57e6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x57e6('0x3'),_0x57e6('0x4'))}};
\ No newline at end of file
+var _0xafde=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x574bc2,_0x20de49){var _0x47e48a=function(_0x43c458){while(--_0x43c458){_0x574bc2['push'](_0x574bc2['shift']());}};_0x47e48a(++_0x20de49);}(_0xafde,0xd2));var _0xeafd=function(_0x27ec38,_0x56ae99){_0x27ec38=_0x27ec38-0x0;var _0xf3ae60=_0xafde[_0x27ec38];return _0xf3ae60;};'use strict';var Sequelize=require(_0xeafd('0x0'));module[_0xeafd('0x1')]={'name':{'type':Sequelize[_0xeafd('0x2')],'unique':_0xeafd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeafd('0x2')]},'timeout':{'type':Sequelize[_0xeafd('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xeafd('0x5'),_0xeafd('0x6'),_0xeafd('0x7'))}};
\ No newline at end of file
index 645a6ae..6b047de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1b2=['removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','name','send','index','map','SmsQueue','rawAttributes','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','filter','type','options','include','findAll','rows','catch','show','keys','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','UserSmsQueue','length','nolimit','order','pick','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','findOne','Team','getTeams','ids','User','online','voicePause','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save'];(function(_0x5ee582,_0x5c1898){var _0x176a90=function(_0x302057){while(--_0x302057){_0x5ee582['push'](_0x5ee582['shift']());}};_0x176a90(++_0x5c1898);}(_0xb1b2,0x12d));var _0x2b1b=function(_0x4c3d7a,_0x19a724){_0x4c3d7a=_0x4c3d7a-0x0;var _0x2c2395=_0xb1b2[_0x4c3d7a];return _0x2c2395;};'use strict';var emlformat=require(_0x2b1b('0x0'));var rimraf=require(_0x2b1b('0x1'));var zipdir=require(_0x2b1b('0x2'));var jsonpatch=require(_0x2b1b('0x3'));var rp=require(_0x2b1b('0x4'));var moment=require('moment');var BPromise=require(_0x2b1b('0x5'));var Mustache=require(_0x2b1b('0x6'));var util=require(_0x2b1b('0x7'));var path=require(_0x2b1b('0x8'));var sox=require(_0x2b1b('0x9'));var csv=require(_0x2b1b('0xa'));var ejs=require(_0x2b1b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b1b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2b1b('0xd'));var toCsv=require(_0x2b1b('0xa'));var querystring=require(_0x2b1b('0xe'));var Papa=require(_0x2b1b('0xf'));var Redis=require('ioredis');var authService=require(_0x2b1b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b1b('0x11'))(_0x2b1b('0x12'));var utils=require(_0x2b1b('0x13'));var config=require(_0x2b1b('0x14'));var licenseUtil=require(_0x2b1b('0x15'));var db=require(_0x2b1b('0x16'))['db'];config[_0x2b1b('0x17')]=_[_0x2b1b('0x18')](config[_0x2b1b('0x17')],{'host':_0x2b1b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b1b('0x17')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x5bd4a2,_0x2f49c5){_0x2f49c5=_0x2f49c5||0xcc;return function(_0x52f5c2){if(_0x52f5c2){return _0x5bd4a2['sendStatus'](_0x2f49c5);}return _0x5bd4a2[_0x2b1b('0x1a')](_0x2f49c5)[_0x2b1b('0x1b')]();};}function respondWithResult(_0x566e7b,_0x22c3ed){_0x22c3ed=_0x22c3ed||0xc8;return function(_0x51c6f1){if(_0x51c6f1){return _0x566e7b[_0x2b1b('0x1a')](_0x22c3ed)[_0x2b1b('0x1c')](_0x51c6f1);}};}function respondWithFilteredResult(_0x3958fa,_0x440457){return function(_0x4e1e3a){if(_0x4e1e3a){var _0x4ecd5c=typeof _0x440457[_0x2b1b('0x1d')]===_0x2b1b('0x1e')&&typeof _0x440457[_0x2b1b('0x1f')]===_0x2b1b('0x1e');var _0x400c90=_0x4e1e3a[_0x2b1b('0x20')];var _0x2ca4e2=_0x4ecd5c?0x0:_0x440457[_0x2b1b('0x1d')];var _0x372bca=_0x4ecd5c?_0x4e1e3a[_0x2b1b('0x20')]:_0x440457[_0x2b1b('0x1d')]+_0x440457['limit'];var _0xdd2e34;if(_0x372bca>=_0x400c90){_0x372bca=_0x400c90;_0xdd2e34=0xc8;}else{_0xdd2e34=0xce;}_0x3958fa[_0x2b1b('0x1a')](_0xdd2e34);return _0x3958fa[_0x2b1b('0x21')](_0x2b1b('0x22'),_0x2ca4e2+'-'+_0x372bca+'/'+_0x400c90)[_0x2b1b('0x1c')](_0x4e1e3a);}return null;};}function patchUpdates(_0x19309a){return function(_0xd18f8a){try{jsonpatch[_0x2b1b('0x23')](_0xd18f8a,_0x19309a,!![]);}catch(_0x49548b){return BPromise[_0x2b1b('0x24')](_0x49548b);}return _0xd18f8a[_0x2b1b('0x25')]();};}function saveUpdates(_0x51dec9,_0x56f3b4){return function(_0x4e1211){if(_0x4e1211){return _0x4e1211[_0x2b1b('0x26')](_0x51dec9)[_0x2b1b('0x27')](function(_0x3312f9){return _0x3312f9;});}return null;};}function removeEntity(_0x325e6a,_0x4b8c05){return function(_0x2bcc37){if(_0x2bcc37){return _0x2bcc37['destroy']()[_0x2b1b('0x27')](function(){var _0x205606=_0x2bcc37[_0x2b1b('0x28')]({'plain':!![]});var _0x3bf81d=_0x2b1b('0x29');return db[_0x2b1b('0x2a')][_0x2b1b('0x2b')]({'where':{'type':_0x3bf81d,'resourceId':_0x205606['id']}})[_0x2b1b('0x27')](function(){return _0x2bcc37;});})['then'](function(){_0x325e6a[_0x2b1b('0x1a')](0xcc)[_0x2b1b('0x1b')]();});}};}function handleEntityNotFound(_0x14ec03,_0x57e46a){return function(_0x142e35){if(!_0x142e35){_0x14ec03['sendStatus'](0x194);}return _0x142e35;};}function handleError(_0x56bdc0,_0x77cd9d){_0x77cd9d=_0x77cd9d||0x1f4;return function(_0x458b9a){logger[_0x2b1b('0x2c')](_0x458b9a[_0x2b1b('0x2d')]);if(_0x458b9a[_0x2b1b('0x2e')]){delete _0x458b9a[_0x2b1b('0x2e')];}_0x56bdc0[_0x2b1b('0x1a')](_0x77cd9d)[_0x2b1b('0x2f')](_0x458b9a);};}exports[_0x2b1b('0x30')]=function(_0x5bdb6b,_0x30c853){var _0x357243={},_0x49a887={},_0x22a182={'count':0x0,'rows':[]};var _0xb8a422=_[_0x2b1b('0x31')](db[_0x2b1b('0x32')][_0x2b1b('0x33')],function(_0x81dab){return{'name':_0x81dab['fieldName'],'type':_0x81dab['type'][_0x2b1b('0x34')]};});_0x49a887['model']=_[_0x2b1b('0x31')](_0xb8a422,_0x2b1b('0x2e'));_0x49a887[_0x2b1b('0x35')]=_['keys'](_0x5bdb6b[_0x2b1b('0x35')]);_0x49a887[_0x2b1b('0x36')]=_[_0x2b1b('0x37')](_0x49a887[_0x2b1b('0x38')],_0x49a887[_0x2b1b('0x35')]);_0x357243['attributes']=_[_0x2b1b('0x37')](_0x49a887['model'],qs[_0x2b1b('0x39')](_0x5bdb6b[_0x2b1b('0x35')]['fields']));_0x357243[_0x2b1b('0x3a')]=_0x357243[_0x2b1b('0x3a')]['length']?_0x357243[_0x2b1b('0x3a')]:_0x49a887['model'];if(!_0x5bdb6b['query'][_0x2b1b('0x3b')]('nolimit')){_0x357243[_0x2b1b('0x1f')]=qs[_0x2b1b('0x1f')](_0x5bdb6b[_0x2b1b('0x35')][_0x2b1b('0x1f')]);_0x357243['offset']=qs['offset'](_0x5bdb6b[_0x2b1b('0x35')][_0x2b1b('0x1d')]);}_0x357243['order']=qs['sort'](_0x5bdb6b[_0x2b1b('0x35')][_0x2b1b('0x3c')]);_0x357243[_0x2b1b('0x3d')]=qs[_0x2b1b('0x36')](_['pick'](_0x5bdb6b[_0x2b1b('0x35')],_0x49a887['filters']),_0xb8a422);if(_0x5bdb6b['query'][_0x2b1b('0x3e')]){_0x357243[_0x2b1b('0x3d')]=_['merge'](_0x357243['where'],{'$or':_[_0x2b1b('0x31')](_0xb8a422,function(_0x1cb9e8){if(_0x1cb9e8[_0x2b1b('0x3f')]!=='VIRTUAL'){var _0xd002f4={};_0xd002f4[_0x1cb9e8[_0x2b1b('0x2e')]]={'$like':'%'+_0x5bdb6b[_0x2b1b('0x35')][_0x2b1b('0x3e')]+'%'};return _0xd002f4;}})});}_0x357243=_['merge']({},_0x357243,_0x5bdb6b[_0x2b1b('0x40')]);var _0x3a225b={'where':_0x357243[_0x2b1b('0x3d')]};return db[_0x2b1b('0x32')][_0x2b1b('0x20')](_0x3a225b)['then'](function(_0x3b1076){_0x22a182[_0x2b1b('0x20')]=_0x3b1076;if(_0x5bdb6b[_0x2b1b('0x35')]['includeAll']){_0x357243[_0x2b1b('0x41')]=[{'all':!![]}];}return db[_0x2b1b('0x32')][_0x2b1b('0x42')](_0x357243);})[_0x2b1b('0x27')](function(_0x5a2433){_0x22a182[_0x2b1b('0x43')]=_0x5a2433;return _0x22a182;})[_0x2b1b('0x27')](respondWithFilteredResult(_0x30c853,_0x357243))[_0x2b1b('0x44')](handleError(_0x30c853,null));};exports[_0x2b1b('0x45')]=function(_0xf7f159,_0x32d287){var _0x5e48fc={'raw':!![],'where':{'id':_0xf7f159['params']['id']}},_0x4f176c={};_0x4f176c[_0x2b1b('0x38')]=_[_0x2b1b('0x46')](db[_0x2b1b('0x32')][_0x2b1b('0x33')]);_0x4f176c[_0x2b1b('0x35')]=_[_0x2b1b('0x46')](_0xf7f159[_0x2b1b('0x35')]);_0x4f176c[_0x2b1b('0x36')]=_[_0x2b1b('0x37')](_0x4f176c['model'],_0x4f176c[_0x2b1b('0x35')]);_0x5e48fc['attributes']=_[_0x2b1b('0x37')](_0x4f176c[_0x2b1b('0x38')],qs['fields'](_0xf7f159[_0x2b1b('0x35')][_0x2b1b('0x39')]));_0x5e48fc['attributes']=_0x5e48fc['attributes']['length']?_0x5e48fc[_0x2b1b('0x3a')]:_0x4f176c[_0x2b1b('0x38')];if(_0xf7f159[_0x2b1b('0x35')][_0x2b1b('0x47')]){_0x5e48fc['include']=[{'all':!![]}];}_0x5e48fc=_[_0x2b1b('0x48')]({},_0x5e48fc,_0xf7f159[_0x2b1b('0x40')]);return db[_0x2b1b('0x32')][_0x2b1b('0x49')](_0x5e48fc)['then'](handleEntityNotFound(_0x32d287,null))[_0x2b1b('0x27')](respondWithResult(_0x32d287,null))[_0x2b1b('0x44')](handleError(_0x32d287,null));};exports[_0x2b1b('0x4a')]=function(_0x2c00d4,_0x6ba667){return db[_0x2b1b('0x32')][_0x2b1b('0x4a')](_0x2c00d4[_0x2b1b('0x4b')],{})[_0x2b1b('0x27')](function(_0x4976e1){var _0x1a2617=_0x2c00d4[_0x2b1b('0x4c')][_0x2b1b('0x28')]({'plain':!![]});if(!_0x1a2617)throw new Error(_0x2b1b('0x4d'));if(_0x1a2617[_0x2b1b('0x4e')]===_0x2b1b('0x4c')){var _0x1669a3=_0x4976e1[_0x2b1b('0x28')]({'plain':!![]});var _0x4a8551='SmsQueues';return db[_0x2b1b('0x4f')][_0x2b1b('0x49')]({'where':{'name':_0x4a8551,'userProfileId':_0x1a2617[_0x2b1b('0x50')]},'raw':!![]})[_0x2b1b('0x27')](function(_0x3bae79){if(_0x3bae79&&_0x3bae79[_0x2b1b('0x51')]===0x0){return db[_0x2b1b('0x2a')][_0x2b1b('0x4a')]({'name':_0x1669a3[_0x2b1b('0x2e')],'resourceId':_0x1669a3['id'],'type':_0x3bae79[_0x2b1b('0x2e')],'sectionId':_0x3bae79['id']},{})['then'](function(){return _0x4976e1;});}else{return _0x4976e1;}})[_0x2b1b('0x44')](function(_0x1d683b){logger[_0x2b1b('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d683b);throw _0x1d683b;});}return _0x4976e1;})[_0x2b1b('0x27')](respondWithResult(_0x6ba667,0xc9))['catch'](handleError(_0x6ba667,null));};exports[_0x2b1b('0x26')]=function(_0x11755f,_0x371e52){if(_0x11755f[_0x2b1b('0x4b')]['id']){delete _0x11755f[_0x2b1b('0x4b')]['id'];}return db['SmsQueue'][_0x2b1b('0x49')]({'where':{'id':_0x11755f[_0x2b1b('0x52')]['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x371e52,null))[_0x2b1b('0x27')](saveUpdates(_0x11755f[_0x2b1b('0x4b')],null))[_0x2b1b('0x27')](respondWithResult(_0x371e52,null))[_0x2b1b('0x44')](handleError(_0x371e52,null));};exports[_0x2b1b('0x2b')]=function(_0x34dfcd,_0x2137d9){return db[_0x2b1b('0x32')][_0x2b1b('0x49')]({'where':{'id':_0x34dfcd[_0x2b1b('0x52')]['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x2137d9,null))['then'](removeEntity(_0x2137d9,null))[_0x2b1b('0x44')](handleError(_0x2137d9,null));};exports['describe']=function(_0x521f35,_0x170e88){return db[_0x2b1b('0x32')][_0x2b1b('0x53')]()[_0x2b1b('0x27')](respondWithResult(_0x170e88,null))[_0x2b1b('0x44')](handleError(_0x170e88,null));};exports[_0x2b1b('0x54')]=function(_0x5dfbf3,_0x107cdc,_0x130ae4){var _0xda1214={'raw':!![],'where':{}},_0x2ac03f={},_0x3011f5;return db[_0x2b1b('0x32')]['findOne']({'where':{'id':_0x5dfbf3[_0x2b1b('0x52')]['id']}})['then'](handleEntityNotFound(_0x107cdc,null))['then'](function(_0x4844b1){if(_0x4844b1){_0x3011f5=_0x4844b1[_0x2b1b('0x28')]({'plain':!![]});_0x2ac03f['model']=_[_0x2b1b('0x46')](db[_0x2b1b('0x55')][_0x2b1b('0x33')]);_0x2ac03f[_0x2b1b('0x35')]=_[_0x2b1b('0x46')](_0x5dfbf3['query']);_0x2ac03f[_0x2b1b('0x36')]=_['intersection'](_0x2ac03f[_0x2b1b('0x38')],_0x2ac03f[_0x2b1b('0x35')]);_0xda1214[_0x2b1b('0x3a')]=_[_0x2b1b('0x37')](_0x2ac03f[_0x2b1b('0x38')],qs[_0x2b1b('0x39')](_0x5dfbf3[_0x2b1b('0x35')][_0x2b1b('0x39')]));_0xda1214[_0x2b1b('0x3a')]=_0xda1214['attributes'][_0x2b1b('0x56')]?_0xda1214[_0x2b1b('0x3a')]:_0x2ac03f[_0x2b1b('0x38')];if(!_0x5dfbf3['query'][_0x2b1b('0x3b')](_0x2b1b('0x57'))){_0xda1214[_0x2b1b('0x1f')]=qs[_0x2b1b('0x1f')](_0x5dfbf3[_0x2b1b('0x35')][_0x2b1b('0x1f')]);_0xda1214[_0x2b1b('0x1d')]=qs[_0x2b1b('0x1d')](_0x5dfbf3[_0x2b1b('0x35')][_0x2b1b('0x1d')]);}_0xda1214[_0x2b1b('0x58')]=qs[_0x2b1b('0x3c')](_0x5dfbf3[_0x2b1b('0x35')][_0x2b1b('0x3c')]);_0xda1214[_0x2b1b('0x3d')]=qs[_0x2b1b('0x36')](_[_0x2b1b('0x59')](_0x5dfbf3[_0x2b1b('0x35')],_0x2ac03f[_0x2b1b('0x36')]));_0xda1214[_0x2b1b('0x3d')][_0x2b1b('0x5a')]=_0x4844b1['id'];if(_0x5dfbf3[_0x2b1b('0x35')][_0x2b1b('0x3e')]){_0xda1214['where']=_[_0x2b1b('0x48')](_0xda1214[_0x2b1b('0x3d')],{'$or':_[_0x2b1b('0x31')](_0xda1214[_0x2b1b('0x3a')],function(_0x489d62){var _0x550997={};_0x550997[_0x489d62]={'$like':'%'+_0x5dfbf3['query'][_0x2b1b('0x3e')]+'%'};return _0x550997;})});}_0xda1214=_['merge']({},_0xda1214,_0x5dfbf3[_0x2b1b('0x40')]);return db['UserSmsQueue'][_0x2b1b('0x42')](_0xda1214);}})[_0x2b1b('0x27')](function(_0x345575){if(_0x345575){return db['User'][_0x2b1b('0x5b')]({'where':{'id':_[_0x2b1b('0x31')](_0x345575,_0x2b1b('0x5c')),'role':_0x2b1b('0x5d')},'attributes':['id',_0x2b1b('0x2e'),_0x2b1b('0x5e'),_0x2b1b('0x5f'),'createdAt']});}})['then'](function(_0x35d7cf){if(_0x35d7cf){return{'count':_0x35d7cf[_0x2b1b('0x20')],'rows':_[_0x2b1b('0x31')](_0x35d7cf['rows'],function(_0x4d0253){return{'membername':_0x4d0253['name'],'UserId':_0x4d0253['id'],'queue_name':_0x3011f5[_0x2b1b('0x2e')],'SmsQueueId':_0x3011f5['id'],'interface':util[_0x2b1b('0x60')](_0x2b1b('0x61'),_0x2b1b('0x62'),_0x4d0253[_0x2b1b('0x2e')]),'penalty':0x0,'paused':_0x4d0253[_0x2b1b('0x5e')],'createdAt':_0x4d0253[_0x2b1b('0x63')],'updatedAt':_0x4d0253[_0x2b1b('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2b1b('0x27')](respondWithFilteredResult(_0x107cdc,_0xda1214))[_0x2b1b('0x44')](handleError(_0x107cdc,null));};exports['getTeams']=function(_0x47b02a,_0x21fa10,_0x570b5b){var _0x208df6={};var _0x41853e={};var _0x168d8a;var _0x40f4f5;return db[_0x2b1b('0x32')][_0x2b1b('0x64')]({'where':{'id':_0x47b02a[_0x2b1b('0x52')]['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x21fa10,null))[_0x2b1b('0x27')](function(_0x5dec4d){if(_0x5dec4d){_0x168d8a=_0x5dec4d;_0x41853e['model']=_[_0x2b1b('0x46')](db[_0x2b1b('0x65')]['rawAttributes']);_0x41853e[_0x2b1b('0x35')]=_[_0x2b1b('0x46')](_0x47b02a[_0x2b1b('0x35')]);_0x41853e[_0x2b1b('0x36')]=_[_0x2b1b('0x37')](_0x41853e['model'],_0x41853e[_0x2b1b('0x35')]);_0x208df6['attributes']=_['intersection'](_0x41853e['model'],qs[_0x2b1b('0x39')](_0x47b02a[_0x2b1b('0x35')]['fields']));_0x208df6[_0x2b1b('0x3a')]=_0x208df6[_0x2b1b('0x3a')][_0x2b1b('0x56')]?_0x208df6[_0x2b1b('0x3a')]:_0x41853e[_0x2b1b('0x38')];_0x208df6[_0x2b1b('0x58')]=qs['sort'](_0x47b02a[_0x2b1b('0x35')]['sort']);_0x208df6[_0x2b1b('0x3d')]=qs['filters'](_[_0x2b1b('0x59')](_0x47b02a[_0x2b1b('0x35')],_0x41853e[_0x2b1b('0x36')]));if(_0x47b02a[_0x2b1b('0x35')][_0x2b1b('0x3e')]){_0x208df6[_0x2b1b('0x3d')]=_[_0x2b1b('0x48')](_0x208df6[_0x2b1b('0x3d')],{'$or':_['map'](_0x208df6[_0x2b1b('0x3a')],function(_0x58958d){var _0x76d6fc={};_0x76d6fc[_0x58958d]={'$like':'%'+_0x47b02a['query']['filter']+'%'};return _0x76d6fc;})});}_0x208df6=_[_0x2b1b('0x48')]({},_0x208df6,_0x47b02a[_0x2b1b('0x40')]);return _0x168d8a[_0x2b1b('0x66')](_0x208df6);}})[_0x2b1b('0x27')](function(_0x9c4782){if(_0x9c4782){_0x40f4f5=_0x9c4782[_0x2b1b('0x56')];if(!_0x47b02a[_0x2b1b('0x35')]['hasOwnProperty'](_0x2b1b('0x57'))){_0x208df6[_0x2b1b('0x1f')]=qs[_0x2b1b('0x1f')](_0x47b02a[_0x2b1b('0x35')][_0x2b1b('0x1f')]);_0x208df6[_0x2b1b('0x1d')]=qs[_0x2b1b('0x1d')](_0x47b02a['query'][_0x2b1b('0x1d')]);}return _0x168d8a[_0x2b1b('0x66')](_0x208df6);}})[_0x2b1b('0x27')](function(_0x2c6e59){if(_0x2c6e59){return _0x2c6e59?{'count':_0x40f4f5,'rows':_0x2c6e59}:null;}})[_0x2b1b('0x27')](respondWithResult(_0x21fa10,null))['catch'](handleError(_0x21fa10,null));};exports['addTeams']=function(_0x512872,_0x99ca3e,_0x2fd550){var _0xbfc633=_0x512872['body'][_0x2b1b('0x67')];return db[_0x2b1b('0x65')][_0x2b1b('0x42')]({'where':{'id':_0xbfc633},'attributes':['id'],'include':[{'model':db[_0x2b1b('0x68')],'as':'Agents','attributes':['id',_0x2b1b('0x2e'),_0x2b1b('0x69'),_0x2b1b('0x6a'),'interface'],'raw':!![]}]})[_0x2b1b('0x27')](function(_0x4e8cc4){if(_0x4e8cc4){var _0x3bab0e=_['flatMap'](_0x4e8cc4,function(_0x47a3b4){var _0x129365=_0x47a3b4[_0x2b1b('0x28')]({'plain':!![]});return _0x129365[_0x2b1b('0x6b')];});return db[_0x2b1b('0x32')][_0x2b1b('0x49')]({'where':{'id':_0x512872[_0x2b1b('0x52')]['id']}})[_0x2b1b('0x27')](function(_0x448b58){return db[_0x2b1b('0x6c')][_0x2b1b('0x6d')](function(_0x30a87f){return _0x448b58[_0x2b1b('0x6e')](_0xbfc633,{'transaction':_0x30a87f})[_0x2b1b('0x27')](function(){return BPromise[_0x2b1b('0x6f')](_0x3bab0e,function(_0x321842){return db[_0x2b1b('0x55')][_0x2b1b('0x70')]({'where':{'UserId':_0x321842['id'],'SmsQueueId':_0x512872[_0x2b1b('0x52')]['id']},'transaction':_0x30a87f});});})['then'](function(){_0x3bab0e[_0x2b1b('0x71')](function(_0x51c1af){socket[_0x2b1b('0x72')](_0x2b1b('0x73'),{'UserId':_0x51c1af['id'],'SmsQueueId':_0x448b58['id']});});});});});}})[_0x2b1b('0x27')](respondWithStatusCode(_0x99ca3e,null))['catch'](handleError(_0x99ca3e,null));};exports[_0x2b1b('0x74')]=function(_0x413fba,_0x4b24cb,_0x3510c4){return db[_0x2b1b('0x65')][_0x2b1b('0x42')]({'where':{'id':_0x413fba[_0x2b1b('0x35')][_0x2b1b('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2b1b('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x2b1b('0x27')](handleEntityNotFound(_0x4b24cb,null))[_0x2b1b('0x27')](function(_0x3db82d){var _0x4026e9=_[_0x2b1b('0x31')](_0x3db82d,'id');var _0x32bb16=[];var _0xbf7e08=[];var _0x419e88=squel[_0x2b1b('0x75')]();_0x419e88['field'](_0x2b1b('0x76'))[_0x2b1b('0x77')](_0x2b1b('0x78'),'tq')[_0x2b1b('0x79')](_0x2b1b('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2b1b('0x3d')]('SmsQueueId\x20=\x20?',_0x413fba[_0x2b1b('0x52')]['id']);for(var _0x3e5515=0x0;_0x3e5515<_0x3db82d[_0x2b1b('0x56')];_0x3e5515+=0x1){let _0x5ef6a6=_0x3db82d[_0x3e5515];for(var _0x2df2c2=0x0;_0x2df2c2<_0x5ef6a6[_0x2b1b('0x6b')][_0x2b1b('0x56')];_0x2df2c2+=0x1){let _0x2d7f8a=_0x5ef6a6[_0x2b1b('0x6b')][_0x2df2c2];var _0x484274=_0x419e88[_0x2b1b('0x7b')]();_0x484274['where']('ut.UserId\x20=\x20?',_0x2d7f8a['id']);_0xbf7e08[_0x2b1b('0x7c')](db['sequelize'][_0x2b1b('0x35')](_0x484274[_0x2b1b('0x7d')](),{'type':db[_0x2b1b('0x6c')][_0x2b1b('0x7e')][_0x2b1b('0x7f')]})[_0x2b1b('0x27')](function(_0x7cc2f){if(_0x7cc2f[_0x2b1b('0x56')]===0x1){return _0x2d7f8a['id'];}else{var _0x3a2791=_[_0x2b1b('0x80')](_[_0x2b1b('0x31')](_0x7cc2f,_0x2b1b('0x81')),function(_0x3048d0){return _[_0x2b1b('0x82')](_0x4026e9,_0x3048d0);});if(_0x3a2791){return _0x2d7f8a['id'];}}}));}}return BPromise['all'](_0xbf7e08)[_0x2b1b('0x27')](function(_0x2ca9bb){_0x32bb16=_(_0x32bb16)[_0x2b1b('0x83')](_0x2ca9bb)['compact']()[_0x2b1b('0x84')]();return db[_0x2b1b('0x32')][_0x2b1b('0x49')]({'where':{'id':_0x413fba['params']['id']}})[_0x2b1b('0x27')](function(_0x5a26b5){return db[_0x2b1b('0x6c')][_0x2b1b('0x6d')](function(_0x6211be){return _0x5a26b5[_0x2b1b('0x74')](_0x413fba[_0x2b1b('0x35')][_0x2b1b('0x67')],{'transaction':_0x6211be})[_0x2b1b('0x27')](function(){if(!_['isEmpty'](_0x32bb16)){return _0x5a26b5[_0x2b1b('0x85')](_0x32bb16,{'transaction':_0x6211be});}})[_0x2b1b('0x27')](function(){_0x32bb16['forEach'](function(_0x5368bb){socket['emit'](_0x2b1b('0x86'),{'UserId':_0x5368bb,'SmsQueueId':_0x5a26b5['id']});});});});});});})[_0x2b1b('0x27')](respondWithStatusCode(_0x4b24cb,null))[_0x2b1b('0x44')](handleError(_0x4b24cb,null));};exports[_0x2b1b('0x87')]=function(_0xbba735,_0x4f50d2,_0xed734){return db[_0x2b1b('0x32')][_0x2b1b('0x49')]({'where':{'id':_0xbba735[_0x2b1b('0x52')]['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x4f50d2,null))[_0x2b1b('0x27')](function(_0x292b2f){if(_0x292b2f){return _0x292b2f[_0x2b1b('0x87')](_0xbba735['body']['ids'],_[_0x2b1b('0x88')](_0xbba735[_0x2b1b('0x4b')],[_0x2b1b('0x67'),'id'])||{})['spread'](function(_0x46e719){for(var _0x1f69aa=0x0;_0x1f69aa<_0xbba735[_0x2b1b('0x4b')][_0x2b1b('0x67')]['length'];_0x1f69aa+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0xbba735[_0x2b1b('0x4b')][_0x2b1b('0x67')][_0x1f69aa]),'SmsQueueId':Number(_0xbba735[_0x2b1b('0x52')]['id'])});}return _0x46e719;});}})[_0x2b1b('0x27')](respondWithResult(_0x4f50d2,null))['catch'](handleError(_0x4f50d2,null));};exports[_0x2b1b('0x85')]=function(_0x2c0b48,_0x53d993,_0x35608f){return db[_0x2b1b('0x32')][_0x2b1b('0x49')]({'where':{'id':_0x2c0b48[_0x2b1b('0x52')]['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x53d993,null))[_0x2b1b('0x27')](function(_0x2f3b82){if(_0x2f3b82){return _0x2f3b82[_0x2b1b('0x85')](_0x2c0b48[_0x2b1b('0x35')][_0x2b1b('0x67')])[_0x2b1b('0x27')](function(){if(_[_0x2b1b('0x89')](_0x2c0b48[_0x2b1b('0x35')][_0x2b1b('0x67')])){for(var _0x5d6b15=0x0;_0x5d6b15<_0x2c0b48[_0x2b1b('0x35')][_0x2b1b('0x67')][_0x2b1b('0x56')];_0x5d6b15+=0x1){socket[_0x2b1b('0x72')](_0x2b1b('0x86'),{'UserId':Number(_0x2c0b48[_0x2b1b('0x35')][_0x2b1b('0x67')][_0x5d6b15]),'SmsQueueId':Number(_0x2c0b48['params']['id'])});}}else{socket[_0x2b1b('0x72')](_0x2b1b('0x86'),{'UserId':Number(_0x2c0b48['query']['ids']),'SmsQueueId':Number(_0x2c0b48[_0x2b1b('0x52')]['id'])});}});}})[_0x2b1b('0x27')](respondWithStatusCode(_0x53d993,null))[_0x2b1b('0x44')](handleError(_0x53d993,null));};exports[_0x2b1b('0x8a')]=function(_0x3a0714,_0x81a97e,_0x38d4c8){var _0x42dc02={};var _0x11de47={};var _0x5e225b;var _0x7c4257;return db[_0x2b1b('0x32')][_0x2b1b('0x64')]({'where':{'id':_0x3a0714['params']['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x81a97e,null))[_0x2b1b('0x27')](function(_0x5c14cb){if(_0x5c14cb){_0x5e225b=_0x5c14cb;_0x11de47[_0x2b1b('0x38')]=_[_0x2b1b('0x46')](db[_0x2b1b('0x68')][_0x2b1b('0x33')]);_0x11de47[_0x2b1b('0x35')]=_['keys'](_0x3a0714[_0x2b1b('0x35')]);_0x11de47[_0x2b1b('0x36')]=_['intersection'](_0x11de47[_0x2b1b('0x38')],_0x11de47[_0x2b1b('0x35')]);_0x42dc02[_0x2b1b('0x3a')]=_[_0x2b1b('0x37')](_0x11de47[_0x2b1b('0x38')],qs['fields'](_0x3a0714[_0x2b1b('0x35')][_0x2b1b('0x39')]));_0x42dc02[_0x2b1b('0x3a')]=_0x42dc02[_0x2b1b('0x3a')][_0x2b1b('0x56')]?_0x42dc02['attributes']:_0x11de47['model'];_0x42dc02[_0x2b1b('0x58')]=qs[_0x2b1b('0x3c')](_0x3a0714[_0x2b1b('0x35')][_0x2b1b('0x3c')]);_0x42dc02[_0x2b1b('0x3d')]=qs[_0x2b1b('0x36')](_[_0x2b1b('0x59')](_0x3a0714[_0x2b1b('0x35')],_0x11de47['filters']));if(_0x3a0714[_0x2b1b('0x35')][_0x2b1b('0x3e')]){_0x42dc02[_0x2b1b('0x3d')]=_['merge'](_0x42dc02[_0x2b1b('0x3d')],{'$or':_[_0x2b1b('0x31')](_0x42dc02[_0x2b1b('0x3a')],function(_0x38d0d9){var _0x1aaae6={};_0x1aaae6[_0x38d0d9]={'$like':'%'+_0x3a0714[_0x2b1b('0x35')]['filter']+'%'};return _0x1aaae6;})});}_0x42dc02=_[_0x2b1b('0x48')]({},_0x42dc02,_0x3a0714['options']);return _0x5e225b[_0x2b1b('0x8a')](_0x42dc02);}})[_0x2b1b('0x27')](function(_0x242c66){if(_0x242c66){_0x7c4257=_0x242c66[_0x2b1b('0x56')];if(!_0x3a0714[_0x2b1b('0x35')]['hasOwnProperty']('nolimit')){_0x42dc02[_0x2b1b('0x1f')]=qs[_0x2b1b('0x1f')](_0x3a0714['query'][_0x2b1b('0x1f')]);_0x42dc02[_0x2b1b('0x1d')]=qs[_0x2b1b('0x1d')](_0x3a0714['query']['offset']);}return _0x5e225b[_0x2b1b('0x8a')](_0x42dc02);}})[_0x2b1b('0x27')](function(_0x5df495){if(_0x5df495){return _0x5df495?{'count':_0x7c4257,'rows':_0x5df495}:null;}})[_0x2b1b('0x27')](respondWithResult(_0x81a97e,null))[_0x2b1b('0x44')](handleError(_0x81a97e,null));};
\ No newline at end of file
+var _0x9960=['describe','getMembers','UserSmsQueue','order','pick','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','findOne','Team','ids','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','all','union','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','defaults','./smsQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','fieldName','type','model','query','keys','filters','intersection','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','findAll','rows','show','params','rawAttributes','attributes','fields','include','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','find'];(function(_0x2cbeb8,_0x49d8a8){var _0xfaec4e=function(_0x5a9042){while(--_0x5a9042){_0x2cbeb8['push'](_0x2cbeb8['shift']());}};_0xfaec4e(++_0x49d8a8);}(_0x9960,0x147));var _0x0996=function(_0x55a109,_0x277fc6){_0x55a109=_0x55a109-0x0;var _0x359f83=_0x9960[_0x55a109];return _0x359f83;};'use strict';var emlformat=require(_0x0996('0x0'));var rimraf=require(_0x0996('0x1'));var zipdir=require(_0x0996('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0996('0x3'));var BPromise=require(_0x0996('0x4'));var Mustache=require(_0x0996('0x5'));var util=require(_0x0996('0x6'));var path=require(_0x0996('0x7'));var sox=require(_0x0996('0x8'));var csv=require(_0x0996('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0996('0xa'));var _=require(_0x0996('0xb'));var squel=require('squel');var crypto=require(_0x0996('0xc'));var jsforce=require(_0x0996('0xd'));var deskjs=require(_0x0996('0xe'));var toCsv=require(_0x0996('0x9'));var querystring=require(_0x0996('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0996('0x10'));var qs=require(_0x0996('0x11'));var as=require(_0x0996('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0996('0x13'));var utils=require('../../config/utils');var config=require(_0x0996('0x14'));var licenseUtil=require(_0x0996('0x15'));var db=require('../../mysqldb')['db'];config[_0x0996('0x16')]=_[_0x0996('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0996('0x16')]));require(_0x0996('0x18'))[_0x0996('0x19')](socket);function respondWithStatusCode(_0x1e1363,_0x5b7c43){_0x5b7c43=_0x5b7c43||0xcc;return function(_0x35ea13){if(_0x35ea13){return _0x1e1363['sendStatus'](_0x5b7c43);}return _0x1e1363[_0x0996('0x1a')](_0x5b7c43)[_0x0996('0x1b')]();};}function respondWithResult(_0x490444,_0xaeaacb){_0xaeaacb=_0xaeaacb||0xc8;return function(_0x26c100){if(_0x26c100){return _0x490444[_0x0996('0x1a')](_0xaeaacb)[_0x0996('0x1c')](_0x26c100);}};}function respondWithFilteredResult(_0x3ff7ff,_0x4d9564){return function(_0x5c0df9){if(_0x5c0df9){var _0x1954c5=typeof _0x4d9564[_0x0996('0x1d')]===_0x0996('0x1e')&&typeof _0x4d9564[_0x0996('0x1f')]===_0x0996('0x1e');var _0x9af35f=_0x5c0df9['count'];var _0x5a9d02=_0x1954c5?0x0:_0x4d9564[_0x0996('0x1d')];var _0x2c0c26=_0x1954c5?_0x5c0df9[_0x0996('0x20')]:_0x4d9564[_0x0996('0x1d')]+_0x4d9564[_0x0996('0x1f')];var _0x57372b;if(_0x2c0c26>=_0x9af35f){_0x2c0c26=_0x9af35f;_0x57372b=0xc8;}else{_0x57372b=0xce;}_0x3ff7ff[_0x0996('0x1a')](_0x57372b);return _0x3ff7ff[_0x0996('0x21')](_0x0996('0x22'),_0x5a9d02+'-'+_0x2c0c26+'/'+_0x9af35f)[_0x0996('0x1c')](_0x5c0df9);}return null;};}function patchUpdates(_0x1ea01a){return function(_0x400538){try{jsonpatch['apply'](_0x400538,_0x1ea01a,!![]);}catch(_0x5188ba){return BPromise[_0x0996('0x23')](_0x5188ba);}return _0x400538[_0x0996('0x24')]();};}function saveUpdates(_0x508626,_0x4ad4ce){return function(_0x28eda3){if(_0x28eda3){return _0x28eda3[_0x0996('0x25')](_0x508626)[_0x0996('0x26')](function(_0x482259){return _0x482259;});}return null;};}function removeEntity(_0x19df1c,_0x5f4e5b){return function(_0x3c543b){if(_0x3c543b){return _0x3c543b[_0x0996('0x27')]()[_0x0996('0x26')](function(){var _0x2e2af4=_0x3c543b[_0x0996('0x28')]({'plain':!![]});var _0x46992b=_0x0996('0x29');return db[_0x0996('0x2a')][_0x0996('0x27')]({'where':{'type':_0x46992b,'resourceId':_0x2e2af4['id']}})['then'](function(){return _0x3c543b;});})[_0x0996('0x26')](function(){_0x19df1c[_0x0996('0x1a')](0xcc)[_0x0996('0x1b')]();});}};}function handleEntityNotFound(_0x2bd2d1,_0x3f7046){return function(_0x17a890){if(!_0x17a890){_0x2bd2d1['sendStatus'](0x194);}return _0x17a890;};}function handleError(_0x26a152,_0x1d66b6){_0x1d66b6=_0x1d66b6||0x1f4;return function(_0x3c724b){logger[_0x0996('0x2b')](_0x3c724b[_0x0996('0x2c')]);if(_0x3c724b[_0x0996('0x2d')]){delete _0x3c724b[_0x0996('0x2d')];}_0x26a152[_0x0996('0x1a')](_0x1d66b6)[_0x0996('0x2e')](_0x3c724b);};}exports[_0x0996('0x2f')]=function(_0xeed36,_0x133ace){var _0x841a2b={},_0x2e67a8={},_0x5f1f72={'count':0x0,'rows':[]};var _0x38f856=_[_0x0996('0x30')](db[_0x0996('0x31')]['rawAttributes'],function(_0x2a262d){return{'name':_0x2a262d[_0x0996('0x32')],'type':_0x2a262d[_0x0996('0x33')]['key']};});_0x2e67a8[_0x0996('0x34')]=_[_0x0996('0x30')](_0x38f856,'name');_0x2e67a8[_0x0996('0x35')]=_[_0x0996('0x36')](_0xeed36[_0x0996('0x35')]);_0x2e67a8[_0x0996('0x37')]=_[_0x0996('0x38')](_0x2e67a8['model'],_0x2e67a8['query']);_0x841a2b['attributes']=_[_0x0996('0x38')](_0x2e67a8[_0x0996('0x34')],qs['fields'](_0xeed36['query']['fields']));_0x841a2b['attributes']=_0x841a2b['attributes'][_0x0996('0x39')]?_0x841a2b['attributes']:_0x2e67a8['model'];if(!_0xeed36['query'][_0x0996('0x3a')](_0x0996('0x3b'))){_0x841a2b[_0x0996('0x1f')]=qs[_0x0996('0x1f')](_0xeed36[_0x0996('0x35')][_0x0996('0x1f')]);_0x841a2b['offset']=qs[_0x0996('0x1d')](_0xeed36[_0x0996('0x35')][_0x0996('0x1d')]);}_0x841a2b['order']=qs[_0x0996('0x3c')](_0xeed36[_0x0996('0x35')][_0x0996('0x3c')]);_0x841a2b[_0x0996('0x3d')]=qs['filters'](_['pick'](_0xeed36[_0x0996('0x35')],_0x2e67a8[_0x0996('0x37')]),_0x38f856);if(_0xeed36[_0x0996('0x35')][_0x0996('0x3e')]){_0x841a2b[_0x0996('0x3d')]=_['merge'](_0x841a2b[_0x0996('0x3d')],{'$or':_[_0x0996('0x30')](_0x38f856,function(_0x10adff){if(_0x10adff['type']!==_0x0996('0x3f')){var _0x38b0a2={};_0x38b0a2[_0x10adff[_0x0996('0x2d')]]={'$like':'%'+_0xeed36[_0x0996('0x35')][_0x0996('0x3e')]+'%'};return _0x38b0a2;}})});}_0x841a2b=_[_0x0996('0x40')]({},_0x841a2b,_0xeed36['options']);var _0x24cd4c={'where':_0x841a2b[_0x0996('0x3d')]};return db['SmsQueue']['count'](_0x24cd4c)[_0x0996('0x26')](function(_0x3caac8){_0x5f1f72['count']=_0x3caac8;if(_0xeed36[_0x0996('0x35')]['includeAll']){_0x841a2b['include']=[{'all':!![]}];}return db[_0x0996('0x31')][_0x0996('0x41')](_0x841a2b);})[_0x0996('0x26')](function(_0x527a18){_0x5f1f72[_0x0996('0x42')]=_0x527a18;return _0x5f1f72;})[_0x0996('0x26')](respondWithFilteredResult(_0x133ace,_0x841a2b))['catch'](handleError(_0x133ace,null));};exports[_0x0996('0x43')]=function(_0x18a60c,_0x210d48){var _0x29bb41={'raw':!![],'where':{'id':_0x18a60c[_0x0996('0x44')]['id']}},_0x417cf4={};_0x417cf4[_0x0996('0x34')]=_[_0x0996('0x36')](db[_0x0996('0x31')][_0x0996('0x45')]);_0x417cf4['query']=_[_0x0996('0x36')](_0x18a60c[_0x0996('0x35')]);_0x417cf4['filters']=_[_0x0996('0x38')](_0x417cf4[_0x0996('0x34')],_0x417cf4[_0x0996('0x35')]);_0x29bb41[_0x0996('0x46')]=_[_0x0996('0x38')](_0x417cf4[_0x0996('0x34')],qs[_0x0996('0x47')](_0x18a60c[_0x0996('0x35')][_0x0996('0x47')]));_0x29bb41[_0x0996('0x46')]=_0x29bb41[_0x0996('0x46')][_0x0996('0x39')]?_0x29bb41['attributes']:_0x417cf4[_0x0996('0x34')];if(_0x18a60c[_0x0996('0x35')]['includeAll']){_0x29bb41[_0x0996('0x48')]=[{'all':!![]}];}_0x29bb41=_['merge']({},_0x29bb41,_0x18a60c[_0x0996('0x49')]);return db['SmsQueue']['find'](_0x29bb41)['then'](handleEntityNotFound(_0x210d48,null))['then'](respondWithResult(_0x210d48,null))[_0x0996('0x4a')](handleError(_0x210d48,null));};exports['create']=function(_0x40edaa,_0x3aee93){return db[_0x0996('0x31')][_0x0996('0x4b')](_0x40edaa[_0x0996('0x4c')],{})[_0x0996('0x26')](function(_0x3063fa){var _0x342c9c=_0x40edaa['user'][_0x0996('0x28')]({'plain':!![]});if(!_0x342c9c)throw new Error(_0x0996('0x4d'));if(_0x342c9c[_0x0996('0x4e')]==='user'){var _0x47ab34=_0x3063fa['get']({'plain':!![]});var _0x82210a=_0x0996('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x82210a,'userProfileId':_0x342c9c[_0x0996('0x4f')]},'raw':!![]})[_0x0996('0x26')](function(_0x7afef5){if(_0x7afef5&&_0x7afef5['autoAssociation']===0x0){return db['UserProfileResource'][_0x0996('0x4b')]({'name':_0x47ab34[_0x0996('0x2d')],'resourceId':_0x47ab34['id'],'type':_0x7afef5[_0x0996('0x2d')],'sectionId':_0x7afef5['id']},{})[_0x0996('0x26')](function(){return _0x3063fa;});}else{return _0x3063fa;}})['catch'](function(_0x3a1eb1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a1eb1);throw _0x3a1eb1;});}return _0x3063fa;})[_0x0996('0x26')](respondWithResult(_0x3aee93,0xc9))[_0x0996('0x4a')](handleError(_0x3aee93,null));};exports[_0x0996('0x25')]=function(_0x33182f,_0x313c0a){if(_0x33182f[_0x0996('0x4c')]['id']){delete _0x33182f[_0x0996('0x4c')]['id'];}return db[_0x0996('0x31')][_0x0996('0x50')]({'where':{'id':_0x33182f[_0x0996('0x44')]['id']}})[_0x0996('0x26')](handleEntityNotFound(_0x313c0a,null))[_0x0996('0x26')](saveUpdates(_0x33182f[_0x0996('0x4c')],null))[_0x0996('0x26')](respondWithResult(_0x313c0a,null))[_0x0996('0x4a')](handleError(_0x313c0a,null));};exports[_0x0996('0x27')]=function(_0x58544a,_0x2ea18e){return db[_0x0996('0x31')][_0x0996('0x50')]({'where':{'id':_0x58544a[_0x0996('0x44')]['id']}})[_0x0996('0x26')](handleEntityNotFound(_0x2ea18e,null))['then'](removeEntity(_0x2ea18e,null))[_0x0996('0x4a')](handleError(_0x2ea18e,null));};exports[_0x0996('0x51')]=function(_0x17e971,_0x2485cf){return db[_0x0996('0x31')]['describe']()[_0x0996('0x26')](respondWithResult(_0x2485cf,null))['catch'](handleError(_0x2485cf,null));};exports[_0x0996('0x52')]=function(_0x1d3f12,_0x29d9de,_0x55baa8){var _0x39e93b={'raw':!![],'where':{}},_0x3691a4={},_0xde9899;return db[_0x0996('0x31')]['findOne']({'where':{'id':_0x1d3f12['params']['id']}})['then'](handleEntityNotFound(_0x29d9de,null))['then'](function(_0x339bff){if(_0x339bff){_0xde9899=_0x339bff['get']({'plain':!![]});_0x3691a4[_0x0996('0x34')]=_[_0x0996('0x36')](db[_0x0996('0x53')][_0x0996('0x45')]);_0x3691a4[_0x0996('0x35')]=_[_0x0996('0x36')](_0x1d3f12[_0x0996('0x35')]);_0x3691a4[_0x0996('0x37')]=_[_0x0996('0x38')](_0x3691a4['model'],_0x3691a4[_0x0996('0x35')]);_0x39e93b['attributes']=_[_0x0996('0x38')](_0x3691a4[_0x0996('0x34')],qs[_0x0996('0x47')](_0x1d3f12[_0x0996('0x35')]['fields']));_0x39e93b[_0x0996('0x46')]=_0x39e93b['attributes'][_0x0996('0x39')]?_0x39e93b[_0x0996('0x46')]:_0x3691a4[_0x0996('0x34')];if(!_0x1d3f12['query'][_0x0996('0x3a')](_0x0996('0x3b'))){_0x39e93b['limit']=qs['limit'](_0x1d3f12[_0x0996('0x35')][_0x0996('0x1f')]);_0x39e93b[_0x0996('0x1d')]=qs['offset'](_0x1d3f12[_0x0996('0x35')][_0x0996('0x1d')]);}_0x39e93b[_0x0996('0x54')]=qs[_0x0996('0x3c')](_0x1d3f12[_0x0996('0x35')][_0x0996('0x3c')]);_0x39e93b[_0x0996('0x3d')]=qs[_0x0996('0x37')](_[_0x0996('0x55')](_0x1d3f12[_0x0996('0x35')],_0x3691a4[_0x0996('0x37')]));_0x39e93b[_0x0996('0x3d')][_0x0996('0x56')]=_0x339bff['id'];if(_0x1d3f12[_0x0996('0x35')]['filter']){_0x39e93b[_0x0996('0x3d')]=_[_0x0996('0x40')](_0x39e93b[_0x0996('0x3d')],{'$or':_[_0x0996('0x30')](_0x39e93b[_0x0996('0x46')],function(_0xc0b4e3){var _0x3feb45={};_0x3feb45[_0xc0b4e3]={'$like':'%'+_0x1d3f12[_0x0996('0x35')][_0x0996('0x3e')]+'%'};return _0x3feb45;})});}_0x39e93b=_['merge']({},_0x39e93b,_0x1d3f12[_0x0996('0x49')]);return db[_0x0996('0x53')][_0x0996('0x41')](_0x39e93b);}})['then'](function(_0x383e42){if(_0x383e42){return db[_0x0996('0x57')][_0x0996('0x58')]({'where':{'id':_[_0x0996('0x30')](_0x383e42,_0x0996('0x59')),'role':_0x0996('0x5a')},'attributes':['id','name',_0x0996('0x5b'),_0x0996('0x5c'),_0x0996('0x5d')]});}})[_0x0996('0x26')](function(_0x11016c){if(_0x11016c){return{'count':_0x11016c['count'],'rows':_[_0x0996('0x30')](_0x11016c['rows'],function(_0x3708db){return{'membername':_0x3708db['name'],'UserId':_0x3708db['id'],'queue_name':_0xde9899[_0x0996('0x2d')],'SmsQueueId':_0xde9899['id'],'interface':util[_0x0996('0x5e')]('%s/%s',_0x0996('0x5f'),_0x3708db[_0x0996('0x2d')]),'penalty':0x0,'paused':_0x3708db[_0x0996('0x5b')],'createdAt':_0x3708db[_0x0996('0x5d')],'updatedAt':_0x3708db[_0x0996('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0996('0x26')](respondWithFilteredResult(_0x29d9de,_0x39e93b))[_0x0996('0x4a')](handleError(_0x29d9de,null));};exports['getTeams']=function(_0x3b0689,_0x21ec53,_0x1b1248){var _0x3822ca={};var _0x573023={};var _0x5b29f8;var _0x4b080f;return db[_0x0996('0x31')][_0x0996('0x60')]({'where':{'id':_0x3b0689[_0x0996('0x44')]['id']}})[_0x0996('0x26')](handleEntityNotFound(_0x21ec53,null))['then'](function(_0x3966bf){if(_0x3966bf){_0x5b29f8=_0x3966bf;_0x573023['model']=_['keys'](db[_0x0996('0x61')][_0x0996('0x45')]);_0x573023[_0x0996('0x35')]=_[_0x0996('0x36')](_0x3b0689[_0x0996('0x35')]);_0x573023[_0x0996('0x37')]=_[_0x0996('0x38')](_0x573023[_0x0996('0x34')],_0x573023[_0x0996('0x35')]);_0x3822ca[_0x0996('0x46')]=_[_0x0996('0x38')](_0x573023[_0x0996('0x34')],qs[_0x0996('0x47')](_0x3b0689[_0x0996('0x35')]['fields']));_0x3822ca[_0x0996('0x46')]=_0x3822ca[_0x0996('0x46')][_0x0996('0x39')]?_0x3822ca[_0x0996('0x46')]:_0x573023[_0x0996('0x34')];_0x3822ca['order']=qs[_0x0996('0x3c')](_0x3b0689['query']['sort']);_0x3822ca[_0x0996('0x3d')]=qs['filters'](_[_0x0996('0x55')](_0x3b0689[_0x0996('0x35')],_0x573023[_0x0996('0x37')]));if(_0x3b0689[_0x0996('0x35')][_0x0996('0x3e')]){_0x3822ca[_0x0996('0x3d')]=_[_0x0996('0x40')](_0x3822ca[_0x0996('0x3d')],{'$or':_[_0x0996('0x30')](_0x3822ca[_0x0996('0x46')],function(_0x383a5f){var _0x2d9d3e={};_0x2d9d3e[_0x383a5f]={'$like':'%'+_0x3b0689[_0x0996('0x35')]['filter']+'%'};return _0x2d9d3e;})});}_0x3822ca=_[_0x0996('0x40')]({},_0x3822ca,_0x3b0689[_0x0996('0x49')]);return _0x5b29f8['getTeams'](_0x3822ca);}})[_0x0996('0x26')](function(_0x2cab74){if(_0x2cab74){_0x4b080f=_0x2cab74[_0x0996('0x39')];if(!_0x3b0689['query'][_0x0996('0x3a')](_0x0996('0x3b'))){_0x3822ca[_0x0996('0x1f')]=qs[_0x0996('0x1f')](_0x3b0689[_0x0996('0x35')][_0x0996('0x1f')]);_0x3822ca[_0x0996('0x1d')]=qs[_0x0996('0x1d')](_0x3b0689[_0x0996('0x35')]['offset']);}return _0x5b29f8['getTeams'](_0x3822ca);}})[_0x0996('0x26')](function(_0x112250){if(_0x112250){return _0x112250?{'count':_0x4b080f,'rows':_0x112250}:null;}})['then'](respondWithResult(_0x21ec53,null))[_0x0996('0x4a')](handleError(_0x21ec53,null));};exports['addTeams']=function(_0x21e7b9,_0x125c31,_0x73c760){var _0x4b3348=_0x21e7b9[_0x0996('0x4c')][_0x0996('0x62')];return db[_0x0996('0x61')][_0x0996('0x41')]({'where':{'id':_0x4b3348},'attributes':['id'],'include':[{'model':db[_0x0996('0x57')],'as':'Agents','attributes':['id',_0x0996('0x2d'),'online',_0x0996('0x63'),_0x0996('0x64')],'raw':!![]}]})[_0x0996('0x26')](function(_0x4950aa){if(_0x4950aa){var _0x62b966=_[_0x0996('0x65')](_0x4950aa,function(_0x2bcee0){var _0x340fbd=_0x2bcee0[_0x0996('0x28')]({'plain':!![]});return _0x340fbd['Agents'];});return db[_0x0996('0x31')][_0x0996('0x50')]({'where':{'id':_0x21e7b9[_0x0996('0x44')]['id']}})['then'](function(_0x2c2044){return db[_0x0996('0x66')][_0x0996('0x67')](function(_0x34457c){return _0x2c2044[_0x0996('0x68')](_0x4b3348,{'transaction':_0x34457c})[_0x0996('0x26')](function(){return BPromise[_0x0996('0x69')](_0x62b966,function(_0x588dd2){return db[_0x0996('0x53')][_0x0996('0x6a')]({'where':{'UserId':_0x588dd2['id'],'SmsQueueId':_0x21e7b9[_0x0996('0x44')]['id']},'transaction':_0x34457c});});})[_0x0996('0x26')](function(){_0x62b966[_0x0996('0x6b')](function(_0x4005a0){socket[_0x0996('0x6c')](_0x0996('0x6d'),{'UserId':_0x4005a0['id'],'SmsQueueId':_0x2c2044['id']});});});});});}})[_0x0996('0x26')](respondWithStatusCode(_0x125c31,null))[_0x0996('0x4a')](handleError(_0x125c31,null));};exports[_0x0996('0x6e')]=function(_0x2a9c13,_0x518120,_0x1a9e38){return db[_0x0996('0x61')][_0x0996('0x41')]({'where':{'id':_0x2a9c13[_0x0996('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0996('0x57')],'as':_0x0996('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x518120,null))['then'](function(_0xf493f5){var _0x35fa65=_['map'](_0xf493f5,'id');var _0x4a6ce2=[];var _0xa7dbf2=[];var _0xf816d=squel[_0x0996('0x70')]();_0xf816d[_0x0996('0x71')](_0x0996('0x72'))[_0x0996('0x73')](_0x0996('0x74'),'tq')[_0x0996('0x75')]('user_has_teams','ut',_0x0996('0x76'))[_0x0996('0x3d')](_0x0996('0x77'),_0x2a9c13['params']['id']);for(var _0x5e11d4=0x0;_0x5e11d4<_0xf493f5[_0x0996('0x39')];_0x5e11d4+=0x1){let _0x20775c=_0xf493f5[_0x5e11d4];for(var _0x138712=0x0;_0x138712<_0x20775c['Agents'][_0x0996('0x39')];_0x138712+=0x1){let _0x1b13b3=_0x20775c[_0x0996('0x6f')][_0x138712];var _0x1f92ec=_0xf816d[_0x0996('0x78')]();_0x1f92ec[_0x0996('0x3d')](_0x0996('0x79'),_0x1b13b3['id']);_0xa7dbf2['push'](db['sequelize']['query'](_0x1f92ec['toString'](),{'type':db['sequelize'][_0x0996('0x7a')][_0x0996('0x7b')]})[_0x0996('0x26')](function(_0x36b808){if(_0x36b808[_0x0996('0x39')]===0x1){return _0x1b13b3['id'];}else{var _0x432def=_[_0x0996('0x7c')](_['map'](_0x36b808,'TeamId'),function(_0x4b12f4){return _['includes'](_0x35fa65,_0x4b12f4);});if(_0x432def){return _0x1b13b3['id'];}}}));}}return BPromise[_0x0996('0x7d')](_0xa7dbf2)[_0x0996('0x26')](function(_0x5617f1){_0x4a6ce2=_(_0x4a6ce2)[_0x0996('0x7e')](_0x5617f1)['compact']()[_0x0996('0x7f')]();return db['SmsQueue'][_0x0996('0x50')]({'where':{'id':_0x2a9c13[_0x0996('0x44')]['id']}})[_0x0996('0x26')](function(_0x3df41c){return db['sequelize']['transaction'](function(_0xd23572){return _0x3df41c[_0x0996('0x6e')](_0x2a9c13[_0x0996('0x35')][_0x0996('0x62')],{'transaction':_0xd23572})['then'](function(){if(!_[_0x0996('0x80')](_0x4a6ce2)){return _0x3df41c['removeAgents'](_0x4a6ce2,{'transaction':_0xd23572});}})[_0x0996('0x26')](function(){_0x4a6ce2[_0x0996('0x6b')](function(_0x40eeda){socket['emit'](_0x0996('0x81'),{'UserId':_0x40eeda,'SmsQueueId':_0x3df41c['id']});});});});});});})[_0x0996('0x26')](respondWithStatusCode(_0x518120,null))[_0x0996('0x4a')](handleError(_0x518120,null));};exports[_0x0996('0x82')]=function(_0x3413f0,_0x25dd4f,_0x2941f5){return db[_0x0996('0x31')][_0x0996('0x50')]({'where':{'id':_0x3413f0[_0x0996('0x44')]['id']}})[_0x0996('0x26')](handleEntityNotFound(_0x25dd4f,null))[_0x0996('0x26')](function(_0x1752f4){if(_0x1752f4){return _0x1752f4[_0x0996('0x82')](_0x3413f0[_0x0996('0x4c')][_0x0996('0x62')],_[_0x0996('0x83')](_0x3413f0['body'],[_0x0996('0x62'),'id'])||{})[_0x0996('0x84')](function(_0x27e3b1){for(var _0x561a6a=0x0;_0x561a6a<_0x3413f0[_0x0996('0x4c')][_0x0996('0x62')]['length'];_0x561a6a+=0x1){socket[_0x0996('0x6c')]('userSmsQueue:save',{'UserId':Number(_0x3413f0['body'][_0x0996('0x62')][_0x561a6a]),'SmsQueueId':Number(_0x3413f0[_0x0996('0x44')]['id'])});}return _0x27e3b1;});}})[_0x0996('0x26')](respondWithResult(_0x25dd4f,null))[_0x0996('0x4a')](handleError(_0x25dd4f,null));};exports[_0x0996('0x85')]=function(_0x260e58,_0x412ef5,_0x12552c){return db[_0x0996('0x31')]['find']({'where':{'id':_0x260e58[_0x0996('0x44')]['id']}})[_0x0996('0x26')](handleEntityNotFound(_0x412ef5,null))[_0x0996('0x26')](function(_0x5d20e2){if(_0x5d20e2){return _0x5d20e2[_0x0996('0x85')](_0x260e58['query']['ids'])[_0x0996('0x26')](function(){if(_[_0x0996('0x86')](_0x260e58[_0x0996('0x35')]['ids'])){for(var _0x1eb3d1=0x0;_0x1eb3d1<_0x260e58[_0x0996('0x35')][_0x0996('0x62')][_0x0996('0x39')];_0x1eb3d1+=0x1){socket['emit'](_0x0996('0x81'),{'UserId':Number(_0x260e58[_0x0996('0x35')][_0x0996('0x62')][_0x1eb3d1]),'SmsQueueId':Number(_0x260e58[_0x0996('0x44')]['id'])});}}else{socket[_0x0996('0x6c')](_0x0996('0x81'),{'UserId':Number(_0x260e58[_0x0996('0x35')][_0x0996('0x62')]),'SmsQueueId':Number(_0x260e58[_0x0996('0x44')]['id'])});}});}})[_0x0996('0x26')](respondWithStatusCode(_0x412ef5,null))[_0x0996('0x4a')](handleError(_0x412ef5,null));};exports[_0x0996('0x87')]=function(_0x53cf81,_0x2e5216,_0x843acf){var _0x36936a={};var _0x271fa7={};var _0x34a148;var _0x589bc6;return db[_0x0996('0x31')][_0x0996('0x60')]({'where':{'id':_0x53cf81[_0x0996('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e5216,null))[_0x0996('0x26')](function(_0x5c3db0){if(_0x5c3db0){_0x34a148=_0x5c3db0;_0x271fa7[_0x0996('0x34')]=_[_0x0996('0x36')](db[_0x0996('0x57')]['rawAttributes']);_0x271fa7[_0x0996('0x35')]=_[_0x0996('0x36')](_0x53cf81[_0x0996('0x35')]);_0x271fa7[_0x0996('0x37')]=_[_0x0996('0x38')](_0x271fa7['model'],_0x271fa7[_0x0996('0x35')]);_0x36936a[_0x0996('0x46')]=_[_0x0996('0x38')](_0x271fa7[_0x0996('0x34')],qs[_0x0996('0x47')](_0x53cf81[_0x0996('0x35')][_0x0996('0x47')]));_0x36936a[_0x0996('0x46')]=_0x36936a[_0x0996('0x46')][_0x0996('0x39')]?_0x36936a['attributes']:_0x271fa7[_0x0996('0x34')];_0x36936a[_0x0996('0x54')]=qs[_0x0996('0x3c')](_0x53cf81[_0x0996('0x35')][_0x0996('0x3c')]);_0x36936a['where']=qs[_0x0996('0x37')](_[_0x0996('0x55')](_0x53cf81[_0x0996('0x35')],_0x271fa7['filters']));if(_0x53cf81['query'][_0x0996('0x3e')]){_0x36936a[_0x0996('0x3d')]=_[_0x0996('0x40')](_0x36936a[_0x0996('0x3d')],{'$or':_[_0x0996('0x30')](_0x36936a['attributes'],function(_0x3f2dc5){var _0x4de8ba={};_0x4de8ba[_0x3f2dc5]={'$like':'%'+_0x53cf81[_0x0996('0x35')][_0x0996('0x3e')]+'%'};return _0x4de8ba;})});}_0x36936a=_[_0x0996('0x40')]({},_0x36936a,_0x53cf81[_0x0996('0x49')]);return _0x34a148['getAgents'](_0x36936a);}})[_0x0996('0x26')](function(_0x1dbf1b){if(_0x1dbf1b){_0x589bc6=_0x1dbf1b['length'];if(!_0x53cf81[_0x0996('0x35')]['hasOwnProperty'](_0x0996('0x3b'))){_0x36936a['limit']=qs[_0x0996('0x1f')](_0x53cf81['query'][_0x0996('0x1f')]);_0x36936a['offset']=qs['offset'](_0x53cf81[_0x0996('0x35')]['offset']);}return _0x34a148[_0x0996('0x87')](_0x36936a);}})[_0x0996('0x26')](function(_0x7ffe38){if(_0x7ffe38){return _0x7ffe38?{'count':_0x589bc6,'rows':_0x7ffe38}:null;}})['then'](respondWithResult(_0x2e5216,null))[_0x0996('0x4a')](handleError(_0x2e5216,null));};
\ No newline at end of file
index 0664d32..926ef89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cc6=['exports','events','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x9cc6,0x160));var _0x69cc=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x9cc6[_0x29aefc];return _0x11be36;};'use strict';var EventEmitter=require(_0x69cc('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x69cc('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x69cc('0x2')](0x0);var events={'afterCreate':_0x69cc('0x3'),'afterUpdate':'update','afterDestroy':_0x69cc('0x4')};function emitEvent(_0x51a308){return function(_0x108767,_0x4898f5,_0x26b9a5){SmsQueueEvents[_0x69cc('0x5')](_0x51a308+':'+_0x108767['id'],_0x108767);SmsQueueEvents[_0x69cc('0x5')](_0x51a308,_0x108767);_0x26b9a5(null);};}for(var e in events){if(events[_0x69cc('0x6')](e)){var event=events[e];SmsQueue[_0x69cc('0x7')](e,emitEvent(event));}}module[_0x69cc('0x8')]=SmsQueueEvents;
\ No newline at end of file
+var _0xa1d4=['SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4d874e,_0x14c2a8){var _0xf37cf0=function(_0x17d930){while(--_0x17d930){_0x4d874e['push'](_0x4d874e['shift']());}};_0xf37cf0(++_0x14c2a8);}(_0xa1d4,0x73));var _0x4a1d=function(_0x5a0619,_0x398e66){_0x5a0619=_0x5a0619-0x0;var _0x4b6580=_0xa1d4[_0x5a0619];return _0x4b6580;};'use strict';var EventEmitter=require(_0x4a1d('0x0'));var SmsQueue=require(_0x4a1d('0x1'))['db'][_0x4a1d('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4a1d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a1d('0x4'),'afterDestroy':_0x4a1d('0x5')};function emitEvent(_0x450363){return function(_0x5e5575,_0x9fac81,_0x4a4491){SmsQueueEvents[_0x4a1d('0x6')](_0x450363+':'+_0x5e5575['id'],_0x5e5575);SmsQueueEvents[_0x4a1d('0x6')](_0x450363,_0x5e5575);_0x4a4491(null);};}for(var e in events){if(events[_0x4a1d('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x4a1d('0x8')]=SmsQueueEvents;
\ No newline at end of file
index a8bbc12..0a74336 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6bc=['./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2690da,_0x16c7c2){var _0x5251ca=function(_0x1800ab){while(--_0x1800ab){_0x2690da['push'](_0x2690da['shift']());}};_0x5251ca(++_0x16c7c2);}(_0xf6bc,0x1b1));var _0xcf6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf6b('0x0'));var util=require(_0xcf6b('0x1'));var logger=require(_0xcf6b('0x2'))(_0xcf6b('0x3'));var moment=require(_0xcf6b('0x4'));var BPromise=require('bluebird');var rp=require(_0xcf6b('0x5'));var fs=require('fs');var path=require(_0xcf6b('0x6'));var rimraf=require(_0xcf6b('0x7'));var config=require(_0xcf6b('0x8'));var attributes=require(_0xcf6b('0x9'));module[_0xcf6b('0xa')]=function(_0x45c2e8,_0x34c19f){return _0x45c2e8['define'](_0xcf6b('0xb'),attributes,{'tableName':_0xcf6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1895=['../../config/logger','moment','bluebird','path','rimraf','./smsQueue.attributes','exports','lodash'];(function(_0x2e48bf,_0x4bde87){var _0x2b6b2d=function(_0x183d59){while(--_0x183d59){_0x2e48bf['push'](_0x2e48bf['shift']());}};_0x2b6b2d(++_0x4bde87);}(_0x1895,0xef));var _0x5189=function(_0x349a6e,_0xbaeaf0){_0x349a6e=_0x349a6e-0x0;var _0x1ff380=_0x1895[_0x349a6e];return _0x1ff380;};'use strict';var _=require(_0x5189('0x0'));var util=require('util');var logger=require(_0x5189('0x1'))('api');var moment=require(_0x5189('0x2'));var BPromise=require(_0x5189('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5189('0x4'));var rimraf=require(_0x5189('0x5'));var config=require('../../config/environment');var attributes=require(_0x5189('0x6'));module[_0x5189('0x7')]=function(_0x16b8cd,_0x20e528){return _0x16b8cd['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 22ff944..de7bb03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43ec=['include','GetSmsQueue','stringify','ShowSmsQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','SmsQueue','findAll','options','raw','where','attributes','map','model'];(function(_0x2f9464,_0x468524){var _0x31bab7=function(_0xf430e7){while(--_0xf430e7){_0x2f9464['push'](_0x2f9464['shift']());}};_0x31bab7(++_0x468524);}(_0x43ec,0x1d9));var _0xc43e=function(_0x319fcc,_0x45a33a){_0x319fcc=_0x319fcc-0x0;var _0x57f2f5=_0x43ec[_0x319fcc];return _0x57f2f5;};'use strict';var _=require('lodash');var util=require(_0xc43e('0x0'));var moment=require(_0xc43e('0x1'));var BPromise=require(_0xc43e('0x2'));var rs=require(_0xc43e('0x3'));var fs=require('fs');var Redis=require(_0xc43e('0x4'));var db=require(_0xc43e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc43e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc43e('0x7'));var client=jayson[_0xc43e('0x8')][_0xc43e('0x9')]({'port':0x232a});config[_0xc43e('0xa')]=_[_0xc43e('0xb')](config[_0xc43e('0xa')],{'host':_0xc43e('0xc'),'port':0x18eb});var socket=require(_0xc43e('0xd'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xc43e('0xe')](socket);function respondWithRpcPromise(_0x304df8,_0x1c03c3,_0x36b203){return new BPromise(function(_0x1bc74b,_0x30d9ba){return client[_0xc43e('0xf')](_0x304df8,_0x36b203)[_0xc43e('0x10')](function(_0x286f35){logger['info'](_0xc43e('0x11'),_0x1c03c3,_0xc43e('0x12'));logger[_0xc43e('0x13')](_0xc43e('0x14'),_0x1c03c3,_0xc43e('0x12'),JSON['stringify'](_0x286f35));if(_0x286f35[_0xc43e('0x15')]){if(_0x286f35[_0xc43e('0x15')]['code']===0x1f4){logger[_0xc43e('0x15')]('SmsQueue,\x20%s,\x20%s',_0x1c03c3,_0x286f35[_0xc43e('0x15')][_0xc43e('0x16')]);return _0x30d9ba(_0x286f35[_0xc43e('0x15')][_0xc43e('0x16')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x1c03c3,_0x286f35[_0xc43e('0x15')][_0xc43e('0x16')]);return _0x1bc74b(_0x286f35['error'][_0xc43e('0x16')]);}else{logger[_0xc43e('0x17')](_0xc43e('0x11'),_0x1c03c3,_0xc43e('0x12'));_0x1bc74b(_0x286f35[_0xc43e('0x18')]['message']);}})[_0xc43e('0x19')](function(_0x1dbf8a){logger['error'](_0xc43e('0x11'),_0x1c03c3,_0x1dbf8a);_0x30d9ba(_0x1dbf8a);});});}exports['GetSmsQueue']=function(_0x5af279){var _0x5e6e0b=this;return new Promise(function(_0x352149,_0x5d8e2e){return db[_0xc43e('0x1a')][_0xc43e('0x1b')]({'raw':_0x5af279[_0xc43e('0x1c')]?_0x5af279[_0xc43e('0x1c')][_0xc43e('0x1d')]===undefined?!![]:![]:!![],'where':_0x5af279[_0xc43e('0x1c')]?_0x5af279[_0xc43e('0x1c')][_0xc43e('0x1e')]||null:null,'attributes':_0x5af279[_0xc43e('0x1c')]?_0x5af279['options'][_0xc43e('0x1f')]||null:null,'limit':_0x5af279['options']?_0x5af279[_0xc43e('0x1c')]['limit']||null:null,'include':_0x5af279[_0xc43e('0x1c')]?_0x5af279[_0xc43e('0x1c')]['include']?_[_0xc43e('0x20')](_0x5af279[_0xc43e('0x1c')]['include'],function(_0x177b21){return{'model':db[_0x177b21[_0xc43e('0x21')]],'as':_0x177b21['as'],'attributes':_0x177b21[_0xc43e('0x1f')],'include':_0x177b21['include']?_['map'](_0x177b21[_0xc43e('0x22')],function(_0x4ca2db){return{'model':db[_0x4ca2db[_0xc43e('0x21')]],'as':_0x4ca2db['as'],'attributes':_0x4ca2db['attributes'],'include':_0x4ca2db[_0xc43e('0x22')]?_[_0xc43e('0x20')](_0x4ca2db[_0xc43e('0x22')],function(_0xe91b91){return{'model':db[_0xe91b91[_0xc43e('0x21')]],'as':_0xe91b91['as'],'attributes':_0xe91b91['attributes']};}):[]};}):[]};}):[]:[]})[_0xc43e('0x10')](function(_0x30e34e){logger[_0xc43e('0x17')]('GetSmsQueue',_0x5af279);logger['debug'](_0xc43e('0x23'),_0x5af279,JSON[_0xc43e('0x24')](_0x30e34e));_0x352149(_0x30e34e);})[_0xc43e('0x19')](function(_0x43c57e){logger['error'](_0xc43e('0x23'),_0x43c57e[_0xc43e('0x16')],_0x5af279);_0x5d8e2e(_0x5e6e0b['error'](0x1f4,_0x43c57e[_0xc43e('0x16')]));});});};exports[_0xc43e('0x25')]=function(_0x37f48f){var _0x5e8dbc=this;return new Promise(function(_0x2a001b,_0x396861){return db['SmsQueue'][_0xc43e('0x26')]({'raw':_0x37f48f[_0xc43e('0x1c')]?_0x37f48f[_0xc43e('0x1c')][_0xc43e('0x1d')]===undefined?!![]:![]:!![],'where':_0x37f48f[_0xc43e('0x1c')]?_0x37f48f[_0xc43e('0x1c')]['where']||null:null,'attributes':_0x37f48f[_0xc43e('0x1c')]?_0x37f48f[_0xc43e('0x1c')][_0xc43e('0x1f')]||null:null,'include':_0x37f48f[_0xc43e('0x1c')]?_0x37f48f[_0xc43e('0x1c')][_0xc43e('0x22')]?_['map'](_0x37f48f[_0xc43e('0x1c')][_0xc43e('0x22')],function(_0x2d379a){return{'model':db[_0x2d379a[_0xc43e('0x21')]],'as':_0x2d379a['as'],'attributes':_0x2d379a[_0xc43e('0x1f')],'include':_0x2d379a[_0xc43e('0x22')]?_[_0xc43e('0x20')](_0x2d379a['include'],function(_0x190fc9){return{'model':db[_0x190fc9[_0xc43e('0x21')]],'as':_0x190fc9['as'],'attributes':_0x190fc9[_0xc43e('0x1f')],'include':_0x190fc9[_0xc43e('0x22')]?_[_0xc43e('0x20')](_0x190fc9[_0xc43e('0x22')],function(_0x443b7c){return{'model':db[_0x443b7c['model']],'as':_0x443b7c['as'],'attributes':_0x443b7c[_0xc43e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc43e('0x10')](function(_0x345d71){logger[_0xc43e('0x17')](_0xc43e('0x25'),_0x37f48f);logger['debug']('ShowSmsQueue',_0x37f48f,JSON[_0xc43e('0x24')](_0x345d71));_0x2a001b(_0x345d71);})['catch'](function(_0x38e553){logger[_0xc43e('0x15')](_0xc43e('0x25'),_0x38e553['message'],_0x37f48f);_0x396861(_0x5e8dbc[_0xc43e('0x15')](0x1f4,_0x38e553[_0xc43e('0x16')]));});});};
\ No newline at end of file
+var _0xe859=['where','limit','include','map','attributes','model','catch','ShowSmsQueue','find','then','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','raw'];(function(_0x48da9c,_0x242c4a){var _0x593a2f=function(_0x477c72){while(--_0x477c72){_0x48da9c['push'](_0x48da9c['shift']());}};_0x593a2f(++_0x242c4a);}(_0xe859,0x169));var _0x9e85=function(_0x430313,_0x3e00ff){_0x430313=_0x430313-0x0;var _0x5e50d9=_0xe859[_0x430313];return _0x5e50d9;};'use strict';var _=require(_0x9e85('0x0'));var util=require('util');var moment=require(_0x9e85('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9e85('0x2'));var logger=require(_0x9e85('0x3'))(_0x9e85('0x4'));var config=require(_0x9e85('0x5'));var jayson=require(_0x9e85('0x6'));var client=jayson[_0x9e85('0x7')][_0x9e85('0x8')]({'port':0x232a});config[_0x9e85('0x9')]=_[_0x9e85('0xa')](config[_0x9e85('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9e85('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x9e85('0xc')](socket);function respondWithRpcPromise(_0x4f5bc5,_0x36374b,_0x3e5a4b){return new BPromise(function(_0x3bd453,_0x213354){return client[_0x9e85('0xd')](_0x4f5bc5,_0x3e5a4b)['then'](function(_0x5417ef){logger['info'](_0x9e85('0xe'),_0x36374b,_0x9e85('0xf'));logger[_0x9e85('0x10')](_0x9e85('0x11'),_0x36374b,_0x9e85('0xf'),JSON[_0x9e85('0x12')](_0x5417ef));if(_0x5417ef[_0x9e85('0x13')]){if(_0x5417ef[_0x9e85('0x13')][_0x9e85('0x14')]===0x1f4){logger[_0x9e85('0x13')](_0x9e85('0xe'),_0x36374b,_0x5417ef['error'][_0x9e85('0x15')]);return _0x213354(_0x5417ef[_0x9e85('0x13')][_0x9e85('0x15')]);}logger['error'](_0x9e85('0xe'),_0x36374b,_0x5417ef[_0x9e85('0x13')][_0x9e85('0x15')]);return _0x3bd453(_0x5417ef[_0x9e85('0x13')][_0x9e85('0x15')]);}else{logger[_0x9e85('0x16')](_0x9e85('0xe'),_0x36374b,'request\x20sent');_0x3bd453(_0x5417ef[_0x9e85('0x17')][_0x9e85('0x15')]);}})['catch'](function(_0x47c063){logger['error']('SmsQueue,\x20%s,\x20%s',_0x36374b,_0x47c063);_0x213354(_0x47c063);});});}exports[_0x9e85('0x18')]=function(_0x24be12){var _0x153238=this;return new Promise(function(_0x2fdc50,_0x42b464){return db[_0x9e85('0x19')][_0x9e85('0x1a')]({'raw':_0x24be12['options']?_0x24be12[_0x9e85('0x1b')][_0x9e85('0x1c')]===undefined?!![]:![]:!![],'where':_0x24be12[_0x9e85('0x1b')]?_0x24be12[_0x9e85('0x1b')][_0x9e85('0x1d')]||null:null,'attributes':_0x24be12[_0x9e85('0x1b')]?_0x24be12['options']['attributes']||null:null,'limit':_0x24be12['options']?_0x24be12[_0x9e85('0x1b')][_0x9e85('0x1e')]||null:null,'include':_0x24be12[_0x9e85('0x1b')]?_0x24be12['options'][_0x9e85('0x1f')]?_[_0x9e85('0x20')](_0x24be12['options'][_0x9e85('0x1f')],function(_0x5c16af){return{'model':db[_0x5c16af['model']],'as':_0x5c16af['as'],'attributes':_0x5c16af[_0x9e85('0x21')],'include':_0x5c16af[_0x9e85('0x1f')]?_[_0x9e85('0x20')](_0x5c16af[_0x9e85('0x1f')],function(_0x4d6af2){return{'model':db[_0x4d6af2[_0x9e85('0x22')]],'as':_0x4d6af2['as'],'attributes':_0x4d6af2['attributes'],'include':_0x4d6af2[_0x9e85('0x1f')]?_['map'](_0x4d6af2[_0x9e85('0x1f')],function(_0x237eac){return{'model':db[_0x237eac['model']],'as':_0x237eac['as'],'attributes':_0x237eac[_0x9e85('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ae6dd){logger[_0x9e85('0x16')](_0x9e85('0x18'),_0x24be12);logger[_0x9e85('0x10')](_0x9e85('0x18'),_0x24be12,JSON['stringify'](_0x1ae6dd));_0x2fdc50(_0x1ae6dd);})[_0x9e85('0x23')](function(_0xe89e48){logger[_0x9e85('0x13')](_0x9e85('0x18'),_0xe89e48[_0x9e85('0x15')],_0x24be12);_0x42b464(_0x153238['error'](0x1f4,_0xe89e48[_0x9e85('0x15')]));});});};exports[_0x9e85('0x24')]=function(_0x1d0e0b){var _0x55bc07=this;return new Promise(function(_0xf35818,_0x5bccc1){return db[_0x9e85('0x19')][_0x9e85('0x25')]({'raw':_0x1d0e0b['options']?_0x1d0e0b[_0x9e85('0x1b')][_0x9e85('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d0e0b[_0x9e85('0x1b')]?_0x1d0e0b[_0x9e85('0x1b')][_0x9e85('0x1d')]||null:null,'attributes':_0x1d0e0b[_0x9e85('0x1b')]?_0x1d0e0b[_0x9e85('0x1b')]['attributes']||null:null,'include':_0x1d0e0b['options']?_0x1d0e0b['options'][_0x9e85('0x1f')]?_[_0x9e85('0x20')](_0x1d0e0b[_0x9e85('0x1b')][_0x9e85('0x1f')],function(_0x288648){return{'model':db[_0x288648[_0x9e85('0x22')]],'as':_0x288648['as'],'attributes':_0x288648[_0x9e85('0x21')],'include':_0x288648[_0x9e85('0x1f')]?_[_0x9e85('0x20')](_0x288648[_0x9e85('0x1f')],function(_0x13f824){return{'model':db[_0x13f824[_0x9e85('0x22')]],'as':_0x13f824['as'],'attributes':_0x13f824[_0x9e85('0x21')],'include':_0x13f824[_0x9e85('0x1f')]?_[_0x9e85('0x20')](_0x13f824[_0x9e85('0x1f')],function(_0x2a9412){return{'model':db[_0x2a9412[_0x9e85('0x22')]],'as':_0x2a9412['as'],'attributes':_0x2a9412['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e85('0x26')](function(_0x141c9a){logger['info']('ShowSmsQueue',_0x1d0e0b);logger[_0x9e85('0x10')]('ShowSmsQueue',_0x1d0e0b,JSON[_0x9e85('0x12')](_0x141c9a));_0xf35818(_0x141c9a);})['catch'](function(_0x28d84b){logger[_0x9e85('0x13')](_0x9e85('0x24'),_0x28d84b[_0x9e85('0x15')],_0x1d0e0b);_0x5bccc1(_0x55bc07[_0x9e85('0x13')](0x1f4,_0x28d84b[_0x9e85('0x15')]));});});};
\ No newline at end of file
index c85538e..9f4c52f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a0d=['length','smsQueue:','./smsQueue.events','save','remove','update','register'];(function(_0x3ffbab,_0x2ee1b4){var _0x42b220=function(_0x11fece){while(--_0x11fece){_0x3ffbab['push'](_0x3ffbab['shift']());}};_0x42b220(++_0x2ee1b4);}(_0x7a0d,0xd4));var _0xd7a0=function(_0x302f55,_0x31872f){_0x302f55=_0x302f55-0x0;var _0x55ca94=_0x7a0d[_0x302f55];return _0x55ca94;};'use strict';var SmsQueueEvents=require(_0xd7a0('0x0'));var events=[_0xd7a0('0x1'),_0xd7a0('0x2'),_0xd7a0('0x3')];function createListener(_0x10603c,_0xd6ab8){return function(_0x3ae832){_0xd6ab8['emit'](_0x10603c,_0x3ae832);};}function removeListener(_0x5cff80,_0x4f3738){return function(){SmsQueueEvents['removeListener'](_0x5cff80,_0x4f3738);};}exports[_0xd7a0('0x4')]=function(_0x370bfb){for(var _0x33bc5c=0x0,_0x1dd242=events[_0xd7a0('0x5')];_0x33bc5c<_0x1dd242;_0x33bc5c++){var _0x496669=events[_0x33bc5c];var _0x5a8c83=createListener(_0xd7a0('0x6')+_0x496669,_0x370bfb);SmsQueueEvents['on'](_0x496669,_0x5a8c83);}};
\ No newline at end of file
+var _0x14c7=['update','emit','removeListener','length','save'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x14c7,0x1a8));var _0x714c=function(_0x16db20,_0x16699f){_0x16db20=_0x16db20-0x0;var _0x124549=_0x14c7[_0x16db20];return _0x124549;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x714c('0x0'),'remove',_0x714c('0x1')];function createListener(_0x2a6b60,_0x1eed55){return function(_0xe17e37){_0x1eed55[_0x714c('0x2')](_0x2a6b60,_0xe17e37);};}function removeListener(_0x1e814f,_0x1e1e9d){return function(){SmsQueueEvents[_0x714c('0x3')](_0x1e814f,_0x1e1e9d);};}exports['register']=function(_0x2c72ee){for(var _0x4587d5=0x0,_0x3def35=events[_0x714c('0x4')];_0x4587d5<_0x3def35;_0x4587d5++){var _0x4272b3=events[_0x4587d5];var _0x4d097c=createListener('smsQueue:'+_0x4272b3,_0x2c72ee);SmsQueueEvents['on'](_0x4272b3,_0x4d097c);}};
\ No newline at end of file
index 8237637..8af92bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdded=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete','destroy','exports'];(function(_0x2562d4,_0x15fd51){var _0x51b7ed=function(_0x4eef4b){while(--_0x4eef4b){_0x2562d4['push'](_0x2562d4['shift']());}};_0x51b7ed(++_0x15fd51);}(_0xdded,0x17a));var _0xddde=function(_0x140d47,_0x445fe0){_0x140d47=_0x140d47-0x0;var _0x4b5afe=_0xdded[_0x140d47];return _0x4b5afe;};'use strict';var multer=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var path=require(_0xddde('0x2'));var timeout=require(_0xddde('0x3'));var express=require(_0xddde('0x4'));var router=express[_0xddde('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xddde('0x6'));var interaction=require(_0xddde('0x7'));var config=require(_0xddde('0x8'));var controller=require(_0xddde('0x9'));router[_0xddde('0xa')]('/',auth[_0xddde('0xb')](),controller[_0xddde('0xc')]);router[_0xddde('0xa')](_0xddde('0xd'),auth[_0xddde('0xb')](),controller[_0xddde('0xe')]);router['get'](_0xddde('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xddde('0xb')](),controller['create']);router[_0xddde('0x10')]('/:id',auth[_0xddde('0xb')](),controller[_0xddde('0x11')]);router[_0xddde('0x12')](_0xddde('0xf'),auth[_0xddde('0xb')](),controller[_0xddde('0x13')]);module[_0xddde('0x14')]=router;
\ No newline at end of file
+var _0xbdba=['./smsQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x589c00,_0x5e8820){var _0x4efc18=function(_0x13a785){while(--_0x13a785){_0x589c00['push'](_0x589c00['shift']());}};_0x4efc18(++_0x5e8820);}(_0xbdba,0x107));var _0xabdb=function(_0x245e9c,_0x3846b6){_0x245e9c=_0x245e9c-0x0;var _0x423cb0=_0xbdba[_0x245e9c];return _0x423cb0;};'use strict';var multer=require(_0xabdb('0x0'));var util=require('util');var path=require(_0xabdb('0x1'));var timeout=require(_0xabdb('0x2'));var express=require(_0xabdb('0x3'));var router=express[_0xabdb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xabdb('0x5'));var interaction=require(_0xabdb('0x6'));var config=require('../../config/environment');var controller=require(_0xabdb('0x7'));router[_0xabdb('0x8')]('/',auth[_0xabdb('0x9')](),controller['index']);router[_0xabdb('0x8')](_0xabdb('0xa'),auth[_0xabdb('0x9')](),controller['describe']);router[_0xabdb('0x8')](_0xabdb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xabdb('0xc')]('/',auth['isAuthenticated'](),controller[_0xabdb('0xd')]);router[_0xabdb('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xabdb('0xf')](_0xabdb('0xb'),auth[_0xabdb('0x9')](),controller[_0xabdb('0x10')]);module[_0xabdb('0x11')]=router;
\ No newline at end of file
index 908c706..e966f4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbebf=['DATE','moment','exports','STRING'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbebf,0xf9));var _0xfbeb=function(_0x2bbd0f,_0x26dbe2){_0x2bbd0f=_0x2bbd0f-0x0;var _0x257768=_0xbebf[_0x2bbd0f];return _0x257768;};'use strict';var moment=require(_0xfbeb('0x0'));var Sequelize=require('sequelize');module[_0xfbeb('0x1')]={'uniqueid':{'type':Sequelize[_0xfbeb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfbeb('0x2')]},'joinAt':{'type':Sequelize[_0xfbeb('0x3')]},'leaveAt':{'type':Sequelize[_0xfbeb('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfbeb('0x3')]},'reason':{'type':Sequelize[_0xfbeb('0x2')]}};
\ No newline at end of file
+var _0xc110=['STRING','DATE','moment','sequelize','exports'];(function(_0x15c6e6,_0x6f55ee){var _0x341f8c=function(_0xef2e5){while(--_0xef2e5){_0x15c6e6['push'](_0x15c6e6['shift']());}};_0x341f8c(++_0x6f55ee);}(_0xc110,0xf7));var _0x0c11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc110[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x0c11('0x0'));var Sequelize=require(_0x0c11('0x1'));module[_0x0c11('0x2')]={'uniqueid':{'type':Sequelize[_0x0c11('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0c11('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0c11('0x4')]},'acceptAt':{'type':Sequelize[_0x0c11('0x4')]},'exitAt':{'type':Sequelize[_0x0c11('0x4')]},'reason':{'type':Sequelize[_0x0c11('0x3')]}};
\ No newline at end of file
index 89b332c..1da87d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x605f=['ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','name','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0xf458ea,_0x5767e5){var _0x20f763=function(_0x223f6d){while(--_0x223f6d){_0xf458ea['push'](_0xf458ea['shift']());}};_0x20f763(++_0x5767e5);}(_0x605f,0x11b));var _0xf605=function(_0x45ae42,_0x45aefc){_0x45ae42=_0x45ae42-0x0;var _0x1f6f4b=_0x605f[_0x45ae42];return _0x1f6f4b;};'use strict';var emlformat=require(_0xf605('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf605('0x1'));var jsonpatch=require(_0xf605('0x2'));var rp=require(_0xf605('0x3'));var moment=require(_0xf605('0x4'));var BPromise=require(_0xf605('0x5'));var Mustache=require('mustache');var util=require(_0xf605('0x6'));var path=require(_0xf605('0x7'));var sox=require(_0xf605('0x8'));var csv=require(_0xf605('0x9'));var ejs=require(_0xf605('0xa'));var fs=require('fs');var fs_extra=require(_0xf605('0xb'));var _=require(_0xf605('0xc'));var squel=require(_0xf605('0xd'));var crypto=require(_0xf605('0xe'));var jsforce=require(_0xf605('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf605('0x9'));var querystring=require(_0xf605('0x10'));var Papa=require('papaparse');var Redis=require(_0xf605('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf605('0x12'));var logger=require(_0xf605('0x13'))(_0xf605('0x14'));var utils=require(_0xf605('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf605('0x16'));var db=require(_0xf605('0x17'))['db'];function respondWithStatusCode(_0x5d984a,_0x1c1347){_0x1c1347=_0x1c1347||0xcc;return function(_0x31f4eb){if(_0x31f4eb){return _0x5d984a[_0xf605('0x18')](_0x1c1347);}return _0x5d984a[_0xf605('0x19')](_0x1c1347)[_0xf605('0x1a')]();};}function respondWithResult(_0x4a7557,_0x1fcfb6){_0x1fcfb6=_0x1fcfb6||0xc8;return function(_0x3d29c4){if(_0x3d29c4){return _0x4a7557[_0xf605('0x19')](_0x1fcfb6)['json'](_0x3d29c4);}};}function respondWithFilteredResult(_0x53ac45,_0x30012d){return function(_0x2f0593){if(_0x2f0593){var _0xc14cc0=typeof _0x30012d[_0xf605('0x1b')]===_0xf605('0x1c')&&typeof _0x30012d[_0xf605('0x1d')]===_0xf605('0x1c');var _0x10c741=_0x2f0593[_0xf605('0x1e')];var _0x874003=_0xc14cc0?0x0:_0x30012d[_0xf605('0x1b')];var _0x4a6962=_0xc14cc0?_0x2f0593[_0xf605('0x1e')]:_0x30012d[_0xf605('0x1b')]+_0x30012d[_0xf605('0x1d')];var _0x1db750;if(_0x4a6962>=_0x10c741){_0x4a6962=_0x10c741;_0x1db750=0xc8;}else{_0x1db750=0xce;}_0x53ac45[_0xf605('0x19')](_0x1db750);return _0x53ac45[_0xf605('0x1f')](_0xf605('0x20'),_0x874003+'-'+_0x4a6962+'/'+_0x10c741)[_0xf605('0x21')](_0x2f0593);}return null;};}function patchUpdates(_0x38068c){return function(_0x3d9b91){try{jsonpatch['apply'](_0x3d9b91,_0x38068c,!![]);}catch(_0x15cc89){return BPromise[_0xf605('0x22')](_0x15cc89);}return _0x3d9b91[_0xf605('0x23')]();};}function saveUpdates(_0x3e975d,_0x55fc6a){return function(_0x1dab5a){if(_0x1dab5a){return _0x1dab5a[_0xf605('0x24')](_0x3e975d)['then'](function(_0x123cd0){return _0x123cd0;});}return null;};}function removeEntity(_0x46620e,_0x338a87){return function(_0xcfcb68){if(_0xcfcb68){return _0xcfcb68[_0xf605('0x25')]()[_0xf605('0x26')](function(){_0x46620e[_0xf605('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386638,_0x51903d){return function(_0x64f524){if(!_0x64f524){_0x386638[_0xf605('0x18')](0x194);}return _0x64f524;};}function handleError(_0x23b94d,_0x27064d){_0x27064d=_0x27064d||0x1f4;return function(_0xd35868){logger[_0xf605('0x27')](_0xd35868[_0xf605('0x28')]);if(_0xd35868['name']){delete _0xd35868['name'];}_0x23b94d[_0xf605('0x19')](_0x27064d)[_0xf605('0x29')](_0xd35868);};}exports[_0xf605('0x2a')]=function(_0x1bd4ed,_0x277da0){var _0x413032={},_0x5985bd={},_0xfd1fa1={'count':0x0,'rows':[]};var _0x56d5a2=_[_0xf605('0x2b')](db[_0xf605('0x2c')][_0xf605('0x2d')],function(_0x44352c){return{'name':_0x44352c[_0xf605('0x2e')],'type':_0x44352c[_0xf605('0x2f')]['key']};});_0x5985bd[_0xf605('0x30')]=_[_0xf605('0x2b')](_0x56d5a2,'name');_0x5985bd['query']=_[_0xf605('0x31')](_0x1bd4ed[_0xf605('0x32')]);_0x5985bd[_0xf605('0x33')]=_[_0xf605('0x34')](_0x5985bd[_0xf605('0x30')],_0x5985bd['query']);_0x413032[_0xf605('0x35')]=_[_0xf605('0x34')](_0x5985bd['model'],qs[_0xf605('0x36')](_0x1bd4ed['query'][_0xf605('0x36')]));_0x413032['attributes']=_0x413032['attributes']['length']?_0x413032[_0xf605('0x35')]:_0x5985bd[_0xf605('0x30')];if(!_0x1bd4ed[_0xf605('0x32')]['hasOwnProperty'](_0xf605('0x37'))){_0x413032[_0xf605('0x1d')]=qs[_0xf605('0x1d')](_0x1bd4ed[_0xf605('0x32')][_0xf605('0x1d')]);_0x413032[_0xf605('0x1b')]=qs[_0xf605('0x1b')](_0x1bd4ed[_0xf605('0x32')][_0xf605('0x1b')]);}_0x413032[_0xf605('0x38')]=qs['sort'](_0x1bd4ed['query'][_0xf605('0x39')]);_0x413032[_0xf605('0x3a')]=qs[_0xf605('0x33')](_[_0xf605('0x3b')](_0x1bd4ed[_0xf605('0x32')],_0x5985bd[_0xf605('0x33')]),_0x56d5a2);if(_0x1bd4ed[_0xf605('0x32')]['filter']){_0x413032[_0xf605('0x3a')]=_[_0xf605('0x3c')](_0x413032[_0xf605('0x3a')],{'$or':_['map'](_0x56d5a2,function(_0x31e84f){if(_0x31e84f[_0xf605('0x2f')]!=='VIRTUAL'){var _0x23e924={};_0x23e924[_0x31e84f[_0xf605('0x3d')]]={'$like':'%'+_0x1bd4ed['query'][_0xf605('0x3e')]+'%'};return _0x23e924;}})});}_0x413032=_[_0xf605('0x3c')]({},_0x413032,_0x1bd4ed[_0xf605('0x3f')]);var _0x566b19={'where':_0x413032[_0xf605('0x3a')]};return db[_0xf605('0x2c')][_0xf605('0x1e')](_0x566b19)[_0xf605('0x26')](function(_0x148162){_0xfd1fa1[_0xf605('0x1e')]=_0x148162;if(_0x1bd4ed[_0xf605('0x32')][_0xf605('0x40')]){_0x413032['include']=[{'all':!![]}];}return db[_0xf605('0x2c')][_0xf605('0x41')](_0x413032);})['then'](function(_0x2bf604){_0xfd1fa1[_0xf605('0x42')]=_0x2bf604;return _0xfd1fa1;})[_0xf605('0x26')](respondWithFilteredResult(_0x277da0,_0x413032))[_0xf605('0x43')](handleError(_0x277da0,null));};exports[_0xf605('0x44')]=function(_0x396074,_0x211786){var _0x2f3a8b={'raw':!![],'where':{'id':_0x396074[_0xf605('0x45')]['id']}},_0x31947a={};_0x31947a[_0xf605('0x30')]=_[_0xf605('0x31')](db[_0xf605('0x2c')][_0xf605('0x2d')]);_0x31947a[_0xf605('0x32')]=_[_0xf605('0x31')](_0x396074[_0xf605('0x32')]);_0x31947a[_0xf605('0x33')]=_[_0xf605('0x34')](_0x31947a['model'],_0x31947a[_0xf605('0x32')]);_0x2f3a8b[_0xf605('0x35')]=_[_0xf605('0x34')](_0x31947a[_0xf605('0x30')],qs[_0xf605('0x36')](_0x396074['query']['fields']));_0x2f3a8b[_0xf605('0x35')]=_0x2f3a8b[_0xf605('0x35')]['length']?_0x2f3a8b[_0xf605('0x35')]:_0x31947a['model'];if(_0x396074[_0xf605('0x32')][_0xf605('0x40')]){_0x2f3a8b[_0xf605('0x46')]=[{'all':!![]}];}_0x2f3a8b=_[_0xf605('0x3c')]({},_0x2f3a8b,_0x396074[_0xf605('0x3f')]);return db[_0xf605('0x2c')][_0xf605('0x47')](_0x2f3a8b)[_0xf605('0x26')](handleEntityNotFound(_0x211786,null))[_0xf605('0x26')](respondWithResult(_0x211786,null))[_0xf605('0x43')](handleError(_0x211786,null));};exports[_0xf605('0x48')]=function(_0x548938,_0x115ae1){return db[_0xf605('0x2c')][_0xf605('0x48')](_0x548938[_0xf605('0x49')],{})[_0xf605('0x26')](respondWithResult(_0x115ae1,0xc9))[_0xf605('0x43')](handleError(_0x115ae1,null));};exports[_0xf605('0x24')]=function(_0x3ad519,_0x4778eb){if(_0x3ad519[_0xf605('0x49')]['id']){delete _0x3ad519[_0xf605('0x49')]['id'];}return db[_0xf605('0x2c')][_0xf605('0x47')]({'where':{'id':_0x3ad519[_0xf605('0x45')]['id']}})[_0xf605('0x26')](handleEntityNotFound(_0x4778eb,null))['then'](saveUpdates(_0x3ad519[_0xf605('0x49')],null))[_0xf605('0x26')](respondWithResult(_0x4778eb,null))[_0xf605('0x43')](handleError(_0x4778eb,null));};exports['destroy']=function(_0x3c0980,_0x5903f7){return db['SmsQueueReport'][_0xf605('0x47')]({'where':{'id':_0x3c0980[_0xf605('0x45')]['id']}})[_0xf605('0x26')](handleEntityNotFound(_0x5903f7,null))['then'](removeEntity(_0x5903f7,null))[_0xf605('0x43')](handleError(_0x5903f7,null));};exports[_0xf605('0x4a')]=function(_0x2ea2ac,_0x4fa071){return db['SmsQueueReport'][_0xf605('0x4a')]()[_0xf605('0x26')](respondWithResult(_0x4fa071,null))[_0xf605('0x43')](handleError(_0x4fa071,null));};
\ No newline at end of file
+var _0x049b=['fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','params','options','find','create','body','destroy','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes'];(function(_0x336082,_0x5c364b){var _0x2ea2eb=function(_0x4c6c53){while(--_0x4c6c53){_0x336082['push'](_0x336082['shift']());}};_0x2ea2eb(++_0x5c364b);}(_0x049b,0x1d2));var _0xb049=function(_0x2be303,_0x1052ba){_0x2be303=_0x2be303-0x0;var _0xc7dd26=_0x049b[_0x2be303];return _0xc7dd26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb049('0x0'));var zipdir=require(_0xb049('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb049('0x2'));var BPromise=require(_0xb049('0x3'));var Mustache=require(_0xb049('0x4'));var util=require(_0xb049('0x5'));var path=require(_0xb049('0x6'));var sox=require('sox');var csv=require(_0xb049('0x7'));var ejs=require(_0xb049('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb049('0x9'));var squel=require(_0xb049('0xa'));var crypto=require('crypto');var jsforce=require(_0xb049('0xb'));var deskjs=require(_0xb049('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb049('0xd'));var Papa=require(_0xb049('0xe'));var Redis=require(_0xb049('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb049('0x10'));var as=require(_0xb049('0x11'));var hardwareService=require(_0xb049('0x12'));var logger=require(_0xb049('0x13'))(_0xb049('0x14'));var utils=require(_0xb049('0x15'));var config=require(_0xb049('0x16'));var licenseUtil=require(_0xb049('0x17'));var db=require(_0xb049('0x18'))['db'];function respondWithStatusCode(_0x35e289,_0x59c4e4){_0x59c4e4=_0x59c4e4||0xcc;return function(_0x46e801){if(_0x46e801){return _0x35e289[_0xb049('0x19')](_0x59c4e4);}return _0x35e289['status'](_0x59c4e4)['end']();};}function respondWithResult(_0x3cccae,_0x5aaf24){_0x5aaf24=_0x5aaf24||0xc8;return function(_0x5b4b1f){if(_0x5b4b1f){return _0x3cccae[_0xb049('0x1a')](_0x5aaf24)['json'](_0x5b4b1f);}};}function respondWithFilteredResult(_0x2e3022,_0x1bafce){return function(_0x11cd63){if(_0x11cd63){var _0xe93f3c=typeof _0x1bafce[_0xb049('0x1b')]===_0xb049('0x1c')&&typeof _0x1bafce['limit']===_0xb049('0x1c');var _0x28076c=_0x11cd63[_0xb049('0x1d')];var _0x4098f5=_0xe93f3c?0x0:_0x1bafce[_0xb049('0x1b')];var _0x42b600=_0xe93f3c?_0x11cd63[_0xb049('0x1d')]:_0x1bafce[_0xb049('0x1b')]+_0x1bafce[_0xb049('0x1e')];var _0x483b98;if(_0x42b600>=_0x28076c){_0x42b600=_0x28076c;_0x483b98=0xc8;}else{_0x483b98=0xce;}_0x2e3022[_0xb049('0x1a')](_0x483b98);return _0x2e3022['set'](_0xb049('0x1f'),_0x4098f5+'-'+_0x42b600+'/'+_0x28076c)[_0xb049('0x20')](_0x11cd63);}return null;};}function patchUpdates(_0x390f2c){return function(_0x10838b){try{jsonpatch[_0xb049('0x21')](_0x10838b,_0x390f2c,!![]);}catch(_0x674e66){return BPromise['reject'](_0x674e66);}return _0x10838b[_0xb049('0x22')]();};}function saveUpdates(_0xcbdc8c,_0x288e4f){return function(_0x3bca0a){if(_0x3bca0a){return _0x3bca0a[_0xb049('0x23')](_0xcbdc8c)[_0xb049('0x24')](function(_0x2fca40){return _0x2fca40;});}return null;};}function removeEntity(_0x4adc31,_0x3d9a04){return function(_0x333e7e){if(_0x333e7e){return _0x333e7e['destroy']()['then'](function(){_0x4adc31['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d563b,_0x458a0b){return function(_0x51502c){if(!_0x51502c){_0x1d563b[_0xb049('0x19')](0x194);}return _0x51502c;};}function handleError(_0x3e10c7,_0x4b1d83){_0x4b1d83=_0x4b1d83||0x1f4;return function(_0x35b383){logger[_0xb049('0x25')](_0x35b383[_0xb049('0x26')]);if(_0x35b383['name']){delete _0x35b383[_0xb049('0x27')];}_0x3e10c7['status'](_0x4b1d83)[_0xb049('0x28')](_0x35b383);};}exports[_0xb049('0x29')]=function(_0x4a6731,_0xb81172){var _0x29eee4={},_0x47ac6b={},_0x252ab7={'count':0x0,'rows':[]};var _0x380f31=_[_0xb049('0x2a')](db[_0xb049('0x2b')][_0xb049('0x2c')],function(_0x1512fb){return{'name':_0x1512fb[_0xb049('0x2d')],'type':_0x1512fb['type'][_0xb049('0x2e')]};});_0x47ac6b[_0xb049('0x2f')]=_[_0xb049('0x2a')](_0x380f31,_0xb049('0x27'));_0x47ac6b[_0xb049('0x30')]=_[_0xb049('0x31')](_0x4a6731[_0xb049('0x30')]);_0x47ac6b['filters']=_[_0xb049('0x32')](_0x47ac6b[_0xb049('0x2f')],_0x47ac6b['query']);_0x29eee4[_0xb049('0x33')]=_[_0xb049('0x32')](_0x47ac6b[_0xb049('0x2f')],qs[_0xb049('0x34')](_0x4a6731[_0xb049('0x30')]['fields']));_0x29eee4[_0xb049('0x33')]=_0x29eee4[_0xb049('0x33')][_0xb049('0x35')]?_0x29eee4[_0xb049('0x33')]:_0x47ac6b[_0xb049('0x2f')];if(!_0x4a6731['query'][_0xb049('0x36')]('nolimit')){_0x29eee4['limit']=qs[_0xb049('0x1e')](_0x4a6731['query'][_0xb049('0x1e')]);_0x29eee4['offset']=qs[_0xb049('0x1b')](_0x4a6731[_0xb049('0x30')][_0xb049('0x1b')]);}_0x29eee4[_0xb049('0x37')]=qs[_0xb049('0x38')](_0x4a6731[_0xb049('0x30')]['sort']);_0x29eee4[_0xb049('0x39')]=qs['filters'](_[_0xb049('0x3a')](_0x4a6731[_0xb049('0x30')],_0x47ac6b['filters']),_0x380f31);if(_0x4a6731[_0xb049('0x30')]['filter']){_0x29eee4[_0xb049('0x39')]=_[_0xb049('0x3b')](_0x29eee4['where'],{'$or':_[_0xb049('0x2a')](_0x380f31,function(_0x357e55){if(_0x357e55[_0xb049('0x3c')]!==_0xb049('0x3d')){var _0x7bbe9b={};_0x7bbe9b[_0x357e55[_0xb049('0x27')]]={'$like':'%'+_0x4a6731[_0xb049('0x30')][_0xb049('0x3e')]+'%'};return _0x7bbe9b;}})});}_0x29eee4=_[_0xb049('0x3b')]({},_0x29eee4,_0x4a6731['options']);var _0x57c468={'where':_0x29eee4['where']};return db[_0xb049('0x2b')][_0xb049('0x1d')](_0x57c468)['then'](function(_0x2bf689){_0x252ab7[_0xb049('0x1d')]=_0x2bf689;if(_0x4a6731[_0xb049('0x30')][_0xb049('0x3f')]){_0x29eee4[_0xb049('0x40')]=[{'all':!![]}];}return db[_0xb049('0x2b')][_0xb049('0x41')](_0x29eee4);})[_0xb049('0x24')](function(_0x3696ae){_0x252ab7['rows']=_0x3696ae;return _0x252ab7;})[_0xb049('0x24')](respondWithFilteredResult(_0xb81172,_0x29eee4))[_0xb049('0x42')](handleError(_0xb81172,null));};exports['show']=function(_0x435ee1,_0x15af38){var _0x555711={'raw':!![],'where':{'id':_0x435ee1[_0xb049('0x43')]['id']}},_0xb80e2d={};_0xb80e2d[_0xb049('0x2f')]=_['keys'](db['SmsQueueReport']['rawAttributes']);_0xb80e2d['query']=_[_0xb049('0x31')](_0x435ee1[_0xb049('0x30')]);_0xb80e2d['filters']=_['intersection'](_0xb80e2d[_0xb049('0x2f')],_0xb80e2d[_0xb049('0x30')]);_0x555711[_0xb049('0x33')]=_['intersection'](_0xb80e2d[_0xb049('0x2f')],qs[_0xb049('0x34')](_0x435ee1[_0xb049('0x30')][_0xb049('0x34')]));_0x555711[_0xb049('0x33')]=_0x555711['attributes'][_0xb049('0x35')]?_0x555711['attributes']:_0xb80e2d[_0xb049('0x2f')];if(_0x435ee1['query'][_0xb049('0x3f')]){_0x555711['include']=[{'all':!![]}];}_0x555711=_['merge']({},_0x555711,_0x435ee1[_0xb049('0x44')]);return db[_0xb049('0x2b')][_0xb049('0x45')](_0x555711)[_0xb049('0x24')](handleEntityNotFound(_0x15af38,null))['then'](respondWithResult(_0x15af38,null))[_0xb049('0x42')](handleError(_0x15af38,null));};exports[_0xb049('0x46')]=function(_0x4465ad,_0x2a5260){return db[_0xb049('0x2b')][_0xb049('0x46')](_0x4465ad[_0xb049('0x47')],{})[_0xb049('0x24')](respondWithResult(_0x2a5260,0xc9))[_0xb049('0x42')](handleError(_0x2a5260,null));};exports['update']=function(_0x1dd605,_0x2f11d2){if(_0x1dd605[_0xb049('0x47')]['id']){delete _0x1dd605[_0xb049('0x47')]['id'];}return db[_0xb049('0x2b')]['find']({'where':{'id':_0x1dd605[_0xb049('0x43')]['id']}})[_0xb049('0x24')](handleEntityNotFound(_0x2f11d2,null))['then'](saveUpdates(_0x1dd605['body'],null))[_0xb049('0x24')](respondWithResult(_0x2f11d2,null))[_0xb049('0x42')](handleError(_0x2f11d2,null));};exports[_0xb049('0x48')]=function(_0x5dc3b8,_0x3894a0){return db['SmsQueueReport'][_0xb049('0x45')]({'where':{'id':_0x5dc3b8['params']['id']}})[_0xb049('0x24')](handleEntityNotFound(_0x3894a0,null))[_0xb049('0x24')](removeEntity(_0x3894a0,null))[_0xb049('0x42')](handleError(_0x3894a0,null));};exports[_0xb049('0x49')]=function(_0xe964b9,_0x176c1c){return db[_0xb049('0x2b')]['describe']()[_0xb049('0x24')](respondWithResult(_0x176c1c,null))[_0xb049('0x42')](handleError(_0x176c1c,null));};
\ No newline at end of file
index 0f9c266..738e69b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x59a5c2,_0x227ac7){var _0x55df76=function(_0x510b57){while(--_0x510b57){_0x59a5c2['push'](_0x59a5c2['shift']());}};_0x55df76(++_0x227ac7);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xb7e7[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 21b8d8b..16230e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65a5=['../../config/utils','../../config/logger','rpc','http','then','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsQueueReport,\x20%s,\x20%s','message','info','result','CreateSmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','attributes','limit','stringify','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x454891,_0x1b3d9f){var _0x242be9=function(_0x3e1a24){while(--_0x3e1a24){_0x454891['push'](_0x454891['shift']());}};_0x242be9(++_0x1b3d9f);}(_0x65a5,0xc6));var _0x565a=function(_0x51ab83,_0x2721b9){_0x51ab83=_0x51ab83-0x0;var _0x14b6de=_0x65a5[_0x51ab83];return _0x14b6de;};'use strict';var _=require(_0x565a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x565a('0x1'));var rs=require(_0x565a('0x2'));var fs=require('fs');var Redis=require(_0x565a('0x3'));var db=require(_0x565a('0x4'))['db'];var utils=require(_0x565a('0x5'));var logger=require(_0x565a('0x6'))(_0x565a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x565a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40c8b4,_0x5f0b94,_0x27c425){return new BPromise(function(_0x4a0eca,_0x49cc8a){return client['request'](_0x40c8b4,_0x27c425)[_0x565a('0x9')](function(_0x23669c){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x5f0b94,'request\x20sent');logger[_0x565a('0xa')](_0x565a('0xb'),_0x5f0b94,_0x565a('0xc'),JSON['stringify'](_0x23669c));if(_0x23669c[_0x565a('0xd')]){if(_0x23669c[_0x565a('0xd')]['code']===0x1f4){logger[_0x565a('0xd')](_0x565a('0xe'),_0x5f0b94,_0x23669c['error'][_0x565a('0xf')]);return _0x49cc8a(_0x23669c['error'][_0x565a('0xf')]);}logger['error'](_0x565a('0xe'),_0x5f0b94,_0x23669c[_0x565a('0xd')][_0x565a('0xf')]);return _0x4a0eca(_0x23669c[_0x565a('0xd')]['message']);}else{logger[_0x565a('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x5f0b94,'request\x20sent');_0x4a0eca(_0x23669c[_0x565a('0x11')][_0x565a('0xf')]);}})['catch'](function(_0xe14a73){logger['error'](_0x565a('0xe'),_0x5f0b94,_0xe14a73);_0x49cc8a(_0xe14a73);});});}exports[_0x565a('0x12')]=function(_0x324d6f){var _0x431ca2=this;return new Promise(function(_0x145240,_0x454f27){return db['SmsQueueReport'][_0x565a('0x13')](_0x324d6f[_0x565a('0x14')],{'raw':_0x324d6f['options']?_0x324d6f[_0x565a('0x15')][_0x565a('0x16')]===undefined?!![]:![]:!![]})[_0x565a('0x9')](function(_0x300ab5){logger[_0x565a('0x10')](_0x565a('0x12'),_0x324d6f);logger[_0x565a('0xa')](_0x565a('0x12'),_0x324d6f,JSON['stringify'](_0x300ab5));_0x145240(_0x300ab5);})['catch'](function(_0x5e4471){logger[_0x565a('0xd')](_0x565a('0x12'),_0x5e4471[_0x565a('0xf')],_0x324d6f);_0x454f27(_0x431ca2[_0x565a('0xd')](0x1f4,_0x5e4471['message']));});});};exports[_0x565a('0x17')]=function(_0xfcc92e){var _0x2028b2=this;return new Promise(function(_0x121c4e,_0x42a201){return db[_0x565a('0x18')]['update'](_0xfcc92e[_0x565a('0x14')],{'raw':_0xfcc92e[_0x565a('0x15')]?_0xfcc92e[_0x565a('0x15')][_0x565a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfcc92e[_0x565a('0x15')]?_0xfcc92e[_0x565a('0x15')]['where']||null:null,'attributes':_0xfcc92e[_0x565a('0x15')]?_0xfcc92e[_0x565a('0x15')][_0x565a('0x19')]||null:null,'limit':_0xfcc92e['options']?_0xfcc92e[_0x565a('0x15')][_0x565a('0x1a')]||null:null})['then'](function(_0x2fe82c){logger[_0x565a('0x10')](_0x565a('0x17'),_0xfcc92e);logger[_0x565a('0xa')]('UpdateSmsQueueReport',_0xfcc92e,JSON[_0x565a('0x1b')](_0x2fe82c));_0x121c4e(_0x2fe82c);})[_0x565a('0x1c')](function(_0x54f81d){logger['error'](_0x565a('0x17'),_0x54f81d[_0x565a('0xf')],_0xfcc92e);_0x42a201(_0x2028b2[_0x565a('0xd')](0x1f4,_0x54f81d[_0x565a('0xf')]));});});};
\ No newline at end of file
+var _0x377b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','where','limit','lodash','util','moment'];(function(_0x295b2a,_0x51eb5d){var _0x148201=function(_0x45ec0e){while(--_0x45ec0e){_0x295b2a['push'](_0x295b2a['shift']());}};_0x148201(++_0x51eb5d);}(_0x377b,0x189));var _0xb377=function(_0x33f823,_0x3b5129){_0x33f823=_0x33f823-0x0;var _0x225609=_0x377b[_0x33f823];return _0x225609;};'use strict';var _=require(_0xb377('0x0'));var util=require(_0xb377('0x1'));var moment=require(_0xb377('0x2'));var BPromise=require(_0xb377('0x3'));var rs=require(_0xb377('0x4'));var fs=require('fs');var Redis=require(_0xb377('0x5'));var db=require(_0xb377('0x6'))['db'];var utils=require(_0xb377('0x7'));var logger=require(_0xb377('0x8'))(_0xb377('0x9'));var config=require(_0xb377('0xa'));var jayson=require(_0xb377('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1ded,_0x2dc1f1,_0x4919d6){return new BPromise(function(_0x4e1054,_0x1c28c7){return client[_0xb377('0xc')](_0x4c1ded,_0x4919d6)[_0xb377('0xd')](function(_0xad8a55){logger[_0xb377('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x2dc1f1,_0xb377('0xf'));logger[_0xb377('0x10')](_0xb377('0x11'),_0x2dc1f1,_0xb377('0xf'),JSON[_0xb377('0x12')](_0xad8a55));if(_0xad8a55['error']){if(_0xad8a55[_0xb377('0x13')]['code']===0x1f4){logger[_0xb377('0x13')](_0xb377('0x14'),_0x2dc1f1,_0xad8a55[_0xb377('0x13')][_0xb377('0x15')]);return _0x1c28c7(_0xad8a55[_0xb377('0x13')][_0xb377('0x15')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2dc1f1,_0xad8a55['error'][_0xb377('0x15')]);return _0x4e1054(_0xad8a55['error'][_0xb377('0x15')]);}else{logger['info'](_0xb377('0x14'),_0x2dc1f1,'request\x20sent');_0x4e1054(_0xad8a55[_0xb377('0x16')][_0xb377('0x15')]);}})[_0xb377('0x17')](function(_0x102205){logger['error'](_0xb377('0x14'),_0x2dc1f1,_0x102205);_0x1c28c7(_0x102205);});});}exports[_0xb377('0x18')]=function(_0x1c59b2){var _0x1b7ee9=this;return new Promise(function(_0x52c972,_0x1e8693){return db['SmsQueueReport'][_0xb377('0x19')](_0x1c59b2[_0xb377('0x1a')],{'raw':_0x1c59b2[_0xb377('0x1b')]?_0x1c59b2[_0xb377('0x1b')][_0xb377('0x1c')]===undefined?!![]:![]:!![]})[_0xb377('0xd')](function(_0x17a18b){logger[_0xb377('0xe')](_0xb377('0x18'),_0x1c59b2);logger[_0xb377('0x10')](_0xb377('0x18'),_0x1c59b2,JSON[_0xb377('0x12')](_0x17a18b));_0x52c972(_0x17a18b);})[_0xb377('0x17')](function(_0x2a4c71){logger[_0xb377('0x13')]('CreateSmsQueueReport',_0x2a4c71['message'],_0x1c59b2);_0x1e8693(_0x1b7ee9[_0xb377('0x13')](0x1f4,_0x2a4c71[_0xb377('0x15')]));});});};exports[_0xb377('0x1d')]=function(_0x1833cb){var _0x210ecc=this;return new Promise(function(_0x5d6e71,_0x527fae){return db[_0xb377('0x1e')]['update'](_0x1833cb[_0xb377('0x1a')],{'raw':_0x1833cb['options']?_0x1833cb[_0xb377('0x1b')][_0xb377('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1833cb[_0xb377('0x1b')]?_0x1833cb[_0xb377('0x1b')][_0xb377('0x1f')]||null:null,'attributes':_0x1833cb[_0xb377('0x1b')]?_0x1833cb[_0xb377('0x1b')]['attributes']||null:null,'limit':_0x1833cb['options']?_0x1833cb['options'][_0xb377('0x20')]||null:null})['then'](function(_0x28c9e2){logger[_0xb377('0xe')](_0xb377('0x1d'),_0x1833cb);logger[_0xb377('0x10')](_0xb377('0x1d'),_0x1833cb,JSON[_0xb377('0x12')](_0x28c9e2));_0x5d6e71(_0x28c9e2);})[_0xb377('0x17')](function(_0x3fc187){logger[_0xb377('0x13')](_0xb377('0x1d'),_0x3fc187['message'],_0x1833cb);_0x527fae(_0x210ecc[_0xb377('0x13')](0x1f4,_0x3fc187[_0xb377('0x15')]));});});};
\ No newline at end of file
index 10765c4..b350585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5178=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x3b06de,_0x140afd){var _0x1fdb8e=function(_0x11c4fb){while(--_0x11c4fb){_0x3b06de['push'](_0x3b06de['shift']());}};_0x1fdb8e(++_0x140afd);}(_0x5178,0x171));var _0x8517=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5178[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./smsTransferReport.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0xd')]('/',auth[_0x8517('0xa')](),controller['create']);router[_0x8517('0xe')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0xf')]);router[_0x8517('0x10')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x4944=['fs-extra','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4944,0x6d));var _0x4494=function(_0x1b4e93,_0x4e082d){_0x1b4e93=_0x1b4e93-0x0;var _0x4f8fca=_0x4944[_0x1b4e93];return _0x4f8fca;};'use strict';var multer=require(_0x4494('0x0'));var util=require('util');var path=require(_0x4494('0x1'));var timeout=require(_0x4494('0x2'));var express=require(_0x4494('0x3'));var router=express[_0x4494('0x4')]();var fs_extra=require(_0x4494('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4494('0x6'));var config=require('../../config/environment');var controller=require(_0x4494('0x7'));router[_0x4494('0x8')]('/',auth[_0x4494('0x9')](),controller[_0x4494('0xa')]);router[_0x4494('0x8')](_0x4494('0xb'),auth[_0x4494('0x9')](),controller[_0x4494('0xc')]);router[_0x4494('0x8')]('/:id',auth[_0x4494('0x9')](),controller[_0x4494('0xd')]);router[_0x4494('0xe')]('/',auth[_0x4494('0x9')](),controller['create']);router['put'](_0x4494('0xf'),auth[_0x4494('0x9')](),controller[_0x4494('0x10')]);router['delete']('/:id',auth[_0x4494('0x9')](),controller[_0x4494('0x11')]);module[_0x4494('0x12')]=router;
\ No newline at end of file
index cfd94b6..b64c19a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3838a4,_0x2ae1e6){var _0x3c56b4=function(_0x4cbf64){while(--_0x4cbf64){_0x3838a4['push'](_0x3838a4['shift']());}};_0x3c56b4(++_0x2ae1e6);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x48fc17,_0x55df64){var _0x4f533e=function(_0x2e6aa9){while(--_0x2e6aa9){_0x48fc17['push'](_0x48fc17['shift']());}};_0x4f533e(++_0x55df64);}(_0x70e0,0x17b));var _0x070e=function(_0xd37039,_0x51b000){_0xd37039=_0xd37039-0x0;var _0x2dd22b=_0x70e0[_0xd37039];return _0x2dd22b;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index 3416f78..aeb6cdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f1d=['save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x1a3351,_0x20a9fb){var _0x1f570d=function(_0x4d8357){while(--_0x4d8357){_0x1a3351['push'](_0x1a3351['shift']());}};_0x1f570d(++_0x20a9fb);}(_0x4f1d,0x1e7));var _0xd4f1=function(_0x39010b,_0x17e844){_0x39010b=_0x39010b-0x0;var _0x3d8797=_0x4f1d[_0x39010b];return _0x3d8797;};'use strict';var emlformat=require(_0xd4f1('0x0'));var rimraf=require(_0xd4f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4f1('0x2'));var rp=require(_0xd4f1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd4f1('0x4'));var util=require(_0xd4f1('0x5'));var path=require('path');var sox=require(_0xd4f1('0x6'));var csv=require(_0xd4f1('0x7'));var ejs=require(_0xd4f1('0x8'));var fs=require('fs');var fs_extra=require(_0xd4f1('0x9'));var _=require('lodash');var squel=require(_0xd4f1('0xa'));var crypto=require(_0xd4f1('0xb'));var jsforce=require(_0xd4f1('0xc'));var deskjs=require(_0xd4f1('0xd'));var toCsv=require(_0xd4f1('0x7'));var querystring=require(_0xd4f1('0xe'));var Papa=require(_0xd4f1('0xf'));var Redis=require(_0xd4f1('0x10'));var authService=require(_0xd4f1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd4f1('0x12'));var utils=require('../../config/utils');var config=require(_0xd4f1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f0fab,_0x3ddb7b){_0x3ddb7b=_0x3ddb7b||0xcc;return function(_0x1058ee){if(_0x1058ee){return _0x1f0fab['sendStatus'](_0x3ddb7b);}return _0x1f0fab[_0xd4f1('0x14')](_0x3ddb7b)[_0xd4f1('0x15')]();};}function respondWithResult(_0x469a18,_0x4907ad){_0x4907ad=_0x4907ad||0xc8;return function(_0x426efa){if(_0x426efa){return _0x469a18['status'](_0x4907ad)[_0xd4f1('0x16')](_0x426efa);}};}function respondWithFilteredResult(_0x5aff54,_0x1e3e72){return function(_0x2c3184){if(_0x2c3184){var _0x246dcc=typeof _0x1e3e72[_0xd4f1('0x17')]==='undefined'&&typeof _0x1e3e72[_0xd4f1('0x18')]===_0xd4f1('0x19');var _0x1844ac=_0x2c3184[_0xd4f1('0x1a')];var _0x4740da=_0x246dcc?0x0:_0x1e3e72[_0xd4f1('0x17')];var _0x1bbd75=_0x246dcc?_0x2c3184[_0xd4f1('0x1a')]:_0x1e3e72[_0xd4f1('0x17')]+_0x1e3e72[_0xd4f1('0x18')];var _0x3f24cc;if(_0x1bbd75>=_0x1844ac){_0x1bbd75=_0x1844ac;_0x3f24cc=0xc8;}else{_0x3f24cc=0xce;}_0x5aff54[_0xd4f1('0x14')](_0x3f24cc);return _0x5aff54[_0xd4f1('0x1b')](_0xd4f1('0x1c'),_0x4740da+'-'+_0x1bbd75+'/'+_0x1844ac)[_0xd4f1('0x16')](_0x2c3184);}return null;};}function patchUpdates(_0x35b47b){return function(_0x6a103f){try{jsonpatch[_0xd4f1('0x1d')](_0x6a103f,_0x35b47b,!![]);}catch(_0x405a3b){return BPromise[_0xd4f1('0x1e')](_0x405a3b);}return _0x6a103f[_0xd4f1('0x1f')]();};}function saveUpdates(_0x59eb85,_0x33cdd0){return function(_0x26aef6){if(_0x26aef6){return _0x26aef6[_0xd4f1('0x20')](_0x59eb85)[_0xd4f1('0x21')](function(_0x55834c){return _0x55834c;});}return null;};}function removeEntity(_0x474198,_0x1cbaa9){return function(_0x2e8fbd){if(_0x2e8fbd){return _0x2e8fbd[_0xd4f1('0x22')]()['then'](function(){_0x474198['status'](0xcc)[_0xd4f1('0x15')]();});}};}function handleEntityNotFound(_0x2feb26,_0x301405){return function(_0x45913a){if(!_0x45913a){_0x2feb26[_0xd4f1('0x23')](0x194);}return _0x45913a;};}function handleError(_0x28af9d,_0x22032a){_0x22032a=_0x22032a||0x1f4;return function(_0x2dde5e){logger[_0xd4f1('0x24')](_0x2dde5e[_0xd4f1('0x25')]);if(_0x2dde5e[_0xd4f1('0x26')]){delete _0x2dde5e[_0xd4f1('0x26')];}_0x28af9d['status'](_0x22032a)[_0xd4f1('0x27')](_0x2dde5e);};}exports[_0xd4f1('0x28')]=function(_0x7e04c2,_0x2c9bdc){var _0x574d92={},_0x53ffd4={},_0x2230c8={'count':0x0,'rows':[]};var _0x18df77=_[_0xd4f1('0x29')](db[_0xd4f1('0x2a')]['rawAttributes'],function(_0x2346ae){return{'name':_0x2346ae[_0xd4f1('0x2b')],'type':_0x2346ae[_0xd4f1('0x2c')][_0xd4f1('0x2d')]};});_0x53ffd4['model']=_[_0xd4f1('0x29')](_0x18df77,_0xd4f1('0x26'));_0x53ffd4['query']=_[_0xd4f1('0x2e')](_0x7e04c2[_0xd4f1('0x2f')]);_0x53ffd4[_0xd4f1('0x30')]=_[_0xd4f1('0x31')](_0x53ffd4['model'],_0x53ffd4[_0xd4f1('0x2f')]);_0x574d92[_0xd4f1('0x32')]=_[_0xd4f1('0x31')](_0x53ffd4[_0xd4f1('0x33')],qs['fields'](_0x7e04c2['query'][_0xd4f1('0x34')]));_0x574d92[_0xd4f1('0x32')]=_0x574d92['attributes']['length']?_0x574d92['attributes']:_0x53ffd4['model'];if(!_0x7e04c2['query'][_0xd4f1('0x35')](_0xd4f1('0x36'))){_0x574d92['limit']=qs['limit'](_0x7e04c2[_0xd4f1('0x2f')][_0xd4f1('0x18')]);_0x574d92[_0xd4f1('0x17')]=qs[_0xd4f1('0x17')](_0x7e04c2[_0xd4f1('0x2f')]['offset']);}_0x574d92[_0xd4f1('0x37')]=qs[_0xd4f1('0x38')](_0x7e04c2['query'][_0xd4f1('0x38')]);_0x574d92[_0xd4f1('0x39')]=qs['filters'](_[_0xd4f1('0x3a')](_0x7e04c2[_0xd4f1('0x2f')],_0x53ffd4[_0xd4f1('0x30')]),_0x18df77);if(_0x7e04c2[_0xd4f1('0x2f')][_0xd4f1('0x3b')]){_0x574d92[_0xd4f1('0x39')]=_[_0xd4f1('0x3c')](_0x574d92[_0xd4f1('0x39')],{'$or':_[_0xd4f1('0x29')](_0x18df77,function(_0x447d8e){if(_0x447d8e[_0xd4f1('0x2c')]!==_0xd4f1('0x3d')){var _0x7629c={};_0x7629c[_0x447d8e[_0xd4f1('0x26')]]={'$like':'%'+_0x7e04c2[_0xd4f1('0x2f')]['filter']+'%'};return _0x7629c;}})});}_0x574d92=_['merge']({},_0x574d92,_0x7e04c2[_0xd4f1('0x3e')]);var _0x7819ae={'where':_0x574d92['where']};return db[_0xd4f1('0x2a')][_0xd4f1('0x1a')](_0x7819ae)[_0xd4f1('0x21')](function(_0x3f8b99){_0x2230c8[_0xd4f1('0x1a')]=_0x3f8b99;if(_0x7e04c2[_0xd4f1('0x2f')][_0xd4f1('0x3f')]){_0x574d92[_0xd4f1('0x40')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x574d92);})[_0xd4f1('0x21')](function(_0x10b593){_0x2230c8[_0xd4f1('0x41')]=_0x10b593;return _0x2230c8;})[_0xd4f1('0x21')](respondWithFilteredResult(_0x2c9bdc,_0x574d92))[_0xd4f1('0x42')](handleError(_0x2c9bdc,null));};exports[_0xd4f1('0x43')]=function(_0x3baf2f,_0x11a8aa){var _0x373210={'raw':!![],'where':{'id':_0x3baf2f[_0xd4f1('0x44')]['id']}},_0x2309f3={};_0x2309f3[_0xd4f1('0x33')]=_[_0xd4f1('0x2e')](db[_0xd4f1('0x2a')][_0xd4f1('0x45')]);_0x2309f3[_0xd4f1('0x2f')]=_[_0xd4f1('0x2e')](_0x3baf2f[_0xd4f1('0x2f')]);_0x2309f3[_0xd4f1('0x30')]=_['intersection'](_0x2309f3[_0xd4f1('0x33')],_0x2309f3[_0xd4f1('0x2f')]);_0x373210[_0xd4f1('0x32')]=_[_0xd4f1('0x31')](_0x2309f3['model'],qs[_0xd4f1('0x34')](_0x3baf2f[_0xd4f1('0x2f')][_0xd4f1('0x34')]));_0x373210[_0xd4f1('0x32')]=_0x373210[_0xd4f1('0x32')][_0xd4f1('0x46')]?_0x373210[_0xd4f1('0x32')]:_0x2309f3[_0xd4f1('0x33')];if(_0x3baf2f['query'][_0xd4f1('0x3f')]){_0x373210[_0xd4f1('0x40')]=[{'all':!![]}];}_0x373210=_[_0xd4f1('0x3c')]({},_0x373210,_0x3baf2f[_0xd4f1('0x3e')]);return db[_0xd4f1('0x2a')][_0xd4f1('0x47')](_0x373210)[_0xd4f1('0x21')](handleEntityNotFound(_0x11a8aa,null))[_0xd4f1('0x21')](respondWithResult(_0x11a8aa,null))['catch'](handleError(_0x11a8aa,null));};exports[_0xd4f1('0x48')]=function(_0x4d64a0,_0xf3bdb8){return db[_0xd4f1('0x2a')]['create'](_0x4d64a0[_0xd4f1('0x49')],{})[_0xd4f1('0x21')](respondWithResult(_0xf3bdb8,0xc9))[_0xd4f1('0x42')](handleError(_0xf3bdb8,null));};exports[_0xd4f1('0x20')]=function(_0x2d3a2f,_0x2cb548){if(_0x2d3a2f[_0xd4f1('0x49')]['id']){delete _0x2d3a2f[_0xd4f1('0x49')]['id'];}return db[_0xd4f1('0x2a')]['find']({'where':{'id':_0x2d3a2f[_0xd4f1('0x44')]['id']}})[_0xd4f1('0x21')](handleEntityNotFound(_0x2cb548,null))[_0xd4f1('0x21')](saveUpdates(_0x2d3a2f[_0xd4f1('0x49')],null))[_0xd4f1('0x21')](respondWithResult(_0x2cb548,null))[_0xd4f1('0x42')](handleError(_0x2cb548,null));};exports[_0xd4f1('0x22')]=function(_0x1ad6fd,_0x513b73){return db[_0xd4f1('0x2a')]['find']({'where':{'id':_0x1ad6fd[_0xd4f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x513b73,null))['then'](removeEntity(_0x513b73,null))[_0xd4f1('0x42')](handleError(_0x513b73,null));};exports['describe']=function(_0x14846b,_0x52bf04){return db[_0xd4f1('0x2a')]['describe']()[_0xd4f1('0x21')](respondWithResult(_0x52bf04,null))[_0xd4f1('0x42')](handleError(_0x52bf04,null));};
\ No newline at end of file
+var _0xaabc=['include','rows','catch','show','params','find','create','body','update','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','SmsTransferReport','includeAll'];(function(_0x725ca7,_0x1cbd18){var _0xcc351e=function(_0x289aa7){while(--_0x289aa7){_0x725ca7['push'](_0x725ca7['shift']());}};_0xcc351e(++_0x1cbd18);}(_0xaabc,0x13e));var _0xcaab=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xaabc[_0x11005e];return _0x29338f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaab('0x0'));var zipdir=require(_0xcaab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaab('0x2'));var moment=require(_0xcaab('0x3'));var BPromise=require(_0xcaab('0x4'));var Mustache=require(_0xcaab('0x5'));var util=require(_0xcaab('0x6'));var path=require(_0xcaab('0x7'));var sox=require(_0xcaab('0x8'));var csv=require(_0xcaab('0x9'));var ejs=require(_0xcaab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaab('0xb'));var squel=require(_0xcaab('0xc'));var crypto=require(_0xcaab('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcaab('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcaab('0xe'));var authService=require(_0xcaab('0xf'));var qs=require(_0xcaab('0x10'));var as=require(_0xcaab('0x11'));var hardwareService=require(_0xcaab('0x12'));var logger=require(_0xcaab('0x13'))(_0xcaab('0x14'));var utils=require(_0xcaab('0x15'));var config=require(_0xcaab('0x16'));var licenseUtil=require(_0xcaab('0x17'));var db=require(_0xcaab('0x18'))['db'];function respondWithStatusCode(_0xac93d7,_0x34e2ce){_0x34e2ce=_0x34e2ce||0xcc;return function(_0x473ca5){if(_0x473ca5){return _0xac93d7[_0xcaab('0x19')](_0x34e2ce);}return _0xac93d7[_0xcaab('0x1a')](_0x34e2ce)[_0xcaab('0x1b')]();};}function respondWithResult(_0x36122b,_0x4de5fd){_0x4de5fd=_0x4de5fd||0xc8;return function(_0x924fd1){if(_0x924fd1){return _0x36122b[_0xcaab('0x1a')](_0x4de5fd)['json'](_0x924fd1);}};}function respondWithFilteredResult(_0x4abd10,_0x18285d){return function(_0x87fd9){if(_0x87fd9){var _0x3d999f=typeof _0x18285d[_0xcaab('0x1c')]===_0xcaab('0x1d')&&typeof _0x18285d[_0xcaab('0x1e')]==='undefined';var _0x5b0eea=_0x87fd9['count'];var _0x46a627=_0x3d999f?0x0:_0x18285d[_0xcaab('0x1c')];var _0x4fc671=_0x3d999f?_0x87fd9[_0xcaab('0x1f')]:_0x18285d[_0xcaab('0x1c')]+_0x18285d[_0xcaab('0x1e')];var _0xaa789b;if(_0x4fc671>=_0x5b0eea){_0x4fc671=_0x5b0eea;_0xaa789b=0xc8;}else{_0xaa789b=0xce;}_0x4abd10[_0xcaab('0x1a')](_0xaa789b);return _0x4abd10[_0xcaab('0x20')](_0xcaab('0x21'),_0x46a627+'-'+_0x4fc671+'/'+_0x5b0eea)[_0xcaab('0x22')](_0x87fd9);}return null;};}function patchUpdates(_0x49391b){return function(_0x5989dd){try{jsonpatch[_0xcaab('0x23')](_0x5989dd,_0x49391b,!![]);}catch(_0x4d95f7){return BPromise[_0xcaab('0x24')](_0x4d95f7);}return _0x5989dd['save']();};}function saveUpdates(_0x4dc00e,_0x3e1e92){return function(_0x1f8c9e){if(_0x1f8c9e){return _0x1f8c9e['update'](_0x4dc00e)[_0xcaab('0x25')](function(_0x179451){return _0x179451;});}return null;};}function removeEntity(_0x154c3a,_0x41e9ef){return function(_0xb862fc){if(_0xb862fc){return _0xb862fc['destroy']()[_0xcaab('0x25')](function(){_0x154c3a[_0xcaab('0x1a')](0xcc)[_0xcaab('0x1b')]();});}};}function handleEntityNotFound(_0x338ed9,_0x541359){return function(_0x2a52aa){if(!_0x2a52aa){_0x338ed9[_0xcaab('0x19')](0x194);}return _0x2a52aa;};}function handleError(_0x11c055,_0x33edd2){_0x33edd2=_0x33edd2||0x1f4;return function(_0x3052ef){logger[_0xcaab('0x26')](_0x3052ef[_0xcaab('0x27')]);if(_0x3052ef['name']){delete _0x3052ef['name'];}_0x11c055['status'](_0x33edd2)[_0xcaab('0x28')](_0x3052ef);};}exports[_0xcaab('0x29')]=function(_0x2846fe,_0x15973a){var _0x993b9f={},_0x3f4e95={},_0x57312d={'count':0x0,'rows':[]};var _0x485dbc=_['map'](db['SmsTransferReport'][_0xcaab('0x2a')],function(_0x284720){return{'name':_0x284720[_0xcaab('0x2b')],'type':_0x284720[_0xcaab('0x2c')][_0xcaab('0x2d')]};});_0x3f4e95[_0xcaab('0x2e')]=_[_0xcaab('0x2f')](_0x485dbc,'name');_0x3f4e95[_0xcaab('0x30')]=_[_0xcaab('0x31')](_0x2846fe[_0xcaab('0x30')]);_0x3f4e95[_0xcaab('0x32')]=_[_0xcaab('0x33')](_0x3f4e95[_0xcaab('0x2e')],_0x3f4e95['query']);_0x993b9f[_0xcaab('0x34')]=_[_0xcaab('0x33')](_0x3f4e95[_0xcaab('0x2e')],qs[_0xcaab('0x35')](_0x2846fe[_0xcaab('0x30')][_0xcaab('0x35')]));_0x993b9f[_0xcaab('0x34')]=_0x993b9f[_0xcaab('0x34')][_0xcaab('0x36')]?_0x993b9f[_0xcaab('0x34')]:_0x3f4e95[_0xcaab('0x2e')];if(!_0x2846fe['query']['hasOwnProperty'](_0xcaab('0x37'))){_0x993b9f[_0xcaab('0x1e')]=qs[_0xcaab('0x1e')](_0x2846fe[_0xcaab('0x30')][_0xcaab('0x1e')]);_0x993b9f[_0xcaab('0x1c')]=qs[_0xcaab('0x1c')](_0x2846fe['query'][_0xcaab('0x1c')]);}_0x993b9f[_0xcaab('0x38')]=qs[_0xcaab('0x39')](_0x2846fe[_0xcaab('0x30')][_0xcaab('0x39')]);_0x993b9f[_0xcaab('0x3a')]=qs[_0xcaab('0x32')](_[_0xcaab('0x3b')](_0x2846fe[_0xcaab('0x30')],_0x3f4e95[_0xcaab('0x32')]),_0x485dbc);if(_0x2846fe[_0xcaab('0x30')][_0xcaab('0x3c')]){_0x993b9f[_0xcaab('0x3a')]=_[_0xcaab('0x3d')](_0x993b9f[_0xcaab('0x3a')],{'$or':_['map'](_0x485dbc,function(_0x2b501c){if(_0x2b501c[_0xcaab('0x2c')]!==_0xcaab('0x3e')){var _0xdc4752={};_0xdc4752[_0x2b501c[_0xcaab('0x3f')]]={'$like':'%'+_0x2846fe[_0xcaab('0x30')]['filter']+'%'};return _0xdc4752;}})});}_0x993b9f=_[_0xcaab('0x3d')]({},_0x993b9f,_0x2846fe[_0xcaab('0x40')]);var _0x1cbf06={'where':_0x993b9f[_0xcaab('0x3a')]};return db[_0xcaab('0x41')][_0xcaab('0x1f')](_0x1cbf06)['then'](function(_0x54a7fc){_0x57312d[_0xcaab('0x1f')]=_0x54a7fc;if(_0x2846fe[_0xcaab('0x30')][_0xcaab('0x42')]){_0x993b9f[_0xcaab('0x43')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x993b9f);})[_0xcaab('0x25')](function(_0x4fb633){_0x57312d[_0xcaab('0x44')]=_0x4fb633;return _0x57312d;})[_0xcaab('0x25')](respondWithFilteredResult(_0x15973a,_0x993b9f))[_0xcaab('0x45')](handleError(_0x15973a,null));};exports[_0xcaab('0x46')]=function(_0x5d02f9,_0x4343f3){var _0x4e0007={'raw':!![],'where':{'id':_0x5d02f9[_0xcaab('0x47')]['id']}},_0x101f30={};_0x101f30[_0xcaab('0x2e')]=_[_0xcaab('0x31')](db['SmsTransferReport'][_0xcaab('0x2a')]);_0x101f30[_0xcaab('0x30')]=_[_0xcaab('0x31')](_0x5d02f9['query']);_0x101f30[_0xcaab('0x32')]=_['intersection'](_0x101f30[_0xcaab('0x2e')],_0x101f30[_0xcaab('0x30')]);_0x4e0007['attributes']=_[_0xcaab('0x33')](_0x101f30['model'],qs[_0xcaab('0x35')](_0x5d02f9[_0xcaab('0x30')][_0xcaab('0x35')]));_0x4e0007[_0xcaab('0x34')]=_0x4e0007['attributes'][_0xcaab('0x36')]?_0x4e0007[_0xcaab('0x34')]:_0x101f30['model'];if(_0x5d02f9[_0xcaab('0x30')][_0xcaab('0x42')]){_0x4e0007[_0xcaab('0x43')]=[{'all':!![]}];}_0x4e0007=_[_0xcaab('0x3d')]({},_0x4e0007,_0x5d02f9['options']);return db[_0xcaab('0x41')][_0xcaab('0x48')](_0x4e0007)[_0xcaab('0x25')](handleEntityNotFound(_0x4343f3,null))[_0xcaab('0x25')](respondWithResult(_0x4343f3,null))[_0xcaab('0x45')](handleError(_0x4343f3,null));};exports[_0xcaab('0x49')]=function(_0x4427a0,_0x475153){return db[_0xcaab('0x41')]['create'](_0x4427a0[_0xcaab('0x4a')],{})[_0xcaab('0x25')](respondWithResult(_0x475153,0xc9))[_0xcaab('0x45')](handleError(_0x475153,null));};exports[_0xcaab('0x4b')]=function(_0x5da887,_0x5ef12d){if(_0x5da887['body']['id']){delete _0x5da887[_0xcaab('0x4a')]['id'];}return db[_0xcaab('0x41')]['find']({'where':{'id':_0x5da887[_0xcaab('0x47')]['id']}})[_0xcaab('0x25')](handleEntityNotFound(_0x5ef12d,null))[_0xcaab('0x25')](saveUpdates(_0x5da887[_0xcaab('0x4a')],null))[_0xcaab('0x25')](respondWithResult(_0x5ef12d,null))[_0xcaab('0x45')](handleError(_0x5ef12d,null));};exports[_0xcaab('0x4c')]=function(_0x3aee62,_0x4b5f38){return db['SmsTransferReport'][_0xcaab('0x48')]({'where':{'id':_0x3aee62[_0xcaab('0x47')]['id']}})[_0xcaab('0x25')](handleEntityNotFound(_0x4b5f38,null))[_0xcaab('0x25')](removeEntity(_0x4b5f38,null))[_0xcaab('0x45')](handleError(_0x4b5f38,null));};exports['describe']=function(_0x2d89aa,_0x468795){return db['SmsTransferReport']['describe']()[_0xcaab('0x25')](respondWithResult(_0x468795,null))['catch'](handleError(_0x468795,null));};
\ No newline at end of file
index 0267133..a1bd093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0501=['util','api','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x9213cb,_0x45033a){var _0x34664d=function(_0x1fa7e7){while(--_0x1fa7e7){_0x9213cb['push'](_0x9213cb['shift']());}};_0x34664d(++_0x45033a);}(_0x0501,0xcf));var _0x1050=function(_0x53cfae,_0x44a7c5){_0x53cfae=_0x53cfae-0x0;var _0xc056ac=_0x0501[_0x53cfae];return _0xc056ac;};'use strict';var _=require(_0x1050('0x0'));var util=require(_0x1050('0x1'));var logger=require('../../config/logger')(_0x1050('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1050('0x3'));var fs=require('fs');var path=require(_0x1050('0x4'));var rimraf=require(_0x1050('0x5'));var config=require(_0x1050('0x6'));var attributes=require(_0x1050('0x7'));module[_0x1050('0x8')]=function(_0x271605,_0x55509f){return _0x271605[_0x1050('0x9')](_0x1050('0xa'),attributes,{'tableName':_0x1050('0xb'),'paranoid':![],'indexes':[{'name':_0x1050('0xc'),'fields':[_0x1050('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b06=['request-promise','path','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b06,0x97));var _0x64b0=function(_0x26e66e,_0x11afe4){_0x26e66e=_0x26e66e-0x0;var _0x43a697=_0x4b06[_0x26e66e];return _0x43a697;};'use strict';var _=require(_0x64b0('0x0'));var util=require(_0x64b0('0x1'));var logger=require(_0x64b0('0x2'))('api');var moment=require(_0x64b0('0x3'));var BPromise=require(_0x64b0('0x4'));var rp=require(_0x64b0('0x5'));var fs=require('fs');var path=require(_0x64b0('0x6'));var rimraf=require('rimraf');var config=require(_0x64b0('0x7'));var attributes=require(_0x64b0('0x8'));module['exports']=function(_0xb88b5a,_0x454e58){return _0xb88b5a[_0x64b0('0x9')](_0x64b0('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x64b0('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 291e576..cab855d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc474=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x2fcfda,_0x517cf4){var _0x2236b2=function(_0x420226){while(--_0x420226){_0x2fcfda['push'](_0x2fcfda['shift']());}};_0x2236b2(++_0x517cf4);}(_0xc474,0xfc));var _0x4c47=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xc474[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var moment=require(_0x4c47('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c47('0x3'));var fs=require('fs');var Redis=require(_0x4c47('0x4'));var db=require(_0x4c47('0x5'))['db'];var utils=require(_0x4c47('0x6'));var logger=require(_0x4c47('0x7'))(_0x4c47('0x8'));var config=require(_0x4c47('0x9'));var jayson=require(_0x4c47('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6aeef8,_0x255b6e,_0x275a64){return new BPromise(function(_0x35a093,_0x2593c2){return client['request'](_0x6aeef8,_0x275a64)[_0x4c47('0xb')](function(_0x1d2f5c){logger['info'](_0x4c47('0xc'),_0x255b6e,_0x4c47('0xd'));logger[_0x4c47('0xe')](_0x4c47('0xf'),_0x255b6e,'request\x20sent',JSON[_0x4c47('0x10')](_0x1d2f5c));if(_0x1d2f5c['error']){if(_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x12')]===0x1f4){logger[_0x4c47('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x255b6e,_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x13')]);return _0x2593c2(_0x1d2f5c['error'][_0x4c47('0x13')]);}logger['error'](_0x4c47('0xc'),_0x255b6e,_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x13')]);return _0x35a093(_0x1d2f5c[_0x4c47('0x11')]['message']);}else{logger[_0x4c47('0x14')](_0x4c47('0xc'),_0x255b6e,_0x4c47('0xd'));_0x35a093(_0x1d2f5c[_0x4c47('0x15')]['message']);}})['catch'](function(_0x5afffc){logger[_0x4c47('0x11')](_0x4c47('0xc'),_0x255b6e,_0x5afffc);_0x2593c2(_0x5afffc);});});}
\ No newline at end of file
+var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3e143d,_0x103582){var _0x573460=function(_0x3a7696){while(--_0x3a7696){_0x3e143d['push'](_0x3e143d['shift']());}};_0x573460(++_0x103582);}(_0xa41a,0x6b));var _0xaa41=function(_0x13106b,_0x285c0d){_0x13106b=_0x13106b-0x0;var _0x1f5fb7=_0xa41a[_0x13106b];return _0x1f5fb7;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
index d49f589..5b062f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0c1=['put','/:id','update','delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','root','server/files/sounds/original/','originalname','%s-%s%s','extname','post','single','file','create'];(function(_0x44015d,_0x5654c4){var _0x38562=function(_0x250e18){while(--_0x250e18){_0x44015d['push'](_0x44015d['shift']());}};_0x38562(++_0x5654c4);}(_0xb0c1,0x122));var _0x1b0c=function(_0x51e484,_0x5ad688){_0x51e484=_0x51e484-0x0;var _0x29e12e=_0xb0c1[_0x51e484];return _0x29e12e;};'use strict';var multer=require('multer');var util=require(_0x1b0c('0x0'));var path=require('path');var timeout=require(_0x1b0c('0x1'));var express=require('express');var router=express[_0x1b0c('0x2')]();var fs_extra=require(_0x1b0c('0x3'));var auth=require(_0x1b0c('0x4'));var interaction=require(_0x1b0c('0x5'));var config=require(_0x1b0c('0x6'));var controller=require(_0x1b0c('0x7'));router[_0x1b0c('0x8')]('/',auth[_0x1b0c('0x9')](),controller[_0x1b0c('0xa')]);router[_0x1b0c('0x8')]('/:id',auth[_0x1b0c('0x9')](),controller[_0x1b0c('0xb')]);router[_0x1b0c('0x8')](_0x1b0c('0xc'),auth[_0x1b0c('0x9')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26ac8b,_0x5b64ae,_0xd3f839){_0xd3f839(null,path['join'](config[_0x1b0c('0xd')],_0x1b0c('0xe')));},'filename':function(_0x2238c6,_0x21e5da,_0x43e43c){_0x21e5da[_0x1b0c('0xf')]=_0x21e5da['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43e43c(null,util['format'](_0x1b0c('0x10'),path['basename'](_0x21e5da[_0x1b0c('0xf')],path[_0x1b0c('0x11')](_0x21e5da[_0x1b0c('0xf')])),Date['now'](),path[_0x1b0c('0x11')](_0x21e5da['originalname'])));}})});router[_0x1b0c('0x12')]('/',upload[_0x1b0c('0x13')](_0x1b0c('0x14')),controller[_0x1b0c('0x15')]);router[_0x1b0c('0x16')](_0x1b0c('0x17'),auth[_0x1b0c('0x9')](),controller[_0x1b0c('0x18')]);router[_0x1b0c('0x19')]('/:id',auth[_0x1b0c('0x9')](),controller[_0x1b0c('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xe345=['replace','format','%s-%s%s','extname','now','post','single','file','create','put','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','diskStorage','join','root','originalname'];(function(_0x2d287e,_0x8e2259){var _0x5a78e0=function(_0x2875b1){while(--_0x2875b1){_0x2d287e['push'](_0x2d287e['shift']());}};_0x5a78e0(++_0x8e2259);}(_0xe345,0x99));var _0x5e34=function(_0x22f164,_0xaa4f80){_0x22f164=_0x22f164-0x0;var _0x51ab95=_0xe345[_0x22f164];return _0x51ab95;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e34('0x0'));var timeout=require('connect-timeout');var express=require(_0x5e34('0x1'));var router=express[_0x5e34('0x2')]();var fs_extra=require(_0x5e34('0x3'));var auth=require(_0x5e34('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5e34('0x5'));var controller=require('./sound.controller');router[_0x5e34('0x6')]('/',auth['isAuthenticated'](),controller[_0x5e34('0x7')]);router[_0x5e34('0x6')](_0x5e34('0x8'),auth[_0x5e34('0x9')](),controller[_0x5e34('0xa')]);router[_0x5e34('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x5e34('0xb')]({'destination':function(_0x4ad902,_0xcba235,_0x50ab7a){_0x50ab7a(null,path[_0x5e34('0xc')](config[_0x5e34('0xd')],'server/files/sounds/original/'));},'filename':function(_0x44549a,_0x24f067,_0x33955c){_0x24f067['originalname']=_0x24f067[_0x5e34('0xe')][_0x5e34('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33955c(null,util[_0x5e34('0x10')](_0x5e34('0x11'),path['basename'](_0x24f067['originalname'],path[_0x5e34('0x12')](_0x24f067[_0x5e34('0xe')])),Date[_0x5e34('0x13')](),path['extname'](_0x24f067[_0x5e34('0xe')])));}})});router[_0x5e34('0x14')]('/',upload[_0x5e34('0x15')](_0x5e34('0x16')),controller[_0x5e34('0x17')]);router[_0x5e34('0x18')]('/:id',auth[_0x5e34('0x9')](),controller[_0x5e34('0x19')]);router[_0x5e34('0x1a')]('/:id',auth[_0x5e34('0x9')](),controller[_0x5e34('0x1a')]);module[_0x5e34('0x1b')]=router;
\ No newline at end of file
index b038034..854584a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb254=['FLOAT','BIGINT','INTEGER','exports','STRING','name'];(function(_0x120900,_0x1b16c7){var _0x356528=function(_0x3f938b){while(--_0x3f938b){_0x120900['push'](_0x120900['shift']());}};_0x356528(++_0x1b16c7);}(_0xb254,0x1b9));var _0x4b25=function(_0x1e68ec,_0x1a2c8f){_0x1e68ec=_0x1e68ec-0x0;var _0x47af1f=_0xb254[_0x1e68ec];return _0x47af1f;};'use strict';var Sequelize=require('sequelize');module[_0x4b25('0x0')]={'name':{'type':Sequelize[_0x4b25('0x1')],'unique':_0x4b25('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4b25('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x4b25('0x1')]},'original_format':{'type':Sequelize[_0x4b25('0x1')]},'original_duration':{'type':Sequelize[_0x4b25('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4b25('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x4b25('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4b25('0x5')]},'converted_format':{'type':Sequelize[_0x4b25('0x1')]},'converted_duration':{'type':Sequelize[_0x4b25('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x4b25('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x4b25('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x4b25('0x5')]}};
\ No newline at end of file
+var _0x0da8=['STRING','name','BIGINT','INTEGER','FLOAT','sequelize','exports'];(function(_0x48a766,_0x2b095a){var _0x4a2207=function(_0x5ad397){while(--_0x5ad397){_0x48a766['push'](_0x48a766['shift']());}};_0x4a2207(++_0x2b095a);}(_0x0da8,0x1ef));var _0x80da=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x0da8[_0x1d5a32];return _0x361ca0;};'use strict';var Sequelize=require(_0x80da('0x0'));module[_0x80da('0x1')]={'name':{'type':Sequelize[_0x80da('0x2')],'unique':_0x80da('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x80da('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x80da('0x2')]},'original_format':{'type':Sequelize[_0x80da('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x80da('0x4')]},'original_channelCount':{'type':Sequelize[_0x80da('0x5')]},'original_bitRate':{'type':Sequelize[_0x80da('0x4')]},'original_sampleRate':{'type':Sequelize[_0x80da('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x80da('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x80da('0x4')]},'converted_channelCount':{'type':Sequelize[_0x80da('0x5')]},'converted_bitRate':{'type':Sequelize[_0x80da('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 20db9d1..c83cd75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f37=['filters','intersection','query','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','length','include','find','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','download','format','%s.%s','create','basename','file','extname','filename','originalname','wav','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','bitRate','converted_sampleRate','0777','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','pick','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','get','Sounds','destroy','status','end','stack','name','index','map','Sound','rawAttributes','fieldName','type','model'];(function(_0x41efee,_0x3b1307){var _0x5c9862=function(_0x59948d){while(--_0x59948d){_0x41efee['push'](_0x41efee['shift']());}};_0x5c9862(++_0x3b1307);}(_0x1f37,0x140));var _0x71f3=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x1f37[_0x26f1b2];return _0x1624a4;};'use strict';var emlformat=require(_0x71f3('0x0'));var rimraf=require(_0x71f3('0x1'));var zipdir=require(_0x71f3('0x2'));var jsonpatch=require(_0x71f3('0x3'));var rp=require('request-promise');var moment=require(_0x71f3('0x4'));var BPromise=require(_0x71f3('0x5'));var Mustache=require(_0x71f3('0x6'));var util=require(_0x71f3('0x7'));var path=require(_0x71f3('0x8'));var sox=require(_0x71f3('0x9'));var csv=require(_0x71f3('0xa'));var ejs=require(_0x71f3('0xb'));var fs=require('fs');var fs_extra=require(_0x71f3('0xc'));var _=require(_0x71f3('0xd'));var squel=require(_0x71f3('0xe'));var crypto=require(_0x71f3('0xf'));var jsforce=require(_0x71f3('0x10'));var deskjs=require(_0x71f3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x71f3('0x12'));var Papa=require(_0x71f3('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x71f3('0x14'));var as=require(_0x71f3('0x15'));var hardwareService=require(_0x71f3('0x16'));var logger=require('../../config/logger')(_0x71f3('0x17'));var utils=require(_0x71f3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x71f3('0x19'));var db=require(_0x71f3('0x1a'))['db'];function respondWithStatusCode(_0x45deef,_0x2277dc){_0x2277dc=_0x2277dc||0xcc;return function(_0x91ebf4){if(_0x91ebf4){return _0x45deef[_0x71f3('0x1b')](_0x2277dc);}return _0x45deef['status'](_0x2277dc)['end']();};}function respondWithResult(_0x573090,_0x265e41){_0x265e41=_0x265e41||0xc8;return function(_0x4fb8bb){if(_0x4fb8bb){return _0x573090['status'](_0x265e41)[_0x71f3('0x1c')](_0x4fb8bb);}};}function respondWithFilteredResult(_0x3b112d,_0x291cc6){return function(_0x2060d8){if(_0x2060d8){var _0x2ffa2d=typeof _0x291cc6[_0x71f3('0x1d')]==='undefined'&&typeof _0x291cc6[_0x71f3('0x1e')]===_0x71f3('0x1f');var _0x1eef02=_0x2060d8[_0x71f3('0x20')];var _0x480570=_0x2ffa2d?0x0:_0x291cc6[_0x71f3('0x1d')];var _0x7865b3=_0x2ffa2d?_0x2060d8[_0x71f3('0x20')]:_0x291cc6['offset']+_0x291cc6[_0x71f3('0x1e')];var _0xed3819;if(_0x7865b3>=_0x1eef02){_0x7865b3=_0x1eef02;_0xed3819=0xc8;}else{_0xed3819=0xce;}_0x3b112d['status'](_0xed3819);return _0x3b112d[_0x71f3('0x21')](_0x71f3('0x22'),_0x480570+'-'+_0x7865b3+'/'+_0x1eef02)[_0x71f3('0x1c')](_0x2060d8);}return null;};}function patchUpdates(_0x3ffa85){return function(_0xf449d2){try{jsonpatch['apply'](_0xf449d2,_0x3ffa85,!![]);}catch(_0x25bc77){return BPromise[_0x71f3('0x23')](_0x25bc77);}return _0xf449d2['save']();};}function saveUpdates(_0x3c6407,_0x4e2ddf){return function(_0x585382){if(_0x585382){return _0x585382[_0x71f3('0x24')](_0x3c6407)[_0x71f3('0x25')](function(_0x581843){return _0x581843;});}return null;};}function removeEntity(_0x441d44,_0x56a27e){return function(_0x2f0253){if(_0x2f0253){return _0x2f0253['destroy']()[_0x71f3('0x25')](function(){var _0x3e992a=_0x2f0253[_0x71f3('0x26')]({'plain':!![]});var _0x93c408=_0x71f3('0x27');return db['UserProfileResource'][_0x71f3('0x28')]({'where':{'type':_0x93c408,'resourceId':_0x3e992a['id']}})[_0x71f3('0x25')](function(){return _0x2f0253;});})['then'](function(){_0x441d44[_0x71f3('0x29')](0xcc)[_0x71f3('0x2a')]();});}};}function handleEntityNotFound(_0x371896,_0x2d197c){return function(_0x269753){if(!_0x269753){_0x371896[_0x71f3('0x1b')](0x194);}return _0x269753;};}function handleError(_0x266444,_0x248197){_0x248197=_0x248197||0x1f4;return function(_0x40523e){logger['error'](_0x40523e[_0x71f3('0x2b')]);if(_0x40523e[_0x71f3('0x2c')]){delete _0x40523e[_0x71f3('0x2c')];}_0x266444['status'](_0x248197)['send'](_0x40523e);};}exports[_0x71f3('0x2d')]=function(_0x5b6b94,_0x1b337e){var _0x557888={},_0x59681b={},_0xbbd0d1={'count':0x0,'rows':[]};var _0x2c7f56=_[_0x71f3('0x2e')](db[_0x71f3('0x2f')][_0x71f3('0x30')],function(_0x36992c){return{'name':_0x36992c[_0x71f3('0x31')],'type':_0x36992c[_0x71f3('0x32')]['key']};});_0x59681b[_0x71f3('0x33')]=_[_0x71f3('0x2e')](_0x2c7f56,_0x71f3('0x2c'));_0x59681b['query']=_['keys'](_0x5b6b94['query']);_0x59681b[_0x71f3('0x34')]=_[_0x71f3('0x35')](_0x59681b[_0x71f3('0x33')],_0x59681b[_0x71f3('0x36')]);_0x557888[_0x71f3('0x37')]=_[_0x71f3('0x35')](_0x59681b[_0x71f3('0x33')],qs[_0x71f3('0x38')](_0x5b6b94[_0x71f3('0x36')][_0x71f3('0x38')]));_0x557888[_0x71f3('0x37')]=_0x557888['attributes']['length']?_0x557888['attributes']:_0x59681b[_0x71f3('0x33')];if(!_0x5b6b94[_0x71f3('0x36')]['hasOwnProperty'](_0x71f3('0x39'))){_0x557888[_0x71f3('0x1e')]=qs[_0x71f3('0x1e')](_0x5b6b94[_0x71f3('0x36')][_0x71f3('0x1e')]);_0x557888['offset']=qs[_0x71f3('0x1d')](_0x5b6b94['query'][_0x71f3('0x1d')]);}_0x557888[_0x71f3('0x3a')]=qs[_0x71f3('0x3b')](_0x5b6b94[_0x71f3('0x36')][_0x71f3('0x3b')]);_0x557888['where']=qs[_0x71f3('0x34')](_['pick'](_0x5b6b94[_0x71f3('0x36')],_0x59681b[_0x71f3('0x34')]),_0x2c7f56);if(_0x5b6b94[_0x71f3('0x36')][_0x71f3('0x3c')]){_0x557888[_0x71f3('0x3d')]=_[_0x71f3('0x3e')](_0x557888[_0x71f3('0x3d')],{'$or':_['map'](_0x2c7f56,function(_0x5ae821){if(_0x5ae821['type']!==_0x71f3('0x3f')){var _0x46f091={};_0x46f091[_0x5ae821[_0x71f3('0x2c')]]={'$like':'%'+_0x5b6b94[_0x71f3('0x36')][_0x71f3('0x3c')]+'%'};return _0x46f091;}})});}_0x557888=_[_0x71f3('0x3e')]({},_0x557888,_0x5b6b94[_0x71f3('0x40')]);var _0x319b2b={'where':_0x557888['where']};return db[_0x71f3('0x2f')][_0x71f3('0x20')](_0x319b2b)[_0x71f3('0x25')](function(_0x2298db){_0xbbd0d1[_0x71f3('0x20')]=_0x2298db;if(_0x5b6b94[_0x71f3('0x36')][_0x71f3('0x41')]){_0x557888['include']=[{'all':!![]}];}return db[_0x71f3('0x2f')]['findAll'](_0x557888);})[_0x71f3('0x25')](function(_0x5f1f22){_0xbbd0d1[_0x71f3('0x42')]=_0x5f1f22;return _0xbbd0d1;})[_0x71f3('0x25')](respondWithFilteredResult(_0x1b337e,_0x557888))[_0x71f3('0x43')](handleError(_0x1b337e,null));};exports[_0x71f3('0x44')]=function(_0x6ba0eb,_0x48b808){var _0x572108={'raw':!![],'where':{'id':_0x6ba0eb[_0x71f3('0x45')]['id']}},_0x5721e0={};_0x5721e0['model']=_[_0x71f3('0x46')](db['Sound'][_0x71f3('0x30')]);_0x5721e0[_0x71f3('0x36')]=_['keys'](_0x6ba0eb[_0x71f3('0x36')]);_0x5721e0[_0x71f3('0x34')]=_['intersection'](_0x5721e0['model'],_0x5721e0['query']);_0x572108[_0x71f3('0x37')]=_['intersection'](_0x5721e0[_0x71f3('0x33')],qs[_0x71f3('0x38')](_0x6ba0eb[_0x71f3('0x36')][_0x71f3('0x38')]));_0x572108[_0x71f3('0x37')]=_0x572108['attributes'][_0x71f3('0x47')]?_0x572108[_0x71f3('0x37')]:_0x5721e0[_0x71f3('0x33')];if(_0x6ba0eb[_0x71f3('0x36')][_0x71f3('0x41')]){_0x572108[_0x71f3('0x48')]=[{'all':!![]}];}_0x572108=_[_0x71f3('0x3e')]({},_0x572108,_0x6ba0eb[_0x71f3('0x40')]);return db['Sound'][_0x71f3('0x49')](_0x572108)['then'](handleEntityNotFound(_0x48b808,null))[_0x71f3('0x25')](respondWithResult(_0x48b808,null))['catch'](handleError(_0x48b808,null));};exports['download']=function(_0x33bac8,_0x3c2e43,_0x3d041f){return db[_0x71f3('0x2f')][_0x71f3('0x49')]({'where':{'id':_0x33bac8[_0x71f3('0x45')]['id']},'attributes':[_0x71f3('0x2c'),'save_name',_0x71f3('0x4a')],'raw':!![]})[_0x71f3('0x25')](handleEntityNotFound(_0x3c2e43,null))[_0x71f3('0x25')](function(_0x3d480b){if(_0x3d480b){if(!fs['existsSync'](path[_0x71f3('0x4b')](config[_0x71f3('0x4c')],_0x71f3('0x4d'),_0x3d480b[_0x71f3('0x4e')]+'.'+_0x3d480b['converted_format']))){throw new db[(_0x71f3('0x4f'))][(_0x71f3('0x50'))]('Sound\x20not\x20found');}return _0x3c2e43[_0x71f3('0x51')](path[_0x71f3('0x4b')](config[_0x71f3('0x4c')],_0x71f3('0x4d'),util[_0x71f3('0x52')](_0x71f3('0x53'),_0x3d480b[_0x71f3('0x4e')],_0x3d480b[_0x71f3('0x4a')])),util[_0x71f3('0x52')]('%s.%s',_0x3d480b[_0x71f3('0x2c')],_0x3d480b[_0x71f3('0x4a')]));}return null;})[_0x71f3('0x43')](handleError(_0x3c2e43,null));};exports[_0x71f3('0x54')]=function(_0x271991,_0x114acd,_0x37028e){var _0x5c3955={'name':path[_0x71f3('0x55')](_0x271991[_0x71f3('0x56')]['originalname'],path[_0x71f3('0x57')](_0x271991[_0x71f3('0x56')]['originalname'])),'save_name':path[_0x71f3('0x55')](_0x271991['file'][_0x71f3('0x58')],path[_0x71f3('0x57')](_0x271991[_0x71f3('0x56')]['filename'])),'original_format':path[_0x71f3('0x57')](_0x271991[_0x71f3('0x56')][_0x71f3('0x59')])['substring'](0x1),'converted_format':_0x71f3('0x5a')};var _0x2a9a8b=path['join'](config[_0x71f3('0x4c')],'server/files/sounds/original',_0x271991[_0x71f3('0x56')][_0x71f3('0x58')]);var _0x1691bc=path[_0x71f3('0x4b')](config[_0x71f3('0x4c')],'server/files/sounds/converted',util[_0x71f3('0x52')](_0x71f3('0x53'),path[_0x71f3('0x55')](_0x271991[_0x71f3('0x56')][_0x71f3('0x58')],path[_0x71f3('0x57')](_0x271991['file'][_0x71f3('0x58')])),_0x5c3955[_0x71f3('0x4a')]));logger[_0x71f3('0x5b')](_0x71f3('0x5c'),_0x2a9a8b);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x1691bc);try{fs[_0x71f3('0x5d')](_0x2a9a8b,parseInt('0777',0x8));var _0x789524=sox[_0x71f3('0x5e')](_0x2a9a8b,_0x1691bc,{'sampleRate':0x1f40,'format':_0x71f3('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x789524['on']('error',function(_0x486be8){fs[_0x71f3('0x5f')](_0x2a9a8b);_0x114acd[_0x71f3('0x29')](0x1f4)['send'](_0x486be8);});_0x789524['on'](_0x71f3('0x60'),function(_0x3f5f50){_0x5c3955[_0x71f3('0x61')]=isNaN(_0x3f5f50[_0x71f3('0x62')])?null:_0x3f5f50[_0x71f3('0x62')]*0x3e8;_0x5c3955[_0x71f3('0x63')]=isNaN(_0x3f5f50[_0x71f3('0x64')])?null:_0x3f5f50[_0x71f3('0x64')];_0x5c3955[_0x71f3('0x65')]=isNaN(_0x3f5f50[_0x71f3('0x66')])?null:_0x3f5f50['channelCount'];_0x5c3955['original_bitRate']=isNaN(_0x3f5f50['bitRate'])?null:_0x3f5f50['bitRate'];_0x5c3955[_0x71f3('0x67')]=isNaN(_0x3f5f50[_0x71f3('0x68')])?null:_0x3f5f50['sampleRate'];});_0x789524['on'](_0x71f3('0x69'),function(_0x72f88c){_0x5c3955[_0x71f3('0x6a')]=isNaN(_0x72f88c[_0x71f3('0x62')])?null:_0x72f88c[_0x71f3('0x62')]*0x3e8;_0x5c3955[_0x71f3('0x6b')]=isNaN(_0x72f88c['sampleCount'])?null:_0x72f88c[_0x71f3('0x64')];_0x5c3955[_0x71f3('0x6c')]=isNaN(_0x72f88c[_0x71f3('0x66')])?null:_0x72f88c[_0x71f3('0x66')];_0x5c3955['converted_bitRate']=isNaN(_0x72f88c[_0x71f3('0x6d')])?null:_0x72f88c[_0x71f3('0x6d')];_0x5c3955[_0x71f3('0x6e')]=isNaN(_0x72f88c[_0x71f3('0x68')])?null:_0x72f88c['sampleRate'];});_0x789524['on']('end',function(){fs[_0x71f3('0x5d')](_0x1691bc,parseInt(_0x71f3('0x6f'),0x8));return db[_0x71f3('0x2f')]['create'](_0x5c3955)[_0x71f3('0x25')](function(_0x2a6d8b){var _0x2bc530={'role':_0x271991[_0x71f3('0x70')]['role'],'userProfileId':_0x271991[_0x71f3('0x70')]['userProfileId']};if(!_0x2bc530)throw new Error(_0x71f3('0x71'));if(_0x2bc530[_0x71f3('0x72')]===_0x71f3('0x73')){var _0x2e7352=_0x2a6d8b[_0x71f3('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x71f3('0x49')]({'where':{'name':'Sounds','userProfileId':_0x2bc530[_0x71f3('0x74')]},'raw':!![]})[_0x71f3('0x25')](function(_0x3b2226){if(_0x3b2226&&_0x3b2226['autoAssociation']===0x0){return db[_0x71f3('0x75')]['create']({'name':_0x2e7352[_0x71f3('0x2c')],'resourceId':_0x2e7352['id'],'type':_0x3b2226[_0x71f3('0x2c')],'sectionId':_0x3b2226['id']},{})[_0x71f3('0x25')](function(){return _0x2a6d8b;});}else{return _0x2a6d8b;}})[_0x71f3('0x43')](function(_0x2b5c5f){logger[_0x71f3('0x76')](_0x71f3('0x77'),_0x2b5c5f);throw _0x2b5c5f;});}return _0x2a6d8b;})['then'](respondWithResult(_0x114acd,null))[_0x71f3('0x43')](handleError(_0x114acd,null));});_0x789524['start']();}catch(_0x527602){_0x114acd['status'](0x1f4)[_0x71f3('0x78')](_0x527602);}};exports[_0x71f3('0x24')]=function(_0x290eaf,_0x41168a,_0x226dc9){return db[_0x71f3('0x2f')][_0x71f3('0x49')]({'where':{'id':_0x290eaf[_0x71f3('0x45')]['id']}})[_0x71f3('0x25')](handleEntityNotFound(_0x41168a,null))['then'](saveUpdates(_[_0x71f3('0x79')](_0x290eaf['body'],[_0x71f3('0x2c'),'description']),null))[_0x71f3('0x25')](respondWithResult(_0x41168a,null))[_0x71f3('0x43')](handleError(_0x41168a,null));};exports['delete']=function(_0x4a6c0d,_0x112271,_0x366e51){return db[_0x71f3('0x2f')][_0x71f3('0x49')]({'where':{'id':_0x4a6c0d[_0x71f3('0x45')]['id']}})[_0x71f3('0x25')](function(_0x4d425b){if(_0x4d425b){return _0x4d425b[_0x71f3('0x28')]();}})[_0x71f3('0x25')](function(_0x1851cc){var _0x52346b=path[_0x71f3('0x4b')](config[_0x71f3('0x4c')],_0x71f3('0x7a'),util[_0x71f3('0x52')](_0x71f3('0x53'),_0x1851cc['save_name'],_0x1851cc[_0x71f3('0x7b')]));var _0x476fa2=path[_0x71f3('0x4b')](config['root'],_0x71f3('0x4d'),util[_0x71f3('0x52')](_0x71f3('0x53'),_0x1851cc[_0x71f3('0x4e')],_0x1851cc[_0x71f3('0x4a')]));fs['unlinkSync'](_0x52346b);fs[_0x71f3('0x5f')](_0x476fa2);return _0x1851cc;})[_0x71f3('0x25')](function(_0x18d60){if(_0x18d60){return _0x112271[_0x71f3('0x29')](0xcc)[_0x71f3('0x2a')]();}})['then'](handleEntityNotFound(_0x112271,null))[_0x71f3('0x43')](handleError(_0x112271,null));};
\ No newline at end of file
+var _0x7478=['substring','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','wav','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','offset','set','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','show','keys','find','params','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','download','format','%s.%s','catch','create','basename','originalname','file','filename','extname'];(function(_0x5d74f1,_0x231020){var _0x5c6b5d=function(_0x5a19ed){while(--_0x5a19ed){_0x5d74f1['push'](_0x5d74f1['shift']());}};_0x5c6b5d(++_0x231020);}(_0x7478,0x10f));var _0x8747=function(_0xfa696f,_0x573390){_0xfa696f=_0xfa696f-0x0;var _0x13bcfb=_0x7478[_0xfa696f];return _0x13bcfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8747('0x0'));var zipdir=require(_0x8747('0x1'));var jsonpatch=require(_0x8747('0x2'));var rp=require(_0x8747('0x3'));var moment=require(_0x8747('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8747('0x5'));var util=require(_0x8747('0x6'));var path=require(_0x8747('0x7'));var sox=require(_0x8747('0x8'));var csv=require('to-csv');var ejs=require(_0x8747('0x9'));var fs=require('fs');var fs_extra=require(_0x8747('0xa'));var _=require(_0x8747('0xb'));var squel=require(_0x8747('0xc'));var crypto=require(_0x8747('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8747('0xe'));var toCsv=require(_0x8747('0xf'));var querystring=require(_0x8747('0x10'));var Papa=require('papaparse');var Redis=require(_0x8747('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8747('0x12'));var logger=require(_0x8747('0x13'))('api');var utils=require(_0x8747('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8747('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x111afa,_0x4a9701){_0x4a9701=_0x4a9701||0xcc;return function(_0x427d6c){if(_0x427d6c){return _0x111afa[_0x8747('0x16')](_0x4a9701);}return _0x111afa[_0x8747('0x17')](_0x4a9701)[_0x8747('0x18')]();};}function respondWithResult(_0x3adeb7,_0x5b9330){_0x5b9330=_0x5b9330||0xc8;return function(_0x2383b3){if(_0x2383b3){return _0x3adeb7[_0x8747('0x17')](_0x5b9330)[_0x8747('0x19')](_0x2383b3);}};}function respondWithFilteredResult(_0x1dac54,_0x530a25){return function(_0xfb4b){if(_0xfb4b){var _0x9403ff=typeof _0x530a25['offset']==='undefined'&&typeof _0x530a25['limit']===_0x8747('0x1a');var _0x553da4=_0xfb4b['count'];var _0x4008cd=_0x9403ff?0x0:_0x530a25['offset'];var _0x3e683e=_0x9403ff?_0xfb4b['count']:_0x530a25[_0x8747('0x1b')]+_0x530a25['limit'];var _0x3ba9c2;if(_0x3e683e>=_0x553da4){_0x3e683e=_0x553da4;_0x3ba9c2=0xc8;}else{_0x3ba9c2=0xce;}_0x1dac54[_0x8747('0x17')](_0x3ba9c2);return _0x1dac54[_0x8747('0x1c')](_0x8747('0x1d'),_0x4008cd+'-'+_0x3e683e+'/'+_0x553da4)['json'](_0xfb4b);}return null;};}function patchUpdates(_0x5a4ae2){return function(_0x59f3c5){try{jsonpatch[_0x8747('0x1e')](_0x59f3c5,_0x5a4ae2,!![]);}catch(_0x5ec47d){return BPromise[_0x8747('0x1f')](_0x5ec47d);}return _0x59f3c5['save']();};}function saveUpdates(_0x41b023,_0xb73959){return function(_0x2a64be){if(_0x2a64be){return _0x2a64be[_0x8747('0x20')](_0x41b023)[_0x8747('0x21')](function(_0x570d49){return _0x570d49;});}return null;};}function removeEntity(_0xab2b87,_0xfb122a){return function(_0x4e3cd0){if(_0x4e3cd0){return _0x4e3cd0[_0x8747('0x22')]()[_0x8747('0x21')](function(){var _0x300db7=_0x4e3cd0[_0x8747('0x23')]({'plain':!![]});var _0x5773f7='Sounds';return db['UserProfileResource'][_0x8747('0x22')]({'where':{'type':_0x5773f7,'resourceId':_0x300db7['id']}})[_0x8747('0x21')](function(){return _0x4e3cd0;});})[_0x8747('0x21')](function(){_0xab2b87[_0x8747('0x17')](0xcc)[_0x8747('0x18')]();});}};}function handleEntityNotFound(_0x13df17,_0x4fddd6){return function(_0x4b232f){if(!_0x4b232f){_0x13df17[_0x8747('0x16')](0x194);}return _0x4b232f;};}function handleError(_0x3331ba,_0x11e22f){_0x11e22f=_0x11e22f||0x1f4;return function(_0x347965){logger[_0x8747('0x24')](_0x347965[_0x8747('0x25')]);if(_0x347965[_0x8747('0x26')]){delete _0x347965['name'];}_0x3331ba['status'](_0x11e22f)[_0x8747('0x27')](_0x347965);};}exports[_0x8747('0x28')]=function(_0x1f7f7d,_0x35cde5){var _0x48601e={},_0x40079a={},_0x393959={'count':0x0,'rows':[]};var _0x2f257c=_[_0x8747('0x29')](db[_0x8747('0x2a')][_0x8747('0x2b')],function(_0x3dabd1){return{'name':_0x3dabd1[_0x8747('0x2c')],'type':_0x3dabd1[_0x8747('0x2d')][_0x8747('0x2e')]};});_0x40079a[_0x8747('0x2f')]=_['map'](_0x2f257c,_0x8747('0x26'));_0x40079a[_0x8747('0x30')]=_['keys'](_0x1f7f7d[_0x8747('0x30')]);_0x40079a[_0x8747('0x31')]=_[_0x8747('0x32')](_0x40079a[_0x8747('0x2f')],_0x40079a[_0x8747('0x30')]);_0x48601e[_0x8747('0x33')]=_[_0x8747('0x32')](_0x40079a['model'],qs[_0x8747('0x34')](_0x1f7f7d[_0x8747('0x30')]['fields']));_0x48601e[_0x8747('0x33')]=_0x48601e['attributes'][_0x8747('0x35')]?_0x48601e[_0x8747('0x33')]:_0x40079a['model'];if(!_0x1f7f7d['query'][_0x8747('0x36')](_0x8747('0x37'))){_0x48601e[_0x8747('0x38')]=qs[_0x8747('0x38')](_0x1f7f7d[_0x8747('0x30')][_0x8747('0x38')]);_0x48601e[_0x8747('0x1b')]=qs[_0x8747('0x1b')](_0x1f7f7d['query']['offset']);}_0x48601e[_0x8747('0x39')]=qs[_0x8747('0x3a')](_0x1f7f7d['query'][_0x8747('0x3a')]);_0x48601e[_0x8747('0x3b')]=qs[_0x8747('0x31')](_[_0x8747('0x3c')](_0x1f7f7d['query'],_0x40079a[_0x8747('0x31')]),_0x2f257c);if(_0x1f7f7d[_0x8747('0x30')][_0x8747('0x3d')]){_0x48601e[_0x8747('0x3b')]=_[_0x8747('0x3e')](_0x48601e[_0x8747('0x3b')],{'$or':_['map'](_0x2f257c,function(_0x447c19){if(_0x447c19[_0x8747('0x2d')]!=='VIRTUAL'){var _0xb6c84d={};_0xb6c84d[_0x447c19[_0x8747('0x26')]]={'$like':'%'+_0x1f7f7d[_0x8747('0x30')]['filter']+'%'};return _0xb6c84d;}})});}_0x48601e=_[_0x8747('0x3e')]({},_0x48601e,_0x1f7f7d[_0x8747('0x3f')]);var _0x41d217={'where':_0x48601e[_0x8747('0x3b')]};return db[_0x8747('0x2a')][_0x8747('0x40')](_0x41d217)[_0x8747('0x21')](function(_0x441173){_0x393959[_0x8747('0x40')]=_0x441173;if(_0x1f7f7d[_0x8747('0x30')][_0x8747('0x41')]){_0x48601e[_0x8747('0x42')]=[{'all':!![]}];}return db[_0x8747('0x2a')]['findAll'](_0x48601e);})['then'](function(_0x397c12){_0x393959[_0x8747('0x43')]=_0x397c12;return _0x393959;})[_0x8747('0x21')](respondWithFilteredResult(_0x35cde5,_0x48601e))['catch'](handleError(_0x35cde5,null));};exports[_0x8747('0x44')]=function(_0x295dc5,_0x3fa6ea){var _0x143b34={'raw':!![],'where':{'id':_0x295dc5['params']['id']}},_0x483af2={};_0x483af2['model']=_[_0x8747('0x45')](db['Sound'][_0x8747('0x2b')]);_0x483af2['query']=_[_0x8747('0x45')](_0x295dc5[_0x8747('0x30')]);_0x483af2[_0x8747('0x31')]=_['intersection'](_0x483af2['model'],_0x483af2['query']);_0x143b34[_0x8747('0x33')]=_[_0x8747('0x32')](_0x483af2[_0x8747('0x2f')],qs['fields'](_0x295dc5[_0x8747('0x30')]['fields']));_0x143b34['attributes']=_0x143b34[_0x8747('0x33')][_0x8747('0x35')]?_0x143b34[_0x8747('0x33')]:_0x483af2[_0x8747('0x2f')];if(_0x295dc5['query']['includeAll']){_0x143b34['include']=[{'all':!![]}];}_0x143b34=_[_0x8747('0x3e')]({},_0x143b34,_0x295dc5[_0x8747('0x3f')]);return db[_0x8747('0x2a')][_0x8747('0x46')](_0x143b34)[_0x8747('0x21')](handleEntityNotFound(_0x3fa6ea,null))[_0x8747('0x21')](respondWithResult(_0x3fa6ea,null))['catch'](handleError(_0x3fa6ea,null));};exports['download']=function(_0xe5aab9,_0x533f14,_0x9b5221){return db['Sound']['find']({'where':{'id':_0xe5aab9[_0x8747('0x47')]['id']},'attributes':[_0x8747('0x26'),_0x8747('0x48'),_0x8747('0x49')],'raw':!![]})[_0x8747('0x21')](handleEntityNotFound(_0x533f14,null))[_0x8747('0x21')](function(_0x48ab3f){if(_0x48ab3f){if(!fs['existsSync'](path[_0x8747('0x4a')](config[_0x8747('0x4b')],_0x8747('0x4c'),_0x48ab3f[_0x8747('0x48')]+'.'+_0x48ab3f[_0x8747('0x49')]))){throw new db[(_0x8747('0x4d'))]['ValidationError'](_0x8747('0x4e'));}return _0x533f14[_0x8747('0x4f')](path[_0x8747('0x4a')](config[_0x8747('0x4b')],_0x8747('0x4c'),util[_0x8747('0x50')](_0x8747('0x51'),_0x48ab3f[_0x8747('0x48')],_0x48ab3f[_0x8747('0x49')])),util[_0x8747('0x50')](_0x8747('0x51'),_0x48ab3f['name'],_0x48ab3f[_0x8747('0x49')]));}return null;})[_0x8747('0x52')](handleError(_0x533f14,null));};exports[_0x8747('0x53')]=function(_0x24c817,_0x39c232,_0xdeae1e){var _0x4f2eba={'name':path[_0x8747('0x54')](_0x24c817['file'][_0x8747('0x55')],path['extname'](_0x24c817['file'][_0x8747('0x55')])),'save_name':path[_0x8747('0x54')](_0x24c817[_0x8747('0x56')][_0x8747('0x57')],path[_0x8747('0x58')](_0x24c817[_0x8747('0x56')]['filename'])),'original_format':path[_0x8747('0x58')](_0x24c817[_0x8747('0x56')]['originalname'])[_0x8747('0x59')](0x1),'converted_format':'wav'};var _0x1cb0f6=path[_0x8747('0x4a')](config[_0x8747('0x4b')],_0x8747('0x5a'),_0x24c817[_0x8747('0x56')][_0x8747('0x57')]);var _0x2187ba=path[_0x8747('0x4a')](config[_0x8747('0x4b')],'server/files/sounds/converted',util[_0x8747('0x50')](_0x8747('0x51'),path[_0x8747('0x54')](_0x24c817['file']['filename'],path[_0x8747('0x58')](_0x24c817[_0x8747('0x56')][_0x8747('0x57')])),_0x4f2eba[_0x8747('0x49')]));logger[_0x8747('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x1cb0f6);logger[_0x8747('0x5b')](_0x8747('0x5c'),_0x2187ba);try{fs['chmodSync'](_0x1cb0f6,parseInt(_0x8747('0x5d'),0x8));var _0x3fdcae=sox['transcode'](_0x1cb0f6,_0x2187ba,{'sampleRate':0x1f40,'format':_0x8747('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3fdcae['on'](_0x8747('0x24'),function(_0x3a819b){fs[_0x8747('0x5f')](_0x1cb0f6);_0x39c232[_0x8747('0x17')](0x1f4)[_0x8747('0x27')](_0x3a819b);});_0x3fdcae['on'](_0x8747('0x60'),function(_0x513770){_0x4f2eba[_0x8747('0x61')]=isNaN(_0x513770[_0x8747('0x62')])?null:_0x513770[_0x8747('0x62')]*0x3e8;_0x4f2eba['original_sampleCount']=isNaN(_0x513770[_0x8747('0x63')])?null:_0x513770[_0x8747('0x63')];_0x4f2eba[_0x8747('0x64')]=isNaN(_0x513770[_0x8747('0x65')])?null:_0x513770[_0x8747('0x65')];_0x4f2eba[_0x8747('0x66')]=isNaN(_0x513770['bitRate'])?null:_0x513770[_0x8747('0x67')];_0x4f2eba[_0x8747('0x68')]=isNaN(_0x513770[_0x8747('0x69')])?null:_0x513770[_0x8747('0x69')];});_0x3fdcae['on'](_0x8747('0x6a'),function(_0x120a46){_0x4f2eba[_0x8747('0x6b')]=isNaN(_0x120a46[_0x8747('0x62')])?null:_0x120a46[_0x8747('0x62')]*0x3e8;_0x4f2eba[_0x8747('0x6c')]=isNaN(_0x120a46['sampleCount'])?null:_0x120a46[_0x8747('0x63')];_0x4f2eba['converted_channelCount']=isNaN(_0x120a46[_0x8747('0x65')])?null:_0x120a46['channelCount'];_0x4f2eba['converted_bitRate']=isNaN(_0x120a46[_0x8747('0x67')])?null:_0x120a46[_0x8747('0x67')];_0x4f2eba['converted_sampleRate']=isNaN(_0x120a46[_0x8747('0x69')])?null:_0x120a46[_0x8747('0x69')];});_0x3fdcae['on'](_0x8747('0x18'),function(){fs['chmodSync'](_0x2187ba,parseInt(_0x8747('0x5d'),0x8));return db['Sound']['create'](_0x4f2eba)[_0x8747('0x21')](function(_0x29e0d6){var _0x185795={'role':_0x24c817[_0x8747('0x6d')]['role'],'userProfileId':_0x24c817[_0x8747('0x6d')]['userProfileId']};if(!_0x185795)throw new Error(_0x8747('0x6e'));if(_0x185795[_0x8747('0x6f')]===_0x8747('0x70')){var _0x267c31=_0x29e0d6[_0x8747('0x23')]({'plain':!![]});return db[_0x8747('0x71')]['find']({'where':{'name':_0x8747('0x72'),'userProfileId':_0x185795['userProfileId']},'raw':!![]})[_0x8747('0x21')](function(_0x56fdfc){if(_0x56fdfc&&_0x56fdfc[_0x8747('0x73')]===0x0){return db['UserProfileResource']['create']({'name':_0x267c31[_0x8747('0x26')],'resourceId':_0x267c31['id'],'type':_0x56fdfc[_0x8747('0x26')],'sectionId':_0x56fdfc['id']},{})['then'](function(){return _0x29e0d6;});}else{return _0x29e0d6;}})[_0x8747('0x52')](function(_0x122ed1){logger[_0x8747('0x24')](_0x8747('0x74'),_0x122ed1);throw _0x122ed1;});}return _0x29e0d6;})['then'](respondWithResult(_0x39c232,null))['catch'](handleError(_0x39c232,null));});_0x3fdcae['start']();}catch(_0x27703f){_0x39c232['status'](0x1f4)[_0x8747('0x27')](_0x27703f);}};exports[_0x8747('0x20')]=function(_0x2dd528,_0x3da7db,_0x142454){return db[_0x8747('0x2a')][_0x8747('0x46')]({'where':{'id':_0x2dd528[_0x8747('0x47')]['id']}})[_0x8747('0x21')](handleEntityNotFound(_0x3da7db,null))[_0x8747('0x21')](saveUpdates(_[_0x8747('0x3c')](_0x2dd528[_0x8747('0x6d')],[_0x8747('0x26'),_0x8747('0x75')]),null))[_0x8747('0x21')](respondWithResult(_0x3da7db,null))[_0x8747('0x52')](handleError(_0x3da7db,null));};exports[_0x8747('0x76')]=function(_0x1c5f82,_0x33a040,_0x29f92e){return db['Sound'][_0x8747('0x46')]({'where':{'id':_0x1c5f82['params']['id']}})[_0x8747('0x21')](function(_0x9e1c16){if(_0x9e1c16){return _0x9e1c16[_0x8747('0x22')]();}})[_0x8747('0x21')](function(_0x6a3f28){var _0x3424a2=path[_0x8747('0x4a')](config[_0x8747('0x4b')],_0x8747('0x5a'),util['format'](_0x8747('0x51'),_0x6a3f28[_0x8747('0x48')],_0x6a3f28[_0x8747('0x77')]));var _0x145030=path['join'](config[_0x8747('0x4b')],_0x8747('0x4c'),util['format'](_0x8747('0x51'),_0x6a3f28[_0x8747('0x48')],_0x6a3f28[_0x8747('0x49')]));fs[_0x8747('0x5f')](_0x3424a2);fs[_0x8747('0x5f')](_0x145030);return _0x6a3f28;})[_0x8747('0x21')](function(_0xbc1d24){if(_0xbc1d24){return _0x33a040[_0x8747('0x17')](0xcc)[_0x8747('0x18')]();}})[_0x8747('0x21')](handleEntityNotFound(_0x33a040,null))[_0x8747('0x52')](handleError(_0x33a040,null));};
\ No newline at end of file
index 61e980a..ab03d67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d5b=['api','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x3deef8,_0x2c67a7){var _0x4a9b70=function(_0x20a24b){while(--_0x20a24b){_0x3deef8['push'](_0x3deef8['shift']());}};_0x4a9b70(++_0x2c67a7);}(_0x5d5b,0x65));var _0xb5d5=function(_0x22ce88,_0x2e4fac){_0x22ce88=_0x22ce88-0x0;var _0x2b585f=_0x5d5b[_0x22ce88];return _0x2b585f;};'use strict';var _=require(_0xb5d5('0x0'));var util=require(_0xb5d5('0x1'));var logger=require(_0xb5d5('0x2'))(_0xb5d5('0x3'));var moment=require(_0xb5d5('0x4'));var BPromise=require(_0xb5d5('0x5'));var rp=require(_0xb5d5('0x6'));var fs=require('fs');var path=require(_0xb5d5('0x7'));var rimraf=require('rimraf');var config=require(_0xb5d5('0x8'));var attributes=require(_0xb5d5('0x9'));module['exports']=function(_0x2b82a2,_0xb774db){return _0x2b82a2[_0xb5d5('0xa')](_0xb5d5('0xb'),attributes,{'tableName':_0xb5d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9153=['Sound','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x277858,_0x4645f2){var _0x314790=function(_0x40f620){while(--_0x40f620){_0x277858['push'](_0x277858['shift']());}};_0x314790(++_0x4645f2);}(_0x9153,0xd3));var _0x3915=function(_0x354bce,_0x41340c){_0x354bce=_0x354bce-0x0;var _0x31e738=_0x9153[_0x354bce];return _0x31e738;};'use strict';var _=require('lodash');var util=require(_0x3915('0x0'));var logger=require('../../config/logger')(_0x3915('0x1'));var moment=require(_0x3915('0x2'));var BPromise=require('bluebird');var rp=require(_0x3915('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3915('0x4'));var config=require(_0x3915('0x5'));var attributes=require('./sound.attributes');module['exports']=function(_0x285e37,_0x4b7409){return _0x285e37['define'](_0x3915('0x6'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e2d2004..76c30fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce4a=['Sound,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model','map','then','stringify','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info'];(function(_0x391569,_0x354dfb){var _0x25a0f3=function(_0x4b72ca){while(--_0x4b72ca){_0x391569['push'](_0x391569['shift']());}};_0x25a0f3(++_0x354dfb);}(_0xce4a,0x6e));var _0xace4=function(_0x555ec4,_0x4c93f2){_0x555ec4=_0x555ec4-0x0;var _0x185ff9=_0xce4a[_0x555ec4];return _0x185ff9;};'use strict';var _=require('lodash');var util=require(_0xace4('0x0'));var moment=require('moment');var BPromise=require(_0xace4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xace4('0x2'));var db=require(_0xace4('0x3'))['db'];var utils=require(_0xace4('0x4'));var logger=require(_0xace4('0x5'))(_0xace4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xace4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee6fa,_0x3ecbca,_0x4a6b32){return new BPromise(function(_0x3e7bdc,_0x1de051){return client[_0xace4('0x8')](_0x5ee6fa,_0x4a6b32)['then'](function(_0x2fc4e7){logger[_0xace4('0x9')](_0xace4('0xa'),_0x3ecbca,'request\x20sent');logger[_0xace4('0xb')]('Sound,\x20%s,\x20%s,\x20%s',_0x3ecbca,_0xace4('0xc'),JSON['stringify'](_0x2fc4e7));if(_0x2fc4e7['error']){if(_0x2fc4e7[_0xace4('0xd')][_0xace4('0xe')]===0x1f4){logger[_0xace4('0xd')](_0xace4('0xa'),_0x3ecbca,_0x2fc4e7[_0xace4('0xd')][_0xace4('0xf')]);return _0x1de051(_0x2fc4e7[_0xace4('0xd')][_0xace4('0xf')]);}logger['error'](_0xace4('0xa'),_0x3ecbca,_0x2fc4e7['error'][_0xace4('0xf')]);return _0x3e7bdc(_0x2fc4e7[_0xace4('0xd')][_0xace4('0xf')]);}else{logger[_0xace4('0x9')]('Sound,\x20%s,\x20%s',_0x3ecbca,'request\x20sent');_0x3e7bdc(_0x2fc4e7[_0xace4('0x10')][_0xace4('0xf')]);}})[_0xace4('0x11')](function(_0x4eca30){logger[_0xace4('0xd')](_0xace4('0xa'),_0x3ecbca,_0x4eca30);_0x1de051(_0x4eca30);});});}exports[_0xace4('0x12')]=function(_0x420cb6){var _0x597b3b=this;return new Promise(function(_0x4ebf82,_0xa7109d){return db[_0xace4('0x13')][_0xace4('0x14')]({'raw':_0x420cb6[_0xace4('0x15')]?_0x420cb6[_0xace4('0x15')][_0xace4('0x16')]===undefined?!![]:![]:!![],'where':_0x420cb6[_0xace4('0x15')]?_0x420cb6['options'][_0xace4('0x17')]||null:null,'attributes':_0x420cb6['options']?_0x420cb6['options'][_0xace4('0x18')]||null:null,'include':_0x420cb6[_0xace4('0x15')]?_0x420cb6[_0xace4('0x15')]['include']?_['map'](_0x420cb6[_0xace4('0x15')][_0xace4('0x19')],function(_0x41cfac){return{'model':db[_0x41cfac[_0xace4('0x1a')]],'as':_0x41cfac['as'],'attributes':_0x41cfac[_0xace4('0x18')],'include':_0x41cfac[_0xace4('0x19')]?_[_0xace4('0x1b')](_0x41cfac[_0xace4('0x19')],function(_0x372914){return{'model':db[_0x372914[_0xace4('0x1a')]],'as':_0x372914['as'],'attributes':_0x372914[_0xace4('0x18')],'include':_0x372914['include']?_[_0xace4('0x1b')](_0x372914[_0xace4('0x19')],function(_0x5d4f0a){return{'model':db[_0x5d4f0a[_0xace4('0x1a')]],'as':_0x5d4f0a['as'],'attributes':_0x5d4f0a['attributes']};}):[]};}):[]};}):[]:[]})[_0xace4('0x1c')](function(_0x1037cc){logger[_0xace4('0x9')](_0xace4('0x12'),_0x420cb6);logger[_0xace4('0xb')](_0xace4('0x12'),_0x420cb6,JSON[_0xace4('0x1d')](_0x1037cc));_0x4ebf82(_0x1037cc);})[_0xace4('0x11')](function(_0x27ce0c){logger[_0xace4('0xd')]('ShowSound',_0x27ce0c[_0xace4('0xf')],_0x420cb6);_0xa7109d(_0x597b3b[_0xace4('0xd')](0x1f4,_0x27ce0c[_0xace4('0xf')]));});});};
\ No newline at end of file
+var _0xa651=['debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','ShowSound','find','options','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x1dfb23,_0x3dbe83){var _0x36440b=function(_0x3ac389){while(--_0x3ac389){_0x1dfb23['push'](_0x1dfb23['shift']());}};_0x36440b(++_0x3dbe83);}(_0xa651,0xb6));var _0x1a65=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0xa651[_0x59eacf];return _0x5d74f2;};'use strict';var _=require(_0x1a65('0x0'));var util=require(_0x1a65('0x1'));var moment=require(_0x1a65('0x2'));var BPromise=require(_0x1a65('0x3'));var rs=require(_0x1a65('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a65('0x5'))['db'];var utils=require(_0x1a65('0x6'));var logger=require(_0x1a65('0x7'))(_0x1a65('0x8'));var config=require(_0x1a65('0x9'));var jayson=require(_0x1a65('0xa'));var client=jayson[_0x1a65('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e4813,_0x3050eb,_0x38f500){return new BPromise(function(_0x5ad5b4,_0x1fa75f){return client[_0x1a65('0xc')](_0x2e4813,_0x38f500)[_0x1a65('0xd')](function(_0x106a4e){logger[_0x1a65('0xe')](_0x1a65('0xf'),_0x3050eb,'request\x20sent');logger[_0x1a65('0x10')](_0x1a65('0x11'),_0x3050eb,_0x1a65('0x12'),JSON[_0x1a65('0x13')](_0x106a4e));if(_0x106a4e['error']){if(_0x106a4e['error'][_0x1a65('0x14')]===0x1f4){logger[_0x1a65('0x15')](_0x1a65('0xf'),_0x3050eb,_0x106a4e[_0x1a65('0x15')][_0x1a65('0x16')]);return _0x1fa75f(_0x106a4e[_0x1a65('0x15')][_0x1a65('0x16')]);}logger[_0x1a65('0x15')](_0x1a65('0xf'),_0x3050eb,_0x106a4e[_0x1a65('0x15')]['message']);return _0x5ad5b4(_0x106a4e['error'][_0x1a65('0x16')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x3050eb,_0x1a65('0x12'));_0x5ad5b4(_0x106a4e[_0x1a65('0x17')][_0x1a65('0x16')]);}})[_0x1a65('0x18')](function(_0x5e2ea8){logger[_0x1a65('0x15')](_0x1a65('0xf'),_0x3050eb,_0x5e2ea8);_0x1fa75f(_0x5e2ea8);});});}exports[_0x1a65('0x19')]=function(_0x200286){var _0x28635d=this;return new Promise(function(_0x26aaad,_0x25b937){return db['Sound'][_0x1a65('0x1a')]({'raw':_0x200286[_0x1a65('0x1b')]?_0x200286[_0x1a65('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x200286[_0x1a65('0x1b')]?_0x200286['options'][_0x1a65('0x1c')]||null:null,'attributes':_0x200286['options']?_0x200286[_0x1a65('0x1b')][_0x1a65('0x1d')]||null:null,'include':_0x200286[_0x1a65('0x1b')]?_0x200286[_0x1a65('0x1b')]['include']?_['map'](_0x200286[_0x1a65('0x1b')][_0x1a65('0x1e')],function(_0x2dc7ca){return{'model':db[_0x2dc7ca[_0x1a65('0x1f')]],'as':_0x2dc7ca['as'],'attributes':_0x2dc7ca[_0x1a65('0x1d')],'include':_0x2dc7ca[_0x1a65('0x1e')]?_['map'](_0x2dc7ca[_0x1a65('0x1e')],function(_0x1d3684){return{'model':db[_0x1d3684[_0x1a65('0x1f')]],'as':_0x1d3684['as'],'attributes':_0x1d3684[_0x1a65('0x1d')],'include':_0x1d3684[_0x1a65('0x1e')]?_[_0x1a65('0x20')](_0x1d3684['include'],function(_0x208b94){return{'model':db[_0x208b94[_0x1a65('0x1f')]],'as':_0x208b94['as'],'attributes':_0x208b94[_0x1a65('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1a65('0xd')](function(_0x50e62e){logger['info'](_0x1a65('0x19'),_0x200286);logger[_0x1a65('0x10')]('ShowSound',_0x200286,JSON['stringify'](_0x50e62e));_0x26aaad(_0x50e62e);})['catch'](function(_0x3bd08f){logger[_0x1a65('0x15')](_0x1a65('0x19'),_0x3bd08f['message'],_0x200286);_0x25b937(_0x28635d[_0x1a65('0x15')](0x1f4,_0x3bd08f[_0x1a65('0x16')]));});});};
\ No newline at end of file
index 5be10b6..a0a41b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x436fd6,_0x3a416a){var _0x45cd28=function(_0x4096c7){while(--_0x4096c7){_0x436fd6['push'](_0x436fd6['shift']());}};_0x45cd28(++_0x3a416a);}(_0x14a0,0x8e));var _0x014a=function(_0x59a8ef,_0x3df38f){_0x59a8ef=_0x59a8ef-0x0;var _0xbf5809=_0x14a0[_0x59a8ef];return _0xbf5809;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x5e81a5,_0x9ba84c){var _0x4ebeaf=function(_0x10ff18){while(--_0x10ff18){_0x5e81a5['push'](_0x5e81a5['shift']());}};_0x4ebeaf(++_0x9ba84c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router;
\ No newline at end of file
index b1c058f..19f6eb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51b4=['sequelize','exports','TEXT','medium','ENUM','out','STRING'];(function(_0x3ec40a,_0x2b3e3f){var _0x393c34=function(_0x14a41e){while(--_0x14a41e){_0x3ec40a['push'](_0x3ec40a['shift']());}};_0x393c34(++_0x2b3e3f);}(_0x51b4,0x1c7));var _0x451b=function(_0x1a6d7e,_0x18a9f7){_0x1a6d7e=_0x1a6d7e-0x0;var _0x399f11=_0x51b4[_0x1a6d7e];return _0x399f11;};'use strict';var Sequelize=require(_0x451b('0x0'));module[_0x451b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x451b('0x2')](_0x451b('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x451b('0x4')]('in',_0x451b('0x5')),'defaultValue':_0x451b('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x451b('0x6')]},'providerResponse':{'type':Sequelize[_0x451b('0x2')]}};
\ No newline at end of file
+var _0x0b65=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0b65,0x15c));var _0x50b6=function(_0x16247e,_0x319a09){_0x16247e=_0x16247e-0x0;var _0x1c07d7=_0x0b65[_0x16247e];return _0x1c07d7;};'use strict';var Sequelize=require(_0x50b6('0x0'));module[_0x50b6('0x1')]={'uniqueid':{'type':Sequelize[_0x50b6('0x2')]},'body':{'type':Sequelize[_0x50b6('0x3')](_0x50b6('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x50b6('0x5')]('in',_0x50b6('0x6')),'defaultValue':_0x50b6('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x50b6('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index fc4d9c2..11a5d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ef1=['offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','eml-format','rimraf','request-promise','bluebird','mustache','path','fs-extra','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ef1,0x187));var _0x13ef=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x3ef1[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0x13ef('0x0'));var rimraf=require(_0x13ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x13ef('0x2'));var moment=require('moment');var BPromise=require(_0x13ef('0x3'));var Mustache=require(_0x13ef('0x4'));var util=require('util');var path=require(_0x13ef('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13ef('0x6'));var _=require('lodash');var squel=require(_0x13ef('0x7'));var crypto=require('crypto');var jsforce=require(_0x13ef('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x13ef('0x9'));var querystring=require('querystring');var Papa=require(_0x13ef('0xa'));var Redis=require(_0x13ef('0xb'));var authService=require(_0x13ef('0xc'));var qs=require(_0x13ef('0xd'));var as=require(_0x13ef('0xe'));var hardwareService=require(_0x13ef('0xf'));var logger=require(_0x13ef('0x10'))('api');var utils=require(_0x13ef('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x13ef('0x12'));var db=require(_0x13ef('0x13'))['db'];function respondWithStatusCode(_0x330c20,_0x5e6039){_0x5e6039=_0x5e6039||0xcc;return function(_0x27c292){if(_0x27c292){return _0x330c20[_0x13ef('0x14')](_0x5e6039);}return _0x330c20[_0x13ef('0x15')](_0x5e6039)[_0x13ef('0x16')]();};}function respondWithResult(_0x5692d1,_0x2b4869){_0x2b4869=_0x2b4869||0xc8;return function(_0x1476d9){if(_0x1476d9){return _0x5692d1[_0x13ef('0x15')](_0x2b4869)['json'](_0x1476d9);}};}function respondWithFilteredResult(_0x4610c9,_0x1eb9cb){return function(_0x56ecc0){if(_0x56ecc0){var _0xce6c80=typeof _0x1eb9cb[_0x13ef('0x17')]===_0x13ef('0x18')&&typeof _0x1eb9cb[_0x13ef('0x19')]===_0x13ef('0x18');var _0xf613b0=_0x56ecc0[_0x13ef('0x1a')];var _0x35ac43=_0xce6c80?0x0:_0x1eb9cb[_0x13ef('0x17')];var _0x53a9e7=_0xce6c80?_0x56ecc0['count']:_0x1eb9cb[_0x13ef('0x17')]+_0x1eb9cb[_0x13ef('0x19')];var _0x494c50;if(_0x53a9e7>=_0xf613b0){_0x53a9e7=_0xf613b0;_0x494c50=0xc8;}else{_0x494c50=0xce;}_0x4610c9[_0x13ef('0x15')](_0x494c50);return _0x4610c9[_0x13ef('0x1b')](_0x13ef('0x1c'),_0x35ac43+'-'+_0x53a9e7+'/'+_0xf613b0)['json'](_0x56ecc0);}return null;};}function patchUpdates(_0x64e7a){return function(_0x1be6c8){try{jsonpatch[_0x13ef('0x1d')](_0x1be6c8,_0x64e7a,!![]);}catch(_0x27467f){return BPromise[_0x13ef('0x1e')](_0x27467f);}return _0x1be6c8['save']();};}function saveUpdates(_0x12f010,_0x117b98){return function(_0x34d51a){if(_0x34d51a){return _0x34d51a['update'](_0x12f010)[_0x13ef('0x1f')](function(_0x59815a){return _0x59815a;});}return null;};}function removeEntity(_0x166392,_0x162921){return function(_0x3e7e28){if(_0x3e7e28){return _0x3e7e28[_0x13ef('0x20')]()[_0x13ef('0x1f')](function(){_0x166392[_0x13ef('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33035e,_0x146453){return function(_0x523ffe){if(!_0x523ffe){_0x33035e['sendStatus'](0x194);}return _0x523ffe;};}function handleError(_0x2ef554,_0x14d49){_0x14d49=_0x14d49||0x1f4;return function(_0x17d9e2){logger['error'](_0x17d9e2[_0x13ef('0x21')]);if(_0x17d9e2[_0x13ef('0x22')]){delete _0x17d9e2[_0x13ef('0x22')];}_0x2ef554[_0x13ef('0x15')](_0x14d49)[_0x13ef('0x23')](_0x17d9e2);};}exports[_0x13ef('0x24')]=function(_0x3b9c24,_0x1a49cc){var _0x1f8c78={},_0x49b312={},_0x43a49f={'count':0x0,'rows':[]};var _0x16c155=_['map'](db[_0x13ef('0x25')][_0x13ef('0x26')],function(_0x25909){return{'name':_0x25909[_0x13ef('0x27')],'type':_0x25909[_0x13ef('0x28')][_0x13ef('0x29')]};});_0x49b312[_0x13ef('0x2a')]=_[_0x13ef('0x2b')](_0x16c155,'name');_0x49b312[_0x13ef('0x2c')]=_[_0x13ef('0x2d')](_0x3b9c24[_0x13ef('0x2c')]);_0x49b312[_0x13ef('0x2e')]=_[_0x13ef('0x2f')](_0x49b312[_0x13ef('0x2a')],_0x49b312[_0x13ef('0x2c')]);_0x1f8c78['attributes']=_[_0x13ef('0x2f')](_0x49b312['model'],qs['fields'](_0x3b9c24[_0x13ef('0x2c')][_0x13ef('0x30')]));_0x1f8c78[_0x13ef('0x31')]=_0x1f8c78[_0x13ef('0x31')]['length']?_0x1f8c78[_0x13ef('0x31')]:_0x49b312[_0x13ef('0x2a')];if(!_0x3b9c24[_0x13ef('0x2c')]['hasOwnProperty'](_0x13ef('0x32'))){_0x1f8c78[_0x13ef('0x19')]=qs['limit'](_0x3b9c24[_0x13ef('0x2c')][_0x13ef('0x19')]);_0x1f8c78['offset']=qs[_0x13ef('0x17')](_0x3b9c24[_0x13ef('0x2c')]['offset']);}_0x1f8c78[_0x13ef('0x33')]=qs[_0x13ef('0x34')](_0x3b9c24[_0x13ef('0x2c')]['sort']);_0x1f8c78[_0x13ef('0x35')]=qs[_0x13ef('0x2e')](_['pick'](_0x3b9c24[_0x13ef('0x2c')],_0x49b312[_0x13ef('0x2e')]),_0x16c155);if(_0x3b9c24[_0x13ef('0x2c')][_0x13ef('0x36')]){_0x1f8c78['where']=_[_0x13ef('0x37')](_0x1f8c78['where'],{'$or':_[_0x13ef('0x2b')](_0x16c155,function(_0x2a2f4c){if(_0x2a2f4c['type']!==_0x13ef('0x38')){var _0x5225d3={};_0x5225d3[_0x2a2f4c[_0x13ef('0x22')]]={'$like':'%'+_0x3b9c24['query'][_0x13ef('0x36')]+'%'};return _0x5225d3;}})});}_0x1f8c78=_[_0x13ef('0x37')]({},_0x1f8c78,_0x3b9c24['options']);var _0x31bfd3={'where':_0x1f8c78[_0x13ef('0x35')]};return db['SquareMessage'][_0x13ef('0x1a')](_0x31bfd3)[_0x13ef('0x1f')](function(_0xbac48){_0x43a49f[_0x13ef('0x1a')]=_0xbac48;if(_0x3b9c24[_0x13ef('0x2c')][_0x13ef('0x39')]){_0x1f8c78[_0x13ef('0x3a')]=[{'all':!![]}];}return db[_0x13ef('0x25')][_0x13ef('0x3b')](_0x1f8c78);})[_0x13ef('0x1f')](function(_0x169345){_0x43a49f[_0x13ef('0x3c')]=_0x169345;return _0x43a49f;})['then'](respondWithFilteredResult(_0x1a49cc,_0x1f8c78))['catch'](handleError(_0x1a49cc,null));};exports[_0x13ef('0x3d')]=function(_0x38bf18,_0x3a8074){var _0x36d401={'raw':!![],'where':{'id':_0x38bf18[_0x13ef('0x3e')]['id']}},_0x34dcf1={};_0x34dcf1['model']=_[_0x13ef('0x2d')](db[_0x13ef('0x25')][_0x13ef('0x26')]);_0x34dcf1[_0x13ef('0x2c')]=_[_0x13ef('0x2d')](_0x38bf18[_0x13ef('0x2c')]);_0x34dcf1[_0x13ef('0x2e')]=_[_0x13ef('0x2f')](_0x34dcf1[_0x13ef('0x2a')],_0x34dcf1['query']);_0x36d401['attributes']=_[_0x13ef('0x2f')](_0x34dcf1[_0x13ef('0x2a')],qs[_0x13ef('0x30')](_0x38bf18[_0x13ef('0x2c')]['fields']));_0x36d401[_0x13ef('0x31')]=_0x36d401[_0x13ef('0x31')]['length']?_0x36d401[_0x13ef('0x31')]:_0x34dcf1['model'];if(_0x38bf18[_0x13ef('0x2c')][_0x13ef('0x39')]){_0x36d401[_0x13ef('0x3a')]=[{'all':!![]}];}_0x36d401=_[_0x13ef('0x37')]({},_0x36d401,_0x38bf18[_0x13ef('0x3f')]);return db[_0x13ef('0x25')][_0x13ef('0x40')](_0x36d401)[_0x13ef('0x1f')](handleEntityNotFound(_0x3a8074,null))[_0x13ef('0x1f')](respondWithResult(_0x3a8074,null))[_0x13ef('0x41')](handleError(_0x3a8074,null));};exports[_0x13ef('0x42')]=function(_0x1cfad4,_0x5145bd){return db[_0x13ef('0x25')][_0x13ef('0x42')](_0x1cfad4[_0x13ef('0x43')],{})[_0x13ef('0x1f')](respondWithResult(_0x5145bd,0xc9))[_0x13ef('0x41')](handleError(_0x5145bd,null));};exports[_0x13ef('0x44')]=function(_0x3dd18b,_0x145af0){if(_0x3dd18b[_0x13ef('0x43')]['id']){delete _0x3dd18b[_0x13ef('0x43')]['id'];}return db[_0x13ef('0x25')][_0x13ef('0x40')]({'where':{'id':_0x3dd18b[_0x13ef('0x3e')]['id']}})[_0x13ef('0x1f')](handleEntityNotFound(_0x145af0,null))[_0x13ef('0x1f')](saveUpdates(_0x3dd18b[_0x13ef('0x43')],null))[_0x13ef('0x1f')](respondWithResult(_0x145af0,null))[_0x13ef('0x41')](handleError(_0x145af0,null));};exports[_0x13ef('0x20')]=function(_0x131172,_0x55ca3c){return db[_0x13ef('0x25')][_0x13ef('0x40')]({'where':{'id':_0x131172['params']['id']}})['then'](handleEntityNotFound(_0x55ca3c,null))['then'](removeEntity(_0x55ca3c,null))[_0x13ef('0x41')](handleError(_0x55ca3c,null));};
\ No newline at end of file
+var _0x9a55=['params','rawAttributes','length','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SquareMessage','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x4b48a5,_0x2360d9){var _0x544aad=function(_0x4ebe3d){while(--_0x4ebe3d){_0x4b48a5['push'](_0x4b48a5['shift']());}};_0x544aad(++_0x2360d9);}(_0x9a55,0xe2));var _0x59a5=function(_0x3f23cf,_0x363025){_0x3f23cf=_0x3f23cf-0x0;var _0x10d898=_0x9a55[_0x3f23cf];return _0x10d898;};'use strict';var emlformat=require(_0x59a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59a5('0x1'));var jsonpatch=require(_0x59a5('0x2'));var rp=require(_0x59a5('0x3'));var moment=require('moment');var BPromise=require(_0x59a5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x59a5('0x5'));var sox=require('sox');var csv=require(_0x59a5('0x6'));var ejs=require(_0x59a5('0x7'));var fs=require('fs');var fs_extra=require(_0x59a5('0x8'));var _=require(_0x59a5('0x9'));var squel=require(_0x59a5('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x59a5('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x59a5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x59a5('0xd'));var as=require(_0x59a5('0xe'));var hardwareService=require(_0x59a5('0xf'));var logger=require(_0x59a5('0x10'))(_0x59a5('0x11'));var utils=require(_0x59a5('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x59a5('0x13'))['db'];function respondWithStatusCode(_0x427a03,_0x72199){_0x72199=_0x72199||0xcc;return function(_0x324a86){if(_0x324a86){return _0x427a03[_0x59a5('0x14')](_0x72199);}return _0x427a03[_0x59a5('0x15')](_0x72199)[_0x59a5('0x16')]();};}function respondWithResult(_0x387581,_0x5a9eb5){_0x5a9eb5=_0x5a9eb5||0xc8;return function(_0x2ed149){if(_0x2ed149){return _0x387581[_0x59a5('0x15')](_0x5a9eb5)[_0x59a5('0x17')](_0x2ed149);}};}function respondWithFilteredResult(_0x312f16,_0x619724){return function(_0x18e5fb){if(_0x18e5fb){var _0x25b019=typeof _0x619724[_0x59a5('0x18')]===_0x59a5('0x19')&&typeof _0x619724['limit']===_0x59a5('0x19');var _0xe4fee1=_0x18e5fb[_0x59a5('0x1a')];var _0x44ef9a=_0x25b019?0x0:_0x619724['offset'];var _0x415f38=_0x25b019?_0x18e5fb[_0x59a5('0x1a')]:_0x619724[_0x59a5('0x18')]+_0x619724[_0x59a5('0x1b')];var _0x46a0f8;if(_0x415f38>=_0xe4fee1){_0x415f38=_0xe4fee1;_0x46a0f8=0xc8;}else{_0x46a0f8=0xce;}_0x312f16['status'](_0x46a0f8);return _0x312f16[_0x59a5('0x1c')](_0x59a5('0x1d'),_0x44ef9a+'-'+_0x415f38+'/'+_0xe4fee1)[_0x59a5('0x17')](_0x18e5fb);}return null;};}function patchUpdates(_0x4feb84){return function(_0x4bbe3f){try{jsonpatch[_0x59a5('0x1e')](_0x4bbe3f,_0x4feb84,!![]);}catch(_0x51fe04){return BPromise[_0x59a5('0x1f')](_0x51fe04);}return _0x4bbe3f[_0x59a5('0x20')]();};}function saveUpdates(_0x2ab3e1,_0x3c6208){return function(_0x536339){if(_0x536339){return _0x536339[_0x59a5('0x21')](_0x2ab3e1)[_0x59a5('0x22')](function(_0x285a62){return _0x285a62;});}return null;};}function removeEntity(_0x26007d,_0x3a9ab0){return function(_0x53865c){if(_0x53865c){return _0x53865c[_0x59a5('0x23')]()[_0x59a5('0x22')](function(){_0x26007d[_0x59a5('0x15')](0xcc)[_0x59a5('0x16')]();});}};}function handleEntityNotFound(_0x5b8f10,_0x5981c0){return function(_0x1667a4){if(!_0x1667a4){_0x5b8f10[_0x59a5('0x14')](0x194);}return _0x1667a4;};}function handleError(_0x4e46f5,_0x3fb821){_0x3fb821=_0x3fb821||0x1f4;return function(_0x4e43cd){logger[_0x59a5('0x24')](_0x4e43cd[_0x59a5('0x25')]);if(_0x4e43cd[_0x59a5('0x26')]){delete _0x4e43cd[_0x59a5('0x26')];}_0x4e46f5[_0x59a5('0x15')](_0x3fb821)['send'](_0x4e43cd);};}exports['index']=function(_0x5bd23f,_0x456049){var _0x2c9160={},_0x5eacd6={},_0x5d93c3={'count':0x0,'rows':[]};var _0x4d37f5=_[_0x59a5('0x27')](db[_0x59a5('0x28')]['rawAttributes'],function(_0x39da62){return{'name':_0x39da62[_0x59a5('0x29')],'type':_0x39da62[_0x59a5('0x2a')][_0x59a5('0x2b')]};});_0x5eacd6[_0x59a5('0x2c')]=_[_0x59a5('0x27')](_0x4d37f5,_0x59a5('0x26'));_0x5eacd6['query']=_[_0x59a5('0x2d')](_0x5bd23f[_0x59a5('0x2e')]);_0x5eacd6[_0x59a5('0x2f')]=_['intersection'](_0x5eacd6['model'],_0x5eacd6[_0x59a5('0x2e')]);_0x2c9160[_0x59a5('0x30')]=_[_0x59a5('0x31')](_0x5eacd6[_0x59a5('0x2c')],qs[_0x59a5('0x32')](_0x5bd23f[_0x59a5('0x2e')][_0x59a5('0x32')]));_0x2c9160['attributes']=_0x2c9160[_0x59a5('0x30')]['length']?_0x2c9160[_0x59a5('0x30')]:_0x5eacd6[_0x59a5('0x2c')];if(!_0x5bd23f['query'][_0x59a5('0x33')](_0x59a5('0x34'))){_0x2c9160['limit']=qs[_0x59a5('0x1b')](_0x5bd23f[_0x59a5('0x2e')][_0x59a5('0x1b')]);_0x2c9160[_0x59a5('0x18')]=qs[_0x59a5('0x18')](_0x5bd23f[_0x59a5('0x2e')]['offset']);}_0x2c9160[_0x59a5('0x35')]=qs[_0x59a5('0x36')](_0x5bd23f[_0x59a5('0x2e')][_0x59a5('0x36')]);_0x2c9160['where']=qs[_0x59a5('0x2f')](_[_0x59a5('0x37')](_0x5bd23f[_0x59a5('0x2e')],_0x5eacd6[_0x59a5('0x2f')]),_0x4d37f5);if(_0x5bd23f['query'][_0x59a5('0x38')]){_0x2c9160[_0x59a5('0x39')]=_[_0x59a5('0x3a')](_0x2c9160[_0x59a5('0x39')],{'$or':_[_0x59a5('0x27')](_0x4d37f5,function(_0x5b6c87){if(_0x5b6c87[_0x59a5('0x2a')]!==_0x59a5('0x3b')){var _0xab0cfa={};_0xab0cfa[_0x5b6c87['name']]={'$like':'%'+_0x5bd23f[_0x59a5('0x2e')]['filter']+'%'};return _0xab0cfa;}})});}_0x2c9160=_[_0x59a5('0x3a')]({},_0x2c9160,_0x5bd23f[_0x59a5('0x3c')]);var _0x4afb12={'where':_0x2c9160[_0x59a5('0x39')]};return db[_0x59a5('0x28')][_0x59a5('0x1a')](_0x4afb12)[_0x59a5('0x22')](function(_0x936088){_0x5d93c3[_0x59a5('0x1a')]=_0x936088;if(_0x5bd23f[_0x59a5('0x2e')][_0x59a5('0x3d')]){_0x2c9160[_0x59a5('0x3e')]=[{'all':!![]}];}return db[_0x59a5('0x28')][_0x59a5('0x3f')](_0x2c9160);})[_0x59a5('0x22')](function(_0x5d4c3f){_0x5d93c3[_0x59a5('0x40')]=_0x5d4c3f;return _0x5d93c3;})[_0x59a5('0x22')](respondWithFilteredResult(_0x456049,_0x2c9160))['catch'](handleError(_0x456049,null));};exports[_0x59a5('0x41')]=function(_0x1d1d97,_0x5169e3){var _0x599409={'raw':!![],'where':{'id':_0x1d1d97[_0x59a5('0x42')]['id']}},_0x331cde={};_0x331cde[_0x59a5('0x2c')]=_[_0x59a5('0x2d')](db[_0x59a5('0x28')][_0x59a5('0x43')]);_0x331cde[_0x59a5('0x2e')]=_['keys'](_0x1d1d97[_0x59a5('0x2e')]);_0x331cde[_0x59a5('0x2f')]=_['intersection'](_0x331cde[_0x59a5('0x2c')],_0x331cde[_0x59a5('0x2e')]);_0x599409[_0x59a5('0x30')]=_['intersection'](_0x331cde['model'],qs[_0x59a5('0x32')](_0x1d1d97[_0x59a5('0x2e')][_0x59a5('0x32')]));_0x599409[_0x59a5('0x30')]=_0x599409[_0x59a5('0x30')][_0x59a5('0x44')]?_0x599409[_0x59a5('0x30')]:_0x331cde[_0x59a5('0x2c')];if(_0x1d1d97['query']['includeAll']){_0x599409[_0x59a5('0x3e')]=[{'all':!![]}];}_0x599409=_[_0x59a5('0x3a')]({},_0x599409,_0x1d1d97[_0x59a5('0x3c')]);return db['SquareMessage'][_0x59a5('0x45')](_0x599409)[_0x59a5('0x22')](handleEntityNotFound(_0x5169e3,null))[_0x59a5('0x22')](respondWithResult(_0x5169e3,null))[_0x59a5('0x46')](handleError(_0x5169e3,null));};exports['create']=function(_0x8dab8e,_0x430999){return db[_0x59a5('0x28')][_0x59a5('0x47')](_0x8dab8e[_0x59a5('0x48')],{})['then'](respondWithResult(_0x430999,0xc9))[_0x59a5('0x46')](handleError(_0x430999,null));};exports['update']=function(_0x23ee0e,_0x4e191e){if(_0x23ee0e[_0x59a5('0x48')]['id']){delete _0x23ee0e['body']['id'];}return db[_0x59a5('0x28')][_0x59a5('0x45')]({'where':{'id':_0x23ee0e[_0x59a5('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e191e,null))['then'](saveUpdates(_0x23ee0e[_0x59a5('0x48')],null))[_0x59a5('0x22')](respondWithResult(_0x4e191e,null))[_0x59a5('0x46')](handleError(_0x4e191e,null));};exports[_0x59a5('0x23')]=function(_0x4c3e00,_0x192a5a){return db[_0x59a5('0x28')][_0x59a5('0x45')]({'where':{'id':_0x4c3e00[_0x59a5('0x42')]['id']}})[_0x59a5('0x22')](handleEntityNotFound(_0x192a5a,null))[_0x59a5('0x22')](removeEntity(_0x192a5a,null))[_0x59a5('0x46')](handleError(_0x192a5a,null));};
\ No newline at end of file
index 8cfcca2..8ec9575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31a0=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','util'];(function(_0x3f8da2,_0x3c70a9){var _0x9df78c=function(_0xf6e386){while(--_0xf6e386){_0x3f8da2['push'](_0x3f8da2['shift']());}};_0x9df78c(++_0x3c70a9);}(_0x31a0,0xa7));var _0x031a=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x31a0[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x031a('0x0'));var util=require(_0x031a('0x1'));var logger=require(_0x031a('0x2'))(_0x031a('0x3'));var moment=require(_0x031a('0x4'));var BPromise=require('bluebird');var rp=require(_0x031a('0x5'));var fs=require('fs');var path=require(_0x031a('0x6'));var rimraf=require(_0x031a('0x7'));var config=require(_0x031a('0x8'));var attributes=require(_0x031a('0x9'));module[_0x031a('0xa')]=function(_0x4e0303,_0x49ee87){return _0x4e0303[_0x031a('0xb')]('SquareMessage',attributes,{'tableName':_0x031a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc47=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0xcc47,0x1ac));var _0x7cc4=function(_0x5464df,_0x452b55){_0x5464df=_0x5464df-0x0;var _0x2ddac0=_0xcc47[_0x5464df];return _0x2ddac0;};'use strict';var _=require(_0x7cc4('0x0'));var util=require(_0x7cc4('0x1'));var logger=require(_0x7cc4('0x2'))('api');var moment=require(_0x7cc4('0x3'));var BPromise=require(_0x7cc4('0x4'));var rp=require(_0x7cc4('0x5'));var fs=require('fs');var path=require(_0x7cc4('0x6'));var rimraf=require(_0x7cc4('0x7'));var config=require(_0x7cc4('0x8'));var attributes=require(_0x7cc4('0x9'));module[_0x7cc4('0xa')]=function(_0x41d6e6,_0x49afdc){return _0x41d6e6[_0x7cc4('0xb')](_0x7cc4('0xc'),attributes,{'tableName':_0x7cc4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 51ce5d1..1a919d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1a7=['CreateSquareMessage','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','info'];(function(_0x48bc05,_0x31fb98){var _0x5b6fec=function(_0x1e8555){while(--_0x1e8555){_0x48bc05['push'](_0x48bc05['shift']());}};_0x5b6fec(++_0x31fb98);}(_0xf1a7,0xb6));var _0x7f1a=function(_0x375e21,_0x371d40){_0x375e21=_0x375e21-0x0;var _0xf6aecb=_0xf1a7[_0x375e21];return _0xf6aecb;};'use strict';var _=require(_0x7f1a('0x0'));var util=require('util');var moment=require(_0x7f1a('0x1'));var BPromise=require(_0x7f1a('0x2'));var rs=require(_0x7f1a('0x3'));var fs=require('fs');var Redis=require(_0x7f1a('0x4'));var db=require(_0x7f1a('0x5'))['db'];var utils=require(_0x7f1a('0x6'));var logger=require(_0x7f1a('0x7'))(_0x7f1a('0x8'));var config=require(_0x7f1a('0x9'));var jayson=require(_0x7f1a('0xa'));var client=jayson[_0x7f1a('0xb')][_0x7f1a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23e816,_0x34500f,_0x4d34a4){return new BPromise(function(_0x51f3c8,_0x37d78b){return client[_0x7f1a('0xd')](_0x23e816,_0x4d34a4)[_0x7f1a('0xe')](function(_0x1c55a3){logger['info'](_0x7f1a('0xf'),_0x34500f,_0x7f1a('0x10'));logger['debug'](_0x7f1a('0x11'),_0x34500f,_0x7f1a('0x10'),JSON[_0x7f1a('0x12')](_0x1c55a3));if(_0x1c55a3['error']){if(_0x1c55a3[_0x7f1a('0x13')][_0x7f1a('0x14')]===0x1f4){logger[_0x7f1a('0x13')](_0x7f1a('0xf'),_0x34500f,_0x1c55a3[_0x7f1a('0x13')][_0x7f1a('0x15')]);return _0x37d78b(_0x1c55a3[_0x7f1a('0x13')][_0x7f1a('0x15')]);}logger[_0x7f1a('0x13')](_0x7f1a('0xf'),_0x34500f,_0x1c55a3[_0x7f1a('0x13')][_0x7f1a('0x15')]);return _0x51f3c8(_0x1c55a3[_0x7f1a('0x13')][_0x7f1a('0x15')]);}else{logger['info'](_0x7f1a('0xf'),_0x34500f,_0x7f1a('0x10'));_0x51f3c8(_0x1c55a3[_0x7f1a('0x16')][_0x7f1a('0x15')]);}})[_0x7f1a('0x17')](function(_0x4e35d4){logger[_0x7f1a('0x13')](_0x7f1a('0xf'),_0x34500f,_0x4e35d4);_0x37d78b(_0x4e35d4);});});}exports['CreateSquareMessage']=function(_0x19f199){var _0x3b0746=this;return new Promise(function(_0x11ab0c,_0x1b757a){return db['SquareMessage']['create'](_0x19f199[_0x7f1a('0x18')],{'raw':_0x19f199[_0x7f1a('0x19')]?_0x19f199[_0x7f1a('0x19')][_0x7f1a('0x1a')]===undefined?!![]:![]:!![]})[_0x7f1a('0xe')](function(_0x709238){logger[_0x7f1a('0x1b')](_0x7f1a('0x1c'),_0x19f199);logger[_0x7f1a('0x1d')](_0x7f1a('0x1c'),_0x19f199,JSON[_0x7f1a('0x12')](_0x709238));_0x11ab0c(_0x709238);})[_0x7f1a('0x17')](function(_0x3f7f49){logger['error']('CreateSquareMessage',_0x3f7f49['message'],_0x19f199);_0x1b757a(_0x3b0746['error'](0x1f4,_0x3f7f49['message']));});});};
\ No newline at end of file
+var _0x30cd=['raw','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','SquareMessage','create','body','options'];(function(_0xbff461,_0x234e2b){var _0x755edf=function(_0x3e486a){while(--_0x3e486a){_0xbff461['push'](_0xbff461['shift']());}};_0x755edf(++_0x234e2b);}(_0x30cd,0x198));var _0xd30c=function(_0x5b7089,_0x2af973){_0x5b7089=_0x5b7089-0x0;var _0x5d0c36=_0x30cd[_0x5b7089];return _0x5d0c36;};'use strict';var _=require(_0xd30c('0x0'));var util=require(_0xd30c('0x1'));var moment=require(_0xd30c('0x2'));var BPromise=require(_0xd30c('0x3'));var rs=require(_0xd30c('0x4'));var fs=require('fs');var Redis=require(_0xd30c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd30c('0x6'));var logger=require('../../config/logger')(_0xd30c('0x7'));var config=require(_0xd30c('0x8'));var jayson=require(_0xd30c('0x9'));var client=jayson[_0xd30c('0xa')][_0xd30c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fd734,_0x5e6d33,_0x4eeb71){return new BPromise(function(_0x180e23,_0x366a65){return client[_0xd30c('0xc')](_0x4fd734,_0x4eeb71)[_0xd30c('0xd')](function(_0x31a07d){logger['info'](_0xd30c('0xe'),_0x5e6d33,_0xd30c('0xf'));logger[_0xd30c('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5e6d33,_0xd30c('0xf'),JSON[_0xd30c('0x11')](_0x31a07d));if(_0x31a07d[_0xd30c('0x12')]){if(_0x31a07d[_0xd30c('0x12')]['code']===0x1f4){logger[_0xd30c('0x12')](_0xd30c('0xe'),_0x5e6d33,_0x31a07d['error'][_0xd30c('0x13')]);return _0x366a65(_0x31a07d[_0xd30c('0x12')][_0xd30c('0x13')]);}logger['error'](_0xd30c('0xe'),_0x5e6d33,_0x31a07d[_0xd30c('0x12')][_0xd30c('0x13')]);return _0x180e23(_0x31a07d[_0xd30c('0x12')]['message']);}else{logger[_0xd30c('0x14')](_0xd30c('0xe'),_0x5e6d33,_0xd30c('0xf'));_0x180e23(_0x31a07d[_0xd30c('0x15')]['message']);}})[_0xd30c('0x16')](function(_0x310657){logger[_0xd30c('0x12')](_0xd30c('0xe'),_0x5e6d33,_0x310657);_0x366a65(_0x310657);});});}exports['CreateSquareMessage']=function(_0x522dbf){var _0x208074=this;return new Promise(function(_0x4b7c8a,_0x4ccef2){return db[_0xd30c('0x17')][_0xd30c('0x18')](_0x522dbf[_0xd30c('0x19')],{'raw':_0x522dbf[_0xd30c('0x1a')]?_0x522dbf[_0xd30c('0x1a')][_0xd30c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x58a950){logger[_0xd30c('0x14')]('CreateSquareMessage',_0x522dbf);logger[_0xd30c('0x10')]('CreateSquareMessage',_0x522dbf,JSON['stringify'](_0x58a950));_0x4b7c8a(_0x58a950);})[_0xd30c('0x16')](function(_0x2e7d66){logger[_0xd30c('0x12')](_0xd30c('0x1c'),_0x2e7d66[_0xd30c('0x13')],_0x522dbf);_0x4ccef2(_0x208074[_0xd30c('0x12')](0x1f4,_0x2e7d66[_0xd30c('0x13')]));});});};
\ No newline at end of file
index 8c7cd9f..e102fb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2885=['../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1bdc59,_0x17dd89){var _0x42ea29=function(_0x6830cd){while(--_0x6830cd){_0x1bdc59['push'](_0x1bdc59['shift']());}};_0x42ea29(++_0x17dd89);}(_0x2885,0x122));var _0x5288=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x2885[_0x4b73a2];return _0x383c66;};'use strict';var multer=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var path=require(_0x5288('0x2'));var timeout=require(_0x5288('0x3'));var express=require(_0x5288('0x4'));var router=express[_0x5288('0x5')]();var fs_extra=require(_0x5288('0x6'));var auth=require(_0x5288('0x7'));var interaction=require(_0x5288('0x8'));var config=require(_0x5288('0x9'));var controller=require(_0x5288('0xa'));router[_0x5288('0xb')]('/',auth[_0x5288('0xc')](),controller[_0x5288('0xd')]);router[_0x5288('0xb')]('/:id',auth[_0x5288('0xc')](),controller[_0x5288('0xe')]);router[_0x5288('0xb')](_0x5288('0xf'),auth[_0x5288('0xc')](),timeout(_0x5288('0x10')),controller['test']);router[_0x5288('0x11')]('/',auth[_0x5288('0xc')](),controller[_0x5288('0x12')]);router[_0x5288('0x13')](_0x5288('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x5288('0x15')](_0x5288('0x14'),auth['isAuthenticated'](),controller[_0x5288('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x8ec6=['get','isAuthenticated','index','/:id','show','/:id/test','15s','test','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ec6,0x9f));var _0x68ec=function(_0x3682f1,_0x13fed6){_0x3682f1=_0x3682f1-0x0;var _0x5f4868=_0x8ec6[_0x3682f1];return _0x5f4868;};'use strict';var multer=require(_0x68ec('0x0'));var util=require('util');var path=require(_0x68ec('0x1'));var timeout=require(_0x68ec('0x2'));var express=require(_0x68ec('0x3'));var router=express[_0x68ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x68ec('0x5'));var interaction=require(_0x68ec('0x6'));var config=require(_0x68ec('0x7'));var controller=require(_0x68ec('0x8'));router[_0x68ec('0x9')]('/',auth[_0x68ec('0xa')](),controller[_0x68ec('0xb')]);router[_0x68ec('0x9')](_0x68ec('0xc'),auth[_0x68ec('0xa')](),controller[_0x68ec('0xd')]);router[_0x68ec('0x9')](_0x68ec('0xe'),auth[_0x68ec('0xa')](),timeout(_0x68ec('0xf')),controller[_0x68ec('0x10')]);router['post']('/',auth[_0x68ec('0xa')](),controller['create']);router[_0x68ec('0x11')](_0x68ec('0xc'),auth[_0x68ec('0xa')](),controller[_0x68ec('0x12')]);router['delete']('/:id',auth[_0x68ec('0xa')](),controller[_0x68ec('0x13')]);module[_0x68ec('0x14')]=router;
\ No newline at end of file
index 88270fc..42437c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31bc=['STRING','sequelize','exports','name'];(function(_0x5d5df9,_0x1172a){var _0x1ed248=function(_0x28916c){while(--_0x28916c){_0x5d5df9['push'](_0x5d5df9['shift']());}};_0x1ed248(++_0x1172a);}(_0x31bc,0x121));var _0xc31b=function(_0x5979e7,_0x2a8391){_0x5979e7=_0x5979e7-0x0;var _0x5b08be=_0x31bc[_0x5979e7];return _0x5b08be;};'use strict';var Sequelize=require(_0xc31b('0x0'));module[_0xc31b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc31b('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xc31b('0x3')]},'description':{'type':Sequelize[_0xc31b('0x3')]}};
\ No newline at end of file
+var _0x7460=['name','sequelize','exports','STRING'];(function(_0x23d7a7,_0x4b0f57){var _0x43f390=function(_0x3528d0){while(--_0x3528d0){_0x23d7a7['push'](_0x23d7a7['shift']());}};_0x43f390(++_0x4b0f57);}(_0x7460,0x14d));var _0x0746=function(_0xafcda6,_0x2817b9){_0xafcda6=_0xafcda6-0x0;var _0x2f00c5=_0x7460[_0xafcda6];return _0x2f00c5;};'use strict';var Sequelize=require(_0x0746('0x0'));module[_0x0746('0x1')]={'name':{'type':Sequelize[_0x0746('0x2')],'unique':_0x0746('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0746('0x2')]},'description':{'type':Sequelize[_0x0746('0x2')]}};
\ No newline at end of file
index ae183c6..e38a8d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7546=['count','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','index','map','SquareOdbc','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','options','findAll','catch','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','params','test','dsn','odbc','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','end','status','json','limit','undefined','offset'];(function(_0x245186,_0x1550ff){var _0x58c8d2=function(_0x116b48){while(--_0x116b48){_0x245186['push'](_0x245186['shift']());}};_0x58c8d2(++_0x1550ff);}(_0x7546,0x11a));var _0x6754=function(_0x5a596e,_0x1f3e9a){_0x5a596e=_0x5a596e-0x0;var _0x3b31c7=_0x7546[_0x5a596e];return _0x3b31c7;};'use strict';var emlformat=require(_0x6754('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6754('0x1'));var jsonpatch=require(_0x6754('0x2'));var rp=require(_0x6754('0x3'));var moment=require(_0x6754('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6754('0x5'));var path=require(_0x6754('0x6'));var sox=require('sox');var csv=require(_0x6754('0x7'));var ejs=require(_0x6754('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6754('0x9'));var squel=require(_0x6754('0xa'));var crypto=require(_0x6754('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6754('0xc'));var Papa=require('papaparse');var Redis=require(_0x6754('0xd'));var authService=require(_0x6754('0xe'));var qs=require(_0x6754('0xf'));var as=require(_0x6754('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6754('0x11'))('api');var utils=require(_0x6754('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6754('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x549d6b,_0x1b673f){_0x1b673f=_0x1b673f||0xcc;return function(_0xd40dd1){if(_0xd40dd1){return _0x549d6b['sendStatus'](_0x1b673f);}return _0x549d6b['status'](_0x1b673f)[_0x6754('0x14')]();};}function respondWithResult(_0xde2d68,_0x7be547){_0x7be547=_0x7be547||0xc8;return function(_0x284e1f){if(_0x284e1f){return _0xde2d68[_0x6754('0x15')](_0x7be547)[_0x6754('0x16')](_0x284e1f);}};}function respondWithFilteredResult(_0x4d6e9b,_0x59b27a){return function(_0x408f23){if(_0x408f23){var _0x26a722=typeof _0x59b27a['offset']==='undefined'&&typeof _0x59b27a[_0x6754('0x17')]===_0x6754('0x18');var _0x4297d5=_0x408f23['count'];var _0x1d0ec7=_0x26a722?0x0:_0x59b27a[_0x6754('0x19')];var _0x488441=_0x26a722?_0x408f23[_0x6754('0x1a')]:_0x59b27a[_0x6754('0x19')]+_0x59b27a[_0x6754('0x17')];var _0x4998ff;if(_0x488441>=_0x4297d5){_0x488441=_0x4297d5;_0x4998ff=0xc8;}else{_0x4998ff=0xce;}_0x4d6e9b['status'](_0x4998ff);return _0x4d6e9b[_0x6754('0x1b')](_0x6754('0x1c'),_0x1d0ec7+'-'+_0x488441+'/'+_0x4297d5)[_0x6754('0x16')](_0x408f23);}return null;};}function patchUpdates(_0xc0ffce){return function(_0x481167){try{jsonpatch[_0x6754('0x1d')](_0x481167,_0xc0ffce,!![]);}catch(_0x115d58){return BPromise[_0x6754('0x1e')](_0x115d58);}return _0x481167[_0x6754('0x1f')]();};}function saveUpdates(_0x1f10af,_0x41634a){return function(_0x5be698){if(_0x5be698){return _0x5be698['update'](_0x1f10af)[_0x6754('0x20')](function(_0x4feff8){return _0x4feff8;});}return null;};}function removeEntity(_0xa07dd0,_0x1f22e6){return function(_0x356404){if(_0x356404){return _0x356404[_0x6754('0x21')]()[_0x6754('0x20')](function(){var _0x2daa60=_0x356404[_0x6754('0x22')]({'plain':!![]});var _0x47f867=_0x6754('0x23');return db[_0x6754('0x24')][_0x6754('0x21')]({'where':{'type':_0x47f867,'resourceId':_0x2daa60['id']}})[_0x6754('0x20')](function(){return _0x356404;});})[_0x6754('0x20')](function(){_0xa07dd0[_0x6754('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x226d50,_0x43f5e7){return function(_0x16fe43){if(!_0x16fe43){_0x226d50['sendStatus'](0x194);}return _0x16fe43;};}function handleError(_0x15e8a2,_0x1ed515){_0x1ed515=_0x1ed515||0x1f4;return function(_0x283b5f){logger[_0x6754('0x25')](_0x283b5f[_0x6754('0x26')]);if(_0x283b5f[_0x6754('0x27')]){delete _0x283b5f[_0x6754('0x27')];}_0x15e8a2['status'](_0x1ed515)['send'](_0x283b5f);};}exports[_0x6754('0x28')]=function(_0x3dcda4,_0x44b8d4){var _0x8fa146={},_0x4cf659={},_0x4ec9e2={'count':0x0,'rows':[]};var _0xb9a7a4=_[_0x6754('0x29')](db[_0x6754('0x2a')]['rawAttributes'],function(_0xebfdf9){return{'name':_0xebfdf9[_0x6754('0x2b')],'type':_0xebfdf9['type'][_0x6754('0x2c')]};});_0x4cf659['model']=_['map'](_0xb9a7a4,_0x6754('0x27'));_0x4cf659[_0x6754('0x2d')]=_[_0x6754('0x2e')](_0x3dcda4[_0x6754('0x2d')]);_0x4cf659[_0x6754('0x2f')]=_[_0x6754('0x30')](_0x4cf659['model'],_0x4cf659['query']);_0x8fa146[_0x6754('0x31')]=_[_0x6754('0x30')](_0x4cf659[_0x6754('0x32')],qs[_0x6754('0x33')](_0x3dcda4['query'][_0x6754('0x33')]));_0x8fa146[_0x6754('0x31')]=_0x8fa146[_0x6754('0x31')][_0x6754('0x34')]?_0x8fa146[_0x6754('0x31')]:_0x4cf659['model'];if(!_0x3dcda4[_0x6754('0x2d')][_0x6754('0x35')](_0x6754('0x36'))){_0x8fa146[_0x6754('0x17')]=qs[_0x6754('0x17')](_0x3dcda4['query'][_0x6754('0x17')]);_0x8fa146[_0x6754('0x19')]=qs[_0x6754('0x19')](_0x3dcda4[_0x6754('0x2d')]['offset']);}_0x8fa146['order']=qs[_0x6754('0x37')](_0x3dcda4[_0x6754('0x2d')]['sort']);_0x8fa146['where']=qs[_0x6754('0x2f')](_[_0x6754('0x38')](_0x3dcda4[_0x6754('0x2d')],_0x4cf659[_0x6754('0x2f')]),_0xb9a7a4);if(_0x3dcda4[_0x6754('0x2d')][_0x6754('0x39')]){_0x8fa146['where']=_[_0x6754('0x3a')](_0x8fa146[_0x6754('0x3b')],{'$or':_[_0x6754('0x29')](_0xb9a7a4,function(_0x53f473){if(_0x53f473[_0x6754('0x3c')]!=='VIRTUAL'){var _0x11eed3={};_0x11eed3[_0x53f473['name']]={'$like':'%'+_0x3dcda4[_0x6754('0x2d')][_0x6754('0x39')]+'%'};return _0x11eed3;}})});}_0x8fa146=_['merge']({},_0x8fa146,_0x3dcda4[_0x6754('0x3d')]);var _0x1a9ae8={'where':_0x8fa146['where']};return db['SquareOdbc']['count'](_0x1a9ae8)['then'](function(_0x15baa2){_0x4ec9e2[_0x6754('0x1a')]=_0x15baa2;if(_0x3dcda4[_0x6754('0x2d')]['includeAll']){_0x8fa146['include']=[{'all':!![]}];}return db[_0x6754('0x2a')][_0x6754('0x3e')](_0x8fa146);})['then'](function(_0x61e507){_0x4ec9e2['rows']=_0x61e507;return _0x4ec9e2;})[_0x6754('0x20')](respondWithFilteredResult(_0x44b8d4,_0x8fa146))[_0x6754('0x3f')](handleError(_0x44b8d4,null));};exports['show']=function(_0x176503,_0x437499){var _0x26c1e3={'raw':!![],'where':{'id':_0x176503['params']['id']}},_0x1887fc={};_0x1887fc[_0x6754('0x32')]=_[_0x6754('0x2e')](db['SquareOdbc']['rawAttributes']);_0x1887fc[_0x6754('0x2d')]=_[_0x6754('0x2e')](_0x176503['query']);_0x1887fc[_0x6754('0x2f')]=_[_0x6754('0x30')](_0x1887fc[_0x6754('0x32')],_0x1887fc['query']);_0x26c1e3[_0x6754('0x31')]=_[_0x6754('0x30')](_0x1887fc[_0x6754('0x32')],qs[_0x6754('0x33')](_0x176503[_0x6754('0x2d')][_0x6754('0x33')]));_0x26c1e3[_0x6754('0x31')]=_0x26c1e3[_0x6754('0x31')]['length']?_0x26c1e3[_0x6754('0x31')]:_0x1887fc[_0x6754('0x32')];if(_0x176503['query'][_0x6754('0x40')]){_0x26c1e3['include']=[{'all':!![]}];}_0x26c1e3=_['merge']({},_0x26c1e3,_0x176503[_0x6754('0x3d')]);return db[_0x6754('0x2a')]['find'](_0x26c1e3)[_0x6754('0x20')](handleEntityNotFound(_0x437499,null))[_0x6754('0x20')](respondWithResult(_0x437499,null))[_0x6754('0x3f')](handleError(_0x437499,null));};exports[_0x6754('0x41')]=function(_0x562aff,_0x2cf92e){return db['SquareOdbc'][_0x6754('0x41')](_0x562aff[_0x6754('0x42')],{})['then'](function(_0xa306c){var _0x283d3c=_0x562aff[_0x6754('0x43')]['get']({'plain':!![]});if(!_0x283d3c)throw new Error(_0x6754('0x44'));if(_0x283d3c[_0x6754('0x45')]==='user'){var _0x4c853f=_0xa306c[_0x6754('0x22')]({'plain':!![]});var _0x32c631=_0x6754('0x23');return db[_0x6754('0x46')][_0x6754('0x47')]({'where':{'name':_0x32c631,'userProfileId':_0x283d3c['userProfileId']},'raw':!![]})[_0x6754('0x20')](function(_0x6538e8){if(_0x6538e8&&_0x6538e8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4c853f[_0x6754('0x27')],'resourceId':_0x4c853f['id'],'type':_0x6538e8[_0x6754('0x27')],'sectionId':_0x6538e8['id']},{})['then'](function(){return _0xa306c;});}else{return _0xa306c;}})[_0x6754('0x3f')](function(_0x17a9ea){logger[_0x6754('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17a9ea);throw _0x17a9ea;});}return _0xa306c;})[_0x6754('0x20')](respondWithResult(_0x2cf92e,0xc9))['catch'](handleError(_0x2cf92e,null));};exports['update']=function(_0x5aa14d,_0x2e1e0b){if(_0x5aa14d['body']['id']){delete _0x5aa14d['body']['id'];}return db[_0x6754('0x2a')][_0x6754('0x47')]({'where':{'id':_0x5aa14d[_0x6754('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e1e0b,null))[_0x6754('0x20')](saveUpdates(_0x5aa14d[_0x6754('0x42')],null))['then'](respondWithResult(_0x2e1e0b,null))[_0x6754('0x3f')](handleError(_0x2e1e0b,null));};exports[_0x6754('0x21')]=function(_0x11158c,_0x46c3bd){return db['SquareOdbc'][_0x6754('0x47')]({'where':{'id':_0x11158c[_0x6754('0x48')]['id']}})['then'](handleEntityNotFound(_0x46c3bd,null))[_0x6754('0x20')](removeEntity(_0x46c3bd,null))[_0x6754('0x3f')](handleError(_0x46c3bd,null));};exports[_0x6754('0x49')]=function(_0x28f5cb,_0x58896e,_0x340849){var _0x511bf0;return db[_0x6754('0x2a')][_0x6754('0x47')]({'where':{'id':_0x28f5cb[_0x6754('0x48')]['id']},'attributes':['id',_0x6754('0x4a')]})[_0x6754('0x20')](handleEntityNotFound(_0x58896e,null))[_0x6754('0x20')](function(_0x1dc936){if(_0x1dc936){var _0xe8c431=require(_0x6754('0x4b'))();_0xe8c431['openSync'](_0x1dc936['dsn']);_0xe8c431[_0x6754('0x4c')]();return _0x1dc936;}})[_0x6754('0x20')](respondWithResult(_0x58896e,null))[_0x6754('0x3f')](handleError(_0x58896e,null));};
\ No newline at end of file
+var _0x866b=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','SquareOdbc','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','update','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x866b,0xa9));var _0xb866=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0x866b[_0x1b1365];return _0x5edfd8;};'use strict';var emlformat=require(_0xb866('0x0'));var rimraf=require(_0xb866('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb866('0x2'));var rp=require(_0xb866('0x3'));var moment=require(_0xb866('0x4'));var BPromise=require(_0xb866('0x5'));var Mustache=require('mustache');var util=require(_0xb866('0x6'));var path=require(_0xb866('0x7'));var sox=require(_0xb866('0x8'));var csv=require(_0xb866('0x9'));var ejs=require(_0xb866('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb866('0xb'));var squel=require(_0xb866('0xc'));var crypto=require(_0xb866('0xd'));var jsforce=require(_0xb866('0xe'));var deskjs=require(_0xb866('0xf'));var toCsv=require(_0xb866('0x9'));var querystring=require(_0xb866('0x10'));var Papa=require('papaparse');var Redis=require(_0xb866('0x11'));var authService=require(_0xb866('0x12'));var qs=require(_0xb866('0x13'));var as=require(_0xb866('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb866('0x15'));var utils=require(_0xb866('0x16'));var config=require(_0xb866('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb866('0x18'))['db'];function respondWithStatusCode(_0x41174b,_0x15dba7){_0x15dba7=_0x15dba7||0xcc;return function(_0x1ba6f6){if(_0x1ba6f6){return _0x41174b[_0xb866('0x19')](_0x15dba7);}return _0x41174b[_0xb866('0x1a')](_0x15dba7)[_0xb866('0x1b')]();};}function respondWithResult(_0x30d253,_0x504de1){_0x504de1=_0x504de1||0xc8;return function(_0x34fb40){if(_0x34fb40){return _0x30d253['status'](_0x504de1)['json'](_0x34fb40);}};}function respondWithFilteredResult(_0x3bd579,_0x392a5d){return function(_0x552489){if(_0x552489){var _0x7eb68d=typeof _0x392a5d[_0xb866('0x1c')]===_0xb866('0x1d')&&typeof _0x392a5d['limit']==='undefined';var _0x3fe443=_0x552489[_0xb866('0x1e')];var _0x142e30=_0x7eb68d?0x0:_0x392a5d[_0xb866('0x1c')];var _0x4991ad=_0x7eb68d?_0x552489[_0xb866('0x1e')]:_0x392a5d[_0xb866('0x1c')]+_0x392a5d[_0xb866('0x1f')];var _0x108dab;if(_0x4991ad>=_0x3fe443){_0x4991ad=_0x3fe443;_0x108dab=0xc8;}else{_0x108dab=0xce;}_0x3bd579[_0xb866('0x1a')](_0x108dab);return _0x3bd579[_0xb866('0x20')](_0xb866('0x21'),_0x142e30+'-'+_0x4991ad+'/'+_0x3fe443)[_0xb866('0x22')](_0x552489);}return null;};}function patchUpdates(_0x938613){return function(_0x280f32){try{jsonpatch[_0xb866('0x23')](_0x280f32,_0x938613,!![]);}catch(_0x1f2bfc){return BPromise['reject'](_0x1f2bfc);}return _0x280f32['save']();};}function saveUpdates(_0xc5a3d1,_0x5761c6){return function(_0x3c5cd3){if(_0x3c5cd3){return _0x3c5cd3['update'](_0xc5a3d1)[_0xb866('0x24')](function(_0x384c0e){return _0x384c0e;});}return null;};}function removeEntity(_0x4daf81,_0x273d17){return function(_0x109edf){if(_0x109edf){return _0x109edf[_0xb866('0x25')]()[_0xb866('0x24')](function(){var _0x3153e0=_0x109edf[_0xb866('0x26')]({'plain':!![]});var _0x5057de=_0xb866('0x27');return db[_0xb866('0x28')][_0xb866('0x25')]({'where':{'type':_0x5057de,'resourceId':_0x3153e0['id']}})[_0xb866('0x24')](function(){return _0x109edf;});})[_0xb866('0x24')](function(){_0x4daf81['status'](0xcc)[_0xb866('0x1b')]();});}};}function handleEntityNotFound(_0x5c2483,_0x12f406){return function(_0x2ca847){if(!_0x2ca847){_0x5c2483[_0xb866('0x19')](0x194);}return _0x2ca847;};}function handleError(_0x1d770c,_0x5167c1){_0x5167c1=_0x5167c1||0x1f4;return function(_0x57e9cc){logger[_0xb866('0x29')](_0x57e9cc[_0xb866('0x2a')]);if(_0x57e9cc[_0xb866('0x2b')]){delete _0x57e9cc['name'];}_0x1d770c[_0xb866('0x1a')](_0x5167c1)[_0xb866('0x2c')](_0x57e9cc);};}exports[_0xb866('0x2d')]=function(_0x5d6854,_0x2a17f6){var _0x34806b={},_0x5c75db={},_0x512e2a={'count':0x0,'rows':[]};var _0x761cae=_['map'](db[_0xb866('0x2e')]['rawAttributes'],function(_0x3f0838){return{'name':_0x3f0838[_0xb866('0x2f')],'type':_0x3f0838[_0xb866('0x30')]['key']};});_0x5c75db[_0xb866('0x31')]=_[_0xb866('0x32')](_0x761cae,_0xb866('0x2b'));_0x5c75db[_0xb866('0x33')]=_['keys'](_0x5d6854[_0xb866('0x33')]);_0x5c75db[_0xb866('0x34')]=_[_0xb866('0x35')](_0x5c75db[_0xb866('0x31')],_0x5c75db[_0xb866('0x33')]);_0x34806b[_0xb866('0x36')]=_[_0xb866('0x35')](_0x5c75db['model'],qs[_0xb866('0x37')](_0x5d6854[_0xb866('0x33')]['fields']));_0x34806b[_0xb866('0x36')]=_0x34806b[_0xb866('0x36')][_0xb866('0x38')]?_0x34806b['attributes']:_0x5c75db[_0xb866('0x31')];if(!_0x5d6854[_0xb866('0x33')][_0xb866('0x39')](_0xb866('0x3a'))){_0x34806b[_0xb866('0x1f')]=qs[_0xb866('0x1f')](_0x5d6854[_0xb866('0x33')]['limit']);_0x34806b[_0xb866('0x1c')]=qs['offset'](_0x5d6854[_0xb866('0x33')]['offset']);}_0x34806b[_0xb866('0x3b')]=qs[_0xb866('0x3c')](_0x5d6854[_0xb866('0x33')][_0xb866('0x3c')]);_0x34806b['where']=qs[_0xb866('0x34')](_[_0xb866('0x3d')](_0x5d6854[_0xb866('0x33')],_0x5c75db[_0xb866('0x34')]),_0x761cae);if(_0x5d6854[_0xb866('0x33')][_0xb866('0x3e')]){_0x34806b[_0xb866('0x3f')]=_[_0xb866('0x40')](_0x34806b[_0xb866('0x3f')],{'$or':_[_0xb866('0x32')](_0x761cae,function(_0x3f381d){if(_0x3f381d[_0xb866('0x30')]!==_0xb866('0x41')){var _0x198e3d={};_0x198e3d[_0x3f381d[_0xb866('0x2b')]]={'$like':'%'+_0x5d6854[_0xb866('0x33')][_0xb866('0x3e')]+'%'};return _0x198e3d;}})});}_0x34806b=_['merge']({},_0x34806b,_0x5d6854['options']);var _0x296914={'where':_0x34806b[_0xb866('0x3f')]};return db['SquareOdbc'][_0xb866('0x1e')](_0x296914)[_0xb866('0x24')](function(_0x1eae91){_0x512e2a[_0xb866('0x1e')]=_0x1eae91;if(_0x5d6854[_0xb866('0x33')][_0xb866('0x42')]){_0x34806b[_0xb866('0x43')]=[{'all':!![]}];}return db[_0xb866('0x2e')][_0xb866('0x44')](_0x34806b);})[_0xb866('0x24')](function(_0x421225){_0x512e2a[_0xb866('0x45')]=_0x421225;return _0x512e2a;})['then'](respondWithFilteredResult(_0x2a17f6,_0x34806b))[_0xb866('0x46')](handleError(_0x2a17f6,null));};exports[_0xb866('0x47')]=function(_0x3fb0d8,_0x4db307){var _0x187d1d={'raw':!![],'where':{'id':_0x3fb0d8[_0xb866('0x48')]['id']}},_0x72ee9a={};_0x72ee9a[_0xb866('0x31')]=_['keys'](db[_0xb866('0x2e')]['rawAttributes']);_0x72ee9a[_0xb866('0x33')]=_[_0xb866('0x49')](_0x3fb0d8['query']);_0x72ee9a['filters']=_[_0xb866('0x35')](_0x72ee9a[_0xb866('0x31')],_0x72ee9a['query']);_0x187d1d[_0xb866('0x36')]=_[_0xb866('0x35')](_0x72ee9a[_0xb866('0x31')],qs[_0xb866('0x37')](_0x3fb0d8[_0xb866('0x33')][_0xb866('0x37')]));_0x187d1d[_0xb866('0x36')]=_0x187d1d['attributes'][_0xb866('0x38')]?_0x187d1d[_0xb866('0x36')]:_0x72ee9a[_0xb866('0x31')];if(_0x3fb0d8[_0xb866('0x33')][_0xb866('0x42')]){_0x187d1d[_0xb866('0x43')]=[{'all':!![]}];}_0x187d1d=_[_0xb866('0x40')]({},_0x187d1d,_0x3fb0d8[_0xb866('0x4a')]);return db[_0xb866('0x2e')]['find'](_0x187d1d)[_0xb866('0x24')](handleEntityNotFound(_0x4db307,null))[_0xb866('0x24')](respondWithResult(_0x4db307,null))[_0xb866('0x46')](handleError(_0x4db307,null));};exports['create']=function(_0x3f7525,_0x5510f9){return db[_0xb866('0x2e')][_0xb866('0x4b')](_0x3f7525[_0xb866('0x4c')],{})['then'](function(_0xcbdc0f){var _0x25301e=_0x3f7525['user'][_0xb866('0x26')]({'plain':!![]});if(!_0x25301e)throw new Error(_0xb866('0x4d'));if(_0x25301e[_0xb866('0x4e')]===_0xb866('0x4f')){var _0x22b005=_0xcbdc0f[_0xb866('0x26')]({'plain':!![]});var _0x3f2e8e='ODBC';return db[_0xb866('0x50')][_0xb866('0x51')]({'where':{'name':_0x3f2e8e,'userProfileId':_0x25301e[_0xb866('0x52')]},'raw':!![]})[_0xb866('0x24')](function(_0x194adf){if(_0x194adf&&_0x194adf['autoAssociation']===0x0){return db['UserProfileResource'][_0xb866('0x4b')]({'name':_0x22b005[_0xb866('0x2b')],'resourceId':_0x22b005['id'],'type':_0x194adf[_0xb866('0x2b')],'sectionId':_0x194adf['id']},{})[_0xb866('0x24')](function(){return _0xcbdc0f;});}else{return _0xcbdc0f;}})[_0xb866('0x46')](function(_0x488309){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x488309);throw _0x488309;});}return _0xcbdc0f;})[_0xb866('0x24')](respondWithResult(_0x5510f9,0xc9))[_0xb866('0x46')](handleError(_0x5510f9,null));};exports[_0xb866('0x53')]=function(_0x4f6580,_0x57a210){if(_0x4f6580['body']['id']){delete _0x4f6580[_0xb866('0x4c')]['id'];}return db[_0xb866('0x2e')]['find']({'where':{'id':_0x4f6580[_0xb866('0x48')]['id']}})[_0xb866('0x24')](handleEntityNotFound(_0x57a210,null))['then'](saveUpdates(_0x4f6580[_0xb866('0x4c')],null))[_0xb866('0x24')](respondWithResult(_0x57a210,null))['catch'](handleError(_0x57a210,null));};exports[_0xb866('0x25')]=function(_0x427d16,_0x488128){return db[_0xb866('0x2e')][_0xb866('0x51')]({'where':{'id':_0x427d16[_0xb866('0x48')]['id']}})[_0xb866('0x24')](handleEntityNotFound(_0x488128,null))[_0xb866('0x24')](removeEntity(_0x488128,null))[_0xb866('0x46')](handleError(_0x488128,null));};exports[_0xb866('0x54')]=function(_0x163714,_0x336ea6,_0x3d26cc){var _0xdbee99;return db[_0xb866('0x2e')]['find']({'where':{'id':_0x163714[_0xb866('0x48')]['id']},'attributes':['id',_0xb866('0x55')]})['then'](handleEntityNotFound(_0x336ea6,null))['then'](function(_0x5559fc){if(_0x5559fc){var _0x1d5f33=require(_0xb866('0x56'))();_0x1d5f33[_0xb866('0x57')](_0x5559fc[_0xb866('0x55')]);_0x1d5f33[_0xb866('0x58')]();return _0x5559fc;}})[_0xb866('0x24')](respondWithResult(_0x336ea6,null))['catch'](handleError(_0x336ea6,null));};
\ No newline at end of file
index 8620b9f..01ddc8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35be=['exports','define','SquareOdbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x35be,0x92));var _0xe35b=function(_0x43130c,_0x1a0e3e){_0x43130c=_0x43130c-0x0;var _0x570f1a=_0x35be[_0x43130c];return _0x570f1a;};'use strict';var _=require(_0xe35b('0x0'));var util=require(_0xe35b('0x1'));var logger=require('../../config/logger')(_0xe35b('0x2'));var moment=require(_0xe35b('0x3'));var BPromise=require(_0xe35b('0x4'));var rp=require(_0xe35b('0x5'));var fs=require('fs');var path=require(_0xe35b('0x6'));var rimraf=require(_0xe35b('0x7'));var config=require(_0xe35b('0x8'));var attributes=require(_0xe35b('0x9'));module[_0xe35b('0xa')]=function(_0x27d5a2,_0x20e390){return _0x27d5a2[_0xe35b('0xb')](_0xe35b('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x843c=['rimraf','../../config/environment','define','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x480d5b,_0x196dca){var _0xfe2cc0=function(_0x5007bf){while(--_0x5007bf){_0x480d5b['push'](_0x480d5b['shift']());}};_0xfe2cc0(++_0x196dca);}(_0x843c,0x9e));var _0xc843=function(_0x1ba3c7,_0x292411){_0x1ba3c7=_0x1ba3c7-0x0;var _0x23550d=_0x843c[_0x1ba3c7];return _0x23550d;};'use strict';var _=require(_0xc843('0x0'));var util=require(_0xc843('0x1'));var logger=require(_0xc843('0x2'))(_0xc843('0x3'));var moment=require(_0xc843('0x4'));var BPromise=require(_0xc843('0x5'));var rp=require(_0xc843('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc843('0x7'));var config=require(_0xc843('0x8'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x39f1b2,_0x2440bc){return _0x39f1b2[_0xc843('0x9')](_0xc843('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8991728..91d8ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af8=['model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','map','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9af8,0x1f0));var _0x89af=function(_0x32a634,_0x38285f){_0x32a634=_0x32a634-0x0;var _0x41c3d1=_0x9af8[_0x32a634];return _0x41c3d1;};'use strict';var _=require(_0x89af('0x0'));var util=require(_0x89af('0x1'));var moment=require(_0x89af('0x2'));var BPromise=require(_0x89af('0x3'));var rs=require(_0x89af('0x4'));var fs=require('fs');var Redis=require(_0x89af('0x5'));var db=require(_0x89af('0x6'))['db'];var utils=require(_0x89af('0x7'));var logger=require(_0x89af('0x8'))('rpc');var config=require(_0x89af('0x9'));var jayson=require(_0x89af('0xa'));var client=jayson[_0x89af('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59bcec,_0x10f188,_0x13586e){return new BPromise(function(_0x48ec0b,_0x4a73a5){return client['request'](_0x59bcec,_0x13586e)[_0x89af('0xc')](function(_0x57d11e){logger[_0x89af('0xd')](_0x89af('0xe'),_0x10f188,_0x89af('0xf'));logger[_0x89af('0x10')](_0x89af('0x11'),_0x10f188,_0x89af('0xf'),JSON[_0x89af('0x12')](_0x57d11e));if(_0x57d11e[_0x89af('0x13')]){if(_0x57d11e[_0x89af('0x13')][_0x89af('0x14')]===0x1f4){logger[_0x89af('0x13')](_0x89af('0xe'),_0x10f188,_0x57d11e[_0x89af('0x13')]['message']);return _0x4a73a5(_0x57d11e[_0x89af('0x13')][_0x89af('0x15')]);}logger['error'](_0x89af('0xe'),_0x10f188,_0x57d11e[_0x89af('0x13')][_0x89af('0x15')]);return _0x48ec0b(_0x57d11e['error'][_0x89af('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x10f188,'request\x20sent');_0x48ec0b(_0x57d11e[_0x89af('0x16')][_0x89af('0x15')]);}})[_0x89af('0x17')](function(_0x159fe1){logger[_0x89af('0x13')](_0x89af('0xe'),_0x10f188,_0x159fe1);_0x4a73a5(_0x159fe1);});});}exports[_0x89af('0x18')]=function(_0x234bbe){var _0x4c91ed=this;return new Promise(function(_0x4367ac,_0x479775){return db['SquareOdbc'][_0x89af('0x19')]({'raw':_0x234bbe[_0x89af('0x1a')]?_0x234bbe[_0x89af('0x1a')][_0x89af('0x1b')]===undefined?!![]:![]:!![],'where':_0x234bbe[_0x89af('0x1a')]?_0x234bbe[_0x89af('0x1a')][_0x89af('0x1c')]||null:null,'attributes':_0x234bbe[_0x89af('0x1a')]?_0x234bbe[_0x89af('0x1a')][_0x89af('0x1d')]||null:null,'include':_0x234bbe['options']?_0x234bbe[_0x89af('0x1a')]['include']?_[_0x89af('0x1e')](_0x234bbe['options'][_0x89af('0x1f')],function(_0x7ac1dd){return{'model':db[_0x7ac1dd[_0x89af('0x20')]],'as':_0x7ac1dd['as'],'attributes':_0x7ac1dd[_0x89af('0x1d')],'include':_0x7ac1dd['include']?_[_0x89af('0x1e')](_0x7ac1dd[_0x89af('0x1f')],function(_0x5aa2d9){return{'model':db[_0x5aa2d9[_0x89af('0x20')]],'as':_0x5aa2d9['as'],'attributes':_0x5aa2d9[_0x89af('0x1d')],'include':_0x5aa2d9[_0x89af('0x1f')]?_[_0x89af('0x1e')](_0x5aa2d9[_0x89af('0x1f')],function(_0x395167){return{'model':db[_0x395167[_0x89af('0x20')]],'as':_0x395167['as'],'attributes':_0x395167[_0x89af('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fde92){logger['info'](_0x89af('0x18'),_0x234bbe);logger[_0x89af('0x10')](_0x89af('0x18'),_0x234bbe,JSON[_0x89af('0x12')](_0x3fde92));_0x4367ac(_0x3fde92);})[_0x89af('0x17')](function(_0x1c9ffb){logger[_0x89af('0x13')](_0x89af('0x18'),_0x1c9ffb[_0x89af('0x15')],_0x234bbe);_0x479775(_0x4c91ed[_0x89af('0x13')](0x1f4,_0x1c9ffb[_0x89af('0x15')]));});});};
\ No newline at end of file
+var _0x7d88=['request\x20sent','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','info','stringify','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x5e8422,_0xb949e2){var _0x4144b8=function(_0x49e171){while(--_0x49e171){_0x5e8422['push'](_0x5e8422['shift']());}};_0x4144b8(++_0xb949e2);}(_0x7d88,0x8e));var _0x87d8=function(_0x182cb2,_0x269638){_0x182cb2=_0x182cb2-0x0;var _0xdd9111=_0x7d88[_0x182cb2];return _0xdd9111;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x87d8('0x0'));var BPromise=require(_0x87d8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87d8('0x2'));var db=require(_0x87d8('0x3'))['db'];var utils=require(_0x87d8('0x4'));var logger=require(_0x87d8('0x5'))(_0x87d8('0x6'));var config=require('../../config/environment');var jayson=require(_0x87d8('0x7'));var client=jayson[_0x87d8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d1589,_0x190f39,_0x16b4e9){return new BPromise(function(_0x974c14,_0x1a2e4f){return client['request'](_0x2d1589,_0x16b4e9)[_0x87d8('0x9')](function(_0x5ccf11){logger['info'](_0x87d8('0xa'),_0x190f39,'request\x20sent');logger[_0x87d8('0xb')](_0x87d8('0xc'),_0x190f39,_0x87d8('0xd'),JSON['stringify'](_0x5ccf11));if(_0x5ccf11[_0x87d8('0xe')]){if(_0x5ccf11[_0x87d8('0xe')][_0x87d8('0xf')]===0x1f4){logger[_0x87d8('0xe')](_0x87d8('0xa'),_0x190f39,_0x5ccf11[_0x87d8('0xe')][_0x87d8('0x10')]);return _0x1a2e4f(_0x5ccf11[_0x87d8('0xe')]['message']);}logger[_0x87d8('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x190f39,_0x5ccf11[_0x87d8('0xe')][_0x87d8('0x10')]);return _0x974c14(_0x5ccf11['error'][_0x87d8('0x10')]);}else{logger['info'](_0x87d8('0xa'),_0x190f39,_0x87d8('0xd'));_0x974c14(_0x5ccf11[_0x87d8('0x11')][_0x87d8('0x10')]);}})[_0x87d8('0x12')](function(_0x293ca2){logger[_0x87d8('0xe')](_0x87d8('0xa'),_0x190f39,_0x293ca2);_0x1a2e4f(_0x293ca2);});});}exports[_0x87d8('0x13')]=function(_0x5b19bf){var _0x4e6959=this;return new Promise(function(_0x55010a,_0x5bd87a){return db[_0x87d8('0x14')][_0x87d8('0x15')]({'raw':_0x5b19bf['options']?_0x5b19bf[_0x87d8('0x16')][_0x87d8('0x17')]===undefined?!![]:![]:!![],'where':_0x5b19bf[_0x87d8('0x16')]?_0x5b19bf['options'][_0x87d8('0x18')]||null:null,'attributes':_0x5b19bf[_0x87d8('0x16')]?_0x5b19bf['options'][_0x87d8('0x19')]||null:null,'include':_0x5b19bf['options']?_0x5b19bf[_0x87d8('0x16')][_0x87d8('0x1a')]?_['map'](_0x5b19bf[_0x87d8('0x16')][_0x87d8('0x1a')],function(_0x1f0e96){return{'model':db[_0x1f0e96['model']],'as':_0x1f0e96['as'],'attributes':_0x1f0e96[_0x87d8('0x19')],'include':_0x1f0e96['include']?_[_0x87d8('0x1b')](_0x1f0e96[_0x87d8('0x1a')],function(_0xde8696){return{'model':db[_0xde8696[_0x87d8('0x1c')]],'as':_0xde8696['as'],'attributes':_0xde8696[_0x87d8('0x19')],'include':_0xde8696[_0x87d8('0x1a')]?_[_0x87d8('0x1b')](_0xde8696[_0x87d8('0x1a')],function(_0xc409d1){return{'model':db[_0xc409d1['model']],'as':_0xc409d1['as'],'attributes':_0xc409d1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dec75){logger[_0x87d8('0x1d')]('ShowSquareOdbc',_0x5b19bf);logger['debug'](_0x87d8('0x13'),_0x5b19bf,JSON[_0x87d8('0x1e')](_0x2dec75));_0x55010a(_0x2dec75);})[_0x87d8('0x12')](function(_0x316d42){logger[_0x87d8('0xe')](_0x87d8('0x13'),_0x316d42[_0x87d8('0x10')],_0x5b19bf);_0x5bd87a(_0x4e6959[_0x87d8('0xe')](0x1f4,_0x316d42[_0x87d8('0x10')]));});});};
\ No newline at end of file
index 48b5f26..e124055 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a5c=['/:id','isAuthenticated','/:id/users','getUsers','post','create','put','update','delete','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','index'];(function(_0x4a28a9,_0x2590b5){var _0x3d30c9=function(_0x2a937a){while(--_0x2a937a){_0x4a28a9['push'](_0x4a28a9['shift']());}};_0x3d30c9(++_0x2590b5);}(_0x8a5c,0x136));var _0xc8a5=function(_0x36dd92,_0x174d64){_0x36dd92=_0x36dd92-0x0;var _0x1513e7=_0x8a5c[_0x36dd92];return _0x1513e7;};'use strict';var multer=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var path=require(_0xc8a5('0x2'));var timeout=require(_0xc8a5('0x3'));var express=require(_0xc8a5('0x4'));var router=express[_0xc8a5('0x5')]();var fs_extra=require(_0xc8a5('0x6'));var auth=require(_0xc8a5('0x7'));var interaction=require(_0xc8a5('0x8'));var config=require('../../config/environment');var controller=require(_0xc8a5('0x9'));router[_0xc8a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xc8a5('0xb')]);router[_0xc8a5('0xa')](_0xc8a5('0xc'),auth[_0xc8a5('0xd')](),controller['show']);router[_0xc8a5('0xa')](_0xc8a5('0xe'),auth[_0xc8a5('0xd')](),controller[_0xc8a5('0xf')]);router[_0xc8a5('0x10')]('/',auth[_0xc8a5('0xd')](),controller[_0xc8a5('0x11')]);router[_0xc8a5('0x10')](_0xc8a5('0xe'),auth['isAuthenticated'](),controller['addUsers']);router[_0xc8a5('0x12')]('/:id',auth[_0xc8a5('0xd')](),controller[_0xc8a5('0x13')]);router[_0xc8a5('0x14')](_0xc8a5('0xc'),auth[_0xc8a5('0xd')](),controller['destroy']);router[_0xc8a5('0x14')](_0xc8a5('0xe'),auth['isAuthenticated'](),controller[_0xc8a5('0x15')]);module[_0xc8a5('0x16')]=router;
\ No newline at end of file
+var _0x13eb=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/users','getUsers','post','create','addUsers','put','update','delete','removeUsers','exports','multer','util','connect-timeout','express'];(function(_0x2052e9,_0x730641){var _0x13190c=function(_0x3aeb3b){while(--_0x3aeb3b){_0x2052e9['push'](_0x2052e9['shift']());}};_0x13190c(++_0x730641);}(_0x13eb,0x8f));var _0xb13e=function(_0x305551,_0x868339){_0x305551=_0x305551-0x0;var _0x115ce2=_0x13eb[_0x305551];return _0x115ce2;};'use strict';var multer=require(_0xb13e('0x0'));var util=require(_0xb13e('0x1'));var path=require('path');var timeout=require(_0xb13e('0x2'));var express=require(_0xb13e('0x3'));var router=express['Router']();var fs_extra=require(_0xb13e('0x4'));var auth=require(_0xb13e('0x5'));var interaction=require(_0xb13e('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xb13e('0x7')]('/',auth[_0xb13e('0x8')](),controller[_0xb13e('0x9')]);router[_0xb13e('0x7')](_0xb13e('0xa'),auth[_0xb13e('0x8')](),controller['show']);router[_0xb13e('0x7')](_0xb13e('0xb'),auth['isAuthenticated'](),controller[_0xb13e('0xc')]);router[_0xb13e('0xd')]('/',auth[_0xb13e('0x8')](),controller[_0xb13e('0xe')]);router[_0xb13e('0xd')](_0xb13e('0xb'),auth[_0xb13e('0x8')](),controller[_0xb13e('0xf')]);router[_0xb13e('0x10')](_0xb13e('0xa'),auth['isAuthenticated'](),controller[_0xb13e('0x11')]);router[_0xb13e('0x12')](_0xb13e('0xa'),auth[_0xb13e('0x8')](),controller['destroy']);router[_0xb13e('0x12')](_0xb13e('0xb'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x13')]);module[_0xb13e('0x14')]=router;
\ No newline at end of file
index 4c2d79f..d5b89bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c9=['toString','utf8','BLOB','production','DATE','sequelize','exports','name','TEXT','long','getDataValue','preproduction'];(function(_0xd3a507,_0x175bad){var _0x19a769=function(_0x26d2f8){while(--_0x26d2f8){_0xd3a507['push'](_0xd3a507['shift']());}};_0x19a769(++_0x175bad);}(_0x81c9,0x65));var _0x981c=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x81c9[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x981c('0x0'));module[_0x981c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x981c('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x981c('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x981c('0x4')),'get':function(){if(this[_0x981c('0x5')](_0x981c('0x6'))){return this[_0x981c('0x5')](_0x981c('0x6'))[_0x981c('0x7')](_0x981c('0x8'));}}},'production':{'type':Sequelize[_0x981c('0x9')](_0x981c('0x4')),'get':function(){if(this[_0x981c('0x5')](_0x981c('0xa'))){return this[_0x981c('0x5')](_0x981c('0xa'))[_0x981c('0x7')](_0x981c('0x8'));}}},'savedAt':{'type':Sequelize[_0x981c('0xb')]},'publishedAt':{'type':Sequelize[_0x981c('0xb')]}};
\ No newline at end of file
+var _0xed5c=['name','TEXT','BLOB','long','getDataValue','preproduction','toString','production','DATE','sequelize','exports','STRING'];(function(_0x52451b,_0x2f8c1c){var _0x335fcd=function(_0x4bcb51){while(--_0x4bcb51){_0x52451b['push'](_0x52451b['shift']());}};_0x335fcd(++_0x2f8c1c);}(_0xed5c,0x81));var _0xced5=function(_0x273241,_0xb22dc9){_0x273241=_0x273241-0x0;var _0x46aad9=_0xed5c[_0x273241];return _0x46aad9;};'use strict';var Sequelize=require(_0xced5('0x0'));module[_0xced5('0x1')]={'name':{'type':Sequelize[_0xced5('0x2')],'unique':_0xced5('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xced5('0x2')]},'notes':{'type':Sequelize[_0xced5('0x4')]},'preproduction':{'type':Sequelize[_0xced5('0x5')](_0xced5('0x6')),'get':function(){if(this[_0xced5('0x7')](_0xced5('0x8'))){return this['getDataValue'](_0xced5('0x8'))[_0xced5('0x9')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xced5('0x6')),'get':function(){if(this[_0xced5('0x7')](_0xced5('0xa'))){return this[_0xced5('0x7')](_0xced5('0xa'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xced5('0xb')]},'publishedAt':{'type':Sequelize[_0xced5('0xb')]}};
\ No newline at end of file
index 776c97f..4555f43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf781=['includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','isArray','emit','userSquareProject:remove','getUsers','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','./squareProject.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','end','error','stack','name','send','index','SquareProject','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','keys'];(function(_0x311d45,_0xad8766){var _0x55ba6e=function(_0x4c17f5){while(--_0x4c17f5){_0x311d45['push'](_0x311d45['shift']());}};_0x55ba6e(++_0xad8766);}(_0xf781,0x195));var _0x1f78=function(_0x1fb373,_0x331086){_0x1fb373=_0x1fb373-0x0;var _0x3a0502=_0xf781[_0x1fb373];return _0x3a0502;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f78('0x0'));var zipdir=require(_0x1f78('0x1'));var jsonpatch=require(_0x1f78('0x2'));var rp=require(_0x1f78('0x3'));var moment=require(_0x1f78('0x4'));var BPromise=require(_0x1f78('0x5'));var Mustache=require('mustache');var util=require(_0x1f78('0x6'));var path=require(_0x1f78('0x7'));var sox=require('sox');var csv=require(_0x1f78('0x8'));var ejs=require(_0x1f78('0x9'));var fs=require('fs');var fs_extra=require(_0x1f78('0xa'));var _=require(_0x1f78('0xb'));var squel=require(_0x1f78('0xc'));var crypto=require(_0x1f78('0xd'));var jsforce=require(_0x1f78('0xe'));var deskjs=require(_0x1f78('0xf'));var toCsv=require(_0x1f78('0x8'));var querystring=require(_0x1f78('0x10'));var Papa=require(_0x1f78('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f78('0x12'));var as=require(_0x1f78('0x13'));var hardwareService=require(_0x1f78('0x14'));var logger=require(_0x1f78('0x15'))(_0x1f78('0x16'));var utils=require('../../config/utils');var config=require(_0x1f78('0x17'));var licenseUtil=require(_0x1f78('0x18'));var db=require(_0x1f78('0x19'))['db'];config[_0x1f78('0x1a')]=_['defaults'](config[_0x1f78('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f78('0x1a')]));require(_0x1f78('0x1b'))[_0x1f78('0x1c')](socket);function respondWithStatusCode(_0x11f6d8,_0x3a7245){_0x3a7245=_0x3a7245||0xcc;return function(_0x1aa85d){if(_0x1aa85d){return _0x11f6d8[_0x1f78('0x1d')](_0x3a7245);}return _0x11f6d8[_0x1f78('0x1e')](_0x3a7245)['end']();};}function respondWithResult(_0x5cc389,_0x586c18){_0x586c18=_0x586c18||0xc8;return function(_0x51daa3){if(_0x51daa3){return _0x5cc389[_0x1f78('0x1e')](_0x586c18)[_0x1f78('0x1f')](_0x51daa3);}};}function respondWithFilteredResult(_0x464060,_0x4ccbad){return function(_0x3d90b6){if(_0x3d90b6){var _0x3e6742=typeof _0x4ccbad['offset']===_0x1f78('0x20')&&typeof _0x4ccbad[_0x1f78('0x21')]===_0x1f78('0x20');var _0xbae88a=_0x3d90b6[_0x1f78('0x22')];var _0x42f906=_0x3e6742?0x0:_0x4ccbad[_0x1f78('0x23')];var _0x555416=_0x3e6742?_0x3d90b6[_0x1f78('0x22')]:_0x4ccbad['offset']+_0x4ccbad[_0x1f78('0x21')];var _0x92fea3;if(_0x555416>=_0xbae88a){_0x555416=_0xbae88a;_0x92fea3=0xc8;}else{_0x92fea3=0xce;}_0x464060[_0x1f78('0x1e')](_0x92fea3);return _0x464060['set'](_0x1f78('0x24'),_0x42f906+'-'+_0x555416+'/'+_0xbae88a)[_0x1f78('0x1f')](_0x3d90b6);}return null;};}function patchUpdates(_0x1f1f50){return function(_0x4bed11){try{jsonpatch[_0x1f78('0x25')](_0x4bed11,_0x1f1f50,!![]);}catch(_0x4d15b5){return BPromise[_0x1f78('0x26')](_0x4d15b5);}return _0x4bed11[_0x1f78('0x27')]();};}function saveUpdates(_0x1e464b,_0x327449){return function(_0x35e8d1){if(_0x35e8d1){return _0x35e8d1[_0x1f78('0x28')](_0x1e464b)[_0x1f78('0x29')](function(_0x189d62){return _0x189d62;});}return null;};}function removeEntity(_0x2fcfb6,_0x425396){return function(_0xc28a3c){if(_0xc28a3c){return _0xc28a3c[_0x1f78('0x2a')]()[_0x1f78('0x29')](function(){var _0x2b5f5d=_0xc28a3c[_0x1f78('0x2b')]({'plain':!![]});var _0x291c65=_0x1f78('0x2c');return db[_0x1f78('0x2d')]['destroy']({'where':{'type':_0x291c65,'resourceId':_0x2b5f5d['id']}})[_0x1f78('0x29')](function(){return _0xc28a3c;});})[_0x1f78('0x29')](function(){_0x2fcfb6[_0x1f78('0x1e')](0xcc)[_0x1f78('0x2e')]();});}};}function handleEntityNotFound(_0x27b0bd,_0xb14766){return function(_0x181e32){if(!_0x181e32){_0x27b0bd['sendStatus'](0x194);}return _0x181e32;};}function handleError(_0x567a34,_0x30d430){_0x30d430=_0x30d430||0x1f4;return function(_0x41b833){logger[_0x1f78('0x2f')](_0x41b833[_0x1f78('0x30')]);if(_0x41b833[_0x1f78('0x31')]){delete _0x41b833[_0x1f78('0x31')];}_0x567a34[_0x1f78('0x1e')](_0x30d430)[_0x1f78('0x32')](_0x41b833);};}exports[_0x1f78('0x33')]=function(_0x1f27eb,_0x2313a8){var _0x34698c={},_0x31b7f5={},_0x288074={'count':0x0,'rows':[]};var _0x1e632e=_['map'](db[_0x1f78('0x34')][_0x1f78('0x35')],function(_0x25c1fe){return{'name':_0x25c1fe[_0x1f78('0x36')],'type':_0x25c1fe[_0x1f78('0x37')][_0x1f78('0x38')]};});_0x31b7f5[_0x1f78('0x39')]=_[_0x1f78('0x3a')](_0x1e632e,_0x1f78('0x31'));_0x31b7f5[_0x1f78('0x3b')]=_['keys'](_0x1f27eb['query']);_0x31b7f5[_0x1f78('0x3c')]=_[_0x1f78('0x3d')](_0x31b7f5[_0x1f78('0x39')],_0x31b7f5[_0x1f78('0x3b')]);_0x34698c[_0x1f78('0x3e')]=_[_0x1f78('0x3d')](_0x31b7f5[_0x1f78('0x39')],qs['fields'](_0x1f27eb[_0x1f78('0x3b')][_0x1f78('0x3f')]));_0x34698c[_0x1f78('0x3e')]=_0x34698c[_0x1f78('0x3e')][_0x1f78('0x40')]?_0x34698c['attributes']:_0x31b7f5[_0x1f78('0x39')];if(!_0x1f27eb[_0x1f78('0x3b')][_0x1f78('0x41')](_0x1f78('0x42'))){_0x34698c[_0x1f78('0x21')]=qs['limit'](_0x1f27eb[_0x1f78('0x3b')][_0x1f78('0x21')]);_0x34698c[_0x1f78('0x23')]=qs[_0x1f78('0x23')](_0x1f27eb['query'][_0x1f78('0x23')]);}_0x34698c[_0x1f78('0x43')]=qs[_0x1f78('0x44')](_0x1f27eb[_0x1f78('0x3b')]['sort']);_0x34698c[_0x1f78('0x45')]=qs[_0x1f78('0x3c')](_[_0x1f78('0x46')](_0x1f27eb['query'],_0x31b7f5['filters']),_0x1e632e);if(_0x1f27eb[_0x1f78('0x3b')][_0x1f78('0x47')]){_0x34698c[_0x1f78('0x45')]=_[_0x1f78('0x48')](_0x34698c['where'],{'$or':_[_0x1f78('0x3a')](_0x1e632e,function(_0x541597){if(_0x541597['type']!==_0x1f78('0x49')){var _0x41c538={};_0x41c538[_0x541597['name']]={'$like':'%'+_0x1f27eb['query'][_0x1f78('0x47')]+'%'};return _0x41c538;}})});}_0x34698c=_[_0x1f78('0x48')]({},_0x34698c,_0x1f27eb['options']);var _0x550e81={'where':_0x34698c[_0x1f78('0x45')]};return db[_0x1f78('0x34')][_0x1f78('0x22')](_0x550e81)['then'](function(_0x28473f){_0x288074['count']=_0x28473f;if(_0x1f27eb['query']['includeAll']){_0x34698c[_0x1f78('0x4a')]=[{'all':!![]}];}return db[_0x1f78('0x34')]['findAll'](_0x34698c);})[_0x1f78('0x29')](function(_0x39f04d){_0x288074[_0x1f78('0x4b')]=_0x39f04d;return _0x288074;})[_0x1f78('0x29')](respondWithFilteredResult(_0x2313a8,_0x34698c))[_0x1f78('0x4c')](handleError(_0x2313a8,null));};exports[_0x1f78('0x4d')]=function(_0x172158,_0xd54944){var _0x3aa359={'raw':![],'where':{'id':_0x172158[_0x1f78('0x4e')]['id']}},_0x4ccc4d={};_0x4ccc4d[_0x1f78('0x39')]=_['keys'](db[_0x1f78('0x34')][_0x1f78('0x35')]);_0x4ccc4d[_0x1f78('0x3b')]=_[_0x1f78('0x4f')](_0x172158[_0x1f78('0x3b')]);_0x4ccc4d[_0x1f78('0x3c')]=_[_0x1f78('0x3d')](_0x4ccc4d[_0x1f78('0x39')],_0x4ccc4d[_0x1f78('0x3b')]);_0x3aa359[_0x1f78('0x3e')]=_['intersection'](_0x4ccc4d[_0x1f78('0x39')],qs[_0x1f78('0x3f')](_0x172158[_0x1f78('0x3b')][_0x1f78('0x3f')]));_0x3aa359[_0x1f78('0x3e')]=_0x3aa359['attributes'][_0x1f78('0x40')]?_0x3aa359[_0x1f78('0x3e')]:_0x4ccc4d[_0x1f78('0x39')];if(_0x172158['query'][_0x1f78('0x50')]){_0x3aa359[_0x1f78('0x4a')]=[{'all':!![]}];}_0x3aa359=_[_0x1f78('0x48')]({},_0x3aa359,_0x172158[_0x1f78('0x51')]);return db['SquareProject'][_0x1f78('0x52')](_0x3aa359)['then'](handleEntityNotFound(_0xd54944,null))[_0x1f78('0x29')](respondWithResult(_0xd54944,null))['catch'](handleError(_0xd54944,null));};exports['create']=function(_0x60a9f5,_0x10490e){return db[_0x1f78('0x34')][_0x1f78('0x53')](_0x60a9f5[_0x1f78('0x54')],{})['then'](function(_0x1b90ec){var _0xdebf7a=_0x60a9f5['user'][_0x1f78('0x2b')]({'plain':!![]});if(!_0xdebf7a)throw new Error(_0x1f78('0x55'));if(_0xdebf7a[_0x1f78('0x56')]===_0x1f78('0x57')){var _0x48ef28=_0x1b90ec[_0x1f78('0x2b')]({'plain':!![]});var _0x323f0a=_0x1f78('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x323f0a,'userProfileId':_0xdebf7a[_0x1f78('0x58')]},'raw':!![]})['then'](function(_0x574568){if(_0x574568&&_0x574568['autoAssociation']===0x0){return db['UserProfileResource'][_0x1f78('0x53')]({'name':_0x48ef28['name'],'resourceId':_0x48ef28['id'],'type':_0x574568[_0x1f78('0x31')],'sectionId':_0x574568['id']},{})[_0x1f78('0x29')](function(){return _0x1b90ec;});}else{return _0x1b90ec;}})['catch'](function(_0x55af75){logger['error'](_0x1f78('0x59'),_0x55af75);throw _0x55af75;});}return _0x1b90ec;})[_0x1f78('0x29')](respondWithResult(_0x10490e,0xc9))[_0x1f78('0x4c')](handleError(_0x10490e,null));};exports[_0x1f78('0x28')]=function(_0x6cd18a,_0x38d98d){if(_0x6cd18a[_0x1f78('0x54')]['id']){delete _0x6cd18a[_0x1f78('0x54')]['id'];}return db[_0x1f78('0x34')]['find']({'where':{'id':_0x6cd18a['params']['id']}})[_0x1f78('0x29')](handleEntityNotFound(_0x38d98d,null))[_0x1f78('0x29')](saveUpdates(_0x6cd18a[_0x1f78('0x54')],null))[_0x1f78('0x29')](respondWithResult(_0x38d98d,null))[_0x1f78('0x4c')](handleError(_0x38d98d,null));};exports[_0x1f78('0x2a')]=function(_0x398984,_0xc874a2){return db['SquareProject']['find']({'where':{'id':_0x398984[_0x1f78('0x4e')]['id']}})[_0x1f78('0x29')](handleEntityNotFound(_0xc874a2,null))[_0x1f78('0x29')](removeEntity(_0xc874a2,null))[_0x1f78('0x4c')](handleError(_0xc874a2,null));};exports['addUsers']=function(_0xbc32fe,_0xb983a8,_0x3eb4ce){return db['SquareProject'][_0x1f78('0x52')]({'where':{'id':_0xbc32fe['params']['id']}})[_0x1f78('0x29')](handleEntityNotFound(_0xb983a8,null))['then'](function(_0x1a77f2){if(_0x1a77f2){return _0x1a77f2[_0x1f78('0x5a')](_0xbc32fe['body']['ids'],_['omit'](_0xbc32fe[_0x1f78('0x54')],[_0x1f78('0x5b'),'id'])||{});}})[_0x1f78('0x29')](respondWithResult(_0xb983a8,null))[_0x1f78('0x4c')](handleError(_0xb983a8,null));};exports['removeUsers']=function(_0x4b2d04,_0x1f7f62,_0x317777){return db['SquareProject'][_0x1f78('0x52')]({'where':{'id':_0x4b2d04['params']['id']}})[_0x1f78('0x29')](handleEntityNotFound(_0x1f7f62,null))[_0x1f78('0x29')](function(_0x3bf472){if(_0x3bf472){return _0x3bf472['removeUsers'](_0x4b2d04[_0x1f78('0x3b')][_0x1f78('0x5b')])[_0x1f78('0x29')](function(){if(_[_0x1f78('0x5c')](_0x4b2d04['query']['ids'])){for(var _0x50dd35=0x0;_0x50dd35<_0x4b2d04[_0x1f78('0x3b')][_0x1f78('0x5b')][_0x1f78('0x40')];_0x50dd35+=0x1){socket[_0x1f78('0x5d')](_0x1f78('0x5e'),{'UserId':Number(_0x4b2d04['query'][_0x1f78('0x5b')][_0x50dd35]),'SquareProjectId':Number(_0x4b2d04[_0x1f78('0x4e')]['id'])});}}else{socket['emit'](_0x1f78('0x5e'),{'UserId':Number(_0x4b2d04[_0x1f78('0x3b')][_0x1f78('0x5b')]),'SquareProjectId':Number(_0x4b2d04[_0x1f78('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f7f62,null))[_0x1f78('0x4c')](handleError(_0x1f7f62,null));};exports[_0x1f78('0x5f')]=function(_0x5377d5,_0x3b8a19,_0x1d2349){var _0x25aab4={};var _0x32e3e8={};var _0x24b347;var _0x4b98ce;return db[_0x1f78('0x34')][_0x1f78('0x60')]({'where':{'id':_0x5377d5[_0x1f78('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3b8a19,null))[_0x1f78('0x29')](function(_0x2d70c0){if(_0x2d70c0){_0x24b347=_0x2d70c0;_0x32e3e8[_0x1f78('0x39')]=_[_0x1f78('0x4f')](db['User']['rawAttributes']);_0x32e3e8[_0x1f78('0x3b')]=_[_0x1f78('0x4f')](_0x5377d5[_0x1f78('0x3b')]);_0x32e3e8[_0x1f78('0x3c')]=_['intersection'](_0x32e3e8[_0x1f78('0x39')],_0x32e3e8[_0x1f78('0x3b')]);_0x25aab4[_0x1f78('0x3e')]=_[_0x1f78('0x3d')](_0x32e3e8[_0x1f78('0x39')],qs[_0x1f78('0x3f')](_0x5377d5[_0x1f78('0x3b')]['fields']));_0x25aab4['attributes']=_0x25aab4[_0x1f78('0x3e')][_0x1f78('0x40')]?_0x25aab4['attributes']:_0x32e3e8[_0x1f78('0x39')];_0x25aab4[_0x1f78('0x43')]=qs[_0x1f78('0x44')](_0x5377d5[_0x1f78('0x3b')][_0x1f78('0x44')]);_0x25aab4[_0x1f78('0x45')]=qs[_0x1f78('0x3c')](_[_0x1f78('0x46')](_0x5377d5[_0x1f78('0x3b')],_0x32e3e8[_0x1f78('0x3c')]));if(_0x5377d5[_0x1f78('0x3b')][_0x1f78('0x47')]){_0x25aab4['where']=_['merge'](_0x25aab4[_0x1f78('0x45')],{'$or':_['map'](_0x25aab4[_0x1f78('0x3e')],function(_0x1b3dbc){var _0x22e6a6={};_0x22e6a6[_0x1b3dbc]={'$like':'%'+_0x5377d5[_0x1f78('0x3b')]['filter']+'%'};return _0x22e6a6;})});}_0x25aab4=_[_0x1f78('0x48')]({},_0x25aab4,_0x5377d5['options']);return _0x24b347[_0x1f78('0x5f')](_0x25aab4);}})['then'](function(_0x13d3af){if(_0x13d3af){_0x4b98ce=_0x13d3af[_0x1f78('0x40')];if(!_0x5377d5[_0x1f78('0x3b')]['hasOwnProperty'](_0x1f78('0x42'))){_0x25aab4['limit']=qs[_0x1f78('0x21')](_0x5377d5[_0x1f78('0x3b')][_0x1f78('0x21')]);_0x25aab4[_0x1f78('0x23')]=qs[_0x1f78('0x23')](_0x5377d5[_0x1f78('0x3b')][_0x1f78('0x23')]);}return _0x24b347['getUsers'](_0x25aab4);}})[_0x1f78('0x29')](function(_0x2095f0){if(_0x2095f0){return _0x2095f0?{'count':_0x4b98ce,'rows':_0x2095f0}:null;}})[_0x1f78('0x29')](respondWithResult(_0x3b8a19,null))['catch'](handleError(_0x3b8a19,null));};
\ No newline at end of file
+var _0x4e0f=['order','sort','where','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','params','find','create','body','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','isArray','emit','userSquareProject:remove','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','SquareProjects','UserProfileResource','end','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit'];(function(_0x597351,_0x5aed9f){var _0x410cd7=function(_0x511d62){while(--_0x511d62){_0x597351['push'](_0x597351['shift']());}};_0x410cd7(++_0x5aed9f);}(_0x4e0f,0x1e1));var _0xf4e0=function(_0x53be66,_0x9ec3be){_0x53be66=_0x53be66-0x0;var _0x9e5520=_0x4e0f[_0x53be66];return _0x9e5520;};'use strict';var emlformat=require(_0xf4e0('0x0'));var rimraf=require(_0xf4e0('0x1'));var zipdir=require(_0xf4e0('0x2'));var jsonpatch=require(_0xf4e0('0x3'));var rp=require(_0xf4e0('0x4'));var moment=require(_0xf4e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf4e0('0x6'));var util=require('util');var path=require(_0xf4e0('0x7'));var sox=require(_0xf4e0('0x8'));var csv=require(_0xf4e0('0x9'));var ejs=require(_0xf4e0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4e0('0xb'));var squel=require(_0xf4e0('0xc'));var crypto=require(_0xf4e0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf4e0('0x9'));var querystring=require(_0xf4e0('0xe'));var Papa=require('papaparse');var Redis=require(_0xf4e0('0xf'));var authService=require(_0xf4e0('0x10'));var qs=require(_0xf4e0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4e0('0x12'));var logger=require(_0xf4e0('0x13'))(_0xf4e0('0x14'));var utils=require(_0xf4e0('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf4e0('0x16'))['db'];config['redis']=_['defaults'](config[_0xf4e0('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xf4e0('0x18'))(new Redis(config[_0xf4e0('0x17')]));require(_0xf4e0('0x19'))[_0xf4e0('0x1a')](socket);function respondWithStatusCode(_0x4c9b17,_0x3d5fa3){_0x3d5fa3=_0x3d5fa3||0xcc;return function(_0x590a2c){if(_0x590a2c){return _0x4c9b17[_0xf4e0('0x1b')](_0x3d5fa3);}return _0x4c9b17[_0xf4e0('0x1c')](_0x3d5fa3)['end']();};}function respondWithResult(_0x4c93fd,_0x5e29f7){_0x5e29f7=_0x5e29f7||0xc8;return function(_0x1d2fa1){if(_0x1d2fa1){return _0x4c93fd[_0xf4e0('0x1c')](_0x5e29f7)[_0xf4e0('0x1d')](_0x1d2fa1);}};}function respondWithFilteredResult(_0x10708d,_0x474bb7){return function(_0x5d8cf8){if(_0x5d8cf8){var _0x183095=typeof _0x474bb7['offset']===_0xf4e0('0x1e')&&typeof _0x474bb7['limit']===_0xf4e0('0x1e');var _0x4bc3e4=_0x5d8cf8[_0xf4e0('0x1f')];var _0x4bda84=_0x183095?0x0:_0x474bb7[_0xf4e0('0x20')];var _0x4b3ce0=_0x183095?_0x5d8cf8[_0xf4e0('0x1f')]:_0x474bb7[_0xf4e0('0x20')]+_0x474bb7['limit'];var _0x4ebe56;if(_0x4b3ce0>=_0x4bc3e4){_0x4b3ce0=_0x4bc3e4;_0x4ebe56=0xc8;}else{_0x4ebe56=0xce;}_0x10708d[_0xf4e0('0x1c')](_0x4ebe56);return _0x10708d[_0xf4e0('0x21')](_0xf4e0('0x22'),_0x4bda84+'-'+_0x4b3ce0+'/'+_0x4bc3e4)[_0xf4e0('0x1d')](_0x5d8cf8);}return null;};}function patchUpdates(_0xe51000){return function(_0x37f9bd){try{jsonpatch[_0xf4e0('0x23')](_0x37f9bd,_0xe51000,!![]);}catch(_0x1aa0b4){return BPromise[_0xf4e0('0x24')](_0x1aa0b4);}return _0x37f9bd[_0xf4e0('0x25')]();};}function saveUpdates(_0x36c63e,_0x442988){return function(_0x936f93){if(_0x936f93){return _0x936f93[_0xf4e0('0x26')](_0x36c63e)['then'](function(_0x5926ae){return _0x5926ae;});}return null;};}function removeEntity(_0x355c5f,_0x3ac56c){return function(_0x1d83f1){if(_0x1d83f1){return _0x1d83f1[_0xf4e0('0x27')]()['then'](function(){var _0x389222=_0x1d83f1[_0xf4e0('0x28')]({'plain':!![]});var _0x23716f=_0xf4e0('0x29');return db[_0xf4e0('0x2a')]['destroy']({'where':{'type':_0x23716f,'resourceId':_0x389222['id']}})['then'](function(){return _0x1d83f1;});})['then'](function(){_0x355c5f[_0xf4e0('0x1c')](0xcc)[_0xf4e0('0x2b')]();});}};}function handleEntityNotFound(_0x410720,_0x12bbd7){return function(_0x5d9b03){if(!_0x5d9b03){_0x410720[_0xf4e0('0x1b')](0x194);}return _0x5d9b03;};}function handleError(_0x508fa0,_0x2064f4){_0x2064f4=_0x2064f4||0x1f4;return function(_0x1b9dfb){logger[_0xf4e0('0x2c')](_0x1b9dfb[_0xf4e0('0x2d')]);if(_0x1b9dfb[_0xf4e0('0x2e')]){delete _0x1b9dfb['name'];}_0x508fa0[_0xf4e0('0x1c')](_0x2064f4)[_0xf4e0('0x2f')](_0x1b9dfb);};}exports[_0xf4e0('0x30')]=function(_0x559909,_0x28fd0d){var _0x1af285={},_0x582ce4={},_0x466e84={'count':0x0,'rows':[]};var _0x50d91f=_[_0xf4e0('0x31')](db[_0xf4e0('0x32')][_0xf4e0('0x33')],function(_0x598957){return{'name':_0x598957[_0xf4e0('0x34')],'type':_0x598957['type'][_0xf4e0('0x35')]};});_0x582ce4[_0xf4e0('0x36')]=_[_0xf4e0('0x31')](_0x50d91f,'name');_0x582ce4[_0xf4e0('0x37')]=_[_0xf4e0('0x38')](_0x559909['query']);_0x582ce4[_0xf4e0('0x39')]=_[_0xf4e0('0x3a')](_0x582ce4[_0xf4e0('0x36')],_0x582ce4[_0xf4e0('0x37')]);_0x1af285['attributes']=_['intersection'](_0x582ce4[_0xf4e0('0x36')],qs[_0xf4e0('0x3b')](_0x559909[_0xf4e0('0x37')][_0xf4e0('0x3b')]));_0x1af285['attributes']=_0x1af285[_0xf4e0('0x3c')][_0xf4e0('0x3d')]?_0x1af285[_0xf4e0('0x3c')]:_0x582ce4[_0xf4e0('0x36')];if(!_0x559909[_0xf4e0('0x37')][_0xf4e0('0x3e')](_0xf4e0('0x3f'))){_0x1af285[_0xf4e0('0x40')]=qs['limit'](_0x559909[_0xf4e0('0x37')][_0xf4e0('0x40')]);_0x1af285['offset']=qs[_0xf4e0('0x20')](_0x559909['query'][_0xf4e0('0x20')]);}_0x1af285[_0xf4e0('0x41')]=qs[_0xf4e0('0x42')](_0x559909[_0xf4e0('0x37')][_0xf4e0('0x42')]);_0x1af285[_0xf4e0('0x43')]=qs[_0xf4e0('0x39')](_['pick'](_0x559909[_0xf4e0('0x37')],_0x582ce4['filters']),_0x50d91f);if(_0x559909['query'][_0xf4e0('0x44')]){_0x1af285[_0xf4e0('0x43')]=_['merge'](_0x1af285[_0xf4e0('0x43')],{'$or':_[_0xf4e0('0x31')](_0x50d91f,function(_0x5a3354){if(_0x5a3354['type']!==_0xf4e0('0x45')){var _0x43b25f={};_0x43b25f[_0x5a3354[_0xf4e0('0x2e')]]={'$like':'%'+_0x559909[_0xf4e0('0x37')]['filter']+'%'};return _0x43b25f;}})});}_0x1af285=_[_0xf4e0('0x46')]({},_0x1af285,_0x559909[_0xf4e0('0x47')]);var _0x4e6eab={'where':_0x1af285[_0xf4e0('0x43')]};return db[_0xf4e0('0x32')][_0xf4e0('0x1f')](_0x4e6eab)[_0xf4e0('0x48')](function(_0x1f7cb0){_0x466e84[_0xf4e0('0x1f')]=_0x1f7cb0;if(_0x559909[_0xf4e0('0x37')][_0xf4e0('0x49')]){_0x1af285[_0xf4e0('0x4a')]=[{'all':!![]}];}return db['SquareProject'][_0xf4e0('0x4b')](_0x1af285);})['then'](function(_0x5f59a9){_0x466e84['rows']=_0x5f59a9;return _0x466e84;})['then'](respondWithFilteredResult(_0x28fd0d,_0x1af285))[_0xf4e0('0x4c')](handleError(_0x28fd0d,null));};exports['show']=function(_0xec7e3b,_0xf07d86){var _0x5a1e5c={'raw':![],'where':{'id':_0xec7e3b[_0xf4e0('0x4d')]['id']}},_0x3f8552={};_0x3f8552['model']=_[_0xf4e0('0x38')](db['SquareProject'][_0xf4e0('0x33')]);_0x3f8552['query']=_[_0xf4e0('0x38')](_0xec7e3b['query']);_0x3f8552['filters']=_[_0xf4e0('0x3a')](_0x3f8552[_0xf4e0('0x36')],_0x3f8552['query']);_0x5a1e5c['attributes']=_[_0xf4e0('0x3a')](_0x3f8552['model'],qs[_0xf4e0('0x3b')](_0xec7e3b[_0xf4e0('0x37')][_0xf4e0('0x3b')]));_0x5a1e5c[_0xf4e0('0x3c')]=_0x5a1e5c[_0xf4e0('0x3c')][_0xf4e0('0x3d')]?_0x5a1e5c[_0xf4e0('0x3c')]:_0x3f8552[_0xf4e0('0x36')];if(_0xec7e3b['query'][_0xf4e0('0x49')]){_0x5a1e5c['include']=[{'all':!![]}];}_0x5a1e5c=_[_0xf4e0('0x46')]({},_0x5a1e5c,_0xec7e3b[_0xf4e0('0x47')]);return db[_0xf4e0('0x32')][_0xf4e0('0x4e')](_0x5a1e5c)[_0xf4e0('0x48')](handleEntityNotFound(_0xf07d86,null))[_0xf4e0('0x48')](respondWithResult(_0xf07d86,null))[_0xf4e0('0x4c')](handleError(_0xf07d86,null));};exports['create']=function(_0x2957ff,_0x2210e1){return db['SquareProject'][_0xf4e0('0x4f')](_0x2957ff[_0xf4e0('0x50')],{})['then'](function(_0x2f4427){var _0x520a66=_0x2957ff['user'][_0xf4e0('0x28')]({'plain':!![]});if(!_0x520a66)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x520a66[_0xf4e0('0x51')]==='user'){var _0x21e0d7=_0x2f4427[_0xf4e0('0x28')]({'plain':!![]});var _0x1ac972=_0xf4e0('0x29');return db[_0xf4e0('0x52')][_0xf4e0('0x4e')]({'where':{'name':_0x1ac972,'userProfileId':_0x520a66[_0xf4e0('0x53')]},'raw':!![]})[_0xf4e0('0x48')](function(_0x29ddb8){if(_0x29ddb8&&_0x29ddb8['autoAssociation']===0x0){return db[_0xf4e0('0x2a')][_0xf4e0('0x4f')]({'name':_0x21e0d7[_0xf4e0('0x2e')],'resourceId':_0x21e0d7['id'],'type':_0x29ddb8[_0xf4e0('0x2e')],'sectionId':_0x29ddb8['id']},{})[_0xf4e0('0x48')](function(){return _0x2f4427;});}else{return _0x2f4427;}})[_0xf4e0('0x4c')](function(_0x6acf77){logger[_0xf4e0('0x2c')](_0xf4e0('0x54'),_0x6acf77);throw _0x6acf77;});}return _0x2f4427;})['then'](respondWithResult(_0x2210e1,0xc9))[_0xf4e0('0x4c')](handleError(_0x2210e1,null));};exports[_0xf4e0('0x26')]=function(_0x41d6c7,_0xf190b1){if(_0x41d6c7[_0xf4e0('0x50')]['id']){delete _0x41d6c7['body']['id'];}return db['SquareProject'][_0xf4e0('0x4e')]({'where':{'id':_0x41d6c7[_0xf4e0('0x4d')]['id']}})[_0xf4e0('0x48')](handleEntityNotFound(_0xf190b1,null))[_0xf4e0('0x48')](saveUpdates(_0x41d6c7[_0xf4e0('0x50')],null))['then'](respondWithResult(_0xf190b1,null))[_0xf4e0('0x4c')](handleError(_0xf190b1,null));};exports[_0xf4e0('0x27')]=function(_0x60061,_0x55e101){return db[_0xf4e0('0x32')][_0xf4e0('0x4e')]({'where':{'id':_0x60061['params']['id']}})[_0xf4e0('0x48')](handleEntityNotFound(_0x55e101,null))[_0xf4e0('0x48')](removeEntity(_0x55e101,null))['catch'](handleError(_0x55e101,null));};exports[_0xf4e0('0x55')]=function(_0x51dde8,_0x108d1d,_0x46a5f4){return db['SquareProject']['find']({'where':{'id':_0x51dde8['params']['id']}})['then'](handleEntityNotFound(_0x108d1d,null))[_0xf4e0('0x48')](function(_0x109ffa){if(_0x109ffa){return _0x109ffa['addUsers'](_0x51dde8['body'][_0xf4e0('0x56')],_['omit'](_0x51dde8['body'],[_0xf4e0('0x56'),'id'])||{});}})[_0xf4e0('0x48')](respondWithResult(_0x108d1d,null))[_0xf4e0('0x4c')](handleError(_0x108d1d,null));};exports['removeUsers']=function(_0x564720,_0x29b541,_0x52e0c2){return db[_0xf4e0('0x32')][_0xf4e0('0x4e')]({'where':{'id':_0x564720[_0xf4e0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29b541,null))[_0xf4e0('0x48')](function(_0x3ae542){if(_0x3ae542){return _0x3ae542['removeUsers'](_0x564720[_0xf4e0('0x37')][_0xf4e0('0x56')])[_0xf4e0('0x48')](function(){if(_[_0xf4e0('0x57')](_0x564720[_0xf4e0('0x37')][_0xf4e0('0x56')])){for(var _0x404e8d=0x0;_0x404e8d<_0x564720[_0xf4e0('0x37')][_0xf4e0('0x56')][_0xf4e0('0x3d')];_0x404e8d+=0x1){socket[_0xf4e0('0x58')]('userSquareProject:remove',{'UserId':Number(_0x564720[_0xf4e0('0x37')][_0xf4e0('0x56')][_0x404e8d]),'SquareProjectId':Number(_0x564720['params']['id'])});}}else{socket[_0xf4e0('0x58')](_0xf4e0('0x59'),{'UserId':Number(_0x564720[_0xf4e0('0x37')][_0xf4e0('0x56')]),'SquareProjectId':Number(_0x564720[_0xf4e0('0x4d')]['id'])});}});}})[_0xf4e0('0x48')](respondWithStatusCode(_0x29b541,null))[_0xf4e0('0x4c')](handleError(_0x29b541,null));};exports[_0xf4e0('0x5a')]=function(_0x527008,_0x4100dc,_0x29dd86){var _0x5b6b00={};var _0x4e4367={};var _0x1c35fe;var _0x3fe7be;return db[_0xf4e0('0x32')]['findOne']({'where':{'id':_0x527008[_0xf4e0('0x4d')]['id']}})[_0xf4e0('0x48')](handleEntityNotFound(_0x4100dc,null))[_0xf4e0('0x48')](function(_0x1b58c9){if(_0x1b58c9){_0x1c35fe=_0x1b58c9;_0x4e4367[_0xf4e0('0x36')]=_[_0xf4e0('0x38')](db['User']['rawAttributes']);_0x4e4367['query']=_['keys'](_0x527008[_0xf4e0('0x37')]);_0x4e4367[_0xf4e0('0x39')]=_[_0xf4e0('0x3a')](_0x4e4367[_0xf4e0('0x36')],_0x4e4367[_0xf4e0('0x37')]);_0x5b6b00[_0xf4e0('0x3c')]=_[_0xf4e0('0x3a')](_0x4e4367[_0xf4e0('0x36')],qs[_0xf4e0('0x3b')](_0x527008[_0xf4e0('0x37')][_0xf4e0('0x3b')]));_0x5b6b00[_0xf4e0('0x3c')]=_0x5b6b00[_0xf4e0('0x3c')][_0xf4e0('0x3d')]?_0x5b6b00[_0xf4e0('0x3c')]:_0x4e4367['model'];_0x5b6b00[_0xf4e0('0x41')]=qs[_0xf4e0('0x42')](_0x527008[_0xf4e0('0x37')][_0xf4e0('0x42')]);_0x5b6b00[_0xf4e0('0x43')]=qs[_0xf4e0('0x39')](_['pick'](_0x527008[_0xf4e0('0x37')],_0x4e4367[_0xf4e0('0x39')]));if(_0x527008[_0xf4e0('0x37')][_0xf4e0('0x44')]){_0x5b6b00[_0xf4e0('0x43')]=_['merge'](_0x5b6b00[_0xf4e0('0x43')],{'$or':_[_0xf4e0('0x31')](_0x5b6b00['attributes'],function(_0x19d405){var _0x5abbce={};_0x5abbce[_0x19d405]={'$like':'%'+_0x527008[_0xf4e0('0x37')]['filter']+'%'};return _0x5abbce;})});}_0x5b6b00=_[_0xf4e0('0x46')]({},_0x5b6b00,_0x527008['options']);return _0x1c35fe[_0xf4e0('0x5a')](_0x5b6b00);}})[_0xf4e0('0x48')](function(_0x4a4b19){if(_0x4a4b19){_0x3fe7be=_0x4a4b19[_0xf4e0('0x3d')];if(!_0x527008[_0xf4e0('0x37')]['hasOwnProperty'](_0xf4e0('0x3f'))){_0x5b6b00[_0xf4e0('0x40')]=qs['limit'](_0x527008[_0xf4e0('0x37')][_0xf4e0('0x40')]);_0x5b6b00['offset']=qs[_0xf4e0('0x20')](_0x527008['query'][_0xf4e0('0x20')]);}return _0x1c35fe[_0xf4e0('0x5a')](_0x5b6b00);}})[_0xf4e0('0x48')](function(_0x522adb){if(_0x522adb){return _0x522adb?{'count':_0x3fe7be,'rows':_0x522adb}:null;}})[_0xf4e0('0x48')](respondWithResult(_0x4100dc,null))['catch'](handleError(_0x4100dc,null));};
\ No newline at end of file
index 8a942da..624997b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc57f=['emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x5ea48d,_0x2efa7e){var _0x54d536=function(_0x5b8b3a){while(--_0x5b8b3a){_0x5ea48d['push'](_0x5ea48d['shift']());}};_0x54d536(++_0x2efa7e);}(_0xc57f,0x12f));var _0xfc57=function(_0x4aa741,_0x5134c1){_0x4aa741=_0x4aa741-0x0;var _0x272370=_0xc57f[_0x4aa741];return _0x272370;};'use strict';var EventEmitter=require(_0xfc57('0x0'));var SquareProject=require(_0xfc57('0x1'))['db'][_0xfc57('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xfc57('0x3')](0x0);var events={'afterCreate':_0xfc57('0x4'),'afterUpdate':_0xfc57('0x5'),'afterDestroy':_0xfc57('0x6')};function emitEvent(_0x224422){return function(_0x2d94a8,_0x497c02,_0x4c5c42){SquareProjectEvents[_0xfc57('0x7')](_0x224422+':'+_0x2d94a8['id'],_0x2d94a8);SquareProjectEvents[_0xfc57('0x7')](_0x224422,_0x2d94a8);_0x4c5c42(null);};}for(var e in events){if(events[_0xfc57('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xfc57('0x9')]=SquareProjectEvents;
\ No newline at end of file
+var _0xe37b=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x481acf,_0x2d8736){var _0x4e3efc=function(_0x3eca9c){while(--_0x3eca9c){_0x481acf['push'](_0x481acf['shift']());}};_0x4e3efc(++_0x2d8736);}(_0xe37b,0x149));var _0xbe37=function(_0x322dac,_0x19aa67){_0x322dac=_0x322dac-0x0;var _0x281a66=_0xe37b[_0x322dac];return _0x281a66;};'use strict';var EventEmitter=require(_0xbe37('0x0'));var SquareProject=require(_0xbe37('0x1'))['db'][_0xbe37('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbe37('0x3')](0x0);var events={'afterCreate':_0xbe37('0x4'),'afterUpdate':_0xbe37('0x5'),'afterDestroy':_0xbe37('0x6')};function emitEvent(_0x314273){return function(_0x20d164,_0x38db20,_0x4836b5){SquareProjectEvents[_0xbe37('0x7')](_0x314273+':'+_0x20d164['id'],_0x20d164);SquareProjectEvents['emit'](_0x314273,_0x20d164);_0x4836b5(null);};}for(var e in events){if(events[_0xbe37('0x8')](e)){var event=events[e];SquareProject[_0xbe37('0x9')](e,emitEvent(event));}}module[_0xbe37('0xa')]=SquareProjectEvents;
\ No newline at end of file
index 8b389b3..bebf214 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe00=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction','format','lodash','util'];(function(_0x287652,_0x15662b){var _0x176be4=function(_0x3b99ee){while(--_0x3b99ee){_0x287652['push'](_0x287652['shift']());}};_0x176be4(++_0x15662b);}(_0xbe00,0x16e));var _0x0be0=function(_0x150f71,_0x506d31){_0x150f71=_0x150f71-0x0;var _0x468043=_0xbe00[_0x150f71];return _0x468043;};'use strict';var _=require(_0x0be0('0x0'));var util=require(_0x0be0('0x1'));var logger=require(_0x0be0('0x2'))(_0x0be0('0x3'));var moment=require(_0x0be0('0x4'));var BPromise=require('bluebird');var rp=require(_0x0be0('0x5'));var fs=require('fs');var path=require(_0x0be0('0x6'));var rimraf=require(_0x0be0('0x7'));var config=require(_0x0be0('0x8'));var attributes=require(_0x0be0('0x9'));module[_0x0be0('0xa')]=function(_0x37449e,_0x30be0a){return _0x37449e['define'](_0x0be0('0xb'),attributes,{'tableName':_0x0be0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x283b7c,_0x2f3283,_0x77c544){if(_0x283b7c[_0x0be0('0xd')](_0x0be0('0xe'))){_0x283b7c['savedAt']=moment()[_0x0be0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x283b7c[_0x0be0('0xd')]('production')){_0x283b7c['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x77c544(null,_0x283b7c);}}});};
\ No newline at end of file
+var _0x2df7=['rimraf','./squareProject.attributes','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','publishedAt','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0x2df7,0x192));var _0x72df=function(_0x2d4023,_0x1a778d){_0x2d4023=_0x2d4023-0x0;var _0x41e372=_0x2df7[_0x2d4023];return _0x41e372;};'use strict';var _=require(_0x72df('0x0'));var util=require(_0x72df('0x1'));var logger=require('../../config/logger')(_0x72df('0x2'));var moment=require(_0x72df('0x3'));var BPromise=require(_0x72df('0x4'));var rp=require(_0x72df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72df('0x6'));var config=require('../../config/environment');var attributes=require(_0x72df('0x7'));module['exports']=function(_0x43a6bc,_0x45582b){return _0x43a6bc[_0x72df('0x8')](_0x72df('0x9'),attributes,{'tableName':_0x72df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e44c8,_0x321e75,_0x4cd4ab){if(_0x1e44c8['changed'](_0x72df('0xb'))){_0x1e44c8[_0x72df('0xc')]=moment()[_0x72df('0xd')](_0x72df('0xe'));}if(_0x1e44c8[_0x72df('0xf')]('production')){_0x1e44c8[_0x72df('0x10')]=moment()[_0x72df('0xd')](_0x72df('0xe'));}_0x4cd4ab(null,_0x1e44c8);}}});};
\ No newline at end of file
index 544e084..3f3a706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19dd=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','include','map','model','attributes','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x19dd,0x18a));var _0xd19d=function(_0x42e75c,_0x136223){_0x42e75c=_0x42e75c-0x0;var _0x42b0b8=_0x19dd[_0x42e75c];return _0x42b0b8;};'use strict';var _=require(_0xd19d('0x0'));var util=require('util');var moment=require(_0xd19d('0x1'));var BPromise=require(_0xd19d('0x2'));var rs=require(_0xd19d('0x3'));var fs=require('fs');var Redis=require(_0xd19d('0x4'));var db=require(_0xd19d('0x5'))['db'];var utils=require(_0xd19d('0x6'));var logger=require(_0xd19d('0x7'))(_0xd19d('0x8'));var config=require(_0xd19d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd19d('0xa')][_0xd19d('0xb')]({'port':0x232a});config[_0xd19d('0xc')]=_[_0xd19d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd19d('0xe'))(new Redis(config[_0xd19d('0xc')]));require(_0xd19d('0xf'))[_0xd19d('0x10')](socket);function respondWithRpcPromise(_0x5bb6ec,_0x8b7f5d,_0x3c90ae){return new BPromise(function(_0x4c914d,_0x987149){return client[_0xd19d('0x11')](_0x5bb6ec,_0x3c90ae)['then'](function(_0x353950){logger[_0xd19d('0x12')](_0xd19d('0x13'),_0x8b7f5d,_0xd19d('0x14'));logger[_0xd19d('0x15')](_0xd19d('0x16'),_0x8b7f5d,_0xd19d('0x14'),JSON[_0xd19d('0x17')](_0x353950));if(_0x353950[_0xd19d('0x18')]){if(_0x353950[_0xd19d('0x18')][_0xd19d('0x19')]===0x1f4){logger['error'](_0xd19d('0x13'),_0x8b7f5d,_0x353950['error']['message']);return _0x987149(_0x353950[_0xd19d('0x18')]['message']);}logger[_0xd19d('0x18')](_0xd19d('0x13'),_0x8b7f5d,_0x353950[_0xd19d('0x18')][_0xd19d('0x1a')]);return _0x4c914d(_0x353950[_0xd19d('0x18')]['message']);}else{logger[_0xd19d('0x12')](_0xd19d('0x13'),_0x8b7f5d,_0xd19d('0x14'));_0x4c914d(_0x353950[_0xd19d('0x1b')][_0xd19d('0x1a')]);}})[_0xd19d('0x1c')](function(_0x5c4075){logger[_0xd19d('0x18')](_0xd19d('0x13'),_0x8b7f5d,_0x5c4075);_0x987149(_0x5c4075);});});}exports[_0xd19d('0x1d')]=function(_0xcb426){var _0x2857e1=this;return new Promise(function(_0x2e9d8,_0x4b361b){return db[_0xd19d('0x1e')][_0xd19d('0x1f')]({'raw':_0xcb426[_0xd19d('0x20')]?_0xcb426[_0xd19d('0x20')][_0xd19d('0x21')]===undefined?!![]:![]:!![],'where':_0xcb426[_0xd19d('0x20')]?_0xcb426[_0xd19d('0x20')][_0xd19d('0x22')]||null:null,'attributes':_0xcb426[_0xd19d('0x20')]?_0xcb426[_0xd19d('0x20')]['attributes']||null:null,'include':_0xcb426[_0xd19d('0x20')]?_0xcb426[_0xd19d('0x20')][_0xd19d('0x23')]?_[_0xd19d('0x24')](_0xcb426[_0xd19d('0x20')]['include'],function(_0x315849){return{'model':db[_0x315849[_0xd19d('0x25')]],'as':_0x315849['as'],'attributes':_0x315849[_0xd19d('0x26')],'include':_0x315849[_0xd19d('0x23')]?_[_0xd19d('0x24')](_0x315849[_0xd19d('0x23')],function(_0xd18c48){return{'model':db[_0xd18c48[_0xd19d('0x25')]],'as':_0xd18c48['as'],'attributes':_0xd18c48['attributes'],'include':_0xd18c48[_0xd19d('0x23')]?_[_0xd19d('0x24')](_0xd18c48[_0xd19d('0x23')],function(_0x27d7b5){return{'model':db[_0x27d7b5[_0xd19d('0x25')]],'as':_0x27d7b5['as'],'attributes':_0x27d7b5['attributes']};}):[]};}):[]};}):[]:[]})[_0xd19d('0x27')](function(_0x53f0ae){logger['info'](_0xd19d('0x1d'),_0xcb426);logger[_0xd19d('0x15')](_0xd19d('0x1d'),_0xcb426,JSON[_0xd19d('0x17')](_0x53f0ae));_0x2e9d8(_0x53f0ae);})[_0xd19d('0x1c')](function(_0x1f9254){logger[_0xd19d('0x18')](_0xd19d('0x1d'),_0x1f9254[_0xd19d('0x1a')],_0xcb426);_0x4b361b(_0x2857e1[_0xd19d('0x18')](0x1f4,_0x1f9254[_0xd19d('0x1a')]));});});};
\ No newline at end of file
+var _0x9613=['defaults','redis','localhost','./squareProject.socket','register','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','SquareProject,\x20%s,\x20%s','message','ShowSquareProject','find','options','raw','where','attributes','map','include','model','debug','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x2c044c,_0x217c40){var _0x2144a0=function(_0x3a4696){while(--_0x3a4696){_0x2c044c['push'](_0x2c044c['shift']());}};_0x2144a0(++_0x217c40);}(_0x9613,0x16c));var _0x3961=function(_0x34b02c,_0x3aa4ee){_0x34b02c=_0x34b02c-0x0;var _0x237403=_0x9613[_0x34b02c];return _0x237403;};'use strict';var _=require(_0x3961('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3961('0x1'));var db=require(_0x3961('0x2'))['db'];var utils=require(_0x3961('0x3'));var logger=require(_0x3961('0x4'))('rpc');var config=require(_0x3961('0x5'));var jayson=require(_0x3961('0x6'));var client=jayson['client'][_0x3961('0x7')]({'port':0x232a});config['redis']=_[_0x3961('0x8')](config[_0x3961('0x9')],{'host':_0x3961('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3961('0x9')]));require(_0x3961('0xb'))[_0x3961('0xc')](socket);function respondWithRpcPromise(_0x9901e9,_0x44c002,_0x431e4f){return new BPromise(function(_0x31f8e1,_0x5201f2){return client['request'](_0x9901e9,_0x431e4f)['then'](function(_0x31daee){logger[_0x3961('0xd')]('SquareProject,\x20%s,\x20%s',_0x44c002,_0x3961('0xe'));logger['debug'](_0x3961('0xf'),_0x44c002,_0x3961('0xe'),JSON[_0x3961('0x10')](_0x31daee));if(_0x31daee[_0x3961('0x11')]){if(_0x31daee[_0x3961('0x11')]['code']===0x1f4){logger[_0x3961('0x11')](_0x3961('0x12'),_0x44c002,_0x31daee[_0x3961('0x11')]['message']);return _0x5201f2(_0x31daee[_0x3961('0x11')][_0x3961('0x13')]);}logger[_0x3961('0x11')](_0x3961('0x12'),_0x44c002,_0x31daee[_0x3961('0x11')]['message']);return _0x31f8e1(_0x31daee[_0x3961('0x11')][_0x3961('0x13')]);}else{logger[_0x3961('0xd')](_0x3961('0x12'),_0x44c002,_0x3961('0xe'));_0x31f8e1(_0x31daee['result'][_0x3961('0x13')]);}})['catch'](function(_0x10962a){logger['error'](_0x3961('0x12'),_0x44c002,_0x10962a);_0x5201f2(_0x10962a);});});}exports[_0x3961('0x14')]=function(_0x324f3e){var _0x2f89f9=this;return new Promise(function(_0x4264bf,_0x4f659f){return db['SquareProject'][_0x3961('0x15')]({'raw':_0x324f3e['options']?_0x324f3e[_0x3961('0x16')][_0x3961('0x17')]===undefined?!![]:![]:!![],'where':_0x324f3e['options']?_0x324f3e[_0x3961('0x16')][_0x3961('0x18')]||null:null,'attributes':_0x324f3e[_0x3961('0x16')]?_0x324f3e[_0x3961('0x16')][_0x3961('0x19')]||null:null,'include':_0x324f3e[_0x3961('0x16')]?_0x324f3e['options']['include']?_[_0x3961('0x1a')](_0x324f3e[_0x3961('0x16')][_0x3961('0x1b')],function(_0x181f5c){return{'model':db[_0x181f5c[_0x3961('0x1c')]],'as':_0x181f5c['as'],'attributes':_0x181f5c['attributes'],'include':_0x181f5c[_0x3961('0x1b')]?_['map'](_0x181f5c[_0x3961('0x1b')],function(_0x427c47){return{'model':db[_0x427c47[_0x3961('0x1c')]],'as':_0x427c47['as'],'attributes':_0x427c47['attributes'],'include':_0x427c47['include']?_['map'](_0x427c47[_0x3961('0x1b')],function(_0x2537aa){return{'model':db[_0x2537aa[_0x3961('0x1c')]],'as':_0x2537aa['as'],'attributes':_0x2537aa[_0x3961('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ab65f){logger[_0x3961('0xd')]('ShowSquareProject',_0x324f3e);logger[_0x3961('0x1d')]('ShowSquareProject',_0x324f3e,JSON['stringify'](_0x4ab65f));_0x4264bf(_0x4ab65f);})[_0x3961('0x1e')](function(_0x1a80b8){logger[_0x3961('0x11')](_0x3961('0x14'),_0x1a80b8[_0x3961('0x13')],_0x324f3e);_0x4f659f(_0x2f89f9[_0x3961('0x11')](0x1f4,_0x1a80b8[_0x3961('0x13')]));});});};
\ No newline at end of file
index 69991e2..cc234f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d49=['update','emit','removeListener','register','length','squareProject:','./squareProject.events','save'];(function(_0x34dfc8,_0x7bfb7a){var _0x597bda=function(_0x386edf){while(--_0x386edf){_0x34dfc8['push'](_0x34dfc8['shift']());}};_0x597bda(++_0x7bfb7a);}(_0x6d49,0x6e));var _0x96d4=function(_0x2d0fa5,_0x5b4db){_0x2d0fa5=_0x2d0fa5-0x0;var _0x3c0154=_0x6d49[_0x2d0fa5];return _0x3c0154;};'use strict';var SquareProjectEvents=require(_0x96d4('0x0'));var events=[_0x96d4('0x1'),'remove',_0x96d4('0x2')];function createListener(_0x434313,_0x581af4){return function(_0xb38a96){_0x581af4[_0x96d4('0x3')](_0x434313,_0xb38a96);};}function removeListener(_0x36c088,_0x423db8){return function(){SquareProjectEvents[_0x96d4('0x4')](_0x36c088,_0x423db8);};}exports[_0x96d4('0x5')]=function(_0x59f1d2){for(var _0x370e39=0x0,_0x3f4db4=events[_0x96d4('0x6')];_0x370e39<_0x3f4db4;_0x370e39++){var _0x12219b=events[_0x370e39];var _0x2282f3=createListener(_0x96d4('0x7')+_0x12219b,_0x59f1d2);SquareProjectEvents['on'](_0x12219b,_0x2282f3);}};
\ No newline at end of file
+var _0x4e67=['emit','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x5465f8,_0x422dad){var _0x22ff4b=function(_0x1356dc){while(--_0x1356dc){_0x5465f8['push'](_0x5465f8['shift']());}};_0x22ff4b(++_0x422dad);}(_0x4e67,0xac));var _0x74e6=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0x4e67[_0x2b45b5];return _0x1d9c06;};'use strict';var SquareProjectEvents=require(_0x74e6('0x0'));var events=[_0x74e6('0x1'),_0x74e6('0x2'),_0x74e6('0x3')];function createListener(_0x1c2495,_0x4af7e1){return function(_0x2a4e4a){_0x4af7e1[_0x74e6('0x4')](_0x1c2495,_0x2a4e4a);};}function removeListener(_0x4d84f2,_0xd7c27f){return function(){SquareProjectEvents['removeListener'](_0x4d84f2,_0xd7c27f);};}exports[_0x74e6('0x5')]=function(_0x15a665){for(var _0x167444=0x0,_0x41ba4f=events[_0x74e6('0x6')];_0x167444<_0x41ba4f;_0x167444++){var _0x355626=events[_0x167444];var _0x116ed1=createListener(_0x74e6('0x7')+_0x355626,_0x15a665);SquareProjectEvents['on'](_0x355626,_0x116ed1);}};
\ No newline at end of file
index 4615249..bab5caa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0xdffda6,_0x58aa48){var _0x493b80=function(_0x5d3426){while(--_0x5d3426){_0xdffda6['push'](_0xdffda6['shift']());}};_0x493b80(++_0x58aa48);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router;
\ No newline at end of file
+var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0xa67d31,_0x3a694e){var _0x2723a1=function(_0x5951e6){while(--_0x5951e6){_0xa67d31['push'](_0xa67d31['shift']());}};_0x2723a1(++_0x3a694e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1e45ec,_0x2e11eb){_0x1e45ec=_0x1e45ec-0x0;var _0x42f22d=_0x7fbe[_0x1e45ec];return _0x42f22d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router;
\ No newline at end of file
index 80a6299..e87d7e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f47=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue'];(function(_0x662ee4,_0x4632e9){var _0x569bca=function(_0x3352b7){while(--_0x3352b7){_0x662ee4['push'](_0x662ee4['shift']());}};_0x569bca(++_0x4632e9);}(_0x6f47,0xc7));var _0x76f4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6f47[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'uniqueid':{'type':Sequelize[_0x76f4('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76f4('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x76f4('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76f4('0x1')]},'dnid':{'type':Sequelize[_0x76f4('0x1')]},'projectName':{'type':Sequelize[_0x76f4('0x1')]},'saveName':{'type':Sequelize[_0x76f4('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x76f4('0x1')]},'format':{'type':Sequelize[_0x76f4('0x2')],'get':function(){var _0x2176a7='';var _0x497f99=this[_0x76f4('0x3')](_0x76f4('0x4'));if(_0x497f99){_0x2176a7=_0x497f99[_0x76f4('0x5')](_0x497f99[_0x76f4('0x6')]('.'));}return _0x2176a7;}}};
\ No newline at end of file
+var _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0xbbd5cc,_0x5c72d5){var _0x1d7c29=function(_0x1ba8bc){while(--_0x1ba8bc){_0xbbd5cc['push'](_0xbbd5cc['shift']());}};_0x1d7c29(++_0x5c72d5);}(_0x032e,0x124));var _0xe032=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x032e[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}};
\ No newline at end of file
index 321b11d..08804e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95db=['order','sort','where','pick','filter','merge','VIRTUAL','SquareRecording','includeAll','include','findAll','catch','show','params','length','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','decryptFile','secrets','existsSync','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','destroy','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0xf276ef,_0x1ba14a){var _0x32026b=function(_0x3d6930){while(--_0x3d6930){_0xf276ef['push'](_0xf276ef['shift']());}};_0x32026b(++_0x1ba14a);}(_0x95db,0x87));var _0xb95d=function(_0x24a9c1,_0x168c64){_0x24a9c1=_0x24a9c1-0x0;var _0x13ddb4=_0x95db[_0x24a9c1];return _0x13ddb4;};'use strict';var emlformat=require(_0xb95d('0x0'));var rimraf=require(_0xb95d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb95d('0x2'));var rp=require('request-promise');var moment=require(_0xb95d('0x3'));var BPromise=require(_0xb95d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb95d('0x5'));var sox=require(_0xb95d('0x6'));var csv=require(_0xb95d('0x7'));var ejs=require(_0xb95d('0x8'));var fs=require('fs');var fs_extra=require(_0xb95d('0x9'));var _=require('lodash');var squel=require(_0xb95d('0xa'));var crypto=require(_0xb95d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb95d('0xc'));var toCsv=require(_0xb95d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb95d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb95d('0xe'));var as=require(_0xb95d('0xf'));var hardwareService=require(_0xb95d('0x10'));var logger=require(_0xb95d('0x11'))(_0xb95d('0x12'));var utils=require(_0xb95d('0x13'));var config=require(_0xb95d('0x14'));var licenseUtil=require(_0xb95d('0x15'));var db=require(_0xb95d('0x16'))['db'];function respondWithStatusCode(_0x28be52,_0x42c1fd){_0x42c1fd=_0x42c1fd||0xcc;return function(_0x17e572){if(_0x17e572){return _0x28be52[_0xb95d('0x17')](_0x42c1fd);}return _0x28be52[_0xb95d('0x18')](_0x42c1fd)[_0xb95d('0x19')]();};}function respondWithResult(_0xc2fea9,_0x35afb3){_0x35afb3=_0x35afb3||0xc8;return function(_0xd54473){if(_0xd54473){return _0xc2fea9['status'](_0x35afb3)[_0xb95d('0x1a')](_0xd54473);}};}function respondWithFilteredResult(_0x395b02,_0x1ef272){return function(_0x2dbe49){if(_0x2dbe49){var _0x5c3446=typeof _0x1ef272[_0xb95d('0x1b')]===_0xb95d('0x1c')&&typeof _0x1ef272[_0xb95d('0x1d')]===_0xb95d('0x1c');var _0xa454fb=_0x2dbe49[_0xb95d('0x1e')];var _0x31e855=_0x5c3446?0x0:_0x1ef272[_0xb95d('0x1b')];var _0x2f710e=_0x5c3446?_0x2dbe49[_0xb95d('0x1e')]:_0x1ef272[_0xb95d('0x1b')]+_0x1ef272[_0xb95d('0x1d')];var _0x1822a3;if(_0x2f710e>=_0xa454fb){_0x2f710e=_0xa454fb;_0x1822a3=0xc8;}else{_0x1822a3=0xce;}_0x395b02[_0xb95d('0x18')](_0x1822a3);return _0x395b02['set']('Content-Range',_0x31e855+'-'+_0x2f710e+'/'+_0xa454fb)['json'](_0x2dbe49);}return null;};}function patchUpdates(_0x4f7b1d){return function(_0x41017f){try{jsonpatch[_0xb95d('0x1f')](_0x41017f,_0x4f7b1d,!![]);}catch(_0x42108d){return BPromise[_0xb95d('0x20')](_0x42108d);}return _0x41017f[_0xb95d('0x21')]();};}function saveUpdates(_0x5cff1c,_0x239c28){return function(_0x3d50ae){if(_0x3d50ae){return _0x3d50ae[_0xb95d('0x22')](_0x5cff1c)[_0xb95d('0x23')](function(_0x25cfbc){return _0x25cfbc;});}return null;};}function removeEntity(_0x1ca511,_0x4d0b84){return function(_0x3d082b){if(_0x3d082b){return _0x3d082b['destroy']()[_0xb95d('0x23')](function(){_0x1ca511['status'](0xcc)[_0xb95d('0x19')]();});}};}function handleEntityNotFound(_0x57b94c,_0x313901){return function(_0x51ce53){if(!_0x51ce53){_0x57b94c[_0xb95d('0x17')](0x194);}return _0x51ce53;};}function handleError(_0x483b7b,_0xde4165){_0xde4165=_0xde4165||0x1f4;return function(_0x3793d1){logger[_0xb95d('0x24')](_0x3793d1[_0xb95d('0x25')]);if(_0x3793d1[_0xb95d('0x26')]){delete _0x3793d1[_0xb95d('0x26')];}_0x483b7b[_0xb95d('0x18')](_0xde4165)['send'](_0x3793d1);};}exports[_0xb95d('0x27')]=function(_0xd3ca3c,_0x5c4b74){var _0x1e89b0={},_0x587f6b={},_0x2b083a={'count':0x0,'rows':[]};var _0x54aaa7=_['map'](db['SquareRecording'][_0xb95d('0x28')],function(_0x11dfd8){return{'name':_0x11dfd8['fieldName'],'type':_0x11dfd8[_0xb95d('0x29')][_0xb95d('0x2a')]};});_0x587f6b[_0xb95d('0x2b')]=_[_0xb95d('0x2c')](_0x54aaa7,_0xb95d('0x26'));_0x587f6b[_0xb95d('0x2d')]=_['keys'](_0xd3ca3c['query']);_0x587f6b[_0xb95d('0x2e')]=_[_0xb95d('0x2f')](_0x587f6b['model'],_0x587f6b[_0xb95d('0x2d')]);_0x1e89b0[_0xb95d('0x30')]=_[_0xb95d('0x2f')](_0x587f6b[_0xb95d('0x2b')],qs['fields'](_0xd3ca3c[_0xb95d('0x2d')][_0xb95d('0x31')]));_0x1e89b0[_0xb95d('0x30')]=_0x1e89b0[_0xb95d('0x30')]['length']?_0x1e89b0[_0xb95d('0x30')]:_0x587f6b[_0xb95d('0x2b')];if(!_0xd3ca3c['query'][_0xb95d('0x32')]('nolimit')){_0x1e89b0[_0xb95d('0x1d')]=qs['limit'](_0xd3ca3c[_0xb95d('0x2d')]['limit']);_0x1e89b0[_0xb95d('0x1b')]=qs[_0xb95d('0x1b')](_0xd3ca3c['query'][_0xb95d('0x1b')]);}_0x1e89b0[_0xb95d('0x33')]=qs[_0xb95d('0x34')](_0xd3ca3c[_0xb95d('0x2d')][_0xb95d('0x34')]);_0x1e89b0[_0xb95d('0x35')]=qs[_0xb95d('0x2e')](_[_0xb95d('0x36')](_0xd3ca3c[_0xb95d('0x2d')],_0x587f6b[_0xb95d('0x2e')]),_0x54aaa7);if(_0xd3ca3c[_0xb95d('0x2d')][_0xb95d('0x37')]){_0x1e89b0[_0xb95d('0x35')]=_[_0xb95d('0x38')](_0x1e89b0[_0xb95d('0x35')],{'$or':_[_0xb95d('0x2c')](_0x54aaa7,function(_0x53dc2f){if(_0x53dc2f[_0xb95d('0x29')]!==_0xb95d('0x39')){var _0x26595b={};_0x26595b[_0x53dc2f['name']]={'$like':'%'+_0xd3ca3c[_0xb95d('0x2d')][_0xb95d('0x37')]+'%'};return _0x26595b;}})});}_0x1e89b0=_[_0xb95d('0x38')]({},_0x1e89b0,_0xd3ca3c['options']);var _0x4ec2e5={'where':_0x1e89b0[_0xb95d('0x35')]};return db[_0xb95d('0x3a')]['count'](_0x4ec2e5)[_0xb95d('0x23')](function(_0x1e8a98){_0x2b083a[_0xb95d('0x1e')]=_0x1e8a98;if(_0xd3ca3c[_0xb95d('0x2d')][_0xb95d('0x3b')]){_0x1e89b0[_0xb95d('0x3c')]=[{'all':!![]}];}return db['SquareRecording'][_0xb95d('0x3d')](_0x1e89b0);})[_0xb95d('0x23')](function(_0x38109){_0x2b083a['rows']=_0x38109;return _0x2b083a;})[_0xb95d('0x23')](respondWithFilteredResult(_0x5c4b74,_0x1e89b0))[_0xb95d('0x3e')](handleError(_0x5c4b74,null));};exports[_0xb95d('0x3f')]=function(_0x2a2e43,_0x5ca19d){var _0x151e25={'raw':!![],'where':{'id':_0x2a2e43[_0xb95d('0x40')]['id']}},_0x38e38f={};_0x38e38f[_0xb95d('0x2b')]=_['keys'](db[_0xb95d('0x3a')][_0xb95d('0x28')]);_0x38e38f[_0xb95d('0x2d')]=_['keys'](_0x2a2e43[_0xb95d('0x2d')]);_0x38e38f[_0xb95d('0x2e')]=_[_0xb95d('0x2f')](_0x38e38f['model'],_0x38e38f[_0xb95d('0x2d')]);_0x151e25[_0xb95d('0x30')]=_['intersection'](_0x38e38f[_0xb95d('0x2b')],qs[_0xb95d('0x31')](_0x2a2e43['query'][_0xb95d('0x31')]));_0x151e25[_0xb95d('0x30')]=_0x151e25['attributes'][_0xb95d('0x41')]?_0x151e25[_0xb95d('0x30')]:_0x38e38f[_0xb95d('0x2b')];if(_0x2a2e43[_0xb95d('0x2d')][_0xb95d('0x3b')]){_0x151e25['include']=[{'all':!![]}];}_0x151e25=_[_0xb95d('0x38')]({},_0x151e25,_0x2a2e43['options']);return db[_0xb95d('0x3a')][_0xb95d('0x42')](_0x151e25)[_0xb95d('0x23')](handleEntityNotFound(_0x5ca19d,null))[_0xb95d('0x23')](respondWithResult(_0x5ca19d,null))[_0xb95d('0x3e')](handleError(_0x5ca19d,null));};exports['create']=function(_0x101fc1,_0x34cafa){return db[_0xb95d('0x3a')][_0xb95d('0x43')](_0x101fc1['body'],{})[_0xb95d('0x23')](respondWithResult(_0x34cafa,0xc9))[_0xb95d('0x3e')](handleError(_0x34cafa,null));};exports['update']=function(_0x506f75,_0xd8973f){if(_0x506f75[_0xb95d('0x44')]['id']){delete _0x506f75[_0xb95d('0x44')]['id'];}return db['SquareRecording'][_0xb95d('0x42')]({'where':{'id':_0x506f75['params']['id']}})[_0xb95d('0x23')](handleEntityNotFound(_0xd8973f,null))[_0xb95d('0x23')](saveUpdates(_0x506f75[_0xb95d('0x44')],null))[_0xb95d('0x23')](respondWithResult(_0xd8973f,null))['catch'](handleError(_0xd8973f,null));};exports[_0xb95d('0x45')]=function(_0x5b75a7,_0x4d601c,_0x545041){var _0x2b7735=require(_0xb95d('0x46'));var _0x23aa0e=![];var _0x33f3a6={};if(_0x5b75a7[_0xb95d('0x2d')][_0xb95d('0x29')]&&_0x5b75a7[_0xb95d('0x2d')][_0xb95d('0x29')]==='uniqueid'){_0x33f3a6[_0xb95d('0x47')]=_0x5b75a7['params']['id'];}else{_0x33f3a6['id']=_0x5b75a7['params']['id'];}return db['SquareRecording'][_0xb95d('0x42')]({'where':_0x33f3a6,'attributes':['id',_0xb95d('0x48'),_0xb95d('0x49')],'raw':!![]})[_0xb95d('0x23')](handleEntityNotFound(_0x4d601c,null))[_0xb95d('0x23')](function(_0x54e579){if(_0x54e579){var _0x5a5f17=_0x54e579[_0xb95d('0x48')];var _0x4156dc=util['format'](_0xb95d('0x4a'),_0x5a5f17);if(fs['existsSync'](_0x4156dc)){_0x23aa0e=!![];return _0x2b7735[_0xb95d('0x4b')](_0x4156dc,_0x5a5f17,config[_0xb95d('0x4c')]['recording'])[_0xb95d('0x23')](function(){return _0x54e579;});}return _0x54e579;}})[_0xb95d('0x23')](function(_0x16f937){if(_0x16f937){var _0x275e83=_0x16f937['savePath'];if(!fs[_0xb95d('0x4d')](_0x275e83)){throw new db['Sequelize'][(_0xb95d('0x4e'))](_0xb95d('0x4f'));}if(_0x16f937[_0xb95d('0x49')]){return _0x4d601c[_0xb95d('0x45')](_0x275e83,_0x16f937[_0xb95d('0x49')]+path[_0xb95d('0x50')](_0x275e83),function(){if(_0x23aa0e){fs[_0xb95d('0x51')](_0x275e83);}});}else{return _0x4d601c['download'](_0x275e83,function(_0x20a66c){if(_0x23aa0e){fs[_0xb95d('0x51')](_0x275e83);}});}}})[_0xb95d('0x3e')](function(_0x528c01){if(_0x528c01[_0xb95d('0x52')]===_0xb95d('0x4f')){_0x4d601c['status'](0x194)[_0xb95d('0x53')](_0xb95d('0x54'));}else{return handleError(_0x4d601c,null);}});};exports[_0xb95d('0x55')]=function(_0x1e3284,_0x31403a){return db['SquareRecording'][_0xb95d('0x42')]({'where':{'id':_0x1e3284[_0xb95d('0x40')]['id']}})['then'](function(_0x1541b5){if(_[_0xb95d('0x56')](_0x1541b5)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1541b5;})[_0xb95d('0x23')](function(_0x257bad){var _0x274cff=_0x257bad[_0xb95d('0x48')];logger['info'](_0xb95d('0x57'),_0x274cff);if(!_['isNil'](_0x257bad[_0xb95d('0x48')])&&fs[_0xb95d('0x4d')](_0x274cff)){logger[_0xb95d('0x58')](_0xb95d('0x59')+_0x274cff+_0xb95d('0x5a'));fs['unlinkSync'](_0x274cff);}_0x274cff=_0x274cff+_0xb95d('0x5b');if(!_[_0xb95d('0x56')](_0x257bad[_0xb95d('0x48')])&&fs[_0xb95d('0x4d')](_0x274cff)){logger['info']('File:\x20\x22'+_0x274cff+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb95d('0x5c')](_0x274cff);}return _0x257bad;})[_0xb95d('0x23')](function(_0x583153){if(!_0x583153)throw new InternalError();return _0x583153['destroy']();})['then'](function(){_0x31403a[_0xb95d('0x18')](0xcc)[_0xb95d('0x19')]();})[_0xb95d('0x3e')](handleError(_0x31403a,null));};
\ No newline at end of file
+var _0xc107=['status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','SquareRecording','rawAttributes','fieldName','model','keys','filters','query','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','params','length','includeAll','find','create','body','download','uniqueid','filename','savePath','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc107,0x9d));var _0x7c10=function(_0x25400b,_0x3ae3fb){_0x25400b=_0x25400b-0x0;var _0xf9975d=_0xc107[_0x25400b];return _0xf9975d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c10('0x0'));var jsonpatch=require(_0x7c10('0x1'));var rp=require(_0x7c10('0x2'));var moment=require(_0x7c10('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c10('0x4'));var util=require('util');var path=require(_0x7c10('0x5'));var sox=require(_0x7c10('0x6'));var csv=require('to-csv');var ejs=require(_0x7c10('0x7'));var fs=require('fs');var fs_extra=require(_0x7c10('0x8'));var _=require('lodash');var squel=require(_0x7c10('0x9'));var crypto=require(_0x7c10('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c10('0xb'));var Papa=require('papaparse');var Redis=require(_0x7c10('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7c10('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c10('0xe'));var logger=require(_0x7c10('0xf'))('api');var utils=require(_0x7c10('0x10'));var config=require(_0x7c10('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102b5f,_0x8eb0c5){_0x8eb0c5=_0x8eb0c5||0xcc;return function(_0x242276){if(_0x242276){return _0x102b5f[_0x7c10('0x12')](_0x8eb0c5);}return _0x102b5f['status'](_0x8eb0c5)['end']();};}function respondWithResult(_0xf52dc5,_0x24d9b7){_0x24d9b7=_0x24d9b7||0xc8;return function(_0x37c94b){if(_0x37c94b){return _0xf52dc5[_0x7c10('0x13')](_0x24d9b7)[_0x7c10('0x14')](_0x37c94b);}};}function respondWithFilteredResult(_0x20c241,_0x3bd65a){return function(_0x3525f9){if(_0x3525f9){var _0x49845c=typeof _0x3bd65a[_0x7c10('0x15')]==='undefined'&&typeof _0x3bd65a[_0x7c10('0x16')]===_0x7c10('0x17');var _0x2bec74=_0x3525f9[_0x7c10('0x18')];var _0x1c9448=_0x49845c?0x0:_0x3bd65a[_0x7c10('0x15')];var _0x1a5729=_0x49845c?_0x3525f9[_0x7c10('0x18')]:_0x3bd65a[_0x7c10('0x15')]+_0x3bd65a['limit'];var _0x24c0d7;if(_0x1a5729>=_0x2bec74){_0x1a5729=_0x2bec74;_0x24c0d7=0xc8;}else{_0x24c0d7=0xce;}_0x20c241['status'](_0x24c0d7);return _0x20c241[_0x7c10('0x19')](_0x7c10('0x1a'),_0x1c9448+'-'+_0x1a5729+'/'+_0x2bec74)[_0x7c10('0x14')](_0x3525f9);}return null;};}function patchUpdates(_0x5c0a92){return function(_0x16fec9){try{jsonpatch[_0x7c10('0x1b')](_0x16fec9,_0x5c0a92,!![]);}catch(_0x32c0c0){return BPromise[_0x7c10('0x1c')](_0x32c0c0);}return _0x16fec9[_0x7c10('0x1d')]();};}function saveUpdates(_0x9b83c2,_0x5693ed){return function(_0x1735f7){if(_0x1735f7){return _0x1735f7[_0x7c10('0x1e')](_0x9b83c2)[_0x7c10('0x1f')](function(_0x19bb64){return _0x19bb64;});}return null;};}function removeEntity(_0x46d273,_0x281de4){return function(_0x54b5a4){if(_0x54b5a4){return _0x54b5a4[_0x7c10('0x20')]()['then'](function(){_0x46d273[_0x7c10('0x13')](0xcc)[_0x7c10('0x21')]();});}};}function handleEntityNotFound(_0x22f1da,_0x52f6b6){return function(_0x263317){if(!_0x263317){_0x22f1da[_0x7c10('0x12')](0x194);}return _0x263317;};}function handleError(_0x5ce096,_0x39c9fc){_0x39c9fc=_0x39c9fc||0x1f4;return function(_0x48d530){logger[_0x7c10('0x22')](_0x48d530['stack']);if(_0x48d530['name']){delete _0x48d530[_0x7c10('0x23')];}_0x5ce096['status'](_0x39c9fc)[_0x7c10('0x24')](_0x48d530);};}exports['index']=function(_0x19ca80,_0xa440f7){var _0x3f29f4={},_0x253cd5={},_0x11c421={'count':0x0,'rows':[]};var _0x30ff39=_[_0x7c10('0x25')](db[_0x7c10('0x26')][_0x7c10('0x27')],function(_0xc91863){return{'name':_0xc91863[_0x7c10('0x28')],'type':_0xc91863['type']['key']};});_0x253cd5[_0x7c10('0x29')]=_[_0x7c10('0x25')](_0x30ff39,_0x7c10('0x23'));_0x253cd5['query']=_[_0x7c10('0x2a')](_0x19ca80['query']);_0x253cd5[_0x7c10('0x2b')]=_['intersection'](_0x253cd5[_0x7c10('0x29')],_0x253cd5[_0x7c10('0x2c')]);_0x3f29f4[_0x7c10('0x2d')]=_[_0x7c10('0x2e')](_0x253cd5[_0x7c10('0x29')],qs[_0x7c10('0x2f')](_0x19ca80['query'][_0x7c10('0x2f')]));_0x3f29f4[_0x7c10('0x2d')]=_0x3f29f4[_0x7c10('0x2d')]['length']?_0x3f29f4[_0x7c10('0x2d')]:_0x253cd5[_0x7c10('0x29')];if(!_0x19ca80['query']['hasOwnProperty'](_0x7c10('0x30'))){_0x3f29f4[_0x7c10('0x16')]=qs[_0x7c10('0x16')](_0x19ca80[_0x7c10('0x2c')][_0x7c10('0x16')]);_0x3f29f4['offset']=qs['offset'](_0x19ca80[_0x7c10('0x2c')][_0x7c10('0x15')]);}_0x3f29f4[_0x7c10('0x31')]=qs[_0x7c10('0x32')](_0x19ca80[_0x7c10('0x2c')][_0x7c10('0x32')]);_0x3f29f4[_0x7c10('0x33')]=qs['filters'](_[_0x7c10('0x34')](_0x19ca80['query'],_0x253cd5[_0x7c10('0x2b')]),_0x30ff39);if(_0x19ca80[_0x7c10('0x2c')][_0x7c10('0x35')]){_0x3f29f4[_0x7c10('0x33')]=_[_0x7c10('0x36')](_0x3f29f4[_0x7c10('0x33')],{'$or':_[_0x7c10('0x25')](_0x30ff39,function(_0x190a6f){if(_0x190a6f[_0x7c10('0x37')]!==_0x7c10('0x38')){var _0x41f9a3={};_0x41f9a3[_0x190a6f[_0x7c10('0x23')]]={'$like':'%'+_0x19ca80[_0x7c10('0x2c')][_0x7c10('0x35')]+'%'};return _0x41f9a3;}})});}_0x3f29f4=_[_0x7c10('0x36')]({},_0x3f29f4,_0x19ca80[_0x7c10('0x39')]);var _0x5a3b5f={'where':_0x3f29f4[_0x7c10('0x33')]};return db[_0x7c10('0x26')][_0x7c10('0x18')](_0x5a3b5f)[_0x7c10('0x1f')](function(_0x4a8cfd){_0x11c421[_0x7c10('0x18')]=_0x4a8cfd;if(_0x19ca80[_0x7c10('0x2c')]['includeAll']){_0x3f29f4[_0x7c10('0x3a')]=[{'all':!![]}];}return db[_0x7c10('0x26')]['findAll'](_0x3f29f4);})[_0x7c10('0x1f')](function(_0x44a317){_0x11c421[_0x7c10('0x3b')]=_0x44a317;return _0x11c421;})[_0x7c10('0x1f')](respondWithFilteredResult(_0xa440f7,_0x3f29f4))[_0x7c10('0x3c')](handleError(_0xa440f7,null));};exports['show']=function(_0x2d2f97,_0x45eb59){var _0x1875a8={'raw':!![],'where':{'id':_0x2d2f97[_0x7c10('0x3d')]['id']}},_0xb65498={};_0xb65498[_0x7c10('0x29')]=_[_0x7c10('0x2a')](db[_0x7c10('0x26')][_0x7c10('0x27')]);_0xb65498[_0x7c10('0x2c')]=_['keys'](_0x2d2f97[_0x7c10('0x2c')]);_0xb65498[_0x7c10('0x2b')]=_[_0x7c10('0x2e')](_0xb65498[_0x7c10('0x29')],_0xb65498[_0x7c10('0x2c')]);_0x1875a8[_0x7c10('0x2d')]=_[_0x7c10('0x2e')](_0xb65498['model'],qs[_0x7c10('0x2f')](_0x2d2f97['query'][_0x7c10('0x2f')]));_0x1875a8['attributes']=_0x1875a8[_0x7c10('0x2d')][_0x7c10('0x3e')]?_0x1875a8['attributes']:_0xb65498[_0x7c10('0x29')];if(_0x2d2f97[_0x7c10('0x2c')][_0x7c10('0x3f')]){_0x1875a8[_0x7c10('0x3a')]=[{'all':!![]}];}_0x1875a8=_['merge']({},_0x1875a8,_0x2d2f97[_0x7c10('0x39')]);return db[_0x7c10('0x26')][_0x7c10('0x40')](_0x1875a8)[_0x7c10('0x1f')](handleEntityNotFound(_0x45eb59,null))[_0x7c10('0x1f')](respondWithResult(_0x45eb59,null))['catch'](handleError(_0x45eb59,null));};exports[_0x7c10('0x41')]=function(_0x54d62b,_0x2bcb40){return db[_0x7c10('0x26')][_0x7c10('0x41')](_0x54d62b[_0x7c10('0x42')],{})[_0x7c10('0x1f')](respondWithResult(_0x2bcb40,0xc9))[_0x7c10('0x3c')](handleError(_0x2bcb40,null));};exports[_0x7c10('0x1e')]=function(_0x498272,_0x20c24c){if(_0x498272[_0x7c10('0x42')]['id']){delete _0x498272[_0x7c10('0x42')]['id'];}return db[_0x7c10('0x26')][_0x7c10('0x40')]({'where':{'id':_0x498272[_0x7c10('0x3d')]['id']}})[_0x7c10('0x1f')](handleEntityNotFound(_0x20c24c,null))[_0x7c10('0x1f')](saveUpdates(_0x498272[_0x7c10('0x42')],null))[_0x7c10('0x1f')](respondWithResult(_0x20c24c,null))['catch'](handleError(_0x20c24c,null));};exports[_0x7c10('0x43')]=function(_0x23f351,_0x358054,_0x362a7c){var _0x199694=require('../../components/encryptor');var _0x10f972=![];var _0x432049={};if(_0x23f351[_0x7c10('0x2c')][_0x7c10('0x37')]&&_0x23f351['query'][_0x7c10('0x37')]===_0x7c10('0x44')){_0x432049[_0x7c10('0x44')]=_0x23f351[_0x7c10('0x3d')]['id'];}else{_0x432049['id']=_0x23f351['params']['id'];}return db[_0x7c10('0x26')]['find']({'where':_0x432049,'attributes':['id','savePath',_0x7c10('0x45')],'raw':!![]})['then'](handleEntityNotFound(_0x358054,null))[_0x7c10('0x1f')](function(_0x4005ff){if(_0x4005ff){var _0x523ab9=_0x4005ff[_0x7c10('0x46')];var _0x3d8be0=util['format'](_0x7c10('0x47'),_0x523ab9);if(fs['existsSync'](_0x3d8be0)){_0x10f972=!![];return _0x199694[_0x7c10('0x48')](_0x3d8be0,_0x523ab9,config[_0x7c10('0x49')][_0x7c10('0x4a')])[_0x7c10('0x1f')](function(){return _0x4005ff;});}return _0x4005ff;}})['then'](function(_0x5585fa){if(_0x5585fa){var _0x257191=_0x5585fa['savePath'];if(!fs[_0x7c10('0x4b')](_0x257191)){throw new db[(_0x7c10('0x4c'))][(_0x7c10('0x4d'))](_0x7c10('0x4e'));}if(_0x5585fa[_0x7c10('0x45')]){return _0x358054[_0x7c10('0x43')](_0x257191,_0x5585fa[_0x7c10('0x45')]+path['extname'](_0x257191),function(){if(_0x10f972){fs[_0x7c10('0x4f')](_0x257191);}});}else{return _0x358054['download'](_0x257191,function(_0x1b9162){if(_0x10f972){fs[_0x7c10('0x4f')](_0x257191);}});}}})['catch'](function(_0x23e654){if(_0x23e654[_0x7c10('0x50')]===_0x7c10('0x4e')){_0x358054[_0x7c10('0x13')](0x194)[_0x7c10('0x24')](_0x7c10('0x51'));}else{return handleError(_0x358054,null);}});};exports['destroy']=function(_0x466b14,_0x55b198){return db['SquareRecording'][_0x7c10('0x40')]({'where':{'id':_0x466b14['params']['id']}})[_0x7c10('0x1f')](function(_0x3a6c37){if(_['isNil'](_0x3a6c37)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a6c37;})[_0x7c10('0x1f')](function(_0x54576f){var _0x11235b=_0x54576f[_0x7c10('0x46')];logger[_0x7c10('0x52')]('cancellazione\x20fisica\x20documento\x20%s',_0x11235b);if(!_[_0x7c10('0x53')](_0x54576f[_0x7c10('0x46')])&&fs[_0x7c10('0x4b')](_0x11235b)){logger[_0x7c10('0x52')](_0x7c10('0x54')+_0x11235b+_0x7c10('0x55'));fs[_0x7c10('0x56')](_0x11235b);}_0x11235b=_0x11235b+_0x7c10('0x57');if(!_[_0x7c10('0x53')](_0x54576f[_0x7c10('0x46')])&&fs[_0x7c10('0x4b')](_0x11235b)){logger[_0x7c10('0x52')](_0x7c10('0x54')+_0x11235b+_0x7c10('0x55'));fs['unlinkSync'](_0x11235b);}return _0x54576f;})[_0x7c10('0x1f')](function(_0x9f11c0){if(!_0x9f11c0)throw new InternalError();return _0x9f11c0['destroy']();})[_0x7c10('0x1f')](function(){_0x55b198[_0x7c10('0x13')](0xcc)[_0x7c10('0x21')]();})[_0x7c10('0x3c')](handleError(_0x55b198,null));};
\ No newline at end of file
index 33206bc..9f2cf9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf03a=['api','moment','request-promise','path','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','util','../../config/logger'];(function(_0x5d8d16,_0x52365c){var _0x3e718a=function(_0x314370){while(--_0x314370){_0x5d8d16['push'](_0x5d8d16['shift']());}};_0x3e718a(++_0x52365c);}(_0xf03a,0x1a0));var _0xaf03=function(_0x27b418,_0x38457c){_0x27b418=_0x27b418-0x0;var _0x276bae=_0xf03a[_0x27b418];return _0x276bae;};'use strict';var _=require('lodash');var util=require(_0xaf03('0x0'));var logger=require(_0xaf03('0x1'))(_0xaf03('0x2'));var moment=require(_0xaf03('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf03('0x4'));var fs=require('fs');var path=require(_0xaf03('0x5'));var rimraf=require('rimraf');var config=require(_0xaf03('0x6'));var attributes=require(_0xaf03('0x7'));module[_0xaf03('0x8')]=function(_0x2e05f7,_0x58a29b){return _0x2e05f7[_0xaf03('0x9')]('SquareRecording',attributes,{'tableName':_0xaf03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97ce=['bluebird','path','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x97ce,0x151));var _0xe97c=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x97ce[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var logger=require(_0xe97c('0x2'))(_0xe97c('0x3'));var moment=require('moment');var BPromise=require(_0xe97c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe97c('0x5'));var rimraf=require('rimraf');var config=require(_0xe97c('0x6'));var attributes=require(_0xe97c('0x7'));module[_0xe97c('0x8')]=function(_0x447030,_0x29184f){return _0x447030[_0xe97c('0x9')]('SquareRecording',attributes,{'tableName':_0xe97c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a367db8..c4df1f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf48=['then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSquareRecording','body','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xf66d89,_0x580808){var _0x2ba363=function(_0x26ecfc){while(--_0x26ecfc){_0xf66d89['push'](_0xf66d89['shift']());}};_0x2ba363(++_0x580808);}(_0xdf48,0x75));var _0x8df4=function(_0x8fd758,_0x17b896){_0x8fd758=_0x8fd758-0x0;var _0x1b3487=_0xdf48[_0x8fd758];return _0x1b3487;};'use strict';var _=require(_0x8df4('0x0'));var util=require(_0x8df4('0x1'));var moment=require(_0x8df4('0x2'));var BPromise=require(_0x8df4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df4('0x4'));var db=require(_0x8df4('0x5'))['db'];var utils=require(_0x8df4('0x6'));var logger=require(_0x8df4('0x7'))(_0x8df4('0x8'));var config=require(_0x8df4('0x9'));var jayson=require(_0x8df4('0xa'));var client=jayson[_0x8df4('0xb')][_0x8df4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x331ba3,_0x27fa9b,_0xbf7f8c){return new BPromise(function(_0xc8b2ff,_0x3152c7){return client['request'](_0x331ba3,_0xbf7f8c)[_0x8df4('0xd')](function(_0x4c6edf){logger[_0x8df4('0xe')](_0x8df4('0xf'),_0x27fa9b,'request\x20sent');logger[_0x8df4('0x10')](_0x8df4('0x11'),_0x27fa9b,_0x8df4('0x12'),JSON['stringify'](_0x4c6edf));if(_0x4c6edf[_0x8df4('0x13')]){if(_0x4c6edf[_0x8df4('0x13')][_0x8df4('0x14')]===0x1f4){logger['error'](_0x8df4('0xf'),_0x27fa9b,_0x4c6edf[_0x8df4('0x13')][_0x8df4('0x15')]);return _0x3152c7(_0x4c6edf['error'][_0x8df4('0x15')]);}logger[_0x8df4('0x13')](_0x8df4('0xf'),_0x27fa9b,_0x4c6edf['error'][_0x8df4('0x15')]);return _0xc8b2ff(_0x4c6edf['error'][_0x8df4('0x15')]);}else{logger[_0x8df4('0xe')](_0x8df4('0xf'),_0x27fa9b,_0x8df4('0x12'));_0xc8b2ff(_0x4c6edf['result']['message']);}})[_0x8df4('0x16')](function(_0x55acf3){logger[_0x8df4('0x13')](_0x8df4('0xf'),_0x27fa9b,_0x55acf3);_0x3152c7(_0x55acf3);});});}exports[_0x8df4('0x17')]=function(_0x1184a6){var _0x22fe7b=this;return new Promise(function(_0x1e2d79,_0x16c766){return db['SquareRecording']['create'](_0x1184a6[_0x8df4('0x18')],{'raw':_0x1184a6['options']?_0x1184a6['options'][_0x8df4('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5907df){logger['info'](_0x8df4('0x17'),_0x1184a6);logger['debug'](_0x8df4('0x17'),_0x1184a6,JSON['stringify'](_0x5907df));_0x1e2d79(_0x5907df);})[_0x8df4('0x16')](function(_0x360246){logger[_0x8df4('0x13')]('CreateSquareRecording',_0x360246['message'],_0x1184a6);_0x16c766(_0x22fe7b['error'](0x1f4,_0x360246[_0x8df4('0x15')]));});});};
\ No newline at end of file
+var _0xbe9e=['client','http','request','then','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','body','options','info','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xbe9e,0x13d));var _0xebe9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbe9e[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xebe9('0x0'));var moment=require(_0xebe9('0x1'));var BPromise=require('bluebird');var rs=require(_0xebe9('0x2'));var fs=require('fs');var Redis=require(_0xebe9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xebe9('0x4'));var logger=require(_0xebe9('0x5'))(_0xebe9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xebe9('0x7')][_0xebe9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46d973,_0x2b1ce7,_0x1e087b){return new BPromise(function(_0x272fa9,_0x82ef23){return client[_0xebe9('0x9')](_0x46d973,_0x1e087b)[_0xebe9('0xa')](function(_0x4dc80f){logger['info'](_0xebe9('0xb'),_0x2b1ce7,'request\x20sent');logger[_0xebe9('0xc')](_0xebe9('0xd'),_0x2b1ce7,'request\x20sent',JSON[_0xebe9('0xe')](_0x4dc80f));if(_0x4dc80f[_0xebe9('0xf')]){if(_0x4dc80f[_0xebe9('0xf')][_0xebe9('0x10')]===0x1f4){logger['error'](_0xebe9('0xb'),_0x2b1ce7,_0x4dc80f[_0xebe9('0xf')]['message']);return _0x82ef23(_0x4dc80f[_0xebe9('0xf')][_0xebe9('0x11')]);}logger[_0xebe9('0xf')](_0xebe9('0xb'),_0x2b1ce7,_0x4dc80f[_0xebe9('0xf')]['message']);return _0x272fa9(_0x4dc80f[_0xebe9('0xf')]['message']);}else{logger['info'](_0xebe9('0xb'),_0x2b1ce7,_0xebe9('0x12'));_0x272fa9(_0x4dc80f[_0xebe9('0x13')][_0xebe9('0x11')]);}})[_0xebe9('0x14')](function(_0x35717f){logger['error'](_0xebe9('0xb'),_0x2b1ce7,_0x35717f);_0x82ef23(_0x35717f);});});}exports[_0xebe9('0x15')]=function(_0x2e18e1){var _0x172d8b=this;return new Promise(function(_0xad37b0,_0x5332dd){return db[_0xebe9('0x16')][_0xebe9('0x17')](_0x2e18e1[_0xebe9('0x18')],{'raw':_0x2e18e1['options']?_0x2e18e1[_0xebe9('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xebe9('0xa')](function(_0x3a10cd){logger[_0xebe9('0x1a')](_0xebe9('0x15'),_0x2e18e1);logger['debug'](_0xebe9('0x15'),_0x2e18e1,JSON[_0xebe9('0xe')](_0x3a10cd));_0xad37b0(_0x3a10cd);})['catch'](function(_0x381828){logger['error'](_0xebe9('0x15'),_0x381828[_0xebe9('0x11')],_0x2e18e1);_0x5332dd(_0x172d8b['error'](0x1f4,_0x381828[_0xebe9('0x11')]));});});};
\ No newline at end of file
index 1144628..3a8d723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x4ea9d9,_0x3ff085){var _0x593442=function(_0x1fbfab){while(--_0x1fbfab){_0x4ea9d9['push'](_0x4ea9d9['shift']());}};_0x593442(++_0x3ff085);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
+var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1fac90,_0x1441df){var _0x3c13ab=function(_0x56ade1){while(--_0x56ade1){_0x1fac90['push'](_0x1fac90['shift']());}};_0x3c13ab(++_0x1441df);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
index 9333398..7149817 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf3a=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xbf3a,0x193));var _0xabf3=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0xbf3a[_0x2defb5];return _0x229c53;};'use strict';var Sequelize=require(_0xabf3('0x0'));module['exports']={'network':{'type':Sequelize[_0xabf3('0x1')]},'network_script':{'type':Sequelize[_0xabf3('0x1')]},'request':{'type':Sequelize[_0xabf3('0x1')]},'channel':{'type':Sequelize[_0xabf3('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xabf3('0x1')]},'uniqueid':{'type':Sequelize[_0xabf3('0x1')]},'version':{'type':Sequelize[_0xabf3('0x1')]},'callerid':{'type':Sequelize[_0xabf3('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xabf3('0x1')]},'callingani2':{'type':Sequelize[_0xabf3('0x1')]},'callington':{'type':Sequelize[_0xabf3('0x1')]},'callingtns':{'type':Sequelize[_0xabf3('0x1')]},'dnid':{'type':Sequelize[_0xabf3('0x1')]},'rdnis':{'type':Sequelize[_0xabf3('0x1')]},'context':{'type':Sequelize[_0xabf3('0x1')]},'extension':{'type':Sequelize[_0xabf3('0x1')]},'priority':{'type':Sequelize[_0xabf3('0x1')]},'enhanced':{'type':Sequelize[_0xabf3('0x1')]},'accountcode':{'type':Sequelize[_0xabf3('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xabf3('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xabf3('0x2')]},'bot':{'type':Sequelize[_0xabf3('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7d21=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x7d21,0x188));var _0x17d2=function(_0x6da8a9,_0x2f2989){_0x6da8a9=_0x6da8a9-0x0;var _0x275eb1=_0x7d21[_0x6da8a9];return _0x275eb1;};'use strict';var Sequelize=require(_0x17d2('0x0'));module['exports']={'network':{'type':Sequelize[_0x17d2('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x17d2('0x1')]},'channel':{'type':Sequelize[_0x17d2('0x1')]},'language':{'type':Sequelize[_0x17d2('0x1')]},'type':{'type':Sequelize[_0x17d2('0x1')]},'uniqueid':{'type':Sequelize[_0x17d2('0x1')]},'version':{'type':Sequelize[_0x17d2('0x1')]},'callerid':{'type':Sequelize[_0x17d2('0x1')]},'calleridname':{'type':Sequelize[_0x17d2('0x1')]},'callingpres':{'type':Sequelize[_0x17d2('0x1')]},'callingani2':{'type':Sequelize[_0x17d2('0x1')]},'callington':{'type':Sequelize[_0x17d2('0x1')]},'callingtns':{'type':Sequelize[_0x17d2('0x1')]},'dnid':{'type':Sequelize[_0x17d2('0x1')]},'rdnis':{'type':Sequelize[_0x17d2('0x1')]},'context':{'type':Sequelize[_0x17d2('0x1')]},'extension':{'type':Sequelize[_0x17d2('0x1')]},'priority':{'type':Sequelize[_0x17d2('0x1')]},'enhanced':{'type':Sequelize[_0x17d2('0x1')]},'accountcode':{'type':Sequelize[_0x17d2('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x17d2('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x17d2('0x2')]},'bot':{'type':Sequelize[_0x17d2('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 7263875..9d94ff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a37=['SquareReport','key','map','model','attributes','fields','query','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','include','findAll','catch','show','params','keys','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index'];(function(_0x8199e7,_0xded57c){var _0x24db3a=function(_0x38133c){while(--_0x38133c){_0x8199e7['push'](_0x8199e7['shift']());}};_0x24db3a(++_0xded57c);}(_0x2a37,0x150));var _0x72a3=function(_0x19225b,_0x5ac812){_0x19225b=_0x19225b-0x0;var _0x493bf3=_0x2a37[_0x19225b];return _0x493bf3;};'use strict';var emlformat=require(_0x72a3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x72a3('0x1'));var rp=require(_0x72a3('0x2'));var moment=require(_0x72a3('0x3'));var BPromise=require(_0x72a3('0x4'));var Mustache=require(_0x72a3('0x5'));var util=require(_0x72a3('0x6'));var path=require('path');var sox=require(_0x72a3('0x7'));var csv=require('to-csv');var ejs=require(_0x72a3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72a3('0x9'));var squel=require(_0x72a3('0xa'));var crypto=require(_0x72a3('0xb'));var jsforce=require(_0x72a3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x72a3('0xd'));var Papa=require(_0x72a3('0xe'));var Redis=require(_0x72a3('0xf'));var authService=require(_0x72a3('0x10'));var qs=require(_0x72a3('0x11'));var as=require(_0x72a3('0x12'));var hardwareService=require(_0x72a3('0x13'));var logger=require(_0x72a3('0x14'))(_0x72a3('0x15'));var utils=require(_0x72a3('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x72a3('0x17'))['db'];function respondWithStatusCode(_0x4e0c7b,_0x3e9b06){_0x3e9b06=_0x3e9b06||0xcc;return function(_0x39e8b4){if(_0x39e8b4){return _0x4e0c7b[_0x72a3('0x18')](_0x3e9b06);}return _0x4e0c7b[_0x72a3('0x19')](_0x3e9b06)['end']();};}function respondWithResult(_0xedf3f6,_0xee1adb){_0xee1adb=_0xee1adb||0xc8;return function(_0x87c5a3){if(_0x87c5a3){return _0xedf3f6[_0x72a3('0x19')](_0xee1adb)[_0x72a3('0x1a')](_0x87c5a3);}};}function respondWithFilteredResult(_0x503d23,_0xb9c4a1){return function(_0x31af1d){if(_0x31af1d){var _0x97bbf=typeof _0xb9c4a1[_0x72a3('0x1b')]===_0x72a3('0x1c')&&typeof _0xb9c4a1['limit']===_0x72a3('0x1c');var _0x4a9611=_0x31af1d[_0x72a3('0x1d')];var _0x2fbe45=_0x97bbf?0x0:_0xb9c4a1[_0x72a3('0x1b')];var _0x4a7bb5=_0x97bbf?_0x31af1d[_0x72a3('0x1d')]:_0xb9c4a1[_0x72a3('0x1b')]+_0xb9c4a1[_0x72a3('0x1e')];var _0x148b77;if(_0x4a7bb5>=_0x4a9611){_0x4a7bb5=_0x4a9611;_0x148b77=0xc8;}else{_0x148b77=0xce;}_0x503d23[_0x72a3('0x19')](_0x148b77);return _0x503d23[_0x72a3('0x1f')](_0x72a3('0x20'),_0x2fbe45+'-'+_0x4a7bb5+'/'+_0x4a9611)[_0x72a3('0x1a')](_0x31af1d);}return null;};}function patchUpdates(_0x30f496){return function(_0x1fd059){try{jsonpatch[_0x72a3('0x21')](_0x1fd059,_0x30f496,!![]);}catch(_0x1fd6c0){return BPromise[_0x72a3('0x22')](_0x1fd6c0);}return _0x1fd059[_0x72a3('0x23')]();};}function saveUpdates(_0x564527,_0x180e4e){return function(_0x564855){if(_0x564855){return _0x564855[_0x72a3('0x24')](_0x564527)['then'](function(_0x3e427f){return _0x3e427f;});}return null;};}function removeEntity(_0x2c7e27,_0x3ca43d){return function(_0x394d21){if(_0x394d21){return _0x394d21['destroy']()[_0x72a3('0x25')](function(){_0x2c7e27[_0x72a3('0x19')](0xcc)[_0x72a3('0x26')]();});}};}function handleEntityNotFound(_0x36a9bb,_0x5329b0){return function(_0x46d4fc){if(!_0x46d4fc){_0x36a9bb['sendStatus'](0x194);}return _0x46d4fc;};}function handleError(_0x243d32,_0x427a52){_0x427a52=_0x427a52||0x1f4;return function(_0x5db9a8){logger[_0x72a3('0x27')](_0x5db9a8[_0x72a3('0x28')]);if(_0x5db9a8[_0x72a3('0x29')]){delete _0x5db9a8[_0x72a3('0x29')];}_0x243d32['status'](_0x427a52)[_0x72a3('0x2a')](_0x5db9a8);};}exports[_0x72a3('0x2b')]=function(_0x514215,_0x4dafb3){var _0x153a8c={},_0x562ef6={},_0x16f36c={'count':0x0,'rows':[]};var _0x31e6bd=_['map'](db[_0x72a3('0x2c')]['rawAttributes'],function(_0x1d8647){return{'name':_0x1d8647['fieldName'],'type':_0x1d8647['type'][_0x72a3('0x2d')]};});_0x562ef6['model']=_[_0x72a3('0x2e')](_0x31e6bd,_0x72a3('0x29'));_0x562ef6['query']=_['keys'](_0x514215['query']);_0x562ef6['filters']=_['intersection'](_0x562ef6[_0x72a3('0x2f')],_0x562ef6['query']);_0x153a8c[_0x72a3('0x30')]=_['intersection'](_0x562ef6[_0x72a3('0x2f')],qs[_0x72a3('0x31')](_0x514215[_0x72a3('0x32')][_0x72a3('0x31')]));_0x153a8c['attributes']=_0x153a8c[_0x72a3('0x30')][_0x72a3('0x33')]?_0x153a8c[_0x72a3('0x30')]:_0x562ef6['model'];if(!_0x514215[_0x72a3('0x32')]['hasOwnProperty'](_0x72a3('0x34'))){_0x153a8c[_0x72a3('0x1e')]=qs['limit'](_0x514215[_0x72a3('0x32')][_0x72a3('0x1e')]);_0x153a8c[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x514215[_0x72a3('0x32')][_0x72a3('0x1b')]);}_0x153a8c[_0x72a3('0x35')]=qs[_0x72a3('0x36')](_0x514215[_0x72a3('0x32')][_0x72a3('0x36')]);_0x153a8c[_0x72a3('0x37')]=qs[_0x72a3('0x38')](_[_0x72a3('0x39')](_0x514215[_0x72a3('0x32')],_0x562ef6[_0x72a3('0x38')]),_0x31e6bd);if(_0x514215['query'][_0x72a3('0x3a')]){_0x153a8c[_0x72a3('0x37')]=_[_0x72a3('0x3b')](_0x153a8c[_0x72a3('0x37')],{'$or':_['map'](_0x31e6bd,function(_0x34bde6){if(_0x34bde6[_0x72a3('0x3c')]!=='VIRTUAL'){var _0x1b9006={};_0x1b9006[_0x34bde6[_0x72a3('0x29')]]={'$like':'%'+_0x514215[_0x72a3('0x32')]['filter']+'%'};return _0x1b9006;}})});}_0x153a8c=_[_0x72a3('0x3b')]({},_0x153a8c,_0x514215[_0x72a3('0x3d')]);var _0x3c3414={'where':_0x153a8c['where']};return db[_0x72a3('0x2c')][_0x72a3('0x1d')](_0x3c3414)['then'](function(_0xc5e053){_0x16f36c[_0x72a3('0x1d')]=_0xc5e053;if(_0x514215[_0x72a3('0x32')]['includeAll']){_0x153a8c[_0x72a3('0x3e')]=[{'all':!![]}];}return db[_0x72a3('0x2c')][_0x72a3('0x3f')](_0x153a8c);})[_0x72a3('0x25')](function(_0x15bd6b){_0x16f36c['rows']=_0x15bd6b;return _0x16f36c;})['then'](respondWithFilteredResult(_0x4dafb3,_0x153a8c))[_0x72a3('0x40')](handleError(_0x4dafb3,null));};exports[_0x72a3('0x41')]=function(_0x559ca2,_0x5df190){var _0x44ef78={'raw':!![],'where':{'id':_0x559ca2[_0x72a3('0x42')]['id']}},_0x2761cc={};_0x2761cc[_0x72a3('0x2f')]=_[_0x72a3('0x43')](db[_0x72a3('0x2c')][_0x72a3('0x44')]);_0x2761cc[_0x72a3('0x32')]=_[_0x72a3('0x43')](_0x559ca2[_0x72a3('0x32')]);_0x2761cc[_0x72a3('0x38')]=_[_0x72a3('0x45')](_0x2761cc[_0x72a3('0x2f')],_0x2761cc['query']);_0x44ef78[_0x72a3('0x30')]=_[_0x72a3('0x45')](_0x2761cc[_0x72a3('0x2f')],qs[_0x72a3('0x31')](_0x559ca2[_0x72a3('0x32')]['fields']));_0x44ef78['attributes']=_0x44ef78['attributes'][_0x72a3('0x33')]?_0x44ef78[_0x72a3('0x30')]:_0x2761cc[_0x72a3('0x2f')];if(_0x559ca2[_0x72a3('0x32')][_0x72a3('0x46')]){_0x44ef78[_0x72a3('0x3e')]=[{'all':!![]}];}_0x44ef78=_['merge']({},_0x44ef78,_0x559ca2[_0x72a3('0x3d')]);return db[_0x72a3('0x2c')][_0x72a3('0x47')](_0x44ef78)[_0x72a3('0x25')](handleEntityNotFound(_0x5df190,null))[_0x72a3('0x25')](respondWithResult(_0x5df190,null))['catch'](handleError(_0x5df190,null));};exports[_0x72a3('0x48')]=function(_0x194084,_0x30c6dc){return db[_0x72a3('0x2c')][_0x72a3('0x48')](_0x194084[_0x72a3('0x49')],{})[_0x72a3('0x25')](respondWithResult(_0x30c6dc,0xc9))[_0x72a3('0x40')](handleError(_0x30c6dc,null));};exports['update']=function(_0x291f74,_0x579ab9){if(_0x291f74[_0x72a3('0x49')]['id']){delete _0x291f74[_0x72a3('0x49')]['id'];}return db[_0x72a3('0x2c')][_0x72a3('0x47')]({'where':{'id':_0x291f74[_0x72a3('0x42')]['id']}})[_0x72a3('0x25')](handleEntityNotFound(_0x579ab9,null))[_0x72a3('0x25')](saveUpdates(_0x291f74[_0x72a3('0x49')],null))[_0x72a3('0x25')](respondWithResult(_0x579ab9,null))['catch'](handleError(_0x579ab9,null));};exports[_0x72a3('0x4a')]=function(_0x4d938d,_0xc752ec){return db[_0x72a3('0x2c')][_0x72a3('0x47')]({'where':{'id':_0x4d938d[_0x72a3('0x42')]['id']}})[_0x72a3('0x25')](handleEntityNotFound(_0xc752ec,null))[_0x72a3('0x25')](removeEntity(_0xc752ec,null))[_0x72a3('0x40')](handleError(_0xc752ec,null));};exports[_0x72a3('0x4b')]=function(_0x362a7d,_0x1760e1){return db[_0x72a3('0x2c')][_0x72a3('0x4b')]()['then'](respondWithResult(_0x1760e1,null))[_0x72a3('0x40')](handleError(_0x1760e1,null));};
\ No newline at end of file
+var _0x8d52=['filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','SquareReport','intersection','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys'];(function(_0x5a422c,_0x373f20){var _0x1f63d1=function(_0x1620dd){while(--_0x1620dd){_0x5a422c['push'](_0x5a422c['shift']());}};_0x1f63d1(++_0x373f20);}(_0x8d52,0xf1));var _0x28d5=function(_0x154fe5,_0x1229c6){_0x154fe5=_0x154fe5-0x0;var _0x13478a=_0x8d52[_0x154fe5];return _0x13478a;};'use strict';var emlformat=require(_0x28d5('0x0'));var rimraf=require(_0x28d5('0x1'));var zipdir=require(_0x28d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28d5('0x3'));var moment=require(_0x28d5('0x4'));var BPromise=require(_0x28d5('0x5'));var Mustache=require(_0x28d5('0x6'));var util=require('util');var path=require(_0x28d5('0x7'));var sox=require(_0x28d5('0x8'));var csv=require(_0x28d5('0x9'));var ejs=require(_0x28d5('0xa'));var fs=require('fs');var fs_extra=require(_0x28d5('0xb'));var _=require(_0x28d5('0xc'));var squel=require(_0x28d5('0xd'));var crypto=require(_0x28d5('0xe'));var jsforce=require(_0x28d5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x28d5('0x9'));var querystring=require(_0x28d5('0x10'));var Papa=require('papaparse');var Redis=require(_0x28d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x28d5('0x12'));var as=require(_0x28d5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28d5('0x14'))(_0x28d5('0x15'));var utils=require(_0x28d5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x28d5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x592aa6,_0x51942f){_0x51942f=_0x51942f||0xcc;return function(_0xc1dfd0){if(_0xc1dfd0){return _0x592aa6[_0x28d5('0x18')](_0x51942f);}return _0x592aa6[_0x28d5('0x19')](_0x51942f)['end']();};}function respondWithResult(_0x550ec3,_0x2b8706){_0x2b8706=_0x2b8706||0xc8;return function(_0x4c27b8){if(_0x4c27b8){return _0x550ec3[_0x28d5('0x19')](_0x2b8706)['json'](_0x4c27b8);}};}function respondWithFilteredResult(_0x199183,_0x25b6ce){return function(_0x12f8e6){if(_0x12f8e6){var _0xef7098=typeof _0x25b6ce[_0x28d5('0x1a')]===_0x28d5('0x1b')&&typeof _0x25b6ce[_0x28d5('0x1c')]===_0x28d5('0x1b');var _0x51916a=_0x12f8e6[_0x28d5('0x1d')];var _0x3f55c4=_0xef7098?0x0:_0x25b6ce[_0x28d5('0x1a')];var _0x1156f3=_0xef7098?_0x12f8e6[_0x28d5('0x1d')]:_0x25b6ce[_0x28d5('0x1a')]+_0x25b6ce[_0x28d5('0x1c')];var _0x1e0a2b;if(_0x1156f3>=_0x51916a){_0x1156f3=_0x51916a;_0x1e0a2b=0xc8;}else{_0x1e0a2b=0xce;}_0x199183['status'](_0x1e0a2b);return _0x199183[_0x28d5('0x1e')](_0x28d5('0x1f'),_0x3f55c4+'-'+_0x1156f3+'/'+_0x51916a)[_0x28d5('0x20')](_0x12f8e6);}return null;};}function patchUpdates(_0x1a101f){return function(_0x5eb986){try{jsonpatch['apply'](_0x5eb986,_0x1a101f,!![]);}catch(_0x59484b){return BPromise[_0x28d5('0x21')](_0x59484b);}return _0x5eb986[_0x28d5('0x22')]();};}function saveUpdates(_0x1da42d,_0x1d08a3){return function(_0x2811f1){if(_0x2811f1){return _0x2811f1[_0x28d5('0x23')](_0x1da42d)[_0x28d5('0x24')](function(_0x5b4b13){return _0x5b4b13;});}return null;};}function removeEntity(_0x55ed97,_0x926c24){return function(_0x317c40){if(_0x317c40){return _0x317c40[_0x28d5('0x25')]()[_0x28d5('0x24')](function(){_0x55ed97[_0x28d5('0x19')](0xcc)[_0x28d5('0x26')]();});}};}function handleEntityNotFound(_0x5853bd,_0x3bffd6){return function(_0x38a96f){if(!_0x38a96f){_0x5853bd[_0x28d5('0x18')](0x194);}return _0x38a96f;};}function handleError(_0x460b5c,_0x54351d){_0x54351d=_0x54351d||0x1f4;return function(_0x5c396e){logger[_0x28d5('0x27')](_0x5c396e[_0x28d5('0x28')]);if(_0x5c396e[_0x28d5('0x29')]){delete _0x5c396e[_0x28d5('0x29')];}_0x460b5c['status'](_0x54351d)[_0x28d5('0x2a')](_0x5c396e);};}exports[_0x28d5('0x2b')]=function(_0x27c98f,_0x3ef742){var _0x2890e8={},_0x227bdf={},_0x1eb729={'count':0x0,'rows':[]};var _0x1414eb=_['map'](db['SquareReport'][_0x28d5('0x2c')],function(_0x20ed07){return{'name':_0x20ed07[_0x28d5('0x2d')],'type':_0x20ed07[_0x28d5('0x2e')]['key']};});_0x227bdf[_0x28d5('0x2f')]=_[_0x28d5('0x30')](_0x1414eb,_0x28d5('0x29'));_0x227bdf[_0x28d5('0x31')]=_[_0x28d5('0x32')](_0x27c98f['query']);_0x227bdf[_0x28d5('0x33')]=_['intersection'](_0x227bdf[_0x28d5('0x2f')],_0x227bdf['query']);_0x2890e8[_0x28d5('0x34')]=_['intersection'](_0x227bdf[_0x28d5('0x2f')],qs[_0x28d5('0x35')](_0x27c98f[_0x28d5('0x31')][_0x28d5('0x35')]));_0x2890e8[_0x28d5('0x34')]=_0x2890e8[_0x28d5('0x34')][_0x28d5('0x36')]?_0x2890e8['attributes']:_0x227bdf[_0x28d5('0x2f')];if(!_0x27c98f[_0x28d5('0x31')]['hasOwnProperty'](_0x28d5('0x37'))){_0x2890e8[_0x28d5('0x1c')]=qs[_0x28d5('0x1c')](_0x27c98f[_0x28d5('0x31')][_0x28d5('0x1c')]);_0x2890e8[_0x28d5('0x1a')]=qs['offset'](_0x27c98f[_0x28d5('0x31')][_0x28d5('0x1a')]);}_0x2890e8[_0x28d5('0x38')]=qs[_0x28d5('0x39')](_0x27c98f['query'][_0x28d5('0x39')]);_0x2890e8[_0x28d5('0x3a')]=qs[_0x28d5('0x33')](_['pick'](_0x27c98f[_0x28d5('0x31')],_0x227bdf[_0x28d5('0x33')]),_0x1414eb);if(_0x27c98f[_0x28d5('0x31')][_0x28d5('0x3b')]){_0x2890e8[_0x28d5('0x3a')]=_[_0x28d5('0x3c')](_0x2890e8['where'],{'$or':_[_0x28d5('0x30')](_0x1414eb,function(_0x583ec6){if(_0x583ec6['type']!==_0x28d5('0x3d')){var _0x567269={};_0x567269[_0x583ec6[_0x28d5('0x29')]]={'$like':'%'+_0x27c98f[_0x28d5('0x31')][_0x28d5('0x3b')]+'%'};return _0x567269;}})});}_0x2890e8=_[_0x28d5('0x3c')]({},_0x2890e8,_0x27c98f[_0x28d5('0x3e')]);var _0x5d4f9f={'where':_0x2890e8['where']};return db['SquareReport']['count'](_0x5d4f9f)[_0x28d5('0x24')](function(_0x1f1725){_0x1eb729[_0x28d5('0x1d')]=_0x1f1725;if(_0x27c98f['query']['includeAll']){_0x2890e8[_0x28d5('0x3f')]=[{'all':!![]}];}return db['SquareReport'][_0x28d5('0x40')](_0x2890e8);})['then'](function(_0x541ec8){_0x1eb729['rows']=_0x541ec8;return _0x1eb729;})[_0x28d5('0x24')](respondWithFilteredResult(_0x3ef742,_0x2890e8))[_0x28d5('0x41')](handleError(_0x3ef742,null));};exports['show']=function(_0x21101f,_0x144f47){var _0x63df8d={'raw':!![],'where':{'id':_0x21101f['params']['id']}},_0x3f4e95={};_0x3f4e95[_0x28d5('0x2f')]=_[_0x28d5('0x32')](db[_0x28d5('0x42')][_0x28d5('0x2c')]);_0x3f4e95['query']=_[_0x28d5('0x32')](_0x21101f[_0x28d5('0x31')]);_0x3f4e95['filters']=_[_0x28d5('0x43')](_0x3f4e95[_0x28d5('0x2f')],_0x3f4e95[_0x28d5('0x31')]);_0x63df8d[_0x28d5('0x34')]=_[_0x28d5('0x43')](_0x3f4e95[_0x28d5('0x2f')],qs[_0x28d5('0x35')](_0x21101f[_0x28d5('0x31')]['fields']));_0x63df8d[_0x28d5('0x34')]=_0x63df8d[_0x28d5('0x34')][_0x28d5('0x36')]?_0x63df8d['attributes']:_0x3f4e95[_0x28d5('0x2f')];if(_0x21101f[_0x28d5('0x31')]['includeAll']){_0x63df8d[_0x28d5('0x3f')]=[{'all':!![]}];}_0x63df8d=_['merge']({},_0x63df8d,_0x21101f[_0x28d5('0x3e')]);return db[_0x28d5('0x42')][_0x28d5('0x44')](_0x63df8d)[_0x28d5('0x24')](handleEntityNotFound(_0x144f47,null))[_0x28d5('0x24')](respondWithResult(_0x144f47,null))[_0x28d5('0x41')](handleError(_0x144f47,null));};exports[_0x28d5('0x45')]=function(_0x3a1d68,_0x17a7bb){return db['SquareReport'][_0x28d5('0x45')](_0x3a1d68[_0x28d5('0x46')],{})['then'](respondWithResult(_0x17a7bb,0xc9))[_0x28d5('0x41')](handleError(_0x17a7bb,null));};exports[_0x28d5('0x23')]=function(_0x19b0ab,_0x1491d1){if(_0x19b0ab[_0x28d5('0x46')]['id']){delete _0x19b0ab[_0x28d5('0x46')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x19b0ab[_0x28d5('0x47')]['id']}})['then'](handleEntityNotFound(_0x1491d1,null))[_0x28d5('0x24')](saveUpdates(_0x19b0ab['body'],null))[_0x28d5('0x24')](respondWithResult(_0x1491d1,null))['catch'](handleError(_0x1491d1,null));};exports[_0x28d5('0x25')]=function(_0x2b3edb,_0x358caf){return db[_0x28d5('0x42')][_0x28d5('0x44')]({'where':{'id':_0x2b3edb[_0x28d5('0x47')]['id']}})[_0x28d5('0x24')](handleEntityNotFound(_0x358caf,null))[_0x28d5('0x24')](removeEntity(_0x358caf,null))[_0x28d5('0x41')](handleError(_0x358caf,null));};exports[_0x28d5('0x48')]=function(_0x4eb22f,_0x102c8c){return db[_0x28d5('0x42')]['describe']()[_0x28d5('0x24')](respondWithResult(_0x102c8c,null))[_0x28d5('0x41')](handleError(_0x102c8c,null));};
\ No newline at end of file
index fe96968..e3dc4ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4adb=['uid_pname','leaveAt','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square'];(function(_0x5d03fe,_0x2c4931){var _0x2e97f5=function(_0x21ac15){while(--_0x21ac15){_0x5d03fe['push'](_0x5d03fe['shift']());}};_0x2e97f5(++_0x2c4931);}(_0x4adb,0x188));var _0xb4ad=function(_0x49eeb3,_0x31dcb6){_0x49eeb3=_0x49eeb3-0x0;var _0x4de783=_0x4adb[_0x49eeb3];return _0x4de783;};'use strict';var _=require(_0xb4ad('0x0'));var util=require('util');var logger=require(_0xb4ad('0x1'))(_0xb4ad('0x2'));var moment=require(_0xb4ad('0x3'));var BPromise=require(_0xb4ad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb4ad('0x5'));var config=require(_0xb4ad('0x6'));var attributes=require(_0xb4ad('0x7'));module['exports']=function(_0x14a092,_0x1b42e5){return _0x14a092[_0xb4ad('0x8')](_0xb4ad('0x9'),attributes,{'tableName':_0xb4ad('0xa'),'paranoid':![],'indexes':[{'name':_0xb4ad('0xb'),'fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0xb4ad('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf2a=['rimraf','../../config/environment','./squareReport.attributes','define','uid_pname','uniqueid','leaveAt','lodash','../../config/logger','moment','path'];(function(_0x31fa62,_0x447552){var _0x2444b6=function(_0x35db94){while(--_0x35db94){_0x31fa62['push'](_0x31fa62['shift']());}};_0x2444b6(++_0x447552);}(_0xbf2a,0x6a));var _0xabf2=function(_0x54e856,_0x313d5c){_0x54e856=_0x54e856-0x0;var _0x124873=_0xbf2a[_0x54e856];return _0x124873;};'use strict';var _=require(_0xabf2('0x0'));var util=require('util');var logger=require(_0xabf2('0x1'))('api');var moment=require(_0xabf2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xabf2('0x3'));var rimraf=require(_0xabf2('0x4'));var config=require(_0xabf2('0x5'));var attributes=require(_0xabf2('0x6'));module['exports']=function(_0x2135fa,_0x3fc5f4){return _0x2135fa[_0xabf2('0x7')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xabf2('0x8'),'fields':[_0xabf2('0x9'),'project_name']},{'name':_0xabf2('0xa'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index e9f65d6..a7937e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfc1=['CreateSquareReport','SquareReport','where','attributes','limit','UpdateSquareReport','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','create','body','options','raw'];(function(_0x190276,_0x582f8f){var _0x1a5367=function(_0x1eb8f4){while(--_0x1eb8f4){_0x190276['push'](_0x190276['shift']());}};_0x1a5367(++_0x582f8f);}(_0xbfc1,0x1c0));var _0x1bfc=function(_0x3acfd2,_0x2cefe3){_0x3acfd2=_0x3acfd2-0x0;var _0x331dea=_0xbfc1[_0x3acfd2];return _0x331dea;};'use strict';var _=require('lodash');var util=require(_0x1bfc('0x0'));var moment=require(_0x1bfc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bfc('0x2'));var db=require(_0x1bfc('0x3'))['db'];var utils=require(_0x1bfc('0x4'));var logger=require(_0x1bfc('0x5'))(_0x1bfc('0x6'));var config=require(_0x1bfc('0x7'));var jayson=require(_0x1bfc('0x8'));var client=jayson[_0x1bfc('0x9')][_0x1bfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c58aa,_0x169e60,_0x5e3452){return new BPromise(function(_0x2e71a8,_0x888d28){return client[_0x1bfc('0xb')](_0x2c58aa,_0x5e3452)[_0x1bfc('0xc')](function(_0x29bf8c){logger[_0x1bfc('0xd')](_0x1bfc('0xe'),_0x169e60,'request\x20sent');logger[_0x1bfc('0xf')](_0x1bfc('0x10'),_0x169e60,_0x1bfc('0x11'),JSON[_0x1bfc('0x12')](_0x29bf8c));if(_0x29bf8c[_0x1bfc('0x13')]){if(_0x29bf8c[_0x1bfc('0x13')][_0x1bfc('0x14')]===0x1f4){logger[_0x1bfc('0x13')](_0x1bfc('0xe'),_0x169e60,_0x29bf8c[_0x1bfc('0x13')][_0x1bfc('0x15')]);return _0x888d28(_0x29bf8c[_0x1bfc('0x13')][_0x1bfc('0x15')]);}logger[_0x1bfc('0x13')]('SquareReport,\x20%s,\x20%s',_0x169e60,_0x29bf8c[_0x1bfc('0x13')][_0x1bfc('0x15')]);return _0x2e71a8(_0x29bf8c[_0x1bfc('0x13')][_0x1bfc('0x15')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x169e60,'request\x20sent');_0x2e71a8(_0x29bf8c[_0x1bfc('0x16')]['message']);}})[_0x1bfc('0x17')](function(_0x3777ca){logger[_0x1bfc('0x13')]('SquareReport,\x20%s,\x20%s',_0x169e60,_0x3777ca);_0x888d28(_0x3777ca);});});}exports['CreateSquareReport']=function(_0x4e3b7d){var _0x14a7cd=this;return new Promise(function(_0x6d38d3,_0x2a6a44){return db['SquareReport'][_0x1bfc('0x18')](_0x4e3b7d[_0x1bfc('0x19')],{'raw':_0x4e3b7d['options']?_0x4e3b7d[_0x1bfc('0x1a')][_0x1bfc('0x1b')]===undefined?!![]:![]:!![]})[_0x1bfc('0xc')](function(_0x1ac04e){logger[_0x1bfc('0xd')]('CreateSquareReport',_0x4e3b7d);logger[_0x1bfc('0xf')](_0x1bfc('0x1c'),_0x4e3b7d,JSON['stringify'](_0x1ac04e));_0x6d38d3(_0x1ac04e);})['catch'](function(_0xaf4e2){logger[_0x1bfc('0x13')](_0x1bfc('0x1c'),_0xaf4e2['message'],_0x4e3b7d);_0x2a6a44(_0x14a7cd['error'](0x1f4,_0xaf4e2['message']));});});};exports['UpdateSquareReport']=function(_0x32f2c1){var _0x227065=this;return new Promise(function(_0x4549e9,_0x1cec2d){return db[_0x1bfc('0x1d')]['update'](_0x32f2c1[_0x1bfc('0x19')],{'raw':_0x32f2c1[_0x1bfc('0x1a')]?_0x32f2c1[_0x1bfc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32f2c1[_0x1bfc('0x1a')]?_0x32f2c1['options'][_0x1bfc('0x1e')]||null:null,'attributes':_0x32f2c1[_0x1bfc('0x1a')]?_0x32f2c1[_0x1bfc('0x1a')][_0x1bfc('0x1f')]||null:null,'limit':_0x32f2c1['options']?_0x32f2c1[_0x1bfc('0x1a')][_0x1bfc('0x20')]||null:null})[_0x1bfc('0xc')](function(_0x397df1){logger[_0x1bfc('0xd')](_0x1bfc('0x21'),_0x32f2c1);logger[_0x1bfc('0xf')]('UpdateSquareReport',_0x32f2c1,JSON[_0x1bfc('0x12')](_0x397df1));_0x4549e9(_0x397df1);})['catch'](function(_0x219dcb){logger['error'](_0x1bfc('0x21'),_0x219dcb['message'],_0x32f2c1);_0x1cec2d(_0x227065[_0x1bfc('0x13')](0x1f4,_0x219dcb[_0x1bfc('0x15')]));});});};
\ No newline at end of file
+var _0x21ec=['request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','UpdateSquareReport','update','raw','where','attributes','limit','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x5af410,_0x4e9ee4){var _0x170c35=function(_0x57c0f6){while(--_0x57c0f6){_0x5af410['push'](_0x5af410['shift']());}};_0x170c35(++_0x4e9ee4);}(_0x21ec,0xf1));var _0xc21e=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x21ec[_0xc67528];return _0x38e26d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc21e('0x0'));var BPromise=require(_0xc21e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc21e('0x2'))['db'];var utils=require(_0xc21e('0x3'));var logger=require('../../config/logger')(_0xc21e('0x4'));var config=require('../../config/environment');var jayson=require(_0xc21e('0x5'));var client=jayson['client'][_0xc21e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x286ac7,_0x5733ba,_0x566f55){return new BPromise(function(_0x56d9fb,_0x5e13b1){return client[_0xc21e('0x7')](_0x286ac7,_0x566f55)[_0xc21e('0x8')](function(_0x27ec42){logger['info'](_0xc21e('0x9'),_0x5733ba,_0xc21e('0xa'));logger[_0xc21e('0xb')](_0xc21e('0xc'),_0x5733ba,_0xc21e('0xa'),JSON[_0xc21e('0xd')](_0x27ec42));if(_0x27ec42[_0xc21e('0xe')]){if(_0x27ec42['error'][_0xc21e('0xf')]===0x1f4){logger[_0xc21e('0xe')](_0xc21e('0x9'),_0x5733ba,_0x27ec42['error'][_0xc21e('0x10')]);return _0x5e13b1(_0x27ec42['error'][_0xc21e('0x10')]);}logger[_0xc21e('0xe')](_0xc21e('0x9'),_0x5733ba,_0x27ec42[_0xc21e('0xe')]['message']);return _0x56d9fb(_0x27ec42[_0xc21e('0xe')][_0xc21e('0x10')]);}else{logger[_0xc21e('0x11')](_0xc21e('0x9'),_0x5733ba,_0xc21e('0xa'));_0x56d9fb(_0x27ec42[_0xc21e('0x12')]['message']);}})[_0xc21e('0x13')](function(_0x56de56){logger[_0xc21e('0xe')](_0xc21e('0x9'),_0x5733ba,_0x56de56);_0x5e13b1(_0x56de56);});});}exports[_0xc21e('0x14')]=function(_0x315f10){var _0x1b9b46=this;return new Promise(function(_0x3f8d21,_0x2aacf2){return db[_0xc21e('0x15')][_0xc21e('0x16')](_0x315f10[_0xc21e('0x17')],{'raw':_0x315f10[_0xc21e('0x18')]?_0x315f10[_0xc21e('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc21e('0x8')](function(_0x53d699){logger[_0xc21e('0x11')](_0xc21e('0x14'),_0x315f10);logger[_0xc21e('0xb')]('CreateSquareReport',_0x315f10,JSON[_0xc21e('0xd')](_0x53d699));_0x3f8d21(_0x53d699);})[_0xc21e('0x13')](function(_0x1c80b0){logger[_0xc21e('0xe')](_0xc21e('0x14'),_0x1c80b0[_0xc21e('0x10')],_0x315f10);_0x2aacf2(_0x1b9b46[_0xc21e('0xe')](0x1f4,_0x1c80b0['message']));});});};exports[_0xc21e('0x19')]=function(_0x23caac){var _0x280cc1=this;return new Promise(function(_0xaa22e3,_0x1268fa){return db[_0xc21e('0x15')][_0xc21e('0x1a')](_0x23caac[_0xc21e('0x17')],{'raw':_0x23caac[_0xc21e('0x18')]?_0x23caac[_0xc21e('0x18')][_0xc21e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23caac[_0xc21e('0x18')]?_0x23caac['options'][_0xc21e('0x1c')]||null:null,'attributes':_0x23caac[_0xc21e('0x18')]?_0x23caac[_0xc21e('0x18')][_0xc21e('0x1d')]||null:null,'limit':_0x23caac[_0xc21e('0x18')]?_0x23caac[_0xc21e('0x18')][_0xc21e('0x1e')]||null:null})['then'](function(_0x2e235d){logger[_0xc21e('0x11')]('UpdateSquareReport',_0x23caac);logger[_0xc21e('0xb')](_0xc21e('0x19'),_0x23caac,JSON[_0xc21e('0xd')](_0x2e235d));_0xaa22e3(_0x2e235d);})[_0xc21e('0x13')](function(_0x10a456){logger[_0xc21e('0xe')](_0xc21e('0x19'),_0x10a456[_0xc21e('0x10')],_0x23caac);_0x1268fa(_0x280cc1[_0xc21e('0xe')](0x1f4,_0x10a456[_0xc21e('0x10')]));});});};
\ No newline at end of file
index 5391694..6b78862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47f2=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','show','post','/:id','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4ce3d5,_0x3fdd38){var _0x34d817=function(_0x27f57d){while(--_0x27f57d){_0x4ce3d5['push'](_0x4ce3d5['shift']());}};_0x34d817(++_0x3fdd38);}(_0x47f2,0x1aa));var _0x247f=function(_0x3e8d89,_0x38d5e2){_0x3e8d89=_0x3e8d89-0x0;var _0x498cc6=_0x47f2[_0x3e8d89];return _0x498cc6;};'use strict';var multer=require('multer');var util=require(_0x247f('0x0'));var path=require(_0x247f('0x1'));var timeout=require(_0x247f('0x2'));var express=require(_0x247f('0x3'));var router=express[_0x247f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x247f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x247f('0x6'));var controller=require(_0x247f('0x7'));router[_0x247f('0x8')]('/',auth[_0x247f('0x9')](),controller['index']);router[_0x247f('0x8')](_0x247f('0xa'),auth[_0x247f('0x9')](),controller['describe']);router[_0x247f('0x8')]('/:id',auth[_0x247f('0x9')](),controller[_0x247f('0xb')]);router[_0x247f('0xc')]('/',auth[_0x247f('0x9')](),controller['create']);router['put'](_0x247f('0xd'),auth[_0x247f('0x9')](),controller['update']);router[_0x247f('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x247f('0xf')]=router;
\ No newline at end of file
+var _0xda17=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda17,0x67));var _0x7da1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xda17[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7da1('0x0'));var util=require(_0x7da1('0x1'));var path=require(_0x7da1('0x2'));var timeout=require('connect-timeout');var express=require(_0x7da1('0x3'));var router=express[_0x7da1('0x4')]();var fs_extra=require(_0x7da1('0x5'));var auth=require(_0x7da1('0x6'));var interaction=require(_0x7da1('0x7'));var config=require(_0x7da1('0x8'));var controller=require(_0x7da1('0x9'));router[_0x7da1('0xa')]('/',auth[_0x7da1('0xb')](),controller[_0x7da1('0xc')]);router['get'](_0x7da1('0xd'),auth[_0x7da1('0xb')](),controller['describe']);router[_0x7da1('0xa')](_0x7da1('0xe'),auth[_0x7da1('0xb')](),controller['show']);router['post']('/',auth[_0x7da1('0xb')](),controller[_0x7da1('0xf')]);router['put'](_0x7da1('0xe'),auth[_0x7da1('0xb')](),controller[_0x7da1('0x10')]);router[_0x7da1('0x11')](_0x7da1('0xe'),auth[_0x7da1('0xb')](),controller[_0x7da1('0x12')]);module[_0x7da1('0x13')]=router;
\ No newline at end of file
index 5075b55..2d53edc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dff=['TEXT','sequelize','STRING'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x6dff,0x139));var _0xf6df=function(_0x316e89,_0x3f19d0){_0x316e89=_0x316e89-0x0;var _0x22c923=_0x6dff[_0x316e89];return _0x22c923;};'use strict';var Sequelize=require(_0xf6df('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf6df('0x1')]},'node':{'type':Sequelize[_0xf6df('0x1')]},'application':{'type':Sequelize[_0xf6df('0x1')]},'data':{'type':Sequelize[_0xf6df('0x2')]},'project_name':{'type':Sequelize[_0xf6df('0x1')]},'callerid':{'type':Sequelize[_0xf6df('0x1')]}};
\ No newline at end of file
+var _0x5bf2=['TEXT','sequelize','STRING'];(function(_0xb65193,_0x13d94d){var _0x12eeb4=function(_0x526c9c){while(--_0x526c9c){_0xb65193['push'](_0xb65193['shift']());}};_0x12eeb4(++_0x13d94d);}(_0x5bf2,0x1e4));var _0x25bf=function(_0x2d70eb,_0x21f50d){_0x2d70eb=_0x2d70eb-0x0;var _0x4afb16=_0x5bf2[_0x2d70eb];return _0x4afb16;};'use strict';var Sequelize=require(_0x25bf('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x25bf('0x1')]},'node':{'type':Sequelize[_0x25bf('0x1')]},'application':{'type':Sequelize[_0x25bf('0x1')]},'data':{'type':Sequelize[_0x25bf('0x2')]},'project_name':{'type':Sequelize[_0x25bf('0x1')]},'callerid':{'type':Sequelize[_0x25bf('0x1')]}};
\ No newline at end of file
index 07b696f..895581b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5636=['map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index'];(function(_0x229180,_0x1990b0){var _0x48df54=function(_0x5ef098){while(--_0x5ef098){_0x229180['push'](_0x229180['shift']());}};_0x48df54(++_0x1990b0);}(_0x5636,0x71));var _0x6563=function(_0x3a4251,_0x5bf2a2){_0x3a4251=_0x3a4251-0x0;var _0x505160=_0x5636[_0x3a4251];return _0x505160;};'use strict';var emlformat=require(_0x6563('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6563('0x1'));var jsonpatch=require(_0x6563('0x2'));var rp=require('request-promise');var moment=require(_0x6563('0x3'));var BPromise=require(_0x6563('0x4'));var Mustache=require('mustache');var util=require(_0x6563('0x5'));var path=require(_0x6563('0x6'));var sox=require('sox');var csv=require(_0x6563('0x7'));var ejs=require(_0x6563('0x8'));var fs=require('fs');var fs_extra=require(_0x6563('0x9'));var _=require(_0x6563('0xa'));var squel=require('squel');var crypto=require(_0x6563('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6563('0x7'));var querystring=require(_0x6563('0xc'));var Papa=require(_0x6563('0xd'));var Redis=require(_0x6563('0xe'));var authService=require(_0x6563('0xf'));var qs=require(_0x6563('0x10'));var as=require(_0x6563('0x11'));var hardwareService=require(_0x6563('0x12'));var logger=require('../../config/logger')(_0x6563('0x13'));var utils=require('../../config/utils');var config=require(_0x6563('0x14'));var licenseUtil=require(_0x6563('0x15'));var db=require(_0x6563('0x16'))['db'];function respondWithStatusCode(_0x3154a0,_0x3001e9){_0x3001e9=_0x3001e9||0xcc;return function(_0x3a2111){if(_0x3a2111){return _0x3154a0[_0x6563('0x17')](_0x3001e9);}return _0x3154a0[_0x6563('0x18')](_0x3001e9)['end']();};}function respondWithResult(_0xcf66b8,_0x85c13f){_0x85c13f=_0x85c13f||0xc8;return function(_0x2ceb49){if(_0x2ceb49){return _0xcf66b8['status'](_0x85c13f)[_0x6563('0x19')](_0x2ceb49);}};}function respondWithFilteredResult(_0x581fa3,_0x37e276){return function(_0x516d1d){if(_0x516d1d){var _0x298fab=typeof _0x37e276[_0x6563('0x1a')]===_0x6563('0x1b')&&typeof _0x37e276[_0x6563('0x1c')]===_0x6563('0x1b');var _0x5a8a08=_0x516d1d[_0x6563('0x1d')];var _0x51a5bc=_0x298fab?0x0:_0x37e276[_0x6563('0x1a')];var _0x2ab84c=_0x298fab?_0x516d1d['count']:_0x37e276['offset']+_0x37e276[_0x6563('0x1c')];var _0x3a64e1;if(_0x2ab84c>=_0x5a8a08){_0x2ab84c=_0x5a8a08;_0x3a64e1=0xc8;}else{_0x3a64e1=0xce;}_0x581fa3[_0x6563('0x18')](_0x3a64e1);return _0x581fa3[_0x6563('0x1e')](_0x6563('0x1f'),_0x51a5bc+'-'+_0x2ab84c+'/'+_0x5a8a08)['json'](_0x516d1d);}return null;};}function patchUpdates(_0x59477d){return function(_0x120e6b){try{jsonpatch[_0x6563('0x20')](_0x120e6b,_0x59477d,!![]);}catch(_0x5b6c99){return BPromise[_0x6563('0x21')](_0x5b6c99);}return _0x120e6b['save']();};}function saveUpdates(_0x38c5a3,_0x32982a){return function(_0x364163){if(_0x364163){return _0x364163[_0x6563('0x22')](_0x38c5a3)[_0x6563('0x23')](function(_0x24590a){return _0x24590a;});}return null;};}function removeEntity(_0x39c25a,_0x546579){return function(_0x377e5d){if(_0x377e5d){return _0x377e5d[_0x6563('0x24')]()['then'](function(){_0x39c25a[_0x6563('0x18')](0xcc)[_0x6563('0x25')]();});}};}function handleEntityNotFound(_0x4bf942,_0xfb514b){return function(_0xcd0b75){if(!_0xcd0b75){_0x4bf942[_0x6563('0x17')](0x194);}return _0xcd0b75;};}function handleError(_0x350f9b,_0x3aed9f){_0x3aed9f=_0x3aed9f||0x1f4;return function(_0x1b65e4){logger[_0x6563('0x26')](_0x1b65e4[_0x6563('0x27')]);if(_0x1b65e4[_0x6563('0x28')]){delete _0x1b65e4[_0x6563('0x28')];}_0x350f9b[_0x6563('0x18')](_0x3aed9f)[_0x6563('0x29')](_0x1b65e4);};}exports[_0x6563('0x2a')]=function(_0x39caff,_0x545692){var _0x10592d={},_0x53963c={},_0x511b2c={'count':0x0,'rows':[]};var _0x2e50f4=_[_0x6563('0x2b')](db[_0x6563('0x2c')][_0x6563('0x2d')],function(_0x967f88){return{'name':_0x967f88[_0x6563('0x2e')],'type':_0x967f88[_0x6563('0x2f')][_0x6563('0x30')]};});_0x53963c[_0x6563('0x31')]=_[_0x6563('0x2b')](_0x2e50f4,_0x6563('0x28'));_0x53963c[_0x6563('0x32')]=_[_0x6563('0x33')](_0x39caff['query']);_0x53963c[_0x6563('0x34')]=_[_0x6563('0x35')](_0x53963c[_0x6563('0x31')],_0x53963c[_0x6563('0x32')]);_0x10592d[_0x6563('0x36')]=_[_0x6563('0x35')](_0x53963c[_0x6563('0x31')],qs[_0x6563('0x37')](_0x39caff['query'][_0x6563('0x37')]));_0x10592d['attributes']=_0x10592d[_0x6563('0x36')][_0x6563('0x38')]?_0x10592d[_0x6563('0x36')]:_0x53963c[_0x6563('0x31')];if(!_0x39caff['query'][_0x6563('0x39')](_0x6563('0x3a'))){_0x10592d[_0x6563('0x1c')]=qs[_0x6563('0x1c')](_0x39caff[_0x6563('0x32')][_0x6563('0x1c')]);_0x10592d[_0x6563('0x1a')]=qs[_0x6563('0x1a')](_0x39caff[_0x6563('0x32')][_0x6563('0x1a')]);}_0x10592d[_0x6563('0x3b')]=qs[_0x6563('0x3c')](_0x39caff[_0x6563('0x32')][_0x6563('0x3c')]);_0x10592d[_0x6563('0x3d')]=qs[_0x6563('0x34')](_[_0x6563('0x3e')](_0x39caff[_0x6563('0x32')],_0x53963c[_0x6563('0x34')]),_0x2e50f4);if(_0x39caff[_0x6563('0x32')][_0x6563('0x3f')]){_0x10592d[_0x6563('0x3d')]=_[_0x6563('0x40')](_0x10592d[_0x6563('0x3d')],{'$or':_[_0x6563('0x2b')](_0x2e50f4,function(_0x4845d8){if(_0x4845d8['type']!==_0x6563('0x41')){var _0x308ce3={};_0x308ce3[_0x4845d8[_0x6563('0x28')]]={'$like':'%'+_0x39caff['query'][_0x6563('0x3f')]+'%'};return _0x308ce3;}})});}_0x10592d=_[_0x6563('0x40')]({},_0x10592d,_0x39caff[_0x6563('0x42')]);var _0x2793d5={'where':_0x10592d[_0x6563('0x3d')]};return db[_0x6563('0x2c')]['count'](_0x2793d5)[_0x6563('0x23')](function(_0x4aab72){_0x511b2c[_0x6563('0x1d')]=_0x4aab72;if(_0x39caff[_0x6563('0x32')][_0x6563('0x43')]){_0x10592d[_0x6563('0x44')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x6563('0x45')](_0x10592d);})[_0x6563('0x23')](function(_0x2d37db){_0x511b2c[_0x6563('0x46')]=_0x2d37db;return _0x511b2c;})['then'](respondWithFilteredResult(_0x545692,_0x10592d))[_0x6563('0x47')](handleError(_0x545692,null));};exports[_0x6563('0x48')]=function(_0x56b3a2,_0x2f5f69){var _0x57f9a7={'raw':!![],'where':{'id':_0x56b3a2[_0x6563('0x49')]['id']}},_0x5ae5a2={};_0x5ae5a2[_0x6563('0x31')]=_['keys'](db[_0x6563('0x2c')][_0x6563('0x2d')]);_0x5ae5a2[_0x6563('0x32')]=_['keys'](_0x56b3a2['query']);_0x5ae5a2[_0x6563('0x34')]=_[_0x6563('0x35')](_0x5ae5a2[_0x6563('0x31')],_0x5ae5a2[_0x6563('0x32')]);_0x57f9a7[_0x6563('0x36')]=_[_0x6563('0x35')](_0x5ae5a2[_0x6563('0x31')],qs[_0x6563('0x37')](_0x56b3a2[_0x6563('0x32')][_0x6563('0x37')]));_0x57f9a7['attributes']=_0x57f9a7['attributes'][_0x6563('0x38')]?_0x57f9a7[_0x6563('0x36')]:_0x5ae5a2[_0x6563('0x31')];if(_0x56b3a2[_0x6563('0x32')]['includeAll']){_0x57f9a7['include']=[{'all':!![]}];}_0x57f9a7=_[_0x6563('0x40')]({},_0x57f9a7,_0x56b3a2[_0x6563('0x42')]);return db[_0x6563('0x2c')]['find'](_0x57f9a7)['then'](handleEntityNotFound(_0x2f5f69,null))[_0x6563('0x23')](respondWithResult(_0x2f5f69,null))[_0x6563('0x47')](handleError(_0x2f5f69,null));};exports[_0x6563('0x4a')]=function(_0x58df70,_0x463a87){return db[_0x6563('0x2c')]['create'](_0x58df70[_0x6563('0x4b')],{})[_0x6563('0x23')](respondWithResult(_0x463a87,0xc9))['catch'](handleError(_0x463a87,null));};exports['update']=function(_0x14ad54,_0x20950d){if(_0x14ad54[_0x6563('0x4b')]['id']){delete _0x14ad54['body']['id'];}return db[_0x6563('0x2c')][_0x6563('0x4c')]({'where':{'id':_0x14ad54[_0x6563('0x49')]['id']}})[_0x6563('0x23')](handleEntityNotFound(_0x20950d,null))[_0x6563('0x23')](saveUpdates(_0x14ad54['body'],null))['then'](respondWithResult(_0x20950d,null))[_0x6563('0x47')](handleError(_0x20950d,null));};exports[_0x6563('0x24')]=function(_0x8312d9,_0x31ee31){return db['SquareDetailsReport'][_0x6563('0x4c')]({'where':{'id':_0x8312d9[_0x6563('0x49')]['id']}})[_0x6563('0x23')](handleEntityNotFound(_0x31ee31,null))[_0x6563('0x23')](removeEntity(_0x31ee31,null))[_0x6563('0x47')](handleError(_0x31ee31,null));};exports[_0x6563('0x4d')]=function(_0x20a05a,_0xf50c84){return db[_0x6563('0x2c')][_0x6563('0x4d')]()[_0x6563('0x23')](respondWithResult(_0xf50c84,null))[_0x6563('0x47')](handleError(_0xf50c84,null));};
\ No newline at end of file
+var _0x8947=['show','includeAll','include','catch','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareDetailsReport','findAll'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x8947,0x1d6));var _0x7894=function(_0x48920a,_0x1caad7){_0x48920a=_0x48920a-0x0;var _0x271586=_0x8947[_0x48920a];return _0x271586;};'use strict';var emlformat=require(_0x7894('0x0'));var rimraf=require(_0x7894('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7894('0x2'));var rp=require(_0x7894('0x3'));var moment=require(_0x7894('0x4'));var BPromise=require(_0x7894('0x5'));var Mustache=require(_0x7894('0x6'));var util=require(_0x7894('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7894('0x8'));var ejs=require(_0x7894('0x9'));var fs=require('fs');var fs_extra=require(_0x7894('0xa'));var _=require(_0x7894('0xb'));var squel=require(_0x7894('0xc'));var crypto=require(_0x7894('0xd'));var jsforce=require(_0x7894('0xe'));var deskjs=require(_0x7894('0xf'));var toCsv=require(_0x7894('0x8'));var querystring=require(_0x7894('0x10'));var Papa=require(_0x7894('0x11'));var Redis=require(_0x7894('0x12'));var authService=require(_0x7894('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7894('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7894('0x15'))(_0x7894('0x16'));var utils=require(_0x7894('0x17'));var config=require(_0x7894('0x18'));var licenseUtil=require(_0x7894('0x19'));var db=require(_0x7894('0x1a'))['db'];function respondWithStatusCode(_0x5a8c2d,_0x65b361){_0x65b361=_0x65b361||0xcc;return function(_0x3817dd){if(_0x3817dd){return _0x5a8c2d[_0x7894('0x1b')](_0x65b361);}return _0x5a8c2d[_0x7894('0x1c')](_0x65b361)[_0x7894('0x1d')]();};}function respondWithResult(_0x313ce2,_0x2acbc2){_0x2acbc2=_0x2acbc2||0xc8;return function(_0x4f41db){if(_0x4f41db){return _0x313ce2[_0x7894('0x1c')](_0x2acbc2)[_0x7894('0x1e')](_0x4f41db);}};}function respondWithFilteredResult(_0x53654a,_0x457aae){return function(_0x3bf00b){if(_0x3bf00b){var _0x4f9ab6=typeof _0x457aae[_0x7894('0x1f')]===_0x7894('0x20')&&typeof _0x457aae[_0x7894('0x21')]===_0x7894('0x20');var _0x5ced96=_0x3bf00b[_0x7894('0x22')];var _0x331695=_0x4f9ab6?0x0:_0x457aae['offset'];var _0x4641d4=_0x4f9ab6?_0x3bf00b[_0x7894('0x22')]:_0x457aae[_0x7894('0x1f')]+_0x457aae[_0x7894('0x21')];var _0xf9ac22;if(_0x4641d4>=_0x5ced96){_0x4641d4=_0x5ced96;_0xf9ac22=0xc8;}else{_0xf9ac22=0xce;}_0x53654a[_0x7894('0x1c')](_0xf9ac22);return _0x53654a[_0x7894('0x23')](_0x7894('0x24'),_0x331695+'-'+_0x4641d4+'/'+_0x5ced96)['json'](_0x3bf00b);}return null;};}function patchUpdates(_0x16e9b8){return function(_0x2c4a9a){try{jsonpatch[_0x7894('0x25')](_0x2c4a9a,_0x16e9b8,!![]);}catch(_0x47a58a){return BPromise[_0x7894('0x26')](_0x47a58a);}return _0x2c4a9a['save']();};}function saveUpdates(_0x240cdf,_0x3cc53a){return function(_0x377347){if(_0x377347){return _0x377347[_0x7894('0x27')](_0x240cdf)[_0x7894('0x28')](function(_0x5972f1){return _0x5972f1;});}return null;};}function removeEntity(_0x83a1ae,_0x2a7d81){return function(_0x11633d){if(_0x11633d){return _0x11633d[_0x7894('0x29')]()['then'](function(){_0x83a1ae[_0x7894('0x1c')](0xcc)[_0x7894('0x1d')]();});}};}function handleEntityNotFound(_0x4ecb3d,_0x5d379d){return function(_0x6854a9){if(!_0x6854a9){_0x4ecb3d[_0x7894('0x1b')](0x194);}return _0x6854a9;};}function handleError(_0x537a3d,_0x59c65d){_0x59c65d=_0x59c65d||0x1f4;return function(_0x388218){logger[_0x7894('0x2a')](_0x388218[_0x7894('0x2b')]);if(_0x388218[_0x7894('0x2c')]){delete _0x388218[_0x7894('0x2c')];}_0x537a3d[_0x7894('0x1c')](_0x59c65d)[_0x7894('0x2d')](_0x388218);};}exports['index']=function(_0x11382f,_0x389d5c){var _0x2a49c5={},_0x1e3c9e={},_0x22c882={'count':0x0,'rows':[]};var _0x1dec75=_[_0x7894('0x2e')](db['SquareDetailsReport'][_0x7894('0x2f')],function(_0x2d2e80){return{'name':_0x2d2e80['fieldName'],'type':_0x2d2e80['type'][_0x7894('0x30')]};});_0x1e3c9e[_0x7894('0x31')]=_[_0x7894('0x2e')](_0x1dec75,_0x7894('0x2c'));_0x1e3c9e[_0x7894('0x32')]=_[_0x7894('0x33')](_0x11382f[_0x7894('0x32')]);_0x1e3c9e[_0x7894('0x34')]=_[_0x7894('0x35')](_0x1e3c9e[_0x7894('0x31')],_0x1e3c9e[_0x7894('0x32')]);_0x2a49c5[_0x7894('0x36')]=_[_0x7894('0x35')](_0x1e3c9e[_0x7894('0x31')],qs[_0x7894('0x37')](_0x11382f['query'][_0x7894('0x37')]));_0x2a49c5[_0x7894('0x36')]=_0x2a49c5[_0x7894('0x36')][_0x7894('0x38')]?_0x2a49c5[_0x7894('0x36')]:_0x1e3c9e[_0x7894('0x31')];if(!_0x11382f[_0x7894('0x32')][_0x7894('0x39')](_0x7894('0x3a'))){_0x2a49c5[_0x7894('0x21')]=qs[_0x7894('0x21')](_0x11382f['query'][_0x7894('0x21')]);_0x2a49c5[_0x7894('0x1f')]=qs[_0x7894('0x1f')](_0x11382f['query'][_0x7894('0x1f')]);}_0x2a49c5['order']=qs[_0x7894('0x3b')](_0x11382f['query'][_0x7894('0x3b')]);_0x2a49c5[_0x7894('0x3c')]=qs[_0x7894('0x34')](_[_0x7894('0x3d')](_0x11382f[_0x7894('0x32')],_0x1e3c9e['filters']),_0x1dec75);if(_0x11382f['query']['filter']){_0x2a49c5[_0x7894('0x3c')]=_[_0x7894('0x3e')](_0x2a49c5[_0x7894('0x3c')],{'$or':_[_0x7894('0x2e')](_0x1dec75,function(_0x547934){if(_0x547934[_0x7894('0x3f')]!==_0x7894('0x40')){var _0x1b450b={};_0x1b450b[_0x547934[_0x7894('0x2c')]]={'$like':'%'+_0x11382f['query'][_0x7894('0x41')]+'%'};return _0x1b450b;}})});}_0x2a49c5=_[_0x7894('0x3e')]({},_0x2a49c5,_0x11382f[_0x7894('0x42')]);var _0x264879={'where':_0x2a49c5[_0x7894('0x3c')]};return db['SquareDetailsReport']['count'](_0x264879)[_0x7894('0x28')](function(_0x4c2409){_0x22c882['count']=_0x4c2409;if(_0x11382f[_0x7894('0x32')]['includeAll']){_0x2a49c5['include']=[{'all':!![]}];}return db[_0x7894('0x43')][_0x7894('0x44')](_0x2a49c5);})['then'](function(_0x2618fb){_0x22c882['rows']=_0x2618fb;return _0x22c882;})[_0x7894('0x28')](respondWithFilteredResult(_0x389d5c,_0x2a49c5))['catch'](handleError(_0x389d5c,null));};exports[_0x7894('0x45')]=function(_0x3e6f78,_0x39a9f9){var _0x159690={'raw':!![],'where':{'id':_0x3e6f78['params']['id']}},_0x56a7cd={};_0x56a7cd['model']=_[_0x7894('0x33')](db[_0x7894('0x43')]['rawAttributes']);_0x56a7cd[_0x7894('0x32')]=_[_0x7894('0x33')](_0x3e6f78[_0x7894('0x32')]);_0x56a7cd[_0x7894('0x34')]=_[_0x7894('0x35')](_0x56a7cd[_0x7894('0x31')],_0x56a7cd[_0x7894('0x32')]);_0x159690['attributes']=_[_0x7894('0x35')](_0x56a7cd[_0x7894('0x31')],qs[_0x7894('0x37')](_0x3e6f78[_0x7894('0x32')][_0x7894('0x37')]));_0x159690[_0x7894('0x36')]=_0x159690[_0x7894('0x36')][_0x7894('0x38')]?_0x159690['attributes']:_0x56a7cd[_0x7894('0x31')];if(_0x3e6f78[_0x7894('0x32')][_0x7894('0x46')]){_0x159690[_0x7894('0x47')]=[{'all':!![]}];}_0x159690=_['merge']({},_0x159690,_0x3e6f78['options']);return db[_0x7894('0x43')]['find'](_0x159690)['then'](handleEntityNotFound(_0x39a9f9,null))[_0x7894('0x28')](respondWithResult(_0x39a9f9,null))[_0x7894('0x48')](handleError(_0x39a9f9,null));};exports['create']=function(_0x428ece,_0x5e5036){return db[_0x7894('0x43')]['create'](_0x428ece[_0x7894('0x49')],{})[_0x7894('0x28')](respondWithResult(_0x5e5036,0xc9))[_0x7894('0x48')](handleError(_0x5e5036,null));};exports[_0x7894('0x27')]=function(_0x2393df,_0x17ee38){if(_0x2393df['body']['id']){delete _0x2393df[_0x7894('0x49')]['id'];}return db['SquareDetailsReport'][_0x7894('0x4a')]({'where':{'id':_0x2393df[_0x7894('0x4b')]['id']}})[_0x7894('0x28')](handleEntityNotFound(_0x17ee38,null))[_0x7894('0x28')](saveUpdates(_0x2393df[_0x7894('0x49')],null))[_0x7894('0x28')](respondWithResult(_0x17ee38,null))['catch'](handleError(_0x17ee38,null));};exports[_0x7894('0x29')]=function(_0x3cae71,_0x443d85){return db[_0x7894('0x43')]['find']({'where':{'id':_0x3cae71[_0x7894('0x4b')]['id']}})[_0x7894('0x28')](handleEntityNotFound(_0x443d85,null))[_0x7894('0x28')](removeEntity(_0x443d85,null))['catch'](handleError(_0x443d85,null));};exports[_0x7894('0x4c')]=function(_0x44fe34,_0x41d0cd){return db[_0x7894('0x43')][_0x7894('0x4c')]()[_0x7894('0x28')](respondWithResult(_0x41d0cd,null))[_0x7894('0x48')](handleError(_0x41d0cd,null));};
\ No newline at end of file
index 4a23d6a..c4a1ab7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1110=['define','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment','request-promise','path','./squareReportDetail.attributes','exports'];(function(_0x1e1751,_0x24ee5a){var _0x45870c=function(_0x424b5e){while(--_0x424b5e){_0x1e1751['push'](_0x1e1751['shift']());}};_0x45870c(++_0x24ee5a);}(_0x1110,0x7c));var _0x0111=function(_0xb26065,_0x36df08){_0xb26065=_0xb26065-0x0;var _0x974dce=_0x1110[_0xb26065];return _0x974dce;};'use strict';var _=require('lodash');var util=require(_0x0111('0x0'));var logger=require(_0x0111('0x1'))(_0x0111('0x2'));var moment=require(_0x0111('0x3'));var BPromise=require('bluebird');var rp=require(_0x0111('0x4'));var fs=require('fs');var path=require(_0x0111('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0111('0x6'));module[_0x0111('0x7')]=function(_0x13f355,_0x7430a5){return _0x13f355[_0x0111('0x8')](_0x0111('0x9'),attributes,{'tableName':_0x0111('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69bf=['rimraf','./squareReportDetail.attributes','define','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x284885,_0x34b143){var _0x3a9710=function(_0x31eda3){while(--_0x31eda3){_0x284885['push'](_0x284885['shift']());}};_0x3a9710(++_0x34b143);}(_0x69bf,0x117));var _0xf69b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x69bf[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf69b('0x0'));var util=require(_0xf69b('0x1'));var logger=require(_0xf69b('0x2'))(_0xf69b('0x3'));var moment=require(_0xf69b('0x4'));var BPromise=require('bluebird');var rp=require(_0xf69b('0x5'));var fs=require('fs');var path=require(_0xf69b('0x6'));var rimraf=require(_0xf69b('0x7'));var config=require('../../config/environment');var attributes=require(_0xf69b('0x8'));module['exports']=function(_0x201bdf,_0x194caa){return _0x201bdf[_0xf69b('0x9')]('SquareDetailsReport',attributes,{'tableName':_0xf69b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4207479..6495e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2cf=['info','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x3401ce,_0x5d1579){_0x3401ce=_0x3401ce-0x0;var _0x1bb79d=_0xe2cf[_0x3401ce];return _0x1bb79d;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});}exports[_0xfe2c('0x13')]=function(_0x23242b){var _0x36aeec=this;return new Promise(function(_0x13f233,_0x4afea3){return db[_0xfe2c('0x14')][_0xfe2c('0x15')](_0x23242b[_0xfe2c('0x16')],{'raw':_0x23242b[_0xfe2c('0x17')]?_0x23242b['options'][_0xfe2c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4e9137){logger[_0xfe2c('0x19')](_0xfe2c('0x13'),_0x23242b);logger['debug'](_0xfe2c('0x13'),_0x23242b,JSON[_0xfe2c('0xd')](_0x4e9137));_0x13f233(_0x4e9137);})['catch'](function(_0x1bd50e){logger['error'](_0xfe2c('0x13'),_0x1bd50e[_0xfe2c('0x10')],_0x23242b);_0x4afea3(_0x36aeec[_0xfe2c('0xe')](0x1f4,_0x1bd50e[_0xfe2c('0x10')]));});});};
\ No newline at end of file
+var _0x5b12=['../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2a3363,_0x5c0cdc){var _0x5e042f=function(_0x39fccf){while(--_0x39fccf){_0x2a3363['push'](_0x2a3363['shift']());}};_0x5e042f(++_0x5c0cdc);}(_0x5b12,0xa3));var _0x25b1=function(_0xe56397,_0x30d7a0){_0xe56397=_0xe56397-0x0;var _0x554a10=_0x5b12[_0xe56397];return _0x554a10;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['create'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bfd7d){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger['debug'](_0x25b1('0x14'),_0x27ccc9,JSON['stringify'](_0x3bfd7d));_0x2a7d14(_0x3bfd7d);})['catch'](function(_0x565cfd){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x565cfd['message'],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x565cfd[_0x25b1('0x12')]));});});};
\ No newline at end of file
index a21cf84..f65bc72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa257=['/process/:pid/kill','express','Router','../../components/auth/service','./system.controller','isAuthenticated','index'];(function(_0x356524,_0x4e1e89){var _0x51e108=function(_0x7fcf6d){while(--_0x7fcf6d){_0x356524['push'](_0x356524['shift']());}};_0x51e108(++_0x4e1e89);}(_0xa257,0xcc));var _0x7a25=function(_0x4a0b1c,_0x530242){_0x4a0b1c=_0x4a0b1c-0x0;var _0x4c114c=_0xa257[_0x4a0b1c];return _0x4c114c;};'use strict';var express=require(_0x7a25('0x0'));var router=express[_0x7a25('0x1')]();var auth=require(_0x7a25('0x2'));var controller=require(_0x7a25('0x3'));router['get']('/',auth[_0x7a25('0x4')](),controller[_0x7a25('0x5')]);router['get'](_0x7a25('0x6'),auth[_0x7a25('0x4')](),controller['killProcess']);module['exports']=router;
\ No newline at end of file
+var _0xf444=['isAuthenticated','index','/process/:pid/kill','killProcess','Router','../../components/auth/service','./system.controller','get'];(function(_0xef98dc,_0x25d6da){var _0x131b2d=function(_0x33b927){while(--_0x33b927){_0xef98dc['push'](_0xef98dc['shift']());}};_0x131b2d(++_0x25d6da);}(_0xf444,0x1b4));var _0x4f44=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xf444[_0x2f87cd];return _0x5d7eda;};'use strict';var express=require('express');var router=express[_0x4f44('0x0')]();var auth=require(_0x4f44('0x1'));var controller=require(_0x4f44('0x2'));router[_0x4f44('0x3')]('/',auth[_0x4f44('0x4')](),controller[_0x4f44('0x5')]);router['get'](_0x4f44('0x6'),auth['isAuthenticated'](),controller[_0x4f44('0x7')]);module['exports']=router;
\ No newline at end of file
index 6042ad2..f4e4788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9065=['params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','inspect','send','getAllData','then','status','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9065,0x127));var _0x5906=function(_0x1aeb08,_0x374a37){_0x1aeb08=_0x1aeb08-0x0;var _0x354f9e=_0x9065[_0x1aeb08];return _0x354f9e;};'use strict';var info=require(_0x5906('0x0'));var exec=require(_0x5906('0x1'))[_0x5906('0x2')];var logger=require(_0x5906('0x3'))(_0x5906('0x4'));var util=require(_0x5906('0x5'));var BPromise=require(_0x5906('0x6'));var _=require(_0x5906('0x7'));function handleError(_0xae5ef8,_0x54d60c,_0x3f4d57){_0x54d60c=_0x54d60c||0x1f4;return function(_0x2e9aa4){logger[_0x5906('0x8')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3f4d57,_0x54d60c,util[_0x5906('0x9')](_0x2e9aa4,{'showHidden':![],'depth':null}));delete _0x2e9aa4['name'];_0xae5ef8['status'](_0x54d60c)[_0x5906('0xa')](_0x2e9aa4);};}exports['index']=function(_0x21e561,_0x4b4eb3){return info[_0x5906('0xb')]()[_0x5906('0xc')](function(_0x39ffbb){return _0x4b4eb3['status'](0xc8)['json'](_0x39ffbb);})['catch'](function(_0x2f212a){return _0x4b4eb3[_0x5906('0xd')](0x1f4)['json'](_0x2f212a);});};exports['killProcess']=function(_0x39df0b,_0x35a0d5){var _0x4701f2=[_0x5906('0xe')];return new BPromise(function(_0x17ae1c,_0x428b59){return exec(util[_0x5906('0xf')](_0x5906('0x10'),_0x39df0b[_0x5906('0x11')][_0x5906('0x12')]),function(_0x42e3c9,_0x240d51,_0x33de04){if(_0x42e3c9){return _0x428b59(_0x42e3c9);}return _0x17ae1c(_0x240d51);});})[_0x5906('0xc')](function(_0x38731b){var _0x3590ce=![];var _0x300570=_0x38731b[_0x5906('0x13')](/\n/);for(var _0x30316a=0x0,_0x3d597c=_0x4701f2['length'];_0x30316a<_0x3d597c,_0x3590ce===![];_0x30316a+=0x1){if(_0x38731b[_0x5906('0x14')](_0x4701f2[_0x30316a])>=0x0){_0x3590ce=!![];}}if(!_0x3590ce){throw new Error(util['format'](_0x5906('0x15'),_0x39df0b[_0x5906('0x11')][_0x5906('0x12')]));}process[_0x5906('0x16')](_0x39df0b[_0x5906('0x11')]['pid'],'SIGINT');return _0x35a0d5[_0x5906('0xd')](0xc8)[_0x5906('0x17')]({'message':util[_0x5906('0xf')](_0x5906('0x18'),_0x39df0b[_0x5906('0x11')][_0x5906('0x12')])});})['catch'](handleError(_0x35a0d5,null,_0x5906('0x19')));};
\ No newline at end of file
+var _0x1e65=['length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','systeminformation','exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x1e65,0x19d));var _0x51e6=function(_0x634e3d,_0x1cab83){_0x634e3d=_0x634e3d-0x0;var _0x29fdfc=_0x1e65[_0x634e3d];return _0x29fdfc;};'use strict';var info=require(_0x51e6('0x0'));var exec=require('child_process')[_0x51e6('0x1')];var logger=require(_0x51e6('0x2'))('api');var util=require(_0x51e6('0x3'));var BPromise=require(_0x51e6('0x4'));var _=require('lodash');function handleError(_0x5ef7c8,_0x11a0e7,_0x9876b0){_0x11a0e7=_0x11a0e7||0x1f4;return function(_0x5e32ba){logger[_0x51e6('0x5')](_0x51e6('0x6'),_0x9876b0,_0x11a0e7,util[_0x51e6('0x7')](_0x5e32ba,{'showHidden':![],'depth':null}));delete _0x5e32ba[_0x51e6('0x8')];_0x5ef7c8[_0x51e6('0x9')](_0x11a0e7)['send'](_0x5e32ba);};}exports[_0x51e6('0xa')]=function(_0x53a64a,_0x2c1b32){return info[_0x51e6('0xb')]()[_0x51e6('0xc')](function(_0x1ad9dd){return _0x2c1b32[_0x51e6('0x9')](0xc8)[_0x51e6('0xd')](_0x1ad9dd);})['catch'](function(_0x6b8d3d){return _0x2c1b32['status'](0x1f4)[_0x51e6('0xd')](_0x6b8d3d);});};exports[_0x51e6('0xe')]=function(_0xd63428,_0x5d0eff){var _0x4d4394=['components/import/cm'];return new BPromise(function(_0x605f16,_0x5deb73){return exec(util['format'](_0x51e6('0xf'),_0xd63428[_0x51e6('0x10')][_0x51e6('0x11')]),function(_0xb1d23a,_0x4da076,_0x48d2d4){if(_0xb1d23a){return _0x5deb73(_0xb1d23a);}return _0x605f16(_0x4da076);});})['then'](function(_0x7e882f){var _0x8ec521=![];var _0x6ea2d2=_0x7e882f[_0x51e6('0x12')](/\n/);for(var _0xc594c7=0x0,_0x5a0a01=_0x4d4394[_0x51e6('0x13')];_0xc594c7<_0x5a0a01,_0x8ec521===![];_0xc594c7+=0x1){if(_0x7e882f['indexOf'](_0x4d4394[_0xc594c7])>=0x0){_0x8ec521=!![];}}if(!_0x8ec521){throw new Error(util[_0x51e6('0x14')](_0x51e6('0x15'),_0xd63428[_0x51e6('0x10')][_0x51e6('0x11')]));}process[_0x51e6('0x16')](_0xd63428[_0x51e6('0x10')][_0x51e6('0x11')],_0x51e6('0x17'));return _0x5d0eff[_0x51e6('0x9')](0xc8)[_0x51e6('0xd')]({'message':util[_0x51e6('0x14')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xd63428['params']['pid'])});})['catch'](handleError(_0x5d0eff,null,'killProcess'));};
\ No newline at end of file
index 8cb6c8b..0425f96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2906=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','show','create','put','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2906,0xe0));var _0x6290=function(_0x4e502e,_0x2a7c94){_0x4e502e=_0x4e502e-0x0;var _0x25c957=_0x2906[_0x4e502e];return _0x25c957;};'use strict';var multer=require(_0x6290('0x0'));var util=require(_0x6290('0x1'));var path=require('path');var timeout=require(_0x6290('0x2'));var express=require('express');var router=express[_0x6290('0x3')]();var fs_extra=require(_0x6290('0x4'));var auth=require(_0x6290('0x5'));var interaction=require(_0x6290('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router['get']('/',auth[_0x6290('0x7')](),controller['index']);router[_0x6290('0x8')]('/:id',auth[_0x6290('0x7')](),controller[_0x6290('0x9')]);router['post']('/',auth[_0x6290('0x7')](),controller[_0x6290('0xa')]);router[_0x6290('0xb')](_0x6290('0xc'),auth[_0x6290('0x7')](),controller[_0x6290('0xd')]);router[_0x6290('0xe')](_0x6290('0xc'),auth[_0x6290('0x7')](),controller[_0x6290('0xf')]);module[_0x6290('0x10')]=router;
\ No newline at end of file
+var _0xe11d=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1d850e,_0x723bc4){var _0x2efd1f=function(_0x4aabc7){while(--_0x4aabc7){_0x1d850e['push'](_0x1d850e['shift']());}};_0x2efd1f(++_0x723bc4);}(_0xe11d,0x1eb));var _0xde11=function(_0x2aef20,_0x4c09de){_0x2aef20=_0x2aef20-0x0;var _0xf23862=_0xe11d[_0x2aef20];return _0xf23862;};'use strict';var multer=require(_0xde11('0x0'));var util=require('util');var path=require(_0xde11('0x1'));var timeout=require(_0xde11('0x2'));var express=require(_0xde11('0x3'));var router=express['Router']();var fs_extra=require(_0xde11('0x4'));var auth=require(_0xde11('0x5'));var interaction=require(_0xde11('0x6'));var config=require(_0xde11('0x7'));var controller=require(_0xde11('0x8'));router[_0xde11('0x9')]('/',auth[_0xde11('0xa')](),controller[_0xde11('0xb')]);router['get'](_0xde11('0xc'),auth[_0xde11('0xa')](),controller[_0xde11('0xd')]);router[_0xde11('0xe')]('/',auth[_0xde11('0xa')](),controller['create']);router[_0xde11('0xf')](_0xde11('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xde11('0x10')](_0xde11('0xc'),auth[_0xde11('0xa')](),controller[_0xde11('0x11')]);module[_0xde11('0x12')]=router;
\ No newline at end of file
index 3cb5a4b..2199af5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x608a=['exports','STRING','#0091EA'];(function(_0xc62492,_0x20aaee){var _0x4c0517=function(_0x4d7da0){while(--_0x4d7da0){_0xc62492['push'](_0xc62492['shift']());}};_0x4c0517(++_0x20aaee);}(_0x608a,0xff));var _0xa608=function(_0x26b633,_0x4da9f1){_0x26b633=_0x26b633-0x0;var _0x2643fa=_0x608a[_0x26b633];return _0x2643fa;};'use strict';var Sequelize=require('sequelize');module[_0xa608('0x0')]={'name':{'type':Sequelize[_0xa608('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa608('0x1')],'defaultValue':_0xa608('0x2')},'description':{'type':Sequelize[_0xa608('0x1')]}};
\ No newline at end of file
+var _0xc15c=['STRING','name'];(function(_0x110f55,_0x4025f9){var _0x303268=function(_0x3a333d){while(--_0x3a333d){_0x110f55['push'](_0x110f55['shift']());}};_0x303268(++_0x4025f9);}(_0xc15c,0xae));var _0xcc15=function(_0x4c25cb,_0x44dd75){_0x4c25cb=_0x4c25cb-0x0;var _0x4dc86b=_0xc15c[_0x4c25cb];return _0x4dc86b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcc15('0x0')],'unique':_0xcc15('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xcc15('0x0')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xcc15('0x0')]}};
\ No newline at end of file
index c995f74..75eb44d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf109=['save','update','destroy','then','Tags','UserProfileResource','sendStatus','error','stack','name','send','map','Tag','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf109,0xce));var _0x9f10=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0xf109[_0xda464c];return _0x19e222;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){var _0x44b99d=_0x4d21c5['get']({'plain':!![]});var _0x2ec07d=_0x9f10('0x26');return db[_0x9f10('0x27')][_0x9f10('0x24')]({'where':{'type':_0x2ec07d,'resourceId':_0x44b99d['id']}})['then'](function(){return _0x4d21c5;});})['then'](function(){_0x3dde2e['status'](0xcc)[_0x9f10('0x19')]();});}};}function handleEntityNotFound(_0x4a0407,_0x314794){return function(_0x1de75a){if(!_0x1de75a){_0x4a0407[_0x9f10('0x28')](0x194);}return _0x1de75a;};}function handleError(_0x2ed95b,_0x2e11b1){_0x2e11b1=_0x2e11b1||0x1f4;return function(_0x4f6b0c){logger[_0x9f10('0x29')](_0x4f6b0c[_0x9f10('0x2a')]);if(_0x4f6b0c[_0x9f10('0x2b')]){delete _0x4f6b0c[_0x9f10('0x2b')];}_0x2ed95b[_0x9f10('0x18')](_0x2e11b1)[_0x9f10('0x2c')](_0x4f6b0c);};}exports['index']=function(_0x358d3f,_0x501ee){var _0x44207f={},_0x1b03ee={},_0x49b3f4={'count':0x0,'rows':[]};var _0x44f0a0=_[_0x9f10('0x2d')](db[_0x9f10('0x2e')]['rawAttributes'],function(_0x434128){return{'name':_0x434128['fieldName'],'type':_0x434128[_0x9f10('0x2f')][_0x9f10('0x30')]};});_0x1b03ee[_0x9f10('0x31')]=_['map'](_0x44f0a0,_0x9f10('0x2b'));_0x1b03ee[_0x9f10('0x32')]=_[_0x9f10('0x33')](_0x358d3f[_0x9f10('0x32')]);_0x1b03ee[_0x9f10('0x34')]=_['intersection'](_0x1b03ee[_0x9f10('0x31')],_0x1b03ee['query']);_0x44207f[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x1b03ee[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44207f['attributes']=_0x44207f[_0x9f10('0x35')][_0x9f10('0x38')]?_0x44207f[_0x9f10('0x35')]:_0x1b03ee['model'];if(!_0x358d3f[_0x9f10('0x32')][_0x9f10('0x39')]('nolimit')){_0x44207f[_0x9f10('0x1b')]=qs['limit'](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1b')]);_0x44207f[_0x9f10('0x1d')]=qs[_0x9f10('0x1d')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1d')]);}_0x44207f[_0x9f10('0x3a')]=qs[_0x9f10('0x3b')](_0x358d3f['query'][_0x9f10('0x3b')]);_0x44207f[_0x9f10('0x3c')]=qs[_0x9f10('0x34')](_['pick'](_0x358d3f[_0x9f10('0x32')],_0x1b03ee[_0x9f10('0x34')]),_0x44f0a0);if(_0x358d3f['query'][_0x9f10('0x3d')]){_0x44207f[_0x9f10('0x3c')]=_[_0x9f10('0x3e')](_0x44207f['where'],{'$or':_['map'](_0x44f0a0,function(_0x2e4e2d){if(_0x2e4e2d[_0x9f10('0x2f')]!==_0x9f10('0x3f')){var _0x433e70={};_0x433e70[_0x2e4e2d[_0x9f10('0x2b')]]={'$like':'%'+_0x358d3f[_0x9f10('0x32')][_0x9f10('0x3d')]+'%'};return _0x433e70;}})});}_0x44207f=_[_0x9f10('0x3e')]({},_0x44207f,_0x358d3f[_0x9f10('0x40')]);var _0x149f8f={'where':_0x44207f[_0x9f10('0x3c')]};return db[_0x9f10('0x2e')]['count'](_0x149f8f)['then'](function(_0x4bb805){_0x49b3f4[_0x9f10('0x1c')]=_0x4bb805;if(_0x358d3f['query'][_0x9f10('0x41')]){_0x44207f[_0x9f10('0x42')]=[{'all':!![]}];}return db[_0x9f10('0x2e')]['findAll'](_0x44207f);})[_0x9f10('0x25')](function(_0xf1164){_0x49b3f4[_0x9f10('0x43')]=_0xf1164;return _0x49b3f4;})[_0x9f10('0x25')](respondWithFilteredResult(_0x501ee,_0x44207f))[_0x9f10('0x44')](handleError(_0x501ee,null));};exports['show']=function(_0x578368,_0x542a22){var _0x44bb34={'raw':!![],'where':{'id':_0x578368[_0x9f10('0x45')]['id']}},_0x5d08fb={};_0x5d08fb['model']=_[_0x9f10('0x33')](db[_0x9f10('0x2e')][_0x9f10('0x46')]);_0x5d08fb[_0x9f10('0x32')]=_['keys'](_0x578368[_0x9f10('0x32')]);_0x5d08fb[_0x9f10('0x34')]=_['intersection'](_0x5d08fb[_0x9f10('0x31')],_0x5d08fb[_0x9f10('0x32')]);_0x44bb34[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x5d08fb[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x578368[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44bb34[_0x9f10('0x35')]=_0x44bb34[_0x9f10('0x35')]['length']?_0x44bb34[_0x9f10('0x35')]:_0x5d08fb[_0x9f10('0x31')];if(_0x578368['query'][_0x9f10('0x41')]){_0x44bb34[_0x9f10('0x42')]=[{'all':!![]}];}_0x44bb34=_[_0x9f10('0x3e')]({},_0x44bb34,_0x578368[_0x9f10('0x40')]);return db['Tag'][_0x9f10('0x47')](_0x44bb34)[_0x9f10('0x25')](handleEntityNotFound(_0x542a22,null))[_0x9f10('0x25')](respondWithResult(_0x542a22,null))[_0x9f10('0x44')](handleError(_0x542a22,null));};exports[_0x9f10('0x48')]=function(_0x43cb31,_0x479b46){return db[_0x9f10('0x2e')][_0x9f10('0x48')](_0x43cb31[_0x9f10('0x49')],{})[_0x9f10('0x25')](function(_0x5c8d13){var _0x1d5436=_0x43cb31['user'][_0x9f10('0x4a')]({'plain':!![]});if(!_0x1d5436)throw new Error(_0x9f10('0x4b'));if(_0x1d5436[_0x9f10('0x4c')]===_0x9f10('0x4d')){var _0x39dae3=_0x5c8d13[_0x9f10('0x4a')]({'plain':!![]});var _0x2b6fe7=_0x9f10('0x26');return db['UserProfileSection'][_0x9f10('0x47')]({'where':{'name':_0x2b6fe7,'userProfileId':_0x1d5436['userProfileId']},'raw':!![]})[_0x9f10('0x25')](function(_0x532808){if(_0x532808&&_0x532808[_0x9f10('0x4e')]===0x0){return db[_0x9f10('0x27')][_0x9f10('0x48')]({'name':_0x39dae3[_0x9f10('0x2b')],'resourceId':_0x39dae3['id'],'type':_0x532808[_0x9f10('0x2b')],'sectionId':_0x532808['id']},{})['then'](function(){return _0x5c8d13;});}else{return _0x5c8d13;}})[_0x9f10('0x44')](function(_0x63abfb){logger[_0x9f10('0x29')](_0x9f10('0x4f'),_0x63abfb);throw _0x63abfb;});}return _0x5c8d13;})['then'](respondWithResult(_0x479b46,0xc9))['catch'](handleError(_0x479b46,null));};exports[_0x9f10('0x23')]=function(_0x22e236,_0x4bd874){if(_0x22e236['body']['id']){delete _0x22e236[_0x9f10('0x49')]['id'];}return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0x22e236['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x4bd874,null))[_0x9f10('0x25')](saveUpdates(_0x22e236[_0x9f10('0x49')],null))['then'](respondWithResult(_0x4bd874,null))[_0x9f10('0x44')](handleError(_0x4bd874,null));};exports[_0x9f10('0x24')]=function(_0xe18852,_0x48a76e){return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0xe18852['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x48a76e,null))[_0x9f10('0x25')](removeEntity(_0x48a76e,null))[_0x9f10('0x44')](handleError(_0x48a76e,null));};
\ No newline at end of file
+var _0x4b1f=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','findAll','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x4b1f,0x195));var _0xf4b1=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x4b1f[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0xf4b1('0x0'));var rimraf=require(_0xf4b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4b1('0x2'));var rp=require(_0xf4b1('0x3'));var moment=require(_0xf4b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4b1('0x5'));var util=require(_0xf4b1('0x6'));var path=require(_0xf4b1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b1('0x8'));var fs=require('fs');var fs_extra=require(_0xf4b1('0x9'));var _=require(_0xf4b1('0xa'));var squel=require(_0xf4b1('0xb'));var crypto=require(_0xf4b1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4b1('0xd'));var Papa=require('papaparse');var Redis=require(_0xf4b1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4b1('0xf'));var hardwareService=require(_0xf4b1('0x10'));var logger=require(_0xf4b1('0x11'))(_0xf4b1('0x12'));var utils=require(_0xf4b1('0x13'));var config=require(_0xf4b1('0x14'));var licenseUtil=require(_0xf4b1('0x15'));var db=require(_0xf4b1('0x16'))['db'];function respondWithStatusCode(_0x38afbb,_0xf66b4c){_0xf66b4c=_0xf66b4c||0xcc;return function(_0x2c4eb9){if(_0x2c4eb9){return _0x38afbb[_0xf4b1('0x17')](_0xf66b4c);}return _0x38afbb[_0xf4b1('0x18')](_0xf66b4c)['end']();};}function respondWithResult(_0x591476,_0x3ea6f3){_0x3ea6f3=_0x3ea6f3||0xc8;return function(_0x5cbc25){if(_0x5cbc25){return _0x591476['status'](_0x3ea6f3)[_0xf4b1('0x19')](_0x5cbc25);}};}function respondWithFilteredResult(_0x51c39f,_0x5764b1){return function(_0x293f59){if(_0x293f59){var _0x4968f4=typeof _0x5764b1['offset']==='undefined'&&typeof _0x5764b1['limit']===_0xf4b1('0x1a');var _0x3ee70a=_0x293f59['count'];var _0x3b378e=_0x4968f4?0x0:_0x5764b1[_0xf4b1('0x1b')];var _0x322b38=_0x4968f4?_0x293f59[_0xf4b1('0x1c')]:_0x5764b1[_0xf4b1('0x1b')]+_0x5764b1[_0xf4b1('0x1d')];var _0x5b0214;if(_0x322b38>=_0x3ee70a){_0x322b38=_0x3ee70a;_0x5b0214=0xc8;}else{_0x5b0214=0xce;}_0x51c39f[_0xf4b1('0x18')](_0x5b0214);return _0x51c39f[_0xf4b1('0x1e')]('Content-Range',_0x3b378e+'-'+_0x322b38+'/'+_0x3ee70a)[_0xf4b1('0x19')](_0x293f59);}return null;};}function patchUpdates(_0x30c239){return function(_0x56ef48){try{jsonpatch[_0xf4b1('0x1f')](_0x56ef48,_0x30c239,!![]);}catch(_0x559a64){return BPromise[_0xf4b1('0x20')](_0x559a64);}return _0x56ef48[_0xf4b1('0x21')]();};}function saveUpdates(_0x5c50e8,_0x20013c){return function(_0x29b8c1){if(_0x29b8c1){return _0x29b8c1[_0xf4b1('0x22')](_0x5c50e8)[_0xf4b1('0x23')](function(_0x58376d){return _0x58376d;});}return null;};}function removeEntity(_0x92b390,_0x474212){return function(_0x4b6c08){if(_0x4b6c08){return _0x4b6c08[_0xf4b1('0x24')]()['then'](function(){var _0x15cfc4=_0x4b6c08['get']({'plain':!![]});var _0x238fbe=_0xf4b1('0x25');return db[_0xf4b1('0x26')]['destroy']({'where':{'type':_0x238fbe,'resourceId':_0x15cfc4['id']}})[_0xf4b1('0x23')](function(){return _0x4b6c08;});})['then'](function(){_0x92b390[_0xf4b1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29493b,_0x447ae7){return function(_0x5d28af){if(!_0x5d28af){_0x29493b[_0xf4b1('0x17')](0x194);}return _0x5d28af;};}function handleError(_0x23693b,_0x5bd8ee){_0x5bd8ee=_0x5bd8ee||0x1f4;return function(_0x125bf4){logger[_0xf4b1('0x27')](_0x125bf4[_0xf4b1('0x28')]);if(_0x125bf4[_0xf4b1('0x29')]){delete _0x125bf4[_0xf4b1('0x29')];}_0x23693b[_0xf4b1('0x18')](_0x5bd8ee)[_0xf4b1('0x2a')](_0x125bf4);};}exports['index']=function(_0x56ee5e,_0x31c13c){var _0xff9a65={},_0x1cbcff={},_0x29b9f9={'count':0x0,'rows':[]};var _0x35d81b=_['map'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')],function(_0xa6bdd7){return{'name':_0xa6bdd7[_0xf4b1('0x2d')],'type':_0xa6bdd7[_0xf4b1('0x2e')][_0xf4b1('0x2f')]};});_0x1cbcff[_0xf4b1('0x30')]=_[_0xf4b1('0x31')](_0x35d81b,'name');_0x1cbcff[_0xf4b1('0x32')]=_['keys'](_0x56ee5e['query']);_0x1cbcff['filters']=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],_0x1cbcff[_0xf4b1('0x32')]);_0xff9a65[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],qs[_0xf4b1('0x35')](_0x56ee5e[_0xf4b1('0x32')]['fields']));_0xff9a65[_0xf4b1('0x34')]=_0xff9a65['attributes'][_0xf4b1('0x36')]?_0xff9a65[_0xf4b1('0x34')]:_0x1cbcff['model'];if(!_0x56ee5e[_0xf4b1('0x32')][_0xf4b1('0x37')](_0xf4b1('0x38'))){_0xff9a65[_0xf4b1('0x1d')]=qs[_0xf4b1('0x1d')](_0x56ee5e['query'][_0xf4b1('0x1d')]);_0xff9a65['offset']=qs[_0xf4b1('0x1b')](_0x56ee5e['query'][_0xf4b1('0x1b')]);}_0xff9a65[_0xf4b1('0x39')]=qs[_0xf4b1('0x3a')](_0x56ee5e['query'][_0xf4b1('0x3a')]);_0xff9a65[_0xf4b1('0x3b')]=qs[_0xf4b1('0x3c')](_[_0xf4b1('0x3d')](_0x56ee5e[_0xf4b1('0x32')],_0x1cbcff[_0xf4b1('0x3c')]),_0x35d81b);if(_0x56ee5e[_0xf4b1('0x32')]['filter']){_0xff9a65[_0xf4b1('0x3b')]=_[_0xf4b1('0x3e')](_0xff9a65[_0xf4b1('0x3b')],{'$or':_[_0xf4b1('0x31')](_0x35d81b,function(_0x39de7f){if(_0x39de7f[_0xf4b1('0x2e')]!=='VIRTUAL'){var _0x33879b={};_0x33879b[_0x39de7f[_0xf4b1('0x29')]]={'$like':'%'+_0x56ee5e['query']['filter']+'%'};return _0x33879b;}})});}_0xff9a65=_[_0xf4b1('0x3e')]({},_0xff9a65,_0x56ee5e[_0xf4b1('0x3f')]);var _0x439c9d={'where':_0xff9a65[_0xf4b1('0x3b')]};return db[_0xf4b1('0x2b')][_0xf4b1('0x1c')](_0x439c9d)[_0xf4b1('0x23')](function(_0x1600b6){_0x29b9f9['count']=_0x1600b6;if(_0x56ee5e[_0xf4b1('0x32')]['includeAll']){_0xff9a65['include']=[{'all':!![]}];}return db['Tag'][_0xf4b1('0x40')](_0xff9a65);})[_0xf4b1('0x23')](function(_0x28b9f2){_0x29b9f9['rows']=_0x28b9f2;return _0x29b9f9;})[_0xf4b1('0x23')](respondWithFilteredResult(_0x31c13c,_0xff9a65))[_0xf4b1('0x41')](handleError(_0x31c13c,null));};exports[_0xf4b1('0x42')]=function(_0x5597d5,_0x13c130){var _0x15845a={'raw':!![],'where':{'id':_0x5597d5['params']['id']}},_0x1f856c={};_0x1f856c[_0xf4b1('0x30')]=_['keys'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')]);_0x1f856c[_0xf4b1('0x32')]=_['keys'](_0x5597d5[_0xf4b1('0x32')]);_0x1f856c[_0xf4b1('0x3c')]=_['intersection'](_0x1f856c[_0xf4b1('0x30')],_0x1f856c[_0xf4b1('0x32')]);_0x15845a[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1f856c['model'],qs['fields'](_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x35')]));_0x15845a['attributes']=_0x15845a[_0xf4b1('0x34')]['length']?_0x15845a[_0xf4b1('0x34')]:_0x1f856c['model'];if(_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x43')]){_0x15845a['include']=[{'all':!![]}];}_0x15845a=_[_0xf4b1('0x3e')]({},_0x15845a,_0x5597d5[_0xf4b1('0x3f')]);return db[_0xf4b1('0x2b')][_0xf4b1('0x44')](_0x15845a)[_0xf4b1('0x23')](handleEntityNotFound(_0x13c130,null))[_0xf4b1('0x23')](respondWithResult(_0x13c130,null))[_0xf4b1('0x41')](handleError(_0x13c130,null));};exports[_0xf4b1('0x45')]=function(_0x4e6e04,_0x4a9761){return db[_0xf4b1('0x2b')][_0xf4b1('0x45')](_0x4e6e04['body'],{})[_0xf4b1('0x23')](function(_0x3476b3){var _0x21dc3b=_0x4e6e04[_0xf4b1('0x46')][_0xf4b1('0x47')]({'plain':!![]});if(!_0x21dc3b)throw new Error(_0xf4b1('0x48'));if(_0x21dc3b[_0xf4b1('0x49')]===_0xf4b1('0x46')){var _0x29c3c1=_0x3476b3[_0xf4b1('0x47')]({'plain':!![]});var _0x407ecf=_0xf4b1('0x25');return db[_0xf4b1('0x4a')][_0xf4b1('0x44')]({'where':{'name':_0x407ecf,'userProfileId':_0x21dc3b[_0xf4b1('0x4b')]},'raw':!![]})[_0xf4b1('0x23')](function(_0xacaa0e){if(_0xacaa0e&&_0xacaa0e[_0xf4b1('0x4c')]===0x0){return db[_0xf4b1('0x26')][_0xf4b1('0x45')]({'name':_0x29c3c1[_0xf4b1('0x29')],'resourceId':_0x29c3c1['id'],'type':_0xacaa0e[_0xf4b1('0x29')],'sectionId':_0xacaa0e['id']},{})[_0xf4b1('0x23')](function(){return _0x3476b3;});}else{return _0x3476b3;}})[_0xf4b1('0x41')](function(_0x389ad7){logger[_0xf4b1('0x27')](_0xf4b1('0x4d'),_0x389ad7);throw _0x389ad7;});}return _0x3476b3;})[_0xf4b1('0x23')](respondWithResult(_0x4a9761,0xc9))['catch'](handleError(_0x4a9761,null));};exports[_0xf4b1('0x22')]=function(_0x479e71,_0x5bdd65){if(_0x479e71[_0xf4b1('0x4e')]['id']){delete _0x479e71[_0xf4b1('0x4e')]['id'];}return db['Tag'][_0xf4b1('0x44')]({'where':{'id':_0x479e71[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x5bdd65,null))['then'](saveUpdates(_0x479e71['body'],null))[_0xf4b1('0x23')](respondWithResult(_0x5bdd65,null))[_0xf4b1('0x41')](handleError(_0x5bdd65,null));};exports[_0xf4b1('0x24')]=function(_0x38938f,_0x402e6c){return db[_0xf4b1('0x2b')][_0xf4b1('0x44')]({'where':{'id':_0x38938f[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x402e6c,null))[_0xf4b1('0x23')](removeEntity(_0x402e6c,null))[_0xf4b1('0x41')](handleError(_0x402e6c,null));};
\ No newline at end of file
index a27a7fc..21443e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6557=['exports','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x932429,_0x29c5d5){var _0x375a74=function(_0x2ecf62){while(--_0x2ecf62){_0x932429['push'](_0x932429['shift']());}};_0x375a74(++_0x29c5d5);}(_0x6557,0x145));var _0x7655=function(_0x2954c2,_0x13fb77){_0x2954c2=_0x2954c2-0x0;var _0x44604d=_0x6557[_0x2954c2];return _0x44604d;};'use strict';var _=require(_0x7655('0x0'));var util=require(_0x7655('0x1'));var logger=require(_0x7655('0x2'))(_0x7655('0x3'));var moment=require(_0x7655('0x4'));var BPromise=require(_0x7655('0x5'));var rp=require(_0x7655('0x6'));var fs=require('fs');var path=require(_0x7655('0x7'));var rimraf=require(_0x7655('0x8'));var config=require(_0x7655('0x9'));var attributes=require(_0x7655('0xa'));module[_0x7655('0xb')]=function(_0x59875e,_0x308b4d){return _0x59875e['define'](_0x7655('0xc'),attributes,{'tableName':_0x7655('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdce3=['./tag.attributes','exports','define','lodash','bluebird','request-promise','path','../../config/environment'];(function(_0x2f0057,_0x448b27){var _0x17f2c3=function(_0x12efc3){while(--_0x12efc3){_0x2f0057['push'](_0x2f0057['shift']());}};_0x17f2c3(++_0x448b27);}(_0xdce3,0xd3));var _0x3dce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdce3[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x3dce('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3dce('0x1'));var rp=require(_0x3dce('0x2'));var fs=require('fs');var path=require(_0x3dce('0x3'));var rimraf=require('rimraf');var config=require(_0x3dce('0x4'));var attributes=require(_0x3dce('0x5'));module[_0x3dce('0x6')]=function(_0x1670e0,_0x33e387){return _0x1670e0[_0x3dce('0x7')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8cd5fff..85fb50c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf725=['http','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x552f1c,_0x31b738){var _0xe523d7=function(_0x2f3bf){while(--_0x2f3bf){_0x552f1c['push'](_0x552f1c['shift']());}};_0xe523d7(++_0x31b738);}(_0xf725,0x7e));var _0x5f72=function(_0x4acd04,_0x3fe67f){_0x4acd04=_0x4acd04-0x0;var _0x2ab659=_0xf725[_0x4acd04];return _0x2ab659;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require(_0x5f72('0x7'));var logger=require(_0x5f72('0x8'))(_0x5f72('0x9'));var config=require('../../config/environment');var jayson=require(_0x5f72('0xa'));var client=jayson[_0x5f72('0xb')][_0x5f72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193393,_0x148af8,_0x4961d1){return new BPromise(function(_0x158aa3,_0x523365){return client['request'](_0x193393,_0x4961d1)[_0x5f72('0xd')](function(_0x3f189d){logger['info'](_0x5f72('0xe'),_0x148af8,_0x5f72('0xf'));logger['debug'](_0x5f72('0x10'),_0x148af8,_0x5f72('0xf'),JSON[_0x5f72('0x11')](_0x3f189d));if(_0x3f189d[_0x5f72('0x12')]){if(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x13')]===0x1f4){logger[_0x5f72('0x12')]('Tag,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);return _0x523365(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);}logger[_0x5f72('0x12')]('Tag,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')]['message']);return _0x158aa3(_0x3f189d['error'][_0x5f72('0x14')]);}else{logger['info'](_0x5f72('0xe'),_0x148af8,'request\x20sent');_0x158aa3(_0x3f189d[_0x5f72('0x15')]['message']);}})[_0x5f72('0x16')](function(_0x2c7ac6){logger['error'](_0x5f72('0xe'),_0x148af8,_0x2c7ac6);_0x523365(_0x2c7ac6);});});}
\ No newline at end of file
+var _0x22fb=['Tag,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2fc602,_0x275684){var _0x295ac6=function(_0x3e1c43){while(--_0x3e1c43){_0x2fc602['push'](_0x2fc602['shift']());}};_0x295ac6(++_0x275684);}(_0x22fb,0x192));var _0xb22f=function(_0x36ccbd,_0xfccb46){_0x36ccbd=_0x36ccbd-0x0;var _0x5d520f=_0x22fb[_0x36ccbd];return _0x5d520f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('Tag,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});}
\ No newline at end of file
index 0d17568..8bbb9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
index 0ce2883..3a0ef48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0x52e482,_0x55f548){var _0x117c9f=function(_0x1801bc){while(--_0x1801bc){_0x52e482['push'](_0x52e482['shift']());}};_0x117c9f(++_0x55f548);}(_0x757a,0xde));var _0xa757=function(_0x1aa727,_0x3ce7a9){_0x1aa727=_0x1aa727-0x0;var _0x459358=_0x757a[_0x1aa727];return _0x459358;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0713=['STRING','name'];(function(_0x4b63b2,_0x1f7aad){var _0xc7548c=function(_0x1ce043){while(--_0x1ce043){_0x4b63b2['push'](_0x4b63b2['shift']());}};_0xc7548c(++_0x1f7aad);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
index bbc6c98..e891dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd899=['then','error','stack','name','send','Team','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','user','get','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','ValidationError','Unknown\x20channel','capitalize','channel','Queue','order','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Chat','Openchannel','Whatsapp','Voice','penalty','TeamVoiceQueue','User','emit','Queue:save','QueueId','voicePause','interface','format','all','spread','removeAgents','Sms','Fax','Queue:remove','UserVoiceQueueRt','getAgents','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','limit','count','offset','set','Content-Range','apply','reject','save'];(function(_0x29283b,_0x4ff9a5){var _0x12f136=function(_0x41377d){while(--_0x41377d){_0x29283b['push'](_0x29283b['shift']());}};_0x12f136(++_0x4ff9a5);}(_0xd899,0x108));var _0x9d89=function(_0x3ffa73,_0x380d89){_0x3ffa73=_0x3ffa73-0x0;var _0x583873=_0xd899[_0x3ffa73];return _0x583873;};'use strict';var emlformat=require(_0x9d89('0x0'));var rimraf=require(_0x9d89('0x1'));var zipdir=require(_0x9d89('0x2'));var jsonpatch=require(_0x9d89('0x3'));var rp=require(_0x9d89('0x4'));var moment=require(_0x9d89('0x5'));var BPromise=require(_0x9d89('0x6'));var Mustache=require(_0x9d89('0x7'));var util=require(_0x9d89('0x8'));var path=require(_0x9d89('0x9'));var sox=require(_0x9d89('0xa'));var csv=require(_0x9d89('0xb'));var ejs=require(_0x9d89('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d89('0xd'));var squel=require(_0x9d89('0xe'));var crypto=require(_0x9d89('0xf'));var jsforce=require(_0x9d89('0x10'));var deskjs=require(_0x9d89('0x11'));var toCsv=require(_0x9d89('0xb'));var querystring=require(_0x9d89('0x12'));var Papa=require('papaparse');var Redis=require(_0x9d89('0x13'));var authService=require(_0x9d89('0x14'));var qs=require(_0x9d89('0x15'));var as=require(_0x9d89('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d89('0x17'))(_0x9d89('0x18'));var utils=require(_0x9d89('0x19'));var config=require(_0x9d89('0x1a'));var licenseUtil=require(_0x9d89('0x1b'));var db=require(_0x9d89('0x1c'))['db'];config['redis']=_[_0x9d89('0x1d')](config[_0x9d89('0x1e')],{'host':_0x9d89('0x1f'),'port':0x18eb});var socket=require(_0x9d89('0x20'))(new Redis(config[_0x9d89('0x1e')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x22f24a,_0x464b28){_0x464b28=_0x464b28||0xcc;return function(_0x4c2c99){if(_0x4c2c99){return _0x22f24a[_0x9d89('0x21')](_0x464b28);}return _0x22f24a[_0x9d89('0x22')](_0x464b28)[_0x9d89('0x23')]();};}function respondWithResult(_0x16deda,_0x13ba57){_0x13ba57=_0x13ba57||0xc8;return function(_0xbb900d){if(_0xbb900d){return _0x16deda[_0x9d89('0x22')](_0x13ba57)['json'](_0xbb900d);}};}function respondWithFilteredResult(_0x171ed3,_0x5806eb){return function(_0xa11f4a){if(_0xa11f4a){var _0x2101f8=typeof _0x5806eb['offset']==='undefined'&&typeof _0x5806eb[_0x9d89('0x24')]==='undefined';var _0x139b23=_0xa11f4a[_0x9d89('0x25')];var _0x3d1688=_0x2101f8?0x0:_0x5806eb['offset'];var _0x30116d=_0x2101f8?_0xa11f4a['count']:_0x5806eb[_0x9d89('0x26')]+_0x5806eb['limit'];var _0x20b5cf;if(_0x30116d>=_0x139b23){_0x30116d=_0x139b23;_0x20b5cf=0xc8;}else{_0x20b5cf=0xce;}_0x171ed3['status'](_0x20b5cf);return _0x171ed3[_0x9d89('0x27')](_0x9d89('0x28'),_0x3d1688+'-'+_0x30116d+'/'+_0x139b23)['json'](_0xa11f4a);}return null;};}function patchUpdates(_0x2d667a){return function(_0x49b758){try{jsonpatch[_0x9d89('0x29')](_0x49b758,_0x2d667a,!![]);}catch(_0x4074ad){return BPromise[_0x9d89('0x2a')](_0x4074ad);}return _0x49b758[_0x9d89('0x2b')]();};}function saveUpdates(_0x9d0cb5,_0x21f655){return function(_0x18e08d){if(_0x18e08d){return _0x18e08d['update'](_0x9d0cb5)[_0x9d89('0x2c')](function(_0x58ea1a){return _0x58ea1a;});}return null;};}function handleEntityNotFound(_0x1ef64f,_0x58c6e8){return function(_0xd09059){if(!_0xd09059){_0x1ef64f[_0x9d89('0x21')](0x194);}return _0xd09059;};}function handleError(_0x209de8,_0xb04a8a){_0xb04a8a=_0xb04a8a||0x1f4;return function(_0x1a8f4e){logger[_0x9d89('0x2d')](_0x1a8f4e[_0x9d89('0x2e')]);if(_0x1a8f4e[_0x9d89('0x2f')]){delete _0x1a8f4e[_0x9d89('0x2f')];}_0x209de8[_0x9d89('0x22')](_0xb04a8a)[_0x9d89('0x30')](_0x1a8f4e);};}exports['index']=function(_0x5cbcbf,_0x43063f){var _0x4c2251={},_0x1ae569={},_0x38653c={'count':0x0,'rows':[]};var _0x1295b8=_['map'](db[_0x9d89('0x31')][_0x9d89('0x32')],function(_0x326366){return{'name':_0x326366[_0x9d89('0x33')],'type':_0x326366['type'][_0x9d89('0x34')]};});_0x1ae569[_0x9d89('0x35')]=_[_0x9d89('0x36')](_0x1295b8,_0x9d89('0x2f'));_0x1ae569[_0x9d89('0x37')]=_[_0x9d89('0x38')](_0x5cbcbf[_0x9d89('0x37')]);_0x1ae569[_0x9d89('0x39')]=_['intersection'](_0x1ae569[_0x9d89('0x35')],_0x1ae569[_0x9d89('0x37')]);_0x4c2251['attributes']=_[_0x9d89('0x3a')](_0x1ae569[_0x9d89('0x35')],qs[_0x9d89('0x3b')](_0x5cbcbf[_0x9d89('0x37')][_0x9d89('0x3b')]));_0x4c2251[_0x9d89('0x3c')]=_0x4c2251[_0x9d89('0x3c')][_0x9d89('0x3d')]?_0x4c2251['attributes']:_0x1ae569[_0x9d89('0x35')];if(!_0x5cbcbf['query'][_0x9d89('0x3e')](_0x9d89('0x3f'))){_0x4c2251['limit']=qs[_0x9d89('0x24')](_0x5cbcbf[_0x9d89('0x37')][_0x9d89('0x24')]);_0x4c2251['offset']=qs['offset'](_0x5cbcbf[_0x9d89('0x37')][_0x9d89('0x26')]);}_0x4c2251['order']=qs[_0x9d89('0x40')](_0x5cbcbf['query'][_0x9d89('0x40')]);_0x4c2251['where']=qs[_0x9d89('0x39')](_[_0x9d89('0x41')](_0x5cbcbf[_0x9d89('0x37')],_0x1ae569[_0x9d89('0x39')]),_0x1295b8);if(_0x5cbcbf[_0x9d89('0x37')][_0x9d89('0x42')]){_0x4c2251[_0x9d89('0x43')]=_[_0x9d89('0x44')](_0x4c2251[_0x9d89('0x43')],{'$or':_['map'](_0x1295b8,function(_0x44e9ac){if(_0x44e9ac[_0x9d89('0x45')]!==_0x9d89('0x46')){var _0x1be2cf={};_0x1be2cf[_0x44e9ac[_0x9d89('0x2f')]]={'$like':'%'+_0x5cbcbf['query'][_0x9d89('0x42')]+'%'};return _0x1be2cf;}})});}_0x4c2251=_[_0x9d89('0x44')]({},_0x4c2251,_0x5cbcbf[_0x9d89('0x47')]);var _0x247de2={'where':_0x4c2251[_0x9d89('0x43')]};return db[_0x9d89('0x31')][_0x9d89('0x25')](_0x247de2)['then'](function(_0xfa0f94){_0x38653c[_0x9d89('0x25')]=_0xfa0f94;if(_0x5cbcbf[_0x9d89('0x37')][_0x9d89('0x48')]){_0x4c2251[_0x9d89('0x49')]=[{'all':!![]}];}return db[_0x9d89('0x31')][_0x9d89('0x4a')](_0x4c2251);})['then'](function(_0x907b38){_0x38653c['rows']=_0x907b38;return _0x38653c;})[_0x9d89('0x2c')](respondWithFilteredResult(_0x43063f,_0x4c2251))['catch'](handleError(_0x43063f,null));};exports[_0x9d89('0x4b')]=function(_0x203eb7,_0x39296d){var _0x3bb1f6={'raw':![],'where':{'id':_0x203eb7[_0x9d89('0x4c')]['id']}},_0x2e45e2={};_0x2e45e2[_0x9d89('0x35')]=_[_0x9d89('0x38')](db['Team']['rawAttributes']);_0x2e45e2['query']=_[_0x9d89('0x38')](_0x203eb7['query']);_0x2e45e2[_0x9d89('0x39')]=_['intersection'](_0x2e45e2[_0x9d89('0x35')],_0x2e45e2[_0x9d89('0x37')]);_0x3bb1f6[_0x9d89('0x3c')]=_[_0x9d89('0x3a')](_0x2e45e2[_0x9d89('0x35')],qs[_0x9d89('0x3b')](_0x203eb7[_0x9d89('0x37')][_0x9d89('0x3b')]));_0x3bb1f6[_0x9d89('0x3c')]=_0x3bb1f6[_0x9d89('0x3c')][_0x9d89('0x3d')]?_0x3bb1f6[_0x9d89('0x3c')]:_0x2e45e2[_0x9d89('0x35')];if(_0x203eb7[_0x9d89('0x37')][_0x9d89('0x48')]){_0x3bb1f6[_0x9d89('0x49')]=[{'all':!![]}];}_0x3bb1f6=_[_0x9d89('0x44')]({},_0x3bb1f6,_0x203eb7[_0x9d89('0x47')]);return db[_0x9d89('0x31')]['find'](_0x3bb1f6)[_0x9d89('0x2c')](handleEntityNotFound(_0x39296d,null))['then'](respondWithResult(_0x39296d,null))['catch'](handleError(_0x39296d,null));};exports[_0x9d89('0x4d')]=function(_0x2b7bb1,_0x55cecf){return db[_0x9d89('0x31')]['create'](_0x2b7bb1[_0x9d89('0x4e')],{})['then'](function(_0x293f80){var _0x253eaa=_0x2b7bb1[_0x9d89('0x4f')][_0x9d89('0x50')]({'plain':!![]});if(!_0x253eaa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x253eaa[_0x9d89('0x51')]===_0x9d89('0x4f')){var _0x3a2202=_0x293f80[_0x9d89('0x50')]({'plain':!![]});var _0x4b0870=_0x9d89('0x52');return db[_0x9d89('0x53')][_0x9d89('0x54')]({'where':{'name':_0x4b0870,'userProfileId':_0x253eaa[_0x9d89('0x55')]},'raw':!![]})[_0x9d89('0x2c')](function(_0x415b92){if(_0x415b92&&_0x415b92[_0x9d89('0x56')]===0x0){return db['UserProfileResource'][_0x9d89('0x4d')]({'name':_0x3a2202['name'],'resourceId':_0x3a2202['id'],'type':_0x415b92[_0x9d89('0x2f')],'sectionId':_0x415b92['id']},{})[_0x9d89('0x2c')](function(){return _0x293f80;});}else{return _0x293f80;}})[_0x9d89('0x57')](function(_0x2bf2dc){logger[_0x9d89('0x2d')](_0x9d89('0x58'),_0x2bf2dc);throw _0x2bf2dc;});}return _0x293f80;})['then'](respondWithResult(_0x55cecf,0xc9))[_0x9d89('0x57')](handleError(_0x55cecf,null));};exports[_0x9d89('0x59')]=function(_0x54e121,_0x52a15e){if(_0x54e121['body']['id']){delete _0x54e121[_0x9d89('0x4e')]['id'];}return db['Team'][_0x9d89('0x54')]({'where':{'id':_0x54e121[_0x9d89('0x4c')]['id']}})[_0x9d89('0x2c')](handleEntityNotFound(_0x52a15e,null))[_0x9d89('0x2c')](saveUpdates(_0x54e121[_0x9d89('0x4e')],null))[_0x9d89('0x2c')](respondWithResult(_0x52a15e,null))[_0x9d89('0x57')](handleError(_0x52a15e,null));};exports[_0x9d89('0x5a')]=function(_0x587604,_0x270939){var _0x45c194=_0x587604[_0x9d89('0x4c')]['id'];var _0x4c2c57=[];return db['sequelize'][_0x9d89('0x5b')](function(_0xbb2935){var _0x479c35=_0x9d89('0x5c')+_0x45c194;return db[_0x9d89('0x5d')]['query'](_0x479c35,{'type':db['Sequelize'][_0x9d89('0x5e')][_0x9d89('0x5f')],'raw':!![],'transaction':_0xbb2935})[_0x9d89('0x2c')](function(_0x4176cc){_0x4c2c57=_[_0x9d89('0x36')](_0x4176cc,function(_0x5d56f7){return Number(_0x5d56f7['UserId']);});})[_0x9d89('0x2c')](function(){var _0x29d022=_0x9d89('0x60')+_0x45c194;return db['sequelize'][_0x9d89('0x37')](_0x29d022,{'type':db['Sequelize'][_0x9d89('0x5e')][_0x9d89('0x5f')],'raw':!![],'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(_0x35228f){var _0x2d35c1=_['map'](_0x35228f,function(_0x2520d2){return Number(_0x2520d2[_0x9d89('0x61')]);});return db[_0x9d89('0x62')][_0x9d89('0x5a')]({'where':{'UserId':{'$in':_0x4c2c57},'VoiceQueueId':{'$in':_0x2d35c1}},'transaction':_0xbb2935});})['then'](function(){var _0x389b28=_0x9d89('0x63')+_0x45c194;return db[_0x9d89('0x5d')][_0x9d89('0x37')](_0x389b28,{'type':db['Sequelize'][_0x9d89('0x5e')][_0x9d89('0x5f')],'raw':!![],'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(_0x510a65){var _0x58fd08=_['map'](_0x510a65,function(_0x48e7ed){return Number(_0x48e7ed['MailQueueId']);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x4c2c57},'MailQueueId':{'$in':_0x58fd08}},'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(){var _0x134bb7=_0x9d89('0x64')+_0x45c194;return db[_0x9d89('0x5d')][_0x9d89('0x37')](_0x134bb7,{'type':db[_0x9d89('0x65')][_0x9d89('0x5e')]['SELECT'],'raw':!![],'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(_0xb729d2){var _0x24e8de=_[_0x9d89('0x36')](_0xb729d2,function(_0x51c905){return Number(_0x51c905['SmsQueueId']);});return db[_0x9d89('0x66')][_0x9d89('0x5a')]({'where':{'UserId':{'$in':_0x4c2c57},'SmsQueueId':{'$in':_0x24e8de}},'transaction':_0xbb2935});})['then'](function(){var _0x4d9201=_0x9d89('0x67')+_0x45c194;return db['sequelize'][_0x9d89('0x37')](_0x4d9201,{'type':db['Sequelize'][_0x9d89('0x5e')][_0x9d89('0x5f')],'raw':!![],'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(_0x103fab){var _0x362669=_[_0x9d89('0x36')](_0x103fab,function(_0x346b90){return Number(_0x346b90['ChatQueueId']);});return db[_0x9d89('0x68')][_0x9d89('0x5a')]({'where':{'UserId':{'$in':_0x4c2c57},'ChatQueueId':{'$in':_0x362669}},'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(){var _0x5431df=_0x9d89('0x69')+_0x45c194;return db[_0x9d89('0x5d')][_0x9d89('0x37')](_0x5431df,{'type':db[_0x9d89('0x65')][_0x9d89('0x5e')]['SELECT'],'raw':!![],'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(_0x11a232){var _0x14eb60=_[_0x9d89('0x36')](_0x11a232,function(_0x2b9325){return Number(_0x2b9325[_0x9d89('0x6a')]);});return db[_0x9d89('0x6b')][_0x9d89('0x5a')]({'where':{'UserId':{'$in':_0x4c2c57},'FaxQueueId':{'$in':_0x14eb60}},'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(){var _0x3a5ba3=_0x9d89('0x6c')+_0x45c194;return db['sequelize']['query'](_0x3a5ba3,{'type':db['Sequelize'][_0x9d89('0x5e')][_0x9d89('0x5f')],'raw':!![],'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(_0xa2ca03){var _0x352886=_[_0x9d89('0x36')](_0xa2ca03,function(_0x1a15f0){return Number(_0x1a15f0['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x9d89('0x5a')]({'where':{'UserId':{'$in':_0x4c2c57},'OpenchannelQueueId':{'$in':_0x352886}},'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(){var _0x64db34=_0x9d89('0x6d')+_0x45c194;return db[_0x9d89('0x5d')]['query'](_0x64db34,{'type':db['Sequelize']['QueryTypes'][_0x9d89('0x5f')],'raw':!![],'transaction':_0xbb2935});})['then'](function(_0x33315f){var _0x2e216f=_[_0x9d89('0x36')](_0x33315f,function(_0x267260){return Number(_0x267260[_0x9d89('0x6e')]);});return db[_0x9d89('0x6f')][_0x9d89('0x5a')]({'where':{'UserId':{'$in':_0x4c2c57},'WhatsappQueueId':{'$in':_0x2e216f}},'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(){return db[_0x9d89('0x70')]['find']({'where':{'TeamId':_0x45c194}});})[_0x9d89('0x2c')](function(_0x49d0f3){if(_0x49d0f3===null){return;}return db[_0x9d89('0x71')][_0x9d89('0x5a')]({'where':{'UserId':{'$in':_0x4c2c57},'VoicePrefixId':_0x49d0f3[_0x9d89('0x72')]},'transaction':_0xbb2935});})[_0x9d89('0x2c')](function(){return db[_0x9d89('0x31')]['destroy']({'where':{'id':_0x45c194},'cascade':!![],'transaction':_0xbb2935});})['then'](function(_0x1eb8d8){if(_0x1eb8d8===0x0){_0x270939[_0x9d89('0x21')](0x194);}else{return db['UserProfileResource'][_0x9d89('0x5a')]({'where':{'type':_0x9d89('0x52'),'resourceId':_0x45c194},'cascade':!![],'transaction':_0xbb2935})[_0x9d89('0x2c')](function(){_0x270939[_0x9d89('0x22')](0xcc)[_0x9d89('0x23')]();});}})[_0x9d89('0x57')](function(_0x2a0453){_0x270939[_0x9d89('0x22')](0x1f4)[_0x9d89('0x30')](_0x2a0453);});});};exports[_0x9d89('0x73')]=function(_0xd60c00,_0x49b0b2,_0xff792f){return db[_0x9d89('0x31')][_0x9d89('0x74')]({'where':{'id':_0xd60c00[_0x9d89('0x4c')]['id']}})[_0x9d89('0x2c')](handleEntityNotFound(_0x49b0b2,null))['then'](function(_0x3cda8c){if(!_0xd60c00[_0x9d89('0x37')]['channel']||!utils[_0x9d89('0x75')](_0xd60c00[_0x9d89('0x37')]['channel'])){throw new db[(_0x9d89('0x65'))][(_0x9d89('0x76'))](_0x9d89('0x77'));}var _0x21d9f2={};var _0x119dbc={};_0x119dbc['model']=_['keys'](db[_[_0x9d89('0x78')](_0xd60c00[_0x9d89('0x37')][_0x9d89('0x79')]['toLowerCase']())+_0x9d89('0x7a')][_0x9d89('0x32')]);_0x119dbc[_0x9d89('0x37')]=_[_0x9d89('0x38')](_0xd60c00[_0x9d89('0x37')]);_0x119dbc[_0x9d89('0x39')]=_[_0x9d89('0x3a')](_0x119dbc[_0x9d89('0x35')],_0x119dbc[_0x9d89('0x37')]);_0x21d9f2[_0x9d89('0x3c')]=_['intersection'](_0x119dbc[_0x9d89('0x35')],qs[_0x9d89('0x3b')](_0xd60c00['query'][_0x9d89('0x3b')]));_0x21d9f2[_0x9d89('0x3c')]=_0x21d9f2[_0x9d89('0x3c')][_0x9d89('0x3d')]?_0x21d9f2['attributes']:_0x119dbc[_0x9d89('0x35')];_0x21d9f2['limit']=qs[_0x9d89('0x24')](_0xd60c00[_0x9d89('0x37')][_0x9d89('0x24')]);_0x21d9f2[_0x9d89('0x26')]=qs[_0x9d89('0x26')](_0xd60c00[_0x9d89('0x37')]['offset']);_0x21d9f2[_0x9d89('0x7b')]=qs[_0x9d89('0x40')](_0xd60c00[_0x9d89('0x37')][_0x9d89('0x40')]);_0x21d9f2[_0x9d89('0x43')]=qs[_0x9d89('0x39')](_[_0x9d89('0x41')](_0xd60c00[_0x9d89('0x37')],_0x119dbc['filters']));_0x21d9f2=_[_0x9d89('0x44')]({},_0x21d9f2,_0xd60c00[_0x9d89('0x47')]);return _0x3cda8c[_0x9d89('0x50')+_[_0x9d89('0x78')](_0xd60c00['query'][_0x9d89('0x79')][_0x9d89('0x7c')]())+_0x9d89('0x7d')](_0x21d9f2);})[_0x9d89('0x2c')](respondWithResult(_0x49b0b2,null))[_0x9d89('0x57')](handleError(_0x49b0b2,null));};exports[_0x9d89('0x7e')]=function(_0x494d45,_0x674366,_0x4352b4){return db[_0x9d89('0x31')][_0x9d89('0x74')]({'where':{'id':_0x494d45['params']['id']}})[_0x9d89('0x2c')](function(_0x56acac){if(_0x56acac){if(!_0x494d45['body']['channel']||!utils[_0x9d89('0x75')](_0x494d45['body'][_0x9d89('0x79')])){throw new db[(_0x9d89('0x65'))]['ValidationError'](_0x9d89('0x77'));}return _0x56acac[_0x9d89('0x7f')+_[_0x9d89('0x78')](_0x494d45[_0x9d89('0x4e')][_0x9d89('0x79')][_0x9d89('0x7c')]())+_0x9d89('0x7d')](_0x494d45[_0x9d89('0x4e')][_0x9d89('0x80')]);}return null;})['then'](handleEntityNotFound(_0x674366,null))[_0x9d89('0x2c')](respondWithStatusCode(_0x674366,null))[_0x9d89('0x57')](handleError(_0x674366,null));};exports[_0x9d89('0x81')]=function(_0x27641b,_0x5bf5dd,_0x4074e6){return db[_0x9d89('0x31')][_0x9d89('0x74')]({'where':{'id':_0x27641b[_0x9d89('0x4c')]['id']}})[_0x9d89('0x2c')](function(_0x3a881e){if(_0x3a881e){if(!_0x27641b[_0x9d89('0x37')][_0x9d89('0x79')]||!utils[_0x9d89('0x75')](_0x27641b[_0x9d89('0x37')][_0x9d89('0x79')])){throw new db[(_0x9d89('0x65'))][(_0x9d89('0x76'))](_0x9d89('0x77'));}return _0x3a881e[_0x9d89('0x82')+_[_0x9d89('0x78')](_0x27641b[_0x9d89('0x37')][_0x9d89('0x79')]['toLowerCase']())+'Queues'](_0x27641b[_0x9d89('0x37')][_0x9d89('0x80')]);}return null;})[_0x9d89('0x2c')](handleEntityNotFound(_0x5bf5dd,null))[_0x9d89('0x2c')](respondWithStatusCode(_0x5bf5dd,null))[_0x9d89('0x57')](handleError(_0x5bf5dd,null));};exports[_0x9d89('0x83')]=function(_0x4e7cb3,_0x312eeb){var _0x475b01=_[_0x9d89('0x84')](_0x4e7cb3['body']['ids'])?_0x4e7cb3[_0x9d89('0x4e')][_0x9d89('0x80')]:[_0x4e7cb3['body'][_0x9d89('0x80')]];var _0x2f670e=_0x4e7cb3[_0x9d89('0x4c')]['id'];return db[_0x9d89('0x31')][_0x9d89('0x54')]({'where':{'id':_0x2f670e}})[_0x9d89('0x2c')](handleEntityNotFound(_0x312eeb,null))['then'](function(_0x3e796b){if(_0x3e796b){var _0x3f33f9=['Voice',_0x9d89('0x85'),'Mail','Sms','Fax',_0x9d89('0x86'),_0x9d89('0x87')];return db[_0x9d89('0x5d')][_0x9d89('0x5b')](function(_0x27a7f1){var _0x268969=_[_0x9d89('0x36')](_0x3f33f9,function(_0x33649e){var _0xcd7a38={'attributes':['id',_0x9d89('0x2f')]};if(_0x33649e===_0x9d89('0x88')){_0xcd7a38['through']={'attributes':[_0x9d89('0x89')]};}return _0x3e796b['get'+_0x33649e+_0x9d89('0x7d')](_0xcd7a38)[_0x9d89('0x2c')](function(_0xc54364){var _0x22da6c=_['map'](_0xc54364,function(_0x15167a){var _0x1a6469=_[_0x9d89('0x36')](_0x475b01,function(_0x2eefbc){var _0x1152d7={'where':{'UserId':_0x2eefbc,[_0x33649e+'QueueId']:_0x15167a['id']},'transaction':_0x27a7f1};if(_0x33649e===_0x9d89('0x88')){_0x1152d7[_0x9d89('0x1d')]={'penalty':_0x15167a[_0x9d89('0x8a')]['penalty']};}return db[_0x9d89('0x8b')+_0x33649e+_0x9d89('0x7a')]['findOrCreate'](_0x1152d7)[_0x9d89('0x2c')](function(){socket[_0x9d89('0x8c')](_0x9d89('0x4f')+_0x33649e+_0x9d89('0x8d'),{'UserId':_0x2eefbc,[_0x33649e+_0x9d89('0x8e')]:_0x15167a['id']});if(_0x33649e!==_0x9d89('0x88')){return;}return db['User'][_0x9d89('0x4a')]({'where':{'id':_0x475b01,'online':0x1},'attributes':['id',_0x9d89('0x2f'),'online',_0x9d89('0x8f'),_0x9d89('0x90')],'raw':!![]})['then'](function(_0x3aec91){var _0x5442c7=_[_0x9d89('0x36')](_0x3aec91,function(_0x1c3827){return db['UserVoiceQueueRt']['upsert']({'membername':_0x1c3827[_0x9d89('0x2f')],'UserId':_0x1c3827['id'],'queue_name':_0x15167a['name'],'VoiceQueueId':_0x15167a['id'],'interface':_['isNil'](_0x1c3827[_0x9d89('0x90')])?util[_0x9d89('0x91')]('SIP/%s',_0x1c3827[_0x9d89('0x2f')]):_0x1c3827['interface'],'paused':_0x1c3827['voicePause']||![],'penalty':_0x15167a[_0x9d89('0x8a')][_0x9d89('0x89')]},{'transaction':_0x27a7f1});});return Promise[_0x9d89('0x92')](_0x5442c7);});});});return Promise[_0x9d89('0x92')](_0x1a6469);});return Promise[_0x9d89('0x92')](_0x22da6c);})[_0x9d89('0x2c')](function(){return db[_0x9d89('0x70')][_0x9d89('0x74')]({'where':{'teamId':_0x2f670e}})[_0x9d89('0x2c')](function(_0x4a155){if(_0x4a155){var _0x3c29d0=_[_0x9d89('0x36')](_0x475b01,function(_0x3cda6c){db['UserVoicePrefix']['upsert']({'UserId':_0x3cda6c,'VoicePrefixId':_0x4a155[_0x9d89('0x72')]});});return Promise[_0x9d89('0x92')](_0x3c29d0);}});});});return Promise[_0x9d89('0x92')](_0x268969)[_0x9d89('0x2c')](function(){return _0x3e796b[_0x9d89('0x83')](_0x475b01,{'transaction':_0x27a7f1})[_0x9d89('0x93')](function(_0xffb780){return _0xffb780;});});});}})[_0x9d89('0x2c')](respondWithResult(_0x312eeb,null))[_0x9d89('0x57')](handleError(_0x312eeb,null));};exports[_0x9d89('0x94')]=function(_0x5bedeb,_0x1b0573){var _0x24da4c=_[_0x9d89('0x84')](_0x5bedeb[_0x9d89('0x37')][_0x9d89('0x80')])?_0x5bedeb['query']['ids']:[_0x5bedeb['query']['ids']];var _0x3cea75=_0x5bedeb[_0x9d89('0x4c')]['id'];return db[_0x9d89('0x31')][_0x9d89('0x54')]({'where':{'id':_0x3cea75}})[_0x9d89('0x2c')](handleEntityNotFound(_0x1b0573,null))[_0x9d89('0x2c')](function(_0x25afc7){if(_0x25afc7){var _0x40462a=[_0x9d89('0x88'),_0x9d89('0x85'),'Mail',_0x9d89('0x95'),_0x9d89('0x96'),'Openchannel',_0x9d89('0x87')];return db[_0x9d89('0x5d')][_0x9d89('0x5b')](function(_0xc7ee6f){var _0x3d4e0b=_[_0x9d89('0x36')](_0x40462a,function(_0x29109c){var _0x5121cc={'attributes':['id',_0x9d89('0x2f')]};return _0x25afc7[_0x9d89('0x50')+_0x29109c+_0x9d89('0x7d')](_0x5121cc)[_0x9d89('0x2c')](function(_0x2854b6){var _0x3493de=_[_0x9d89('0x36')](_0x2854b6,function(_0x47d098){return _0x47d098['removeAgents'](_0x24da4c,{'transaction':_0xc7ee6f})[_0x9d89('0x2c')](function(){var _0x18c1d3=_[_0x9d89('0x36')](_0x24da4c,function(_0x1103a4){socket[_0x9d89('0x8c')]('user'+_0x29109c+_0x9d89('0x97'),{'UserId':Number(_0x1103a4),[_0x29109c+_0x9d89('0x8e')]:_0x47d098['id']});if(_0x29109c!=='Voice'){return;}return db[_0x9d89('0x98')][_0x9d89('0x5a')]({'where':{'VoiceQueueId':_0x47d098['id'],'UserId':_0x1103a4},'transaction':_0xc7ee6f});});return Promise['all'](_0x18c1d3);});});return Promise[_0x9d89('0x92')](_0x3493de);});});return Promise[_0x9d89('0x92')](_0x3d4e0b)[_0x9d89('0x2c')](function(){return _0x25afc7[_0x9d89('0x94')](_0x24da4c,{'transaction':_0xc7ee6f});})[_0x9d89('0x2c')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x3cea75}})[_0x9d89('0x2c')](function(_0x29127b){if(_0x29127b){var _0x245395=_[_0x9d89('0x36')](_0x24da4c,function(_0x1e40c7){db[_0x9d89('0x71')]['destroy']({'where':{'UserId':_0x1e40c7,'VoicePrefixId':_0x29127b[_0x9d89('0x72')]}});});return Promise[_0x9d89('0x92')](_0x245395);}});});});}})[_0x9d89('0x2c')](respondWithStatusCode(_0x1b0573,null))['catch'](handleError(_0x1b0573,null));};exports['getAgents']=function(_0x26b5b8,_0x54d7b8,_0x158850){var _0x3bd920={};var _0x1fb376={};var _0x1c0c53;var _0x34cad6;return db[_0x9d89('0x31')][_0x9d89('0x74')]({'where':{'id':_0x26b5b8['params']['id']}})[_0x9d89('0x2c')](handleEntityNotFound(_0x54d7b8,null))[_0x9d89('0x2c')](function(_0x26d326){if(_0x26d326){_0x1c0c53=_0x26d326;_0x1fb376['model']=_[_0x9d89('0x38')](db['User'][_0x9d89('0x32')]);_0x1fb376['query']=_['keys'](_0x26b5b8[_0x9d89('0x37')]);_0x1fb376[_0x9d89('0x39')]=_['intersection'](_0x1fb376[_0x9d89('0x35')],_0x1fb376[_0x9d89('0x37')]);_0x3bd920['attributes']=_[_0x9d89('0x3a')](_0x1fb376['model'],qs['fields'](_0x26b5b8[_0x9d89('0x37')][_0x9d89('0x3b')]));_0x3bd920[_0x9d89('0x3c')]=_0x3bd920[_0x9d89('0x3c')][_0x9d89('0x3d')]?_0x3bd920[_0x9d89('0x3c')]:_0x1fb376['model'];_0x3bd920['order']=qs[_0x9d89('0x40')](_0x26b5b8[_0x9d89('0x37')][_0x9d89('0x40')]);_0x3bd920[_0x9d89('0x43')]=qs[_0x9d89('0x39')](_[_0x9d89('0x41')](_0x26b5b8['query'],_0x1fb376[_0x9d89('0x39')]));if(_0x26b5b8[_0x9d89('0x37')][_0x9d89('0x42')]){_0x3bd920[_0x9d89('0x43')]=_[_0x9d89('0x44')](_0x3bd920[_0x9d89('0x43')],{'$or':_[_0x9d89('0x36')](_0x3bd920[_0x9d89('0x3c')],function(_0x416e82){var _0x52ae8f={};_0x52ae8f[_0x416e82]={'$like':'%'+_0x26b5b8[_0x9d89('0x37')]['filter']+'%'};return _0x52ae8f;})});}_0x3bd920=_[_0x9d89('0x44')]({},_0x3bd920,_0x26b5b8[_0x9d89('0x47')]);return _0x1c0c53[_0x9d89('0x99')](_0x3bd920);}})[_0x9d89('0x2c')](function(_0x286232){if(_0x286232){_0x34cad6=_0x286232[_0x9d89('0x3d')];if(!_0x26b5b8[_0x9d89('0x37')]['hasOwnProperty'](_0x9d89('0x3f'))){_0x3bd920[_0x9d89('0x24')]=qs[_0x9d89('0x24')](_0x26b5b8[_0x9d89('0x37')]['limit']);_0x3bd920[_0x9d89('0x26')]=qs[_0x9d89('0x26')](_0x26b5b8['query'][_0x9d89('0x26')]);}return _0x1c0c53[_0x9d89('0x99')](_0x3bd920);}})[_0x9d89('0x2c')](function(_0x4eded3){if(_0x4eded3){return _0x4eded3?{'count':_0x34cad6,'rows':_0x4eded3}:null;}})['then'](respondWithResult(_0x54d7b8,null))[_0x9d89('0x57')](handleError(_0x54d7b8,null));};
\ No newline at end of file
+var _0xa581=['Queue:remove','UserVoiceQueueRt','VoicePrefixId','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','limit','undefined','offset','count','set','apply','reject','update','then','sendStatus','error','name','map','Team','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserChatQueue','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','send','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','findOne','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','online','voicePause','isNil','interface','SIP/%s','all','upsert','spread','removeAgents','emit'];(function(_0x3ea78a,_0x10acb9){var _0x520301=function(_0x2a033){while(--_0x2a033){_0x3ea78a['push'](_0x3ea78a['shift']());}};_0x520301(++_0x10acb9);}(_0xa581,0x9f));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a58('0x0'));var zipdir=require(_0x1a58('0x1'));var jsonpatch=require(_0x1a58('0x2'));var rp=require(_0x1a58('0x3'));var moment=require(_0x1a58('0x4'));var BPromise=require(_0x1a58('0x5'));var Mustache=require(_0x1a58('0x6'));var util=require('util');var path=require(_0x1a58('0x7'));var sox=require(_0x1a58('0x8'));var csv=require(_0x1a58('0x9'));var ejs=require(_0x1a58('0xa'));var fs=require('fs');var fs_extra=require(_0x1a58('0xb'));var _=require(_0x1a58('0xc'));var squel=require('squel');var crypto=require(_0x1a58('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a58('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1a58('0xf'));var Papa=require(_0x1a58('0x10'));var Redis=require(_0x1a58('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1a58('0x12'));var as=require(_0x1a58('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a58('0x14'))('api');var utils=require(_0x1a58('0x15'));var config=require(_0x1a58('0x16'));var licenseUtil=require(_0x1a58('0x17'));var db=require(_0x1a58('0x18'))['db'];config['redis']=_[_0x1a58('0x19')](config[_0x1a58('0x1a')],{'host':_0x1a58('0x1b'),'port':0x18eb});var socket=require(_0x1a58('0x1c'))(new Redis(config[_0x1a58('0x1a')]));require(_0x1a58('0x1d'))[_0x1a58('0x1e')](socket);function respondWithStatusCode(_0xc54a63,_0x1cad6c){_0x1cad6c=_0x1cad6c||0xcc;return function(_0xddda3d){if(_0xddda3d){return _0xc54a63['sendStatus'](_0x1cad6c);}return _0xc54a63[_0x1a58('0x1f')](_0x1cad6c)[_0x1a58('0x20')]();};}function respondWithResult(_0x28943b,_0x2f2047){_0x2f2047=_0x2f2047||0xc8;return function(_0x8661c3){if(_0x8661c3){return _0x28943b[_0x1a58('0x1f')](_0x2f2047)[_0x1a58('0x21')](_0x8661c3);}};}function respondWithFilteredResult(_0x3129c3,_0x36f9f6){return function(_0xf16c96){if(_0xf16c96){var _0x180508=typeof _0x36f9f6['offset']==='undefined'&&typeof _0x36f9f6[_0x1a58('0x22')]===_0x1a58('0x23');var _0x11c9cd=_0xf16c96['count'];var _0x585806=_0x180508?0x0:_0x36f9f6[_0x1a58('0x24')];var _0x2a0f3a=_0x180508?_0xf16c96[_0x1a58('0x25')]:_0x36f9f6[_0x1a58('0x24')]+_0x36f9f6[_0x1a58('0x22')];var _0x71dc50;if(_0x2a0f3a>=_0x11c9cd){_0x2a0f3a=_0x11c9cd;_0x71dc50=0xc8;}else{_0x71dc50=0xce;}_0x3129c3['status'](_0x71dc50);return _0x3129c3[_0x1a58('0x26')]('Content-Range',_0x585806+'-'+_0x2a0f3a+'/'+_0x11c9cd)[_0x1a58('0x21')](_0xf16c96);}return null;};}function patchUpdates(_0x27a446){return function(_0x419476){try{jsonpatch[_0x1a58('0x27')](_0x419476,_0x27a446,!![]);}catch(_0x523cff){return BPromise[_0x1a58('0x28')](_0x523cff);}return _0x419476['save']();};}function saveUpdates(_0x1aa773,_0xa6a0fd){return function(_0x185e01){if(_0x185e01){return _0x185e01[_0x1a58('0x29')](_0x1aa773)[_0x1a58('0x2a')](function(_0x29b904){return _0x29b904;});}return null;};}function handleEntityNotFound(_0x592b32,_0x4fe25c){return function(_0x53e8b2){if(!_0x53e8b2){_0x592b32[_0x1a58('0x2b')](0x194);}return _0x53e8b2;};}function handleError(_0x459780,_0x272a04){_0x272a04=_0x272a04||0x1f4;return function(_0x31bcf8){logger[_0x1a58('0x2c')](_0x31bcf8['stack']);if(_0x31bcf8[_0x1a58('0x2d')]){delete _0x31bcf8[_0x1a58('0x2d')];}_0x459780['status'](_0x272a04)['send'](_0x31bcf8);};}exports['index']=function(_0x2fba4e,_0x230036){var _0xc61e41={},_0x229d73={},_0x48949f={'count':0x0,'rows':[]};var _0x5cba4f=_[_0x1a58('0x2e')](db[_0x1a58('0x2f')][_0x1a58('0x30')],function(_0x19aea7){return{'name':_0x19aea7[_0x1a58('0x31')],'type':_0x19aea7['type']['key']};});_0x229d73[_0x1a58('0x32')]=_['map'](_0x5cba4f,_0x1a58('0x2d'));_0x229d73[_0x1a58('0x33')]=_[_0x1a58('0x34')](_0x2fba4e[_0x1a58('0x33')]);_0x229d73[_0x1a58('0x35')]=_[_0x1a58('0x36')](_0x229d73['model'],_0x229d73[_0x1a58('0x33')]);_0xc61e41[_0x1a58('0x37')]=_[_0x1a58('0x36')](_0x229d73['model'],qs[_0x1a58('0x38')](_0x2fba4e[_0x1a58('0x33')][_0x1a58('0x38')]));_0xc61e41[_0x1a58('0x37')]=_0xc61e41[_0x1a58('0x37')]['length']?_0xc61e41[_0x1a58('0x37')]:_0x229d73[_0x1a58('0x32')];if(!_0x2fba4e[_0x1a58('0x33')]['hasOwnProperty'](_0x1a58('0x39'))){_0xc61e41['limit']=qs[_0x1a58('0x22')](_0x2fba4e[_0x1a58('0x33')][_0x1a58('0x22')]);_0xc61e41[_0x1a58('0x24')]=qs['offset'](_0x2fba4e[_0x1a58('0x33')][_0x1a58('0x24')]);}_0xc61e41[_0x1a58('0x3a')]=qs[_0x1a58('0x3b')](_0x2fba4e['query'][_0x1a58('0x3b')]);_0xc61e41[_0x1a58('0x3c')]=qs[_0x1a58('0x35')](_[_0x1a58('0x3d')](_0x2fba4e[_0x1a58('0x33')],_0x229d73['filters']),_0x5cba4f);if(_0x2fba4e[_0x1a58('0x33')][_0x1a58('0x3e')]){_0xc61e41['where']=_[_0x1a58('0x3f')](_0xc61e41['where'],{'$or':_[_0x1a58('0x2e')](_0x5cba4f,function(_0x2f2dd0){if(_0x2f2dd0[_0x1a58('0x40')]!=='VIRTUAL'){var _0x5b383a={};_0x5b383a[_0x2f2dd0[_0x1a58('0x2d')]]={'$like':'%'+_0x2fba4e[_0x1a58('0x33')][_0x1a58('0x3e')]+'%'};return _0x5b383a;}})});}_0xc61e41=_[_0x1a58('0x3f')]({},_0xc61e41,_0x2fba4e[_0x1a58('0x41')]);var _0x17c2af={'where':_0xc61e41[_0x1a58('0x3c')]};return db[_0x1a58('0x2f')][_0x1a58('0x25')](_0x17c2af)['then'](function(_0x2d0e43){_0x48949f[_0x1a58('0x25')]=_0x2d0e43;if(_0x2fba4e[_0x1a58('0x33')][_0x1a58('0x42')]){_0xc61e41['include']=[{'all':!![]}];}return db[_0x1a58('0x2f')][_0x1a58('0x43')](_0xc61e41);})[_0x1a58('0x2a')](function(_0xe765ec){_0x48949f[_0x1a58('0x44')]=_0xe765ec;return _0x48949f;})['then'](respondWithFilteredResult(_0x230036,_0xc61e41))['catch'](handleError(_0x230036,null));};exports[_0x1a58('0x45')]=function(_0x20295b,_0x2931c2){var _0x573a5b={'raw':![],'where':{'id':_0x20295b[_0x1a58('0x46')]['id']}},_0x141644={};_0x141644['model']=_[_0x1a58('0x34')](db[_0x1a58('0x2f')][_0x1a58('0x30')]);_0x141644[_0x1a58('0x33')]=_['keys'](_0x20295b['query']);_0x141644['filters']=_[_0x1a58('0x36')](_0x141644[_0x1a58('0x32')],_0x141644[_0x1a58('0x33')]);_0x573a5b[_0x1a58('0x37')]=_[_0x1a58('0x36')](_0x141644[_0x1a58('0x32')],qs[_0x1a58('0x38')](_0x20295b[_0x1a58('0x33')]['fields']));_0x573a5b[_0x1a58('0x37')]=_0x573a5b[_0x1a58('0x37')][_0x1a58('0x47')]?_0x573a5b[_0x1a58('0x37')]:_0x141644[_0x1a58('0x32')];if(_0x20295b[_0x1a58('0x33')][_0x1a58('0x42')]){_0x573a5b[_0x1a58('0x48')]=[{'all':!![]}];}_0x573a5b=_[_0x1a58('0x3f')]({},_0x573a5b,_0x20295b[_0x1a58('0x41')]);return db['Team'][_0x1a58('0x49')](_0x573a5b)[_0x1a58('0x2a')](handleEntityNotFound(_0x2931c2,null))[_0x1a58('0x2a')](respondWithResult(_0x2931c2,null))[_0x1a58('0x4a')](handleError(_0x2931c2,null));};exports[_0x1a58('0x4b')]=function(_0x3f9d0b,_0x40d9d2){return db['Team'][_0x1a58('0x4b')](_0x3f9d0b['body'],{})[_0x1a58('0x2a')](function(_0x284c38){var _0x43eb34=_0x3f9d0b[_0x1a58('0x4c')][_0x1a58('0x4d')]({'plain':!![]});if(!_0x43eb34)throw new Error(_0x1a58('0x4e'));if(_0x43eb34[_0x1a58('0x4f')]===_0x1a58('0x4c')){var _0x49012d=_0x284c38[_0x1a58('0x4d')]({'plain':!![]});var _0x54d7ea=_0x1a58('0x50');return db[_0x1a58('0x51')][_0x1a58('0x49')]({'where':{'name':_0x54d7ea,'userProfileId':_0x43eb34[_0x1a58('0x52')]},'raw':!![]})[_0x1a58('0x2a')](function(_0x460374){if(_0x460374&&_0x460374[_0x1a58('0x53')]===0x0){return db[_0x1a58('0x54')][_0x1a58('0x4b')]({'name':_0x49012d['name'],'resourceId':_0x49012d['id'],'type':_0x460374[_0x1a58('0x2d')],'sectionId':_0x460374['id']},{})[_0x1a58('0x2a')](function(){return _0x284c38;});}else{return _0x284c38;}})[_0x1a58('0x4a')](function(_0x5cc308){logger[_0x1a58('0x2c')](_0x1a58('0x55'),_0x5cc308);throw _0x5cc308;});}return _0x284c38;})[_0x1a58('0x2a')](respondWithResult(_0x40d9d2,0xc9))[_0x1a58('0x4a')](handleError(_0x40d9d2,null));};exports[_0x1a58('0x29')]=function(_0x42774a,_0x1d2ad7){if(_0x42774a[_0x1a58('0x56')]['id']){delete _0x42774a[_0x1a58('0x56')]['id'];}return db[_0x1a58('0x2f')][_0x1a58('0x49')]({'where':{'id':_0x42774a[_0x1a58('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d2ad7,null))[_0x1a58('0x2a')](saveUpdates(_0x42774a[_0x1a58('0x56')],null))[_0x1a58('0x2a')](respondWithResult(_0x1d2ad7,null))[_0x1a58('0x4a')](handleError(_0x1d2ad7,null));};exports[_0x1a58('0x57')]=function(_0x768e61,_0x41d561){var _0x411caf=_0x768e61['params']['id'];var _0x4a232c=[];return db[_0x1a58('0x58')][_0x1a58('0x59')](function(_0x38e6ca){var _0x1563d1=_0x1a58('0x5a')+_0x411caf;return db[_0x1a58('0x58')][_0x1a58('0x33')](_0x1563d1,{'type':db[_0x1a58('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x38e6ca})[_0x1a58('0x2a')](function(_0x2c6719){_0x4a232c=_[_0x1a58('0x2e')](_0x2c6719,function(_0x163281){return Number(_0x163281['UserId']);});})[_0x1a58('0x2a')](function(){var _0x53a87a=_0x1a58('0x5c')+_0x411caf;return db[_0x1a58('0x58')]['query'](_0x53a87a,{'type':db['Sequelize'][_0x1a58('0x5d')][_0x1a58('0x5e')],'raw':!![],'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(_0x8cea2){var _0x29687c=_['map'](_0x8cea2,function(_0x235c2b){return Number(_0x235c2b[_0x1a58('0x5f')]);});return db[_0x1a58('0x60')]['destroy']({'where':{'UserId':{'$in':_0x4a232c},'VoiceQueueId':{'$in':_0x29687c}},'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(){var _0xd24dd7=_0x1a58('0x61')+_0x411caf;return db[_0x1a58('0x58')][_0x1a58('0x33')](_0xd24dd7,{'type':db['Sequelize'][_0x1a58('0x5d')]['SELECT'],'raw':!![],'transaction':_0x38e6ca});})['then'](function(_0xa35893){var _0x206b8d=_[_0x1a58('0x2e')](_0xa35893,function(_0x5835cb){return Number(_0x5835cb['MailQueueId']);});return db[_0x1a58('0x62')][_0x1a58('0x57')]({'where':{'UserId':{'$in':_0x4a232c},'MailQueueId':{'$in':_0x206b8d}},'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(){var _0x26cd4e=_0x1a58('0x63')+_0x411caf;return db[_0x1a58('0x58')][_0x1a58('0x33')](_0x26cd4e,{'type':db[_0x1a58('0x5b')][_0x1a58('0x5d')]['SELECT'],'raw':!![],'transaction':_0x38e6ca});})['then'](function(_0x3abc8f){var _0x3ae02d=_['map'](_0x3abc8f,function(_0x2f1146){return Number(_0x2f1146[_0x1a58('0x64')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x4a232c},'SmsQueueId':{'$in':_0x3ae02d}},'transaction':_0x38e6ca});})['then'](function(){var _0x3ead8f='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x411caf;return db[_0x1a58('0x58')][_0x1a58('0x33')](_0x3ead8f,{'type':db['Sequelize'][_0x1a58('0x5d')][_0x1a58('0x5e')],'raw':!![],'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(_0x3ab12f){var _0x3c71a0=_[_0x1a58('0x2e')](_0x3ab12f,function(_0x35f48d){return Number(_0x35f48d['ChatQueueId']);});return db[_0x1a58('0x65')]['destroy']({'where':{'UserId':{'$in':_0x4a232c},'ChatQueueId':{'$in':_0x3c71a0}},'transaction':_0x38e6ca});})['then'](function(){var _0x176726='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x411caf;return db[_0x1a58('0x58')][_0x1a58('0x33')](_0x176726,{'type':db[_0x1a58('0x5b')][_0x1a58('0x5d')][_0x1a58('0x5e')],'raw':!![],'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(_0x17474f){var _0x22e4c3=_[_0x1a58('0x2e')](_0x17474f,function(_0x43e29c){return Number(_0x43e29c[_0x1a58('0x66')]);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x4a232c},'FaxQueueId':{'$in':_0x22e4c3}},'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(){var _0x3a7f94='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x411caf;return db['sequelize']['query'](_0x3a7f94,{'type':db[_0x1a58('0x5b')][_0x1a58('0x5d')]['SELECT'],'raw':!![],'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(_0x4f0826){var _0x102441=_[_0x1a58('0x2e')](_0x4f0826,function(_0xa3e90f){return Number(_0xa3e90f[_0x1a58('0x67')]);});return db[_0x1a58('0x68')][_0x1a58('0x57')]({'where':{'UserId':{'$in':_0x4a232c},'OpenchannelQueueId':{'$in':_0x102441}},'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(){var _0x42e46b=_0x1a58('0x69')+_0x411caf;return db[_0x1a58('0x58')][_0x1a58('0x33')](_0x42e46b,{'type':db['Sequelize'][_0x1a58('0x5d')][_0x1a58('0x5e')],'raw':!![],'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(_0x186c28){var _0x4f6dd3=_[_0x1a58('0x2e')](_0x186c28,function(_0x29c2e5){return Number(_0x29c2e5[_0x1a58('0x6a')]);});return db[_0x1a58('0x6b')][_0x1a58('0x57')]({'where':{'UserId':{'$in':_0x4a232c},'WhatsappQueueId':{'$in':_0x4f6dd3}},'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(){return db[_0x1a58('0x6c')]['find']({'where':{'TeamId':_0x411caf}});})[_0x1a58('0x2a')](function(_0x2c8970){if(_0x2c8970===null){return;}return db[_0x1a58('0x6d')][_0x1a58('0x57')]({'where':{'UserId':{'$in':_0x4a232c},'VoicePrefixId':_0x2c8970['VoicePrefixId']},'transaction':_0x38e6ca});})[_0x1a58('0x2a')](function(){return db[_0x1a58('0x2f')][_0x1a58('0x57')]({'where':{'id':_0x411caf},'cascade':!![],'transaction':_0x38e6ca});})['then'](function(_0x5c335e){if(_0x5c335e===0x0){_0x41d561['sendStatus'](0x194);}else{return db[_0x1a58('0x54')][_0x1a58('0x57')]({'where':{'type':_0x1a58('0x50'),'resourceId':_0x411caf},'cascade':!![],'transaction':_0x38e6ca})[_0x1a58('0x2a')](function(){_0x41d561[_0x1a58('0x1f')](0xcc)[_0x1a58('0x20')]();});}})[_0x1a58('0x4a')](function(_0x4d39c7){_0x41d561[_0x1a58('0x1f')](0x1f4)[_0x1a58('0x6e')](_0x4d39c7);});});};exports[_0x1a58('0x6f')]=function(_0x42cf43,_0x44dcde,_0xea8241){return db[_0x1a58('0x2f')]['findOne']({'where':{'id':_0x42cf43[_0x1a58('0x46')]['id']}})[_0x1a58('0x2a')](handleEntityNotFound(_0x44dcde,null))[_0x1a58('0x2a')](function(_0x8f1a54){if(!_0x42cf43[_0x1a58('0x33')][_0x1a58('0x70')]||!utils[_0x1a58('0x71')](_0x42cf43[_0x1a58('0x33')]['channel'])){throw new db['Sequelize'][(_0x1a58('0x72'))](_0x1a58('0x73'));}var _0x275b13={};var _0x4ba8a9={};_0x4ba8a9[_0x1a58('0x32')]=_[_0x1a58('0x34')](db[_[_0x1a58('0x74')](_0x42cf43[_0x1a58('0x33')][_0x1a58('0x70')][_0x1a58('0x75')]())+_0x1a58('0x76')][_0x1a58('0x30')]);_0x4ba8a9[_0x1a58('0x33')]=_['keys'](_0x42cf43[_0x1a58('0x33')]);_0x4ba8a9[_0x1a58('0x35')]=_['intersection'](_0x4ba8a9['model'],_0x4ba8a9[_0x1a58('0x33')]);_0x275b13[_0x1a58('0x37')]=_[_0x1a58('0x36')](_0x4ba8a9[_0x1a58('0x32')],qs['fields'](_0x42cf43['query']['fields']));_0x275b13[_0x1a58('0x37')]=_0x275b13['attributes'][_0x1a58('0x47')]?_0x275b13[_0x1a58('0x37')]:_0x4ba8a9[_0x1a58('0x32')];_0x275b13[_0x1a58('0x22')]=qs[_0x1a58('0x22')](_0x42cf43[_0x1a58('0x33')]['limit']);_0x275b13[_0x1a58('0x24')]=qs[_0x1a58('0x24')](_0x42cf43[_0x1a58('0x33')][_0x1a58('0x24')]);_0x275b13[_0x1a58('0x3a')]=qs['sort'](_0x42cf43[_0x1a58('0x33')]['sort']);_0x275b13[_0x1a58('0x3c')]=qs[_0x1a58('0x35')](_[_0x1a58('0x3d')](_0x42cf43['query'],_0x4ba8a9[_0x1a58('0x35')]));_0x275b13=_[_0x1a58('0x3f')]({},_0x275b13,_0x42cf43[_0x1a58('0x41')]);return _0x8f1a54[_0x1a58('0x4d')+_[_0x1a58('0x74')](_0x42cf43[_0x1a58('0x33')][_0x1a58('0x70')]['toLowerCase']())+_0x1a58('0x77')](_0x275b13);})['then'](respondWithResult(_0x44dcde,null))[_0x1a58('0x4a')](handleError(_0x44dcde,null));};exports[_0x1a58('0x78')]=function(_0xb5d7dd,_0x23b55d,_0x1f3626){return db['Team'][_0x1a58('0x79')]({'where':{'id':_0xb5d7dd[_0x1a58('0x46')]['id']}})[_0x1a58('0x2a')](function(_0x5ec428){if(_0x5ec428){if(!_0xb5d7dd['body'][_0x1a58('0x70')]||!utils[_0x1a58('0x71')](_0xb5d7dd['body']['channel'])){throw new db[(_0x1a58('0x5b'))][(_0x1a58('0x72'))](_0x1a58('0x73'));}return _0x5ec428[_0x1a58('0x7a')+_[_0x1a58('0x74')](_0xb5d7dd[_0x1a58('0x56')][_0x1a58('0x70')][_0x1a58('0x75')]())+'Queues'](_0xb5d7dd[_0x1a58('0x56')][_0x1a58('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x23b55d,null))[_0x1a58('0x2a')](respondWithStatusCode(_0x23b55d,null))[_0x1a58('0x4a')](handleError(_0x23b55d,null));};exports[_0x1a58('0x7c')]=function(_0xbdd620,_0xde083c,_0x2ae0cc){return db['Team'][_0x1a58('0x79')]({'where':{'id':_0xbdd620[_0x1a58('0x46')]['id']}})[_0x1a58('0x2a')](function(_0x58c97b){if(_0x58c97b){if(!_0xbdd620[_0x1a58('0x33')][_0x1a58('0x70')]||!utils[_0x1a58('0x71')](_0xbdd620['query'][_0x1a58('0x70')])){throw new db['Sequelize'][(_0x1a58('0x72'))](_0x1a58('0x73'));}return _0x58c97b[_0x1a58('0x7d')+_['capitalize'](_0xbdd620[_0x1a58('0x33')][_0x1a58('0x70')][_0x1a58('0x75')]())+'Queues'](_0xbdd620[_0x1a58('0x33')][_0x1a58('0x7b')]);}return null;})[_0x1a58('0x2a')](handleEntityNotFound(_0xde083c,null))[_0x1a58('0x2a')](respondWithStatusCode(_0xde083c,null))[_0x1a58('0x4a')](handleError(_0xde083c,null));};exports[_0x1a58('0x7e')]=function(_0x37ec0a,_0x23555a){var _0x2dd8f4=_[_0x1a58('0x7f')](_0x37ec0a[_0x1a58('0x56')][_0x1a58('0x7b')])?_0x37ec0a[_0x1a58('0x56')][_0x1a58('0x7b')]:[_0x37ec0a[_0x1a58('0x56')]['ids']];var _0xfcadd2=_0x37ec0a[_0x1a58('0x46')]['id'];return db[_0x1a58('0x2f')][_0x1a58('0x49')]({'where':{'id':_0xfcadd2}})['then'](handleEntityNotFound(_0x23555a,null))[_0x1a58('0x2a')](function(_0xd370f){if(_0xd370f){var _0x5007e8=[_0x1a58('0x80'),_0x1a58('0x81'),_0x1a58('0x82'),_0x1a58('0x83'),_0x1a58('0x84'),_0x1a58('0x85'),_0x1a58('0x86')];return db[_0x1a58('0x58')]['transaction'](function(_0x3da6c1){var _0x46a1f5=_[_0x1a58('0x2e')](_0x5007e8,function(_0xfc6bcf){var _0x393f10={'attributes':['id',_0x1a58('0x2d')]};if(_0xfc6bcf===_0x1a58('0x80')){_0x393f10[_0x1a58('0x87')]={'attributes':['penalty']};}return _0xd370f[_0x1a58('0x4d')+_0xfc6bcf+_0x1a58('0x77')](_0x393f10)[_0x1a58('0x2a')](function(_0x14aa5a){var _0x57bf27=_[_0x1a58('0x2e')](_0x14aa5a,function(_0x1f57ca){var _0xcf83a5=_[_0x1a58('0x2e')](_0x2dd8f4,function(_0x10a904){var _0x50788b={'where':{'UserId':_0x10a904,[_0xfc6bcf+_0x1a58('0x88')]:_0x1f57ca['id']},'transaction':_0x3da6c1};if(_0xfc6bcf===_0x1a58('0x80')){_0x50788b[_0x1a58('0x19')]={'penalty':_0x1f57ca[_0x1a58('0x89')][_0x1a58('0x8a')]};}return db[_0x1a58('0x8b')+_0xfc6bcf+_0x1a58('0x76')][_0x1a58('0x8c')](_0x50788b)['then'](function(){socket['emit'](_0x1a58('0x4c')+_0xfc6bcf+'Queue:save',{'UserId':_0x10a904,[_0xfc6bcf+_0x1a58('0x88')]:_0x1f57ca['id']});if(_0xfc6bcf!==_0x1a58('0x80')){return;}return db['User'][_0x1a58('0x43')]({'where':{'id':_0x2dd8f4,'online':0x1},'attributes':['id',_0x1a58('0x2d'),_0x1a58('0x8d'),_0x1a58('0x8e'),'interface'],'raw':!![]})['then'](function(_0x51b4f9){var _0x45b07e=_[_0x1a58('0x2e')](_0x51b4f9,function(_0x590346){return db['UserVoiceQueueRt']['upsert']({'membername':_0x590346[_0x1a58('0x2d')],'UserId':_0x590346['id'],'queue_name':_0x1f57ca[_0x1a58('0x2d')],'VoiceQueueId':_0x1f57ca['id'],'interface':_[_0x1a58('0x8f')](_0x590346[_0x1a58('0x90')])?util['format'](_0x1a58('0x91'),_0x590346[_0x1a58('0x2d')]):_0x590346[_0x1a58('0x90')],'paused':_0x590346['voicePause']||![],'penalty':_0x1f57ca['TeamVoiceQueue'][_0x1a58('0x8a')]},{'transaction':_0x3da6c1});});return Promise[_0x1a58('0x92')](_0x45b07e);});});});return Promise['all'](_0xcf83a5);});return Promise[_0x1a58('0x92')](_0x57bf27);})[_0x1a58('0x2a')](function(){return db['TeamVoicePrefix'][_0x1a58('0x79')]({'where':{'teamId':_0xfcadd2}})[_0x1a58('0x2a')](function(_0x2eff23){if(_0x2eff23){var _0x4b9806=_[_0x1a58('0x2e')](_0x2dd8f4,function(_0x66c15f){db['UserVoicePrefix'][_0x1a58('0x93')]({'UserId':_0x66c15f,'VoicePrefixId':_0x2eff23['VoicePrefixId']});});return Promise[_0x1a58('0x92')](_0x4b9806);}});});});return Promise['all'](_0x46a1f5)[_0x1a58('0x2a')](function(){return _0xd370f[_0x1a58('0x7e')](_0x2dd8f4,{'transaction':_0x3da6c1})[_0x1a58('0x94')](function(_0x37cb0c){return _0x37cb0c;});});});}})[_0x1a58('0x2a')](respondWithResult(_0x23555a,null))['catch'](handleError(_0x23555a,null));};exports['removeAgents']=function(_0x5872a0,_0xd2d4c6){var _0x17e2ba=_[_0x1a58('0x7f')](_0x5872a0['query'][_0x1a58('0x7b')])?_0x5872a0[_0x1a58('0x33')][_0x1a58('0x7b')]:[_0x5872a0[_0x1a58('0x33')][_0x1a58('0x7b')]];var _0x5ae5e5=_0x5872a0['params']['id'];return db[_0x1a58('0x2f')]['find']({'where':{'id':_0x5ae5e5}})['then'](handleEntityNotFound(_0xd2d4c6,null))[_0x1a58('0x2a')](function(_0x202fb0){if(_0x202fb0){var _0x3951b9=['Voice',_0x1a58('0x81'),_0x1a58('0x82'),_0x1a58('0x83'),_0x1a58('0x84'),'Openchannel','Whatsapp'];return db[_0x1a58('0x58')]['transaction'](function(_0x3de155){var _0x2dc5f0=_['map'](_0x3951b9,function(_0x55fc5f){var _0x101361={'attributes':['id','name']};return _0x202fb0[_0x1a58('0x4d')+_0x55fc5f+_0x1a58('0x77')](_0x101361)[_0x1a58('0x2a')](function(_0x596330){var _0x2689f6=_['map'](_0x596330,function(_0x181d42){return _0x181d42[_0x1a58('0x95')](_0x17e2ba,{'transaction':_0x3de155})[_0x1a58('0x2a')](function(){var _0x1eec99=_[_0x1a58('0x2e')](_0x17e2ba,function(_0x18c1c1){socket[_0x1a58('0x96')]('user'+_0x55fc5f+_0x1a58('0x97'),{'UserId':Number(_0x18c1c1),[_0x55fc5f+_0x1a58('0x88')]:_0x181d42['id']});if(_0x55fc5f!==_0x1a58('0x80')){return;}return db[_0x1a58('0x98')][_0x1a58('0x57')]({'where':{'VoiceQueueId':_0x181d42['id'],'UserId':_0x18c1c1},'transaction':_0x3de155});});return Promise[_0x1a58('0x92')](_0x1eec99);});});return Promise[_0x1a58('0x92')](_0x2689f6);});});return Promise[_0x1a58('0x92')](_0x2dc5f0)[_0x1a58('0x2a')](function(){return _0x202fb0['removeAgents'](_0x17e2ba,{'transaction':_0x3de155});})['then'](function(){return db[_0x1a58('0x6c')][_0x1a58('0x79')]({'where':{'teamId':_0x5ae5e5}})[_0x1a58('0x2a')](function(_0x492a28){if(_0x492a28){var _0x42ff93=_['map'](_0x17e2ba,function(_0x553568){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x553568,'VoicePrefixId':_0x492a28[_0x1a58('0x99')]}});});return Promise[_0x1a58('0x92')](_0x42ff93);}});});});}})['then'](respondWithStatusCode(_0xd2d4c6,null))[_0x1a58('0x4a')](handleError(_0xd2d4c6,null));};exports['getAgents']=function(_0x3b8b23,_0x2a3734,_0x118d3c){var _0x28ae02={};var _0x5124b0={};var _0x2cc9a2;var _0x33c755;return db[_0x1a58('0x2f')][_0x1a58('0x79')]({'where':{'id':_0x3b8b23[_0x1a58('0x46')]['id']}})[_0x1a58('0x2a')](handleEntityNotFound(_0x2a3734,null))['then'](function(_0x44ee86){if(_0x44ee86){_0x2cc9a2=_0x44ee86;_0x5124b0[_0x1a58('0x32')]=_[_0x1a58('0x34')](db[_0x1a58('0x8b')][_0x1a58('0x30')]);_0x5124b0[_0x1a58('0x33')]=_['keys'](_0x3b8b23['query']);_0x5124b0['filters']=_['intersection'](_0x5124b0[_0x1a58('0x32')],_0x5124b0['query']);_0x28ae02['attributes']=_[_0x1a58('0x36')](_0x5124b0[_0x1a58('0x32')],qs[_0x1a58('0x38')](_0x3b8b23['query'][_0x1a58('0x38')]));_0x28ae02[_0x1a58('0x37')]=_0x28ae02[_0x1a58('0x37')][_0x1a58('0x47')]?_0x28ae02[_0x1a58('0x37')]:_0x5124b0['model'];_0x28ae02[_0x1a58('0x3a')]=qs[_0x1a58('0x3b')](_0x3b8b23['query']['sort']);_0x28ae02[_0x1a58('0x3c')]=qs[_0x1a58('0x35')](_[_0x1a58('0x3d')](_0x3b8b23[_0x1a58('0x33')],_0x5124b0[_0x1a58('0x35')]));if(_0x3b8b23['query'][_0x1a58('0x3e')]){_0x28ae02[_0x1a58('0x3c')]=_[_0x1a58('0x3f')](_0x28ae02['where'],{'$or':_[_0x1a58('0x2e')](_0x28ae02['attributes'],function(_0xd0aa2){var _0x5e15e1={};_0x5e15e1[_0xd0aa2]={'$like':'%'+_0x3b8b23[_0x1a58('0x33')][_0x1a58('0x3e')]+'%'};return _0x5e15e1;})});}_0x28ae02=_[_0x1a58('0x3f')]({},_0x28ae02,_0x3b8b23['options']);return _0x2cc9a2[_0x1a58('0x9a')](_0x28ae02);}})[_0x1a58('0x2a')](function(_0x2b8384){if(_0x2b8384){_0x33c755=_0x2b8384[_0x1a58('0x47')];if(!_0x3b8b23[_0x1a58('0x33')]['hasOwnProperty'](_0x1a58('0x39'))){_0x28ae02[_0x1a58('0x22')]=qs[_0x1a58('0x22')](_0x3b8b23[_0x1a58('0x33')][_0x1a58('0x22')]);_0x28ae02[_0x1a58('0x24')]=qs['offset'](_0x3b8b23[_0x1a58('0x33')][_0x1a58('0x24')]);}return _0x2cc9a2[_0x1a58('0x9a')](_0x28ae02);}})[_0x1a58('0x2a')](function(_0x1a3dc4){if(_0x1a3dc4){return _0x1a3dc4?{'count':_0x33c755,'rows':_0x1a3dc4}:null;}})['then'](respondWithResult(_0x2a3734,null))[_0x1a58('0x4a')](handleError(_0x2a3734,null));};
\ No newline at end of file
index 4241c9c..c20791a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7b5=['emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xe7b5,0x1e7));var _0x5e7b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe7b5[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x5e7b('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e7b('0x1'),'afterUpdate':_0x5e7b('0x2'),'afterDestroy':'remove'};function emitEvent(_0x42f2b0){return function(_0x56bf39,_0x5df230,_0x42560b){TeamEvents[_0x5e7b('0x3')](_0x42f2b0+':'+_0x56bf39['id'],_0x56bf39);TeamEvents[_0x5e7b('0x3')](_0x42f2b0,_0x56bf39);_0x42560b(null);};}for(var e in events){if(events[_0x5e7b('0x4')](e)){var event=events[e];Team[_0x5e7b('0x5')](e,emitEvent(event));}}module[_0x5e7b('0x6')]=TeamEvents;
\ No newline at end of file
+var _0xacfa=['hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x4bda96,_0x1eed4a){var _0x2ffc5f=function(_0x1c43d6){while(--_0x1c43d6){_0x4bda96['push'](_0x4bda96['shift']());}};_0x2ffc5f(++_0x1eed4a);}(_0xacfa,0x175));var _0xaacf=function(_0x221bc5,_0x3e3bd7){_0x221bc5=_0x221bc5-0x0;var _0xdf4f74=_0xacfa[_0x221bc5];return _0xdf4f74;};'use strict';var EventEmitter=require('events');var Team=require(_0xaacf('0x0'))['db'][_0xaacf('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xaacf('0x2')](0x0);var events={'afterCreate':_0xaacf('0x3'),'afterUpdate':_0xaacf('0x4'),'afterDestroy':_0xaacf('0x5')};function emitEvent(_0x7a5269){return function(_0x1b9b06,_0xec549a,_0x195304){TeamEvents[_0xaacf('0x6')](_0x7a5269+':'+_0x1b9b06['id'],_0x1b9b06);TeamEvents[_0xaacf('0x6')](_0x7a5269,_0x1b9b06);_0x195304(null);};}for(var e in events){if(events[_0xaacf('0x7')](e)){var event=events[e];Team[_0xaacf('0x8')](e,emitEvent(event));}}module[_0xaacf('0x9')]=TeamEvents;
\ No newline at end of file
index 1b74b33..2f0167f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b0a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','util','../../config/logger'];(function(_0x16527c,_0x1e866d){var _0x345030=function(_0x384bff){while(--_0x384bff){_0x16527c['push'](_0x16527c['shift']());}};_0x345030(++_0x1e866d);}(_0x4b0a,0x1cb));var _0xa4b0=function(_0x4c7162,_0x5b1dbb){_0x4c7162=_0x4c7162-0x0;var _0x11c0fd=_0x4b0a[_0x4c7162];return _0x11c0fd;};'use strict';var _=require(_0xa4b0('0x0'));var util=require(_0xa4b0('0x1'));var logger=require(_0xa4b0('0x2'))(_0xa4b0('0x3'));var moment=require(_0xa4b0('0x4'));var BPromise=require(_0xa4b0('0x5'));var rp=require(_0xa4b0('0x6'));var fs=require('fs');var path=require(_0xa4b0('0x7'));var rimraf=require(_0xa4b0('0x8'));var config=require(_0xa4b0('0x9'));var attributes=require(_0xa4b0('0xa'));module[_0xa4b0('0xb')]=function(_0x258461,_0x384005){return _0x258461['define'](_0xa4b0('0xc'),attributes,{'tableName':_0xa4b0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fc7=['teams','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./team.attributes','exports','define','Team'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x9fc7,0xf1));var _0x79fc=function(_0x40493e,_0x5089fd){_0x40493e=_0x40493e-0x0;var _0xad822=_0x9fc7[_0x40493e];return _0xad822;};'use strict';var _=require('lodash');var util=require(_0x79fc('0x0'));var logger=require(_0x79fc('0x1'))(_0x79fc('0x2'));var moment=require(_0x79fc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x79fc('0x4'));var rimraf=require(_0x79fc('0x5'));var config=require(_0x79fc('0x6'));var attributes=require(_0x79fc('0x7'));module[_0x79fc('0x8')]=function(_0x11f97e,_0xe02d74){return _0x11f97e[_0x79fc('0x9')](_0x79fc('0xa'),attributes,{'tableName':_0x79fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3018126..64fbe8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3664=['register','then','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket'];(function(_0x2fd5a7,_0x51d172){var _0x29430d=function(_0x27db1b){while(--_0x27db1b){_0x2fd5a7['push'](_0x2fd5a7['shift']());}};_0x29430d(++_0x51d172);}(_0x3664,0x19c));var _0x4366=function(_0x5427b5,_0x276483){_0x5427b5=_0x5427b5-0x0;var _0x224262=_0x3664[_0x5427b5];return _0x224262;};'use strict';var _=require(_0x4366('0x0'));var util=require('util');var moment=require(_0x4366('0x1'));var BPromise=require(_0x4366('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4366('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4366('0x4'));var config=require(_0x4366('0x5'));var jayson=require(_0x4366('0x6'));var client=jayson['client'][_0x4366('0x7')]({'port':0x232a});config[_0x4366('0x8')]=_[_0x4366('0x9')](config['redis'],{'host':_0x4366('0xa'),'port':0x18eb});var socket=require(_0x4366('0xb'))(new Redis(config[_0x4366('0x8')]));require(_0x4366('0xc'))[_0x4366('0xd')](socket);function respondWithRpcPromise(_0x581848,_0x5e3f69,_0x2da1c9){return new BPromise(function(_0x7368da,_0x3a4aa6){return client['request'](_0x581848,_0x2da1c9)[_0x4366('0xe')](function(_0x28fb0b){logger['info'](_0x4366('0xf'),_0x5e3f69,'request\x20sent');logger['debug'](_0x4366('0x10'),_0x5e3f69,_0x4366('0x11'),JSON[_0x4366('0x12')](_0x28fb0b));if(_0x28fb0b[_0x4366('0x13')]){if(_0x28fb0b['error'][_0x4366('0x14')]===0x1f4){logger[_0x4366('0x13')](_0x4366('0xf'),_0x5e3f69,_0x28fb0b[_0x4366('0x13')]['message']);return _0x3a4aa6(_0x28fb0b['error'][_0x4366('0x15')]);}logger[_0x4366('0x13')](_0x4366('0xf'),_0x5e3f69,_0x28fb0b['error'][_0x4366('0x15')]);return _0x7368da(_0x28fb0b[_0x4366('0x13')][_0x4366('0x15')]);}else{logger[_0x4366('0x16')](_0x4366('0xf'),_0x5e3f69,_0x4366('0x11'));_0x7368da(_0x28fb0b[_0x4366('0x17')][_0x4366('0x15')]);}})[_0x4366('0x18')](function(_0x3135f2){logger[_0x4366('0x13')](_0x4366('0xf'),_0x5e3f69,_0x3135f2);_0x3a4aa6(_0x3135f2);});});}
\ No newline at end of file
+var _0x1e7a=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x1e7a,0xe3));var _0xa1e7=function(_0x3c6f7f,_0x46301d){_0x3c6f7f=_0x3c6f7f-0x0;var _0xb10891=_0x1e7a[_0x3c6f7f];return _0xb10891;};'use strict';var _=require(_0xa1e7('0x0'));var util=require(_0xa1e7('0x1'));var moment=require('moment');var BPromise=require(_0xa1e7('0x2'));var rs=require(_0xa1e7('0x3'));var fs=require('fs');var Redis=require(_0xa1e7('0x4'));var db=require(_0xa1e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1e7('0x6'))(_0xa1e7('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1e7('0x8'));var client=jayson[_0xa1e7('0x9')][_0xa1e7('0xa')]({'port':0x232a});config[_0xa1e7('0xb')]=_[_0xa1e7('0xc')](config[_0xa1e7('0xb')],{'host':_0xa1e7('0xd'),'port':0x18eb});var socket=require(_0xa1e7('0xe'))(new Redis(config[_0xa1e7('0xb')]));require('./team.socket')[_0xa1e7('0xf')](socket);function respondWithRpcPromise(_0x56e8a8,_0x34931d,_0x42dda6){return new BPromise(function(_0x567c3f,_0x5cc22f){return client[_0xa1e7('0x10')](_0x56e8a8,_0x42dda6)[_0xa1e7('0x11')](function(_0x538af4){logger[_0xa1e7('0x12')](_0xa1e7('0x13'),_0x34931d,_0xa1e7('0x14'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x34931d,_0xa1e7('0x14'),JSON['stringify'](_0x538af4));if(_0x538af4[_0xa1e7('0x15')]){if(_0x538af4[_0xa1e7('0x15')]['code']===0x1f4){logger[_0xa1e7('0x15')](_0xa1e7('0x13'),_0x34931d,_0x538af4[_0xa1e7('0x15')][_0xa1e7('0x16')]);return _0x5cc22f(_0x538af4['error']['message']);}logger[_0xa1e7('0x15')](_0xa1e7('0x13'),_0x34931d,_0x538af4['error']['message']);return _0x567c3f(_0x538af4[_0xa1e7('0x15')][_0xa1e7('0x16')]);}else{logger[_0xa1e7('0x12')](_0xa1e7('0x13'),_0x34931d,'request\x20sent');_0x567c3f(_0x538af4[_0xa1e7('0x17')][_0xa1e7('0x16')]);}})[_0xa1e7('0x18')](function(_0x34470f){logger['error']('Team,\x20%s,\x20%s',_0x34931d,_0x34470f);_0x5cc22f(_0x34470f);});});}
\ No newline at end of file
index 1a60a76..ce771ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f1=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0x37d264,_0x2fe6f9){var _0x24be13=function(_0x45489c){while(--_0x45489c){_0x37d264['push'](_0x37d264['shift']());}};_0x24be13(++_0x2fe6f9);}(_0xd1f1,0x84));var _0x1d1f=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0xd1f1[_0x22dac7];return _0x3e6cfa;};'use strict';var TeamEvents=require(_0x1d1f('0x0'));var events=[_0x1d1f('0x1'),_0x1d1f('0x2'),_0x1d1f('0x3')];function createListener(_0x29966d,_0x4ab21a){return function(_0x448898){_0x4ab21a[_0x1d1f('0x4')](_0x29966d,_0x448898);};}function removeListener(_0x35d347,_0x5ede62){return function(){TeamEvents[_0x1d1f('0x5')](_0x35d347,_0x5ede62);};}exports[_0x1d1f('0x6')]=function(_0x54e8a0){for(var _0x2337fc=0x0,_0x5c285a=events[_0x1d1f('0x7')];_0x2337fc<_0x5c285a;_0x2337fc++){var _0xf6f6ab=events[_0x2337fc];var _0x44f6c1=createListener(_0x1d1f('0x8')+_0xf6f6ab,_0x54e8a0);TeamEvents['on'](_0xf6f6ab,_0x44f6c1);}};
\ No newline at end of file
+var _0xa6e2=['update','register','./team.events','save'];(function(_0x394f6f,_0x26ddc9){var _0x5caceb=function(_0x2f6d9b){while(--_0x2f6d9b){_0x394f6f['push'](_0x394f6f['shift']());}};_0x5caceb(++_0x26ddc9);}(_0xa6e2,0x132));var _0x2a6e=function(_0x2a4a53,_0x53c5fa){_0x2a4a53=_0x2a4a53-0x0;var _0x13a565=_0xa6e2[_0x2a4a53];return _0x13a565;};'use strict';var TeamEvents=require(_0x2a6e('0x0'));var events=[_0x2a6e('0x1'),'remove',_0x2a6e('0x2')];function createListener(_0x1286dd,_0x314611){return function(_0x4e74b6){_0x314611['emit'](_0x1286dd,_0x4e74b6);};}function removeListener(_0x3ea938,_0x4f1b6d){return function(){TeamEvents['removeListener'](_0x3ea938,_0x4f1b6d);};}exports[_0x2a6e('0x3')]=function(_0x17b0f4){for(var _0x29fd48=0x0,_0x10ec91=events['length'];_0x29fd48<_0x10ec91;_0x29fd48++){var _0x238615=events[_0x29fd48];var _0x272ec4=createListener('team:'+_0x238615,_0x17b0f4);TeamEvents['on'](_0x238615,_0x272ec4);}};
\ No newline at end of file
index 51c7f49..77c8bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5825=['sequelize','exports','INTEGER'];(function(_0xb18b17,_0x121eb1){var _0xd1ff7c=function(_0x3eea6f){while(--_0x3eea6f){_0xb18b17['push'](_0xb18b17['shift']());}};_0xd1ff7c(++_0x121eb1);}(_0x5825,0x78));var _0x5582=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5825[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x5582('0x0'));module[_0x5582('0x1')]={'TeamId':{'type':Sequelize[_0x5582('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5582('0x2')]}};
\ No newline at end of file
+var _0x0545=['INTEGER','sequelize','exports'];(function(_0xfb60c4,_0x599c95){var _0x205172=function(_0x3aded8){while(--_0x3aded8){_0xfb60c4['push'](_0xfb60c4['shift']());}};_0x205172(++_0x599c95);}(_0x0545,0x17e));var _0x5054=function(_0x5379f3,_0x2f213c){_0x5379f3=_0x5379f3-0x0;var _0x3954a8=_0x0545[_0x5379f3];return _0x3954a8;};'use strict';var Sequelize=require(_0x5054('0x0'));module[_0x5054('0x1')]={'TeamId':{'type':Sequelize[_0x5054('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5054('0x2')]}};
\ No newline at end of file
index 87d04d3..b49d924 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a1=['team_has_voice_prefixes','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','TeamVoicePrefix'];(function(_0x2724e4,_0x60fd80){var _0x1f6b08=function(_0x3f42f3){while(--_0x3f42f3){_0x2724e4['push'](_0x2724e4['shift']());}};_0x1f6b08(++_0x60fd80);}(_0x73a1,0x161));var _0x173a=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x73a1[_0x4d180c];return _0x49b57e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x173a('0x0'))(_0x173a('0x1'));var moment=require('moment');var BPromise=require(_0x173a('0x2'));var rp=require(_0x173a('0x3'));var fs=require('fs');var path=require(_0x173a('0x4'));var rimraf=require(_0x173a('0x5'));var config=require(_0x173a('0x6'));var attributes=require('./teamVoicePrefix.attributes');module[_0x173a('0x7')]=function(_0x1a8b94,_0xac84a){return _0x1a8b94[_0x173a('0x8')](_0x173a('0x9'),attributes,{'tableName':_0x173a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x67da=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x67da,0x192));var _0xa67d=function(_0x223b7d,_0x3bf05f){_0x223b7d=_0x223b7d-0x0;var _0x5d8441=_0x67da[_0x223b7d];return _0x5d8441;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var logger=require(_0xa67d('0x1'))(_0xa67d('0x2'));var moment=require(_0xa67d('0x3'));var BPromise=require(_0xa67d('0x4'));var rp=require(_0xa67d('0x5'));var fs=require('fs');var path=require(_0xa67d('0x6'));var rimraf=require(_0xa67d('0x7'));var config=require(_0xa67d('0x8'));var attributes=require(_0xa67d('0x9'));module['exports']=function(_0x5b8ec7,_0x408786){return _0x5b8ec7['define'](_0xa67d('0xa'),attributes,{'tableName':_0xa67d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb6a23e..2b8d197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x481e1e,_0x82fa9f){var _0x3d4a8b=function(_0x1771d8){while(--_0x1771d8){_0x481e1e['push'](_0x481e1e['shift']());}};_0x3d4a8b(++_0x82fa9f);}(_0x70e0,0x17b));var _0x070e=function(_0x519751,_0x3b4f8b){_0x519751=_0x519751-0x0;var _0x31716a=_0x70e0[_0x519751];return _0x31716a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3e4856,_0x317ccd){var _0x27547d=function(_0x784f2){while(--_0x784f2){_0x3e4856['push'](_0x3e4856['shift']());}};_0x27547d(++_0x317ccd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 3683b0f..d1bc86b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd263=['exports','INTEGER','sequelize'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd263,0xb3));var _0x3d26=function(_0x533050,_0x294de0){_0x533050=_0x533050-0x0;var _0x2432f3=_0xd263[_0x533050];return _0x2432f3;};'use strict';var Sequelize=require(_0x3d26('0x0'));module[_0x3d26('0x1')]={'penalty':{'type':Sequelize[_0x3d26('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbd8f=['INTEGER','sequelize','exports'];(function(_0x3fd3f5,_0x358c42){var _0x34e7e5=function(_0x91d70a){while(--_0x91d70a){_0x3fd3f5['push'](_0x3fd3f5['shift']());}};_0x34e7e5(++_0x358c42);}(_0xbd8f,0x130));var _0xfbd8=function(_0x3d9312,_0x3363fc){_0x3d9312=_0x3d9312-0x0;var _0x3a0a42=_0xbd8f[_0x3d9312];return _0x3a0a42;};'use strict';var Sequelize=require(_0xfbd8('0x0'));module[_0xfbd8('0x1')]={'penalty':{'type':Sequelize[_0xfbd8('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index cab1a1b..56209b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6108=['../../config/logger','api','moment','path','rimraf','exports','define','team_has_voice_queues','lodash'];(function(_0x4ae63d,_0x152404){var _0x4c1e01=function(_0x58cb7e){while(--_0x58cb7e){_0x4ae63d['push'](_0x4ae63d['shift']());}};_0x4c1e01(++_0x152404);}(_0x6108,0xbc));var _0x8610=function(_0x3334dd,_0x3384fb){_0x3334dd=_0x3334dd-0x0;var _0x25d173=_0x6108[_0x3334dd];return _0x25d173;};'use strict';var _=require(_0x8610('0x0'));var util=require('util');var logger=require(_0x8610('0x1'))(_0x8610('0x2'));var moment=require(_0x8610('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8610('0x4'));var rimraf=require(_0x8610('0x5'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0x8610('0x6')]=function(_0x1ca62b,_0x28a680){return _0x1ca62b[_0x8610('0x7')]('TeamVoiceQueue',attributes,{'tableName':_0x8610('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa7c=['../../config/environment','./teamVoiceQueue.attributes','exports','define','lodash','bluebird','request-promise','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x32dca1,_0x29ec22){_0x32dca1=_0x32dca1-0x0;var _0x1c2894=_0xaa7c[_0x32dca1];return _0x1c2894;};'use strict';var _=require(_0xcaa7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcaa7('0x1'));var rp=require(_0xcaa7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaa7('0x3'));var config=require(_0xcaa7('0x4'));var attributes=require(_0xcaa7('0x5'));module[_0xcaa7('0x6')]=function(_0x27e610,_0x5a3674){return _0x27e610[_0xcaa7('0x7')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d0e437..641a295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8891=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8891,0x119));var _0x1889=function(_0x3ae24a,_0x7d32f9){_0x3ae24a=_0x3ae24a-0x0;var _0x18690f=_0x8891[_0x3ae24a];return _0x18690f;};'use strict';var _=require(_0x1889('0x0'));var util=require(_0x1889('0x1'));var moment=require('moment');var BPromise=require(_0x1889('0x2'));var rs=require(_0x1889('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1889('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1889('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1889('0x6')][_0x1889('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3fc592,_0x4c4892,_0x2c0c3d){return new BPromise(function(_0x2b3a00,_0x2695f1){return client[_0x1889('0x8')](_0x3fc592,_0x2c0c3d)[_0x1889('0x9')](function(_0x35262d){logger[_0x1889('0xa')](_0x1889('0xb'),_0x4c4892,'request\x20sent');logger[_0x1889('0xc')](_0x1889('0xd'),_0x4c4892,_0x1889('0xe'),JSON[_0x1889('0xf')](_0x35262d));if(_0x35262d[_0x1889('0x10')]){if(_0x35262d['error'][_0x1889('0x11')]===0x1f4){logger[_0x1889('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4c4892,_0x35262d[_0x1889('0x10')][_0x1889('0x12')]);return _0x2695f1(_0x35262d['error']['message']);}logger[_0x1889('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4c4892,_0x35262d[_0x1889('0x10')][_0x1889('0x12')]);return _0x2b3a00(_0x35262d[_0x1889('0x10')][_0x1889('0x12')]);}else{logger[_0x1889('0xa')](_0x1889('0xb'),_0x4c4892,_0x1889('0xe'));_0x2b3a00(_0x35262d[_0x1889('0x13')]['message']);}})[_0x1889('0x14')](function(_0xeefd85){logger[_0x1889('0x10')](_0x1889('0xb'),_0x4c4892,_0xeefd85);_0x2695f1(_0xeefd85);});});}
\ No newline at end of file
+var _0x4a5a=['then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a16f7,_0x15e545){var _0x5cb364=function(_0xfa7198){while(--_0xfa7198){_0x5a16f7['push'](_0x5a16f7['shift']());}};_0x5cb364(++_0x15e545);}(_0x4a5a,0x6e));var _0xa4a5=function(_0x142bfd,_0x3baac8){_0x142bfd=_0x142bfd-0x0;var _0x380674=_0x4a5a[_0x142bfd];return _0x380674;};'use strict';var _=require(_0xa4a5('0x0'));var util=require('util');var moment=require(_0xa4a5('0x1'));var BPromise=require(_0xa4a5('0x2'));var rs=require(_0xa4a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4a5('0x4'))['db'];var utils=require(_0xa4a5('0x5'));var logger=require(_0xa4a5('0x6'))(_0xa4a5('0x7'));var config=require(_0xa4a5('0x8'));var jayson=require(_0xa4a5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5a2b,_0x4a3df4,_0xb24c42){return new BPromise(function(_0x161489,_0x1e4550){return client['request'](_0x3a5a2b,_0xb24c42)[_0xa4a5('0xa')](function(_0x4eb5ad){logger[_0xa4a5('0xb')](_0xa4a5('0xc'),_0x4a3df4,_0xa4a5('0xd'));logger[_0xa4a5('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4a3df4,'request\x20sent',JSON[_0xa4a5('0xf')](_0x4eb5ad));if(_0x4eb5ad[_0xa4a5('0x10')]){if(_0x4eb5ad['error']['code']===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x4a3df4,_0x4eb5ad['error'][_0xa4a5('0x11')]);return _0x1e4550(_0x4eb5ad[_0xa4a5('0x10')][_0xa4a5('0x11')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x4a3df4,_0x4eb5ad['error']['message']);return _0x161489(_0x4eb5ad[_0xa4a5('0x10')][_0xa4a5('0x11')]);}else{logger[_0xa4a5('0xb')](_0xa4a5('0xc'),_0x4a3df4,'request\x20sent');_0x161489(_0x4eb5ad[_0xa4a5('0x12')][_0xa4a5('0x11')]);}})[_0xa4a5('0x13')](function(_0x32d781){logger[_0xa4a5('0x10')](_0xa4a5('0xc'),_0x4a3df4,_0x32d781);_0x1e4550(_0x32d781);});});}
\ No newline at end of file
index aec1826..b4745b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f2d=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x18b4de,_0x5904ed){var _0x4eacd7=function(_0x4e32c4){while(--_0x4e32c4){_0x18b4de['push'](_0x18b4de['shift']());}};_0x4eacd7(++_0x5904ed);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x1f2d[_0x218972];return _0x1bb1a8;};'use strict';var multer=require(_0xd1f2('0x0'));var util=require(_0xd1f2('0x1'));var path=require(_0xd1f2('0x2'));var timeout=require(_0xd1f2('0x3'));var express=require('express');var router=express[_0xd1f2('0x4')]();var fs_extra=require(_0xd1f2('0x5'));var auth=require(_0xd1f2('0x6'));var interaction=require(_0xd1f2('0x7'));var config=require(_0xd1f2('0x8'));var controller=require(_0xd1f2('0x9'));router[_0xd1f2('0xa')]('/',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0xc')]);router[_0xd1f2('0xa')](_0xd1f2('0xd'),auth[_0xd1f2('0xb')](),controller[_0xd1f2('0xe')]);router[_0xd1f2('0xf')]('/',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0x10')]);router[_0xd1f2('0x11')]('/:id',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0x12')]);router[_0xd1f2('0x13')](_0xd1f2('0xd'),auth['isAuthenticated'](),controller[_0xd1f2('0x14')]);module[_0xd1f2('0x15')]=router;
\ No newline at end of file
+var _0xb366=['path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','multer'];(function(_0x4cc601,_0x1f26be){var _0x359d8e=function(_0x107ff3){while(--_0x107ff3){_0x4cc601['push'](_0x4cc601['shift']());}};_0x359d8e(++_0x1f26be);}(_0xb366,0xa4));var _0x6b36=function(_0x40429e,_0x3e4fae){_0x40429e=_0x40429e-0x0;var _0x29a910=_0xb366[_0x40429e];return _0x29a910;};'use strict';var multer=require(_0x6b36('0x0'));var util=require('util');var path=require(_0x6b36('0x1'));var timeout=require(_0x6b36('0x2'));var express=require('express');var router=express[_0x6b36('0x3')]();var fs_extra=require(_0x6b36('0x4'));var auth=require(_0x6b36('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0x6b36('0x6')]('/',auth[_0x6b36('0x7')](),controller['index']);router[_0x6b36('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x6b36('0x8')]);router[_0x6b36('0x9')]('/',auth[_0x6b36('0x7')](),controller[_0x6b36('0xa')]);router['put'](_0x6b36('0xb'),auth[_0x6b36('0x7')](),controller['update']);router[_0x6b36('0xc')]('/:id',auth[_0x6b36('0x7')](),controller[_0x6b36('0xd')]);module[_0x6b36('0xe')]=router;
\ No newline at end of file
index a96df7d..a034d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93c8=['sequelize','exports','STRING'];(function(_0x22dbc4,_0x41f321){var _0x15452e=function(_0x451912){while(--_0x451912){_0x22dbc4['push'](_0x22dbc4['shift']());}};_0x15452e(++_0x41f321);}(_0x93c8,0x19b));var _0x893c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x93c8[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0x893c('0x0'));module[_0x893c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x893c('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5f74=['sequelize','STRING','TEXT'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x5f74,0x18c));var _0x45f7=function(_0x5e0e88,_0x5684fb){_0x5e0e88=_0x5e0e88-0x0;var _0x485dd7=_0x5f74[_0x5e0e88];return _0x485dd7;};'use strict';var Sequelize=require(_0x45f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x45f7('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x45f7('0x2')]}};
\ No newline at end of file
index 1d68d51..0133c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cb1=['where','VIRTUAL','filter','merge','options','Template','includeAll','findAll','catch','show','params','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','Templates','UserProfileResource','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cb1,0x1c0));var _0x19cb=function(_0x24e756,_0x2e32d5){_0x24e756=_0x24e756-0x0;var _0x4caec0=_0x9cb1[_0x24e756];return _0x4caec0;};'use strict';var emlformat=require(_0x19cb('0x0'));var rimraf=require(_0x19cb('0x1'));var zipdir=require(_0x19cb('0x2'));var jsonpatch=require(_0x19cb('0x3'));var rp=require('request-promise');var moment=require(_0x19cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x19cb('0x5'));var util=require(_0x19cb('0x6'));var path=require(_0x19cb('0x7'));var sox=require(_0x19cb('0x8'));var csv=require(_0x19cb('0x9'));var ejs=require(_0x19cb('0xa'));var fs=require('fs');var fs_extra=require(_0x19cb('0xb'));var _=require(_0x19cb('0xc'));var squel=require(_0x19cb('0xd'));var crypto=require(_0x19cb('0xe'));var jsforce=require(_0x19cb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x19cb('0x9'));var querystring=require(_0x19cb('0x10'));var Papa=require('papaparse');var Redis=require(_0x19cb('0x11'));var authService=require(_0x19cb('0x12'));var qs=require(_0x19cb('0x13'));var as=require(_0x19cb('0x14'));var hardwareService=require(_0x19cb('0x15'));var logger=require('../../config/logger')(_0x19cb('0x16'));var utils=require(_0x19cb('0x17'));var config=require(_0x19cb('0x18'));var licenseUtil=require(_0x19cb('0x19'));var db=require(_0x19cb('0x1a'))['db'];function respondWithStatusCode(_0x44725b,_0x30306b){_0x30306b=_0x30306b||0xcc;return function(_0x176a00){if(_0x176a00){return _0x44725b['sendStatus'](_0x30306b);}return _0x44725b['status'](_0x30306b)[_0x19cb('0x1b')]();};}function respondWithResult(_0x48c593,_0x24286b){_0x24286b=_0x24286b||0xc8;return function(_0x1ce93f){if(_0x1ce93f){return _0x48c593[_0x19cb('0x1c')](_0x24286b)[_0x19cb('0x1d')](_0x1ce93f);}};}function respondWithFilteredResult(_0x4e0e90,_0x105bfb){return function(_0x27763e){if(_0x27763e){var _0x3a96d9=typeof _0x105bfb[_0x19cb('0x1e')]===_0x19cb('0x1f')&&typeof _0x105bfb[_0x19cb('0x20')]===_0x19cb('0x1f');var _0x43919f=_0x27763e[_0x19cb('0x21')];var _0xb6a9ff=_0x3a96d9?0x0:_0x105bfb[_0x19cb('0x1e')];var _0x12404d=_0x3a96d9?_0x27763e[_0x19cb('0x21')]:_0x105bfb[_0x19cb('0x1e')]+_0x105bfb['limit'];var _0x23caee;if(_0x12404d>=_0x43919f){_0x12404d=_0x43919f;_0x23caee=0xc8;}else{_0x23caee=0xce;}_0x4e0e90[_0x19cb('0x1c')](_0x23caee);return _0x4e0e90['set'](_0x19cb('0x22'),_0xb6a9ff+'-'+_0x12404d+'/'+_0x43919f)[_0x19cb('0x1d')](_0x27763e);}return null;};}function patchUpdates(_0x523734){return function(_0x280c66){try{jsonpatch[_0x19cb('0x23')](_0x280c66,_0x523734,!![]);}catch(_0x4ecf02){return BPromise[_0x19cb('0x24')](_0x4ecf02);}return _0x280c66[_0x19cb('0x25')]();};}function saveUpdates(_0x26a9b4,_0xf22514){return function(_0x450be1){if(_0x450be1){return _0x450be1[_0x19cb('0x26')](_0x26a9b4)['then'](function(_0x5b0658){return _0x5b0658;});}return null;};}function removeEntity(_0x463ad9,_0x4c693c){return function(_0x176076){if(_0x176076){return _0x176076[_0x19cb('0x27')]()[_0x19cb('0x28')](function(){var _0x5f54a7=_0x176076['get']({'plain':!![]});var _0xa1d1ee=_0x19cb('0x29');return db[_0x19cb('0x2a')]['destroy']({'where':{'type':_0xa1d1ee,'resourceId':_0x5f54a7['id']}})[_0x19cb('0x28')](function(){return _0x176076;});})[_0x19cb('0x28')](function(){_0x463ad9[_0x19cb('0x1c')](0xcc)[_0x19cb('0x1b')]();});}};}function handleEntityNotFound(_0x4d21fa,_0x520e41){return function(_0x41140e){if(!_0x41140e){_0x4d21fa[_0x19cb('0x2b')](0x194);}return _0x41140e;};}function handleError(_0x3d53c0,_0x420e6f){_0x420e6f=_0x420e6f||0x1f4;return function(_0x59511a){logger[_0x19cb('0x2c')](_0x59511a['stack']);if(_0x59511a[_0x19cb('0x2d')]){delete _0x59511a[_0x19cb('0x2d')];}_0x3d53c0[_0x19cb('0x1c')](_0x420e6f)['send'](_0x59511a);};}exports[_0x19cb('0x2e')]=function(_0x4948e8,_0x1aae3f){var _0x4d4713={},_0x3da6b4={},_0x88aad8={'count':0x0,'rows':[]};var _0x375882=_[_0x19cb('0x2f')](db['Template'][_0x19cb('0x30')],function(_0x569a2f){return{'name':_0x569a2f[_0x19cb('0x31')],'type':_0x569a2f[_0x19cb('0x32')][_0x19cb('0x33')]};});_0x3da6b4['model']=_[_0x19cb('0x2f')](_0x375882,'name');_0x3da6b4[_0x19cb('0x34')]=_['keys'](_0x4948e8['query']);_0x3da6b4[_0x19cb('0x35')]=_[_0x19cb('0x36')](_0x3da6b4[_0x19cb('0x37')],_0x3da6b4['query']);_0x4d4713[_0x19cb('0x38')]=_[_0x19cb('0x36')](_0x3da6b4['model'],qs['fields'](_0x4948e8[_0x19cb('0x34')][_0x19cb('0x39')]));_0x4d4713['attributes']=_0x4d4713[_0x19cb('0x38')]['length']?_0x4d4713[_0x19cb('0x38')]:_0x3da6b4['model'];if(!_0x4948e8['query'][_0x19cb('0x3a')](_0x19cb('0x3b'))){_0x4d4713[_0x19cb('0x20')]=qs['limit'](_0x4948e8['query'][_0x19cb('0x20')]);_0x4d4713[_0x19cb('0x1e')]=qs[_0x19cb('0x1e')](_0x4948e8[_0x19cb('0x34')]['offset']);}_0x4d4713[_0x19cb('0x3c')]=qs[_0x19cb('0x3d')](_0x4948e8[_0x19cb('0x34')][_0x19cb('0x3d')]);_0x4d4713['where']=qs[_0x19cb('0x35')](_['pick'](_0x4948e8[_0x19cb('0x34')],_0x3da6b4[_0x19cb('0x35')]),_0x375882);if(_0x4948e8[_0x19cb('0x34')]['filter']){_0x4d4713[_0x19cb('0x3e')]=_['merge'](_0x4d4713['where'],{'$or':_[_0x19cb('0x2f')](_0x375882,function(_0x4a7d82){if(_0x4a7d82[_0x19cb('0x32')]!==_0x19cb('0x3f')){var _0x153769={};_0x153769[_0x4a7d82[_0x19cb('0x2d')]]={'$like':'%'+_0x4948e8[_0x19cb('0x34')][_0x19cb('0x40')]+'%'};return _0x153769;}})});}_0x4d4713=_[_0x19cb('0x41')]({},_0x4d4713,_0x4948e8[_0x19cb('0x42')]);var _0x269557={'where':_0x4d4713[_0x19cb('0x3e')]};return db[_0x19cb('0x43')][_0x19cb('0x21')](_0x269557)[_0x19cb('0x28')](function(_0x413057){_0x88aad8[_0x19cb('0x21')]=_0x413057;if(_0x4948e8[_0x19cb('0x34')][_0x19cb('0x44')]){_0x4d4713['include']=[{'all':!![]}];}return db[_0x19cb('0x43')][_0x19cb('0x45')](_0x4d4713);})[_0x19cb('0x28')](function(_0x383e1d){_0x88aad8['rows']=_0x383e1d;return _0x88aad8;})[_0x19cb('0x28')](respondWithFilteredResult(_0x1aae3f,_0x4d4713))[_0x19cb('0x46')](handleError(_0x1aae3f,null));};exports[_0x19cb('0x47')]=function(_0x39597e,_0x4a5046){var _0x1c6376={'raw':!![],'where':{'id':_0x39597e[_0x19cb('0x48')]['id']}},_0x2ffd57={};_0x2ffd57[_0x19cb('0x37')]=_[_0x19cb('0x49')](db['Template']['rawAttributes']);_0x2ffd57[_0x19cb('0x34')]=_['keys'](_0x39597e[_0x19cb('0x34')]);_0x2ffd57[_0x19cb('0x35')]=_[_0x19cb('0x36')](_0x2ffd57[_0x19cb('0x37')],_0x2ffd57[_0x19cb('0x34')]);_0x1c6376['attributes']=_[_0x19cb('0x36')](_0x2ffd57[_0x19cb('0x37')],qs[_0x19cb('0x39')](_0x39597e[_0x19cb('0x34')][_0x19cb('0x39')]));_0x1c6376[_0x19cb('0x38')]=_0x1c6376[_0x19cb('0x38')]['length']?_0x1c6376['attributes']:_0x2ffd57[_0x19cb('0x37')];if(_0x39597e[_0x19cb('0x34')][_0x19cb('0x44')]){_0x1c6376[_0x19cb('0x4a')]=[{'all':!![]}];}_0x1c6376=_[_0x19cb('0x41')]({},_0x1c6376,_0x39597e[_0x19cb('0x42')]);return db[_0x19cb('0x43')][_0x19cb('0x4b')](_0x1c6376)['then'](handleEntityNotFound(_0x4a5046,null))[_0x19cb('0x28')](respondWithResult(_0x4a5046,null))[_0x19cb('0x46')](handleError(_0x4a5046,null));};exports[_0x19cb('0x4c')]=function(_0x3e1f3b,_0x5cbe11){return db[_0x19cb('0x43')][_0x19cb('0x4c')](_0x3e1f3b[_0x19cb('0x4d')],{})[_0x19cb('0x28')](function(_0x52e28c){var _0x116fc5=_0x3e1f3b[_0x19cb('0x4e')][_0x19cb('0x4f')]({'plain':!![]});if(!_0x116fc5)throw new Error(_0x19cb('0x50'));if(_0x116fc5[_0x19cb('0x51')]===_0x19cb('0x4e')){var _0x18c6e3=_0x52e28c[_0x19cb('0x4f')]({'plain':!![]});var _0x179d58=_0x19cb('0x29');return db[_0x19cb('0x52')]['find']({'where':{'name':_0x179d58,'userProfileId':_0x116fc5[_0x19cb('0x53')]},'raw':!![]})['then'](function(_0x233258){if(_0x233258&&_0x233258[_0x19cb('0x54')]===0x0){return db[_0x19cb('0x2a')][_0x19cb('0x4c')]({'name':_0x18c6e3[_0x19cb('0x2d')],'resourceId':_0x18c6e3['id'],'type':_0x233258[_0x19cb('0x2d')],'sectionId':_0x233258['id']},{})[_0x19cb('0x28')](function(){return _0x52e28c;});}else{return _0x52e28c;}})[_0x19cb('0x46')](function(_0x27b818){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27b818);throw _0x27b818;});}return _0x52e28c;})['then'](respondWithResult(_0x5cbe11,0xc9))[_0x19cb('0x46')](handleError(_0x5cbe11,null));};exports[_0x19cb('0x26')]=function(_0x26ea91,_0x217c27){if(_0x26ea91['body']['id']){delete _0x26ea91[_0x19cb('0x4d')]['id'];}return db[_0x19cb('0x43')][_0x19cb('0x4b')]({'where':{'id':_0x26ea91['params']['id']}})['then'](handleEntityNotFound(_0x217c27,null))[_0x19cb('0x28')](saveUpdates(_0x26ea91[_0x19cb('0x4d')],null))['then'](respondWithResult(_0x217c27,null))[_0x19cb('0x46')](handleError(_0x217c27,null));};exports[_0x19cb('0x27')]=function(_0x550db5,_0x48a884){return db[_0x19cb('0x43')][_0x19cb('0x4b')]({'where':{'id':_0x550db5['params']['id']}})[_0x19cb('0x28')](handleEntityNotFound(_0x48a884,null))[_0x19cb('0x28')](removeEntity(_0x48a884,null))[_0x19cb('0x46')](handleError(_0x48a884,null));};
\ No newline at end of file
+var _0x3a04=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','Templates','UserProfileResource','destroy','end','error','stack','name','index','map','Template','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3a04,0x14d));var _0x43a0=function(_0x28ea86,_0x15dee1){_0x28ea86=_0x28ea86-0x0;var _0x45bf56=_0x3a04[_0x28ea86];return _0x45bf56;};'use strict';var emlformat=require(_0x43a0('0x0'));var rimraf=require(_0x43a0('0x1'));var zipdir=require(_0x43a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43a0('0x3'));var moment=require('moment');var BPromise=require(_0x43a0('0x4'));var Mustache=require(_0x43a0('0x5'));var util=require(_0x43a0('0x6'));var path=require(_0x43a0('0x7'));var sox=require(_0x43a0('0x8'));var csv=require(_0x43a0('0x9'));var ejs=require(_0x43a0('0xa'));var fs=require('fs');var fs_extra=require(_0x43a0('0xb'));var _=require('lodash');var squel=require(_0x43a0('0xc'));var crypto=require(_0x43a0('0xd'));var jsforce=require(_0x43a0('0xe'));var deskjs=require(_0x43a0('0xf'));var toCsv=require(_0x43a0('0x9'));var querystring=require(_0x43a0('0x10'));var Papa=require('papaparse');var Redis=require(_0x43a0('0x11'));var authService=require(_0x43a0('0x12'));var qs=require(_0x43a0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43a0('0x14'));var logger=require('../../config/logger')(_0x43a0('0x15'));var utils=require(_0x43a0('0x16'));var config=require(_0x43a0('0x17'));var licenseUtil=require(_0x43a0('0x18'));var db=require(_0x43a0('0x19'))['db'];function respondWithStatusCode(_0xfbeb2b,_0xfac4ad){_0xfac4ad=_0xfac4ad||0xcc;return function(_0x27fac7){if(_0x27fac7){return _0xfbeb2b[_0x43a0('0x1a')](_0xfac4ad);}return _0xfbeb2b['status'](_0xfac4ad)['end']();};}function respondWithResult(_0x1164fa,_0x23b4b2){_0x23b4b2=_0x23b4b2||0xc8;return function(_0x1b9593){if(_0x1b9593){return _0x1164fa[_0x43a0('0x1b')](_0x23b4b2)[_0x43a0('0x1c')](_0x1b9593);}};}function respondWithFilteredResult(_0x4b91c7,_0x1dca50){return function(_0x5558ff){if(_0x5558ff){var _0x5561d2=typeof _0x1dca50['offset']===_0x43a0('0x1d')&&typeof _0x1dca50[_0x43a0('0x1e')]===_0x43a0('0x1d');var _0x3083cd=_0x5558ff[_0x43a0('0x1f')];var _0x277819=_0x5561d2?0x0:_0x1dca50['offset'];var _0x536eda=_0x5561d2?_0x5558ff[_0x43a0('0x1f')]:_0x1dca50[_0x43a0('0x20')]+_0x1dca50[_0x43a0('0x1e')];var _0x37a7f0;if(_0x536eda>=_0x3083cd){_0x536eda=_0x3083cd;_0x37a7f0=0xc8;}else{_0x37a7f0=0xce;}_0x4b91c7[_0x43a0('0x1b')](_0x37a7f0);return _0x4b91c7[_0x43a0('0x21')](_0x43a0('0x22'),_0x277819+'-'+_0x536eda+'/'+_0x3083cd)[_0x43a0('0x1c')](_0x5558ff);}return null;};}function patchUpdates(_0x53bcff){return function(_0x3f32c9){try{jsonpatch[_0x43a0('0x23')](_0x3f32c9,_0x53bcff,!![]);}catch(_0x2066de){return BPromise[_0x43a0('0x24')](_0x2066de);}return _0x3f32c9['save']();};}function saveUpdates(_0x4008a4,_0x1063ec){return function(_0x3993af){if(_0x3993af){return _0x3993af[_0x43a0('0x25')](_0x4008a4)[_0x43a0('0x26')](function(_0x389552){return _0x389552;});}return null;};}function removeEntity(_0x5993b1,_0x3e2b19){return function(_0x11cebf){if(_0x11cebf){return _0x11cebf['destroy']()[_0x43a0('0x26')](function(){var _0x5a5988=_0x11cebf['get']({'plain':!![]});var _0x3f299f=_0x43a0('0x27');return db[_0x43a0('0x28')][_0x43a0('0x29')]({'where':{'type':_0x3f299f,'resourceId':_0x5a5988['id']}})[_0x43a0('0x26')](function(){return _0x11cebf;});})[_0x43a0('0x26')](function(){_0x5993b1[_0x43a0('0x1b')](0xcc)[_0x43a0('0x2a')]();});}};}function handleEntityNotFound(_0x35274f,_0x1805fd){return function(_0x5992e8){if(!_0x5992e8){_0x35274f[_0x43a0('0x1a')](0x194);}return _0x5992e8;};}function handleError(_0x17ac80,_0x4c4dbf){_0x4c4dbf=_0x4c4dbf||0x1f4;return function(_0x41b231){logger[_0x43a0('0x2b')](_0x41b231[_0x43a0('0x2c')]);if(_0x41b231[_0x43a0('0x2d')]){delete _0x41b231[_0x43a0('0x2d')];}_0x17ac80['status'](_0x4c4dbf)['send'](_0x41b231);};}exports[_0x43a0('0x2e')]=function(_0x14a955,_0x4ce4de){var _0x51f91b={},_0x1c39b1={},_0x3b3adb={'count':0x0,'rows':[]};var _0x27f67b=_[_0x43a0('0x2f')](db[_0x43a0('0x30')]['rawAttributes'],function(_0x53c151){return{'name':_0x53c151[_0x43a0('0x31')],'type':_0x53c151[_0x43a0('0x32')][_0x43a0('0x33')]};});_0x1c39b1[_0x43a0('0x34')]=_[_0x43a0('0x2f')](_0x27f67b,_0x43a0('0x2d'));_0x1c39b1[_0x43a0('0x35')]=_[_0x43a0('0x36')](_0x14a955[_0x43a0('0x35')]);_0x1c39b1[_0x43a0('0x37')]=_[_0x43a0('0x38')](_0x1c39b1[_0x43a0('0x34')],_0x1c39b1[_0x43a0('0x35')]);_0x51f91b[_0x43a0('0x39')]=_[_0x43a0('0x38')](_0x1c39b1[_0x43a0('0x34')],qs[_0x43a0('0x3a')](_0x14a955[_0x43a0('0x35')][_0x43a0('0x3a')]));_0x51f91b[_0x43a0('0x39')]=_0x51f91b[_0x43a0('0x39')][_0x43a0('0x3b')]?_0x51f91b[_0x43a0('0x39')]:_0x1c39b1[_0x43a0('0x34')];if(!_0x14a955[_0x43a0('0x35')][_0x43a0('0x3c')]('nolimit')){_0x51f91b['limit']=qs[_0x43a0('0x1e')](_0x14a955['query'][_0x43a0('0x1e')]);_0x51f91b['offset']=qs[_0x43a0('0x20')](_0x14a955[_0x43a0('0x35')][_0x43a0('0x20')]);}_0x51f91b[_0x43a0('0x3d')]=qs[_0x43a0('0x3e')](_0x14a955[_0x43a0('0x35')][_0x43a0('0x3e')]);_0x51f91b[_0x43a0('0x3f')]=qs[_0x43a0('0x37')](_['pick'](_0x14a955[_0x43a0('0x35')],_0x1c39b1['filters']),_0x27f67b);if(_0x14a955[_0x43a0('0x35')][_0x43a0('0x40')]){_0x51f91b[_0x43a0('0x3f')]=_['merge'](_0x51f91b[_0x43a0('0x3f')],{'$or':_[_0x43a0('0x2f')](_0x27f67b,function(_0x261c06){if(_0x261c06[_0x43a0('0x32')]!==_0x43a0('0x41')){var _0x2f47ab={};_0x2f47ab[_0x261c06[_0x43a0('0x2d')]]={'$like':'%'+_0x14a955[_0x43a0('0x35')][_0x43a0('0x40')]+'%'};return _0x2f47ab;}})});}_0x51f91b=_[_0x43a0('0x42')]({},_0x51f91b,_0x14a955[_0x43a0('0x43')]);var _0xbfcbff={'where':_0x51f91b['where']};return db[_0x43a0('0x30')][_0x43a0('0x1f')](_0xbfcbff)['then'](function(_0x59ab46){_0x3b3adb[_0x43a0('0x1f')]=_0x59ab46;if(_0x14a955[_0x43a0('0x35')][_0x43a0('0x44')]){_0x51f91b[_0x43a0('0x45')]=[{'all':!![]}];}return db[_0x43a0('0x30')][_0x43a0('0x46')](_0x51f91b);})['then'](function(_0x8f52c6){_0x3b3adb[_0x43a0('0x47')]=_0x8f52c6;return _0x3b3adb;})[_0x43a0('0x26')](respondWithFilteredResult(_0x4ce4de,_0x51f91b))['catch'](handleError(_0x4ce4de,null));};exports[_0x43a0('0x48')]=function(_0x40f583,_0x27a8b9){var _0x266f62={'raw':!![],'where':{'id':_0x40f583[_0x43a0('0x49')]['id']}},_0x43d2bd={};_0x43d2bd[_0x43a0('0x34')]=_[_0x43a0('0x36')](db[_0x43a0('0x30')][_0x43a0('0x4a')]);_0x43d2bd[_0x43a0('0x35')]=_['keys'](_0x40f583[_0x43a0('0x35')]);_0x43d2bd['filters']=_[_0x43a0('0x38')](_0x43d2bd[_0x43a0('0x34')],_0x43d2bd[_0x43a0('0x35')]);_0x266f62['attributes']=_['intersection'](_0x43d2bd[_0x43a0('0x34')],qs[_0x43a0('0x3a')](_0x40f583[_0x43a0('0x35')][_0x43a0('0x3a')]));_0x266f62[_0x43a0('0x39')]=_0x266f62['attributes'][_0x43a0('0x3b')]?_0x266f62[_0x43a0('0x39')]:_0x43d2bd['model'];if(_0x40f583[_0x43a0('0x35')]['includeAll']){_0x266f62['include']=[{'all':!![]}];}_0x266f62=_['merge']({},_0x266f62,_0x40f583['options']);return db[_0x43a0('0x30')]['find'](_0x266f62)[_0x43a0('0x26')](handleEntityNotFound(_0x27a8b9,null))[_0x43a0('0x26')](respondWithResult(_0x27a8b9,null))[_0x43a0('0x4b')](handleError(_0x27a8b9,null));};exports[_0x43a0('0x4c')]=function(_0x2dc024,_0x31e786){return db[_0x43a0('0x30')]['create'](_0x2dc024['body'],{})['then'](function(_0x40b4c2){var _0x35e729=_0x2dc024[_0x43a0('0x4d')]['get']({'plain':!![]});if(!_0x35e729)throw new Error(_0x43a0('0x4e'));if(_0x35e729[_0x43a0('0x4f')]===_0x43a0('0x4d')){var _0x8c4f79=_0x40b4c2['get']({'plain':!![]});var _0x1289f5=_0x43a0('0x27');return db[_0x43a0('0x50')][_0x43a0('0x51')]({'where':{'name':_0x1289f5,'userProfileId':_0x35e729['userProfileId']},'raw':!![]})['then'](function(_0x5bdc3e){if(_0x5bdc3e&&_0x5bdc3e['autoAssociation']===0x0){return db[_0x43a0('0x28')][_0x43a0('0x4c')]({'name':_0x8c4f79['name'],'resourceId':_0x8c4f79['id'],'type':_0x5bdc3e['name'],'sectionId':_0x5bdc3e['id']},{})[_0x43a0('0x26')](function(){return _0x40b4c2;});}else{return _0x40b4c2;}})[_0x43a0('0x4b')](function(_0x375dd9){logger[_0x43a0('0x2b')](_0x43a0('0x52'),_0x375dd9);throw _0x375dd9;});}return _0x40b4c2;})[_0x43a0('0x26')](respondWithResult(_0x31e786,0xc9))[_0x43a0('0x4b')](handleError(_0x31e786,null));};exports[_0x43a0('0x25')]=function(_0x12e182,_0x163cc5){if(_0x12e182[_0x43a0('0x53')]['id']){delete _0x12e182[_0x43a0('0x53')]['id'];}return db['Template'][_0x43a0('0x51')]({'where':{'id':_0x12e182[_0x43a0('0x49')]['id']}})['then'](handleEntityNotFound(_0x163cc5,null))[_0x43a0('0x26')](saveUpdates(_0x12e182['body'],null))[_0x43a0('0x26')](respondWithResult(_0x163cc5,null))[_0x43a0('0x4b')](handleError(_0x163cc5,null));};exports['destroy']=function(_0x2e2809,_0x141fe8){return db[_0x43a0('0x30')][_0x43a0('0x51')]({'where':{'id':_0x2e2809[_0x43a0('0x49')]['id']}})[_0x43a0('0x26')](handleEntityNotFound(_0x141fe8,null))[_0x43a0('0x26')](removeEntity(_0x141fe8,null))[_0x43a0('0x4b')](handleError(_0x141fe8,null));};
\ No newline at end of file
index 4697199..73b0ee1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb777=['define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x121886,_0x8cd8e5){var _0x20ca01=function(_0x15e144){while(--_0x15e144){_0x121886['push'](_0x121886['shift']());}};_0x20ca01(++_0x8cd8e5);}(_0xb777,0x12f));var _0x7b77=function(_0x21ce97,_0x10dbe9){_0x21ce97=_0x21ce97-0x0;var _0x10ad5e=_0xb777[_0x21ce97];return _0x10ad5e;};'use strict';var _=require(_0x7b77('0x0'));var util=require('util');var logger=require(_0x7b77('0x1'))(_0x7b77('0x2'));var moment=require(_0x7b77('0x3'));var BPromise=require(_0x7b77('0x4'));var rp=require(_0x7b77('0x5'));var fs=require('fs');var path=require(_0x7b77('0x6'));var rimraf=require(_0x7b77('0x7'));var config=require(_0x7b77('0x8'));var attributes=require('./template.attributes');module['exports']=function(_0x4eb3bd,_0x1475df){return _0x4eb3bd[_0x7b77('0x9')](_0x7b77('0xa'),attributes,{'tableName':_0x7b77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2611=['moment','bluebird','./template.attributes','define','Template','tools_templates','lodash','../../config/logger','api'];(function(_0x11521d,_0x372b9f){var _0x575b4e=function(_0x2068fc){while(--_0x2068fc){_0x11521d['push'](_0x11521d['shift']());}};_0x575b4e(++_0x372b9f);}(_0x2611,0x138));var _0x1261=function(_0x5f4c7b,_0x536a5c){_0x5f4c7b=_0x5f4c7b-0x0;var _0x586a1a=_0x2611[_0x5f4c7b];return _0x586a1a;};'use strict';var _=require(_0x1261('0x0'));var util=require('util');var logger=require(_0x1261('0x1'))(_0x1261('0x2'));var moment=require(_0x1261('0x3'));var BPromise=require(_0x1261('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1261('0x5'));module['exports']=function(_0x3065dd,_0x31f9c8){return _0x3065dd[_0x1261('0x6')](_0x1261('0x7'),attributes,{'tableName':_0x1261('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4bef649..99d4c5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27f4=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','Template','findAll','options','where','attributes','include','map','model','util','moment'];(function(_0x28f72e,_0x45e0e6){var _0x1ed7de=function(_0x2098da){while(--_0x2098da){_0x28f72e['push'](_0x28f72e['shift']());}};_0x1ed7de(++_0x45e0e6);}(_0x27f4,0x14e));var _0x427f=function(_0x8fb092,_0x883290){_0x8fb092=_0x8fb092-0x0;var _0xd63883=_0x27f4[_0x8fb092];return _0xd63883;};'use strict';var _=require('lodash');var util=require(_0x427f('0x0'));var moment=require(_0x427f('0x1'));var BPromise=require(_0x427f('0x2'));var rs=require(_0x427f('0x3'));var fs=require('fs');var Redis=require(_0x427f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x427f('0x5'));var config=require(_0x427f('0x6'));var jayson=require(_0x427f('0x7'));var client=jayson['client'][_0x427f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x372c76,_0x4e87bd,_0x19a13e){return new BPromise(function(_0x5c3cb5,_0xf22405){return client['request'](_0x372c76,_0x19a13e)['then'](function(_0x2d25a7){logger[_0x427f('0x9')](_0x427f('0xa'),_0x4e87bd,_0x427f('0xb'));logger[_0x427f('0xc')](_0x427f('0xd'),_0x4e87bd,_0x427f('0xb'),JSON[_0x427f('0xe')](_0x2d25a7));if(_0x2d25a7[_0x427f('0xf')]){if(_0x2d25a7[_0x427f('0xf')][_0x427f('0x10')]===0x1f4){logger[_0x427f('0xf')](_0x427f('0xa'),_0x4e87bd,_0x2d25a7[_0x427f('0xf')][_0x427f('0x11')]);return _0xf22405(_0x2d25a7[_0x427f('0xf')][_0x427f('0x11')]);}logger['error']('Template,\x20%s,\x20%s',_0x4e87bd,_0x2d25a7['error'][_0x427f('0x11')]);return _0x5c3cb5(_0x2d25a7['error'][_0x427f('0x11')]);}else{logger[_0x427f('0x9')](_0x427f('0xa'),_0x4e87bd,_0x427f('0xb'));_0x5c3cb5(_0x2d25a7[_0x427f('0x12')][_0x427f('0x11')]);}})['catch'](function(_0x3fe2c2){logger[_0x427f('0xf')]('Template,\x20%s,\x20%s',_0x4e87bd,_0x3fe2c2);_0xf22405(_0x3fe2c2);});});}exports[_0x427f('0x13')]=function(_0x512a65){var _0x302b4a=this;return new Promise(function(_0x57fe2a,_0x4d4e98){return db[_0x427f('0x14')][_0x427f('0x15')]({'raw':_0x512a65['options']?_0x512a65[_0x427f('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x512a65[_0x427f('0x16')]?_0x512a65[_0x427f('0x16')][_0x427f('0x17')]||null:null,'attributes':_0x512a65[_0x427f('0x16')]?_0x512a65[_0x427f('0x16')][_0x427f('0x18')]||null:null,'limit':_0x512a65[_0x427f('0x16')]?_0x512a65[_0x427f('0x16')]['limit']||null:null,'include':_0x512a65[_0x427f('0x16')]?_0x512a65['options'][_0x427f('0x19')]?_[_0x427f('0x1a')](_0x512a65[_0x427f('0x16')][_0x427f('0x19')],function(_0xf68e9d){return{'model':db[_0xf68e9d[_0x427f('0x1b')]],'as':_0xf68e9d['as'],'attributes':_0xf68e9d[_0x427f('0x18')],'include':_0xf68e9d[_0x427f('0x19')]?_['map'](_0xf68e9d[_0x427f('0x19')],function(_0xde57be){return{'model':db[_0xde57be['model']],'as':_0xde57be['as'],'attributes':_0xde57be[_0x427f('0x18')],'include':_0xde57be['include']?_[_0x427f('0x1a')](_0xde57be[_0x427f('0x19')],function(_0x59a396){return{'model':db[_0x59a396['model']],'as':_0x59a396['as'],'attributes':_0x59a396[_0x427f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29eecd){logger[_0x427f('0x9')](_0x427f('0x13'),_0x512a65);logger[_0x427f('0xc')](_0x427f('0x13'),_0x512a65,JSON[_0x427f('0xe')](_0x29eecd));_0x57fe2a(_0x29eecd);})['catch'](function(_0x2cf312){logger['error'](_0x427f('0x13'),_0x2cf312[_0x427f('0x11')],_0x512a65);_0x4d4e98(_0x302b4a[_0x427f('0xf')](0x1f4,_0x2cf312[_0x427f('0x11')]));});});};
\ No newline at end of file
+var _0x5ff9=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x1b1f04,_0xc66e12){var _0x1c0109=function(_0x3306e2){while(--_0x3306e2){_0x1b1f04['push'](_0x1b1f04['shift']());}};_0x1c0109(++_0xc66e12);}(_0x5ff9,0xb4));var _0x95ff=function(_0x3afe87,_0x2c9cc5){_0x3afe87=_0x3afe87-0x0;var _0x31ea7f=_0x5ff9[_0x3afe87];return _0x31ea7f;};'use strict';var _=require('lodash');var util=require(_0x95ff('0x0'));var moment=require(_0x95ff('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95ff('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x95ff('0x3'));var logger=require(_0x95ff('0x4'))(_0x95ff('0x5'));var config=require('../../config/environment');var jayson=require(_0x95ff('0x6'));var client=jayson['client'][_0x95ff('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d78fb,_0x102aa4,_0x8b473e){return new BPromise(function(_0x578454,_0x5ce7eb){return client[_0x95ff('0x8')](_0x3d78fb,_0x8b473e)[_0x95ff('0x9')](function(_0x7e09b7){logger[_0x95ff('0xa')](_0x95ff('0xb'),_0x102aa4,_0x95ff('0xc'));logger[_0x95ff('0xd')]('Template,\x20%s,\x20%s,\x20%s',_0x102aa4,_0x95ff('0xc'),JSON[_0x95ff('0xe')](_0x7e09b7));if(_0x7e09b7[_0x95ff('0xf')]){if(_0x7e09b7[_0x95ff('0xf')][_0x95ff('0x10')]===0x1f4){logger[_0x95ff('0xf')](_0x95ff('0xb'),_0x102aa4,_0x7e09b7['error'][_0x95ff('0x11')]);return _0x5ce7eb(_0x7e09b7['error'][_0x95ff('0x11')]);}logger[_0x95ff('0xf')]('Template,\x20%s,\x20%s',_0x102aa4,_0x7e09b7[_0x95ff('0xf')][_0x95ff('0x11')]);return _0x578454(_0x7e09b7[_0x95ff('0xf')][_0x95ff('0x11')]);}else{logger[_0x95ff('0xa')](_0x95ff('0xb'),_0x102aa4,_0x95ff('0xc'));_0x578454(_0x7e09b7[_0x95ff('0x12')][_0x95ff('0x11')]);}})[_0x95ff('0x13')](function(_0x2fe8d3){logger[_0x95ff('0xf')](_0x95ff('0xb'),_0x102aa4,_0x2fe8d3);_0x5ce7eb(_0x2fe8d3);});});}exports[_0x95ff('0x14')]=function(_0x21d39d){var _0x1f0645=this;return new Promise(function(_0x1b1972,_0x5b654b){return db[_0x95ff('0x15')][_0x95ff('0x16')]({'raw':_0x21d39d[_0x95ff('0x17')]?_0x21d39d[_0x95ff('0x17')][_0x95ff('0x18')]===undefined?!![]:![]:!![],'where':_0x21d39d[_0x95ff('0x17')]?_0x21d39d[_0x95ff('0x17')]['where']||null:null,'attributes':_0x21d39d[_0x95ff('0x17')]?_0x21d39d['options'][_0x95ff('0x19')]||null:null,'limit':_0x21d39d[_0x95ff('0x17')]?_0x21d39d[_0x95ff('0x17')][_0x95ff('0x1a')]||null:null,'include':_0x21d39d[_0x95ff('0x17')]?_0x21d39d[_0x95ff('0x17')][_0x95ff('0x1b')]?_[_0x95ff('0x1c')](_0x21d39d[_0x95ff('0x17')][_0x95ff('0x1b')],function(_0x5d2f52){return{'model':db[_0x5d2f52[_0x95ff('0x1d')]],'as':_0x5d2f52['as'],'attributes':_0x5d2f52[_0x95ff('0x19')],'include':_0x5d2f52[_0x95ff('0x1b')]?_[_0x95ff('0x1c')](_0x5d2f52['include'],function(_0x3ed0a4){return{'model':db[_0x3ed0a4['model']],'as':_0x3ed0a4['as'],'attributes':_0x3ed0a4[_0x95ff('0x19')],'include':_0x3ed0a4[_0x95ff('0x1b')]?_[_0x95ff('0x1c')](_0x3ed0a4[_0x95ff('0x1b')],function(_0x4f4430){return{'model':db[_0x4f4430['model']],'as':_0x4f4430['as'],'attributes':_0x4f4430['attributes']};}):[]};}):[]};}):[]:[]})[_0x95ff('0x9')](function(_0x15f2db){logger['info'](_0x95ff('0x14'),_0x21d39d);logger[_0x95ff('0xd')]('GetTemplate',_0x21d39d,JSON[_0x95ff('0xe')](_0x15f2db));_0x1b1972(_0x15f2db);})[_0x95ff('0x13')](function(_0x5c2700){logger[_0x95ff('0xf')](_0x95ff('0x14'),_0x5c2700[_0x95ff('0x11')],_0x21d39d);_0x5b654b(_0x1f0645[_0x95ff('0xf')](0x1f4,_0x5c2700['message']));});});};
\ No newline at end of file
index 9ebbc61..af746db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8be=['getAnyConditions','getActions','create','post','/:id/actions','addAction','put','update','delete','/:id','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xc8be,0x66));var _0xec8b=function(_0x8bad10,_0x16556e){_0x8bad10=_0x8bad10-0x0;var _0x3333e7=_0xc8be[_0x8bad10];return _0x3333e7;};'use strict';var multer=require(_0xec8b('0x0'));var util=require('util');var path=require(_0xec8b('0x1'));var timeout=require(_0xec8b('0x2'));var express=require(_0xec8b('0x3'));var router=express[_0xec8b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xec8b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec8b('0x6'));var controller=require('./trigger.controller');router[_0xec8b('0x7')]('/',auth[_0xec8b('0x8')](),controller['index']);router[_0xec8b('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xec8b('0x9')]);router[_0xec8b('0x7')](_0xec8b('0xa'),auth[_0xec8b('0x8')](),controller[_0xec8b('0xb')]);router[_0xec8b('0x7')](_0xec8b('0xc'),auth[_0xec8b('0x8')](),controller[_0xec8b('0xd')]);router['get']('/:id/actions',auth[_0xec8b('0x8')](),controller[_0xec8b('0xe')]);router['post']('/',auth[_0xec8b('0x8')](),controller[_0xec8b('0xf')]);router['post'](_0xec8b('0xa'),auth[_0xec8b('0x8')](),controller['addAllCondition']);router[_0xec8b('0x10')](_0xec8b('0xc'),auth[_0xec8b('0x8')](),controller['addAnyCondition']);router[_0xec8b('0x10')](_0xec8b('0x11'),auth['isAuthenticated'](),controller[_0xec8b('0x12')]);router[_0xec8b('0x13')]('/:id',auth[_0xec8b('0x8')](),controller[_0xec8b('0x14')]);router[_0xec8b('0x15')](_0xec8b('0x16'),auth[_0xec8b('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbed6=['../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAnyCondition','put','delete','exports','util','path','connect-timeout','../../components/auth/service'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0xbed6,0x172));var _0x6bed=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xbed6[_0x31cb5f];return _0x586042;};'use strict';var multer=require('multer');var util=require(_0x6bed('0x0'));var path=require(_0x6bed('0x1'));var timeout=require(_0x6bed('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6bed('0x3'));var interaction=require(_0x6bed('0x4'));var config=require(_0x6bed('0x5'));var controller=require(_0x6bed('0x6'));router[_0x6bed('0x7')]('/',auth[_0x6bed('0x8')](),controller[_0x6bed('0x9')]);router['get'](_0x6bed('0xa'),auth[_0x6bed('0x8')](),controller[_0x6bed('0xb')]);router['get'](_0x6bed('0xc'),auth[_0x6bed('0x8')](),controller['getAllConditions']);router['get'](_0x6bed('0xd'),auth['isAuthenticated'](),controller[_0x6bed('0xe')]);router[_0x6bed('0x7')](_0x6bed('0xf'),auth[_0x6bed('0x8')](),controller[_0x6bed('0x10')]);router[_0x6bed('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/all_conditions',auth[_0x6bed('0x8')](),controller['addAllCondition']);router[_0x6bed('0x11')](_0x6bed('0xd'),auth[_0x6bed('0x8')](),controller[_0x6bed('0x12')]);router[_0x6bed('0x11')](_0x6bed('0xf'),auth[_0x6bed('0x8')](),controller['addAction']);router[_0x6bed('0x13')](_0x6bed('0xa'),auth[_0x6bed('0x8')](),controller['update']);router[_0x6bed('0x14')](_0x6bed('0xa'),auth[_0x6bed('0x8')](),controller['destroy']);module[_0x6bed('0x15')]=router;
\ No newline at end of file
index e18ff9d..4d78d6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf07=['sequelize','exports','STRING','BOOLEAN'];(function(_0x896187,_0x3854e5){var _0x1a55ef=function(_0x443404){while(--_0x443404){_0x896187['push'](_0x896187['shift']());}};_0x1a55ef(++_0x3854e5);}(_0xdf07,0x174));var _0x7df0=function(_0x3e4c1f,_0x351f60){_0x3e4c1f=_0x3e4c1f-0x0;var _0x55853a=_0xdf07[_0x3e4c1f];return _0x55853a;};'use strict';var Sequelize=require(_0x7df0('0x0'));module[_0x7df0('0x1')]={'name':{'type':Sequelize[_0x7df0('0x2')]},'channel':{'type':Sequelize[_0x7df0('0x2')]},'description':{'type':Sequelize[_0x7df0('0x2')]},'status':{'type':Sequelize[_0x7df0('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb38b=['BOOLEAN','sequelize','STRING'];(function(_0x203238,_0x406d28){var _0xed88e8=function(_0x4b9af8){while(--_0x4b9af8){_0x203238['push'](_0x203238['shift']());}};_0xed88e8(++_0x406d28);}(_0xb38b,0x18d));var _0xbb38=function(_0x6a81b8,_0x10742e){_0x6a81b8=_0x6a81b8-0x0;var _0x753d61=_0xb38b[_0x6a81b8];return _0x753d61;};'use strict';var Sequelize=require(_0xbb38('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbb38('0x1')]},'description':{'type':Sequelize[_0xbb38('0x1')]},'status':{'type':Sequelize[_0xbb38('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 48301bf..2b1e894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe7f=['rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','count','includeAll','include','Trigger','findAll','rows','intersection','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','addAllCondition','Condition','addAnyCondition','TriggerAnyId','findOne','order','options','getAllConditions','getAnyConditions','addAction','Action','getActions','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','save','destroy','then','get','Triggers','UserProfileResource','end','error','stack','name','send','map'];(function(_0x397941,_0x2346fe){var _0x1a631f=function(_0xf21a4e){while(--_0xf21a4e){_0x397941['push'](_0x397941['shift']());}};_0x1a631f(++_0x2346fe);}(_0xfe7f,0x14d));var _0xffe7=function(_0x2e0fdd,_0x70704d){_0x2e0fdd=_0x2e0fdd-0x0;var _0x18330a=_0xfe7f[_0x2e0fdd];return _0x18330a;};'use strict';var emlformat=require(_0xffe7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffe7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffe7('0x2'));var moment=require('moment');var BPromise=require(_0xffe7('0x3'));var Mustache=require(_0xffe7('0x4'));var util=require('util');var path=require(_0xffe7('0x5'));var sox=require(_0xffe7('0x6'));var csv=require(_0xffe7('0x7'));var ejs=require(_0xffe7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffe7('0x9'));var crypto=require(_0xffe7('0xa'));var jsforce=require(_0xffe7('0xb'));var deskjs=require(_0xffe7('0xc'));var toCsv=require(_0xffe7('0x7'));var querystring=require(_0xffe7('0xd'));var Papa=require(_0xffe7('0xe'));var Redis=require(_0xffe7('0xf'));var authService=require(_0xffe7('0x10'));var qs=require(_0xffe7('0x11'));var as=require(_0xffe7('0x12'));var hardwareService=require(_0xffe7('0x13'));var logger=require(_0xffe7('0x14'))(_0xffe7('0x15'));var utils=require(_0xffe7('0x16'));var config=require(_0xffe7('0x17'));var licenseUtil=require(_0xffe7('0x18'));var db=require(_0xffe7('0x19'))['db'];function respondWithStatusCode(_0x2d5dac,_0x10f7ba){_0x10f7ba=_0x10f7ba||0xcc;return function(_0x26dec7){if(_0x26dec7){return _0x2d5dac[_0xffe7('0x1a')](_0x10f7ba);}return _0x2d5dac[_0xffe7('0x1b')](_0x10f7ba)['end']();};}function respondWithResult(_0x10a5ef,_0x533735){_0x533735=_0x533735||0xc8;return function(_0x566d2d){if(_0x566d2d){return _0x10a5ef[_0xffe7('0x1b')](_0x533735)[_0xffe7('0x1c')](_0x566d2d);}};}function respondWithFilteredResult(_0x2af053,_0x587368){return function(_0x27da89){if(_0x27da89){var _0x333325=typeof _0x587368[_0xffe7('0x1d')]==='undefined'&&typeof _0x587368['limit']===_0xffe7('0x1e');var _0x3795f7=_0x27da89['count'];var _0x1dbcab=_0x333325?0x0:_0x587368['offset'];var _0xfbf6a2=_0x333325?_0x27da89['count']:_0x587368[_0xffe7('0x1d')]+_0x587368['limit'];var _0x197d08;if(_0xfbf6a2>=_0x3795f7){_0xfbf6a2=_0x3795f7;_0x197d08=0xc8;}else{_0x197d08=0xce;}_0x2af053['status'](_0x197d08);return _0x2af053[_0xffe7('0x1f')](_0xffe7('0x20'),_0x1dbcab+'-'+_0xfbf6a2+'/'+_0x3795f7)['json'](_0x27da89);}return null;};}function patchUpdates(_0x2265ea){return function(_0x532b58){try{jsonpatch[_0xffe7('0x21')](_0x532b58,_0x2265ea,!![]);}catch(_0x1a775c){return BPromise[_0xffe7('0x22')](_0x1a775c);}return _0x532b58[_0xffe7('0x23')]();};}function saveUpdates(_0x53175c,_0xe4d325){return function(_0x2edf12){if(_0x2edf12){return _0x2edf12['update'](_0x53175c)['then'](function(_0x3b4d28){return _0x3b4d28;});}return null;};}function removeEntity(_0x38ddd2,_0x1f5eff){return function(_0x5a196a){if(_0x5a196a){return _0x5a196a[_0xffe7('0x24')]()[_0xffe7('0x25')](function(){var _0x292ded=_0x5a196a[_0xffe7('0x26')]({'plain':!![]});var _0x144b35=_0xffe7('0x27');return db[_0xffe7('0x28')][_0xffe7('0x24')]({'where':{'type':_0x144b35,'resourceId':_0x292ded['id']}})[_0xffe7('0x25')](function(){return _0x5a196a;});})[_0xffe7('0x25')](function(){_0x38ddd2['status'](0xcc)[_0xffe7('0x29')]();});}};}function handleEntityNotFound(_0x30da85,_0x3e4a05){return function(_0x5cd629){if(!_0x5cd629){_0x30da85[_0xffe7('0x1a')](0x194);}return _0x5cd629;};}function handleError(_0xe41eb3,_0x52b13e){_0x52b13e=_0x52b13e||0x1f4;return function(_0x46fd79){logger[_0xffe7('0x2a')](_0x46fd79[_0xffe7('0x2b')]);if(_0x46fd79[_0xffe7('0x2c')]){delete _0x46fd79[_0xffe7('0x2c')];}_0xe41eb3['status'](_0x52b13e)[_0xffe7('0x2d')](_0x46fd79);};}exports['index']=function(_0x2988d3,_0x56b51b){var _0x5780e2={},_0x32b34f={},_0x4c5356={'count':0x0,'rows':[]};var _0x4addd2=_[_0xffe7('0x2e')](db['Trigger'][_0xffe7('0x2f')],function(_0x33e386){return{'name':_0x33e386['fieldName'],'type':_0x33e386[_0xffe7('0x30')][_0xffe7('0x31')]};});_0x32b34f[_0xffe7('0x32')]=_[_0xffe7('0x2e')](_0x4addd2,_0xffe7('0x2c'));_0x32b34f[_0xffe7('0x33')]=_[_0xffe7('0x34')](_0x2988d3['query']);_0x32b34f['filters']=_['intersection'](_0x32b34f[_0xffe7('0x32')],_0x32b34f[_0xffe7('0x33')]);_0x5780e2[_0xffe7('0x35')]=_['intersection'](_0x32b34f[_0xffe7('0x32')],qs[_0xffe7('0x36')](_0x2988d3['query']['fields']));_0x5780e2[_0xffe7('0x35')]=_0x5780e2[_0xffe7('0x35')][_0xffe7('0x37')]?_0x5780e2[_0xffe7('0x35')]:_0x32b34f['model'];if(!_0x2988d3['query'][_0xffe7('0x38')](_0xffe7('0x39'))){_0x5780e2[_0xffe7('0x3a')]=qs[_0xffe7('0x3a')](_0x2988d3[_0xffe7('0x33')]['limit']);_0x5780e2[_0xffe7('0x1d')]=qs['offset'](_0x2988d3['query'][_0xffe7('0x1d')]);}_0x5780e2['order']=qs[_0xffe7('0x3b')](_0x2988d3['query'][_0xffe7('0x3b')]);_0x5780e2['where']=qs[_0xffe7('0x3c')](_[_0xffe7('0x3d')](_0x2988d3[_0xffe7('0x33')],_0x32b34f[_0xffe7('0x3c')]),_0x4addd2);if(_0x2988d3['query'][_0xffe7('0x3e')]){_0x5780e2[_0xffe7('0x3f')]=_[_0xffe7('0x40')](_0x5780e2[_0xffe7('0x3f')],{'$or':_['map'](_0x4addd2,function(_0x21a3da){if(_0x21a3da[_0xffe7('0x30')]!==_0xffe7('0x41')){var _0x43b776={};_0x43b776[_0x21a3da['name']]={'$like':'%'+_0x2988d3[_0xffe7('0x33')][_0xffe7('0x3e')]+'%'};return _0x43b776;}})});}_0x5780e2=_['merge']({},_0x5780e2,_0x2988d3['options']);var _0x3ef3fb={'where':_0x5780e2[_0xffe7('0x3f')]};return db['Trigger'][_0xffe7('0x42')](_0x3ef3fb)[_0xffe7('0x25')](function(_0x41ca43){_0x4c5356[_0xffe7('0x42')]=_0x41ca43;if(_0x2988d3[_0xffe7('0x33')][_0xffe7('0x43')]){_0x5780e2[_0xffe7('0x44')]=[{'all':!![]}];}return db[_0xffe7('0x45')][_0xffe7('0x46')](_0x5780e2);})[_0xffe7('0x25')](function(_0x509d1e){_0x4c5356[_0xffe7('0x47')]=_0x509d1e;return _0x4c5356;})[_0xffe7('0x25')](respondWithFilteredResult(_0x56b51b,_0x5780e2))['catch'](handleError(_0x56b51b,null));};exports['show']=function(_0x1cec82,_0x145fa5){var _0x51a0db={'raw':![],'where':{'id':_0x1cec82['params']['id']}},_0x192ec2={};_0x192ec2[_0xffe7('0x32')]=_[_0xffe7('0x34')](db[_0xffe7('0x45')][_0xffe7('0x2f')]);_0x192ec2[_0xffe7('0x33')]=_[_0xffe7('0x34')](_0x1cec82[_0xffe7('0x33')]);_0x192ec2[_0xffe7('0x3c')]=_['intersection'](_0x192ec2[_0xffe7('0x32')],_0x192ec2[_0xffe7('0x33')]);_0x51a0db[_0xffe7('0x35')]=_[_0xffe7('0x48')](_0x192ec2[_0xffe7('0x32')],qs[_0xffe7('0x36')](_0x1cec82[_0xffe7('0x33')]['fields']));_0x51a0db[_0xffe7('0x35')]=_0x51a0db['attributes'][_0xffe7('0x37')]?_0x51a0db[_0xffe7('0x35')]:_0x192ec2['model'];if(_0x1cec82[_0xffe7('0x33')]['includeAll']){_0x51a0db['include']=[{'all':!![]}];}_0x51a0db=_[_0xffe7('0x40')]({},_0x51a0db,_0x1cec82['options']);return db[_0xffe7('0x45')][_0xffe7('0x49')](_0x51a0db)['then'](handleEntityNotFound(_0x145fa5,null))[_0xffe7('0x25')](respondWithResult(_0x145fa5,null))[_0xffe7('0x4a')](handleError(_0x145fa5,null));};exports[_0xffe7('0x4b')]=function(_0x316281,_0x4f40a4){return db[_0xffe7('0x45')]['create'](_0x316281[_0xffe7('0x4c')],{})[_0xffe7('0x25')](function(_0x3257dc){var _0x40f610=_0x316281[_0xffe7('0x4d')][_0xffe7('0x26')]({'plain':!![]});if(!_0x40f610)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40f610[_0xffe7('0x4e')]===_0xffe7('0x4d')){var _0x18a7f9=_0x3257dc['get']({'plain':!![]});var _0x42ab8f='Triggers';return db[_0xffe7('0x4f')]['find']({'where':{'name':_0x42ab8f,'userProfileId':_0x40f610[_0xffe7('0x50')]},'raw':!![]})[_0xffe7('0x25')](function(_0x3e4116){if(_0x3e4116&&_0x3e4116[_0xffe7('0x51')]===0x0){return db[_0xffe7('0x28')]['create']({'name':_0x18a7f9['name'],'resourceId':_0x18a7f9['id'],'type':_0x3e4116[_0xffe7('0x2c')],'sectionId':_0x3e4116['id']},{})[_0xffe7('0x25')](function(){return _0x3257dc;});}else{return _0x3257dc;}})[_0xffe7('0x4a')](function(_0x11c014){logger[_0xffe7('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11c014);throw _0x11c014;});}return _0x3257dc;})[_0xffe7('0x25')](respondWithResult(_0x4f40a4,0xc9))['catch'](handleError(_0x4f40a4,null));};exports['update']=function(_0x29c897,_0x5bf75c){if(_0x29c897[_0xffe7('0x4c')]['id']){delete _0x29c897[_0xffe7('0x4c')]['id'];}return db['Trigger'][_0xffe7('0x49')]({'where':{'id':_0x29c897[_0xffe7('0x52')]['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x5bf75c,null))[_0xffe7('0x25')](saveUpdates(_0x29c897['body'],null))[_0xffe7('0x25')](respondWithResult(_0x5bf75c,null))[_0xffe7('0x4a')](handleError(_0x5bf75c,null));};exports[_0xffe7('0x24')]=function(_0x34aae6,_0x180084){return db[_0xffe7('0x45')]['find']({'where':{'id':_0x34aae6[_0xffe7('0x52')]['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x180084,null))['then'](removeEntity(_0x180084,null))['catch'](handleError(_0x180084,null));};exports[_0xffe7('0x53')]=function(_0x316ffc,_0x3b08f0,_0x2384db){if(_0x316ffc['body']['id']){delete _0x316ffc[_0xffe7('0x4c')]['id'];}return db[_0xffe7('0x45')][_0xffe7('0x49')]({'where':{'id':_0x316ffc[_0xffe7('0x52')]['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x3b08f0,null))[_0xffe7('0x25')](function(_0x5335e0){if(_0x5335e0){_0x316ffc[_0xffe7('0x4c')]['TriggerAllId']=_0x5335e0['id'];return db[_0xffe7('0x54')]['create'](_0x316ffc[_0xffe7('0x4c')]);}})[_0xffe7('0x25')](respondWithResult(_0x3b08f0,null))[_0xffe7('0x4a')](handleError(_0x3b08f0,null));};exports[_0xffe7('0x55')]=function(_0x11f69a,_0x5b055c,_0x462331){if(_0x11f69a[_0xffe7('0x4c')]['id']){delete _0x11f69a[_0xffe7('0x4c')]['id'];}return db[_0xffe7('0x45')][_0xffe7('0x49')]({'where':{'id':_0x11f69a[_0xffe7('0x52')]['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x5b055c,null))[_0xffe7('0x25')](function(_0x1de65b){if(_0x1de65b){_0x11f69a[_0xffe7('0x4c')][_0xffe7('0x56')]=_0x1de65b['id'];return db[_0xffe7('0x54')][_0xffe7('0x4b')](_0x11f69a[_0xffe7('0x4c')]);}})[_0xffe7('0x25')](respondWithResult(_0x5b055c,null))[_0xffe7('0x4a')](handleError(_0x5b055c,null));};exports['getAllConditions']=function(_0x3ef67d,_0x3925da,_0x2dfc61){var _0x1e9aba={};var _0x41df28={};var _0x4f1bce;var _0x28120f;return db['Trigger'][_0xffe7('0x57')]({'where':{'id':_0x3ef67d[_0xffe7('0x52')]['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x3925da,null))[_0xffe7('0x25')](function(_0x44b48d){if(_0x44b48d){_0x4f1bce=_0x44b48d;_0x41df28[_0xffe7('0x32')]=_['keys'](db['Condition']['rawAttributes']);_0x41df28['query']=_[_0xffe7('0x34')](_0x3ef67d[_0xffe7('0x33')]);_0x41df28[_0xffe7('0x3c')]=_[_0xffe7('0x48')](_0x41df28[_0xffe7('0x32')],_0x41df28['query']);_0x1e9aba[_0xffe7('0x35')]=_[_0xffe7('0x48')](_0x41df28['model'],qs[_0xffe7('0x36')](_0x3ef67d[_0xffe7('0x33')][_0xffe7('0x36')]));_0x1e9aba[_0xffe7('0x35')]=_0x1e9aba[_0xffe7('0x35')]['length']?_0x1e9aba[_0xffe7('0x35')]:_0x41df28['model'];_0x1e9aba[_0xffe7('0x58')]=qs[_0xffe7('0x3b')](_0x3ef67d[_0xffe7('0x33')][_0xffe7('0x3b')]);_0x1e9aba[_0xffe7('0x3f')]=qs[_0xffe7('0x3c')](_[_0xffe7('0x3d')](_0x3ef67d[_0xffe7('0x33')],_0x41df28['filters']));if(_0x3ef67d['query'][_0xffe7('0x3e')]){_0x1e9aba[_0xffe7('0x3f')]=_[_0xffe7('0x40')](_0x1e9aba[_0xffe7('0x3f')],{'$or':_[_0xffe7('0x2e')](_0x1e9aba[_0xffe7('0x35')],function(_0x4dc3fd){var _0x1fce90={};_0x1fce90[_0x4dc3fd]={'$like':'%'+_0x3ef67d[_0xffe7('0x33')][_0xffe7('0x3e')]+'%'};return _0x1fce90;})});}_0x1e9aba=_[_0xffe7('0x40')]({},_0x1e9aba,_0x3ef67d[_0xffe7('0x59')]);return _0x4f1bce[_0xffe7('0x5a')](_0x1e9aba);}})[_0xffe7('0x25')](function(_0x56c570){if(_0x56c570){_0x28120f=_0x56c570[_0xffe7('0x37')];if(!_0x3ef67d[_0xffe7('0x33')][_0xffe7('0x38')](_0xffe7('0x39'))){_0x1e9aba[_0xffe7('0x3a')]=qs[_0xffe7('0x3a')](_0x3ef67d[_0xffe7('0x33')][_0xffe7('0x3a')]);_0x1e9aba['offset']=qs[_0xffe7('0x1d')](_0x3ef67d['query'][_0xffe7('0x1d')]);}return _0x4f1bce[_0xffe7('0x5a')](_0x1e9aba);}})[_0xffe7('0x25')](function(_0x4e4fb1){if(_0x4e4fb1){return _0x4e4fb1?{'count':_0x28120f,'rows':_0x4e4fb1}:null;}})['then'](respondWithResult(_0x3925da,null))[_0xffe7('0x4a')](handleError(_0x3925da,null));};exports[_0xffe7('0x5b')]=function(_0x3a2d97,_0x10809f,_0x3c929b){var _0x30eaad={};var _0x29af60={};var _0x4ba85b;var _0x36afb7;return db['Trigger'][_0xffe7('0x57')]({'where':{'id':_0x3a2d97['params']['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x10809f,null))[_0xffe7('0x25')](function(_0x43a6ca){if(_0x43a6ca){_0x4ba85b=_0x43a6ca;_0x29af60[_0xffe7('0x32')]=_[_0xffe7('0x34')](db[_0xffe7('0x54')][_0xffe7('0x2f')]);_0x29af60[_0xffe7('0x33')]=_['keys'](_0x3a2d97[_0xffe7('0x33')]);_0x29af60['filters']=_[_0xffe7('0x48')](_0x29af60['model'],_0x29af60[_0xffe7('0x33')]);_0x30eaad[_0xffe7('0x35')]=_['intersection'](_0x29af60[_0xffe7('0x32')],qs[_0xffe7('0x36')](_0x3a2d97['query']['fields']));_0x30eaad['attributes']=_0x30eaad[_0xffe7('0x35')][_0xffe7('0x37')]?_0x30eaad[_0xffe7('0x35')]:_0x29af60[_0xffe7('0x32')];_0x30eaad[_0xffe7('0x58')]=qs[_0xffe7('0x3b')](_0x3a2d97[_0xffe7('0x33')]['sort']);_0x30eaad['where']=qs[_0xffe7('0x3c')](_[_0xffe7('0x3d')](_0x3a2d97[_0xffe7('0x33')],_0x29af60[_0xffe7('0x3c')]));if(_0x3a2d97['query'][_0xffe7('0x3e')]){_0x30eaad['where']=_[_0xffe7('0x40')](_0x30eaad['where'],{'$or':_[_0xffe7('0x2e')](_0x30eaad[_0xffe7('0x35')],function(_0xaad39b){var _0x66f254={};_0x66f254[_0xaad39b]={'$like':'%'+_0x3a2d97[_0xffe7('0x33')][_0xffe7('0x3e')]+'%'};return _0x66f254;})});}_0x30eaad=_[_0xffe7('0x40')]({},_0x30eaad,_0x3a2d97[_0xffe7('0x59')]);return _0x4ba85b[_0xffe7('0x5b')](_0x30eaad);}})[_0xffe7('0x25')](function(_0x2bfdb5){if(_0x2bfdb5){_0x36afb7=_0x2bfdb5[_0xffe7('0x37')];if(!_0x3a2d97['query'][_0xffe7('0x38')]('nolimit')){_0x30eaad[_0xffe7('0x3a')]=qs[_0xffe7('0x3a')](_0x3a2d97['query'][_0xffe7('0x3a')]);_0x30eaad[_0xffe7('0x1d')]=qs['offset'](_0x3a2d97[_0xffe7('0x33')][_0xffe7('0x1d')]);}return _0x4ba85b[_0xffe7('0x5b')](_0x30eaad);}})[_0xffe7('0x25')](function(_0xdfb291){if(_0xdfb291){return _0xdfb291?{'count':_0x36afb7,'rows':_0xdfb291}:null;}})[_0xffe7('0x25')](respondWithResult(_0x10809f,null))[_0xffe7('0x4a')](handleError(_0x10809f,null));};exports[_0xffe7('0x5c')]=function(_0x4d6691,_0x44cbf0,_0x401c3b){if(_0x4d6691[_0xffe7('0x4c')]['id']){delete _0x4d6691[_0xffe7('0x4c')]['id'];}return db[_0xffe7('0x45')][_0xffe7('0x49')]({'where':{'id':_0x4d6691[_0xffe7('0x52')]['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x44cbf0,null))[_0xffe7('0x25')](function(_0x15e826){if(_0x15e826){_0x4d6691[_0xffe7('0x4c')]['TriggerId']=_0x15e826['id'];return db[_0xffe7('0x5d')][_0xffe7('0x4b')](_0x4d6691[_0xffe7('0x4c')]);}})[_0xffe7('0x25')](respondWithResult(_0x44cbf0,null))[_0xffe7('0x4a')](handleError(_0x44cbf0,null));};exports[_0xffe7('0x5e')]=function(_0x32489f,_0x1f7ae4,_0x58f79c){var _0x5295ed={};var _0x51b379={};var _0x1287df;var _0x58f727;return db['Trigger'][_0xffe7('0x57')]({'where':{'id':_0x32489f[_0xffe7('0x52')]['id']}})[_0xffe7('0x25')](handleEntityNotFound(_0x1f7ae4,null))[_0xffe7('0x25')](function(_0x1d8e93){if(_0x1d8e93){_0x1287df=_0x1d8e93;_0x51b379[_0xffe7('0x32')]=_['keys'](db[_0xffe7('0x5d')][_0xffe7('0x2f')]);_0x51b379['query']=_['keys'](_0x32489f[_0xffe7('0x33')]);_0x51b379[_0xffe7('0x3c')]=_[_0xffe7('0x48')](_0x51b379[_0xffe7('0x32')],_0x51b379[_0xffe7('0x33')]);_0x5295ed[_0xffe7('0x35')]=_[_0xffe7('0x48')](_0x51b379[_0xffe7('0x32')],qs[_0xffe7('0x36')](_0x32489f['query'][_0xffe7('0x36')]));_0x5295ed[_0xffe7('0x35')]=_0x5295ed[_0xffe7('0x35')][_0xffe7('0x37')]?_0x5295ed['attributes']:_0x51b379[_0xffe7('0x32')];_0x5295ed['order']=qs[_0xffe7('0x3b')](_0x32489f[_0xffe7('0x33')]['sort']);_0x5295ed[_0xffe7('0x3f')]=qs[_0xffe7('0x3c')](_['pick'](_0x32489f[_0xffe7('0x33')],_0x51b379[_0xffe7('0x3c')]));if(_0x32489f[_0xffe7('0x33')]['filter']){_0x5295ed[_0xffe7('0x3f')]=_['merge'](_0x5295ed[_0xffe7('0x3f')],{'$or':_['map'](_0x5295ed[_0xffe7('0x35')],function(_0x2b98ee){var _0x1892f0={};_0x1892f0[_0x2b98ee]={'$like':'%'+_0x32489f[_0xffe7('0x33')][_0xffe7('0x3e')]+'%'};return _0x1892f0;})});}_0x5295ed=_[_0xffe7('0x40')]({},_0x5295ed,_0x32489f['options']);return _0x1287df[_0xffe7('0x5e')](_0x5295ed);}})[_0xffe7('0x25')](function(_0x5babaa){if(_0x5babaa){_0x58f727=_0x5babaa[_0xffe7('0x37')];if(!_0x32489f[_0xffe7('0x33')][_0xffe7('0x38')](_0xffe7('0x39'))){_0x5295ed[_0xffe7('0x3a')]=qs[_0xffe7('0x3a')](_0x32489f['query']['limit']);_0x5295ed[_0xffe7('0x1d')]=qs[_0xffe7('0x1d')](_0x32489f[_0xffe7('0x33')]['offset']);}return _0x1287df['getActions'](_0x5295ed);}})[_0xffe7('0x25')](function(_0x54353a){if(_0x54353a){return _0x54353a?{'count':_0x58f727,'rows':_0x54353a}:null;}})[_0xffe7('0x25')](respondWithResult(_0x1f7ae4,null))[_0xffe7('0x4a')](handleError(_0x1f7ae4,null));};
\ No newline at end of file
+var _0x73cd=['sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','Triggers','UserProfileResource','stack','name','index','map','Trigger','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','count','include','findAll','catch','show','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x73cd,0xfd));var _0xd73c=function(_0x836c43,_0x5a3808){_0x836c43=_0x836c43-0x0;var _0x3f9fef=_0x73cd[_0x836c43];return _0x3f9fef;};'use strict';var emlformat=require(_0xd73c('0x0'));var rimraf=require(_0xd73c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd73c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd73c('0x3'));var util=require('util');var path=require('path');var sox=require(_0xd73c('0x4'));var csv=require(_0xd73c('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd73c('0x6'));var _=require(_0xd73c('0x7'));var squel=require(_0xd73c('0x8'));var crypto=require(_0xd73c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd73c('0xa'));var Papa=require(_0xd73c('0xb'));var Redis=require('ioredis');var authService=require(_0xd73c('0xc'));var qs=require(_0xd73c('0xd'));var as=require(_0xd73c('0xe'));var hardwareService=require(_0xd73c('0xf'));var logger=require(_0xd73c('0x10'))(_0xd73c('0x11'));var utils=require(_0xd73c('0x12'));var config=require(_0xd73c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df5f9,_0x36c643){_0x36c643=_0x36c643||0xcc;return function(_0x2090e9){if(_0x2090e9){return _0x2df5f9[_0xd73c('0x14')](_0x36c643);}return _0x2df5f9[_0xd73c('0x15')](_0x36c643)[_0xd73c('0x16')]();};}function respondWithResult(_0x55109a,_0x29070d){_0x29070d=_0x29070d||0xc8;return function(_0x2bb638){if(_0x2bb638){return _0x55109a[_0xd73c('0x15')](_0x29070d)[_0xd73c('0x17')](_0x2bb638);}};}function respondWithFilteredResult(_0x5db80a,_0x262aa4){return function(_0x38f4c9){if(_0x38f4c9){var _0x1ecbd8=typeof _0x262aa4[_0xd73c('0x18')]===_0xd73c('0x19')&&typeof _0x262aa4[_0xd73c('0x1a')]===_0xd73c('0x19');var _0x5054b3=_0x38f4c9['count'];var _0x1a74a6=_0x1ecbd8?0x0:_0x262aa4['offset'];var _0x470032=_0x1ecbd8?_0x38f4c9['count']:_0x262aa4[_0xd73c('0x18')]+_0x262aa4[_0xd73c('0x1a')];var _0x10415e;if(_0x470032>=_0x5054b3){_0x470032=_0x5054b3;_0x10415e=0xc8;}else{_0x10415e=0xce;}_0x5db80a[_0xd73c('0x15')](_0x10415e);return _0x5db80a[_0xd73c('0x1b')](_0xd73c('0x1c'),_0x1a74a6+'-'+_0x470032+'/'+_0x5054b3)[_0xd73c('0x17')](_0x38f4c9);}return null;};}function patchUpdates(_0x203ff7){return function(_0x2d9c7b){try{jsonpatch[_0xd73c('0x1d')](_0x2d9c7b,_0x203ff7,!![]);}catch(_0x29e756){return BPromise['reject'](_0x29e756);}return _0x2d9c7b[_0xd73c('0x1e')]();};}function saveUpdates(_0x4d6700,_0x517520){return function(_0x15663e){if(_0x15663e){return _0x15663e[_0xd73c('0x1f')](_0x4d6700)[_0xd73c('0x20')](function(_0x33539d){return _0x33539d;});}return null;};}function removeEntity(_0x3e7f48,_0x236e53){return function(_0x48eac2){if(_0x48eac2){return _0x48eac2[_0xd73c('0x21')]()['then'](function(){var _0x4e6cc7=_0x48eac2[_0xd73c('0x22')]({'plain':!![]});var _0x44cb69=_0xd73c('0x23');return db[_0xd73c('0x24')][_0xd73c('0x21')]({'where':{'type':_0x44cb69,'resourceId':_0x4e6cc7['id']}})[_0xd73c('0x20')](function(){return _0x48eac2;});})[_0xd73c('0x20')](function(){_0x3e7f48['status'](0xcc)[_0xd73c('0x16')]();});}};}function handleEntityNotFound(_0x350a60,_0x90d209){return function(_0x2f5a5d){if(!_0x2f5a5d){_0x350a60[_0xd73c('0x14')](0x194);}return _0x2f5a5d;};}function handleError(_0x3a49eb,_0x104843){_0x104843=_0x104843||0x1f4;return function(_0x3ca739){logger['error'](_0x3ca739[_0xd73c('0x25')]);if(_0x3ca739[_0xd73c('0x26')]){delete _0x3ca739[_0xd73c('0x26')];}_0x3a49eb['status'](_0x104843)['send'](_0x3ca739);};}exports[_0xd73c('0x27')]=function(_0x3603d9,_0x5c564c){var _0x343e95={},_0x24d47f={},_0x4370af={'count':0x0,'rows':[]};var _0x4b2802=_[_0xd73c('0x28')](db[_0xd73c('0x29')][_0xd73c('0x2a')],function(_0x22a038){return{'name':_0x22a038[_0xd73c('0x2b')],'type':_0x22a038[_0xd73c('0x2c')]['key']};});_0x24d47f[_0xd73c('0x2d')]=_[_0xd73c('0x28')](_0x4b2802,'name');_0x24d47f['query']=_[_0xd73c('0x2e')](_0x3603d9['query']);_0x24d47f[_0xd73c('0x2f')]=_['intersection'](_0x24d47f['model'],_0x24d47f[_0xd73c('0x30')]);_0x343e95[_0xd73c('0x31')]=_[_0xd73c('0x32')](_0x24d47f[_0xd73c('0x2d')],qs[_0xd73c('0x33')](_0x3603d9[_0xd73c('0x30')][_0xd73c('0x33')]));_0x343e95[_0xd73c('0x31')]=_0x343e95[_0xd73c('0x31')][_0xd73c('0x34')]?_0x343e95[_0xd73c('0x31')]:_0x24d47f[_0xd73c('0x2d')];if(!_0x3603d9[_0xd73c('0x30')][_0xd73c('0x35')](_0xd73c('0x36'))){_0x343e95[_0xd73c('0x1a')]=qs[_0xd73c('0x1a')](_0x3603d9[_0xd73c('0x30')][_0xd73c('0x1a')]);_0x343e95[_0xd73c('0x18')]=qs[_0xd73c('0x18')](_0x3603d9[_0xd73c('0x30')]['offset']);}_0x343e95['order']=qs['sort'](_0x3603d9[_0xd73c('0x30')][_0xd73c('0x37')]);_0x343e95['where']=qs[_0xd73c('0x2f')](_[_0xd73c('0x38')](_0x3603d9[_0xd73c('0x30')],_0x24d47f[_0xd73c('0x2f')]),_0x4b2802);if(_0x3603d9[_0xd73c('0x30')][_0xd73c('0x39')]){_0x343e95[_0xd73c('0x3a')]=_[_0xd73c('0x3b')](_0x343e95[_0xd73c('0x3a')],{'$or':_[_0xd73c('0x28')](_0x4b2802,function(_0x3c1e85){if(_0x3c1e85[_0xd73c('0x2c')]!=='VIRTUAL'){var _0x2da43b={};_0x2da43b[_0x3c1e85[_0xd73c('0x26')]]={'$like':'%'+_0x3603d9['query'][_0xd73c('0x39')]+'%'};return _0x2da43b;}})});}_0x343e95=_[_0xd73c('0x3b')]({},_0x343e95,_0x3603d9[_0xd73c('0x3c')]);var _0x13f2d7={'where':_0x343e95[_0xd73c('0x3a')]};return db[_0xd73c('0x29')][_0xd73c('0x3d')](_0x13f2d7)[_0xd73c('0x20')](function(_0x22ac03){_0x4370af[_0xd73c('0x3d')]=_0x22ac03;if(_0x3603d9['query']['includeAll']){_0x343e95[_0xd73c('0x3e')]=[{'all':!![]}];}return db[_0xd73c('0x29')][_0xd73c('0x3f')](_0x343e95);})[_0xd73c('0x20')](function(_0x305398){_0x4370af['rows']=_0x305398;return _0x4370af;})['then'](respondWithFilteredResult(_0x5c564c,_0x343e95))[_0xd73c('0x40')](handleError(_0x5c564c,null));};exports[_0xd73c('0x41')]=function(_0x5eb108,_0x43d3a4){var _0x16ffcb={'raw':![],'where':{'id':_0x5eb108[_0xd73c('0x42')]['id']}},_0x34e586={};_0x34e586[_0xd73c('0x2d')]=_[_0xd73c('0x2e')](db['Trigger'][_0xd73c('0x2a')]);_0x34e586[_0xd73c('0x30')]=_[_0xd73c('0x2e')](_0x5eb108[_0xd73c('0x30')]);_0x34e586[_0xd73c('0x2f')]=_[_0xd73c('0x32')](_0x34e586['model'],_0x34e586[_0xd73c('0x30')]);_0x16ffcb['attributes']=_['intersection'](_0x34e586[_0xd73c('0x2d')],qs[_0xd73c('0x33')](_0x5eb108[_0xd73c('0x30')][_0xd73c('0x33')]));_0x16ffcb[_0xd73c('0x31')]=_0x16ffcb[_0xd73c('0x31')][_0xd73c('0x34')]?_0x16ffcb['attributes']:_0x34e586[_0xd73c('0x2d')];if(_0x5eb108[_0xd73c('0x30')][_0xd73c('0x43')]){_0x16ffcb[_0xd73c('0x3e')]=[{'all':!![]}];}_0x16ffcb=_['merge']({},_0x16ffcb,_0x5eb108[_0xd73c('0x3c')]);return db[_0xd73c('0x29')][_0xd73c('0x44')](_0x16ffcb)[_0xd73c('0x20')](handleEntityNotFound(_0x43d3a4,null))[_0xd73c('0x20')](respondWithResult(_0x43d3a4,null))['catch'](handleError(_0x43d3a4,null));};exports[_0xd73c('0x45')]=function(_0x1061b3,_0x3a4a50){return db[_0xd73c('0x29')][_0xd73c('0x45')](_0x1061b3['body'],{})[_0xd73c('0x20')](function(_0x39df9d){var _0x2b2752=_0x1061b3['user'][_0xd73c('0x22')]({'plain':!![]});if(!_0x2b2752)throw new Error(_0xd73c('0x46'));if(_0x2b2752[_0xd73c('0x47')]==='user'){var _0x43bd28=_0x39df9d[_0xd73c('0x22')]({'plain':!![]});var _0x22880f=_0xd73c('0x23');return db[_0xd73c('0x48')][_0xd73c('0x44')]({'where':{'name':_0x22880f,'userProfileId':_0x2b2752[_0xd73c('0x49')]},'raw':!![]})[_0xd73c('0x20')](function(_0xe23d4e){if(_0xe23d4e&&_0xe23d4e[_0xd73c('0x4a')]===0x0){return db[_0xd73c('0x24')][_0xd73c('0x45')]({'name':_0x43bd28[_0xd73c('0x26')],'resourceId':_0x43bd28['id'],'type':_0xe23d4e[_0xd73c('0x26')],'sectionId':_0xe23d4e['id']},{})[_0xd73c('0x20')](function(){return _0x39df9d;});}else{return _0x39df9d;}})[_0xd73c('0x40')](function(_0x5e5656){logger[_0xd73c('0x4b')](_0xd73c('0x4c'),_0x5e5656);throw _0x5e5656;});}return _0x39df9d;})[_0xd73c('0x20')](respondWithResult(_0x3a4a50,0xc9))[_0xd73c('0x40')](handleError(_0x3a4a50,null));};exports['update']=function(_0x53e0eb,_0x429869){if(_0x53e0eb['body']['id']){delete _0x53e0eb[_0xd73c('0x4d')]['id'];}return db[_0xd73c('0x29')][_0xd73c('0x44')]({'where':{'id':_0x53e0eb[_0xd73c('0x42')]['id']}})[_0xd73c('0x20')](handleEntityNotFound(_0x429869,null))[_0xd73c('0x20')](saveUpdates(_0x53e0eb[_0xd73c('0x4d')],null))[_0xd73c('0x20')](respondWithResult(_0x429869,null))[_0xd73c('0x40')](handleError(_0x429869,null));};exports[_0xd73c('0x21')]=function(_0x356bb5,_0x239a45){return db[_0xd73c('0x29')]['find']({'where':{'id':_0x356bb5[_0xd73c('0x42')]['id']}})['then'](handleEntityNotFound(_0x239a45,null))['then'](removeEntity(_0x239a45,null))['catch'](handleError(_0x239a45,null));};exports[_0xd73c('0x4e')]=function(_0x4a54d8,_0x168ecb,_0x490206){if(_0x4a54d8[_0xd73c('0x4d')]['id']){delete _0x4a54d8[_0xd73c('0x4d')]['id'];}return db[_0xd73c('0x29')]['find']({'where':{'id':_0x4a54d8[_0xd73c('0x42')]['id']}})[_0xd73c('0x20')](handleEntityNotFound(_0x168ecb,null))[_0xd73c('0x20')](function(_0x4bb0b4){if(_0x4bb0b4){_0x4a54d8['body'][_0xd73c('0x4f')]=_0x4bb0b4['id'];return db[_0xd73c('0x50')][_0xd73c('0x45')](_0x4a54d8[_0xd73c('0x4d')]);}})['then'](respondWithResult(_0x168ecb,null))[_0xd73c('0x40')](handleError(_0x168ecb,null));};exports[_0xd73c('0x51')]=function(_0x877e73,_0x16c21b,_0x525e19){if(_0x877e73['body']['id']){delete _0x877e73[_0xd73c('0x4d')]['id'];}return db[_0xd73c('0x29')][_0xd73c('0x44')]({'where':{'id':_0x877e73[_0xd73c('0x42')]['id']}})[_0xd73c('0x20')](handleEntityNotFound(_0x16c21b,null))[_0xd73c('0x20')](function(_0x331935){if(_0x331935){_0x877e73[_0xd73c('0x4d')][_0xd73c('0x52')]=_0x331935['id'];return db[_0xd73c('0x50')][_0xd73c('0x45')](_0x877e73['body']);}})[_0xd73c('0x20')](respondWithResult(_0x16c21b,null))[_0xd73c('0x40')](handleError(_0x16c21b,null));};exports['getAllConditions']=function(_0x26beb1,_0x589a48,_0xf88d99){var _0xb55d9a={};var _0x39afa4={};var _0x4b7ce5;var _0x1fe730;return db['Trigger'][_0xd73c('0x53')]({'where':{'id':_0x26beb1[_0xd73c('0x42')]['id']}})['then'](handleEntityNotFound(_0x589a48,null))['then'](function(_0xc63bbc){if(_0xc63bbc){_0x4b7ce5=_0xc63bbc;_0x39afa4[_0xd73c('0x2d')]=_[_0xd73c('0x2e')](db[_0xd73c('0x50')][_0xd73c('0x2a')]);_0x39afa4[_0xd73c('0x30')]=_[_0xd73c('0x2e')](_0x26beb1[_0xd73c('0x30')]);_0x39afa4['filters']=_[_0xd73c('0x32')](_0x39afa4['model'],_0x39afa4[_0xd73c('0x30')]);_0xb55d9a[_0xd73c('0x31')]=_['intersection'](_0x39afa4['model'],qs['fields'](_0x26beb1[_0xd73c('0x30')][_0xd73c('0x33')]));_0xb55d9a['attributes']=_0xb55d9a[_0xd73c('0x31')][_0xd73c('0x34')]?_0xb55d9a[_0xd73c('0x31')]:_0x39afa4[_0xd73c('0x2d')];_0xb55d9a[_0xd73c('0x54')]=qs[_0xd73c('0x37')](_0x26beb1[_0xd73c('0x30')][_0xd73c('0x37')]);_0xb55d9a[_0xd73c('0x3a')]=qs['filters'](_[_0xd73c('0x38')](_0x26beb1[_0xd73c('0x30')],_0x39afa4[_0xd73c('0x2f')]));if(_0x26beb1[_0xd73c('0x30')][_0xd73c('0x39')]){_0xb55d9a['where']=_['merge'](_0xb55d9a['where'],{'$or':_['map'](_0xb55d9a[_0xd73c('0x31')],function(_0x1e1cf9){var _0x81d4f={};_0x81d4f[_0x1e1cf9]={'$like':'%'+_0x26beb1[_0xd73c('0x30')][_0xd73c('0x39')]+'%'};return _0x81d4f;})});}_0xb55d9a=_[_0xd73c('0x3b')]({},_0xb55d9a,_0x26beb1[_0xd73c('0x3c')]);return _0x4b7ce5[_0xd73c('0x55')](_0xb55d9a);}})[_0xd73c('0x20')](function(_0x257664){if(_0x257664){_0x1fe730=_0x257664['length'];if(!_0x26beb1[_0xd73c('0x30')][_0xd73c('0x35')](_0xd73c('0x36'))){_0xb55d9a[_0xd73c('0x1a')]=qs[_0xd73c('0x1a')](_0x26beb1[_0xd73c('0x30')]['limit']);_0xb55d9a[_0xd73c('0x18')]=qs[_0xd73c('0x18')](_0x26beb1[_0xd73c('0x30')][_0xd73c('0x18')]);}return _0x4b7ce5[_0xd73c('0x55')](_0xb55d9a);}})[_0xd73c('0x20')](function(_0x2b4dcb){if(_0x2b4dcb){return _0x2b4dcb?{'count':_0x1fe730,'rows':_0x2b4dcb}:null;}})[_0xd73c('0x20')](respondWithResult(_0x589a48,null))[_0xd73c('0x40')](handleError(_0x589a48,null));};exports['getAnyConditions']=function(_0x9f2c3,_0x2e4493,_0x347b0d){var _0x25322c={};var _0x1fdaac={};var _0x130c81;var _0x36d9ff;return db[_0xd73c('0x29')][_0xd73c('0x53')]({'where':{'id':_0x9f2c3[_0xd73c('0x42')]['id']}})[_0xd73c('0x20')](handleEntityNotFound(_0x2e4493,null))[_0xd73c('0x20')](function(_0x1864b3){if(_0x1864b3){_0x130c81=_0x1864b3;_0x1fdaac[_0xd73c('0x2d')]=_[_0xd73c('0x2e')](db['Condition'][_0xd73c('0x2a')]);_0x1fdaac['query']=_['keys'](_0x9f2c3[_0xd73c('0x30')]);_0x1fdaac[_0xd73c('0x2f')]=_[_0xd73c('0x32')](_0x1fdaac[_0xd73c('0x2d')],_0x1fdaac['query']);_0x25322c['attributes']=_['intersection'](_0x1fdaac['model'],qs['fields'](_0x9f2c3[_0xd73c('0x30')]['fields']));_0x25322c[_0xd73c('0x31')]=_0x25322c['attributes']['length']?_0x25322c[_0xd73c('0x31')]:_0x1fdaac[_0xd73c('0x2d')];_0x25322c[_0xd73c('0x54')]=qs[_0xd73c('0x37')](_0x9f2c3['query']['sort']);_0x25322c[_0xd73c('0x3a')]=qs[_0xd73c('0x2f')](_[_0xd73c('0x38')](_0x9f2c3[_0xd73c('0x30')],_0x1fdaac[_0xd73c('0x2f')]));if(_0x9f2c3[_0xd73c('0x30')][_0xd73c('0x39')]){_0x25322c[_0xd73c('0x3a')]=_['merge'](_0x25322c['where'],{'$or':_[_0xd73c('0x28')](_0x25322c['attributes'],function(_0xb72cd8){var _0x268171={};_0x268171[_0xb72cd8]={'$like':'%'+_0x9f2c3[_0xd73c('0x30')][_0xd73c('0x39')]+'%'};return _0x268171;})});}_0x25322c=_[_0xd73c('0x3b')]({},_0x25322c,_0x9f2c3[_0xd73c('0x3c')]);return _0x130c81[_0xd73c('0x56')](_0x25322c);}})[_0xd73c('0x20')](function(_0x3d0ddb){if(_0x3d0ddb){_0x36d9ff=_0x3d0ddb[_0xd73c('0x34')];if(!_0x9f2c3[_0xd73c('0x30')][_0xd73c('0x35')](_0xd73c('0x36'))){_0x25322c[_0xd73c('0x1a')]=qs[_0xd73c('0x1a')](_0x9f2c3[_0xd73c('0x30')][_0xd73c('0x1a')]);_0x25322c[_0xd73c('0x18')]=qs[_0xd73c('0x18')](_0x9f2c3[_0xd73c('0x30')][_0xd73c('0x18')]);}return _0x130c81['getAnyConditions'](_0x25322c);}})[_0xd73c('0x20')](function(_0x86832f){if(_0x86832f){return _0x86832f?{'count':_0x36d9ff,'rows':_0x86832f}:null;}})[_0xd73c('0x20')](respondWithResult(_0x2e4493,null))['catch'](handleError(_0x2e4493,null));};exports[_0xd73c('0x57')]=function(_0x1e3fc9,_0x6f7457,_0x5a02b1){if(_0x1e3fc9['body']['id']){delete _0x1e3fc9[_0xd73c('0x4d')]['id'];}return db[_0xd73c('0x29')][_0xd73c('0x44')]({'where':{'id':_0x1e3fc9[_0xd73c('0x42')]['id']}})[_0xd73c('0x20')](handleEntityNotFound(_0x6f7457,null))['then'](function(_0x27633c){if(_0x27633c){_0x1e3fc9[_0xd73c('0x4d')][_0xd73c('0x58')]=_0x27633c['id'];return db[_0xd73c('0x59')][_0xd73c('0x45')](_0x1e3fc9[_0xd73c('0x4d')]);}})[_0xd73c('0x20')](respondWithResult(_0x6f7457,null))[_0xd73c('0x40')](handleError(_0x6f7457,null));};exports[_0xd73c('0x5a')]=function(_0x4797b2,_0x837d34,_0x1503d3){var _0xe6b076={};var _0x203b57={};var _0xb5f13c;var _0x15e3fe;return db[_0xd73c('0x29')][_0xd73c('0x53')]({'where':{'id':_0x4797b2[_0xd73c('0x42')]['id']}})[_0xd73c('0x20')](handleEntityNotFound(_0x837d34,null))[_0xd73c('0x20')](function(_0x2e1787){if(_0x2e1787){_0xb5f13c=_0x2e1787;_0x203b57[_0xd73c('0x2d')]=_[_0xd73c('0x2e')](db[_0xd73c('0x59')][_0xd73c('0x2a')]);_0x203b57[_0xd73c('0x30')]=_[_0xd73c('0x2e')](_0x4797b2[_0xd73c('0x30')]);_0x203b57[_0xd73c('0x2f')]=_['intersection'](_0x203b57['model'],_0x203b57['query']);_0xe6b076['attributes']=_[_0xd73c('0x32')](_0x203b57[_0xd73c('0x2d')],qs[_0xd73c('0x33')](_0x4797b2[_0xd73c('0x30')][_0xd73c('0x33')]));_0xe6b076[_0xd73c('0x31')]=_0xe6b076[_0xd73c('0x31')]['length']?_0xe6b076[_0xd73c('0x31')]:_0x203b57['model'];_0xe6b076[_0xd73c('0x54')]=qs[_0xd73c('0x37')](_0x4797b2[_0xd73c('0x30')][_0xd73c('0x37')]);_0xe6b076['where']=qs[_0xd73c('0x2f')](_[_0xd73c('0x38')](_0x4797b2[_0xd73c('0x30')],_0x203b57[_0xd73c('0x2f')]));if(_0x4797b2['query'][_0xd73c('0x39')]){_0xe6b076[_0xd73c('0x3a')]=_[_0xd73c('0x3b')](_0xe6b076['where'],{'$or':_[_0xd73c('0x28')](_0xe6b076[_0xd73c('0x31')],function(_0x40e12d){var _0x35e9dd={};_0x35e9dd[_0x40e12d]={'$like':'%'+_0x4797b2[_0xd73c('0x30')]['filter']+'%'};return _0x35e9dd;})});}_0xe6b076=_['merge']({},_0xe6b076,_0x4797b2['options']);return _0xb5f13c[_0xd73c('0x5a')](_0xe6b076);}})[_0xd73c('0x20')](function(_0x389e99){if(_0x389e99){_0x15e3fe=_0x389e99['length'];if(!_0x4797b2[_0xd73c('0x30')]['hasOwnProperty'](_0xd73c('0x36'))){_0xe6b076[_0xd73c('0x1a')]=qs['limit'](_0x4797b2[_0xd73c('0x30')]['limit']);_0xe6b076[_0xd73c('0x18')]=qs['offset'](_0x4797b2[_0xd73c('0x30')][_0xd73c('0x18')]);}return _0xb5f13c['getActions'](_0xe6b076);}})[_0xd73c('0x20')](function(_0x132f93){if(_0x132f93){return _0x132f93?{'count':_0x15e3fe,'rows':_0x132f93}:null;}})[_0xd73c('0x20')](respondWithResult(_0x837d34,null))['catch'](handleError(_0x837d34,null));};
\ No newline at end of file
index edd62d4..d8be30d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207c=['api','moment','bluebird','request-promise','path','../../config/environment','define','Trigger','util','../../config/logger'];(function(_0x141ec6,_0xad8345){var _0x3f2557=function(_0x2096ca){while(--_0x2096ca){_0x141ec6['push'](_0x141ec6['shift']());}};_0x3f2557(++_0xad8345);}(_0x207c,0x1e8));var _0xc207=function(_0x1d7466,_0x161771){_0x1d7466=_0x1d7466-0x0;var _0x3ebbb6=_0x207c[_0x1d7466];return _0x3ebbb6;};'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 fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require('rimraf');var config=require(_0xc207('0x7'));var attributes=require('./trigger.attributes');module['exports']=function(_0x55023e,_0xc88789){return _0x55023e[_0xc207('0x8')](_0xc207('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c32=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x4a325a,_0x2c154c){var _0x2597a1=function(_0x437af3){while(--_0x437af3){_0x4a325a['push'](_0x4a325a['shift']());}};_0x2597a1(++_0x2c154c);}(_0x8c32,0x130));var _0x28c3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8c32[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var logger=require(_0x28c3('0x2'))(_0x28c3('0x3'));var moment=require(_0x28c3('0x4'));var BPromise=require(_0x28c3('0x5'));var rp=require(_0x28c3('0x6'));var fs=require('fs');var path=require(_0x28c3('0x7'));var rimraf=require(_0x28c3('0x8'));var config=require(_0x28c3('0x9'));var attributes=require(_0x28c3('0xa'));module[_0x28c3('0xb')]=function(_0x537b4f,_0x2861c9){return _0x537b4f[_0x28c3('0xc')](_0x28c3('0xd'),attributes,{'tableName':_0x28c3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 575c2ea..1f04df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','GetTrigger','findAll','options','raw','attributes','limit','include','model','map','ShowTrigger','Trigger','find','where','lodash'];(function(_0x560b33,_0x54a69c){var _0x15c35e=function(_0x58d087){while(--_0x58d087){_0x560b33['push'](_0x560b33['shift']());}};_0x15c35e(++_0x54a69c);}(_0x67bd,0x143));var _0xd67b=function(_0x2ffe9c,_0x181dfe){_0x2ffe9c=_0x2ffe9c-0x0;var _0xa25adb=_0x67bd[_0x2ffe9c];return _0xa25adb;};'use strict';var _=require(_0xd67b('0x0'));var util=require(_0xd67b('0x1'));var moment=require(_0xd67b('0x2'));var BPromise=require(_0xd67b('0x3'));var rs=require(_0xd67b('0x4'));var fs=require('fs');var Redis=require(_0xd67b('0x5'));var db=require(_0xd67b('0x6'))['db'];var utils=require(_0xd67b('0x7'));var logger=require(_0xd67b('0x8'))('rpc');var config=require(_0xd67b('0x9'));var jayson=require(_0xd67b('0xa'));var client=jayson[_0xd67b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c0394,_0x46596c,_0x3e4376){return new BPromise(function(_0x1fa251,_0x5095b6){return client[_0xd67b('0xc')](_0x3c0394,_0x3e4376)[_0xd67b('0xd')](function(_0x1d1414){logger[_0xd67b('0xe')](_0xd67b('0xf'),_0x46596c,'request\x20sent');logger[_0xd67b('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x46596c,'request\x20sent',JSON[_0xd67b('0x11')](_0x1d1414));if(_0x1d1414[_0xd67b('0x12')]){if(_0x1d1414['error'][_0xd67b('0x13')]===0x1f4){logger[_0xd67b('0x12')](_0xd67b('0xf'),_0x46596c,_0x1d1414[_0xd67b('0x12')]['message']);return _0x5095b6(_0x1d1414[_0xd67b('0x12')]['message']);}logger[_0xd67b('0x12')]('Trigger,\x20%s,\x20%s',_0x46596c,_0x1d1414[_0xd67b('0x12')][_0xd67b('0x14')]);return _0x1fa251(_0x1d1414[_0xd67b('0x12')][_0xd67b('0x14')]);}else{logger[_0xd67b('0xe')](_0xd67b('0xf'),_0x46596c,_0xd67b('0x15'));_0x1fa251(_0x1d1414['result'][_0xd67b('0x14')]);}})[_0xd67b('0x16')](function(_0x4db99f){logger[_0xd67b('0x12')](_0xd67b('0xf'),_0x46596c,_0x4db99f);_0x5095b6(_0x4db99f);});});}exports[_0xd67b('0x17')]=function(_0xb13d5d){var _0x28a8d2=this;return new Promise(function(_0x2d1174,_0x5e1b20){return db['Trigger'][_0xd67b('0x18')]({'raw':_0xb13d5d[_0xd67b('0x19')]?_0xb13d5d[_0xd67b('0x19')][_0xd67b('0x1a')]===undefined?!![]:![]:!![],'where':_0xb13d5d[_0xd67b('0x19')]?_0xb13d5d['options']['where']||null:null,'attributes':_0xb13d5d[_0xd67b('0x19')]?_0xb13d5d[_0xd67b('0x19')][_0xd67b('0x1b')]||null:null,'limit':_0xb13d5d['options']?_0xb13d5d['options'][_0xd67b('0x1c')]||null:null,'include':_0xb13d5d[_0xd67b('0x19')]?_0xb13d5d[_0xd67b('0x19')]['include']?_['map'](_0xb13d5d[_0xd67b('0x19')][_0xd67b('0x1d')],function(_0x235ae0){return{'model':db[_0x235ae0[_0xd67b('0x1e')]],'as':_0x235ae0['as'],'attributes':_0x235ae0['attributes'],'include':_0x235ae0[_0xd67b('0x1d')]?_[_0xd67b('0x1f')](_0x235ae0[_0xd67b('0x1d')],function(_0x38b675){return{'model':db[_0x38b675['model']],'as':_0x38b675['as'],'attributes':_0x38b675[_0xd67b('0x1b')],'include':_0x38b675[_0xd67b('0x1d')]?_[_0xd67b('0x1f')](_0x38b675[_0xd67b('0x1d')],function(_0x74ceb8){return{'model':db[_0x74ceb8['model']],'as':_0x74ceb8['as'],'attributes':_0x74ceb8[_0xd67b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd67b('0xd')](function(_0x5ed255){logger['info'](_0xd67b('0x17'),_0xb13d5d);logger[_0xd67b('0x10')](_0xd67b('0x17'),_0xb13d5d,JSON['stringify'](_0x5ed255));_0x2d1174(_0x5ed255);})[_0xd67b('0x16')](function(_0x2d67a6){logger[_0xd67b('0x12')](_0xd67b('0x17'),_0x2d67a6[_0xd67b('0x14')],_0xb13d5d);_0x5e1b20(_0x28a8d2['error'](0x1f4,_0x2d67a6['message']));});});};exports[_0xd67b('0x20')]=function(_0x4a9e87){var _0x438710=this;return new Promise(function(_0x586936,_0x1efd03){return db[_0xd67b('0x21')][_0xd67b('0x22')]({'raw':_0x4a9e87[_0xd67b('0x19')]?_0x4a9e87[_0xd67b('0x19')][_0xd67b('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a9e87[_0xd67b('0x19')]?_0x4a9e87['options'][_0xd67b('0x23')]||null:null,'attributes':_0x4a9e87['options']?_0x4a9e87[_0xd67b('0x19')][_0xd67b('0x1b')]||null:null,'include':_0x4a9e87[_0xd67b('0x19')]?_0x4a9e87[_0xd67b('0x19')][_0xd67b('0x1d')]?_[_0xd67b('0x1f')](_0x4a9e87[_0xd67b('0x19')]['include'],function(_0x249dec){return{'model':db[_0x249dec[_0xd67b('0x1e')]],'as':_0x249dec['as'],'attributes':_0x249dec[_0xd67b('0x1b')],'include':_0x249dec[_0xd67b('0x1d')]?_[_0xd67b('0x1f')](_0x249dec[_0xd67b('0x1d')],function(_0x2fff10){return{'model':db[_0x2fff10[_0xd67b('0x1e')]],'as':_0x2fff10['as'],'attributes':_0x2fff10['attributes'],'include':_0x2fff10[_0xd67b('0x1d')]?_[_0xd67b('0x1f')](_0x2fff10['include'],function(_0x4762fe){return{'model':db[_0x4762fe[_0xd67b('0x1e')]],'as':_0x4762fe['as'],'attributes':_0x4762fe[_0xd67b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x306dfd){logger[_0xd67b('0xe')](_0xd67b('0x20'),_0x4a9e87);logger[_0xd67b('0x10')]('ShowTrigger',_0x4a9e87,JSON[_0xd67b('0x11')](_0x306dfd));_0x586936(_0x306dfd);})['catch'](function(_0x582741){logger[_0xd67b('0x12')](_0xd67b('0x20'),_0x582741[_0xd67b('0x14')],_0x4a9e87);_0x1efd03(_0x438710[_0xd67b('0x12')](0x1f4,_0x582741[_0xd67b('0x14')]));});});};
\ No newline at end of file
+var _0x4959=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrigger','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x160140,_0x1691a7){var _0x38b08a=function(_0x41b9c4){while(--_0x41b9c4){_0x160140['push'](_0x160140['shift']());}};_0x38b08a(++_0x1691a7);}(_0x4959,0xd1));var _0x9495=function(_0x22a2fd,_0x596a5b){_0x22a2fd=_0x22a2fd-0x0;var _0xc95400=_0x4959[_0x22a2fd];return _0xc95400;};'use strict';var _=require('lodash');var util=require(_0x9495('0x0'));var moment=require(_0x9495('0x1'));var BPromise=require(_0x9495('0x2'));var rs=require(_0x9495('0x3'));var fs=require('fs');var Redis=require(_0x9495('0x4'));var db=require(_0x9495('0x5'))['db'];var utils=require(_0x9495('0x6'));var logger=require(_0x9495('0x7'))(_0x9495('0x8'));var config=require(_0x9495('0x9'));var jayson=require(_0x9495('0xa'));var client=jayson[_0x9495('0xb')][_0x9495('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36385b,_0x2e7708,_0x39abb0){return new BPromise(function(_0xffd1b7,_0x37b682){return client['request'](_0x36385b,_0x39abb0)[_0x9495('0xd')](function(_0x1661ac){logger[_0x9495('0xe')](_0x9495('0xf'),_0x2e7708,'request\x20sent');logger[_0x9495('0x10')](_0x9495('0x11'),_0x2e7708,_0x9495('0x12'),JSON['stringify'](_0x1661ac));if(_0x1661ac[_0x9495('0x13')]){if(_0x1661ac[_0x9495('0x13')]['code']===0x1f4){logger[_0x9495('0x13')](_0x9495('0xf'),_0x2e7708,_0x1661ac[_0x9495('0x13')]['message']);return _0x37b682(_0x1661ac[_0x9495('0x13')][_0x9495('0x14')]);}logger[_0x9495('0x13')](_0x9495('0xf'),_0x2e7708,_0x1661ac[_0x9495('0x13')][_0x9495('0x14')]);return _0xffd1b7(_0x1661ac['error'][_0x9495('0x14')]);}else{logger[_0x9495('0xe')](_0x9495('0xf'),_0x2e7708,_0x9495('0x12'));_0xffd1b7(_0x1661ac['result'][_0x9495('0x14')]);}})[_0x9495('0x15')](function(_0x59dbd8){logger[_0x9495('0x13')](_0x9495('0xf'),_0x2e7708,_0x59dbd8);_0x37b682(_0x59dbd8);});});}exports[_0x9495('0x16')]=function(_0x5569d2){var _0xa163fb=this;return new Promise(function(_0x4d6bee,_0x1f067a){return db[_0x9495('0x17')][_0x9495('0x18')]({'raw':_0x5569d2[_0x9495('0x19')]?_0x5569d2[_0x9495('0x19')][_0x9495('0x1a')]===undefined?!![]:![]:!![],'where':_0x5569d2[_0x9495('0x19')]?_0x5569d2[_0x9495('0x19')][_0x9495('0x1b')]||null:null,'attributes':_0x5569d2[_0x9495('0x19')]?_0x5569d2['options'][_0x9495('0x1c')]||null:null,'limit':_0x5569d2[_0x9495('0x19')]?_0x5569d2[_0x9495('0x19')][_0x9495('0x1d')]||null:null,'include':_0x5569d2[_0x9495('0x19')]?_0x5569d2['options'][_0x9495('0x1e')]?_[_0x9495('0x1f')](_0x5569d2[_0x9495('0x19')]['include'],function(_0x3b244e){return{'model':db[_0x3b244e[_0x9495('0x20')]],'as':_0x3b244e['as'],'attributes':_0x3b244e[_0x9495('0x1c')],'include':_0x3b244e[_0x9495('0x1e')]?_['map'](_0x3b244e[_0x9495('0x1e')],function(_0x3f7798){return{'model':db[_0x3f7798[_0x9495('0x20')]],'as':_0x3f7798['as'],'attributes':_0x3f7798[_0x9495('0x1c')],'include':_0x3f7798['include']?_['map'](_0x3f7798[_0x9495('0x1e')],function(_0x5af122){return{'model':db[_0x5af122[_0x9495('0x20')]],'as':_0x5af122['as'],'attributes':_0x5af122[_0x9495('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cb3d1){logger[_0x9495('0xe')](_0x9495('0x16'),_0x5569d2);logger[_0x9495('0x10')](_0x9495('0x16'),_0x5569d2,JSON[_0x9495('0x21')](_0x1cb3d1));_0x4d6bee(_0x1cb3d1);})['catch'](function(_0x399c86){logger[_0x9495('0x13')]('GetTrigger',_0x399c86['message'],_0x5569d2);_0x1f067a(_0xa163fb[_0x9495('0x13')](0x1f4,_0x399c86['message']));});});};exports[_0x9495('0x22')]=function(_0x2565a5){var _0x2dc9d9=this;return new Promise(function(_0x3ffd55,_0x30cb87){return db[_0x9495('0x17')][_0x9495('0x23')]({'raw':_0x2565a5[_0x9495('0x19')]?_0x2565a5[_0x9495('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2565a5[_0x9495('0x19')]?_0x2565a5[_0x9495('0x19')][_0x9495('0x1b')]||null:null,'attributes':_0x2565a5[_0x9495('0x19')]?_0x2565a5[_0x9495('0x19')][_0x9495('0x1c')]||null:null,'include':_0x2565a5[_0x9495('0x19')]?_0x2565a5[_0x9495('0x19')][_0x9495('0x1e')]?_[_0x9495('0x1f')](_0x2565a5[_0x9495('0x19')]['include'],function(_0x3d5f4d){return{'model':db[_0x3d5f4d[_0x9495('0x20')]],'as':_0x3d5f4d['as'],'attributes':_0x3d5f4d[_0x9495('0x1c')],'include':_0x3d5f4d[_0x9495('0x1e')]?_[_0x9495('0x1f')](_0x3d5f4d[_0x9495('0x1e')],function(_0x422282){return{'model':db[_0x422282[_0x9495('0x20')]],'as':_0x422282['as'],'attributes':_0x422282[_0x9495('0x1c')],'include':_0x422282[_0x9495('0x1e')]?_[_0x9495('0x1f')](_0x422282['include'],function(_0x508b2e){return{'model':db[_0x508b2e[_0x9495('0x20')]],'as':_0x508b2e['as'],'attributes':_0x508b2e[_0x9495('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9495('0xd')](function(_0x787411){logger[_0x9495('0xe')](_0x9495('0x22'),_0x2565a5);logger[_0x9495('0x10')]('ShowTrigger',_0x2565a5,JSON['stringify'](_0x787411));_0x3ffd55(_0x787411);})[_0x9495('0x15')](function(_0x59a49b){logger[_0x9495('0x13')]('ShowTrigger',_0x59a49b[_0x9495('0x14')],_0x2565a5);_0x30cb87(_0x2dc9d9[_0x9495('0x13')](0x1f4,_0x59a49b[_0x9495('0x14')]));});});};
\ No newline at end of file
index 2ef515a..649cd7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x988b=['../../components/auth/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x4b5726,_0x45fd7f){var _0x315299=function(_0x34f242){while(--_0x34f242){_0x4b5726['push'](_0x4b5726['shift']());}};_0x315299(++_0x45fd7f);}(_0x988b,0x1ab));var _0xb988=function(_0x49a60f,_0x518c48){_0x49a60f=_0x49a60f-0x0;var _0x38c29c=_0x988b[_0x49a60f];return _0x38c29c;};'use strict';var multer=require(_0xb988('0x0'));var util=require(_0xb988('0x1'));var path=require(_0xb988('0x2'));var timeout=require(_0xb988('0x3'));var express=require('express');var router=express[_0xb988('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb988('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb988('0x6'));router[_0xb988('0x7')]('/',auth[_0xb988('0x8')](),controller[_0xb988('0x9')]);router[_0xb988('0x7')](_0xb988('0xa'),auth[_0xb988('0x8')](),controller[_0xb988('0xb')]);router[_0xb988('0xc')](_0xb988('0xd'),auth['isAuthenticated'](),controller[_0xb988('0xe')]);router[_0xb988('0xc')]('/',auth[_0xb988('0x8')](),controller['create']);router['put'](_0xb988('0xa'),auth[_0xb988('0x8')](),controller[_0xb988('0xf')]);router[_0xb988('0x10')](_0xb988('0xa'),auth[_0xb988('0x8')](),controller['destroy']);module[_0xb988('0x11')]=router;
\ No newline at end of file
+var _0x40f4=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','index','get','isAuthenticated','show','/:id/clone','clone','post','create','put','update','delete','/:id','destroy'];(function(_0x214e15,_0x41b6d8){var _0x485d70=function(_0x17bc77){while(--_0x17bc77){_0x214e15['push'](_0x214e15['shift']());}};_0x485d70(++_0x41b6d8);}(_0x40f4,0xe7));var _0x440f=function(_0x171f8d,_0x5b7240){_0x171f8d=_0x171f8d-0x0;var _0x1672df=_0x40f4[_0x171f8d];return _0x1672df;};'use strict';var multer=require('multer');var util=require(_0x440f('0x0'));var path=require(_0x440f('0x1'));var timeout=require(_0x440f('0x2'));var express=require(_0x440f('0x3'));var router=express[_0x440f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x440f('0x5'));var interaction=require(_0x440f('0x6'));var config=require(_0x440f('0x7'));var controller=require(_0x440f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x440f('0x9')]);router[_0x440f('0xa')]('/:id',auth[_0x440f('0xb')](),controller[_0x440f('0xc')]);router['post'](_0x440f('0xd'),auth[_0x440f('0xb')](),controller[_0x440f('0xe')]);router[_0x440f('0xf')]('/',auth[_0x440f('0xb')](),controller[_0x440f('0x10')]);router[_0x440f('0x11')]('/:id',auth[_0x440f('0xb')](),controller[_0x440f('0x12')]);router[_0x440f('0x13')](_0x440f('0x14'),auth[_0x440f('0xb')](),controller[_0x440f('0x15')]);module[_0x440f('0x16')]=router;
\ No newline at end of file
index 6e0e48f..64e95f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0504=['force_rport,comedia','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','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','STRING','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x0504,0x18d));var _0x4050=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x0504[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x4050('0x0'));module[_0x4050('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4050('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x4'),_0x4050('0x5'),_0x4050('0x6')),'allowNull':![],'defaultValue':_0x4050('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4050('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x4050('0x8'),'ALLOWED_PASSED_SCREEN',_0x4050('0x9'),_0x4050('0xa'),_0x4050('0xb'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x4050('0xc')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4050('0xc')]},'remotesecret':{'type':Sequelize[_0x4050('0xc')]},'transport':{'type':Sequelize[_0x4050('0xc')],'defaultValue':'udp','set':function(_0x2ee74){this[_0x4050('0xd')](_0x4050('0xe'),_0x2ee74?_0x2ee74[_0x4050('0xf')](','):null);},'get':function(){return this[_0x4050('0x10')](_0x4050('0xe'))?this[_0x4050('0x10')]('transport')[_0x4050('0x11')](','):null;},'comment':_0x4050('0x12')},'dtmfmode':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x13'),_0x4050('0x14'),_0x4050('0x15'),_0x4050('0x16'),'auto'),'defaultValue':_0x4050('0x13')},'directmedia':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no',_0x4050('0x18'),_0x4050('0x19'),_0x4050('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4050('0xc')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x4050('0xc')],'defaultValue':_0x4050('0x1b'),'set':function(_0x5c7f40){this[_0x4050('0xd')](_0x4050('0x1c'),_0x5c7f40?_0x5c7f40[_0x4050('0xf')](','):null);},'get':function(){return this[_0x4050('0x10')]('nat')?this[_0x4050('0x10')](_0x4050('0x1c'))[_0x4050('0x11')](','):null;},'comment':_0x4050('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x4050('0xc')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x4050('0xc')]},'language':{'type':Sequelize[_0x4050('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4050('0xc')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4050('0xc')],'defaultValue':_0x4050('0x1e')},'allow':{'type':Sequelize[_0x4050('0xc')],'allowNull':![],'defaultValue':_0x4050('0x1f'),'set':function(_0x2fb6e9){this['setDataValue'](_0x4050('0x20'),_0x2fb6e9?_0x2fb6e9[_0x4050('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x4050('0x10')](_0x4050('0x20'))?this[_0x4050('0x10')](_0x4050('0x20'))['split'](';'):null;},'comment':_0x4050('0x21')},'autoframing':{'type':Sequelize[_0x4050('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x4050('0xc')],'defaultValue':_0x4050('0x22'),'set':function(_0x3219e3){this[_0x4050('0xd')](_0x4050('0x23'),_0x3219e3?_0x3219e3['join'](','):null);},'get':function(){return this['getDataValue'](_0x4050('0x23'))?this['getDataValue']('insecure')[_0x4050('0x11')](','):null;},'comment':_0x4050('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0x4050('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no',_0x4050('0x25'))},'promiscredir':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x4050('0x3')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x4050('0xc')]},'callerid':{'type':Sequelize[_0x4050('0xc')],'defaultValue':_0x4050('0x26')},'amaflags':{'type':Sequelize[_0x4050('0xc')]},'callcounter':{'type':Sequelize[_0x4050('0x3')]('yes','no'),'defaultValue':_0x4050('0x17')},'busylevel':{'type':Sequelize[_0x4050('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x4050('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x4050('0xc')]},'template':{'type':Sequelize[_0x4050('0xc')]},'videosupport':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4050('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4050('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x4050('0xc')]},'session_timers':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x28'),_0x4050('0x29'),_0x4050('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x4050('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x4050('0x2b'),'uas'),'defaultValue':_0x4050('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x4050('0xc')]},'regexten':{'type':Sequelize[_0x4050('0xc')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4050('0x27')](0x5)},'qualify':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x4050('0xc')]},'defaultuser':{'type':Sequelize[_0x4050('0xc')]},'rtptimeout':{'type':Sequelize[_0x4050('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4050('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4050('0x27')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x4050('0x17'),'no',_0x4050('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4050('0xc')]},'callbackextension':{'type':Sequelize[_0x4050('0xc')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x4050('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x4050('0xc')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x4050('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0x4050('0xc')]},'use_q850_reason':{'type':Sequelize[_0x4050('0xc')]},'maxforwards':{'type':Sequelize[_0x4050('0x27')](0xb)},'encryption':{'type':Sequelize[_0x4050('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'force_avp':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'icesupport':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no',_0x4050('0x2e'),_0x4050('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x4050('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4050('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0x4050('0xc')]},'dtlscipher':{'type':Sequelize[_0x4050('0xc')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x4050('0xc')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x4050('0x30'),_0x4050('0x31'),_0x4050('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4050('0xc')]},'usereqphone':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4050('0xc')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x4050('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x4050('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no')},'vmexten':{'type':Sequelize[_0x4050('0xc')]},'mohinterpret':{'type':Sequelize[_0x4050('0xc')]},'mohsuggest':{'type':Sequelize[_0x4050('0xc')]},'parkinglot':{'type':Sequelize[_0x4050('0xc')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4050('0xc')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x17'),'no',_0x4050('0x18'),'update',_0x4050('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x4050('0xc')]},'active':{'type':Sequelize[_0x4050('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4050('0xc')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x11af=['split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','uac','uas','pai','certificate','passive','actpass','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','update','outgoing','force_rport,comedia','setDataValue','nat'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x11af,0x74));var _0xf11a=function(_0x331d35,_0x36ccdb){_0x331d35=_0x331d35-0x0;var _0x51f261=_0x11af[_0x331d35];return _0x51f261;};'use strict';var Sequelize=require(_0xf11a('0x0'));module[_0xf11a('0x1')]={'name':{'type':Sequelize[_0xf11a('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x4'),'user','peer'),'allowNull':![],'defaultValue':_0xf11a('0x4')},'context':{'type':Sequelize[_0xf11a('0x2')],'allowNull':![],'defaultValue':_0xf11a('0x5')},'callingpres':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x6'),_0xf11a('0x7'),_0xf11a('0x8'),_0xf11a('0x9'),_0xf11a('0xa'),'PROHIB_PASSED_SCREEN',_0xf11a('0xb'),_0xf11a('0xc'))},'deny':{'type':Sequelize[_0xf11a('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xf11a('0x2')]},'md5secret':{'type':Sequelize[_0xf11a('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xf11a('0x2')],'defaultValue':_0xf11a('0xd'),'set':function(_0x16f153){this['setDataValue'](_0xf11a('0xe'),_0x16f153?_0x16f153[_0xf11a('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xf11a('0xe'))?this[_0xf11a('0x10')](_0xf11a('0xe'))['split'](','):null;},'comment':_0xf11a('0x11')},'dtmfmode':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x12'),_0xf11a('0x13'),_0xf11a('0x14'),_0xf11a('0x15'),'auto'),'defaultValue':_0xf11a('0x12')},'directmedia':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no','nonat',_0xf11a('0x17'),_0xf11a('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf11a('0x2')]},'directmediadeny':{'type':Sequelize[_0xf11a('0x2')]},'nat':{'type':Sequelize[_0xf11a('0x2')],'defaultValue':_0xf11a('0x19'),'set':function(_0x30e764){this[_0xf11a('0x1a')](_0xf11a('0x1b'),_0x30e764?_0x30e764[_0xf11a('0xf')](','):null);},'get':function(){return this[_0xf11a('0x10')](_0xf11a('0x1b'))?this[_0xf11a('0x10')](_0xf11a('0x1b'))[_0xf11a('0x1c')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf11a('0x2')]},'pickupgroup':{'type':Sequelize[_0xf11a('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xf11a('0x2')]},'language':{'type':Sequelize[_0xf11a('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf11a('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf11a('0x2')],'defaultValue':_0xf11a('0x1d')},'allow':{'type':Sequelize[_0xf11a('0x2')],'allowNull':![],'defaultValue':_0xf11a('0x1e'),'set':function(_0x3402a9){this[_0xf11a('0x1a')]('allow',_0x3402a9?_0x3402a9[_0xf11a('0xf')](';'):_0xf11a('0x1e'));},'get':function(){return this['getDataValue']('allow')?this[_0xf11a('0x10')](_0xf11a('0x1f'))['split'](';'):null;},'comment':_0xf11a('0x20')},'autoframing':{'type':Sequelize[_0xf11a('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xf11a('0x21'),'set':function(_0x14e04d){this[_0xf11a('0x1a')](_0xf11a('0x22'),_0x14e04d?_0x14e04d[_0xf11a('0xf')](','):null);},'get':function(){return this[_0xf11a('0x10')](_0xf11a('0x22'))?this[_0xf11a('0x10')](_0xf11a('0x22'))[_0xf11a('0x1c')](','):null;},'comment':_0xf11a('0x23')},'trustrpid':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xf11a('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0xf11a('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no')},'accountcode':{'type':Sequelize[_0xf11a('0x24')](0xb)},'setvar':{'type':Sequelize[_0xf11a('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xf11a('0x25')},'amaflags':{'type':Sequelize[_0xf11a('0x2')]},'callcounter':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no'),'defaultValue':_0xf11a('0x16')},'busylevel':{'type':Sequelize[_0xf11a('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xf11a('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xf11a('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xf11a('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0xf11a('0x16'),'no',_0xf11a('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf11a('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf11a('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xf11a('0x2')]},'session_timers':{'type':Sequelize[_0xf11a('0x3')]('accept','refuse','originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x27'),'uas'),'defaultValue':_0xf11a('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xf11a('0x2')]},'fromdomain':{'type':Sequelize[_0xf11a('0x2')]},'fromuser':{'type':Sequelize[_0xf11a('0x2')]},'port':{'type':Sequelize[_0xf11a('0x24')](0x5)},'qualify':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no'),'defaultValue':_0xf11a('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xf11a('0x2')]},'defaultuser':{'type':Sequelize[_0xf11a('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf11a('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf11a('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no',_0xf11a('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf11a('0x2')]},'callbackextension':{'type':Sequelize[_0xf11a('0x2')]},'timert1':{'type':Sequelize[_0xf11a('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xf11a('0x2')]},'contactdeny':{'type':Sequelize[_0xf11a('0x2')]},'contactacl':{'type':Sequelize[_0xf11a('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xf11a('0x2')]},'maxforwards':{'type':Sequelize[_0xf11a('0x24')](0xb)},'encryption':{'type':Sequelize[_0xf11a('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf11a('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xf11a('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no','fingerprint',_0xf11a('0x2a'))},'dtlsrekey':{'type':Sequelize[_0xf11a('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf11a('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xf11a('0x2')]},'dtlscipher':{'type':Sequelize[_0xf11a('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xf11a('0x2')]},'dtlssetup':{'type':Sequelize[_0xf11a('0x3')]('active',_0xf11a('0x2b'),_0xf11a('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf11a('0x2')]},'usereqphone':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf11a('0x2')]},'recordofffeature':{'type':Sequelize[_0xf11a('0x2')]},'call_limit':{'type':Sequelize[_0xf11a('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf11a('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xf11a('0x3')](_0xf11a('0x16'),'no')},'vmexten':{'type':Sequelize[_0xf11a('0x2')]},'mohinterpret':{'type':Sequelize[_0xf11a('0x2')]},'mohsuggest':{'type':Sequelize[_0xf11a('0x2')]},'parkinglot':{'type':Sequelize[_0xf11a('0x2')]},'description':{'type':Sequelize[_0xf11a('0x2')]},'host':{'type':Sequelize[_0xf11a('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xf11a('0x3')]('yes','no',_0xf11a('0x2d'),'update',_0xf11a('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf11a('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xf11a('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index aea95f5..3dc4bf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4b84,0x1cc));var _0x44b8=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x4b84[_0x71b765];return _0x34cb24;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x57cbe4,_0x4d4866){var _0x298400=function(_0x131318){while(--_0x131318){_0x57cbe4['push'](_0x57cbe4['shift']());}};_0x298400(++_0x4d4866);}(_0x98a8,0x12c));var _0x898a=function(_0x515359,_0x520462){_0x515359=_0x515359-0x0;var _0x441fe8=_0x98a8[_0x515359];return _0x441fe8;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));};
\ No newline at end of file
index 5084d10..a5afad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15f2=['Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define'];(function(_0x2d5576,_0x578ac9){var _0x1b3e39=function(_0x53d14a){while(--_0x53d14a){_0x2d5576['push'](_0x2d5576['shift']());}};_0x1b3e39(++_0x578ac9);}(_0x15f2,0x17b));var _0x215f=function(_0x31aa4b,_0x468550){_0x31aa4b=_0x31aa4b-0x0;var _0x49f208=_0x15f2[_0x31aa4b];return _0x49f208;};'use strict';var _=require(_0x215f('0x0'));var util=require('util');var logger=require(_0x215f('0x1'))(_0x215f('0x2'));var moment=require(_0x215f('0x3'));var BPromise=require(_0x215f('0x4'));var rp=require(_0x215f('0x5'));var fs=require('fs');var path=require(_0x215f('0x6'));var rimraf=require(_0x215f('0x7'));var config=require('../../config/environment');var attributes=require(_0x215f('0x8'));module[_0x215f('0x9')]=function(_0xb9263,_0x31e053){return _0xb9263[_0x215f('0xa')](_0x215f('0xb'),attributes,{'tableName':_0x215f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x785c=['define','Trunk','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./trunk.attributes','exports'];(function(_0x253cbf,_0x3d20b8){var _0xde8646=function(_0x1bd048){while(--_0x1bd048){_0x253cbf['push'](_0x253cbf['shift']());}};_0xde8646(++_0x3d20b8);}(_0x785c,0x9e));var _0xc785=function(_0x13dd6b,_0x57ec0e){_0x13dd6b=_0x13dd6b-0x0;var _0x4ef912=_0x785c[_0x13dd6b];return _0x4ef912;};'use strict';var _=require(_0xc785('0x0'));var util=require(_0xc785('0x1'));var logger=require(_0xc785('0x2'))(_0xc785('0x3'));var moment=require('moment');var BPromise=require(_0xc785('0x4'));var rp=require(_0xc785('0x5'));var fs=require('fs');var path=require(_0xc785('0x6'));var rimraf=require(_0xc785('0x7'));var config=require('../../config/environment');var attributes=require(_0xc785('0x8'));module[_0xc785('0x9')]=function(_0x5d30e4,_0x5646eb){return _0x5d30e4[_0xc785('0xa')](_0xc785('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8a475e9..9c546d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a06=['GetTrunk','Trunk','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0x5a06,0x1e9));var _0x65a0=function(_0x12a5ac,_0x4cb0d2){_0x12a5ac=_0x12a5ac-0x0;var _0x282958=_0x5a06[_0x12a5ac];return _0x282958;};'use strict';var _=require(_0x65a0('0x0'));var util=require(_0x65a0('0x1'));var moment=require(_0x65a0('0x2'));var BPromise=require(_0x65a0('0x3'));var rs=require(_0x65a0('0x4'));var fs=require('fs');var Redis=require(_0x65a0('0x5'));var db=require(_0x65a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x65a0('0x7'));var config=require(_0x65a0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c47fa,_0x867ed2,_0x5c3b89){return new BPromise(function(_0x336f16,_0x34d7f6){return client[_0x65a0('0xa')](_0x4c47fa,_0x5c3b89)[_0x65a0('0xb')](function(_0x3e4373){logger[_0x65a0('0xc')](_0x65a0('0xd'),_0x867ed2,_0x65a0('0xe'));logger[_0x65a0('0xf')](_0x65a0('0x10'),_0x867ed2,'request\x20sent',JSON['stringify'](_0x3e4373));if(_0x3e4373[_0x65a0('0x11')]){if(_0x3e4373[_0x65a0('0x11')][_0x65a0('0x12')]===0x1f4){logger[_0x65a0('0x11')](_0x65a0('0xd'),_0x867ed2,_0x3e4373[_0x65a0('0x11')][_0x65a0('0x13')]);return _0x34d7f6(_0x3e4373[_0x65a0('0x11')][_0x65a0('0x13')]);}logger[_0x65a0('0x11')](_0x65a0('0xd'),_0x867ed2,_0x3e4373['error'][_0x65a0('0x13')]);return _0x336f16(_0x3e4373[_0x65a0('0x11')][_0x65a0('0x13')]);}else{logger[_0x65a0('0xc')](_0x65a0('0xd'),_0x867ed2,_0x65a0('0xe'));_0x336f16(_0x3e4373['result']['message']);}})[_0x65a0('0x14')](function(_0x1190a7){logger[_0x65a0('0x11')]('Trunk,\x20%s,\x20%s',_0x867ed2,_0x1190a7);_0x34d7f6(_0x1190a7);});});}exports[_0x65a0('0x15')]=function(_0x5eb31a){var _0x360531=this;return new Promise(function(_0x390e53,_0x25b275){return db[_0x65a0('0x16')][_0x65a0('0x17')]({'raw':_0x5eb31a[_0x65a0('0x18')]?_0x5eb31a[_0x65a0('0x18')][_0x65a0('0x19')]===undefined?!![]:![]:!![],'where':_0x5eb31a[_0x65a0('0x18')]?_0x5eb31a[_0x65a0('0x18')][_0x65a0('0x1a')]||null:null,'attributes':_0x5eb31a[_0x65a0('0x18')]?_0x5eb31a['options']['attributes']||null:null,'limit':_0x5eb31a['options']?_0x5eb31a[_0x65a0('0x18')][_0x65a0('0x1b')]||null:null,'include':_0x5eb31a[_0x65a0('0x18')]?_0x5eb31a[_0x65a0('0x18')][_0x65a0('0x1c')]?_[_0x65a0('0x1d')](_0x5eb31a['options']['include'],function(_0xd201e4){return{'model':db[_0xd201e4[_0x65a0('0x1e')]],'as':_0xd201e4['as'],'attributes':_0xd201e4[_0x65a0('0x1f')],'include':_0xd201e4[_0x65a0('0x1c')]?_['map'](_0xd201e4['include'],function(_0x5b6371){return{'model':db[_0x5b6371['model']],'as':_0x5b6371['as'],'attributes':_0x5b6371[_0x65a0('0x1f')],'include':_0x5b6371[_0x65a0('0x1c')]?_[_0x65a0('0x1d')](_0x5b6371['include'],function(_0x1fcf1a){return{'model':db[_0x1fcf1a[_0x65a0('0x1e')]],'as':_0x1fcf1a['as'],'attributes':_0x1fcf1a[_0x65a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x65a0('0xb')](function(_0x2ea221){logger[_0x65a0('0xc')](_0x65a0('0x15'),_0x5eb31a);logger['debug'](_0x65a0('0x15'),_0x5eb31a,JSON[_0x65a0('0x20')](_0x2ea221));_0x390e53(_0x2ea221);})[_0x65a0('0x14')](function(_0xe5dc35){logger[_0x65a0('0x11')](_0x65a0('0x15'),_0xe5dc35[_0x65a0('0x13')],_0x5eb31a);_0x25b275(_0x360531[_0x65a0('0x11')](0x1f4,_0xe5dc35[_0x65a0('0x13')]));});});};exports['ShowTrunk']=function(_0x406e33){var _0x1896e2=this;return new Promise(function(_0x441156,_0x532ad6){return db[_0x65a0('0x16')]['find']({'raw':_0x406e33['options']?_0x406e33['options']['raw']===undefined?!![]:![]:!![],'where':_0x406e33[_0x65a0('0x18')]?_0x406e33[_0x65a0('0x18')][_0x65a0('0x1a')]||null:null,'attributes':_0x406e33[_0x65a0('0x18')]?_0x406e33[_0x65a0('0x18')][_0x65a0('0x1f')]||null:null,'include':_0x406e33[_0x65a0('0x18')]?_0x406e33[_0x65a0('0x18')]['include']?_[_0x65a0('0x1d')](_0x406e33[_0x65a0('0x18')][_0x65a0('0x1c')],function(_0x184560){return{'model':db[_0x184560[_0x65a0('0x1e')]],'as':_0x184560['as'],'attributes':_0x184560[_0x65a0('0x1f')],'include':_0x184560[_0x65a0('0x1c')]?_[_0x65a0('0x1d')](_0x184560[_0x65a0('0x1c')],function(_0x2e3ef5){return{'model':db[_0x2e3ef5[_0x65a0('0x1e')]],'as':_0x2e3ef5['as'],'attributes':_0x2e3ef5[_0x65a0('0x1f')],'include':_0x2e3ef5['include']?_[_0x65a0('0x1d')](_0x2e3ef5[_0x65a0('0x1c')],function(_0x315547){return{'model':db[_0x315547[_0x65a0('0x1e')]],'as':_0x315547['as'],'attributes':_0x315547[_0x65a0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5076b8){logger['info']('ShowTrunk',_0x406e33);logger['debug']('ShowTrunk',_0x406e33,JSON['stringify'](_0x5076b8));_0x441156(_0x5076b8);})[_0x65a0('0x14')](function(_0x51f9d4){logger[_0x65a0('0x11')](_0x65a0('0x21'),_0x51f9d4[_0x65a0('0x13')],_0x406e33);_0x532ad6(_0x1896e2[_0x65a0('0x11')](0x1f4,_0x51f9d4['message']));});});};
\ No newline at end of file
+var _0x3082=['raw','attributes','limit','include','map','model','debug','catch','ShowTrunk','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','GetTrunk','Trunk','options'];(function(_0x5e4c86,_0x30bb93){var _0x4edaa8=function(_0x11304b){while(--_0x11304b){_0x5e4c86['push'](_0x5e4c86['shift']());}};_0x4edaa8(++_0x30bb93);}(_0x3082,0x1ca));var _0x2308=function(_0x4fbc47,_0x4a994a){_0x4fbc47=_0x4fbc47-0x0;var _0x556eab=_0x3082[_0x4fbc47];return _0x556eab;};'use strict';var _=require(_0x2308('0x0'));var util=require(_0x2308('0x1'));var moment=require(_0x2308('0x2'));var BPromise=require(_0x2308('0x3'));var rs=require(_0x2308('0x4'));var fs=require('fs');var Redis=require(_0x2308('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2308('0x6'));var logger=require(_0x2308('0x7'))(_0x2308('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2308('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x523abe,_0x1caaf7,_0xe32e0a){return new BPromise(function(_0x6790f0,_0x46566c){return client[_0x2308('0xa')](_0x523abe,_0xe32e0a)['then'](function(_0x593e78){logger[_0x2308('0xb')]('Trunk,\x20%s,\x20%s',_0x1caaf7,_0x2308('0xc'));logger['debug'](_0x2308('0xd'),_0x1caaf7,_0x2308('0xc'),JSON[_0x2308('0xe')](_0x593e78));if(_0x593e78[_0x2308('0xf')]){if(_0x593e78[_0x2308('0xf')][_0x2308('0x10')]===0x1f4){logger[_0x2308('0xf')]('Trunk,\x20%s,\x20%s',_0x1caaf7,_0x593e78[_0x2308('0xf')][_0x2308('0x11')]);return _0x46566c(_0x593e78[_0x2308('0xf')]['message']);}logger[_0x2308('0xf')](_0x2308('0x12'),_0x1caaf7,_0x593e78[_0x2308('0xf')]['message']);return _0x6790f0(_0x593e78['error'][_0x2308('0x11')]);}else{logger[_0x2308('0xb')]('Trunk,\x20%s,\x20%s',_0x1caaf7,_0x2308('0xc'));_0x6790f0(_0x593e78['result'][_0x2308('0x11')]);}})['catch'](function(_0x3528bf){logger[_0x2308('0xf')](_0x2308('0x12'),_0x1caaf7,_0x3528bf);_0x46566c(_0x3528bf);});});}exports[_0x2308('0x13')]=function(_0x260d9f){var _0x3bf542=this;return new Promise(function(_0x1d9439,_0x5e6f41){return db[_0x2308('0x14')]['findAll']({'raw':_0x260d9f[_0x2308('0x15')]?_0x260d9f[_0x2308('0x15')][_0x2308('0x16')]===undefined?!![]:![]:!![],'where':_0x260d9f[_0x2308('0x15')]?_0x260d9f[_0x2308('0x15')]['where']||null:null,'attributes':_0x260d9f['options']?_0x260d9f['options'][_0x2308('0x17')]||null:null,'limit':_0x260d9f[_0x2308('0x15')]?_0x260d9f['options'][_0x2308('0x18')]||null:null,'include':_0x260d9f[_0x2308('0x15')]?_0x260d9f[_0x2308('0x15')][_0x2308('0x19')]?_[_0x2308('0x1a')](_0x260d9f[_0x2308('0x15')]['include'],function(_0x449938){return{'model':db[_0x449938[_0x2308('0x1b')]],'as':_0x449938['as'],'attributes':_0x449938[_0x2308('0x17')],'include':_0x449938[_0x2308('0x19')]?_[_0x2308('0x1a')](_0x449938['include'],function(_0x11f722){return{'model':db[_0x11f722[_0x2308('0x1b')]],'as':_0x11f722['as'],'attributes':_0x11f722[_0x2308('0x17')],'include':_0x11f722[_0x2308('0x19')]?_[_0x2308('0x1a')](_0x11f722['include'],function(_0x57ed9b){return{'model':db[_0x57ed9b[_0x2308('0x1b')]],'as':_0x57ed9b['as'],'attributes':_0x57ed9b[_0x2308('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59a929){logger[_0x2308('0xb')](_0x2308('0x13'),_0x260d9f);logger[_0x2308('0x1c')](_0x2308('0x13'),_0x260d9f,JSON[_0x2308('0xe')](_0x59a929));_0x1d9439(_0x59a929);})[_0x2308('0x1d')](function(_0x37638b){logger[_0x2308('0xf')]('GetTrunk',_0x37638b['message'],_0x260d9f);_0x5e6f41(_0x3bf542['error'](0x1f4,_0x37638b[_0x2308('0x11')]));});});};exports[_0x2308('0x1e')]=function(_0xf7bbef){var _0x58bc00=this;return new Promise(function(_0x806087,_0x1051cf){return db[_0x2308('0x14')]['find']({'raw':_0xf7bbef[_0x2308('0x15')]?_0xf7bbef[_0x2308('0x15')][_0x2308('0x16')]===undefined?!![]:![]:!![],'where':_0xf7bbef['options']?_0xf7bbef[_0x2308('0x15')]['where']||null:null,'attributes':_0xf7bbef[_0x2308('0x15')]?_0xf7bbef['options']['attributes']||null:null,'include':_0xf7bbef[_0x2308('0x15')]?_0xf7bbef[_0x2308('0x15')][_0x2308('0x19')]?_[_0x2308('0x1a')](_0xf7bbef[_0x2308('0x15')][_0x2308('0x19')],function(_0x3a3011){return{'model':db[_0x3a3011[_0x2308('0x1b')]],'as':_0x3a3011['as'],'attributes':_0x3a3011[_0x2308('0x17')],'include':_0x3a3011['include']?_[_0x2308('0x1a')](_0x3a3011[_0x2308('0x19')],function(_0x409dc2){return{'model':db[_0x409dc2[_0x2308('0x1b')]],'as':_0x409dc2['as'],'attributes':_0x409dc2[_0x2308('0x17')],'include':_0x409dc2['include']?_[_0x2308('0x1a')](_0x409dc2[_0x2308('0x19')],function(_0x22f8a0){return{'model':db[_0x22f8a0[_0x2308('0x1b')]],'as':_0x22f8a0['as'],'attributes':_0x22f8a0[_0x2308('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2308('0x1f')](function(_0x9b9f62){logger['info']('ShowTrunk',_0xf7bbef);logger[_0x2308('0x1c')]('ShowTrunk',_0xf7bbef,JSON['stringify'](_0x9b9f62));_0x806087(_0x9b9f62);})[_0x2308('0x1d')](function(_0x420121){logger[_0x2308('0xf')]('ShowTrunk',_0x420121['message'],_0xf7bbef);_0x1051cf(_0x58bc00[_0x2308('0xf')](0x1f4,_0x420121[_0x2308('0x11')]));});});};
\ No newline at end of file
index b542b7d..402c3aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x991b=['diskStorage','join','root','server/files/images/','format','now','originalname','single','file','addAvatar','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','/:id/password','delete','removeQueues','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','index','isAuthenticated','whoami','/presence','/:id','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','/:id/queues_rt','/:id/groups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/:id/contacts','create','bulkCreate'];(function(_0x3df3c6,_0x496e1a){var _0x254c43=function(_0x371daa){while(--_0x371daa){_0x3df3c6['push'](_0x3df3c6['shift']());}};_0x254c43(++_0x496e1a);}(_0x991b,0x1d4));var _0xb991=function(_0x4ac361,_0x323c51){_0x4ac361=_0x4ac361-0x0;var _0x500126=_0x991b[_0x4ac361];return _0x500126;};'use strict';var multer=require('multer');var util=require(_0xb991('0x0'));var path=require(_0xb991('0x1'));var timeout=require(_0xb991('0x2'));var express=require(_0xb991('0x3'));var router=express[_0xb991('0x4')]();var fs_extra=require(_0xb991('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb991('0x6'));var config=require(_0xb991('0x7'));var controller=require(_0xb991('0x8'));router[_0xb991('0x9')]('/',auth['isAuthenticated'](),controller[_0xb991('0xa')]);router[_0xb991('0x9')]('/describe',auth[_0xb991('0xb')](),controller['describe']);router[_0xb991('0x9')]('/whoami',auth[_0xb991('0xb')](),controller[_0xb991('0xc')]);router[_0xb991('0x9')](_0xb991('0xd'),auth[_0xb991('0xb')](),controller['getPresence']);router[_0xb991('0x9')](_0xb991('0xe'),auth[_0xb991('0xb')](),controller['show']);router[_0xb991('0x9')]('/:id/avatar',controller[_0xb991('0xf')]);router[_0xb991('0x9')](_0xb991('0x10'),auth['isAuthenticated'](),controller[_0xb991('0x11')]);router['get']('/:id/contacts',auth[_0xb991('0xb')](),controller[_0xb991('0x12')]);router['get'](_0xb991('0x13'),auth[_0xb991('0xb')](),controller['getQueues']);router['get'](_0xb991('0x14'),auth[_0xb991('0xb')](),controller['getVoiceQueuesRt']);router[_0xb991('0x9')](_0xb991('0x15'),auth[_0xb991('0xb')](),controller['getGroups']);router[_0xb991('0x9')](_0xb991('0x16'),auth[_0xb991('0xb')](),controller['getRecordings']);router[_0xb991('0x9')](_0xb991('0x17'),auth[_0xb991('0xb')](),controller[_0xb991('0x18')]);router['get'](_0xb991('0x19'),auth['isAuthenticated'](),controller[_0xb991('0x1a')]);router[_0xb991('0x9')]('/:id/openchannel/interactions',auth[_0xb991('0xb')](),controller[_0xb991('0x1b')]);router[_0xb991('0x9')](_0xb991('0x1c'),auth[_0xb991('0xb')](),controller['getMailInteractions']);router['get'](_0xb991('0x1d'),auth[_0xb991('0xb')](),controller['getSmsInteractions']);router[_0xb991('0x9')]('/:id/fax/interactions',auth[_0xb991('0xb')](),controller[_0xb991('0x1e')]);router[_0xb991('0x9')](_0xb991('0x1f'),auth['isAuthenticated'](),controller[_0xb991('0x20')]);router[_0xb991('0x9')](_0xb991('0x21'),auth[_0xb991('0xb')](),controller[_0xb991('0x22')]);router[_0xb991('0x9')](_0xb991('0x23'),auth[_0xb991('0xb')](),controller[_0xb991('0x24')]);router['get']('/:id/agents',auth[_0xb991('0xb')](),controller['getAgents']);router['get']('/:id/prefixes',auth[_0xb991('0xb')](),controller[_0xb991('0x25')]);router[_0xb991('0x9')](_0xb991('0x26'),auth[_0xb991('0xb')](),controller[_0xb991('0x27')]);router['get'](_0xb991('0x28'),auth['isAuthenticated'](),controller[_0xb991('0x29')]);router['get']('/:id/openchannel_accounts',auth[_0xb991('0xb')](),controller[_0xb991('0x2a')]);router[_0xb991('0x9')](_0xb991('0x2b'),auth[_0xb991('0xb')](),controller[_0xb991('0x2c')]);router[_0xb991('0x9')](_0xb991('0x2d'),auth['isAuthenticated'](),controller[_0xb991('0x2e')]);router[_0xb991('0x9')](_0xb991('0x2f'),auth['isAuthenticated'](),controller[_0xb991('0x30')]);router[_0xb991('0x9')](_0xb991('0x31'),auth[_0xb991('0xb')](),controller[_0xb991('0x32')]);router['get'](_0xb991('0x33'),auth[_0xb991('0xb')](),controller[_0xb991('0x34')]);router[_0xb991('0x9')]('/:id/api_key',auth[_0xb991('0xb')](),controller['getApiKey']);router[_0xb991('0x35')](_0xb991('0x36'),auth[_0xb991('0xb')](),controller['addContacts']);router[_0xb991('0x35')]('/',auth[_0xb991('0xb')](),controller[_0xb991('0x37')]);router[_0xb991('0x35')]('/create_many',auth['isAuthenticated'](),controller[_0xb991('0x38')]);router[_0xb991('0x35')](_0xb991('0x13'),auth[_0xb991('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0xb991('0x39')]({'destination':function(_0x17f505,_0x11f3d4,_0x4e5088){_0x4e5088(null,path[_0xb991('0x3a')](config[_0xb991('0x3b')],_0xb991('0x3c')));},'filename':function(_0x5ccb2f,_0x4059f8,_0x58cd3d){_0x58cd3d(null,util[_0xb991('0x3d')]('%s-%s',Date[_0xb991('0x3e')](),_0x4059f8[_0xb991('0x3f')]));}})});router[_0xb991('0x35')]('/:id/avatar',upload[_0xb991('0x40')](_0xb991('0x41')),controller[_0xb991('0x42')]);router[_0xb991('0x35')]('/:id/login',auth[_0xb991('0xb')](),controller['login']);router[_0xb991('0x35')](_0xb991('0x43'),auth[_0xb991('0xb')](),controller[_0xb991('0x44')]);router[_0xb991('0x35')](_0xb991('0x45'),auth[_0xb991('0xb')](),controller[_0xb991('0x46')]);router[_0xb991('0x35')](_0xb991('0x47'),auth['isAuthenticated'](),controller[_0xb991('0x48')]);router[_0xb991('0x35')](_0xb991('0x21'),auth['isAuthenticated'](),controller[_0xb991('0x49')]);router['post'](_0xb991('0x4a'),auth[_0xb991('0xb')](),controller['addChatInteractions']);router[_0xb991('0x35')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xb991('0x35')]('/:id/fax_interactions',auth[_0xb991('0xb')](),controller['addFaxInteractions']);router[_0xb991('0x35')](_0xb991('0x4b'),auth[_0xb991('0xb')](),controller[_0xb991('0x4c')]);router[_0xb991('0x35')](_0xb991('0x4d'),auth['isAuthenticated'](),controller[_0xb991('0x4e')]);router['post'](_0xb991('0x4f'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post'](_0xb991('0x26'),auth['isAuthenticated'](),controller[_0xb991('0x50')]);router['post'](_0xb991('0x28'),auth['isAuthenticated'](),controller[_0xb991('0x51')]);router[_0xb991('0x35')](_0xb991('0x52'),auth[_0xb991('0xb')](),controller[_0xb991('0x53')]);router[_0xb991('0x35')](_0xb991('0x2b'),auth['isAuthenticated'](),controller[_0xb991('0x54')]);router['post'](_0xb991('0x2d'),auth[_0xb991('0xb')](),controller['addChatWebsites']);router['post'](_0xb991('0x2f'),auth[_0xb991('0xb')](),controller[_0xb991('0x55')]);router[_0xb991('0x35')]('/:id/square_projects',auth[_0xb991('0xb')](),controller['addSquareProjects']);router[_0xb991('0x35')](_0xb991('0x56'),auth[_0xb991('0xb')](),controller[_0xb991('0x57')]);router[_0xb991('0x58')](_0xb991('0xe'),auth[_0xb991('0xb')](),controller[_0xb991('0x59')]);router['put'](_0xb991('0x5a'),auth[_0xb991('0xb')](),controller['changePassword']);router[_0xb991('0x5b')](_0xb991('0x13'),auth[_0xb991('0xb')](),controller[_0xb991('0x5c')]);router[_0xb991('0x5b')](_0xb991('0x21'),auth[_0xb991('0xb')](),controller['removeTeams']);router[_0xb991('0x5b')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/chat_interactions',auth[_0xb991('0xb')](),controller['removeChatInteractions']);router[_0xb991('0x5b')](_0xb991('0x5d'),auth[_0xb991('0xb')](),controller[_0xb991('0x5e')]);router[_0xb991('0x5b')](_0xb991('0x5f'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xb991('0x5b')](_0xb991('0x4b'),auth[_0xb991('0xb')](),controller[_0xb991('0x60')]);router[_0xb991('0x5b')](_0xb991('0x4d'),auth[_0xb991('0xb')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/whatsapp_interactions',auth[_0xb991('0xb')](),controller[_0xb991('0x61')]);router['delete'](_0xb991('0x26'),auth[_0xb991('0xb')](),controller[_0xb991('0x62')]);router[_0xb991('0x5b')](_0xb991('0x28'),auth[_0xb991('0xb')](),controller['removeMailAccounts']);router['delete'](_0xb991('0x52'),auth[_0xb991('0xb')](),controller[_0xb991('0x63')]);router[_0xb991('0x5b')](_0xb991('0x2b'),auth[_0xb991('0xb')](),controller[_0xb991('0x64')]);router[_0xb991('0x5b')](_0xb991('0x2d'),auth[_0xb991('0xb')](),controller[_0xb991('0x65')]);router[_0xb991('0x5b')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xb991('0x66')]);router[_0xb991('0x5b')]('/:id/square_projects',auth[_0xb991('0xb')](),controller[_0xb991('0x67')]);router[_0xb991('0x5b')](_0xb991('0x56'),auth[_0xb991('0xb')](),controller['removeApiKey']);module[_0xb991('0x68')]=router;
\ No newline at end of file
+var _0x684b=['getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','login','/:id/logout','logout','pause','/:id/unpause','addTeams','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','describe','/whoami','isAuthenticated','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions'];(function(_0x53f8a7,_0x5bea5c){var _0x85857b=function(_0x3e466e){while(--_0x3e466e){_0x53f8a7['push'](_0x53f8a7['shift']());}};_0x85857b(++_0x5bea5c);}(_0x684b,0x1b8));var _0xb684=function(_0x15be4f,_0x3d12da){_0x15be4f=_0x15be4f-0x0;var _0x4720aa=_0x684b[_0x15be4f];return _0x4720aa;};'use strict';var multer=require(_0xb684('0x0'));var util=require(_0xb684('0x1'));var path=require('path');var timeout=require(_0xb684('0x2'));var express=require(_0xb684('0x3'));var router=express[_0xb684('0x4')]();var fs_extra=require(_0xb684('0x5'));var auth=require(_0xb684('0x6'));var interaction=require(_0xb684('0x7'));var config=require(_0xb684('0x8'));var controller=require(_0xb684('0x9'));router[_0xb684('0xa')]('/',auth['isAuthenticated'](),controller[_0xb684('0xb')]);router[_0xb684('0xa')](_0xb684('0xc'),auth['isAuthenticated'](),controller[_0xb684('0xd')]);router['get'](_0xb684('0xe'),auth[_0xb684('0xf')](),controller['whoami']);router[_0xb684('0xa')](_0xb684('0x10'),auth[_0xb684('0xf')](),controller[_0xb684('0x11')]);router[_0xb684('0xa')](_0xb684('0x12'),auth[_0xb684('0xf')](),controller[_0xb684('0x13')]);router['get'](_0xb684('0x14'),controller['getAvatar']);router['get'](_0xb684('0x15'),auth[_0xb684('0xf')](),controller[_0xb684('0x16')]);router[_0xb684('0xa')](_0xb684('0x17'),auth[_0xb684('0xf')](),controller[_0xb684('0x18')]);router[_0xb684('0xa')](_0xb684('0x19'),auth[_0xb684('0xf')](),controller[_0xb684('0x1a')]);router[_0xb684('0xa')](_0xb684('0x1b'),auth[_0xb684('0xf')](),controller[_0xb684('0x1c')]);router['get'](_0xb684('0x1d'),auth[_0xb684('0xf')](),controller[_0xb684('0x1e')]);router[_0xb684('0xa')]('/:id/recordings',auth[_0xb684('0xf')](),controller[_0xb684('0x1f')]);router['get'](_0xb684('0x20'),auth[_0xb684('0xf')](),controller['getScreenRecordings']);router[_0xb684('0xa')](_0xb684('0x21'),auth[_0xb684('0xf')](),controller[_0xb684('0x22')]);router[_0xb684('0xa')](_0xb684('0x23'),auth['isAuthenticated'](),controller[_0xb684('0x24')]);router[_0xb684('0xa')](_0xb684('0x25'),auth['isAuthenticated'](),controller[_0xb684('0x26')]);router[_0xb684('0xa')](_0xb684('0x27'),auth[_0xb684('0xf')](),controller['getSmsInteractions']);router[_0xb684('0xa')](_0xb684('0x28'),auth['isAuthenticated'](),controller[_0xb684('0x29')]);router[_0xb684('0xa')](_0xb684('0x2a'),auth[_0xb684('0xf')](),controller[_0xb684('0x2b')]);router[_0xb684('0xa')](_0xb684('0x2c'),auth[_0xb684('0xf')](),controller['getTeams']);router['get'](_0xb684('0x2d'),auth['isAuthenticated'](),controller[_0xb684('0x2e')]);router['get'](_0xb684('0x2f'),auth[_0xb684('0xf')](),controller['getAgents']);router[_0xb684('0xa')](_0xb684('0x30'),auth['isAuthenticated'](),controller[_0xb684('0x31')]);router[_0xb684('0xa')](_0xb684('0x32'),auth[_0xb684('0xf')](),controller[_0xb684('0x33')]);router[_0xb684('0xa')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xb684('0x34')]);router[_0xb684('0xa')](_0xb684('0x35'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xb684('0xa')]('/:id/sms_accounts',auth[_0xb684('0xf')](),controller[_0xb684('0x36')]);router[_0xb684('0xa')]('/:id/chat_websites',auth[_0xb684('0xf')](),controller[_0xb684('0x37')]);router[_0xb684('0xa')](_0xb684('0x38'),auth[_0xb684('0xf')](),controller['getWhatsappAccounts']);router[_0xb684('0xa')](_0xb684('0x39'),auth['isAuthenticated'](),controller[_0xb684('0x3a')]);router['get'](_0xb684('0x3b'),auth['isAuthenticated'](),controller[_0xb684('0x3c')]);router[_0xb684('0xa')](_0xb684('0x3d'),auth[_0xb684('0xf')](),controller[_0xb684('0x3e')]);router[_0xb684('0x3f')](_0xb684('0x17'),auth[_0xb684('0xf')](),controller[_0xb684('0x40')]);router[_0xb684('0x3f')]('/',auth[_0xb684('0xf')](),controller[_0xb684('0x41')]);router[_0xb684('0x3f')](_0xb684('0x42'),auth[_0xb684('0xf')](),controller['bulkCreate']);router[_0xb684('0x3f')](_0xb684('0x19'),auth['isAuthenticated'](),controller[_0xb684('0x43')]);var upload=multer({'storage':multer[_0xb684('0x44')]({'destination':function(_0x10d963,_0x4b60ba,_0x228cf0){_0x228cf0(null,path[_0xb684('0x45')](config[_0xb684('0x46')],_0xb684('0x47')));},'filename':function(_0xb7a70e,_0x33699f,_0x12b541){_0x12b541(null,util[_0xb684('0x48')](_0xb684('0x49'),Date['now'](),_0x33699f[_0xb684('0x4a')]));}})});router[_0xb684('0x3f')](_0xb684('0x14'),upload[_0xb684('0x4b')](_0xb684('0x4c')),controller[_0xb684('0x4d')]);router[_0xb684('0x3f')]('/:id/login',auth['isAuthenticated'](),controller[_0xb684('0x4e')]);router['post'](_0xb684('0x4f'),auth[_0xb684('0xf')](),controller[_0xb684('0x50')]);router[_0xb684('0x3f')]('/:id/pause',auth[_0xb684('0xf')](),controller[_0xb684('0x51')]);router[_0xb684('0x3f')](_0xb684('0x52'),auth[_0xb684('0xf')](),controller['unpause']);router[_0xb684('0x3f')](_0xb684('0x2c'),auth[_0xb684('0xf')](),controller[_0xb684('0x53')]);router['post']('/:id/chat_interactions',auth[_0xb684('0xf')](),controller[_0xb684('0x54')]);router[_0xb684('0x3f')](_0xb684('0x55'),auth[_0xb684('0xf')](),controller['addMailInteractions']);router[_0xb684('0x3f')](_0xb684('0x56'),auth[_0xb684('0xf')](),controller[_0xb684('0x57')]);router[_0xb684('0x3f')](_0xb684('0x58'),auth[_0xb684('0xf')](),controller['addSmsInteractions']);router[_0xb684('0x3f')](_0xb684('0x59'),auth[_0xb684('0xf')](),controller[_0xb684('0x5a')]);router[_0xb684('0x3f')](_0xb684('0x5b'),auth[_0xb684('0xf')](),controller['addWhatsappInteractions']);router[_0xb684('0x3f')](_0xb684('0x32'),auth[_0xb684('0xf')](),controller[_0xb684('0x5c')]);router['post'](_0xb684('0x5d'),auth[_0xb684('0xf')](),controller[_0xb684('0x5e')]);router[_0xb684('0x3f')](_0xb684('0x35'),auth[_0xb684('0xf')](),controller[_0xb684('0x5f')]);router[_0xb684('0x3f')](_0xb684('0x60'),auth[_0xb684('0xf')](),controller[_0xb684('0x61')]);router[_0xb684('0x3f')](_0xb684('0x62'),auth[_0xb684('0xf')](),controller[_0xb684('0x63')]);router[_0xb684('0x3f')](_0xb684('0x38'),auth[_0xb684('0xf')](),controller[_0xb684('0x64')]);router[_0xb684('0x3f')](_0xb684('0x39'),auth[_0xb684('0xf')](),controller['addSquareProjects']);router[_0xb684('0x3f')](_0xb684('0x3d'),auth['isAuthenticated'](),controller[_0xb684('0x65')]);router[_0xb684('0x66')]('/:id',auth[_0xb684('0xf')](),controller[_0xb684('0x67')]);router[_0xb684('0x66')](_0xb684('0x68'),auth[_0xb684('0xf')](),controller['changePassword']);router[_0xb684('0x69')]('/:id/queues',auth[_0xb684('0xf')](),controller[_0xb684('0x6a')]);router[_0xb684('0x69')](_0xb684('0x2c'),auth[_0xb684('0xf')](),controller[_0xb684('0x6b')]);router[_0xb684('0x69')](_0xb684('0x12'),auth[_0xb684('0xf')](),controller['destroy']);router['delete'](_0xb684('0x6c'),auth[_0xb684('0xf')](),controller[_0xb684('0x6d')]);router[_0xb684('0x69')](_0xb684('0x55'),auth['isAuthenticated'](),controller[_0xb684('0x6e')]);router[_0xb684('0x69')](_0xb684('0x56'),auth[_0xb684('0xf')](),controller[_0xb684('0x6f')]);router[_0xb684('0x69')]('/:id/sms_interactions',auth[_0xb684('0xf')](),controller['removeSmsInteractions']);router[_0xb684('0x69')](_0xb684('0x59'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xb684('0x69')](_0xb684('0x5b'),auth[_0xb684('0xf')](),controller['removeWhatsappInteractions']);router[_0xb684('0x69')](_0xb684('0x32'),auth[_0xb684('0xf')](),controller['removeFaxAccounts']);router['delete'](_0xb684('0x5d'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0xb684('0x69')](_0xb684('0x35'),auth[_0xb684('0xf')](),controller[_0xb684('0x70')]);router['delete']('/:id/sms_accounts',auth[_0xb684('0xf')](),controller[_0xb684('0x71')]);router[_0xb684('0x69')](_0xb684('0x62'),auth[_0xb684('0xf')](),controller[_0xb684('0x72')]);router[_0xb684('0x69')](_0xb684('0x38'),auth['isAuthenticated'](),controller[_0xb684('0x73')]);router[_0xb684('0x69')](_0xb684('0x39'),auth[_0xb684('0xf')](),controller[_0xb684('0x74')]);router[_0xb684('0x69')](_0xb684('0x3d'),auth[_0xb684('0xf')](),controller[_0xb684('0x75')]);module[_0xb684('0x76')]=router;
\ No newline at end of file
index b544497..d2a5bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f42=['nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','uac','uas','fingerprint','passive','TEXT','showWebBar','get','isArray','udp','wss','encryption','force_avp','icesupport','dtlsenable','dtlscertfile','rtcp_mux','avpf','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','sequelize','util','lodash','STRING','name','defaultuser','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','agent','telephone','local','INTEGER','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nonat','update','outgoing','force_rport,comedia'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0x7f42,0x1dd));var _0x27f4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7f42[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x27f4('0x0'));var moment=require('moment');var util=require(_0x27f4('0x1'));var _=require(_0x27f4('0x2'));module['exports']={'name':{'type':Sequelize[_0x27f4('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x10627e){this['setDataValue'](_0x27f4('0x4'),_0x10627e);this['setDataValue'](_0x27f4('0x5'),_0x10627e);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x27f4('0x3')],'allowNull':![],'set':function(_0x1a85f2){this[_0x27f4('0x6')](_0x27f4('0x7'),_0x1a85f2);this[_0x27f4('0x6')](_0x27f4('0x8'),util[_0x27f4('0x9')](_0x27f4('0xa'),_0x1a85f2,this[_0x27f4('0xb')](_0x27f4('0xc'))));}},'alias':{'type':Sequelize[_0x27f4('0x3')]},'email':{'type':Sequelize[_0x27f4('0x3')],'allowNull':![],'unique':_0x27f4('0xd'),'validate':{'isEmail':!![]},'set':function(_0x247c47){if(_0x247c47){this[_0x27f4('0x6')](_0x27f4('0xd'),_0x247c47[_0x27f4('0xe')]());}}},'role':{'type':Sequelize[_0x27f4('0xf')]('admin','user',_0x27f4('0x10'),_0x27f4('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x27f4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x27f4('0x3')],'defaultValue':_0x27f4('0x12')},'internal':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':![],'unique':_0x27f4('0xc'),'set':function(_0x40393e){this['setDataValue']('internal',_0x40393e);this[_0x27f4('0x6')](_0x27f4('0x14'),_0x40393e);this[_0x27f4('0x6')](_0x27f4('0x8'),util['format'](_0x27f4('0xa'),this[_0x27f4('0xb')](_0x27f4('0x7')),_0x40393e));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x27f4('0x3')]},'mobile':{'type':Sequelize[_0x27f4('0x3')]},'address':{'type':Sequelize[_0x27f4('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x27f4('0x3')]},'city':{'type':Sequelize[_0x27f4('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x27f4('0x15')]},'voicePause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x27f4('0x3')],'defaultValue':_0x27f4('0x17')},'lastPauseAt':{'type':Sequelize[_0x27f4('0x15')]},'chatCapacity':{'type':Sequelize[_0x27f4('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x27f4('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x27f4('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x27f4('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x27f4('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x27f4('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x27f4('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x27f4('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![],'defaultValue':_0x27f4('0x18')},'ipaddr':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x27f4('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x19'),_0x27f4('0x1a'),'peer'),'allowNull':!![],'defaultValue':_0x27f4('0x19')},'context':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x1b'),'ALLOWED_PASSED_SCREEN',_0x27f4('0x1c'),_0x27f4('0x1d'),'PROHIB_NOT_SCREENED',_0x27f4('0x1e'),_0x27f4('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x1e9a84){this[_0x27f4('0x6')](_0x27f4('0x20'),_0x1e9a84?_0x1e9a84[_0x27f4('0x21')](','):null);},'get':function(){return this[_0x27f4('0xb')](_0x27f4('0x20'))?this[_0x27f4('0xb')](_0x27f4('0x20'))[_0x27f4('0x22')](','):null;},'comment':_0x27f4('0x23')},'dtmfmode':{'type':Sequelize[_0x27f4('0xf')]('rfc2833',_0x27f4('0x24'),_0x27f4('0x25'),_0x27f4('0x26'),'auto'),'allowNull':!![],'defaultValue':_0x27f4('0x27')},'directmedia':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no',_0x27f4('0x29'),_0x27f4('0x2a'),_0x27f4('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![],'defaultValue':_0x27f4('0x2c'),'set':function(_0x63c4f2){this[_0x27f4('0x6')](_0x27f4('0x2d'),_0x63c4f2?_0x63c4f2[_0x27f4('0x21')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x27f4('0xb')](_0x27f4('0x2d'))[_0x27f4('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x27f4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x27f4('0x3')]},'pickupgroup':{'type':Sequelize[_0x27f4('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x27f4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x27f4('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x27f4('0x2e')},'allow':{'type':Sequelize[_0x27f4('0x3')],'allowNull':![],'defaultValue':_0x27f4('0x2f'),'set':function(_0x1dbe8b){this[_0x27f4('0x6')]('allow',_0x1dbe8b?_0x1dbe8b[_0x27f4('0x21')](';'):_0x27f4('0x2f'));},'get':function(){return this[_0x27f4('0xb')](_0x27f4('0x30'))?this['getDataValue'](_0x27f4('0x30'))[_0x27f4('0x22')](';'):null;},'comment':_0x27f4('0x31')},'autoframing':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x32f87f){this[_0x27f4('0x6')](_0x27f4('0x32'),_0x32f87f?_0x32f87f[_0x27f4('0x21')](','):null);},'get':function(){return this['getDataValue'](_0x27f4('0x32'))?this[_0x27f4('0xb')](_0x27f4('0x32'))[_0x27f4('0x22')](','):null;},'comment':_0x27f4('0x33')},'trustrpid':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no',_0x27f4('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![],'defaultValue':_0x27f4('0x28')},'busylevel':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x35'),_0x27f4('0x36'),_0x27f4('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x27f4('0x38'),_0x27f4('0x39')),'allowNull':!![],'defaultValue':_0x27f4('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x27f4('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no',_0x27f4('0x3a'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x27f4('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x27f4('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x27f4('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x27f4('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no','nonat',_0x27f4('0x2a'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x27f4('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x27f4('0x15')]},'passwordResetAt':{'type':Sequelize[_0x27f4('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x27f4('0x3c')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1deb54){this['setDataValue'](_0x27f4('0x3d'),_0x1deb54);var _0x2b602a=this[_0x27f4('0x3e')]({'plain':!![]});switch(_0x1deb54){case 0x0:case 0x1:var _0x5a9201=_0x2b602a[_0x27f4('0x20')]?_[_0x27f4('0x3f')](_0x2b602a['transport'])?_0x2b602a[_0x27f4('0x20')][_0x27f4('0x21')]():_0x2b602a[_0x27f4('0x20')]:_0x27f4('0x40');if(_0x5a9201===_0x27f4('0x41')){_0x5a9201=_0x27f4('0x40');}this[_0x27f4('0x6')](_0x27f4('0x20'),_0x5a9201);this[_0x27f4('0x6')](_0x27f4('0x42'),'no');this[_0x27f4('0x6')]('avpf',null);this[_0x27f4('0x6')](_0x27f4('0x43'),null);this[_0x27f4('0x6')](_0x27f4('0x44'),null);this[_0x27f4('0x6')](_0x27f4('0x45'),null);this[_0x27f4('0x6')]('dtlsverify',null);this[_0x27f4('0x6')]('dtlssetup',null);this[_0x27f4('0x6')](_0x27f4('0x46'),null);this[_0x27f4('0x6')]('dtlsprivatekey',null);this[_0x27f4('0x6')](_0x27f4('0x47'),'no');break;case 0x2:this[_0x27f4('0x6')](_0x27f4('0x20'),_0x27f4('0x41'));this['setDataValue'](_0x27f4('0x42'),_0x27f4('0x28'));this[_0x27f4('0x6')](_0x27f4('0x48'),_0x27f4('0x28'));this[_0x27f4('0x6')](_0x27f4('0x43'),_0x27f4('0x28'));this[_0x27f4('0x6')]('icesupport',_0x27f4('0x28'));this[_0x27f4('0x6')](_0x27f4('0x45'),'yes');this['setDataValue'](_0x27f4('0x49'),'no');this[_0x27f4('0x6')](_0x27f4('0x4a'),_0x27f4('0x4b'));this['setDataValue'](_0x27f4('0x46'),_0x2b602a['dtlscertfile']||_0x27f4('0x4c'));this[_0x27f4('0x6')]('dtlsprivatekey',_0x2b602a['dtlsprivatekey']||_0x27f4('0x4d'));this[_0x27f4('0x6')]('rtcp_mux',_0x27f4('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x27f4('0x3c')],'set':function(_0x2d9e3b){this[_0x27f4('0x6')](_0x27f4('0x4e'),_0x2d9e3b?_0x2d9e3b[_0x27f4('0x21')](','):[]);},'get':function(){return this[_0x27f4('0xb')]('permissions')?_[_0x27f4('0x4f')](this[_0x27f4('0xb')](_0x27f4('0x4e'))[_0x27f4('0x22')](','),function(_0x38177c){return parseInt(_0x38177c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x27f4('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x27f4('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x27f4('0xf')](_0x27f4('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x27f4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x27f4('0xb')](_0x27f4('0x50'))?this[_0x27f4('0xb')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x27f4('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![],'set':function(_0x1c8657){if(typeof _0x1c8657===_0x27f4('0x51')){var _0x5cee6d=_0x1c8657==='1'?!![]:_0x1c8657==='0'?![]:_0x1c8657===_0x27f4('0x52')?!![]:_0x1c8657===_0x27f4('0x53')?![]:![];this[_0x27f4('0x6')](_0x27f4('0x54'),_0x5cee6d);}else{this['setDataValue'](_0x27f4('0x54'),_0x1c8657);}}},'blocked':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![],'set':function(_0xf05816){this[_0x27f4('0x6')](_0x27f4('0x55'),_0xf05816);if(_0xf05816===!![]){this[_0x27f4('0x6')](_0x27f4('0x56'),moment());this[_0x27f4('0x6')]('loginAttempts',0x0);}else{this[_0x27f4('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x27f4('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x27f4('0x13')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x27f4('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x238f=['getDataValue','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','user','peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','active','passive','update','update,nonat','TEXT','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x238f,0xa5));var _0xf238=function(_0x3b6cf6,_0x5a1394){_0x3b6cf6=_0x3b6cf6-0x0;var _0x2d6085=_0x238f[_0x3b6cf6];return _0x2d6085;};'use strict';var Sequelize=require(_0xf238('0x0'));var moment=require(_0xf238('0x1'));var util=require(_0xf238('0x2'));var _=require('lodash');module[_0xf238('0x3')]={'name':{'type':Sequelize[_0xf238('0x4')],'allowNull':![],'unique':_0xf238('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xb2d281){this[_0xf238('0x6')](_0xf238('0x5'),_0xb2d281);this['setDataValue'](_0xf238('0x7'),_0xb2d281);},'comment':_0xf238('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x549a61){this[_0xf238('0x6')]('fullname',_0x549a61);this[_0xf238('0x6')](_0xf238('0x9'),util[_0xf238('0xa')](_0xf238('0xb'),_0x549a61,this['getDataValue'](_0xf238('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf238('0x4')],'allowNull':![],'unique':_0xf238('0xd'),'validate':{'isEmail':!![]},'set':function(_0x3f4d1a){if(_0x3f4d1a){this[_0xf238('0x6')](_0xf238('0xd'),_0x3f4d1a[_0xf238('0xe')]());}}},'role':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x10'),'user',_0xf238('0x11'),_0xf238('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xf238('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xf238('0x13')},'internal':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':![],'unique':_0xf238('0xc'),'set':function(_0xc5b447){this[_0xf238('0x6')]('internal',_0xc5b447);this[_0xf238('0x6')]('accountcode',_0xc5b447);this[_0xf238('0x6')](_0xf238('0x9'),util[_0xf238('0xa')](_0xf238('0xb'),this[_0xf238('0x15')](_0xf238('0x16')),_0xc5b447));}},'salt':{'type':Sequelize[_0xf238('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf238('0x4')]},'address':{'type':Sequelize[_0xf238('0x4')]},'zipcode':{'type':Sequelize[_0xf238('0x4')]},'userpic':{'type':Sequelize[_0xf238('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xf238('0x4')]},'online':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf238('0x18')]},'voicePause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf238('0x4')],'defaultValue':_0xf238('0x19')},'lastPauseAt':{'type':Sequelize[_0xf238('0x18')]},'chatCapacity':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf238('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf238('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf238('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![],'defaultValue':_0xf238('0x1a')},'ipaddr':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x1b'),_0xf238('0x1c'),_0xf238('0x1d')),'allowNull':!![],'defaultValue':_0xf238('0x1b')},'context':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xf238('0x1e'),_0xf238('0x1f'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xf238('0x20'),_0xf238('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![],'defaultValue':_0xf238('0x22'),'set':function(_0x34869e){this[_0xf238('0x6')]('transport',_0x34869e?_0x34869e['join'](','):null);},'get':function(){return this[_0xf238('0x15')](_0xf238('0x23'))?this[_0xf238('0x15')](_0xf238('0x23'))[_0xf238('0x24')](','):null;},'comment':_0xf238('0x25')},'dtmfmode':{'type':Sequelize['ENUM'](_0xf238('0x26'),_0xf238('0x27'),'shortinfo',_0xf238('0x28'),_0xf238('0x29')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no',_0xf238('0x2b'),'update',_0xf238('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![],'defaultValue':_0xf238('0x2d'),'set':function(_0x1e576c){this['setDataValue']('nat',_0x1e576c?_0x1e576c[_0xf238('0x2e')](','):null);},'get':function(){return this[_0xf238('0x15')](_0xf238('0x2f'))?this['getDataValue'](_0xf238('0x2f'))['split'](','):null;},'comment':_0xf238('0x30')},'callgroup':{'type':Sequelize[_0xf238('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xf238('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xf238('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf238('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3a13fb){this[_0xf238('0x6')](_0xf238('0x31'),_0x3a13fb?_0x3a13fb[_0xf238('0x2e')](';'):_0xf238('0x32'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0xf238('0x31'))[_0xf238('0x24')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![],'set':function(_0x256d2e){this['setDataValue'](_0xf238('0x33'),_0x256d2e?_0x256d2e['join'](','):null);},'get':function(){return this[_0xf238('0x15')](_0xf238('0x33'))?this['getDataValue'](_0xf238('0x33'))[_0xf238('0x24')](','):null;},'comment':_0xf238('0x34')},'trustrpid':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no',_0xf238('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf238('0x36')},'amaflags':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf238('0x2a')},'busylevel':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf238('0xf')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf238('0xf')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf238('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no',_0xf238('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf238('0xf')]('accept',_0xf238('0x38'),_0xf238('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf238('0xf')]('uac',_0xf238('0x3a')),'allowNull':!![],'defaultValue':_0xf238('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf238('0x2a')},'keepalive':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf238('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xf238('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no',_0xf238('0x3b'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf238('0x3c'),_0xf238('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf238('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf238('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no',_0xf238('0x2b'),_0xf238('0x3e'),_0xf238('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf238('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xf238('0x18')]},'passwordResetAt':{'type':Sequelize[_0xf238('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf238('0x40')]},'showWebBar':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0,'set':function(_0x186abc){this[_0xf238('0x6')]('showWebBar',_0x186abc);var _0x52db23=this[_0xf238('0x41')]({'plain':!![]});switch(_0x186abc){case 0x0:case 0x1:var _0x49ad74=_0x52db23['transport']?_[_0xf238('0x42')](_0x52db23['transport'])?_0x52db23[_0xf238('0x23')][_0xf238('0x2e')]():_0x52db23['transport']:_0xf238('0x22');if(_0x49ad74===_0xf238('0x43')){_0x49ad74=_0xf238('0x22');}this[_0xf238('0x6')]('transport',_0x49ad74);this[_0xf238('0x6')](_0xf238('0x44'),'no');this[_0xf238('0x6')](_0xf238('0x45'),null);this[_0xf238('0x6')](_0xf238('0x46'),null);this[_0xf238('0x6')]('icesupport',null);this[_0xf238('0x6')](_0xf238('0x47'),null);this[_0xf238('0x6')](_0xf238('0x48'),null);this[_0xf238('0x6')](_0xf238('0x49'),null);this[_0xf238('0x6')]('dtlscertfile',null);this['setDataValue'](_0xf238('0x4a'),null);this[_0xf238('0x6')](_0xf238('0x4b'),'no');break;case 0x2:this['setDataValue'](_0xf238('0x23'),_0xf238('0x43'));this[_0xf238('0x6')](_0xf238('0x44'),_0xf238('0x2a'));this[_0xf238('0x6')](_0xf238('0x45'),_0xf238('0x2a'));this['setDataValue'](_0xf238('0x46'),_0xf238('0x2a'));this['setDataValue'](_0xf238('0x4c'),_0xf238('0x2a'));this[_0xf238('0x6')](_0xf238('0x47'),_0xf238('0x2a'));this[_0xf238('0x6')]('dtlsverify','no');this[_0xf238('0x6')](_0xf238('0x49'),_0xf238('0x4d'));this[_0xf238('0x6')](_0xf238('0x4e'),_0x52db23[_0xf238('0x4e')]||_0xf238('0x4f'));this['setDataValue']('dtlsprivatekey',_0x52db23[_0xf238('0x4a')]||_0xf238('0x50'));this[_0xf238('0x6')]('rtcp_mux',_0xf238('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xf238('0x40')],'set':function(_0x523491){this['setDataValue'](_0xf238('0x51'),_0x523491?_0x523491[_0xf238('0x2e')](','):[]);},'get':function(){return this['getDataValue'](_0xf238('0x51'))?_[_0xf238('0x52')](this[_0xf238('0x15')]('permissions')['split'](','),function(_0x4cac4a){return parseInt(_0x4cac4a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf238('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xf238('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf238('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf238('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf238('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf238('0xf')](_0xf238('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf238('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf238('0x53')],'get':function(){return this[_0xf238('0x15')](_0xf238('0x54'))?this[_0xf238('0x15')](_0xf238('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf238('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![],'set':function(_0x380be8){if(typeof _0x380be8===_0xf238('0x55')){var _0x5cf34b=_0x380be8==='1'?!![]:_0x380be8==='0'?![]:_0x380be8===_0xf238('0x56')?!![]:_0x380be8===_0xf238('0x57')?![]:![];this['setDataValue'](_0xf238('0x58'),_0x5cf34b);}else{this[_0xf238('0x6')](_0xf238('0x58'),_0x380be8);}}},'blocked':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![],'set':function(_0x4090a2){this[_0xf238('0x6')](_0xf238('0x59'),_0x4090a2);if(_0x4090a2===!![]){this['setDataValue'](_0xf238('0x5a'),moment());this[_0xf238('0x6')](_0xf238('0x5b'),0x0);}else{this[_0xf238('0x6')](_0xf238('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xf238('0x14')](0x5)[_0xf238('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf238('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf238('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf238('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf238('0x17')],'defaultValue':![]}};
\ No newline at end of file
index e29ba67..2bebd7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','LOGININPAUSE','MemberReport','bulkCreate','isMiddleware','logout','pause','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','manual','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','getSmsQueues','TeamVoicePrefix','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$notILike','$like','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','inbound','lower','col','toString','desc','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','offline','idle','unknown','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','SELECT','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','defaults','redis','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','role','admin','Users','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','find','UserProfileResource','sendStatus','name','index','rawAttributes','fieldName','type','salt','getOptions','where','User','query','include','attributes','push','openTabs','true','rows','length','chat','dataValues','sms','fax','mail','whatsapp','show','model','keys','password','filters','intersection','fields','options','openchannel','all','body','describe','addContacts','params','ids','omit','Setting','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','QueryTypes','from','voicemail','VoiceMail','fullname','email','agent','permissions','101','102','113','104','105','106','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','findAll','isEmpty','compact','changePassword','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','ValidationError','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','online','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','penalty','spread','emit','toLowerCase','Queue:save','VoiceQueue','voice','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','channel','remove','Queues','QueueId','Queue:remove','addAvatar','userpic','file','filename','root','download','existsSync','join','server/files/images/','ChatOpenTabs','CHAT','FaxOpenTabs','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','getContacts','CmContact','order','merge','includeAll','CmList','List','Tag','color','tag','hasOwnProperty','nolimit','getQueues','Queue','sort','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x1a37,0xb4));var _0x71a3=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x1a37[_0x3d42d8];return _0x27fc41;};'use strict';var moment=require(_0x71a3('0x0'));var BPromise=require(_0x71a3('0x1'));var util=require(_0x71a3('0x2'));var path=require(_0x71a3('0x3'));var fs=require('fs');var _=require(_0x71a3('0x4'));var squel=require(_0x71a3('0x5'));var jayson=require(_0x71a3('0x6'));var Redis=require(_0x71a3('0x7'));var authService=require(_0x71a3('0x8'));var qs=require(_0x71a3('0x9'));var logger=require('../../config/logger')(_0x71a3('0xa'));var utils=require('../../config/utils');var config=require(_0x71a3('0xb'));var licenseUtil=require(_0x71a3('0xc'));var db=require(_0x71a3('0xd'))['db'];var socket=require(_0x71a3('0xe'))(new Redis(config['redis']));require('./user.socket')['register'](socket);config['redis']=_[_0x71a3('0xf')](config[_0x71a3('0x10')],{'host':_0x71a3('0x11'),'port':0x18eb});var client=jayson[_0x71a3('0x12')][_0x71a3('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2215f2,_0x1826a0,_0x35c4f8,_0x5c464c){return new BPromise(function(_0x5ac7df,_0x5e37e8){var _0x15923f=_0x5c464c||client;return _0x15923f[_0x71a3('0x14')](_0x2215f2,_0x35c4f8)[_0x71a3('0x15')](function(_0x229134){logger[_0x71a3('0x16')](_0x71a3('0x17'),_0x1826a0,_0x71a3('0x18'));logger[_0x71a3('0x19')](_0x71a3('0x1a'),_0x1826a0,_0x71a3('0x18'),JSON[_0x71a3('0x1b')](_0x229134));if(_0x229134['error']){if(_0x229134[_0x71a3('0x1c')][_0x71a3('0x1d')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x1826a0,_0x229134[_0x71a3('0x1c')][_0x71a3('0x1e')]);return _0x5e37e8(_0x229134[_0x71a3('0x1c')][_0x71a3('0x1e')]);}logger[_0x71a3('0x1c')](_0x71a3('0x17'),_0x1826a0,_0x229134['error'][_0x71a3('0x1e')]);return _0x5ac7df(_0x229134[_0x71a3('0x1c')]['message']);}else{logger['info'](_0x71a3('0x17'),_0x1826a0,_0x71a3('0x18'));_0x5ac7df(_0x229134[_0x71a3('0x1f')][_0x71a3('0x1e')]);}})[_0x71a3('0x20')](function(_0x596328){logger[_0x71a3('0x1c')](_0x71a3('0x17'),_0x1826a0,_0x596328);_0x5e37e8(_0x596328);});});}function respondWithStatusCode(_0x28535b,_0x3ea036){_0x3ea036=_0x3ea036||0xcc;return function(_0x3c862f){if(_0x3c862f){return _0x28535b['sendStatus'](_0x3ea036);}return _0x28535b[_0x71a3('0x21')](_0x3ea036)['end']();};}function respondWithResult(_0x3bf78e,_0x35d1d4){_0x35d1d4=_0x35d1d4||0xc8;return function(_0x2982b9){if(_0x2982b9){return _0x3bf78e[_0x71a3('0x21')](_0x35d1d4)[_0x71a3('0x22')](_0x2982b9);}};}function respondWithFilteredResult(_0x2847b4,_0x5f33c5){return function(_0x26e6e7){if(_0x26e6e7){var _0x299d1d=typeof _0x5f33c5[_0x71a3('0x23')]===_0x71a3('0x24')&&typeof _0x5f33c5[_0x71a3('0x25')]==='undefined';var _0x107fbd=_0x26e6e7[_0x71a3('0x26')];var _0x4c1a3d=_0x299d1d?0x0:_0x5f33c5[_0x71a3('0x23')];var _0x515519=_0x299d1d?_0x26e6e7[_0x71a3('0x26')]:_0x5f33c5[_0x71a3('0x23')]+_0x5f33c5[_0x71a3('0x25')];var _0x35b5c7;if(_0x515519>=_0x107fbd){_0x515519=_0x107fbd;_0x35b5c7=0xc8;}else{_0x35b5c7=0xce;}_0x2847b4[_0x71a3('0x21')](_0x35b5c7);return _0x2847b4[_0x71a3('0x27')](_0x71a3('0x28'),_0x4c1a3d+'-'+_0x515519+'/'+_0x107fbd)[_0x71a3('0x22')](_0x26e6e7);}return null;};}function saveUpdates(_0x305eb1){return function(_0x3fc578){if(_0x3fc578){return _0x3fc578[_0x71a3('0x29')](_0x305eb1)[_0x71a3('0x15')](function(_0x51cde3){return _0x51cde3;});}return null;};}function removeEntity(_0x26fd9f){return function(_0x1719e6){if(_0x1719e6){return _0x1719e6[_0x71a3('0x2a')]()[_0x71a3('0x15')](function(){var _0x4a750c=_0x1719e6[_0x71a3('0x2b')]({'plain':!![]});if(_0x4a750c[_0x71a3('0x2c')]===_0x71a3('0x2d'))return;var _0x114032=[{'name':_0x71a3('0x2e'),'value':_0x71a3('0x2f'),'ignore':!![]},{'name':_0x71a3('0x30'),'value':'agent','ignore':![]},{'name':_0x71a3('0x31'),'value':_0x71a3('0x32'),'ignore':![]}];var _0x3aaf63=_(_0x114032)[_0x71a3('0x33')](_0x71a3('0x34'))[_0x71a3('0x35')](_0x71a3('0x36'))[_0x71a3('0x36')]();if(_[_0x71a3('0x37')](_0x3aaf63,_0x4a750c[_0x71a3('0x2c')])){return;}var _0x2376e5=_[_0x71a3('0x38')](_0x114032,[_0x71a3('0x36'),_0x4a750c['role']])['name'];return db[_0x71a3('0x39')][_0x71a3('0x2a')]({'where':{'type':_0x2376e5,'resourceId':_0x4a750c['id']}})['then'](function(){return _0x1719e6;});})[_0x71a3('0x15')](function(){_0x26fd9f[_0x71a3('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3650){return function(_0x1a7bb7){if(!_0x1a7bb7){_0x2f3650[_0x71a3('0x3a')](0x194);}return _0x1a7bb7;};}function handleError(_0x250572,_0x354147){_0x354147=_0x354147||0x1f4;return function(_0x255098){logger[_0x71a3('0x1c')](_0x255098['stack']);if(_0x255098[_0x71a3('0x3b')]){delete _0x255098[_0x71a3('0x3b')];}_0x250572[_0x71a3('0x21')](_0x354147)['send'](_0x255098);};}exports[_0x71a3('0x3c')]=function(_0x2937cf,_0x3dc1de){var _0x171902={},_0x6cea55={'count':0x0,'rows':[]};var _0x54d03b=_(db['User'][_0x71a3('0x3d')])[_0x71a3('0x35')](function(_0xbec9ad){return{'name':_0xbec9ad[_0x71a3('0x3e')],'type':_0xbec9ad[_0x71a3('0x3f')]['key']};})[_0x71a3('0x33')](function(_0x16d23c){return!_[_0x71a3('0x37')](['password',_0x71a3('0x40')],_0x16d23c['name']);})[_0x71a3('0x36')]();_0x171902=qs[_0x71a3('0x41')](_0x54d03b,_0x2937cf);var _0x46e6ce={'where':_0x171902[_0x71a3('0x42')]};return db[_0x71a3('0x43')][_0x71a3('0x26')](_0x46e6ce)[_0x71a3('0x15')](function(_0x40a18f){_0x6cea55[_0x71a3('0x26')]=_0x40a18f;if(_0x2937cf[_0x71a3('0x44')]['includeAll']){_0x171902[_0x71a3('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x171902[_0x71a3('0x46')],'id')){_0x171902[_0x71a3('0x46')][_0x71a3('0x47')]('id');}return db[_0x71a3('0x43')]['findAll'](_0x171902);})[_0x71a3('0x15')](function(_0x4b4fde){_0x6cea55['rows']=_0x4b4fde;if(_0x2937cf[_0x71a3('0x44')][_0x71a3('0x48')]===_0x71a3('0x49')){var _0x1dc34b=[];for(var _0x519242=0x0;_0x519242<_0x6cea55[_0x71a3('0x4a')][_0x71a3('0x4b')];_0x519242++){_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4e'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4f'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x50'),_0x6cea55['rows'][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs('openchannel',_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x6cea55[_0x71a3('0x4a')][_0x519242]['dataValues']));}return BPromise['all'](_0x1dc34b)[_0x71a3('0x15')](function(_0x4305ee){return _0x6cea55;});}else{return _0x6cea55;}})['then'](respondWithFilteredResult(_0x3dc1de,_0x171902))[_0x71a3('0x20')](handleError(_0x3dc1de,null));};exports[_0x71a3('0x52')]=function(_0xd1d09c,_0x28378a){var _0x250e56={'raw':![],'where':{'id':_0xd1d09c['params']['id']}},_0xb0d710={};_0xb0d710[_0x71a3('0x53')]=_['differenceBy'](_[_0x71a3('0x54')](db[_0x71a3('0x43')][_0x71a3('0x3d')]),[_0x71a3('0x55'),_0x71a3('0x40')]);_0xb0d710['query']=_[_0x71a3('0x54')](_0xd1d09c[_0x71a3('0x44')]);_0xb0d710[_0x71a3('0x56')]=_['intersection'](_0xb0d710[_0x71a3('0x53')],_0xb0d710['query']);_0x250e56[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0xb0d710['model'],qs[_0x71a3('0x58')](_0xd1d09c[_0x71a3('0x44')][_0x71a3('0x58')]));_0x250e56[_0x71a3('0x46')]=_0x250e56[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x250e56[_0x71a3('0x46')]:_0xb0d710['model'];if(_0xd1d09c[_0x71a3('0x44')]['includeAll']){_0x250e56[_0x71a3('0x45')]=[{'all':!![]}];}_0x250e56=_['merge']({},_0x250e56,_0xd1d09c[_0x71a3('0x59')]);if(!_[_0x71a3('0x37')](_0x250e56[_0x71a3('0x46')],'id')){_0x250e56[_0x71a3('0x46')]['push']('id');}return db['User'][_0x71a3('0x38')](_0x250e56)[_0x71a3('0x15')](handleEntityNotFound(_0x28378a,null))[_0x71a3('0x15')](function(_0x29410d){var _0x4d9181=[];values=_0x29410d;if(_0xd1d09c['query'][_0x71a3('0x48')]===_0x71a3('0x49')){_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181['push'](get_open_tabs(_0x71a3('0x4e'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x5a'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181['push'](get_open_tabs(_0x71a3('0x4f'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs('mail',_0x29410d[_0x71a3('0x4d')]));return BPromise[_0x71a3('0x5b')](_0x4d9181);}else{return values;}})[_0x71a3('0x15')](function(_0x23988d){return values;})[_0x71a3('0x15')](respondWithResult(_0x28378a,null))[_0x71a3('0x20')](handleError(_0x28378a,null));};exports[_0x71a3('0x29')]=function(_0x302dab,_0x3ebf59){if(_0x302dab[_0x71a3('0x5c')]['id']){delete _0x302dab['body']['id'];}delete _0x302dab[_0x71a3('0x5c')][_0x71a3('0x2c')];return db['User'][_0x71a3('0x38')]({'where':{'id':_0x302dab['params']['id']}})['then'](handleEntityNotFound(_0x3ebf59,null))[_0x71a3('0x15')](saveUpdates(_0x302dab[_0x71a3('0x5c')],null))[_0x71a3('0x15')](respondWithResult(_0x3ebf59,null))[_0x71a3('0x20')](handleError(_0x3ebf59,null));};exports[_0x71a3('0x5d')]=function(_0x5cffd2,_0x121b2d){return db[_0x71a3('0x43')]['describe']()[_0x71a3('0x15')](respondWithResult(_0x121b2d,null))['catch'](handleError(_0x121b2d,null));};exports[_0x71a3('0x5e')]=function(_0x1619d3,_0x523e13){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x1619d3[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x523e13,null))[_0x71a3('0x15')](function(_0x97ed1b){if(_0x97ed1b){return _0x97ed1b[_0x71a3('0x5e')](_0x1619d3['body'][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x1619d3[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0x523e13,null))[_0x71a3('0x20')](handleError(_0x523e13,null));};function validateUser(_0x1ee283){return new BPromise(function(_0x30fc7a,_0xe03bb5){if(_0x1ee283['internal'])return _0x30fc7a(_0x1ee283);return db[_0x71a3('0x62')][_0x71a3('0x63')](0x1)[_0x71a3('0x15')](function(_0x509bf7){if(_0x509bf7[_0x71a3('0x64')])authService[_0x71a3('0x65')](_0x1ee283[_0x71a3('0x55')]);db[_0x71a3('0x43')][_0x71a3('0x66')](_0x71a3('0x67'))[_0x71a3('0x15')](function(_0xea64e6){if(_[_0x71a3('0x68')](_0xea64e6)){_0x1ee283['internal']=_0x509bf7[_0x71a3('0x69')]||0x1;return;}if(_['isNil'](_0x509bf7[_0x71a3('0x69')])||_0x509bf7['min_internal']===_0xea64e6){_0x1ee283['internal']=_0xea64e6+0x1;return;}if(_0x509bf7[_0x71a3('0x69')]>_0xea64e6){_0x1ee283['internal']=_0x509bf7[_0x71a3('0x69')];return;}return db[_0x71a3('0x6a')][_0x71a3('0x44')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x71a3('0x6a')][_0x71a3('0x6b')]['SELECT']})[_0x71a3('0x15')](function(_0x189320){if(_0x189320&&_0x189320[_0x71a3('0x4b')]){for(var _0x1450cc=0x0,_0x4430f2=_0x189320[_0x71a3('0x4b')];_0x1450cc<_0x4430f2&&_[_0x71a3('0x68')](_0x1ee283[_0x71a3('0x67')]);_0x1450cc++){if(_0x509bf7['min_internal']<=_0x189320[_0x1450cc]['from']){_0x1ee283[_0x71a3('0x67')]=_0x189320[_0x1450cc][_0x71a3('0x6c')];}else if(_0x509bf7[_0x71a3('0x69')]>_0x189320[_0x1450cc]['from']&&_0x509bf7[_0x71a3('0x69')]<=_0x189320[_0x1450cc]['to']){_0x1ee283[_0x71a3('0x67')]=_0x509bf7['min_internal'];}}}if(_[_0x71a3('0x68')](_0x1ee283['internal'])){_0x1ee283[_0x71a3('0x67')]=_0xea64e6+0x1;}return _0x30fc7a(_0x1ee283);});});})[_0x71a3('0x20')](function(_0x765b9c){_0xe03bb5(_0x765b9c);});});}function updateUser(_0x184389){return new BPromise(function(_0x528c4b,_0x7c9e78){try{if(_0x184389[_0x71a3('0x6d')]){_0x184389['mailbox']=_0x184389[_0x71a3('0x67')];_0x184389[_0x71a3('0x6e')]={'mailbox':_0x184389[_0x71a3('0x67')],'password':_0x184389[_0x71a3('0x55')],'fullname':_0x184389[_0x71a3('0x6f')],'email':_0x184389[_0x71a3('0x70')]};}if(_0x184389[_0x71a3('0x2c')]===_0x71a3('0x71')){if(!_0x184389[_0x71a3('0x72')])_0x184389[_0x71a3('0x72')]=[_0x71a3('0x73'),_0x71a3('0x74'),'103',_0x71a3('0x75'),'110',_0x71a3('0x76'),_0x71a3('0x77'),_0x71a3('0x78'),_0x71a3('0x79'),_0x71a3('0x7a'),_0x71a3('0x7b'),_0x71a3('0x7c'),_0x71a3('0x7d'),_0x71a3('0x7e'),_0x71a3('0x7f')];}_0x528c4b(_0x184389);}catch(_0x365f5a){_0x7c9e78(_0x365f5a);}});}exports[_0x71a3('0x80')]=function(_0x316641,_0x18a3ae){if(_0x316641[_0x71a3('0x2f')][_0x71a3('0x2c')]===_0x71a3('0x71'))throw new Error(_0x71a3('0x81'));if(_0x316641[_0x71a3('0x5c')]['role']===_0x71a3('0x2f')&&_0x316641[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2d')){throw new Error(_0x71a3('0x82'));}if(_0x316641[_0x71a3('0x5c')][_0x71a3('0x2c')]==='admin'&&_0x316641[_0x71a3('0x2f')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x316641['body']])['then'](function(){return validateUser(_0x316641[_0x71a3('0x5c')]);})[_0x71a3('0x15')](function(_0x133994){return updateUser(_0x133994)[_0x71a3('0x15')](function(_0x17e205){if(_0x17e205[_0x71a3('0x2c')]===_0x71a3('0x2d')){_0x17e205[_0x71a3('0x83')]=_0x316641[_0x71a3('0x2f')][_0x71a3('0x83')];delete _0x17e205[_0x71a3('0x84')];}return _0x17e205;});})[_0x71a3('0x15')](function(_0x26fa56){return db['User'][_0x71a3('0x80')](_0x26fa56,{'include':[{'model':db[_0x71a3('0x6e')],'as':_0x71a3('0x6e')}]});})[_0x71a3('0x15')](function(_0x38f928){if(_0x316641[_0x71a3('0x5c')]['role']==='user')return _0x38f928;if(_0x316641['user'][_0x71a3('0x2c')]!==_0x71a3('0x2f'))return _0x38f928;return db[_0x71a3('0x85')]['find']({'where':{'name':_0x38f928[_0x71a3('0x2c')]===_0x71a3('0x71')?_0x71a3('0x30'):_0x71a3('0x31'),'userProfileId':_0x316641[_0x71a3('0x2f')][_0x71a3('0x84')]},'raw':!![]})[_0x71a3('0x15')](function(_0x28c184){if(!_0x28c184||_0x28c184[_0x71a3('0x86')]!=0x0)return _0x38f928;return db['UserProfileResource'][_0x71a3('0x80')]({'name':_0x38f928[_0x71a3('0x3b')],'resourceId':_0x38f928['id'],'type':_0x28c184['name'],'sectionId':_0x28c184['id']},{})[_0x71a3('0x15')](function(){return _0x38f928;});})['catch'](function(_0x2d3b17){logger[_0x71a3('0x1c')](_0x71a3('0x87'),_0x2d3b17);throw _0x2d3b17;});})[_0x71a3('0x15')](respondWithResult(_0x18a3ae,0xc9))[_0x71a3('0x20')](handleError(_0x18a3ae,null));};exports['bulkCreate']=function(_0x471c80,_0x1bca59){var _0x51a48f=_0x471c80[_0x71a3('0x5c')];var _0x358853=[];if(_0x471c80[_0x71a3('0x2f')]['role']===_0x71a3('0x71'))throw new Error(_0x71a3('0x81'));if(_[_0x71a3('0x88')](_0x51a48f,['role','user'])&&_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x71a3('0x88')](_0x51a48f,['role',_0x71a3('0x2d')])&&_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!=='admin'){throw new Error(_0x71a3('0x89'));}return licenseUtil['checkUserLimits'](_0x51a48f)[_0x71a3('0x15')](function(){return validateUser(_0x51a48f[0x0]);})[_0x71a3('0x15')](function(){for(var _0x333ab6=0x1;_0x333ab6<_0x51a48f[_0x71a3('0x4b')];_0x333ab6++){var _0x4713a3=_0x51a48f[_0x333ab6-0x1]['internal'];if(!_0x51a48f[_0x333ab6][_0x71a3('0x67')])_0x51a48f[_0x333ab6][_0x71a3('0x67')]=_0x4713a3+0x1;_0x358853['push'](validateUser(_0x51a48f[_0x333ab6]));}return BPromise['all'](_0x358853);})[_0x71a3('0x15')](function(){_0x358853=[];for(var _0xbd5fcc=0x0;_0xbd5fcc<_0x51a48f[_0x71a3('0x4b')];_0xbd5fcc++){_0x358853['push'](updateUser(_0x51a48f[_0xbd5fcc]));}return BPromise[_0x71a3('0x5b')](_0x358853);})[_0x71a3('0x15')](function(){return BPromise[_0x71a3('0x8a')](_0x51a48f,function(_0x2fab3e){return db[_0x71a3('0x43')][_0x71a3('0x80')](_0x2fab3e,{'include':[{'model':db[_0x71a3('0x6e')],'as':'VoiceMail'}]})[_0x71a3('0x15')](function(_0xd87f34){_0x2fab3e['id']=_0xd87f34['id'];return _0x2fab3e;});});})[_0x71a3('0x15')](function(_0x2fc088){if(_0x471c80['body'][_0x71a3('0x2c')]===_0x71a3('0x2f'))return _0x2fc088;if(_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2f'))return _0x2fc088;var _0x220299=_[_0x71a3('0x88')](_0x2fc088,function(_0xd79454){return _0xd79454['role']===_0x71a3('0x71')||_0xd79454['role']===_0x71a3('0x32');});if(!_0x220299)return _0x2fc088;return db[_0x71a3('0x85')][_0x71a3('0x8b')]({'where':{'name':{'$or':[_0x71a3('0x30'),'Telephones']},'userProfileId':_0x471c80['user']['userProfileId']},'raw':!![]})[_0x71a3('0x15')](function(_0x38d740){if(_[_0x71a3('0x8c')](_0x38d740)||!_[_0x71a3('0x88')](_0x38d740,[_0x71a3('0x86'),0x0]))return _0x2fc088;_0x358853=[];var _0x11014c=_(_0x38d740)[_0x71a3('0x35')](function(_0x14919d){if(_0x14919d[_0x71a3('0x86')]===0x1)return;return _0x14919d[_0x71a3('0x3b')]==='Agents'?_0x71a3('0x71'):_0x71a3('0x32');})[_0x71a3('0x8d')]()[_0x71a3('0x36')]();for(var _0x43aab6=0x0;_0x43aab6<_0x2fc088[_0x71a3('0x4b')];_0x43aab6++){if(!_['includes'](_0x11014c,_0x2fc088[_0x43aab6][_0x71a3('0x2c')]))return;var _0x5ee509=_0x2fc088[_0x43aab6][_0x71a3('0x2c')]==='agent'?_0x71a3('0x30'):_0x71a3('0x31');_0x358853['push'](db[_0x71a3('0x39')]['create']({'name':_0x2fc088[_0x43aab6][_0x71a3('0x3b')],'resourceId':_0x2fc088[_0x43aab6]['id'],'type':_0x5ee509,'sectionId':_['find'](_0x38d740,[_0x71a3('0x3b'),_0x5ee509])['id']},{}));}return BPromise[_0x71a3('0x5b')](_0x358853);});})['then'](respondWithResult(_0x1bca59,0xc9))[_0x71a3('0x20')](handleError(_0x1bca59,null));};exports[_0x71a3('0x8e')]=function(_0x31bbd9,_0xf0bded){if(_0x31bbd9[_0x71a3('0x5c')]['id']){delete _0x31bbd9[_0x71a3('0x5c')]['id'];}return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x31bbd9['params']['id']}})[_0x71a3('0x15')](function(_0x1435f8){if(!_0x1435f8)return null;if(_0x1435f8['id']===_0x31bbd9[_0x71a3('0x2f')]['id']){if(!_0x31bbd9['body'][_0x71a3('0x8f')]||!_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')]){throw new db['Sequelize']['ValidationError'](_0x71a3('0x91'));}if(!_0x1435f8[_0x71a3('0x92')](_0x31bbd9['body'][_0x71a3('0x8f')])){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x95'));}if(_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x8f')]===_0x31bbd9[_0x71a3('0x5c')]['newPassword']){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x31bbd9['user'][_0x71a3('0x2c')]===_0x71a3('0x2d')){if(!_0x31bbd9['body'][_0x71a3('0x90')]){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x31bbd9['user'][_0x71a3('0x2c')]===_0x71a3('0x2f')){if(!_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')]){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x96'));}if(_0x1435f8[_0x71a3('0x2c')]!==_0x71a3('0x71')){throw new db['Sequelize'][(_0x71a3('0x94'))]('Unauthorized');}}else{throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x81'));}return _0x1435f8;})[_0x71a3('0x15')](handleEntityNotFound(_0xf0bded,null))['then'](function(_0x500bd9){return db[_0x71a3('0x62')][_0x71a3('0x97')]({'attributes':['id',_0x71a3('0x64'),_0x71a3('0x98'),'passwordHistoryLimit']})[_0x71a3('0x15')](function(_0x609352){if(_0x609352['securePassword'])authService[_0x71a3('0x65')](_0x31bbd9['body'][_0x71a3('0x90')]);if(!_0x609352[_0x71a3('0x98')]||!_0x500bd9[_0x71a3('0x99')])return _0x500bd9;authService[_0x71a3('0x9a')](_0x31bbd9[_0x71a3('0x5c')]['newPassword'],_0x500bd9[_0x71a3('0x99')],_0x609352['passwordHistoryLimit']);return _0x500bd9;})[_0x71a3('0x15')](saveUpdates({'password':_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')],'passwordResetAt':_0x31bbd9[_0x71a3('0x2f')]['id']==_0x31bbd9[_0x71a3('0x5f')]['id']?moment():null,'previousPasswords':authService[_0x71a3('0x9b')](_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')],_0x500bd9[_0x71a3('0x99')])},null));})[_0x71a3('0x15')](respondWithResult(_0xf0bded,null))[_0x71a3('0x20')](handleError(_0xf0bded,null));};exports[_0x71a3('0x9c')]=function(_0x3d1710,_0x17951c){var _0x5ea267=_0x3d1710['body']['channel'];return db[_0x71a3('0x43')]['find']({'where':{'id':_0x3d1710[_0x71a3('0x5f')]['id']},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c'),_0x71a3('0x9d'),'loginInPause',_0x71a3('0x9e'),_0x71a3('0x9f')]})[_0x71a3('0x15')](handleEntityNotFound(_0x17951c,null))[_0x71a3('0x15')](function(_0x29e932){if(_0x29e932){if(!utils[_0x71a3('0xa0')](_0x5ea267)){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0xa1'));}return _0x29e932['add'+_[_0x71a3('0xa2')](_0x5ea267['toLowerCase']())+'Queues'](_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')],{'penalty':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0xa3')]||0x0})[_0x71a3('0xa4')](function(_0x125bd4){for(var _0x57edb2=0x0;_0x57edb2<_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x57edb2+=0x1){var _0x47167a={'UserId':Number(_0x3d1710[_0x71a3('0x5f')]['id'])};_0x47167a[_[_0x71a3('0xa2')](_0x5ea267['toLowerCase']())+'QueueId']=Number(_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')][_0x57edb2]);socket[_0x71a3('0xa5')]('user'+_[_0x71a3('0xa2')](_0x5ea267[_0x71a3('0xa6')]())+_0x71a3('0xa7'),_0x47167a);}return _0x125bd4;})['then'](function(){if(_0x5ea267==='voice'){return db[_0x71a3('0xa8')][_0x71a3('0x8b')]({'where':{'id':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')]||[]},'raw':!![],'attributes':['id',_0x71a3('0x3b')]});}})[_0x71a3('0x15')](function(_0xa539cc){var _0x47cd2f=_0x29e932[_0x71a3('0x2b')]({'plain':!![]});var _0x34582b=[];if(_0x5ea267===_0x71a3('0xa9')&&_0x47cd2f[_0x71a3('0x2c')]===_0x71a3('0x71')&&_0x47cd2f[_0x71a3('0x9d')]){for(var _0x3a66f8=0x0;_0x3a66f8<_0xa539cc[_0x71a3('0x4b')];_0x3a66f8+=0x1){_0x34582b[_0x71a3('0x47')]({'membername':_0x47cd2f[_0x71a3('0x3b')],'UserId':_0x47cd2f['id'],'queue_name':_0xa539cc[_0x3a66f8][_0x71a3('0x3b')],'VoiceQueueId':_0xa539cc[_0x3a66f8]['id'],'interface':_[_0x71a3('0x68')](_0x47cd2f[_0x71a3('0x9f')])?util[_0x71a3('0xaa')](_0x71a3('0xab'),_0x47cd2f['name']):_0x47cd2f[_0x71a3('0x9f')],'paused':_0x47cd2f[_0x71a3('0x9e')]||![],'penalty':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0xa3')]||0x0});}return BPromise[_0x71a3('0x8a')](_0x34582b,function(_0x35a51f){return db[_0x71a3('0xac')][_0x71a3('0xad')](_0x35a51f);});}return _0x29e932;});}})[_0x71a3('0x15')](respondWithStatusCode(_0x17951c,null))[_0x71a3('0x20')](handleError(_0x17951c,null));};exports[_0x71a3('0xae')]=function(_0xbe2360,_0x1b6c9b){var _0x22873;return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0xbe2360['params']['id']},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c')]})[_0x71a3('0x15')](handleEntityNotFound(_0x1b6c9b,null))[_0x71a3('0x15')](function(_0x56a85a){if(_0x56a85a){_0x22873=_0x56a85a;if(!_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')]||!utils[_0x71a3('0xa0')](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')])){throw new db[(_0x71a3('0x93'))]['ValidationError']('Unknown\x20channel');}return _0x56a85a[_0x71a3('0xb0')+_['capitalize'](_0xbe2360['query'][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb1')](_0xbe2360[_0x71a3('0x44')]['ids']);}})[_0x71a3('0x15')](function(_0x169408){if(_['isArray'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')])){for(var _0x3965d1=0x0;_0x3965d1<_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x3965d1+=0x1){var _0x410c41={'UserId':Number(_0xbe2360[_0x71a3('0x5f')]['id'])};_0x410c41[_[_0x71a3('0xa2')](_0xbe2360[_0x71a3('0x44')]['channel'][_0x71a3('0xa6')]())+_0x71a3('0xb2')]=Number(_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')][_0x3965d1]);socket[_0x71a3('0xa5')]('user'+_[_0x71a3('0xa2')](_0xbe2360['query']['channel'][_0x71a3('0xa6')]())+_0x71a3('0xb3'),_0x410c41);}}else{var _0x410c41={'UserId':Number(_0xbe2360['params']['id'])};_0x410c41[_['capitalize'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb2')]=Number(_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')]);socket[_0x71a3('0xa5')](_0x71a3('0x2f')+_['capitalize'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb3'),_0x410c41);}return _0x169408;})['then'](function(){if(_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')]==='voice'){return db[_0x71a3('0xac')][_0x71a3('0x2a')]({'where':{'UserId':_0xbe2360[_0x71a3('0x5f')]['id'],'VoiceQueueId':_0xbe2360['query'][_0x71a3('0x60')]},'individualHooks':!![]})[_0x71a3('0x15')](function(){return _0x22873;});}return _0x22873;})['then'](respondWithStatusCode(_0x1b6c9b,null))[_0x71a3('0x20')](handleError(_0x1b6c9b,null));};exports[_0x71a3('0xb4')]=function(_0x39965e,_0x13b1f7){_0x39965e[_0x71a3('0x5c')][_0x71a3('0xb5')]=_0x39965e[_0x71a3('0xb6')][_0x71a3('0xb7')];return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x39965e[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x13b1f7,null))[_0x71a3('0x15')](saveUpdates(_0x39965e[_0x71a3('0x5c')],null))[_0x71a3('0x15')](respondWithResult(_0x13b1f7,null))[_0x71a3('0x20')](handleError(_0x13b1f7,null));};exports['getAvatar']=function(_0x3a3f78,_0x39939d){var _0x13741a=path['join'](config[_0x71a3('0xb8')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x3a3f78[_0x71a3('0x5f')]['id']},'attributes':['id',_0x71a3('0xb5')],'raw':!![]})[_0x71a3('0x15')](handleEntityNotFound(_0x39939d,null))[_0x71a3('0x15')](function(_0x3eb84f){if(_0x3eb84f){if(_[_0x71a3('0x68')](_0x3eb84f[_0x71a3('0xb5')])){return _0x39939d[_0x71a3('0xb9')](_0x13741a);}else{if(!fs[_0x71a3('0xba')](path[_0x71a3('0xbb')](config[_0x71a3('0xb8')],_0x71a3('0xbc'),_0x3eb84f[_0x71a3('0xb5')]))){return _0x39939d[_0x71a3('0xb9')](_0x13741a);}return _0x39939d[_0x71a3('0xb9')](path['join'](config[_0x71a3('0xb8')],_0x71a3('0xbc'),_0x3eb84f[_0x71a3('0xb5')]));}}})[_0x71a3('0x20')](handleError(_0x39939d,null));};exports['getOpenTabs']=function(_0x379c00,_0x18a69d){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x379c00[_0x71a3('0x5f')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x18a69d,null))[_0x71a3('0x15')](function(_0x37a598){var _0x44bb40=[];values=_0x37a598[_0x71a3('0x4d')];_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40['push'](get_open_tabs(_0x71a3('0x4e'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x5a'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x37a598['dataValues']));_0x44bb40['push'](get_open_tabs(_0x71a3('0x4f'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x50'),_0x37a598[_0x71a3('0x4d')]));return BPromise['all'](_0x44bb40);})['then'](function(_0x3aebc8){var _0x40395d=[];if(_0x3aebc8){for(var _0x38594a=0x0;_0x38594a<values[_0x71a3('0xbd')]['length'];_0x38594a++){var _0x1fafdd=values[_0x71a3('0xbd')][_0x38594a];_0x40395d[_0x71a3('0x47')]({'channel':_0x71a3('0xbe'),'id':_0x1fafdd['id'],'createdAt':_0x1fafdd['createdAt']});}for(var _0x38594a=0x0;_0x38594a<values['FaxOpenTabs']['length'];_0x38594a++){var _0x1fafdd=values[_0x71a3('0xbf')][_0x38594a];_0x40395d['push']({'channel':'FAX','id':_0x1fafdd['id'],'createdAt':_0x1fafdd[_0x71a3('0xc0')]});}for(var _0x38594a=0x0;_0x38594a<values[_0x71a3('0xc1')][_0x71a3('0x4b')];_0x38594a++){var _0x1fafdd=values[_0x71a3('0xc1')][_0x38594a];_0x40395d[_0x71a3('0x47')]({'channel':_0x71a3('0xc2'),'id':_0x1fafdd['id'],'createdAt':_0x1fafdd[_0x71a3('0xc0')]});}for(var _0x38594a=0x0;_0x38594a<values[_0x71a3('0xc3')][_0x71a3('0x4b')];_0x38594a++){var _0x1fafdd=values[_0x71a3('0xc3')][_0x38594a];_0x40395d['push']({'channel':_0x71a3('0xc4'),'id':_0x1fafdd['id'],'createdAt':_0x1fafdd[_0x71a3('0xc0')]});}for(var _0x38594a=0x0;_0x38594a<values['SmsOpenTabs'][_0x71a3('0x4b')];_0x38594a++){var _0x1fafdd=values['SmsOpenTabs'][_0x38594a];_0x40395d[_0x71a3('0x47')]({'channel':_0x71a3('0xc5'),'id':_0x1fafdd['id'],'createdAt':_0x1fafdd[_0x71a3('0xc0')]});}for(var _0x38594a=0x0;_0x38594a<values[_0x71a3('0xc6')][_0x71a3('0x4b')];_0x38594a++){var _0x1fafdd=values[_0x71a3('0xc6')][_0x38594a];_0x40395d[_0x71a3('0x47')]({'channel':'WHATSAPP','id':_0x1fafdd['id'],'createdAt':_0x1fafdd[_0x71a3('0xc0')]});}var _0x6f8959={'count':_0x40395d[_0x71a3('0x4b')],'rows':_0x40395d};return _0x6f8959;}else return null;})[_0x71a3('0x15')](respondWithResult(_0x18a69d,null))['catch'](handleError(_0x18a69d,null));};exports[_0x71a3('0xc7')]=function(_0x1102c4,_0xa2363e){var _0x27003b={};var _0x300692={};var _0x118a8c;var _0x1bbbe1;return db[_0x71a3('0x43')]['findOne']({'where':{'id':_0x1102c4['params']['id']}})['then'](handleEntityNotFound(_0xa2363e,null))[_0x71a3('0x15')](function(_0x5de288){if(_0x5de288){_0x118a8c=_0x5de288;_0x300692[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xc8')]['rawAttributes']);_0x300692[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x1102c4[_0x71a3('0x44')]);_0x300692[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x300692[_0x71a3('0x53')],_0x300692[_0x71a3('0x44')]);_0x27003b['attributes']=_[_0x71a3('0x57')](_0x300692[_0x71a3('0x53')],qs['fields'](_0x1102c4[_0x71a3('0x44')][_0x71a3('0x58')]));_0x27003b[_0x71a3('0x46')]=_0x27003b['attributes']['length']?_0x27003b[_0x71a3('0x46')]:_0x300692[_0x71a3('0x53')];_0x27003b[_0x71a3('0xc9')]=qs['sort'](_0x1102c4[_0x71a3('0x44')]['sort']);_0x27003b[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_['pick'](_0x1102c4[_0x71a3('0x44')],_0x300692['filters']));if(_0x1102c4[_0x71a3('0x44')]['filter']){_0x27003b[_0x71a3('0x42')]=_['merge'](_0x27003b[_0x71a3('0x42')],{'$or':_['map'](_0x27003b[_0x71a3('0x46')],function(_0x32f935){var _0x5981cf={};_0x5981cf[_0x32f935]={'$like':'%'+_0x1102c4[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x5981cf;})});}_0x27003b=_[_0x71a3('0xca')]({},_0x27003b,_0x1102c4['options']);return _0x118a8c[_0x71a3('0xc7')](_0x27003b);}})[_0x71a3('0x15')](function(_0x3e415c){if(_0x3e415c){_0x1bbbe1=_0x3e415c[_0x71a3('0x4b')];if(_0x1102c4[_0x71a3('0x44')]['hasOwnProperty'](_0x71a3('0xcb'))){_0x27003b[_0x71a3('0x45')]=[{'model':db[_0x71a3('0xcc')],'as':_0x71a3('0xcd'),'required':![]},{'model':db[_0x71a3('0xce')],'as':'Tags','attributes':['id',_0x71a3('0x3b'),_0x71a3('0xcf')],'where':_0x1102c4[_0x71a3('0x44')][_0x71a3('0xd0')]?{'id':_0x1102c4['query'][_0x71a3('0xd0')]}:undefined,'required':_0x1102c4[_0x71a3('0x44')][_0x71a3('0xd0')]?!![]:![]}];}if(!_0x1102c4[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x27003b['limit']=qs[_0x71a3('0x25')](_0x1102c4['query'][_0x71a3('0x25')]);_0x27003b[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x1102c4['query'][_0x71a3('0x23')]);}return _0x118a8c[_0x71a3('0xc7')](_0x27003b);}})[_0x71a3('0x15')](function(_0x30916c){if(_0x30916c){return _0x30916c?{'count':_0x1bbbe1,'rows':_0x30916c}:null;}})['then'](respondWithResult(_0xa2363e,null))[_0x71a3('0x20')](handleError(_0xa2363e,null));};exports[_0x71a3('0xd3')]=function(_0x414638,_0x4b968d){var _0x9878e0;var _0x9639a4;var _0x3ba1f3={};var _0x5ba504;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x414638['params']['id']},'attributes':['id',_0x71a3('0x3b'),'role']})[_0x71a3('0x15')](handleEntityNotFound(_0x4b968d,null))['then'](function(_0x301ab8){if(!utils[_0x71a3('0xa0')](_0x414638[_0x71a3('0x44')]['channel'])){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0xa1'));}_0x9878e0=_0x301ab8;var _0x102496={};_0x102496[_0x71a3('0x53')]=_['keys'](db[_['capitalize'](_0x414638['query'][_0x71a3('0xaf')])+_0x71a3('0xd4')]['rawAttributes']);_0x102496['query']=_['keys'](_0x414638[_0x71a3('0x44')]);_0x102496['filters']=_[_0x71a3('0x57')](_0x102496[_0x71a3('0x53')],_0x102496['query']);_0x3ba1f3[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x102496['model'],qs['fields'](_0x414638['query'][_0x71a3('0x58')]));_0x3ba1f3[_0x71a3('0x46')]=_0x3ba1f3['attributes'][_0x71a3('0x4b')]?_0x3ba1f3['attributes']:_0x102496[_0x71a3('0x53')];_0x3ba1f3[_0x71a3('0xc9')]=qs['sort'](_0x414638[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x3ba1f3[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x414638[_0x71a3('0x44')],_0x102496[_0x71a3('0x56')]));if(_0x414638['query'][_0x71a3('0x33')]){_0x3ba1f3['where']=_[_0x71a3('0xca')](_0x3ba1f3['where'],{'$or':_[_0x71a3('0x35')](_0x3ba1f3[_0x71a3('0x46')],function(_0x38705d){var _0x24a353={};_0x24a353[_0x38705d]={'$like':'%'+_0x414638[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x24a353;})});}_0x3ba1f3=_[_0x71a3('0xca')]({},_0x3ba1f3,_0x414638[_0x71a3('0x59')]);switch(_0x9878e0[_0x71a3('0x2c')]){case _0x71a3('0x2d'):return db[_[_0x71a3('0xa2')](_0x414638[_0x71a3('0x44')][_0x71a3('0xaf')])+_0x71a3('0xd4')]['findAll'](_0x3ba1f3);case _0x71a3('0x2f'):case _0x71a3('0x71'):return _0x9878e0[_0x71a3('0x2b')+_[_0x71a3('0xa2')](_0x414638['query']['channel'])+_0x71a3('0xb1')](_0x3ba1f3);default:throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0xd7'));}})['then'](function(_0x35dad6){_0x5ba504=_0x35dad6[_0x71a3('0x4b')];if(!_0x414638['query'][_0x71a3('0xd1')]('nolimit')){_0x3ba1f3[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x414638[_0x71a3('0x44')][_0x71a3('0x25')]);_0x3ba1f3[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x414638['query'][_0x71a3('0x23')]);}switch(_0x9878e0[_0x71a3('0x2c')]){case _0x71a3('0x2d'):return db[_[_0x71a3('0xa2')](_0x414638[_0x71a3('0x44')][_0x71a3('0xaf')])+_0x71a3('0xd4')][_0x71a3('0x8b')](_0x3ba1f3);case'user':case _0x71a3('0x71'):return _0x9878e0[_0x71a3('0x2b')+_[_0x71a3('0xa2')](_0x414638[_0x71a3('0x44')][_0x71a3('0xaf')])+_0x71a3('0xb1')](_0x3ba1f3);}})[_0x71a3('0x15')](function(_0x25a502){return{'count':_0x5ba504,'rows':_0x25a502};})[_0x71a3('0x15')](respondWithResult(_0x4b968d,null))[_0x71a3('0x20')](handleError(_0x4b968d,null));};exports[_0x71a3('0xd8')]=function(_0x57caa2,_0x8904ff){var _0x3702f3={};var _0x493396={};var _0x5eeed1;var _0x567c5a;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x57caa2[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x8904ff,null))['then'](function(_0x2c47ee){if(_0x2c47ee){_0x5eeed1=_0x2c47ee;_0x493396[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xac')][_0x71a3('0x3d')]);_0x493396[_0x71a3('0x44')]=_['keys'](_0x57caa2['query']);_0x493396[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x493396['model'],_0x493396[_0x71a3('0x44')]);_0x3702f3[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x493396[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x57caa2[_0x71a3('0x44')][_0x71a3('0x58')]));_0x3702f3[_0x71a3('0x46')]=_0x3702f3[_0x71a3('0x46')]['length']?_0x3702f3[_0x71a3('0x46')]:_0x493396[_0x71a3('0x53')];_0x3702f3['order']=qs[_0x71a3('0xd5')](_0x57caa2[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x3702f3[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_['pick'](_0x57caa2[_0x71a3('0x44')],_0x493396[_0x71a3('0x56')]));if(_0x57caa2[_0x71a3('0x44')][_0x71a3('0x33')]){_0x3702f3[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x3702f3[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x3702f3[_0x71a3('0x46')],function(_0xb57cea){var _0x2688dc={};_0x2688dc[_0xb57cea]={'$like':'%'+_0x57caa2[_0x71a3('0x44')]['filter']+'%'};return _0x2688dc;})});}_0x3702f3=_['merge']({},_0x3702f3,_0x57caa2['options']);return _0x5eeed1[_0x71a3('0xd8')](_0x3702f3);}})['then'](function(_0x9eada2){if(_0x9eada2){_0x567c5a=_0x9eada2[_0x71a3('0x4b')];if(!_0x57caa2[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x3702f3[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x57caa2[_0x71a3('0x44')][_0x71a3('0x25')]);_0x3702f3[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x57caa2['query'][_0x71a3('0x23')]);}return _0x5eeed1[_0x71a3('0xd8')](_0x3702f3);}})[_0x71a3('0x15')](function(_0x1e183e){if(_0x1e183e){return _0x1e183e?{'count':_0x567c5a,'rows':_0x1e183e}:null;}})[_0x71a3('0x15')](respondWithResult(_0x8904ff,null))[_0x71a3('0x20')](handleError(_0x8904ff,null));};exports[_0x71a3('0xd9')]=function(_0x34f1f1,_0x10b189){var _0x144b12={};var _0x55a0b9={};var _0x1879e6;var _0x3a6671;return db['User'][_0x71a3('0x97')]({'where':{'id':_0x34f1f1[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x10b189,null))[_0x71a3('0x15')](function(_0x411fc1){if(_0x411fc1){_0x1879e6=_0x411fc1;_0x55a0b9[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xda')][_0x71a3('0x3d')]);_0x55a0b9[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x34f1f1[_0x71a3('0x44')]);_0x55a0b9[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x55a0b9['model'],_0x55a0b9['query']);_0x144b12[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x55a0b9[_0x71a3('0x53')],qs['fields'](_0x34f1f1[_0x71a3('0x44')][_0x71a3('0x58')]));_0x144b12[_0x71a3('0x46')]=_0x144b12[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x144b12['attributes']:_0x55a0b9[_0x71a3('0x53')];_0x144b12[_0x71a3('0xc9')]=qs['sort'](_0x34f1f1[_0x71a3('0x44')]['sort']);_0x144b12[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x34f1f1[_0x71a3('0x44')],_0x55a0b9[_0x71a3('0x56')]));if(_0x34f1f1[_0x71a3('0x44')][_0x71a3('0x33')]){_0x144b12[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x144b12[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x144b12[_0x71a3('0x46')],function(_0x34914b){var _0x88251c={};_0x88251c[_0x34914b]={'$like':'%'+_0x34f1f1[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x88251c;})});}_0x144b12=_[_0x71a3('0xca')]({},_0x144b12,_0x34f1f1['options']);return _0x1879e6[_0x71a3('0xd9')](_0x144b12);}})['then'](function(_0x4b2f38){if(_0x4b2f38){_0x3a6671=_0x4b2f38[_0x71a3('0x4b')];if(!_0x34f1f1[_0x71a3('0x44')][_0x71a3('0xd1')]('nolimit')){_0x144b12[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x34f1f1[_0x71a3('0x44')]['limit']);_0x144b12['offset']=qs[_0x71a3('0x23')](_0x34f1f1['query']['offset']);}return _0x1879e6['getGroups'](_0x144b12);}})[_0x71a3('0x15')](function(_0x5a76b9){if(_0x5a76b9){return _0x5a76b9?{'count':_0x3a6671,'rows':_0x5a76b9}:null;}})[_0x71a3('0x15')](respondWithResult(_0x10b189,null))[_0x71a3('0x20')](handleError(_0x10b189,null));};exports[_0x71a3('0xdb')]=function(_0x547cfd,_0x11abd1){var _0x3877d5={'raw':!![],'where':{}};var _0x115074={};var _0x34ae60={'count':0x0,'rows':[]};return db['User'][_0x71a3('0x97')]({'where':{'id':_0x547cfd[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x11abd1,null))[_0x71a3('0x15')](function(_0x334c06){if(_0x334c06){_0x115074[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xdc')][_0x71a3('0x3d')]);_0x115074[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x547cfd[_0x71a3('0x44')]);_0x115074[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x115074[_0x71a3('0x53')],_0x115074['query']);_0x3877d5[_0x71a3('0x46')]=_['intersection'](_0x115074[_0x71a3('0x53')],qs['fields'](_0x547cfd[_0x71a3('0x44')][_0x71a3('0x58')]));_0x3877d5[_0x71a3('0x46')]=_0x3877d5[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x3877d5[_0x71a3('0x46')]:_0x115074[_0x71a3('0x53')];if(!_0x547cfd[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x3877d5['limit']=qs[_0x71a3('0x25')](_0x547cfd[_0x71a3('0x44')][_0x71a3('0x25')]);_0x3877d5[_0x71a3('0x23')]=qs['offset'](_0x547cfd[_0x71a3('0x44')][_0x71a3('0x23')]);}_0x3877d5[_0x71a3('0xc9')]=qs['sort'](_0x547cfd[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x3877d5['where']=qs['filters'](_[_0x71a3('0xd6')](_0x547cfd[_0x71a3('0x44')],_0x115074[_0x71a3('0x56')]));_0x3877d5[_0x71a3('0x42')][_0x71a3('0xdd')]=_0x334c06['id'];if(_0x547cfd[_0x71a3('0x44')][_0x71a3('0x33')]){_0x3877d5['where']=_[_0x71a3('0xca')](_0x3877d5[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x3877d5[_0x71a3('0x46')],function(_0x542e31){var _0xe87927={};_0xe87927[_0x542e31]={'$like':'%'+_0x547cfd[_0x71a3('0x44')]['filter']+'%'};return _0xe87927;})});}_0x3877d5=_[_0x71a3('0xca')]({},_0x3877d5,_0x547cfd[_0x71a3('0x59')]);return db[_0x71a3('0xdc')][_0x71a3('0x26')]({'where':_0x3877d5[_0x71a3('0x42')]})[_0x71a3('0x15')](function(_0x2aaef8){_0x34ae60['count']=_0x2aaef8;if(_0x547cfd[_0x71a3('0x44')][_0x71a3('0xcb')]){_0x3877d5[_0x71a3('0x45')]=[{'all':!![]}];}return db[_0x71a3('0xdc')][_0x71a3('0x8b')](_0x3877d5);})[_0x71a3('0x15')](function(_0x1a6d1e){_0x34ae60['rows']=_0x1a6d1e;return _0x34ae60;});}})['then'](respondWithFilteredResult(_0x11abd1,_0x3877d5))['catch'](handleError(_0x11abd1,null));};exports['getScreenRecordings']=function(_0x5ea40f,_0x23b8fe){var _0x578fd5={'raw':!![],'where':{}};var _0x346794={};var _0x22f8c1={'count':0x0,'rows':[]};return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x5ea40f[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x23b8fe,null))[_0x71a3('0x15')](function(_0x23eb8b){if(_0x23eb8b){_0x346794[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xde')]['rawAttributes']);_0x346794['query']=_['keys'](_0x5ea40f[_0x71a3('0x44')]);_0x346794[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x346794[_0x71a3('0x53')],_0x346794['query']);_0x578fd5[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x346794[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x5ea40f[_0x71a3('0x44')][_0x71a3('0x58')]));_0x578fd5['attributes']=_0x578fd5['attributes'][_0x71a3('0x4b')]?_0x578fd5[_0x71a3('0x46')]:_0x346794[_0x71a3('0x53')];if(!_0x5ea40f['query'][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x578fd5[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x5ea40f[_0x71a3('0x44')]['limit']);_0x578fd5['offset']=qs[_0x71a3('0x23')](_0x5ea40f['query'][_0x71a3('0x23')]);}_0x578fd5['order']=qs[_0x71a3('0xd5')](_0x5ea40f[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x578fd5[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x5ea40f[_0x71a3('0x44')],_0x346794[_0x71a3('0x56')]));_0x578fd5[_0x71a3('0x42')][_0x71a3('0xdd')]=_0x23eb8b['id'];if(_0x5ea40f[_0x71a3('0x44')][_0x71a3('0x33')]){_0x578fd5[_0x71a3('0x42')]=_['merge'](_0x578fd5['where'],{'$or':_['map'](_0x578fd5['attributes'],function(_0x2bc1eb){var _0x4d54e4={};_0x4d54e4[_0x2bc1eb]={'$like':'%'+_0x5ea40f[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x4d54e4;})});}_0x578fd5=_['merge']({},_0x578fd5,_0x5ea40f[_0x71a3('0x59')]);return db['ScreenRecording'][_0x71a3('0x26')]({'where':_0x578fd5[_0x71a3('0x42')]})[_0x71a3('0x15')](function(_0x210021){_0x22f8c1[_0x71a3('0x26')]=_0x210021;if(_0x5ea40f[_0x71a3('0x44')][_0x71a3('0xcb')]){_0x578fd5[_0x71a3('0x45')]=[{'all':!![]}];}return db['ScreenRecording'][_0x71a3('0x8b')](_0x578fd5);})['then'](function(_0x2527d7){_0x22f8c1['rows']=_0x2527d7;return _0x22f8c1;});}})['then'](respondWithFilteredResult(_0x23b8fe,_0x578fd5))['catch'](handleError(_0x23b8fe,null));};exports[_0x71a3('0xdf')]=function(_0xbd1128,_0xb40751){var _0x559e39={};var _0xe938a={};var _0x5b7eae;var _0x1312ac;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0xbd1128[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0xb40751,null))[_0x71a3('0x15')](function(_0xe84485){if(_0xe84485){_0x5b7eae=_0xe84485;_0xe938a['model']=_[_0x71a3('0x54')](db[_0x71a3('0xe0')][_0x71a3('0x3d')]);_0xe938a[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0xbd1128[_0x71a3('0x44')]);_0xe938a['filters']=_[_0x71a3('0x57')](_0xe938a[_0x71a3('0x53')],_0xe938a[_0x71a3('0x44')]);_0x559e39['attributes']=_['intersection'](_0xe938a[_0x71a3('0x53')],qs['fields'](_0xbd1128['query'][_0x71a3('0x58')]));_0x559e39['attributes']=_0x559e39[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x559e39[_0x71a3('0x46')]:_0xe938a['model'];_0x559e39[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0xbd1128[_0x71a3('0x44')]['sort']);_0x559e39[_0x71a3('0x42')]=qs['filters'](_[_0x71a3('0xd6')](_0xbd1128[_0x71a3('0x44')],_0xe938a[_0x71a3('0x56')]));if(_0xbd1128[_0x71a3('0x44')][_0x71a3('0x33')]){_0x559e39[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x559e39[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x559e39[_0x71a3('0x46')],function(_0x40c7cc){var _0x26833e={};_0x26833e[_0x40c7cc]={'$like':'%'+_0xbd1128[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x26833e;})});}_0x559e39=_[_0x71a3('0xca')]({},_0x559e39,_0xbd1128[_0x71a3('0x59')]);return _0x5b7eae[_0x71a3('0xdf')](_0x559e39);}})['then'](function(_0x52d9ce){if(_0x52d9ce){_0x1312ac=_0x52d9ce[_0x71a3('0x4b')];if(!_0xbd1128[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x559e39[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0xbd1128[_0x71a3('0x44')][_0x71a3('0x25')]);_0x559e39[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0xbd1128[_0x71a3('0x44')][_0x71a3('0x23')]);}return _0x5b7eae[_0x71a3('0xdf')](_0x559e39);}})['then'](function(_0x4917f6){if(_0x4917f6){return _0x4917f6?{'count':_0x1312ac,'rows':_0x4917f6}:null;}})['then'](respondWithResult(_0xb40751,null))[_0x71a3('0x20')](handleError(_0xb40751,null));};exports[_0x71a3('0xe1')]=function(_0x1d1862,_0x5e1ae4){var _0x3e977e={};var _0x50eb9d={};var _0x108e0b;var _0x1ef9e5;return db[_0x71a3('0x43')]['findOne']({'where':{'id':_0x1d1862['params']['id']}})['then'](handleEntityNotFound(_0x5e1ae4,null))['then'](function(_0x9b372){if(_0x9b372){_0x108e0b=_0x9b372;_0x50eb9d[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xe2')][_0x71a3('0x3d')]);_0x50eb9d[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x1d1862['query']);_0x50eb9d[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x50eb9d[_0x71a3('0x53')],_0x50eb9d[_0x71a3('0x44')]);_0x3e977e['attributes']=_[_0x71a3('0x57')](_0x50eb9d[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x1d1862[_0x71a3('0x44')][_0x71a3('0x58')]));_0x3e977e[_0x71a3('0x46')]=_0x3e977e[_0x71a3('0x46')]['length']?_0x3e977e[_0x71a3('0x46')]:_0x50eb9d['model'];_0x3e977e[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x1d1862[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x3e977e[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_['pick'](_0x1d1862[_0x71a3('0x44')],_0x50eb9d['filters']));if(_0x1d1862[_0x71a3('0x44')][_0x71a3('0x33')]){_0x3e977e[_0x71a3('0x42')]=_['merge'](_0x3e977e[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x3e977e[_0x71a3('0x46')],function(_0x2e5d91){var _0x267ee0={};_0x267ee0[_0x2e5d91]={'$like':'%'+_0x1d1862['query'][_0x71a3('0x33')]+'%'};return _0x267ee0;})});}_0x3e977e=_[_0x71a3('0xca')]({},_0x3e977e,_0x1d1862[_0x71a3('0x59')]);return _0x108e0b[_0x71a3('0xe1')](_0x3e977e);}})[_0x71a3('0x15')](function(_0x5544d2){if(_0x5544d2){_0x1ef9e5=_0x5544d2[_0x71a3('0x4b')];if(!_0x1d1862[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x3e977e[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x1d1862['query'][_0x71a3('0x25')]);_0x3e977e[_0x71a3('0x23')]=qs['offset'](_0x1d1862[_0x71a3('0x44')][_0x71a3('0x23')]);}return _0x108e0b[_0x71a3('0xe1')](_0x3e977e);}})['then'](function(_0x2b201d){if(_0x2b201d){return _0x2b201d?{'count':_0x1ef9e5,'rows':_0x2b201d}:null;}})['then'](respondWithResult(_0x5e1ae4,null))[_0x71a3('0x20')](handleError(_0x5e1ae4,null));};exports['getMailInteractions']=function(_0x23f2c9,_0x14437d){var _0x4f6a1e={'raw':!![],'where':{}};var _0x3ef0d8={};var _0x146edc={'count':0x0,'rows':[]};return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x23f2c9[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x14437d,null))[_0x71a3('0x15')](function(_0x513116){if(_0x513116){_0x3ef0d8[_0x71a3('0x53')]=_[_0x71a3('0x54')](db['MailInteraction'][_0x71a3('0x3d')]);_0x3ef0d8['query']=_['keys'](_0x23f2c9['query']);_0x3ef0d8[_0x71a3('0x56')]=_['intersection'](_0x3ef0d8['model'],_0x3ef0d8[_0x71a3('0x44')]);_0x4f6a1e['attributes']=_[_0x71a3('0x57')](_0x3ef0d8[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x23f2c9['query'][_0x71a3('0x58')]));_0x4f6a1e[_0x71a3('0x46')]=_0x4f6a1e[_0x71a3('0x46')]['length']?_0x4f6a1e[_0x71a3('0x46')]:_0x3ef0d8[_0x71a3('0x53')];if(!_0x23f2c9[_0x71a3('0x44')][_0x71a3('0xd1')]('nolimit')){_0x4f6a1e[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x23f2c9[_0x71a3('0x44')][_0x71a3('0x25')]);_0x4f6a1e[_0x71a3('0x23')]=qs['offset'](_0x23f2c9[_0x71a3('0x44')]['offset']);}_0x4f6a1e[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x23f2c9[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x4f6a1e[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_['pick'](_0x23f2c9[_0x71a3('0x44')],_0x3ef0d8[_0x71a3('0x56')]));_0x4f6a1e[_0x71a3('0x42')][_0x71a3('0xdd')]=_0x513116['id'];if(_0x23f2c9[_0x71a3('0x44')][_0x71a3('0x33')]){_0x4f6a1e['where']=_['merge'](_0x4f6a1e['where'],{'$or':_[_0x71a3('0x35')](_0x4f6a1e[_0x71a3('0x46')],function(_0x47a684){var _0x738510={};_0x738510[_0x47a684]={'$like':'%'+_0x23f2c9[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x738510;})});}_0x4f6a1e=_['merge']({},_0x4f6a1e,_0x23f2c9[_0x71a3('0x59')]);return db[_0x71a3('0xe3')][_0x71a3('0x26')]({'where':_0x4f6a1e['where']})['then'](function(_0x288e52){_0x146edc[_0x71a3('0x26')]=_0x288e52;if(_0x23f2c9[_0x71a3('0x44')][_0x71a3('0xcb')]){_0x4f6a1e['include']=[{'all':!![]}];}return db[_0x71a3('0xe3')][_0x71a3('0x8b')](_0x4f6a1e);})[_0x71a3('0x15')](function(_0x476dff){_0x146edc['rows']=_0x476dff;return _0x146edc;});}})[_0x71a3('0x15')](respondWithFilteredResult(_0x14437d,_0x4f6a1e))[_0x71a3('0x20')](handleError(_0x14437d,null));};exports[_0x71a3('0xe4')]=function(_0x573675,_0x5ea8b0){var _0x2af756={};var _0x521949={};var _0x40d3e2;var _0x20f657;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x573675[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x5ea8b0,null))['then'](function(_0x538048){if(_0x538048){_0x40d3e2=_0x538048;_0x521949[_0x71a3('0x53')]=_[_0x71a3('0x54')](db['SmsInteraction'][_0x71a3('0x3d')]);_0x521949['query']=_[_0x71a3('0x54')](_0x573675[_0x71a3('0x44')]);_0x521949['filters']=_['intersection'](_0x521949[_0x71a3('0x53')],_0x521949[_0x71a3('0x44')]);_0x2af756['attributes']=_['intersection'](_0x521949['model'],qs['fields'](_0x573675[_0x71a3('0x44')][_0x71a3('0x58')]));_0x2af756[_0x71a3('0x46')]=_0x2af756[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x2af756[_0x71a3('0x46')]:_0x521949['model'];_0x2af756[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x573675[_0x71a3('0x44')]['sort']);_0x2af756['where']=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x573675[_0x71a3('0x44')],_0x521949[_0x71a3('0x56')]));if(_0x573675[_0x71a3('0x44')]['filter']){_0x2af756[_0x71a3('0x42')]=_['merge'](_0x2af756['where'],{'$or':_[_0x71a3('0x35')](_0x2af756[_0x71a3('0x46')],function(_0x33fc91){var _0x5cc039={};_0x5cc039[_0x33fc91]={'$like':'%'+_0x573675['query'][_0x71a3('0x33')]+'%'};return _0x5cc039;})});}_0x2af756=_[_0x71a3('0xca')]({},_0x2af756,_0x573675[_0x71a3('0x59')]);return _0x40d3e2[_0x71a3('0xe4')](_0x2af756);}})[_0x71a3('0x15')](function(_0x3b27b1){if(_0x3b27b1){_0x20f657=_0x3b27b1[_0x71a3('0x4b')];if(!_0x573675[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x2af756[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x573675[_0x71a3('0x44')][_0x71a3('0x25')]);_0x2af756['offset']=qs[_0x71a3('0x23')](_0x573675[_0x71a3('0x44')]['offset']);}return _0x40d3e2[_0x71a3('0xe4')](_0x2af756);}})[_0x71a3('0x15')](function(_0xaccd64){if(_0xaccd64){return _0xaccd64?{'count':_0x20f657,'rows':_0xaccd64}:null;}})['then'](respondWithResult(_0x5ea8b0,null))[_0x71a3('0x20')](handleError(_0x5ea8b0,null));};exports[_0x71a3('0xe5')]=function(_0x3d7fd5,_0x3ef0d5){var _0x3652ee={};var _0x5af5a7={};var _0x2ed354;var _0x471ad9;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x3d7fd5[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x3ef0d5,null))[_0x71a3('0x15')](function(_0x3fe12b){if(_0x3fe12b){_0x2ed354=_0x3fe12b;_0x5af5a7[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xe6')]['rawAttributes']);_0x5af5a7[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x3d7fd5[_0x71a3('0x44')]);_0x5af5a7[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x5af5a7[_0x71a3('0x53')],_0x5af5a7['query']);_0x3652ee[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x5af5a7['model'],qs[_0x71a3('0x58')](_0x3d7fd5[_0x71a3('0x44')][_0x71a3('0x58')]));_0x3652ee[_0x71a3('0x46')]=_0x3652ee[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x3652ee[_0x71a3('0x46')]:_0x5af5a7[_0x71a3('0x53')];_0x3652ee[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x3d7fd5[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x3652ee[_0x71a3('0x42')]=qs['filters'](_[_0x71a3('0xd6')](_0x3d7fd5['query'],_0x5af5a7[_0x71a3('0x56')]));if(_0x3d7fd5[_0x71a3('0x44')][_0x71a3('0x33')]){_0x3652ee[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x3652ee[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x3652ee[_0x71a3('0x46')],function(_0x105980){var _0x3bd4e9={};_0x3bd4e9[_0x105980]={'$like':'%'+_0x3d7fd5[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x3bd4e9;})});}_0x3652ee=_[_0x71a3('0xca')]({},_0x3652ee,_0x3d7fd5['options']);return _0x2ed354[_0x71a3('0xe5')](_0x3652ee);}})[_0x71a3('0x15')](function(_0x398bbd){if(_0x398bbd){_0x471ad9=_0x398bbd[_0x71a3('0x4b')];if(!_0x3d7fd5[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x3652ee[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x3d7fd5['query'][_0x71a3('0x25')]);_0x3652ee[_0x71a3('0x23')]=qs['offset'](_0x3d7fd5[_0x71a3('0x44')]['offset']);}return _0x2ed354['getFaxInteractions'](_0x3652ee);}})['then'](function(_0x42acf7){if(_0x42acf7){return _0x42acf7?{'count':_0x471ad9,'rows':_0x42acf7}:null;}})[_0x71a3('0x15')](respondWithResult(_0x3ef0d5,null))[_0x71a3('0x20')](handleError(_0x3ef0d5,null));};exports[_0x71a3('0xe7')]=function(_0x11c9d2,_0x211b97){var _0x2742db={};var _0x15d31a={};var _0x54e084;var _0x3e333d;return db['User'][_0x71a3('0x97')]({'where':{'id':_0x11c9d2[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x211b97,null))[_0x71a3('0x15')](function(_0xee6b67){if(_0xee6b67){_0x54e084=_0xee6b67;_0x15d31a['model']=_['keys'](db[_0x71a3('0xe8')][_0x71a3('0x3d')]);_0x15d31a[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x11c9d2[_0x71a3('0x44')]);_0x15d31a['filters']=_[_0x71a3('0x57')](_0x15d31a['model'],_0x15d31a[_0x71a3('0x44')]);_0x2742db[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x15d31a[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x11c9d2[_0x71a3('0x44')][_0x71a3('0x58')]));_0x2742db['attributes']=_0x2742db[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x2742db['attributes']:_0x15d31a[_0x71a3('0x53')];_0x2742db['order']=qs['sort'](_0x11c9d2[_0x71a3('0x44')]['sort']);_0x2742db['where']=qs['filters'](_[_0x71a3('0xd6')](_0x11c9d2[_0x71a3('0x44')],_0x15d31a[_0x71a3('0x56')]));if(_0x11c9d2[_0x71a3('0x44')][_0x71a3('0x33')]){_0x2742db[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x2742db[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x2742db['attributes'],function(_0x60eba5){var _0x17a2ba={};_0x17a2ba[_0x60eba5]={'$like':'%'+_0x11c9d2[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x17a2ba;})});}_0x2742db=_[_0x71a3('0xca')]({},_0x2742db,_0x11c9d2[_0x71a3('0x59')]);return _0x54e084[_0x71a3('0xe7')](_0x2742db);}})[_0x71a3('0x15')](function(_0x33e0f0){if(_0x33e0f0){_0x3e333d=_0x33e0f0[_0x71a3('0x4b')];if(!_0x11c9d2[_0x71a3('0x44')]['hasOwnProperty'](_0x71a3('0xd2'))){_0x2742db[_0x71a3('0x25')]=qs['limit'](_0x11c9d2[_0x71a3('0x44')]['limit']);_0x2742db['offset']=qs['offset'](_0x11c9d2[_0x71a3('0x44')][_0x71a3('0x23')]);}return _0x54e084[_0x71a3('0xe7')](_0x2742db);}})[_0x71a3('0x15')](function(_0x211642){if(_0x211642){return _0x211642?{'count':_0x3e333d,'rows':_0x211642}:null;}})['then'](respondWithResult(_0x211b97,null))['catch'](handleError(_0x211b97,null));};exports[_0x71a3('0xe9')]=function(_0x4c6292,_0x2df6eb,_0xd0f0ae){var _0x47ed82;var _0x2ab297;var _0x47627b;var _0x5e62dd=!_[_0x71a3('0x68')](_0x4c6292[_0x71a3('0x5f')]['id'])?_0x4c6292['params']['id']:!_[_0x71a3('0x68')](_0x4c6292[_0x71a3('0x2f')]['id'])?_0x4c6292[_0x71a3('0x2f')]['id']:null;return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x5e62dd,'role':{'$or':[_0x71a3('0x2d'),_0x71a3('0x2f'),'agent']}},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0xea'),_0x71a3('0xeb'),_0x71a3('0x2c'),_0x71a3('0x67'),'loginInPause']})[_0x71a3('0x15')](function(_0x29b974){if(_0x29b974){if(_0x29b974[_0x71a3('0x2c')]===_0x71a3('0x71')){_0x47ed82=_0x29b974;if(_0x4c6292[_0x71a3('0x5c')][_0x71a3('0x9f')]){_0x47627b=util['format'](_0x71a3('0xec'),_0x47ed82[_0x4c6292['body'][_0x71a3('0x9f')]]);}else if(_0x4c6292['body']['intrf']){_0x47627b=util[_0x71a3('0xaa')]('SIP/%s',_0x4c6292[_0x71a3('0x5c')][_0x71a3('0xed')]);}else{_0x47627b=util[_0x71a3('0xaa')](_0x71a3('0xab'),_0x47ed82[_0x71a3('0x3b')]);}socket['to'](util[_0x71a3('0xaa')](_0x71a3('0xee'),_0x47ed82[_0x71a3('0x3b')]))[_0x71a3('0xa5')](_0x71a3('0xef'),{'user':{'id':_0x47ed82['id'],'name':_0x47ed82['name']},'ip':_0x4c6292[_0x71a3('0xf0')]['x-forwarded-for']||_0x4c6292['connection'][_0x71a3('0xf1')]||_0x4c6292['socket'][_0x71a3('0xf1')]||_0x4c6292['connection']['socket'][_0x71a3('0xf1')]});return db[_0x71a3('0xac')][_0x71a3('0x2a')]({'where':{'membername':_0x47ed82['name']},'individualHooks':!![]});}}else{throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0xf2'));}})['then'](function(){if(_0x47ed82){return _0x47ed82[_0x71a3('0xf3')]({'raw':!![]});}})[_0x71a3('0x15')](function(_0x1b51b6){if(_0x47ed82){var _0x346e9d=[];if(_0x1b51b6){_0x2ab297=_0x1b51b6;if(_0x2ab297['length']){for(var _0x3cf06a=0x0;_0x3cf06a<_0x2ab297['length'];_0x3cf06a++){_0x346e9d[_0x71a3('0x47')]({'membername':_0x47ed82[_0x71a3('0x3b')],'UserId':_0x47ed82['id'],'queue_name':_0x2ab297[_0x3cf06a][_0x71a3('0x3b')],'VoiceQueueId':_0x2ab297[_0x3cf06a]['id'],'interface':_0x47627b,'paused':_0x47ed82[_0x71a3('0xf4')]||![],'penalty':_0x2ab297[_0x3cf06a][_0x71a3('0xf5')]||0x0});}return BPromise['each'](_0x346e9d,function(_0x4a1bcb){return db[_0x71a3('0xac')][_0x71a3('0xad')](_0x4a1bcb);});}}}})[_0x71a3('0x15')](function(){if(_0x47ed82){return db['MemberReport'][_0x71a3('0x8b')]({'where':{'membername':_0x47ed82[_0x71a3('0x3b')],'exitAt':null}});}})[_0x71a3('0x15')](function(_0x4e07f5){if(_0x47ed82){var _0x4ba7ab=[];_0x4e07f5['forEach'](function(_0x2eb510){_0x4ba7ab['push'](_0x2eb510[_0x71a3('0x29')]({'exitAt':moment()[_0x71a3('0xaa')](_0x71a3('0xf6'))}));});return BPromise['all'](_0x4ba7ab);}})[_0x71a3('0x15')](function(){if(_0x47ed82){var _0x1f5d32=[];var _0x103964=[];var _0x30ac44=utils[_0x71a3('0xf7')]();var _0x2fbf08={'membername':_0x47ed82[_0x71a3('0x3b')],'interface':_0x47627b,'enterAt':moment()[_0x71a3('0xaa')](_0x71a3('0xf6')),'role':_0x47ed82['role'],'internal':_0x47ed82['internal']};_0x30ac44[_0x71a3('0xf8')](function(_0x26c169){_0x1f5d32[_0x71a3('0x47')](_[_0x71a3('0xca')]({'channel':_0x26c169,'type':_0x71a3('0xf9'),'data1':_0x4c6292[_0x71a3('0x5c')][_0x71a3('0xfa')],'data2':_0x47627b},_0x2fbf08));if(_0x47ed82['loginInPause']){_0x103964[_0x71a3('0x47')](_[_0x71a3('0xca')]({'channel':_0x26c169,'type':'PAUSE','data1':_0x71a3('0xfb')},_0x2fbf08));}});return db[_0x71a3('0xfc')][_0x71a3('0xfd')](_0x1f5d32['concat'](_0x103964),{'individualHooks':!![]});}})[_0x71a3('0x15')](function(){if(_0x47ed82){return _0x47ed82['update']({'online':!![],'lastLoginAt':moment()[_0x71a3('0xaa')](_0x71a3('0xf6')),'voicePause':_0x47ed82['loginInPause']||![],'mailPause':_0x47ed82[_0x71a3('0xf4')]||![],'chatPause':_0x47ed82[_0x71a3('0xf4')]||![],'faxPause':_0x47ed82['loginInPause']||![],'smsPause':_0x47ed82[_0x71a3('0xf4')]||![],'openchannelPause':_0x47ed82['loginInPause']||![],'whatsappPause':_0x47ed82[_0x71a3('0xf4')]||![],'pauseType':_0x47ed82[_0x71a3('0xf4')]?_0x71a3('0xfb'):null,'interface':_0x47627b,'lastPauseAt':moment()[_0x71a3('0xaa')](_0x71a3('0xf6'))});}})[_0x71a3('0x15')](function(_0x38512f){if(_0x4c6292[_0x71a3('0xfe')]){return _0xd0f0ae();}else{return BPromise['resolve'](_0x38512f)[_0x71a3('0x15')](respondWithResult(_0x2df6eb,null));}})['catch'](handleError(_0x2df6eb,null));};exports[_0x71a3('0xff')]=function(_0x174e74,_0x1359a7){var _0xf6f07c;return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x174e74['params']['id'],'role':_0x71a3('0x71')},'attributes':['id',_0x71a3('0x3b'),'role']})[_0x71a3('0x15')](handleEntityNotFound(_0x1359a7,null))[_0x71a3('0x15')](function(_0x75c2c0){if(_0x75c2c0){_0xf6f07c=_0x75c2c0;return db[_0x71a3('0xac')][_0x71a3('0x2a')]({'where':{'membername':_0xf6f07c[_0x71a3('0x3b')]},'individualHooks':!![]});}})[_0x71a3('0x15')](function(){return db[_0x71a3('0xfc')]['findAll']({'where':{'membername':_0xf6f07c['name'],'exitAt':null}});})[_0x71a3('0x15')](function(_0x2f1226){var _0x43dcf2=[];_0x2f1226[_0x71a3('0xf8')](function(_0x507e79){_0x43dcf2['push'](_0x507e79['update']({'exitAt':moment()['format'](_0x71a3('0xf6'))}));});return BPromise[_0x71a3('0x5b')](_0x43dcf2);})[_0x71a3('0x15')](function(){return _0xf6f07c[_0x71a3('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x71a3('0x15')](respondWithResult(_0x1359a7,null))[_0x71a3('0x20')](handleError(_0x1359a7,null));};exports[_0x71a3('0x100')]=function(_0x188896,_0x38ab54){var _0x2c4125;return db[_0x71a3('0xac')][_0x71a3('0x29')]({'paused':0x1},{'where':{'UserId':_0x188896[_0x71a3('0x5f')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x188896[_0x71a3('0x5f')]['id'],'role':_0x71a3('0x71')},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c'),_0x71a3('0x67'),_0x71a3('0x9f')]});})['then'](handleEntityNotFound(_0x38ab54,null))[_0x71a3('0x15')](function(_0x2b6c6e){if(_0x2b6c6e){_0x2c4125=_0x2b6c6e;return respondWithRpcPromise('QueuePause','pause',{'id':_0x2c4125['id'],'name':_0x2c4125['name'],'pause':!![]});}})[_0x71a3('0x15')](function(){if(_0x2c4125){return db[_0x71a3('0xfc')][_0x71a3('0x8b')]({'where':{'membername':_0x2c4125[_0x71a3('0x3b')],'type':_0x71a3('0x101'),'exitAt':null}});}})[_0x71a3('0x15')](function(_0x272700){if(_0x272700[_0x71a3('0x4b')]){var _0x41ae5b=moment()[_0x71a3('0xaa')](_0x71a3('0xf6'));for(var _0x317d0d=0x0,_0x49feed=_0x272700[_0x71a3('0x4b')];_0x317d0d<_0x49feed;_0x317d0d++){_0x272700[_0x317d0d]['updateAttributes']({'exitAt':_0x41ae5b});}}})[_0x71a3('0x15')](function(){var _0x5ed1f3=[];var _0x27f8c9=utils[_0x71a3('0xf7')]();_0x27f8c9['forEach'](function(_0x1cef35){_0x5ed1f3[_0x71a3('0x47')]({'channel':_0x1cef35,'membername':_0x2c4125[_0x71a3('0x3b')],'interface':_[_0x71a3('0x68')](_0x2c4125['interface'])?util[_0x71a3('0xaa')](_0x71a3('0xab'),_0x2c4125['name']):_0x2c4125[_0x71a3('0x9f')],'type':'PAUSE','enterAt':moment()[_0x71a3('0xaa')](_0x71a3('0xf6')),'data1':_0x188896[_0x71a3('0x5c')]['type']||_0x71a3('0x102'),'role':_0x2c4125[_0x71a3('0x2c')],'internal':_0x2c4125['internal']});});return db[_0x71a3('0xfc')][_0x71a3('0xfd')](_0x5ed1f3,{'individualHooks':!![]});})[_0x71a3('0x15')](function(){return _0x2c4125[_0x71a3('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x188896[_0x71a3('0x5c')][_0x71a3('0x3f')]||_0x71a3('0x102'),'lastPauseAt':moment()[_0x71a3('0xaa')](_0x71a3('0xf6'))});})['then'](respondWithResult(_0x38ab54,null))['catch'](handleError(_0x38ab54,null));};exports[_0x71a3('0x103')]=function(_0x4d7a0e,_0x5c470c){var _0x244bb8;return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x4d7a0e[_0x71a3('0x5f')]['id']},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c'),_0x71a3('0x9e'),_0x71a3('0x104'),_0x71a3('0x105'),_0x71a3('0x106'),_0x71a3('0x107'),'smsPause',_0x71a3('0x108'),_0x71a3('0x109'),_0x71a3('0x10a')]})['then'](handleEntityNotFound(_0x5c470c,null))[_0x71a3('0x15')](function(_0x331ece){if(_0x331ece){_0x244bb8=_0x331ece;if(_0x4d7a0e[_0x71a3('0x5c')]['channel']&&!utils[_0x71a3('0xa0')](_0x4d7a0e[_0x71a3('0x5c')][_0x71a3('0xaf')])){throw new db['Sequelize'][(_0x71a3('0x94'))](_0x71a3('0xa1'));}switch(_0x4d7a0e[_0x71a3('0x5c')][_0x71a3('0xaf')]){case _0x71a3('0xa9'):return respondWithRpcPromise('QueuePause',_0x71a3('0x103'),{'id':_0x244bb8['id'],'name':_0x244bb8[_0x71a3('0x3b')],'pause':![]})[_0x71a3('0x15')](function(){return db[_0x71a3('0xac')][_0x71a3('0x29')]({'paused':0x0},{'where':{'UserId':_0x244bb8['id']},'individualHooks':!![]});})['then'](function(){return db[_0x71a3('0xfc')][_0x71a3('0x38')]({'where':{'channel':_0x4d7a0e[_0x71a3('0x5c')][_0x71a3('0xaf')],'membername':_0x244bb8[_0x71a3('0x3b')],'type':_0x71a3('0x101'),'exitAt':null}});})[_0x71a3('0x15')](function(_0x1caed1){if(_0x1caed1){return _0x1caed1['update']({'exitAt':moment()['format'](_0x71a3('0xf6')),'data2':_0x71a3('0x10b')},{'individualHooks':!![]});}return null;})[_0x71a3('0x15')](function(){return _0x244bb8[_0x71a3('0x29')]({'voicePause':![]});});case _0x71a3('0x50'):case'chat':case'fax':case'sms':case _0x71a3('0x51'):case _0x71a3('0x5a'):return db[_0x71a3('0xfc')]['find']({'where':{'channel':_0x4d7a0e[_0x71a3('0x5c')]['channel'],'membername':_0x244bb8[_0x71a3('0x3b')],'type':_0x71a3('0x101'),'exitAt':null}})[_0x71a3('0x15')](function(_0x52bda2){if(_0x52bda2){return _0x52bda2[_0x71a3('0x29')]({'exitAt':moment()['format'](_0x71a3('0xf6')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x838522={};_[_0x71a3('0x27')](_0x838522,util[_0x71a3('0xaa')]('%s%s',_0x4d7a0e[_0x71a3('0x5c')]['channel'],_0x71a3('0x10c')),![]);return _0x244bb8['update'](_0x838522);});default:return respondWithRpcPromise('QueuePause',_0x71a3('0x103'),{'id':_0x244bb8['id'],'name':_0x244bb8[_0x71a3('0x3b')],'pause':![]})['then'](function(){return db[_0x71a3('0xac')][_0x71a3('0x29')]({'paused':0x0},{'where':{'UserId':_0x244bb8['id']}});})[_0x71a3('0x15')](function(){return db['MemberReport'][_0x71a3('0x8b')]({'where':{'membername':_0x244bb8[_0x71a3('0x3b')],'type':_0x71a3('0x101'),'exitAt':null}});})['then'](function(_0x1fe175){var _0xd18c6f=[];_0x1fe175[_0x71a3('0xf8')](function(_0x269373){_0xd18c6f[_0x71a3('0x47')](_0x269373['update']({'exitAt':moment()['format'](_0x71a3('0xf6')),'data2':_0x71a3('0x10b')}));});return BPromise[_0x71a3('0x5b')](_0xd18c6f);})[_0x71a3('0x15')](function(){return _0x244bb8[_0x71a3('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x71a3('0x15')](respondWithResult(_0x5c470c,null))['catch'](handleError(_0x5c470c,null));};exports[_0x71a3('0x10d')]=function(_0xb9490e,_0x5a53dc){var _0x2a1d51={};var _0x523110={};var _0x2d9105;var _0x57c06a;return db['User'][_0x71a3('0x97')]({'where':{'id':_0xb9490e['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x5a53dc,null))['then'](function(_0x55712c){if(_0x55712c){_0x2d9105=_0x55712c;_0x523110['model']=_[_0x71a3('0x54')](db[_0x71a3('0x10e')]['rawAttributes']);_0x523110[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0xb9490e['query']);_0x523110['filters']=_[_0x71a3('0x57')](_0x523110[_0x71a3('0x53')],_0x523110[_0x71a3('0x44')]);_0x2a1d51[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x523110[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0xb9490e[_0x71a3('0x44')]['fields']));_0x2a1d51['attributes']=_0x2a1d51[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x2a1d51[_0x71a3('0x46')]:_0x523110[_0x71a3('0x53')];_0x2a1d51[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0xb9490e['query'][_0x71a3('0xd5')]);_0x2a1d51[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0xb9490e['query'],_0x523110[_0x71a3('0x56')]));if(_0xb9490e[_0x71a3('0x44')][_0x71a3('0x33')]){_0x2a1d51['where']=_[_0x71a3('0xca')](_0x2a1d51[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x2a1d51['attributes'],function(_0x54dd25){var _0x34328b={};_0x34328b[_0x54dd25]={'$like':'%'+_0xb9490e[_0x71a3('0x44')]['filter']+'%'};return _0x34328b;})});}_0x2a1d51=_['merge']({},_0x2a1d51,_0xb9490e[_0x71a3('0x59')]);return _0x2d9105[_0x71a3('0x10d')](_0x2a1d51);}})[_0x71a3('0x15')](function(_0x5c8b63){if(_0x5c8b63){_0x57c06a=_0x5c8b63[_0x71a3('0x4b')];if(!_0xb9490e[_0x71a3('0x44')][_0x71a3('0xd1')]('nolimit')){_0x2a1d51['limit']=qs['limit'](_0xb9490e[_0x71a3('0x44')]['limit']);_0x2a1d51['offset']=qs[_0x71a3('0x23')](_0xb9490e['query'][_0x71a3('0x23')]);}return _0x2d9105[_0x71a3('0x10d')](_0x2a1d51);}})[_0x71a3('0x15')](function(_0xccbfe2){if(_0xccbfe2){return _0xccbfe2?{'count':_0x57c06a,'rows':_0xccbfe2}:null;}})[_0x71a3('0x15')](respondWithResult(_0x5a53dc,null))[_0x71a3('0x20')](handleError(_0x5a53dc,null));};exports[_0x71a3('0x10f')]=function(_0xf00626,_0x2e9bd9){return db[_0x71a3('0x43')]['find']({'where':{'id':_0xf00626[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x2e9bd9,null))[_0x71a3('0x15')](function(_0x250afe){if(_0x250afe){var _0x17d4bf=_0x250afe[_0x71a3('0x2b')]({'plain':!![]});return _0x250afe[_0x71a3('0x10f')](_0xf00626[_0x71a3('0x5c')][_0x71a3('0x60')],_[_0x71a3('0x61')](_0xf00626[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{})[_0x71a3('0x15')](function(){for(var _0x28d565=0x0;_0x28d565<_0xf00626[_0x71a3('0x5c')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x28d565++){var _0x4e0bb7=[];var _0x2e178d={};db[_0x71a3('0x10e')][_0x71a3('0x97')]({'where':{'id':_0xf00626[_0x71a3('0x5c')][_0x71a3('0x60')][_0x28d565]}})['then'](function(_0x29faa5){_0x2e178d=_0x29faa5[_0x71a3('0x4d')];_0x4e0bb7[_0x71a3('0x47')](_0x29faa5['getVoiceQueues']()[_0x71a3('0x15')](function(_0x192b9c){for(var _0xa221fa=0x0;_0xa221fa<_0x192b9c[_0x71a3('0x4b')];_0xa221fa++){_0x192b9c[_0xa221fa][_0x71a3('0x110')](_0x71a3('0xaf'),_0x71a3('0x111'));}return _0x192b9c;}));_0x4e0bb7[_0x71a3('0x47')](_0x29faa5[_0x71a3('0x112')]()[_0x71a3('0x15')](function(_0x14cd5f){for(var _0x14c932=0x0;_0x14c932<_0x14cd5f[_0x71a3('0x4b')];_0x14c932++){_0x14cd5f[_0x14c932][_0x71a3('0x110')](_0x71a3('0xaf'),_0x71a3('0x113'));}return _0x14cd5f;}));_0x4e0bb7[_0x71a3('0x47')](_0x29faa5[_0x71a3('0x114')]()[_0x71a3('0x15')](function(_0x57c488){for(var _0x8128eb=0x0;_0x8128eb<_0x57c488[_0x71a3('0x4b')];_0x8128eb++){_0x57c488[_0x8128eb]['setDataValue'](_0x71a3('0xaf'),_0x71a3('0x115'));}return _0x57c488;}));_0x4e0bb7[_0x71a3('0x47')](_0x29faa5['getSmsQueues']()[_0x71a3('0x15')](function(_0x259db0){for(var _0x34eab5=0x0;_0x34eab5<_0x259db0[_0x71a3('0x4b')];_0x34eab5++){_0x259db0[_0x34eab5]['setDataValue'](_0x71a3('0xaf'),_0x71a3('0x116'));}return _0x259db0;}));_0x4e0bb7[_0x71a3('0x47')](_0x29faa5[_0x71a3('0x117')]()['then'](function(_0x4be076){for(var _0x3f50af=0x0;_0x3f50af<_0x4be076['length'];_0x3f50af++){_0x4be076[_0x3f50af][_0x71a3('0x110')]('channel',_0x71a3('0x118'));}return _0x4be076;}));_0x4e0bb7['push'](_0x29faa5[_0x71a3('0x119')]()[_0x71a3('0x15')](function(_0x19d328){for(var _0x546bc5=0x0;_0x546bc5<_0x19d328[_0x71a3('0x4b')];_0x546bc5++){_0x19d328[_0x546bc5][_0x71a3('0x110')](_0x71a3('0xaf'),_0x71a3('0x11a'));}return _0x19d328;}));_0x4e0bb7[_0x71a3('0x47')](_0x29faa5[_0x71a3('0x11b')]()[_0x71a3('0x15')](function(_0xc7a158){for(var _0x5f362d=0x0;_0x5f362d<_0xc7a158[_0x71a3('0x4b')];_0x5f362d++){_0xc7a158[_0x5f362d][_0x71a3('0x110')]('channel',_0x71a3('0x11c'));}return _0xc7a158;}));return BPromise[_0x71a3('0x5b')](_0x4e0bb7);})[_0x71a3('0x15')](function(_0x106601){var _0x1e3ee5=_[_0x71a3('0x11d')](_0x106601);_0x4e0bb7=[];return db[_0x71a3('0x6a')][_0x71a3('0x11e')](function(_0x3ab7c8){for(var _0x1c5b82=0x0;_0x1c5b82<_0x1e3ee5[_0x71a3('0x4b')];_0x1c5b82++){_0x4e0bb7[_0x71a3('0x47')](_0x1e3ee5[_0x1c5b82]['addAgent'](_0x17d4bf['id']),{'transaction':_0x3ab7c8});}return BPromise['all'](_0x4e0bb7)[_0x71a3('0x15')](function(){if(_0x17d4bf['online']){return BPromise[_0x71a3('0x8a')](_[_0x71a3('0x33')](_0x1e3ee5,function(_0xcd4e1f){return _0xcd4e1f[_0x71a3('0x11f')]('channel')===_0x71a3('0x111');}),function(_0xc6d9ac){return db[_0x71a3('0xac')]['upsert']({'membername':_0x17d4bf[_0x71a3('0x3b')],'UserId':_0x17d4bf['id'],'queue_name':_0xc6d9ac[_0x71a3('0x3b')],'VoiceQueueId':_0xc6d9ac['id'],'interface':_[_0x71a3('0x68')](_0x17d4bf['interface'])?util[_0x71a3('0xaa')](_0x71a3('0xab'),_0x17d4bf[_0x71a3('0x3b')]):_0x17d4bf[_0x71a3('0x9f')],'paused':_0x17d4bf[_0x71a3('0x9e')]||![],'penalty':_0x17d4bf['penalty']},{'transaction':_0x3ab7c8});});}else{return;}})[_0x71a3('0x15')](function(){for(var _0x3c822e=0x0;_0x3c822e<_0x1e3ee5[_0x71a3('0x4b')];_0x3c822e++){var _0x347cb0=_0x1e3ee5[_0x3c822e][_0x71a3('0x11f')](_0x71a3('0xaf'));var _0x43a0b5=_0x347cb0+'QueueId';socket['emit'](_0x71a3('0x2f')+_0x347cb0+_0x71a3('0xa7'),{'UserId':_0x17d4bf['id'],['queueField']:_0x1e3ee5[_0x3c822e]['id']});}});});})['then'](function(){db['TeamVoicePrefix'][_0x71a3('0x97')]({'where':{'teamId':_0x2e178d['id']}})['then'](function(_0x54dea5){if(_0x54dea5){db[_0x71a3('0x120')][_0x71a3('0x80')]({'UserId':_0xf00626[_0x71a3('0x5f')]['id'],'VoicePrefixId':_0x54dea5[_0x71a3('0x121')]});}});});}});}})[_0x71a3('0x15')](respondWithStatusCode(_0x2e9bd9,null))['catch'](handleError(_0x2e9bd9,null));};exports['removeTeams']=function(_0x3a4206,_0x5807cc){return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x3a4206[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x5807cc,null))[_0x71a3('0x15')](function(_0x3c6e2a){if(_0x3c6e2a){var _0xd0d9bb=_0x3c6e2a['get']({'plain':!![]});var _0x2d39d5=_0x3a4206[_0x71a3('0x44')][_0x71a3('0x60')];return _0x3c6e2a[_0x71a3('0x122')](_0x2d39d5)[_0x71a3('0x15')](function(){for(var _0x2a8e45=0x0;_0x2a8e45<_0x2d39d5[_0x71a3('0x4b')];_0x2a8e45++){var _0x979fcf=[];var _0x599eae={};db['Team']['findOne']({'where':{'id':_0x2d39d5[_0x2a8e45]}})[_0x71a3('0x15')](function(_0x5ca1ae){_0x599eae=_0x5ca1ae[_0x71a3('0x4d')];_0x979fcf[_0x71a3('0x47')](_0x5ca1ae[_0x71a3('0xf3')]()[_0x71a3('0x15')](function(_0x34fbf9){for(var _0x5b8082=0x0;_0x5b8082<_0x34fbf9[_0x71a3('0x4b')];_0x5b8082++){_0x34fbf9[_0x5b8082][_0x71a3('0x110')](_0x71a3('0xaf'),_0x71a3('0x111'));}return _0x34fbf9;}));_0x979fcf[_0x71a3('0x47')](_0x5ca1ae[_0x71a3('0x112')]()['then'](function(_0x26636f){for(var _0x376d01=0x0;_0x376d01<_0x26636f['length'];_0x376d01++){_0x26636f[_0x376d01][_0x71a3('0x110')](_0x71a3('0xaf'),'Chat');}return _0x26636f;}));_0x979fcf[_0x71a3('0x47')](_0x5ca1ae[_0x71a3('0x114')]()['then'](function(_0x1fd42c){for(var _0x3899e7=0x0;_0x3899e7<_0x1fd42c[_0x71a3('0x4b')];_0x3899e7++){_0x1fd42c[_0x3899e7][_0x71a3('0x110')](_0x71a3('0xaf'),_0x71a3('0x115'));}return _0x1fd42c;}));_0x979fcf[_0x71a3('0x47')](_0x5ca1ae[_0x71a3('0x123')]()['then'](function(_0x1d1809){for(var _0x492179=0x0;_0x492179<_0x1d1809[_0x71a3('0x4b')];_0x492179++){_0x1d1809[_0x492179]['setDataValue'](_0x71a3('0xaf'),_0x71a3('0x116'));}return _0x1d1809;}));_0x979fcf[_0x71a3('0x47')](_0x5ca1ae[_0x71a3('0x117')]()[_0x71a3('0x15')](function(_0x2605e1){for(var _0x58b30d=0x0;_0x58b30d<_0x2605e1[_0x71a3('0x4b')];_0x58b30d++){_0x2605e1[_0x58b30d]['setDataValue'](_0x71a3('0xaf'),_0x71a3('0x118'));}return _0x2605e1;}));_0x979fcf['push'](_0x5ca1ae['getFaxQueues']()[_0x71a3('0x15')](function(_0x596a11){for(var _0x939d81=0x0;_0x939d81<_0x596a11[_0x71a3('0x4b')];_0x939d81++){_0x596a11[_0x939d81][_0x71a3('0x110')](_0x71a3('0xaf'),_0x71a3('0x11a'));}return _0x596a11;}));_0x979fcf[_0x71a3('0x47')](_0x5ca1ae[_0x71a3('0x11b')]()[_0x71a3('0x15')](function(_0x144ba3){for(var _0x11a455=0x0;_0x11a455<_0x144ba3[_0x71a3('0x4b')];_0x11a455++){_0x144ba3[_0x11a455][_0x71a3('0x110')](_0x71a3('0xaf'),_0x71a3('0x11c'));}return _0x144ba3;}));return BPromise['all'](_0x979fcf);})['then'](function(_0x188c5b){var _0x347d34=_[_0x71a3('0x11d')](_0x188c5b);_0x979fcf=[];return db[_0x71a3('0x6a')][_0x71a3('0x11e')](function(_0x5b9ac9){for(var _0x59a916=0x0;_0x59a916<_0x347d34[_0x71a3('0x4b')];_0x59a916++){_0x979fcf['push'](_0x347d34[_0x59a916]['removeAgent'](_0xd0d9bb['id']),{'transaction':_0x5b9ac9});}return BPromise[_0x71a3('0x5b')](_0x979fcf)['then'](function(){if(_0xd0d9bb[_0x71a3('0x9d')]){return BPromise['each'](_['filter'](_0x347d34,function(_0x30ec8c){return _0x30ec8c[_0x71a3('0x11f')]('channel')==='Voice';}),function(_0x3373f3){return db['UserVoiceQueueRt'][_0x71a3('0x2a')]({'where':{'VoiceQueueId':_0x3373f3['id'],'UserId':_0xd0d9bb['id']},'transaction':_0x5b9ac9});});}else{return;}})[_0x71a3('0x15')](function(){db[_0x71a3('0x124')][_0x71a3('0x97')]({'where':{'teamId':_0x599eae['id']}})[_0x71a3('0x15')](function(_0x47084c){if(_0x47084c){return db[_0x71a3('0x120')]['destroy']({'where':{'UserId':_0xd0d9bb['id'],'VoicePrefixId':_0x47084c['dataValues'][_0x71a3('0x121')]}});}});})[_0x71a3('0x15')](function(){for(var _0x5d7371=0x0;_0x5d7371<_0x347d34['length'];_0x5d7371++){var _0xe40e89=_0x347d34[_0x5d7371][_0x71a3('0x11f')](_0x71a3('0xaf'));var _0x12a5fa=_0xe40e89+_0x71a3('0xb2');socket['emit'](_0x71a3('0x2f')+_0xe40e89+_0x71a3('0xb3'),{'UserId':_0xd0d9bb['id'],['queueField']:_0x347d34[_0x5d7371]['id']});}});});});}});}})[_0x71a3('0x15')](respondWithStatusCode(_0x5807cc,null))['catch'](handleError(_0x5807cc,null));};exports[_0x71a3('0x125')]=function(_0x2bc81f,_0x12e5af){var _0x167e64={};var _0x452d2e={};var _0x34a30e;var _0x3e2fd0;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x2bc81f[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x12e5af,null))[_0x71a3('0x15')](function(_0x4051ba){if(_0x4051ba){_0x34a30e=_0x4051ba;_0x452d2e[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0xcc')][_0x71a3('0x3d')]);_0x452d2e[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x2bc81f[_0x71a3('0x44')]);_0x452d2e['filters']=_[_0x71a3('0x57')](_0x452d2e[_0x71a3('0x53')],_0x452d2e[_0x71a3('0x44')]);_0x167e64[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x452d2e['model'],qs[_0x71a3('0x58')](_0x2bc81f[_0x71a3('0x44')][_0x71a3('0x58')]));_0x167e64['attributes']=_0x167e64[_0x71a3('0x46')]['length']?_0x167e64[_0x71a3('0x46')]:_0x452d2e[_0x71a3('0x53')];_0x167e64[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x2bc81f[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x167e64['where']=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x2bc81f[_0x71a3('0x44')],_0x452d2e[_0x71a3('0x56')]));if(_0x2bc81f[_0x71a3('0x44')][_0x71a3('0x33')]){_0x167e64['where']=_[_0x71a3('0xca')](_0x167e64[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x167e64[_0x71a3('0x46')],function(_0x34a017){var _0x545381={};_0x545381[_0x34a017]={'$like':'%'+_0x2bc81f[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x545381;})});}_0x167e64=_[_0x71a3('0xca')]({},_0x167e64,_0x2bc81f['options']);return _0x34a30e['getLists'](_0x167e64);}})[_0x71a3('0x15')](function(_0x2fa0f6){if(_0x2fa0f6){_0x3e2fd0=_0x2fa0f6[_0x71a3('0x4b')];if(!_0x2bc81f[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x167e64[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x2bc81f['query'][_0x71a3('0x25')]);_0x167e64[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x2bc81f['query'][_0x71a3('0x23')]);}return _0x34a30e[_0x71a3('0x125')](_0x167e64);}})[_0x71a3('0x15')](function(_0x4383a4){if(_0x4383a4){return _0x4383a4?{'count':_0x3e2fd0,'rows':_0x4383a4}:null;}})[_0x71a3('0x15')](respondWithResult(_0x12e5af,null))[_0x71a3('0x20')](handleError(_0x12e5af,null));};exports[_0x71a3('0x126')]=function(_0x10b400,_0x38908d){var _0x5ce100={};var _0x1e452a={};var _0x84fc5f;var _0x34fff0;return db[_0x71a3('0x43')]['findOne']({'where':{'id':_0x10b400[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x38908d,null))[_0x71a3('0x15')](function(_0x3e8019){if(_0x3e8019){_0x84fc5f=_0x3e8019;_0x1e452a['model']=_[_0x71a3('0x54')](db[_0x71a3('0x43')][_0x71a3('0x3d')]);_0x1e452a[_0x71a3('0x44')]=_['keys'](_0x10b400[_0x71a3('0x44')]);_0x1e452a[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x1e452a[_0x71a3('0x53')],_0x1e452a[_0x71a3('0x44')]);_0x5ce100[_0x71a3('0x46')]=_['intersection'](_0x1e452a[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x10b400[_0x71a3('0x44')][_0x71a3('0x58')]));_0x5ce100[_0x71a3('0x46')]=_0x5ce100[_0x71a3('0x46')]['length']?_0x5ce100[_0x71a3('0x46')]:_0x1e452a['model'];_0x5ce100['order']=qs[_0x71a3('0xd5')](_0x10b400[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x5ce100['where']=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x10b400['query'],_0x1e452a['filters']));if(_0x10b400[_0x71a3('0x44')]['filter']){_0x5ce100[_0x71a3('0x42')]=_['merge'](_0x5ce100['where'],{'$or':_[_0x71a3('0x35')](_0x5ce100[_0x71a3('0x46')],function(_0x36106e){var _0x2a886b={};_0x2a886b[_0x36106e]={'$like':'%'+_0x10b400[_0x71a3('0x44')]['filter']+'%'};return _0x2a886b;})});}_0x5ce100['model']=db[_0x71a3('0x43')];_0x5ce100['as']=_0x71a3('0x30');_0x5ce100=_[_0x71a3('0xca')]({},_0x5ce100,_0x10b400[_0x71a3('0x59')]);return _0x84fc5f[_0x71a3('0xf3')]({'include':[_0x5ce100]});}})[_0x71a3('0x15')](function(_0x3a8237){if(_0x3a8237){var _0x4374ca={},_0xbbf3d5=[],_0x383d32=0x0;for(var _0x2ac962=0x0;_0x2ac962<_0x3a8237[_0x71a3('0x4b')];_0x2ac962+=0x1){for(var _0x122437=0x0,_0x2b9a82;_0x122437<_0x3a8237[_0x2ac962][_0x71a3('0x30')]['length'];_0x122437+=0x1){_0x2b9a82=_0x3a8237[_0x2ac962]['Agents'][_0x122437][_0x71a3('0x2b')]({'plain':!![]});_0x4374ca[_0x2b9a82['id']]=_0x2b9a82;}}_0x4374ca=_[_0x71a3('0x127')](_0x4374ca);for(var _0xd68d6=qs[_0x71a3('0x23')](_0x10b400[_0x71a3('0x44')][_0x71a3('0x23')]);_0xd68d6<_0x4374ca[_0x71a3('0x4b')]&&_0xbbf3d5[_0x71a3('0x4b')]<qs[_0x71a3('0x25')](_0x10b400['query'][_0x71a3('0x25')]);_0xd68d6+=0x1){if(_0x4374ca[_0xd68d6]){_0xbbf3d5['push'](_0x4374ca[_0xd68d6]);}}return{'count':_0x4374ca[_0x71a3('0x4b')],'rows':_0xbbf3d5};}})[_0x71a3('0x15')](respondWithResult(_0x38908d,null))['catch'](handleError(_0x38908d,null));};exports[_0x71a3('0x2a')]=function(_0x41ed40,_0x4af0e7){if(_0x41ed40[_0x71a3('0x2f')]['id']==_0x41ed40[_0x71a3('0x5f')]['id']){return _0x4af0e7[_0x71a3('0x21')](0x1f4)[_0x71a3('0x128')]({'message':_0x71a3('0x129')});}return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x41ed40['params']['id']}})['then'](handleEntityNotFound(_0x4af0e7,null))['then'](removeEntity(_0x4af0e7,null))[_0x71a3('0x20')](handleError(_0x4af0e7,null));};exports['addChatInteractions']=function(_0x45340f,_0x18d38d){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x45340f[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x18d38d,null))['then'](function(_0x283c03){if(_0x283c03){return _0x283c03['addChatInteractions'](_0x45340f[_0x71a3('0x5c')]['ids'],_[_0x71a3('0x61')](_0x45340f[_0x71a3('0x5c')],['ids','id'])||{})[_0x71a3('0xa4')](function(){for(var _0x33e441=0x0;_0x33e441<_0x45340f['body'][_0x71a3('0x60')]['length'];_0x33e441+=0x1){socket[_0x71a3('0xa5')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x45340f['body'][_0x71a3('0x60')][_0x33e441]),'UserId':Number(_0x45340f[_0x71a3('0x5f')]['id'])});}return _0x45340f[_0x71a3('0x5c')][_0x71a3('0x60')];});}})[_0x71a3('0x15')](respondWithResult(_0x18d38d,null))[_0x71a3('0x20')](handleError(_0x18d38d,null));};exports[_0x71a3('0x12a')]=function(_0x36452e,_0x58f309){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x36452e[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x58f309,null))[_0x71a3('0x15')](function(_0x19b02e){if(_0x19b02e){return _0x19b02e[_0x71a3('0x12a')](_0x36452e['query'][_0x71a3('0x60')])[_0x71a3('0x15')](function(){if(_[_0x71a3('0x12b')](_0x36452e['query'][_0x71a3('0x60')])){for(var _0x11ea02=0x0;_0x11ea02<_0x36452e[_0x71a3('0x44')]['ids'][_0x71a3('0x4b')];_0x11ea02+=0x1){socket[_0x71a3('0xa5')](_0x71a3('0x12c'),{'ChatInteractionId':Number(_0x36452e['query'][_0x71a3('0x60')][_0x11ea02]),'UserId':Number(_0x36452e['params']['id'])});}}else{socket[_0x71a3('0xa5')](_0x71a3('0x12c'),{'ChatInteractionId':Number(_0x36452e[_0x71a3('0x44')][_0x71a3('0x60')]),'UserId':Number(_0x36452e[_0x71a3('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x58f309,null))['catch'](handleError(_0x58f309,null));};exports[_0x71a3('0x12d')]=function(_0x41974a,_0x3b0e01){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x41974a['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x3b0e01,null))['then'](function(_0x1e7dc3){if(_0x1e7dc3){return _0x1e7dc3[_0x71a3('0x12d')](_0x41974a[_0x71a3('0x5c')][_0x71a3('0x60')],_['omit'](_0x41974a[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{})[_0x71a3('0xa4')](function(){for(var _0x10afc3=0x0;_0x10afc3<_0x41974a[_0x71a3('0x5c')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x10afc3+=0x1){socket[_0x71a3('0xa5')](_0x71a3('0x12e'),{'MailInteractionId':Number(_0x41974a[_0x71a3('0x5c')][_0x71a3('0x60')][_0x10afc3]),'UserId':Number(_0x41974a[_0x71a3('0x5f')]['id'])});}return _0x41974a[_0x71a3('0x5c')][_0x71a3('0x60')];});}})['then'](respondWithResult(_0x3b0e01,null))[_0x71a3('0x20')](handleError(_0x3b0e01,null));};exports[_0x71a3('0x12f')]=function(_0x3c6094,_0x18426e){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x3c6094[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x18426e,null))[_0x71a3('0x15')](function(_0x478cb4){if(_0x478cb4){return _0x478cb4[_0x71a3('0x12f')](_0x3c6094['query'][_0x71a3('0x60')])[_0x71a3('0x15')](function(){if(_['isArray'](_0x3c6094['query'][_0x71a3('0x60')])){for(var _0x5b921c=0x0;_0x5b921c<_0x3c6094[_0x71a3('0x44')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x5b921c+=0x1){socket['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3c6094[_0x71a3('0x44')][_0x71a3('0x60')][_0x5b921c]),'UserId':Number(_0x3c6094[_0x71a3('0x5f')]['id'])});}}else{socket[_0x71a3('0xa5')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3c6094['query'][_0x71a3('0x60')]),'UserId':Number(_0x3c6094['params']['id'])});}});}})[_0x71a3('0x15')](respondWithStatusCode(_0x18426e,null))[_0x71a3('0x20')](handleError(_0x18426e,null));};exports[_0x71a3('0x130')]=function(_0x9f1ced,_0x33c115){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x9f1ced[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x33c115,null))['then'](function(_0x4014d6){if(_0x4014d6){return _0x4014d6[_0x71a3('0x130')](_0x9f1ced[_0x71a3('0x5c')][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x9f1ced[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{})[_0x71a3('0xa4')](function(){for(var _0x5b72e0=0x0;_0x5b72e0<_0x9f1ced['body'][_0x71a3('0x60')][_0x71a3('0x4b')];_0x5b72e0+=0x1){socket[_0x71a3('0xa5')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x9f1ced[_0x71a3('0x5c')][_0x71a3('0x60')][_0x5b72e0]),'UserId':Number(_0x9f1ced[_0x71a3('0x5f')]['id'])});}return _0x9f1ced[_0x71a3('0x5c')][_0x71a3('0x60')];});}})[_0x71a3('0x15')](respondWithResult(_0x33c115,null))[_0x71a3('0x20')](handleError(_0x33c115,null));};exports[_0x71a3('0x131')]=function(_0x35802f,_0x10ca70){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x35802f['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x10ca70,null))[_0x71a3('0x15')](function(_0x58e2c5){if(_0x58e2c5){return _0x58e2c5[_0x71a3('0x131')](_0x35802f['query'][_0x71a3('0x60')])[_0x71a3('0x15')](function(){if(_[_0x71a3('0x12b')](_0x35802f[_0x71a3('0x44')]['ids'])){for(var _0x3b7b8a=0x0;_0x3b7b8a<_0x35802f[_0x71a3('0x44')]['ids']['length'];_0x3b7b8a+=0x1){socket[_0x71a3('0xa5')](_0x71a3('0x132'),{'FaxInteractionId':Number(_0x35802f[_0x71a3('0x44')][_0x71a3('0x60')][_0x3b7b8a]),'UserId':Number(_0x35802f[_0x71a3('0x5f')]['id'])});}}else{socket['emit'](_0x71a3('0x132'),{'FaxInteractionId':Number(_0x35802f[_0x71a3('0x44')]['ids']),'UserId':Number(_0x35802f[_0x71a3('0x5f')]['id'])});}});}})[_0x71a3('0x15')](respondWithStatusCode(_0x10ca70,null))[_0x71a3('0x20')](handleError(_0x10ca70,null));};exports[_0x71a3('0x133')]=function(_0x4633f0,_0x188dad){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x4633f0['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x188dad,null))[_0x71a3('0x15')](function(_0x2915a1){if(_0x2915a1){return _0x2915a1['addSmsInteractions'](_0x4633f0[_0x71a3('0x5c')][_0x71a3('0x60')],_['omit'](_0x4633f0['body'],[_0x71a3('0x60'),'id'])||{})[_0x71a3('0xa4')](function(){for(var _0xb37d9b=0x0;_0xb37d9b<_0x4633f0['body'][_0x71a3('0x60')]['length'];_0xb37d9b+=0x1){socket[_0x71a3('0xa5')](_0x71a3('0x134'),{'SmsInteractionId':Number(_0x4633f0['body'][_0x71a3('0x60')][_0xb37d9b]),'UserId':Number(_0x4633f0[_0x71a3('0x5f')]['id'])});}return _0x4633f0['body'][_0x71a3('0x60')];});}})[_0x71a3('0x15')](respondWithResult(_0x188dad,null))[_0x71a3('0x20')](handleError(_0x188dad,null));};exports[_0x71a3('0x135')]=function(_0x1a3622,_0x520b5a){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x1a3622[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x520b5a,null))[_0x71a3('0x15')](function(_0x51ea20){if(_0x51ea20){return _0x51ea20[_0x71a3('0x135')](_0x1a3622[_0x71a3('0x44')]['ids'])[_0x71a3('0x15')](function(){if(_[_0x71a3('0x12b')](_0x1a3622[_0x71a3('0x44')][_0x71a3('0x60')])){for(var _0x47eea9=0x0;_0x47eea9<_0x1a3622[_0x71a3('0x44')]['ids'][_0x71a3('0x4b')];_0x47eea9+=0x1){socket[_0x71a3('0xa5')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1a3622[_0x71a3('0x44')]['ids'][_0x47eea9]),'UserId':Number(_0x1a3622[_0x71a3('0x5f')]['id'])});}}else{socket[_0x71a3('0xa5')](_0x71a3('0x136'),{'SmsInteractionId':Number(_0x1a3622[_0x71a3('0x44')]['ids']),'UserId':Number(_0x1a3622['params']['id'])});}});}})[_0x71a3('0x15')](respondWithStatusCode(_0x520b5a,null))[_0x71a3('0x20')](handleError(_0x520b5a,null));};exports[_0x71a3('0x137')]=function(_0x40e559,_0x154421){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x40e559['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x154421,null))[_0x71a3('0x15')](function(_0x194ff4){if(_0x194ff4){return _0x194ff4[_0x71a3('0x137')](_0x40e559[_0x71a3('0x5c')][_0x71a3('0x60')],_['omit'](_0x40e559[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{})[_0x71a3('0xa4')](function(){for(var _0x559615=0x0;_0x559615<_0x40e559[_0x71a3('0x5c')]['ids'][_0x71a3('0x4b')];_0x559615+=0x1){socket['emit']('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x40e559['body'][_0x71a3('0x60')][_0x559615]),'UserId':Number(_0x40e559[_0x71a3('0x5f')]['id'])});}return _0x40e559[_0x71a3('0x5c')][_0x71a3('0x60')];});}})['then'](respondWithResult(_0x154421,null))[_0x71a3('0x20')](handleError(_0x154421,null));};exports[_0x71a3('0x138')]=function(_0x334512,_0x9022cb){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x334512[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x9022cb,null))['then'](function(_0x147e22){if(_0x147e22){return _0x147e22[_0x71a3('0x138')](_0x334512[_0x71a3('0x44')][_0x71a3('0x60')])[_0x71a3('0x15')](function(){if(_[_0x71a3('0x12b')](_0x334512[_0x71a3('0x44')]['ids'])){for(var _0x2cddc1=0x0;_0x2cddc1<_0x334512['query'][_0x71a3('0x60')][_0x71a3('0x4b')];_0x2cddc1+=0x1){socket[_0x71a3('0xa5')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x334512[_0x71a3('0x44')]['ids'][_0x2cddc1]),'UserId':Number(_0x334512[_0x71a3('0x5f')]['id'])});}}else{socket[_0x71a3('0xa5')](_0x71a3('0x139'),{'OpenchannelInteractionId':Number(_0x334512['query'][_0x71a3('0x60')]),'UserId':Number(_0x334512[_0x71a3('0x5f')]['id'])});}});}})[_0x71a3('0x15')](respondWithStatusCode(_0x9022cb,null))[_0x71a3('0x20')](handleError(_0x9022cb,null));};exports[_0x71a3('0x13a')]=function(_0x58fa5d,_0x2d7c43){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x58fa5d[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x2d7c43,null))[_0x71a3('0x15')](function(_0x425c58){if(_0x425c58){return _0x425c58[_0x71a3('0x13a')](_0x58fa5d[_0x71a3('0x5c')]['ids'],_[_0x71a3('0x61')](_0x58fa5d['body'],['ids','id'])||{})['spread'](function(){for(var _0x25a199=0x0;_0x25a199<_0x58fa5d['body']['ids'][_0x71a3('0x4b')];_0x25a199+=0x1){socket[_0x71a3('0xa5')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x58fa5d['body'][_0x71a3('0x60')][_0x25a199]),'UserId':Number(_0x58fa5d[_0x71a3('0x5f')]['id'])});}return _0x58fa5d[_0x71a3('0x5c')][_0x71a3('0x60')];});}})[_0x71a3('0x15')](respondWithResult(_0x2d7c43,null))[_0x71a3('0x20')](handleError(_0x2d7c43,null));};exports[_0x71a3('0x13b')]=function(_0x2f6e14,_0x396b41){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x2f6e14['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x396b41,null))[_0x71a3('0x15')](function(_0x53f97e){if(_0x53f97e){return _0x53f97e[_0x71a3('0x13b')](_0x2f6e14[_0x71a3('0x44')][_0x71a3('0x60')]);}})[_0x71a3('0x15')](respondWithStatusCode(_0x396b41,null))[_0x71a3('0x20')](handleError(_0x396b41,null));};exports[_0x71a3('0x13c')]=function(_0x355f31,_0x153cd8){var _0x28fcfc={};var _0x1e7ba2={};var _0x54653e;var _0x5b5c40;return db['User'][_0x71a3('0x97')]({'where':{'id':_0x355f31['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x153cd8,null))[_0x71a3('0x15')](function(_0x46246c){if(_0x46246c){_0x54653e=_0x46246c;_0x1e7ba2[_0x71a3('0x53')]=_[_0x71a3('0x54')](db['VoicePrefix'][_0x71a3('0x3d')]);_0x1e7ba2[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x355f31[_0x71a3('0x44')]);_0x1e7ba2[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x1e7ba2[_0x71a3('0x53')],_0x1e7ba2[_0x71a3('0x44')]);_0x28fcfc['attributes']=_[_0x71a3('0x57')](_0x1e7ba2[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x355f31['query']['fields']));_0x28fcfc[_0x71a3('0x46')]=_0x28fcfc[_0x71a3('0x46')]['length']?_0x28fcfc['attributes']:_0x1e7ba2[_0x71a3('0x53')];_0x28fcfc[_0x71a3('0xc9')]=qs['sort'](_0x355f31[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x28fcfc['where']=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x355f31[_0x71a3('0x44')],_0x1e7ba2['filters']));if(_0x355f31[_0x71a3('0x44')]['filter']){_0x28fcfc['where']=_[_0x71a3('0xca')](_0x28fcfc['where'],{'$or':_[_0x71a3('0x35')](_0x28fcfc[_0x71a3('0x46')],function(_0x1e6bf1){var _0x43b4d7={};_0x43b4d7[_0x1e6bf1]={'$like':'%'+_0x355f31['query'][_0x71a3('0x33')]+'%'};return _0x43b4d7;})});}_0x28fcfc=_[_0x71a3('0xca')]({},_0x28fcfc,_0x355f31['options']);return _0x54653e['getVoicePrefixes'](_0x28fcfc);}})[_0x71a3('0x15')](function(_0x49052f){if(_0x49052f){_0x5b5c40=_0x49052f[_0x71a3('0x4b')];if(!_0x355f31['query'][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x28fcfc[_0x71a3('0x25')]=qs['limit'](_0x355f31[_0x71a3('0x44')]['limit']);_0x28fcfc[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x355f31[_0x71a3('0x44')][_0x71a3('0x23')]);}return _0x54653e[_0x71a3('0x13c')](_0x28fcfc);}})[_0x71a3('0x15')](function(_0x2c8dea){if(_0x2c8dea){return _0x2c8dea?{'count':_0x5b5c40,'rows':_0x2c8dea}:null;}})[_0x71a3('0x15')](respondWithResult(_0x153cd8,null))[_0x71a3('0x20')](handleError(_0x153cd8,null));};exports[_0x71a3('0x13d')]=function(_0x400299,_0x3be555){var _0x524cd8={};var _0x5ac976={};var _0x3d69b3;var _0xac8635;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x400299[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x3be555,null))[_0x71a3('0x15')](function(_0x18ae60){if(_0x18ae60){_0x3d69b3=_0x18ae60;_0x5ac976['model']=_['keys'](db[_0x71a3('0x13e')]['rawAttributes']);_0x5ac976[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x400299[_0x71a3('0x44')]);_0x5ac976[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x5ac976[_0x71a3('0x53')],_0x5ac976[_0x71a3('0x44')]);_0x524cd8[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x5ac976['model'],qs[_0x71a3('0x58')](_0x400299[_0x71a3('0x44')][_0x71a3('0x58')]));_0x524cd8[_0x71a3('0x46')]=_0x524cd8[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x524cd8['attributes']:_0x5ac976[_0x71a3('0x53')];_0x524cd8['order']=qs[_0x71a3('0xd5')](_0x400299[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x524cd8[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x400299[_0x71a3('0x44')],_0x5ac976[_0x71a3('0x56')]));if(_0x400299['query'][_0x71a3('0x33')]){_0x524cd8[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x524cd8['where'],{'$or':_[_0x71a3('0x35')](_0x524cd8[_0x71a3('0x46')],function(_0xd2bd41){var _0x531aa0={};_0x531aa0[_0xd2bd41]={'$like':'%'+_0x400299[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x531aa0;})});}_0x524cd8=_[_0x71a3('0xca')]({},_0x524cd8,_0x400299[_0x71a3('0x59')]);return _0x3d69b3['getFaxAccounts'](_0x524cd8);}})[_0x71a3('0x15')](function(_0x5b4d6f){if(_0x5b4d6f){_0xac8635=_0x5b4d6f[_0x71a3('0x4b')];if(!_0x400299[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x524cd8[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x400299['query']['limit']);_0x524cd8[_0x71a3('0x23')]=qs['offset'](_0x400299['query'][_0x71a3('0x23')]);}return _0x3d69b3['getFaxAccounts'](_0x524cd8);}})['then'](function(_0x3e2e68){if(_0x3e2e68){return _0x3e2e68?{'count':_0xac8635,'rows':_0x3e2e68}:null;}})[_0x71a3('0x15')](respondWithResult(_0x3be555,null))[_0x71a3('0x20')](handleError(_0x3be555,null));};exports[_0x71a3('0x13f')]=function(_0x1428ae,_0x26676c){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x1428ae[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x26676c,null))[_0x71a3('0x15')](function(_0x1f2bc7){if(_0x1f2bc7){return _0x1f2bc7['addFaxAccounts'](_0x1428ae[_0x71a3('0x5c')]['ids'],_[_0x71a3('0x61')](_0x1428ae[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0x26676c,null))['catch'](handleError(_0x26676c,null));};exports['removeFaxAccounts']=function(_0x5420be,_0x19c90e){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x5420be[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x19c90e,null))[_0x71a3('0x15')](function(_0x3ea188){if(_0x3ea188){return _0x3ea188['removeFaxAccounts'](_0x5420be[_0x71a3('0x44')][_0x71a3('0x60')]);}})[_0x71a3('0x15')](respondWithStatusCode(_0x19c90e,null))[_0x71a3('0x20')](handleError(_0x19c90e,null));};exports[_0x71a3('0x140')]=function(_0x811ecc,_0x17d551){var _0x834295={};var _0x2d1880={};var _0x398b9e;var _0x223382;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x811ecc[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x17d551,null))[_0x71a3('0x15')](function(_0x2425ac){if(_0x2425ac){_0x398b9e=_0x2425ac;_0x2d1880[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0x141')][_0x71a3('0x3d')]);_0x2d1880[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x811ecc['query']);_0x2d1880[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x2d1880['model'],_0x2d1880[_0x71a3('0x44')]);_0x834295[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x2d1880['model'],qs['fields'](_0x811ecc[_0x71a3('0x44')][_0x71a3('0x58')]));_0x834295['attributes']=_0x834295[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x834295[_0x71a3('0x46')]:_0x2d1880['model'];_0x834295[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x811ecc[_0x71a3('0x44')]['sort']);_0x834295[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_['pick'](_0x811ecc['query'],_0x2d1880[_0x71a3('0x56')]));if(_0x811ecc[_0x71a3('0x44')][_0x71a3('0x33')]){_0x834295['where']=_[_0x71a3('0xca')](_0x834295[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x834295[_0x71a3('0x46')],function(_0x41976a){var _0x4aaa48={};_0x4aaa48[_0x41976a]={'$like':'%'+_0x811ecc[_0x71a3('0x44')]['filter']+'%'};return _0x4aaa48;})});}_0x834295=_['merge']({},_0x834295,_0x811ecc[_0x71a3('0x59')]);return _0x398b9e[_0x71a3('0x140')](_0x834295);}})[_0x71a3('0x15')](function(_0x2ba919){if(_0x2ba919){_0x223382=_0x2ba919[_0x71a3('0x4b')];if(!_0x811ecc['query'][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x834295['limit']=qs['limit'](_0x811ecc[_0x71a3('0x44')][_0x71a3('0x25')]);_0x834295[_0x71a3('0x23')]=qs['offset'](_0x811ecc[_0x71a3('0x44')]['offset']);}return _0x398b9e[_0x71a3('0x140')](_0x834295);}})[_0x71a3('0x15')](function(_0x43e1b2){if(_0x43e1b2){return _0x43e1b2?{'count':_0x223382,'rows':_0x43e1b2}:null;}})['then'](respondWithResult(_0x17d551,null))[_0x71a3('0x20')](handleError(_0x17d551,null));};exports[_0x71a3('0x142')]=function(_0x590a7c,_0xbf61e){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x590a7c['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0xbf61e,null))[_0x71a3('0x15')](function(_0x456ade){if(_0x456ade){return _0x456ade[_0x71a3('0x142')](_0x590a7c['body'][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x590a7c[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0xbf61e,null))['catch'](handleError(_0xbf61e,null));};exports[_0x71a3('0x143')]=function(_0x19692f,_0x1ff703){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x19692f[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1ff703,null))['then'](function(_0x364fba){if(_0x364fba){return _0x364fba['removeMailAccounts'](_0x19692f[_0x71a3('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x1ff703,null))[_0x71a3('0x20')](handleError(_0x1ff703,null));};exports[_0x71a3('0x144')]=function(_0x4b2866,_0x36cfc4){var _0x113197={};var _0x1ba638={};var _0x230826;var _0x4bc8a1;return db['User']['findOne']({'where':{'id':_0x4b2866['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x36cfc4,null))[_0x71a3('0x15')](function(_0x36da08){if(_0x36da08){_0x230826=_0x36da08;_0x1ba638['model']=_[_0x71a3('0x54')](db['OpenchannelAccount']['rawAttributes']);_0x1ba638[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x4b2866[_0x71a3('0x44')]);_0x1ba638[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x1ba638[_0x71a3('0x53')],_0x1ba638[_0x71a3('0x44')]);_0x113197[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x1ba638[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x4b2866[_0x71a3('0x44')]['fields']));_0x113197[_0x71a3('0x46')]=_0x113197[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x113197[_0x71a3('0x46')]:_0x1ba638[_0x71a3('0x53')];_0x113197[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x4b2866[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x113197['where']=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x4b2866['query'],_0x1ba638[_0x71a3('0x56')]));if(_0x4b2866[_0x71a3('0x44')][_0x71a3('0x33')]){_0x113197[_0x71a3('0x42')]=_['merge'](_0x113197[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x113197[_0x71a3('0x46')],function(_0x54e59d){var _0x35dd04={};_0x35dd04[_0x54e59d]={'$like':'%'+_0x4b2866[_0x71a3('0x44')]['filter']+'%'};return _0x35dd04;})});}_0x113197=_[_0x71a3('0xca')]({},_0x113197,_0x4b2866[_0x71a3('0x59')]);return _0x230826[_0x71a3('0x144')](_0x113197);}})[_0x71a3('0x15')](function(_0x1534ba){if(_0x1534ba){_0x4bc8a1=_0x1534ba['length'];if(!_0x4b2866[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x113197[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x4b2866['query'][_0x71a3('0x25')]);_0x113197['offset']=qs[_0x71a3('0x23')](_0x4b2866['query'][_0x71a3('0x23')]);}return _0x230826[_0x71a3('0x144')](_0x113197);}})[_0x71a3('0x15')](function(_0x1e3693){if(_0x1e3693){return _0x1e3693?{'count':_0x4bc8a1,'rows':_0x1e3693}:null;}})[_0x71a3('0x15')](respondWithResult(_0x36cfc4,null))[_0x71a3('0x20')](handleError(_0x36cfc4,null));};exports[_0x71a3('0x145')]=function(_0x32ebd4,_0x5421cb){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x32ebd4['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x5421cb,null))[_0x71a3('0x15')](function(_0x22987e){if(_0x22987e){return _0x22987e['addOpenchannelAccounts'](_0x32ebd4[_0x71a3('0x5c')]['ids'],_[_0x71a3('0x61')](_0x32ebd4[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})['then'](respondWithResult(_0x5421cb,null))['catch'](handleError(_0x5421cb,null));};exports['removeOpenchannelAccounts']=function(_0x3d108a,_0x44f088){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x3d108a[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x44f088,null))[_0x71a3('0x15')](function(_0x1099fa){if(_0x1099fa){return _0x1099fa['removeOpenchannelAccounts'](_0x3d108a['query']['ids']);}})['then'](respondWithStatusCode(_0x44f088,null))[_0x71a3('0x20')](handleError(_0x44f088,null));};exports[_0x71a3('0x146')]=function(_0x20892b,_0x5c9029){var _0x46d816={};var _0x556fc2={};var _0x36cc33;var _0xf6a7e1;return db['User'][_0x71a3('0x97')]({'where':{'id':_0x20892b['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x5c9029,null))[_0x71a3('0x15')](function(_0x12c703){if(_0x12c703){_0x36cc33=_0x12c703;_0x556fc2[_0x71a3('0x53')]=_[_0x71a3('0x54')](db['SmsAccount']['rawAttributes']);_0x556fc2['query']=_[_0x71a3('0x54')](_0x20892b[_0x71a3('0x44')]);_0x556fc2[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0x556fc2[_0x71a3('0x53')],_0x556fc2[_0x71a3('0x44')]);_0x46d816[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x556fc2['model'],qs['fields'](_0x20892b[_0x71a3('0x44')]['fields']));_0x46d816[_0x71a3('0x46')]=_0x46d816['attributes'][_0x71a3('0x4b')]?_0x46d816[_0x71a3('0x46')]:_0x556fc2[_0x71a3('0x53')];_0x46d816[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x20892b[_0x71a3('0x44')]['sort']);_0x46d816[_0x71a3('0x42')]=qs['filters'](_[_0x71a3('0xd6')](_0x20892b['query'],_0x556fc2[_0x71a3('0x56')]));if(_0x20892b[_0x71a3('0x44')][_0x71a3('0x33')]){_0x46d816['where']=_[_0x71a3('0xca')](_0x46d816[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x46d816[_0x71a3('0x46')],function(_0x1e1be1){var _0x9b3aee={};_0x9b3aee[_0x1e1be1]={'$like':'%'+_0x20892b[_0x71a3('0x44')][_0x71a3('0x33')]+'%'};return _0x9b3aee;})});}_0x46d816=_['merge']({},_0x46d816,_0x20892b[_0x71a3('0x59')]);return _0x36cc33[_0x71a3('0x146')](_0x46d816);}})['then'](function(_0x923d98){if(_0x923d98){_0xf6a7e1=_0x923d98[_0x71a3('0x4b')];if(!_0x20892b['query'][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x46d816[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x20892b[_0x71a3('0x44')][_0x71a3('0x25')]);_0x46d816[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x20892b['query'][_0x71a3('0x23')]);}return _0x36cc33['getSmsAccounts'](_0x46d816);}})['then'](function(_0x2a3e1e){if(_0x2a3e1e){return _0x2a3e1e?{'count':_0xf6a7e1,'rows':_0x2a3e1e}:null;}})[_0x71a3('0x15')](respondWithResult(_0x5c9029,null))[_0x71a3('0x20')](handleError(_0x5c9029,null));};exports['addSmsAccounts']=function(_0x22122a,_0xc80d34){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x22122a[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0xc80d34,null))[_0x71a3('0x15')](function(_0x2ec2c2){if(_0x2ec2c2){return _0x2ec2c2[_0x71a3('0x147')](_0x22122a[_0x71a3('0x5c')][_0x71a3('0x60')],_['omit'](_0x22122a[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0xc80d34,null))[_0x71a3('0x20')](handleError(_0xc80d34,null));};exports['removeSmsAccounts']=function(_0x2950ac,_0x270661){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x2950ac[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x270661,null))[_0x71a3('0x15')](function(_0x33a271){if(_0x33a271){return _0x33a271[_0x71a3('0x148')](_0x2950ac[_0x71a3('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x270661,null))[_0x71a3('0x20')](handleError(_0x270661,null));};exports[_0x71a3('0x149')]=function(_0x2b99d7,_0x42177b){var _0x5281e6={};var _0x479764={};var _0xf70d4f;var _0x4fce8d;return db[_0x71a3('0x43')]['findOne']({'where':{'id':_0x2b99d7[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x42177b,null))['then'](function(_0x59f505){if(_0x59f505){_0xf70d4f=_0x59f505;_0x479764['model']=_['keys'](db[_0x71a3('0x14a')][_0x71a3('0x3d')]);_0x479764[_0x71a3('0x44')]=_['keys'](_0x2b99d7[_0x71a3('0x44')]);_0x479764['filters']=_[_0x71a3('0x57')](_0x479764[_0x71a3('0x53')],_0x479764['query']);_0x5281e6[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x479764['model'],qs[_0x71a3('0x58')](_0x2b99d7[_0x71a3('0x44')]['fields']));_0x5281e6['attributes']=_0x5281e6[_0x71a3('0x46')]['length']?_0x5281e6['attributes']:_0x479764[_0x71a3('0x53')];_0x5281e6[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x2b99d7['query'][_0x71a3('0xd5')]);_0x5281e6[_0x71a3('0x42')]=qs['filters'](_[_0x71a3('0xd6')](_0x2b99d7[_0x71a3('0x44')],_0x479764['filters']));if(_0x2b99d7['query'][_0x71a3('0x33')]){_0x5281e6[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x5281e6['where'],{'$or':_[_0x71a3('0x35')](_0x5281e6[_0x71a3('0x46')],function(_0xab26a0){var _0x4caa40={};_0x4caa40[_0xab26a0]={'$like':'%'+_0x2b99d7['query'][_0x71a3('0x33')]+'%'};return _0x4caa40;})});}_0x5281e6=_[_0x71a3('0xca')]({},_0x5281e6,_0x2b99d7[_0x71a3('0x59')]);return _0xf70d4f[_0x71a3('0x149')](_0x5281e6);}})[_0x71a3('0x15')](function(_0xdb2cd2){if(_0xdb2cd2){_0x4fce8d=_0xdb2cd2['length'];if(!_0x2b99d7[_0x71a3('0x44')]['hasOwnProperty'](_0x71a3('0xd2'))){_0x5281e6[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x2b99d7[_0x71a3('0x44')][_0x71a3('0x25')]);_0x5281e6['offset']=qs[_0x71a3('0x23')](_0x2b99d7[_0x71a3('0x44')][_0x71a3('0x23')]);}return _0xf70d4f['getChatWebsites'](_0x5281e6);}})[_0x71a3('0x15')](function(_0x2ea932){if(_0x2ea932){return _0x2ea932?{'count':_0x4fce8d,'rows':_0x2ea932}:null;}})['then'](respondWithResult(_0x42177b,null))[_0x71a3('0x20')](handleError(_0x42177b,null));};exports[_0x71a3('0x14b')]=function(_0x3d7ba6,_0x17bec6){return db['User']['find']({'where':{'id':_0x3d7ba6[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x17bec6,null))[_0x71a3('0x15')](function(_0x226baa){if(_0x226baa){return _0x226baa[_0x71a3('0x14b')](_0x3d7ba6[_0x71a3('0x5c')][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x3d7ba6[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0x17bec6,null))['catch'](handleError(_0x17bec6,null));};exports[_0x71a3('0x14c')]=function(_0x5db6a1,_0xfeedff){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x5db6a1[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0xfeedff,null))['then'](function(_0x89ecb0){if(_0x89ecb0){return _0x89ecb0[_0x71a3('0x14c')](_0x5db6a1['query'][_0x71a3('0x60')]);}})['then'](respondWithStatusCode(_0xfeedff,null))[_0x71a3('0x20')](handleError(_0xfeedff,null));};exports[_0x71a3('0x14d')]=function(_0x4739e2,_0x524a45){var _0x4f08cf={};var _0xb32754={};var _0x163b0d;var _0x486ac6;return db[_0x71a3('0x43')]['findOne']({'where':{'id':_0x4739e2['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x524a45,null))[_0x71a3('0x15')](function(_0x3aa8a2){if(_0x3aa8a2){_0x163b0d=_0x3aa8a2;_0xb32754[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0x14e')][_0x71a3('0x3d')]);_0xb32754['query']=_[_0x71a3('0x54')](_0x4739e2[_0x71a3('0x44')]);_0xb32754[_0x71a3('0x56')]=_[_0x71a3('0x57')](_0xb32754[_0x71a3('0x53')],_0xb32754[_0x71a3('0x44')]);_0x4f08cf[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0xb32754[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x4739e2['query'][_0x71a3('0x58')]));_0x4f08cf['attributes']=_0x4f08cf[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x4f08cf[_0x71a3('0x46')]:_0xb32754[_0x71a3('0x53')];_0x4f08cf[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x4739e2[_0x71a3('0x44')]['sort']);_0x4f08cf[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x4739e2['query'],_0xb32754[_0x71a3('0x56')]));if(_0x4739e2[_0x71a3('0x44')][_0x71a3('0x33')]){_0x4f08cf[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x4f08cf[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x4f08cf['attributes'],function(_0x42d9d2){var _0x2c9d19={};_0x2c9d19[_0x42d9d2]={'$like':'%'+_0x4739e2['query'][_0x71a3('0x33')]+'%'};return _0x2c9d19;})});}_0x4f08cf=_[_0x71a3('0xca')]({},_0x4f08cf,_0x4739e2[_0x71a3('0x59')]);return _0x163b0d['getWhatsappAccounts'](_0x4f08cf);}})[_0x71a3('0x15')](function(_0x13a764){if(_0x13a764){_0x486ac6=_0x13a764[_0x71a3('0x4b')];if(!_0x4739e2[_0x71a3('0x44')][_0x71a3('0xd1')]('nolimit')){_0x4f08cf['limit']=qs[_0x71a3('0x25')](_0x4739e2['query'][_0x71a3('0x25')]);_0x4f08cf[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x4739e2['query'][_0x71a3('0x23')]);}return _0x163b0d['getWhatsappAccounts'](_0x4f08cf);}})[_0x71a3('0x15')](function(_0x2b10cb){if(_0x2b10cb){return _0x2b10cb?{'count':_0x486ac6,'rows':_0x2b10cb}:null;}})[_0x71a3('0x15')](respondWithResult(_0x524a45,null))[_0x71a3('0x20')](handleError(_0x524a45,null));};exports[_0x71a3('0x14f')]=function(_0x249f4d,_0x27a4f9){return db[_0x71a3('0x43')]['find']({'where':{'id':_0x249f4d[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x27a4f9,null))[_0x71a3('0x15')](function(_0x56197d){if(_0x56197d){return _0x56197d[_0x71a3('0x14f')](_0x249f4d[_0x71a3('0x5c')][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x249f4d['body'],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0x27a4f9,null))['catch'](handleError(_0x27a4f9,null));};exports[_0x71a3('0x150')]=function(_0x654191,_0x2be162){return db['User']['find']({'where':{'id':_0x654191[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2be162,null))[_0x71a3('0x15')](function(_0x546125){if(_0x546125){return _0x546125[_0x71a3('0x150')](_0x654191['query'][_0x71a3('0x60')]);}})[_0x71a3('0x15')](respondWithStatusCode(_0x2be162,null))[_0x71a3('0x20')](handleError(_0x2be162,null));};exports[_0x71a3('0x151')]=function(_0x52723d,_0x1e49ee){var _0x18a6d8={};var _0xce27a5={};var _0xa7af02;var _0x536e7c;return db[_0x71a3('0x43')][_0x71a3('0x97')]({'where':{'id':_0x52723d[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x1e49ee,null))[_0x71a3('0x15')](function(_0x1ef253){if(_0x1ef253){_0xa7af02=_0x1ef253;_0xce27a5[_0x71a3('0x53')]=_[_0x71a3('0x54')](db[_0x71a3('0x152')][_0x71a3('0x3d')]);_0xce27a5[_0x71a3('0x44')]=_['keys'](_0x52723d[_0x71a3('0x44')]);_0xce27a5['filters']=_[_0x71a3('0x57')](_0xce27a5['model'],_0xce27a5[_0x71a3('0x44')]);_0x18a6d8['attributes']=_[_0x71a3('0x57')](_0xce27a5['model'],qs[_0x71a3('0x58')](_0x52723d[_0x71a3('0x44')][_0x71a3('0x58')]));_0x18a6d8[_0x71a3('0x46')]=_0x18a6d8[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x18a6d8[_0x71a3('0x46')]:_0xce27a5['model'];_0x18a6d8[_0x71a3('0xc9')]=qs[_0x71a3('0xd5')](_0x52723d[_0x71a3('0x44')]['sort']);_0x18a6d8[_0x71a3('0x42')]=qs[_0x71a3('0x56')](_[_0x71a3('0xd6')](_0x52723d[_0x71a3('0x44')],_0xce27a5[_0x71a3('0x56')]));if(_0x52723d[_0x71a3('0x44')][_0x71a3('0x33')]){_0x18a6d8[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x18a6d8[_0x71a3('0x42')],{'$or':_[_0x71a3('0x35')](_0x18a6d8['attributes'],function(_0x77acd7){var _0x49c8d9={};_0x49c8d9[_0x77acd7]={'$like':'%'+_0x52723d[_0x71a3('0x44')]['filter']+'%'};return _0x49c8d9;})});}_0x18a6d8=_[_0x71a3('0xca')]({},_0x18a6d8,_0x52723d[_0x71a3('0x59')]);return _0xa7af02['getSquareProjects'](_0x18a6d8);}})[_0x71a3('0x15')](function(_0x575aa0){if(_0x575aa0){_0x536e7c=_0x575aa0['length'];if(!_0x52723d[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x18a6d8['limit']=qs[_0x71a3('0x25')](_0x52723d[_0x71a3('0x44')][_0x71a3('0x25')]);_0x18a6d8[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x52723d[_0x71a3('0x44')][_0x71a3('0x23')]);}return _0xa7af02[_0x71a3('0x151')](_0x18a6d8);}})[_0x71a3('0x15')](function(_0x4123af){if(_0x4123af){return _0x4123af?{'count':_0x536e7c,'rows':_0x4123af}:null;}})[_0x71a3('0x15')](respondWithResult(_0x1e49ee,null))['catch'](handleError(_0x1e49ee,null));};exports[_0x71a3('0x153')]=function(_0x53bdee,_0x5d28ca){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x53bdee['params']['id']}})['then'](handleEntityNotFound(_0x5d28ca,null))[_0x71a3('0x15')](function(_0x13e5a7){if(_0x13e5a7){return _0x13e5a7[_0x71a3('0x153')](_0x53bdee[_0x71a3('0x5c')][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x53bdee['body'],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0x5d28ca,null))[_0x71a3('0x20')](handleError(_0x5d28ca,null));};exports[_0x71a3('0x154')]=function(_0x4b8db8,_0x40fe42){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x4b8db8[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x40fe42,null))[_0x71a3('0x15')](function(_0x55789b){if(_0x55789b){return _0x55789b[_0x71a3('0x154')](_0x4b8db8[_0x71a3('0x44')][_0x71a3('0x60')]);}})[_0x71a3('0x15')](respondWithStatusCode(_0x40fe42,null))['catch'](handleError(_0x40fe42,null));};exports[_0x71a3('0x155')]=function(_0x9b4d05,_0x9713a9){var _0x440a86={},_0x138f94={},_0x1c96ff={'count':0x0,'rows':[]};var _0x115724=db[_0x71a3('0x156')][_0x71a3('0x3d')];_0x138f94[_0x71a3('0x53')]=_[_0x71a3('0x54')](_0x115724);_0x138f94[_0x71a3('0x44')]=_[_0x71a3('0x54')](_0x9b4d05[_0x71a3('0x44')]);_0x138f94['filters']=_['intersection'](_0x138f94['model'],_0x138f94['query']);_0x138f94[_0x71a3('0x56')]=_['concat'](_0x138f94['filters'],[_0x71a3('0x157'),_0x71a3('0x158'),'$gt','$gte',_0x71a3('0x159'),_0x71a3('0x15a'),_0x71a3('0x15b'),_0x71a3('0x15c'),_0x71a3('0x15d'),_0x71a3('0x15e'),'$notBetween',_0x71a3('0x15f'),_0x71a3('0x160'),'$like','$notLike','$iLike',_0x71a3('0x161'),_0x71a3('0x162'),'$overlap','$contains',_0x71a3('0x163'),_0x71a3('0x164')]);_0x440a86[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0x138f94[_0x71a3('0x53')],qs[_0x71a3('0x58')](_0x9b4d05[_0x71a3('0x44')][_0x71a3('0x58')]));_0x440a86[_0x71a3('0x46')]=_0x440a86[_0x71a3('0x46')]['length']?_0x440a86['attributes']:_0x138f94[_0x71a3('0x53')];if(!_0x9b4d05[_0x71a3('0x44')][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x440a86[_0x71a3('0x25')]=qs[_0x71a3('0x25')](_0x9b4d05[_0x71a3('0x44')][_0x71a3('0x25')]);_0x440a86[_0x71a3('0x23')]=qs[_0x71a3('0x23')](_0x9b4d05[_0x71a3('0x44')][_0x71a3('0x23')]);}_0x440a86['order']=qs[_0x71a3('0xd5')](_0x9b4d05[_0x71a3('0x44')][_0x71a3('0xd5')]);_0x440a86[_0x71a3('0x42')]=qs['filters'](_[_0x71a3('0xd6')](_0x9b4d05[_0x71a3('0x44')],_0x138f94['filters']));if(_0x9b4d05[_0x71a3('0x44')][_0x71a3('0x33')]){_0x440a86[_0x71a3('0x42')]=_[_0x71a3('0xca')](_0x440a86[_0x71a3('0x42')],{'$or':_['map'](_0x440a86[_0x71a3('0x46')],function(_0x736376){var _0x1c14e9={};_0x1c14e9[_0x736376]={'$like':'%'+_0x9b4d05['query']['filter']+'%'};return _0x1c14e9;})});}_0x440a86[_0x71a3('0x42')]={'$and':[_0x440a86[_0x71a3('0x42')],{'$or':[{'UserId':_0x9b4d05[_0x71a3('0x5f')]['id']},{'OwnerId':_0x9b4d05['params']['id']}]}]};_0x440a86=_['merge']({},_0x440a86,_0x9b4d05['options']);var _0x1e08f5={'where':_0x440a86[_0x71a3('0x42')]};return db[_0x71a3('0x156')][_0x71a3('0x26')](_0x1e08f5)[_0x71a3('0x15')](function(_0x39ab50){_0x1c96ff[_0x71a3('0x26')]=_0x39ab50;if(_0x9b4d05['query'][_0x71a3('0xcb')]){_0x440a86[_0x71a3('0x45')]=[{'attributes':['id',_0x71a3('0x165'),_0x71a3('0x166'),_0x71a3('0xea')],'model':db[_0x71a3('0xc8')],'as':_0x71a3('0x167')},{'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x168')],'model':db[_0x71a3('0xa8')],'as':_0x71a3('0xd4')}];}return db[_0x71a3('0x156')][_0x71a3('0x8b')](_0x440a86);})['then'](function(_0x54c0da){_0x1c96ff[_0x71a3('0x4a')]=_0x54c0da;return _0x1c96ff;})['then'](respondWithFilteredResult(_0x9713a9,_0x440a86))['catch'](handleError(_0x9713a9,null));};exports[_0x71a3('0x169')]=function(_0x74352e,_0xaec85c){if(!_[_0x71a3('0x68')](_0x74352e[_0x71a3('0x2f')]['id'])&&(_0x74352e['user'][_0x71a3('0x2c')]==_0x71a3('0x2d')||_0x74352e['user'][_0x71a3('0x2c')]=='user')){return db['User'][_0x71a3('0x97')]({'where':{'id':_0x74352e[_0x71a3('0x5f')]['id']},'raw':!![]})[_0x71a3('0x15')](function(_0x5a8c61){return authService['retrieveApiKey'](_0x5a8c61);})[_0x71a3('0x15')](function(_0x29550e){if(_0x29550e){return _0xaec85c['status'](0xc8)[_0x71a3('0x22')]({'api_key':_0x29550e['token']});}else{return _0xaec85c[_0x71a3('0x21')](0xcc)['json']({'message':_0x71a3('0x16a')});}})['catch'](handleError(_0xaec85c,0x193));}else{return _0xaec85c[_0x71a3('0x21')](0x191)[_0x71a3('0x22')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x71a3('0x16b')]=function(_0x54979c,_0x3df576){if(!_['isNil'](_0x54979c[_0x71a3('0x2f')]['id'])&&(_0x54979c['user'][_0x71a3('0x2c')]==_0x71a3('0x2d')||_0x54979c[_0x71a3('0x2f')][_0x71a3('0x2c')]==_0x71a3('0x2f'))){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x54979c['params']['id']}})['then'](function(_0x39a905){return authService[_0x71a3('0x16c')](_0x39a905);})[_0x71a3('0x15')](function(_0x53af80){return db[_0x71a3('0x43')][_0x71a3('0x29')]({'apiKeyIat':_0x53af80['iat'],'apiKeyNonce':_0x53af80[_0x71a3('0x16d')]},{'where':{'id':_0x54979c[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](function(){return _0x3df576['status'](0xc8)[_0x71a3('0x22')]({'api_key':_0x53af80['token']});});})['catch'](handleError(_0x3df576,0x193));}else{return _0x3df576[_0x71a3('0x21')](0x191)[_0x71a3('0x22')]({'message':_0x71a3('0x16e')});}};exports[_0x71a3('0x16f')]=function(_0x31c355,_0x2bbeb1){if(!_[_0x71a3('0x68')](_0x31c355[_0x71a3('0x2f')]['id'])&&(_0x31c355[_0x71a3('0x2f')][_0x71a3('0x2c')]==_0x71a3('0x2d')||_0x31c355['user'][_0x71a3('0x2c')]==_0x71a3('0x2f'))){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x31c355[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x2bbeb1,null))[_0x71a3('0x15')](function(_0x43530c){if(_0x43530c&&_0x43530c[_0x71a3('0x170')]&&_0x43530c['apiKeyIat'])return _0x43530c;else throw{'message':_0x71a3('0x171')};})[_0x71a3('0x15')](function(_0x4966c5){return db[_0x71a3('0x43')][_0x71a3('0x29')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x31c355['params']['id']}});})[_0x71a3('0x15')](respondWithStatusCode(_0x2bbeb1,0xc8))[_0x71a3('0x20')](handleError(_0x2bbeb1,0x193));}else{return _0x2bbeb1['status'](0x191)[_0x71a3('0x22')]({'message':_0x71a3('0x16e')});}};exports[_0x71a3('0x172')]=function(_0x123c6d,_0x33ca78){var _0x18611f=_0x123c6d[_0x71a3('0x2f')][_0x71a3('0x2b')]({'plain':!![]});if(!_0x18611f){return _0x33ca78[_0x71a3('0x21')](0x191)[_0x71a3('0x128')](_0x71a3('0x173'));}else{return _0x33ca78[_0x71a3('0x21')](0xc8)[_0x71a3('0x22')](_0x18611f);}};exports[_0x71a3('0x174')]=function(_0x2660e9,_0x5ed19f){var _0x4481c4={'offset':0x0},_0x38a99d={'count':0x0,'rows':[]};Promise[_0x71a3('0x175')]()[_0x71a3('0x15')](function(){if(!_0x2660e9[_0x71a3('0x44')][_0x71a3('0x33')]&&!_0x2660e9['query'][_0x71a3('0x176')]&&!_0x2660e9[_0x71a3('0x44')]['queues'])return[];return Promise['resolve']()['then'](function(){var _0x5d4093=[];if(!_['isEmpty'](_0x2660e9[_0x71a3('0x44')]['teams'])){_0x5d4093[_0x71a3('0x47')](db[_0x71a3('0x10e')][_0x71a3('0x8b')]({'attributes':['id','name'],'where':{'id':_0x2660e9[_0x71a3('0x44')][_0x71a3('0x176')]}}));}if(!_['isEmpty'](_0x2660e9[_0x71a3('0x44')][_0x71a3('0x177')])){_0x5d4093[_0x71a3('0x47')](db['VoiceQueue'][_0x71a3('0x8b')]({'attributes':['id',_0x71a3('0x3b')],'type':_0x71a3('0x178'),'where':{'id':_0x2660e9[_0x71a3('0x44')]['queues']}}));}return Promise[_0x71a3('0x5b')](_0x5d4093);})[_0x71a3('0x15')](function(_0x745851){var _0x2fcb04=_['flatten'](_0x745851)[_0x71a3('0x35')](function(_0x442722){return _0x442722[_0x71a3('0x126')]({'attributes':['id',_0x71a3('0x3b'),'internal','online'],'raw':!![]});});return Promise[_0x71a3('0x5b')](_0x2fcb04);})[_0x71a3('0x15')](function(_0x37c33b){var _0x5a2e66=_['flatten'](_0x37c33b);if(!_0x2660e9[_0x71a3('0x44')][_0x71a3('0x33')])return _0x5a2e66;if(_[_0x71a3('0x8c')](_0x5a2e66)){return db[_0x71a3('0x43')][_0x71a3('0x8b')]({'attributes':['id',_0x71a3('0x3b'),'internal','online'],'where':{'role':_0x71a3('0x71'),'$or':[db[_0x71a3('0x6a')][_0x71a3('0x42')](db['sequelize']['fn'](_0x71a3('0x179'),db['sequelize'][_0x71a3('0x17a')]('name')),{'$like':'%'+_0x2660e9['query'][_0x71a3('0x33')][_0x71a3('0xa6')]()+'%'}),{'internal':{'$like':'%'+_0x2660e9[_0x71a3('0x44')][_0x71a3('0x33')]+'%'}}]},'raw':!![]});}else{return _(_0x5a2e66)['flatten']()['filter'](function(_0x1e3d79){return _0x1e3d79['name'][_0x71a3('0xa6')]()[_0x71a3('0x37')](_0x2660e9[_0x71a3('0x44')][_0x71a3('0x33')][_0x71a3('0xa6')]())||_0x1e3d79[_0x71a3('0x67')][_0x71a3('0x17b')]()[_0x71a3('0x37')](_0x2660e9[_0x71a3('0x44')][_0x71a3('0x33')]);})[_0x71a3('0x36')]();}})[_0x71a3('0x15')](function(_0xa9dc69){var _0x4acbd8=_0x71a3('0x3b');var _0x4b3a49='asc';if(_0x2660e9['query'][_0x71a3('0xd5')]){var _0x4b3a49=_0x2660e9['query'][_0x71a3('0xd5')][0x0]==='-'?_0x71a3('0x17c'):_0x71a3('0x17d');var _0x4acbd8=_0x4b3a49===_0x71a3('0x17d')?_0x2660e9[_0x71a3('0x44')][_0x71a3('0xd5')]:_0x2660e9[_0x71a3('0x44')][_0x71a3('0xd5')][_0x71a3('0x17e')](0x1);}return _(_0xa9dc69)[_0x71a3('0x17f')]('id')[_0x71a3('0x180')]([function(_0x5c30a1){return _0x4acbd8===_0x71a3('0x3b')?_0x5c30a1[_0x4acbd8]['toLowerCase']():_0x5c30a1[_0x4acbd8];}],[_0x4b3a49])['map'](function(_0x1fcf81){return _[_0x71a3('0xd6')](_0x1fcf81,['id',_0x71a3('0x3b'),_0x71a3('0x67'),'online']);})[_0x71a3('0x36')]();})['then'](function(_0x48126c){return client[_0x71a3('0x14')](_0x71a3('0x30'),_0x2660e9)[_0x71a3('0x15')](function(_0x47d544){if(_0x47d544[_0x71a3('0x1c')])throw new Error(_0x71a3('0x181'));var _0x3a4c4b=_0x47d544['result'];var _0x5e8366=jayson['client']['http']({'port':0x232c});return _0x5e8366[_0x71a3('0x14')](_0x71a3('0x30'),_0x2660e9)[_0x71a3('0x15')](function(_0x15a381){if(_0x15a381['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x484a4b=_0x15a381[_0x71a3('0x1f')];return _[_0x71a3('0xca')]({},_0x484a4b,_0x3a4c4b);});})[_0x71a3('0x15')](function(_0x2bf530){return _[_0x71a3('0x35')](_0x48126c,function(_0x29ed83){var _0x5529dc=_[_0x71a3('0x38')](_0x2bf530['rows'],['id',_0x29ed83['id']]);if(!_0x5529dc||!_0x29ed83[_0x71a3('0x9d')]){_0x29ed83['status']=_0x71a3('0x182');}else if(_0x5529dc[_0x71a3('0x9e')]){_0x29ed83[_0x71a3('0x21')]='pause';}else{_0x29ed83['status']=_[_0x71a3('0x37')]([_0x71a3('0x183'),_0x71a3('0x184'),_0x71a3('0x185'),'ringing',null,undefined],_0x5529dc[_0x71a3('0x186')])?_0x71a3('0x9d'):_0x71a3('0x187');}return _0x29ed83;});});});})[_0x71a3('0x15')](function(_0x12b73a){if(!_0x2660e9['query'][_0x71a3('0xd1')](_0x71a3('0xd2'))){_0x4481c4['limit']=qs[_0x71a3('0x25')](_0x2660e9[_0x71a3('0x44')][_0x71a3('0x25')]||0xa);_0x4481c4['offset']=qs['offset'](_0x2660e9[_0x71a3('0x44')][_0x71a3('0x23')]);}_0x38a99d[_0x71a3('0x26')]=_0x12b73a[_0x71a3('0x4b')];_0x38a99d[_0x71a3('0x4a')]=_0x4481c4[_0x71a3('0x25')]?_0x12b73a['slice'](_0x4481c4[_0x71a3('0x23')],_0x4481c4[_0x71a3('0x23')]+_0x4481c4[_0x71a3('0x25')]):_0x12b73a;return _0x38a99d;})['then'](respondWithFilteredResult(_0x5ed19f,_0x4481c4))[_0x71a3('0x20')](handleError(_0x5ed19f,null));};function get_open_tabs(_0x1c4c69,_0xb7b2c8){var _0x260984=_0x1c4c69[_0x71a3('0x188')](0x0)[_0x71a3('0x189')]()+_0x1c4c69[_0x71a3('0x18a')](0x1);var _0x595e38={'type':db[_0x71a3('0x93')][_0x71a3('0x6b')][_0x71a3('0x18b')],'raw':!![]};return new BPromise(function(_0x2699ec,_0x17d7b3){var _0xd8c356=squel[_0x71a3('0x18c')]()[_0x71a3('0x18d')](_0x71a3('0x18e')+_0x260984+_0x71a3('0x18f'),'id')[_0x71a3('0x18d')](_0x71a3('0x190'))['from'](_0x71a3('0x191')+_0x1c4c69+_0x71a3('0x192'),'ui')[_0x71a3('0x42')](_0x71a3('0x193'),_0xb7b2c8['id']);return db[_0x71a3('0x6a')][_0x71a3('0x44')](_0xd8c356[_0x71a3('0x17b')](),_0x595e38)[_0x71a3('0x15')](function(_0x16dab7){_0xb7b2c8[_0x260984+'OpenTabs']=_0x16dab7;_0x2699ec(_0x16dab7);})[_0x71a3('0x20')](function(_0x1eb312){_0x17d7b3(_0x1eb312);});});};
\ No newline at end of file
+var _0x9f0e=['bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','each','create','isEmpty','autoAssociation','changePassword','oldPassword','newPassword','Sequelize','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','loginInPause','voicePause','interface','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','online','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Unknown\x20channel','remove','Queues','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','findOne','sort','pick','getContacts','hasOwnProperty','CmList','List','Tag','Tags','tag','getQueues','Queue','order','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','UserId','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','LOCAL/%s@from-sip/n','format','intrf','user:%s','user:forcelogout','headers','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','concat','isMiddleware','resolve','logout','pause','QueuePause','type','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','smsPause','whatsapppause','pauseType','unpause','manual','%s%s','Pause','Team','getTeams','addTeams','getVoiceQueues','setDataValue','Voice','getChatQueues','Mail','getSmsQueues','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Chat','getMailQueues','Sms','getOpenchannelQueues','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$any','firstName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','iat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','queues','teams','inbound','getAgents','lower','col','toString','desc','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','busy','slice','toUpperCase','QueryTypes','field','ui.','InteractionId','user_has_','_interactions','OpenTabs','moment','bluebird','util','path','lodash','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','client','http','then','info','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','find','value','name','sendStatus','stack','send','index','rawAttributes','fieldName','key','getOptions','where','User','query','includeAll','include','attributes','findAll','openTabs','true','length','push','chat','rows','dataValues','sms','fax','mail','openchannel','whatsapp','show','params','model','differenceBy','keys','password','filters','intersection','fields','merge','options','includes','body','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','107','108','109','100','111','114','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x441853,_0xef5511){var _0x3fecbe=function(_0x5dc6cd){while(--_0x5dc6cd){_0x441853['push'](_0x441853['shift']());}};_0x3fecbe(++_0xef5511);}(_0x9f0e,0x116));var _0xe9f0=function(_0x5b488f,_0x9972f0){_0x5b488f=_0x5b488f-0x0;var _0x596cd6=_0x9f0e[_0x5b488f];return _0x596cd6;};'use strict';var moment=require(_0xe9f0('0x0'));var BPromise=require(_0xe9f0('0x1'));var util=require(_0xe9f0('0x2'));var path=require(_0xe9f0('0x3'));var fs=require('fs');var _=require(_0xe9f0('0x4'));var squel=require('squel');var jayson=require('jayson/promise');var Redis=require(_0xe9f0('0x5'));var authService=require(_0xe9f0('0x6'));var qs=require(_0xe9f0('0x7'));var logger=require(_0xe9f0('0x8'))(_0xe9f0('0x9'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe9f0('0xa'));var db=require(_0xe9f0('0xb'))['db'];var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);config[_0xe9f0('0xf')]=_[_0xe9f0('0x10')](config[_0xe9f0('0xf')],{'host':_0xe9f0('0x11'),'port':0x18eb});var client=jayson[_0xe9f0('0x12')][_0xe9f0('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x6acfb,_0x5352e0,_0x39b5b1,_0x329ecd){return new BPromise(function(_0x2d2863,_0x4a82aa){var _0x207fac=_0x329ecd||client;return _0x207fac['request'](_0x6acfb,_0x39b5b1)[_0xe9f0('0x14')](function(_0xd82420){logger[_0xe9f0('0x15')](_0xe9f0('0x16'),_0x5352e0,'request\x20sent');logger[_0xe9f0('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x5352e0,_0xe9f0('0x18'),JSON[_0xe9f0('0x19')](_0xd82420));if(_0xd82420[_0xe9f0('0x1a')]){if(_0xd82420['error'][_0xe9f0('0x1b')]===0x1f4){logger[_0xe9f0('0x1a')](_0xe9f0('0x16'),_0x5352e0,_0xd82420['error'][_0xe9f0('0x1c')]);return _0x4a82aa(_0xd82420[_0xe9f0('0x1a')][_0xe9f0('0x1c')]);}logger[_0xe9f0('0x1a')](_0xe9f0('0x16'),_0x5352e0,_0xd82420[_0xe9f0('0x1a')][_0xe9f0('0x1c')]);return _0x2d2863(_0xd82420['error'][_0xe9f0('0x1c')]);}else{logger[_0xe9f0('0x15')](_0xe9f0('0x16'),_0x5352e0,'request\x20sent');_0x2d2863(_0xd82420[_0xe9f0('0x1d')][_0xe9f0('0x1c')]);}})[_0xe9f0('0x1e')](function(_0x43f399){logger['error'](_0xe9f0('0x16'),_0x5352e0,_0x43f399);_0x4a82aa(_0x43f399);});});}function respondWithStatusCode(_0xfaa312,_0x583687){_0x583687=_0x583687||0xcc;return function(_0x51e03f){if(_0x51e03f){return _0xfaa312['sendStatus'](_0x583687);}return _0xfaa312[_0xe9f0('0x1f')](_0x583687)[_0xe9f0('0x20')]();};}function respondWithResult(_0x1211ae,_0x316cdf){_0x316cdf=_0x316cdf||0xc8;return function(_0x3ce106){if(_0x3ce106){return _0x1211ae['status'](_0x316cdf)[_0xe9f0('0x21')](_0x3ce106);}};}function respondWithFilteredResult(_0x38b7ee,_0x437d43){return function(_0x10801b){if(_0x10801b){var _0x3ca991=typeof _0x437d43[_0xe9f0('0x22')]===_0xe9f0('0x23')&&typeof _0x437d43[_0xe9f0('0x24')]===_0xe9f0('0x23');var _0x3fce54=_0x10801b['count'];var _0x371095=_0x3ca991?0x0:_0x437d43[_0xe9f0('0x22')];var _0x2ddfba=_0x3ca991?_0x10801b[_0xe9f0('0x25')]:_0x437d43['offset']+_0x437d43[_0xe9f0('0x24')];var _0x2613fd;if(_0x2ddfba>=_0x3fce54){_0x2ddfba=_0x3fce54;_0x2613fd=0xc8;}else{_0x2613fd=0xce;}_0x38b7ee[_0xe9f0('0x1f')](_0x2613fd);return _0x38b7ee[_0xe9f0('0x26')](_0xe9f0('0x27'),_0x371095+'-'+_0x2ddfba+'/'+_0x3fce54)['json'](_0x10801b);}return null;};}function saveUpdates(_0x130f96){return function(_0xdc16bc){if(_0xdc16bc){return _0xdc16bc[_0xe9f0('0x28')](_0x130f96)[_0xe9f0('0x14')](function(_0xa27c84){return _0xa27c84;});}return null;};}function removeEntity(_0xd19788){return function(_0x1d788a){if(_0x1d788a){return _0x1d788a[_0xe9f0('0x29')]()[_0xe9f0('0x14')](function(){var _0x3dbe49=_0x1d788a[_0xe9f0('0x2a')]({'plain':!![]});if(_0x3dbe49[_0xe9f0('0x2b')]===_0xe9f0('0x2c'))return;var _0x2ab77d=[{'name':_0xe9f0('0x2d'),'value':_0xe9f0('0x2e'),'ignore':!![]},{'name':_0xe9f0('0x2f'),'value':_0xe9f0('0x30'),'ignore':![]},{'name':_0xe9f0('0x31'),'value':_0xe9f0('0x32'),'ignore':![]}];var _0x4089cc=_(_0x2ab77d)[_0xe9f0('0x33')](_0xe9f0('0x34'))[_0xe9f0('0x35')]('value')['value']();if(_['includes'](_0x4089cc,_0x3dbe49[_0xe9f0('0x2b')])){return;}var _0x585742=_[_0xe9f0('0x36')](_0x2ab77d,[_0xe9f0('0x37'),_0x3dbe49['role']])[_0xe9f0('0x38')];return db['UserProfileResource']['destroy']({'where':{'type':_0x585742,'resourceId':_0x3dbe49['id']}})['then'](function(){return _0x1d788a;});})[_0xe9f0('0x14')](function(){_0xd19788[_0xe9f0('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3becb9){return function(_0xb0cfc){if(!_0xb0cfc){_0x3becb9[_0xe9f0('0x39')](0x194);}return _0xb0cfc;};}function handleError(_0x4d4186,_0x523fbc){_0x523fbc=_0x523fbc||0x1f4;return function(_0x3fb04e){logger[_0xe9f0('0x1a')](_0x3fb04e[_0xe9f0('0x3a')]);if(_0x3fb04e['name']){delete _0x3fb04e[_0xe9f0('0x38')];}_0x4d4186[_0xe9f0('0x1f')](_0x523fbc)[_0xe9f0('0x3b')](_0x3fb04e);};}exports[_0xe9f0('0x3c')]=function(_0x2b38de,_0x552ec2){var _0x2ab492={},_0x3a2b23={'count':0x0,'rows':[]};var _0x2ede2=_(db['User'][_0xe9f0('0x3d')])[_0xe9f0('0x35')](function(_0x4825f2){return{'name':_0x4825f2[_0xe9f0('0x3e')],'type':_0x4825f2['type'][_0xe9f0('0x3f')]};})['filter'](function(_0x5dcbeb){return!_['includes'](['password','salt'],_0x5dcbeb[_0xe9f0('0x38')]);})[_0xe9f0('0x37')]();_0x2ab492=qs[_0xe9f0('0x40')](_0x2ede2,_0x2b38de);var _0x40c2c6={'where':_0x2ab492[_0xe9f0('0x41')]};return db[_0xe9f0('0x42')][_0xe9f0('0x25')](_0x40c2c6)[_0xe9f0('0x14')](function(_0xb06e04){_0x3a2b23['count']=_0xb06e04;if(_0x2b38de[_0xe9f0('0x43')][_0xe9f0('0x44')]){_0x2ab492[_0xe9f0('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x2ab492['attributes'],'id')){_0x2ab492[_0xe9f0('0x46')]['push']('id');}return db[_0xe9f0('0x42')][_0xe9f0('0x47')](_0x2ab492);})[_0xe9f0('0x14')](function(_0x42d9d2){_0x3a2b23['rows']=_0x42d9d2;if(_0x2b38de[_0xe9f0('0x43')][_0xe9f0('0x48')]===_0xe9f0('0x49')){var _0x18faaf=[];for(var _0x37a2ac=0x0;_0x37a2ac<_0x3a2b23['rows'][_0xe9f0('0x4a')];_0x37a2ac++){_0x18faaf[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x4c'),_0x3a2b23[_0xe9f0('0x4d')][_0x37a2ac][_0xe9f0('0x4e')]));_0x18faaf['push'](get_open_tabs(_0xe9f0('0x4f'),_0x3a2b23['rows'][_0x37a2ac]['dataValues']));_0x18faaf[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x50'),_0x3a2b23['rows'][_0x37a2ac][_0xe9f0('0x4e')]));_0x18faaf[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x51'),_0x3a2b23[_0xe9f0('0x4d')][_0x37a2ac][_0xe9f0('0x4e')]));_0x18faaf[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x52'),_0x3a2b23['rows'][_0x37a2ac][_0xe9f0('0x4e')]));_0x18faaf['push'](get_open_tabs(_0xe9f0('0x53'),_0x3a2b23['rows'][_0x37a2ac][_0xe9f0('0x4e')]));}return BPromise['all'](_0x18faaf)[_0xe9f0('0x14')](function(_0x2023b4){return _0x3a2b23;});}else{return _0x3a2b23;}})[_0xe9f0('0x14')](respondWithFilteredResult(_0x552ec2,_0x2ab492))['catch'](handleError(_0x552ec2,null));};exports[_0xe9f0('0x54')]=function(_0xcf426d,_0x3e351a){var _0x22fce6={'raw':![],'where':{'id':_0xcf426d[_0xe9f0('0x55')]['id']}},_0x9a25fb={};_0x9a25fb[_0xe9f0('0x56')]=_[_0xe9f0('0x57')](_[_0xe9f0('0x58')](db[_0xe9f0('0x42')][_0xe9f0('0x3d')]),[_0xe9f0('0x59'),'salt']);_0x9a25fb['query']=_[_0xe9f0('0x58')](_0xcf426d[_0xe9f0('0x43')]);_0x9a25fb[_0xe9f0('0x5a')]=_['intersection'](_0x9a25fb[_0xe9f0('0x56')],_0x9a25fb['query']);_0x22fce6[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x9a25fb[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0xcf426d['query'][_0xe9f0('0x5c')]));_0x22fce6[_0xe9f0('0x46')]=_0x22fce6['attributes'][_0xe9f0('0x4a')]?_0x22fce6[_0xe9f0('0x46')]:_0x9a25fb[_0xe9f0('0x56')];if(_0xcf426d[_0xe9f0('0x43')]['includeAll']){_0x22fce6[_0xe9f0('0x45')]=[{'all':!![]}];}_0x22fce6=_[_0xe9f0('0x5d')]({},_0x22fce6,_0xcf426d[_0xe9f0('0x5e')]);if(!_[_0xe9f0('0x5f')](_0x22fce6[_0xe9f0('0x46')],'id')){_0x22fce6[_0xe9f0('0x46')][_0xe9f0('0x4b')]('id');}return db[_0xe9f0('0x42')]['find'](_0x22fce6)[_0xe9f0('0x14')](handleEntityNotFound(_0x3e351a,null))[_0xe9f0('0x14')](function(_0x465380){var _0x4728e7=[];values=_0x465380;if(_0xcf426d[_0xe9f0('0x43')][_0xe9f0('0x48')]===_0xe9f0('0x49')){_0x4728e7[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x4c'),_0x465380[_0xe9f0('0x4e')]));_0x4728e7[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x4f'),_0x465380[_0xe9f0('0x4e')]));_0x4728e7[_0xe9f0('0x4b')](get_open_tabs('openchannel',_0x465380[_0xe9f0('0x4e')]));_0x4728e7[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x53'),_0x465380['dataValues']));_0x4728e7['push'](get_open_tabs(_0xe9f0('0x50'),_0x465380['dataValues']));_0x4728e7[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x51'),_0x465380[_0xe9f0('0x4e')]));return BPromise['all'](_0x4728e7);}else{return values;}})[_0xe9f0('0x14')](function(_0x454b8a){return values;})[_0xe9f0('0x14')](respondWithResult(_0x3e351a,null))[_0xe9f0('0x1e')](handleError(_0x3e351a,null));};exports['update']=function(_0x392eae,_0x3a05e7){if(_0x392eae[_0xe9f0('0x60')]['id']){delete _0x392eae[_0xe9f0('0x60')]['id'];}delete _0x392eae['body']['role'];return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x392eae[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x3a05e7,null))[_0xe9f0('0x14')](saveUpdates(_0x392eae['body'],null))[_0xe9f0('0x14')](respondWithResult(_0x3a05e7,null))['catch'](handleError(_0x3a05e7,null));};exports[_0xe9f0('0x61')]=function(_0x5858a9,_0x7c05aa){return db[_0xe9f0('0x42')][_0xe9f0('0x61')]()[_0xe9f0('0x14')](respondWithResult(_0x7c05aa,null))[_0xe9f0('0x1e')](handleError(_0x7c05aa,null));};exports['addContacts']=function(_0x4e972e,_0x4bfb6d){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x4e972e['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x4bfb6d,null))['then'](function(_0x4f6a5b){if(_0x4f6a5b){return _0x4f6a5b[_0xe9f0('0x62')](_0x4e972e[_0xe9f0('0x60')][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x4e972e[_0xe9f0('0x60')],[_0xe9f0('0x63'),'id'])||{});}})['then'](respondWithResult(_0x4bfb6d,null))['catch'](handleError(_0x4bfb6d,null));};function validateUser(_0x1255e6){return new BPromise(function(_0x248f10,_0x12d40a){if(_0x1255e6[_0xe9f0('0x65')])return _0x248f10(_0x1255e6);return db['Setting'][_0xe9f0('0x66')](0x1)[_0xe9f0('0x14')](function(_0x22b44a){if(_0x22b44a[_0xe9f0('0x67')])authService[_0xe9f0('0x68')](_0x1255e6[_0xe9f0('0x59')]);db['User'][_0xe9f0('0x69')](_0xe9f0('0x65'))[_0xe9f0('0x14')](function(_0x16f19f){if(_[_0xe9f0('0x6a')](_0x16f19f)){_0x1255e6['internal']=_0x22b44a[_0xe9f0('0x6b')]||0x1;return;}if(_[_0xe9f0('0x6a')](_0x22b44a[_0xe9f0('0x6b')])||_0x22b44a[_0xe9f0('0x6b')]===_0x16f19f){_0x1255e6[_0xe9f0('0x65')]=_0x16f19f+0x1;return;}if(_0x22b44a[_0xe9f0('0x6b')]>_0x16f19f){_0x1255e6[_0xe9f0('0x65')]=_0x22b44a[_0xe9f0('0x6b')];return;}return db[_0xe9f0('0x6c')][_0xe9f0('0x43')](_0xe9f0('0x6d'),{'type':db[_0xe9f0('0x6c')]['QueryTypes'][_0xe9f0('0x6e')]})[_0xe9f0('0x14')](function(_0x78fcdb){if(_0x78fcdb&&_0x78fcdb[_0xe9f0('0x4a')]){for(var _0x3c700e=0x0,_0x2428aa=_0x78fcdb[_0xe9f0('0x4a')];_0x3c700e<_0x2428aa&&_['isNil'](_0x1255e6[_0xe9f0('0x65')]);_0x3c700e++){if(_0x22b44a[_0xe9f0('0x6b')]<=_0x78fcdb[_0x3c700e]['from']){_0x1255e6[_0xe9f0('0x65')]=_0x78fcdb[_0x3c700e][_0xe9f0('0x6f')];}else if(_0x22b44a[_0xe9f0('0x6b')]>_0x78fcdb[_0x3c700e]['from']&&_0x22b44a[_0xe9f0('0x6b')]<=_0x78fcdb[_0x3c700e]['to']){_0x1255e6[_0xe9f0('0x65')]=_0x22b44a['min_internal'];}}}if(_[_0xe9f0('0x6a')](_0x1255e6[_0xe9f0('0x65')])){_0x1255e6['internal']=_0x16f19f+0x1;}return _0x248f10(_0x1255e6);});});})['catch'](function(_0x45466b){_0x12d40a(_0x45466b);});});}function updateUser(_0x507e02){return new BPromise(function(_0x386d7b,_0x3afb6c){try{if(_0x507e02['voicemail']){_0x507e02[_0xe9f0('0x70')]=_0x507e02[_0xe9f0('0x65')];_0x507e02[_0xe9f0('0x71')]={'mailbox':_0x507e02[_0xe9f0('0x65')],'password':_0x507e02[_0xe9f0('0x59')],'fullname':_0x507e02[_0xe9f0('0x72')],'email':_0x507e02[_0xe9f0('0x73')]};}if(_0x507e02[_0xe9f0('0x2b')]===_0xe9f0('0x30')){if(!_0x507e02['permissions'])_0x507e02[_0xe9f0('0x74')]=[_0xe9f0('0x75'),_0xe9f0('0x76'),_0xe9f0('0x77'),_0xe9f0('0x78'),_0xe9f0('0x79'),_0xe9f0('0x7a'),_0xe9f0('0x7b'),'106',_0xe9f0('0x7c'),_0xe9f0('0x7d'),_0xe9f0('0x7e'),_0xe9f0('0x7f'),_0xe9f0('0x80'),_0xe9f0('0x81'),'115'];}_0x386d7b(_0x507e02);}catch(_0x12e663){_0x3afb6c(_0x12e663);}});}exports['create']=function(_0x5dda96,_0x5ca5e5){if(_0x5dda96[_0xe9f0('0x2e')][_0xe9f0('0x2b')]===_0xe9f0('0x30'))throw new Error(_0xe9f0('0x82'));if(_0x5dda96[_0xe9f0('0x60')][_0xe9f0('0x2b')]===_0xe9f0('0x2e')&&_0x5dda96[_0xe9f0('0x2e')][_0xe9f0('0x2b')]!=='admin'){throw new Error(_0xe9f0('0x83'));}if(_0x5dda96[_0xe9f0('0x60')][_0xe9f0('0x2b')]===_0xe9f0('0x2c')&&_0x5dda96[_0xe9f0('0x2e')][_0xe9f0('0x2b')]!==_0xe9f0('0x2c')){throw new Error(_0xe9f0('0x84'));}return licenseUtil[_0xe9f0('0x85')]([_0x5dda96[_0xe9f0('0x60')]])['then'](function(){return validateUser(_0x5dda96['body']);})[_0xe9f0('0x14')](function(_0x27ff72){return updateUser(_0x27ff72)[_0xe9f0('0x14')](function(_0x2b4a03){if(_0x2b4a03[_0xe9f0('0x2b')]===_0xe9f0('0x2c')){_0x2b4a03[_0xe9f0('0x86')]=_0x5dda96[_0xe9f0('0x2e')]['settingsEnabled'];delete _0x2b4a03['userProfileId'];}return _0x2b4a03;});})[_0xe9f0('0x14')](function(_0x449a6a){return db['User']['create'](_0x449a6a,{'include':[{'model':db[_0xe9f0('0x71')],'as':_0xe9f0('0x71')}]});})[_0xe9f0('0x14')](function(_0xab92b){if(_0x5dda96[_0xe9f0('0x60')]['role']===_0xe9f0('0x2e'))return _0xab92b;if(_0x5dda96[_0xe9f0('0x2e')][_0xe9f0('0x2b')]!==_0xe9f0('0x2e'))return _0xab92b;return db[_0xe9f0('0x87')][_0xe9f0('0x36')]({'where':{'name':_0xab92b[_0xe9f0('0x2b')]==='agent'?'Agents':'Telephones','userProfileId':_0x5dda96[_0xe9f0('0x2e')][_0xe9f0('0x88')]},'raw':!![]})[_0xe9f0('0x14')](function(_0x39affc){if(!_0x39affc||_0x39affc['autoAssociation']!=0x0)return _0xab92b;return db[_0xe9f0('0x89')]['create']({'name':_0xab92b[_0xe9f0('0x38')],'resourceId':_0xab92b['id'],'type':_0x39affc['name'],'sectionId':_0x39affc['id']},{})[_0xe9f0('0x14')](function(){return _0xab92b;});})[_0xe9f0('0x1e')](function(_0x83cb0b){logger[_0xe9f0('0x1a')](_0xe9f0('0x8a'),_0x83cb0b);throw _0x83cb0b;});})[_0xe9f0('0x14')](respondWithResult(_0x5ca5e5,0xc9))['catch'](handleError(_0x5ca5e5,null));};exports[_0xe9f0('0x8b')]=function(_0x1820f6,_0x7a0ccc){var _0x470c5a=_0x1820f6[_0xe9f0('0x60')];var _0x5da556=[];if(_0x1820f6[_0xe9f0('0x2e')][_0xe9f0('0x2b')]==='agent')throw new Error(_0xe9f0('0x82'));if(_['some'](_0x470c5a,[_0xe9f0('0x2b'),_0xe9f0('0x2e')])&&_0x1820f6[_0xe9f0('0x2e')]['role']!==_0xe9f0('0x2c')){throw new Error(_0xe9f0('0x83'));}if(_[_0xe9f0('0x8c')](_0x470c5a,['role',_0xe9f0('0x2c')])&&_0x1820f6[_0xe9f0('0x2e')][_0xe9f0('0x2b')]!==_0xe9f0('0x2c')){throw new Error(_0xe9f0('0x8d'));}return licenseUtil[_0xe9f0('0x85')](_0x470c5a)[_0xe9f0('0x14')](function(){return validateUser(_0x470c5a[0x0]);})['then'](function(){for(var _0x4a416c=0x1;_0x4a416c<_0x470c5a[_0xe9f0('0x4a')];_0x4a416c++){var _0x37a475=_0x470c5a[_0x4a416c-0x1][_0xe9f0('0x65')];if(!_0x470c5a[_0x4a416c]['internal'])_0x470c5a[_0x4a416c][_0xe9f0('0x65')]=_0x37a475+0x1;_0x5da556[_0xe9f0('0x4b')](validateUser(_0x470c5a[_0x4a416c]));}return BPromise[_0xe9f0('0x8e')](_0x5da556);})[_0xe9f0('0x14')](function(){_0x5da556=[];for(var _0x592592=0x0;_0x592592<_0x470c5a['length'];_0x592592++){_0x5da556[_0xe9f0('0x4b')](updateUser(_0x470c5a[_0x592592]));}return BPromise[_0xe9f0('0x8e')](_0x5da556);})['then'](function(){return BPromise[_0xe9f0('0x8f')](_0x470c5a,function(_0x5b26b1){return db['User'][_0xe9f0('0x90')](_0x5b26b1,{'include':[{'model':db[_0xe9f0('0x71')],'as':_0xe9f0('0x71')}]})[_0xe9f0('0x14')](function(_0x10c4cf){_0x5b26b1['id']=_0x10c4cf['id'];return _0x5b26b1;});});})['then'](function(_0x5761d3){if(_0x1820f6[_0xe9f0('0x60')][_0xe9f0('0x2b')]===_0xe9f0('0x2e'))return _0x5761d3;if(_0x1820f6[_0xe9f0('0x2e')][_0xe9f0('0x2b')]!=='user')return _0x5761d3;var _0x57b0d0=_['some'](_0x5761d3,function(_0xb78361){return _0xb78361['role']===_0xe9f0('0x30')||_0xb78361[_0xe9f0('0x2b')]===_0xe9f0('0x32');});if(!_0x57b0d0)return _0x5761d3;return db[_0xe9f0('0x87')][_0xe9f0('0x47')]({'where':{'name':{'$or':[_0xe9f0('0x2f'),'Telephones']},'userProfileId':_0x1820f6['user'][_0xe9f0('0x88')]},'raw':!![]})[_0xe9f0('0x14')](function(_0x55bcc4){if(_[_0xe9f0('0x91')](_0x55bcc4)||!_[_0xe9f0('0x8c')](_0x55bcc4,[_0xe9f0('0x92'),0x0]))return _0x5761d3;_0x5da556=[];var _0x22d878=_(_0x55bcc4)[_0xe9f0('0x35')](function(_0x29764d){if(_0x29764d[_0xe9f0('0x92')]===0x1)return;return _0x29764d[_0xe9f0('0x38')]===_0xe9f0('0x2f')?_0xe9f0('0x30'):_0xe9f0('0x32');})['compact']()[_0xe9f0('0x37')]();for(var _0x169951=0x0;_0x169951<_0x5761d3[_0xe9f0('0x4a')];_0x169951++){if(!_[_0xe9f0('0x5f')](_0x22d878,_0x5761d3[_0x169951][_0xe9f0('0x2b')]))return;var _0x34203f=_0x5761d3[_0x169951][_0xe9f0('0x2b')]===_0xe9f0('0x30')?_0xe9f0('0x2f'):_0xe9f0('0x31');_0x5da556[_0xe9f0('0x4b')](db['UserProfileResource'][_0xe9f0('0x90')]({'name':_0x5761d3[_0x169951][_0xe9f0('0x38')],'resourceId':_0x5761d3[_0x169951]['id'],'type':_0x34203f,'sectionId':_[_0xe9f0('0x36')](_0x55bcc4,[_0xe9f0('0x38'),_0x34203f])['id']},{}));}return BPromise[_0xe9f0('0x8e')](_0x5da556);});})[_0xe9f0('0x14')](respondWithResult(_0x7a0ccc,0xc9))[_0xe9f0('0x1e')](handleError(_0x7a0ccc,null));};exports[_0xe9f0('0x93')]=function(_0x5b32f2,_0x5c5ac9){if(_0x5b32f2[_0xe9f0('0x60')]['id']){delete _0x5b32f2[_0xe9f0('0x60')]['id'];}return db['User']['find']({'where':{'id':_0x5b32f2[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](function(_0x37a080){if(!_0x37a080)return null;if(_0x37a080['id']===_0x5b32f2[_0xe9f0('0x2e')]['id']){if(!_0x5b32f2[_0xe9f0('0x60')][_0xe9f0('0x94')]||!_0x5b32f2['body'][_0xe9f0('0x95')]){throw new db[(_0xe9f0('0x96'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x37a080[_0xe9f0('0x97')](_0x5b32f2[_0xe9f0('0x60')]['oldPassword'])){throw new db[(_0xe9f0('0x96'))][(_0xe9f0('0x98'))](_0xe9f0('0x99'));}if(_0x5b32f2['body'][_0xe9f0('0x94')]===_0x5b32f2[_0xe9f0('0x60')][_0xe9f0('0x95')]){throw new db[(_0xe9f0('0x96'))]['ValidationError'](_0xe9f0('0x9a'));}}else if(_0x5b32f2[_0xe9f0('0x2e')][_0xe9f0('0x2b')]==='admin'){if(!_0x5b32f2['body']['newPassword']){throw new db[(_0xe9f0('0x96'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x5b32f2[_0xe9f0('0x2e')]['role']===_0xe9f0('0x2e')){if(!_0x5b32f2[_0xe9f0('0x60')][_0xe9f0('0x95')]){throw new db[(_0xe9f0('0x96'))]['ValidationError'](_0xe9f0('0x9b'));}if(_0x37a080[_0xe9f0('0x2b')]!==_0xe9f0('0x30')){throw new db[(_0xe9f0('0x96'))][(_0xe9f0('0x98'))](_0xe9f0('0x82'));}}else{throw new db[(_0xe9f0('0x96'))][(_0xe9f0('0x98'))](_0xe9f0('0x82'));}return _0x37a080;})[_0xe9f0('0x14')](handleEntityNotFound(_0x5c5ac9,null))[_0xe9f0('0x14')](function(_0x1ceb54){return db[_0xe9f0('0x9c')]['findOne']({'attributes':['id',_0xe9f0('0x67'),_0xe9f0('0x9d'),'passwordHistoryLimit']})['then'](function(_0xec006){if(_0xec006[_0xe9f0('0x67')])authService[_0xe9f0('0x68')](_0x5b32f2[_0xe9f0('0x60')]['newPassword']);if(!_0xec006[_0xe9f0('0x9d')]||!_0x1ceb54[_0xe9f0('0x9e')])return _0x1ceb54;authService[_0xe9f0('0x9f')](_0x5b32f2['body'][_0xe9f0('0x95')],_0x1ceb54[_0xe9f0('0x9e')],_0xec006[_0xe9f0('0xa0')]);return _0x1ceb54;})[_0xe9f0('0x14')](saveUpdates({'password':_0x5b32f2[_0xe9f0('0x60')]['newPassword'],'passwordResetAt':_0x5b32f2['user']['id']==_0x5b32f2[_0xe9f0('0x55')]['id']?moment():null,'previousPasswords':authService[_0xe9f0('0xa1')](_0x5b32f2[_0xe9f0('0x60')][_0xe9f0('0x95')],_0x1ceb54[_0xe9f0('0x9e')])},null));})[_0xe9f0('0x14')](respondWithResult(_0x5c5ac9,null))[_0xe9f0('0x1e')](handleError(_0x5c5ac9,null));};exports[_0xe9f0('0xa2')]=function(_0x5ae9f1,_0x1aacfa){var _0x4eea8f=_0x5ae9f1['body'][_0xe9f0('0xa3')];return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x5ae9f1['params']['id']},'attributes':['id',_0xe9f0('0x38'),_0xe9f0('0x2b'),'online',_0xe9f0('0xa4'),_0xe9f0('0xa5'),_0xe9f0('0xa6')]})[_0xe9f0('0x14')](handleEntityNotFound(_0x1aacfa,null))['then'](function(_0x25750e){if(_0x25750e){if(!utils['isValidChannel'](_0x4eea8f)){throw new db[(_0xe9f0('0x96'))]['ValidationError']('Unknown\x20channel');}return _0x25750e['add'+_[_0xe9f0('0xa7')](_0x4eea8f[_0xe9f0('0xa8')]())+'Queues'](_0x5ae9f1[_0xe9f0('0x60')][_0xe9f0('0x63')],{'penalty':_0x5ae9f1[_0xe9f0('0x60')][_0xe9f0('0xa9')]||0x0})[_0xe9f0('0xaa')](function(_0x40306a){for(var _0x1cfb29=0x0;_0x1cfb29<_0x5ae9f1['body'][_0xe9f0('0x63')][_0xe9f0('0x4a')];_0x1cfb29+=0x1){var _0x32eb6c={'UserId':Number(_0x5ae9f1['params']['id'])};_0x32eb6c[_[_0xe9f0('0xa7')](_0x4eea8f[_0xe9f0('0xa8')]())+_0xe9f0('0xab')]=Number(_0x5ae9f1['body'][_0xe9f0('0x63')][_0x1cfb29]);socket[_0xe9f0('0xac')]('user'+_[_0xe9f0('0xa7')](_0x4eea8f['toLowerCase']())+_0xe9f0('0xad'),_0x32eb6c);}return _0x40306a;})[_0xe9f0('0x14')](function(){if(_0x4eea8f===_0xe9f0('0xae')){return db[_0xe9f0('0xaf')][_0xe9f0('0x47')]({'where':{'id':_0x5ae9f1[_0xe9f0('0x60')]['ids']||[]},'raw':!![],'attributes':['id',_0xe9f0('0x38')]});}})[_0xe9f0('0x14')](function(_0xfe329a){var _0x1684a7=_0x25750e[_0xe9f0('0x2a')]({'plain':!![]});var _0x45e390=[];if(_0x4eea8f===_0xe9f0('0xae')&&_0x1684a7['role']==='agent'&&_0x1684a7[_0xe9f0('0xb0')]){for(var _0x3e8745=0x0;_0x3e8745<_0xfe329a['length'];_0x3e8745+=0x1){_0x45e390[_0xe9f0('0x4b')]({'membername':_0x1684a7['name'],'UserId':_0x1684a7['id'],'queue_name':_0xfe329a[_0x3e8745][_0xe9f0('0x38')],'VoiceQueueId':_0xfe329a[_0x3e8745]['id'],'interface':_[_0xe9f0('0x6a')](_0x1684a7['interface'])?util['format'](_0xe9f0('0xb1'),_0x1684a7[_0xe9f0('0x38')]):_0x1684a7[_0xe9f0('0xa6')],'paused':_0x1684a7['voicePause']||![],'penalty':_0x5ae9f1['body'][_0xe9f0('0xa9')]||0x0});}return BPromise[_0xe9f0('0x8f')](_0x45e390,function(_0x249c41){return db[_0xe9f0('0xb2')][_0xe9f0('0xb3')](_0x249c41);});}return _0x25750e;});}})[_0xe9f0('0x14')](respondWithStatusCode(_0x1aacfa,null))[_0xe9f0('0x1e')](handleError(_0x1aacfa,null));};exports[_0xe9f0('0xb4')]=function(_0x2f65a6,_0x45edd9){var _0x423364;return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x2f65a6[_0xe9f0('0x55')]['id']},'attributes':['id','name',_0xe9f0('0x2b')]})['then'](handleEntityNotFound(_0x45edd9,null))[_0xe9f0('0x14')](function(_0x229e28){if(_0x229e28){_0x423364=_0x229e28;if(!_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0xa3')]||!utils[_0xe9f0('0xb5')](_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0xa3')])){throw new db[(_0xe9f0('0x96'))]['ValidationError'](_0xe9f0('0xb6'));}return _0x229e28[_0xe9f0('0xb7')+_[_0xe9f0('0xa7')](_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0xa3')][_0xe9f0('0xa8')]())+_0xe9f0('0xb8')](_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0x63')]);}})[_0xe9f0('0x14')](function(_0x896068){if(_[_0xe9f0('0xb9')](_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0x63')])){for(var _0x46705f=0x0;_0x46705f<_0x2f65a6[_0xe9f0('0x43')]['ids'][_0xe9f0('0x4a')];_0x46705f+=0x1){var _0x4a98e8={'UserId':Number(_0x2f65a6['params']['id'])};_0x4a98e8[_[_0xe9f0('0xa7')](_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0xa3')][_0xe9f0('0xa8')]())+'QueueId']=Number(_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0x63')][_0x46705f]);socket[_0xe9f0('0xac')](_0xe9f0('0x2e')+_['capitalize'](_0x2f65a6[_0xe9f0('0x43')]['channel']['toLowerCase']())+_0xe9f0('0xba'),_0x4a98e8);}}else{var _0x4a98e8={'UserId':Number(_0x2f65a6['params']['id'])};_0x4a98e8[_[_0xe9f0('0xa7')](_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0xa3')][_0xe9f0('0xa8')]())+_0xe9f0('0xab')]=Number(_0x2f65a6['query'][_0xe9f0('0x63')]);socket[_0xe9f0('0xac')]('user'+_[_0xe9f0('0xa7')](_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0xa3')][_0xe9f0('0xa8')]())+_0xe9f0('0xba'),_0x4a98e8);}return _0x896068;})[_0xe9f0('0x14')](function(){if(_0x2f65a6[_0xe9f0('0x43')][_0xe9f0('0xa3')]===_0xe9f0('0xae')){return db['UserVoiceQueueRt'][_0xe9f0('0x29')]({'where':{'UserId':_0x2f65a6[_0xe9f0('0x55')]['id'],'VoiceQueueId':_0x2f65a6['query'][_0xe9f0('0x63')]},'individualHooks':!![]})[_0xe9f0('0x14')](function(){return _0x423364;});}return _0x423364;})[_0xe9f0('0x14')](respondWithStatusCode(_0x45edd9,null))[_0xe9f0('0x1e')](handleError(_0x45edd9,null));};exports[_0xe9f0('0xbb')]=function(_0x4e7e1a,_0x54efec){_0x4e7e1a[_0xe9f0('0x60')][_0xe9f0('0xbc')]=_0x4e7e1a[_0xe9f0('0xbd')]['filename'];return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x4e7e1a[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x54efec,null))[_0xe9f0('0x14')](saveUpdates(_0x4e7e1a[_0xe9f0('0x60')],null))[_0xe9f0('0x14')](respondWithResult(_0x54efec,null))[_0xe9f0('0x1e')](handleError(_0x54efec,null));};exports[_0xe9f0('0xbe')]=function(_0x1869c1,_0x162c2e){var _0xf63dd8=path[_0xe9f0('0xbf')](config[_0xe9f0('0xc0')],_0xe9f0('0xc1'));return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x1869c1['params']['id']},'attributes':['id',_0xe9f0('0xbc')],'raw':!![]})[_0xe9f0('0x14')](handleEntityNotFound(_0x162c2e,null))[_0xe9f0('0x14')](function(_0x58fe38){if(_0x58fe38){if(_[_0xe9f0('0x6a')](_0x58fe38['userpic'])){return _0x162c2e['download'](_0xf63dd8);}else{if(!fs[_0xe9f0('0xc2')](path['join'](config[_0xe9f0('0xc0')],'server/files/images/',_0x58fe38['userpic']))){return _0x162c2e[_0xe9f0('0xc3')](_0xf63dd8);}return _0x162c2e[_0xe9f0('0xc3')](path[_0xe9f0('0xbf')](config['root'],_0xe9f0('0xc4'),_0x58fe38[_0xe9f0('0xbc')]));}}})[_0xe9f0('0x1e')](handleError(_0x162c2e,null));};exports[_0xe9f0('0xc5')]=function(_0x1646cb,_0x3957d7){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x1646cb[_0xe9f0('0x55')]['id']},'attributes':['id']})[_0xe9f0('0x14')](handleEntityNotFound(_0x3957d7,null))[_0xe9f0('0x14')](function(_0x360e00){var _0x1c925b=[];values=_0x360e00[_0xe9f0('0x4e')];_0x1c925b['push'](get_open_tabs(_0xe9f0('0x4c'),_0x360e00[_0xe9f0('0x4e')]));_0x1c925b[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x4f'),_0x360e00[_0xe9f0('0x4e')]));_0x1c925b[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x52'),_0x360e00[_0xe9f0('0x4e')]));_0x1c925b['push'](get_open_tabs(_0xe9f0('0x53'),_0x360e00['dataValues']));_0x1c925b[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x50'),_0x360e00[_0xe9f0('0x4e')]));_0x1c925b[_0xe9f0('0x4b')](get_open_tabs(_0xe9f0('0x51'),_0x360e00[_0xe9f0('0x4e')]));return BPromise[_0xe9f0('0x8e')](_0x1c925b);})['then'](function(_0x17a367){var _0x5a6222=[];if(_0x17a367){for(var _0x1de13b=0x0;_0x1de13b<values[_0xe9f0('0xc6')]['length'];_0x1de13b++){var _0x4b8d2d=values[_0xe9f0('0xc6')][_0x1de13b];_0x5a6222[_0xe9f0('0x4b')]({'channel':_0xe9f0('0xc7'),'id':_0x4b8d2d['id'],'createdAt':_0x4b8d2d[_0xe9f0('0xc8')]});}for(var _0x1de13b=0x0;_0x1de13b<values[_0xe9f0('0xc9')][_0xe9f0('0x4a')];_0x1de13b++){var _0x4b8d2d=values[_0xe9f0('0xc9')][_0x1de13b];_0x5a6222[_0xe9f0('0x4b')]({'channel':_0xe9f0('0xca'),'id':_0x4b8d2d['id'],'createdAt':_0x4b8d2d[_0xe9f0('0xc8')]});}for(var _0x1de13b=0x0;_0x1de13b<values['OpenchannelOpenTabs'][_0xe9f0('0x4a')];_0x1de13b++){var _0x4b8d2d=values['OpenchannelOpenTabs'][_0x1de13b];_0x5a6222[_0xe9f0('0x4b')]({'channel':_0xe9f0('0xcb'),'id':_0x4b8d2d['id'],'createdAt':_0x4b8d2d[_0xe9f0('0xc8')]});}for(var _0x1de13b=0x0;_0x1de13b<values['MailOpenTabs'][_0xe9f0('0x4a')];_0x1de13b++){var _0x4b8d2d=values[_0xe9f0('0xcc')][_0x1de13b];_0x5a6222[_0xe9f0('0x4b')]({'channel':_0xe9f0('0xcd'),'id':_0x4b8d2d['id'],'createdAt':_0x4b8d2d['createdAt']});}for(var _0x1de13b=0x0;_0x1de13b<values[_0xe9f0('0xce')]['length'];_0x1de13b++){var _0x4b8d2d=values['SmsOpenTabs'][_0x1de13b];_0x5a6222[_0xe9f0('0x4b')]({'channel':_0xe9f0('0xcf'),'id':_0x4b8d2d['id'],'createdAt':_0x4b8d2d[_0xe9f0('0xc8')]});}for(var _0x1de13b=0x0;_0x1de13b<values[_0xe9f0('0xd0')][_0xe9f0('0x4a')];_0x1de13b++){var _0x4b8d2d=values[_0xe9f0('0xd0')][_0x1de13b];_0x5a6222[_0xe9f0('0x4b')]({'channel':_0xe9f0('0xd1'),'id':_0x4b8d2d['id'],'createdAt':_0x4b8d2d['createdAt']});}var _0xa1d44b={'count':_0x5a6222['length'],'rows':_0x5a6222};return _0xa1d44b;}else return null;})[_0xe9f0('0x14')](respondWithResult(_0x3957d7,null))[_0xe9f0('0x1e')](handleError(_0x3957d7,null));};exports['getContacts']=function(_0x490d6e,_0x4ebfcc){var _0x2b3bde={};var _0x316e88={};var _0x325708;var _0x6e7cd9;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x490d6e[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x4ebfcc,null))[_0xe9f0('0x14')](function(_0x5a2191){if(_0x5a2191){_0x325708=_0x5a2191;_0x316e88['model']=_[_0xe9f0('0x58')](db['CmContact'][_0xe9f0('0x3d')]);_0x316e88[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x490d6e[_0xe9f0('0x43')]);_0x316e88[_0xe9f0('0x5a')]=_['intersection'](_0x316e88[_0xe9f0('0x56')],_0x316e88[_0xe9f0('0x43')]);_0x2b3bde[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x316e88[_0xe9f0('0x56')],qs['fields'](_0x490d6e[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x2b3bde['attributes']=_0x2b3bde[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x2b3bde[_0xe9f0('0x46')]:_0x316e88['model'];_0x2b3bde['order']=qs[_0xe9f0('0xd3')](_0x490d6e[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x2b3bde['where']=qs['filters'](_[_0xe9f0('0xd4')](_0x490d6e[_0xe9f0('0x43')],_0x316e88[_0xe9f0('0x5a')]));if(_0x490d6e['query'][_0xe9f0('0x33')]){_0x2b3bde[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x2b3bde[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0x2b3bde[_0xe9f0('0x46')],function(_0x4bc973){var _0x218ee5={};_0x218ee5[_0x4bc973]={'$like':'%'+_0x490d6e[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x218ee5;})});}_0x2b3bde=_[_0xe9f0('0x5d')]({},_0x2b3bde,_0x490d6e[_0xe9f0('0x5e')]);return _0x325708[_0xe9f0('0xd5')](_0x2b3bde);}})[_0xe9f0('0x14')](function(_0xd2a575){if(_0xd2a575){_0x6e7cd9=_0xd2a575[_0xe9f0('0x4a')];if(_0x490d6e[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0x44'))){_0x2b3bde[_0xe9f0('0x45')]=[{'model':db[_0xe9f0('0xd7')],'as':_0xe9f0('0xd8'),'required':![]},{'model':db[_0xe9f0('0xd9')],'as':_0xe9f0('0xda'),'attributes':['id','name','color'],'where':_0x490d6e['query'][_0xe9f0('0xdb')]?{'id':_0x490d6e[_0xe9f0('0x43')]['tag']}:undefined,'required':_0x490d6e[_0xe9f0('0x43')]['tag']?!![]:![]}];}if(!_0x490d6e[_0xe9f0('0x43')][_0xe9f0('0xd6')]('nolimit')){_0x2b3bde[_0xe9f0('0x24')]=qs['limit'](_0x490d6e[_0xe9f0('0x43')]['limit']);_0x2b3bde['offset']=qs[_0xe9f0('0x22')](_0x490d6e[_0xe9f0('0x43')]['offset']);}return _0x325708[_0xe9f0('0xd5')](_0x2b3bde);}})[_0xe9f0('0x14')](function(_0x12df00){if(_0x12df00){return _0x12df00?{'count':_0x6e7cd9,'rows':_0x12df00}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x4ebfcc,null))[_0xe9f0('0x1e')](handleError(_0x4ebfcc,null));};exports[_0xe9f0('0xdc')]=function(_0x4e13b6,_0x34edd6){var _0x77d071;var _0x1ed935;var _0xa22b5={};var _0x5ef897;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x4e13b6[_0xe9f0('0x55')]['id']},'attributes':['id',_0xe9f0('0x38'),_0xe9f0('0x2b')]})[_0xe9f0('0x14')](handleEntityNotFound(_0x34edd6,null))[_0xe9f0('0x14')](function(_0xba5824){if(!utils[_0xe9f0('0xb5')](_0x4e13b6[_0xe9f0('0x43')][_0xe9f0('0xa3')])){throw new db[(_0xe9f0('0x96'))]['ValidationError'](_0xe9f0('0xb6'));}_0x77d071=_0xba5824;var _0x32fceb={};_0x32fceb[_0xe9f0('0x56')]=_['keys'](db[_[_0xe9f0('0xa7')](_0x4e13b6[_0xe9f0('0x43')]['channel'])+_0xe9f0('0xdd')][_0xe9f0('0x3d')]);_0x32fceb[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x4e13b6[_0xe9f0('0x43')]);_0x32fceb[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x32fceb['model'],_0x32fceb['query']);_0xa22b5[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x32fceb[_0xe9f0('0x56')],qs['fields'](_0x4e13b6[_0xe9f0('0x43')]['fields']));_0xa22b5['attributes']=_0xa22b5[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0xa22b5['attributes']:_0x32fceb[_0xe9f0('0x56')];_0xa22b5[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x4e13b6[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0xa22b5[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x4e13b6[_0xe9f0('0x43')],_0x32fceb[_0xe9f0('0x5a')]));if(_0x4e13b6[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0xa22b5[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0xa22b5[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0xa22b5['attributes'],function(_0x59d73f){var _0x1e8c61={};_0x1e8c61[_0x59d73f]={'$like':'%'+_0x4e13b6[_0xe9f0('0x43')]['filter']+'%'};return _0x1e8c61;})});}_0xa22b5=_[_0xe9f0('0x5d')]({},_0xa22b5,_0x4e13b6['options']);switch(_0x77d071[_0xe9f0('0x2b')]){case _0xe9f0('0x2c'):return db[_[_0xe9f0('0xa7')](_0x4e13b6['query'][_0xe9f0('0xa3')])+'Queue'][_0xe9f0('0x47')](_0xa22b5);case _0xe9f0('0x2e'):case _0xe9f0('0x30'):return _0x77d071[_0xe9f0('0x2a')+_[_0xe9f0('0xa7')](_0x4e13b6[_0xe9f0('0x43')][_0xe9f0('0xa3')])+'Queues'](_0xa22b5);default:throw new db['Sequelize'][(_0xe9f0('0x98'))](_0xe9f0('0xdf'));}})['then'](function(_0x40d436){_0x5ef897=_0x40d436['length'];if(!_0x4e13b6[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0xa22b5[_0xe9f0('0x24')]=qs['limit'](_0x4e13b6[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0xa22b5[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x4e13b6[_0xe9f0('0x43')][_0xe9f0('0x22')]);}switch(_0x77d071[_0xe9f0('0x2b')]){case _0xe9f0('0x2c'):return db[_['capitalize'](_0x4e13b6['query'][_0xe9f0('0xa3')])+_0xe9f0('0xdd')][_0xe9f0('0x47')](_0xa22b5);case _0xe9f0('0x2e'):case'agent':return _0x77d071[_0xe9f0('0x2a')+_[_0xe9f0('0xa7')](_0x4e13b6[_0xe9f0('0x43')]['channel'])+_0xe9f0('0xb8')](_0xa22b5);}})[_0xe9f0('0x14')](function(_0x4e674e){return{'count':_0x5ef897,'rows':_0x4e674e};})[_0xe9f0('0x14')](respondWithResult(_0x34edd6,null))[_0xe9f0('0x1e')](handleError(_0x34edd6,null));};exports[_0xe9f0('0xe1')]=function(_0x3e4912,_0x1ee162){var _0x344755={};var _0x591b59={};var _0x242895;var _0x7b4b1;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x3e4912['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x1ee162,null))['then'](function(_0x1ad83c){if(_0x1ad83c){_0x242895=_0x1ad83c;_0x591b59[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db[_0xe9f0('0xb2')][_0xe9f0('0x3d')]);_0x591b59[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x3e4912[_0xe9f0('0x43')]);_0x591b59['filters']=_[_0xe9f0('0x5b')](_0x591b59[_0xe9f0('0x56')],_0x591b59[_0xe9f0('0x43')]);_0x344755[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x591b59['model'],qs[_0xe9f0('0x5c')](_0x3e4912[_0xe9f0('0x43')]['fields']));_0x344755[_0xe9f0('0x46')]=_0x344755[_0xe9f0('0x46')]['length']?_0x344755[_0xe9f0('0x46')]:_0x591b59[_0xe9f0('0x56')];_0x344755['order']=qs[_0xe9f0('0xd3')](_0x3e4912[_0xe9f0('0x43')]['sort']);_0x344755['where']=qs['filters'](_['pick'](_0x3e4912['query'],_0x591b59[_0xe9f0('0x5a')]));if(_0x3e4912[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x344755['where']=_[_0xe9f0('0x5d')](_0x344755[_0xe9f0('0x41')],{'$or':_['map'](_0x344755[_0xe9f0('0x46')],function(_0x16b798){var _0x149cc2={};_0x149cc2[_0x16b798]={'$like':'%'+_0x3e4912[_0xe9f0('0x43')]['filter']+'%'};return _0x149cc2;})});}_0x344755=_['merge']({},_0x344755,_0x3e4912['options']);return _0x242895[_0xe9f0('0xe1')](_0x344755);}})['then'](function(_0x35a944){if(_0x35a944){_0x7b4b1=_0x35a944['length'];if(!_0x3e4912['query'][_0xe9f0('0xd6')]('nolimit')){_0x344755[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x3e4912[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x344755['offset']=qs[_0xe9f0('0x22')](_0x3e4912['query'][_0xe9f0('0x22')]);}return _0x242895[_0xe9f0('0xe1')](_0x344755);}})[_0xe9f0('0x14')](function(_0x591513){if(_0x591513){return _0x591513?{'count':_0x7b4b1,'rows':_0x591513}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x1ee162,null))[_0xe9f0('0x1e')](handleError(_0x1ee162,null));};exports[_0xe9f0('0xe2')]=function(_0x562b95,_0x53ad49){var _0x257fc2={};var _0x58c366={};var _0x306620;var _0x51614c;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x562b95[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x53ad49,null))[_0xe9f0('0x14')](function(_0x3db1f8){if(_0x3db1f8){_0x306620=_0x3db1f8;_0x58c366[_0xe9f0('0x56')]=_['keys'](db[_0xe9f0('0xe3')]['rawAttributes']);_0x58c366[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x562b95[_0xe9f0('0x43')]);_0x58c366[_0xe9f0('0x5a')]=_['intersection'](_0x58c366[_0xe9f0('0x56')],_0x58c366[_0xe9f0('0x43')]);_0x257fc2[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x58c366[_0xe9f0('0x56')],qs['fields'](_0x562b95[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x257fc2[_0xe9f0('0x46')]=_0x257fc2[_0xe9f0('0x46')]['length']?_0x257fc2[_0xe9f0('0x46')]:_0x58c366[_0xe9f0('0x56')];_0x257fc2[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x562b95[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x257fc2[_0xe9f0('0x41')]=qs['filters'](_[_0xe9f0('0xd4')](_0x562b95[_0xe9f0('0x43')],_0x58c366[_0xe9f0('0x5a')]));if(_0x562b95[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x257fc2[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x257fc2[_0xe9f0('0x41')],{'$or':_['map'](_0x257fc2[_0xe9f0('0x46')],function(_0x400ed1){var _0x576f20={};_0x576f20[_0x400ed1]={'$like':'%'+_0x562b95[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x576f20;})});}_0x257fc2=_[_0xe9f0('0x5d')]({},_0x257fc2,_0x562b95['options']);return _0x306620['getGroups'](_0x257fc2);}})[_0xe9f0('0x14')](function(_0x58acdd){if(_0x58acdd){_0x51614c=_0x58acdd[_0xe9f0('0x4a')];if(!_0x562b95[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x257fc2['limit']=qs[_0xe9f0('0x24')](_0x562b95['query']['limit']);_0x257fc2[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x562b95[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x306620[_0xe9f0('0xe2')](_0x257fc2);}})[_0xe9f0('0x14')](function(_0x4e3d20){if(_0x4e3d20){return _0x4e3d20?{'count':_0x51614c,'rows':_0x4e3d20}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x53ad49,null))['catch'](handleError(_0x53ad49,null));};exports[_0xe9f0('0xe4')]=function(_0x2ff309,_0x193cb2){var _0x3cb18a={'raw':!![],'where':{}};var _0x5afb5c={};var _0x3ab841={'count':0x0,'rows':[]};return db[_0xe9f0('0x42')]['findOne']({'where':{'id':_0x2ff309[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x193cb2,null))[_0xe9f0('0x14')](function(_0x58a314){if(_0x58a314){_0x5afb5c['model']=_['keys'](db[_0xe9f0('0xe5')][_0xe9f0('0x3d')]);_0x5afb5c['query']=_[_0xe9f0('0x58')](_0x2ff309[_0xe9f0('0x43')]);_0x5afb5c[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x5afb5c[_0xe9f0('0x56')],_0x5afb5c[_0xe9f0('0x43')]);_0x3cb18a[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x5afb5c['model'],qs[_0xe9f0('0x5c')](_0x2ff309[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x3cb18a[_0xe9f0('0x46')]=_0x3cb18a[_0xe9f0('0x46')]['length']?_0x3cb18a[_0xe9f0('0x46')]:_0x5afb5c['model'];if(!_0x2ff309[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x3cb18a[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x2ff309['query'][_0xe9f0('0x24')]);_0x3cb18a[_0xe9f0('0x22')]=qs['offset'](_0x2ff309[_0xe9f0('0x43')][_0xe9f0('0x22')]);}_0x3cb18a['order']=qs[_0xe9f0('0xd3')](_0x2ff309[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x3cb18a[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x2ff309[_0xe9f0('0x43')],_0x5afb5c[_0xe9f0('0x5a')]));_0x3cb18a[_0xe9f0('0x41')]['UserId']=_0x58a314['id'];if(_0x2ff309[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x3cb18a[_0xe9f0('0x41')]=_['merge'](_0x3cb18a['where'],{'$or':_[_0xe9f0('0x35')](_0x3cb18a[_0xe9f0('0x46')],function(_0x5cab9d){var _0x3a6e4e={};_0x3a6e4e[_0x5cab9d]={'$like':'%'+_0x2ff309['query']['filter']+'%'};return _0x3a6e4e;})});}_0x3cb18a=_['merge']({},_0x3cb18a,_0x2ff309['options']);return db[_0xe9f0('0xe5')][_0xe9f0('0x25')]({'where':_0x3cb18a['where']})[_0xe9f0('0x14')](function(_0x3fe6ea){_0x3ab841['count']=_0x3fe6ea;if(_0x2ff309[_0xe9f0('0x43')][_0xe9f0('0x44')]){_0x3cb18a['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xe9f0('0x47')](_0x3cb18a);})['then'](function(_0x27f0d9){_0x3ab841[_0xe9f0('0x4d')]=_0x27f0d9;return _0x3ab841;});}})[_0xe9f0('0x14')](respondWithFilteredResult(_0x193cb2,_0x3cb18a))[_0xe9f0('0x1e')](handleError(_0x193cb2,null));};exports['getScreenRecordings']=function(_0x484e2d,_0xa27b3c){var _0x17ee38={'raw':!![],'where':{}};var _0x3233f5={};var _0x1cf653={'count':0x0,'rows':[]};return db['User'][_0xe9f0('0xd2')]({'where':{'id':_0x484e2d['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0xa27b3c,null))[_0xe9f0('0x14')](function(_0x2e2fb9){if(_0x2e2fb9){_0x3233f5['model']=_[_0xe9f0('0x58')](db[_0xe9f0('0xe6')]['rawAttributes']);_0x3233f5['query']=_[_0xe9f0('0x58')](_0x484e2d['query']);_0x3233f5['filters']=_[_0xe9f0('0x5b')](_0x3233f5['model'],_0x3233f5[_0xe9f0('0x43')]);_0x17ee38[_0xe9f0('0x46')]=_['intersection'](_0x3233f5[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x484e2d[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x17ee38[_0xe9f0('0x46')]=_0x17ee38[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x17ee38[_0xe9f0('0x46')]:_0x3233f5[_0xe9f0('0x56')];if(!_0x484e2d['query']['hasOwnProperty']('nolimit')){_0x17ee38[_0xe9f0('0x24')]=qs['limit'](_0x484e2d['query']['limit']);_0x17ee38[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x484e2d[_0xe9f0('0x43')][_0xe9f0('0x22')]);}_0x17ee38[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x484e2d[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x17ee38[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x484e2d['query'],_0x3233f5[_0xe9f0('0x5a')]));_0x17ee38[_0xe9f0('0x41')][_0xe9f0('0xe7')]=_0x2e2fb9['id'];if(_0x484e2d[_0xe9f0('0x43')]['filter']){_0x17ee38['where']=_[_0xe9f0('0x5d')](_0x17ee38['where'],{'$or':_['map'](_0x17ee38[_0xe9f0('0x46')],function(_0x32c83c){var _0x5d094c={};_0x5d094c[_0x32c83c]={'$like':'%'+_0x484e2d[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x5d094c;})});}_0x17ee38=_['merge']({},_0x17ee38,_0x484e2d['options']);return db[_0xe9f0('0xe6')]['count']({'where':_0x17ee38[_0xe9f0('0x41')]})[_0xe9f0('0x14')](function(_0x56389c){_0x1cf653[_0xe9f0('0x25')]=_0x56389c;if(_0x484e2d[_0xe9f0('0x43')][_0xe9f0('0x44')]){_0x17ee38[_0xe9f0('0x45')]=[{'all':!![]}];}return db[_0xe9f0('0xe6')][_0xe9f0('0x47')](_0x17ee38);})[_0xe9f0('0x14')](function(_0x531e4f){_0x1cf653['rows']=_0x531e4f;return _0x1cf653;});}})['then'](respondWithFilteredResult(_0xa27b3c,_0x17ee38))[_0xe9f0('0x1e')](handleError(_0xa27b3c,null));};exports[_0xe9f0('0xe8')]=function(_0x5b50c5,_0x5f55f8){var _0xecf079={};var _0x11897a={};var _0x2c2e0c;var _0x506e4f;return db['User']['findOne']({'where':{'id':_0x5b50c5[_0xe9f0('0x55')]['id']}})['then'](handleEntityNotFound(_0x5f55f8,null))[_0xe9f0('0x14')](function(_0x2ec29e){if(_0x2ec29e){_0x2c2e0c=_0x2ec29e;_0x11897a['model']=_[_0xe9f0('0x58')](db['ChatInteraction']['rawAttributes']);_0x11897a[_0xe9f0('0x43')]=_['keys'](_0x5b50c5['query']);_0x11897a[_0xe9f0('0x5a')]=_['intersection'](_0x11897a[_0xe9f0('0x56')],_0x11897a[_0xe9f0('0x43')]);_0xecf079[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x11897a[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x5b50c5['query'][_0xe9f0('0x5c')]));_0xecf079[_0xe9f0('0x46')]=_0xecf079[_0xe9f0('0x46')]['length']?_0xecf079[_0xe9f0('0x46')]:_0x11897a['model'];_0xecf079['order']=qs[_0xe9f0('0xd3')](_0x5b50c5[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0xecf079[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x5b50c5[_0xe9f0('0x43')],_0x11897a[_0xe9f0('0x5a')]));if(_0x5b50c5[_0xe9f0('0x43')]['filter']){_0xecf079['where']=_[_0xe9f0('0x5d')](_0xecf079[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0xecf079[_0xe9f0('0x46')],function(_0x330367){var _0x2000d0={};_0x2000d0[_0x330367]={'$like':'%'+_0x5b50c5['query'][_0xe9f0('0x33')]+'%'};return _0x2000d0;})});}_0xecf079=_['merge']({},_0xecf079,_0x5b50c5[_0xe9f0('0x5e')]);return _0x2c2e0c[_0xe9f0('0xe8')](_0xecf079);}})[_0xe9f0('0x14')](function(_0xb366e){if(_0xb366e){_0x506e4f=_0xb366e[_0xe9f0('0x4a')];if(!_0x5b50c5['query'][_0xe9f0('0xd6')]('nolimit')){_0xecf079['limit']=qs[_0xe9f0('0x24')](_0x5b50c5[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0xecf079['offset']=qs[_0xe9f0('0x22')](_0x5b50c5['query'][_0xe9f0('0x22')]);}return _0x2c2e0c[_0xe9f0('0xe8')](_0xecf079);}})[_0xe9f0('0x14')](function(_0x15fd9c){if(_0x15fd9c){return _0x15fd9c?{'count':_0x506e4f,'rows':_0x15fd9c}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x5f55f8,null))[_0xe9f0('0x1e')](handleError(_0x5f55f8,null));};exports[_0xe9f0('0xe9')]=function(_0x28dd42,_0x17cee5){var _0x31c39f={};var _0x3a3949={};var _0x5e77f5;var _0x36b491;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x28dd42[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x17cee5,null))[_0xe9f0('0x14')](function(_0x2f036a){if(_0x2f036a){_0x5e77f5=_0x2f036a;_0x3a3949[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db['OpenchannelInteraction']['rawAttributes']);_0x3a3949[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x28dd42[_0xe9f0('0x43')]);_0x3a3949[_0xe9f0('0x5a')]=_['intersection'](_0x3a3949[_0xe9f0('0x56')],_0x3a3949[_0xe9f0('0x43')]);_0x31c39f['attributes']=_[_0xe9f0('0x5b')](_0x3a3949[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x28dd42[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x31c39f[_0xe9f0('0x46')]=_0x31c39f['attributes'][_0xe9f0('0x4a')]?_0x31c39f[_0xe9f0('0x46')]:_0x3a3949[_0xe9f0('0x56')];_0x31c39f[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x28dd42['query']['sort']);_0x31c39f[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x28dd42[_0xe9f0('0x43')],_0x3a3949[_0xe9f0('0x5a')]));if(_0x28dd42[_0xe9f0('0x43')]['filter']){_0x31c39f[_0xe9f0('0x41')]=_['merge'](_0x31c39f[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0x31c39f[_0xe9f0('0x46')],function(_0x39e37e){var _0x3bad57={};_0x3bad57[_0x39e37e]={'$like':'%'+_0x28dd42[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x3bad57;})});}_0x31c39f=_[_0xe9f0('0x5d')]({},_0x31c39f,_0x28dd42[_0xe9f0('0x5e')]);return _0x5e77f5[_0xe9f0('0xe9')](_0x31c39f);}})[_0xe9f0('0x14')](function(_0x10d035){if(_0x10d035){_0x36b491=_0x10d035[_0xe9f0('0x4a')];if(!_0x28dd42[_0xe9f0('0x43')]['hasOwnProperty'](_0xe9f0('0xe0'))){_0x31c39f[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x28dd42[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x31c39f[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x28dd42[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x5e77f5[_0xe9f0('0xe9')](_0x31c39f);}})[_0xe9f0('0x14')](function(_0x4cfaa0){if(_0x4cfaa0){return _0x4cfaa0?{'count':_0x36b491,'rows':_0x4cfaa0}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x17cee5,null))[_0xe9f0('0x1e')](handleError(_0x17cee5,null));};exports[_0xe9f0('0xea')]=function(_0x47537d,_0x3b3117){var _0x5e2adc={'raw':!![],'where':{}};var _0x398c4a={};var _0x29982b={'count':0x0,'rows':[]};return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x47537d['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x3b3117,null))[_0xe9f0('0x14')](function(_0x5b5004){if(_0x5b5004){_0x398c4a[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db[_0xe9f0('0xeb')]['rawAttributes']);_0x398c4a[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x47537d[_0xe9f0('0x43')]);_0x398c4a[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x398c4a[_0xe9f0('0x56')],_0x398c4a[_0xe9f0('0x43')]);_0x5e2adc[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x398c4a[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x47537d['query']['fields']));_0x5e2adc[_0xe9f0('0x46')]=_0x5e2adc[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x5e2adc[_0xe9f0('0x46')]:_0x398c4a[_0xe9f0('0x56')];if(!_0x47537d[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x5e2adc[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x47537d[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x5e2adc[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x47537d[_0xe9f0('0x43')][_0xe9f0('0x22')]);}_0x5e2adc[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x47537d['query'][_0xe9f0('0xd3')]);_0x5e2adc[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x47537d[_0xe9f0('0x43')],_0x398c4a[_0xe9f0('0x5a')]));_0x5e2adc[_0xe9f0('0x41')][_0xe9f0('0xe7')]=_0x5b5004['id'];if(_0x47537d[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x5e2adc[_0xe9f0('0x41')]=_['merge'](_0x5e2adc['where'],{'$or':_[_0xe9f0('0x35')](_0x5e2adc[_0xe9f0('0x46')],function(_0x49b411){var _0x444377={};_0x444377[_0x49b411]={'$like':'%'+_0x47537d['query']['filter']+'%'};return _0x444377;})});}_0x5e2adc=_[_0xe9f0('0x5d')]({},_0x5e2adc,_0x47537d[_0xe9f0('0x5e')]);return db[_0xe9f0('0xeb')][_0xe9f0('0x25')]({'where':_0x5e2adc[_0xe9f0('0x41')]})[_0xe9f0('0x14')](function(_0x413808){_0x29982b[_0xe9f0('0x25')]=_0x413808;if(_0x47537d['query'][_0xe9f0('0x44')]){_0x5e2adc[_0xe9f0('0x45')]=[{'all':!![]}];}return db[_0xe9f0('0xeb')][_0xe9f0('0x47')](_0x5e2adc);})[_0xe9f0('0x14')](function(_0x45e657){_0x29982b[_0xe9f0('0x4d')]=_0x45e657;return _0x29982b;});}})[_0xe9f0('0x14')](respondWithFilteredResult(_0x3b3117,_0x5e2adc))[_0xe9f0('0x1e')](handleError(_0x3b3117,null));};exports[_0xe9f0('0xec')]=function(_0x31a31e,_0xb4687b){var _0x1d3e63={};var _0xf0dfda={};var _0x145808;var _0x2e1ee5;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x31a31e[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0xb4687b,null))['then'](function(_0x2ec00f){if(_0x2ec00f){_0x145808=_0x2ec00f;_0xf0dfda['model']=_[_0xe9f0('0x58')](db[_0xe9f0('0xed')][_0xe9f0('0x3d')]);_0xf0dfda['query']=_[_0xe9f0('0x58')](_0x31a31e[_0xe9f0('0x43')]);_0xf0dfda[_0xe9f0('0x5a')]=_['intersection'](_0xf0dfda[_0xe9f0('0x56')],_0xf0dfda[_0xe9f0('0x43')]);_0x1d3e63['attributes']=_['intersection'](_0xf0dfda['model'],qs[_0xe9f0('0x5c')](_0x31a31e[_0xe9f0('0x43')]['fields']));_0x1d3e63['attributes']=_0x1d3e63[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x1d3e63[_0xe9f0('0x46')]:_0xf0dfda[_0xe9f0('0x56')];_0x1d3e63[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x31a31e[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x1d3e63[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x31a31e[_0xe9f0('0x43')],_0xf0dfda[_0xe9f0('0x5a')]));if(_0x31a31e[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x1d3e63['where']=_['merge'](_0x1d3e63[_0xe9f0('0x41')],{'$or':_['map'](_0x1d3e63[_0xe9f0('0x46')],function(_0x3930ac){var _0x621209={};_0x621209[_0x3930ac]={'$like':'%'+_0x31a31e[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x621209;})});}_0x1d3e63=_['merge']({},_0x1d3e63,_0x31a31e[_0xe9f0('0x5e')]);return _0x145808[_0xe9f0('0xec')](_0x1d3e63);}})['then'](function(_0x5029d0){if(_0x5029d0){_0x2e1ee5=_0x5029d0[_0xe9f0('0x4a')];if(!_0x31a31e['query']['hasOwnProperty'](_0xe9f0('0xe0'))){_0x1d3e63[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x31a31e[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x1d3e63[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x31a31e['query'][_0xe9f0('0x22')]);}return _0x145808[_0xe9f0('0xec')](_0x1d3e63);}})[_0xe9f0('0x14')](function(_0x22d847){if(_0x22d847){return _0x22d847?{'count':_0x2e1ee5,'rows':_0x22d847}:null;}})[_0xe9f0('0x14')](respondWithResult(_0xb4687b,null))['catch'](handleError(_0xb4687b,null));};exports[_0xe9f0('0xee')]=function(_0x447856,_0x1e5045){var _0x257745={};var _0x1f29bd={};var _0x30351c;var _0x2274f7;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x447856[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x1e5045,null))[_0xe9f0('0x14')](function(_0x1ab82f){if(_0x1ab82f){_0x30351c=_0x1ab82f;_0x1f29bd[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db['FaxInteraction'][_0xe9f0('0x3d')]);_0x1f29bd[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x447856['query']);_0x1f29bd[_0xe9f0('0x5a')]=_['intersection'](_0x1f29bd[_0xe9f0('0x56')],_0x1f29bd[_0xe9f0('0x43')]);_0x257745[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x1f29bd['model'],qs[_0xe9f0('0x5c')](_0x447856[_0xe9f0('0x43')]['fields']));_0x257745['attributes']=_0x257745[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x257745['attributes']:_0x1f29bd[_0xe9f0('0x56')];_0x257745['order']=qs[_0xe9f0('0xd3')](_0x447856[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x257745['where']=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x447856[_0xe9f0('0x43')],_0x1f29bd[_0xe9f0('0x5a')]));if(_0x447856[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x257745[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x257745[_0xe9f0('0x41')],{'$or':_['map'](_0x257745[_0xe9f0('0x46')],function(_0x2c4d7f){var _0x5167d4={};_0x5167d4[_0x2c4d7f]={'$like':'%'+_0x447856[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x5167d4;})});}_0x257745=_[_0xe9f0('0x5d')]({},_0x257745,_0x447856[_0xe9f0('0x5e')]);return _0x30351c[_0xe9f0('0xee')](_0x257745);}})[_0xe9f0('0x14')](function(_0x6d9bd){if(_0x6d9bd){_0x2274f7=_0x6d9bd['length'];if(!_0x447856[_0xe9f0('0x43')]['hasOwnProperty']('nolimit')){_0x257745[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x447856[_0xe9f0('0x43')]['limit']);_0x257745[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x447856[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x30351c['getFaxInteractions'](_0x257745);}})[_0xe9f0('0x14')](function(_0x14139d){if(_0x14139d){return _0x14139d?{'count':_0x2274f7,'rows':_0x14139d}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x1e5045,null))[_0xe9f0('0x1e')](handleError(_0x1e5045,null));};exports[_0xe9f0('0xef')]=function(_0x15cca0,_0x52111c){var _0x12e508={};var _0x184c77={};var _0x4f4443;var _0x5c3817;return db[_0xe9f0('0x42')]['findOne']({'where':{'id':_0x15cca0['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x52111c,null))[_0xe9f0('0x14')](function(_0x47295d){if(_0x47295d){_0x4f4443=_0x47295d;_0x184c77['model']=_['keys'](db[_0xe9f0('0xf0')][_0xe9f0('0x3d')]);_0x184c77['query']=_[_0xe9f0('0x58')](_0x15cca0[_0xe9f0('0x43')]);_0x184c77[_0xe9f0('0x5a')]=_['intersection'](_0x184c77[_0xe9f0('0x56')],_0x184c77[_0xe9f0('0x43')]);_0x12e508['attributes']=_[_0xe9f0('0x5b')](_0x184c77[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x15cca0[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x12e508['attributes']=_0x12e508[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x12e508[_0xe9f0('0x46')]:_0x184c77[_0xe9f0('0x56')];_0x12e508[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x15cca0[_0xe9f0('0x43')]['sort']);_0x12e508['where']=qs['filters'](_[_0xe9f0('0xd4')](_0x15cca0['query'],_0x184c77[_0xe9f0('0x5a')]));if(_0x15cca0['query'][_0xe9f0('0x33')]){_0x12e508[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x12e508['where'],{'$or':_[_0xe9f0('0x35')](_0x12e508[_0xe9f0('0x46')],function(_0x2c8f67){var _0x27746c={};_0x27746c[_0x2c8f67]={'$like':'%'+_0x15cca0[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x27746c;})});}_0x12e508=_[_0xe9f0('0x5d')]({},_0x12e508,_0x15cca0[_0xe9f0('0x5e')]);return _0x4f4443[_0xe9f0('0xef')](_0x12e508);}})[_0xe9f0('0x14')](function(_0x14d906){if(_0x14d906){_0x5c3817=_0x14d906[_0xe9f0('0x4a')];if(!_0x15cca0[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x12e508[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x15cca0[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x12e508[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x15cca0['query']['offset']);}return _0x4f4443[_0xe9f0('0xef')](_0x12e508);}})[_0xe9f0('0x14')](function(_0x15fe35){if(_0x15fe35){return _0x15fe35?{'count':_0x5c3817,'rows':_0x15fe35}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x52111c,null))['catch'](handleError(_0x52111c,null));};exports[_0xe9f0('0xf1')]=function(_0x519179,_0x545b75,_0xab8d50){var _0x346b16;var _0xc0e487;var _0x268a6b;var _0x8bdc85=!_[_0xe9f0('0x6a')](_0x519179[_0xe9f0('0x55')]['id'])?_0x519179[_0xe9f0('0x55')]['id']:!_[_0xe9f0('0x6a')](_0x519179['user']['id'])?_0x519179[_0xe9f0('0x2e')]['id']:null;return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x8bdc85,'role':{'$or':[_0xe9f0('0x2c'),_0xe9f0('0x2e'),'agent']}},'attributes':['id','name',_0xe9f0('0xf2'),'mobile','role',_0xe9f0('0x65'),'loginInPause']})['then'](function(_0x15f8c1){if(_0x15f8c1){if(_0x15f8c1[_0xe9f0('0x2b')]===_0xe9f0('0x30')){_0x346b16=_0x15f8c1;if(_0x519179['body'][_0xe9f0('0xa6')]){_0x268a6b=util['format'](_0xe9f0('0xf3'),_0x346b16[_0x519179[_0xe9f0('0x60')]['interface']]);}else if(_0x519179[_0xe9f0('0x60')]['intrf']){_0x268a6b=util[_0xe9f0('0xf4')]('SIP/%s',_0x519179[_0xe9f0('0x60')][_0xe9f0('0xf5')]);}else{_0x268a6b=util[_0xe9f0('0xf4')]('SIP/%s',_0x346b16[_0xe9f0('0x38')]);}socket['to'](util['format'](_0xe9f0('0xf6'),_0x346b16[_0xe9f0('0x38')]))['emit'](_0xe9f0('0xf7'),{'user':{'id':_0x346b16['id'],'name':_0x346b16['name']},'ip':_0x519179[_0xe9f0('0xf8')]['x-forwarded-for']||_0x519179['connection']['remoteAddress']||_0x519179[_0xe9f0('0xf9')][_0xe9f0('0xfa')]||_0x519179[_0xe9f0('0xfb')][_0xe9f0('0xf9')]['remoteAddress']});return db[_0xe9f0('0xb2')][_0xe9f0('0x29')]({'where':{'membername':_0x346b16['name']},'individualHooks':!![]});}}else{throw new db[(_0xe9f0('0x96'))]['ValidationError'](_0xe9f0('0xfc'));}})['then'](function(){if(_0x346b16){return _0x346b16['getVoiceQueues']({'raw':!![]});}})[_0xe9f0('0x14')](function(_0x518f57){if(_0x346b16){var _0x4e40e5=[];if(_0x518f57){_0xc0e487=_0x518f57;if(_0xc0e487['length']){for(var _0x51e1d4=0x0;_0x51e1d4<_0xc0e487[_0xe9f0('0x4a')];_0x51e1d4++){_0x4e40e5[_0xe9f0('0x4b')]({'membername':_0x346b16[_0xe9f0('0x38')],'UserId':_0x346b16['id'],'queue_name':_0xc0e487[_0x51e1d4][_0xe9f0('0x38')],'VoiceQueueId':_0xc0e487[_0x51e1d4]['id'],'interface':_0x268a6b,'paused':_0x346b16[_0xe9f0('0xa4')]||![],'penalty':_0xc0e487[_0x51e1d4][_0xe9f0('0xfd')]||0x0});}return BPromise['each'](_0x4e40e5,function(_0x3efa36){return db[_0xe9f0('0xb2')][_0xe9f0('0xb3')](_0x3efa36);});}}}})[_0xe9f0('0x14')](function(){if(_0x346b16){return db['MemberReport'][_0xe9f0('0x47')]({'where':{'membername':_0x346b16[_0xe9f0('0x38')],'exitAt':null}});}})['then'](function(_0x490bc4){if(_0x346b16){var _0x47c5e6=[];_0x490bc4['forEach'](function(_0x3fc6c7){_0x47c5e6[_0xe9f0('0x4b')](_0x3fc6c7[_0xe9f0('0x28')]({'exitAt':moment()[_0xe9f0('0xf4')](_0xe9f0('0xfe'))}));});return BPromise[_0xe9f0('0x8e')](_0x47c5e6);}})[_0xe9f0('0x14')](function(){if(_0x346b16){var _0x3c96f3=[];var _0x460943=[];var _0x4c5bde=utils[_0xe9f0('0xff')]();var _0x479ce3={'membername':_0x346b16[_0xe9f0('0x38')],'interface':_0x268a6b,'enterAt':moment()[_0xe9f0('0xf4')](_0xe9f0('0xfe')),'role':_0x346b16[_0xe9f0('0x2b')],'internal':_0x346b16[_0xe9f0('0x65')]};_0x4c5bde[_0xe9f0('0x100')](function(_0x2437c3){_0x3c96f3['push'](_['merge']({'channel':_0x2437c3,'type':_0xe9f0('0x101'),'data1':_0x519179[_0xe9f0('0x60')][_0xe9f0('0x102')],'data2':_0x268a6b},_0x479ce3));if(_0x346b16[_0xe9f0('0xa4')]){_0x460943[_0xe9f0('0x4b')](_['merge']({'channel':_0x2437c3,'type':_0xe9f0('0x103'),'data1':_0xe9f0('0x104')},_0x479ce3));}});return db[_0xe9f0('0x105')][_0xe9f0('0x8b')](_0x3c96f3[_0xe9f0('0x106')](_0x460943),{'individualHooks':!![]});}})['then'](function(){if(_0x346b16){return _0x346b16[_0xe9f0('0x28')]({'online':!![],'lastLoginAt':moment()[_0xe9f0('0xf4')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x346b16['loginInPause']||![],'mailPause':_0x346b16[_0xe9f0('0xa4')]||![],'chatPause':_0x346b16[_0xe9f0('0xa4')]||![],'faxPause':_0x346b16[_0xe9f0('0xa4')]||![],'smsPause':_0x346b16[_0xe9f0('0xa4')]||![],'openchannelPause':_0x346b16[_0xe9f0('0xa4')]||![],'whatsappPause':_0x346b16[_0xe9f0('0xa4')]||![],'pauseType':_0x346b16['loginInPause']?_0xe9f0('0x104'):null,'interface':_0x268a6b,'lastPauseAt':moment()[_0xe9f0('0xf4')](_0xe9f0('0xfe'))});}})[_0xe9f0('0x14')](function(_0x44b3fe){if(_0x519179[_0xe9f0('0x107')]){return _0xab8d50();}else{return BPromise[_0xe9f0('0x108')](_0x44b3fe)[_0xe9f0('0x14')](respondWithResult(_0x545b75,null));}})[_0xe9f0('0x1e')](handleError(_0x545b75,null));};exports[_0xe9f0('0x109')]=function(_0x288ed2,_0x1bc1db){var _0x57576c;return db['User'][_0xe9f0('0x36')]({'where':{'id':_0x288ed2['params']['id'],'role':_0xe9f0('0x30')},'attributes':['id','name',_0xe9f0('0x2b')]})[_0xe9f0('0x14')](handleEntityNotFound(_0x1bc1db,null))[_0xe9f0('0x14')](function(_0xb01504){if(_0xb01504){_0x57576c=_0xb01504;return db[_0xe9f0('0xb2')][_0xe9f0('0x29')]({'where':{'membername':_0x57576c[_0xe9f0('0x38')]},'individualHooks':!![]});}})['then'](function(){return db[_0xe9f0('0x105')][_0xe9f0('0x47')]({'where':{'membername':_0x57576c[_0xe9f0('0x38')],'exitAt':null}});})[_0xe9f0('0x14')](function(_0x26437c){var _0x498654=[];_0x26437c['forEach'](function(_0x3a1b0f){_0x498654[_0xe9f0('0x4b')](_0x3a1b0f[_0xe9f0('0x28')]({'exitAt':moment()[_0xe9f0('0xf4')](_0xe9f0('0xfe'))}));});return BPromise[_0xe9f0('0x8e')](_0x498654);})[_0xe9f0('0x14')](function(){return _0x57576c[_0xe9f0('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xe9f0('0x14')](respondWithResult(_0x1bc1db,null))[_0xe9f0('0x1e')](handleError(_0x1bc1db,null));};exports[_0xe9f0('0x10a')]=function(_0x5bb8ba,_0x348567){var _0x52f5ab;return db[_0xe9f0('0xb2')][_0xe9f0('0x28')]({'paused':0x1},{'where':{'UserId':_0x5bb8ba['params']['id']},'individualHooks':!![]})[_0xe9f0('0x14')](function(){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x5bb8ba['params']['id'],'role':_0xe9f0('0x30')},'attributes':['id','name','role',_0xe9f0('0x65'),'interface']});})['then'](handleEntityNotFound(_0x348567,null))['then'](function(_0x4d4c0d){if(_0x4d4c0d){_0x52f5ab=_0x4d4c0d;return respondWithRpcPromise(_0xe9f0('0x10b'),_0xe9f0('0x10a'),{'id':_0x52f5ab['id'],'name':_0x52f5ab[_0xe9f0('0x38')],'pause':!![]});}})[_0xe9f0('0x14')](function(){if(_0x52f5ab){return db['MemberReport'][_0xe9f0('0x47')]({'where':{'membername':_0x52f5ab[_0xe9f0('0x38')],'type':_0xe9f0('0x103'),'exitAt':null}});}})[_0xe9f0('0x14')](function(_0x27df5d){if(_0x27df5d['length']){var _0x4644c4=moment()[_0xe9f0('0xf4')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1eaa38=0x0,_0x741522=_0x27df5d[_0xe9f0('0x4a')];_0x1eaa38<_0x741522;_0x1eaa38++){_0x27df5d[_0x1eaa38]['updateAttributes']({'exitAt':_0x4644c4});}}})[_0xe9f0('0x14')](function(){var _0x49e4b7=[];var _0x100878=utils['getChannels']();_0x100878['forEach'](function(_0x112de5){_0x49e4b7[_0xe9f0('0x4b')]({'channel':_0x112de5,'membername':_0x52f5ab[_0xe9f0('0x38')],'interface':_['isNil'](_0x52f5ab['interface'])?util[_0xe9f0('0xf4')](_0xe9f0('0xb1'),_0x52f5ab[_0xe9f0('0x38')]):_0x52f5ab[_0xe9f0('0xa6')],'type':_0xe9f0('0x103'),'enterAt':moment()[_0xe9f0('0xf4')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x5bb8ba[_0xe9f0('0x60')][_0xe9f0('0x10c')]||_0xe9f0('0x10d'),'role':_0x52f5ab[_0xe9f0('0x2b')],'internal':_0x52f5ab[_0xe9f0('0x65')]});});return db[_0xe9f0('0x105')][_0xe9f0('0x8b')](_0x49e4b7,{'individualHooks':!![]});})['then'](function(){return _0x52f5ab['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5bb8ba[_0xe9f0('0x60')][_0xe9f0('0x10c')]||_0xe9f0('0x10d'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x348567,null))[_0xe9f0('0x1e')](handleError(_0x348567,null));};exports['unpause']=function(_0xe4cee8,_0x324007){var _0x1996f4;return db['User'][_0xe9f0('0x36')]({'where':{'id':_0xe4cee8[_0xe9f0('0x55')]['id']},'attributes':['id',_0xe9f0('0x38'),'role',_0xe9f0('0xa5'),_0xe9f0('0x10e'),_0xe9f0('0x10f'),_0xe9f0('0x110'),'openchannelPause',_0xe9f0('0x111'),_0xe9f0('0x112'),_0xe9f0('0x113'),'lastPauseAt']})[_0xe9f0('0x14')](handleEntityNotFound(_0x324007,null))[_0xe9f0('0x14')](function(_0x1f106e){if(_0x1f106e){_0x1996f4=_0x1f106e;if(_0xe4cee8[_0xe9f0('0x60')][_0xe9f0('0xa3')]&&!utils['isValidChannel'](_0xe4cee8[_0xe9f0('0x60')][_0xe9f0('0xa3')])){throw new db[(_0xe9f0('0x96'))]['ValidationError']('Unknown\x20channel');}switch(_0xe4cee8[_0xe9f0('0x60')]['channel']){case _0xe9f0('0xae'):return respondWithRpcPromise(_0xe9f0('0x10b'),_0xe9f0('0x114'),{'id':_0x1996f4['id'],'name':_0x1996f4['name'],'pause':![]})[_0xe9f0('0x14')](function(){return db[_0xe9f0('0xb2')]['update']({'paused':0x0},{'where':{'UserId':_0x1996f4['id']},'individualHooks':!![]});})[_0xe9f0('0x14')](function(){return db[_0xe9f0('0x105')]['find']({'where':{'channel':_0xe4cee8[_0xe9f0('0x60')]['channel'],'membername':_0x1996f4['name'],'type':'PAUSE','exitAt':null}});})[_0xe9f0('0x14')](function(_0x129429){if(_0x129429){return _0x129429[_0xe9f0('0x28')]({'exitAt':moment()[_0xe9f0('0xf4')](_0xe9f0('0xfe')),'data2':_0xe9f0('0x115')},{'individualHooks':!![]});}return null;})[_0xe9f0('0x14')](function(){return _0x1996f4[_0xe9f0('0x28')]({'voicePause':![]});});case'mail':case _0xe9f0('0x4c'):case _0xe9f0('0x50'):case _0xe9f0('0x4f'):case _0xe9f0('0x53'):case _0xe9f0('0x52'):return db[_0xe9f0('0x105')][_0xe9f0('0x36')]({'where':{'channel':_0xe4cee8[_0xe9f0('0x60')][_0xe9f0('0xa3')],'membername':_0x1996f4['name'],'type':_0xe9f0('0x103'),'exitAt':null}})[_0xe9f0('0x14')](function(_0xb736a2){if(_0xb736a2){return _0xb736a2['update']({'exitAt':moment()[_0xe9f0('0xf4')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe9f0('0x115')},{'individualHooks':!![]});}return null;})[_0xe9f0('0x14')](function(){var _0xd01692={};_[_0xe9f0('0x26')](_0xd01692,util['format'](_0xe9f0('0x116'),_0xe4cee8[_0xe9f0('0x60')][_0xe9f0('0xa3')],_0xe9f0('0x117')),![]);return _0x1996f4[_0xe9f0('0x28')](_0xd01692);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x1996f4['id'],'name':_0x1996f4[_0xe9f0('0x38')],'pause':![]})[_0xe9f0('0x14')](function(){return db[_0xe9f0('0xb2')][_0xe9f0('0x28')]({'paused':0x0},{'where':{'UserId':_0x1996f4['id']}});})[_0xe9f0('0x14')](function(){return db[_0xe9f0('0x105')][_0xe9f0('0x47')]({'where':{'membername':_0x1996f4[_0xe9f0('0x38')],'type':_0xe9f0('0x103'),'exitAt':null}});})[_0xe9f0('0x14')](function(_0x51787a){var _0x4f1ab7=[];_0x51787a[_0xe9f0('0x100')](function(_0x5614b4){_0x4f1ab7[_0xe9f0('0x4b')](_0x5614b4[_0xe9f0('0x28')]({'exitAt':moment()[_0xe9f0('0xf4')](_0xe9f0('0xfe')),'data2':_0xe9f0('0x115')}));});return BPromise[_0xe9f0('0x8e')](_0x4f1ab7);})[_0xe9f0('0x14')](function(){return _0x1996f4['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x324007,null))[_0xe9f0('0x1e')](handleError(_0x324007,null));};exports['getTeams']=function(_0x3cda98,_0x293381){var _0x4c604e={};var _0x20921a={};var _0x30c14b;var _0x1a2e02;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x3cda98[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x293381,null))[_0xe9f0('0x14')](function(_0x58edfa){if(_0x58edfa){_0x30c14b=_0x58edfa;_0x20921a[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db[_0xe9f0('0x118')][_0xe9f0('0x3d')]);_0x20921a[_0xe9f0('0x43')]=_['keys'](_0x3cda98[_0xe9f0('0x43')]);_0x20921a['filters']=_[_0xe9f0('0x5b')](_0x20921a[_0xe9f0('0x56')],_0x20921a['query']);_0x4c604e[_0xe9f0('0x46')]=_['intersection'](_0x20921a[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x3cda98[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x4c604e[_0xe9f0('0x46')]=_0x4c604e['attributes'][_0xe9f0('0x4a')]?_0x4c604e[_0xe9f0('0x46')]:_0x20921a['model'];_0x4c604e[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x3cda98[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x4c604e[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_['pick'](_0x3cda98['query'],_0x20921a['filters']));if(_0x3cda98[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x4c604e[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x4c604e[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0x4c604e[_0xe9f0('0x46')],function(_0x3f26b4){var _0x1e85d2={};_0x1e85d2[_0x3f26b4]={'$like':'%'+_0x3cda98[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x1e85d2;})});}_0x4c604e=_['merge']({},_0x4c604e,_0x3cda98[_0xe9f0('0x5e')]);return _0x30c14b[_0xe9f0('0x119')](_0x4c604e);}})[_0xe9f0('0x14')](function(_0x3b0c6c){if(_0x3b0c6c){_0x1a2e02=_0x3b0c6c['length'];if(!_0x3cda98[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x4c604e[_0xe9f0('0x24')]=qs['limit'](_0x3cda98['query']['limit']);_0x4c604e['offset']=qs[_0xe9f0('0x22')](_0x3cda98[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x30c14b[_0xe9f0('0x119')](_0x4c604e);}})[_0xe9f0('0x14')](function(_0x4e64aa){if(_0x4e64aa){return _0x4e64aa?{'count':_0x1a2e02,'rows':_0x4e64aa}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x293381,null))[_0xe9f0('0x1e')](handleError(_0x293381,null));};exports[_0xe9f0('0x11a')]=function(_0x1ff695,_0x379a21){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x1ff695[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x379a21,null))[_0xe9f0('0x14')](function(_0x351b88){if(_0x351b88){var _0x44753d=_0x351b88['get']({'plain':!![]});return _0x351b88[_0xe9f0('0x11a')](_0x1ff695[_0xe9f0('0x60')][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x1ff695[_0xe9f0('0x60')],['ids','id'])||{})[_0xe9f0('0x14')](function(){for(var _0x86e0fd=0x0;_0x86e0fd<_0x1ff695[_0xe9f0('0x60')][_0xe9f0('0x63')][_0xe9f0('0x4a')];_0x86e0fd++){var _0x3a9668=[];var _0x2fd1e3={};db['Team'][_0xe9f0('0xd2')]({'where':{'id':_0x1ff695[_0xe9f0('0x60')][_0xe9f0('0x63')][_0x86e0fd]}})[_0xe9f0('0x14')](function(_0x10da41){_0x2fd1e3=_0x10da41[_0xe9f0('0x4e')];_0x3a9668[_0xe9f0('0x4b')](_0x10da41[_0xe9f0('0x11b')]()['then'](function(_0xb8b06){for(var _0x9ba1b2=0x0;_0x9ba1b2<_0xb8b06[_0xe9f0('0x4a')];_0x9ba1b2++){_0xb8b06[_0x9ba1b2][_0xe9f0('0x11c')](_0xe9f0('0xa3'),_0xe9f0('0x11d'));}return _0xb8b06;}));_0x3a9668['push'](_0x10da41[_0xe9f0('0x11e')]()['then'](function(_0x2919ca){for(var _0x3536bd=0x0;_0x3536bd<_0x2919ca[_0xe9f0('0x4a')];_0x3536bd++){_0x2919ca[_0x3536bd]['setDataValue']('channel','Chat');}return _0x2919ca;}));_0x3a9668[_0xe9f0('0x4b')](_0x10da41['getMailQueues']()[_0xe9f0('0x14')](function(_0x93c590){for(var _0x6967f6=0x0;_0x6967f6<_0x93c590[_0xe9f0('0x4a')];_0x6967f6++){_0x93c590[_0x6967f6][_0xe9f0('0x11c')](_0xe9f0('0xa3'),_0xe9f0('0x11f'));}return _0x93c590;}));_0x3a9668[_0xe9f0('0x4b')](_0x10da41[_0xe9f0('0x120')]()['then'](function(_0x10ec21){for(var _0x1ed933=0x0;_0x1ed933<_0x10ec21[_0xe9f0('0x4a')];_0x1ed933++){_0x10ec21[_0x1ed933][_0xe9f0('0x11c')](_0xe9f0('0xa3'),'Sms');}return _0x10ec21;}));_0x3a9668[_0xe9f0('0x4b')](_0x10da41[_0xe9f0('0x121')]()['then'](function(_0x22617d){for(var _0x233089=0x0;_0x233089<_0x22617d[_0xe9f0('0x4a')];_0x233089++){_0x22617d[_0x233089][_0xe9f0('0x11c')](_0xe9f0('0xa3'),_0xe9f0('0x122'));}return _0x22617d;}));_0x3a9668['push'](_0x10da41[_0xe9f0('0x123')]()[_0xe9f0('0x14')](function(_0x2aa100){for(var _0x5043bd=0x0;_0x5043bd<_0x2aa100['length'];_0x5043bd++){_0x2aa100[_0x5043bd][_0xe9f0('0x11c')](_0xe9f0('0xa3'),_0xe9f0('0x124'));}return _0x2aa100;}));_0x3a9668[_0xe9f0('0x4b')](_0x10da41['getOpenchannelQueues']()[_0xe9f0('0x14')](function(_0x3942f8){for(var _0x332cc0=0x0;_0x332cc0<_0x3942f8['length'];_0x332cc0++){_0x3942f8[_0x332cc0]['setDataValue'](_0xe9f0('0xa3'),_0xe9f0('0x125'));}return _0x3942f8;}));return BPromise['all'](_0x3a9668);})[_0xe9f0('0x14')](function(_0x273c04){var _0x109d4c=_[_0xe9f0('0x126')](_0x273c04);_0x3a9668=[];return db[_0xe9f0('0x6c')][_0xe9f0('0x127')](function(_0x209d0a){for(var _0x218e83=0x0;_0x218e83<_0x109d4c[_0xe9f0('0x4a')];_0x218e83++){_0x3a9668[_0xe9f0('0x4b')](_0x109d4c[_0x218e83][_0xe9f0('0x128')](_0x44753d['id']),{'transaction':_0x209d0a});}return BPromise[_0xe9f0('0x8e')](_0x3a9668)['then'](function(){if(_0x44753d[_0xe9f0('0xb0')]){return BPromise[_0xe9f0('0x8f')](_[_0xe9f0('0x33')](_0x109d4c,function(_0x3e2fcd){return _0x3e2fcd[_0xe9f0('0x129')](_0xe9f0('0xa3'))===_0xe9f0('0x11d');}),function(_0x589986){return db[_0xe9f0('0xb2')]['upsert']({'membername':_0x44753d['name'],'UserId':_0x44753d['id'],'queue_name':_0x589986[_0xe9f0('0x38')],'VoiceQueueId':_0x589986['id'],'interface':_['isNil'](_0x44753d[_0xe9f0('0xa6')])?util[_0xe9f0('0xf4')](_0xe9f0('0xb1'),_0x44753d['name']):_0x44753d[_0xe9f0('0xa6')],'paused':_0x44753d[_0xe9f0('0xa5')]||![],'penalty':_0x44753d[_0xe9f0('0xa9')]},{'transaction':_0x209d0a});});}else{return;}})[_0xe9f0('0x14')](function(){for(var _0x201d1e=0x0;_0x201d1e<_0x109d4c[_0xe9f0('0x4a')];_0x201d1e++){var _0x2d9456=_0x109d4c[_0x201d1e][_0xe9f0('0x129')](_0xe9f0('0xa3'));var _0x581db3=_0x2d9456+_0xe9f0('0xab');socket['emit'](_0xe9f0('0x2e')+_0x2d9456+_0xe9f0('0xad'),{'UserId':_0x44753d['id'],['queueField']:_0x109d4c[_0x201d1e]['id']});}});});})[_0xe9f0('0x14')](function(){db[_0xe9f0('0x12a')]['findOne']({'where':{'teamId':_0x2fd1e3['id']}})[_0xe9f0('0x14')](function(_0x26b7e9){if(_0x26b7e9){db[_0xe9f0('0x12b')][_0xe9f0('0x90')]({'UserId':_0x1ff695['params']['id'],'VoicePrefixId':_0x26b7e9[_0xe9f0('0x12c')]});}});});}});}})[_0xe9f0('0x14')](respondWithStatusCode(_0x379a21,null))[_0xe9f0('0x1e')](handleError(_0x379a21,null));};exports[_0xe9f0('0x12d')]=function(_0x1484fc,_0x532b2e){return db['User'][_0xe9f0('0xd2')]({'where':{'id':_0x1484fc[_0xe9f0('0x55')]['id']}})['then'](handleEntityNotFound(_0x532b2e,null))[_0xe9f0('0x14')](function(_0xf44411){if(_0xf44411){var _0x21d45b=_0xf44411[_0xe9f0('0x2a')]({'plain':!![]});var _0x4d1c58=_0x1484fc[_0xe9f0('0x43')][_0xe9f0('0x63')];return _0xf44411[_0xe9f0('0x12d')](_0x4d1c58)[_0xe9f0('0x14')](function(){for(var _0x1f1343=0x0;_0x1f1343<_0x4d1c58[_0xe9f0('0x4a')];_0x1f1343++){var _0x22d71b=[];var _0x26ddc4={};db[_0xe9f0('0x118')][_0xe9f0('0xd2')]({'where':{'id':_0x4d1c58[_0x1f1343]}})[_0xe9f0('0x14')](function(_0x293660){_0x26ddc4=_0x293660['dataValues'];_0x22d71b[_0xe9f0('0x4b')](_0x293660['getVoiceQueues']()[_0xe9f0('0x14')](function(_0x1cc518){for(var _0x5d6675=0x0;_0x5d6675<_0x1cc518[_0xe9f0('0x4a')];_0x5d6675++){_0x1cc518[_0x5d6675]['setDataValue'](_0xe9f0('0xa3'),_0xe9f0('0x11d'));}return _0x1cc518;}));_0x22d71b['push'](_0x293660[_0xe9f0('0x11e')]()[_0xe9f0('0x14')](function(_0x25a582){for(var _0x200b46=0x0;_0x200b46<_0x25a582[_0xe9f0('0x4a')];_0x200b46++){_0x25a582[_0x200b46][_0xe9f0('0x11c')]('channel',_0xe9f0('0x12e'));}return _0x25a582;}));_0x22d71b[_0xe9f0('0x4b')](_0x293660[_0xe9f0('0x12f')]()[_0xe9f0('0x14')](function(_0x2c97e2){for(var _0x20a7db=0x0;_0x20a7db<_0x2c97e2[_0xe9f0('0x4a')];_0x20a7db++){_0x2c97e2[_0x20a7db][_0xe9f0('0x11c')](_0xe9f0('0xa3'),'Mail');}return _0x2c97e2;}));_0x22d71b[_0xe9f0('0x4b')](_0x293660[_0xe9f0('0x120')]()['then'](function(_0x1588b8){for(var _0x22a998=0x0;_0x22a998<_0x1588b8['length'];_0x22a998++){_0x1588b8[_0x22a998]['setDataValue'](_0xe9f0('0xa3'),_0xe9f0('0x130'));}return _0x1588b8;}));_0x22d71b[_0xe9f0('0x4b')](_0x293660['getWhatsappQueues']()[_0xe9f0('0x14')](function(_0x42c72e){for(var _0x1575c5=0x0;_0x1575c5<_0x42c72e[_0xe9f0('0x4a')];_0x1575c5++){_0x42c72e[_0x1575c5][_0xe9f0('0x11c')](_0xe9f0('0xa3'),_0xe9f0('0x122'));}return _0x42c72e;}));_0x22d71b[_0xe9f0('0x4b')](_0x293660['getFaxQueues']()[_0xe9f0('0x14')](function(_0x1de62a){for(var _0x21b399=0x0;_0x21b399<_0x1de62a[_0xe9f0('0x4a')];_0x21b399++){_0x1de62a[_0x21b399]['setDataValue']('channel',_0xe9f0('0x124'));}return _0x1de62a;}));_0x22d71b[_0xe9f0('0x4b')](_0x293660[_0xe9f0('0x131')]()['then'](function(_0x18a0b4){for(var _0x4bdf68=0x0;_0x4bdf68<_0x18a0b4[_0xe9f0('0x4a')];_0x4bdf68++){_0x18a0b4[_0x4bdf68][_0xe9f0('0x11c')](_0xe9f0('0xa3'),_0xe9f0('0x125'));}return _0x18a0b4;}));return BPromise['all'](_0x22d71b);})[_0xe9f0('0x14')](function(_0x3c7cf8){var _0x4f5ebb=_[_0xe9f0('0x126')](_0x3c7cf8);_0x22d71b=[];return db[_0xe9f0('0x6c')][_0xe9f0('0x127')](function(_0x56e14e){for(var _0x55dfe5=0x0;_0x55dfe5<_0x4f5ebb['length'];_0x55dfe5++){_0x22d71b['push'](_0x4f5ebb[_0x55dfe5][_0xe9f0('0x132')](_0x21d45b['id']),{'transaction':_0x56e14e});}return BPromise[_0xe9f0('0x8e')](_0x22d71b)[_0xe9f0('0x14')](function(){if(_0x21d45b[_0xe9f0('0xb0')]){return BPromise[_0xe9f0('0x8f')](_[_0xe9f0('0x33')](_0x4f5ebb,function(_0x57460b){return _0x57460b[_0xe9f0('0x129')]('channel')==='Voice';}),function(_0x17b54f){return db[_0xe9f0('0xb2')][_0xe9f0('0x29')]({'where':{'VoiceQueueId':_0x17b54f['id'],'UserId':_0x21d45b['id']},'transaction':_0x56e14e});});}else{return;}})['then'](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x26ddc4['id']}})[_0xe9f0('0x14')](function(_0x4560e0){if(_0x4560e0){return db[_0xe9f0('0x12b')][_0xe9f0('0x29')]({'where':{'UserId':_0x21d45b['id'],'VoicePrefixId':_0x4560e0[_0xe9f0('0x4e')][_0xe9f0('0x12c')]}});}});})[_0xe9f0('0x14')](function(){for(var _0x1b593=0x0;_0x1b593<_0x4f5ebb['length'];_0x1b593++){var _0x1c6dbf=_0x4f5ebb[_0x1b593]['getDataValue'](_0xe9f0('0xa3'));var _0x183a72=_0x1c6dbf+_0xe9f0('0xab');socket['emit'](_0xe9f0('0x2e')+_0x1c6dbf+_0xe9f0('0xba'),{'UserId':_0x21d45b['id'],['queueField']:_0x4f5ebb[_0x1b593]['id']});}});});});}});}})[_0xe9f0('0x14')](respondWithStatusCode(_0x532b2e,null))[_0xe9f0('0x1e')](handleError(_0x532b2e,null));};exports[_0xe9f0('0x133')]=function(_0x3cd6d9,_0x205886){var _0x1d6ef1={};var _0x180dcb={};var _0x3d728a;var _0x2462fe;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x3cd6d9[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x205886,null))[_0xe9f0('0x14')](function(_0x5994ec){if(_0x5994ec){_0x3d728a=_0x5994ec;_0x180dcb[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db['CmList'][_0xe9f0('0x3d')]);_0x180dcb[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x3cd6d9[_0xe9f0('0x43')]);_0x180dcb[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x180dcb[_0xe9f0('0x56')],_0x180dcb['query']);_0x1d6ef1[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x180dcb[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x3cd6d9[_0xe9f0('0x43')]['fields']));_0x1d6ef1['attributes']=_0x1d6ef1[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x1d6ef1[_0xe9f0('0x46')]:_0x180dcb['model'];_0x1d6ef1['order']=qs[_0xe9f0('0xd3')](_0x3cd6d9['query'][_0xe9f0('0xd3')]);_0x1d6ef1[_0xe9f0('0x41')]=qs['filters'](_[_0xe9f0('0xd4')](_0x3cd6d9[_0xe9f0('0x43')],_0x180dcb[_0xe9f0('0x5a')]));if(_0x3cd6d9[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x1d6ef1[_0xe9f0('0x41')]=_['merge'](_0x1d6ef1[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0x1d6ef1[_0xe9f0('0x46')],function(_0x282f64){var _0x45bc0c={};_0x45bc0c[_0x282f64]={'$like':'%'+_0x3cd6d9[_0xe9f0('0x43')]['filter']+'%'};return _0x45bc0c;})});}_0x1d6ef1=_[_0xe9f0('0x5d')]({},_0x1d6ef1,_0x3cd6d9[_0xe9f0('0x5e')]);return _0x3d728a[_0xe9f0('0x133')](_0x1d6ef1);}})['then'](function(_0x3ca85d){if(_0x3ca85d){_0x2462fe=_0x3ca85d[_0xe9f0('0x4a')];if(!_0x3cd6d9['query']['hasOwnProperty'](_0xe9f0('0xe0'))){_0x1d6ef1[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x3cd6d9['query'][_0xe9f0('0x24')]);_0x1d6ef1[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x3cd6d9[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x3d728a[_0xe9f0('0x133')](_0x1d6ef1);}})[_0xe9f0('0x14')](function(_0x50e247){if(_0x50e247){return _0x50e247?{'count':_0x2462fe,'rows':_0x50e247}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x205886,null))[_0xe9f0('0x1e')](handleError(_0x205886,null));};exports['getAgents']=function(_0x937742,_0x5b9b88){var _0x129e43={};var _0x204658={};var _0xddb69d;var _0x42f153;return db[_0xe9f0('0x42')]['findOne']({'where':{'id':_0x937742[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x5b9b88,null))[_0xe9f0('0x14')](function(_0x2f6121){if(_0x2f6121){_0xddb69d=_0x2f6121;_0x204658[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db['User'][_0xe9f0('0x3d')]);_0x204658[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x937742[_0xe9f0('0x43')]);_0x204658[_0xe9f0('0x5a')]=_['intersection'](_0x204658[_0xe9f0('0x56')],_0x204658[_0xe9f0('0x43')]);_0x129e43['attributes']=_[_0xe9f0('0x5b')](_0x204658['model'],qs[_0xe9f0('0x5c')](_0x937742[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x129e43['attributes']=_0x129e43['attributes'][_0xe9f0('0x4a')]?_0x129e43['attributes']:_0x204658[_0xe9f0('0x56')];_0x129e43['order']=qs['sort'](_0x937742['query']['sort']);_0x129e43[_0xe9f0('0x41')]=qs['filters'](_[_0xe9f0('0xd4')](_0x937742[_0xe9f0('0x43')],_0x204658['filters']));if(_0x937742[_0xe9f0('0x43')]['filter']){_0x129e43[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x129e43[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0x129e43[_0xe9f0('0x46')],function(_0x266fc3){var _0x59d971={};_0x59d971[_0x266fc3]={'$like':'%'+_0x937742[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x59d971;})});}_0x129e43['model']=db['User'];_0x129e43['as']=_0xe9f0('0x2f');_0x129e43=_['merge']({},_0x129e43,_0x937742[_0xe9f0('0x5e')]);return _0xddb69d[_0xe9f0('0x11b')]({'include':[_0x129e43]});}})['then'](function(_0x50dae0){if(_0x50dae0){var _0x31ff63={},_0x49de75=[],_0x3cb152=0x0;for(var _0x25c7e4=0x0;_0x25c7e4<_0x50dae0[_0xe9f0('0x4a')];_0x25c7e4+=0x1){for(var _0x4079af=0x0,_0x2e2c83;_0x4079af<_0x50dae0[_0x25c7e4][_0xe9f0('0x2f')]['length'];_0x4079af+=0x1){_0x2e2c83=_0x50dae0[_0x25c7e4]['Agents'][_0x4079af][_0xe9f0('0x2a')]({'plain':!![]});_0x31ff63[_0x2e2c83['id']]=_0x2e2c83;}}_0x31ff63=_[_0xe9f0('0x134')](_0x31ff63);for(var _0x22407b=qs[_0xe9f0('0x22')](_0x937742[_0xe9f0('0x43')]['offset']);_0x22407b<_0x31ff63[_0xe9f0('0x4a')]&&_0x49de75[_0xe9f0('0x4a')]<qs[_0xe9f0('0x24')](_0x937742[_0xe9f0('0x43')]['limit']);_0x22407b+=0x1){if(_0x31ff63[_0x22407b]){_0x49de75[_0xe9f0('0x4b')](_0x31ff63[_0x22407b]);}}return{'count':_0x31ff63[_0xe9f0('0x4a')],'rows':_0x49de75};}})[_0xe9f0('0x14')](respondWithResult(_0x5b9b88,null))[_0xe9f0('0x1e')](handleError(_0x5b9b88,null));};exports['destroy']=function(_0x35ce88,_0x4c77f0){if(_0x35ce88[_0xe9f0('0x2e')]['id']==_0x35ce88[_0xe9f0('0x55')]['id']){return _0x4c77f0[_0xe9f0('0x1f')](0x1f4)[_0xe9f0('0x3b')]({'message':_0xe9f0('0x135')});}return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x35ce88['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x4c77f0,null))[_0xe9f0('0x14')](removeEntity(_0x4c77f0,null))[_0xe9f0('0x1e')](handleError(_0x4c77f0,null));};exports[_0xe9f0('0x136')]=function(_0x475c47,_0x150fe5){return db[_0xe9f0('0x42')]['find']({'where':{'id':_0x475c47[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x150fe5,null))[_0xe9f0('0x14')](function(_0x18cc91){if(_0x18cc91){return _0x18cc91['addChatInteractions'](_0x475c47[_0xe9f0('0x60')][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x475c47[_0xe9f0('0x60')],[_0xe9f0('0x63'),'id'])||{})[_0xe9f0('0xaa')](function(){for(var _0x3bce88=0x0;_0x3bce88<_0x475c47['body']['ids'][_0xe9f0('0x4a')];_0x3bce88+=0x1){socket[_0xe9f0('0xac')](_0xe9f0('0x137'),{'ChatInteractionId':Number(_0x475c47[_0xe9f0('0x60')][_0xe9f0('0x63')][_0x3bce88]),'UserId':Number(_0x475c47[_0xe9f0('0x55')]['id'])});}return _0x475c47[_0xe9f0('0x60')]['ids'];});}})[_0xe9f0('0x14')](respondWithResult(_0x150fe5,null))[_0xe9f0('0x1e')](handleError(_0x150fe5,null));};exports['removeChatInteractions']=function(_0x55a88d,_0x47c838){return db[_0xe9f0('0x42')]['find']({'where':{'id':_0x55a88d[_0xe9f0('0x55')]['id']}})['then'](handleEntityNotFound(_0x47c838,null))[_0xe9f0('0x14')](function(_0x4b07d2){if(_0x4b07d2){return _0x4b07d2['removeChatInteractions'](_0x55a88d[_0xe9f0('0x43')][_0xe9f0('0x63')])['then'](function(){if(_[_0xe9f0('0xb9')](_0x55a88d[_0xe9f0('0x43')][_0xe9f0('0x63')])){for(var _0x1a2d57=0x0;_0x1a2d57<_0x55a88d[_0xe9f0('0x43')][_0xe9f0('0x63')][_0xe9f0('0x4a')];_0x1a2d57+=0x1){socket[_0xe9f0('0xac')](_0xe9f0('0x138'),{'ChatInteractionId':Number(_0x55a88d[_0xe9f0('0x43')]['ids'][_0x1a2d57]),'UserId':Number(_0x55a88d[_0xe9f0('0x55')]['id'])});}}else{socket[_0xe9f0('0xac')](_0xe9f0('0x138'),{'ChatInteractionId':Number(_0x55a88d['query'][_0xe9f0('0x63')]),'UserId':Number(_0x55a88d[_0xe9f0('0x55')]['id'])});}});}})[_0xe9f0('0x14')](respondWithStatusCode(_0x47c838,null))[_0xe9f0('0x1e')](handleError(_0x47c838,null));};exports[_0xe9f0('0x139')]=function(_0x20e5f0,_0x3c3126){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x20e5f0[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x3c3126,null))[_0xe9f0('0x14')](function(_0x2f4fa3){if(_0x2f4fa3){return _0x2f4fa3[_0xe9f0('0x139')](_0x20e5f0[_0xe9f0('0x60')][_0xe9f0('0x63')],_['omit'](_0x20e5f0[_0xe9f0('0x60')],['ids','id'])||{})[_0xe9f0('0xaa')](function(){for(var _0x187660=0x0;_0x187660<_0x20e5f0[_0xe9f0('0x60')][_0xe9f0('0x63')][_0xe9f0('0x4a')];_0x187660+=0x1){socket[_0xe9f0('0xac')](_0xe9f0('0x13a'),{'MailInteractionId':Number(_0x20e5f0['body'][_0xe9f0('0x63')][_0x187660]),'UserId':Number(_0x20e5f0['params']['id'])});}return _0x20e5f0[_0xe9f0('0x60')][_0xe9f0('0x63')];});}})[_0xe9f0('0x14')](respondWithResult(_0x3c3126,null))[_0xe9f0('0x1e')](handleError(_0x3c3126,null));};exports[_0xe9f0('0x13b')]=function(_0x24cadd,_0x2d7b0c){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x24cadd[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x2d7b0c,null))[_0xe9f0('0x14')](function(_0x19f3d7){if(_0x19f3d7){return _0x19f3d7[_0xe9f0('0x13b')](_0x24cadd[_0xe9f0('0x43')][_0xe9f0('0x63')])['then'](function(){if(_['isArray'](_0x24cadd[_0xe9f0('0x43')][_0xe9f0('0x63')])){for(var _0x43b441=0x0;_0x43b441<_0x24cadd[_0xe9f0('0x43')][_0xe9f0('0x63')][_0xe9f0('0x4a')];_0x43b441+=0x1){socket[_0xe9f0('0xac')](_0xe9f0('0x13c'),{'MailInteractionId':Number(_0x24cadd[_0xe9f0('0x43')][_0xe9f0('0x63')][_0x43b441]),'UserId':Number(_0x24cadd[_0xe9f0('0x55')]['id'])});}}else{socket[_0xe9f0('0xac')](_0xe9f0('0x13c'),{'MailInteractionId':Number(_0x24cadd[_0xe9f0('0x43')]['ids']),'UserId':Number(_0x24cadd[_0xe9f0('0x55')]['id'])});}});}})[_0xe9f0('0x14')](respondWithStatusCode(_0x2d7b0c,null))[_0xe9f0('0x1e')](handleError(_0x2d7b0c,null));};exports['addFaxInteractions']=function(_0x48aab8,_0x44416a){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x48aab8['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x44416a,null))[_0xe9f0('0x14')](function(_0x257762){if(_0x257762){return _0x257762[_0xe9f0('0x13d')](_0x48aab8[_0xe9f0('0x60')][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x48aab8['body'],[_0xe9f0('0x63'),'id'])||{})['spread'](function(){for(var _0x5b06ce=0x0;_0x5b06ce<_0x48aab8[_0xe9f0('0x60')][_0xe9f0('0x63')]['length'];_0x5b06ce+=0x1){socket['emit'](_0xe9f0('0x13e'),{'FaxInteractionId':Number(_0x48aab8[_0xe9f0('0x60')][_0xe9f0('0x63')][_0x5b06ce]),'UserId':Number(_0x48aab8[_0xe9f0('0x55')]['id'])});}return _0x48aab8[_0xe9f0('0x60')]['ids'];});}})[_0xe9f0('0x14')](respondWithResult(_0x44416a,null))[_0xe9f0('0x1e')](handleError(_0x44416a,null));};exports[_0xe9f0('0x13f')]=function(_0x4440c5,_0x29e885){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x4440c5['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x29e885,null))[_0xe9f0('0x14')](function(_0x5376ed){if(_0x5376ed){return _0x5376ed[_0xe9f0('0x13f')](_0x4440c5[_0xe9f0('0x43')]['ids'])['then'](function(){if(_[_0xe9f0('0xb9')](_0x4440c5[_0xe9f0('0x43')][_0xe9f0('0x63')])){for(var _0x4dbf62=0x0;_0x4dbf62<_0x4440c5[_0xe9f0('0x43')]['ids'][_0xe9f0('0x4a')];_0x4dbf62+=0x1){socket[_0xe9f0('0xac')](_0xe9f0('0x140'),{'FaxInteractionId':Number(_0x4440c5[_0xe9f0('0x43')]['ids'][_0x4dbf62]),'UserId':Number(_0x4440c5[_0xe9f0('0x55')]['id'])});}}else{socket[_0xe9f0('0xac')](_0xe9f0('0x140'),{'FaxInteractionId':Number(_0x4440c5['query'][_0xe9f0('0x63')]),'UserId':Number(_0x4440c5['params']['id'])});}});}})[_0xe9f0('0x14')](respondWithStatusCode(_0x29e885,null))[_0xe9f0('0x1e')](handleError(_0x29e885,null));};exports[_0xe9f0('0x141')]=function(_0xe1165e,_0x99e7cf){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0xe1165e[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x99e7cf,null))[_0xe9f0('0x14')](function(_0x49ad45){if(_0x49ad45){return _0x49ad45[_0xe9f0('0x141')](_0xe1165e[_0xe9f0('0x60')][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0xe1165e['body'],[_0xe9f0('0x63'),'id'])||{})[_0xe9f0('0xaa')](function(){for(var _0x53eaae=0x0;_0x53eaae<_0xe1165e['body'][_0xe9f0('0x63')]['length'];_0x53eaae+=0x1){socket[_0xe9f0('0xac')](_0xe9f0('0x142'),{'SmsInteractionId':Number(_0xe1165e[_0xe9f0('0x60')][_0xe9f0('0x63')][_0x53eaae]),'UserId':Number(_0xe1165e[_0xe9f0('0x55')]['id'])});}return _0xe1165e['body'][_0xe9f0('0x63')];});}})[_0xe9f0('0x14')](respondWithResult(_0x99e7cf,null))[_0xe9f0('0x1e')](handleError(_0x99e7cf,null));};exports[_0xe9f0('0x143')]=function(_0xb7f413,_0x1f5f9b){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0xb7f413[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x1f5f9b,null))[_0xe9f0('0x14')](function(_0x33423c){if(_0x33423c){return _0x33423c[_0xe9f0('0x143')](_0xb7f413[_0xe9f0('0x43')][_0xe9f0('0x63')])['then'](function(){if(_[_0xe9f0('0xb9')](_0xb7f413[_0xe9f0('0x43')][_0xe9f0('0x63')])){for(var _0x3a662a=0x0;_0x3a662a<_0xb7f413[_0xe9f0('0x43')]['ids'][_0xe9f0('0x4a')];_0x3a662a+=0x1){socket[_0xe9f0('0xac')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xb7f413[_0xe9f0('0x43')][_0xe9f0('0x63')][_0x3a662a]),'UserId':Number(_0xb7f413[_0xe9f0('0x55')]['id'])});}}else{socket[_0xe9f0('0xac')](_0xe9f0('0x144'),{'SmsInteractionId':Number(_0xb7f413['query'][_0xe9f0('0x63')]),'UserId':Number(_0xb7f413[_0xe9f0('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f5f9b,null))[_0xe9f0('0x1e')](handleError(_0x1f5f9b,null));};exports[_0xe9f0('0x145')]=function(_0x22530a,_0x2e80a0){return db[_0xe9f0('0x42')]['find']({'where':{'id':_0x22530a[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x2e80a0,null))[_0xe9f0('0x14')](function(_0x31f6a2){if(_0x31f6a2){return _0x31f6a2['addOpenchannelInteractions'](_0x22530a[_0xe9f0('0x60')][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x22530a[_0xe9f0('0x60')],['ids','id'])||{})[_0xe9f0('0xaa')](function(){for(var _0x5f47de=0x0;_0x5f47de<_0x22530a[_0xe9f0('0x60')][_0xe9f0('0x63')]['length'];_0x5f47de+=0x1){socket[_0xe9f0('0xac')](_0xe9f0('0x146'),{'OpenchannelInteractionId':Number(_0x22530a['body'][_0xe9f0('0x63')][_0x5f47de]),'UserId':Number(_0x22530a[_0xe9f0('0x55')]['id'])});}return _0x22530a[_0xe9f0('0x60')][_0xe9f0('0x63')];});}})[_0xe9f0('0x14')](respondWithResult(_0x2e80a0,null))[_0xe9f0('0x1e')](handleError(_0x2e80a0,null));};exports[_0xe9f0('0x147')]=function(_0x3037e5,_0x33fce6){return db[_0xe9f0('0x42')]['find']({'where':{'id':_0x3037e5[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x33fce6,null))[_0xe9f0('0x14')](function(_0x3ab3f9){if(_0x3ab3f9){return _0x3ab3f9[_0xe9f0('0x147')](_0x3037e5['query'][_0xe9f0('0x63')])['then'](function(){if(_[_0xe9f0('0xb9')](_0x3037e5[_0xe9f0('0x43')][_0xe9f0('0x63')])){for(var _0x1b5bee=0x0;_0x1b5bee<_0x3037e5['query'][_0xe9f0('0x63')][_0xe9f0('0x4a')];_0x1b5bee+=0x1){socket['emit'](_0xe9f0('0x148'),{'OpenchannelInteractionId':Number(_0x3037e5['query'][_0xe9f0('0x63')][_0x1b5bee]),'UserId':Number(_0x3037e5[_0xe9f0('0x55')]['id'])});}}else{socket['emit'](_0xe9f0('0x148'),{'OpenchannelInteractionId':Number(_0x3037e5['query'][_0xe9f0('0x63')]),'UserId':Number(_0x3037e5[_0xe9f0('0x55')]['id'])});}});}})[_0xe9f0('0x14')](respondWithStatusCode(_0x33fce6,null))[_0xe9f0('0x1e')](handleError(_0x33fce6,null));};exports[_0xe9f0('0x149')]=function(_0xd3452c,_0x5be398){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0xd3452c[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x5be398,null))['then'](function(_0x246948){if(_0x246948){return _0x246948[_0xe9f0('0x149')](_0xd3452c[_0xe9f0('0x60')][_0xe9f0('0x63')],_['omit'](_0xd3452c[_0xe9f0('0x60')],[_0xe9f0('0x63'),'id'])||{})[_0xe9f0('0xaa')](function(){for(var _0x5ed38a=0x0;_0x5ed38a<_0xd3452c[_0xe9f0('0x60')]['ids'][_0xe9f0('0x4a')];_0x5ed38a+=0x1){socket[_0xe9f0('0xac')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0xd3452c[_0xe9f0('0x60')][_0xe9f0('0x63')][_0x5ed38a]),'UserId':Number(_0xd3452c[_0xe9f0('0x55')]['id'])});}return _0xd3452c[_0xe9f0('0x60')]['ids'];});}})['then'](respondWithResult(_0x5be398,null))[_0xe9f0('0x1e')](handleError(_0x5be398,null));};exports[_0xe9f0('0x14a')]=function(_0x27c967,_0xab22d){return db['User'][_0xe9f0('0x36')]({'where':{'id':_0x27c967['params']['id']}})['then'](handleEntityNotFound(_0xab22d,null))[_0xe9f0('0x14')](function(_0xf5a7e7){if(_0xf5a7e7){return _0xf5a7e7[_0xe9f0('0x14a')](_0x27c967['query'][_0xe9f0('0x63')]);}})['then'](respondWithStatusCode(_0xab22d,null))[_0xe9f0('0x1e')](handleError(_0xab22d,null));};exports[_0xe9f0('0x14b')]=function(_0x279e4e,_0x60b12b){var _0x261084={};var _0xcda07c={};var _0x5e76d4;var _0x4c2de6;return db['User'][_0xe9f0('0xd2')]({'where':{'id':_0x279e4e[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x60b12b,null))[_0xe9f0('0x14')](function(_0xfa0176){if(_0xfa0176){_0x5e76d4=_0xfa0176;_0xcda07c['model']=_[_0xe9f0('0x58')](db[_0xe9f0('0x14c')][_0xe9f0('0x3d')]);_0xcda07c['query']=_[_0xe9f0('0x58')](_0x279e4e[_0xe9f0('0x43')]);_0xcda07c[_0xe9f0('0x5a')]=_['intersection'](_0xcda07c[_0xe9f0('0x56')],_0xcda07c[_0xe9f0('0x43')]);_0x261084['attributes']=_['intersection'](_0xcda07c[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x279e4e[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x261084[_0xe9f0('0x46')]=_0x261084[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x261084['attributes']:_0xcda07c[_0xe9f0('0x56')];_0x261084[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x279e4e[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x261084['where']=qs['filters'](_[_0xe9f0('0xd4')](_0x279e4e['query'],_0xcda07c[_0xe9f0('0x5a')]));if(_0x279e4e[_0xe9f0('0x43')]['filter']){_0x261084[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x261084[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0x261084[_0xe9f0('0x46')],function(_0x3f50e3){var _0x193a7b={};_0x193a7b[_0x3f50e3]={'$like':'%'+_0x279e4e[_0xe9f0('0x43')]['filter']+'%'};return _0x193a7b;})});}_0x261084=_[_0xe9f0('0x5d')]({},_0x261084,_0x279e4e[_0xe9f0('0x5e')]);return _0x5e76d4[_0xe9f0('0x14b')](_0x261084);}})[_0xe9f0('0x14')](function(_0x322150){if(_0x322150){_0x4c2de6=_0x322150[_0xe9f0('0x4a')];if(!_0x279e4e['query'][_0xe9f0('0xd6')]('nolimit')){_0x261084['limit']=qs[_0xe9f0('0x24')](_0x279e4e[_0xe9f0('0x43')]['limit']);_0x261084[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x279e4e[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x5e76d4[_0xe9f0('0x14b')](_0x261084);}})[_0xe9f0('0x14')](function(_0xf95db2){if(_0xf95db2){return _0xf95db2?{'count':_0x4c2de6,'rows':_0xf95db2}:null;}})['then'](respondWithResult(_0x60b12b,null))[_0xe9f0('0x1e')](handleError(_0x60b12b,null));};exports['getFaxAccounts']=function(_0x47450d,_0x36246c){var _0x28d68a={};var _0x73f6b={};var _0xe381f8;var _0xbb8fb8;return db['User'][_0xe9f0('0xd2')]({'where':{'id':_0x47450d[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x36246c,null))[_0xe9f0('0x14')](function(_0x1f803a){if(_0x1f803a){_0xe381f8=_0x1f803a;_0x73f6b[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db[_0xe9f0('0x14d')][_0xe9f0('0x3d')]);_0x73f6b[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x47450d['query']);_0x73f6b[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x73f6b[_0xe9f0('0x56')],_0x73f6b[_0xe9f0('0x43')]);_0x28d68a[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x73f6b[_0xe9f0('0x56')],qs['fields'](_0x47450d['query'][_0xe9f0('0x5c')]));_0x28d68a[_0xe9f0('0x46')]=_0x28d68a[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x28d68a[_0xe9f0('0x46')]:_0x73f6b[_0xe9f0('0x56')];_0x28d68a[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x47450d[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x28d68a[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x47450d[_0xe9f0('0x43')],_0x73f6b['filters']));if(_0x47450d['query']['filter']){_0x28d68a[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x28d68a['where'],{'$or':_[_0xe9f0('0x35')](_0x28d68a[_0xe9f0('0x46')],function(_0x2f330c){var _0x5a742b={};_0x5a742b[_0x2f330c]={'$like':'%'+_0x47450d[_0xe9f0('0x43')]['filter']+'%'};return _0x5a742b;})});}_0x28d68a=_[_0xe9f0('0x5d')]({},_0x28d68a,_0x47450d[_0xe9f0('0x5e')]);return _0xe381f8[_0xe9f0('0x14e')](_0x28d68a);}})[_0xe9f0('0x14')](function(_0x27849b){if(_0x27849b){_0xbb8fb8=_0x27849b[_0xe9f0('0x4a')];if(!_0x47450d[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x28d68a[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x47450d[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x28d68a[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x47450d[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0xe381f8[_0xe9f0('0x14e')](_0x28d68a);}})[_0xe9f0('0x14')](function(_0xa8e32b){if(_0xa8e32b){return _0xa8e32b?{'count':_0xbb8fb8,'rows':_0xa8e32b}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x36246c,null))[_0xe9f0('0x1e')](handleError(_0x36246c,null));};exports[_0xe9f0('0x14f')]=function(_0x4a963d,_0x2617a4){return db['User']['find']({'where':{'id':_0x4a963d[_0xe9f0('0x55')]['id']}})['then'](handleEntityNotFound(_0x2617a4,null))[_0xe9f0('0x14')](function(_0x2207bb){if(_0x2207bb){return _0x2207bb[_0xe9f0('0x14f')](_0x4a963d[_0xe9f0('0x60')][_0xe9f0('0x63')],_['omit'](_0x4a963d[_0xe9f0('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0x2617a4,null))['catch'](handleError(_0x2617a4,null));};exports[_0xe9f0('0x150')]=function(_0x3fdcd4,_0x14d111){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x3fdcd4['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x14d111,null))[_0xe9f0('0x14')](function(_0x4a0914){if(_0x4a0914){return _0x4a0914['removeFaxAccounts'](_0x3fdcd4[_0xe9f0('0x43')][_0xe9f0('0x63')]);}})[_0xe9f0('0x14')](respondWithStatusCode(_0x14d111,null))['catch'](handleError(_0x14d111,null));};exports[_0xe9f0('0x151')]=function(_0x102508,_0x171313){var _0x4c8f97={};var _0x4d96aa={};var _0x4450af;var _0x394108;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x102508['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x171313,null))[_0xe9f0('0x14')](function(_0x541e67){if(_0x541e67){_0x4450af=_0x541e67;_0x4d96aa[_0xe9f0('0x56')]=_['keys'](db['MailAccount'][_0xe9f0('0x3d')]);_0x4d96aa[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x102508[_0xe9f0('0x43')]);_0x4d96aa[_0xe9f0('0x5a')]=_['intersection'](_0x4d96aa[_0xe9f0('0x56')],_0x4d96aa[_0xe9f0('0x43')]);_0x4c8f97['attributes']=_[_0xe9f0('0x5b')](_0x4d96aa[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x102508['query'][_0xe9f0('0x5c')]));_0x4c8f97[_0xe9f0('0x46')]=_0x4c8f97['attributes'][_0xe9f0('0x4a')]?_0x4c8f97[_0xe9f0('0x46')]:_0x4d96aa['model'];_0x4c8f97['order']=qs[_0xe9f0('0xd3')](_0x102508[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x4c8f97['where']=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x102508[_0xe9f0('0x43')],_0x4d96aa[_0xe9f0('0x5a')]));if(_0x102508[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x4c8f97[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x4c8f97['where'],{'$or':_[_0xe9f0('0x35')](_0x4c8f97[_0xe9f0('0x46')],function(_0xab35a9){var _0x4a19f5={};_0x4a19f5[_0xab35a9]={'$like':'%'+_0x102508[_0xe9f0('0x43')]['filter']+'%'};return _0x4a19f5;})});}_0x4c8f97=_['merge']({},_0x4c8f97,_0x102508['options']);return _0x4450af[_0xe9f0('0x151')](_0x4c8f97);}})[_0xe9f0('0x14')](function(_0xbed28c){if(_0xbed28c){_0x394108=_0xbed28c[_0xe9f0('0x4a')];if(!_0x102508[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x4c8f97['limit']=qs['limit'](_0x102508[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x4c8f97['offset']=qs[_0xe9f0('0x22')](_0x102508['query'][_0xe9f0('0x22')]);}return _0x4450af[_0xe9f0('0x151')](_0x4c8f97);}})[_0xe9f0('0x14')](function(_0x50d6cf){if(_0x50d6cf){return _0x50d6cf?{'count':_0x394108,'rows':_0x50d6cf}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x171313,null))[_0xe9f0('0x1e')](handleError(_0x171313,null));};exports[_0xe9f0('0x152')]=function(_0x2412b4,_0x2d6d6f){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x2412b4['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x2d6d6f,null))[_0xe9f0('0x14')](function(_0x2aef76){if(_0x2aef76){return _0x2aef76['addMailAccounts'](_0x2412b4['body'][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x2412b4['body'],[_0xe9f0('0x63'),'id'])||{});}})['then'](respondWithResult(_0x2d6d6f,null))['catch'](handleError(_0x2d6d6f,null));};exports[_0xe9f0('0x153')]=function(_0x524e85,_0x300272){return db['User']['find']({'where':{'id':_0x524e85[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x300272,null))[_0xe9f0('0x14')](function(_0x23ee34){if(_0x23ee34){return _0x23ee34['removeMailAccounts'](_0x524e85[_0xe9f0('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x300272,null))['catch'](handleError(_0x300272,null));};exports['getOpenchannelAccounts']=function(_0x5b49a7,_0x1a39b6){var _0x11c25d={};var _0x2427ec={};var _0x3de52e;var _0x187c98;return db[_0xe9f0('0x42')]['findOne']({'where':{'id':_0x5b49a7[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x1a39b6,null))['then'](function(_0x4a55e1){if(_0x4a55e1){_0x3de52e=_0x4a55e1;_0x2427ec[_0xe9f0('0x56')]=_['keys'](db[_0xe9f0('0x154')][_0xe9f0('0x3d')]);_0x2427ec['query']=_[_0xe9f0('0x58')](_0x5b49a7['query']);_0x2427ec[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x2427ec[_0xe9f0('0x56')],_0x2427ec[_0xe9f0('0x43')]);_0x11c25d[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x2427ec['model'],qs[_0xe9f0('0x5c')](_0x5b49a7['query'][_0xe9f0('0x5c')]));_0x11c25d[_0xe9f0('0x46')]=_0x11c25d[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x11c25d[_0xe9f0('0x46')]:_0x2427ec[_0xe9f0('0x56')];_0x11c25d[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x5b49a7[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x11c25d[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_['pick'](_0x5b49a7[_0xe9f0('0x43')],_0x2427ec[_0xe9f0('0x5a')]));if(_0x5b49a7[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x11c25d[_0xe9f0('0x41')]=_['merge'](_0x11c25d['where'],{'$or':_[_0xe9f0('0x35')](_0x11c25d[_0xe9f0('0x46')],function(_0x342616){var _0x51efd8={};_0x51efd8[_0x342616]={'$like':'%'+_0x5b49a7[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x51efd8;})});}_0x11c25d=_[_0xe9f0('0x5d')]({},_0x11c25d,_0x5b49a7[_0xe9f0('0x5e')]);return _0x3de52e['getOpenchannelAccounts'](_0x11c25d);}})[_0xe9f0('0x14')](function(_0x16cdd6){if(_0x16cdd6){_0x187c98=_0x16cdd6['length'];if(!_0x5b49a7[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x11c25d[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x5b49a7[_0xe9f0('0x43')]['limit']);_0x11c25d[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x5b49a7['query'][_0xe9f0('0x22')]);}return _0x3de52e[_0xe9f0('0x155')](_0x11c25d);}})[_0xe9f0('0x14')](function(_0x38418d){if(_0x38418d){return _0x38418d?{'count':_0x187c98,'rows':_0x38418d}:null;}})['then'](respondWithResult(_0x1a39b6,null))[_0xe9f0('0x1e')](handleError(_0x1a39b6,null));};exports[_0xe9f0('0x156')]=function(_0x151548,_0xe2d98e){return db['User'][_0xe9f0('0x36')]({'where':{'id':_0x151548[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0xe2d98e,null))[_0xe9f0('0x14')](function(_0x2d79e4){if(_0x2d79e4){return _0x2d79e4[_0xe9f0('0x156')](_0x151548['body']['ids'],_[_0xe9f0('0x64')](_0x151548['body'],['ids','id'])||{});}})[_0xe9f0('0x14')](respondWithResult(_0xe2d98e,null))[_0xe9f0('0x1e')](handleError(_0xe2d98e,null));};exports[_0xe9f0('0x157')]=function(_0x3e4728,_0x5ab145){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x3e4728['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x5ab145,null))['then'](function(_0x3f492c){if(_0x3f492c){return _0x3f492c[_0xe9f0('0x157')](_0x3e4728[_0xe9f0('0x43')][_0xe9f0('0x63')]);}})[_0xe9f0('0x14')](respondWithStatusCode(_0x5ab145,null))[_0xe9f0('0x1e')](handleError(_0x5ab145,null));};exports[_0xe9f0('0x158')]=function(_0x3688f5,_0x2a35df){var _0x49bde3={};var _0x9f5d95={};var _0x13d724;var _0x18d809;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x3688f5['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x2a35df,null))[_0xe9f0('0x14')](function(_0x4a1d5c){if(_0x4a1d5c){_0x13d724=_0x4a1d5c;_0x9f5d95[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db['SmsAccount'][_0xe9f0('0x3d')]);_0x9f5d95['query']=_[_0xe9f0('0x58')](_0x3688f5['query']);_0x9f5d95['filters']=_[_0xe9f0('0x5b')](_0x9f5d95[_0xe9f0('0x56')],_0x9f5d95[_0xe9f0('0x43')]);_0x49bde3[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x9f5d95['model'],qs['fields'](_0x3688f5['query'][_0xe9f0('0x5c')]));_0x49bde3[_0xe9f0('0x46')]=_0x49bde3[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x49bde3['attributes']:_0x9f5d95['model'];_0x49bde3[_0xe9f0('0xde')]=qs['sort'](_0x3688f5[_0xe9f0('0x43')]['sort']);_0x49bde3[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x3688f5[_0xe9f0('0x43')],_0x9f5d95[_0xe9f0('0x5a')]));if(_0x3688f5['query']['filter']){_0x49bde3['where']=_['merge'](_0x49bde3['where'],{'$or':_[_0xe9f0('0x35')](_0x49bde3[_0xe9f0('0x46')],function(_0x29aa4f){var _0x39bb05={};_0x39bb05[_0x29aa4f]={'$like':'%'+_0x3688f5[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x39bb05;})});}_0x49bde3=_[_0xe9f0('0x5d')]({},_0x49bde3,_0x3688f5[_0xe9f0('0x5e')]);return _0x13d724[_0xe9f0('0x158')](_0x49bde3);}})[_0xe9f0('0x14')](function(_0x4b0e67){if(_0x4b0e67){_0x18d809=_0x4b0e67['length'];if(!_0x3688f5[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x49bde3[_0xe9f0('0x24')]=qs['limit'](_0x3688f5[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x49bde3['offset']=qs[_0xe9f0('0x22')](_0x3688f5[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x13d724['getSmsAccounts'](_0x49bde3);}})[_0xe9f0('0x14')](function(_0x1b8163){if(_0x1b8163){return _0x1b8163?{'count':_0x18d809,'rows':_0x1b8163}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x2a35df,null))[_0xe9f0('0x1e')](handleError(_0x2a35df,null));};exports['addSmsAccounts']=function(_0x39a712,_0x33e588){return db[_0xe9f0('0x42')]['find']({'where':{'id':_0x39a712[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x33e588,null))['then'](function(_0x175eda){if(_0x175eda){return _0x175eda['addSmsAccounts'](_0x39a712[_0xe9f0('0x60')][_0xe9f0('0x63')],_['omit'](_0x39a712[_0xe9f0('0x60')],[_0xe9f0('0x63'),'id'])||{});}})['then'](respondWithResult(_0x33e588,null))['catch'](handleError(_0x33e588,null));};exports[_0xe9f0('0x159')]=function(_0x3419da,_0x33ce41){return db['User'][_0xe9f0('0x36')]({'where':{'id':_0x3419da[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x33ce41,null))[_0xe9f0('0x14')](function(_0x259a8d){if(_0x259a8d){return _0x259a8d[_0xe9f0('0x159')](_0x3419da[_0xe9f0('0x43')]['ids']);}})[_0xe9f0('0x14')](respondWithStatusCode(_0x33ce41,null))[_0xe9f0('0x1e')](handleError(_0x33ce41,null));};exports[_0xe9f0('0x15a')]=function(_0x4d6d89,_0x53a295){var _0xf36ac9={};var _0x27d0ae={};var _0x51db6c;var _0x3ba5d8;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x4d6d89[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x53a295,null))[_0xe9f0('0x14')](function(_0x27e779){if(_0x27e779){_0x51db6c=_0x27e779;_0x27d0ae[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db[_0xe9f0('0x15b')][_0xe9f0('0x3d')]);_0x27d0ae[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x4d6d89['query']);_0x27d0ae[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x27d0ae[_0xe9f0('0x56')],_0x27d0ae[_0xe9f0('0x43')]);_0xf36ac9['attributes']=_[_0xe9f0('0x5b')](_0x27d0ae[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x4d6d89[_0xe9f0('0x43')]['fields']));_0xf36ac9[_0xe9f0('0x46')]=_0xf36ac9[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0xf36ac9[_0xe9f0('0x46')]:_0x27d0ae[_0xe9f0('0x56')];_0xf36ac9['order']=qs['sort'](_0x4d6d89[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0xf36ac9['where']=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x4d6d89[_0xe9f0('0x43')],_0x27d0ae['filters']));if(_0x4d6d89[_0xe9f0('0x43')]['filter']){_0xf36ac9[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0xf36ac9['where'],{'$or':_[_0xe9f0('0x35')](_0xf36ac9['attributes'],function(_0x57e2ac){var _0x41da05={};_0x41da05[_0x57e2ac]={'$like':'%'+_0x4d6d89[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x41da05;})});}_0xf36ac9=_[_0xe9f0('0x5d')]({},_0xf36ac9,_0x4d6d89[_0xe9f0('0x5e')]);return _0x51db6c[_0xe9f0('0x15a')](_0xf36ac9);}})[_0xe9f0('0x14')](function(_0x32c17a){if(_0x32c17a){_0x3ba5d8=_0x32c17a['length'];if(!_0x4d6d89[_0xe9f0('0x43')][_0xe9f0('0xd6')]('nolimit')){_0xf36ac9['limit']=qs['limit'](_0x4d6d89[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0xf36ac9['offset']=qs[_0xe9f0('0x22')](_0x4d6d89[_0xe9f0('0x43')]['offset']);}return _0x51db6c['getChatWebsites'](_0xf36ac9);}})[_0xe9f0('0x14')](function(_0x457ec9){if(_0x457ec9){return _0x457ec9?{'count':_0x3ba5d8,'rows':_0x457ec9}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x53a295,null))['catch'](handleError(_0x53a295,null));};exports[_0xe9f0('0x15c')]=function(_0x570444,_0x2c6152){return db[_0xe9f0('0x42')]['find']({'where':{'id':_0x570444[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x2c6152,null))[_0xe9f0('0x14')](function(_0x4e4a08){if(_0x4e4a08){return _0x4e4a08['addChatWebsites'](_0x570444['body']['ids'],_['omit'](_0x570444[_0xe9f0('0x60')],[_0xe9f0('0x63'),'id'])||{});}})['then'](respondWithResult(_0x2c6152,null))[_0xe9f0('0x1e')](handleError(_0x2c6152,null));};exports[_0xe9f0('0x15d')]=function(_0x25d301,_0x15d270){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x25d301[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x15d270,null))['then'](function(_0x271122){if(_0x271122){return _0x271122[_0xe9f0('0x15d')](_0x25d301[_0xe9f0('0x43')][_0xe9f0('0x63')]);}})[_0xe9f0('0x14')](respondWithStatusCode(_0x15d270,null))['catch'](handleError(_0x15d270,null));};exports[_0xe9f0('0x15e')]=function(_0x178c32,_0x545a7f){var _0x22fad9={};var _0x49bfcf={};var _0x30dcb2;var _0x378f44;return db['User']['findOne']({'where':{'id':_0x178c32[_0xe9f0('0x55')]['id']}})['then'](handleEntityNotFound(_0x545a7f,null))[_0xe9f0('0x14')](function(_0x23a2e4){if(_0x23a2e4){_0x30dcb2=_0x23a2e4;_0x49bfcf[_0xe9f0('0x56')]=_['keys'](db[_0xe9f0('0x15f')][_0xe9f0('0x3d')]);_0x49bfcf[_0xe9f0('0x43')]=_['keys'](_0x178c32[_0xe9f0('0x43')]);_0x49bfcf[_0xe9f0('0x5a')]=_['intersection'](_0x49bfcf['model'],_0x49bfcf['query']);_0x22fad9[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x49bfcf['model'],qs[_0xe9f0('0x5c')](_0x178c32['query'][_0xe9f0('0x5c')]));_0x22fad9['attributes']=_0x22fad9[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x22fad9['attributes']:_0x49bfcf[_0xe9f0('0x56')];_0x22fad9[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x178c32[_0xe9f0('0x43')]['sort']);_0x22fad9[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x178c32[_0xe9f0('0x43')],_0x49bfcf[_0xe9f0('0x5a')]));if(_0x178c32[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x22fad9['where']=_[_0xe9f0('0x5d')](_0x22fad9['where'],{'$or':_[_0xe9f0('0x35')](_0x22fad9[_0xe9f0('0x46')],function(_0x259cb8){var _0x330e56={};_0x330e56[_0x259cb8]={'$like':'%'+_0x178c32[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x330e56;})});}_0x22fad9=_[_0xe9f0('0x5d')]({},_0x22fad9,_0x178c32[_0xe9f0('0x5e')]);return _0x30dcb2[_0xe9f0('0x15e')](_0x22fad9);}})[_0xe9f0('0x14')](function(_0x9a619){if(_0x9a619){_0x378f44=_0x9a619[_0xe9f0('0x4a')];if(!_0x178c32[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x22fad9[_0xe9f0('0x24')]=qs['limit'](_0x178c32[_0xe9f0('0x43')][_0xe9f0('0x24')]);_0x22fad9[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x178c32['query'][_0xe9f0('0x22')]);}return _0x30dcb2[_0xe9f0('0x15e')](_0x22fad9);}})[_0xe9f0('0x14')](function(_0x5f3ab4){if(_0x5f3ab4){return _0x5f3ab4?{'count':_0x378f44,'rows':_0x5f3ab4}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x545a7f,null))[_0xe9f0('0x1e')](handleError(_0x545a7f,null));};exports[_0xe9f0('0x160')]=function(_0x1266fd,_0x511a4d){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x1266fd[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x511a4d,null))[_0xe9f0('0x14')](function(_0x1f63e1){if(_0x1f63e1){return _0x1f63e1[_0xe9f0('0x160')](_0x1266fd['body'][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x1266fd[_0xe9f0('0x60')],[_0xe9f0('0x63'),'id'])||{});}})[_0xe9f0('0x14')](respondWithResult(_0x511a4d,null))[_0xe9f0('0x1e')](handleError(_0x511a4d,null));};exports[_0xe9f0('0x161')]=function(_0x41ce56,_0x5b7f5a){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x41ce56['params']['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x5b7f5a,null))[_0xe9f0('0x14')](function(_0x1c6a56){if(_0x1c6a56){return _0x1c6a56[_0xe9f0('0x161')](_0x41ce56[_0xe9f0('0x43')]['ids']);}})[_0xe9f0('0x14')](respondWithStatusCode(_0x5b7f5a,null))['catch'](handleError(_0x5b7f5a,null));};exports['getSquareProjects']=function(_0x32b967,_0x44a816){var _0x58a2ef={};var _0x291be7={};var _0x50a397;var _0x26b3d8;return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x32b967[_0xe9f0('0x55')]['id']}})['then'](handleEntityNotFound(_0x44a816,null))['then'](function(_0x36c3e6){if(_0x36c3e6){_0x50a397=_0x36c3e6;_0x291be7[_0xe9f0('0x56')]=_[_0xe9f0('0x58')](db[_0xe9f0('0x162')]['rawAttributes']);_0x291be7[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x32b967[_0xe9f0('0x43')]);_0x291be7[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x291be7[_0xe9f0('0x56')],_0x291be7[_0xe9f0('0x43')]);_0x58a2ef[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x291be7[_0xe9f0('0x56')],qs[_0xe9f0('0x5c')](_0x32b967[_0xe9f0('0x43')][_0xe9f0('0x5c')]));_0x58a2ef[_0xe9f0('0x46')]=_0x58a2ef['attributes']['length']?_0x58a2ef[_0xe9f0('0x46')]:_0x291be7[_0xe9f0('0x56')];_0x58a2ef[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x32b967[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x58a2ef[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x32b967[_0xe9f0('0x43')],_0x291be7[_0xe9f0('0x5a')]));if(_0x32b967[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x58a2ef[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x58a2ef[_0xe9f0('0x41')],{'$or':_[_0xe9f0('0x35')](_0x58a2ef[_0xe9f0('0x46')],function(_0x2b6ce9){var _0x188a8d={};_0x188a8d[_0x2b6ce9]={'$like':'%'+_0x32b967[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x188a8d;})});}_0x58a2ef=_[_0xe9f0('0x5d')]({},_0x58a2ef,_0x32b967[_0xe9f0('0x5e')]);return _0x50a397[_0xe9f0('0x163')](_0x58a2ef);}})['then'](function(_0x4753b7){if(_0x4753b7){_0x26b3d8=_0x4753b7[_0xe9f0('0x4a')];if(!_0x32b967[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x58a2ef[_0xe9f0('0x24')]=qs['limit'](_0x32b967['query']['limit']);_0x58a2ef['offset']=qs[_0xe9f0('0x22')](_0x32b967[_0xe9f0('0x43')][_0xe9f0('0x22')]);}return _0x50a397[_0xe9f0('0x163')](_0x58a2ef);}})[_0xe9f0('0x14')](function(_0x6cc818){if(_0x6cc818){return _0x6cc818?{'count':_0x26b3d8,'rows':_0x6cc818}:null;}})[_0xe9f0('0x14')](respondWithResult(_0x44a816,null))[_0xe9f0('0x1e')](handleError(_0x44a816,null));};exports['addSquareProjects']=function(_0x1d2125,_0x2bdcd6){return db['User'][_0xe9f0('0x36')]({'where':{'id':_0x1d2125[_0xe9f0('0x55')]['id']}})['then'](handleEntityNotFound(_0x2bdcd6,null))[_0xe9f0('0x14')](function(_0x398ec6){if(_0x398ec6){return _0x398ec6['addSquareProjects'](_0x1d2125[_0xe9f0('0x60')][_0xe9f0('0x63')],_[_0xe9f0('0x64')](_0x1d2125[_0xe9f0('0x60')],[_0xe9f0('0x63'),'id'])||{});}})[_0xe9f0('0x14')](respondWithResult(_0x2bdcd6,null))[_0xe9f0('0x1e')](handleError(_0x2bdcd6,null));};exports['removeSquareProjects']=function(_0x24e7d4,_0x77d415){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x24e7d4[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x77d415,null))[_0xe9f0('0x14')](function(_0x47d343){if(_0x47d343){return _0x47d343['removeSquareProjects'](_0x24e7d4['query']['ids']);}})['then'](respondWithStatusCode(_0x77d415,null))[_0xe9f0('0x1e')](handleError(_0x77d415,null));};exports[_0xe9f0('0x164')]=function(_0x25a11f,_0x5471b6){var _0x2d7cae={},_0x400fd6={},_0x2870bd={'count':0x0,'rows':[]};var _0x49bda8=db[_0xe9f0('0x165')]['rawAttributes'];_0x400fd6[_0xe9f0('0x56')]=_['keys'](_0x49bda8);_0x400fd6[_0xe9f0('0x43')]=_[_0xe9f0('0x58')](_0x25a11f[_0xe9f0('0x43')]);_0x400fd6[_0xe9f0('0x5a')]=_[_0xe9f0('0x5b')](_0x400fd6[_0xe9f0('0x56')],_0x400fd6[_0xe9f0('0x43')]);_0x400fd6[_0xe9f0('0x5a')]=_[_0xe9f0('0x106')](_0x400fd6[_0xe9f0('0x5a')],[_0xe9f0('0x166'),_0xe9f0('0x167'),_0xe9f0('0x168'),_0xe9f0('0x169'),'$lt','$lte',_0xe9f0('0x16a'),_0xe9f0('0x16b'),_0xe9f0('0x16c'),_0xe9f0('0x16d'),_0xe9f0('0x16e'),_0xe9f0('0x16f'),'$notIn',_0xe9f0('0x170'),'$notLike',_0xe9f0('0x171'),_0xe9f0('0x172'),'$like',_0xe9f0('0x173'),'$contains','$contained',_0xe9f0('0x174')]);_0x2d7cae[_0xe9f0('0x46')]=_[_0xe9f0('0x5b')](_0x400fd6['model'],qs[_0xe9f0('0x5c')](_0x25a11f['query'][_0xe9f0('0x5c')]));_0x2d7cae[_0xe9f0('0x46')]=_0x2d7cae[_0xe9f0('0x46')][_0xe9f0('0x4a')]?_0x2d7cae[_0xe9f0('0x46')]:_0x400fd6[_0xe9f0('0x56')];if(!_0x25a11f[_0xe9f0('0x43')]['hasOwnProperty']('nolimit')){_0x2d7cae[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x25a11f['query'][_0xe9f0('0x24')]);_0x2d7cae[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x25a11f[_0xe9f0('0x43')][_0xe9f0('0x22')]);}_0x2d7cae[_0xe9f0('0xde')]=qs[_0xe9f0('0xd3')](_0x25a11f[_0xe9f0('0x43')][_0xe9f0('0xd3')]);_0x2d7cae[_0xe9f0('0x41')]=qs[_0xe9f0('0x5a')](_[_0xe9f0('0xd4')](_0x25a11f[_0xe9f0('0x43')],_0x400fd6[_0xe9f0('0x5a')]));if(_0x25a11f[_0xe9f0('0x43')][_0xe9f0('0x33')]){_0x2d7cae[_0xe9f0('0x41')]=_[_0xe9f0('0x5d')](_0x2d7cae['where'],{'$or':_[_0xe9f0('0x35')](_0x2d7cae[_0xe9f0('0x46')],function(_0x5b100c){var _0x140701={};_0x140701[_0x5b100c]={'$like':'%'+_0x25a11f[_0xe9f0('0x43')][_0xe9f0('0x33')]+'%'};return _0x140701;})});}_0x2d7cae[_0xe9f0('0x41')]={'$and':[_0x2d7cae[_0xe9f0('0x41')],{'$or':[{'UserId':_0x25a11f[_0xe9f0('0x55')]['id']},{'OwnerId':_0x25a11f[_0xe9f0('0x55')]['id']}]}]};_0x2d7cae=_[_0xe9f0('0x5d')]({},_0x2d7cae,_0x25a11f['options']);var _0xb9fc05={'where':_0x2d7cae[_0xe9f0('0x41')]};return db[_0xe9f0('0x165')]['count'](_0xb9fc05)[_0xe9f0('0x14')](function(_0x1963f0){_0x2870bd[_0xe9f0('0x25')]=_0x1963f0;if(_0x25a11f[_0xe9f0('0x43')][_0xe9f0('0x44')]){_0x2d7cae[_0xe9f0('0x45')]=[{'attributes':['id',_0xe9f0('0x175'),'lastName',_0xe9f0('0xf2')],'model':db[_0xe9f0('0x176')],'as':_0xe9f0('0x177')},{'attributes':['id',_0xe9f0('0x38'),_0xe9f0('0x178')],'model':db['VoiceQueue'],'as':_0xe9f0('0xdd')}];}return db[_0xe9f0('0x165')][_0xe9f0('0x47')](_0x2d7cae);})[_0xe9f0('0x14')](function(_0x35bc72){_0x2870bd[_0xe9f0('0x4d')]=_0x35bc72;return _0x2870bd;})['then'](respondWithFilteredResult(_0x5471b6,_0x2d7cae))[_0xe9f0('0x1e')](handleError(_0x5471b6,null));};exports[_0xe9f0('0x179')]=function(_0x2baf0a,_0x475397){if(!_[_0xe9f0('0x6a')](_0x2baf0a[_0xe9f0('0x2e')]['id'])&&(_0x2baf0a['user'][_0xe9f0('0x2b')]==_0xe9f0('0x2c')||_0x2baf0a['user'][_0xe9f0('0x2b')]==_0xe9f0('0x2e'))){return db[_0xe9f0('0x42')][_0xe9f0('0xd2')]({'where':{'id':_0x2baf0a[_0xe9f0('0x55')]['id']},'raw':!![]})[_0xe9f0('0x14')](function(_0x24b026){return authService[_0xe9f0('0x17a')](_0x24b026);})[_0xe9f0('0x14')](function(_0x824cb0){if(_0x824cb0){return _0x475397[_0xe9f0('0x1f')](0xc8)[_0xe9f0('0x21')]({'api_key':_0x824cb0[_0xe9f0('0x17b')]});}else{return _0x475397[_0xe9f0('0x1f')](0xcc)[_0xe9f0('0x21')]({'message':_0xe9f0('0x17c')});}})[_0xe9f0('0x1e')](handleError(_0x475397,0x193));}else{return _0x475397[_0xe9f0('0x1f')](0x191)[_0xe9f0('0x21')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xe9f0('0x17d')]=function(_0x3a4144,_0xbefd52){if(!_['isNil'](_0x3a4144['user']['id'])&&(_0x3a4144['user']['role']==_0xe9f0('0x2c')||_0x3a4144['user'][_0xe9f0('0x2b')]==_0xe9f0('0x2e'))){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x3a4144[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](function(_0x5bd4b7){return authService['generateApiKey'](_0x5bd4b7);})[_0xe9f0('0x14')](function(_0x349514){return db[_0xe9f0('0x42')][_0xe9f0('0x28')]({'apiKeyIat':_0x349514[_0xe9f0('0x17e')],'apiKeyNonce':_0x349514['nonce']},{'where':{'id':_0x3a4144[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](function(){return _0xbefd52[_0xe9f0('0x1f')](0xc8)[_0xe9f0('0x21')]({'api_key':_0x349514[_0xe9f0('0x17b')]});});})[_0xe9f0('0x1e')](handleError(_0xbefd52,0x193));}else{return _0xbefd52[_0xe9f0('0x1f')](0x191)[_0xe9f0('0x21')]({'message':_0xe9f0('0x17f')});}};exports[_0xe9f0('0x180')]=function(_0x5e3a2c,_0x3d479a){if(!_[_0xe9f0('0x6a')](_0x5e3a2c[_0xe9f0('0x2e')]['id'])&&(_0x5e3a2c[_0xe9f0('0x2e')]['role']==_0xe9f0('0x2c')||_0x5e3a2c[_0xe9f0('0x2e')][_0xe9f0('0x2b')]==_0xe9f0('0x2e'))){return db[_0xe9f0('0x42')][_0xe9f0('0x36')]({'where':{'id':_0x5e3a2c[_0xe9f0('0x55')]['id']}})[_0xe9f0('0x14')](handleEntityNotFound(_0x3d479a,null))[_0xe9f0('0x14')](function(_0x386fbd){if(_0x386fbd&&_0x386fbd['apiKeyNonce']&&_0x386fbd[_0xe9f0('0x181')])return _0x386fbd;else throw{'message':_0xe9f0('0x182')};})[_0xe9f0('0x14')](function(_0x44aa63){return db[_0xe9f0('0x42')][_0xe9f0('0x28')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x5e3a2c[_0xe9f0('0x55')]['id']}});})[_0xe9f0('0x14')](respondWithStatusCode(_0x3d479a,0xc8))['catch'](handleError(_0x3d479a,0x193));}else{return _0x3d479a[_0xe9f0('0x1f')](0x191)[_0xe9f0('0x21')]({'message':_0xe9f0('0x17f')});}};exports[_0xe9f0('0x183')]=function(_0x11be0e,_0x303618){var _0x1b4a71=_0x11be0e['user'][_0xe9f0('0x2a')]({'plain':!![]});if(!_0x1b4a71){return _0x303618[_0xe9f0('0x1f')](0x191)[_0xe9f0('0x3b')](_0xe9f0('0x184'));}else{return _0x303618[_0xe9f0('0x1f')](0xc8)[_0xe9f0('0x21')](_0x1b4a71);}};exports['getPresence']=function(_0xf9964b,_0x2ec0f7){var _0x535888={'offset':0x0},_0x256c3b={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(!_0xf9964b['query']['filter']&&!_0xf9964b[_0xe9f0('0x43')]['teams']&&!_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0x185')])return[];return Promise[_0xe9f0('0x108')]()[_0xe9f0('0x14')](function(){var _0x20f10a=[];if(!_['isEmpty'](_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0x186')])){_0x20f10a[_0xe9f0('0x4b')](db[_0xe9f0('0x118')]['findAll']({'attributes':['id',_0xe9f0('0x38')],'where':{'id':_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0x186')]}}));}if(!_[_0xe9f0('0x91')](_0xf9964b[_0xe9f0('0x43')]['queues'])){_0x20f10a[_0xe9f0('0x4b')](db[_0xe9f0('0xaf')]['findAll']({'attributes':['id',_0xe9f0('0x38')],'type':_0xe9f0('0x187'),'where':{'id':_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0x185')]}}));}return Promise[_0xe9f0('0x8e')](_0x20f10a);})[_0xe9f0('0x14')](function(_0x362ea6){var _0x50a129=_[_0xe9f0('0x126')](_0x362ea6)[_0xe9f0('0x35')](function(_0x56dbcf){return _0x56dbcf[_0xe9f0('0x188')]({'attributes':['id',_0xe9f0('0x38'),_0xe9f0('0x65'),_0xe9f0('0xb0')],'raw':!![]});});return Promise[_0xe9f0('0x8e')](_0x50a129);})[_0xe9f0('0x14')](function(_0x34ad34){var _0x43754b=_[_0xe9f0('0x126')](_0x34ad34);if(!_0xf9964b[_0xe9f0('0x43')]['filter'])return _0x43754b;if(_['isEmpty'](_0x43754b)){return db[_0xe9f0('0x42')]['findAll']({'attributes':['id',_0xe9f0('0x38'),_0xe9f0('0x65'),'online'],'where':{'role':_0xe9f0('0x30'),'$or':[db['sequelize'][_0xe9f0('0x41')](db[_0xe9f0('0x6c')]['fn'](_0xe9f0('0x189'),db[_0xe9f0('0x6c')][_0xe9f0('0x18a')](_0xe9f0('0x38'))),{'$like':'%'+_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0x33')][_0xe9f0('0xa8')]()+'%'}),{'internal':{'$like':'%'+_0xf9964b[_0xe9f0('0x43')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x43754b)[_0xe9f0('0x126')]()[_0xe9f0('0x33')](function(_0x2ff387){return _0x2ff387[_0xe9f0('0x38')][_0xe9f0('0xa8')]()['includes'](_0xf9964b['query'][_0xe9f0('0x33')][_0xe9f0('0xa8')]())||_0x2ff387[_0xe9f0('0x65')][_0xe9f0('0x18b')]()[_0xe9f0('0x5f')](_0xf9964b[_0xe9f0('0x43')]['filter']);})[_0xe9f0('0x37')]();}})[_0xe9f0('0x14')](function(_0x31af56){var _0x1c93a6=_0xe9f0('0x38');var _0x4f0e56='asc';if(_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0xd3')]){var _0x4f0e56=_0xf9964b['query']['sort'][0x0]==='-'?_0xe9f0('0x18c'):'asc';var _0x1c93a6=_0x4f0e56==='asc'?_0xf9964b[_0xe9f0('0x43')]['sort']:_0xf9964b['query'][_0xe9f0('0xd3')]['substring'](0x1);}return _(_0x31af56)[_0xe9f0('0x18d')]('id')[_0xe9f0('0x18e')]([function(_0x5d5c71){return _0x1c93a6==='name'?_0x5d5c71[_0x1c93a6][_0xe9f0('0xa8')]():_0x5d5c71[_0x1c93a6];}],[_0x4f0e56])['map'](function(_0x1d3e22){return _[_0xe9f0('0xd4')](_0x1d3e22,['id',_0xe9f0('0x38'),_0xe9f0('0x65'),_0xe9f0('0xb0')]);})[_0xe9f0('0x37')]();})[_0xe9f0('0x14')](function(_0x5ade7f){return client[_0xe9f0('0x18f')](_0xe9f0('0x2f'),_0xf9964b)[_0xe9f0('0x14')](function(_0x15b9ad){if(_0x15b9ad[_0xe9f0('0x1a')])throw new Error(_0xe9f0('0x190'));var _0x43c559=_0x15b9ad[_0xe9f0('0x1d')];var _0x422aea=jayson[_0xe9f0('0x12')][_0xe9f0('0x13')]({'port':0x232c});return _0x422aea[_0xe9f0('0x18f')](_0xe9f0('0x2f'),_0xf9964b)['then'](function(_0x296f0){if(_0x296f0[_0xe9f0('0x1a')])throw new Error(_0xe9f0('0x191'));var _0x158ccf=_0x296f0['result'];return _['merge']({},_0x158ccf,_0x43c559);});})['then'](function(_0x21a82a){return _[_0xe9f0('0x35')](_0x5ade7f,function(_0x324b0a){var _0x135b69=_[_0xe9f0('0x36')](_0x21a82a[_0xe9f0('0x4d')],['id',_0x324b0a['id']]);if(!_0x135b69||!_0x324b0a['online']){_0x324b0a['status']=_0xe9f0('0x192');}else if(_0x135b69['voicePause']){_0x324b0a[_0xe9f0('0x1f')]=_0xe9f0('0x10a');}else{_0x324b0a[_0xe9f0('0x1f')]=_[_0xe9f0('0x5f')]([_0xe9f0('0x193'),_0xe9f0('0x194'),_0xe9f0('0x195'),_0xe9f0('0x196'),null,undefined],_0x135b69['voiceStatus'])?_0xe9f0('0xb0'):_0xe9f0('0x197');}return _0x324b0a;});});});})[_0xe9f0('0x14')](function(_0x5117bb){if(!_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0xd6')](_0xe9f0('0xe0'))){_0x535888[_0xe9f0('0x24')]=qs['limit'](_0xf9964b[_0xe9f0('0x43')]['limit']||0xa);_0x535888['offset']=qs[_0xe9f0('0x22')](_0xf9964b[_0xe9f0('0x43')][_0xe9f0('0x22')]);}_0x256c3b[_0xe9f0('0x25')]=_0x5117bb[_0xe9f0('0x4a')];_0x256c3b[_0xe9f0('0x4d')]=_0x535888[_0xe9f0('0x24')]?_0x5117bb[_0xe9f0('0x198')](_0x535888[_0xe9f0('0x22')],_0x535888['offset']+_0x535888[_0xe9f0('0x24')]):_0x5117bb;return _0x256c3b;})[_0xe9f0('0x14')](respondWithFilteredResult(_0x2ec0f7,_0x535888))[_0xe9f0('0x1e')](handleError(_0x2ec0f7,null));};function get_open_tabs(_0x15a003,_0x1d877a){var _0x157a3a=_0x15a003['charAt'](0x0)[_0xe9f0('0x199')]()+_0x15a003[_0xe9f0('0x198')](0x1);var _0x274023={'type':db[_0xe9f0('0x96')][_0xe9f0('0x19a')][_0xe9f0('0x6e')],'raw':!![]};return new BPromise(function(_0x1ce031,_0x42f68e){var _0x4c262b=squel['select']()[_0xe9f0('0x19b')](_0xe9f0('0x19c')+_0x157a3a+_0xe9f0('0x19d'),'id')[_0xe9f0('0x19b')]('ui.createdAt')['from'](_0xe9f0('0x19e')+_0x15a003+_0xe9f0('0x19f'),'ui')[_0xe9f0('0x41')]('ui.UserId\x20=\x20?',_0x1d877a['id']);return db[_0xe9f0('0x6c')][_0xe9f0('0x43')](_0x4c262b[_0xe9f0('0x18b')](),_0x274023)[_0xe9f0('0x14')](function(_0x3ea2c7){_0x1d877a[_0x157a3a+_0xe9f0('0x1a0')]=_0x3ea2c7;_0x1ce031(_0x3ea2c7);})[_0xe9f0('0x1e')](function(_0x1e10ed){_0x42f68e(_0x1e10ed);});});};
\ No newline at end of file
index 6b9f51c..89cb0d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc805=['hasOwnProperty','hook','exports','events','../../mysqldb','User','save','update','remove','emit'];(function(_0x1e0454,_0x30e055){var _0x1ba650=function(_0x3170d1){while(--_0x3170d1){_0x1e0454['push'](_0x1e0454['shift']());}};_0x1ba650(++_0x30e055);}(_0xc805,0x161));var _0x5c80=function(_0x6b888e,_0x420fed){_0x6b888e=_0x6b888e-0x0;var _0x17d0f6=_0xc805[_0x6b888e];return _0x17d0f6;};'use strict';var EventEmitter=require(_0x5c80('0x0'));var User=require(_0x5c80('0x1'))['db'][_0x5c80('0x2')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c80('0x3'),'afterUpdate':_0x5c80('0x4'),'afterDestroy':_0x5c80('0x5')};function emitEvent(_0x1ed38c){return function(_0x38d7d6,_0x5c01e5,_0x1ece97){UserEvents[_0x5c80('0x6')](_0x1ed38c+':'+_0x38d7d6['id'],_0x38d7d6);UserEvents[_0x5c80('0x6')](_0x1ed38c,_0x38d7d6);_0x1ece97(null);};}for(var e in events){if(events[_0x5c80('0x7')](e)){var event=events[e];User[_0x5c80('0x8')](e,emitEvent(event));}}module[_0x5c80('0x9')]=UserEvents;
\ No newline at end of file
+var _0xf9ed=['../../mysqldb','User','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x94b3b5,_0x1a2fac){var _0x113650=function(_0x55467e){while(--_0x55467e){_0x94b3b5['push'](_0x94b3b5['shift']());}};_0x113650(++_0x1a2fac);}(_0xf9ed,0xbd));var _0xdf9e=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xf9ed[_0x26462c];return _0x509a42;};'use strict';var EventEmitter=require(_0xdf9e('0x0'));var User=require(_0xdf9e('0x1'))['db'][_0xdf9e('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xdf9e('0x3')](0x0);var events={'afterCreate':_0xdf9e('0x4'),'afterUpdate':_0xdf9e('0x5'),'afterDestroy':_0xdf9e('0x6')};function emitEvent(_0x44ede1){return function(_0x2b0476,_0xe0d6e6,_0x172f07){UserEvents[_0xdf9e('0x7')](_0x44ede1+':'+_0x2b0476['id'],_0x2b0476);UserEvents[_0xdf9e('0x7')](_0x44ede1,_0x2b0476);_0x172f07(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0xdf9e('0x8')](e,emitEvent(event));}}module[_0xdf9e('0x9')]=UserEvents;
\ No newline at end of file
index 446ca56..088397d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ac=[':asterisk:','crypto','util','./user.attributes','length','context','format','%s%s','push','merge','CDR(type)=%s','record','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','wav','gsm','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxX','Hangup','priority','defaults','findAll','then','internal','name','concat','catch','exports','models','users','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','find','privacyEnabled','updateMd5Password','updatePassword','changed','VoiceExtension','bulkCreate','chanspy','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0xc5ac,0x93));var _0xcc5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5ac[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var crypto=require(_0xcc5a('0x0'));var util=require(_0xcc5a('0x1'));var md5=require('md5');var _=require('lodash');var attributes=require(_0xcc5a('0x2'));var authTypes=['google'];var validatePresenceOf=function(_0x25e963){return _0x25e963&&_0x25e963[_0xcc5a('0x3')];};var getChanSpyApplications=function(_0x35efec,_0xd572b1,_0x319349){var _0xfa6484={'context':_0x35efec[_0xcc5a('0x4')]||'from-sip','type':'system','isApp':![],'UserId':_0x35efec['id']};var _0x360138=[];for(var _0x5786ac=0x0,_0xd7a0e0=0x1;_0x5786ac<_0x319349[_0xcc5a('0x3')];_0x5786ac++,_0xd7a0e0=0x1){var _0x47fa81={'exten':util[_0xcc5a('0x5')](_0xcc5a('0x6'),_0x319349[_0x5786ac]['prefix'],_0xd572b1),'ChanSpyId':_0x319349[_0x5786ac]['id']};_0x360138[_0xcc5a('0x7')](_[_0xcc5a('0x8')]({'app':'Set','appdata':util['format'](_0xcc5a('0x9'),'chanspy'),'priority':_0xd7a0e0++},_0xfa6484,_0x47fa81));if(_0x319349[_0x5786ac][_0xcc5a('0xa')]){_0x360138[_0xcc5a('0x7')](_['merge']({'app':_0xcc5a('0xb'),'appdata':util[_0xcc5a('0x5')]('${UNIQUEID}.%s,a',_0x319349[_0x5786ac][_0xcc5a('0xc')]),'priority':_0xd7a0e0++},_0xfa6484,_0x47fa81));}if(_0x319349[_0x5786ac][_0xcc5a('0xd')]){_0x360138[_0xcc5a('0x7')](_[_0xcc5a('0x8')]({'app':_0xcc5a('0xe'),'appdata':_0x319349[_0x5786ac][_0xcc5a('0xf')],'priority':_0xd7a0e0++},_0xfa6484,_0x47fa81));}_0x360138['push'](_[_0xcc5a('0x8')]({'app':_0xcc5a('0x10'),'appdata':util[_0xcc5a('0x5')](_0xcc5a('0x11'),_0x35efec['name'],_0x319349[_0x5786ac]['options']?_0x319349[_0x5786ac][_0xcc5a('0x12')][_0xcc5a('0x13')](''):''),'priority':_0xd7a0e0++},_0xfa6484,_0x47fa81));if(_0x319349[_0x5786ac]['record']){_0x360138[_0xcc5a('0x7')](_['merge']({'app':_0xcc5a('0x14'),'priority':_0xd7a0e0++},_0xfa6484,_0x47fa81));}}return _0x360138;};var getUserApplications=function(_0x1b6602,_0x53ca89){var _0x352344=[_0xcc5a('0x15'),'WAV',_0xcc5a('0x16')];var _0x37ec81={'context':_0x1b6602[_0xcc5a('0x4')]||'from-sip','exten':_0x53ca89,'type':'system','isApp':![],'UserId':_0x1b6602['id']};var _0xa07844=[{'app':_0xcc5a('0x17'),'appdata':_0xcc5a('0x18')}];if(_0x1b6602[_0xcc5a('0x19')]&&_[_0xcc5a('0x1a')](_0x352344,_0x1b6602[_0xcc5a('0x19')])){_0xa07844[_0xcc5a('0x7')]({'app':_0xcc5a('0x17'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0xa07844[_0xcc5a('0x7')]({'app':'Set','appdata':util[_0xcc5a('0x5')](_0xcc5a('0x1b'),_0x1b6602[_0xcc5a('0x19')])});_0xa07844['push']({'app':_0xcc5a('0x1c'),'appdata':util[_0xcc5a('0x5')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x1b6602['name'])});}else{_0xa07844[_0xcc5a('0x7')]({'app':_0xcc5a('0x1c'),'appdata':util[_0xcc5a('0x5')](_0xcc5a('0x1d'),_0x1b6602['name'])});}_0xa07844[_0xcc5a('0x7')]({'app':_0xcc5a('0x1e')});for(var _0x45a045=0x0;_0x45a045<_0xa07844['length'];_0x45a045++){_0xa07844[_0x45a045][_0xcc5a('0x1f')]=_0x45a045+0x1;_0xa07844[_0x45a045]=_[_0xcc5a('0x20')](_0xa07844[_0x45a045],_0x37ec81);}return _0xa07844;};var getChanSpyPromise=function(_0x5cc6d2,_0x2fad78){return new BPromise(function(_0x181f5c,_0x870dbc){return _0x5cc6d2['VoiceChanSpy'][_0xcc5a('0x21')]()[_0xcc5a('0x22')](function(_0x2a4a97){if(_0x2a4a97){var _0x352d53=getChanSpyApplications(_0x2fad78,_0x2fad78[_0xcc5a('0x23')],_0x2a4a97);if(_0x2fad78[_0xcc5a('0x23')]!=_0x2fad78[_0xcc5a('0x24')]){_0x352d53=_0x352d53[_0xcc5a('0x25')](getChanSpyApplications(_0x2fad78,_0x2fad78[_0xcc5a('0x24')],_0x2a4a97));}return _0x181f5c(_0x352d53);}return _0x181f5c([]);})[_0xcc5a('0x26')](function(_0x4e96d5){_0x870dbc(_0x4e96d5);});});};module[_0xcc5a('0x27')]=function(_0x34fdf0,_0x26b22b){var _0xddbc4f=_0x34fdf0[_0xcc5a('0x28')];return _0x34fdf0['define']('User',attributes,{'tableName':_0xcc5a('0x29'),'charset':_0xcc5a('0x2a'),'collate':_0xcc5a('0x2b'),'hooks':{'beforeCreate':function(_0x2761fd,_0xb4687b,_0x4f5ed8){var _0x2ffa3b=typeof _0x2761fd[_0xcc5a('0x2c')]===_0xcc5a('0x2d')?BPromise[_0xcc5a('0x2e')](null):_0xddbc4f[_0xcc5a('0x2f')][_0xcc5a('0x30')]({'where':{'id':_0x2761fd['userProfileId']}});_0x2ffa3b['then'](function(_0x516102){if(_0x516102){_0x2761fd[_0xcc5a('0x31')]=_0x516102[_0xcc5a('0x31')];}})[_0xcc5a('0x22')](function(){_0x2761fd[_0xcc5a('0x32')]();_0x2761fd[_0xcc5a('0x33')](_0x4f5ed8);})['catch'](function(_0x5b1c63){_0x4f5ed8(_0x5b1c63);});},'beforeUpdate':function(_0x127443,_0x443d8f,_0x222c9d){Promise[_0xcc5a('0x2e')]()[_0xcc5a('0x22')](function(){if(_0x127443[_0xcc5a('0x34')](_0xcc5a('0x2c'))===![])return;return _0xddbc4f[_0xcc5a('0x2f')]['find']({'where':{'id':_0x127443['userProfileId']}})[_0xcc5a('0x22')](function(_0x3efccc){if(_0x3efccc)_0x127443[_0xcc5a('0x31')]=_0x3efccc['privacyEnabled'];return;});})[_0xcc5a('0x22')](function(){if(_0x127443['changed'](_0xcc5a('0xf'))){_0x127443[_0xcc5a('0x32')]();return _0x127443[_0xcc5a('0x33')](_0x222c9d);}_0x222c9d();})['catch'](function(_0x24fba7){_0x222c9d(_0x24fba7);});},'afterCreate':function(_0x4fcce5,_0xf43a9c,_0x51fe0a){var _0x28f5eb=getUserApplications(_0x4fcce5,_0x4fcce5[_0xcc5a('0x23')]);if(_0x4fcce5['internal']!=_0x4fcce5[_0xcc5a('0x24')]){_0x28f5eb=_0x28f5eb[_0xcc5a('0x25')](getUserApplications(_0x4fcce5,_0x4fcce5[_0xcc5a('0x24')]));}return _0xddbc4f[_0xcc5a('0x35')][_0xcc5a('0x36')](_0x28f5eb)[_0xcc5a('0x22')](function(){if(_0x4fcce5[_0xcc5a('0x37')]){return getChanSpyPromise(_0xddbc4f,_0x4fcce5);}})[_0xcc5a('0x22')](function(_0x35351c){if(_0x35351c&&_0x35351c[_0xcc5a('0x3')]){return _0xddbc4f[_0xcc5a('0x35')][_0xcc5a('0x36')](_0x35351c);}})[_0xcc5a('0x22')](function(){_0x51fe0a();})[_0xcc5a('0x26')](function(_0x53da2a){_0x51fe0a(_0x53da2a);});},'afterUpdate':function(_0x138efa,_0x52c56d,_0x51eecc){return BPromise[_0xcc5a('0x2e')]()[_0xcc5a('0x22')](function(){if(_0x138efa[_0xcc5a('0x34')](_0xcc5a('0x37'))||_0x138efa[_0xcc5a('0x34')](_0xcc5a('0x4'))){return _0xddbc4f[_0xcc5a('0x35')]['destroy']({'where':{'UserId':_0x138efa['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0xcc5a('0x22')](function(){if(_0x138efa[_0xcc5a('0x37')]){return getChanSpyPromise(_0xddbc4f,_0x138efa)[_0xcc5a('0x22')](function(_0x45afaa){if(_0x45afaa&&_0x45afaa[_0xcc5a('0x3')]){return _0xddbc4f[_0xcc5a('0x35')][_0xcc5a('0x36')](_0x45afaa);}});}});}})[_0xcc5a('0x22')](function(){if(_0x138efa[_0xcc5a('0x34')](_0xcc5a('0x19'))||_0x138efa['changed']('context')){return _0xddbc4f['VoiceExtension'][_0xcc5a('0x38')]({'where':{'UserId':_0x138efa['id'],'type':'system','ChanSpyId':null}})['then'](function(){var _0x1a2087=getUserApplications(_0x138efa,_0x138efa[_0xcc5a('0x23')]);if(_0x138efa[_0xcc5a('0x23')]!=_0x138efa[_0xcc5a('0x24')]){_0x1a2087=_0x1a2087[_0xcc5a('0x25')](getUserApplications(_0x138efa,_0x138efa[_0xcc5a('0x24')]));}return _0xddbc4f['VoiceExtension'][_0xcc5a('0x36')](_0x1a2087);});}})[_0xcc5a('0x22')](function(){_0x51eecc();})[_0xcc5a('0x26')](function(_0x397045){_0x51eecc(_0x397045);});},'afterDestroy':function(_0x571780,_0x5e6c47){return _0xddbc4f[_0xcc5a('0x35')][_0xcc5a('0x38')]({'where':{'UserId':_0x571780['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x3f2997,_0x52a370){if(!_0x52a370){return this[_0xcc5a('0xf')]===this[_0xcc5a('0x39')](_0x3f2997);}var _0x140169=this;this[_0xcc5a('0x39')](_0x3f2997,function(_0x22eddb,_0x11b884){if(_0x22eddb){_0x52a370(_0x22eddb);}if(_0x140169['password']===_0x11b884){_0x52a370(null,!![]);}else{_0x52a370(null,![]);}});},'makeSalt':function(_0x83df1f,_0x47f9aa){var _0x1aa476=0x10;if(typeof arguments[0x0]===_0xcc5a('0x3a')){_0x47f9aa=arguments[0x0];_0x83df1f=_0x1aa476;}else if(typeof arguments[0x1]==='function'){_0x47f9aa=arguments[0x1];}else{throw new Error(_0xcc5a('0x3b'));}if(!_0x83df1f){_0x83df1f=_0x1aa476;}return crypto[_0xcc5a('0x3c')](_0x83df1f,function(_0x17d376,_0xf89898){if(_0x17d376){_0x47f9aa(_0x17d376);}return _0x47f9aa(null,_0xf89898[_0xcc5a('0x3d')](_0xcc5a('0x3e')));});},'encryptPassword':function(_0x273ec3,_0x33aa4b){if(!_0x273ec3||!this[_0xcc5a('0x3f')]){return _0x33aa4b?_0x33aa4b(null):null;}var _0x364c8c=0x2710;var _0x31f09d=0x40;var _0x40e6db=new Buffer(this[_0xcc5a('0x3f')],_0xcc5a('0x3e'));if(!_0x33aa4b){return crypto[_0xcc5a('0x40')](_0x273ec3,_0x40e6db,_0x364c8c,_0x31f09d,_0xcc5a('0x41'))[_0xcc5a('0x3d')](_0xcc5a('0x3e'));}return crypto[_0xcc5a('0x42')](_0x273ec3,_0x40e6db,_0x364c8c,_0x31f09d,_0xcc5a('0x41'),function(_0x591762,_0x1f1be6){if(_0x591762){_0x33aa4b(_0x591762);}return _0x33aa4b(null,_0x1f1be6[_0xcc5a('0x3d')]('base64'));});},'updatePassword':function(_0x37347c){if(!this[_0xcc5a('0xf')]){return _0x37347c(null);}if(!validatePresenceOf(this[_0xcc5a('0xf')])&&authTypes[_0xcc5a('0x43')](this[_0xcc5a('0x44')])===-0x1){_0x37347c(new Error(_0xcc5a('0x45')));}var _0x4364a=this;this[_0xcc5a('0x46')](function(_0x182a93,_0x178ee0){if(_0x182a93){return _0x37347c(_0x182a93);}_0x4364a['salt']=_0x178ee0;_0x4364a[_0xcc5a('0x39')](_0x4364a[_0xcc5a('0xf')],function(_0x35fd00,_0x5b4044){if(_0x35fd00){_0x37347c(_0x35fd00);}_0x4364a[_0xcc5a('0xf')]=_0x5b4044;_0x37347c(null);});});},'updateMd5Password':function(){this[_0xcc5a('0x47')]=md5(this[_0xcc5a('0x24')]+_0xcc5a('0x48')+this['password']);return this[_0xcc5a('0x47')];}}});};
\ No newline at end of file
+var _0x18db=['bulkCreate','encryptPassword','function','Missing\x20Callback','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','makeSalt',':asterisk:','md5secret','crypto','util','./user.attributes','google','length','from-sip','system','format','prefix','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','auth','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','WAV','gsm','context','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','then','internal','concat','catch','exports','models','User','users','utf8','utf8_bin','resolve','UserProfile','find','privacyEnabled','updateMd5Password','updatePassword','changed','userProfileId','VoiceExtension','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x18db,0x12f));var _0xb18d=function(_0x444730,_0x569b81){_0x444730=_0x444730-0x0;var _0x5948e2=_0x18db[_0x444730];return _0x5948e2;};'use strict';var BPromise=require('bluebird');var crypto=require(_0xb18d('0x0'));var util=require(_0xb18d('0x1'));var md5=require('md5');var _=require('lodash');var attributes=require(_0xb18d('0x2'));var authTypes=[_0xb18d('0x3')];var validatePresenceOf=function(_0x21dd48){return _0x21dd48&&_0x21dd48[_0xb18d('0x4')];};var getChanSpyApplications=function(_0x1d4258,_0x38d54d,_0x35a3af){var _0x3669a2={'context':_0x1d4258['context']||_0xb18d('0x5'),'type':_0xb18d('0x6'),'isApp':![],'UserId':_0x1d4258['id']};var _0x56675c=[];for(var _0x485160=0x0,_0x5118ea=0x1;_0x485160<_0x35a3af[_0xb18d('0x4')];_0x485160++,_0x5118ea=0x1){var _0x40c001={'exten':util[_0xb18d('0x7')]('%s%s',_0x35a3af[_0x485160][_0xb18d('0x8')],_0x38d54d),'ChanSpyId':_0x35a3af[_0x485160]['id']};_0x56675c[_0xb18d('0x9')](_[_0xb18d('0xa')]({'app':_0xb18d('0xb'),'appdata':util[_0xb18d('0x7')](_0xb18d('0xc'),_0xb18d('0xd')),'priority':_0x5118ea++},_0x3669a2,_0x40c001));if(_0x35a3af[_0x485160]['record']){_0x56675c[_0xb18d('0x9')](_[_0xb18d('0xa')]({'app':_0xb18d('0xe'),'appdata':util[_0xb18d('0x7')](_0xb18d('0xf'),_0x35a3af[_0x485160]['recordingFormat']),'priority':_0x5118ea++},_0x3669a2,_0x40c001));}if(_0x35a3af[_0x485160][_0xb18d('0x10')]){_0x56675c[_0xb18d('0x9')](_[_0xb18d('0xa')]({'app':'Authenticate','appdata':_0x35a3af[_0x485160][_0xb18d('0x11')],'priority':_0x5118ea++},_0x3669a2,_0x40c001));}_0x56675c['push'](_[_0xb18d('0xa')]({'app':_0xb18d('0x12'),'appdata':util[_0xb18d('0x7')](_0xb18d('0x13'),_0x1d4258[_0xb18d('0x14')],_0x35a3af[_0x485160][_0xb18d('0x15')]?_0x35a3af[_0x485160][_0xb18d('0x15')]['join'](''):''),'priority':_0x5118ea++},_0x3669a2,_0x40c001));if(_0x35a3af[_0x485160]['record']){_0x56675c[_0xb18d('0x9')](_[_0xb18d('0xa')]({'app':_0xb18d('0x16'),'priority':_0x5118ea++},_0x3669a2,_0x40c001));}}return _0x56675c;};var getUserApplications=function(_0x21c644,_0x2d947c){var _0x1e60ea=['wav',_0xb18d('0x17'),_0xb18d('0x18')];var _0x4b0e33={'context':_0x21c644[_0xb18d('0x19')]||_0xb18d('0x5'),'exten':_0x2d947c,'type':_0xb18d('0x6'),'isApp':![],'UserId':_0x21c644['id']};var _0x52f9d7=[{'app':_0xb18d('0xb'),'appdata':_0xb18d('0x1a')}];if(_0x21c644[_0xb18d('0x1b')]&&_['includes'](_0x1e60ea,_0x21c644[_0xb18d('0x1b')])){_0x52f9d7[_0xb18d('0x9')]({'app':_0xb18d('0xb'),'appdata':_0xb18d('0x1c')});_0x52f9d7[_0xb18d('0x9')]({'app':'Set','appdata':util['format'](_0xb18d('0x1d'),_0x21c644['extensionMonitor'])});_0x52f9d7[_0xb18d('0x9')]({'app':_0xb18d('0x1e'),'appdata':util[_0xb18d('0x7')](_0xb18d('0x1f'),_0x21c644[_0xb18d('0x14')])});}else{_0x52f9d7[_0xb18d('0x9')]({'app':'Dial','appdata':util[_0xb18d('0x7')](_0xb18d('0x20'),_0x21c644[_0xb18d('0x14')])});}_0x52f9d7['push']({'app':_0xb18d('0x21')});for(var _0x9d93c0=0x0;_0x9d93c0<_0x52f9d7[_0xb18d('0x4')];_0x9d93c0++){_0x52f9d7[_0x9d93c0][_0xb18d('0x22')]=_0x9d93c0+0x1;_0x52f9d7[_0x9d93c0]=_[_0xb18d('0x23')](_0x52f9d7[_0x9d93c0],_0x4b0e33);}return _0x52f9d7;};var getChanSpyPromise=function(_0x321210,_0x31842f){return new BPromise(function(_0x4f457e,_0x7543fb){return _0x321210[_0xb18d('0x24')]['findAll']()[_0xb18d('0x25')](function(_0xd69522){if(_0xd69522){var _0x1572c8=getChanSpyApplications(_0x31842f,_0x31842f[_0xb18d('0x26')],_0xd69522);if(_0x31842f['internal']!=_0x31842f[_0xb18d('0x14')]){_0x1572c8=_0x1572c8[_0xb18d('0x27')](getChanSpyApplications(_0x31842f,_0x31842f[_0xb18d('0x14')],_0xd69522));}return _0x4f457e(_0x1572c8);}return _0x4f457e([]);})[_0xb18d('0x28')](function(_0x595940){_0x7543fb(_0x595940);});});};module[_0xb18d('0x29')]=function(_0x529c4b,_0x320acf){var _0x502306=_0x529c4b[_0xb18d('0x2a')];return _0x529c4b['define'](_0xb18d('0x2b'),attributes,{'tableName':_0xb18d('0x2c'),'charset':_0xb18d('0x2d'),'collate':_0xb18d('0x2e'),'hooks':{'beforeCreate':function(_0x283a27,_0x28b27b,_0x2b7d86){var _0x441518=typeof _0x283a27['userProfileId']==='undefined'?BPromise[_0xb18d('0x2f')](null):_0x502306[_0xb18d('0x30')][_0xb18d('0x31')]({'where':{'id':_0x283a27['userProfileId']}});_0x441518[_0xb18d('0x25')](function(_0x35c20f){if(_0x35c20f){_0x283a27[_0xb18d('0x32')]=_0x35c20f[_0xb18d('0x32')];}})['then'](function(){_0x283a27[_0xb18d('0x33')]();_0x283a27[_0xb18d('0x34')](_0x2b7d86);})[_0xb18d('0x28')](function(_0x4ec35e){_0x2b7d86(_0x4ec35e);});},'beforeUpdate':function(_0x19d590,_0x3a0195,_0x1099c8){Promise[_0xb18d('0x2f')]()[_0xb18d('0x25')](function(){if(_0x19d590[_0xb18d('0x35')](_0xb18d('0x36'))===![])return;return _0x502306[_0xb18d('0x30')]['find']({'where':{'id':_0x19d590[_0xb18d('0x36')]}})[_0xb18d('0x25')](function(_0x36459a){if(_0x36459a)_0x19d590['privacyEnabled']=_0x36459a[_0xb18d('0x32')];return;});})[_0xb18d('0x25')](function(){if(_0x19d590[_0xb18d('0x35')](_0xb18d('0x11'))){_0x19d590[_0xb18d('0x33')]();return _0x19d590['updatePassword'](_0x1099c8);}_0x1099c8();})['catch'](function(_0xb659ae){_0x1099c8(_0xb659ae);});},'afterCreate':function(_0x4d8e9e,_0x4751b6,_0x169bf6){var _0x5de82b=getUserApplications(_0x4d8e9e,_0x4d8e9e[_0xb18d('0x26')]);if(_0x4d8e9e[_0xb18d('0x26')]!=_0x4d8e9e[_0xb18d('0x14')]){_0x5de82b=_0x5de82b[_0xb18d('0x27')](getUserApplications(_0x4d8e9e,_0x4d8e9e[_0xb18d('0x14')]));}return _0x502306[_0xb18d('0x37')]['bulkCreate'](_0x5de82b)[_0xb18d('0x25')](function(){if(_0x4d8e9e[_0xb18d('0xd')]){return getChanSpyPromise(_0x502306,_0x4d8e9e);}})['then'](function(_0x32fb70){if(_0x32fb70&&_0x32fb70[_0xb18d('0x4')]){return _0x502306[_0xb18d('0x37')]['bulkCreate'](_0x32fb70);}})[_0xb18d('0x25')](function(){_0x169bf6();})[_0xb18d('0x28')](function(_0x593322){_0x169bf6(_0x593322);});},'afterUpdate':function(_0x574cfe,_0x46523d,_0x585d97){return BPromise[_0xb18d('0x2f')]()[_0xb18d('0x25')](function(){if(_0x574cfe[_0xb18d('0x35')](_0xb18d('0xd'))||_0x574cfe[_0xb18d('0x35')](_0xb18d('0x19'))){return _0x502306[_0xb18d('0x37')][_0xb18d('0x38')]({'where':{'UserId':_0x574cfe['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0xb18d('0x25')](function(){if(_0x574cfe[_0xb18d('0xd')]){return getChanSpyPromise(_0x502306,_0x574cfe)[_0xb18d('0x25')](function(_0x393aa8){if(_0x393aa8&&_0x393aa8['length']){return _0x502306['VoiceExtension'][_0xb18d('0x39')](_0x393aa8);}});}});}})[_0xb18d('0x25')](function(){if(_0x574cfe['changed'](_0xb18d('0x1b'))||_0x574cfe['changed'](_0xb18d('0x19'))){return _0x502306[_0xb18d('0x37')][_0xb18d('0x38')]({'where':{'UserId':_0x574cfe['id'],'type':_0xb18d('0x6'),'ChanSpyId':null}})['then'](function(){var _0x3108b4=getUserApplications(_0x574cfe,_0x574cfe[_0xb18d('0x26')]);if(_0x574cfe[_0xb18d('0x26')]!=_0x574cfe[_0xb18d('0x14')]){_0x3108b4=_0x3108b4['concat'](getUserApplications(_0x574cfe,_0x574cfe[_0xb18d('0x14')]));}return _0x502306[_0xb18d('0x37')][_0xb18d('0x39')](_0x3108b4);});}})[_0xb18d('0x25')](function(){_0x585d97();})[_0xb18d('0x28')](function(_0x3b9e12){_0x585d97(_0x3b9e12);});},'afterDestroy':function(_0x4791ef,_0xc9fb7){return _0x502306[_0xb18d('0x37')][_0xb18d('0x38')]({'where':{'UserId':_0x4791ef['id'],'type':_0xb18d('0x6')}});}},'instanceMethods':{'authenticate':function(_0x278ca7,_0x33f2ff){if(!_0x33f2ff){return this[_0xb18d('0x11')]===this['encryptPassword'](_0x278ca7);}var _0x263fc9=this;this[_0xb18d('0x3a')](_0x278ca7,function(_0x37575b,_0x1f102b){if(_0x37575b){_0x33f2ff(_0x37575b);}if(_0x263fc9['password']===_0x1f102b){_0x33f2ff(null,!![]);}else{_0x33f2ff(null,![]);}});},'makeSalt':function(_0x42c7dc,_0x4a221b){var _0x159154=0x10;if(typeof arguments[0x0]===_0xb18d('0x3b')){_0x4a221b=arguments[0x0];_0x42c7dc=_0x159154;}else if(typeof arguments[0x1]==='function'){_0x4a221b=arguments[0x1];}else{throw new Error(_0xb18d('0x3c'));}if(!_0x42c7dc){_0x42c7dc=_0x159154;}return crypto['randomBytes'](_0x42c7dc,function(_0x3e9be9,_0x52665e){if(_0x3e9be9){_0x4a221b(_0x3e9be9);}return _0x4a221b(null,_0x52665e[_0xb18d('0x3d')](_0xb18d('0x3e')));});},'encryptPassword':function(_0x237992,_0x235981){if(!_0x237992||!this[_0xb18d('0x3f')]){return _0x235981?_0x235981(null):null;}var _0xf17839=0x2710;var _0x351ca5=0x40;var _0x3466fb=new Buffer(this[_0xb18d('0x3f')],_0xb18d('0x3e'));if(!_0x235981){return crypto[_0xb18d('0x40')](_0x237992,_0x3466fb,_0xf17839,_0x351ca5,_0xb18d('0x41'))['toString']('base64');}return crypto[_0xb18d('0x42')](_0x237992,_0x3466fb,_0xf17839,_0x351ca5,_0xb18d('0x41'),function(_0x4e8818,_0x176bc3){if(_0x4e8818){_0x235981(_0x4e8818);}return _0x235981(null,_0x176bc3[_0xb18d('0x3d')](_0xb18d('0x3e')));});},'updatePassword':function(_0x51d2e9){if(!this['password']){return _0x51d2e9(null);}if(!validatePresenceOf(this[_0xb18d('0x11')])&&authTypes[_0xb18d('0x43')](this[_0xb18d('0x44')])===-0x1){_0x51d2e9(new Error('Invalid\x20password'));}var _0x21a93a=this;this[_0xb18d('0x45')](function(_0x211157,_0x20889c){if(_0x211157){return _0x51d2e9(_0x211157);}_0x21a93a[_0xb18d('0x3f')]=_0x20889c;_0x21a93a[_0xb18d('0x3a')](_0x21a93a[_0xb18d('0x11')],function(_0x1beec1,_0x5ddef3){if(_0x1beec1){_0x51d2e9(_0x1beec1);}_0x21a93a[_0xb18d('0x11')]=_0x5ddef3;_0x51d2e9(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this['name']+_0xb18d('0x46')+this['password']);return this[_0xb18d('0x47')];}}});};
\ No newline at end of file
index ce24c8d..3bb1ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e6a=['raw','where','attributes','limit','include','map','model','catch','ShowUser','PauseUser','find','name','role','internal','UserVoiceQueueRt','MemberReport','PAUSE','length','format','getChannels','forEach','push','isNil','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','update','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','set','Pause','all','LogoutUser','destroy','mobile','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','stringify','error','message','User,\x20%s,\x20%s','info','result','GetUser','User','findAll','options'];(function(_0x2ecfad,_0xdbd164){var _0x4344da=function(_0x212a6c){while(--_0x212a6c){_0x2ecfad['push'](_0x2ecfad['shift']());}};_0x4344da(++_0xdbd164);}(_0x9e6a,0x159));var _0xa9e6=function(_0x391b19,_0x214efa){_0x391b19=_0x391b19-0x0;var _0x4789ff=_0x9e6a[_0x391b19];return _0x4789ff;};'use strict';var _=require(_0xa9e6('0x0'));var util=require(_0xa9e6('0x1'));var moment=require(_0xa9e6('0x2'));var BPromise=require('bluebird');var rs=require(_0xa9e6('0x3'));var fs=require('fs');var Redis=require(_0xa9e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9e6('0x5'));var config=require(_0xa9e6('0x6'));var jayson=require(_0xa9e6('0x7'));var client=jayson['client'][_0xa9e6('0x8')]({'port':0x232a});config[_0xa9e6('0x9')]=_['defaults'](config['redis'],{'host':_0xa9e6('0xa'),'port':0x18eb});var socket=require(_0xa9e6('0xb'))(new Redis(config[_0xa9e6('0x9')]));require('./user.socket')[_0xa9e6('0xc')](socket);function respondWithRpcPromise(_0x6ff5d1,_0x30b6ab,_0x1d8d41){return new BPromise(function(_0x34bfdc,_0x10a645){return client[_0xa9e6('0xd')](_0x6ff5d1,_0x1d8d41)[_0xa9e6('0xe')](function(_0x484b23){logger['info']('User,\x20%s,\x20%s',_0x30b6ab,_0xa9e6('0xf'));logger[_0xa9e6('0x10')]('User,\x20%s,\x20%s,\x20%s',_0x30b6ab,_0xa9e6('0xf'),JSON[_0xa9e6('0x11')](_0x484b23));if(_0x484b23[_0xa9e6('0x12')]){if(_0x484b23['error']['code']===0x1f4){logger[_0xa9e6('0x12')]('User,\x20%s,\x20%s',_0x30b6ab,_0x484b23[_0xa9e6('0x12')]['message']);return _0x10a645(_0x484b23[_0xa9e6('0x12')][_0xa9e6('0x13')]);}logger[_0xa9e6('0x12')](_0xa9e6('0x14'),_0x30b6ab,_0x484b23[_0xa9e6('0x12')][_0xa9e6('0x13')]);return _0x34bfdc(_0x484b23[_0xa9e6('0x12')][_0xa9e6('0x13')]);}else{logger[_0xa9e6('0x15')](_0xa9e6('0x14'),_0x30b6ab,_0xa9e6('0xf'));_0x34bfdc(_0x484b23[_0xa9e6('0x16')][_0xa9e6('0x13')]);}})['catch'](function(_0x3123e2){logger[_0xa9e6('0x12')](_0xa9e6('0x14'),_0x30b6ab,_0x3123e2);_0x10a645(_0x3123e2);});});}exports[_0xa9e6('0x17')]=function(_0x21d2cf){var _0x1f26bd=this;return new Promise(function(_0xe6303f,_0x530e49){return db[_0xa9e6('0x18')][_0xa9e6('0x19')]({'raw':_0x21d2cf[_0xa9e6('0x1a')]?_0x21d2cf[_0xa9e6('0x1a')][_0xa9e6('0x1b')]===undefined?!![]:![]:!![],'where':_0x21d2cf[_0xa9e6('0x1a')]?_0x21d2cf[_0xa9e6('0x1a')][_0xa9e6('0x1c')]||null:null,'attributes':_0x21d2cf[_0xa9e6('0x1a')]?_0x21d2cf[_0xa9e6('0x1a')][_0xa9e6('0x1d')]||null:null,'limit':_0x21d2cf[_0xa9e6('0x1a')]?_0x21d2cf[_0xa9e6('0x1a')][_0xa9e6('0x1e')]||null:null,'include':_0x21d2cf[_0xa9e6('0x1a')]?_0x21d2cf['options'][_0xa9e6('0x1f')]?_[_0xa9e6('0x20')](_0x21d2cf[_0xa9e6('0x1a')]['include'],function(_0x4fe770){return{'model':db[_0x4fe770[_0xa9e6('0x21')]],'as':_0x4fe770['as'],'attributes':_0x4fe770[_0xa9e6('0x1d')],'include':_0x4fe770[_0xa9e6('0x1f')]?_['map'](_0x4fe770['include'],function(_0x1cf956){return{'model':db[_0x1cf956[_0xa9e6('0x21')]],'as':_0x1cf956['as'],'attributes':_0x1cf956[_0xa9e6('0x1d')],'include':_0x1cf956[_0xa9e6('0x1f')]?_['map'](_0x1cf956[_0xa9e6('0x1f')],function(_0x5b7b4d){return{'model':db[_0x5b7b4d[_0xa9e6('0x21')]],'as':_0x5b7b4d['as'],'attributes':_0x5b7b4d[_0xa9e6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa9e6('0xe')](function(_0x2474ca){logger[_0xa9e6('0x15')](_0xa9e6('0x17'),_0x21d2cf);logger[_0xa9e6('0x10')](_0xa9e6('0x17'),_0x21d2cf,JSON[_0xa9e6('0x11')](_0x2474ca));_0xe6303f(_0x2474ca);})[_0xa9e6('0x22')](function(_0x5dfe86){logger[_0xa9e6('0x12')]('GetUser',_0x5dfe86[_0xa9e6('0x13')],_0x21d2cf);_0x530e49(_0x1f26bd[_0xa9e6('0x12')](0x1f4,_0x5dfe86[_0xa9e6('0x13')]));});});};exports['ShowUser']=function(_0x13c1cc){var _0x668ede=this;return new Promise(function(_0x414696,_0x49fa2a){return db['User']['find']({'raw':_0x13c1cc[_0xa9e6('0x1a')]?_0x13c1cc['options']['raw']===undefined?!![]:![]:!![],'where':_0x13c1cc[_0xa9e6('0x1a')]?_0x13c1cc['options'][_0xa9e6('0x1c')]||null:null,'attributes':_0x13c1cc[_0xa9e6('0x1a')]?_0x13c1cc[_0xa9e6('0x1a')][_0xa9e6('0x1d')]||null:null,'include':_0x13c1cc['options']?_0x13c1cc['options'][_0xa9e6('0x1f')]?_[_0xa9e6('0x20')](_0x13c1cc[_0xa9e6('0x1a')][_0xa9e6('0x1f')],function(_0x2271d6){return{'model':db[_0x2271d6[_0xa9e6('0x21')]],'as':_0x2271d6['as'],'attributes':_0x2271d6['attributes'],'include':_0x2271d6[_0xa9e6('0x1f')]?_[_0xa9e6('0x20')](_0x2271d6['include'],function(_0x246e0a){return{'model':db[_0x246e0a[_0xa9e6('0x21')]],'as':_0x246e0a['as'],'attributes':_0x246e0a[_0xa9e6('0x1d')],'include':_0x246e0a[_0xa9e6('0x1f')]?_[_0xa9e6('0x20')](_0x246e0a[_0xa9e6('0x1f')],function(_0x590642){return{'model':db[_0x590642[_0xa9e6('0x21')]],'as':_0x590642['as'],'attributes':_0x590642[_0xa9e6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa9e6('0xe')](function(_0x3ae889){logger[_0xa9e6('0x15')]('ShowUser',_0x13c1cc);logger[_0xa9e6('0x10')]('ShowUser',_0x13c1cc,JSON[_0xa9e6('0x11')](_0x3ae889));_0x414696(_0x3ae889);})[_0xa9e6('0x22')](function(_0x5c7a2a){logger[_0xa9e6('0x12')](_0xa9e6('0x23'),_0x5c7a2a[_0xa9e6('0x13')],_0x13c1cc);_0x49fa2a(_0x668ede[_0xa9e6('0x12')](0x1f4,_0x5c7a2a['message']));});});};exports[_0xa9e6('0x24')]=function(_0x33c37f){var _0x3cc9a0=this;return new Promise(function(_0x208470,_0x10fac2){var _0x4c66a2;return db[_0xa9e6('0x18')][_0xa9e6('0x25')]({'where':_0x33c37f[_0xa9e6('0x1a')][_0xa9e6('0x1c')]||{},'attributes':['id',_0xa9e6('0x26'),_0xa9e6('0x27'),_0xa9e6('0x28'),'interface']})[_0xa9e6('0xe')](function(_0x837355){if(_0x837355){_0x4c66a2=_0x837355;return db[_0xa9e6('0x29')]['update']({'paused':0x1},{'where':{'UserId':_0x4c66a2['id']},'individualHooks':!![]});}})[_0xa9e6('0xe')](function(){if(_0x4c66a2){return db[_0xa9e6('0x2a')]['findAll']({'where':{'membername':_0x4c66a2[_0xa9e6('0x26')],'type':_0xa9e6('0x2b'),'exitAt':null}});}})['then'](function(_0x328376){if(_0x4c66a2){if(_0x328376&&_0x328376[_0xa9e6('0x2c')]){var _0x36b38b=moment()[_0xa9e6('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2de5a9=0x0,_0xac3319=_0x328376[_0xa9e6('0x2c')];_0x2de5a9<_0xac3319;_0x2de5a9++){_0x328376[_0x2de5a9]['updateAttributes']({'exitAt':_0x36b38b});}}}})['then'](function(){if(_0x4c66a2){var _0x94a42b=[];var _0x13293e=utils[_0xa9e6('0x2e')]();_0x13293e[_0xa9e6('0x2f')](function(_0x368a6d){_0x94a42b[_0xa9e6('0x30')]({'channel':_0x368a6d,'membername':_0x4c66a2[_0xa9e6('0x26')],'interface':_[_0xa9e6('0x31')](_0x4c66a2[_0xa9e6('0x32')])?util[_0xa9e6('0x2d')](_0xa9e6('0x33'),_0x4c66a2[_0xa9e6('0x26')]):_0x4c66a2[_0xa9e6('0x32')],'type':'PAUSE','enterAt':moment()[_0xa9e6('0x2d')](_0xa9e6('0x34')),'data1':_0x33c37f['body'][_0xa9e6('0x35')]||_0xa9e6('0x36'),'role':_0x4c66a2['role'],'internal':_0x4c66a2[_0xa9e6('0x28')],'uniqueid':_0x33c37f[_0xa9e6('0x37')][_0xa9e6('0x38')]||null});});return db[_0xa9e6('0x2a')][_0xa9e6('0x39')](_0x94a42b,{'individualHooks':!![]});}})[_0xa9e6('0xe')](function(){if(_0x4c66a2){return _0x4c66a2[_0xa9e6('0x3a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x33c37f[_0xa9e6('0x37')]['type']||_0xa9e6('0x36'),'lastPauseAt':moment()[_0xa9e6('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x42c737){_0x208470(_0x42c737);})[_0xa9e6('0x22')](function(_0x5ba8d9){_0x10fac2(_0x3cc9a0[_0xa9e6('0x12')](0x1f4,_0x5ba8d9[_0xa9e6('0x13')]));});});};exports[_0xa9e6('0x3b')]=function(_0x1e8edb){var _0x3f9a9c=this;return new Promise(function(_0x2920fd,_0x424e03){var _0x11466a;return db[_0xa9e6('0x18')][_0xa9e6('0x3c')]({'where':_0x1e8edb[_0xa9e6('0x1a')][_0xa9e6('0x1c')]||{},'attributes':['id',_0xa9e6('0x26')]})[_0xa9e6('0xe')](function(_0xdc040a){if(_0xdc040a){_0x11466a=_0xdc040a;if(_0x1e8edb[_0xa9e6('0x37')][_0xa9e6('0x3d')]&&!utils[_0xa9e6('0x3e')](_0x1e8edb['body'][_0xa9e6('0x3d')])){throw new Error(_0xa9e6('0x3f'));}switch(_0x1e8edb[_0xa9e6('0x37')][_0xa9e6('0x3d')]){case _0xa9e6('0x40'):return db[_0xa9e6('0x29')][_0xa9e6('0x3a')]({'paused':0x0},{'where':{'UserId':_0x11466a['id']}})[_0xa9e6('0xe')](function(){return db[_0xa9e6('0x2a')][_0xa9e6('0x25')]({'where':{'channel':_0x1e8edb[_0xa9e6('0x37')]['channel'],'membername':_0x11466a['name'],'type':_0xa9e6('0x2b'),'exitAt':null}});})['then'](function(_0x500a10){if(_0x500a10){return _0x500a10[_0xa9e6('0x3a')]({'exitAt':moment()['format'](_0xa9e6('0x34')),'data2':_0xa9e6('0x41')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x11466a[_0xa9e6('0x3a')]({'voicePause':![]});});case _0xa9e6('0x42'):case _0xa9e6('0x43'):case _0xa9e6('0x44'):case _0xa9e6('0x45'):case _0xa9e6('0x46'):case _0xa9e6('0x47'):return db['MemberReport'][_0xa9e6('0x25')]({'where':{'channel':_0x1e8edb['body']['channel'],'membername':_0x11466a['name'],'type':_0xa9e6('0x2b'),'exitAt':null}})['then'](function(_0x3bd288){return _0x3bd288[_0xa9e6('0x3a')]({'exitAt':moment()[_0xa9e6('0x2d')](_0xa9e6('0x34')),'data2':_0xa9e6('0x41')},{'individualHooks':!![]});})[_0xa9e6('0xe')](function(){var _0x26044b={};_[_0xa9e6('0x48')](_0x26044b,util[_0xa9e6('0x2d')]('%s%s',_0x1e8edb[_0xa9e6('0x37')][_0xa9e6('0x3d')],_0xa9e6('0x49')),![]);return _0x11466a[_0xa9e6('0x3a')](_0x26044b);});default:return db[_0xa9e6('0x29')][_0xa9e6('0x3a')]({'paused':0x0},{'where':{'UserId':_0x11466a['id']}})['then'](function(){return db[_0xa9e6('0x2a')]['findAll']({'where':{'membername':_0x11466a[_0xa9e6('0x26')],'type':_0xa9e6('0x2b'),'exitAt':null}});})[_0xa9e6('0xe')](function(_0x49cabf){var _0x49221c=[];_0x49cabf[_0xa9e6('0x2f')](function(_0x3928f8){_0x49221c[_0xa9e6('0x30')](_0x3928f8['update']({'exitAt':moment()[_0xa9e6('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xa9e6('0x41')}));});return BPromise[_0xa9e6('0x4a')](_0x49221c);})[_0xa9e6('0xe')](function(){return _0x11466a[_0xa9e6('0x3a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xa9e6('0xe')](function(_0x46eeac){_0x2920fd(_0x46eeac);})[_0xa9e6('0x22')](function(_0xefa556){_0x424e03(_0x3f9a9c['error'](0x1f4,_0xefa556['message']));});});};exports[_0xa9e6('0x4b')]=function(_0x584fdf){var _0x2da97e=this;return new Promise(function(_0x22176c,_0xda2649){var _0xeb0590;return db[_0xa9e6('0x18')][_0xa9e6('0x3c')]({'where':_0x584fdf[_0xa9e6('0x1a')][_0xa9e6('0x1c')]||{},'attributes':['id',_0xa9e6('0x26')]})[_0xa9e6('0xe')](function(_0x2c2f84){if(_0x2c2f84){_0xeb0590=_0x2c2f84;return db[_0xa9e6('0x29')][_0xa9e6('0x4c')]({'where':{'membername':_0xeb0590[_0xa9e6('0x26')]},'individualHooks':!![]});}})['then'](function(){if(_0xeb0590){return db[_0xa9e6('0x2a')][_0xa9e6('0x19')]({'where':{'membername':_0xeb0590[_0xa9e6('0x26')],'exitAt':null}});}})[_0xa9e6('0xe')](function(_0x5a3da9){if(_0xeb0590){if(_0x5a3da9&&_0x5a3da9[_0xa9e6('0x2c')]){var _0x524361=[];_0x5a3da9[_0xa9e6('0x2f')](function(_0x56ad64){_0x524361[_0xa9e6('0x30')](_0x56ad64[_0xa9e6('0x3a')]({'exitAt':moment()[_0xa9e6('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xa9e6('0x4a')](_0x524361);}}})[_0xa9e6('0xe')](function(){if(_0xeb0590){return _0xeb0590[_0xa9e6('0x3a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xa9e6('0xe')](function(_0x5f3561){_0x22176c(_0x5f3561);})[_0xa9e6('0x22')](function(_0x2f2071){_0xda2649(_0x2da97e[_0xa9e6('0x12')](0x1f4,_0x2f2071[_0xa9e6('0x13')]));});});};exports['LoginUser']=function(_0x3c2925){var _0x1165e2=this;return new Promise(function(_0x445e5a,_0x3a829f){var _0x53a8a2;var _0x17b516;var _0x2adbf5;var _0x2e931b;return db[_0xa9e6('0x18')][_0xa9e6('0x3c')]({'where':_0x3c2925['options'][_0xa9e6('0x1c')]||{},'attributes':['id','name',_0xa9e6('0x27'),_0xa9e6('0x4d'),_0xa9e6('0x4e'),_0xa9e6('0x28'),_0xa9e6('0x4f'),_0xa9e6('0x32')]})[_0xa9e6('0xe')](function(_0x5cfccd){if(_0x5cfccd){_0x53a8a2=_0x5cfccd;_0x2e931b=_0x3c2925[_0xa9e6('0x37')]['interface']?_0x3c2925['body'][_0xa9e6('0x32')]:util['format'](_0xa9e6('0x33'),_0x53a8a2[_0xa9e6('0x26')]);return db[_0xa9e6('0x18')][_0xa9e6('0x50')]({'where':{'role':_0xa9e6('0x51'),'online':!![],'id':{'$ne':_0x53a8a2['id']}}});}})[_0xa9e6('0xe')](function(_0x57dc44){if(_0x57dc44){_0x2adbf5=_0x57dc44;return require('../../config/license/util')[_0xa9e6('0x52')]();}})[_0xa9e6('0xe')](function(_0x3efa55){if(_0x3efa55&&_0x3efa55[_0xa9e6('0x53')]&&_0x2adbf5>=_0x3efa55[_0xa9e6('0x53')]){throw new Error(_0xa9e6('0x54'));}})[_0xa9e6('0xe')](function(){if(_0x53a8a2){return db['UserVoiceQueueRt'][_0xa9e6('0x4c')]({'where':{'membername':_0x53a8a2[_0xa9e6('0x26')]},'individualHooks':!![]});}})[_0xa9e6('0xe')](function(){if(_0x53a8a2){return _0x53a8a2[_0xa9e6('0x55')]({'raw':!![]});}})[_0xa9e6('0xe')](function(_0x48e62a){if(_0x53a8a2){if(_0x48e62a){var _0x518055=[];_0x17b516=_0x48e62a;if(_0x17b516[_0xa9e6('0x2c')]){for(var _0x5ccd46=0x0;_0x5ccd46<_0x17b516['length'];_0x5ccd46++){_0x518055['push'](db[_0xa9e6('0x29')][_0xa9e6('0x56')]({'membername':_0x53a8a2['name'],'UserId':_0x53a8a2['id'],'queue_name':_0x17b516[_0x5ccd46][_0xa9e6('0x26')],'VoiceQueueId':_0x17b516[_0x5ccd46]['id'],'interface':_0x2e931b,'paused':_0x53a8a2['loginInPause']||![],'penalty':_0x17b516[_0x5ccd46][_0xa9e6('0x57')]||0x0}));}return BPromise[_0xa9e6('0x4a')](_0x518055);}}}})[_0xa9e6('0xe')](function(){if(_0x53a8a2){return db[_0xa9e6('0x2a')][_0xa9e6('0x19')]({'where':{'membername':_0x53a8a2[_0xa9e6('0x26')],'exitAt':null}});}})[_0xa9e6('0xe')](function(_0x588d3a){if(_0x53a8a2){if(_0x588d3a&&_0x588d3a[_0xa9e6('0x2c')]){var _0x27b8e8=[];_0x588d3a[_0xa9e6('0x2f')](function(_0x4e3f05){_0x27b8e8[_0xa9e6('0x30')](_0x4e3f05[_0xa9e6('0x3a')]({'exitAt':moment()[_0xa9e6('0x2d')](_0xa9e6('0x34'))}));});return BPromise[_0xa9e6('0x4a')](_0x27b8e8);}}})[_0xa9e6('0xe')](function(_0x2450b5){if(_0x53a8a2){var _0xc9b5b7=[];var _0x3473e0=[];var _0x138702=utils[_0xa9e6('0x2e')]();var _0x4f3958={'membername':_0x53a8a2[_0xa9e6('0x26')],'interface':_0x2e931b,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x53a8a2[_0xa9e6('0x27')],'internal':_0x53a8a2[_0xa9e6('0x28')]};_0x138702[_0xa9e6('0x2f')](function(_0x1862e5){_0xc9b5b7[_0xa9e6('0x30')](_['merge']({'channel':_0x1862e5,'type':_0xa9e6('0x58'),'data1':_0xa9e6('0x59'),'data2':_0x2e931b},_0x4f3958));if(_0x53a8a2['loginInPause']){_0x3473e0[_0xa9e6('0x30')](_[_0xa9e6('0x5a')]({'channel':_0x1862e5,'type':_0xa9e6('0x2b'),'data1':_0xa9e6('0x5b')},_0x4f3958));}});return db[_0xa9e6('0x2a')][_0xa9e6('0x39')](_0xc9b5b7[_0xa9e6('0x5c')](_0x3473e0),{'individualHooks':!![]});}})['then'](function(){if(_0x53a8a2){return _0x53a8a2['update']({'online':!![],'lastLoginAt':moment()[_0xa9e6('0x2d')](_0xa9e6('0x34')),'voicePause':_0x53a8a2['loginInPause']||![],'mailPause':_0x53a8a2['loginInPause']||![],'chatPause':_0x53a8a2['loginInPause']||![],'faxPause':_0x53a8a2[_0xa9e6('0x4f')]||![],'smsPause':_0x53a8a2[_0xa9e6('0x4f')]||![],'openchannelPause':_0x53a8a2['loginInPause']||![],'pauseType':_0x53a8a2[_0xa9e6('0x4f')]?_0xa9e6('0x5b'):null,'lastPauseAt':moment()[_0xa9e6('0x2d')](_0xa9e6('0x34')),'interface':_0x2e931b});}})['then'](function(_0x3ce334){_0x445e5a(_0x3ce334);})[_0xa9e6('0x22')](function(_0x2cc969){_0x3a829f(_0x1165e2[_0xa9e6('0x12')](0x1f4,_0x2cc969[_0xa9e6('0x13')]));});});};
\ No newline at end of file
+var _0x507d=['phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','bulkCreate','concat','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','./user.socket','register','request','then','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetUser','options','raw','where','attributes','limit','include','map','model','info','User','ShowUser','name','interface','UserVoiceQueueRt','update','findAll','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','push','isNil','SIP/%s','body','type','internal','uniqueid','MemberReport','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','find','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','forEach','destroy','LoginUser','mobile'];(function(_0x4dd3e3,_0x58c571){var _0x50d0a6=function(_0x1c6869){while(--_0x1c6869){_0x4dd3e3['push'](_0x4dd3e3['shift']());}};_0x50d0a6(++_0x58c571);}(_0x507d,0x12e));var _0xd507=function(_0x47d9f8,_0x676fd6){_0x47d9f8=_0x47d9f8-0x0;var _0x376674=_0x507d[_0x47d9f8];return _0x376674;};'use strict';var _=require(_0xd507('0x0'));var util=require(_0xd507('0x1'));var moment=require(_0xd507('0x2'));var BPromise=require(_0xd507('0x3'));var rs=require(_0xd507('0x4'));var fs=require('fs');var Redis=require(_0xd507('0x5'));var db=require(_0xd507('0x6'))['db'];var utils=require(_0xd507('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd507('0x8'));var client=jayson[_0xd507('0x9')][_0xd507('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd507('0xb')],{'host':_0xd507('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd507('0xb')]));require(_0xd507('0xd'))[_0xd507('0xe')](socket);function respondWithRpcPromise(_0x32fc98,_0x5cf4e0,_0x147eda){return new BPromise(function(_0x25f63c,_0x42b24f){return client[_0xd507('0xf')](_0x32fc98,_0x147eda)[_0xd507('0x10')](function(_0x212bb8){logger['info'](_0xd507('0x11'),_0x5cf4e0,_0xd507('0x12'));logger[_0xd507('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x5cf4e0,_0xd507('0x12'),JSON[_0xd507('0x14')](_0x212bb8));if(_0x212bb8[_0xd507('0x15')]){if(_0x212bb8[_0xd507('0x15')]['code']===0x1f4){logger[_0xd507('0x15')](_0xd507('0x11'),_0x5cf4e0,_0x212bb8[_0xd507('0x15')][_0xd507('0x16')]);return _0x42b24f(_0x212bb8[_0xd507('0x15')]['message']);}logger[_0xd507('0x15')](_0xd507('0x11'),_0x5cf4e0,_0x212bb8['error'][_0xd507('0x16')]);return _0x25f63c(_0x212bb8['error'][_0xd507('0x16')]);}else{logger['info'](_0xd507('0x11'),_0x5cf4e0,_0xd507('0x12'));_0x25f63c(_0x212bb8[_0xd507('0x17')][_0xd507('0x16')]);}})[_0xd507('0x18')](function(_0x1e2955){logger['error'](_0xd507('0x11'),_0x5cf4e0,_0x1e2955);_0x42b24f(_0x1e2955);});});}exports[_0xd507('0x19')]=function(_0x316cfe){var _0x2bd190=this;return new Promise(function(_0x38c2c6,_0x44b07d){return db['User']['findAll']({'raw':_0x316cfe[_0xd507('0x1a')]?_0x316cfe[_0xd507('0x1a')][_0xd507('0x1b')]===undefined?!![]:![]:!![],'where':_0x316cfe[_0xd507('0x1a')]?_0x316cfe['options'][_0xd507('0x1c')]||null:null,'attributes':_0x316cfe[_0xd507('0x1a')]?_0x316cfe[_0xd507('0x1a')][_0xd507('0x1d')]||null:null,'limit':_0x316cfe[_0xd507('0x1a')]?_0x316cfe[_0xd507('0x1a')][_0xd507('0x1e')]||null:null,'include':_0x316cfe['options']?_0x316cfe[_0xd507('0x1a')][_0xd507('0x1f')]?_[_0xd507('0x20')](_0x316cfe[_0xd507('0x1a')][_0xd507('0x1f')],function(_0x39bdbb){return{'model':db[_0x39bdbb[_0xd507('0x21')]],'as':_0x39bdbb['as'],'attributes':_0x39bdbb['attributes'],'include':_0x39bdbb[_0xd507('0x1f')]?_['map'](_0x39bdbb[_0xd507('0x1f')],function(_0x45a93b){return{'model':db[_0x45a93b[_0xd507('0x21')]],'as':_0x45a93b['as'],'attributes':_0x45a93b[_0xd507('0x1d')],'include':_0x45a93b[_0xd507('0x1f')]?_[_0xd507('0x20')](_0x45a93b['include'],function(_0x5ae225){return{'model':db[_0x5ae225[_0xd507('0x21')]],'as':_0x5ae225['as'],'attributes':_0x5ae225[_0xd507('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x377989){logger[_0xd507('0x22')](_0xd507('0x19'),_0x316cfe);logger[_0xd507('0x13')](_0xd507('0x19'),_0x316cfe,JSON[_0xd507('0x14')](_0x377989));_0x38c2c6(_0x377989);})[_0xd507('0x18')](function(_0x4102f3){logger[_0xd507('0x15')](_0xd507('0x19'),_0x4102f3['message'],_0x316cfe);_0x44b07d(_0x2bd190['error'](0x1f4,_0x4102f3[_0xd507('0x16')]));});});};exports['ShowUser']=function(_0x480fd6){var _0x223392=this;return new Promise(function(_0x402859,_0x461f87){return db[_0xd507('0x23')]['find']({'raw':_0x480fd6[_0xd507('0x1a')]?_0x480fd6[_0xd507('0x1a')][_0xd507('0x1b')]===undefined?!![]:![]:!![],'where':_0x480fd6[_0xd507('0x1a')]?_0x480fd6[_0xd507('0x1a')][_0xd507('0x1c')]||null:null,'attributes':_0x480fd6[_0xd507('0x1a')]?_0x480fd6['options'][_0xd507('0x1d')]||null:null,'include':_0x480fd6[_0xd507('0x1a')]?_0x480fd6[_0xd507('0x1a')][_0xd507('0x1f')]?_[_0xd507('0x20')](_0x480fd6['options'][_0xd507('0x1f')],function(_0x3160ce){return{'model':db[_0x3160ce[_0xd507('0x21')]],'as':_0x3160ce['as'],'attributes':_0x3160ce[_0xd507('0x1d')],'include':_0x3160ce[_0xd507('0x1f')]?_[_0xd507('0x20')](_0x3160ce[_0xd507('0x1f')],function(_0x5e1631){return{'model':db[_0x5e1631[_0xd507('0x21')]],'as':_0x5e1631['as'],'attributes':_0x5e1631[_0xd507('0x1d')],'include':_0x5e1631['include']?_[_0xd507('0x20')](_0x5e1631[_0xd507('0x1f')],function(_0x3d2e0c){return{'model':db[_0x3d2e0c[_0xd507('0x21')]],'as':_0x3d2e0c['as'],'attributes':_0x3d2e0c[_0xd507('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd507('0x10')](function(_0x35db54){logger['info'](_0xd507('0x24'),_0x480fd6);logger['debug']('ShowUser',_0x480fd6,JSON[_0xd507('0x14')](_0x35db54));_0x402859(_0x35db54);})['catch'](function(_0x204756){logger[_0xd507('0x15')](_0xd507('0x24'),_0x204756[_0xd507('0x16')],_0x480fd6);_0x461f87(_0x223392[_0xd507('0x15')](0x1f4,_0x204756[_0xd507('0x16')]));});});};exports['PauseUser']=function(_0x166604){var _0x580990=this;return new Promise(function(_0x31859c,_0xe3cbfc){var _0x56ab84;return db[_0xd507('0x23')]['find']({'where':_0x166604[_0xd507('0x1a')][_0xd507('0x1c')]||{},'attributes':['id',_0xd507('0x25'),'role','internal',_0xd507('0x26')]})['then'](function(_0x4b9368){if(_0x4b9368){_0x56ab84=_0x4b9368;return db[_0xd507('0x27')][_0xd507('0x28')]({'paused':0x1},{'where':{'UserId':_0x56ab84['id']},'individualHooks':!![]});}})[_0xd507('0x10')](function(){if(_0x56ab84){return db['MemberReport'][_0xd507('0x29')]({'where':{'membername':_0x56ab84[_0xd507('0x25')],'type':_0xd507('0x2a'),'exitAt':null}});}})['then'](function(_0x1c84b1){if(_0x56ab84){if(_0x1c84b1&&_0x1c84b1['length']){var _0x1501d1=moment()[_0xd507('0x2b')](_0xd507('0x2c'));for(var _0x57deba=0x0,_0x5d3c7e=_0x1c84b1[_0xd507('0x2d')];_0x57deba<_0x5d3c7e;_0x57deba++){_0x1c84b1[_0x57deba][_0xd507('0x2e')]({'exitAt':_0x1501d1});}}}})['then'](function(){if(_0x56ab84){var _0x321965=[];var _0x1eb59d=utils[_0xd507('0x2f')]();_0x1eb59d['forEach'](function(_0x2415a6){_0x321965[_0xd507('0x30')]({'channel':_0x2415a6,'membername':_0x56ab84[_0xd507('0x25')],'interface':_[_0xd507('0x31')](_0x56ab84[_0xd507('0x26')])?util['format'](_0xd507('0x32'),_0x56ab84['name']):_0x56ab84['interface'],'type':'PAUSE','enterAt':moment()[_0xd507('0x2b')](_0xd507('0x2c')),'data1':_0x166604[_0xd507('0x33')][_0xd507('0x34')]||'DEFAULT\x20PAUSE','role':_0x56ab84['role'],'internal':_0x56ab84[_0xd507('0x35')],'uniqueid':_0x166604[_0xd507('0x33')][_0xd507('0x36')]||null});});return db[_0xd507('0x37')]['bulkCreate'](_0x321965,{'individualHooks':!![]});}})[_0xd507('0x10')](function(){if(_0x56ab84){return _0x56ab84['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x166604['body'][_0xd507('0x34')]||_0xd507('0x38'),'lastPauseAt':moment()[_0xd507('0x2b')](_0xd507('0x2c'))});}})[_0xd507('0x10')](function(_0x117aa8){_0x31859c(_0x117aa8);})['catch'](function(_0x233603){_0xe3cbfc(_0x580990[_0xd507('0x15')](0x1f4,_0x233603[_0xd507('0x16')]));});});};exports[_0xd507('0x39')]=function(_0x4d779a){var _0x584a33=this;return new Promise(function(_0x387b6e,_0x45a833){var _0x264607;return db[_0xd507('0x23')][_0xd507('0x3a')]({'where':_0x4d779a[_0xd507('0x1a')]['where']||{},'attributes':['id',_0xd507('0x25')]})[_0xd507('0x10')](function(_0x267ab8){if(_0x267ab8){_0x264607=_0x267ab8;if(_0x4d779a[_0xd507('0x33')][_0xd507('0x3b')]&&!utils[_0xd507('0x3c')](_0x4d779a[_0xd507('0x33')]['channel'])){throw new Error(_0xd507('0x3d'));}switch(_0x4d779a['body'][_0xd507('0x3b')]){case _0xd507('0x3e'):return db[_0xd507('0x27')][_0xd507('0x28')]({'paused':0x0},{'where':{'UserId':_0x264607['id']}})['then'](function(){return db['MemberReport'][_0xd507('0x3f')]({'where':{'channel':_0x4d779a[_0xd507('0x33')][_0xd507('0x3b')],'membername':_0x264607['name'],'type':_0xd507('0x2a'),'exitAt':null}});})[_0xd507('0x10')](function(_0x418cc5){if(_0x418cc5){return _0x418cc5['update']({'exitAt':moment()[_0xd507('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd507('0x40')},{'individualHooks':!![]});}return null;})[_0xd507('0x10')](function(){return _0x264607[_0xd507('0x28')]({'voicePause':![]});});case _0xd507('0x41'):case _0xd507('0x42'):case _0xd507('0x43'):case _0xd507('0x44'):case _0xd507('0x45'):case _0xd507('0x46'):return db[_0xd507('0x37')][_0xd507('0x3f')]({'where':{'channel':_0x4d779a[_0xd507('0x33')][_0xd507('0x3b')],'membername':_0x264607[_0xd507('0x25')],'type':_0xd507('0x2a'),'exitAt':null}})[_0xd507('0x10')](function(_0x5f2adb){return _0x5f2adb[_0xd507('0x28')]({'exitAt':moment()[_0xd507('0x2b')](_0xd507('0x2c')),'data2':'system'},{'individualHooks':!![]});})[_0xd507('0x10')](function(){var _0x3ac9e5={};_[_0xd507('0x47')](_0x3ac9e5,util['format'](_0xd507('0x48'),_0x4d779a[_0xd507('0x33')][_0xd507('0x3b')],_0xd507('0x49')),![]);return _0x264607[_0xd507('0x28')](_0x3ac9e5);});default:return db[_0xd507('0x27')][_0xd507('0x28')]({'paused':0x0},{'where':{'UserId':_0x264607['id']}})[_0xd507('0x10')](function(){return db[_0xd507('0x37')][_0xd507('0x29')]({'where':{'membername':_0x264607[_0xd507('0x25')],'type':'PAUSE','exitAt':null}});})[_0xd507('0x10')](function(_0x4635c3){var _0x24a1fa=[];_0x4635c3[_0xd507('0x4a')](function(_0x1edf9b){_0x24a1fa[_0xd507('0x30')](_0x1edf9b[_0xd507('0x28')]({'exitAt':moment()['format'](_0xd507('0x2c')),'data2':_0xd507('0x40')}));});return BPromise['all'](_0x24a1fa);})[_0xd507('0x10')](function(){return _0x264607[_0xd507('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x14157a){_0x387b6e(_0x14157a);})[_0xd507('0x18')](function(_0x475613){_0x45a833(_0x584a33[_0xd507('0x15')](0x1f4,_0x475613[_0xd507('0x16')]));});});};exports['LogoutUser']=function(_0x1f8544){var _0x132306=this;return new Promise(function(_0x5c314b,_0x26f7cf){var _0x21931f;return db[_0xd507('0x23')][_0xd507('0x3a')]({'where':_0x1f8544['options']['where']||{},'attributes':['id',_0xd507('0x25')]})['then'](function(_0x5bcb50){if(_0x5bcb50){_0x21931f=_0x5bcb50;return db[_0xd507('0x27')][_0xd507('0x4b')]({'where':{'membername':_0x21931f[_0xd507('0x25')]},'individualHooks':!![]});}})[_0xd507('0x10')](function(){if(_0x21931f){return db[_0xd507('0x37')][_0xd507('0x29')]({'where':{'membername':_0x21931f[_0xd507('0x25')],'exitAt':null}});}})['then'](function(_0x4c8153){if(_0x21931f){if(_0x4c8153&&_0x4c8153[_0xd507('0x2d')]){var _0x577848=[];_0x4c8153[_0xd507('0x4a')](function(_0x2181cd){_0x577848['push'](_0x2181cd['update']({'exitAt':moment()[_0xd507('0x2b')](_0xd507('0x2c'))}));});return BPromise['all'](_0x577848);}}})[_0xd507('0x10')](function(){if(_0x21931f){return _0x21931f[_0xd507('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd507('0x10')](function(_0x442c31){_0x5c314b(_0x442c31);})[_0xd507('0x18')](function(_0x6cec30){_0x26f7cf(_0x132306[_0xd507('0x15')](0x1f4,_0x6cec30[_0xd507('0x16')]));});});};exports[_0xd507('0x4c')]=function(_0x535667){var _0x5f09b3=this;return new Promise(function(_0x20170e,_0x4fab38){var _0x1b4689;var _0x315525;var _0x5c415d;var _0x31e9c2;return db['User'][_0xd507('0x3a')]({'where':_0x535667[_0xd507('0x1a')][_0xd507('0x1c')]||{},'attributes':['id',_0xd507('0x25'),'role',_0xd507('0x4d'),_0xd507('0x4e'),_0xd507('0x35'),_0xd507('0x4f'),_0xd507('0x26')]})[_0xd507('0x10')](function(_0x1177b0){if(_0x1177b0){_0x1b4689=_0x1177b0;_0x31e9c2=_0x535667[_0xd507('0x33')]['interface']?_0x535667[_0xd507('0x33')][_0xd507('0x26')]:util['format'](_0xd507('0x32'),_0x1b4689['name']);return db[_0xd507('0x23')][_0xd507('0x50')]({'where':{'role':_0xd507('0x51'),'online':!![],'id':{'$ne':_0x1b4689['id']}}});}})[_0xd507('0x10')](function(_0x338718){if(_0x338718){_0x5c415d=_0x338718;return require('../../config/license/util')[_0xd507('0x52')]();}})[_0xd507('0x10')](function(_0x229bf2){if(_0x229bf2&&_0x229bf2[_0xd507('0x53')]&&_0x5c415d>=_0x229bf2[_0xd507('0x53')]){throw new Error(_0xd507('0x54'));}})[_0xd507('0x10')](function(){if(_0x1b4689){return db[_0xd507('0x27')][_0xd507('0x4b')]({'where':{'membername':_0x1b4689['name']},'individualHooks':!![]});}})[_0xd507('0x10')](function(){if(_0x1b4689){return _0x1b4689[_0xd507('0x55')]({'raw':!![]});}})[_0xd507('0x10')](function(_0x79501b){if(_0x1b4689){if(_0x79501b){var _0x53c0b5=[];_0x315525=_0x79501b;if(_0x315525[_0xd507('0x2d')]){for(var _0x2db005=0x0;_0x2db005<_0x315525[_0xd507('0x2d')];_0x2db005++){_0x53c0b5[_0xd507('0x30')](db[_0xd507('0x27')][_0xd507('0x56')]({'membername':_0x1b4689[_0xd507('0x25')],'UserId':_0x1b4689['id'],'queue_name':_0x315525[_0x2db005][_0xd507('0x25')],'VoiceQueueId':_0x315525[_0x2db005]['id'],'interface':_0x31e9c2,'paused':_0x1b4689['loginInPause']||![],'penalty':_0x315525[_0x2db005][_0xd507('0x57')]||0x0}));}return BPromise[_0xd507('0x58')](_0x53c0b5);}}}})[_0xd507('0x10')](function(){if(_0x1b4689){return db[_0xd507('0x37')]['findAll']({'where':{'membername':_0x1b4689[_0xd507('0x25')],'exitAt':null}});}})[_0xd507('0x10')](function(_0x1442c9){if(_0x1b4689){if(_0x1442c9&&_0x1442c9['length']){var _0x46cefa=[];_0x1442c9['forEach'](function(_0x21ef82){_0x46cefa[_0xd507('0x30')](_0x21ef82['update']({'exitAt':moment()[_0xd507('0x2b')](_0xd507('0x2c'))}));});return BPromise[_0xd507('0x58')](_0x46cefa);}}})[_0xd507('0x10')](function(_0x3f890d){if(_0x1b4689){var _0x5809aa=[];var _0x182497=[];var _0xe8b2d4=utils['getChannels']();var _0x35f296={'membername':_0x1b4689[_0xd507('0x25')],'interface':_0x31e9c2,'enterAt':moment()[_0xd507('0x2b')](_0xd507('0x2c')),'role':_0x1b4689['role'],'internal':_0x1b4689[_0xd507('0x35')]};_0xe8b2d4['forEach'](function(_0x899e75){_0x5809aa['push'](_[_0xd507('0x59')]({'channel':_0x899e75,'type':_0xd507('0x5a'),'data1':_0xd507('0x5b'),'data2':_0x31e9c2},_0x35f296));if(_0x1b4689[_0xd507('0x4f')]){_0x182497[_0xd507('0x30')](_['merge']({'channel':_0x899e75,'type':_0xd507('0x2a'),'data1':'LOGININPAUSE'},_0x35f296));}});return db[_0xd507('0x37')][_0xd507('0x5c')](_0x5809aa[_0xd507('0x5d')](_0x182497),{'individualHooks':!![]});}})[_0xd507('0x10')](function(){if(_0x1b4689){return _0x1b4689[_0xd507('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0xd507('0x2c')),'voicePause':_0x1b4689[_0xd507('0x4f')]||![],'mailPause':_0x1b4689[_0xd507('0x4f')]||![],'chatPause':_0x1b4689[_0xd507('0x4f')]||![],'faxPause':_0x1b4689[_0xd507('0x4f')]||![],'smsPause':_0x1b4689[_0xd507('0x4f')]||![],'openchannelPause':_0x1b4689['loginInPause']||![],'pauseType':_0x1b4689['loginInPause']?_0xd507('0x5e'):null,'lastPauseAt':moment()[_0xd507('0x2b')](_0xd507('0x2c')),'interface':_0x31e9c2});}})[_0xd507('0x10')](function(_0x3d2a58){_0x20170e(_0x3d2a58);})[_0xd507('0x18')](function(_0x2f9a9b){_0x4fab38(_0x5f09b3['error'](0x1f4,_0x2f9a9b[_0xd507('0x16')]));});});};
\ No newline at end of file
index d8ea0dd..8e2e8fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d2d=['register','length','user:','save','remove','emit','removeListener'];(function(_0x4f3ec5,_0xb65bdc){var _0x34e94d=function(_0x1adc81){while(--_0x1adc81){_0x4f3ec5['push'](_0x4f3ec5['shift']());}};_0x34e94d(++_0xb65bdc);}(_0x4d2d,0xf8));var _0xd4d2=function(_0x2f4173,_0x1f5d89){_0x2f4173=_0x2f4173-0x0;var _0x1f9f8d=_0x4d2d[_0x2f4173];return _0x1f9f8d;};'use strict';var UserEvents=require('./user.events');var events=[_0xd4d2('0x0'),_0xd4d2('0x1'),'update'];function createListener(_0x12841b,_0x2c72b5){return function(_0x55dbf8){_0x2c72b5[_0xd4d2('0x2')](_0x12841b,_0x55dbf8);};}function removeListener(_0x1efcee,_0xfdbb71){return function(){UserEvents[_0xd4d2('0x3')](_0x1efcee,_0xfdbb71);};}exports[_0xd4d2('0x4')]=function(_0x1bedcd){for(var _0x57fe81=0x0,_0x1f7df6=events[_0xd4d2('0x5')];_0x57fe81<_0x1f7df6;_0x57fe81++){var _0x3a8777=events[_0x57fe81];var _0x17c3fd=createListener(_0xd4d2('0x6')+_0x3a8777,_0x1bedcd);UserEvents['on'](_0x3a8777,_0x17c3fd);}};
\ No newline at end of file
+var _0x9df7=['user:','./user.events','save','remove','update','emit','removeListener','length'];(function(_0x358a1e,_0x22b3cd){var _0x288e37=function(_0x71dc26){while(--_0x71dc26){_0x358a1e['push'](_0x358a1e['shift']());}};_0x288e37(++_0x22b3cd);}(_0x9df7,0x129));var _0x79df=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0x9df7[_0x4d2f00];return _0x2d7b7f;};'use strict';var UserEvents=require(_0x79df('0x0'));var events=[_0x79df('0x1'),_0x79df('0x2'),_0x79df('0x3')];function createListener(_0x58b241,_0x412fa1){return function(_0x53c5a7){_0x412fa1[_0x79df('0x4')](_0x58b241,_0x53c5a7);};}function removeListener(_0x1eb3ac,_0x9ce373){return function(){UserEvents[_0x79df('0x5')](_0x1eb3ac,_0x9ce373);};}exports['register']=function(_0x2ef4bc){for(var _0x2b856e=0x0,_0x43d911=events[_0x79df('0x6')];_0x2b856e<_0x43d911;_0x2b856e++){var _0x489437=events[_0x2b856e];var _0x36073c=createListener(_0x79df('0x7')+_0x489437,_0x2ef4bc);UserEvents['on'](_0x489437,_0x36073c);}};
\ No newline at end of file
index 89e9310..e7f3c9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3766f9,_0x40f3de){var _0x5b8739=function(_0x46f429){while(--_0x46f429){_0x3766f9['push'](_0x3766f9['shift']());}};_0x5b8739(++_0x40f3de);}(_0x70e0,0x17b));var _0x070e=function(_0x3f0b5d,_0xf758a5){_0x3f0b5d=_0x3f0b5d-0x0;var _0xcbdf59=_0x70e0[_0x3f0b5d];return _0xcbdf59;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x580b83,_0x2bad96){var _0x2ba948=function(_0x572c0e){while(--_0x572c0e){_0x580b83['push'](_0x580b83['shift']());}};_0x2ba948(++_0x2bad96);}(_0x70e0,0x17b));var _0x070e=function(_0x307cca,_0xfab6de){_0x307cca=_0x307cca-0x0;var _0x59bd1b=_0x70e0[_0x307cca];return _0x59bd1b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 3b01344..865c87a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33ae=['exports','INTEGER','sequelize'];(function(_0x4b0731,_0x5f15de){var _0x2eb2ba=function(_0x95f664){while(--_0x95f664){_0x4b0731['push'](_0x4b0731['shift']());}};_0x2eb2ba(++_0x5f15de);}(_0x33ae,0x155));var _0xe33a=function(_0x34ed48,_0x2cc995){_0x34ed48=_0x34ed48-0x0;var _0x37da5c=_0x33ae[_0x34ed48];return _0x37da5c;};'use strict';var Sequelize=require(_0xe33a('0x0'));module[_0xe33a('0x1')]={'penalty':{'type':Sequelize[_0xe33a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6347=['exports','sequelize'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6347,0x1c9));var _0x7634=function(_0x9c233,_0x48f7ec){_0x9c233=_0x9c233-0x0;var _0x717883=_0x6347[_0x9c233];return _0x717883;};'use strict';var Sequelize=require(_0x7634('0x0'));module[_0x7634('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 18cebe3..e6c8dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe65d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','lodash','util','../../config/logger'];(function(_0x2a2b9d,_0x29ad81){var _0x314b2d=function(_0x2887cb){while(--_0x2887cb){_0x2a2b9d['push'](_0x2a2b9d['shift']());}};_0x314b2d(++_0x29ad81);}(_0xe65d,0xda));var _0xde65=function(_0x4cc117,_0x270e6f){_0x4cc117=_0x4cc117-0x0;var _0x27d95a=_0xe65d[_0x4cc117];return _0x27d95a;};'use strict';var _=require(_0xde65('0x0'));var util=require(_0xde65('0x1'));var logger=require(_0xde65('0x2'))(_0xde65('0x3'));var moment=require(_0xde65('0x4'));var BPromise=require(_0xde65('0x5'));var rp=require(_0xde65('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde65('0x7'));var config=require(_0xde65('0x8'));var attributes=require(_0xde65('0x9'));module[_0xde65('0xa')]=function(_0x449129,_0x592716){return _0x449129[_0xde65('0xb')](_0xde65('0xc'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f1d=['util','../../config/logger','api','moment','bluebird','path','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x238ad2,_0xdb657d){var _0x17b936=function(_0x3ca893){while(--_0x3ca893){_0x238ad2['push'](_0x238ad2['shift']());}};_0x17b936(++_0xdb657d);}(_0x4f1d,0xf2));var _0xd4f1=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0x4f1d[_0x838813];return _0x2bd32d;};'use strict';var _=require('lodash');var util=require(_0xd4f1('0x0'));var logger=require(_0xd4f1('0x1'))(_0xd4f1('0x2'));var moment=require(_0xd4f1('0x3'));var BPromise=require(_0xd4f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd4f1('0x6'));module[_0xd4f1('0x7')]=function(_0x7b0e90,_0x58c6fb){return _0x7b0e90[_0xd4f1('0x8')](_0xd4f1('0x9'),attributes,{'tableName':_0xd4f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c5c2677..70cc848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccbc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x455b5d,_0x427262){var _0x460edc=function(_0x4d7b43){while(--_0x4d7b43){_0x455b5d['push'](_0x455b5d['shift']());}};_0x460edc(++_0x427262);}(_0xccbc,0x1c4));var _0xcccb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xccbc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcccb('0x0'));var util=require('util');var moment=require(_0xcccb('0x1'));var BPromise=require(_0xcccb('0x2'));var rs=require(_0xcccb('0x3'));var fs=require('fs');var Redis=require(_0xcccb('0x4'));var db=require(_0xcccb('0x5'))['db'];var utils=require(_0xcccb('0x6'));var logger=require(_0xcccb('0x7'))(_0xcccb('0x8'));var config=require(_0xcccb('0x9'));var jayson=require(_0xcccb('0xa'));var client=jayson['client'][_0xcccb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56fee0,_0x1191f2,_0x3ba68c){return new BPromise(function(_0x4d2ab3,_0x38a619){return client[_0xcccb('0xc')](_0x56fee0,_0x3ba68c)[_0xcccb('0xd')](function(_0x483a80){logger[_0xcccb('0xe')](_0xcccb('0xf'),_0x1191f2,_0xcccb('0x10'));logger[_0xcccb('0x11')](_0xcccb('0x12'),_0x1191f2,'request\x20sent',JSON[_0xcccb('0x13')](_0x483a80));if(_0x483a80[_0xcccb('0x14')]){if(_0x483a80[_0xcccb('0x14')]['code']===0x1f4){logger['error'](_0xcccb('0xf'),_0x1191f2,_0x483a80[_0xcccb('0x14')]['message']);return _0x38a619(_0x483a80[_0xcccb('0x14')][_0xcccb('0x15')]);}logger[_0xcccb('0x14')](_0xcccb('0xf'),_0x1191f2,_0x483a80['error'][_0xcccb('0x15')]);return _0x4d2ab3(_0x483a80[_0xcccb('0x14')][_0xcccb('0x15')]);}else{logger['info'](_0xcccb('0xf'),_0x1191f2,_0xcccb('0x10'));_0x4d2ab3(_0x483a80[_0xcccb('0x16')]['message']);}})[_0xcccb('0x17')](function(_0x10b568){logger[_0xcccb('0x14')](_0xcccb('0xf'),_0x1191f2,_0x10b568);_0x38a619(_0x10b568);});});}
\ No newline at end of file
+var _0x4217=['message','catch','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2896e6,_0x3211e0){var _0x38ada6=function(_0x57349f){while(--_0x57349f){_0x2896e6['push'](_0x2896e6['shift']());}};_0x38ada6(++_0x3211e0);}(_0x4217,0x1ba));var _0x7421=function(_0x46af5b,_0x1f94c0){_0x46af5b=_0x46af5b-0x0;var _0x41e60a=_0x4217[_0x46af5b];return _0x41e60a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7421('0x0'));var BPromise=require(_0x7421('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7421('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7421('0x3'));var logger=require('../../config/logger')(_0x7421('0x4'));var config=require(_0x7421('0x5'));var jayson=require(_0x7421('0x6'));var client=jayson[_0x7421('0x7')][_0x7421('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ea942,_0x4691e9,_0x2d9784){return new BPromise(function(_0x324e76,_0x1e544e){return client[_0x7421('0x9')](_0x2ea942,_0x2d9784)[_0x7421('0xa')](function(_0x544f7e){logger[_0x7421('0xb')](_0x7421('0xc'),_0x4691e9,'request\x20sent');logger[_0x7421('0xd')](_0x7421('0xe'),_0x4691e9,_0x7421('0xf'),JSON[_0x7421('0x10')](_0x544f7e));if(_0x544f7e[_0x7421('0x11')]){if(_0x544f7e[_0x7421('0x11')]['code']===0x1f4){logger[_0x7421('0x11')](_0x7421('0xc'),_0x4691e9,_0x544f7e[_0x7421('0x11')]['message']);return _0x1e544e(_0x544f7e[_0x7421('0x11')][_0x7421('0x12')]);}logger[_0x7421('0x11')](_0x7421('0xc'),_0x4691e9,_0x544f7e[_0x7421('0x11')]['message']);return _0x324e76(_0x544f7e[_0x7421('0x11')][_0x7421('0x12')]);}else{logger[_0x7421('0xb')](_0x7421('0xc'),_0x4691e9,_0x7421('0xf'));_0x324e76(_0x544f7e['result'][_0x7421('0x12')]);}})[_0x7421('0x13')](function(_0x323bb7){logger['error'](_0x7421('0xc'),_0x4691e9,_0x323bb7);_0x1e544e(_0x323bb7);});});}
\ No newline at end of file
index 0a18ef8..63d32d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5d3956,_0x697661){var _0x17325f=function(_0x27ff66){while(--_0x27ff66){_0x5d3956['push'](_0x5d3956['shift']());}};_0x17325f(++_0x697661);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4932bb,_0x28b8ef){var _0x8929f6=function(_0x5a4466){while(--_0x5a4466){_0x4932bb['push'](_0x4932bb['shift']());}};_0x8929f6(++_0x28b8ef);}(_0xedd9,0xfc));var _0x9edd=function(_0x59a791,_0x3b49a7){_0x59a791=_0x59a791-0x0;var _0x235d58=_0xedd9[_0x59a791];return _0x235d58;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 0121a5d..9323965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a30=['sequelize','exports','INTEGER'];(function(_0x1ae734,_0x1d03b2){var _0xd199b=function(_0x46f62f){while(--_0x46f62f){_0x1ae734['push'](_0x1ae734['shift']());}};_0xd199b(++_0x1d03b2);}(_0x1a30,0x15c));var _0x01a3=function(_0x10594f,_0x1af3a0){_0x10594f=_0x10594f-0x0;var _0x5115fa=_0x1a30[_0x10594f];return _0x5115fa;};'use strict';var Sequelize=require(_0x01a3('0x0'));module[_0x01a3('0x1')]={'penalty':{'type':Sequelize[_0x01a3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc991=['sequelize','exports','INTEGER','STRING'];(function(_0x3d4868,_0x1054ba){var _0x4b97d0=function(_0x2b590d){while(--_0x2b590d){_0x3d4868['push'](_0x3d4868['shift']());}};_0x4b97d0(++_0x1054ba);}(_0xc991,0x18c));var _0x1c99=function(_0xff1688,_0x527b5d){_0xff1688=_0xff1688-0x0;var _0x261704=_0xc991[_0xff1688];return _0x261704;};'use strict';var Sequelize=require(_0x1c99('0x0'));module[_0x1c99('0x1')]={'penalty':{'type':Sequelize[_0x1c99('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1c99('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1c99('0x3')]}};
\ No newline at end of file
index 3d5c801..0b2215b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6568=['user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userFaxQueue.attributes','define'];(function(_0x2e1119,_0x4cf524){var _0x40b835=function(_0x5a5d30){while(--_0x5a5d30){_0x2e1119['push'](_0x2e1119['shift']());}};_0x40b835(++_0x4cf524);}(_0x6568,0xe7));var _0x8656=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x6568[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x8656('0x0'));var util=require('util');var logger=require(_0x8656('0x1'))(_0x8656('0x2'));var moment=require(_0x8656('0x3'));var BPromise=require(_0x8656('0x4'));var rp=require(_0x8656('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8656('0x6'));var config=require('../../config/environment');var attributes=require(_0x8656('0x7'));module['exports']=function(_0x292539,_0x325ac3){return _0x292539[_0x8656('0x8')]('UserFaxQueue',attributes,{'tableName':_0x8656('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0089=['rimraf','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x33a74d,_0x513e27){var _0x44a534=function(_0x2fee2f){while(--_0x2fee2f){_0x33a74d['push'](_0x33a74d['shift']());}};_0x44a534(++_0x513e27);}(_0x0089,0xa0));var _0x9008=function(_0x42f148,_0xf1d86c){_0x42f148=_0x42f148-0x0;var _0x53200d=_0x0089[_0x42f148];return _0x53200d;};'use strict';var _=require(_0x9008('0x0'));var util=require(_0x9008('0x1'));var logger=require(_0x9008('0x2'))(_0x9008('0x3'));var moment=require(_0x9008('0x4'));var BPromise=require(_0x9008('0x5'));var rp=require(_0x9008('0x6'));var fs=require('fs');var path=require(_0x9008('0x7'));var rimraf=require(_0x9008('0x8'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x9008('0x9')]=function(_0x49a79e,_0x298ebc){return _0x49a79e['define'](_0x9008('0xa'),attributes,{'tableName':_0x9008('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e84f7c7..e790db6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x378b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x10301b,_0x50b238){var _0x75b4e6=function(_0x351c87){while(--_0x351c87){_0x10301b['push'](_0x10301b['shift']());}};_0x75b4e6(++_0x50b238);}(_0x378b,0x16c));var _0xb378=function(_0x24130a,_0x45f722){_0x24130a=_0x24130a-0x0;var _0x5054a0=_0x378b[_0x24130a];return _0x5054a0;};'use strict';var _=require(_0xb378('0x0'));var util=require(_0xb378('0x1'));var moment=require(_0xb378('0x2'));var BPromise=require(_0xb378('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb378('0x4'))['db'];var utils=require(_0xb378('0x5'));var logger=require(_0xb378('0x6'))(_0xb378('0x7'));var config=require(_0xb378('0x8'));var jayson=require(_0xb378('0x9'));var client=jayson[_0xb378('0xa')][_0xb378('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x359d65,_0x182151,_0x11d6b4){return new BPromise(function(_0x351530,_0x4d2ead){return client[_0xb378('0xc')](_0x359d65,_0x11d6b4)['then'](function(_0x15d669){logger[_0xb378('0xd')](_0xb378('0xe'),_0x182151,'request\x20sent');logger[_0xb378('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x182151,_0xb378('0x10'),JSON[_0xb378('0x11')](_0x15d669));if(_0x15d669[_0xb378('0x12')]){if(_0x15d669['error'][_0xb378('0x13')]===0x1f4){logger['error'](_0xb378('0xe'),_0x182151,_0x15d669['error']['message']);return _0x4d2ead(_0x15d669['error']['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x182151,_0x15d669[_0xb378('0x12')]['message']);return _0x351530(_0x15d669[_0xb378('0x12')][_0xb378('0x14')]);}else{logger[_0xb378('0xd')](_0xb378('0xe'),_0x182151,_0xb378('0x10'));_0x351530(_0x15d669[_0xb378('0x15')][_0xb378('0x14')]);}})[_0xb378('0x16')](function(_0x58eea2){logger['error'](_0xb378('0xe'),_0x182151,_0x58eea2);_0x4d2ead(_0x58eea2);});});}
\ No newline at end of file
+var _0x5dbd=['request','then','info','request\x20sent','debug','stringify','error','message','UserFaxQueue,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5dbd,0xfc));var _0xd5db=function(_0x362247,_0x370c90){_0x362247=_0x362247-0x0;var _0x328213=_0x5dbd[_0x362247];return _0x328213;};'use strict';var _=require(_0xd5db('0x0'));var util=require(_0xd5db('0x1'));var moment=require(_0xd5db('0x2'));var BPromise=require(_0xd5db('0x3'));var rs=require(_0xd5db('0x4'));var fs=require('fs');var Redis=require(_0xd5db('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5db('0x6'));var logger=require(_0xd5db('0x7'))(_0xd5db('0x8'));var config=require(_0xd5db('0x9'));var jayson=require(_0xd5db('0xa'));var client=jayson[_0xd5db('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e88db,_0x3e591d,_0xed5b28){return new BPromise(function(_0x2bea2a,_0x3e06e4){return client[_0xd5db('0xc')](_0x4e88db,_0xed5b28)[_0xd5db('0xd')](function(_0xd39d00){logger[_0xd5db('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x3e591d,_0xd5db('0xf'));logger[_0xd5db('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x3e591d,_0xd5db('0xf'),JSON[_0xd5db('0x11')](_0xd39d00));if(_0xd39d00[_0xd5db('0x12')]){if(_0xd39d00[_0xd5db('0x12')]['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x3e591d,_0xd39d00['error'][_0xd5db('0x13')]);return _0x3e06e4(_0xd39d00['error']['message']);}logger[_0xd5db('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x3e591d,_0xd39d00['error']['message']);return _0x2bea2a(_0xd39d00[_0xd5db('0x12')]['message']);}else{logger[_0xd5db('0xe')](_0xd5db('0x14'),_0x3e591d,'request\x20sent');_0x2bea2a(_0xd39d00['result']['message']);}})[_0xd5db('0x15')](function(_0x3cd0fa){logger[_0xd5db('0x12')](_0xd5db('0x14'),_0x3e591d,_0x3cd0fa);_0x3e06e4(_0x3cd0fa);});});}
\ No newline at end of file
index 01cfd2b..9f53d18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3acc38,_0x84bd2a){var _0x5832f8=function(_0xb5ed4b){while(--_0xb5ed4b){_0x3acc38['push'](_0x3acc38['shift']());}};_0x5832f8(++_0x84bd2a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xcb91[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x349a2c,_0x4655dc){var _0x93d984=function(_0x32869c){while(--_0x32869c){_0x349a2c['push'](_0x349a2c['shift']());}};_0x93d984(++_0x4655dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 7474def..0a46112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5156=['INTEGER','exports'];(function(_0x63cfc2,_0x8218bf){var _0x2717e9=function(_0x54530f){while(--_0x54530f){_0x63cfc2['push'](_0x63cfc2['shift']());}};_0x2717e9(++_0x8218bf);}(_0x5156,0xf1));var _0x6515=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x5156[_0x485b5a];return _0xd2b34d;};'use strict';var Sequelize=require('sequelize');module[_0x6515('0x0')]={'penalty':{'type':Sequelize[_0x6515('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf688=['INTEGER'];(function(_0x462827,_0xd02288){var _0x1c1add=function(_0x6bbd49){while(--_0x6bbd49){_0x462827['push'](_0x462827['shift']());}};_0x1c1add(++_0xd02288);}(_0xf688,0x10d));var _0x8f68=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf688[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x8f68('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index 234d7fa..9797a16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues'];(function(_0x2a1db6,_0x5bd31a){var _0x41d420=function(_0xbecc83){while(--_0xbecc83){_0x2a1db6['push'](_0x2a1db6['shift']());}};_0x41d420(++_0x5bd31a);}(_0x78d0,0xe0));var _0x078d=function(_0x1b1932,_0x4a21cc){_0x1b1932=_0x1b1932-0x0;var _0x1342c1=_0x78d0[_0x1b1932];return _0x1342c1;};'use strict';var _=require(_0x078d('0x0'));var util=require(_0x078d('0x1'));var logger=require(_0x078d('0x2'))(_0x078d('0x3'));var moment=require(_0x078d('0x4'));var BPromise=require(_0x078d('0x5'));var rp=require(_0x078d('0x6'));var fs=require('fs');var path=require(_0x078d('0x7'));var rimraf=require(_0x078d('0x8'));var config=require(_0x078d('0x9'));var attributes=require(_0x078d('0xa'));module['exports']=function(_0x3fa589,_0x5d4acd){return _0x3fa589[_0x078d('0xb')](_0x078d('0xc'),attributes,{'tableName':_0x078d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4808=['../../config/environment','exports','define','lodash','moment','request-promise','path','rimraf'];(function(_0x4259fb,_0x376d06){var _0x275931=function(_0x49e18f){while(--_0x49e18f){_0x4259fb['push'](_0x4259fb['shift']());}};_0x275931(++_0x376d06);}(_0x4808,0x8b));var _0x8480=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x4808[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x8480('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8480('0x1'));var BPromise=require('bluebird');var rp=require(_0x8480('0x2'));var fs=require('fs');var path=require(_0x8480('0x3'));var rimraf=require(_0x8480('0x4'));var config=require(_0x8480('0x5'));var attributes=require('./userMailQueue.attributes');module[_0x8480('0x6')]=function(_0x3bef72,_0x47276f){return _0x3bef72[_0x8480('0x7')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 823b9f8..2671505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x337ef9,_0x5ea432){var _0x4f7628=function(_0x183e73){while(--_0x183e73){_0x337ef9['push'](_0x337ef9['shift']());}};_0x4f7628(++_0x5ea432);}(_0xa41a,0x6b));var _0xaa41=function(_0x33b17b,_0x25d54d){_0x33b17b=_0x33b17b-0x0;var _0x8f5ee=_0xa41a[_0x33b17b];return _0x8f5ee;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x19881c,_0x5828b1){var _0x3eac55=function(_0x1e2e1f){while(--_0x1e2e1f){_0x19881c['push'](_0x19881c['shift']());}};_0x3eac55(++_0x5828b1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x457585,_0x47e33a){_0x457585=_0x457585-0x0;var _0x1f96e1=_0x7fbe[_0x457585];return _0x1f96e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
index 2ce0afa..962a1a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x314c=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','multer','util'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0x314c,0xca));var _0xc314=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x314c[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0xc314('0x0'));var util=require(_0xc314('0x1'));var path=require(_0xc314('0x2'));var timeout=require(_0xc314('0x3'));var express=require('express');var router=express[_0xc314('0x4')]();var fs_extra=require(_0xc314('0x5'));var auth=require(_0xc314('0x6'));var interaction=require(_0xc314('0x7'));var config=require(_0xc314('0x8'));var controller=require('./userNotification.controller');router[_0xc314('0x9')]('/',auth[_0xc314('0xa')](),controller[_0xc314('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xfc75=['fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','path','connect-timeout','Router'];(function(_0x51eda4,_0x3bdb75){var _0x291864=function(_0x26ecd8){while(--_0x26ecd8){_0x51eda4['push'](_0x51eda4['shift']());}};_0x291864(++_0x3bdb75);}(_0xfc75,0x1b8));var _0x5fc7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfc75[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x5fc7('0x0'));var util=require('util');var path=require(_0x5fc7('0x1'));var timeout=require(_0x5fc7('0x2'));var express=require('express');var router=express[_0x5fc7('0x3')]();var fs_extra=require(_0x5fc7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5fc7('0x5'));var config=require(_0x5fc7('0x6'));var controller=require(_0x5fc7('0x7'));router[_0x5fc7('0x8')]('/',auth[_0x5fc7('0x9')](),controller[_0x5fc7('0xa')]);module[_0x5fc7('0xb')]=router;
\ No newline at end of file
index b997e8a..b753dfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb12=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x48525d,_0x3d57e8){var _0x3db5e9=function(_0x48509d){while(--_0x48509d){_0x48525d['push'](_0x48525d['shift']());}};_0x3db5e9(++_0x3d57e8);}(_0xdb12,0x81));var _0x2db1=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0xdb12[_0x18d5d7];return _0x30a9ea;};'use strict';var Sequelize=require(_0x2db1('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x2db1('0x1')]},'recipientsDescription':{'type':Sequelize[_0x2db1('0x2')]},'beep':{'type':Sequelize[_0x2db1('0x3')]}};
\ No newline at end of file
+var _0x3110=['exports','TEXT','BOOLEAN','sequelize'];(function(_0x3cb6f8,_0x4f60e7){var _0x36f63a=function(_0x3a739c){while(--_0x3a739c){_0x3cb6f8['push'](_0x3cb6f8['shift']());}};_0x36f63a(++_0x4f60e7);}(_0x3110,0x1a7));var _0x0311=function(_0x182199,_0x4f59f1){_0x182199=_0x182199-0x0;var _0x35b58b=_0x3110[_0x182199];return _0x35b58b;};'use strict';var Sequelize=require(_0x0311('0x0'));module[_0x0311('0x1')]={'body':{'type':Sequelize[_0x0311('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x0311('0x3')]}};
\ No newline at end of file
index 647b679..10c0155 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8afa=['user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','replace','queue','push','all','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team'];(function(_0x1ad484,_0x1019d9){var _0x27cac4=function(_0x15dae5){while(--_0x15dae5){_0x1ad484['push'](_0x1ad484['shift']());}};_0x27cac4(++_0x1019d9);}(_0x8afa,0x8d));var _0xa8af=function(_0x210c6e,_0x38dec5){_0x210c6e=_0x210c6e-0x0;var _0x4edaf4=_0x8afa[_0x210c6e];return _0x4edaf4;};'use strict';var emlformat=require(_0xa8af('0x0'));var rimraf=require(_0xa8af('0x1'));var zipdir=require(_0xa8af('0x2'));var jsonpatch=require(_0xa8af('0x3'));var rp=require(_0xa8af('0x4'));var moment=require(_0xa8af('0x5'));var BPromise=require(_0xa8af('0x6'));var Mustache=require(_0xa8af('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa8af('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8af('0x9'));var _=require(_0xa8af('0xa'));var squel=require('squel');var crypto=require(_0xa8af('0xb'));var jsforce=require(_0xa8af('0xc'));var deskjs=require(_0xa8af('0xd'));var toCsv=require(_0xa8af('0xe'));var querystring=require(_0xa8af('0xf'));var Papa=require(_0xa8af('0x10'));var Redis=require(_0xa8af('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa8af('0x12'));var as=require(_0xa8af('0x13'));var hardwareService=require(_0xa8af('0x14'));var logger=require(_0xa8af('0x15'))(_0xa8af('0x16'));var utils=require(_0xa8af('0x17'));var config=require(_0xa8af('0x18'));var licenseUtil=require(_0xa8af('0x19'));var db=require(_0xa8af('0x1a'))['db'];config[_0xa8af('0x1b')]=_[_0xa8af('0x1c')](config['redis'],{'host':_0xa8af('0x1d'),'port':0x18eb});var socket=require(_0xa8af('0x1e'))(new Redis(config[_0xa8af('0x1b')]));require(_0xa8af('0x1f'))[_0xa8af('0x20')](socket);function respondWithStatusCode(_0x478977,_0x5571ba){_0x5571ba=_0x5571ba||0xcc;return function(_0x562c1f){if(_0x562c1f){return _0x478977[_0xa8af('0x21')](_0x5571ba);}return _0x478977[_0xa8af('0x22')](_0x5571ba)[_0xa8af('0x23')]();};}function respondWithResult(_0x3005e7,_0x53f673){_0x53f673=_0x53f673||0xc8;return function(_0x4f6c4c){if(_0x4f6c4c){return _0x3005e7[_0xa8af('0x22')](_0x53f673)[_0xa8af('0x24')](_0x4f6c4c);}};}function respondWithFilteredResult(_0x5172e6,_0x2d781a){return function(_0x27136c){if(_0x27136c){var _0xcd9bab=typeof _0x2d781a[_0xa8af('0x25')]===_0xa8af('0x26')&&typeof _0x2d781a['limit']===_0xa8af('0x26');var _0x141d59=_0x27136c[_0xa8af('0x27')];var _0x553c22=_0xcd9bab?0x0:_0x2d781a[_0xa8af('0x25')];var _0x288f4e=_0xcd9bab?_0x27136c[_0xa8af('0x27')]:_0x2d781a[_0xa8af('0x25')]+_0x2d781a[_0xa8af('0x28')];var _0xf110b3;if(_0x288f4e>=_0x141d59){_0x288f4e=_0x141d59;_0xf110b3=0xc8;}else{_0xf110b3=0xce;}_0x5172e6[_0xa8af('0x22')](_0xf110b3);return _0x5172e6[_0xa8af('0x29')](_0xa8af('0x2a'),_0x553c22+'-'+_0x288f4e+'/'+_0x141d59)['json'](_0x27136c);}return null;};}function patchUpdates(_0x54d1c2){return function(_0x34ecb8){try{jsonpatch[_0xa8af('0x2b')](_0x34ecb8,_0x54d1c2,!![]);}catch(_0x3ab882){return BPromise[_0xa8af('0x2c')](_0x3ab882);}return _0x34ecb8[_0xa8af('0x2d')]();};}function saveUpdates(_0xab7ac1,_0x4f4c9a){return function(_0x52cab3){if(_0x52cab3){return _0x52cab3[_0xa8af('0x2e')](_0xab7ac1)[_0xa8af('0x2f')](function(_0x4c298c){return _0x4c298c;});}return null;};}function removeEntity(_0x279c4a,_0x218cb9){return function(_0x5834f8){if(_0x5834f8){return _0x5834f8[_0xa8af('0x30')]()[_0xa8af('0x2f')](function(){_0x279c4a[_0xa8af('0x22')](0xcc)[_0xa8af('0x23')]();});}};}function handleEntityNotFound(_0x50e9e8,_0x57508a){return function(_0xdb8f79){if(!_0xdb8f79){_0x50e9e8['sendStatus'](0x194);}return _0xdb8f79;};}function handleError(_0x5053ac,_0x473e5c){_0x473e5c=_0x473e5c||0x1f4;return function(_0x5ab622){logger[_0xa8af('0x31')](_0x5ab622[_0xa8af('0x32')]);if(_0x5ab622[_0xa8af('0x33')]){delete _0x5ab622[_0xa8af('0x33')];}_0x5053ac['status'](_0x473e5c)[_0xa8af('0x34')](_0x5ab622);};}exports[_0xa8af('0x35')]=function(_0x5f106b,_0x17dc9a,_0x569dd1){if(!_0x5f106b[_0xa8af('0x36')][_0xa8af('0x37')](_0xa8af('0x38'))&&!_0x5f106b[_0xa8af('0x36')][_0xa8af('0x37')](_0xa8af('0x39'))){throw new db['Sequelize'][(_0xa8af('0x3a'))](_0xa8af('0x3b'));}else{if(_0x5f106b[_0xa8af('0x36')]['hasOwnProperty'](_0xa8af('0x39'))&&!_0x5f106b[_0xa8af('0x36')]['hasOwnProperty']('view')){throw new db[(_0xa8af('0x3c'))][(_0xa8af('0x3a'))](_0xa8af('0x3d'));}if(!_0x5f106b[_0xa8af('0x36')][_0xa8af('0x37')](_0xa8af('0x3e'))){throw new db[(_0xa8af('0x3c'))][(_0xa8af('0x3a'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4b8248=JSON['parse'](_0x5f106b[_0xa8af('0x36')][_0xa8af('0x3e')]);}catch(_0x16a5c3){logger[_0xa8af('0x31')](_0x16a5c3);throw new db[(_0xa8af('0x3c'))][(_0xa8af('0x3a'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x27d8e5=[_0xa8af('0x3f'),_0xa8af('0x40'),_0xa8af('0x41'),_0xa8af('0x42'),_0xa8af('0x43'),_0xa8af('0x44'),_0xa8af('0x45'),_0xa8af('0x46'),_0xa8af('0x47')];if(_[_0xa8af('0x48')](_0x4b8248,function(_0x50ebb7){return!_[_0xa8af('0x49')](_0x27d8e5,_0x50ebb7[_0xa8af('0x4a')][_0xa8af('0x4b')]());})){throw new db[(_0xa8af('0x3c'))][(_0xa8af('0x3a'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x2caa7c={};_0x2caa7c[_0xa8af('0x4c')]=_0x5f106b[_0xa8af('0x36')][_0xa8af('0x37')](_0xa8af('0x4c'))?_0x5f106b[_0xa8af('0x36')][_0xa8af('0x4c')]:_0x5f106b[_0xa8af('0x47')][_0xa8af('0x4d')];_0x2caa7c[_0xa8af('0x4e')]=_[_0xa8af('0x4f')](_0x5f106b['body']['recipientsDescription'])?null:_0x5f106b[_0xa8af('0x36')][_0xa8af('0x4e')];_0x2caa7c[_0xa8af('0x50')]=_0x5f106b[_0xa8af('0x36')]['beep']||![];_0x2caa7c[_0xa8af('0x51')]=_0x5f106b[_0xa8af('0x47')]['id'];return getContent(_0x5f106b[_0xa8af('0x36')])[_0xa8af('0x2f')](function(_0x7aae05){_0x2caa7c[_0xa8af('0x36')]=_0x7aae05;return getRecipients(_0x4b8248);})[_0xa8af('0x2f')](function(_0x1ddf01){_0x2caa7c[_0xa8af('0x52')]=_[_0xa8af('0x53')](_0x1ddf01)['join'](',');return db['sequelize'][_0xa8af('0x54')](function(_0x5626dd){return db[_0xa8af('0x55')]['create'](_0x2caa7c,{'raw':!![],'transaction':_0x5626dd})[_0xa8af('0x2f')](function(_0x177851){var _0x44e9f7={'sender':_0x2caa7c[_0xa8af('0x4c')],'description':_0x2caa7c[_0xa8af('0x4e')],'content':_0x2caa7c['body'],'beep':_0x2caa7c['beep']};_0x1ddf01[_0xa8af('0x56')](function(_0x29897d){_0x44e9f7[_0xa8af('0x57')]=_0x29897d;socket[_0xa8af('0x58')](_0xa8af('0x59'),_0x44e9f7);});return _0x177851;});});})[_0xa8af('0x2f')](respondWithResult(_0x17dc9a,0xc9))[_0xa8af('0x5a')](handleError(_0x17dc9a,null));};function getContent(_0x2f5458){return new BPromise(function(_0x55acb7,_0x96e6d0){if(_0x2f5458[_0xa8af('0x38')]){_0x55acb7(_0x2f5458[_0xa8af('0x38')]);return;}return db[_0xa8af('0x5b')][_0xa8af('0x5c')]({'attributes':['html'],'where':{'id':_0x2f5458['TemplateId']},'raw':!![]})[_0xa8af('0x2f')](function(_0x2ad1d1){if(!_0x2ad1d1)throw new db[(_0xa8af('0x3c'))][(_0xa8af('0x3a'))](_0xa8af('0x5d'));var _0xacf459=Mustache[_0xa8af('0x5e')](_0x2ad1d1[_0xa8af('0x5f')],_0x2f5458['view']);_0x55acb7(_0xacf459);})[_0xa8af('0x5a')](function(_0x1781a1){_0x96e6d0(_0x1781a1);});});}function getRecipients(_0x32028e){return new BPromise(function(_0x3b6860,_0x466be3){var _0x4df6a2=[];var _0x552cb5=[];_0x32028e['forEach'](function(_0x230f72){var _0x5d95e6=_[_0xa8af('0x60')](_0x230f72[_0xa8af('0x4a')][_0xa8af('0x4b')]());if(_0x5d95e6===_0xa8af('0x61')){_0x4df6a2=_[_0xa8af('0x62')](_0x4df6a2,_0x230f72[_0xa8af('0x63')]);}else{if(_[_0xa8af('0x49')](_0x5d95e6,'queue'))_0x5d95e6=_0x5d95e6[_0xa8af('0x64')](_0xa8af('0x65'),'Queue');_0x230f72[_0xa8af('0x63')][_0xa8af('0x56')](function(_0x461863){_0x552cb5[_0xa8af('0x66')](getAgents(_0x5d95e6,_0x461863));});}});return BPromise[_0xa8af('0x67')](_0x552cb5)[_0xa8af('0x2f')](function(_0x4e9fea){_0x4df6a2=_['union'](_0x4df6a2,_[_0xa8af('0x68')](_0x4e9fea));_0x3b6860(_0x4df6a2);})['catch'](function(_0x11ef14){_0x466be3(_0x11ef14);});});}function getAgents(_0x46d8a1,_0x1584d3){return new BPromise(function(_0x38d607,_0x318300){return db[_0x46d8a1][_0xa8af('0x5c')]({'where':{'id':_0x1584d3}})[_0xa8af('0x2f')](function(_0x324010){return _0x324010['getAgents']({'attributes':['id'],'raw':!![]})[_0xa8af('0x2f')](function(_0x47bfe2){var _0x37345d=_[_0xa8af('0x69')](_0x47bfe2,'id');_0x38d607(_0x37345d);});})['catch'](function(_0x3e4879){_0x318300(_0x3e4879);});});}
\ No newline at end of file
+var _0xb94a=['hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','UserNotification','forEach','catch','html','view','startCase','model','User','ids','queue','Queue','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','sendUserNotification','body'];(function(_0x2f4a56,_0x15b543){var _0x4f6ae8=function(_0x151c8b){while(--_0x151c8b){_0x2f4a56['push'](_0x2f4a56['shift']());}};_0x4f6ae8(++_0x15b543);}(_0xb94a,0x14c));var _0xab94=function(_0x540306,_0x14b0ef){_0x540306=_0x540306-0x0;var _0x4d97bd=_0xb94a[_0x540306];return _0x4d97bd;};'use strict';var emlformat=require(_0xab94('0x0'));var rimraf=require(_0xab94('0x1'));var zipdir=require(_0xab94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab94('0x3'));var moment=require(_0xab94('0x4'));var BPromise=require(_0xab94('0x5'));var Mustache=require(_0xab94('0x6'));var util=require(_0xab94('0x7'));var path=require(_0xab94('0x8'));var sox=require(_0xab94('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab94('0xa'));var _=require('lodash');var squel=require(_0xab94('0xb'));var crypto=require(_0xab94('0xc'));var jsforce=require(_0xab94('0xd'));var deskjs=require(_0xab94('0xe'));var toCsv=require(_0xab94('0xf'));var querystring=require(_0xab94('0x10'));var Papa=require(_0xab94('0x11'));var Redis=require(_0xab94('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xab94('0x13'));var as=require(_0xab94('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab94('0x15'))('api');var utils=require(_0xab94('0x16'));var config=require(_0xab94('0x17'));var licenseUtil=require(_0xab94('0x18'));var db=require(_0xab94('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xab94('0x1a'))(new Redis(config[_0xab94('0x1b')]));require(_0xab94('0x1c'))[_0xab94('0x1d')](socket);function respondWithStatusCode(_0x249c73,_0xb7a236){_0xb7a236=_0xb7a236||0xcc;return function(_0x48cf82){if(_0x48cf82){return _0x249c73['sendStatus'](_0xb7a236);}return _0x249c73[_0xab94('0x1e')](_0xb7a236)[_0xab94('0x1f')]();};}function respondWithResult(_0x3494e2,_0x17e533){_0x17e533=_0x17e533||0xc8;return function(_0x1bedee){if(_0x1bedee){return _0x3494e2[_0xab94('0x1e')](_0x17e533)[_0xab94('0x20')](_0x1bedee);}};}function respondWithFilteredResult(_0x1a52d6,_0xe11042){return function(_0x566526){if(_0x566526){var _0x44c806=typeof _0xe11042[_0xab94('0x21')]===_0xab94('0x22')&&typeof _0xe11042[_0xab94('0x23')]==='undefined';var _0x4250d6=_0x566526['count'];var _0x3c63b6=_0x44c806?0x0:_0xe11042['offset'];var _0x55469c=_0x44c806?_0x566526[_0xab94('0x24')]:_0xe11042[_0xab94('0x21')]+_0xe11042[_0xab94('0x23')];var _0x14a89f;if(_0x55469c>=_0x4250d6){_0x55469c=_0x4250d6;_0x14a89f=0xc8;}else{_0x14a89f=0xce;}_0x1a52d6[_0xab94('0x1e')](_0x14a89f);return _0x1a52d6['set'](_0xab94('0x25'),_0x3c63b6+'-'+_0x55469c+'/'+_0x4250d6)[_0xab94('0x20')](_0x566526);}return null;};}function patchUpdates(_0x5374d1){return function(_0x1c3606){try{jsonpatch['apply'](_0x1c3606,_0x5374d1,!![]);}catch(_0x5a1651){return BPromise['reject'](_0x5a1651);}return _0x1c3606[_0xab94('0x26')]();};}function saveUpdates(_0x424006,_0x2720b2){return function(_0x5274e8){if(_0x5274e8){return _0x5274e8['update'](_0x424006)[_0xab94('0x27')](function(_0x519792){return _0x519792;});}return null;};}function removeEntity(_0x3ba0de,_0x151707){return function(_0x368cab){if(_0x368cab){return _0x368cab[_0xab94('0x28')]()[_0xab94('0x27')](function(){_0x3ba0de['status'](0xcc)[_0xab94('0x1f')]();});}};}function handleEntityNotFound(_0x4fc590,_0xc2c398){return function(_0x219ade){if(!_0x219ade){_0x4fc590[_0xab94('0x29')](0x194);}return _0x219ade;};}function handleError(_0x5264dd,_0x372ad7){_0x372ad7=_0x372ad7||0x1f4;return function(_0x58a9f4){logger[_0xab94('0x2a')](_0x58a9f4[_0xab94('0x2b')]);if(_0x58a9f4[_0xab94('0x2c')]){delete _0x58a9f4['name'];}_0x5264dd[_0xab94('0x1e')](_0x372ad7)[_0xab94('0x2d')](_0x58a9f4);};}exports[_0xab94('0x2e')]=function(_0x1fff2b,_0x845bf,_0x25e55c){if(!_0x1fff2b[_0xab94('0x2f')][_0xab94('0x30')](_0xab94('0x31'))&&!_0x1fff2b[_0xab94('0x2f')][_0xab94('0x30')](_0xab94('0x32'))){throw new db[(_0xab94('0x33'))][(_0xab94('0x34'))](_0xab94('0x35'));}else{if(_0x1fff2b[_0xab94('0x2f')][_0xab94('0x30')](_0xab94('0x32'))&&!_0x1fff2b[_0xab94('0x2f')][_0xab94('0x30')]('view')){throw new db[(_0xab94('0x33'))][(_0xab94('0x34'))](_0xab94('0x36'));}if(!_0x1fff2b[_0xab94('0x2f')][_0xab94('0x30')](_0xab94('0x37'))){throw new db['Sequelize'][(_0xab94('0x34'))](_0xab94('0x38'));}else{try{var _0x5fb185=JSON[_0xab94('0x39')](_0x1fff2b[_0xab94('0x2f')]['recipients']);}catch(_0x24f0c6){logger[_0xab94('0x2a')](_0x24f0c6);throw new db[(_0xab94('0x33'))][(_0xab94('0x34'))](_0xab94('0x3a'));}var _0x199474=[_0xab94('0x3b'),_0xab94('0x3c'),_0xab94('0x3d'),_0xab94('0x3e'),_0xab94('0x3f'),'voicequeue',_0xab94('0x40'),_0xab94('0x41'),'user'];if(_['some'](_0x5fb185,function(_0x4b6f21){return!_[_0xab94('0x42')](_0x199474,_0x4b6f21['model'][_0xab94('0x43')]());})){throw new db[(_0xab94('0x33'))][(_0xab94('0x34'))](_0xab94('0x44'));}}}var _0x5cf8f5={};_0x5cf8f5[_0xab94('0x45')]=_0x1fff2b[_0xab94('0x2f')][_0xab94('0x30')](_0xab94('0x45'))?_0x1fff2b['body'][_0xab94('0x45')]:_0x1fff2b['user'][_0xab94('0x46')];_0x5cf8f5[_0xab94('0x47')]=_[_0xab94('0x48')](_0x1fff2b['body'][_0xab94('0x47')])?null:_0x1fff2b[_0xab94('0x2f')]['recipientsDescription'];_0x5cf8f5['beep']=_0x1fff2b[_0xab94('0x2f')][_0xab94('0x49')]||![];_0x5cf8f5[_0xab94('0x4a')]=_0x1fff2b['user']['id'];return getContent(_0x1fff2b[_0xab94('0x2f')])[_0xab94('0x27')](function(_0x5c464f){_0x5cf8f5[_0xab94('0x2f')]=_0x5c464f;return getRecipients(_0x5fb185);})[_0xab94('0x27')](function(_0x481140){_0x5cf8f5[_0xab94('0x4b')]=_[_0xab94('0x4c')](_0x481140)['join'](',');return db[_0xab94('0x4d')]['transaction'](function(_0x5872f3){return db[_0xab94('0x4e')]['create'](_0x5cf8f5,{'raw':!![],'transaction':_0x5872f3})[_0xab94('0x27')](function(_0x3f421a){var _0x265406={'sender':_0x5cf8f5['senderName'],'description':_0x5cf8f5[_0xab94('0x47')],'content':_0x5cf8f5[_0xab94('0x2f')],'beep':_0x5cf8f5[_0xab94('0x49')]};_0x481140[_0xab94('0x4f')](function(_0xe7e86e){_0x265406['recipient']=_0xe7e86e;socket['emit']('userNotification:send',_0x265406);});return _0x3f421a;});});})[_0xab94('0x27')](respondWithResult(_0x845bf,0xc9))[_0xab94('0x50')](handleError(_0x845bf,null));};function getContent(_0x5a1422){return new BPromise(function(_0x261b5f,_0x2e8411){if(_0x5a1422[_0xab94('0x31')]){_0x261b5f(_0x5a1422['text']);return;}return db['Template']['findOne']({'attributes':['html'],'where':{'id':_0x5a1422[_0xab94('0x32')]},'raw':!![]})['then'](function(_0x13e7cd){if(!_0x13e7cd)throw new db[(_0xab94('0x33'))][(_0xab94('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2667c6=Mustache['render'](_0x13e7cd[_0xab94('0x51')],_0x5a1422[_0xab94('0x52')]);_0x261b5f(_0x2667c6);})[_0xab94('0x50')](function(_0x2504d6){_0x2e8411(_0x2504d6);});});}function getRecipients(_0x228827){return new BPromise(function(_0x15c7d4,_0x3a758d){var _0x21c7d1=[];var _0x5310e6=[];_0x228827[_0xab94('0x4f')](function(_0x654aa0){var _0x6ba4a4=_[_0xab94('0x53')](_0x654aa0[_0xab94('0x54')]['toLowerCase']());if(_0x6ba4a4===_0xab94('0x55')){_0x21c7d1=_['union'](_0x21c7d1,_0x654aa0[_0xab94('0x56')]);}else{if(_[_0xab94('0x42')](_0x6ba4a4,_0xab94('0x57')))_0x6ba4a4=_0x6ba4a4['replace'](_0xab94('0x57'),_0xab94('0x58'));_0x654aa0['ids'][_0xab94('0x4f')](function(_0x2a4b3d){_0x5310e6[_0xab94('0x59')](getAgents(_0x6ba4a4,_0x2a4b3d));});}});return BPromise[_0xab94('0x5a')](_0x5310e6)[_0xab94('0x27')](function(_0x293925){_0x21c7d1=_['union'](_0x21c7d1,_[_0xab94('0x5b')](_0x293925));_0x15c7d4(_0x21c7d1);})[_0xab94('0x50')](function(_0x2eb677){_0x3a758d(_0x2eb677);});});}function getAgents(_0x271a24,_0x592f20){return new BPromise(function(_0x36b36f,_0xc2eae9){return db[_0x271a24][_0xab94('0x5c')]({'where':{'id':_0x592f20}})[_0xab94('0x27')](function(_0x57670b){return _0x57670b[_0xab94('0x5d')]({'attributes':['id'],'raw':!![]})[_0xab94('0x27')](function(_0xa03ec0){var _0x3c7b3a=_[_0xab94('0x5e')](_0xa03ec0,'id');_0x36b36f(_0x3c7b3a);});})[_0xab94('0x50')](function(_0x1d15f4){_0xc2eae9(_0x1d15f4);});});}
\ No newline at end of file
index 800f5f3..0d0903c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fc=['events','../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x41d27c,_0xb87d87){var _0x10e4b4=function(_0x125311){while(--_0x125311){_0x41d27c['push'](_0x41d27c['shift']());}};_0x10e4b4(++_0xb87d87);}(_0x66fc,0x75));var _0xc66f=function(_0x1d3d06,_0x5c4b39){_0x1d3d06=_0x1d3d06-0x0;var _0x94face=_0x66fc[_0x1d3d06];return _0x94face;};'use strict';var EventEmitter=require(_0xc66f('0x0'));var UserNotification=require(_0xc66f('0x1'))['db'][_0xc66f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc66f('0x3')](0x0);var events={'afterCreate':_0xc66f('0x4'),'afterUpdate':'update','afterDestroy':_0xc66f('0x5')};function emitEvent(_0x4371db){return function(_0x12820c,_0x1bc3c2,_0x2ba3ec){UserNotificationEvents['emit'](_0x4371db+':'+_0x12820c['id'],_0x12820c);UserNotificationEvents[_0xc66f('0x6')](_0x4371db,_0x12820c);_0x2ba3ec(null);};}for(var e in events){if(events[_0xc66f('0x7')](e)){var event=events[e];UserNotification[_0xc66f('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x546b=['emit','hasOwnProperty','hook','events','UserNotification','save','remove'];(function(_0x490a2a,_0x3dbcab){var _0x2f7aa3=function(_0x8229fa){while(--_0x8229fa){_0x490a2a['push'](_0x490a2a['shift']());}};_0x2f7aa3(++_0x3dbcab);}(_0x546b,0xb2));var _0xb546=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0x546b[_0xcd5a3d];return _0xd43207;};'use strict';var EventEmitter=require(_0xb546('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xb546('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb546('0x2'),'afterUpdate':'update','afterDestroy':_0xb546('0x3')};function emitEvent(_0x48e610){return function(_0x17aced,_0x173501,_0x489105){UserNotificationEvents[_0xb546('0x4')](_0x48e610+':'+_0x17aced['id'],_0x17aced);UserNotificationEvents[_0xb546('0x4')](_0x48e610,_0x17aced);_0x489105(null);};}for(var e in events){if(events[_0xb546('0x5')](e)){var event=events[e];UserNotification[_0xb546('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
index 3adad6d..9265965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7599=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x584e56,_0x4b612f){var _0x5c6c94=function(_0x1091e8){while(--_0x1091e8){_0x584e56['push'](_0x584e56['shift']());}};_0x5c6c94(++_0x4b612f);}(_0x7599,0x177));var _0x9759=function(_0x315081,_0x6f58a4){_0x315081=_0x315081-0x0;var _0x4bcb8a=_0x7599[_0x315081];return _0x4bcb8a;};'use strict';var _=require('lodash');var util=require(_0x9759('0x0'));var logger=require(_0x9759('0x1'))(_0x9759('0x2'));var moment=require(_0x9759('0x3'));var BPromise=require(_0x9759('0x4'));var rp=require(_0x9759('0x5'));var fs=require('fs');var path=require(_0x9759('0x6'));var rimraf=require(_0x9759('0x7'));var config=require(_0x9759('0x8'));var attributes=require(_0x9759('0x9'));module['exports']=function(_0x1d5fe1,_0x19f9ef){return _0x1d5fe1[_0x9759('0xa')]('UserNotification',attributes,{'tableName':_0x9759('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9759('0xc'),'collate':_0x9759('0xd')});};
\ No newline at end of file
+var _0x1e80=['utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications'];(function(_0x514867,_0xbc5f43){var _0x3a1b64=function(_0x4d66c4){while(--_0x4d66c4){_0x514867['push'](_0x514867['shift']());}};_0x3a1b64(++_0xbc5f43);}(_0x1e80,0xb7));var _0x01e8=function(_0x44e7a8,_0x586e22){_0x44e7a8=_0x44e7a8-0x0;var _0x5b9b41=_0x1e80[_0x44e7a8];return _0x5b9b41;};'use strict';var _=require(_0x01e8('0x0'));var util=require(_0x01e8('0x1'));var logger=require(_0x01e8('0x2'))(_0x01e8('0x3'));var moment=require('moment');var BPromise=require(_0x01e8('0x4'));var rp=require(_0x01e8('0x5'));var fs=require('fs');var path=require(_0x01e8('0x6'));var rimraf=require('rimraf');var config=require(_0x01e8('0x7'));var attributes=require(_0x01e8('0x8'));module[_0x01e8('0x9')]=function(_0xa8cc28,_0xd4cbd4){return _0xa8cc28[_0x01e8('0xa')](_0x01e8('0xb'),attributes,{'tableName':_0x01e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01e8('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index bee2b52..9987f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddc8=['UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xddc8,0xf7));var _0x8ddc=function(_0x4f65e5,_0x5da854){_0x4f65e5=_0x4f65e5-0x0;var _0x3eb048=_0xddc8[_0x4f65e5];return _0x3eb048;};'use strict';var _=require(_0x8ddc('0x0'));var util=require('util');var moment=require(_0x8ddc('0x1'));var BPromise=require(_0x8ddc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ddc('0x3'));var db=require(_0x8ddc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ddc('0x5'));var config=require(_0x8ddc('0x6'));var jayson=require(_0x8ddc('0x7'));var client=jayson[_0x8ddc('0x8')]['http']({'port':0x232a});config[_0x8ddc('0x9')]=_[_0x8ddc('0xa')](config[_0x8ddc('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ddc('0xb'))(new Redis(config[_0x8ddc('0x9')]));require(_0x8ddc('0xc'))[_0x8ddc('0xd')](socket);function respondWithRpcPromise(_0x27fd6d,_0x43ad07,_0xb0c097){return new BPromise(function(_0x595081,_0x5b55f2){return client[_0x8ddc('0xe')](_0x27fd6d,_0xb0c097)[_0x8ddc('0xf')](function(_0x2f7e3f){logger['info']('UserNotification,\x20%s,\x20%s',_0x43ad07,_0x8ddc('0x10'));logger['debug'](_0x8ddc('0x11'),_0x43ad07,'request\x20sent',JSON[_0x8ddc('0x12')](_0x2f7e3f));if(_0x2f7e3f[_0x8ddc('0x13')]){if(_0x2f7e3f[_0x8ddc('0x13')][_0x8ddc('0x14')]===0x1f4){logger[_0x8ddc('0x13')](_0x8ddc('0x15'),_0x43ad07,_0x2f7e3f[_0x8ddc('0x13')][_0x8ddc('0x16')]);return _0x5b55f2(_0x2f7e3f[_0x8ddc('0x13')][_0x8ddc('0x16')]);}logger[_0x8ddc('0x13')](_0x8ddc('0x15'),_0x43ad07,_0x2f7e3f['error'][_0x8ddc('0x16')]);return _0x595081(_0x2f7e3f['error'][_0x8ddc('0x16')]);}else{logger[_0x8ddc('0x17')]('UserNotification,\x20%s,\x20%s',_0x43ad07,_0x8ddc('0x10'));_0x595081(_0x2f7e3f['result'][_0x8ddc('0x16')]);}})['catch'](function(_0x7e2922){logger[_0x8ddc('0x13')](_0x8ddc('0x15'),_0x43ad07,_0x7e2922);_0x5b55f2(_0x7e2922);});});}
\ No newline at end of file
+var _0x3f13=['register','request','then','info','request\x20sent','error','code','UserNotification,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket'];(function(_0x191edc,_0x1adb39){var _0x5d2765=function(_0x5a4406){while(--_0x5a4406){_0x191edc['push'](_0x191edc['shift']());}};_0x5d2765(++_0x1adb39);}(_0x3f13,0x1ed));var _0x33f1=function(_0x1621e5,_0x2cc67b){_0x1621e5=_0x1621e5-0x0;var _0x53dd63=_0x3f13[_0x1621e5];return _0x53dd63;};'use strict';var _=require('lodash');var util=require(_0x33f1('0x0'));var moment=require(_0x33f1('0x1'));var BPromise=require(_0x33f1('0x2'));var rs=require(_0x33f1('0x3'));var fs=require('fs');var Redis=require(_0x33f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x33f1('0x5'));var jayson=require(_0x33f1('0x6'));var client=jayson['client'][_0x33f1('0x7')]({'port':0x232a});config[_0x33f1('0x8')]=_[_0x33f1('0x9')](config['redis'],{'host':_0x33f1('0xa'),'port':0x18eb});var socket=require(_0x33f1('0xb'))(new Redis(config[_0x33f1('0x8')]));require(_0x33f1('0xc'))[_0x33f1('0xd')](socket);function respondWithRpcPromise(_0x298df8,_0x43a7d6,_0x255541){return new BPromise(function(_0x553eb0,_0x154a8a){return client[_0x33f1('0xe')](_0x298df8,_0x255541)[_0x33f1('0xf')](function(_0x59caae){logger[_0x33f1('0x10')]('UserNotification,\x20%s,\x20%s',_0x43a7d6,_0x33f1('0x11'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x43a7d6,_0x33f1('0x11'),JSON['stringify'](_0x59caae));if(_0x59caae[_0x33f1('0x12')]){if(_0x59caae[_0x33f1('0x12')][_0x33f1('0x13')]===0x1f4){logger['error'](_0x33f1('0x14'),_0x43a7d6,_0x59caae[_0x33f1('0x12')]['message']);return _0x154a8a(_0x59caae[_0x33f1('0x12')][_0x33f1('0x15')]);}logger['error'](_0x33f1('0x14'),_0x43a7d6,_0x59caae[_0x33f1('0x12')][_0x33f1('0x15')]);return _0x553eb0(_0x59caae[_0x33f1('0x12')][_0x33f1('0x15')]);}else{logger['info'](_0x33f1('0x14'),_0x43a7d6,'request\x20sent');_0x553eb0(_0x59caae['result'][_0x33f1('0x15')]);}})[_0x33f1('0x16')](function(_0x2c1b3b){logger[_0x33f1('0x12')]('UserNotification,\x20%s,\x20%s',_0x43a7d6,_0x2c1b3b);_0x154a8a(_0x2c1b3b);});});}
\ No newline at end of file
index 85b7d1e..83da2a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77b7=['userNotification:','save','remove','update','removeListener','register','length'];(function(_0x413131,_0x27aee7){var _0x17d761=function(_0x275c63){while(--_0x275c63){_0x413131['push'](_0x413131['shift']());}};_0x17d761(++_0x27aee7);}(_0x77b7,0x15f));var _0x777b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x77b7[_0x432682];return _0x463d05;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x777b('0x0'),_0x777b('0x1'),_0x777b('0x2')];function createListener(_0x4a84e9,_0x22913e){return function(_0x249ac9){_0x22913e['emit'](_0x4a84e9,_0x249ac9);};}function removeListener(_0x8a0462,_0x504462){return function(){UserNotificationEvents[_0x777b('0x3')](_0x8a0462,_0x504462);};}exports[_0x777b('0x4')]=function(_0x20bc1d){for(var _0x47b4b6=0x0,_0x1a925d=events[_0x777b('0x5')];_0x47b4b6<_0x1a925d;_0x47b4b6++){var _0x147914=events[_0x47b4b6];var _0x258550=createListener(_0x777b('0x6')+_0x147914,_0x20bc1d);UserNotificationEvents['on'](_0x147914,_0x258550);}};
\ No newline at end of file
+var _0x8adc=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x2718ce,_0xcc5d1a){var _0x424140=function(_0x491f15){while(--_0x491f15){_0x2718ce['push'](_0x2718ce['shift']());}};_0x424140(++_0xcc5d1a);}(_0x8adc,0x6d));var _0xc8ad=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x8adc[_0x67f95e];return _0x538f5a;};'use strict';var UserNotificationEvents=require(_0xc8ad('0x0'));var events=[_0xc8ad('0x1'),_0xc8ad('0x2'),'update'];function createListener(_0x5e24b7,_0x3574ea){return function(_0x4e7331){_0x3574ea[_0xc8ad('0x3')](_0x5e24b7,_0x4e7331);};}function removeListener(_0x228d53,_0x2019c5){return function(){UserNotificationEvents[_0xc8ad('0x4')](_0x228d53,_0x2019c5);};}exports[_0xc8ad('0x5')]=function(_0xdb5d44){for(var _0x2741e8=0x0,_0x37f83b=events[_0xc8ad('0x6')];_0x2741e8<_0x37f83b;_0x2741e8++){var _0x2d281a=events[_0x2741e8];var _0x1f9471=createListener(_0xc8ad('0x7')+_0x2d281a,_0xdb5d44);UserNotificationEvents['on'](_0x2d281a,_0x1f9471);}};
\ No newline at end of file
index f099ace..41bf8ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x273458,_0x29414a){var _0x565962=function(_0x409fbf){while(--_0x409fbf){_0x273458['push'](_0x273458['shift']());}};_0x565962(++_0x29414a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4abd29,_0xc7c32c){var _0x5224ef=function(_0x3fe0ed){while(--_0x3fe0ed){_0x4abd29['push'](_0x4abd29['shift']());}};_0x5224ef(++_0xc7c32c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 3500687..38ca887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x645e=['sequelize','exports','INTEGER'];(function(_0x1e5cdd,_0x3ba08e){var _0x3dc05e=function(_0x490e36){while(--_0x490e36){_0x1e5cdd['push'](_0x1e5cdd['shift']());}};_0x3dc05e(++_0x3ba08e);}(_0x645e,0x16b));var _0xe645=function(_0x2338d4,_0x131b44){_0x2338d4=_0x2338d4-0x0;var _0x5700d0=_0x645e[_0x2338d4];return _0x5700d0;};'use strict';var Sequelize=require(_0xe645('0x0'));module[_0xe645('0x1')]={'penalty':{'type':Sequelize[_0xe645('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2793=['exports','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2793,0xfe));var _0x3279=function(_0x5c0974,_0x133f4a){_0x5c0974=_0x5c0974-0x0;var _0x45877a=_0x2793[_0x5c0974];return _0x45877a;};'use strict';var Sequelize=require('sequelize');module[_0x3279('0x0')]={'penalty':{'type':Sequelize[_0x3279('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index f3d6001..163e19d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb800=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x36e8e4,_0x213a61){var _0x491ac7=function(_0x2e9e78){while(--_0x2e9e78){_0x36e8e4['push'](_0x36e8e4['shift']());}};_0x491ac7(++_0x213a61);}(_0xb800,0x138));var _0x0b80=function(_0x5358d4,_0x116e59){_0x5358d4=_0x5358d4-0x0;var _0x2883b0=_0xb800[_0x5358d4];return _0x2883b0;};'use strict';var _=require('lodash');var util=require(_0x0b80('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0b80('0x1'));var BPromise=require(_0x0b80('0x2'));var rp=require(_0x0b80('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b80('0x4'));var config=require(_0x0b80('0x5'));var attributes=require(_0x0b80('0x6'));module[_0x0b80('0x7')]=function(_0x531b6e,_0x4dab00){return _0x531b6e[_0x0b80('0x8')](_0x0b80('0x9'),attributes,{'tableName':_0x0b80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x73ef=['path','rimraf','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xe5f2a3,_0x90b99b){var _0xd27691=function(_0x42105d){while(--_0x42105d){_0xe5f2a3['push'](_0xe5f2a3['shift']());}};_0xd27691(++_0x90b99b);}(_0x73ef,0xc0));var _0xf73e=function(_0x11003b,_0x4b4e65){_0x11003b=_0x11003b-0x0;var _0x3fff7b=_0x73ef[_0x11003b];return _0x3fff7b;};'use strict';var _=require(_0xf73e('0x0'));var util=require(_0xf73e('0x1'));var logger=require(_0xf73e('0x2'))('api');var moment=require(_0xf73e('0x3'));var BPromise=require(_0xf73e('0x4'));var rp=require(_0xf73e('0x5'));var fs=require('fs');var path=require(_0xf73e('0x6'));var rimraf=require(_0xf73e('0x7'));var config=require('../../config/environment');var attributes=require(_0xf73e('0x8'));module[_0xf73e('0x9')]=function(_0x2bff27,_0x45d6d7){return _0x2bff27['define'](_0xf73e('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 904d7f6..78fe658 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc51=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x4425ee,_0x354d04){var _0x46cb58=function(_0x11a2e9){while(--_0x11a2e9){_0x4425ee['push'](_0x4425ee['shift']());}};_0x46cb58(++_0x354d04);}(_0xfc51,0x83));var _0x1fc5=function(_0x421baf,_0x33673d){_0x421baf=_0x421baf-0x0;var _0x4b378a=_0xfc51[_0x421baf];return _0x4b378a;};'use strict';var _=require(_0x1fc5('0x0'));var util=require('util');var moment=require(_0x1fc5('0x1'));var BPromise=require(_0x1fc5('0x2'));var rs=require(_0x1fc5('0x3'));var fs=require('fs');var Redis=require(_0x1fc5('0x4'));var db=require(_0x1fc5('0x5'))['db'];var utils=require(_0x1fc5('0x6'));var logger=require(_0x1fc5('0x7'))(_0x1fc5('0x8'));var config=require(_0x1fc5('0x9'));var jayson=require(_0x1fc5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1db8a2,_0x3971af,_0x34f392){return new BPromise(function(_0xec8b9b,_0x468354){return client[_0x1fc5('0xb')](_0x1db8a2,_0x34f392)[_0x1fc5('0xc')](function(_0x20d659){logger['info'](_0x1fc5('0xd'),_0x3971af,_0x1fc5('0xe'));logger[_0x1fc5('0xf')](_0x1fc5('0x10'),_0x3971af,_0x1fc5('0xe'),JSON[_0x1fc5('0x11')](_0x20d659));if(_0x20d659[_0x1fc5('0x12')]){if(_0x20d659['error'][_0x1fc5('0x13')]===0x1f4){logger['error'](_0x1fc5('0xd'),_0x3971af,_0x20d659[_0x1fc5('0x12')]['message']);return _0x468354(_0x20d659['error'][_0x1fc5('0x14')]);}logger['error'](_0x1fc5('0xd'),_0x3971af,_0x20d659['error'][_0x1fc5('0x14')]);return _0xec8b9b(_0x20d659[_0x1fc5('0x12')][_0x1fc5('0x14')]);}else{logger[_0x1fc5('0x15')](_0x1fc5('0xd'),_0x3971af,_0x1fc5('0xe'));_0xec8b9b(_0x20d659[_0x1fc5('0x16')][_0x1fc5('0x14')]);}})[_0x1fc5('0x17')](function(_0xe4ad76){logger[_0x1fc5('0x12')](_0x1fc5('0xd'),_0x3971af,_0xe4ad76);_0x468354(_0xe4ad76);});});}
\ No newline at end of file
+var _0x5464=['info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x589f71,_0x2faba4){var _0x520534=function(_0x34d22a){while(--_0x34d22a){_0x589f71['push'](_0x589f71['shift']());}};_0x520534(++_0x2faba4);}(_0x5464,0x15d));var _0x4546=function(_0x395c2b,_0x2f15e3){_0x395c2b=_0x395c2b-0x0;var _0x354608=_0x5464[_0x395c2b];return _0x354608;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}
\ No newline at end of file
index 1e7f00f..a761a50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2411=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getSections','getResources','post','/:id/clone','/:id/sections','addSections','/:id/resources','addResources','put','update','destroy','delete','removeSections','removeResources','exports','multer','util','path','express'];(function(_0x538660,_0x255b3f){var _0x5ddc5a=function(_0x5d1f3f){while(--_0x5d1f3f){_0x538660['push'](_0x538660['shift']());}};_0x5ddc5a(++_0x255b3f);}(_0x2411,0xce));var _0x1241=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x2411[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require(_0x1241('0x0'));var util=require(_0x1241('0x1'));var path=require(_0x1241('0x2'));var timeout=require('connect-timeout');var express=require(_0x1241('0x3'));var router=express[_0x1241('0x4')]();var fs_extra=require(_0x1241('0x5'));var auth=require(_0x1241('0x6'));var interaction=require(_0x1241('0x7'));var config=require(_0x1241('0x8'));var controller=require('./userProfile.controller');router[_0x1241('0x9')]('/',auth[_0x1241('0xa')](),controller[_0x1241('0xb')]);router[_0x1241('0x9')](_0x1241('0xc'),auth[_0x1241('0xa')](),controller[_0x1241('0xd')]);router[_0x1241('0x9')](_0x1241('0xe'),auth[_0x1241('0xa')](),controller['show']);router[_0x1241('0x9')]('/:id/sections',auth[_0x1241('0xa')](),controller[_0x1241('0xf')]);router[_0x1241('0x9')]('/:id/resources',auth[_0x1241('0xa')](),controller[_0x1241('0x10')]);router[_0x1241('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1241('0x11')](_0x1241('0x12'),auth[_0x1241('0xa')](),controller['clone']);router[_0x1241('0x11')](_0x1241('0x13'),auth['isAuthenticated'](),controller[_0x1241('0x14')]);router[_0x1241('0x11')](_0x1241('0x15'),auth['isAuthenticated'](),controller[_0x1241('0x16')]);router[_0x1241('0x17')](_0x1241('0xe'),auth[_0x1241('0xa')](),controller[_0x1241('0x18')]);router['delete'](_0x1241('0xe'),auth[_0x1241('0xa')](),controller[_0x1241('0x19')]);router[_0x1241('0x1a')]('/:id/sections',auth[_0x1241('0xa')](),controller[_0x1241('0x1b')]);router[_0x1241('0x1a')](_0x1241('0x15'),auth[_0x1241('0xa')](),controller[_0x1241('0x1c')]);module[_0x1241('0x1d')]=router;
\ No newline at end of file
+var _0xb33f=['clone','/:id/resources','addResources','update','delete','removeSections','exports','multer','util','connect-timeout','fs-extra','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','getResources','post','create','/:id/clone'];(function(_0x9b1698,_0x1cd5ce){var _0x135c42=function(_0x891b6c){while(--_0x891b6c){_0x9b1698['push'](_0x9b1698['shift']());}};_0x135c42(++_0x1cd5ce);}(_0xb33f,0x1cf));var _0xfb33=function(_0x54b886,_0x45211c){_0x54b886=_0x54b886-0x0;var _0x33943c=_0xb33f[_0x54b886];return _0x33943c;};'use strict';var multer=require(_0xfb33('0x0'));var util=require(_0xfb33('0x1'));var path=require('path');var timeout=require(_0xfb33('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfb33('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb33('0x4'));router[_0xfb33('0x5')]('/',auth[_0xfb33('0x6')](),controller[_0xfb33('0x7')]);router['get'](_0xfb33('0x8'),auth[_0xfb33('0x6')](),controller[_0xfb33('0x9')]);router['get'](_0xfb33('0xa'),auth[_0xfb33('0x6')](),controller['show']);router[_0xfb33('0x5')](_0xfb33('0xb'),auth[_0xfb33('0x6')](),controller[_0xfb33('0xc')]);router[_0xfb33('0x5')]('/:id/resources',auth[_0xfb33('0x6')](),controller[_0xfb33('0xd')]);router[_0xfb33('0xe')]('/',auth['isAuthenticated'](),controller[_0xfb33('0xf')]);router[_0xfb33('0xe')](_0xfb33('0x10'),auth[_0xfb33('0x6')](),controller[_0xfb33('0x11')]);router[_0xfb33('0xe')](_0xfb33('0xb'),auth['isAuthenticated'](),controller['addSections']);router[_0xfb33('0xe')](_0xfb33('0x12'),auth[_0xfb33('0x6')](),controller[_0xfb33('0x13')]);router['put'](_0xfb33('0xa'),auth['isAuthenticated'](),controller[_0xfb33('0x14')]);router['delete'](_0xfb33('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xfb33('0x15')](_0xfb33('0xb'),auth[_0xfb33('0x6')](),controller[_0xfb33('0x16')]);router[_0xfb33('0x15')]('/:id/resources',auth[_0xfb33('0x6')](),controller['removeResources']);module[_0xfb33('0x17')]=router;
\ No newline at end of file
index f149589..d4d3835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb55=['join','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x273987,_0x44056f){var _0x50ebc7=function(_0x4efbf0){while(--_0x4efbf0){_0x273987['push'](_0x273987['shift']());}};_0x50ebc7(++_0x44056f);}(_0xdb55,0x147));var _0x5db5=function(_0x5f4e56,_0x592e0a){_0x5f4e56=_0x5f4e56-0x0;var _0x5ad71b=_0xdb55[_0x5f4e56];return _0x5ad71b;};'use strict';var Sequelize=require(_0x5db5('0x0'));module[_0x5db5('0x1')]={'name':{'type':Sequelize[_0x5db5('0x2')],'allowNull':![],'unique':_0x5db5('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x56deb3){this[_0x5db5('0x4')](_0x5db5('0x5'),_0x56deb3?_0x56deb3[_0x5db5('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x5db5('0x5'))?this['getDataValue'](_0x5db5('0x5'))[_0x5db5('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5db5('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x5db5('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5db5('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5db5('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5db5('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xece3=['split','BOOLEAN','sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0xaaa1fe,_0x1e998c){var _0x2a722d=function(_0xee39ab){while(--_0xee39ab){_0xaaa1fe['push'](_0xaaa1fe['shift']());}};_0x2a722d(++_0x1e998c);}(_0xece3,0x110));var _0x3ece=function(_0x5a58db,_0x2d7f41){_0x5a58db=_0x5a58db-0x0;var _0x42dd9a=_0xece3[_0x5a58db];return _0x42dd9a;};'use strict';var Sequelize=require(_0x3ece('0x0'));module[_0x3ece('0x1')]={'name':{'type':Sequelize[_0x3ece('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x3ece('0x2')],'set':function(_0x3ac537){this[_0x3ece('0x3')](_0x3ece('0x4'),_0x3ac537?_0x3ac537[_0x3ece('0x5')](''):[]);},'get':function(){return this[_0x3ece('0x6')](_0x3ece('0x4'))?this[_0x3ece('0x6')](_0x3ece('0x4'))[_0x3ece('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3ece('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x3ece('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x3ece('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3ece('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3ece('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 5350ba2..c9022d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5fc=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','options','find','create','body','clone','include','get','omit','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','addSections','sequelize','removeSections','getSections','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0xd5fc,0xae));var _0xcd5f=function(_0x351ac1,_0x49f569){_0x351ac1=_0x351ac1-0x0;var _0x4bd162=_0xd5fc[_0x351ac1];return _0x4bd162;};'use strict';var emlformat=require(_0xcd5f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd5f('0x1'));var moment=require(_0xcd5f('0x2'));var BPromise=require(_0xcd5f('0x3'));var Mustache=require(_0xcd5f('0x4'));var util=require(_0xcd5f('0x5'));var path=require(_0xcd5f('0x6'));var sox=require('sox');var csv=require(_0xcd5f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd5f('0x8'));var _=require(_0xcd5f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd5f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xcd5f('0xb'));var Papa=require(_0xcd5f('0xc'));var Redis=require('ioredis');var authService=require(_0xcd5f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcd5f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd5f('0xf'))(_0xcd5f('0x10'));var utils=require(_0xcd5f('0x11'));var config=require(_0xcd5f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd5f('0x13'))['db'];config[_0xcd5f('0x14')]=_['defaults'](config[_0xcd5f('0x14')],{'host':_0xcd5f('0x15'),'port':0x18eb});var socket=require(_0xcd5f('0x16'))(new Redis(config[_0xcd5f('0x14')]));require(_0xcd5f('0x17'))['register'](socket);function respondWithStatusCode(_0x2ff7e1,_0x42b369){_0x42b369=_0x42b369||0xcc;return function(_0xc088a3){if(_0xc088a3){return _0x2ff7e1[_0xcd5f('0x18')](_0x42b369);}return _0x2ff7e1[_0xcd5f('0x19')](_0x42b369)[_0xcd5f('0x1a')]();};}function respondWithResult(_0x29a1c8,_0x503ab6){_0x503ab6=_0x503ab6||0xc8;return function(_0x398e16){if(_0x398e16){return _0x29a1c8[_0xcd5f('0x19')](_0x503ab6)[_0xcd5f('0x1b')](_0x398e16);}};}function respondWithFilteredResult(_0x14da31,_0x566200){return function(_0x1a4cb6){if(_0x1a4cb6){var _0x56a874=typeof _0x566200[_0xcd5f('0x1c')]===_0xcd5f('0x1d')&&typeof _0x566200['limit']===_0xcd5f('0x1d');var _0x2e8fde=_0x1a4cb6['count'];var _0x3a952b=_0x56a874?0x0:_0x566200['offset'];var _0x404488=_0x56a874?_0x1a4cb6['count']:_0x566200['offset']+_0x566200[_0xcd5f('0x1e')];var _0x5e7a24;if(_0x404488>=_0x2e8fde){_0x404488=_0x2e8fde;_0x5e7a24=0xc8;}else{_0x5e7a24=0xce;}_0x14da31['status'](_0x5e7a24);return _0x14da31['set'](_0xcd5f('0x1f'),_0x3a952b+'-'+_0x404488+'/'+_0x2e8fde)['json'](_0x1a4cb6);}return null;};}function patchUpdates(_0x154449){return function(_0x3728e5){try{jsonpatch[_0xcd5f('0x20')](_0x3728e5,_0x154449,!![]);}catch(_0x233323){return BPromise[_0xcd5f('0x21')](_0x233323);}return _0x3728e5['save']();};}function saveUpdates(_0x388290,_0x41015c){return function(_0x4dc7ab){if(_0x4dc7ab){return _0x4dc7ab[_0xcd5f('0x22')](_0x388290)[_0xcd5f('0x23')](function(_0x221adc){return _0x221adc;});}return null;};}function removeEntity(_0x3f5cd6,_0x97fff9){return function(_0x1eff4a){if(_0x1eff4a){return _0x1eff4a[_0xcd5f('0x24')]()[_0xcd5f('0x23')](function(){_0x3f5cd6[_0xcd5f('0x19')](0xcc)[_0xcd5f('0x1a')]();});}};}function handleEntityNotFound(_0x36d100,_0x237331){return function(_0x1051c3){if(!_0x1051c3){_0x36d100[_0xcd5f('0x18')](0x194);}return _0x1051c3;};}function handleError(_0x56a74a,_0x10d389){_0x10d389=_0x10d389||0x1f4;return function(_0x3ae2f1){logger['error'](_0x3ae2f1[_0xcd5f('0x25')]);if(_0x3ae2f1['name']){delete _0x3ae2f1[_0xcd5f('0x26')];}_0x56a74a[_0xcd5f('0x19')](_0x10d389)[_0xcd5f('0x27')](_0x3ae2f1);};}exports[_0xcd5f('0x28')]=function(_0xb56143,_0x22e87e){var _0x57e5cf={},_0x5955bb={},_0x116223={'count':0x0,'rows':[]};var _0x168d97=_[_0xcd5f('0x29')](db[_0xcd5f('0x2a')][_0xcd5f('0x2b')],function(_0x3aca2f){return{'name':_0x3aca2f[_0xcd5f('0x2c')],'type':_0x3aca2f['type'][_0xcd5f('0x2d')]};});_0x5955bb[_0xcd5f('0x2e')]=_[_0xcd5f('0x29')](_0x168d97,_0xcd5f('0x26'));_0x5955bb['query']=_[_0xcd5f('0x2f')](_0xb56143[_0xcd5f('0x30')]);_0x5955bb[_0xcd5f('0x31')]=_['intersection'](_0x5955bb[_0xcd5f('0x2e')],_0x5955bb[_0xcd5f('0x30')]);_0x57e5cf[_0xcd5f('0x32')]=_[_0xcd5f('0x33')](_0x5955bb[_0xcd5f('0x2e')],qs[_0xcd5f('0x34')](_0xb56143[_0xcd5f('0x30')][_0xcd5f('0x34')]));_0x57e5cf['attributes']=_0x57e5cf['attributes'][_0xcd5f('0x35')]?_0x57e5cf['attributes']:_0x5955bb[_0xcd5f('0x2e')];if(!_0xb56143[_0xcd5f('0x30')][_0xcd5f('0x36')]('nolimit')){_0x57e5cf[_0xcd5f('0x1e')]=qs[_0xcd5f('0x1e')](_0xb56143[_0xcd5f('0x30')][_0xcd5f('0x1e')]);_0x57e5cf['offset']=qs[_0xcd5f('0x1c')](_0xb56143['query'][_0xcd5f('0x1c')]);}_0x57e5cf[_0xcd5f('0x37')]=qs[_0xcd5f('0x38')](_0xb56143[_0xcd5f('0x30')][_0xcd5f('0x38')]);_0x57e5cf[_0xcd5f('0x39')]=qs['filters'](_[_0xcd5f('0x3a')](_0xb56143['query'],_0x5955bb[_0xcd5f('0x31')]),_0x168d97);if(_0xb56143[_0xcd5f('0x30')][_0xcd5f('0x3b')]){_0x57e5cf['where']=_[_0xcd5f('0x3c')](_0x57e5cf[_0xcd5f('0x39')],{'$or':_[_0xcd5f('0x29')](_0x168d97,function(_0x118881){if(_0x118881[_0xcd5f('0x3d')]!==_0xcd5f('0x3e')){var _0x7f185={};_0x7f185[_0x118881['name']]={'$like':'%'+_0xb56143[_0xcd5f('0x30')][_0xcd5f('0x3b')]+'%'};return _0x7f185;}})});}_0x57e5cf=_[_0xcd5f('0x3c')]({},_0x57e5cf,_0xb56143['options']);var _0x59ebb3={'where':_0x57e5cf[_0xcd5f('0x39')]};return db['UserProfile'][_0xcd5f('0x3f')](_0x59ebb3)[_0xcd5f('0x23')](function(_0x395692){_0x116223[_0xcd5f('0x3f')]=_0x395692;if(_0xb56143['query'][_0xcd5f('0x40')]){_0x57e5cf['include']=[{'all':!![]}];}return db[_0xcd5f('0x2a')][_0xcd5f('0x41')](_0x57e5cf);})[_0xcd5f('0x23')](function(_0x4ef112){_0x116223[_0xcd5f('0x42')]=_0x4ef112;return _0x116223;})[_0xcd5f('0x23')](respondWithFilteredResult(_0x22e87e,_0x57e5cf))[_0xcd5f('0x43')](handleError(_0x22e87e,null));};exports[_0xcd5f('0x44')]=function(_0x141f6c,_0x11b358){var _0x223de4={'raw':![],'where':{'id':_0x141f6c[_0xcd5f('0x45')]['id']}},_0x302ed7={};_0x302ed7[_0xcd5f('0x2e')]=_['keys'](db['UserProfile'][_0xcd5f('0x2b')]);_0x302ed7[_0xcd5f('0x30')]=_[_0xcd5f('0x2f')](_0x141f6c[_0xcd5f('0x30')]);_0x302ed7['filters']=_[_0xcd5f('0x33')](_0x302ed7['model'],_0x302ed7[_0xcd5f('0x30')]);_0x223de4[_0xcd5f('0x32')]=_[_0xcd5f('0x33')](_0x302ed7['model'],qs['fields'](_0x141f6c[_0xcd5f('0x30')][_0xcd5f('0x34')]));_0x223de4[_0xcd5f('0x32')]=_0x223de4[_0xcd5f('0x32')][_0xcd5f('0x35')]?_0x223de4[_0xcd5f('0x32')]:_0x302ed7[_0xcd5f('0x2e')];if(_0x141f6c[_0xcd5f('0x30')][_0xcd5f('0x40')]){_0x223de4['include']=[{'all':!![]}];}_0x223de4=_['merge']({},_0x223de4,_0x141f6c[_0xcd5f('0x46')]);return db[_0xcd5f('0x2a')][_0xcd5f('0x47')](_0x223de4)['then'](handleEntityNotFound(_0x11b358,null))[_0xcd5f('0x23')](respondWithResult(_0x11b358,null))[_0xcd5f('0x43')](handleError(_0x11b358,null));};exports[_0xcd5f('0x48')]=function(_0x21e87c,_0x112c30){return db['UserProfile'][_0xcd5f('0x48')](_0x21e87c[_0xcd5f('0x49')],{})[_0xcd5f('0x23')](respondWithResult(_0x112c30,0xc9))[_0xcd5f('0x43')](handleError(_0x112c30,null));};exports[_0xcd5f('0x4a')]=function(_0xf30d3d,_0x3e4c92){var _0x5ed0c3={'where':{'id':_0xf30d3d[_0xcd5f('0x45')]['id']}},_0x4cb80c={};_0x4cb80c['model']=_[_0xcd5f('0x2f')](db['UserProfile'][_0xcd5f('0x2b')]);_0x5ed0c3[_0xcd5f('0x32')]=_[_0xcd5f('0x33')](_0x4cb80c[_0xcd5f('0x2e')],qs[_0xcd5f('0x34')](_0xf30d3d['query'][_0xcd5f('0x34')]));_0x5ed0c3[_0xcd5f('0x32')]=_0x5ed0c3[_0xcd5f('0x32')][_0xcd5f('0x35')]?_0x5ed0c3[_0xcd5f('0x32')]:_0x4cb80c['model'];if(_0xf30d3d[_0xcd5f('0x30')][_0xcd5f('0x40')]){_0x5ed0c3[_0xcd5f('0x4b')]=[{'all':!![]}];}_0x5ed0c3=_[_0xcd5f('0x3c')]({},_0x5ed0c3,_0xf30d3d[_0xcd5f('0x46')]);return db[_0xcd5f('0x2a')]['find'](_0x5ed0c3)[_0xcd5f('0x23')](handleEntityNotFound(_0x3e4c92,null))[_0xcd5f('0x23')](function(_0xc8d6a){if(_0xc8d6a){var _0x8bc8d1=_0xc8d6a[_0xcd5f('0x4c')]({'plain':!![]});_0x8bc8d1=qs[_0xcd5f('0x4d')](_0x8bc8d1,['id',_0xcd5f('0x4e'),_0xcd5f('0x4f'),_0xcd5f('0x50')]);_0xf30d3d[_0xcd5f('0x49')]=_[_0xcd5f('0x4d')](_0xf30d3d[_0xcd5f('0x49')],['id',_0xcd5f('0x4e'),'updatedAt']);return db['sequelize'][_0xcd5f('0x51')](function(_0x4e269f){return db['UserProfile'][_0xcd5f('0x48')](_['merge'](_0x8bc8d1,_0xf30d3d[_0xcd5f('0x49')]),{'include':_0xf30d3d[_0xcd5f('0x30')][_0xcd5f('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x4e269f})['then'](function(_0x356b97){var _0x4da639=_0x356b97['get']({'plain':!![]});return db['UserProfileSection'][_0xcd5f('0x41')]({'where':{'userProfileId':_0xf30d3d[_0xcd5f('0x45')]['id']},'raw':!![]})[_0xcd5f('0x23')](function(_0x5e69ea){if(_0x5e69ea){return BPromise[_0xcd5f('0x52')](_0x5e69ea,function(_0x590633){return new BPromise(function(_0x56f99d,_0x5e57f4){if(_0x590633[_0xcd5f('0x53')]===null||_0x590633[_0xcd5f('0x53')]===0x1)_0x56f99d(null);return db['UserProfileResource'][_0xcd5f('0x41')]({'where':{'sectionId':_0x590633['id']},'raw':!![]})[_0xcd5f('0x23')](function(_0x453e11){var _0x28078f=_[_0xcd5f('0x29')](_0x453e11,function(_0x216465){return qs[_0xcd5f('0x4d')](_0x216465,['id',_0xcd5f('0x4e'),_0xcd5f('0x4f'),_0xcd5f('0x54')]);});_0x56f99d(_0x28078f);})[_0xcd5f('0x43')](function(_0x50c1af){_0x5e57f4(_0x50c1af);});})[_0xcd5f('0x23')](function(_0x18ebef){var _0x584763=qs[_0xcd5f('0x4d')](_0x590633,['id',_0xcd5f('0x4e'),_0xcd5f('0x4f')]);_0x584763[_0xcd5f('0x55')]=_0x4da639['id'];if(_0x18ebef)_0x584763[_0xcd5f('0x56')]=_0x18ebef;return _0x584763;})[_0xcd5f('0x23')](function(_0x132636){return db[_0xcd5f('0x57')][_0xcd5f('0x48')](_0x132636,{'include':[{'model':db[_0xcd5f('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x4e269f});});})['then'](function(){return _0x4da639;});}});});});}})[_0xcd5f('0x23')](respondWithResult(_0x3e4c92,0xc9))[_0xcd5f('0x43')](handleError(_0x3e4c92,null));};exports[_0xcd5f('0x22')]=function(_0x11254d,_0x3f1c0e){if(_0x11254d[_0xcd5f('0x49')]['id']){delete _0x11254d[_0xcd5f('0x49')]['id'];}return db[_0xcd5f('0x2a')][_0xcd5f('0x47')]({'where':{'id':_0x11254d[_0xcd5f('0x45')]['id']}})[_0xcd5f('0x23')](handleEntityNotFound(_0x3f1c0e,null))['then'](saveUpdates(_0x11254d[_0xcd5f('0x49')],null))[_0xcd5f('0x23')](respondWithResult(_0x3f1c0e,null))[_0xcd5f('0x43')](handleError(_0x3f1c0e,null));};exports[_0xcd5f('0x24')]=function(_0xcd97ec,_0xe7117e){return db[_0xcd5f('0x2a')]['find']({'where':{'id':_0xcd97ec[_0xcd5f('0x45')]['id']}})[_0xcd5f('0x23')](handleEntityNotFound(_0xe7117e,null))[_0xcd5f('0x23')](removeEntity(_0xe7117e,null))[_0xcd5f('0x43')](handleError(_0xe7117e,null));};exports[_0xcd5f('0x59')]=function(_0x31c395,_0x28b3b8){return db['UserProfile']['describe']()[_0xcd5f('0x23')](respondWithResult(_0x28b3b8,null))[_0xcd5f('0x43')](handleError(_0x28b3b8,null));};exports[_0xcd5f('0x5a')]=function(_0x1d121a,_0x507c27){var _0x2d0509=_0x1d121a['body'];return db[_0xcd5f('0x2a')][_0xcd5f('0x47')]({'where':{'id':_0x1d121a['params']['id']}})[_0xcd5f('0x23')](handleEntityNotFound(_0x507c27,null))[_0xcd5f('0x23')](function(_0x1605f4){if(_0x1605f4){return db[_0xcd5f('0x5b')][_0xcd5f('0x51')](function(_0x3ae89c){return db[_0xcd5f('0x57')]['destroy']({'where':{'userProfileId':_0x1d121a['params']['id'],'sectionId':_['map'](_0x2d0509,function(_0x83e1f9){return _0x83e1f9[_0xcd5f('0x54')];})},'transaction':_0x3ae89c})[_0xcd5f('0x23')](function(){var _0xccd5da=_[_0xcd5f('0x29')](_0x2d0509,function(_0x2385b6){_0x2385b6[_0xcd5f('0x55')]=_0x1d121a[_0xcd5f('0x45')]['id'];return _0x2385b6;});var _0xe1a707=[];return BPromise[_0xcd5f('0x52')](_0xccd5da,function(_0x2f2057){return db['UserProfileSection'][_0xcd5f('0x48')](_0x2f2057,{'include':[{'model':db[_0xcd5f('0x58')],'as':_0xcd5f('0x56')}],'raw':!![],'transaction':_0x3ae89c})[_0xcd5f('0x23')](function(_0x280c67){_0xe1a707['push'](_0x280c67[_0xcd5f('0x4c')]({'plain':!![]}));});})[_0xcd5f('0x23')](function(){return _0xe1a707;});});});}})['then'](function(_0x24e6ac){return _0x24e6ac;})[_0xcd5f('0x23')](respondWithResult(_0x507c27,null))[_0xcd5f('0x43')](handleError(_0x507c27,null));};exports[_0xcd5f('0x5c')]=function(_0x54b389,_0x581ca9){var _0xf7f055;return db[_0xcd5f('0x2a')][_0xcd5f('0x47')]({'where':{'id':_0x54b389[_0xcd5f('0x45')]['id']},'attributes':['id',_0xcd5f('0x26')]})[_0xcd5f('0x23')](handleEntityNotFound(_0x581ca9,null))[_0xcd5f('0x23')](function(_0xca1437){if(_0xca1437){_0xf7f055=_0xca1437;return db[_0xcd5f('0x57')][_0xcd5f('0x24')]({'where':{'userProfileId':_0x54b389['params']['id'],'sectionId':_0x54b389[_0xcd5f('0x30')]['ids']}});}})[_0xcd5f('0x23')](function(){return _0xf7f055;})[_0xcd5f('0x23')](respondWithStatusCode(_0x581ca9,null))[_0xcd5f('0x43')](handleError(_0x581ca9,null));};exports[_0xcd5f('0x5d')]=function(_0x167bad,_0x51bc01){var _0x1843c2=[];var _0x27f460=[];return db[_0xcd5f('0x57')][_0xcd5f('0x41')]({'where':{'userProfileId':_0x167bad[_0xcd5f('0x45')]['id']},'raw':!![]})[_0xcd5f('0x23')](function(_0x1d7ef6){_0x1843c2=_[_0xcd5f('0x3b')](_0x1d7ef6,function(_0x176400){return _0x176400[_0xcd5f('0x5e')]===0x1||_[_0xcd5f('0x5f')]([0x3eb,0x709],_0x176400[_0xcd5f('0x54')]);});if(!_[_0xcd5f('0x60')](_0x1843c2)){return _[_0xcd5f('0x29')](_0x1843c2,function(_0x998e7e){return _0x998e7e[_0xcd5f('0x54')];});}else{return;}})[_0xcd5f('0x23')](function(_0x567382){if(_0x567382)_0x27f460=_0x567382;if(_[_0xcd5f('0x5f')](_0x27f460,0x64)){var _0x45ea22=_['find'](_0x1843c2,{'sectionId':0x64});return hasDefaultDashboard(_0x45ea22)[_0xcd5f('0x23')](function(_0x4724cb){return _['map'](_0x1843c2,function(_0x5d7974){if(_0x5d7974[_0xcd5f('0x54')]===0x64){_0x5d7974['subsections']=_0x4724cb;}return _0x5d7974;});});}else{return;}})[_0xcd5f('0x23')](function(_0x4bbde9){if(_0x4bbde9)_0x1843c2=_0x4bbde9;if(_[_0xcd5f('0x5f')](_0x27f460,0x3eb)){var _0x4d5e0e=_[_0xcd5f('0x47')](_0x1843c2,{'sectionId':0x3eb});return getCustomDashboards(_0x4d5e0e)[_0xcd5f('0x23')](function(_0x4d4f70){return _['map'](_0x1843c2,function(_0x276812){if(_0x4d5e0e['enabled']){if(_0x276812[_0xcd5f('0x54')]===0x3eb){_0x276812[_0xcd5f('0x61')]=_0x4d4f70;}}else{if(_0x276812[_0xcd5f('0x54')]===0x64){_0x276812['subsections']=_0x4d4f70;}}return _0x276812;});});}else{return;}})[_0xcd5f('0x23')](function(_0x26d3e2){if(_0x26d3e2)_0x1843c2=_0x26d3e2;if(_[_0xcd5f('0x5f')](_0x27f460,0x709)){var _0x526bcc=_['find'](_0x1843c2,{'sectionId':0x709});return getPlugins(_0x526bcc)[_0xcd5f('0x23')](function(_0xa3fde9){if(_0x526bcc['enabled']){return _[_0xcd5f('0x29')](_0x1843c2,function(_0x305bb1){if(_0x305bb1[_0xcd5f('0x54')]===0x709){_0x305bb1[_0xcd5f('0x61')]=_0xa3fde9;}return _0x305bb1;});}else{var _0x2d610e={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa3fde9};var _0x40498f=_[_0xcd5f('0x29')](_0x1843c2);_0x40498f[_0xcd5f('0x62')](_0x2d610e);return _0x40498f;}});}else{return;}})[_0xcd5f('0x23')](function(_0x43b362){if(_0x43b362)_0x1843c2=_0x43b362;return _[_0xcd5f('0x3b')](_0x1843c2,['enabled',0x1]);})[_0xcd5f('0x23')](respondWithResult(_0x51bc01,null))[_0xcd5f('0x43')](handleError(_0x51bc01,null));};function hasDefaultDashboard(_0x2f3b81){var _0x482370=[0x65];return new BPromise(function(_0x54c5fe,_0xcffa50){try{if(_0x2f3b81[_0xcd5f('0x53')]){_0x54c5fe(_0x482370);}else{return db[_0xcd5f('0x58')][_0xcd5f('0x63')]({'where':{'sectionId':_0x2f3b81['id']},'raw':!![]})['then'](function(_0x1a6e8c){_0x1a6e8c?_0x54c5fe(_0x482370):_0x54c5fe();});}}catch(_0x464914){_0xcffa50(_0x464914);}});}function getCustomDashboards(_0x1a86e9){var _0x1bff64=[];return new BPromise(function(_0x65dc56,_0x2b3cd5){try{if(_0x1a86e9['autoAssociation']){return db[_0xcd5f('0x64')]['findAll']({'raw':!![]})[_0xcd5f('0x23')](function(_0x34266b){_0x34266b[_0xcd5f('0x65')](function(_0x555f32){_0x1bff64[_0xcd5f('0x62')](_0x555f32['id']+0x1869f);});_0x65dc56(_0x1bff64);});}else{return db['UserProfileResource'][_0xcd5f('0x41')]({'where':{'sectionId':_0x1a86e9['id']},'raw':!![]})[_0xcd5f('0x23')](function(_0x33a80c){_0x33a80c['forEach'](function(_0x5c84cc){_0x1bff64[_0xcd5f('0x62')](_0x5c84cc['resourceId']+0x1869f);});_0x65dc56(_0x1bff64);});}}catch(_0x371f25){_0x2b3cd5(_0x371f25);}});}function getPlugins(_0x4a8078){var _0x1a57db=[];return new BPromise(function(_0x4da8bc,_0x420c25){try{if(_0x4a8078[_0xcd5f('0x53')]){return db[_0xcd5f('0x66')][_0xcd5f('0x41')]({'raw':!![]})[_0xcd5f('0x23')](function(_0xdaec0d){_0xdaec0d[_0xcd5f('0x65')](function(_0x374f63){_0x1a57db[_0xcd5f('0x62')](_0x374f63['id']+0x15b38);});_0x4da8bc(_0x1a57db);});}else{return db[_0xcd5f('0x58')][_0xcd5f('0x41')]({'where':{'sectionId':_0x4a8078['id']},'raw':!![]})['then'](function(_0x4b415b){_0x4b415b[_0xcd5f('0x65')](function(_0x114447){_0x1a57db[_0xcd5f('0x62')](_0x114447[_0xcd5f('0x67')]+0x15b38);});_0x4da8bc(_0x1a57db);});}}catch(_0x3885af){_0x420c25(_0x3885af);}});}exports[_0xcd5f('0x68')]=function(_0x2f7f37,_0x42ca3e){return db[_0xcd5f('0x2a')]['find']({'where':{'id':_0x2f7f37[_0xcd5f('0x45')]['id']}})[_0xcd5f('0x23')](handleEntityNotFound(_0x42ca3e,null))[_0xcd5f('0x23')](function(_0x4d6bcb){if(_0x4d6bcb){return db[_0xcd5f('0x5b')][_0xcd5f('0x51')](function(_0x7f58b8){return db[_0xcd5f('0x57')]['findAll']({'where':{'userProfileId':_0x2f7f37[_0xcd5f('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xcd5f('0x23')](function(_0x3ad5ab){if(_0x3ad5ab){return db[_0xcd5f('0x57')][_0xcd5f('0x24')]({'where':{'userProfileId':_0x2f7f37[_0xcd5f('0x45')]['id'],'id':_['map'](_0x3ad5ab,function(_0x27dab7){return _0x27dab7['id'];})},'transaction':_0x7f58b8});}})[_0xcd5f('0x23')](function(_0x246082){var _0x5431f4=_['map'](_0x2f7f37['body'],function(_0xb6bc93){_0xb6bc93[_0xcd5f('0x55')]=_0x2f7f37[_0xcd5f('0x45')]['id'];return _0xb6bc93;});return db[_0xcd5f('0x57')][_0xcd5f('0x69')](_0x5431f4,{'raw':!![],'transaction':_0x7f58b8});})[_0xcd5f('0x23')](function(_0x53d41e){var _0x322820=_['filter'](_[_0xcd5f('0x29')](_0x53d41e,function(_0xa902fd){return _0xa902fd[_0xcd5f('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x322820){return db[_0xcd5f('0x57')]['findAll']({'where':{'userProfileId':_0x2f7f37['params']['id'],'sectionId':_[_0xcd5f('0x29')](_0x322820,function(_0x927dc2){return _0x927dc2[_0xcd5f('0x54')];})},'attributes':['id',_0xcd5f('0x54')],'raw':!![]})[_0xcd5f('0x23')](function(_0x588526){var _0x46273b=_[_0xcd5f('0x29')](_0x2f7f37[_0xcd5f('0x49')],function(_0x2f9460){_0x2f9460[_0xcd5f('0x55')]=_0x2f7f37[_0xcd5f('0x45')]['id'];return _0x2f9460;});return db[_0xcd5f('0x58')][_0xcd5f('0x69')](_0x46273b,{'raw':!![],'transaction':_0x7f58b8});});}})[_0xcd5f('0x43')](handleError(_0x42ca3e,null));});}})[_0xcd5f('0x23')](function(_0x5dc343){var _0x50f68b=_[_0xcd5f('0x29')](_0x5dc343,function(_0x26a034){return _0x26a034[_0xcd5f('0x4c')]({'plain':!![]});});})['then'](respondWithResult(_0x42ca3e,null))[_0xcd5f('0x43')](handleError(_0x42ca3e,null));};exports[_0xcd5f('0x6a')]=function(_0x18435d,_0x203534,_0x7614ae){return db[_0xcd5f('0x2a')][_0xcd5f('0x47')]({'where':{'id':_0x18435d['params']['id']}})[_0xcd5f('0x23')](handleEntityNotFound(_0x203534,null))[_0xcd5f('0x23')](function(_0xc225f){if(_0xc225f){return _0xc225f[_0xcd5f('0x6a')](_0x18435d[_0xcd5f('0x30')][_0xcd5f('0x6b')]);}})[_0xcd5f('0x23')](respondWithStatusCode(_0x203534,null))[_0xcd5f('0x43')](handleError(_0x203534,null));};exports[_0xcd5f('0x6c')]=function(_0x30ec9c,_0x59ec80){var _0x5a0b74={};if(!_0x30ec9c['query'][_0xcd5f('0x6d')])throw new Error(_0xcd5f('0x6e'));if(!_0x30ec9c[_0xcd5f('0x30')][_0xcd5f('0x36')](_0xcd5f('0x6f'))){_0x5a0b74[_0xcd5f('0x1e')]=qs[_0xcd5f('0x1e')](_0x30ec9c[_0xcd5f('0x30')][_0xcd5f('0x1e')]);_0x5a0b74[_0xcd5f('0x1c')]=qs[_0xcd5f('0x1c')](_0x30ec9c[_0xcd5f('0x30')]['offset']);}return db['UserProfile'][_0xcd5f('0x47')]({'where':{'id':_0x30ec9c[_0xcd5f('0x45')]['id']}})[_0xcd5f('0x23')](function(_0x50cff6){if(!_0x50cff6)throw new Error(_0xcd5f('0x70')+_0x30ec9c[_0xcd5f('0x45')]['id']);return db[_0xcd5f('0x2a')]['getResources'](_0x30ec9c);})[_0xcd5f('0x23')](respondWithFilteredResult(_0x59ec80,_0x5a0b74))['catch'](handleError(_0x59ec80,null));};
\ No newline at end of file
+var _0xa3e8=['order','sort','where','pick','filters','VIRTUAL','filter','merge','rows','catch','show','params','includeAll','include','options','find','create','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','UserProfileSection','findAll','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','transaction','each','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','push','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x10837d,_0x39199d){var _0xba0112=function(_0x1ff885){while(--_0x1ff885){_0x10837d['push'](_0x10837d['shift']());}};_0xba0112(++_0x39199d);}(_0xa3e8,0x127));var _0x8a3e=function(_0xb2cbec,_0x41a20f){_0xb2cbec=_0xb2cbec-0x0;var _0x2da99c=_0xa3e8[_0xb2cbec];return _0x2da99c;};'use strict';var emlformat=require(_0x8a3e('0x0'));var rimraf=require(_0x8a3e('0x1'));var zipdir=require(_0x8a3e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a3e('0x3'));var moment=require(_0x8a3e('0x4'));var BPromise=require(_0x8a3e('0x5'));var Mustache=require(_0x8a3e('0x6'));var util=require(_0x8a3e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x8a3e('0x9'));var _=require(_0x8a3e('0xa'));var squel=require('squel');var crypto=require(_0x8a3e('0xb'));var jsforce=require(_0x8a3e('0xc'));var deskjs=require(_0x8a3e('0xd'));var toCsv=require(_0x8a3e('0xe'));var querystring=require(_0x8a3e('0xf'));var Papa=require(_0x8a3e('0x10'));var Redis=require(_0x8a3e('0x11'));var authService=require(_0x8a3e('0x12'));var qs=require(_0x8a3e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a3e('0x14'));var logger=require(_0x8a3e('0x15'))(_0x8a3e('0x16'));var utils=require('../../config/utils');var config=require(_0x8a3e('0x17'));var licenseUtil=require(_0x8a3e('0x18'));var db=require(_0x8a3e('0x19'))['db'];config[_0x8a3e('0x1a')]=_[_0x8a3e('0x1b')](config[_0x8a3e('0x1a')],{'host':_0x8a3e('0x1c'),'port':0x18eb});var socket=require(_0x8a3e('0x1d'))(new Redis(config[_0x8a3e('0x1a')]));require(_0x8a3e('0x1e'))[_0x8a3e('0x1f')](socket);function respondWithStatusCode(_0x2f6305,_0x333c51){_0x333c51=_0x333c51||0xcc;return function(_0x4d9a4c){if(_0x4d9a4c){return _0x2f6305[_0x8a3e('0x20')](_0x333c51);}return _0x2f6305[_0x8a3e('0x21')](_0x333c51)[_0x8a3e('0x22')]();};}function respondWithResult(_0xe302f3,_0x2f316e){_0x2f316e=_0x2f316e||0xc8;return function(_0x4cfba8){if(_0x4cfba8){return _0xe302f3['status'](_0x2f316e)[_0x8a3e('0x23')](_0x4cfba8);}};}function respondWithFilteredResult(_0x5aec3d,_0x49be9d){return function(_0x2f0b46){if(_0x2f0b46){var _0xb2f9c3=typeof _0x49be9d[_0x8a3e('0x24')]===_0x8a3e('0x25')&&typeof _0x49be9d[_0x8a3e('0x26')]===_0x8a3e('0x25');var _0x18bb0e=_0x2f0b46[_0x8a3e('0x27')];var _0x5f30ed=_0xb2f9c3?0x0:_0x49be9d[_0x8a3e('0x24')];var _0x4c25be=_0xb2f9c3?_0x2f0b46[_0x8a3e('0x27')]:_0x49be9d[_0x8a3e('0x24')]+_0x49be9d[_0x8a3e('0x26')];var _0x4a43c8;if(_0x4c25be>=_0x18bb0e){_0x4c25be=_0x18bb0e;_0x4a43c8=0xc8;}else{_0x4a43c8=0xce;}_0x5aec3d[_0x8a3e('0x21')](_0x4a43c8);return _0x5aec3d[_0x8a3e('0x28')]('Content-Range',_0x5f30ed+'-'+_0x4c25be+'/'+_0x18bb0e)[_0x8a3e('0x23')](_0x2f0b46);}return null;};}function patchUpdates(_0x34dc13){return function(_0x306632){try{jsonpatch[_0x8a3e('0x29')](_0x306632,_0x34dc13,!![]);}catch(_0x1cebd6){return BPromise[_0x8a3e('0x2a')](_0x1cebd6);}return _0x306632[_0x8a3e('0x2b')]();};}function saveUpdates(_0x422303,_0x328c45){return function(_0x36d365){if(_0x36d365){return _0x36d365[_0x8a3e('0x2c')](_0x422303)[_0x8a3e('0x2d')](function(_0x489015){return _0x489015;});}return null;};}function removeEntity(_0x1d34e5,_0x58195b){return function(_0x33322d){if(_0x33322d){return _0x33322d['destroy']()[_0x8a3e('0x2d')](function(){_0x1d34e5[_0x8a3e('0x21')](0xcc)[_0x8a3e('0x22')]();});}};}function handleEntityNotFound(_0x289318,_0x86eb3e){return function(_0x15c3ef){if(!_0x15c3ef){_0x289318[_0x8a3e('0x20')](0x194);}return _0x15c3ef;};}function handleError(_0x4f79d3,_0x1f8079){_0x1f8079=_0x1f8079||0x1f4;return function(_0x1c9a16){logger[_0x8a3e('0x2e')](_0x1c9a16[_0x8a3e('0x2f')]);if(_0x1c9a16[_0x8a3e('0x30')]){delete _0x1c9a16[_0x8a3e('0x30')];}_0x4f79d3[_0x8a3e('0x21')](_0x1f8079)['send'](_0x1c9a16);};}exports[_0x8a3e('0x31')]=function(_0x463efc,_0x1012b0){var _0xb21ef={},_0x9587fd={},_0x2ef24a={'count':0x0,'rows':[]};var _0x35ec0f=_[_0x8a3e('0x32')](db[_0x8a3e('0x33')][_0x8a3e('0x34')],function(_0xbd9410){return{'name':_0xbd9410[_0x8a3e('0x35')],'type':_0xbd9410[_0x8a3e('0x36')][_0x8a3e('0x37')]};});_0x9587fd[_0x8a3e('0x38')]=_['map'](_0x35ec0f,'name');_0x9587fd['query']=_[_0x8a3e('0x39')](_0x463efc[_0x8a3e('0x3a')]);_0x9587fd['filters']=_['intersection'](_0x9587fd[_0x8a3e('0x38')],_0x9587fd['query']);_0xb21ef['attributes']=_[_0x8a3e('0x3b')](_0x9587fd[_0x8a3e('0x38')],qs[_0x8a3e('0x3c')](_0x463efc[_0x8a3e('0x3a')][_0x8a3e('0x3c')]));_0xb21ef['attributes']=_0xb21ef[_0x8a3e('0x3d')][_0x8a3e('0x3e')]?_0xb21ef['attributes']:_0x9587fd[_0x8a3e('0x38')];if(!_0x463efc['query'][_0x8a3e('0x3f')](_0x8a3e('0x40'))){_0xb21ef[_0x8a3e('0x26')]=qs[_0x8a3e('0x26')](_0x463efc[_0x8a3e('0x3a')][_0x8a3e('0x26')]);_0xb21ef[_0x8a3e('0x24')]=qs[_0x8a3e('0x24')](_0x463efc['query'][_0x8a3e('0x24')]);}_0xb21ef[_0x8a3e('0x41')]=qs[_0x8a3e('0x42')](_0x463efc[_0x8a3e('0x3a')][_0x8a3e('0x42')]);_0xb21ef[_0x8a3e('0x43')]=qs['filters'](_[_0x8a3e('0x44')](_0x463efc[_0x8a3e('0x3a')],_0x9587fd[_0x8a3e('0x45')]),_0x35ec0f);if(_0x463efc[_0x8a3e('0x3a')]['filter']){_0xb21ef[_0x8a3e('0x43')]=_['merge'](_0xb21ef[_0x8a3e('0x43')],{'$or':_[_0x8a3e('0x32')](_0x35ec0f,function(_0x180ea2){if(_0x180ea2[_0x8a3e('0x36')]!==_0x8a3e('0x46')){var _0x100446={};_0x100446[_0x180ea2[_0x8a3e('0x30')]]={'$like':'%'+_0x463efc[_0x8a3e('0x3a')][_0x8a3e('0x47')]+'%'};return _0x100446;}})});}_0xb21ef=_[_0x8a3e('0x48')]({},_0xb21ef,_0x463efc['options']);var _0x5c5f85={'where':_0xb21ef[_0x8a3e('0x43')]};return db[_0x8a3e('0x33')]['count'](_0x5c5f85)[_0x8a3e('0x2d')](function(_0x1cf040){_0x2ef24a['count']=_0x1cf040;if(_0x463efc[_0x8a3e('0x3a')]['includeAll']){_0xb21ef['include']=[{'all':!![]}];}return db[_0x8a3e('0x33')]['findAll'](_0xb21ef);})['then'](function(_0x17cd6c){_0x2ef24a[_0x8a3e('0x49')]=_0x17cd6c;return _0x2ef24a;})['then'](respondWithFilteredResult(_0x1012b0,_0xb21ef))[_0x8a3e('0x4a')](handleError(_0x1012b0,null));};exports[_0x8a3e('0x4b')]=function(_0x5d40af,_0x22ea63){var _0x485fb5={'raw':![],'where':{'id':_0x5d40af[_0x8a3e('0x4c')]['id']}},_0x5ec137={};_0x5ec137[_0x8a3e('0x38')]=_[_0x8a3e('0x39')](db['UserProfile'][_0x8a3e('0x34')]);_0x5ec137[_0x8a3e('0x3a')]=_['keys'](_0x5d40af[_0x8a3e('0x3a')]);_0x5ec137[_0x8a3e('0x45')]=_['intersection'](_0x5ec137[_0x8a3e('0x38')],_0x5ec137[_0x8a3e('0x3a')]);_0x485fb5['attributes']=_['intersection'](_0x5ec137[_0x8a3e('0x38')],qs[_0x8a3e('0x3c')](_0x5d40af['query'][_0x8a3e('0x3c')]));_0x485fb5[_0x8a3e('0x3d')]=_0x485fb5[_0x8a3e('0x3d')][_0x8a3e('0x3e')]?_0x485fb5[_0x8a3e('0x3d')]:_0x5ec137['model'];if(_0x5d40af['query'][_0x8a3e('0x4d')]){_0x485fb5[_0x8a3e('0x4e')]=[{'all':!![]}];}_0x485fb5=_['merge']({},_0x485fb5,_0x5d40af[_0x8a3e('0x4f')]);return db['UserProfile'][_0x8a3e('0x50')](_0x485fb5)[_0x8a3e('0x2d')](handleEntityNotFound(_0x22ea63,null))['then'](respondWithResult(_0x22ea63,null))[_0x8a3e('0x4a')](handleError(_0x22ea63,null));};exports[_0x8a3e('0x51')]=function(_0x380b63,_0x12a86e){return db['UserProfile'][_0x8a3e('0x51')](_0x380b63['body'],{})[_0x8a3e('0x2d')](respondWithResult(_0x12a86e,0xc9))[_0x8a3e('0x4a')](handleError(_0x12a86e,null));};exports['clone']=function(_0x2fd323,_0x37eb08){var _0x28f217={'where':{'id':_0x2fd323[_0x8a3e('0x4c')]['id']}},_0x3ebe68={};_0x3ebe68['model']=_['keys'](db['UserProfile'][_0x8a3e('0x34')]);_0x28f217[_0x8a3e('0x3d')]=_['intersection'](_0x3ebe68[_0x8a3e('0x38')],qs[_0x8a3e('0x3c')](_0x2fd323[_0x8a3e('0x3a')]['fields']));_0x28f217['attributes']=_0x28f217[_0x8a3e('0x3d')]['length']?_0x28f217[_0x8a3e('0x3d')]:_0x3ebe68[_0x8a3e('0x38')];if(_0x2fd323['query'][_0x8a3e('0x4d')]){_0x28f217[_0x8a3e('0x4e')]=[{'all':!![]}];}_0x28f217=_[_0x8a3e('0x48')]({},_0x28f217,_0x2fd323[_0x8a3e('0x4f')]);return db[_0x8a3e('0x33')]['find'](_0x28f217)[_0x8a3e('0x2d')](handleEntityNotFound(_0x37eb08,null))[_0x8a3e('0x2d')](function(_0x105cb9){if(_0x105cb9){var _0x3acbc8=_0x105cb9[_0x8a3e('0x52')]({'plain':!![]});_0x3acbc8=qs[_0x8a3e('0x53')](_0x3acbc8,['id',_0x8a3e('0x54'),_0x8a3e('0x55'),_0x8a3e('0x56')]);_0x2fd323[_0x8a3e('0x57')]=_[_0x8a3e('0x53')](_0x2fd323[_0x8a3e('0x57')],['id',_0x8a3e('0x54'),_0x8a3e('0x55')]);return db[_0x8a3e('0x58')]['transaction'](function(_0x3db9f6){return db[_0x8a3e('0x33')][_0x8a3e('0x51')](_[_0x8a3e('0x48')](_0x3acbc8,_0x2fd323[_0x8a3e('0x57')]),{'include':_0x2fd323[_0x8a3e('0x3a')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3db9f6})[_0x8a3e('0x2d')](function(_0x10073a){var _0x54c105=_0x10073a['get']({'plain':!![]});return db[_0x8a3e('0x59')][_0x8a3e('0x5a')]({'where':{'userProfileId':_0x2fd323[_0x8a3e('0x4c')]['id']},'raw':!![]})[_0x8a3e('0x2d')](function(_0x1ca373){if(_0x1ca373){return BPromise['each'](_0x1ca373,function(_0x520be1){return new BPromise(function(_0x11c3e3,_0x8a7c83){if(_0x520be1[_0x8a3e('0x5b')]===null||_0x520be1[_0x8a3e('0x5b')]===0x1)_0x11c3e3(null);return db[_0x8a3e('0x5c')][_0x8a3e('0x5a')]({'where':{'sectionId':_0x520be1['id']},'raw':!![]})['then'](function(_0x1d3d46){var _0x9202fb=_[_0x8a3e('0x32')](_0x1d3d46,function(_0x438c17){return qs[_0x8a3e('0x53')](_0x438c17,['id',_0x8a3e('0x54'),'updatedAt',_0x8a3e('0x5d')]);});_0x11c3e3(_0x9202fb);})[_0x8a3e('0x4a')](function(_0x17eed2){_0x8a7c83(_0x17eed2);});})['then'](function(_0x4724bd){var _0x1f845d=qs[_0x8a3e('0x53')](_0x520be1,['id',_0x8a3e('0x54'),_0x8a3e('0x55')]);_0x1f845d[_0x8a3e('0x5e')]=_0x54c105['id'];if(_0x4724bd)_0x1f845d[_0x8a3e('0x5f')]=_0x4724bd;return _0x1f845d;})[_0x8a3e('0x2d')](function(_0x3be636){return db['UserProfileSection']['create'](_0x3be636,{'include':[{'model':db[_0x8a3e('0x5c')],'as':_0x8a3e('0x5f')}],'raw':!![],'transaction':_0x3db9f6});});})[_0x8a3e('0x2d')](function(){return _0x54c105;});}});});});}})['then'](respondWithResult(_0x37eb08,0xc9))[_0x8a3e('0x4a')](handleError(_0x37eb08,null));};exports[_0x8a3e('0x2c')]=function(_0x161c33,_0x5c713a){if(_0x161c33['body']['id']){delete _0x161c33[_0x8a3e('0x57')]['id'];}return db['UserProfile'][_0x8a3e('0x50')]({'where':{'id':_0x161c33['params']['id']}})[_0x8a3e('0x2d')](handleEntityNotFound(_0x5c713a,null))['then'](saveUpdates(_0x161c33['body'],null))[_0x8a3e('0x2d')](respondWithResult(_0x5c713a,null))['catch'](handleError(_0x5c713a,null));};exports[_0x8a3e('0x60')]=function(_0x18d131,_0x3ecd38){return db[_0x8a3e('0x33')][_0x8a3e('0x50')]({'where':{'id':_0x18d131[_0x8a3e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ecd38,null))['then'](removeEntity(_0x3ecd38,null))['catch'](handleError(_0x3ecd38,null));};exports[_0x8a3e('0x61')]=function(_0x370887,_0x468ff3){return db[_0x8a3e('0x33')]['describe']()[_0x8a3e('0x2d')](respondWithResult(_0x468ff3,null))['catch'](handleError(_0x468ff3,null));};exports[_0x8a3e('0x62')]=function(_0x1866e9,_0x425279){var _0x49080b=_0x1866e9[_0x8a3e('0x57')];return db[_0x8a3e('0x33')][_0x8a3e('0x50')]({'where':{'id':_0x1866e9[_0x8a3e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x425279,null))[_0x8a3e('0x2d')](function(_0x4a7561){if(_0x4a7561){return db[_0x8a3e('0x58')][_0x8a3e('0x63')](function(_0x223100){return db[_0x8a3e('0x59')][_0x8a3e('0x60')]({'where':{'userProfileId':_0x1866e9[_0x8a3e('0x4c')]['id'],'sectionId':_['map'](_0x49080b,function(_0x5d1094){return _0x5d1094[_0x8a3e('0x5d')];})},'transaction':_0x223100})[_0x8a3e('0x2d')](function(){var _0xd77af7=_[_0x8a3e('0x32')](_0x49080b,function(_0x301c06){_0x301c06['userProfileId']=_0x1866e9['params']['id'];return _0x301c06;});var _0x4df40f=[];return BPromise[_0x8a3e('0x64')](_0xd77af7,function(_0x53a593){return db[_0x8a3e('0x59')][_0x8a3e('0x51')](_0x53a593,{'include':[{'model':db[_0x8a3e('0x5c')],'as':_0x8a3e('0x5f')}],'raw':!![],'transaction':_0x223100})[_0x8a3e('0x2d')](function(_0x26ac52){_0x4df40f['push'](_0x26ac52['get']({'plain':!![]}));});})[_0x8a3e('0x2d')](function(){return _0x4df40f;});});});}})['then'](function(_0x4e7f48){return _0x4e7f48;})[_0x8a3e('0x2d')](respondWithResult(_0x425279,null))[_0x8a3e('0x4a')](handleError(_0x425279,null));};exports[_0x8a3e('0x65')]=function(_0x20c53b,_0x4daf56){var _0x4552d8;return db['UserProfile'][_0x8a3e('0x50')]({'where':{'id':_0x20c53b[_0x8a3e('0x4c')]['id']},'attributes':['id',_0x8a3e('0x30')]})[_0x8a3e('0x2d')](handleEntityNotFound(_0x4daf56,null))['then'](function(_0x2a900b){if(_0x2a900b){_0x4552d8=_0x2a900b;return db[_0x8a3e('0x59')][_0x8a3e('0x60')]({'where':{'userProfileId':_0x20c53b[_0x8a3e('0x4c')]['id'],'sectionId':_0x20c53b['query'][_0x8a3e('0x66')]}});}})[_0x8a3e('0x2d')](function(){return _0x4552d8;})['then'](respondWithStatusCode(_0x4daf56,null))[_0x8a3e('0x4a')](handleError(_0x4daf56,null));};exports[_0x8a3e('0x67')]=function(_0x33d7cb,_0xe28823){var _0x372602=[];var _0x2bfdf3=[];return db[_0x8a3e('0x59')][_0x8a3e('0x5a')]({'where':{'userProfileId':_0x33d7cb[_0x8a3e('0x4c')]['id']},'raw':!![]})[_0x8a3e('0x2d')](function(_0x2f6a55){_0x372602=_[_0x8a3e('0x47')](_0x2f6a55,function(_0x446ecc){return _0x446ecc[_0x8a3e('0x68')]===0x1||_[_0x8a3e('0x69')]([0x3eb,0x709],_0x446ecc[_0x8a3e('0x5d')]);});if(!_[_0x8a3e('0x6a')](_0x372602)){return _['map'](_0x372602,function(_0x5ca364){return _0x5ca364[_0x8a3e('0x5d')];});}else{return;}})['then'](function(_0x5713cc){if(_0x5713cc)_0x2bfdf3=_0x5713cc;if(_[_0x8a3e('0x69')](_0x2bfdf3,0x64)){var _0xf3f70d=_[_0x8a3e('0x50')](_0x372602,{'sectionId':0x64});return hasDefaultDashboard(_0xf3f70d)[_0x8a3e('0x2d')](function(_0x4aea68){return _[_0x8a3e('0x32')](_0x372602,function(_0x30bd8b){if(_0x30bd8b['sectionId']===0x64){_0x30bd8b[_0x8a3e('0x6b')]=_0x4aea68;}return _0x30bd8b;});});}else{return;}})['then'](function(_0x169aa1){if(_0x169aa1)_0x372602=_0x169aa1;if(_[_0x8a3e('0x69')](_0x2bfdf3,0x3eb)){var _0x94746b=_[_0x8a3e('0x50')](_0x372602,{'sectionId':0x3eb});return getCustomDashboards(_0x94746b)[_0x8a3e('0x2d')](function(_0x91e548){return _[_0x8a3e('0x32')](_0x372602,function(_0x348955){if(_0x94746b['enabled']){if(_0x348955[_0x8a3e('0x5d')]===0x3eb){_0x348955[_0x8a3e('0x6b')]=_0x91e548;}}else{if(_0x348955['sectionId']===0x64){_0x348955[_0x8a3e('0x6b')]=_0x91e548;}}return _0x348955;});});}else{return;}})[_0x8a3e('0x2d')](function(_0x46de23){if(_0x46de23)_0x372602=_0x46de23;if(_['includes'](_0x2bfdf3,0x709)){var _0x4b4573=_[_0x8a3e('0x50')](_0x372602,{'sectionId':0x709});return getPlugins(_0x4b4573)[_0x8a3e('0x2d')](function(_0x31f8dc){if(_0x4b4573['enabled']){return _[_0x8a3e('0x32')](_0x372602,function(_0x41cf47){if(_0x41cf47[_0x8a3e('0x5d')]===0x709){_0x41cf47[_0x8a3e('0x6b')]=_0x31f8dc;}return _0x41cf47;});}else{var _0x57abb1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x31f8dc};var _0x38f001=_[_0x8a3e('0x32')](_0x372602);_0x38f001[_0x8a3e('0x6c')](_0x57abb1);return _0x38f001;}});}else{return;}})['then'](function(_0x45e6c5){if(_0x45e6c5)_0x372602=_0x45e6c5;return _['filter'](_0x372602,['enabled',0x1]);})[_0x8a3e('0x2d')](respondWithResult(_0xe28823,null))[_0x8a3e('0x4a')](handleError(_0xe28823,null));};function hasDefaultDashboard(_0x180087){var _0x1ed1b0=[0x65];return new BPromise(function(_0x1fc726,_0x58a2e3){try{if(_0x180087['autoAssociation']){_0x1fc726(_0x1ed1b0);}else{return db[_0x8a3e('0x5c')]['findOne']({'where':{'sectionId':_0x180087['id']},'raw':!![]})[_0x8a3e('0x2d')](function(_0x261e7d){_0x261e7d?_0x1fc726(_0x1ed1b0):_0x1fc726();});}}catch(_0x246ca0){_0x58a2e3(_0x246ca0);}});}function getCustomDashboards(_0x4a6158){var _0x119dfd=[];return new BPromise(function(_0xb683f3,_0x1990b4){try{if(_0x4a6158[_0x8a3e('0x5b')]){return db[_0x8a3e('0x6d')][_0x8a3e('0x5a')]({'raw':!![]})[_0x8a3e('0x2d')](function(_0x791f33){_0x791f33[_0x8a3e('0x6e')](function(_0x161fd9){_0x119dfd[_0x8a3e('0x6c')](_0x161fd9['id']+0x1869f);});_0xb683f3(_0x119dfd);});}else{return db['UserProfileResource'][_0x8a3e('0x5a')]({'where':{'sectionId':_0x4a6158['id']},'raw':!![]})[_0x8a3e('0x2d')](function(_0x4b5ed9){_0x4b5ed9['forEach'](function(_0x150b61){_0x119dfd[_0x8a3e('0x6c')](_0x150b61[_0x8a3e('0x6f')]+0x1869f);});_0xb683f3(_0x119dfd);});}}catch(_0x29b5ff){_0x1990b4(_0x29b5ff);}});}function getPlugins(_0x586a5f){var _0x24af9d=[];return new BPromise(function(_0x36e7cf,_0x3001b3){try{if(_0x586a5f[_0x8a3e('0x5b')]){return db[_0x8a3e('0x70')][_0x8a3e('0x5a')]({'raw':!![]})['then'](function(_0x598489){_0x598489[_0x8a3e('0x6e')](function(_0x728d3f){_0x24af9d[_0x8a3e('0x6c')](_0x728d3f['id']+0x15b38);});_0x36e7cf(_0x24af9d);});}else{return db[_0x8a3e('0x5c')]['findAll']({'where':{'sectionId':_0x586a5f['id']},'raw':!![]})[_0x8a3e('0x2d')](function(_0xfa2395){_0xfa2395[_0x8a3e('0x6e')](function(_0x3204d5){_0x24af9d[_0x8a3e('0x6c')](_0x3204d5[_0x8a3e('0x6f')]+0x15b38);});_0x36e7cf(_0x24af9d);});}}catch(_0x17525e){_0x3001b3(_0x17525e);}});}exports[_0x8a3e('0x71')]=function(_0xa7fcbe,_0x1b8bcf){return db[_0x8a3e('0x33')][_0x8a3e('0x50')]({'where':{'id':_0xa7fcbe[_0x8a3e('0x4c')]['id']}})[_0x8a3e('0x2d')](handleEntityNotFound(_0x1b8bcf,null))[_0x8a3e('0x2d')](function(_0x22fe4e){if(_0x22fe4e){return db['sequelize'][_0x8a3e('0x63')](function(_0x2ed6f9){return db[_0x8a3e('0x59')][_0x8a3e('0x5a')]({'where':{'userProfileId':_0xa7fcbe[_0x8a3e('0x4c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4a6680){if(_0x4a6680){return db[_0x8a3e('0x59')][_0x8a3e('0x60')]({'where':{'userProfileId':_0xa7fcbe[_0x8a3e('0x4c')]['id'],'id':_[_0x8a3e('0x32')](_0x4a6680,function(_0x457d5d){return _0x457d5d['id'];})},'transaction':_0x2ed6f9});}})['then'](function(_0x51bf05){var _0x2b122f=_[_0x8a3e('0x32')](_0xa7fcbe[_0x8a3e('0x57')],function(_0x12769c){_0x12769c[_0x8a3e('0x5e')]=_0xa7fcbe[_0x8a3e('0x4c')]['id'];return _0x12769c;});return db[_0x8a3e('0x59')][_0x8a3e('0x72')](_0x2b122f,{'raw':!![],'transaction':_0x2ed6f9});})[_0x8a3e('0x2d')](function(_0x26377b){var _0x3ba18e=_[_0x8a3e('0x47')](_['map'](_0x26377b,function(_0x26d1c4){return _0x26d1c4['get']({'plain':!![]});}),{'includeAll':![]});if(_0x3ba18e){return db[_0x8a3e('0x59')]['findAll']({'where':{'userProfileId':_0xa7fcbe[_0x8a3e('0x4c')]['id'],'sectionId':_[_0x8a3e('0x32')](_0x3ba18e,function(_0x17f100){return _0x17f100[_0x8a3e('0x5d')];})},'attributes':['id',_0x8a3e('0x5d')],'raw':!![]})[_0x8a3e('0x2d')](function(_0xaaf8d4){var _0x47ed32=_[_0x8a3e('0x32')](_0xa7fcbe[_0x8a3e('0x57')],function(_0x50146f){_0x50146f[_0x8a3e('0x5e')]=_0xa7fcbe[_0x8a3e('0x4c')]['id'];return _0x50146f;});return db['UserProfileResource']['bulkCreate'](_0x47ed32,{'raw':!![],'transaction':_0x2ed6f9});});}})[_0x8a3e('0x4a')](handleError(_0x1b8bcf,null));});}})[_0x8a3e('0x2d')](function(_0x467f3e){var _0x5088e6=_[_0x8a3e('0x32')](_0x467f3e,function(_0x40e4a5){return _0x40e4a5[_0x8a3e('0x52')]({'plain':!![]});});})[_0x8a3e('0x2d')](respondWithResult(_0x1b8bcf,null))[_0x8a3e('0x4a')](handleError(_0x1b8bcf,null));};exports[_0x8a3e('0x73')]=function(_0x1c6dad,_0x34f345,_0x345ab6){return db[_0x8a3e('0x33')][_0x8a3e('0x50')]({'where':{'id':_0x1c6dad[_0x8a3e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34f345,null))[_0x8a3e('0x2d')](function(_0x3852ba){if(_0x3852ba){return _0x3852ba[_0x8a3e('0x73')](_0x1c6dad['query'][_0x8a3e('0x66')]);}})[_0x8a3e('0x2d')](respondWithStatusCode(_0x34f345,null))[_0x8a3e('0x4a')](handleError(_0x34f345,null));};exports['getResources']=function(_0x518788,_0x123db1){var _0x4bbdb2={};if(!_0x518788[_0x8a3e('0x3a')][_0x8a3e('0x74')])throw new Error(_0x8a3e('0x75'));if(!_0x518788[_0x8a3e('0x3a')][_0x8a3e('0x3f')](_0x8a3e('0x40'))){_0x4bbdb2[_0x8a3e('0x26')]=qs[_0x8a3e('0x26')](_0x518788[_0x8a3e('0x3a')][_0x8a3e('0x26')]);_0x4bbdb2['offset']=qs[_0x8a3e('0x24')](_0x518788[_0x8a3e('0x3a')][_0x8a3e('0x24')]);}return db['UserProfile'][_0x8a3e('0x50')]({'where':{'id':_0x518788[_0x8a3e('0x4c')]['id']}})[_0x8a3e('0x2d')](function(_0x440e86){if(!_0x440e86)throw new Error(_0x8a3e('0x76')+_0x518788[_0x8a3e('0x4c')]['id']);return db[_0x8a3e('0x33')][_0x8a3e('0x77')](_0x518788);})['then'](respondWithFilteredResult(_0x123db1,_0x4bbdb2))[_0x8a3e('0x4a')](handleError(_0x123db1,null));};
\ No newline at end of file
index c386b3f..e9d28a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb22=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xcb22,0xc8));var _0x2cb2=function(_0x50fb37,_0x2f0f72){_0x50fb37=_0x50fb37-0x0;var _0x1212ee=_0xcb22[_0x50fb37];return _0x1212ee;};'use strict';var EventEmitter=require(_0x2cb2('0x0'));var UserProfile=require(_0x2cb2('0x1'))['db'][_0x2cb2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2cb2('0x3')](0x0);var events={'afterCreate':_0x2cb2('0x4'),'afterUpdate':_0x2cb2('0x5'),'afterDestroy':_0x2cb2('0x6')};function emitEvent(_0xe763ff){return function(_0x386f8b,_0x3b1af5,_0x3dec93){UserProfileEvents['emit'](_0xe763ff+':'+_0x386f8b['id'],_0x386f8b);UserProfileEvents[_0x2cb2('0x7')](_0xe763ff,_0x386f8b);_0x3dec93(null);};}for(var e in events){if(events[_0x2cb2('0x8')](e)){var event=events[e];UserProfile[_0x2cb2('0x9')](e,emitEvent(event));}}module[_0x2cb2('0xa')]=UserProfileEvents;
\ No newline at end of file
+var _0x8ace=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update'];(function(_0x2bdeb4,_0xdf6a44){var _0x38389a=function(_0x487153){while(--_0x487153){_0x2bdeb4['push'](_0x2bdeb4['shift']());}};_0x38389a(++_0xdf6a44);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x1e1943,_0x1a6d54){_0x1e1943=_0x1e1943-0x0;var _0x4989a9=_0x8ace[_0x1e1943];return _0x4989a9;};'use strict';var EventEmitter=require(_0xe8ac('0x0'));var UserProfile=require(_0xe8ac('0x1'))['db'][_0xe8ac('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe8ac('0x3')](0x0);var events={'afterCreate':_0xe8ac('0x4'),'afterUpdate':_0xe8ac('0x5'),'afterDestroy':_0xe8ac('0x6')};function emitEvent(_0x274d7d){return function(_0x114351,_0xf6af00,_0x199794){UserProfileEvents[_0xe8ac('0x7')](_0x274d7d+':'+_0x114351['id'],_0x114351);UserProfileEvents[_0xe8ac('0x7')](_0x274d7d,_0x114351);_0x199794(null);};}for(var e in events){if(events[_0xe8ac('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xe8ac('0x9')]=UserProfileEvents;
\ No newline at end of file
index 9f909c9..010c8ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a6d=['queue','VoiceQueue','inbound','type','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','User','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','Reports','reportId','AnalyticMetric','toUpperCase','slice','QueryTypes','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','section','isEmpty','push','UserProfileSection','find','all','ignore','union','length','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','includeAll','default','DefaultReports','custom','CustomReports','count','include','ThroughTags','color','tag','rows','true','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','telephone','VoiceQueues'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0x3a6d,0x143));var _0xd3a6=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x3a6d[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xd3a6('0x0'));var attributes=require(_0xd3a6('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xd3a6('0x2'));module[_0xd3a6('0x3')]=function(_0x31619a){var _0x37a8f2=_0x31619a[_0xd3a6('0x4')];function _0x585473(_0x1cb966,_0x27d641){return new Promise(function(_0x1e44bd,_0x1fc450){if(!_0x27d641)return _0x1e44bd(null);var _0x25b042=_0x27d641[_0xd3a6('0x5')]?{[_0x27d641['filter'][_0xd3a6('0x6')]]:_0x27d641[_0xd3a6('0x5')][_0xd3a6('0x7')]}:undefined;return _0x37a8f2[_0x1cb966][_0xd3a6('0x8')]({'where':_0x25b042,'raw':!![]})[_0xd3a6('0x9')](function(_0xa67661){_0x27d641[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0xa67661,'id');_0x1e44bd(_0x27d641);})[_0xd3a6('0xc')](function(_0x5ab5a9){_0x1fc450(_0x5ab5a9);});});}function _0x172513(_0x1a00f7,_0x3f4d74){return new Promise(function(_0x225399,_0x2bd4f0){var _0x517a3b=_0x1a00f7['filter']?{[_0x1a00f7['filter'][_0xd3a6('0x6')]]:_0x1a00f7[_0xd3a6('0x5')][_0xd3a6('0x7')]}:undefined;return _0x37a8f2[_0x1a00f7[_0xd3a6('0xd')]][_0xd3a6('0x8')]({'where':_0x517a3b,'raw':!![]})[_0xd3a6('0x9')](function(_0xa56452){_0x3f4d74['associatedResources']=_[_0xd3a6('0xb')](_0xa56452,function(_0xf5ace5){return _0xf5ace5[_0xd3a6('0xe')];});_0x225399(_0x3f4d74);})['catch'](function(_0x3c2399){_0x2bd4f0(_0x3c2399);});});}function _0x305b61(_0x1781f6,_0x57d826,_0x3498d5){if(!_0x57d826)return Promise['resolve'](null);return new Promise(function(_0x518b6d,_0x28b63c){return _0x37a8f2[_0xd3a6('0xf')][_0xd3a6('0x8')]({'where':{'sectionId':_0x57d826['id']},'raw':!![]})[_0xd3a6('0x9')](function(_0x22fb05){if(_0x1781f6[_0xd3a6('0x6')]&&_0x1781f6[_0xd3a6('0x6')]!=='id'){_0x57d826['associatedResources']=_[_0xd3a6('0xb')](_0x22fb05,function(_0x4e78ec){return _0x4e78ec[_0x1781f6[_0xd3a6('0x6')]];});}else{if(_0x3498d5===_0xd3a6('0x10')){_0x57d826[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0x22fb05,function(_0x465d25){return{'id':_0x465d25[_0xd3a6('0x11')],'type':_0x465d25['type']};});}else{_0x57d826[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0x22fb05,function(_0x57cf15){return _0x57cf15['resourceId'];});}}_0x518b6d(_0x57d826);})['catch'](function(_0x573870){_0x28b63c(_0x573870);});});}function _0x5c9075(_0x98a12a,_0x400982){var _0x3d0b28={'parentSections':[]};switch(_0x98a12a['toLowerCase']()){case _0xd3a6('0x12'):_0x3d0b28['childModel']=_0xd3a6('0x13');break;case _0xd3a6('0x14'):_0x3d0b28[_0xd3a6('0x15')]='SquareOdbc';break;case _0xd3a6('0x16'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x17');_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x19'),'field':_0xd3a6('0xe'),'foreignKey':'projectName'}];break;case _0xd3a6('0x1a'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x1b');break;case _0xd3a6('0x1c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x1d');_0x3d0b28['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0xd3a6('0x1e')}];break;case _0xd3a6('0x1f'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x20');break;case'companies':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x21');break;case'globalcustomfields':_0x3d0b28[_0xd3a6('0x15')]='CmCustomField';break;case _0xd3a6('0x22'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x23');break;case _0xd3a6('0x24'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x25');break;case _0xd3a6('0x26'):_0x3d0b28['childModel']='FaxQueue';break;case _0xd3a6('0x27'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x28');break;case'inboundroutes':case _0xd3a6('0x29'):case _0xd3a6('0x2a'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x2b');break;case _0xd3a6('0x2c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x2d');break;case _0xd3a6('0x2e'):_0x3d0b28['childModel']=_0xd3a6('0x2f');break;case _0xd3a6('0x30'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x31');_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x32'),'field':'name','foreignKey':_0xd3a6('0x33'),'model':'User','filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x35')]}},{'name':_0xd3a6('0x36'),'field':_0xd3a6('0xe'),'foreignKey':'membername','model':'User','filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x37')]}},{'name':_0xd3a6('0x38'),'field':'name','foreignKey':_0xd3a6('0x39'),'model':_0xd3a6('0x3a'),'filter':{'field':'type','value':[_0xd3a6('0x3b')]}},{'name':'QueueCampaigns','field':_0xd3a6('0xe'),'foreignKey':_0xd3a6('0x39'),'model':'VoiceQueue','filter':{'field':_0xd3a6('0x3c'),'value':['outbound']}}];break;case _0xd3a6('0x3d'):_0x3d0b28[_0xd3a6('0x15')]='VoiceMusicOnHold';break;case _0xd3a6('0x3e'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x3f');break;case _0xd3a6('0x40'):_0x3d0b28['childModel']=_0xd3a6('0x41');break;case _0xd3a6('0x42'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x43');break;case _0xd3a6('0x44'):_0x3d0b28['childModel']=_0xd3a6('0x45');break;case'mailaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x46');break;case _0xd3a6('0x47'):_0x3d0b28['childModel']=_0xd3a6('0x48');break;case'openchannelqueues':_0x3d0b28[_0xd3a6('0x15')]='OpenchannelQueue';break;case _0xd3a6('0x49'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x4a');break;case _0xd3a6('0x4b'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x4c');break;case _0xd3a6('0x4d'):_0x3d0b28['childModel']=_0xd3a6('0x4e');break;case _0xd3a6('0x4f'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x50');break;case'whatsappaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x51');break;case _0xd3a6('0x52'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x53');break;case _0xd3a6('0x54'):case _0xd3a6('0x55'):_0x3d0b28[_0xd3a6('0x15')]='VoiceQueue';if(_0x400982){_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x38')},{'name':_0xd3a6('0x56')}];}break;case _0xd3a6('0x57'):case _0xd3a6('0x58'):case'telephones':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x59');if(_0x400982){_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x5a'),'filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x5b'),_0xd3a6('0x5c')]},'ignore':!![]},{'name':_0xd3a6('0x32')},{'name':'Telephones'}];}break;case _0xd3a6('0x5d'):_0x3d0b28['childModel']=_0xd3a6('0x5e');break;case _0xd3a6('0x5f'):_0x3d0b28['childModel']=_0xd3a6('0x60');break;case _0xd3a6('0x61'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x62');break;case _0xd3a6('0x63'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x64');break;case _0xd3a6('0x65'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x66');break;case'zohoaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x67');break;case _0xd3a6('0x68'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x59');break;case _0xd3a6('0x69'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6a');break;case _0xd3a6('0x6b'):_0x3d0b28[_0xd3a6('0x15')]='Disposition';break;case _0xd3a6('0x6c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6d');break;case'intervals':_0x3d0b28[_0xd3a6('0x15')]='Interval';break;case'pauses':_0x3d0b28['childModel']='Pause';break;case _0xd3a6('0x6e'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6f');break;case _0xd3a6('0x70'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x71');break;case _0xd3a6('0x72'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x73');break;case _0xd3a6('0x74'):_0x3d0b28['childModel']='Template';break;case _0xd3a6('0x75'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x76');break;case _0xd3a6('0x77'):_0x3d0b28[_0xd3a6('0x15')]='Trunk';break;case _0xd3a6('0x78'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x79');break;case _0xd3a6('0x7a'):_0x3d0b28['childModel']='Plugin';break;case _0xd3a6('0x7b'):_0x3d0b28[_0xd3a6('0x15')]='AnalyticExtractedReport';_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x7c'),'field':'id','foreignKey':_0xd3a6('0x7d')}];break;case'metrics':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x7e');break;}return _0x3d0b28;}function _0x5dc8fd(_0x10b56f,_0x3c4fa9){var _0x5134fa=_0x10b56f['charAt'](0x0)[_0xd3a6('0x7f')]()+_0x10b56f[_0xd3a6('0x80')](0x1);var _0x4e02fb={'type':_0x37a8f2['Sequelize'][_0xd3a6('0x81')]['SELECT'],'raw':!![]};return new Promise(function(_0x3354cf,_0x3b5f26){var _0x5b1fc9=squel[_0xd3a6('0x82')]()['field']('ui.'+_0x5134fa+_0xd3a6('0x83'),'id')['field'](_0xd3a6('0x84'))[_0xd3a6('0x85')](_0xd3a6('0x86')+_0x10b56f+_0xd3a6('0x87'),'ui')[_0xd3a6('0x88')]('ui.UserId\x20=\x20?',_0x3c4fa9['id']);return _0x37a8f2[_0xd3a6('0x89')][_0xd3a6('0x8a')](_0x5b1fc9[_0xd3a6('0x8b')](),_0x4e02fb)[_0xd3a6('0x9')](function(_0x52a65e){_0x3c4fa9[_0x5134fa+_0xd3a6('0x8c')]=_0x52a65e;_0x3354cf(_0x52a65e);})[_0xd3a6('0xc')](function(_0x911ff0){_0x3b5f26(_0x911ff0);});});}return _0x31619a[_0xd3a6('0x8d')](_0xd3a6('0x8e'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x49cc6e){var _0x24115a={'raw':![],'where':{}};var _0x49bec2={};var _0xd2f49={'count':0x0,'rows':[]};var _0x2a1d67=_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0x8f')];var _0x3c6b26=_0x49cc6e['query']['mergeResources']||![];var _0x20e881=_0x5c9075(_0x2a1d67,_0x3c6b26);if(!_0x20e881['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x2a1d67+'\x27');var _0xf8b715=[{'name':_0x2a1d67}];if(!_[_0xd3a6('0x90')](_0x20e881[_0xd3a6('0x18')]))_0xf8b715=_0x20e881[_0xd3a6('0x18')];var _0x3818fd=[];for(var _0x3f79cd=0x0;_0x3f79cd<_0xf8b715['length'];_0x3f79cd++){_0x3818fd[_0xd3a6('0x91')](_0x37a8f2[_0xd3a6('0x92')][_0xd3a6('0x93')]({'where':{'userProfileId':_0x49cc6e['params']['id'],'name':_0xf8b715[_0x3f79cd][_0xd3a6('0xe')]},'raw':!![]}));}return Promise[_0xd3a6('0x94')](_0x3818fd)['then'](function(_0x224b20){var _0x5a7749=_[_0xd3a6('0x5')](_0x224b20,function(_0x2c3b55){return _0x2c3b55?_0x2c3b55:undefined;});var _0x26748e=_['filter'](_0xf8b715,[_0xd3a6('0x95'),!![]]);var _0x4c1204=_[_0xd3a6('0x90')](_0x5a7749)&&_[_0xd3a6('0x90')](_0x26748e)?null:_[_0xd3a6('0x96')](_0x26748e,_0x5a7749);if(!_0x4c1204)return null;var _0x5287f0=[];for(var _0x17cb54=0x0;_0x17cb54<_0x4c1204[_0xd3a6('0x97')];_0x17cb54++){var _0x532b07=_[_0xd3a6('0x93')](_0xf8b715,function(_0x25c2f8){return _0x4c1204[_0x17cb54]?_0x25c2f8[_0xd3a6('0xe')]===_0x4c1204[_0x17cb54][_0xd3a6('0xe')]:null;});if(_0x532b07){if(_0x4c1204[_0x17cb54][_0xd3a6('0x95')]){_0x5287f0[_0xd3a6('0x91')](_0x585473(_0x20e881['childModel'],_0x4c1204[_0x17cb54]));}else{if(!_0x4c1204[_0x17cb54]['autoAssociation']){_0x5287f0[_0xd3a6('0x91')](_0x305b61(_0x532b07,_0x4c1204[_0x17cb54],_0x20e881[_0xd3a6('0x15')]));}else{if(_0x532b07[_0xd3a6('0xd')]){_0x5287f0[_0xd3a6('0x91')](_0x172513(_0x532b07,_0x4c1204[_0x17cb54]));}}}}}return Promise['all'](_0x5287f0);})[_0xd3a6('0x9')](function(_0x2a1495){var _0x377f28=_0x2a1495;var _0x477feb=null;if(_0x377f28){_0x477feb=_0x377f28['length']===0x1?_0x377f28[0x0]:null;}if(!_0x477feb&&!_0x377f28)return _0xd2f49;var _0x30815f=_0x37a8f2[_0x20e881['childModel']][_0xd3a6('0x98')];_0x49bec2[_0xd3a6('0xd')]=_[_0xd3a6('0x99')](_0x30815f);_0x49bec2[_0xd3a6('0x8a')]=_[_0xd3a6('0x99')](_0x49cc6e[_0xd3a6('0x8a')]);_0x49bec2[_0xd3a6('0x9a')]=_[_0xd3a6('0x9b')](_0x49bec2[_0xd3a6('0xd')],_0x49bec2[_0xd3a6('0x8a')]);_0x24115a[_0xd3a6('0x9c')]=_[_0xd3a6('0x9b')](_0x49bec2['model'],qs[_0xd3a6('0x9d')](_0x49cc6e['query'][_0xd3a6('0x9d')]));_0x24115a[_0xd3a6('0x9c')]=_0x24115a[_0xd3a6('0x9c')]['length']?_0x24115a[_0xd3a6('0x9c')]:_0x49bec2[_0xd3a6('0xd')];if(!_0x49cc6e['query'][_0xd3a6('0x9e')](_0xd3a6('0x9f'))){_0x24115a[_0xd3a6('0xa0')]=qs[_0xd3a6('0xa0')](_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xa0')]);_0x24115a[_0xd3a6('0xa1')]=qs[_0xd3a6('0xa1')](_0x49cc6e['query'][_0xd3a6('0xa1')]);}_0x24115a[_0xd3a6('0xa2')]=qs[_0xd3a6('0xa3')](_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xa3')]);_0x24115a[_0xd3a6('0x88')]=qs[_0xd3a6('0x9a')](_[_0xd3a6('0xa4')](_0x49cc6e[_0xd3a6('0x8a')],_0x49bec2[_0xd3a6('0x9a')]));if(_0x49cc6e[_0xd3a6('0x8a')]['filter']){_0x24115a[_0xd3a6('0x88')]=_['merge'](_0x24115a[_0xd3a6('0x88')],{'$or':_[_0xd3a6('0xb')](_0x30815f,function(_0x5e9dda){if(_0x5e9dda[_0xd3a6('0x3c')][_0xd3a6('0xa5')]!==_0xd3a6('0xa6')){var _0x13beb2={};_0x13beb2[_0x5e9dda[_0xd3a6('0x6')]]={'$like':'%'+_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0x5')]+'%'};return _0x13beb2;}})});}var _0x2bed51=[];var _0xa62210=null;var _0xf95987={};if(_0x477feb){_0xa62210=_[_0xd3a6('0x93')](_0xf8b715,['name',_0x477feb[_0xd3a6('0xe')]]);if(_0xa62210[_0xd3a6('0x6')]){_0xf95987={};if(_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x10')){_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_[_0xd3a6('0xb')](_0x477feb['associatedResources'],'id');}else{_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_0x477feb[_0xd3a6('0xa')];}_0x2bed51['push'](_0xf95987);}else{_0x24115a[_0xd3a6('0x88')]['id']=_0x477feb['associatedResources'];}}else{for(var _0x310a4f=0x0;_0x310a4f<_0x377f28[_0xd3a6('0x97')];_0x310a4f++){_0xa62210=_['find'](_0xf8b715,[_0xd3a6('0xe'),_0x377f28[_0x310a4f][_0xd3a6('0xe')]]);if(_0xa62210[_0xd3a6('0x6')]){_0xf95987={};_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_0x377f28[_0x310a4f]['associatedResources'];_0x2bed51['push'](_0xf95987);}else{if(!_0x24115a[_0xd3a6('0x88')]['id'])_0x24115a[_0xd3a6('0x88')]['id']=[];_0x377f28[_0x310a4f][_0xd3a6('0xa')][_0xd3a6('0xa8')](function(_0x154fb1){_0x24115a['where']['id'][_0xd3a6('0x91')](_0x154fb1);});}}}if(!_[_0xd3a6('0x90')](_0x2bed51)){_0x24115a[_0xd3a6('0x88')]=_[_0xd3a6('0xa9')](_0x24115a[_0xd3a6('0x88')],{'$and':{'$or':_0x2bed51}});}_0x24115a=_[_0xd3a6('0xa9')]({},_0x24115a,_0x49cc6e[_0xd3a6('0xaa')]);if(_0x477feb&&!_0x477feb[_0xd3a6('0xab')]&&_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x10')){if(_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xac')]){_0x24115a['include']=[{'all':!![]}];}return _0x37a8f2[_0x20e881['childModel']]['findAll'](_0x24115a)[_0xd3a6('0x9')](function(_0x18ba56){var _0x58bf33=[];_0x18ba56[_0xd3a6('0xa8')](function(_0x29126f){var _0x339f68;switch(_0x29126f['reportType']){case _0xd3a6('0xad'):_0x339f68=_[_0xd3a6('0x93')](_0x477feb[_0xd3a6('0xa')],function(_0x2b39cb){return _0x2b39cb['id']===_0x29126f['reportId']&&_0x2b39cb['type']===_0xd3a6('0xae');});break;case _0xd3a6('0xaf'):_0x339f68=_[_0xd3a6('0x93')](_0x477feb['associatedResources'],function(_0x4d95f5){return _0x4d95f5['id']===_0x29126f[_0xd3a6('0x7d')]&&_0x4d95f5[_0xd3a6('0x3c')]===_0xd3a6('0xb0');});break;}if(_0x339f68)_0x58bf33['push'](_0x29126f);});_0xd2f49[_0xd3a6('0xb1')]=_0x58bf33[_0xd3a6('0x97')];_0xd2f49['rows']=_0x58bf33;return _0xd2f49;});}else{return _0x37a8f2[_0x20e881[_0xd3a6('0x15')]]['count']({'where':_0x24115a[_0xd3a6('0x88')]})[_0xd3a6('0x9')](function(_0x3834ba){_0xd2f49[_0xd3a6('0xb1')]=_0x3834ba;if(_0x49cc6e['query']['includeAll']){if(_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x1d')){_0x24115a[_0xd3a6('0xb2')]=[{'model':_0x37a8f2['Tag'],'as':'Tags','attributes':['id',_0xd3a6('0xe'),'color'],'required':_0x49cc6e[_0xd3a6('0x8a')]['tag']?!![]:![]},{'model':_0x37a8f2[_0xd3a6('0x73')],'as':_0xd3a6('0xb3'),'attributes':['id',_0xd3a6('0xe'),_0xd3a6('0xb4')],'through':_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xb5')]?{'attributes':[],'where':{'TagId':_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xb5')]||undefined}}:{},'required':_0x49cc6e[_0xd3a6('0x8a')]['tag']?!![]:![]}];}else{_0x24115a['include']=[{'all':!![]}];}}return _0x37a8f2[_0x20e881['childModel']][_0xd3a6('0x8')](_0x24115a);})[_0xd3a6('0x9')](function(_0x31a6fb){_0xd2f49[_0xd3a6('0xb6')]=_0x31a6fb;if(_0x2a1d67===_0xd3a6('0x32')&&_0x49cc6e[_0xd3a6('0x8a')]['openTabs']===_0xd3a6('0xb7')){var _0x339674=[];for(var _0x4e643b=0x0;_0x4e643b<_0xd2f49[_0xd3a6('0xb6')][_0xd3a6('0x97')];_0x4e643b++){_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xb8'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xba'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd(_0xd3a6('0xbb'),_0xd2f49['rows'][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd('mail',_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd(_0xd3a6('0xbc'),_0xd2f49['rows'][_0x4e643b][_0xd3a6('0xb9')]));_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xbd'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b]['dataValues']));}return Promise[_0xd3a6('0x94')](_0x339674)[_0xd3a6('0x9')](function(){return _0xd2f49;});}return _0xd2f49;});}});}}});};
\ No newline at end of file
+var _0x4888=['offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tag','Tags','tag','ThroughTags','color','openTabs','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','findAll','then','associatedResources','map','catch','field','model','name','resolve','UserProfileResource','resourceId','type','odbc','squarerecordings','childModel','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','VoiceRecording','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','Dashboard','intervals','pauses','Pause','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','find','params','all','ignore','union','rawAttributes','filters','intersection','attributes','fields','hasOwnProperty','limit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4888,0x198));var _0x8488=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x4888[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var attributes=require(_0x8488('0x0'));var qs=require(_0x8488('0x1'));var squel=require(_0x8488('0x2'));module[_0x8488('0x3')]=function(_0x257275){var _0xacc8f0=_0x257275[_0x8488('0x4')];function _0x571e4b(_0x267093,_0xf45c3f){return new Promise(function(_0x1a97f4,_0x421292){if(!_0xf45c3f)return _0x1a97f4(null);var _0x326887=_0xf45c3f[_0x8488('0x5')]?{[_0xf45c3f['filter']['field']]:_0xf45c3f['filter']['value']}:undefined;return _0xacc8f0[_0x267093][_0x8488('0x6')]({'where':_0x326887,'raw':!![]})[_0x8488('0x7')](function(_0x542bd8){_0xf45c3f[_0x8488('0x8')]=_[_0x8488('0x9')](_0x542bd8,'id');_0x1a97f4(_0xf45c3f);})[_0x8488('0xa')](function(_0x19a2ee){_0x421292(_0x19a2ee);});});}function _0x515ea8(_0x377d3b,_0x1909c9){return new Promise(function(_0x468896,_0x256bab){var _0x47146a=_0x377d3b['filter']?{[_0x377d3b[_0x8488('0x5')][_0x8488('0xb')]]:_0x377d3b['filter']['value']}:undefined;return _0xacc8f0[_0x377d3b[_0x8488('0xc')]]['findAll']({'where':_0x47146a,'raw':!![]})[_0x8488('0x7')](function(_0x4e94fc){_0x1909c9['associatedResources']=_[_0x8488('0x9')](_0x4e94fc,function(_0x3635da){return _0x3635da[_0x8488('0xd')];});_0x468896(_0x1909c9);})[_0x8488('0xa')](function(_0x3b3cfa){_0x256bab(_0x3b3cfa);});});}function _0x8d3b3d(_0x165139,_0x4e44af,_0x3dad45){if(!_0x4e44af)return Promise[_0x8488('0xe')](null);return new Promise(function(_0x3edfe4,_0x37361d){return _0xacc8f0[_0x8488('0xf')][_0x8488('0x6')]({'where':{'sectionId':_0x4e44af['id']},'raw':!![]})[_0x8488('0x7')](function(_0x27c62a){if(_0x165139[_0x8488('0xb')]&&_0x165139[_0x8488('0xb')]!=='id'){_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0x3dd93e){return _0x3dd93e[_0x165139['field']];});}else{if(_0x3dad45==='AnalyticExtractedReport'){_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0xbb10fe){return{'id':_0xbb10fe[_0x8488('0x10')],'type':_0xbb10fe[_0x8488('0x11')]};});}else{_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0x3c078c){return _0x3c078c[_0x8488('0x10')];});}}_0x3edfe4(_0x4e44af);})['catch'](function(_0x476a14){_0x37361d(_0x476a14);});});}function _0x4e07e1(_0x140b0b,_0x1361a6){var _0x290b33={'parentSections':[]};switch(_0x140b0b['toLowerCase']()){case'squareprojects':_0x290b33['childModel']='SquareProject';break;case _0x8488('0x12'):_0x290b33['childModel']='SquareOdbc';break;case _0x8488('0x13'):_0x290b33[_0x8488('0x14')]=_0x8488('0x15');_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x17'),'field':'name','foreignKey':_0x8488('0x18')}];break;case _0x8488('0x19'):_0x290b33[_0x8488('0x14')]=_0x8488('0x1a');break;case _0x8488('0x1b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x1c');_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x1d'),'field':'id','foreignKey':_0x8488('0x1e')}];break;case _0x8488('0x1f'):_0x290b33['childModel']='CmList';break;case'companies':_0x290b33[_0x8488('0x14')]=_0x8488('0x20');break;case _0x8488('0x21'):_0x290b33[_0x8488('0x14')]=_0x8488('0x22');break;case _0x8488('0x23'):_0x290b33['childModel']=_0x8488('0x24');break;case _0x8488('0x25'):_0x290b33[_0x8488('0x14')]=_0x8488('0x26');break;case _0x8488('0x27'):_0x290b33['childModel']=_0x8488('0x28');break;case _0x8488('0x29'):_0x290b33['childModel']=_0x8488('0x2a');break;case _0x8488('0x2b'):case _0x8488('0x2c'):case _0x8488('0x2d'):_0x290b33[_0x8488('0x14')]='VoiceExtension';break;case _0x8488('0x2e'):_0x290b33[_0x8488('0x14')]=_0x8488('0x2f');break;case'voicemails':_0x290b33[_0x8488('0x14')]='VoiceMail';break;case _0x8488('0x30'):_0x290b33[_0x8488('0x14')]=_0x8488('0x31');_0x290b33[_0x8488('0x16')]=[{'name':'Agents','field':_0x8488('0xd'),'foreignKey':_0x8488('0x32'),'model':_0x8488('0x33'),'filter':{'field':'role','value':[_0x8488('0x34')]}},{'name':_0x8488('0x35'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x32'),'model':_0x8488('0x33'),'filter':{'field':_0x8488('0x36'),'value':[_0x8488('0x37')]}},{'name':_0x8488('0x38'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x39'),'model':_0x8488('0x3a'),'filter':{'field':'type','value':['inbound']}},{'name':_0x8488('0x3b'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x39'),'model':_0x8488('0x3a'),'filter':{'field':_0x8488('0x11'),'value':[_0x8488('0x3c')]}}];break;case _0x8488('0x3d'):_0x290b33[_0x8488('0x14')]=_0x8488('0x3e');break;case'chanspies':_0x290b33[_0x8488('0x14')]=_0x8488('0x3f');break;case _0x8488('0x40'):_0x290b33['childModel']=_0x8488('0x41');break;case _0x8488('0x42'):_0x290b33[_0x8488('0x14')]=_0x8488('0x43');break;case _0x8488('0x44'):_0x290b33[_0x8488('0x14')]=_0x8488('0x45');break;case'mailaccounts':_0x290b33[_0x8488('0x14')]=_0x8488('0x46');break;case _0x8488('0x47'):_0x290b33['childModel']=_0x8488('0x48');break;case'openchannelqueues':_0x290b33[_0x8488('0x14')]=_0x8488('0x49');break;case'openchannelaccounts':_0x290b33[_0x8488('0x14')]=_0x8488('0x4a');break;case _0x8488('0x4b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x4c');break;case'smsaccounts':_0x290b33[_0x8488('0x14')]='SmsAccount';break;case _0x8488('0x4d'):_0x290b33[_0x8488('0x14')]=_0x8488('0x4e');break;case _0x8488('0x4f'):_0x290b33[_0x8488('0x14')]=_0x8488('0x50');break;case _0x8488('0x51'):_0x290b33[_0x8488('0x14')]=_0x8488('0x52');break;case _0x8488('0x53'):case _0x8488('0x54'):_0x290b33[_0x8488('0x14')]=_0x8488('0x3a');if(_0x1361a6){_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x38')},{'name':_0x8488('0x3b')}];}break;case _0x8488('0x55'):case'agents':case _0x8488('0x56'):_0x290b33[_0x8488('0x14')]=_0x8488('0x33');if(_0x1361a6){_0x290b33[_0x8488('0x16')]=[{'name':'Users','filter':{'field':_0x8488('0x36'),'value':[_0x8488('0x57'),_0x8488('0x58')]},'ignore':!![]},{'name':_0x8488('0x59')},{'name':'Telephones'}];}break;case _0x8488('0x5a'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5b');break;case _0x8488('0x5c'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5d');break;case _0x8488('0x5e'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5f');break;case _0x8488('0x60'):_0x290b33[_0x8488('0x14')]=_0x8488('0x61');break;case _0x8488('0x62'):_0x290b33['childModel']='DeskAccount';break;case _0x8488('0x63'):_0x290b33[_0x8488('0x14')]=_0x8488('0x64');break;case _0x8488('0x65'):_0x290b33[_0x8488('0x14')]=_0x8488('0x33');break;case _0x8488('0x66'):_0x290b33[_0x8488('0x14')]=_0x8488('0x67');break;case'dispositions':_0x290b33[_0x8488('0x14')]=_0x8488('0x68');break;case'customdashboards':_0x290b33[_0x8488('0x14')]=_0x8488('0x69');break;case _0x8488('0x6a'):_0x290b33[_0x8488('0x14')]='Interval';break;case _0x8488('0x6b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x6c');break;case'scheduler':_0x290b33[_0x8488('0x14')]=_0x8488('0x6d');break;case _0x8488('0x6e'):_0x290b33[_0x8488('0x14')]='Sound';break;case _0x8488('0x6f'):_0x290b33['childModel']='Tag';break;case _0x8488('0x70'):_0x290b33['childModel']=_0x8488('0x71');break;case _0x8488('0x72'):_0x290b33[_0x8488('0x14')]=_0x8488('0x73');break;case _0x8488('0x74'):_0x290b33[_0x8488('0x14')]='Trunk';break;case _0x8488('0x75'):_0x290b33[_0x8488('0x14')]=_0x8488('0x76');break;case _0x8488('0x77'):_0x290b33[_0x8488('0x14')]='Plugin';break;case _0x8488('0x78'):_0x290b33['childModel']=_0x8488('0x79');_0x290b33[_0x8488('0x16')]=[{'name':'Reports','field':'id','foreignKey':_0x8488('0x7a')}];break;case _0x8488('0x7b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x7c');break;}return _0x290b33;}function _0x4041e5(_0x168740,_0x59d0d4){var _0xb3574c=_0x168740['charAt'](0x0)[_0x8488('0x7d')]()+_0x168740[_0x8488('0x7e')](0x1);var _0x3c06a4={'type':_0xacc8f0[_0x8488('0x7f')][_0x8488('0x80')][_0x8488('0x81')],'raw':!![]};return new Promise(function(_0x5a4426,_0x43ec52){var _0x4dba5a=squel[_0x8488('0x82')]()[_0x8488('0xb')](_0x8488('0x83')+_0xb3574c+_0x8488('0x84'),'id')[_0x8488('0xb')](_0x8488('0x85'))['from']('user_has_'+_0x168740+'_interactions','ui')[_0x8488('0x86')](_0x8488('0x87'),_0x59d0d4['id']);return _0xacc8f0[_0x8488('0x88')][_0x8488('0x89')](_0x4dba5a[_0x8488('0x8a')](),_0x3c06a4)[_0x8488('0x7')](function(_0x2377db){_0x59d0d4[_0xb3574c+_0x8488('0x8b')]=_0x2377db;_0x5a4426(_0x2377db);})[_0x8488('0xa')](function(_0xa90a65){_0x43ec52(_0xa90a65);});});}return _0x257275['define'](_0x8488('0x8c'),attributes,{'tableName':_0x8488('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b6bfe){var _0x4ba14e={'raw':![],'where':{}};var _0x4ae192={};var _0x164d30={'count':0x0,'rows':[]};var _0x379a4d=_0x3b6bfe[_0x8488('0x89')][_0x8488('0x8e')];var _0x52bc90=_0x3b6bfe['query'][_0x8488('0x8f')]||![];var _0x26e0cc=_0x4e07e1(_0x379a4d,_0x52bc90);if(!_0x26e0cc[_0x8488('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x379a4d+'\x27');var _0x3c3e89=[{'name':_0x379a4d}];if(!_[_0x8488('0x90')](_0x26e0cc[_0x8488('0x16')]))_0x3c3e89=_0x26e0cc[_0x8488('0x16')];var _0x332a9c=[];for(var _0x5e41e5=0x0;_0x5e41e5<_0x3c3e89[_0x8488('0x91')];_0x5e41e5++){_0x332a9c[_0x8488('0x92')](_0xacc8f0['UserProfileSection'][_0x8488('0x93')]({'where':{'userProfileId':_0x3b6bfe[_0x8488('0x94')]['id'],'name':_0x3c3e89[_0x5e41e5]['name']},'raw':!![]}));}return Promise[_0x8488('0x95')](_0x332a9c)[_0x8488('0x7')](function(_0x212c3b){var _0x1d8c83=_[_0x8488('0x5')](_0x212c3b,function(_0x105f23){return _0x105f23?_0x105f23:undefined;});var _0x163cd9=_['filter'](_0x3c3e89,[_0x8488('0x96'),!![]]);var _0x3b7aa8=_['isEmpty'](_0x1d8c83)&&_['isEmpty'](_0x163cd9)?null:_[_0x8488('0x97')](_0x163cd9,_0x1d8c83);if(!_0x3b7aa8)return null;var _0x370a9c=[];for(var _0x3ff6c0=0x0;_0x3ff6c0<_0x3b7aa8['length'];_0x3ff6c0++){var _0xb85159=_[_0x8488('0x93')](_0x3c3e89,function(_0x56b35a){return _0x3b7aa8[_0x3ff6c0]?_0x56b35a[_0x8488('0xd')]===_0x3b7aa8[_0x3ff6c0]['name']:null;});if(_0xb85159){if(_0x3b7aa8[_0x3ff6c0][_0x8488('0x96')]){_0x370a9c[_0x8488('0x92')](_0x571e4b(_0x26e0cc[_0x8488('0x14')],_0x3b7aa8[_0x3ff6c0]));}else{if(!_0x3b7aa8[_0x3ff6c0]['autoAssociation']){_0x370a9c[_0x8488('0x92')](_0x8d3b3d(_0xb85159,_0x3b7aa8[_0x3ff6c0],_0x26e0cc[_0x8488('0x14')]));}else{if(_0xb85159['model']){_0x370a9c['push'](_0x515ea8(_0xb85159,_0x3b7aa8[_0x3ff6c0]));}}}}}return Promise[_0x8488('0x95')](_0x370a9c);})[_0x8488('0x7')](function(_0xfedfd2){var _0x3ab1b6=_0xfedfd2;var _0xe1fe21=null;if(_0x3ab1b6){_0xe1fe21=_0x3ab1b6[_0x8488('0x91')]===0x1?_0x3ab1b6[0x0]:null;}if(!_0xe1fe21&&!_0x3ab1b6)return _0x164d30;var _0x20d7c3=_0xacc8f0[_0x26e0cc[_0x8488('0x14')]][_0x8488('0x98')];_0x4ae192[_0x8488('0xc')]=_['keys'](_0x20d7c3);_0x4ae192[_0x8488('0x89')]=_['keys'](_0x3b6bfe[_0x8488('0x89')]);_0x4ae192[_0x8488('0x99')]=_[_0x8488('0x9a')](_0x4ae192[_0x8488('0xc')],_0x4ae192['query']);_0x4ba14e[_0x8488('0x9b')]=_[_0x8488('0x9a')](_0x4ae192['model'],qs[_0x8488('0x9c')](_0x3b6bfe['query'][_0x8488('0x9c')]));_0x4ba14e[_0x8488('0x9b')]=_0x4ba14e[_0x8488('0x9b')][_0x8488('0x91')]?_0x4ba14e[_0x8488('0x9b')]:_0x4ae192[_0x8488('0xc')];if(!_0x3b6bfe[_0x8488('0x89')][_0x8488('0x9d')]('nolimit')){_0x4ba14e[_0x8488('0x9e')]=qs['limit'](_0x3b6bfe['query'][_0x8488('0x9e')]);_0x4ba14e[_0x8488('0x9f')]=qs[_0x8488('0x9f')](_0x3b6bfe['query']['offset']);}_0x4ba14e[_0x8488('0xa0')]=qs[_0x8488('0xa1')](_0x3b6bfe['query'][_0x8488('0xa1')]);_0x4ba14e[_0x8488('0x86')]=qs[_0x8488('0x99')](_[_0x8488('0xa2')](_0x3b6bfe[_0x8488('0x89')],_0x4ae192[_0x8488('0x99')]));if(_0x3b6bfe['query'][_0x8488('0x5')]){_0x4ba14e[_0x8488('0x86')]=_[_0x8488('0xa3')](_0x4ba14e['where'],{'$or':_[_0x8488('0x9')](_0x20d7c3,function(_0x2b5ea4){if(_0x2b5ea4[_0x8488('0x11')]['key']!==_0x8488('0xa4')){var _0xaf7f76={};_0xaf7f76[_0x2b5ea4['field']]={'$like':'%'+_0x3b6bfe['query'][_0x8488('0x5')]+'%'};return _0xaf7f76;}})});}var _0x18c724=[];var _0x511143=null;var _0x353514={};if(_0xe1fe21){_0x511143=_[_0x8488('0x93')](_0x3c3e89,['name',_0xe1fe21['name']]);if(_0x511143[_0x8488('0xb')]){_0x353514={};if(_0x26e0cc['childModel']===_0x8488('0x79')){_0x353514[_0x511143[_0x8488('0xa5')]]=_[_0x8488('0x9')](_0xe1fe21[_0x8488('0x8')],'id');}else{_0x353514[_0x511143['foreignKey']]=_0xe1fe21[_0x8488('0x8')];}_0x18c724['push'](_0x353514);}else{_0x4ba14e[_0x8488('0x86')]['id']=_0xe1fe21['associatedResources'];}}else{for(var _0x2f137a=0x0;_0x2f137a<_0x3ab1b6[_0x8488('0x91')];_0x2f137a++){_0x511143=_[_0x8488('0x93')](_0x3c3e89,[_0x8488('0xd'),_0x3ab1b6[_0x2f137a][_0x8488('0xd')]]);if(_0x511143[_0x8488('0xb')]){_0x353514={};_0x353514[_0x511143[_0x8488('0xa5')]]=_0x3ab1b6[_0x2f137a][_0x8488('0x8')];_0x18c724[_0x8488('0x92')](_0x353514);}else{if(!_0x4ba14e[_0x8488('0x86')]['id'])_0x4ba14e[_0x8488('0x86')]['id']=[];_0x3ab1b6[_0x2f137a][_0x8488('0x8')][_0x8488('0xa6')](function(_0x3b22ad){_0x4ba14e['where']['id'][_0x8488('0x92')](_0x3b22ad);});}}}if(!_[_0x8488('0x90')](_0x18c724)){_0x4ba14e['where']=_[_0x8488('0xa3')](_0x4ba14e[_0x8488('0x86')],{'$and':{'$or':_0x18c724}});}_0x4ba14e=_[_0x8488('0xa3')]({},_0x4ba14e,_0x3b6bfe[_0x8488('0xa7')]);if(_0xe1fe21&&!_0xe1fe21[_0x8488('0xa8')]&&_0x26e0cc[_0x8488('0x14')]===_0x8488('0x79')){if(_0x3b6bfe[_0x8488('0x89')][_0x8488('0xa9')]){_0x4ba14e[_0x8488('0xaa')]=[{'all':!![]}];}return _0xacc8f0[_0x26e0cc[_0x8488('0x14')]]['findAll'](_0x4ba14e)[_0x8488('0x7')](function(_0x1abac4){var _0x51814e=[];_0x1abac4[_0x8488('0xa6')](function(_0x7426b2){var _0x76c3c;switch(_0x7426b2[_0x8488('0xab')]){case _0x8488('0xac'):_0x76c3c=_['find'](_0xe1fe21['associatedResources'],function(_0x31138c){return _0x31138c['id']===_0x7426b2[_0x8488('0x7a')]&&_0x31138c[_0x8488('0x11')]===_0x8488('0xad');});break;case _0x8488('0xae'):_0x76c3c=_[_0x8488('0x93')](_0xe1fe21[_0x8488('0x8')],function(_0x283824){return _0x283824['id']===_0x7426b2[_0x8488('0x7a')]&&_0x283824[_0x8488('0x11')]===_0x8488('0xaf');});break;}if(_0x76c3c)_0x51814e[_0x8488('0x92')](_0x7426b2);});_0x164d30[_0x8488('0xb0')]=_0x51814e[_0x8488('0x91')];_0x164d30[_0x8488('0xb1')]=_0x51814e;return _0x164d30;});}else{return _0xacc8f0[_0x26e0cc['childModel']][_0x8488('0xb0')]({'where':_0x4ba14e['where']})['then'](function(_0x1e25a3){_0x164d30[_0x8488('0xb0')]=_0x1e25a3;if(_0x3b6bfe[_0x8488('0x89')][_0x8488('0xa9')]){if(_0x26e0cc[_0x8488('0x14')]===_0x8488('0x1c')){_0x4ba14e[_0x8488('0xaa')]=[{'model':_0xacc8f0[_0x8488('0xb2')],'as':_0x8488('0xb3'),'attributes':['id',_0x8488('0xd'),'color'],'required':_0x3b6bfe[_0x8488('0x89')][_0x8488('0xb4')]?!![]:![]},{'model':_0xacc8f0[_0x8488('0xb2')],'as':_0x8488('0xb5'),'attributes':['id',_0x8488('0xd'),_0x8488('0xb6')],'through':_0x3b6bfe['query'][_0x8488('0xb4')]?{'attributes':[],'where':{'TagId':_0x3b6bfe['query'][_0x8488('0xb4')]||undefined}}:{},'required':_0x3b6bfe[_0x8488('0x89')]['tag']?!![]:![]}];}else{_0x4ba14e['include']=[{'all':!![]}];}}return _0xacc8f0[_0x26e0cc[_0x8488('0x14')]][_0x8488('0x6')](_0x4ba14e);})[_0x8488('0x7')](function(_0x30b124){_0x164d30[_0x8488('0xb1')]=_0x30b124;if(_0x379a4d==='Agents'&&_0x3b6bfe[_0x8488('0x89')][_0x8488('0xb7')]==='true'){var _0x52c750=[];for(var _0x41491a=0x0;_0x41491a<_0x164d30[_0x8488('0xb1')][_0x8488('0x91')];_0x41491a++){_0x52c750['push'](_0x4041e5('chat',_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5('sms',_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xb9'),_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xba'),_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xbb'),_0x164d30[_0x8488('0xb1')][_0x41491a]['dataValues']));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xbc'),_0x164d30[_0x8488('0xb1')][_0x41491a]['dataValues']));}return Promise[_0x8488('0x95')](_0x52c750)['then'](function(){return _0x164d30;});}return _0x164d30;});}});}}});};
\ No newline at end of file
index 8c785d9..afac247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7be=['then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request'];(function(_0x4acfd2,_0x5b9374){var _0x12afbe=function(_0x5bc178){while(--_0x5bc178){_0x4acfd2['push'](_0x4acfd2['shift']());}};_0x12afbe(++_0x5b9374);}(_0xa7be,0xfd));var _0xea7b=function(_0x15100d,_0xe65cd7){_0x15100d=_0x15100d-0x0;var _0x2d0c36=_0xa7be[_0x15100d];return _0x2d0c36;};'use strict';var _=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var moment=require(_0xea7b('0x2'));var BPromise=require(_0xea7b('0x3'));var rs=require(_0xea7b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xea7b('0x5'));var logger=require(_0xea7b('0x6'))(_0xea7b('0x7'));var config=require('../../config/environment');var jayson=require(_0xea7b('0x8'));var client=jayson[_0xea7b('0x9')][_0xea7b('0xa')]({'port':0x232a});config[_0xea7b('0xb')]=_[_0xea7b('0xc')](config[_0xea7b('0xb')],{'host':_0xea7b('0xd'),'port':0x18eb});var socket=require(_0xea7b('0xe'))(new Redis(config[_0xea7b('0xb')]));require(_0xea7b('0xf'))['register'](socket);function respondWithRpcPromise(_0x413c1b,_0x13bdcf,_0x37e035){return new BPromise(function(_0x3675a9,_0x4de636){return client[_0xea7b('0x10')](_0x413c1b,_0x37e035)[_0xea7b('0x11')](function(_0x4a5b29){logger[_0xea7b('0x12')](_0xea7b('0x13'),_0x13bdcf,_0xea7b('0x14'));logger[_0xea7b('0x15')](_0xea7b('0x16'),_0x13bdcf,_0xea7b('0x14'),JSON[_0xea7b('0x17')](_0x4a5b29));if(_0x4a5b29[_0xea7b('0x18')]){if(_0x4a5b29['error']['code']===0x1f4){logger[_0xea7b('0x18')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0x4a5b29[_0xea7b('0x18')][_0xea7b('0x19')]);return _0x4de636(_0x4a5b29['error']['message']);}logger[_0xea7b('0x18')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0x4a5b29[_0xea7b('0x18')][_0xea7b('0x19')]);return _0x3675a9(_0x4a5b29[_0xea7b('0x18')][_0xea7b('0x19')]);}else{logger[_0xea7b('0x12')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0xea7b('0x14'));_0x3675a9(_0x4a5b29[_0xea7b('0x1a')][_0xea7b('0x19')]);}})['catch'](function(_0x1d7c67){logger[_0xea7b('0x18')]('UserProfile,\x20%s,\x20%s',_0x13bdcf,_0x1d7c67);_0x4de636(_0x1d7c67);});});}
\ No newline at end of file
+var _0x66c7=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4a1814,_0x2a4abf){var _0x4fcdba=function(_0xc71171){while(--_0xc71171){_0x4a1814['push'](_0x4a1814['shift']());}};_0x4fcdba(++_0x2a4abf);}(_0x66c7,0x15c));var _0x766c=function(_0x54a82e,_0xd1126f){_0x54a82e=_0x54a82e-0x0;var _0x45f163=_0x66c7[_0x54a82e];return _0x45f163;};'use strict';var _=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var moment=require(_0x766c('0x2'));var BPromise=require('bluebird');var rs=require(_0x766c('0x3'));var fs=require('fs');var Redis=require(_0x766c('0x4'));var db=require(_0x766c('0x5'))['db'];var utils=require(_0x766c('0x6'));var logger=require(_0x766c('0x7'))(_0x766c('0x8'));var config=require('../../config/environment');var jayson=require(_0x766c('0x9'));var client=jayson[_0x766c('0xa')][_0x766c('0xb')]({'port':0x232a});config[_0x766c('0xc')]=_[_0x766c('0xd')](config[_0x766c('0xc')],{'host':_0x766c('0xe'),'port':0x18eb});var socket=require(_0x766c('0xf'))(new Redis(config['redis']));require('./userProfile.socket')[_0x766c('0x10')](socket);function respondWithRpcPromise(_0xbd798b,_0x1d8ac1,_0x58cb58){return new BPromise(function(_0x1d360f,_0x4acfc1){return client[_0x766c('0x11')](_0xbd798b,_0x58cb58)[_0x766c('0x12')](function(_0x67d3b7){logger[_0x766c('0x13')](_0x766c('0x14'),_0x1d8ac1,_0x766c('0x15'));logger[_0x766c('0x16')](_0x766c('0x17'),_0x1d8ac1,_0x766c('0x15'),JSON[_0x766c('0x18')](_0x67d3b7));if(_0x67d3b7[_0x766c('0x19')]){if(_0x67d3b7[_0x766c('0x19')][_0x766c('0x1a')]===0x1f4){logger[_0x766c('0x19')](_0x766c('0x14'),_0x1d8ac1,_0x67d3b7['error']['message']);return _0x4acfc1(_0x67d3b7['error'][_0x766c('0x1b')]);}logger[_0x766c('0x19')](_0x766c('0x14'),_0x1d8ac1,_0x67d3b7[_0x766c('0x19')][_0x766c('0x1b')]);return _0x1d360f(_0x67d3b7[_0x766c('0x19')]['message']);}else{logger['info'](_0x766c('0x14'),_0x1d8ac1,_0x766c('0x15'));_0x1d360f(_0x67d3b7[_0x766c('0x1c')]['message']);}})[_0x766c('0x1d')](function(_0x328ffa){logger[_0x766c('0x19')]('UserProfile,\x20%s,\x20%s',_0x1d8ac1,_0x328ffa);_0x4acfc1(_0x328ffa);});});}
\ No newline at end of file
index 2282ec4..9bd1f44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4c1=['./userProfile.events','save','remove','update','emit','removeListener','userProfile:'];(function(_0x5a6069,_0x3c53f1){var _0x5d995b=function(_0x4d70c8){while(--_0x4d70c8){_0x5a6069['push'](_0x5a6069['shift']());}};_0x5d995b(++_0x3c53f1);}(_0xc4c1,0x1a4));var _0x1c4c=function(_0x1e5866,_0x437182){_0x1e5866=_0x1e5866-0x0;var _0x424cfa=_0xc4c1[_0x1e5866];return _0x424cfa;};'use strict';var UserProfileEvents=require(_0x1c4c('0x0'));var events=[_0x1c4c('0x1'),_0x1c4c('0x2'),_0x1c4c('0x3')];function createListener(_0x5906c1,_0x51f62c){return function(_0x5d58e6){_0x51f62c[_0x1c4c('0x4')](_0x5906c1,_0x5d58e6);};}function removeListener(_0x3d7de7,_0x4e6253){return function(){UserProfileEvents[_0x1c4c('0x5')](_0x3d7de7,_0x4e6253);};}exports['register']=function(_0xf5ec8c){for(var _0x3f3aad=0x0,_0x364529=events['length'];_0x3f3aad<_0x364529;_0x3f3aad++){var _0x1df76d=events[_0x3f3aad];var _0x49c34f=createListener(_0x1c4c('0x6')+_0x1df76d,_0xf5ec8c);UserProfileEvents['on'](_0x1df76d,_0x49c34f);}};
\ No newline at end of file
+var _0x2490=['./userProfile.events','remove','update','emit','removeListener','register','length'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x2490,0x1ab));var _0x0249=function(_0x5720d8,_0x2d8db4){_0x5720d8=_0x5720d8-0x0;var _0x375f7f=_0x2490[_0x5720d8];return _0x375f7f;};'use strict';var UserProfileEvents=require(_0x0249('0x0'));var events=['save',_0x0249('0x1'),_0x0249('0x2')];function createListener(_0x5a8eeb,_0x5d5b63){return function(_0x59e8fb){_0x5d5b63[_0x0249('0x3')](_0x5a8eeb,_0x59e8fb);};}function removeListener(_0x237c97,_0x2b031c){return function(){UserProfileEvents[_0x0249('0x4')](_0x237c97,_0x2b031c);};}exports[_0x0249('0x5')]=function(_0x22f64e){for(var _0x38748a=0x0,_0x1554e1=events[_0x0249('0x6')];_0x38748a<_0x1554e1;_0x38748a++){var _0x2bbf7a=events[_0x38748a];var _0x12cd8e=createListener('userProfile:'+_0x2bbf7a,_0x22f64e);UserProfileEvents['on'](_0x2bbf7a,_0x12cd8e);}};
\ No newline at end of file
index b5ef82a..b71c051 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008d=['index','/describe','/:id','show','post','create','put','update','delete','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x008d,0x195));var _0xd008=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x008d[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require(_0xd008('0x0'));var path=require(_0xd008('0x1'));var timeout=require('connect-timeout');var express=require(_0xd008('0x2'));var router=express['Router']();var fs_extra=require(_0xd008('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd008('0x4'));var config=require(_0xd008('0x5'));var controller=require(_0xd008('0x6'));router[_0xd008('0x7')]('/',auth[_0xd008('0x8')](),controller[_0xd008('0x9')]);router[_0xd008('0x7')](_0xd008('0xa'),auth[_0xd008('0x8')](),controller['describe']);router[_0xd008('0x7')](_0xd008('0xb'),auth[_0xd008('0x8')](),controller[_0xd008('0xc')]);router[_0xd008('0xd')]('/',auth[_0xd008('0x8')](),controller[_0xd008('0xe')]);router[_0xd008('0xf')](_0xd008('0xb'),auth['isAuthenticated'](),controller[_0xd008('0x10')]);router[_0xd008('0x11')](_0xd008('0xb'),auth[_0xd008('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x98a2=['create','update','/:id','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','post'];(function(_0x4527d8,_0x59e349){var _0x1ec91d=function(_0x1ec598){while(--_0x1ec598){_0x4527d8['push'](_0x4527d8['shift']());}};_0x1ec91d(++_0x59e349);}(_0x98a2,0xf5));var _0x298a=function(_0x229b0b,_0x27d6be){_0x229b0b=_0x229b0b-0x0;var _0xfadd52=_0x98a2[_0x229b0b];return _0xfadd52;};'use strict';var multer=require(_0x298a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x298a('0x1'));var express=require(_0x298a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x298a('0x3'));var interaction=require(_0x298a('0x4'));var config=require(_0x298a('0x5'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x298a('0x6')](),controller['index']);router[_0x298a('0x7')]('/describe',auth[_0x298a('0x6')](),controller[_0x298a('0x8')]);router['get']('/:id',auth[_0x298a('0x6')](),controller[_0x298a('0x9')]);router[_0x298a('0xa')]('/',auth[_0x298a('0x6')](),controller[_0x298a('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x298a('0xc')]);router['delete'](_0x298a('0xd'),auth[_0x298a('0x6')](),controller[_0x298a('0xe')]);module[_0x298a('0xf')]=router;
\ No newline at end of file
index 5b07c8d..2029d67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd07=['sequelize'];(function(_0x3791af,_0x2ff36c){var _0x18fda1=function(_0x8b9cea){while(--_0x8b9cea){_0x3791af['push'](_0x3791af['shift']());}};_0x18fda1(++_0x2ff36c);}(_0xbd07,0xe6));var _0x7bd0=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xbd07[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0x7bd0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x7af3=['exports','sequelize'];(function(_0x30a5ca,_0x4200cc){var _0x113c44=function(_0x103e2e){while(--_0x103e2e){_0x30a5ca['push'](_0x30a5ca['shift']());}};_0x113c44(++_0x4200cc);}(_0x7af3,0x19b));var _0x37af=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x7af3[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x37af('0x0'));module[_0x37af('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 66b0024..8becb4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x687b,0x14a));var _0xb687=function(_0x279229,_0x1d69d9){_0x279229=_0x279229-0x0;var _0x195ca7=_0x687b[_0x279229];return _0x195ca7;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));};
\ No newline at end of file
+var _0x1a37=['index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1a37[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));};
\ No newline at end of file
index a218d61..eddabf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9b8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','../../config/logger','api','moment'];(function(_0x361a72,_0x28fbf2){var _0x8e8463=function(_0x1947bd){while(--_0x1947bd){_0x361a72['push'](_0x361a72['shift']());}};_0x8e8463(++_0x28fbf2);}(_0xf9b8,0xbf));var _0x8f9b=function(_0x4dfc86,_0x2a5e5e){_0x4dfc86=_0x4dfc86-0x0;var _0xf9de10=_0xf9b8[_0x4dfc86];return _0xf9de10;};'use strict';var _=require(_0x8f9b('0x0'));var util=require('util');var logger=require(_0x8f9b('0x1'))(_0x8f9b('0x2'));var moment=require(_0x8f9b('0x3'));var BPromise=require(_0x8f9b('0x4'));var rp=require(_0x8f9b('0x5'));var fs=require('fs');var path=require(_0x8f9b('0x6'));var rimraf=require(_0x8f9b('0x7'));var config=require(_0x8f9b('0x8'));var attributes=require('./userProfileResource.attributes');module[_0x8f9b('0x9')]=function(_0x476f9d,_0x344492){return _0x476f9d[_0x8f9b('0xa')](_0x8f9b('0xb'),attributes,{'tableName':_0x8f9b('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x8f9b('0xd'),_0x8f9b('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdc5=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash'];(function(_0x22d1c5,_0x3a3182){var _0x188c2a=function(_0x4c9f56){while(--_0x4c9f56){_0x22d1c5['push'](_0x22d1c5['shift']());}};_0x188c2a(++_0x3a3182);}(_0xfdc5,0x133));var _0x5fdc=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xfdc5[_0x342700];return _0x53406f;};'use strict';var _=require(_0x5fdc('0x0'));var util=require(_0x5fdc('0x1'));var logger=require(_0x5fdc('0x2'))('api');var moment=require(_0x5fdc('0x3'));var BPromise=require(_0x5fdc('0x4'));var rp=require(_0x5fdc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fdc('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fdc('0x7'));module[_0x5fdc('0x8')]=function(_0x35d486,_0x3f2576){return _0x35d486[_0x5fdc('0x9')](_0x5fdc('0xa'),attributes,{'tableName':_0x5fdc('0xb'),'paranoid':![],'indexes':[{'name':_0x5fdc('0xc'),'fields':['resourceId',_0x5fdc('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index b00feb5..0c5118d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf82=['info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x4c41a4,_0x390850){var _0x6c6b11=function(_0x2ecd0c){while(--_0x2ecd0c){_0x4c41a4['push'](_0x4c41a4['shift']());}};_0x6c6b11(++_0x390850);}(_0xdf82,0x136));var _0x2df8=function(_0x487bc,_0x4ab308){_0x487bc=_0x487bc-0x0;var _0x5cf816=_0xdf82[_0x487bc];return _0x5cf816;};'use strict';var _=require(_0x2df8('0x0'));var util=require(_0x2df8('0x1'));var moment=require(_0x2df8('0x2'));var BPromise=require(_0x2df8('0x3'));var rs=require(_0x2df8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2df8('0x5'));var logger=require(_0x2df8('0x6'))(_0x2df8('0x7'));var config=require(_0x2df8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2df8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a8be4,_0x5645c6,_0x885b85){return new BPromise(function(_0x4d66c7,_0x137061){return client[_0x2df8('0xa')](_0x1a8be4,_0x885b85)[_0x2df8('0xb')](function(_0x3482ee){logger[_0x2df8('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x5645c6,_0x2df8('0xd'));logger[_0x2df8('0xe')](_0x2df8('0xf'),_0x5645c6,_0x2df8('0xd'),JSON[_0x2df8('0x10')](_0x3482ee));if(_0x3482ee[_0x2df8('0x11')]){if(_0x3482ee[_0x2df8('0x11')][_0x2df8('0x12')]===0x1f4){logger['error'](_0x2df8('0x13'),_0x5645c6,_0x3482ee[_0x2df8('0x11')][_0x2df8('0x14')]);return _0x137061(_0x3482ee['error']['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x5645c6,_0x3482ee[_0x2df8('0x11')][_0x2df8('0x14')]);return _0x4d66c7(_0x3482ee[_0x2df8('0x11')][_0x2df8('0x14')]);}else{logger[_0x2df8('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x5645c6,_0x2df8('0xd'));_0x4d66c7(_0x3482ee[_0x2df8('0x15')][_0x2df8('0x14')]);}})[_0x2df8('0x16')](function(_0xbfe443){logger[_0x2df8('0x11')](_0x2df8('0x13'),_0x5645c6,_0xbfe443);_0x137061(_0xbfe443);});});}
\ No newline at end of file
+var _0x844d=['http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d4158,_0x5bc6ac){var _0x4512f2=function(_0x40ed7a){while(--_0x40ed7a){_0x1d4158['push'](_0x1d4158['shift']());}};_0x4512f2(++_0x5bc6ac);}(_0x844d,0x1f0));var _0xd844=function(_0x367995,_0x129ae2){_0x367995=_0x367995-0x0;var _0x22daa8=_0x844d[_0x367995];return _0x22daa8;};'use strict';var _=require(_0xd844('0x0'));var util=require(_0xd844('0x1'));var moment=require(_0xd844('0x2'));var BPromise=require('bluebird');var rs=require(_0xd844('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd844('0x4'))['db'];var utils=require(_0xd844('0x5'));var logger=require(_0xd844('0x6'))(_0xd844('0x7'));var config=require(_0xd844('0x8'));var jayson=require(_0xd844('0x9'));var client=jayson['client'][_0xd844('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11dfe9,_0x163fa9,_0x4860ce){return new BPromise(function(_0x4570f7,_0x2f590c){return client[_0xd844('0xb')](_0x11dfe9,_0x4860ce)[_0xd844('0xc')](function(_0xbec99e){logger[_0xd844('0xd')](_0xd844('0xe'),_0x163fa9,_0xd844('0xf'));logger[_0xd844('0x10')](_0xd844('0x11'),_0x163fa9,_0xd844('0xf'),JSON[_0xd844('0x12')](_0xbec99e));if(_0xbec99e[_0xd844('0x13')]){if(_0xbec99e[_0xd844('0x13')][_0xd844('0x14')]===0x1f4){logger[_0xd844('0x13')](_0xd844('0xe'),_0x163fa9,_0xbec99e['error'][_0xd844('0x15')]);return _0x2f590c(_0xbec99e[_0xd844('0x13')]['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x163fa9,_0xbec99e['error']['message']);return _0x4570f7(_0xbec99e['error'][_0xd844('0x15')]);}else{logger[_0xd844('0xd')](_0xd844('0xe'),_0x163fa9,_0xd844('0xf'));_0x4570f7(_0xbec99e['result'][_0xd844('0x15')]);}})[_0xd844('0x16')](function(_0x395e91){logger['error'](_0xd844('0xe'),_0x163fa9,_0x395e91);_0x2f590c(_0x395e91);});});}
\ No newline at end of file
index c23bd93..0f65d11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b43=['get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x5b43,0x1ed));var _0x35b4=function(_0x1beb5c,_0x9891e5){_0x1beb5c=_0x1beb5c-0x0;var _0x5b2674=_0x5b43[_0x1beb5c];return _0x5b2674;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x35b4('0x0'));var timeout=require(_0x35b4('0x1'));var express=require(_0x35b4('0x2'));var router=express[_0x35b4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x35b4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x35b4('0x5'));var controller=require(_0x35b4('0x6'));router[_0x35b4('0x7')]('/',auth[_0x35b4('0x8')](),controller[_0x35b4('0x9')]);router[_0x35b4('0x7')](_0x35b4('0xa'),auth['isAuthenticated'](),controller[_0x35b4('0xb')]);router[_0x35b4('0x7')]('/:id',auth[_0x35b4('0x8')](),controller[_0x35b4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x35b4('0xd')]);router[_0x35b4('0xe')](_0x35b4('0xf'),auth['isAuthenticated'](),controller[_0x35b4('0x10')]);router[_0x35b4('0x11')](_0x35b4('0xf'),auth[_0x35b4('0x8')](),controller[_0x35b4('0x12')]);module[_0x35b4('0x13')]=router;
\ No newline at end of file
+var _0x02b6=['exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1ec65c,_0x354923){var _0x5249c2=function(_0x451341){while(--_0x451341){_0x1ec65c['push'](_0x1ec65c['shift']());}};_0x5249c2(++_0x354923);}(_0x02b6,0x191));var _0x602b=function(_0xdd49dd,_0x2e470b){_0xdd49dd=_0xdd49dd-0x0;var _0x580538=_0x02b6[_0xdd49dd];return _0x580538;};'use strict';var multer=require(_0x602b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x602b('0x1'));var express=require(_0x602b('0x2'));var router=express[_0x602b('0x3')]();var fs_extra=require(_0x602b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x602b('0x5'));var controller=require('./userProfileSection.controller');router[_0x602b('0x6')]('/',auth[_0x602b('0x7')](),controller[_0x602b('0x8')]);router[_0x602b('0x6')](_0x602b('0x9'),auth[_0x602b('0x7')](),controller[_0x602b('0xa')]);router[_0x602b('0x6')](_0x602b('0xb'),auth[_0x602b('0x7')](),controller[_0x602b('0xc')]);router[_0x602b('0xd')]('/',auth[_0x602b('0x7')](),controller[_0x602b('0xe')]);router[_0x602b('0xf')]('/:id',auth[_0x602b('0x7')](),controller[_0x602b('0x10')]);router[_0x602b('0x11')](_0x602b('0xb'),auth['isAuthenticated'](),controller[_0x602b('0x12')]);module[_0x602b('0x13')]=router;
\ No newline at end of file
index f94d9de..ddffd63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x282b=['setDataValue','crudPermissions','join','getDataValue','sequelize','exports','STRING','INTEGER'];(function(_0xa762e5,_0x1ca54f){var _0x132a2b=function(_0x4aad6a){while(--_0x4aad6a){_0xa762e5['push'](_0xa762e5['shift']());}};_0x132a2b(++_0x1ca54f);}(_0x282b,0xec));var _0xb282=function(_0x5c33ce,_0x2c64a3){_0x5c33ce=_0x5c33ce-0x0;var _0x48780d=_0x282b[_0x5c33ce];return _0x48780d;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xb282('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb282('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb282('0x2')],'set':function(_0x5cadd7){this[_0xb282('0x4')](_0xb282('0x5'),_0x5cadd7?_0x5cadd7[_0xb282('0x6')](''):[]);},'get':function(){return this[_0xb282('0x7')](_0xb282('0x5'))?this[_0xb282('0x7')]('crudPermissions')['split'](''):[];}}};
\ No newline at end of file
+var _0x4024=['crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','getDataValue'];(function(_0x4968d9,_0x447c98){var _0x780056=function(_0x7337f2){while(--_0x7337f2){_0x4968d9['push'](_0x4968d9['shift']());}};_0x780056(++_0x447c98);}(_0x4024,0x89));var _0x4402=function(_0x139c47,_0x48de2c){_0x139c47=_0x139c47-0x0;var _0x1e124b=_0x4024[_0x139c47];return _0x1e124b;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4402('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4402('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4402('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x950c82){this[_0x4402('0x5')]('crudPermissions',_0x950c82?_0x950c82['join'](''):[]);},'get':function(){return this[_0x4402('0x6')](_0x4402('0x7'))?this[_0x4402('0x6')]('crudPermissions')[_0x4402('0x8')](''):[];}}};
\ No newline at end of file
index 7f49f6f..a6fae58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc539=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','update','destroy','then','error','stack','name','send','map','UserProfileSection','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','create','body','catch','describe','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc539,0x150));var _0x9c53=function(_0x2f49de,_0x1327ab){_0x2f49de=_0x2f49de-0x0;var _0x1b0951=_0xc539[_0x2f49de];return _0x1b0951;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c53('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c53('0x1'));var moment=require(_0x9c53('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9c53('0x3'));var util=require(_0x9c53('0x4'));var path=require(_0x9c53('0x5'));var sox=require(_0x9c53('0x6'));var csv=require(_0x9c53('0x7'));var ejs=require(_0x9c53('0x8'));var fs=require('fs');var fs_extra=require(_0x9c53('0x9'));var _=require(_0x9c53('0xa'));var squel=require(_0x9c53('0xb'));var crypto=require(_0x9c53('0xc'));var jsforce=require(_0x9c53('0xd'));var deskjs=require(_0x9c53('0xe'));var toCsv=require(_0x9c53('0x7'));var querystring=require('querystring');var Papa=require(_0x9c53('0xf'));var Redis=require('ioredis');var authService=require(_0x9c53('0x10'));var qs=require(_0x9c53('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c53('0x12'));var logger=require(_0x9c53('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9c53('0x14'));var licenseUtil=require(_0x9c53('0x15'));var db=require(_0x9c53('0x16'))['db'];function respondWithStatusCode(_0x3def07,_0x536b8f){_0x536b8f=_0x536b8f||0xcc;return function(_0x40a079){if(_0x40a079){return _0x3def07[_0x9c53('0x17')](_0x536b8f);}return _0x3def07['status'](_0x536b8f)[_0x9c53('0x18')]();};}function respondWithResult(_0x7652cd,_0x22c56c){_0x22c56c=_0x22c56c||0xc8;return function(_0x3f4181){if(_0x3f4181){return _0x7652cd[_0x9c53('0x19')](_0x22c56c)['json'](_0x3f4181);}};}function respondWithFilteredResult(_0x2b4fd6,_0x12476e){return function(_0x1aa843){if(_0x1aa843){var _0x2fb725=typeof _0x12476e['offset']==='undefined'&&typeof _0x12476e['limit']==='undefined';var _0x1fa11f=_0x1aa843[_0x9c53('0x1a')];var _0x30f0f4=_0x2fb725?0x0:_0x12476e[_0x9c53('0x1b')];var _0xaa1679=_0x2fb725?_0x1aa843[_0x9c53('0x1a')]:_0x12476e[_0x9c53('0x1b')]+_0x12476e[_0x9c53('0x1c')];var _0x80e636;if(_0xaa1679>=_0x1fa11f){_0xaa1679=_0x1fa11f;_0x80e636=0xc8;}else{_0x80e636=0xce;}_0x2b4fd6[_0x9c53('0x19')](_0x80e636);return _0x2b4fd6[_0x9c53('0x1d')](_0x9c53('0x1e'),_0x30f0f4+'-'+_0xaa1679+'/'+_0x1fa11f)[_0x9c53('0x1f')](_0x1aa843);}return null;};}function patchUpdates(_0x4ed03e){return function(_0x3f486c){try{jsonpatch[_0x9c53('0x20')](_0x3f486c,_0x4ed03e,!![]);}catch(_0x3610d2){return BPromise['reject'](_0x3610d2);}return _0x3f486c['save']();};}function saveUpdates(_0x4fbef9,_0xf6af01){return function(_0x31ceb9){if(_0x31ceb9){return _0x31ceb9[_0x9c53('0x21')](_0x4fbef9)['then'](function(_0x2e759a){return _0x2e759a;});}return null;};}function removeEntity(_0x4816cb,_0x338ba5){return function(_0xe4830){if(_0xe4830){return _0xe4830[_0x9c53('0x22')]()[_0x9c53('0x23')](function(){_0x4816cb[_0x9c53('0x19')](0xcc)[_0x9c53('0x18')]();});}};}function handleEntityNotFound(_0x25cbb6,_0x8366aa){return function(_0x512683){if(!_0x512683){_0x25cbb6['sendStatus'](0x194);}return _0x512683;};}function handleError(_0x4bcfa5,_0x16a7c2){_0x16a7c2=_0x16a7c2||0x1f4;return function(_0x3fb83f){logger[_0x9c53('0x24')](_0x3fb83f[_0x9c53('0x25')]);if(_0x3fb83f[_0x9c53('0x26')]){delete _0x3fb83f['name'];}_0x4bcfa5[_0x9c53('0x19')](_0x16a7c2)[_0x9c53('0x27')](_0x3fb83f);};}exports['index']=function(_0x285ca2,_0x267970){var _0x671f65={},_0x3ca503={},_0x5740ca={'count':0x0,'rows':[]};var _0x5c66da=_[_0x9c53('0x28')](db[_0x9c53('0x29')]['rawAttributes'],function(_0x50203b){return{'name':_0x50203b[_0x9c53('0x2a')],'type':_0x50203b[_0x9c53('0x2b')][_0x9c53('0x2c')]};});_0x3ca503[_0x9c53('0x2d')]=_[_0x9c53('0x28')](_0x5c66da,'name');_0x3ca503[_0x9c53('0x2e')]=_['keys'](_0x285ca2[_0x9c53('0x2e')]);_0x3ca503[_0x9c53('0x2f')]=_[_0x9c53('0x30')](_0x3ca503['model'],_0x3ca503['query']);_0x671f65[_0x9c53('0x31')]=_['intersection'](_0x3ca503['model'],qs[_0x9c53('0x32')](_0x285ca2[_0x9c53('0x2e')][_0x9c53('0x32')]));_0x671f65['attributes']=_0x671f65[_0x9c53('0x31')]['length']?_0x671f65['attributes']:_0x3ca503[_0x9c53('0x2d')];if(!_0x285ca2['query']['hasOwnProperty'](_0x9c53('0x33'))){_0x671f65['limit']=qs[_0x9c53('0x1c')](_0x285ca2[_0x9c53('0x2e')][_0x9c53('0x1c')]);_0x671f65[_0x9c53('0x1b')]=qs[_0x9c53('0x1b')](_0x285ca2['query'][_0x9c53('0x1b')]);}_0x671f65[_0x9c53('0x34')]=qs['sort'](_0x285ca2[_0x9c53('0x2e')]['sort']);_0x671f65[_0x9c53('0x35')]=qs[_0x9c53('0x2f')](_['pick'](_0x285ca2[_0x9c53('0x2e')],_0x3ca503[_0x9c53('0x2f')]),_0x5c66da);if(_0x285ca2['query'][_0x9c53('0x36')]){_0x671f65[_0x9c53('0x35')]=_['merge'](_0x671f65[_0x9c53('0x35')],{'$or':_['map'](_0x5c66da,function(_0x33c5f1){if(_0x33c5f1[_0x9c53('0x2b')]!==_0x9c53('0x37')){var _0x22d27c={};_0x22d27c[_0x33c5f1['name']]={'$like':'%'+_0x285ca2[_0x9c53('0x2e')][_0x9c53('0x36')]+'%'};return _0x22d27c;}})});}_0x671f65=_[_0x9c53('0x38')]({},_0x671f65,_0x285ca2[_0x9c53('0x39')]);var _0x4571db={'where':_0x671f65[_0x9c53('0x35')]};return db[_0x9c53('0x29')][_0x9c53('0x1a')](_0x4571db)[_0x9c53('0x23')](function(_0x283259){_0x5740ca['count']=_0x283259;if(_0x285ca2[_0x9c53('0x2e')][_0x9c53('0x3a')]){_0x671f65['include']=[{'all':!![]}];}return db[_0x9c53('0x29')][_0x9c53('0x3b')](_0x671f65);})[_0x9c53('0x23')](function(_0x10f9b1){_0x5740ca[_0x9c53('0x3c')]=_0x10f9b1;return _0x5740ca;})[_0x9c53('0x23')](respondWithFilteredResult(_0x267970,_0x671f65))['catch'](handleError(_0x267970,null));};exports[_0x9c53('0x3d')]=function(_0xafd011,_0x52b8aa){var _0xca2800={'raw':![],'where':{'id':_0xafd011[_0x9c53('0x3e')]['id']}},_0x21f89c={};_0x21f89c[_0x9c53('0x2d')]=_[_0x9c53('0x3f')](db[_0x9c53('0x29')][_0x9c53('0x40')]);_0x21f89c[_0x9c53('0x2e')]=_[_0x9c53('0x3f')](_0xafd011[_0x9c53('0x2e')]);_0x21f89c[_0x9c53('0x2f')]=_[_0x9c53('0x30')](_0x21f89c[_0x9c53('0x2d')],_0x21f89c[_0x9c53('0x2e')]);_0xca2800[_0x9c53('0x31')]=_[_0x9c53('0x30')](_0x21f89c[_0x9c53('0x2d')],qs[_0x9c53('0x32')](_0xafd011['query']['fields']));_0xca2800['attributes']=_0xca2800[_0x9c53('0x31')]['length']?_0xca2800[_0x9c53('0x31')]:_0x21f89c[_0x9c53('0x2d')];if(_0xafd011['query'][_0x9c53('0x3a')]){_0xca2800[_0x9c53('0x41')]=[{'all':!![]}];}_0xca2800=_['merge']({},_0xca2800,_0xafd011[_0x9c53('0x39')]);return db[_0x9c53('0x29')][_0x9c53('0x42')](_0xca2800)['then'](handleEntityNotFound(_0x52b8aa,null))[_0x9c53('0x23')](respondWithResult(_0x52b8aa,null))['catch'](handleError(_0x52b8aa,null));};exports[_0x9c53('0x43')]=function(_0x1e3442,_0x4575c8){return db[_0x9c53('0x29')][_0x9c53('0x43')](_0x1e3442[_0x9c53('0x44')],{})[_0x9c53('0x23')](respondWithResult(_0x4575c8,0xc9))[_0x9c53('0x45')](handleError(_0x4575c8,null));};exports['update']=function(_0x211f68,_0x472d6e){if(_0x211f68[_0x9c53('0x44')]['id']){delete _0x211f68[_0x9c53('0x44')]['id'];}return db[_0x9c53('0x29')][_0x9c53('0x42')]({'where':{'id':_0x211f68[_0x9c53('0x3e')]['id']}})[_0x9c53('0x23')](handleEntityNotFound(_0x472d6e,null))[_0x9c53('0x23')](saveUpdates(_0x211f68[_0x9c53('0x44')],null))['then'](respondWithResult(_0x472d6e,null))[_0x9c53('0x45')](handleError(_0x472d6e,null));};exports[_0x9c53('0x22')]=function(_0x545ab7,_0x16bd58){return db[_0x9c53('0x29')][_0x9c53('0x42')]({'where':{'id':_0x545ab7[_0x9c53('0x3e')]['id']}})[_0x9c53('0x23')](handleEntityNotFound(_0x16bd58,null))[_0x9c53('0x23')](removeEntity(_0x16bd58,null))[_0x9c53('0x45')](handleError(_0x16bd58,null));};exports[_0x9c53('0x46')]=function(_0x60acb4,_0x1232d2){return db['UserProfileSection']['describe']()[_0x9c53('0x23')](respondWithResult(_0x1232d2,null))[_0x9c53('0x45')](handleError(_0x1232d2,null));};
\ No newline at end of file
+var _0x52c6=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','includeAll','rows','catch','show','length','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x52c6,0x120));var _0x652c=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x52c6[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0x652c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x652c('0x1'));var jsonpatch=require(_0x652c('0x2'));var rp=require(_0x652c('0x3'));var moment=require(_0x652c('0x4'));var BPromise=require(_0x652c('0x5'));var Mustache=require(_0x652c('0x6'));var util=require(_0x652c('0x7'));var path=require(_0x652c('0x8'));var sox=require(_0x652c('0x9'));var csv=require(_0x652c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x652c('0xb'));var squel=require(_0x652c('0xc'));var crypto=require(_0x652c('0xd'));var jsforce=require(_0x652c('0xe'));var deskjs=require(_0x652c('0xf'));var toCsv=require(_0x652c('0xa'));var querystring=require(_0x652c('0x10'));var Papa=require(_0x652c('0x11'));var Redis=require(_0x652c('0x12'));var authService=require(_0x652c('0x13'));var qs=require(_0x652c('0x14'));var as=require(_0x652c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x652c('0x16'))(_0x652c('0x17'));var utils=require(_0x652c('0x18'));var config=require(_0x652c('0x19'));var licenseUtil=require(_0x652c('0x1a'));var db=require(_0x652c('0x1b'))['db'];function respondWithStatusCode(_0x46679b,_0x3bfe50){_0x3bfe50=_0x3bfe50||0xcc;return function(_0x240678){if(_0x240678){return _0x46679b[_0x652c('0x1c')](_0x3bfe50);}return _0x46679b[_0x652c('0x1d')](_0x3bfe50)[_0x652c('0x1e')]();};}function respondWithResult(_0x2f4113,_0x3b9ab9){_0x3b9ab9=_0x3b9ab9||0xc8;return function(_0x48a8dc){if(_0x48a8dc){return _0x2f4113[_0x652c('0x1d')](_0x3b9ab9)[_0x652c('0x1f')](_0x48a8dc);}};}function respondWithFilteredResult(_0xb5d85a,_0x5deaeb){return function(_0x41d3b6){if(_0x41d3b6){var _0x2169cf=typeof _0x5deaeb['offset']===_0x652c('0x20')&&typeof _0x5deaeb[_0x652c('0x21')]===_0x652c('0x20');var _0x578dab=_0x41d3b6[_0x652c('0x22')];var _0x226102=_0x2169cf?0x0:_0x5deaeb['offset'];var _0x37382c=_0x2169cf?_0x41d3b6[_0x652c('0x22')]:_0x5deaeb[_0x652c('0x23')]+_0x5deaeb[_0x652c('0x21')];var _0x3e2314;if(_0x37382c>=_0x578dab){_0x37382c=_0x578dab;_0x3e2314=0xc8;}else{_0x3e2314=0xce;}_0xb5d85a['status'](_0x3e2314);return _0xb5d85a[_0x652c('0x24')](_0x652c('0x25'),_0x226102+'-'+_0x37382c+'/'+_0x578dab)['json'](_0x41d3b6);}return null;};}function patchUpdates(_0x436a4e){return function(_0x558137){try{jsonpatch[_0x652c('0x26')](_0x558137,_0x436a4e,!![]);}catch(_0x36505b){return BPromise['reject'](_0x36505b);}return _0x558137[_0x652c('0x27')]();};}function saveUpdates(_0x2d7e83,_0x4d4f29){return function(_0x2382a4){if(_0x2382a4){return _0x2382a4[_0x652c('0x28')](_0x2d7e83)[_0x652c('0x29')](function(_0xa84fa2){return _0xa84fa2;});}return null;};}function removeEntity(_0x15dc0f,_0x3bf173){return function(_0xd5300c){if(_0xd5300c){return _0xd5300c[_0x652c('0x2a')]()[_0x652c('0x29')](function(){_0x15dc0f[_0x652c('0x1d')](0xcc)[_0x652c('0x1e')]();});}};}function handleEntityNotFound(_0x2ebcb8,_0x2d0d1f){return function(_0x432d93){if(!_0x432d93){_0x2ebcb8['sendStatus'](0x194);}return _0x432d93;};}function handleError(_0x53e9e0,_0x15cae5){_0x15cae5=_0x15cae5||0x1f4;return function(_0x49fbca){logger['error'](_0x49fbca[_0x652c('0x2b')]);if(_0x49fbca[_0x652c('0x2c')]){delete _0x49fbca[_0x652c('0x2c')];}_0x53e9e0[_0x652c('0x1d')](_0x15cae5)[_0x652c('0x2d')](_0x49fbca);};}exports[_0x652c('0x2e')]=function(_0x28f565,_0x4e9bd7){var _0x5525d0={},_0x513d8f={},_0x1524be={'count':0x0,'rows':[]};var _0x58f564=_[_0x652c('0x2f')](db['UserProfileSection'][_0x652c('0x30')],function(_0x410bdf){return{'name':_0x410bdf['fieldName'],'type':_0x410bdf[_0x652c('0x31')]['key']};});_0x513d8f[_0x652c('0x32')]=_['map'](_0x58f564,_0x652c('0x2c'));_0x513d8f[_0x652c('0x33')]=_[_0x652c('0x34')](_0x28f565[_0x652c('0x33')]);_0x513d8f[_0x652c('0x35')]=_[_0x652c('0x36')](_0x513d8f[_0x652c('0x32')],_0x513d8f[_0x652c('0x33')]);_0x5525d0[_0x652c('0x37')]=_[_0x652c('0x36')](_0x513d8f['model'],qs[_0x652c('0x38')](_0x28f565[_0x652c('0x33')][_0x652c('0x38')]));_0x5525d0[_0x652c('0x37')]=_0x5525d0[_0x652c('0x37')]['length']?_0x5525d0['attributes']:_0x513d8f[_0x652c('0x32')];if(!_0x28f565[_0x652c('0x33')][_0x652c('0x39')](_0x652c('0x3a'))){_0x5525d0['limit']=qs['limit'](_0x28f565[_0x652c('0x33')][_0x652c('0x21')]);_0x5525d0[_0x652c('0x23')]=qs['offset'](_0x28f565[_0x652c('0x33')][_0x652c('0x23')]);}_0x5525d0[_0x652c('0x3b')]=qs['sort'](_0x28f565[_0x652c('0x33')][_0x652c('0x3c')]);_0x5525d0[_0x652c('0x3d')]=qs['filters'](_[_0x652c('0x3e')](_0x28f565[_0x652c('0x33')],_0x513d8f['filters']),_0x58f564);if(_0x28f565[_0x652c('0x33')][_0x652c('0x3f')]){_0x5525d0['where']=_[_0x652c('0x40')](_0x5525d0['where'],{'$or':_[_0x652c('0x2f')](_0x58f564,function(_0x963afc){if(_0x963afc[_0x652c('0x31')]!==_0x652c('0x41')){var _0x3281df={};_0x3281df[_0x963afc[_0x652c('0x2c')]]={'$like':'%'+_0x28f565[_0x652c('0x33')][_0x652c('0x3f')]+'%'};return _0x3281df;}})});}_0x5525d0=_[_0x652c('0x40')]({},_0x5525d0,_0x28f565[_0x652c('0x42')]);var _0x31ee08={'where':_0x5525d0[_0x652c('0x3d')]};return db[_0x652c('0x43')][_0x652c('0x22')](_0x31ee08)['then'](function(_0x5215f1){_0x1524be[_0x652c('0x22')]=_0x5215f1;if(_0x28f565[_0x652c('0x33')][_0x652c('0x44')]){_0x5525d0['include']=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x5525d0);})[_0x652c('0x29')](function(_0x176b6d){_0x1524be[_0x652c('0x45')]=_0x176b6d;return _0x1524be;})[_0x652c('0x29')](respondWithFilteredResult(_0x4e9bd7,_0x5525d0))[_0x652c('0x46')](handleError(_0x4e9bd7,null));};exports[_0x652c('0x47')]=function(_0x109ca7,_0x1dc020){var _0x2ac46f={'raw':![],'where':{'id':_0x109ca7['params']['id']}},_0x5959d1={};_0x5959d1['model']=_['keys'](db[_0x652c('0x43')][_0x652c('0x30')]);_0x5959d1[_0x652c('0x33')]=_['keys'](_0x109ca7[_0x652c('0x33')]);_0x5959d1[_0x652c('0x35')]=_[_0x652c('0x36')](_0x5959d1[_0x652c('0x32')],_0x5959d1['query']);_0x2ac46f['attributes']=_[_0x652c('0x36')](_0x5959d1['model'],qs[_0x652c('0x38')](_0x109ca7['query'][_0x652c('0x38')]));_0x2ac46f[_0x652c('0x37')]=_0x2ac46f[_0x652c('0x37')][_0x652c('0x48')]?_0x2ac46f['attributes']:_0x5959d1[_0x652c('0x32')];if(_0x109ca7[_0x652c('0x33')][_0x652c('0x44')]){_0x2ac46f[_0x652c('0x49')]=[{'all':!![]}];}_0x2ac46f=_[_0x652c('0x40')]({},_0x2ac46f,_0x109ca7[_0x652c('0x42')]);return db[_0x652c('0x43')][_0x652c('0x4a')](_0x2ac46f)[_0x652c('0x29')](handleEntityNotFound(_0x1dc020,null))['then'](respondWithResult(_0x1dc020,null))[_0x652c('0x46')](handleError(_0x1dc020,null));};exports[_0x652c('0x4b')]=function(_0x15025c,_0x36f036){return db[_0x652c('0x43')][_0x652c('0x4b')](_0x15025c['body'],{})[_0x652c('0x29')](respondWithResult(_0x36f036,0xc9))['catch'](handleError(_0x36f036,null));};exports[_0x652c('0x28')]=function(_0x59553a,_0x3a280d){if(_0x59553a[_0x652c('0x4c')]['id']){delete _0x59553a[_0x652c('0x4c')]['id'];}return db[_0x652c('0x43')][_0x652c('0x4a')]({'where':{'id':_0x59553a[_0x652c('0x4d')]['id']}})[_0x652c('0x29')](handleEntityNotFound(_0x3a280d,null))[_0x652c('0x29')](saveUpdates(_0x59553a[_0x652c('0x4c')],null))[_0x652c('0x29')](respondWithResult(_0x3a280d,null))[_0x652c('0x46')](handleError(_0x3a280d,null));};exports['destroy']=function(_0x319490,_0x3b9e38){return db[_0x652c('0x43')][_0x652c('0x4a')]({'where':{'id':_0x319490['params']['id']}})[_0x652c('0x29')](handleEntityNotFound(_0x3b9e38,null))[_0x652c('0x29')](removeEntity(_0x3b9e38,null))['catch'](handleError(_0x3b9e38,null));};exports[_0x652c('0x4e')]=function(_0x1a5e91,_0x4f4e83){return db[_0x652c('0x43')][_0x652c('0x4e')]()[_0x652c('0x29')](respondWithResult(_0x4f4e83,null))[_0x652c('0x46')](handleError(_0x4f4e83,null));};
\ No newline at end of file
index 617672b..021cce1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01bd=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x43ab8e,_0x365f34){var _0x1a9773=function(_0x392902){while(--_0x392902){_0x43ab8e['push'](_0x43ab8e['shift']());}};_0x1a9773(++_0x365f34);}(_0x01bd,0x1e1));var _0xd01b=function(_0x3c7b91,_0x5b3e20){_0x3c7b91=_0x3c7b91-0x0;var _0x3bc225=_0x01bd[_0x3c7b91];return _0x3bc225;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd01b('0x0'))(_0xd01b('0x1'));var moment=require(_0xd01b('0x2'));var BPromise=require('bluebird');var rp=require(_0xd01b('0x3'));var fs=require('fs');var path=require(_0xd01b('0x4'));var rimraf=require('rimraf');var config=require(_0xd01b('0x5'));var attributes=require('./userProfileSection.attributes');module[_0xd01b('0x6')]=function(_0x4b3c91,_0xf299c1){return _0x4b3c91[_0xd01b('0x7')](_0xd01b('0x8'),attributes,{'tableName':_0xd01b('0x9'),'paranoid':![],'indexes':[{'name':_0xd01b('0xa'),'fields':[_0xd01b('0xb'),_0xd01b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb39c=['api','moment','bluebird','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util'];(function(_0x592216,_0xdd6bee){var _0x60b178=function(_0x5284bb){while(--_0x5284bb){_0x592216['push'](_0x592216['shift']());}};_0x60b178(++_0xdd6bee);}(_0xb39c,0x136));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcb39('0x0'));var util=require(_0xcb39('0x1'));var logger=require('../../config/logger')(_0xcb39('0x2'));var moment=require(_0xcb39('0x3'));var BPromise=require(_0xcb39('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb39('0x5'));var config=require(_0xcb39('0x6'));var attributes=require(_0xcb39('0x7'));module[_0xcb39('0x8')]=function(_0xbe8847,_0x2d8231){return _0xbe8847['define'](_0xcb39('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xcb39('0xa'),'fields':[_0xcb39('0xb'),_0xcb39('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 123c489..e2653d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x741c=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x741c,0x8d));var _0xc741=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x741c[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var moment=require(_0xc741('0x2'));var BPromise=require(_0xc741('0x3'));var rs=require(_0xc741('0x4'));var fs=require('fs');var Redis=require(_0xc741('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc741('0x6'))('rpc');var config=require(_0xc741('0x7'));var jayson=require(_0xc741('0x8'));var client=jayson['client'][_0xc741('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45f031,_0x304240,_0x3d0e5a){return new BPromise(function(_0x21daa8,_0x2f7b28){return client[_0xc741('0xa')](_0x45f031,_0x3d0e5a)[_0xc741('0xb')](function(_0x37f535){logger[_0xc741('0xc')](_0xc741('0xd'),_0x304240,'request\x20sent');logger[_0xc741('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x304240,_0xc741('0xf'),JSON['stringify'](_0x37f535));if(_0x37f535[_0xc741('0x10')]){if(_0x37f535[_0xc741('0x10')][_0xc741('0x11')]===0x1f4){logger[_0xc741('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x304240,_0x37f535['error'][_0xc741('0x12')]);return _0x2f7b28(_0x37f535[_0xc741('0x10')][_0xc741('0x12')]);}logger[_0xc741('0x10')](_0xc741('0xd'),_0x304240,_0x37f535[_0xc741('0x10')][_0xc741('0x12')]);return _0x21daa8(_0x37f535[_0xc741('0x10')]['message']);}else{logger[_0xc741('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x304240,_0xc741('0xf'));_0x21daa8(_0x37f535[_0xc741('0x13')]['message']);}})['catch'](function(_0x317b0b){logger[_0xc741('0x10')](_0xc741('0xd'),_0x304240,_0x317b0b);_0x2f7b28(_0x317b0b);});});}
\ No newline at end of file
+var _0xb42d=['request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UserProfileSection,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0xb42d,0x1ed));var _0xdb42=function(_0xeaeb5d,_0x5274e9){_0xeaeb5d=_0xeaeb5d-0x0;var _0x2eea1c=_0xb42d[_0xeaeb5d];return _0x2eea1c;};'use strict';var _=require(_0xdb42('0x0'));var util=require(_0xdb42('0x1'));var moment=require(_0xdb42('0x2'));var BPromise=require(_0xdb42('0x3'));var rs=require(_0xdb42('0x4'));var fs=require('fs');var Redis=require(_0xdb42('0x5'));var db=require(_0xdb42('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb42('0x7'))('rpc');var config=require(_0xdb42('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdb42('0x9')][_0xdb42('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c9e22,_0x52b777,_0x137a69){return new BPromise(function(_0x5780dd,_0x17d658){return client[_0xdb42('0xb')](_0x1c9e22,_0x137a69)[_0xdb42('0xc')](function(_0x40e85a){logger[_0xdb42('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x52b777,'request\x20sent');logger[_0xdb42('0xe')](_0xdb42('0xf'),_0x52b777,_0xdb42('0x10'),JSON[_0xdb42('0x11')](_0x40e85a));if(_0x40e85a[_0xdb42('0x12')]){if(_0x40e85a['error']['code']===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x52b777,_0x40e85a[_0xdb42('0x12')][_0xdb42('0x13')]);return _0x17d658(_0x40e85a[_0xdb42('0x12')][_0xdb42('0x13')]);}logger[_0xdb42('0x12')](_0xdb42('0x14'),_0x52b777,_0x40e85a[_0xdb42('0x12')][_0xdb42('0x13')]);return _0x5780dd(_0x40e85a['error']['message']);}else{logger['info'](_0xdb42('0x14'),_0x52b777,_0xdb42('0x10'));_0x5780dd(_0x40e85a['result']['message']);}})['catch'](function(_0x163a6d){logger[_0xdb42('0x12')](_0xdb42('0x14'),_0x52b777,_0x163a6d);_0x17d658(_0x163a6d);});});}
\ No newline at end of file
index 6fad10d..72c28e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a00d0,_0x25da24){var _0x1091c3=function(_0x23ea11){while(--_0x23ea11){_0x5a00d0['push'](_0x5a00d0['shift']());}};_0x1091c3(++_0x25da24);}(_0xe706,0xa3));var _0x6e70=function(_0x2466ec,_0x4260dc){_0x2466ec=_0x2466ec-0x0;var _0x450c0b=_0xe706[_0x2466ec];return _0x450c0b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x26cc1c,_0x4f6b44){var _0x23d79c=function(_0x4782ad){while(--_0x4782ad){_0x26cc1c['push'](_0x26cc1c['shift']());}};_0x23d79c(++_0x4f6b44);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index f6b7de5..c9b52b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a6f=['sequelize'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x7a6f,0x148));var _0xf7a6=function(_0x20b61e,_0x1b5057){_0x20b61e=_0x20b61e-0x0;var _0x4614fa=_0x7a6f[_0x20b61e];return _0x4614fa;};'use strict';var Sequelize=require(_0xf7a6('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6469=['INTEGER','sequelize','exports'];(function(_0x4ed625,_0x384757){var _0x5b4bad=function(_0x4b4baf){while(--_0x4b4baf){_0x4ed625['push'](_0x4ed625['shift']());}};_0x5b4bad(++_0x384757);}(_0x6469,0x142));var _0x9646=function(_0x49c1a0,_0x1776a8){_0x49c1a0=_0x49c1a0-0x0;var _0x5bc4b1=_0x6469[_0x49c1a0];return _0x5bc4b1;};'use strict';var Sequelize=require(_0x9646('0x0'));module[_0x9646('0x1')]={'penalty':{'type':Sequelize[_0x9646('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index d2e039f..e1462ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf2=['rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xcaf2,0x8a));var _0x2caf=function(_0x443f79,_0x33e446){_0x443f79=_0x443f79-0x0;var _0x3847e4=_0xcaf2[_0x443f79];return _0x3847e4;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var logger=require(_0x2caf('0x1'))(_0x2caf('0x2'));var moment=require('moment');var BPromise=require(_0x2caf('0x3'));var rp=require(_0x2caf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x6'));module[_0x2caf('0x7')]=function(_0x249a4b,_0x599ce7){return _0x249a4b[_0x2caf('0x8')](_0x2caf('0x9'),attributes,{'tableName':_0x2caf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39e6=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x355536,_0x44c727){var _0x25ea13=function(_0x530f07){while(--_0x530f07){_0x355536['push'](_0x355536['shift']());}};_0x25ea13(++_0x44c727);}(_0x39e6,0x9e));var _0x639e=function(_0x4f495a,_0x30accc){_0x4f495a=_0x4f495a-0x0;var _0x46f5ce=_0x39e6[_0x4f495a];return _0x46f5ce;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var logger=require(_0x639e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x639e('0x2'));var rp=require(_0x639e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x639e('0x4'));var config=require(_0x639e('0x5'));var attributes=require(_0x639e('0x6'));module[_0x639e('0x7')]=function(_0x15e5df,_0x320448){return _0x15e5df[_0x639e('0x8')](_0x639e('0x9'),attributes,{'tableName':_0x639e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 001f220..918f63d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1733=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','catch'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x1733,0x1e4));var _0x3173=function(_0x139281,_0x285272){_0x139281=_0x139281-0x0;var _0x280342=_0x1733[_0x139281];return _0x280342;};'use strict';var _=require(_0x3173('0x0'));var util=require(_0x3173('0x1'));var moment=require(_0x3173('0x2'));var BPromise=require(_0x3173('0x3'));var rs=require(_0x3173('0x4'));var fs=require('fs');var Redis=require(_0x3173('0x5'));var db=require(_0x3173('0x6'))['db'];var utils=require(_0x3173('0x7'));var logger=require(_0x3173('0x8'))('rpc');var config=require(_0x3173('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3173('0xa')][_0x3173('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30bdfb,_0x5a56a4,_0x3f0626){return new BPromise(function(_0x3266f5,_0x59af05){return client[_0x3173('0xc')](_0x30bdfb,_0x3f0626)[_0x3173('0xd')](function(_0x28ae9d){logger[_0x3173('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x5a56a4,_0x3173('0xf'));logger[_0x3173('0x10')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5a56a4,_0x3173('0xf'),JSON[_0x3173('0x11')](_0x28ae9d));if(_0x28ae9d[_0x3173('0x12')]){if(_0x28ae9d[_0x3173('0x12')]['code']===0x1f4){logger[_0x3173('0x12')](_0x3173('0x13'),_0x5a56a4,_0x28ae9d[_0x3173('0x12')][_0x3173('0x14')]);return _0x59af05(_0x28ae9d['error'][_0x3173('0x14')]);}logger[_0x3173('0x12')](_0x3173('0x13'),_0x5a56a4,_0x28ae9d['error'][_0x3173('0x14')]);return _0x3266f5(_0x28ae9d[_0x3173('0x12')][_0x3173('0x14')]);}else{logger['info'](_0x3173('0x13'),_0x5a56a4,_0x3173('0xf'));_0x3266f5(_0x28ae9d['result']['message']);}})[_0x3173('0x15')](function(_0x2d3013){logger[_0x3173('0x12')](_0x3173('0x13'),_0x5a56a4,_0x2d3013);_0x59af05(_0x2d3013);});});}
\ No newline at end of file
+var _0x265c=['http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client'];(function(_0xc153db,_0x516c10){var _0x4dc97d=function(_0x10fc05){while(--_0x10fc05){_0xc153db['push'](_0xc153db['shift']());}};_0x4dc97d(++_0x516c10);}(_0x265c,0x6a));var _0xc265=function(_0x2b3e6e,_0x507e1f){_0x2b3e6e=_0x2b3e6e-0x0;var _0x46b423=_0x265c[_0x2b3e6e];return _0x46b423;};'use strict';var _=require(_0xc265('0x0'));var util=require(_0xc265('0x1'));var moment=require('moment');var BPromise=require(_0xc265('0x2'));var rs=require(_0xc265('0x3'));var fs=require('fs');var Redis=require(_0xc265('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc265('0x5'));var logger=require(_0xc265('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc265('0x7')][_0xc265('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1fb179,_0xebabdf,_0x4fd2b6){return new BPromise(function(_0x2f6530,_0x324a13){return client[_0xc265('0x9')](_0x1fb179,_0x4fd2b6)[_0xc265('0xa')](function(_0x5bf193){logger[_0xc265('0xb')](_0xc265('0xc'),_0xebabdf,_0xc265('0xd'));logger[_0xc265('0xe')](_0xc265('0xf'),_0xebabdf,_0xc265('0xd'),JSON['stringify'](_0x5bf193));if(_0x5bf193[_0xc265('0x10')]){if(_0x5bf193[_0xc265('0x10')]['code']===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0xebabdf,_0x5bf193[_0xc265('0x10')]['message']);return _0x324a13(_0x5bf193[_0xc265('0x10')][_0xc265('0x11')]);}logger[_0xc265('0x10')](_0xc265('0xc'),_0xebabdf,_0x5bf193[_0xc265('0x10')]['message']);return _0x2f6530(_0x5bf193[_0xc265('0x10')][_0xc265('0x11')]);}else{logger[_0xc265('0xb')](_0xc265('0xc'),_0xebabdf,'request\x20sent');_0x2f6530(_0x5bf193[_0xc265('0x12')]['message']);}})['catch'](function(_0x35c019){logger['error'](_0xc265('0xc'),_0xebabdf,_0x35c019);_0x324a13(_0x35c019);});});}
\ No newline at end of file
index c83cc6a..eb89372 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x728f=['exports','INTEGER','sequelize'];(function(_0x8ea09b,_0x5c45d6){var _0x16d530=function(_0x103f61){while(--_0x103f61){_0x8ea09b['push'](_0x8ea09b['shift']());}};_0x16d530(++_0x5c45d6);}(_0x728f,0x107));var _0xf728=function(_0x4a9b4e,_0x2f277c){_0x4a9b4e=_0x4a9b4e-0x0;var _0x1a0f43=_0x728f[_0x4a9b4e];return _0x1a0f43;};'use strict';var Sequelize=require(_0xf728('0x0'));module[_0xf728('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xf728('0x2')]}};
\ No newline at end of file
+var _0x6daf=['INTEGER','sequelize','exports'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x6daf,0xe5));var _0xf6da=function(_0x1395a0,_0x5ea811){_0x1395a0=_0x1395a0-0x0;var _0x5ba162=_0x6daf[_0x1395a0];return _0x5ba162;};'use strict';var Sequelize=require(_0xf6da('0x0'));module[_0xf6da('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xf6da('0x2')]}};
\ No newline at end of file
index 3da8125..8f7094d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x605b67,_0x22027f){var _0x2b91ca=function(_0x1b2aa0){while(--_0x1b2aa0){_0x605b67['push'](_0x605b67['shift']());}};_0x2b91ca(++_0x22027f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2c328f,_0x3c429a){var _0x6037ea=function(_0x31756a){while(--_0x31756a){_0x2c328f['push'](_0x2c328f['shift']());}};_0x6037ea(++_0x3c429a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ded453a..a10f52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x83221c,_0x3975ef){var _0x2fa1fc=function(_0x26d691){while(--_0x26d691){_0x83221c['push'](_0x83221c['shift']());}};_0x2fa1fc(++_0x3975ef);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x23c816,_0x18642d){var _0x122bd3=function(_0x3ab89a){while(--_0x3ab89a){_0x23c816['push'](_0x23c816['shift']());}};_0x122bd3(++_0x18642d);}(_0xe706,0xa3));var _0x6e70=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xe706[_0x4849f6];return _0x1a3dcd;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index 14e0cbf..e66cefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2873=['sequelize','exports'];(function(_0x34175b,_0x5e8829){var _0x3cff1b=function(_0x1f4780){while(--_0x1f4780){_0x34175b['push'](_0x34175b['shift']());}};_0x3cff1b(++_0x5e8829);}(_0x2873,0x168));var _0x3287=function(_0x2f8753,_0x5d2b06){_0x2f8753=_0x2f8753-0x0;var _0x576f3d=_0x2873[_0x2f8753];return _0x576f3d;};'use strict';var Sequelize=require(_0x3287('0x0'));module[_0x3287('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x73c9=['sequelize','exports','INTEGER'];(function(_0x131205,_0x57575c){var _0x305300=function(_0x179eea){while(--_0x179eea){_0x131205['push'](_0x131205['shift']());}};_0x305300(++_0x57575c);}(_0x73c9,0x17a));var _0x973c=function(_0x22ba7d,_0x2b0cfd){_0x22ba7d=_0x22ba7d-0x0;var _0x3b3b6a=_0x73c9[_0x22ba7d];return _0x3b3b6a;};'use strict';var Sequelize=require(_0x973c('0x0'));module[_0x973c('0x1')]={'penalty':{'type':Sequelize[_0x973c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 6a72917..47c1b64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074a=['../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3885e7,_0x16e843){var _0x11c25f=function(_0x51c189){while(--_0x51c189){_0x3885e7['push'](_0x3885e7['shift']());}};_0x11c25f(++_0x16e843);}(_0x074a,0xe2));var _0xa074=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x074a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xa074('0x0'));var util=require(_0xa074('0x1'));var logger=require(_0xa074('0x2'))('api');var moment=require(_0xa074('0x3'));var BPromise=require(_0xa074('0x4'));var rp=require(_0xa074('0x5'));var fs=require('fs');var path=require(_0xa074('0x6'));var rimraf=require(_0xa074('0x7'));var config=require(_0xa074('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0xa074('0x9')]=function(_0x2d2704,_0x39ef1c){return _0x2d2704[_0xa074('0xa')](_0xa074('0xb'),attributes,{'tableName':_0xa074('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b6c=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','../../config/logger','api','bluebird'];(function(_0x585d06,_0x1b43a5){var _0x51bbe3=function(_0x4b0fb7){while(--_0x4b0fb7){_0x585d06['push'](_0x585d06['shift']());}};_0x51bbe3(++_0x1b43a5);}(_0x7b6c,0x81));var _0xc7b6=function(_0x3658ea,_0x208646){_0x3658ea=_0x3658ea-0x0;var _0x1aaead=_0x7b6c[_0x3658ea];return _0x1aaead;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc7b6('0x0'))(_0xc7b6('0x1'));var moment=require('moment');var BPromise=require(_0xc7b6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7b6('0x3'));var rimraf=require(_0xc7b6('0x4'));var config=require(_0xc7b6('0x5'));var attributes=require(_0xc7b6('0x6'));module[_0xc7b6('0x7')]=function(_0x58364b,_0x39c450){return _0x58364b[_0xc7b6('0x8')](_0xc7b6('0x9'),attributes,{'tableName':_0xc7b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f5cfc84..757d473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29a6=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2ddcad,_0x27f5b4){var _0x1f2c40=function(_0x206ae9){while(--_0x206ae9){_0x2ddcad['push'](_0x2ddcad['shift']());}};_0x1f2c40(++_0x27f5b4);}(_0x29a6,0x106));var _0x629a=function(_0x30162f,_0x335c0c){_0x30162f=_0x30162f-0x0;var _0x46489a=_0x29a6[_0x30162f];return _0x46489a;};'use strict';var _=require(_0x629a('0x0'));var util=require(_0x629a('0x1'));var moment=require(_0x629a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x629a('0x3'));var db=require(_0x629a('0x4'))['db'];var utils=require(_0x629a('0x5'));var logger=require('../../config/logger')(_0x629a('0x6'));var config=require(_0x629a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x629a('0x8')][_0x629a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4af9cb,_0x570988,_0x879a3c){return new BPromise(function(_0x315617,_0x1a8a96){return client['request'](_0x4af9cb,_0x879a3c)[_0x629a('0xa')](function(_0x53ec23){logger[_0x629a('0xb')](_0x629a('0xc'),_0x570988,_0x629a('0xd'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x570988,_0x629a('0xd'),JSON[_0x629a('0xe')](_0x53ec23));if(_0x53ec23[_0x629a('0xf')]){if(_0x53ec23[_0x629a('0xf')][_0x629a('0x10')]===0x1f4){logger[_0x629a('0xf')](_0x629a('0xc'),_0x570988,_0x53ec23[_0x629a('0xf')][_0x629a('0x11')]);return _0x1a8a96(_0x53ec23[_0x629a('0xf')][_0x629a('0x11')]);}logger[_0x629a('0xf')](_0x629a('0xc'),_0x570988,_0x53ec23[_0x629a('0xf')][_0x629a('0x11')]);return _0x315617(_0x53ec23[_0x629a('0xf')][_0x629a('0x11')]);}else{logger[_0x629a('0xb')](_0x629a('0xc'),_0x570988,_0x629a('0xd'));_0x315617(_0x53ec23[_0x629a('0x12')][_0x629a('0x11')]);}})[_0x629a('0x13')](function(_0x4cf0c8){logger[_0x629a('0xf')](_0x629a('0xc'),_0x570988,_0x4cf0c8);_0x1a8a96(_0x4cf0c8);});});}
\ No newline at end of file
+var _0x6068=['info','request\x20sent','debug','stringify','error','code','message','UserVoiceQueue,\x20%s,\x20%s','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then'];(function(_0x80176d,_0x54d63c){var _0x684188=function(_0x113719){while(--_0x113719){_0x80176d['push'](_0x80176d['shift']());}};_0x684188(++_0x54d63c);}(_0x6068,0xc7));var _0x8606=function(_0x1ec406,_0x22cbd1){_0x1ec406=_0x1ec406-0x0;var _0xb669e5=_0x6068[_0x1ec406];return _0xb669e5;};'use strict';var _=require(_0x8606('0x0'));var util=require(_0x8606('0x1'));var moment=require('moment');var BPromise=require(_0x8606('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8606('0x3'));var db=require(_0x8606('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8606('0x5'))('rpc');var config=require(_0x8606('0x6'));var jayson=require(_0x8606('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53fed6,_0x2fa66a,_0x45fcae){return new BPromise(function(_0x59563d,_0x5a0f41){return client[_0x8606('0x8')](_0x53fed6,_0x45fcae)[_0x8606('0x9')](function(_0x593f52){logger[_0x8606('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x2fa66a,_0x8606('0xb'));logger[_0x8606('0xc')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2fa66a,_0x8606('0xb'),JSON[_0x8606('0xd')](_0x593f52));if(_0x593f52[_0x8606('0xe')]){if(_0x593f52[_0x8606('0xe')][_0x8606('0xf')]===0x1f4){logger[_0x8606('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x2fa66a,_0x593f52[_0x8606('0xe')][_0x8606('0x10')]);return _0x5a0f41(_0x593f52['error']['message']);}logger['error'](_0x8606('0x11'),_0x2fa66a,_0x593f52['error'][_0x8606('0x10')]);return _0x59563d(_0x593f52[_0x8606('0xe')]['message']);}else{logger[_0x8606('0xa')](_0x8606('0x11'),_0x2fa66a,_0x8606('0xb'));_0x59563d(_0x593f52[_0x8606('0x12')]['message']);}})['catch'](function(_0x136966){logger[_0x8606('0xe')](_0x8606('0x11'),_0x2fa66a,_0x136966);_0x5a0f41(_0x136966);});});}
\ No newline at end of file
index 539644c..accf535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5e31e2,_0x273090){var _0x294e2c=function(_0x20ab82){while(--_0x20ab82){_0x5e31e2['push'](_0x5e31e2['shift']());}};_0x294e2c(++_0x273090);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x416353,_0x5e8bbc){var _0xef175e=function(_0x3f4e22){while(--_0x3f4e22){_0x416353['push'](_0x416353['shift']());}};_0xef175e(++_0x5e8bbc);}(_0x70e0,0x17b));var _0x070e=function(_0x1359d9,_0x2410b6){_0x1359d9=_0x1359d9-0x0;var _0x343e72=_0x70e0[_0x1359d9];return _0x343e72;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 0e786ea..bc4f11b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf40b=['queue_interface','exports','INTEGER','STRING','Required\x20by\x20Asterisk'];(function(_0x5b65e4,_0x535e2e){var _0x9f49e9=function(_0x3319eb){while(--_0x3319eb){_0x5b65e4['push'](_0x5b65e4['shift']());}};_0x9f49e9(++_0x535e2e);}(_0xf40b,0xfb));var _0xbf40=function(_0x4070a0,_0x523f5d){_0x4070a0=_0x4070a0-0x0;var _0x55c11e=_0xf40b[_0x4070a0];return _0x55c11e;};'use strict';var Sequelize=require('sequelize');module[_0xbf40('0x0')]={'uniqueid':{'type':Sequelize[_0xbf40('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xbf40('0x2')],'allowNull':![],'comment':_0xbf40('0x3')},'UserId':{'type':Sequelize[_0xbf40('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbf40('0x2')],'allowNull':![],'unique':_0xbf40('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xbf40('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xbf40('0x2')],'allowNull':![],'unique':_0xbf40('0x4'),'comment':_0xbf40('0x3')},'penalty':{'type':Sequelize[_0xbf40('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xbf40('0x1')](0xb),'defaultValue':0x0,'comment':_0xbf40('0x3')}};
\ No newline at end of file
+var _0x0d8e=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0d8e,0x1e6));var _0xe0d8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x0d8e[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xe0d8('0x0'));module[_0xe0d8('0x1')]={'uniqueid':{'type':Sequelize[_0xe0d8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe0d8('0x3')},'membername':{'type':Sequelize[_0xe0d8('0x4')],'allowNull':![],'comment':_0xe0d8('0x3')},'UserId':{'type':Sequelize[_0xe0d8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe0d8('0x4')],'allowNull':![],'unique':_0xe0d8('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xe0d8('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xe0d8('0x4')],'allowNull':![],'unique':_0xe0d8('0x5'),'comment':_0xe0d8('0x3')},'penalty':{'type':Sequelize[_0xe0d8('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
index 9f6a0d2..45eb46a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6727=['save','update','remove','emit','hook','exports','../../mysqldb','UserVoiceQueueRt'];(function(_0x4b5bab,_0x1d73d4){var _0x5abd6b=function(_0x1256d6){while(--_0x1256d6){_0x4b5bab['push'](_0x4b5bab['shift']());}};_0x5abd6b(++_0x1d73d4);}(_0x6727,0x11e));var _0x7672=function(_0x21a69e,_0x4c15ae){_0x21a69e=_0x21a69e-0x0;var _0x5f3e66=_0x6727[_0x21a69e];return _0x5f3e66;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x7672('0x0'))['db'][_0x7672('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7672('0x2'),'afterUpdate':_0x7672('0x3'),'afterDestroy':_0x7672('0x4')};function emitEvent(_0x5f0882){return function(_0x5309d6,_0xb1add0,_0x3a66c5){UserVoiceQueueRtEvents[_0x7672('0x5')](_0x5f0882+':'+_0x5309d6['id'],_0x5309d6);UserVoiceQueueRtEvents[_0x7672('0x5')](_0x5f0882,_0x5309d6);_0x3a66c5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x7672('0x6')](e,emitEvent(event));}}module[_0x7672('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x5b0a=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','save'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5b0a,0x192));var _0xa5b0=function(_0x3ba4f1,_0x57abd0){_0x3ba4f1=_0x3ba4f1-0x0;var _0x384549=_0x5b0a[_0x3ba4f1];return _0x384549;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xa5b0('0x0'))['db'][_0xa5b0('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa5b0('0x2'),'afterUpdate':_0xa5b0('0x3'),'afterDestroy':_0xa5b0('0x4')};function emitEvent(_0x26ac24){return function(_0x212cd9,_0x31d1df,_0x206c14){UserVoiceQueueRtEvents[_0xa5b0('0x5')](_0x26ac24+':'+_0x212cd9['id'],_0x212cd9);UserVoiceQueueRtEvents[_0xa5b0('0x5')](_0x26ac24,_0x212cd9);_0x206c14(null);};}for(var e in events){if(events[_0xa5b0('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xa5b0('0x7')](e,emitEvent(event));}}module[_0xa5b0('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 203066c..acd6530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95d2=['bluebird','request-promise','path','rimraf','../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api'];(function(_0x7f3edb,_0x1219c4){var _0x58e0b9=function(_0x19eb9d){while(--_0x19eb9d){_0x7f3edb['push'](_0x7f3edb['shift']());}};_0x58e0b9(++_0x1219c4);}(_0x95d2,0x1e4));var _0x295d=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x95d2[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x295d('0x0'))(_0x295d('0x1'));var moment=require('moment');var BPromise=require(_0x295d('0x2'));var rp=require(_0x295d('0x3'));var fs=require('fs');var path=require(_0x295d('0x4'));var rimraf=require(_0x295d('0x5'));var config=require(_0x295d('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x4fa6b4,_0x216cbd){return _0x4fa6b4['define'](_0x295d('0x7'),attributes,{'tableName':_0x295d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0558=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x4e5c10,_0xd535a0){var _0x29445b=function(_0x2ab470){while(--_0x2ab470){_0x4e5c10['push'](_0x4e5c10['shift']());}};_0x29445b(++_0xd535a0);}(_0x0558,0x1d0));var _0x8055=function(_0xe7d561,_0x146cef){_0xe7d561=_0xe7d561-0x0;var _0x4c27f0=_0x0558[_0xe7d561];return _0x4c27f0;};'use strict';var _=require(_0x8055('0x0'));var util=require('util');var logger=require(_0x8055('0x1'))(_0x8055('0x2'));var moment=require(_0x8055('0x3'));var BPromise=require(_0x8055('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8055('0x5'));var rimraf=require(_0x8055('0x6'));var config=require(_0x8055('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x8055('0x8')]=function(_0x635d95,_0x35fe30){return _0x635d95['define'](_0x8055('0x9'),attributes,{'tableName':_0x8055('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 50df231..55be150 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe10=['GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','literal','outboundQueuePauses','debug','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','info','result'];(function(_0x510fad,_0x283c39){var _0x249cc9=function(_0x5a9740){while(--_0x5a9740){_0x510fad['push'](_0x510fad['shift']());}};_0x249cc9(++_0x283c39);}(_0xbe10,0xbf));var _0x0be1=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xbe10[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x0be1('0x0'));var util=require('util');var moment=require(_0x0be1('0x1'));var BPromise=require(_0x0be1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0be1('0x3'));var db=require(_0x0be1('0x4'))['db'];var utils=require(_0x0be1('0x5'));var logger=require(_0x0be1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0be1('0x7'));var client=jayson[_0x0be1('0x8')][_0x0be1('0x9')]({'port':0x232a});config[_0x0be1('0xa')]=_[_0x0be1('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0be1('0xc'))(new Redis(config[_0x0be1('0xa')]));require(_0x0be1('0xd'))[_0x0be1('0xe')](socket);function respondWithRpcPromise(_0x154ad7,_0xfeef3,_0x57bd87){return new BPromise(function(_0x5f4183,_0x3dcc3f){return client['request'](_0x154ad7,_0x57bd87)[_0x0be1('0xf')](function(_0x4c5faa){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0xfeef3,'request\x20sent');logger['debug'](_0x0be1('0x10'),_0xfeef3,_0x0be1('0x11'),JSON[_0x0be1('0x12')](_0x4c5faa));if(_0x4c5faa[_0x0be1('0x13')]){if(_0x4c5faa[_0x0be1('0x13')][_0x0be1('0x14')]===0x1f4){logger[_0x0be1('0x13')](_0x0be1('0x15'),_0xfeef3,_0x4c5faa[_0x0be1('0x13')][_0x0be1('0x16')]);return _0x3dcc3f(_0x4c5faa[_0x0be1('0x13')]['message']);}logger[_0x0be1('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xfeef3,_0x4c5faa[_0x0be1('0x13')][_0x0be1('0x16')]);return _0x5f4183(_0x4c5faa[_0x0be1('0x13')][_0x0be1('0x16')]);}else{logger[_0x0be1('0x17')](_0x0be1('0x15'),_0xfeef3,_0x0be1('0x11'));_0x5f4183(_0x4c5faa[_0x0be1('0x18')][_0x0be1('0x16')]);}})['catch'](function(_0x3216b8){logger[_0x0be1('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xfeef3,_0x3216b8);_0x3dcc3f(_0x3216b8);});});}exports[_0x0be1('0x19')]=function(_0x5b6d94){var _0x1d7a8d=this;return new Promise(function(_0x3ed2a2,_0x13a49c){return db['UserVoiceQueueRt'][_0x0be1('0x1a')]({'raw':_0x5b6d94[_0x0be1('0x1b')]?_0x5b6d94[_0x0be1('0x1b')][_0x0be1('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b6d94[_0x0be1('0x1b')]?_0x5b6d94[_0x0be1('0x1b')][_0x0be1('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x0be1('0x1e'),db['sequelize']['fn']('IF',db[_0x0be1('0x1f')][_0x0be1('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),_0x0be1('0x21')]]})[_0x0be1('0xf')](function(_0x1dc379){logger[_0x0be1('0x17')](_0x0be1('0x19'),_0x5b6d94);logger[_0x0be1('0x22')](_0x0be1('0x19'),_0x5b6d94,JSON['stringify'](_0x1dc379));_0x3ed2a2(_0x1dc379);})[_0x0be1('0x23')](function(_0x875d9a){logger['error'](_0x0be1('0x19'),_0x875d9a['message'],_0x5b6d94);_0x13a49c(_0x1d7a8d[_0x0be1('0x13')](0x1f4,_0x875d9a['message']));});});};
\ No newline at end of file
+var _0xaa88=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x3f9b08,_0x501a00){var _0x5ad64f=function(_0x2433ab){while(--_0x2433ab){_0x3f9b08['push'](_0x3f9b08['shift']());}};_0x5ad64f(++_0x501a00);}(_0xaa88,0xf0));var _0x8aa8=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0xaa88[_0x252328];return _0xaa85b7;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require('moment');var BPromise=require(_0x8aa8('0x2'));var rs=require(_0x8aa8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8aa8('0x4'))['db'];var utils=require(_0x8aa8('0x5'));var logger=require(_0x8aa8('0x6'))(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8aa8('0x9')][_0x8aa8('0xa')]({'port':0x232a});config[_0x8aa8('0xb')]=_[_0x8aa8('0xc')](config[_0x8aa8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8aa8('0xd'))(new Redis(config[_0x8aa8('0xb')]));require(_0x8aa8('0xe'))[_0x8aa8('0xf')](socket);function respondWithRpcPromise(_0x4509d0,_0x39a441,_0x254fb2){return new BPromise(function(_0x2715e3,_0x18a7c0){return client['request'](_0x4509d0,_0x254fb2)[_0x8aa8('0x10')](function(_0x2b624b){logger[_0x8aa8('0x11')](_0x8aa8('0x12'),_0x39a441,_0x8aa8('0x13'));logger[_0x8aa8('0x14')](_0x8aa8('0x15'),_0x39a441,_0x8aa8('0x13'),JSON['stringify'](_0x2b624b));if(_0x2b624b[_0x8aa8('0x16')]){if(_0x2b624b[_0x8aa8('0x16')][_0x8aa8('0x17')]===0x1f4){logger[_0x8aa8('0x16')](_0x8aa8('0x12'),_0x39a441,_0x2b624b[_0x8aa8('0x16')][_0x8aa8('0x18')]);return _0x18a7c0(_0x2b624b['error'][_0x8aa8('0x18')]);}logger[_0x8aa8('0x16')](_0x8aa8('0x12'),_0x39a441,_0x2b624b[_0x8aa8('0x16')]['message']);return _0x2715e3(_0x2b624b[_0x8aa8('0x16')][_0x8aa8('0x18')]);}else{logger[_0x8aa8('0x11')](_0x8aa8('0x12'),_0x39a441,_0x8aa8('0x13'));_0x2715e3(_0x2b624b[_0x8aa8('0x19')]['message']);}})[_0x8aa8('0x1a')](function(_0xaea5dd){logger['error'](_0x8aa8('0x12'),_0x39a441,_0xaea5dd);_0x18a7c0(_0xaea5dd);});});}exports['GetVoiceQueueRtPauses']=function(_0x4e23ec){var _0x37d4ba=this;return new Promise(function(_0x2df326,_0x180e65){return db[_0x8aa8('0x1b')]['findAll']({'raw':_0x4e23ec[_0x8aa8('0x1c')]?_0x4e23ec[_0x8aa8('0x1c')][_0x8aa8('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e23ec['options']?_0x4e23ec[_0x8aa8('0x1c')][_0x8aa8('0x1e')]||null:null,'attributes':[[db[_0x8aa8('0x1f')]['fn'](_0x8aa8('0x20'),db[_0x8aa8('0x1f')]['fn']('IF',db[_0x8aa8('0x1f')][_0x8aa8('0x21')](_0x8aa8('0x22')))),_0x8aa8('0x23')]]})[_0x8aa8('0x10')](function(_0x4ec0c5){logger['info'](_0x8aa8('0x24'),_0x4e23ec);logger[_0x8aa8('0x14')]('GetVoiceQueueRtPauses',_0x4e23ec,JSON['stringify'](_0x4ec0c5));_0x2df326(_0x4ec0c5);})['catch'](function(_0x42a9c6){logger['error'](_0x8aa8('0x24'),_0x42a9c6[_0x8aa8('0x18')],_0x4e23ec);_0x180e65(_0x37d4ba[_0x8aa8('0x16')](0x1f4,_0x42a9c6[_0x8aa8('0x18')]));});});};
\ No newline at end of file
index e464ca8..7dcef46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf12=['emit','removeListener','register','length','userVoiceQueueRt:','save','update'];(function(_0x1221e8,_0x2e7229){var _0x3f3041=function(_0x2042c){while(--_0x2042c){_0x1221e8['push'](_0x1221e8['shift']());}};_0x3f3041(++_0x2e7229);}(_0xcf12,0x140));var _0x2cf1=function(_0xc78832,_0x27a347){_0xc78832=_0xc78832-0x0;var _0x21753a=_0xcf12[_0xc78832];return _0x21753a;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x2cf1('0x0'),'remove',_0x2cf1('0x1')];function createListener(_0x361548,_0xd3a5ce){return function(_0x5ccf2c){_0xd3a5ce[_0x2cf1('0x2')](_0x361548,_0x5ccf2c);};}function removeListener(_0x3553ec,_0x2c4bb6){return function(){UserVoiceQueueRtEvents[_0x2cf1('0x3')](_0x3553ec,_0x2c4bb6);};}exports[_0x2cf1('0x4')]=function(_0x2da534){for(var _0x445f40=0x0,_0x2bd9c3=events[_0x2cf1('0x5')];_0x445f40<_0x2bd9c3;_0x445f40++){var _0x592e36=events[_0x445f40];var _0x19588f=createListener(_0x2cf1('0x6')+_0x592e36,_0x2da534);UserVoiceQueueRtEvents['on'](_0x592e36,_0x19588f);}};
\ No newline at end of file
+var _0x39c7=['update','removeListener','userVoiceQueueRt:','save','remove'];(function(_0x524732,_0x23e9e1){var _0x4eacec=function(_0x6fd775){while(--_0x6fd775){_0x524732['push'](_0x524732['shift']());}};_0x4eacec(++_0x23e9e1);}(_0x39c7,0x85));var _0x739c=function(_0x283e40,_0x11487a){_0x283e40=_0x283e40-0x0;var _0x289686=_0x39c7[_0x283e40];return _0x289686;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x739c('0x0'),_0x739c('0x1'),_0x739c('0x2')];function createListener(_0x25fdf5,_0xfadce8){return function(_0x18d787){_0xfadce8['emit'](_0x25fdf5,_0x18d787);};}function removeListener(_0x11c0a6,_0xff8215){return function(){UserVoiceQueueRtEvents[_0x739c('0x3')](_0x11c0a6,_0xff8215);};}exports['register']=function(_0x4c5030){for(var _0x1923d9=0x0,_0x3c0af1=events['length'];_0x1923d9<_0x3c0af1;_0x1923d9++){var _0x480159=events[_0x1923d9];var _0x27c5a4=createListener(_0x739c('0x4')+_0x480159,_0x4c5030);UserVoiceQueueRtEvents['on'](_0x480159,_0x27c5a4);}};
\ No newline at end of file
index 64b2637..900fb60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x207417,_0x47db9e){var _0x507706=function(_0x12f6c5){while(--_0x12f6c5){_0x207417['push'](_0x207417['shift']());}};_0x507706(++_0x47db9e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xffcc03,_0x5d36fa){var _0xbb0a38=function(_0x1a7259){while(--_0x1a7259){_0xffcc03['push'](_0xffcc03['shift']());}};_0xbb0a38(++_0x5d36fa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 2295d49..0787881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc961=['exports','INTEGER','sequelize'];(function(_0x10c405,_0x3c4f40){var _0xcd2264=function(_0x1575fb){while(--_0x1575fb){_0x10c405['push'](_0x10c405['shift']());}};_0xcd2264(++_0x3c4f40);}(_0xc961,0xb3));var _0x1c96=function(_0x232d09,_0x30a518){_0x232d09=_0x232d09-0x0;var _0x454385=_0xc961[_0x232d09];return _0x454385;};'use strict';var Sequelize=require(_0x1c96('0x0'));module[_0x1c96('0x1')]={'penalty':{'type':Sequelize[_0x1c96('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6506=['sequelize'];(function(_0x254dd3,_0x2f6a1a){var _0x282b98=function(_0x28b21c){while(--_0x28b21c){_0x254dd3['push'](_0x254dd3['shift']());}};_0x282b98(++_0x2f6a1a);}(_0x6506,0xbc));var _0x6650=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x6506[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0x6650('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 792e728..f31f914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8318=['moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','user_has_whatsapp_queues','util','../../config/logger','api'];(function(_0x4f659b,_0x36d701){var _0x3869de=function(_0x91c364){while(--_0x91c364){_0x4f659b['push'](_0x4f659b['shift']());}};_0x3869de(++_0x36d701);}(_0x8318,0x1d6));var _0x8831=function(_0x245598,_0x952baa){_0x245598=_0x245598-0x0;var _0x477633=_0x8318[_0x245598];return _0x477633;};'use strict';var _=require('lodash');var util=require(_0x8831('0x0'));var logger=require(_0x8831('0x1'))(_0x8831('0x2'));var moment=require(_0x8831('0x3'));var BPromise=require(_0x8831('0x4'));var rp=require(_0x8831('0x5'));var fs=require('fs');var path=require(_0x8831('0x6'));var rimraf=require('rimraf');var config=require(_0x8831('0x7'));var attributes=require(_0x8831('0x8'));module[_0x8831('0x9')]=function(_0x572975,_0x5a6a46){return _0x572975['define']('UserWhatsappQueue',attributes,{'tableName':_0x8831('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fb4=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x4f8af0,_0x3baa04){var _0x22889f=function(_0x287a1f){while(--_0x287a1f){_0x4f8af0['push'](_0x4f8af0['shift']());}};_0x22889f(++_0x3baa04);}(_0x8fb4,0xb8));var _0x48fb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fb4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x48fb('0x0'));var util=require(_0x48fb('0x1'));var logger=require('../../config/logger')(_0x48fb('0x2'));var moment=require(_0x48fb('0x3'));var BPromise=require(_0x48fb('0x4'));var rp=require(_0x48fb('0x5'));var fs=require('fs');var path=require(_0x48fb('0x6'));var rimraf=require(_0x48fb('0x7'));var config=require(_0x48fb('0x8'));var attributes=require(_0x48fb('0x9'));module[_0x48fb('0xa')]=function(_0x4b7a1a,_0x152f73){return _0x4b7a1a['define'](_0x48fb('0xb'),attributes,{'tableName':_0x48fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df170eb..b73224d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6081=['jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x6081,0x8c));var _0x1608=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6081[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1608('0x0'));var util=require(_0x1608('0x1'));var moment=require(_0x1608('0x2'));var BPromise=require(_0x1608('0x3'));var rs=require(_0x1608('0x4'));var fs=require('fs');var Redis=require(_0x1608('0x5'));var db=require(_0x1608('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1608('0x7'))(_0x1608('0x8'));var config=require(_0x1608('0x9'));var jayson=require(_0x1608('0xa'));var client=jayson[_0x1608('0xb')][_0x1608('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b4b68,_0x43492e,_0x8da64f){return new BPromise(function(_0x181998,_0x201400){return client[_0x1608('0xd')](_0x1b4b68,_0x8da64f)[_0x1608('0xe')](function(_0x36e9e2){logger[_0x1608('0xf')](_0x1608('0x10'),_0x43492e,_0x1608('0x11'));logger[_0x1608('0x12')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x43492e,'request\x20sent',JSON[_0x1608('0x13')](_0x36e9e2));if(_0x36e9e2[_0x1608('0x14')]){if(_0x36e9e2[_0x1608('0x14')][_0x1608('0x15')]===0x1f4){logger[_0x1608('0x14')](_0x1608('0x10'),_0x43492e,_0x36e9e2[_0x1608('0x14')][_0x1608('0x16')]);return _0x201400(_0x36e9e2[_0x1608('0x14')][_0x1608('0x16')]);}logger[_0x1608('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x43492e,_0x36e9e2[_0x1608('0x14')][_0x1608('0x16')]);return _0x181998(_0x36e9e2['error'][_0x1608('0x16')]);}else{logger[_0x1608('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x43492e,_0x1608('0x11'));_0x181998(_0x36e9e2[_0x1608('0x17')][_0x1608('0x16')]);}})[_0x1608('0x18')](function(_0x123ace){logger[_0x1608('0x14')](_0x1608('0x10'),_0x43492e,_0x123ace);_0x201400(_0x123ace);});});}
\ No newline at end of file
+var _0x77a6=['message','result','catch','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c4137,_0x2d3fa0){var _0x5225d3=function(_0x2d2fb8){while(--_0x2d2fb8){_0x4c4137['push'](_0x4c4137['shift']());}};_0x5225d3(++_0x2d3fa0);}(_0x77a6,0x17d));var _0x677a=function(_0x15ea6a,_0x2d282f){_0x15ea6a=_0x15ea6a-0x0;var _0x4d4d12=_0x77a6[_0x15ea6a];return _0x4d4d12;};'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(_0x677a('0x0'));var db=require(_0x677a('0x1'))['db'];var utils=require(_0x677a('0x2'));var logger=require(_0x677a('0x3'))(_0x677a('0x4'));var config=require(_0x677a('0x5'));var jayson=require(_0x677a('0x6'));var client=jayson[_0x677a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4bfd,_0x3d5f21,_0x2cf108){return new BPromise(function(_0x852e30,_0x295884){return client[_0x677a('0x8')](_0x4f4bfd,_0x2cf108)[_0x677a('0x9')](function(_0x3eed09){logger[_0x677a('0xa')](_0x677a('0xb'),_0x3d5f21,_0x677a('0xc'));logger[_0x677a('0xd')](_0x677a('0xe'),_0x3d5f21,'request\x20sent',JSON[_0x677a('0xf')](_0x3eed09));if(_0x3eed09[_0x677a('0x10')]){if(_0x3eed09[_0x677a('0x10')][_0x677a('0x11')]===0x1f4){logger[_0x677a('0x10')](_0x677a('0xb'),_0x3d5f21,_0x3eed09[_0x677a('0x10')][_0x677a('0x12')]);return _0x295884(_0x3eed09['error']['message']);}logger[_0x677a('0x10')](_0x677a('0xb'),_0x3d5f21,_0x3eed09[_0x677a('0x10')][_0x677a('0x12')]);return _0x852e30(_0x3eed09['error'][_0x677a('0x12')]);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x3d5f21,'request\x20sent');_0x852e30(_0x3eed09[_0x677a('0x13')][_0x677a('0x12')]);}})[_0x677a('0x14')](function(_0x2b0424){logger['error'](_0x677a('0xb'),_0x3d5f21,_0x2b0424);_0x295884(_0x2b0424);});});}
\ No newline at end of file
index f9c4d1d..a21676b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2356=['put','/:id','delete','destroy','exports','util','path','Router','fs-extra','../../config/environment','isAuthenticated','index','get','post','create'];(function(_0x2b7d1f,_0xc3f972){var _0x445092=function(_0x2501bd){while(--_0x2501bd){_0x2b7d1f['push'](_0x2b7d1f['shift']());}};_0x445092(++_0xc3f972);}(_0x2356,0x14f));var _0x6235=function(_0x23e9af,_0x29c52c){_0x23e9af=_0x23e9af-0x0;var _0x2c4f8b=_0x2356[_0x23e9af];return _0x2c4f8b;};'use strict';var multer=require('multer');var util=require(_0x6235('0x0'));var path=require(_0x6235('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6235('0x2')]();var fs_extra=require(_0x6235('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6235('0x4'));var controller=require('./variable.controller');router['get']('/',auth[_0x6235('0x5')](),controller[_0x6235('0x6')]);router[_0x6235('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6235('0x8')]('/',auth['isAuthenticated'](),controller[_0x6235('0x9')]);router[_0x6235('0xa')](_0x6235('0xb'),auth[_0x6235('0x5')](),controller['update']);router[_0x6235('0xc')](_0x6235('0xb'),auth[_0x6235('0x5')](),controller[_0x6235('0xd')]);module[_0x6235('0xe')]=router;
\ No newline at end of file
+var _0x9bde=['index','/:id','isAuthenticated','show','post','create','put','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x44ab8f,_0x19754b){_0x44ab8f=_0x44ab8f-0x0;var _0x3cbf2c=_0x9bde[_0x44ab8f];return _0x3cbf2c;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0xd')]('/',auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')](_0xe9bd('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xe9bd('0x10')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller['destroy']);module[_0xe9bd('0x11')]=router;
\ No newline at end of file
index cabd2c7..211cfaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1340=['STRING','name','exports'];(function(_0x373e50,_0x488255){var _0x3ad132=function(_0x472058){while(--_0x472058){_0x373e50['push'](_0x373e50['shift']());}};_0x3ad132(++_0x488255);}(_0x1340,0x74));var _0x0134=function(_0x5a93cd,_0x1f528c){_0x5a93cd=_0x5a93cd-0x0;var _0x3b2698=_0x1340[_0x5a93cd];return _0x3b2698;};'use strict';var Sequelize=require('sequelize');module[_0x0134('0x0')]={'name':{'type':Sequelize[_0x0134('0x1')],'unique':_0x0134('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0134('0x1')]}};
\ No newline at end of file
+var _0x2dab=['sequelize','exports','STRING','name'];(function(_0x3abc9f,_0x49440e){var _0x486bc4=function(_0xc9a1a7){while(--_0xc9a1a7){_0x3abc9f['push'](_0x3abc9f['shift']());}};_0x486bc4(++_0x49440e);}(_0x2dab,0x120));var _0xb2da=function(_0x2293aa,_0x45a53f){_0x2293aa=_0x2293aa-0x0;var _0x22ebef=_0x2dab[_0x2293aa];return _0x22ebef;};'use strict';var Sequelize=require(_0xb2da('0x0'));module[_0xb2da('0x1')]={'name':{'type':Sequelize[_0xb2da('0x2')],'unique':_0xb2da('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb2da('0x2')]}};
\ No newline at end of file
index 83314c5..ca9111d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3fa=['UserProfileResource','then','error','stack','name','send','index','Variable','rawAttributes','fieldName','type','key','keys','filters','query','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','params','length','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','Variables'];(function(_0x2f71c1,_0x319017){var _0x411bb7=function(_0x4e69b5){while(--_0x4e69b5){_0x2f71c1['push'](_0x2f71c1['shift']());}};_0x411bb7(++_0x319017);}(_0xf3fa,0x7d));var _0xaf3f=function(_0x2f90c0,_0x5d162a){_0x2f90c0=_0x2f90c0-0x0;var _0x2e3552=_0xf3fa[_0x2f90c0];return _0x2e3552;};'use strict';var emlformat=require(_0xaf3f('0x0'));var rimraf=require(_0xaf3f('0x1'));var zipdir=require(_0xaf3f('0x2'));var jsonpatch=require(_0xaf3f('0x3'));var rp=require('request-promise');var moment=require(_0xaf3f('0x4'));var BPromise=require(_0xaf3f('0x5'));var Mustache=require(_0xaf3f('0x6'));var util=require(_0xaf3f('0x7'));var path=require(_0xaf3f('0x8'));var sox=require(_0xaf3f('0x9'));var csv=require('to-csv');var ejs=require(_0xaf3f('0xa'));var fs=require('fs');var fs_extra=require(_0xaf3f('0xb'));var _=require('lodash');var squel=require(_0xaf3f('0xc'));var crypto=require(_0xaf3f('0xd'));var jsforce=require(_0xaf3f('0xe'));var deskjs=require(_0xaf3f('0xf'));var toCsv=require(_0xaf3f('0x10'));var querystring=require('querystring');var Papa=require(_0xaf3f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaf3f('0x12'));var as=require(_0xaf3f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf3f('0x14'))(_0xaf3f('0x15'));var utils=require(_0xaf3f('0x16'));var config=require(_0xaf3f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xed48ed,_0x2fa292){_0x2fa292=_0x2fa292||0xcc;return function(_0x9c89e6){if(_0x9c89e6){return _0xed48ed[_0xaf3f('0x18')](_0x2fa292);}return _0xed48ed[_0xaf3f('0x19')](_0x2fa292)[_0xaf3f('0x1a')]();};}function respondWithResult(_0x3b32e6,_0x362ea1){_0x362ea1=_0x362ea1||0xc8;return function(_0x3fe362){if(_0x3fe362){return _0x3b32e6[_0xaf3f('0x19')](_0x362ea1)[_0xaf3f('0x1b')](_0x3fe362);}};}function respondWithFilteredResult(_0x1a10f0,_0x92e08a){return function(_0x21fe9b){if(_0x21fe9b){var _0x221ae4=typeof _0x92e08a[_0xaf3f('0x1c')]===_0xaf3f('0x1d')&&typeof _0x92e08a[_0xaf3f('0x1e')]===_0xaf3f('0x1d');var _0x556262=_0x21fe9b[_0xaf3f('0x1f')];var _0x3aa38e=_0x221ae4?0x0:_0x92e08a[_0xaf3f('0x1c')];var _0x304b61=_0x221ae4?_0x21fe9b[_0xaf3f('0x1f')]:_0x92e08a[_0xaf3f('0x1c')]+_0x92e08a['limit'];var _0x244bd3;if(_0x304b61>=_0x556262){_0x304b61=_0x556262;_0x244bd3=0xc8;}else{_0x244bd3=0xce;}_0x1a10f0[_0xaf3f('0x19')](_0x244bd3);return _0x1a10f0[_0xaf3f('0x20')](_0xaf3f('0x21'),_0x3aa38e+'-'+_0x304b61+'/'+_0x556262)[_0xaf3f('0x1b')](_0x21fe9b);}return null;};}function patchUpdates(_0x54c6d7){return function(_0x1f72ec){try{jsonpatch[_0xaf3f('0x22')](_0x1f72ec,_0x54c6d7,!![]);}catch(_0xe9c17b){return BPromise['reject'](_0xe9c17b);}return _0x1f72ec[_0xaf3f('0x23')]();};}function saveUpdates(_0xbabb0f,_0x1e2bd3){return function(_0x190f66){if(_0x190f66){return _0x190f66[_0xaf3f('0x24')](_0xbabb0f)['then'](function(_0x4faab2){return _0x4faab2;});}return null;};}function removeEntity(_0x3c0d44,_0x267856){return function(_0x5e5b7c){if(_0x5e5b7c){return _0x5e5b7c[_0xaf3f('0x25')]()['then'](function(){var _0x1fc890=_0x5e5b7c['get']({'plain':!![]});var _0x2134c5=_0xaf3f('0x26');return db[_0xaf3f('0x27')]['destroy']({'where':{'type':_0x2134c5,'resourceId':_0x1fc890['id']}})[_0xaf3f('0x28')](function(){return _0x5e5b7c;});})[_0xaf3f('0x28')](function(){_0x3c0d44[_0xaf3f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f625c,_0x1e7de3){return function(_0xb60453){if(!_0xb60453){_0x1f625c[_0xaf3f('0x18')](0x194);}return _0xb60453;};}function handleError(_0x1bde51,_0x148b85){_0x148b85=_0x148b85||0x1f4;return function(_0x54fb0d){logger[_0xaf3f('0x29')](_0x54fb0d[_0xaf3f('0x2a')]);if(_0x54fb0d[_0xaf3f('0x2b')]){delete _0x54fb0d[_0xaf3f('0x2b')];}_0x1bde51[_0xaf3f('0x19')](_0x148b85)[_0xaf3f('0x2c')](_0x54fb0d);};}exports[_0xaf3f('0x2d')]=function(_0x2960f4,_0x5aa47f){var _0x3c3481={},_0x490dac={},_0x16fe1c={'count':0x0,'rows':[]};var _0x40bc53=_['map'](db[_0xaf3f('0x2e')][_0xaf3f('0x2f')],function(_0x5ac23c){return{'name':_0x5ac23c[_0xaf3f('0x30')],'type':_0x5ac23c[_0xaf3f('0x31')][_0xaf3f('0x32')]};});_0x490dac['model']=_['map'](_0x40bc53,'name');_0x490dac['query']=_[_0xaf3f('0x33')](_0x2960f4['query']);_0x490dac[_0xaf3f('0x34')]=_['intersection'](_0x490dac['model'],_0x490dac[_0xaf3f('0x35')]);_0x3c3481['attributes']=_[_0xaf3f('0x36')](_0x490dac[_0xaf3f('0x37')],qs[_0xaf3f('0x38')](_0x2960f4[_0xaf3f('0x35')][_0xaf3f('0x38')]));_0x3c3481[_0xaf3f('0x39')]=_0x3c3481[_0xaf3f('0x39')]['length']?_0x3c3481[_0xaf3f('0x39')]:_0x490dac[_0xaf3f('0x37')];if(!_0x2960f4[_0xaf3f('0x35')][_0xaf3f('0x3a')]('nolimit')){_0x3c3481['limit']=qs[_0xaf3f('0x1e')](_0x2960f4[_0xaf3f('0x35')]['limit']);_0x3c3481[_0xaf3f('0x1c')]=qs[_0xaf3f('0x1c')](_0x2960f4['query'][_0xaf3f('0x1c')]);}_0x3c3481[_0xaf3f('0x3b')]=qs['sort'](_0x2960f4[_0xaf3f('0x35')][_0xaf3f('0x3c')]);_0x3c3481['where']=qs['filters'](_[_0xaf3f('0x3d')](_0x2960f4[_0xaf3f('0x35')],_0x490dac[_0xaf3f('0x34')]),_0x40bc53);if(_0x2960f4[_0xaf3f('0x35')][_0xaf3f('0x3e')]){_0x3c3481[_0xaf3f('0x3f')]=_[_0xaf3f('0x40')](_0x3c3481[_0xaf3f('0x3f')],{'$or':_['map'](_0x40bc53,function(_0x44fcc8){if(_0x44fcc8[_0xaf3f('0x31')]!==_0xaf3f('0x41')){var _0x356713={};_0x356713[_0x44fcc8['name']]={'$like':'%'+_0x2960f4[_0xaf3f('0x35')]['filter']+'%'};return _0x356713;}})});}_0x3c3481=_[_0xaf3f('0x40')]({},_0x3c3481,_0x2960f4[_0xaf3f('0x42')]);var _0x580c66={'where':_0x3c3481[_0xaf3f('0x3f')]};return db[_0xaf3f('0x2e')][_0xaf3f('0x1f')](_0x580c66)[_0xaf3f('0x28')](function(_0x45c92f){_0x16fe1c[_0xaf3f('0x1f')]=_0x45c92f;if(_0x2960f4[_0xaf3f('0x35')]['includeAll']){_0x3c3481['include']=[{'all':!![]}];}return db[_0xaf3f('0x2e')]['findAll'](_0x3c3481);})[_0xaf3f('0x28')](function(_0x122aed){_0x16fe1c[_0xaf3f('0x43')]=_0x122aed;return _0x16fe1c;})[_0xaf3f('0x28')](respondWithFilteredResult(_0x5aa47f,_0x3c3481))[_0xaf3f('0x44')](handleError(_0x5aa47f,null));};exports['show']=function(_0x411dda,_0x2d553f){var _0x4c96e3={'raw':!![],'where':{'id':_0x411dda[_0xaf3f('0x45')]['id']}},_0x4df4cb={};_0x4df4cb[_0xaf3f('0x37')]=_[_0xaf3f('0x33')](db[_0xaf3f('0x2e')]['rawAttributes']);_0x4df4cb[_0xaf3f('0x35')]=_[_0xaf3f('0x33')](_0x411dda['query']);_0x4df4cb[_0xaf3f('0x34')]=_['intersection'](_0x4df4cb['model'],_0x4df4cb['query']);_0x4c96e3[_0xaf3f('0x39')]=_[_0xaf3f('0x36')](_0x4df4cb[_0xaf3f('0x37')],qs[_0xaf3f('0x38')](_0x411dda[_0xaf3f('0x35')]['fields']));_0x4c96e3[_0xaf3f('0x39')]=_0x4c96e3[_0xaf3f('0x39')][_0xaf3f('0x46')]?_0x4c96e3['attributes']:_0x4df4cb[_0xaf3f('0x37')];if(_0x411dda[_0xaf3f('0x35')][_0xaf3f('0x47')]){_0x4c96e3[_0xaf3f('0x48')]=[{'all':!![]}];}_0x4c96e3=_[_0xaf3f('0x40')]({},_0x4c96e3,_0x411dda[_0xaf3f('0x42')]);return db[_0xaf3f('0x2e')][_0xaf3f('0x49')](_0x4c96e3)[_0xaf3f('0x28')](handleEntityNotFound(_0x2d553f,null))[_0xaf3f('0x28')](respondWithResult(_0x2d553f,null))[_0xaf3f('0x44')](handleError(_0x2d553f,null));};exports['create']=function(_0x5ac7f9,_0x4b522a){return db[_0xaf3f('0x2e')]['create'](_0x5ac7f9[_0xaf3f('0x4a')],{})[_0xaf3f('0x28')](function(_0x36c7f5){var _0x46ed2f=_0x5ac7f9[_0xaf3f('0x4b')]['get']({'plain':!![]});if(!_0x46ed2f)throw new Error(_0xaf3f('0x4c'));if(_0x46ed2f['role']===_0xaf3f('0x4b')){var _0x22e41c=_0x36c7f5[_0xaf3f('0x4d')]({'plain':!![]});var _0x49a450=_0xaf3f('0x26');return db[_0xaf3f('0x4e')][_0xaf3f('0x49')]({'where':{'name':_0x49a450,'userProfileId':_0x46ed2f[_0xaf3f('0x4f')]},'raw':!![]})[_0xaf3f('0x28')](function(_0x137e37){if(_0x137e37&&_0x137e37[_0xaf3f('0x50')]===0x0){return db[_0xaf3f('0x27')]['create']({'name':_0x22e41c[_0xaf3f('0x2b')],'resourceId':_0x22e41c['id'],'type':_0x137e37[_0xaf3f('0x2b')],'sectionId':_0x137e37['id']},{})['then'](function(){return _0x36c7f5;});}else{return _0x36c7f5;}})[_0xaf3f('0x44')](function(_0x57aec3){logger[_0xaf3f('0x29')](_0xaf3f('0x51'),_0x57aec3);throw _0x57aec3;});}return _0x36c7f5;})['then'](respondWithResult(_0x4b522a,0xc9))['catch'](handleError(_0x4b522a,null));};exports['update']=function(_0x159273,_0x10d784){if(_0x159273[_0xaf3f('0x4a')]['id']){delete _0x159273['body']['id'];}return db['Variable'][_0xaf3f('0x49')]({'where':{'id':_0x159273[_0xaf3f('0x45')]['id']}})[_0xaf3f('0x28')](handleEntityNotFound(_0x10d784,null))[_0xaf3f('0x28')](saveUpdates(_0x159273['body'],null))[_0xaf3f('0x28')](respondWithResult(_0x10d784,null))[_0xaf3f('0x44')](handleError(_0x10d784,null));};exports['destroy']=function(_0x5a7d13,_0x5be826){return db['Variable'][_0xaf3f('0x49')]({'where':{'id':_0x5a7d13[_0xaf3f('0x45')]['id']}})[_0xaf3f('0x28')](handleEntityNotFound(_0x5be826,null))['then'](removeEntity(_0x5be826,null))[_0xaf3f('0x44')](handleError(_0x5be826,null));};
\ No newline at end of file
+var _0x3a3d=['squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','count','offset','status','set','Content-Range','apply','reject','save','then','destroy','Variables','UserProfileResource','end','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','intersection','length','includeAll','find','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','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x365751,_0x29a147){var _0x4e5991=function(_0x3178e2){while(--_0x3178e2){_0x365751['push'](_0x365751['shift']());}};_0x4e5991(++_0x29a147);}(_0x3a3d,0xa4));var _0xd3a3=function(_0x4ca7da,_0x173924){_0x4ca7da=_0x4ca7da-0x0;var _0x3e0238=_0x3a3d[_0x4ca7da];return _0x3e0238;};'use strict';var emlformat=require(_0xd3a3('0x0'));var rimraf=require(_0xd3a3('0x1'));var zipdir=require(_0xd3a3('0x2'));var jsonpatch=require(_0xd3a3('0x3'));var rp=require('request-promise');var moment=require(_0xd3a3('0x4'));var BPromise=require(_0xd3a3('0x5'));var Mustache=require(_0xd3a3('0x6'));var util=require(_0xd3a3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd3a3('0x8'));var ejs=require(_0xd3a3('0x9'));var fs=require('fs');var fs_extra=require(_0xd3a3('0xa'));var _=require(_0xd3a3('0xb'));var squel=require(_0xd3a3('0xc'));var crypto=require(_0xd3a3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd3a3('0xe'));var toCsv=require(_0xd3a3('0x8'));var querystring=require(_0xd3a3('0xf'));var Papa=require(_0xd3a3('0x10'));var Redis=require('ioredis');var authService=require(_0xd3a3('0x11'));var qs=require(_0xd3a3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3a3('0x13'));var logger=require('../../config/logger')(_0xd3a3('0x14'));var utils=require(_0xd3a3('0x15'));var config=require(_0xd3a3('0x16'));var licenseUtil=require(_0xd3a3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4128,_0x380eec){_0x380eec=_0x380eec||0xcc;return function(_0x2cf1b4){if(_0x2cf1b4){return _0x3c4128[_0xd3a3('0x18')](_0x380eec);}return _0x3c4128['status'](_0x380eec)['end']();};}function respondWithResult(_0x485ebc,_0x384d92){_0x384d92=_0x384d92||0xc8;return function(_0x312645){if(_0x312645){return _0x485ebc['status'](_0x384d92)[_0xd3a3('0x19')](_0x312645);}};}function respondWithFilteredResult(_0x492e28,_0x1f2898){return function(_0x5e4c5c){if(_0x5e4c5c){var _0x649c9e=typeof _0x1f2898['offset']==='undefined'&&typeof _0x1f2898['limit']==='undefined';var _0x43bd52=_0x5e4c5c[_0xd3a3('0x1a')];var _0x377f80=_0x649c9e?0x0:_0x1f2898[_0xd3a3('0x1b')];var _0x53d8f6=_0x649c9e?_0x5e4c5c[_0xd3a3('0x1a')]:_0x1f2898[_0xd3a3('0x1b')]+_0x1f2898['limit'];var _0x2a8a27;if(_0x53d8f6>=_0x43bd52){_0x53d8f6=_0x43bd52;_0x2a8a27=0xc8;}else{_0x2a8a27=0xce;}_0x492e28[_0xd3a3('0x1c')](_0x2a8a27);return _0x492e28[_0xd3a3('0x1d')](_0xd3a3('0x1e'),_0x377f80+'-'+_0x53d8f6+'/'+_0x43bd52)['json'](_0x5e4c5c);}return null;};}function patchUpdates(_0x324ea7){return function(_0x374a07){try{jsonpatch[_0xd3a3('0x1f')](_0x374a07,_0x324ea7,!![]);}catch(_0x4535cf){return BPromise[_0xd3a3('0x20')](_0x4535cf);}return _0x374a07[_0xd3a3('0x21')]();};}function saveUpdates(_0x5af292,_0x856732){return function(_0x2d0117){if(_0x2d0117){return _0x2d0117['update'](_0x5af292)[_0xd3a3('0x22')](function(_0x378ae8){return _0x378ae8;});}return null;};}function removeEntity(_0x3d9a3e,_0x2da141){return function(_0x518eb9){if(_0x518eb9){return _0x518eb9[_0xd3a3('0x23')]()['then'](function(){var _0x2013aa=_0x518eb9['get']({'plain':!![]});var _0x9c3bdc=_0xd3a3('0x24');return db[_0xd3a3('0x25')]['destroy']({'where':{'type':_0x9c3bdc,'resourceId':_0x2013aa['id']}})[_0xd3a3('0x22')](function(){return _0x518eb9;});})['then'](function(){_0x3d9a3e[_0xd3a3('0x1c')](0xcc)[_0xd3a3('0x26')]();});}};}function handleEntityNotFound(_0x4bc446,_0x170953){return function(_0x220d1c){if(!_0x220d1c){_0x4bc446['sendStatus'](0x194);}return _0x220d1c;};}function handleError(_0x54a54d,_0x539eb8){_0x539eb8=_0x539eb8||0x1f4;return function(_0x5b4653){logger['error'](_0x5b4653[_0xd3a3('0x27')]);if(_0x5b4653['name']){delete _0x5b4653[_0xd3a3('0x28')];}_0x54a54d['status'](_0x539eb8)[_0xd3a3('0x29')](_0x5b4653);};}exports[_0xd3a3('0x2a')]=function(_0x26e28a,_0x6d3444){var _0x5af0a7={},_0x34bc94={},_0x1df287={'count':0x0,'rows':[]};var _0x4b7482=_[_0xd3a3('0x2b')](db[_0xd3a3('0x2c')][_0xd3a3('0x2d')],function(_0x1e497e){return{'name':_0x1e497e[_0xd3a3('0x2e')],'type':_0x1e497e[_0xd3a3('0x2f')][_0xd3a3('0x30')]};});_0x34bc94[_0xd3a3('0x31')]=_['map'](_0x4b7482,'name');_0x34bc94[_0xd3a3('0x32')]=_['keys'](_0x26e28a[_0xd3a3('0x32')]);_0x34bc94[_0xd3a3('0x33')]=_['intersection'](_0x34bc94[_0xd3a3('0x31')],_0x34bc94[_0xd3a3('0x32')]);_0x5af0a7[_0xd3a3('0x34')]=_['intersection'](_0x34bc94[_0xd3a3('0x31')],qs[_0xd3a3('0x35')](_0x26e28a[_0xd3a3('0x32')][_0xd3a3('0x35')]));_0x5af0a7[_0xd3a3('0x34')]=_0x5af0a7[_0xd3a3('0x34')]['length']?_0x5af0a7['attributes']:_0x34bc94[_0xd3a3('0x31')];if(!_0x26e28a[_0xd3a3('0x32')][_0xd3a3('0x36')](_0xd3a3('0x37'))){_0x5af0a7[_0xd3a3('0x38')]=qs['limit'](_0x26e28a['query'][_0xd3a3('0x38')]);_0x5af0a7[_0xd3a3('0x1b')]=qs[_0xd3a3('0x1b')](_0x26e28a[_0xd3a3('0x32')]['offset']);}_0x5af0a7[_0xd3a3('0x39')]=qs[_0xd3a3('0x3a')](_0x26e28a[_0xd3a3('0x32')]['sort']);_0x5af0a7['where']=qs[_0xd3a3('0x33')](_[_0xd3a3('0x3b')](_0x26e28a[_0xd3a3('0x32')],_0x34bc94['filters']),_0x4b7482);if(_0x26e28a['query'][_0xd3a3('0x3c')]){_0x5af0a7[_0xd3a3('0x3d')]=_[_0xd3a3('0x3e')](_0x5af0a7[_0xd3a3('0x3d')],{'$or':_[_0xd3a3('0x2b')](_0x4b7482,function(_0x1944b9){if(_0x1944b9[_0xd3a3('0x2f')]!==_0xd3a3('0x3f')){var _0x502981={};_0x502981[_0x1944b9[_0xd3a3('0x28')]]={'$like':'%'+_0x26e28a['query'][_0xd3a3('0x3c')]+'%'};return _0x502981;}})});}_0x5af0a7=_[_0xd3a3('0x3e')]({},_0x5af0a7,_0x26e28a[_0xd3a3('0x40')]);var _0x1accc8={'where':_0x5af0a7[_0xd3a3('0x3d')]};return db[_0xd3a3('0x2c')][_0xd3a3('0x1a')](_0x1accc8)[_0xd3a3('0x22')](function(_0x3a5207){_0x1df287['count']=_0x3a5207;if(_0x26e28a[_0xd3a3('0x32')]['includeAll']){_0x5af0a7[_0xd3a3('0x41')]=[{'all':!![]}];}return db[_0xd3a3('0x2c')][_0xd3a3('0x42')](_0x5af0a7);})[_0xd3a3('0x22')](function(_0x4c16d9){_0x1df287[_0xd3a3('0x43')]=_0x4c16d9;return _0x1df287;})[_0xd3a3('0x22')](respondWithFilteredResult(_0x6d3444,_0x5af0a7))[_0xd3a3('0x44')](handleError(_0x6d3444,null));};exports[_0xd3a3('0x45')]=function(_0x51a827,_0x357140){var _0x69b58b={'raw':!![],'where':{'id':_0x51a827['params']['id']}},_0x21917d={};_0x21917d[_0xd3a3('0x31')]=_[_0xd3a3('0x46')](db[_0xd3a3('0x2c')][_0xd3a3('0x2d')]);_0x21917d[_0xd3a3('0x32')]=_[_0xd3a3('0x46')](_0x51a827[_0xd3a3('0x32')]);_0x21917d['filters']=_[_0xd3a3('0x47')](_0x21917d[_0xd3a3('0x31')],_0x21917d[_0xd3a3('0x32')]);_0x69b58b[_0xd3a3('0x34')]=_[_0xd3a3('0x47')](_0x21917d[_0xd3a3('0x31')],qs[_0xd3a3('0x35')](_0x51a827[_0xd3a3('0x32')][_0xd3a3('0x35')]));_0x69b58b[_0xd3a3('0x34')]=_0x69b58b[_0xd3a3('0x34')][_0xd3a3('0x48')]?_0x69b58b['attributes']:_0x21917d['model'];if(_0x51a827['query'][_0xd3a3('0x49')]){_0x69b58b[_0xd3a3('0x41')]=[{'all':!![]}];}_0x69b58b=_[_0xd3a3('0x3e')]({},_0x69b58b,_0x51a827[_0xd3a3('0x40')]);return db[_0xd3a3('0x2c')][_0xd3a3('0x4a')](_0x69b58b)[_0xd3a3('0x22')](handleEntityNotFound(_0x357140,null))['then'](respondWithResult(_0x357140,null))['catch'](handleError(_0x357140,null));};exports[_0xd3a3('0x4b')]=function(_0x4f3b94,_0x3b573b){return db[_0xd3a3('0x2c')]['create'](_0x4f3b94[_0xd3a3('0x4c')],{})[_0xd3a3('0x22')](function(_0x8d7310){var _0x1c5030=_0x4f3b94[_0xd3a3('0x4d')][_0xd3a3('0x4e')]({'plain':!![]});if(!_0x1c5030)throw new Error(_0xd3a3('0x4f'));if(_0x1c5030[_0xd3a3('0x50')]===_0xd3a3('0x4d')){var _0xea371c=_0x8d7310[_0xd3a3('0x4e')]({'plain':!![]});var _0x401230=_0xd3a3('0x24');return db[_0xd3a3('0x51')]['find']({'where':{'name':_0x401230,'userProfileId':_0x1c5030[_0xd3a3('0x52')]},'raw':!![]})[_0xd3a3('0x22')](function(_0x1c6441){if(_0x1c6441&&_0x1c6441[_0xd3a3('0x53')]===0x0){return db[_0xd3a3('0x25')][_0xd3a3('0x4b')]({'name':_0xea371c[_0xd3a3('0x28')],'resourceId':_0xea371c['id'],'type':_0x1c6441['name'],'sectionId':_0x1c6441['id']},{})[_0xd3a3('0x22')](function(){return _0x8d7310;});}else{return _0x8d7310;}})[_0xd3a3('0x44')](function(_0x1f7980){logger[_0xd3a3('0x54')](_0xd3a3('0x55'),_0x1f7980);throw _0x1f7980;});}return _0x8d7310;})[_0xd3a3('0x22')](respondWithResult(_0x3b573b,0xc9))[_0xd3a3('0x44')](handleError(_0x3b573b,null));};exports[_0xd3a3('0x56')]=function(_0x23e74e,_0x38e9a1){if(_0x23e74e[_0xd3a3('0x4c')]['id']){delete _0x23e74e[_0xd3a3('0x4c')]['id'];}return db[_0xd3a3('0x2c')]['find']({'where':{'id':_0x23e74e['params']['id']}})[_0xd3a3('0x22')](handleEntityNotFound(_0x38e9a1,null))[_0xd3a3('0x22')](saveUpdates(_0x23e74e['body'],null))[_0xd3a3('0x22')](respondWithResult(_0x38e9a1,null))[_0xd3a3('0x44')](handleError(_0x38e9a1,null));};exports['destroy']=function(_0x3cece1,_0x5b23c5){return db[_0xd3a3('0x2c')][_0xd3a3('0x4a')]({'where':{'id':_0x3cece1[_0xd3a3('0x57')]['id']}})[_0xd3a3('0x22')](handleEntityNotFound(_0x5b23c5,null))['then'](removeEntity(_0x5b23c5,null))[_0xd3a3('0x44')](handleError(_0x5b23c5,null));};
\ No newline at end of file
index bd46bab..97fab3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2d7=['tools_variables','lodash','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x506ebc,_0x2edf81){var _0x122744=function(_0x45b183){while(--_0x45b183){_0x506ebc['push'](_0x506ebc['shift']());}};_0x122744(++_0x2edf81);}(_0xb2d7,0x97));var _0x7b2d=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0xb2d7[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require(_0x7b2d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7b2d('0x1'));var moment=require(_0x7b2d('0x2'));var BPromise=require(_0x7b2d('0x3'));var rp=require(_0x7b2d('0x4'));var fs=require('fs');var path=require(_0x7b2d('0x5'));var rimraf=require(_0x7b2d('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x7b2d('0x7')]=function(_0x26901f,_0x1177d1){return _0x26901f[_0x7b2d('0x8')]('Variable',attributes,{'tableName':_0x7b2d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16c0=['define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x3012fb,_0x25830){var _0x3fd776=function(_0x32109a){while(--_0x32109a){_0x3012fb['push'](_0x3012fb['shift']());}};_0x3fd776(++_0x25830);}(_0x16c0,0x12e));var _0x016c=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x16c0[_0x218ca4];return _0x1b3ff9;};'use strict';var _=require(_0x016c('0x0'));var util=require('util');var logger=require(_0x016c('0x1'))(_0x016c('0x2'));var moment=require(_0x016c('0x3'));var BPromise=require(_0x016c('0x4'));var rp=require(_0x016c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x016c('0x6'));var config=require(_0x016c('0x7'));var attributes=require(_0x016c('0x8'));module[_0x016c('0x9')]=function(_0x9f138,_0x37562e){return _0x9f138[_0x016c('0xa')](_0x016c('0xb'),attributes,{'tableName':_0x016c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3f2b5ca..cbed143 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xa41a,0x6b));var _0xaa41=function(_0x32b15e,_0x5d7cfa){_0x32b15e=_0x32b15e-0x0;var _0xc7b3f3=_0xa41a[_0x32b15e];return _0xc7b3f3;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});};
\ No newline at end of file
+var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x133f2b,_0x16889b){var _0xf84d03=function(_0x2b117a){while(--_0x2b117a){_0x133f2b['push'](_0x133f2b['shift']());}};_0xf84d03(++_0x16889b);}(_0x7217,0x19e));var _0x7721=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x7217[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});};
\ No newline at end of file
index 6e3eac4..3f582c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f50=['canUpdate','get','/reset','reset','/pull','pull','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','/fetch','isAuthenticated'];(function(_0x21a077,_0x3608e6){var _0x371e77=function(_0x3de470){while(--_0x3de470){_0x21a077['push'](_0x21a077['shift']());}};_0x371e77(++_0x3608e6);}(_0x7f50,0x109));var _0x07f5=function(_0x11e3d1,_0x1dee24){_0x11e3d1=_0x11e3d1-0x0;var _0x40e9d3=_0x7f50[_0x11e3d1];return _0x40e9d3;};'use strict';var express=require(_0x07f5('0x0'));var router=express['Router']();var auth=require(_0x07f5('0x1'));var controller=require(_0x07f5('0x2'));router['get']('/',controller['index']);router['get'](_0x07f5('0x3'),auth[_0x07f5('0x4')](),auth[_0x07f5('0x5')](),controller['fetch']);router[_0x07f5('0x6')](_0x07f5('0x7'),auth['isAuthenticated'](),auth[_0x07f5('0x5')](),controller[_0x07f5('0x8')]);router['get'](_0x07f5('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x07f5('0xa')]);router[_0x07f5('0x6')]('/restart',auth['isAuthenticated'](),controller[_0x07f5('0xb')]);router['get'](_0x07f5('0xc'),controller[_0x07f5('0xd')]);module[_0x07f5('0xe')]=router;
\ No newline at end of file
+var _0xa77e=['isAuthenticated','canUpdate','/pull','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','index','get','/fetch'];(function(_0x44a284,_0x58449f){var _0x1a03f2=function(_0x45f2e6){while(--_0x45f2e6){_0x44a284['push'](_0x44a284['shift']());}};_0x1a03f2(++_0x58449f);}(_0xa77e,0xf6));var _0xea77=function(_0x1e610c,_0x419c79){_0x1e610c=_0x1e610c-0x0;var _0x45b1d3=_0xa77e[_0x1e610c];return _0x45b1d3;};'use strict';var express=require(_0xea77('0x0'));var router=express['Router']();var auth=require(_0xea77('0x1'));var controller=require(_0xea77('0x2'));router['get']('/',controller[_0xea77('0x3')]);router[_0xea77('0x4')](_0xea77('0x5'),auth[_0xea77('0x6')](),auth['canUpdate'](),controller['fetch']);router[_0xea77('0x4')]('/reset',auth[_0xea77('0x6')](),auth[_0xea77('0x7')](),controller['reset']);router[_0xea77('0x4')](_0xea77('0x8'),auth[_0xea77('0x6')](),auth[_0xea77('0x7')](),controller['pull']);router['get']('/restart',auth[_0xea77('0x6')](),controller['restart']);router[_0xea77('0x4')](_0xea77('0x9'),controller[_0xea77('0xa')]);module[_0xea77('0xb')]=router;
\ No newline at end of file
index 896a16e..529cc94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a84=['join','server','migrations','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','catch','UniqueConstraintError','umzug','lodash','version','compare-versions','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','query','latest','fetch','exports','2.0.0','status','json','origin','master','info','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync'];(function(_0x5ed1cd,_0x24630b){var _0x5133a6=function(_0x394661){while(--_0x394661){_0x5ed1cd['push'](_0x5ed1cd['shift']());}};_0x5133a6(++_0x24630b);}(_0x6a84,0xe6));var _0x46a8=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x6a84[_0x5608a3];return _0x1ed50a;};'use strict';var Umzug=require(_0x46a8('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x46a8('0x1'));var pkginfo=require('pkginfo')(module,_0x46a8('0x2'));var compareVersions=require(_0x46a8('0x3'));var exec=require('child_process')[_0x46a8('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x46a8('0x5'));var pm2=require(_0x46a8('0x6'));var logger=require(_0x46a8('0x7'))(_0x46a8('0x8'));var git=require(_0x46a8('0x9'))(config[_0x46a8('0xa')]);exports[_0x46a8('0xb')]=function(_0x382ab6,_0xcd1eaf){var _0x393265={'current':module['exports'][_0x46a8('0x2')],'phonebar':0x2};if(_0x382ab6[_0x46a8('0xc')]&&_0x382ab6['query'][_0x46a8('0xd')]){return git[_0x46a8('0xe')]()['tags'](function(_0x59f0e9,_0xc5cc71){_0x393265[_0x46a8('0xd')]=(_0x59f0e9?module[_0x46a8('0xf')][_0x46a8('0x2')]:_0xc5cc71[_0x46a8('0xd')])||_0x46a8('0x10');return _0xcd1eaf[_0x46a8('0x11')](0xc8)['json'](_0x393265);});}else{return _0xcd1eaf['status'](0xc8)[_0x46a8('0x12')](_0x393265);}};exports[_0x46a8('0xe')]=function(_0x53fd8f,_0x1036cb){return git[_0x46a8('0xe')]([_0x46a8('0x13'),_0x46a8('0x14')],function(_0x47b805){if(_0x47b805){logger['error'](_0x47b805);return _0x1036cb[_0x46a8('0x11')](0x1f4)[_0x46a8('0x12')](_0x47b805);}logger[_0x46a8('0x15')]('git\x20fetch');return _0x1036cb[_0x46a8('0x11')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x46a8('0x16')]=function(_0x5718c7,_0x340f2c){return git[_0x46a8('0x16')]([_0x46a8('0x17'),_0x46a8('0x18')],function(_0x172909){if(_0x172909){logger[_0x46a8('0x19')](_0x172909);return _0x340f2c[_0x46a8('0x11')](0x1f4)[_0x46a8('0x12')](_0x172909);}logger[_0x46a8('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x340f2c[_0x46a8('0x11')](0xc8)[_0x46a8('0x12')]({'output':_0x46a8('0x1a')});});};exports[_0x46a8('0x1b')]=function(_0x28eeb8,_0x2ebd31){exec(_0x46a8('0x1c'),function(_0x322305,_0x2a22ce,_0x4963bb){logger[_0x46a8('0x15')](_0x2a22ce);logger['info'](_0x4963bb);if(_0x322305){logger[_0x46a8('0x19')](_0x322305);return _0x2ebd31[_0x46a8('0x11')](0x1f4)[_0x46a8('0x12')](_0x322305);}return _0x2ebd31[_0x46a8('0x11')](0xc8)[_0x46a8('0x12')]({'output':_0x2a22ce});});};exports[_0x46a8('0x1d')]=function(_0x2d2d0e,_0x266c7d){return pm2[_0x46a8('0x1d')](_0x46a8('0x1e'))[_0x46a8('0x1f')](function(_0x29f486){logger[_0x46a8('0x15')](_0x46a8('0x20'),_0x29f486);return _0x266c7d[_0x46a8('0x11')](0xc8)['json']({'output':_0x46a8('0x21')});})['catch'](function(_0x1337f5){logger[_0x46a8('0x19')](_0x1337f5);return _0x266c7d[_0x46a8('0x11')](0x1f4)[_0x46a8('0x12')](_0x1337f5);});};exports['migrations']=function(_0x4fe9df,_0x1604b1){var _0x27603d=fs[_0x46a8('0x22')](path[_0x46a8('0x23')](config[_0x46a8('0xa')],_0x46a8('0x24'),_0x46a8('0x25')));var _0xbf3552=[];for(var _0x484fb6=0x0;_0x484fb6<_0x27603d['length'];_0x484fb6++){var _0x216fa5=_0x27603d[_0x484fb6][_0x46a8('0x26')](_0x46a8('0x27'),'');if(compareVersions(module['exports'][_0x46a8('0x2')],_0x216fa5)===-0x1){_0xbf3552[_0x46a8('0x28')](_0x216fa5);}}if(_0xbf3552[_0x46a8('0x29')]){var _0x1ae9b0=_0xbf3552[_0x46a8('0x2a')](compareVersions);var _0x48e4ed=new Umzug({'storage':_0x46a8('0x2b'),'storageOptions':{'model':db[_0x46a8('0x2c')],'modelName':_0x46a8('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x46a8('0x2b')][_0x46a8('0x2d')](),db[_0x46a8('0x2b')][_0x46a8('0x2e')],function(){throw new Error(_0x46a8('0x2f'));}],'path':path[_0x46a8('0x23')](config[_0x46a8('0xa')],_0x46a8('0x24'),_0x46a8('0x25')),'pattern':/\.js$/}});_0x48e4ed['up']({'migrations':_[_0x46a8('0x30')](_0x1ae9b0,function(_0x551445){return _0x551445+'.js';})})[_0x46a8('0x1f')](function(){return _0x1604b1['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x46a8('0xf')][_0x46a8('0x2')]+_0x46a8('0x31')+_[_0x46a8('0x32')](_0x1ae9b0),'migrations':_['join'](_0x1ae9b0)});})[_0x46a8('0x33')](function(_0x49baf4){if(_0x49baf4 instanceof db[_0x46a8('0x2b')][_0x46a8('0x34')]){return _0x1604b1[_0x46a8('0x11')](0xc8)[_0x46a8('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x1604b1['status'](0x1f4)[_0x46a8('0x12')](_0x49baf4);}});}else{return _0x1604b1[_0x46a8('0x11')](0xc8)[_0x46a8('0x12')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
+var _0x68db=['json','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','error','restart','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','root','index','exports','latest','fetch','tags','status'];(function(_0x306b51,_0x16db9b){var _0x410982=function(_0x3b5ae3){while(--_0x3b5ae3){_0x306b51['push'](_0x306b51['shift']());}};_0x410982(++_0x16db9b);}(_0x68db,0xdb));var _0xb68d=function(_0x2690aa,_0x8ed922){_0x2690aa=_0x2690aa-0x0;var _0x307fea=_0x68db[_0x2690aa];return _0x307fea;};'use strict';var Umzug=require(_0xb68d('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xb68d('0x1'));var pkginfo=require('pkginfo')(module,_0xb68d('0x2'));var compareVersions=require(_0xb68d('0x3'));var exec=require(_0xb68d('0x4'))[_0xb68d('0x5')];var db=require(_0xb68d('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xb68d('0x7'));var logger=require(_0xb68d('0x8'))('update');var git=require('simple-git')(config[_0xb68d('0x9')]);exports[_0xb68d('0xa')]=function(_0x59552b,_0x1676e8){var _0xb801c0={'current':module[_0xb68d('0xb')][_0xb68d('0x2')],'phonebar':0x2};if(_0x59552b['query']&&_0x59552b['query'][_0xb68d('0xc')]){return git[_0xb68d('0xd')]()[_0xb68d('0xe')](function(_0x9dd3a1,_0x31ebe2){_0xb801c0[_0xb68d('0xc')]=(_0x9dd3a1?module[_0xb68d('0xb')][_0xb68d('0x2')]:_0x31ebe2[_0xb68d('0xc')])||'2.0.0';return _0x1676e8[_0xb68d('0xf')](0xc8)[_0xb68d('0x10')](_0xb801c0);});}else{return _0x1676e8['status'](0xc8)[_0xb68d('0x10')](_0xb801c0);}};exports[_0xb68d('0xd')]=function(_0x111256,_0x16b3c7){return git[_0xb68d('0xd')]([_0xb68d('0x11'),_0xb68d('0x12')],function(_0x514e91){if(_0x514e91){logger['error'](_0x514e91);return _0x16b3c7[_0xb68d('0xf')](0x1f4)[_0xb68d('0x10')](_0x514e91);}logger[_0xb68d('0x13')](_0xb68d('0x14'));return _0x16b3c7[_0xb68d('0xf')](0xc8)[_0xb68d('0x10')]({'output':_0xb68d('0x15')});});};exports[_0xb68d('0x16')]=function(_0x2f8687,_0x428d61){return git[_0xb68d('0x16')]([_0xb68d('0x17'),_0xb68d('0x18')],function(_0xbc6f3){if(_0xbc6f3){logger['error'](_0xbc6f3);return _0x428d61[_0xb68d('0xf')](0x1f4)['json'](_0xbc6f3);}logger[_0xb68d('0x13')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x428d61[_0xb68d('0xf')](0xc8)[_0xb68d('0x10')]({'output':'git\x20reset\x20--hard'});});};exports[_0xb68d('0x19')]=function(_0x421bd6,_0x2704a2){exec(_0xb68d('0x1a'),function(_0x30fd2e,_0x2f2e1b,_0x23d129){logger[_0xb68d('0x13')](_0x2f2e1b);logger[_0xb68d('0x13')](_0x23d129);if(_0x30fd2e){logger[_0xb68d('0x1b')](_0x30fd2e);return _0x2704a2[_0xb68d('0xf')](0x1f4)[_0xb68d('0x10')](_0x30fd2e);}return _0x2704a2['status'](0xc8)[_0xb68d('0x10')]({'output':_0x2f2e1b});});};exports[_0xb68d('0x1c')]=function(_0xbc823e,_0x6ec7){return pm2[_0xb68d('0x1c')]('motion2')['then'](function(_0x2b9a67){logger[_0xb68d('0x13')]('pm2\x20restart\x20motion\x20%s',_0x2b9a67);return _0x6ec7['status'](0xc8)[_0xb68d('0x10')]({'output':_0xb68d('0x1d')});})[_0xb68d('0x1e')](function(_0xc6228a){logger[_0xb68d('0x1b')](_0xc6228a);return _0x6ec7[_0xb68d('0xf')](0x1f4)[_0xb68d('0x10')](_0xc6228a);});};exports[_0xb68d('0x1f')]=function(_0x44bba9,_0x46236d){var _0x3e5a26=fs[_0xb68d('0x20')](path['join'](config[_0xb68d('0x9')],_0xb68d('0x21'),_0xb68d('0x1f')));var _0xbae8bc=[];for(var _0x52eb86=0x0;_0x52eb86<_0x3e5a26[_0xb68d('0x22')];_0x52eb86++){var _0x374b37=_0x3e5a26[_0x52eb86]['replace'](_0xb68d('0x23'),'');if(compareVersions(module[_0xb68d('0xb')][_0xb68d('0x2')],_0x374b37)===-0x1){_0xbae8bc[_0xb68d('0x24')](_0x374b37);}}if(_0xbae8bc[_0xb68d('0x22')]){var _0x205ee5=_0xbae8bc[_0xb68d('0x25')](compareVersions);var _0x1c8a18=new Umzug({'storage':_0xb68d('0x26'),'storageOptions':{'model':db[_0xb68d('0x27')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xb68d('0x26')][_0xb68d('0x28')](),db[_0xb68d('0x26')]['constructor'],function(){throw new Error(_0xb68d('0x29'));}],'path':path[_0xb68d('0x2a')](config[_0xb68d('0x9')],'server',_0xb68d('0x1f')),'pattern':/\.js$/}});_0x1c8a18['up']({'migrations':_[_0xb68d('0x2b')](_0x205ee5,function(_0x86560a){return _0x86560a+_0xb68d('0x23');})})['then'](function(){return _0x46236d[_0xb68d('0xf')](0xc8)[_0xb68d('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xb68d('0xb')][_0xb68d('0x2')]+_0xb68d('0x2c')+_['last'](_0x205ee5),'migrations':_['join'](_0x205ee5)});})[_0xb68d('0x1e')](function(_0x491ff9){if(_0x491ff9 instanceof db['sequelize'][_0xb68d('0x2d')]){return _0x46236d[_0xb68d('0xf')](0xc8)[_0xb68d('0x10')]({'output':_0xb68d('0x2e')});}else{return _0x46236d[_0xb68d('0xf')](0x1f4)['json'](_0x491ff9);}});}else{return _0x46236d[_0xb68d('0xf')](0xc8)['json']({'output':_0xb68d('0x2e')});}};
\ No newline at end of file
index dd2a652..acc2782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf06=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','fs-extra','./voiceAgentReport.controller','isAuthenticated','index','get'];(function(_0x59f452,_0xd1b3fc){var _0x56b671=function(_0x3ab743){while(--_0x3ab743){_0x59f452['push'](_0x59f452['shift']());}};_0x56b671(++_0xd1b3fc);}(_0xbf06,0xb6));var _0x6bf0=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xbf06[_0x42bc91];return _0x3f5507;};'use strict';var multer=require(_0x6bf0('0x0'));var util=require(_0x6bf0('0x1'));var path=require(_0x6bf0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6bf0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6bf0('0x4'));router['get']('/',auth[_0x6bf0('0x5')](),controller[_0x6bf0('0x6')]);router[_0x6bf0('0x7')](_0x6bf0('0x8'),auth[_0x6bf0('0x5')](),controller[_0x6bf0('0x9')]);router[_0x6bf0('0x7')](_0x6bf0('0xa'),auth[_0x6bf0('0x5')](),controller[_0x6bf0('0xb')]);router[_0x6bf0('0xc')]('/',auth[_0x6bf0('0x5')](),controller[_0x6bf0('0xd')]);router[_0x6bf0('0xe')](_0x6bf0('0xa'),auth[_0x6bf0('0x5')](),controller[_0x6bf0('0xf')]);router[_0x6bf0('0x10')](_0x6bf0('0xa'),auth['isAuthenticated'](),controller[_0x6bf0('0x11')]);module[_0x6bf0('0x12')]=router;
\ No newline at end of file
+var _0xab1a=['isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','index','get','/describe'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0xab1a,0x173));var _0xaab1=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0xab1a[_0x368e09];return _0x14b7df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaab1('0x0'));var timeout=require(_0xaab1('0x1'));var express=require(_0xaab1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaab1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xaab1('0x4'));var controller=require(_0xaab1('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xaab1('0x6')]);router[_0xaab1('0x7')](_0xaab1('0x8'),auth[_0xaab1('0x9')](),controller[_0xaab1('0xa')]);router[_0xaab1('0x7')]('/:id',auth[_0xaab1('0x9')](),controller['show']);router[_0xaab1('0xb')]('/',auth['isAuthenticated'](),controller[_0xaab1('0xc')]);router[_0xaab1('0xd')](_0xaab1('0xe'),auth[_0xaab1('0x9')](),controller[_0xaab1('0xf')]);router[_0xaab1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xaab1('0x11')]);module[_0xaab1('0x12')]=router;
\ No newline at end of file
index ff9cac8..68d0d9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa149=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x358952,_0x1ce415){var _0x119ec6=function(_0x27dc6a){while(--_0x27dc6a){_0x358952['push'](_0x358952['shift']());}};_0x119ec6(++_0x1ce415);}(_0xa149,0x18c));var _0x9a14=function(_0x2f2757,_0x5932f4){_0x2f2757=_0x2f2757-0x0;var _0x3cf133=_0xa149[_0x2f2757];return _0x3cf133;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'type':{'type':Sequelize[_0x9a14('0x2')]},'uniqueid':{'type':Sequelize[_0x9a14('0x2')]},'calleridnum':{'type':Sequelize[_0x9a14('0x2')]},'calleridname':{'type':Sequelize[_0x9a14('0x2')]},'queue':{'type':Sequelize[_0x9a14('0x2')]},'interface':{'type':Sequelize[_0x9a14('0x2')]},'membername':{'type':Sequelize[_0x9a14('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9a14('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x9a14('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x9a14('0x3')]},'holdtime':{'type':Sequelize[_0x9a14('0x4')]},'agentcomplete':{'type':Sequelize[_0x9a14('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9a14('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9a14('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9a14('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9a14('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x9a14('0x2')]},'channel':{'type':Sequelize[_0x9a14('0x2')]},'channelstate':{'type':Sequelize[_0x9a14('0x4')]},'channelstatedesc':{'type':Sequelize[_0x9a14('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9a14('0x2')]},'connectedlinename':{'type':Sequelize[_0x9a14('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9a14('0x2')]},'destchannel':{'type':Sequelize[_0x9a14('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9a14('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9a14('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9a14('0x2')]},'destaccountcode':{'type':Sequelize[_0x9a14('0x2')]},'destcontext':{'type':Sequelize[_0x9a14('0x2')]},'destexten':{'type':Sequelize[_0x9a14('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x9a14('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9a14('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9a14('0x2')]},'transfer':{'type':Sequelize[_0x9a14('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9a14('0x2')],'comment':_0x9a14('0x6')},'transferexten':{'type':Sequelize[_0x9a14('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9a14('0x2')]},'agententerreason':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb9be=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x5bb51a,_0x114946){var _0x37c376=function(_0x504655){while(--_0x504655){_0x5bb51a['push'](_0x5bb51a['shift']());}};_0x37c376(++_0x114946);}(_0xb9be,0xc5));var _0xeb9b=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0xb9be[_0x53c256];return _0x25feb6;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'type':{'type':Sequelize[_0xeb9b('0x2')]},'uniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'calleridnum':{'type':Sequelize[_0xeb9b('0x2')]},'calleridname':{'type':Sequelize[_0xeb9b('0x2')]},'queue':{'type':Sequelize[_0xeb9b('0x2')]},'interface':{'type':Sequelize[_0xeb9b('0x2')]},'membername':{'type':Sequelize[_0xeb9b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xeb9b('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xeb9b('0x3')]},'agentdumpAt':{'type':Sequelize[_0xeb9b('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xeb9b('0x5')]},'agentacw':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xeb9b('0x5')]},'reason':{'type':Sequelize[_0xeb9b('0x2')]},'lastevent':{'type':Sequelize[_0xeb9b('0x2')]},'channel':{'type':Sequelize[_0xeb9b('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xeb9b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xeb9b('0x2')]},'accountcode':{'type':Sequelize[_0xeb9b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xeb9b('0x2')]},'priority':{'type':Sequelize[_0xeb9b('0x2')]},'destchannel':{'type':Sequelize[_0xeb9b('0x2')]},'destchannelstate':{'type':Sequelize[_0xeb9b('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xeb9b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xeb9b('0x2')]},'destlanguage':{'type':Sequelize[_0xeb9b('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xeb9b('0x2')]},'destuniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xeb9b('0x2')]},'transfer':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xeb9b('0x2')],'comment':_0xeb9b('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'agententerreason':{'type':Sequelize[_0xeb9b('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 3742ecb..3cc8ec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
index 60cf0a1..8c0f533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b5=['rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xf54f29,_0x4b1b54){var _0x2535ba=function(_0x2437bf){while(--_0x2437bf){_0xf54f29['push'](_0xf54f29['shift']());}};_0x2535ba(++_0x4b1b54);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x45bc52,_0xb89030){_0x45bc52=_0x45bc52-0x0;var _0x17d281=_0xc3b5[_0x45bc52];return _0x17d281;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x5c3b('0x8')]=function(_0x6b8a1e,_0x56345e){return _0x6b8a1e[_0x5c3b('0x9')](_0x5c3b('0xa'),attributes,{'tableName':_0x5c3b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5c3b('0xc'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x23f4=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid'];(function(_0x12c263,_0x2d9bce){var _0x192cd7=function(_0x3a1fc0){while(--_0x3a1fc0){_0x12c263['push'](_0x12c263['shift']());}};_0x192cd7(++_0x2d9bce);}(_0x23f4,0x1ee));var _0x423f=function(_0x547143,_0x2a5e78){_0x547143=_0x547143-0x0;var _0x1cb487=_0x23f4[_0x547143];return _0x1cb487;};'use strict';var _=require('lodash');var util=require(_0x423f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x423f('0x1'));var BPromise=require(_0x423f('0x2'));var rp=require(_0x423f('0x3'));var fs=require('fs');var path=require(_0x423f('0x4'));var rimraf=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var attributes=require(_0x423f('0x7'));module[_0x423f('0x8')]=function(_0x34a2d9,_0x51066b){return _0x34a2d9[_0x423f('0x9')](_0x423f('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x423f('0xb'),_0x423f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 5e1faa2..743c2f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd749=['options','raw','CreateVoiceAgentReport','debug','catch','UpdateVoiceAgentReport','update','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','result','VoiceAgentReport','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd749,0x1d3));var _0x9d74=function(_0x274cff,_0x180f42){_0x274cff=_0x274cff-0x0;var _0xd968c8=_0xd749[_0x274cff];return _0xd968c8;};'use strict';var _=require(_0x9d74('0x0'));var util=require(_0x9d74('0x1'));var moment=require(_0x9d74('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d74('0x3'));var db=require(_0x9d74('0x4'))['db'];var utils=require(_0x9d74('0x5'));var logger=require('../../config/logger')(_0x9d74('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9d74('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e53a8,_0x389d76,_0x161e4d){return new BPromise(function(_0x3a5b2e,_0x5c76f){return client[_0x9d74('0x8')](_0x2e53a8,_0x161e4d)[_0x9d74('0x9')](function(_0x50feef){logger[_0x9d74('0xa')](_0x9d74('0xb'),_0x389d76,_0x9d74('0xc'));logger['debug'](_0x9d74('0xd'),_0x389d76,_0x9d74('0xc'),JSON['stringify'](_0x50feef));if(_0x50feef[_0x9d74('0xe')]){if(_0x50feef['error']['code']===0x1f4){logger[_0x9d74('0xe')](_0x9d74('0xb'),_0x389d76,_0x50feef[_0x9d74('0xe')][_0x9d74('0xf')]);return _0x5c76f(_0x50feef[_0x9d74('0xe')][_0x9d74('0xf')]);}logger[_0x9d74('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x389d76,_0x50feef[_0x9d74('0xe')][_0x9d74('0xf')]);return _0x3a5b2e(_0x50feef[_0x9d74('0xe')][_0x9d74('0xf')]);}else{logger[_0x9d74('0xa')](_0x9d74('0xb'),_0x389d76,_0x9d74('0xc'));_0x3a5b2e(_0x50feef[_0x9d74('0x10')][_0x9d74('0xf')]);}})['catch'](function(_0xe445c8){logger['error'](_0x9d74('0xb'),_0x389d76,_0xe445c8);_0x5c76f(_0xe445c8);});});}exports['CreateVoiceAgentReport']=function(_0x47bcfe){var _0x662791=this;return new Promise(function(_0x56f655,_0x2318d9){return db[_0x9d74('0x11')]['create'](_0x47bcfe[_0x9d74('0x12')],{'raw':_0x47bcfe['options']?_0x47bcfe[_0x9d74('0x13')][_0x9d74('0x14')]===undefined?!![]:![]:!![]})[_0x9d74('0x9')](function(_0x15b10f){logger[_0x9d74('0xa')](_0x9d74('0x15'),_0x47bcfe);logger[_0x9d74('0x16')](_0x9d74('0x15'),_0x47bcfe,JSON['stringify'](_0x15b10f));_0x56f655(_0x15b10f);})[_0x9d74('0x17')](function(_0x37f8d7){logger[_0x9d74('0xe')]('CreateVoiceAgentReport',_0x37f8d7['message'],_0x47bcfe);_0x2318d9(_0x662791['error'](0x1f4,_0x37f8d7[_0x9d74('0xf')]));});});};exports[_0x9d74('0x18')]=function(_0x4955ec){var _0x475a64=this;return new Promise(function(_0x8e6053,_0x5346c1){return db[_0x9d74('0x11')][_0x9d74('0x19')](_0x4955ec[_0x9d74('0x12')],{'raw':_0x4955ec[_0x9d74('0x13')]?_0x4955ec[_0x9d74('0x13')][_0x9d74('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4955ec[_0x9d74('0x13')]?_0x4955ec['options']['where']||null:null,'attributes':_0x4955ec['options']?_0x4955ec[_0x9d74('0x13')]['attributes']||null:null,'limit':_0x4955ec[_0x9d74('0x13')]?_0x4955ec[_0x9d74('0x13')]['limit']||null:null})[_0x9d74('0x9')](function(_0x1919e0){logger[_0x9d74('0xa')](_0x9d74('0x18'),_0x4955ec);logger[_0x9d74('0x16')](_0x9d74('0x18'),_0x4955ec,JSON[_0x9d74('0x1a')](_0x1919e0));_0x8e6053(_0x1919e0);})[_0x9d74('0x17')](function(_0x1c3a92){logger[_0x9d74('0xe')](_0x9d74('0x18'),_0x1c3a92['message'],_0x4955ec);_0x5346c1(_0x475a64['error'](0x1f4,_0x1c3a92[_0x9d74('0xf')]));});});};
\ No newline at end of file
+var _0xc631=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','moment'];(function(_0x361ab4,_0x133456){var _0x561504=function(_0x1c4ca8){while(--_0x1c4ca8){_0x361ab4['push'](_0x361ab4['shift']());}};_0x561504(++_0x133456);}(_0xc631,0x177));var _0x1c63=function(_0x1fb0b8,_0x18e87c){_0x1fb0b8=_0x1fb0b8-0x0;var _0x185f6b=_0xc631[_0x1fb0b8];return _0x185f6b;};'use strict';var _=require(_0x1c63('0x0'));var util=require('util');var moment=require(_0x1c63('0x1'));var BPromise=require(_0x1c63('0x2'));var rs=require(_0x1c63('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c63('0x4'))['db'];var utils=require(_0x1c63('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1c63('0x6'));var jayson=require(_0x1c63('0x7'));var client=jayson['client'][_0x1c63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53323f,_0x16bab9,_0xcbabfa){return new BPromise(function(_0x5c24d6,_0x4907fb){return client['request'](_0x53323f,_0xcbabfa)[_0x1c63('0x9')](function(_0x1503f6){logger[_0x1c63('0xa')](_0x1c63('0xb'),_0x16bab9,_0x1c63('0xc'));logger[_0x1c63('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x16bab9,'request\x20sent',JSON[_0x1c63('0xe')](_0x1503f6));if(_0x1503f6[_0x1c63('0xf')]){if(_0x1503f6[_0x1c63('0xf')][_0x1c63('0x10')]===0x1f4){logger[_0x1c63('0xf')](_0x1c63('0xb'),_0x16bab9,_0x1503f6[_0x1c63('0xf')][_0x1c63('0x11')]);return _0x4907fb(_0x1503f6[_0x1c63('0xf')][_0x1c63('0x11')]);}logger['error'](_0x1c63('0xb'),_0x16bab9,_0x1503f6[_0x1c63('0xf')][_0x1c63('0x11')]);return _0x5c24d6(_0x1503f6['error']['message']);}else{logger[_0x1c63('0xa')](_0x1c63('0xb'),_0x16bab9,_0x1c63('0xc'));_0x5c24d6(_0x1503f6[_0x1c63('0x12')]['message']);}})['catch'](function(_0x155c74){logger[_0x1c63('0xf')](_0x1c63('0xb'),_0x16bab9,_0x155c74);_0x4907fb(_0x155c74);});});}exports[_0x1c63('0x13')]=function(_0x5e9163){var _0x2e10f8=this;return new Promise(function(_0x461950,_0x24d3d7){return db[_0x1c63('0x14')]['create'](_0x5e9163[_0x1c63('0x15')],{'raw':_0x5e9163[_0x1c63('0x16')]?_0x5e9163[_0x1c63('0x16')][_0x1c63('0x17')]===undefined?!![]:![]:!![]})[_0x1c63('0x9')](function(_0x5dce30){logger[_0x1c63('0xa')](_0x1c63('0x13'),_0x5e9163);logger['debug'](_0x1c63('0x13'),_0x5e9163,JSON[_0x1c63('0xe')](_0x5dce30));_0x461950(_0x5dce30);})['catch'](function(_0x5accab){logger[_0x1c63('0xf')]('CreateVoiceAgentReport',_0x5accab[_0x1c63('0x11')],_0x5e9163);_0x24d3d7(_0x2e10f8[_0x1c63('0xf')](0x1f4,_0x5accab[_0x1c63('0x11')]));});});};exports[_0x1c63('0x18')]=function(_0x495a6c){var _0x3fcb96=this;return new Promise(function(_0x2af32e,_0x61c9){return db[_0x1c63('0x14')][_0x1c63('0x19')](_0x495a6c[_0x1c63('0x15')],{'raw':_0x495a6c[_0x1c63('0x16')]?_0x495a6c[_0x1c63('0x16')][_0x1c63('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495a6c[_0x1c63('0x16')]?_0x495a6c['options'][_0x1c63('0x1a')]||null:null,'attributes':_0x495a6c[_0x1c63('0x16')]?_0x495a6c[_0x1c63('0x16')][_0x1c63('0x1b')]||null:null,'limit':_0x495a6c[_0x1c63('0x16')]?_0x495a6c[_0x1c63('0x16')][_0x1c63('0x1c')]||null:null})[_0x1c63('0x9')](function(_0x4e8413){logger[_0x1c63('0xa')]('UpdateVoiceAgentReport',_0x495a6c);logger[_0x1c63('0xd')](_0x1c63('0x18'),_0x495a6c,JSON[_0x1c63('0xe')](_0x4e8413));_0x2af32e(_0x4e8413);})['catch'](function(_0x2c47a7){logger[_0x1c63('0xf')](_0x1c63('0x18'),_0x2c47a7['message'],_0x495a6c);_0x61c9(_0x3fcb96[_0x1c63('0xf')](0x1f4,_0x2c47a7['message']));});});};
\ No newline at end of file
index ac0d764..7b99651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4a7529,_0xba0830){var _0x254252=function(_0x53cbea){while(--_0x53cbea){_0x4a7529['push'](_0x4a7529['shift']());}};_0x254252(++_0xba0830);}(_0x425d,0x1e0));var _0xd425=function(_0x3afbdf,_0x9e463b){_0x3afbdf=_0x3afbdf-0x0;var _0x5b6861=_0x425d[_0x3afbdf];return _0x5b6861;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),auth['isAuthenticated'](),controller[_0xd425('0xd')]);router[_0xd425('0x9')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0x11')]);router[_0xd425('0x12')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x13')]);router[_0xd425('0x14')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x15')]);module[_0xd425('0x16')]=router;
\ No newline at end of file
+var _0xdc97=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x4ed6c7,_0x2e6803){var _0x112d0c=function(_0x188c4f){while(--_0x188c4f){_0x4ed6c7['push'](_0x4ed6c7['shift']());}};_0x112d0c(++_0x2e6803);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1bcdf3,_0x25d60c){_0x1bcdf3=_0x1bcdf3-0x0;var _0x2f3f74=_0xdc97[_0x1bcdf3];return _0x2f3f74;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['post']('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0xe')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xf')]);router[_0x7dc9('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1f437aa..e7a8722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad07=['inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound'];(function(_0x56f43b,_0x12f74b){var _0x2a81de=function(_0x3e22c4){while(--_0x3e22c4){_0x56f43b['push'](_0x56f43b['shift']());}};_0x2a81de(++_0x12f74b);}(_0xad07,0xe3));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7ad0('0x0'));module[_0x7ad0('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7ad0('0x2')](_0x7ad0('0x3'),'internal','outbound',_0x7ad0('0x4'),_0x7ad0('0x5'),_0x7ad0('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7ad0('0x7')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x7ad0('0x7')]},'callerid':{'type':Sequelize[_0x7ad0('0x7')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x7ad0('0x7')]},'lastdata':{'type':Sequelize[_0x7ad0('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x7ad0('0x9')]},'answertime':{'type':Sequelize[_0x7ad0('0x9')]},'endtime':{'type':Sequelize[_0x7ad0('0x9')]},'duration':{'type':Sequelize[_0x7ad0('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7ad0('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7ad0('0x7')]},'amaflags':{'type':Sequelize[_0x7ad0('0x7')]},'userfield':{'type':Sequelize[_0x7ad0('0x7')]},'userDisposition':{'type':Sequelize[_0x7ad0('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x7ad0('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x7ad0('0x7')]},'note':{'type':Sequelize[_0x7ad0('0x7')]},'prefix':{'type':Sequelize[_0x7ad0('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x7ad0('0x7')]}};
\ No newline at end of file
+var _0xfe56=['sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','TEXT','DATE','INTEGER'];(function(_0x2c1923,_0x5446e9){var _0x73c9b4=function(_0x1c0f5d){while(--_0x1c0f5d){_0x2c1923['push'](_0x2c1923['shift']());}};_0x73c9b4(++_0x5446e9);}(_0xfe56,0x9a));var _0x6fe5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfe56[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6fe5('0x0'));module[_0x6fe5('0x1')]={'uniqueid':{'type':Sequelize[_0x6fe5('0x2')]},'type':{'type':Sequelize[_0x6fe5('0x3')](_0x6fe5('0x4'),_0x6fe5('0x5'),'outbound',_0x6fe5('0x6'),_0x6fe5('0x7'),'dialer')},'tag':{'type':Sequelize[_0x6fe5('0x2')]},'accountcode':{'type':Sequelize[_0x6fe5('0x2')]},'source':{'type':Sequelize[_0x6fe5('0x2')]},'destination':{'type':Sequelize[_0x6fe5('0x2')]},'destinationcontext':{'type':Sequelize[_0x6fe5('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6fe5('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x6fe5('0x2')]},'lastdata':{'type':Sequelize[_0x6fe5('0x8')]},'starttime':{'type':Sequelize[_0x6fe5('0x9')]},'systemanswertime':{'type':Sequelize[_0x6fe5('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x6fe5('0xa')]},'mohtime':{'type':Sequelize[_0x6fe5('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6fe5('0x2')]},'amaflags':{'type':Sequelize[_0x6fe5('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x6fe5('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x6fe5('0x2')]},'note':{'type':Sequelize[_0x6fe5('0x2')]},'prefix':{'type':Sequelize[_0x6fe5('0x2')]},'routeid':{'type':Sequelize[_0x6fe5('0xa')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3f14773..b0ed9d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x2ef3,0xba));var _0x32ef=function(_0x17263d,_0x335b55){_0x17263d=_0x17263d-0x0;var _0x24d32d=_0x2ef3[_0x17263d];return _0x24d32d;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
+var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
index e32a36f..100e395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc64=['report_call','uniqueid','lodash','util','../../config/logger','api','moment','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x585674,_0x11d34d){var _0xc0ffe2=function(_0xfa2ce3){while(--_0xfa2ce3){_0x585674['push'](_0x585674['shift']());}};_0xc0ffe2(++_0x11d34d);}(_0xcc64,0xd2));var _0x4cc6=function(_0x28243a,_0x1fb595){_0x28243a=_0x28243a-0x0;var _0x28f045=_0xcc64[_0x28243a];return _0x28f045;};'use strict';var _=require(_0x4cc6('0x0'));var util=require(_0x4cc6('0x1'));var logger=require(_0x4cc6('0x2'))(_0x4cc6('0x3'));var moment=require(_0x4cc6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cc6('0x5'));var rimraf=require('rimraf');var config=require(_0x4cc6('0x6'));var attributes=require(_0x4cc6('0x7'));module[_0x4cc6('0x8')]=function(_0x5b52ed,_0x3eedf5){return _0x5b52ed[_0x4cc6('0x9')](_0x4cc6('0xa'),attributes,{'tableName':_0x4cc6('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4cc6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc73=['report_call','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x339411,_0x47f05c){var _0x9c19a9=function(_0x94cfe7){while(--_0x94cfe7){_0x339411['push'](_0x339411['shift']());}};_0x9c19a9(++_0x47f05c);}(_0xfc73,0x1e5));var _0x3fc7=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xfc73[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var logger=require('../../config/logger')(_0x3fc7('0x2'));var moment=require(_0x3fc7('0x3'));var BPromise=require(_0x3fc7('0x4'));var rp=require(_0x3fc7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3fc7('0x6'));var attributes=require(_0x3fc7('0x7'));module[_0x3fc7('0x8')]=function(_0xc3aa8b,_0x168396){return _0xc3aa8b[_0x3fc7('0x9')]('VoiceCallReport',attributes,{'tableName':_0x3fc7('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 91885da..d2b18a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c7b=['raw','where','attributes','limit','model','include','map','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','code','error','message','GetVoiceCallReport','VoiceCallReport','findAll','options'];(function(_0x16b62f,_0x30a548){var _0x477d06=function(_0x3a03fc){while(--_0x3a03fc){_0x16b62f['push'](_0x16b62f['shift']());}};_0x477d06(++_0x30a548);}(_0x0c7b,0x136));var _0xb0c7=function(_0xa598b9,_0x5552df){_0xa598b9=_0xa598b9-0x0;var _0x3633d4=_0x0c7b[_0xa598b9];return _0x3633d4;};'use strict';var _=require(_0xb0c7('0x0'));var util=require(_0xb0c7('0x1'));var moment=require(_0xb0c7('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0c7('0x3'));var fs=require('fs');var Redis=require(_0xb0c7('0x4'));var db=require(_0xb0c7('0x5'))['db'];var utils=require(_0xb0c7('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb0c7('0x7'));var client=jayson[_0xb0c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4652a7,_0x3c2acd,_0x4087f3){return new BPromise(function(_0x14df87,_0x589525){return client[_0xb0c7('0x9')](_0x4652a7,_0x4087f3)[_0xb0c7('0xa')](function(_0x55ed24){logger[_0xb0c7('0xb')](_0xb0c7('0xc'),_0x3c2acd,_0xb0c7('0xd'));logger[_0xb0c7('0xe')](_0xb0c7('0xf'),_0x3c2acd,_0xb0c7('0xd'),JSON['stringify'](_0x55ed24));if(_0x55ed24['error']){if(_0x55ed24['error'][_0xb0c7('0x10')]===0x1f4){logger['error'](_0xb0c7('0xc'),_0x3c2acd,_0x55ed24[_0xb0c7('0x11')]['message']);return _0x589525(_0x55ed24[_0xb0c7('0x11')][_0xb0c7('0x12')]);}logger[_0xb0c7('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x3c2acd,_0x55ed24[_0xb0c7('0x11')][_0xb0c7('0x12')]);return _0x14df87(_0x55ed24[_0xb0c7('0x11')][_0xb0c7('0x12')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x3c2acd,'request\x20sent');_0x14df87(_0x55ed24['result'][_0xb0c7('0x12')]);}})['catch'](function(_0x74fcd4){logger[_0xb0c7('0x11')](_0xb0c7('0xc'),_0x3c2acd,_0x74fcd4);_0x589525(_0x74fcd4);});});}exports[_0xb0c7('0x13')]=function(_0xe3675f){var _0x4aae38=this;return new Promise(function(_0x53f8bb,_0x20e2f4){return db[_0xb0c7('0x14')][_0xb0c7('0x15')]({'raw':_0xe3675f[_0xb0c7('0x16')]?_0xe3675f['options'][_0xb0c7('0x17')]===undefined?!![]:![]:!![],'where':_0xe3675f[_0xb0c7('0x16')]?_0xe3675f[_0xb0c7('0x16')][_0xb0c7('0x18')]||null:null,'attributes':_0xe3675f['options']?_0xe3675f[_0xb0c7('0x16')][_0xb0c7('0x19')]||null:null,'limit':_0xe3675f[_0xb0c7('0x16')]?_0xe3675f[_0xb0c7('0x16')][_0xb0c7('0x1a')]||null:null,'include':_0xe3675f[_0xb0c7('0x16')]?_0xe3675f[_0xb0c7('0x16')]['include']?_['map'](_0xe3675f[_0xb0c7('0x16')]['include'],function(_0x31b56e){return{'model':db[_0x31b56e[_0xb0c7('0x1b')]],'as':_0x31b56e['as'],'attributes':_0x31b56e[_0xb0c7('0x19')],'include':_0x31b56e[_0xb0c7('0x1c')]?_[_0xb0c7('0x1d')](_0x31b56e[_0xb0c7('0x1c')],function(_0x3e2702){return{'model':db[_0x3e2702[_0xb0c7('0x1b')]],'as':_0x3e2702['as'],'attributes':_0x3e2702[_0xb0c7('0x19')],'include':_0x3e2702['include']?_[_0xb0c7('0x1d')](_0x3e2702[_0xb0c7('0x1c')],function(_0x40f769){return{'model':db[_0x40f769['model']],'as':_0x40f769['as'],'attributes':_0x40f769['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11ee58){logger[_0xb0c7('0xb')]('GetVoiceCallReport',_0xe3675f);logger[_0xb0c7('0xe')](_0xb0c7('0x13'),_0xe3675f,JSON['stringify'](_0x11ee58));_0x53f8bb(_0x11ee58);})[_0xb0c7('0x1e')](function(_0xeb3f67){logger['error']('GetVoiceCallReport',_0xeb3f67[_0xb0c7('0x12')],_0xe3675f);_0x20e2f4(_0x4aae38['error'](0x1f4,_0xeb3f67[_0xb0c7('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x529cbe){var _0x5acb9b=this;return new Promise(function(_0x5a19a8,_0x3fbc6){return db['VoiceCallReport'][_0xb0c7('0x1f')](_0x529cbe[_0xb0c7('0x20')],{'raw':_0x529cbe[_0xb0c7('0x16')]?_0x529cbe[_0xb0c7('0x16')][_0xb0c7('0x17')]===undefined?!![]:![]:!![]})[_0xb0c7('0xa')](function(_0x477ca1){logger[_0xb0c7('0xb')](_0xb0c7('0x21'),_0x529cbe);logger[_0xb0c7('0xe')](_0xb0c7('0x21'),_0x529cbe,JSON['stringify'](_0x477ca1));_0x5a19a8(_0x477ca1);})['catch'](function(_0x34f1da){logger[_0xb0c7('0x11')]('CreateVoiceCallReport',_0x34f1da[_0xb0c7('0x12')],_0x529cbe);_0x3fbc6(_0x5acb9b['error'](0x1f4,_0x34f1da[_0xb0c7('0x12')]));});});};exports[_0xb0c7('0x22')]=function(_0x2a5760){var _0x471d4a=this;return new Promise(function(_0x37efd7,_0x4ca9f0){return db[_0xb0c7('0x14')][_0xb0c7('0x23')](_0x2a5760[_0xb0c7('0x20')],{'raw':_0x2a5760['options']?_0x2a5760[_0xb0c7('0x16')][_0xb0c7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a5760[_0xb0c7('0x16')]?_0x2a5760[_0xb0c7('0x16')][_0xb0c7('0x18')]||null:null,'attributes':_0x2a5760[_0xb0c7('0x16')]?_0x2a5760[_0xb0c7('0x16')][_0xb0c7('0x19')]||null:null,'limit':_0x2a5760[_0xb0c7('0x16')]?_0x2a5760[_0xb0c7('0x16')][_0xb0c7('0x1a')]||null:null})[_0xb0c7('0xa')](function(_0xc8b7b8){logger['info'](_0xb0c7('0x22'),_0x2a5760);logger[_0xb0c7('0xe')](_0xb0c7('0x22'),_0x2a5760,JSON[_0xb0c7('0x24')](_0xc8b7b8));_0x37efd7(_0xc8b7b8);})[_0xb0c7('0x1e')](function(_0x129134){logger[_0xb0c7('0x11')](_0xb0c7('0x22'),_0x129134[_0xb0c7('0x12')],_0x2a5760);_0x4ca9f0(_0x471d4a[_0xb0c7('0x11')](0x1f4,_0x129134[_0xb0c7('0x12')]));});});};
\ No newline at end of file
+var _0x5549=['map','model','attributes','include','GetVoiceCallReport','CreateVoiceCallReport','create','stringify','body','limit','UpdateVoiceCallReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','code','error','message','catch','VoiceCallReport','findAll','options','raw','where'];(function(_0x39e86,_0xabea07){var _0x38c7cc=function(_0x11e9cf){while(--_0x11e9cf){_0x39e86['push'](_0x39e86['shift']());}};_0x38c7cc(++_0xabea07);}(_0x5549,0x11b));var _0x9554=function(_0xcc00dd,_0x240a76){_0xcc00dd=_0xcc00dd-0x0;var _0x5acfbf=_0x5549[_0xcc00dd];return _0x5acfbf;};'use strict';var _=require(_0x9554('0x0'));var util=require('util');var moment=require(_0x9554('0x1'));var BPromise=require(_0x9554('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9554('0x3'));var db=require(_0x9554('0x4'))['db'];var utils=require(_0x9554('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9554('0x6')][_0x9554('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x18673d,_0xe7fd49,_0x95d96c){return new BPromise(function(_0x4c9838,_0x15eeb3){return client[_0x9554('0x8')](_0x18673d,_0x95d96c)[_0x9554('0x9')](function(_0x1bcd6f){logger[_0x9554('0xa')](_0x9554('0xb'),_0xe7fd49,'request\x20sent');logger[_0x9554('0xc')](_0x9554('0xd'),_0xe7fd49,'request\x20sent',JSON['stringify'](_0x1bcd6f));if(_0x1bcd6f['error']){if(_0x1bcd6f['error'][_0x9554('0xe')]===0x1f4){logger['error'](_0x9554('0xb'),_0xe7fd49,_0x1bcd6f[_0x9554('0xf')][_0x9554('0x10')]);return _0x15eeb3(_0x1bcd6f['error'][_0x9554('0x10')]);}logger[_0x9554('0xf')](_0x9554('0xb'),_0xe7fd49,_0x1bcd6f[_0x9554('0xf')][_0x9554('0x10')]);return _0x4c9838(_0x1bcd6f[_0x9554('0xf')][_0x9554('0x10')]);}else{logger[_0x9554('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0xe7fd49,'request\x20sent');_0x4c9838(_0x1bcd6f['result'][_0x9554('0x10')]);}})[_0x9554('0x11')](function(_0x50ed17){logger[_0x9554('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0xe7fd49,_0x50ed17);_0x15eeb3(_0x50ed17);});});}exports['GetVoiceCallReport']=function(_0x22cd42){var _0x2f5517=this;return new Promise(function(_0x1f9b34,_0x1ae98e){return db[_0x9554('0x12')][_0x9554('0x13')]({'raw':_0x22cd42['options']?_0x22cd42[_0x9554('0x14')][_0x9554('0x15')]===undefined?!![]:![]:!![],'where':_0x22cd42[_0x9554('0x14')]?_0x22cd42[_0x9554('0x14')][_0x9554('0x16')]||null:null,'attributes':_0x22cd42[_0x9554('0x14')]?_0x22cd42[_0x9554('0x14')]['attributes']||null:null,'limit':_0x22cd42[_0x9554('0x14')]?_0x22cd42[_0x9554('0x14')]['limit']||null:null,'include':_0x22cd42['options']?_0x22cd42[_0x9554('0x14')]['include']?_[_0x9554('0x17')](_0x22cd42[_0x9554('0x14')]['include'],function(_0x2e0598){return{'model':db[_0x2e0598[_0x9554('0x18')]],'as':_0x2e0598['as'],'attributes':_0x2e0598[_0x9554('0x19')],'include':_0x2e0598[_0x9554('0x1a')]?_[_0x9554('0x17')](_0x2e0598[_0x9554('0x1a')],function(_0x37f999){return{'model':db[_0x37f999[_0x9554('0x18')]],'as':_0x37f999['as'],'attributes':_0x37f999['attributes'],'include':_0x37f999['include']?_['map'](_0x37f999[_0x9554('0x1a')],function(_0x535932){return{'model':db[_0x535932['model']],'as':_0x535932['as'],'attributes':_0x535932['attributes']};}):[]};}):[]};}):[]:[]})[_0x9554('0x9')](function(_0x1dcc62){logger[_0x9554('0xa')](_0x9554('0x1b'),_0x22cd42);logger[_0x9554('0xc')](_0x9554('0x1b'),_0x22cd42,JSON['stringify'](_0x1dcc62));_0x1f9b34(_0x1dcc62);})['catch'](function(_0x442139){logger[_0x9554('0xf')](_0x9554('0x1b'),_0x442139[_0x9554('0x10')],_0x22cd42);_0x1ae98e(_0x2f5517[_0x9554('0xf')](0x1f4,_0x442139[_0x9554('0x10')]));});});};exports[_0x9554('0x1c')]=function(_0x198626){var _0x2ccf49=this;return new Promise(function(_0x318757,_0x20df48){return db[_0x9554('0x12')][_0x9554('0x1d')](_0x198626['body'],{'raw':_0x198626['options']?_0x198626[_0x9554('0x14')][_0x9554('0x15')]===undefined?!![]:![]:!![]})[_0x9554('0x9')](function(_0x130f22){logger[_0x9554('0xa')](_0x9554('0x1c'),_0x198626);logger[_0x9554('0xc')]('CreateVoiceCallReport',_0x198626,JSON[_0x9554('0x1e')](_0x130f22));_0x318757(_0x130f22);})['catch'](function(_0x130480){logger[_0x9554('0xf')](_0x9554('0x1c'),_0x130480[_0x9554('0x10')],_0x198626);_0x20df48(_0x2ccf49[_0x9554('0xf')](0x1f4,_0x130480[_0x9554('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x40ecee){var _0x53987d=this;return new Promise(function(_0x39a3da,_0x373091){return db[_0x9554('0x12')]['update'](_0x40ecee[_0x9554('0x1f')],{'raw':_0x40ecee['options']?_0x40ecee['options'][_0x9554('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40ecee[_0x9554('0x14')]?_0x40ecee['options']['where']||null:null,'attributes':_0x40ecee['options']?_0x40ecee[_0x9554('0x14')][_0x9554('0x19')]||null:null,'limit':_0x40ecee[_0x9554('0x14')]?_0x40ecee['options'][_0x9554('0x20')]||null:null})[_0x9554('0x9')](function(_0x246879){logger[_0x9554('0xa')](_0x9554('0x21'),_0x40ecee);logger['debug'](_0x9554('0x21'),_0x40ecee,JSON[_0x9554('0x1e')](_0x246879));_0x39a3da(_0x246879);})['catch'](function(_0x89e40a){logger['error'](_0x9554('0x21'),_0x89e40a['message'],_0x40ecee);_0x373091(_0x53987d[_0x9554('0xf')](0x1f4,_0x89e40a[_0x9554('0x10')]));});});};
\ No newline at end of file
index 231534d..cda63cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x999d=['update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','post','create','put'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x999d,0x193));var _0xd999=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x999d[_0x58c20f];return _0x3b0318;};'use strict';var multer=require(_0xd999('0x0'));var util=require('util');var path=require(_0xd999('0x1'));var timeout=require('connect-timeout');var express=require(_0xd999('0x2'));var router=express['Router']();var fs_extra=require(_0xd999('0x3'));var auth=require(_0xd999('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd999('0x5'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd999('0x6')]);router[_0xd999('0x7')](_0xd999('0x8'),auth[_0xd999('0x9')](),controller['show']);router[_0xd999('0xa')]('/',auth[_0xd999('0x9')](),controller[_0xd999('0xb')]);router[_0xd999('0xc')]('/:id',auth[_0xd999('0x9')](),controller[_0xd999('0xd')]);router[_0xd999('0xe')]('/:id',auth[_0xd999('0x9')](),controller[_0xd999('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x9302=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9302,0x1c1));var _0x2930=function(_0x5b0f07,_0x2ad42c){_0x5b0f07=_0x5b0f07-0x0;var _0x59e162=_0x9302[_0x5b0f07];return _0x59e162;};'use strict';var multer=require(_0x2930('0x0'));var util=require(_0x2930('0x1'));var path=require(_0x2930('0x2'));var timeout=require(_0x2930('0x3'));var express=require(_0x2930('0x4'));var router=express[_0x2930('0x5')]();var fs_extra=require(_0x2930('0x6'));var auth=require(_0x2930('0x7'));var interaction=require(_0x2930('0x8'));var config=require(_0x2930('0x9'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x2930('0xa')](),controller[_0x2930('0xb')]);router[_0x2930('0xc')](_0x2930('0xd'),auth[_0x2930('0xa')](),controller[_0x2930('0xe')]);router['post']('/',auth[_0x2930('0xa')](),controller['create']);router['put'](_0x2930('0xd'),auth[_0x2930('0xa')](),controller[_0x2930('0xf')]);router[_0x2930('0x10')](_0x2930('0xd'),auth['isAuthenticated'](),controller[_0x2930('0x11')]);module[_0x2930('0x12')]=router;
\ No newline at end of file
index 78cb81d..6ff59c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19f4=['STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x1b1d3a,_0x370b29){var _0x1c4dfd=function(_0x570a08){while(--_0x570a08){_0x1b1d3a['push'](_0x1b1d3a['shift']());}};_0x1c4dfd(++_0x370b29);}(_0x19f4,0x15c));var _0x419f=function(_0x2886ad,_0x418c18){_0x2886ad=_0x2886ad-0x0;var _0x5f43b3=_0x19f4[_0x2886ad];return _0x5f43b3;};'use strict';var Sequelize=require(_0x419f('0x0'));module[_0x419f('0x1')]={'name':{'type':Sequelize[_0x419f('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x419f('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x419f('0x2')],'set':function(_0x3e82a9){this[_0x419f('0x4')](_0x419f('0x5'),_0x3e82a9?_0x3e82a9[_0x419f('0x6')](''):[]);},'get':function(){return this[_0x419f('0x7')](_0x419f('0x5'))?this[_0x419f('0x7')](_0x419f('0x5'))[_0x419f('0x8')](''):[];}},'auth':{'type':Sequelize[_0x419f('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x419f('0x2')]},'record':{'type':Sequelize[_0x419f('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x419f('0x2')]},'description':{'type':Sequelize[_0x419f('0x2')]}};
\ No newline at end of file
+var _0xb6be=['exports','STRING','name','options','getDataValue','split','BOOLEAN','sequelize'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xb6be,0x177));var _0xeb6b=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0xb6be[_0x5b34c0];return _0x242bd3;};'use strict';var Sequelize=require(_0xeb6b('0x0'));module[_0xeb6b('0x1')]={'name':{'type':Sequelize[_0xeb6b('0x2')]},'prefix':{'type':Sequelize[_0xeb6b('0x2')],'unique':_0xeb6b('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xeb6b('0x2')],'set':function(_0x39fa24){this['setDataValue'](_0xeb6b('0x4'),_0x39fa24?_0x39fa24['join'](''):[]);},'get':function(){return this[_0xeb6b('0x5')](_0xeb6b('0x4'))?this[_0xeb6b('0x5')](_0xeb6b('0x4'))[_0xeb6b('0x6')](''):[];}},'auth':{'type':Sequelize[_0xeb6b('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xeb6b('0x2')]},'record':{'type':Sequelize[_0xeb6b('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb6b('0x2')]}};
\ No newline at end of file
index 2753eca..affe8d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a24=['reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6a24,0xd1));var _0x46a2=function(_0x36d572,_0x5515a1){_0x36d572=_0x36d572-0x0;var _0x1d88bc=_0x6a24[_0x36d572];return _0x1d88bc;};'use strict';var emlformat=require(_0x46a2('0x0'));var rimraf=require(_0x46a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a2('0x2'));var rp=require(_0x46a2('0x3'));var moment=require(_0x46a2('0x4'));var BPromise=require(_0x46a2('0x5'));var Mustache=require(_0x46a2('0x6'));var util=require('util');var path=require(_0x46a2('0x7'));var sox=require(_0x46a2('0x8'));var csv=require('to-csv');var ejs=require(_0x46a2('0x9'));var fs=require('fs');var fs_extra=require(_0x46a2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x46a2('0xb'));var jsforce=require(_0x46a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x46a2('0xd'));var querystring=require('querystring');var Papa=require(_0x46a2('0xe'));var Redis=require('ioredis');var authService=require(_0x46a2('0xf'));var qs=require(_0x46a2('0x10'));var as=require(_0x46a2('0x11'));var hardwareService=require(_0x46a2('0x12'));var logger=require(_0x46a2('0x13'))(_0x46a2('0x14'));var utils=require(_0x46a2('0x15'));var config=require(_0x46a2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403282,_0x18e584){_0x18e584=_0x18e584||0xcc;return function(_0x5c5d10){if(_0x5c5d10){return _0x403282[_0x46a2('0x17')](_0x18e584);}return _0x403282[_0x46a2('0x18')](_0x18e584)[_0x46a2('0x19')]();};}function respondWithResult(_0x18a038,_0xddc328){_0xddc328=_0xddc328||0xc8;return function(_0x2fd383){if(_0x2fd383){return _0x18a038[_0x46a2('0x18')](_0xddc328)[_0x46a2('0x1a')](_0x2fd383);}};}function respondWithFilteredResult(_0x577591,_0x4a7e7a){return function(_0x3c81e8){if(_0x3c81e8){var _0x2deb20=typeof _0x4a7e7a['offset']===_0x46a2('0x1b')&&typeof _0x4a7e7a[_0x46a2('0x1c')]==='undefined';var _0xa2eb96=_0x3c81e8[_0x46a2('0x1d')];var _0x577f18=_0x2deb20?0x0:_0x4a7e7a[_0x46a2('0x1e')];var _0x24f75f=_0x2deb20?_0x3c81e8['count']:_0x4a7e7a[_0x46a2('0x1e')]+_0x4a7e7a[_0x46a2('0x1c')];var _0x5144c7;if(_0x24f75f>=_0xa2eb96){_0x24f75f=_0xa2eb96;_0x5144c7=0xc8;}else{_0x5144c7=0xce;}_0x577591[_0x46a2('0x18')](_0x5144c7);return _0x577591[_0x46a2('0x1f')](_0x46a2('0x20'),_0x577f18+'-'+_0x24f75f+'/'+_0xa2eb96)[_0x46a2('0x1a')](_0x3c81e8);}return null;};}function patchUpdates(_0x202294){return function(_0x2d65c2){try{jsonpatch[_0x46a2('0x21')](_0x2d65c2,_0x202294,!![]);}catch(_0x473cfb){return BPromise[_0x46a2('0x22')](_0x473cfb);}return _0x2d65c2[_0x46a2('0x23')]();};}function saveUpdates(_0x5c7586,_0xa37d90){return function(_0x504b9e){if(_0x504b9e){return _0x504b9e[_0x46a2('0x24')](_0x5c7586)[_0x46a2('0x25')](function(_0x511ff6){return _0x511ff6;});}return null;};}function removeEntity(_0x43dc69,_0x15e5bb){return function(_0x233c4e){if(_0x233c4e){return _0x233c4e[_0x46a2('0x26')]()['then'](function(){var _0x197230=_0x233c4e[_0x46a2('0x27')]({'plain':!![]});var _0x1e48f5=_0x46a2('0x28');return db[_0x46a2('0x29')][_0x46a2('0x26')]({'where':{'type':_0x1e48f5,'resourceId':_0x197230['id']}})[_0x46a2('0x25')](function(){return _0x233c4e;});})[_0x46a2('0x25')](function(){_0x43dc69[_0x46a2('0x18')](0xcc)[_0x46a2('0x19')]();});}};}function handleEntityNotFound(_0x44ffb4,_0x582ada){return function(_0x2b4d9f){if(!_0x2b4d9f){_0x44ffb4[_0x46a2('0x17')](0x194);}return _0x2b4d9f;};}function handleError(_0x1c059b,_0x35dcbf){_0x35dcbf=_0x35dcbf||0x1f4;return function(_0x435155){logger[_0x46a2('0x2a')](_0x435155['stack']);if(_0x435155[_0x46a2('0x2b')]){delete _0x435155[_0x46a2('0x2b')];}_0x1c059b[_0x46a2('0x18')](_0x35dcbf)[_0x46a2('0x2c')](_0x435155);};}exports[_0x46a2('0x2d')]=function(_0x511bea,_0x4024be){var _0x4bb07e={},_0x20a0a2={},_0x97a3bf={'count':0x0,'rows':[]};var _0x3c1fba=_[_0x46a2('0x2e')](db[_0x46a2('0x2f')][_0x46a2('0x30')],function(_0x4c294a){return{'name':_0x4c294a[_0x46a2('0x31')],'type':_0x4c294a[_0x46a2('0x32')]['key']};});_0x20a0a2[_0x46a2('0x33')]=_[_0x46a2('0x2e')](_0x3c1fba,_0x46a2('0x2b'));_0x20a0a2[_0x46a2('0x34')]=_[_0x46a2('0x35')](_0x511bea['query']);_0x20a0a2['filters']=_[_0x46a2('0x36')](_0x20a0a2[_0x46a2('0x33')],_0x20a0a2[_0x46a2('0x34')]);_0x4bb07e[_0x46a2('0x37')]=_[_0x46a2('0x36')](_0x20a0a2[_0x46a2('0x33')],qs['fields'](_0x511bea['query'][_0x46a2('0x38')]));_0x4bb07e['attributes']=_0x4bb07e[_0x46a2('0x37')][_0x46a2('0x39')]?_0x4bb07e[_0x46a2('0x37')]:_0x20a0a2[_0x46a2('0x33')];if(!_0x511bea['query'][_0x46a2('0x3a')](_0x46a2('0x3b'))){_0x4bb07e[_0x46a2('0x1c')]=qs[_0x46a2('0x1c')](_0x511bea['query'][_0x46a2('0x1c')]);_0x4bb07e[_0x46a2('0x1e')]=qs[_0x46a2('0x1e')](_0x511bea[_0x46a2('0x34')]['offset']);}_0x4bb07e[_0x46a2('0x3c')]=qs['sort'](_0x511bea[_0x46a2('0x34')]['sort']);_0x4bb07e[_0x46a2('0x3d')]=qs[_0x46a2('0x3e')](_['pick'](_0x511bea[_0x46a2('0x34')],_0x20a0a2['filters']),_0x3c1fba);if(_0x511bea['query'][_0x46a2('0x3f')]){_0x4bb07e[_0x46a2('0x3d')]=_[_0x46a2('0x40')](_0x4bb07e[_0x46a2('0x3d')],{'$or':_[_0x46a2('0x2e')](_0x3c1fba,function(_0x3b2c96){if(_0x3b2c96['type']!==_0x46a2('0x41')){var _0x49ace7={};_0x49ace7[_0x3b2c96[_0x46a2('0x2b')]]={'$like':'%'+_0x511bea[_0x46a2('0x34')][_0x46a2('0x3f')]+'%'};return _0x49ace7;}})});}_0x4bb07e=_[_0x46a2('0x40')]({},_0x4bb07e,_0x511bea[_0x46a2('0x42')]);var _0x27cd37={'where':_0x4bb07e[_0x46a2('0x3d')]};return db[_0x46a2('0x2f')]['count'](_0x27cd37)[_0x46a2('0x25')](function(_0x15ec39){_0x97a3bf[_0x46a2('0x1d')]=_0x15ec39;if(_0x511bea[_0x46a2('0x34')]['includeAll']){_0x4bb07e[_0x46a2('0x43')]=[{'all':!![]}];}return db[_0x46a2('0x2f')][_0x46a2('0x44')](_0x4bb07e);})[_0x46a2('0x25')](function(_0x1fcc03){_0x97a3bf['rows']=_0x1fcc03;return _0x97a3bf;})[_0x46a2('0x25')](respondWithFilteredResult(_0x4024be,_0x4bb07e))['catch'](handleError(_0x4024be,null));};exports[_0x46a2('0x45')]=function(_0x20968b,_0x5df93d){var _0x19fcc0={'raw':![],'where':{'id':_0x20968b[_0x46a2('0x46')]['id']}},_0x1a7e45={};_0x1a7e45[_0x46a2('0x33')]=_[_0x46a2('0x35')](db[_0x46a2('0x2f')][_0x46a2('0x30')]);_0x1a7e45[_0x46a2('0x34')]=_[_0x46a2('0x35')](_0x20968b[_0x46a2('0x34')]);_0x1a7e45['filters']=_[_0x46a2('0x36')](_0x1a7e45[_0x46a2('0x33')],_0x1a7e45[_0x46a2('0x34')]);_0x19fcc0[_0x46a2('0x37')]=_[_0x46a2('0x36')](_0x1a7e45['model'],qs[_0x46a2('0x38')](_0x20968b[_0x46a2('0x34')][_0x46a2('0x38')]));_0x19fcc0[_0x46a2('0x37')]=_0x19fcc0[_0x46a2('0x37')]['length']?_0x19fcc0[_0x46a2('0x37')]:_0x1a7e45['model'];if(_0x20968b[_0x46a2('0x34')][_0x46a2('0x47')]){_0x19fcc0['include']=[{'all':!![]}];}_0x19fcc0=_[_0x46a2('0x40')]({},_0x19fcc0,_0x20968b[_0x46a2('0x42')]);return db[_0x46a2('0x2f')][_0x46a2('0x48')](_0x19fcc0)[_0x46a2('0x25')](handleEntityNotFound(_0x5df93d,null))[_0x46a2('0x25')](respondWithResult(_0x5df93d,null))[_0x46a2('0x49')](handleError(_0x5df93d,null));};exports['create']=function(_0x369015,_0x1f8640){return db[_0x46a2('0x2f')][_0x46a2('0x4a')](_0x369015['body'],{})[_0x46a2('0x25')](function(_0x4c40a6){var _0x12f268=_0x369015[_0x46a2('0x4b')]['get']({'plain':!![]});if(!_0x12f268)throw new Error(_0x46a2('0x4c'));if(_0x12f268['role']===_0x46a2('0x4b')){var _0x76ccd3=_0x4c40a6[_0x46a2('0x27')]({'plain':!![]});var _0x38e4e7=_0x46a2('0x28');return db[_0x46a2('0x4d')]['find']({'where':{'name':_0x38e4e7,'userProfileId':_0x12f268['userProfileId']},'raw':!![]})[_0x46a2('0x25')](function(_0x1a5cf4){if(_0x1a5cf4&&_0x1a5cf4[_0x46a2('0x4e')]===0x0){return db[_0x46a2('0x29')][_0x46a2('0x4a')]({'name':_0x76ccd3[_0x46a2('0x2b')],'resourceId':_0x76ccd3['id'],'type':_0x1a5cf4[_0x46a2('0x2b')],'sectionId':_0x1a5cf4['id']},{})['then'](function(){return _0x4c40a6;});}else{return _0x4c40a6;}})[_0x46a2('0x49')](function(_0x3665db){logger[_0x46a2('0x2a')](_0x46a2('0x4f'),_0x3665db);throw _0x3665db;});}return _0x4c40a6;})[_0x46a2('0x25')](respondWithResult(_0x1f8640,0xc9))[_0x46a2('0x49')](handleError(_0x1f8640,null));};exports[_0x46a2('0x24')]=function(_0x4ff5e6,_0x3ff55a){if(_0x4ff5e6[_0x46a2('0x50')]['id']){delete _0x4ff5e6['body']['id'];}return db[_0x46a2('0x2f')][_0x46a2('0x48')]({'where':{'id':_0x4ff5e6['params']['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x3ff55a,null))[_0x46a2('0x25')](saveUpdates(_0x4ff5e6['body'],null))[_0x46a2('0x25')](respondWithResult(_0x3ff55a,null))[_0x46a2('0x49')](handleError(_0x3ff55a,null));};exports['destroy']=function(_0x5e926e,_0x48f2c2){return db['VoiceChanSpy'][_0x46a2('0x48')]({'where':{'id':_0x5e926e['params']['id']}})['then'](handleEntityNotFound(_0x48f2c2,null))[_0x46a2('0x25')](removeEntity(_0x48f2c2,null))[_0x46a2('0x49')](handleError(_0x48f2c2,null));};
\ No newline at end of file
+var _0x80df=['fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','ChanSpies','end','sendStatus','error','stack','name','index','VoiceChanSpy','rawAttributes','type','key','map','query','filters','intersection','model'];(function(_0x39acd9,_0x165360){var _0x46c77f=function(_0x4103e7){while(--_0x4103e7){_0x39acd9['push'](_0x39acd9['shift']());}};_0x46c77f(++_0x165360);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf80d('0x0'));var rimraf=require(_0xf80d('0x1'));var zipdir=require(_0xf80d('0x2'));var jsonpatch=require(_0xf80d('0x3'));var rp=require('request-promise');var moment=require(_0xf80d('0x4'));var BPromise=require(_0xf80d('0x5'));var Mustache=require(_0xf80d('0x6'));var util=require(_0xf80d('0x7'));var path=require(_0xf80d('0x8'));var sox=require(_0xf80d('0x9'));var csv=require(_0xf80d('0xa'));var ejs=require(_0xf80d('0xb'));var fs=require('fs');var fs_extra=require(_0xf80d('0xc'));var _=require(_0xf80d('0xd'));var squel=require('squel');var crypto=require(_0xf80d('0xe'));var jsforce=require(_0xf80d('0xf'));var deskjs=require(_0xf80d('0x10'));var toCsv=require(_0xf80d('0xa'));var querystring=require(_0xf80d('0x11'));var Papa=require(_0xf80d('0x12'));var Redis=require(_0xf80d('0x13'));var authService=require(_0xf80d('0x14'));var qs=require(_0xf80d('0x15'));var as=require(_0xf80d('0x16'));var hardwareService=require(_0xf80d('0x17'));var logger=require(_0xf80d('0x18'))(_0xf80d('0x19'));var utils=require(_0xf80d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf80d('0x1b'))['db'];function respondWithStatusCode(_0x74ce36,_0x489bdf){_0x489bdf=_0x489bdf||0xcc;return function(_0x34e130){if(_0x34e130){return _0x74ce36['sendStatus'](_0x489bdf);}return _0x74ce36[_0xf80d('0x1c')](_0x489bdf)['end']();};}function respondWithResult(_0x4285de,_0x50c968){_0x50c968=_0x50c968||0xc8;return function(_0x3be9a9){if(_0x3be9a9){return _0x4285de[_0xf80d('0x1c')](_0x50c968)[_0xf80d('0x1d')](_0x3be9a9);}};}function respondWithFilteredResult(_0x1e1b08,_0x2098d6){return function(_0x45751c){if(_0x45751c){var _0x482043=typeof _0x2098d6[_0xf80d('0x1e')]===_0xf80d('0x1f')&&typeof _0x2098d6[_0xf80d('0x20')]===_0xf80d('0x1f');var _0x27b2ea=_0x45751c[_0xf80d('0x21')];var _0x1d104a=_0x482043?0x0:_0x2098d6[_0xf80d('0x1e')];var _0x2ea2c1=_0x482043?_0x45751c[_0xf80d('0x21')]:_0x2098d6[_0xf80d('0x1e')]+_0x2098d6[_0xf80d('0x20')];var _0x5392c5;if(_0x2ea2c1>=_0x27b2ea){_0x2ea2c1=_0x27b2ea;_0x5392c5=0xc8;}else{_0x5392c5=0xce;}_0x1e1b08[_0xf80d('0x1c')](_0x5392c5);return _0x1e1b08[_0xf80d('0x22')]('Content-Range',_0x1d104a+'-'+_0x2ea2c1+'/'+_0x27b2ea)[_0xf80d('0x1d')](_0x45751c);}return null;};}function patchUpdates(_0x539c80){return function(_0x3f3a2a){try{jsonpatch[_0xf80d('0x23')](_0x3f3a2a,_0x539c80,!![]);}catch(_0x2d5e46){return BPromise[_0xf80d('0x24')](_0x2d5e46);}return _0x3f3a2a[_0xf80d('0x25')]();};}function saveUpdates(_0x25d031,_0x446153){return function(_0x269859){if(_0x269859){return _0x269859[_0xf80d('0x26')](_0x25d031)[_0xf80d('0x27')](function(_0x33d58c){return _0x33d58c;});}return null;};}function removeEntity(_0x739968,_0x570c99){return function(_0x32ad42){if(_0x32ad42){return _0x32ad42[_0xf80d('0x28')]()['then'](function(){var _0x3353a3=_0x32ad42[_0xf80d('0x29')]({'plain':!![]});var _0x323540=_0xf80d('0x2a');return db['UserProfileResource'][_0xf80d('0x28')]({'where':{'type':_0x323540,'resourceId':_0x3353a3['id']}})[_0xf80d('0x27')](function(){return _0x32ad42;});})[_0xf80d('0x27')](function(){_0x739968[_0xf80d('0x1c')](0xcc)[_0xf80d('0x2b')]();});}};}function handleEntityNotFound(_0xde054a,_0x2fc429){return function(_0x68f2c6){if(!_0x68f2c6){_0xde054a[_0xf80d('0x2c')](0x194);}return _0x68f2c6;};}function handleError(_0x4d2579,_0xe940d6){_0xe940d6=_0xe940d6||0x1f4;return function(_0x1603a4){logger[_0xf80d('0x2d')](_0x1603a4[_0xf80d('0x2e')]);if(_0x1603a4[_0xf80d('0x2f')]){delete _0x1603a4[_0xf80d('0x2f')];}_0x4d2579[_0xf80d('0x1c')](_0xe940d6)['send'](_0x1603a4);};}exports[_0xf80d('0x30')]=function(_0x27887e,_0x214bff){var _0x435e23={},_0x5c3a1d={},_0x487d2c={'count':0x0,'rows':[]};var _0x2359f1=_['map'](db[_0xf80d('0x31')][_0xf80d('0x32')],function(_0x45f76a){return{'name':_0x45f76a['fieldName'],'type':_0x45f76a[_0xf80d('0x33')][_0xf80d('0x34')]};});_0x5c3a1d['model']=_[_0xf80d('0x35')](_0x2359f1,_0xf80d('0x2f'));_0x5c3a1d[_0xf80d('0x36')]=_['keys'](_0x27887e[_0xf80d('0x36')]);_0x5c3a1d[_0xf80d('0x37')]=_[_0xf80d('0x38')](_0x5c3a1d[_0xf80d('0x39')],_0x5c3a1d[_0xf80d('0x36')]);_0x435e23['attributes']=_[_0xf80d('0x38')](_0x5c3a1d['model'],qs[_0xf80d('0x3a')](_0x27887e[_0xf80d('0x36')][_0xf80d('0x3a')]));_0x435e23[_0xf80d('0x3b')]=_0x435e23['attributes'][_0xf80d('0x3c')]?_0x435e23[_0xf80d('0x3b')]:_0x5c3a1d[_0xf80d('0x39')];if(!_0x27887e[_0xf80d('0x36')]['hasOwnProperty'](_0xf80d('0x3d'))){_0x435e23[_0xf80d('0x20')]=qs[_0xf80d('0x20')](_0x27887e[_0xf80d('0x36')][_0xf80d('0x20')]);_0x435e23[_0xf80d('0x1e')]=qs[_0xf80d('0x1e')](_0x27887e[_0xf80d('0x36')]['offset']);}_0x435e23[_0xf80d('0x3e')]=qs[_0xf80d('0x3f')](_0x27887e[_0xf80d('0x36')]['sort']);_0x435e23[_0xf80d('0x40')]=qs['filters'](_[_0xf80d('0x41')](_0x27887e[_0xf80d('0x36')],_0x5c3a1d[_0xf80d('0x37')]),_0x2359f1);if(_0x27887e[_0xf80d('0x36')]['filter']){_0x435e23['where']=_['merge'](_0x435e23[_0xf80d('0x40')],{'$or':_[_0xf80d('0x35')](_0x2359f1,function(_0x2d0ee5){if(_0x2d0ee5[_0xf80d('0x33')]!==_0xf80d('0x42')){var _0x100dc7={};_0x100dc7[_0x2d0ee5['name']]={'$like':'%'+_0x27887e[_0xf80d('0x36')][_0xf80d('0x43')]+'%'};return _0x100dc7;}})});}_0x435e23=_[_0xf80d('0x44')]({},_0x435e23,_0x27887e['options']);var _0x14314a={'where':_0x435e23['where']};return db[_0xf80d('0x31')][_0xf80d('0x21')](_0x14314a)[_0xf80d('0x27')](function(_0x2cd371){_0x487d2c[_0xf80d('0x21')]=_0x2cd371;if(_0x27887e[_0xf80d('0x36')][_0xf80d('0x45')]){_0x435e23[_0xf80d('0x46')]=[{'all':!![]}];}return db[_0xf80d('0x31')][_0xf80d('0x47')](_0x435e23);})[_0xf80d('0x27')](function(_0x437e44){_0x487d2c[_0xf80d('0x48')]=_0x437e44;return _0x487d2c;})[_0xf80d('0x27')](respondWithFilteredResult(_0x214bff,_0x435e23))[_0xf80d('0x49')](handleError(_0x214bff,null));};exports[_0xf80d('0x4a')]=function(_0x43474d,_0x9da271){var _0x19b7eb={'raw':![],'where':{'id':_0x43474d[_0xf80d('0x4b')]['id']}},_0x24c1e4={};_0x24c1e4[_0xf80d('0x39')]=_[_0xf80d('0x4c')](db[_0xf80d('0x31')][_0xf80d('0x32')]);_0x24c1e4['query']=_[_0xf80d('0x4c')](_0x43474d[_0xf80d('0x36')]);_0x24c1e4[_0xf80d('0x37')]=_[_0xf80d('0x38')](_0x24c1e4[_0xf80d('0x39')],_0x24c1e4['query']);_0x19b7eb[_0xf80d('0x3b')]=_[_0xf80d('0x38')](_0x24c1e4[_0xf80d('0x39')],qs[_0xf80d('0x3a')](_0x43474d[_0xf80d('0x36')][_0xf80d('0x3a')]));_0x19b7eb[_0xf80d('0x3b')]=_0x19b7eb[_0xf80d('0x3b')][_0xf80d('0x3c')]?_0x19b7eb[_0xf80d('0x3b')]:_0x24c1e4[_0xf80d('0x39')];if(_0x43474d[_0xf80d('0x36')][_0xf80d('0x45')]){_0x19b7eb[_0xf80d('0x46')]=[{'all':!![]}];}_0x19b7eb=_[_0xf80d('0x44')]({},_0x19b7eb,_0x43474d[_0xf80d('0x4d')]);return db[_0xf80d('0x31')]['find'](_0x19b7eb)[_0xf80d('0x27')](handleEntityNotFound(_0x9da271,null))[_0xf80d('0x27')](respondWithResult(_0x9da271,null))[_0xf80d('0x49')](handleError(_0x9da271,null));};exports['create']=function(_0x3e5cf6,_0x1088ca){return db['VoiceChanSpy']['create'](_0x3e5cf6[_0xf80d('0x4e')],{})['then'](function(_0xcb5fe7){var _0x24c70e=_0x3e5cf6[_0xf80d('0x4f')][_0xf80d('0x29')]({'plain':!![]});if(!_0x24c70e)throw new Error(_0xf80d('0x50'));if(_0x24c70e[_0xf80d('0x51')]===_0xf80d('0x4f')){var _0x114132=_0xcb5fe7[_0xf80d('0x29')]({'plain':!![]});var _0x1f20a2=_0xf80d('0x2a');return db[_0xf80d('0x52')]['find']({'where':{'name':_0x1f20a2,'userProfileId':_0x24c70e[_0xf80d('0x53')]},'raw':!![]})[_0xf80d('0x27')](function(_0x3c25d7){if(_0x3c25d7&&_0x3c25d7['autoAssociation']===0x0){return db[_0xf80d('0x54')][_0xf80d('0x55')]({'name':_0x114132['name'],'resourceId':_0x114132['id'],'type':_0x3c25d7[_0xf80d('0x2f')],'sectionId':_0x3c25d7['id']},{})[_0xf80d('0x27')](function(){return _0xcb5fe7;});}else{return _0xcb5fe7;}})['catch'](function(_0xee12ae){logger[_0xf80d('0x2d')](_0xf80d('0x56'),_0xee12ae);throw _0xee12ae;});}return _0xcb5fe7;})[_0xf80d('0x27')](respondWithResult(_0x1088ca,0xc9))['catch'](handleError(_0x1088ca,null));};exports[_0xf80d('0x26')]=function(_0x374985,_0x1a4c08){if(_0x374985['body']['id']){delete _0x374985[_0xf80d('0x4e')]['id'];}return db[_0xf80d('0x31')][_0xf80d('0x57')]({'where':{'id':_0x374985[_0xf80d('0x4b')]['id']}})[_0xf80d('0x27')](handleEntityNotFound(_0x1a4c08,null))[_0xf80d('0x27')](saveUpdates(_0x374985[_0xf80d('0x4e')],null))[_0xf80d('0x27')](respondWithResult(_0x1a4c08,null))[_0xf80d('0x49')](handleError(_0x1a4c08,null));};exports[_0xf80d('0x28')]=function(_0x543dba,_0x112342){return db[_0xf80d('0x31')][_0xf80d('0x57')]({'where':{'id':_0x543dba[_0xf80d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x112342,null))['then'](removeEntity(_0x112342,null))[_0xf80d('0x49')](handleError(_0x112342,null));};
\ No newline at end of file
index 0c37dc0..4ff674b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ab0=['SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate'];(function(_0x100f53,_0x29744b){var _0x349a52=function(_0x1944a3){while(--_0x1944a3){_0x100f53['push'](_0x100f53['shift']());}};_0x349a52(++_0x29744b);}(_0x8ab0,0x1e8));var _0x08ab=function(_0x21a8c4,_0x3c79bf){_0x21a8c4=_0x21a8c4-0x0;var _0x5d6c21=_0x8ab0[_0x21a8c4];return _0x5d6c21;};'use strict';var _=require(_0x08ab('0x0'));var util=require('util');var BPromise=require(_0x08ab('0x1'));var attributes=require(_0x08ab('0x2'));var getUserApplications=function(_0x5ddcf7,_0xc5eb71,_0x5a56e3){var _0x3a171e=0x1;var _0x50e244=[];var _0x9df0a9={'context':_0xc5eb71['context']||_0x08ab('0x3'),'exten':util[_0x08ab('0x4')](_0x08ab('0x5'),_0x5ddcf7[_0x08ab('0x6')],_0x5a56e3),'type':_0x08ab('0x7'),'isApp':![],'ChanSpyId':_0x5ddcf7['id'],'UserId':_0xc5eb71['id']};_0x50e244[_0x08ab('0x8')](_[_0x08ab('0x9')]({'app':_0x08ab('0xa'),'appdata':util[_0x08ab('0x4')](_0x08ab('0xb'),_0x08ab('0xc')),'priority':_0x3a171e++},_0x9df0a9));if(_0x5ddcf7[_0x08ab('0xd')]){_0x50e244[_0x08ab('0x8')](_[_0x08ab('0x9')]({'app':_0x08ab('0xe'),'appdata':util[_0x08ab('0x4')](_0x08ab('0xf'),_0x5ddcf7[_0x08ab('0x10')]),'priority':_0x3a171e++},_0x9df0a9));}if(_0x5ddcf7[_0x08ab('0x11')]){_0x50e244[_0x08ab('0x8')](_[_0x08ab('0x9')]({'app':_0x08ab('0x12'),'appdata':_0x5ddcf7['password'],'priority':_0x3a171e++},_0x9df0a9));}_0x50e244[_0x08ab('0x8')](_['merge']({'app':'ChanSpy','appdata':util[_0x08ab('0x4')](_0x08ab('0x13'),_0xc5eb71[_0x08ab('0x14')],_0x5ddcf7['options']?_0x5ddcf7[_0x08ab('0x15')][_0x08ab('0x16')](''):''),'priority':_0x3a171e++},_0x9df0a9));if(_0x5ddcf7['record']){_0x50e244['push'](_[_0x08ab('0x9')]({'app':_0x08ab('0x17'),'priority':_0x3a171e++},_0x9df0a9));}return _0x50e244;};var getChanSpyApplications=function(_0x1638ff,_0xf20451){var _0x15afe2=[];for(var _0x249336=0x0,_0x558994=0x1;_0x249336<_0xf20451[_0x08ab('0x18')];_0x249336++,_0x558994=0x1){_0x15afe2=_0x15afe2[_0x08ab('0x19')](getUserApplications(_0x1638ff,_0xf20451[_0x249336],_0xf20451[_0x249336][_0x08ab('0x1a')]));if(_0xf20451[_0x249336]['internal']!=_0xf20451[_0x249336][_0x08ab('0x14')]){_0x15afe2=_0x15afe2[_0x08ab('0x19')](getUserApplications(_0x1638ff,_0xf20451[_0x249336],_0xf20451[_0x249336][_0x08ab('0x14')]));}}return _0x15afe2;};var getChanSpyPromise=function(_0x3a9a53,_0x4e93c8){return new BPromise(function(_0x89c78e,_0x108357){return _0x3a9a53['User'][_0x08ab('0x1b')]({'attributes':['id',_0x08ab('0x14'),_0x08ab('0x1a')],'where':{'role':_0x08ab('0x1c'),'chanspy':!![]},'raw':!![]})[_0x08ab('0x1d')](function(_0x657667){if(_0x657667){return _0x89c78e(getChanSpyApplications(_0x4e93c8,_0x657667));}return _0x89c78e([]);})[_0x08ab('0x1e')](function(_0x24ecea){_0x108357(_0x24ecea);});});};module[_0x08ab('0x1f')]=function(_0x1a1c8e,_0x68bffc){var _0x20e577=_0x1a1c8e[_0x08ab('0x20')];return _0x1a1c8e[_0x08ab('0x21')](_0x08ab('0x22'),attributes,{'tableName':_0x08ab('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x27f2da,_0x1c5ad6,_0x4202e8){return getChanSpyPromise(_0x20e577,_0x27f2da)['then'](function(_0x5dd977){if(_0x5dd977&&_0x5dd977[_0x08ab('0x18')]){return _0x20e577[_0x08ab('0x24')][_0x08ab('0x25')](_0x5dd977);}})[_0x08ab('0x1d')](function(){_0x4202e8();})[_0x08ab('0x1e')](function(_0x46b3aa){_0x4202e8(_0x46b3aa);});},'afterUpdate':function(_0xdd637e,_0x1c15d3,_0x4855cd){return _0x20e577[_0x08ab('0x24')][_0x08ab('0x26')]({'where':{'ChanSpyId':_0xdd637e['id']}})[_0x08ab('0x1d')](function(){return getChanSpyPromise(_0x20e577,_0xdd637e);})[_0x08ab('0x1d')](function(_0x4ae605){if(_0x4ae605&&_0x4ae605['length']){return _0x20e577['VoiceExtension'][_0x08ab('0x25')](_0x4ae605);}})[_0x08ab('0x1d')](function(){_0x4855cd();})[_0x08ab('0x1e')](function(_0x1806de){_0x4855cd(_0x1806de);});},'afterDestroy':function(_0x1c271e,_0x3eb675,_0x36b6de){return _0x20e577['VoiceExtension'][_0x08ab('0x26')]({'where':{'ChanSpyId':_0x1c271e['id']}})[_0x08ab('0x1d')](function(){_0x36b6de();})[_0x08ab('0x1e')](function(_0x20459f){_0x36b6de(_0x20459f);});}}});};
\ No newline at end of file
+var _0x3717=['CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','password','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','bulkCreate','destroy','util','./voiceChanSpy.attributes','from-sip','format','system','push','merge','Set'];(function(_0x11f083,_0x38a7dd){var _0x1a41f3=function(_0x4570b5){while(--_0x4570b5){_0x11f083['push'](_0x11f083['shift']());}};_0x1a41f3(++_0x38a7dd);}(_0x3717,0x80));var _0x7371=function(_0x25069a,_0x38bba9){_0x25069a=_0x25069a-0x0;var _0x1cbaca=_0x3717[_0x25069a];return _0x1cbaca;};'use strict';var _=require('lodash');var util=require(_0x7371('0x0'));var BPromise=require('bluebird');var attributes=require(_0x7371('0x1'));var getUserApplications=function(_0x1a23e5,_0x2ac640,_0x27e030){var _0x36093c=0x1;var _0x4c8ba1=[];var _0x3bc475={'context':_0x2ac640['context']||_0x7371('0x2'),'exten':util[_0x7371('0x3')]('%s%s',_0x1a23e5['prefix'],_0x27e030),'type':_0x7371('0x4'),'isApp':![],'ChanSpyId':_0x1a23e5['id'],'UserId':_0x2ac640['id']};_0x4c8ba1[_0x7371('0x5')](_[_0x7371('0x6')]({'app':_0x7371('0x7'),'appdata':util[_0x7371('0x3')](_0x7371('0x8'),_0x7371('0x9')),'priority':_0x36093c++},_0x3bc475));if(_0x1a23e5[_0x7371('0xa')]){_0x4c8ba1[_0x7371('0x5')](_[_0x7371('0x6')]({'app':'MixMonitor','appdata':util[_0x7371('0x3')](_0x7371('0xb'),_0x1a23e5[_0x7371('0xc')]),'priority':_0x36093c++},_0x3bc475));}if(_0x1a23e5[_0x7371('0xd')]){_0x4c8ba1['push'](_[_0x7371('0x6')]({'app':'Authenticate','appdata':_0x1a23e5[_0x7371('0xe')],'priority':_0x36093c++},_0x3bc475));}_0x4c8ba1['push'](_['merge']({'app':'ChanSpy','appdata':util['format']('SIP/%s,%s',_0x2ac640[_0x7371('0xf')],_0x1a23e5[_0x7371('0x10')]?_0x1a23e5[_0x7371('0x10')][_0x7371('0x11')](''):''),'priority':_0x36093c++},_0x3bc475));if(_0x1a23e5[_0x7371('0xa')]){_0x4c8ba1[_0x7371('0x5')](_[_0x7371('0x6')]({'app':_0x7371('0x12'),'priority':_0x36093c++},_0x3bc475));}return _0x4c8ba1;};var getChanSpyApplications=function(_0x5ec4e3,_0xdd03d){var _0x2b1b25=[];for(var _0x3e9254=0x0,_0x2b8cdd=0x1;_0x3e9254<_0xdd03d[_0x7371('0x13')];_0x3e9254++,_0x2b8cdd=0x1){_0x2b1b25=_0x2b1b25[_0x7371('0x14')](getUserApplications(_0x5ec4e3,_0xdd03d[_0x3e9254],_0xdd03d[_0x3e9254][_0x7371('0x15')]));if(_0xdd03d[_0x3e9254][_0x7371('0x15')]!=_0xdd03d[_0x3e9254]['name']){_0x2b1b25=_0x2b1b25[_0x7371('0x14')](getUserApplications(_0x5ec4e3,_0xdd03d[_0x3e9254],_0xdd03d[_0x3e9254][_0x7371('0xf')]));}}return _0x2b1b25;};var getChanSpyPromise=function(_0x31907a,_0x59e9cc){return new BPromise(function(_0xd30010,_0x256085){return _0x31907a['User'][_0x7371('0x16')]({'attributes':['id','name',_0x7371('0x15')],'where':{'role':_0x7371('0x17'),'chanspy':!![]},'raw':!![]})[_0x7371('0x18')](function(_0x2f19b9){if(_0x2f19b9){return _0xd30010(getChanSpyApplications(_0x59e9cc,_0x2f19b9));}return _0xd30010([]);})['catch'](function(_0x5bdd1f){_0x256085(_0x5bdd1f);});});};module[_0x7371('0x19')]=function(_0x5ee680,_0x557e53){var _0x11e1e2=_0x5ee680[_0x7371('0x1a')];return _0x5ee680[_0x7371('0x1b')](_0x7371('0x1c'),attributes,{'tableName':_0x7371('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x44f52a,_0x39c09f,_0x26d079){return getChanSpyPromise(_0x11e1e2,_0x44f52a)['then'](function(_0x505527){if(_0x505527&&_0x505527[_0x7371('0x13')]){return _0x11e1e2[_0x7371('0x1e')]['bulkCreate'](_0x505527);}})[_0x7371('0x18')](function(){_0x26d079();})[_0x7371('0x1f')](function(_0x48536f){_0x26d079(_0x48536f);});},'afterUpdate':function(_0x10b6de,_0x514228,_0x54b404){return _0x11e1e2[_0x7371('0x1e')]['destroy']({'where':{'ChanSpyId':_0x10b6de['id']}})[_0x7371('0x18')](function(){return getChanSpyPromise(_0x11e1e2,_0x10b6de);})[_0x7371('0x18')](function(_0x1fe3de){if(_0x1fe3de&&_0x1fe3de['length']){return _0x11e1e2[_0x7371('0x1e')][_0x7371('0x20')](_0x1fe3de);}})[_0x7371('0x18')](function(){_0x54b404();})[_0x7371('0x1f')](function(_0x54ff74){_0x54b404(_0x54ff74);});},'afterDestroy':function(_0x55e3dc,_0x3bb5e1,_0x455b7f){return _0x11e1e2['VoiceExtension'][_0x7371('0x21')]({'where':{'ChanSpyId':_0x55e3dc['id']}})['then'](function(){_0x455b7f();})['catch'](function(_0x21f66d){_0x455b7f(_0x21f66d);});}}});};
\ No newline at end of file
index 1a46e3a..0088bea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe28e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x21d532,_0x4552a4){var _0x37bda1=function(_0x134a6f){while(--_0x134a6f){_0x21d532['push'](_0x21d532['shift']());}};_0x37bda1(++_0x4552a4);}(_0xe28e,0x1ba));var _0xee28=function(_0x3b366d,_0x2c5dae){_0x3b366d=_0x3b366d-0x0;var _0x2a5012=_0xe28e[_0x3b366d];return _0x2a5012;};'use strict';var _=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var moment=require(_0xee28('0x2'));var BPromise=require(_0xee28('0x3'));var rs=require(_0xee28('0x4'));var fs=require('fs');var Redis=require(_0xee28('0x5'));var db=require(_0xee28('0x6'))['db'];var utils=require(_0xee28('0x7'));var logger=require(_0xee28('0x8'))(_0xee28('0x9'));var config=require(_0xee28('0xa'));var jayson=require(_0xee28('0xb'));var client=jayson[_0xee28('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39b337,_0x30224a,_0x3f9bd9){return new BPromise(function(_0x66d0b6,_0x156aad){return client[_0xee28('0xd')](_0x39b337,_0x3f9bd9)[_0xee28('0xe')](function(_0x5d7562){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x30224a,_0xee28('0xf'));logger[_0xee28('0x10')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x30224a,_0xee28('0xf'),JSON[_0xee28('0x11')](_0x5d7562));if(_0x5d7562['error']){if(_0x5d7562[_0xee28('0x12')][_0xee28('0x13')]===0x1f4){logger[_0xee28('0x12')](_0xee28('0x14'),_0x30224a,_0x5d7562[_0xee28('0x12')][_0xee28('0x15')]);return _0x156aad(_0x5d7562[_0xee28('0x12')]['message']);}logger[_0xee28('0x12')](_0xee28('0x14'),_0x30224a,_0x5d7562[_0xee28('0x12')][_0xee28('0x15')]);return _0x66d0b6(_0x5d7562[_0xee28('0x12')]['message']);}else{logger[_0xee28('0x16')](_0xee28('0x14'),_0x30224a,_0xee28('0xf'));_0x66d0b6(_0x5d7562[_0xee28('0x17')][_0xee28('0x15')]);}})[_0xee28('0x18')](function(_0x4c0eb9){logger[_0xee28('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x30224a,_0x4c0eb9);_0x156aad(_0x4c0eb9);});});}
\ No newline at end of file
+var _0x0eaa=['http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5d98e4,_0x377619){var _0x36157d=function(_0x1b39fd){while(--_0x1b39fd){_0x5d98e4['push'](_0x5d98e4['shift']());}};_0x36157d(++_0x377619);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x7584cb,_0x2a13ff){_0x7584cb=_0x7584cb-0x0;var _0x40256c=_0x0eaa[_0x7584cb];return _0x40256c;};'use strict';var _=require(_0xa0ea('0x0'));var util=require(_0xa0ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0ea('0x2'));var fs=require('fs');var Redis=require(_0xa0ea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0ea('0x4'));var logger=require(_0xa0ea('0x5'))(_0xa0ea('0x6'));var config=require(_0xa0ea('0x7'));var jayson=require(_0xa0ea('0x8'));var client=jayson['client'][_0xa0ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x521881,_0x4b8856,_0x361178){return new BPromise(function(_0x8632a1,_0x5b2adc){return client['request'](_0x521881,_0x361178)[_0xa0ea('0xa')](function(_0x2746f2){logger[_0xa0ea('0xb')](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));logger['debug'](_0xa0ea('0xe'),_0x4b8856,_0xa0ea('0xd'),JSON[_0xa0ea('0xf')](_0x2746f2));if(_0x2746f2[_0xa0ea('0x10')]){if(_0x2746f2['error'][_0xa0ea('0x11')]===0x1f4){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x5b2adc(_0x2746f2['error'][_0xa0ea('0x12')]);}logger[_0xa0ea('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x8632a1(_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);}else{logger['info'](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));_0x8632a1(_0x2746f2[_0xa0ea('0x13')][_0xa0ea('0x12')]);}})[_0xa0ea('0x14')](function(_0x34b94c){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x34b94c);_0x5b2adc(_0x34b94c);});});}
\ No newline at end of file
index c2b258d..77b31ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1726=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','/:id','isAuthenticated'];(function(_0x57df3f,_0x6fed2f){var _0x4027d2=function(_0x43a570){while(--_0x43a570){_0x57df3f['push'](_0x57df3f['shift']());}};_0x4027d2(++_0x6fed2f);}(_0x1726,0xbc));var _0x6172=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x1726[_0x5235a6];return _0x1cf37e;};'use strict';var multer=require(_0x6172('0x0'));var util=require(_0x6172('0x1'));var path=require(_0x6172('0x2'));var timeout=require('connect-timeout');var express=require(_0x6172('0x3'));var router=express['Router']();var fs_extra=require(_0x6172('0x4'));var auth=require(_0x6172('0x5'));var interaction=require(_0x6172('0x6'));var config=require(_0x6172('0x7'));var controller=require(_0x6172('0x8'));router[_0x6172('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6172('0x9')](_0x6172('0xa'),auth[_0x6172('0xb')](),controller[_0x6172('0xc')]);router[_0x6172('0xd')]('/',auth['isAuthenticated'](),controller[_0x6172('0xe')]);router[_0x6172('0xf')](_0x6172('0xa'),auth[_0x6172('0xb')](),controller[_0x6172('0x10')]);router[_0x6172('0x11')](_0x6172('0xa'),auth[_0x6172('0xb')](),controller[_0x6172('0x12')]);module[_0x6172('0x13')]=router;
\ No newline at end of file
+var _0x080c=['post','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x080c,0xd1));var _0xc080=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x080c[_0x3c4f1f];return _0x19cb69;};'use strict';var multer=require(_0xc080('0x0'));var util=require(_0xc080('0x1'));var path=require('path');var timeout=require(_0xc080('0x2'));var express=require(_0xc080('0x3'));var router=express[_0xc080('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc080('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc080('0x6'));var controller=require(_0xc080('0x7'));router[_0xc080('0x8')]('/',auth[_0xc080('0x9')](),controller[_0xc080('0xa')]);router[_0xc080('0x8')]('/:id',auth[_0xc080('0x9')](),controller[_0xc080('0xb')]);router[_0xc080('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc080('0xd'),auth[_0xc080('0x9')](),controller[_0xc080('0xe')]);router['delete'](_0xc080('0xd'),auth[_0xc080('0x9')](),controller[_0xc080('0xf')]);module[_0xc080('0x10')]=router;
\ No newline at end of file
index 5b12468..1c2f8f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70f8=['sequelize','exports','STRING','name'];(function(_0x5a4410,_0x23b207){var _0x59c336=function(_0x4660cd){while(--_0x4660cd){_0x5a4410['push'](_0x5a4410['shift']());}};_0x59c336(++_0x23b207);}(_0x70f8,0x13c));var _0x870f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x70f8[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x870f('0x0'));module[_0x870f('0x1')]={'name':{'type':Sequelize[_0x870f('0x2')],'unique':_0x870f('0x3')},'description':{'type':Sequelize[_0x870f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x00c6=['exports','STRING','BOOLEAN','sequelize'];(function(_0x59c476,_0x5cd7fb){var _0x5c6e4f=function(_0x1e95c5){while(--_0x1e95c5){_0x59c476['push'](_0x59c476['shift']());}};_0x5c6e4f(++_0x5cd7fb);}(_0x00c6,0x9b));var _0x600c=function(_0x4e8b4c,_0x1fbc1b){_0x4e8b4c=_0x4e8b4c-0x0;var _0x3adef5=_0x00c6[_0x4e8b4c];return _0x3adef5;};'use strict';var Sequelize=require(_0x600c('0x0'));module[_0x600c('0x1')]={'name':{'type':Sequelize[_0x600c('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x600c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index cdcc9f3..725f9e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4254=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','server/files/templates/context.ejs','Reload','chan_sip.so','destroy','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','get','Contexts','UserProfileResource','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','show','params','keys','create','body','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','role','UserProfileSection','userProfileId'];(function(_0x19e5c9,_0x44a8a7){var _0x5129d0=function(_0x1ef79e){while(--_0x1ef79e){_0x19e5c9['push'](_0x19e5c9['shift']());}};_0x5129d0(++_0x44a8a7);}(_0x4254,0x13c));var _0x4425=function(_0x25622f,_0x48f2f0){_0x25622f=_0x25622f-0x0;var _0x3803a7=_0x4254[_0x25622f];return _0x3803a7;};'use strict';var emlformat=require(_0x4425('0x0'));var rimraf=require(_0x4425('0x1'));var zipdir=require(_0x4425('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4425('0x3'));var BPromise=require(_0x4425('0x4'));var Mustache=require('mustache');var util=require(_0x4425('0x5'));var path=require(_0x4425('0x6'));var sox=require(_0x4425('0x7'));var csv=require(_0x4425('0x8'));var ejs=require(_0x4425('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4425('0xa'));var squel=require('squel');var crypto=require(_0x4425('0xb'));var jsforce=require(_0x4425('0xc'));var deskjs=require(_0x4425('0xd'));var toCsv=require(_0x4425('0x8'));var querystring=require(_0x4425('0xe'));var Papa=require(_0x4425('0xf'));var Redis=require(_0x4425('0x10'));var authService=require(_0x4425('0x11'));var qs=require(_0x4425('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4425('0x13'))(_0x4425('0x14'));var utils=require('../../config/utils');var config=require(_0x4425('0x15'));var licenseUtil=require(_0x4425('0x16'));var db=require(_0x4425('0x17'))['db'];var jayson=require(_0x4425('0x18'));var client=jayson[_0x4425('0x19')][_0x4425('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1481f3,_0x1ada90,_0x31b942,_0x4cf082){return new BPromise(function(_0xb73c9,_0x276459){var _0x1932d9=_0x4cf082||client;return _0x1932d9[_0x4425('0x1b')](_0x1481f3,_0x31b942)[_0x4425('0x1c')](function(_0x21f1c5){logger['info'](_0x4425('0x1d'),_0x1ada90,_0x4425('0x1e'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1ada90,'request\x20sent',JSON[_0x4425('0x1f')](_0x21f1c5));if(_0x21f1c5[_0x4425('0x20')]){if(_0x21f1c5[_0x4425('0x20')][_0x4425('0x21')]===0x1f4){logger[_0x4425('0x20')](_0x4425('0x1d'),_0x1ada90,_0x21f1c5['error'][_0x4425('0x22')]);return _0x276459(_0x21f1c5[_0x4425('0x20')][_0x4425('0x22')]);}logger[_0x4425('0x20')](_0x4425('0x1d'),_0x1ada90,_0x21f1c5['error']['message']);return _0xb73c9(_0x21f1c5[_0x4425('0x20')]['message']);}else{logger['info'](_0x4425('0x1d'),_0x1ada90,_0x4425('0x1e'));_0xb73c9(_0x21f1c5[_0x4425('0x23')][_0x4425('0x22')]);}})[_0x4425('0x24')](function(_0x904706){logger[_0x4425('0x20')]('VoiceContext,\x20%s,\x20%s',_0x1ada90,_0x904706);_0x276459(_0x904706);});});}function respondWithStatusCode(_0x1ff428,_0x4e3fca){_0x4e3fca=_0x4e3fca||0xcc;return function(_0x1e9109){if(_0x1e9109){return _0x1ff428[_0x4425('0x25')](_0x4e3fca);}return _0x1ff428[_0x4425('0x26')](_0x4e3fca)[_0x4425('0x27')]();};}function respondWithResult(_0xd47a9d,_0xfcabca){_0xfcabca=_0xfcabca||0xc8;return function(_0x30b6fa){if(_0x30b6fa){return _0xd47a9d['status'](_0xfcabca)['json'](_0x30b6fa);}};}function respondWithFilteredResult(_0x334964,_0x28c8c3){return function(_0x817ce){if(_0x817ce){var _0x48ef3e=typeof _0x28c8c3[_0x4425('0x28')]===_0x4425('0x29')&&typeof _0x28c8c3[_0x4425('0x2a')]===_0x4425('0x29');var _0x49841a=_0x817ce[_0x4425('0x2b')];var _0x2dc9ae=_0x48ef3e?0x0:_0x28c8c3[_0x4425('0x28')];var _0x107a7a=_0x48ef3e?_0x817ce[_0x4425('0x2b')]:_0x28c8c3[_0x4425('0x28')]+_0x28c8c3[_0x4425('0x2a')];var _0x521e2b;if(_0x107a7a>=_0x49841a){_0x107a7a=_0x49841a;_0x521e2b=0xc8;}else{_0x521e2b=0xce;}_0x334964[_0x4425('0x26')](_0x521e2b);return _0x334964[_0x4425('0x2c')](_0x4425('0x2d'),_0x2dc9ae+'-'+_0x107a7a+'/'+_0x49841a)[_0x4425('0x2e')](_0x817ce);}return null;};}function patchUpdates(_0x453cd9){return function(_0x2488e2){try{jsonpatch[_0x4425('0x2f')](_0x2488e2,_0x453cd9,!![]);}catch(_0x5ae4cc){return BPromise[_0x4425('0x30')](_0x5ae4cc);}return _0x2488e2['save']();};}function saveUpdates(_0x2a0afa,_0x5e96c5){return function(_0x2ec9f2){if(_0x2ec9f2){return _0x2ec9f2[_0x4425('0x31')](_0x2a0afa)[_0x4425('0x1c')](function(_0x451286){return _0x451286;});}return null;};}function removeEntity(_0xe89b3e,_0x5e256a){return function(_0x11cf98){if(_0x11cf98){return _0x11cf98['destroy']()[_0x4425('0x1c')](function(){var _0x1cd1cb=_0x11cf98[_0x4425('0x32')]({'plain':!![]});var _0x52dce8=_0x4425('0x33');return db[_0x4425('0x34')]['destroy']({'where':{'type':_0x52dce8,'resourceId':_0x1cd1cb['id']}})[_0x4425('0x1c')](function(){return _0x11cf98;});})[_0x4425('0x1c')](function(){_0xe89b3e[_0x4425('0x26')](0xcc)[_0x4425('0x27')]();});}};}function handleEntityNotFound(_0x4bac4b,_0x5d478d){return function(_0x1c92e9){if(!_0x1c92e9){_0x4bac4b[_0x4425('0x25')](0x194);}return _0x1c92e9;};}function handleError(_0x37d596,_0x5c7511){_0x5c7511=_0x5c7511||0x1f4;return function(_0x1953bf){logger[_0x4425('0x20')](_0x1953bf['stack']);if(_0x1953bf[_0x4425('0x35')]){delete _0x1953bf[_0x4425('0x35')];}_0x37d596[_0x4425('0x26')](_0x5c7511)['send'](_0x1953bf);};}exports[_0x4425('0x36')]=function(_0xc917d0,_0x4e7afe){var _0x3db7dd={},_0x24a7f6={},_0x35310b={'count':0x0,'rows':[]};var _0x14863a=_[_0x4425('0x37')](db['VoiceContext'][_0x4425('0x38')],function(_0x15d179){return{'name':_0x15d179[_0x4425('0x39')],'type':_0x15d179[_0x4425('0x3a')][_0x4425('0x3b')]};});_0x24a7f6[_0x4425('0x3c')]=_['map'](_0x14863a,_0x4425('0x35'));_0x24a7f6[_0x4425('0x3d')]=_['keys'](_0xc917d0[_0x4425('0x3d')]);_0x24a7f6['filters']=_[_0x4425('0x3e')](_0x24a7f6[_0x4425('0x3c')],_0x24a7f6[_0x4425('0x3d')]);_0x3db7dd['attributes']=_[_0x4425('0x3e')](_0x24a7f6['model'],qs['fields'](_0xc917d0['query'][_0x4425('0x3f')]));_0x3db7dd['attributes']=_0x3db7dd[_0x4425('0x40')][_0x4425('0x41')]?_0x3db7dd['attributes']:_0x24a7f6['model'];if(!_0xc917d0['query'][_0x4425('0x42')]('nolimit')){_0x3db7dd['limit']=qs[_0x4425('0x2a')](_0xc917d0[_0x4425('0x3d')][_0x4425('0x2a')]);_0x3db7dd[_0x4425('0x28')]=qs[_0x4425('0x28')](_0xc917d0[_0x4425('0x3d')][_0x4425('0x28')]);}_0x3db7dd[_0x4425('0x43')]=qs[_0x4425('0x44')](_0xc917d0[_0x4425('0x3d')]['sort']);_0x3db7dd[_0x4425('0x45')]=qs[_0x4425('0x46')](_[_0x4425('0x47')](_0xc917d0[_0x4425('0x3d')],_0x24a7f6[_0x4425('0x46')]),_0x14863a);if(_0xc917d0[_0x4425('0x3d')][_0x4425('0x48')]){_0x3db7dd['where']=_[_0x4425('0x49')](_0x3db7dd[_0x4425('0x45')],{'$or':_[_0x4425('0x37')](_0x14863a,function(_0x3848c0){if(_0x3848c0[_0x4425('0x3a')]!==_0x4425('0x4a')){var _0x399cb3={};_0x399cb3[_0x3848c0[_0x4425('0x35')]]={'$like':'%'+_0xc917d0['query'][_0x4425('0x48')]+'%'};return _0x399cb3;}})});}_0x3db7dd=_[_0x4425('0x49')]({},_0x3db7dd,_0xc917d0[_0x4425('0x4b')]);var _0x8eb4af={'where':_0x3db7dd[_0x4425('0x45')]};return db[_0x4425('0x4c')][_0x4425('0x2b')](_0x8eb4af)[_0x4425('0x1c')](function(_0x5a2a88){_0x35310b[_0x4425('0x2b')]=_0x5a2a88;if(_0xc917d0[_0x4425('0x3d')][_0x4425('0x4d')]){_0x3db7dd[_0x4425('0x4e')]=[{'all':!![]}];}return db[_0x4425('0x4c')][_0x4425('0x4f')](_0x3db7dd);})[_0x4425('0x1c')](function(_0x431760){_0x35310b['rows']=_0x431760;return _0x35310b;})[_0x4425('0x1c')](respondWithFilteredResult(_0x4e7afe,_0x3db7dd))[_0x4425('0x24')](handleError(_0x4e7afe,null));};exports[_0x4425('0x50')]=function(_0x881b97,_0x3ccca7){var _0x35340c={'raw':![],'where':{'id':_0x881b97[_0x4425('0x51')]['id']}},_0x34b845={};_0x34b845[_0x4425('0x3c')]=_[_0x4425('0x52')](db[_0x4425('0x4c')][_0x4425('0x38')]);_0x34b845[_0x4425('0x3d')]=_['keys'](_0x881b97['query']);_0x34b845['filters']=_[_0x4425('0x3e')](_0x34b845[_0x4425('0x3c')],_0x34b845[_0x4425('0x3d')]);_0x35340c[_0x4425('0x40')]=_[_0x4425('0x3e')](_0x34b845[_0x4425('0x3c')],qs[_0x4425('0x3f')](_0x881b97[_0x4425('0x3d')][_0x4425('0x3f')]));_0x35340c[_0x4425('0x40')]=_0x35340c[_0x4425('0x40')][_0x4425('0x41')]?_0x35340c[_0x4425('0x40')]:_0x34b845[_0x4425('0x3c')];if(_0x881b97['query'][_0x4425('0x4d')]){_0x35340c['include']=[{'all':!![]}];}_0x35340c=_['merge']({},_0x35340c,_0x881b97['options']);return db['VoiceContext']['find'](_0x35340c)[_0x4425('0x1c')](handleEntityNotFound(_0x3ccca7,null))['then'](respondWithResult(_0x3ccca7,null))['catch'](handleError(_0x3ccca7,null));};exports[_0x4425('0x53')]=function(_0x187ea6,_0x4d682,_0x560d68){var _0x35aec1;return db[_0x4425('0x4c')]['create'](_0x187ea6[_0x4425('0x54')],{'raw':!![]})['then'](function(_0x3d63ec){_0x35aec1=_0x3d63ec;return db[_0x4425('0x4c')][_0x4425('0x4f')]({'raw':!![]});})['then'](function(_0x29fbba){var _0x32b652=fs[_0x4425('0x55')](path[_0x4425('0x56')](config[_0x4425('0x57')],'server/files/templates/context.ejs'),_0x4425('0x58'));var _0x447bb0=ejs[_0x4425('0x59')](_0x32b652,{'contexts':_0x29fbba||[]});fs[_0x4425('0x5a')](_0x4425('0x5b'),_0x447bb0);})[_0x4425('0x1c')](function(){return respondWithRpcPromise('Reload',_0x4425('0x53'),{'module':'chan_sip.so'});})['then'](function(){var _0x1e1eaa=_0x187ea6[_0x4425('0x5c')][_0x4425('0x32')]({'plain':!![]});if(!_0x1e1eaa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e1eaa[_0x4425('0x5d')]===_0x4425('0x5c')){var _0x5e6531=_0x35aec1[_0x4425('0x32')]({'plain':!![]});return db[_0x4425('0x5e')]['find']({'where':{'name':_0x4425('0x33'),'userProfileId':_0x1e1eaa[_0x4425('0x5f')]},'raw':!![]})[_0x4425('0x1c')](function(_0x5cfefd){if(_0x5cfefd&&_0x5cfefd[_0x4425('0x60')]===0x0){return db[_0x4425('0x34')]['create']({'name':_0x5e6531[_0x4425('0x35')],'resourceId':_0x5e6531['id'],'type':_0x5cfefd['name'],'sectionId':_0x5cfefd['id']},{})[_0x4425('0x1c')](function(){return _0x35aec1;});}else{return _0x35aec1;}})[_0x4425('0x24')](function(_0x4779f4){logger[_0x4425('0x20')](_0x4425('0x61'),_0x4779f4);throw _0x4779f4;});}return _0x35aec1;})['then'](respondWithResult(_0x4d682,0xc9))[_0x4425('0x24')](handleError(_0x4d682,null));};exports[_0x4425('0x31')]=function(_0x112e04,_0x5a110a,_0x5e2a9e){var _0x3b722b;return db[_0x4425('0x4c')][_0x4425('0x62')]({'where':{'id':_0x112e04['params']['id']}})[_0x4425('0x1c')](handleEntityNotFound(_0x5a110a,null))[_0x4425('0x1c')](saveUpdates(_0x112e04[_0x4425('0x54')],null))[_0x4425('0x1c')](function(_0xcde7da){if(_0xcde7da){_0x3b722b=_0xcde7da;return db['VoiceContext'][_0x4425('0x4f')]({'raw':!![]});}})[_0x4425('0x1c')](function(_0x488565){var _0x5072e7=fs[_0x4425('0x55')](path[_0x4425('0x56')](config['root'],_0x4425('0x63')),_0x4425('0x58'));var _0x607813=ejs[_0x4425('0x59')](_0x5072e7,{'contexts':_0x488565||[]});fs[_0x4425('0x5a')](_0x4425('0x5b'),_0x607813);})[_0x4425('0x1c')](function(){return respondWithRpcPromise(_0x4425('0x64'),_0x4425('0x31'),{'module':_0x4425('0x65')});})['then'](function(){return _0x3b722b;})[_0x4425('0x1c')](respondWithResult(_0x5a110a,null))[_0x4425('0x24')](handleError(_0x5a110a,null));};exports[_0x4425('0x66')]=function(_0x5bcc68,_0x5b1266,_0xff2565){var _0x40bcd6;return db[_0x4425('0x4c')][_0x4425('0x62')]({'where':{'id':_0x5bcc68['params']['id']}})['then'](handleEntityNotFound(_0x5b1266,null))[_0x4425('0x1c')](removeEntity(_0x5b1266,null))[_0x4425('0x1c')](function(){return db[_0x4425('0x4c')]['findAll']({'raw':!![]});})[_0x4425('0x1c')](function(_0x20f8f6){var _0x3c3bd9=fs[_0x4425('0x55')](path[_0x4425('0x56')](config[_0x4425('0x57')],_0x4425('0x63')),_0x4425('0x58'));var _0x13ed2e=ejs['render'](_0x3c3bd9,{'contexts':_0x20f8f6});fs[_0x4425('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x13ed2e);return respondWithRpcPromise('Reload',_0x4425('0x66'),{'module':_0x4425('0x65')});})['catch'](handleError(_0x5b1266,null));};
\ No newline at end of file
+var _0x3895=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0xb515c5,_0x4ee6ae){var _0x50ee1c=function(_0x40bbe5){while(--_0x40bbe5){_0xb515c5['push'](_0xb515c5['shift']());}};_0x50ee1c(++_0x4ee6ae);}(_0x3895,0x193));var _0x5389=function(_0x11d2ed,_0x485e91){_0x11d2ed=_0x11d2ed-0x0;var _0x4df55c=_0x3895[_0x11d2ed];return _0x4df55c;};'use strict';var emlformat=require(_0x5389('0x0'));var rimraf=require(_0x5389('0x1'));var zipdir=require(_0x5389('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5389('0x3'));var moment=require(_0x5389('0x4'));var BPromise=require(_0x5389('0x5'));var Mustache=require(_0x5389('0x6'));var util=require(_0x5389('0x7'));var path=require(_0x5389('0x8'));var sox=require(_0x5389('0x9'));var csv=require(_0x5389('0xa'));var ejs=require(_0x5389('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5389('0xc'));var squel=require('squel');var crypto=require(_0x5389('0xd'));var jsforce=require(_0x5389('0xe'));var deskjs=require(_0x5389('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5389('0x10'));var Papa=require(_0x5389('0x11'));var Redis=require(_0x5389('0x12'));var authService=require(_0x5389('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5389('0x14'));var hardwareService=require(_0x5389('0x15'));var logger=require(_0x5389('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5389('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5389('0x18'));var client=jayson[_0x5389('0x19')][_0x5389('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1010ae,_0x59bc96,_0x448a23,_0x46b65c){return new BPromise(function(_0x2f5e6f,_0x322f0c){var _0x1cfcf4=_0x46b65c||client;return _0x1cfcf4[_0x5389('0x1b')](_0x1010ae,_0x448a23)[_0x5389('0x1c')](function(_0x43c188){logger[_0x5389('0x1d')](_0x5389('0x1e'),_0x59bc96,_0x5389('0x1f'));logger['debug'](_0x5389('0x20'),_0x59bc96,_0x5389('0x1f'),JSON[_0x5389('0x21')](_0x43c188));if(_0x43c188[_0x5389('0x22')]){if(_0x43c188['error'][_0x5389('0x23')]===0x1f4){logger['error'](_0x5389('0x1e'),_0x59bc96,_0x43c188['error'][_0x5389('0x24')]);return _0x322f0c(_0x43c188[_0x5389('0x22')][_0x5389('0x24')]);}logger[_0x5389('0x22')](_0x5389('0x1e'),_0x59bc96,_0x43c188[_0x5389('0x22')][_0x5389('0x24')]);return _0x2f5e6f(_0x43c188[_0x5389('0x22')][_0x5389('0x24')]);}else{logger[_0x5389('0x1d')](_0x5389('0x1e'),_0x59bc96,'request\x20sent');_0x2f5e6f(_0x43c188['result']['message']);}})['catch'](function(_0x38f8c5){logger[_0x5389('0x22')](_0x5389('0x1e'),_0x59bc96,_0x38f8c5);_0x322f0c(_0x38f8c5);});});}function respondWithStatusCode(_0x29be40,_0x5a080a){_0x5a080a=_0x5a080a||0xcc;return function(_0x5e3b62){if(_0x5e3b62){return _0x29be40[_0x5389('0x25')](_0x5a080a);}return _0x29be40['status'](_0x5a080a)['end']();};}function respondWithResult(_0x8ed3ed,_0x59a2c1){_0x59a2c1=_0x59a2c1||0xc8;return function(_0x263b29){if(_0x263b29){return _0x8ed3ed[_0x5389('0x26')](_0x59a2c1)['json'](_0x263b29);}};}function respondWithFilteredResult(_0x483e25,_0x1ac104){return function(_0x3e2502){if(_0x3e2502){var _0x3ba6e8=typeof _0x1ac104[_0x5389('0x27')]==='undefined'&&typeof _0x1ac104[_0x5389('0x28')]==='undefined';var _0x371454=_0x3e2502['count'];var _0x3b0085=_0x3ba6e8?0x0:_0x1ac104[_0x5389('0x27')];var _0x179a5e=_0x3ba6e8?_0x3e2502[_0x5389('0x29')]:_0x1ac104[_0x5389('0x27')]+_0x1ac104[_0x5389('0x28')];var _0x3bd771;if(_0x179a5e>=_0x371454){_0x179a5e=_0x371454;_0x3bd771=0xc8;}else{_0x3bd771=0xce;}_0x483e25[_0x5389('0x26')](_0x3bd771);return _0x483e25[_0x5389('0x2a')](_0x5389('0x2b'),_0x3b0085+'-'+_0x179a5e+'/'+_0x371454)[_0x5389('0x2c')](_0x3e2502);}return null;};}function patchUpdates(_0x27c3c9){return function(_0x2af300){try{jsonpatch[_0x5389('0x2d')](_0x2af300,_0x27c3c9,!![]);}catch(_0x44813e){return BPromise[_0x5389('0x2e')](_0x44813e);}return _0x2af300[_0x5389('0x2f')]();};}function saveUpdates(_0x4af5c4,_0x322d63){return function(_0x101f21){if(_0x101f21){return _0x101f21['update'](_0x4af5c4)['then'](function(_0x53e0d6){return _0x53e0d6;});}return null;};}function removeEntity(_0x2dbb9e,_0x2cdea3){return function(_0x5887fc){if(_0x5887fc){return _0x5887fc[_0x5389('0x30')]()[_0x5389('0x1c')](function(){var _0x43ec19=_0x5887fc[_0x5389('0x31')]({'plain':!![]});var _0x110ac8='Contexts';return db[_0x5389('0x32')][_0x5389('0x30')]({'where':{'type':_0x110ac8,'resourceId':_0x43ec19['id']}})[_0x5389('0x1c')](function(){return _0x5887fc;});})[_0x5389('0x1c')](function(){_0x2dbb9e[_0x5389('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5f41,_0x60f5f5){return function(_0x364da0){if(!_0x364da0){_0x2b5f41[_0x5389('0x25')](0x194);}return _0x364da0;};}function handleError(_0x38cdf3,_0x4d9fa0){_0x4d9fa0=_0x4d9fa0||0x1f4;return function(_0x4f8a18){logger[_0x5389('0x22')](_0x4f8a18[_0x5389('0x33')]);if(_0x4f8a18['name']){delete _0x4f8a18[_0x5389('0x34')];}_0x38cdf3['status'](_0x4d9fa0)[_0x5389('0x35')](_0x4f8a18);};}exports[_0x5389('0x36')]=function(_0x513395,_0x5b1eb2){var _0x2e354d={},_0x380c96={},_0x3d73c5={'count':0x0,'rows':[]};var _0x5a200c=_[_0x5389('0x37')](db[_0x5389('0x38')][_0x5389('0x39')],function(_0x1d5d85){return{'name':_0x1d5d85[_0x5389('0x3a')],'type':_0x1d5d85['type'][_0x5389('0x3b')]};});_0x380c96['model']=_[_0x5389('0x37')](_0x5a200c,_0x5389('0x34'));_0x380c96[_0x5389('0x3c')]=_[_0x5389('0x3d')](_0x513395[_0x5389('0x3c')]);_0x380c96[_0x5389('0x3e')]=_[_0x5389('0x3f')](_0x380c96[_0x5389('0x40')],_0x380c96[_0x5389('0x3c')]);_0x2e354d[_0x5389('0x41')]=_[_0x5389('0x3f')](_0x380c96['model'],qs[_0x5389('0x42')](_0x513395[_0x5389('0x3c')][_0x5389('0x42')]));_0x2e354d[_0x5389('0x41')]=_0x2e354d[_0x5389('0x41')][_0x5389('0x43')]?_0x2e354d['attributes']:_0x380c96[_0x5389('0x40')];if(!_0x513395[_0x5389('0x3c')][_0x5389('0x44')](_0x5389('0x45'))){_0x2e354d[_0x5389('0x28')]=qs[_0x5389('0x28')](_0x513395[_0x5389('0x3c')]['limit']);_0x2e354d['offset']=qs[_0x5389('0x27')](_0x513395[_0x5389('0x3c')][_0x5389('0x27')]);}_0x2e354d[_0x5389('0x46')]=qs[_0x5389('0x47')](_0x513395['query'][_0x5389('0x47')]);_0x2e354d[_0x5389('0x48')]=qs[_0x5389('0x3e')](_['pick'](_0x513395[_0x5389('0x3c')],_0x380c96[_0x5389('0x3e')]),_0x5a200c);if(_0x513395[_0x5389('0x3c')][_0x5389('0x49')]){_0x2e354d[_0x5389('0x48')]=_[_0x5389('0x4a')](_0x2e354d['where'],{'$or':_[_0x5389('0x37')](_0x5a200c,function(_0x5cb4c1){if(_0x5cb4c1[_0x5389('0x4b')]!==_0x5389('0x4c')){var _0x4c8211={};_0x4c8211[_0x5cb4c1['name']]={'$like':'%'+_0x513395[_0x5389('0x3c')][_0x5389('0x49')]+'%'};return _0x4c8211;}})});}_0x2e354d=_[_0x5389('0x4a')]({},_0x2e354d,_0x513395[_0x5389('0x4d')]);var _0xac6fdc={'where':_0x2e354d[_0x5389('0x48')]};return db[_0x5389('0x38')]['count'](_0xac6fdc)[_0x5389('0x1c')](function(_0x19312a){_0x3d73c5[_0x5389('0x29')]=_0x19312a;if(_0x513395['query'][_0x5389('0x4e')]){_0x2e354d[_0x5389('0x4f')]=[{'all':!![]}];}return db[_0x5389('0x38')]['findAll'](_0x2e354d);})[_0x5389('0x1c')](function(_0x362da9){_0x3d73c5['rows']=_0x362da9;return _0x3d73c5;})[_0x5389('0x1c')](respondWithFilteredResult(_0x5b1eb2,_0x2e354d))[_0x5389('0x50')](handleError(_0x5b1eb2,null));};exports[_0x5389('0x51')]=function(_0x56e562,_0xa0f059){var _0x1efc1a={'raw':![],'where':{'id':_0x56e562[_0x5389('0x52')]['id']}},_0x774b3={};_0x774b3[_0x5389('0x40')]=_[_0x5389('0x3d')](db[_0x5389('0x38')][_0x5389('0x39')]);_0x774b3[_0x5389('0x3c')]=_['keys'](_0x56e562[_0x5389('0x3c')]);_0x774b3['filters']=_[_0x5389('0x3f')](_0x774b3[_0x5389('0x40')],_0x774b3[_0x5389('0x3c')]);_0x1efc1a[_0x5389('0x41')]=_[_0x5389('0x3f')](_0x774b3[_0x5389('0x40')],qs['fields'](_0x56e562[_0x5389('0x3c')]['fields']));_0x1efc1a[_0x5389('0x41')]=_0x1efc1a['attributes']['length']?_0x1efc1a[_0x5389('0x41')]:_0x774b3[_0x5389('0x40')];if(_0x56e562[_0x5389('0x3c')]['includeAll']){_0x1efc1a['include']=[{'all':!![]}];}_0x1efc1a=_[_0x5389('0x4a')]({},_0x1efc1a,_0x56e562[_0x5389('0x4d')]);return db['VoiceContext'][_0x5389('0x53')](_0x1efc1a)['then'](handleEntityNotFound(_0xa0f059,null))[_0x5389('0x1c')](respondWithResult(_0xa0f059,null))[_0x5389('0x50')](handleError(_0xa0f059,null));};exports[_0x5389('0x54')]=function(_0x17b248,_0xde1cbb,_0x40b766){var _0x32371e;return db[_0x5389('0x38')][_0x5389('0x54')](_0x17b248[_0x5389('0x55')],{'raw':!![]})[_0x5389('0x1c')](function(_0x543a28){_0x32371e=_0x543a28;return db[_0x5389('0x38')]['findAll']({'raw':!![]});})[_0x5389('0x1c')](function(_0x12adaa){var _0x10abcd=fs[_0x5389('0x56')](path[_0x5389('0x57')](config[_0x5389('0x58')],'server/files/templates/context.ejs'),_0x5389('0x59'));var _0x262079=ejs[_0x5389('0x5a')](_0x10abcd,{'contexts':_0x12adaa||[]});fs[_0x5389('0x5b')](_0x5389('0x5c'),_0x262079);})['then'](function(){return respondWithRpcPromise('Reload',_0x5389('0x54'),{'module':_0x5389('0x5d')});})[_0x5389('0x1c')](function(){var _0x4840c0=_0x17b248[_0x5389('0x5e')]['get']({'plain':!![]});if(!_0x4840c0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4840c0['role']===_0x5389('0x5e')){var _0x1bcb9d=_0x32371e[_0x5389('0x31')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5389('0x5f'),'userProfileId':_0x4840c0[_0x5389('0x60')]},'raw':!![]})[_0x5389('0x1c')](function(_0x51394e){if(_0x51394e&&_0x51394e[_0x5389('0x61')]===0x0){return db[_0x5389('0x32')][_0x5389('0x54')]({'name':_0x1bcb9d['name'],'resourceId':_0x1bcb9d['id'],'type':_0x51394e[_0x5389('0x34')],'sectionId':_0x51394e['id']},{})['then'](function(){return _0x32371e;});}else{return _0x32371e;}})['catch'](function(_0x547f10){logger['error'](_0x5389('0x62'),_0x547f10);throw _0x547f10;});}return _0x32371e;})[_0x5389('0x1c')](respondWithResult(_0xde1cbb,0xc9))[_0x5389('0x50')](handleError(_0xde1cbb,null));};exports['update']=function(_0x56d9ca,_0x46b6c3,_0x5b042e){var _0x3bf8bb;return db[_0x5389('0x38')][_0x5389('0x53')]({'where':{'id':_0x56d9ca[_0x5389('0x52')]['id']}})[_0x5389('0x1c')](handleEntityNotFound(_0x46b6c3,null))['then'](saveUpdates(_0x56d9ca[_0x5389('0x55')],null))[_0x5389('0x1c')](function(_0x4e2cc5){if(_0x4e2cc5){_0x3bf8bb=_0x4e2cc5;return db[_0x5389('0x38')]['findAll']({'raw':!![]});}})[_0x5389('0x1c')](function(_0x574ba0){var _0x4da463=fs['readFileSync'](path['join'](config[_0x5389('0x58')],_0x5389('0x63')),'utf8');var _0x3692d2=ejs[_0x5389('0x5a')](_0x4da463,{'contexts':_0x574ba0||[]});fs[_0x5389('0x5b')](_0x5389('0x5c'),_0x3692d2);})[_0x5389('0x1c')](function(){return respondWithRpcPromise(_0x5389('0x64'),_0x5389('0x65'),{'module':_0x5389('0x5d')});})[_0x5389('0x1c')](function(){return _0x3bf8bb;})[_0x5389('0x1c')](respondWithResult(_0x46b6c3,null))[_0x5389('0x50')](handleError(_0x46b6c3,null));};exports[_0x5389('0x30')]=function(_0x53dc25,_0x80dbf8,_0x3c1bcb){var _0x37522d;return db['VoiceContext'][_0x5389('0x53')]({'where':{'id':_0x53dc25[_0x5389('0x52')]['id']}})[_0x5389('0x1c')](handleEntityNotFound(_0x80dbf8,null))[_0x5389('0x1c')](removeEntity(_0x80dbf8,null))['then'](function(){return db[_0x5389('0x38')]['findAll']({'raw':!![]});})[_0x5389('0x1c')](function(_0x7ed31a){var _0x1c1def=fs[_0x5389('0x56')](path[_0x5389('0x57')](config[_0x5389('0x58')],_0x5389('0x63')),_0x5389('0x59'));var _0x54c842=ejs[_0x5389('0x5a')](_0x1c1def,{'contexts':_0x7ed31a});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x54c842);return respondWithRpcPromise(_0x5389('0x64'),_0x5389('0x30'),{'module':'chan_sip.so'});})[_0x5389('0x50')](handleError(_0x80dbf8,null));};
\ No newline at end of file
index 2d68b42..5155bad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b1d=['../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x21f24b,_0x4bd432){var _0x364efc=function(_0x3f31a2){while(--_0x3f31a2){_0x21f24b['push'](_0x21f24b['shift']());}};_0x364efc(++_0x4bd432);}(_0x1b1d,0x16d));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1b1('0x0'));var util=require(_0xd1b1('0x1'));var logger=require('../../config/logger')(_0xd1b1('0x2'));var moment=require(_0xd1b1('0x3'));var BPromise=require('bluebird');var rp=require(_0xd1b1('0x4'));var fs=require('fs');var path=require(_0xd1b1('0x5'));var rimraf=require(_0xd1b1('0x6'));var config=require(_0xd1b1('0x7'));var attributes=require(_0xd1b1('0x8'));module['exports']=function(_0x5ab041,_0x150b11){return _0x5ab041[_0xd1b1('0x9')](_0xd1b1('0xa'),attributes,{'tableName':_0xd1b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f59=['../../config/environment','./voiceContext.attributes','exports','VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4ed2fe,_0x3db5c5){var _0x20e387=function(_0x49c2cb){while(--_0x49c2cb){_0x4ed2fe['push'](_0x4ed2fe['shift']());}};_0x20e387(++_0x3db5c5);}(_0x6f59,0x1be));var _0x96f5=function(_0x4b4ec0,_0x1591de){_0x4b4ec0=_0x4b4ec0-0x0;var _0x9fedf8=_0x6f59[_0x4b4ec0];return _0x9fedf8;};'use strict';var _=require(_0x96f5('0x0'));var util=require(_0x96f5('0x1'));var logger=require(_0x96f5('0x2'))(_0x96f5('0x3'));var moment=require(_0x96f5('0x4'));var BPromise=require(_0x96f5('0x5'));var rp=require(_0x96f5('0x6'));var fs=require('fs');var path=require(_0x96f5('0x7'));var rimraf=require(_0x96f5('0x8'));var config=require(_0x96f5('0x9'));var attributes=require(_0x96f5('0xa'));module[_0x96f5('0xb')]=function(_0x598154,_0xf6cd7d){return _0x598154['define'](_0x96f5('0xc'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 04d37b6..6a8b7ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1564=['debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s'];(function(_0x45e8f0,_0xb1fbe4){var _0x368139=function(_0x2c8a88){while(--_0x2c8a88){_0x45e8f0['push'](_0x45e8f0['shift']());}};_0x368139(++_0xb1fbe4);}(_0x1564,0x125));var _0x4156=function(_0x201643,_0x580320){_0x201643=_0x201643-0x0;var _0x398865=_0x1564[_0x201643];return _0x398865;};'use strict';var _=require(_0x4156('0x0'));var util=require(_0x4156('0x1'));var moment=require(_0x4156('0x2'));var BPromise=require(_0x4156('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4156('0x4'));var db=require(_0x4156('0x5'))['db'];var utils=require(_0x4156('0x6'));var logger=require(_0x4156('0x7'))(_0x4156('0x8'));var config=require(_0x4156('0x9'));var jayson=require(_0x4156('0xa'));var client=jayson[_0x4156('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a49d1,_0x5d0d0b,_0x2dcaf1){return new BPromise(function(_0x492aec,_0x347f0e){return client[_0x4156('0xc')](_0x5a49d1,_0x2dcaf1)['then'](function(_0x276ad6){logger[_0x4156('0xd')](_0x4156('0xe'),_0x5d0d0b,'request\x20sent');logger[_0x4156('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5d0d0b,_0x4156('0x10'),JSON[_0x4156('0x11')](_0x276ad6));if(_0x276ad6['error']){if(_0x276ad6[_0x4156('0x12')][_0x4156('0x13')]===0x1f4){logger[_0x4156('0x12')](_0x4156('0xe'),_0x5d0d0b,_0x276ad6[_0x4156('0x12')][_0x4156('0x14')]);return _0x347f0e(_0x276ad6[_0x4156('0x12')][_0x4156('0x14')]);}logger['error'](_0x4156('0xe'),_0x5d0d0b,_0x276ad6[_0x4156('0x12')][_0x4156('0x14')]);return _0x492aec(_0x276ad6[_0x4156('0x12')][_0x4156('0x14')]);}else{logger['info'](_0x4156('0xe'),_0x5d0d0b,'request\x20sent');_0x492aec(_0x276ad6['result'][_0x4156('0x14')]);}})[_0x4156('0x15')](function(_0x70e570){logger[_0x4156('0x12')](_0x4156('0xe'),_0x5d0d0b,_0x70e570);_0x347f0e(_0x70e570);});});}
\ No newline at end of file
+var _0xb78e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x699072,_0x3aca68){var _0x44edc2=function(_0x3c1e8b){while(--_0x3c1e8b){_0x699072['push'](_0x699072['shift']());}};_0x44edc2(++_0x3aca68);}(_0xb78e,0x1c9));var _0xeb78=function(_0x2bcbb0,_0x2f41a1){_0x2bcbb0=_0x2bcbb0-0x0;var _0x34c476=_0xb78e[_0x2bcbb0];return _0x34c476;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('VoiceContext,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});}
\ No newline at end of file
index ace288b..d584e73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc995=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','/:id'];(function(_0x56312b,_0x38f5c2){var _0x2cf4d1=function(_0x2b973f){while(--_0x2b973f){_0x56312b['push'](_0x56312b['shift']());}};_0x2cf4d1(++_0x38f5c2);}(_0xc995,0x8c));var _0x5c99=function(_0x33cefb,_0x554cba){_0x33cefb=_0x33cefb-0x0;var _0x3a8dfb=_0xc995[_0x33cefb];return _0x3a8dfb;};'use strict';var multer=require(_0x5c99('0x0'));var util=require(_0x5c99('0x1'));var path=require(_0x5c99('0x2'));var timeout=require(_0x5c99('0x3'));var express=require(_0x5c99('0x4'));var router=express[_0x5c99('0x5')]();var fs_extra=require(_0x5c99('0x6'));var auth=require(_0x5c99('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5c99('0x8'));var controller=require('./voiceDialReport.controller');router[_0x5c99('0x9')]('/',auth['isAuthenticated'](),controller[_0x5c99('0xa')]);router[_0x5c99('0x9')](_0x5c99('0xb'),auth[_0x5c99('0xc')](),controller['describe']);router[_0x5c99('0x9')](_0x5c99('0xd'),auth[_0x5c99('0xc')](),controller[_0x5c99('0xe')]);router[_0x5c99('0xf')]('/',auth['isAuthenticated'](),controller[_0x5c99('0x10')]);router[_0x5c99('0x11')]('/:id',auth[_0x5c99('0xc')](),controller[_0x5c99('0x12')]);router[_0x5c99('0x13')](_0x5c99('0xd'),auth[_0x5c99('0xc')](),controller[_0x5c99('0x14')]);module[_0x5c99('0x15')]=router;
\ No newline at end of file
+var _0x1acc=['/describe','isAuthenticated','show','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','get','index'];(function(_0x49a5f6,_0x2eea42){var _0x22fe92=function(_0x4ed337){while(--_0x4ed337){_0x49a5f6['push'](_0x49a5f6['shift']());}};_0x22fe92(++_0x2eea42);}(_0x1acc,0x15c));var _0xc1ac=function(_0x40d80e,_0x51e0a1){_0x40d80e=_0x40d80e-0x0;var _0x445bd0=_0x1acc[_0x40d80e];return _0x445bd0;};'use strict';var multer=require(_0xc1ac('0x0'));var util=require(_0xc1ac('0x1'));var path=require(_0xc1ac('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1ac('0x3'));var router=express[_0xc1ac('0x4')]();var fs_extra=require(_0xc1ac('0x5'));var auth=require(_0xc1ac('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0xc1ac('0x7')]('/',auth['isAuthenticated'](),controller[_0xc1ac('0x8')]);router[_0xc1ac('0x7')](_0xc1ac('0x9'),auth[_0xc1ac('0xa')](),controller['describe']);router[_0xc1ac('0x7')]('/:id',auth[_0xc1ac('0xa')](),controller[_0xc1ac('0xb')]);router['post']('/',auth[_0xc1ac('0xa')](),controller['create']);router[_0xc1ac('0xc')](_0xc1ac('0xd'),auth[_0xc1ac('0xa')](),controller[_0xc1ac('0xe')]);router[_0xc1ac('0xf')](_0xc1ac('0xd'),auth[_0xc1ac('0xa')](),controller['destroy']);module[_0xc1ac('0x10')]=router;
\ No newline at end of file
index 736b654..50a7397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x2c4ce4,_0x43083a){var _0x5a3901=function(_0x405062){while(--_0x405062){_0x2c4ce4['push'](_0x2c4ce4['shift']());}};_0x5a3901(++_0x43083a);}(_0x6aa7,0x178));var _0x76aa=function(_0x4bfdd1,_0x30bbec){_0x4bfdd1=_0x4bfdd1-0x0;var _0xc934e0=_0x6aa7[_0x4bfdd1];return _0xc934e0;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x597945,_0x3da022){var _0x5cfe5b=function(_0x1f8431){while(--_0x1f8431){_0x597945['push'](_0x597945['shift']());}};_0x5cfe5b(++_0x3da022);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x24ca[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
index 4057344..65cea5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dd2=['stack','name','index','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','VoiceDialReport','include','findAll','catch','show','keys','rawAttributes','merge','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x5e2735,_0x23e0d3){var _0x1e8622=function(_0x370a09){while(--_0x370a09){_0x5e2735['push'](_0x5e2735['shift']());}};_0x1e8622(++_0x23e0d3);}(_0x5dd2,0x1d8));var _0x25dd=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x5dd2[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0x25dd('0x0'));var rimraf=require(_0x25dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25dd('0x2'));var rp=require(_0x25dd('0x3'));var moment=require(_0x25dd('0x4'));var BPromise=require(_0x25dd('0x5'));var Mustache=require('mustache');var util=require(_0x25dd('0x6'));var path=require('path');var sox=require(_0x25dd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25dd('0x8'));var crypto=require(_0x25dd('0x9'));var jsforce=require(_0x25dd('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x25dd('0xb'));var querystring=require(_0x25dd('0xc'));var Papa=require(_0x25dd('0xd'));var Redis=require(_0x25dd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x25dd('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25dd('0x10'));var logger=require('../../config/logger')(_0x25dd('0x11'));var utils=require(_0x25dd('0x12'));var config=require(_0x25dd('0x13'));var licenseUtil=require(_0x25dd('0x14'));var db=require(_0x25dd('0x15'))['db'];function respondWithStatusCode(_0x45f216,_0x58c60b){_0x58c60b=_0x58c60b||0xcc;return function(_0x55abef){if(_0x55abef){return _0x45f216['sendStatus'](_0x58c60b);}return _0x45f216[_0x25dd('0x16')](_0x58c60b)[_0x25dd('0x17')]();};}function respondWithResult(_0x3aefa0,_0x47a3dd){_0x47a3dd=_0x47a3dd||0xc8;return function(_0x1b2d77){if(_0x1b2d77){return _0x3aefa0[_0x25dd('0x16')](_0x47a3dd)[_0x25dd('0x18')](_0x1b2d77);}};}function respondWithFilteredResult(_0x2c9f0a,_0x3ed419){return function(_0x2357b1){if(_0x2357b1){var _0x55d963=typeof _0x3ed419['offset']===_0x25dd('0x19')&&typeof _0x3ed419[_0x25dd('0x1a')]==='undefined';var _0x25b20a=_0x2357b1[_0x25dd('0x1b')];var _0x38ea21=_0x55d963?0x0:_0x3ed419[_0x25dd('0x1c')];var _0x38fa3c=_0x55d963?_0x2357b1[_0x25dd('0x1b')]:_0x3ed419[_0x25dd('0x1c')]+_0x3ed419[_0x25dd('0x1a')];var _0x3cf96c;if(_0x38fa3c>=_0x25b20a){_0x38fa3c=_0x25b20a;_0x3cf96c=0xc8;}else{_0x3cf96c=0xce;}_0x2c9f0a[_0x25dd('0x16')](_0x3cf96c);return _0x2c9f0a[_0x25dd('0x1d')](_0x25dd('0x1e'),_0x38ea21+'-'+_0x38fa3c+'/'+_0x25b20a)[_0x25dd('0x18')](_0x2357b1);}return null;};}function patchUpdates(_0x49a8d7){return function(_0x203a2f){try{jsonpatch[_0x25dd('0x1f')](_0x203a2f,_0x49a8d7,!![]);}catch(_0x512f0d){return BPromise[_0x25dd('0x20')](_0x512f0d);}return _0x203a2f[_0x25dd('0x21')]();};}function saveUpdates(_0x2b8c51,_0x16aac0){return function(_0x4d04d3){if(_0x4d04d3){return _0x4d04d3[_0x25dd('0x22')](_0x2b8c51)[_0x25dd('0x23')](function(_0x3d19e9){return _0x3d19e9;});}return null;};}function removeEntity(_0x36e084,_0x56e4db){return function(_0x348994){if(_0x348994){return _0x348994[_0x25dd('0x24')]()[_0x25dd('0x23')](function(){_0x36e084[_0x25dd('0x16')](0xcc)[_0x25dd('0x17')]();});}};}function handleEntityNotFound(_0x41421c,_0x10d0de){return function(_0x3dfec8){if(!_0x3dfec8){_0x41421c[_0x25dd('0x25')](0x194);}return _0x3dfec8;};}function handleError(_0x5c08a4,_0x59bbf4){_0x59bbf4=_0x59bbf4||0x1f4;return function(_0x482629){logger[_0x25dd('0x26')](_0x482629[_0x25dd('0x27')]);if(_0x482629['name']){delete _0x482629[_0x25dd('0x28')];}_0x5c08a4[_0x25dd('0x16')](_0x59bbf4)['send'](_0x482629);};}exports[_0x25dd('0x29')]=function(_0x162c64,_0x51a13f){var _0x227bd0={},_0x4abe31={},_0x1fb133={'count':0x0,'rows':[]};var _0x224390=_['map'](db['VoiceDialReport']['rawAttributes'],function(_0x481751){return{'name':_0x481751[_0x25dd('0x2a')],'type':_0x481751[_0x25dd('0x2b')]['key']};});_0x4abe31[_0x25dd('0x2c')]=_[_0x25dd('0x2d')](_0x224390,_0x25dd('0x28'));_0x4abe31[_0x25dd('0x2e')]=_['keys'](_0x162c64[_0x25dd('0x2e')]);_0x4abe31[_0x25dd('0x2f')]=_[_0x25dd('0x30')](_0x4abe31[_0x25dd('0x2c')],_0x4abe31[_0x25dd('0x2e')]);_0x227bd0[_0x25dd('0x31')]=_['intersection'](_0x4abe31[_0x25dd('0x2c')],qs[_0x25dd('0x32')](_0x162c64[_0x25dd('0x2e')][_0x25dd('0x32')]));_0x227bd0[_0x25dd('0x31')]=_0x227bd0[_0x25dd('0x31')][_0x25dd('0x33')]?_0x227bd0[_0x25dd('0x31')]:_0x4abe31[_0x25dd('0x2c')];if(!_0x162c64[_0x25dd('0x2e')]['hasOwnProperty'](_0x25dd('0x34'))){_0x227bd0[_0x25dd('0x1a')]=qs[_0x25dd('0x1a')](_0x162c64[_0x25dd('0x2e')][_0x25dd('0x1a')]);_0x227bd0[_0x25dd('0x1c')]=qs[_0x25dd('0x1c')](_0x162c64[_0x25dd('0x2e')][_0x25dd('0x1c')]);}_0x227bd0[_0x25dd('0x35')]=qs[_0x25dd('0x36')](_0x162c64[_0x25dd('0x2e')]['sort']);_0x227bd0[_0x25dd('0x37')]=qs[_0x25dd('0x2f')](_[_0x25dd('0x38')](_0x162c64[_0x25dd('0x2e')],_0x4abe31['filters']),_0x224390);if(_0x162c64[_0x25dd('0x2e')]['filter']){_0x227bd0['where']=_['merge'](_0x227bd0[_0x25dd('0x37')],{'$or':_[_0x25dd('0x2d')](_0x224390,function(_0x1ed9f5){if(_0x1ed9f5[_0x25dd('0x2b')]!==_0x25dd('0x39')){var _0x4fc108={};_0x4fc108[_0x1ed9f5[_0x25dd('0x28')]]={'$like':'%'+_0x162c64['query'][_0x25dd('0x3a')]+'%'};return _0x4fc108;}})});}_0x227bd0=_['merge']({},_0x227bd0,_0x162c64[_0x25dd('0x3b')]);var _0x1d01df={'where':_0x227bd0[_0x25dd('0x37')]};return db[_0x25dd('0x3c')][_0x25dd('0x1b')](_0x1d01df)['then'](function(_0x2930ff){_0x1fb133[_0x25dd('0x1b')]=_0x2930ff;if(_0x162c64[_0x25dd('0x2e')]['includeAll']){_0x227bd0[_0x25dd('0x3d')]=[{'all':!![]}];}return db[_0x25dd('0x3c')][_0x25dd('0x3e')](_0x227bd0);})[_0x25dd('0x23')](function(_0x2abd15){_0x1fb133['rows']=_0x2abd15;return _0x1fb133;})[_0x25dd('0x23')](respondWithFilteredResult(_0x51a13f,_0x227bd0))[_0x25dd('0x3f')](handleError(_0x51a13f,null));};exports[_0x25dd('0x40')]=function(_0x309368,_0x496fae){var _0x3a98e6={'raw':!![],'where':{'id':_0x309368['params']['id']}},_0x20ad52={};_0x20ad52[_0x25dd('0x2c')]=_[_0x25dd('0x41')](db[_0x25dd('0x3c')][_0x25dd('0x42')]);_0x20ad52[_0x25dd('0x2e')]=_[_0x25dd('0x41')](_0x309368[_0x25dd('0x2e')]);_0x20ad52[_0x25dd('0x2f')]=_[_0x25dd('0x30')](_0x20ad52['model'],_0x20ad52[_0x25dd('0x2e')]);_0x3a98e6[_0x25dd('0x31')]=_[_0x25dd('0x30')](_0x20ad52['model'],qs[_0x25dd('0x32')](_0x309368['query'][_0x25dd('0x32')]));_0x3a98e6[_0x25dd('0x31')]=_0x3a98e6[_0x25dd('0x31')][_0x25dd('0x33')]?_0x3a98e6[_0x25dd('0x31')]:_0x20ad52[_0x25dd('0x2c')];if(_0x309368[_0x25dd('0x2e')]['includeAll']){_0x3a98e6[_0x25dd('0x3d')]=[{'all':!![]}];}_0x3a98e6=_[_0x25dd('0x43')]({},_0x3a98e6,_0x309368[_0x25dd('0x3b')]);return db['VoiceDialReport'][_0x25dd('0x44')](_0x3a98e6)['then'](handleEntityNotFound(_0x496fae,null))[_0x25dd('0x23')](respondWithResult(_0x496fae,null))[_0x25dd('0x3f')](handleError(_0x496fae,null));};exports['create']=function(_0x44160e,_0x4f667a){return db[_0x25dd('0x3c')][_0x25dd('0x45')](_0x44160e['body'],{})['then'](respondWithResult(_0x4f667a,0xc9))[_0x25dd('0x3f')](handleError(_0x4f667a,null));};exports[_0x25dd('0x22')]=function(_0x297510,_0x56cc95){if(_0x297510[_0x25dd('0x46')]['id']){delete _0x297510['body']['id'];}return db['VoiceDialReport'][_0x25dd('0x44')]({'where':{'id':_0x297510[_0x25dd('0x47')]['id']}})[_0x25dd('0x23')](handleEntityNotFound(_0x56cc95,null))[_0x25dd('0x23')](saveUpdates(_0x297510[_0x25dd('0x46')],null))[_0x25dd('0x23')](respondWithResult(_0x56cc95,null))['catch'](handleError(_0x56cc95,null));};exports[_0x25dd('0x24')]=function(_0x37fe2f,_0xeca827){return db[_0x25dd('0x3c')][_0x25dd('0x44')]({'where':{'id':_0x37fe2f['params']['id']}})[_0x25dd('0x23')](handleEntityNotFound(_0xeca827,null))[_0x25dd('0x23')](removeEntity(_0xeca827,null))['catch'](handleError(_0xeca827,null));};exports[_0x25dd('0x48')]=function(_0x409568,_0x3edd8a){return db[_0x25dd('0x3c')][_0x25dd('0x48')]()[_0x25dd('0x23')](respondWithResult(_0x3edd8a,null))['catch'](handleError(_0x3edd8a,null));};
\ No newline at end of file
+var _0xe7c2=['../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','merge','options','then','includeAll','rows','catch','params','include','find','create','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x4f708f,_0x19857c){var _0xc14ea8=function(_0x4f3728){while(--_0x4f3728){_0x4f708f['push'](_0x4f708f['shift']());}};_0xc14ea8(++_0x19857c);}(_0xe7c2,0x1ca));var _0x2e7c=function(_0x2c22fb,_0x812df0){_0x2c22fb=_0x2c22fb-0x0;var _0x34ba7c=_0xe7c2[_0x2c22fb];return _0x34ba7c;};'use strict';var emlformat=require(_0x2e7c('0x0'));var rimraf=require(_0x2e7c('0x1'));var zipdir=require(_0x2e7c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e7c('0x3'));var moment=require(_0x2e7c('0x4'));var BPromise=require(_0x2e7c('0x5'));var Mustache=require(_0x2e7c('0x6'));var util=require(_0x2e7c('0x7'));var path=require('path');var sox=require(_0x2e7c('0x8'));var csv=require('to-csv');var ejs=require(_0x2e7c('0x9'));var fs=require('fs');var fs_extra=require(_0x2e7c('0xa'));var _=require(_0x2e7c('0xb'));var squel=require('squel');var crypto=require(_0x2e7c('0xc'));var jsforce=require(_0x2e7c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2e7c('0xe'));var querystring=require('querystring');var Papa=require(_0x2e7c('0xf'));var Redis=require('ioredis');var authService=require(_0x2e7c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e7c('0x11'));var logger=require(_0x2e7c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2e7c('0x13'));var licenseUtil=require(_0x2e7c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ea5d5,_0x4d2e14){_0x4d2e14=_0x4d2e14||0xcc;return function(_0x53f696){if(_0x53f696){return _0x5ea5d5[_0x2e7c('0x15')](_0x4d2e14);}return _0x5ea5d5[_0x2e7c('0x16')](_0x4d2e14)[_0x2e7c('0x17')]();};}function respondWithResult(_0x5d7318,_0x1169ec){_0x1169ec=_0x1169ec||0xc8;return function(_0x1743f6){if(_0x1743f6){return _0x5d7318[_0x2e7c('0x16')](_0x1169ec)[_0x2e7c('0x18')](_0x1743f6);}};}function respondWithFilteredResult(_0x38dbdd,_0x2c889b){return function(_0x4e3efe){if(_0x4e3efe){var _0x1a74b0=typeof _0x2c889b[_0x2e7c('0x19')]===_0x2e7c('0x1a')&&typeof _0x2c889b['limit']===_0x2e7c('0x1a');var _0x3fac65=_0x4e3efe[_0x2e7c('0x1b')];var _0x5a07d6=_0x1a74b0?0x0:_0x2c889b['offset'];var _0xc6e7e1=_0x1a74b0?_0x4e3efe[_0x2e7c('0x1b')]:_0x2c889b[_0x2e7c('0x19')]+_0x2c889b[_0x2e7c('0x1c')];var _0x5e6f7d;if(_0xc6e7e1>=_0x3fac65){_0xc6e7e1=_0x3fac65;_0x5e6f7d=0xc8;}else{_0x5e6f7d=0xce;}_0x38dbdd[_0x2e7c('0x16')](_0x5e6f7d);return _0x38dbdd['set'](_0x2e7c('0x1d'),_0x5a07d6+'-'+_0xc6e7e1+'/'+_0x3fac65)['json'](_0x4e3efe);}return null;};}function patchUpdates(_0x965241){return function(_0x39d9f3){try{jsonpatch[_0x2e7c('0x1e')](_0x39d9f3,_0x965241,!![]);}catch(_0x179a9b){return BPromise['reject'](_0x179a9b);}return _0x39d9f3['save']();};}function saveUpdates(_0x50b981,_0x4e476b){return function(_0x4f0746){if(_0x4f0746){return _0x4f0746['update'](_0x50b981)['then'](function(_0x10db5d){return _0x10db5d;});}return null;};}function removeEntity(_0x1d7a5d,_0x164d3f){return function(_0x127ebb){if(_0x127ebb){return _0x127ebb['destroy']()['then'](function(){_0x1d7a5d[_0x2e7c('0x16')](0xcc)[_0x2e7c('0x17')]();});}};}function handleEntityNotFound(_0x1b6f20,_0x9f8a11){return function(_0x2e7963){if(!_0x2e7963){_0x1b6f20[_0x2e7c('0x15')](0x194);}return _0x2e7963;};}function handleError(_0x1215f2,_0xec1663){_0xec1663=_0xec1663||0x1f4;return function(_0x538fce){logger[_0x2e7c('0x1f')](_0x538fce[_0x2e7c('0x20')]);if(_0x538fce[_0x2e7c('0x21')]){delete _0x538fce['name'];}_0x1215f2[_0x2e7c('0x16')](_0xec1663)[_0x2e7c('0x22')](_0x538fce);};}exports['index']=function(_0x1a8b28,_0x3c95e8){var _0x22dac3={},_0x19f1ab={},_0x154fc7={'count':0x0,'rows':[]};var _0x4ce935=_[_0x2e7c('0x23')](db[_0x2e7c('0x24')][_0x2e7c('0x25')],function(_0x34f4ba){return{'name':_0x34f4ba[_0x2e7c('0x26')],'type':_0x34f4ba['type']['key']};});_0x19f1ab['model']=_['map'](_0x4ce935,'name');_0x19f1ab[_0x2e7c('0x27')]=_[_0x2e7c('0x28')](_0x1a8b28['query']);_0x19f1ab[_0x2e7c('0x29')]=_[_0x2e7c('0x2a')](_0x19f1ab[_0x2e7c('0x2b')],_0x19f1ab['query']);_0x22dac3[_0x2e7c('0x2c')]=_['intersection'](_0x19f1ab[_0x2e7c('0x2b')],qs[_0x2e7c('0x2d')](_0x1a8b28[_0x2e7c('0x27')][_0x2e7c('0x2d')]));_0x22dac3[_0x2e7c('0x2c')]=_0x22dac3[_0x2e7c('0x2c')][_0x2e7c('0x2e')]?_0x22dac3[_0x2e7c('0x2c')]:_0x19f1ab[_0x2e7c('0x2b')];if(!_0x1a8b28[_0x2e7c('0x27')][_0x2e7c('0x2f')](_0x2e7c('0x30'))){_0x22dac3[_0x2e7c('0x1c')]=qs['limit'](_0x1a8b28['query']['limit']);_0x22dac3[_0x2e7c('0x19')]=qs[_0x2e7c('0x19')](_0x1a8b28[_0x2e7c('0x27')][_0x2e7c('0x19')]);}_0x22dac3[_0x2e7c('0x31')]=qs['sort'](_0x1a8b28[_0x2e7c('0x27')][_0x2e7c('0x32')]);_0x22dac3['where']=qs['filters'](_[_0x2e7c('0x33')](_0x1a8b28[_0x2e7c('0x27')],_0x19f1ab[_0x2e7c('0x29')]),_0x4ce935);if(_0x1a8b28[_0x2e7c('0x27')]['filter']){_0x22dac3[_0x2e7c('0x34')]=_['merge'](_0x22dac3[_0x2e7c('0x34')],{'$or':_[_0x2e7c('0x23')](_0x4ce935,function(_0x5b5272){if(_0x5b5272[_0x2e7c('0x35')]!==_0x2e7c('0x36')){var _0x1078d4={};_0x1078d4[_0x5b5272['name']]={'$like':'%'+_0x1a8b28[_0x2e7c('0x27')]['filter']+'%'};return _0x1078d4;}})});}_0x22dac3=_[_0x2e7c('0x37')]({},_0x22dac3,_0x1a8b28[_0x2e7c('0x38')]);var _0x4c0d35={'where':_0x22dac3[_0x2e7c('0x34')]};return db[_0x2e7c('0x24')][_0x2e7c('0x1b')](_0x4c0d35)[_0x2e7c('0x39')](function(_0x47d780){_0x154fc7[_0x2e7c('0x1b')]=_0x47d780;if(_0x1a8b28[_0x2e7c('0x27')][_0x2e7c('0x3a')]){_0x22dac3['include']=[{'all':!![]}];}return db[_0x2e7c('0x24')]['findAll'](_0x22dac3);})[_0x2e7c('0x39')](function(_0x44768e){_0x154fc7[_0x2e7c('0x3b')]=_0x44768e;return _0x154fc7;})[_0x2e7c('0x39')](respondWithFilteredResult(_0x3c95e8,_0x22dac3))[_0x2e7c('0x3c')](handleError(_0x3c95e8,null));};exports['show']=function(_0x2ad756,_0x314b41){var _0x1e52ce={'raw':!![],'where':{'id':_0x2ad756[_0x2e7c('0x3d')]['id']}},_0x1c8bb6={};_0x1c8bb6[_0x2e7c('0x2b')]=_[_0x2e7c('0x28')](db[_0x2e7c('0x24')][_0x2e7c('0x25')]);_0x1c8bb6[_0x2e7c('0x27')]=_[_0x2e7c('0x28')](_0x2ad756['query']);_0x1c8bb6[_0x2e7c('0x29')]=_[_0x2e7c('0x2a')](_0x1c8bb6[_0x2e7c('0x2b')],_0x1c8bb6[_0x2e7c('0x27')]);_0x1e52ce[_0x2e7c('0x2c')]=_[_0x2e7c('0x2a')](_0x1c8bb6[_0x2e7c('0x2b')],qs[_0x2e7c('0x2d')](_0x2ad756[_0x2e7c('0x27')]['fields']));_0x1e52ce[_0x2e7c('0x2c')]=_0x1e52ce[_0x2e7c('0x2c')][_0x2e7c('0x2e')]?_0x1e52ce[_0x2e7c('0x2c')]:_0x1c8bb6['model'];if(_0x2ad756['query'][_0x2e7c('0x3a')]){_0x1e52ce[_0x2e7c('0x3e')]=[{'all':!![]}];}_0x1e52ce=_[_0x2e7c('0x37')]({},_0x1e52ce,_0x2ad756[_0x2e7c('0x38')]);return db[_0x2e7c('0x24')][_0x2e7c('0x3f')](_0x1e52ce)[_0x2e7c('0x39')](handleEntityNotFound(_0x314b41,null))[_0x2e7c('0x39')](respondWithResult(_0x314b41,null))[_0x2e7c('0x3c')](handleError(_0x314b41,null));};exports[_0x2e7c('0x40')]=function(_0x26bebb,_0x1553d8){return db[_0x2e7c('0x24')][_0x2e7c('0x40')](_0x26bebb['body'],{})[_0x2e7c('0x39')](respondWithResult(_0x1553d8,0xc9))[_0x2e7c('0x3c')](handleError(_0x1553d8,null));};exports[_0x2e7c('0x41')]=function(_0x50f781,_0x553ea1){if(_0x50f781[_0x2e7c('0x42')]['id']){delete _0x50f781[_0x2e7c('0x42')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x50f781['params']['id']}})[_0x2e7c('0x39')](handleEntityNotFound(_0x553ea1,null))[_0x2e7c('0x39')](saveUpdates(_0x50f781[_0x2e7c('0x42')],null))['then'](respondWithResult(_0x553ea1,null))[_0x2e7c('0x3c')](handleError(_0x553ea1,null));};exports['destroy']=function(_0x2ccb6c,_0x1e275c){return db['VoiceDialReport'][_0x2e7c('0x3f')]({'where':{'id':_0x2ccb6c[_0x2e7c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1e275c,null))[_0x2e7c('0x39')](removeEntity(_0x1e275c,null))[_0x2e7c('0x3c')](handleError(_0x1e275c,null));};exports[_0x2e7c('0x43')]=function(_0x3debb1,_0x35df5a){return db[_0x2e7c('0x24')][_0x2e7c('0x43')]()[_0x2e7c('0x39')](respondWithResult(_0x35df5a,null))[_0x2e7c('0x3c')](handleError(_0x35df5a,null));};
\ No newline at end of file
index 49f23d0..3903b8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x843b=['uniqueid','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial'];(function(_0xa515c,_0x57ca32){var _0x4b737e=function(_0x5c29d7){while(--_0x5c29d7){_0xa515c['push'](_0xa515c['shift']());}};_0x4b737e(++_0x57ca32);}(_0x843b,0x91));var _0xb843=function(_0x4ffbb6,_0x2fa1ea){_0x4ffbb6=_0x4ffbb6-0x0;var _0x2dd3d1=_0x843b[_0x4ffbb6];return _0x2dd3d1;};'use strict';var _=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb843('0x2'));var BPromise=require(_0xb843('0x3'));var rp=require(_0xb843('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb843('0x5'));var config=require(_0xb843('0x6'));var attributes=require(_0xb843('0x7'));module[_0xb843('0x8')]=function(_0x5e781f,_0x1a0c43){return _0x5e781f[_0xb843('0x9')]('VoiceDialReport',attributes,{'tableName':_0xb843('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb843('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc271=['api','bluebird','request-promise','path','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x20df0b,_0x5a8d05){var _0x2984dd=function(_0x4862a1){while(--_0x4862a1){_0x20df0b['push'](_0x20df0b['shift']());}};_0x2984dd(++_0x5a8d05);}(_0xc271,0x165));var _0x1c27=function(_0x682868,_0x36a550){_0x682868=_0x682868-0x0;var _0x765311=_0xc271[_0x682868];return _0x765311;};'use strict';var _=require(_0x1c27('0x0'));var util=require(_0x1c27('0x1'));var logger=require(_0x1c27('0x2'))(_0x1c27('0x3'));var moment=require('moment');var BPromise=require(_0x1c27('0x4'));var rp=require(_0x1c27('0x5'));var fs=require('fs');var path=require(_0x1c27('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1c27('0x7'));module[_0x1c27('0x8')]=function(_0x4ece8d,_0x422ca1){return _0x4ece8d['define'](_0x1c27('0x9'),attributes,{'tableName':_0x1c27('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1c27('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index e8f3767..fdd00f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9f7=['VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','UpdateVoiceDialReport','update','body','raw','where','limit','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x442231,_0x1333c6){var _0x271919=function(_0x1706ad){while(--_0x1706ad){_0x442231['push'](_0x442231['shift']());}};_0x271919(++_0x1333c6);}(_0xf9f7,0xe9));var _0x7f9f=function(_0x188945,_0x2aafa5){_0x188945=_0x188945-0x0;var _0x4959c2=_0xf9f7[_0x188945];return _0x4959c2;};'use strict';var _=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var moment=require(_0x7f9f('0x2'));var BPromise=require(_0x7f9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7f9f('0x4'));var logger=require('../../config/logger')(_0x7f9f('0x5'));var config=require(_0x7f9f('0x6'));var jayson=require(_0x7f9f('0x7'));var client=jayson['client'][_0x7f9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c0197,_0x1dea2a,_0x1f1c3d){return new BPromise(function(_0x4a8c5d,_0x30a165){return client[_0x7f9f('0x9')](_0x3c0197,_0x1f1c3d)[_0x7f9f('0xa')](function(_0x17f9db){logger[_0x7f9f('0xb')](_0x7f9f('0xc'),_0x1dea2a,_0x7f9f('0xd'));logger[_0x7f9f('0xe')](_0x7f9f('0xf'),_0x1dea2a,_0x7f9f('0xd'),JSON[_0x7f9f('0x10')](_0x17f9db));if(_0x17f9db[_0x7f9f('0x11')]){if(_0x17f9db[_0x7f9f('0x11')]['code']===0x1f4){logger[_0x7f9f('0x11')](_0x7f9f('0xc'),_0x1dea2a,_0x17f9db[_0x7f9f('0x11')][_0x7f9f('0x12')]);return _0x30a165(_0x17f9db[_0x7f9f('0x11')][_0x7f9f('0x12')]);}logger[_0x7f9f('0x11')](_0x7f9f('0xc'),_0x1dea2a,_0x17f9db['error'][_0x7f9f('0x12')]);return _0x4a8c5d(_0x17f9db[_0x7f9f('0x11')][_0x7f9f('0x12')]);}else{logger['info'](_0x7f9f('0xc'),_0x1dea2a,_0x7f9f('0xd'));_0x4a8c5d(_0x17f9db[_0x7f9f('0x13')][_0x7f9f('0x12')]);}})['catch'](function(_0x128a92){logger[_0x7f9f('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x1dea2a,_0x128a92);_0x30a165(_0x128a92);});});}exports[_0x7f9f('0x14')]=function(_0xc406ca){var _0x1fb633=this;return new Promise(function(_0x1b90ee,_0x547bd1){return db[_0x7f9f('0x15')][_0x7f9f('0x16')](_0xc406ca['body'],{'raw':_0xc406ca[_0x7f9f('0x17')]?_0xc406ca['options']['raw']===undefined?!![]:![]:!![]})[_0x7f9f('0xa')](function(_0x5c71a4){logger[_0x7f9f('0xb')]('CreateVoiceDialReport',_0xc406ca);logger[_0x7f9f('0xe')](_0x7f9f('0x14'),_0xc406ca,JSON[_0x7f9f('0x10')](_0x5c71a4));_0x1b90ee(_0x5c71a4);})['catch'](function(_0x2744f5){logger['error'](_0x7f9f('0x14'),_0x2744f5[_0x7f9f('0x12')],_0xc406ca);_0x547bd1(_0x1fb633[_0x7f9f('0x11')](0x1f4,_0x2744f5['message']));});});};exports[_0x7f9f('0x18')]=function(_0x422651){var _0x4c23f8=this;return new Promise(function(_0x3e58c3,_0x27641e){return db[_0x7f9f('0x15')][_0x7f9f('0x19')](_0x422651[_0x7f9f('0x1a')],{'raw':_0x422651['options']?_0x422651['options'][_0x7f9f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422651[_0x7f9f('0x17')]?_0x422651['options'][_0x7f9f('0x1c')]||null:null,'attributes':_0x422651[_0x7f9f('0x17')]?_0x422651[_0x7f9f('0x17')]['attributes']||null:null,'limit':_0x422651['options']?_0x422651['options'][_0x7f9f('0x1d')]||null:null})[_0x7f9f('0xa')](function(_0x23b6f2){logger[_0x7f9f('0xb')](_0x7f9f('0x18'),_0x422651);logger['debug']('UpdateVoiceDialReport',_0x422651,JSON['stringify'](_0x23b6f2));_0x3e58c3(_0x23b6f2);})[_0x7f9f('0x1e')](function(_0x2156e6){logger[_0x7f9f('0x11')](_0x7f9f('0x18'),_0x2156e6[_0x7f9f('0x12')],_0x422651);_0x27641e(_0x4c23f8['error'](0x1f4,_0x2156e6[_0x7f9f('0x12')]));});});};
\ No newline at end of file
+var _0xa857=['options','raw','debug','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body'];(function(_0x452232,_0x1ac82b){var _0x4eab1b=function(_0x48f5e7){while(--_0x48f5e7){_0x452232['push'](_0x452232['shift']());}};_0x4eab1b(++_0x1ac82b);}(_0xa857,0x145));var _0x7a85=function(_0x3aecb9,_0x1b0c3b){_0x3aecb9=_0x3aecb9-0x0;var _0x3de4c2=_0xa857[_0x3aecb9];return _0x3de4c2;};'use strict';var _=require('lodash');var util=require(_0x7a85('0x0'));var moment=require(_0x7a85('0x1'));var BPromise=require(_0x7a85('0x2'));var rs=require(_0x7a85('0x3'));var fs=require('fs');var Redis=require(_0x7a85('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a85('0x5'));var logger=require('../../config/logger')(_0x7a85('0x6'));var config=require(_0x7a85('0x7'));var jayson=require(_0x7a85('0x8'));var client=jayson[_0x7a85('0x9')][_0x7a85('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aceaf,_0x5c5d5a,_0x32b443){return new BPromise(function(_0x2e2e37,_0x340cfe){return client[_0x7a85('0xb')](_0x5aceaf,_0x32b443)[_0x7a85('0xc')](function(_0x42bd7d){logger[_0x7a85('0xd')](_0x7a85('0xe'),_0x5c5d5a,_0x7a85('0xf'));logger['debug'](_0x7a85('0x10'),_0x5c5d5a,_0x7a85('0xf'),JSON[_0x7a85('0x11')](_0x42bd7d));if(_0x42bd7d['error']){if(_0x42bd7d[_0x7a85('0x12')][_0x7a85('0x13')]===0x1f4){logger['error'](_0x7a85('0xe'),_0x5c5d5a,_0x42bd7d[_0x7a85('0x12')][_0x7a85('0x14')]);return _0x340cfe(_0x42bd7d[_0x7a85('0x12')][_0x7a85('0x14')]);}logger[_0x7a85('0x12')](_0x7a85('0xe'),_0x5c5d5a,_0x42bd7d['error'][_0x7a85('0x14')]);return _0x2e2e37(_0x42bd7d[_0x7a85('0x12')][_0x7a85('0x14')]);}else{logger[_0x7a85('0xd')](_0x7a85('0xe'),_0x5c5d5a,'request\x20sent');_0x2e2e37(_0x42bd7d[_0x7a85('0x15')][_0x7a85('0x14')]);}})[_0x7a85('0x16')](function(_0x3995b3){logger[_0x7a85('0x12')](_0x7a85('0xe'),_0x5c5d5a,_0x3995b3);_0x340cfe(_0x3995b3);});});}exports['CreateVoiceDialReport']=function(_0x2c4db5){var _0x5748a3=this;return new Promise(function(_0x151803,_0x5c2bb5){return db['VoiceDialReport'][_0x7a85('0x17')](_0x2c4db5[_0x7a85('0x18')],{'raw':_0x2c4db5['options']?_0x2c4db5[_0x7a85('0x19')][_0x7a85('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x37529c){logger[_0x7a85('0xd')]('CreateVoiceDialReport',_0x2c4db5);logger[_0x7a85('0x1b')](_0x7a85('0x1c'),_0x2c4db5,JSON[_0x7a85('0x11')](_0x37529c));_0x151803(_0x37529c);})['catch'](function(_0x40f7b0){logger['error'](_0x7a85('0x1c'),_0x40f7b0[_0x7a85('0x14')],_0x2c4db5);_0x5c2bb5(_0x5748a3[_0x7a85('0x12')](0x1f4,_0x40f7b0[_0x7a85('0x14')]));});});};exports[_0x7a85('0x1d')]=function(_0x38f99f){var _0x3e3cd4=this;return new Promise(function(_0x2db9a5,_0x384c9f){return db[_0x7a85('0x1e')][_0x7a85('0x1f')](_0x38f99f['body'],{'raw':_0x38f99f[_0x7a85('0x19')]?_0x38f99f[_0x7a85('0x19')][_0x7a85('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38f99f['options']?_0x38f99f['options'][_0x7a85('0x20')]||null:null,'attributes':_0x38f99f[_0x7a85('0x19')]?_0x38f99f['options'][_0x7a85('0x21')]||null:null,'limit':_0x38f99f[_0x7a85('0x19')]?_0x38f99f[_0x7a85('0x19')][_0x7a85('0x22')]||null:null})[_0x7a85('0xc')](function(_0x4a7c5c){logger[_0x7a85('0xd')](_0x7a85('0x1d'),_0x38f99f);logger[_0x7a85('0x1b')](_0x7a85('0x1d'),_0x38f99f,JSON[_0x7a85('0x11')](_0x4a7c5c));_0x2db9a5(_0x4a7c5c);})[_0x7a85('0x16')](function(_0xbed54b){logger[_0x7a85('0x12')]('UpdateVoiceDialReport',_0xbed54b[_0x7a85('0x14')],_0x38f99f);_0x384c9f(_0x3e3cd4[_0x7a85('0x12')](0x1f4,_0xbed54b[_0x7a85('0x14')]));});});};
\ No newline at end of file
index 6e32002..67dca40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a67=['index','/:id','isAuthenticated','show','post','create','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a67,0x1f0));var _0x77a6=function(_0x62b5c8,_0x29bb86){_0x62b5c8=_0x62b5c8-0x0;var _0x20def2=_0x7a67[_0x62b5c8];return _0x20def2;};'use strict';var multer=require(_0x77a6('0x0'));var util=require(_0x77a6('0x1'));var path=require(_0x77a6('0x2'));var timeout=require(_0x77a6('0x3'));var express=require(_0x77a6('0x4'));var router=express['Router']();var fs_extra=require(_0x77a6('0x5'));var auth=require(_0x77a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x77a6('0x7'));var controller=require(_0x77a6('0x8'));router[_0x77a6('0x9')]('/',auth['isAuthenticated'](),controller[_0x77a6('0xa')]);router[_0x77a6('0x9')](_0x77a6('0xb'),auth[_0x77a6('0xc')](),controller[_0x77a6('0xd')]);router[_0x77a6('0xe')]('/',auth[_0x77a6('0xc')](),controller[_0x77a6('0xf')]);router['post']('/:id/applications',auth[_0x77a6('0xc')](),controller[_0x77a6('0x10')]);router[_0x77a6('0x11')](_0x77a6('0xb'),auth['isAuthenticated'](),controller[_0x77a6('0x12')]);router[_0x77a6('0x13')](_0x77a6('0xb'),auth[_0x77a6('0xc')](),controller[_0x77a6('0x14')]);module[_0x77a6('0x15')]=router;
\ No newline at end of file
+var _0x3e24=['/:id','post','create','addApplications','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3e24,0x6e));var _0x43e2=function(_0xf64bc0,_0x28997d){_0xf64bc0=_0xf64bc0-0x0;var _0x15914e=_0x3e24[_0xf64bc0];return _0x15914e;};'use strict';var multer=require(_0x43e2('0x0'));var util=require('util');var path=require(_0x43e2('0x1'));var timeout=require(_0x43e2('0x2'));var express=require(_0x43e2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e2('0x4'));var interaction=require(_0x43e2('0x5'));var config=require(_0x43e2('0x6'));var controller=require('./voiceExtension.controller');router[_0x43e2('0x7')]('/',auth[_0x43e2('0x8')](),controller['index']);router['get'](_0x43e2('0x9'),auth[_0x43e2('0x8')](),controller['show']);router[_0x43e2('0xa')]('/',auth[_0x43e2('0x8')](),controller[_0x43e2('0xb')]);router[_0x43e2('0xa')]('/:id/applications',auth[_0x43e2('0x8')](),controller[_0x43e2('0xc')]);router['put'](_0x43e2('0x9'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0xe')](_0x43e2('0x9'),auth['isAuthenticated'](),controller[_0x43e2('0xf')]);module[_0x43e2('0x10')]=router;
\ No newline at end of file
index d75e7da..f2a725f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc152=['outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','STRING','compositeIndex','inbound','internal','inbound-fax'];(function(_0x1a1aed,_0x2cbbfb){var _0x37e0bf=function(_0x4dedc4){while(--_0x4dedc4){_0x1a1aed['push'](_0x1a1aed['shift']());}};_0x37e0bf(++_0x2cbbfb);}(_0xc152,0xbf));var _0x2c15=function(_0x4c011f,_0x3adbdc){_0x4c011f=_0x4c011f-0x0;var _0x5ad07b=_0xc152[_0x4c011f];return _0x5ad07b;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x2c15('0x0')],'allowNull':![],'unique':_0x2c15('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2c15('0x0')],'allowNull':![],'unique':_0x2c15('0x1')},'priority':{'type':Sequelize[_0x2c15('0x0')],'allowNull':![],'defaultValue':'1','unique':_0x2c15('0x1')},'tag':{'type':Sequelize[_0x2c15('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2c15('0x0')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x2c15('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x2c15('0x2'),'outbound',_0x2c15('0x3'),_0x2c15('0x4'),_0x2c15('0x5'),_0x2c15('0x6'),_0x2c15('0x7')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2c15('0x0')],'allowNull':![],'defaultValue':_0x2c15('0x8')},'IntervalId':{'type':Sequelize[_0x2c15('0x9')]},'isApp':{'type':Sequelize[_0x2c15('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2c15('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2c15('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0x2c15('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x2c15('0x9')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x2c15('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x2c15('0xc')],'get':function(_0x1c2c94){return this[_0x2c15('0xd')]('exten');}},'alias':{'type':Sequelize[_0x2c15('0x0')],'allowNull':!![]}};
\ No newline at end of file
+var _0x7b26=['system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','compositeIndex','STRING','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax'];(function(_0x41f5eb,_0x2c1e5a){var _0x2b4115=function(_0x13fba2){while(--_0x13fba2){_0x41f5eb['push'](_0x41f5eb['shift']());}};_0x2b4115(++_0x2c1e5a);}(_0x7b26,0x1dc));var _0x67b2=function(_0x2c170a,_0x1ae64e){_0x2c170a=_0x2c170a-0x0;var _0x26abee=_0x7b26[_0x2c170a];return _0x26abee;};'use strict';var Sequelize=require(_0x67b2('0x0'));module[_0x67b2('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x67b2('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x67b2('0x3')],'allowNull':![],'unique':_0x67b2('0x2')},'priority':{'type':Sequelize[_0x67b2('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x67b2('0x2')},'tag':{'type':Sequelize[_0x67b2('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x67b2('0x4')},'appdata':{'type':Sequelize[_0x67b2('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x67b2('0x5'),_0x67b2('0x6'),_0x67b2('0x7'),_0x67b2('0x8'),_0x67b2('0x9'),_0x67b2('0xa'),_0x67b2('0xb')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x67b2('0x3')],'allowNull':![],'defaultValue':_0x67b2('0xc')},'IntervalId':{'type':Sequelize[_0x67b2('0xd')]},'isApp':{'type':Sequelize[_0x67b2('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x67b2('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x67b2('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x67b2('0xd')]},'recordingFormat':{'type':Sequelize[_0x67b2('0x3')],'defaultValue':_0x67b2('0xf')},'answer':{'type':Sequelize[_0x67b2('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x67b2('0x10')],'get':function(_0x4bc77a){return this['getDataValue'](_0x67b2('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 24d37d1..f522d98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83a1=['get','InboundRoutes','inbound','outbound','InternalRoutes','filter','map','value','includes','find','type','name','UserProfileResource','stack','send','index','VoiceExtension','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','internal','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','alias','context','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','priority','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','then'];(function(_0x5a07f7,_0x19eb33){var _0x23a33b=function(_0x449bc5){while(--_0x449bc5){_0x5a07f7['push'](_0x5a07f7['shift']());}};_0x23a33b(++_0x19eb33);}(_0x83a1,0xf3));var _0x183a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x83a1[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x183a('0x0'));var Redis=require(_0x183a('0x1'));var qs=require(_0x183a('0x2'));var logger=require(_0x183a('0x3'))(_0x183a('0x4'));var config=require(_0x183a('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x183a('0x6')](config[_0x183a('0x7')],{'host':_0x183a('0x8'),'port':0x18eb});var socket=require(_0x183a('0x9'))(new Redis(config[_0x183a('0x7')]));require(_0x183a('0xa'))[_0x183a('0xb')](socket);function respondWithStatusCode(_0x3887a9,_0x538649){_0x538649=_0x538649||0xcc;return function(_0x17fc52){if(_0x17fc52){return _0x3887a9[_0x183a('0xc')](_0x538649);}return _0x3887a9[_0x183a('0xd')](_0x538649)[_0x183a('0xe')]();};}function respondWithResult(_0x11e966,_0x241dce){_0x241dce=_0x241dce||0xc8;return function(_0x26e67e){if(_0x26e67e){return _0x11e966[_0x183a('0xd')](_0x241dce)[_0x183a('0xf')](_0x26e67e);}};}function respondWithFilteredResult(_0x53477a,_0x2a0dc4){return function(_0x2ad539){if(_0x2ad539){var _0x460fa7=typeof _0x2a0dc4[_0x183a('0x10')]===_0x183a('0x11')&&typeof _0x2a0dc4['limit']===_0x183a('0x11');var _0x5d1872=_0x2ad539[_0x183a('0x12')];var _0x3884e4=_0x460fa7?0x0:_0x2a0dc4['offset'];var _0x5dbcfd=_0x460fa7?_0x2ad539['count']:_0x2a0dc4[_0x183a('0x10')]+_0x2a0dc4[_0x183a('0x13')];var _0x21964e;if(_0x5dbcfd>=_0x5d1872){_0x5dbcfd=_0x5d1872;_0x21964e=0xc8;}else{_0x21964e=0xce;}_0x53477a[_0x183a('0xd')](_0x21964e);return _0x53477a[_0x183a('0x14')](_0x183a('0x15'),_0x3884e4+'-'+_0x5dbcfd+'/'+_0x5d1872)[_0x183a('0xf')](_0x2ad539);}return null;};}function removeEntity(_0x39b8da){return function(_0x28accd){if(_0x28accd){return _0x28accd[_0x183a('0x16')]()[_0x183a('0x17')](function(){var _0x3cbed8=_0x28accd[_0x183a('0x18')]({'plain':!![]});var _0x59f756=[{'name':_0x183a('0x19'),'value':_0x183a('0x1a'),'ignore':![]},{'name':'OutboundRoutes','value':_0x183a('0x1b'),'ignore':![]},{'name':_0x183a('0x1c'),'value':'internal','ignore':![]}];var _0x396fec=_(_0x59f756)[_0x183a('0x1d')]('ignore')[_0x183a('0x1e')](_0x183a('0x1f'))[_0x183a('0x1f')]();if(_[_0x183a('0x20')](_0x396fec,_0x3cbed8['type'])){return;}var _0x5e2e99=_[_0x183a('0x21')](_0x59f756,[_0x183a('0x1f'),_0x3cbed8[_0x183a('0x22')]])[_0x183a('0x23')];return db[_0x183a('0x24')][_0x183a('0x16')]({'where':{'type':_0x5e2e99,'resourceId':_0x3cbed8['id']}})[_0x183a('0x17')](function(){return _0x28accd;});})[_0x183a('0x17')](function(){_0x39b8da[_0x183a('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc2518){return function(_0x24be92){if(!_0x24be92){_0xdc2518['sendStatus'](0x194);}return _0x24be92;};}function handleError(_0x87b8c1,_0x1f8b8c){_0x1f8b8c=_0x1f8b8c||0x1f4;return function(_0x2a25d3){logger['error'](_0x2a25d3[_0x183a('0x25')]);if(_0x2a25d3[_0x183a('0x23')]){delete _0x2a25d3['name'];}_0x87b8c1['status'](_0x1f8b8c)[_0x183a('0x26')](_0x2a25d3);};}exports[_0x183a('0x27')]=function(_0x815fa9,_0x5a4842){var _0x388e10={},_0x32ec91={},_0x4bd6ac={'count':0x0,'rows':[]};var _0x3dfe1b=_[_0x183a('0x1e')](db[_0x183a('0x28')]['rawAttributes'],function(_0x538e32){return{'name':_0x538e32['fieldName'],'type':_0x538e32[_0x183a('0x22')]['key']};});_0x32ec91['model']=_['map'](_0x3dfe1b,_0x183a('0x23'));_0x32ec91[_0x183a('0x29')]=_[_0x183a('0x2a')](_0x815fa9[_0x183a('0x29')]);_0x32ec91['filters']=_[_0x183a('0x2b')](_0x32ec91[_0x183a('0x2c')],_0x32ec91[_0x183a('0x29')]);_0x388e10[_0x183a('0x2d')]=_['intersection'](_0x32ec91[_0x183a('0x2c')],qs[_0x183a('0x2e')](_0x815fa9[_0x183a('0x29')][_0x183a('0x2e')]));_0x388e10[_0x183a('0x2d')]=_0x388e10['attributes'][_0x183a('0x2f')]?_0x388e10[_0x183a('0x2d')]:_0x32ec91[_0x183a('0x2c')];if(!_0x815fa9[_0x183a('0x29')][_0x183a('0x30')](_0x183a('0x31'))){_0x388e10['limit']=qs[_0x183a('0x13')](_0x815fa9['query'][_0x183a('0x13')]);_0x388e10[_0x183a('0x10')]=qs['offset'](_0x815fa9[_0x183a('0x29')][_0x183a('0x10')]);}_0x388e10['order']=qs[_0x183a('0x32')](_0x815fa9[_0x183a('0x29')][_0x183a('0x32')]);_0x388e10['where']=qs[_0x183a('0x33')](_[_0x183a('0x34')](_0x815fa9[_0x183a('0x29')],_0x32ec91['filters']),_0x3dfe1b);if(_0x815fa9[_0x183a('0x29')][_0x183a('0x1d')]){_0x388e10[_0x183a('0x35')]=_[_0x183a('0x36')](_0x388e10[_0x183a('0x35')],{'$or':_[_0x183a('0x1e')](_0x3dfe1b,function(_0x32fbe1){if(_0x32fbe1[_0x183a('0x22')]!==_0x183a('0x37')){var _0x3f1640={};_0x3f1640[_0x32fbe1[_0x183a('0x23')]]={'$like':'%'+_0x815fa9['query']['filter']+'%'};return _0x3f1640;}})});}_0x388e10=_['merge']({},_0x388e10,_0x815fa9['options']);var _0x371729={'where':_0x388e10['where']};return db['VoiceExtension'][_0x183a('0x12')](_0x371729)[_0x183a('0x17')](function(_0x11fd9b){_0x4bd6ac['count']=_0x11fd9b;if(_0x815fa9[_0x183a('0x29')][_0x183a('0x38')]){_0x388e10[_0x183a('0x39')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x388e10);})[_0x183a('0x17')](function(_0x46e09c){_0x4bd6ac[_0x183a('0x3a')]=_0x46e09c;return _0x4bd6ac;})[_0x183a('0x17')](respondWithFilteredResult(_0x5a4842,_0x388e10))[_0x183a('0x3b')](handleError(_0x5a4842,null));};exports[_0x183a('0x3c')]=function(_0x4c3865,_0x716f22){var _0x4bbc4c={'raw':![],'where':{'id':_0x4c3865[_0x183a('0x3d')]['id']}},_0x3d7fbd={};_0x3d7fbd[_0x183a('0x2c')]=_['keys'](db['VoiceExtension']['rawAttributes']);_0x3d7fbd[_0x183a('0x29')]=_[_0x183a('0x2a')](_0x4c3865[_0x183a('0x29')]);_0x3d7fbd[_0x183a('0x33')]=_[_0x183a('0x2b')](_0x3d7fbd[_0x183a('0x2c')],_0x3d7fbd['query']);_0x4bbc4c[_0x183a('0x2d')]=_['intersection'](_0x3d7fbd[_0x183a('0x2c')],qs[_0x183a('0x2e')](_0x4c3865[_0x183a('0x29')]['fields']));_0x4bbc4c[_0x183a('0x2d')]=_0x4bbc4c[_0x183a('0x2d')][_0x183a('0x2f')]?_0x4bbc4c['attributes']:_0x3d7fbd[_0x183a('0x2c')];if(_0x4c3865[_0x183a('0x29')][_0x183a('0x38')]){_0x4bbc4c[_0x183a('0x39')]=[{'all':!![]}];}_0x4bbc4c=_[_0x183a('0x36')]({},_0x4bbc4c,_0x4c3865['options']);return db[_0x183a('0x28')]['find'](_0x4bbc4c)[_0x183a('0x17')](handleEntityNotFound(_0x716f22,null))[_0x183a('0x17')](respondWithResult(_0x716f22,null))[_0x183a('0x3b')](handleError(_0x716f22,null));};exports[_0x183a('0x16')]=function(_0x1b3faf,_0x3fffd8){return db[_0x183a('0x28')][_0x183a('0x21')]({'where':{'id':_0x1b3faf[_0x183a('0x3d')]['id']}})[_0x183a('0x17')](handleEntityNotFound(_0x3fffd8,null))[_0x183a('0x17')](removeEntity(_0x3fffd8,null))['catch'](handleError(_0x3fffd8,null));};exports['create']=function(_0x1c2ea3,_0x2db304){if(_0x1c2ea3[_0x183a('0x3e')][_0x183a('0x22')]===_0x183a('0x1b')&&!_[_0x183a('0x3f')](_0x1c2ea3[_0x183a('0x3e')]['exten'],'_')){_0x1c2ea3[_0x183a('0x3e')][_0x183a('0x40')]='_'[_0x183a('0x41')](_0x1c2ea3[_0x183a('0x3e')]['exten']);}return db[_0x183a('0x28')][_0x183a('0x42')](_0x1c2ea3[_0x183a('0x3e')],{'raw':![]})[_0x183a('0x17')](function(_0x17d4e8){var _0x9a32a=_0x1c2ea3[_0x183a('0x43')]['get']({'plain':!![]});if(!_0x9a32a)throw new Error(_0x183a('0x44'));if(_0x9a32a[_0x183a('0x45')]===_0x183a('0x43')){var _0x664fc5=_0x17d4e8[_0x183a('0x18')]({'plain':!![]});var _0x558af0=[{'name':_0x183a('0x19'),'value':_0x183a('0x1a')},{'name':_0x183a('0x46'),'value':'outbound'},{'name':_0x183a('0x1c'),'value':_0x183a('0x47')}];var _0x1dea4b=_['find'](_0x558af0,[_0x183a('0x1f'),_0x664fc5[_0x183a('0x22')]])[_0x183a('0x23')];return db['UserProfileSection'][_0x183a('0x21')]({'where':{'name':_0x1dea4b,'userProfileId':_0x9a32a[_0x183a('0x48')]},'raw':!![]})[_0x183a('0x17')](function(_0x179ec6){if(_0x179ec6&&_0x179ec6['autoAssociation']===0x0){return db[_0x183a('0x24')][_0x183a('0x42')]({'name':_0x664fc5[_0x183a('0x23')],'resourceId':_0x664fc5['id'],'type':_0x179ec6['name'],'sectionId':_0x179ec6['id']},{})[_0x183a('0x17')](function(){return _0x17d4e8;});}else{return _0x17d4e8;}})[_0x183a('0x3b')](function(_0x4b6b14){logger[_0x183a('0x49')](_0x183a('0x4a'),_0x4b6b14);throw _0x4b6b14;});}return _0x17d4e8;})[_0x183a('0x17')](respondWithResult(_0x2db304,0xc9))[_0x183a('0x3b')](handleError(_0x2db304,null));};exports[_0x183a('0x4b')]=function(_0x5bdc8b,_0x32d4fd){if(_0x5bdc8b['body']['id']){delete _0x5bdc8b[_0x183a('0x3e')]['id'];}return db[_0x183a('0x28')][_0x183a('0x21')]({'where':{'id':_0x5bdc8b['params']['id']}})[_0x183a('0x17')](handleEntityNotFound(_0x32d4fd,null))[_0x183a('0x17')](function(_0x5d6327){if(_0x5d6327){return db[_0x183a('0x28')][_0x183a('0x4b')](_[_0x183a('0x34')](_0x5bdc8b[_0x183a('0x3e')],[_0x183a('0x40'),'context',_0x183a('0x4c'),_0x183a('0x4d'),'cutdigits','mandatoryDisposition',_0x183a('0x4e')]),{'where':{'context':_0x5d6327[_0x183a('0x4f')],'exten':_0x5d6327[_0x183a('0x40')]},'individualHooks':!![]})[_0x183a('0x17')](function(_0x196428){return _0x196428;});}return null;})['then'](respondWithStatusCode(_0x32d4fd,null))[_0x183a('0x3b')](handleError(_0x32d4fd,null));};exports['addApplications']=function(_0x1c293d,_0x2ff0f2){var _0x4a805b=_0x1c293d[_0x183a('0x3d')]['id'];var _0x7e1189=_0x1c293d[_0x183a('0x3e')];var _0x389fa8=0xc8;var _0x38986a=null;return db[_0x183a('0x50')]['transaction']({'isolationLevel':db[_0x183a('0x50')]['Transaction'][_0x183a('0x51')][_0x183a('0x52')]},function(_0x415187){return db[_0x183a('0x28')][_0x183a('0x53')]({'where':{'id':_0x4a805b},'transaction':_0x415187})[_0x183a('0x17')](function(_0x16e0da){if(_0x16e0da){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x4a805b},'transaction':_0x415187})[_0x183a('0x17')](function(){var _0x5b866b=_[_0x183a('0x1e')](_0x7e1189,function(_0x1b578b){_0x1b578b['VoiceExtensionId']=_0x4a805b;_0x1b578b[_0x183a('0x54')]=!![];return _0x1b578b;});return _0x16e0da[_0x183a('0x55')](_0x5b866b);})[_0x183a('0x17')](function(_0x35cedd){return db['VoiceExtension'][_0x183a('0x56')](_0x35cedd,{'transaction':_0x415187});});}else{_0x389fa8=0x194;_0x38986a=[];}});})[_0x183a('0x17')](function(){if(_0x389fa8!==0x194){return db[_0x183a('0x28')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4a805b},'order':_0x183a('0x57')})[_0x183a('0x17')](function(_0x5898a8){_0x38986a=_0x5898a8;});}})[_0x183a('0x3b')](function(_0xd4b401){_0x389fa8=0x1f4;logger[_0x183a('0x49')](_0xd4b401[_0x183a('0x25')]);if(_0xd4b401[_0x183a('0x23')]){delete _0xd4b401['name'];}_0x38986a=_0xd4b401;})[_0x183a('0x58')](function(){if(_0x38986a===null){_0x2ff0f2[_0x183a('0xc')](_0x389fa8);}else{if(_0x389fa8===0x1f4){_0x2ff0f2['status'](_0x389fa8)[_0x183a('0x26')](_0x38986a);}else{_0x2ff0f2[_0x183a('0xd')](_0x389fa8)[_0x183a('0xf')](_0x38986a);}}});};
\ No newline at end of file
+var _0x1a24=['rows','catch','show','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','stack','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','pick','filters','merge','where','VIRTUAL','options','includeAll','include','findAll'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1a24,0x142));var _0x41a2=function(_0x447d73,_0x50f8c7){_0x447d73=_0x447d73-0x0;var _0x343b07=_0x1a24[_0x447d73];return _0x343b07;};'use strict';var _=require(_0x41a2('0x0'));var Redis=require(_0x41a2('0x1'));var qs=require(_0x41a2('0x2'));var logger=require('../../config/logger')(_0x41a2('0x3'));var config=require(_0x41a2('0x4'));var db=require(_0x41a2('0x5'))['db'];config['redis']=_[_0x41a2('0x6')](config[_0x41a2('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x41a2('0x8'))(new Redis(config['redis']));require(_0x41a2('0x9'))[_0x41a2('0xa')](socket);function respondWithStatusCode(_0x23fdb6,_0x1bc5a1){_0x1bc5a1=_0x1bc5a1||0xcc;return function(_0x119a00){if(_0x119a00){return _0x23fdb6[_0x41a2('0xb')](_0x1bc5a1);}return _0x23fdb6[_0x41a2('0xc')](_0x1bc5a1)['end']();};}function respondWithResult(_0xff9a4,_0x33e557){_0x33e557=_0x33e557||0xc8;return function(_0x29b9db){if(_0x29b9db){return _0xff9a4[_0x41a2('0xc')](_0x33e557)['json'](_0x29b9db);}};}function respondWithFilteredResult(_0x3a4321,_0x4e767c){return function(_0x24a5dc){if(_0x24a5dc){var _0x545472=typeof _0x4e767c[_0x41a2('0xd')]==='undefined'&&typeof _0x4e767c[_0x41a2('0xe')]==='undefined';var _0x5c1a32=_0x24a5dc[_0x41a2('0xf')];var _0x2e595d=_0x545472?0x0:_0x4e767c[_0x41a2('0xd')];var _0x35b3be=_0x545472?_0x24a5dc[_0x41a2('0xf')]:_0x4e767c[_0x41a2('0xd')]+_0x4e767c[_0x41a2('0xe')];var _0x452dab;if(_0x35b3be>=_0x5c1a32){_0x35b3be=_0x5c1a32;_0x452dab=0xc8;}else{_0x452dab=0xce;}_0x3a4321[_0x41a2('0xc')](_0x452dab);return _0x3a4321[_0x41a2('0x10')](_0x41a2('0x11'),_0x2e595d+'-'+_0x35b3be+'/'+_0x5c1a32)[_0x41a2('0x12')](_0x24a5dc);}return null;};}function removeEntity(_0x3ae879){return function(_0x4bcc35){if(_0x4bcc35){return _0x4bcc35[_0x41a2('0x13')]()[_0x41a2('0x14')](function(){var _0x27a97d=_0x4bcc35[_0x41a2('0x15')]({'plain':!![]});var _0x246fda=[{'name':_0x41a2('0x16'),'value':_0x41a2('0x17'),'ignore':![]},{'name':_0x41a2('0x18'),'value':_0x41a2('0x19'),'ignore':![]},{'name':'InternalRoutes','value':_0x41a2('0x1a'),'ignore':![]}];var _0x3fc871=_(_0x246fda)[_0x41a2('0x1b')](_0x41a2('0x1c'))[_0x41a2('0x1d')]('value')[_0x41a2('0x1e')]();if(_[_0x41a2('0x1f')](_0x3fc871,_0x27a97d[_0x41a2('0x20')])){return;}var _0xb1bc07=_[_0x41a2('0x21')](_0x246fda,[_0x41a2('0x1e'),_0x27a97d[_0x41a2('0x20')]])[_0x41a2('0x22')];return db[_0x41a2('0x23')]['destroy']({'where':{'type':_0xb1bc07,'resourceId':_0x27a97d['id']}})[_0x41a2('0x14')](function(){return _0x4bcc35;});})[_0x41a2('0x14')](function(){_0x3ae879[_0x41a2('0xc')](0xcc)[_0x41a2('0x24')]();});}};}function handleEntityNotFound(_0x293231){return function(_0x4011f6){if(!_0x4011f6){_0x293231[_0x41a2('0xb')](0x194);}return _0x4011f6;};}function handleError(_0x45728d,_0x2a7cde){_0x2a7cde=_0x2a7cde||0x1f4;return function(_0x48c139){logger[_0x41a2('0x25')](_0x48c139['stack']);if(_0x48c139[_0x41a2('0x22')]){delete _0x48c139[_0x41a2('0x22')];}_0x45728d[_0x41a2('0xc')](_0x2a7cde)[_0x41a2('0x26')](_0x48c139);};}exports[_0x41a2('0x27')]=function(_0x4fe052,_0x4d6460){var _0x3e2b09={},_0x3ec8b1={},_0x2e6ac4={'count':0x0,'rows':[]};var _0x205b72=_[_0x41a2('0x1d')](db[_0x41a2('0x28')][_0x41a2('0x29')],function(_0x441840){return{'name':_0x441840[_0x41a2('0x2a')],'type':_0x441840['type'][_0x41a2('0x2b')]};});_0x3ec8b1[_0x41a2('0x2c')]=_['map'](_0x205b72,_0x41a2('0x22'));_0x3ec8b1[_0x41a2('0x2d')]=_[_0x41a2('0x2e')](_0x4fe052[_0x41a2('0x2d')]);_0x3ec8b1['filters']=_['intersection'](_0x3ec8b1[_0x41a2('0x2c')],_0x3ec8b1[_0x41a2('0x2d')]);_0x3e2b09[_0x41a2('0x2f')]=_[_0x41a2('0x30')](_0x3ec8b1['model'],qs[_0x41a2('0x31')](_0x4fe052[_0x41a2('0x2d')]['fields']));_0x3e2b09[_0x41a2('0x2f')]=_0x3e2b09[_0x41a2('0x2f')]['length']?_0x3e2b09[_0x41a2('0x2f')]:_0x3ec8b1[_0x41a2('0x2c')];if(!_0x4fe052[_0x41a2('0x2d')]['hasOwnProperty'](_0x41a2('0x32'))){_0x3e2b09[_0x41a2('0xe')]=qs[_0x41a2('0xe')](_0x4fe052[_0x41a2('0x2d')][_0x41a2('0xe')]);_0x3e2b09[_0x41a2('0xd')]=qs[_0x41a2('0xd')](_0x4fe052[_0x41a2('0x2d')]['offset']);}_0x3e2b09[_0x41a2('0x33')]=qs[_0x41a2('0x34')](_0x4fe052[_0x41a2('0x2d')][_0x41a2('0x34')]);_0x3e2b09['where']=qs['filters'](_[_0x41a2('0x35')](_0x4fe052[_0x41a2('0x2d')],_0x3ec8b1[_0x41a2('0x36')]),_0x205b72);if(_0x4fe052[_0x41a2('0x2d')]['filter']){_0x3e2b09['where']=_[_0x41a2('0x37')](_0x3e2b09[_0x41a2('0x38')],{'$or':_[_0x41a2('0x1d')](_0x205b72,function(_0x3173e5){if(_0x3173e5['type']!==_0x41a2('0x39')){var _0x537f44={};_0x537f44[_0x3173e5[_0x41a2('0x22')]]={'$like':'%'+_0x4fe052[_0x41a2('0x2d')][_0x41a2('0x1b')]+'%'};return _0x537f44;}})});}_0x3e2b09=_[_0x41a2('0x37')]({},_0x3e2b09,_0x4fe052[_0x41a2('0x3a')]);var _0xd1b1c6={'where':_0x3e2b09['where']};return db[_0x41a2('0x28')]['count'](_0xd1b1c6)[_0x41a2('0x14')](function(_0x3a2250){_0x2e6ac4[_0x41a2('0xf')]=_0x3a2250;if(_0x4fe052[_0x41a2('0x2d')][_0x41a2('0x3b')]){_0x3e2b09[_0x41a2('0x3c')]=[{'all':!![]}];}return db['VoiceExtension'][_0x41a2('0x3d')](_0x3e2b09);})[_0x41a2('0x14')](function(_0x5ae036){_0x2e6ac4[_0x41a2('0x3e')]=_0x5ae036;return _0x2e6ac4;})['then'](respondWithFilteredResult(_0x4d6460,_0x3e2b09))[_0x41a2('0x3f')](handleError(_0x4d6460,null));};exports[_0x41a2('0x40')]=function(_0x162d75,_0x39d27c){var _0x35b463={'raw':![],'where':{'id':_0x162d75['params']['id']}},_0x7602ae={};_0x7602ae[_0x41a2('0x2c')]=_['keys'](db['VoiceExtension'][_0x41a2('0x29')]);_0x7602ae[_0x41a2('0x2d')]=_['keys'](_0x162d75[_0x41a2('0x2d')]);_0x7602ae[_0x41a2('0x36')]=_[_0x41a2('0x30')](_0x7602ae['model'],_0x7602ae[_0x41a2('0x2d')]);_0x35b463[_0x41a2('0x2f')]=_['intersection'](_0x7602ae['model'],qs[_0x41a2('0x31')](_0x162d75[_0x41a2('0x2d')][_0x41a2('0x31')]));_0x35b463[_0x41a2('0x2f')]=_0x35b463[_0x41a2('0x2f')]['length']?_0x35b463[_0x41a2('0x2f')]:_0x7602ae[_0x41a2('0x2c')];if(_0x162d75[_0x41a2('0x2d')][_0x41a2('0x3b')]){_0x35b463['include']=[{'all':!![]}];}_0x35b463=_[_0x41a2('0x37')]({},_0x35b463,_0x162d75['options']);return db['VoiceExtension'][_0x41a2('0x21')](_0x35b463)[_0x41a2('0x14')](handleEntityNotFound(_0x39d27c,null))['then'](respondWithResult(_0x39d27c,null))[_0x41a2('0x3f')](handleError(_0x39d27c,null));};exports[_0x41a2('0x13')]=function(_0x34ed54,_0x4102d5){return db[_0x41a2('0x28')][_0x41a2('0x21')]({'where':{'id':_0x34ed54[_0x41a2('0x41')]['id']}})[_0x41a2('0x14')](handleEntityNotFound(_0x4102d5,null))[_0x41a2('0x14')](removeEntity(_0x4102d5,null))[_0x41a2('0x3f')](handleError(_0x4102d5,null));};exports[_0x41a2('0x42')]=function(_0x7d5718,_0x46372e){if(_0x7d5718[_0x41a2('0x43')][_0x41a2('0x20')]===_0x41a2('0x19')&&!_[_0x41a2('0x44')](_0x7d5718[_0x41a2('0x43')][_0x41a2('0x45')],'_')){_0x7d5718[_0x41a2('0x43')]['exten']='_'[_0x41a2('0x46')](_0x7d5718[_0x41a2('0x43')][_0x41a2('0x45')]);}return db[_0x41a2('0x28')][_0x41a2('0x42')](_0x7d5718[_0x41a2('0x43')],{'raw':![]})[_0x41a2('0x14')](function(_0x11cfec){var _0x1fa489=_0x7d5718[_0x41a2('0x47')][_0x41a2('0x15')]({'plain':!![]});if(!_0x1fa489)throw new Error(_0x41a2('0x48'));if(_0x1fa489[_0x41a2('0x49')]===_0x41a2('0x47')){var _0x1bf66b=_0x11cfec[_0x41a2('0x15')]({'plain':!![]});var _0x1a757a=[{'name':_0x41a2('0x16'),'value':'inbound'},{'name':'OutboundRoutes','value':_0x41a2('0x19')},{'name':'InternalRoutes','value':_0x41a2('0x1a')}];var _0x85488b=_[_0x41a2('0x21')](_0x1a757a,[_0x41a2('0x1e'),_0x1bf66b[_0x41a2('0x20')]])[_0x41a2('0x22')];return db[_0x41a2('0x4a')]['find']({'where':{'name':_0x85488b,'userProfileId':_0x1fa489[_0x41a2('0x4b')]},'raw':!![]})['then'](function(_0x458384){if(_0x458384&&_0x458384[_0x41a2('0x4c')]===0x0){return db[_0x41a2('0x23')][_0x41a2('0x42')]({'name':_0x1bf66b['name'],'resourceId':_0x1bf66b['id'],'type':_0x458384[_0x41a2('0x22')],'sectionId':_0x458384['id']},{})['then'](function(){return _0x11cfec;});}else{return _0x11cfec;}})['catch'](function(_0x1bab70){logger[_0x41a2('0x25')](_0x41a2('0x4d'),_0x1bab70);throw _0x1bab70;});}return _0x11cfec;})['then'](respondWithResult(_0x46372e,0xc9))['catch'](handleError(_0x46372e,null));};exports[_0x41a2('0x4e')]=function(_0x37b5e8,_0x26e41a){if(_0x37b5e8['body']['id']){delete _0x37b5e8['body']['id'];}return db[_0x41a2('0x28')][_0x41a2('0x21')]({'where':{'id':_0x37b5e8[_0x41a2('0x41')]['id']}})[_0x41a2('0x14')](handleEntityNotFound(_0x26e41a,null))[_0x41a2('0x14')](function(_0x3a0714){if(_0x3a0714){return db[_0x41a2('0x28')][_0x41a2('0x4e')](_['pick'](_0x37b5e8[_0x41a2('0x43')],[_0x41a2('0x45'),_0x41a2('0x4f'),_0x41a2('0x50'),_0x41a2('0x51'),_0x41a2('0x52'),'mandatoryDisposition','alias']),{'where':{'context':_0x3a0714[_0x41a2('0x4f')],'exten':_0x3a0714['exten']},'individualHooks':!![]})['then'](function(_0x2c8593){return _0x2c8593;});}return null;})['then'](respondWithStatusCode(_0x26e41a,null))[_0x41a2('0x3f')](handleError(_0x26e41a,null));};exports[_0x41a2('0x53')]=function(_0x2f780d,_0x86b578){var _0x17711f=_0x2f780d[_0x41a2('0x41')]['id'];var _0x199bad=_0x2f780d['body'];var _0x27fb00=0xc8;var _0x4e6ed0=null;return db['sequelize'][_0x41a2('0x54')]({'isolationLevel':db[_0x41a2('0x55')][_0x41a2('0x56')][_0x41a2('0x57')][_0x41a2('0x58')]},function(_0x38c841){return db[_0x41a2('0x28')][_0x41a2('0x59')]({'where':{'id':_0x17711f},'transaction':_0x38c841})[_0x41a2('0x14')](function(_0x22323b){if(_0x22323b){return db[_0x41a2('0x28')]['destroy']({'where':{'VoiceExtensionId':_0x17711f},'transaction':_0x38c841})[_0x41a2('0x14')](function(){var _0x31b1fa=_['map'](_0x199bad,function(_0x59f51a){_0x59f51a[_0x41a2('0x5a')]=_0x17711f;_0x59f51a[_0x41a2('0x5b')]=!![];return _0x59f51a;});return _0x22323b['createRouting'](_0x31b1fa);})[_0x41a2('0x14')](function(_0x37e3b2){return db['VoiceExtension'][_0x41a2('0x5c')](_0x37e3b2,{'transaction':_0x38c841});});}else{_0x27fb00=0x194;_0x4e6ed0=[];}});})[_0x41a2('0x14')](function(){if(_0x27fb00!==0x194){return db[_0x41a2('0x28')][_0x41a2('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x17711f},'order':'priority'})[_0x41a2('0x14')](function(_0x4ab681){_0x4e6ed0=_0x4ab681;});}})['catch'](function(_0x59d0c9){_0x27fb00=0x1f4;logger[_0x41a2('0x25')](_0x59d0c9[_0x41a2('0x5e')]);if(_0x59d0c9[_0x41a2('0x22')]){delete _0x59d0c9[_0x41a2('0x22')];}_0x4e6ed0=_0x59d0c9;})[_0x41a2('0x5f')](function(){if(_0x4e6ed0===null){_0x86b578[_0x41a2('0xb')](_0x27fb00);}else{if(_0x27fb00===0x1f4){_0x86b578[_0x41a2('0xc')](_0x27fb00)[_0x41a2('0x26')](_0x4e6ed0);}else{_0x86b578['status'](_0x27fb00)[_0x41a2('0x12')](_0x4e6ed0);}}});};
\ No newline at end of file
index 4904310..b6a8ff8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd008=['hook','exports','events','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xc27aef,_0x5bd885){var _0x20c546=function(_0x416ec4){while(--_0x416ec4){_0xc27aef['push'](_0xc27aef['shift']());}};_0x20c546(++_0x5bd885);}(_0xd008,0xde));var _0x8d00=function(_0x476299,_0x389a8b){_0x476299=_0x476299-0x0;var _0x479f7a=_0xd008[_0x476299];return _0x479f7a;};'use strict';var EventEmitter=require(_0x8d00('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x8d00('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8d00('0x2')](0x0);var events={'afterCreate':_0x8d00('0x3'),'afterUpdate':_0x8d00('0x4'),'afterDestroy':_0x8d00('0x5')};function emitEvent(_0x2d7c24){return function(_0x18a1b7,_0x4e30fc,_0x271014){VoiceExtensionEvents[_0x8d00('0x6')](_0x2d7c24+':'+_0x18a1b7['id'],_0x18a1b7);VoiceExtensionEvents['emit'](_0x2d7c24,_0x18a1b7);_0x271014(null);};}for(var e in events){if(events[_0x8d00('0x7')](e)){var event=events[e];VoiceExtension[_0x8d00('0x8')](e,emitEvent(event));}}module[_0x8d00('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xf686=['exports','events','../../mysqldb','remove','emit','hasOwnProperty','hook'];(function(_0x34e063,_0xe12c0e){var _0x521e79=function(_0x3b5399){while(--_0x3b5399){_0x34e063['push'](_0x34e063['shift']());}};_0x521e79(++_0xe12c0e);}(_0xf686,0x127));var _0x6f68=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf686[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x6f68('0x0'));var VoiceExtension=require(_0x6f68('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6f68('0x2')};function emitEvent(_0x4778f9){return function(_0x15762c,_0x31becb,_0x1c5a18){VoiceExtensionEvents[_0x6f68('0x3')](_0x4778f9+':'+_0x15762c['id'],_0x15762c);VoiceExtensionEvents['emit'](_0x4778f9,_0x15762c);_0x1c5a18(null);};}for(var e in events){if(events[_0x6f68('0x4')](e)){var event=events[e];VoiceExtension[_0x6f68('0x5')](e,emitEvent(event));}}module[_0x6f68('0x6')]=VoiceExtensionEvents;
\ No newline at end of file
index 68ce034..a905669 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8734=['CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','split','length','name','trunk','param','phone','prefix','SIP','U(xcally-mixmonitor-context)','join','isEmpty','Interval','findAll','IntervalId','interval','*,*,*,*','map','toLowerCase','tag','push','CDR(tag)=','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','Hangup','lodash','exports','models','type','CDR(type)=','Set','NoOp','alias','CDR(routeAlias)=','context','exten','inbound'];(function(_0x4d91e4,_0xb83618){var _0x382475=function(_0x1f2935){while(--_0x1f2935){_0x4d91e4['push'](_0x4d91e4['shift']());}};_0x382475(++_0xb83618);}(_0x8734,0x134));var _0x4873=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x8734[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x4873('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x4873('0x1')]=function(_0x29ba53){var _0x270283=_0x29ba53[_0x4873('0x2')];function _0x4eb8ad(_0x35bd54){var _0x5bcb32=0x2;var _0x1ae455=[{'type':_0x35bd54[_0x4873('0x3')],'app':'Set','appdata':_0x4873('0x4')+_0x35bd54['type'],'context':_0x35bd54['context'],'exten':_0x35bd54['exten'],'priority':_0x5bcb32++,'VoiceExtensionId':_0x35bd54['id']},{'type':_0x35bd54[_0x4873('0x3')],'app':_0x35bd54['alias']?_0x4873('0x5'):_0x4873('0x6'),'appdata':_0x35bd54[_0x4873('0x7')]?_0x4873('0x8')+_0x35bd54[_0x4873('0x7')]:'No\x20alias\x20set','context':_0x35bd54[_0x4873('0x9')],'exten':_0x35bd54[_0x4873('0xa')],'priority':_0x5bcb32++,'VoiceExtensionId':_0x35bd54['id']}];if(_0x35bd54['type']===_0x4873('0xb')){_0x1ae455['push']({'type':_0x4873('0xb'),'app':_0x4873('0x5'),'appdata':_0x4873('0xc')+_0x35bd54['id'],'context':_0x35bd54['context'],'exten':_0x35bd54[_0x4873('0xa')],'priority':_0x5bcb32++,'VoiceExtensionId':_0x35bd54['id']});}_0x1ae455['push']({'type':_0x35bd54[_0x4873('0x3')],'app':_0x4873('0x5'),'appdata':_0x4873('0xd'),'context':_0x35bd54['context'],'exten':_0x35bd54[_0x4873('0xa')],'priority':_0x5bcb32++,'VoiceExtensionId':_0x35bd54['id']},{'type':_0x35bd54[_0x4873('0x3')],'app':_0x4873('0x5'),'appdata':_0x4873('0xe'),'context':_0x35bd54['context'],'exten':_0x35bd54['exten'],'priority':_0x5bcb32++,'VoiceExtensionId':_0x35bd54['id']},{'type':_0x35bd54[_0x4873('0x3')],'app':_0x4873('0x5'),'appdata':_0x4873('0xf'),'context':_0x35bd54[_0x4873('0x9')],'exten':_0x35bd54['exten'],'priority':_0x5bcb32++,'VoiceExtensionId':_0x35bd54['id']});return _0x1ae455;}function _0x471eb3(_0x476100){var _0x533812=0x2;var _0x552a71=[{'type':_0x4873('0x10'),'app':_0x4873('0x5'),'appdata':_0x4873('0x11'),'context':_0x476100[_0x4873('0x9')],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':_0x4873('0x10'),'app':_0x476100['alias']?'Set':_0x4873('0x6'),'appdata':_0x476100[_0x4873('0x7')]?'CDR(routeAlias)='+_0x476100[_0x4873('0x7')]:'No\x20alias\x20set','context':_0x476100[_0x4873('0x9')],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':_0x4873('0x10'),'app':_0x4873('0x5'),'appdata':'CDR(destination)='+(_0x476100[_0x4873('0x12')]?_0x4873('0x13')+_0x476100[_0x4873('0x12')]+'}':_0x4873('0x14')),'context':_0x476100['context'],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':_0x4873('0x10'),'app':'Set','appdata':_0x4873('0xc')+_0x476100['id'],'context':_0x476100['context'],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':_0x4873('0x10'),'app':_0x4873('0x15'),'appdata':_0x4873('0x16')+(_0x533812+0x2)+_0x4873('0x17')+(_0x533812+0x1)+')','context':_0x476100[_0x4873('0x9')],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':'outbound','app':'Set','appdata':_0x476100[_0x4873('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x476100[_0x4873('0x12')]+'}':_0x4873('0x18'),'context':_0x476100[_0x4873('0x9')],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':_0x4873('0x10'),'app':_0x4873('0x5'),'appdata':_0x4873('0xd'),'context':_0x476100[_0x4873('0x9')],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':'outbound','app':_0x4873('0x5'),'appdata':_0x4873('0xe'),'context':_0x476100['context'],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':_0x4873('0x10'),'app':_0x4873('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x476100['context'],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':'outbound','app':'Set','appdata':_0x4873('0x19')+_0x476100['id'],'context':_0x476100['context'],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']}];if(_0x476100[_0x4873('0x1a')](_0x4873('0x1b'))&&_0x476100['recordingFormat']!==_0x4873('0x1c')){_0x552a71['push']({'type':_0x4873('0x10'),'app':_0x4873('0x5'),'appdata':_0x4873('0x1d'),'context':_0x476100['context'],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']},{'type':_0x4873('0x10'),'app':_0x4873('0x5'),'appdata':_0x4873('0x1e')+_0x476100[_0x4873('0x1b')]||'wav','context':_0x476100[_0x4873('0x9')],'exten':_0x476100[_0x4873('0xa')],'priority':_0x533812++,'VoiceExtensionId':_0x476100['id']});}return _0x552a71;}function _0x735543(_0x41497b,_0x353508){var _0x4d9f56=[{'name':'trunk','param':0x0},{'name':_0x4873('0x1f'),'param':0x1},{'name':_0x4873('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x4b588d={};var _0xe2d48a=_0x353508[_0x4873('0x21')](',');var _0x188998=[];for(var _0x299774=0x0;_0x299774<_0x4d9f56[_0x4873('0x22')];_0x299774++){switch(_0x4d9f56[_0x299774][_0x4873('0x23')]){case _0x4873('0x24'):_0x4b588d[_0x4873('0x24')]=_0xe2d48a[_0x4d9f56[_0x299774][_0x4873('0x25')]][_0x4873('0x21')]('/')[0x1];_0x4b588d[_0x4873('0x26')]=_0xe2d48a[_0x4d9f56[_0x299774]['param']][_0x4873('0x21')]('/')[0x2];_0x4b588d['prefix']=_0x4b588d['phone']?_0x4b588d[_0x4873('0x26')][_0x4873('0x21')]('$')[0x0]:undefined;_0x4b588d[_0x4873('0x26')]=_0x41497b['cutdigits']?(_0x4b588d[_0x4873('0x27')]||'')+_0x4873('0x13')+_0x41497b[_0x4873('0x12')]+'}':(_0x4b588d['prefix']||'')+_0x4873('0x14');_0x188998[_0x4d9f56[_0x299774][_0x4873('0x25')]]=[_0x4873('0x28'),_0x4b588d[_0x4873('0x24')],_0x4b588d[_0x4873('0x26')]]['join']('/');break;case _0x4873('0x20'):_0x4b588d['options']=_0xe2d48a[_0x4d9f56[_0x299774][_0x4873('0x25')]];if(_0x41497b[_0x4873('0x1b')]!==_0x4873('0x1c')){if(_0x4b588d[_0x4873('0x20')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x4b588d['options']+=_0x4873('0x29');}}else{_0x4b588d[_0x4873('0x20')]=_0x4b588d['options']['replace']('U(xcally-mixmonitor-context)','');}_0x188998[_0x4d9f56[_0x299774]['param']]=_0x4b588d['options'];break;default:_0x188998[_0x4d9f56[_0x299774][_0x4873('0x25')]]=_0xe2d48a[_0x4d9f56[_0x299774][_0x4873('0x25')]];}}return _0x188998[_0x4873('0x2a')](',');}function _0x5bc9e8(_0x3fd078,_0x335390,_0x506701){return new Promise(function(_0x351b46,_0x1a3eee){var _0x414bab=[];if(_[_0x4873('0x2b')](_0x335390))return _0x351b46(_0x414bab);_0x270283[_0x4873('0x2c')][_0x4873('0x2d')]({'attributes':['id','interval',_0x4873('0x2e')],'raw':!![]})['then'](function(_0x342d79){for(var _0x50ccb3=0x0,_0x55f15e=0x0;_0x50ccb3<_0x335390['length'];_0x50ccb3++,_0x55f15e=0x0){var _0x500f6b=_0x335390[_0x50ccb3];var _0x577b57=[];var _0x46102b=[];delete _0x500f6b['id'];if(_0x500f6b[_0x4873('0x2f')]!==_0x4873('0x30')){_0x500f6b['intervals']=[_0x500f6b[_0x4873('0x2f')]];}else{_0x500f6b['intervals']=_0x500f6b[_0x4873('0x2e')]?_[_0x4873('0x31')](_['filter'](_0x342d79,{'IntervalId':_0x500f6b[_0x4873('0x2e')]}),_0x4873('0x2f')):[];}_0x500f6b[_0x4873('0x9')]=_0x3fd078[_0x4873('0x9')];_0x500f6b[_0x4873('0xa')]=_0x3fd078[_0x4873('0xa')];if(_0x500f6b[_0x4873('0x3')])_0x500f6b[_0x4873('0x3')]=_0x500f6b[_0x4873('0x3')][_0x4873('0x32')]();if(_0x3fd078['type']==='outbound'){if(_0x500f6b[_0x4873('0x1a')](_0x4873('0x33'))&&_0x500f6b[_0x4873('0x33')]&&_0x500f6b[_0x4873('0x33')]!=='--'){_0x577b57[_0x4873('0x34')]({'type':_0x500f6b['type'][_0x4873('0x32')](),'app':_0x4873('0x5'),'appdata':_0x4873('0x35')+_0x500f6b[_0x4873('0x33')],'context':_0x3fd078[_0x4873('0x9')],'exten':_0x3fd078[_0x4873('0xa')],'priority':_0x500f6b[_0x4873('0x36')]['length']+_0x506701+_0x55f15e++,'VoiceExtensionId':_0x3fd078['id']});}_0x577b57[_0x4873('0x34')]({'type':_0x500f6b[_0x4873('0x3')]['toLowerCase'](),'app':_0x4873('0x15'),'appdata':_0x4873('0x37')+(_0x500f6b[_0x4873('0x38')]?_0x4873('0x39')+_0x500f6b[_0x4873('0x38')]+')':_0x4873('0x3a')),'context':_0x3fd078['context'],'exten':_0x3fd078[_0x4873('0xa')],'priority':_0x500f6b[_0x4873('0x36')][_0x4873('0x22')]+_0x506701+_0x55f15e++,'VoiceExtensionId':_0x3fd078['id']});}else{if(_0x500f6b[_0x4873('0x1a')](_0x4873('0x3b'))){if([_0x4873('0x3c'),_0x4873('0x3d')][_0x4873('0x3e')](_0x500f6b[_0x4873('0x3f')][_0x4873('0x32')]())&&_0x500f6b[_0x4873('0x40')]!==_0x4873('0x41')){if(_0x500f6b[_0x4873('0x3b')]){_0x577b57[_0x4873('0x34')]({'type':_0x500f6b['type']['toLowerCase'](),'app':_0x4873('0x15'),'appdata':_0x4873('0x42'),'context':_0x3fd078['context'],'exten':_0x3fd078['exten'],'priority':_0x500f6b[_0x4873('0x36')][_0x4873('0x22')]+_0x506701+_0x55f15e++,'VoiceExtensionId':_0x3fd078['id']});_0x577b57['push']({'type':_0x500f6b[_0x4873('0x3')][_0x4873('0x32')](),'app':'Set','appdata':_0x4873('0x43'),'context':_0x3fd078[_0x4873('0x9')],'exten':_0x3fd078[_0x4873('0xa')],'priority':_0x500f6b[_0x4873('0x36')][_0x4873('0x22')]+_0x506701+_0x55f15e++,'VoiceExtensionId':_0x3fd078['id']});}else{_0x577b57[_0x4873('0x34')]({'type':_0x500f6b['type'][_0x4873('0x32')](),'app':'ExecIf','appdata':_0x4873('0x44'),'context':_0x3fd078[_0x4873('0x9')],'exten':_0x3fd078['exten'],'priority':_0x500f6b[_0x4873('0x36')][_0x4873('0x22')]+_0x506701+_0x55f15e++,'VoiceExtensionId':_0x3fd078['id']});_0x577b57[_0x4873('0x34')]({'type':_0x500f6b[_0x4873('0x3')][_0x4873('0x32')](),'app':_0x4873('0x5'),'appdata':_0x4873('0x45'),'context':_0x3fd078[_0x4873('0x9')],'exten':_0x3fd078[_0x4873('0xa')],'priority':_0x500f6b[_0x4873('0x36')][_0x4873('0x22')]+_0x506701+_0x55f15e++,'VoiceExtensionId':_0x3fd078['id']});}}}}for(var _0x3d6617=0x0;_0x3d6617<_0x500f6b[_0x4873('0x36')]['length'];_0x3d6617++){var _0x3a3efc=_0x506701+_0x500f6b['intervals'][_0x4873('0x22')];var _0x370c10=_0x3d6617===_0x500f6b[_0x4873('0x36')][_0x4873('0x22')]-0x1?_0x506701+_0x577b57[_0x4873('0x22')]+_0x46102b[_0x4873('0x22')]+0x2:_0x506701+_0x3d6617+0x1;_0x577b57['splice'](_0x3d6617,0x0,{'type':_0x3fd078['type'],'app':_0x4873('0x46'),'appdata':_0x500f6b[_0x4873('0x36')][_0x3d6617]+'?'+_0x3fd078[_0x4873('0x9')]+',${EXTEN},'+_0x3a3efc+':'+_0x3fd078[_0x4873('0x9')]+_0x4873('0x47')+_0x370c10,'exten':_0x3fd078[_0x4873('0xa')],'context':_0x3fd078[_0x4873('0x9')],'priority':_0x506701+_0x3d6617,'VoiceExtensionId':_0x3fd078['id']});}if(_0x500f6b['appType']===_0x4873('0x48'))_0x500f6b[_0x4873('0x49')]=_0x735543(_0x3fd078,_0x500f6b['appdata']);_0x500f6b[_0x4873('0x4a')]=_0x577b57[_0x4873('0x22')]?_[_0x4873('0x4b')](_0x577b57)[_0x4873('0x4a')]+0x1:_0x506701;_0x414bab=_[_0x4873('0x4c')](_0x414bab,_0x577b57,[_0x500f6b],_0x46102b);_0x506701=_[_0x4873('0x4b')](_0x414bab)[_0x4873('0x4a')]+0x1;}return _0x351b46(_0x414bab);})[_0x4873('0x4d')](function(_0x31fc1f){_0x1a3eee(_0x31fc1f);});});}return _0x29ba53[_0x4873('0x4e')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x24981d){var _0x7a80ee=this['get']({'plain':!![]});var _0x2886ea=_0x7a80ee[_0x4873('0x3')]===_0x4873('0x10')?_0x471eb3(_0x7a80ee):_0x4eb8ad(_0x7a80ee);return _0x5bc9e8(_0x7a80ee,_0x24981d,_['last'](_0x2886ea)['priority']+0x1)['then'](function(_0x5906e0){var _0x3ba8f6=_['concat'](_0x2886ea,_0x5906e0);_0x3ba8f6[_0x4873('0x34')]({'type':_0x7a80ee[_0x4873('0x3')],'app':_0x4873('0x4f'),'exten':_0x7a80ee['exten'],'context':_0x7a80ee[_0x4873('0x9')],'priority':_[_0x4873('0x4b')](_0x3ba8f6)[_0x4873('0x4a')]+0x1,'VoiceExtensionId':_0x7a80ee['id']});return _0x3ba8f6;});}}});};
\ No newline at end of file
+var _0xe57d=['${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','voice_extensions','Hangup','lodash','exports','type','CDR(type)=','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','Set','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits'];(function(_0x25f5f7,_0x170bee){var _0xeb0d9c=function(_0x9c9688){while(--_0x9c9688){_0x25f5f7['push'](_0x25f5f7['shift']());}};_0xeb0d9c(++_0x170bee);}(_0xe57d,0xd7));var _0xde57=function(_0x1f5822,_0x50a5ab){_0x1f5822=_0x1f5822-0x0;var _0x124d1e=_0xe57d[_0x1f5822];return _0x124d1e;};'use strict';var _=require(_0xde57('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xde57('0x1')]=function(_0x2ee99f){var _0x5a3a93=_0x2ee99f['models'];function _0x2243bf(_0x2caa99){var _0x1e0509=0x2;var _0x4d001d=[{'type':_0x2caa99[_0xde57('0x2')],'app':'Set','appdata':_0xde57('0x3')+_0x2caa99[_0xde57('0x2')],'context':_0x2caa99[_0xde57('0x4')],'exten':_0x2caa99['exten'],'priority':_0x1e0509++,'VoiceExtensionId':_0x2caa99['id']},{'type':_0x2caa99['type'],'app':_0x2caa99[_0xde57('0x5')]?'Set':_0xde57('0x6'),'appdata':_0x2caa99[_0xde57('0x5')]?_0xde57('0x7')+_0x2caa99['alias']:_0xde57('0x8'),'context':_0x2caa99['context'],'exten':_0x2caa99[_0xde57('0x9')],'priority':_0x1e0509++,'VoiceExtensionId':_0x2caa99['id']}];if(_0x2caa99[_0xde57('0x2')]===_0xde57('0xa')){_0x4d001d[_0xde57('0xb')]({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x2caa99['id'],'context':_0x2caa99['context'],'exten':_0x2caa99['exten'],'priority':_0x1e0509++,'VoiceExtensionId':_0x2caa99['id']});}_0x4d001d[_0xde57('0xb')]({'type':_0x2caa99[_0xde57('0x2')],'app':_0xde57('0xc'),'appdata':_0xde57('0xd'),'context':_0x2caa99['context'],'exten':_0x2caa99[_0xde57('0x9')],'priority':_0x1e0509++,'VoiceExtensionId':_0x2caa99['id']},{'type':_0x2caa99[_0xde57('0x2')],'app':_0xde57('0xc'),'appdata':_0xde57('0xe'),'context':_0x2caa99[_0xde57('0x4')],'exten':_0x2caa99['exten'],'priority':_0x1e0509++,'VoiceExtensionId':_0x2caa99['id']},{'type':_0x2caa99[_0xde57('0x2')],'app':_0xde57('0xc'),'appdata':_0xde57('0xf'),'context':_0x2caa99[_0xde57('0x4')],'exten':_0x2caa99['exten'],'priority':_0x1e0509++,'VoiceExtensionId':_0x2caa99['id']});return _0x4d001d;}function _0x2b9098(_0x4566e0){var _0x108751=0x2;var _0x4b785d=[{'type':'outbound','app':_0xde57('0xc'),'appdata':'CDR(type)=outbound','context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':_0xde57('0x10'),'app':_0x4566e0[_0xde57('0x5')]?_0xde57('0xc'):_0xde57('0x6'),'appdata':_0x4566e0['alias']?_0xde57('0x7')+_0x4566e0[_0xde57('0x5')]:_0xde57('0x8'),'context':_0x4566e0['context'],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':'outbound','app':_0xde57('0xc'),'appdata':_0xde57('0x11')+(_0x4566e0[_0xde57('0x12')]?_0xde57('0x13')+_0x4566e0[_0xde57('0x12')]+'}':_0xde57('0x14')),'context':_0x4566e0['context'],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':'outbound','app':'Set','appdata':'CDR(routeid)='+_0x4566e0['id'],'context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':_0xde57('0x10'),'app':_0xde57('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x108751+0x2)+_0xde57('0x16')+(_0x108751+0x1)+')','context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':'outbound','app':_0xde57('0xc'),'appdata':_0x4566e0['cutdigits']?_0xde57('0x17')+_0x4566e0[_0xde57('0x12')]+'}':_0xde57('0x18'),'context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':_0xde57('0x10'),'app':_0xde57('0xc'),'appdata':_0xde57('0xd'),'context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':_0xde57('0x10'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':_0xde57('0x10'),'app':_0xde57('0xc'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':_0xde57('0x10'),'app':_0xde57('0xc'),'appdata':'outboundrouteid='+_0x4566e0['id'],'context':_0x4566e0['context'],'exten':_0x4566e0['exten'],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']}];if(_0x4566e0[_0xde57('0x19')](_0xde57('0x1a'))&&_0x4566e0[_0xde57('0x1a')]!==_0xde57('0x1b')){_0x4b785d[_0xde57('0xb')]({'type':_0xde57('0x10'),'app':_0xde57('0xc'),'appdata':_0xde57('0x1c'),'context':_0x4566e0['context'],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']},{'type':'outbound','app':_0xde57('0xc'),'appdata':_0xde57('0x1d')+_0x4566e0[_0xde57('0x1a')]||_0xde57('0x1e'),'context':_0x4566e0[_0xde57('0x4')],'exten':_0x4566e0[_0xde57('0x9')],'priority':_0x108751++,'VoiceExtensionId':_0x4566e0['id']});}return _0x4b785d;}function _0x3491be(_0x4053fa,_0xe35b09){var _0x50007b=[{'name':_0xde57('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xde57('0x20'),'param':0x2},{'name':_0xde57('0x21'),'param':0x3}];var _0x2e1b83={};var _0x53c8ef=_0xe35b09[_0xde57('0x22')](',');var _0x1bcd04=[];for(var _0x218fe4=0x0;_0x218fe4<_0x50007b[_0xde57('0x23')];_0x218fe4++){switch(_0x50007b[_0x218fe4][_0xde57('0x24')]){case _0xde57('0x1f'):_0x2e1b83['trunk']=_0x53c8ef[_0x50007b[_0x218fe4][_0xde57('0x25')]][_0xde57('0x22')]('/')[0x1];_0x2e1b83[_0xde57('0x26')]=_0x53c8ef[_0x50007b[_0x218fe4][_0xde57('0x25')]]['split']('/')[0x2];_0x2e1b83['prefix']=_0x2e1b83[_0xde57('0x26')]?_0x2e1b83[_0xde57('0x26')][_0xde57('0x22')]('$')[0x0]:undefined;_0x2e1b83[_0xde57('0x26')]=_0x4053fa['cutdigits']?(_0x2e1b83[_0xde57('0x27')]||'')+_0xde57('0x13')+_0x4053fa[_0xde57('0x12')]+'}':(_0x2e1b83[_0xde57('0x27')]||'')+_0xde57('0x14');_0x1bcd04[_0x50007b[_0x218fe4]['param']]=[_0xde57('0x28'),_0x2e1b83[_0xde57('0x1f')],_0x2e1b83[_0xde57('0x26')]][_0xde57('0x29')]('/');break;case _0xde57('0x20'):_0x2e1b83[_0xde57('0x20')]=_0x53c8ef[_0x50007b[_0x218fe4][_0xde57('0x25')]];if(_0x4053fa[_0xde57('0x1a')]!==_0xde57('0x1b')){if(_0x2e1b83[_0xde57('0x20')]['indexOf'](_0xde57('0x2a'))<0x0){_0x2e1b83['options']+='U(xcally-mixmonitor-context)';}}else{_0x2e1b83[_0xde57('0x20')]=_0x2e1b83[_0xde57('0x20')][_0xde57('0x2b')]('U(xcally-mixmonitor-context)','');}_0x1bcd04[_0x50007b[_0x218fe4][_0xde57('0x25')]]=_0x2e1b83[_0xde57('0x20')];break;default:_0x1bcd04[_0x50007b[_0x218fe4]['param']]=_0x53c8ef[_0x50007b[_0x218fe4][_0xde57('0x25')]];}}return _0x1bcd04[_0xde57('0x29')](',');}function _0x171817(_0x2b3bb3,_0x19f8c2,_0x16fcce){return new Promise(function(_0x473660,_0x598260){var _0x5d8ec3=[];if(_[_0xde57('0x2c')](_0x19f8c2))return _0x473660(_0x5d8ec3);_0x5a3a93[_0xde57('0x2d')][_0xde57('0x2e')]({'attributes':['id',_0xde57('0x2f'),_0xde57('0x30')],'raw':!![]})[_0xde57('0x31')](function(_0x1dde71){for(var _0xeb373=0x0,_0x52728f=0x0;_0xeb373<_0x19f8c2['length'];_0xeb373++,_0x52728f=0x0){var _0x72c12f=_0x19f8c2[_0xeb373];var _0x30e225=[];var _0x27eb97=[];delete _0x72c12f['id'];if(_0x72c12f[_0xde57('0x2f')]!==_0xde57('0x32')){_0x72c12f[_0xde57('0x33')]=[_0x72c12f[_0xde57('0x2f')]];}else{_0x72c12f['intervals']=_0x72c12f[_0xde57('0x30')]?_[_0xde57('0x34')](_['filter'](_0x1dde71,{'IntervalId':_0x72c12f[_0xde57('0x30')]}),_0xde57('0x2f')):[];}_0x72c12f[_0xde57('0x4')]=_0x2b3bb3[_0xde57('0x4')];_0x72c12f['exten']=_0x2b3bb3[_0xde57('0x9')];if(_0x72c12f[_0xde57('0x2')])_0x72c12f['type']=_0x72c12f['type'][_0xde57('0x35')]();if(_0x2b3bb3[_0xde57('0x2')]==='outbound'){if(_0x72c12f[_0xde57('0x19')](_0xde57('0x36'))&&_0x72c12f['tag']&&_0x72c12f[_0xde57('0x36')]!=='--'){_0x30e225[_0xde57('0xb')]({'type':_0x72c12f[_0xde57('0x2')][_0xde57('0x35')](),'app':_0xde57('0xc'),'appdata':_0xde57('0x37')+_0x72c12f['tag'],'context':_0x2b3bb3['context'],'exten':_0x2b3bb3[_0xde57('0x9')],'priority':_0x72c12f[_0xde57('0x33')][_0xde57('0x23')]+_0x16fcce+_0x52728f++,'VoiceExtensionId':_0x2b3bb3['id']});}_0x30e225['push']({'type':_0x72c12f[_0xde57('0x2')][_0xde57('0x35')](),'app':_0xde57('0x15'),'appdata':_0xde57('0x38')+(_0x72c12f[_0xde57('0x39')]?'Set(CALLERID(all)='+_0x72c12f[_0xde57('0x39')]+')':_0xde57('0x3a')),'context':_0x2b3bb3[_0xde57('0x4')],'exten':_0x2b3bb3[_0xde57('0x9')],'priority':_0x72c12f[_0xde57('0x33')][_0xde57('0x23')]+_0x16fcce+_0x52728f++,'VoiceExtensionId':_0x2b3bb3['id']});}else{if(_0x72c12f[_0xde57('0x19')](_0xde57('0x3b'))){if([_0xde57('0x3c'),'playback']['includes'](_0x72c12f[_0xde57('0x3d')][_0xde57('0x35')]())&&_0x72c12f[_0xde57('0x3e')]!==_0xde57('0x3f')){if(_0x72c12f[_0xde57('0x3b')]){_0x30e225[_0xde57('0xb')]({'type':_0x72c12f[_0xde57('0x2')][_0xde57('0x35')](),'app':'ExecIf','appdata':_0xde57('0x40'),'context':_0x2b3bb3[_0xde57('0x4')],'exten':_0x2b3bb3[_0xde57('0x9')],'priority':_0x72c12f[_0xde57('0x33')][_0xde57('0x23')]+_0x16fcce+_0x52728f++,'VoiceExtensionId':_0x2b3bb3['id']});_0x30e225[_0xde57('0xb')]({'type':_0x72c12f[_0xde57('0x2')][_0xde57('0x35')](),'app':_0xde57('0xc'),'appdata':_0xde57('0x41'),'context':_0x2b3bb3[_0xde57('0x4')],'exten':_0x2b3bb3[_0xde57('0x9')],'priority':_0x72c12f[_0xde57('0x33')][_0xde57('0x23')]+_0x16fcce+_0x52728f++,'VoiceExtensionId':_0x2b3bb3['id']});}else{_0x30e225[_0xde57('0xb')]({'type':_0x72c12f['type']['toLowerCase'](),'app':_0xde57('0x15'),'appdata':_0xde57('0x42'),'context':_0x2b3bb3[_0xde57('0x4')],'exten':_0x2b3bb3[_0xde57('0x9')],'priority':_0x72c12f[_0xde57('0x33')][_0xde57('0x23')]+_0x16fcce+_0x52728f++,'VoiceExtensionId':_0x2b3bb3['id']});_0x30e225['push']({'type':_0x72c12f['type'][_0xde57('0x35')](),'app':_0xde57('0xc'),'appdata':_0xde57('0x43'),'context':_0x2b3bb3[_0xde57('0x4')],'exten':_0x2b3bb3['exten'],'priority':_0x72c12f[_0xde57('0x33')][_0xde57('0x23')]+_0x16fcce+_0x52728f++,'VoiceExtensionId':_0x2b3bb3['id']});}}}}for(var _0x40b72c=0x0;_0x40b72c<_0x72c12f[_0xde57('0x33')][_0xde57('0x23')];_0x40b72c++){var _0x3ef276=_0x16fcce+_0x72c12f[_0xde57('0x33')]['length'];var _0x24ed72=_0x40b72c===_0x72c12f[_0xde57('0x33')]['length']-0x1?_0x16fcce+_0x30e225[_0xde57('0x23')]+_0x27eb97['length']+0x2:_0x16fcce+_0x40b72c+0x1;_0x30e225['splice'](_0x40b72c,0x0,{'type':_0x2b3bb3[_0xde57('0x2')],'app':_0xde57('0x44'),'appdata':_0x72c12f[_0xde57('0x33')][_0x40b72c]+'?'+_0x2b3bb3[_0xde57('0x4')]+',${EXTEN},'+_0x3ef276+':'+_0x2b3bb3[_0xde57('0x4')]+_0xde57('0x45')+_0x24ed72,'exten':_0x2b3bb3[_0xde57('0x9')],'context':_0x2b3bb3[_0xde57('0x4')],'priority':_0x16fcce+_0x40b72c,'VoiceExtensionId':_0x2b3bb3['id']});}if(_0x72c12f['appType']===_0xde57('0x46'))_0x72c12f[_0xde57('0x47')]=_0x3491be(_0x2b3bb3,_0x72c12f[_0xde57('0x47')]);_0x72c12f[_0xde57('0x48')]=_0x30e225[_0xde57('0x23')]?_[_0xde57('0x49')](_0x30e225)['priority']+0x1:_0x16fcce;_0x5d8ec3=_[_0xde57('0x4a')](_0x5d8ec3,_0x30e225,[_0x72c12f],_0x27eb97);_0x16fcce=_['last'](_0x5d8ec3)[_0xde57('0x48')]+0x1;}return _0x473660(_0x5d8ec3);})['catch'](function(_0xc33575){_0x598260(_0xc33575);});});}return _0x2ee99f[_0xde57('0x4b')]('VoiceExtension',attributes,{'tableName':_0xde57('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x32368b){var _0x138d87=this['get']({'plain':!![]});var _0x249e7c=_0x138d87[_0xde57('0x2')]===_0xde57('0x10')?_0x2b9098(_0x138d87):_0x2243bf(_0x138d87);return _0x171817(_0x138d87,_0x32368b,_['last'](_0x249e7c)[_0xde57('0x48')]+0x1)[_0xde57('0x31')](function(_0x563873){var _0x3521e6=_[_0xde57('0x4a')](_0x249e7c,_0x563873);_0x3521e6['push']({'type':_0x138d87[_0xde57('0x2')],'app':_0xde57('0x4d'),'exten':_0x138d87[_0xde57('0x9')],'context':_0x138d87[_0xde57('0x4')],'priority':_[_0xde57('0x49')](_0x3521e6)[_0xde57('0x48')]+0x1,'VoiceExtensionId':_0x138d87['id']});return _0x3521e6;});}}});};
\ No newline at end of file
index 6750fad..b3a6cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c42=['../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x62721b,_0x1e8956){var _0x39a359=function(_0x5ab077){while(--_0x5ab077){_0x62721b['push'](_0x62721b['shift']());}};_0x39a359(++_0x1e8956);}(_0x0c42,0x191));var _0x20c4=function(_0x56edea,_0x3ffb09){_0x56edea=_0x56edea-0x0;var _0x35c9cd=_0x0c42[_0x56edea];return _0x35c9cd;};'use strict';var _=require(_0x20c4('0x0'));var util=require(_0x20c4('0x1'));var moment=require(_0x20c4('0x2'));var BPromise=require(_0x20c4('0x3'));var rs=require(_0x20c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x20c4('0x5'));var logger=require(_0x20c4('0x6'))(_0x20c4('0x7'));var config=require(_0x20c4('0x8'));var jayson=require(_0x20c4('0x9'));var client=jayson['client'][_0x20c4('0xa')]({'port':0x232a});config['redis']=_[_0x20c4('0xb')](config['redis'],{'host':_0x20c4('0xc'),'port':0x18eb});var socket=require(_0x20c4('0xd'))(new Redis(config[_0x20c4('0xe')]));require('./voiceExtension.socket')[_0x20c4('0xf')](socket);function respondWithRpcPromise(_0x219b9f,_0x94a2e8,_0xf3917){return new BPromise(function(_0xdc42c3,_0x312ee0){return client[_0x20c4('0x10')](_0x219b9f,_0xf3917)[_0x20c4('0x11')](function(_0x4ae2fd){logger[_0x20c4('0x12')](_0x20c4('0x13'),_0x94a2e8,_0x20c4('0x14'));logger[_0x20c4('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x94a2e8,_0x20c4('0x14'),JSON['stringify'](_0x4ae2fd));if(_0x4ae2fd[_0x20c4('0x16')]){if(_0x4ae2fd[_0x20c4('0x16')]['code']===0x1f4){logger[_0x20c4('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x94a2e8,_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);return _0x312ee0(_0x4ae2fd[_0x20c4('0x16')]['message']);}logger[_0x20c4('0x16')](_0x20c4('0x13'),_0x94a2e8,_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);return _0xdc42c3(_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);}else{logger[_0x20c4('0x12')](_0x20c4('0x13'),_0x94a2e8,_0x20c4('0x14'));_0xdc42c3(_0x4ae2fd[_0x20c4('0x18')][_0x20c4('0x17')]);}})['catch'](function(_0x513dc7){logger[_0x20c4('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x94a2e8,_0x513dc7);_0x312ee0(_0x513dc7);});});}exports[_0x20c4('0x19')]=function(_0x2c1892){var _0x805816=this;return new Promise(function(_0x294c37,_0x28ba0a){return db[_0x20c4('0x1a')][_0x20c4('0x1b')]({'raw':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1e')]||null:null,'attributes':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1f')]||null:null,'limit':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x20')]||null:null,'include':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x21')]?_[_0x20c4('0x22')](_0x2c1892[_0x20c4('0x1c')]['include'],function(_0x5efa2b){return{'model':db[_0x5efa2b[_0x20c4('0x23')]],'as':_0x5efa2b['as'],'attributes':_0x5efa2b[_0x20c4('0x1f')],'include':_0x5efa2b['include']?_[_0x20c4('0x22')](_0x5efa2b[_0x20c4('0x21')],function(_0x5bc23a){return{'model':db[_0x5bc23a[_0x20c4('0x23')]],'as':_0x5bc23a['as'],'attributes':_0x5bc23a[_0x20c4('0x1f')],'include':_0x5bc23a['include']?_[_0x20c4('0x22')](_0x5bc23a['include'],function(_0x19907c){return{'model':db[_0x19907c['model']],'as':_0x19907c['as'],'attributes':_0x19907c[_0x20c4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x20c4('0x11')](function(_0x26a63e){logger[_0x20c4('0x12')](_0x20c4('0x19'),_0x2c1892);logger[_0x20c4('0x15')]('GetVoiceExtension',_0x2c1892,JSON['stringify'](_0x26a63e));_0x294c37(_0x26a63e);})[_0x20c4('0x24')](function(_0x1673ff){logger[_0x20c4('0x16')](_0x20c4('0x19'),_0x1673ff[_0x20c4('0x17')],_0x2c1892);_0x28ba0a(_0x805816['error'](0x1f4,_0x1673ff[_0x20c4('0x17')]));});});};
\ No newline at end of file
+var _0x9973=['VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','include','model','map','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./voiceExtension.socket','register','request','then','info'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0x9973,0x157));var _0x3997=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9973[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x3997('0x0'));var moment=require(_0x3997('0x1'));var BPromise=require('bluebird');var rs=require(_0x3997('0x2'));var fs=require('fs');var Redis=require(_0x3997('0x3'));var db=require(_0x3997('0x4'))['db'];var utils=require(_0x3997('0x5'));var logger=require(_0x3997('0x6'))(_0x3997('0x7'));var config=require(_0x3997('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3997('0x9')]({'port':0x232a});config[_0x3997('0xa')]=_[_0x3997('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3997('0xa')]));require(_0x3997('0xc'))[_0x3997('0xd')](socket);function respondWithRpcPromise(_0xaa5f42,_0x96da4b,_0x2290df){return new BPromise(function(_0x6ec837,_0x1d166e){return client[_0x3997('0xe')](_0xaa5f42,_0x2290df)[_0x3997('0xf')](function(_0x140b13){logger[_0x3997('0x10')](_0x3997('0x11'),_0x96da4b,_0x3997('0x12'));logger[_0x3997('0x13')](_0x3997('0x14'),_0x96da4b,_0x3997('0x12'),JSON[_0x3997('0x15')](_0x140b13));if(_0x140b13[_0x3997('0x16')]){if(_0x140b13[_0x3997('0x16')][_0x3997('0x17')]===0x1f4){logger[_0x3997('0x16')](_0x3997('0x11'),_0x96da4b,_0x140b13['error'][_0x3997('0x18')]);return _0x1d166e(_0x140b13[_0x3997('0x16')][_0x3997('0x18')]);}logger[_0x3997('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x96da4b,_0x140b13[_0x3997('0x16')][_0x3997('0x18')]);return _0x6ec837(_0x140b13['error']['message']);}else{logger[_0x3997('0x10')](_0x3997('0x11'),_0x96da4b,'request\x20sent');_0x6ec837(_0x140b13[_0x3997('0x19')][_0x3997('0x18')]);}})[_0x3997('0x1a')](function(_0x122130){logger[_0x3997('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x96da4b,_0x122130);_0x1d166e(_0x122130);});});}exports[_0x3997('0x1b')]=function(_0x3631ef){var _0x16cb82=this;return new Promise(function(_0x541832,_0x20caab){return db[_0x3997('0x1c')]['findAll']({'raw':_0x3631ef[_0x3997('0x1d')]?_0x3631ef[_0x3997('0x1d')][_0x3997('0x1e')]===undefined?!![]:![]:!![],'where':_0x3631ef['options']?_0x3631ef['options'][_0x3997('0x1f')]||null:null,'attributes':_0x3631ef[_0x3997('0x1d')]?_0x3631ef[_0x3997('0x1d')][_0x3997('0x20')]||null:null,'limit':_0x3631ef['options']?_0x3631ef[_0x3997('0x1d')]['limit']||null:null,'include':_0x3631ef['options']?_0x3631ef[_0x3997('0x1d')][_0x3997('0x21')]?_['map'](_0x3631ef['options'][_0x3997('0x21')],function(_0xe3e7b6){return{'model':db[_0xe3e7b6[_0x3997('0x22')]],'as':_0xe3e7b6['as'],'attributes':_0xe3e7b6['attributes'],'include':_0xe3e7b6['include']?_['map'](_0xe3e7b6[_0x3997('0x21')],function(_0x124022){return{'model':db[_0x124022[_0x3997('0x22')]],'as':_0x124022['as'],'attributes':_0x124022[_0x3997('0x20')],'include':_0x124022[_0x3997('0x21')]?_[_0x3997('0x23')](_0x124022['include'],function(_0x5ad688){return{'model':db[_0x5ad688[_0x3997('0x22')]],'as':_0x5ad688['as'],'attributes':_0x5ad688[_0x3997('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cec57){logger[_0x3997('0x10')](_0x3997('0x1b'),_0x3631ef);logger[_0x3997('0x13')](_0x3997('0x1b'),_0x3631ef,JSON[_0x3997('0x15')](_0x2cec57));_0x541832(_0x2cec57);})['catch'](function(_0x24fdf2){logger[_0x3997('0x16')](_0x3997('0x1b'),_0x24fdf2[_0x3997('0x18')],_0x3631ef);_0x20caab(_0x16cb82[_0x3997('0x16')](0x1f4,_0x24fdf2['message']));});});};
\ No newline at end of file
index e7db11b..81b48d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x3cbf90,_0x2f1b42){var _0x1102f0=function(_0x5c75f5){while(--_0x5c75f5){_0x3cbf90['push'](_0x3cbf90['shift']());}};_0x1102f0(++_0x2f1b42);}(_0x0295,0x1f0));var _0x5029=function(_0x32ad2d,_0x188218){_0x32ad2d=_0x32ad2d-0x0;var _0x2e5aa2=_0x0295[_0x32ad2d];return _0x2e5aa2;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}};
\ No newline at end of file
+var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x483d4a,_0x191733){var _0x224bda=function(_0x1b6b5f){while(--_0x1b6b5f){_0x483d4a['push'](_0x483d4a['shift']());}};_0x224bda(++_0x191733);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x5fc3[_0x4c1ec2];return _0x3f6f1c;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}};
\ No newline at end of file
index 95a11d3..7956dca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a5a=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','getMessages'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9a5a,0x194));var _0xa9a5=function(_0x311817,_0x2b7bcc){_0x311817=_0x311817-0x0;var _0x5ad7d2=_0x9a5a[_0x311817];return _0x5ad7d2;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')]('/',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0x12')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller['update']);router['delete']('/:id',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x13')]);module[_0xa9a5('0x14')]=router;
\ No newline at end of file
+var _0x9fd4=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9fd4,0x16c));var _0x49fd=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0x9fd4[_0x452968];return _0xb6f9ae;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/:id',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['getMessages']);router[_0x49fd('0xe')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x12')]);router['delete'](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x13')]);module[_0x49fd('0x14')]=router;
\ No newline at end of file
index e627bbb..9638575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f6e=['ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central'];(function(_0x37ab74,_0x147b3d){var _0x3f0167=function(_0x146b75){while(--_0x146b75){_0x37ab74['push'](_0x37ab74['shift']());}};_0x3f0167(++_0x147b3d);}(_0x5f6e,0x1b7));var _0xe5f6=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0x5f6e[_0x164760];return _0x8b91b2;};'use strict';var Sequelize=require(_0xe5f6('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xe5f6('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xe5f6('0x2'),'unique':_0xe5f6('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xe5f6('0x1')]},'fullname':{'type':Sequelize[_0xe5f6('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x57b19a){this[_0xe5f6('0x4')](_0xe5f6('0x5'),typeof _0x57b19a===_0xe5f6('0x6')&&_0x57b19a['trim']()?_0x57b19a[_0xe5f6('0x7')]():null);}},'pager':{'type':Sequelize[_0xe5f6('0x1')]},'tz':{'type':Sequelize[_0xe5f6('0x1')],'defaultValue':_0xe5f6('0x8')},'attach':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':_0xe5f6('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':_0xe5f6('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xe5f6('0x1')]},'review':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe5f6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':_0xe5f6('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xe5f6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe5f6('0x9')](_0xe5f6('0xa'),'no'),'defaultValue':_0xe5f6('0xa'),'allowNull':![]},'stamp':{'type':_0xe5f6('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xe5f6('0x1')]},'maxsecs':{'type':Sequelize[_0xe5f6('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe5f6('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe5f6('0xd')],'get':function(){return this[_0xe5f6('0xe')](_0xe5f6('0xf'))+'\x20-\x20'+this[_0xe5f6('0xe')]('mailbox');}}};
\ No newline at end of file
+var _0xd881=['getDataValue','\x20-\x20','mailbox','STRING','contest_mailbox','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER'];(function(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0xd881,0x114));var _0x1d88=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd881[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x1d88('0x0')]},'context':{'type':Sequelize[_0x1d88('0x0')],'defaultValue':'from-voicemail','unique':_0x1d88('0x1')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x1d88('0x1')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x1d88('0x0')]},'email':{'type':Sequelize[_0x1d88('0x0')],'validate':{'isEmail':!![]},'set':function(_0x4de746){this['setDataValue'](_0x1d88('0x2'),typeof _0x4de746===_0x1d88('0x3')&&_0x4de746[_0x1d88('0x4')]()?_0x4de746[_0x1d88('0x4')]():null);}},'pager':{'type':Sequelize[_0x1d88('0x0')]},'tz':{'type':Sequelize[_0x1d88('0x0')],'defaultValue':_0x1d88('0x5')},'attach':{'type':Sequelize['ENUM'](_0x1d88('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x1d88('0x6'),'no'),'defaultValue':_0x1d88('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0x1d88('0x0')]},'callback':{'type':Sequelize[_0x1d88('0x0')]},'review':{'type':Sequelize[_0x1d88('0x7')](_0x1d88('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1d88('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1d88('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1d88('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1d88('0x7')](_0x1d88('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1d88('0x7')](_0x1d88('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1d88('0x7')](_0x1d88('0x6'),'no'),'defaultValue':_0x1d88('0x6'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1d88('0x7')](_0x1d88('0x6'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x1d88('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1d88('0x7')](_0x1d88('0x6'),'no'),'defaultValue':_0x1d88('0x6'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x1d88('0x0')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x1d88('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1d88('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1d88('0xa')]('fullname')+_0x1d88('0xb')+this[_0x1d88('0xa')](_0x1d88('0xc'));}}};
\ No newline at end of file
index f53da1c..e08bcb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','VoiceMail','include','findAll','rows','catch','includeAll','create','body','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce'];(function(_0xb17861,_0x3ee37e){var _0x3de1f4=function(_0x4a4ffb){while(--_0x4a4ffb){_0xb17861['push'](_0xb17861['shift']());}};_0x3de1f4(++_0x3ee37e);}(_0xac4a,0x13f));var _0xaac4=function(_0x24d421,_0x5afcea){_0x24d421=_0x24d421-0x0;var _0x23e246=_0xac4a[_0x24d421];return _0x23e246;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){var _0xb2577b=_0x4f10ec['get']({'plain':!![]});var _0x24186b='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x24186b,'resourceId':_0xb2577b['id']}})['then'](function(){return _0x4f10ec;});})[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)[_0xaac4('0x24')]();});}};}function handleEntityNotFound(_0xe93120,_0x3c1445){return function(_0x249a5d){if(!_0x249a5d){_0xe93120[_0xaac4('0x15')](0x194);}return _0x249a5d;};}function handleError(_0x2d68b6,_0x2f36ad){_0x2f36ad=_0x2f36ad||0x1f4;return function(_0x386c9b){logger['error'](_0x386c9b[_0xaac4('0x25')]);if(_0x386c9b[_0xaac4('0x26')]){delete _0x386c9b[_0xaac4('0x26')];}_0x2d68b6[_0xaac4('0x16')](_0x2f36ad)[_0xaac4('0x27')](_0x386c9b);};}exports[_0xaac4('0x28')]=function(_0x5e469a,_0xcf6c1){var _0x5d2c9a={},_0x2df7e3={},_0xab5d04={'count':0x0,'rows':[]};var _0x182343=_[_0xaac4('0x29')](db['VoiceMail']['rawAttributes'],function(_0x58f748){return{'name':_0x58f748[_0xaac4('0x2a')],'type':_0x58f748[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x2df7e3[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0x182343,_0xaac4('0x26'));_0x2df7e3[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x5e469a[_0xaac4('0x2e')]);_0x2df7e3[_0xaac4('0x30')]=_[_0xaac4('0x31')](_0x2df7e3[_0xaac4('0x2d')],_0x2df7e3[_0xaac4('0x2e')]);_0x5d2c9a[_0xaac4('0x32')]=_[_0xaac4('0x31')](_0x2df7e3['model'],qs['fields'](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x5d2c9a[_0xaac4('0x32')]=_0x5d2c9a['attributes'][_0xaac4('0x34')]?_0x5d2c9a[_0xaac4('0x32')]:_0x2df7e3[_0xaac4('0x2d')];if(!_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x35')](_0xaac4('0x36'))){_0x5d2c9a[_0xaac4('0x1a')]=qs['limit'](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x5d2c9a[_0xaac4('0x18')]=qs['offset'](_0x5e469a[_0xaac4('0x2e')]['offset']);}_0x5d2c9a['order']=qs[_0xaac4('0x37')](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x5d2c9a['where']=qs['filters'](_[_0xaac4('0x38')](_0x5e469a[_0xaac4('0x2e')],_0x2df7e3[_0xaac4('0x30')]),_0x182343);if(_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x39')]){_0x5d2c9a[_0xaac4('0x3a')]=_['merge'](_0x5d2c9a['where'],{'$or':_[_0xaac4('0x29')](_0x182343,function(_0x3b2b72){if(_0x3b2b72['type']!==_0xaac4('0x3b')){var _0xdea3a0={};_0xdea3a0[_0x3b2b72[_0xaac4('0x26')]]={'$like':'%'+_0x5e469a['query'][_0xaac4('0x39')]+'%'};return _0xdea3a0;}})});}_0x5d2c9a=_[_0xaac4('0x3c')]({},_0x5d2c9a,_0x5e469a[_0xaac4('0x3d')]);var _0x5bc387={'where':_0x5d2c9a[_0xaac4('0x3a')]};return db[_0xaac4('0x3e')][_0xaac4('0x1b')](_0x5bc387)[_0xaac4('0x23')](function(_0x51e59d){_0xab5d04[_0xaac4('0x1b')]=_0x51e59d;if(_0x5e469a['query']['includeAll']){_0x5d2c9a[_0xaac4('0x3f')]=[{'all':!![]}];}return db[_0xaac4('0x3e')][_0xaac4('0x40')](_0x5d2c9a);})[_0xaac4('0x23')](function(_0x43bc12){_0xab5d04[_0xaac4('0x41')]=_0x43bc12;return _0xab5d04;})[_0xaac4('0x23')](respondWithFilteredResult(_0xcf6c1,_0x5d2c9a))[_0xaac4('0x42')](handleError(_0xcf6c1,null));};exports['show']=function(_0x15191a,_0x36ac31){var _0x1fea3d={'raw':!![],'where':{'id':_0x15191a['params']['id']}},_0x2bba0c={};_0x2bba0c[_0xaac4('0x2d')]=_[_0xaac4('0x2f')](db[_0xaac4('0x3e')]['rawAttributes']);_0x2bba0c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x15191a[_0xaac4('0x2e')]);_0x2bba0c[_0xaac4('0x30')]=_['intersection'](_0x2bba0c[_0xaac4('0x2d')],_0x2bba0c[_0xaac4('0x2e')]);_0x1fea3d[_0xaac4('0x32')]=_['intersection'](_0x2bba0c[_0xaac4('0x2d')],qs[_0xaac4('0x33')](_0x15191a[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x1fea3d[_0xaac4('0x32')]=_0x1fea3d[_0xaac4('0x32')][_0xaac4('0x34')]?_0x1fea3d[_0xaac4('0x32')]:_0x2bba0c[_0xaac4('0x2d')];if(_0x15191a['query'][_0xaac4('0x43')]){_0x1fea3d[_0xaac4('0x3f')]=[{'all':!![]}];}_0x1fea3d=_[_0xaac4('0x3c')]({},_0x1fea3d,_0x15191a[_0xaac4('0x3d')]);return db[_0xaac4('0x3e')]['find'](_0x1fea3d)['then'](handleEntityNotFound(_0x36ac31,null))[_0xaac4('0x23')](respondWithResult(_0x36ac31,null))[_0xaac4('0x42')](handleError(_0x36ac31,null));};exports[_0xaac4('0x44')]=function(_0x16c7f4,_0x5f33ea){return db[_0xaac4('0x3e')]['create'](_0x16c7f4[_0xaac4('0x45')],{})[_0xaac4('0x23')](function(_0x487203){var _0x282de3=_0x16c7f4[_0xaac4('0x46')][_0xaac4('0x47')]({'plain':!![]});if(!_0x282de3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x282de3['role']===_0xaac4('0x46')){var _0x2c1751=_0x487203[_0xaac4('0x47')]({'plain':!![]});var _0xb32d1d=_0xaac4('0x48');return db[_0xaac4('0x49')]['find']({'where':{'name':_0xb32d1d,'userProfileId':_0x282de3[_0xaac4('0x4a')]},'raw':!![]})[_0xaac4('0x23')](function(_0x1c9979){if(_0x1c9979&&_0x1c9979[_0xaac4('0x4b')]===0x0){return db['UserProfileResource'][_0xaac4('0x44')]({'name':_0x2c1751['name'],'resourceId':_0x2c1751['id'],'type':_0x1c9979[_0xaac4('0x26')],'sectionId':_0x1c9979['id']},{})[_0xaac4('0x23')](function(){return _0x487203;});}else{return _0x487203;}})[_0xaac4('0x42')](function(_0x3922a0){logger[_0xaac4('0x4c')](_0xaac4('0x4d'),_0x3922a0);throw _0x3922a0;});}return _0x487203;})[_0xaac4('0x23')](respondWithResult(_0x5f33ea,0xc9))[_0xaac4('0x42')](handleError(_0x5f33ea,null));};exports[_0xaac4('0x21')]=function(_0x1b9219,_0x1a637e){if(_0x1b9219[_0xaac4('0x45')]['id']){delete _0x1b9219[_0xaac4('0x45')]['id'];}return db[_0xaac4('0x3e')]['find']({'where':{'id':_0x1b9219[_0xaac4('0x4e')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x1a637e,null))[_0xaac4('0x23')](saveUpdates(_0x1b9219[_0xaac4('0x45')],null))[_0xaac4('0x23')](respondWithResult(_0x1a637e,null))[_0xaac4('0x42')](handleError(_0x1a637e,null));};exports[_0xaac4('0x22')]=function(_0x46082d,_0x5e8928){return db[_0xaac4('0x3e')]['find']({'where':{'id':_0x46082d[_0xaac4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e8928,null))[_0xaac4('0x23')](removeEntity(_0x5e8928,null))['catch'](handleError(_0x5e8928,null));};exports['getMessages']=function(_0x19764c,_0x3a4e29,_0x48ae39){return db[_0xaac4('0x3e')][_0xaac4('0x4f')]({'where':{'id':_0x19764c[_0xaac4('0x4e')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x3a4e29,null))[_0xaac4('0x23')](function(_0x19d9c1){var _0x5d38bc;var _0x346f4c={},_0x586a10={};_0x586a10[_0xaac4('0x2d')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x586a10[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x19764c[_0xaac4('0x2e')]);_0x586a10[_0xaac4('0x30')]=_['intersection'](_0x586a10[_0xaac4('0x2d')],_0x586a10[_0xaac4('0x2e')]);_0x346f4c[_0xaac4('0x32')]=_['intersection'](_0x586a10[_0xaac4('0x2d')],qs[_0xaac4('0x33')](_0x19764c[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x346f4c[_0xaac4('0x32')]=_0x346f4c[_0xaac4('0x32')][_0xaac4('0x34')]?_0x346f4c['attributes']:_0x586a10['model'];if(!_0x19764c[_0xaac4('0x2e')]['hasOwnProperty']('nolimit')){_0x346f4c[_0xaac4('0x1a')]=qs['limit'](_0x19764c[_0xaac4('0x2e')]['limit']);_0x346f4c[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x19764c['query']['offset']);}_0x346f4c['order']=qs['sort'](_0x19764c[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x346f4c[_0xaac4('0x3a')]=qs[_0xaac4('0x30')](_['pick'](_0x19764c[_0xaac4('0x2e')],_0x586a10[_0xaac4('0x30')]));if(_0x19764c[_0xaac4('0x2e')][_0xaac4('0x39')]){_0x346f4c[_0xaac4('0x3a')]=_[_0xaac4('0x3c')](_0x346f4c[_0xaac4('0x3a')],{'$or':_[_0xaac4('0x29')](_0x346f4c[_0xaac4('0x32')],function(_0x40271c){var _0x43aeee={};_0x43aeee[_0x40271c]={'$like':'%'+_0x19764c['query']['filter']+'%'};return _0x43aeee;})});}_0x346f4c[_0xaac4('0x3a')]=_['merge'](_0x346f4c['where'],{'mailboxuser':_0x19d9c1[_0xaac4('0x50')]});_0x346f4c=_['merge']({},_0x346f4c,_0x19764c[_0xaac4('0x3d')]);return db[_0xaac4('0x51')][_0xaac4('0x52')](_0x346f4c)[_0xaac4('0x23')](respondWithFilteredResult(_0x3a4e29,_0x346f4c));})['catch'](handleError(_0x3a4e29,null));};
\ No newline at end of file
+var _0x878f=['reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','name','send','map','VoiceMail','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','VoiceMailMessage','hasOwnProperty','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json'];(function(_0x15db95,_0x754d5f){var _0xe3f94e=function(_0x39b261){while(--_0x39b261){_0x15db95['push'](_0x15db95['shift']());}};_0xe3f94e(++_0x754d5f);}(_0x878f,0x173));var _0xf878=function(_0xa35dfe,_0xce821c){_0xa35dfe=_0xa35dfe-0x0;var _0x37abd4=_0x878f[_0xa35dfe];return _0x37abd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];function respondWithStatusCode(_0x339c9c,_0x596fb5){_0x596fb5=_0x596fb5||0xcc;return function(_0x1ce004){if(_0x1ce004){return _0x339c9c[_0xf878('0x15')](_0x596fb5);}return _0x339c9c[_0xf878('0x16')](_0x596fb5)['end']();};}function respondWithResult(_0xe2c2de,_0x3902f7){_0x3902f7=_0x3902f7||0xc8;return function(_0x119e9e){if(_0x119e9e){return _0xe2c2de['status'](_0x3902f7)['json'](_0x119e9e);}};}function respondWithFilteredResult(_0x4c0948,_0x35ff2d){return function(_0x31d888){if(_0x31d888){var _0x6dbeca=typeof _0x35ff2d[_0xf878('0x17')]===_0xf878('0x18')&&typeof _0x35ff2d[_0xf878('0x19')]===_0xf878('0x18');var _0x3c5dee=_0x31d888[_0xf878('0x1a')];var _0x3b2e1b=_0x6dbeca?0x0:_0x35ff2d['offset'];var _0x2b2b54=_0x6dbeca?_0x31d888[_0xf878('0x1a')]:_0x35ff2d[_0xf878('0x17')]+_0x35ff2d[_0xf878('0x19')];var _0x3714f6;if(_0x2b2b54>=_0x3c5dee){_0x2b2b54=_0x3c5dee;_0x3714f6=0xc8;}else{_0x3714f6=0xce;}_0x4c0948[_0xf878('0x16')](_0x3714f6);return _0x4c0948[_0xf878('0x1b')]('Content-Range',_0x3b2e1b+'-'+_0x2b2b54+'/'+_0x3c5dee)[_0xf878('0x1c')](_0x31d888);}return null;};}function patchUpdates(_0x140866){return function(_0x250f85){try{jsonpatch['apply'](_0x250f85,_0x140866,!![]);}catch(_0x432e5d){return BPromise[_0xf878('0x1d')](_0x432e5d);}return _0x250f85[_0xf878('0x1e')]();};}function saveUpdates(_0x392822,_0x22d884){return function(_0x442450){if(_0x442450){return _0x442450[_0xf878('0x1f')](_0x392822)[_0xf878('0x20')](function(_0x212436){return _0x212436;});}return null;};}function removeEntity(_0x1a6506,_0x45e61f){return function(_0x566995){if(_0x566995){return _0x566995[_0xf878('0x21')]()['then'](function(){var _0xa3d3d3=_0x566995[_0xf878('0x22')]({'plain':!![]});var _0x35b3b4=_0xf878('0x23');return db[_0xf878('0x24')]['destroy']({'where':{'type':_0x35b3b4,'resourceId':_0xa3d3d3['id']}})['then'](function(){return _0x566995;});})['then'](function(){_0x1a6506[_0xf878('0x16')](0xcc)[_0xf878('0x25')]();});}};}function handleEntityNotFound(_0x38fa87,_0x5af87f){return function(_0xfa3e11){if(!_0xfa3e11){_0x38fa87[_0xf878('0x15')](0x194);}return _0xfa3e11;};}function handleError(_0x3e848d,_0xd50680){_0xd50680=_0xd50680||0x1f4;return function(_0x41dd55){logger['error'](_0x41dd55['stack']);if(_0x41dd55[_0xf878('0x26')]){delete _0x41dd55[_0xf878('0x26')];}_0x3e848d['status'](_0xd50680)[_0xf878('0x27')](_0x41dd55);};}exports['index']=function(_0x969ee3,_0x51afaf){var _0x2c61c1={},_0x49e66a={},_0x2630fb={'count':0x0,'rows':[]};var _0x48b151=_[_0xf878('0x28')](db[_0xf878('0x29')][_0xf878('0x2a')],function(_0x1f5331){return{'name':_0x1f5331[_0xf878('0x2b')],'type':_0x1f5331[_0xf878('0x2c')]['key']};});_0x49e66a[_0xf878('0x2d')]=_[_0xf878('0x28')](_0x48b151,_0xf878('0x26'));_0x49e66a[_0xf878('0x2e')]=_[_0xf878('0x2f')](_0x969ee3['query']);_0x49e66a[_0xf878('0x30')]=_[_0xf878('0x31')](_0x49e66a['model'],_0x49e66a[_0xf878('0x2e')]);_0x2c61c1[_0xf878('0x32')]=_[_0xf878('0x31')](_0x49e66a[_0xf878('0x2d')],qs[_0xf878('0x33')](_0x969ee3['query'][_0xf878('0x33')]));_0x2c61c1[_0xf878('0x32')]=_0x2c61c1[_0xf878('0x32')][_0xf878('0x34')]?_0x2c61c1['attributes']:_0x49e66a[_0xf878('0x2d')];if(!_0x969ee3['query']['hasOwnProperty'](_0xf878('0x35'))){_0x2c61c1[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x969ee3[_0xf878('0x2e')][_0xf878('0x19')]);_0x2c61c1['offset']=qs[_0xf878('0x17')](_0x969ee3['query'][_0xf878('0x17')]);}_0x2c61c1[_0xf878('0x36')]=qs['sort'](_0x969ee3[_0xf878('0x2e')][_0xf878('0x37')]);_0x2c61c1['where']=qs[_0xf878('0x30')](_[_0xf878('0x38')](_0x969ee3['query'],_0x49e66a[_0xf878('0x30')]),_0x48b151);if(_0x969ee3[_0xf878('0x2e')][_0xf878('0x39')]){_0x2c61c1[_0xf878('0x3a')]=_[_0xf878('0x3b')](_0x2c61c1[_0xf878('0x3a')],{'$or':_[_0xf878('0x28')](_0x48b151,function(_0x54af54){if(_0x54af54[_0xf878('0x2c')]!==_0xf878('0x3c')){var _0x47ec1b={};_0x47ec1b[_0x54af54[_0xf878('0x26')]]={'$like':'%'+_0x969ee3['query']['filter']+'%'};return _0x47ec1b;}})});}_0x2c61c1=_[_0xf878('0x3b')]({},_0x2c61c1,_0x969ee3[_0xf878('0x3d')]);var _0x43b03e={'where':_0x2c61c1[_0xf878('0x3a')]};return db[_0xf878('0x29')]['count'](_0x43b03e)[_0xf878('0x20')](function(_0x4c4ae4){_0x2630fb[_0xf878('0x1a')]=_0x4c4ae4;if(_0x969ee3[_0xf878('0x2e')]['includeAll']){_0x2c61c1['include']=[{'all':!![]}];}return db[_0xf878('0x29')][_0xf878('0x3e')](_0x2c61c1);})[_0xf878('0x20')](function(_0x2f6ee5){_0x2630fb[_0xf878('0x3f')]=_0x2f6ee5;return _0x2630fb;})[_0xf878('0x20')](respondWithFilteredResult(_0x51afaf,_0x2c61c1))[_0xf878('0x40')](handleError(_0x51afaf,null));};exports[_0xf878('0x41')]=function(_0x3b1c67,_0x5444eb){var _0x1edaa9={'raw':!![],'where':{'id':_0x3b1c67[_0xf878('0x42')]['id']}},_0x21b4fb={};_0x21b4fb[_0xf878('0x2d')]=_[_0xf878('0x2f')](db[_0xf878('0x29')]['rawAttributes']);_0x21b4fb[_0xf878('0x2e')]=_[_0xf878('0x2f')](_0x3b1c67[_0xf878('0x2e')]);_0x21b4fb[_0xf878('0x30')]=_[_0xf878('0x31')](_0x21b4fb['model'],_0x21b4fb[_0xf878('0x2e')]);_0x1edaa9[_0xf878('0x32')]=_[_0xf878('0x31')](_0x21b4fb[_0xf878('0x2d')],qs['fields'](_0x3b1c67[_0xf878('0x2e')][_0xf878('0x33')]));_0x1edaa9[_0xf878('0x32')]=_0x1edaa9['attributes']['length']?_0x1edaa9[_0xf878('0x32')]:_0x21b4fb['model'];if(_0x3b1c67['query']['includeAll']){_0x1edaa9[_0xf878('0x43')]=[{'all':!![]}];}_0x1edaa9=_['merge']({},_0x1edaa9,_0x3b1c67[_0xf878('0x3d')]);return db[_0xf878('0x29')][_0xf878('0x44')](_0x1edaa9)[_0xf878('0x20')](handleEntityNotFound(_0x5444eb,null))[_0xf878('0x20')](respondWithResult(_0x5444eb,null))[_0xf878('0x40')](handleError(_0x5444eb,null));};exports[_0xf878('0x45')]=function(_0x526c89,_0xb0bf4c){return db[_0xf878('0x29')][_0xf878('0x45')](_0x526c89[_0xf878('0x46')],{})[_0xf878('0x20')](function(_0x47c8be){var _0x4a5b71=_0x526c89[_0xf878('0x47')][_0xf878('0x22')]({'plain':!![]});if(!_0x4a5b71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a5b71[_0xf878('0x48')]==='user'){var _0x1ce6b9=_0x47c8be[_0xf878('0x22')]({'plain':!![]});var _0x379912=_0xf878('0x23');return db['UserProfileSection'][_0xf878('0x44')]({'where':{'name':_0x379912,'userProfileId':_0x4a5b71[_0xf878('0x49')]},'raw':!![]})[_0xf878('0x20')](function(_0x5a88d1){if(_0x5a88d1&&_0x5a88d1[_0xf878('0x4a')]===0x0){return db[_0xf878('0x24')][_0xf878('0x45')]({'name':_0x1ce6b9[_0xf878('0x26')],'resourceId':_0x1ce6b9['id'],'type':_0x5a88d1['name'],'sectionId':_0x5a88d1['id']},{})[_0xf878('0x20')](function(){return _0x47c8be;});}else{return _0x47c8be;}})[_0xf878('0x40')](function(_0x3f9fce){logger['error'](_0xf878('0x4b'),_0x3f9fce);throw _0x3f9fce;});}return _0x47c8be;})[_0xf878('0x20')](respondWithResult(_0xb0bf4c,0xc9))[_0xf878('0x40')](handleError(_0xb0bf4c,null));};exports[_0xf878('0x1f')]=function(_0x5118f4,_0x5a2666){if(_0x5118f4['body']['id']){delete _0x5118f4[_0xf878('0x46')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x5118f4['params']['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x5a2666,null))[_0xf878('0x20')](saveUpdates(_0x5118f4['body'],null))[_0xf878('0x20')](respondWithResult(_0x5a2666,null))[_0xf878('0x40')](handleError(_0x5a2666,null));};exports[_0xf878('0x21')]=function(_0x4ce441,_0x5eab57){return db[_0xf878('0x29')]['find']({'where':{'id':_0x4ce441[_0xf878('0x42')]['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x5eab57,null))[_0xf878('0x20')](removeEntity(_0x5eab57,null))[_0xf878('0x40')](handleError(_0x5eab57,null));};exports[_0xf878('0x4c')]=function(_0x344aa4,_0x57f635,_0x284132){return db[_0xf878('0x29')]['findOne']({'where':{'id':_0x344aa4[_0xf878('0x42')]['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x57f635,null))[_0xf878('0x20')](function(_0x282985){var _0x263f26;var _0x36b000={},_0x339141={};_0x339141['model']=_[_0xf878('0x2f')](db[_0xf878('0x4d')][_0xf878('0x2a')]);_0x339141['query']=_[_0xf878('0x2f')](_0x344aa4['query']);_0x339141[_0xf878('0x30')]=_[_0xf878('0x31')](_0x339141[_0xf878('0x2d')],_0x339141[_0xf878('0x2e')]);_0x36b000[_0xf878('0x32')]=_[_0xf878('0x31')](_0x339141[_0xf878('0x2d')],qs[_0xf878('0x33')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x33')]));_0x36b000['attributes']=_0x36b000['attributes']['length']?_0x36b000[_0xf878('0x32')]:_0x339141['model'];if(!_0x344aa4[_0xf878('0x2e')][_0xf878('0x4e')]('nolimit')){_0x36b000['limit']=qs[_0xf878('0x19')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x19')]);_0x36b000[_0xf878('0x17')]=qs[_0xf878('0x17')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x17')]);}_0x36b000[_0xf878('0x36')]=qs[_0xf878('0x37')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x37')]);_0x36b000[_0xf878('0x3a')]=qs[_0xf878('0x30')](_[_0xf878('0x38')](_0x344aa4[_0xf878('0x2e')],_0x339141[_0xf878('0x30')]));if(_0x344aa4[_0xf878('0x2e')][_0xf878('0x39')]){_0x36b000['where']=_[_0xf878('0x3b')](_0x36b000['where'],{'$or':_[_0xf878('0x28')](_0x36b000[_0xf878('0x32')],function(_0x2e8a57){var _0x910e78={};_0x910e78[_0x2e8a57]={'$like':'%'+_0x344aa4[_0xf878('0x2e')][_0xf878('0x39')]+'%'};return _0x910e78;})});}_0x36b000[_0xf878('0x3a')]=_[_0xf878('0x3b')](_0x36b000[_0xf878('0x3a')],{'mailboxuser':_0x282985['mailbox']});_0x36b000=_[_0xf878('0x3b')]({},_0x36b000,_0x344aa4[_0xf878('0x3d')]);return db[_0xf878('0x4d')][_0xf878('0x4f')](_0x36b000)['then'](respondWithFilteredResult(_0x57f635,_0x36b000));})[_0xf878('0x40')](handleError(_0x57f635,null));};
\ No newline at end of file
index f62f607..5675494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9a3=['define','VoiceMail','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceMail.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9a3,0xbd));var _0x3a9a=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9a3[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x3a9a('0x0'));var util=require(_0x3a9a('0x1'));var logger=require(_0x3a9a('0x2'))(_0x3a9a('0x3'));var moment=require('moment');var BPromise=require(_0x3a9a('0x4'));var rp=require(_0x3a9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a9a('0x6'));var attributes=require(_0x3a9a('0x7'));module[_0x3a9a('0x8')]=function(_0xafdccb,_0x5ad3d9){return _0xafdccb[_0x3a9a('0x9')](_0x3a9a('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c03=['VoiceMail','voice_voicemail','mailbox_context','mailbox','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define'];(function(_0x2f66e4,_0x43507b){var _0x11fb9d=function(_0x142a5f){while(--_0x142a5f){_0x2f66e4['push'](_0x2f66e4['shift']());}};_0x11fb9d(++_0x43507b);}(_0x9c03,0x18a));var _0x39c0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9c03[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x39c0('0x0'));var logger=require(_0x39c0('0x1'))(_0x39c0('0x2'));var moment=require(_0x39c0('0x3'));var BPromise=require(_0x39c0('0x4'));var rp=require(_0x39c0('0x5'));var fs=require('fs');var path=require(_0x39c0('0x6'));var rimraf=require(_0x39c0('0x7'));var config=require('../../config/environment');var attributes=require(_0x39c0('0x8'));module[_0x39c0('0x9')]=function(_0x5c4038,_0x6ac478){return _0x5c4038[_0x39c0('0xa')](_0x39c0('0xb'),attributes,{'tableName':_0x39c0('0xc'),'paranoid':![],'indexes':[{'name':_0x39c0('0xd'),'fields':[_0x39c0('0xe'),'context']}],'timestamps':!![]});};
\ No newline at end of file
index eeaf6a6..43e677e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f81=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x242378,_0x663231){var _0x172f4b=function(_0xac4844){while(--_0xac4844){_0x242378['push'](_0x242378['shift']());}};_0x172f4b(++_0x663231);}(_0x8f81,0xd6));var _0x18f8=function(_0x1966df,_0x42d00d){_0x1966df=_0x1966df-0x0;var _0x3c0c3d=_0x8f81[_0x1966df];return _0x3c0c3d;};'use strict';var _=require(_0x18f8('0x0'));var util=require(_0x18f8('0x1'));var moment=require(_0x18f8('0x2'));var BPromise=require(_0x18f8('0x3'));var rs=require(_0x18f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x18f8('0x5'));var logger=require(_0x18f8('0x6'))(_0x18f8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x18f8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a6fcc,_0x368d46,_0x47d485){return new BPromise(function(_0x5d1b7a,_0x51051b){return client['request'](_0x4a6fcc,_0x47d485)[_0x18f8('0x9')](function(_0x15a855){logger['info'](_0x18f8('0xa'),_0x368d46,_0x18f8('0xb'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x368d46,_0x18f8('0xb'),JSON[_0x18f8('0xc')](_0x15a855));if(_0x15a855[_0x18f8('0xd')]){if(_0x15a855[_0x18f8('0xd')][_0x18f8('0xe')]===0x1f4){logger[_0x18f8('0xd')](_0x18f8('0xa'),_0x368d46,_0x15a855[_0x18f8('0xd')][_0x18f8('0xf')]);return _0x51051b(_0x15a855[_0x18f8('0xd')][_0x18f8('0xf')]);}logger[_0x18f8('0xd')](_0x18f8('0xa'),_0x368d46,_0x15a855[_0x18f8('0xd')][_0x18f8('0xf')]);return _0x5d1b7a(_0x15a855[_0x18f8('0xd')]['message']);}else{logger[_0x18f8('0x10')](_0x18f8('0xa'),_0x368d46,_0x18f8('0xb'));_0x5d1b7a(_0x15a855[_0x18f8('0x11')][_0x18f8('0xf')]);}})[_0x18f8('0x12')](function(_0x2eeac5){logger['error']('VoiceMail,\x20%s,\x20%s',_0x368d46,_0x2eeac5);_0x51051b(_0x2eeac5);});});}
\ No newline at end of file
+var _0x3d38=['rpc','../../config/environment','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe85b1e,_0x129d1c){var _0x5f414b=function(_0x10df28){while(--_0x10df28){_0xe85b1e['push'](_0xe85b1e['shift']());}};_0x5f414b(++_0x129d1c);}(_0x3d38,0x15e));var _0x83d3=function(_0xa3ff70,_0x4a8609){_0xa3ff70=_0xa3ff70-0x0;var _0x538dbb=_0x3d38[_0xa3ff70];return _0x538dbb;};'use strict';var _=require('lodash');var util=require(_0x83d3('0x0'));var moment=require(_0x83d3('0x1'));var BPromise=require('bluebird');var rs=require(_0x83d3('0x2'));var fs=require('fs');var Redis=require(_0x83d3('0x3'));var db=require(_0x83d3('0x4'))['db'];var utils=require(_0x83d3('0x5'));var logger=require(_0x83d3('0x6'))(_0x83d3('0x7'));var config=require(_0x83d3('0x8'));var jayson=require(_0x83d3('0x9'));var client=jayson[_0x83d3('0xa')][_0x83d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dda03,_0x1c85cf,_0x526c65){return new BPromise(function(_0x2ba656,_0x2028d2){return client['request'](_0x4dda03,_0x526c65)['then'](function(_0x7bef25){logger[_0x83d3('0xc')](_0x83d3('0xd'),_0x1c85cf,_0x83d3('0xe'));logger[_0x83d3('0xf')](_0x83d3('0x10'),_0x1c85cf,'request\x20sent',JSON['stringify'](_0x7bef25));if(_0x7bef25[_0x83d3('0x11')]){if(_0x7bef25[_0x83d3('0x11')]['code']===0x1f4){logger[_0x83d3('0x11')](_0x83d3('0xd'),_0x1c85cf,_0x7bef25['error'][_0x83d3('0x12')]);return _0x2028d2(_0x7bef25['error'][_0x83d3('0x12')]);}logger[_0x83d3('0x11')](_0x83d3('0xd'),_0x1c85cf,_0x7bef25[_0x83d3('0x11')][_0x83d3('0x12')]);return _0x2ba656(_0x7bef25[_0x83d3('0x11')][_0x83d3('0x12')]);}else{logger[_0x83d3('0xc')](_0x83d3('0xd'),_0x1c85cf,_0x83d3('0xe'));_0x2ba656(_0x7bef25[_0x83d3('0x13')]['message']);}})[_0x83d3('0x14')](function(_0x1a91ee){logger[_0x83d3('0x11')]('VoiceMail,\x20%s,\x20%s',_0x1c85cf,_0x1a91ee);_0x2028d2(_0x1a91ee);});});}
\ No newline at end of file
index a3b8e0b..4d618ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f3=['/:id/download','isAuthenticated','create','put','update','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','show'];(function(_0x1dcd0c,_0x2d9ee5){var _0x31299d=function(_0x148303){while(--_0x148303){_0x1dcd0c['push'](_0x1dcd0c['shift']());}};_0x31299d(++_0x2d9ee5);}(_0x81f3,0xba));var _0x381f=function(_0x118fa4,_0x44cf98){_0x118fa4=_0x118fa4-0x0;var _0x2952bd=_0x81f3[_0x118fa4];return _0x2952bd;};'use strict';var multer=require(_0x381f('0x0'));var util=require('util');var path=require(_0x381f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x381f('0x2')]();var fs_extra=require(_0x381f('0x3'));var auth=require(_0x381f('0x4'));var interaction=require(_0x381f('0x5'));var config=require(_0x381f('0x6'));var controller=require(_0x381f('0x7'));router[_0x381f('0x8')]('/',auth['isAuthenticated'](),controller[_0x381f('0x9')]);router[_0x381f('0x8')](_0x381f('0xa'),auth['isAuthenticated'](),controller[_0x381f('0xb')]);router[_0x381f('0x8')](_0x381f('0xc'),auth[_0x381f('0xd')](),controller['download']);router['post']('/',auth[_0x381f('0xd')](),controller[_0x381f('0xe')]);router[_0x381f('0xf')](_0x381f('0xa'),auth[_0x381f('0xd')](),controller[_0x381f('0x10')]);router['delete'](_0x381f('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x381f('0x11')]=router;
\ No newline at end of file
+var _0x4e9d=['download','post','create','put','delete','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x301c46,_0x286435){var _0x5e8efd=function(_0x2203cf){while(--_0x2203cf){_0x301c46['push'](_0x301c46['shift']());}};_0x5e8efd(++_0x286435);}(_0x4e9d,0xc4));var _0xd4e9=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x4e9d[_0x1e6e4e];return _0x3d746b;};'use strict';var multer=require('multer');var util=require(_0xd4e9('0x0'));var path=require(_0xd4e9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd4e9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd4e9('0x3'));var interaction=require(_0xd4e9('0x4'));var config=require(_0xd4e9('0x5'));var controller=require(_0xd4e9('0x6'));router[_0xd4e9('0x7')]('/',auth[_0xd4e9('0x8')](),controller[_0xd4e9('0x9')]);router[_0xd4e9('0x7')](_0xd4e9('0xa'),auth[_0xd4e9('0x8')](),controller[_0xd4e9('0xb')]);router[_0xd4e9('0x7')](_0xd4e9('0xc'),auth[_0xd4e9('0x8')](),controller[_0xd4e9('0xd')]);router[_0xd4e9('0xe')]('/',auth[_0xd4e9('0x8')](),controller[_0xd4e9('0xf')]);router[_0xd4e9('0x10')](_0xd4e9('0xa'),auth[_0xd4e9('0x8')](),controller['update']);router[_0xd4e9('0x11')](_0xd4e9('0xa'),auth[_0xd4e9('0x8')](),controller['destroy']);module[_0xd4e9('0x12')]=router;
\ No newline at end of file
index 8a50461..2fd36fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe12d=['getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x4a5ce3,_0x32f308){var _0x5b135e=function(_0xf346f7){while(--_0xf346f7){_0x4a5ce3['push'](_0x4a5ce3['shift']());}};_0x5b135e(++_0x32f308);}(_0xe12d,0x18d));var _0xde12=function(_0x53f428,_0x3185e8){_0x53f428=_0x53f428-0x0;var _0xf4fd57=_0xe12d[_0x53f428];return _0xf4fd57;};'use strict';var Sequelize=require(_0xde12('0x0'));module[_0xde12('0x1')]={'name':{'type':Sequelize[_0xde12('0x2')],'get':function(_0x3abd5f){return this[_0xde12('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xde12('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xde12('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xde12('0x5')],'defaultValue':''},'stamp':{'type':_0xde12('0x7'),'defaultValue':Sequelize[_0xde12('0x8')](_0xde12('0x9'))}};
\ No newline at end of file
+var _0x4f0e=['getDataValue','STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x285f13,_0x1547b7){var _0x3bde28=function(_0x3d6bb8){while(--_0x3d6bb8){_0x285f13['push'](_0x285f13['shift']());}};_0x3bde28(++_0x1547b7);}(_0x4f0e,0x105));var _0xe4f0=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x4f0e[_0x4bf96c];return _0x281d09;};'use strict';var Sequelize=require(_0xe4f0('0x0'));module[_0xe4f0('0x1')]={'name':{'type':Sequelize[_0xe4f0('0x2')],'get':function(_0x1a2ead){return this[_0xe4f0('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xe4f0('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xe4f0('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xe4f0('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xe4f0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe4f0('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xe4f0('0x5')](_0xe4f0('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xe4f0('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xe4f0('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 43cd298..e2baaa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45b5=['query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','update','body','find','download','recording','msg_id','Sequelize','audio/wav','attachment','Content-Disposition','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','keys','filters','intersection'];(function(_0x1d594f,_0x36ceef){var _0x137b4d=function(_0x26473b){while(--_0x26473b){_0x1d594f['push'](_0x1d594f['shift']());}};_0x137b4d(++_0x36ceef);}(_0x45b5,0x1d4));var _0x545b=function(_0x2f58dc,_0x8f6ae2){_0x2f58dc=_0x2f58dc-0x0;var _0x3fd90d=_0x45b5[_0x2f58dc];return _0x3fd90d;};'use strict';var emlformat=require(_0x545b('0x0'));var rimraf=require(_0x545b('0x1'));var zipdir=require(_0x545b('0x2'));var jsonpatch=require(_0x545b('0x3'));var rp=require(_0x545b('0x4'));var moment=require('moment');var BPromise=require(_0x545b('0x5'));var Mustache=require(_0x545b('0x6'));var util=require(_0x545b('0x7'));var path=require(_0x545b('0x8'));var sox=require(_0x545b('0x9'));var csv=require('to-csv');var ejs=require(_0x545b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x545b('0xb'));var squel=require('squel');var crypto=require(_0x545b('0xc'));var jsforce=require(_0x545b('0xd'));var deskjs=require(_0x545b('0xe'));var toCsv=require(_0x545b('0xf'));var querystring=require(_0x545b('0x10'));var Papa=require(_0x545b('0x11'));var Redis=require(_0x545b('0x12'));var authService=require(_0x545b('0x13'));var qs=require(_0x545b('0x14'));var as=require(_0x545b('0x15'));var hardwareService=require(_0x545b('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x545b('0x17'));var licenseUtil=require(_0x545b('0x18'));var db=require(_0x545b('0x19'))['db'];function respondWithStatusCode(_0xb4c931,_0x39d364){_0x39d364=_0x39d364||0xcc;return function(_0x39b0ad){if(_0x39b0ad){return _0xb4c931['sendStatus'](_0x39d364);}return _0xb4c931[_0x545b('0x1a')](_0x39d364)[_0x545b('0x1b')]();};}function respondWithResult(_0x3c7ca8,_0x447cee){_0x447cee=_0x447cee||0xc8;return function(_0xf3fa08){if(_0xf3fa08){return _0x3c7ca8[_0x545b('0x1a')](_0x447cee)[_0x545b('0x1c')](_0xf3fa08);}};}function respondWithFilteredResult(_0x50f5c3,_0x3a4d4b){return function(_0x259d94){if(_0x259d94){var _0x4b25a0=typeof _0x3a4d4b[_0x545b('0x1d')]==='undefined'&&typeof _0x3a4d4b['limit']===_0x545b('0x1e');var _0x285364=_0x259d94['count'];var _0x1729cf=_0x4b25a0?0x0:_0x3a4d4b[_0x545b('0x1d')];var _0x406918=_0x4b25a0?_0x259d94['count']:_0x3a4d4b[_0x545b('0x1d')]+_0x3a4d4b[_0x545b('0x1f')];var _0x18e811;if(_0x406918>=_0x285364){_0x406918=_0x285364;_0x18e811=0xc8;}else{_0x18e811=0xce;}_0x50f5c3[_0x545b('0x1a')](_0x18e811);return _0x50f5c3[_0x545b('0x20')](_0x545b('0x21'),_0x1729cf+'-'+_0x406918+'/'+_0x285364)[_0x545b('0x1c')](_0x259d94);}return null;};}function patchUpdates(_0x55ce5b){return function(_0x28ee07){try{jsonpatch[_0x545b('0x22')](_0x28ee07,_0x55ce5b,!![]);}catch(_0x1a03b2){return BPromise[_0x545b('0x23')](_0x1a03b2);}return _0x28ee07[_0x545b('0x24')]();};}function saveUpdates(_0x5c90be,_0x274816){return function(_0x2fa81c){if(_0x2fa81c){return _0x2fa81c['update'](_0x5c90be)[_0x545b('0x25')](function(_0x10c300){return _0x10c300;});}return null;};}function removeEntity(_0x16e077,_0x40eaff){return function(_0x57a83a){if(_0x57a83a){return _0x57a83a[_0x545b('0x26')]()[_0x545b('0x25')](function(){_0x16e077[_0x545b('0x1a')](0xcc)[_0x545b('0x1b')]();});}};}function handleEntityNotFound(_0x3468d0,_0x323ae9){return function(_0x5e3e32){if(!_0x5e3e32){_0x3468d0[_0x545b('0x27')](0x194);}return _0x5e3e32;};}function handleError(_0x40b44d,_0xa2f4c4){_0xa2f4c4=_0xa2f4c4||0x1f4;return function(_0x2e243d){logger[_0x545b('0x28')](_0x2e243d[_0x545b('0x29')]);if(_0x2e243d['name']){delete _0x2e243d[_0x545b('0x2a')];}_0x40b44d[_0x545b('0x1a')](_0xa2f4c4)[_0x545b('0x2b')](_0x2e243d);};}exports['index']=function(_0x4b2198,_0x117e3b){var _0xc19b={},_0x4a47b3={},_0x415354={'count':0x0,'rows':[]};var _0x4d1abe=_[_0x545b('0x2c')](db[_0x545b('0x2d')][_0x545b('0x2e')],function(_0x2dfa3c){return{'name':_0x2dfa3c[_0x545b('0x2f')],'type':_0x2dfa3c['type'][_0x545b('0x30')]};});_0x4a47b3[_0x545b('0x31')]=_[_0x545b('0x32')](_[_0x545b('0x2c')](_0x4d1abe,_0x545b('0x2a')),[_0x545b('0x2a')]);_0x4a47b3['query']=_[_0x545b('0x33')](_0x4b2198['query']);_0x4a47b3[_0x545b('0x34')]=_[_0x545b('0x35')](_0x4a47b3[_0x545b('0x31')],_0x4a47b3[_0x545b('0x36')]);_0xc19b[_0x545b('0x37')]=_[_0x545b('0x35')](_0x4a47b3[_0x545b('0x31')],qs['fields'](_0x4b2198[_0x545b('0x36')][_0x545b('0x38')]));_0xc19b['attributes']=_0xc19b[_0x545b('0x37')][_0x545b('0x39')]?_0xc19b[_0x545b('0x37')]:_0x4a47b3[_0x545b('0x31')];if(!_0x4b2198[_0x545b('0x36')][_0x545b('0x3a')](_0x545b('0x3b'))){_0xc19b[_0x545b('0x1f')]=qs[_0x545b('0x1f')](_0x4b2198[_0x545b('0x36')][_0x545b('0x1f')]);_0xc19b[_0x545b('0x1d')]=qs[_0x545b('0x1d')](_0x4b2198[_0x545b('0x36')][_0x545b('0x1d')]);}_0xc19b[_0x545b('0x3c')]=qs[_0x545b('0x3d')](_0x4b2198[_0x545b('0x36')][_0x545b('0x3d')]);_0xc19b[_0x545b('0x3e')]=qs['filters'](_[_0x545b('0x3f')](_0x4b2198[_0x545b('0x36')],_0x4a47b3['filters']),_0x4d1abe);if(_0x4b2198['query'][_0x545b('0x40')]){_0xc19b[_0x545b('0x3e')]=_['merge'](_0xc19b['where'],{'$or':_[_0x545b('0x2c')](_0x4d1abe,function(_0x36c188){if(_0x36c188[_0x545b('0x41')]!==_0x545b('0x42')){var _0x421bd4={};_0x421bd4[_0x36c188[_0x545b('0x2a')]]={'$like':'%'+_0x4b2198['query'][_0x545b('0x40')]+'%'};return _0x421bd4;}})});}_0xc19b=_[_0x545b('0x43')]({},_0xc19b,_0x4b2198[_0x545b('0x44')]);var _0x4de41d={'where':_0xc19b[_0x545b('0x3e')]};return db[_0x545b('0x2d')]['count'](_0x4de41d)['then'](function(_0x32288b){_0x415354['count']=_0x32288b;if(_0x4b2198['query'][_0x545b('0x45')]){_0xc19b[_0x545b('0x46')]=[{'all':!![]}];}return db[_0x545b('0x2d')][_0x545b('0x47')](_0xc19b);})[_0x545b('0x25')](function(_0x1ee5a1){_0x415354[_0x545b('0x48')]=_0x1ee5a1;return _0x415354;})['then'](respondWithFilteredResult(_0x117e3b,_0xc19b))[_0x545b('0x49')](handleError(_0x117e3b,null));};exports[_0x545b('0x4a')]=function(_0x460214,_0x11e673){var _0x5a5abf={'raw':!![],'where':{'id':_0x460214[_0x545b('0x4b')]['id']}},_0x913063={};_0x913063['model']=_[_0x545b('0x33')](db['VoiceMailMessage'][_0x545b('0x2e')]);_0x913063['query']=_[_0x545b('0x33')](_0x460214[_0x545b('0x36')]);_0x913063[_0x545b('0x34')]=_[_0x545b('0x35')](_0x913063[_0x545b('0x31')],_0x913063[_0x545b('0x36')]);_0x5a5abf['attributes']=_['intersection'](_0x913063[_0x545b('0x31')],qs[_0x545b('0x38')](_0x460214['query'][_0x545b('0x38')]));_0x5a5abf['attributes']=_0x5a5abf['attributes']['length']?_0x5a5abf['attributes']:_0x913063[_0x545b('0x31')];if(_0x460214[_0x545b('0x36')]['includeAll']){_0x5a5abf[_0x545b('0x46')]=[{'all':!![]}];}_0x5a5abf=_[_0x545b('0x43')]({},_0x5a5abf,_0x460214['options']);return db['VoiceMailMessage']['find'](_0x5a5abf)['then'](handleEntityNotFound(_0x11e673,null))[_0x545b('0x25')](respondWithResult(_0x11e673,null))['catch'](handleError(_0x11e673,null));};exports['create']=function(_0xdc1ec0,_0x2bdad9){return db[_0x545b('0x2d')][_0x545b('0x4c')](_0xdc1ec0['body'],{})[_0x545b('0x25')](respondWithResult(_0x2bdad9,0xc9))[_0x545b('0x49')](handleError(_0x2bdad9,null));};exports[_0x545b('0x4d')]=function(_0x51a952,_0x5438d9){if(_0x51a952[_0x545b('0x4e')]['id']){delete _0x51a952[_0x545b('0x4e')]['id'];}return db[_0x545b('0x2d')][_0x545b('0x4f')]({'where':{'id':_0x51a952[_0x545b('0x4b')]['id']}})[_0x545b('0x25')](handleEntityNotFound(_0x5438d9,null))[_0x545b('0x25')](saveUpdates(_0x51a952[_0x545b('0x4e')],null))['then'](respondWithResult(_0x5438d9,null))[_0x545b('0x49')](handleError(_0x5438d9,null));};exports[_0x545b('0x26')]=function(_0x5d7107,_0x195ef1){return db[_0x545b('0x2d')][_0x545b('0x4f')]({'where':{'id':_0x5d7107[_0x545b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x195ef1,null))['then'](removeEntity(_0x195ef1,null))[_0x545b('0x49')](handleError(_0x195ef1,null));};exports[_0x545b('0x50')]=function(_0x11a0ea,_0x2a1d46,_0x8d656f){return db[_0x545b('0x2d')][_0x545b('0x4f')]({'where':{'id':_0x11a0ea[_0x545b('0x4b')]['id']},'attributes':['id',_0x545b('0x51'),_0x545b('0x52')]})[_0x545b('0x25')](handleEntityNotFound(_0x2a1d46,null))[_0x545b('0x25')](function(_0x2f5638){if(_0x2f5638){if(!_0x2f5638[_0x545b('0x51')]){throw new db[(_0x545b('0x53'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x57ccee={'Content-Type':_0x545b('0x54'),'Content-Disposition':_0x545b('0x55')};if(_0x2f5638[_0x545b('0x52')]){_0x57ccee[_0x545b('0x56')]='attachment;\x20filename=\x22'+_0x2f5638[_0x545b('0x52')]+'.wav\x22';}_0x2a1d46[_0x545b('0x20')](_0x57ccee);return _0x2a1d46['send'](new Buffer(_0x2f5638[_0x545b('0x51')]));}})['catch'](handleError(_0x2a1d46,null));};
\ No newline at end of file
+var _0x6950=['util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','intersection','attributes','model','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','fields','find','create','body','download','recording','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','moment','bluebird'];(function(_0x1030aa,_0x2013cf){var _0x55bb14=function(_0x10bcf3){while(--_0x10bcf3){_0x1030aa['push'](_0x1030aa['shift']());}};_0x55bb14(++_0x2013cf);}(_0x6950,0xf5));var _0x0695=function(_0x49486c,_0x36cc55){_0x49486c=_0x49486c-0x0;var _0xa84010=_0x6950[_0x49486c];return _0xa84010;};'use strict';var emlformat=require(_0x0695('0x0'));var rimraf=require(_0x0695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0695('0x2'));var BPromise=require(_0x0695('0x3'));var Mustache=require('mustache');var util=require(_0x0695('0x4'));var path=require(_0x0695('0x5'));var sox=require(_0x0695('0x6'));var csv=require(_0x0695('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0695('0x8'));var _=require(_0x0695('0x9'));var squel=require(_0x0695('0xa'));var crypto=require('crypto');var jsforce=require(_0x0695('0xb'));var deskjs=require(_0x0695('0xc'));var toCsv=require(_0x0695('0x7'));var querystring=require('querystring');var Papa=require(_0x0695('0xd'));var Redis=require('ioredis');var authService=require(_0x0695('0xe'));var qs=require(_0x0695('0xf'));var as=require(_0x0695('0x10'));var hardwareService=require(_0x0695('0x11'));var logger=require(_0x0695('0x12'))(_0x0695('0x13'));var utils=require(_0x0695('0x14'));var config=require(_0x0695('0x15'));var licenseUtil=require(_0x0695('0x16'));var db=require(_0x0695('0x17'))['db'];function respondWithStatusCode(_0x123121,_0x5c7043){_0x5c7043=_0x5c7043||0xcc;return function(_0xaef18a){if(_0xaef18a){return _0x123121['sendStatus'](_0x5c7043);}return _0x123121[_0x0695('0x18')](_0x5c7043)[_0x0695('0x19')]();};}function respondWithResult(_0x4109c8,_0x99e2a8){_0x99e2a8=_0x99e2a8||0xc8;return function(_0xdcae18){if(_0xdcae18){return _0x4109c8['status'](_0x99e2a8)[_0x0695('0x1a')](_0xdcae18);}};}function respondWithFilteredResult(_0x52386d,_0x213a52){return function(_0x198087){if(_0x198087){var _0x1b2f38=typeof _0x213a52['offset']===_0x0695('0x1b')&&typeof _0x213a52[_0x0695('0x1c')]==='undefined';var _0x3de7ec=_0x198087['count'];var _0x162e2b=_0x1b2f38?0x0:_0x213a52[_0x0695('0x1d')];var _0x479c79=_0x1b2f38?_0x198087[_0x0695('0x1e')]:_0x213a52[_0x0695('0x1d')]+_0x213a52[_0x0695('0x1c')];var _0x2726e9;if(_0x479c79>=_0x3de7ec){_0x479c79=_0x3de7ec;_0x2726e9=0xc8;}else{_0x2726e9=0xce;}_0x52386d[_0x0695('0x18')](_0x2726e9);return _0x52386d[_0x0695('0x1f')](_0x0695('0x20'),_0x162e2b+'-'+_0x479c79+'/'+_0x3de7ec)[_0x0695('0x1a')](_0x198087);}return null;};}function patchUpdates(_0x460a0d){return function(_0x5117a5){try{jsonpatch['apply'](_0x5117a5,_0x460a0d,!![]);}catch(_0xa7bd2c){return BPromise[_0x0695('0x21')](_0xa7bd2c);}return _0x5117a5['save']();};}function saveUpdates(_0x57bc7f,_0x20878a){return function(_0x103f72){if(_0x103f72){return _0x103f72[_0x0695('0x22')](_0x57bc7f)[_0x0695('0x23')](function(_0x59b86d){return _0x59b86d;});}return null;};}function removeEntity(_0x3b2536,_0x1253c7){return function(_0x55148e){if(_0x55148e){return _0x55148e[_0x0695('0x24')]()[_0x0695('0x23')](function(){_0x3b2536['status'](0xcc)[_0x0695('0x19')]();});}};}function handleEntityNotFound(_0x24e778,_0x3b422b){return function(_0x1c444f){if(!_0x1c444f){_0x24e778['sendStatus'](0x194);}return _0x1c444f;};}function handleError(_0x1b51dd,_0x32a09f){_0x32a09f=_0x32a09f||0x1f4;return function(_0x58daa7){logger[_0x0695('0x25')](_0x58daa7[_0x0695('0x26')]);if(_0x58daa7[_0x0695('0x27')]){delete _0x58daa7[_0x0695('0x27')];}_0x1b51dd[_0x0695('0x18')](_0x32a09f)[_0x0695('0x28')](_0x58daa7);};}exports[_0x0695('0x29')]=function(_0x25e622,_0x463b93){var _0x243bfb={},_0x10b26e={},_0x22f7a7={'count':0x0,'rows':[]};var _0x3317af=_[_0x0695('0x2a')](db[_0x0695('0x2b')][_0x0695('0x2c')],function(_0x4343ff){return{'name':_0x4343ff[_0x0695('0x2d')],'type':_0x4343ff[_0x0695('0x2e')][_0x0695('0x2f')]};});_0x10b26e['model']=_[_0x0695('0x30')](_[_0x0695('0x2a')](_0x3317af,_0x0695('0x27')),[_0x0695('0x27')]);_0x10b26e[_0x0695('0x31')]=_[_0x0695('0x32')](_0x25e622[_0x0695('0x31')]);_0x10b26e['filters']=_[_0x0695('0x33')](_0x10b26e['model'],_0x10b26e[_0x0695('0x31')]);_0x243bfb[_0x0695('0x34')]=_[_0x0695('0x33')](_0x10b26e[_0x0695('0x35')],qs['fields'](_0x25e622[_0x0695('0x31')]['fields']));_0x243bfb['attributes']=_0x243bfb['attributes'][_0x0695('0x36')]?_0x243bfb['attributes']:_0x10b26e[_0x0695('0x35')];if(!_0x25e622[_0x0695('0x31')]['hasOwnProperty'](_0x0695('0x37'))){_0x243bfb[_0x0695('0x1c')]=qs[_0x0695('0x1c')](_0x25e622[_0x0695('0x31')][_0x0695('0x1c')]);_0x243bfb['offset']=qs['offset'](_0x25e622[_0x0695('0x31')]['offset']);}_0x243bfb[_0x0695('0x38')]=qs[_0x0695('0x39')](_0x25e622[_0x0695('0x31')]['sort']);_0x243bfb[_0x0695('0x3a')]=qs[_0x0695('0x3b')](_['pick'](_0x25e622[_0x0695('0x31')],_0x10b26e[_0x0695('0x3b')]),_0x3317af);if(_0x25e622[_0x0695('0x31')]['filter']){_0x243bfb[_0x0695('0x3a')]=_[_0x0695('0x3c')](_0x243bfb[_0x0695('0x3a')],{'$or':_[_0x0695('0x2a')](_0x3317af,function(_0x573b59){if(_0x573b59[_0x0695('0x2e')]!==_0x0695('0x3d')){var _0x110734={};_0x110734[_0x573b59['name']]={'$like':'%'+_0x25e622[_0x0695('0x31')][_0x0695('0x3e')]+'%'};return _0x110734;}})});}_0x243bfb=_[_0x0695('0x3c')]({},_0x243bfb,_0x25e622[_0x0695('0x3f')]);var _0x3fca65={'where':_0x243bfb['where']};return db[_0x0695('0x2b')][_0x0695('0x1e')](_0x3fca65)[_0x0695('0x23')](function(_0x31f4df){_0x22f7a7[_0x0695('0x1e')]=_0x31f4df;if(_0x25e622[_0x0695('0x31')][_0x0695('0x40')]){_0x243bfb[_0x0695('0x41')]=[{'all':!![]}];}return db[_0x0695('0x2b')]['findAll'](_0x243bfb);})[_0x0695('0x23')](function(_0x53ce38){_0x22f7a7[_0x0695('0x42')]=_0x53ce38;return _0x22f7a7;})[_0x0695('0x23')](respondWithFilteredResult(_0x463b93,_0x243bfb))[_0x0695('0x43')](handleError(_0x463b93,null));};exports[_0x0695('0x44')]=function(_0x43ddd7,_0x227dd6){var _0x3cf649={'raw':!![],'where':{'id':_0x43ddd7[_0x0695('0x45')]['id']}},_0x44ef5b={};_0x44ef5b[_0x0695('0x35')]=_[_0x0695('0x32')](db[_0x0695('0x2b')][_0x0695('0x2c')]);_0x44ef5b[_0x0695('0x31')]=_['keys'](_0x43ddd7[_0x0695('0x31')]);_0x44ef5b['filters']=_[_0x0695('0x33')](_0x44ef5b[_0x0695('0x35')],_0x44ef5b['query']);_0x3cf649['attributes']=_['intersection'](_0x44ef5b[_0x0695('0x35')],qs['fields'](_0x43ddd7[_0x0695('0x31')][_0x0695('0x46')]));_0x3cf649[_0x0695('0x34')]=_0x3cf649[_0x0695('0x34')]['length']?_0x3cf649['attributes']:_0x44ef5b[_0x0695('0x35')];if(_0x43ddd7[_0x0695('0x31')][_0x0695('0x40')]){_0x3cf649['include']=[{'all':!![]}];}_0x3cf649=_[_0x0695('0x3c')]({},_0x3cf649,_0x43ddd7[_0x0695('0x3f')]);return db['VoiceMailMessage'][_0x0695('0x47')](_0x3cf649)[_0x0695('0x23')](handleEntityNotFound(_0x227dd6,null))[_0x0695('0x23')](respondWithResult(_0x227dd6,null))['catch'](handleError(_0x227dd6,null));};exports[_0x0695('0x48')]=function(_0x34beea,_0x420cda){return db[_0x0695('0x2b')]['create'](_0x34beea[_0x0695('0x49')],{})['then'](respondWithResult(_0x420cda,0xc9))[_0x0695('0x43')](handleError(_0x420cda,null));};exports[_0x0695('0x22')]=function(_0x5e1305,_0x4ce630){if(_0x5e1305[_0x0695('0x49')]['id']){delete _0x5e1305[_0x0695('0x49')]['id'];}return db[_0x0695('0x2b')]['find']({'where':{'id':_0x5e1305[_0x0695('0x45')]['id']}})[_0x0695('0x23')](handleEntityNotFound(_0x4ce630,null))[_0x0695('0x23')](saveUpdates(_0x5e1305['body'],null))['then'](respondWithResult(_0x4ce630,null))[_0x0695('0x43')](handleError(_0x4ce630,null));};exports[_0x0695('0x24')]=function(_0x570bea,_0x441f2d){return db[_0x0695('0x2b')][_0x0695('0x47')]({'where':{'id':_0x570bea['params']['id']}})[_0x0695('0x23')](handleEntityNotFound(_0x441f2d,null))[_0x0695('0x23')](removeEntity(_0x441f2d,null))[_0x0695('0x43')](handleError(_0x441f2d,null));};exports[_0x0695('0x4a')]=function(_0x80e168,_0xe20ffe,_0xbb00cf){return db[_0x0695('0x2b')][_0x0695('0x47')]({'where':{'id':_0x80e168['params']['id']},'attributes':['id',_0x0695('0x4b'),'msg_id']})['then'](handleEntityNotFound(_0xe20ffe,null))[_0x0695('0x23')](function(_0x337ad2){if(_0x337ad2){if(!_0x337ad2[_0x0695('0x4b')]){throw new db['Sequelize']['ValidationError'](_0x0695('0x4c'));}var _0x13e626={'Content-Type':_0x0695('0x4d'),'Content-Disposition':_0x0695('0x4e')};if(_0x337ad2[_0x0695('0x4f')]){_0x13e626[_0x0695('0x50')]=_0x0695('0x51')+_0x337ad2['msg_id']+_0x0695('0x52');}_0xe20ffe['set'](_0x13e626);return _0xe20ffe[_0x0695('0x28')](new Buffer(_0x337ad2[_0x0695('0x4b')]));}})['catch'](handleError(_0xe20ffe,null));};
\ No newline at end of file
index 7923467..773d5dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351b=['bluebird','rimraf','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0x351b,0x10b));var _0xb351=function(_0x36ba2c,_0x4e6be2){_0x36ba2c=_0x36ba2c-0x0;var _0x528958=_0x351b[_0x36ba2c];return _0x528958;};'use strict';var _=require('lodash');var util=require(_0xb351('0x0'));var logger=require(_0xb351('0x1'))(_0xb351('0x2'));var moment=require('moment');var BPromise=require(_0xb351('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb351('0x4'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xb351('0x5')]=function(_0x44d51e,_0x68cc83){return _0x44d51e[_0xb351('0x6')](_0xb351('0x7'),attributes,{'tableName':_0xb351('0x8'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xb351('0x9')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x2991=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','dir'];(function(_0x598100,_0x32dd1b){var _0x1e0bed=function(_0x17f893){while(--_0x17f893){_0x598100['push'](_0x598100['shift']());}};_0x1e0bed(++_0x32dd1b);}(_0x2991,0x144));var _0x1299=function(_0x38d887,_0x5c0a97){_0x38d887=_0x38d887-0x0;var _0x2ed226=_0x2991[_0x38d887];return _0x2ed226;};'use strict';var _=require(_0x1299('0x0'));var util=require('util');var logger=require(_0x1299('0x1'))(_0x1299('0x2'));var moment=require(_0x1299('0x3'));var BPromise=require(_0x1299('0x4'));var rp=require(_0x1299('0x5'));var fs=require('fs');var path=require(_0x1299('0x6'));var rimraf=require(_0x1299('0x7'));var config=require('../../config/environment');var attributes=require(_0x1299('0x8'));module[_0x1299('0x9')]=function(_0x889906,_0x14b836){return _0x889906[_0x1299('0xa')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x1299('0xb'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
index 9aa4ab8..49918f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b45=['rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x44b2de,_0x41db8a){var _0x3baf40=function(_0x18b9d3){while(--_0x18b9d3){_0x44b2de['push'](_0x44b2de['shift']());}};_0x3baf40(++_0x41db8a);}(_0x5b45,0x19f));var _0x55b4=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0x5b45[_0x3725ee];return _0x399c71;};'use strict';var _=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var moment=require(_0x55b4('0x2'));var BPromise=require('bluebird');var rs=require(_0x55b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55b4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x55b4('0x5'));var config=require(_0x55b4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x55b4('0x7')][_0x55b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd64017,_0x4b1351,_0x34c9ba){return new BPromise(function(_0xfb91d1,_0xaaa791){return client[_0x55b4('0x9')](_0xd64017,_0x34c9ba)[_0x55b4('0xa')](function(_0x351df4){logger[_0x55b4('0xb')](_0x55b4('0xc'),_0x4b1351,_0x55b4('0xd'));logger[_0x55b4('0xe')](_0x55b4('0xf'),_0x4b1351,_0x55b4('0xd'),JSON['stringify'](_0x351df4));if(_0x351df4[_0x55b4('0x10')]){if(_0x351df4['error']['code']===0x1f4){logger[_0x55b4('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x4b1351,_0x351df4[_0x55b4('0x10')][_0x55b4('0x11')]);return _0xaaa791(_0x351df4['error'][_0x55b4('0x11')]);}logger[_0x55b4('0x10')](_0x55b4('0xc'),_0x4b1351,_0x351df4[_0x55b4('0x10')][_0x55b4('0x11')]);return _0xfb91d1(_0x351df4['error']['message']);}else{logger['info'](_0x55b4('0xc'),_0x4b1351,_0x55b4('0xd'));_0xfb91d1(_0x351df4[_0x55b4('0x12')][_0x55b4('0x11')]);}})[_0x55b4('0x13')](function(_0x4e480b){logger[_0x55b4('0x10')](_0x55b4('0xc'),_0x4b1351,_0x4e480b);_0xaaa791(_0x4e480b);});});}
\ No newline at end of file
+var _0x1374=['message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x555ebb,_0x442f1c){var _0x22a977=function(_0x5be2bc){while(--_0x5be2bc){_0x555ebb['push'](_0x555ebb['shift']());}};_0x22a977(++_0x442f1c);}(_0x1374,0x138));var _0x4137=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x1374[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0x4137('0x0'));var moment=require(_0x4137('0x1'));var BPromise=require('bluebird');var rs=require(_0x4137('0x2'));var fs=require('fs');var Redis=require(_0x4137('0x3'));var db=require(_0x4137('0x4'))['db'];var utils=require(_0x4137('0x5'));var logger=require('../../config/logger')(_0x4137('0x6'));var config=require(_0x4137('0x7'));var jayson=require(_0x4137('0x8'));var client=jayson['client'][_0x4137('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x130630,_0x5985ac,_0x195cbe){return new BPromise(function(_0xf0a509,_0x59aa5f){return client[_0x4137('0xa')](_0x130630,_0x195cbe)['then'](function(_0x148ab9){logger['info'](_0x4137('0xb'),_0x5985ac,_0x4137('0xc'));logger[_0x4137('0xd')](_0x4137('0xe'),_0x5985ac,_0x4137('0xc'),JSON[_0x4137('0xf')](_0x148ab9));if(_0x148ab9[_0x4137('0x10')]){if(_0x148ab9['error'][_0x4137('0x11')]===0x1f4){logger[_0x4137('0x10')](_0x4137('0xb'),_0x5985ac,_0x148ab9[_0x4137('0x10')][_0x4137('0x12')]);return _0x59aa5f(_0x148ab9['error'][_0x4137('0x12')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5985ac,_0x148ab9[_0x4137('0x10')]['message']);return _0xf0a509(_0x148ab9['error'][_0x4137('0x12')]);}else{logger[_0x4137('0x13')](_0x4137('0xb'),_0x5985ac,_0x4137('0xc'));_0xf0a509(_0x148ab9[_0x4137('0x14')][_0x4137('0x12')]);}})[_0x4137('0x15')](function(_0x3864d5){logger[_0x4137('0x10')](_0x4137('0xb'),_0x5985ac,_0x3864d5);_0x59aa5f(_0x3864d5);});});}
\ No newline at end of file
index b595ea8..7088b29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f24=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','/:id','show','/:id/sounds','isAuthenticated','post','create','addSound','update','delete','destroy','/:id/sounds/:id2','exports'];(function(_0x3fdd09,_0x2853f7){var _0x2be280=function(_0x419408){while(--_0x419408){_0x3fdd09['push'](_0x3fdd09['shift']());}};_0x2be280(++_0x2853f7);}(_0x8f24,0x1e3));var _0x48f2=function(_0x3d4da3,_0x17a8ee){_0x3d4da3=_0x3d4da3-0x0;var _0x43055c=_0x8f24[_0x3d4da3];return _0x43055c;};'use strict';var multer=require(_0x48f2('0x0'));var util=require(_0x48f2('0x1'));var path=require(_0x48f2('0x2'));var timeout=require(_0x48f2('0x3'));var express=require(_0x48f2('0x4'));var router=express[_0x48f2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x48f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x48f2('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x48f2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x48f2('0x8')](_0x48f2('0x9'),auth['isAuthenticated'](),controller[_0x48f2('0xa')]);router[_0x48f2('0x8')](_0x48f2('0xb'),auth[_0x48f2('0xc')](),controller['getSounds']);router[_0x48f2('0xd')]('/',auth['isAuthenticated'](),controller[_0x48f2('0xe')]);router[_0x48f2('0xd')]('/:id/sounds',auth[_0x48f2('0xc')](),controller[_0x48f2('0xf')]);router['put'](_0x48f2('0x9'),auth['isAuthenticated'](),controller[_0x48f2('0x10')]);router[_0x48f2('0x11')]('/:id',auth[_0x48f2('0xc')](),controller[_0x48f2('0x12')]);router['delete'](_0x48f2('0x13'),auth['isAuthenticated'](),controller['removeSound']);module[_0x48f2('0x14')]=router;
\ No newline at end of file
+var _0x5935=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound'];(function(_0x201984,_0x4ac282){var _0x3bd3f3=function(_0x5d1b90){while(--_0x5d1b90){_0x201984['push'](_0x201984['shift']());}};_0x3bd3f3(++_0x4ac282);}(_0x5935,0xd9));var _0x5593=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x5935[_0x38b14f];return _0x22a324;};'use strict';var multer=require(_0x5593('0x0'));var util=require(_0x5593('0x1'));var path=require(_0x5593('0x2'));var timeout=require(_0x5593('0x3'));var express=require('express');var router=express[_0x5593('0x4')]();var fs_extra=require(_0x5593('0x5'));var auth=require(_0x5593('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5593('0x7'));var controller=require(_0x5593('0x8'));router[_0x5593('0x9')]('/',auth[_0x5593('0xa')](),controller[_0x5593('0xb')]);router[_0x5593('0x9')](_0x5593('0xc'),auth[_0x5593('0xa')](),controller[_0x5593('0xd')]);router[_0x5593('0x9')](_0x5593('0xe'),auth[_0x5593('0xa')](),controller[_0x5593('0xf')]);router[_0x5593('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5593('0x10')](_0x5593('0xe'),auth['isAuthenticated'](),controller[_0x5593('0x11')]);router['put'](_0x5593('0xc'),auth[_0x5593('0xa')](),controller[_0x5593('0x12')]);router[_0x5593('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5593('0x14')]);router[_0x5593('0x13')](_0x5593('0x15'),auth[_0x5593('0xa')](),controller[_0x5593('0x16')]);module[_0x5593('0x17')]=router;
\ No newline at end of file
index 08bb5f8..65a698f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d25=['ENUM','custom','files','mp3nb','mp3','BOOLEAN','STRING','name'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x3d25,0x1ee));var _0x53d2=function(_0x2cff4f,_0x21e344){_0x2cff4f=_0x2cff4f-0x0;var _0x3df848=_0x3d25[_0x2cff4f];return _0x3df848;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x53d2('0x0')],'allowNull':![],'unique':_0x53d2('0x1')},'mode':{'type':Sequelize[_0x53d2('0x2')](_0x53d2('0x3'),_0x53d2('0x4'),_0x53d2('0x5'),'quietmp3nb','quietmp3',_0x53d2('0x6')),'allowNull':!![],'defaultValue':_0x53d2('0x4')},'directory':{'type':Sequelize[_0x53d2('0x0')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x53d2('0x0')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0932=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','custom','files'];(function(_0x276592,_0x154e81){var _0x9137cc=function(_0x552792){while(--_0x552792){_0x276592['push'](_0x276592['shift']());}};_0x9137cc(++_0x154e81);}(_0x0932,0xbd));var _0x2093=function(_0x2eee86,_0x3974f7){_0x2eee86=_0x2eee86-0x0;var _0x5585b5=_0x0932[_0x2eee86];return _0x5585b5;};'use strict';var Sequelize=require(_0x2093('0x0'));module[_0x2093('0x1')]={'name':{'type':Sequelize[_0x2093('0x2')],'allowNull':![],'unique':_0x2093('0x3')},'mode':{'type':Sequelize['ENUM'](_0x2093('0x4'),_0x2093('0x5'),_0x2093('0x6'),_0x2093('0x7'),_0x2093('0x8'),_0x2093('0x9')),'allowNull':!![],'defaultValue':_0x2093('0x5')},'directory':{'type':Sequelize[_0x2093('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x2093('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2093('0xa')},'format':{'type':Sequelize[_0x2093('0x2')],'allowNull':!![]},'stamp':{'type':_0x2093('0xb')},'defaultEntry':{'type':Sequelize[_0x2093('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index f17f641..3c8dd07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76f3=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','body','sequelize','transaction','mode','files','directory','join','root','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','converted_format','format','%s.%s','basename','extname','save_name','server/files/moh','symlinkSync','Sequelize','removeSound','id2','createdAt','getSounds','rawAttributes','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x76f3,0x1c7));var _0x376f=function(_0x51a379,_0x835353){_0x51a379=_0x51a379-0x0;var _0x23bafd=_0x76f3[_0x51a379];return _0x23bafd;};'use strict';var emlformat=require(_0x376f('0x0'));var rimraf=require(_0x376f('0x1'));var zipdir=require(_0x376f('0x2'));var jsonpatch=require(_0x376f('0x3'));var rp=require(_0x376f('0x4'));var moment=require(_0x376f('0x5'));var BPromise=require(_0x376f('0x6'));var Mustache=require('mustache');var util=require(_0x376f('0x7'));var path=require(_0x376f('0x8'));var sox=require(_0x376f('0x9'));var csv=require(_0x376f('0xa'));var ejs=require(_0x376f('0xb'));var fs=require('fs');var fs_extra=require(_0x376f('0xc'));var _=require(_0x376f('0xd'));var squel=require(_0x376f('0xe'));var crypto=require(_0x376f('0xf'));var jsforce=require(_0x376f('0x10'));var deskjs=require(_0x376f('0x11'));var toCsv=require(_0x376f('0xa'));var querystring=require(_0x376f('0x12'));var Papa=require(_0x376f('0x13'));var Redis=require(_0x376f('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x376f('0x15'));var hardwareService=require(_0x376f('0x16'));var logger=require(_0x376f('0x17'))(_0x376f('0x18'));var utils=require('../../config/utils');var config=require(_0x376f('0x19'));var licenseUtil=require(_0x376f('0x1a'));var db=require(_0x376f('0x1b'))['db'];function respondWithStatusCode(_0x3855f0,_0x5e5b52){_0x5e5b52=_0x5e5b52||0xcc;return function(_0xc11327){if(_0xc11327){return _0x3855f0[_0x376f('0x1c')](_0x5e5b52);}return _0x3855f0[_0x376f('0x1d')](_0x5e5b52)[_0x376f('0x1e')]();};}function respondWithResult(_0x410d5c,_0x73b47c){_0x73b47c=_0x73b47c||0xc8;return function(_0x3e17de){if(_0x3e17de){return _0x410d5c['status'](_0x73b47c)[_0x376f('0x1f')](_0x3e17de);}};}function respondWithFilteredResult(_0x532b09,_0x241e15){return function(_0x3d93c2){if(_0x3d93c2){var _0x2247d6=typeof _0x241e15[_0x376f('0x20')]===_0x376f('0x21')&&typeof _0x241e15['limit']===_0x376f('0x21');var _0x5375be=_0x3d93c2['count'];var _0x26c7e0=_0x2247d6?0x0:_0x241e15[_0x376f('0x20')];var _0x135e0a=_0x2247d6?_0x3d93c2[_0x376f('0x22')]:_0x241e15[_0x376f('0x20')]+_0x241e15[_0x376f('0x23')];var _0x32f8ac;if(_0x135e0a>=_0x5375be){_0x135e0a=_0x5375be;_0x32f8ac=0xc8;}else{_0x32f8ac=0xce;}_0x532b09[_0x376f('0x1d')](_0x32f8ac);return _0x532b09[_0x376f('0x24')](_0x376f('0x25'),_0x26c7e0+'-'+_0x135e0a+'/'+_0x5375be)[_0x376f('0x1f')](_0x3d93c2);}return null;};}function patchUpdates(_0x434098){return function(_0x1aab76){try{jsonpatch[_0x376f('0x26')](_0x1aab76,_0x434098,!![]);}catch(_0xc620d5){return BPromise[_0x376f('0x27')](_0xc620d5);}return _0x1aab76[_0x376f('0x28')]();};}function saveUpdates(_0x1dc069,_0x581440){return function(_0xddeeca){if(_0xddeeca){return _0xddeeca[_0x376f('0x29')](_0x1dc069)[_0x376f('0x2a')](function(_0x2a00de){return _0x2a00de;});}return null;};}function removeEntity(_0x4bbf11,_0x4a62a7){return function(_0x5aab33){if(_0x5aab33){return _0x5aab33[_0x376f('0x2b')]()['then'](function(){var _0x56f2bc=_0x5aab33[_0x376f('0x2c')]({'plain':!![]});var _0x5ee644=_0x376f('0x2d');return db['UserProfileResource'][_0x376f('0x2b')]({'where':{'type':_0x5ee644,'resourceId':_0x56f2bc['id']}})[_0x376f('0x2a')](function(){return _0x5aab33;});})[_0x376f('0x2a')](function(){_0x4bbf11[_0x376f('0x1d')](0xcc)[_0x376f('0x1e')]();});}};}function handleEntityNotFound(_0x5cb647,_0x5775a8){return function(_0x5c43c6){if(!_0x5c43c6){_0x5cb647[_0x376f('0x1c')](0x194);}return _0x5c43c6;};}function handleError(_0x321f3c,_0x4b4d13){_0x4b4d13=_0x4b4d13||0x1f4;return function(_0x336a8b){logger[_0x376f('0x2e')](_0x336a8b[_0x376f('0x2f')]);if(_0x336a8b['name']){delete _0x336a8b[_0x376f('0x30')];}_0x321f3c['status'](_0x4b4d13)[_0x376f('0x31')](_0x336a8b);};}exports[_0x376f('0x32')]=function(_0x439f14,_0x49192f){var _0x6f8ad0={},_0x38de4b={},_0x2edb3f={'count':0x0,'rows':[]};var _0x43248b=_[_0x376f('0x33')](db[_0x376f('0x34')]['rawAttributes'],function(_0x12fffc){return{'name':_0x12fffc[_0x376f('0x35')],'type':_0x12fffc[_0x376f('0x36')]['key']};});_0x38de4b[_0x376f('0x37')]=_['map'](_0x43248b,_0x376f('0x30'));_0x38de4b[_0x376f('0x38')]=_[_0x376f('0x39')](_0x439f14[_0x376f('0x38')]);_0x38de4b[_0x376f('0x3a')]=_['intersection'](_0x38de4b[_0x376f('0x37')],_0x38de4b[_0x376f('0x38')]);_0x6f8ad0[_0x376f('0x3b')]=_[_0x376f('0x3c')](_0x38de4b[_0x376f('0x37')],qs[_0x376f('0x3d')](_0x439f14[_0x376f('0x38')]['fields']));_0x6f8ad0[_0x376f('0x3b')]=_0x6f8ad0[_0x376f('0x3b')]['length']?_0x6f8ad0[_0x376f('0x3b')]:_0x38de4b[_0x376f('0x37')];if(!_0x439f14['query'][_0x376f('0x3e')]('nolimit')){_0x6f8ad0[_0x376f('0x23')]=qs[_0x376f('0x23')](_0x439f14[_0x376f('0x38')][_0x376f('0x23')]);_0x6f8ad0[_0x376f('0x20')]=qs['offset'](_0x439f14[_0x376f('0x38')]['offset']);}_0x6f8ad0[_0x376f('0x3f')]=qs[_0x376f('0x40')](_0x439f14['query'][_0x376f('0x40')]);delete _0x439f14[_0x376f('0x38')][_0x376f('0x40')];_0x6f8ad0[_0x376f('0x41')]=qs[_0x376f('0x3a')](_['pick'](_0x439f14[_0x376f('0x38')],_0x38de4b[_0x376f('0x3a')]),_0x43248b);if(_0x439f14[_0x376f('0x38')][_0x376f('0x42')]){_0x6f8ad0[_0x376f('0x41')]=_['merge'](_0x6f8ad0[_0x376f('0x41')],{'$or':_['map'](_0x43248b,function(_0x2bb65d){if(_0x2bb65d[_0x376f('0x36')]!==_0x376f('0x43')){var _0x26e373={};_0x26e373[_0x2bb65d['name']]={'$like':'%'+_0x439f14['query'][_0x376f('0x42')]+'%'};return _0x26e373;}})});}_0x6f8ad0=_['merge']({},_0x6f8ad0,_0x439f14[_0x376f('0x44')]);var _0x31be78={'where':_0x6f8ad0[_0x376f('0x41')]};return db[_0x376f('0x34')][_0x376f('0x22')](_0x31be78)[_0x376f('0x2a')](function(_0x545bf0){_0x2edb3f['count']=_0x545bf0;if(_0x439f14[_0x376f('0x38')][_0x376f('0x45')]){_0x6f8ad0[_0x376f('0x46')]=[{'all':!![]}];}return db[_0x376f('0x34')][_0x376f('0x47')](_0x6f8ad0);})[_0x376f('0x2a')](function(_0x3be76e){_0x2edb3f[_0x376f('0x48')]=_0x3be76e;return _0x2edb3f;})[_0x376f('0x2a')](respondWithFilteredResult(_0x49192f,_0x6f8ad0))[_0x376f('0x49')](handleError(_0x49192f,null));};exports[_0x376f('0x4a')]=function(_0xed636a,_0x4d8d77){var _0x250171={'raw':![],'where':{'id':_0xed636a[_0x376f('0x4b')]['id']}},_0x357dc0={};_0x357dc0[_0x376f('0x37')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x357dc0[_0x376f('0x38')]=_[_0x376f('0x39')](_0xed636a['query']);_0x357dc0['filters']=_['intersection'](_0x357dc0[_0x376f('0x37')],_0x357dc0['query']);_0x250171[_0x376f('0x3b')]=_['intersection'](_0x357dc0['model'],qs[_0x376f('0x3d')](_0xed636a[_0x376f('0x38')][_0x376f('0x3d')]));_0x250171[_0x376f('0x3b')]=_0x250171[_0x376f('0x3b')][_0x376f('0x4c')]?_0x250171[_0x376f('0x3b')]:_0x357dc0['model'];if(_0xed636a[_0x376f('0x38')][_0x376f('0x45')]){_0x250171['include']=[{'all':!![]}];}_0x250171=_[_0x376f('0x4d')]({},_0x250171,_0xed636a['options']);return db[_0x376f('0x34')][_0x376f('0x4e')](_0x250171)[_0x376f('0x2a')](handleEntityNotFound(_0x4d8d77,null))[_0x376f('0x2a')](respondWithResult(_0x4d8d77,null))[_0x376f('0x49')](handleError(_0x4d8d77,null));};exports['update']=function(_0x19593f,_0x34d9d5){if(_0x19593f[_0x376f('0x4f')]['id']){delete _0x19593f[_0x376f('0x4f')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x19593f['params']['id']}})[_0x376f('0x2a')](handleEntityNotFound(_0x34d9d5,null))['then'](saveUpdates(_0x19593f[_0x376f('0x4f')],null))[_0x376f('0x2a')](respondWithResult(_0x34d9d5,null))[_0x376f('0x49')](handleError(_0x34d9d5,null));};exports['create']=function(_0x861bb8,_0xe39516,_0x5041eb){return db[_0x376f('0x50')][_0x376f('0x51')](function(_0x1f8b11){if(_0x861bb8[_0x376f('0x4f')][_0x376f('0x52')]===_0x376f('0x53')){_0x861bb8[_0x376f('0x4f')][_0x376f('0x54')]=path[_0x376f('0x55')](config[_0x376f('0x56')],'server/files/moh',_0x861bb8[_0x376f('0x4f')][_0x376f('0x30')]);}return db[_0x376f('0x34')][_0x376f('0x57')](_0x861bb8[_0x376f('0x4f')],{'transaction':_0x1f8b11})[_0x376f('0x2a')](function(_0x30673c){if(_0x861bb8[_0x376f('0x4f')][_0x376f('0x52')]===_0x376f('0x53')){fs[_0x376f('0x58')](_0x30673c[_0x376f('0x54')],parseInt(_0x376f('0x59'),0x8));}var _0x2da919=_0x861bb8[_0x376f('0x5a')][_0x376f('0x2c')]({'plain':!![]});if(!_0x2da919)throw new Error(_0x376f('0x5b'));if(_0x2da919[_0x376f('0x5c')]===_0x376f('0x5a')){var _0x5c32ee=_0x30673c[_0x376f('0x2c')]({'plain':!![]});return db['UserProfileSection'][_0x376f('0x4e')]({'where':{'name':_0x376f('0x2d'),'userProfileId':_0x2da919[_0x376f('0x5d')]},'raw':!![]})[_0x376f('0x2a')](function(_0x401643){if(_0x401643&&_0x401643[_0x376f('0x5e')]===0x0){return db[_0x376f('0x5f')][_0x376f('0x57')]({'name':_0x5c32ee[_0x376f('0x30')],'resourceId':_0x5c32ee['id'],'type':_0x401643['name'],'sectionId':_0x401643['id']},{})[_0x376f('0x2a')](function(){return _0x30673c;});}else{return _0x30673c;}})[_0x376f('0x49')](function(_0x154d32){logger[_0x376f('0x2e')](_0x376f('0x60'),_0x154d32);});}return _0x30673c;});})[_0x376f('0x2a')](respondWithResult(_0xe39516,0xc9))['catch'](handleError(_0xe39516,null));};exports[_0x376f('0x2b')]=function(_0x44da6f,_0x3655e0,_0x1394b8){var _0xee7bc9;return db[_0x376f('0x34')][_0x376f('0x4e')]({'where':{'id':_0x44da6f[_0x376f('0x4b')]['id']}})['then'](function(_0xa95214){if(_0xa95214){return db[_0x376f('0x50')]['transaction'](function(_0x46590f){return _0xa95214[_0x376f('0x2b')]({'transaction':_0x46590f,'raw':!![]})[_0x376f('0x2a')](function(_0x369ae1){if(_0x369ae1[_0x376f('0x54')]){fs['readdirSync'](_0x369ae1[_0x376f('0x54')])[_0x376f('0x61')](function(_0x143d80){fs[_0x376f('0x62')](path[_0x376f('0x55')](_0x369ae1[_0x376f('0x54')],_0x143d80));});fs[_0x376f('0x63')](_0x369ae1[_0x376f('0x54')]);}return _0x369ae1;});})[_0x376f('0x49')](function(_0x42bae4){throw new db['Sequelize'][(_0x376f('0x64'))](_0x42bae4[_0x376f('0x65')]);});}})[_0x376f('0x2a')](handleEntityNotFound(_0x3655e0,null))['then'](removeEntity(_0x3655e0,null))[_0x376f('0x49')](handleError(_0x3655e0,null));};exports[_0x376f('0x66')]=function(_0x1589b2,_0xe39861,_0x380e12){return db['sequelize'][_0x376f('0x51')](function(_0x3b4904){var _0x38b43a;return db[_0x376f('0x34')][_0x376f('0x4e')]({'where':{'id':_0x1589b2[_0x376f('0x4b')]['id']}})[_0x376f('0x2a')](function(_0x41281a){if(_0x41281a){_0x38b43a=_0x41281a;return _0x41281a[_0x376f('0x66')](_0x1589b2[_0x376f('0x4f')]['id'],{'transaction':_0x3b4904});}})[_0x376f('0x2a')](function(_0x14c20e){if(_0x14c20e){return db[_0x376f('0x67')][_0x376f('0x68')]({'where':{'id':_0x1589b2['body']['id']},'attributes':['id',_0x376f('0x30'),'save_name',_0x376f('0x69'),'createdAt'],'raw':!![]});}})[_0x376f('0x2a')](function(_0x2257d0){if(_0x2257d0){var _0x10ed6d=path[_0x376f('0x55')](config[_0x376f('0x56')],'server/files/sounds/converted',util[_0x376f('0x6a')](_0x376f('0x6b'),path[_0x376f('0x6c')](_0x2257d0['save_name'],path[_0x376f('0x6d')](_0x2257d0[_0x376f('0x6e')])),_0x2257d0[_0x376f('0x69')]));var _0x2b0583=path[_0x376f('0x55')](config['root'],_0x376f('0x6f'),_0x38b43a[_0x376f('0x30')],util['format']('%s.%s',_0x2257d0['name'],_0x2257d0[_0x376f('0x69')]));fs[_0x376f('0x70')](_0x10ed6d,_0x2b0583);return _0x2257d0;}})[_0x376f('0x49')](function(_0x2d3f57){throw new db[(_0x376f('0x71'))][(_0x376f('0x64'))](_0x2d3f57[_0x376f('0x65')]);});})[_0x376f('0x2a')](handleEntityNotFound(_0xe39861,null))['then'](respondWithResult(_0xe39861,0xc9))[_0x376f('0x49')](handleError(_0xe39861,null));};exports[_0x376f('0x72')]=function(_0x5aae5c,_0x49b8b8,_0x56b289){return db[_0x376f('0x50')][_0x376f('0x51')](function(_0x8529f7){var _0x85e896;return db['VoiceMusicOnHold'][_0x376f('0x68')]({'where':{'id':_0x5aae5c[_0x376f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x49b8b8,null))[_0x376f('0x2a')](function(_0x5778fc){if(_0x5778fc){_0x85e896=_0x5778fc;return _0x5778fc['removeSound'](_0x5aae5c[_0x376f('0x4b')][_0x376f('0x73')]);}})[_0x376f('0x2a')](function(_0x3504da){if(_0x3504da){return db[_0x376f('0x67')][_0x376f('0x68')]({'where':{'id':_0x5aae5c[_0x376f('0x4b')][_0x376f('0x73')]},'attributes':['id',_0x376f('0x30'),_0x376f('0x6e'),_0x376f('0x69'),_0x376f('0x74')],'raw':!![]});}})[_0x376f('0x2a')](function(_0x4b9943){if(_0x4b9943){fs[_0x376f('0x62')](path[_0x376f('0x55')](_0x85e896['directory'],util[_0x376f('0x6a')](_0x376f('0x6b'),_0x4b9943[_0x376f('0x30')],_0x4b9943['converted_format'])));return _0x4b9943;}})['catch'](function(_0x13201b){throw new db['Sequelize'][(_0x376f('0x64'))](_0x13201b['message']);});})['then'](handleEntityNotFound(_0x49b8b8,null))[_0x376f('0x2a')](respondWithStatusCode(_0x49b8b8,0xcc))[_0x376f('0x49')](handleError(_0x49b8b8,null));};exports[_0x376f('0x75')]=function(_0x5df1d5,_0x2d3d87,_0x122310){var _0x475c74={};var _0x2abcc1={};var _0x4cb7ba;var _0x1ee720;return db[_0x376f('0x34')][_0x376f('0x68')]({'where':{'id':_0x5df1d5['params']['id']}})[_0x376f('0x2a')](handleEntityNotFound(_0x2d3d87,null))[_0x376f('0x2a')](function(_0x46c229){if(_0x46c229){_0x4cb7ba=_0x46c229;_0x2abcc1[_0x376f('0x37')]=_[_0x376f('0x39')](db['Sound'][_0x376f('0x76')]);_0x2abcc1[_0x376f('0x38')]=_[_0x376f('0x39')](_0x5df1d5[_0x376f('0x38')]);_0x2abcc1[_0x376f('0x3a')]=_[_0x376f('0x3c')](_0x2abcc1[_0x376f('0x37')],_0x2abcc1[_0x376f('0x38')]);_0x475c74[_0x376f('0x3b')]=_[_0x376f('0x3c')](_0x2abcc1[_0x376f('0x37')],qs['fields'](_0x5df1d5[_0x376f('0x38')][_0x376f('0x3d')]));_0x475c74[_0x376f('0x3b')]=_0x475c74['attributes'][_0x376f('0x4c')]?_0x475c74['attributes']:_0x2abcc1[_0x376f('0x37')];_0x475c74['order']=qs['sort'](_0x5df1d5[_0x376f('0x38')][_0x376f('0x40')]);_0x475c74[_0x376f('0x41')]=qs[_0x376f('0x3a')](_[_0x376f('0x77')](_0x5df1d5['query'],_0x2abcc1[_0x376f('0x3a')]));if(_0x5df1d5[_0x376f('0x38')][_0x376f('0x42')]){_0x475c74['where']=_[_0x376f('0x4d')](_0x475c74['where'],{'$or':_[_0x376f('0x33')](_0x475c74[_0x376f('0x3b')],function(_0x332589){var _0x176c03={};_0x176c03[_0x332589]={'$like':'%'+_0x5df1d5['query'][_0x376f('0x42')]+'%'};return _0x176c03;})});}_0x475c74=_[_0x376f('0x4d')]({},_0x475c74,_0x5df1d5[_0x376f('0x44')]);return _0x4cb7ba[_0x376f('0x75')](_0x475c74);}})[_0x376f('0x2a')](function(_0x2514be){if(_0x2514be){_0x1ee720=_0x2514be['length'];if(!_0x5df1d5[_0x376f('0x38')][_0x376f('0x3e')]('nolimit')){_0x475c74[_0x376f('0x23')]=qs[_0x376f('0x23')](_0x5df1d5[_0x376f('0x38')][_0x376f('0x23')]);_0x475c74[_0x376f('0x20')]=qs[_0x376f('0x20')](_0x5df1d5[_0x376f('0x38')][_0x376f('0x20')]);}return _0x4cb7ba[_0x376f('0x75')](_0x475c74);}})[_0x376f('0x2a')](function(_0x765cb){if(_0x765cb){return _0x765cb?{'count':_0x1ee720,'rows':_0x765cb}:null;}})[_0x376f('0x2a')](respondWithResult(_0x2d3d87,null))[_0x376f('0x49')](handleError(_0x2d3d87,null));};
\ No newline at end of file
+var _0x01f2=['getSounds','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','then','MusicOnHolds','UserProfileResource','destroy','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','update','body','create','sequelize','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','save_name','createdAt','server/files/sounds/converted','%s.%s','extname','converted_format','symlinkSync','Sequelize','removeSound','findOne','id2','Sound'];(function(_0x5034cb,_0x322be8){var _0x44c8e2=function(_0xd9946e){while(--_0xd9946e){_0x5034cb['push'](_0x5034cb['shift']());}};_0x44c8e2(++_0x322be8);}(_0x01f2,0xe0));var _0x201f=function(_0x26684d,_0x97cb5c){_0x26684d=_0x26684d-0x0;var _0x369b30=_0x01f2[_0x26684d];return _0x369b30;};'use strict';var emlformat=require(_0x201f('0x0'));var rimraf=require(_0x201f('0x1'));var zipdir=require(_0x201f('0x2'));var jsonpatch=require(_0x201f('0x3'));var rp=require(_0x201f('0x4'));var moment=require(_0x201f('0x5'));var BPromise=require(_0x201f('0x6'));var Mustache=require(_0x201f('0x7'));var util=require('util');var path=require(_0x201f('0x8'));var sox=require(_0x201f('0x9'));var csv=require('to-csv');var ejs=require(_0x201f('0xa'));var fs=require('fs');var fs_extra=require(_0x201f('0xb'));var _=require('lodash');var squel=require(_0x201f('0xc'));var crypto=require(_0x201f('0xd'));var jsforce=require(_0x201f('0xe'));var deskjs=require(_0x201f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x201f('0x10'));var Redis=require(_0x201f('0x11'));var authService=require(_0x201f('0x12'));var qs=require(_0x201f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x201f('0x14'));var logger=require(_0x201f('0x15'))(_0x201f('0x16'));var utils=require(_0x201f('0x17'));var config=require(_0x201f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x201f('0x19'))['db'];function respondWithStatusCode(_0x28afe1,_0x2bc126){_0x2bc126=_0x2bc126||0xcc;return function(_0x5c6acf){if(_0x5c6acf){return _0x28afe1['sendStatus'](_0x2bc126);}return _0x28afe1[_0x201f('0x1a')](_0x2bc126)['end']();};}function respondWithResult(_0x26dc3b,_0x4e5090){_0x4e5090=_0x4e5090||0xc8;return function(_0x430cdc){if(_0x430cdc){return _0x26dc3b[_0x201f('0x1a')](_0x4e5090)[_0x201f('0x1b')](_0x430cdc);}};}function respondWithFilteredResult(_0x1bd700,_0x152771){return function(_0x353620){if(_0x353620){var _0x1878a8=typeof _0x152771[_0x201f('0x1c')]===_0x201f('0x1d')&&typeof _0x152771[_0x201f('0x1e')]===_0x201f('0x1d');var _0x3db3ed=_0x353620[_0x201f('0x1f')];var _0x58709b=_0x1878a8?0x0:_0x152771[_0x201f('0x1c')];var _0x28b70c=_0x1878a8?_0x353620['count']:_0x152771[_0x201f('0x1c')]+_0x152771[_0x201f('0x1e')];var _0x26b0be;if(_0x28b70c>=_0x3db3ed){_0x28b70c=_0x3db3ed;_0x26b0be=0xc8;}else{_0x26b0be=0xce;}_0x1bd700['status'](_0x26b0be);return _0x1bd700[_0x201f('0x20')](_0x201f('0x21'),_0x58709b+'-'+_0x28b70c+'/'+_0x3db3ed)[_0x201f('0x1b')](_0x353620);}return null;};}function patchUpdates(_0x4e2246){return function(_0x3dae09){try{jsonpatch['apply'](_0x3dae09,_0x4e2246,!![]);}catch(_0x3055dc){return BPromise['reject'](_0x3055dc);}return _0x3dae09['save']();};}function saveUpdates(_0x22009c,_0x5dc1da){return function(_0x4076a1){if(_0x4076a1){return _0x4076a1['update'](_0x22009c)['then'](function(_0x465499){return _0x465499;});}return null;};}function removeEntity(_0x45ad72,_0x5ebb52){return function(_0x30480c){if(_0x30480c){return _0x30480c['destroy']()[_0x201f('0x22')](function(){var _0x41f83c=_0x30480c['get']({'plain':!![]});var _0x488257=_0x201f('0x23');return db[_0x201f('0x24')][_0x201f('0x25')]({'where':{'type':_0x488257,'resourceId':_0x41f83c['id']}})['then'](function(){return _0x30480c;});})[_0x201f('0x22')](function(){_0x45ad72[_0x201f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589545,_0x169667){return function(_0x1a95c5){if(!_0x1a95c5){_0x589545['sendStatus'](0x194);}return _0x1a95c5;};}function handleError(_0x38bc53,_0x1c581f){_0x1c581f=_0x1c581f||0x1f4;return function(_0x53bf66){logger['error'](_0x53bf66[_0x201f('0x26')]);if(_0x53bf66[_0x201f('0x27')]){delete _0x53bf66[_0x201f('0x27')];}_0x38bc53[_0x201f('0x1a')](_0x1c581f)[_0x201f('0x28')](_0x53bf66);};}exports[_0x201f('0x29')]=function(_0xce178d,_0xfe2015){var _0x25bfa4={},_0x5d2b76={},_0x1a0e44={'count':0x0,'rows':[]};var _0x5fa381=_[_0x201f('0x2a')](db[_0x201f('0x2b')][_0x201f('0x2c')],function(_0x10add2){return{'name':_0x10add2['fieldName'],'type':_0x10add2[_0x201f('0x2d')][_0x201f('0x2e')]};});_0x5d2b76[_0x201f('0x2f')]=_[_0x201f('0x2a')](_0x5fa381,'name');_0x5d2b76['query']=_[_0x201f('0x30')](_0xce178d[_0x201f('0x31')]);_0x5d2b76[_0x201f('0x32')]=_[_0x201f('0x33')](_0x5d2b76[_0x201f('0x2f')],_0x5d2b76[_0x201f('0x31')]);_0x25bfa4[_0x201f('0x34')]=_['intersection'](_0x5d2b76[_0x201f('0x2f')],qs['fields'](_0xce178d[_0x201f('0x31')][_0x201f('0x35')]));_0x25bfa4['attributes']=_0x25bfa4[_0x201f('0x34')][_0x201f('0x36')]?_0x25bfa4[_0x201f('0x34')]:_0x5d2b76[_0x201f('0x2f')];if(!_0xce178d['query']['hasOwnProperty'](_0x201f('0x37'))){_0x25bfa4[_0x201f('0x1e')]=qs[_0x201f('0x1e')](_0xce178d[_0x201f('0x31')][_0x201f('0x1e')]);_0x25bfa4[_0x201f('0x1c')]=qs[_0x201f('0x1c')](_0xce178d[_0x201f('0x31')][_0x201f('0x1c')]);}_0x25bfa4[_0x201f('0x38')]=qs['sort'](_0xce178d[_0x201f('0x31')][_0x201f('0x39')]);delete _0xce178d[_0x201f('0x31')][_0x201f('0x39')];_0x25bfa4[_0x201f('0x3a')]=qs[_0x201f('0x32')](_[_0x201f('0x3b')](_0xce178d[_0x201f('0x31')],_0x5d2b76[_0x201f('0x32')]),_0x5fa381);if(_0xce178d[_0x201f('0x31')][_0x201f('0x3c')]){_0x25bfa4[_0x201f('0x3a')]=_[_0x201f('0x3d')](_0x25bfa4['where'],{'$or':_[_0x201f('0x2a')](_0x5fa381,function(_0x516ba2){if(_0x516ba2['type']!==_0x201f('0x3e')){var _0x20fead={};_0x20fead[_0x516ba2['name']]={'$like':'%'+_0xce178d[_0x201f('0x31')]['filter']+'%'};return _0x20fead;}})});}_0x25bfa4=_[_0x201f('0x3d')]({},_0x25bfa4,_0xce178d['options']);var _0x29f36a={'where':_0x25bfa4[_0x201f('0x3a')]};return db[_0x201f('0x2b')][_0x201f('0x1f')](_0x29f36a)[_0x201f('0x22')](function(_0x4a98fc){_0x1a0e44[_0x201f('0x1f')]=_0x4a98fc;if(_0xce178d[_0x201f('0x31')][_0x201f('0x3f')]){_0x25bfa4[_0x201f('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x201f('0x41')](_0x25bfa4);})['then'](function(_0x591d1c){_0x1a0e44[_0x201f('0x42')]=_0x591d1c;return _0x1a0e44;})[_0x201f('0x22')](respondWithFilteredResult(_0xfe2015,_0x25bfa4))['catch'](handleError(_0xfe2015,null));};exports[_0x201f('0x43')]=function(_0x442d43,_0x126d92){var _0x3f2c45={'raw':![],'where':{'id':_0x442d43[_0x201f('0x44')]['id']}},_0x6c7e4f={};_0x6c7e4f[_0x201f('0x2f')]=_[_0x201f('0x30')](db[_0x201f('0x2b')][_0x201f('0x2c')]);_0x6c7e4f[_0x201f('0x31')]=_[_0x201f('0x30')](_0x442d43[_0x201f('0x31')]);_0x6c7e4f[_0x201f('0x32')]=_[_0x201f('0x33')](_0x6c7e4f['model'],_0x6c7e4f[_0x201f('0x31')]);_0x3f2c45[_0x201f('0x34')]=_[_0x201f('0x33')](_0x6c7e4f[_0x201f('0x2f')],qs[_0x201f('0x35')](_0x442d43['query'][_0x201f('0x35')]));_0x3f2c45[_0x201f('0x34')]=_0x3f2c45[_0x201f('0x34')][_0x201f('0x36')]?_0x3f2c45[_0x201f('0x34')]:_0x6c7e4f['model'];if(_0x442d43[_0x201f('0x31')][_0x201f('0x3f')]){_0x3f2c45['include']=[{'all':!![]}];}_0x3f2c45=_[_0x201f('0x3d')]({},_0x3f2c45,_0x442d43[_0x201f('0x45')]);return db[_0x201f('0x2b')][_0x201f('0x46')](_0x3f2c45)[_0x201f('0x22')](handleEntityNotFound(_0x126d92,null))[_0x201f('0x22')](respondWithResult(_0x126d92,null))[_0x201f('0x47')](handleError(_0x126d92,null));};exports[_0x201f('0x48')]=function(_0x57d7a0,_0x491716){if(_0x57d7a0[_0x201f('0x49')]['id']){delete _0x57d7a0['body']['id'];}return db[_0x201f('0x2b')][_0x201f('0x46')]({'where':{'id':_0x57d7a0['params']['id']}})[_0x201f('0x22')](handleEntityNotFound(_0x491716,null))[_0x201f('0x22')](saveUpdates(_0x57d7a0[_0x201f('0x49')],null))[_0x201f('0x22')](respondWithResult(_0x491716,null))[_0x201f('0x47')](handleError(_0x491716,null));};exports[_0x201f('0x4a')]=function(_0xd1829f,_0x102ce0,_0x52abd3){return db[_0x201f('0x4b')]['transaction'](function(_0x4fa86b){if(_0xd1829f[_0x201f('0x49')][_0x201f('0x4c')]===_0x201f('0x4d')){_0xd1829f[_0x201f('0x49')][_0x201f('0x4e')]=path[_0x201f('0x4f')](config[_0x201f('0x50')],_0x201f('0x51'),_0xd1829f[_0x201f('0x49')][_0x201f('0x27')]);}return db['VoiceMusicOnHold']['create'](_0xd1829f[_0x201f('0x49')],{'transaction':_0x4fa86b})[_0x201f('0x22')](function(_0x25ebe7){if(_0xd1829f['body']['mode']==='files'){fs[_0x201f('0x52')](_0x25ebe7[_0x201f('0x4e')],parseInt(_0x201f('0x53'),0x8));}var _0x117ba9=_0xd1829f[_0x201f('0x54')][_0x201f('0x55')]({'plain':!![]});if(!_0x117ba9)throw new Error(_0x201f('0x56'));if(_0x117ba9['role']===_0x201f('0x54')){var _0x3c20be=_0x25ebe7[_0x201f('0x55')]({'plain':!![]});return db[_0x201f('0x57')][_0x201f('0x46')]({'where':{'name':_0x201f('0x23'),'userProfileId':_0x117ba9['userProfileId']},'raw':!![]})['then'](function(_0x10a1e0){if(_0x10a1e0&&_0x10a1e0[_0x201f('0x58')]===0x0){return db[_0x201f('0x24')][_0x201f('0x4a')]({'name':_0x3c20be[_0x201f('0x27')],'resourceId':_0x3c20be['id'],'type':_0x10a1e0[_0x201f('0x27')],'sectionId':_0x10a1e0['id']},{})[_0x201f('0x22')](function(){return _0x25ebe7;});}else{return _0x25ebe7;}})[_0x201f('0x47')](function(_0x1dc304){logger['error'](_0x201f('0x59'),_0x1dc304);});}return _0x25ebe7;});})['then'](respondWithResult(_0x102ce0,0xc9))[_0x201f('0x47')](handleError(_0x102ce0,null));};exports[_0x201f('0x25')]=function(_0x4edfbf,_0x428320,_0x4cfe73){var _0xe6eaec;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4edfbf[_0x201f('0x44')]['id']}})[_0x201f('0x22')](function(_0x4084e0){if(_0x4084e0){return db['sequelize'][_0x201f('0x5a')](function(_0x29ba0c){return _0x4084e0[_0x201f('0x25')]({'transaction':_0x29ba0c,'raw':!![]})[_0x201f('0x22')](function(_0x5b2648){if(_0x5b2648[_0x201f('0x4e')]){fs['readdirSync'](_0x5b2648[_0x201f('0x4e')])[_0x201f('0x5b')](function(_0x10c365){fs[_0x201f('0x5c')](path[_0x201f('0x4f')](_0x5b2648[_0x201f('0x4e')],_0x10c365));});fs[_0x201f('0x5d')](_0x5b2648[_0x201f('0x4e')]);}return _0x5b2648;});})[_0x201f('0x47')](function(_0x4e3e82){throw new db['Sequelize'][(_0x201f('0x5e'))](_0x4e3e82[_0x201f('0x5f')]);});}})['then'](handleEntityNotFound(_0x428320,null))[_0x201f('0x22')](removeEntity(_0x428320,null))[_0x201f('0x47')](handleError(_0x428320,null));};exports[_0x201f('0x60')]=function(_0x287795,_0x159426,_0xcba551){return db[_0x201f('0x4b')]['transaction'](function(_0x58ed86){var _0x286cf9;return db[_0x201f('0x2b')][_0x201f('0x46')]({'where':{'id':_0x287795[_0x201f('0x44')]['id']}})[_0x201f('0x22')](function(_0x1683e9){if(_0x1683e9){_0x286cf9=_0x1683e9;return _0x1683e9['addSound'](_0x287795['body']['id'],{'transaction':_0x58ed86});}})['then'](function(_0x1a5a9e){if(_0x1a5a9e){return db['Sound']['findOne']({'where':{'id':_0x287795['body']['id']},'attributes':['id','name',_0x201f('0x61'),'converted_format',_0x201f('0x62')],'raw':!![]});}})[_0x201f('0x22')](function(_0x560507){if(_0x560507){var _0x2cf273=path[_0x201f('0x4f')](config['root'],_0x201f('0x63'),util['format'](_0x201f('0x64'),path['basename'](_0x560507['save_name'],path[_0x201f('0x65')](_0x560507[_0x201f('0x61')])),_0x560507[_0x201f('0x66')]));var _0x16c22c=path[_0x201f('0x4f')](config[_0x201f('0x50')],_0x201f('0x51'),_0x286cf9[_0x201f('0x27')],util['format']('%s.%s',_0x560507[_0x201f('0x27')],_0x560507['converted_format']));fs[_0x201f('0x67')](_0x2cf273,_0x16c22c);return _0x560507;}})['catch'](function(_0x1b2f31){throw new db[(_0x201f('0x68'))]['ValidationError'](_0x1b2f31['message']);});})[_0x201f('0x22')](handleEntityNotFound(_0x159426,null))[_0x201f('0x22')](respondWithResult(_0x159426,0xc9))[_0x201f('0x47')](handleError(_0x159426,null));};exports[_0x201f('0x69')]=function(_0x18d046,_0xf7c0b9,_0x3d63fb){return db[_0x201f('0x4b')][_0x201f('0x5a')](function(_0x396ec9){var _0xd65880;return db[_0x201f('0x2b')][_0x201f('0x6a')]({'where':{'id':_0x18d046[_0x201f('0x44')]['id']}})['then'](handleEntityNotFound(_0xf7c0b9,null))[_0x201f('0x22')](function(_0x5cb5d9){if(_0x5cb5d9){_0xd65880=_0x5cb5d9;return _0x5cb5d9[_0x201f('0x69')](_0x18d046[_0x201f('0x44')][_0x201f('0x6b')]);}})[_0x201f('0x22')](function(_0x5bde51){if(_0x5bde51){return db[_0x201f('0x6c')][_0x201f('0x6a')]({'where':{'id':_0x18d046['params'][_0x201f('0x6b')]},'attributes':['id',_0x201f('0x27'),'save_name',_0x201f('0x66'),_0x201f('0x62')],'raw':!![]});}})[_0x201f('0x22')](function(_0x2f40cd){if(_0x2f40cd){fs[_0x201f('0x5c')](path[_0x201f('0x4f')](_0xd65880['directory'],util['format'](_0x201f('0x64'),_0x2f40cd[_0x201f('0x27')],_0x2f40cd[_0x201f('0x66')])));return _0x2f40cd;}})[_0x201f('0x47')](function(_0x5e95b7){throw new db['Sequelize'][(_0x201f('0x5e'))](_0x5e95b7['message']);});})[_0x201f('0x22')](handleEntityNotFound(_0xf7c0b9,null))[_0x201f('0x22')](respondWithStatusCode(_0xf7c0b9,0xcc))['catch'](handleError(_0xf7c0b9,null));};exports[_0x201f('0x6d')]=function(_0x384370,_0x153cfb,_0x32e1a3){var _0x33c9d6={};var _0x1dda33={};var _0x14f1be;var _0x191f5d;return db[_0x201f('0x2b')][_0x201f('0x6a')]({'where':{'id':_0x384370['params']['id']}})['then'](handleEntityNotFound(_0x153cfb,null))['then'](function(_0x58ea5d){if(_0x58ea5d){_0x14f1be=_0x58ea5d;_0x1dda33[_0x201f('0x2f')]=_[_0x201f('0x30')](db[_0x201f('0x6c')][_0x201f('0x2c')]);_0x1dda33['query']=_[_0x201f('0x30')](_0x384370[_0x201f('0x31')]);_0x1dda33['filters']=_['intersection'](_0x1dda33['model'],_0x1dda33[_0x201f('0x31')]);_0x33c9d6['attributes']=_[_0x201f('0x33')](_0x1dda33[_0x201f('0x2f')],qs[_0x201f('0x35')](_0x384370[_0x201f('0x31')][_0x201f('0x35')]));_0x33c9d6['attributes']=_0x33c9d6[_0x201f('0x34')][_0x201f('0x36')]?_0x33c9d6[_0x201f('0x34')]:_0x1dda33['model'];_0x33c9d6[_0x201f('0x38')]=qs[_0x201f('0x39')](_0x384370[_0x201f('0x31')][_0x201f('0x39')]);_0x33c9d6[_0x201f('0x3a')]=qs[_0x201f('0x32')](_[_0x201f('0x3b')](_0x384370[_0x201f('0x31')],_0x1dda33[_0x201f('0x32')]));if(_0x384370[_0x201f('0x31')]['filter']){_0x33c9d6[_0x201f('0x3a')]=_[_0x201f('0x3d')](_0x33c9d6[_0x201f('0x3a')],{'$or':_['map'](_0x33c9d6[_0x201f('0x34')],function(_0x338ea3){var _0x2527b6={};_0x2527b6[_0x338ea3]={'$like':'%'+_0x384370[_0x201f('0x31')][_0x201f('0x3c')]+'%'};return _0x2527b6;})});}_0x33c9d6=_[_0x201f('0x3d')]({},_0x33c9d6,_0x384370[_0x201f('0x45')]);return _0x14f1be[_0x201f('0x6d')](_0x33c9d6);}})['then'](function(_0x37187e){if(_0x37187e){_0x191f5d=_0x37187e[_0x201f('0x36')];if(!_0x384370['query'][_0x201f('0x6e')]('nolimit')){_0x33c9d6['limit']=qs[_0x201f('0x1e')](_0x384370['query'][_0x201f('0x1e')]);_0x33c9d6[_0x201f('0x1c')]=qs['offset'](_0x384370[_0x201f('0x31')][_0x201f('0x1c')]);}return _0x14f1be[_0x201f('0x6d')](_0x33c9d6);}})[_0x201f('0x22')](function(_0x2f7192){if(_0x2f7192){return _0x2f7192?{'count':_0x191f5d,'rows':_0x2f7192}:null;}})[_0x201f('0x22')](respondWithResult(_0x153cfb,null))['catch'](handleError(_0x153cfb,null));};
\ No newline at end of file
index d8ce366..a26652d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf27b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0xf27b,0x12b));var _0xbf27=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xf27b[_0x298ed3];return _0x5aad28;};'use strict';var _=require('lodash');var util=require(_0xbf27('0x0'));var logger=require(_0xbf27('0x1'))(_0xbf27('0x2'));var moment=require(_0xbf27('0x3'));var BPromise=require(_0xbf27('0x4'));var rp=require(_0xbf27('0x5'));var fs=require('fs');var path=require(_0xbf27('0x6'));var rimraf=require(_0xbf27('0x7'));var config=require(_0xbf27('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xbf27('0x9')]=function(_0x25d8f3,_0x3218e8){return _0x25d8f3[_0xbf27('0xa')](_0xbf27('0xb'),attributes,{'tableName':_0xbf27('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd53=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x4dd284,_0xe53c27){var _0xdab5a9=function(_0x5e7b8b){while(--_0x5e7b8b){_0x4dd284['push'](_0x4dd284['shift']());}};_0xdab5a9(++_0xe53c27);}(_0xbd53,0xa5));var _0x3bd5=function(_0x3b07d7,_0x374e44){_0x3b07d7=_0x3b07d7-0x0;var _0x2a9b53=_0xbd53[_0x3b07d7];return _0x2a9b53;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3bd5('0x0'))(_0x3bd5('0x1'));var moment=require(_0x3bd5('0x2'));var BPromise=require(_0x3bd5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bd5('0x4'));var rimraf=require(_0x3bd5('0x5'));var config=require(_0x3bd5('0x6'));var attributes=require(_0x3bd5('0x7'));module['exports']=function(_0xc54467,_0x54fb4d){return _0xc54467[_0x3bd5('0x8')](_0x3bd5('0x9'),attributes,{'tableName':_0x3bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 94790dc..91d262e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x40cfe3,_0x1c182b){var _0x17c81d=function(_0x3605f6){while(--_0x3605f6){_0x40cfe3['push'](_0x40cfe3['shift']());}};_0x17c81d(++_0x1c182b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0xcb91[_0x644ecd];return _0x1c66ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
+var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x1f70c3,_0x2ee382){var _0x334017=function(_0x3534c6){while(--_0x3534c6){_0x1f70c3['push'](_0x1f70c3['shift']());}};_0x334017(++_0x2ee382);}(_0xedd9,0xfc));var _0x9edd=function(_0x570c01,_0x5c72fb){_0x570c01=_0x570c01-0x0;var _0x3cddcb=_0xedd9[_0x570c01];return _0x3cddcb;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
index 76d8112..987fcff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50a6=['../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','index','get','/describe','isAuthenticated','show','/:id/users','post','create','addAgents','/:id/teams','addTeams','put','/:id','delete','destroy','removeTeams','exports','multer','util','express','fs-extra'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0x50a6,0xa4));var _0x650a=function(_0x428f32,_0xba79ad){_0x428f32=_0x428f32-0x0;var _0x9e6f89=_0x50a6[_0x428f32];return _0x9e6f89;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),auth[_0x650a('0xa')](),controller['describe']);router[_0x650a('0x8')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0xb')]);router['get'](_0x650a('0xc'),auth[_0x650a('0xa')](),controller['getAgents']);router[_0x650a('0x8')]('/:id/teams',auth[_0x650a('0xa')](),controller['getTeams']);router[_0x650a('0xd')]('/',auth['isAuthenticated'](),controller[_0x650a('0xe')]);router['post'](_0x650a('0xc'),auth[_0x650a('0xa')](),controller[_0x650a('0xf')]);router['post'](_0x650a('0x10'),auth[_0x650a('0xa')](),controller[_0x650a('0x11')]);router[_0x650a('0x12')](_0x650a('0x13'),auth[_0x650a('0xa')](),controller['update']);router[_0x650a('0x14')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0x15')]);router[_0x650a('0x14')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router['delete'](_0x650a('0x10'),auth[_0x650a('0xa')](),controller[_0x650a('0x16')]);module[_0x650a('0x17')]=router;
\ No newline at end of file
+var _0x9933=['../../components/auth/service','get','index','/describe','/:id','isAuthenticated','show','getAgents','getTeams','post','create','/:id/users','addAgents','/:id/teams','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9933,0xe5));var _0x3993=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9933[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x3993('0x0'));var util=require(_0x3993('0x1'));var path=require('path');var timeout=require(_0x3993('0x2'));var express=require('express');var router=express[_0x3993('0x3')]();var fs_extra=require(_0x3993('0x4'));var auth=require(_0x3993('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x3993('0x6')]('/',auth['isAuthenticated'](),controller[_0x3993('0x7')]);router[_0x3993('0x6')](_0x3993('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x3993('0x6')](_0x3993('0x9'),auth[_0x3993('0xa')](),controller[_0x3993('0xb')]);router['get']('/:id/users',auth[_0x3993('0xa')](),controller[_0x3993('0xc')]);router[_0x3993('0x6')]('/:id/teams',auth[_0x3993('0xa')](),controller[_0x3993('0xd')]);router[_0x3993('0xe')]('/',auth['isAuthenticated'](),controller[_0x3993('0xf')]);router[_0x3993('0xe')](_0x3993('0x10'),auth[_0x3993('0xa')](),controller[_0x3993('0x11')]);router[_0x3993('0xe')](_0x3993('0x12'),auth[_0x3993('0xa')](),controller['addTeams']);router[_0x3993('0x13')](_0x3993('0x9'),auth['isAuthenticated'](),controller[_0x3993('0x14')]);router[_0x3993('0x15')](_0x3993('0x9'),auth['isAuthenticated'](),controller[_0x3993('0x16')]);router[_0x3993('0x15')](_0x3993('0x10'),auth['isAuthenticated'](),controller[_0x3993('0x17')]);router[_0x3993('0x15')](_0x3993('0x12'),auth[_0x3993('0xa')](),controller[_0x3993('0x18')]);module[_0x3993('0x19')]=router;
\ No newline at end of file
index d3e0afa..3a7b505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0f7=['name','VIRTUAL','system-','getDataValue','INTEGER','exports','STRING'];(function(_0x5c0c87,_0x3464a5){var _0x31ac61=function(_0x18cf3a){while(--_0x18cf3a){_0x5c0c87['push'](_0x5c0c87['shift']());}};_0x31ac61(++_0x3464a5);}(_0xb0f7,0x1a2));var _0x7b0f=function(_0x55032a,_0x41aa89){_0x55032a=_0x55032a-0x0;var _0x21883c=_0xb0f7[_0x55032a];return _0x21883c;};'use strict';var Sequelize=require('sequelize');module[_0x7b0f('0x0')]={'name':{'type':Sequelize[_0x7b0f('0x1')],'allowNull':![],'unique':_0x7b0f('0x2')},'prefix':{'type':Sequelize[_0x7b0f('0x3')],'get':function(_0x18a611){return _0x7b0f('0x4')+this[_0x7b0f('0x5')](_0x7b0f('0x2'))+'-';}},'description':{'type':Sequelize[_0x7b0f('0x1')]},'callerIdAll':{'type':Sequelize[_0x7b0f('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x7b0f('0x6')]}};
\ No newline at end of file
+var _0x5672=['sequelize','exports','STRING','VIRTUAL','system-','name','INTEGER'];(function(_0x52bb8b,_0x3425b6){var _0x107865=function(_0x416a59){while(--_0x416a59){_0x52bb8b['push'](_0x52bb8b['shift']());}};_0x107865(++_0x3425b6);}(_0x5672,0x93));var _0x2567=function(_0x337537,_0x4ea7b8){_0x337537=_0x337537-0x0;var _0x4fdd67=_0x5672[_0x337537];return _0x4fdd67;};'use strict';var Sequelize=require(_0x2567('0x0'));module[_0x2567('0x1')]={'name':{'type':Sequelize[_0x2567('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x2567('0x3')],'get':function(_0x203407){return _0x2567('0x4')+this['getDataValue'](_0x2567('0x5'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x2567('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x2567('0x6')]}};
\ No newline at end of file
index 63f7724..37fa5ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0e=['limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoicePrefix','rawAttributes','key','keys','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','filters','options','find','describe','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','order','pick','getAgents','getTeams','Team','User','Agents','flatMap','addTeams','each','TeamVoicePrefix','upsert','forEach','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','all','union','value','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','status','end','json','undefined'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0x9f0e,0x116));var _0xe9f0=function(_0x5b81fa,_0x4153ca){_0x5b81fa=_0x5b81fa-0x0;var _0x2375cf=_0x9f0e[_0x5b81fa];return _0x2375cf;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];config['redis']=_[_0xe9f0('0x19')](config[_0xe9f0('0x1a')],{'host':_0xe9f0('0x1b'),'port':0x18eb});var socket=require(_0xe9f0('0x1c'))(new Redis(config['redis']));require(_0xe9f0('0x1d'))['register'](socket);function respondWithStatusCode(_0x1e3ba8,_0x23914b){_0x23914b=_0x23914b||0xcc;return function(_0x3800e8){if(_0x3800e8){return _0x1e3ba8['sendStatus'](_0x23914b);}return _0x1e3ba8[_0xe9f0('0x1e')](_0x23914b)[_0xe9f0('0x1f')]();};}function respondWithResult(_0x2e68ef,_0x598eee){_0x598eee=_0x598eee||0xc8;return function(_0xaa7aa6){if(_0xaa7aa6){return _0x2e68ef[_0xe9f0('0x1e')](_0x598eee)[_0xe9f0('0x20')](_0xaa7aa6);}};}function respondWithFilteredResult(_0xd71ac8,_0x3ed69a){return function(_0x2ab12b){if(_0x2ab12b){var _0x3da237=typeof _0x3ed69a['offset']===_0xe9f0('0x21')&&typeof _0x3ed69a[_0xe9f0('0x22')]===_0xe9f0('0x21');var _0x5c4182=_0x2ab12b[_0xe9f0('0x23')];var _0x30b8c7=_0x3da237?0x0:_0x3ed69a[_0xe9f0('0x24')];var _0x43f399=_0x3da237?_0x2ab12b['count']:_0x3ed69a[_0xe9f0('0x24')]+_0x3ed69a[_0xe9f0('0x22')];var _0x583687;if(_0x43f399>=_0x5c4182){_0x43f399=_0x5c4182;_0x583687=0xc8;}else{_0x583687=0xce;}_0xd71ac8['status'](_0x583687);return _0xd71ac8['set'](_0xe9f0('0x25'),_0x30b8c7+'-'+_0x43f399+'/'+_0x5c4182)[_0xe9f0('0x20')](_0x2ab12b);}return null;};}function patchUpdates(_0x1211ae){return function(_0x316cdf){try{jsonpatch[_0xe9f0('0x26')](_0x316cdf,_0x1211ae,!![]);}catch(_0x4a5c27){return BPromise[_0xe9f0('0x27')](_0x4a5c27);}return _0x316cdf[_0xe9f0('0x28')]();};}function saveUpdates(_0x437d43,_0x10801b){return function(_0x3ca991){if(_0x3ca991){return _0x3ca991[_0xe9f0('0x29')](_0x437d43)[_0xe9f0('0x2a')](function(_0x1321bb){return _0x1321bb;});}return null;};}function removeEntity(_0x3c4ba9,_0x3fce54){return function(_0x48128a){if(_0x48128a){return _0x48128a[_0xe9f0('0x2b')]()[_0xe9f0('0x2a')](function(){var _0x2ddfba=_0x48128a[_0xe9f0('0x2c')]({'plain':!![]});var _0x4cf1b1=_0xe9f0('0x2d');return db[_0xe9f0('0x2e')][_0xe9f0('0x2b')]({'where':{'type':_0x4cf1b1,'resourceId':_0x2ddfba['id']}})[_0xe9f0('0x2a')](function(){return _0x48128a;});})[_0xe9f0('0x2a')](function(){_0x3c4ba9['status'](0xcc)[_0xe9f0('0x1f')]();});}};}function handleEntityNotFound(_0xdc16bc,_0x44fb5b){return function(_0xab3d81){if(!_0xab3d81){_0xdc16bc[_0xe9f0('0x2f')](0x194);}return _0xab3d81;};}function handleError(_0xd19788,_0x1d788a){_0x1d788a=_0x1d788a||0x1f4;return function(_0x2efd33){logger[_0xe9f0('0x30')](_0x2efd33[_0xe9f0('0x31')]);if(_0x2efd33[_0xe9f0('0x32')]){delete _0x2efd33[_0xe9f0('0x32')];}_0xd19788[_0xe9f0('0x1e')](_0x1d788a)[_0xe9f0('0x33')](_0x2efd33);};}exports[_0xe9f0('0x34')]=function(_0x2097c4,_0x80e3ac){var _0x3e1846={},_0x2e7535={},_0x19d799={'count':0x0,'rows':[]};var _0x4089cc=_[_0xe9f0('0x35')](db[_0xe9f0('0x36')][_0xe9f0('0x37')],function(_0x5480ce){return{'name':_0x5480ce['fieldName'],'type':_0x5480ce['type'][_0xe9f0('0x38')]};});_0x2e7535['model']=_[_0xe9f0('0x35')](_0x4089cc,_0xe9f0('0x32'));_0x2e7535['query']=_[_0xe9f0('0x39')](_0x2097c4['query']);_0x2e7535['filters']=_['intersection'](_0x2e7535[_0xe9f0('0x3a')],_0x2e7535[_0xe9f0('0x3b')]);_0x3e1846['attributes']=_[_0xe9f0('0x3c')](_0x2e7535[_0xe9f0('0x3a')],qs[_0xe9f0('0x3d')](_0x2097c4['query']['fields']));_0x3e1846[_0xe9f0('0x3e')]=_0x3e1846[_0xe9f0('0x3e')][_0xe9f0('0x3f')]?_0x3e1846['attributes']:_0x2e7535[_0xe9f0('0x3a')];if(!_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x40')](_0xe9f0('0x41'))){_0x3e1846[_0xe9f0('0x22')]=qs['limit'](_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x22')]);_0x3e1846[_0xe9f0('0x24')]=qs['offset'](_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x24')]);}_0x3e1846['order']=qs[_0xe9f0('0x42')](_0x2097c4['query'][_0xe9f0('0x42')]);_0x3e1846['where']=qs['filters'](_['pick'](_0x2097c4['query'],_0x2e7535['filters']),_0x4089cc);if(_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x43')]){_0x3e1846[_0xe9f0('0x44')]=_[_0xe9f0('0x45')](_0x3e1846[_0xe9f0('0x44')],{'$or':_[_0xe9f0('0x35')](_0x4089cc,function(_0x3d4eb7){if(_0x3d4eb7[_0xe9f0('0x46')]!==_0xe9f0('0x47')){var _0x4e1c68={};_0x4e1c68[_0x3d4eb7[_0xe9f0('0x32')]]={'$like':'%'+_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x43')]+'%'};return _0x4e1c68;}})});}_0x3e1846=_['merge']({},_0x3e1846,_0x2097c4['options']);var _0x3cbf49={'where':_0x3e1846['where']};return db[_0xe9f0('0x36')][_0xe9f0('0x23')](_0x3cbf49)[_0xe9f0('0x2a')](function(_0x42d9d2){_0x19d799['count']=_0x42d9d2;if(_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x48')]){_0x3e1846[_0xe9f0('0x49')]=[{'all':!![]}];}return db[_0xe9f0('0x36')][_0xe9f0('0x4a')](_0x3e1846);})['then'](function(_0x60a40d){_0x19d799[_0xe9f0('0x4b')]=_0x60a40d;return _0x19d799;})[_0xe9f0('0x2a')](respondWithFilteredResult(_0x80e3ac,_0x3e1846))[_0xe9f0('0x4c')](handleError(_0x80e3ac,null));};exports[_0xe9f0('0x4d')]=function(_0x4ffc17,_0x3a8d1d){var _0x54ab8f={'raw':![],'where':{'id':_0x4ffc17[_0xe9f0('0x4e')]['id']}},_0x54e432={};_0x54e432[_0xe9f0('0x3a')]=_['keys'](db[_0xe9f0('0x36')][_0xe9f0('0x37')]);_0x54e432[_0xe9f0('0x3b')]=_[_0xe9f0('0x39')](_0x4ffc17[_0xe9f0('0x3b')]);_0x54e432[_0xe9f0('0x4f')]=_[_0xe9f0('0x3c')](_0x54e432['model'],_0x54e432[_0xe9f0('0x3b')]);_0x54ab8f['attributes']=_[_0xe9f0('0x3c')](_0x54e432['model'],qs[_0xe9f0('0x3d')](_0x4ffc17['query'][_0xe9f0('0x3d')]));_0x54ab8f[_0xe9f0('0x3e')]=_0x54ab8f[_0xe9f0('0x3e')]['length']?_0x54ab8f[_0xe9f0('0x3e')]:_0x54e432[_0xe9f0('0x3a')];if(_0x4ffc17[_0xe9f0('0x3b')][_0xe9f0('0x48')]){_0x54ab8f[_0xe9f0('0x49')]=[{'all':!![]}];}_0x54ab8f=_[_0xe9f0('0x45')]({},_0x54ab8f,_0x4ffc17[_0xe9f0('0x50')]);return db[_0xe9f0('0x36')][_0xe9f0('0x51')](_0x54ab8f)[_0xe9f0('0x2a')](handleEntityNotFound(_0x3a8d1d,null))[_0xe9f0('0x2a')](respondWithResult(_0x3a8d1d,null))[_0xe9f0('0x4c')](handleError(_0x3a8d1d,null));};exports['destroy']=function(_0x55e898,_0x31aa19){return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x55e898['params']['id']}})[_0xe9f0('0x2a')](handleEntityNotFound(_0x31aa19,null))['then'](removeEntity(_0x31aa19,null))[_0xe9f0('0x4c')](handleError(_0x31aa19,null));};exports[_0xe9f0('0x52')]=function(_0x31770f,_0x4e8416){return db['VoicePrefix'][_0xe9f0('0x52')]()[_0xe9f0('0x2a')](respondWithResult(_0x4e8416,null))['catch'](handleError(_0x4e8416,null));};exports[_0xe9f0('0x53')]=function(_0xafb4d7,_0x33f26c){var _0xa26972;return db['sequelize'][_0xe9f0('0x54')](function(_0x3a5d19){return db[_0xe9f0('0x36')][_0xe9f0('0x53')](_0xafb4d7[_0xe9f0('0x55')],{'transaction':_0x3a5d19})[_0xe9f0('0x2a')](function(_0x1cba23){_0xa26972=_0x1cba23[_0xe9f0('0x2c')]({'plain':!![]});return db['VoiceExtension'][_0xe9f0('0x51')]({'where':{'id':_0xa26972[_0xe9f0('0x56')]},'raw':!![]})[_0xe9f0('0x2a')](function(_0x4728e7){return createVoicePrefixExtensions(_0xa26972,_0x4728e7,_0x3a5d19);});});})[_0xe9f0('0x2a')](function(){var _0xe67052=_0xafb4d7[_0xe9f0('0x57')][_0xe9f0('0x2c')]({'plain':!![]});if(!_0xe67052)throw new Error(_0xe9f0('0x58'));if(_0xe67052[_0xe9f0('0x59')]===_0xe9f0('0x57')){var _0x3c26ac=_0xa26972;return db[_0xe9f0('0x5a')][_0xe9f0('0x51')]({'where':{'name':'VoicePrefixes','userProfileId':_0xe67052[_0xe9f0('0x5b')]},'raw':!![]})[_0xe9f0('0x2a')](function(_0x52bcce){if(_0x52bcce&&_0x52bcce['autoAssociation']===0x0){return db['UserProfileResource'][_0xe9f0('0x53')]({'name':_0x3c26ac['name'],'resourceId':_0x3c26ac['id'],'type':_0x52bcce[_0xe9f0('0x32')],'sectionId':_0x52bcce['id']},{})[_0xe9f0('0x2a')](function(){return _0xa26972;});}else{return _0xa26972;}})[_0xe9f0('0x4c')](function(_0x4c983e){logger[_0xe9f0('0x30')](_0xe9f0('0x5c'),_0x4c983e);throw _0x4c983e;});}return _0xa26972;})[_0xe9f0('0x2a')](respondWithResult(_0x33f26c,null))[_0xe9f0('0x4c')](handleError(_0x33f26c,null));};function Extension(_0x4bb39d,_0x392eae,_0x3a05e7,_0x28a66e){this[_0xe9f0('0x5d')]='from-sip';this['exten']=_0x4bb39d;this[_0xe9f0('0x5e')]=_0x3a05e7;this[_0xe9f0('0x46')]=_0xe9f0('0x5f');this[_0xe9f0('0x60')]=_0xe9f0('0x61');this['priority']=_0x392eae;this[_0xe9f0('0x62')]=_0x28a66e;}function createVoicePrefixExtensions(_0x55ce2d,_0x16b3c0,_0x5858a9){return new BPromise(function(_0x7c05aa,_0x15ece3){var _0x8b26f2=new Extension(formatPrefixName(_0x55ce2d[_0xe9f0('0x63')]),0x1,_0xe9f0('0x64'),'Voice\x20Prefix');_0x8b26f2['VoicePrefixId']=_0x55ce2d['id'];return db['VoiceExtension'][_0xe9f0('0x53')](_0x8b26f2,{'transaction':_0x5858a9})[_0xe9f0('0x2a')](function(_0x4f6f7c){var _0x2fd3b2=_0x4f6f7c['get']({'plain':!![]});var _0x4f6a5b=_[_0xe9f0('0x35')](addVoicePrefixExtensions(_0x55ce2d,_0x16b3c0),function(_0x329e9e){_0x329e9e[_0xe9f0('0x56')]=_0x2fd3b2['id'];_0x329e9e[_0xe9f0('0x65')]=_0x55ce2d['id'];return _0x329e9e;});return db[_0xe9f0('0x66')][_0xe9f0('0x67')](_0x4f6a5b,{'transaction':_0x5858a9})['then'](function(_0x5e4ad4){if(!_0x5e4ad4){return _0x15ece3(_0xe9f0('0x68'));}else{return _0x7c05aa(_0x5e4ad4);}})[_0xe9f0('0x4c')](function(_0x12d40a){return _0x15ece3(_0x12d40a);});});;});};function addVoicePrefixExtensions(_0x1f57a1,_0x55dae1){var _0xb9b439=[];var _0x83dea9=formatPrefixName(_0x1f57a1[_0xe9f0('0x63')]);_0xb9b439[_0xe9f0('0x69')](new Extension(_0x83dea9,0x2,_0xe9f0('0x6a'),_0xe9f0('0x6b')+_0x1f57a1['name']));if(_0x1f57a1[_0xe9f0('0x6c')]){_0xb9b439[_0xe9f0('0x69')](new Extension(_0x83dea9,0x3,_0xe9f0('0x6a'),_0xe9f0('0x6d')+_0x1f57a1[_0xe9f0('0x6c')]));}else{_0xb9b439['push'](new Extension(_0x83dea9,0x3,_0xe9f0('0x64'),_0xe9f0('0x6e')));}_0xb9b439[_0xe9f0('0x69')](new Extension(_0x83dea9,0x4,_0xe9f0('0x6f'),_0x55dae1[_0xe9f0('0x5d')]+','+_0xe9f0('0x70')+(0x8+_0x1f57a1[_0xe9f0('0x32')][_0xe9f0('0x3f')])+'}'+','+0x1));return _0xb9b439;}function formatPrefixName(_0x2eaead){var _0x27e6bc='_';for(var _0xeaab41=0x0;_0xeaab41<_0x2eaead[_0xe9f0('0x3f')];_0xeaab41++){if(_0x2eaead['charAt'](_0xeaab41)=='-'){_0x27e6bc+=_0x2eaead[_0xe9f0('0x71')](_0xeaab41);}else{_0x27e6bc+='['+_0x2eaead[_0xe9f0('0x71')](_0xeaab41)+']';}}_0x27e6bc+='.';return _0x27e6bc;}exports[_0xe9f0('0x29')]=function(_0x116ec5,_0x3c700e,_0x2428aa){var _0x158e44=_0x116ec5['body'];_0x158e44[_0xe9f0('0x63')]=_0xe9f0('0x72')+_0x158e44['name']+'-';return db[_0xe9f0('0x73')][_0xe9f0('0x54')](function(_0x442b78){return db['VoicePrefix'][_0xe9f0('0x29')](_0x158e44,{'where':{'id':_0x158e44['id']},'transaction':_0x442b78})[_0xe9f0('0x2a')](function(){return db['VoiceExtension'][_0xe9f0('0x2b')]({'where':{'VoicePrefixId':_0x158e44['id']},'transaction':_0x442b78})[_0xe9f0('0x2a')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x158e44[_0xe9f0('0x56')]},'raw':!![]})['then'](function(_0x386d7b){return createVoicePrefixExtensions(_0x158e44,_0x386d7b,_0x442b78);});});});})[_0xe9f0('0x2a')](function(){return db['VoicePrefix'][_0xe9f0('0x74')](_0x158e44['id']);})[_0xe9f0('0x2a')](respondWithResult(_0x3c700e,null))[_0xe9f0('0x4c')](handleError(_0x3c700e,null));};exports[_0xe9f0('0x75')]=function(_0x161ee4,_0x8096c2,_0x42e4e9){return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x161ee4['params']['id']}})[_0xe9f0('0x2a')](handleEntityNotFound(_0x8096c2,null))[_0xe9f0('0x2a')](function(_0xe7fdb){if(_0xe7fdb){return _0xe7fdb[_0xe9f0('0x75')](_0x161ee4[_0xe9f0('0x55')][_0xe9f0('0x76')],_[_0xe9f0('0x77')](_0x161ee4[_0xe9f0('0x55')],['ids','id'])||{})[_0xe9f0('0x78')](function(_0x17c18c){for(var _0x2ce60c=0x0;_0x2ce60c<_0x161ee4[_0xe9f0('0x55')][_0xe9f0('0x76')][_0xe9f0('0x3f')];_0x2ce60c+=0x1){socket['emit'](_0xe9f0('0x79'),{'UserId':Number(_0x161ee4['body']['ids'][_0x2ce60c]),'VoicePrefixId':Number(_0x161ee4['params']['id'])});}return _0x17c18c;});}})[_0xe9f0('0x2a')](respondWithResult(_0x8096c2,null))[_0xe9f0('0x4c')](handleError(_0x8096c2,null));};exports[_0xe9f0('0x7a')]=function(_0x3b5b57,_0x2bf006,_0x8f8df5){return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x3b5b57[_0xe9f0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2bf006,null))[_0xe9f0('0x2a')](function(_0x29eee2){if(_0x29eee2){return _0x29eee2[_0xe9f0('0x7a')](_0x3b5b57[_0xe9f0('0x3b')][_0xe9f0('0x76')])[_0xe9f0('0x2a')](function(){if(_[_0xe9f0('0x7b')](_0x3b5b57[_0xe9f0('0x3b')][_0xe9f0('0x76')])){for(var _0x1a4217=0x0;_0x1a4217<_0x3b5b57['query']['ids'][_0xe9f0('0x3f')];_0x1a4217+=0x1){socket[_0xe9f0('0x7c')](_0xe9f0('0x7d'),{'UserId':Number(_0x3b5b57[_0xe9f0('0x3b')][_0xe9f0('0x76')][_0x1a4217]),'VoicePrefixId':Number(_0x3b5b57[_0xe9f0('0x4e')]['id'])});}}else{socket[_0xe9f0('0x7c')](_0xe9f0('0x7d'),{'UserId':Number(_0x3b5b57['query']['ids']),'VoicePrefixId':Number(_0x3b5b57[_0xe9f0('0x4e')]['id'])});}});}})[_0xe9f0('0x2a')](respondWithStatusCode(_0x2bf006,null))['catch'](handleError(_0x2bf006,null));};exports['getAgents']=function(_0x2c9d84,_0x145040,_0x3ed26a){var _0xab92b={};var _0x2f73cd={};var _0x5553df;var _0x20c026;return db[_0xe9f0('0x36')][_0xe9f0('0x7e')]({'where':{'id':_0x2c9d84[_0xe9f0('0x4e')]['id']}})[_0xe9f0('0x2a')](handleEntityNotFound(_0x145040,null))[_0xe9f0('0x2a')](function(_0x2aca09){if(_0x2aca09){_0x5553df=_0x2aca09;_0x2f73cd['model']=_['keys'](db['User'][_0xe9f0('0x37')]);_0x2f73cd[_0xe9f0('0x3b')]=_[_0xe9f0('0x39')](_0x2c9d84[_0xe9f0('0x3b')]);_0x2f73cd['filters']=_[_0xe9f0('0x3c')](_0x2f73cd['model'],_0x2f73cd[_0xe9f0('0x3b')]);_0xab92b['attributes']=_[_0xe9f0('0x3c')](_0x2f73cd[_0xe9f0('0x3a')],qs[_0xe9f0('0x3d')](_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x3d')]));_0xab92b[_0xe9f0('0x3e')]=_0xab92b['attributes'][_0xe9f0('0x3f')]?_0xab92b[_0xe9f0('0x3e')]:_0x2f73cd[_0xe9f0('0x3a')];_0xab92b[_0xe9f0('0x7f')]=qs[_0xe9f0('0x42')](_0x2c9d84['query'][_0xe9f0('0x42')]);_0xab92b[_0xe9f0('0x44')]=qs['filters'](_[_0xe9f0('0x80')](_0x2c9d84['query'],_0x2f73cd[_0xe9f0('0x4f')]));if(_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x43')]){_0xab92b['where']=_[_0xe9f0('0x45')](_0xab92b[_0xe9f0('0x44')],{'$or':_[_0xe9f0('0x35')](_0xab92b['attributes'],function(_0x2a5d79){var _0x473f78={};_0x473f78[_0x2a5d79]={'$like':'%'+_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x43')]+'%'};return _0x473f78;})});}_0xab92b=_[_0xe9f0('0x45')]({},_0xab92b,_0x2c9d84[_0xe9f0('0x50')]);return _0x5553df[_0xe9f0('0x81')](_0xab92b);}})['then'](function(_0x4a416c){if(_0x4a416c){_0x20c026=_0x4a416c[_0xe9f0('0x3f')];if(!_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x40')]('nolimit')){_0xab92b[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x22')]);_0xab92b['offset']=qs['offset'](_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x24')]);}return _0x5553df['getAgents'](_0xab92b);}})[_0xe9f0('0x2a')](function(_0x5b26b1){if(_0x5b26b1){return _0x5b26b1?{'count':_0x20c026,'rows':_0x5b26b1}:null;}})['then'](respondWithResult(_0x145040,null))[_0xe9f0('0x4c')](handleError(_0x145040,null));};exports[_0xe9f0('0x82')]=function(_0x77b59d,_0x32ad0e,_0x10c4cf){var _0x563f55={};var _0x5761d3={};var _0x3e323e;var _0x41c1a9;return db[_0xe9f0('0x36')][_0xe9f0('0x7e')]({'where':{'id':_0x77b59d[_0xe9f0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32ad0e,null))['then'](function(_0x5ae1ce){if(_0x5ae1ce){_0x3e323e=_0x5ae1ce;_0x5761d3[_0xe9f0('0x3a')]=_['keys'](db[_0xe9f0('0x83')][_0xe9f0('0x37')]);_0x5761d3[_0xe9f0('0x3b')]=_[_0xe9f0('0x39')](_0x77b59d[_0xe9f0('0x3b')]);_0x5761d3[_0xe9f0('0x4f')]=_['intersection'](_0x5761d3['model'],_0x5761d3[_0xe9f0('0x3b')]);_0x563f55[_0xe9f0('0x3e')]=_[_0xe9f0('0x3c')](_0x5761d3[_0xe9f0('0x3a')],qs[_0xe9f0('0x3d')](_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x3d')]));_0x563f55[_0xe9f0('0x3e')]=_0x563f55[_0xe9f0('0x3e')][_0xe9f0('0x3f')]?_0x563f55[_0xe9f0('0x3e')]:_0x5761d3[_0xe9f0('0x3a')];_0x563f55[_0xe9f0('0x7f')]=qs[_0xe9f0('0x42')](_0x77b59d['query'][_0xe9f0('0x42')]);_0x563f55[_0xe9f0('0x44')]=qs[_0xe9f0('0x4f')](_[_0xe9f0('0x80')](_0x77b59d[_0xe9f0('0x3b')],_0x5761d3[_0xe9f0('0x4f')]));if(_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x43')]){_0x563f55[_0xe9f0('0x44')]=_[_0xe9f0('0x45')](_0x563f55[_0xe9f0('0x44')],{'$or':_['map'](_0x563f55[_0xe9f0('0x3e')],function(_0x2b9c16){var _0x41ef5b={};_0x41ef5b[_0x2b9c16]={'$like':'%'+_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x43')]+'%'};return _0x41ef5b;})});}_0x563f55=_[_0xe9f0('0x45')]({},_0x563f55,_0x77b59d[_0xe9f0('0x50')]);return _0x3e323e[_0xe9f0('0x82')](_0x563f55);}})['then'](function(_0x5c5ac9){if(_0x5c5ac9){_0x41c1a9=_0x5c5ac9[_0xe9f0('0x3f')];if(!_0x77b59d[_0xe9f0('0x3b')]['hasOwnProperty']('nolimit')){_0x563f55[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x22')]);_0x563f55[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x77b59d['query'][_0xe9f0('0x24')]);}return _0x3e323e[_0xe9f0('0x82')](_0x563f55);}})['then'](function(_0x4d59c0){if(_0x4d59c0){return _0x4d59c0?{'count':_0x41c1a9,'rows':_0x4d59c0}:null;}})[_0xe9f0('0x2a')](respondWithResult(_0x32ad0e,null))[_0xe9f0('0x4c')](handleError(_0x32ad0e,null));};exports['addTeams']=function(_0x17013a,_0x63e374,_0x34eda8){var _0x5a38f4=_0x17013a[_0xe9f0('0x55')][_0xe9f0('0x76')];var _0x2a607b;return db[_0xe9f0('0x83')]['findAll']({'where':{'id':_0x5a38f4},'attributes':['id'],'include':[{'model':db[_0xe9f0('0x84')],'as':_0xe9f0('0x85'),'attributes':['id',_0xe9f0('0x32'),'online','voicePause','interface'],'raw':!![]}]})[_0xe9f0('0x2a')](function(_0x58db9d){if(_0x58db9d){_0x2a607b=_0x58db9d;var _0x4820a1=_[_0xe9f0('0x86')](_0x58db9d,function(_0x4cd8bc){var _0x1b2532=_0x4cd8bc[_0xe9f0('0x2c')]({'plain':!![]});return _0x1b2532[_0xe9f0('0x85')];});return db[_0xe9f0('0x36')]['find']({'where':{'id':_0x17013a[_0xe9f0('0x4e')]['id']}})[_0xe9f0('0x2a')](function(_0x231d94){return db[_0xe9f0('0x73')][_0xe9f0('0x54')](function(_0x25c2f6){return _0x231d94[_0xe9f0('0x87')](_0x5a38f4,{'transaction':_0x25c2f6})[_0xe9f0('0x2a')](function(){return BPromise[_0xe9f0('0x88')](_0x2a607b,function(_0x2cd0a5){return db[_0xe9f0('0x89')][_0xe9f0('0x8a')]({'TeamId':_0x2cd0a5['id'],'VoicePrefixId':_0x17013a[_0xe9f0('0x4e')]['id']},{'transaction':_0x25c2f6});});})['then'](function(){return BPromise[_0xe9f0('0x88')](_0x4820a1,function(_0x1d8fb5){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x1d8fb5['id'],'VoicePrefixId':_0x17013a[_0xe9f0('0x4e')]['id']},'transaction':_0x25c2f6});});})[_0xe9f0('0x2a')](function(){_0x4820a1[_0xe9f0('0x8b')](function(_0x1c0db4){socket['emit'](_0xe9f0('0x79'),{'UserId':_0x1c0db4['id'],'VoicePrefixId':_0x231d94['id']});});});});});}})[_0xe9f0('0x2a')](respondWithStatusCode(_0x63e374,null))[_0xe9f0('0x4c')](handleError(_0x63e374,null));};exports['removeTeams']=function(_0x448834,_0x116aec,_0x4398fd){return db[_0xe9f0('0x83')][_0xe9f0('0x4a')]({'where':{'id':_0x448834['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe9f0('0x84')],'as':_0xe9f0('0x85'),'attributes':['id'],'raw':!![]}]})[_0xe9f0('0x2a')](handleEntityNotFound(_0x116aec,null))[_0xe9f0('0x2a')](function(_0x13ad0d){var _0x1b4977=_[_0xe9f0('0x35')](_0x13ad0d,'id');var _0x34f99d=[];var _0x5ae9f1=[];var _0x1aacfa=squel['select']();_0x1aacfa['field'](_0xe9f0('0x8c'))[_0xe9f0('0x8d')](_0xe9f0('0x8e'),'tq')['join'](_0xe9f0('0x8f'),'ut',_0xe9f0('0x90'))['where'](_0xe9f0('0x91'),_0x448834[_0xe9f0('0x4e')]['id']);for(var _0x14e369=0x0;_0x14e369<_0x13ad0d[_0xe9f0('0x3f')];_0x14e369+=0x1){let _0x56e09f=_0x13ad0d[_0x14e369];for(var _0x25750e=0x0;_0x25750e<_0x56e09f['Agents'][_0xe9f0('0x3f')];_0x25750e+=0x1){let _0x56e47c=_0x56e09f['Agents'][_0x25750e];var _0x58d863=_0x1aacfa[_0xe9f0('0x92')]();_0x58d863[_0xe9f0('0x44')]('ut.UserId\x20=\x20?',_0x56e47c['id']);_0x5ae9f1[_0xe9f0('0x69')](db[_0xe9f0('0x73')][_0xe9f0('0x3b')](_0x58d863[_0xe9f0('0x93')](),{'type':db[_0xe9f0('0x73')][_0xe9f0('0x94')][_0xe9f0('0x95')]})['then'](function(_0x5b10a5){if(_0x5b10a5[_0xe9f0('0x3f')]===0x1){return _0x56e47c['id'];}else{var _0x32eb6c=_['every'](_[_0xe9f0('0x35')](_0x5b10a5,_0xe9f0('0x96')),function(_0x96e959){return _['includes'](_0x1b4977,_0x96e959);});if(_0x32eb6c){return _0x56e47c['id'];}}}));}}return BPromise[_0xe9f0('0x97')](_0x5ae9f1)[_0xe9f0('0x2a')](function(_0x59fbca){_0x34f99d=_(_0x34f99d)[_0xe9f0('0x98')](_0x59fbca)['compact']()[_0xe9f0('0x99')]();return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x448834[_0xe9f0('0x4e')]['id']}})[_0xe9f0('0x2a')](function(_0x305d2f){return db['sequelize'][_0xe9f0('0x54')](function(_0x17f9bd){return _0x305d2f[_0xe9f0('0x9a')](_0x448834[_0xe9f0('0x3b')][_0xe9f0('0x76')],{'transaction':_0x17f9bd})[_0xe9f0('0x2a')](function(){if(!_[_0xe9f0('0x9b')](_0x34f99d)){return _0x305d2f['removeAgents'](_0x34f99d,{'transaction':_0x17f9bd});}})['then'](function(){_0x34f99d[_0xe9f0('0x8b')](function(_0x3e8745){socket['emit'](_0xe9f0('0x7d'),{'UserId':_0x3e8745,'VoicePrefixId':_0x305d2f['id']});});});});});});})['then'](respondWithStatusCode(_0x116aec,null))[_0xe9f0('0x4c')](handleError(_0x116aec,null));};
\ No newline at end of file
+var _0x1893=['compact','value','isEmpty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','error','name','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoicePrefix','includeAll','findAll','rows','show','length','options','find','catch','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','context','${EXTEN:','charAt','body','system-','findById','addAgents','params','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','rawAttributes','pick','getAgents','getTeams','addTeams','Team','Agents','online','voicePause','flatMap','each','upsert','findOrCreate','forEach','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1893,0xa2));var _0x3189=function(_0x380fa9,_0x5123eb){_0x380fa9=_0x380fa9-0x0;var _0x4f2532=_0x1893[_0x380fa9];return _0x4f2532;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3189('0x0'));var jsonpatch=require(_0x3189('0x1'));var rp=require(_0x3189('0x2'));var moment=require(_0x3189('0x3'));var BPromise=require(_0x3189('0x4'));var Mustache=require(_0x3189('0x5'));var util=require(_0x3189('0x6'));var path=require('path');var sox=require(_0x3189('0x7'));var csv=require(_0x3189('0x8'));var ejs=require(_0x3189('0x9'));var fs=require('fs');var fs_extra=require(_0x3189('0xa'));var _=require(_0x3189('0xb'));var squel=require(_0x3189('0xc'));var crypto=require(_0x3189('0xd'));var jsforce=require(_0x3189('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3189('0x8'));var querystring=require('querystring');var Papa=require(_0x3189('0xf'));var Redis=require('ioredis');var authService=require(_0x3189('0x10'));var qs=require(_0x3189('0x11'));var as=require(_0x3189('0x12'));var hardwareService=require(_0x3189('0x13'));var logger=require('../../config/logger')(_0x3189('0x14'));var utils=require(_0x3189('0x15'));var config=require(_0x3189('0x16'));var licenseUtil=require(_0x3189('0x17'));var db=require(_0x3189('0x18'))['db'];config['redis']=_[_0x3189('0x19')](config[_0x3189('0x1a')],{'host':_0x3189('0x1b'),'port':0x18eb});var socket=require(_0x3189('0x1c'))(new Redis(config[_0x3189('0x1a')]));require(_0x3189('0x1d'))[_0x3189('0x1e')](socket);function respondWithStatusCode(_0x25a917,_0x5521bb){_0x5521bb=_0x5521bb||0xcc;return function(_0x220b18){if(_0x220b18){return _0x25a917[_0x3189('0x1f')](_0x5521bb);}return _0x25a917[_0x3189('0x20')](_0x5521bb)[_0x3189('0x21')]();};}function respondWithResult(_0x486dd2,_0x40195d){_0x40195d=_0x40195d||0xc8;return function(_0x5f2e82){if(_0x5f2e82){return _0x486dd2['status'](_0x40195d)[_0x3189('0x22')](_0x5f2e82);}};}function respondWithFilteredResult(_0x49b1bc,_0x42c3a3){return function(_0xf8aed7){if(_0xf8aed7){var _0x22c7ba=typeof _0x42c3a3[_0x3189('0x23')]==='undefined'&&typeof _0x42c3a3[_0x3189('0x24')]===_0x3189('0x25');var _0x16edd7=_0xf8aed7['count'];var _0x561265=_0x22c7ba?0x0:_0x42c3a3[_0x3189('0x23')];var _0x306ed3=_0x22c7ba?_0xf8aed7[_0x3189('0x26')]:_0x42c3a3[_0x3189('0x23')]+_0x42c3a3['limit'];var _0x1771a8;if(_0x306ed3>=_0x16edd7){_0x306ed3=_0x16edd7;_0x1771a8=0xc8;}else{_0x1771a8=0xce;}_0x49b1bc[_0x3189('0x20')](_0x1771a8);return _0x49b1bc[_0x3189('0x27')]('Content-Range',_0x561265+'-'+_0x306ed3+'/'+_0x16edd7)[_0x3189('0x22')](_0xf8aed7);}return null;};}function patchUpdates(_0x47abb4){return function(_0x4bfc03){try{jsonpatch[_0x3189('0x28')](_0x4bfc03,_0x47abb4,!![]);}catch(_0x200f16){return BPromise[_0x3189('0x29')](_0x200f16);}return _0x4bfc03[_0x3189('0x2a')]();};}function saveUpdates(_0x393fcb,_0x5a08dc){return function(_0x4b03ad){if(_0x4b03ad){return _0x4b03ad[_0x3189('0x2b')](_0x393fcb)[_0x3189('0x2c')](function(_0x1dc1c8){return _0x1dc1c8;});}return null;};}function removeEntity(_0x3cc1e5,_0x103de4){return function(_0x3f4789){if(_0x3f4789){return _0x3f4789[_0x3189('0x2d')]()[_0x3189('0x2c')](function(){var _0x17b540=_0x3f4789[_0x3189('0x2e')]({'plain':!![]});var _0x5ce5f5='VoicePrefixes';return db['UserProfileResource'][_0x3189('0x2d')]({'where':{'type':_0x5ce5f5,'resourceId':_0x17b540['id']}})[_0x3189('0x2c')](function(){return _0x3f4789;});})[_0x3189('0x2c')](function(){_0x3cc1e5[_0x3189('0x20')](0xcc)[_0x3189('0x21')]();});}};}function handleEntityNotFound(_0x2f7504,_0x4d453a){return function(_0x1ab94b){if(!_0x1ab94b){_0x2f7504[_0x3189('0x1f')](0x194);}return _0x1ab94b;};}function handleError(_0x4bd677,_0x173f18){_0x173f18=_0x173f18||0x1f4;return function(_0x3744ff){logger[_0x3189('0x2f')](_0x3744ff['stack']);if(_0x3744ff[_0x3189('0x30')]){delete _0x3744ff[_0x3189('0x30')];}_0x4bd677[_0x3189('0x20')](_0x173f18)['send'](_0x3744ff);};}exports[_0x3189('0x31')]=function(_0x47f7a7,_0x51ce54){var _0x32ca90={},_0x34007b={},_0x374f23={'count':0x0,'rows':[]};var _0x3bdc84=_[_0x3189('0x32')](db['VoicePrefix']['rawAttributes'],function(_0x7d7745){return{'name':_0x7d7745['fieldName'],'type':_0x7d7745[_0x3189('0x33')][_0x3189('0x34')]};});_0x34007b[_0x3189('0x35')]=_[_0x3189('0x32')](_0x3bdc84,_0x3189('0x30'));_0x34007b[_0x3189('0x36')]=_[_0x3189('0x37')](_0x47f7a7[_0x3189('0x36')]);_0x34007b[_0x3189('0x38')]=_['intersection'](_0x34007b[_0x3189('0x35')],_0x34007b[_0x3189('0x36')]);_0x32ca90[_0x3189('0x39')]=_[_0x3189('0x3a')](_0x34007b[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x47f7a7[_0x3189('0x36')]['fields']));_0x32ca90['attributes']=_0x32ca90[_0x3189('0x39')]['length']?_0x32ca90[_0x3189('0x39')]:_0x34007b[_0x3189('0x35')];if(!_0x47f7a7['query'][_0x3189('0x3c')](_0x3189('0x3d'))){_0x32ca90[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x47f7a7['query'][_0x3189('0x24')]);_0x32ca90['offset']=qs['offset'](_0x47f7a7[_0x3189('0x36')][_0x3189('0x23')]);}_0x32ca90[_0x3189('0x3e')]=qs[_0x3189('0x3f')](_0x47f7a7[_0x3189('0x36')][_0x3189('0x3f')]);_0x32ca90[_0x3189('0x40')]=qs[_0x3189('0x38')](_['pick'](_0x47f7a7['query'],_0x34007b[_0x3189('0x38')]),_0x3bdc84);if(_0x47f7a7[_0x3189('0x36')][_0x3189('0x41')]){_0x32ca90[_0x3189('0x40')]=_[_0x3189('0x42')](_0x32ca90[_0x3189('0x40')],{'$or':_['map'](_0x3bdc84,function(_0x280146){if(_0x280146[_0x3189('0x33')]!==_0x3189('0x43')){var _0xaf76f1={};_0xaf76f1[_0x280146['name']]={'$like':'%'+_0x47f7a7[_0x3189('0x36')][_0x3189('0x41')]+'%'};return _0xaf76f1;}})});}_0x32ca90=_['merge']({},_0x32ca90,_0x47f7a7['options']);var _0x1ef1b2={'where':_0x32ca90['where']};return db[_0x3189('0x44')][_0x3189('0x26')](_0x1ef1b2)[_0x3189('0x2c')](function(_0x9593f3){_0x374f23['count']=_0x9593f3;if(_0x47f7a7[_0x3189('0x36')][_0x3189('0x45')]){_0x32ca90['include']=[{'all':!![]}];}return db[_0x3189('0x44')][_0x3189('0x46')](_0x32ca90);})[_0x3189('0x2c')](function(_0x3a6a36){_0x374f23[_0x3189('0x47')]=_0x3a6a36;return _0x374f23;})['then'](respondWithFilteredResult(_0x51ce54,_0x32ca90))['catch'](handleError(_0x51ce54,null));};exports[_0x3189('0x48')]=function(_0x5ca360,_0x44e45f){var _0xf095fe={'raw':![],'where':{'id':_0x5ca360['params']['id']}},_0x1a3e51={};_0x1a3e51[_0x3189('0x35')]=_[_0x3189('0x37')](db[_0x3189('0x44')]['rawAttributes']);_0x1a3e51[_0x3189('0x36')]=_[_0x3189('0x37')](_0x5ca360[_0x3189('0x36')]);_0x1a3e51[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x1a3e51[_0x3189('0x35')],_0x1a3e51['query']);_0xf095fe['attributes']=_[_0x3189('0x3a')](_0x1a3e51['model'],qs['fields'](_0x5ca360[_0x3189('0x36')]['fields']));_0xf095fe[_0x3189('0x39')]=_0xf095fe[_0x3189('0x39')][_0x3189('0x49')]?_0xf095fe['attributes']:_0x1a3e51[_0x3189('0x35')];if(_0x5ca360['query'][_0x3189('0x45')]){_0xf095fe['include']=[{'all':!![]}];}_0xf095fe=_['merge']({},_0xf095fe,_0x5ca360[_0x3189('0x4a')]);return db['VoicePrefix'][_0x3189('0x4b')](_0xf095fe)['then'](handleEntityNotFound(_0x44e45f,null))['then'](respondWithResult(_0x44e45f,null))[_0x3189('0x4c')](handleError(_0x44e45f,null));};exports[_0x3189('0x2d')]=function(_0x4373f6,_0x35cb23){return db[_0x3189('0x44')][_0x3189('0x4b')]({'where':{'id':_0x4373f6['params']['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x35cb23,null))['then'](removeEntity(_0x35cb23,null))['catch'](handleError(_0x35cb23,null));};exports[_0x3189('0x4d')]=function(_0x4f641a,_0xd90868){return db[_0x3189('0x44')][_0x3189('0x4d')]()[_0x3189('0x2c')](respondWithResult(_0xd90868,null))['catch'](handleError(_0xd90868,null));};exports[_0x3189('0x4e')]=function(_0x4ad892,_0x35fdb2){var _0x242ec4;return db[_0x3189('0x4f')][_0x3189('0x50')](function(_0x4f41e5){return db[_0x3189('0x44')][_0x3189('0x4e')](_0x4ad892['body'],{'transaction':_0x4f41e5})[_0x3189('0x2c')](function(_0xbf07c5){_0x242ec4=_0xbf07c5[_0x3189('0x2e')]({'plain':!![]});return db[_0x3189('0x51')]['find']({'where':{'id':_0x242ec4[_0x3189('0x52')]},'raw':!![]})['then'](function(_0x1ebb0d){return createVoicePrefixExtensions(_0x242ec4,_0x1ebb0d,_0x4f41e5);});});})['then'](function(){var _0x460c6e=_0x4ad892[_0x3189('0x53')]['get']({'plain':!![]});if(!_0x460c6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460c6e['role']===_0x3189('0x53')){var _0x5b14ac=_0x242ec4;return db[_0x3189('0x54')][_0x3189('0x4b')]({'where':{'name':_0x3189('0x55'),'userProfileId':_0x460c6e[_0x3189('0x56')]},'raw':!![]})[_0x3189('0x2c')](function(_0x40623f){if(_0x40623f&&_0x40623f[_0x3189('0x57')]===0x0){return db[_0x3189('0x58')][_0x3189('0x4e')]({'name':_0x5b14ac['name'],'resourceId':_0x5b14ac['id'],'type':_0x40623f[_0x3189('0x30')],'sectionId':_0x40623f['id']},{})[_0x3189('0x2c')](function(){return _0x242ec4;});}else{return _0x242ec4;}})[_0x3189('0x4c')](function(_0x429de3){logger[_0x3189('0x2f')](_0x3189('0x59'),_0x429de3);throw _0x429de3;});}return _0x242ec4;})[_0x3189('0x2c')](respondWithResult(_0x35fdb2,null))[_0x3189('0x4c')](handleError(_0x35fdb2,null));};function Extension(_0xa1316a,_0x68de3c,_0x187877,_0x3a2fe6){this['context']='from-sip';this[_0x3189('0x5a')]=_0xa1316a;this[_0x3189('0x5b')]=_0x187877;this[_0x3189('0x33')]=_0x3189('0x5c');this[_0x3189('0x5d')]=_0x3189('0x5e');this[_0x3189('0x5f')]=_0x68de3c;this[_0x3189('0x60')]=_0x3a2fe6;}function createVoicePrefixExtensions(_0x120a8a,_0x1472b6,_0xd45395){return new BPromise(function(_0x4f0ccb,_0x5b31dd){var _0x57aae5=new Extension(formatPrefixName(_0x120a8a[_0x3189('0x61')]),0x1,_0x3189('0x62'),'Voice\x20Prefix');_0x57aae5[_0x3189('0x63')]=_0x120a8a['id'];return db[_0x3189('0x51')][_0x3189('0x4e')](_0x57aae5,{'transaction':_0xd45395})[_0x3189('0x2c')](function(_0x26fdf2){var _0x4875a2=_0x26fdf2[_0x3189('0x2e')]({'plain':!![]});var _0x35a4d1=_[_0x3189('0x32')](addVoicePrefixExtensions(_0x120a8a,_0x1472b6),function(_0x228dfc){_0x228dfc['VoiceExtensionId']=_0x4875a2['id'];_0x228dfc[_0x3189('0x63')]=_0x120a8a['id'];return _0x228dfc;});return db[_0x3189('0x51')][_0x3189('0x64')](_0x35a4d1,{'transaction':_0xd45395})[_0x3189('0x2c')](function(_0x4a7172){if(!_0x4a7172){return _0x5b31dd(_0x3189('0x65'));}else{return _0x4f0ccb(_0x4a7172);}})['catch'](function(_0x1d7a44){return _0x5b31dd(_0x1d7a44);});});;});};function addVoicePrefixExtensions(_0x448635,_0x10fe1b){var _0xb02b4f=[];var _0x55bcf0=formatPrefixName(_0x448635[_0x3189('0x61')]);_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x2,_0x3189('0x67'),_0x3189('0x68')+_0x448635[_0x3189('0x30')]));if(_0x448635[_0x3189('0x69')]){_0xb02b4f['push'](new Extension(_0x55bcf0,0x3,_0x3189('0x67'),_0x3189('0x6a')+_0x448635[_0x3189('0x69')]));}else{_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x3,_0x3189('0x62'),'No\x20callerid\x20available'));}_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x4,'goto',_0x10fe1b[_0x3189('0x6b')]+','+_0x3189('0x6c')+(0x8+_0x448635[_0x3189('0x30')][_0x3189('0x49')])+'}'+','+0x1));return _0xb02b4f;}function formatPrefixName(_0x46faac){var _0x458db9='_';for(var _0x403d31=0x0;_0x403d31<_0x46faac[_0x3189('0x49')];_0x403d31++){if(_0x46faac['charAt'](_0x403d31)=='-'){_0x458db9+=_0x46faac[_0x3189('0x6d')](_0x403d31);}else{_0x458db9+='['+_0x46faac['charAt'](_0x403d31)+']';}}_0x458db9+='.';return _0x458db9;}exports[_0x3189('0x2b')]=function(_0x2eedf4,_0xf740b0,_0x1e08f4){var _0x3d11ac=_0x2eedf4[_0x3189('0x6e')];_0x3d11ac['prefix']=_0x3189('0x6f')+_0x3d11ac[_0x3189('0x30')]+'-';return db['sequelize'][_0x3189('0x50')](function(_0x50438f){return db[_0x3189('0x44')][_0x3189('0x2b')](_0x3d11ac,{'where':{'id':_0x3d11ac['id']},'transaction':_0x50438f})[_0x3189('0x2c')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x3d11ac['id']},'transaction':_0x50438f})[_0x3189('0x2c')](function(){return db[_0x3189('0x51')][_0x3189('0x4b')]({'where':{'id':_0x3d11ac['VoiceExtensionId']},'raw':!![]})[_0x3189('0x2c')](function(_0x285b0d){return createVoicePrefixExtensions(_0x3d11ac,_0x285b0d,_0x50438f);});});});})['then'](function(){return db[_0x3189('0x44')][_0x3189('0x70')](_0x3d11ac['id']);})[_0x3189('0x2c')](respondWithResult(_0xf740b0,null))['catch'](handleError(_0xf740b0,null));};exports[_0x3189('0x71')]=function(_0x28bbe6,_0x3ab88e,_0x5d3478){return db['VoicePrefix'][_0x3189('0x4b')]({'where':{'id':_0x28bbe6[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x3ab88e,null))['then'](function(_0x1f57c7){if(_0x1f57c7){return _0x1f57c7[_0x3189('0x71')](_0x28bbe6[_0x3189('0x6e')][_0x3189('0x73')],_[_0x3189('0x74')](_0x28bbe6[_0x3189('0x6e')],[_0x3189('0x73'),'id'])||{})[_0x3189('0x75')](function(_0x2c110e){for(var _0x41d415=0x0;_0x41d415<_0x28bbe6['body'][_0x3189('0x73')][_0x3189('0x49')];_0x41d415+=0x1){socket[_0x3189('0x76')](_0x3189('0x77'),{'UserId':Number(_0x28bbe6[_0x3189('0x6e')][_0x3189('0x73')][_0x41d415]),'VoicePrefixId':Number(_0x28bbe6[_0x3189('0x72')]['id'])});}return _0x2c110e;});}})[_0x3189('0x2c')](respondWithResult(_0x3ab88e,null))['catch'](handleError(_0x3ab88e,null));};exports[_0x3189('0x78')]=function(_0x4861ba,_0x226a58,_0x176c44){return db[_0x3189('0x44')][_0x3189('0x4b')]({'where':{'id':_0x4861ba['params']['id']}})['then'](handleEntityNotFound(_0x226a58,null))[_0x3189('0x2c')](function(_0x2c0e85){if(_0x2c0e85){return _0x2c0e85[_0x3189('0x78')](_0x4861ba[_0x3189('0x36')]['ids'])[_0x3189('0x2c')](function(){if(_[_0x3189('0x79')](_0x4861ba['query'][_0x3189('0x73')])){for(var _0x65c13f=0x0;_0x65c13f<_0x4861ba['query'][_0x3189('0x73')][_0x3189('0x49')];_0x65c13f+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x4861ba[_0x3189('0x36')]['ids'][_0x65c13f]),'VoicePrefixId':Number(_0x4861ba[_0x3189('0x72')]['id'])});}}else{socket[_0x3189('0x76')](_0x3189('0x7a'),{'UserId':Number(_0x4861ba[_0x3189('0x36')][_0x3189('0x73')]),'VoicePrefixId':Number(_0x4861ba['params']['id'])});}});}})['then'](respondWithStatusCode(_0x226a58,null))[_0x3189('0x4c')](handleError(_0x226a58,null));};exports['getAgents']=function(_0x33b271,_0x5c138a,_0x583d35){var _0x51303a={};var _0x278553={};var _0x4917e3;var _0x2d3d78;return db[_0x3189('0x44')][_0x3189('0x7b')]({'where':{'id':_0x33b271[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x5c138a,null))[_0x3189('0x2c')](function(_0x4d3554){if(_0x4d3554){_0x4917e3=_0x4d3554;_0x278553[_0x3189('0x35')]=_[_0x3189('0x37')](db[_0x3189('0x7c')][_0x3189('0x7d')]);_0x278553[_0x3189('0x36')]=_['keys'](_0x33b271[_0x3189('0x36')]);_0x278553[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x278553[_0x3189('0x35')],_0x278553[_0x3189('0x36')]);_0x51303a['attributes']=_[_0x3189('0x3a')](_0x278553[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x33b271[_0x3189('0x36')][_0x3189('0x3b')]));_0x51303a[_0x3189('0x39')]=_0x51303a[_0x3189('0x39')][_0x3189('0x49')]?_0x51303a[_0x3189('0x39')]:_0x278553[_0x3189('0x35')];_0x51303a['order']=qs[_0x3189('0x3f')](_0x33b271[_0x3189('0x36')][_0x3189('0x3f')]);_0x51303a[_0x3189('0x40')]=qs[_0x3189('0x38')](_[_0x3189('0x7e')](_0x33b271['query'],_0x278553[_0x3189('0x38')]));if(_0x33b271['query'][_0x3189('0x41')]){_0x51303a['where']=_[_0x3189('0x42')](_0x51303a['where'],{'$or':_[_0x3189('0x32')](_0x51303a['attributes'],function(_0x3a84e8){var _0x17b46a={};_0x17b46a[_0x3a84e8]={'$like':'%'+_0x33b271['query'][_0x3189('0x41')]+'%'};return _0x17b46a;})});}_0x51303a=_[_0x3189('0x42')]({},_0x51303a,_0x33b271[_0x3189('0x4a')]);return _0x4917e3[_0x3189('0x7f')](_0x51303a);}})[_0x3189('0x2c')](function(_0x549bbd){if(_0x549bbd){_0x2d3d78=_0x549bbd['length'];if(!_0x33b271[_0x3189('0x36')][_0x3189('0x3c')](_0x3189('0x3d'))){_0x51303a[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x33b271[_0x3189('0x36')]['limit']);_0x51303a[_0x3189('0x23')]=qs[_0x3189('0x23')](_0x33b271['query'][_0x3189('0x23')]);}return _0x4917e3[_0x3189('0x7f')](_0x51303a);}})[_0x3189('0x2c')](function(_0x5d10f8){if(_0x5d10f8){return _0x5d10f8?{'count':_0x2d3d78,'rows':_0x5d10f8}:null;}})[_0x3189('0x2c')](respondWithResult(_0x5c138a,null))[_0x3189('0x4c')](handleError(_0x5c138a,null));};exports[_0x3189('0x80')]=function(_0x24fec5,_0x5a7cf4,_0x2ef30c){var _0x14cecc={};var _0x2165f1={};var _0x1b8666;var _0x5bbf36;return db[_0x3189('0x44')][_0x3189('0x7b')]({'where':{'id':_0x24fec5[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x5a7cf4,null))['then'](function(_0x4371b7){if(_0x4371b7){_0x1b8666=_0x4371b7;_0x2165f1[_0x3189('0x35')]=_[_0x3189('0x37')](db['Team'][_0x3189('0x7d')]);_0x2165f1['query']=_[_0x3189('0x37')](_0x24fec5['query']);_0x2165f1[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x2165f1[_0x3189('0x35')],_0x2165f1[_0x3189('0x36')]);_0x14cecc['attributes']=_[_0x3189('0x3a')](_0x2165f1[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x24fec5[_0x3189('0x36')][_0x3189('0x3b')]));_0x14cecc[_0x3189('0x39')]=_0x14cecc['attributes']['length']?_0x14cecc[_0x3189('0x39')]:_0x2165f1[_0x3189('0x35')];_0x14cecc['order']=qs[_0x3189('0x3f')](_0x24fec5[_0x3189('0x36')][_0x3189('0x3f')]);_0x14cecc[_0x3189('0x40')]=qs['filters'](_[_0x3189('0x7e')](_0x24fec5[_0x3189('0x36')],_0x2165f1[_0x3189('0x38')]));if(_0x24fec5[_0x3189('0x36')]['filter']){_0x14cecc[_0x3189('0x40')]=_[_0x3189('0x42')](_0x14cecc['where'],{'$or':_[_0x3189('0x32')](_0x14cecc[_0x3189('0x39')],function(_0x5eeb3d){var _0xe94bda={};_0xe94bda[_0x5eeb3d]={'$like':'%'+_0x24fec5[_0x3189('0x36')]['filter']+'%'};return _0xe94bda;})});}_0x14cecc=_[_0x3189('0x42')]({},_0x14cecc,_0x24fec5[_0x3189('0x4a')]);return _0x1b8666[_0x3189('0x80')](_0x14cecc);}})[_0x3189('0x2c')](function(_0x23d34e){if(_0x23d34e){_0x5bbf36=_0x23d34e[_0x3189('0x49')];if(!_0x24fec5['query'][_0x3189('0x3c')](_0x3189('0x3d'))){_0x14cecc[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x24fec5[_0x3189('0x36')][_0x3189('0x24')]);_0x14cecc[_0x3189('0x23')]=qs[_0x3189('0x23')](_0x24fec5['query'][_0x3189('0x23')]);}return _0x1b8666[_0x3189('0x80')](_0x14cecc);}})['then'](function(_0x418ef8){if(_0x418ef8){return _0x418ef8?{'count':_0x5bbf36,'rows':_0x418ef8}:null;}})[_0x3189('0x2c')](respondWithResult(_0x5a7cf4,null))['catch'](handleError(_0x5a7cf4,null));};exports[_0x3189('0x81')]=function(_0x85c195,_0x4917ee,_0x2a8f73){var _0x464843=_0x85c195[_0x3189('0x6e')][_0x3189('0x73')];var _0x429bc1;return db[_0x3189('0x82')]['findAll']({'where':{'id':_0x464843},'attributes':['id'],'include':[{'model':db[_0x3189('0x7c')],'as':_0x3189('0x83'),'attributes':['id','name',_0x3189('0x84'),_0x3189('0x85'),'interface'],'raw':!![]}]})['then'](function(_0x158199){if(_0x158199){_0x429bc1=_0x158199;var _0x431e68=_[_0x3189('0x86')](_0x158199,function(_0x18d525){var _0x5e565c=_0x18d525['get']({'plain':!![]});return _0x5e565c[_0x3189('0x83')];});return db[_0x3189('0x44')]['find']({'where':{'id':_0x85c195[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](function(_0x36262a){return db['sequelize'][_0x3189('0x50')](function(_0xd24f4a){return _0x36262a[_0x3189('0x81')](_0x464843,{'transaction':_0xd24f4a})[_0x3189('0x2c')](function(){return BPromise[_0x3189('0x87')](_0x429bc1,function(_0x33f64c){return db['TeamVoicePrefix'][_0x3189('0x88')]({'TeamId':_0x33f64c['id'],'VoicePrefixId':_0x85c195['params']['id']},{'transaction':_0xd24f4a});});})[_0x3189('0x2c')](function(){return BPromise[_0x3189('0x87')](_0x431e68,function(_0x1c919f){return db['UserVoicePrefix'][_0x3189('0x89')]({'where':{'UserId':_0x1c919f['id'],'VoicePrefixId':_0x85c195[_0x3189('0x72')]['id']},'transaction':_0xd24f4a});});})['then'](function(){_0x431e68[_0x3189('0x8a')](function(_0x2bab94){socket['emit'](_0x3189('0x77'),{'UserId':_0x2bab94['id'],'VoicePrefixId':_0x36262a['id']});});});});});}})[_0x3189('0x2c')](respondWithStatusCode(_0x4917ee,null))[_0x3189('0x4c')](handleError(_0x4917ee,null));};exports[_0x3189('0x8b')]=function(_0x39fe89,_0x4f564d,_0x341e23){return db['Team'][_0x3189('0x46')]({'where':{'id':_0x39fe89[_0x3189('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3189('0x7c')],'as':_0x3189('0x83'),'attributes':['id'],'raw':!![]}]})[_0x3189('0x2c')](handleEntityNotFound(_0x4f564d,null))['then'](function(_0x4fb475){var _0x522aa5=_[_0x3189('0x32')](_0x4fb475,'id');var _0x1f0c98=[];var _0x3f5cf9=[];var _0x47ce18=squel['select']();_0x47ce18[_0x3189('0x8c')](_0x3189('0x8d'))[_0x3189('0x8e')](_0x3189('0x8f'),'tq')[_0x3189('0x90')]('user_has_teams','ut',_0x3189('0x91'))['where'](_0x3189('0x92'),_0x39fe89['params']['id']);for(var _0x241a67=0x0;_0x241a67<_0x4fb475[_0x3189('0x49')];_0x241a67+=0x1){let _0x51913c=_0x4fb475[_0x241a67];for(var _0x1a07d7=0x0;_0x1a07d7<_0x51913c[_0x3189('0x83')][_0x3189('0x49')];_0x1a07d7+=0x1){let _0x36602c=_0x51913c['Agents'][_0x1a07d7];var _0x1f9018=_0x47ce18[_0x3189('0x93')]();_0x1f9018[_0x3189('0x40')]('ut.UserId\x20=\x20?',_0x36602c['id']);_0x3f5cf9[_0x3189('0x66')](db[_0x3189('0x4f')][_0x3189('0x36')](_0x1f9018[_0x3189('0x94')](),{'type':db['sequelize'][_0x3189('0x95')][_0x3189('0x96')]})[_0x3189('0x2c')](function(_0x13fc9f){if(_0x13fc9f[_0x3189('0x49')]===0x1){return _0x36602c['id'];}else{var _0x516164=_[_0x3189('0x97')](_['map'](_0x13fc9f,_0x3189('0x98')),function(_0x1f506c){return _[_0x3189('0x99')](_0x522aa5,_0x1f506c);});if(_0x516164){return _0x36602c['id'];}}}));}}return BPromise[_0x3189('0x9a')](_0x3f5cf9)[_0x3189('0x2c')](function(_0x48835c){_0x1f0c98=_(_0x1f0c98)[_0x3189('0x9b')](_0x48835c)[_0x3189('0x9c')]()[_0x3189('0x9d')]();return db['VoicePrefix']['find']({'where':{'id':_0x39fe89[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](function(_0x4c19e2){return db[_0x3189('0x4f')][_0x3189('0x50')](function(_0x5d89ec){return _0x4c19e2[_0x3189('0x8b')](_0x39fe89[_0x3189('0x36')][_0x3189('0x73')],{'transaction':_0x5d89ec})['then'](function(){if(!_[_0x3189('0x9e')](_0x1f0c98)){return _0x4c19e2[_0x3189('0x78')](_0x1f0c98,{'transaction':_0x5d89ec});}})['then'](function(){_0x1f0c98[_0x3189('0x8a')](function(_0xab746c){socket[_0x3189('0x76')](_0x3189('0x7a'),{'UserId':_0xab746c,'VoicePrefixId':_0x4c19e2['id']});});});});});});})[_0x3189('0x2c')](respondWithStatusCode(_0x4f564d,null))[_0x3189('0x4c')](handleError(_0x4f564d,null));};
\ No newline at end of file
index d6c5717..08c8808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ce4=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x10c93e,_0x118ba2){var _0x535369=function(_0x2f757a){while(--_0x2f757a){_0x10c93e['push'](_0x10c93e['shift']());}};_0x535369(++_0x118ba2);}(_0x0ce4,0x1b4));var _0x40ce=function(_0x508621,_0x1e5fa9){_0x508621=_0x508621-0x0;var _0xf32c9f=_0x0ce4[_0x508621];return _0xf32c9f;};'use strict';var EventEmitter=require(_0x40ce('0x0'));var VoicePrefix=require(_0x40ce('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x40ce('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x40ce('0x3'),'afterDestroy':_0x40ce('0x4')};function emitEvent(_0x111e3e){return function(_0x1e64d7,_0xdad90d,_0x440bd0){VoicePrefixEvents[_0x40ce('0x5')](_0x111e3e+':'+_0x1e64d7['id'],_0x1e64d7);VoicePrefixEvents['emit'](_0x111e3e,_0x1e64d7);_0x440bd0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x40ce('0x6')](e,emitEvent(event));}}module[_0x40ce('0x7')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xc488=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0xc488,0xbb));var _0x8c48=function(_0x5ddc3c,_0x39b50a){_0x5ddc3c=_0x5ddc3c-0x0;var _0x5e13b2=_0xc488[_0x5ddc3c];return _0x5e13b2;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x8c48('0x0'))['db'][_0x8c48('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8c48('0x2')](0x0);var events={'afterCreate':_0x8c48('0x3'),'afterUpdate':_0x8c48('0x4'),'afterDestroy':'remove'};function emitEvent(_0x13e899){return function(_0x266ac7,_0x543112,_0x1a3c30){VoicePrefixEvents[_0x8c48('0x5')](_0x13e899+':'+_0x266ac7['id'],_0x266ac7);VoicePrefixEvents[_0x8c48('0x5')](_0x13e899,_0x266ac7);_0x1a3c30(null);};}for(var e in events){if(events[_0x8c48('0x6')](e)){var event=events[e];VoicePrefix[_0x8c48('0x7')](e,emitEvent(event));}}module[_0x8c48('0x8')]=VoicePrefixEvents;
\ No newline at end of file
index ceb9545..7d6b3b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5f3=['request-promise','path','rimraf','./voicePrefix.attributes','exports','define','voice_prefixes','util','../../config/logger','api','moment','bluebird'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xd5f3,0x1f3));var _0x3d5f=function(_0x489abb,_0x48fb66){_0x489abb=_0x489abb-0x0;var _0x7370b6=_0xd5f3[_0x489abb];return _0x7370b6;};'use strict';var _=require('lodash');var util=require(_0x3d5f('0x0'));var logger=require(_0x3d5f('0x1'))(_0x3d5f('0x2'));var moment=require(_0x3d5f('0x3'));var BPromise=require(_0x3d5f('0x4'));var rp=require(_0x3d5f('0x5'));var fs=require('fs');var path=require(_0x3d5f('0x6'));var rimraf=require(_0x3d5f('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d5f('0x8'));module[_0x3d5f('0x9')]=function(_0x2b51da,_0x4075e5){return _0x2b51da[_0x3d5f('0xa')]('VoicePrefix',attributes,{'tableName':_0x3d5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x68ec=['define','VoicePrefix','voice_prefixes','util','../../config/logger','moment','bluebird','path','../../config/environment','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x68ec,0x1bb));var _0xc68e=function(_0x43ad81,_0x114d95){_0x43ad81=_0x43ad81-0x0;var _0x1273f0=_0x68ec[_0x43ad81];return _0x1273f0;};'use strict';var _=require('lodash');var util=require(_0xc68e('0x0'));var logger=require(_0xc68e('0x1'))('api');var moment=require(_0xc68e('0x2'));var BPromise=require(_0xc68e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc68e('0x4'));var rimraf=require('rimraf');var config=require(_0xc68e('0x5'));var attributes=require('./voicePrefix.attributes');module[_0xc68e('0x6')]=function(_0x350d90,_0x360544){return _0x350d90[_0xc68e('0x7')](_0xc68e('0x8'),attributes,{'tableName':_0xc68e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index abf480d..0ef1204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf470=['register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x21b306,_0x126fb6){var _0x4dd56e=function(_0x48010b){while(--_0x48010b){_0x21b306['push'](_0x21b306['shift']());}};_0x4dd56e(++_0x126fb6);}(_0xf470,0xfd));var _0x0f47=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xf470[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var moment=require(_0x0f47('0x2'));var BPromise=require(_0x0f47('0x3'));var rs=require(_0x0f47('0x4'));var fs=require('fs');var Redis=require(_0x0f47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f47('0x6'));var logger=require(_0x0f47('0x7'))('rpc');var config=require(_0x0f47('0x8'));var jayson=require(_0x0f47('0x9'));var client=jayson[_0x0f47('0xa')][_0x0f47('0xb')]({'port':0x232a});config[_0x0f47('0xc')]=_[_0x0f47('0xd')](config[_0x0f47('0xc')],{'host':_0x0f47('0xe'),'port':0x18eb});var socket=require(_0x0f47('0xf'))(new Redis(config[_0x0f47('0xc')]));require(_0x0f47('0x10'))[_0x0f47('0x11')](socket);function respondWithRpcPromise(_0x6900a,_0x2256e5,_0x440449){return new BPromise(function(_0x2196d2,_0x3a78c8){return client[_0x0f47('0x12')](_0x6900a,_0x440449)[_0x0f47('0x13')](function(_0x4bfa8f){logger[_0x0f47('0x14')](_0x0f47('0x15'),_0x2256e5,_0x0f47('0x16'));logger[_0x0f47('0x17')](_0x0f47('0x18'),_0x2256e5,'request\x20sent',JSON['stringify'](_0x4bfa8f));if(_0x4bfa8f[_0x0f47('0x19')]){if(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1a')]===0x1f4){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f['error'][_0x0f47('0x1b')]);return _0x3a78c8(_0x4bfa8f['error']['message']);}logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);return _0x2196d2(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);}else{logger[_0x0f47('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x2256e5,_0x0f47('0x16'));_0x2196d2(_0x4bfa8f[_0x0f47('0x1c')]['message']);}})[_0x0f47('0x1d')](function(_0x2e2f35){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x2e2f35);_0x3a78c8(_0x2e2f35);});});}
\ No newline at end of file
+var _0xbbbc=['localhost','socket.io-emitter','./voicePrefix.socket','request','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x4c9423,_0x59c92a){var _0x5af0ef=function(_0x579406){while(--_0x579406){_0x4c9423['push'](_0x4c9423['shift']());}};_0x5af0ef(++_0x59c92a);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x446836,_0x19becf){_0x446836=_0x446836-0x0;var _0x4f0793=_0xbbbc[_0x446836];return _0x4f0793;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}
\ No newline at end of file
index 50286bc..0f6524e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0b2=['update','emit','removeListener','register','voicePrefix:','save','remove'];(function(_0x1bcf97,_0x257c96){var _0x4780c2=function(_0x4741d3){while(--_0x4741d3){_0x1bcf97['push'](_0x1bcf97['shift']());}};_0x4780c2(++_0x257c96);}(_0xe0b2,0xec));var _0x2e0b=function(_0x14a772,_0x19771c){_0x14a772=_0x14a772-0x0;var _0x5837af=_0xe0b2[_0x14a772];return _0x5837af;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2e0b('0x0'),_0x2e0b('0x1'),_0x2e0b('0x2')];function createListener(_0x1480b,_0x406b1c){return function(_0x187b65){_0x406b1c[_0x2e0b('0x3')](_0x1480b,_0x187b65);};}function removeListener(_0x56b694,_0x44e35e){return function(){VoicePrefixEvents[_0x2e0b('0x4')](_0x56b694,_0x44e35e);};}exports[_0x2e0b('0x5')]=function(_0x2a3a82){for(var _0x1b8455=0x0,_0x264319=events['length'];_0x1b8455<_0x264319;_0x1b8455++){var _0x2e1e40=events[_0x1b8455];var _0x504ea6=createListener(_0x2e0b('0x6')+_0x2e1e40,_0x2a3a82);VoicePrefixEvents['on'](_0x2e1e40,_0x504ea6);}};
\ No newline at end of file
+var _0x80fb=['remove','emit','removeListener','register','length','voicePrefix:','save'];(function(_0x3b7273,_0x49195e){var _0x3b37cc=function(_0xd356b3){while(--_0xd356b3){_0x3b7273['push'](_0x3b7273['shift']());}};_0x3b37cc(++_0x49195e);}(_0x80fb,0x11e));var _0xb80f=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x80fb[_0x2bf141];return _0x48277b;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xb80f('0x0'),_0xb80f('0x1'),'update'];function createListener(_0x33f217,_0x374dc2){return function(_0x38def4){_0x374dc2[_0xb80f('0x2')](_0x33f217,_0x38def4);};}function removeListener(_0x22de9a,_0x4561c7){return function(){VoicePrefixEvents[_0xb80f('0x3')](_0x22de9a,_0x4561c7);};}exports[_0xb80f('0x4')]=function(_0x52d81c){for(var _0x1676a9=0x0,_0x251de5=events[_0xb80f('0x5')];_0x1676a9<_0x251de5;_0x1676a9++){var _0x2083ab=events[_0x1676a9];var _0x28027c=createListener(_0xb80f('0x6')+_0x2083ab,_0x52d81c);VoicePrefixEvents['on'](_0x2083ab,_0x28027c);}};
\ No newline at end of file
index 461633a..2953955 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0xc2c0c3,_0x2bf8a9){var _0x292acf=function(_0x192b73){while(--_0x192b73){_0xc2c0c3['push'](_0xc2c0c3['shift']());}};_0x292acf(++_0x2bf8a9);}(_0xb10b,0x12a));var _0xbb10=function(_0x338c8c,_0x19df14){_0x338c8c=_0x338c8c-0x0;var _0x371a9a=_0xb10b[_0x338c8c];return _0x371a9a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
+var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x5adf4d,_0xdfd7ef){var _0x17b2db=function(_0x5a9a2f){while(--_0x5a9a2f){_0x5adf4d['push'](_0x5adf4d['shift']());}};_0x17b2db(++_0xdfd7ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
index 0a7cea3..3df2807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814d=['wrapuptime','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','inbound','outbound','ENUM','ringall','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory','getDataValue','type','booked','roundrobin','progressive','power','INTEGER','yes','all','TEXT','periodic_announce','joinempty','leavewhenempty','join','split'];(function(_0x5b4bb1,_0x3d8f0a){var _0x140df9=function(_0x5699cd){while(--_0x5699cd){_0x5b4bb1['push'](_0x5b4bb1['shift']());}};_0x140df9(++_0x3d8f0a);}(_0x814d,0x19a));var _0xd814=function(_0x3aa085,_0x5013b6){_0x3aa085=_0x3aa085-0x0;var _0x340cef=_0x814d[_0x3aa085];return _0x340cef;};'use strict';var Sequelize=require('sequelize');module[_0xd814('0x0')]={'name':{'type':Sequelize[_0xd814('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xd814('0x2'),_0xd814('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xd814('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd814('0x4')]('rr',_0xd814('0x5'),_0xd814('0x6'),_0xd814('0x7'),_0xd814('0x8'),'rrmemory','linear',_0xd814('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0xd814('0x5'),'set':function(_0x29eb25){this[_0xd814('0xa')](_0xd814('0xb'),_0x29eb25?_0x29eb25:_0xd814('0xc'));},'get':function(){var _0x65dcd=this[_0xd814('0xd')](_0xd814('0xe'));var _0x4e0846=this['getDataValue']('dialMethod');var _0x2f473b=this[_0xd814('0xd')]('strategy');if(_0x65dcd===_0xd814('0x2')){return _0x2f473b;}if(_0x4e0846===_0xd814('0xf')&&_0x2f473b===_0xd814('0xc')||_0x4e0846===_0xd814('0xf')&&_0x2f473b===_0xd814('0x10')){return _0x2f473b;}if(_0x4e0846===_0xd814('0x11')||_0x4e0846==='predictive'||_0x4e0846===_0xd814('0x12')){return _0x2f473b;}return null;}},'servicelevel':{'type':Sequelize[_0xd814('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xd814('0x1')]},'weight':{'type':Sequelize[_0xd814('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xd814('0x4')]('yes','no'),'defaultValue':_0xd814('0x14')},'autopause':{'type':Sequelize['ENUM'](_0xd814('0x14'),'no',_0xd814('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd814('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xd814('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd814('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd814('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd814('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd814('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd814('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':_0xd814('0x14')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xd814('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd814('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xd814('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0xd814('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd814('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xd814('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd814('0x1')]},'queue_quantity1':{'type':Sequelize[_0xd814('0x1')]},'queue_quantity2':{'type':Sequelize[_0xd814('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xd814('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xd814('0x16')],'set':function(_0x10c5c9){this['setDataValue'](_0xd814('0x17'),_0x10c5c9?_0x10c5c9['join'](','):[]);},'get':function(){return this[_0xd814('0xd')]('periodic_announce')?this['getDataValue'](_0xd814('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xd814('0x1')],'defaultValue':_0xd814('0x14'),'set':function(_0x506330){this[_0xd814('0xa')](_0xd814('0x18'),_0x506330?_0x506330['join'](','):undefined);},'get':function(){return this[_0xd814('0xd')]('joinempty')?this[_0xd814('0xd')](_0xd814('0x18'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x317c73){this['setDataValue'](_0xd814('0x19'),_0x317c73?_0x317c73[_0xd814('0x1a')](','):undefined);},'get':function(){return this[_0xd814('0xd')](_0xd814('0x19'))?this[_0xd814('0xd')](_0xd814('0x19'))[_0xd814('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xd814('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd814('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd814('0x1')]},'description':{'type':Sequelize[_0xd814('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x968ea4){this[_0xd814('0xa')]('acw',_0x968ea4);if(_0x968ea4){if(this[_0xd814('0xd')](_0xd814('0x1c'))<0x2){this[_0xd814('0xa')](_0xd814('0x1c'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd814('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x1d'),_0xd814('0x11'),_0xd814('0x12'),_0xd814('0x1e'),_0xd814('0xf')),'defaultValue':_0xd814('0x11'),'comment':_0xd814('0x1f')},'dialLimitChannel':{'type':Sequelize[_0xd814('0x13')](0x4)[_0xd814('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd814('0x21')},'dialLimitQueue':{'type':Sequelize[_0xd814('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd814('0x22')},'dialPowerLevel':{'type':Sequelize[_0xd814('0x23')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xd814('0x24')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0xd814('0x25')),'defaultValue':_0xd814('0x25'),'comment':_0xd814('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd814('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xd814('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd814('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd814('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd814('0x28')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xd814('0x29'),'comment':_0xd814('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0xd814('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd814('0x2b')},'dialQueueProject':{'type':Sequelize[_0xd814('0x1')],'comment':_0xd814('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd814('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd814('0x13')](0x5)[_0xd814('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd814('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd814('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd814('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd814('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd814('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd814('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd814('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd814('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd814('0x1')],'defaultValue':_0xd814('0x32')},'dialPrefix':{'type':Sequelize[_0xd814('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd814('0x4')](_0xd814('0x33'),'never',_0xd814('0x34')),'defaultValue':_0xd814('0x33')},'dialAMDActive':{'type':Sequelize[_0xd814('0x35')],'defaultValue':0x0,'comment':_0xd814('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0xd814('0x13')](0x9)[_0xd814('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd814('0x37')},'dialAMDGreeting':{'type':Sequelize[_0xd814('0x13')](0x9)[_0xd814('0x20')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd814('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd814('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd814('0x13')](0x9)[_0xd814('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd814('0x13')](0x9)[_0xd814('0x20')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd814('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd814('0x13')](0x9)[_0xd814('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd814('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd814('0x13')](0x9)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd814('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd814('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd814('0x13')](0x9)[_0xd814('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd814('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0xd814('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd814('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0xd814('0x35')],'defaultValue':0x0,'comment':_0xd814('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd814('0x4')]('DESC','ASC'),'defaultValue':_0xd814('0x40')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xd814('0x2c')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xd814('0x35')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd814('0x41')},'dialCutDigit':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd814('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd814('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd814('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd814('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd814('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd814('0x13')](0x5)[_0xd814('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd814('0x45')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd814('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd814('0x13')](0x5)[_0xd814('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd814('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd814('0x13')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd814('0x35')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x16d29e){if(!_0x16d29e)this[_0xd814('0xa')](_0xd814('0x47'),null);this[_0xd814('0xa')](_0xd814('0x48'),_0x16d29e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd814('0x13')](0x3)[_0xd814('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xd814('0x35')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x78ba=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','outbound','inbound','default','STRING','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'];(function(_0x323e3d,_0x27c504){var _0x941c8c=function(_0x32cf38){while(--_0x32cf38){_0x323e3d['push'](_0x323e3d['shift']());}};_0x941c8c(++_0x27c504);}(_0x78ba,0xba));var _0xa78b=function(_0x313731,_0x3e3b3a){_0x313731=_0x313731-0x0;var _0x1a51f5=_0x78ba[_0x313731];return _0x1a51f5;};'use strict';var Sequelize=require(_0xa78b('0x0'));module[_0xa78b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa78b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa78b('0x3')]('inbound',_0xa78b('0x4')),'allowNull':![],'defaultValue':_0xa78b('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xa78b('0x6')},'announce':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xa78b('0x8'),_0xa78b('0x9'),_0xa78b('0xa'),_0xa78b('0xb'),'rrmemory',_0xa78b('0xc'),_0xa78b('0xd'),_0xa78b('0xe')),'allowNull':![],'defaultValue':'ringall','set':function(_0x59135e){this[_0xa78b('0xf')]('strategy',_0x59135e?_0x59135e:_0xa78b('0x10'));},'get':function(){var _0x5c0c73=this[_0xa78b('0x11')](_0xa78b('0x12'));var _0x5c8c5a=this[_0xa78b('0x11')](_0xa78b('0x13'));var _0x368bb9=this[_0xa78b('0x11')]('strategy');if(_0x5c0c73==='inbound'){return _0x368bb9;}if(_0x5c8c5a===_0xa78b('0x14')&&_0x368bb9===_0xa78b('0x10')||_0x5c8c5a==='booked'&&_0x368bb9===_0xa78b('0x15')){return _0x368bb9;}if(_0x5c8c5a==='progressive'||_0x5c8c5a===_0xa78b('0x16')||_0x5c8c5a==='power'){return _0x368bb9;}return null;}},'servicelevel':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa78b('0x17')](0xb)},'timeout':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa78b('0x7')]},'weight':{'type':Sequelize[_0xa78b('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xa78b('0x3')]('yes','no'),'defaultValue':_0xa78b('0x18')},'autopause':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no',_0xa78b('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa78b('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xa78b('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xa78b('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xa78b('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xa78b('0x18')},'announce_holdtime':{'type':Sequelize[_0xa78b('0x3')]('yes','no',_0xa78b('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0xa78b('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xa78b('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa78b('0x7')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa78b('0x7')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xa78b('0x7')]},'queue_periodic_announce':{'type':Sequelize[_0xa78b('0x7')]},'queue_less_than':{'type':Sequelize[_0xa78b('0x7')]},'periodic_announce':{'type':Sequelize[_0xa78b('0x1b')],'set':function(_0x48d3f8){this[_0xa78b('0xf')](_0xa78b('0x1c'),_0x48d3f8?_0x48d3f8[_0xa78b('0x1d')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0xa78b('0x11')](_0xa78b('0x1c'))[_0xa78b('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':_0xa78b('0x18'),'set':function(_0x27c93f){this[_0xa78b('0xf')](_0xa78b('0x1f'),_0x27c93f?_0x27c93f['join'](','):undefined);},'get':function(){return this[_0xa78b('0x11')](_0xa78b('0x1f'))?this[_0xa78b('0x11')](_0xa78b('0x1f'))[_0xa78b('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':'no','set':function(_0x24524a){this[_0xa78b('0xf')](_0xa78b('0x20'),_0x24524a?_0x24524a[_0xa78b('0x1d')](','):undefined);},'get':function(){return this[_0xa78b('0x11')]('leavewhenempty')?this['getDataValue']('leavewhenempty')[_0xa78b('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa78b('0x7')]},'description':{'type':Sequelize[_0xa78b('0x7')]},'acw':{'type':Sequelize[_0xa78b('0x21')],'defaultValue':0x0,'set':function(_0x2593d9){this['setDataValue'](_0xa78b('0x22'),_0x2593d9);if(_0x2593d9){if(this[_0xa78b('0x11')](_0xa78b('0x23'))<0x2){this[_0xa78b('0xf')](_0xa78b('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa78b('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa78b('0x21')],'defaultValue':0x0,'comment':_0xa78b('0x24')},'dialMethod':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x25'),'progressive','power',_0xa78b('0x16'),_0xa78b('0x14')),'defaultValue':_0xa78b('0x26'),'comment':_0xa78b('0x27')},'dialLimitChannel':{'type':Sequelize[_0xa78b('0x17')](0x4)[_0xa78b('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xa78b('0x17')](0x4)[_0xa78b('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa78b('0x29')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xa78b('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x2a'),_0xa78b('0x2b')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa78b('0x2c')](0x2)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa78b('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xa78b('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa78b('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa78b('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':_0xa78b('0x2f'),'comment':_0xa78b('0x30')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa78b('0x31')},'dialQueueProject':{'type':Sequelize[_0xa78b('0x7')],'comment':_0xa78b('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa78b('0x17')](0x5)[_0xa78b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa78b('0x33')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa78b('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa78b('0x17')](0x5)[_0xa78b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa78b('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa78b('0x17')](0x5)[_0xa78b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':_0xa78b('0x36')},'dialPrefix':{'type':Sequelize[_0xa78b('0x7')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xa78b('0x37'),_0xa78b('0x38')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xa78b('0x21')],'defaultValue':0x0,'comment':_0xa78b('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xa78b('0x17')](0x9)[_0xa78b('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa78b('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xa78b('0x17')](0x9)[_0xa78b('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa78b('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa78b('0x17')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa78b('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa78b('0x17')](0x9)[_0xa78b('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa78b('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xa78b('0x17')](0x9)[_0xa78b('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa78b('0x17')](0x9)[_0xa78b('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa78b('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa78b('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa78b('0x17')](0x5)[_0xa78b('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa78b('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa78b('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0xa78b('0x17')](0x5)[_0xa78b('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa78b('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa78b('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa78b('0x3')](_0xa78b('0x43'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa78b('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa78b('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa78b('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa78b('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa78b('0x17')](0x5)[_0xa78b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa78b('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa78b('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0xa78b('0x17')](0x5)[_0xa78b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa78b('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa78b('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa78b('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa78b('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa78b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa78b('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa78b('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xa78b('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0xa78b('0x21')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x593fc0){if(!_0x593fc0)this[_0xa78b('0xf')](_0xa78b('0x4d'),null);this['setDataValue'](_0xa78b('0x4e'),_0x593fc0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa78b('0x17')](0x3)[_0xa78b('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xa78b('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa78b('0x21')],'defaultValue':!![]}};
\ No newline at end of file
index 6dd3e35..85c9bce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb57=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','get','omit','createdAt','updatedAt','userProfileId','autoAssociation','findOne','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','getTeams','Team','addTeams','teams','User','online','voicePause','interface','Agents','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','isEmpty','removeAgents','forEach','userVoiceQueue:remove','addAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','CmListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','scheduledAt','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','CmHopperBlack','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','end','limit','undefined','offset','count','status','set','json','apply','reject','save','update','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','type','name','UserProfileResource','then','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xbb57,0x1e5));var _0x7bb5=function(_0x2283a4,_0x3a9819){_0x2283a4=_0x2283a4-0x0;var _0x15e2b8=_0xbb57[_0x2283a4];return _0x15e2b8;};'use strict';var emlformat=require(_0x7bb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7bb5('0x1'));var jsonpatch=require(_0x7bb5('0x2'));var rp=require(_0x7bb5('0x3'));var moment=require(_0x7bb5('0x4'));var BPromise=require(_0x7bb5('0x5'));var Mustache=require(_0x7bb5('0x6'));var util=require(_0x7bb5('0x7'));var path=require(_0x7bb5('0x8'));var sox=require('sox');var csv=require(_0x7bb5('0x9'));var ejs=require(_0x7bb5('0xa'));var fs=require('fs');var fs_extra=require(_0x7bb5('0xb'));var _=require(_0x7bb5('0xc'));var squel=require(_0x7bb5('0xd'));var crypto=require(_0x7bb5('0xe'));var jsforce=require(_0x7bb5('0xf'));var deskjs=require(_0x7bb5('0x10'));var toCsv=require(_0x7bb5('0x9'));var querystring=require('querystring');var Papa=require(_0x7bb5('0x11'));var Redis=require('ioredis');var authService=require(_0x7bb5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7bb5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bb5('0x14'))(_0x7bb5('0x15'));var utils=require(_0x7bb5('0x16'));var config=require(_0x7bb5('0x17'));var licenseUtil=require(_0x7bb5('0x18'));var db=require(_0x7bb5('0x19'))['db'];config[_0x7bb5('0x1a')]=_['defaults'](config[_0x7bb5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bb5('0x1b'))(new Redis(config[_0x7bb5('0x1a')]));require(_0x7bb5('0x1c'))['register'](socket);function respondWithStatusCode(_0x457fca,_0x52cdef){_0x52cdef=_0x52cdef||0xcc;return function(_0x18e577){if(_0x18e577){return _0x457fca[_0x7bb5('0x1d')](_0x52cdef);}return _0x457fca['status'](_0x52cdef)[_0x7bb5('0x1e')]();};}function respondWithResult(_0x48b4ce,_0x380633){_0x380633=_0x380633||0xc8;return function(_0x45badb){if(_0x45badb){return _0x48b4ce['status'](_0x380633)['json'](_0x45badb);}};}function respondWithFilteredResult(_0x455ddb,_0x14143e){return function(_0x195e60){if(_0x195e60){var _0x12f455=typeof _0x14143e['offset']==='undefined'&&typeof _0x14143e[_0x7bb5('0x1f')]===_0x7bb5('0x20');var _0x8d015a=_0x195e60['count'];var _0x4186ba=_0x12f455?0x0:_0x14143e[_0x7bb5('0x21')];var _0x307c7d=_0x12f455?_0x195e60[_0x7bb5('0x22')]:_0x14143e[_0x7bb5('0x21')]+_0x14143e[_0x7bb5('0x1f')];var _0x596a0c;if(_0x307c7d>=_0x8d015a){_0x307c7d=_0x8d015a;_0x596a0c=0xc8;}else{_0x596a0c=0xce;}_0x455ddb[_0x7bb5('0x23')](_0x596a0c);return _0x455ddb[_0x7bb5('0x24')]('Content-Range',_0x4186ba+'-'+_0x307c7d+'/'+_0x8d015a)[_0x7bb5('0x25')](_0x195e60);}return null;};}function patchUpdates(_0x133efd){return function(_0x52e045){try{jsonpatch[_0x7bb5('0x26')](_0x52e045,_0x133efd,!![]);}catch(_0x382a96){return BPromise[_0x7bb5('0x27')](_0x382a96);}return _0x52e045[_0x7bb5('0x28')]();};}function saveUpdates(_0x1f8eed,_0x3f54ef){return function(_0x20d99b){if(_0x20d99b){return _0x20d99b[_0x7bb5('0x29')](_0x1f8eed)['then'](function(_0x4430ad){return _0x4430ad;});}return null;};}function removeEntity(_0x41485e,_0x4ec220){return function(_0x478f53){if(_0x478f53){return _0x478f53[_0x7bb5('0x2a')]()['then'](function(){var _0x4d35a6=_0x478f53['get']({'plain':!![]});var _0x450405=[{'name':_0x7bb5('0x2b'),'value':_0x7bb5('0x2c'),'ignore':![]},{'name':_0x7bb5('0x2d'),'value':_0x7bb5('0x2e'),'ignore':![]}];var _0x4c14c4=_(_0x450405)['filter'](_0x7bb5('0x2f'))[_0x7bb5('0x30')](_0x7bb5('0x31'))['value']();if(_['includes'](_0x4c14c4,_0x4d35a6[_0x7bb5('0x32')])){return;}var _0x30d681=_['find'](_0x450405,[_0x7bb5('0x31'),_0x4d35a6[_0x7bb5('0x32')]])[_0x7bb5('0x33')];return db[_0x7bb5('0x34')][_0x7bb5('0x2a')]({'where':{'type':_0x30d681,'resourceId':_0x4d35a6['id']}})[_0x7bb5('0x35')](function(){return _0x478f53;});})['then'](function(){_0x41485e[_0x7bb5('0x23')](0xcc)[_0x7bb5('0x1e')]();});}};}function handleEntityNotFound(_0x478884,_0x6235b){return function(_0x505541){if(!_0x505541){_0x478884[_0x7bb5('0x1d')](0x194);}return _0x505541;};}function handleError(_0x32ae33,_0x20bfc2){_0x20bfc2=_0x20bfc2||0x1f4;return function(_0x3ff720){logger['error'](_0x3ff720[_0x7bb5('0x36')]);if(_0x3ff720[_0x7bb5('0x33')]){delete _0x3ff720[_0x7bb5('0x33')];}_0x32ae33[_0x7bb5('0x23')](_0x20bfc2)[_0x7bb5('0x37')](_0x3ff720);};}exports[_0x7bb5('0x38')]=function(_0x39ff55,_0x40aab7){var _0x25ed65={},_0x7a3309={},_0x22fda7={'count':0x0,'rows':[]};var _0x3b4aa2=_[_0x7bb5('0x30')](db[_0x7bb5('0x39')][_0x7bb5('0x3a')],function(_0x53a6fb){return{'name':_0x53a6fb[_0x7bb5('0x3b')],'type':_0x53a6fb['type'][_0x7bb5('0x3c')]};});_0x7a3309[_0x7bb5('0x3d')]=_[_0x7bb5('0x30')](_0x3b4aa2,_0x7bb5('0x33'));_0x7a3309[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x39ff55[_0x7bb5('0x3e')]);_0x7a3309[_0x7bb5('0x40')]=_[_0x7bb5('0x41')](_0x7a3309[_0x7bb5('0x3d')],_0x7a3309[_0x7bb5('0x3e')]);_0x25ed65['attributes']=_['intersection'](_0x7a3309[_0x7bb5('0x3d')],qs[_0x7bb5('0x42')](_0x39ff55['query']['fields']));_0x25ed65[_0x7bb5('0x43')]=_0x25ed65['attributes'][_0x7bb5('0x44')]?_0x25ed65[_0x7bb5('0x43')]:_0x7a3309[_0x7bb5('0x3d')];if(!_0x39ff55[_0x7bb5('0x3e')][_0x7bb5('0x45')](_0x7bb5('0x46'))){_0x25ed65[_0x7bb5('0x1f')]=qs['limit'](_0x39ff55[_0x7bb5('0x3e')][_0x7bb5('0x1f')]);_0x25ed65[_0x7bb5('0x21')]=qs[_0x7bb5('0x21')](_0x39ff55['query'][_0x7bb5('0x21')]);}_0x25ed65[_0x7bb5('0x47')]=qs[_0x7bb5('0x48')](_0x39ff55[_0x7bb5('0x3e')]['sort']);_0x25ed65['where']=qs['filters'](_[_0x7bb5('0x49')](_0x39ff55['query'],_0x7a3309['filters']),_0x3b4aa2);if(_0x39ff55[_0x7bb5('0x3e')][_0x7bb5('0x4a')]){_0x25ed65[_0x7bb5('0x4b')]=_[_0x7bb5('0x4c')](_0x25ed65['where'],{'$or':_[_0x7bb5('0x30')](_0x3b4aa2,function(_0x1b2af3){if(_0x1b2af3['type']!==_0x7bb5('0x4d')){var _0x2d9fa7={};_0x2d9fa7[_0x1b2af3[_0x7bb5('0x33')]]={'$like':'%'+_0x39ff55[_0x7bb5('0x3e')]['filter']+'%'};return _0x2d9fa7;}})});}_0x25ed65=_['merge']({},_0x25ed65,_0x39ff55[_0x7bb5('0x4e')]);var _0x33a7ae={'where':_0x25ed65[_0x7bb5('0x4b')]};return db[_0x7bb5('0x39')][_0x7bb5('0x22')](_0x33a7ae)[_0x7bb5('0x35')](function(_0x5c050e){_0x22fda7[_0x7bb5('0x22')]=_0x5c050e;if(_0x39ff55['query'][_0x7bb5('0x4f')]){_0x25ed65[_0x7bb5('0x50')]=[{'all':!![]}];}return db['VoiceQueue'][_0x7bb5('0x51')](_0x25ed65);})[_0x7bb5('0x35')](function(_0x435802){_0x22fda7['rows']=_0x435802;return _0x22fda7;})[_0x7bb5('0x35')](respondWithFilteredResult(_0x40aab7,_0x25ed65))[_0x7bb5('0x52')](handleError(_0x40aab7,null));};exports[_0x7bb5('0x53')]=function(_0x53080a,_0xc835b9){var _0x4ecf56={'raw':![],'where':{'id':_0x53080a['params']['id']}},_0x53d419={};_0x53d419[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db['VoiceQueue'][_0x7bb5('0x3a')]);_0x53d419[_0x7bb5('0x3e')]=_['keys'](_0x53080a[_0x7bb5('0x3e')]);_0x53d419[_0x7bb5('0x40')]=_[_0x7bb5('0x41')](_0x53d419[_0x7bb5('0x3d')],_0x53d419[_0x7bb5('0x3e')]);_0x4ecf56['attributes']=_['intersection'](_0x53d419['model'],qs[_0x7bb5('0x42')](_0x53080a['query']['fields']));_0x4ecf56[_0x7bb5('0x43')]=_0x4ecf56[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x4ecf56[_0x7bb5('0x43')]:_0x53d419['model'];if(_0x53080a['query'][_0x7bb5('0x4f')]){_0x4ecf56[_0x7bb5('0x50')]=[{'all':!![]}];}_0x4ecf56=_['merge']({},_0x4ecf56,_0x53080a[_0x7bb5('0x4e')]);return db[_0x7bb5('0x39')][_0x7bb5('0x54')](_0x4ecf56)[_0x7bb5('0x35')](handleEntityNotFound(_0xc835b9,null))[_0x7bb5('0x35')](respondWithResult(_0xc835b9,null))[_0x7bb5('0x52')](handleError(_0xc835b9,null));};exports[_0x7bb5('0x55')]=function(_0x2b03fb,_0x158483){return db['VoiceQueue'][_0x7bb5('0x55')](_0x2b03fb[_0x7bb5('0x56')],{})[_0x7bb5('0x35')](function(_0x251690){var _0x3c2f45=_0x2b03fb[_0x7bb5('0x57')]['get']({'plain':!![]});if(!_0x3c2f45)throw new Error(_0x7bb5('0x58'));if(_0x3c2f45[_0x7bb5('0x59')]===_0x7bb5('0x57')){var _0x164ac9=_0x251690['get']({'plain':!![]});var _0x530b1f=[{'name':_0x7bb5('0x2b'),'value':_0x7bb5('0x2c')},{'name':_0x7bb5('0x2d'),'value':_0x7bb5('0x2e')}];var _0x37d6c9=_[_0x7bb5('0x54')](_0x530b1f,[_0x7bb5('0x31'),_0x164ac9[_0x7bb5('0x32')]])[_0x7bb5('0x33')];return db[_0x7bb5('0x5a')][_0x7bb5('0x54')]({'where':{'name':_0x37d6c9,'userProfileId':_0x3c2f45['userProfileId']},'raw':!![]})[_0x7bb5('0x35')](function(_0x17b7b9){if(_0x17b7b9&&_0x17b7b9['autoAssociation']===0x0){return db['UserProfileResource'][_0x7bb5('0x55')]({'name':_0x164ac9[_0x7bb5('0x33')],'resourceId':_0x164ac9['id'],'type':_0x17b7b9['name'],'sectionId':_0x17b7b9['id']},{})[_0x7bb5('0x35')](function(){return _0x251690;});}else{return _0x251690;}})[_0x7bb5('0x52')](function(_0x3b7182){logger[_0x7bb5('0x5b')](_0x7bb5('0x5c'),_0x3b7182);throw _0x3b7182;});}return _0x251690;})['then'](respondWithResult(_0x158483,0xc9))['catch'](handleError(_0x158483,null));};exports[_0x7bb5('0x5d')]=function(_0x5d3bb7,_0x396a48){var _0x28eb13={'where':{'id':_0x5d3bb7[_0x7bb5('0x5e')]['id']}},_0x18781b={};_0x18781b[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db[_0x7bb5('0x39')][_0x7bb5('0x3a')]);_0x28eb13[_0x7bb5('0x43')]=_[_0x7bb5('0x41')](_0x18781b[_0x7bb5('0x3d')],qs[_0x7bb5('0x42')](_0x5d3bb7[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x28eb13[_0x7bb5('0x43')]=_0x28eb13[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x28eb13['attributes']:_0x18781b[_0x7bb5('0x3d')];if(_0x5d3bb7[_0x7bb5('0x3e')][_0x7bb5('0x4f')]){_0x28eb13[_0x7bb5('0x50')]=[{'all':!![]}];}_0x28eb13=_[_0x7bb5('0x4c')]({},_0x28eb13,_0x5d3bb7[_0x7bb5('0x4e')]);return db[_0x7bb5('0x39')][_0x7bb5('0x54')](_0x28eb13)['then'](handleEntityNotFound(_0x396a48,null))[_0x7bb5('0x35')](function(_0x5b6bfa){if(_0x5b6bfa){var _0xcce6de=_0x5b6bfa[_0x7bb5('0x5f')]({'plain':!![]});_0xcce6de=qs[_0x7bb5('0x60')](_0xcce6de,['id',_0x7bb5('0x61'),_0x7bb5('0x62')]);_0x5d3bb7[_0x7bb5('0x56')]=_[_0x7bb5('0x60')](_0x5d3bb7[_0x7bb5('0x56')],['id',_0x7bb5('0x61'),'updatedAt']);return db[_0x7bb5('0x39')][_0x7bb5('0x55')](_[_0x7bb5('0x4c')](_0xcce6de,_0x5d3bb7[_0x7bb5('0x56')]),{'include':_0x5d3bb7[_0x7bb5('0x3e')][_0x7bb5('0x4f')]?[{'all':!![]}]:undefined})[_0x7bb5('0x35')](function(_0x14529d){var _0x96f946=_0x5d3bb7[_0x7bb5('0x57')][_0x7bb5('0x5f')]({'plain':!![]});if(!_0x96f946)throw new Error(_0x7bb5('0x58'));if(_0x96f946[_0x7bb5('0x59')]==='user'){var _0x5366e2=_0x14529d[_0x7bb5('0x5f')]({'plain':!![]});var _0x19c67b=[{'name':_0x7bb5('0x2b'),'value':'inbound'},{'name':_0x7bb5('0x2d'),'value':'outbound'}];var _0x4a4eb6=_[_0x7bb5('0x54')](_0x19c67b,[_0x7bb5('0x31'),_0x5366e2[_0x7bb5('0x32')]])[_0x7bb5('0x33')];return db[_0x7bb5('0x5a')][_0x7bb5('0x54')]({'where':{'name':_0x4a4eb6,'userProfileId':_0x96f946[_0x7bb5('0x63')]},'raw':!![]})['then'](function(_0x2b9844){if(_0x2b9844&&_0x2b9844[_0x7bb5('0x64')]===0x0){return db['UserProfileResource'][_0x7bb5('0x55')]({'name':_0x5366e2[_0x7bb5('0x33')],'resourceId':_0x5366e2['id'],'type':_0x2b9844[_0x7bb5('0x33')],'sectionId':_0x2b9844['id']},{})[_0x7bb5('0x35')](function(){return _0x14529d;});}else{return _0x14529d;}})[_0x7bb5('0x52')](function(_0x2ca75f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca75f);throw _0x2ca75f;});}return _0x14529d;});}})[_0x7bb5('0x35')](respondWithResult(_0x396a48,0xc9))[_0x7bb5('0x52')](handleError(_0x396a48,null));};exports['update']=function(_0x3ecfb6,_0x3f6d1f){if(_0x3ecfb6['body']['id']){delete _0x3ecfb6['body']['id'];}return db[_0x7bb5('0x39')][_0x7bb5('0x54')]({'where':{'id':_0x3ecfb6[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x3f6d1f,null))['then'](saveUpdates(_0x3ecfb6[_0x7bb5('0x56')],null))[_0x7bb5('0x35')](respondWithResult(_0x3f6d1f,null))[_0x7bb5('0x52')](handleError(_0x3f6d1f,null));};exports[_0x7bb5('0x2a')]=function(_0x7c45f7,_0x419c19){return db['VoiceQueue'][_0x7bb5('0x54')]({'where':{'id':_0x7c45f7['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x419c19,null))[_0x7bb5('0x35')](removeEntity(_0x419c19,null))[_0x7bb5('0x52')](handleError(_0x419c19,null));};exports['getHoppers']=function(_0x22f2be,_0x26b6ba,_0x530fb3){var _0x147afb={'raw':![],'where':{}};var _0x233a26={};var _0x1afa4f={'count':0x0,'rows':[]};return db[_0x7bb5('0x39')][_0x7bb5('0x65')]({'where':{'id':_0x22f2be[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x26b6ba,null))[_0x7bb5('0x35')](function(_0x557674){if(_0x557674){_0x233a26[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db['CmHopper'][_0x7bb5('0x3a')]);_0x233a26[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x22f2be[_0x7bb5('0x3e')]);_0x233a26[_0x7bb5('0x40')]=_[_0x7bb5('0x41')](_0x233a26[_0x7bb5('0x3d')],_0x233a26[_0x7bb5('0x3e')]);_0x147afb['attributes']=_[_0x7bb5('0x41')](_0x233a26[_0x7bb5('0x3d')],qs[_0x7bb5('0x42')](_0x22f2be[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x147afb[_0x7bb5('0x43')]=_0x147afb[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x147afb[_0x7bb5('0x43')]:_0x233a26['model'];if(!_0x22f2be[_0x7bb5('0x3e')][_0x7bb5('0x45')](_0x7bb5('0x46'))){_0x147afb[_0x7bb5('0x1f')]=qs[_0x7bb5('0x1f')](_0x22f2be[_0x7bb5('0x3e')][_0x7bb5('0x1f')]);_0x147afb[_0x7bb5('0x21')]=qs[_0x7bb5('0x21')](_0x22f2be[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}_0x147afb['order']=qs[_0x7bb5('0x48')](_0x22f2be[_0x7bb5('0x3e')]['sort']);_0x147afb[_0x7bb5('0x4b')]=qs[_0x7bb5('0x40')](_['pick'](_0x22f2be['query'],_0x233a26['filters']));_0x147afb[_0x7bb5('0x4b')][_0x7bb5('0x66')]=_0x557674['id'];if(_0x22f2be[_0x7bb5('0x3e')][_0x7bb5('0x4a')]){_0x147afb[_0x7bb5('0x4b')]=_[_0x7bb5('0x4c')](_0x147afb[_0x7bb5('0x4b')],{'$or':_[_0x7bb5('0x30')](_0x147afb[_0x7bb5('0x43')],function(_0xf6d427){var _0x65bd9b={};_0x65bd9b[_0xf6d427]={'$like':'%'+_0x22f2be['query'][_0x7bb5('0x4a')]+'%'};return _0x65bd9b;})});}_0x147afb=_['merge']({},_0x147afb,_0x22f2be[_0x7bb5('0x4e')]);return db[_0x7bb5('0x67')]['count']({'where':_0x147afb[_0x7bb5('0x4b')]})['then'](function(_0x3a44f2){_0x1afa4f['count']=_0x3a44f2;if(_0x22f2be[_0x7bb5('0x3e')][_0x7bb5('0x4f')]){_0x147afb[_0x7bb5('0x50')]=[{'all':!![]}];}return db[_0x7bb5('0x67')][_0x7bb5('0x51')](_0x147afb);})[_0x7bb5('0x35')](function(_0x3cba34){_0x1afa4f[_0x7bb5('0x68')]=_0x3cba34;return _0x1afa4f;});}})[_0x7bb5('0x35')](respondWithFilteredResult(_0x26b6ba,_0x147afb))[_0x7bb5('0x52')](handleError(_0x26b6ba,null));};exports[_0x7bb5('0x69')]=function(_0x34b188,_0x86dc50,_0x2429bb){var _0x5db229={'raw':!![],'where':{}};var _0x439323={};var _0x47d0c2={'count':0x0,'rows':[]};return db[_0x7bb5('0x39')][_0x7bb5('0x65')]({'where':{'id':_0x34b188['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x86dc50,null))[_0x7bb5('0x35')](function(_0x3bac4c){if(_0x3bac4c){_0x439323[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db[_0x7bb5('0x6a')][_0x7bb5('0x3a')]);_0x439323[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x34b188[_0x7bb5('0x3e')]);_0x439323[_0x7bb5('0x40')]=_[_0x7bb5('0x41')](_0x439323[_0x7bb5('0x3d')],_0x439323[_0x7bb5('0x3e')]);_0x5db229[_0x7bb5('0x43')]=_['intersection'](_0x439323[_0x7bb5('0x3d')],qs[_0x7bb5('0x42')](_0x34b188[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x5db229['attributes']=_0x5db229[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x5db229[_0x7bb5('0x43')]:_0x439323[_0x7bb5('0x3d')];if(!_0x34b188[_0x7bb5('0x3e')][_0x7bb5('0x45')](_0x7bb5('0x46'))){_0x5db229[_0x7bb5('0x1f')]=qs['limit'](_0x34b188[_0x7bb5('0x3e')][_0x7bb5('0x1f')]);_0x5db229[_0x7bb5('0x21')]=qs[_0x7bb5('0x21')](_0x34b188[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}_0x5db229[_0x7bb5('0x47')]=qs['sort'](_0x34b188['query'][_0x7bb5('0x48')]);_0x5db229[_0x7bb5('0x4b')]=qs[_0x7bb5('0x40')](_[_0x7bb5('0x49')](_0x34b188['query'],_0x439323[_0x7bb5('0x40')]));_0x5db229[_0x7bb5('0x4b')]['VoiceQueueId']=_0x3bac4c['id'];if(_0x34b188[_0x7bb5('0x3e')][_0x7bb5('0x4a')]){_0x5db229[_0x7bb5('0x4b')]=_[_0x7bb5('0x4c')](_0x5db229['where'],{'$or':_['map'](_0x5db229[_0x7bb5('0x43')],function(_0x20610d){var _0x21f931={};_0x21f931[_0x20610d]={'$like':'%'+_0x34b188['query']['filter']+'%'};return _0x21f931;})});}_0x5db229=_[_0x7bb5('0x4c')]({},_0x5db229,_0x34b188[_0x7bb5('0x4e')]);return db[_0x7bb5('0x6a')][_0x7bb5('0x22')]({'where':_0x5db229[_0x7bb5('0x4b')]})['then'](function(_0xcb76de){_0x47d0c2[_0x7bb5('0x22')]=_0xcb76de;if(_0x34b188[_0x7bb5('0x3e')]['includeAll']){_0x5db229[_0x7bb5('0x50')]=[{'all':!![]}];}return db[_0x7bb5('0x6a')][_0x7bb5('0x51')](_0x5db229);})['then'](function(_0x4986cd){_0x47d0c2['rows']=_0x4986cd;return _0x47d0c2;});}})[_0x7bb5('0x35')](respondWithFilteredResult(_0x86dc50,_0x5db229))[_0x7bb5('0x52')](handleError(_0x86dc50,null));};exports[_0x7bb5('0x6b')]=function(_0x5cbe3a,_0xa77f02,_0x3f7197){var _0x24c708={'raw':!![],'where':{}};var _0x31c8a8={};var _0x182f94={'count':0x0,'rows':[]};return db[_0x7bb5('0x39')][_0x7bb5('0x65')]({'where':{'id':_0x5cbe3a['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0xa77f02,null))[_0x7bb5('0x35')](function(_0xb47ee1){if(_0xb47ee1){_0x31c8a8['model']=_[_0x7bb5('0x3f')](db['CmHopperFinal'][_0x7bb5('0x3a')]);_0x31c8a8[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x5cbe3a[_0x7bb5('0x3e')]);_0x31c8a8['filters']=_['intersection'](_0x31c8a8[_0x7bb5('0x3d')],_0x31c8a8[_0x7bb5('0x3e')]);_0x24c708['attributes']=_[_0x7bb5('0x41')](_0x31c8a8['model'],qs[_0x7bb5('0x42')](_0x5cbe3a['query'][_0x7bb5('0x42')]));_0x24c708['attributes']=_0x24c708[_0x7bb5('0x43')]['length']?_0x24c708['attributes']:_0x31c8a8[_0x7bb5('0x3d')];if(!_0x5cbe3a[_0x7bb5('0x3e')][_0x7bb5('0x45')](_0x7bb5('0x46'))){_0x24c708[_0x7bb5('0x1f')]=qs[_0x7bb5('0x1f')](_0x5cbe3a[_0x7bb5('0x3e')][_0x7bb5('0x1f')]);_0x24c708[_0x7bb5('0x21')]=qs[_0x7bb5('0x21')](_0x5cbe3a[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}_0x24c708[_0x7bb5('0x47')]=qs[_0x7bb5('0x48')](_0x5cbe3a['query'][_0x7bb5('0x48')]);_0x24c708['where']=qs[_0x7bb5('0x40')](_[_0x7bb5('0x49')](_0x5cbe3a[_0x7bb5('0x3e')],_0x31c8a8['filters']));_0x24c708['where']['VoiceQueueId']=_0xb47ee1['id'];if(_0x5cbe3a[_0x7bb5('0x3e')][_0x7bb5('0x4a')]){_0x24c708[_0x7bb5('0x4b')]=_[_0x7bb5('0x4c')](_0x24c708[_0x7bb5('0x4b')],{'$or':_[_0x7bb5('0x30')](_0x24c708['attributes'],function(_0x46dcc1){var _0x8382c={};_0x8382c[_0x46dcc1]={'$like':'%'+_0x5cbe3a[_0x7bb5('0x3e')][_0x7bb5('0x4a')]+'%'};return _0x8382c;})});}_0x24c708=_[_0x7bb5('0x4c')]({},_0x24c708,_0x5cbe3a[_0x7bb5('0x4e')]);return db[_0x7bb5('0x6c')][_0x7bb5('0x22')]({'where':_0x24c708['where']})[_0x7bb5('0x35')](function(_0x1c5501){_0x182f94['count']=_0x1c5501;if(_0x5cbe3a[_0x7bb5('0x3e')][_0x7bb5('0x4f')]){_0x24c708[_0x7bb5('0x50')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7bb5('0x51')](_0x24c708);})[_0x7bb5('0x35')](function(_0x7ffd39){_0x182f94[_0x7bb5('0x68')]=_0x7ffd39;return _0x182f94;});}})[_0x7bb5('0x35')](respondWithFilteredResult(_0xa77f02,_0x24c708))[_0x7bb5('0x52')](handleError(_0xa77f02,null));};exports[_0x7bb5('0x6d')]=function(_0x212df8,_0x381399,_0x568313){var _0x3b178e={'raw':!![],'where':{}};var _0x36a8bb={};var _0x394b47={'count':0x0,'rows':[]};return db[_0x7bb5('0x39')]['findOne']({'where':{'id':_0x212df8['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x381399,null))['then'](function(_0x295839){if(_0x295839){_0x36a8bb[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db['CmHopperBlack'][_0x7bb5('0x3a')]);_0x36a8bb[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x212df8[_0x7bb5('0x3e')]);_0x36a8bb[_0x7bb5('0x40')]=_['intersection'](_0x36a8bb[_0x7bb5('0x3d')],_0x36a8bb[_0x7bb5('0x3e')]);_0x3b178e[_0x7bb5('0x43')]=_[_0x7bb5('0x41')](_0x36a8bb['model'],qs['fields'](_0x212df8[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x3b178e[_0x7bb5('0x43')]=_0x3b178e[_0x7bb5('0x43')]['length']?_0x3b178e[_0x7bb5('0x43')]:_0x36a8bb[_0x7bb5('0x3d')];if(!_0x212df8[_0x7bb5('0x3e')][_0x7bb5('0x45')](_0x7bb5('0x46'))){_0x3b178e[_0x7bb5('0x1f')]=qs[_0x7bb5('0x1f')](_0x212df8[_0x7bb5('0x3e')]['limit']);_0x3b178e[_0x7bb5('0x21')]=qs['offset'](_0x212df8['query'][_0x7bb5('0x21')]);}_0x3b178e['order']=qs[_0x7bb5('0x48')](_0x212df8[_0x7bb5('0x3e')][_0x7bb5('0x48')]);_0x3b178e[_0x7bb5('0x4b')]=qs[_0x7bb5('0x40')](_[_0x7bb5('0x49')](_0x212df8[_0x7bb5('0x3e')],_0x36a8bb[_0x7bb5('0x40')]));_0x3b178e[_0x7bb5('0x4b')][_0x7bb5('0x66')]=_0x295839['id'];if(_0x212df8[_0x7bb5('0x3e')][_0x7bb5('0x4a')]){_0x3b178e[_0x7bb5('0x4b')]=_[_0x7bb5('0x4c')](_0x3b178e[_0x7bb5('0x4b')],{'$or':_[_0x7bb5('0x30')](_0x3b178e[_0x7bb5('0x43')],function(_0x24ea26){var _0x238178={};_0x238178[_0x24ea26]={'$like':'%'+_0x212df8[_0x7bb5('0x3e')][_0x7bb5('0x4a')]+'%'};return _0x238178;})});}_0x3b178e=_[_0x7bb5('0x4c')]({},_0x3b178e,_0x212df8[_0x7bb5('0x4e')]);return db['CmHopperBlack'][_0x7bb5('0x22')]({'where':_0x3b178e[_0x7bb5('0x4b')]})[_0x7bb5('0x35')](function(_0x5a000f){_0x394b47['count']=_0x5a000f;if(_0x212df8[_0x7bb5('0x3e')][_0x7bb5('0x4f')]){_0x3b178e[_0x7bb5('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x7bb5('0x51')](_0x3b178e);})[_0x7bb5('0x35')](function(_0x191949){_0x394b47[_0x7bb5('0x68')]=_0x191949;return _0x394b47;});}})[_0x7bb5('0x35')](respondWithFilteredResult(_0x381399,_0x3b178e))[_0x7bb5('0x52')](handleError(_0x381399,null));};exports[_0x7bb5('0x6e')]=function(_0x3572ad,_0xf38c79,_0x1621f7){var _0x426623={};var _0x255493={};var _0x509b7a;var _0x483249;return db[_0x7bb5('0x39')][_0x7bb5('0x65')]({'where':{'id':_0x3572ad[_0x7bb5('0x5e')]['id']}})['then'](handleEntityNotFound(_0xf38c79,null))[_0x7bb5('0x35')](function(_0xa8c0b5){if(_0xa8c0b5){_0x509b7a=_0xa8c0b5;_0x255493[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db[_0x7bb5('0x6f')][_0x7bb5('0x3a')]);_0x255493[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x3572ad[_0x7bb5('0x3e')]);_0x255493['filters']=_['intersection'](_0x255493['model'],_0x255493[_0x7bb5('0x3e')]);_0x426623[_0x7bb5('0x43')]=_['intersection'](_0x255493[_0x7bb5('0x3d')],qs[_0x7bb5('0x42')](_0x3572ad[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x426623['attributes']=_0x426623[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x426623[_0x7bb5('0x43')]:_0x255493[_0x7bb5('0x3d')];_0x426623[_0x7bb5('0x47')]=qs[_0x7bb5('0x48')](_0x3572ad[_0x7bb5('0x3e')][_0x7bb5('0x48')]);_0x426623[_0x7bb5('0x4b')]=qs[_0x7bb5('0x40')](_[_0x7bb5('0x49')](_0x3572ad['query'],_0x255493['filters']));if(_0x3572ad[_0x7bb5('0x3e')][_0x7bb5('0x4a')]){_0x426623[_0x7bb5('0x4b')]=_['merge'](_0x426623[_0x7bb5('0x4b')],{'$or':_[_0x7bb5('0x30')](_0x426623[_0x7bb5('0x43')],function(_0x4665b8){var _0x55e537={};_0x55e537[_0x4665b8]={'$like':'%'+_0x3572ad[_0x7bb5('0x3e')][_0x7bb5('0x4a')]+'%'};return _0x55e537;})});}_0x426623=_[_0x7bb5('0x4c')]({},_0x426623,_0x3572ad[_0x7bb5('0x4e')]);return _0x509b7a['getTeams'](_0x426623);}})[_0x7bb5('0x35')](function(_0x543a22){if(_0x543a22){_0x483249=_0x543a22[_0x7bb5('0x44')];if(!_0x3572ad[_0x7bb5('0x3e')][_0x7bb5('0x45')]('nolimit')){_0x426623[_0x7bb5('0x1f')]=qs[_0x7bb5('0x1f')](_0x3572ad[_0x7bb5('0x3e')][_0x7bb5('0x1f')]);_0x426623['offset']=qs[_0x7bb5('0x21')](_0x3572ad[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}return _0x509b7a['getTeams'](_0x426623);}})[_0x7bb5('0x35')](function(_0x2ea39c){if(_0x2ea39c){return _0x2ea39c?{'count':_0x483249,'rows':_0x2ea39c}:null;}})[_0x7bb5('0x35')](respondWithResult(_0xf38c79,null))['catch'](handleError(_0xf38c79,null));};exports[_0x7bb5('0x70')]=function(_0x1d7081,_0x2aeb0b,_0x4c0cdc){var _0x196666=_0x1d7081[_0x7bb5('0x56')][_0x7bb5('0x71')];var _0x19b65e=_[_0x7bb5('0x30')](_0x196666,'id');return db[_0x7bb5('0x6f')][_0x7bb5('0x51')]({'where':{'id':_0x19b65e},'attributes':['id'],'include':[{'model':db[_0x7bb5('0x72')],'as':'Agents','attributes':['id','name',_0x7bb5('0x73'),_0x7bb5('0x74'),_0x7bb5('0x75')],'raw':!![]}]})[_0x7bb5('0x35')](function(_0x58e4ac){if(_0x58e4ac){var _0x12b5cc=_['flatMap'](_0x58e4ac,function(_0x401655){var _0x2224b2=_0x401655['get']({'plain':!![]});_0x2224b2[_0x7bb5('0x76')]['forEach'](function(_0x388c57){_0x388c57['penalty']=_[_0x7bb5('0x54')](_0x196666,{'id':_0x2224b2['id']})[_0x7bb5('0x77')];});return _0x2224b2[_0x7bb5('0x76')];});return db[_0x7bb5('0x39')][_0x7bb5('0x54')]({'where':{'id':_0x1d7081['params']['id']}})[_0x7bb5('0x35')](function(_0x1a4b0d){return db[_0x7bb5('0x78')][_0x7bb5('0x79')](function(_0x4ff7cd){return _0x1a4b0d[_0x7bb5('0x70')](_0x19b65e,{'transaction':_0x4ff7cd})[_0x7bb5('0x35')](function(){return BPromise['each'](_0x196666,function(_0x1ed2e2){return db[_0x7bb5('0x7a')][_0x7bb5('0x7b')]({'TeamId':_0x1ed2e2['id'],'VoiceQueueId':_0x1d7081[_0x7bb5('0x5e')]['id'],'penalty':_0x1ed2e2[_0x7bb5('0x77')]},{'transaction':_0x4ff7cd});});})[_0x7bb5('0x35')](function(){return BPromise[_0x7bb5('0x7c')](_0x12b5cc,function(_0x531c66){return db[_0x7bb5('0x7d')][_0x7bb5('0x7e')]({'where':{'UserId':_0x531c66['id'],'VoiceQueueId':_0x1d7081['params']['id']},'defaults':{'penalty':_0x531c66[_0x7bb5('0x77')]},'transaction':_0x4ff7cd});});})[_0x7bb5('0x35')](function(){return BPromise[_0x7bb5('0x7c')](_[_0x7bb5('0x4a')](_0x12b5cc,{'online':!![]}),function(_0x128128){return db[_0x7bb5('0x7f')][_0x7bb5('0x7b')]({'membername':_0x128128[_0x7bb5('0x33')],'UserId':_0x128128['id'],'queue_name':_0x1a4b0d[_0x7bb5('0x33')],'VoiceQueueId':_0x1a4b0d['id'],'interface':_[_0x7bb5('0x80')](_0x128128[_0x7bb5('0x75')])?util[_0x7bb5('0x81')](_0x7bb5('0x82'),_0x128128['name']):_0x128128[_0x7bb5('0x75')],'paused':_0x128128[_0x7bb5('0x74')]||![],'penalty':_0x128128[_0x7bb5('0x77')]},{'transaction':_0x4ff7cd});});})[_0x7bb5('0x35')](function(){_0x12b5cc['forEach'](function(_0x342db3){socket[_0x7bb5('0x83')](_0x7bb5('0x84'),{'UserId':_0x342db3['id'],'VoiceQueueId':_0x1a4b0d['id']});});});});});}})[_0x7bb5('0x35')](respondWithStatusCode(_0x2aeb0b,null))['catch'](handleError(_0x2aeb0b,null));};exports[_0x7bb5('0x85')]=function(_0x1e61aa,_0x35cb64,_0x2721c5){return db[_0x7bb5('0x6f')][_0x7bb5('0x51')]({'where':{'id':_0x1e61aa['query'][_0x7bb5('0x86')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7bb5('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x35cb64,null))[_0x7bb5('0x35')](function(_0x4b4935){var _0xb674e2=_[_0x7bb5('0x30')](_0x4b4935,'id');var _0x11684c=[];var _0x1b4f80=[];var _0x2ff283=squel[_0x7bb5('0x87')]();_0x2ff283['field'](_0x7bb5('0x88'))['from'](_0x7bb5('0x89'),'tq')[_0x7bb5('0x8a')](_0x7bb5('0x8b'),'ut',_0x7bb5('0x8c'))[_0x7bb5('0x4b')](_0x7bb5('0x8d'),_0x1e61aa[_0x7bb5('0x5e')]['id']);for(var _0xd8c47d=0x0;_0xd8c47d<_0x4b4935[_0x7bb5('0x44')];_0xd8c47d+=0x1){let _0x332447=_0x4b4935[_0xd8c47d];for(var _0x105229=0x0;_0x105229<_0x332447[_0x7bb5('0x76')][_0x7bb5('0x44')];_0x105229+=0x1){let _0x3c31b0=_0x332447[_0x7bb5('0x76')][_0x105229];var _0x172ea7=_0x2ff283[_0x7bb5('0x5d')]();_0x172ea7[_0x7bb5('0x4b')](_0x7bb5('0x8e'),_0x3c31b0['id']);_0x1b4f80[_0x7bb5('0x8f')](db[_0x7bb5('0x78')]['query'](_0x172ea7[_0x7bb5('0x90')](),{'type':db['sequelize'][_0x7bb5('0x91')][_0x7bb5('0x92')]})['then'](function(_0x2bccf7){if(_0x2bccf7[_0x7bb5('0x44')]===0x1){return _0x3c31b0['id'];}else{var _0x47fc4f=_['every'](_[_0x7bb5('0x30')](_0x2bccf7,_0x7bb5('0x93')),function(_0x3717ce){return _[_0x7bb5('0x94')](_0xb674e2,_0x3717ce);});if(_0x47fc4f){return _0x3c31b0['id'];}}}));}}return BPromise[_0x7bb5('0x95')](_0x1b4f80)['then'](function(_0x17b054){_0x11684c=_(_0x11684c)[_0x7bb5('0x96')](_0x17b054)['compact']()[_0x7bb5('0x31')]();return db[_0x7bb5('0x39')]['find']({'where':{'id':_0x1e61aa[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](function(_0x3e6c90){return db[_0x7bb5('0x78')]['transaction'](function(_0x1f01f8){return _0x3e6c90[_0x7bb5('0x85')](_0x1e61aa[_0x7bb5('0x3e')][_0x7bb5('0x86')],{'transaction':_0x1f01f8})[_0x7bb5('0x35')](function(){if(!_[_0x7bb5('0x97')](_0x11684c)){return _0x3e6c90[_0x7bb5('0x98')](_0x11684c,{'transaction':_0x1f01f8})[_0x7bb5('0x35')](function(){return db['UserVoiceQueueRt'][_0x7bb5('0x2a')]({'where':{'VoiceQueueId':_0x1e61aa[_0x7bb5('0x5e')]['id'],'UserId':_0x11684c},'transaction':_0x1f01f8});});}})[_0x7bb5('0x35')](function(){_0x11684c[_0x7bb5('0x99')](function(_0x4e3f94){socket[_0x7bb5('0x83')](_0x7bb5('0x9a'),{'UserId':_0x4e3f94,'VoiceQueueId':_0x3e6c90['id']});});});});});});})[_0x7bb5('0x35')](respondWithStatusCode(_0x35cb64,null))[_0x7bb5('0x52')](handleError(_0x35cb64,null));};exports[_0x7bb5('0x9b')]=function(_0x426616,_0x3bf140,_0x629d32){var _0x5c35fc,_0x1d3bb9;return db[_0x7bb5('0x39')][_0x7bb5('0x54')]({'where':{'id':_0x426616[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x3bf140,null))[_0x7bb5('0x35')](function(_0x2befce){if(_0x2befce){_0x1d3bb9=_0x2befce;return _0x2befce[_0x7bb5('0x9b')](_0x426616['body'][_0x7bb5('0x86')],_[_0x7bb5('0x60')](_0x426616[_0x7bb5('0x56')],[_0x7bb5('0x86'),'id'])||{})['spread'](function(_0x5eadc7){for(var _0x154b34=0x0;_0x154b34<_0x426616[_0x7bb5('0x56')][_0x7bb5('0x86')][_0x7bb5('0x44')];_0x154b34+=0x1){socket[_0x7bb5('0x83')](_0x7bb5('0x84'),{'UserId':Number(_0x426616[_0x7bb5('0x56')][_0x7bb5('0x86')][_0x154b34]),'VoiceQueueId':Number(_0x426616[_0x7bb5('0x5e')]['id'])});}return _0x5eadc7;});}})[_0x7bb5('0x35')](function(_0x1ef71d){_0x5c35fc=_0x1ef71d||[];if(_0x1d3bb9){return db['User'][_0x7bb5('0x51')]({'where':{'id':_0x426616['body'][_0x7bb5('0x86')]},'attributes':['id',_0x7bb5('0x33'),_0x7bb5('0x73'),_0x7bb5('0x74'),'interface'],'raw':!![]});}})[_0x7bb5('0x35')](function(_0x51f78a){if(!_[_0x7bb5('0x97')](_0x51f78a)){var _0x3cfe0b=[];for(var _0x15e2bd=0x0;_0x15e2bd<_0x51f78a[_0x7bb5('0x44')];_0x15e2bd++){if(_0x51f78a[_0x15e2bd][_0x7bb5('0x73')]){_0x3cfe0b['push'](db['UserVoiceQueueRt'][_0x7bb5('0x7b')]({'membername':_0x51f78a[_0x15e2bd]['name'],'UserId':_0x51f78a[_0x15e2bd]['id'],'queue_name':_0x1d3bb9[_0x7bb5('0x33')],'VoiceQueueId':_0x1d3bb9['id'],'interface':_[_0x7bb5('0x80')](_0x51f78a[_0x15e2bd][_0x7bb5('0x75')])?util[_0x7bb5('0x81')](_0x7bb5('0x82'),_0x51f78a[_0x15e2bd][_0x7bb5('0x33')]):_0x51f78a[_0x15e2bd][_0x7bb5('0x75')],'paused':_0x51f78a[_0x15e2bd]['voicePause']||![],'penalty':_0x426616[_0x7bb5('0x56')][_0x7bb5('0x77')]||0x0}));}}return BPromise[_0x7bb5('0x95')](_0x3cfe0b);}})[_0x7bb5('0x35')](function(){return _0x5c35fc;})[_0x7bb5('0x35')](respondWithResult(_0x3bf140,null))[_0x7bb5('0x52')](handleError(_0x3bf140,null));};exports[_0x7bb5('0x98')]=function(_0x48d857,_0x3edf26,_0x449efd){return db[_0x7bb5('0x39')]['find']({'where':{'id':_0x48d857['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x3edf26,null))[_0x7bb5('0x35')](function(_0x3da042){if(_0x3da042){return _0x3da042['removeAgents'](_0x48d857['query'][_0x7bb5('0x86')])[_0x7bb5('0x35')](function(){if(_[_0x7bb5('0x9c')](_0x48d857['query'][_0x7bb5('0x86')])){for(var _0x432d29=0x0;_0x432d29<_0x48d857['query'][_0x7bb5('0x86')]['length'];_0x432d29+=0x1){socket[_0x7bb5('0x83')](_0x7bb5('0x9a'),{'UserId':Number(_0x48d857['query'][_0x7bb5('0x86')][_0x432d29]),'VoiceQueueId':Number(_0x48d857['params']['id'])});}}else{socket[_0x7bb5('0x83')]('userVoiceQueue:remove',{'UserId':Number(_0x48d857[_0x7bb5('0x3e')][_0x7bb5('0x86')]),'VoiceQueueId':Number(_0x48d857[_0x7bb5('0x5e')]['id'])});}});}})[_0x7bb5('0x35')](function(_0x2a958d){return db[_0x7bb5('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x48d857[_0x7bb5('0x5e')]['id'],'UserId':_0x48d857[_0x7bb5('0x3e')][_0x7bb5('0x86')]}})[_0x7bb5('0x35')](function(){return _0x2a958d;});})[_0x7bb5('0x35')](respondWithStatusCode(_0x3edf26,null))[_0x7bb5('0x52')](handleError(_0x3edf26,null));};exports[_0x7bb5('0x9d')]=function(_0x4c0a4a,_0x22e97e,_0x5f6cbf){var _0x5d5fba={};var _0x39e6f5={};var _0x2fcca9;var _0x25930f;return db[_0x7bb5('0x39')][_0x7bb5('0x65')]({'where':{'id':_0x4c0a4a[_0x7bb5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x22e97e,null))[_0x7bb5('0x35')](function(_0x9579a4){if(_0x9579a4){_0x2fcca9=_0x9579a4;_0x39e6f5[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db[_0x7bb5('0x72')][_0x7bb5('0x3a')]);_0x39e6f5[_0x7bb5('0x3e')]=_['keys'](_0x4c0a4a[_0x7bb5('0x3e')]);_0x39e6f5[_0x7bb5('0x40')]=_[_0x7bb5('0x41')](_0x39e6f5[_0x7bb5('0x3d')],_0x39e6f5[_0x7bb5('0x3e')]);_0x5d5fba[_0x7bb5('0x43')]=_[_0x7bb5('0x41')](_0x39e6f5[_0x7bb5('0x3d')],qs[_0x7bb5('0x42')](_0x4c0a4a[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x5d5fba[_0x7bb5('0x43')]=_0x5d5fba[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x5d5fba[_0x7bb5('0x43')]:_0x39e6f5['model'];_0x5d5fba['order']=qs[_0x7bb5('0x48')](_0x4c0a4a['query'][_0x7bb5('0x48')]);_0x5d5fba[_0x7bb5('0x4b')]=qs[_0x7bb5('0x40')](_[_0x7bb5('0x49')](_0x4c0a4a[_0x7bb5('0x3e')],_0x39e6f5['filters']));if(_0x4c0a4a['query']['filter']){_0x5d5fba[_0x7bb5('0x4b')]=_[_0x7bb5('0x4c')](_0x5d5fba['where'],{'$or':_[_0x7bb5('0x30')](_0x5d5fba['attributes'],function(_0x3e35cb){var _0x47687f={};_0x47687f[_0x3e35cb]={'$like':'%'+_0x4c0a4a['query'][_0x7bb5('0x4a')]+'%'};return _0x47687f;})});}_0x5d5fba=_[_0x7bb5('0x4c')]({},_0x5d5fba,_0x4c0a4a[_0x7bb5('0x4e')]);return _0x2fcca9[_0x7bb5('0x9d')](_0x5d5fba);}})[_0x7bb5('0x35')](function(_0x3740a0){if(_0x3740a0){_0x25930f=_0x3740a0[_0x7bb5('0x44')];if(!_0x4c0a4a[_0x7bb5('0x3e')]['hasOwnProperty']('nolimit')){_0x5d5fba['limit']=qs['limit'](_0x4c0a4a['query'][_0x7bb5('0x1f')]);_0x5d5fba[_0x7bb5('0x21')]=qs[_0x7bb5('0x21')](_0x4c0a4a[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}return _0x2fcca9[_0x7bb5('0x9d')](_0x5d5fba);}})['then'](function(_0x590d54){if(_0x590d54){return _0x590d54?{'count':_0x25930f,'rows':_0x590d54}:null;}})['then'](respondWithResult(_0x22e97e,null))[_0x7bb5('0x52')](handleError(_0x22e97e,null));};exports[_0x7bb5('0x9e')]=function(_0x5ef0f3,_0x1c484c,_0x55c3fc){var _0x8db612={};var _0x24196d={};var _0x86aa08;var _0x179bc0;return db['VoiceQueue'][_0x7bb5('0x65')]({'where':{'id':_0x5ef0f3[_0x7bb5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1c484c,null))['then'](function(_0x3024e7){if(_0x3024e7){_0x86aa08=_0x3024e7;_0x24196d[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db[_0x7bb5('0x7f')][_0x7bb5('0x3a')]);_0x24196d['query']=_[_0x7bb5('0x3f')](_0x5ef0f3[_0x7bb5('0x3e')]);_0x24196d['filters']=_[_0x7bb5('0x41')](_0x24196d[_0x7bb5('0x3d')],_0x24196d[_0x7bb5('0x3e')]);_0x8db612[_0x7bb5('0x43')]=_[_0x7bb5('0x41')](_0x24196d[_0x7bb5('0x3d')],qs[_0x7bb5('0x42')](_0x5ef0f3[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x8db612[_0x7bb5('0x43')]=_0x8db612[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x8db612['attributes']:_0x24196d[_0x7bb5('0x3d')];_0x8db612[_0x7bb5('0x47')]=qs['sort'](_0x5ef0f3[_0x7bb5('0x3e')][_0x7bb5('0x48')]);_0x8db612[_0x7bb5('0x4b')]=qs['filters'](_[_0x7bb5('0x49')](_0x5ef0f3['query'],_0x24196d[_0x7bb5('0x40')]));if(_0x5ef0f3[_0x7bb5('0x3e')]['filter']){_0x8db612[_0x7bb5('0x4b')]=_['merge'](_0x8db612[_0x7bb5('0x4b')],{'$or':_[_0x7bb5('0x30')](_0x8db612['attributes'],function(_0x40fa8a){var _0x4e4d43={};_0x4e4d43[_0x40fa8a]={'$like':'%'+_0x5ef0f3[_0x7bb5('0x3e')][_0x7bb5('0x4a')]+'%'};return _0x4e4d43;})});}_0x8db612=_[_0x7bb5('0x4c')]({},_0x8db612,_0x5ef0f3[_0x7bb5('0x4e')]);return _0x86aa08[_0x7bb5('0x9e')](_0x8db612);}})[_0x7bb5('0x35')](function(_0x1b09f2){if(_0x1b09f2){_0x179bc0=_0x1b09f2['length'];if(!_0x5ef0f3['query']['hasOwnProperty']('nolimit')){_0x8db612[_0x7bb5('0x1f')]=qs['limit'](_0x5ef0f3[_0x7bb5('0x3e')][_0x7bb5('0x1f')]);_0x8db612[_0x7bb5('0x21')]=qs[_0x7bb5('0x21')](_0x5ef0f3[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}return _0x86aa08[_0x7bb5('0x9e')](_0x8db612);}})[_0x7bb5('0x35')](function(_0x19f7f6){return _0x19f7f6?{'count':_0x179bc0,'rows':_0x19f7f6}:null;})[_0x7bb5('0x35')](respondWithResult(_0x1c484c,null))['catch'](handleError(_0x1c484c,null));};exports[_0x7bb5('0x9f')]=function(_0x265363,_0x5a3f25,_0x503139){var _0x4a1078={};var _0x5edb9c={};var _0x555180;var _0x3a7cee;return db[_0x7bb5('0x39')]['findOne']({'where':{'id':_0x265363[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x5a3f25,null))[_0x7bb5('0x35')](function(_0x582f22){if(_0x582f22){_0x555180=_0x582f22;_0x5edb9c[_0x7bb5('0x3d')]=_[_0x7bb5('0x3f')](db[_0x7bb5('0xa0')][_0x7bb5('0x3a')]);_0x5edb9c[_0x7bb5('0x3e')]=_[_0x7bb5('0x3f')](_0x265363[_0x7bb5('0x3e')]);_0x5edb9c[_0x7bb5('0x40')]=_[_0x7bb5('0x41')](_0x5edb9c['model'],_0x5edb9c[_0x7bb5('0x3e')]);_0x4a1078[_0x7bb5('0x43')]=_[_0x7bb5('0x41')](_0x5edb9c[_0x7bb5('0x3d')],qs['fields'](_0x265363['query'][_0x7bb5('0x42')]));_0x4a1078[_0x7bb5('0x43')]=_0x4a1078[_0x7bb5('0x43')][_0x7bb5('0x44')]?_0x4a1078[_0x7bb5('0x43')]:_0x5edb9c[_0x7bb5('0x3d')];_0x4a1078[_0x7bb5('0x47')]=qs[_0x7bb5('0x48')](_0x265363[_0x7bb5('0x3e')][_0x7bb5('0x48')]);_0x4a1078[_0x7bb5('0x4b')]=qs[_0x7bb5('0x40')](_[_0x7bb5('0x49')](_0x265363[_0x7bb5('0x3e')],_0x5edb9c[_0x7bb5('0x40')]));if(_0x265363['query'][_0x7bb5('0x4a')]){_0x4a1078[_0x7bb5('0x4b')]=_[_0x7bb5('0x4c')](_0x4a1078[_0x7bb5('0x4b')],{'$or':_[_0x7bb5('0x30')](_0x4a1078[_0x7bb5('0x43')],function(_0x202571){var _0x456d98={};_0x456d98[_0x202571]={'$like':'%'+_0x265363[_0x7bb5('0x3e')]['filter']+'%'};return _0x456d98;})});}_0x4a1078=_[_0x7bb5('0x4c')]({},_0x4a1078,_0x265363['options']);return _0x555180['getLists'](_0x4a1078);}})[_0x7bb5('0x35')](function(_0x29c6e3){if(_0x29c6e3){_0x3a7cee=_0x29c6e3['length'];if(!_0x265363[_0x7bb5('0x3e')][_0x7bb5('0x45')](_0x7bb5('0x46'))){_0x4a1078['limit']=qs[_0x7bb5('0x1f')](_0x265363[_0x7bb5('0x3e')][_0x7bb5('0x1f')]);_0x4a1078[_0x7bb5('0x21')]=qs['offset'](_0x265363[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}return _0x555180['getLists'](_0x4a1078);}})['then'](function(_0xee9f73){if(_0xee9f73){return _0xee9f73?{'count':_0x3a7cee,'rows':_0xee9f73}:null;}})[_0x7bb5('0x35')](respondWithResult(_0x5a3f25,null))[_0x7bb5('0x52')](handleError(_0x5a3f25,null));};exports[_0x7bb5('0xa1')]=function(_0x2de212,_0x40927c,_0x2d6dfc){var _0x2f4b2b,_0x158693;return db[_0x7bb5('0x39')][_0x7bb5('0x54')]({'where':{'id':_0x2de212['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x40927c,null))['then'](function(_0x761aef){if(_0x761aef){_0x158693=_0x761aef;return _0x761aef[_0x7bb5('0xa1')](_0x2de212[_0x7bb5('0x56')][_0x7bb5('0x86')],_[_0x7bb5('0x60')](_0x2de212['body'],[_0x7bb5('0x86'),'id'])||{});}return null;})['spread'](function(_0x41824d){var _0x1603c0;_0x2f4b2b=_0x41824d||[];var _0xca2b67=[];if(_0x41824d){for(var _0x9e30dc=0x0;_0x9e30dc<_0x41824d['length'];_0x9e30dc+=0x1){var _0x4a46a4=_0x41824d[_0x9e30dc][_0x7bb5('0x5f')]({'plain':!![]});_0x158693[_0x7bb5('0xa2')]=_0x2de212[_0x7bb5('0x56')][_0x7bb5('0xa2')]?_0x2de212['body']['dialCheckDuplicateType']:_0x158693[_0x7bb5('0xa2')];switch(_0x158693[_0x7bb5('0xa2')]){case'always':_0x1603c0=squel[_0x7bb5('0xa3')]()[_0x7bb5('0xa4')](_0x7bb5('0xa5'))[_0x7bb5('0xa6')]([_0x7bb5('0xa7'),'scheduledAt',_0x7bb5('0xa8'),_0x7bb5('0xa9'),'VoiceQueueId',_0x7bb5('0x61'),_0x7bb5('0x62')],squel[_0x7bb5('0x87')]()[_0x7bb5('0xaa')](_0x7bb5('0xa7'),_0x7bb5('0xa7'))[_0x7bb5('0xaa')](_0x7bb5('0xab'),'scheduledAt')[_0x7bb5('0xaa')]('id',_0x7bb5('0xa8'))[_0x7bb5('0xaa')](_0x4a46a4[_0x7bb5('0xac')][_0x7bb5('0x90')](),_0x7bb5('0xa9'))[_0x7bb5('0xaa')](_0x2de212[_0x7bb5('0x5e')]['id']['toString'](),_0x7bb5('0x66'))['field'](_0x7bb5('0xab'),_0x7bb5('0x61'))[_0x7bb5('0xaa')]('NOW()',_0x7bb5('0x62'))[_0x7bb5('0xad')]('cm_contacts')[_0x7bb5('0x4b')]('deletedAt\x20IS\x20NULL')[_0x7bb5('0x4b')](_0x7bb5('0xae'),_0x4a46a4[_0x7bb5('0xac')][_0x7bb5('0x90')]())[_0x7bb5('0x4b')](_0x7bb5('0xaf'))['where'](_0x7bb5('0xb0'),squel[_0x7bb5('0x87')]()['field'](_0x7bb5('0xb1'))['from'](_0x7bb5('0xb2'))[_0x7bb5('0x4b')](_0x7bb5('0x8d'),_0x2de212[_0x7bb5('0x5e')]['id'][_0x7bb5('0x90')]()))[_0x7bb5('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7bb5('0x87')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x7bb5('0xa5'))['where']('VoiceQueueId\x20=\x20?',_0x2de212[_0x7bb5('0x5e')]['id']['toString']())))[_0x7bb5('0x90')]();break;case'onlyIfOpen':_0x1603c0=squel[_0x7bb5('0xa3')]()[_0x7bb5('0xa4')](_0x7bb5('0xa5'))[_0x7bb5('0xa6')]([_0x7bb5('0xa7'),_0x7bb5('0xb3'),_0x7bb5('0xa8'),_0x7bb5('0xa9'),_0x7bb5('0x66'),_0x7bb5('0x61'),_0x7bb5('0x62')],squel[_0x7bb5('0x87')]()[_0x7bb5('0xaa')](_0x7bb5('0xa7'),'phone')[_0x7bb5('0xaa')](_0x7bb5('0xab'),_0x7bb5('0xb3'))[_0x7bb5('0xaa')]('id',_0x7bb5('0xa8'))[_0x7bb5('0xaa')](_0x4a46a4['CmListId'][_0x7bb5('0x90')](),_0x7bb5('0xa9'))[_0x7bb5('0xaa')](_0x2de212['params']['id'][_0x7bb5('0x90')](),_0x7bb5('0x66'))['field'](_0x7bb5('0xab'),_0x7bb5('0x61'))[_0x7bb5('0xaa')](_0x7bb5('0xab'),'updatedAt')['from'](_0x7bb5('0xb4'))[_0x7bb5('0x4b')](_0x7bb5('0xb5'))[_0x7bb5('0x4b')](_0x7bb5('0xae'),_0x4a46a4[_0x7bb5('0xac')][_0x7bb5('0x90')]())[_0x7bb5('0x4b')](_0x7bb5('0xaf'))['where'](_0x7bb5('0xb0'),squel[_0x7bb5('0x87')]()['field'](_0x7bb5('0xb6'))[_0x7bb5('0xad')](_0x7bb5('0xa5'))[_0x7bb5('0x4b')](_0x7bb5('0x8d'),_0x2de212[_0x7bb5('0x5e')]['id'][_0x7bb5('0x90')]())))[_0x7bb5('0x90')]();break;default:_0x1603c0=squel[_0x7bb5('0xa3')]()[_0x7bb5('0xa4')](_0x7bb5('0xa5'))[_0x7bb5('0xa6')]([_0x7bb5('0xa7'),_0x7bb5('0xb3'),_0x7bb5('0xa8'),'ListId',_0x7bb5('0x66'),'createdAt',_0x7bb5('0x62')],squel['select']()[_0x7bb5('0xaa')]('phone',_0x7bb5('0xa7'))[_0x7bb5('0xaa')](_0x7bb5('0xab'),_0x7bb5('0xb3'))[_0x7bb5('0xaa')]('id',_0x7bb5('0xa8'))[_0x7bb5('0xaa')](_0x4a46a4[_0x7bb5('0xac')][_0x7bb5('0x90')](),_0x7bb5('0xa9'))['field'](_0x2de212[_0x7bb5('0x5e')]['id'][_0x7bb5('0x90')](),_0x7bb5('0x66'))[_0x7bb5('0xaa')](_0x7bb5('0xab'),_0x7bb5('0x61'))[_0x7bb5('0xaa')](_0x7bb5('0xab'),_0x7bb5('0x62'))[_0x7bb5('0xad')](_0x7bb5('0xb4'))[_0x7bb5('0x4b')](_0x7bb5('0xb5'))[_0x7bb5('0x4b')](_0x7bb5('0xae'),_0x4a46a4[_0x7bb5('0xac')][_0x7bb5('0x90')]())['where'](_0x7bb5('0xaf')))[_0x7bb5('0x90')]();}_0xca2b67['push'](db['sequelize'][_0x7bb5('0x3e')](_0x1603c0));}return BPromise['all'](_0xca2b67);}})['then'](function(){return _0x2f4b2b;})[_0x7bb5('0x35')](respondWithResult(_0x40927c,null))[_0x7bb5('0x52')](handleError(_0x40927c,null));};exports[_0x7bb5('0xb7')]=function(_0x702e39,_0x121890,_0x14bf42){return db[_0x7bb5('0x39')][_0x7bb5('0x54')]({'where':{'id':_0x702e39['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x121890,null))[_0x7bb5('0x35')](function(_0x3ddb0b){if(_0x3ddb0b){return _0x3ddb0b['removeLists'](_0x702e39[_0x7bb5('0x3e')]['ids']);}})[_0x7bb5('0x35')](function(_0x15f895){if(_0x15f895){return db[_0x7bb5('0x67')]['destroy']({'where':{'ListId':_0x702e39[_0x7bb5('0x3e')]['ids'],'VoiceQueueId':_0x702e39[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](function(){return _0x15f895;});}})[_0x7bb5('0x35')](respondWithStatusCode(_0x121890,null))[_0x7bb5('0x52')](handleError(_0x121890,null));};exports[_0x7bb5('0xb8')]=function(_0x4cc377,_0x24e56f,_0x47ed2c){var _0x576473={};var _0x57cc06={};var _0x48134a;var _0x1a54b5;return db['VoiceQueue'][_0x7bb5('0x65')]({'where':{'id':_0x4cc377['params']['id']}})['then'](handleEntityNotFound(_0x24e56f,null))['then'](function(_0x383b28){if(_0x383b28){_0x48134a=_0x383b28;_0x57cc06['model']=_[_0x7bb5('0x3f')](db['CmList'][_0x7bb5('0x3a')]);_0x57cc06['query']=_['keys'](_0x4cc377[_0x7bb5('0x3e')]);_0x57cc06[_0x7bb5('0x40')]=_[_0x7bb5('0x41')](_0x57cc06[_0x7bb5('0x3d')],_0x57cc06[_0x7bb5('0x3e')]);_0x576473[_0x7bb5('0x43')]=_[_0x7bb5('0x41')](_0x57cc06['model'],qs[_0x7bb5('0x42')](_0x4cc377[_0x7bb5('0x3e')][_0x7bb5('0x42')]));_0x576473[_0x7bb5('0x43')]=_0x576473['attributes'][_0x7bb5('0x44')]?_0x576473[_0x7bb5('0x43')]:_0x57cc06['model'];_0x576473[_0x7bb5('0x47')]=qs[_0x7bb5('0x48')](_0x4cc377[_0x7bb5('0x3e')][_0x7bb5('0x48')]);_0x576473[_0x7bb5('0x4b')]=qs[_0x7bb5('0x40')](_[_0x7bb5('0x49')](_0x4cc377[_0x7bb5('0x3e')],_0x57cc06[_0x7bb5('0x40')]));if(_0x4cc377[_0x7bb5('0x3e')][_0x7bb5('0x4a')]){_0x576473['where']=_['merge'](_0x576473['where'],{'$or':_[_0x7bb5('0x30')](_0x576473['attributes'],function(_0x199b37){var _0x1e3719={};_0x1e3719[_0x199b37]={'$like':'%'+_0x4cc377[_0x7bb5('0x3e')]['filter']+'%'};return _0x1e3719;})});}_0x576473=_['merge']({},_0x576473,_0x4cc377[_0x7bb5('0x4e')]);return _0x48134a['getBlackLists'](_0x576473);}})[_0x7bb5('0x35')](function(_0x41a1cb){if(_0x41a1cb){_0x1a54b5=_0x41a1cb['length'];if(!_0x4cc377[_0x7bb5('0x3e')][_0x7bb5('0x45')](_0x7bb5('0x46'))){_0x576473[_0x7bb5('0x1f')]=qs[_0x7bb5('0x1f')](_0x4cc377['query'][_0x7bb5('0x1f')]);_0x576473[_0x7bb5('0x21')]=qs[_0x7bb5('0x21')](_0x4cc377[_0x7bb5('0x3e')][_0x7bb5('0x21')]);}return _0x48134a[_0x7bb5('0xb8')](_0x576473);}})['then'](function(_0x51db75){if(_0x51db75){return _0x51db75?{'count':_0x1a54b5,'rows':_0x51db75}:null;}})[_0x7bb5('0x35')](respondWithResult(_0x24e56f,null))[_0x7bb5('0x52')](handleError(_0x24e56f,null));};exports[_0x7bb5('0xb9')]=function(_0x477dfc,_0x49bc68,_0x24805f){var _0x8710e1,_0x4132fe;return db[_0x7bb5('0x39')]['find']({'where':{'id':_0x477dfc['params']['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x49bc68,null))[_0x7bb5('0x35')](function(_0x9975e1){if(_0x9975e1){_0x4132fe=_0x9975e1;return _0x9975e1[_0x7bb5('0xb9')](_0x477dfc[_0x7bb5('0x56')]['ids'],_[_0x7bb5('0x60')](_0x477dfc[_0x7bb5('0x56')],[_0x7bb5('0x86'),'id'])||{});}return null;})[_0x7bb5('0xba')](function(_0x41e688){var _0x29d897;_0x8710e1=_0x41e688||[];var _0xbb99d4=[];if(_0x41e688){for(var _0x396c89=0x0;_0x396c89<_0x41e688['length'];_0x396c89+=0x1){var _0x359c46=_0x41e688[_0x396c89][_0x7bb5('0x5f')]({'plain':!![]});_0x29d897=squel['insert']()['into'](_0x7bb5('0xbb'))[_0x7bb5('0xa6')]([_0x7bb5('0xa7'),_0x7bb5('0xa8'),_0x7bb5('0xa9'),'VoiceQueueId',_0x7bb5('0x61'),'updatedAt'],squel['select']()[_0x7bb5('0xaa')](_0x7bb5('0xa7'),_0x7bb5('0xa7'))[_0x7bb5('0xaa')]('id','ContactId')['field'](_0x359c46[_0x7bb5('0xac')][_0x7bb5('0x90')](),_0x7bb5('0xa9'))[_0x7bb5('0xaa')](_0x477dfc[_0x7bb5('0x5e')]['id'][_0x7bb5('0x90')](),_0x7bb5('0x66'))['field'](_0x7bb5('0xab'),'createdAt')[_0x7bb5('0xaa')](_0x7bb5('0xab'),_0x7bb5('0x62'))[_0x7bb5('0xad')]('cm_contacts')[_0x7bb5('0x4b')](_0x7bb5('0xb5'))['where'](_0x7bb5('0xae'),_0x359c46[_0x7bb5('0xac')][_0x7bb5('0x90')]())[_0x7bb5('0x4b')](_0x7bb5('0xaf')))[_0x7bb5('0x90')]();_0xbb99d4['push'](db[_0x7bb5('0x78')][_0x7bb5('0x3e')](_0x29d897));}return BPromise[_0x7bb5('0x95')](_0xbb99d4);}})['then'](function(){return _0x8710e1;})['then'](respondWithResult(_0x49bc68,null))[_0x7bb5('0x52')](handleError(_0x49bc68,null));};exports['removeBlackLists']=function(_0x5a1eeb,_0x2f1d6e,_0x543053){return db[_0x7bb5('0x39')][_0x7bb5('0x54')]({'where':{'id':_0x5a1eeb[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](handleEntityNotFound(_0x2f1d6e,null))[_0x7bb5('0x35')](function(_0xbca858){if(_0xbca858){return _0xbca858[_0x7bb5('0xbc')](_0x5a1eeb[_0x7bb5('0x3e')][_0x7bb5('0x86')]);}})[_0x7bb5('0x35')](function(_0x12159e){if(_0x12159e){return db[_0x7bb5('0xbd')]['destroy']({'where':{'ListId':_0x5a1eeb[_0x7bb5('0x3e')][_0x7bb5('0x86')],'VoiceQueueId':_0x5a1eeb[_0x7bb5('0x5e')]['id']}})[_0x7bb5('0x35')](function(){return _0x12159e;});}})[_0x7bb5('0x35')](respondWithStatusCode(_0x2f1d6e,null))[_0x7bb5('0x52')](handleError(_0x2f1d6e,null));};
\ No newline at end of file
+var _0x4b63=['userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','isArray','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','NOW()','scheduledAt','CmListId','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','onlyIfOpen','insert','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','apply','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','map','value','includes','find','name','UserProfileResource','destroy','sendStatus','send','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','order','sort','where','pick','filter','type','merge','options','include','findAll','rows','show','fields','includeAll','create','body','user','get','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','catch','getHoppers','findOne','hasOwnProperty','nolimit','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','voicePause','interface','forEach','transaction','TeamVoiceQueue','upsert','penalty','each','UserVoiceQueue','isNil','SIP/%s','emit','removeTeams','ids','User','select','field','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','TeamId','all','union','isEmpty','removeAgents','UserVoiceQueueRt'];(function(_0x28e096,_0x594ac0){var _0x8769a=function(_0x2665da){while(--_0x2665da){_0x28e096['push'](_0x28e096['shift']());}};_0x8769a(++_0x594ac0);}(_0x4b63,0xd5));var _0x34b6=function(_0x59a5d0,_0x4b3308){_0x59a5d0=_0x59a5d0-0x0;var _0x6840ac=_0x4b63[_0x59a5d0];return _0x6840ac;};'use strict';var emlformat=require(_0x34b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x34b6('0x1'));var jsonpatch=require(_0x34b6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34b6('0x3'));var Mustache=require('mustache');var util=require(_0x34b6('0x4'));var path=require(_0x34b6('0x5'));var sox=require(_0x34b6('0x6'));var csv=require(_0x34b6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x34b6('0x8'));var _=require(_0x34b6('0x9'));var squel=require(_0x34b6('0xa'));var crypto=require(_0x34b6('0xb'));var jsforce=require(_0x34b6('0xc'));var deskjs=require(_0x34b6('0xd'));var toCsv=require(_0x34b6('0x7'));var querystring=require(_0x34b6('0xe'));var Papa=require(_0x34b6('0xf'));var Redis=require('ioredis');var authService=require(_0x34b6('0x10'));var qs=require(_0x34b6('0x11'));var as=require(_0x34b6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x34b6('0x13'))('api');var utils=require(_0x34b6('0x14'));var config=require(_0x34b6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x34b6('0x16'))['db'];config[_0x34b6('0x17')]=_[_0x34b6('0x18')](config['redis'],{'host':_0x34b6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34b6('0x17')]));require(_0x34b6('0x1a'))[_0x34b6('0x1b')](socket);function respondWithStatusCode(_0x14ae90,_0x1f0107){_0x1f0107=_0x1f0107||0xcc;return function(_0x3c3593){if(_0x3c3593){return _0x14ae90['sendStatus'](_0x1f0107);}return _0x14ae90[_0x34b6('0x1c')](_0x1f0107)[_0x34b6('0x1d')]();};}function respondWithResult(_0x3d2bc6,_0x82db7){_0x82db7=_0x82db7||0xc8;return function(_0x4f9d8c){if(_0x4f9d8c){return _0x3d2bc6[_0x34b6('0x1c')](_0x82db7)[_0x34b6('0x1e')](_0x4f9d8c);}};}function respondWithFilteredResult(_0x2dcfda,_0x23b40c){return function(_0x42cc81){if(_0x42cc81){var _0x39eead=typeof _0x23b40c[_0x34b6('0x1f')]===_0x34b6('0x20')&&typeof _0x23b40c[_0x34b6('0x21')]==='undefined';var _0x5505c8=_0x42cc81[_0x34b6('0x22')];var _0xaa5585=_0x39eead?0x0:_0x23b40c[_0x34b6('0x1f')];var _0x12a36a=_0x39eead?_0x42cc81[_0x34b6('0x22')]:_0x23b40c[_0x34b6('0x1f')]+_0x23b40c['limit'];var _0x1041ea;if(_0x12a36a>=_0x5505c8){_0x12a36a=_0x5505c8;_0x1041ea=0xc8;}else{_0x1041ea=0xce;}_0x2dcfda[_0x34b6('0x1c')](_0x1041ea);return _0x2dcfda[_0x34b6('0x23')]('Content-Range',_0xaa5585+'-'+_0x12a36a+'/'+_0x5505c8)['json'](_0x42cc81);}return null;};}function patchUpdates(_0x431322){return function(_0x14c460){try{jsonpatch[_0x34b6('0x24')](_0x14c460,_0x431322,!![]);}catch(_0x53b3aa){return BPromise['reject'](_0x53b3aa);}return _0x14c460['save']();};}function saveUpdates(_0x705a8b,_0x1b54c2){return function(_0x4a3e5f){if(_0x4a3e5f){return _0x4a3e5f[_0x34b6('0x25')](_0x705a8b)[_0x34b6('0x26')](function(_0x57851c){return _0x57851c;});}return null;};}function removeEntity(_0x223ac3,_0x7ab0a3){return function(_0x589612){if(_0x589612){return _0x589612['destroy']()['then'](function(){var _0x5c60b7=_0x589612['get']({'plain':!![]});var _0x3dad2d=[{'name':_0x34b6('0x27'),'value':_0x34b6('0x28'),'ignore':![]},{'name':_0x34b6('0x29'),'value':_0x34b6('0x2a'),'ignore':![]}];var _0x30aa03=_(_0x3dad2d)['filter']('ignore')[_0x34b6('0x2b')](_0x34b6('0x2c'))['value']();if(_[_0x34b6('0x2d')](_0x30aa03,_0x5c60b7['type'])){return;}var _0x5d3f75=_[_0x34b6('0x2e')](_0x3dad2d,[_0x34b6('0x2c'),_0x5c60b7['type']])[_0x34b6('0x2f')];return db[_0x34b6('0x30')][_0x34b6('0x31')]({'where':{'type':_0x5d3f75,'resourceId':_0x5c60b7['id']}})['then'](function(){return _0x589612;});})[_0x34b6('0x26')](function(){_0x223ac3[_0x34b6('0x1c')](0xcc)[_0x34b6('0x1d')]();});}};}function handleEntityNotFound(_0x10991c,_0x489a93){return function(_0x413566){if(!_0x413566){_0x10991c[_0x34b6('0x32')](0x194);}return _0x413566;};}function handleError(_0x283245,_0x3074c6){_0x3074c6=_0x3074c6||0x1f4;return function(_0x1a4d0c){logger['error'](_0x1a4d0c['stack']);if(_0x1a4d0c['name']){delete _0x1a4d0c[_0x34b6('0x2f')];}_0x283245[_0x34b6('0x1c')](_0x3074c6)[_0x34b6('0x33')](_0x1a4d0c);};}exports[_0x34b6('0x34')]=function(_0xd395fc,_0x33f719){var _0x427fd3={},_0x449b05={},_0xc89b1b={'count':0x0,'rows':[]};var _0x9cfac4=_[_0x34b6('0x2b')](db[_0x34b6('0x35')][_0x34b6('0x36')],function(_0x4374d2){return{'name':_0x4374d2[_0x34b6('0x37')],'type':_0x4374d2['type'][_0x34b6('0x38')]};});_0x449b05['model']=_[_0x34b6('0x2b')](_0x9cfac4,_0x34b6('0x2f'));_0x449b05[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0xd395fc[_0x34b6('0x39')]);_0x449b05[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x449b05[_0x34b6('0x3d')],_0x449b05['query']);_0x427fd3[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x449b05['model'],qs['fields'](_0xd395fc['query']['fields']));_0x427fd3[_0x34b6('0x3e')]=_0x427fd3[_0x34b6('0x3e')][_0x34b6('0x3f')]?_0x427fd3[_0x34b6('0x3e')]:_0x449b05[_0x34b6('0x3d')];if(!_0xd395fc[_0x34b6('0x39')]['hasOwnProperty']('nolimit')){_0x427fd3[_0x34b6('0x21')]=qs['limit'](_0xd395fc[_0x34b6('0x39')][_0x34b6('0x21')]);_0x427fd3['offset']=qs[_0x34b6('0x1f')](_0xd395fc[_0x34b6('0x39')][_0x34b6('0x1f')]);}_0x427fd3[_0x34b6('0x40')]=qs[_0x34b6('0x41')](_0xd395fc[_0x34b6('0x39')][_0x34b6('0x41')]);_0x427fd3[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0xd395fc['query'],_0x449b05[_0x34b6('0x3b')]),_0x9cfac4);if(_0xd395fc['query'][_0x34b6('0x44')]){_0x427fd3[_0x34b6('0x42')]=_['merge'](_0x427fd3[_0x34b6('0x42')],{'$or':_['map'](_0x9cfac4,function(_0x270b55){if(_0x270b55[_0x34b6('0x45')]!=='VIRTUAL'){var _0xc8c53a={};_0xc8c53a[_0x270b55[_0x34b6('0x2f')]]={'$like':'%'+_0xd395fc[_0x34b6('0x39')][_0x34b6('0x44')]+'%'};return _0xc8c53a;}})});}_0x427fd3=_[_0x34b6('0x46')]({},_0x427fd3,_0xd395fc[_0x34b6('0x47')]);var _0x271d3f={'where':_0x427fd3[_0x34b6('0x42')]};return db[_0x34b6('0x35')]['count'](_0x271d3f)[_0x34b6('0x26')](function(_0x5121ff){_0xc89b1b[_0x34b6('0x22')]=_0x5121ff;if(_0xd395fc[_0x34b6('0x39')]['includeAll']){_0x427fd3[_0x34b6('0x48')]=[{'all':!![]}];}return db[_0x34b6('0x35')][_0x34b6('0x49')](_0x427fd3);})[_0x34b6('0x26')](function(_0x5eeb7){_0xc89b1b[_0x34b6('0x4a')]=_0x5eeb7;return _0xc89b1b;})['then'](respondWithFilteredResult(_0x33f719,_0x427fd3))['catch'](handleError(_0x33f719,null));};exports[_0x34b6('0x4b')]=function(_0x4af50f,_0x22bc18){var _0x2988bd={'raw':![],'where':{'id':_0x4af50f['params']['id']}},_0x340295={};_0x340295[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x35')][_0x34b6('0x36')]);_0x340295['query']=_[_0x34b6('0x3a')](_0x4af50f[_0x34b6('0x39')]);_0x340295['filters']=_['intersection'](_0x340295['model'],_0x340295[_0x34b6('0x39')]);_0x2988bd[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x340295[_0x34b6('0x3d')],qs[_0x34b6('0x4c')](_0x4af50f[_0x34b6('0x39')][_0x34b6('0x4c')]));_0x2988bd['attributes']=_0x2988bd['attributes'][_0x34b6('0x3f')]?_0x2988bd[_0x34b6('0x3e')]:_0x340295[_0x34b6('0x3d')];if(_0x4af50f[_0x34b6('0x39')][_0x34b6('0x4d')]){_0x2988bd['include']=[{'all':!![]}];}_0x2988bd=_[_0x34b6('0x46')]({},_0x2988bd,_0x4af50f['options']);return db[_0x34b6('0x35')]['find'](_0x2988bd)['then'](handleEntityNotFound(_0x22bc18,null))['then'](respondWithResult(_0x22bc18,null))['catch'](handleError(_0x22bc18,null));};exports['create']=function(_0x479269,_0x1c2b6a){return db['VoiceQueue'][_0x34b6('0x4e')](_0x479269[_0x34b6('0x4f')],{})[_0x34b6('0x26')](function(_0x5ea6d5){var _0x28ce09=_0x479269[_0x34b6('0x50')][_0x34b6('0x51')]({'plain':!![]});if(!_0x28ce09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28ce09['role']===_0x34b6('0x50')){var _0x1cc2f9=_0x5ea6d5[_0x34b6('0x51')]({'plain':!![]});var _0x1bb027=[{'name':'VoiceQueues','value':_0x34b6('0x28')},{'name':_0x34b6('0x29'),'value':_0x34b6('0x2a')}];var _0x522146=_['find'](_0x1bb027,[_0x34b6('0x2c'),_0x1cc2f9[_0x34b6('0x45')]])['name'];return db[_0x34b6('0x52')]['find']({'where':{'name':_0x522146,'userProfileId':_0x28ce09['userProfileId']},'raw':!![]})[_0x34b6('0x26')](function(_0x45966b){if(_0x45966b&&_0x45966b[_0x34b6('0x53')]===0x0){return db[_0x34b6('0x30')][_0x34b6('0x4e')]({'name':_0x1cc2f9['name'],'resourceId':_0x1cc2f9['id'],'type':_0x45966b[_0x34b6('0x2f')],'sectionId':_0x45966b['id']},{})['then'](function(){return _0x5ea6d5;});}else{return _0x5ea6d5;}})['catch'](function(_0x49f301){logger[_0x34b6('0x54')](_0x34b6('0x55'),_0x49f301);throw _0x49f301;});}return _0x5ea6d5;})['then'](respondWithResult(_0x1c2b6a,0xc9))['catch'](handleError(_0x1c2b6a,null));};exports[_0x34b6('0x56')]=function(_0x135466,_0xf89ebb){var _0x11f3ef={'where':{'id':_0x135466[_0x34b6('0x57')]['id']}},_0x192e86={};_0x192e86['model']=_[_0x34b6('0x3a')](db['VoiceQueue'][_0x34b6('0x36')]);_0x11f3ef['attributes']=_[_0x34b6('0x3c')](_0x192e86[_0x34b6('0x3d')],qs[_0x34b6('0x4c')](_0x135466[_0x34b6('0x39')][_0x34b6('0x4c')]));_0x11f3ef[_0x34b6('0x3e')]=_0x11f3ef[_0x34b6('0x3e')]['length']?_0x11f3ef[_0x34b6('0x3e')]:_0x192e86['model'];if(_0x135466[_0x34b6('0x39')][_0x34b6('0x4d')]){_0x11f3ef[_0x34b6('0x48')]=[{'all':!![]}];}_0x11f3ef=_[_0x34b6('0x46')]({},_0x11f3ef,_0x135466[_0x34b6('0x47')]);return db['VoiceQueue'][_0x34b6('0x2e')](_0x11f3ef)[_0x34b6('0x26')](handleEntityNotFound(_0xf89ebb,null))[_0x34b6('0x26')](function(_0xd3d559){if(_0xd3d559){var _0x195514=_0xd3d559[_0x34b6('0x51')]({'plain':!![]});_0x195514=qs['omit'](_0x195514,['id','createdAt',_0x34b6('0x58')]);_0x135466[_0x34b6('0x4f')]=_[_0x34b6('0x59')](_0x135466['body'],['id',_0x34b6('0x5a'),_0x34b6('0x58')]);return db[_0x34b6('0x35')][_0x34b6('0x4e')](_['merge'](_0x195514,_0x135466[_0x34b6('0x4f')]),{'include':_0x135466[_0x34b6('0x39')][_0x34b6('0x4d')]?[{'all':!![]}]:undefined})[_0x34b6('0x26')](function(_0x20085f){var _0x56a41f=_0x135466[_0x34b6('0x50')][_0x34b6('0x51')]({'plain':!![]});if(!_0x56a41f)throw new Error(_0x34b6('0x5b'));if(_0x56a41f[_0x34b6('0x5c')]==='user'){var _0x47072a=_0x20085f[_0x34b6('0x51')]({'plain':!![]});var _0x27f34d=[{'name':'VoiceQueues','value':_0x34b6('0x28')},{'name':_0x34b6('0x29'),'value':_0x34b6('0x2a')}];var _0x8355e=_[_0x34b6('0x2e')](_0x27f34d,[_0x34b6('0x2c'),_0x47072a[_0x34b6('0x45')]])[_0x34b6('0x2f')];return db[_0x34b6('0x52')][_0x34b6('0x2e')]({'where':{'name':_0x8355e,'userProfileId':_0x56a41f[_0x34b6('0x5d')]},'raw':!![]})[_0x34b6('0x26')](function(_0x540f72){if(_0x540f72&&_0x540f72[_0x34b6('0x53')]===0x0){return db[_0x34b6('0x30')][_0x34b6('0x4e')]({'name':_0x47072a[_0x34b6('0x2f')],'resourceId':_0x47072a['id'],'type':_0x540f72[_0x34b6('0x2f')],'sectionId':_0x540f72['id']},{})[_0x34b6('0x26')](function(){return _0x20085f;});}else{return _0x20085f;}})[_0x34b6('0x5e')](function(_0x2a624f){logger[_0x34b6('0x54')](_0x34b6('0x55'),_0x2a624f);throw _0x2a624f;});}return _0x20085f;});}})['then'](respondWithResult(_0xf89ebb,0xc9))['catch'](handleError(_0xf89ebb,null));};exports[_0x34b6('0x25')]=function(_0x478793,_0x17c33a){if(_0x478793[_0x34b6('0x4f')]['id']){delete _0x478793[_0x34b6('0x4f')]['id'];}return db['VoiceQueue'][_0x34b6('0x2e')]({'where':{'id':_0x478793[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x17c33a,null))['then'](saveUpdates(_0x478793[_0x34b6('0x4f')],null))['then'](respondWithResult(_0x17c33a,null))[_0x34b6('0x5e')](handleError(_0x17c33a,null));};exports[_0x34b6('0x31')]=function(_0x3980fa,_0x55d70d){return db['VoiceQueue'][_0x34b6('0x2e')]({'where':{'id':_0x3980fa[_0x34b6('0x57')]['id']}})['then'](handleEntityNotFound(_0x55d70d,null))[_0x34b6('0x26')](removeEntity(_0x55d70d,null))[_0x34b6('0x5e')](handleError(_0x55d70d,null));};exports[_0x34b6('0x5f')]=function(_0x1f21a6,_0x2e137c,_0x3e9ee8){var _0x108fa4={'raw':![],'where':{}};var _0x1a096c={};var _0x34ae0c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x34b6('0x60')]({'where':{'id':_0x1f21a6[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x2e137c,null))[_0x34b6('0x26')](function(_0x250afd){if(_0x250afd){_0x1a096c['model']=_[_0x34b6('0x3a')](db['CmHopper'][_0x34b6('0x36')]);_0x1a096c[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0x1f21a6[_0x34b6('0x39')]);_0x1a096c[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x1a096c[_0x34b6('0x3d')],_0x1a096c['query']);_0x108fa4[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x1a096c['model'],qs[_0x34b6('0x4c')](_0x1f21a6[_0x34b6('0x39')][_0x34b6('0x4c')]));_0x108fa4[_0x34b6('0x3e')]=_0x108fa4[_0x34b6('0x3e')]['length']?_0x108fa4['attributes']:_0x1a096c[_0x34b6('0x3d')];if(!_0x1f21a6['query'][_0x34b6('0x61')](_0x34b6('0x62'))){_0x108fa4[_0x34b6('0x21')]=qs[_0x34b6('0x21')](_0x1f21a6['query'][_0x34b6('0x21')]);_0x108fa4[_0x34b6('0x1f')]=qs[_0x34b6('0x1f')](_0x1f21a6[_0x34b6('0x39')][_0x34b6('0x1f')]);}_0x108fa4[_0x34b6('0x40')]=qs[_0x34b6('0x41')](_0x1f21a6[_0x34b6('0x39')]['sort']);_0x108fa4[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0x1f21a6[_0x34b6('0x39')],_0x1a096c[_0x34b6('0x3b')]));_0x108fa4[_0x34b6('0x42')]['VoiceQueueId']=_0x250afd['id'];if(_0x1f21a6[_0x34b6('0x39')]['filter']){_0x108fa4[_0x34b6('0x42')]=_[_0x34b6('0x46')](_0x108fa4[_0x34b6('0x42')],{'$or':_[_0x34b6('0x2b')](_0x108fa4[_0x34b6('0x3e')],function(_0x426b8a){var _0x10f108={};_0x10f108[_0x426b8a]={'$like':'%'+_0x1f21a6[_0x34b6('0x39')]['filter']+'%'};return _0x10f108;})});}_0x108fa4=_['merge']({},_0x108fa4,_0x1f21a6[_0x34b6('0x47')]);return db[_0x34b6('0x63')][_0x34b6('0x22')]({'where':_0x108fa4['where']})[_0x34b6('0x26')](function(_0x47db6a){_0x34ae0c[_0x34b6('0x22')]=_0x47db6a;if(_0x1f21a6[_0x34b6('0x39')]['includeAll']){_0x108fa4[_0x34b6('0x48')]=[{'all':!![]}];}return db[_0x34b6('0x63')]['findAll'](_0x108fa4);})[_0x34b6('0x26')](function(_0x1107d2){_0x34ae0c[_0x34b6('0x4a')]=_0x1107d2;return _0x34ae0c;});}})[_0x34b6('0x26')](respondWithFilteredResult(_0x2e137c,_0x108fa4))[_0x34b6('0x5e')](handleError(_0x2e137c,null));};exports[_0x34b6('0x64')]=function(_0x2bc3ec,_0x33a267,_0x449691){var _0x84342c={'raw':!![],'where':{}};var _0x5f01e3={};var _0x215f67={'count':0x0,'rows':[]};return db[_0x34b6('0x35')][_0x34b6('0x60')]({'where':{'id':_0x2bc3ec[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x33a267,null))[_0x34b6('0x26')](function(_0x569a1b){if(_0x569a1b){_0x5f01e3[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x65')][_0x34b6('0x36')]);_0x5f01e3[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0x2bc3ec[_0x34b6('0x39')]);_0x5f01e3[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x5f01e3[_0x34b6('0x3d')],_0x5f01e3[_0x34b6('0x39')]);_0x84342c['attributes']=_[_0x34b6('0x3c')](_0x5f01e3['model'],qs['fields'](_0x2bc3ec[_0x34b6('0x39')][_0x34b6('0x4c')]));_0x84342c[_0x34b6('0x3e')]=_0x84342c[_0x34b6('0x3e')][_0x34b6('0x3f')]?_0x84342c[_0x34b6('0x3e')]:_0x5f01e3['model'];if(!_0x2bc3ec[_0x34b6('0x39')][_0x34b6('0x61')](_0x34b6('0x62'))){_0x84342c[_0x34b6('0x21')]=qs['limit'](_0x2bc3ec['query'][_0x34b6('0x21')]);_0x84342c['offset']=qs[_0x34b6('0x1f')](_0x2bc3ec['query']['offset']);}_0x84342c[_0x34b6('0x40')]=qs[_0x34b6('0x41')](_0x2bc3ec[_0x34b6('0x39')][_0x34b6('0x41')]);_0x84342c[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0x2bc3ec[_0x34b6('0x39')],_0x5f01e3[_0x34b6('0x3b')]));_0x84342c[_0x34b6('0x42')][_0x34b6('0x66')]=_0x569a1b['id'];if(_0x2bc3ec[_0x34b6('0x39')][_0x34b6('0x44')]){_0x84342c[_0x34b6('0x42')]=_[_0x34b6('0x46')](_0x84342c['where'],{'$or':_[_0x34b6('0x2b')](_0x84342c['attributes'],function(_0x38aa5e){var _0x302c49={};_0x302c49[_0x38aa5e]={'$like':'%'+_0x2bc3ec['query']['filter']+'%'};return _0x302c49;})});}_0x84342c=_[_0x34b6('0x46')]({},_0x84342c,_0x2bc3ec[_0x34b6('0x47')]);return db[_0x34b6('0x65')][_0x34b6('0x22')]({'where':_0x84342c[_0x34b6('0x42')]})[_0x34b6('0x26')](function(_0x548b69){_0x215f67[_0x34b6('0x22')]=_0x548b69;if(_0x2bc3ec['query'][_0x34b6('0x4d')]){_0x84342c[_0x34b6('0x48')]=[{'all':!![]}];}return db[_0x34b6('0x65')][_0x34b6('0x49')](_0x84342c);})[_0x34b6('0x26')](function(_0x5c981b){_0x215f67[_0x34b6('0x4a')]=_0x5c981b;return _0x215f67;});}})['then'](respondWithFilteredResult(_0x33a267,_0x84342c))['catch'](handleError(_0x33a267,null));};exports['getHopperFinals']=function(_0x1b3bea,_0x166eed,_0x557e2e){var _0x2e27ab={'raw':!![],'where':{}};var _0x36cf2f={};var _0x7de4f2={'count':0x0,'rows':[]};return db[_0x34b6('0x35')][_0x34b6('0x60')]({'where':{'id':_0x1b3bea[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x166eed,null))[_0x34b6('0x26')](function(_0x1e8f8b){if(_0x1e8f8b){_0x36cf2f[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x67')][_0x34b6('0x36')]);_0x36cf2f[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0x1b3bea[_0x34b6('0x39')]);_0x36cf2f[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x36cf2f['model'],_0x36cf2f[_0x34b6('0x39')]);_0x2e27ab[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x36cf2f['model'],qs[_0x34b6('0x4c')](_0x1b3bea[_0x34b6('0x39')]['fields']));_0x2e27ab[_0x34b6('0x3e')]=_0x2e27ab[_0x34b6('0x3e')]['length']?_0x2e27ab[_0x34b6('0x3e')]:_0x36cf2f[_0x34b6('0x3d')];if(!_0x1b3bea['query'][_0x34b6('0x61')](_0x34b6('0x62'))){_0x2e27ab[_0x34b6('0x21')]=qs[_0x34b6('0x21')](_0x1b3bea['query'][_0x34b6('0x21')]);_0x2e27ab[_0x34b6('0x1f')]=qs[_0x34b6('0x1f')](_0x1b3bea[_0x34b6('0x39')][_0x34b6('0x1f')]);}_0x2e27ab['order']=qs[_0x34b6('0x41')](_0x1b3bea[_0x34b6('0x39')][_0x34b6('0x41')]);_0x2e27ab['where']=qs[_0x34b6('0x3b')](_['pick'](_0x1b3bea['query'],_0x36cf2f[_0x34b6('0x3b')]));_0x2e27ab[_0x34b6('0x42')][_0x34b6('0x66')]=_0x1e8f8b['id'];if(_0x1b3bea[_0x34b6('0x39')][_0x34b6('0x44')]){_0x2e27ab[_0x34b6('0x42')]=_[_0x34b6('0x46')](_0x2e27ab[_0x34b6('0x42')],{'$or':_[_0x34b6('0x2b')](_0x2e27ab[_0x34b6('0x3e')],function(_0x22c2c0){var _0x5009ce={};_0x5009ce[_0x22c2c0]={'$like':'%'+_0x1b3bea['query'][_0x34b6('0x44')]+'%'};return _0x5009ce;})});}_0x2e27ab=_[_0x34b6('0x46')]({},_0x2e27ab,_0x1b3bea[_0x34b6('0x47')]);return db['CmHopperFinal'][_0x34b6('0x22')]({'where':_0x2e27ab[_0x34b6('0x42')]})[_0x34b6('0x26')](function(_0xaa336){_0x7de4f2[_0x34b6('0x22')]=_0xaa336;if(_0x1b3bea[_0x34b6('0x39')]['includeAll']){_0x2e27ab[_0x34b6('0x48')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x34b6('0x49')](_0x2e27ab);})['then'](function(_0x304540){_0x7de4f2['rows']=_0x304540;return _0x7de4f2;});}})['then'](respondWithFilteredResult(_0x166eed,_0x2e27ab))[_0x34b6('0x5e')](handleError(_0x166eed,null));};exports[_0x34b6('0x68')]=function(_0x2b1ec0,_0x30d696,_0x1ca5ee){var _0x5ee9cc={'raw':!![],'where':{}};var _0x52a01c={};var _0x539185={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x34b6('0x60')]({'where':{'id':_0x2b1ec0[_0x34b6('0x57')]['id']}})['then'](handleEntityNotFound(_0x30d696,null))[_0x34b6('0x26')](function(_0x2cf17f){if(_0x2cf17f){_0x52a01c[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x69')][_0x34b6('0x36')]);_0x52a01c[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0x2b1ec0[_0x34b6('0x39')]);_0x52a01c[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x52a01c['model'],_0x52a01c['query']);_0x5ee9cc[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x52a01c[_0x34b6('0x3d')],qs['fields'](_0x2b1ec0[_0x34b6('0x39')][_0x34b6('0x4c')]));_0x5ee9cc[_0x34b6('0x3e')]=_0x5ee9cc[_0x34b6('0x3e')][_0x34b6('0x3f')]?_0x5ee9cc['attributes']:_0x52a01c[_0x34b6('0x3d')];if(!_0x2b1ec0[_0x34b6('0x39')][_0x34b6('0x61')](_0x34b6('0x62'))){_0x5ee9cc[_0x34b6('0x21')]=qs['limit'](_0x2b1ec0[_0x34b6('0x39')][_0x34b6('0x21')]);_0x5ee9cc[_0x34b6('0x1f')]=qs[_0x34b6('0x1f')](_0x2b1ec0[_0x34b6('0x39')][_0x34b6('0x1f')]);}_0x5ee9cc[_0x34b6('0x40')]=qs['sort'](_0x2b1ec0[_0x34b6('0x39')][_0x34b6('0x41')]);_0x5ee9cc[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0x2b1ec0[_0x34b6('0x39')],_0x52a01c[_0x34b6('0x3b')]));_0x5ee9cc[_0x34b6('0x42')][_0x34b6('0x66')]=_0x2cf17f['id'];if(_0x2b1ec0[_0x34b6('0x39')][_0x34b6('0x44')]){_0x5ee9cc[_0x34b6('0x42')]=_[_0x34b6('0x46')](_0x5ee9cc[_0x34b6('0x42')],{'$or':_[_0x34b6('0x2b')](_0x5ee9cc['attributes'],function(_0x2d3564){var _0x5a8f2a={};_0x5a8f2a[_0x2d3564]={'$like':'%'+_0x2b1ec0['query'][_0x34b6('0x44')]+'%'};return _0x5a8f2a;})});}_0x5ee9cc=_[_0x34b6('0x46')]({},_0x5ee9cc,_0x2b1ec0[_0x34b6('0x47')]);return db[_0x34b6('0x69')][_0x34b6('0x22')]({'where':_0x5ee9cc['where']})[_0x34b6('0x26')](function(_0x1f6d5f){_0x539185['count']=_0x1f6d5f;if(_0x2b1ec0[_0x34b6('0x39')]['includeAll']){_0x5ee9cc[_0x34b6('0x48')]=[{'all':!![]}];}return db[_0x34b6('0x69')][_0x34b6('0x49')](_0x5ee9cc);})['then'](function(_0x35b752){_0x539185['rows']=_0x35b752;return _0x539185;});}})[_0x34b6('0x26')](respondWithFilteredResult(_0x30d696,_0x5ee9cc))[_0x34b6('0x5e')](handleError(_0x30d696,null));};exports[_0x34b6('0x6a')]=function(_0x44c5e0,_0x1028ea,_0x422f25){var _0x6a5aa={};var _0x2b01df={};var _0x25114b;var _0x5b4810;return db[_0x34b6('0x35')][_0x34b6('0x60')]({'where':{'id':_0x44c5e0[_0x34b6('0x57')]['id']}})['then'](handleEntityNotFound(_0x1028ea,null))[_0x34b6('0x26')](function(_0x4249b6){if(_0x4249b6){_0x25114b=_0x4249b6;_0x2b01df[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x6b')]['rawAttributes']);_0x2b01df[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0x44c5e0[_0x34b6('0x39')]);_0x2b01df['filters']=_[_0x34b6('0x3c')](_0x2b01df['model'],_0x2b01df[_0x34b6('0x39')]);_0x6a5aa[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x2b01df[_0x34b6('0x3d')],qs[_0x34b6('0x4c')](_0x44c5e0['query']['fields']));_0x6a5aa['attributes']=_0x6a5aa['attributes']['length']?_0x6a5aa[_0x34b6('0x3e')]:_0x2b01df['model'];_0x6a5aa[_0x34b6('0x40')]=qs[_0x34b6('0x41')](_0x44c5e0[_0x34b6('0x39')][_0x34b6('0x41')]);_0x6a5aa[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0x44c5e0['query'],_0x2b01df[_0x34b6('0x3b')]));if(_0x44c5e0[_0x34b6('0x39')][_0x34b6('0x44')]){_0x6a5aa['where']=_[_0x34b6('0x46')](_0x6a5aa[_0x34b6('0x42')],{'$or':_[_0x34b6('0x2b')](_0x6a5aa['attributes'],function(_0x11ab75){var _0x1715d6={};_0x1715d6[_0x11ab75]={'$like':'%'+_0x44c5e0[_0x34b6('0x39')][_0x34b6('0x44')]+'%'};return _0x1715d6;})});}_0x6a5aa=_[_0x34b6('0x46')]({},_0x6a5aa,_0x44c5e0[_0x34b6('0x47')]);return _0x25114b[_0x34b6('0x6a')](_0x6a5aa);}})['then'](function(_0x5124e0){if(_0x5124e0){_0x5b4810=_0x5124e0[_0x34b6('0x3f')];if(!_0x44c5e0[_0x34b6('0x39')]['hasOwnProperty'](_0x34b6('0x62'))){_0x6a5aa[_0x34b6('0x21')]=qs[_0x34b6('0x21')](_0x44c5e0[_0x34b6('0x39')]['limit']);_0x6a5aa[_0x34b6('0x1f')]=qs[_0x34b6('0x1f')](_0x44c5e0[_0x34b6('0x39')][_0x34b6('0x1f')]);}return _0x25114b['getTeams'](_0x6a5aa);}})[_0x34b6('0x26')](function(_0x32016f){if(_0x32016f){return _0x32016f?{'count':_0x5b4810,'rows':_0x32016f}:null;}})[_0x34b6('0x26')](respondWithResult(_0x1028ea,null))[_0x34b6('0x5e')](handleError(_0x1028ea,null));};exports[_0x34b6('0x6c')]=function(_0x5f32ab,_0xbd6651,_0x2b26d4){var _0x1f20a0=_0x5f32ab[_0x34b6('0x4f')][_0x34b6('0x6d')];var _0x35029a=_[_0x34b6('0x2b')](_0x1f20a0,'id');return db[_0x34b6('0x6b')][_0x34b6('0x49')]({'where':{'id':_0x35029a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x34b6('0x6e'),'attributes':['id',_0x34b6('0x2f'),'online',_0x34b6('0x6f'),_0x34b6('0x70')],'raw':!![]}]})[_0x34b6('0x26')](function(_0x196a81){if(_0x196a81){var _0x34aa18=_['flatMap'](_0x196a81,function(_0x2ffc6a){var _0x73fd3d=_0x2ffc6a[_0x34b6('0x51')]({'plain':!![]});_0x73fd3d[_0x34b6('0x6e')][_0x34b6('0x71')](function(_0x256907){_0x256907['penalty']=_[_0x34b6('0x2e')](_0x1f20a0,{'id':_0x73fd3d['id']})['penalty'];});return _0x73fd3d['Agents'];});return db[_0x34b6('0x35')]['find']({'where':{'id':_0x5f32ab[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](function(_0x2efaca){return db['sequelize'][_0x34b6('0x72')](function(_0x1a6be2){return _0x2efaca['addTeams'](_0x35029a,{'transaction':_0x1a6be2})['then'](function(){return BPromise['each'](_0x1f20a0,function(_0x1cb3ed){return db[_0x34b6('0x73')][_0x34b6('0x74')]({'TeamId':_0x1cb3ed['id'],'VoiceQueueId':_0x5f32ab['params']['id'],'penalty':_0x1cb3ed[_0x34b6('0x75')]},{'transaction':_0x1a6be2});});})['then'](function(){return BPromise[_0x34b6('0x76')](_0x34aa18,function(_0x2803dd){return db[_0x34b6('0x77')]['findOrCreate']({'where':{'UserId':_0x2803dd['id'],'VoiceQueueId':_0x5f32ab[_0x34b6('0x57')]['id']},'defaults':{'penalty':_0x2803dd[_0x34b6('0x75')]},'transaction':_0x1a6be2});});})[_0x34b6('0x26')](function(){return BPromise[_0x34b6('0x76')](_[_0x34b6('0x44')](_0x34aa18,{'online':!![]}),function(_0x136f93){return db['UserVoiceQueueRt']['upsert']({'membername':_0x136f93[_0x34b6('0x2f')],'UserId':_0x136f93['id'],'queue_name':_0x2efaca[_0x34b6('0x2f')],'VoiceQueueId':_0x2efaca['id'],'interface':_[_0x34b6('0x78')](_0x136f93[_0x34b6('0x70')])?util['format'](_0x34b6('0x79'),_0x136f93[_0x34b6('0x2f')]):_0x136f93[_0x34b6('0x70')],'paused':_0x136f93[_0x34b6('0x6f')]||![],'penalty':_0x136f93[_0x34b6('0x75')]},{'transaction':_0x1a6be2});});})['then'](function(){_0x34aa18[_0x34b6('0x71')](function(_0x30d2e0){socket[_0x34b6('0x7a')]('userVoiceQueue:save',{'UserId':_0x30d2e0['id'],'VoiceQueueId':_0x2efaca['id']});});});});});}})[_0x34b6('0x26')](respondWithStatusCode(_0xbd6651,null))[_0x34b6('0x5e')](handleError(_0xbd6651,null));};exports[_0x34b6('0x7b')]=function(_0x30acc7,_0x1df082,_0x5a3d44){return db[_0x34b6('0x6b')]['findAll']({'where':{'id':_0x30acc7['query'][_0x34b6('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x34b6('0x7d')],'as':_0x34b6('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x34b6('0x26')](handleEntityNotFound(_0x1df082,null))['then'](function(_0x3872d7){var _0x45498a=_[_0x34b6('0x2b')](_0x3872d7,'id');var _0x34388c=[];var _0x5839e3=[];var _0xd84540=squel[_0x34b6('0x7e')]();_0xd84540[_0x34b6('0x7f')]('tq.TeamId')[_0x34b6('0x80')](_0x34b6('0x81'),'tq')[_0x34b6('0x82')]('user_has_teams','ut',_0x34b6('0x83'))['where'](_0x34b6('0x84'),_0x30acc7[_0x34b6('0x57')]['id']);for(var _0x275baf=0x0;_0x275baf<_0x3872d7[_0x34b6('0x3f')];_0x275baf+=0x1){let _0x3e6730=_0x3872d7[_0x275baf];for(var _0x540b85=0x0;_0x540b85<_0x3e6730[_0x34b6('0x6e')][_0x34b6('0x3f')];_0x540b85+=0x1){let _0x2ef655=_0x3e6730['Agents'][_0x540b85];var _0x1eb9c8=_0xd84540['clone']();_0x1eb9c8[_0x34b6('0x42')](_0x34b6('0x85'),_0x2ef655['id']);_0x5839e3['push'](db['sequelize'][_0x34b6('0x39')](_0x1eb9c8[_0x34b6('0x86')](),{'type':db[_0x34b6('0x87')][_0x34b6('0x88')]['SELECT']})['then'](function(_0xb3f68a){if(_0xb3f68a['length']===0x1){return _0x2ef655['id'];}else{var _0x188bf8=_['every'](_['map'](_0xb3f68a,_0x34b6('0x89')),function(_0x76845e){return _[_0x34b6('0x2d')](_0x45498a,_0x76845e);});if(_0x188bf8){return _0x2ef655['id'];}}}));}}return BPromise[_0x34b6('0x8a')](_0x5839e3)[_0x34b6('0x26')](function(_0x4760dd){_0x34388c=_(_0x34388c)[_0x34b6('0x8b')](_0x4760dd)['compact']()[_0x34b6('0x2c')]();return db['VoiceQueue'][_0x34b6('0x2e')]({'where':{'id':_0x30acc7[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](function(_0x386ede){return db[_0x34b6('0x87')][_0x34b6('0x72')](function(_0x518004){return _0x386ede[_0x34b6('0x7b')](_0x30acc7[_0x34b6('0x39')][_0x34b6('0x7c')],{'transaction':_0x518004})[_0x34b6('0x26')](function(){if(!_[_0x34b6('0x8c')](_0x34388c)){return _0x386ede[_0x34b6('0x8d')](_0x34388c,{'transaction':_0x518004})[_0x34b6('0x26')](function(){return db[_0x34b6('0x8e')][_0x34b6('0x31')]({'where':{'VoiceQueueId':_0x30acc7[_0x34b6('0x57')]['id'],'UserId':_0x34388c},'transaction':_0x518004});});}})[_0x34b6('0x26')](function(){_0x34388c[_0x34b6('0x71')](function(_0x27b370){socket[_0x34b6('0x7a')](_0x34b6('0x8f'),{'UserId':_0x27b370,'VoiceQueueId':_0x386ede['id']});});});});});});})[_0x34b6('0x26')](respondWithStatusCode(_0x1df082,null))[_0x34b6('0x5e')](handleError(_0x1df082,null));};exports[_0x34b6('0x90')]=function(_0x4547ea,_0xf0fac,_0x5a834e){var _0xf4328d,_0x1ac716;return db['VoiceQueue'][_0x34b6('0x2e')]({'where':{'id':_0x4547ea[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0xf0fac,null))[_0x34b6('0x26')](function(_0x1ae57e){if(_0x1ae57e){_0x1ac716=_0x1ae57e;return _0x1ae57e[_0x34b6('0x90')](_0x4547ea[_0x34b6('0x4f')]['ids'],_[_0x34b6('0x59')](_0x4547ea[_0x34b6('0x4f')],[_0x34b6('0x7c'),'id'])||{})[_0x34b6('0x91')](function(_0x22b2f7){for(var _0x4ffb39=0x0;_0x4ffb39<_0x4547ea[_0x34b6('0x4f')][_0x34b6('0x7c')][_0x34b6('0x3f')];_0x4ffb39+=0x1){socket[_0x34b6('0x7a')](_0x34b6('0x92'),{'UserId':Number(_0x4547ea[_0x34b6('0x4f')][_0x34b6('0x7c')][_0x4ffb39]),'VoiceQueueId':Number(_0x4547ea[_0x34b6('0x57')]['id'])});}return _0x22b2f7;});}})['then'](function(_0x2eb3c2){_0xf4328d=_0x2eb3c2||[];if(_0x1ac716){return db[_0x34b6('0x7d')][_0x34b6('0x49')]({'where':{'id':_0x4547ea[_0x34b6('0x4f')][_0x34b6('0x7c')]},'attributes':['id',_0x34b6('0x2f'),_0x34b6('0x93'),_0x34b6('0x6f'),_0x34b6('0x70')],'raw':!![]});}})['then'](function(_0x5482b0){if(!_[_0x34b6('0x8c')](_0x5482b0)){var _0x312d18=[];for(var _0x3ff1e1=0x0;_0x3ff1e1<_0x5482b0[_0x34b6('0x3f')];_0x3ff1e1++){if(_0x5482b0[_0x3ff1e1][_0x34b6('0x93')]){_0x312d18['push'](db[_0x34b6('0x8e')][_0x34b6('0x74')]({'membername':_0x5482b0[_0x3ff1e1]['name'],'UserId':_0x5482b0[_0x3ff1e1]['id'],'queue_name':_0x1ac716['name'],'VoiceQueueId':_0x1ac716['id'],'interface':_[_0x34b6('0x78')](_0x5482b0[_0x3ff1e1]['interface'])?util['format'](_0x34b6('0x79'),_0x5482b0[_0x3ff1e1][_0x34b6('0x2f')]):_0x5482b0[_0x3ff1e1][_0x34b6('0x70')],'paused':_0x5482b0[_0x3ff1e1]['voicePause']||![],'penalty':_0x4547ea[_0x34b6('0x4f')][_0x34b6('0x75')]||0x0}));}}return BPromise[_0x34b6('0x8a')](_0x312d18);}})['then'](function(){return _0xf4328d;})[_0x34b6('0x26')](respondWithResult(_0xf0fac,null))['catch'](handleError(_0xf0fac,null));};exports[_0x34b6('0x8d')]=function(_0x84a6c9,_0xc15d36,_0x12aa12){return db[_0x34b6('0x35')]['find']({'where':{'id':_0x84a6c9[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0xc15d36,null))[_0x34b6('0x26')](function(_0x58140d){if(_0x58140d){return _0x58140d[_0x34b6('0x8d')](_0x84a6c9[_0x34b6('0x39')]['ids'])[_0x34b6('0x26')](function(){if(_[_0x34b6('0x94')](_0x84a6c9[_0x34b6('0x39')][_0x34b6('0x7c')])){for(var _0x12dab9=0x0;_0x12dab9<_0x84a6c9[_0x34b6('0x39')][_0x34b6('0x7c')]['length'];_0x12dab9+=0x1){socket[_0x34b6('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x84a6c9[_0x34b6('0x39')][_0x34b6('0x7c')][_0x12dab9]),'VoiceQueueId':Number(_0x84a6c9['params']['id'])});}}else{socket[_0x34b6('0x7a')](_0x34b6('0x8f'),{'UserId':Number(_0x84a6c9[_0x34b6('0x39')][_0x34b6('0x7c')]),'VoiceQueueId':Number(_0x84a6c9[_0x34b6('0x57')]['id'])});}});}})['then'](function(_0x17122e){return db[_0x34b6('0x8e')][_0x34b6('0x31')]({'where':{'VoiceQueueId':_0x84a6c9[_0x34b6('0x57')]['id'],'UserId':_0x84a6c9[_0x34b6('0x39')][_0x34b6('0x7c')]}})[_0x34b6('0x26')](function(){return _0x17122e;});})[_0x34b6('0x26')](respondWithStatusCode(_0xc15d36,null))[_0x34b6('0x5e')](handleError(_0xc15d36,null));};exports['getAgents']=function(_0x195543,_0x218843,_0x2f2cfd){var _0x300f7f={};var _0x3f7bc6={};var _0x439d0e;var _0x259d7e;return db['VoiceQueue'][_0x34b6('0x60')]({'where':{'id':_0x195543[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x218843,null))[_0x34b6('0x26')](function(_0x24fa89){if(_0x24fa89){_0x439d0e=_0x24fa89;_0x3f7bc6[_0x34b6('0x3d')]=_['keys'](db[_0x34b6('0x7d')][_0x34b6('0x36')]);_0x3f7bc6[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0x195543['query']);_0x3f7bc6[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x3f7bc6['model'],_0x3f7bc6[_0x34b6('0x39')]);_0x300f7f[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x3f7bc6[_0x34b6('0x3d')],qs[_0x34b6('0x4c')](_0x195543[_0x34b6('0x39')][_0x34b6('0x4c')]));_0x300f7f[_0x34b6('0x3e')]=_0x300f7f[_0x34b6('0x3e')][_0x34b6('0x3f')]?_0x300f7f[_0x34b6('0x3e')]:_0x3f7bc6[_0x34b6('0x3d')];_0x300f7f[_0x34b6('0x40')]=qs[_0x34b6('0x41')](_0x195543[_0x34b6('0x39')][_0x34b6('0x41')]);_0x300f7f[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0x195543[_0x34b6('0x39')],_0x3f7bc6[_0x34b6('0x3b')]));if(_0x195543['query']['filter']){_0x300f7f[_0x34b6('0x42')]=_[_0x34b6('0x46')](_0x300f7f['where'],{'$or':_[_0x34b6('0x2b')](_0x300f7f['attributes'],function(_0x51ba5d){var _0x1183a6={};_0x1183a6[_0x51ba5d]={'$like':'%'+_0x195543[_0x34b6('0x39')]['filter']+'%'};return _0x1183a6;})});}_0x300f7f=_[_0x34b6('0x46')]({},_0x300f7f,_0x195543['options']);return _0x439d0e['getAgents'](_0x300f7f);}})[_0x34b6('0x26')](function(_0x51e3be){if(_0x51e3be){_0x259d7e=_0x51e3be[_0x34b6('0x3f')];if(!_0x195543[_0x34b6('0x39')][_0x34b6('0x61')](_0x34b6('0x62'))){_0x300f7f[_0x34b6('0x21')]=qs[_0x34b6('0x21')](_0x195543[_0x34b6('0x39')][_0x34b6('0x21')]);_0x300f7f[_0x34b6('0x1f')]=qs[_0x34b6('0x1f')](_0x195543['query']['offset']);}return _0x439d0e['getAgents'](_0x300f7f);}})[_0x34b6('0x26')](function(_0x550bc2){if(_0x550bc2){return _0x550bc2?{'count':_0x259d7e,'rows':_0x550bc2}:null;}})['then'](respondWithResult(_0x218843,null))[_0x34b6('0x5e')](handleError(_0x218843,null));};exports[_0x34b6('0x95')]=function(_0x23f4a2,_0x4108e1,_0x26bf4e){var _0x3df3bc={};var _0x5b62c9={};var _0x3d4f82;var _0x8b29d8;return db[_0x34b6('0x35')][_0x34b6('0x60')]({'where':{'id':_0x23f4a2[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x4108e1,null))['then'](function(_0x429581){if(_0x429581){_0x3d4f82=_0x429581;_0x5b62c9[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x8e')][_0x34b6('0x36')]);_0x5b62c9[_0x34b6('0x39')]=_[_0x34b6('0x3a')](_0x23f4a2['query']);_0x5b62c9[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x5b62c9[_0x34b6('0x3d')],_0x5b62c9[_0x34b6('0x39')]);_0x3df3bc['attributes']=_[_0x34b6('0x3c')](_0x5b62c9[_0x34b6('0x3d')],qs[_0x34b6('0x4c')](_0x23f4a2[_0x34b6('0x39')]['fields']));_0x3df3bc[_0x34b6('0x3e')]=_0x3df3bc[_0x34b6('0x3e')][_0x34b6('0x3f')]?_0x3df3bc['attributes']:_0x5b62c9[_0x34b6('0x3d')];_0x3df3bc[_0x34b6('0x40')]=qs[_0x34b6('0x41')](_0x23f4a2[_0x34b6('0x39')][_0x34b6('0x41')]);_0x3df3bc[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0x23f4a2['query'],_0x5b62c9[_0x34b6('0x3b')]));if(_0x23f4a2[_0x34b6('0x39')][_0x34b6('0x44')]){_0x3df3bc[_0x34b6('0x42')]=_[_0x34b6('0x46')](_0x3df3bc[_0x34b6('0x42')],{'$or':_['map'](_0x3df3bc[_0x34b6('0x3e')],function(_0x540196){var _0x22ef97={};_0x22ef97[_0x540196]={'$like':'%'+_0x23f4a2[_0x34b6('0x39')]['filter']+'%'};return _0x22ef97;})});}_0x3df3bc=_[_0x34b6('0x46')]({},_0x3df3bc,_0x23f4a2['options']);return _0x3d4f82[_0x34b6('0x95')](_0x3df3bc);}})[_0x34b6('0x26')](function(_0x5c9ee9){if(_0x5c9ee9){_0x8b29d8=_0x5c9ee9[_0x34b6('0x3f')];if(!_0x23f4a2[_0x34b6('0x39')][_0x34b6('0x61')](_0x34b6('0x62'))){_0x3df3bc[_0x34b6('0x21')]=qs[_0x34b6('0x21')](_0x23f4a2['query'][_0x34b6('0x21')]);_0x3df3bc[_0x34b6('0x1f')]=qs[_0x34b6('0x1f')](_0x23f4a2[_0x34b6('0x39')]['offset']);}return _0x3d4f82['getMembers'](_0x3df3bc);}})[_0x34b6('0x26')](function(_0x43d46c){return _0x43d46c?{'count':_0x8b29d8,'rows':_0x43d46c}:null;})['then'](respondWithResult(_0x4108e1,null))['catch'](handleError(_0x4108e1,null));};exports[_0x34b6('0x96')]=function(_0xea7361,_0x45940c,_0x52fa8){var _0x7b2f46={};var _0x404847={};var _0x3a7d40;var _0x5b0f21;return db[_0x34b6('0x35')][_0x34b6('0x60')]({'where':{'id':_0xea7361[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x45940c,null))[_0x34b6('0x26')](function(_0x1fef6a){if(_0x1fef6a){_0x3a7d40=_0x1fef6a;_0x404847[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x97')][_0x34b6('0x36')]);_0x404847['query']=_[_0x34b6('0x3a')](_0xea7361[_0x34b6('0x39')]);_0x404847[_0x34b6('0x3b')]=_['intersection'](_0x404847[_0x34b6('0x3d')],_0x404847[_0x34b6('0x39')]);_0x7b2f46[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x404847[_0x34b6('0x3d')],qs[_0x34b6('0x4c')](_0xea7361[_0x34b6('0x39')][_0x34b6('0x4c')]));_0x7b2f46[_0x34b6('0x3e')]=_0x7b2f46[_0x34b6('0x3e')][_0x34b6('0x3f')]?_0x7b2f46['attributes']:_0x404847['model'];_0x7b2f46[_0x34b6('0x40')]=qs[_0x34b6('0x41')](_0xea7361['query'][_0x34b6('0x41')]);_0x7b2f46[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_['pick'](_0xea7361['query'],_0x404847['filters']));if(_0xea7361[_0x34b6('0x39')][_0x34b6('0x44')]){_0x7b2f46[_0x34b6('0x42')]=_['merge'](_0x7b2f46[_0x34b6('0x42')],{'$or':_[_0x34b6('0x2b')](_0x7b2f46[_0x34b6('0x3e')],function(_0x64c7e6){var _0x11daea={};_0x11daea[_0x64c7e6]={'$like':'%'+_0xea7361[_0x34b6('0x39')]['filter']+'%'};return _0x11daea;})});}_0x7b2f46=_[_0x34b6('0x46')]({},_0x7b2f46,_0xea7361[_0x34b6('0x47')]);return _0x3a7d40[_0x34b6('0x96')](_0x7b2f46);}})[_0x34b6('0x26')](function(_0xbe3ffe){if(_0xbe3ffe){_0x5b0f21=_0xbe3ffe[_0x34b6('0x3f')];if(!_0xea7361[_0x34b6('0x39')][_0x34b6('0x61')](_0x34b6('0x62'))){_0x7b2f46[_0x34b6('0x21')]=qs[_0x34b6('0x21')](_0xea7361[_0x34b6('0x39')][_0x34b6('0x21')]);_0x7b2f46[_0x34b6('0x1f')]=qs[_0x34b6('0x1f')](_0xea7361[_0x34b6('0x39')][_0x34b6('0x1f')]);}return _0x3a7d40[_0x34b6('0x96')](_0x7b2f46);}})[_0x34b6('0x26')](function(_0x3605a1){if(_0x3605a1){return _0x3605a1?{'count':_0x5b0f21,'rows':_0x3605a1}:null;}})[_0x34b6('0x26')](respondWithResult(_0x45940c,null))[_0x34b6('0x5e')](handleError(_0x45940c,null));};exports['addLists']=function(_0x2f49b6,_0x53c55c,_0x5c6af8){var _0xe3cc76,_0x2b1be1;return db[_0x34b6('0x35')][_0x34b6('0x2e')]({'where':{'id':_0x2f49b6[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x53c55c,null))[_0x34b6('0x26')](function(_0x181fc2){if(_0x181fc2){_0x2b1be1=_0x181fc2;return _0x181fc2[_0x34b6('0x98')](_0x2f49b6[_0x34b6('0x4f')]['ids'],_[_0x34b6('0x59')](_0x2f49b6[_0x34b6('0x4f')],['ids','id'])||{});}return null;})[_0x34b6('0x91')](function(_0x2a80d0){var _0x2ffe28;_0xe3cc76=_0x2a80d0||[];var _0x555e2c=[];if(_0x2a80d0){for(var _0x26dc91=0x0;_0x26dc91<_0x2a80d0[_0x34b6('0x3f')];_0x26dc91+=0x1){var _0x44afe9=_0x2a80d0[_0x26dc91][_0x34b6('0x51')]({'plain':!![]});_0x2b1be1[_0x34b6('0x99')]=_0x2f49b6[_0x34b6('0x4f')][_0x34b6('0x99')]?_0x2f49b6[_0x34b6('0x4f')][_0x34b6('0x99')]:_0x2b1be1[_0x34b6('0x99')];switch(_0x2b1be1['dialCheckDuplicateType']){case _0x34b6('0x9a'):_0x2ffe28=squel['insert']()[_0x34b6('0x9b')](_0x34b6('0x9c'))[_0x34b6('0x9d')]([_0x34b6('0x9e'),'scheduledAt',_0x34b6('0x9f'),_0x34b6('0xa0'),'VoiceQueueId','createdAt',_0x34b6('0x58')],squel['select']()[_0x34b6('0x7f')](_0x34b6('0x9e'),_0x34b6('0x9e'))['field'](_0x34b6('0xa1'),_0x34b6('0xa2'))[_0x34b6('0x7f')]('id',_0x34b6('0x9f'))[_0x34b6('0x7f')](_0x44afe9[_0x34b6('0xa3')][_0x34b6('0x86')](),_0x34b6('0xa0'))[_0x34b6('0x7f')](_0x2f49b6[_0x34b6('0x57')]['id'][_0x34b6('0x86')](),'VoiceQueueId')[_0x34b6('0x7f')](_0x34b6('0xa1'),_0x34b6('0x5a'))[_0x34b6('0x7f')](_0x34b6('0xa1'),'updatedAt')[_0x34b6('0x80')](_0x34b6('0xa4'))[_0x34b6('0x42')]('deletedAt\x20IS\x20NULL')[_0x34b6('0x42')]('ListId\x20=\x20?',_0x44afe9[_0x34b6('0xa3')]['toString']())[_0x34b6('0x42')](_0x34b6('0xa5'))[_0x34b6('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x34b6('0x7e')]()[_0x34b6('0x7f')](_0x34b6('0xa6'))['from']('cm_hopper_final')[_0x34b6('0x42')](_0x34b6('0x84'),_0x2f49b6[_0x34b6('0x57')]['id'][_0x34b6('0x86')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x34b6('0x7e')]()[_0x34b6('0x7f')]('COALESCE(phone,\x27\x27)')[_0x34b6('0x80')](_0x34b6('0x9c'))[_0x34b6('0x42')](_0x34b6('0x84'),_0x2f49b6[_0x34b6('0x57')]['id'][_0x34b6('0x86')]())))[_0x34b6('0x86')]();break;case _0x34b6('0xa7'):_0x2ffe28=squel[_0x34b6('0xa8')]()[_0x34b6('0x9b')]('cm_hopper')[_0x34b6('0x9d')]([_0x34b6('0x9e'),_0x34b6('0xa2'),_0x34b6('0x9f'),'ListId','VoiceQueueId',_0x34b6('0x5a'),_0x34b6('0x58')],squel['select']()[_0x34b6('0x7f')](_0x34b6('0x9e'),_0x34b6('0x9e'))[_0x34b6('0x7f')](_0x34b6('0xa1'),_0x34b6('0xa2'))[_0x34b6('0x7f')]('id',_0x34b6('0x9f'))[_0x34b6('0x7f')](_0x44afe9[_0x34b6('0xa3')][_0x34b6('0x86')](),_0x34b6('0xa0'))[_0x34b6('0x7f')](_0x2f49b6[_0x34b6('0x57')]['id'][_0x34b6('0x86')](),_0x34b6('0x66'))[_0x34b6('0x7f')](_0x34b6('0xa1'),'createdAt')['field'](_0x34b6('0xa1'),_0x34b6('0x58'))[_0x34b6('0x80')](_0x34b6('0xa4'))[_0x34b6('0x42')]('deletedAt\x20IS\x20NULL')[_0x34b6('0x42')]('ListId\x20=\x20?',_0x44afe9['CmListId'][_0x34b6('0x86')]())['where'](_0x34b6('0xa5'))[_0x34b6('0x42')](_0x34b6('0xa9'),squel[_0x34b6('0x7e')]()[_0x34b6('0x7f')](_0x34b6('0xaa'))[_0x34b6('0x80')]('cm_hopper')['where'](_0x34b6('0x84'),_0x2f49b6[_0x34b6('0x57')]['id'][_0x34b6('0x86')]())))['toString']();break;default:_0x2ffe28=squel[_0x34b6('0xa8')]()[_0x34b6('0x9b')]('cm_hopper')[_0x34b6('0x9d')]([_0x34b6('0x9e'),'scheduledAt',_0x34b6('0x9f'),_0x34b6('0xa0'),_0x34b6('0x66'),_0x34b6('0x5a'),_0x34b6('0x58')],squel[_0x34b6('0x7e')]()[_0x34b6('0x7f')](_0x34b6('0x9e'),_0x34b6('0x9e'))[_0x34b6('0x7f')]('NOW()',_0x34b6('0xa2'))[_0x34b6('0x7f')]('id',_0x34b6('0x9f'))[_0x34b6('0x7f')](_0x44afe9[_0x34b6('0xa3')]['toString'](),_0x34b6('0xa0'))[_0x34b6('0x7f')](_0x2f49b6[_0x34b6('0x57')]['id']['toString'](),_0x34b6('0x66'))[_0x34b6('0x7f')](_0x34b6('0xa1'),'createdAt')[_0x34b6('0x7f')](_0x34b6('0xa1'),_0x34b6('0x58'))[_0x34b6('0x80')](_0x34b6('0xa4'))[_0x34b6('0x42')]('deletedAt\x20IS\x20NULL')[_0x34b6('0x42')](_0x34b6('0xab'),_0x44afe9['CmListId']['toString']())['where'](_0x34b6('0xa5')))[_0x34b6('0x86')]();}_0x555e2c[_0x34b6('0xac')](db['sequelize'][_0x34b6('0x39')](_0x2ffe28));}return BPromise[_0x34b6('0x8a')](_0x555e2c);}})['then'](function(){return _0xe3cc76;})[_0x34b6('0x26')](respondWithResult(_0x53c55c,null))[_0x34b6('0x5e')](handleError(_0x53c55c,null));};exports[_0x34b6('0xad')]=function(_0x404645,_0x2092dd,_0x573634){return db[_0x34b6('0x35')][_0x34b6('0x2e')]({'where':{'id':_0x404645[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x2092dd,null))[_0x34b6('0x26')](function(_0x2d3c5d){if(_0x2d3c5d){return _0x2d3c5d[_0x34b6('0xad')](_0x404645['query']['ids']);}})['then'](function(_0x5dc281){if(_0x5dc281){return db[_0x34b6('0x63')]['destroy']({'where':{'ListId':_0x404645[_0x34b6('0x39')]['ids'],'VoiceQueueId':_0x404645['params']['id']}})[_0x34b6('0x26')](function(){return _0x5dc281;});}})[_0x34b6('0x26')](respondWithStatusCode(_0x2092dd,null))['catch'](handleError(_0x2092dd,null));};exports['getBlackLists']=function(_0x4f86ac,_0xf75cbd,_0x480d78){var _0x12c3a5={};var _0x3c4e94={};var _0x424098;var _0xefc9e8;return db['VoiceQueue'][_0x34b6('0x60')]({'where':{'id':_0x4f86ac[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0xf75cbd,null))[_0x34b6('0x26')](function(_0x536c2d){if(_0x536c2d){_0x424098=_0x536c2d;_0x3c4e94[_0x34b6('0x3d')]=_[_0x34b6('0x3a')](db[_0x34b6('0x97')]['rawAttributes']);_0x3c4e94[_0x34b6('0x39')]=_['keys'](_0x4f86ac[_0x34b6('0x39')]);_0x3c4e94[_0x34b6('0x3b')]=_[_0x34b6('0x3c')](_0x3c4e94[_0x34b6('0x3d')],_0x3c4e94['query']);_0x12c3a5[_0x34b6('0x3e')]=_[_0x34b6('0x3c')](_0x3c4e94[_0x34b6('0x3d')],qs[_0x34b6('0x4c')](_0x4f86ac[_0x34b6('0x39')]['fields']));_0x12c3a5[_0x34b6('0x3e')]=_0x12c3a5[_0x34b6('0x3e')]['length']?_0x12c3a5[_0x34b6('0x3e')]:_0x3c4e94[_0x34b6('0x3d')];_0x12c3a5[_0x34b6('0x40')]=qs['sort'](_0x4f86ac[_0x34b6('0x39')]['sort']);_0x12c3a5[_0x34b6('0x42')]=qs[_0x34b6('0x3b')](_[_0x34b6('0x43')](_0x4f86ac[_0x34b6('0x39')],_0x3c4e94['filters']));if(_0x4f86ac['query'][_0x34b6('0x44')]){_0x12c3a5[_0x34b6('0x42')]=_[_0x34b6('0x46')](_0x12c3a5[_0x34b6('0x42')],{'$or':_['map'](_0x12c3a5[_0x34b6('0x3e')],function(_0x628d35){var _0x469d6e={};_0x469d6e[_0x628d35]={'$like':'%'+_0x4f86ac[_0x34b6('0x39')][_0x34b6('0x44')]+'%'};return _0x469d6e;})});}_0x12c3a5=_['merge']({},_0x12c3a5,_0x4f86ac[_0x34b6('0x47')]);return _0x424098[_0x34b6('0xae')](_0x12c3a5);}})[_0x34b6('0x26')](function(_0x141da8){if(_0x141da8){_0xefc9e8=_0x141da8[_0x34b6('0x3f')];if(!_0x4f86ac[_0x34b6('0x39')][_0x34b6('0x61')](_0x34b6('0x62'))){_0x12c3a5[_0x34b6('0x21')]=qs[_0x34b6('0x21')](_0x4f86ac[_0x34b6('0x39')][_0x34b6('0x21')]);_0x12c3a5['offset']=qs[_0x34b6('0x1f')](_0x4f86ac[_0x34b6('0x39')][_0x34b6('0x1f')]);}return _0x424098[_0x34b6('0xae')](_0x12c3a5);}})['then'](function(_0x2b6e17){if(_0x2b6e17){return _0x2b6e17?{'count':_0xefc9e8,'rows':_0x2b6e17}:null;}})[_0x34b6('0x26')](respondWithResult(_0xf75cbd,null))[_0x34b6('0x5e')](handleError(_0xf75cbd,null));};exports['addBlackLists']=function(_0x34a8a9,_0x838f7a,_0x5686f1){var _0x82705c,_0x187e75;return db[_0x34b6('0x35')][_0x34b6('0x2e')]({'where':{'id':_0x34a8a9[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x838f7a,null))[_0x34b6('0x26')](function(_0x1be876){if(_0x1be876){_0x187e75=_0x1be876;return _0x1be876[_0x34b6('0xaf')](_0x34a8a9[_0x34b6('0x4f')][_0x34b6('0x7c')],_['omit'](_0x34a8a9['body'],[_0x34b6('0x7c'),'id'])||{});}return null;})[_0x34b6('0x91')](function(_0x495bd2){var _0xa2f92d;_0x82705c=_0x495bd2||[];var _0x18cd3b=[];if(_0x495bd2){for(var _0x33eeae=0x0;_0x33eeae<_0x495bd2[_0x34b6('0x3f')];_0x33eeae+=0x1){var _0x5e330d=_0x495bd2[_0x33eeae][_0x34b6('0x51')]({'plain':!![]});_0xa2f92d=squel[_0x34b6('0xa8')]()['into'](_0x34b6('0xb0'))[_0x34b6('0x9d')]([_0x34b6('0x9e'),_0x34b6('0x9f'),_0x34b6('0xa0'),_0x34b6('0x66'),'createdAt',_0x34b6('0x58')],squel[_0x34b6('0x7e')]()['field']('phone',_0x34b6('0x9e'))['field']('id',_0x34b6('0x9f'))[_0x34b6('0x7f')](_0x5e330d['CmListId'][_0x34b6('0x86')](),_0x34b6('0xa0'))[_0x34b6('0x7f')](_0x34a8a9[_0x34b6('0x57')]['id'][_0x34b6('0x86')](),'VoiceQueueId')[_0x34b6('0x7f')]('NOW()',_0x34b6('0x5a'))[_0x34b6('0x7f')]('NOW()',_0x34b6('0x58'))[_0x34b6('0x80')](_0x34b6('0xa4'))[_0x34b6('0x42')](_0x34b6('0xb1'))['where']('ListId\x20=\x20?',_0x5e330d['CmListId']['toString']())[_0x34b6('0x42')](_0x34b6('0xa5')))[_0x34b6('0x86')]();_0x18cd3b[_0x34b6('0xac')](db['sequelize'][_0x34b6('0x39')](_0xa2f92d));}return BPromise[_0x34b6('0x8a')](_0x18cd3b);}})[_0x34b6('0x26')](function(){return _0x82705c;})[_0x34b6('0x26')](respondWithResult(_0x838f7a,null))[_0x34b6('0x5e')](handleError(_0x838f7a,null));};exports['removeBlackLists']=function(_0x488f41,_0x323199,_0x2826bc){return db[_0x34b6('0x35')]['find']({'where':{'id':_0x488f41[_0x34b6('0x57')]['id']}})[_0x34b6('0x26')](handleEntityNotFound(_0x323199,null))['then'](function(_0x5f56df){if(_0x5f56df){return _0x5f56df['removeBlackLists'](_0x488f41['query']['ids']);}})['then'](function(_0x3e9f2c){if(_0x3e9f2c){return db[_0x34b6('0x69')][_0x34b6('0x31')]({'where':{'ListId':_0x488f41[_0x34b6('0x39')]['ids'],'VoiceQueueId':_0x488f41['params']['id']}})[_0x34b6('0x26')](function(){return _0x3e9f2c;});}})[_0x34b6('0x26')](respondWithStatusCode(_0x323199,null))['catch'](handleError(_0x323199,null));};
\ No newline at end of file
index 13e782b..f3d02bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcf9=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','save','update','remove','emit'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xbcf9,0xfd));var _0x9bcf=function(_0x2ce9aa,_0xf89712){_0x2ce9aa=_0x2ce9aa-0x0;var _0x48daf8=_0xbcf9[_0x2ce9aa];return _0x48daf8;};'use strict';var EventEmitter=require(_0x9bcf('0x0'));var VoiceQueue=require(_0x9bcf('0x1'))['db'][_0x9bcf('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9bcf('0x3'),'afterUpdate':_0x9bcf('0x4'),'afterDestroy':_0x9bcf('0x5')};function emitEvent(_0x1f532e){return function(_0x11b856,_0x11b795,_0x19ee0a){VoiceQueueEvents[_0x9bcf('0x6')](_0x1f532e+':'+_0x11b856['id'],_0x11b856);VoiceQueueEvents[_0x9bcf('0x6')](_0x1f532e,_0x11b856);_0x19ee0a(null);};}for(var e in events){if(events[_0x9bcf('0x7')](e)){var event=events[e];VoiceQueue[_0x9bcf('0x8')](e,emitEvent(event));}}module[_0x9bcf('0x9')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x8129=['VoiceQueue','setMaxListeners','save','remove','emit','hook','events','../../mysqldb'];(function(_0x2f10cf,_0x1d2f0c){var _0x4e31df=function(_0x5de05c){while(--_0x5de05c){_0x2f10cf['push'](_0x2f10cf['shift']());}};_0x4e31df(++_0x1d2f0c);}(_0x8129,0xb6));var _0x9812=function(_0x5a86f9,_0x236c64){_0x5a86f9=_0x5a86f9-0x0;var _0x45d8d9=_0x8129[_0x5a86f9];return _0x45d8d9;};'use strict';var EventEmitter=require(_0x9812('0x0'));var VoiceQueue=require(_0x9812('0x1'))['db'][_0x9812('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9812('0x3')](0x0);var events={'afterCreate':_0x9812('0x4'),'afterUpdate':'update','afterDestroy':_0x9812('0x5')};function emitEvent(_0x23d839){return function(_0x53df7d,_0x417d0a,_0x23f5cd){VoiceQueueEvents[_0x9812('0x6')](_0x23d839+':'+_0x53df7d['id'],_0x53df7d);VoiceQueueEvents[_0x9812('0x6')](_0x23d839,_0x53df7d);_0x23f5cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x9812('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index af9551b..1b642f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x73081,_0x89bb25){var _0x171bd0=function(_0x4cdf1d){while(--_0x4cdf1d){_0x73081['push'](_0x73081['shift']());}};_0x171bd0(++_0x89bb25);}(_0x34e8,0x12c));var _0x834e=function(_0x21c507,_0x504904){_0x21c507=_0x21c507-0x0;var _0x16bf10=_0x34e8[_0x21c507];return _0x16bf10;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x16f39a,_0x233f55){var _0xd6a5da=function(_0x179a80){while(--_0x179a80){_0x16f39a['push'](_0x16f39a['shift']());}};_0xd6a5da(++_0x233f55);}(_0x008c,0x188));var _0xc008=function(_0x3c77f9,_0x2abb07){_0x3c77f9=_0x3c77f9-0x0;var _0x41790a=_0x008c[_0x3c77f9];return _0x41790a;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d3dc810..8ee022b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaff9=['catch','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','GetVoiceQueue','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueue,\x20%s,\x20%s','message'];(function(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0xaff9,0xa9));var _0x9aff=function(_0x2b5a07,_0x582d27){_0x2b5a07=_0x2b5a07-0x0;var _0xaef95b=_0xaff9[_0x2b5a07];return _0xaef95b;};'use strict';var _=require(_0x9aff('0x0'));var util=require(_0x9aff('0x1'));var moment=require(_0x9aff('0x2'));var BPromise=require(_0x9aff('0x3'));var rs=require(_0x9aff('0x4'));var fs=require('fs');var Redis=require(_0x9aff('0x5'));var db=require(_0x9aff('0x6'))['db'];var utils=require(_0x9aff('0x7'));var logger=require(_0x9aff('0x8'))(_0x9aff('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9aff('0xa')][_0x9aff('0xb')]({'port':0x232a});config[_0x9aff('0xc')]=_['defaults'](config[_0x9aff('0xc')],{'host':_0x9aff('0xd'),'port':0x18eb});var socket=require(_0x9aff('0xe'))(new Redis(config['redis']));require(_0x9aff('0xf'))['register'](socket);function respondWithRpcPromise(_0x25b587,_0xbf47e6,_0x2a6cc8){return new BPromise(function(_0x653b65,_0x52c680){return client[_0x9aff('0x10')](_0x25b587,_0x2a6cc8)[_0x9aff('0x11')](function(_0x7c38c2){logger[_0x9aff('0x12')]('VoiceQueue,\x20%s,\x20%s',_0xbf47e6,_0x9aff('0x13'));logger[_0x9aff('0x14')](_0x9aff('0x15'),_0xbf47e6,_0x9aff('0x13'),JSON[_0x9aff('0x16')](_0x7c38c2));if(_0x7c38c2[_0x9aff('0x17')]){if(_0x7c38c2[_0x9aff('0x17')]['code']===0x1f4){logger[_0x9aff('0x17')](_0x9aff('0x18'),_0xbf47e6,_0x7c38c2[_0x9aff('0x17')][_0x9aff('0x19')]);return _0x52c680(_0x7c38c2['error']['message']);}logger[_0x9aff('0x17')](_0x9aff('0x18'),_0xbf47e6,_0x7c38c2['error'][_0x9aff('0x19')]);return _0x653b65(_0x7c38c2[_0x9aff('0x17')][_0x9aff('0x19')]);}else{logger[_0x9aff('0x12')]('VoiceQueue,\x20%s,\x20%s',_0xbf47e6,_0x9aff('0x13'));_0x653b65(_0x7c38c2['result'][_0x9aff('0x19')]);}})[_0x9aff('0x1a')](function(_0xf2b7a4){logger[_0x9aff('0x17')](_0x9aff('0x18'),_0xbf47e6,_0xf2b7a4);_0x52c680(_0xf2b7a4);});});}exports['GetVoiceQueue']=function(_0xb2056a){var _0x2c4247=this;return new Promise(function(_0x2b1d77,_0x175561){return db[_0x9aff('0x1b')][_0x9aff('0x1c')]({'raw':_0xb2056a[_0x9aff('0x1d')]?_0xb2056a['options'][_0x9aff('0x1e')]===undefined?!![]:![]:!![],'where':_0xb2056a[_0x9aff('0x1d')]?_0xb2056a[_0x9aff('0x1d')][_0x9aff('0x1f')]||null:null,'attributes':_0xb2056a[_0x9aff('0x1d')]?_0xb2056a[_0x9aff('0x1d')][_0x9aff('0x20')]||null:null,'limit':_0xb2056a[_0x9aff('0x1d')]?_0xb2056a[_0x9aff('0x1d')]['limit']||null:null,'include':_0xb2056a[_0x9aff('0x1d')]?_0xb2056a[_0x9aff('0x1d')][_0x9aff('0x21')]?_[_0x9aff('0x22')](_0xb2056a[_0x9aff('0x1d')][_0x9aff('0x21')],function(_0x405dad){return{'model':db[_0x405dad[_0x9aff('0x23')]],'as':_0x405dad['as'],'attributes':_0x405dad[_0x9aff('0x20')],'include':_0x405dad[_0x9aff('0x21')]?_[_0x9aff('0x22')](_0x405dad[_0x9aff('0x21')],function(_0x476644){return{'model':db[_0x476644['model']],'as':_0x476644['as'],'attributes':_0x476644[_0x9aff('0x20')],'include':_0x476644[_0x9aff('0x21')]?_[_0x9aff('0x22')](_0x476644[_0x9aff('0x21')],function(_0x34eb62){return{'model':db[_0x34eb62[_0x9aff('0x23')]],'as':_0x34eb62['as'],'attributes':_0x34eb62[_0x9aff('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9aff('0x11')](function(_0x4ff94d){logger['info']('GetVoiceQueue',_0xb2056a);logger[_0x9aff('0x14')]('GetVoiceQueue',_0xb2056a,JSON[_0x9aff('0x16')](_0x4ff94d));_0x2b1d77(_0x4ff94d);})[_0x9aff('0x1a')](function(_0x2a0843){logger[_0x9aff('0x17')](_0x9aff('0x24'),_0x2a0843[_0x9aff('0x19')],_0xb2056a);_0x175561(_0x2c4247[_0x9aff('0x17')](0x1f4,_0x2a0843[_0x9aff('0x19')]));});});};exports[_0x9aff('0x25')]=function(_0x159775){var _0x53ffc4=this;return new Promise(function(_0xa3bd6d,_0x1f77ce){return db['VoiceQueue'][_0x9aff('0x26')]({'raw':_0x159775[_0x9aff('0x1d')]?_0x159775['options'][_0x9aff('0x1e')]===undefined?!![]:![]:!![],'where':_0x159775[_0x9aff('0x1d')]?_0x159775['options'][_0x9aff('0x1f')]||null:null,'attributes':_0x159775['options']?_0x159775[_0x9aff('0x1d')][_0x9aff('0x20')]||null:null,'include':_0x159775[_0x9aff('0x1d')]?_0x159775[_0x9aff('0x1d')][_0x9aff('0x21')]?_[_0x9aff('0x22')](_0x159775[_0x9aff('0x1d')][_0x9aff('0x21')],function(_0x1361a4){return{'model':db[_0x1361a4[_0x9aff('0x23')]],'as':_0x1361a4['as'],'attributes':_0x1361a4[_0x9aff('0x20')],'include':_0x1361a4[_0x9aff('0x21')]?_[_0x9aff('0x22')](_0x1361a4['include'],function(_0x335b64){return{'model':db[_0x335b64['model']],'as':_0x335b64['as'],'attributes':_0x335b64[_0x9aff('0x20')],'include':_0x335b64[_0x9aff('0x21')]?_[_0x9aff('0x22')](_0x335b64[_0x9aff('0x21')],function(_0x133f51){return{'model':db[_0x133f51[_0x9aff('0x23')]],'as':_0x133f51['as'],'attributes':_0x133f51[_0x9aff('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9aff('0x11')](function(_0x166a93){logger['info'](_0x9aff('0x25'),_0x159775);logger['debug'](_0x9aff('0x25'),_0x159775,JSON['stringify'](_0x166a93));_0xa3bd6d(_0x166a93);})[_0x9aff('0x1a')](function(_0x39359b){logger['error'](_0x9aff('0x25'),_0x39359b[_0x9aff('0x19')],_0x159775);_0x1f77ce(_0x53ffc4[_0x9aff('0x17')](0x1f4,_0x39359b[_0x9aff('0x19')]));});});};
\ No newline at end of file
+var _0x42dc=['debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','ShowVoiceQueue','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','request\x20sent'];(function(_0x1bcee0,_0x10ea66){var _0x3482d2=function(_0x5df15c){while(--_0x5df15c){_0x1bcee0['push'](_0x1bcee0['shift']());}};_0x3482d2(++_0x10ea66);}(_0x42dc,0x153));var _0xc42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42dc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc42d('0x0'));var util=require('util');var moment=require(_0xc42d('0x1'));var BPromise=require(_0xc42d('0x2'));var rs=require(_0xc42d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc42d('0x4'))['db'];var utils=require(_0xc42d('0x5'));var logger=require(_0xc42d('0x6'))(_0xc42d('0x7'));var config=require(_0xc42d('0x8'));var jayson=require(_0xc42d('0x9'));var client=jayson[_0xc42d('0xa')][_0xc42d('0xb')]({'port':0x232a});config[_0xc42d('0xc')]=_[_0xc42d('0xd')](config['redis'],{'host':_0xc42d('0xe'),'port':0x18eb});var socket=require(_0xc42d('0xf'))(new Redis(config[_0xc42d('0xc')]));require(_0xc42d('0x10'))[_0xc42d('0x11')](socket);function respondWithRpcPromise(_0x2a672d,_0x3dd424,_0x4d7c44){return new BPromise(function(_0x582262,_0x19101f){return client['request'](_0x2a672d,_0x4d7c44)[_0xc42d('0x12')](function(_0x576e21){logger[_0xc42d('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x3dd424,_0xc42d('0x14'));logger[_0xc42d('0x15')](_0xc42d('0x16'),_0x3dd424,_0xc42d('0x14'),JSON[_0xc42d('0x17')](_0x576e21));if(_0x576e21[_0xc42d('0x18')]){if(_0x576e21[_0xc42d('0x18')]['code']===0x1f4){logger[_0xc42d('0x18')](_0xc42d('0x19'),_0x3dd424,_0x576e21[_0xc42d('0x18')][_0xc42d('0x1a')]);return _0x19101f(_0x576e21['error']['message']);}logger[_0xc42d('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x3dd424,_0x576e21[_0xc42d('0x18')][_0xc42d('0x1a')]);return _0x582262(_0x576e21[_0xc42d('0x18')]['message']);}else{logger[_0xc42d('0x13')](_0xc42d('0x19'),_0x3dd424,_0xc42d('0x14'));_0x582262(_0x576e21[_0xc42d('0x1b')][_0xc42d('0x1a')]);}})[_0xc42d('0x1c')](function(_0x93b643){logger[_0xc42d('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x3dd424,_0x93b643);_0x19101f(_0x93b643);});});}exports[_0xc42d('0x1d')]=function(_0x356d59){var _0x36ab83=this;return new Promise(function(_0x3d8db1,_0x4cf130){return db[_0xc42d('0x1e')][_0xc42d('0x1f')]({'raw':_0x356d59[_0xc42d('0x20')]?_0x356d59[_0xc42d('0x20')][_0xc42d('0x21')]===undefined?!![]:![]:!![],'where':_0x356d59[_0xc42d('0x20')]?_0x356d59[_0xc42d('0x20')][_0xc42d('0x22')]||null:null,'attributes':_0x356d59[_0xc42d('0x20')]?_0x356d59[_0xc42d('0x20')][_0xc42d('0x23')]||null:null,'limit':_0x356d59[_0xc42d('0x20')]?_0x356d59['options']['limit']||null:null,'include':_0x356d59[_0xc42d('0x20')]?_0x356d59[_0xc42d('0x20')][_0xc42d('0x24')]?_[_0xc42d('0x25')](_0x356d59['options']['include'],function(_0x404be6){return{'model':db[_0x404be6['model']],'as':_0x404be6['as'],'attributes':_0x404be6['attributes'],'include':_0x404be6[_0xc42d('0x24')]?_[_0xc42d('0x25')](_0x404be6[_0xc42d('0x24')],function(_0x57f568){return{'model':db[_0x57f568[_0xc42d('0x26')]],'as':_0x57f568['as'],'attributes':_0x57f568['attributes'],'include':_0x57f568[_0xc42d('0x24')]?_[_0xc42d('0x25')](_0x57f568['include'],function(_0x2438d7){return{'model':db[_0x2438d7[_0xc42d('0x26')]],'as':_0x2438d7['as'],'attributes':_0x2438d7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1086b4){logger[_0xc42d('0x13')](_0xc42d('0x1d'),_0x356d59);logger['debug'](_0xc42d('0x1d'),_0x356d59,JSON[_0xc42d('0x17')](_0x1086b4));_0x3d8db1(_0x1086b4);})[_0xc42d('0x1c')](function(_0x6ce05d){logger[_0xc42d('0x18')](_0xc42d('0x1d'),_0x6ce05d[_0xc42d('0x1a')],_0x356d59);_0x4cf130(_0x36ab83[_0xc42d('0x18')](0x1f4,_0x6ce05d[_0xc42d('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x140db9){var _0x52b894=this;return new Promise(function(_0x1e31a4,_0x4540b3){return db[_0xc42d('0x1e')]['find']({'raw':_0x140db9[_0xc42d('0x20')]?_0x140db9[_0xc42d('0x20')][_0xc42d('0x21')]===undefined?!![]:![]:!![],'where':_0x140db9[_0xc42d('0x20')]?_0x140db9[_0xc42d('0x20')][_0xc42d('0x22')]||null:null,'attributes':_0x140db9[_0xc42d('0x20')]?_0x140db9[_0xc42d('0x20')][_0xc42d('0x23')]||null:null,'include':_0x140db9['options']?_0x140db9['options'][_0xc42d('0x24')]?_[_0xc42d('0x25')](_0x140db9[_0xc42d('0x20')][_0xc42d('0x24')],function(_0x3e9b53){return{'model':db[_0x3e9b53[_0xc42d('0x26')]],'as':_0x3e9b53['as'],'attributes':_0x3e9b53[_0xc42d('0x23')],'include':_0x3e9b53[_0xc42d('0x24')]?_[_0xc42d('0x25')](_0x3e9b53[_0xc42d('0x24')],function(_0x1ddef0){return{'model':db[_0x1ddef0[_0xc42d('0x26')]],'as':_0x1ddef0['as'],'attributes':_0x1ddef0[_0xc42d('0x23')],'include':_0x1ddef0['include']?_[_0xc42d('0x25')](_0x1ddef0['include'],function(_0x2fb414){return{'model':db[_0x2fb414['model']],'as':_0x2fb414['as'],'attributes':_0x2fb414['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c9a7a){logger['info']('ShowVoiceQueue',_0x140db9);logger[_0xc42d('0x15')]('ShowVoiceQueue',_0x140db9,JSON[_0xc42d('0x17')](_0x3c9a7a));_0x1e31a4(_0x3c9a7a);})['catch'](function(_0x4b9fe3){logger['error'](_0xc42d('0x27'),_0x4b9fe3[_0xc42d('0x1a')],_0x140db9);_0x4540b3(_0x52b894['error'](0x1f4,_0x4b9fe3['message']));});});};
\ No newline at end of file
index 3e6cf5a..85c1a40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70b3=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','update'];(function(_0xf333d2,_0x44d7f8){var _0x39fadb=function(_0x42d01a){while(--_0x42d01a){_0xf333d2['push'](_0xf333d2['shift']());}};_0x39fadb(++_0x44d7f8);}(_0x70b3,0x1c5));var _0x370b=function(_0x267a87,_0x4fa360){_0x267a87=_0x267a87-0x0;var _0x13d547=_0x70b3[_0x267a87];return _0x13d547;};'use strict';var VoiceQueueEvents=require(_0x370b('0x0'));var events=[_0x370b('0x1'),'remove',_0x370b('0x2')];function createListener(_0x478c61,_0x4085c7){return function(_0x4f7d9a){_0x4085c7[_0x370b('0x3')](_0x478c61,_0x4f7d9a);};}function removeListener(_0x3b6203,_0xa050a9){return function(){VoiceQueueEvents[_0x370b('0x4')](_0x3b6203,_0xa050a9);};}exports[_0x370b('0x5')]=function(_0x36b768){for(var _0x4de545=0x0,_0x52f291=events[_0x370b('0x6')];_0x4de545<_0x52f291;_0x4de545++){var _0x4bb324=events[_0x4de545];var _0x10ac69=createListener(_0x370b('0x7')+_0x4bb324,_0x36b768);VoiceQueueEvents['on'](_0x4bb324,_0x10ac69);}};
\ No newline at end of file
+var _0x62c9=['length','voiceQueue:','save','update','emit','removeListener','register'];(function(_0x18b4e8,_0x30e9e1){var _0x4b6265=function(_0x46bc8b){while(--_0x46bc8b){_0x18b4e8['push'](_0x18b4e8['shift']());}};_0x4b6265(++_0x30e9e1);}(_0x62c9,0x1c2));var _0x962c=function(_0x260939,_0x17bee4){_0x260939=_0x260939-0x0;var _0x29fd7b=_0x62c9[_0x260939];return _0x29fd7b;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x962c('0x0'),'remove',_0x962c('0x1')];function createListener(_0x505e34,_0x20bd9d){return function(_0x3ae15a){_0x20bd9d[_0x962c('0x2')](_0x505e34,_0x3ae15a);};}function removeListener(_0x11acda,_0x29676b){return function(){VoiceQueueEvents[_0x962c('0x3')](_0x11acda,_0x29676b);};}exports[_0x962c('0x4')]=function(_0x516dd6){for(var _0x1811ab=0x0,_0x51cbd1=events[_0x962c('0x5')];_0x1811ab<_0x51cbd1;_0x1811ab++){var _0x43c217=events[_0x1811ab];var _0x4eaf51=createListener(_0x962c('0x6')+_0x43c217,_0x516dd6);VoiceQueueEvents['on'](_0x43c217,_0x4eaf51);}};
\ No newline at end of file
index 5c42cdc..17a5721 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6c2=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xc6c2,0xf2));var _0x2c6c=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0xc6c2[_0x687ddc];return _0x441991;};'use strict';var multer=require(_0x2c6c('0x0'));var util=require(_0x2c6c('0x1'));var path=require('path');var timeout=require(_0x2c6c('0x2'));var express=require(_0x2c6c('0x3'));var router=express[_0x2c6c('0x4')]();var fs_extra=require(_0x2c6c('0x5'));var auth=require(_0x2c6c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c6c('0x7'));var controller=require('./voiceQueueReport.controller');router[_0x2c6c('0x8')]('/',auth[_0x2c6c('0x9')](),controller[_0x2c6c('0xa')]);router[_0x2c6c('0x8')](_0x2c6c('0xb'),auth[_0x2c6c('0x9')](),controller['describe']);router[_0x2c6c('0x8')]('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x2c6c('0x8')](_0x2c6c('0xc'),auth['isAuthenticated'](),controller[_0x2c6c('0xd')]);router[_0x2c6c('0xe')]('/',auth[_0x2c6c('0x9')](),controller[_0x2c6c('0xf')]);router[_0x2c6c('0x10')](_0x2c6c('0xc'),auth[_0x2c6c('0x9')](),controller[_0x2c6c('0x11')]);router[_0x2c6c('0x12')](_0x2c6c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2c6c('0x13')]=router;
\ No newline at end of file
+var _0xee0e=['/:id','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','get','index','/describe','/index','isAuthenticated','getVoiceQueuesReport'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xee0e,0x1ab));var _0xeee0=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0xee0e[_0x4a095e];return _0x10ef73;};'use strict';var multer=require(_0xeee0('0x0'));var util=require(_0xeee0('0x1'));var path=require(_0xeee0('0x2'));var timeout=require('connect-timeout');var express=require(_0xeee0('0x3'));var router=express[_0xeee0('0x4')]();var fs_extra=require(_0xeee0('0x5'));var auth=require(_0xeee0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xeee0('0x7')]('/',auth['isAuthenticated'](),controller[_0xeee0('0x8')]);router[_0xeee0('0x7')](_0xeee0('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xeee0('0x7')](_0xeee0('0xa'),auth[_0xeee0('0xb')](),controller[_0xeee0('0xc')]);router[_0xeee0('0x7')](_0xeee0('0xd'),auth[_0xeee0('0xb')](),controller['show']);router[_0xeee0('0xe')]('/',auth['isAuthenticated'](),controller[_0xeee0('0xf')]);router['put'](_0xeee0('0xd'),auth[_0xeee0('0xb')](),controller[_0xeee0('0x10')]);router[_0xeee0('0x11')]('/:id',auth[_0xeee0('0xb')](),controller[_0xeee0('0x12')]);module[_0xeee0('0x13')]=router;
\ No newline at end of file
index 419065a..512014f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0d5=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xb0d5,0x1db));var _0x5b0d=function(_0x5cb367,_0x27ec9d){_0x5cb367=_0x5cb367-0x0;var _0x279365=_0xb0d5[_0x5cb367];return _0x279365;};'use strict';var Sequelize=require(_0x5b0d('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x5b0d('0x1')]},'uniqueid':{'type':Sequelize[_0x5b0d('0x1')]},'calleridnum':{'type':Sequelize[_0x5b0d('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5b0d('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x5b0d('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x5b0d('0x2')],'set':function(_0x58359a){var _0x21b2c6=moment(_0x58359a);var _0x348bf9=moment(this['getDataValue'](_0x5b0d('0x3')))[_0x5b0d('0x4')](_0x5b0d('0x5'));var _0x5da075=_0x21b2c6['diff'](_0x348bf9,'seconds');this[_0x5b0d('0x6')](_0x5b0d('0x7'),_0x58359a);this[_0x5b0d('0x6')](_0x5b0d('0x8'),_0x5da075||null);}},'position':{'type':Sequelize[_0x5b0d('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x5b0d('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5b0d('0x2')]},'queuecallerexit':{'type':Sequelize[_0x5b0d('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5b0d('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x5b0d('0x1')],'comment':_0x5b0d('0xb')},'originalposition':{'type':Sequelize[_0x5b0d('0x9')]},'channel':{'type':Sequelize[_0x5b0d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x5b0d('0x1')]},'connectedlinename':{'type':Sequelize[_0x5b0d('0x1')]},'accountcode':{'type':Sequelize[_0x5b0d('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5b0d('0x1')]},'priority':{'type':Sequelize[_0x5b0d('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5b0d('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5b0d('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5b0d('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x5b0d('0xc')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x5b0d('0x1')]},'disposition':{'type':Sequelize[_0x5b0d('0x1')]},'secondDisposition':{'type':Sequelize[_0x5b0d('0x1')]},'thirdDisposition':{'type':Sequelize[_0x5b0d('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x5b0d('0x9')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9611=['setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x19d6c5,_0x3e517e){var _0x291cf9=function(_0x1af2b8){while(--_0x1af2b8){_0x19d6c5['push'](_0x19d6c5['shift']());}};_0x291cf9(++_0x3e517e);}(_0x9611,0x94));var _0x1961=function(_0x17ca12,_0x1c9cf4){_0x17ca12=_0x17ca12-0x0;var _0x2093ab=_0x9611[_0x17ca12];return _0x2093ab;};'use strict';var Sequelize=require(_0x1961('0x0'));var moment=require('moment');module[_0x1961('0x1')]={'type':{'type':Sequelize[_0x1961('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1961('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x1961('0x3')],'set':function(_0x5a7925){var _0x24a924=moment(_0x5a7925);var _0x55fb93=moment(this[_0x1961('0x4')](_0x1961('0x5')))['format'](_0x1961('0x6'));var _0x438aa2=_0x24a924[_0x1961('0x7')](_0x55fb93,'seconds');this[_0x1961('0x8')]('queuecallerleaveAt',_0x5a7925);this[_0x1961('0x8')](_0x1961('0x9'),_0x438aa2||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x1961('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x1961('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1961('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x1961('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1961('0x3')]},'queuecallerexit':{'type':Sequelize[_0x1961('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1961('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x1961('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x1961('0xa')]},'channel':{'type':Sequelize[_0x1961('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1961('0x2')]},'connectedlinename':{'type':Sequelize[_0x1961('0x2')]},'accountcode':{'type':Sequelize[_0x1961('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1961('0x2')]},'priority':{'type':Sequelize[_0x1961('0x2')]},'holdtime':{'type':Sequelize[_0x1961('0xa')]},'mohtime':{'type':Sequelize[_0x1961('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1961('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1961('0x2')]},'transfer':{'type':Sequelize[_0x1961('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1961('0x2')],'comment':_0x1961('0xc')},'transferexten':{'type':Sequelize[_0x1961('0x2')]},'transferuniqueid':{'type':Sequelize[_0x1961('0x2')]},'disposition':{'type':Sequelize[_0x1961('0x2')]},'secondDisposition':{'type':Sequelize[_0x1961('0x2')]},'thirdDisposition':{'type':Sequelize[_0x1961('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x1961('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index c98f958..3d48c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe640=['create','body','describe','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','filters','length','find'];(function(_0x118621,_0x197b5c){var _0x527611=function(_0xcbfe12){while(--_0xcbfe12){_0x118621['push'](_0x118621['shift']());}};_0x527611(++_0x197b5c);}(_0xe640,0x151));var _0x0e64=function(_0x11c619,_0x5ef967){_0x11c619=_0x11c619-0x0;var _0x3799dc=_0xe640[_0x11c619];return _0x3799dc;};'use strict';var emlformat=require(_0x0e64('0x0'));var rimraf=require(_0x0e64('0x1'));var zipdir=require(_0x0e64('0x2'));var jsonpatch=require(_0x0e64('0x3'));var rp=require(_0x0e64('0x4'));var moment=require(_0x0e64('0x5'));var BPromise=require(_0x0e64('0x6'));var Mustache=require(_0x0e64('0x7'));var util=require(_0x0e64('0x8'));var path=require(_0x0e64('0x9'));var sox=require(_0x0e64('0xa'));var csv=require(_0x0e64('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e64('0xc'));var _=require('lodash');var squel=require(_0x0e64('0xd'));var crypto=require(_0x0e64('0xe'));var jsforce=require(_0x0e64('0xf'));var deskjs=require(_0x0e64('0x10'));var toCsv=require(_0x0e64('0xb'));var querystring=require('querystring');var Papa=require(_0x0e64('0x11'));var Redis=require(_0x0e64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0e64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e64('0x14'))('api');var utils=require(_0x0e64('0x15'));var config=require(_0x0e64('0x16'));var licenseUtil=require(_0x0e64('0x17'));var db=require(_0x0e64('0x18'))['db'];config[_0x0e64('0x19')]=_[_0x0e64('0x1a')](config[_0x0e64('0x19')],{'host':_0x0e64('0x1b'),'port':0x18eb});var socket=require(_0x0e64('0x1c'))(new Redis(config[_0x0e64('0x19')]));require(_0x0e64('0x1d'))[_0x0e64('0x1e')](socket);function respondWithStatusCode(_0x3f4919,_0xb562ca){_0xb562ca=_0xb562ca||0xcc;return function(_0x2de3a5){if(_0x2de3a5){return _0x3f4919['sendStatus'](_0xb562ca);}return _0x3f4919[_0x0e64('0x1f')](_0xb562ca)[_0x0e64('0x20')]();};}function respondWithResult(_0x2ee6e7,_0x3b8e37){_0x3b8e37=_0x3b8e37||0xc8;return function(_0x2c8c6f){if(_0x2c8c6f){return _0x2ee6e7['status'](_0x3b8e37)[_0x0e64('0x21')](_0x2c8c6f);}};}function respondWithFilteredResult(_0x3b7fe8,_0x5ed5e8){return function(_0x33ba86){if(_0x33ba86){var _0x3bd2a3=typeof _0x5ed5e8[_0x0e64('0x22')]==='undefined'&&typeof _0x5ed5e8[_0x0e64('0x23')]===_0x0e64('0x24');var _0x4d5e19=_0x33ba86['count'];var _0x3e4a2e=_0x3bd2a3?0x0:_0x5ed5e8[_0x0e64('0x22')];var _0x31d85d=_0x3bd2a3?_0x33ba86[_0x0e64('0x25')]:_0x5ed5e8[_0x0e64('0x22')]+_0x5ed5e8[_0x0e64('0x23')];var _0x309130;if(_0x31d85d>=_0x4d5e19){_0x31d85d=_0x4d5e19;_0x309130=0xc8;}else{_0x309130=0xce;}_0x3b7fe8[_0x0e64('0x1f')](_0x309130);return _0x3b7fe8[_0x0e64('0x26')](_0x0e64('0x27'),_0x3e4a2e+'-'+_0x31d85d+'/'+_0x4d5e19)[_0x0e64('0x21')](_0x33ba86);}return null;};}function patchUpdates(_0x192a3a){return function(_0x5b469a){try{jsonpatch[_0x0e64('0x28')](_0x5b469a,_0x192a3a,!![]);}catch(_0x320381){return BPromise['reject'](_0x320381);}return _0x5b469a[_0x0e64('0x29')]();};}function saveUpdates(_0x275cc6,_0x58d689){return function(_0xce3931){if(_0xce3931){return _0xce3931[_0x0e64('0x2a')](_0x275cc6)[_0x0e64('0x2b')](function(_0x1a6ba3){return _0x1a6ba3;});}return null;};}function removeEntity(_0x2b5d5b,_0x140a09){return function(_0x2e9ec0){if(_0x2e9ec0){return _0x2e9ec0[_0x0e64('0x2c')]()[_0x0e64('0x2b')](function(){_0x2b5d5b[_0x0e64('0x1f')](0xcc)[_0x0e64('0x20')]();});}};}function handleEntityNotFound(_0x3a22f7,_0x25db73){return function(_0x4786b7){if(!_0x4786b7){_0x3a22f7[_0x0e64('0x2d')](0x194);}return _0x4786b7;};}function handleError(_0x2d16be,_0x1456bd){_0x1456bd=_0x1456bd||0x1f4;return function(_0x37ad6a){logger[_0x0e64('0x2e')](_0x37ad6a[_0x0e64('0x2f')]);if(_0x37ad6a[_0x0e64('0x30')]){delete _0x37ad6a[_0x0e64('0x30')];}_0x2d16be['status'](_0x1456bd)['send'](_0x37ad6a);};}exports['index']=function(_0x1cf8fa,_0x17a468){var _0x2cbe9a={},_0x21765e={},_0x504764={'count':0x0,'rows':[]};var _0x31a33c=_[_0x0e64('0x31')](db[_0x0e64('0x32')][_0x0e64('0x33')],function(_0x556456){return{'name':_0x556456[_0x0e64('0x34')],'type':_0x556456[_0x0e64('0x35')][_0x0e64('0x36')]};});_0x21765e[_0x0e64('0x37')]=_[_0x0e64('0x31')](_0x31a33c,_0x0e64('0x30'));_0x21765e[_0x0e64('0x38')]=_[_0x0e64('0x39')](_0x1cf8fa[_0x0e64('0x38')]);_0x21765e['filters']=_[_0x0e64('0x3a')](_0x21765e[_0x0e64('0x37')],_0x21765e['query']);_0x2cbe9a[_0x0e64('0x3b')]=_[_0x0e64('0x3a')](_0x21765e['model'],qs[_0x0e64('0x3c')](_0x1cf8fa[_0x0e64('0x38')]['fields']));_0x2cbe9a[_0x0e64('0x3b')]=_0x2cbe9a[_0x0e64('0x3b')]['length']?_0x2cbe9a['attributes']:_0x21765e[_0x0e64('0x37')];if(!_0x1cf8fa[_0x0e64('0x38')]['hasOwnProperty'](_0x0e64('0x3d'))){_0x2cbe9a[_0x0e64('0x23')]=qs[_0x0e64('0x23')](_0x1cf8fa[_0x0e64('0x38')][_0x0e64('0x23')]);_0x2cbe9a[_0x0e64('0x22')]=qs[_0x0e64('0x22')](_0x1cf8fa[_0x0e64('0x38')][_0x0e64('0x22')]);}_0x2cbe9a[_0x0e64('0x3e')]=qs['sort'](_0x1cf8fa[_0x0e64('0x38')][_0x0e64('0x3f')]);_0x2cbe9a[_0x0e64('0x40')]=qs['filters'](_['pick'](_0x1cf8fa['query'],_0x21765e['filters']),_0x31a33c);if(_0x1cf8fa['query'][_0x0e64('0x41')]){_0x2cbe9a[_0x0e64('0x40')]=_[_0x0e64('0x42')](_0x2cbe9a[_0x0e64('0x40')],{'$or':_[_0x0e64('0x31')](_0x31a33c,function(_0x1ce2ce){if(_0x1ce2ce['type']!==_0x0e64('0x43')){var _0x2c2fab={};_0x2c2fab[_0x1ce2ce['name']]={'$like':'%'+_0x1cf8fa[_0x0e64('0x38')][_0x0e64('0x41')]+'%'};return _0x2c2fab;}})});}_0x2cbe9a=_[_0x0e64('0x42')]({},_0x2cbe9a,_0x1cf8fa[_0x0e64('0x44')]);var _0x5e73f3={'where':_0x2cbe9a[_0x0e64('0x40')]};return db[_0x0e64('0x32')]['count'](_0x5e73f3)[_0x0e64('0x2b')](function(_0x5e7792){_0x504764[_0x0e64('0x25')]=_0x5e7792;if(_0x1cf8fa['query'][_0x0e64('0x45')]){_0x2cbe9a[_0x0e64('0x46')]=[{'all':!![]}];}return db[_0x0e64('0x32')]['findAll'](_0x2cbe9a);})[_0x0e64('0x2b')](function(_0x32522b){_0x504764[_0x0e64('0x47')]=_0x32522b;return _0x504764;})['then'](respondWithFilteredResult(_0x17a468,_0x2cbe9a))[_0x0e64('0x48')](handleError(_0x17a468,null));};exports[_0x0e64('0x49')]=function(_0x10e0bd,_0x436af4){var _0x3d91f6={'raw':![],'where':{'id':_0x10e0bd[_0x0e64('0x4a')]['id']}},_0x5b2118={};_0x5b2118['model']=_['keys'](db[_0x0e64('0x32')][_0x0e64('0x33')]);_0x5b2118['query']=_['keys'](_0x10e0bd[_0x0e64('0x38')]);_0x5b2118[_0x0e64('0x4b')]=_[_0x0e64('0x3a')](_0x5b2118[_0x0e64('0x37')],_0x5b2118[_0x0e64('0x38')]);_0x3d91f6[_0x0e64('0x3b')]=_['intersection'](_0x5b2118[_0x0e64('0x37')],qs[_0x0e64('0x3c')](_0x10e0bd[_0x0e64('0x38')][_0x0e64('0x3c')]));_0x3d91f6[_0x0e64('0x3b')]=_0x3d91f6['attributes'][_0x0e64('0x4c')]?_0x3d91f6[_0x0e64('0x3b')]:_0x5b2118[_0x0e64('0x37')];if(_0x10e0bd['query'][_0x0e64('0x45')]){_0x3d91f6[_0x0e64('0x46')]=[{'all':!![]}];}_0x3d91f6=_['merge']({},_0x3d91f6,_0x10e0bd[_0x0e64('0x44')]);return db[_0x0e64('0x32')][_0x0e64('0x4d')](_0x3d91f6)[_0x0e64('0x2b')](handleEntityNotFound(_0x436af4,null))[_0x0e64('0x2b')](respondWithResult(_0x436af4,null))[_0x0e64('0x48')](handleError(_0x436af4,null));};exports[_0x0e64('0x4e')]=function(_0x5ce02b,_0x5264bc){return db[_0x0e64('0x32')][_0x0e64('0x4e')](_0x5ce02b[_0x0e64('0x4f')],{})['then'](respondWithResult(_0x5264bc,0xc9))['catch'](handleError(_0x5264bc,null));};exports[_0x0e64('0x2a')]=function(_0x266379,_0x39703d){if(_0x266379[_0x0e64('0x4f')]['id']){delete _0x266379['body']['id'];}return db[_0x0e64('0x32')][_0x0e64('0x4d')]({'where':{'id':_0x266379[_0x0e64('0x4a')]['id']}})[_0x0e64('0x2b')](handleEntityNotFound(_0x39703d,null))['then'](saveUpdates(_0x266379[_0x0e64('0x4f')],null))[_0x0e64('0x2b')](respondWithResult(_0x39703d,null))['catch'](handleError(_0x39703d,null));};exports[_0x0e64('0x2c')]=function(_0x41db52,_0x423a33){return db[_0x0e64('0x32')]['find']({'where':{'id':_0x41db52[_0x0e64('0x4a')]['id']}})[_0x0e64('0x2b')](handleEntityNotFound(_0x423a33,null))[_0x0e64('0x2b')](removeEntity(_0x423a33,null))[_0x0e64('0x48')](handleError(_0x423a33,null));};exports[_0x0e64('0x50')]=function(_0x448d2c,_0x417b2d){return db[_0x0e64('0x32')][_0x0e64('0x50')]()[_0x0e64('0x2b')](respondWithResult(_0x417b2d,null))[_0x0e64('0x48')](handleError(_0x417b2d,null));};exports['getVoiceQueuesReport']=function(_0x405372,_0x5b912f){var _0x1d73d9={},_0x5ac250={},_0x25bd90={'count':0x0,'rows':[]};_0x5ac250[_0x0e64('0x37')]=_[_0x0e64('0x39')](db[_0x0e64('0x32')]['rawAttributes']);_0x5ac250['query']=_['keys'](_0x405372['query']);_0x5ac250[_0x0e64('0x4b')]=_[_0x0e64('0x3a')](_0x5ac250[_0x0e64('0x37')],_0x5ac250[_0x0e64('0x38')]);_0x1d73d9[_0x0e64('0x3b')]=_[_0x0e64('0x3a')](_0x5ac250['model'],qs['fields'](_0x405372[_0x0e64('0x38')]['fields']));_0x1d73d9[_0x0e64('0x3b')]=_0x1d73d9[_0x0e64('0x3b')][_0x0e64('0x4c')]?_0x1d73d9['attributes']:_0x5ac250[_0x0e64('0x37')];if(!_0x405372['query']['hasOwnProperty'](_0x0e64('0x3d'))){_0x1d73d9['limit']=qs[_0x0e64('0x23')](_0x405372['query']['limit']);_0x1d73d9['offset']=qs[_0x0e64('0x22')](_0x405372['query'][_0x0e64('0x22')]);}_0x1d73d9[_0x0e64('0x3e')]=qs[_0x0e64('0x3f')](_0x405372['query'][_0x0e64('0x3f')]);_0x1d73d9[_0x0e64('0x40')]=qs['filters'](_['pick'](_0x405372[_0x0e64('0x38')],_0x5ac250['filters']));if(_0x405372[_0x0e64('0x38')][_0x0e64('0x41')]){_0x1d73d9[_0x0e64('0x40')]=_[_0x0e64('0x42')](_0x1d73d9['where'],{'$or':_[_0x0e64('0x31')](_0x1d73d9[_0x0e64('0x3b')],function(_0x126c01){var _0x38b6ab={};_0x38b6ab[_0x126c01]={'$like':'%'+_0x405372[_0x0e64('0x38')]['filter']+'%'};return _0x38b6ab;})});}_0x1d73d9=_[_0x0e64('0x42')]({},_0x1d73d9,_0x405372[_0x0e64('0x44')]);var _0x492573={'where':_0x1d73d9[_0x0e64('0x40')]};return db[_0x0e64('0x32')][_0x0e64('0x25')](_0x492573)[_0x0e64('0x2b')](function(_0x2b45a2){_0x25bd90[_0x0e64('0x25')]=_0x2b45a2;if(_0x405372[_0x0e64('0x38')]['includeAll']){_0x1d73d9[_0x0e64('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x0e64('0x51')](_0x1d73d9);})[_0x0e64('0x2b')](function(_0x367097){_0x25bd90[_0x0e64('0x47')]=_0x367097;return _0x25bd90;})[_0x0e64('0x2b')](respondWithFilteredResult(_0x5b912f,_0x1d73d9,_0x0e64('0x52')))[_0x0e64('0x48')](handleError(_0x5b912f,null,_0x0e64('0x52')));};
\ No newline at end of file
+var _0x92bb=['filter','merge','options','includeAll','include','rows','catch','show','keys','find','create','body','params','describe','findAll','getVoiceQueuesReport','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL'];(function(_0x4672f6,_0x3f3c9c){var _0x1508e7=function(_0x12d9a7){while(--_0x12d9a7){_0x4672f6['push'](_0x4672f6['shift']());}};_0x1508e7(++_0x3f3c9c);}(_0x92bb,0x19b));var _0xb92b=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x92bb[_0x2ac5f8];return _0x3b8229;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb92b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb92b('0x1'));var rp=require(_0xb92b('0x2'));var moment=require(_0xb92b('0x3'));var BPromise=require(_0xb92b('0x4'));var Mustache=require(_0xb92b('0x5'));var util=require(_0xb92b('0x6'));var path=require(_0xb92b('0x7'));var sox=require(_0xb92b('0x8'));var csv=require('to-csv');var ejs=require(_0xb92b('0x9'));var fs=require('fs');var fs_extra=require(_0xb92b('0xa'));var _=require(_0xb92b('0xb'));var squel=require(_0xb92b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb92b('0xd'));var querystring=require(_0xb92b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb92b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb92b('0x10'));var hardwareService=require(_0xb92b('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb92b('0x12'));var licenseUtil=require(_0xb92b('0x13'));var db=require(_0xb92b('0x14'))['db'];config['redis']=_[_0xb92b('0x15')](config['redis'],{'host':_0xb92b('0x16'),'port':0x18eb});var socket=require(_0xb92b('0x17'))(new Redis(config[_0xb92b('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0xafae55,_0x2a5367){_0x2a5367=_0x2a5367||0xcc;return function(_0x32159c){if(_0x32159c){return _0xafae55['sendStatus'](_0x2a5367);}return _0xafae55[_0xb92b('0x19')](_0x2a5367)['end']();};}function respondWithResult(_0x521880,_0x5aa536){_0x5aa536=_0x5aa536||0xc8;return function(_0x25d58c){if(_0x25d58c){return _0x521880[_0xb92b('0x19')](_0x5aa536)[_0xb92b('0x1a')](_0x25d58c);}};}function respondWithFilteredResult(_0x5074ad,_0x55fca1){return function(_0x595a72){if(_0x595a72){var _0x210f03=typeof _0x55fca1[_0xb92b('0x1b')]==='undefined'&&typeof _0x55fca1[_0xb92b('0x1c')]===_0xb92b('0x1d');var _0x2a8fb2=_0x595a72[_0xb92b('0x1e')];var _0x39a1d7=_0x210f03?0x0:_0x55fca1[_0xb92b('0x1b')];var _0x4f32fb=_0x210f03?_0x595a72['count']:_0x55fca1[_0xb92b('0x1b')]+_0x55fca1[_0xb92b('0x1c')];var _0x3a47ad;if(_0x4f32fb>=_0x2a8fb2){_0x4f32fb=_0x2a8fb2;_0x3a47ad=0xc8;}else{_0x3a47ad=0xce;}_0x5074ad[_0xb92b('0x19')](_0x3a47ad);return _0x5074ad[_0xb92b('0x1f')](_0xb92b('0x20'),_0x39a1d7+'-'+_0x4f32fb+'/'+_0x2a8fb2)[_0xb92b('0x1a')](_0x595a72);}return null;};}function patchUpdates(_0x35a2f2){return function(_0x20ce7c){try{jsonpatch[_0xb92b('0x21')](_0x20ce7c,_0x35a2f2,!![]);}catch(_0x10766e){return BPromise['reject'](_0x10766e);}return _0x20ce7c[_0xb92b('0x22')]();};}function saveUpdates(_0x135259,_0x3265cd){return function(_0x51f429){if(_0x51f429){return _0x51f429[_0xb92b('0x23')](_0x135259)[_0xb92b('0x24')](function(_0x46f721){return _0x46f721;});}return null;};}function removeEntity(_0x32823d,_0x4d9778){return function(_0x106b1d){if(_0x106b1d){return _0x106b1d[_0xb92b('0x25')]()[_0xb92b('0x24')](function(){_0x32823d[_0xb92b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d119a,_0x3d5ed1){return function(_0x2d1cff){if(!_0x2d1cff){_0x9d119a[_0xb92b('0x26')](0x194);}return _0x2d1cff;};}function handleError(_0x543db9,_0x5ea51f){_0x5ea51f=_0x5ea51f||0x1f4;return function(_0x1e74f5){logger[_0xb92b('0x27')](_0x1e74f5[_0xb92b('0x28')]);if(_0x1e74f5['name']){delete _0x1e74f5[_0xb92b('0x29')];}_0x543db9[_0xb92b('0x19')](_0x5ea51f)[_0xb92b('0x2a')](_0x1e74f5);};}exports[_0xb92b('0x2b')]=function(_0x490aff,_0x2b60ae){var _0x319a23={},_0x1dada2={},_0x2e163f={'count':0x0,'rows':[]};var _0x2a39a0=_[_0xb92b('0x2c')](db[_0xb92b('0x2d')][_0xb92b('0x2e')],function(_0x3e72ef){return{'name':_0x3e72ef[_0xb92b('0x2f')],'type':_0x3e72ef['type'][_0xb92b('0x30')]};});_0x1dada2[_0xb92b('0x31')]=_['map'](_0x2a39a0,_0xb92b('0x29'));_0x1dada2[_0xb92b('0x32')]=_['keys'](_0x490aff['query']);_0x1dada2['filters']=_[_0xb92b('0x33')](_0x1dada2[_0xb92b('0x31')],_0x1dada2[_0xb92b('0x32')]);_0x319a23[_0xb92b('0x34')]=_[_0xb92b('0x33')](_0x1dada2[_0xb92b('0x31')],qs['fields'](_0x490aff[_0xb92b('0x32')][_0xb92b('0x35')]));_0x319a23[_0xb92b('0x34')]=_0x319a23[_0xb92b('0x34')][_0xb92b('0x36')]?_0x319a23[_0xb92b('0x34')]:_0x1dada2[_0xb92b('0x31')];if(!_0x490aff[_0xb92b('0x32')][_0xb92b('0x37')](_0xb92b('0x38'))){_0x319a23['limit']=qs['limit'](_0x490aff['query'][_0xb92b('0x1c')]);_0x319a23[_0xb92b('0x1b')]=qs[_0xb92b('0x1b')](_0x490aff[_0xb92b('0x32')]['offset']);}_0x319a23[_0xb92b('0x39')]=qs['sort'](_0x490aff[_0xb92b('0x32')][_0xb92b('0x3a')]);_0x319a23[_0xb92b('0x3b')]=qs[_0xb92b('0x3c')](_[_0xb92b('0x3d')](_0x490aff[_0xb92b('0x32')],_0x1dada2[_0xb92b('0x3c')]),_0x2a39a0);if(_0x490aff['query']['filter']){_0x319a23[_0xb92b('0x3b')]=_['merge'](_0x319a23[_0xb92b('0x3b')],{'$or':_[_0xb92b('0x2c')](_0x2a39a0,function(_0x3f14e4){if(_0x3f14e4['type']!==_0xb92b('0x3e')){var _0x7659bd={};_0x7659bd[_0x3f14e4[_0xb92b('0x29')]]={'$like':'%'+_0x490aff[_0xb92b('0x32')][_0xb92b('0x3f')]+'%'};return _0x7659bd;}})});}_0x319a23=_[_0xb92b('0x40')]({},_0x319a23,_0x490aff[_0xb92b('0x41')]);var _0x32b9da={'where':_0x319a23[_0xb92b('0x3b')]};return db[_0xb92b('0x2d')]['count'](_0x32b9da)[_0xb92b('0x24')](function(_0x55a483){_0x2e163f['count']=_0x55a483;if(_0x490aff[_0xb92b('0x32')][_0xb92b('0x42')]){_0x319a23[_0xb92b('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x319a23);})[_0xb92b('0x24')](function(_0x115581){_0x2e163f[_0xb92b('0x44')]=_0x115581;return _0x2e163f;})[_0xb92b('0x24')](respondWithFilteredResult(_0x2b60ae,_0x319a23))[_0xb92b('0x45')](handleError(_0x2b60ae,null));};exports[_0xb92b('0x46')]=function(_0x224c11,_0x2211b2){var _0x3ecef6={'raw':![],'where':{'id':_0x224c11['params']['id']}},_0x3c182b={};_0x3c182b[_0xb92b('0x31')]=_['keys'](db['VoiceQueueReport'][_0xb92b('0x2e')]);_0x3c182b[_0xb92b('0x32')]=_[_0xb92b('0x47')](_0x224c11['query']);_0x3c182b[_0xb92b('0x3c')]=_['intersection'](_0x3c182b[_0xb92b('0x31')],_0x3c182b[_0xb92b('0x32')]);_0x3ecef6[_0xb92b('0x34')]=_[_0xb92b('0x33')](_0x3c182b[_0xb92b('0x31')],qs['fields'](_0x224c11[_0xb92b('0x32')][_0xb92b('0x35')]));_0x3ecef6['attributes']=_0x3ecef6[_0xb92b('0x34')]['length']?_0x3ecef6['attributes']:_0x3c182b[_0xb92b('0x31')];if(_0x224c11[_0xb92b('0x32')][_0xb92b('0x42')]){_0x3ecef6[_0xb92b('0x43')]=[{'all':!![]}];}_0x3ecef6=_['merge']({},_0x3ecef6,_0x224c11['options']);return db[_0xb92b('0x2d')][_0xb92b('0x48')](_0x3ecef6)[_0xb92b('0x24')](handleEntityNotFound(_0x2211b2,null))['then'](respondWithResult(_0x2211b2,null))[_0xb92b('0x45')](handleError(_0x2211b2,null));};exports[_0xb92b('0x49')]=function(_0x36b799,_0x1a0bf5){return db[_0xb92b('0x2d')][_0xb92b('0x49')](_0x36b799[_0xb92b('0x4a')],{})[_0xb92b('0x24')](respondWithResult(_0x1a0bf5,0xc9))[_0xb92b('0x45')](handleError(_0x1a0bf5,null));};exports[_0xb92b('0x23')]=function(_0x49ea12,_0x18ca5b){if(_0x49ea12['body']['id']){delete _0x49ea12['body']['id'];}return db[_0xb92b('0x2d')][_0xb92b('0x48')]({'where':{'id':_0x49ea12[_0xb92b('0x4b')]['id']}})[_0xb92b('0x24')](handleEntityNotFound(_0x18ca5b,null))['then'](saveUpdates(_0x49ea12['body'],null))['then'](respondWithResult(_0x18ca5b,null))[_0xb92b('0x45')](handleError(_0x18ca5b,null));};exports['destroy']=function(_0x188017,_0x598311){return db[_0xb92b('0x2d')][_0xb92b('0x48')]({'where':{'id':_0x188017[_0xb92b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x598311,null))[_0xb92b('0x24')](removeEntity(_0x598311,null))[_0xb92b('0x45')](handleError(_0x598311,null));};exports[_0xb92b('0x4c')]=function(_0x5f5d97,_0x58f70e){return db[_0xb92b('0x2d')]['describe']()[_0xb92b('0x24')](respondWithResult(_0x58f70e,null))['catch'](handleError(_0x58f70e,null));};exports['getVoiceQueuesReport']=function(_0x4f248a,_0x2d6203){var _0x2a6be0={},_0x3a21d5={},_0x1f825d={'count':0x0,'rows':[]};_0x3a21d5[_0xb92b('0x31')]=_['keys'](db[_0xb92b('0x2d')][_0xb92b('0x2e')]);_0x3a21d5[_0xb92b('0x32')]=_[_0xb92b('0x47')](_0x4f248a[_0xb92b('0x32')]);_0x3a21d5[_0xb92b('0x3c')]=_[_0xb92b('0x33')](_0x3a21d5[_0xb92b('0x31')],_0x3a21d5[_0xb92b('0x32')]);_0x2a6be0['attributes']=_[_0xb92b('0x33')](_0x3a21d5['model'],qs[_0xb92b('0x35')](_0x4f248a['query']['fields']));_0x2a6be0[_0xb92b('0x34')]=_0x2a6be0[_0xb92b('0x34')]['length']?_0x2a6be0[_0xb92b('0x34')]:_0x3a21d5[_0xb92b('0x31')];if(!_0x4f248a['query'][_0xb92b('0x37')](_0xb92b('0x38'))){_0x2a6be0[_0xb92b('0x1c')]=qs[_0xb92b('0x1c')](_0x4f248a[_0xb92b('0x32')]['limit']);_0x2a6be0['offset']=qs[_0xb92b('0x1b')](_0x4f248a[_0xb92b('0x32')][_0xb92b('0x1b')]);}_0x2a6be0[_0xb92b('0x39')]=qs[_0xb92b('0x3a')](_0x4f248a[_0xb92b('0x32')][_0xb92b('0x3a')]);_0x2a6be0[_0xb92b('0x3b')]=qs[_0xb92b('0x3c')](_[_0xb92b('0x3d')](_0x4f248a['query'],_0x3a21d5[_0xb92b('0x3c')]));if(_0x4f248a[_0xb92b('0x32')]['filter']){_0x2a6be0[_0xb92b('0x3b')]=_['merge'](_0x2a6be0['where'],{'$or':_[_0xb92b('0x2c')](_0x2a6be0[_0xb92b('0x34')],function(_0x2eb490){var _0x5029e0={};_0x5029e0[_0x2eb490]={'$like':'%'+_0x4f248a[_0xb92b('0x32')][_0xb92b('0x3f')]+'%'};return _0x5029e0;})});}_0x2a6be0=_[_0xb92b('0x40')]({},_0x2a6be0,_0x4f248a[_0xb92b('0x41')]);var _0x513c08={'where':_0x2a6be0[_0xb92b('0x3b')]};return db['VoiceQueueReport'][_0xb92b('0x1e')](_0x513c08)[_0xb92b('0x24')](function(_0x414849){_0x1f825d[_0xb92b('0x1e')]=_0x414849;if(_0x4f248a[_0xb92b('0x32')][_0xb92b('0x42')]){_0x2a6be0['include']=[{'all':!![]}];}return db[_0xb92b('0x2d')][_0xb92b('0x4d')](_0x2a6be0);})['then'](function(_0x1f6814){_0x1f825d[_0xb92b('0x44')]=_0x1f6814;return _0x1f825d;})[_0xb92b('0x24')](respondWithFilteredResult(_0x2d6203,_0x2a6be0,_0xb92b('0x4e')))[_0xb92b('0x45')](handleError(_0x2d6203,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index a3d72b9..e5d1814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0580=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0580,0x1af));var _0x0058=function(_0x2d43a8,_0x4d379c){_0x2d43a8=_0x2d43a8-0x0;var _0x22a5ee=_0x0580[_0x2d43a8];return _0x22a5ee;};'use strict';var EventEmitter=require(_0x0058('0x0'));var VoiceQueueReport=require(_0x0058('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0058('0x2')](0x0);var events={'afterCreate':_0x0058('0x3'),'afterUpdate':_0x0058('0x4'),'afterDestroy':_0x0058('0x5')};function emitEvent(_0x145bfc){return function(_0x2c5bbf,_0x455cba,_0x54da7b){VoiceQueueReportEvents[_0x0058('0x6')](_0x145bfc+':'+_0x2c5bbf['id'],_0x2c5bbf);VoiceQueueReportEvents[_0x0058('0x6')](_0x145bfc,_0x2c5bbf);_0x54da7b(null);};}for(var e in events){if(events[_0x0058('0x7')](e)){var event=events[e];VoiceQueueReport[_0x0058('0x8')](e,emitEvent(event));}}module[_0x0058('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xac95=['emit','hasOwnProperty','events','VoiceQueueReport','setMaxListeners','save','remove'];(function(_0x5e275c,_0x49d109){var _0x6cd0d=function(_0xdf067d){while(--_0xdf067d){_0x5e275c['push'](_0x5e275c['shift']());}};_0x6cd0d(++_0x49d109);}(_0xac95,0x121));var _0x5ac9=function(_0x5c0781,_0x47dc51){_0x5c0781=_0x5c0781-0x0;var _0x13bdd5=_0xac95[_0x5c0781];return _0x13bdd5;};'use strict';var EventEmitter=require(_0x5ac9('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x5ac9('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5ac9('0x2')](0x0);var events={'afterCreate':_0x5ac9('0x3'),'afterUpdate':'update','afterDestroy':_0x5ac9('0x4')};function emitEvent(_0x4a3957){return function(_0x53d21c,_0x58316c,_0x429cd5){VoiceQueueReportEvents[_0x5ac9('0x5')](_0x4a3957+':'+_0x53d21c['id'],_0x53d21c);VoiceQueueReportEvents['emit'](_0x4a3957,_0x53d21c);_0x429cd5(null);};}for(var e in events){if(events[_0x5ac9('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index 3971373..9a0e378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb029=['request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a6704,_0x2a8683){var _0x487fcc=function(_0x328306){while(--_0x328306){_0x4a6704['push'](_0x4a6704['shift']());}};_0x487fcc(++_0x2a8683);}(_0xb029,0x120));var _0x9b02=function(_0x327530,_0x38fa4e){_0x327530=_0x327530-0x0;var _0x469631=_0xb029[_0x327530];return _0x469631;};'use strict';var _=require(_0x9b02('0x0'));var util=require(_0x9b02('0x1'));var logger=require(_0x9b02('0x2'))(_0x9b02('0x3'));var moment=require(_0x9b02('0x4'));var BPromise=require(_0x9b02('0x5'));var rp=require(_0x9b02('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b02('0x7'));var config=require(_0x9b02('0x8'));var attributes=require(_0x9b02('0x9'));module[_0x9b02('0xa')]=function(_0x5ba990,_0x4342d2){return _0x5ba990[_0x9b02('0xb')](_0x9b02('0xc'),attributes,{'tableName':_0x9b02('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4c9=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x186797,_0x44ff12){var _0x54da2a=function(_0x56c6e6){while(--_0x56c6e6){_0x186797['push'](_0x186797['shift']());}};_0x54da2a(++_0x44ff12);}(_0xc4c9,0xad));var _0x9c4c=function(_0x13f691,_0x32ddcc){_0x13f691=_0x13f691-0x0;var _0x1d5852=_0xc4c9[_0x13f691];return _0x1d5852;};'use strict';var _=require(_0x9c4c('0x0'));var util=require(_0x9c4c('0x1'));var logger=require(_0x9c4c('0x2'))(_0x9c4c('0x3'));var moment=require(_0x9c4c('0x4'));var BPromise=require(_0x9c4c('0x5'));var rp=require(_0x9c4c('0x6'));var fs=require('fs');var path=require(_0x9c4c('0x7'));var rimraf=require(_0x9c4c('0x8'));var config=require(_0x9c4c('0x9'));var attributes=require(_0x9c4c('0xa'));module[_0x9c4c('0xb')]=function(_0x1aa12c,_0xcf07a3){return _0x1aa12c['define'](_0x9c4c('0xc'),attributes,{'tableName':_0x9c4c('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x9c4c('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index bc4466b..25eb60f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2926=['attributes','limit','map','include','model','GetVoiceQueueReport','create','body','raw','CreateVoiceQueueReport','stringify','UpdateVoiceQueueReport','update','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','VoiceQueueReport','findAll','options'];(function(_0x3333b6,_0x577657){var _0x433d48=function(_0x32afd8){while(--_0x32afd8){_0x3333b6['push'](_0x3333b6['shift']());}};_0x433d48(++_0x577657);}(_0x2926,0xea));var _0x6292=function(_0x5ac4b6,_0x4d9360){_0x5ac4b6=_0x5ac4b6-0x0;var _0x29ced8=_0x2926[_0x5ac4b6];return _0x29ced8;};'use strict';var _=require('lodash');var util=require(_0x6292('0x0'));var moment=require(_0x6292('0x1'));var BPromise=require('bluebird');var rs=require(_0x6292('0x2'));var fs=require('fs');var Redis=require(_0x6292('0x3'));var db=require(_0x6292('0x4'))['db'];var utils=require(_0x6292('0x5'));var logger=require(_0x6292('0x6'))(_0x6292('0x7'));var config=require(_0x6292('0x8'));var jayson=require(_0x6292('0x9'));var client=jayson[_0x6292('0xa')][_0x6292('0xb')]({'port':0x232a});config[_0x6292('0xc')]=_['defaults'](config['redis'],{'host':_0x6292('0xd'),'port':0x18eb});var socket=require(_0x6292('0xe'))(new Redis(config[_0x6292('0xc')]));require(_0x6292('0xf'))[_0x6292('0x10')](socket);function respondWithRpcPromise(_0x4df3b3,_0x24f522,_0x43569e){return new BPromise(function(_0x133b52,_0x473354){return client[_0x6292('0x11')](_0x4df3b3,_0x43569e)[_0x6292('0x12')](function(_0x360329){logger[_0x6292('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x24f522,_0x6292('0x14'));logger[_0x6292('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x24f522,_0x6292('0x14'),JSON['stringify'](_0x360329));if(_0x360329['error']){if(_0x360329[_0x6292('0x16')]['code']===0x1f4){logger['error'](_0x6292('0x17'),_0x24f522,_0x360329['error'][_0x6292('0x18')]);return _0x473354(_0x360329[_0x6292('0x16')]['message']);}logger[_0x6292('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x24f522,_0x360329[_0x6292('0x16')][_0x6292('0x18')]);return _0x133b52(_0x360329[_0x6292('0x16')][_0x6292('0x18')]);}else{logger['info'](_0x6292('0x17'),_0x24f522,_0x6292('0x14'));_0x133b52(_0x360329[_0x6292('0x19')]['message']);}})[_0x6292('0x1a')](function(_0x4025fd){logger[_0x6292('0x16')](_0x6292('0x17'),_0x24f522,_0x4025fd);_0x473354(_0x4025fd);});});}exports['GetVoiceQueueReport']=function(_0x4e90e7){var _0x7facdc=this;return new Promise(function(_0x30d559,_0x16e9be){return db[_0x6292('0x1b')][_0x6292('0x1c')]({'raw':_0x4e90e7['options']?_0x4e90e7[_0x6292('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4e90e7[_0x6292('0x1d')]?_0x4e90e7[_0x6292('0x1d')]['where']||null:null,'attributes':_0x4e90e7[_0x6292('0x1d')]?_0x4e90e7['options'][_0x6292('0x1e')]||null:null,'limit':_0x4e90e7[_0x6292('0x1d')]?_0x4e90e7[_0x6292('0x1d')][_0x6292('0x1f')]||null:null,'include':_0x4e90e7[_0x6292('0x1d')]?_0x4e90e7[_0x6292('0x1d')]['include']?_[_0x6292('0x20')](_0x4e90e7[_0x6292('0x1d')][_0x6292('0x21')],function(_0x41ea05){return{'model':db[_0x41ea05[_0x6292('0x22')]],'as':_0x41ea05['as'],'attributes':_0x41ea05[_0x6292('0x1e')],'include':_0x41ea05[_0x6292('0x21')]?_[_0x6292('0x20')](_0x41ea05[_0x6292('0x21')],function(_0x3025f6){return{'model':db[_0x3025f6[_0x6292('0x22')]],'as':_0x3025f6['as'],'attributes':_0x3025f6['attributes'],'include':_0x3025f6[_0x6292('0x21')]?_[_0x6292('0x20')](_0x3025f6[_0x6292('0x21')],function(_0x535cc8){return{'model':db[_0x535cc8[_0x6292('0x22')]],'as':_0x535cc8['as'],'attributes':_0x535cc8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6292('0x12')](function(_0x59b90f){logger[_0x6292('0x13')]('GetVoiceQueueReport',_0x4e90e7);logger[_0x6292('0x15')](_0x6292('0x23'),_0x4e90e7,JSON['stringify'](_0x59b90f));_0x30d559(_0x59b90f);})[_0x6292('0x1a')](function(_0x4785bc){logger[_0x6292('0x16')](_0x6292('0x23'),_0x4785bc['message'],_0x4e90e7);_0x16e9be(_0x7facdc[_0x6292('0x16')](0x1f4,_0x4785bc[_0x6292('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x952126){var _0x367b1b=this;return new Promise(function(_0x5744b8,_0x30b45b){return db[_0x6292('0x1b')][_0x6292('0x24')](_0x952126[_0x6292('0x25')],{'raw':_0x952126[_0x6292('0x1d')]?_0x952126[_0x6292('0x1d')][_0x6292('0x26')]===undefined?!![]:![]:!![]})[_0x6292('0x12')](function(_0x534951){logger[_0x6292('0x13')](_0x6292('0x27'),_0x952126);logger[_0x6292('0x15')]('CreateVoiceQueueReport',_0x952126,JSON[_0x6292('0x28')](_0x534951));_0x5744b8(_0x534951);})['catch'](function(_0x581a60){logger['error']('CreateVoiceQueueReport',_0x581a60[_0x6292('0x18')],_0x952126);_0x30b45b(_0x367b1b['error'](0x1f4,_0x581a60[_0x6292('0x18')]));});});};exports[_0x6292('0x29')]=function(_0x7448fb){var _0x15f774=this;return new Promise(function(_0x39373e,_0x1805f2){return db[_0x6292('0x1b')][_0x6292('0x2a')](_0x7448fb[_0x6292('0x25')],{'raw':_0x7448fb[_0x6292('0x1d')]?_0x7448fb[_0x6292('0x1d')][_0x6292('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7448fb[_0x6292('0x1d')]?_0x7448fb[_0x6292('0x1d')][_0x6292('0x2b')]||null:null,'attributes':_0x7448fb[_0x6292('0x1d')]?_0x7448fb[_0x6292('0x1d')][_0x6292('0x1e')]||null:null,'limit':_0x7448fb['options']?_0x7448fb['options'][_0x6292('0x1f')]||null:null})['then'](function(_0x1ab833){logger['info']('UpdateVoiceQueueReport',_0x7448fb);logger[_0x6292('0x15')](_0x6292('0x29'),_0x7448fb,JSON[_0x6292('0x28')](_0x1ab833));_0x39373e(_0x1ab833);})[_0x6292('0x1a')](function(_0x4cd174){logger[_0x6292('0x16')](_0x6292('0x29'),_0x4cd174[_0x6292('0x18')],_0x7448fb);_0x1805f2(_0x15f774[_0x6292('0x16')](0x1f4,_0x4cd174['message']));});});};
\ No newline at end of file
+var _0x3b0c=['redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','catch','CreateVoiceQueueReport','VoiceQueueReport','create','body','update','where','UpdateVoiceQueueReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x3b0c,0x181));var _0xc3b0=function(_0x400f81,_0x11fc2b){_0x400f81=_0x400f81-0x0;var _0x28b989=_0x3b0c[_0x400f81];return _0x28b989;};'use strict';var _=require(_0xc3b0('0x0'));var util=require('util');var moment=require(_0xc3b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xc3b0('0x2'));var fs=require('fs');var Redis=require(_0xc3b0('0x3'));var db=require(_0xc3b0('0x4'))['db'];var utils=require(_0xc3b0('0x5'));var logger=require(_0xc3b0('0x6'))(_0xc3b0('0x7'));var config=require(_0xc3b0('0x8'));var jayson=require(_0xc3b0('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc3b0('0xa')](config[_0xc3b0('0xb')],{'host':_0xc3b0('0xc'),'port':0x18eb});var socket=require(_0xc3b0('0xd'))(new Redis(config[_0xc3b0('0xb')]));require(_0xc3b0('0xe'))['register'](socket);function respondWithRpcPromise(_0x571ef9,_0x101349,_0x32d8b0){return new BPromise(function(_0x14ce87,_0x4eab38){return client[_0xc3b0('0xf')](_0x571ef9,_0x32d8b0)[_0xc3b0('0x10')](function(_0x5b0564){logger[_0xc3b0('0x11')](_0xc3b0('0x12'),_0x101349,_0xc3b0('0x13'));logger[_0xc3b0('0x14')](_0xc3b0('0x15'),_0x101349,_0xc3b0('0x13'),JSON[_0xc3b0('0x16')](_0x5b0564));if(_0x5b0564[_0xc3b0('0x17')]){if(_0x5b0564['error'][_0xc3b0('0x18')]===0x1f4){logger[_0xc3b0('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x101349,_0x5b0564['error'][_0xc3b0('0x19')]);return _0x4eab38(_0x5b0564[_0xc3b0('0x17')][_0xc3b0('0x19')]);}logger[_0xc3b0('0x17')](_0xc3b0('0x12'),_0x101349,_0x5b0564[_0xc3b0('0x17')][_0xc3b0('0x19')]);return _0x14ce87(_0x5b0564[_0xc3b0('0x17')]['message']);}else{logger[_0xc3b0('0x11')](_0xc3b0('0x12'),_0x101349,_0xc3b0('0x13'));_0x14ce87(_0x5b0564[_0xc3b0('0x1a')]['message']);}})['catch'](function(_0x36770){logger['error'](_0xc3b0('0x12'),_0x101349,_0x36770);_0x4eab38(_0x36770);});});}exports[_0xc3b0('0x1b')]=function(_0x5ce3a0){var _0x3e8f9e=this;return new Promise(function(_0x3d441d,_0x55c767){return db['VoiceQueueReport'][_0xc3b0('0x1c')]({'raw':_0x5ce3a0[_0xc3b0('0x1d')]?_0x5ce3a0['options'][_0xc3b0('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ce3a0[_0xc3b0('0x1d')]?_0x5ce3a0[_0xc3b0('0x1d')]['where']||null:null,'attributes':_0x5ce3a0['options']?_0x5ce3a0['options'][_0xc3b0('0x1f')]||null:null,'limit':_0x5ce3a0['options']?_0x5ce3a0[_0xc3b0('0x1d')][_0xc3b0('0x20')]||null:null,'include':_0x5ce3a0[_0xc3b0('0x1d')]?_0x5ce3a0['options'][_0xc3b0('0x21')]?_['map'](_0x5ce3a0[_0xc3b0('0x1d')][_0xc3b0('0x21')],function(_0x212422){return{'model':db[_0x212422[_0xc3b0('0x22')]],'as':_0x212422['as'],'attributes':_0x212422[_0xc3b0('0x1f')],'include':_0x212422['include']?_[_0xc3b0('0x23')](_0x212422['include'],function(_0x1faf0b){return{'model':db[_0x1faf0b[_0xc3b0('0x22')]],'as':_0x1faf0b['as'],'attributes':_0x1faf0b['attributes'],'include':_0x1faf0b['include']?_['map'](_0x1faf0b[_0xc3b0('0x21')],function(_0x48d2e1){return{'model':db[_0x48d2e1['model']],'as':_0x48d2e1['as'],'attributes':_0x48d2e1[_0xc3b0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc3b0('0x10')](function(_0x5d248c){logger[_0xc3b0('0x11')](_0xc3b0('0x1b'),_0x5ce3a0);logger['debug'](_0xc3b0('0x1b'),_0x5ce3a0,JSON[_0xc3b0('0x16')](_0x5d248c));_0x3d441d(_0x5d248c);})[_0xc3b0('0x24')](function(_0x5bc699){logger[_0xc3b0('0x17')](_0xc3b0('0x1b'),_0x5bc699['message'],_0x5ce3a0);_0x55c767(_0x3e8f9e[_0xc3b0('0x17')](0x1f4,_0x5bc699[_0xc3b0('0x19')]));});});};exports[_0xc3b0('0x25')]=function(_0x43db6c){var _0x52fd48=this;return new Promise(function(_0x1b114b,_0xb6c116){return db[_0xc3b0('0x26')][_0xc3b0('0x27')](_0x43db6c[_0xc3b0('0x28')],{'raw':_0x43db6c[_0xc3b0('0x1d')]?_0x43db6c[_0xc3b0('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xc3b0('0x10')](function(_0x4ba546){logger['info'](_0xc3b0('0x25'),_0x43db6c);logger['debug'](_0xc3b0('0x25'),_0x43db6c,JSON[_0xc3b0('0x16')](_0x4ba546));_0x1b114b(_0x4ba546);})['catch'](function(_0x402348){logger[_0xc3b0('0x17')](_0xc3b0('0x25'),_0x402348['message'],_0x43db6c);_0xb6c116(_0x52fd48[_0xc3b0('0x17')](0x1f4,_0x402348['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x306b5f){var _0x4dda36=this;return new Promise(function(_0x2fa9da,_0x4f86c2){return db[_0xc3b0('0x26')][_0xc3b0('0x29')](_0x306b5f[_0xc3b0('0x28')],{'raw':_0x306b5f['options']?_0x306b5f[_0xc3b0('0x1d')][_0xc3b0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306b5f[_0xc3b0('0x1d')]?_0x306b5f[_0xc3b0('0x1d')][_0xc3b0('0x2a')]||null:null,'attributes':_0x306b5f[_0xc3b0('0x1d')]?_0x306b5f['options'][_0xc3b0('0x1f')]||null:null,'limit':_0x306b5f[_0xc3b0('0x1d')]?_0x306b5f[_0xc3b0('0x1d')][_0xc3b0('0x20')]||null:null})[_0xc3b0('0x10')](function(_0x608e1e){logger[_0xc3b0('0x11')]('UpdateVoiceQueueReport',_0x306b5f);logger[_0xc3b0('0x14')](_0xc3b0('0x2b'),_0x306b5f,JSON[_0xc3b0('0x16')](_0x608e1e));_0x2fa9da(_0x608e1e);})[_0xc3b0('0x24')](function(_0x94b22d){logger[_0xc3b0('0x17')](_0xc3b0('0x2b'),_0x94b22d[_0xc3b0('0x19')],_0x306b5f);_0x4f86c2(_0x4dda36['error'](0x1f4,_0x94b22d['message']));});});};
\ No newline at end of file
index d24fa4f..779fa87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535d=['./voiceQueueReport.events','save','update','emit','removeListener','register','length','voiceQueueReport:'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x535d,0xe8));var _0xd535=function(_0x52f7b9,_0x40f535){_0x52f7b9=_0x52f7b9-0x0;var _0x509aae=_0x535d[_0x52f7b9];return _0x509aae;};'use strict';var VoiceQueueReportEvents=require(_0xd535('0x0'));var events=[_0xd535('0x1'),'remove',_0xd535('0x2')];function createListener(_0x35ea3d,_0x4c932c){return function(_0x4d7b99){_0x4c932c[_0xd535('0x3')](_0x35ea3d,_0x4d7b99);};}function removeListener(_0x2414de,_0x108ed6){return function(){VoiceQueueReportEvents[_0xd535('0x4')](_0x2414de,_0x108ed6);};}exports[_0xd535('0x5')]=function(_0xa9d48d){for(var _0x4a25fa=0x0,_0x52cbc5=events[_0xd535('0x6')];_0x4a25fa<_0x52cbc5;_0x4a25fa++){var _0x20b2ae=events[_0x4a25fa];var _0x4fba4f=createListener(_0xd535('0x7')+_0x20b2ae,_0xa9d48d);VoiceQueueReportEvents['on'](_0x20b2ae,_0x4fba4f);}};
\ No newline at end of file
+var _0x3981=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x3981,0x144));var _0x1398=function(_0x9e6ff7,_0x174e9a){_0x9e6ff7=_0x9e6ff7-0x0;var _0x311fce=_0x3981[_0x9e6ff7];return _0x311fce;};'use strict';var VoiceQueueReportEvents=require(_0x1398('0x0'));var events=['save',_0x1398('0x1'),_0x1398('0x2')];function createListener(_0x8739be,_0x1be1d9){return function(_0x1d39c3){_0x1be1d9[_0x1398('0x3')](_0x8739be,_0x1d39c3);};}function removeListener(_0x37fb2f,_0x2860af){return function(){VoiceQueueReportEvents[_0x1398('0x4')](_0x37fb2f,_0x2860af);};}exports[_0x1398('0x5')]=function(_0x199a50){for(var _0x5c5fe0=0x0,_0x216064=events[_0x1398('0x6')];_0x5c5fe0<_0x216064;_0x5c5fe0++){var _0x40e860=events[_0x5c5fe0];var _0x51dd7f=createListener(_0x1398('0x7')+_0x40e860,_0x199a50);VoiceQueueReportEvents['on'](_0x40e860,_0x51dd7f);}};
\ No newline at end of file
index 6588041..7bec957 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb1f=['./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2195b5,_0x27faa0){var _0x2ef682=function(_0x2f4f4b){while(--_0x2f4f4b){_0x2195b5['push'](_0x2195b5['shift']());}};_0x2ef682(++_0x27faa0);}(_0xfb1f,0x6a));var _0xffb1=function(_0x1e93bf,_0x4d2552){_0x1e93bf=_0x1e93bf-0x0;var _0x282eaa=_0xfb1f[_0x1e93bf];return _0x282eaa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xffb1('0x0'));var timeout=require(_0xffb1('0x1'));var express=require(_0xffb1('0x2'));var router=express[_0xffb1('0x3')]();var fs_extra=require(_0xffb1('0x4'));var auth=require(_0xffb1('0x5'));var interaction=require(_0xffb1('0x6'));var config=require(_0xffb1('0x7'));var controller=require(_0xffb1('0x8'));router[_0xffb1('0x9')]('/',auth[_0xffb1('0xa')](),controller[_0xffb1('0xb')]);router[_0xffb1('0x9')](_0xffb1('0xc'),auth[_0xffb1('0xa')](),controller['show']);router[_0xffb1('0xd')]('/',auth['isAuthenticated'](),controller[_0xffb1('0xe')]);router[_0xffb1('0xf')](_0xffb1('0xc'),auth[_0xffb1('0xa')](),controller[_0xffb1('0x10')]);router[_0xffb1('0x11')](_0xffb1('0xc'),auth[_0xffb1('0xa')](),controller[_0xffb1('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xe81d=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show'];(function(_0x5b2dc2,_0x59e0ea){var _0x2608e8=function(_0x5c3b2c){while(--_0x5c3b2c){_0x5b2dc2['push'](_0x5b2dc2['shift']());}};_0x2608e8(++_0x59e0ea);}(_0xe81d,0xc4));var _0xde81=function(_0x52a3b7,_0x3d3af2){_0x52a3b7=_0x52a3b7-0x0;var _0x3b848a=_0xe81d[_0x52a3b7];return _0x3b848a;};'use strict';var multer=require(_0xde81('0x0'));var util=require(_0xde81('0x1'));var path=require(_0xde81('0x2'));var timeout=require(_0xde81('0x3'));var express=require(_0xde81('0x4'));var router=express[_0xde81('0x5')]();var fs_extra=require(_0xde81('0x6'));var auth=require(_0xde81('0x7'));var interaction=require(_0xde81('0x8'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0xde81('0x9')]('/',auth[_0xde81('0xa')](),controller['index']);router[_0xde81('0x9')](_0xde81('0xb'),auth[_0xde81('0xa')](),controller[_0xde81('0xc')]);router[_0xde81('0xd')]('/',auth['isAuthenticated'](),controller[_0xde81('0xe')]);router['put'](_0xde81('0xb'),auth[_0xde81('0xa')](),controller[_0xde81('0xf')]);router[_0xde81('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xde81('0x11')]);module[_0xde81('0x12')]=router;
\ No newline at end of file
index 487f2f6..1c9c25b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2d=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa2d,0x11b));var _0xdfa2=function(_0x323a37,_0x55e4a8){_0x323a37=_0x323a37-0x0;var _0x14ed3f=_0xfa2d[_0x323a37];return _0x14ed3f;};'use strict';var Sequelize=require(_0xdfa2('0x0'));var moment=require(_0xdfa2('0x1'));module[_0xdfa2('0x2')]={'time':{'type':Sequelize[_0xdfa2('0x3')]},'callid':{'type':Sequelize[_0xdfa2('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xdfa2('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xdfa2('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xdfa2('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xdfa2('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xdfa2('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xdfa2('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0xdfa2('0x5'))}};
\ No newline at end of file
+var _0x6237=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x4791bb,_0x35de77){var _0x5c95d9=function(_0x206f35){while(--_0x206f35){_0x4791bb['push'](_0x4791bb['shift']());}};_0x5c95d9(++_0x35de77);}(_0x6237,0xc4));var _0x7623=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x6237[_0x470e67];return _0x28bbde;};'use strict';var Sequelize=require(_0x7623('0x0'));var moment=require(_0x7623('0x1'));module[_0x7623('0x2')]={'time':{'type':Sequelize[_0x7623('0x3')]},'callid':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7623('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7623('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x7623('0x5'))}};
\ No newline at end of file
index e86322b..7d5d5af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9378=['stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','includeAll','include','rows','catch','params','options','create','body','find','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','limit','set','apply','save','update','then','end'];(function(_0x95e44d,_0x1a1a5b){var _0x35cd76=function(_0x227ba1){while(--_0x227ba1){_0x95e44d['push'](_0x95e44d['shift']());}};_0x35cd76(++_0x1a1a5b);}(_0x9378,0x6f));var _0x8937=function(_0x3b6c54,_0x57de45){_0x3b6c54=_0x3b6c54-0x0;var _0x4f1222=_0x9378[_0x3b6c54];return _0x4f1222;};'use strict';var emlformat=require(_0x8937('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8937('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8937('0x2'));var moment=require(_0x8937('0x3'));var BPromise=require(_0x8937('0x4'));var Mustache=require(_0x8937('0x5'));var util=require(_0x8937('0x6'));var path=require(_0x8937('0x7'));var sox=require('sox');var csv=require(_0x8937('0x8'));var ejs=require(_0x8937('0x9'));var fs=require('fs');var fs_extra=require(_0x8937('0xa'));var _=require('lodash');var squel=require(_0x8937('0xb'));var crypto=require(_0x8937('0xc'));var jsforce=require(_0x8937('0xd'));var deskjs=require(_0x8937('0xe'));var toCsv=require(_0x8937('0x8'));var querystring=require(_0x8937('0xf'));var Papa=require(_0x8937('0x10'));var Redis=require(_0x8937('0x11'));var authService=require(_0x8937('0x12'));var qs=require(_0x8937('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8937('0x14'));var logger=require(_0x8937('0x15'))(_0x8937('0x16'));var utils=require(_0x8937('0x17'));var config=require(_0x8937('0x18'));var licenseUtil=require(_0x8937('0x19'));var db=require(_0x8937('0x1a'))['db'];function respondWithStatusCode(_0x2add55,_0x2b129d){_0x2b129d=_0x2b129d||0xcc;return function(_0x4106e6){if(_0x4106e6){return _0x2add55[_0x8937('0x1b')](_0x2b129d);}return _0x2add55['status'](_0x2b129d)['end']();};}function respondWithResult(_0x2d1b51,_0xbdaee1){_0xbdaee1=_0xbdaee1||0xc8;return function(_0x4fb7b5){if(_0x4fb7b5){return _0x2d1b51[_0x8937('0x1c')](_0xbdaee1)[_0x8937('0x1d')](_0x4fb7b5);}};}function respondWithFilteredResult(_0x4d14c5,_0x2aa249){return function(_0x42c2bd){if(_0x42c2bd){var _0x104fbf=typeof _0x2aa249['offset']===_0x8937('0x1e')&&typeof _0x2aa249['limit']===_0x8937('0x1e');var _0x40c04b=_0x42c2bd[_0x8937('0x1f')];var _0x54544e=_0x104fbf?0x0:_0x2aa249['offset'];var _0x2ad9e7=_0x104fbf?_0x42c2bd[_0x8937('0x1f')]:_0x2aa249['offset']+_0x2aa249[_0x8937('0x20')];var _0x217b58;if(_0x2ad9e7>=_0x40c04b){_0x2ad9e7=_0x40c04b;_0x217b58=0xc8;}else{_0x217b58=0xce;}_0x4d14c5[_0x8937('0x1c')](_0x217b58);return _0x4d14c5[_0x8937('0x21')]('Content-Range',_0x54544e+'-'+_0x2ad9e7+'/'+_0x40c04b)['json'](_0x42c2bd);}return null;};}function patchUpdates(_0x3e4db3){return function(_0x580d61){try{jsonpatch[_0x8937('0x22')](_0x580d61,_0x3e4db3,!![]);}catch(_0x23fb2f){return BPromise['reject'](_0x23fb2f);}return _0x580d61[_0x8937('0x23')]();};}function saveUpdates(_0x2e6335,_0x526971){return function(_0x3e8ee0){if(_0x3e8ee0){return _0x3e8ee0[_0x8937('0x24')](_0x2e6335)[_0x8937('0x25')](function(_0x239959){return _0x239959;});}return null;};}function removeEntity(_0x265f40,_0x474ced){return function(_0x20b128){if(_0x20b128){return _0x20b128['destroy']()['then'](function(){_0x265f40[_0x8937('0x1c')](0xcc)[_0x8937('0x26')]();});}};}function handleEntityNotFound(_0x30554b,_0x57576d){return function(_0xdee84c){if(!_0xdee84c){_0x30554b[_0x8937('0x1b')](0x194);}return _0xdee84c;};}function handleError(_0x5077dc,_0x2e10d3){_0x2e10d3=_0x2e10d3||0x1f4;return function(_0x26b118){logger['error'](_0x26b118[_0x8937('0x27')]);if(_0x26b118['name']){delete _0x26b118[_0x8937('0x28')];}_0x5077dc['status'](_0x2e10d3)[_0x8937('0x29')](_0x26b118);};}exports[_0x8937('0x2a')]=function(_0x3fa9c8,_0x351a79){var _0x33a66e={},_0x512712={},_0x224963={'count':0x0,'rows':[]};var _0x45c2cf=_[_0x8937('0x2b')](db[_0x8937('0x2c')][_0x8937('0x2d')],function(_0xd733b5){return{'name':_0xd733b5[_0x8937('0x2e')],'type':_0xd733b5[_0x8937('0x2f')][_0x8937('0x30')]};});_0x512712[_0x8937('0x31')]=_[_0x8937('0x2b')](_0x45c2cf,'name');_0x512712[_0x8937('0x32')]=_[_0x8937('0x33')](_0x3fa9c8[_0x8937('0x32')]);_0x512712['filters']=_[_0x8937('0x34')](_0x512712[_0x8937('0x31')],_0x512712[_0x8937('0x32')]);_0x33a66e[_0x8937('0x35')]=_[_0x8937('0x34')](_0x512712['model'],qs[_0x8937('0x36')](_0x3fa9c8[_0x8937('0x32')][_0x8937('0x36')]));_0x33a66e[_0x8937('0x35')]=_0x33a66e[_0x8937('0x35')][_0x8937('0x37')]?_0x33a66e['attributes']:_0x512712['model'];if(!_0x3fa9c8[_0x8937('0x32')][_0x8937('0x38')](_0x8937('0x39'))){_0x33a66e['limit']=qs[_0x8937('0x20')](_0x3fa9c8[_0x8937('0x32')][_0x8937('0x20')]);_0x33a66e[_0x8937('0x3a')]=qs[_0x8937('0x3a')](_0x3fa9c8[_0x8937('0x32')][_0x8937('0x3a')]);}_0x33a66e[_0x8937('0x3b')]=qs['sort'](_0x3fa9c8['query'][_0x8937('0x3c')]);_0x33a66e[_0x8937('0x3d')]=qs[_0x8937('0x3e')](_['pick'](_0x3fa9c8[_0x8937('0x32')],_0x512712['filters']),_0x45c2cf);if(_0x3fa9c8[_0x8937('0x32')][_0x8937('0x3f')]){_0x33a66e[_0x8937('0x3d')]=_[_0x8937('0x40')](_0x33a66e['where'],{'$or':_[_0x8937('0x2b')](_0x45c2cf,function(_0x253175){if(_0x253175[_0x8937('0x2f')]!=='VIRTUAL'){var _0xfa9944={};_0xfa9944[_0x253175['name']]={'$like':'%'+_0x3fa9c8[_0x8937('0x32')][_0x8937('0x3f')]+'%'};return _0xfa9944;}})});}_0x33a66e=_[_0x8937('0x40')]({},_0x33a66e,_0x3fa9c8['options']);var _0xc4f3d0={'where':_0x33a66e[_0x8937('0x3d')]};return db[_0x8937('0x2c')][_0x8937('0x1f')](_0xc4f3d0)[_0x8937('0x25')](function(_0xf5f3ba){_0x224963[_0x8937('0x1f')]=_0xf5f3ba;if(_0x3fa9c8['query'][_0x8937('0x41')]){_0x33a66e[_0x8937('0x42')]=[{'all':!![]}];}return db[_0x8937('0x2c')]['findAll'](_0x33a66e);})[_0x8937('0x25')](function(_0x3af4eb){_0x224963[_0x8937('0x43')]=_0x3af4eb;return _0x224963;})[_0x8937('0x25')](respondWithFilteredResult(_0x351a79,_0x33a66e))[_0x8937('0x44')](handleError(_0x351a79,null));};exports['show']=function(_0xd250a2,_0x15a882){var _0x5a19d1={'raw':!![],'where':{'id':_0xd250a2[_0x8937('0x45')]['id']}},_0xc03103={};_0xc03103[_0x8937('0x31')]=_[_0x8937('0x33')](db[_0x8937('0x2c')]['rawAttributes']);_0xc03103['query']=_[_0x8937('0x33')](_0xd250a2[_0x8937('0x32')]);_0xc03103['filters']=_['intersection'](_0xc03103[_0x8937('0x31')],_0xc03103[_0x8937('0x32')]);_0x5a19d1['attributes']=_[_0x8937('0x34')](_0xc03103[_0x8937('0x31')],qs[_0x8937('0x36')](_0xd250a2['query'][_0x8937('0x36')]));_0x5a19d1[_0x8937('0x35')]=_0x5a19d1[_0x8937('0x35')][_0x8937('0x37')]?_0x5a19d1[_0x8937('0x35')]:_0xc03103[_0x8937('0x31')];if(_0xd250a2['query'][_0x8937('0x41')]){_0x5a19d1[_0x8937('0x42')]=[{'all':!![]}];}_0x5a19d1=_[_0x8937('0x40')]({},_0x5a19d1,_0xd250a2[_0x8937('0x46')]);return db[_0x8937('0x2c')]['find'](_0x5a19d1)[_0x8937('0x25')](handleEntityNotFound(_0x15a882,null))[_0x8937('0x25')](respondWithResult(_0x15a882,null))[_0x8937('0x44')](handleError(_0x15a882,null));};exports[_0x8937('0x47')]=function(_0x5264f3,_0x56d544){return db[_0x8937('0x2c')][_0x8937('0x47')](_0x5264f3[_0x8937('0x48')],{})[_0x8937('0x25')](respondWithResult(_0x56d544,0xc9))['catch'](handleError(_0x56d544,null));};exports[_0x8937('0x24')]=function(_0x387de5,_0x1bd165){if(_0x387de5['body']['id']){delete _0x387de5['body']['id'];}return db[_0x8937('0x2c')][_0x8937('0x49')]({'where':{'id':_0x387de5[_0x8937('0x45')]['id']}})[_0x8937('0x25')](handleEntityNotFound(_0x1bd165,null))[_0x8937('0x25')](saveUpdates(_0x387de5[_0x8937('0x48')],null))[_0x8937('0x25')](respondWithResult(_0x1bd165,null))[_0x8937('0x44')](handleError(_0x1bd165,null));};exports[_0x8937('0x4a')]=function(_0x4ccc01,_0x15dbf3){return db[_0x8937('0x2c')][_0x8937('0x49')]({'where':{'id':_0x4ccc01[_0x8937('0x45')]['id']}})[_0x8937('0x25')](handleEntityNotFound(_0x15dbf3,null))[_0x8937('0x25')](removeEntity(_0x15dbf3,null))['catch'](handleError(_0x15dbf3,null));};
\ No newline at end of file
+var _0x0496=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x32ee0f,_0x5d54e4){var _0x11e9dc=function(_0x4a2fdc){while(--_0x4a2fdc){_0x32ee0f['push'](_0x32ee0f['shift']());}};_0x11e9dc(++_0x5d54e4);}(_0x0496,0x17c));var _0x6049=function(_0x5bfe05,_0x584f5c){_0x5bfe05=_0x5bfe05-0x0;var _0x27b07c=_0x0496[_0x5bfe05];return _0x27b07c;};'use strict';var emlformat=require(_0x6049('0x0'));var rimraf=require(_0x6049('0x1'));var zipdir=require(_0x6049('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6049('0x3'));var moment=require(_0x6049('0x4'));var BPromise=require(_0x6049('0x5'));var Mustache=require(_0x6049('0x6'));var util=require(_0x6049('0x7'));var path=require(_0x6049('0x8'));var sox=require('sox');var csv=require(_0x6049('0x9'));var ejs=require(_0x6049('0xa'));var fs=require('fs');var fs_extra=require(_0x6049('0xb'));var _=require(_0x6049('0xc'));var squel=require(_0x6049('0xd'));var crypto=require(_0x6049('0xe'));var jsforce=require(_0x6049('0xf'));var deskjs=require(_0x6049('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6049('0x11'));var Redis=require(_0x6049('0x12'));var authService=require(_0x6049('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6049('0x14'));var utils=require(_0x6049('0x15'));var config=require(_0x6049('0x16'));var licenseUtil=require(_0x6049('0x17'));var db=require(_0x6049('0x18'))['db'];function respondWithStatusCode(_0x405231,_0x3eec99){_0x3eec99=_0x3eec99||0xcc;return function(_0x145b51){if(_0x145b51){return _0x405231[_0x6049('0x19')](_0x3eec99);}return _0x405231[_0x6049('0x1a')](_0x3eec99)[_0x6049('0x1b')]();};}function respondWithResult(_0x3ccee6,_0xc2f9a6){_0xc2f9a6=_0xc2f9a6||0xc8;return function(_0x1966e0){if(_0x1966e0){return _0x3ccee6['status'](_0xc2f9a6)['json'](_0x1966e0);}};}function respondWithFilteredResult(_0xec759f,_0x4dd1bf){return function(_0x3faa9a){if(_0x3faa9a){var _0x4d69a6=typeof _0x4dd1bf['offset']===_0x6049('0x1c')&&typeof _0x4dd1bf[_0x6049('0x1d')]===_0x6049('0x1c');var _0x2b5d37=_0x3faa9a[_0x6049('0x1e')];var _0x558a64=_0x4d69a6?0x0:_0x4dd1bf[_0x6049('0x1f')];var _0x42e670=_0x4d69a6?_0x3faa9a[_0x6049('0x1e')]:_0x4dd1bf[_0x6049('0x1f')]+_0x4dd1bf[_0x6049('0x1d')];var _0x5aa567;if(_0x42e670>=_0x2b5d37){_0x42e670=_0x2b5d37;_0x5aa567=0xc8;}else{_0x5aa567=0xce;}_0xec759f[_0x6049('0x1a')](_0x5aa567);return _0xec759f[_0x6049('0x20')](_0x6049('0x21'),_0x558a64+'-'+_0x42e670+'/'+_0x2b5d37)[_0x6049('0x22')](_0x3faa9a);}return null;};}function patchUpdates(_0x452e28){return function(_0x46f576){try{jsonpatch['apply'](_0x46f576,_0x452e28,!![]);}catch(_0x592f6b){return BPromise[_0x6049('0x23')](_0x592f6b);}return _0x46f576[_0x6049('0x24')]();};}function saveUpdates(_0x5014f9,_0x3fe504){return function(_0x3ae907){if(_0x3ae907){return _0x3ae907[_0x6049('0x25')](_0x5014f9)['then'](function(_0x822f0e){return _0x822f0e;});}return null;};}function removeEntity(_0x12b843,_0x551aae){return function(_0x153ad5){if(_0x153ad5){return _0x153ad5[_0x6049('0x26')]()['then'](function(){_0x12b843[_0x6049('0x1a')](0xcc)[_0x6049('0x1b')]();});}};}function handleEntityNotFound(_0x121bbc,_0x2165cb){return function(_0x5f3999){if(!_0x5f3999){_0x121bbc[_0x6049('0x19')](0x194);}return _0x5f3999;};}function handleError(_0x204466,_0x2d6363){_0x2d6363=_0x2d6363||0x1f4;return function(_0x1c7b2b){logger[_0x6049('0x27')](_0x1c7b2b[_0x6049('0x28')]);if(_0x1c7b2b[_0x6049('0x29')]){delete _0x1c7b2b[_0x6049('0x29')];}_0x204466[_0x6049('0x1a')](_0x2d6363)[_0x6049('0x2a')](_0x1c7b2b);};}exports[_0x6049('0x2b')]=function(_0x3c5500,_0x218d9c){var _0x19d847={},_0x4a5084={},_0x2f9521={'count':0x0,'rows':[]};var _0x51c622=_['map'](db[_0x6049('0x2c')][_0x6049('0x2d')],function(_0x20bf3c){return{'name':_0x20bf3c[_0x6049('0x2e')],'type':_0x20bf3c[_0x6049('0x2f')][_0x6049('0x30')]};});_0x4a5084[_0x6049('0x31')]=_[_0x6049('0x32')](_0x51c622,'name');_0x4a5084[_0x6049('0x33')]=_[_0x6049('0x34')](_0x3c5500[_0x6049('0x33')]);_0x4a5084['filters']=_[_0x6049('0x35')](_0x4a5084[_0x6049('0x31')],_0x4a5084[_0x6049('0x33')]);_0x19d847[_0x6049('0x36')]=_[_0x6049('0x35')](_0x4a5084['model'],qs[_0x6049('0x37')](_0x3c5500[_0x6049('0x33')]['fields']));_0x19d847[_0x6049('0x36')]=_0x19d847[_0x6049('0x36')][_0x6049('0x38')]?_0x19d847['attributes']:_0x4a5084[_0x6049('0x31')];if(!_0x3c5500[_0x6049('0x33')][_0x6049('0x39')](_0x6049('0x3a'))){_0x19d847[_0x6049('0x1d')]=qs[_0x6049('0x1d')](_0x3c5500[_0x6049('0x33')]['limit']);_0x19d847[_0x6049('0x1f')]=qs[_0x6049('0x1f')](_0x3c5500['query'][_0x6049('0x1f')]);}_0x19d847['order']=qs['sort'](_0x3c5500[_0x6049('0x33')][_0x6049('0x3b')]);_0x19d847[_0x6049('0x3c')]=qs[_0x6049('0x3d')](_[_0x6049('0x3e')](_0x3c5500['query'],_0x4a5084['filters']),_0x51c622);if(_0x3c5500[_0x6049('0x33')][_0x6049('0x3f')]){_0x19d847['where']=_[_0x6049('0x40')](_0x19d847[_0x6049('0x3c')],{'$or':_[_0x6049('0x32')](_0x51c622,function(_0x2afc00){if(_0x2afc00[_0x6049('0x2f')]!==_0x6049('0x41')){var _0x4c70c3={};_0x4c70c3[_0x2afc00[_0x6049('0x29')]]={'$like':'%'+_0x3c5500['query']['filter']+'%'};return _0x4c70c3;}})});}_0x19d847=_[_0x6049('0x40')]({},_0x19d847,_0x3c5500['options']);var _0x598e6d={'where':_0x19d847[_0x6049('0x3c')]};return db[_0x6049('0x2c')][_0x6049('0x1e')](_0x598e6d)[_0x6049('0x42')](function(_0x59cfed){_0x2f9521[_0x6049('0x1e')]=_0x59cfed;if(_0x3c5500[_0x6049('0x33')][_0x6049('0x43')]){_0x19d847[_0x6049('0x44')]=[{'all':!![]}];}return db[_0x6049('0x2c')][_0x6049('0x45')](_0x19d847);})[_0x6049('0x42')](function(_0x4a6e61){_0x2f9521[_0x6049('0x46')]=_0x4a6e61;return _0x2f9521;})[_0x6049('0x42')](respondWithFilteredResult(_0x218d9c,_0x19d847))['catch'](handleError(_0x218d9c,null));};exports['show']=function(_0x1ee8c0,_0x51aac5){var _0x488095={'raw':!![],'where':{'id':_0x1ee8c0[_0x6049('0x47')]['id']}},_0x1aec23={};_0x1aec23[_0x6049('0x31')]=_[_0x6049('0x34')](db['VoiceQueuesLog'][_0x6049('0x2d')]);_0x1aec23[_0x6049('0x33')]=_[_0x6049('0x34')](_0x1ee8c0[_0x6049('0x33')]);_0x1aec23[_0x6049('0x3d')]=_[_0x6049('0x35')](_0x1aec23[_0x6049('0x31')],_0x1aec23[_0x6049('0x33')]);_0x488095[_0x6049('0x36')]=_[_0x6049('0x35')](_0x1aec23[_0x6049('0x31')],qs[_0x6049('0x37')](_0x1ee8c0[_0x6049('0x33')]['fields']));_0x488095[_0x6049('0x36')]=_0x488095[_0x6049('0x36')][_0x6049('0x38')]?_0x488095['attributes']:_0x1aec23[_0x6049('0x31')];if(_0x1ee8c0[_0x6049('0x33')][_0x6049('0x43')]){_0x488095[_0x6049('0x44')]=[{'all':!![]}];}_0x488095=_['merge']({},_0x488095,_0x1ee8c0[_0x6049('0x48')]);return db[_0x6049('0x2c')][_0x6049('0x49')](_0x488095)[_0x6049('0x42')](handleEntityNotFound(_0x51aac5,null))[_0x6049('0x42')](respondWithResult(_0x51aac5,null))[_0x6049('0x4a')](handleError(_0x51aac5,null));};exports[_0x6049('0x4b')]=function(_0x29fc00,_0x3a353e){return db[_0x6049('0x2c')][_0x6049('0x4b')](_0x29fc00[_0x6049('0x4c')],{})[_0x6049('0x42')](respondWithResult(_0x3a353e,0xc9))['catch'](handleError(_0x3a353e,null));};exports['update']=function(_0x13fe99,_0x26cab7){if(_0x13fe99[_0x6049('0x4c')]['id']){delete _0x13fe99[_0x6049('0x4c')]['id'];}return db[_0x6049('0x2c')]['find']({'where':{'id':_0x13fe99[_0x6049('0x47')]['id']}})[_0x6049('0x42')](handleEntityNotFound(_0x26cab7,null))[_0x6049('0x42')](saveUpdates(_0x13fe99[_0x6049('0x4c')],null))['then'](respondWithResult(_0x26cab7,null))[_0x6049('0x4a')](handleError(_0x26cab7,null));};exports[_0x6049('0x26')]=function(_0x4cf513,_0x2dd0ae){return db[_0x6049('0x2c')][_0x6049('0x49')]({'where':{'id':_0x4cf513[_0x6049('0x47')]['id']}})[_0x6049('0x42')](handleEntityNotFound(_0x2dd0ae,null))[_0x6049('0x42')](removeEntity(_0x2dd0ae,null))[_0x6049('0x4a')](handleError(_0x2dd0ae,null));};
\ No newline at end of file
index 0eb4fa2..5079f7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a56=['event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x583fda,_0x1a3f25){var _0x47a01c=function(_0x43a96e){while(--_0x43a96e){_0x583fda['push'](_0x583fda['shift']());}};_0x47a01c(++_0x1a3f25);}(_0x8a56,0xf0));var _0x68a5=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0x8a56[_0x5b1c50];return _0x2d379b;};'use strict';var _=require(_0x68a5('0x0'));var util=require(_0x68a5('0x1'));var logger=require(_0x68a5('0x2'))(_0x68a5('0x3'));var moment=require(_0x68a5('0x4'));var BPromise=require(_0x68a5('0x5'));var rp=require(_0x68a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68a5('0x7'));var config=require(_0x68a5('0x8'));var attributes=require(_0x68a5('0x9'));module[_0x68a5('0xa')]=function(_0x5da045,_0x3ac385){return _0x5da045[_0x68a5('0xb')](_0x68a5('0xc'),attributes,{'tableName':_0x68a5('0xd'),'paranoid':![],'indexes':[{'name':_0x68a5('0xe'),'fields':[_0x68a5('0xf'),_0x68a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x6282=['exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6282,0x76));var _0x2628=function(_0x49a59c,_0x4aeb8f){_0x49a59c=_0x49a59c-0x0;var _0x242495=_0x6282[_0x49a59c];return _0x242495;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var logger=require(_0x2628('0x2'))(_0x2628('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2628('0x4'));var fs=require('fs');var path=require(_0x2628('0x5'));var rimraf=require('rimraf');var config=require(_0x2628('0x6'));var attributes=require(_0x2628('0x7'));module[_0x2628('0x8')]=function(_0x47102a,_0x128d3a){return _0x47102a['define'](_0x2628('0x9'),attributes,{'tableName':_0x2628('0xa'),'paranoid':![],'indexes':[{'name':_0x2628('0xb'),'fields':[_0x2628('0xc'),_0x2628('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index 2f80931..c2cb42c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x184a=['../../config/logger','rpc','../../config/environment','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4580f3,_0x12b09c){var _0x34fb4c=function(_0x56a7f5){while(--_0x56a7f5){_0x4580f3['push'](_0x4580f3['shift']());}};_0x34fb4c(++_0x12b09c);}(_0x184a,0x9a));var _0xa184=function(_0x1da82b,_0x51a962){_0x1da82b=_0x1da82b-0x0;var _0x5a90d2=_0x184a[_0x1da82b];return _0x5a90d2;};'use strict';var _=require(_0xa184('0x0'));var util=require('util');var moment=require(_0xa184('0x1'));var BPromise=require(_0xa184('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa184('0x3'));var db=require(_0xa184('0x4'))['db'];var utils=require(_0xa184('0x5'));var logger=require(_0xa184('0x6'))(_0xa184('0x7'));var config=require(_0xa184('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa184('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x374a99,_0x462720,_0x166e9f){return new BPromise(function(_0x19421b,_0xa76dc3){return client[_0xa184('0xa')](_0x374a99,_0x166e9f)[_0xa184('0xb')](function(_0x1bb05c){logger['info'](_0xa184('0xc'),_0x462720,_0xa184('0xd'));logger[_0xa184('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x462720,_0xa184('0xd'),JSON[_0xa184('0xf')](_0x1bb05c));if(_0x1bb05c[_0xa184('0x10')]){if(_0x1bb05c[_0xa184('0x10')]['code']===0x1f4){logger['error'](_0xa184('0xc'),_0x462720,_0x1bb05c[_0xa184('0x10')][_0xa184('0x11')]);return _0xa76dc3(_0x1bb05c['error'][_0xa184('0x11')]);}logger[_0xa184('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x462720,_0x1bb05c[_0xa184('0x10')][_0xa184('0x11')]);return _0x19421b(_0x1bb05c[_0xa184('0x10')]['message']);}else{logger[_0xa184('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x462720,'request\x20sent');_0x19421b(_0x1bb05c['result']['message']);}})[_0xa184('0x13')](function(_0x35f24f){logger['error'](_0xa184('0xc'),_0x462720,_0x35f24f);_0xa76dc3(_0x35f24f);});});}
\ No newline at end of file
+var _0xe152=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x7bd7db,_0x37537c){var _0x2bca29=function(_0x5a4b17){while(--_0x5a4b17){_0x7bd7db['push'](_0x7bd7db['shift']());}};_0x2bca29(++_0x37537c);}(_0xe152,0x172));var _0x2e15=function(_0x5c9ab5,_0x25d1ab){_0x5c9ab5=_0x5c9ab5-0x0;var _0x162df2=_0xe152[_0x5c9ab5];return _0x162df2;};'use strict';var _=require(_0x2e15('0x0'));var util=require(_0x2e15('0x1'));var moment=require(_0x2e15('0x2'));var BPromise=require(_0x2e15('0x3'));var rs=require(_0x2e15('0x4'));var fs=require('fs');var Redis=require(_0x2e15('0x5'));var db=require(_0x2e15('0x6'))['db'];var utils=require(_0x2e15('0x7'));var logger=require(_0x2e15('0x8'))(_0x2e15('0x9'));var config=require('../../config/environment');var jayson=require(_0x2e15('0xa'));var client=jayson[_0x2e15('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3af75a,_0x4ba5d4,_0x2c644b){return new BPromise(function(_0x3abb46,_0x2bcdac){return client[_0x2e15('0xc')](_0x3af75a,_0x2c644b)[_0x2e15('0xd')](function(_0x139432){logger['info'](_0x2e15('0xe'),_0x4ba5d4,_0x2e15('0xf'));logger[_0x2e15('0x10')](_0x2e15('0x11'),_0x4ba5d4,'request\x20sent',JSON['stringify'](_0x139432));if(_0x139432[_0x2e15('0x12')]){if(_0x139432[_0x2e15('0x12')][_0x2e15('0x13')]===0x1f4){logger['error'](_0x2e15('0xe'),_0x4ba5d4,_0x139432[_0x2e15('0x12')]['message']);return _0x2bcdac(_0x139432[_0x2e15('0x12')][_0x2e15('0x14')]);}logger['error'](_0x2e15('0xe'),_0x4ba5d4,_0x139432[_0x2e15('0x12')][_0x2e15('0x14')]);return _0x3abb46(_0x139432[_0x2e15('0x12')]['message']);}else{logger['info'](_0x2e15('0xe'),_0x4ba5d4,_0x2e15('0xf'));_0x3abb46(_0x139432[_0x2e15('0x15')][_0x2e15('0x14')]);}})['catch'](function(_0x3ea8b2){logger['error'](_0x2e15('0xe'),_0x4ba5d4,_0x3ea8b2);_0x2bcdac(_0x3ea8b2);});});}
\ No newline at end of file
index 0c1a137..1a42987 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd949=['/:id/download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','show'];(function(_0x557d6f,_0x29e5a2){var _0x288d13=function(_0x35f632){while(--_0x35f632){_0x557d6f['push'](_0x557d6f['shift']());}};_0x288d13(++_0x29e5a2);}(_0xd949,0xba));var _0x9d94=function(_0x3c4d9e,_0xda9ffb){_0x3c4d9e=_0x3c4d9e-0x0;var _0x13268e=_0xd949[_0x3c4d9e];return _0x13268e;};'use strict';var multer=require('multer');var util=require(_0x9d94('0x0'));var path=require(_0x9d94('0x1'));var timeout=require(_0x9d94('0x2'));var express=require(_0x9d94('0x3'));var router=express[_0x9d94('0x4')]();var fs_extra=require(_0x9d94('0x5'));var auth=require(_0x9d94('0x6'));var interaction=require(_0x9d94('0x7'));var config=require(_0x9d94('0x8'));var controller=require(_0x9d94('0x9'));router[_0x9d94('0xa')]('/',auth[_0x9d94('0xb')](),controller['index']);router[_0x9d94('0xa')](_0x9d94('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x9d94('0xb')](),controller[_0x9d94('0xd')]);router['get'](_0x9d94('0xe'),auth[_0x9d94('0xb')](),controller['download']);router[_0x9d94('0xa')](_0x9d94('0xf'),controller[_0x9d94('0x10')]);router[_0x9d94('0xa')]('/:id/transcribe',auth[_0x9d94('0xb')](),controller[_0x9d94('0x11')]);router[_0x9d94('0x12')]('/',auth[_0x9d94('0xb')](),controller[_0x9d94('0x13')]);router[_0x9d94('0x12')](_0x9d94('0x14'),auth[_0x9d94('0xb')](),controller['runTranscribe']);router['put'](_0x9d94('0x15'),auth['isAuthenticated'](),controller[_0x9d94('0x16')]);router['delete'](_0x9d94('0x15'),auth[_0x9d94('0xb')](),controller[_0x9d94('0x17')]);module[_0x9d94('0x18')]=router;
\ No newline at end of file
+var _0xa00b=['/:id','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','show','download','/:id/downloads','downloads','/:id/transcribe','post','create','put','update','delete'];(function(_0x15a387,_0x408e59){var _0x1e6241=function(_0x49b670){while(--_0x49b670){_0x15a387['push'](_0x15a387['shift']());}};_0x1e6241(++_0x408e59);}(_0xa00b,0x80));var _0xba00=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa00b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xba00('0x0'));var util=require(_0xba00('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xba00('0x2'));var router=express['Router']();var fs_extra=require(_0xba00('0x3'));var auth=require(_0xba00('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xba00('0x5'));var controller=require(_0xba00('0x6'));router[_0xba00('0x7')]('/',auth['isAuthenticated'](),controller[_0xba00('0x8')]);router['get'](_0xba00('0x9'),auth[_0xba00('0xa')](),controller[_0xba00('0xb')]);router[_0xba00('0x7')]('/:id',auth[_0xba00('0xa')](),controller[_0xba00('0xc')]);router[_0xba00('0x7')]('/:id/download',auth[_0xba00('0xa')](),controller[_0xba00('0xd')]);router[_0xba00('0x7')](_0xba00('0xe'),controller[_0xba00('0xf')]);router[_0xba00('0x7')](_0xba00('0x10'),auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0xba00('0x11')]('/',auth[_0xba00('0xa')](),controller[_0xba00('0x12')]);router['post'](_0xba00('0x10'),auth[_0xba00('0xa')](),controller['runTranscribe']);router[_0xba00('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xba00('0x14')]);router[_0xba00('0x15')](_0xba00('0x16'),auth[_0xba00('0xa')](),controller[_0xba00('0x17')]);module[_0xba00('0x18')]=router;
\ No newline at end of file
index 0abab1c..af000d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
+var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
index 5235c95..c6f8ccb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebd4=['File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','upload','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','VoiceRecording','rawAttributes','type','key','differenceBy','format','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','include','findAll','catch','show','params','keys','includeAll','find','create','update','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','%s.cypher','VoiceRecording\x20not\x20found','isNil','Entity\x20not\x20found','info'];(function(_0x3db0ba,_0x2be65c){var _0x2d8e9a=function(_0x780700){while(--_0x780700){_0x3db0ba['push'](_0x3db0ba['shift']());}};_0x2d8e9a(++_0x2be65c);}(_0xebd4,0x1ee));var _0x4ebd=function(_0x2ee2d1,_0x29fc6f){_0x2ee2d1=_0x2ee2d1-0x0;var _0x5849b7=_0xebd4[_0x2ee2d1];return _0x5849b7;};'use strict';var emlformat=require(_0x4ebd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ebd('0x1'));var jsonpatch=require(_0x4ebd('0x2'));var rp=require(_0x4ebd('0x3'));var moment=require(_0x4ebd('0x4'));var BPromise=require(_0x4ebd('0x5'));var Mustache=require(_0x4ebd('0x6'));var util=require(_0x4ebd('0x7'));var path=require(_0x4ebd('0x8'));var sox=require(_0x4ebd('0x9'));var csv=require(_0x4ebd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ebd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ebd('0xc'));var deskjs=require(_0x4ebd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4ebd('0xe'));var Papa=require(_0x4ebd('0xf'));var AWS=require(_0x4ebd('0x10'));var uuidv4=require(_0x4ebd('0x11'));var Redis=require(_0x4ebd('0x12'));var authService=require(_0x4ebd('0x13'));var qs=require(_0x4ebd('0x14'));var as=require(_0x4ebd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4ebd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4ebd('0x17'));var db=require(_0x4ebd('0x18'))['db'];function respondWithStatusCode(_0x1ca532,_0x28428c){_0x28428c=_0x28428c||0xcc;return function(_0xfef8c4){if(_0xfef8c4){return _0x1ca532[_0x4ebd('0x19')](_0x28428c);}return _0x1ca532['status'](_0x28428c)[_0x4ebd('0x1a')]();};}function respondWithResult(_0x5d893e,_0x47039f){_0x47039f=_0x47039f||0xc8;return function(_0x4116af){if(_0x4116af){return _0x5d893e[_0x4ebd('0x1b')](_0x47039f)[_0x4ebd('0x1c')](_0x4116af);}};}function respondWithFilteredResult(_0x5ae452,_0x1655b8){return function(_0x45d79f){if(_0x45d79f){var _0x43b3c2=typeof _0x1655b8['offset']===_0x4ebd('0x1d')&&typeof _0x1655b8[_0x4ebd('0x1e')]===_0x4ebd('0x1d');var _0xf09edc=_0x45d79f[_0x4ebd('0x1f')];var _0x92b21b=_0x43b3c2?0x0:_0x1655b8[_0x4ebd('0x20')];var _0x1f8356=_0x43b3c2?_0x45d79f[_0x4ebd('0x1f')]:_0x1655b8[_0x4ebd('0x20')]+_0x1655b8[_0x4ebd('0x1e')];var _0x392869;if(_0x1f8356>=_0xf09edc){_0x1f8356=_0xf09edc;_0x392869=0xc8;}else{_0x392869=0xce;}_0x5ae452[_0x4ebd('0x1b')](_0x392869);return _0x5ae452[_0x4ebd('0x21')](_0x4ebd('0x22'),_0x92b21b+'-'+_0x1f8356+'/'+_0xf09edc)[_0x4ebd('0x1c')](_0x45d79f);}return null;};}function patchUpdates(_0x2efa42){return function(_0x346db4){try{jsonpatch[_0x4ebd('0x23')](_0x346db4,_0x2efa42,!![]);}catch(_0x3051b9){return BPromise[_0x4ebd('0x24')](_0x3051b9);}return _0x346db4[_0x4ebd('0x25')]();};}function saveUpdates(_0x4eb0cb,_0x5cc949){return function(_0x14385f){if(_0x14385f){return _0x14385f['update'](_0x4eb0cb)[_0x4ebd('0x26')](function(_0x3ba579){return _0x3ba579;});}return null;};}function removeEntity(_0x48e9d4,_0x4c51f2){return function(_0x244c73){if(_0x244c73){return _0x244c73[_0x4ebd('0x27')]()[_0x4ebd('0x26')](function(){_0x48e9d4[_0x4ebd('0x1b')](0xcc)[_0x4ebd('0x1a')]();});}};}function handleEntityNotFound(_0x4731a4,_0x38a5c9){return function(_0x50f665){if(!_0x50f665){_0x4731a4[_0x4ebd('0x19')](0x194);}return _0x50f665;};}function handleError(_0xd07520,_0x2d1942){_0x2d1942=_0x2d1942||0x1f4;return function(_0x2bd938){logger[_0x4ebd('0x28')](_0x2bd938['stack']);if(_0x2bd938[_0x4ebd('0x29')]){delete _0x2bd938[_0x4ebd('0x29')];}_0xd07520[_0x4ebd('0x1b')](_0x2d1942)[_0x4ebd('0x2a')](_0x2bd938);};}exports[_0x4ebd('0x2b')]=function(_0x4595d2,_0x228420){var _0x48b279={},_0x4808cd={},_0x1902d2={'count':0x0,'rows':[]};var _0x3f9e0d=_['map'](db[_0x4ebd('0x2c')][_0x4ebd('0x2d')],function(_0x3f0de2){return{'name':_0x3f0de2['fieldName'],'type':_0x3f0de2[_0x4ebd('0x2e')][_0x4ebd('0x2f')]};});_0x4808cd['model']=_[_0x4ebd('0x30')](_['map'](_0x3f9e0d,'name'),[_0x4ebd('0x31')]);_0x4808cd['query']=_['keys'](_0x4595d2[_0x4ebd('0x32')]);_0x4808cd['filters']=_[_0x4ebd('0x33')](_0x4808cd[_0x4ebd('0x34')],_0x4808cd['query']);_0x48b279[_0x4ebd('0x35')]=_[_0x4ebd('0x33')](_0x4808cd[_0x4ebd('0x34')],qs['fields'](_0x4595d2[_0x4ebd('0x32')][_0x4ebd('0x36')]));_0x48b279[_0x4ebd('0x35')]=_0x48b279[_0x4ebd('0x35')][_0x4ebd('0x37')]?_0x48b279['attributes']:_0x4808cd['model'];if(!_0x4595d2['query'][_0x4ebd('0x38')]('nolimit')){_0x48b279[_0x4ebd('0x1e')]=qs['limit'](_0x4595d2[_0x4ebd('0x32')]['limit']);_0x48b279[_0x4ebd('0x20')]=qs[_0x4ebd('0x20')](_0x4595d2[_0x4ebd('0x32')][_0x4ebd('0x20')]);}_0x48b279['order']=qs['sort'](_0x4595d2[_0x4ebd('0x32')][_0x4ebd('0x39')]);_0x48b279[_0x4ebd('0x3a')]=qs[_0x4ebd('0x3b')](_[_0x4ebd('0x3c')](_0x4595d2[_0x4ebd('0x32')],_0x4808cd['filters']),_0x3f9e0d);if(_0x4595d2[_0x4ebd('0x32')][_0x4ebd('0x3d')]){_0x48b279['where']=_[_0x4ebd('0x3e')](_0x48b279[_0x4ebd('0x3a')],{'$or':_[_0x4ebd('0x3f')](_0x3f9e0d,function(_0x232a28){if(_0x232a28[_0x4ebd('0x2e')]!=='VIRTUAL'){var _0x5b454a={};_0x5b454a[_0x232a28['name']]={'$like':'%'+_0x4595d2['query'][_0x4ebd('0x3d')]+'%'};return _0x5b454a;}})});}_0x48b279=_[_0x4ebd('0x3e')]({},_0x48b279,_0x4595d2['options']);var _0x480cb9={'where':_0x48b279[_0x4ebd('0x3a')]};return db['VoiceRecording'][_0x4ebd('0x1f')](_0x480cb9)[_0x4ebd('0x26')](function(_0x1f56f7){_0x1902d2['count']=_0x1f56f7;if(_0x4595d2['query']['includeAll']){_0x48b279[_0x4ebd('0x40')]=[{'all':!![]}];}return db[_0x4ebd('0x2c')][_0x4ebd('0x41')](_0x48b279);})[_0x4ebd('0x26')](function(_0x2823f9){_0x1902d2['rows']=_0x2823f9;return _0x1902d2;})[_0x4ebd('0x26')](respondWithFilteredResult(_0x228420,_0x48b279))[_0x4ebd('0x42')](handleError(_0x228420,null));};exports[_0x4ebd('0x43')]=function(_0x425281,_0x2bd5b2){var _0x2670d0={'raw':![],'where':{'id':_0x425281[_0x4ebd('0x44')]['id']}},_0x2b334f={};_0x2b334f[_0x4ebd('0x34')]=_[_0x4ebd('0x45')](db[_0x4ebd('0x2c')][_0x4ebd('0x2d')]);_0x2b334f['query']=_[_0x4ebd('0x45')](_0x425281[_0x4ebd('0x32')]);_0x2b334f[_0x4ebd('0x3b')]=_['intersection'](_0x2b334f[_0x4ebd('0x34')],_0x2b334f[_0x4ebd('0x32')]);_0x2670d0[_0x4ebd('0x35')]=_['intersection'](_0x2b334f[_0x4ebd('0x34')],qs[_0x4ebd('0x36')](_0x425281[_0x4ebd('0x32')][_0x4ebd('0x36')]));_0x2670d0[_0x4ebd('0x35')]=_0x2670d0['attributes'][_0x4ebd('0x37')]?_0x2670d0[_0x4ebd('0x35')]:_0x2b334f['model'];if(_0x425281['query'][_0x4ebd('0x46')]){_0x2670d0['include']=[{'all':!![]}];}_0x2670d0=_['merge']({},_0x2670d0,_0x425281['options']);return db['VoiceRecording'][_0x4ebd('0x47')](_0x2670d0)[_0x4ebd('0x26')](handleEntityNotFound(_0x2bd5b2,null))[_0x4ebd('0x26')](respondWithResult(_0x2bd5b2,null))['catch'](handleError(_0x2bd5b2,null));};exports[_0x4ebd('0x48')]=function(_0x56ad8f,_0x3ea8b6){return db[_0x4ebd('0x2c')]['create'](_0x56ad8f['body'],{})[_0x4ebd('0x26')](respondWithResult(_0x3ea8b6,0xc9))[_0x4ebd('0x42')](handleError(_0x3ea8b6,null));};exports[_0x4ebd('0x49')]=function(_0x26ba2d,_0x31841c){if(_0x26ba2d[_0x4ebd('0x4a')]['id']){delete _0x26ba2d[_0x4ebd('0x4a')]['id'];}return db['VoiceRecording'][_0x4ebd('0x47')]({'where':{'id':_0x26ba2d[_0x4ebd('0x44')]['id']}})['then'](handleEntityNotFound(_0x31841c,null))[_0x4ebd('0x26')](saveUpdates(_0x26ba2d[_0x4ebd('0x4a')],null))[_0x4ebd('0x26')](respondWithResult(_0x31841c,null))['catch'](handleError(_0x31841c,null));};exports[_0x4ebd('0x4b')]=function(_0x314850,_0x596aa8){return db[_0x4ebd('0x2c')]['describe']()[_0x4ebd('0x26')](respondWithResult(_0x596aa8,null))[_0x4ebd('0x42')](handleError(_0x596aa8,null));};exports[_0x4ebd('0x4c')]=function(_0x4baa81,_0x401a8c,_0x211e41){var _0xb18879=require(_0x4ebd('0x4d'));var _0x53a84d=![];var _0x4302f8={};if(_0x4baa81[_0x4ebd('0x32')][_0x4ebd('0x2e')]&&_0x4baa81['query'][_0x4ebd('0x2e')]===_0x4ebd('0x4e')){_0x4302f8[_0x4ebd('0x4e')]=_0x4baa81[_0x4ebd('0x44')]['id'];}else{_0x4302f8['id']=_0x4baa81[_0x4ebd('0x44')]['id'];}return db[_0x4ebd('0x2c')][_0x4ebd('0x47')]({'where':_0x4302f8,'attributes':['id','value'],'raw':!![]})[_0x4ebd('0x26')](handleEntityNotFound(_0x401a8c,null))[_0x4ebd('0x26')](function(_0x5617bd){if(_0x5617bd){var _0x2943c3=_0x5617bd[_0x4ebd('0x4f')];var _0xf7c49=util[_0x4ebd('0x31')]('%s.cypher',_0x2943c3);if(fs[_0x4ebd('0x50')](_0xf7c49)){_0x53a84d=!![];return _0xb18879[_0x4ebd('0x51')](_0xf7c49,_0x2943c3,config[_0x4ebd('0x52')][_0x4ebd('0x53')])[_0x4ebd('0x26')](function(){return _0x5617bd;});}return _0x5617bd;}})[_0x4ebd('0x26')](function(_0x2f878c){if(_0x2f878c){var _0x595bd6=_0x2f878c['value'];if(!fs['existsSync'](_0x595bd6)){throw new db[(_0x4ebd('0x54'))][(_0x4ebd('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x2f878c[_0x4ebd('0x56')]){return _0x401a8c['download'](_0x595bd6,_0x2f878c[_0x4ebd('0x56')]+path[_0x4ebd('0x57')](_0x595bd6),function(){if(_0x53a84d){fs[_0x4ebd('0x58')](_0x595bd6);}});}else{return _0x401a8c['download'](_0x595bd6,function(_0x54d89c){if(_0x53a84d){fs[_0x4ebd('0x58')](_0x595bd6);}});}}})[_0x4ebd('0x42')](function(_0x2e3258){if(_0x2e3258[_0x4ebd('0x59')]==='VoiceRecording\x20not\x20found'){_0x401a8c[_0x4ebd('0x1b')](0x194)[_0x4ebd('0x2a')](_0x4ebd('0x5a'));}else{return handleError(_0x401a8c,null);}});};exports[_0x4ebd('0x5b')]=function(_0x3db4e0,_0x59a161,_0x3f6c05){var _0x4a26a9=require(_0x4ebd('0x4d'));var _0x3d5d1d=![];var _0x4dea25={'$and':[db[_0x4ebd('0x5c')][_0x4ebd('0x3a')](db[_0x4ebd('0x5c')]['fn'](_0x4ebd('0x5d'),db[_0x4ebd('0x5c')][_0x4ebd('0x5e')]('uniqueid')),_0x3db4e0['query'][_0x4ebd('0x5f')])]};if(_0x3db4e0[_0x4ebd('0x32')]['type']&&_0x3db4e0[_0x4ebd('0x32')][_0x4ebd('0x2e')]===_0x4ebd('0x4e')){_0x4dea25['$and']['push']({'uniqueid':_0x3db4e0[_0x4ebd('0x44')]['id']});}else{_0x4dea25[_0x4ebd('0x60')]['push']({'id':_0x3db4e0['params']['id']});}return db['VoiceRecording'][_0x4ebd('0x47')]({'where':_0x4dea25,'attributes':['id',_0x4ebd('0x4f')],'raw':!![]})[_0x4ebd('0x26')](handleEntityNotFound(_0x59a161,null))[_0x4ebd('0x26')](function(_0x1f1050){if(_0x1f1050){var _0x5537c5=util[_0x4ebd('0x31')](_0x4ebd('0x61'),_0x1f1050[_0x4ebd('0x4f')]);if(fs[_0x4ebd('0x50')](_0x5537c5)){_0x3d5d1d=!![];return _0x4a26a9[_0x4ebd('0x51')](_0x5537c5,_0x1f1050[_0x4ebd('0x4f')],config[_0x4ebd('0x52')][_0x4ebd('0x53')])['then'](function(){return _0x1f1050;});}return _0x1f1050;}})[_0x4ebd('0x26')](function(_0x4e3581){if(_0x4e3581){if(!fs['existsSync'](_0x4e3581['value'])){throw new db[(_0x4ebd('0x54'))]['ValidationError'](_0x4ebd('0x62'));}if(_0x4e3581[_0x4ebd('0x56')]){return _0x59a161[_0x4ebd('0x4c')](_0x4e3581[_0x4ebd('0x4f')],_0x4e3581[_0x4ebd('0x56')]+path['extname'](_0x4e3581[_0x4ebd('0x4f')]),function(){if(_0x3d5d1d){fs[_0x4ebd('0x58')](_0x4e3581['value']);}});}else{return _0x59a161[_0x4ebd('0x4c')](_0x4e3581[_0x4ebd('0x4f')],function(_0x3b2aea){if(_0x3d5d1d){fs[_0x4ebd('0x58')](_0x4e3581['value']);}});}}})[_0x4ebd('0x42')](handleError(_0x59a161,null));};exports[_0x4ebd('0x27')]=function(_0x479f99,_0x422a20){return db['VoiceRecording']['find']({'where':{'id':_0x479f99[_0x4ebd('0x44')]['id']}})[_0x4ebd('0x26')](function(_0x542d5f){if(_[_0x4ebd('0x63')](_0x542d5f)){throw new ReferenceError(_0x4ebd('0x64'));}return _0x542d5f;})['then'](function(_0x46c035){var _0x151ca1=_0x46c035['value'];logger[_0x4ebd('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x151ca1);if(!_['isNil'](_0x46c035['value'])&&fs[_0x4ebd('0x50')](_0x151ca1)){logger[_0x4ebd('0x65')](_0x4ebd('0x66')+_0x151ca1+_0x4ebd('0x67'));fs['unlinkSync'](_0x151ca1);}_0x151ca1=_0x151ca1+'.cypher';if(!_[_0x4ebd('0x63')](_0x46c035[_0x4ebd('0x4f')])&&fs[_0x4ebd('0x50')](_0x151ca1)){logger[_0x4ebd('0x65')](_0x4ebd('0x66')+_0x151ca1+_0x4ebd('0x67'));fs['unlinkSync'](_0x151ca1);}return _0x46c035;})[_0x4ebd('0x26')](function(_0x490709){if(!_0x490709)throw new InternalError();return _0x490709['destroy']();})[_0x4ebd('0x26')](function(){_0x422a20[_0x4ebd('0x1b')](0xcc)[_0x4ebd('0x1a')]();})[_0x4ebd('0x42')](handleError(_0x422a20,null));};function getBucketslist(_0x2d61b9,_0x5a4682,_0x1ba86a){return new Promise(function(_0x1722f4,_0x53677b){var _0x4d4b15=new AWS['S3']({'accessKeyId':_0x5a4682,'secretAccessKey':_0x2d61b9,'region':_0x1ba86a});_0x4d4b15['listBuckets']({},function(_0x22bf16,_0x1670d7){if(_0x22bf16){return _0x53677b(_0x22bf16);}else{return _0x1722f4(_0x1670d7);}});});}function createBucket(_0x1939a0,_0x9a3e12,_0x55987e,_0x52c098){return new Promise(function(_0x35eb8d,_0x12d88a){var _0x2c0769=new AWS['S3']({'accessKeyId':_0x9a3e12,'secretAccessKey':_0x1939a0,'region':_0x55987e});_0x2c0769[_0x4ebd('0x68')]({'Bucket':_0x52c098},function(_0x5b256d,_0x2690b7){if(_0x5b256d){return _0x12d88a(_0x5b256d);}else{return _0x35eb8d(_0x2690b7);}});});}function uploadFile(_0x1806ca,_0xf6afee,_0x4c6d66,_0x5bb5ce,_0x7b86b9,_0x2b22a8){return new Promise(function(_0x16d6ec,_0x21c6b9){var _0x322b92=new AWS['S3']({'accessKeyId':_0xf6afee,'secretAccessKey':_0x1806ca,'region':_0x4c6d66});_0x322b92[_0x4ebd('0x69')]({'Bucket':_0x5bb5ce,'Key':_0x7b86b9,'Body':_0x2b22a8},function(_0x480756,_0x160568){if(_0x480756){return _0x21c6b9(_0x480756);}else{return _0x16d6ec(_0x160568);}});});}function startTranscribe(_0x24ebd2,_0x214203,_0x54ec0f,_0x571412,_0x46c3cc,_0x437b08){return new Promise(function(_0x4cd0a6,_0x4e29fd){var _0xa2d17c=new AWS['TranscribeService']({'accessKeyId':_0x214203,'secretAccessKey':_0x24ebd2,'region':_0x54ec0f});_0xa2d17c[_0x4ebd('0x6a')]({'TranscriptionJobName':_0x571412,'LanguageCode':_0x46c3cc,'Media':{'MediaFileUri':_0x437b08}},function(_0x556432,_0x5e5a89){if(_0x556432){return _0x4e29fd(_0x556432);}else{return _0x4cd0a6(_0x5e5a89);}});});}function transcribe(_0x34882e,_0x286ad9,_0x4e9ab8,_0x224e37,_0x4d45a8,_0x3a095c,_0x1b7dab){return new Promise(function(_0x518f9d,_0x2578f3){var _0x51c478={};logger[_0x4ebd('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x34882e,_0x4d45a8));return uploadFile(_0x286ad9,_0x4e9ab8,_0x224e37,_0x4d45a8,path[_0x4ebd('0x6b')](_0x3a095c),fs[_0x4ebd('0x6c')](_0x3a095c))[_0x4ebd('0x26')](function(_0x462926){logger[_0x4ebd('0x65')](util['format'](_0x4ebd('0x6d'),_0x34882e,_0x4d45a8,_0x462926['Location']));_0x51c478['bucket']=_0x462926['Bucket'];_0x51c478[_0x4ebd('0x6e')]=_0x462926[_0x4ebd('0x6f')];logger[_0x4ebd('0x65')](util[_0x4ebd('0x31')](_0x4ebd('0x70'),_0x34882e));return startTranscribe(_0x286ad9,_0x4e9ab8,_0x224e37,uuidv4(),_0x1b7dab,_0x462926[_0x4ebd('0x6f')]);})[_0x4ebd('0x26')](function(_0xda9a05){logger[_0x4ebd('0x65')](util[_0x4ebd('0x31')](_0x4ebd('0x71'),_0x34882e,_0xda9a05['TranscriptionJob'][_0x4ebd('0x72')]));_0x51c478[_0x4ebd('0x73')]=_0xda9a05[_0x4ebd('0x74')][_0x4ebd('0x72')];_0x51c478[_0x4ebd('0x75')]=_0xda9a05[_0x4ebd('0x74')][_0x4ebd('0x76')];return _0x518f9d(_0x51c478);})[_0x4ebd('0x42')](function(_0x50ef25){return _0x2578f3(_0x50ef25);});});}exports[_0x4ebd('0x77')]=function(_0xad80ed,_0x2fe396,_0xfec6ff){var _0x3ce3fe;var _0x1db1bc;var _0x5205eb;var _0x18aa33=require(_0x4ebd('0x4d'));return db[_0x4ebd('0x2c')][_0x4ebd('0x78')]({'where':{'id':_0xad80ed[_0x4ebd('0x44')]['id']}})[_0x4ebd('0x26')](function(_0x5ebc41){if(_0x5ebc41){var _0x2f75bd=util[_0x4ebd('0x31')]('%s.cypher',_0x5ebc41[_0x4ebd('0x4f')]);if(fs[_0x4ebd('0x50')](_0x2f75bd)){cypher=!![];return _0x18aa33['decryptFile'](_0x2f75bd,_0x5ebc41[_0x4ebd('0x4f')],config[_0x4ebd('0x52')][_0x4ebd('0x53')])['then'](function(){return _0x5ebc41;});}return _0x5ebc41;}})[_0x4ebd('0x26')](function(_0x5b71cd){if(!_0x5b71cd){throw new db[(_0x4ebd('0x54'))][(_0x4ebd('0x55'))](_0x4ebd('0x79'));}_0x1db1bc=_0x5b71cd;return db[_0x4ebd('0x7a')][_0x4ebd('0x78')]({'where':{'id':0x1}});})[_0x4ebd('0x26')](handleEntityNotFound(_0x2fe396,null))[_0x4ebd('0x26')](function(_0x4d22c9){if(_0x4d22c9){_0x3ce3fe=_0x4d22c9;if(!_0x3ce3fe[_0x4ebd('0x7b')]||!_0x3ce3fe['transcribeAccountId']||!_0x3ce3fe['transcribeRegion']||!_0x3ce3fe[_0x4ebd('0x7c')]||!_0x3ce3fe[_0x4ebd('0x7d')]){throw new db['Sequelize'][(_0x4ebd('0x55'))](_0x4ebd('0x7e'));}if(_0xad80ed[_0x4ebd('0x4a')][_0x4ebd('0x7f')]&&(!_0x3ce3fe['sentiment']||!_0x3ce3fe['sentimentAccountId']||!_0x3ce3fe[_0x4ebd('0x80')]||!_0x3ce3fe[_0x4ebd('0x7c')]||!_0x3ce3fe['bucket'])){throw new db[(_0x4ebd('0x54'))][(_0x4ebd('0x55'))](_0x4ebd('0x81'));}return db[_0x4ebd('0x82')][_0x4ebd('0x78')]({'where':{'id':_0x3ce3fe['transcribeAccountId']}});}})[_0x4ebd('0x26')](function(_0x57e93f){if(!_0x57e93f){throw new db[(_0x4ebd('0x54'))][(_0x4ebd('0x55'))](_0x4ebd('0x83'));}if(!_0x57e93f[_0x4ebd('0x84')]||!_0x57e93f[_0x4ebd('0x85')]){throw new db['Sequelize'][(_0x4ebd('0x55'))](_0x4ebd('0x86'));}_0x5205eb=_0x57e93f;return getBucketslist(_0x5205eb[_0x4ebd('0x84')],_0x5205eb[_0x4ebd('0x85')],_0x3ce3fe[_0x4ebd('0x87')]);})['then'](function(_0x516639){if(_0x516639&&_0x516639['Buckets']){var _0x8a63d8=_[_0x4ebd('0x47')](_0x516639[_0x4ebd('0x88')],function(_0x2dfae9){return _0x2dfae9['Name']===_0x3ce3fe[_0x4ebd('0x7d')];});if(!_0x8a63d8){logger[_0x4ebd('0x65')](util[_0x4ebd('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xad80ed['params']['id'],_0x3ce3fe[_0x4ebd('0x7d')]));return createBucket(_0x5205eb['data1'],_0x5205eb['data2'],_0x3ce3fe[_0x4ebd('0x87')],_0x3ce3fe[_0x4ebd('0x7d')]);}logger[_0x4ebd('0x65')](util[_0x4ebd('0x31')](_0x4ebd('0x89'),_0xad80ed[_0x4ebd('0x44')]['id'],_0x3ce3fe[_0x4ebd('0x7d')]));return;}})['then'](function(_0x1413aa){if(_0x1db1bc[_0x4ebd('0x75')]===_0x4ebd('0x8a')){return transcribe(_0xad80ed[_0x4ebd('0x44')]['id'],_0x5205eb[_0x4ebd('0x84')],_0x5205eb['data2'],_0x3ce3fe[_0x4ebd('0x87')],_0x3ce3fe[_0x4ebd('0x7d')],_0x1db1bc['value'],_0x3ce3fe['language']);}else{logger[_0x4ebd('0x65')](util[_0x4ebd('0x31')](_0x4ebd('0x8b'),_0xad80ed['params']['id']));return{'transcribeStatus':_0x4ebd('0x8c')};}})[_0x4ebd('0x26')](function(_0x4f85dc){if(_0x4f85dc){_0x4f85dc[_0x4ebd('0x8d')]=_0xad80ed[_0x4ebd('0x4a')][_0x4ebd('0x7f')];return _0x1db1bc[_0x4ebd('0x8e')](_0x4f85dc);}})[_0x4ebd('0x26')](respondWithResult(_0x2fe396,null))['catch'](handleError(_0x2fe396,null));};function writeFile(_0x252f29,_0x5c5b79){return new Promise(function(_0x1b024e,_0x33fdb0){fs[_0x4ebd('0x8f')](_0x5c5b79,_0x252f29,function(_0x2a26ec,_0x1258be){if(_0x2a26ec){return _0x33fdb0(_0x2a26ec);}else{return _0x1b024e(_0x1258be);}});});}exports['downloadTranscribe']=function(_0x31b7ef,_0x1f8180,_0x52c9a6){return db[_0x4ebd('0x2c')][_0x4ebd('0x78')]({'where':{'id':_0x31b7ef[_0x4ebd('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f8180))[_0x4ebd('0x26')](function(_0x5d44ab){if(_0x5d44ab&&_0x5d44ab[_0x4ebd('0x90')]){var _0x30f700=_0x5d44ab[_0x4ebd('0x90')];var _0x5687a7=config[_0x4ebd('0x91')]+_0x4ebd('0x92')+_0x5d44ab['id']+_0x4ebd('0x93');if(fs['existsSync'](_0x5687a7)){return _0x5687a7;}return writeFile(_0x30f700,_0x5687a7)[_0x4ebd('0x26')](function(){return _0x5687a7;});}else{throw new db[(_0x4ebd('0x54'))][(_0x4ebd('0x55'))](_0x4ebd('0x94'));}})[_0x4ebd('0x26')](function(_0x362ce4){return _0x1f8180[_0x4ebd('0x4c')](_0x362ce4);})[_0x4ebd('0x42')](handleError(_0x1f8180));};
\ No newline at end of file
+var _0x2210=['recording','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','sequelize','MD5','col','token','push','$and','secrets','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','differenceBy','format','query','keys','intersection','attributes','model','length','hasOwnProperty','order','filters','pick','filter','where','VIRTUAL','merge','VoiceRecording','includeAll','findAll','rows','catch','show','params','fields','include','options','create','body','describe','download','../../components/encryptor','uniqueid','find','value','%s.cypher','existsSync','decryptFile'];(function(_0x66f777,_0x4a64d0){var _0x10d2dc=function(_0x32e6fe){while(--_0x32e6fe){_0x66f777['push'](_0x66f777['shift']());}};_0x10d2dc(++_0x4a64d0);}(_0x2210,0x16a));var _0x0221=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2210[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x0221('0x0'));var rimraf=require(_0x0221('0x1'));var zipdir=require(_0x0221('0x2'));var jsonpatch=require(_0x0221('0x3'));var rp=require(_0x0221('0x4'));var moment=require(_0x0221('0x5'));var BPromise=require(_0x0221('0x6'));var Mustache=require('mustache');var util=require(_0x0221('0x7'));var path=require(_0x0221('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0221('0x9'));var _=require('lodash');var squel=require(_0x0221('0xa'));var crypto=require(_0x0221('0xb'));var jsforce=require(_0x0221('0xc'));var deskjs=require(_0x0221('0xd'));var toCsv=require(_0x0221('0xe'));var querystring=require('querystring');var Papa=require(_0x0221('0xf'));var AWS=require(_0x0221('0x10'));var uuidv4=require(_0x0221('0x11'));var Redis=require(_0x0221('0x12'));var authService=require(_0x0221('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0221('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0221('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0221('0x16'))['db'];function respondWithStatusCode(_0x5823e2,_0x36fe87){_0x36fe87=_0x36fe87||0xcc;return function(_0x35690a){if(_0x35690a){return _0x5823e2[_0x0221('0x17')](_0x36fe87);}return _0x5823e2[_0x0221('0x18')](_0x36fe87)[_0x0221('0x19')]();};}function respondWithResult(_0x3228f7,_0x542d20){_0x542d20=_0x542d20||0xc8;return function(_0x1277e7){if(_0x1277e7){return _0x3228f7[_0x0221('0x18')](_0x542d20)['json'](_0x1277e7);}};}function respondWithFilteredResult(_0x27d33d,_0x3b3a6f){return function(_0x49d513){if(_0x49d513){var _0x7f672d=typeof _0x3b3a6f['offset']===_0x0221('0x1a')&&typeof _0x3b3a6f[_0x0221('0x1b')]===_0x0221('0x1a');var _0x5e41f0=_0x49d513[_0x0221('0x1c')];var _0x1d5a4a=_0x7f672d?0x0:_0x3b3a6f[_0x0221('0x1d')];var _0x4eb2f1=_0x7f672d?_0x49d513[_0x0221('0x1c')]:_0x3b3a6f['offset']+_0x3b3a6f[_0x0221('0x1b')];var _0x27319d;if(_0x4eb2f1>=_0x5e41f0){_0x4eb2f1=_0x5e41f0;_0x27319d=0xc8;}else{_0x27319d=0xce;}_0x27d33d[_0x0221('0x18')](_0x27319d);return _0x27d33d[_0x0221('0x1e')](_0x0221('0x1f'),_0x1d5a4a+'-'+_0x4eb2f1+'/'+_0x5e41f0)[_0x0221('0x20')](_0x49d513);}return null;};}function patchUpdates(_0x5dbf59){return function(_0xda92a2){try{jsonpatch[_0x0221('0x21')](_0xda92a2,_0x5dbf59,!![]);}catch(_0x4ab158){return BPromise[_0x0221('0x22')](_0x4ab158);}return _0xda92a2[_0x0221('0x23')]();};}function saveUpdates(_0x1c55aa,_0x2ce2ee){return function(_0x2cd65e){if(_0x2cd65e){return _0x2cd65e[_0x0221('0x24')](_0x1c55aa)[_0x0221('0x25')](function(_0x3e67e9){return _0x3e67e9;});}return null;};}function removeEntity(_0x846b4f,_0x4d8688){return function(_0x158229){if(_0x158229){return _0x158229[_0x0221('0x26')]()[_0x0221('0x25')](function(){_0x846b4f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17675b,_0x31f299){return function(_0xb4b2cc){if(!_0xb4b2cc){_0x17675b[_0x0221('0x17')](0x194);}return _0xb4b2cc;};}function handleError(_0x39c20d,_0x1c3de5){_0x1c3de5=_0x1c3de5||0x1f4;return function(_0x160ff3){logger[_0x0221('0x27')](_0x160ff3[_0x0221('0x28')]);if(_0x160ff3[_0x0221('0x29')]){delete _0x160ff3[_0x0221('0x29')];}_0x39c20d['status'](_0x1c3de5)[_0x0221('0x2a')](_0x160ff3);};}exports[_0x0221('0x2b')]=function(_0x1e683e,_0xb2f1a4){var _0x3eb123={},_0xaa093d={},_0x25f8d7={'count':0x0,'rows':[]};var _0x4d51c0=_[_0x0221('0x2c')](db['VoiceRecording']['rawAttributes'],function(_0x43220c){return{'name':_0x43220c[_0x0221('0x2d')],'type':_0x43220c[_0x0221('0x2e')][_0x0221('0x2f')]};});_0xaa093d['model']=_[_0x0221('0x30')](_[_0x0221('0x2c')](_0x4d51c0,'name'),[_0x0221('0x31')]);_0xaa093d[_0x0221('0x32')]=_[_0x0221('0x33')](_0x1e683e[_0x0221('0x32')]);_0xaa093d['filters']=_[_0x0221('0x34')](_0xaa093d['model'],_0xaa093d[_0x0221('0x32')]);_0x3eb123[_0x0221('0x35')]=_[_0x0221('0x34')](_0xaa093d[_0x0221('0x36')],qs['fields'](_0x1e683e[_0x0221('0x32')]['fields']));_0x3eb123[_0x0221('0x35')]=_0x3eb123['attributes'][_0x0221('0x37')]?_0x3eb123['attributes']:_0xaa093d[_0x0221('0x36')];if(!_0x1e683e['query'][_0x0221('0x38')]('nolimit')){_0x3eb123['limit']=qs[_0x0221('0x1b')](_0x1e683e[_0x0221('0x32')][_0x0221('0x1b')]);_0x3eb123[_0x0221('0x1d')]=qs[_0x0221('0x1d')](_0x1e683e[_0x0221('0x32')][_0x0221('0x1d')]);}_0x3eb123[_0x0221('0x39')]=qs['sort'](_0x1e683e['query']['sort']);_0x3eb123['where']=qs[_0x0221('0x3a')](_[_0x0221('0x3b')](_0x1e683e[_0x0221('0x32')],_0xaa093d[_0x0221('0x3a')]),_0x4d51c0);if(_0x1e683e['query'][_0x0221('0x3c')]){_0x3eb123[_0x0221('0x3d')]=_['merge'](_0x3eb123['where'],{'$or':_[_0x0221('0x2c')](_0x4d51c0,function(_0x2f5eaa){if(_0x2f5eaa[_0x0221('0x2e')]!==_0x0221('0x3e')){var _0x37af66={};_0x37af66[_0x2f5eaa[_0x0221('0x29')]]={'$like':'%'+_0x1e683e[_0x0221('0x32')][_0x0221('0x3c')]+'%'};return _0x37af66;}})});}_0x3eb123=_[_0x0221('0x3f')]({},_0x3eb123,_0x1e683e['options']);var _0xc3fea2={'where':_0x3eb123[_0x0221('0x3d')]};return db[_0x0221('0x40')][_0x0221('0x1c')](_0xc3fea2)['then'](function(_0x4717aa){_0x25f8d7[_0x0221('0x1c')]=_0x4717aa;if(_0x1e683e[_0x0221('0x32')][_0x0221('0x41')]){_0x3eb123['include']=[{'all':!![]}];}return db[_0x0221('0x40')][_0x0221('0x42')](_0x3eb123);})['then'](function(_0x1c065f){_0x25f8d7[_0x0221('0x43')]=_0x1c065f;return _0x25f8d7;})[_0x0221('0x25')](respondWithFilteredResult(_0xb2f1a4,_0x3eb123))[_0x0221('0x44')](handleError(_0xb2f1a4,null));};exports[_0x0221('0x45')]=function(_0x2743df,_0xc20dbb){var _0x39ed55={'raw':![],'where':{'id':_0x2743df[_0x0221('0x46')]['id']}},_0x508dd6={};_0x508dd6['model']=_[_0x0221('0x33')](db[_0x0221('0x40')]['rawAttributes']);_0x508dd6[_0x0221('0x32')]=_[_0x0221('0x33')](_0x2743df['query']);_0x508dd6[_0x0221('0x3a')]=_[_0x0221('0x34')](_0x508dd6[_0x0221('0x36')],_0x508dd6[_0x0221('0x32')]);_0x39ed55[_0x0221('0x35')]=_[_0x0221('0x34')](_0x508dd6[_0x0221('0x36')],qs[_0x0221('0x47')](_0x2743df[_0x0221('0x32')][_0x0221('0x47')]));_0x39ed55[_0x0221('0x35')]=_0x39ed55[_0x0221('0x35')][_0x0221('0x37')]?_0x39ed55[_0x0221('0x35')]:_0x508dd6[_0x0221('0x36')];if(_0x2743df[_0x0221('0x32')][_0x0221('0x41')]){_0x39ed55[_0x0221('0x48')]=[{'all':!![]}];}_0x39ed55=_['merge']({},_0x39ed55,_0x2743df[_0x0221('0x49')]);return db[_0x0221('0x40')]['find'](_0x39ed55)[_0x0221('0x25')](handleEntityNotFound(_0xc20dbb,null))[_0x0221('0x25')](respondWithResult(_0xc20dbb,null))['catch'](handleError(_0xc20dbb,null));};exports[_0x0221('0x4a')]=function(_0x2c14b3,_0x15033c){return db['VoiceRecording'][_0x0221('0x4a')](_0x2c14b3['body'],{})[_0x0221('0x25')](respondWithResult(_0x15033c,0xc9))[_0x0221('0x44')](handleError(_0x15033c,null));};exports['update']=function(_0x1a0381,_0x9e069c){if(_0x1a0381[_0x0221('0x4b')]['id']){delete _0x1a0381[_0x0221('0x4b')]['id'];}return db[_0x0221('0x40')]['find']({'where':{'id':_0x1a0381[_0x0221('0x46')]['id']}})[_0x0221('0x25')](handleEntityNotFound(_0x9e069c,null))[_0x0221('0x25')](saveUpdates(_0x1a0381[_0x0221('0x4b')],null))['then'](respondWithResult(_0x9e069c,null))[_0x0221('0x44')](handleError(_0x9e069c,null));};exports['describe']=function(_0x596a56,_0x215a87){return db[_0x0221('0x40')][_0x0221('0x4c')]()['then'](respondWithResult(_0x215a87,null))[_0x0221('0x44')](handleError(_0x215a87,null));};exports[_0x0221('0x4d')]=function(_0x3d8422,_0x43c726,_0x299237){var _0x652a7d=require(_0x0221('0x4e'));var _0x12eec1=![];var _0x2f82c0={};if(_0x3d8422[_0x0221('0x32')][_0x0221('0x2e')]&&_0x3d8422[_0x0221('0x32')][_0x0221('0x2e')]===_0x0221('0x4f')){_0x2f82c0['uniqueid']=_0x3d8422[_0x0221('0x46')]['id'];}else{_0x2f82c0['id']=_0x3d8422[_0x0221('0x46')]['id'];}return db[_0x0221('0x40')][_0x0221('0x50')]({'where':_0x2f82c0,'attributes':['id',_0x0221('0x51')],'raw':!![]})[_0x0221('0x25')](handleEntityNotFound(_0x43c726,null))['then'](function(_0x4b888c){if(_0x4b888c){var _0x392b69=_0x4b888c[_0x0221('0x51')];var _0x3cf263=util['format'](_0x0221('0x52'),_0x392b69);if(fs[_0x0221('0x53')](_0x3cf263)){_0x12eec1=!![];return _0x652a7d[_0x0221('0x54')](_0x3cf263,_0x392b69,config['secrets'][_0x0221('0x55')])[_0x0221('0x25')](function(){return _0x4b888c;});}return _0x4b888c;}})[_0x0221('0x25')](function(_0x4236a7){if(_0x4236a7){var _0x5abd42=_0x4236a7[_0x0221('0x51')];if(!fs[_0x0221('0x53')](_0x5abd42)){throw new db[(_0x0221('0x56'))][(_0x0221('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x4236a7['filename']){return _0x43c726[_0x0221('0x4d')](_0x5abd42,_0x4236a7[_0x0221('0x58')]+path[_0x0221('0x59')](_0x5abd42),function(){if(_0x12eec1){fs[_0x0221('0x5a')](_0x5abd42);}});}else{return _0x43c726[_0x0221('0x4d')](_0x5abd42,function(_0x5d1df5){if(_0x12eec1){fs[_0x0221('0x5a')](_0x5abd42);}});}}})[_0x0221('0x44')](function(_0x5da57a){if(_0x5da57a[_0x0221('0x5b')]===_0x0221('0x5c')){_0x43c726[_0x0221('0x18')](0x194)[_0x0221('0x2a')](_0x0221('0x5d'));}else{return handleError(_0x43c726,null);}});};exports['downloads']=function(_0x2cbb77,_0x37d3a3,_0xd62283){var _0x4930e9=require('../../components/encryptor');var _0x2dacdd=![];var _0x1a5f08={'$and':[db[_0x0221('0x5e')][_0x0221('0x3d')](db[_0x0221('0x5e')]['fn'](_0x0221('0x5f'),db[_0x0221('0x5e')][_0x0221('0x60')](_0x0221('0x4f'))),_0x2cbb77['query'][_0x0221('0x61')])]};if(_0x2cbb77['query']['type']&&_0x2cbb77[_0x0221('0x32')][_0x0221('0x2e')]===_0x0221('0x4f')){_0x1a5f08['$and'][_0x0221('0x62')]({'uniqueid':_0x2cbb77['params']['id']});}else{_0x1a5f08[_0x0221('0x63')]['push']({'id':_0x2cbb77['params']['id']});}return db['VoiceRecording']['find']({'where':_0x1a5f08,'attributes':['id',_0x0221('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x37d3a3,null))[_0x0221('0x25')](function(_0x56befd){if(_0x56befd){var _0x2c4868=util[_0x0221('0x31')](_0x0221('0x52'),_0x56befd[_0x0221('0x51')]);if(fs[_0x0221('0x53')](_0x2c4868)){_0x2dacdd=!![];return _0x4930e9['decryptFile'](_0x2c4868,_0x56befd[_0x0221('0x51')],config[_0x0221('0x64')][_0x0221('0x55')])[_0x0221('0x25')](function(){return _0x56befd;});}return _0x56befd;}})[_0x0221('0x25')](function(_0x341cb4){if(_0x341cb4){if(!fs[_0x0221('0x53')](_0x341cb4[_0x0221('0x51')])){throw new db[(_0x0221('0x56'))]['ValidationError'](_0x0221('0x5c'));}if(_0x341cb4[_0x0221('0x58')]){return _0x37d3a3['download'](_0x341cb4[_0x0221('0x51')],_0x341cb4[_0x0221('0x58')]+path[_0x0221('0x59')](_0x341cb4[_0x0221('0x51')]),function(){if(_0x2dacdd){fs['unlink'](_0x341cb4[_0x0221('0x51')]);}});}else{return _0x37d3a3[_0x0221('0x4d')](_0x341cb4[_0x0221('0x51')],function(_0x10034d){if(_0x2dacdd){fs[_0x0221('0x5a')](_0x341cb4[_0x0221('0x51')]);}});}}})[_0x0221('0x44')](handleError(_0x37d3a3,null));};exports[_0x0221('0x26')]=function(_0x39e7bd,_0x4b2803){return db['VoiceRecording'][_0x0221('0x50')]({'where':{'id':_0x39e7bd[_0x0221('0x46')]['id']}})['then'](function(_0x35f2bb){if(_[_0x0221('0x65')](_0x35f2bb)){throw new ReferenceError(_0x0221('0x66'));}return _0x35f2bb;})[_0x0221('0x25')](function(_0xd41cf3){var _0x5633c7=_0xd41cf3[_0x0221('0x51')];logger[_0x0221('0x67')](_0x0221('0x68'),_0x5633c7);if(!_[_0x0221('0x65')](_0xd41cf3[_0x0221('0x51')])&&fs[_0x0221('0x53')](_0x5633c7)){logger[_0x0221('0x67')](_0x0221('0x69')+_0x5633c7+_0x0221('0x6a'));fs[_0x0221('0x6b')](_0x5633c7);}_0x5633c7=_0x5633c7+_0x0221('0x6c');if(!_['isNil'](_0xd41cf3['value'])&&fs[_0x0221('0x53')](_0x5633c7)){logger[_0x0221('0x67')]('File:\x20\x22'+_0x5633c7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0221('0x6b')](_0x5633c7);}return _0xd41cf3;})['then'](function(_0x3b4a8f){if(!_0x3b4a8f)throw new InternalError();return _0x3b4a8f['destroy']();})[_0x0221('0x25')](function(){_0x4b2803[_0x0221('0x18')](0xcc)[_0x0221('0x19')]();})[_0x0221('0x44')](handleError(_0x4b2803,null));};function getBucketslist(_0x18fcd1,_0xcfccaf,_0x1278e1){return new Promise(function(_0xf0ea36,_0x549de7){var _0x572e1d=new AWS['S3']({'accessKeyId':_0xcfccaf,'secretAccessKey':_0x18fcd1,'region':_0x1278e1});_0x572e1d[_0x0221('0x6d')]({},function(_0x419f5f,_0x19767f){if(_0x419f5f){return _0x549de7(_0x419f5f);}else{return _0xf0ea36(_0x19767f);}});});}function createBucket(_0x109c40,_0x548cab,_0x216973,_0x59bc5b){return new Promise(function(_0x54ed29,_0x5e5f95){var _0x52bb7c=new AWS['S3']({'accessKeyId':_0x548cab,'secretAccessKey':_0x109c40,'region':_0x216973});_0x52bb7c[_0x0221('0x6e')]({'Bucket':_0x59bc5b},function(_0x2f05a2,_0x14b4af){if(_0x2f05a2){return _0x5e5f95(_0x2f05a2);}else{return _0x54ed29(_0x14b4af);}});});}function uploadFile(_0x1ca2ef,_0x49e3f0,_0x29031a,_0x3c8dae,_0x3f2f95,_0x4ea2a1){return new Promise(function(_0xfdcb2f,_0x401f8e){var _0x4fd083=new AWS['S3']({'accessKeyId':_0x49e3f0,'secretAccessKey':_0x1ca2ef,'region':_0x29031a});_0x4fd083['upload']({'Bucket':_0x3c8dae,'Key':_0x3f2f95,'Body':_0x4ea2a1},function(_0x48c741,_0x4caa25){if(_0x48c741){return _0x401f8e(_0x48c741);}else{return _0xfdcb2f(_0x4caa25);}});});}function startTranscribe(_0x102d0d,_0x18a7ff,_0x19f15f,_0x1375a7,_0x188d92,_0x3d777a){return new Promise(function(_0x127fd4,_0x470722){var _0x54c95c=new AWS['TranscribeService']({'accessKeyId':_0x18a7ff,'secretAccessKey':_0x102d0d,'region':_0x19f15f});_0x54c95c[_0x0221('0x6f')]({'TranscriptionJobName':_0x1375a7,'LanguageCode':_0x188d92,'Media':{'MediaFileUri':_0x3d777a}},function(_0x429d73,_0x37fa86){if(_0x429d73){return _0x470722(_0x429d73);}else{return _0x127fd4(_0x37fa86);}});});}function transcribe(_0x473511,_0x50e109,_0xfb0ab,_0x4b392e,_0x1f1169,_0x138995,_0x4273a7){return new Promise(function(_0x143385,_0x649fe1){var _0x27e6ba={};logger[_0x0221('0x67')](util[_0x0221('0x31')](_0x0221('0x70'),_0x473511,_0x1f1169));return uploadFile(_0x50e109,_0xfb0ab,_0x4b392e,_0x1f1169,path['basename'](_0x138995),fs[_0x0221('0x71')](_0x138995))[_0x0221('0x25')](function(_0xb9d442){logger[_0x0221('0x67')](util[_0x0221('0x31')](_0x0221('0x72'),_0x473511,_0x1f1169,_0xb9d442[_0x0221('0x73')]));_0x27e6ba[_0x0221('0x74')]=_0xb9d442[_0x0221('0x75')];_0x27e6ba['location']=_0xb9d442[_0x0221('0x73')];logger[_0x0221('0x67')](util[_0x0221('0x31')](_0x0221('0x76'),_0x473511));return startTranscribe(_0x50e109,_0xfb0ab,_0x4b392e,uuidv4(),_0x4273a7,_0xb9d442[_0x0221('0x73')]);})[_0x0221('0x25')](function(_0x426819){logger[_0x0221('0x67')](util['format'](_0x0221('0x77'),_0x473511,_0x426819[_0x0221('0x78')][_0x0221('0x79')]));_0x27e6ba[_0x0221('0x7a')]=_0x426819[_0x0221('0x78')][_0x0221('0x79')];_0x27e6ba[_0x0221('0x7b')]=_0x426819[_0x0221('0x78')]['TranscriptionJobStatus'];return _0x143385(_0x27e6ba);})['catch'](function(_0x2ffb36){return _0x649fe1(_0x2ffb36);});});}exports[_0x0221('0x7c')]=function(_0x2bc18d,_0x13a936,_0x143e67){var _0x679c8a;var _0x4e727e;var _0x272197;var _0x5ba861=require(_0x0221('0x4e'));return db[_0x0221('0x40')][_0x0221('0x7d')]({'where':{'id':_0x2bc18d[_0x0221('0x46')]['id']}})[_0x0221('0x25')](function(_0x119fe5){if(_0x119fe5){var _0x4210dc=util[_0x0221('0x31')](_0x0221('0x52'),_0x119fe5[_0x0221('0x51')]);if(fs[_0x0221('0x53')](_0x4210dc)){cypher=!![];return _0x5ba861[_0x0221('0x54')](_0x4210dc,_0x119fe5[_0x0221('0x51')],config[_0x0221('0x64')][_0x0221('0x55')])['then'](function(){return _0x119fe5;});}return _0x119fe5;}})[_0x0221('0x25')](function(_0x376b69){if(!_0x376b69){throw new db['Sequelize'][(_0x0221('0x57'))](_0x0221('0x7e'));}_0x4e727e=_0x376b69;return db['Setting'][_0x0221('0x7d')]({'where':{'id':0x1}});})[_0x0221('0x25')](handleEntityNotFound(_0x13a936,null))[_0x0221('0x25')](function(_0xbe2d20){if(_0xbe2d20){_0x679c8a=_0xbe2d20;if(!_0x679c8a[_0x0221('0x7f')]||!_0x679c8a[_0x0221('0x80')]||!_0x679c8a[_0x0221('0x81')]||!_0x679c8a[_0x0221('0x82')]||!_0x679c8a[_0x0221('0x74')]){throw new db['Sequelize'][(_0x0221('0x57'))](_0x0221('0x83'));}if(_0x2bc18d['body'][_0x0221('0x84')]&&(!_0x679c8a[_0x0221('0x85')]||!_0x679c8a['sentimentAccountId']||!_0x679c8a['sentimentRegion']||!_0x679c8a[_0x0221('0x82')]||!_0x679c8a[_0x0221('0x74')])){throw new db[(_0x0221('0x56'))][(_0x0221('0x57'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x0221('0x7d')]({'where':{'id':_0x679c8a[_0x0221('0x80')]}});}})[_0x0221('0x25')](function(_0x2becc4){if(!_0x2becc4){throw new db['Sequelize']['ValidationError'](_0x0221('0x86'));}if(!_0x2becc4[_0x0221('0x87')]||!_0x2becc4[_0x0221('0x88')]){throw new db[(_0x0221('0x56'))][(_0x0221('0x57'))](_0x0221('0x89'));}_0x272197=_0x2becc4;return getBucketslist(_0x272197[_0x0221('0x87')],_0x272197[_0x0221('0x88')],_0x679c8a['transcribeRegion']);})[_0x0221('0x25')](function(_0xb33ed1){if(_0xb33ed1&&_0xb33ed1[_0x0221('0x8a')]){var _0x33e30b=_[_0x0221('0x50')](_0xb33ed1['Buckets'],function(_0xdc9134){return _0xdc9134[_0x0221('0x8b')]===_0x679c8a[_0x0221('0x74')];});if(!_0x33e30b){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x2bc18d['params']['id'],_0x679c8a[_0x0221('0x74')]));return createBucket(_0x272197[_0x0221('0x87')],_0x272197[_0x0221('0x88')],_0x679c8a['transcribeRegion'],_0x679c8a['bucket']);}logger['info'](util[_0x0221('0x31')](_0x0221('0x8c'),_0x2bc18d['params']['id'],_0x679c8a['bucket']));return;}})[_0x0221('0x25')](function(_0x35f3d0){if(_0x4e727e[_0x0221('0x7b')]==='NEW'){return transcribe(_0x2bc18d[_0x0221('0x46')]['id'],_0x272197[_0x0221('0x87')],_0x272197[_0x0221('0x88')],_0x679c8a['transcribeRegion'],_0x679c8a[_0x0221('0x74')],_0x4e727e[_0x0221('0x51')],_0x679c8a[_0x0221('0x82')]);}else{logger['info'](util[_0x0221('0x31')](_0x0221('0x8d'),_0x2bc18d[_0x0221('0x46')]['id']));return{'transcribeStatus':_0x0221('0x8e')};}})[_0x0221('0x25')](function(_0x3c5c46){if(_0x3c5c46){_0x3c5c46['tempSentiment']=_0x2bc18d[_0x0221('0x4b')][_0x0221('0x84')];return _0x4e727e['updateAttributes'](_0x3c5c46);}})[_0x0221('0x25')](respondWithResult(_0x13a936,null))[_0x0221('0x44')](handleError(_0x13a936,null));};function writeFile(_0x1f9ca8,_0x273b43){return new Promise(function(_0x16266b,_0x2587ae){fs[_0x0221('0x8f')](_0x273b43,_0x1f9ca8,function(_0x3cdcf4,_0xd30717){if(_0x3cdcf4){return _0x2587ae(_0x3cdcf4);}else{return _0x16266b(_0xd30717);}});});}exports['downloadTranscribe']=function(_0x164256,_0xeeebfe,_0x42c9f1){return db['VoiceRecording']['findOne']({'where':{'id':_0x164256[_0x0221('0x46')]['id']}})[_0x0221('0x25')](handleEntityNotFound(_0xeeebfe))[_0x0221('0x25')](function(_0x322af9){if(_0x322af9&&_0x322af9['fileText']){var _0x5bba99=_0x322af9[_0x0221('0x90')];var _0x3ebbb5=config[_0x0221('0x91')]+_0x0221('0x92')+_0x322af9['id']+_0x0221('0x93');if(fs[_0x0221('0x53')](_0x3ebbb5)){return _0x3ebbb5;}return writeFile(_0x5bba99,_0x3ebbb5)[_0x0221('0x25')](function(){return _0x3ebbb5;});}else{throw new db[(_0x0221('0x56'))][(_0x0221('0x57'))](_0x0221('0x94'));}})[_0x0221('0x25')](function(_0xed2384){return _0xeeebfe[_0x0221('0x4d')](_0xed2384);})['catch'](handleError(_0xeeebfe));};
\ No newline at end of file
index d4fac98..9449bcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236c=['rimraf','./voiceRecording.attributes','exports','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x236c,0x164));var _0xc236=function(_0x171dfd,_0x10161e){_0x171dfd=_0x171dfd-0x0;var _0x3dc393=_0x236c[_0x171dfd];return _0x3dc393;};'use strict';var _=require(_0xc236('0x0'));var util=require(_0xc236('0x1'));var logger=require(_0xc236('0x2'))(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var rp=require(_0xc236('0x6'));var fs=require('fs');var path=require(_0xc236('0x7'));var rimraf=require(_0xc236('0x8'));var config=require('../../config/environment');var attributes=require(_0xc236('0x9'));module[_0xc236('0xa')]=function(_0x1ec0f3,_0xf7909f){return _0x1ec0f3['define']('VoiceRecording',attributes,{'tableName':_0xc236('0xb'),'paranoid':![],'indexes':[{'name':_0xc236('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8897=['../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x50da5d,_0x1b620c){var _0x27a6ba=function(_0x91c625){while(--_0x91c625){_0x50da5d['push'](_0x50da5d['shift']());}};_0x27a6ba(++_0x1b620c);}(_0x8897,0x132));var _0x7889=function(_0x2aeb75,_0x47bc3d){_0x2aeb75=_0x2aeb75-0x0;var _0x2838be=_0x8897[_0x2aeb75];return _0x2838be;};'use strict';var _=require(_0x7889('0x0'));var util=require(_0x7889('0x1'));var logger=require(_0x7889('0x2'))(_0x7889('0x3'));var moment=require(_0x7889('0x4'));var BPromise=require(_0x7889('0x5'));var rp=require(_0x7889('0x6'));var fs=require('fs');var path=require(_0x7889('0x7'));var rimraf=require(_0x7889('0x8'));var config=require(_0x7889('0x9'));var attributes=require(_0x7889('0xa'));module[_0x7889('0xb')]=function(_0x3c30d7,_0x840398){return _0x3c30d7[_0x7889('0xc')](_0x7889('0xd'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x7889('0xe'),'fields':[_0x7889('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 3581bff..7dc03a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb11=['update','body','options','where','attributes','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xfb11[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}exports[_0x1fb1('0x14')]=function(_0x24d4df){var _0x34076b=this;return new Promise(function(_0x33c6b6,_0x27d71f){return db[_0x1fb1('0x15')][_0x1fb1('0x16')](_0x24d4df[_0x1fb1('0x17')],{'raw':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')][_0x1fb1('0x19')]||null:null,'attributes':_0x24d4df[_0x1fb1('0x18')]?_0x24d4df['options'][_0x1fb1('0x1a')]||null:null,'limit':_0x24d4df['options']?_0x24d4df['options']['limit']||null:null})[_0x1fb1('0xa')](function(_0x1f8e5a){logger[_0x1fb1('0xb')](_0x1fb1('0x14'),_0x24d4df);logger[_0x1fb1('0x1b')]('UpdateVoiceRecording',_0x24d4df,JSON[_0x1fb1('0xf')](_0x1f8e5a));_0x33c6b6(_0x1f8e5a);})[_0x1fb1('0x13')](function(_0x1dc03f){logger[_0x1fb1('0x10')](_0x1fb1('0x14'),_0x1dc03f[_0x1fb1('0x12')],_0x24d4df);_0x27d71f(_0x34076b[_0x1fb1('0x10')](0x1f4,_0x1dc03f[_0x1fb1('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x1b25b3){var _0x1aac7d=this;return new Promise(function(_0x46ff60,_0xc5188b){var _0x1898e7=require(_0x1fb1('0x1c'));var _0x1a74c4;return db[_0x1fb1('0x1d')][_0x1fb1('0x1e')]({'attributes':['id',_0x1fb1('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x1fb1('0xa')](function(_0x497017){_0x1a74c4=_0x497017;return db[_0x1fb1('0x15')][_0x1fb1('0x20')](_0x1b25b3[_0x1fb1('0x17')]);})['then'](function(_0x106134){if(_0x1a74c4[_0x1fb1('0x1f')]&&fs[_0x1fb1('0x21')](_0x106134[_0x1fb1('0x22')])){var _0x5402e9=util[_0x1fb1('0x23')](_0x1fb1('0x24'),_0x106134['value']);return _0x1898e7[_0x1fb1('0x25')](_0x106134['value'],_0x5402e9,config['secrets'][_0x1fb1('0x26')])[_0x1fb1('0xa')](function(){fs['unlink'](_0x106134[_0x1fb1('0x22')]);logger[_0x1fb1('0xb')](_0x1fb1('0x27'));return _0x106134;});}return _0x106134;})[_0x1fb1('0xa')](function(_0x32d797){logger['info'](_0x1fb1('0x28'),_0x1b25b3);logger[_0x1fb1('0x1b')](_0x1fb1('0x28'),_0x1b25b3,JSON[_0x1fb1('0xf')](_0x32d797));_0x46ff60(_0x32d797);})[_0x1fb1('0x13')](function(_0x307700){logger[_0x1fb1('0x10')](_0x1fb1('0x28'),_0x307700[_0x1fb1('0x12')],_0x1b25b3);_0xc5188b(_0x1aac7d['error'](0x1f4,_0x307700[_0x1fb1('0x12')]));});});};
\ No newline at end of file
+var _0x47c5=['secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceRecording','update','body','options','raw','where','attributes','limit','UpdateVoiceRecording','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher'];(function(_0x5c1798,_0x3e5405){var _0x14995e=function(_0x3f9ad5){while(--_0x3f9ad5){_0x5c1798['push'](_0x5c1798['shift']());}};_0x14995e(++_0x3e5405);}(_0x47c5,0x165));var _0x547c=function(_0x33ab57,_0x449de8){_0x33ab57=_0x33ab57-0x0;var _0x3af8ce=_0x47c5[_0x33ab57];return _0x3af8ce;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['UpdateVoiceRecording']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23fa9e['options']?_0x23fa9e['options'][_0x547c('0x1d')]||null:null,'attributes':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1e')]||null:null,'limit':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1f')]||null:null})[_0x547c('0xc')](function(_0x436e67){logger['info'](_0x547c('0x20'),_0x23fa9e);logger[_0x547c('0x10')](_0x547c('0x20'),_0x23fa9e,JSON[_0x547c('0x12')](_0x436e67));_0xeb059e(_0x436e67);})[_0x547c('0x17')](function(_0x2663bc){logger[_0x547c('0x13')](_0x547c('0x20'),_0x2663bc['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2663bc['message']));});});};exports['CreateVoiceRecording']=function(_0x4855fd){var _0x478f04=this;return new Promise(function(_0x2c725d,_0x4c5256){var _0x93985c=require('../../components/encryptor');var _0x3ea493;return db['Setting'][_0x547c('0x21')]({'attributes':['id',_0x547c('0x22')],'where':{'id':0x1},'raw':!![]})[_0x547c('0xc')](function(_0x30a96c){_0x3ea493=_0x30a96c;return db[_0x547c('0x18')]['create'](_0x4855fd['body']);})[_0x547c('0xc')](function(_0x54de6f){if(_0x3ea493[_0x547c('0x22')]&&fs[_0x547c('0x23')](_0x54de6f[_0x547c('0x24')])){var _0x1695be=util[_0x547c('0x25')](_0x547c('0x26'),_0x54de6f[_0x547c('0x24')]);return _0x93985c['encryptFile'](_0x54de6f['value'],_0x1695be,config[_0x547c('0x27')][_0x547c('0x28')])[_0x547c('0xc')](function(){fs[_0x547c('0x29')](_0x54de6f[_0x547c('0x24')]);logger[_0x547c('0xd')](_0x547c('0x2a'));return _0x54de6f;});}return _0x54de6f;})[_0x547c('0xc')](function(_0x378bac){logger[_0x547c('0xd')](_0x547c('0x2b'),_0x4855fd);logger[_0x547c('0x10')](_0x547c('0x2b'),_0x4855fd,JSON[_0x547c('0x12')](_0x378bac));_0x2c725d(_0x378bac);})['catch'](function(_0x3afc28){logger['error']('CreateVoiceRecording',_0x3afc28['message'],_0x4855fd);_0x4c5256(_0x478f04[_0x547c('0x13')](0x1f4,_0x3afc28[_0x547c('0x15')]));});});};
\ No newline at end of file
index 8725f95..b7d6627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47ad=['isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x47ad,0x7c));var _0xd47a=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0x47ad[_0x12d951];return _0x44de17;};'use strict';var multer=require(_0xd47a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd47a('0x1'));var express=require(_0xd47a('0x2'));var router=express['Router']();var fs_extra=require(_0xd47a('0x3'));var auth=require(_0xd47a('0x4'));var interaction=require(_0xd47a('0x5'));var config=require(_0xd47a('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xd47a('0x7')]('/',auth['isAuthenticated'](),controller[_0xd47a('0x8')]);router[_0xd47a('0x7')]('/describe',auth[_0xd47a('0x9')](),controller[_0xd47a('0xa')]);router['get'](_0xd47a('0xb'),auth[_0xd47a('0x9')](),controller[_0xd47a('0xc')]);router[_0xd47a('0xd')]('/',auth[_0xd47a('0x9')](),controller['create']);router[_0xd47a('0xe')](_0xd47a('0xb'),auth['isAuthenticated'](),controller[_0xd47a('0xf')]);router[_0xd47a('0x10')](_0xd47a('0xb'),auth['isAuthenticated'](),controller[_0xd47a('0x11')]);module[_0xd47a('0x12')]=router;
\ No newline at end of file
+var _0x0619=['./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0619,0x1c5));var _0x9061=function(_0x455928,_0x3e6950){_0x455928=_0x455928-0x0;var _0x484223=_0x0619[_0x455928];return _0x484223;};'use strict';var multer=require('multer');var util=require(_0x9061('0x0'));var path=require(_0x9061('0x1'));var timeout=require(_0x9061('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9061('0x3'));var auth=require(_0x9061('0x4'));var interaction=require(_0x9061('0x5'));var config=require(_0x9061('0x6'));var controller=require(_0x9061('0x7'));router[_0x9061('0x8')]('/',auth[_0x9061('0x9')](),controller['index']);router[_0x9061('0x8')](_0x9061('0xa'),auth[_0x9061('0x9')](),controller[_0x9061('0xb')]);router['get'](_0x9061('0xc'),auth[_0x9061('0x9')](),controller[_0x9061('0xd')]);router[_0x9061('0xe')]('/',auth[_0x9061('0x9')](),controller[_0x9061('0xf')]);router[_0x9061('0x10')](_0x9061('0xc'),auth['isAuthenticated'](),controller[_0x9061('0x11')]);router[_0x9061('0x12')](_0x9061('0xc'),auth[_0x9061('0x9')](),controller['destroy']);module[_0x9061('0x13')]=router;
\ No newline at end of file
index 5ff1a78..352aff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcee2=['sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x49e6db,_0x1a4546){var _0x5a6137=function(_0xcf3ed9){while(--_0xcf3ed9){_0x49e6db['push'](_0x49e6db['shift']());}};_0x5a6137(++_0x1a4546);}(_0xcee2,0x7e));var _0x2cee=function(_0x3ecdbb,_0x5577f8){_0x3ecdbb=_0x3ecdbb-0x0;var _0x494065=_0xcee2[_0x3ecdbb];return _0x494065;};'use strict';var Sequelize=require(_0x2cee('0x0'));var moment=require(_0x2cee('0x1'));module[_0x2cee('0x2')]={'type':{'type':Sequelize[_0x2cee('0x3')](_0x2cee('0x4'),_0x2cee('0x5'))},'result':{'type':Sequelize[_0x2cee('0x6')]},'transfererchannel':{'type':Sequelize[_0x2cee('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x2cee('0x6')]},'transferercalleridname':{'type':Sequelize[_0x2cee('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2cee('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x2cee('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x2cee('0x6')]},'transferercontext':{'type':Sequelize[_0x2cee('0x6')]},'transfererexten':{'type':Sequelize[_0x2cee('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x2cee('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x2cee('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x2cee('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x2cee('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x2cee('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x2cee('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x2cee('0x6')]},'isexternal':{'type':Sequelize[_0x2cee('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x2cee('0x6')]},'extension':{'type':Sequelize[_0x2cee('0x6')]}};
\ No newline at end of file
+var _0xc101=['Yes','sequelize','exports','ENUM','blind','STRING'];(function(_0x20b453,_0x40d694){var _0xcfd1cf=function(_0x68acf6){while(--_0x68acf6){_0x20b453['push'](_0x20b453['shift']());}};_0xcfd1cf(++_0x40d694);}(_0xc101,0xcd));var _0x1c10=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xc101[_0x595013];return _0x2a29e3;};'use strict';var Sequelize=require(_0x1c10('0x0'));var moment=require('moment');module[_0x1c10('0x1')]={'type':{'type':Sequelize[_0x1c10('0x2')](_0x1c10('0x3'),'attended')},'result':{'type':Sequelize[_0x1c10('0x4')]},'transfererchannel':{'type':Sequelize[_0x1c10('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1c10('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1c10('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1c10('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1c10('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1c10('0x4')]},'transfererexten':{'type':Sequelize[_0x1c10('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1c10('0x4')]},'transfereechannel':{'type':Sequelize[_0x1c10('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1c10('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x1c10('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1c10('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1c10('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x1c10('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x1c10('0x4')]},'isexternal':{'type':Sequelize[_0x1c10('0x2')](_0x1c10('0x5'),'No')},'context':{'type':Sequelize[_0x1c10('0x4')]},'extension':{'type':Sequelize[_0x1c10('0x4')]}};
\ No newline at end of file
index 0265a9f..cbea810 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadd9=['stack','name','index','map','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VoiceTransferReport','include','catch','show','params','keys','rawAttributes','includeAll','find','body','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error'];(function(_0x1602ea,_0x11ada9){var _0x21f447=function(_0x31f49e){while(--_0x31f49e){_0x1602ea['push'](_0x1602ea['shift']());}};_0x21f447(++_0x11ada9);}(_0xadd9,0x1d0));var _0x9add=function(_0x170bb0,_0x46fd3c){_0x170bb0=_0x170bb0-0x0;var _0x26aa44=_0xadd9[_0x170bb0];return _0x26aa44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9add('0x0'));var zipdir=require(_0x9add('0x1'));var jsonpatch=require(_0x9add('0x2'));var rp=require('request-promise');var moment=require(_0x9add('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9add('0x4'));var path=require('path');var sox=require(_0x9add('0x5'));var csv=require(_0x9add('0x6'));var ejs=require(_0x9add('0x7'));var fs=require('fs');var fs_extra=require(_0x9add('0x8'));var _=require(_0x9add('0x9'));var squel=require(_0x9add('0xa'));var crypto=require(_0x9add('0xb'));var jsforce=require(_0x9add('0xc'));var deskjs=require(_0x9add('0xd'));var toCsv=require(_0x9add('0x6'));var querystring=require(_0x9add('0xe'));var Papa=require(_0x9add('0xf'));var Redis=require(_0x9add('0x10'));var authService=require(_0x9add('0x11'));var qs=require(_0x9add('0x12'));var as=require(_0x9add('0x13'));var hardwareService=require(_0x9add('0x14'));var logger=require(_0x9add('0x15'))(_0x9add('0x16'));var utils=require(_0x9add('0x17'));var config=require(_0x9add('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9add('0x19'))['db'];function respondWithStatusCode(_0x38f6f2,_0x492021){_0x492021=_0x492021||0xcc;return function(_0x41519a){if(_0x41519a){return _0x38f6f2[_0x9add('0x1a')](_0x492021);}return _0x38f6f2[_0x9add('0x1b')](_0x492021)[_0x9add('0x1c')]();};}function respondWithResult(_0x44cf2d,_0x58aaa1){_0x58aaa1=_0x58aaa1||0xc8;return function(_0x3323c4){if(_0x3323c4){return _0x44cf2d[_0x9add('0x1b')](_0x58aaa1)[_0x9add('0x1d')](_0x3323c4);}};}function respondWithFilteredResult(_0x41317a,_0x49f4db){return function(_0x22939a){if(_0x22939a){var _0xd7d50=typeof _0x49f4db[_0x9add('0x1e')]===_0x9add('0x1f')&&typeof _0x49f4db[_0x9add('0x20')]===_0x9add('0x1f');var _0x299e66=_0x22939a['count'];var _0x26dc02=_0xd7d50?0x0:_0x49f4db[_0x9add('0x1e')];var _0x217494=_0xd7d50?_0x22939a[_0x9add('0x21')]:_0x49f4db[_0x9add('0x1e')]+_0x49f4db[_0x9add('0x20')];var _0x2f72d0;if(_0x217494>=_0x299e66){_0x217494=_0x299e66;_0x2f72d0=0xc8;}else{_0x2f72d0=0xce;}_0x41317a['status'](_0x2f72d0);return _0x41317a[_0x9add('0x22')](_0x9add('0x23'),_0x26dc02+'-'+_0x217494+'/'+_0x299e66)[_0x9add('0x1d')](_0x22939a);}return null;};}function patchUpdates(_0x5cfae0){return function(_0x147fa7){try{jsonpatch['apply'](_0x147fa7,_0x5cfae0,!![]);}catch(_0x5d19c2){return BPromise[_0x9add('0x24')](_0x5d19c2);}return _0x147fa7['save']();};}function saveUpdates(_0x4ce51f,_0x22232a){return function(_0x4ac768){if(_0x4ac768){return _0x4ac768['update'](_0x4ce51f)[_0x9add('0x25')](function(_0x23c650){return _0x23c650;});}return null;};}function removeEntity(_0x14d3d6,_0xe77fbb){return function(_0x118aaf){if(_0x118aaf){return _0x118aaf[_0x9add('0x26')]()['then'](function(){_0x14d3d6[_0x9add('0x1b')](0xcc)[_0x9add('0x1c')]();});}};}function handleEntityNotFound(_0x30cb03,_0x35afc4){return function(_0x435659){if(!_0x435659){_0x30cb03['sendStatus'](0x194);}return _0x435659;};}function handleError(_0x12c43,_0x495d1c){_0x495d1c=_0x495d1c||0x1f4;return function(_0x5f1a18){logger[_0x9add('0x27')](_0x5f1a18[_0x9add('0x28')]);if(_0x5f1a18[_0x9add('0x29')]){delete _0x5f1a18[_0x9add('0x29')];}_0x12c43[_0x9add('0x1b')](_0x495d1c)['send'](_0x5f1a18);};}exports[_0x9add('0x2a')]=function(_0x34d23f,_0x5ed7da){var _0x10da81={},_0x3bab85={},_0x4b9387={'count':0x0,'rows':[]};var _0x53b093=_[_0x9add('0x2b')](db['VoiceTransferReport']['rawAttributes'],function(_0x3aebc6){return{'name':_0x3aebc6['fieldName'],'type':_0x3aebc6[_0x9add('0x2c')][_0x9add('0x2d')]};});_0x3bab85[_0x9add('0x2e')]=_[_0x9add('0x2b')](_0x53b093,_0x9add('0x29'));_0x3bab85[_0x9add('0x2f')]=_['keys'](_0x34d23f[_0x9add('0x2f')]);_0x3bab85['filters']=_[_0x9add('0x30')](_0x3bab85['model'],_0x3bab85[_0x9add('0x2f')]);_0x10da81[_0x9add('0x31')]=_[_0x9add('0x30')](_0x3bab85[_0x9add('0x2e')],qs[_0x9add('0x32')](_0x34d23f[_0x9add('0x2f')][_0x9add('0x32')]));_0x10da81[_0x9add('0x31')]=_0x10da81[_0x9add('0x31')][_0x9add('0x33')]?_0x10da81[_0x9add('0x31')]:_0x3bab85[_0x9add('0x2e')];if(!_0x34d23f[_0x9add('0x2f')][_0x9add('0x34')](_0x9add('0x35'))){_0x10da81[_0x9add('0x20')]=qs[_0x9add('0x20')](_0x34d23f[_0x9add('0x2f')][_0x9add('0x20')]);_0x10da81['offset']=qs['offset'](_0x34d23f[_0x9add('0x2f')][_0x9add('0x1e')]);}_0x10da81[_0x9add('0x36')]=qs[_0x9add('0x37')](_0x34d23f[_0x9add('0x2f')][_0x9add('0x37')]);_0x10da81[_0x9add('0x38')]=qs[_0x9add('0x39')](_[_0x9add('0x3a')](_0x34d23f[_0x9add('0x2f')],_0x3bab85[_0x9add('0x39')]),_0x53b093);if(_0x34d23f[_0x9add('0x2f')][_0x9add('0x3b')]){_0x10da81[_0x9add('0x38')]=_[_0x9add('0x3c')](_0x10da81['where'],{'$or':_[_0x9add('0x2b')](_0x53b093,function(_0x390d26){if(_0x390d26[_0x9add('0x2c')]!=='VIRTUAL'){var _0x8131ee={};_0x8131ee[_0x390d26[_0x9add('0x29')]]={'$like':'%'+_0x34d23f[_0x9add('0x2f')][_0x9add('0x3b')]+'%'};return _0x8131ee;}})});}_0x10da81=_[_0x9add('0x3c')]({},_0x10da81,_0x34d23f[_0x9add('0x3d')]);var _0x2160c2={'where':_0x10da81[_0x9add('0x38')]};return db[_0x9add('0x3e')][_0x9add('0x21')](_0x2160c2)[_0x9add('0x25')](function(_0x573288){_0x4b9387[_0x9add('0x21')]=_0x573288;if(_0x34d23f[_0x9add('0x2f')]['includeAll']){_0x10da81[_0x9add('0x3f')]=[{'all':!![]}];}return db[_0x9add('0x3e')]['findAll'](_0x10da81);})[_0x9add('0x25')](function(_0x4fd8b3){_0x4b9387['rows']=_0x4fd8b3;return _0x4b9387;})[_0x9add('0x25')](respondWithFilteredResult(_0x5ed7da,_0x10da81))[_0x9add('0x40')](handleError(_0x5ed7da,null));};exports[_0x9add('0x41')]=function(_0x1fd437,_0x15afdf){var _0x27f5b6={'raw':!![],'where':{'id':_0x1fd437[_0x9add('0x42')]['id']}},_0x454bf2={};_0x454bf2[_0x9add('0x2e')]=_[_0x9add('0x43')](db[_0x9add('0x3e')][_0x9add('0x44')]);_0x454bf2[_0x9add('0x2f')]=_[_0x9add('0x43')](_0x1fd437['query']);_0x454bf2[_0x9add('0x39')]=_[_0x9add('0x30')](_0x454bf2['model'],_0x454bf2[_0x9add('0x2f')]);_0x27f5b6[_0x9add('0x31')]=_[_0x9add('0x30')](_0x454bf2[_0x9add('0x2e')],qs[_0x9add('0x32')](_0x1fd437['query'][_0x9add('0x32')]));_0x27f5b6['attributes']=_0x27f5b6[_0x9add('0x31')][_0x9add('0x33')]?_0x27f5b6[_0x9add('0x31')]:_0x454bf2['model'];if(_0x1fd437[_0x9add('0x2f')][_0x9add('0x45')]){_0x27f5b6['include']=[{'all':!![]}];}_0x27f5b6=_[_0x9add('0x3c')]({},_0x27f5b6,_0x1fd437[_0x9add('0x3d')]);return db[_0x9add('0x3e')][_0x9add('0x46')](_0x27f5b6)['then'](handleEntityNotFound(_0x15afdf,null))[_0x9add('0x25')](respondWithResult(_0x15afdf,null))['catch'](handleError(_0x15afdf,null));};exports['create']=function(_0x2929f4,_0xab482f){return db[_0x9add('0x3e')]['create'](_0x2929f4[_0x9add('0x47')],{})[_0x9add('0x25')](respondWithResult(_0xab482f,0xc9))[_0x9add('0x40')](handleError(_0xab482f,null));};exports['update']=function(_0x98c7df,_0x3dde79){if(_0x98c7df['body']['id']){delete _0x98c7df[_0x9add('0x47')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x98c7df[_0x9add('0x42')]['id']}})['then'](handleEntityNotFound(_0x3dde79,null))['then'](saveUpdates(_0x98c7df[_0x9add('0x47')],null))[_0x9add('0x25')](respondWithResult(_0x3dde79,null))[_0x9add('0x40')](handleError(_0x3dde79,null));};exports[_0x9add('0x26')]=function(_0x4754b5,_0x170bbe){return db[_0x9add('0x3e')][_0x9add('0x46')]({'where':{'id':_0x4754b5[_0x9add('0x42')]['id']}})[_0x9add('0x25')](handleEntityNotFound(_0x170bbe,null))['then'](removeEntity(_0x170bbe,null))[_0x9add('0x40')](handleError(_0x170bbe,null));};exports['describe']=function(_0x7dbc40,_0x1e07f1){return db['VoiceTransferReport']['describe']()[_0x9add('0x25')](respondWithResult(_0x1e07f1,null))[_0x9add('0x40')](handleError(_0x1e07f1,null));};
\ No newline at end of file
+var _0x73cb=['create','body','find','params','describe','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x4d674e,_0xd22186){var _0xe75e4b=function(_0x267e9d){while(--_0x267e9d){_0x4d674e['push'](_0x4d674e['shift']());}};_0xe75e4b(++_0xd22186);}(_0x73cb,0xa3));var _0xb73c=function(_0x27ae04,_0x54e0ec){_0x27ae04=_0x27ae04-0x0;var _0x51e90d=_0x73cb[_0x27ae04];return _0x51e90d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb73c('0x0'));var zipdir=require(_0xb73c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb73c('0x2'));var moment=require(_0xb73c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb73c('0x4'));var util=require(_0xb73c('0x5'));var path=require('path');var sox=require(_0xb73c('0x6'));var csv=require(_0xb73c('0x7'));var ejs=require(_0xb73c('0x8'));var fs=require('fs');var fs_extra=require(_0xb73c('0x9'));var _=require(_0xb73c('0xa'));var squel=require(_0xb73c('0xb'));var crypto=require(_0xb73c('0xc'));var jsforce=require(_0xb73c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb73c('0x7'));var querystring=require('querystring');var Papa=require(_0xb73c('0xe'));var Redis=require(_0xb73c('0xf'));var authService=require(_0xb73c('0x10'));var qs=require(_0xb73c('0x11'));var as=require(_0xb73c('0x12'));var hardwareService=require(_0xb73c('0x13'));var logger=require(_0xb73c('0x14'))('api');var utils=require(_0xb73c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb73c('0x16'));var db=require(_0xb73c('0x17'))['db'];function respondWithStatusCode(_0x3cd530,_0x1a27db){_0x1a27db=_0x1a27db||0xcc;return function(_0x32fe12){if(_0x32fe12){return _0x3cd530[_0xb73c('0x18')](_0x1a27db);}return _0x3cd530[_0xb73c('0x19')](_0x1a27db)[_0xb73c('0x1a')]();};}function respondWithResult(_0x5ea482,_0x1b05ca){_0x1b05ca=_0x1b05ca||0xc8;return function(_0x2ab2d1){if(_0x2ab2d1){return _0x5ea482[_0xb73c('0x19')](_0x1b05ca)['json'](_0x2ab2d1);}};}function respondWithFilteredResult(_0x8716ad,_0x1c7f1b){return function(_0x5ad5b8){if(_0x5ad5b8){var _0x147642=typeof _0x1c7f1b['offset']===_0xb73c('0x1b')&&typeof _0x1c7f1b[_0xb73c('0x1c')]===_0xb73c('0x1b');var _0x288076=_0x5ad5b8['count'];var _0x5e7f09=_0x147642?0x0:_0x1c7f1b[_0xb73c('0x1d')];var _0x174c1f=_0x147642?_0x5ad5b8[_0xb73c('0x1e')]:_0x1c7f1b[_0xb73c('0x1d')]+_0x1c7f1b[_0xb73c('0x1c')];var _0x82e789;if(_0x174c1f>=_0x288076){_0x174c1f=_0x288076;_0x82e789=0xc8;}else{_0x82e789=0xce;}_0x8716ad['status'](_0x82e789);return _0x8716ad[_0xb73c('0x1f')](_0xb73c('0x20'),_0x5e7f09+'-'+_0x174c1f+'/'+_0x288076)['json'](_0x5ad5b8);}return null;};}function patchUpdates(_0x3d36d3){return function(_0x2ed8b7){try{jsonpatch[_0xb73c('0x21')](_0x2ed8b7,_0x3d36d3,!![]);}catch(_0x48f3f7){return BPromise[_0xb73c('0x22')](_0x48f3f7);}return _0x2ed8b7[_0xb73c('0x23')]();};}function saveUpdates(_0x6198a4,_0x337c65){return function(_0x1dab17){if(_0x1dab17){return _0x1dab17[_0xb73c('0x24')](_0x6198a4)[_0xb73c('0x25')](function(_0x8b0e58){return _0x8b0e58;});}return null;};}function removeEntity(_0x45b057,_0x4dff56){return function(_0xbc263a){if(_0xbc263a){return _0xbc263a[_0xb73c('0x26')]()[_0xb73c('0x25')](function(){_0x45b057['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f76cb,_0x51cfad){return function(_0x52383e){if(!_0x52383e){_0x2f76cb['sendStatus'](0x194);}return _0x52383e;};}function handleError(_0x251f08,_0x2fe90f){_0x2fe90f=_0x2fe90f||0x1f4;return function(_0x462502){logger[_0xb73c('0x27')](_0x462502[_0xb73c('0x28')]);if(_0x462502[_0xb73c('0x29')]){delete _0x462502[_0xb73c('0x29')];}_0x251f08['status'](_0x2fe90f)[_0xb73c('0x2a')](_0x462502);};}exports[_0xb73c('0x2b')]=function(_0x139cb4,_0x31a52f){var _0x4f9dd8={},_0x37016b={},_0x47acdb={'count':0x0,'rows':[]};var _0x920f62=_[_0xb73c('0x2c')](db[_0xb73c('0x2d')][_0xb73c('0x2e')],function(_0x5c892d){return{'name':_0x5c892d[_0xb73c('0x2f')],'type':_0x5c892d[_0xb73c('0x30')][_0xb73c('0x31')]};});_0x37016b[_0xb73c('0x32')]=_[_0xb73c('0x2c')](_0x920f62,_0xb73c('0x29'));_0x37016b[_0xb73c('0x33')]=_[_0xb73c('0x34')](_0x139cb4[_0xb73c('0x33')]);_0x37016b['filters']=_['intersection'](_0x37016b[_0xb73c('0x32')],_0x37016b['query']);_0x4f9dd8[_0xb73c('0x35')]=_[_0xb73c('0x36')](_0x37016b[_0xb73c('0x32')],qs[_0xb73c('0x37')](_0x139cb4[_0xb73c('0x33')][_0xb73c('0x37')]));_0x4f9dd8[_0xb73c('0x35')]=_0x4f9dd8['attributes'][_0xb73c('0x38')]?_0x4f9dd8[_0xb73c('0x35')]:_0x37016b[_0xb73c('0x32')];if(!_0x139cb4[_0xb73c('0x33')][_0xb73c('0x39')](_0xb73c('0x3a'))){_0x4f9dd8[_0xb73c('0x1c')]=qs[_0xb73c('0x1c')](_0x139cb4['query']['limit']);_0x4f9dd8[_0xb73c('0x1d')]=qs[_0xb73c('0x1d')](_0x139cb4[_0xb73c('0x33')][_0xb73c('0x1d')]);}_0x4f9dd8[_0xb73c('0x3b')]=qs[_0xb73c('0x3c')](_0x139cb4['query'][_0xb73c('0x3c')]);_0x4f9dd8['where']=qs['filters'](_[_0xb73c('0x3d')](_0x139cb4[_0xb73c('0x33')],_0x37016b[_0xb73c('0x3e')]),_0x920f62);if(_0x139cb4[_0xb73c('0x33')][_0xb73c('0x3f')]){_0x4f9dd8[_0xb73c('0x40')]=_[_0xb73c('0x41')](_0x4f9dd8['where'],{'$or':_[_0xb73c('0x2c')](_0x920f62,function(_0x78130f){if(_0x78130f[_0xb73c('0x30')]!==_0xb73c('0x42')){var _0x1265c2={};_0x1265c2[_0x78130f['name']]={'$like':'%'+_0x139cb4['query'][_0xb73c('0x3f')]+'%'};return _0x1265c2;}})});}_0x4f9dd8=_['merge']({},_0x4f9dd8,_0x139cb4[_0xb73c('0x43')]);var _0xd0d71b={'where':_0x4f9dd8[_0xb73c('0x40')]};return db[_0xb73c('0x2d')]['count'](_0xd0d71b)[_0xb73c('0x25')](function(_0x83dd92){_0x47acdb[_0xb73c('0x1e')]=_0x83dd92;if(_0x139cb4[_0xb73c('0x33')][_0xb73c('0x44')]){_0x4f9dd8[_0xb73c('0x45')]=[{'all':!![]}];}return db[_0xb73c('0x2d')][_0xb73c('0x46')](_0x4f9dd8);})[_0xb73c('0x25')](function(_0x3afaf5){_0x47acdb[_0xb73c('0x47')]=_0x3afaf5;return _0x47acdb;})[_0xb73c('0x25')](respondWithFilteredResult(_0x31a52f,_0x4f9dd8))[_0xb73c('0x48')](handleError(_0x31a52f,null));};exports[_0xb73c('0x49')]=function(_0x5b4e84,_0x44eb1a){var _0xa49765={'raw':!![],'where':{'id':_0x5b4e84['params']['id']}},_0x4aa944={};_0x4aa944[_0xb73c('0x32')]=_[_0xb73c('0x34')](db[_0xb73c('0x2d')][_0xb73c('0x2e')]);_0x4aa944[_0xb73c('0x33')]=_['keys'](_0x5b4e84[_0xb73c('0x33')]);_0x4aa944[_0xb73c('0x3e')]=_[_0xb73c('0x36')](_0x4aa944[_0xb73c('0x32')],_0x4aa944[_0xb73c('0x33')]);_0xa49765['attributes']=_[_0xb73c('0x36')](_0x4aa944[_0xb73c('0x32')],qs[_0xb73c('0x37')](_0x5b4e84[_0xb73c('0x33')][_0xb73c('0x37')]));_0xa49765[_0xb73c('0x35')]=_0xa49765[_0xb73c('0x35')][_0xb73c('0x38')]?_0xa49765['attributes']:_0x4aa944[_0xb73c('0x32')];if(_0x5b4e84[_0xb73c('0x33')][_0xb73c('0x44')]){_0xa49765[_0xb73c('0x45')]=[{'all':!![]}];}_0xa49765=_[_0xb73c('0x41')]({},_0xa49765,_0x5b4e84[_0xb73c('0x43')]);return db[_0xb73c('0x2d')]['find'](_0xa49765)[_0xb73c('0x25')](handleEntityNotFound(_0x44eb1a,null))['then'](respondWithResult(_0x44eb1a,null))[_0xb73c('0x48')](handleError(_0x44eb1a,null));};exports[_0xb73c('0x4a')]=function(_0x14b4fa,_0x3703bc){return db['VoiceTransferReport'][_0xb73c('0x4a')](_0x14b4fa[_0xb73c('0x4b')],{})[_0xb73c('0x25')](respondWithResult(_0x3703bc,0xc9))['catch'](handleError(_0x3703bc,null));};exports[_0xb73c('0x24')]=function(_0x54fea2,_0x1072af){if(_0x54fea2[_0xb73c('0x4b')]['id']){delete _0x54fea2[_0xb73c('0x4b')]['id'];}return db[_0xb73c('0x2d')][_0xb73c('0x4c')]({'where':{'id':_0x54fea2[_0xb73c('0x4d')]['id']}})[_0xb73c('0x25')](handleEntityNotFound(_0x1072af,null))[_0xb73c('0x25')](saveUpdates(_0x54fea2[_0xb73c('0x4b')],null))['then'](respondWithResult(_0x1072af,null))['catch'](handleError(_0x1072af,null));};exports[_0xb73c('0x26')]=function(_0x50cd43,_0x491817){return db[_0xb73c('0x2d')][_0xb73c('0x4c')]({'where':{'id':_0x50cd43[_0xb73c('0x4d')]['id']}})[_0xb73c('0x25')](handleEntityNotFound(_0x491817,null))[_0xb73c('0x25')](removeEntity(_0x491817,null))['catch'](handleError(_0x491817,null));};exports[_0xb73c('0x4e')]=function(_0x5c39c1,_0x7d6e73){return db[_0xb73c('0x2d')][_0xb73c('0x4e')]()['then'](respondWithResult(_0x7d6e73,null))[_0xb73c('0x48')](handleError(_0x7d6e73,null));};
\ No newline at end of file
index 0bf68d3..e6ce37b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fa8=['exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x555ebb,_0x393b61){var _0x41c273=function(_0x4e4442){while(--_0x4e4442){_0x555ebb['push'](_0x555ebb['shift']());}};_0x41c273(++_0x393b61);}(_0x5fa8,0x1f2));var _0x85fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fa8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x85fa('0x0'));var util=require(_0x85fa('0x1'));var logger=require(_0x85fa('0x2'))(_0x85fa('0x3'));var moment=require(_0x85fa('0x4'));var BPromise=require(_0x85fa('0x5'));var rp=require(_0x85fa('0x6'));var fs=require('fs');var path=require(_0x85fa('0x7'));var rimraf=require(_0x85fa('0x8'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x85fa('0x9')]=function(_0x428445,_0x52f555){return _0x428445[_0x85fa('0xa')](_0x85fa('0xb'),attributes,{'tableName':_0x85fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x287b=['define','VoiceTransferReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x287b,0xc8));var _0xb287=function(_0x257e65,_0x3f4a68){_0x257e65=_0x257e65-0x0;var _0x3eef2f=_0x287b[_0x257e65];return _0x3eef2f;};'use strict';var _=require(_0xb287('0x0'));var util=require(_0xb287('0x1'));var logger=require('../../config/logger')(_0xb287('0x2'));var moment=require(_0xb287('0x3'));var BPromise=require(_0xb287('0x4'));var rp=require(_0xb287('0x5'));var fs=require('fs');var path=require(_0xb287('0x6'));var rimraf=require(_0xb287('0x7'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xb287('0x8')]=function(_0x1f561c,_0x51fadf){return _0x1f561c[_0xb287('0x9')](_0xb287('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4c648e..6ea800f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86c7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceTransferReport','create','options','raw','info','CreateVoiceTransferReport','stringify','lodash','util','moment'];(function(_0x529059,_0x294a33){var _0x156bc2=function(_0x9bc770){while(--_0x9bc770){_0x529059['push'](_0x529059['shift']());}};_0x156bc2(++_0x294a33);}(_0x86c7,0x1dd));var _0x786c=function(_0x1878a8,_0x2bffbd){_0x1878a8=_0x1878a8-0x0;var _0x17e69f=_0x86c7[_0x1878a8];return _0x17e69f;};'use strict';var _=require(_0x786c('0x0'));var util=require(_0x786c('0x1'));var moment=require(_0x786c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x786c('0x3'));var db=require(_0x786c('0x4'))['db'];var utils=require(_0x786c('0x5'));var logger=require(_0x786c('0x6'))(_0x786c('0x7'));var config=require(_0x786c('0x8'));var jayson=require(_0x786c('0x9'));var client=jayson[_0x786c('0xa')][_0x786c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2126c7,_0x399f30,_0x45c8db){return new BPromise(function(_0x3a92b4,_0x5cc1b9){return client[_0x786c('0xc')](_0x2126c7,_0x45c8db)[_0x786c('0xd')](function(_0x989f5){logger['info'](_0x786c('0xe'),_0x399f30,_0x786c('0xf'));logger[_0x786c('0x10')](_0x786c('0x11'),_0x399f30,_0x786c('0xf'),JSON['stringify'](_0x989f5));if(_0x989f5[_0x786c('0x12')]){if(_0x989f5[_0x786c('0x12')][_0x786c('0x13')]===0x1f4){logger[_0x786c('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x399f30,_0x989f5['error'][_0x786c('0x14')]);return _0x5cc1b9(_0x989f5[_0x786c('0x12')]['message']);}logger[_0x786c('0x12')](_0x786c('0xe'),_0x399f30,_0x989f5[_0x786c('0x12')][_0x786c('0x14')]);return _0x3a92b4(_0x989f5['error'][_0x786c('0x14')]);}else{logger['info'](_0x786c('0xe'),_0x399f30,_0x786c('0xf'));_0x3a92b4(_0x989f5[_0x786c('0x15')][_0x786c('0x14')]);}})[_0x786c('0x16')](function(_0xa17659){logger[_0x786c('0x12')](_0x786c('0xe'),_0x399f30,_0xa17659);_0x5cc1b9(_0xa17659);});});}exports['CreateVoiceTransferReport']=function(_0x8ed33d){var _0x3bb5c9=this;return new Promise(function(_0x419359,_0x202a2d){return db[_0x786c('0x17')][_0x786c('0x18')](_0x8ed33d['body'],{'raw':_0x8ed33d[_0x786c('0x19')]?_0x8ed33d[_0x786c('0x19')][_0x786c('0x1a')]===undefined?!![]:![]:!![]})[_0x786c('0xd')](function(_0x1d6b55){logger[_0x786c('0x1b')]('CreateVoiceTransferReport',_0x8ed33d);logger[_0x786c('0x10')](_0x786c('0x1c'),_0x8ed33d,JSON[_0x786c('0x1d')](_0x1d6b55));_0x419359(_0x1d6b55);})['catch'](function(_0x10eca7){logger[_0x786c('0x12')](_0x786c('0x1c'),_0x10eca7['message'],_0x8ed33d);_0x202a2d(_0x3bb5c9[_0x786c('0x12')](0x1f4,_0x10eca7[_0x786c('0x14')]));});});};
\ No newline at end of file
+var _0x3abc=['then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x337ebc,_0x4e81b1){var _0x167214=function(_0x2636e7){while(--_0x2636e7){_0x337ebc['push'](_0x337ebc['shift']());}};_0x167214(++_0x4e81b1);}(_0x3abc,0x167));var _0xc3ab=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x3abc[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xc3ab('0x0'));var util=require('util');var moment=require(_0xc3ab('0x1'));var BPromise=require(_0xc3ab('0x2'));var rs=require(_0xc3ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3ab('0x4'))['db'];var utils=require(_0xc3ab('0x5'));var logger=require(_0xc3ab('0x6'))(_0xc3ab('0x7'));var config=require(_0xc3ab('0x8'));var jayson=require(_0xc3ab('0x9'));var client=jayson[_0xc3ab('0xa')][_0xc3ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x64c122,_0xa53bc1,_0x305bcb){return new BPromise(function(_0x30eda4,_0x428f88){return client[_0xc3ab('0xc')](_0x64c122,_0x305bcb)[_0xc3ab('0xd')](function(_0x4a003f){logger['info'](_0xc3ab('0xe'),_0xa53bc1,_0xc3ab('0xf'));logger[_0xc3ab('0x10')](_0xc3ab('0x11'),_0xa53bc1,_0xc3ab('0xf'),JSON['stringify'](_0x4a003f));if(_0x4a003f[_0xc3ab('0x12')]){if(_0x4a003f['error'][_0xc3ab('0x13')]===0x1f4){logger[_0xc3ab('0x12')](_0xc3ab('0xe'),_0xa53bc1,_0x4a003f['error'][_0xc3ab('0x14')]);return _0x428f88(_0x4a003f[_0xc3ab('0x12')][_0xc3ab('0x14')]);}logger['error'](_0xc3ab('0xe'),_0xa53bc1,_0x4a003f['error'][_0xc3ab('0x14')]);return _0x30eda4(_0x4a003f[_0xc3ab('0x12')][_0xc3ab('0x14')]);}else{logger[_0xc3ab('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0xa53bc1,_0xc3ab('0xf'));_0x30eda4(_0x4a003f[_0xc3ab('0x16')][_0xc3ab('0x14')]);}})[_0xc3ab('0x17')](function(_0x17ab41){logger[_0xc3ab('0x12')](_0xc3ab('0xe'),_0xa53bc1,_0x17ab41);_0x428f88(_0x17ab41);});});}exports['CreateVoiceTransferReport']=function(_0x449883){var _0x3f1da3=this;return new Promise(function(_0x2ffa65,_0x2d8a54){return db[_0xc3ab('0x18')][_0xc3ab('0x19')](_0x449883[_0xc3ab('0x1a')],{'raw':_0x449883[_0xc3ab('0x1b')]?_0x449883[_0xc3ab('0x1b')][_0xc3ab('0x1c')]===undefined?!![]:![]:!![]})[_0xc3ab('0xd')](function(_0x4818a1){logger[_0xc3ab('0x15')](_0xc3ab('0x1d'),_0x449883);logger[_0xc3ab('0x10')](_0xc3ab('0x1d'),_0x449883,JSON[_0xc3ab('0x1e')](_0x4818a1));_0x2ffa65(_0x4818a1);})[_0xc3ab('0x17')](function(_0x1df00e){logger[_0xc3ab('0x12')](_0xc3ab('0x1d'),_0x1df00e['message'],_0x449883);_0x2d8a54(_0x3f1da3['error'](0x1f4,_0x1df00e[_0xc3ab('0x14')]));});});};
\ No newline at end of file
index 39aa964..9cde140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb302=['originate','/hangup','hangup','/answer','answer','/hold','isAuthenticated','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','canUpdate'];(function(_0x48c2b5,_0x400aac){var _0x796dc8=function(_0x563fdf){while(--_0x563fdf){_0x48c2b5['push'](_0x48c2b5['shift']());}};_0x796dc8(++_0x400aac);}(_0xb302,0x1b1));var _0x2b30=function(_0x3cbb46,_0x86e2eb){_0x3cbb46=_0x3cbb46-0x0;var _0x2a3b79=_0xb302[_0x3cbb46];return _0x2a3b79;};'use strict';var express=require(_0x2b30('0x0'));var router=express[_0x2b30('0x1')]();var auth=require(_0x2b30('0x2'));var controller=require(_0x2b30('0x3'));router[_0x2b30('0x4')](_0x2b30('0x5'),auth['isAuthenticated'](),auth[_0x2b30('0x6')](),controller[_0x2b30('0x7')]);router[_0x2b30('0x4')](_0x2b30('0x8'),auth['isAuthenticated'](),auth[_0x2b30('0x6')](),controller[_0x2b30('0x9')]);router[_0x2b30('0x4')](_0x2b30('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x2b30('0xb')]);router[_0x2b30('0x4')](_0x2b30('0xc'),auth[_0x2b30('0xd')](),auth[_0x2b30('0x6')](),controller[_0x2b30('0xe')]);router[_0x2b30('0x4')](_0x2b30('0xf'),auth[_0x2b30('0xd')](),auth[_0x2b30('0x6')](),controller[_0x2b30('0x10')]);router[_0x2b30('0x4')](_0x2b30('0x11'),auth[_0x2b30('0xd')](),auth[_0x2b30('0x6')](),controller[_0x2b30('0x12')]);router[_0x2b30('0x4')](_0x2b30('0x13'),auth[_0x2b30('0xd')](),auth[_0x2b30('0x6')](),controller[_0x2b30('0x14')]);module[_0x2b30('0x15')]=router;
\ No newline at end of file
+var _0x8971=['/unhold','unhold','/calls','/transfer','transfer','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','/answer','answer','/hold','hold'];(function(_0x2d717c,_0x25b6db){var _0x1c363a=function(_0x5689c4){while(--_0x5689c4){_0x2d717c['push'](_0x2d717c['shift']());}};_0x1c363a(++_0x25b6db);}(_0x8971,0x115));var _0x1897=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8971[_0x199572];return _0x13cfa3;};'use strict';var express=require('express');var router=express[_0x1897('0x0')]();var auth=require(_0x1897('0x1'));var controller=require('./webbar.controller');router[_0x1897('0x2')](_0x1897('0x3'),auth[_0x1897('0x4')](),auth[_0x1897('0x5')](),controller[_0x1897('0x6')]);router[_0x1897('0x2')](_0x1897('0x7'),auth[_0x1897('0x4')](),auth['canUpdate'](),controller['hangup']);router[_0x1897('0x2')](_0x1897('0x8'),auth[_0x1897('0x4')](),auth[_0x1897('0x5')](),controller[_0x1897('0x9')]);router[_0x1897('0x2')](_0x1897('0xa'),auth['isAuthenticated'](),auth[_0x1897('0x5')](),controller[_0x1897('0xb')]);router[_0x1897('0x2')](_0x1897('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1897('0xd')]);router[_0x1897('0x2')](_0x1897('0xe'),auth[_0x1897('0x4')](),auth['canUpdate'](),controller['calls']);router[_0x1897('0x2')](_0x1897('0xf'),auth['isAuthenticated'](),auth[_0x1897('0x5')](),controller[_0x1897('0x10')]);module['exports']=router;
\ No newline at end of file
index 495d898..a9853d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde2c=['name','send','status','request','error','code','message','result','catch','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','userId','callNumber','callerId','callbackUrl','format','user:%s','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','hold','hold\x20fired:','entityFound:','hold\x20executed!','unhold','webbar:unhold','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack'];(function(_0x21fc12,_0x3b1816){var _0x30ed92=function(_0x5bcb01){while(--_0x5bcb01){_0x21fc12['push'](_0x21fc12['shift']());}};_0x30ed92(++_0x3b1816);}(_0xde2c,0x7f));var _0xcde2=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xde2c[_0x1b1e76];return _0x3d743a;};'use strict';var path=require(_0xcde2('0x0'));var fs=require('fs');var _=require(_0xcde2('0x1'));var db=require(_0xcde2('0x2'))['db'];var config=require(_0xcde2('0x3'));var util=require(_0xcde2('0x4'));var BPromise=require(_0xcde2('0x5'));var jayson=require(_0xcde2('0x6'));var amiClient=jayson[_0xcde2('0x7')]['http']({'port':0x232a});var logger=require(_0xcde2('0x8'))(_0xcde2('0x9'));var Redis=require(_0xcde2('0xa'));config[_0xcde2('0xb')]=_[_0xcde2('0xc')](config['redis'],{'host':_0xcde2('0xd'),'port':0x18eb});var io=require(_0xcde2('0xe'))(new Redis(config[_0xcde2('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'callNumber':{'type':_0xcde2('0x10'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xcde2('0x10')},'callbackUrl':{'type':_0xcde2('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':[!![],_0xcde2('0x12')]},'transferNumber':{'type':'string','required':[!![],_0xcde2('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x39b023,_0x4c558b,_0x31b4a7){logger[_0xcde2('0x14')](_0x39b023,_0x4c558b,JSON[_0xcde2('0x15')](_0x31b4a7));io['to'](_0x39b023)[_0xcde2('0x16')](_0x4c558b,_0x31b4a7);}function handleError(_0x5223f1){return function(_0x4fd5aa){console['log'](_0xcde2('0x17'),_0x4fd5aa,_0x4fd5aa instanceof RangeError);logger['error'](_0x4fd5aa[_0xcde2('0x18')]);if(_0x4fd5aa instanceof RangeError){if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1['status'](0x194)[_0xcde2('0x1a')](_0x4fd5aa);}else{if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1[_0xcde2('0x1b')](0x1f4)[_0xcde2('0x1a')](_0x4fd5aa);}};}function checkError(){return function(_0x57210d){if(!_0x57210d){throw new RangeError('NotFound');}return _0x57210d;};}function respondWithRpcPromise(_0x5a92b9,_0xb96dc0){return new BPromise(function(_0x3e5170,_0x2c9562){var _0x4063d4=amiClient;return _0x4063d4[_0xcde2('0x1c')](_0x5a92b9,_0xb96dc0)['then'](function(_0x1104b8){if(_0x1104b8['error']){if(_0x1104b8[_0xcde2('0x1d')][_0xcde2('0x1e')]===0x1f4){return _0x2c9562(_0x1104b8[_0xcde2('0x1d')]['message']);}return _0x3e5170(_0x1104b8['error'][_0xcde2('0x1f')]);}else{_0x3e5170(_0x1104b8[_0xcde2('0x20')]);}})[_0xcde2('0x21')](function(_0x217ec9){_0x2c9562(_0x217ec9);});});}function getAgent(_0xcadb2){return db['User'][_0xcde2('0x22')]({'where':{'id':_0xcadb2,'role':_0xcde2('0x23')}})[_0xcde2('0x24')](checkError());}function getAgentCheckSession(_0x513965,_0x2487eb){return new BPromise(function(_0x348ca1,_0x8e1655){var _0x40309d=respondWithRpcPromise(_0xcde2('0x25'));var _0x5b2b7=getAgent(_0x513965);Promise[_0xcde2('0x26')]([_0x40309d,_0x5b2b7])[_0xcde2('0x24')](function(_0x5bf1e6){var _0x3c3c01=_0x5bf1e6[0x0];var _0x4a0826=_0x5bf1e6[0x1];var _0x141072=_[_0xcde2('0x27')](_0x3c3c01[_0xcde2('0x28')],function(_0x49cb58){return _0x49cb58[_0xcde2('0x29')]==_0x4a0826['id']&&_0x49cb58[_0xcde2('0x2a')]==_0x2487eb;});if(_0x141072['length']==0x1){_0x348ca1(_0x4a0826);}else{_0x8e1655(new RangeError(_0xcde2('0x2b')+_0x2487eb+_0xcde2('0x2c')));}});});}exports[_0xcde2('0x2d')]=function(_0x2b2ea1,_0x14f784){logger[_0xcde2('0x14')](_0xcde2('0x2e'),_0x2b2ea1[_0xcde2('0x2f')]);var _0x5c08f0=originateValidation[_0xcde2('0x30')](_0x2b2ea1[_0xcde2('0x2f')]);if(_0x5c08f0[_0xcde2('0x31')]>0x0){return _0x14f784[_0xcde2('0x1b')](0x190)['json'](_0x5c08f0);}var _0x2ae8e0=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x2fec6e=_0x2b2ea1['body'][_0xcde2('0x33')];var _0x452816=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x34')];var _0x54ae78=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x35')];return getAgent(_0x2ae8e0)[_0xcde2('0x24')](function(_0x3090b6){logger[_0xcde2('0x14')]('entityFound:',_0x3090b6[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x3090b6[_0xcde2('0x19')]),'webbar:originate',{'callNumber':_0x2fec6e,'callerId':_0x452816,'callbackUrl':_0x54ae78});return _0x14f784['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x39')});})[_0xcde2('0x21')](handleError(_0x14f784));};exports[_0xcde2('0x3a')]=function(_0x10c494,_0x45af6e){logger[_0xcde2('0x14')](_0xcde2('0x3b'),_0x10c494[_0xcde2('0x2f')]);var _0x5d02b3=hangupValidation[_0xcde2('0x30')](_0x10c494[_0xcde2('0x2f')]);if(_0x5d02b3[_0xcde2('0x31')]>0x0){return _0x45af6e[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5d02b3);}var _0x47b6ee=_0x10c494['body'][_0xcde2('0x32')];var _0xc8e8a4=_0x10c494[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x47b6ee)[_0xcde2('0x24')](function(_0x1939a0){logger['info']('entityFound:',_0x1939a0['name']);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x1939a0[_0xcde2('0x19')]),_0xcde2('0x3c'),{'sessionId':_0xc8e8a4});return _0x45af6e[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x3d')});})['catch'](handleError(_0x45af6e));};exports['answer']=function(_0x6f60d5,_0x578bf1){logger[_0xcde2('0x14')]('answer\x20fired:',_0x6f60d5[_0xcde2('0x2f')]);var _0x3239a0=answerValidation[_0xcde2('0x30')](_0x6f60d5['body']);if(_0x3239a0[_0xcde2('0x31')]>0x0){return _0x578bf1['status'](0x190)[_0xcde2('0x38')](_0x3239a0);}var _0x24a46a=_0x6f60d5[_0xcde2('0x2f')][_0xcde2('0x32')];var _0xcafd7=_0x6f60d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x24a46a)['then'](function(_0x22084e){logger['info']('entityFound:',_0x22084e[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x22084e[_0xcde2('0x19')]),'webbar:answer',{'sessionId':_0xcafd7});return _0x578bf1[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0xcde2('0x21')](handleError(_0x578bf1));};exports[_0xcde2('0x3e')]=function(_0x4fc9d5,_0x1e05a4){logger['info'](_0xcde2('0x3f'),_0x4fc9d5[_0xcde2('0x2f')]);var _0x2d7b55=holdValidation[_0xcde2('0x30')](_0x4fc9d5[_0xcde2('0x2f')]);if(_0x2d7b55['length']>0x0){return _0x1e05a4[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x2d7b55);}var _0x40d14b=_0x4fc9d5[_0xcde2('0x2f')]['userId'];var _0x58ded4=_0x4fc9d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x40d14b)[_0xcde2('0x24')](function(_0x3e9e79){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x3e9e79[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')]('user:%s',_0x3e9e79[_0xcde2('0x19')]),'webbar:hold',{'sessionId':_0x58ded4});return _0x1e05a4[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':_0xcde2('0x41')});})[_0xcde2('0x21')](handleError(_0x1e05a4));};exports[_0xcde2('0x42')]=function(_0x16cddb,_0x446cf0){logger[_0xcde2('0x14')]('unhold\x20fired:',_0x16cddb[_0xcde2('0x2f')]);var _0x5aa54f=unholdValidation[_0xcde2('0x30')](_0x16cddb[_0xcde2('0x2f')]);if(_0x5aa54f[_0xcde2('0x31')]>0x0){return _0x446cf0[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5aa54f);}var _0x9067c8=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x373cdc=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x9067c8)[_0xcde2('0x24')](function(_0x5d777d){logger['info']('entityFound:',_0x5d777d[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x5d777d[_0xcde2('0x19')]),_0xcde2('0x43'),{'sessionId':_0x373cdc});return _0x446cf0['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':'unhold\x20executed!'});})[_0xcde2('0x21')](handleError(_0x446cf0));};exports['calls']=function(_0x1085d2,_0x10d6ab){logger['info'](_0xcde2('0x44'),_0x10d6ab['body']);var _0x5e6fd3=callsValidation[_0xcde2('0x30')](_0x1085d2[_0xcde2('0x2f')]);if(_0x5e6fd3[_0xcde2('0x31')]>0x0){return _0x10d6ab[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5e6fd3);}var _0x3787b5=_0x1085d2['body'][_0xcde2('0x32')];var _0x44b3fb=respondWithRpcPromise(_0xcde2('0x25'));var _0x145b4a=getAgent(_0x3787b5);return Promise[_0xcde2('0x26')]([_0x44b3fb,_0x145b4a])[_0xcde2('0x24')](function(_0x50892c){var _0x5775bb=_0x50892c[0x0];var _0x30dee3=_0x50892c[0x1];var _0x35c6e5=_[_0xcde2('0x27')](_0x5775bb[_0xcde2('0x28')],function(_0x4c298b){return _0x4c298b[_0xcde2('0x29')]==_0x30dee3['id'];});return _0x10d6ab[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'count':_0x35c6e5[_0xcde2('0x31')],'rows':_0x35c6e5});})[_0xcde2('0x21')](handleError(_0x10d6ab));};exports[_0xcde2('0x45')]=function(_0x50a1db,_0x1bea12){logger[_0xcde2('0x14')]('conference\x20fired:',_0x50a1db[_0xcde2('0x2f')]);var _0x4544bd=conferenceValidation[_0xcde2('0x30')](_0x50a1db[_0xcde2('0x2f')]);if(_0x4544bd[_0xcde2('0x31')]>0x0){return _0x1bea12[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x4544bd);}var _0x2541e0=_0x50a1db[_0xcde2('0x2f')][_0xcde2('0x32')];return getAgent(_0x2541e0)['then'](function(_0x223cb0){logger[_0xcde2('0x14')]('entityFound:',_0x223cb0[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x223cb0['name']),_0xcde2('0x46'));return _0x1bea12[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x47')});})[_0xcde2('0x21')](handleError(_0x1bea12));};exports[_0xcde2('0x48')]=function(_0x21cd07,_0x45bd76){logger[_0xcde2('0x14')](_0xcde2('0x49'),_0x21cd07[_0xcde2('0x2f')]);var _0x5d42f8=transferValidation['validate'](_0x21cd07[_0xcde2('0x2f')]);if(_0x5d42f8[_0xcde2('0x31')]>0x0){return _0x45bd76[_0xcde2('0x1b')](0x190)['json'](_0x5d42f8);}var _0x485a79=_0x21cd07['body'][_0xcde2('0x32')];var _0x367bad=_0x21cd07[_0xcde2('0x2f')][_0xcde2('0x2a')];var _0x325b51=_0x21cd07[_0xcde2('0x2f')]['transferNumber'];return getAgent(_0x485a79)['then'](function(_0x165ec4){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x165ec4[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x165ec4[_0xcde2('0x19')]),_0xcde2('0x4a'),{'sessionId':_0x367bad,'transferNumber':_0x325b51});return _0x45bd76[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x4b')});})[_0xcde2('0x21')](handleError(_0x45bd76));};
\ No newline at end of file
+var _0xf3cd=['webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','VoiceChannels','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','all','filter','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','json'];(function(_0x4b10f0,_0x25c95d){var _0x455af5=function(_0x57526b){while(--_0x57526b){_0x4b10f0['push'](_0x4b10f0['shift']());}};_0x455af5(++_0x25c95d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xf738ad,_0x5e1d7f){_0xf738ad=_0xf738ad-0x0;var _0x598570=_0xf3cd[_0xf738ad];return _0x598570;};'use strict';var path=require(_0xdf3c('0x0'));var fs=require('fs');var _=require(_0xdf3c('0x1'));var db=require(_0xdf3c('0x2'))['db'];var config=require(_0xdf3c('0x3'));var util=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0xdf3c('0x6')][_0xdf3c('0x7')]({'port':0x232a});var logger=require(_0xdf3c('0x8'))('webbarapi');var Redis=require(_0xdf3c('0x9'));config[_0xdf3c('0xa')]=_[_0xdf3c('0xb')](config[_0xdf3c('0xa')],{'host':_0xdf3c('0xc'),'port':0x18eb});var io=require(_0xdf3c('0xd'))(new Redis(config['redis']));var Schema=require(_0xdf3c('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xdf3c('0xf'),'required':[!![],_0xdf3c('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xdf3c('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xdf3c('0xf'),'required':[!![],_0xdf3c('0x13')]},'transferNumber':{'type':_0xdf3c('0xf'),'required':[!![],_0xdf3c('0x14')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xdf3c('0x12')]},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]}});function emit(_0x1a7a5a,_0x305ea5,_0x92008b){logger[_0xdf3c('0x15')](_0x1a7a5a,_0x305ea5,JSON[_0xdf3c('0x16')](_0x92008b));io['to'](_0x1a7a5a)['emit'](_0x305ea5,_0x92008b);}function handleError(_0x13b0e6){return function(_0x465e7d){console[_0xdf3c('0x17')](_0xdf3c('0x18'),_0x465e7d,_0x465e7d instanceof RangeError);logger[_0xdf3c('0x19')](_0x465e7d[_0xdf3c('0x1a')]);if(_0x465e7d instanceof RangeError){if(_0x465e7d[_0xdf3c('0x1b')]){delete _0x465e7d[_0xdf3c('0x1b')];}_0x13b0e6[_0xdf3c('0x1c')](0x194)[_0xdf3c('0x1d')](_0x465e7d);}else{if(_0x465e7d[_0xdf3c('0x1b')]){delete _0x465e7d[_0xdf3c('0x1b')];}_0x13b0e6[_0xdf3c('0x1c')](0x1f4)['send'](_0x465e7d);}};}function checkError(){return function(_0x4d620f){if(!_0x4d620f){throw new RangeError(_0xdf3c('0x1e'));}return _0x4d620f;};}function respondWithRpcPromise(_0x583ce4,_0x15776c){return new BPromise(function(_0x40e7ec,_0x36552e){var _0x38b319=amiClient;return _0x38b319[_0xdf3c('0x1f')](_0x583ce4,_0x15776c)[_0xdf3c('0x20')](function(_0x50d8ca){if(_0x50d8ca[_0xdf3c('0x19')]){if(_0x50d8ca[_0xdf3c('0x19')][_0xdf3c('0x21')]===0x1f4){return _0x36552e(_0x50d8ca[_0xdf3c('0x19')][_0xdf3c('0x22')]);}return _0x40e7ec(_0x50d8ca[_0xdf3c('0x19')][_0xdf3c('0x22')]);}else{_0x40e7ec(_0x50d8ca[_0xdf3c('0x23')]);}})[_0xdf3c('0x24')](function(_0x1adee4){_0x36552e(_0x1adee4);});});}function getAgent(_0x4c076c){return db[_0xdf3c('0x25')][_0xdf3c('0x26')]({'where':{'id':_0x4c076c,'role':'agent'}})[_0xdf3c('0x20')](checkError());}function getAgentCheckSession(_0x59659e,_0x4eaced){return new BPromise(function(_0x508be9,_0x14aac9){var _0x186bba=respondWithRpcPromise('VoiceChannels');var _0x5c3b5a=getAgent(_0x59659e);Promise[_0xdf3c('0x27')]([_0x186bba,_0x5c3b5a])[_0xdf3c('0x20')](function(_0xd3cfcb){var _0x1ccdd4=_0xd3cfcb[0x0];var _0x5c98a2=_0xd3cfcb[0x1];var _0x43ce06=_[_0xdf3c('0x28')](_0x1ccdd4['rows'],function(_0x51e0a4){return _0x51e0a4[_0xdf3c('0x29')]==_0x5c98a2['id']&&_0x51e0a4[_0xdf3c('0x2a')]==_0x4eaced;});if(_0x43ce06[_0xdf3c('0x2b')]==0x1){_0x508be9(_0x5c98a2);}else{_0x14aac9(new RangeError('sessionId\x20'+_0x4eaced+_0xdf3c('0x2c')));}});});}exports[_0xdf3c('0x2d')]=function(_0x21e7b8,_0x10099e){logger['info'](_0xdf3c('0x2e'),_0x21e7b8[_0xdf3c('0x2f')]);var _0x522e5f=originateValidation[_0xdf3c('0xe')](_0x21e7b8[_0xdf3c('0x2f')]);if(_0x522e5f[_0xdf3c('0x2b')]>0x0){return _0x10099e[_0xdf3c('0x1c')](0x190)['json'](_0x522e5f);}var _0x33632f=_0x21e7b8[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0x3b9ce8=_0x21e7b8['body'][_0xdf3c('0x31')];var _0x3e7a4b=_0x21e7b8['body']['callerId'];var _0x12cc19=_0x21e7b8['body'][_0xdf3c('0x32')];return getAgent(_0x33632f)['then'](function(_0x57faba){logger['info'](_0xdf3c('0x33'),_0x57faba[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x57faba['name']),'webbar:originate',{'callNumber':_0x3b9ce8,'callerId':_0x3e7a4b,'callbackUrl':_0x12cc19});return _0x10099e[_0xdf3c('0x1c')](0xc8)['json']({'error':![],'message':_0xdf3c('0x36')});})[_0xdf3c('0x24')](handleError(_0x10099e));};exports[_0xdf3c('0x37')]=function(_0xcdd731,_0x1004e9){logger[_0xdf3c('0x15')](_0xdf3c('0x38'),_0xcdd731[_0xdf3c('0x2f')]);var _0x398c76=hangupValidation['validate'](_0xcdd731[_0xdf3c('0x2f')]);if(_0x398c76['length']>0x0){return _0x1004e9['status'](0x190)[_0xdf3c('0x39')](_0x398c76);}var _0x47f760=_0xcdd731[_0xdf3c('0x2f')]['userId'];var _0x2a94c3=_0xcdd731[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x47f760)[_0xdf3c('0x20')](function(_0x3098cb){logger[_0xdf3c('0x15')](_0xdf3c('0x33'),_0x3098cb[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x3098cb[_0xdf3c('0x1b')]),_0xdf3c('0x3a'),{'sessionId':_0x2a94c3});return _0x1004e9['status'](0xc8)['json']({'error':![],'message':_0xdf3c('0x3b')});})['catch'](handleError(_0x1004e9));};exports[_0xdf3c('0x3c')]=function(_0x14d8e1,_0x46194d){logger[_0xdf3c('0x15')]('answer\x20fired:',_0x14d8e1['body']);var _0x335c1b=answerValidation[_0xdf3c('0xe')](_0x14d8e1[_0xdf3c('0x2f')]);if(_0x335c1b['length']>0x0){return _0x46194d[_0xdf3c('0x1c')](0x190)[_0xdf3c('0x39')](_0x335c1b);}var _0x6fc3b6=_0x14d8e1[_0xdf3c('0x2f')]['userId'];var _0x127685=_0x14d8e1[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x6fc3b6)[_0xdf3c('0x20')](function(_0x2f52c5){logger['info'](_0xdf3c('0x33'),_0x2f52c5[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x2f52c5[_0xdf3c('0x1b')]),_0xdf3c('0x3d'),{'sessionId':_0x127685});return _0x46194d['status'](0xc8)['json']({'error':![],'message':_0xdf3c('0x3e')});})[_0xdf3c('0x24')](handleError(_0x46194d));};exports['hold']=function(_0x5c9885,_0x269723){logger[_0xdf3c('0x15')](_0xdf3c('0x3f'),_0x5c9885[_0xdf3c('0x2f')]);var _0xaae4bc=holdValidation[_0xdf3c('0xe')](_0x5c9885[_0xdf3c('0x2f')]);if(_0xaae4bc[_0xdf3c('0x2b')]>0x0){return _0x269723[_0xdf3c('0x1c')](0x190)['json'](_0xaae4bc);}var _0x129c2a=_0x5c9885[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0xe760dd=_0x5c9885[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x129c2a)[_0xdf3c('0x20')](function(_0x553f70){logger[_0xdf3c('0x15')]('entityFound:',_0x553f70[_0xdf3c('0x1b')]);emit(util['format'](_0xdf3c('0x35'),_0x553f70[_0xdf3c('0x1b')]),_0xdf3c('0x40'),{'sessionId':_0xe760dd});return _0x269723[_0xdf3c('0x1c')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x269723));};exports[_0xdf3c('0x41')]=function(_0x5f5726,_0x31c600){logger[_0xdf3c('0x15')](_0xdf3c('0x42'),_0x5f5726[_0xdf3c('0x2f')]);var _0x3b17d9=unholdValidation['validate'](_0x5f5726['body']);if(_0x3b17d9[_0xdf3c('0x2b')]>0x0){return _0x31c600[_0xdf3c('0x1c')](0x190)['json'](_0x3b17d9);}var _0x3b215d=_0x5f5726[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0x3fda0a=_0x5f5726[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x3b215d)[_0xdf3c('0x20')](function(_0x492396){logger['info'](_0xdf3c('0x33'),_0x492396[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x492396[_0xdf3c('0x1b')]),_0xdf3c('0x43'),{'sessionId':_0x3fda0a});return _0x31c600[_0xdf3c('0x1c')](0xc8)[_0xdf3c('0x39')]({'error':![],'message':_0xdf3c('0x44')});})[_0xdf3c('0x24')](handleError(_0x31c600));};exports[_0xdf3c('0x45')]=function(_0x4cb28f,_0x1eebcf){logger['info']('calls\x20fired:',_0x1eebcf['body']);var _0x58fcbf=callsValidation['validate'](_0x4cb28f[_0xdf3c('0x2f')]);if(_0x58fcbf[_0xdf3c('0x2b')]>0x0){return _0x1eebcf['status'](0x190)[_0xdf3c('0x39')](_0x58fcbf);}var _0x32427e=_0x4cb28f['body'][_0xdf3c('0x30')];var _0x28f935=respondWithRpcPromise(_0xdf3c('0x46'));var _0x1389e0=getAgent(_0x32427e);return Promise[_0xdf3c('0x27')]([_0x28f935,_0x1389e0])[_0xdf3c('0x20')](function(_0xb54629){var _0xdc859=_0xb54629[0x0];var _0x42efa2=_0xb54629[0x1];var _0xa05518=_[_0xdf3c('0x28')](_0xdc859['rows'],function(_0x1ed898){return _0x1ed898[_0xdf3c('0x29')]==_0x42efa2['id'];});return _0x1eebcf[_0xdf3c('0x1c')](0xc8)['json']({'count':_0xa05518[_0xdf3c('0x2b')],'rows':_0xa05518});})[_0xdf3c('0x24')](handleError(_0x1eebcf));};exports[_0xdf3c('0x47')]=function(_0x552264,_0x1effdb){logger[_0xdf3c('0x15')]('conference\x20fired:',_0x552264[_0xdf3c('0x2f')]);var _0x4f8fd6=conferenceValidation[_0xdf3c('0xe')](_0x552264[_0xdf3c('0x2f')]);if(_0x4f8fd6[_0xdf3c('0x2b')]>0x0){return _0x1effdb[_0xdf3c('0x1c')](0x190)[_0xdf3c('0x39')](_0x4f8fd6);}var _0x30e6e1=_0x552264[_0xdf3c('0x2f')][_0xdf3c('0x30')];return getAgent(_0x30e6e1)[_0xdf3c('0x20')](function(_0x330730){logger[_0xdf3c('0x15')](_0xdf3c('0x33'),_0x330730[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x330730[_0xdf3c('0x1b')]),_0xdf3c('0x48'));return _0x1effdb['status'](0xc8)['json']({'error':![],'message':_0xdf3c('0x49')});})[_0xdf3c('0x24')](handleError(_0x1effdb));};exports[_0xdf3c('0x4a')]=function(_0x596282,_0x164e0a){logger['info']('transfer\x20fired:',_0x596282[_0xdf3c('0x2f')]);var _0x399db6=transferValidation[_0xdf3c('0xe')](_0x596282[_0xdf3c('0x2f')]);if(_0x399db6[_0xdf3c('0x2b')]>0x0){return _0x164e0a[_0xdf3c('0x1c')](0x190)[_0xdf3c('0x39')](_0x399db6);}var _0x3ec03a=_0x596282[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0x1cce9a=_0x596282[_0xdf3c('0x2f')][_0xdf3c('0x2a')];var _0x4be79a=_0x596282[_0xdf3c('0x2f')][_0xdf3c('0x4b')];return getAgent(_0x3ec03a)[_0xdf3c('0x20')](function(_0x16d6ea){logger[_0xdf3c('0x15')]('entityFound:',_0x16d6ea[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x16d6ea[_0xdf3c('0x1b')]),_0xdf3c('0x4c'),{'sessionId':_0x1cce9a,'transferNumber':_0x4be79a});return _0x164e0a[_0xdf3c('0x1c')](0xc8)[_0xdf3c('0x39')]({'error':![],'message':_0xdf3c('0x4d')});})[_0xdf3c('0x24')](handleError(_0x164e0a));};
\ No newline at end of file
index f09e10e..5619bec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x45dd5d,_0x21dd5e){var _0x291c6f=function(_0x2367ed){while(--_0x2367ed){_0x45dd5d['push'](_0x45dd5d['shift']());}};_0x291c6f(++_0x21dd5e);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x40c36b,_0x5e7a1b){_0x40c36b=_0x40c36b-0x0;var _0x474e74=_0xf4f4[_0x40c36b];return _0x474e74;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./whatsappAccount.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4f4f('0x8')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x8')](_0x4f4f('0x13'),auth['isAuthenticated'](),controller[_0x4f4f('0x14')]);router['post']('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x15')]);router[_0x4f4f('0x16')](_0x4f4f('0xe'),auth['isAuthenticated'](),controller[_0x4f4f('0x17')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x16')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x19')]);router[_0x4f4f('0x16')](_0x4f4f('0x13'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1a')]);router[_0x4f4f('0x16')](_0x4f4f('0x1b'),controller[_0x4f4f('0x1c')]);router['post'](_0x4f4f('0x1d'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1e')]);router[_0x4f4f('0x1f')](_0x4f4f('0x20'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x21')]);router[_0x4f4f('0x22')](_0x4f4f('0x20'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x23')]);router[_0x4f4f('0x22')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x24')]);router['delete'](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x25')]);module[_0x4f4f('0x26')]=router;
\ No newline at end of file
+var _0x1a85=['removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addAnswer','addApplications','/:id/notify','/:id/send','send','put','/:id','update','destroy','delete','removeAnswers'];(function(_0x30ee46,_0x91b326){var _0xfb2806=function(_0x10b01d){while(--_0x10b01d){_0x30ee46['push'](_0x30ee46['shift']());}};_0xfb2806(++_0x91b326);}(_0x1a85,0x178));var _0x51a8=function(_0x4ea44b,_0x546b89){_0x4ea44b=_0x4ea44b-0x0;var _0x418cc9=_0x1a85[_0x4ea44b];return _0x418cc9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./whatsappAccount.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0x6')](_0x51a8('0xb'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0x6')](_0x51a8('0xd'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xe')]);router[_0x51a8('0x6')](_0x51a8('0xf'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x10')]);router[_0x51a8('0x6')](_0x51a8('0x11'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x12')]);router['post']('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0x13')]);router[_0x51a8('0x14')]('/:id/dispositions',auth[_0x51a8('0x9')](),controller['addDisposition']);router[_0x51a8('0x14')](_0x51a8('0xd'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x15')]);router[_0x51a8('0x14')](_0x51a8('0xf'),auth[_0x51a8('0x9')](),controller['addAgents']);router[_0x51a8('0x14')](_0x51a8('0x11'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x16')]);router[_0x51a8('0x14')](_0x51a8('0x17'),controller['notify']);router[_0x51a8('0x14')](_0x51a8('0x18'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x19')]);router[_0x51a8('0x1a')](_0x51a8('0x1b'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x1c')]);router['delete'](_0x51a8('0x1b'),auth['isAuthenticated'](),controller[_0x51a8('0x1d')]);router[_0x51a8('0x1e')](_0x51a8('0xb'),auth[_0x51a8('0x9')](),controller['removeDispositions']);router[_0x51a8('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x51a8('0x1f')]);router['delete'](_0x51a8('0xf'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x20')]);module[_0x51a8('0x21')]=router;
\ No newline at end of file
index a9ae942..780e3a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1424=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','INTEGER'];(function(_0x592e46,_0x1fa9fd){var _0x4e65e0=function(_0x12dc39){while(--_0x12dc39){_0x592e46['push'](_0x592e46['shift']());}};_0x4e65e0(++_0x1fa9fd);}(_0x1424,0x15d));var _0x4142=function(_0x271a95,_0x4d2a07){_0x271a95=_0x271a95-0x0;var _0x3fa489=_0x1424[_0x271a95];return _0x3fa489;};'use strict';var Sequelize=require(_0x4142('0x0'));var rs=require(_0x4142('0x1'));module[_0x4142('0x2')]={'name':{'type':Sequelize[_0x4142('0x3')],'unique':_0x4142('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x4142('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x4142('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x4142('0x3')],'defaultValue':function(){return rs[_0x4142('0x5')]();}},'phone':{'type':Sequelize[_0x4142('0x3')]},'type':{'type':Sequelize[_0x4142('0x6')](_0x4142('0x7'),_0x4142('0x8'))},'accountSid':{'type':Sequelize[_0x4142('0x3')]},'baseUrl':{'type':Sequelize[_0x4142('0x3')]},'authToken':{'type':Sequelize[_0x4142('0x3')]},'notificationTemplate':{'type':Sequelize[_0x4142('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4142('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4142('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4142('0xa')],'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[_0x4142('0xa')],'comment':_0x4142('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x4142('0xb')],'defaultValue':![],'comment':_0x4142('0xd'),'set':function(_0x3662e5){if(!_0x3662e5){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x4142('0xe')]('mandatoryDisposition',_0x3662e5);}},'description':{'type':Sequelize[_0x4142('0x3')]}};
\ No newline at end of file
+var _0xc369=['name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING'];(function(_0xbdf362,_0x3ea263){var _0x5374e3=function(_0x3a8316){while(--_0x3a8316){_0xbdf362['push'](_0xbdf362['shift']());}};_0x5374e3(++_0x3ea263);}(_0xc369,0x147));var _0x9c36=function(_0x401d43,_0x56f697){_0x401d43=_0x401d43-0x0;var _0x8fcc4b=_0xc369[_0x401d43];return _0x8fcc4b;};'use strict';var Sequelize=require(_0x9c36('0x0'));var rs=require('randomstring');module[_0x9c36('0x1')]={'name':{'type':Sequelize[_0x9c36('0x2')],'unique':_0x9c36('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9c36('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9c36('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9c36('0x5')](_0x9c36('0x6'),_0x9c36('0x7'))},'accountSid':{'type':Sequelize[_0x9c36('0x2')]},'baseUrl':{'type':Sequelize[_0x9c36('0x2')]},'authToken':{'type':Sequelize[_0x9c36('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9c36('0x8')],'defaultValue':function(){return _0x9c36('0x9');}},'notificationSound':{'type':Sequelize[_0x9c36('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9c36('0xb')],'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[_0x9c36('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9c36('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9c36('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x342b74){if(!_0x342b74){this['setDataValue'](_0x9c36('0xd'),null);}this[_0x9c36('0xe')]('mandatoryDisposition',_0x342b74);}},'description':{'type':Sequelize[_0x9c36('0x2')]}};
\ No newline at end of file
index 1454f0f..86b09d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535a=['omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','Applications','asc','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','mobile','from','From','replace','Body','MessageSid','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','contact','WhatsappInteraction','interaction','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','DESC','List','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','http','request','then','info','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','WhatsappAccount','findAll','show','params','rawAttributes','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','Disposition','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x535a,0x1cd));var _0xa535=function(_0x51fc91,_0xf52e8b){_0x51fc91=_0x51fc91-0x0;var _0x552fa1=_0x535a[_0x51fc91];return _0x552fa1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa535('0x0'));var zipdir=require(_0xa535('0x1'));var jsonpatch=require(_0xa535('0x2'));var rp=require(_0xa535('0x3'));var moment=require(_0xa535('0x4'));var BPromise=require(_0xa535('0x5'));var Mustache=require(_0xa535('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa535('0x7'));var csv=require(_0xa535('0x8'));var ejs=require(_0xa535('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa535('0xa'));var squel=require(_0xa535('0xb'));var crypto=require(_0xa535('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa535('0xd'));var toCsv=require(_0xa535('0x8'));var querystring=require(_0xa535('0xe'));var Papa=require(_0xa535('0xf'));var Redis=require('ioredis');var authService=require(_0xa535('0x10'));var qs=require(_0xa535('0x11'));var as=require(_0xa535('0x12'));var hardwareService=require(_0xa535('0x13'));var logger=require('../../config/logger')(_0xa535('0x14'));var utils=require(_0xa535('0x15'));var config=require(_0xa535('0x16'));var licenseUtil=require(_0xa535('0x17'));var db=require(_0xa535('0x18'))['db'];config[_0xa535('0x19')]=_[_0xa535('0x1a')](config[_0xa535('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa535('0x1b'))(new Redis(config[_0xa535('0x19')]));require(_0xa535('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa535('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1c3d81,_0x2d0137,_0x24db38,_0x27ce60){return new BPromise(function(_0x3fb6b9,_0x5140d9){var _0xc6271b=_0x27ce60||client;return _0xc6271b[_0xa535('0x1e')](_0x1c3d81,_0x24db38)[_0xa535('0x1f')](function(_0x3de38e){logger[_0xa535('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x2d0137,_0xa535('0x21'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2d0137,_0xa535('0x21'),JSON[_0xa535('0x22')](_0x3de38e));if(_0x3de38e[_0xa535('0x23')]){if(_0x3de38e[_0xa535('0x23')][_0xa535('0x24')]===0x1f4){logger[_0xa535('0x23')](_0xa535('0x25'),_0x2d0137,_0x3de38e[_0xa535('0x23')][_0xa535('0x26')]);return _0x5140d9(_0x3de38e[_0xa535('0x23')][_0xa535('0x26')]);}logger[_0xa535('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x2d0137,_0x3de38e[_0xa535('0x23')]['message']);return _0x3fb6b9(_0x3de38e[_0xa535('0x23')]['message']);}else{logger[_0xa535('0x20')](_0xa535('0x25'),_0x2d0137,'request\x20sent');_0x3fb6b9(_0x3de38e[_0xa535('0x27')][_0xa535('0x26')]);}})[_0xa535('0x28')](function(_0x1b4459){logger[_0xa535('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x2d0137,_0x1b4459);_0x5140d9(_0x1b4459);});});}function respondWithStatusCode(_0x31abed,_0x48e79c){_0x48e79c=_0x48e79c||0xcc;return function(_0x48d509){if(_0x48d509){return _0x31abed[_0xa535('0x29')](_0x48e79c);}return _0x31abed['status'](_0x48e79c)[_0xa535('0x2a')]();};}function respondWithResult(_0x14efc7,_0x1542c4){_0x1542c4=_0x1542c4||0xc8;return function(_0xf4a064){if(_0xf4a064){return _0x14efc7[_0xa535('0x2b')](_0x1542c4)['json'](_0xf4a064);}};}function respondWithFilteredResult(_0xf247fb,_0x3b5681){return function(_0x3cb72c){if(_0x3cb72c){var _0x2543b6=typeof _0x3b5681[_0xa535('0x2c')]===_0xa535('0x2d')&&typeof _0x3b5681[_0xa535('0x2e')]===_0xa535('0x2d');var _0x30f39e=_0x3cb72c[_0xa535('0x2f')];var _0x5c160e=_0x2543b6?0x0:_0x3b5681[_0xa535('0x2c')];var _0x1de84f=_0x2543b6?_0x3cb72c['count']:_0x3b5681[_0xa535('0x2c')]+_0x3b5681[_0xa535('0x2e')];var _0x318513;if(_0x1de84f>=_0x30f39e){_0x1de84f=_0x30f39e;_0x318513=0xc8;}else{_0x318513=0xce;}_0xf247fb[_0xa535('0x2b')](_0x318513);return _0xf247fb['set'](_0xa535('0x30'),_0x5c160e+'-'+_0x1de84f+'/'+_0x30f39e)[_0xa535('0x31')](_0x3cb72c);}return null;};}function patchUpdates(_0x5c738f){return function(_0x381213){try{jsonpatch[_0xa535('0x32')](_0x381213,_0x5c738f,!![]);}catch(_0xb7bcf){return BPromise[_0xa535('0x33')](_0xb7bcf);}return _0x381213['save']();};}function saveUpdates(_0x4a42c9,_0x31974d){return function(_0x833b41){if(_0x833b41){return _0x833b41[_0xa535('0x34')](_0x4a42c9)[_0xa535('0x1f')](function(_0x3e2faa){return _0x3e2faa;});}return null;};}function removeEntity(_0x15542b,_0x11e345){return function(_0x4ccf05){if(_0x4ccf05){return _0x4ccf05[_0xa535('0x35')]()[_0xa535('0x1f')](function(){var _0x5b28c=_0x4ccf05[_0xa535('0x36')]({'plain':!![]});var _0x4cbf01=_0xa535('0x37');return db[_0xa535('0x38')]['destroy']({'where':{'type':_0x4cbf01,'resourceId':_0x5b28c['id']}})[_0xa535('0x1f')](function(){return _0x4ccf05;});})[_0xa535('0x1f')](function(){_0x15542b[_0xa535('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20f2fa,_0x53c660){return function(_0xf43007){if(!_0xf43007){_0x20f2fa[_0xa535('0x29')](0x194);}return _0xf43007;};}function handleError(_0x34cde7,_0x1468ab){_0x1468ab=_0x1468ab||0x1f4;return function(_0x4587bb){logger[_0xa535('0x23')](_0x4587bb[_0xa535('0x39')]);if(_0x4587bb['name']){delete _0x4587bb[_0xa535('0x3a')];}_0x34cde7[_0xa535('0x2b')](_0x1468ab)[_0xa535('0x3b')](_0x4587bb);};}exports[_0xa535('0x3c')]=function(_0x53ed91,_0x5d6362){var _0x4288f9={'include':[{'model':db[_0xa535('0x3d')],'as':_0xa535('0x3e')}]},_0x426785={},_0x48a9e1={'count':0x0,'rows':[]};var _0x4b76de=_['map'](db['WhatsappAccount']['rawAttributes'],function(_0x1999ea){return{'name':_0x1999ea[_0xa535('0x3f')],'type':_0x1999ea['type']['key']};});_0x426785[_0xa535('0x40')]=_[_0xa535('0x41')](_0x4b76de,_0xa535('0x3a'));_0x426785[_0xa535('0x42')]=_[_0xa535('0x43')](_0x53ed91['query']);_0x426785[_0xa535('0x44')]=_['intersection'](_0x426785[_0xa535('0x40')],_0x426785[_0xa535('0x42')]);_0x4288f9[_0xa535('0x45')]=_[_0xa535('0x46')](_0x426785[_0xa535('0x40')],qs['fields'](_0x53ed91[_0xa535('0x42')][_0xa535('0x47')]));_0x4288f9[_0xa535('0x45')]=_0x4288f9[_0xa535('0x45')]['length']?_0x4288f9['attributes']:_0x426785[_0xa535('0x40')];if(!_0x53ed91[_0xa535('0x42')][_0xa535('0x48')](_0xa535('0x49'))){_0x4288f9['limit']=qs[_0xa535('0x2e')](_0x53ed91[_0xa535('0x42')][_0xa535('0x2e')]);_0x4288f9[_0xa535('0x2c')]=qs[_0xa535('0x2c')](_0x53ed91['query'][_0xa535('0x2c')]);}_0x4288f9[_0xa535('0x4a')]=qs[_0xa535('0x4b')](_0x53ed91[_0xa535('0x42')]['sort']);_0x4288f9[_0xa535('0x4c')]=qs['filters'](_['pick'](_0x53ed91[_0xa535('0x42')],_0x426785[_0xa535('0x44')]),_0x4b76de);if(_0x53ed91[_0xa535('0x42')]['filter']){_0x4288f9[_0xa535('0x4c')]=_[_0xa535('0x4d')](_0x4288f9['where'],{'$or':_[_0xa535('0x41')](_0x4b76de,function(_0x28939c){if(_0x28939c[_0xa535('0x4e')]!==_0xa535('0x4f')){var _0x125394={};_0x125394[_0x28939c[_0xa535('0x3a')]]={'$like':'%'+_0x53ed91['query'][_0xa535('0x50')]+'%'};return _0x125394;}})});}_0x4288f9=_[_0xa535('0x4d')]({},_0x4288f9,_0x53ed91['options']);var _0x59a6aa={'where':_0x4288f9[_0xa535('0x4c')]};return db['WhatsappAccount']['count'](_0x59a6aa)[_0xa535('0x1f')](function(_0xc60540){_0x48a9e1[_0xa535('0x2f')]=_0xc60540;if(_0x53ed91[_0xa535('0x42')][_0xa535('0x51')]){_0x4288f9['include']=[{'all':!![]}];}return db[_0xa535('0x52')][_0xa535('0x53')](_0x4288f9);})[_0xa535('0x1f')](function(_0x34a67f){_0x48a9e1['rows']=_0x34a67f;return _0x48a9e1;})['then'](respondWithFilteredResult(_0x5d6362,_0x4288f9))[_0xa535('0x28')](handleError(_0x5d6362,null));};exports[_0xa535('0x54')]=function(_0x241ed5,_0x3bbbeb){var _0x407847={'raw':![],'where':{'id':_0x241ed5[_0xa535('0x55')]['id']},'include':[{'model':db[_0xa535('0x3d')],'as':_0xa535('0x3e')}]},_0x242800={};_0x242800['model']=_['keys'](db[_0xa535('0x52')][_0xa535('0x56')]);_0x242800[_0xa535('0x42')]=_[_0xa535('0x43')](_0x241ed5[_0xa535('0x42')]);_0x242800[_0xa535('0x44')]=_[_0xa535('0x46')](_0x242800[_0xa535('0x40')],_0x242800[_0xa535('0x42')]);_0x407847[_0xa535('0x45')]=_['intersection'](_0x242800[_0xa535('0x40')],qs[_0xa535('0x47')](_0x241ed5['query'][_0xa535('0x47')]));_0x407847['attributes']=_0x407847[_0xa535('0x45')][_0xa535('0x57')]?_0x407847[_0xa535('0x45')]:_0x242800[_0xa535('0x40')];if(_0x241ed5[_0xa535('0x42')]['includeAll']){_0x407847[_0xa535('0x58')]=[{'all':!![]}];}_0x407847=_[_0xa535('0x4d')]({},_0x407847,_0x241ed5[_0xa535('0x59')]);return db[_0xa535('0x52')][_0xa535('0x5a')](_0x407847)[_0xa535('0x1f')](handleEntityNotFound(_0x3bbbeb,null))[_0xa535('0x1f')](respondWithResult(_0x3bbbeb,null))['catch'](handleError(_0x3bbbeb,null));};exports[_0xa535('0x5b')]=function(_0x37f8f2,_0x5b1106){return db[_0xa535('0x52')][_0xa535('0x5b')](_0x37f8f2[_0xa535('0x5c')],{})[_0xa535('0x1f')](function(_0xaf17f6){var _0x3d96a6=_0x37f8f2[_0xa535('0x5d')]['get']({'plain':!![]});if(!_0x3d96a6)throw new Error(_0xa535('0x5e'));if(_0x3d96a6[_0xa535('0x5f')]===_0xa535('0x5d')){var _0x3b37ba=_0xaf17f6['get']({'plain':!![]});var _0x3cde38=_0xa535('0x37');return db['UserProfileSection'][_0xa535('0x5a')]({'where':{'name':_0x3cde38,'userProfileId':_0x3d96a6[_0xa535('0x60')]},'raw':!![]})[_0xa535('0x1f')](function(_0x2aa4e9){if(_0x2aa4e9&&_0x2aa4e9[_0xa535('0x61')]===0x0){return db[_0xa535('0x38')][_0xa535('0x5b')]({'name':_0x3b37ba['name'],'resourceId':_0x3b37ba['id'],'type':_0x2aa4e9[_0xa535('0x3a')],'sectionId':_0x2aa4e9['id']},{})['then'](function(){return _0xaf17f6;});}else{return _0xaf17f6;}})[_0xa535('0x28')](function(_0x5c5e82){logger[_0xa535('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5e82);throw _0x5c5e82;});}return _0xaf17f6;})['then'](respondWithResult(_0x5b1106,0xc9))[_0xa535('0x28')](handleError(_0x5b1106,null));};exports[_0xa535('0x34')]=function(_0x355fa2,_0x4b47f8){if(_0x355fa2[_0xa535('0x5c')]['id']){delete _0x355fa2[_0xa535('0x5c')]['id'];}return db[_0xa535('0x52')][_0xa535('0x5a')]({'where':{'id':_0x355fa2[_0xa535('0x55')]['id']},'include':[{'model':db[_0xa535('0x3d')],'as':_0xa535('0x3e')}]})[_0xa535('0x1f')](handleEntityNotFound(_0x4b47f8,null))[_0xa535('0x1f')](saveUpdates(_0x355fa2['body'],null))['then'](respondWithResult(_0x4b47f8,null))[_0xa535('0x28')](handleError(_0x4b47f8,null));};exports['destroy']=function(_0x229cc1,_0x327c5e){return db['WhatsappAccount'][_0xa535('0x5a')]({'where':{'id':_0x229cc1[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x327c5e,null))[_0xa535('0x1f')](removeEntity(_0x327c5e,null))[_0xa535('0x28')](handleError(_0x327c5e,null));};exports[_0xa535('0x62')]=function(_0x4542a0,_0x1b0ebf){return db[_0xa535('0x52')][_0xa535('0x62')]()[_0xa535('0x1f')](respondWithResult(_0x1b0ebf,null))['catch'](handleError(_0x1b0ebf,null));};exports[_0xa535('0x63')]=function(_0x2f6641,_0x599cdf,_0x2518d1){if(_0x2f6641[_0xa535('0x5c')]['id']){delete _0x2f6641['body']['id'];}return db[_0xa535('0x52')][_0xa535('0x5a')]({'where':{'id':_0x2f6641[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x599cdf,null))[_0xa535('0x1f')](function(_0x2baa8d){if(_0x2baa8d){_0x2f6641[_0xa535('0x5c')][_0xa535('0x64')]=_0x2baa8d['id'];return db[_0xa535('0x65')][_0xa535('0x5b')](_0x2f6641[_0xa535('0x5c')]);}})[_0xa535('0x1f')](respondWithResult(_0x599cdf,null))[_0xa535('0x28')](handleError(_0x599cdf,null));};exports['getDispositions']=function(_0x1a82b7,_0x34c8f2,_0x1c887e){var _0x54dd0c={'raw':![],'where':{}};var _0x253e81={};var _0x587d38={'count':0x0,'rows':[]};return db[_0xa535('0x52')][_0xa535('0x66')]({'where':{'id':_0x1a82b7[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x34c8f2,null))[_0xa535('0x1f')](function(_0x22c83c){if(_0x22c83c){_0x253e81['model']=_[_0xa535('0x43')](db[_0xa535('0x65')][_0xa535('0x56')]);_0x253e81[_0xa535('0x42')]=_[_0xa535('0x43')](_0x1a82b7['query']);_0x253e81[_0xa535('0x44')]=_[_0xa535('0x46')](_0x253e81[_0xa535('0x40')],_0x253e81['query']);_0x54dd0c[_0xa535('0x45')]=_[_0xa535('0x46')](_0x253e81[_0xa535('0x40')],qs[_0xa535('0x47')](_0x1a82b7[_0xa535('0x42')][_0xa535('0x47')]));_0x54dd0c['attributes']=_0x54dd0c[_0xa535('0x45')][_0xa535('0x57')]?_0x54dd0c[_0xa535('0x45')]:_0x253e81[_0xa535('0x40')];if(!_0x1a82b7[_0xa535('0x42')][_0xa535('0x48')]('nolimit')){_0x54dd0c[_0xa535('0x2e')]=qs[_0xa535('0x2e')](_0x1a82b7[_0xa535('0x42')]['limit']);_0x54dd0c[_0xa535('0x2c')]=qs[_0xa535('0x2c')](_0x1a82b7[_0xa535('0x42')][_0xa535('0x2c')]);}_0x54dd0c['order']=qs[_0xa535('0x4b')](_0x1a82b7['query'][_0xa535('0x4b')]);_0x54dd0c[_0xa535('0x4c')]=qs['filters'](_['pick'](_0x1a82b7[_0xa535('0x42')],_0x253e81[_0xa535('0x44')]));_0x54dd0c[_0xa535('0x4c')][_0xa535('0x64')]=_0x22c83c['id'];if(_0x1a82b7['query'][_0xa535('0x50')]){_0x54dd0c[_0xa535('0x4c')]=_['merge'](_0x54dd0c[_0xa535('0x4c')],{'$or':_[_0xa535('0x41')](_0x54dd0c[_0xa535('0x45')],function(_0x365ccc){var _0x57c7a1={};_0x57c7a1[_0x365ccc]={'$like':'%'+_0x1a82b7[_0xa535('0x42')][_0xa535('0x50')]+'%'};return _0x57c7a1;})});}_0x54dd0c=_[_0xa535('0x4d')]({},_0x54dd0c,_0x1a82b7['options']);return db[_0xa535('0x65')][_0xa535('0x2f')]({'where':_0x54dd0c[_0xa535('0x4c')]})['then'](function(_0x34be4b){_0x587d38[_0xa535('0x2f')]=_0x34be4b;if(_0x1a82b7[_0xa535('0x42')]['includeAll']){_0x54dd0c['include']=[{'all':!![]}];}return db[_0xa535('0x65')]['findAll'](_0x54dd0c);})[_0xa535('0x1f')](function(_0x100f79){_0x587d38[_0xa535('0x67')]=_0x100f79;return _0x587d38;});}})['then'](respondWithFilteredResult(_0x34c8f2,_0x54dd0c))[_0xa535('0x28')](handleError(_0x34c8f2,null));};exports[_0xa535('0x68')]=function(_0x37c1ac,_0x224043,_0x35b1f9){return db[_0xa535('0x52')][_0xa535('0x5a')]({'where':{'id':_0x37c1ac[_0xa535('0x55')]['id']}})['then'](handleEntityNotFound(_0x224043,null))[_0xa535('0x1f')](function(_0x29fe79){if(_0x29fe79){return _0x29fe79[_0xa535('0x68')](_0x37c1ac[_0xa535('0x42')][_0xa535('0x69')]);}})[_0xa535('0x1f')](respondWithStatusCode(_0x224043,null))['catch'](handleError(_0x224043,null));};exports[_0xa535('0x6a')]=function(_0x6c49e8,_0xab6908,_0x941086){if(_0x6c49e8['body']['id']){delete _0x6c49e8['body']['id'];}return db[_0xa535('0x52')][_0xa535('0x5a')]({'where':{'id':_0x6c49e8[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0xab6908,null))[_0xa535('0x1f')](function(_0x3fa76b){if(_0x3fa76b){_0x6c49e8[_0xa535('0x5c')]['WhatsappAccountId']=_0x3fa76b['id'];return db[_0xa535('0x6b')][_0xa535('0x5b')](_0x6c49e8[_0xa535('0x5c')]);}})[_0xa535('0x1f')](respondWithResult(_0xab6908,null))[_0xa535('0x28')](handleError(_0xab6908,null));};exports['getAnswers']=function(_0x558ab3,_0x40130b,_0x4e984c){var _0x34c02e={'raw':![],'where':{}};var _0xfe7186={};var _0x24ffd1={'count':0x0,'rows':[]};return db[_0xa535('0x52')][_0xa535('0x66')]({'where':{'id':_0x558ab3[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x40130b,null))[_0xa535('0x1f')](function(_0x38669f){if(_0x38669f){_0xfe7186[_0xa535('0x40')]=_[_0xa535('0x43')](db['CannedAnswer'][_0xa535('0x56')]);_0xfe7186[_0xa535('0x42')]=_['keys'](_0x558ab3['query']);_0xfe7186[_0xa535('0x44')]=_['intersection'](_0xfe7186[_0xa535('0x40')],_0xfe7186['query']);_0x34c02e['attributes']=_[_0xa535('0x46')](_0xfe7186[_0xa535('0x40')],qs[_0xa535('0x47')](_0x558ab3['query'][_0xa535('0x47')]));_0x34c02e['attributes']=_0x34c02e['attributes'][_0xa535('0x57')]?_0x34c02e[_0xa535('0x45')]:_0xfe7186['model'];if(!_0x558ab3[_0xa535('0x42')]['hasOwnProperty']('nolimit')){_0x34c02e['limit']=qs[_0xa535('0x2e')](_0x558ab3[_0xa535('0x42')][_0xa535('0x2e')]);_0x34c02e['offset']=qs[_0xa535('0x2c')](_0x558ab3['query'][_0xa535('0x2c')]);}_0x34c02e[_0xa535('0x4a')]=qs[_0xa535('0x4b')](_0x558ab3['query'][_0xa535('0x4b')]);_0x34c02e['where']=qs[_0xa535('0x44')](_['pick'](_0x558ab3[_0xa535('0x42')],_0xfe7186['filters']));_0x34c02e[_0xa535('0x4c')][_0xa535('0x64')]=_0x38669f['id'];if(_0x558ab3[_0xa535('0x42')][_0xa535('0x50')]){_0x34c02e[_0xa535('0x4c')]=_[_0xa535('0x4d')](_0x34c02e[_0xa535('0x4c')],{'$or':_[_0xa535('0x41')](_0x34c02e[_0xa535('0x45')],function(_0x131942){var _0x5c5ac8={};_0x5c5ac8[_0x131942]={'$like':'%'+_0x558ab3[_0xa535('0x42')][_0xa535('0x50')]+'%'};return _0x5c5ac8;})});}_0x34c02e=_['merge']({},_0x34c02e,_0x558ab3['options']);return db[_0xa535('0x6b')][_0xa535('0x2f')]({'where':_0x34c02e[_0xa535('0x4c')]})[_0xa535('0x1f')](function(_0x5b27f2){_0x24ffd1[_0xa535('0x2f')]=_0x5b27f2;if(_0x558ab3[_0xa535('0x42')][_0xa535('0x51')]){_0x34c02e[_0xa535('0x58')]=[{'all':!![]}];}return db[_0xa535('0x6b')]['findAll'](_0x34c02e);})['then'](function(_0x4b2fd8){_0x24ffd1[_0xa535('0x67')]=_0x4b2fd8;return _0x24ffd1;});}})[_0xa535('0x1f')](respondWithFilteredResult(_0x40130b,_0x34c02e))[_0xa535('0x28')](handleError(_0x40130b,null));};exports['removeAnswers']=function(_0xb50a36,_0x1aab6e,_0x51e294){return db[_0xa535('0x52')][_0xa535('0x5a')]({'where':{'id':_0xb50a36[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x1aab6e,null))[_0xa535('0x1f')](function(_0x51d5ed){if(_0x51d5ed){return _0x51d5ed[_0xa535('0x6c')](_0xb50a36['query']['ids']);}})[_0xa535('0x1f')](respondWithStatusCode(_0x1aab6e,null))[_0xa535('0x28')](handleError(_0x1aab6e,null));};exports['addAgents']=function(_0x19e98f,_0x3d37be,_0x441dab){return db[_0xa535('0x52')][_0xa535('0x5a')]({'where':{'id':_0x19e98f[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x3d37be,null))[_0xa535('0x1f')](function(_0x371aa4){if(_0x371aa4){return _0x371aa4['addAgents'](_0x19e98f[_0xa535('0x5c')]['ids'],_[_0xa535('0x6d')](_0x19e98f[_0xa535('0x5c')],[_0xa535('0x69'),'id'])||{})[_0xa535('0x6e')](function(_0x20ac42){for(var _0xbdab26=0x0;_0xbdab26<_0x19e98f[_0xa535('0x5c')][_0xa535('0x69')][_0xa535('0x57')];_0xbdab26+=0x1){socket[_0xa535('0x6f')](_0xa535('0x70'),{'UserId':Number(_0x19e98f['body'][_0xa535('0x69')][_0xbdab26]),'WhatsappAccountId':Number(_0x19e98f[_0xa535('0x55')]['id'])});}return _0x20ac42;});}})[_0xa535('0x1f')](respondWithResult(_0x3d37be,null))[_0xa535('0x28')](handleError(_0x3d37be,null));};exports[_0xa535('0x71')]=function(_0x1b45b8,_0xed68dc,_0x14367e){return db[_0xa535('0x52')][_0xa535('0x5a')]({'where':{'id':_0x1b45b8[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0xed68dc,null))[_0xa535('0x1f')](function(_0x3225f5){if(_0x3225f5){return _0x3225f5[_0xa535('0x71')](_0x1b45b8[_0xa535('0x42')][_0xa535('0x69')])[_0xa535('0x1f')](function(){if(_[_0xa535('0x72')](_0x1b45b8['query'][_0xa535('0x69')])){for(var _0x4b983f=0x0;_0x4b983f<_0x1b45b8[_0xa535('0x42')][_0xa535('0x69')][_0xa535('0x57')];_0x4b983f+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x1b45b8[_0xa535('0x42')]['ids'][_0x4b983f]),'WhatsappAccountId':Number(_0x1b45b8[_0xa535('0x55')]['id'])});}}else{socket[_0xa535('0x6f')](_0xa535('0x73'),{'UserId':Number(_0x1b45b8[_0xa535('0x42')][_0xa535('0x69')]),'WhatsappAccountId':Number(_0x1b45b8[_0xa535('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0xed68dc,null))[_0xa535('0x28')](handleError(_0xed68dc,null));};exports[_0xa535('0x74')]=function(_0x478bad,_0x2ebf9c,_0x408f82){var _0x42866f={};var _0x3cd6dc={};var _0x356878;var _0x4e58bf;return db[_0xa535('0x52')][_0xa535('0x66')]({'where':{'id':_0x478bad[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x2ebf9c,null))[_0xa535('0x1f')](function(_0x4df0b9){if(_0x4df0b9){_0x356878=_0x4df0b9;_0x3cd6dc[_0xa535('0x40')]=_['keys'](db[_0xa535('0x75')][_0xa535('0x56')]);_0x3cd6dc[_0xa535('0x42')]=_[_0xa535('0x43')](_0x478bad[_0xa535('0x42')]);_0x3cd6dc[_0xa535('0x44')]=_[_0xa535('0x46')](_0x3cd6dc[_0xa535('0x40')],_0x3cd6dc[_0xa535('0x42')]);_0x42866f[_0xa535('0x45')]=_['intersection'](_0x3cd6dc[_0xa535('0x40')],qs[_0xa535('0x47')](_0x478bad[_0xa535('0x42')]['fields']));_0x42866f['attributes']=_0x42866f[_0xa535('0x45')][_0xa535('0x57')]?_0x42866f[_0xa535('0x45')]:_0x3cd6dc[_0xa535('0x40')];_0x42866f[_0xa535('0x4a')]=qs[_0xa535('0x4b')](_0x478bad[_0xa535('0x42')]['sort']);_0x42866f[_0xa535('0x4c')]=qs['filters'](_['pick'](_0x478bad[_0xa535('0x42')],_0x3cd6dc[_0xa535('0x44')]));if(_0x478bad['query'][_0xa535('0x50')]){_0x42866f[_0xa535('0x4c')]=_['merge'](_0x42866f['where'],{'$or':_[_0xa535('0x41')](_0x42866f[_0xa535('0x45')],function(_0x2f9718){var _0x429ad5={};_0x429ad5[_0x2f9718]={'$like':'%'+_0x478bad[_0xa535('0x42')][_0xa535('0x50')]+'%'};return _0x429ad5;})});}_0x42866f=_[_0xa535('0x4d')]({},_0x42866f,_0x478bad[_0xa535('0x59')]);return _0x356878[_0xa535('0x74')](_0x42866f);}})['then'](function(_0x5d58c4){if(_0x5d58c4){_0x4e58bf=_0x5d58c4[_0xa535('0x57')];if(!_0x478bad[_0xa535('0x42')][_0xa535('0x48')](_0xa535('0x49'))){_0x42866f[_0xa535('0x2e')]=qs['limit'](_0x478bad['query'][_0xa535('0x2e')]);_0x42866f['offset']=qs[_0xa535('0x2c')](_0x478bad[_0xa535('0x42')][_0xa535('0x2c')]);}return _0x356878[_0xa535('0x74')](_0x42866f);}})[_0xa535('0x1f')](function(_0x2768d2){if(_0x2768d2){return _0x2768d2?{'count':_0x4e58bf,'rows':_0x2768d2}:null;}})[_0xa535('0x1f')](respondWithResult(_0x2ebf9c,null))['catch'](handleError(_0x2ebf9c,null));};exports['addApplications']=function(_0x1e1410,_0x5a0c61){var _0x1164bb=_0x1e1410[_0xa535('0x55')]['id'];var _0x233505=_0x1e1410[_0xa535('0x5c')];var _0x434ff6=0xc8;var _0xd5d729=null;return db[_0xa535('0x76')]['transaction']({'isolationLevel':db[_0xa535('0x76')]['Transaction'][_0xa535('0x77')][_0xa535('0x78')]},function(_0xff8b1c){return db[_0xa535('0x52')]['findOne']({'where':{'id':_0x1164bb},'transaction':_0xff8b1c})['then'](function(_0x11c146){if(_0x11c146){return db[_0xa535('0x79')][_0xa535('0x35')]({'where':{'WhatsappAccountId':_0x1164bb},'transaction':_0xff8b1c})[_0xa535('0x1f')](function(){var _0x41fd71=_[_0xa535('0x41')](_0x233505,function(_0x2ea55b){_0x2ea55b[_0xa535('0x64')]=_0x1164bb;return _0x2ea55b;});return db[_0xa535('0x79')][_0xa535('0x7a')](_0x41fd71,{'transaction':_0xff8b1c});});}else{_0x434ff6=0x194;_0xd5d729=[];}});})['then'](function(){if(_0x434ff6!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x1164bb},'order':_0xa535('0x7b')})[_0xa535('0x1f')](function(_0x34f94e){_0xd5d729=_0x34f94e;});}})[_0xa535('0x28')](function(_0x922762){_0x434ff6=0x1f4;logger['error'](_0x922762['stack']);if(_0x922762[_0xa535('0x3a')]){delete _0x922762[_0xa535('0x3a')];}_0xd5d729=_0x922762;})[_0xa535('0x7c')](function(){if(_0xd5d729===null){_0x5a0c61[_0xa535('0x29')](_0x434ff6);}else{if(_0x434ff6===0x1f4){_0x5a0c61['status'](_0x434ff6)[_0xa535('0x3b')](_0xd5d729);}else{_0x5a0c61[_0xa535('0x2b')](_0x434ff6)[_0xa535('0x31')](_0xd5d729);}}});};exports['getApplications']=function(_0x5e7e0d,_0x5584e9,_0x322902){var _0x180659={};var _0x5c6fe2={};var _0x926786;var _0x3ea252;return db[_0xa535('0x52')][_0xa535('0x66')]({'where':{'id':_0x5e7e0d[_0xa535('0x55')]['id']}})[_0xa535('0x1f')](handleEntityNotFound(_0x5584e9,null))[_0xa535('0x1f')](function(_0x2ad656){if(_0x2ad656){_0x926786=_0x2ad656;_0x5c6fe2[_0xa535('0x40')]=_['keys'](db[_0xa535('0x79')]['rawAttributes']);_0x5c6fe2[_0xa535('0x42')]=_[_0xa535('0x43')](_0x5e7e0d[_0xa535('0x42')]);_0x5c6fe2[_0xa535('0x44')]=_[_0xa535('0x46')](_0x5c6fe2['model'],_0x5c6fe2['query']);_0x180659[_0xa535('0x45')]=_[_0xa535('0x46')](_0x5c6fe2[_0xa535('0x40')],qs[_0xa535('0x47')](_0x5e7e0d[_0xa535('0x42')][_0xa535('0x47')]));_0x180659['attributes']=_0x180659[_0xa535('0x45')][_0xa535('0x57')]?_0x180659['attributes']:_0x5c6fe2[_0xa535('0x40')];_0x180659[_0xa535('0x4a')]=qs[_0xa535('0x4b')](_0x5e7e0d[_0xa535('0x42')][_0xa535('0x4b')]);_0x180659['where']=qs['filters'](_['pick'](_0x5e7e0d['query'],_0x5c6fe2[_0xa535('0x44')]));if(_0x5e7e0d[_0xa535('0x42')]['filter']){_0x180659['where']=_[_0xa535('0x4d')](_0x180659['where'],{'$or':_[_0xa535('0x41')](_0x180659[_0xa535('0x45')],function(_0x64cfe8){var _0x3a1876={};_0x3a1876[_0x64cfe8]={'$like':'%'+_0x5e7e0d[_0xa535('0x42')]['filter']+'%'};return _0x3a1876;})});}_0x180659=_['merge']({},_0x180659,_0x5e7e0d[_0xa535('0x59')]);return _0x926786['getApplications'](_0x180659);}})['then'](function(_0x46b618){if(_0x46b618){_0x3ea252=_0x46b618[_0xa535('0x57')];if(!_0x5e7e0d['query']['hasOwnProperty'](_0xa535('0x49'))){_0x180659[_0xa535('0x2e')]=qs[_0xa535('0x2e')](_0x5e7e0d[_0xa535('0x42')]['limit']);_0x180659[_0xa535('0x2c')]=qs[_0xa535('0x2c')](_0x5e7e0d[_0xa535('0x42')]['offset']);}return _0x926786[_0xa535('0x7d')](_0x180659);}})[_0xa535('0x1f')](function(_0x422dc9){if(_0x422dc9){return _0x422dc9?{'count':_0x3ea252,'rows':_0x422dc9}:null;}})['then'](respondWithResult(_0x5584e9,null))['catch'](handleError(_0x5584e9,null));};exports[_0xa535('0x7e')]=function(_0x3e7ced,_0x4a21c9,_0xc9dbfe){var _0x5c460c={'channel':'whatsapp'};var _0x18da76=[];var _0x595b40=[];var _0x29f485={};return db[_0xa535('0x52')]['find']({'where':{'id':_0x3e7ced[_0xa535('0x55')]['id']},'include':[{'model':db[_0xa535('0x79')],'as':'Applications'}]})[_0xa535('0x1f')](handleEntityNotFound(_0x4a21c9,null))[_0xa535('0x1f')](function(_0x5c297a){_0x5c460c[_0xa535('0x7f')]=_0x5c297a;if(_0x5c460c[_0xa535('0x7f')]&&_0x5c460c['account'][_0xa535('0x4e')]===_0xa535('0x80')&&_0x3e7ced[_0xa535('0x5c')][_0xa535('0x81')]){if(_0x3e7ced[_0xa535('0x5c')]['statuses']['length']===0x0)return;if(_0x3e7ced['body'][_0xa535('0x81')][0x0][_0xa535('0x82')]!==_0xa535('0x83'))return;return db[_0xa535('0x84')][_0xa535('0x34')]({'read':!![],'readAt':_0x3e7ced[_0xa535('0x5c')][_0xa535('0x81')][0x0]['timestamp']},{'where':{'messageId':_0x3e7ced[_0xa535('0x5c')][_0xa535('0x81')][0x0][_0xa535('0x85')]},'individualHooks':!![]})[_0xa535('0x1f')](function(_0x4dcc7e){return _0x4a21c9['status'](0xc8)[_0xa535('0x31')](_0x4dcc7e);});}_0x5c460c[_0xa535('0x86')]=_[_0xa535('0x87')](_0x5c297a[_0xa535('0x88')],[_0xa535('0x7b')],[_0xa535('0x89')]);if(_0x5c460c[_0xa535('0x7f')][_0xa535('0x88')]){delete _0x5c460c[_0xa535('0x7f')][_0xa535('0x88')];}return db['CmContact'][_0xa535('0x62')]()['then'](function(_0x47d4a2){if(!_0x47d4a2){throw new db[(_0xa535('0x8a'))][(_0xa535('0x8b'))](_0xa535('0x8c'));}_0x18da76=_['difference'](_['keys'](_0x47d4a2),['createdAt',_0xa535('0x8d')]);_0x595b40=_[_0xa535('0x8e')](_[_0xa535('0x43')](_0x47d4a2),[_0xa535('0x8f'),'updatedAt',_0xa535('0x90'),_0xa535('0x91')]);_0x5c460c[_0xa535('0x5c')]={'mapKey':_0xa535('0x92')};if(_0x5c460c[_0xa535('0x7f')]&&_0x5c460c[_0xa535('0x7f')][_0xa535('0x4e')]==='twilio'){_0x5c460c[_0xa535('0x5c')][_0xa535('0x93')]=_0x3e7ced['body'][_0xa535('0x94')][_0xa535('0x95')]('whatsapp:','');_0x5c460c[_0xa535('0x5c')]['body']=_0x3e7ced[_0xa535('0x5c')][_0xa535('0x96')];_0x5c460c[_0xa535('0x5c')]['messageId']=_0x3e7ced[_0xa535('0x5c')][_0xa535('0x97')];}if(_0x5c460c[_0xa535('0x7f')]&&_0x5c460c[_0xa535('0x7f')][_0xa535('0x4e')]==='sinch'){_0x5c460c[_0xa535('0x5c')][_0xa535('0x93')]=_0x3e7ced[_0xa535('0x5c')][_0xa535('0x98')][0x0][_0xa535('0x93')];_0x5c460c[_0xa535('0x5c')][_0xa535('0x5c')]=_0x3e7ced[_0xa535('0x5c')]['notifications'][0x0][_0xa535('0x26')][_0xa535('0x5c')];_0x5c460c[_0xa535('0x5c')][_0xa535('0x99')]=_0x3e7ced['body'][_0xa535('0x98')][0x0]['message_id'];}if(_0x5c460c['body']['id']){delete _0x5c460c['body']['id'];}if(_[_0xa535('0x9a')](_0x5c460c[_0xa535('0x5c')][_0xa535('0x93')])){throw new db[(_0xa535('0x8a'))][(_0xa535('0x8b'))](_0xa535('0x9b'));}if(_[_0xa535('0x9a')](_0x5c460c['body'][_0xa535('0x5c')])||_0x5c460c[_0xa535('0x5c')][_0xa535('0x5c')]===''){throw new db[(_0xa535('0x8a'))][(_0xa535('0x8b'))](_0xa535('0x9c'));}if(_[_0xa535('0x9a')](_0x5c460c[_0xa535('0x5c')][_0xa535('0x9d')])){throw new db[(_0xa535('0x8a'))][(_0xa535('0x8b'))](_0xa535('0x9e')+_0x595b40);}if(!_[_0xa535('0x9f')](_0x595b40,_0x5c460c[_0xa535('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0xa535('0x8b'))](_0xa535('0xa0')+_0x595b40);}_0x29f485[_0x5c460c[_0xa535('0x5c')]['mapKey']]=_0x5c460c[_0xa535('0x5c')][_0xa535('0x93')];return db[_0xa535('0xa1')][_0xa535('0x5a')]({'where':{'id':_0x5c460c[_0xa535('0x7f')]['ListId']},'include':[{'model':db[_0xa535('0xa2')],'as':'Contacts','where':_0x29f485,'limit':0x1,'order':[[_0xa535('0x8d'),'DESC']]}]});})[_0xa535('0x1f')](handleEntityNotFound(_0x4a21c9,null))['then'](function(_0x47bed9){if(_0x47bed9){_0x5c460c['list']=_[_0xa535('0x6d')](_0x47bed9,[_0xa535('0xa3')]);if(_0x47bed9[_0xa535('0xa3')]['length']){return _0x47bed9[_0xa535('0xa3')][0x0];}var _0x1f1a0f=_[_0xa535('0x1a')](_0x5c460c['body'],{'firstName':_0x5c460c[_0xa535('0x5c')][_0xa535('0x93')],'ListId':_0x47bed9['id']});_0x1f1a0f[_0x5c460c['body'][_0xa535('0x9d')]]=_0x5c460c[_0xa535('0x5c')]['from'];return db[_0xa535('0xa2')][_0xa535('0x5b')](_0x1f1a0f,{'fields':_0x18da76,'raw':!![]});}})[_0xa535('0x1f')](handleEntityNotFound(_0x4a21c9,null))[_0xa535('0x1f')](function(_0x134fc8){if(_0x134fc8){_0x5c460c[_0xa535('0xa4')]=_0x134fc8;var _0x5b2ce1={'ContactId':_0x134fc8['id'],'phone':_0x5c460c[_0xa535('0x5c')][_0xa535('0x93')],'WhatsappAccountId':_0x3e7ced['params']['id']};var _0x3cb12c={'ContactId':_0x134fc8['id'],'WhatsappAccountId':_0x3e7ced[_0xa535('0x55')]['id'],'closed':![]};return db[_0xa535('0xa5')][_0xa535('0x5a')]({'where':_0x3cb12c})['then'](function(_0x4a40b6){if(_0x4a40b6){return[_0x4a40b6,![]];}return db[_0xa535('0xa5')]['create'](_0x5b2ce1)[_0xa535('0x1f')](function(_0x2cc4c1){return[_0x2cc4c1,!![]];});});}})[_0xa535('0x6e')](function(_0x46a571,_0x54bdce){_0x5c460c[_0xa535('0xa6')]=_0x46a571[_0xa535('0x36')]({'plain':!![]});_0x5c460c[_0xa535('0xa6')]['created']=![];if(_0x54bdce){if(_0x5c460c['account']['autoclose']){_0x5c460c[_0xa535('0x86')][_0xa535('0xa7')]({'id':0x0,'priority':_0x5c460c['applications'][_0xa535('0x57')]+0x1,'app':_0xa535('0xa8'),'appdata':_0xa535('0xa9'),'interval':_0xa535('0xaa')});}_0x5c460c['interaction'][_0xa535('0xab')]=!![];}return db[_0xa535('0x84')]['create']({'phone':_0x5c460c[_0xa535('0x5c')]['from'],'messageId':_0x5c460c[_0xa535('0x5c')][_0xa535('0x99')],'body':_0x5c460c[_0xa535('0x5c')][_0xa535('0x5c')],'WhatsappAccountId':_0x3e7ced[_0xa535('0x55')]['id'],'WhatsappInteractionId':_0x46a571['id'],'direction':'in','ContactId':_0x46a571[_0xa535('0xac')],'AttachmentId':_0x5c460c['body'][_0xa535('0xad')]});})[_0xa535('0x1f')](function(_0x2b7bed){_0x5c460c['message']=_0x2b7bed;if(_0x5c460c[_0xa535('0xa6')]['UserId']){return db[_0xa535('0x75')][_0xa535('0x5a')]({'attributes':['id',_0xa535('0x3a')],'where':{'id':_0x5c460c['interaction'][_0xa535('0xae')]}})[_0xa535('0x1f')](function(_0x41266c){if(_0x41266c){_0x5c460c[_0xa535('0x86')][_0xa535('0xaf')]({'id':0x0,'priority':0x0,'app':_0xa535('0xb0'),'appdata':_0x41266c[_0xa535('0x3a')]+','+(_0x5c460c[_0xa535('0x7f')][_0xa535('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa535('0xb2'),'startRouting',_0x5c460c);});}return respondWithRpcPromise(_0xa535('0xb2'),_0xa535('0xb3'),_0x5c460c);})[_0xa535('0x1f')](function(_0x536637){if(_0x536637){var _0x5f19df=0xc8;var _0x5a6e31='receiveMessage';logger[_0xa535('0x20')](_0xa535('0xb4'),_0x5a6e31,_0x5f19df,_0xa535('0xb5'));logger[_0xa535('0xb6')](_0xa535('0xb7'),_0x5a6e31,_0x5f19df,_0xa535('0xb5'),JSON['stringify'](_0x536637));if(_0x5c460c[_0xa535('0x7f')][_0xa535('0x4e')]==='twilio'){return _0x4a21c9['status'](_0x5f19df)['set'](_0xa535('0xb8'),'text/xml')[_0xa535('0x3b')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x4a21c9[_0xa535('0x2b')](_0x5f19df)[_0xa535('0x31')](_0x536637);}}});})['catch'](handleError(_0x4a21c9,null));};exports['send']=function(_0x3e876d,_0x3d75b0,_0x59d07f){var _0x16cfc0,_0x514dce,_0x57a750;if(_[_0xa535('0x9a')](_0x3e876d['body'][_0xa535('0x5c')])||_0x3e876d[_0xa535('0x5c')][_0xa535('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0xa535('0x9c'));}if(_[_0xa535('0x9a')](_0x3e876d[_0xa535('0x5c')]['to'])){throw new db[(_0xa535('0x8a'))][(_0xa535('0x8b'))]('to\x20is\x20mandatory');}_0x16cfc0=_0x3e876d[_0xa535('0x5c')]['to'];return db['WhatsappAccount'][_0xa535('0x5a')]({'where':{'id':_0x3e876d['params']['id']},'include':[{'model':db[_0xa535('0xa1')],'as':'List','include':[{'model':db[_0xa535('0xa2')],'as':_0xa535('0xa3'),'where':{'mobile':_0x16cfc0},'limit':0x1,'order':[[_0xa535('0x8d'),_0xa535('0xb9')]]}]}]})[_0xa535('0x1f')](handleEntityNotFound(_0x3d75b0,null))[_0xa535('0x1f')](function(_0x9b819b){if(_0x9b819b&&_0x9b819b['List']){_0x514dce=_0x9b819b[_0xa535('0x36')]({'plain':!![]});if(_0x514dce[_0xa535('0xba')]&&_0x514dce[_0xa535('0xba')][_0xa535('0xa3')][_0xa535('0x57')]){return _0x514dce[_0xa535('0xba')][_0xa535('0xa3')][0x0];}return db[_0xa535('0xa2')][_0xa535('0x5b')](_['defaults'](_0x3e876d['body'],{'firstName':_0x16cfc0,'mobile':_0x16cfc0,'phone':_0x16cfc0,'ListId':_0x514dce['ListId']}));}})[_0xa535('0x1f')](handleEntityNotFound(_0x3d75b0,null))[_0xa535('0x1f')](function(_0x347a40){if(_0x347a40){_0x57a750=_0x347a40;return db['WhatsappInteraction'][_0xa535('0x5a')]({'where':{'ContactId':_0x57a750['id'],'closed':![],'WhatsappAccountId':_0x514dce['id']}})[_0xa535('0x1f')](function(_0x4e9719){if(_0x4e9719){return[_0x4e9719,![]];}return db[_0xa535('0xa5')][_0xa535('0x5b')]({'UserId':_0x3e876d[_0xa535('0x5d')]['id'],'ContactId':_0x57a750['id'],'WhatsappAccountId':_0x514dce['id'],'phone':_0x16cfc0,'firstMsgDirection':_0xa535('0xbb'),'Messages':[_[_0xa535('0x4d')](_0x3e876d[_0xa535('0x5c')],{'read':![],'body':_0x3e876d[_0xa535('0x5c')]['body'],'phone':_0x16cfc0,'WhatsappAccountId':_0x514dce['id'],'UserId':_0x3e876d[_0xa535('0x5d')]['id'],'ContactId':_0x57a750['id']})]},{'include':[{'model':db[_0xa535('0x84')],'as':_0xa535('0xbc')}]})[_0xa535('0x1f')](function(_0x296db4){return[_0x296db4,!![]];});});}})[_0xa535('0x6e')](function(_0x4a0d20,_0x29fd9b){if(_0x29fd9b){return _0x4a0d20;}return db[_0xa535('0x84')]['create'](_[_0xa535('0x4d')](_0x3e876d[_0xa535('0x5c')],{'read':![],'body':_0x3e876d['body']['body'],'phone':_0x16cfc0,'WhatsappAccountId':_0x514dce['id'],'WhatsappInteractionId':_0x4a0d20['id'],'UserId':_0x3e876d[_0xa535('0x5d')]['id'],'ContactId':_0x57a750['id']}))[_0xa535('0x1f')](function(_0x172d89){_0x4a0d20[_0xa535('0xbd')][_0xa535('0xbc')]=[];_0x4a0d20['dataValues']['Messages'][_0xa535('0xa7')](_0x172d89[_0xa535('0xbd')]);return _0x4a0d20;});})[_0xa535('0x1f')](respondWithResult(_0x3d75b0,null))[_0xa535('0x28')](handleError(_0x3d75b0,null));};
\ No newline at end of file
+var _0x9fed=['result','end','offset','undefined','limit','count','status','set','json','apply','reject','save','destroy','get','UserProfileResource','sendStatus','stack','name','send','mandatoryDispositionPause','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','options','WhatsappAccount','includeAll','include','findAll','rows','catch','params','Pause','create','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','nolimit','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','read','WhatsappMessage','update','timestamp','message_id','applications','orderBy','asc','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','agent','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','CmList','List','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x122de0,_0x12cbca){var _0x153be0=function(_0x1a30ec){while(--_0x1a30ec){_0x122de0['push'](_0x122de0['shift']());}};_0x153be0(++_0x12cbca);}(_0x9fed,0x94));var _0xd9fe=function(_0x5910fb,_0x4eb2e3){_0x5910fb=_0x5910fb-0x0;var _0x2e72fd=_0x9fed[_0x5910fb];return _0x2e72fd;};'use strict';var emlformat=require(_0xd9fe('0x0'));var rimraf=require(_0xd9fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9fe('0x2'));var rp=require('request-promise');var moment=require(_0xd9fe('0x3'));var BPromise=require(_0xd9fe('0x4'));var Mustache=require(_0xd9fe('0x5'));var util=require(_0xd9fe('0x6'));var path=require(_0xd9fe('0x7'));var sox=require('sox');var csv=require(_0xd9fe('0x8'));var ejs=require(_0xd9fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9fe('0xa'));var squel=require('squel');var crypto=require(_0xd9fe('0xb'));var jsforce=require(_0xd9fe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd9fe('0x8'));var querystring=require(_0xd9fe('0xd'));var Papa=require(_0xd9fe('0xe'));var Redis=require(_0xd9fe('0xf'));var authService=require(_0xd9fe('0x10'));var qs=require(_0xd9fe('0x11'));var as=require(_0xd9fe('0x12'));var hardwareService=require(_0xd9fe('0x13'));var logger=require(_0xd9fe('0x14'))(_0xd9fe('0x15'));var utils=require(_0xd9fe('0x16'));var config=require(_0xd9fe('0x17'));var licenseUtil=require(_0xd9fe('0x18'));var db=require(_0xd9fe('0x19'))['db'];config[_0xd9fe('0x1a')]=_[_0xd9fe('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd9fe('0x1c'))(new Redis(config[_0xd9fe('0x1a')]));require(_0xd9fe('0x1d'))[_0xd9fe('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd9fe('0x1f')][_0xd9fe('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x52146b,_0x51b4c1,_0x4cb56c,_0xc0933e){return new BPromise(function(_0x2fae68,_0x567b0b){var _0x3efa4b=_0xc0933e||client;return _0x3efa4b[_0xd9fe('0x21')](_0x52146b,_0x4cb56c)[_0xd9fe('0x22')](function(_0x48fc18){logger[_0xd9fe('0x23')](_0xd9fe('0x24'),_0x51b4c1,_0xd9fe('0x25'));logger[_0xd9fe('0x26')](_0xd9fe('0x27'),_0x51b4c1,_0xd9fe('0x25'),JSON[_0xd9fe('0x28')](_0x48fc18));if(_0x48fc18[_0xd9fe('0x29')]){if(_0x48fc18[_0xd9fe('0x29')][_0xd9fe('0x2a')]===0x1f4){logger[_0xd9fe('0x29')](_0xd9fe('0x24'),_0x51b4c1,_0x48fc18[_0xd9fe('0x29')]['message']);return _0x567b0b(_0x48fc18[_0xd9fe('0x29')]['message']);}logger['error'](_0xd9fe('0x24'),_0x51b4c1,_0x48fc18[_0xd9fe('0x29')][_0xd9fe('0x2b')]);return _0x2fae68(_0x48fc18['error'][_0xd9fe('0x2b')]);}else{logger[_0xd9fe('0x23')](_0xd9fe('0x24'),_0x51b4c1,_0xd9fe('0x25'));_0x2fae68(_0x48fc18[_0xd9fe('0x2c')][_0xd9fe('0x2b')]);}})['catch'](function(_0x1b48d4){logger[_0xd9fe('0x29')](_0xd9fe('0x24'),_0x51b4c1,_0x1b48d4);_0x567b0b(_0x1b48d4);});});}function respondWithStatusCode(_0x49af06,_0x253819){_0x253819=_0x253819||0xcc;return function(_0x157713){if(_0x157713){return _0x49af06['sendStatus'](_0x253819);}return _0x49af06['status'](_0x253819)[_0xd9fe('0x2d')]();};}function respondWithResult(_0x5a8e68,_0x5a25ea){_0x5a25ea=_0x5a25ea||0xc8;return function(_0x335191){if(_0x335191){return _0x5a8e68['status'](_0x5a25ea)['json'](_0x335191);}};}function respondWithFilteredResult(_0x452ea6,_0x53f533){return function(_0x4ee0d5){if(_0x4ee0d5){var _0x56a43a=typeof _0x53f533[_0xd9fe('0x2e')]===_0xd9fe('0x2f')&&typeof _0x53f533[_0xd9fe('0x30')]===_0xd9fe('0x2f');var _0x342811=_0x4ee0d5[_0xd9fe('0x31')];var _0xeadd97=_0x56a43a?0x0:_0x53f533[_0xd9fe('0x2e')];var _0x284a62=_0x56a43a?_0x4ee0d5[_0xd9fe('0x31')]:_0x53f533['offset']+_0x53f533['limit'];var _0x9ae4cb;if(_0x284a62>=_0x342811){_0x284a62=_0x342811;_0x9ae4cb=0xc8;}else{_0x9ae4cb=0xce;}_0x452ea6[_0xd9fe('0x32')](_0x9ae4cb);return _0x452ea6[_0xd9fe('0x33')]('Content-Range',_0xeadd97+'-'+_0x284a62+'/'+_0x342811)[_0xd9fe('0x34')](_0x4ee0d5);}return null;};}function patchUpdates(_0x1600af){return function(_0x2c8aa7){try{jsonpatch[_0xd9fe('0x35')](_0x2c8aa7,_0x1600af,!![]);}catch(_0x4cac67){return BPromise[_0xd9fe('0x36')](_0x4cac67);}return _0x2c8aa7[_0xd9fe('0x37')]();};}function saveUpdates(_0x107f26,_0x47e070){return function(_0x514048){if(_0x514048){return _0x514048['update'](_0x107f26)['then'](function(_0x5b2167){return _0x5b2167;});}return null;};}function removeEntity(_0x248faa,_0x490152){return function(_0x4ce079){if(_0x4ce079){return _0x4ce079[_0xd9fe('0x38')]()['then'](function(){var _0x580edb=_0x4ce079[_0xd9fe('0x39')]({'plain':!![]});var _0x253514='WhatsappAccounts';return db[_0xd9fe('0x3a')][_0xd9fe('0x38')]({'where':{'type':_0x253514,'resourceId':_0x580edb['id']}})[_0xd9fe('0x22')](function(){return _0x4ce079;});})[_0xd9fe('0x22')](function(){_0x248faa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x547bb4,_0x5bcb42){return function(_0x4fe7ed){if(!_0x4fe7ed){_0x547bb4[_0xd9fe('0x3b')](0x194);}return _0x4fe7ed;};}function handleError(_0x3d95ca,_0x223ec4){_0x223ec4=_0x223ec4||0x1f4;return function(_0xff538b){logger['error'](_0xff538b[_0xd9fe('0x3c')]);if(_0xff538b[_0xd9fe('0x3d')]){delete _0xff538b['name'];}_0x3d95ca['status'](_0x223ec4)[_0xd9fe('0x3e')](_0xff538b);};}exports['index']=function(_0x5c1514,_0x4acee4){var _0x5b6a8d={'include':[{'model':db['Pause'],'as':_0xd9fe('0x3f')}]},_0xe80d96={},_0x10a0fe={'count':0x0,'rows':[]};var _0x16ab87=_['map'](db['WhatsappAccount'][_0xd9fe('0x40')],function(_0x27bbbb){return{'name':_0x27bbbb['fieldName'],'type':_0x27bbbb['type']['key']};});_0xe80d96[_0xd9fe('0x41')]=_[_0xd9fe('0x42')](_0x16ab87,_0xd9fe('0x3d'));_0xe80d96[_0xd9fe('0x43')]=_[_0xd9fe('0x44')](_0x5c1514[_0xd9fe('0x43')]);_0xe80d96['filters']=_[_0xd9fe('0x45')](_0xe80d96['model'],_0xe80d96['query']);_0x5b6a8d[_0xd9fe('0x46')]=_[_0xd9fe('0x45')](_0xe80d96['model'],qs[_0xd9fe('0x47')](_0x5c1514[_0xd9fe('0x43')]['fields']));_0x5b6a8d[_0xd9fe('0x46')]=_0x5b6a8d[_0xd9fe('0x46')][_0xd9fe('0x48')]?_0x5b6a8d[_0xd9fe('0x46')]:_0xe80d96[_0xd9fe('0x41')];if(!_0x5c1514[_0xd9fe('0x43')]['hasOwnProperty']('nolimit')){_0x5b6a8d[_0xd9fe('0x30')]=qs[_0xd9fe('0x30')](_0x5c1514['query'][_0xd9fe('0x30')]);_0x5b6a8d[_0xd9fe('0x2e')]=qs['offset'](_0x5c1514[_0xd9fe('0x43')]['offset']);}_0x5b6a8d[_0xd9fe('0x49')]=qs[_0xd9fe('0x4a')](_0x5c1514[_0xd9fe('0x43')][_0xd9fe('0x4a')]);_0x5b6a8d[_0xd9fe('0x4b')]=qs[_0xd9fe('0x4c')](_[_0xd9fe('0x4d')](_0x5c1514[_0xd9fe('0x43')],_0xe80d96[_0xd9fe('0x4c')]),_0x16ab87);if(_0x5c1514[_0xd9fe('0x43')][_0xd9fe('0x4e')]){_0x5b6a8d[_0xd9fe('0x4b')]=_[_0xd9fe('0x4f')](_0x5b6a8d['where'],{'$or':_[_0xd9fe('0x42')](_0x16ab87,function(_0x7517e3){if(_0x7517e3[_0xd9fe('0x50')]!=='VIRTUAL'){var _0x4f973c={};_0x4f973c[_0x7517e3[_0xd9fe('0x3d')]]={'$like':'%'+_0x5c1514[_0xd9fe('0x43')][_0xd9fe('0x4e')]+'%'};return _0x4f973c;}})});}_0x5b6a8d=_['merge']({},_0x5b6a8d,_0x5c1514[_0xd9fe('0x51')]);var _0x16d8ba={'where':_0x5b6a8d[_0xd9fe('0x4b')]};return db[_0xd9fe('0x52')]['count'](_0x16d8ba)[_0xd9fe('0x22')](function(_0x548b3f){_0x10a0fe[_0xd9fe('0x31')]=_0x548b3f;if(_0x5c1514[_0xd9fe('0x43')][_0xd9fe('0x53')]){_0x5b6a8d[_0xd9fe('0x54')]=[{'all':!![]}];}return db[_0xd9fe('0x52')][_0xd9fe('0x55')](_0x5b6a8d);})[_0xd9fe('0x22')](function(_0x281b9e){_0x10a0fe[_0xd9fe('0x56')]=_0x281b9e;return _0x10a0fe;})[_0xd9fe('0x22')](respondWithFilteredResult(_0x4acee4,_0x5b6a8d))[_0xd9fe('0x57')](handleError(_0x4acee4,null));};exports['show']=function(_0x27e994,_0x3ee5c0){var _0x101111={'raw':![],'where':{'id':_0x27e994[_0xd9fe('0x58')]['id']},'include':[{'model':db[_0xd9fe('0x59')],'as':_0xd9fe('0x3f')}]},_0x16825b={};_0x16825b[_0xd9fe('0x41')]=_[_0xd9fe('0x44')](db[_0xd9fe('0x52')][_0xd9fe('0x40')]);_0x16825b[_0xd9fe('0x43')]=_[_0xd9fe('0x44')](_0x27e994[_0xd9fe('0x43')]);_0x16825b[_0xd9fe('0x4c')]=_[_0xd9fe('0x45')](_0x16825b[_0xd9fe('0x41')],_0x16825b['query']);_0x101111['attributes']=_[_0xd9fe('0x45')](_0x16825b[_0xd9fe('0x41')],qs['fields'](_0x27e994[_0xd9fe('0x43')][_0xd9fe('0x47')]));_0x101111[_0xd9fe('0x46')]=_0x101111[_0xd9fe('0x46')][_0xd9fe('0x48')]?_0x101111[_0xd9fe('0x46')]:_0x16825b['model'];if(_0x27e994[_0xd9fe('0x43')][_0xd9fe('0x53')]){_0x101111['include']=[{'all':!![]}];}_0x101111=_[_0xd9fe('0x4f')]({},_0x101111,_0x27e994['options']);return db[_0xd9fe('0x52')]['find'](_0x101111)[_0xd9fe('0x22')](handleEntityNotFound(_0x3ee5c0,null))[_0xd9fe('0x22')](respondWithResult(_0x3ee5c0,null))['catch'](handleError(_0x3ee5c0,null));};exports[_0xd9fe('0x5a')]=function(_0x1d14a5,_0x37038f){return db[_0xd9fe('0x52')][_0xd9fe('0x5a')](_0x1d14a5['body'],{})[_0xd9fe('0x22')](function(_0x5d1fac){var _0x153c1a=_0x1d14a5['user'][_0xd9fe('0x39')]({'plain':!![]});if(!_0x153c1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x153c1a[_0xd9fe('0x5b')]===_0xd9fe('0x5c')){var _0x4eef6d=_0x5d1fac['get']({'plain':!![]});var _0x7d15bf='WhatsappAccounts';return db[_0xd9fe('0x5d')][_0xd9fe('0x5e')]({'where':{'name':_0x7d15bf,'userProfileId':_0x153c1a['userProfileId']},'raw':!![]})[_0xd9fe('0x22')](function(_0x4fbb38){if(_0x4fbb38&&_0x4fbb38[_0xd9fe('0x5f')]===0x0){return db[_0xd9fe('0x3a')]['create']({'name':_0x4eef6d[_0xd9fe('0x3d')],'resourceId':_0x4eef6d['id'],'type':_0x4fbb38[_0xd9fe('0x3d')],'sectionId':_0x4fbb38['id']},{})['then'](function(){return _0x5d1fac;});}else{return _0x5d1fac;}})[_0xd9fe('0x57')](function(_0x335223){logger['error'](_0xd9fe('0x60'),_0x335223);throw _0x335223;});}return _0x5d1fac;})[_0xd9fe('0x22')](respondWithResult(_0x37038f,0xc9))['catch'](handleError(_0x37038f,null));};exports['update']=function(_0x5cbd6e,_0x57923b){if(_0x5cbd6e[_0xd9fe('0x61')]['id']){delete _0x5cbd6e[_0xd9fe('0x61')]['id'];}return db[_0xd9fe('0x52')][_0xd9fe('0x5e')]({'where':{'id':_0x5cbd6e['params']['id']},'include':[{'model':db[_0xd9fe('0x59')],'as':_0xd9fe('0x3f')}]})[_0xd9fe('0x22')](handleEntityNotFound(_0x57923b,null))[_0xd9fe('0x22')](saveUpdates(_0x5cbd6e[_0xd9fe('0x61')],null))[_0xd9fe('0x22')](respondWithResult(_0x57923b,null))[_0xd9fe('0x57')](handleError(_0x57923b,null));};exports[_0xd9fe('0x38')]=function(_0x21d2d6,_0x3289b){return db[_0xd9fe('0x52')][_0xd9fe('0x5e')]({'where':{'id':_0x21d2d6[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x3289b,null))['then'](removeEntity(_0x3289b,null))[_0xd9fe('0x57')](handleError(_0x3289b,null));};exports['describe']=function(_0x1b056d,_0x3e7db4){return db[_0xd9fe('0x52')][_0xd9fe('0x62')]()[_0xd9fe('0x22')](respondWithResult(_0x3e7db4,null))['catch'](handleError(_0x3e7db4,null));};exports[_0xd9fe('0x63')]=function(_0x2691ac,_0x1998ab,_0x2e2ca7){if(_0x2691ac[_0xd9fe('0x61')]['id']){delete _0x2691ac[_0xd9fe('0x61')]['id'];}return db[_0xd9fe('0x52')][_0xd9fe('0x5e')]({'where':{'id':_0x2691ac[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x1998ab,null))[_0xd9fe('0x22')](function(_0x4cd5b1){if(_0x4cd5b1){_0x2691ac[_0xd9fe('0x61')][_0xd9fe('0x64')]=_0x4cd5b1['id'];return db[_0xd9fe('0x65')][_0xd9fe('0x5a')](_0x2691ac[_0xd9fe('0x61')]);}})[_0xd9fe('0x22')](respondWithResult(_0x1998ab,null))[_0xd9fe('0x57')](handleError(_0x1998ab,null));};exports[_0xd9fe('0x66')]=function(_0x225459,_0xcaee8c,_0x27a7c1){var _0x47315f={'raw':![],'where':{}};var _0x5cf1dd={};var _0x5cc03c={'count':0x0,'rows':[]};return db[_0xd9fe('0x52')][_0xd9fe('0x67')]({'where':{'id':_0x225459[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0xcaee8c,null))[_0xd9fe('0x22')](function(_0x37bfb9){if(_0x37bfb9){_0x5cf1dd[_0xd9fe('0x41')]=_[_0xd9fe('0x44')](db['Disposition'][_0xd9fe('0x40')]);_0x5cf1dd[_0xd9fe('0x43')]=_['keys'](_0x225459[_0xd9fe('0x43')]);_0x5cf1dd[_0xd9fe('0x4c')]=_[_0xd9fe('0x45')](_0x5cf1dd[_0xd9fe('0x41')],_0x5cf1dd[_0xd9fe('0x43')]);_0x47315f[_0xd9fe('0x46')]=_[_0xd9fe('0x45')](_0x5cf1dd[_0xd9fe('0x41')],qs['fields'](_0x225459[_0xd9fe('0x43')][_0xd9fe('0x47')]));_0x47315f[_0xd9fe('0x46')]=_0x47315f[_0xd9fe('0x46')][_0xd9fe('0x48')]?_0x47315f[_0xd9fe('0x46')]:_0x5cf1dd[_0xd9fe('0x41')];if(!_0x225459[_0xd9fe('0x43')]['hasOwnProperty']('nolimit')){_0x47315f['limit']=qs[_0xd9fe('0x30')](_0x225459[_0xd9fe('0x43')][_0xd9fe('0x30')]);_0x47315f['offset']=qs[_0xd9fe('0x2e')](_0x225459[_0xd9fe('0x43')][_0xd9fe('0x2e')]);}_0x47315f[_0xd9fe('0x49')]=qs[_0xd9fe('0x4a')](_0x225459[_0xd9fe('0x43')][_0xd9fe('0x4a')]);_0x47315f[_0xd9fe('0x4b')]=qs[_0xd9fe('0x4c')](_['pick'](_0x225459[_0xd9fe('0x43')],_0x5cf1dd['filters']));_0x47315f[_0xd9fe('0x4b')]['WhatsappAccountId']=_0x37bfb9['id'];if(_0x225459[_0xd9fe('0x43')][_0xd9fe('0x4e')]){_0x47315f[_0xd9fe('0x4b')]=_[_0xd9fe('0x4f')](_0x47315f[_0xd9fe('0x4b')],{'$or':_[_0xd9fe('0x42')](_0x47315f['attributes'],function(_0x5f3a2a){var _0x32bb47={};_0x32bb47[_0x5f3a2a]={'$like':'%'+_0x225459[_0xd9fe('0x43')][_0xd9fe('0x4e')]+'%'};return _0x32bb47;})});}_0x47315f=_[_0xd9fe('0x4f')]({},_0x47315f,_0x225459[_0xd9fe('0x51')]);return db[_0xd9fe('0x65')][_0xd9fe('0x31')]({'where':_0x47315f[_0xd9fe('0x4b')]})['then'](function(_0x2b9640){_0x5cc03c[_0xd9fe('0x31')]=_0x2b9640;if(_0x225459['query'][_0xd9fe('0x53')]){_0x47315f['include']=[{'all':!![]}];}return db['Disposition'][_0xd9fe('0x55')](_0x47315f);})[_0xd9fe('0x22')](function(_0x2059fc){_0x5cc03c['rows']=_0x2059fc;return _0x5cc03c;});}})[_0xd9fe('0x22')](respondWithFilteredResult(_0xcaee8c,_0x47315f))[_0xd9fe('0x57')](handleError(_0xcaee8c,null));};exports['removeDispositions']=function(_0x58406a,_0x400e80,_0x28c29c){return db['WhatsappAccount'][_0xd9fe('0x5e')]({'where':{'id':_0x58406a['params']['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x400e80,null))[_0xd9fe('0x22')](function(_0x4e8c05){if(_0x4e8c05){return _0x4e8c05['removeDispositions'](_0x58406a[_0xd9fe('0x43')][_0xd9fe('0x68')]);}})[_0xd9fe('0x22')](respondWithStatusCode(_0x400e80,null))[_0xd9fe('0x57')](handleError(_0x400e80,null));};exports[_0xd9fe('0x69')]=function(_0x53694e,_0x2895cd,_0x2ea9de){if(_0x53694e[_0xd9fe('0x61')]['id']){delete _0x53694e[_0xd9fe('0x61')]['id'];}return db[_0xd9fe('0x52')][_0xd9fe('0x5e')]({'where':{'id':_0x53694e[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x2895cd,null))['then'](function(_0x222566){if(_0x222566){_0x53694e[_0xd9fe('0x61')][_0xd9fe('0x64')]=_0x222566['id'];return db[_0xd9fe('0x6a')][_0xd9fe('0x5a')](_0x53694e[_0xd9fe('0x61')]);}})[_0xd9fe('0x22')](respondWithResult(_0x2895cd,null))[_0xd9fe('0x57')](handleError(_0x2895cd,null));};exports[_0xd9fe('0x6b')]=function(_0x3bac68,_0x4a219c,_0x313b39){var _0x4b463f={'raw':![],'where':{}};var _0x185b0f={};var _0x4c41e1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xd9fe('0x67')]({'where':{'id':_0x3bac68[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x4a219c,null))[_0xd9fe('0x22')](function(_0x326087){if(_0x326087){_0x185b0f[_0xd9fe('0x41')]=_['keys'](db[_0xd9fe('0x6a')]['rawAttributes']);_0x185b0f['query']=_[_0xd9fe('0x44')](_0x3bac68['query']);_0x185b0f['filters']=_['intersection'](_0x185b0f[_0xd9fe('0x41')],_0x185b0f[_0xd9fe('0x43')]);_0x4b463f[_0xd9fe('0x46')]=_[_0xd9fe('0x45')](_0x185b0f['model'],qs['fields'](_0x3bac68['query']['fields']));_0x4b463f[_0xd9fe('0x46')]=_0x4b463f['attributes'][_0xd9fe('0x48')]?_0x4b463f[_0xd9fe('0x46')]:_0x185b0f[_0xd9fe('0x41')];if(!_0x3bac68[_0xd9fe('0x43')][_0xd9fe('0x6c')](_0xd9fe('0x6d'))){_0x4b463f[_0xd9fe('0x30')]=qs[_0xd9fe('0x30')](_0x3bac68[_0xd9fe('0x43')]['limit']);_0x4b463f[_0xd9fe('0x2e')]=qs[_0xd9fe('0x2e')](_0x3bac68['query'][_0xd9fe('0x2e')]);}_0x4b463f['order']=qs[_0xd9fe('0x4a')](_0x3bac68[_0xd9fe('0x43')][_0xd9fe('0x4a')]);_0x4b463f[_0xd9fe('0x4b')]=qs[_0xd9fe('0x4c')](_['pick'](_0x3bac68[_0xd9fe('0x43')],_0x185b0f['filters']));_0x4b463f['where']['WhatsappAccountId']=_0x326087['id'];if(_0x3bac68[_0xd9fe('0x43')]['filter']){_0x4b463f[_0xd9fe('0x4b')]=_['merge'](_0x4b463f[_0xd9fe('0x4b')],{'$or':_[_0xd9fe('0x42')](_0x4b463f[_0xd9fe('0x46')],function(_0xbbc762){var _0x9337d={};_0x9337d[_0xbbc762]={'$like':'%'+_0x3bac68[_0xd9fe('0x43')][_0xd9fe('0x4e')]+'%'};return _0x9337d;})});}_0x4b463f=_[_0xd9fe('0x4f')]({},_0x4b463f,_0x3bac68[_0xd9fe('0x51')]);return db['CannedAnswer']['count']({'where':_0x4b463f[_0xd9fe('0x4b')]})[_0xd9fe('0x22')](function(_0x2721ea){_0x4c41e1[_0xd9fe('0x31')]=_0x2721ea;if(_0x3bac68[_0xd9fe('0x43')][_0xd9fe('0x53')]){_0x4b463f[_0xd9fe('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd9fe('0x55')](_0x4b463f);})[_0xd9fe('0x22')](function(_0x230b81){_0x4c41e1[_0xd9fe('0x56')]=_0x230b81;return _0x4c41e1;});}})[_0xd9fe('0x22')](respondWithFilteredResult(_0x4a219c,_0x4b463f))[_0xd9fe('0x57')](handleError(_0x4a219c,null));};exports['removeAnswers']=function(_0x33cf00,_0x259d67,_0x49c2f2){return db[_0xd9fe('0x52')][_0xd9fe('0x5e')]({'where':{'id':_0x33cf00[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x259d67,null))[_0xd9fe('0x22')](function(_0x1189c6){if(_0x1189c6){return _0x1189c6[_0xd9fe('0x6e')](_0x33cf00['query'][_0xd9fe('0x68')]);}})[_0xd9fe('0x22')](respondWithStatusCode(_0x259d67,null))[_0xd9fe('0x57')](handleError(_0x259d67,null));};exports[_0xd9fe('0x6f')]=function(_0x3bf6fe,_0x418502,_0xce713){return db['WhatsappAccount'][_0xd9fe('0x5e')]({'where':{'id':_0x3bf6fe['params']['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x418502,null))[_0xd9fe('0x22')](function(_0x304aa8){if(_0x304aa8){return _0x304aa8['addAgents'](_0x3bf6fe[_0xd9fe('0x61')][_0xd9fe('0x68')],_[_0xd9fe('0x70')](_0x3bf6fe[_0xd9fe('0x61')],['ids','id'])||{})['spread'](function(_0x1dfed0){for(var _0x5ecca0=0x0;_0x5ecca0<_0x3bf6fe[_0xd9fe('0x61')][_0xd9fe('0x68')][_0xd9fe('0x48')];_0x5ecca0+=0x1){socket[_0xd9fe('0x71')]('userWhatsappAccount:save',{'UserId':Number(_0x3bf6fe['body'][_0xd9fe('0x68')][_0x5ecca0]),'WhatsappAccountId':Number(_0x3bf6fe[_0xd9fe('0x58')]['id'])});}return _0x1dfed0;});}})['then'](respondWithResult(_0x418502,null))['catch'](handleError(_0x418502,null));};exports[_0xd9fe('0x72')]=function(_0x2026a0,_0xd6dea7,_0x471ffc){return db['WhatsappAccount'][_0xd9fe('0x5e')]({'where':{'id':_0x2026a0[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0xd6dea7,null))[_0xd9fe('0x22')](function(_0x56706c){if(_0x56706c){return _0x56706c[_0xd9fe('0x72')](_0x2026a0[_0xd9fe('0x43')]['ids'])['then'](function(){if(_[_0xd9fe('0x73')](_0x2026a0['query'][_0xd9fe('0x68')])){for(var _0x1c3aac=0x0;_0x1c3aac<_0x2026a0[_0xd9fe('0x43')][_0xd9fe('0x68')]['length'];_0x1c3aac+=0x1){socket[_0xd9fe('0x71')](_0xd9fe('0x74'),{'UserId':Number(_0x2026a0[_0xd9fe('0x43')][_0xd9fe('0x68')][_0x1c3aac]),'WhatsappAccountId':Number(_0x2026a0[_0xd9fe('0x58')]['id'])});}}else{socket[_0xd9fe('0x71')](_0xd9fe('0x74'),{'UserId':Number(_0x2026a0[_0xd9fe('0x43')][_0xd9fe('0x68')]),'WhatsappAccountId':Number(_0x2026a0['params']['id'])});}});}})['then'](respondWithStatusCode(_0xd6dea7,null))[_0xd9fe('0x57')](handleError(_0xd6dea7,null));};exports[_0xd9fe('0x75')]=function(_0x4f7d81,_0xcc5151,_0x44fded){var _0x15af25={};var _0x542039={};var _0x596bf9;var _0x2a3b43;return db[_0xd9fe('0x52')][_0xd9fe('0x67')]({'where':{'id':_0x4f7d81['params']['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0xcc5151,null))['then'](function(_0x5826a9){if(_0x5826a9){_0x596bf9=_0x5826a9;_0x542039['model']=_['keys'](db[_0xd9fe('0x76')][_0xd9fe('0x40')]);_0x542039[_0xd9fe('0x43')]=_['keys'](_0x4f7d81[_0xd9fe('0x43')]);_0x542039[_0xd9fe('0x4c')]=_['intersection'](_0x542039[_0xd9fe('0x41')],_0x542039[_0xd9fe('0x43')]);_0x15af25['attributes']=_[_0xd9fe('0x45')](_0x542039[_0xd9fe('0x41')],qs[_0xd9fe('0x47')](_0x4f7d81[_0xd9fe('0x43')][_0xd9fe('0x47')]));_0x15af25[_0xd9fe('0x46')]=_0x15af25['attributes'][_0xd9fe('0x48')]?_0x15af25['attributes']:_0x542039[_0xd9fe('0x41')];_0x15af25['order']=qs['sort'](_0x4f7d81['query'][_0xd9fe('0x4a')]);_0x15af25[_0xd9fe('0x4b')]=qs[_0xd9fe('0x4c')](_[_0xd9fe('0x4d')](_0x4f7d81[_0xd9fe('0x43')],_0x542039[_0xd9fe('0x4c')]));if(_0x4f7d81[_0xd9fe('0x43')][_0xd9fe('0x4e')]){_0x15af25[_0xd9fe('0x4b')]=_[_0xd9fe('0x4f')](_0x15af25[_0xd9fe('0x4b')],{'$or':_[_0xd9fe('0x42')](_0x15af25['attributes'],function(_0xe2d1fb){var _0x1cce9c={};_0x1cce9c[_0xe2d1fb]={'$like':'%'+_0x4f7d81[_0xd9fe('0x43')]['filter']+'%'};return _0x1cce9c;})});}_0x15af25=_[_0xd9fe('0x4f')]({},_0x15af25,_0x4f7d81['options']);return _0x596bf9['getAgents'](_0x15af25);}})[_0xd9fe('0x22')](function(_0x5d6531){if(_0x5d6531){_0x2a3b43=_0x5d6531['length'];if(!_0x4f7d81[_0xd9fe('0x43')][_0xd9fe('0x6c')](_0xd9fe('0x6d'))){_0x15af25[_0xd9fe('0x30')]=qs[_0xd9fe('0x30')](_0x4f7d81[_0xd9fe('0x43')]['limit']);_0x15af25[_0xd9fe('0x2e')]=qs[_0xd9fe('0x2e')](_0x4f7d81['query'][_0xd9fe('0x2e')]);}return _0x596bf9[_0xd9fe('0x75')](_0x15af25);}})['then'](function(_0x3335c1){if(_0x3335c1){return _0x3335c1?{'count':_0x2a3b43,'rows':_0x3335c1}:null;}})['then'](respondWithResult(_0xcc5151,null))[_0xd9fe('0x57')](handleError(_0xcc5151,null));};exports['addApplications']=function(_0x5b9f8d,_0x35ee38){var _0xc291c8=_0x5b9f8d[_0xd9fe('0x58')]['id'];var _0x17bd86=_0x5b9f8d[_0xd9fe('0x61')];var _0x543a98=0xc8;var _0x2fa1e5=null;return db[_0xd9fe('0x77')][_0xd9fe('0x78')]({'isolationLevel':db[_0xd9fe('0x77')][_0xd9fe('0x79')]['ISOLATION_LEVELS'][_0xd9fe('0x7a')]},function(_0x24af06){return db[_0xd9fe('0x52')][_0xd9fe('0x67')]({'where':{'id':_0xc291c8},'transaction':_0x24af06})['then'](function(_0x545b6d){if(_0x545b6d){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0xc291c8},'transaction':_0x24af06})[_0xd9fe('0x22')](function(){var _0x3d0b4a=_[_0xd9fe('0x42')](_0x17bd86,function(_0x40f682){_0x40f682[_0xd9fe('0x64')]=_0xc291c8;return _0x40f682;});return db[_0xd9fe('0x7b')][_0xd9fe('0x7c')](_0x3d0b4a,{'transaction':_0x24af06});});}else{_0x543a98=0x194;_0x2fa1e5=[];}});})['then'](function(){if(_0x543a98!==0x194){return db[_0xd9fe('0x7b')][_0xd9fe('0x7d')]({'where':{'WhatsappAccountId':_0xc291c8},'order':_0xd9fe('0x7e')})[_0xd9fe('0x22')](function(_0x4dc5b5){_0x2fa1e5=_0x4dc5b5;});}})[_0xd9fe('0x57')](function(_0x3f4c30){_0x543a98=0x1f4;logger[_0xd9fe('0x29')](_0x3f4c30[_0xd9fe('0x3c')]);if(_0x3f4c30[_0xd9fe('0x3d')]){delete _0x3f4c30[_0xd9fe('0x3d')];}_0x2fa1e5=_0x3f4c30;})[_0xd9fe('0x7f')](function(){if(_0x2fa1e5===null){_0x35ee38['sendStatus'](_0x543a98);}else{if(_0x543a98===0x1f4){_0x35ee38[_0xd9fe('0x32')](_0x543a98)[_0xd9fe('0x3e')](_0x2fa1e5);}else{_0x35ee38[_0xd9fe('0x32')](_0x543a98)['json'](_0x2fa1e5);}}});};exports[_0xd9fe('0x80')]=function(_0x465d44,_0x5d7e46,_0x47c560){var _0x254b0b={};var _0x207e3a={};var _0x35f65f;var _0x168f1c;return db['WhatsappAccount'][_0xd9fe('0x67')]({'where':{'id':_0x465d44[_0xd9fe('0x58')]['id']}})[_0xd9fe('0x22')](handleEntityNotFound(_0x5d7e46,null))[_0xd9fe('0x22')](function(_0xea4308){if(_0xea4308){_0x35f65f=_0xea4308;_0x207e3a[_0xd9fe('0x41')]=_['keys'](db[_0xd9fe('0x7b')][_0xd9fe('0x40')]);_0x207e3a[_0xd9fe('0x43')]=_[_0xd9fe('0x44')](_0x465d44[_0xd9fe('0x43')]);_0x207e3a[_0xd9fe('0x4c')]=_[_0xd9fe('0x45')](_0x207e3a[_0xd9fe('0x41')],_0x207e3a[_0xd9fe('0x43')]);_0x254b0b['attributes']=_[_0xd9fe('0x45')](_0x207e3a[_0xd9fe('0x41')],qs[_0xd9fe('0x47')](_0x465d44[_0xd9fe('0x43')][_0xd9fe('0x47')]));_0x254b0b['attributes']=_0x254b0b[_0xd9fe('0x46')][_0xd9fe('0x48')]?_0x254b0b[_0xd9fe('0x46')]:_0x207e3a['model'];_0x254b0b['order']=qs['sort'](_0x465d44[_0xd9fe('0x43')][_0xd9fe('0x4a')]);_0x254b0b['where']=qs[_0xd9fe('0x4c')](_['pick'](_0x465d44[_0xd9fe('0x43')],_0x207e3a['filters']));if(_0x465d44[_0xd9fe('0x43')]['filter']){_0x254b0b[_0xd9fe('0x4b')]=_[_0xd9fe('0x4f')](_0x254b0b[_0xd9fe('0x4b')],{'$or':_['map'](_0x254b0b[_0xd9fe('0x46')],function(_0x2fd773){var _0x57abf0={};_0x57abf0[_0x2fd773]={'$like':'%'+_0x465d44[_0xd9fe('0x43')][_0xd9fe('0x4e')]+'%'};return _0x57abf0;})});}_0x254b0b=_[_0xd9fe('0x4f')]({},_0x254b0b,_0x465d44[_0xd9fe('0x51')]);return _0x35f65f['getApplications'](_0x254b0b);}})[_0xd9fe('0x22')](function(_0xe17152){if(_0xe17152){_0x168f1c=_0xe17152[_0xd9fe('0x48')];if(!_0x465d44['query'][_0xd9fe('0x6c')](_0xd9fe('0x6d'))){_0x254b0b[_0xd9fe('0x30')]=qs[_0xd9fe('0x30')](_0x465d44[_0xd9fe('0x43')][_0xd9fe('0x30')]);_0x254b0b['offset']=qs[_0xd9fe('0x2e')](_0x465d44['query'][_0xd9fe('0x2e')]);}return _0x35f65f[_0xd9fe('0x80')](_0x254b0b);}})['then'](function(_0x2b00c8){if(_0x2b00c8){return _0x2b00c8?{'count':_0x168f1c,'rows':_0x2b00c8}:null;}})[_0xd9fe('0x22')](respondWithResult(_0x5d7e46,null))[_0xd9fe('0x57')](handleError(_0x5d7e46,null));};exports[_0xd9fe('0x81')]=function(_0x1bc1e3,_0x46426d,_0x36732a){var _0x1db270={'channel':'whatsapp'};var _0x2e0cbe=[];var _0xc9da1d=[];var _0x185418={};return db['WhatsappAccount']['find']({'where':{'id':_0x1bc1e3[_0xd9fe('0x58')]['id']},'include':[{'model':db[_0xd9fe('0x7b')],'as':_0xd9fe('0x82')}]})[_0xd9fe('0x22')](handleEntityNotFound(_0x46426d,null))[_0xd9fe('0x22')](function(_0x574e20){_0x1db270['account']=_0x574e20;if(_0x1db270[_0xd9fe('0x83')]&&_0x1db270[_0xd9fe('0x83')][_0xd9fe('0x50')]===_0xd9fe('0x84')&&_0x1bc1e3['body'][_0xd9fe('0x85')]){if(_0x1bc1e3[_0xd9fe('0x61')]['statuses'][_0xd9fe('0x48')]===0x0)return;if(_0x1bc1e3[_0xd9fe('0x61')][_0xd9fe('0x85')][0x0]['state']!==_0xd9fe('0x86'))return;return db[_0xd9fe('0x87')][_0xd9fe('0x88')]({'read':!![],'readAt':_0x1bc1e3[_0xd9fe('0x61')][_0xd9fe('0x85')][0x0][_0xd9fe('0x89')]},{'where':{'messageId':_0x1bc1e3['body'][_0xd9fe('0x85')][0x0][_0xd9fe('0x8a')]},'individualHooks':!![]})[_0xd9fe('0x22')](function(_0x3cfaaa){return _0x46426d[_0xd9fe('0x32')](0xc8)[_0xd9fe('0x34')](_0x3cfaaa);});}_0x1db270[_0xd9fe('0x8b')]=_[_0xd9fe('0x8c')](_0x574e20[_0xd9fe('0x82')],[_0xd9fe('0x7e')],[_0xd9fe('0x8d')]);if(_0x1db270[_0xd9fe('0x83')]['Applications']){delete _0x1db270['account'][_0xd9fe('0x82')];}return db[_0xd9fe('0x8e')][_0xd9fe('0x62')]()['then'](function(_0x4a781a){if(!_0x4a781a){throw new db['Sequelize'][(_0xd9fe('0x8f'))]('no\x20available\x20attributes');}_0x2e0cbe=_[_0xd9fe('0x90')](_['keys'](_0x4a781a),[_0xd9fe('0x91'),_0xd9fe('0x92')]);_0xc9da1d=_[_0xd9fe('0x90')](_[_0xd9fe('0x44')](_0x4a781a),['createdAt',_0xd9fe('0x92'),_0xd9fe('0x93'),_0xd9fe('0x94')]);_0x1db270[_0xd9fe('0x61')]={'mapKey':_0xd9fe('0x95')};if(_0x1db270[_0xd9fe('0x83')]&&_0x1db270[_0xd9fe('0x83')][_0xd9fe('0x50')]===_0xd9fe('0x96')){_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x97')]=_0x1bc1e3[_0xd9fe('0x61')][_0xd9fe('0x98')][_0xd9fe('0x99')](_0xd9fe('0x9a'),'');_0x1db270[_0xd9fe('0x61')]['body']=_0x1bc1e3[_0xd9fe('0x61')][_0xd9fe('0x9b')];_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x9c')]=_0x1bc1e3['body'][_0xd9fe('0x9d')];}if(_0x1db270[_0xd9fe('0x83')]&&_0x1db270[_0xd9fe('0x83')]['type']===_0xd9fe('0x84')){_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x97')]=_0x1bc1e3[_0xd9fe('0x61')]['notifications'][0x0][_0xd9fe('0x97')];_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x61')]=_0x1bc1e3['body'][_0xd9fe('0x9e')][0x0][_0xd9fe('0x2b')][_0xd9fe('0x61')];_0x1db270[_0xd9fe('0x61')]['messageId']=_0x1bc1e3['body'][_0xd9fe('0x9e')][0x0][_0xd9fe('0x8a')];}if(_0x1db270[_0xd9fe('0x61')]['id']){delete _0x1db270[_0xd9fe('0x61')]['id'];}if(_[_0xd9fe('0x9f')](_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x97')])){throw new db['Sequelize'][(_0xd9fe('0x8f'))](_0xd9fe('0xa0'));}if(_[_0xd9fe('0x9f')](_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x61')])||_0x1db270['body'][_0xd9fe('0x61')]===''){throw new db[(_0xd9fe('0xa1'))][(_0xd9fe('0x8f'))](_0xd9fe('0xa2'));}if(_[_0xd9fe('0x9f')](_0x1db270[_0xd9fe('0x61')][_0xd9fe('0xa3')])){throw new db['Sequelize']['ValidationError'](_0xd9fe('0xa4')+_0xc9da1d);}if(!_[_0xd9fe('0xa5')](_0xc9da1d,_0x1db270[_0xd9fe('0x61')][_0xd9fe('0xa3')])){throw new db[(_0xd9fe('0xa1'))][(_0xd9fe('0x8f'))](_0xd9fe('0xa6')+_0xc9da1d);}_0x185418[_0x1db270[_0xd9fe('0x61')][_0xd9fe('0xa3')]]=_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x97')];return db['CmList'][_0xd9fe('0x5e')]({'where':{'id':_0x1db270['account'][_0xd9fe('0x94')]},'include':[{'model':db[_0xd9fe('0x8e')],'as':'Contacts','where':_0x185418,'limit':0x1,'order':[[_0xd9fe('0x92'),_0xd9fe('0xa7')]]}]});})[_0xd9fe('0x22')](handleEntityNotFound(_0x46426d,null))[_0xd9fe('0x22')](function(_0x2b57d3){if(_0x2b57d3){_0x1db270['list']=_['omit'](_0x2b57d3,[_0xd9fe('0xa8')]);if(_0x2b57d3[_0xd9fe('0xa8')]['length']){return _0x2b57d3[_0xd9fe('0xa8')][0x0];}var _0x25ab51=_['defaults'](_0x1db270[_0xd9fe('0x61')],{'firstName':_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x97')],'ListId':_0x2b57d3['id']});_0x25ab51[_0x1db270[_0xd9fe('0x61')]['mapKey']]=_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x97')];return db[_0xd9fe('0x8e')][_0xd9fe('0x5a')](_0x25ab51,{'fields':_0x2e0cbe,'raw':!![]});}})[_0xd9fe('0x22')](handleEntityNotFound(_0x46426d,null))[_0xd9fe('0x22')](function(_0x6ab0f){if(_0x6ab0f){_0x1db270[_0xd9fe('0xa9')]=_0x6ab0f;var _0x352f1f={'ContactId':_0x6ab0f['id'],'phone':_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x97')],'WhatsappAccountId':_0x1bc1e3['params']['id']};var _0x2a3175={'ContactId':_0x6ab0f['id'],'WhatsappAccountId':_0x1bc1e3[_0xd9fe('0x58')]['id'],'closed':![]};return db[_0xd9fe('0xaa')][_0xd9fe('0x5e')]({'where':_0x2a3175})[_0xd9fe('0x22')](function(_0x4a40fe){if(_0x4a40fe){return[_0x4a40fe,![]];}return db[_0xd9fe('0xaa')]['create'](_0x352f1f)['then'](function(_0x5cc459){return[_0x5cc459,!![]];});});}})['spread'](function(_0xc0d054,_0x2711b6){_0x1db270[_0xd9fe('0xab')]=_0xc0d054[_0xd9fe('0x39')]({'plain':!![]});_0x1db270[_0xd9fe('0xab')]['created']=![];if(_0x2711b6){if(_0x1db270[_0xd9fe('0x83')][_0xd9fe('0xac')]){_0x1db270[_0xd9fe('0x8b')][_0xd9fe('0xad')]({'id':0x0,'priority':_0x1db270[_0xd9fe('0x8b')]['length']+0x1,'app':'close','appdata':_0xd9fe('0xae'),'interval':_0xd9fe('0xaf')});}_0x1db270[_0xd9fe('0xab')][_0xd9fe('0xb0')]=!![];}return db[_0xd9fe('0x87')]['create']({'phone':_0x1db270['body'][_0xd9fe('0x97')],'messageId':_0x1db270[_0xd9fe('0x61')][_0xd9fe('0x9c')],'body':_0x1db270['body']['body'],'WhatsappAccountId':_0x1bc1e3[_0xd9fe('0x58')]['id'],'WhatsappInteractionId':_0xc0d054['id'],'direction':'in','ContactId':_0xc0d054[_0xd9fe('0xb1')],'AttachmentId':_0x1db270[_0xd9fe('0x61')][_0xd9fe('0xb2')]});})[_0xd9fe('0x22')](function(_0x3e7daa){_0x1db270['message']=_0x3e7daa;if(_0x1db270[_0xd9fe('0xab')][_0xd9fe('0xb3')]){return db[_0xd9fe('0x76')][_0xd9fe('0x5e')]({'attributes':['id','name'],'where':{'id':_0x1db270[_0xd9fe('0xab')]['UserId']}})[_0xd9fe('0x22')](function(_0x51fcae){if(_0x51fcae){_0x1db270[_0xd9fe('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd9fe('0xb4'),'appdata':_0x51fcae['name']+','+(_0x1db270[_0xd9fe('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0xd9fe('0xaf')});}return respondWithRpcPromise('Start','startRouting',_0x1db270);});}return respondWithRpcPromise(_0xd9fe('0xb5'),'startRouting',_0x1db270);})[_0xd9fe('0x22')](function(_0x423e56){if(_0x423e56){var _0x3d07d7=0xc8;var _0x1681a4=_0xd9fe('0xb6');logger[_0xd9fe('0x23')](_0xd9fe('0x27'),_0x1681a4,_0x3d07d7,_0xd9fe('0xb7'));logger[_0xd9fe('0x26')](_0xd9fe('0xb8'),_0x1681a4,_0x3d07d7,_0xd9fe('0xb7'),JSON[_0xd9fe('0x28')](_0x423e56));if(_0x1db270[_0xd9fe('0x83')][_0xd9fe('0x50')]==='twilio'){return _0x46426d[_0xd9fe('0x32')](_0x3d07d7)['set'](_0xd9fe('0xb9'),'text/xml')[_0xd9fe('0x3e')](_0xd9fe('0xba'));}else{return _0x46426d['status'](_0x3d07d7)[_0xd9fe('0x34')](_0x423e56);}}});})[_0xd9fe('0x57')](handleError(_0x46426d,null));};exports['send']=function(_0x5b914e,_0x401729,_0x315af4){var _0x1abc13,_0x4caef1,_0x2a1207;if(_[_0xd9fe('0x9f')](_0x5b914e[_0xd9fe('0x61')][_0xd9fe('0x61')])||_0x5b914e[_0xd9fe('0x61')][_0xd9fe('0x61')]===''){throw new db['Sequelize'][(_0xd9fe('0x8f'))](_0xd9fe('0xa2'));}if(_[_0xd9fe('0x9f')](_0x5b914e[_0xd9fe('0x61')]['to'])){throw new db[(_0xd9fe('0xa1'))][(_0xd9fe('0x8f'))](_0xd9fe('0xbb'));}_0x1abc13=_0x5b914e[_0xd9fe('0x61')]['to'];return db[_0xd9fe('0x52')][_0xd9fe('0x5e')]({'where':{'id':_0x5b914e[_0xd9fe('0x58')]['id']},'include':[{'model':db[_0xd9fe('0xbc')],'as':_0xd9fe('0xbd'),'include':[{'model':db[_0xd9fe('0x8e')],'as':_0xd9fe('0xa8'),'where':{'mobile':_0x1abc13},'limit':0x1,'order':[[_0xd9fe('0x92'),'DESC']]}]}]})[_0xd9fe('0x22')](handleEntityNotFound(_0x401729,null))[_0xd9fe('0x22')](function(_0x56362c){if(_0x56362c&&_0x56362c[_0xd9fe('0xbd')]){_0x4caef1=_0x56362c[_0xd9fe('0x39')]({'plain':!![]});if(_0x4caef1[_0xd9fe('0xbd')]&&_0x4caef1[_0xd9fe('0xbd')][_0xd9fe('0xa8')][_0xd9fe('0x48')]){return _0x4caef1[_0xd9fe('0xbd')][_0xd9fe('0xa8')][0x0];}return db[_0xd9fe('0x8e')][_0xd9fe('0x5a')](_[_0xd9fe('0x1b')](_0x5b914e[_0xd9fe('0x61')],{'firstName':_0x1abc13,'mobile':_0x1abc13,'phone':_0x1abc13,'ListId':_0x4caef1['ListId']}));}})[_0xd9fe('0x22')](handleEntityNotFound(_0x401729,null))['then'](function(_0x238208){if(_0x238208){_0x2a1207=_0x238208;return db[_0xd9fe('0xaa')][_0xd9fe('0x5e')]({'where':{'ContactId':_0x2a1207['id'],'closed':![],'WhatsappAccountId':_0x4caef1['id']}})['then'](function(_0x1d8aa5){if(_0x1d8aa5){return[_0x1d8aa5,![]];}return db[_0xd9fe('0xaa')][_0xd9fe('0x5a')]({'UserId':_0x5b914e[_0xd9fe('0x5c')]['id'],'ContactId':_0x2a1207['id'],'WhatsappAccountId':_0x4caef1['id'],'phone':_0x1abc13,'firstMsgDirection':'out','Messages':[_[_0xd9fe('0x4f')](_0x5b914e[_0xd9fe('0x61')],{'read':![],'body':_0x5b914e['body']['body'],'phone':_0x1abc13,'WhatsappAccountId':_0x4caef1['id'],'UserId':_0x5b914e[_0xd9fe('0x5c')]['id'],'ContactId':_0x2a1207['id']})]},{'include':[{'model':db[_0xd9fe('0x87')],'as':_0xd9fe('0xbe')}]})['then'](function(_0x1b2e3e){return[_0x1b2e3e,!![]];});});}})['spread'](function(_0x13c963,_0x31cd52){if(_0x31cd52){return _0x13c963;}return db[_0xd9fe('0x87')][_0xd9fe('0x5a')](_[_0xd9fe('0x4f')](_0x5b914e[_0xd9fe('0x61')],{'read':![],'body':_0x5b914e[_0xd9fe('0x61')]['body'],'phone':_0x1abc13,'WhatsappAccountId':_0x4caef1['id'],'WhatsappInteractionId':_0x13c963['id'],'UserId':_0x5b914e[_0xd9fe('0x5c')]['id'],'ContactId':_0x2a1207['id']}))[_0xd9fe('0x22')](function(_0x138668){_0x13c963['dataValues'][_0xd9fe('0xbe')]=[];_0x13c963[_0xd9fe('0xbf')][_0xd9fe('0xbe')]['push'](_0x138668[_0xd9fe('0xbf')]);return _0x13c963;});})[_0xd9fe('0x22')](respondWithResult(_0x401729,null))[_0xd9fe('0x57')](handleError(_0x401729,null));};
\ No newline at end of file
index 088d291..a029dd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8673=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','WhatsappAccount'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x8673,0x75));var _0x3867=function(_0x548cd9,_0x31bb91){_0x548cd9=_0x548cd9-0x0;var _0x55ace4=_0x8673[_0x548cd9];return _0x55ace4;};'use strict';var EventEmitter=require(_0x3867('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x3867('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x3867('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3867('0x3')};function emitEvent(_0x37aedc){return function(_0x364807,_0x758bc1,_0x42ed03){WhatsappAccountEvents['emit'](_0x37aedc+':'+_0x364807['id'],_0x364807);WhatsappAccountEvents[_0x3867('0x4')](_0x37aedc,_0x364807);_0x42ed03(null);};}for(var e in events){if(events[_0x3867('0x5')](e)){var event=events[e];WhatsappAccount[_0x3867('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
+var _0xf68d=['WhatsappAccount','setMaxListeners','save','remove','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x470840,_0x132fbb){var _0x544838=function(_0x5a5e5b){while(--_0x5a5e5b){_0x470840['push'](_0x470840['shift']());}};_0x544838(++_0x132fbb);}(_0xf68d,0x76));var _0xdf68=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xf68d[_0x45d55e];return _0x29812a;};'use strict';var EventEmitter=require(_0xdf68('0x0'));var WhatsappAccount=require(_0xdf68('0x1'))['db'][_0xdf68('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xdf68('0x3')](0x0);var events={'afterCreate':_0xdf68('0x4'),'afterUpdate':'update','afterDestroy':_0xdf68('0x5')};function emitEvent(_0x7d27be){return function(_0x16e79b,_0x65b6,_0x4cbbe0){WhatsappAccountEvents['emit'](_0x7d27be+':'+_0x16e79b['id'],_0x16e79b);WhatsappAccountEvents['emit'](_0x7d27be,_0x16e79b);_0x4cbbe0(null);};}for(var e in events){if(events[_0xdf68('0x6')](e)){var event=events[e];WhatsappAccount[_0xdf68('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
index 8ede944..252b96b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4ee=['define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x380c4b,_0x280681){var _0x5b5f66=function(_0x9784bc){while(--_0x9784bc){_0x380c4b['push'](_0x380c4b['shift']());}};_0x5b5f66(++_0x280681);}(_0xe4ee,0x1b0));var _0xee4e=function(_0x2978db,_0x3a095b){_0x2978db=_0x2978db-0x0;var _0x60bc74=_0xe4ee[_0x2978db];return _0x60bc74;};'use strict';var _=require(_0xee4e('0x0'));var util=require(_0xee4e('0x1'));var logger=require('../../config/logger')(_0xee4e('0x2'));var moment=require(_0xee4e('0x3'));var BPromise=require(_0xee4e('0x4'));var rp=require(_0xee4e('0x5'));var fs=require('fs');var path=require(_0xee4e('0x6'));var rimraf=require(_0xee4e('0x7'));var config=require(_0xee4e('0x8'));var attributes=require(_0xee4e('0x9'));module['exports']=function(_0x4b8832,_0x57b36e){return _0x4b8832[_0xee4e('0xa')](_0xee4e('0xb'),attributes,{'tableName':_0xee4e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb955=['../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4a3168,_0x494f38){var _0x35c154=function(_0x1ab446){while(--_0x1ab446){_0x4a3168['push'](_0x4a3168['shift']());}};_0x35c154(++_0x494f38);}(_0xb955,0x1e5));var _0x5b95=function(_0x2511f5,_0x23c8fe){_0x2511f5=_0x2511f5-0x0;var _0x217615=_0xb955[_0x2511f5];return _0x217615;};'use strict';var _=require(_0x5b95('0x0'));var util=require(_0x5b95('0x1'));var logger=require('../../config/logger')(_0x5b95('0x2'));var moment=require(_0x5b95('0x3'));var BPromise=require(_0x5b95('0x4'));var rp=require(_0x5b95('0x5'));var fs=require('fs');var path=require(_0x5b95('0x6'));var rimraf=require('rimraf');var config=require(_0x5b95('0x7'));var attributes=require(_0x5b95('0x8'));module[_0x5b95('0x9')]=function(_0x53c00e,_0x20eb0e){return _0x53c00e[_0x5b95('0xa')]('WhatsappAccount',attributes,{'tableName':_0x5b95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2632033..f7b2e93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeecc=['map','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xeecc,0x146));var _0xceec=function(_0x278647,_0xb556dc){_0x278647=_0x278647-0x0;var _0x17f219=_0xeecc[_0x278647];return _0x17f219;};'use strict';var _=require(_0xceec('0x0'));var util=require('util');var moment=require(_0xceec('0x1'));var BPromise=require(_0xceec('0x2'));var rs=require(_0xceec('0x3'));var fs=require('fs');var Redis=require(_0xceec('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xceec('0x5'));var logger=require(_0xceec('0x6'))('rpc');var config=require(_0xceec('0x7'));var jayson=require(_0xceec('0x8'));var client=jayson[_0xceec('0x9')][_0xceec('0xa')]({'port':0x232a});config['redis']=_[_0xceec('0xb')](config[_0xceec('0xc')],{'host':_0xceec('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xceec('0xc')]));require(_0xceec('0xe'))[_0xceec('0xf')](socket);function respondWithRpcPromise(_0x42e572,_0x2d35ef,_0x17f2bb){return new BPromise(function(_0x341ae8,_0x152d07){return client[_0xceec('0x10')](_0x42e572,_0x17f2bb)[_0xceec('0x11')](function(_0xc9a442){logger[_0xceec('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x2d35ef,_0xceec('0x13'));logger[_0xceec('0x14')](_0xceec('0x15'),_0x2d35ef,_0xceec('0x13'),JSON['stringify'](_0xc9a442));if(_0xc9a442['error']){if(_0xc9a442[_0xceec('0x16')]['code']===0x1f4){logger[_0xceec('0x16')](_0xceec('0x17'),_0x2d35ef,_0xc9a442[_0xceec('0x16')][_0xceec('0x18')]);return _0x152d07(_0xc9a442['error'][_0xceec('0x18')]);}logger[_0xceec('0x16')](_0xceec('0x17'),_0x2d35ef,_0xc9a442[_0xceec('0x16')][_0xceec('0x18')]);return _0x341ae8(_0xc9a442[_0xceec('0x16')][_0xceec('0x18')]);}else{logger[_0xceec('0x12')](_0xceec('0x17'),_0x2d35ef,'request\x20sent');_0x341ae8(_0xc9a442[_0xceec('0x19')][_0xceec('0x18')]);}})[_0xceec('0x1a')](function(_0x268cbc){logger[_0xceec('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x2d35ef,_0x268cbc);_0x152d07(_0x268cbc);});});}exports[_0xceec('0x1b')]=function(_0x262968){var _0x3deaf1=this;return new Promise(function(_0x116707,_0x52ff3a){return db[_0xceec('0x1c')][_0xceec('0x1d')]({'raw':_0x262968['options']?_0x262968[_0xceec('0x1e')][_0xceec('0x1f')]===undefined?!![]:![]:!![],'where':_0x262968[_0xceec('0x1e')]?_0x262968[_0xceec('0x1e')]['where']||null:null,'attributes':_0x262968[_0xceec('0x1e')]?_0x262968[_0xceec('0x1e')][_0xceec('0x20')]||null:null,'include':_0x262968[_0xceec('0x1e')]?_0x262968['options'][_0xceec('0x21')]?_[_0xceec('0x22')](_0x262968['options'][_0xceec('0x21')],function(_0x134e41){return{'model':db[_0x134e41[_0xceec('0x23')]],'as':_0x134e41['as'],'attributes':_0x134e41['attributes'],'include':_0x134e41[_0xceec('0x21')]?_[_0xceec('0x22')](_0x134e41[_0xceec('0x21')],function(_0x4e0228){return{'model':db[_0x4e0228['model']],'as':_0x4e0228['as'],'attributes':_0x4e0228[_0xceec('0x20')],'include':_0x4e0228[_0xceec('0x21')]?_[_0xceec('0x22')](_0x4e0228[_0xceec('0x21')],function(_0x5acd38){return{'model':db[_0x5acd38[_0xceec('0x23')]],'as':_0x5acd38['as'],'attributes':_0x5acd38[_0xceec('0x20')]};}):[]};}):[]};}):[]:[]})[_0xceec('0x11')](function(_0x368c6d){logger['info']('ShowWhatsappAccount',_0x262968);logger[_0xceec('0x14')](_0xceec('0x1b'),_0x262968,JSON['stringify'](_0x368c6d));_0x116707(_0x368c6d);})['catch'](function(_0x34af62){logger[_0xceec('0x16')](_0xceec('0x1b'),_0x34af62[_0xceec('0x18')],_0x262968);_0x52ff3a(_0x3deaf1[_0xceec('0x16')](0x1f4,_0x34af62['message']));});});};
\ No newline at end of file
+var _0x6002=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring'];(function(_0x3f4568,_0x9eb0ee){var _0xee2340=function(_0xdefabb){while(--_0xdefabb){_0x3f4568['push'](_0x3f4568['shift']());}};_0xee2340(++_0x9eb0ee);}(_0x6002,0xfe));var _0x2600=function(_0x3b33c6,_0x3d6f2f){_0x3b33c6=_0x3b33c6-0x0;var _0x3b6eda=_0x6002[_0x3b33c6];return _0x3b6eda;};'use strict';var _=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var moment=require(_0x2600('0x2'));var BPromise=require(_0x2600('0x3'));var rs=require(_0x2600('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2600('0x5'));var logger=require(_0x2600('0x6'))(_0x2600('0x7'));var config=require(_0x2600('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2600('0x9')]({'port':0x232a});config[_0x2600('0xa')]=_[_0x2600('0xb')](config[_0x2600('0xa')],{'host':_0x2600('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x2600('0xd')](socket);function respondWithRpcPromise(_0x2ab4ad,_0x6569d2,_0x1ed153){return new BPromise(function(_0xf25b93,_0x3ffeda){return client[_0x2600('0xe')](_0x2ab4ad,_0x1ed153)[_0x2600('0xf')](function(_0x2a5cd5){logger[_0x2600('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x6569d2,_0x2600('0x11'));logger[_0x2600('0x12')](_0x2600('0x13'),_0x6569d2,_0x2600('0x11'),JSON[_0x2600('0x14')](_0x2a5cd5));if(_0x2a5cd5['error']){if(_0x2a5cd5[_0x2600('0x15')][_0x2600('0x16')]===0x1f4){logger[_0x2600('0x15')](_0x2600('0x17'),_0x6569d2,_0x2a5cd5['error']['message']);return _0x3ffeda(_0x2a5cd5[_0x2600('0x15')][_0x2600('0x18')]);}logger[_0x2600('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x6569d2,_0x2a5cd5[_0x2600('0x15')][_0x2600('0x18')]);return _0xf25b93(_0x2a5cd5[_0x2600('0x15')][_0x2600('0x18')]);}else{logger[_0x2600('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x6569d2,_0x2600('0x11'));_0xf25b93(_0x2a5cd5[_0x2600('0x19')]['message']);}})[_0x2600('0x1a')](function(_0x2e3c0f){logger['error'](_0x2600('0x17'),_0x6569d2,_0x2e3c0f);_0x3ffeda(_0x2e3c0f);});});}exports[_0x2600('0x1b')]=function(_0xed44bb){var _0x5efd1e=this;return new Promise(function(_0x48735d,_0xe07271){return db[_0x2600('0x1c')][_0x2600('0x1d')]({'raw':_0xed44bb['options']?_0xed44bb[_0x2600('0x1e')][_0x2600('0x1f')]===undefined?!![]:![]:!![],'where':_0xed44bb[_0x2600('0x1e')]?_0xed44bb['options'][_0x2600('0x20')]||null:null,'attributes':_0xed44bb['options']?_0xed44bb[_0x2600('0x1e')]['attributes']||null:null,'include':_0xed44bb[_0x2600('0x1e')]?_0xed44bb[_0x2600('0x1e')][_0x2600('0x21')]?_[_0x2600('0x22')](_0xed44bb['options']['include'],function(_0x5b2840){return{'model':db[_0x5b2840[_0x2600('0x23')]],'as':_0x5b2840['as'],'attributes':_0x5b2840[_0x2600('0x24')],'include':_0x5b2840[_0x2600('0x21')]?_[_0x2600('0x22')](_0x5b2840[_0x2600('0x21')],function(_0x112d05){return{'model':db[_0x112d05[_0x2600('0x23')]],'as':_0x112d05['as'],'attributes':_0x112d05[_0x2600('0x24')],'include':_0x112d05[_0x2600('0x21')]?_[_0x2600('0x22')](_0x112d05[_0x2600('0x21')],function(_0xf1c945){return{'model':db[_0xf1c945[_0x2600('0x23')]],'as':_0xf1c945['as'],'attributes':_0xf1c945[_0x2600('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2600('0xf')](function(_0x32e22f){logger[_0x2600('0x10')](_0x2600('0x1b'),_0xed44bb);logger[_0x2600('0x12')](_0x2600('0x1b'),_0xed44bb,JSON[_0x2600('0x14')](_0x32e22f));_0x48735d(_0x32e22f);})['catch'](function(_0x5db721){logger[_0x2600('0x15')]('ShowWhatsappAccount',_0x5db721['message'],_0xed44bb);_0xe07271(_0x5efd1e[_0x2600('0x15')](0x1f4,_0x5db721[_0x2600('0x18')]));});});};
\ No newline at end of file
index 847d588..c78a2cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x591f=['update','removeListener','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x27ae62,_0x38232e){var _0x587ea3=function(_0x3fea6f){while(--_0x3fea6f){_0x27ae62['push'](_0x27ae62['shift']());}};_0x587ea3(++_0x38232e);}(_0x591f,0x1b9));var _0xf591=function(_0x57a5e5,_0x18b0d6){_0x57a5e5=_0x57a5e5-0x0;var _0x354012=_0x591f[_0x57a5e5];return _0x354012;};'use strict';var WhatsappAccountEvents=require(_0xf591('0x0'));var events=[_0xf591('0x1'),_0xf591('0x2'),_0xf591('0x3')];function createListener(_0x37e00a,_0x4832d7){return function(_0x3a7c7c){_0x4832d7['emit'](_0x37e00a,_0x3a7c7c);};}function removeListener(_0x437ea2,_0x2cdd6e){return function(){WhatsappAccountEvents[_0xf591('0x4')](_0x437ea2,_0x2cdd6e);};}exports['register']=function(_0x298f7f){for(var _0x1d59dd=0x0,_0x40f915=events['length'];_0x1d59dd<_0x40f915;_0x1d59dd++){var _0x529ee4=events[_0x1d59dd];var _0x154b42=createListener(_0xf591('0x5')+_0x529ee4,_0x298f7f);WhatsappAccountEvents['on'](_0x529ee4,_0x154b42);}};
\ No newline at end of file
+var _0x6be2=['register','whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener'];(function(_0xd222fc,_0x476f91){var _0x97e046=function(_0x208d57){while(--_0x208d57){_0xd222fc['push'](_0xd222fc['shift']());}};_0x97e046(++_0x476f91);}(_0x6be2,0xa3));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0x26be('0x0'));var events=[_0x26be('0x1'),'remove',_0x26be('0x2')];function createListener(_0x5d8f7d,_0x6776bf){return function(_0x1653b4){_0x6776bf[_0x26be('0x3')](_0x5d8f7d,_0x1653b4);};}function removeListener(_0x3a5cfb,_0x43a4aa){return function(){WhatsappAccountEvents[_0x26be('0x4')](_0x3a5cfb,_0x43a4aa);};}exports[_0x26be('0x5')]=function(_0x346309){for(var _0x17ac51=0x0,_0x134f67=events['length'];_0x17ac51<_0x134f67;_0x17ac51++){var _0xf8fb59=events[_0x17ac51];var _0x7bfabf=createListener(_0x26be('0x6')+_0xf8fb59,_0x346309);WhatsappAccountEvents['on'](_0xf8fb59,_0x7bfabf);}};
\ No newline at end of file
index 98fda45..8a78eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bbf=['get','isAuthenticated','index','post','create','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4bcf59,_0x5f5d53){var _0x2306bc=function(_0x188486){while(--_0x188486){_0x4bcf59['push'](_0x4bcf59['shift']());}};_0x2306bc(++_0x5f5d53);}(_0x1bbf,0xb3));var _0xf1bb=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0x1bbf[_0x2daef6];return _0x62d030;};'use strict';var multer=require(_0xf1bb('0x0'));var util=require(_0xf1bb('0x1'));var path=require('path');var timeout=require(_0xf1bb('0x2'));var express=require(_0xf1bb('0x3'));var router=express[_0xf1bb('0x4')]();var fs_extra=require(_0xf1bb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf1bb('0x6'));var config=require(_0xf1bb('0x7'));var controller=require('./whatsappApplication.controller');router[_0xf1bb('0x8')]('/',auth[_0xf1bb('0x9')](),controller[_0xf1bb('0xa')]);router[_0xf1bb('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf1bb('0xb')]('/',auth[_0xf1bb('0x9')](),controller[_0xf1bb('0xc')]);router['put'](_0xf1bb('0xd'),auth[_0xf1bb('0x9')](),controller[_0xf1bb('0xe')]);router[_0xf1bb('0xf')](_0xf1bb('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xf1bb('0x10')]=router;
\ No newline at end of file
+var _0x44f1=['express','fs-extra','../../components/auth/service','./whatsappApplication.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x6d0f88,_0x1aa0b7){var _0xfab5df=function(_0x677df8){while(--_0x677df8){_0x6d0f88['push'](_0x6d0f88['shift']());}};_0xfab5df(++_0x1aa0b7);}(_0x44f1,0x7a));var _0x144f=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x44f1[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x144f('0x0'));var util=require(_0x144f('0x1'));var path=require(_0x144f('0x2'));var timeout=require(_0x144f('0x3'));var express=require(_0x144f('0x4'));var router=express['Router']();var fs_extra=require(_0x144f('0x5'));var auth=require(_0x144f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x144f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x144f('0x8')]);router[_0x144f('0x9')](_0x144f('0xa'),auth[_0x144f('0xb')](),controller[_0x144f('0xc')]);router[_0x144f('0xd')]('/',auth[_0x144f('0xb')](),controller[_0x144f('0xe')]);router[_0x144f('0xf')](_0x144f('0xa'),auth[_0x144f('0xb')](),controller[_0x144f('0x10')]);router['delete'](_0x144f('0xa'),auth['isAuthenticated'](),controller[_0x144f('0x11')]);module['exports']=router;
\ No newline at end of file
index b09b1d3..d301a4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8805=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x430953,_0x4b6180){var _0x2945b=function(_0x176676){while(--_0x176676){_0x430953['push'](_0x430953['shift']());}};_0x2945b(++_0x4b6180);}(_0x8805,0xca));var _0x5880=function(_0x170f4c,_0x4a4c80){_0x170f4c=_0x170f4c-0x0;var _0x52eedd=_0x8805[_0x170f4c];return _0x52eedd;};'use strict';var Sequelize=require(_0x5880('0x0'));module[_0x5880('0x1')]={'priority':{'type':Sequelize[_0x5880('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5880('0x3')},'appdata':{'type':Sequelize[_0x5880('0x4')]()},'description':{'type':Sequelize[_0x5880('0x5')]},'interval':{'type':Sequelize[_0x5880('0x5')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xe87b=['*,*,*,*','exports','INTEGER','noop','TEXT','STRING'];(function(_0x45e0c8,_0x35f1b8){var _0x41445a=function(_0x1aedf5){while(--_0x1aedf5){_0x45e0c8['push'](_0x45e0c8['shift']());}};_0x41445a(++_0x35f1b8);}(_0xe87b,0xbb));var _0xbe87=function(_0x144357,_0x4cda2f){_0x144357=_0x144357-0x0;var _0xf2526d=_0xe87b[_0x144357];return _0xf2526d;};'use strict';var Sequelize=require('sequelize');module[_0xbe87('0x0')]={'priority':{'type':Sequelize[_0xbe87('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbe87('0x2')},'appdata':{'type':Sequelize[_0xbe87('0x3')]()},'description':{'type':Sequelize[_0xbe87('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbe87('0x5')}};
\ No newline at end of file
index bf0caff..a40218b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x881e=['where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x129bc7,_0x513650){var _0x388bf1=function(_0x71e943){while(--_0x71e943){_0x129bc7['push'](_0x129bc7['shift']());}};_0x388bf1(++_0x513650);}(_0x881e,0x146));var _0xe881=function(_0x103c28,_0x650b95){_0x103c28=_0x103c28-0x0;var _0x294b86=_0x881e[_0x103c28];return _0x294b86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe881('0x0'));var jsonpatch=require(_0xe881('0x1'));var rp=require('request-promise');var moment=require(_0xe881('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe881('0x3'));var util=require(_0xe881('0x4'));var path=require(_0xe881('0x5'));var sox=require(_0xe881('0x6'));var csv=require('to-csv');var ejs=require(_0xe881('0x7'));var fs=require('fs');var fs_extra=require(_0xe881('0x8'));var _=require('lodash');var squel=require(_0xe881('0x9'));var crypto=require(_0xe881('0xa'));var jsforce=require(_0xe881('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe881('0xc'));var Papa=require(_0xe881('0xd'));var Redis=require(_0xe881('0xe'));var authService=require(_0xe881('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe881('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe881('0x11'))(_0xe881('0x12'));var utils=require(_0xe881('0x13'));var config=require(_0xe881('0x14'));var licenseUtil=require(_0xe881('0x15'));var db=require(_0xe881('0x16'))['db'];function respondWithStatusCode(_0x30f7a0,_0x514f99){_0x514f99=_0x514f99||0xcc;return function(_0x1eacd5){if(_0x1eacd5){return _0x30f7a0[_0xe881('0x17')](_0x514f99);}return _0x30f7a0[_0xe881('0x18')](_0x514f99)['end']();};}function respondWithResult(_0x338d29,_0x5d7531){_0x5d7531=_0x5d7531||0xc8;return function(_0x3046bc){if(_0x3046bc){return _0x338d29[_0xe881('0x18')](_0x5d7531)[_0xe881('0x19')](_0x3046bc);}};}function respondWithFilteredResult(_0x23dc0b,_0x4dc849){return function(_0x21b52a){if(_0x21b52a){var _0x2f014f=typeof _0x4dc849[_0xe881('0x1a')]===_0xe881('0x1b')&&typeof _0x4dc849['limit']===_0xe881('0x1b');var _0x3716f5=_0x21b52a['count'];var _0x592fd0=_0x2f014f?0x0:_0x4dc849[_0xe881('0x1a')];var _0x1cfaa9=_0x2f014f?_0x21b52a[_0xe881('0x1c')]:_0x4dc849[_0xe881('0x1a')]+_0x4dc849[_0xe881('0x1d')];var _0x42a4de;if(_0x1cfaa9>=_0x3716f5){_0x1cfaa9=_0x3716f5;_0x42a4de=0xc8;}else{_0x42a4de=0xce;}_0x23dc0b[_0xe881('0x18')](_0x42a4de);return _0x23dc0b[_0xe881('0x1e')](_0xe881('0x1f'),_0x592fd0+'-'+_0x1cfaa9+'/'+_0x3716f5)[_0xe881('0x19')](_0x21b52a);}return null;};}function patchUpdates(_0xa077b2){return function(_0x1c8cd7){try{jsonpatch[_0xe881('0x20')](_0x1c8cd7,_0xa077b2,!![]);}catch(_0x5eb977){return BPromise[_0xe881('0x21')](_0x5eb977);}return _0x1c8cd7[_0xe881('0x22')]();};}function saveUpdates(_0x205e1a,_0x1ad1f5){return function(_0xf1f388){if(_0xf1f388){return _0xf1f388[_0xe881('0x23')](_0x205e1a)[_0xe881('0x24')](function(_0x21d491){return _0x21d491;});}return null;};}function removeEntity(_0x33c6cb,_0xd335a0){return function(_0x495f72){if(_0x495f72){return _0x495f72['destroy']()[_0xe881('0x24')](function(){_0x33c6cb['status'](0xcc)[_0xe881('0x25')]();});}};}function handleEntityNotFound(_0x53bd85,_0x47fdf4){return function(_0x5f3961){if(!_0x5f3961){_0x53bd85['sendStatus'](0x194);}return _0x5f3961;};}function handleError(_0x442eb3,_0x564562){_0x564562=_0x564562||0x1f4;return function(_0x592d02){logger['error'](_0x592d02[_0xe881('0x26')]);if(_0x592d02[_0xe881('0x27')]){delete _0x592d02['name'];}_0x442eb3[_0xe881('0x18')](_0x564562)[_0xe881('0x28')](_0x592d02);};}exports[_0xe881('0x29')]=function(_0xaa75e7,_0x22fb3a){var _0xb38dd7={},_0x1aba0d={},_0x2864d8={'count':0x0,'rows':[]};var _0x51de7e=_[_0xe881('0x2a')](db[_0xe881('0x2b')][_0xe881('0x2c')],function(_0x4ee181){return{'name':_0x4ee181[_0xe881('0x2d')],'type':_0x4ee181[_0xe881('0x2e')][_0xe881('0x2f')]};});_0x1aba0d[_0xe881('0x30')]=_[_0xe881('0x2a')](_0x51de7e,_0xe881('0x27'));_0x1aba0d[_0xe881('0x31')]=_[_0xe881('0x32')](_0xaa75e7['query']);_0x1aba0d['filters']=_[_0xe881('0x33')](_0x1aba0d[_0xe881('0x30')],_0x1aba0d[_0xe881('0x31')]);_0xb38dd7[_0xe881('0x34')]=_[_0xe881('0x33')](_0x1aba0d[_0xe881('0x30')],qs[_0xe881('0x35')](_0xaa75e7['query'][_0xe881('0x35')]));_0xb38dd7['attributes']=_0xb38dd7[_0xe881('0x34')][_0xe881('0x36')]?_0xb38dd7[_0xe881('0x34')]:_0x1aba0d[_0xe881('0x30')];if(!_0xaa75e7[_0xe881('0x31')][_0xe881('0x37')](_0xe881('0x38'))){_0xb38dd7['limit']=qs[_0xe881('0x1d')](_0xaa75e7[_0xe881('0x31')]['limit']);_0xb38dd7[_0xe881('0x1a')]=qs['offset'](_0xaa75e7[_0xe881('0x31')][_0xe881('0x1a')]);}_0xb38dd7[_0xe881('0x39')]=qs['sort'](_0xaa75e7['query'][_0xe881('0x3a')]);_0xb38dd7[_0xe881('0x3b')]=qs[_0xe881('0x3c')](_[_0xe881('0x3d')](_0xaa75e7[_0xe881('0x31')],_0x1aba0d[_0xe881('0x3c')]),_0x51de7e);if(_0xaa75e7[_0xe881('0x31')][_0xe881('0x3e')]){_0xb38dd7[_0xe881('0x3b')]=_['merge'](_0xb38dd7[_0xe881('0x3b')],{'$or':_['map'](_0x51de7e,function(_0x4278fd){if(_0x4278fd[_0xe881('0x2e')]!==_0xe881('0x3f')){var _0x5e01bc={};_0x5e01bc[_0x4278fd[_0xe881('0x27')]]={'$like':'%'+_0xaa75e7[_0xe881('0x31')]['filter']+'%'};return _0x5e01bc;}})});}_0xb38dd7=_[_0xe881('0x40')]({},_0xb38dd7,_0xaa75e7[_0xe881('0x41')]);var _0x56e780={'where':_0xb38dd7[_0xe881('0x3b')]};return db[_0xe881('0x2b')][_0xe881('0x1c')](_0x56e780)[_0xe881('0x24')](function(_0x3eff24){_0x2864d8[_0xe881('0x1c')]=_0x3eff24;if(_0xaa75e7[_0xe881('0x31')][_0xe881('0x42')]){_0xb38dd7[_0xe881('0x43')]=[{'all':!![]}];}return db[_0xe881('0x2b')][_0xe881('0x44')](_0xb38dd7);})['then'](function(_0x2e91d6){_0x2864d8[_0xe881('0x45')]=_0x2e91d6;return _0x2864d8;})['then'](respondWithFilteredResult(_0x22fb3a,_0xb38dd7))[_0xe881('0x46')](handleError(_0x22fb3a,null));};exports[_0xe881('0x47')]=function(_0x41043e,_0x567538){var _0x3b61a7={'raw':!![],'where':{'id':_0x41043e[_0xe881('0x48')]['id']}},_0x4c93c1={};_0x4c93c1[_0xe881('0x30')]=_['keys'](db[_0xe881('0x2b')][_0xe881('0x2c')]);_0x4c93c1[_0xe881('0x31')]=_[_0xe881('0x32')](_0x41043e[_0xe881('0x31')]);_0x4c93c1[_0xe881('0x3c')]=_[_0xe881('0x33')](_0x4c93c1[_0xe881('0x30')],_0x4c93c1[_0xe881('0x31')]);_0x3b61a7['attributes']=_[_0xe881('0x33')](_0x4c93c1[_0xe881('0x30')],qs['fields'](_0x41043e['query'][_0xe881('0x35')]));_0x3b61a7['attributes']=_0x3b61a7[_0xe881('0x34')][_0xe881('0x36')]?_0x3b61a7[_0xe881('0x34')]:_0x4c93c1[_0xe881('0x30')];if(_0x41043e[_0xe881('0x31')]['includeAll']){_0x3b61a7[_0xe881('0x43')]=[{'all':!![]}];}_0x3b61a7=_['merge']({},_0x3b61a7,_0x41043e[_0xe881('0x41')]);return db[_0xe881('0x2b')]['find'](_0x3b61a7)[_0xe881('0x24')](handleEntityNotFound(_0x567538,null))['then'](respondWithResult(_0x567538,null))[_0xe881('0x46')](handleError(_0x567538,null));};exports[_0xe881('0x49')]=function(_0x336960,_0x1bdb9c){return db[_0xe881('0x2b')][_0xe881('0x49')](_0x336960['body'],{})[_0xe881('0x24')](respondWithResult(_0x1bdb9c,0xc9))[_0xe881('0x46')](handleError(_0x1bdb9c,null));};exports['update']=function(_0x5abcf9,_0x2474e4){if(_0x5abcf9[_0xe881('0x4a')]['id']){delete _0x5abcf9[_0xe881('0x4a')]['id'];}return db['WhatsappApplication'][_0xe881('0x4b')]({'where':{'id':_0x5abcf9[_0xe881('0x48')]['id']}})['then'](handleEntityNotFound(_0x2474e4,null))[_0xe881('0x24')](saveUpdates(_0x5abcf9[_0xe881('0x4a')],null))['then'](respondWithResult(_0x2474e4,null))['catch'](handleError(_0x2474e4,null));};exports[_0xe881('0x4c')]=function(_0x526314,_0x51a985){return db[_0xe881('0x2b')][_0xe881('0x4b')]({'where':{'id':_0x526314[_0xe881('0x48')]['id']}})[_0xe881('0x24')](handleEntityNotFound(_0x51a985,null))['then'](removeEntity(_0x51a985,null))[_0xe881('0x46')](handleError(_0x51a985,null));};
\ No newline at end of file
+var _0xe98f=['update','find','destroy','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','WhatsappApplication','includeAll','findAll','rows','catch','show','params','include','create','body'];(function(_0x3a4c5a,_0x5211c9){var _0x37edff=function(_0x1655eb){while(--_0x1655eb){_0x3a4c5a['push'](_0x3a4c5a['shift']());}};_0x37edff(++_0x5211c9);}(_0xe98f,0xde));var _0xfe98=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe98f[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xfe98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe98('0x2'));var moment=require(_0xfe98('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe98('0x4'));var path=require('path');var sox=require(_0xfe98('0x5'));var csv=require(_0xfe98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe98('0x7'));var _=require('lodash');var squel=require(_0xfe98('0x8'));var crypto=require(_0xfe98('0x9'));var jsforce=require(_0xfe98('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfe98('0x6'));var querystring=require(_0xfe98('0xb'));var Papa=require('papaparse');var Redis=require(_0xfe98('0xc'));var authService=require(_0xfe98('0xd'));var qs=require(_0xfe98('0xe'));var as=require(_0xfe98('0xf'));var hardwareService=require(_0xfe98('0x10'));var logger=require(_0xfe98('0x11'))('api');var utils=require(_0xfe98('0x12'));var config=require(_0xfe98('0x13'));var licenseUtil=require(_0xfe98('0x14'));var db=require(_0xfe98('0x15'))['db'];function respondWithStatusCode(_0x2f5c07,_0x5301bb){_0x5301bb=_0x5301bb||0xcc;return function(_0x1f377f){if(_0x1f377f){return _0x2f5c07[_0xfe98('0x16')](_0x5301bb);}return _0x2f5c07['status'](_0x5301bb)[_0xfe98('0x17')]();};}function respondWithResult(_0x4a71ca,_0x1472e1){_0x1472e1=_0x1472e1||0xc8;return function(_0x3386de){if(_0x3386de){return _0x4a71ca[_0xfe98('0x18')](_0x1472e1)[_0xfe98('0x19')](_0x3386de);}};}function respondWithFilteredResult(_0x47eb77,_0x248436){return function(_0x4d92fc){if(_0x4d92fc){var _0x416c4c=typeof _0x248436[_0xfe98('0x1a')]===_0xfe98('0x1b')&&typeof _0x248436[_0xfe98('0x1c')]==='undefined';var _0x56c0f4=_0x4d92fc[_0xfe98('0x1d')];var _0x26ad78=_0x416c4c?0x0:_0x248436[_0xfe98('0x1a')];var _0x595a34=_0x416c4c?_0x4d92fc[_0xfe98('0x1d')]:_0x248436[_0xfe98('0x1a')]+_0x248436[_0xfe98('0x1c')];var _0x40f0b1;if(_0x595a34>=_0x56c0f4){_0x595a34=_0x56c0f4;_0x40f0b1=0xc8;}else{_0x40f0b1=0xce;}_0x47eb77[_0xfe98('0x18')](_0x40f0b1);return _0x47eb77[_0xfe98('0x1e')](_0xfe98('0x1f'),_0x26ad78+'-'+_0x595a34+'/'+_0x56c0f4)['json'](_0x4d92fc);}return null;};}function patchUpdates(_0x1ca3ba){return function(_0x517841){try{jsonpatch[_0xfe98('0x20')](_0x517841,_0x1ca3ba,!![]);}catch(_0x51d257){return BPromise['reject'](_0x51d257);}return _0x517841[_0xfe98('0x21')]();};}function saveUpdates(_0x9c1f99,_0x413a92){return function(_0xc3c06a){if(_0xc3c06a){return _0xc3c06a['update'](_0x9c1f99)[_0xfe98('0x22')](function(_0x4b808c){return _0x4b808c;});}return null;};}function removeEntity(_0x3edb13,_0x249f2c){return function(_0xb628ed){if(_0xb628ed){return _0xb628ed['destroy']()['then'](function(){_0x3edb13[_0xfe98('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b629e,_0x2c9323){return function(_0x4d17b7){if(!_0x4d17b7){_0x7b629e[_0xfe98('0x16')](0x194);}return _0x4d17b7;};}function handleError(_0x25f675,_0x21325b){_0x21325b=_0x21325b||0x1f4;return function(_0x44096c){logger['error'](_0x44096c['stack']);if(_0x44096c['name']){delete _0x44096c['name'];}_0x25f675[_0xfe98('0x18')](_0x21325b)[_0xfe98('0x23')](_0x44096c);};}exports[_0xfe98('0x24')]=function(_0x21c730,_0x1f3fb5){var _0x1017b5={},_0x3029={},_0x44e9d6={'count':0x0,'rows':[]};var _0x3304d5=_[_0xfe98('0x25')](db['WhatsappApplication'][_0xfe98('0x26')],function(_0x1c56e5){return{'name':_0x1c56e5[_0xfe98('0x27')],'type':_0x1c56e5[_0xfe98('0x28')][_0xfe98('0x29')]};});_0x3029[_0xfe98('0x2a')]=_[_0xfe98('0x25')](_0x3304d5,_0xfe98('0x2b'));_0x3029[_0xfe98('0x2c')]=_[_0xfe98('0x2d')](_0x21c730[_0xfe98('0x2c')]);_0x3029[_0xfe98('0x2e')]=_[_0xfe98('0x2f')](_0x3029[_0xfe98('0x2a')],_0x3029[_0xfe98('0x2c')]);_0x1017b5['attributes']=_['intersection'](_0x3029[_0xfe98('0x2a')],qs[_0xfe98('0x30')](_0x21c730['query'][_0xfe98('0x30')]));_0x1017b5[_0xfe98('0x31')]=_0x1017b5[_0xfe98('0x31')][_0xfe98('0x32')]?_0x1017b5[_0xfe98('0x31')]:_0x3029['model'];if(!_0x21c730[_0xfe98('0x2c')][_0xfe98('0x33')](_0xfe98('0x34'))){_0x1017b5[_0xfe98('0x1c')]=qs[_0xfe98('0x1c')](_0x21c730['query'][_0xfe98('0x1c')]);_0x1017b5['offset']=qs[_0xfe98('0x1a')](_0x21c730[_0xfe98('0x2c')][_0xfe98('0x1a')]);}_0x1017b5[_0xfe98('0x35')]=qs[_0xfe98('0x36')](_0x21c730[_0xfe98('0x2c')][_0xfe98('0x36')]);_0x1017b5[_0xfe98('0x37')]=qs['filters'](_['pick'](_0x21c730[_0xfe98('0x2c')],_0x3029[_0xfe98('0x2e')]),_0x3304d5);if(_0x21c730[_0xfe98('0x2c')][_0xfe98('0x38')]){_0x1017b5[_0xfe98('0x37')]=_['merge'](_0x1017b5[_0xfe98('0x37')],{'$or':_[_0xfe98('0x25')](_0x3304d5,function(_0x342c11){if(_0x342c11['type']!==_0xfe98('0x39')){var _0x30723b={};_0x30723b[_0x342c11[_0xfe98('0x2b')]]={'$like':'%'+_0x21c730[_0xfe98('0x2c')]['filter']+'%'};return _0x30723b;}})});}_0x1017b5=_[_0xfe98('0x3a')]({},_0x1017b5,_0x21c730[_0xfe98('0x3b')]);var _0x59971e={'where':_0x1017b5[_0xfe98('0x37')]};return db[_0xfe98('0x3c')][_0xfe98('0x1d')](_0x59971e)['then'](function(_0x56f379){_0x44e9d6['count']=_0x56f379;if(_0x21c730['query'][_0xfe98('0x3d')]){_0x1017b5['include']=[{'all':!![]}];}return db[_0xfe98('0x3c')][_0xfe98('0x3e')](_0x1017b5);})['then'](function(_0x43b085){_0x44e9d6[_0xfe98('0x3f')]=_0x43b085;return _0x44e9d6;})[_0xfe98('0x22')](respondWithFilteredResult(_0x1f3fb5,_0x1017b5))[_0xfe98('0x40')](handleError(_0x1f3fb5,null));};exports[_0xfe98('0x41')]=function(_0x36795a,_0x12e6dd){var _0x18c322={'raw':!![],'where':{'id':_0x36795a[_0xfe98('0x42')]['id']}},_0x5dae05={};_0x5dae05[_0xfe98('0x2a')]=_['keys'](db[_0xfe98('0x3c')][_0xfe98('0x26')]);_0x5dae05[_0xfe98('0x2c')]=_[_0xfe98('0x2d')](_0x36795a['query']);_0x5dae05[_0xfe98('0x2e')]=_['intersection'](_0x5dae05[_0xfe98('0x2a')],_0x5dae05[_0xfe98('0x2c')]);_0x18c322[_0xfe98('0x31')]=_[_0xfe98('0x2f')](_0x5dae05['model'],qs[_0xfe98('0x30')](_0x36795a[_0xfe98('0x2c')][_0xfe98('0x30')]));_0x18c322[_0xfe98('0x31')]=_0x18c322[_0xfe98('0x31')][_0xfe98('0x32')]?_0x18c322['attributes']:_0x5dae05[_0xfe98('0x2a')];if(_0x36795a[_0xfe98('0x2c')][_0xfe98('0x3d')]){_0x18c322[_0xfe98('0x43')]=[{'all':!![]}];}_0x18c322=_[_0xfe98('0x3a')]({},_0x18c322,_0x36795a[_0xfe98('0x3b')]);return db[_0xfe98('0x3c')]['find'](_0x18c322)[_0xfe98('0x22')](handleEntityNotFound(_0x12e6dd,null))[_0xfe98('0x22')](respondWithResult(_0x12e6dd,null))[_0xfe98('0x40')](handleError(_0x12e6dd,null));};exports[_0xfe98('0x44')]=function(_0x14f5e5,_0x4cb1de){return db[_0xfe98('0x3c')]['create'](_0x14f5e5[_0xfe98('0x45')],{})[_0xfe98('0x22')](respondWithResult(_0x4cb1de,0xc9))[_0xfe98('0x40')](handleError(_0x4cb1de,null));};exports[_0xfe98('0x46')]=function(_0x27b100,_0x475394){if(_0x27b100[_0xfe98('0x45')]['id']){delete _0x27b100[_0xfe98('0x45')]['id'];}return db['WhatsappApplication'][_0xfe98('0x47')]({'where':{'id':_0x27b100[_0xfe98('0x42')]['id']}})[_0xfe98('0x22')](handleEntityNotFound(_0x475394,null))[_0xfe98('0x22')](saveUpdates(_0x27b100['body'],null))[_0xfe98('0x22')](respondWithResult(_0x475394,null))[_0xfe98('0x40')](handleError(_0x475394,null));};exports[_0xfe98('0x48')]=function(_0x22fbcf,_0x27441e){return db[_0xfe98('0x3c')]['find']({'where':{'id':_0x22fbcf[_0xfe98('0x42')]['id']}})[_0xfe98('0x22')](handleEntityNotFound(_0x27441e,null))[_0xfe98('0x22')](removeEntity(_0x27441e,null))[_0xfe98('0x40')](handleError(_0x27441e,null));};
\ No newline at end of file
index d4d33b5..556374f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf120=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci'];(function(_0x3f5120,_0x216b34){var _0x169d43=function(_0x237f83){while(--_0x237f83){_0x3f5120['push'](_0x3f5120['shift']());}};_0x169d43(++_0x216b34);}(_0xf120,0x179));var _0x0f12=function(_0x12f463,_0x358afe){_0x12f463=_0x12f463-0x0;var _0x3dcecf=_0xf120[_0x12f463];return _0x3dcecf;};'use strict';var _=require('lodash');var util=require(_0x0f12('0x0'));var logger=require(_0x0f12('0x1'))(_0x0f12('0x2'));var moment=require('moment');var BPromise=require(_0x0f12('0x3'));var rp=require(_0x0f12('0x4'));var fs=require('fs');var path=require(_0x0f12('0x5'));var rimraf=require('rimraf');var config=require(_0x0f12('0x6'));var attributes=require(_0x0f12('0x7'));module[_0x0f12('0x8')]=function(_0x308941,_0x21f951){return _0x308941[_0x0f12('0x9')](_0x0f12('0xa'),attributes,{'tableName':_0x0f12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0f12('0xc')});};
\ No newline at end of file
+var _0x851e=['request-promise','path','rimraf','../../config/environment','exports','define','WhatsappApplication','utf8mb4','lodash','util','../../config/logger','bluebird'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0x851e,0x1e8));var _0xe851=function(_0x1bcc92,_0x4929b8){_0x1bcc92=_0x1bcc92-0x0;var _0x88406a=_0x851e[_0x1bcc92];return _0x88406a;};'use strict';var _=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var logger=require(_0xe851('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe851('0x3'));var rp=require(_0xe851('0x4'));var fs=require('fs');var path=require(_0xe851('0x5'));var rimraf=require(_0xe851('0x6'));var config=require(_0xe851('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0xe851('0x8')]=function(_0x2b36b5,_0xba0648){return _0x2b36b5[_0xe851('0x9')](_0xe851('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe851('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 7a0016d..50f5495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x8505c0,_0x5a733d){var _0x4ff0b5=function(_0x2f666c){while(--_0x2f666c){_0x8505c0['push'](_0x8505c0['shift']());}};_0x4ff0b5(++_0x5a733d);}(_0x70e0,0x17b));var _0x070e=function(_0xb20afe,_0x503817){_0xb20afe=_0xb20afe-0x0;var _0x235cc2=_0x70e0[_0xb20afe];return _0x235cc2;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
+var _0xd6d6=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30b593,_0x159fe){var _0x16b05c=function(_0x552d80){while(--_0x552d80){_0x30b593['push'](_0x30b593['shift']());}};_0x16b05c(++_0x159fe);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x31484b,_0x2b2a1b){_0x31484b=_0x31484b-0x0;var _0x117feb=_0xd6d6[_0x31484b];return _0x117feb;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});}
\ No newline at end of file
index 4731977..b5b5c5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3f=['/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage'];(function(_0x51766c,_0x4110ef){var _0x243c62=function(_0xdefdbe){while(--_0xdefdbe){_0x51766c['push'](_0x51766c['shift']());}};_0x243c62(++_0x4110ef);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x317e2d,_0x4bea77){_0x317e2d=_0x317e2d-0x0;var _0x34f979=_0xaa3f[_0x317e2d];return _0x34f979;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0x9')](_0xfaa3('0xe'),auth['isAuthenticated'](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xfaa3('0x10')]);router[_0xfaa3('0x9')](_0xfaa3('0x11'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x12')]);router[_0xfaa3('0x13')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0x14')]);router['post'](_0xfaa3('0x15'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x16')]);router['post'](_0xfaa3('0x17'),auth['isAuthenticated'](),interaction[_0xfaa3('0x18')](_0xfaa3('0x19'),_0xfaa3('0x1a')),controller[_0xfaa3('0x1b')]);router[_0xfaa3('0x1c')](_0xfaa3('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xfaa3('0x19'),_0xfaa3('0x1d')),controller[_0xfaa3('0x1e')]);router[_0xfaa3('0x1f')]('/:id',auth['isAuthenticated'](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0xfaa3('0x20')]);router['delete'](_0xfaa3('0x17'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x21')]);module[_0xfaa3('0x22')]=router;
\ No newline at end of file
+var _0x0af5=['/:id/tags','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages','/:id/download','download','create','post','addMessage','tracked','whatsappinteraction:addtags','addTags','update','delete','whatsapp','whatsappinteraction:destroy','destroy'];(function(_0x3d242c,_0x3ae0f7){var _0x451ddf=function(_0x1510bd){while(--_0x1510bd){_0x3d242c['push'](_0x3d242c['shift']());}};_0x451ddf(++_0x3ae0f7);}(_0x0af5,0x158));var _0x50af=function(_0x259196,_0x21aa27){_0x259196=_0x259196-0x0;var _0x4111a9=_0x0af5[_0x259196];return _0x4111a9;};'use strict';var multer=require('multer');var util=require(_0x50af('0x0'));var path=require(_0x50af('0x1'));var timeout=require(_0x50af('0x2'));var express=require(_0x50af('0x3'));var router=express[_0x50af('0x4')]();var fs_extra=require(_0x50af('0x5'));var auth=require(_0x50af('0x6'));var interaction=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var controller=require(_0x50af('0x9'));router[_0x50af('0xa')]('/',auth[_0x50af('0xb')](),controller['index']);router['get'](_0x50af('0xc'),auth[_0x50af('0xb')](),controller['describe']);router['get'](_0x50af('0xd'),auth[_0x50af('0xb')](),controller['show']);router['get'](_0x50af('0xe'),auth[_0x50af('0xb')](),controller['getMessages']);router[_0x50af('0xa')](_0x50af('0xf'),auth[_0x50af('0xb')](),controller[_0x50af('0x10')]);router['post']('/',auth[_0x50af('0xb')](),controller[_0x50af('0x11')]);router[_0x50af('0x12')](_0x50af('0xe'),auth[_0x50af('0xb')](),controller[_0x50af('0x13')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x50af('0x14')]('whatsapp',_0x50af('0x15')),controller[_0x50af('0x16')]);router['put']('/:id',auth[_0x50af('0xb')](),interaction[_0x50af('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0x50af('0x17')]);router[_0x50af('0x18')](_0x50af('0xd'),auth[_0x50af('0xb')](),interaction[_0x50af('0x14')](_0x50af('0x19'),_0x50af('0x1a')),controller[_0x50af('0x1b')]);router[_0x50af('0x18')](_0x50af('0x1c'),auth['isAuthenticated'](),controller[_0x50af('0x1d')]);module[_0x50af('0x1e')]=router;
\ No newline at end of file
index 65730a7..c6630b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7de=['STRING','DATE','ENUM','out','BOOLEAN','sequelize','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7de,0x165));var _0xee7d=function(_0x411eca,_0x57b18b){_0x411eca=_0x411eca-0x0;var _0x18ddf7=_0xe7de[_0x411eca];return _0x18ddf7;};'use strict';var Sequelize=require(_0xee7d('0x0'));var moment=require(_0xee7d('0x1'));module[_0xee7d('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xee7d('0x3')]},'secondDisposition':{'type':Sequelize[_0xee7d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xee7d('0x3')]},'note':{'type':Sequelize[_0xee7d('0x3')]},'phone':{'type':Sequelize[_0xee7d('0x3')]},'read1stAt':{'type':Sequelize[_0xee7d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xee7d('0x5')]('in',_0xee7d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xee7d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xee7d('0x5')]('in',_0xee7d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xee7d('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8375=['sequelize','moment','exports','DATE','STRING','ENUM','out'];(function(_0x40b3b0,_0x3fbd48){var _0x501f46=function(_0x2d0c68){while(--_0x2d0c68){_0x40b3b0['push'](_0x40b3b0['shift']());}};_0x501f46(++_0x3fbd48);}(_0x8375,0xa8));var _0x5837=function(_0x162cb0,_0x274d00){_0x162cb0=_0x162cb0-0x0;var _0x4b5223=_0x8375[_0x162cb0];return _0x4b5223;};'use strict';var Sequelize=require(_0x5837('0x0'));var moment=require(_0x5837('0x1'));module[_0x5837('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5837('0x3')]},'disposition':{'type':Sequelize[_0x5837('0x4')]},'secondDisposition':{'type':Sequelize[_0x5837('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5837('0x4')]},'note':{'type':Sequelize[_0x5837('0x4')]},'phone':{'type':Sequelize[_0x5837('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5837('0x5')]('in',_0x5837('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5837('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5837('0x5')]('in',_0x5837('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 016a47e..6f39d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x303a=['stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','index','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','user_has_whatsapp_interactions','left_join','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','agent','sequelize','toString','count','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','push','rows','catch','show','params','filters','options','create','body','describe','addMessage','WhatsappMessage','getMessages','nolimit','pick','WhatsappInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','merge','includeAll','include','addTags','ids','omit','spread','emit','whatsappInteractionTags:save','removeTags','join','root','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','secret','Owner','get','mkdirSync','Whatsapp','closed','disposition','basename','createReadStream','pipe','createWriteStream','direction','out','server','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','offset','limit','undefined','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error'];(function(_0x42ddaf,_0x34e195){var _0x329485=function(_0x4049c2){while(--_0x4049c2){_0x42ddaf['push'](_0x42ddaf['shift']());}};_0x329485(++_0x34e195);}(_0x303a,0x1a0));var _0xa303=function(_0x545fe3,_0x3b191f){_0x545fe3=_0x545fe3-0x0;var _0x480702=_0x303a[_0x545fe3];return _0x480702;};'use strict';var emlformat=require(_0xa303('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa303('0x1'));var jsonpatch=require(_0xa303('0x2'));var rp=require(_0xa303('0x3'));var moment=require(_0xa303('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa303('0x5'));var util=require(_0xa303('0x6'));var path=require(_0xa303('0x7'));var sox=require(_0xa303('0x8'));var csv=require(_0xa303('0x9'));var ejs=require(_0xa303('0xa'));var fs=require('fs');var fs_extra=require(_0xa303('0xb'));var _=require(_0xa303('0xc'));var squel=require(_0xa303('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa303('0x9'));var querystring=require(_0xa303('0xe'));var Papa=require('papaparse');var Redis=require(_0xa303('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa303('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa303('0x11'));var hardwareService=require(_0xa303('0x12'));var logger=require(_0xa303('0x13'))(_0xa303('0x14'));var utils=require('../../config/utils');var config=require(_0xa303('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa303('0x16'))['db'];config[_0xa303('0x17')]=_[_0xa303('0x18')](config['redis'],{'host':_0xa303('0x19'),'port':0x18eb});var socket=require(_0xa303('0x1a'))(new Redis(config[_0xa303('0x17')]));require(_0xa303('0x1b'))[_0xa303('0x1c')](socket);function respondWithStatusCode(_0x1618e6,_0x475a91){_0x475a91=_0x475a91||0xcc;return function(_0x2d1110){if(_0x2d1110){return _0x1618e6['sendStatus'](_0x475a91);}return _0x1618e6[_0xa303('0x1d')](_0x475a91)[_0xa303('0x1e')]();};}function respondWithResult(_0x1f3ede,_0x288596){_0x288596=_0x288596||0xc8;return function(_0x3e2813){if(_0x3e2813){return _0x1f3ede[_0xa303('0x1d')](_0x288596)['json'](_0x3e2813);}};}function respondWithFilteredResult(_0x28c164,_0x54ca49){return function(_0x1d2003){if(_0x1d2003){var _0x4cf535=typeof _0x54ca49[_0xa303('0x1f')]==='undefined'&&typeof _0x54ca49[_0xa303('0x20')]===_0xa303('0x21');var _0x1ca402=_0x1d2003['count'];var _0x2524db=_0x4cf535?0x0:_0x54ca49[_0xa303('0x1f')];var _0x1b0566=_0x4cf535?_0x1d2003['count']:_0x54ca49[_0xa303('0x1f')]+_0x54ca49[_0xa303('0x20')];var _0x21deee;if(_0x1b0566>=_0x1ca402){_0x1b0566=_0x1ca402;_0x21deee=0xc8;}else{_0x21deee=0xce;}_0x28c164[_0xa303('0x1d')](_0x21deee);return _0x28c164['set'](_0xa303('0x22'),_0x2524db+'-'+_0x1b0566+'/'+_0x1ca402)[_0xa303('0x23')](_0x1d2003);}return null;};}function patchUpdates(_0x565b2e){return function(_0x16ee3d){try{jsonpatch[_0xa303('0x24')](_0x16ee3d,_0x565b2e,!![]);}catch(_0x25db9c){return BPromise[_0xa303('0x25')](_0x25db9c);}return _0x16ee3d[_0xa303('0x26')]();};}function saveUpdates(_0x577ea7,_0x3d3d8a){return function(_0x5d9dee){if(_0x5d9dee){return _0x5d9dee[_0xa303('0x27')](_0x577ea7)['then'](function(_0x532d4d){return _0x532d4d;});}return null;};}function removeEntity(_0x4dad5b,_0x58922f){return function(_0x5da2d2){if(_0x5da2d2){return _0x5da2d2[_0xa303('0x28')]()[_0xa303('0x29')](function(){_0x4dad5b[_0xa303('0x1d')](0xcc)[_0xa303('0x1e')]();});}};}function handleEntityNotFound(_0x94d3e4,_0x48e79f){return function(_0x2d1341){if(!_0x2d1341){_0x94d3e4[_0xa303('0x2a')](0x194);}return _0x2d1341;};}function handleError(_0x561d73,_0x221f59){_0x221f59=_0x221f59||0x1f4;return function(_0xef04b){logger[_0xa303('0x2b')](_0xef04b[_0xa303('0x2c')]);if(_0xef04b[_0xa303('0x2d')]){delete _0xef04b[_0xa303('0x2d')];}_0x561d73[_0xa303('0x1d')](_0x221f59)[_0xa303('0x2e')](_0xef04b);};}function getInteractionUsers(_0x411b42,_0x3383f4){return new BPromise(function(_0x9b7e61,_0x217967){try{if(_0x3383f4[_0x411b42['id']]){_0x411b42[_0xa303('0x2f')]=_[_0xa303('0x30')](_0x3383f4[_0x411b42['id']],function(_0x35e324){return{'id':_0x35e324['id'],'fullname':_0x35e324[_0xa303('0x31')]};});}}catch(_0x228ae7){_0x217967(_0x228ae7);}_0x9b7e61(_0x411b42);});}function getInteractionTags(_0x5de180,_0x485c08){return new BPromise(function(_0x35c312,_0x37cda6){try{if(_0x5de180[_0xa303('0x32')]){_0x5de180[_0xa303('0x33')]=[];_0x5de180['TagIds'][_0xa303('0x34')](',')[_0xa303('0x35')](function(_0x3c21ec){_0x5de180[_0xa303('0x33')]['push'](_0x485c08[_0x3c21ec]);});}delete _0x5de180[_0xa303('0x32')];}catch(_0x37376d){_0x37cda6(_0x37376d);}_0x35c312(_0x5de180);});}function updateWhatsappInteraction(_0x3aca02,_0x483e38,_0xd35249){return new BPromise(function(_0x4349cd,_0x1150fb){return getInteractionUsers(_0x3aca02,_0xd35249)['then'](function(_0x246e17){return getInteractionTags(_0x246e17,_0x483e38);})[_0xa303('0x29')](function(_0x3e432d){_0x4349cd(_0x3e432d);})['catch'](function(_0x7b8a4b){_0x1150fb(_0x7b8a4b);});});}exports[_0xa303('0x36')]=function(_0x3ad97e,_0x6ec021){var _0x4f3c31={},_0x1835c2={},_0x23c318={'count':0x0,'rows':[]};var _0x107cdc=_[_0xa303('0x30')](db['WhatsappInteraction'][_0xa303('0x37')],function(_0x2567f9){return{'name':_0x2567f9[_0xa303('0x38')],'type':_0x2567f9[_0xa303('0x39')][_0xa303('0x3a')]};});_0x1835c2['model']=_['map'](_0x107cdc,_0xa303('0x2d'));_0x1835c2[_0xa303('0x3b')]=_[_0xa303('0x3c')](_0x3ad97e['query']);_0x1835c2['filters']=_[_0xa303('0x3d')](_0x1835c2[_0xa303('0x3e')],_0x1835c2[_0xa303('0x3b')]);_0x4f3c31[_0xa303('0x3f')]=_['intersection'](_0x1835c2['model'],qs[_0xa303('0x40')](_0x3ad97e[_0xa303('0x3b')][_0xa303('0x40')]));_0x4f3c31[_0xa303('0x3f')]=_0x4f3c31[_0xa303('0x3f')]['length']?_0x4f3c31[_0xa303('0x3f')]:_0x1835c2[_0xa303('0x3e')];if(!_0x3ad97e[_0xa303('0x3b')][_0xa303('0x41')]('nolimit')){_0x4f3c31['limit']=qs['limit'](_0x3ad97e[_0xa303('0x3b')][_0xa303('0x20')]);_0x4f3c31[_0xa303('0x1f')]=qs[_0xa303('0x1f')](_0x3ad97e[_0xa303('0x3b')][_0xa303('0x1f')]);}_0x4f3c31[_0xa303('0x42')]=qs[_0xa303('0x43')](_0x3ad97e[_0xa303('0x3b')][_0xa303('0x43')]);_0x4f3c31[_0xa303('0x44')]=qs['filters'](_['pick'](_0x3ad97e[_0xa303('0x3b')],_0x1835c2['filters']),_0x107cdc);var _0x839adf=[];var _0x564d59=squel[_0xa303('0x45')]()[_0xa303('0x46')]('id')[_0xa303('0x46')](_0xa303('0x2d'))[_0xa303('0x46')](_0xa303('0x47'))[_0xa303('0x48')](_0xa303('0x49'));var _0x1040f5=squel[_0xa303('0x45')]()[_0xa303('0x46')](_0xa303('0x4a'))[_0xa303('0x46')]('u.fullname')[_0xa303('0x46')]('ui.WhatsappInteractionId')[_0xa303('0x48')](_0xa303('0x4b'),'ui')[_0xa303('0x4c')]('users','u','u.id\x20=\x20ui.UserId');var _0x9240e1=squel[_0xa303('0x45')]()[_0xa303('0x48')](_0xa303('0x4d'),'i')[_0xa303('0x4c')](_0xa303('0x4e'),'c',_0xa303('0x4f'))[_0xa303('0x4c')](_0xa303('0x50'),'o',_0xa303('0x51'))['left_join'](_0xa303('0x52'),'a',_0xa303('0x53'))['left_join'](_0xa303('0x54'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xa303('0x4c')](_0xa303('0x55'),'it',_0xa303('0x56'))[_0xa303('0x4c')]('tools_tags','t',_0xa303('0x57'));var _0x146b0c=squel[_0xa303('0x58')]();var _0x335414=[];var _0x45d106=squel[_0xa303('0x58')]();var _0x538ef4;if(_0x3ad97e[_0xa303('0x3b')][_0xa303('0x59')]){_0x538ef4=as[_0xa303('0x5a')](_0x3ad97e[_0xa303('0x3b')]['search']);var _0x4c11b7=_0x538ef4[_0xa303('0x5b')];for(var _0x35e114=0x0;_0x35e114<_0x538ef4[_0xa303('0x5c')]['length'];_0x35e114++){var _0x187de3=_0x538ef4['conditions'][_0x35e114];var _0x5939ea='i';var _0x4d7648=_['find'](_0x107cdc,[_0xa303('0x2d'),_0x187de3[_0xa303('0x46')]]);if(!_0x4d7648){switch(_0x187de3['field']){case _0xa303('0x5d'):if(_0x187de3[_0xa303('0x5e')]==0x1){_0x9240e1[_0xa303('0x5f')]('`'+_0x187de3[_0xa303('0x46')]+_0xa303('0x60'));}else{_0x9240e1['having']('`'+_0x187de3[_0xa303('0x46')]+_0xa303('0x61'));}break;case _0xa303('0x62'):if(_0x187de3[_0xa303('0x63')]===_0xa303('0x64')){if(_0x187de3['value']['split']('\x20')[_0xa303('0x65')]>0x1){_0x146b0c[_0x4c11b7](_0xa303('0x66'),qs[_0xa303('0x67')](_0x187de3[_0xa303('0x5e')]),null);}else{var _0x3fcabe='%'+_0x187de3[_0xa303('0x5e')]+'%';_0x146b0c[_0x4c11b7](_0xa303('0x68'),_0x3fcabe,_0x3fcabe,_0x3fcabe);}}else{_0x4d7648=_[_0xa303('0x69')](_0x107cdc,[_0xa303('0x2d'),'ContactId']);_0x187de3[_0xa303('0x46')]=_0xa303('0x6a');_0x41a38c=as[_0xa303('0x6b')](_0x5939ea,_0x4d7648[_0xa303('0x39')],_0x187de3);_0x146b0c[_0x4c11b7](_0x41a38c['text'],_0x41a38c['value'][_0xa303('0x6c')],_0x41a38c['value'][_0xa303('0x1e')]);}break;case _0xa303('0x6d'):var _0x5272d7=_0x187de3['value'][_0xa303('0x34')](',')[_0xa303('0x30')](function(_0x530c4a){return Number(_0x530c4a);});_0x5272d7['forEach'](function(_0x4a4cd8){_0x45d106['or'](_0xa303('0x6e'),'%,'+_0x4a4cd8+',%');});_0x335414=_[_0xa303('0x6f')](_0x335414,_0x5272d7);break;case _0xa303('0x70'):if(_0x187de3[_0xa303('0x63')]===_0xa303('0x64')){_0x146b0c[_0x4c11b7](_0xa303('0x71'),'%'+_0x187de3[_0xa303('0x5e')]+'%',null);}else{_0x4d7648=_[_0xa303('0x69')](_0x107cdc,[_0xa303('0x2d'),'UserId']);_0x187de3[_0xa303('0x46')]=_0xa303('0x72');_0x41a38c=as[_0xa303('0x6b')](_0x5939ea,_0x4d7648[_0xa303('0x39')],_0x187de3);_0x146b0c[_0x4c11b7](_0x41a38c[_0xa303('0x73')],_0x41a38c[_0xa303('0x5e')]['start'],_0x41a38c[_0xa303('0x5e')]['end']);}break;case'body':_0x41a38c=as[_0xa303('0x6b')]('me',null,_0x187de3);_0x146b0c[_0x4c11b7](_0x41a38c[_0xa303('0x73')],_0x41a38c['value'][_0xa303('0x6c')],_0x41a38c[_0xa303('0x5e')][_0xa303('0x1e')]);break;}}else{var _0x41a38c=as[_0xa303('0x6b')](_0x5939ea,_0x4d7648['type'],_0x187de3);_0x146b0c[_0x4c11b7](_0x41a38c['text'],_0x41a38c['value'][_0xa303('0x6c')],_0x41a38c[_0xa303('0x5e')][_0xa303('0x1e')]);}}}else{var _0x5b4e93=_(_0x3ad97e['query'])[_0xa303('0x3c')]()['map'](function(_0x4b15c8){return _['some'](_0x107cdc,['name',_0x4b15c8])?_0x4b15c8:undefined;})[_0xa303('0x74')]()[_0xa303('0x5e')]();if(!_[_0xa303('0x75')](_0x5b4e93)){_0x5b4e93[_0xa303('0x35')](function(_0x3008ae){if(_0x3008ae===_0xa303('0x76')){_0x9240e1[_0xa303('0x44')](_0xa303('0x77'),[]['concat'](_0x3ad97e[_0xa303('0x3b')][_0x3008ae]));}else if(_0x3008ae===_0xa303('0x78')){var _0x123d7f=JSON[_0xa303('0x79')](_0x3ad97e[_0xa303('0x3b')][_0x3008ae])[_0xa303('0x7a')];var _0x51a87d=JSON[_0xa303('0x79')](_0x3ad97e['query'][_0x3008ae])['$lte'];_0x9240e1[_0xa303('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x123d7f,_0x51a87d);}else{if(_0x3ad97e['query'][_0x3008ae]==='null'){_0x9240e1['where']('i.'+_0x3008ae+'\x20IS\x20NULL');}else{_0x9240e1[_0xa303('0x44')]('i.'+_0x3008ae+_0xa303('0x7b'),_0x3ad97e[_0xa303('0x3b')][_0x3008ae]);}}});}if(_0x3ad97e[_0xa303('0x3b')][_0xa303('0x7c')]){if(_0x3ad97e['query'][_0xa303('0x7c')]==0x1){_0x9240e1[_0xa303('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x9240e1['having'](_0xa303('0x7d'));}}if(_0x3ad97e[_0xa303('0x3b')][_0xa303('0x7e')]){_0x335414=_['isArray'](_0x3ad97e[_0xa303('0x3b')][_0xa303('0x7e')])?_0x3ad97e[_0xa303('0x3b')][_0xa303('0x7e')]:new Array(_0x3ad97e[_0xa303('0x3b')][_0xa303('0x7e')]);_0x335414[_0xa303('0x35')](function(_0x5c8feb){_0x45d106['or'](_0xa303('0x6e'),'%,'+_0x5c8feb+',%');});}if(_0x3ad97e[_0xa303('0x3b')][_0xa303('0x7f')]){var _0x3df1d3=_0x3ad97e['query'][_0xa303('0x7f')][_0xa303('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa303('0x81')](_0x3df1d3)){_0x146b0c['or'](_0xa303('0x82'),_0x3df1d3+'%')['or'](_0xa303('0x83'),_0x3df1d3+'%');}else{_0x146b0c['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa303('0x67')](_0x3df1d3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3df1d3+'%');}}}_0x9240e1[_0xa303('0x44')](_0x146b0c);_0x9240e1[_0xa303('0x84')](_0xa303('0x85'));var _0x36a7f4={'type':db[_0xa303('0x86')][_0xa303('0x87')][_0xa303('0x88')],'raw':!![]};var _0xd47cd1=_0x9240e1[_0xa303('0x89')]();_0xd47cd1[_0xa303('0x46')]('i.id');_0xd47cd1['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa303('0x5d'));if(_0x4f3c31['order']){_0x4f3c31[_0xa303('0x42')][_0xa303('0x35')](function(_0x4866bd){var _0x30e0d8=_0x4866bd[0x0]===_0xa303('0x8a')?_0x4866bd[0x0]:'i.'+_0x4866bd[0x0];_0x9240e1[_0xa303('0x42')](_0x30e0d8,_0x4866bd[0x1]===_0xa303('0x8b')?![]:!![]);});}if(!_[_0xa303('0x75')](_0x335414)){_0x9240e1[_0xa303('0x5f')](_0x45d106);_0xd47cd1[_0xa303('0x44')](_0xa303('0x8c'),_0x335414);}BPromise[_0xa303('0x8d')]()[_0xa303('0x29')](function(){if(!_0x538ef4){if(_0x3ad97e[_0xa303('0x3b')][_0xa303('0x76')])return;_0xd47cd1[_0xa303('0x44')](_0xa303('0x8e'));_0x9240e1[_0xa303('0x44')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3ad97e[_0xa303('0x8f')][_0xa303('0x90')]!=='agent')return;return _0x3ad97e[_0xa303('0x8f')][_0xa303('0x91')]({'attributes':['id'],'raw':!![]})[_0xa303('0x29')](function(_0x1e5df5){if(_['isEmpty'](_0x1e5df5)){_0xd47cd1[_0xa303('0x44')]('i.WhatsappAccountId\x20IS\x20NULL');_0x9240e1[_0xa303('0x44')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0xd47cd1[_0xa303('0x44')]('i.WhatsappAccountId\x20IN\x20?',_[_0xa303('0x30')](_0x1e5df5,'id'));_0x9240e1['where']('i.WhatsappAccountId\x20IN\x20?',_[_0xa303('0x30')](_0x1e5df5,'id'));}});})['then'](function(){if(_0x3ad97e[_0xa303('0x8f')][_0xa303('0x90')]===_0xa303('0x92')&&!_0x538ef4&&!_0x3ad97e[_0xa303('0x3b')][_0xa303('0x76')])return[];return db[_0xa303('0x93')][_0xa303('0x3b')](_0xd47cd1[_0xa303('0x94')](),_0x36a7f4);})['then'](function(_0x5bc430){_0x23c318[_0xa303('0x95')]=_0x5bc430[_0xa303('0x65')];if(_0x23c318[_0xa303('0x95')]===0x0)return[];return db[_0xa303('0x93')][_0xa303('0x3b')](_0x564d59[_0xa303('0x94')](),_0x36a7f4)[_0xa303('0x29')](function(_0x463164){_0x839adf=_['keyBy'](_0x463164,'id');_0x36a7f4=_['merge'](_0x36a7f4,{'model':db[_0xa303('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ad97e[_0xa303('0x3b')][_0xa303('0x40')]){_0x4f3c31[_0xa303('0x3f')]['forEach'](function(_0x48e08b){_0x9240e1[_0xa303('0x46')]('i.'+_0x48e08b);});}else{_0x9240e1[_0xa303('0x46')](_0xa303('0x97'),'unreadMessages');_0x9240e1['field']('a.key',_0xa303('0x98'));_0x9240e1[_0xa303('0x46')](_0xa303('0x99'),_0xa303('0x9a'));_0x9240e1[_0xa303('0x46')](_0xa303('0x9b'),'contactName');_0x9240e1[_0xa303('0x46')](_0xa303('0x9c'));_0x9240e1[_0xa303('0x46')]('c.firstName',_0xa303('0x9d'));_0x9240e1['field'](_0xa303('0x9e'),_0xa303('0x9f'));_0x9240e1[_0xa303('0x46')](_0xa303('0xa0'),_0xa303('0xa1'));_0x9240e1[_0xa303('0x46')](_0xa303('0xa2'),_0xa303('0xa3'));_0x9240e1[_0xa303('0x46')](_0xa303('0xa4'),_0xa303('0xa5'));_0x9240e1[_0xa303('0x46')](_0xa303('0xa6'),_0xa303('0xa7'));_0x9240e1[_0xa303('0x46')](_0xa303('0xa8'),_0xa303('0xa9'));_0x9240e1['field'](_0xa303('0xaa'),_0xa303('0xab'));_0x9240e1[_0xa303('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa303('0x32'));}if(_0x4f3c31['limit'])_0x9240e1[_0xa303('0x20')](_0x4f3c31[_0xa303('0x20')]);if(_0x4f3c31[_0xa303('0x1f')])_0x9240e1['offset'](_0x4f3c31['offset']);return db[_0xa303('0x93')]['query'](_0x9240e1[_0xa303('0x94')](),_0x36a7f4);})[_0xa303('0x29')](function(_0xe21cab){if(_0xe21cab[_0xa303('0x65')]>0x0)_0x1040f5[_0xa303('0x44')](_0xa303('0xac'),_[_0xa303('0x30')](_0xe21cab,'id'));return db['sequelize'][_0xa303('0x3b')](_0x1040f5[_0xa303('0x94')](),_0x36a7f4)['then'](function(_0x3da651){var _0x1074e3=_[_0xa303('0xad')](_0x3da651,'WhatsappInteractionId');var _0x26ab63=[];_0xe21cab[_0xa303('0x35')](function(_0x3ece9c){_0x26ab63[_0xa303('0xae')](updateWhatsappInteraction(_0x3ece9c,_0x839adf,_0x1074e3));});return BPromise['all'](_0x26ab63);});});})[_0xa303('0x29')](function(_0xbdaedc){_0x23c318[_0xa303('0xaf')]=_0xbdaedc;return _0x23c318;})[_0xa303('0x29')](respondWithFilteredResult(_0x6ec021,_0x4f3c31))[_0xa303('0xb0')](handleError(_0x6ec021,null));};exports[_0xa303('0xb1')]=function(_0x32ba1d,_0x450e79){var _0x5c91a1={'raw':![],'where':{'id':_0x32ba1d[_0xa303('0xb2')]['id']}},_0x6ad01={};_0x6ad01[_0xa303('0x3e')]=_[_0xa303('0x3c')](db[_0xa303('0x96')]['rawAttributes']);_0x6ad01['query']=_[_0xa303('0x3c')](_0x32ba1d['query']);_0x6ad01[_0xa303('0xb3')]=_[_0xa303('0x3d')](_0x6ad01[_0xa303('0x3e')],_0x6ad01[_0xa303('0x3b')]);_0x5c91a1[_0xa303('0x3f')]=_[_0xa303('0x3d')](_0x6ad01[_0xa303('0x3e')],qs[_0xa303('0x40')](_0x32ba1d[_0xa303('0x3b')][_0xa303('0x40')]));_0x5c91a1['attributes']=_0x5c91a1['attributes'][_0xa303('0x65')]?_0x5c91a1[_0xa303('0x3f')]:_0x6ad01[_0xa303('0x3e')];if(_0x32ba1d[_0xa303('0x3b')]['includeAll']){_0x5c91a1['include']=[{'all':!![]}];}_0x5c91a1=_['merge']({},_0x5c91a1,_0x32ba1d[_0xa303('0xb4')]);return db[_0xa303('0x96')][_0xa303('0x69')](_0x5c91a1)[_0xa303('0x29')](handleEntityNotFound(_0x450e79,null))[_0xa303('0x29')](respondWithResult(_0x450e79,null))['catch'](handleError(_0x450e79,null));};exports['create']=function(_0x1ea0c4,_0x45f5ef){return db[_0xa303('0x96')][_0xa303('0xb5')](_0x1ea0c4[_0xa303('0xb6')],{})['then'](respondWithResult(_0x45f5ef,0xc9))[_0xa303('0xb0')](handleError(_0x45f5ef,null));};exports[_0xa303('0x27')]=function(_0x5a8446,_0xc9b121){if(_0x5a8446[_0xa303('0xb6')]['id']){delete _0x5a8446[_0xa303('0xb6')]['id'];}return db[_0xa303('0x96')][_0xa303('0x69')]({'where':{'id':_0x5a8446[_0xa303('0xb2')]['id']}})[_0xa303('0x29')](handleEntityNotFound(_0xc9b121,null))[_0xa303('0x29')](saveUpdates(_0x5a8446['body'],null))[_0xa303('0x29')](respondWithResult(_0xc9b121,null))['catch'](handleError(_0xc9b121,null));};exports['destroy']=function(_0x25c67b,_0x127252){return db[_0xa303('0x96')][_0xa303('0x69')]({'where':{'id':_0x25c67b[_0xa303('0xb2')]['id']}})[_0xa303('0x29')](handleEntityNotFound(_0x127252,null))[_0xa303('0x29')](removeEntity(_0x127252,null))['catch'](handleError(_0x127252,null));};exports[_0xa303('0xb7')]=function(_0x2df713,_0x1d1140){return db[_0xa303('0x96')][_0xa303('0xb7')]()[_0xa303('0x29')](respondWithResult(_0x1d1140,null))[_0xa303('0xb0')](handleError(_0x1d1140,null));};exports[_0xa303('0xb8')]=function(_0x38e513,_0x70d45,_0x3410e9){return db[_0xa303('0xb9')][_0xa303('0x69')]({'where':{'id':_0x38e513[_0xa303('0xb2')]['id']}})['then'](handleEntityNotFound(_0x70d45,null))[_0xa303('0x29')](function(_0x1bf0b6){if(_0x1bf0b6){return _0x1bf0b6[_0xa303('0xb8')](_0x38e513['body']['ids'],_['omit'](_0x38e513['body'],['ids','id'])||{});}})[_0xa303('0x29')](respondWithResult(_0x70d45,null))[_0xa303('0xb0')](handleError(_0x70d45,null));};exports[_0xa303('0xba')]=function(_0x1350f4,_0x7345b4,_0x2635b7){var _0x4e119={'raw':![],'where':{}};var _0x55ccf4={};var _0x4abf9b={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x1350f4[_0xa303('0xb2')]['id']}})[_0xa303('0x29')](handleEntityNotFound(_0x7345b4,null))['then'](function(_0x7ab564){if(_0x7ab564){_0x55ccf4[_0xa303('0x3e')]=_[_0xa303('0x3c')](db[_0xa303('0xb9')]['rawAttributes']);_0x55ccf4['query']=_[_0xa303('0x3c')](_0x1350f4[_0xa303('0x3b')]);_0x55ccf4[_0xa303('0xb3')]=_[_0xa303('0x3d')](_0x55ccf4[_0xa303('0x3e')],_0x55ccf4[_0xa303('0x3b')]);_0x4e119[_0xa303('0x3f')]=_[_0xa303('0x3d')](_0x55ccf4[_0xa303('0x3e')],qs[_0xa303('0x40')](_0x1350f4[_0xa303('0x3b')]['fields']));_0x4e119[_0xa303('0x3f')]=_0x4e119[_0xa303('0x3f')][_0xa303('0x65')]?_0x4e119[_0xa303('0x3f')]:_0x55ccf4[_0xa303('0x3e')];if(!_0x1350f4[_0xa303('0x3b')][_0xa303('0x41')](_0xa303('0xbb'))){_0x4e119[_0xa303('0x20')]=qs[_0xa303('0x20')](_0x1350f4[_0xa303('0x3b')][_0xa303('0x20')]);_0x4e119[_0xa303('0x1f')]=qs['offset'](_0x1350f4[_0xa303('0x3b')][_0xa303('0x1f')]);}_0x4e119['order']=qs[_0xa303('0x43')](_0x1350f4['query'][_0xa303('0x43')]);_0x4e119['where']=qs[_0xa303('0xb3')](_[_0xa303('0xbc')](_0x1350f4['query'],_0x55ccf4['filters']));_0x4e119[_0xa303('0x44')][_0xa303('0xbd')]=_0x7ab564['id'];if(_0x1350f4[_0xa303('0x3b')][_0xa303('0x7f')]){_0x4e119['where']=_['merge'](_0x4e119[_0xa303('0x44')],{'$or':_[_0xa303('0x30')](_0x4e119[_0xa303('0x3f')],function(_0x11c13b){var _0x44fd10={};_0x44fd10[_0x11c13b]={'$like':'%'+_0x1350f4[_0xa303('0x3b')][_0xa303('0x7f')]+'%'};return _0x44fd10;})});}if(_0x1350f4[_0xa303('0x3b')][_0xa303('0x7a')]){var _0x310017=_0x1350f4[_0xa303('0x3b')][_0xa303('0x7a')][_0xa303('0x34')](',');var _0xd27a={};_0xd27a[_0x310017[0x0]]={'$gte':moment(_0x310017[0x1])[_0xa303('0xbe')](_0xa303('0xbf'))};_0x4e119[_0xa303('0x44')]=_[_0xa303('0xc0')](_0x4e119[_0xa303('0x44')],_0xd27a);}_0x4e119=_['merge']({},_0x4e119,_0x1350f4[_0xa303('0xb4')]);return db[_0xa303('0xb9')]['count']({'where':_0x4e119['where']})['then'](function(_0x36d9d4){_0x4abf9b[_0xa303('0x95')]=_0x36d9d4;if(_0x1350f4[_0xa303('0x3b')][_0xa303('0xc1')]){_0x4e119[_0xa303('0xc2')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4e119);})[_0xa303('0x29')](function(_0x5eb540){_0x4abf9b['rows']=_0x5eb540;return _0x4abf9b;});}})[_0xa303('0x29')](respondWithFilteredResult(_0x7345b4,_0x4e119))[_0xa303('0xb0')](handleError(_0x7345b4,null));};exports[_0xa303('0xc3')]=function(_0x22ddac,_0x54fe2a,_0x4d3c3a){return db[_0xa303('0x96')][_0xa303('0x69')]({'where':{'id':_0x22ddac[_0xa303('0xb2')]['id']}})[_0xa303('0x29')](handleEntityNotFound(_0x54fe2a,null))['then'](function(_0x4ef2f2){if(_0x4ef2f2){return _0x4ef2f2['setTags'](_0x22ddac[_0xa303('0xb6')][_0xa303('0xc4')],_[_0xa303('0xc5')](_0x22ddac[_0xa303('0xb6')],[_0xa303('0xc4'),'id'])||{})[_0xa303('0xc6')](function(){return db[_0xa303('0x6d')]['findAll']({'attributes':['id',_0xa303('0x2d'),'color'],'where':{'id':_0x22ddac['body'][_0xa303('0xc4')]}});})[_0xa303('0x29')](function(_0x3d6dd0){socket[_0xa303('0xc7')](_0xa303('0xc8'),{'id':Number(_0x22ddac['params']['id']),'tags':_0x3d6dd0||[]});return{'id':Number(_0x22ddac[_0xa303('0xb2')]['id']),'tags':_0x3d6dd0||[]};});}})[_0xa303('0x29')](respondWithResult(_0x54fe2a,null))[_0xa303('0xb0')](handleError(_0x54fe2a,null));};exports[_0xa303('0xc9')]=function(_0x236040,_0x34e5f4,_0x4ab40a){return db[_0xa303('0x96')][_0xa303('0x69')]({'where':{'id':_0x236040[_0xa303('0xb2')]['id']}})[_0xa303('0x29')](handleEntityNotFound(_0x34e5f4,null))[_0xa303('0x29')](function(_0x151d16){if(_0x151d16){return _0x151d16[_0xa303('0xc9')](_0x236040[_0xa303('0x3b')][_0xa303('0xc4')]);}})[_0xa303('0x29')](respondWithStatusCode(_0x34e5f4,null))[_0xa303('0xb0')](handleError(_0x34e5f4,null));};exports['download']=function(_0x290c70,_0x321781){var _0x192b74=moment()['unix']()[_0xa303('0x94')]();var _0x543ff3=path[_0xa303('0xca')](config[_0xa303('0xcb')],'server',_0xa303('0xcc'),_0xa303('0xcd'));var _0x21cfe7=path[_0xa303('0xca')](config[_0xa303('0xcb')],'server',_0xa303('0xcc'),_0xa303('0xce'));var _0x56a8da=path['join'](_0x543ff3,_0x192b74);var _0x39b288=util['format'](_0xa303('0xcf'),_0x290c70[_0xa303('0xb2')]['id'],_0x192b74);var _0x5576d6=path[_0xa303('0xca')](_0x543ff3,_0x39b288);var _0x2c942a=[];_0x2c942a[_0xa303('0xae')]({'model':db['User'],'as':_0xa303('0x70'),'attributes':['id',_0xa303('0x31')],'raw':!![]});_0x2c942a[_0xa303('0xae')]({'model':db['CmContact'],'as':_0xa303('0x62'),'attributes':['id',_0xa303('0xd0'),_0xa303('0xd1')],'raw':!![]});if(_0x290c70[_0xa303('0x3b')]['attachments']){_0x2c942a[_0xa303('0xae')]({'model':db[_0xa303('0xd2')],'as':'Attachment','raw':!![]});}var _0x3a3df1=[{'model':db[_0xa303('0xb9')],'as':'Messages','attributes':['id',_0xa303('0xb6'),_0xa303('0x78'),'direction',_0xa303('0xd3'),_0xa303('0x7c')],'include':_0x2c942a}];_0x3a3df1[_0xa303('0xae')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xa303('0x2d')]});_0x3a3df1[_0xa303('0xae')]({'model':db['User'],'as':_0xa303('0xd4'),'attributes':['id',_0xa303('0x31')]});return db[_0xa303('0x96')][_0xa303('0x69')]({'where':{'id':_0x290c70[_0xa303('0xb2')]['id']},'include':_0x3a3df1})['then'](handleEntityNotFound(_0x321781,null))[_0xa303('0x29')](function(_0x26a325){if(_0x26a325){var _0xbe9bb0=_0x26a325[_0xa303('0xd5')]({'plain':!![]});fs[_0xa303('0xd6')](_0x56a8da);var _0x1fc47e={'channel':_0xa303('0xd7'),'account':_0xbe9bb0['Account'][_0xa303('0x2d')],'agent':_0xbe9bb0[_0xa303('0xd4')]?_0xbe9bb0[_0xa303('0xd4')]['fullname']:'N.A.','createdAt':moment(_0xbe9bb0[_0xa303('0x78')])[_0xa303('0xbe')](_0xa303('0xbf'))[_0xa303('0x94')](),'closedAt':_0xbe9bb0[_0xa303('0xd8')]?moment(_0xbe9bb0['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa303('0x94')]():'','disposition':_0xbe9bb0[_0xa303('0xd9')],'messages':_(_0xbe9bb0['Messages'])[_0xa303('0x7f')]({'secret':![]})[_0xa303('0x30')](function(_0x1e02de){if(_0x1e02de['Attachment']){var _0x147183=path[_0xa303('0xca')](_0x21cfe7,_0x1e02de[_0xa303('0xd2')][_0xa303('0xda')]);if(fs['existsSync'](_0x147183)){fs[_0xa303('0xdb')](_0x147183)[_0xa303('0xdc')](fs[_0xa303('0xdd')](path[_0xa303('0xca')](_0x56a8da,_0x1e02de[_0xa303('0xd2')][_0xa303('0xda')])));}}return{'date':moment(_0x1e02de[_0xa303('0x78')])['format'](_0xa303('0xbf'))[_0xa303('0x94')](),'sender':_0x1e02de[_0xa303('0xde')]===_0xa303('0xdf')?_0x1e02de[_0xa303('0x70')]?_0x1e02de[_0xa303('0x70')]['fullname']:'System':_0x1e02de[_0xa303('0x62')]['firstName']+(_0x1e02de[_0xa303('0x62')]['lastName']?'\x20'+_0x1e02de[_0xa303('0x62')][_0xa303('0xd1')]:''),'body':_0x1e02de[_0xa303('0xd2')]?_0x1e02de['Attachment']['basename']:_0x1e02de['body'],'direction':_0x1e02de[_0xa303('0xde')]===_0xa303('0xdf')?'A':'C','secret':_0x1e02de[_0xa303('0xd3')],'read':_0x1e02de[_0xa303('0x7c')],'attachment':_0x1e02de[_0xa303('0xd2')]};})[_0xa303('0x5e')]()};return ejs['renderFile'](path[_0xa303('0xca')](config['root'],_0xa303('0xe0'),'views',_0xa303('0xe1')),{'interaction':_0x1fc47e})[_0xa303('0x29')](function(_0x5588a0){var _0x20d2f9=path[_0xa303('0xca')](_0x56a8da,_0xa303('0xe2')+_0xbe9bb0['id']+'-'+_0x192b74+'.pdf');var _0x22c7af={'path':_0x20d2f9,'channel':'Whatsapp','interactionId':_0xbe9bb0['id']};return pdf[_0xa303('0xe3')](_0x5588a0,_0x22c7af);})[_0xa303('0x29')](function(){return new BPromise(function(_0x991862,_0x52ecbd){zipdir(_0x56a8da,{'saveTo':_0x5576d6},function(_0x1ed414,_0x4114c8){if(_0x1ed414)return _0x52ecbd(_0x1ed414);return _0x991862(_0x4114c8);});})['then'](function(){return new BPromise(function(_0x3ca88b,_0x1e540c){rimraf(_0x56a8da,function(_0x466c5a){if(_0x466c5a)_0x1e540c(_0x466c5a);return _0x3ca88b();});});})['then'](function(){return _0x321781['download'](_0x5576d6,_0x39b288,function(_0x88ba33){if(_0x88ba33){console[_0xa303('0xe4')]('err',_0x88ba33);}else{fs[_0xa303('0xe5')](_0x5576d6);}});});});}else{return _0x321781['sendStatus'](0xc8);}})[_0xa303('0xb0')](handleError(_0x321781,null));};
\ No newline at end of file
+var _0x8d37=['TagIds','forEach','Tags','push','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','u.id','u.fullname','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','parse','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','unreadMessages','Account.key','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','catch','show','params','includeAll','include','options','create','update','describe','addMessage','WhatsappMessage','ids','omit','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','spread','Tag','whatsappInteractionTags:save','removeTags','download','root','files','tmp','attachments','join','transcript-%d-%s.zip','CmContact','firstName','Messages','createdAt','WhatsappAccount','Owner','Whatsapp','Account','N.A.','closed','closedAt','Attachment','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','lastName','secret','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','Users','map','fullname'];(function(_0x1b4595,_0x33c597){var _0x7569b5=function(_0x41ce6e){while(--_0x41ce6e){_0x1b4595['push'](_0x1b4595['shift']());}};_0x7569b5(++_0x33c597);}(_0x8d37,0xbc));var _0x78d3=function(_0x2885eb,_0x39e93a){_0x2885eb=_0x2885eb-0x0;var _0x9fc223=_0x8d37[_0x2885eb];return _0x9fc223;};'use strict';var emlformat=require(_0x78d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78d3('0x1'));var jsonpatch=require(_0x78d3('0x2'));var rp=require(_0x78d3('0x3'));var moment=require(_0x78d3('0x4'));var BPromise=require(_0x78d3('0x5'));var Mustache=require(_0x78d3('0x6'));var util=require(_0x78d3('0x7'));var path=require('path');var sox=require(_0x78d3('0x8'));var csv=require(_0x78d3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78d3('0xa'));var _=require(_0x78d3('0xb'));var squel=require('squel');var crypto=require(_0x78d3('0xc'));var jsforce=require(_0x78d3('0xd'));var deskjs=require(_0x78d3('0xe'));var toCsv=require(_0x78d3('0x9'));var querystring=require(_0x78d3('0xf'));var Papa=require(_0x78d3('0x10'));var Redis=require('ioredis');var authService=require(_0x78d3('0x11'));var qs=require(_0x78d3('0x12'));var as=require(_0x78d3('0x13'));var pdf=require(_0x78d3('0x14'));var hardwareService=require(_0x78d3('0x15'));var logger=require('../../config/logger')(_0x78d3('0x16'));var utils=require(_0x78d3('0x17'));var config=require(_0x78d3('0x18'));var licenseUtil=require(_0x78d3('0x19'));var db=require(_0x78d3('0x1a'))['db'];config[_0x78d3('0x1b')]=_[_0x78d3('0x1c')](config['redis'],{'host':_0x78d3('0x1d'),'port':0x18eb});var socket=require(_0x78d3('0x1e'))(new Redis(config[_0x78d3('0x1b')]));require('./whatsappInteraction.socket')[_0x78d3('0x1f')](socket);function respondWithStatusCode(_0x4c3a49,_0x318289){_0x318289=_0x318289||0xcc;return function(_0x5a723f){if(_0x5a723f){return _0x4c3a49[_0x78d3('0x20')](_0x318289);}return _0x4c3a49['status'](_0x318289)[_0x78d3('0x21')]();};}function respondWithResult(_0x37aec9,_0x58a812){_0x58a812=_0x58a812||0xc8;return function(_0x55608f){if(_0x55608f){return _0x37aec9[_0x78d3('0x22')](_0x58a812)[_0x78d3('0x23')](_0x55608f);}};}function respondWithFilteredResult(_0x46473d,_0x481766){return function(_0x55e489){if(_0x55e489){var _0x4110c6=typeof _0x481766['offset']==='undefined'&&typeof _0x481766['limit']===_0x78d3('0x24');var _0x13c0f0=_0x55e489[_0x78d3('0x25')];var _0x47cad5=_0x4110c6?0x0:_0x481766[_0x78d3('0x26')];var _0x131b3d=_0x4110c6?_0x55e489['count']:_0x481766[_0x78d3('0x26')]+_0x481766[_0x78d3('0x27')];var _0x8ee967;if(_0x131b3d>=_0x13c0f0){_0x131b3d=_0x13c0f0;_0x8ee967=0xc8;}else{_0x8ee967=0xce;}_0x46473d[_0x78d3('0x22')](_0x8ee967);return _0x46473d[_0x78d3('0x28')](_0x78d3('0x29'),_0x47cad5+'-'+_0x131b3d+'/'+_0x13c0f0)[_0x78d3('0x23')](_0x55e489);}return null;};}function patchUpdates(_0x15e16d){return function(_0x319b02){try{jsonpatch[_0x78d3('0x2a')](_0x319b02,_0x15e16d,!![]);}catch(_0x55c490){return BPromise[_0x78d3('0x2b')](_0x55c490);}return _0x319b02['save']();};}function saveUpdates(_0x3def20,_0xbfe530){return function(_0x4ab8be){if(_0x4ab8be){return _0x4ab8be['update'](_0x3def20)['then'](function(_0x213c35){return _0x213c35;});}return null;};}function removeEntity(_0x577d87,_0x4cdcf1){return function(_0x1aa479){if(_0x1aa479){return _0x1aa479[_0x78d3('0x2c')]()[_0x78d3('0x2d')](function(){_0x577d87[_0x78d3('0x22')](0xcc)[_0x78d3('0x21')]();});}};}function handleEntityNotFound(_0x5c0507,_0xfa0a51){return function(_0x2f442f){if(!_0x2f442f){_0x5c0507[_0x78d3('0x20')](0x194);}return _0x2f442f;};}function handleError(_0x3adcdb,_0x18dcd4){_0x18dcd4=_0x18dcd4||0x1f4;return function(_0x4300ea){logger[_0x78d3('0x2e')](_0x4300ea[_0x78d3('0x2f')]);if(_0x4300ea[_0x78d3('0x30')]){delete _0x4300ea[_0x78d3('0x30')];}_0x3adcdb[_0x78d3('0x22')](_0x18dcd4)[_0x78d3('0x31')](_0x4300ea);};}function getInteractionUsers(_0x29f3cc,_0xfee079){return new BPromise(function(_0x5314c0,_0x245edd){try{if(_0xfee079[_0x29f3cc['id']]){_0x29f3cc[_0x78d3('0x32')]=_[_0x78d3('0x33')](_0xfee079[_0x29f3cc['id']],function(_0x1113cb){return{'id':_0x1113cb['id'],'fullname':_0x1113cb[_0x78d3('0x34')]};});}}catch(_0x663f58){_0x245edd(_0x663f58);}_0x5314c0(_0x29f3cc);});}function getInteractionTags(_0x227574,_0x569cc6){return new BPromise(function(_0x384607,_0x28a2fa){try{if(_0x227574[_0x78d3('0x35')]){_0x227574['Tags']=[];_0x227574[_0x78d3('0x35')]['split'](',')[_0x78d3('0x36')](function(_0x41ed36){_0x227574[_0x78d3('0x37')][_0x78d3('0x38')](_0x569cc6[_0x41ed36]);});}delete _0x227574['TagIds'];}catch(_0x207117){_0x28a2fa(_0x207117);}_0x384607(_0x227574);});}function updateWhatsappInteraction(_0x478ddc,_0x1e4611,_0x565c18){return new BPromise(function(_0x57ca0e,_0x1a1a45){return getInteractionUsers(_0x478ddc,_0x565c18)[_0x78d3('0x2d')](function(_0x48812c){return getInteractionTags(_0x48812c,_0x1e4611);})['then'](function(_0x6129b){_0x57ca0e(_0x6129b);})['catch'](function(_0x2a79f7){_0x1a1a45(_0x2a79f7);});});}exports['index']=function(_0x180033,_0xccd183){var _0x41add5={},_0x4dc8b2={},_0x96e7f4={'count':0x0,'rows':[]};var _0x88ae51=_[_0x78d3('0x33')](db[_0x78d3('0x39')][_0x78d3('0x3a')],function(_0x3c78c9){return{'name':_0x3c78c9[_0x78d3('0x3b')],'type':_0x3c78c9[_0x78d3('0x3c')][_0x78d3('0x3d')]};});_0x4dc8b2[_0x78d3('0x3e')]=_['map'](_0x88ae51,'name');_0x4dc8b2[_0x78d3('0x3f')]=_[_0x78d3('0x40')](_0x180033[_0x78d3('0x3f')]);_0x4dc8b2[_0x78d3('0x41')]=_[_0x78d3('0x42')](_0x4dc8b2['model'],_0x4dc8b2[_0x78d3('0x3f')]);_0x41add5[_0x78d3('0x43')]=_[_0x78d3('0x42')](_0x4dc8b2[_0x78d3('0x3e')],qs[_0x78d3('0x44')](_0x180033[_0x78d3('0x3f')]['fields']));_0x41add5['attributes']=_0x41add5[_0x78d3('0x43')][_0x78d3('0x45')]?_0x41add5[_0x78d3('0x43')]:_0x4dc8b2[_0x78d3('0x3e')];if(!_0x180033[_0x78d3('0x3f')][_0x78d3('0x46')](_0x78d3('0x47'))){_0x41add5['limit']=qs[_0x78d3('0x27')](_0x180033['query']['limit']);_0x41add5[_0x78d3('0x26')]=qs[_0x78d3('0x26')](_0x180033[_0x78d3('0x3f')][_0x78d3('0x26')]);}_0x41add5['order']=qs[_0x78d3('0x48')](_0x180033[_0x78d3('0x3f')]['sort']);_0x41add5['where']=qs['filters'](_[_0x78d3('0x49')](_0x180033['query'],_0x4dc8b2[_0x78d3('0x41')]),_0x88ae51);var _0x16004e=[];var _0x2e8669=squel[_0x78d3('0x4a')]()[_0x78d3('0x4b')]('id')[_0x78d3('0x4b')](_0x78d3('0x30'))[_0x78d3('0x4b')](_0x78d3('0x4c'))[_0x78d3('0x4d')]('tools_tags');var _0x3bc56e=squel[_0x78d3('0x4a')]()[_0x78d3('0x4b')](_0x78d3('0x4e'))[_0x78d3('0x4b')](_0x78d3('0x4f'))[_0x78d3('0x4b')]('ui.WhatsappInteractionId')[_0x78d3('0x4d')](_0x78d3('0x50'),'ui')[_0x78d3('0x51')](_0x78d3('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x1b4041=squel['select']()[_0x78d3('0x4d')](_0x78d3('0x53'),'i')[_0x78d3('0x51')]('cm_contacts','c',_0x78d3('0x54'))['left_join'](_0x78d3('0x52'),'o',_0x78d3('0x55'))[_0x78d3('0x51')](_0x78d3('0x56'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x78d3('0x51')](_0x78d3('0x57'),'me',_0x78d3('0x58'))[_0x78d3('0x51')](_0x78d3('0x59'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x78d3('0x51')](_0x78d3('0x5a'),'t',_0x78d3('0x5b'));var _0x472aaf=squel[_0x78d3('0x5c')]();var _0x38ca37=[];var _0xd4bace=squel[_0x78d3('0x5c')]();var _0x45882b;if(_0x180033[_0x78d3('0x3f')][_0x78d3('0x5d')]){_0x45882b=as[_0x78d3('0x5e')](_0x180033['query'][_0x78d3('0x5d')]);var _0x2d77a4=_0x45882b[_0x78d3('0x5f')];for(var _0x4155e5=0x0;_0x4155e5<_0x45882b[_0x78d3('0x60')][_0x78d3('0x45')];_0x4155e5++){var _0x35314f=_0x45882b['conditions'][_0x4155e5];var _0x14d714='i';var _0x18da11=_[_0x78d3('0x61')](_0x88ae51,[_0x78d3('0x30'),_0x35314f[_0x78d3('0x4b')]]);if(!_0x18da11){switch(_0x35314f[_0x78d3('0x4b')]){case'unreadMessages':if(_0x35314f[_0x78d3('0x62')]==0x1){_0x1b4041[_0x78d3('0x63')]('`'+_0x35314f['field']+'`\x20=\x200');}else{_0x1b4041[_0x78d3('0x63')]('`'+_0x35314f['field']+_0x78d3('0x64'));}break;case _0x78d3('0x65'):if(_0x35314f[_0x78d3('0x66')]==='$substring'){if(_0x35314f[_0x78d3('0x62')][_0x78d3('0x67')]('\x20')[_0x78d3('0x45')]>0x1){_0x472aaf[_0x2d77a4](_0x78d3('0x68'),qs[_0x78d3('0x69')](_0x35314f[_0x78d3('0x62')]),null);}else{var _0x55f529='%'+_0x35314f[_0x78d3('0x62')]+'%';_0x472aaf[_0x2d77a4](_0x78d3('0x6a'),_0x55f529,_0x55f529,_0x55f529);}}else{_0x18da11=_['find'](_0x88ae51,['name',_0x78d3('0x6b')]);_0x35314f[_0x78d3('0x4b')]=_0x78d3('0x6b');_0x2ea03b=as[_0x78d3('0x6c')](_0x14d714,_0x18da11['type'],_0x35314f);_0x472aaf[_0x2d77a4](_0x2ea03b[_0x78d3('0x6d')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x6e')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x21')]);}break;case'Tag':var _0x38109a=_0x35314f[_0x78d3('0x62')][_0x78d3('0x67')](',')[_0x78d3('0x33')](function(_0x863e4c){return Number(_0x863e4c);});_0x38109a[_0x78d3('0x36')](function(_0x1830fb){_0xd4bace['or'](_0x78d3('0x6f'),'%,'+_0x1830fb+',%');});_0x38ca37=_[_0x78d3('0x70')](_0x38ca37,_0x38109a);break;case _0x78d3('0x71'):if(_0x35314f['operator']===_0x78d3('0x72')){_0x472aaf[_0x2d77a4](_0x78d3('0x73'),'%'+_0x35314f[_0x78d3('0x62')]+'%',null);}else{_0x18da11=_[_0x78d3('0x61')](_0x88ae51,[_0x78d3('0x30'),_0x78d3('0x74')]);_0x35314f[_0x78d3('0x4b')]='UserId';_0x2ea03b=as['buildExpression'](_0x14d714,_0x18da11[_0x78d3('0x3c')],_0x35314f);_0x472aaf[_0x2d77a4](_0x2ea03b[_0x78d3('0x6d')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x6e')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x21')]);}break;case _0x78d3('0x75'):_0x2ea03b=as[_0x78d3('0x6c')]('me',null,_0x35314f);_0x472aaf[_0x2d77a4](_0x2ea03b[_0x78d3('0x6d')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x6e')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x21')]);break;}}else{var _0x2ea03b=as['buildExpression'](_0x14d714,_0x18da11[_0x78d3('0x3c')],_0x35314f);_0x472aaf[_0x2d77a4](_0x2ea03b[_0x78d3('0x6d')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x6e')],_0x2ea03b[_0x78d3('0x62')][_0x78d3('0x21')]);}}}else{var _0x11c9c6=_(_0x180033[_0x78d3('0x3f')])[_0x78d3('0x40')]()[_0x78d3('0x33')](function(_0x1b6907){return _[_0x78d3('0x76')](_0x88ae51,[_0x78d3('0x30'),_0x1b6907])?_0x1b6907:undefined;})[_0x78d3('0x77')]()['value']();if(!_[_0x78d3('0x78')](_0x11c9c6)){_0x11c9c6[_0x78d3('0x36')](function(_0xb7a828){if(_0xb7a828===_0x78d3('0x79')){_0x1b4041[_0x78d3('0x7a')](_0x78d3('0x7b'),[][_0x78d3('0x7c')](_0x180033['query'][_0xb7a828]));}else if(_0xb7a828==='createdAt'){var _0x231543=JSON[_0x78d3('0x7d')](_0x180033[_0x78d3('0x3f')][_0xb7a828])['$gte'];var _0x4cceae=JSON[_0x78d3('0x7d')](_0x180033[_0x78d3('0x3f')][_0xb7a828])[_0x78d3('0x7e')];_0x1b4041['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x231543,_0x4cceae);}else{if(_0x180033[_0x78d3('0x3f')][_0xb7a828]===_0x78d3('0x7f')){_0x1b4041[_0x78d3('0x7a')]('i.'+_0xb7a828+'\x20IS\x20NULL');}else{_0x1b4041[_0x78d3('0x7a')]('i.'+_0xb7a828+_0x78d3('0x80'),_0x180033[_0x78d3('0x3f')][_0xb7a828]);}}});}if(_0x180033['query'][_0x78d3('0x81')]){if(_0x180033[_0x78d3('0x3f')]['read']==0x1){_0x1b4041[_0x78d3('0x63')](_0x78d3('0x82'));}else{_0x1b4041[_0x78d3('0x63')](_0x78d3('0x83'));}}if(_0x180033[_0x78d3('0x3f')][_0x78d3('0x84')]){_0x38ca37=_[_0x78d3('0x85')](_0x180033[_0x78d3('0x3f')][_0x78d3('0x84')])?_0x180033['query'][_0x78d3('0x84')]:new Array(_0x180033[_0x78d3('0x3f')]['tag']);_0x38ca37[_0x78d3('0x36')](function(_0x245f11){_0xd4bace['or'](_0x78d3('0x6f'),'%,'+_0x245f11+',%');});}if(_0x180033[_0x78d3('0x3f')][_0x78d3('0x86')]){var _0x46a589=_0x180033[_0x78d3('0x3f')][_0x78d3('0x86')][_0x78d3('0x87')]('\x5c','\x5c\x5c')[_0x78d3('0x87')](/'/g,'\x27\x27');if(qs[_0x78d3('0x88')](_0x46a589)){_0x472aaf['or']('i.id\x20LIKE\x20?',_0x46a589+'%')['or']('i.phone\x20LIKE\x20?',_0x46a589+'%');}else{_0x472aaf['or'](_0x78d3('0x89'),qs[_0x78d3('0x69')](_0x46a589))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x46a589+'%');}}}_0x1b4041[_0x78d3('0x7a')](_0x472aaf);_0x1b4041[_0x78d3('0x8a')](_0x78d3('0x8b'));var _0x27745d={'type':db[_0x78d3('0x8c')][_0x78d3('0x8d')][_0x78d3('0x8e')],'raw':!![]};var _0x527d99=_0x1b4041[_0x78d3('0x8f')]();_0x527d99[_0x78d3('0x4b')](_0x78d3('0x8b'));_0x527d99[_0x78d3('0x4b')](_0x78d3('0x90'),'unreadMessages');if(_0x41add5['order']){_0x41add5['order'][_0x78d3('0x36')](function(_0x734be0){var _0x813e44=_0x734be0[0x0]==='contactName'?_0x734be0[0x0]:'i.'+_0x734be0[0x0];_0x1b4041['order'](_0x813e44,_0x734be0[0x1]===_0x78d3('0x91')?![]:!![]);});}if(!_[_0x78d3('0x78')](_0x38ca37)){_0x1b4041[_0x78d3('0x63')](_0xd4bace);_0x527d99[_0x78d3('0x7a')](_0x78d3('0x92'),_0x38ca37);}BPromise['resolve']()['then'](function(){if(!_0x45882b){if(_0x180033[_0x78d3('0x3f')][_0x78d3('0x79')])return;_0x527d99[_0x78d3('0x7a')](_0x78d3('0x93'));_0x1b4041[_0x78d3('0x7a')](_0x78d3('0x93'));return;}if(_0x180033[_0x78d3('0x94')][_0x78d3('0x95')]!==_0x78d3('0x96'))return;return _0x180033[_0x78d3('0x94')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x78d3('0x2d')](function(_0x59ec83){if(_['isEmpty'](_0x59ec83)){_0x527d99[_0x78d3('0x7a')](_0x78d3('0x97'));_0x1b4041[_0x78d3('0x7a')](_0x78d3('0x97'));}else{_0x527d99[_0x78d3('0x7a')](_0x78d3('0x7b'),_[_0x78d3('0x33')](_0x59ec83,'id'));_0x1b4041[_0x78d3('0x7a')](_0x78d3('0x7b'),_['map'](_0x59ec83,'id'));}});})[_0x78d3('0x2d')](function(){if(_0x180033[_0x78d3('0x94')][_0x78d3('0x95')]==='agent'&&!_0x45882b&&!_0x180033['query'][_0x78d3('0x79')])return[];return db[_0x78d3('0x98')][_0x78d3('0x3f')](_0x527d99[_0x78d3('0x99')](),_0x27745d);})['then'](function(_0x2fd217){_0x96e7f4['count']=_0x2fd217[_0x78d3('0x45')];if(_0x96e7f4[_0x78d3('0x25')]===0x0)return[];return db['sequelize'][_0x78d3('0x3f')](_0x2e8669[_0x78d3('0x99')](),_0x27745d)[_0x78d3('0x2d')](function(_0x225356){_0x16004e=_[_0x78d3('0x9a')](_0x225356,'id');_0x27745d=_[_0x78d3('0x9b')](_0x27745d,{'model':db[_0x78d3('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x180033[_0x78d3('0x3f')][_0x78d3('0x44')]){_0x41add5[_0x78d3('0x43')][_0x78d3('0x36')](function(_0x13ea25){_0x1b4041[_0x78d3('0x4b')]('i.'+_0x13ea25);});}else{_0x1b4041[_0x78d3('0x4b')](_0x78d3('0x90'),_0x78d3('0x9c'));_0x1b4041['field']('a.key',_0x78d3('0x9d'));_0x1b4041[_0x78d3('0x4b')]('a.mandatoryDisposition',_0x78d3('0x9e'));_0x1b4041['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x78d3('0x9f'));_0x1b4041['field'](_0x78d3('0xa0'));_0x1b4041['field'](_0x78d3('0xa1'),_0x78d3('0xa2'));_0x1b4041[_0x78d3('0x4b')](_0x78d3('0xa3'),_0x78d3('0xa4'));_0x1b4041['field'](_0x78d3('0xa5'),_0x78d3('0xa6'));_0x1b4041[_0x78d3('0x4b')](_0x78d3('0xa7'),_0x78d3('0xa8'));_0x1b4041['field'](_0x78d3('0xa9'),_0x78d3('0xaa'));_0x1b4041[_0x78d3('0x4b')](_0x78d3('0xab'),_0x78d3('0xac'));_0x1b4041['field'](_0x78d3('0xad'),_0x78d3('0xae'));_0x1b4041[_0x78d3('0x4b')](_0x78d3('0xaf'),_0x78d3('0xb0'));_0x1b4041[_0x78d3('0x4b')](_0x78d3('0xb1'),_0x78d3('0x35'));}if(_0x41add5[_0x78d3('0x27')])_0x1b4041[_0x78d3('0x27')](_0x41add5[_0x78d3('0x27')]);if(_0x41add5[_0x78d3('0x26')])_0x1b4041[_0x78d3('0x26')](_0x41add5['offset']);return db[_0x78d3('0x98')][_0x78d3('0x3f')](_0x1b4041[_0x78d3('0x99')](),_0x27745d);})[_0x78d3('0x2d')](function(_0xf0cc84){if(_0xf0cc84[_0x78d3('0x45')]>0x0)_0x3bc56e[_0x78d3('0x7a')](_0x78d3('0xb2'),_[_0x78d3('0x33')](_0xf0cc84,'id'));return db[_0x78d3('0x98')]['query'](_0x3bc56e['toString'](),_0x27745d)['then'](function(_0x39e2ac){var _0x86f5f7=_[_0x78d3('0xb3')](_0x39e2ac,_0x78d3('0xb4'));var _0x4df397=[];_0xf0cc84['forEach'](function(_0x3c3002){_0x4df397['push'](updateWhatsappInteraction(_0x3c3002,_0x16004e,_0x86f5f7));});return BPromise['all'](_0x4df397);});});})['then'](function(_0x784c53){_0x96e7f4['rows']=_0x784c53;return _0x96e7f4;})[_0x78d3('0x2d')](respondWithFilteredResult(_0xccd183,_0x41add5))[_0x78d3('0xb5')](handleError(_0xccd183,null));};exports[_0x78d3('0xb6')]=function(_0x39d49a,_0x397bdd){var _0x1902c0={'raw':![],'where':{'id':_0x39d49a[_0x78d3('0xb7')]['id']}},_0x4b2018={};_0x4b2018[_0x78d3('0x3e')]=_['keys'](db[_0x78d3('0x39')][_0x78d3('0x3a')]);_0x4b2018[_0x78d3('0x3f')]=_['keys'](_0x39d49a[_0x78d3('0x3f')]);_0x4b2018['filters']=_[_0x78d3('0x42')](_0x4b2018['model'],_0x4b2018[_0x78d3('0x3f')]);_0x1902c0['attributes']=_['intersection'](_0x4b2018[_0x78d3('0x3e')],qs[_0x78d3('0x44')](_0x39d49a[_0x78d3('0x3f')][_0x78d3('0x44')]));_0x1902c0[_0x78d3('0x43')]=_0x1902c0[_0x78d3('0x43')][_0x78d3('0x45')]?_0x1902c0['attributes']:_0x4b2018[_0x78d3('0x3e')];if(_0x39d49a[_0x78d3('0x3f')][_0x78d3('0xb8')]){_0x1902c0[_0x78d3('0xb9')]=[{'all':!![]}];}_0x1902c0=_[_0x78d3('0x9b')]({},_0x1902c0,_0x39d49a[_0x78d3('0xba')]);return db[_0x78d3('0x39')][_0x78d3('0x61')](_0x1902c0)[_0x78d3('0x2d')](handleEntityNotFound(_0x397bdd,null))[_0x78d3('0x2d')](respondWithResult(_0x397bdd,null))['catch'](handleError(_0x397bdd,null));};exports[_0x78d3('0xbb')]=function(_0x3fc3db,_0x51472e){return db[_0x78d3('0x39')][_0x78d3('0xbb')](_0x3fc3db[_0x78d3('0x75')],{})['then'](respondWithResult(_0x51472e,0xc9))[_0x78d3('0xb5')](handleError(_0x51472e,null));};exports[_0x78d3('0xbc')]=function(_0x154066,_0x261e3a){if(_0x154066[_0x78d3('0x75')]['id']){delete _0x154066[_0x78d3('0x75')]['id'];}return db[_0x78d3('0x39')][_0x78d3('0x61')]({'where':{'id':_0x154066[_0x78d3('0xb7')]['id']}})[_0x78d3('0x2d')](handleEntityNotFound(_0x261e3a,null))['then'](saveUpdates(_0x154066[_0x78d3('0x75')],null))[_0x78d3('0x2d')](respondWithResult(_0x261e3a,null))[_0x78d3('0xb5')](handleError(_0x261e3a,null));};exports[_0x78d3('0x2c')]=function(_0x34e82d,_0x30dd55){return db[_0x78d3('0x39')]['find']({'where':{'id':_0x34e82d[_0x78d3('0xb7')]['id']}})[_0x78d3('0x2d')](handleEntityNotFound(_0x30dd55,null))['then'](removeEntity(_0x30dd55,null))[_0x78d3('0xb5')](handleError(_0x30dd55,null));};exports[_0x78d3('0xbd')]=function(_0x5b0250,_0x144c08){return db[_0x78d3('0x39')][_0x78d3('0xbd')]()[_0x78d3('0x2d')](respondWithResult(_0x144c08,null))[_0x78d3('0xb5')](handleError(_0x144c08,null));};exports[_0x78d3('0xbe')]=function(_0x4d7b9b,_0x554b3d,_0x5a786c){return db[_0x78d3('0xbf')][_0x78d3('0x61')]({'where':{'id':_0x4d7b9b[_0x78d3('0xb7')]['id']}})[_0x78d3('0x2d')](handleEntityNotFound(_0x554b3d,null))['then'](function(_0x2ec67a){if(_0x2ec67a){return _0x2ec67a[_0x78d3('0xbe')](_0x4d7b9b['body'][_0x78d3('0xc0')],_[_0x78d3('0xc1')](_0x4d7b9b['body'],[_0x78d3('0xc0'),'id'])||{});}})[_0x78d3('0x2d')](respondWithResult(_0x554b3d,null))[_0x78d3('0xb5')](handleError(_0x554b3d,null));};exports['getMessages']=function(_0x72e8ee,_0x1a0ffe,_0x2431b1){var _0x4b430e={'raw':![],'where':{}};var _0x5dbd86={};var _0x40a98c={'count':0x0,'rows':[]};return db[_0x78d3('0x39')][_0x78d3('0xc2')]({'where':{'id':_0x72e8ee[_0x78d3('0xb7')]['id']}})['then'](handleEntityNotFound(_0x1a0ffe,null))[_0x78d3('0x2d')](function(_0x19104b){if(_0x19104b){_0x5dbd86[_0x78d3('0x3e')]=_[_0x78d3('0x40')](db[_0x78d3('0xbf')][_0x78d3('0x3a')]);_0x5dbd86[_0x78d3('0x3f')]=_[_0x78d3('0x40')](_0x72e8ee[_0x78d3('0x3f')]);_0x5dbd86[_0x78d3('0x41')]=_['intersection'](_0x5dbd86[_0x78d3('0x3e')],_0x5dbd86[_0x78d3('0x3f')]);_0x4b430e['attributes']=_[_0x78d3('0x42')](_0x5dbd86[_0x78d3('0x3e')],qs['fields'](_0x72e8ee[_0x78d3('0x3f')]['fields']));_0x4b430e[_0x78d3('0x43')]=_0x4b430e['attributes'][_0x78d3('0x45')]?_0x4b430e[_0x78d3('0x43')]:_0x5dbd86[_0x78d3('0x3e')];if(!_0x72e8ee[_0x78d3('0x3f')][_0x78d3('0x46')]('nolimit')){_0x4b430e['limit']=qs[_0x78d3('0x27')](_0x72e8ee['query'][_0x78d3('0x27')]);_0x4b430e[_0x78d3('0x26')]=qs[_0x78d3('0x26')](_0x72e8ee[_0x78d3('0x3f')]['offset']);}_0x4b430e['order']=qs[_0x78d3('0x48')](_0x72e8ee[_0x78d3('0x3f')][_0x78d3('0x48')]);_0x4b430e[_0x78d3('0x7a')]=qs[_0x78d3('0x41')](_['pick'](_0x72e8ee[_0x78d3('0x3f')],_0x5dbd86['filters']));_0x4b430e['where'][_0x78d3('0xb4')]=_0x19104b['id'];if(_0x72e8ee['query']['filter']){_0x4b430e[_0x78d3('0x7a')]=_[_0x78d3('0x9b')](_0x4b430e[_0x78d3('0x7a')],{'$or':_[_0x78d3('0x33')](_0x4b430e[_0x78d3('0x43')],function(_0x4bdc2d){var _0x5c6de8={};_0x5c6de8[_0x4bdc2d]={'$like':'%'+_0x72e8ee['query'][_0x78d3('0x86')]+'%'};return _0x5c6de8;})});}if(_0x72e8ee['query'][_0x78d3('0xc3')]){var _0xe57d77=_0x72e8ee[_0x78d3('0x3f')][_0x78d3('0xc3')][_0x78d3('0x67')](',');var _0x40a13b={};_0x40a13b[_0xe57d77[0x0]]={'$gte':moment(_0xe57d77[0x1])[_0x78d3('0xc4')](_0x78d3('0xc5'))};_0x4b430e[_0x78d3('0x7a')]=_['merge'](_0x4b430e['where'],_0x40a13b);}_0x4b430e=_[_0x78d3('0x9b')]({},_0x4b430e,_0x72e8ee[_0x78d3('0xba')]);return db[_0x78d3('0xbf')][_0x78d3('0x25')]({'where':_0x4b430e[_0x78d3('0x7a')]})['then'](function(_0x2f7841){_0x40a98c[_0x78d3('0x25')]=_0x2f7841;if(_0x72e8ee[_0x78d3('0x3f')][_0x78d3('0xb8')]){_0x4b430e[_0x78d3('0xb9')]=[{'all':!![]}];}return db[_0x78d3('0xbf')][_0x78d3('0xc6')](_0x4b430e);})['then'](function(_0x4c5f05){_0x40a98c[_0x78d3('0xc7')]=_0x4c5f05;return _0x40a98c;});}})['then'](respondWithFilteredResult(_0x1a0ffe,_0x4b430e))[_0x78d3('0xb5')](handleError(_0x1a0ffe,null));};exports['addTags']=function(_0x10c520,_0x23f228,_0x5f40cf){return db['WhatsappInteraction']['find']({'where':{'id':_0x10c520[_0x78d3('0xb7')]['id']}})[_0x78d3('0x2d')](handleEntityNotFound(_0x23f228,null))[_0x78d3('0x2d')](function(_0x2190bf){if(_0x2190bf){return _0x2190bf[_0x78d3('0xc8')](_0x10c520[_0x78d3('0x75')][_0x78d3('0xc0')],_[_0x78d3('0xc1')](_0x10c520[_0x78d3('0x75')],[_0x78d3('0xc0'),'id'])||{})[_0x78d3('0xc9')](function(){return db[_0x78d3('0xca')][_0x78d3('0xc6')]({'attributes':['id','name',_0x78d3('0x4c')],'where':{'id':_0x10c520['body']['ids']}});})[_0x78d3('0x2d')](function(_0x3f6b45){socket['emit'](_0x78d3('0xcb'),{'id':Number(_0x10c520[_0x78d3('0xb7')]['id']),'tags':_0x3f6b45||[]});return{'id':Number(_0x10c520[_0x78d3('0xb7')]['id']),'tags':_0x3f6b45||[]};});}})[_0x78d3('0x2d')](respondWithResult(_0x23f228,null))['catch'](handleError(_0x23f228,null));};exports['removeTags']=function(_0x1eed3a,_0x13ef34,_0x359d1f){return db['WhatsappInteraction'][_0x78d3('0x61')]({'where':{'id':_0x1eed3a[_0x78d3('0xb7')]['id']}})[_0x78d3('0x2d')](handleEntityNotFound(_0x13ef34,null))['then'](function(_0xecb4af){if(_0xecb4af){return _0xecb4af[_0x78d3('0xcc')](_0x1eed3a[_0x78d3('0x3f')][_0x78d3('0xc0')]);}})['then'](respondWithStatusCode(_0x13ef34,null))[_0x78d3('0xb5')](handleError(_0x13ef34,null));};exports[_0x78d3('0xcd')]=function(_0x39ee6c,_0xd38809){var _0x1b4f65=moment()['unix']()[_0x78d3('0x99')]();var _0x4ea5b8=path['join'](config[_0x78d3('0xce')],'server',_0x78d3('0xcf'),_0x78d3('0xd0'));var _0x3ff6d4=path['join'](config[_0x78d3('0xce')],'server',_0x78d3('0xcf'),_0x78d3('0xd1'));var _0x4daa90=path[_0x78d3('0xd2')](_0x4ea5b8,_0x1b4f65);var _0x3bb55d=util['format'](_0x78d3('0xd3'),_0x39ee6c[_0x78d3('0xb7')]['id'],_0x1b4f65);var _0x4c7311=path[_0x78d3('0xd2')](_0x4ea5b8,_0x3bb55d);var _0x244e1d=[];_0x244e1d[_0x78d3('0x38')]({'model':db['User'],'as':_0x78d3('0x71'),'attributes':['id',_0x78d3('0x34')],'raw':!![]});_0x244e1d[_0x78d3('0x38')]({'model':db[_0x78d3('0xd4')],'as':_0x78d3('0x65'),'attributes':['id',_0x78d3('0xd5'),'lastName'],'raw':!![]});if(_0x39ee6c[_0x78d3('0x3f')][_0x78d3('0xd1')]){_0x244e1d['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2fe1c5=[{'model':db['WhatsappMessage'],'as':_0x78d3('0xd6'),'attributes':['id',_0x78d3('0x75'),_0x78d3('0xd7'),'direction','secret',_0x78d3('0x81')],'include':_0x244e1d}];_0x2fe1c5['push']({'model':db[_0x78d3('0xd8')],'as':'Account','attributes':['id',_0x78d3('0x30')]});_0x2fe1c5[_0x78d3('0x38')]({'model':db[_0x78d3('0x71')],'as':_0x78d3('0xd9'),'attributes':['id',_0x78d3('0x34')]});return db[_0x78d3('0x39')][_0x78d3('0x61')]({'where':{'id':_0x39ee6c[_0x78d3('0xb7')]['id']},'include':_0x2fe1c5})[_0x78d3('0x2d')](handleEntityNotFound(_0xd38809,null))['then'](function(_0x2ac52d){if(_0x2ac52d){var _0xcb0d80=_0x2ac52d['get']({'plain':!![]});fs['mkdirSync'](_0x4daa90);var _0x514a8d={'channel':_0x78d3('0xda'),'account':_0xcb0d80[_0x78d3('0xdb')][_0x78d3('0x30')],'agent':_0xcb0d80['Owner']?_0xcb0d80[_0x78d3('0xd9')][_0x78d3('0x34')]:_0x78d3('0xdc'),'createdAt':moment(_0xcb0d80[_0x78d3('0xd7')])['format'](_0x78d3('0xc5'))[_0x78d3('0x99')](),'closedAt':_0xcb0d80[_0x78d3('0xdd')]?moment(_0xcb0d80[_0x78d3('0xde')])['format'](_0x78d3('0xc5'))['toString']():'','disposition':_0xcb0d80['disposition'],'messages':_(_0xcb0d80[_0x78d3('0xd6')])['filter']({'secret':![]})[_0x78d3('0x33')](function(_0x3bc8d2){if(_0x3bc8d2[_0x78d3('0xdf')]){var _0x1570b3=path['join'](_0x3ff6d4,_0x3bc8d2[_0x78d3('0xdf')]['basename']);if(fs[_0x78d3('0xe0')](_0x1570b3)){fs[_0x78d3('0xe1')](_0x1570b3)[_0x78d3('0xe2')](fs[_0x78d3('0xe3')](path[_0x78d3('0xd2')](_0x4daa90,_0x3bc8d2[_0x78d3('0xdf')][_0x78d3('0xe4')])));}}return{'date':moment(_0x3bc8d2[_0x78d3('0xd7')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x78d3('0x99')](),'sender':_0x3bc8d2[_0x78d3('0xe5')]===_0x78d3('0xe6')?_0x3bc8d2[_0x78d3('0x71')]?_0x3bc8d2['User']['fullname']:'System':_0x3bc8d2['Contact']['firstName']+(_0x3bc8d2[_0x78d3('0x65')]['lastName']?'\x20'+_0x3bc8d2[_0x78d3('0x65')][_0x78d3('0xe7')]:''),'body':_0x3bc8d2[_0x78d3('0xdf')]?_0x3bc8d2['Attachment'][_0x78d3('0xe4')]:_0x3bc8d2[_0x78d3('0x75')],'direction':_0x3bc8d2[_0x78d3('0xe5')]===_0x78d3('0xe6')?'A':'C','secret':_0x3bc8d2[_0x78d3('0xe8')],'read':_0x3bc8d2[_0x78d3('0x81')],'attachment':_0x3bc8d2[_0x78d3('0xdf')]};})[_0x78d3('0x62')]()};return ejs[_0x78d3('0xe9')](path[_0x78d3('0xd2')](config['root'],_0x78d3('0xea'),_0x78d3('0xeb'),_0x78d3('0xec')),{'interaction':_0x514a8d})[_0x78d3('0x2d')](function(_0x415d4f){var _0x307461=path[_0x78d3('0xd2')](_0x4daa90,_0x78d3('0xed')+_0xcb0d80['id']+'-'+_0x1b4f65+_0x78d3('0xee'));var _0x1b6442={'path':_0x307461,'channel':'Whatsapp','interactionId':_0xcb0d80['id']};return pdf[_0x78d3('0xef')](_0x415d4f,_0x1b6442);})['then'](function(){return new BPromise(function(_0x3b4420,_0x5d2f59){zipdir(_0x4daa90,{'saveTo':_0x4c7311},function(_0x248d4f,_0x1ac8c7){if(_0x248d4f)return _0x5d2f59(_0x248d4f);return _0x3b4420(_0x1ac8c7);});})[_0x78d3('0x2d')](function(){return new BPromise(function(_0x203bc5,_0x37912d){rimraf(_0x4daa90,function(_0xc93420){if(_0xc93420)_0x37912d(_0xc93420);return _0x203bc5();});});})[_0x78d3('0x2d')](function(){return _0xd38809[_0x78d3('0xcd')](_0x4c7311,_0x3bb55d,function(_0xc6b9a4){if(_0xc6b9a4){console['log']('err',_0xc6b9a4);}else{fs[_0x78d3('0xf0')](_0x4c7311);}});});});}else{return _0xd38809[_0x78d3('0x20')](0xc8);}})[_0x78d3('0xb5')](handleError(_0xd38809,null));};
\ No newline at end of file
index 4ed2918..42d49d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5fa=['../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','getUsers','then','setDataValue','Users','map','length','catch','hook','exports'];(function(_0x3c6b7f,_0x3901c0){var _0x154a23=function(_0x536114){while(--_0x536114){_0x3c6b7f['push'](_0x3c6b7f['shift']());}};_0x154a23(++_0x3901c0);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x5bb736,_0x32c198){_0x5bb736=_0x5bb736-0x0;var _0x483aad=_0xa5fa[_0x5bb736];return _0x483aad;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xaa5f('0x0'))['db'][_0xaa5f('0x1')];var WhatsappMessage=require(_0xaa5f('0x0'))['db'][_0xaa5f('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaa5f('0x3'),'afterUpdate':_0xaa5f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x233cd6){return function(_0x42450a,_0x37f7bc,_0x20744d){_0x42450a[_0xaa5f('0x5')]({'attributes':['id'],'raw':!![]})[_0xaa5f('0x6')](function(_0x302138){_0x42450a[_0xaa5f('0x7')](_0xaa5f('0x8'),_0x302138[_0xaa5f('0x9')](function(_0xb96e0){return{'id':_0xb96e0['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x42450a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa5f('0x6')](function(_0x227ebb){_0x42450a['setDataValue']('unreadMessages',_0x227ebb[_0xaa5f('0xa')]);WhatsappInteractionEvents['emit'](_0x233cd6+':'+_0x42450a['id'],_0x42450a);WhatsappInteractionEvents['emit'](_0x233cd6,_0x42450a);_0x20744d(null);})[_0xaa5f('0xb')](_0x20744d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xaa5f('0xc')](e,emitEvent(event));}}module[_0xaa5f('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x851a=['then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x574de4,_0x2982a8){var _0x1c7c9a=function(_0x7b567f){while(--_0x7b567f){_0x574de4['push'](_0x574de4['shift']());}};_0x1c7c9a(++_0x2982a8);}(_0x851a,0x19b));var _0xa851=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x851a[_0x2c7618];return _0x5ce3f0;};'use strict';var EventEmitter=require(_0xa851('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xa851('0x1')];var WhatsappMessage=require(_0xa851('0x2'))['db'][_0xa851('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa851('0x4')](0x0);var events={'afterCreate':_0xa851('0x5'),'afterUpdate':_0xa851('0x6'),'afterDestroy':_0xa851('0x7')};function emitEvent(_0x3f317d){return function(_0x4a10c8,_0xdd4995,_0x57a7c4){_0x4a10c8[_0xa851('0x8')]({'attributes':['id'],'raw':!![]})[_0xa851('0x9')](function(_0x2f1f42){_0x4a10c8['setDataValue'](_0xa851('0xa'),_0x2f1f42[_0xa851('0xb')](function(_0x1334a1){return{'id':_0x1334a1['id']};}));return WhatsappMessage[_0xa851('0xc')]({'where':{'WhatsappInteractionId':_0x4a10c8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x393900){_0x4a10c8[_0xa851('0xd')]('unreadMessages',_0x393900[_0xa851('0xe')]);WhatsappInteractionEvents[_0xa851('0xf')](_0x3f317d+':'+_0x4a10c8['id'],_0x4a10c8);WhatsappInteractionEvents[_0xa851('0xf')](_0x3f317d,_0x4a10c8);_0x57a7c4(null);})[_0xa851('0x10')](_0x57a7c4(null));};}for(var e in events){if(events[_0xa851('0x11')](e)){var event=events[e];WhatsappInteraction[_0xa851('0x12')](e,emitEvent(event));}}module[_0xa851('0x13')]=WhatsappInteractionEvents;
\ No newline at end of file
index 0fffe68..44b07f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fbd=['closed','closedAt','format','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes','whatsapp_interactions','changed'];(function(_0xc5f576,_0x10dda4){var _0x8956f=function(_0x46776d){while(--_0x46776d){_0xc5f576['push'](_0xc5f576['shift']());}};_0x8956f(++_0x10dda4);}(_0x8fbd,0x13b));var _0xd8fb=function(_0x40d141,_0x1ac21c){_0x40d141=_0x40d141-0x0;var _0x30d3cc=_0x8fbd[_0x40d141];return _0x30d3cc;};'use strict';var _=require('lodash');var util=require(_0xd8fb('0x0'));var logger=require(_0xd8fb('0x1'))(_0xd8fb('0x2'));var moment=require(_0xd8fb('0x3'));var BPromise=require(_0xd8fb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8fb('0x5'));var rimraf=require('rimraf');var config=require(_0xd8fb('0x6'));var attributes=require(_0xd8fb('0x7'));module['exports']=function(_0x508c93,_0x1f461e){return _0x508c93['define']('WhatsappInteraction',attributes,{'tableName':_0xd8fb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3024a3,_0x4c68f1,_0x31c8b2){if(_0x3024a3[_0xd8fb('0x9')](_0xd8fb('0xa'))){_0x3024a3[_0xd8fb('0xb')]=moment()[_0xd8fb('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31c8b2(null,_0x3024a3);}}});};
\ No newline at end of file
+var _0x31bc=['closed','closedAt','format','util','../../config/logger','api','moment','request-promise','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed'];(function(_0x20c893,_0xbef2b4){var _0xc705e8=function(_0x449739){while(--_0x449739){_0x20c893['push'](_0x20c893['shift']());}};_0xc705e8(++_0xbef2b4);}(_0x31bc,0x10d));var _0xc31b=function(_0x1de914,_0x2434f1){_0x1de914=_0x1de914-0x0;var _0x303ccd=_0x31bc[_0x1de914];return _0x303ccd;};'use strict';var _=require('lodash');var util=require(_0xc31b('0x0'));var logger=require(_0xc31b('0x1'))(_0xc31b('0x2'));var moment=require(_0xc31b('0x3'));var BPromise=require('bluebird');var rp=require(_0xc31b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc31b('0x5'));var attributes=require(_0xc31b('0x6'));module[_0xc31b('0x7')]=function(_0x455c58,_0x5b4076){return _0x455c58[_0xc31b('0x8')]('WhatsappInteraction',attributes,{'tableName':_0xc31b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12191a,_0x532414,_0x58fa2b){if(_0x12191a[_0xc31b('0xa')](_0xc31b('0xb'))){_0x12191a[_0xc31b('0xc')]=moment()[_0xc31b('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x58fa2b(null,_0x12191a);}}});};
\ No newline at end of file
index 5ff78b6..e53ae28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cdb=['redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','AddTagsToWhatsappInteraction','find','then','omit','AddTags','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x1e7aa7,_0x4e83fd){var _0x4d3c52=function(_0x4d38eb){while(--_0x4d38eb){_0x1e7aa7['push'](_0x1e7aa7['shift']());}};_0x4d3c52(++_0x4e83fd);}(_0x9cdb,0xbd));var _0xb9cd=function(_0x37296b,_0x2e9820){_0x37296b=_0x37296b-0x0;var _0x561567=_0x9cdb[_0x37296b];return _0x561567;};'use strict';var _=require(_0xb9cd('0x0'));var util=require('util');var moment=require(_0xb9cd('0x1'));var BPromise=require(_0xb9cd('0x2'));var rs=require(_0xb9cd('0x3'));var fs=require('fs');var Redis=require(_0xb9cd('0x4'));var db=require(_0xb9cd('0x5'))['db'];var utils=require(_0xb9cd('0x6'));var logger=require('../../config/logger')(_0xb9cd('0x7'));var config=require(_0xb9cd('0x8'));var jayson=require(_0xb9cd('0x9'));var client=jayson['client'][_0xb9cd('0xa')]({'port':0x232a});config[_0xb9cd('0xb')]=_['defaults'](config[_0xb9cd('0xb')],{'host':_0xb9cd('0xc'),'port':0x18eb});var socket=require(_0xb9cd('0xd'))(new Redis(config['redis']));require(_0xb9cd('0xe'))[_0xb9cd('0xf')](socket);function respondWithRpcPromise(_0x4c71ff,_0xb2bcdd,_0x31adb8){return new BPromise(function(_0x3455fd,_0x57a653){return client[_0xb9cd('0x10')](_0x4c71ff,_0x31adb8)['then'](function(_0x1a8f02){logger[_0xb9cd('0x11')](_0xb9cd('0x12'),_0xb2bcdd,'request\x20sent');logger['debug'](_0xb9cd('0x13'),_0xb2bcdd,_0xb9cd('0x14'),JSON[_0xb9cd('0x15')](_0x1a8f02));if(_0x1a8f02[_0xb9cd('0x16')]){if(_0x1a8f02[_0xb9cd('0x16')][_0xb9cd('0x17')]===0x1f4){logger[_0xb9cd('0x16')](_0xb9cd('0x12'),_0xb2bcdd,_0x1a8f02[_0xb9cd('0x16')]['message']);return _0x57a653(_0x1a8f02[_0xb9cd('0x16')][_0xb9cd('0x18')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0xb2bcdd,_0x1a8f02[_0xb9cd('0x16')][_0xb9cd('0x18')]);return _0x3455fd(_0x1a8f02['error']['message']);}else{logger[_0xb9cd('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0xb2bcdd,_0xb9cd('0x14'));_0x3455fd(_0x1a8f02[_0xb9cd('0x19')][_0xb9cd('0x18')]);}})[_0xb9cd('0x1a')](function(_0xc90526){logger['error'](_0xb9cd('0x12'),_0xb2bcdd,_0xc90526);_0x57a653(_0xc90526);});});}exports[_0xb9cd('0x1b')]=function(_0x1ea4ab){var _0x3a27c7=this;return new Promise(function(_0x547cee,_0x2e0644){return db[_0xb9cd('0x1c')]['update'](_0x1ea4ab[_0xb9cd('0x1d')],{'raw':_0x1ea4ab['options']?_0x1ea4ab[_0xb9cd('0x1e')][_0xb9cd('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ea4ab[_0xb9cd('0x1e')]?_0x1ea4ab['options'][_0xb9cd('0x20')]||null:null,'attributes':_0x1ea4ab[_0xb9cd('0x1e')]?_0x1ea4ab[_0xb9cd('0x1e')]['attributes']||null:null,'limit':_0x1ea4ab['options']?_0x1ea4ab[_0xb9cd('0x1e')][_0xb9cd('0x21')]||null:null})['then'](function(_0x45ae68){logger[_0xb9cd('0x11')](_0xb9cd('0x1b'),_0x1ea4ab);logger['debug']('UpdateWhatsappInteraction',_0x1ea4ab,JSON[_0xb9cd('0x15')](_0x45ae68));_0x547cee(_0x45ae68);})[_0xb9cd('0x1a')](function(_0x2ae4f7){logger[_0xb9cd('0x16')](_0xb9cd('0x1b'),_0x2ae4f7[_0xb9cd('0x18')],_0x1ea4ab);_0x2e0644(_0x3a27c7[_0xb9cd('0x16')](0x1f4,_0x2ae4f7[_0xb9cd('0x18')]));});});};exports[_0xb9cd('0x22')]=function(_0xfddeb7){return new Promise(function(_0x228eac,_0x4ace71){return db[_0xb9cd('0x1c')][_0xb9cd('0x23')]({'where':_0xfddeb7[_0xb9cd('0x1e')]?_0xfddeb7[_0xb9cd('0x1e')][_0xb9cd('0x20')]||null:null})[_0xb9cd('0x24')](function(_0x454f2c){if(_0x454f2c){return _0x454f2c['addTags'](_0xfddeb7[_0xb9cd('0x1d')]['ids'],_[_0xb9cd('0x25')](_0xfddeb7[_0xb9cd('0x1d')],['ids','id'])||{});}})['spread'](function(_0x32143f){logger[_0xb9cd('0x11')](_0xb9cd('0x26'),_0xfddeb7);logger[_0xb9cd('0x27')]('AddTags',_0xfddeb7,JSON[_0xb9cd('0x15')](_0x32143f));_0x228eac(_0x32143f);})[_0xb9cd('0x1a')](function(_0x1e9a05){logger[_0xb9cd('0x16')](_0xb9cd('0x26'),_0x1e9a05[_0xb9cd('0x18')],_0xfddeb7);_0x4ace71(_this[_0xb9cd('0x16')](0x1f4,_0x1e9a05[_0xb9cd('0x18')]));});});};
\ No newline at end of file
+var _0x361e=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','catch','AddTagsToWhatsappInteraction','addTags','omit','ids','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x59cdd1,_0x27de7e){var _0x522207=function(_0x313016){while(--_0x313016){_0x59cdd1['push'](_0x59cdd1['shift']());}};_0x522207(++_0x27de7e);}(_0x361e,0x144));var _0xe361=function(_0x5acc47,_0x51018f){_0x5acc47=_0x5acc47-0x0;var _0x5ceee0=_0x361e[_0x5acc47];return _0x5ceee0;};'use strict';var _=require('lodash');var util=require(_0xe361('0x0'));var moment=require(_0xe361('0x1'));var BPromise=require(_0xe361('0x2'));var rs=require(_0xe361('0x3'));var fs=require('fs');var Redis=require(_0xe361('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe361('0x5'))(_0xe361('0x6'));var config=require(_0xe361('0x7'));var jayson=require(_0xe361('0x8'));var client=jayson['client'][_0xe361('0x9')]({'port':0x232a});config['redis']=_[_0xe361('0xa')](config[_0xe361('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe361('0xc'))(new Redis(config[_0xe361('0xb')]));require(_0xe361('0xd'))[_0xe361('0xe')](socket);function respondWithRpcPromise(_0x42ecf0,_0x2bc312,_0xe106ad){return new BPromise(function(_0x1f7816,_0x4b0909){return client[_0xe361('0xf')](_0x42ecf0,_0xe106ad)[_0xe361('0x10')](function(_0x139a9e){logger[_0xe361('0x11')](_0xe361('0x12'),_0x2bc312,_0xe361('0x13'));logger[_0xe361('0x14')](_0xe361('0x15'),_0x2bc312,_0xe361('0x13'),JSON[_0xe361('0x16')](_0x139a9e));if(_0x139a9e['error']){if(_0x139a9e['error']['code']===0x1f4){logger[_0xe361('0x17')](_0xe361('0x12'),_0x2bc312,_0x139a9e[_0xe361('0x17')][_0xe361('0x18')]);return _0x4b0909(_0x139a9e[_0xe361('0x17')]['message']);}logger[_0xe361('0x17')](_0xe361('0x12'),_0x2bc312,_0x139a9e[_0xe361('0x17')][_0xe361('0x18')]);return _0x1f7816(_0x139a9e[_0xe361('0x17')][_0xe361('0x18')]);}else{logger[_0xe361('0x11')](_0xe361('0x12'),_0x2bc312,_0xe361('0x13'));_0x1f7816(_0x139a9e[_0xe361('0x19')][_0xe361('0x18')]);}})['catch'](function(_0x104cf9){logger[_0xe361('0x17')](_0xe361('0x12'),_0x2bc312,_0x104cf9);_0x4b0909(_0x104cf9);});});}exports[_0xe361('0x1a')]=function(_0xe3687d){var _0x237f55=this;return new Promise(function(_0x3ce1e4,_0x323795){return db[_0xe361('0x1b')][_0xe361('0x1c')](_0xe3687d[_0xe361('0x1d')],{'raw':_0xe3687d[_0xe361('0x1e')]?_0xe3687d[_0xe361('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe3687d[_0xe361('0x1e')]?_0xe3687d[_0xe361('0x1e')][_0xe361('0x1f')]||null:null,'attributes':_0xe3687d[_0xe361('0x1e')]?_0xe3687d['options'][_0xe361('0x20')]||null:null,'limit':_0xe3687d[_0xe361('0x1e')]?_0xe3687d[_0xe361('0x1e')][_0xe361('0x21')]||null:null})[_0xe361('0x10')](function(_0x49f84f){logger[_0xe361('0x11')](_0xe361('0x1a'),_0xe3687d);logger[_0xe361('0x14')](_0xe361('0x1a'),_0xe3687d,JSON['stringify'](_0x49f84f));_0x3ce1e4(_0x49f84f);})[_0xe361('0x22')](function(_0x414762){logger[_0xe361('0x17')](_0xe361('0x1a'),_0x414762[_0xe361('0x18')],_0xe3687d);_0x323795(_0x237f55[_0xe361('0x17')](0x1f4,_0x414762[_0xe361('0x18')]));});});};exports[_0xe361('0x23')]=function(_0x19f3d0){return new Promise(function(_0xff53dc,_0x3015f7){return db[_0xe361('0x1b')]['find']({'where':_0x19f3d0[_0xe361('0x1e')]?_0x19f3d0[_0xe361('0x1e')][_0xe361('0x1f')]||null:null})[_0xe361('0x10')](function(_0x2d5be3){if(_0x2d5be3){return _0x2d5be3[_0xe361('0x24')](_0x19f3d0[_0xe361('0x1d')]['ids'],_[_0xe361('0x25')](_0x19f3d0[_0xe361('0x1d')],[_0xe361('0x26'),'id'])||{});}})[_0xe361('0x27')](function(_0x443910){logger[_0xe361('0x11')]('AddTags',_0x19f3d0);logger[_0xe361('0x14')](_0xe361('0x28'),_0x19f3d0,JSON[_0xe361('0x16')](_0x443910));_0xff53dc(_0x443910);})[_0xe361('0x22')](function(_0x46579d){logger[_0xe361('0x17')](_0xe361('0x28'),_0x46579d[_0xe361('0x18')],_0x19f3d0);_0x3015f7(_this[_0xe361('0x17')](0x1f4,_0x46579d[_0xe361('0x18')]));});});};
\ No newline at end of file
index cec4af3..0ec703b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf57b=['save','update','emit','register','./whatsappInteraction.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf57b,0x1b7));var _0xbf57=function(_0x4e30f4,_0x5c17a7){_0x4e30f4=_0x4e30f4-0x0;var _0xa83b4e=_0xf57b[_0x4e30f4];return _0xa83b4e;};'use strict';var WhatsappInteractionEvents=require(_0xbf57('0x0'));var events=[_0xbf57('0x1'),'remove',_0xbf57('0x2')];function createListener(_0x3bcf12,_0x27bced){return function(_0x3a7c4f){_0x27bced[_0xbf57('0x3')](_0x3bcf12,_0x3a7c4f);};}function removeListener(_0x2764d0,_0xb6b03b){return function(){WhatsappInteractionEvents['removeListener'](_0x2764d0,_0xb6b03b);};}exports[_0xbf57('0x4')]=function(_0x4a6723){for(var _0x153ea3=0x0,_0x3999a2=events['length'];_0x153ea3<_0x3999a2;_0x153ea3++){var _0x32a908=events[_0x153ea3];var _0x4766a8=createListener('whatsappInteraction:'+_0x32a908,_0x4a6723);WhatsappInteractionEvents['on'](_0x32a908,_0x4766a8);}};
\ No newline at end of file
+var _0x2507=['remove','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x396ec9,_0x20b988){var _0x14b918=function(_0x21f4d1){while(--_0x21f4d1){_0x396ec9['push'](_0x396ec9['shift']());}};_0x14b918(++_0x20b988);}(_0x2507,0x101));var _0x7250=function(_0x2522ba,_0x20e57a){_0x2522ba=_0x2522ba-0x0;var _0x3bfcaf=_0x2507[_0x2522ba];return _0x3bfcaf;};'use strict';var WhatsappInteractionEvents=require(_0x7250('0x0'));var events=[_0x7250('0x1'),_0x7250('0x2'),'update'];function createListener(_0x37e293,_0x56ed86){return function(_0x4aafc2){_0x56ed86[_0x7250('0x3')](_0x37e293,_0x4aafc2);};}function removeListener(_0x5ba85c,_0x561ab4){return function(){WhatsappInteractionEvents[_0x7250('0x4')](_0x5ba85c,_0x561ab4);};}exports['register']=function(_0x383c9c){for(var _0x55896f=0x0,_0x47b5bd=events[_0x7250('0x5')];_0x55896f<_0x47b5bd;_0x55896f++){var _0x3438d8=events[_0x55896f];var _0x311738=createListener(_0x7250('0x6')+_0x3438d8,_0x383c9c);WhatsappInteractionEvents['on'](_0x3438d8,_0x311738);}};
\ No newline at end of file
index b0769eb..4f82f3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9136=['path','express','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','update','put','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x546af3,_0x904a3f){var _0x1c156a=function(_0x3097fb){while(--_0x3097fb){_0x546af3['push'](_0x546af3['shift']());}};_0x1c156a(++_0x904a3f);}(_0x9136,0x138));var _0x6913=function(_0x284e25,_0x225448){_0x284e25=_0x284e25-0x0;var _0x34576e=_0x9136[_0x284e25];return _0x34576e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6913('0x0'));var timeout=require('connect-timeout');var express=require(_0x6913('0x1'));var router=express['Router']();var fs_extra=require(_0x6913('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6913('0x3'));var config=require('../../config/environment');var controller=require(_0x6913('0x4'));router[_0x6913('0x5')]('/',auth[_0x6913('0x6')](),controller[_0x6913('0x7')]);router['get'](_0x6913('0x8'),auth[_0x6913('0x6')](),controller['describe']);router['get'](_0x6913('0x9'),auth[_0x6913('0x6')](),controller[_0x6913('0xa')]);router[_0x6913('0xb')]('/',auth[_0x6913('0x6')](),interaction[_0x6913('0xc')]('whatsapp',_0x6913('0xd')),controller['create']);router[_0x6913('0xb')](_0x6913('0xe'),controller[_0x6913('0xf')]);router['put'](_0x6913('0x9'),auth['isAuthenticated'](),controller[_0x6913('0x10')]);router[_0x6913('0x11')]('/:id/accept',auth[_0x6913('0x6')](),controller[_0x6913('0x12')]);router[_0x6913('0x11')](_0x6913('0x13'),auth[_0x6913('0x6')](),controller[_0x6913('0x14')]);router[_0x6913('0x15')](_0x6913('0x9'),auth[_0x6913('0x6')](),controller[_0x6913('0x16')]);module[_0x6913('0x17')]=router;
\ No newline at end of file
+var _0xd228=['accept','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','describe','get','show','tracked','whatsapp','whatsappmessage:create','create','post','put','/:id','update','/:id/accept'];(function(_0x176e9e,_0x3dfe11){var _0x1b675f=function(_0x508167){while(--_0x508167){_0x176e9e['push'](_0x176e9e['shift']());}};_0x1b675f(++_0x3dfe11);}(_0xd228,0x1cd));var _0x8d22=function(_0x52c8e8,_0x5ee20d){_0x52c8e8=_0x52c8e8-0x0;var _0x31bb1a=_0xd228[_0x52c8e8];return _0x31bb1a;};'use strict';var multer=require(_0x8d22('0x0'));var util=require(_0x8d22('0x1'));var path=require(_0x8d22('0x2'));var timeout=require(_0x8d22('0x3'));var express=require(_0x8d22('0x4'));var router=express[_0x8d22('0x5')]();var fs_extra=require(_0x8d22('0x6'));var auth=require(_0x8d22('0x7'));var interaction=require(_0x8d22('0x8'));var config=require(_0x8d22('0x9'));var controller=require(_0x8d22('0xa'));router['get']('/',auth[_0x8d22('0xb')](),controller[_0x8d22('0xc')]);router['get']('/describe',auth[_0x8d22('0xb')](),controller[_0x8d22('0xd')]);router[_0x8d22('0xe')]('/:id',auth[_0x8d22('0xb')](),controller[_0x8d22('0xf')]);router['post']('/',auth[_0x8d22('0xb')](),interaction[_0x8d22('0x10')](_0x8d22('0x11'),_0x8d22('0x12')),controller[_0x8d22('0x13')]);router[_0x8d22('0x14')]('/:id/status',controller['status']);router[_0x8d22('0x15')](_0x8d22('0x16'),auth['isAuthenticated'](),controller[_0x8d22('0x17')]);router[_0x8d22('0x15')](_0x8d22('0x18'),auth[_0x8d22('0xb')](),controller[_0x8d22('0x19')]);router['put']('/:id/reject',auth[_0x8d22('0xb')](),controller['reject']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8d22('0x1a')]);module['exports']=router;
\ No newline at end of file
index a186db9..d9dff16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc03e=['BOOLEAN','TEXT','sequelize','medium','ENUM','out','STRING','DATE'];(function(_0x503785,_0x43b6e2){var _0x3f1604=function(_0x59c5bf){while(--_0x59c5bf){_0x503785['push'](_0x503785['shift']());}};_0x3f1604(++_0x43b6e2);}(_0xc03e,0x15a));var _0xec03=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc03e[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xec03('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xec03('0x2')]('in','out'),'defaultValue':_0xec03('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xec03('0x4')](0xbe)},'phone':{'type':Sequelize[_0xec03('0x4')]},'readAt':{'type':Sequelize[_0xec03('0x5')]},'secret':{'type':Sequelize[_0xec03('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xec03('0x4')]},'providerResponse':{'type':Sequelize[_0xec03('0x7')]}};
\ No newline at end of file
+var _0x7b27=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b27,0x12a));var _0x77b2=function(_0x315d52,_0x4d90a6){_0x315d52=_0x315d52-0x0;var _0x2b339f=_0x7b27[_0x315d52];return _0x2b339f;};'use strict';var Sequelize=require(_0x77b2('0x0'));module[_0x77b2('0x1')]={'body':{'type':Sequelize[_0x77b2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x77b2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x77b2('0x4')]('in',_0x77b2('0x5')),'defaultValue':_0x77b2('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x77b2('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x77b2('0x7')]},'providerResponse':{'type':Sequelize[_0x77b2('0x2')]}};
\ No newline at end of file
index 2132365..c549fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb7=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','end','sendStatus','name','send','index','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','type','filter','options','count','includeAll','include','rows','params','create','body','update','find','destroy','describe','whatsapp-interactions','accept','whatsapp','readAt','UserId','get','WhatsappInteractionId','isNil','format','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','agent','fullname','email','manual','interface','channel','motionChannel','event','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','internal','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x568845,_0x262377){var _0x3a466c=function(_0xb20003){while(--_0xb20003){_0x568845['push'](_0x568845['shift']());}};_0x3a466c(++_0x262377);}(_0xabb7,0x197));var _0x7abb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xabb7[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x7abb('0x0'));var rimraf=require(_0x7abb('0x1'));var zipdir=require(_0x7abb('0x2'));var jsonpatch=require(_0x7abb('0x3'));var rp=require(_0x7abb('0x4'));var moment=require(_0x7abb('0x5'));var BPromise=require(_0x7abb('0x6'));var Mustache=require(_0x7abb('0x7'));var util=require('util');var path=require(_0x7abb('0x8'));var sox=require(_0x7abb('0x9'));var csv=require(_0x7abb('0xa'));var ejs=require(_0x7abb('0xb'));var fs=require('fs');var fs_extra=require(_0x7abb('0xc'));var _=require(_0x7abb('0xd'));var squel=require(_0x7abb('0xe'));var crypto=require(_0x7abb('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7abb('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7abb('0x11'));var Papa=require('papaparse');var Redis=require(_0x7abb('0x12'));var authService=require(_0x7abb('0x13'));var qs=require(_0x7abb('0x14'));var as=require(_0x7abb('0x15'));var hardwareService=require(_0x7abb('0x16'));var logger=require(_0x7abb('0x17'))(_0x7abb('0x18'));var utils=require('../../config/utils');var config=require(_0x7abb('0x19'));var licenseUtil=require(_0x7abb('0x1a'));var db=require(_0x7abb('0x1b'))['db'];config[_0x7abb('0x1c')]=_[_0x7abb('0x1d')](config[_0x7abb('0x1c')],{'host':_0x7abb('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x7abb('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x7abb('0x20')][_0x7abb('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x27aef1,_0x191f47,_0x1d1d54,_0x233eca){return new BPromise(function(_0x3db7bc,_0x22c0e3){var _0x3d3ef3=_0x233eca||client;return _0x3d3ef3[_0x7abb('0x22')](_0x27aef1,_0x1d1d54)['then'](function(_0x573a6a){logger[_0x7abb('0x23')](_0x7abb('0x24'),_0x191f47,'request\x20sent');logger[_0x7abb('0x25')](_0x7abb('0x26'),_0x191f47,_0x7abb('0x27'),JSON[_0x7abb('0x28')](_0x573a6a));if(_0x573a6a[_0x7abb('0x29')]){if(_0x573a6a[_0x7abb('0x29')][_0x7abb('0x2a')]===0x1f4){logger[_0x7abb('0x29')](_0x7abb('0x24'),_0x191f47,_0x573a6a['error'][_0x7abb('0x2b')]);return _0x22c0e3(_0x573a6a['error'][_0x7abb('0x2b')]);}logger[_0x7abb('0x29')](_0x7abb('0x24'),_0x191f47,_0x573a6a[_0x7abb('0x29')][_0x7abb('0x2b')]);return _0x3db7bc(_0x573a6a['error'][_0x7abb('0x2b')]);}else{logger['info'](_0x7abb('0x24'),_0x191f47,_0x7abb('0x27'));_0x3db7bc(_0x573a6a[_0x7abb('0x2c')][_0x7abb('0x2b')]);}})[_0x7abb('0x2d')](function(_0x488b14){logger[_0x7abb('0x29')](_0x7abb('0x24'),_0x191f47,_0x488b14);_0x22c0e3(_0x488b14);});});}function respondWithStatusCode(_0xafcf4b,_0x42e8dd){_0x42e8dd=_0x42e8dd||0xcc;return function(_0x3aedb3){if(_0x3aedb3){return _0xafcf4b['sendStatus'](_0x42e8dd);}return _0xafcf4b[_0x7abb('0x2e')](_0x42e8dd)['end']();};}function respondWithResult(_0x3141c9,_0x252e7f){_0x252e7f=_0x252e7f||0xc8;return function(_0x51f9e8){if(_0x51f9e8){return _0x3141c9[_0x7abb('0x2e')](_0x252e7f)[_0x7abb('0x2f')](_0x51f9e8);}};}function respondWithFilteredResult(_0x15a344,_0x15427a){return function(_0x44efc7){if(_0x44efc7){var _0x38f7ab=typeof _0x15427a[_0x7abb('0x30')]===_0x7abb('0x31')&&typeof _0x15427a[_0x7abb('0x32')]===_0x7abb('0x31');var _0x42d452=_0x44efc7['count'];var _0x5cff72=_0x38f7ab?0x0:_0x15427a[_0x7abb('0x30')];var _0x59299d=_0x38f7ab?_0x44efc7['count']:_0x15427a['offset']+_0x15427a[_0x7abb('0x32')];var _0x30ad92;if(_0x59299d>=_0x42d452){_0x59299d=_0x42d452;_0x30ad92=0xc8;}else{_0x30ad92=0xce;}_0x15a344[_0x7abb('0x2e')](_0x30ad92);return _0x15a344[_0x7abb('0x33')](_0x7abb('0x34'),_0x5cff72+'-'+_0x59299d+'/'+_0x42d452)[_0x7abb('0x2f')](_0x44efc7);}return null;};}function patchUpdates(_0x3fec51){return function(_0xd29a54){try{jsonpatch[_0x7abb('0x35')](_0xd29a54,_0x3fec51,!![]);}catch(_0x2d388c){return BPromise[_0x7abb('0x36')](_0x2d388c);}return _0xd29a54[_0x7abb('0x37')]();};}function saveUpdates(_0x5c5bdc,_0x33d535){return function(_0x40e1e0){if(_0x40e1e0){return _0x40e1e0['update'](_0x5c5bdc)[_0x7abb('0x38')](function(_0x2e2c2c){return _0x2e2c2c;});}return null;};}function removeEntity(_0x1cc787,_0x3f1310){return function(_0x53f31d){if(_0x53f31d){return _0x53f31d['destroy']()['then'](function(){_0x1cc787[_0x7abb('0x2e')](0xcc)[_0x7abb('0x39')]();});}};}function handleEntityNotFound(_0x417d72,_0x296976){return function(_0x3a498e){if(!_0x3a498e){_0x417d72[_0x7abb('0x3a')](0x194);}return _0x3a498e;};}function handleError(_0x4b619a,_0x43939c){_0x43939c=_0x43939c||0x1f4;return function(_0x469be7){logger['error'](_0x469be7['stack']);if(_0x469be7[_0x7abb('0x3b')]){delete _0x469be7['name'];}_0x4b619a[_0x7abb('0x2e')](_0x43939c)[_0x7abb('0x3c')](_0x469be7);};}exports[_0x7abb('0x3d')]=function(_0x56f2fe,_0x27cff3){var _0x32d662={},_0x6a7da0={},_0x493563={'count':0x0,'rows':[]};var _0x5e84f0=_['map'](db[_0x7abb('0x3e')][_0x7abb('0x3f')],function(_0x3874b5){return{'name':_0x3874b5[_0x7abb('0x40')],'type':_0x3874b5['type'][_0x7abb('0x41')]};});_0x6a7da0[_0x7abb('0x42')]=_['map'](_0x5e84f0,'name');_0x6a7da0[_0x7abb('0x43')]=_[_0x7abb('0x44')](_0x56f2fe['query']);_0x6a7da0[_0x7abb('0x45')]=_[_0x7abb('0x46')](_0x6a7da0[_0x7abb('0x42')],_0x6a7da0[_0x7abb('0x43')]);_0x32d662[_0x7abb('0x47')]=_[_0x7abb('0x46')](_0x6a7da0[_0x7abb('0x42')],qs[_0x7abb('0x48')](_0x56f2fe[_0x7abb('0x43')][_0x7abb('0x48')]));_0x32d662[_0x7abb('0x47')]=_0x32d662['attributes'][_0x7abb('0x49')]?_0x32d662[_0x7abb('0x47')]:_0x6a7da0['model'];if(!_0x56f2fe[_0x7abb('0x43')][_0x7abb('0x4a')](_0x7abb('0x4b'))){_0x32d662[_0x7abb('0x32')]=qs[_0x7abb('0x32')](_0x56f2fe['query']['limit']);_0x32d662['offset']=qs[_0x7abb('0x30')](_0x56f2fe[_0x7abb('0x43')][_0x7abb('0x30')]);}_0x32d662[_0x7abb('0x4c')]=qs[_0x7abb('0x4d')](_0x56f2fe[_0x7abb('0x43')][_0x7abb('0x4d')]);_0x32d662['where']=qs[_0x7abb('0x45')](_[_0x7abb('0x4e')](_0x56f2fe[_0x7abb('0x43')],_0x6a7da0[_0x7abb('0x45')]),_0x5e84f0);if(_0x56f2fe[_0x7abb('0x43')]['filter']){_0x32d662[_0x7abb('0x4f')]=_[_0x7abb('0x50')](_0x32d662[_0x7abb('0x4f')],{'$or':_[_0x7abb('0x51')](_0x5e84f0,function(_0x1963ae){if(_0x1963ae[_0x7abb('0x52')]!=='VIRTUAL'){var _0x29b94d={};_0x29b94d[_0x1963ae[_0x7abb('0x3b')]]={'$like':'%'+_0x56f2fe['query'][_0x7abb('0x53')]+'%'};return _0x29b94d;}})});}_0x32d662=_[_0x7abb('0x50')]({},_0x32d662,_0x56f2fe[_0x7abb('0x54')]);var _0x164cba={'where':_0x32d662[_0x7abb('0x4f')]};return db[_0x7abb('0x3e')][_0x7abb('0x55')](_0x164cba)['then'](function(_0x3f03dc){_0x493563[_0x7abb('0x55')]=_0x3f03dc;if(_0x56f2fe['query'][_0x7abb('0x56')]){_0x32d662[_0x7abb('0x57')]=[{'all':!![]}];}return db[_0x7abb('0x3e')]['findAll'](_0x32d662);})[_0x7abb('0x38')](function(_0x278c7c){_0x493563[_0x7abb('0x58')]=_0x278c7c;return _0x493563;})[_0x7abb('0x38')](respondWithFilteredResult(_0x27cff3,_0x32d662))[_0x7abb('0x2d')](handleError(_0x27cff3,null));};exports['show']=function(_0x3857d8,_0x5d67bb){var _0x22c059={'raw':!![],'where':{'id':_0x3857d8[_0x7abb('0x59')]['id']}},_0x434c68={};_0x434c68[_0x7abb('0x42')]=_[_0x7abb('0x44')](db[_0x7abb('0x3e')][_0x7abb('0x3f')]);_0x434c68[_0x7abb('0x43')]=_[_0x7abb('0x44')](_0x3857d8[_0x7abb('0x43')]);_0x434c68['filters']=_[_0x7abb('0x46')](_0x434c68[_0x7abb('0x42')],_0x434c68[_0x7abb('0x43')]);_0x22c059[_0x7abb('0x47')]=_[_0x7abb('0x46')](_0x434c68[_0x7abb('0x42')],qs[_0x7abb('0x48')](_0x3857d8['query'][_0x7abb('0x48')]));_0x22c059[_0x7abb('0x47')]=_0x22c059[_0x7abb('0x47')][_0x7abb('0x49')]?_0x22c059['attributes']:_0x434c68[_0x7abb('0x42')];if(_0x3857d8['query'][_0x7abb('0x56')]){_0x22c059[_0x7abb('0x57')]=[{'all':!![]}];}_0x22c059=_['merge']({},_0x22c059,_0x3857d8[_0x7abb('0x54')]);return db['WhatsappMessage']['find'](_0x22c059)[_0x7abb('0x38')](handleEntityNotFound(_0x5d67bb,null))[_0x7abb('0x38')](respondWithResult(_0x5d67bb,null))['catch'](handleError(_0x5d67bb,null));};exports[_0x7abb('0x5a')]=function(_0x3f9848,_0x399fb5){return db[_0x7abb('0x3e')][_0x7abb('0x5a')](_0x3f9848[_0x7abb('0x5b')],{})[_0x7abb('0x38')](respondWithResult(_0x399fb5,0xc9))[_0x7abb('0x2d')](handleError(_0x399fb5,null));};exports[_0x7abb('0x5c')]=function(_0x4b5bc3,_0x5c4d77){if(_0x4b5bc3[_0x7abb('0x5b')]['id']){delete _0x4b5bc3[_0x7abb('0x5b')]['id'];}return db[_0x7abb('0x3e')][_0x7abb('0x5d')]({'where':{'id':_0x4b5bc3[_0x7abb('0x59')]['id']}})[_0x7abb('0x38')](handleEntityNotFound(_0x5c4d77,null))[_0x7abb('0x38')](saveUpdates(_0x4b5bc3['body'],null))['then'](respondWithResult(_0x5c4d77,null))[_0x7abb('0x2d')](handleError(_0x5c4d77,null));};exports[_0x7abb('0x5e')]=function(_0x45d1a8,_0x30b422){return db[_0x7abb('0x3e')][_0x7abb('0x5d')]({'where':{'id':_0x45d1a8[_0x7abb('0x59')]['id']}})[_0x7abb('0x38')](handleEntityNotFound(_0x30b422,null))[_0x7abb('0x38')](removeEntity(_0x30b422,null))[_0x7abb('0x2d')](handleError(_0x30b422,null));};exports[_0x7abb('0x5f')]=function(_0x26ebbd,_0x251ac5){return db['WhatsappMessage'][_0x7abb('0x5f')]()[_0x7abb('0x38')](respondWithResult(_0x251ac5,null))[_0x7abb('0x2d')](handleError(_0x251ac5,null));};var interaction_log=require('../../config/logger')(_0x7abb('0x60'));exports[_0x7abb('0x61')]=function(_0x535dc9,_0x358db1,_0x70691){var _0x21eb44={'agent':{},'channel':_0x7abb('0x62')};if(_0x535dc9[_0x7abb('0x5b')]['id']){delete _0x535dc9['body']['id'];}_0x535dc9[_0x7abb('0x5b')]['read']=!![];_0x535dc9['body'][_0x7abb('0x63')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x535dc9[_0x7abb('0x5b')][_0x7abb('0x64')]=_0x535dc9['body'][_0x7abb('0x64')]||_0x535dc9['user']['id'];_0x21eb44['agent']['id']=_0x535dc9[_0x7abb('0x5b')]['UserId'];return db[_0x7abb('0x3e')]['find']({'where':{'id':_0x535dc9['params']['id'],'UserId':null}})[_0x7abb('0x38')](handleEntityNotFound(_0x358db1,null))[_0x7abb('0x38')](saveUpdates(_0x535dc9[_0x7abb('0x5b')],null))[_0x7abb('0x38')](function(_0x424ac4){if(_0x424ac4){_0x21eb44['message']=_0x424ac4[_0x7abb('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0x7abb('0x5d')]({'where':{'id':_0x424ac4[_0x7abb('0x66')]}});}return null;})[_0x7abb('0x38')](handleEntityNotFound(_0x358db1,null))['then'](function(_0x280dd8){if(_0x280dd8){return _0x280dd8['update']({'UserId':_0x535dc9[_0x7abb('0x5b')][_0x7abb('0x64')],'read1stAt':_[_0x7abb('0x67')](_0x280dd8['read1stAt'])?moment()[_0x7abb('0x68')](_0x7abb('0x69')):undefined});}return null;})[_0x7abb('0x38')](function(_0x37ab8a){if(_0x37ab8a){_0x21eb44[_0x7abb('0x6a')]=_0x37ab8a[_0x7abb('0x65')]({'plain':!![]});interaction_log[_0x7abb('0x23')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x535dc9[_0x7abb('0x6b')]['id'],_0x535dc9[_0x7abb('0x6b')][_0x7abb('0x3b')],_0x535dc9[_0x7abb('0x6b')][_0x7abb('0x6c')],_0x21eb44[_0x7abb('0x6a')]['id'],_0x535dc9[_0x7abb('0x5b')]?JSON[_0x7abb('0x28')](_0x535dc9[_0x7abb('0x5b')]):'null');return respondWithRpcPromise(_0x7abb('0x6d'),_0x7abb('0x6e'),_0x21eb44);}return null;})[_0x7abb('0x38')](function(_0x4a750d){var _0x3b853f=_0x7abb('0x6f')+_0x4a750d[_0x7abb('0x2b')][_0x7abb('0x70')];return db['sequelize'][_0x7abb('0x43')](_0x3b853f,{'type':db[_0x7abb('0x71')][_0x7abb('0x72')]['SELECT'],'raw':!![]})[_0x7abb('0x38')](function(_0x59d1c5){return _0x59d1c5;});})[_0x7abb('0x38')](function(_0x2562fc){if(_0x2562fc){_0x21eb44['message'][_0x7abb('0x73')]=_0x2562fc[0x0];if(!_0x535dc9[_0x7abb('0x5b')][_0x7abb('0x64')])return;return db[_0x7abb('0x74')]['find']({'where':{'id':_0x535dc9[_0x7abb('0x5b')][_0x7abb('0x64')],'role':_0x7abb('0x75')},'attributes':['id',_0x7abb('0x3b'),_0x7abb('0x76'),_0x7abb('0x77'),'internal'],'raw':!![]});}return null;})[_0x7abb('0x38')](function(_0x365110){if(!_0x365110)return null;_0x21eb44[_0x7abb('0x2b')]['agent']=_0x365110;return _0x21eb44;})[_0x7abb('0x38')](function(_0x10face){if(_0x10face){if(_0x535dc9[_0x7abb('0x5b')][_0x7abb('0x78')]){_0x21eb44[_0x7abb('0x2b')][_0x7abb('0x79')]=util['format']('SIP/%s',_0x535dc9[_0x7abb('0x6b')]['name']);_0x21eb44[_0x7abb('0x2b')][_0x7abb('0x7a')]=_0x21eb44[_0x7abb('0x7a')];_0x21eb44[_0x7abb('0x2b')][_0x7abb('0x7b')]=_0x21eb44[_0x7abb('0x7a')];_0x21eb44[_0x7abb('0x2b')][_0x7abb('0x7c')]='accept';return respondWithRpcPromise(_0x7abb('0x7d'),_0x7abb('0x7d'),{'event':'acceptmessage','message':_0x21eb44[_0x7abb('0x2b')]},client9002)['then'](function(){return _0x21eb44;});}return _0x21eb44;}return null;})['then'](respondWithResult(_0x358db1,null))[_0x7abb('0x2d')](handleError(_0x358db1,null));};var interaction_log=require(_0x7abb('0x17'))(_0x7abb('0x60'));exports[_0x7abb('0x36')]=function(_0x26787f,_0x209965,_0x5b86be){var _0x5bb556={'agent':{},'channel':_0x7abb('0x62')};if(_0x26787f[_0x7abb('0x5b')]['id']){delete _0x26787f[_0x7abb('0x5b')]['id'];}_0x26787f[_0x7abb('0x5b')][_0x7abb('0x64')]=_0x26787f['body'][_0x7abb('0x64')]||_0x26787f[_0x7abb('0x6b')]['id'];_0x5bb556[_0x7abb('0x75')]['id']=_0x26787f[_0x7abb('0x5b')][_0x7abb('0x64')];return db[_0x7abb('0x3e')]['find']({'where':{'id':_0x26787f[_0x7abb('0x59')]['id'],'UserId':null}})[_0x7abb('0x38')](handleEntityNotFound(_0x209965,null))[_0x7abb('0x38')](function(_0x454e17){if(_0x454e17){_0x5bb556['message']=_0x454e17[_0x7abb('0x65')]({'plain':!![]});return db[_0x7abb('0x7e')]['find']({'where':{'id':_0x454e17[_0x7abb('0x66')]}});}return null;})[_0x7abb('0x38')](handleEntityNotFound(_0x209965,null))[_0x7abb('0x38')](function(_0x2f9587){if(_0x2f9587){_0x5bb556[_0x7abb('0x6a')]=_0x2f9587[_0x7abb('0x65')]({'plain':!![]});interaction_log['info'](_0x7abb('0x7f'),_0x26787f[_0x7abb('0x6b')]['id'],_0x26787f[_0x7abb('0x6b')][_0x7abb('0x3b')],_0x26787f[_0x7abb('0x6b')][_0x7abb('0x6c')],_0x5bb556[_0x7abb('0x6a')]['id'],_0x26787f[_0x7abb('0x5b')]?JSON['stringify'](_0x26787f[_0x7abb('0x5b')]):'null');return respondWithRpcPromise(_0x7abb('0x80'),_0x7abb('0x81'),_0x5bb556);}return null;})[_0x7abb('0x38')](function(_0x2db7bd){var _0xd4bf6a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2db7bd['message'][_0x7abb('0x70')];return db['sequelize'][_0x7abb('0x43')](_0xd4bf6a,{'type':db[_0x7abb('0x71')]['QueryTypes'][_0x7abb('0x82')],'raw':!![]})[_0x7abb('0x38')](function(_0x934955){return _0x934955;});})['then'](function(_0x35a10){if(_0x35a10){_0x5bb556['message'][_0x7abb('0x73')]=_0x35a10[0x0];if(!_0x26787f[_0x7abb('0x5b')][_0x7abb('0x64')])return;return db['User'][_0x7abb('0x5d')]({'where':{'id':_0x26787f[_0x7abb('0x5b')][_0x7abb('0x64')],'role':_0x7abb('0x75')},'attributes':['id','name','fullname',_0x7abb('0x77'),_0x7abb('0x83')],'raw':!![]});}return null;})[_0x7abb('0x38')](function(_0x3c561f){if(!_0x3c561f)return null;_0x5bb556[_0x7abb('0x2b')][_0x7abb('0x75')]=_0x3c561f;return _0x5bb556;})[_0x7abb('0x38')](function(_0x203df8){if(_0x203df8){_0x203df8['message'][_0x7abb('0x79')]=util['format']('SIP/%s',_0x26787f[_0x7abb('0x6b')][_0x7abb('0x3b')]);_0x203df8[_0x7abb('0x2b')][_0x7abb('0x7a')]=_0x5bb556[_0x7abb('0x7a')];_0x203df8[_0x7abb('0x2b')]['motionChannel']=_0x5bb556[_0x7abb('0x7a')];_0x203df8[_0x7abb('0x2b')][_0x7abb('0x7c')]=_0x7abb('0x36');respondWithRpcPromise(_0x7abb('0x7d'),_0x7abb('0x7d'),{'event':'rejectmessage','message':_0x203df8[_0x7abb('0x2b')]},client9002);return _0x5bb556;}return null;})[_0x7abb('0x38')](respondWithResult(_0x209965,null))[_0x7abb('0x2d')](handleError(_0x209965,null));};exports[_0x7abb('0x2e')]=function(_0x43adb2,_0x170408,_0x28e13f){if(_0x43adb2[_0x7abb('0x5b')]['id']){delete _0x43adb2[_0x7abb('0x5b')]['id'];}var _0x150dfb;return db[_0x7abb('0x3e')]['find']({'where':{'id':_0x43adb2['params']['id']}})[_0x7abb('0x38')](handleEntityNotFound(_0x170408,null))[_0x7abb('0x38')](function(_0x5b8dd5){if(_0x5b8dd5){_0x150dfb=_0x5b8dd5;return db[_0x7abb('0x84')]['find']({'where':{'id':_0x5b8dd5[_0x7abb('0x85')]}});}})['then'](handleEntityNotFound(_0x170408,null))['then'](function(_0xd18a98){if(_0xd18a98){logger[_0x7abb('0x25')](_0x7abb('0x86'),'status',_0x7abb('0x87'),_0xd18a98[_0x7abb('0x52')],util[_0x7abb('0x88')](_0x43adb2['body'],{'showHidden':![],'depth':null}));switch(_0xd18a98[_0x7abb('0x52')]){case _0x7abb('0x89'):if(_0x43adb2[_0x7abb('0x5b')][_0x7abb('0x8a')]&&_0x43adb2[_0x7abb('0x5b')][_0x7abb('0x8a')]===_0x150dfb[_0x7abb('0x8b')]&&_0x43adb2[_0x7abb('0x5b')][_0x7abb('0x8c')]&&_0x43adb2['body'][_0x7abb('0x8c')]===_0x7abb('0x8d')){return _0x150dfb[_0x7abb('0x5c')]({'read':!![]});}else{logger[_0x7abb('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x7abb('0x2e'),_0x7abb('0x89'),util['inspect'](_0x43adb2['body'],{'showHidden':![],'depth':null}));}break;}return _0x150dfb;}})[_0x7abb('0x38')](respondWithResult(_0x170408,null))['catch'](handleError(_0x170408,null));};
\ No newline at end of file
+var _0x6707=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','User','internal','interface','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','limit','count','offset','apply','reject','update','destroy','sendStatus','stack','name','send','index','type','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','WhatsappMessage','includeAll','include','show','params','model','keys','rawAttributes','find','create','body','describe','accept','whatsapp','read','format','UserId','user','agent','get','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x6707,0x129));var _0x7670=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6707[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7670('0x0'));var jsonpatch=require(_0x7670('0x1'));var rp=require(_0x7670('0x2'));var moment=require(_0x7670('0x3'));var BPromise=require(_0x7670('0x4'));var Mustache=require(_0x7670('0x5'));var util=require(_0x7670('0x6'));var path=require(_0x7670('0x7'));var sox=require(_0x7670('0x8'));var csv=require(_0x7670('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7670('0xa'));var squel=require('squel');var crypto=require(_0x7670('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7670('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7670('0xd'));var Papa=require(_0x7670('0xe'));var Redis=require(_0x7670('0xf'));var authService=require(_0x7670('0x10'));var qs=require(_0x7670('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7670('0x12'));var logger=require(_0x7670('0x13'))('api');var utils=require(_0x7670('0x14'));var config=require(_0x7670('0x15'));var licenseUtil=require(_0x7670('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x7670('0x17')],{'host':_0x7670('0x18'),'port':0x18eb});var socket=require(_0x7670('0x19'))(new Redis(config[_0x7670('0x17')]));require(_0x7670('0x1a'))['register'](socket);var jayson=require(_0x7670('0x1b'));var client=jayson[_0x7670('0x1c')][_0x7670('0x1d')]({'port':0x232c});var client9002=jayson[_0x7670('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc4d519,_0x2b32a6,_0x45d8b9,_0x38b197){return new BPromise(function(_0xcfeb1c,_0x2b11d9){var _0x47409b=_0x38b197||client;return _0x47409b['request'](_0xc4d519,_0x45d8b9)[_0x7670('0x1e')](function(_0x1a3943){logger['info'](_0x7670('0x1f'),_0x2b32a6,_0x7670('0x20'));logger[_0x7670('0x21')](_0x7670('0x22'),_0x2b32a6,_0x7670('0x20'),JSON[_0x7670('0x23')](_0x1a3943));if(_0x1a3943[_0x7670('0x24')]){if(_0x1a3943[_0x7670('0x24')][_0x7670('0x25')]===0x1f4){logger['error'](_0x7670('0x1f'),_0x2b32a6,_0x1a3943[_0x7670('0x24')]['message']);return _0x2b11d9(_0x1a3943[_0x7670('0x24')]['message']);}logger[_0x7670('0x24')](_0x7670('0x1f'),_0x2b32a6,_0x1a3943['error'][_0x7670('0x26')]);return _0xcfeb1c(_0x1a3943[_0x7670('0x24')]['message']);}else{logger[_0x7670('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x2b32a6,'request\x20sent');_0xcfeb1c(_0x1a3943[_0x7670('0x28')][_0x7670('0x26')]);}})[_0x7670('0x29')](function(_0x391f37){logger[_0x7670('0x24')](_0x7670('0x1f'),_0x2b32a6,_0x391f37);_0x2b11d9(_0x391f37);});});}function respondWithStatusCode(_0x2f20f5,_0x3b63d3){_0x3b63d3=_0x3b63d3||0xcc;return function(_0x22ae8c){if(_0x22ae8c){return _0x2f20f5['sendStatus'](_0x3b63d3);}return _0x2f20f5[_0x7670('0x2a')](_0x3b63d3)[_0x7670('0x2b')]();};}function respondWithResult(_0x5b5b81,_0x5045a3){_0x5045a3=_0x5045a3||0xc8;return function(_0x3d0a86){if(_0x3d0a86){return _0x5b5b81[_0x7670('0x2a')](_0x5045a3)[_0x7670('0x2c')](_0x3d0a86);}};}function respondWithFilteredResult(_0x227e60,_0x5ae2c1){return function(_0x39948d){if(_0x39948d){var _0x441626=typeof _0x5ae2c1['offset']===_0x7670('0x2d')&&typeof _0x5ae2c1[_0x7670('0x2e')]==='undefined';var _0x2f08bc=_0x39948d[_0x7670('0x2f')];var _0x18507b=_0x441626?0x0:_0x5ae2c1[_0x7670('0x30')];var _0x5a3d85=_0x441626?_0x39948d[_0x7670('0x2f')]:_0x5ae2c1[_0x7670('0x30')]+_0x5ae2c1['limit'];var _0x47b7aa;if(_0x5a3d85>=_0x2f08bc){_0x5a3d85=_0x2f08bc;_0x47b7aa=0xc8;}else{_0x47b7aa=0xce;}_0x227e60[_0x7670('0x2a')](_0x47b7aa);return _0x227e60['set']('Content-Range',_0x18507b+'-'+_0x5a3d85+'/'+_0x2f08bc)[_0x7670('0x2c')](_0x39948d);}return null;};}function patchUpdates(_0x4a9f91){return function(_0x58b5de){try{jsonpatch[_0x7670('0x31')](_0x58b5de,_0x4a9f91,!![]);}catch(_0x51cd74){return BPromise[_0x7670('0x32')](_0x51cd74);}return _0x58b5de['save']();};}function saveUpdates(_0x1438bf,_0x361dc5){return function(_0x1b650b){if(_0x1b650b){return _0x1b650b[_0x7670('0x33')](_0x1438bf)['then'](function(_0x4c2ba1){return _0x4c2ba1;});}return null;};}function removeEntity(_0x5bc3f7,_0x40516a){return function(_0x7c14e){if(_0x7c14e){return _0x7c14e[_0x7670('0x34')]()[_0x7670('0x1e')](function(){_0x5bc3f7[_0x7670('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ca496,_0x405c3f){return function(_0x3a1104){if(!_0x3a1104){_0x5ca496[_0x7670('0x35')](0x194);}return _0x3a1104;};}function handleError(_0x3414c6,_0x3deb0d){_0x3deb0d=_0x3deb0d||0x1f4;return function(_0x39f3ab){logger[_0x7670('0x24')](_0x39f3ab[_0x7670('0x36')]);if(_0x39f3ab[_0x7670('0x37')]){delete _0x39f3ab[_0x7670('0x37')];}_0x3414c6['status'](_0x3deb0d)[_0x7670('0x38')](_0x39f3ab);};}exports[_0x7670('0x39')]=function(_0x3a05f9,_0x1834c4){var _0xe72b73={},_0x31007c={},_0x300f2f={'count':0x0,'rows':[]};var _0x4d91ea=_['map'](db['WhatsappMessage']['rawAttributes'],function(_0x91c0aa){return{'name':_0x91c0aa['fieldName'],'type':_0x91c0aa[_0x7670('0x3a')]['key']};});_0x31007c['model']=_[_0x7670('0x3b')](_0x4d91ea,_0x7670('0x37'));_0x31007c[_0x7670('0x3c')]=_['keys'](_0x3a05f9[_0x7670('0x3c')]);_0x31007c[_0x7670('0x3d')]=_[_0x7670('0x3e')](_0x31007c['model'],_0x31007c['query']);_0xe72b73[_0x7670('0x3f')]=_[_0x7670('0x3e')](_0x31007c['model'],qs[_0x7670('0x40')](_0x3a05f9[_0x7670('0x3c')]['fields']));_0xe72b73[_0x7670('0x3f')]=_0xe72b73['attributes'][_0x7670('0x41')]?_0xe72b73[_0x7670('0x3f')]:_0x31007c['model'];if(!_0x3a05f9['query'][_0x7670('0x42')](_0x7670('0x43'))){_0xe72b73[_0x7670('0x2e')]=qs['limit'](_0x3a05f9['query'][_0x7670('0x2e')]);_0xe72b73['offset']=qs['offset'](_0x3a05f9[_0x7670('0x3c')][_0x7670('0x30')]);}_0xe72b73[_0x7670('0x44')]=qs[_0x7670('0x45')](_0x3a05f9[_0x7670('0x3c')]['sort']);_0xe72b73[_0x7670('0x46')]=qs[_0x7670('0x3d')](_[_0x7670('0x47')](_0x3a05f9['query'],_0x31007c[_0x7670('0x3d')]),_0x4d91ea);if(_0x3a05f9[_0x7670('0x3c')][_0x7670('0x48')]){_0xe72b73[_0x7670('0x46')]=_[_0x7670('0x49')](_0xe72b73[_0x7670('0x46')],{'$or':_[_0x7670('0x3b')](_0x4d91ea,function(_0x4d80fe){if(_0x4d80fe[_0x7670('0x3a')]!=='VIRTUAL'){var _0x2af6d9={};_0x2af6d9[_0x4d80fe['name']]={'$like':'%'+_0x3a05f9[_0x7670('0x3c')][_0x7670('0x48')]+'%'};return _0x2af6d9;}})});}_0xe72b73=_[_0x7670('0x49')]({},_0xe72b73,_0x3a05f9[_0x7670('0x4a')]);var _0x1c76e9={'where':_0xe72b73[_0x7670('0x46')]};return db[_0x7670('0x4b')][_0x7670('0x2f')](_0x1c76e9)[_0x7670('0x1e')](function(_0x2382af){_0x300f2f[_0x7670('0x2f')]=_0x2382af;if(_0x3a05f9[_0x7670('0x3c')][_0x7670('0x4c')]){_0xe72b73[_0x7670('0x4d')]=[{'all':!![]}];}return db[_0x7670('0x4b')]['findAll'](_0xe72b73);})[_0x7670('0x1e')](function(_0x5b853f){_0x300f2f['rows']=_0x5b853f;return _0x300f2f;})[_0x7670('0x1e')](respondWithFilteredResult(_0x1834c4,_0xe72b73))['catch'](handleError(_0x1834c4,null));};exports[_0x7670('0x4e')]=function(_0x5ea52c,_0x2f9141){var _0x259569={'raw':!![],'where':{'id':_0x5ea52c[_0x7670('0x4f')]['id']}},_0x32d5bb={};_0x32d5bb[_0x7670('0x50')]=_[_0x7670('0x51')](db['WhatsappMessage'][_0x7670('0x52')]);_0x32d5bb[_0x7670('0x3c')]=_[_0x7670('0x51')](_0x5ea52c[_0x7670('0x3c')]);_0x32d5bb[_0x7670('0x3d')]=_[_0x7670('0x3e')](_0x32d5bb['model'],_0x32d5bb[_0x7670('0x3c')]);_0x259569['attributes']=_[_0x7670('0x3e')](_0x32d5bb[_0x7670('0x50')],qs[_0x7670('0x40')](_0x5ea52c[_0x7670('0x3c')][_0x7670('0x40')]));_0x259569[_0x7670('0x3f')]=_0x259569[_0x7670('0x3f')]['length']?_0x259569[_0x7670('0x3f')]:_0x32d5bb['model'];if(_0x5ea52c[_0x7670('0x3c')][_0x7670('0x4c')]){_0x259569[_0x7670('0x4d')]=[{'all':!![]}];}_0x259569=_[_0x7670('0x49')]({},_0x259569,_0x5ea52c[_0x7670('0x4a')]);return db['WhatsappMessage'][_0x7670('0x53')](_0x259569)[_0x7670('0x1e')](handleEntityNotFound(_0x2f9141,null))[_0x7670('0x1e')](respondWithResult(_0x2f9141,null))[_0x7670('0x29')](handleError(_0x2f9141,null));};exports[_0x7670('0x54')]=function(_0x48030c,_0x4a0c43){return db[_0x7670('0x4b')][_0x7670('0x54')](_0x48030c['body'],{})[_0x7670('0x1e')](respondWithResult(_0x4a0c43,0xc9))[_0x7670('0x29')](handleError(_0x4a0c43,null));};exports[_0x7670('0x33')]=function(_0x1ad6e9,_0xe0c20f){if(_0x1ad6e9[_0x7670('0x55')]['id']){delete _0x1ad6e9[_0x7670('0x55')]['id'];}return db[_0x7670('0x4b')][_0x7670('0x53')]({'where':{'id':_0x1ad6e9[_0x7670('0x4f')]['id']}})[_0x7670('0x1e')](handleEntityNotFound(_0xe0c20f,null))[_0x7670('0x1e')](saveUpdates(_0x1ad6e9['body'],null))[_0x7670('0x1e')](respondWithResult(_0xe0c20f,null))[_0x7670('0x29')](handleError(_0xe0c20f,null));};exports[_0x7670('0x34')]=function(_0x1e242e,_0x3c8f2b){return db['WhatsappMessage'][_0x7670('0x53')]({'where':{'id':_0x1e242e[_0x7670('0x4f')]['id']}})[_0x7670('0x1e')](handleEntityNotFound(_0x3c8f2b,null))[_0x7670('0x1e')](removeEntity(_0x3c8f2b,null))[_0x7670('0x29')](handleError(_0x3c8f2b,null));};exports[_0x7670('0x56')]=function(_0xbfa1aa,_0x4275e1){return db[_0x7670('0x4b')][_0x7670('0x56')]()[_0x7670('0x1e')](respondWithResult(_0x4275e1,null))[_0x7670('0x29')](handleError(_0x4275e1,null));};var interaction_log=require(_0x7670('0x13'))('whatsapp-interactions');exports[_0x7670('0x57')]=function(_0x225e1c,_0x34cf42,_0x9217cd){var _0x443c2b={'agent':{},'channel':_0x7670('0x58')};if(_0x225e1c[_0x7670('0x55')]['id']){delete _0x225e1c[_0x7670('0x55')]['id'];}_0x225e1c[_0x7670('0x55')][_0x7670('0x59')]=!![];_0x225e1c[_0x7670('0x55')]['readAt']=moment()[_0x7670('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x225e1c[_0x7670('0x55')][_0x7670('0x5b')]=_0x225e1c[_0x7670('0x55')][_0x7670('0x5b')]||_0x225e1c[_0x7670('0x5c')]['id'];_0x443c2b[_0x7670('0x5d')]['id']=_0x225e1c[_0x7670('0x55')][_0x7670('0x5b')];return db[_0x7670('0x4b')][_0x7670('0x53')]({'where':{'id':_0x225e1c[_0x7670('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34cf42,null))[_0x7670('0x1e')](saveUpdates(_0x225e1c['body'],null))[_0x7670('0x1e')](function(_0x15753b){if(_0x15753b){_0x443c2b[_0x7670('0x26')]=_0x15753b[_0x7670('0x5e')]({'plain':!![]});return db['WhatsappInteraction'][_0x7670('0x53')]({'where':{'id':_0x15753b[_0x7670('0x5f')]}});}return null;})[_0x7670('0x1e')](handleEntityNotFound(_0x34cf42,null))[_0x7670('0x1e')](function(_0x451445){if(_0x451445){return _0x451445[_0x7670('0x33')]({'UserId':_0x225e1c[_0x7670('0x55')][_0x7670('0x5b')],'read1stAt':_['isNil'](_0x451445[_0x7670('0x60')])?moment()[_0x7670('0x5a')](_0x7670('0x61')):undefined});}return null;})[_0x7670('0x1e')](function(_0x3d0ecd){if(_0x3d0ecd){_0x443c2b[_0x7670('0x62')]=_0x3d0ecd[_0x7670('0x5e')]({'plain':!![]});interaction_log[_0x7670('0x27')](_0x7670('0x63'),_0x225e1c['user']['id'],_0x225e1c[_0x7670('0x5c')][_0x7670('0x37')],_0x225e1c['user']['role'],_0x443c2b['interaction']['id'],_0x225e1c[_0x7670('0x55')]?JSON['stringify'](_0x225e1c[_0x7670('0x55')]):_0x7670('0x64'));return respondWithRpcPromise('AcceptMessage',_0x7670('0x65'),_0x443c2b);}return null;})[_0x7670('0x1e')](function(_0x50233b){var _0x4bc8ff=_0x7670('0x66')+_0x50233b['message']['ContactId'];return db[_0x7670('0x67')][_0x7670('0x3c')](_0x4bc8ff,{'type':db[_0x7670('0x68')][_0x7670('0x69')][_0x7670('0x6a')],'raw':!![]})[_0x7670('0x1e')](function(_0x4f0804){return _0x4f0804;});})[_0x7670('0x1e')](function(_0x52cc6d){if(_0x52cc6d){_0x443c2b[_0x7670('0x26')][_0x7670('0x6b')]=_0x52cc6d[0x0];if(!_0x225e1c['body']['UserId'])return;return db['User'][_0x7670('0x53')]({'where':{'id':_0x225e1c['body'][_0x7670('0x5b')],'role':_0x7670('0x5d')},'attributes':['id',_0x7670('0x37'),_0x7670('0x6c'),_0x7670('0x6d'),'internal'],'raw':!![]});}return null;})[_0x7670('0x1e')](function(_0x42f244){if(!_0x42f244)return null;_0x443c2b[_0x7670('0x26')]['agent']=_0x42f244;return _0x443c2b;})[_0x7670('0x1e')](function(_0x45f8ff){if(_0x45f8ff){if(_0x225e1c['body'][_0x7670('0x6e')]){_0x443c2b['message']['interface']=util['format'](_0x7670('0x6f'),_0x225e1c[_0x7670('0x5c')][_0x7670('0x37')]);_0x443c2b['message'][_0x7670('0x70')]=_0x443c2b['channel'];_0x443c2b[_0x7670('0x26')][_0x7670('0x71')]=_0x443c2b['channel'];_0x443c2b[_0x7670('0x26')]['event']='accept';return respondWithRpcPromise('EventManager',_0x7670('0x72'),{'event':_0x7670('0x73'),'message':_0x443c2b[_0x7670('0x26')]},client9002)[_0x7670('0x1e')](function(){return _0x443c2b;});}return _0x443c2b;}return null;})[_0x7670('0x1e')](respondWithResult(_0x34cf42,null))[_0x7670('0x29')](handleError(_0x34cf42,null));};var interaction_log=require(_0x7670('0x13'))(_0x7670('0x74'));exports['reject']=function(_0x25700a,_0x87564c,_0x4483d8){var _0x103bb8={'agent':{},'channel':_0x7670('0x58')};if(_0x25700a[_0x7670('0x55')]['id']){delete _0x25700a[_0x7670('0x55')]['id'];}_0x25700a[_0x7670('0x55')][_0x7670('0x5b')]=_0x25700a[_0x7670('0x55')][_0x7670('0x5b')]||_0x25700a['user']['id'];_0x103bb8[_0x7670('0x5d')]['id']=_0x25700a[_0x7670('0x55')]['UserId'];return db[_0x7670('0x4b')][_0x7670('0x53')]({'where':{'id':_0x25700a[_0x7670('0x4f')]['id'],'UserId':null}})[_0x7670('0x1e')](handleEntityNotFound(_0x87564c,null))[_0x7670('0x1e')](function(_0x16fa7e){if(_0x16fa7e){_0x103bb8[_0x7670('0x26')]=_0x16fa7e[_0x7670('0x5e')]({'plain':!![]});return db['WhatsappInteraction'][_0x7670('0x53')]({'where':{'id':_0x16fa7e[_0x7670('0x5f')]}});}return null;})[_0x7670('0x1e')](handleEntityNotFound(_0x87564c,null))[_0x7670('0x1e')](function(_0x2f2d6a){if(_0x2f2d6a){_0x103bb8[_0x7670('0x62')]=_0x2f2d6a[_0x7670('0x5e')]({'plain':!![]});interaction_log[_0x7670('0x27')](_0x7670('0x75'),_0x25700a[_0x7670('0x5c')]['id'],_0x25700a['user']['name'],_0x25700a['user'][_0x7670('0x76')],_0x103bb8[_0x7670('0x62')]['id'],_0x25700a[_0x7670('0x55')]?JSON[_0x7670('0x23')](_0x25700a[_0x7670('0x55')]):'null');return respondWithRpcPromise(_0x7670('0x77'),'rejectMessage',_0x103bb8);}return null;})['then'](function(_0x330d24){var _0x531b6d=_0x7670('0x66')+_0x330d24[_0x7670('0x26')]['ContactId'];return db[_0x7670('0x67')]['query'](_0x531b6d,{'type':db['Sequelize'][_0x7670('0x69')][_0x7670('0x6a')],'raw':!![]})[_0x7670('0x1e')](function(_0x1cce89){return _0x1cce89;});})['then'](function(_0xe5117d){if(_0xe5117d){_0x103bb8[_0x7670('0x26')][_0x7670('0x6b')]=_0xe5117d[0x0];if(!_0x25700a['body'][_0x7670('0x5b')])return;return db[_0x7670('0x78')]['find']({'where':{'id':_0x25700a['body']['UserId'],'role':_0x7670('0x5d')},'attributes':['id','name',_0x7670('0x6c'),'email',_0x7670('0x79')],'raw':!![]});}return null;})[_0x7670('0x1e')](function(_0x339da9){if(!_0x339da9)return null;_0x103bb8['message'][_0x7670('0x5d')]=_0x339da9;return _0x103bb8;})['then'](function(_0x58f917){if(_0x58f917){_0x58f917['message'][_0x7670('0x7a')]=util['format'](_0x7670('0x6f'),_0x25700a['user'][_0x7670('0x37')]);_0x58f917['message']['channel']=_0x103bb8['channel'];_0x58f917[_0x7670('0x26')][_0x7670('0x71')]=_0x103bb8[_0x7670('0x70')];_0x58f917[_0x7670('0x26')][_0x7670('0x7b')]=_0x7670('0x32');respondWithRpcPromise(_0x7670('0x72'),_0x7670('0x72'),{'event':'rejectmessage','message':_0x58f917[_0x7670('0x26')]},client9002);return _0x103bb8;}return null;})[_0x7670('0x1e')](respondWithResult(_0x87564c,null))[_0x7670('0x29')](handleError(_0x87564c,null));};exports[_0x7670('0x2a')]=function(_0x393d32,_0x18ebfd,_0x18c556){if(_0x393d32[_0x7670('0x55')]['id']){delete _0x393d32[_0x7670('0x55')]['id'];}var _0x52cdd6;return db[_0x7670('0x4b')][_0x7670('0x53')]({'where':{'id':_0x393d32['params']['id']}})['then'](handleEntityNotFound(_0x18ebfd,null))[_0x7670('0x1e')](function(_0x53f032){if(_0x53f032){_0x52cdd6=_0x53f032;return db[_0x7670('0x7c')]['find']({'where':{'id':_0x53f032[_0x7670('0x7d')]}});}})[_0x7670('0x1e')](handleEntityNotFound(_0x18ebfd,null))[_0x7670('0x1e')](function(_0xcdd28a){if(_0xcdd28a){logger[_0x7670('0x21')](_0x7670('0x7e'),_0x7670('0x2a'),'received\x20delivery\x20report\x20from',_0xcdd28a[_0x7670('0x3a')],util[_0x7670('0x7f')](_0x393d32[_0x7670('0x55')],{'showHidden':![],'depth':null}));switch(_0xcdd28a[_0x7670('0x3a')]){case _0x7670('0x80'):if(_0x393d32[_0x7670('0x55')][_0x7670('0x81')]&&_0x393d32[_0x7670('0x55')][_0x7670('0x81')]===_0x52cdd6[_0x7670('0x82')]&&_0x393d32[_0x7670('0x55')][_0x7670('0x83')]&&_0x393d32[_0x7670('0x55')][_0x7670('0x83')]===_0x7670('0x59')){return _0x52cdd6[_0x7670('0x33')]({'read':!![]});}else{logger[_0x7670('0x24')](_0x7670('0x84'),_0x7670('0x2a'),_0x7670('0x80'),util['inspect'](_0x393d32[_0x7670('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x52cdd6;}})[_0x7670('0x1e')](respondWithResult(_0x18ebfd,null))[_0x7670('0x29')](handleError(_0x18ebfd,null));};
\ No newline at end of file
index 0dc7038..0e202ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7072=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x5de390,_0x3b9908){var _0x12bf75=function(_0x2d382f){while(--_0x2d382f){_0x5de390['push'](_0x5de390['shift']());}};_0x12bf75(++_0x3b9908);}(_0x7072,0x138));var _0x2707=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x7072[_0x5a79e2];return _0x266c45;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2707('0x0'))['db'][_0x2707('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2707('0x2')](0x0);var events={'afterCreate':_0x2707('0x3'),'afterUpdate':_0x2707('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5af54f){return function(_0xfdfa7a,_0x5f3c1c,_0xd36287){WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f+':'+_0xfdfa7a['id'],_0xfdfa7a);WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f,_0xfdfa7a);_0xd36287(null);};}for(var e in events){if(events[_0x2707('0x6')](e)){var event=events[e];WhatsappMessage[_0x2707('0x7')](e,emitEvent(event));}}module[_0x2707('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x1bc6=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x437d00,_0x4bb576){var _0x18d119=function(_0x4834da){while(--_0x4834da){_0x437d00['push'](_0x437d00['shift']());}};_0x18d119(++_0x4bb576);}(_0x1bc6,0x94));var _0x61bc=function(_0x25bdd8,_0x5a427b){_0x25bdd8=_0x25bdd8-0x0;var _0x1d57f5=_0x1bc6[_0x25bdd8];return _0x1d57f5;};'use strict';var EventEmitter=require(_0x61bc('0x0'));var WhatsappMessage=require(_0x61bc('0x1'))['db'][_0x61bc('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x61bc('0x3')](0x0);var events={'afterCreate':_0x61bc('0x4'),'afterUpdate':_0x61bc('0x5'),'afterDestroy':_0x61bc('0x6')};function emitEvent(_0x4c6252){return function(_0x2f54e3,_0x364993,_0x344a7){WhatsappMessageEvents[_0x61bc('0x7')](_0x4c6252+':'+_0x2f54e3['id'],_0x2f54e3);WhatsappMessageEvents[_0x61bc('0x7')](_0x4c6252,_0x2f54e3);_0x344a7(null);};}for(var e in events){if(events[_0x61bc('0x8')](e)){var event=events[e];WhatsappMessage[_0x61bc('0x9')](e,emitEvent(event));}}module[_0x61bc('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
index 58a28c2..fa69f82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc856=['statuses','catch','err','WhatsappMessage,\x20%s','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','out','isNil','UserId','findOne','WhatsappInteractionId','createdAt','toLowerCase','error','secret','WhatsappAccount','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','body','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','Bearer\x20','application/json','message_id','update'];(function(_0x3b53bc,_0x136046){var _0xdeabb9=function(_0x57ac3a){while(--_0x57ac3a){_0x3b53bc['push'](_0x3b53bc['shift']());}};_0xdeabb9(++_0x136046);}(_0xc856,0x1a9));var _0x6c85=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xc856[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x6c85('0x0'));var util=require(_0x6c85('0x1'));var logger=require(_0x6c85('0x2'))(_0x6c85('0x3'));var moment=require(_0x6c85('0x4'));var BPromise=require(_0x6c85('0x5'));var rp=require('request-promise');var fetch=require(_0x6c85('0x6'));var fs=require('fs');var path=require(_0x6c85('0x7'));var rimraf=require(_0x6c85('0x8'));var config=require('../../config/environment');var attributes=require(_0x6c85('0x9'));module[_0x6c85('0xa')]=function(_0x3105c6,_0x5ed134){return _0x3105c6[_0x6c85('0xb')](_0x6c85('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x6c85('0xd')]},{'name':_0x6c85('0xe'),'fields':['body'],'type':_0x6c85('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4eaa59,_0x5c9819,_0x6e6777){var _0x2521be=_0x3105c6[_0x6c85('0x10')];var _0xca35eb=_0x4eaa59['get']({'plain':!![]});if(_0xca35eb['direction']['toLowerCase']()==='in'||_0xca35eb[_0x6c85('0x11')]['toLowerCase']()===_0x6c85('0x12')&&!_0xca35eb['secret']&&!_[_0x6c85('0x13')](_0xca35eb[_0x6c85('0x14')])){_0x2521be['WhatsappInteraction'][_0x6c85('0x15')]({'where':{'id':_0xca35eb[_0x6c85('0x16')]}})['then'](function(_0x3adc05){if(_0x3adc05){_0x3adc05['update']({'lastMsgAt':_0xca35eb[_0x6c85('0x17')],'lastMsgDirection':_0xca35eb[_0x6c85('0x11')][_0x6c85('0x18')]()});}})['catch'](function(_0x50c182){console[_0x6c85('0x19')](_0x50c182);});}if(_0xca35eb['direction']===_0x6c85('0x12')&&!_0xca35eb[_0x6c85('0x1a')]){var _0x244573;_0x2521be[_0x6c85('0x1b')]['find']({'where':{'id':_0xca35eb[_0x6c85('0x1c')]},'raw':!![]})[_0x6c85('0x1d')](function(_0x33725f){_0x244573=_0x33725f;if(_0x244573&&_0x244573[_0x6c85('0x1e')]){switch(_0x244573['type']){case _0x6c85('0x1f'):var _0x363778=require(_0x6c85('0x1f'));if(_0x244573[_0x6c85('0x20')]&&_0x244573['authToken']&&_0x244573['phone']){var _0x2dd764=new _0x363778(_0x244573[_0x6c85('0x20')],_0x244573[_0x6c85('0x21')]);_0x2dd764[_0x6c85('0x22')][_0x6c85('0x23')]({'body':_0xca35eb[_0x6c85('0x24')],'to':_0x6c85('0x25')+_0xca35eb['phone'],'from':_0x6c85('0x25')+_0x244573[_0x6c85('0x26')],'statusCallback':_0x244573['remote']+_0x6c85('0x27')+_0xca35eb['id']+_0x6c85('0x28')+_0x244573[_0x6c85('0x29')]})[_0x6c85('0x1d')](function(_0x31ebc7){if(_0x31ebc7[_0x6c85('0x2a')]){return _0x4eaa59['update']({'messageId':_0x31ebc7['sid']});}})['catch'](function(_0x410737){logger[_0x6c85('0x19')](_0x6c85('0x2b'),_0x6c85('0x2c'),_0x6c85('0x1f'),util[_0x6c85('0x2d')](_0x410737,{'showHidden':![],'depth':null}));});}else{logger[_0x6c85('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x6c85('0x2c'),_0x6c85('0x1f'),_0x6c85('0x2e'));}break;case _0x6c85('0x2f'):var _0x358ea9=_0x244573[_0x6c85('0x20')];var _0x55286c=_0x244573['authToken'];var _0x3183b4=_0x244573[_0x6c85('0x30')]+'/whatsapp/v1/'+_0x358ea9+_0x6c85('0x31');var _0x22dba6={'to':[_0xca35eb[_0x6c85('0x26')]],'message':{'type':_0x6c85('0x32'),'text':_0xca35eb[_0x6c85('0x24')]}};var _0x4bb305={'method':'POST','uri':_0x3183b4,'headers':{'Authorization':_0x6c85('0x33')+_0x55286c,'Content-Type':_0x6c85('0x34')},'body':_0x22dba6,'json':!![]};rp(_0x4bb305)['then'](function(_0x27f3b0){if(_0x27f3b0['statuses'][0x0][_0x6c85('0x35')]){return _0x4eaa59[_0x6c85('0x36')]({'messageId':_0x27f3b0[_0x6c85('0x37')][0x0]['message_id']});}})[_0x6c85('0x38')](function(_0x43b748){logger[_0x6c85('0x39')](_0x6c85('0x3a'),_0x43b748);});break;}}})['finally'](function(){_0x6e6777();});}else{_0x6e6777();}}},'charset':_0x6c85('0x3b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x18b8=['authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','out','secret','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','toLowerCase','catch','error','WhatsappAccount','WhatsappAccountId','then','type','twilio','accountSid','phone'];(function(_0x58c34b,_0x5cf4c5){var _0x5a4f2e=function(_0x46c310){while(--_0x46c310){_0x58c34b['push'](_0x58c34b['shift']());}};_0x5a4f2e(++_0x5cf4c5);}(_0x18b8,0x10e));var _0x818b=function(_0x581862,_0x35688b){_0x581862=_0x581862-0x0;var _0x198a6f=_0x18b8[_0x581862];return _0x198a6f;};'use strict';var _=require(_0x818b('0x0'));var util=require(_0x818b('0x1'));var logger=require(_0x818b('0x2'))('api');var moment=require(_0x818b('0x3'));var BPromise=require(_0x818b('0x4'));var rp=require(_0x818b('0x5'));var fetch=require(_0x818b('0x6'));var fs=require('fs');var path=require(_0x818b('0x7'));var rimraf=require(_0x818b('0x8'));var config=require(_0x818b('0x9'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x255bda,_0x4e9167){return _0x255bda[_0x818b('0xa')]('WhatsappMessage',attributes,{'tableName':_0x818b('0xb'),'paranoid':![],'indexes':[{'name':_0x818b('0xc'),'fields':[_0x818b('0xc')]},{'name':_0x818b('0xd'),'fields':[_0x818b('0xe')],'type':_0x818b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f9e20,_0x1bd9cb,_0x94ecdf){var _0x1a8d60=_0x255bda['models'];var _0x1b4131=_0x1f9e20[_0x818b('0x10')]({'plain':!![]});if(_0x1b4131[_0x818b('0x11')]['toLowerCase']()==='in'||_0x1b4131[_0x818b('0x11')]['toLowerCase']()===_0x818b('0x12')&&!_0x1b4131[_0x818b('0x13')]&&!_['isNil'](_0x1b4131['UserId'])){_0x1a8d60[_0x818b('0x14')][_0x818b('0x15')]({'where':{'id':_0x1b4131[_0x818b('0x16')]}})['then'](function(_0x40cfd2){if(_0x40cfd2){_0x40cfd2[_0x818b('0x17')]({'lastMsgAt':_0x1b4131[_0x818b('0x18')],'lastMsgDirection':_0x1b4131[_0x818b('0x11')][_0x818b('0x19')]()});}})[_0x818b('0x1a')](function(_0x39423a){console[_0x818b('0x1b')](_0x39423a);});}if(_0x1b4131[_0x818b('0x11')]===_0x818b('0x12')&&!_0x1b4131[_0x818b('0x13')]){var _0x17387d;_0x1a8d60[_0x818b('0x1c')]['find']({'where':{'id':_0x1b4131[_0x818b('0x1d')]},'raw':!![]})[_0x818b('0x1e')](function(_0x560fa5){_0x17387d=_0x560fa5;if(_0x17387d&&_0x17387d[_0x818b('0x1f')]){switch(_0x17387d[_0x818b('0x1f')]){case _0x818b('0x20'):var _0x27273a=require('twilio');if(_0x17387d[_0x818b('0x21')]&&_0x17387d['authToken']&&_0x17387d[_0x818b('0x22')]){var _0xd77292=new _0x27273a(_0x17387d[_0x818b('0x21')],_0x17387d[_0x818b('0x23')]);_0xd77292[_0x818b('0x24')][_0x818b('0x25')]({'body':_0x1b4131[_0x818b('0xe')],'to':_0x818b('0x26')+_0x1b4131[_0x818b('0x22')],'from':_0x818b('0x26')+_0x17387d[_0x818b('0x22')],'statusCallback':_0x17387d[_0x818b('0x27')]+_0x818b('0x28')+_0x1b4131['id']+_0x818b('0x29')+_0x17387d[_0x818b('0x2a')]})[_0x818b('0x1e')](function(_0x2f5858){if(_0x2f5858[_0x818b('0x2b')]){return _0x1f9e20[_0x818b('0x17')]({'messageId':_0x2f5858[_0x818b('0x2b')]});}})['catch'](function(_0x157d32){logger[_0x818b('0x1b')](_0x818b('0x2c'),_0x818b('0x2d'),'twilio',util[_0x818b('0x2e')](_0x157d32,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x818b('0x2c'),_0x818b('0x2d'),_0x818b('0x20'),_0x818b('0x2f'));}break;case'sinch':var _0x4c5530=_0x17387d['accountSid'];var _0x3bcef1=_0x17387d['authToken'];var _0x1d35bb=_0x17387d[_0x818b('0x30')]+_0x818b('0x31')+_0x4c5530+_0x818b('0x32');var _0x1a9195={'to':[_0x1b4131['phone']],'message':{'type':_0x818b('0x33'),'text':_0x1b4131[_0x818b('0xe')]}};var _0x5235c6={'method':'POST','uri':_0x1d35bb,'headers':{'Authorization':_0x818b('0x34')+_0x3bcef1,'Content-Type':_0x818b('0x35')},'body':_0x1a9195,'json':!![]};rp(_0x5235c6)[_0x818b('0x1e')](function(_0x3d680a){if(_0x3d680a[_0x818b('0x36')][0x0][_0x818b('0x37')]){return _0x1f9e20[_0x818b('0x17')]({'messageId':_0x3d680a[_0x818b('0x36')][0x0][_0x818b('0x37')]});}})[_0x818b('0x1a')](function(_0x36528d){logger[_0x818b('0x38')](_0x818b('0x39'),_0x36528d);});break;}}})[_0x818b('0x3a')](function(){_0x94ecdf();});}else{_0x94ecdf();}}},'charset':_0x818b('0x3b'),'collate':_0x818b('0x3c')});};
\ No newline at end of file
index a5f44c5..b5ae2f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ed2=['create','body','options','raw','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateWhatsappMessage','WhatsappMessage'];(function(_0x46c30c,_0x1ac896){var _0x45c5c1=function(_0x21ad77){while(--_0x21ad77){_0x46c30c['push'](_0x46c30c['shift']());}};_0x45c5c1(++_0x1ac896);}(_0x3ed2,0x1c5));var _0x23ed=function(_0x39954b,_0x498d8e){_0x39954b=_0x39954b-0x0;var _0xccce60=_0x3ed2[_0x39954b];return _0xccce60;};'use strict';var _=require(_0x23ed('0x0'));var util=require(_0x23ed('0x1'));var moment=require(_0x23ed('0x2'));var BPromise=require('bluebird');var rs=require(_0x23ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23ed('0x5'));var config=require('../../config/environment');var jayson=require(_0x23ed('0x6'));var client=jayson[_0x23ed('0x7')]['http']({'port':0x232a});config[_0x23ed('0x8')]=_[_0x23ed('0x9')](config[_0x23ed('0x8')],{'host':_0x23ed('0xa'),'port':0x18eb});var socket=require(_0x23ed('0xb'))(new Redis(config[_0x23ed('0x8')]));require(_0x23ed('0xc'))[_0x23ed('0xd')](socket);function respondWithRpcPromise(_0x12e232,_0x3a3b6c,_0x32dc7f){return new BPromise(function(_0x10ff78,_0x362bcf){return client[_0x23ed('0xe')](_0x12e232,_0x32dc7f)[_0x23ed('0xf')](function(_0x195c6b){logger[_0x23ed('0x10')](_0x23ed('0x11'),_0x3a3b6c,_0x23ed('0x12'));logger[_0x23ed('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3a3b6c,_0x23ed('0x12'),JSON[_0x23ed('0x14')](_0x195c6b));if(_0x195c6b[_0x23ed('0x15')]){if(_0x195c6b['error'][_0x23ed('0x16')]===0x1f4){logger[_0x23ed('0x15')](_0x23ed('0x11'),_0x3a3b6c,_0x195c6b['error']['message']);return _0x362bcf(_0x195c6b['error'][_0x23ed('0x17')]);}logger[_0x23ed('0x15')](_0x23ed('0x11'),_0x3a3b6c,_0x195c6b[_0x23ed('0x15')][_0x23ed('0x17')]);return _0x10ff78(_0x195c6b['error'][_0x23ed('0x17')]);}else{logger[_0x23ed('0x10')](_0x23ed('0x11'),_0x3a3b6c,_0x23ed('0x12'));_0x10ff78(_0x195c6b[_0x23ed('0x18')]['message']);}})['catch'](function(_0x536c50){logger[_0x23ed('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x3a3b6c,_0x536c50);_0x362bcf(_0x536c50);});});}exports[_0x23ed('0x19')]=function(_0x1a86d4){var _0x2c3f3f=this;return new Promise(function(_0x151aba,_0x15269c){return db[_0x23ed('0x1a')][_0x23ed('0x1b')](_0x1a86d4[_0x23ed('0x1c')],{'raw':_0x1a86d4['options']?_0x1a86d4[_0x23ed('0x1d')][_0x23ed('0x1e')]===undefined?!![]:![]:!![]})[_0x23ed('0xf')](function(_0x21bbb5){logger[_0x23ed('0x10')](_0x23ed('0x19'),_0x1a86d4);logger[_0x23ed('0x13')](_0x23ed('0x19'),_0x1a86d4,JSON[_0x23ed('0x14')](_0x21bbb5));_0x151aba(_0x21bbb5);})[_0x23ed('0x1f')](function(_0x3ceef3){logger[_0x23ed('0x15')](_0x23ed('0x19'),_0x3ceef3[_0x23ed('0x17')],_0x1a86d4);_0x15269c(_0x2c3f3f['error'](0x1f4,_0x3ceef3[_0x23ed('0x17')]));});});};
\ No newline at end of file
+var _0x51b8=['redis','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost'];(function(_0x117b2a,_0x2d36c0){var _0x5ae202=function(_0x40028a){while(--_0x40028a){_0x117b2a['push'](_0x117b2a['shift']());}};_0x5ae202(++_0x2d36c0);}(_0x51b8,0x8c));var _0x851b=function(_0x1e89c3,_0xb8c07f){_0x1e89c3=_0x1e89c3-0x0;var _0x23096d=_0x51b8[_0x1e89c3];return _0x23096d;};'use strict';var _=require(_0x851b('0x0'));var util=require(_0x851b('0x1'));var moment=require(_0x851b('0x2'));var BPromise=require(_0x851b('0x3'));var rs=require(_0x851b('0x4'));var fs=require('fs');var Redis=require(_0x851b('0x5'));var db=require(_0x851b('0x6'))['db'];var utils=require(_0x851b('0x7'));var logger=require(_0x851b('0x8'))('rpc');var config=require(_0x851b('0x9'));var jayson=require(_0x851b('0xa'));var client=jayson[_0x851b('0xb')][_0x851b('0xc')]({'port':0x232a});config['redis']=_[_0x851b('0xd')](config['redis'],{'host':_0x851b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x851b('0xf')]));require(_0x851b('0x10'))[_0x851b('0x11')](socket);function respondWithRpcPromise(_0x405161,_0x379ebe,_0x203833){return new BPromise(function(_0x42a6fd,_0x2965fc){return client['request'](_0x405161,_0x203833)['then'](function(_0x164b7e){logger[_0x851b('0x12')](_0x851b('0x13'),_0x379ebe,_0x851b('0x14'));logger['debug'](_0x851b('0x15'),_0x379ebe,_0x851b('0x14'),JSON[_0x851b('0x16')](_0x164b7e));if(_0x164b7e[_0x851b('0x17')]){if(_0x164b7e[_0x851b('0x17')][_0x851b('0x18')]===0x1f4){logger[_0x851b('0x17')](_0x851b('0x13'),_0x379ebe,_0x164b7e['error']['message']);return _0x2965fc(_0x164b7e[_0x851b('0x17')][_0x851b('0x19')]);}logger[_0x851b('0x17')](_0x851b('0x13'),_0x379ebe,_0x164b7e[_0x851b('0x17')][_0x851b('0x19')]);return _0x42a6fd(_0x164b7e[_0x851b('0x17')][_0x851b('0x19')]);}else{logger['info'](_0x851b('0x13'),_0x379ebe,'request\x20sent');_0x42a6fd(_0x164b7e['result'][_0x851b('0x19')]);}})[_0x851b('0x1a')](function(_0x5399a4){logger[_0x851b('0x17')](_0x851b('0x13'),_0x379ebe,_0x5399a4);_0x2965fc(_0x5399a4);});});}exports[_0x851b('0x1b')]=function(_0x5808f8){var _0x39a2d3=this;return new Promise(function(_0x39e1e8,_0x37047b){return db['WhatsappMessage']['create'](_0x5808f8[_0x851b('0x1c')],{'raw':_0x5808f8[_0x851b('0x1d')]?_0x5808f8[_0x851b('0x1d')][_0x851b('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x542eca){logger[_0x851b('0x12')](_0x851b('0x1b'),_0x5808f8);logger['debug'](_0x851b('0x1b'),_0x5808f8,JSON[_0x851b('0x16')](_0x542eca));_0x39e1e8(_0x542eca);})['catch'](function(_0x497ed4){logger[_0x851b('0x17')]('CreateWhatsappMessage',_0x497ed4['message'],_0x5808f8);_0x37047b(_0x39a2d3[_0x851b('0x17')](0x1f4,_0x497ed4[_0x851b('0x19')]));});});};
\ No newline at end of file
index 6a7015d..df26d62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe724=['length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x589311,_0x491c5f){var _0x43530b=function(_0x473e98){while(--_0x473e98){_0x589311['push'](_0x589311['shift']());}};_0x43530b(++_0x491c5f);}(_0xe724,0x107));var _0x4e72=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0xe724[_0x45b29d];return _0x32d74;};'use strict';var WhatsappMessageEvents=require(_0x4e72('0x0'));var events=[_0x4e72('0x1'),_0x4e72('0x2'),_0x4e72('0x3')];function createListener(_0x1355d4,_0x49f5f8){return function(_0x58e85d){_0x49f5f8[_0x4e72('0x4')](_0x1355d4,_0x58e85d);};}function removeListener(_0x4ad34c,_0x3f3537){return function(){WhatsappMessageEvents[_0x4e72('0x5')](_0x4ad34c,_0x3f3537);};}exports[_0x4e72('0x6')]=function(_0x40f975){for(var _0x4e46e9=0x0,_0x1be46d=events[_0x4e72('0x7')];_0x4e46e9<_0x1be46d;_0x4e46e9++){var _0x4ab987=events[_0x4e46e9];var _0x7851fa=createListener(_0x4e72('0x8')+_0x4ab987,_0x40f975);WhatsappMessageEvents['on'](_0x4ab987,_0x7851fa);}};
\ No newline at end of file
+var _0xbd30=['emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x1eeedd,_0x1febb2){var _0x27ee34=function(_0x5f34ce){while(--_0x5f34ce){_0x1eeedd['push'](_0x1eeedd['shift']());}};_0x27ee34(++_0x1febb2);}(_0xbd30,0x104));var _0x0bd3=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xbd30[_0x5c2e3e];return _0x53f64a;};'use strict';var WhatsappMessageEvents=require(_0x0bd3('0x0'));var events=[_0x0bd3('0x1'),_0x0bd3('0x2'),_0x0bd3('0x3')];function createListener(_0x657324,_0x1d72ee){return function(_0x3f4c40){_0x1d72ee[_0x0bd3('0x4')](_0x657324,_0x3f4c40);};}function removeListener(_0x2bb937,_0x2ac3f7){return function(){WhatsappMessageEvents[_0x0bd3('0x5')](_0x2bb937,_0x2ac3f7);};}exports[_0x0bd3('0x6')]=function(_0x3b32e2){for(var _0x161a85=0x0,_0xffc538=events['length'];_0x161a85<_0xffc538;_0x161a85++){var _0x4c6061=events[_0x161a85];var _0x17c55a=createListener(_0x0bd3('0x7')+_0x4c6061,_0x3b32e2);WhatsappMessageEvents['on'](_0x4c6061,_0x17c55a);}};
\ No newline at end of file
index c0dff74..d256eea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a69=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','update','delete','removeAgents','multer','util','path','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5a69,0x68));var _0x95a6=function(_0x4ef12b,_0x485cb5){_0x4ef12b=_0x4ef12b-0x0;var _0x2eb63d=_0x5a69[_0x4ef12b];return _0x2eb63d;};'use strict';var multer=require(_0x95a6('0x0'));var util=require(_0x95a6('0x1'));var path=require(_0x95a6('0x2'));var timeout=require(_0x95a6('0x3'));var express=require(_0x95a6('0x4'));var router=express[_0x95a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x95a6('0x6'));var interaction=require(_0x95a6('0x7'));var config=require(_0x95a6('0x8'));var controller=require(_0x95a6('0x9'));router[_0x95a6('0xa')]('/',auth['isAuthenticated'](),controller[_0x95a6('0xb')]);router[_0x95a6('0xa')](_0x95a6('0xc'),auth[_0x95a6('0xd')](),controller['describe']);router[_0x95a6('0xa')](_0x95a6('0xe'),auth['isAuthenticated'](),controller[_0x95a6('0xf')]);router[_0x95a6('0xa')]('/:id/members',auth[_0x95a6('0xd')](),controller[_0x95a6('0x10')]);router[_0x95a6('0xa')](_0x95a6('0x11'),auth['isAuthenticated'](),controller[_0x95a6('0x12')]);router[_0x95a6('0xa')]('/:id/users',auth[_0x95a6('0xd')](),controller['getAgents']);router[_0x95a6('0x13')]('/',auth[_0x95a6('0xd')](),controller[_0x95a6('0x14')]);router['post']('/:id/teams',auth[_0x95a6('0xd')](),controller['addTeams']);router['post'](_0x95a6('0x15'),auth['isAuthenticated'](),controller[_0x95a6('0x16')]);router[_0x95a6('0x17')](_0x95a6('0xe'),auth[_0x95a6('0xd')](),controller[_0x95a6('0x18')]);router[_0x95a6('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x95a6('0x19')]('/:id/teams',auth[_0x95a6('0xd')](),controller['removeTeams']);router[_0x95a6('0x19')](_0x95a6('0x15'),auth['isAuthenticated'](),controller[_0x95a6('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x45da=['create','addTeams','put','/:id','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','/describe','isAuthenticated','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x1f792e,_0x3085d8){var _0x3ddf4f=function(_0x5e7cc7){while(--_0x5e7cc7){_0x1f792e['push'](_0x1f792e['shift']());}};_0x3ddf4f(++_0x3085d8);}(_0x45da,0x183));var _0xa45d=function(_0x2c14e4,_0x59df97){_0x2c14e4=_0x2c14e4-0x0;var _0x80d845=_0x45da[_0x2c14e4];return _0x80d845;};'use strict';var multer=require(_0xa45d('0x0'));var util=require(_0xa45d('0x1'));var path=require(_0xa45d('0x2'));var timeout=require(_0xa45d('0x3'));var express=require('express');var router=express[_0xa45d('0x4')]();var fs_extra=require(_0xa45d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa45d('0x6'));var controller=require('./whatsappQueue.controller');router[_0xa45d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa45d('0x7')](_0xa45d('0x8'),auth[_0xa45d('0x9')](),controller[_0xa45d('0xa')]);router[_0xa45d('0x7')]('/:id',auth[_0xa45d('0x9')](),controller[_0xa45d('0xb')]);router[_0xa45d('0x7')]('/:id/members',auth[_0xa45d('0x9')](),controller[_0xa45d('0xc')]);router[_0xa45d('0x7')](_0xa45d('0xd'),auth['isAuthenticated'](),controller[_0xa45d('0xe')]);router['get'](_0xa45d('0xf'),auth['isAuthenticated'](),controller[_0xa45d('0x10')]);router[_0xa45d('0x11')]('/',auth[_0xa45d('0x9')](),controller[_0xa45d('0x12')]);router[_0xa45d('0x11')](_0xa45d('0xd'),auth[_0xa45d('0x9')](),controller[_0xa45d('0x13')]);router['post'](_0xa45d('0xf'),auth[_0xa45d('0x9')](),controller['addAgents']);router[_0xa45d('0x14')](_0xa45d('0x15'),auth['isAuthenticated'](),controller[_0xa45d('0x16')]);router[_0xa45d('0x17')](_0xa45d('0x15'),auth[_0xa45d('0x9')](),controller['destroy']);router[_0xa45d('0x17')](_0xa45d('0xd'),auth[_0xa45d('0x9')](),controller[_0xa45d('0x18')]);router['delete']('/:id/users',auth[_0xa45d('0x9')](),controller[_0xa45d('0x19')]);module[_0xa45d('0x1a')]=router;
\ No newline at end of file
index bff98e6..ab6bdf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e5=['name','INTEGER','ENUM','rrmemory','beepall','STRING','exports'];(function(_0x3782f1,_0xdb9da7){var _0x59aa2c=function(_0x3ecfb1){while(--_0x3ecfb1){_0x3782f1['push'](_0x3782f1['shift']());}};_0x59aa2c(++_0xdb9da7);}(_0x34e5,0x172));var _0x534e=function(_0xa76f4,_0x3baa6d){_0xa76f4=_0xa76f4-0x0;var _0x4f671c=_0x34e5[_0xa76f4];return _0x4f671c;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x534e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x534e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x534e('0x3')](_0x534e('0x4'),_0x534e('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x534e('0x6')]}};
\ No newline at end of file
+var _0xccdc=['rrmemory','beepall','roundrobin','STRING','sequelize','exports','INTEGER','ENUM'];(function(_0x436b92,_0x19de9){var _0x920cf2=function(_0xc9d9b0){while(--_0xc9d9b0){_0x436b92['push'](_0x436b92['shift']());}};_0x920cf2(++_0x19de9);}(_0xccdc,0x1c4));var _0xcccd=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xccdc[_0x4ae625];return _0x31accf;};'use strict';var Sequelize=require(_0xcccd('0x0'));module[_0xcccd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcccd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcccd('0x3')](_0xcccd('0x4'),_0xcccd('0x5'),_0xcccd('0x6'))},'description':{'type':Sequelize[_0xcccd('0x7')]}};
\ No newline at end of file
index ced54bc..ef0deb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdff7=['WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','forEach','emit','userWhatsappQueue:remove','addAgents','omit','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','WhatsappQueue','type','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','body','describe','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','updatedAt','%s/%s','SIP','whatsappPause','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams'];(function(_0x3253f3,_0x1c57d8){var _0x598c26=function(_0x4c1251){while(--_0x4c1251){_0x3253f3['push'](_0x3253f3['shift']());}};_0x598c26(++_0x1c57d8);}(_0xdff7,0xa0));var _0x7dff=function(_0x7718c5,_0x36d58c){_0x7718c5=_0x7718c5-0x0;var _0x21e800=_0xdff7[_0x7718c5];return _0x21e800;};'use strict';var emlformat=require(_0x7dff('0x0'));var rimraf=require(_0x7dff('0x1'));var zipdir=require(_0x7dff('0x2'));var jsonpatch=require(_0x7dff('0x3'));var rp=require(_0x7dff('0x4'));var moment=require('moment');var BPromise=require(_0x7dff('0x5'));var Mustache=require(_0x7dff('0x6'));var util=require(_0x7dff('0x7'));var path=require(_0x7dff('0x8'));var sox=require(_0x7dff('0x9'));var csv=require(_0x7dff('0xa'));var ejs=require(_0x7dff('0xb'));var fs=require('fs');var fs_extra=require(_0x7dff('0xc'));var _=require(_0x7dff('0xd'));var squel=require(_0x7dff('0xe'));var crypto=require(_0x7dff('0xf'));var jsforce=require(_0x7dff('0x10'));var deskjs=require(_0x7dff('0x11'));var toCsv=require(_0x7dff('0xa'));var querystring=require(_0x7dff('0x12'));var Papa=require(_0x7dff('0x13'));var Redis=require('ioredis');var authService=require(_0x7dff('0x14'));var qs=require(_0x7dff('0x15'));var as=require(_0x7dff('0x16'));var hardwareService=require(_0x7dff('0x17'));var logger=require('../../config/logger')(_0x7dff('0x18'));var utils=require(_0x7dff('0x19'));var config=require(_0x7dff('0x1a'));var licenseUtil=require(_0x7dff('0x1b'));var db=require(_0x7dff('0x1c'))['db'];config[_0x7dff('0x1d')]=_[_0x7dff('0x1e')](config[_0x7dff('0x1d')],{'host':_0x7dff('0x1f'),'port':0x18eb});var socket=require(_0x7dff('0x20'))(new Redis(config[_0x7dff('0x1d')]));require(_0x7dff('0x21'))[_0x7dff('0x22')](socket);function respondWithStatusCode(_0x2725c4,_0x309264){_0x309264=_0x309264||0xcc;return function(_0x30f50d){if(_0x30f50d){return _0x2725c4[_0x7dff('0x23')](_0x309264);}return _0x2725c4[_0x7dff('0x24')](_0x309264)[_0x7dff('0x25')]();};}function respondWithResult(_0x4e91cf,_0x344ddf){_0x344ddf=_0x344ddf||0xc8;return function(_0x1f96e0){if(_0x1f96e0){return _0x4e91cf[_0x7dff('0x24')](_0x344ddf)['json'](_0x1f96e0);}};}function respondWithFilteredResult(_0x393b49,_0x20ac24){return function(_0x378e6b){if(_0x378e6b){var _0x1b5209=typeof _0x20ac24[_0x7dff('0x26')]==='undefined'&&typeof _0x20ac24['limit']==='undefined';var _0x2b8eb0=_0x378e6b[_0x7dff('0x27')];var _0x16c32f=_0x1b5209?0x0:_0x20ac24[_0x7dff('0x26')];var _0x497d82=_0x1b5209?_0x378e6b[_0x7dff('0x27')]:_0x20ac24[_0x7dff('0x26')]+_0x20ac24[_0x7dff('0x28')];var _0x521d3d;if(_0x497d82>=_0x2b8eb0){_0x497d82=_0x2b8eb0;_0x521d3d=0xc8;}else{_0x521d3d=0xce;}_0x393b49[_0x7dff('0x24')](_0x521d3d);return _0x393b49[_0x7dff('0x29')](_0x7dff('0x2a'),_0x16c32f+'-'+_0x497d82+'/'+_0x2b8eb0)['json'](_0x378e6b);}return null;};}function patchUpdates(_0x3640ed){return function(_0xa759f0){try{jsonpatch[_0x7dff('0x2b')](_0xa759f0,_0x3640ed,!![]);}catch(_0x1924b9){return BPromise[_0x7dff('0x2c')](_0x1924b9);}return _0xa759f0[_0x7dff('0x2d')]();};}function saveUpdates(_0x574a5f,_0x1e446f){return function(_0x52fd44){if(_0x52fd44){return _0x52fd44[_0x7dff('0x2e')](_0x574a5f)[_0x7dff('0x2f')](function(_0x4c99cb){return _0x4c99cb;});}return null;};}function removeEntity(_0x36c37f,_0x96b216){return function(_0x243c17){if(_0x243c17){return _0x243c17[_0x7dff('0x30')]()[_0x7dff('0x2f')](function(){var _0x51fb2f=_0x243c17[_0x7dff('0x31')]({'plain':!![]});var _0x1299bb=_0x7dff('0x32');return db[_0x7dff('0x33')]['destroy']({'where':{'type':_0x1299bb,'resourceId':_0x51fb2f['id']}})[_0x7dff('0x2f')](function(){return _0x243c17;});})[_0x7dff('0x2f')](function(){_0x36c37f['status'](0xcc)[_0x7dff('0x25')]();});}};}function handleEntityNotFound(_0xf79e9f,_0x4af91e){return function(_0x5b30a0){if(!_0x5b30a0){_0xf79e9f['sendStatus'](0x194);}return _0x5b30a0;};}function handleError(_0x2185f9,_0x2e579e){_0x2e579e=_0x2e579e||0x1f4;return function(_0x2bb94c){logger[_0x7dff('0x34')](_0x2bb94c['stack']);if(_0x2bb94c['name']){delete _0x2bb94c[_0x7dff('0x35')];}_0x2185f9[_0x7dff('0x24')](_0x2e579e)['send'](_0x2bb94c);};}exports['index']=function(_0x836b6c,_0x10842a){var _0x9eb3a6={},_0x5635d9={},_0x480259={'count':0x0,'rows':[]};var _0x4f2e2d=_['map'](db[_0x7dff('0x36')]['rawAttributes'],function(_0x40cdb4){return{'name':_0x40cdb4['fieldName'],'type':_0x40cdb4[_0x7dff('0x37')]['key']};});_0x5635d9[_0x7dff('0x38')]=_[_0x7dff('0x39')](_0x4f2e2d,'name');_0x5635d9[_0x7dff('0x3a')]=_['keys'](_0x836b6c['query']);_0x5635d9[_0x7dff('0x3b')]=_[_0x7dff('0x3c')](_0x5635d9[_0x7dff('0x38')],_0x5635d9['query']);_0x9eb3a6[_0x7dff('0x3d')]=_['intersection'](_0x5635d9[_0x7dff('0x38')],qs[_0x7dff('0x3e')](_0x836b6c['query'][_0x7dff('0x3e')]));_0x9eb3a6[_0x7dff('0x3d')]=_0x9eb3a6[_0x7dff('0x3d')][_0x7dff('0x3f')]?_0x9eb3a6[_0x7dff('0x3d')]:_0x5635d9[_0x7dff('0x38')];if(!_0x836b6c['query']['hasOwnProperty']('nolimit')){_0x9eb3a6['limit']=qs[_0x7dff('0x28')](_0x836b6c[_0x7dff('0x3a')][_0x7dff('0x28')]);_0x9eb3a6[_0x7dff('0x26')]=qs['offset'](_0x836b6c[_0x7dff('0x3a')][_0x7dff('0x26')]);}_0x9eb3a6[_0x7dff('0x40')]=qs[_0x7dff('0x41')](_0x836b6c[_0x7dff('0x3a')]['sort']);_0x9eb3a6[_0x7dff('0x42')]=qs[_0x7dff('0x3b')](_['pick'](_0x836b6c[_0x7dff('0x3a')],_0x5635d9[_0x7dff('0x3b')]),_0x4f2e2d);if(_0x836b6c[_0x7dff('0x3a')]['filter']){_0x9eb3a6[_0x7dff('0x42')]=_[_0x7dff('0x43')](_0x9eb3a6[_0x7dff('0x42')],{'$or':_[_0x7dff('0x39')](_0x4f2e2d,function(_0x44676d){if(_0x44676d['type']!==_0x7dff('0x44')){var _0x17082b={};_0x17082b[_0x44676d['name']]={'$like':'%'+_0x836b6c[_0x7dff('0x3a')][_0x7dff('0x45')]+'%'};return _0x17082b;}})});}_0x9eb3a6=_[_0x7dff('0x43')]({},_0x9eb3a6,_0x836b6c[_0x7dff('0x46')]);var _0x12c66c={'where':_0x9eb3a6[_0x7dff('0x42')]};return db[_0x7dff('0x36')][_0x7dff('0x27')](_0x12c66c)['then'](function(_0x1826f3){_0x480259[_0x7dff('0x27')]=_0x1826f3;if(_0x836b6c['query'][_0x7dff('0x47')]){_0x9eb3a6['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x7dff('0x48')](_0x9eb3a6);})[_0x7dff('0x2f')](function(_0x253b62){_0x480259[_0x7dff('0x49')]=_0x253b62;return _0x480259;})[_0x7dff('0x2f')](respondWithFilteredResult(_0x10842a,_0x9eb3a6))[_0x7dff('0x4a')](handleError(_0x10842a,null));};exports['show']=function(_0xddd287,_0x1719b7){var _0x2c9a39={'raw':!![],'where':{'id':_0xddd287[_0x7dff('0x4b')]['id']}},_0x227c4c={};_0x227c4c[_0x7dff('0x38')]=_[_0x7dff('0x4c')](db['WhatsappQueue'][_0x7dff('0x4d')]);_0x227c4c[_0x7dff('0x3a')]=_[_0x7dff('0x4c')](_0xddd287[_0x7dff('0x3a')]);_0x227c4c[_0x7dff('0x3b')]=_[_0x7dff('0x3c')](_0x227c4c[_0x7dff('0x38')],_0x227c4c[_0x7dff('0x3a')]);_0x2c9a39[_0x7dff('0x3d')]=_['intersection'](_0x227c4c['model'],qs[_0x7dff('0x3e')](_0xddd287[_0x7dff('0x3a')][_0x7dff('0x3e')]));_0x2c9a39[_0x7dff('0x3d')]=_0x2c9a39[_0x7dff('0x3d')][_0x7dff('0x3f')]?_0x2c9a39[_0x7dff('0x3d')]:_0x227c4c[_0x7dff('0x38')];if(_0xddd287[_0x7dff('0x3a')]['includeAll']){_0x2c9a39['include']=[{'all':!![]}];}_0x2c9a39=_['merge']({},_0x2c9a39,_0xddd287[_0x7dff('0x46')]);return db[_0x7dff('0x36')][_0x7dff('0x4e')](_0x2c9a39)[_0x7dff('0x2f')](handleEntityNotFound(_0x1719b7,null))['then'](respondWithResult(_0x1719b7,null))[_0x7dff('0x4a')](handleError(_0x1719b7,null));};exports[_0x7dff('0x4f')]=function(_0x4164dd,_0x155b6f){return db[_0x7dff('0x36')][_0x7dff('0x4f')](_0x4164dd['body'],{})[_0x7dff('0x2f')](function(_0xbcfb5){var _0x340438=_0x4164dd['user'][_0x7dff('0x31')]({'plain':!![]});if(!_0x340438)throw new Error(_0x7dff('0x50'));if(_0x340438[_0x7dff('0x51')]===_0x7dff('0x52')){var _0xf766a5=_0xbcfb5['get']({'plain':!![]});var _0xcede09=_0x7dff('0x32');return db[_0x7dff('0x53')][_0x7dff('0x4e')]({'where':{'name':_0xcede09,'userProfileId':_0x340438['userProfileId']},'raw':!![]})[_0x7dff('0x2f')](function(_0x4e4f3f){if(_0x4e4f3f&&_0x4e4f3f['autoAssociation']===0x0){return db[_0x7dff('0x33')][_0x7dff('0x4f')]({'name':_0xf766a5['name'],'resourceId':_0xf766a5['id'],'type':_0x4e4f3f['name'],'sectionId':_0x4e4f3f['id']},{})[_0x7dff('0x2f')](function(){return _0xbcfb5;});}else{return _0xbcfb5;}})[_0x7dff('0x4a')](function(_0x1d80db){logger[_0x7dff('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d80db);throw _0x1d80db;});}return _0xbcfb5;})[_0x7dff('0x2f')](respondWithResult(_0x155b6f,0xc9))[_0x7dff('0x4a')](handleError(_0x155b6f,null));};exports[_0x7dff('0x2e')]=function(_0x54a9c0,_0x9a1141){if(_0x54a9c0[_0x7dff('0x54')]['id']){delete _0x54a9c0[_0x7dff('0x54')]['id'];}return db[_0x7dff('0x36')][_0x7dff('0x4e')]({'where':{'id':_0x54a9c0[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](handleEntityNotFound(_0x9a1141,null))[_0x7dff('0x2f')](saveUpdates(_0x54a9c0['body'],null))['then'](respondWithResult(_0x9a1141,null))['catch'](handleError(_0x9a1141,null));};exports[_0x7dff('0x30')]=function(_0x221bc4,_0x3e78f9){return db[_0x7dff('0x36')][_0x7dff('0x4e')]({'where':{'id':_0x221bc4[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](handleEntityNotFound(_0x3e78f9,null))[_0x7dff('0x2f')](removeEntity(_0x3e78f9,null))[_0x7dff('0x4a')](handleError(_0x3e78f9,null));};exports['describe']=function(_0x2cd824,_0x1832a2){return db['WhatsappQueue'][_0x7dff('0x55')]()[_0x7dff('0x2f')](respondWithResult(_0x1832a2,null))[_0x7dff('0x4a')](handleError(_0x1832a2,null));};exports['getMembers']=function(_0x1ced2a,_0x5f1893,_0x3a9e9a){var _0x21e9b9={'raw':!![],'where':{}},_0x5cb56d={},_0x44aa64;return db[_0x7dff('0x36')][_0x7dff('0x56')]({'where':{'id':_0x1ced2a[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](handleEntityNotFound(_0x5f1893,null))[_0x7dff('0x2f')](function(_0x4f5965){if(_0x4f5965){_0x44aa64=_0x4f5965['get']({'plain':!![]});_0x5cb56d[_0x7dff('0x38')]=_[_0x7dff('0x4c')](db[_0x7dff('0x57')][_0x7dff('0x4d')]);_0x5cb56d[_0x7dff('0x3a')]=_[_0x7dff('0x4c')](_0x1ced2a['query']);_0x5cb56d[_0x7dff('0x3b')]=_[_0x7dff('0x3c')](_0x5cb56d[_0x7dff('0x38')],_0x5cb56d['query']);_0x21e9b9[_0x7dff('0x3d')]=_['intersection'](_0x5cb56d[_0x7dff('0x38')],qs[_0x7dff('0x3e')](_0x1ced2a[_0x7dff('0x3a')][_0x7dff('0x3e')]));_0x21e9b9[_0x7dff('0x3d')]=_0x21e9b9[_0x7dff('0x3d')][_0x7dff('0x3f')]?_0x21e9b9[_0x7dff('0x3d')]:_0x5cb56d[_0x7dff('0x38')];if(!_0x1ced2a[_0x7dff('0x3a')][_0x7dff('0x58')](_0x7dff('0x59'))){_0x21e9b9[_0x7dff('0x28')]=qs[_0x7dff('0x28')](_0x1ced2a[_0x7dff('0x3a')]['limit']);_0x21e9b9[_0x7dff('0x26')]=qs['offset'](_0x1ced2a['query'][_0x7dff('0x26')]);}_0x21e9b9[_0x7dff('0x40')]=qs[_0x7dff('0x41')](_0x1ced2a[_0x7dff('0x3a')]['sort']);_0x21e9b9[_0x7dff('0x42')]=qs[_0x7dff('0x3b')](_['pick'](_0x1ced2a[_0x7dff('0x3a')],_0x5cb56d['filters']));_0x21e9b9[_0x7dff('0x42')][_0x7dff('0x5a')]=_0x4f5965['id'];if(_0x1ced2a[_0x7dff('0x3a')][_0x7dff('0x45')]){_0x21e9b9[_0x7dff('0x42')]=_[_0x7dff('0x43')](_0x21e9b9[_0x7dff('0x42')],{'$or':_[_0x7dff('0x39')](_0x21e9b9['attributes'],function(_0x3425c7){var _0x217caf={};_0x217caf[_0x3425c7]={'$like':'%'+_0x1ced2a[_0x7dff('0x3a')][_0x7dff('0x45')]+'%'};return _0x217caf;})});}_0x21e9b9=_[_0x7dff('0x43')]({},_0x21e9b9,_0x1ced2a[_0x7dff('0x46')]);return db['UserWhatsappQueue']['findAll'](_0x21e9b9);}})[_0x7dff('0x2f')](function(_0x24c7f0){if(_0x24c7f0){return db[_0x7dff('0x5b')][_0x7dff('0x5c')]({'where':{'id':_[_0x7dff('0x39')](_0x24c7f0,_0x7dff('0x5d')),'role':_0x7dff('0x5e')},'attributes':['id',_0x7dff('0x35'),'whatsappPause',_0x7dff('0x5f'),'createdAt']});}})[_0x7dff('0x2f')](function(_0xa32505){if(_0xa32505){return{'count':_0xa32505[_0x7dff('0x27')],'rows':_[_0x7dff('0x39')](_0xa32505['rows'],function(_0x16a9de){return{'membername':_0x16a9de[_0x7dff('0x35')],'UserId':_0x16a9de['id'],'queue_name':_0x44aa64['name'],'WhatsappQueueId':_0x44aa64['id'],'interface':util['format'](_0x7dff('0x60'),_0x7dff('0x61'),_0x16a9de[_0x7dff('0x35')]),'penalty':0x0,'paused':_0x16a9de[_0x7dff('0x62')],'createdAt':_0x16a9de[_0x7dff('0x63')],'updatedAt':_0x16a9de['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7dff('0x2f')](respondWithFilteredResult(_0x5f1893,_0x21e9b9))[_0x7dff('0x4a')](handleError(_0x5f1893,null));};exports['getTeams']=function(_0x20ae07,_0x2ea36c,_0x3d6461){var _0x49a82c={};var _0x2ebfc1={};var _0x2359af;var _0x5ace73;return db['WhatsappQueue']['findOne']({'where':{'id':_0x20ae07[_0x7dff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ea36c,null))[_0x7dff('0x2f')](function(_0xb83e1b){if(_0xb83e1b){_0x2359af=_0xb83e1b;_0x2ebfc1[_0x7dff('0x38')]=_[_0x7dff('0x4c')](db[_0x7dff('0x64')]['rawAttributes']);_0x2ebfc1[_0x7dff('0x3a')]=_[_0x7dff('0x4c')](_0x20ae07['query']);_0x2ebfc1[_0x7dff('0x3b')]=_[_0x7dff('0x3c')](_0x2ebfc1[_0x7dff('0x38')],_0x2ebfc1[_0x7dff('0x3a')]);_0x49a82c[_0x7dff('0x3d')]=_[_0x7dff('0x3c')](_0x2ebfc1[_0x7dff('0x38')],qs[_0x7dff('0x3e')](_0x20ae07[_0x7dff('0x3a')]['fields']));_0x49a82c[_0x7dff('0x3d')]=_0x49a82c[_0x7dff('0x3d')]['length']?_0x49a82c[_0x7dff('0x3d')]:_0x2ebfc1[_0x7dff('0x38')];_0x49a82c[_0x7dff('0x40')]=qs['sort'](_0x20ae07['query'][_0x7dff('0x41')]);_0x49a82c['where']=qs['filters'](_['pick'](_0x20ae07[_0x7dff('0x3a')],_0x2ebfc1[_0x7dff('0x3b')]));if(_0x20ae07['query'][_0x7dff('0x45')]){_0x49a82c['where']=_[_0x7dff('0x43')](_0x49a82c['where'],{'$or':_[_0x7dff('0x39')](_0x49a82c[_0x7dff('0x3d')],function(_0x1cd2e0){var _0x4ce15c={};_0x4ce15c[_0x1cd2e0]={'$like':'%'+_0x20ae07['query'][_0x7dff('0x45')]+'%'};return _0x4ce15c;})});}_0x49a82c=_[_0x7dff('0x43')]({},_0x49a82c,_0x20ae07[_0x7dff('0x46')]);return _0x2359af[_0x7dff('0x65')](_0x49a82c);}})[_0x7dff('0x2f')](function(_0x3be3b6){if(_0x3be3b6){_0x5ace73=_0x3be3b6['length'];if(!_0x20ae07[_0x7dff('0x3a')][_0x7dff('0x58')]('nolimit')){_0x49a82c[_0x7dff('0x28')]=qs[_0x7dff('0x28')](_0x20ae07[_0x7dff('0x3a')][_0x7dff('0x28')]);_0x49a82c['offset']=qs['offset'](_0x20ae07[_0x7dff('0x3a')][_0x7dff('0x26')]);}return _0x2359af[_0x7dff('0x65')](_0x49a82c);}})[_0x7dff('0x2f')](function(_0x1ffb1d){if(_0x1ffb1d){return _0x1ffb1d?{'count':_0x5ace73,'rows':_0x1ffb1d}:null;}})[_0x7dff('0x2f')](respondWithResult(_0x2ea36c,null))[_0x7dff('0x4a')](handleError(_0x2ea36c,null));};exports[_0x7dff('0x66')]=function(_0x39ad63,_0xe9fd62,_0x2ca07c){var _0x49ed73=_0x39ad63['body'][_0x7dff('0x67')];return db[_0x7dff('0x64')][_0x7dff('0x48')]({'where':{'id':_0x49ed73},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7dff('0x68'),'attributes':['id',_0x7dff('0x35'),_0x7dff('0x69'),_0x7dff('0x6a'),_0x7dff('0x6b')],'raw':!![]}]})['then'](function(_0x4b2bf0){if(_0x4b2bf0){var _0x5c59ac=_[_0x7dff('0x6c')](_0x4b2bf0,function(_0x2cbd75){var _0x2698e1=_0x2cbd75[_0x7dff('0x31')]({'plain':!![]});return _0x2698e1['Agents'];});return db[_0x7dff('0x36')]['find']({'where':{'id':_0x39ad63[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](function(_0x5e4729){return db[_0x7dff('0x6d')][_0x7dff('0x6e')](function(_0x51c412){return _0x5e4729[_0x7dff('0x66')](_0x49ed73,{'transaction':_0x51c412})['then'](function(){return BPromise[_0x7dff('0x6f')](_0x5c59ac,function(_0x3f0f69){return db[_0x7dff('0x57')][_0x7dff('0x70')]({'where':{'UserId':_0x3f0f69['id'],'WhatsappQueueId':_0x39ad63[_0x7dff('0x4b')]['id']},'transaction':_0x51c412});});})['then'](function(){_0x5c59ac['forEach'](function(_0x1d8a4e){socket['emit'](_0x7dff('0x71'),{'UserId':_0x1d8a4e['id'],'WhatsappQueueId':_0x5e4729['id']});});});});});}})[_0x7dff('0x2f')](respondWithStatusCode(_0xe9fd62,null))[_0x7dff('0x4a')](handleError(_0xe9fd62,null));};exports[_0x7dff('0x72')]=function(_0x244b66,_0x59d942,_0xc8fd1d){return db[_0x7dff('0x64')]['findAll']({'where':{'id':_0x244b66[_0x7dff('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7dff('0x68'),'attributes':['id'],'raw':!![]}]})[_0x7dff('0x2f')](handleEntityNotFound(_0x59d942,null))[_0x7dff('0x2f')](function(_0x50c2cb){var _0x1ac45e=_[_0x7dff('0x39')](_0x50c2cb,'id');var _0x2d6b2b=[];var _0x3ec2d3=[];var _0x5952d9=squel['select']();_0x5952d9[_0x7dff('0x73')](_0x7dff('0x74'))[_0x7dff('0x75')]('team_has_whatsapp_queues','tq')[_0x7dff('0x76')](_0x7dff('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7dff('0x42')](_0x7dff('0x78'),_0x244b66[_0x7dff('0x4b')]['id']);for(var _0x22328e=0x0;_0x22328e<_0x50c2cb[_0x7dff('0x3f')];_0x22328e+=0x1){let _0x38edac=_0x50c2cb[_0x22328e];for(var _0x13b9fd=0x0;_0x13b9fd<_0x38edac[_0x7dff('0x68')]['length'];_0x13b9fd+=0x1){let _0x590620=_0x38edac[_0x7dff('0x68')][_0x13b9fd];var _0x50f647=_0x5952d9[_0x7dff('0x79')]();_0x50f647['where'](_0x7dff('0x7a'),_0x590620['id']);_0x3ec2d3[_0x7dff('0x7b')](db['sequelize'][_0x7dff('0x3a')](_0x50f647[_0x7dff('0x7c')](),{'type':db[_0x7dff('0x6d')][_0x7dff('0x7d')]['SELECT']})[_0x7dff('0x2f')](function(_0x1417b3){if(_0x1417b3['length']===0x1){return _0x590620['id'];}else{var _0x4c05fd=_[_0x7dff('0x7e')](_[_0x7dff('0x39')](_0x1417b3,'TeamId'),function(_0x1e0431){return _[_0x7dff('0x7f')](_0x1ac45e,_0x1e0431);});if(_0x4c05fd){return _0x590620['id'];}}}));}}return BPromise[_0x7dff('0x80')](_0x3ec2d3)[_0x7dff('0x2f')](function(_0x3dc4ea){_0x2d6b2b=_(_0x2d6b2b)[_0x7dff('0x81')](_0x3dc4ea)[_0x7dff('0x82')]()[_0x7dff('0x83')]();return db[_0x7dff('0x36')][_0x7dff('0x4e')]({'where':{'id':_0x244b66[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](function(_0x5df598){return db['sequelize'][_0x7dff('0x6e')](function(_0x26d3fe){return _0x5df598['removeTeams'](_0x244b66[_0x7dff('0x3a')][_0x7dff('0x67')],{'transaction':_0x26d3fe})['then'](function(){if(!_[_0x7dff('0x84')](_0x2d6b2b)){return _0x5df598['removeAgents'](_0x2d6b2b,{'transaction':_0x26d3fe});}})[_0x7dff('0x2f')](function(){_0x2d6b2b[_0x7dff('0x85')](function(_0x18c580){socket[_0x7dff('0x86')](_0x7dff('0x87'),{'UserId':_0x18c580,'WhatsappQueueId':_0x5df598['id']});});});});});});})[_0x7dff('0x2f')](respondWithStatusCode(_0x59d942,null))[_0x7dff('0x4a')](handleError(_0x59d942,null));};exports[_0x7dff('0x88')]=function(_0x2b8a36,_0x2b8bcc,_0x5852cb){return db['WhatsappQueue']['find']({'where':{'id':_0x2b8a36[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](handleEntityNotFound(_0x2b8bcc,null))['then'](function(_0x21dbb2){if(_0x21dbb2){return _0x21dbb2['addAgents'](_0x2b8a36[_0x7dff('0x54')]['ids'],_[_0x7dff('0x89')](_0x2b8a36[_0x7dff('0x54')],[_0x7dff('0x67'),'id'])||{})['spread'](function(_0x5aed68){for(var _0x2f32a8=0x0;_0x2f32a8<_0x2b8a36['body'][_0x7dff('0x67')]['length'];_0x2f32a8+=0x1){socket[_0x7dff('0x86')](_0x7dff('0x71'),{'UserId':Number(_0x2b8a36[_0x7dff('0x54')][_0x7dff('0x67')][_0x2f32a8]),'WhatsappQueueId':Number(_0x2b8a36[_0x7dff('0x4b')]['id'])});}return _0x5aed68;});}})[_0x7dff('0x2f')](respondWithResult(_0x2b8bcc,null))[_0x7dff('0x4a')](handleError(_0x2b8bcc,null));};exports[_0x7dff('0x8a')]=function(_0x2a6a47,_0x35fbf6,_0x461180){return db[_0x7dff('0x36')][_0x7dff('0x4e')]({'where':{'id':_0x2a6a47[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](handleEntityNotFound(_0x35fbf6,null))[_0x7dff('0x2f')](function(_0x47775c){if(_0x47775c){return _0x47775c[_0x7dff('0x8a')](_0x2a6a47[_0x7dff('0x3a')]['ids'])[_0x7dff('0x2f')](function(){if(_['isArray'](_0x2a6a47[_0x7dff('0x3a')][_0x7dff('0x67')])){for(var _0x3665ed=0x0;_0x3665ed<_0x2a6a47[_0x7dff('0x3a')][_0x7dff('0x67')][_0x7dff('0x3f')];_0x3665ed+=0x1){socket[_0x7dff('0x86')](_0x7dff('0x87'),{'UserId':Number(_0x2a6a47[_0x7dff('0x3a')][_0x7dff('0x67')][_0x3665ed]),'WhatsappQueueId':Number(_0x2a6a47[_0x7dff('0x4b')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x2a6a47['query'][_0x7dff('0x67')]),'WhatsappQueueId':Number(_0x2a6a47[_0x7dff('0x4b')]['id'])});}});}})[_0x7dff('0x2f')](respondWithStatusCode(_0x35fbf6,null))[_0x7dff('0x4a')](handleError(_0x35fbf6,null));};exports['getAgents']=function(_0x142bcc,_0x4c10ec,_0x206fcc){var _0x1694d6={};var _0x61a8ca={};var _0x33aee3;var _0x4a1c3d;return db[_0x7dff('0x36')][_0x7dff('0x56')]({'where':{'id':_0x142bcc[_0x7dff('0x4b')]['id']}})[_0x7dff('0x2f')](handleEntityNotFound(_0x4c10ec,null))['then'](function(_0xfe0851){if(_0xfe0851){_0x33aee3=_0xfe0851;_0x61a8ca[_0x7dff('0x38')]=_[_0x7dff('0x4c')](db[_0x7dff('0x5b')][_0x7dff('0x4d')]);_0x61a8ca[_0x7dff('0x3a')]=_['keys'](_0x142bcc[_0x7dff('0x3a')]);_0x61a8ca[_0x7dff('0x3b')]=_[_0x7dff('0x3c')](_0x61a8ca[_0x7dff('0x38')],_0x61a8ca[_0x7dff('0x3a')]);_0x1694d6['attributes']=_[_0x7dff('0x3c')](_0x61a8ca[_0x7dff('0x38')],qs[_0x7dff('0x3e')](_0x142bcc[_0x7dff('0x3a')][_0x7dff('0x3e')]));_0x1694d6['attributes']=_0x1694d6['attributes'][_0x7dff('0x3f')]?_0x1694d6[_0x7dff('0x3d')]:_0x61a8ca[_0x7dff('0x38')];_0x1694d6[_0x7dff('0x40')]=qs['sort'](_0x142bcc[_0x7dff('0x3a')]['sort']);_0x1694d6[_0x7dff('0x42')]=qs[_0x7dff('0x3b')](_['pick'](_0x142bcc['query'],_0x61a8ca[_0x7dff('0x3b')]));if(_0x142bcc[_0x7dff('0x3a')][_0x7dff('0x45')]){_0x1694d6['where']=_['merge'](_0x1694d6['where'],{'$or':_[_0x7dff('0x39')](_0x1694d6[_0x7dff('0x3d')],function(_0x27bec6){var _0x330e0b={};_0x330e0b[_0x27bec6]={'$like':'%'+_0x142bcc[_0x7dff('0x3a')]['filter']+'%'};return _0x330e0b;})});}_0x1694d6=_[_0x7dff('0x43')]({},_0x1694d6,_0x142bcc[_0x7dff('0x46')]);return _0x33aee3[_0x7dff('0x8b')](_0x1694d6);}})['then'](function(_0x310011){if(_0x310011){_0x4a1c3d=_0x310011[_0x7dff('0x3f')];if(!_0x142bcc[_0x7dff('0x3a')][_0x7dff('0x58')](_0x7dff('0x59'))){_0x1694d6[_0x7dff('0x28')]=qs['limit'](_0x142bcc['query'][_0x7dff('0x28')]);_0x1694d6[_0x7dff('0x26')]=qs[_0x7dff('0x26')](_0x142bcc[_0x7dff('0x3a')]['offset']);}return _0x33aee3['getAgents'](_0x1694d6);}})[_0x7dff('0x2f')](function(_0x2e81c1){if(_0x2e81c1){return _0x2e81c1?{'count':_0x4a1c3d,'rows':_0x2e81c1}:null;}})[_0x7dff('0x2f')](respondWithResult(_0x4c10ec,null))['catch'](handleError(_0x4c10ec,null));};
\ No newline at end of file
+var _0x218e=['WhatsappQueueId','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','order','getTeams','addTeams','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x218e,0x154));var _0xe218=function(_0x55a7b0,_0x2dbc55){_0x55a7b0=_0x55a7b0-0x0;var _0x33dda7=_0x218e[_0x55a7b0];return _0x33dda7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe218('0x0'));var zipdir=require(_0xe218('0x1'));var jsonpatch=require(_0xe218('0x2'));var rp=require(_0xe218('0x3'));var moment=require('moment');var BPromise=require(_0xe218('0x4'));var Mustache=require(_0xe218('0x5'));var util=require(_0xe218('0x6'));var path=require(_0xe218('0x7'));var sox=require(_0xe218('0x8'));var csv=require(_0xe218('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe218('0xa'));var _=require(_0xe218('0xb'));var squel=require(_0xe218('0xc'));var crypto=require('crypto');var jsforce=require(_0xe218('0xd'));var deskjs=require(_0xe218('0xe'));var toCsv=require(_0xe218('0x9'));var querystring=require(_0xe218('0xf'));var Papa=require('papaparse');var Redis=require(_0xe218('0x10'));var authService=require(_0xe218('0x11'));var qs=require(_0xe218('0x12'));var as=require(_0xe218('0x13'));var hardwareService=require(_0xe218('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe218('0x15'));var config=require(_0xe218('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe218('0x17'))['db'];config[_0xe218('0x18')]=_['defaults'](config[_0xe218('0x18')],{'host':_0xe218('0x19'),'port':0x18eb});var socket=require(_0xe218('0x1a'))(new Redis(config[_0xe218('0x18')]));require(_0xe218('0x1b'))[_0xe218('0x1c')](socket);function respondWithStatusCode(_0x4b74a6,_0x49bafc){_0x49bafc=_0x49bafc||0xcc;return function(_0x10fe48){if(_0x10fe48){return _0x4b74a6[_0xe218('0x1d')](_0x49bafc);}return _0x4b74a6['status'](_0x49bafc)[_0xe218('0x1e')]();};}function respondWithResult(_0x4f0403,_0x301c1c){_0x301c1c=_0x301c1c||0xc8;return function(_0x1afe70){if(_0x1afe70){return _0x4f0403[_0xe218('0x1f')](_0x301c1c)[_0xe218('0x20')](_0x1afe70);}};}function respondWithFilteredResult(_0x4c6799,_0x43eeeb){return function(_0x19a871){if(_0x19a871){var _0x3590d0=typeof _0x43eeeb[_0xe218('0x21')]===_0xe218('0x22')&&typeof _0x43eeeb[_0xe218('0x23')]==='undefined';var _0x37ed96=_0x19a871[_0xe218('0x24')];var _0x3f447c=_0x3590d0?0x0:_0x43eeeb[_0xe218('0x21')];var _0x58d0bc=_0x3590d0?_0x19a871[_0xe218('0x24')]:_0x43eeeb[_0xe218('0x21')]+_0x43eeeb['limit'];var _0x5aac5e;if(_0x58d0bc>=_0x37ed96){_0x58d0bc=_0x37ed96;_0x5aac5e=0xc8;}else{_0x5aac5e=0xce;}_0x4c6799[_0xe218('0x1f')](_0x5aac5e);return _0x4c6799[_0xe218('0x25')]('Content-Range',_0x3f447c+'-'+_0x58d0bc+'/'+_0x37ed96)[_0xe218('0x20')](_0x19a871);}return null;};}function patchUpdates(_0x26aaf3){return function(_0x48a452){try{jsonpatch[_0xe218('0x26')](_0x48a452,_0x26aaf3,!![]);}catch(_0x3b47a2){return BPromise[_0xe218('0x27')](_0x3b47a2);}return _0x48a452[_0xe218('0x28')]();};}function saveUpdates(_0x4b3c44,_0x4c0ea2){return function(_0x1d6153){if(_0x1d6153){return _0x1d6153[_0xe218('0x29')](_0x4b3c44)[_0xe218('0x2a')](function(_0x228d44){return _0x228d44;});}return null;};}function removeEntity(_0xec48d0,_0x59fc30){return function(_0x5f3e5f){if(_0x5f3e5f){return _0x5f3e5f[_0xe218('0x2b')]()[_0xe218('0x2a')](function(){var _0xc2b7b3=_0x5f3e5f[_0xe218('0x2c')]({'plain':!![]});var _0x2507b0=_0xe218('0x2d');return db[_0xe218('0x2e')][_0xe218('0x2b')]({'where':{'type':_0x2507b0,'resourceId':_0xc2b7b3['id']}})[_0xe218('0x2a')](function(){return _0x5f3e5f;});})[_0xe218('0x2a')](function(){_0xec48d0['status'](0xcc)[_0xe218('0x1e')]();});}};}function handleEntityNotFound(_0x50c709,_0x4717a7){return function(_0x5ec945){if(!_0x5ec945){_0x50c709[_0xe218('0x1d')](0x194);}return _0x5ec945;};}function handleError(_0x27e8fa,_0x189b24){_0x189b24=_0x189b24||0x1f4;return function(_0x149aa9){logger[_0xe218('0x2f')](_0x149aa9[_0xe218('0x30')]);if(_0x149aa9[_0xe218('0x31')]){delete _0x149aa9[_0xe218('0x31')];}_0x27e8fa[_0xe218('0x1f')](_0x189b24)[_0xe218('0x32')](_0x149aa9);};}exports[_0xe218('0x33')]=function(_0x26c791,_0x5b1210){var _0x542d88={},_0x4c29bb={},_0xec67f5={'count':0x0,'rows':[]};var _0x154c81=_[_0xe218('0x34')](db[_0xe218('0x35')][_0xe218('0x36')],function(_0x510185){return{'name':_0x510185[_0xe218('0x37')],'type':_0x510185['type']['key']};});_0x4c29bb[_0xe218('0x38')]=_[_0xe218('0x34')](_0x154c81,_0xe218('0x31'));_0x4c29bb[_0xe218('0x39')]=_[_0xe218('0x3a')](_0x26c791[_0xe218('0x39')]);_0x4c29bb['filters']=_[_0xe218('0x3b')](_0x4c29bb[_0xe218('0x38')],_0x4c29bb[_0xe218('0x39')]);_0x542d88[_0xe218('0x3c')]=_['intersection'](_0x4c29bb['model'],qs[_0xe218('0x3d')](_0x26c791[_0xe218('0x39')][_0xe218('0x3d')]));_0x542d88[_0xe218('0x3c')]=_0x542d88[_0xe218('0x3c')][_0xe218('0x3e')]?_0x542d88['attributes']:_0x4c29bb[_0xe218('0x38')];if(!_0x26c791[_0xe218('0x39')][_0xe218('0x3f')](_0xe218('0x40'))){_0x542d88[_0xe218('0x23')]=qs[_0xe218('0x23')](_0x26c791[_0xe218('0x39')][_0xe218('0x23')]);_0x542d88[_0xe218('0x21')]=qs['offset'](_0x26c791['query']['offset']);}_0x542d88['order']=qs[_0xe218('0x41')](_0x26c791['query'][_0xe218('0x41')]);_0x542d88[_0xe218('0x42')]=qs[_0xe218('0x43')](_[_0xe218('0x44')](_0x26c791[_0xe218('0x39')],_0x4c29bb['filters']),_0x154c81);if(_0x26c791[_0xe218('0x39')][_0xe218('0x45')]){_0x542d88[_0xe218('0x42')]=_['merge'](_0x542d88[_0xe218('0x42')],{'$or':_[_0xe218('0x34')](_0x154c81,function(_0x466d77){if(_0x466d77[_0xe218('0x46')]!==_0xe218('0x47')){var _0x3b202a={};_0x3b202a[_0x466d77[_0xe218('0x31')]]={'$like':'%'+_0x26c791[_0xe218('0x39')][_0xe218('0x45')]+'%'};return _0x3b202a;}})});}_0x542d88=_[_0xe218('0x48')]({},_0x542d88,_0x26c791[_0xe218('0x49')]);var _0x4f2a50={'where':_0x542d88[_0xe218('0x42')]};return db[_0xe218('0x35')][_0xe218('0x24')](_0x4f2a50)[_0xe218('0x2a')](function(_0x1495c8){_0xec67f5[_0xe218('0x24')]=_0x1495c8;if(_0x26c791['query'][_0xe218('0x4a')]){_0x542d88[_0xe218('0x4b')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xe218('0x4c')](_0x542d88);})[_0xe218('0x2a')](function(_0x5a3124){_0xec67f5[_0xe218('0x4d')]=_0x5a3124;return _0xec67f5;})[_0xe218('0x2a')](respondWithFilteredResult(_0x5b1210,_0x542d88))[_0xe218('0x4e')](handleError(_0x5b1210,null));};exports['show']=function(_0x1b3cd6,_0x2f525b){var _0x2d6ebc={'raw':!![],'where':{'id':_0x1b3cd6['params']['id']}},_0x46e188={};_0x46e188[_0xe218('0x38')]=_[_0xe218('0x3a')](db[_0xe218('0x35')][_0xe218('0x36')]);_0x46e188[_0xe218('0x39')]=_[_0xe218('0x3a')](_0x1b3cd6[_0xe218('0x39')]);_0x46e188['filters']=_[_0xe218('0x3b')](_0x46e188[_0xe218('0x38')],_0x46e188[_0xe218('0x39')]);_0x2d6ebc['attributes']=_[_0xe218('0x3b')](_0x46e188['model'],qs[_0xe218('0x3d')](_0x1b3cd6[_0xe218('0x39')][_0xe218('0x3d')]));_0x2d6ebc[_0xe218('0x3c')]=_0x2d6ebc['attributes']['length']?_0x2d6ebc[_0xe218('0x3c')]:_0x46e188[_0xe218('0x38')];if(_0x1b3cd6['query'][_0xe218('0x4a')]){_0x2d6ebc[_0xe218('0x4b')]=[{'all':!![]}];}_0x2d6ebc=_[_0xe218('0x48')]({},_0x2d6ebc,_0x1b3cd6[_0xe218('0x49')]);return db['WhatsappQueue'][_0xe218('0x4f')](_0x2d6ebc)[_0xe218('0x2a')](handleEntityNotFound(_0x2f525b,null))['then'](respondWithResult(_0x2f525b,null))[_0xe218('0x4e')](handleError(_0x2f525b,null));};exports[_0xe218('0x50')]=function(_0x598598,_0x1b8a18){return db[_0xe218('0x35')][_0xe218('0x50')](_0x598598[_0xe218('0x51')],{})['then'](function(_0x31f9a2){var _0x26982d=_0x598598['user'][_0xe218('0x2c')]({'plain':!![]});if(!_0x26982d)throw new Error(_0xe218('0x52'));if(_0x26982d['role']===_0xe218('0x53')){var _0x22b590=_0x31f9a2[_0xe218('0x2c')]({'plain':!![]});var _0x4fc656='WhatsappQueues';return db['UserProfileSection'][_0xe218('0x4f')]({'where':{'name':_0x4fc656,'userProfileId':_0x26982d[_0xe218('0x54')]},'raw':!![]})[_0xe218('0x2a')](function(_0x4b28e6){if(_0x4b28e6&&_0x4b28e6[_0xe218('0x55')]===0x0){return db[_0xe218('0x2e')]['create']({'name':_0x22b590['name'],'resourceId':_0x22b590['id'],'type':_0x4b28e6[_0xe218('0x31')],'sectionId':_0x4b28e6['id']},{})[_0xe218('0x2a')](function(){return _0x31f9a2;});}else{return _0x31f9a2;}})[_0xe218('0x4e')](function(_0xc8f388){logger[_0xe218('0x2f')](_0xe218('0x56'),_0xc8f388);throw _0xc8f388;});}return _0x31f9a2;})[_0xe218('0x2a')](respondWithResult(_0x1b8a18,0xc9))[_0xe218('0x4e')](handleError(_0x1b8a18,null));};exports[_0xe218('0x29')]=function(_0x2c62b5,_0x144789){if(_0x2c62b5[_0xe218('0x51')]['id']){delete _0x2c62b5[_0xe218('0x51')]['id'];}return db[_0xe218('0x35')][_0xe218('0x4f')]({'where':{'id':_0x2c62b5[_0xe218('0x57')]['id']}})[_0xe218('0x2a')](handleEntityNotFound(_0x144789,null))['then'](saveUpdates(_0x2c62b5['body'],null))[_0xe218('0x2a')](respondWithResult(_0x144789,null))['catch'](handleError(_0x144789,null));};exports[_0xe218('0x2b')]=function(_0x2f0aca,_0x453cb3){return db[_0xe218('0x35')]['find']({'where':{'id':_0x2f0aca[_0xe218('0x57')]['id']}})[_0xe218('0x2a')](handleEntityNotFound(_0x453cb3,null))['then'](removeEntity(_0x453cb3,null))['catch'](handleError(_0x453cb3,null));};exports[_0xe218('0x58')]=function(_0x2ebb9a,_0x5dc68a){return db['WhatsappQueue']['describe']()['then'](respondWithResult(_0x5dc68a,null))[_0xe218('0x4e')](handleError(_0x5dc68a,null));};exports[_0xe218('0x59')]=function(_0x47c2e2,_0xf1f455,_0x30d997){var _0x237159={'raw':!![],'where':{}},_0x79c6b9={},_0x13a592;return db[_0xe218('0x35')][_0xe218('0x5a')]({'where':{'id':_0x47c2e2[_0xe218('0x57')]['id']}})[_0xe218('0x2a')](handleEntityNotFound(_0xf1f455,null))['then'](function(_0x20bfc0){if(_0x20bfc0){_0x13a592=_0x20bfc0[_0xe218('0x2c')]({'plain':!![]});_0x79c6b9['model']=_['keys'](db[_0xe218('0x5b')][_0xe218('0x36')]);_0x79c6b9[_0xe218('0x39')]=_[_0xe218('0x3a')](_0x47c2e2[_0xe218('0x39')]);_0x79c6b9['filters']=_['intersection'](_0x79c6b9[_0xe218('0x38')],_0x79c6b9['query']);_0x237159['attributes']=_['intersection'](_0x79c6b9[_0xe218('0x38')],qs['fields'](_0x47c2e2['query']['fields']));_0x237159[_0xe218('0x3c')]=_0x237159[_0xe218('0x3c')][_0xe218('0x3e')]?_0x237159[_0xe218('0x3c')]:_0x79c6b9[_0xe218('0x38')];if(!_0x47c2e2[_0xe218('0x39')]['hasOwnProperty']('nolimit')){_0x237159['limit']=qs['limit'](_0x47c2e2[_0xe218('0x39')][_0xe218('0x23')]);_0x237159['offset']=qs[_0xe218('0x21')](_0x47c2e2[_0xe218('0x39')][_0xe218('0x21')]);}_0x237159['order']=qs[_0xe218('0x41')](_0x47c2e2[_0xe218('0x39')]['sort']);_0x237159[_0xe218('0x42')]=qs[_0xe218('0x43')](_['pick'](_0x47c2e2[_0xe218('0x39')],_0x79c6b9[_0xe218('0x43')]));_0x237159[_0xe218('0x42')][_0xe218('0x5c')]=_0x20bfc0['id'];if(_0x47c2e2[_0xe218('0x39')][_0xe218('0x45')]){_0x237159[_0xe218('0x42')]=_[_0xe218('0x48')](_0x237159[_0xe218('0x42')],{'$or':_['map'](_0x237159[_0xe218('0x3c')],function(_0x43797b){var _0x319c49={};_0x319c49[_0x43797b]={'$like':'%'+_0x47c2e2[_0xe218('0x39')][_0xe218('0x45')]+'%'};return _0x319c49;})});}_0x237159=_[_0xe218('0x48')]({},_0x237159,_0x47c2e2['options']);return db[_0xe218('0x5b')][_0xe218('0x4c')](_0x237159);}})[_0xe218('0x2a')](function(_0x3cdcc6){if(_0x3cdcc6){return db[_0xe218('0x5d')]['findAndCountAll']({'where':{'id':_[_0xe218('0x34')](_0x3cdcc6,_0xe218('0x5e')),'role':_0xe218('0x5f')},'attributes':['id',_0xe218('0x31'),_0xe218('0x60'),_0xe218('0x61'),_0xe218('0x62')]});}})[_0xe218('0x2a')](function(_0x3e55a6){if(_0x3e55a6){return{'count':_0x3e55a6[_0xe218('0x24')],'rows':_[_0xe218('0x34')](_0x3e55a6[_0xe218('0x4d')],function(_0x4e7f5e){return{'membername':_0x4e7f5e['name'],'UserId':_0x4e7f5e['id'],'queue_name':_0x13a592[_0xe218('0x31')],'WhatsappQueueId':_0x13a592['id'],'interface':util[_0xe218('0x63')](_0xe218('0x64'),_0xe218('0x65'),_0x4e7f5e[_0xe218('0x31')]),'penalty':0x0,'paused':_0x4e7f5e['whatsappPause'],'createdAt':_0x4e7f5e[_0xe218('0x62')],'updatedAt':_0x4e7f5e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe218('0x2a')](respondWithFilteredResult(_0xf1f455,_0x237159))[_0xe218('0x4e')](handleError(_0xf1f455,null));};exports['getTeams']=function(_0x4accb3,_0x1d00a7,_0x1662d7){var _0x5acffc={};var _0x410680={};var _0x27e112;var _0x4bac83;return db['WhatsappQueue'][_0xe218('0x5a')]({'where':{'id':_0x4accb3[_0xe218('0x57')]['id']}})['then'](handleEntityNotFound(_0x1d00a7,null))[_0xe218('0x2a')](function(_0x5b3136){if(_0x5b3136){_0x27e112=_0x5b3136;_0x410680[_0xe218('0x38')]=_['keys'](db['Team'][_0xe218('0x36')]);_0x410680[_0xe218('0x39')]=_[_0xe218('0x3a')](_0x4accb3[_0xe218('0x39')]);_0x410680[_0xe218('0x43')]=_['intersection'](_0x410680['model'],_0x410680[_0xe218('0x39')]);_0x5acffc['attributes']=_['intersection'](_0x410680[_0xe218('0x38')],qs[_0xe218('0x3d')](_0x4accb3['query'][_0xe218('0x3d')]));_0x5acffc[_0xe218('0x3c')]=_0x5acffc[_0xe218('0x3c')]['length']?_0x5acffc[_0xe218('0x3c')]:_0x410680[_0xe218('0x38')];_0x5acffc[_0xe218('0x66')]=qs[_0xe218('0x41')](_0x4accb3[_0xe218('0x39')][_0xe218('0x41')]);_0x5acffc[_0xe218('0x42')]=qs['filters'](_[_0xe218('0x44')](_0x4accb3[_0xe218('0x39')],_0x410680[_0xe218('0x43')]));if(_0x4accb3[_0xe218('0x39')][_0xe218('0x45')]){_0x5acffc[_0xe218('0x42')]=_[_0xe218('0x48')](_0x5acffc[_0xe218('0x42')],{'$or':_['map'](_0x5acffc[_0xe218('0x3c')],function(_0x5c2f69){var _0x4b636d={};_0x4b636d[_0x5c2f69]={'$like':'%'+_0x4accb3[_0xe218('0x39')][_0xe218('0x45')]+'%'};return _0x4b636d;})});}_0x5acffc=_[_0xe218('0x48')]({},_0x5acffc,_0x4accb3[_0xe218('0x49')]);return _0x27e112[_0xe218('0x67')](_0x5acffc);}})['then'](function(_0x5675bb){if(_0x5675bb){_0x4bac83=_0x5675bb[_0xe218('0x3e')];if(!_0x4accb3['query']['hasOwnProperty'](_0xe218('0x40'))){_0x5acffc[_0xe218('0x23')]=qs['limit'](_0x4accb3[_0xe218('0x39')][_0xe218('0x23')]);_0x5acffc['offset']=qs['offset'](_0x4accb3['query'][_0xe218('0x21')]);}return _0x27e112[_0xe218('0x67')](_0x5acffc);}})['then'](function(_0x1f8e35){if(_0x1f8e35){return _0x1f8e35?{'count':_0x4bac83,'rows':_0x1f8e35}:null;}})[_0xe218('0x2a')](respondWithResult(_0x1d00a7,null))[_0xe218('0x4e')](handleError(_0x1d00a7,null));};exports[_0xe218('0x68')]=function(_0xd77c4d,_0x556db1,_0x12d34c){var _0x16757c=_0xd77c4d['body']['ids'];return db[_0xe218('0x69')]['findAll']({'where':{'id':_0x16757c},'attributes':['id'],'include':[{'model':db[_0xe218('0x5d')],'as':_0xe218('0x6a'),'attributes':['id',_0xe218('0x31'),_0xe218('0x6b'),_0xe218('0x6c'),'interface'],'raw':!![]}]})[_0xe218('0x2a')](function(_0xc112fe){if(_0xc112fe){var _0xe56022=_[_0xe218('0x6d')](_0xc112fe,function(_0x425e7a){var _0x17668d=_0x425e7a[_0xe218('0x2c')]({'plain':!![]});return _0x17668d[_0xe218('0x6a')];});return db[_0xe218('0x35')][_0xe218('0x4f')]({'where':{'id':_0xd77c4d[_0xe218('0x57')]['id']}})[_0xe218('0x2a')](function(_0x1a3cf3){return db[_0xe218('0x6e')][_0xe218('0x6f')](function(_0x37f87e){return _0x1a3cf3[_0xe218('0x68')](_0x16757c,{'transaction':_0x37f87e})[_0xe218('0x2a')](function(){return BPromise[_0xe218('0x70')](_0xe56022,function(_0x201d8c){return db['UserWhatsappQueue'][_0xe218('0x71')]({'where':{'UserId':_0x201d8c['id'],'WhatsappQueueId':_0xd77c4d['params']['id']},'transaction':_0x37f87e});});})['then'](function(){_0xe56022[_0xe218('0x72')](function(_0xc0eac2){socket[_0xe218('0x73')](_0xe218('0x74'),{'UserId':_0xc0eac2['id'],'WhatsappQueueId':_0x1a3cf3['id']});});});});});}})['then'](respondWithStatusCode(_0x556db1,null))[_0xe218('0x4e')](handleError(_0x556db1,null));};exports[_0xe218('0x75')]=function(_0xee616b,_0x18b560,_0x4a0bb9){return db[_0xe218('0x69')][_0xe218('0x4c')]({'where':{'id':_0xee616b[_0xe218('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe218('0x5d')],'as':_0xe218('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x18b560,null))[_0xe218('0x2a')](function(_0x45cc3b){var _0x26e4f7=_[_0xe218('0x34')](_0x45cc3b,'id');var _0x249f7e=[];var _0x3837ec=[];var _0x5791f1=squel[_0xe218('0x76')]();_0x5791f1[_0xe218('0x77')]('tq.TeamId')['from'](_0xe218('0x78'),'tq')[_0xe218('0x79')](_0xe218('0x7a'),'ut',_0xe218('0x7b'))[_0xe218('0x42')]('WhatsappQueueId\x20=\x20?',_0xee616b[_0xe218('0x57')]['id']);for(var _0x49ab48=0x0;_0x49ab48<_0x45cc3b[_0xe218('0x3e')];_0x49ab48+=0x1){let _0x558812=_0x45cc3b[_0x49ab48];for(var _0x2039b3=0x0;_0x2039b3<_0x558812['Agents'][_0xe218('0x3e')];_0x2039b3+=0x1){let _0x31c09e=_0x558812['Agents'][_0x2039b3];var _0x4a4962=_0x5791f1[_0xe218('0x7c')]();_0x4a4962[_0xe218('0x42')](_0xe218('0x7d'),_0x31c09e['id']);_0x3837ec[_0xe218('0x7e')](db[_0xe218('0x6e')]['query'](_0x4a4962[_0xe218('0x7f')](),{'type':db[_0xe218('0x6e')][_0xe218('0x80')][_0xe218('0x81')]})[_0xe218('0x2a')](function(_0x1e9c24){if(_0x1e9c24[_0xe218('0x3e')]===0x1){return _0x31c09e['id'];}else{var _0x277c33=_[_0xe218('0x82')](_[_0xe218('0x34')](_0x1e9c24,'TeamId'),function(_0x466dc3){return _[_0xe218('0x83')](_0x26e4f7,_0x466dc3);});if(_0x277c33){return _0x31c09e['id'];}}}));}}return BPromise[_0xe218('0x84')](_0x3837ec)[_0xe218('0x2a')](function(_0x52ae29){_0x249f7e=_(_0x249f7e)[_0xe218('0x85')](_0x52ae29)[_0xe218('0x86')]()[_0xe218('0x87')]();return db[_0xe218('0x35')][_0xe218('0x4f')]({'where':{'id':_0xee616b[_0xe218('0x57')]['id']}})[_0xe218('0x2a')](function(_0x4fab17){return db[_0xe218('0x6e')][_0xe218('0x6f')](function(_0x28f403){return _0x4fab17['removeTeams'](_0xee616b[_0xe218('0x39')][_0xe218('0x88')],{'transaction':_0x28f403})[_0xe218('0x2a')](function(){if(!_[_0xe218('0x89')](_0x249f7e)){return _0x4fab17[_0xe218('0x8a')](_0x249f7e,{'transaction':_0x28f403});}})[_0xe218('0x2a')](function(){_0x249f7e[_0xe218('0x72')](function(_0x816ac6){socket[_0xe218('0x73')](_0xe218('0x8b'),{'UserId':_0x816ac6,'WhatsappQueueId':_0x4fab17['id']});});});});});});})[_0xe218('0x2a')](respondWithStatusCode(_0x18b560,null))[_0xe218('0x4e')](handleError(_0x18b560,null));};exports[_0xe218('0x8c')]=function(_0x529a61,_0x47c0fd,_0x4e8de5){return db[_0xe218('0x35')][_0xe218('0x4f')]({'where':{'id':_0x529a61[_0xe218('0x57')]['id']}})['then'](handleEntityNotFound(_0x47c0fd,null))[_0xe218('0x2a')](function(_0x114afc){if(_0x114afc){return _0x114afc['addAgents'](_0x529a61[_0xe218('0x51')][_0xe218('0x88')],_[_0xe218('0x8d')](_0x529a61[_0xe218('0x51')],[_0xe218('0x88'),'id'])||{})[_0xe218('0x8e')](function(_0x4b45ca){for(var _0x37a9df=0x0;_0x37a9df<_0x529a61[_0xe218('0x51')][_0xe218('0x88')]['length'];_0x37a9df+=0x1){socket[_0xe218('0x73')](_0xe218('0x74'),{'UserId':Number(_0x529a61[_0xe218('0x51')]['ids'][_0x37a9df]),'WhatsappQueueId':Number(_0x529a61[_0xe218('0x57')]['id'])});}return _0x4b45ca;});}})[_0xe218('0x2a')](respondWithResult(_0x47c0fd,null))[_0xe218('0x4e')](handleError(_0x47c0fd,null));};exports['removeAgents']=function(_0x5ab03f,_0x2354b1,_0xa34e97){return db['WhatsappQueue']['find']({'where':{'id':_0x5ab03f[_0xe218('0x57')]['id']}})[_0xe218('0x2a')](handleEntityNotFound(_0x2354b1,null))['then'](function(_0x177521){if(_0x177521){return _0x177521[_0xe218('0x8a')](_0x5ab03f[_0xe218('0x39')][_0xe218('0x88')])['then'](function(){if(_['isArray'](_0x5ab03f[_0xe218('0x39')][_0xe218('0x88')])){for(var _0x547b4b=0x0;_0x547b4b<_0x5ab03f[_0xe218('0x39')][_0xe218('0x88')][_0xe218('0x3e')];_0x547b4b+=0x1){socket[_0xe218('0x73')](_0xe218('0x8b'),{'UserId':Number(_0x5ab03f[_0xe218('0x39')][_0xe218('0x88')][_0x547b4b]),'WhatsappQueueId':Number(_0x5ab03f['params']['id'])});}}else{socket[_0xe218('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x5ab03f[_0xe218('0x39')][_0xe218('0x88')]),'WhatsappQueueId':Number(_0x5ab03f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2354b1,null))[_0xe218('0x4e')](handleError(_0x2354b1,null));};exports[_0xe218('0x8f')]=function(_0x502eb7,_0x27b20b,_0x37dc25){var _0x300ab0={};var _0x138380={};var _0x11a57e;var _0x1468a6;return db[_0xe218('0x35')]['findOne']({'where':{'id':_0x502eb7[_0xe218('0x57')]['id']}})['then'](handleEntityNotFound(_0x27b20b,null))[_0xe218('0x2a')](function(_0x259d25){if(_0x259d25){_0x11a57e=_0x259d25;_0x138380['model']=_['keys'](db[_0xe218('0x5d')][_0xe218('0x36')]);_0x138380[_0xe218('0x39')]=_['keys'](_0x502eb7[_0xe218('0x39')]);_0x138380[_0xe218('0x43')]=_[_0xe218('0x3b')](_0x138380[_0xe218('0x38')],_0x138380['query']);_0x300ab0[_0xe218('0x3c')]=_[_0xe218('0x3b')](_0x138380[_0xe218('0x38')],qs[_0xe218('0x3d')](_0x502eb7[_0xe218('0x39')][_0xe218('0x3d')]));_0x300ab0[_0xe218('0x3c')]=_0x300ab0['attributes'][_0xe218('0x3e')]?_0x300ab0[_0xe218('0x3c')]:_0x138380['model'];_0x300ab0[_0xe218('0x66')]=qs[_0xe218('0x41')](_0x502eb7['query'][_0xe218('0x41')]);_0x300ab0[_0xe218('0x42')]=qs['filters'](_[_0xe218('0x44')](_0x502eb7[_0xe218('0x39')],_0x138380[_0xe218('0x43')]));if(_0x502eb7[_0xe218('0x39')][_0xe218('0x45')]){_0x300ab0['where']=_['merge'](_0x300ab0[_0xe218('0x42')],{'$or':_[_0xe218('0x34')](_0x300ab0[_0xe218('0x3c')],function(_0x2c24d8){var _0x55112c={};_0x55112c[_0x2c24d8]={'$like':'%'+_0x502eb7[_0xe218('0x39')][_0xe218('0x45')]+'%'};return _0x55112c;})});}_0x300ab0=_[_0xe218('0x48')]({},_0x300ab0,_0x502eb7[_0xe218('0x49')]);return _0x11a57e['getAgents'](_0x300ab0);}})['then'](function(_0x146247){if(_0x146247){_0x1468a6=_0x146247['length'];if(!_0x502eb7[_0xe218('0x39')][_0xe218('0x3f')](_0xe218('0x40'))){_0x300ab0['limit']=qs[_0xe218('0x23')](_0x502eb7[_0xe218('0x39')][_0xe218('0x23')]);_0x300ab0[_0xe218('0x21')]=qs['offset'](_0x502eb7[_0xe218('0x39')][_0xe218('0x21')]);}return _0x11a57e[_0xe218('0x8f')](_0x300ab0);}})[_0xe218('0x2a')](function(_0x34e0d0){if(_0x34e0d0){return _0x34e0d0?{'count':_0x1468a6,'rows':_0x34e0d0}:null;}})['then'](respondWithResult(_0x27b20b,null))[_0xe218('0x4e')](handleError(_0x27b20b,null));};
\ No newline at end of file
index 45a9f5e..19a4e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11c2=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x189820,_0x32bf5e){var _0x3e6109=function(_0x1833ed){while(--_0x1833ed){_0x189820['push'](_0x189820['shift']());}};_0x3e6109(++_0x32bf5e);}(_0x11c2,0xf9));var _0x211c=function(_0x4e4a14,_0x36fadf){_0x4e4a14=_0x4e4a14-0x0;var _0x5d646f=_0x11c2[_0x4e4a14];return _0x5d646f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x211c('0x0'))['db'][_0x211c('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x211c('0x2')](0x0);var events={'afterCreate':_0x211c('0x3'),'afterUpdate':_0x211c('0x4'),'afterDestroy':_0x211c('0x5')};function emitEvent(_0x1d8ee9){return function(_0x41731f,_0x25914b,_0x48f9d3){WhatsappQueueEvents[_0x211c('0x6')](_0x1d8ee9+':'+_0x41731f['id'],_0x41731f);WhatsappQueueEvents[_0x211c('0x6')](_0x1d8ee9,_0x41731f);_0x48f9d3(null);};}for(var e in events){if(events[_0x211c('0x7')](e)){var event=events[e];WhatsappQueue[_0x211c('0x8')](e,emitEvent(event));}}module[_0x211c('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xae61=['exports','WhatsappQueue','setMaxListeners','save','remove','emit','hook'];(function(_0x162b16,_0x49e731){var _0x533bbd=function(_0x4d74f8){while(--_0x4d74f8){_0x162b16['push'](_0x162b16['shift']());}};_0x533bbd(++_0x49e731);}(_0xae61,0x1a5));var _0x1ae6=function(_0x2a22ec,_0x301047){_0x2a22ec=_0x2a22ec-0x0;var _0x2de908=_0xae61[_0x2a22ec];return _0x2de908;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x1ae6('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1ae6('0x1')](0x0);var events={'afterCreate':_0x1ae6('0x2'),'afterUpdate':'update','afterDestroy':_0x1ae6('0x3')};function emitEvent(_0x29bbd4){return function(_0x2540ac,_0x51117b,_0xfe6522){WhatsappQueueEvents[_0x1ae6('0x4')](_0x29bbd4+':'+_0x2540ac['id'],_0x2540ac);WhatsappQueueEvents[_0x1ae6('0x4')](_0x29bbd4,_0x2540ac);_0xfe6522(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x1ae6('0x5')](e,emitEvent(event));}}module[_0x1ae6('0x6')]=WhatsappQueueEvents;
\ No newline at end of file
index 753c81a..a272dff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbefc=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define'];(function(_0x402771,_0x50c750){var _0x2203a4=function(_0x334271){while(--_0x334271){_0x402771['push'](_0x402771['shift']());}};_0x2203a4(++_0x50c750);}(_0xbefc,0x8e));var _0xcbef=function(_0x229576,_0x4746ef){_0x229576=_0x229576-0x0;var _0x4bd204=_0xbefc[_0x229576];return _0x4bd204;};'use strict';var _=require(_0xcbef('0x0'));var util=require(_0xcbef('0x1'));var logger=require(_0xcbef('0x2'))(_0xcbef('0x3'));var moment=require(_0xcbef('0x4'));var BPromise=require(_0xcbef('0x5'));var rp=require(_0xcbef('0x6'));var fs=require('fs');var path=require(_0xcbef('0x7'));var rimraf=require(_0xcbef('0x8'));var config=require('../../config/environment');var attributes=require(_0xcbef('0x9'));module[_0xcbef('0xa')]=function(_0x183385,_0xef55c3){return _0x183385[_0xcbef('0xb')](_0xcbef('0xc'),attributes,{'tableName':_0xcbef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6774=['../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6774,0x9f));var _0x4677=function(_0x3b8fae,_0x4e1bc0){_0x3b8fae=_0x3b8fae-0x0;var _0xa328c2=_0x6774[_0x3b8fae];return _0xa328c2;};'use strict';var _=require(_0x4677('0x0'));var util=require(_0x4677('0x1'));var logger=require(_0x4677('0x2'))('api');var moment=require(_0x4677('0x3'));var BPromise=require(_0x4677('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4677('0x5'));var config=require(_0x4677('0x6'));var attributes=require(_0x4677('0x7'));module[_0x4677('0x8')]=function(_0x3e5407,_0x13a998){return _0x3e5407['define'](_0x4677('0x9'),attributes,{'tableName':_0x4677('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f5727d..074ec8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7167=['debug','stringify','ShowWhatsappQueue','find','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','include','model','attributes','map'];(function(_0x3b1ac6,_0x44158f){var _0x2ff99b=function(_0x31e285){while(--_0x31e285){_0x3b1ac6['push'](_0x3b1ac6['shift']());}};_0x2ff99b(++_0x44158f);}(_0x7167,0x195));var _0x7716=function(_0x3b4585,_0x16a9c2){_0x3b4585=_0x3b4585-0x0;var _0x551be9=_0x7167[_0x3b4585];return _0x551be9;};'use strict';var _=require(_0x7716('0x0'));var util=require(_0x7716('0x1'));var moment=require(_0x7716('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7716('0x3'));var db=require(_0x7716('0x4'))['db'];var utils=require(_0x7716('0x5'));var logger=require(_0x7716('0x6'))(_0x7716('0x7'));var config=require(_0x7716('0x8'));var jayson=require(_0x7716('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7716('0xa')](config[_0x7716('0xb')],{'host':_0x7716('0xc'),'port':0x18eb});var socket=require(_0x7716('0xd'))(new Redis(config[_0x7716('0xb')]));require(_0x7716('0xe'))[_0x7716('0xf')](socket);function respondWithRpcPromise(_0x1b0d00,_0x317e0d,_0x5e365a){return new BPromise(function(_0x51ef58,_0x2d052a){return client[_0x7716('0x10')](_0x1b0d00,_0x5e365a)[_0x7716('0x11')](function(_0x52a1c7){logger[_0x7716('0x12')](_0x7716('0x13'),_0x317e0d,'request\x20sent');logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x317e0d,_0x7716('0x14'),JSON['stringify'](_0x52a1c7));if(_0x52a1c7[_0x7716('0x15')]){if(_0x52a1c7[_0x7716('0x15')][_0x7716('0x16')]===0x1f4){logger[_0x7716('0x15')](_0x7716('0x13'),_0x317e0d,_0x52a1c7[_0x7716('0x15')][_0x7716('0x17')]);return _0x2d052a(_0x52a1c7[_0x7716('0x15')][_0x7716('0x17')]);}logger['error'](_0x7716('0x13'),_0x317e0d,_0x52a1c7['error'][_0x7716('0x17')]);return _0x51ef58(_0x52a1c7[_0x7716('0x15')]['message']);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x317e0d,_0x7716('0x14'));_0x51ef58(_0x52a1c7[_0x7716('0x18')][_0x7716('0x17')]);}})['catch'](function(_0x10cb78){logger['error'](_0x7716('0x13'),_0x317e0d,_0x10cb78);_0x2d052a(_0x10cb78);});});}exports[_0x7716('0x19')]=function(_0x1865ca){var _0x5462a0=this;return new Promise(function(_0x5ad7eb,_0x3eedab){return db[_0x7716('0x1a')][_0x7716('0x1b')]({'raw':_0x1865ca['options']?_0x1865ca[_0x7716('0x1c')][_0x7716('0x1d')]===undefined?!![]:![]:!![],'where':_0x1865ca[_0x7716('0x1c')]?_0x1865ca[_0x7716('0x1c')][_0x7716('0x1e')]||null:null,'attributes':_0x1865ca[_0x7716('0x1c')]?_0x1865ca[_0x7716('0x1c')]['attributes']||null:null,'limit':_0x1865ca[_0x7716('0x1c')]?_0x1865ca[_0x7716('0x1c')]['limit']||null:null,'include':_0x1865ca[_0x7716('0x1c')]?_0x1865ca[_0x7716('0x1c')][_0x7716('0x1f')]?_['map'](_0x1865ca[_0x7716('0x1c')][_0x7716('0x1f')],function(_0x560c5d){return{'model':db[_0x560c5d[_0x7716('0x20')]],'as':_0x560c5d['as'],'attributes':_0x560c5d[_0x7716('0x21')],'include':_0x560c5d[_0x7716('0x1f')]?_[_0x7716('0x22')](_0x560c5d[_0x7716('0x1f')],function(_0x2a468a){return{'model':db[_0x2a468a['model']],'as':_0x2a468a['as'],'attributes':_0x2a468a[_0x7716('0x21')],'include':_0x2a468a[_0x7716('0x1f')]?_['map'](_0x2a468a[_0x7716('0x1f')],function(_0x32f394){return{'model':db[_0x32f394[_0x7716('0x20')]],'as':_0x32f394['as'],'attributes':_0x32f394[_0x7716('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7716('0x11')](function(_0x4c642c){logger[_0x7716('0x12')](_0x7716('0x19'),_0x1865ca);logger[_0x7716('0x23')](_0x7716('0x19'),_0x1865ca,JSON[_0x7716('0x24')](_0x4c642c));_0x5ad7eb(_0x4c642c);})['catch'](function(_0x353dce){logger[_0x7716('0x15')](_0x7716('0x19'),_0x353dce[_0x7716('0x17')],_0x1865ca);_0x3eedab(_0x5462a0['error'](0x1f4,_0x353dce[_0x7716('0x17')]));});});};exports[_0x7716('0x25')]=function(_0x47c9e0){var _0x5fa69a=this;return new Promise(function(_0x56488e,_0xed8884){return db[_0x7716('0x1a')][_0x7716('0x26')]({'raw':_0x47c9e0[_0x7716('0x1c')]?_0x47c9e0['options'][_0x7716('0x1d')]===undefined?!![]:![]:!![],'where':_0x47c9e0[_0x7716('0x1c')]?_0x47c9e0[_0x7716('0x1c')][_0x7716('0x1e')]||null:null,'attributes':_0x47c9e0[_0x7716('0x1c')]?_0x47c9e0['options']['attributes']||null:null,'include':_0x47c9e0[_0x7716('0x1c')]?_0x47c9e0[_0x7716('0x1c')][_0x7716('0x1f')]?_[_0x7716('0x22')](_0x47c9e0[_0x7716('0x1c')]['include'],function(_0x3ea8f9){return{'model':db[_0x3ea8f9[_0x7716('0x20')]],'as':_0x3ea8f9['as'],'attributes':_0x3ea8f9[_0x7716('0x21')],'include':_0x3ea8f9['include']?_['map'](_0x3ea8f9['include'],function(_0x5082b0){return{'model':db[_0x5082b0[_0x7716('0x20')]],'as':_0x5082b0['as'],'attributes':_0x5082b0['attributes'],'include':_0x5082b0[_0x7716('0x1f')]?_['map'](_0x5082b0[_0x7716('0x1f')],function(_0x22309b){return{'model':db[_0x22309b[_0x7716('0x20')]],'as':_0x22309b['as'],'attributes':_0x22309b[_0x7716('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7716('0x11')](function(_0x37d374){logger['info'](_0x7716('0x25'),_0x47c9e0);logger[_0x7716('0x23')]('ShowWhatsappQueue',_0x47c9e0,JSON[_0x7716('0x24')](_0x37d374));_0x56488e(_0x37d374);})[_0x7716('0x27')](function(_0x15366b){logger['error']('ShowWhatsappQueue',_0x15366b[_0x7716('0x17')],_0x47c9e0);_0xed8884(_0x5fa69a[_0x7716('0x15')](0x1f4,_0x15366b[_0x7716('0x17')]));});});};
\ No newline at end of file
+var _0x0b18=['options','raw','attributes','map','include','model','info','find','where','ShowWhatsappQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue'];(function(_0x4912ca,_0x1345b0){var _0x1b8006=function(_0x232d71){while(--_0x232d71){_0x4912ca['push'](_0x4912ca['shift']());}};_0x1b8006(++_0x1345b0);}(_0x0b18,0x122));var _0x80b1=function(_0x38382f,_0x51183d){_0x38382f=_0x38382f-0x0;var _0x152e8b=_0x0b18[_0x38382f];return _0x152e8b;};'use strict';var _=require(_0x80b1('0x0'));var util=require(_0x80b1('0x1'));var moment=require('moment');var BPromise=require(_0x80b1('0x2'));var rs=require(_0x80b1('0x3'));var fs=require('fs');var Redis=require(_0x80b1('0x4'));var db=require(_0x80b1('0x5'))['db'];var utils=require(_0x80b1('0x6'));var logger=require(_0x80b1('0x7'))(_0x80b1('0x8'));var config=require(_0x80b1('0x9'));var jayson=require(_0x80b1('0xa'));var client=jayson[_0x80b1('0xb')]['http']({'port':0x232a});config['redis']=_[_0x80b1('0xc')](config['redis'],{'host':_0x80b1('0xd'),'port':0x18eb});var socket=require(_0x80b1('0xe'))(new Redis(config[_0x80b1('0xf')]));require(_0x80b1('0x10'))[_0x80b1('0x11')](socket);function respondWithRpcPromise(_0x1c6d3e,_0x369af2,_0x4ad37b){return new BPromise(function(_0x65dd4f,_0x3d1779){return client[_0x80b1('0x12')](_0x1c6d3e,_0x4ad37b)[_0x80b1('0x13')](function(_0x42cce6){logger['info'](_0x80b1('0x14'),_0x369af2,'request\x20sent');logger[_0x80b1('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x369af2,_0x80b1('0x16'),JSON['stringify'](_0x42cce6));if(_0x42cce6[_0x80b1('0x17')]){if(_0x42cce6[_0x80b1('0x17')][_0x80b1('0x18')]===0x1f4){logger[_0x80b1('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x369af2,_0x42cce6[_0x80b1('0x17')][_0x80b1('0x19')]);return _0x3d1779(_0x42cce6[_0x80b1('0x17')][_0x80b1('0x19')]);}logger['error'](_0x80b1('0x14'),_0x369af2,_0x42cce6[_0x80b1('0x17')][_0x80b1('0x19')]);return _0x65dd4f(_0x42cce6['error'][_0x80b1('0x19')]);}else{logger['info'](_0x80b1('0x14'),_0x369af2,'request\x20sent');_0x65dd4f(_0x42cce6[_0x80b1('0x1a')][_0x80b1('0x19')]);}})[_0x80b1('0x1b')](function(_0x579557){logger[_0x80b1('0x17')](_0x80b1('0x14'),_0x369af2,_0x579557);_0x3d1779(_0x579557);});});}exports[_0x80b1('0x1c')]=function(_0x4259fe){var _0x7fba37=this;return new Promise(function(_0x127a10,_0x4e197f){return db[_0x80b1('0x1d')]['findAll']({'raw':_0x4259fe['options']?_0x4259fe[_0x80b1('0x1e')][_0x80b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x4259fe[_0x80b1('0x1e')]?_0x4259fe[_0x80b1('0x1e')]['where']||null:null,'attributes':_0x4259fe[_0x80b1('0x1e')]?_0x4259fe[_0x80b1('0x1e')][_0x80b1('0x20')]||null:null,'limit':_0x4259fe[_0x80b1('0x1e')]?_0x4259fe['options']['limit']||null:null,'include':_0x4259fe[_0x80b1('0x1e')]?_0x4259fe[_0x80b1('0x1e')]['include']?_[_0x80b1('0x21')](_0x4259fe[_0x80b1('0x1e')][_0x80b1('0x22')],function(_0x3877c0){return{'model':db[_0x3877c0['model']],'as':_0x3877c0['as'],'attributes':_0x3877c0[_0x80b1('0x20')],'include':_0x3877c0['include']?_['map'](_0x3877c0[_0x80b1('0x22')],function(_0x31aec3){return{'model':db[_0x31aec3[_0x80b1('0x23')]],'as':_0x31aec3['as'],'attributes':_0x31aec3[_0x80b1('0x20')],'include':_0x31aec3[_0x80b1('0x22')]?_['map'](_0x31aec3[_0x80b1('0x22')],function(_0x505afc){return{'model':db[_0x505afc[_0x80b1('0x23')]],'as':_0x505afc['as'],'attributes':_0x505afc[_0x80b1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31a137){logger[_0x80b1('0x24')](_0x80b1('0x1c'),_0x4259fe);logger[_0x80b1('0x15')](_0x80b1('0x1c'),_0x4259fe,JSON['stringify'](_0x31a137));_0x127a10(_0x31a137);})[_0x80b1('0x1b')](function(_0x115fd5){logger[_0x80b1('0x17')](_0x80b1('0x1c'),_0x115fd5[_0x80b1('0x19')],_0x4259fe);_0x4e197f(_0x7fba37[_0x80b1('0x17')](0x1f4,_0x115fd5[_0x80b1('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x2c59af){var _0x4ad8ba=this;return new Promise(function(_0x5346a2,_0x27fe56){return db['WhatsappQueue'][_0x80b1('0x25')]({'raw':_0x2c59af[_0x80b1('0x1e')]?_0x2c59af[_0x80b1('0x1e')][_0x80b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c59af['options']?_0x2c59af['options'][_0x80b1('0x26')]||null:null,'attributes':_0x2c59af[_0x80b1('0x1e')]?_0x2c59af[_0x80b1('0x1e')][_0x80b1('0x20')]||null:null,'include':_0x2c59af[_0x80b1('0x1e')]?_0x2c59af[_0x80b1('0x1e')]['include']?_[_0x80b1('0x21')](_0x2c59af['options'][_0x80b1('0x22')],function(_0xec324a){return{'model':db[_0xec324a[_0x80b1('0x23')]],'as':_0xec324a['as'],'attributes':_0xec324a['attributes'],'include':_0xec324a[_0x80b1('0x22')]?_[_0x80b1('0x21')](_0xec324a['include'],function(_0x185f2f){return{'model':db[_0x185f2f[_0x80b1('0x23')]],'as':_0x185f2f['as'],'attributes':_0x185f2f['attributes'],'include':_0x185f2f['include']?_['map'](_0x185f2f[_0x80b1('0x22')],function(_0x3a6f5f){return{'model':db[_0x3a6f5f[_0x80b1('0x23')]],'as':_0x3a6f5f['as'],'attributes':_0x3a6f5f[_0x80b1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x221293){logger[_0x80b1('0x24')](_0x80b1('0x27'),_0x2c59af);logger[_0x80b1('0x15')]('ShowWhatsappQueue',_0x2c59af,JSON['stringify'](_0x221293));_0x5346a2(_0x221293);})[_0x80b1('0x1b')](function(_0x45b69b){logger[_0x80b1('0x17')](_0x80b1('0x27'),_0x45b69b[_0x80b1('0x19')],_0x2c59af);_0x27fe56(_0x4ad8ba[_0x80b1('0x17')](0x1f4,_0x45b69b[_0x80b1('0x19')]));});});};
\ No newline at end of file
index 1c17276..c1a2f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c86=['save','update','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x37cf7b,_0x22a78f){var _0x18f8fd=function(_0x35aa44){while(--_0x35aa44){_0x37cf7b['push'](_0x37cf7b['shift']());}};_0x18f8fd(++_0x22a78f);}(_0x3c86,0x1f0));var _0x63c8=function(_0x55c818,_0x1fe266){_0x55c818=_0x55c818-0x0;var _0x1d94c3=_0x3c86[_0x55c818];return _0x1d94c3;};'use strict';var WhatsappQueueEvents=require(_0x63c8('0x0'));var events=[_0x63c8('0x1'),'remove',_0x63c8('0x2')];function createListener(_0x46e3bc,_0xeb767d){return function(_0x22456e){_0xeb767d['emit'](_0x46e3bc,_0x22456e);};}function removeListener(_0x3d68ee,_0x5e5860){return function(){WhatsappQueueEvents[_0x63c8('0x3')](_0x3d68ee,_0x5e5860);};}exports[_0x63c8('0x4')]=function(_0x1db9e0){for(var _0x3dc4a3=0x0,_0x1a8376=events[_0x63c8('0x5')];_0x3dc4a3<_0x1a8376;_0x3dc4a3++){var _0x1b1a89=events[_0x3dc4a3];var _0x314729=createListener(_0x63c8('0x6')+_0x1b1a89,_0x1db9e0);WhatsappQueueEvents['on'](_0x1b1a89,_0x314729);}};
\ No newline at end of file
+var _0x9320=['update','emit','removeListener','register','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x572103,_0x542815){var _0x4720ea=function(_0x1c2376){while(--_0x1c2376){_0x572103['push'](_0x572103['shift']());}};_0x4720ea(++_0x542815);}(_0x9320,0x6e));var _0x0932=function(_0x36f3c9,_0x1dca17){_0x36f3c9=_0x36f3c9-0x0;var _0x581699=_0x9320[_0x36f3c9];return _0x581699;};'use strict';var WhatsappQueueEvents=require(_0x0932('0x0'));var events=[_0x0932('0x1'),'remove',_0x0932('0x2')];function createListener(_0x1cad5d,_0xc6b90e){return function(_0x350480){_0xc6b90e[_0x0932('0x3')](_0x1cad5d,_0x350480);};}function removeListener(_0x33aa0a,_0x4a3d10){return function(){WhatsappQueueEvents[_0x0932('0x4')](_0x33aa0a,_0x4a3d10);};}exports[_0x0932('0x5')]=function(_0x3692cb){for(var _0x4b58e5=0x0,_0x33062b=events['length'];_0x4b58e5<_0x33062b;_0x4b58e5++){var _0x1aeae1=events[_0x4b58e5];var _0x323fed=createListener(_0x0932('0x6')+_0x1aeae1,_0x3692cb);WhatsappQueueEvents['on'](_0x1aeae1,_0x323fed);}};
\ No newline at end of file
index b514c55..21b9c49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40f9=['../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','show','post','put','/:id','update','delete','destroy','exports','multer','path','express','../../components/auth/service'];(function(_0xf452,_0x5b5d9b){var _0x4c7b9f=function(_0x3fd759){while(--_0x3fd759){_0xf452['push'](_0xf452['shift']());}};_0x4c7b9f(++_0x5b5d9b);}(_0x40f9,0x68));var _0x940f=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x40f9[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x940f('0x0'));var util=require('util');var path=require(_0x940f('0x1'));var timeout=require('connect-timeout');var express=require(_0x940f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x940f('0x3'));var interaction=require(_0x940f('0x4'));var config=require('../../config/environment');var controller=require(_0x940f('0x5'));router[_0x940f('0x6')]('/',auth[_0x940f('0x7')](),controller[_0x940f('0x8')]);router['get']('/describe',auth[_0x940f('0x7')](),controller[_0x940f('0x9')]);router['get']('/:id',auth[_0x940f('0x7')](),controller[_0x940f('0xa')]);router[_0x940f('0xb')]('/',auth[_0x940f('0x7')](),controller['create']);router[_0x940f('0xc')](_0x940f('0xd'),auth[_0x940f('0x7')](),controller[_0x940f('0xe')]);router[_0x940f('0xf')](_0x940f('0xd'),auth[_0x940f('0x7')](),controller[_0x940f('0x10')]);module[_0x940f('0x11')]=router;
\ No newline at end of file
+var _0xf3c0=['update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','./whatsappQueueReport.controller','/describe','isAuthenticated','describe','put','/:id'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0xf3c0,0x99));var _0x0f3c=function(_0x498b62,_0xf2947f){_0x498b62=_0x498b62-0x0;var _0x818347=_0xf3c0[_0x498b62];return _0x818347;};'use strict';var multer=require(_0x0f3c('0x0'));var util=require(_0x0f3c('0x1'));var path=require('path');var timeout=require(_0x0f3c('0x2'));var express=require(_0x0f3c('0x3'));var router=express[_0x0f3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0f3c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0f3c('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0f3c('0x7'),auth[_0x0f3c('0x8')](),controller[_0x0f3c('0x9')]);router['get']('/:id',auth[_0x0f3c('0x8')](),controller['show']);router['post']('/',auth[_0x0f3c('0x8')](),controller['create']);router[_0x0f3c('0xa')](_0x0f3c('0xb'),auth[_0x0f3c('0x8')](),controller[_0x0f3c('0xc')]);router[_0x0f3c('0xd')](_0x0f3c('0xb'),auth[_0x0f3c('0x8')](),controller[_0x0f3c('0xe')]);module['exports']=router;
\ No newline at end of file
index 087d69a..c0c93a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x251e91,_0x4d24af){var _0x2769ce=function(_0x32f29f){while(--_0x32f29f){_0x251e91['push'](_0x251e91['shift']());}};_0x2769ce(++_0x4d24af);}(_0x7a54,0x106));var _0x47a5=function(_0x70490c,_0x2e386b){_0x70490c=_0x70490c-0x0;var _0x4bd8c3=_0x7a54[_0x70490c];return _0x4bd8c3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4b3d01,_0x28150e){var _0x1706c0=function(_0x1e0e0b){while(--_0x1e0e0b){_0x4b3d01['push'](_0x4b3d01['shift']());}};_0x1706c0(++_0x28150e);}(_0x7a54,0x106));var _0x47a5=function(_0x37f1bb,_0x3bee3f){_0x37f1bb=_0x37f1bb-0x0;var _0x7d7810=_0x7a54[_0x37f1bb];return _0x7d7810;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index 8f6d415..2d955f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['then','findAll','rows','catch','params','rawAttributes','length','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x70588,_0x2e21dd){_0x70588=_0x70588-0x0;var _0x1981d8=_0xbdb7[_0x70588];return _0x1981d8;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));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 Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={},_0xd2d7be={},_0x25a1fe={'count':0x0,'rows':[]};var _0x365c02=_[_0x7bdb('0x28')](db[_0x7bdb('0x29')]['rawAttributes'],function(_0x388a45){return{'name':_0x388a45[_0x7bdb('0x2a')],'type':_0x388a45[_0x7bdb('0x2b')][_0x7bdb('0x2c')]};});_0xd2d7be[_0x7bdb('0x2d')]=_['map'](_0x365c02,_0x7bdb('0x25'));_0xd2d7be[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x371e8a[_0x7bdb('0x2e')]);_0xd2d7be['filters']=_['intersection'](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2e')]);_0x1e9996['attributes']=_[_0x7bdb('0x30')](_0xd2d7be['model'],qs[_0x7bdb('0x31')](_0x371e8a[_0x7bdb('0x2e')][_0x7bdb('0x31')]));_0x1e9996['attributes']=_0x1e9996[_0x7bdb('0x32')]['length']?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x2d')];if(!_0x371e8a['query'][_0x7bdb('0x33')]('nolimit')){_0x1e9996['limit']=qs[_0x7bdb('0x1b')](_0x371e8a[_0x7bdb('0x2e')][_0x7bdb('0x1b')]);_0x1e9996[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x371e8a[_0x7bdb('0x2e')]['offset']);}_0x1e9996[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x371e8a[_0x7bdb('0x2e')][_0x7bdb('0x35')]);_0x1e9996[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x371e8a[_0x7bdb('0x2e')],_0xd2d7be[_0x7bdb('0x37')]),_0x365c02);if(_0x371e8a['query']['filter']){_0x1e9996[_0x7bdb('0x36')]=_[_0x7bdb('0x39')](_0x1e9996[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x28')](_0x365c02,function(_0x3732b2){if(_0x3732b2['type']!=='VIRTUAL'){var _0x27164f={};_0x27164f[_0x3732b2['name']]={'$like':'%'+_0x371e8a[_0x7bdb('0x2e')]['filter']+'%'};return _0x27164f;}})});}_0x1e9996=_[_0x7bdb('0x39')]({},_0x1e9996,_0x371e8a['options']);var _0x4cf3fa={'where':_0x1e9996[_0x7bdb('0x36')]};return db[_0x7bdb('0x29')][_0x7bdb('0x1c')](_0x4cf3fa)[_0x7bdb('0x3a')](function(_0x43c7d3){_0x25a1fe[_0x7bdb('0x1c')]=_0x43c7d3;if(_0x371e8a[_0x7bdb('0x2e')]['includeAll']){_0x1e9996['include']=[{'all':!![]}];}return db[_0x7bdb('0x29')][_0x7bdb('0x3b')](_0x1e9996);})[_0x7bdb('0x3a')](function(_0x3509e4){_0x25a1fe[_0x7bdb('0x3c')]=_0x3509e4;return _0x25a1fe;})[_0x7bdb('0x3a')](respondWithFilteredResult(_0x2e8e65,_0x1e9996))[_0x7bdb('0x3d')](handleError(_0x2e8e65,null));};exports['show']=function(_0x4a2ebc,_0x1bcbcd){var _0x8e893e={'raw':!![],'where':{'id':_0x4a2ebc[_0x7bdb('0x3e')]['id']}},_0x4636f8={};_0x4636f8['model']=_[_0x7bdb('0x2f')](db['WhatsappQueueReport'][_0x7bdb('0x3f')]);_0x4636f8[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x4a2ebc[_0x7bdb('0x2e')]);_0x4636f8[_0x7bdb('0x37')]=_[_0x7bdb('0x30')](_0x4636f8[_0x7bdb('0x2d')],_0x4636f8[_0x7bdb('0x2e')]);_0x8e893e[_0x7bdb('0x32')]=_['intersection'](_0x4636f8[_0x7bdb('0x2d')],qs[_0x7bdb('0x31')](_0x4a2ebc['query'][_0x7bdb('0x31')]));_0x8e893e['attributes']=_0x8e893e[_0x7bdb('0x32')][_0x7bdb('0x40')]?_0x8e893e[_0x7bdb('0x32')]:_0x4636f8[_0x7bdb('0x2d')];if(_0x4a2ebc[_0x7bdb('0x2e')]['includeAll']){_0x8e893e[_0x7bdb('0x41')]=[{'all':!![]}];}_0x8e893e=_[_0x7bdb('0x39')]({},_0x8e893e,_0x4a2ebc[_0x7bdb('0x42')]);return db[_0x7bdb('0x29')][_0x7bdb('0x43')](_0x8e893e)['then'](handleEntityNotFound(_0x1bcbcd,null))[_0x7bdb('0x3a')](respondWithResult(_0x1bcbcd,null))[_0x7bdb('0x3d')](handleError(_0x1bcbcd,null));};exports[_0x7bdb('0x44')]=function(_0xb26a9,_0x259007){return db[_0x7bdb('0x29')][_0x7bdb('0x44')](_0xb26a9[_0x7bdb('0x45')],{})[_0x7bdb('0x3a')](respondWithResult(_0x259007,0xc9))[_0x7bdb('0x3d')](handleError(_0x259007,null));};exports['update']=function(_0x189cf8,_0x58c4bc){if(_0x189cf8['body']['id']){delete _0x189cf8[_0x7bdb('0x45')]['id'];}return db[_0x7bdb('0x29')]['find']({'where':{'id':_0x189cf8[_0x7bdb('0x3e')]['id']}})[_0x7bdb('0x3a')](handleEntityNotFound(_0x58c4bc,null))['then'](saveUpdates(_0x189cf8['body'],null))['then'](respondWithResult(_0x58c4bc,null))[_0x7bdb('0x3d')](handleError(_0x58c4bc,null));};exports[_0x7bdb('0x46')]=function(_0x2fab74,_0x46410c){return db[_0x7bdb('0x29')][_0x7bdb('0x43')]({'where':{'id':_0x2fab74[_0x7bdb('0x3e')]['id']}})[_0x7bdb('0x3a')](handleEntityNotFound(_0x46410c,null))[_0x7bdb('0x3a')](removeEntity(_0x46410c,null))[_0x7bdb('0x3d')](handleError(_0x46410c,null));};exports['describe']=function(_0x299ef0,_0x4806e0){return db[_0x7bdb('0x29')][_0x7bdb('0x47')]()[_0x7bdb('0x3a')](respondWithResult(_0x4806e0,null))[_0x7bdb('0x3d')](handleError(_0x4806e0,null));};
\ No newline at end of file
+var _0xeb74=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x462c9d,_0xb7c7){var _0x49ab1d=function(_0x3e1e29){while(--_0x3e1e29){_0x462c9d['push'](_0x462c9d['shift']());}};_0x49ab1d(++_0xb7c7);}(_0xeb74,0xe3));var _0x4eb7=function(_0x3fbcaa,_0x70b5bf){_0x3fbcaa=_0x3fbcaa-0x0;var _0x1767f8=_0xeb74[_0x3fbcaa];return _0x1767f8;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['WhatsappQueueReport'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['WhatsappQueueReport'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['WhatsappQueueReport'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));};exports[_0x4eb7('0x50')]=function(_0x1580ba,_0x1411c9){return db[_0x4eb7('0x44')]['describe']()[_0x4eb7('0x25')](respondWithResult(_0x1411c9,null))['catch'](handleError(_0x1411c9,null));};
\ No newline at end of file
index c0fe7f3..b002a80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc09=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc09,0x19e));var _0x9dc0=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0xdc09[_0x58d5ac];return _0x37985c;};'use strict';var _=require(_0x9dc0('0x0'));var util=require(_0x9dc0('0x1'));var logger=require(_0x9dc0('0x2'))(_0x9dc0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9dc0('0x4'));var fs=require('fs');var path=require(_0x9dc0('0x5'));var rimraf=require(_0x9dc0('0x6'));var config=require(_0x9dc0('0x7'));var attributes=require(_0x9dc0('0x8'));module[_0x9dc0('0x9')]=function(_0x39a94b,_0x101316){return _0x39a94b[_0x9dc0('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x9dc0('0xb'),'paranoid':![],'indexes':[{'name':_0x9dc0('0xc'),'fields':[_0x9dc0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7110=['uniqueid','lodash','api','moment','bluebird','request-promise','../../config/environment','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x387710,_0x120b0f){var _0xef5015=function(_0x1459c4){while(--_0x1459c4){_0x387710['push'](_0x387710['shift']());}};_0xef5015(++_0x120b0f);}(_0x7110,0x1d7));var _0x0711=function(_0x535ac5,_0x5a167d){_0x535ac5=_0x535ac5-0x0;var _0xe7e3ec=_0x7110[_0x535ac5];return _0xe7e3ec;};'use strict';var _=require(_0x0711('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0711('0x1'));var moment=require(_0x0711('0x2'));var BPromise=require(_0x0711('0x3'));var rp=require(_0x0711('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0711('0x5'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x29d500,_0x5dc06f){return _0x29d500[_0x0711('0x6')](_0x0711('0x7'),attributes,{'tableName':_0x0711('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0711('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index f97beef..41f22b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aa7=['create','body','options','raw','catch','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','CreateWhatsappQueueReport'];(function(_0x26c957,_0x1f4f15){var _0x57f6d8=function(_0x48ed56){while(--_0x48ed56){_0x26c957['push'](_0x26c957['shift']());}};_0x57f6d8(++_0x1f4f15);}(_0x8aa7,0xbf));var _0x78aa=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x8aa7[_0xa8883];return _0x479426;};'use strict';var _=require(_0x78aa('0x0'));var util=require('util');var moment=require(_0x78aa('0x1'));var BPromise=require(_0x78aa('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(_0x78aa('0x3'))(_0x78aa('0x4'));var config=require(_0x78aa('0x5'));var jayson=require(_0x78aa('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6efb,_0x47e7d5,_0x1021dd){return new BPromise(function(_0x5b3010,_0x268b0a){return client[_0x78aa('0x7')](_0x5e6efb,_0x1021dd)[_0x78aa('0x8')](function(_0x885862){logger['info'](_0x78aa('0x9'),_0x47e7d5,'request\x20sent');logger[_0x78aa('0xa')](_0x78aa('0xb'),_0x47e7d5,_0x78aa('0xc'),JSON[_0x78aa('0xd')](_0x885862));if(_0x885862[_0x78aa('0xe')]){if(_0x885862[_0x78aa('0xe')][_0x78aa('0xf')]===0x1f4){logger['error'](_0x78aa('0x9'),_0x47e7d5,_0x885862[_0x78aa('0xe')][_0x78aa('0x10')]);return _0x268b0a(_0x885862[_0x78aa('0xe')][_0x78aa('0x10')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x47e7d5,_0x885862[_0x78aa('0xe')]['message']);return _0x5b3010(_0x885862[_0x78aa('0xe')][_0x78aa('0x10')]);}else{logger[_0x78aa('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x47e7d5,_0x78aa('0xc'));_0x5b3010(_0x885862['result']['message']);}})['catch'](function(_0x1380cd){logger[_0x78aa('0xe')](_0x78aa('0x9'),_0x47e7d5,_0x1380cd);_0x268b0a(_0x1380cd);});});}exports[_0x78aa('0x12')]=function(_0x16fbef){var _0x230b9f=this;return new Promise(function(_0x4cb7b7,_0x5485cd){return db['WhatsappQueueReport'][_0x78aa('0x13')](_0x16fbef[_0x78aa('0x14')],{'raw':_0x16fbef[_0x78aa('0x15')]?_0x16fbef[_0x78aa('0x15')][_0x78aa('0x16')]===undefined?!![]:![]:!![]})[_0x78aa('0x8')](function(_0x2dcbfe){logger['info'](_0x78aa('0x12'),_0x16fbef);logger[_0x78aa('0xa')]('CreateWhatsappQueueReport',_0x16fbef,JSON[_0x78aa('0xd')](_0x2dcbfe));_0x4cb7b7(_0x2dcbfe);})[_0x78aa('0x17')](function(_0xf4f2bf){logger[_0x78aa('0xe')](_0x78aa('0x12'),_0xf4f2bf[_0x78aa('0x10')],_0x16fbef);_0x5485cd(_0x230b9f[_0x78aa('0xe')](0x1f4,_0xf4f2bf[_0x78aa('0x10')]));});});};exports[_0x78aa('0x18')]=function(_0x4f81c1){var _0x23ca97=this;return new Promise(function(_0x2fb444,_0xdd3b7f){return db[_0x78aa('0x19')][_0x78aa('0x1a')](_0x4f81c1['body'],{'raw':_0x4f81c1[_0x78aa('0x15')]?_0x4f81c1[_0x78aa('0x15')][_0x78aa('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f81c1[_0x78aa('0x15')]?_0x4f81c1[_0x78aa('0x15')][_0x78aa('0x1b')]||null:null,'attributes':_0x4f81c1['options']?_0x4f81c1[_0x78aa('0x15')][_0x78aa('0x1c')]||null:null,'limit':_0x4f81c1[_0x78aa('0x15')]?_0x4f81c1['options'][_0x78aa('0x1d')]||null:null})[_0x78aa('0x8')](function(_0xfd35d9){logger['info'](_0x78aa('0x18'),_0x4f81c1);logger[_0x78aa('0xa')](_0x78aa('0x18'),_0x4f81c1,JSON['stringify'](_0xfd35d9));_0x2fb444(_0xfd35d9);})[_0x78aa('0x17')](function(_0x18ffc6){logger['error'](_0x78aa('0x18'),_0x18ffc6[_0x78aa('0x10')],_0x4f81c1);_0xdd3b7f(_0x23ca97['error'](0x1f4,_0x18ffc6[_0x78aa('0x10')]));});});};
\ No newline at end of file
+var _0xe4c0=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','then','debug','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','info'];(function(_0x4a7d7d,_0xfbaa55){var _0x1e58dc=function(_0x4a8aa8){while(--_0x4a8aa8){_0x4a7d7d['push'](_0x4a7d7d['shift']());}};_0x1e58dc(++_0xfbaa55);}(_0xe4c0,0x17c));var _0x0e4c=function(_0x463a6e,_0x1b47b5){_0x463a6e=_0x463a6e-0x0;var _0x51d8c6=_0xe4c0[_0x463a6e];return _0x51d8c6;};'use strict';var _=require(_0x0e4c('0x0'));var util=require(_0x0e4c('0x1'));var moment=require(_0x0e4c('0x2'));var BPromise=require(_0x0e4c('0x3'));var rs=require(_0x0e4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e4c('0x5'));var logger=require(_0x0e4c('0x6'))('rpc');var config=require(_0x0e4c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0e4c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354295,_0x111b8d,_0x545aa2){return new BPromise(function(_0x580516,_0x29618c){return client['request'](_0x354295,_0x545aa2)['then'](function(_0x1bba05){logger[_0x0e4c('0x9')](_0x0e4c('0xa'),_0x111b8d,_0x0e4c('0xb'));logger['debug'](_0x0e4c('0xc'),_0x111b8d,'request\x20sent',JSON[_0x0e4c('0xd')](_0x1bba05));if(_0x1bba05['error']){if(_0x1bba05[_0x0e4c('0xe')][_0x0e4c('0xf')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x111b8d,_0x1bba05[_0x0e4c('0xe')][_0x0e4c('0x10')]);return _0x29618c(_0x1bba05[_0x0e4c('0xe')][_0x0e4c('0x10')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x111b8d,_0x1bba05[_0x0e4c('0xe')][_0x0e4c('0x10')]);return _0x580516(_0x1bba05[_0x0e4c('0xe')]['message']);}else{logger[_0x0e4c('0x9')](_0x0e4c('0xa'),_0x111b8d,_0x0e4c('0xb'));_0x580516(_0x1bba05[_0x0e4c('0x11')][_0x0e4c('0x10')]);}})[_0x0e4c('0x12')](function(_0x2f72e7){logger[_0x0e4c('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x111b8d,_0x2f72e7);_0x29618c(_0x2f72e7);});});}exports[_0x0e4c('0x13')]=function(_0x487a0b){var _0x2bcf86=this;return new Promise(function(_0xd29c4,_0x22965b){return db[_0x0e4c('0x14')][_0x0e4c('0x15')](_0x487a0b[_0x0e4c('0x16')],{'raw':_0x487a0b[_0x0e4c('0x17')]?_0x487a0b[_0x0e4c('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0e4c('0x18')](function(_0x6dd77){logger[_0x0e4c('0x9')](_0x0e4c('0x13'),_0x487a0b);logger[_0x0e4c('0x19')](_0x0e4c('0x13'),_0x487a0b,JSON['stringify'](_0x6dd77));_0xd29c4(_0x6dd77);})['catch'](function(_0x255fec){logger[_0x0e4c('0xe')](_0x0e4c('0x13'),_0x255fec[_0x0e4c('0x10')],_0x487a0b);_0x22965b(_0x2bcf86[_0x0e4c('0xe')](0x1f4,_0x255fec['message']));});});};exports[_0x0e4c('0x1a')]=function(_0x53cdda){var _0x786b63=this;return new Promise(function(_0x2dafe6,_0x31a169){return db[_0x0e4c('0x14')]['update'](_0x53cdda[_0x0e4c('0x16')],{'raw':_0x53cdda['options']?_0x53cdda['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53cdda[_0x0e4c('0x17')]?_0x53cdda['options'][_0x0e4c('0x1b')]||null:null,'attributes':_0x53cdda[_0x0e4c('0x17')]?_0x53cdda['options'][_0x0e4c('0x1c')]||null:null,'limit':_0x53cdda[_0x0e4c('0x17')]?_0x53cdda[_0x0e4c('0x17')][_0x0e4c('0x1d')]||null:null})['then'](function(_0x11b4cb){logger[_0x0e4c('0x9')](_0x0e4c('0x1a'),_0x53cdda);logger[_0x0e4c('0x19')]('UpdateWhatsappQueueReport',_0x53cdda,JSON[_0x0e4c('0xd')](_0x11b4cb));_0x2dafe6(_0x11b4cb);})[_0x0e4c('0x12')](function(_0x4b7734){logger[_0x0e4c('0xe')]('UpdateWhatsappQueueReport',_0x4b7734['message'],_0x53cdda);_0x31a169(_0x786b63[_0x0e4c('0xe')](0x1f4,_0x4b7734['message']));});});};
\ No newline at end of file
index 85784ab..7c26cd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedb1=['/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','isAuthenticated','describe'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xedb1,0xb2));var _0x1edb=function(_0x2689c2,_0x390ddd){_0x2689c2=_0x2689c2-0x0;var _0x2fc9b4=_0xedb1[_0x2689c2];return _0x2fc9b4;};'use strict';var multer=require(_0x1edb('0x0'));var util=require(_0x1edb('0x1'));var path=require('path');var timeout=require(_0x1edb('0x2'));var express=require('express');var router=express[_0x1edb('0x3')]();var fs_extra=require(_0x1edb('0x4'));var auth=require(_0x1edb('0x5'));var interaction=require(_0x1edb('0x6'));var config=require('../../config/environment');var controller=require(_0x1edb('0x7'));router[_0x1edb('0x8')]('/',auth['isAuthenticated'](),controller[_0x1edb('0x9')]);router[_0x1edb('0x8')]('/describe',auth[_0x1edb('0xa')](),controller[_0x1edb('0xb')]);router[_0x1edb('0x8')](_0x1edb('0xc'),auth[_0x1edb('0xa')](),controller[_0x1edb('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1edb('0xe')]);router[_0x1edb('0xf')](_0x1edb('0xc'),auth[_0x1edb('0xa')](),controller[_0x1edb('0x10')]);router[_0x1edb('0x11')](_0x1edb('0xc'),auth[_0x1edb('0xa')](),controller['destroy']);module[_0x1edb('0x12')]=router;
\ No newline at end of file
+var _0x4977=['/describe','describe','/:id','show','post','create','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0x4977,0xda));var _0x7497=function(_0x662cad,_0x2d8b06){_0x662cad=_0x662cad-0x0;var _0x4b2339=_0x4977[_0x662cad];return _0x4b2339;};'use strict';var multer=require(_0x7497('0x0'));var util=require('util');var path=require(_0x7497('0x1'));var timeout=require('connect-timeout');var express=require(_0x7497('0x2'));var router=express[_0x7497('0x3')]();var fs_extra=require(_0x7497('0x4'));var auth=require(_0x7497('0x5'));var interaction=require(_0x7497('0x6'));var config=require(_0x7497('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x7497('0x8')]('/',auth[_0x7497('0x9')](),controller['index']);router[_0x7497('0x8')](_0x7497('0xa'),auth['isAuthenticated'](),controller[_0x7497('0xb')]);router['get'](_0x7497('0xc'),auth['isAuthenticated'](),controller[_0x7497('0xd')]);router[_0x7497('0xe')]('/',auth['isAuthenticated'](),controller[_0x7497('0xf')]);router['put'](_0x7497('0xc'),auth[_0x7497('0x9')](),controller[_0x7497('0x10')]);router[_0x7497('0x11')]('/:id',auth[_0x7497('0x9')](),controller[_0x7497('0x12')]);module['exports']=router;
\ No newline at end of file
index 8981fc2..202c6a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7462=['DATE','sequelize','exports','account'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7462,0x165));var _0x2746=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0x7462[_0x328bd3];return _0x458149;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2746('0x2'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2746('0x3')]}};
\ No newline at end of file
+var _0xb19a=['sequelize','ENUM','queue','DATE'];(function(_0x3ba99a,_0x2b6030){var _0x4bd594=function(_0x49f5ce){while(--_0x49f5ce){_0x3ba99a['push'](_0x3ba99a['shift']());}};_0x4bd594(++_0x2b6030);}(_0xb19a,0xd0));var _0xab19=function(_0x184bc2,_0x4cf0c3){_0x184bc2=_0x184bc2-0x0;var _0x3dad7a=_0xb19a[_0x184bc2];return _0x3dad7a;};'use strict';var Sequelize=require(_0xab19('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xab19('0x1')]('account','agent',_0xab19('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xab19('0x3')]}};
\ No newline at end of file
index 5970640..32ffe63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087a=['options','catch','create','body','find','describe','eml-format','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys'];(function(_0x5bd232,_0x579d1f){var _0x24d4c6=function(_0x5b4423){while(--_0x5b4423){_0x5bd232['push'](_0x5bd232['shift']());}};_0x24d4c6(++_0x579d1f);}(_0x087a,0x1b0));var _0xa087=function(_0xdcaced,_0x2b11f5){_0xdcaced=_0xdcaced-0x0;var _0x134330=_0x087a[_0xdcaced];return _0x134330;};'use strict';var emlformat=require(_0xa087('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa087('0x1'));var rp=require(_0xa087('0x2'));var moment=require('moment');var BPromise=require(_0xa087('0x3'));var Mustache=require('mustache');var util=require(_0xa087('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa087('0x5'));var ejs=require(_0xa087('0x6'));var fs=require('fs');var fs_extra=require(_0xa087('0x7'));var _=require('lodash');var squel=require(_0xa087('0x8'));var crypto=require(_0xa087('0x9'));var jsforce=require(_0xa087('0xa'));var deskjs=require(_0xa087('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa087('0xc'));var Redis=require(_0xa087('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa087('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa087('0xf'));var logger=require(_0xa087('0x10'))(_0xa087('0x11'));var utils=require(_0xa087('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa087('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7aae2,_0x14c4de){_0x14c4de=_0x14c4de||0xcc;return function(_0x210ce0){if(_0x210ce0){return _0xf7aae2[_0xa087('0x14')](_0x14c4de);}return _0xf7aae2['status'](_0x14c4de)[_0xa087('0x15')]();};}function respondWithResult(_0x2b12e7,_0x4b80f9){_0x4b80f9=_0x4b80f9||0xc8;return function(_0x2fab5b){if(_0x2fab5b){return _0x2b12e7[_0xa087('0x16')](_0x4b80f9)[_0xa087('0x17')](_0x2fab5b);}};}function respondWithFilteredResult(_0x11077b,_0x299d98){return function(_0xbcfe7e){if(_0xbcfe7e){var _0x55d260=typeof _0x299d98[_0xa087('0x18')]===_0xa087('0x19')&&typeof _0x299d98[_0xa087('0x1a')]===_0xa087('0x19');var _0xa12904=_0xbcfe7e[_0xa087('0x1b')];var _0xdd396b=_0x55d260?0x0:_0x299d98[_0xa087('0x18')];var _0x57af0b=_0x55d260?_0xbcfe7e['count']:_0x299d98[_0xa087('0x18')]+_0x299d98['limit'];var _0x1cd240;if(_0x57af0b>=_0xa12904){_0x57af0b=_0xa12904;_0x1cd240=0xc8;}else{_0x1cd240=0xce;}_0x11077b[_0xa087('0x16')](_0x1cd240);return _0x11077b[_0xa087('0x1c')](_0xa087('0x1d'),_0xdd396b+'-'+_0x57af0b+'/'+_0xa12904)[_0xa087('0x17')](_0xbcfe7e);}return null;};}function patchUpdates(_0x1e0a42){return function(_0x335018){try{jsonpatch['apply'](_0x335018,_0x1e0a42,!![]);}catch(_0x442825){return BPromise[_0xa087('0x1e')](_0x442825);}return _0x335018['save']();};}function saveUpdates(_0x4db99b,_0x102034){return function(_0x5e0b95){if(_0x5e0b95){return _0x5e0b95[_0xa087('0x1f')](_0x4db99b)[_0xa087('0x20')](function(_0x20df58){return _0x20df58;});}return null;};}function removeEntity(_0x1dfacb,_0x2273be){return function(_0x17aee7){if(_0x17aee7){return _0x17aee7[_0xa087('0x21')]()[_0xa087('0x20')](function(){_0x1dfacb[_0xa087('0x16')](0xcc)[_0xa087('0x15')]();});}};}function handleEntityNotFound(_0xa4ae00,_0x3d3a8f){return function(_0x3cd376){if(!_0x3cd376){_0xa4ae00['sendStatus'](0x194);}return _0x3cd376;};}function handleError(_0x455395,_0x4d5bdf){_0x4d5bdf=_0x4d5bdf||0x1f4;return function(_0x109c13){logger[_0xa087('0x22')](_0x109c13[_0xa087('0x23')]);if(_0x109c13[_0xa087('0x24')]){delete _0x109c13[_0xa087('0x24')];}_0x455395['status'](_0x4d5bdf)[_0xa087('0x25')](_0x109c13);};}exports[_0xa087('0x26')]=function(_0x38fa94,_0x45c0a7){var _0x2d9738={},_0x5a3c04={},_0x3006ee={'count':0x0,'rows':[]};var _0xa3dedb=_[_0xa087('0x27')](db[_0xa087('0x28')][_0xa087('0x29')],function(_0x254fe6){return{'name':_0x254fe6[_0xa087('0x2a')],'type':_0x254fe6[_0xa087('0x2b')]['key']};});_0x5a3c04[_0xa087('0x2c')]=_[_0xa087('0x27')](_0xa3dedb,_0xa087('0x24'));_0x5a3c04[_0xa087('0x2d')]=_['keys'](_0x38fa94[_0xa087('0x2d')]);_0x5a3c04['filters']=_[_0xa087('0x2e')](_0x5a3c04[_0xa087('0x2c')],_0x5a3c04[_0xa087('0x2d')]);_0x2d9738[_0xa087('0x2f')]=_['intersection'](_0x5a3c04[_0xa087('0x2c')],qs[_0xa087('0x30')](_0x38fa94['query']['fields']));_0x2d9738['attributes']=_0x2d9738[_0xa087('0x2f')][_0xa087('0x31')]?_0x2d9738[_0xa087('0x2f')]:_0x5a3c04[_0xa087('0x2c')];if(!_0x38fa94[_0xa087('0x2d')]['hasOwnProperty'](_0xa087('0x32'))){_0x2d9738[_0xa087('0x1a')]=qs['limit'](_0x38fa94[_0xa087('0x2d')]['limit']);_0x2d9738[_0xa087('0x18')]=qs[_0xa087('0x18')](_0x38fa94[_0xa087('0x2d')][_0xa087('0x18')]);}_0x2d9738[_0xa087('0x33')]=qs['sort'](_0x38fa94[_0xa087('0x2d')][_0xa087('0x34')]);_0x2d9738[_0xa087('0x35')]=qs[_0xa087('0x36')](_[_0xa087('0x37')](_0x38fa94[_0xa087('0x2d')],_0x5a3c04[_0xa087('0x36')]),_0xa3dedb);if(_0x38fa94['query'][_0xa087('0x38')]){_0x2d9738[_0xa087('0x35')]=_[_0xa087('0x39')](_0x2d9738['where'],{'$or':_['map'](_0xa3dedb,function(_0x3017f9){if(_0x3017f9['type']!==_0xa087('0x3a')){var _0x3f4727={};_0x3f4727[_0x3017f9[_0xa087('0x24')]]={'$like':'%'+_0x38fa94['query'][_0xa087('0x38')]+'%'};return _0x3f4727;}})});}_0x2d9738=_[_0xa087('0x39')]({},_0x2d9738,_0x38fa94['options']);var _0x67c7fd={'where':_0x2d9738['where']};return db['WhatsappTransferReport'][_0xa087('0x1b')](_0x67c7fd)[_0xa087('0x20')](function(_0xd92aaa){_0x3006ee[_0xa087('0x1b')]=_0xd92aaa;if(_0x38fa94[_0xa087('0x2d')][_0xa087('0x3b')]){_0x2d9738[_0xa087('0x3c')]=[{'all':!![]}];}return db[_0xa087('0x28')]['findAll'](_0x2d9738);})[_0xa087('0x20')](function(_0x443a86){_0x3006ee[_0xa087('0x3d')]=_0x443a86;return _0x3006ee;})['then'](respondWithFilteredResult(_0x45c0a7,_0x2d9738))['catch'](handleError(_0x45c0a7,null));};exports[_0xa087('0x3e')]=function(_0x55596e,_0x3b369a){var _0x1fe5c0={'raw':!![],'where':{'id':_0x55596e[_0xa087('0x3f')]['id']}},_0x5840e9={};_0x5840e9[_0xa087('0x2c')]=_[_0xa087('0x40')](db['WhatsappTransferReport'][_0xa087('0x29')]);_0x5840e9[_0xa087('0x2d')]=_[_0xa087('0x40')](_0x55596e['query']);_0x5840e9[_0xa087('0x36')]=_[_0xa087('0x2e')](_0x5840e9['model'],_0x5840e9[_0xa087('0x2d')]);_0x1fe5c0[_0xa087('0x2f')]=_['intersection'](_0x5840e9[_0xa087('0x2c')],qs[_0xa087('0x30')](_0x55596e[_0xa087('0x2d')][_0xa087('0x30')]));_0x1fe5c0[_0xa087('0x2f')]=_0x1fe5c0[_0xa087('0x2f')][_0xa087('0x31')]?_0x1fe5c0[_0xa087('0x2f')]:_0x5840e9[_0xa087('0x2c')];if(_0x55596e[_0xa087('0x2d')][_0xa087('0x3b')]){_0x1fe5c0['include']=[{'all':!![]}];}_0x1fe5c0=_[_0xa087('0x39')]({},_0x1fe5c0,_0x55596e[_0xa087('0x41')]);return db['WhatsappTransferReport']['find'](_0x1fe5c0)[_0xa087('0x20')](handleEntityNotFound(_0x3b369a,null))['then'](respondWithResult(_0x3b369a,null))[_0xa087('0x42')](handleError(_0x3b369a,null));};exports['create']=function(_0x26065d,_0x52ed74){return db[_0xa087('0x28')][_0xa087('0x43')](_0x26065d[_0xa087('0x44')],{})['then'](respondWithResult(_0x52ed74,0xc9))[_0xa087('0x42')](handleError(_0x52ed74,null));};exports[_0xa087('0x1f')]=function(_0x29fd37,_0x290aee){if(_0x29fd37[_0xa087('0x44')]['id']){delete _0x29fd37['body']['id'];}return db['WhatsappTransferReport'][_0xa087('0x45')]({'where':{'id':_0x29fd37[_0xa087('0x3f')]['id']}})[_0xa087('0x20')](handleEntityNotFound(_0x290aee,null))[_0xa087('0x20')](saveUpdates(_0x29fd37[_0xa087('0x44')],null))[_0xa087('0x20')](respondWithResult(_0x290aee,null))[_0xa087('0x42')](handleError(_0x290aee,null));};exports[_0xa087('0x21')]=function(_0x267d36,_0x1509af){return db[_0xa087('0x28')][_0xa087('0x45')]({'where':{'id':_0x267d36[_0xa087('0x3f')]['id']}})[_0xa087('0x20')](handleEntityNotFound(_0x1509af,null))['then'](removeEntity(_0x1509af,null))[_0xa087('0x42')](handleError(_0x1509af,null));};exports[_0xa087('0x46')]=function(_0x13a99b,_0x5eac82){return db[_0xa087('0x28')][_0xa087('0x46')]()['then'](respondWithResult(_0x5eac82,null))[_0xa087('0x42')](handleError(_0x5eac82,null));};
\ No newline at end of file
+var _0x4f31=['apply','reject','save','update','destroy','then','error','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range'];(function(_0xacdaef,_0x78bede){var _0x440b43=function(_0x101b2a){while(--_0x101b2a){_0xacdaef['push'](_0xacdaef['shift']());}};_0x440b43(++_0x78bede);}(_0x4f31,0x13f));var _0x14f3=function(_0x231f9a,_0x2ae159){_0x231f9a=_0x231f9a-0x0;var _0x2fc864=_0x4f31[_0x231f9a];return _0x2fc864;};'use strict';var emlformat=require(_0x14f3('0x0'));var rimraf=require(_0x14f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14f3('0x2'));var rp=require('request-promise');var moment=require(_0x14f3('0x3'));var BPromise=require(_0x14f3('0x4'));var Mustache=require(_0x14f3('0x5'));var util=require(_0x14f3('0x6'));var path=require('path');var sox=require(_0x14f3('0x7'));var csv=require(_0x14f3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14f3('0x9'));var squel=require(_0x14f3('0xa'));var crypto=require(_0x14f3('0xb'));var jsforce=require(_0x14f3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x14f3('0xd'));var Redis=require(_0x14f3('0xe'));var authService=require(_0x14f3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x14f3('0x10'));var hardwareService=require(_0x14f3('0x11'));var logger=require(_0x14f3('0x12'))(_0x14f3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x14f3('0x14'));var db=require(_0x14f3('0x15'))['db'];function respondWithStatusCode(_0x58f2a2,_0x30d12c){_0x30d12c=_0x30d12c||0xcc;return function(_0x5b67a5){if(_0x5b67a5){return _0x58f2a2[_0x14f3('0x16')](_0x30d12c);}return _0x58f2a2[_0x14f3('0x17')](_0x30d12c)[_0x14f3('0x18')]();};}function respondWithResult(_0x481bc0,_0x422cff){_0x422cff=_0x422cff||0xc8;return function(_0x8b4148){if(_0x8b4148){return _0x481bc0['status'](_0x422cff)[_0x14f3('0x19')](_0x8b4148);}};}function respondWithFilteredResult(_0x181988,_0x5eac97){return function(_0x5a9ecb){if(_0x5a9ecb){var _0x3e5a7d=typeof _0x5eac97['offset']==='undefined'&&typeof _0x5eac97[_0x14f3('0x1a')]==='undefined';var _0x4561ff=_0x5a9ecb[_0x14f3('0x1b')];var _0x3bd462=_0x3e5a7d?0x0:_0x5eac97['offset'];var _0x29506d=_0x3e5a7d?_0x5a9ecb[_0x14f3('0x1b')]:_0x5eac97[_0x14f3('0x1c')]+_0x5eac97[_0x14f3('0x1a')];var _0x3a8f19;if(_0x29506d>=_0x4561ff){_0x29506d=_0x4561ff;_0x3a8f19=0xc8;}else{_0x3a8f19=0xce;}_0x181988['status'](_0x3a8f19);return _0x181988[_0x14f3('0x1d')](_0x14f3('0x1e'),_0x3bd462+'-'+_0x29506d+'/'+_0x4561ff)[_0x14f3('0x19')](_0x5a9ecb);}return null;};}function patchUpdates(_0x56a4d7){return function(_0x4354f4){try{jsonpatch[_0x14f3('0x1f')](_0x4354f4,_0x56a4d7,!![]);}catch(_0x40dfbc){return BPromise[_0x14f3('0x20')](_0x40dfbc);}return _0x4354f4[_0x14f3('0x21')]();};}function saveUpdates(_0x460094,_0x2d87c1){return function(_0x105869){if(_0x105869){return _0x105869[_0x14f3('0x22')](_0x460094)['then'](function(_0x1dd25c){return _0x1dd25c;});}return null;};}function removeEntity(_0x5125fe,_0x4bfd4e){return function(_0x248f58){if(_0x248f58){return _0x248f58[_0x14f3('0x23')]()[_0x14f3('0x24')](function(){_0x5125fe[_0x14f3('0x17')](0xcc)[_0x14f3('0x18')]();});}};}function handleEntityNotFound(_0x4db176,_0x2e3cc8){return function(_0x4c167c){if(!_0x4c167c){_0x4db176[_0x14f3('0x16')](0x194);}return _0x4c167c;};}function handleError(_0x281a5c,_0x22c8f5){_0x22c8f5=_0x22c8f5||0x1f4;return function(_0x938308){logger[_0x14f3('0x25')](_0x938308['stack']);if(_0x938308[_0x14f3('0x26')]){delete _0x938308[_0x14f3('0x26')];}_0x281a5c[_0x14f3('0x17')](_0x22c8f5)[_0x14f3('0x27')](_0x938308);};}exports[_0x14f3('0x28')]=function(_0x269abe,_0x1bce4f){var _0x3bd24a={},_0x50aae3={},_0x59e4ee={'count':0x0,'rows':[]};var _0x55277d=_[_0x14f3('0x29')](db[_0x14f3('0x2a')][_0x14f3('0x2b')],function(_0x5d97cf){return{'name':_0x5d97cf['fieldName'],'type':_0x5d97cf[_0x14f3('0x2c')][_0x14f3('0x2d')]};});_0x50aae3['model']=_[_0x14f3('0x29')](_0x55277d,_0x14f3('0x26'));_0x50aae3[_0x14f3('0x2e')]=_[_0x14f3('0x2f')](_0x269abe['query']);_0x50aae3[_0x14f3('0x30')]=_[_0x14f3('0x31')](_0x50aae3[_0x14f3('0x32')],_0x50aae3[_0x14f3('0x2e')]);_0x3bd24a[_0x14f3('0x33')]=_[_0x14f3('0x31')](_0x50aae3['model'],qs[_0x14f3('0x34')](_0x269abe['query'][_0x14f3('0x34')]));_0x3bd24a[_0x14f3('0x33')]=_0x3bd24a[_0x14f3('0x33')][_0x14f3('0x35')]?_0x3bd24a['attributes']:_0x50aae3[_0x14f3('0x32')];if(!_0x269abe['query']['hasOwnProperty']('nolimit')){_0x3bd24a[_0x14f3('0x1a')]=qs[_0x14f3('0x1a')](_0x269abe['query'][_0x14f3('0x1a')]);_0x3bd24a[_0x14f3('0x1c')]=qs[_0x14f3('0x1c')](_0x269abe['query']['offset']);}_0x3bd24a[_0x14f3('0x36')]=qs[_0x14f3('0x37')](_0x269abe[_0x14f3('0x2e')]['sort']);_0x3bd24a[_0x14f3('0x38')]=qs[_0x14f3('0x30')](_['pick'](_0x269abe[_0x14f3('0x2e')],_0x50aae3[_0x14f3('0x30')]),_0x55277d);if(_0x269abe[_0x14f3('0x2e')]['filter']){_0x3bd24a['where']=_['merge'](_0x3bd24a[_0x14f3('0x38')],{'$or':_[_0x14f3('0x29')](_0x55277d,function(_0x30c30d){if(_0x30c30d[_0x14f3('0x2c')]!=='VIRTUAL'){var _0x15aea7={};_0x15aea7[_0x30c30d[_0x14f3('0x26')]]={'$like':'%'+_0x269abe['query']['filter']+'%'};return _0x15aea7;}})});}_0x3bd24a=_[_0x14f3('0x39')]({},_0x3bd24a,_0x269abe['options']);var _0x42b2a1={'where':_0x3bd24a[_0x14f3('0x38')]};return db[_0x14f3('0x2a')][_0x14f3('0x1b')](_0x42b2a1)[_0x14f3('0x24')](function(_0x5e7652){_0x59e4ee['count']=_0x5e7652;if(_0x269abe[_0x14f3('0x2e')][_0x14f3('0x3a')]){_0x3bd24a[_0x14f3('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x14f3('0x3c')](_0x3bd24a);})[_0x14f3('0x24')](function(_0x19ccb2){_0x59e4ee[_0x14f3('0x3d')]=_0x19ccb2;return _0x59e4ee;})[_0x14f3('0x24')](respondWithFilteredResult(_0x1bce4f,_0x3bd24a))[_0x14f3('0x3e')](handleError(_0x1bce4f,null));};exports[_0x14f3('0x3f')]=function(_0x5307c9,_0xebefe0){var _0x58fec7={'raw':!![],'where':{'id':_0x5307c9[_0x14f3('0x40')]['id']}},_0x16bc11={};_0x16bc11[_0x14f3('0x32')]=_[_0x14f3('0x2f')](db[_0x14f3('0x2a')][_0x14f3('0x2b')]);_0x16bc11[_0x14f3('0x2e')]=_[_0x14f3('0x2f')](_0x5307c9[_0x14f3('0x2e')]);_0x16bc11[_0x14f3('0x30')]=_[_0x14f3('0x31')](_0x16bc11[_0x14f3('0x32')],_0x16bc11[_0x14f3('0x2e')]);_0x58fec7['attributes']=_[_0x14f3('0x31')](_0x16bc11[_0x14f3('0x32')],qs[_0x14f3('0x34')](_0x5307c9[_0x14f3('0x2e')][_0x14f3('0x34')]));_0x58fec7['attributes']=_0x58fec7[_0x14f3('0x33')][_0x14f3('0x35')]?_0x58fec7[_0x14f3('0x33')]:_0x16bc11[_0x14f3('0x32')];if(_0x5307c9[_0x14f3('0x2e')][_0x14f3('0x3a')]){_0x58fec7[_0x14f3('0x3b')]=[{'all':!![]}];}_0x58fec7=_[_0x14f3('0x39')]({},_0x58fec7,_0x5307c9[_0x14f3('0x41')]);return db[_0x14f3('0x2a')][_0x14f3('0x42')](_0x58fec7)['then'](handleEntityNotFound(_0xebefe0,null))[_0x14f3('0x24')](respondWithResult(_0xebefe0,null))[_0x14f3('0x3e')](handleError(_0xebefe0,null));};exports[_0x14f3('0x43')]=function(_0x25d5e6,_0x243e6a){return db['WhatsappTransferReport']['create'](_0x25d5e6['body'],{})['then'](respondWithResult(_0x243e6a,0xc9))[_0x14f3('0x3e')](handleError(_0x243e6a,null));};exports[_0x14f3('0x22')]=function(_0x5dcbf3,_0x17c28c){if(_0x5dcbf3[_0x14f3('0x44')]['id']){delete _0x5dcbf3['body']['id'];}return db[_0x14f3('0x2a')][_0x14f3('0x42')]({'where':{'id':_0x5dcbf3[_0x14f3('0x40')]['id']}})[_0x14f3('0x24')](handleEntityNotFound(_0x17c28c,null))['then'](saveUpdates(_0x5dcbf3[_0x14f3('0x44')],null))[_0x14f3('0x24')](respondWithResult(_0x17c28c,null))[_0x14f3('0x3e')](handleError(_0x17c28c,null));};exports[_0x14f3('0x23')]=function(_0x20892d,_0x357190){return db[_0x14f3('0x2a')][_0x14f3('0x42')]({'where':{'id':_0x20892d[_0x14f3('0x40')]['id']}})[_0x14f3('0x24')](handleEntityNotFound(_0x357190,null))[_0x14f3('0x24')](removeEntity(_0x357190,null))[_0x14f3('0x3e')](handleError(_0x357190,null));};exports['describe']=function(_0x257b8f,_0x82763c){return db[_0x14f3('0x2a')][_0x14f3('0x45')]()['then'](respondWithResult(_0x82763c,null))['catch'](handleError(_0x82763c,null));};
\ No newline at end of file
index 4e11065..f2f4255 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9891=['../../config/logger','api','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x57e60f,_0x4c868c){var _0xbbcc8=function(_0x5907bc){while(--_0x5907bc){_0x57e60f['push'](_0x57e60f['shift']());}};_0xbbcc8(++_0x4c868c);}(_0x9891,0x8e));var _0x1989=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0x9891[_0x1dc24d];return _0x5d7fb2;};'use strict';var _=require(_0x1989('0x0'));var util=require(_0x1989('0x1'));var logger=require(_0x1989('0x2'))(_0x1989('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1989('0x4'));var rimraf=require(_0x1989('0x5'));var config=require(_0x1989('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x1989('0x7')]=function(_0x382688,_0x514e7b){return _0x382688[_0x1989('0x8')](_0x1989('0x9'),attributes,{'tableName':_0x1989('0xa'),'paranoid':![],'indexes':[{'name':_0x1989('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd92=['moment','bluebird','path','../../config/environment','./whatsappTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger'];(function(_0x2026a2,_0x3ffb61){var _0xce6033=function(_0x267170){while(--_0x267170){_0x2026a2['push'](_0x2026a2['shift']());}};_0xce6033(++_0x3ffb61);}(_0xfd92,0x101));var _0x2fd9=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xfd92[_0x581249];return _0x284bae;};'use strict';var _=require(_0x2fd9('0x0'));var util=require(_0x2fd9('0x1'));var logger=require(_0x2fd9('0x2'))('api');var moment=require(_0x2fd9('0x3'));var BPromise=require(_0x2fd9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fd9('0x5'));var rimraf=require('rimraf');var config=require(_0x2fd9('0x6'));var attributes=require(_0x2fd9('0x7'));module['exports']=function(_0x2c7d27,_0xff764b){return _0x2c7d27[_0x2fd9('0x8')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x2fd9('0x9'),'fields':[_0x2fd9('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 5dfcb13..9e11894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534f=['jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x538c15,_0x15641c){var _0x1432f4=function(_0x7b6519){while(--_0x7b6519){_0x538c15['push'](_0x538c15['shift']());}};_0x1432f4(++_0x15641c);}(_0x534f,0x1af));var _0xf534=function(_0x102f24,_0x517075){_0x102f24=_0x102f24-0x0;var _0x9770e5=_0x534f[_0x102f24];return _0x9770e5;};'use strict';var _=require(_0xf534('0x0'));var util=require(_0xf534('0x1'));var moment=require(_0xf534('0x2'));var BPromise=require(_0xf534('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf534('0x4'));var db=require(_0xf534('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf534('0x6'))(_0xf534('0x7'));var config=require(_0xf534('0x8'));var jayson=require(_0xf534('0x9'));var client=jayson[_0xf534('0xa')][_0xf534('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x514473,_0x3add73,_0x5b3fdb){return new BPromise(function(_0xdb160a,_0x48febf){return client['request'](_0x514473,_0x5b3fdb)[_0xf534('0xc')](function(_0x51f3b0){logger[_0xf534('0xd')](_0xf534('0xe'),_0x3add73,_0xf534('0xf'));logger[_0xf534('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x3add73,_0xf534('0xf'),JSON[_0xf534('0x11')](_0x51f3b0));if(_0x51f3b0[_0xf534('0x12')]){if(_0x51f3b0[_0xf534('0x12')]['code']===0x1f4){logger[_0xf534('0x12')](_0xf534('0xe'),_0x3add73,_0x51f3b0[_0xf534('0x12')][_0xf534('0x13')]);return _0x48febf(_0x51f3b0['error']['message']);}logger['error'](_0xf534('0xe'),_0x3add73,_0x51f3b0[_0xf534('0x12')][_0xf534('0x13')]);return _0xdb160a(_0x51f3b0['error'][_0xf534('0x13')]);}else{logger[_0xf534('0xd')](_0xf534('0xe'),_0x3add73,_0xf534('0xf'));_0xdb160a(_0x51f3b0['result'][_0xf534('0x13')]);}})['catch'](function(_0x27eaa6){logger[_0xf534('0x12')](_0xf534('0xe'),_0x3add73,_0x27eaa6);_0x48febf(_0x27eaa6);});});}
\ No newline at end of file
+var _0x16a8=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5ee460,_0x284a57){var _0x25380e=function(_0x1e095d){while(--_0x1e095d){_0x5ee460['push'](_0x5ee460['shift']());}};_0x25380e(++_0x284a57);}(_0x16a8,0xb4));var _0x816a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x16a8[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x816a('0x0'));var util=require('util');var moment=require(_0x816a('0x1'));var BPromise=require(_0x816a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x816a('0x3'))['db'];var utils=require(_0x816a('0x4'));var logger=require(_0x816a('0x5'))(_0x816a('0x6'));var config=require(_0x816a('0x7'));var jayson=require(_0x816a('0x8'));var client=jayson[_0x816a('0x9')][_0x816a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b2c2a,_0x4e48dd,_0x162859){return new BPromise(function(_0x110d84,_0x38db8d){return client[_0x816a('0xb')](_0x2b2c2a,_0x162859)[_0x816a('0xc')](function(_0xd8f4cf){logger[_0x816a('0xd')](_0x816a('0xe'),_0x4e48dd,_0x816a('0xf'));logger[_0x816a('0x10')](_0x816a('0x11'),_0x4e48dd,'request\x20sent',JSON[_0x816a('0x12')](_0xd8f4cf));if(_0xd8f4cf[_0x816a('0x13')]){if(_0xd8f4cf[_0x816a('0x13')][_0x816a('0x14')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x4e48dd,_0xd8f4cf[_0x816a('0x13')][_0x816a('0x15')]);return _0x38db8d(_0xd8f4cf[_0x816a('0x13')][_0x816a('0x15')]);}logger[_0x816a('0x13')](_0x816a('0xe'),_0x4e48dd,_0xd8f4cf[_0x816a('0x13')][_0x816a('0x15')]);return _0x110d84(_0xd8f4cf['error'][_0x816a('0x15')]);}else{logger[_0x816a('0xd')](_0x816a('0xe'),_0x4e48dd,_0x816a('0xf'));_0x110d84(_0xd8f4cf[_0x816a('0x16')]['message']);}})[_0x816a('0x17')](function(_0x37f71f){logger[_0x816a('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4e48dd,_0x37f71f);_0x38db8d(_0x37f71f);});});}
\ No newline at end of file
index 345c87e..d51b41c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2f9=['name','join','Offline\x20apps:','status','seedDB','./config/seedDB','default','./config/license','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','then','listen','info','start','Online\x20apps:','map','filter','online'];(function(_0x4df204,_0x164b7a){var _0x4d8fbb=function(_0x1d9f1d){while(--_0x1d9f1d){_0x4df204['push'](_0x4df204['shift']());}};_0x4d8fbb(++_0x164b7a);}(_0xd2f9,0x13e));var _0x9d2f=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0xd2f9[_0x210718];return _0x541bfc;};'use strict';var _=require(_0x9d2f('0x0'));var mysqldb=require(_0x9d2f('0x1'));var rpc=require(_0x9d2f('0x2'));var config=require(_0x9d2f('0x3'));var logger=require(_0x9d2f('0x4'))(_0x9d2f('0x5'));var pm2=require(_0x9d2f('0x6'));var pm2Config=require(_0x9d2f('0x7'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x9d2f('0x8'));var transcribe=require(_0x9d2f('0x9'));function main(){return mysqldb['db']['sequelize']['sync']()[_0x9d2f('0xa')](function(){return rpc[_0x9d2f('0xb')]();})[_0x9d2f('0xa')](function(_0x307f3f){logger[_0x9d2f('0xc')](_0x307f3f);return chat[_0x9d2f('0xd')]();})[_0x9d2f('0xa')](function(){return whatsapp['start']();})[_0x9d2f('0xa')](function(){return schedule[_0x9d2f('0xd')]();})[_0x9d2f('0xa')](function(){return transcribe[_0x9d2f('0xd')]();})['then'](function(_0x145134){logger[_0x9d2f('0xc')](_0x145134);return pm2[_0x9d2f('0xd')](pm2Config);})[_0x9d2f('0xa')](function(_0x1f679b){logger[_0x9d2f('0xc')](_0x9d2f('0xe'),_[_0x9d2f('0xf')](_[_0x9d2f('0x10')](_0x1f679b,{'status':_0x9d2f('0x11')}),_0x9d2f('0x12'))[_0x9d2f('0x13')]());logger[_0x9d2f('0xc')](_0x9d2f('0x14'),_['map'](_[_0x9d2f('0x10')](_0x1f679b,function(_0x50346a){return _0x50346a[_0x9d2f('0x15')]!==_0x9d2f('0x11');}),_0x9d2f('0x12'))[_0x9d2f('0x13')]()||'None');config[_0x9d2f('0x16')]&&require(_0x9d2f('0x17'))[_0x9d2f('0x18')]();require(_0x9d2f('0x19'))[_0x9d2f('0x18')]();})['catch'](function(_0x319d67){logger['error'](_0x9d2f('0x1a'),_0x319d67);process[_0x9d2f('0x1b')](0x1);});}main();
\ No newline at end of file
+var _0x1c9b=['join','None','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','listen','info','start','Online\x20apps:','map','filter','status','name'];(function(_0x4f94ee,_0x26e8fd){var _0x1bb8ec=function(_0x466638){while(--_0x466638){_0x4f94ee['push'](_0x4f94ee['shift']());}};_0x1bb8ec(++_0x26e8fd);}(_0x1c9b,0x147));var _0xb1c9=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0x1c9b[_0x508685];return _0x976a76;};'use strict';var _=require(_0xb1c9('0x0'));var mysqldb=require(_0xb1c9('0x1'));var rpc=require(_0xb1c9('0x2'));var config=require(_0xb1c9('0x3'));var logger=require(_0xb1c9('0x4'))(_0xb1c9('0x5'));var pm2=require(_0xb1c9('0x6'));var pm2Config=require(_0xb1c9('0x7'));var schedule=require(_0xb1c9('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xb1c9('0x9'));var transcribe=require(_0xb1c9('0xa'));function main(){return mysqldb['db'][_0xb1c9('0xb')]['sync']()[_0xb1c9('0xc')](function(){return rpc[_0xb1c9('0xd')]();})['then'](function(_0x358666){logger[_0xb1c9('0xe')](_0x358666);return chat['start']();})[_0xb1c9('0xc')](function(){return whatsapp['start']();})[_0xb1c9('0xc')](function(){return schedule['start']();})[_0xb1c9('0xc')](function(){return transcribe['start']();})['then'](function(_0x49c030){logger[_0xb1c9('0xe')](_0x49c030);return pm2[_0xb1c9('0xf')](pm2Config);})['then'](function(_0x2654b5){logger['info'](_0xb1c9('0x10'),_[_0xb1c9('0x11')](_[_0xb1c9('0x12')](_0x2654b5,{'status':'online'}),'name')['join']());logger[_0xb1c9('0xe')]('Offline\x20apps:',_[_0xb1c9('0x11')](_[_0xb1c9('0x12')](_0x2654b5,function(_0x153862){return _0x153862[_0xb1c9('0x13')]!=='online';}),_0xb1c9('0x14'))[_0xb1c9('0x15')]()||_0xb1c9('0x16'));config['seedDB']&&require(_0xb1c9('0x17'))[_0xb1c9('0x18')]();require(_0xb1c9('0x19'))[_0xb1c9('0x18')]();})[_0xb1c9('0x1a')](function(_0x4a8467){logger[_0xb1c9('0x1b')](_0xb1c9('0x1c'),_0x4a8467);process['exit'](0x1);});}main();
\ No newline at end of file
index 65501b3..f126279 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ab7=['voicePause','chatPause','openchannelPause','pauseType','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','User','find','name','authenticate','pass','startsWith','Bearer','query','apikey','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','apiKeyNonce','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','join','promisify','secret','verify','secrets','toString','hex','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','util','moment','session','role','fullname','email','userpic','permissions','md5secret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6ab7,0xdb));var _0x76ab=function(_0x259f92,_0x10e71a){_0x259f92=_0x259f92-0x0;var _0x229137=_0x6ab7[_0x259f92];return _0x229137;};'use strict';var db=require(_0x76ab('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x76ab('0x1'));var licenseUtil=require(_0x76ab('0x2'));var encryptor=require(_0x76ab('0x3'));var _=require('lodash');var jwt=require(_0x76ab('0x4'));var expressJwt=require(_0x76ab('0x5'));var compose=require(_0x76ab('0x6'));var basicAuth=require(_0x76ab('0x7'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x76ab('0x8'));var moment=require(_0x76ab('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x76ab('0xa')]});var userAttributes=['id',_0x76ab('0xb'),_0x76ab('0xc'),'name','internal',_0x76ab('0xd'),_0x76ab('0xe'),_0x76ab('0xf'),_0x76ab('0x10'),_0x76ab('0x11'),_0x76ab('0x12'),'mailPause','faxPause','smsPause',_0x76ab('0x13'),_0x76ab('0x14'),'showWebBar',_0x76ab('0x15'),'lastPauseAt',_0x76ab('0x16'),'allowmessenger',_0x76ab('0x17'),_0x76ab('0x18'),_0x76ab('0x19'),'phoneBarAutoAnswerDelay',_0x76ab('0x1a'),'phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires',_0x76ab('0x1b'),_0x76ab('0x1c'),_0x76ab('0x1d'),_0x76ab('0x1e'),_0x76ab('0x1f'),'userProfileId',_0x76ab('0x20'),_0x76ab('0x21'),_0x76ab('0x22'),'downloadVoiceRecordings',_0x76ab('0x23'),_0x76ab('0x24'),_0x76ab('0x25'),_0x76ab('0x26')];exports[_0x76ab('0x27')]=function(){return this['isAuthenticated'](!![])[_0x76ab('0x28')](function(_0x5d32cc,_0xa626f,_0x50f3c5){if(_0x5d32cc[_0x76ab('0x29')]){_0x50f3c5();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x5d32cc[_0x76ab('0x2a')]['id']},'attributes':['id',_0x76ab('0x2b'),_0x76ab('0x2c')],'raw':!![]})[_0x76ab('0x2d')](function(_0x1e9f59){if(_0x1e9f59&&_0x1e9f59[_0x76ab('0x2b')]){return _0xa626f[_0x76ab('0x2e')](_0x1e9f59['disposition']===_0x76ab('0x2f')?0x195:0x193)[_0x76ab('0x30')]({'message':_0x1e9f59['disposition']===_0x76ab('0x2f')?_0x76ab('0x31'):_0x76ab('0x32')});}else{_0x50f3c5();}})[_0x76ab('0x33')](function(_0x46b115){_0x50f3c5(_0x46b115);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a94d){return compose()[_0x76ab('0x28')](function(_0x1268cd,_0x103377,_0x4db732){var _0x37f755;if(_0x1268cd[_0x76ab('0x34')][_0x76ab('0x35')]){if(_['startsWith'](_0x1268cd[_0x76ab('0x34')]['authorization'],_0x76ab('0x36'))){var _0x427e4b=basicAuth(_0x1268cd);db[_0x76ab('0x37')][_0x76ab('0x38')]({'where':{'name':_0x427e4b[_0x76ab('0x39')]}})[_0x76ab('0x2d')](function(_0x4fe0eb){if(!_0x4fe0eb||!_0x4fe0eb[_0x76ab('0x3a')](_0x427e4b[_0x76ab('0x3b')])){return _0x103377['status'](0x191)[_0x76ab('0x30')]({'message':'Wrong\x20credentials.'});}_0x1268cd[_0x76ab('0x29')]={'id':_0x4fe0eb['id']};_0x4db732();})['catch'](function(_0x1d6836){_0x4db732(_0x1d6836);});}else if(_[_0x76ab('0x3c')](_0x1268cd[_0x76ab('0x34')][_0x76ab('0x35')],_0x76ab('0x3d'))){validateJwt(_0x1268cd,_0x103377,_0x4db732);}else{if(_0x30a94d){_0x4db732();}else{return _0x103377[_0x76ab('0x2e')](0x193)[_0x76ab('0x30')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x1268cd[_0x76ab('0x3e')][_0x76ab('0x3f')]){try{var _0x251f14={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1268cd[_0x76ab('0x3e')][_0x76ab('0x3f')],_0x251f14)[_0x76ab('0x2d')](function(_0x98b56a){return db[_0x76ab('0x37')][_0x76ab('0x38')]({'where':{'id':_0x98b56a[_0x76ab('0x40')]}})[_0x76ab('0x2d')](function(_0x3d49e0){_0x37f755=_0x3d49e0;return db[_0x76ab('0x41')][_0x76ab('0x42')]({'where':{'id':0x1},'attributes':[_0x76ab('0x43'),_0x76ab('0x44')],'raw':!![]});})[_0x76ab('0x2d')](function(_0x2a5d88){if(!_0x37f755||!_[_0x76ab('0x45')](_0x37f755['apiKeyNonce'],_0x98b56a[_0x76ab('0x46')])){return _0x103377['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x37f755[_0x76ab('0x47')]){return _0x103377[_0x76ab('0x2e')](0x191)['json']({'message':_0x76ab('0x48')});}if(_0x37f755[_0x76ab('0x49')]){if(_0x2a5d88['blockDuration']>0x0){if(moment(_0x37f755[_0x76ab('0x4a')])[_0x76ab('0x4b')](_0x2a5d88[_0x76ab('0x44')],_0x76ab('0x4c'))>moment()){return _0x103377[_0x76ab('0x2e')](0x191)[_0x76ab('0x30')]({'message':_0x76ab('0x48')});}}else{return _0x103377[_0x76ab('0x2e')](0x191)[_0x76ab('0x30')]({'message':_0x76ab('0x48')});}}_0x1268cd[_0x76ab('0x29')]={'id':_0x37f755['id']};_0x4db732();});})[_0x76ab('0x33')](function(){return _0x103377[_0x76ab('0x2e')](0x191)[_0x76ab('0x30')]({'message':_0x76ab('0x48')});});}catch(_0x3f5d33){_0x4db732(_0x3f5d33);}}else if(_0x30a94d){_0x4db732();}else{return _0x103377[_0x76ab('0x2e')](0x193)[_0x76ab('0x30')]({'message':_0x76ab('0x4d')});}})['use'](function(_0x365e29,_0x4ab02f,_0x389dc9){if(_0x365e29['user']){db['User'][_0x76ab('0x38')]({'where':{'id':_0x365e29['user']['id']},'attributes':userAttributes})['then'](function(_0x561abb){if(!_0x561abb){return _0x4ab02f['status'](0x194)[_0x76ab('0x30')]({'message':_0x76ab('0x4e')});}_0x365e29['user']=_0x561abb;_0x389dc9();})[_0x76ab('0x33')](function(_0x4cb877){_0x389dc9(_0x4cb877);});}else if(_0x30a94d){_0x389dc9();}else{return _0x4ab02f[_0x76ab('0x2e')](0x194)[_0x76ab('0x30')]({'message':_0x76ab('0x4f')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x76ab('0x28')](function(_0x4ef102,_0x3468d0,_0x50c4e5){return licenseUtil[_0x76ab('0x50')]()['then'](function(_0x20ad63){if(_0x20ad63[_0x76ab('0x51')]){_0x50c4e5();}else{return _0x3468d0[_0x76ab('0x2e')](0x193)[_0x76ab('0x30')]({'message':'Forbidden'});}})['catch'](function(_0x41895a){_0x50c4e5(_0x41895a);});});};exports[_0x76ab('0x52')]=function(_0x1215dd,_0x278e5d,_0x172ff0){_0x1215dd[_0x76ab('0x52')]=!![];return _0x172ff0();};exports[_0x76ab('0x53')]=function signToken(_0x436723){return signJwt(_0x436723);};exports[_0x76ab('0x54')]=function(_0xb91f1f,_0x7fa00d){if(!_0xb91f1f[_0x76ab('0x29')]){return _0x7fa00d[_0x76ab('0x2e')](0x194)['json']({'message':_0x76ab('0x55')});}var _0x2d13e8={'payload':{'id':_0xb91f1f[_0x76ab('0x29')]['id'],'role':_0xb91f1f['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2d13e8)[_0x76ab('0x2d')](function(_0x41944e){_0x7fa00d[_0x76ab('0x56')](_0x76ab('0x57'),_0x41944e);_0x7fa00d[_0x76ab('0x58')](_0x76ab('0x59'));})[_0x76ab('0x33')](function(_0x4791e4){return _0x7fa00d[_0x76ab('0x2e')](0x1f4)[_0x76ab('0x5a')](_0x4791e4);});};exports['retrieveApiKey']=function(_0x3c280b){if(_[_0x76ab('0x5b')](_0x3c280b['apiKeyNonce'])||_[_0x76ab('0x5b')](_0x3c280b[_0x76ab('0x5c')])){return null;}else{return createJwt(_0x3c280b);}};exports['generateApiKey']=function(_0x41c07f){_0x41c07f[_0x76ab('0x5d')]=generateNonce();_0x41c07f[_0x76ab('0x5c')]=generateIssuedAt();return createJwt(_0x41c07f);};exports[_0x76ab('0x5e')]=function(_0x2c7b4b,_0x429d8a){var _0xb33a84=_0x2c7b4b[_0x76ab('0x3e')][_0x76ab('0x3f')];if(_0xb33a84){var _0x5bf21b={'nonce':_0x429d8a[_0x76ab('0x5d')],'iat':_0x429d8a['apiKeyIat'],'audience':hardwareConf[_0x76ab('0x5f')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xb33a84,_0x5bf21b)[_0x76ab('0x2d')](function(){return generateApiKey(_0x429d8a);});}else{throw{'message':_0x76ab('0x60')};}};exports[_0x76ab('0x61')]=function(_0x2ce830){var _0x35eeee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x35eeee['test'](_0x2ce830))throw new db[(_0x76ab('0x62'))][(_0x76ab('0x63'))](_0x76ab('0x64'));return;};exports[_0x76ab('0x65')]=function(_0x1204b4,_0xc0e09b,_0x3f20b2){var _0x2c77f8=encryptor[_0x76ab('0x66')](_0xc0e09b)[_0x76ab('0x67')](',');for(var _0x14acbc=0x0;_0x14acbc<_0x3f20b2;_0x14acbc++){if(!_0x2c77f8[_0x14acbc])break;if(_0x1204b4[_0x76ab('0x68')]()===_0x2c77f8[_0x14acbc]['toLowerCase']()){var _0xc1c85d=util[_0x76ab('0x69')](_0x76ab('0x6a'),_0x3f20b2);if(_0x3f20b2===0x1){_0xc1c85d=_0x76ab('0x6b');}throw new db['Sequelize'][(_0x76ab('0x63'))](_0xc1c85d);}}return;};exports[_0x76ab('0x6c')]=function(_0x4a8c12,_0x4c1d4f){var _0x209288=_0x4c1d4f?encryptor[_0x76ab('0x66')](_0x4c1d4f)[_0x76ab('0x67')](','):[];if(_0x209288[_0x76ab('0x6d')]===0x5){_0x209288[_0x76ab('0x6e')](-0x1,0x1);}_0x209288['unshift'](_0x4a8c12);return encryptor['encryptString'](_0x209288[_0x76ab('0x6f')](','));};function signJwt(_0xbd8a6d){var _0x3354fe=BPromise[_0x76ab('0x70')](jwt['sign'],{'context':jwt});var _0x53fba1=_0xbd8a6d[_0x76ab('0x71')]||config['secrets'][_0x76ab('0xa')];return new BPromise(function(_0x5ecf3e,_0x58c9c5){_0x3354fe(_0xbd8a6d['payload'],_0x53fba1,_0xbd8a6d['options'])['then'](function(_0xe65fe8){_0x5ecf3e(_0xe65fe8);})['catch'](function(_0x49f3a4){_0x58c9c5(_0x49f3a4);});});}function verifyJwt(_0x1b83c5,_0x288c32,_0x3a3547){var _0x33b557=BPromise['promisify'](jwt[_0x76ab('0x72')],{'context':jwt});var _0x503782=_0x3a3547||config[_0x76ab('0x73')][_0x76ab('0xa')];return new BPromise(function(_0x3c2e01,_0x3ac9ef){_0x33b557(_0x1b83c5,_0x503782,_0x288c32)[_0x76ab('0x2d')](function(_0x5f35a4){_0x3c2e01(_0x5f35a4);})['catch'](function(_0x5a4c91){_0x3ac9ef(_0x5a4c91);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x76ab('0x74')](_0x76ab('0x75'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)['toString']();}function createJwt(_0x3fedf9){var _0x1dca66={'payload':{'iat':_0x3fedf9[_0x76ab('0x5c')],'nonce':_0x3fedf9['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x3fedf9['id'][_0x76ab('0x74')](),'issuer':hardwareConf[_0x76ab('0x5f')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1dca66)[_0x76ab('0x2d')](function(_0x414f71){return{'iat':_0x3fedf9[_0x76ab('0x5c')],'nonce':_0x3fedf9[_0x76ab('0x5d')],'token':_0x414f71};});}
\ No newline at end of file
+var _0xd6f6=['phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','params','closed','disposition','status','unmanaged','Unmanaged.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','then','find','sub','Setting','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','blockDuration','User\x20not\x20found.','update','Forbidden','isMiddleware','signToken','role','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','sign','secret','session','options','verify','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','fullname','name','internal','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired'];(function(_0x40ba90,_0xf43e5){var _0x171db3=function(_0x3cbaaa){while(--_0x3cbaaa){_0x40ba90['push'](_0x40ba90['shift']());}};_0x171db3(++_0xf43e5);}(_0xd6f6,0x14b));var _0x6d6f=function(_0x25facc,_0x3b83de){_0x25facc=_0x25facc-0x0;var _0x2ae4dd=_0xd6f6[_0x25facc];return _0x2ae4dd;};'use strict';var db=require(_0x6d6f('0x0'))['db'];var config=require(_0x6d6f('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x6d6f('0x2'));var _=require('lodash');var jwt=require(_0x6d6f('0x3'));var expressJwt=require(_0x6d6f('0x4'));var compose=require(_0x6d6f('0x5'));var basicAuth=require(_0x6d6f('0x6'));var crypto=require('crypto');var BPromise=require(_0x6d6f('0x7'));var util=require(_0x6d6f('0x8'));var moment=require(_0x6d6f('0x9'));var validateJwt=expressJwt({'secret':config[_0x6d6f('0xa')]['session']});var userAttributes=['id','role',_0x6d6f('0xb'),_0x6d6f('0xc'),_0x6d6f('0xd'),'email',_0x6d6f('0xe'),_0x6d6f('0xf'),_0x6d6f('0x10'),_0x6d6f('0x11'),_0x6d6f('0x12'),_0x6d6f('0x13'),'faxPause',_0x6d6f('0x14'),_0x6d6f('0x15'),_0x6d6f('0x16'),_0x6d6f('0x17'),_0x6d6f('0x18'),_0x6d6f('0x19'),_0x6d6f('0x1a'),_0x6d6f('0x1b'),'passwordResetAt',_0x6d6f('0x1c'),_0x6d6f('0x1d'),'phoneBarAutoAnswerDelay',_0x6d6f('0x1e'),_0x6d6f('0x1f'),_0x6d6f('0x20'),'phoneBarEnableSettings',_0x6d6f('0x21'),_0x6d6f('0x22'),_0x6d6f('0x23'),_0x6d6f('0x24'),'hotdesk',_0x6d6f('0x25'),_0x6d6f('0x26'),_0x6d6f('0x27'),'settingsEnabled',_0x6d6f('0x28'),_0x6d6f('0x29'),'downloadOmnichannelInteractions',_0x6d6f('0x2a'),_0x6d6f('0x2b'),_0x6d6f('0x2c')];exports[_0x6d6f('0x2d')]=function(){return this['isAuthenticated'](!![])[_0x6d6f('0x2e')](function(_0x4a966f,_0x3df7d9,_0x14c220){if(_0x4a966f[_0x6d6f('0x2f')]){_0x14c220();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4a966f[_0x6d6f('0x30')]['id']},'attributes':['id',_0x6d6f('0x31'),_0x6d6f('0x32')],'raw':!![]})['then'](function(_0x5aa6e6){if(_0x5aa6e6&&_0x5aa6e6[_0x6d6f('0x31')]){return _0x3df7d9[_0x6d6f('0x33')](_0x5aa6e6['disposition']===_0x6d6f('0x34')?0x195:0x193)['json']({'message':_0x5aa6e6[_0x6d6f('0x32')]==='unmanaged'?_0x6d6f('0x35'):'Forbidden.'});}else{_0x14c220();}})[_0x6d6f('0x36')](function(_0x4f0cf4){_0x14c220(_0x4f0cf4);});}});};exports['isAuthenticated']=function isAuthenticated(_0x1ec73b){return compose()['use'](function(_0x40d1ff,_0x2cecaf,_0x2d71a2){var _0x440bb;if(_0x40d1ff[_0x6d6f('0x37')][_0x6d6f('0x38')]){if(_[_0x6d6f('0x39')](_0x40d1ff[_0x6d6f('0x37')][_0x6d6f('0x38')],_0x6d6f('0x3a'))){var _0x3406b0=basicAuth(_0x40d1ff);db[_0x6d6f('0x3b')]['find']({'where':{'name':_0x3406b0[_0x6d6f('0xc')]}})['then'](function(_0x3a5c57){if(!_0x3a5c57||!_0x3a5c57[_0x6d6f('0x3c')](_0x3406b0[_0x6d6f('0x3d')])){return _0x2cecaf['status'](0x191)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x3f')});}_0x40d1ff[_0x6d6f('0x2f')]={'id':_0x3a5c57['id']};_0x2d71a2();})[_0x6d6f('0x36')](function(_0x5c49b4){_0x2d71a2(_0x5c49b4);});}else if(_[_0x6d6f('0x39')](_0x40d1ff[_0x6d6f('0x37')]['authorization'],_0x6d6f('0x40'))){validateJwt(_0x40d1ff,_0x2cecaf,_0x2d71a2);}else{if(_0x1ec73b){_0x2d71a2();}else{return _0x2cecaf[_0x6d6f('0x33')](0x193)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x41')});}}}else if(_0x40d1ff[_0x6d6f('0x42')][_0x6d6f('0x43')]){try{var _0x424498={'audience':hardwareConf[_0x6d6f('0x44')](),'issuer':hardwareConf[_0x6d6f('0x44')]()};verifyJwt(_0x40d1ff['query']['apikey'],_0x424498)[_0x6d6f('0x45')](function(_0x54f60e){return db['User'][_0x6d6f('0x46')]({'where':{'id':_0x54f60e[_0x6d6f('0x47')]}})[_0x6d6f('0x45')](function(_0x364f17){_0x440bb=_0x364f17;return db[_0x6d6f('0x48')]['findOne']({'where':{'id':0x1},'attributes':[_0x6d6f('0x49'),'blockDuration'],'raw':!![]});})[_0x6d6f('0x45')](function(_0x4f3667){if(!_0x440bb||!_[_0x6d6f('0x4a')](_0x440bb['apiKeyNonce'],_0x54f60e['nonce'])){return _0x2cecaf[_0x6d6f('0x33')](0x191)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x4b')});}if(_0x440bb['disabled']){return _0x2cecaf[_0x6d6f('0x33')](0x191)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x4c')});}if(_0x440bb[_0x6d6f('0x4d')]){if(_0x4f3667['blockDuration']>0x0){if(moment(_0x440bb[_0x6d6f('0x4e')])[_0x6d6f('0x4f')](_0x4f3667[_0x6d6f('0x50')],'minutes')>moment()){return _0x2cecaf[_0x6d6f('0x33')](0x191)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x4c')});}}else{return _0x2cecaf['status'](0x191)['json']({'message':_0x6d6f('0x4c')});}}_0x40d1ff[_0x6d6f('0x2f')]={'id':_0x440bb['id']};_0x2d71a2();});})[_0x6d6f('0x36')](function(){return _0x2cecaf[_0x6d6f('0x33')](0x191)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x4c')});});}catch(_0x20b0db){_0x2d71a2(_0x20b0db);}}else if(_0x1ec73b){_0x2d71a2();}else{return _0x2cecaf[_0x6d6f('0x33')](0x193)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x41')});}})[_0x6d6f('0x2e')](function(_0x115841,_0x1ffa57,_0x5097a2){if(_0x115841[_0x6d6f('0x2f')]){db[_0x6d6f('0x3b')][_0x6d6f('0x46')]({'where':{'id':_0x115841[_0x6d6f('0x2f')]['id']},'attributes':userAttributes})['then'](function(_0x137f2f){if(!_0x137f2f){return _0x1ffa57[_0x6d6f('0x33')](0x194)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x51')});}_0x115841[_0x6d6f('0x2f')]=_0x137f2f;_0x5097a2();})[_0x6d6f('0x36')](function(_0x5878de){_0x5097a2(_0x5878de);});}else if(_0x1ec73b){_0x5097a2();}else{return _0x1ffa57[_0x6d6f('0x33')](0x194)[_0x6d6f('0x3e')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0xf42e5c,_0x1fed2f,_0x28a1c0){return licenseUtil['getLicense']()[_0x6d6f('0x45')](function(_0xdfbc8f){if(_0xdfbc8f[_0x6d6f('0x52')]){_0x28a1c0();}else{return _0x1fed2f[_0x6d6f('0x33')](0x193)[_0x6d6f('0x3e')]({'message':_0x6d6f('0x53')});}})[_0x6d6f('0x36')](function(_0x5e7abf){_0x28a1c0(_0x5e7abf);});});};exports[_0x6d6f('0x54')]=function(_0x25fc8e,_0x13916c,_0x1f8661){_0x25fc8e['isMiddleware']=!![];return _0x1f8661();};exports[_0x6d6f('0x55')]=function signToken(_0xfedd97){return signJwt(_0xfedd97);};exports['setTokenCookie']=function(_0x5213d6,_0x5a2158){if(!_0x5213d6[_0x6d6f('0x2f')]){return _0x5a2158[_0x6d6f('0x33')](0x194)[_0x6d6f('0x3e')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x42807d={'payload':{'id':_0x5213d6['user']['id'],'role':_0x5213d6[_0x6d6f('0x2f')][_0x6d6f('0x56')]},'options':{'expiresIn':0x15180}};return signJwt(_0x42807d)[_0x6d6f('0x45')](function(_0x66300d){_0x5a2158[_0x6d6f('0x57')]('motion.token',_0x66300d);_0x5a2158[_0x6d6f('0x58')](_0x6d6f('0x59'));})['catch'](function(_0x144a6c){return _0x5a2158['status'](0x1f4)[_0x6d6f('0x5a')](_0x144a6c);});};exports[_0x6d6f('0x5b')]=function(_0x1bee36){if(_[_0x6d6f('0x5c')](_0x1bee36['apiKeyNonce'])||_[_0x6d6f('0x5c')](_0x1bee36[_0x6d6f('0x5d')])){return null;}else{return createJwt(_0x1bee36);}};exports[_0x6d6f('0x5e')]=function(_0x487048){_0x487048[_0x6d6f('0x5f')]=generateNonce();_0x487048[_0x6d6f('0x5d')]=generateIssuedAt();return createJwt(_0x487048);};exports[_0x6d6f('0x60')]=function(_0x7e0457,_0x4126e5){var _0x24adb6=_0x7e0457['query'][_0x6d6f('0x43')];if(_0x24adb6){var _0x3cd495={'nonce':_0x4126e5[_0x6d6f('0x5f')],'iat':_0x4126e5[_0x6d6f('0x5d')],'audience':hardwareConf[_0x6d6f('0x44')](),'issuer':hardwareConf[_0x6d6f('0x44')]()};return verifyJwt(_0x24adb6,_0x3cd495)[_0x6d6f('0x45')](function(){return generateApiKey(_0x4126e5);});}else{throw{'message':_0x6d6f('0x61')};}};exports[_0x6d6f('0x62')]=function(_0x2f97a8){var _0x3bf9e5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3bf9e5['test'](_0x2f97a8))throw new db[(_0x6d6f('0x63'))][(_0x6d6f('0x64'))](_0x6d6f('0x65'));return;};exports[_0x6d6f('0x66')]=function(_0x52ddb9,_0x4fbbad,_0x1ce0f9){var _0x72952c=encryptor['decryptString'](_0x4fbbad)[_0x6d6f('0x67')](',');for(var _0x5d7d71=0x0;_0x5d7d71<_0x1ce0f9;_0x5d7d71++){if(!_0x72952c[_0x5d7d71])break;if(_0x52ddb9['toLowerCase']()===_0x72952c[_0x5d7d71][_0x6d6f('0x68')]()){var _0x309a3a=util[_0x6d6f('0x69')](_0x6d6f('0x6a'),_0x1ce0f9);if(_0x1ce0f9===0x1){_0x309a3a=_0x6d6f('0x6b');}throw new db[(_0x6d6f('0x63'))][(_0x6d6f('0x64'))](_0x309a3a);}}return;};exports['updatePasswordsHistory']=function(_0x1efd18,_0x57b32c){var _0x428ff8=_0x57b32c?encryptor['decryptString'](_0x57b32c)[_0x6d6f('0x67')](','):[];if(_0x428ff8[_0x6d6f('0x6c')]===0x5){_0x428ff8[_0x6d6f('0x6d')](-0x1,0x1);}_0x428ff8[_0x6d6f('0x6e')](_0x1efd18);return encryptor[_0x6d6f('0x6f')](_0x428ff8['join'](','));};function signJwt(_0x258d5f){var _0x130515=BPromise['promisify'](jwt[_0x6d6f('0x70')],{'context':jwt});var _0x531e10=_0x258d5f[_0x6d6f('0x71')]||config[_0x6d6f('0xa')][_0x6d6f('0x72')];return new BPromise(function(_0x39ab01,_0x560414){_0x130515(_0x258d5f['payload'],_0x531e10,_0x258d5f[_0x6d6f('0x73')])[_0x6d6f('0x45')](function(_0x42fc92){_0x39ab01(_0x42fc92);})[_0x6d6f('0x36')](function(_0x4ac8fc){_0x560414(_0x4ac8fc);});});}function verifyJwt(_0x5af674,_0x3e4eaf,_0x5df148){var _0x5992a1=BPromise['promisify'](jwt[_0x6d6f('0x74')],{'context':jwt});var _0x2de9b0=_0x5df148||config['secrets']['session'];return new BPromise(function(_0x326326,_0x301991){_0x5992a1(_0x5af674,_0x2de9b0,_0x3e4eaf)['then'](function(_0x27b439){_0x326326(_0x27b439);})['catch'](function(_0x451943){_0x301991(_0x451943);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x6d6f('0x75')](_0x6d6f('0x76'));}function generateIssuedAt(){return Math[_0x6d6f('0x77')](Date[_0x6d6f('0x78')]()/0x3e8)['toString']();}function createJwt(_0xb3c1a9){var _0x4ce973={'payload':{'iat':_0xb3c1a9['apiKeyIat'],'nonce':_0xb3c1a9['apiKeyNonce']},'options':{'algorithm':_0x6d6f('0x79'),'subject':_0xb3c1a9['id']['toString'](),'issuer':hardwareConf[_0x6d6f('0x44')](),'audience':hardwareConf[_0x6d6f('0x44')]()}};return signJwt(_0x4ce973)['then'](function(_0x2db8f8){return{'iat':_0xb3c1a9[_0x6d6f('0x5d')],'nonce':_0xb3c1a9['apiKeyNonce'],'token':_0x2db8f8};});}
\ No newline at end of file
index 96062c2..9eebbea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7071=['lodash','../../config/environment','app','encrypt','algorithm','join','error','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','update','binary','end','final','close','unlink','decryptFile','createReadStream','createDecipher','write','encryptString','secret','utf8','base64','crypto','bluebird'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x7071,0x12a));var _0x1707=function(_0x52e36e,_0x1a9549){_0x52e36e=_0x52e36e-0x0;var _0x17d5ad=_0x7071[_0x52e36e];return _0x17d5ad;};'use strict';var crypto=require(_0x1707('0x0'));var fs=require('fs');var BPromise=require(_0x1707('0x1'));var _=require(_0x1707('0x2'));var config=require(_0x1707('0x3'));var logger=require('../../config/logger')(_0x1707('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x1707('0x5')][_0x1707('0x6')]){var isSupported=isAlgorithmSupported(config[_0x1707('0x5')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x1707('0x5')][_0x1707('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1707('0x7')](',\x20');logger[_0x1707('0x8')](config[_0x1707('0x5')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x28ac94){return AES_SUPPORTED_RX[_0x1707('0x9')](_0x28ac94);}function getSupportedCiphers(){return crypto[_0x1707('0xa')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xe7b443){return getSupportedCiphers()[_0x1707('0xb')](_0xe7b443)>-0x1;}function combineOptions(_0x33fc3d){var _0x4a3928={};for(var _0x37f96f in fileOptions){if(fileOptions[_0x1707('0xc')](_0x37f96f)){_0x4a3928[_0x37f96f]=fileOptions[_0x37f96f];}}if(_0x33fc3d){for(var _0x451c34 in _0x33fc3d){if(_0x33fc3d[_0x1707('0xc')](_0x451c34)){_0x4a3928[_0x451c34]=_0x33fc3d[_0x451c34];}}}return _0x4a3928;}exports[_0x1707('0xd')]=function(_0x394301,_0x2c52cb,_0x3d79b8,_0x5297d8){return new BPromise(function(_0x113135,_0x5cd1df){_0x5297d8=combineOptions(_0x5297d8);var _0x53b7b0=new Buffer(_0x3d79b8);var _0x4eda61=fs['createReadStream'](_0x394301);var _0x451479=fs[_0x1707('0xe')](_0x2c52cb);var _0xbe9e85=crypto[_0x1707('0xf')](_0x5297d8[_0x1707('0x6')],_0x53b7b0);_0x4eda61['on']('data',function(_0x269814){var _0x35f415=new Buffer(_0xbe9e85[_0x1707('0x10')](_0x269814),_0x1707('0x11'));_0x451479['write'](_0x35f415);});_0x4eda61['on'](_0x1707('0x12'),function(){try{var _0x2c55b4=new Buffer(_0xbe9e85[_0x1707('0x13')]('binary'),'binary');_0x451479['write'](_0x2c55b4);_0x451479[_0x1707('0x12')]();_0x451479['on'](_0x1707('0x14'),function(){return _0x113135(_0x2c52cb);});}catch(_0x414fff){fs[_0x1707('0x15')](_0x2c52cb);return _0x5cd1df(_0x414fff);}});});};exports[_0x1707('0x16')]=function(_0x29220d,_0x5076a2,_0x2f7366,_0x34c93c){return new BPromise(function(_0x1edced,_0x6820c){_0x34c93c=combineOptions(_0x34c93c);var _0xefbfbb=new Buffer(_0x2f7366);var _0x22d201=fs[_0x1707('0x17')](_0x29220d);var _0x294dcc=fs['createWriteStream'](_0x5076a2);var _0x5e9909=crypto[_0x1707('0x18')](_0x34c93c['algorithm'],_0xefbfbb);_0x22d201['on']('data',function(_0x369387){var _0x5343da=new Buffer(_0x5e9909[_0x1707('0x10')](_0x369387),_0x1707('0x11'));_0x294dcc[_0x1707('0x19')](_0x5343da);});_0x22d201['on'](_0x1707('0x12'),function(){try{var _0x591c70=new Buffer(_0x5e9909[_0x1707('0x13')](_0x1707('0x11')),_0x1707('0x11'));_0x294dcc[_0x1707('0x19')](_0x591c70);_0x294dcc[_0x1707('0x12')]();_0x294dcc['on'](_0x1707('0x14'),function(){return _0x1edced(_0x5076a2);});}catch(_0x53a4ff){fs['unlink'](_0x5076a2);return _0x6820c(_0x53a4ff);}});});};exports[_0x1707('0x1a')]=function(_0x27f224,_0x5b322a,_0x4a9859){var _0x48ebcb=_0x4a9859||stringOptions[_0x1707('0x6')];var _0x431a91=_0x5b322a||stringOptions[_0x1707('0x1b')];var _0x3580ef=crypto[_0x1707('0xf')](_0x48ebcb,_0x431a91);var _0xa6213f=_0x3580ef[_0x1707('0x10')](_0x27f224,_0x1707('0x1c'),_0x1707('0x1d'));_0xa6213f+=_0x3580ef[_0x1707('0x13')](_0x1707('0x1d'));return _0xa6213f;};exports['decryptString']=function(_0x506962,_0xf791c9,_0x1eed20){var _0x4f6622=_0x1eed20||stringOptions[_0x1707('0x6')];var _0x503420=_0xf791c9||stringOptions[_0x1707('0x1b')];var _0x3aed4c=crypto['createDecipher'](_0x4f6622,_0x503420);var _0x3885d6=_0x3aed4c[_0x1707('0x10')](_0x506962,'base64',_0x1707('0x1c'));_0x3885d6+=_0x3aed4c['final']('utf8');return _0x3885d6;};
\ No newline at end of file
+var _0x35ea=['hasOwnProperty','createReadStream','createWriteStream','createCipher','update','write','end','final','close','decryptFile','createDecipher','data','binary','unlink','encryptString','secret','base64','decryptString','utf8','crypto','../../config/environment','../../config/logger','session','aes-256-ctr','encrypt','algorithm','test','getCiphers','filter','indexOf'];(function(_0x563a72,_0xd36fbb){var _0xbaf337=function(_0x2d25b9){while(--_0x2d25b9){_0x563a72['push'](_0x563a72['shift']());}};_0xbaf337(++_0xd36fbb);}(_0x35ea,0x1d5));var _0xa35e=function(_0x5e343c,_0x5d5c6a){_0x5e343c=_0x5e343c-0x0;var _0x497243=_0x35ea[_0x5e343c];return _0x497243;};'use strict';var crypto=require(_0xa35e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xa35e('0x1'));var logger=require(_0xa35e('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xa35e('0x3')],'algorithm':_0xa35e('0x4')};const fileOptions={'algorithm':'aes192'};if(config[_0xa35e('0x5')]&&config[_0xa35e('0x5')][_0xa35e('0x6')]){var isSupported=isAlgorithmSupported(config[_0xa35e('0x5')][_0xa35e('0x6')]);if(isSupported){fileOptions[_0xa35e('0x6')]=config[_0xa35e('0x5')][_0xa35e('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xa35e('0x5')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x2e08e0){return AES_SUPPORTED_RX[_0xa35e('0x7')](_0x2e08e0);}function getSupportedCiphers(){return crypto[_0xa35e('0x8')]()[_0xa35e('0x9')](isASupportedCipher);}function isAlgorithmSupported(_0x64003e){return getSupportedCiphers()[_0xa35e('0xa')](_0x64003e)>-0x1;}function combineOptions(_0x55fd3d){var _0x170d21={};for(var _0x5c0176 in fileOptions){if(fileOptions[_0xa35e('0xb')](_0x5c0176)){_0x170d21[_0x5c0176]=fileOptions[_0x5c0176];}}if(_0x55fd3d){for(var _0x13e9a0 in _0x55fd3d){if(_0x55fd3d[_0xa35e('0xb')](_0x13e9a0)){_0x170d21[_0x13e9a0]=_0x55fd3d[_0x13e9a0];}}}return _0x170d21;}exports['encryptFile']=function(_0xe9c75c,_0x434604,_0x470700,_0x41e9d2){return new BPromise(function(_0x20b50f,_0x59c698){_0x41e9d2=combineOptions(_0x41e9d2);var _0x183ad3=new Buffer(_0x470700);var _0x1ffc87=fs[_0xa35e('0xc')](_0xe9c75c);var _0x13528=fs[_0xa35e('0xd')](_0x434604);var _0x127dbe=crypto[_0xa35e('0xe')](_0x41e9d2[_0xa35e('0x6')],_0x183ad3);_0x1ffc87['on']('data',function(_0x26cd65){var _0x9a12a0=new Buffer(_0x127dbe[_0xa35e('0xf')](_0x26cd65),'binary');_0x13528[_0xa35e('0x10')](_0x9a12a0);});_0x1ffc87['on'](_0xa35e('0x11'),function(){try{var _0x55ad1e=new Buffer(_0x127dbe[_0xa35e('0x12')]('binary'),'binary');_0x13528[_0xa35e('0x10')](_0x55ad1e);_0x13528['end']();_0x13528['on'](_0xa35e('0x13'),function(){return _0x20b50f(_0x434604);});}catch(_0x1ff15f){fs['unlink'](_0x434604);return _0x59c698(_0x1ff15f);}});});};exports[_0xa35e('0x14')]=function(_0x162a6e,_0x10df78,_0x202120,_0x21301b){return new BPromise(function(_0x59a66d,_0x310a9b){_0x21301b=combineOptions(_0x21301b);var _0x1db2e2=new Buffer(_0x202120);var _0xc02a67=fs[_0xa35e('0xc')](_0x162a6e);var _0x13480d=fs['createWriteStream'](_0x10df78);var _0x23e402=crypto[_0xa35e('0x15')](_0x21301b['algorithm'],_0x1db2e2);_0xc02a67['on'](_0xa35e('0x16'),function(_0x2a647f){var _0x11bb8c=new Buffer(_0x23e402[_0xa35e('0xf')](_0x2a647f),_0xa35e('0x17'));_0x13480d['write'](_0x11bb8c);});_0xc02a67['on'](_0xa35e('0x11'),function(){try{var _0x4087f8=new Buffer(_0x23e402['final'](_0xa35e('0x17')),'binary');_0x13480d[_0xa35e('0x10')](_0x4087f8);_0x13480d[_0xa35e('0x11')]();_0x13480d['on'](_0xa35e('0x13'),function(){return _0x59a66d(_0x10df78);});}catch(_0x278dc6){fs[_0xa35e('0x18')](_0x10df78);return _0x310a9b(_0x278dc6);}});});};exports[_0xa35e('0x19')]=function(_0xd8d31b,_0x4888a0,_0x2e498e){var _0x4caf1d=_0x2e498e||stringOptions[_0xa35e('0x6')];var _0x4336cc=_0x4888a0||stringOptions[_0xa35e('0x1a')];var _0xf62366=crypto[_0xa35e('0xe')](_0x4caf1d,_0x4336cc);var _0x4eb0cf=_0xf62366[_0xa35e('0xf')](_0xd8d31b,'utf8',_0xa35e('0x1b'));_0x4eb0cf+=_0xf62366[_0xa35e('0x12')](_0xa35e('0x1b'));return _0x4eb0cf;};exports[_0xa35e('0x1c')]=function(_0x44bbb0,_0xd6e28a,_0x378426){var _0x58cdae=_0x378426||stringOptions[_0xa35e('0x6')];var _0x35620f=_0xd6e28a||stringOptions[_0xa35e('0x1a')];var _0xc90d4d=crypto[_0xa35e('0x15')](_0x58cdae,_0x35620f);var _0x14e5cf=_0xc90d4d[_0xa35e('0xf')](_0x44bbb0,_0xa35e('0x1b'),_0xa35e('0x1d'));_0x14e5cf+=_0xc90d4d[_0xa35e('0x12')](_0xa35e('0x1d'));return _0x14e5cf;};
\ No newline at end of file
index 7383e3e..1f06b7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1cf=['QueryTypes','SELECT','num','Empty','split','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','length','join','mkdirSync','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','finally','exit','util','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x3aa6ab,_0x3b5f7c){var _0x5789d7=function(_0xe143d6){while(--_0xe143d6){_0x3aa6ab['push'](_0x3aa6ab['shift']());}};_0x5789d7(++_0x3b5f7c);}(_0xc1cf,0x109));var _0xfc1c=function(_0x49584d,_0x1ec19d){_0x49584d=_0x49584d-0x0;var _0x1959db=_0xc1cf[_0x49584d];return _0x1959db;};'use strict';var util=require(_0xfc1c('0x0'));var path=require(_0xfc1c('0x1'));var _=require(_0xfc1c('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xfc1c('0x3'));var zipdir=require(_0xfc1c('0x4'));var rimraf=require('rimraf');var db=require(_0xfc1c('0x5'))['db'];var dbH=require(_0xfc1c('0x5'))[_0xfc1c('0x6')];var logger=require(_0xfc1c('0x7'))(_0xfc1c('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xfc1c('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1fb08f,_0x305f5f){var _0x506042={'status':_0x1fb08f};var _0x72be33={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x305f5f){_0x506042[_0xfc1c('0xa')]=_0x305f5f;}return db[_0xfc1c('0xb')][_0xfc1c('0xc')](_0x506042,_0x72be33);}function main(){var _0x46bc1a=0x1388;var _0x4787ef;logger[_0xfc1c('0xd')](util[_0xfc1c('0xe')](_0xfc1c('0xf'),EXTRACTED_REPORT_ID,_0xfc1c('0x10')));return db[_0xfc1c('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xfc1c('0x12')]})[_0xfc1c('0x13')](function(_0x5209ae){if(_0x5209ae){_0x4787ef=_0x5209ae;_0x46bc1a=_0x4787ef[_0xfc1c('0x12')]||0x1388;}})['then'](function(){return dbH[_0xfc1c('0x14')][_0xfc1c('0x15')](util[_0xfc1c('0xe')](_0xfc1c('0x16'),QUERY),{'type':dbH[_0xfc1c('0x14')][_0xfc1c('0x17')][_0xfc1c('0x18')]});})[_0xfc1c('0x13')](function(_0xf9315d){if(!_0xf9315d[0x0][_0xfc1c('0x19')]){return analyticExtractedReport(_0xfc1c('0x1a'));}var _0x40ff5f=[];var _0x5ec09b=0x0;if(_0x4787ef[_0xfc1c('0x1b')]){if(_0xf9315d&&_0xf9315d['length']){var _0x17aab6=_['range'](_0xf9315d[0x0][_0xfc1c('0x19')]/_0x46bc1a);var _0x5ca467=Number[_0xfc1c('0x1c')](_0xf9315d[0x0][_0xfc1c('0x19')]/_0x46bc1a)?_0xf9315d[0x0][_0xfc1c('0x19')]%_0x46bc1a:0x0;_0x17aab6[_0xfc1c('0x1d')](function(_0x49a599){if(_0x49a599>0x0){_0x5ec09b+=_0x46bc1a;}_0x40ff5f[_0xfc1c('0x1e')](dbH[_0xfc1c('0x14')][_0xfc1c('0x15')](util[_0xfc1c('0xe')](_0xfc1c('0x1f'),QUERY,_0x46bc1a,_0x5ec09b),{'type':dbH['sequelize'][_0xfc1c('0x17')][_0xfc1c('0x18')]}));});if(_0x5ca467>0x0){_0x5ec09b+=_0x46bc1a;_0x40ff5f[_0xfc1c('0x1e')](dbH[_0xfc1c('0x14')][_0xfc1c('0x15')](util[_0xfc1c('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5ca467,_0x5ec09b),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x40ff5f[_0xfc1c('0x1e')](dbH[_0xfc1c('0x14')]['query'](QUERY,{'type':dbH[_0xfc1c('0x14')][_0xfc1c('0x17')][_0xfc1c('0x18')]}));}var _0x65bf9f=path['dirname'](PATH);var _0x1f9112=path[_0xfc1c('0x20')](PATH,_0xfc1c('0x21'));var _0x66036c=_0x4787ef[_0xfc1c('0x1b')]&&_0x40ff5f[_0xfc1c('0x22')]>0x1;var _0x598d39=[];if(!fs['existsSync'](path[_0xfc1c('0x23')](_0x65bf9f,_0x1f9112))&&_0x66036c){fs[_0xfc1c('0x24')](path[_0xfc1c('0x23')](_0x65bf9f,_0x1f9112));}return BPromise['each'](_0x40ff5f,function(_0x3b97c7){_0x598d39[_0xfc1c('0x1e')](_0x3b97c7);})[_0xfc1c('0x13')](function(){for(var _0x595334=0x0;_0x595334<_0x598d39[_0xfc1c('0x22')];_0x595334+=0x1){var _0x319c5d;var _0x49cd6f=_0x598d39[_0x595334];if(_0x66036c){_0x319c5d=path[_0xfc1c('0x23')](_0x65bf9f,_0x1f9112,util[_0xfc1c('0xe')]('%s%d.%s',_0x1f9112,_0x595334,_0xfc1c('0x25')));}else{_0x319c5d=path[_0xfc1c('0x23')](_0x65bf9f,util['format'](_0xfc1c('0x26'),_0x1f9112,'csv'));}fs[_0xfc1c('0x27')](_0x319c5d,csv(_0x49cd6f));}})['then'](function(){if(_0x66036c){return new Promise(function(_0x3d83a6){zipdir(path[_0xfc1c('0x23')](_0x65bf9f,_0x1f9112),{'saveTo':path[_0xfc1c('0x23')](_0x65bf9f,util[_0xfc1c('0xe')](_0xfc1c('0x26'),_0x1f9112,_0xfc1c('0x28')))},function(_0x3954c0,_0x10d004){rimraf(path[_0xfc1c('0x23')](_0x65bf9f,_0x1f9112),function(){});_0x3d83a6(_0xfc1c('0x29'));});});}})['then'](function(){logger[_0xfc1c('0xd')](util[_0xfc1c('0xe')](_0xfc1c('0x2a'),EXTRACTED_REPORT_ID,_0xfc1c('0x10')));return analyticExtractedReport(_0xfc1c('0x2b'),_0x66036c?util[_0xfc1c('0xe')](_0xfc1c('0x26'),_0x1f9112,_0x66036c?_0xfc1c('0x28'):_0xfc1c('0x25')):null);});})[_0xfc1c('0x2c')](function(_0x3c7814){logger[_0xfc1c('0xd')](util[_0xfc1c('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0xfc1c('0x2d')](_0x3c7814,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xfc1c('0x2e')](function(){process[_0xfc1c('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xcbd9=['query','QueryTypes','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','finally','exit','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','then','num','length','range','isInteger','forEach'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xcbd9,0x16b));var _0x9cbd=function(_0x2bb090,_0x3b3c23){_0x2bb090=_0x2bb090-0x0;var _0x37e61e=_0xcbd9[_0x2bb090];return _0x37e61e;};'use strict';var util=require('util');var path=require(_0x9cbd('0x0'));var _=require(_0x9cbd('0x1'));var csv=require(_0x9cbd('0x2'));var fs=require('fs');var BPromise=require(_0x9cbd('0x3'));var zipdir=require(_0x9cbd('0x4'));var rimraf=require(_0x9cbd('0x5'));var db=require(_0x9cbd('0x6'))['db'];var dbH=require(_0x9cbd('0x6'))[_0x9cbd('0x7')];var logger=require(_0x9cbd('0x8'))(_0x9cbd('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x9cbd('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x494b4f,_0x288cec){var _0x7fc8dc={'status':_0x494b4f};var _0x5ceed6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x288cec){_0x7fc8dc[_0x9cbd('0xb')]=_0x288cec;}return db[_0x9cbd('0xc')][_0x9cbd('0xd')](_0x7fc8dc,_0x5ceed6);}function main(){var _0x5740ed=0x1388;var _0x2df0f9;logger[_0x9cbd('0xe')](util[_0x9cbd('0xf')](_0x9cbd('0x10'),EXTRACTED_REPORT_ID,_0x9cbd('0x11')));return db['Setting'][_0x9cbd('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9cbd('0x13'),_0x9cbd('0x14')]})['then'](function(_0x545d6b){if(_0x545d6b){_0x2df0f9=_0x545d6b;_0x5740ed=_0x2df0f9['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x9cbd('0x15')]['query'](util[_0x9cbd('0xf')](_0x9cbd('0x16'),QUERY),{'type':dbH[_0x9cbd('0x15')]['QueryTypes']['SELECT']});})[_0x9cbd('0x17')](function(_0xe57038){if(!_0xe57038[0x0][_0x9cbd('0x18')]){return analyticExtractedReport('Empty');}var _0x240046=[];var _0x126a84=0x0;if(_0x2df0f9['split']){if(_0xe57038&&_0xe57038[_0x9cbd('0x19')]){var _0x223877=_[_0x9cbd('0x1a')](_0xe57038[0x0]['num']/_0x5740ed);var _0x5869f1=Number[_0x9cbd('0x1b')](_0xe57038[0x0][_0x9cbd('0x18')]/_0x5740ed)?_0xe57038[0x0][_0x9cbd('0x18')]%_0x5740ed:0x0;_0x223877[_0x9cbd('0x1c')](function(_0x57cefe){if(_0x57cefe>0x0){_0x126a84+=_0x5740ed;}_0x240046['push'](dbH[_0x9cbd('0x15')][_0x9cbd('0x1d')](util[_0x9cbd('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5740ed,_0x126a84),{'type':dbH[_0x9cbd('0x15')][_0x9cbd('0x1e')]['SELECT']}));});if(_0x5869f1>0x0){_0x126a84+=_0x5740ed;_0x240046[_0x9cbd('0x1f')](dbH[_0x9cbd('0x15')]['query'](util[_0x9cbd('0xf')](_0x9cbd('0x20'),QUERY,_0x5869f1,_0x126a84),{'type':dbH['sequelize']['QueryTypes'][_0x9cbd('0x21')]}));}}}else{_0x240046[_0x9cbd('0x1f')](dbH[_0x9cbd('0x15')][_0x9cbd('0x1d')](QUERY,{'type':dbH[_0x9cbd('0x15')][_0x9cbd('0x1e')][_0x9cbd('0x21')]}));}var _0x1a8d13=path[_0x9cbd('0x22')](PATH);var _0x535ec9=path[_0x9cbd('0x23')](PATH,'.csv');var _0x1a592c=_0x2df0f9['split']&&_0x240046['length']>0x1;var _0x1bcb03=[];if(!fs[_0x9cbd('0x24')](path[_0x9cbd('0x25')](_0x1a8d13,_0x535ec9))&&_0x1a592c){fs['mkdirSync'](path['join'](_0x1a8d13,_0x535ec9));}return BPromise[_0x9cbd('0x26')](_0x240046,function(_0x5c0857){_0x1bcb03[_0x9cbd('0x1f')](_0x5c0857);})[_0x9cbd('0x17')](function(){for(var _0x3347d5=0x0;_0x3347d5<_0x1bcb03[_0x9cbd('0x19')];_0x3347d5+=0x1){var _0x207b08;var _0x544c45=_0x1bcb03[_0x3347d5];if(_0x1a592c){_0x207b08=path[_0x9cbd('0x25')](_0x1a8d13,_0x535ec9,util[_0x9cbd('0xf')](_0x9cbd('0x27'),_0x535ec9,_0x3347d5,_0x9cbd('0x28')));}else{_0x207b08=path['join'](_0x1a8d13,util[_0x9cbd('0xf')](_0x9cbd('0x29'),_0x535ec9,_0x9cbd('0x28')));}fs[_0x9cbd('0x2a')](_0x207b08,csv(_0x544c45));}})[_0x9cbd('0x17')](function(){if(_0x1a592c){return new Promise(function(_0x3718b6){zipdir(path[_0x9cbd('0x25')](_0x1a8d13,_0x535ec9),{'saveTo':path[_0x9cbd('0x25')](_0x1a8d13,util[_0x9cbd('0xf')](_0x9cbd('0x29'),_0x535ec9,'zip'))},function(_0x30bc15,_0x3a50ed){rimraf(path['join'](_0x1a8d13,_0x535ec9),function(){});_0x3718b6(_0x9cbd('0x2b'));});});}})[_0x9cbd('0x17')](function(){logger[_0x9cbd('0xe')](util['format'](_0x9cbd('0x2c'),EXTRACTED_REPORT_ID,_0x9cbd('0x11')));return analyticExtractedReport('Completed',_0x1a592c?util[_0x9cbd('0xf')](_0x9cbd('0x29'),_0x535ec9,_0x1a592c?_0x9cbd('0x2d'):_0x9cbd('0x28')):null);});})[_0x9cbd('0x2e')](function(_0x53ddd4){logger[_0x9cbd('0xe')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x53ddd4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x9cbd('0x2f')](function(){process[_0x9cbd('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
index 58d2f6e..de38070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1968=['Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','analytics','argv','savename','update','map','tableHeader','toString','fill','length','auto','body','push','chunk','name','startDate','format','endDate','margin','landscape','\x20/\x20','footer','Arial','right','num','Empty','Setting','split','splitSizePdf','range','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','mkdirSync','each','then','createPdfKitDocument','join','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x5285a2,_0x1949c0){var _0x4222dc=function(_0x4a166a){while(--_0x4a166a){_0x5285a2['push'](_0x5285a2['shift']());}};_0x4222dc(++_0x1949c0);}(_0x1968,0x17c));var _0x8196=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1968[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x8196('0x0'));var fs=require('fs');var util=require(_0x8196('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x8196('0x2'));var PdfPrinter=require(_0x8196('0x3'));var zipdir=require(_0x8196('0x4'));var rimraf=require(_0x8196('0x5'));var JSDOM=require(_0x8196('0x6'))['JSDOM'];var window=new JSDOM('')[_0x8196('0x7')];var BPromise=require('bluebird');var db=require(_0x8196('0x8'))['db'];var dbH=require('../../mysqldb')[_0x8196('0x9')];var logger=require('../../config/logger')(_0x8196('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x8196('0xb')][0x2]);var QUERY=process[_0x8196('0xb')][0x3];var PATH=process[_0x8196('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x8a2c25,_0x2f985d){var _0x467f46={'status':_0x8a2c25};var _0xdf9dde={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f985d){_0x467f46[_0x8196('0xc')]=_0x2f985d;}return db['AnalyticExtractedReport'][_0x8196('0xd')](_0x467f46,_0xdf9dde);}function getHeaders(_0x593e40){return _[_0x8196('0xe')](_0x593e40,function(_0x499a65){return{'text':_0x499a65,'style':_0x8196('0xf')};});}function getRows(_0x4e275f,_0x2c3aea){return _['map'](_0x2c3aea,function(_0x58d826){return _(_0x58d826)['pick'](_0x4e275f)[_0x8196('0xe')](function(_0xbd3447){return _0xbd3447?_[_0x8196('0x10')](_0xbd3447):'';})['value']();});}function createTable(_0x3290c5,_0x431fca){var _0x4d14da={'widths':_[_0x8196('0x11')](Array(_0x3290c5[_0x8196('0x12')]),0x91),'heights':function(_0x210ad7){return _0x210ad7===0x0?_0x8196('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x424c82=getHeaders(_0x3290c5);_0x4d14da[_0x8196('0x14')][_0x8196('0x15')](_0x424c82);var _0x209d16=getRows(_0x3290c5,_0x431fca);_0x4d14da[_0x8196('0x14')]=_0x4d14da[_0x8196('0x14')]['concat'](_0x209d16);return _0x4d14da;}function createTables(_0x137c4b){var _0x4642c1=[];var _0x8f710e=_[_0x8196('0x16')](Object['keys'](_0x137c4b[0x0]),0x5);_0x8f710e['forEach'](function(_0x3edb4a){_0x4642c1['push'](createTable(_0x3edb4a,_0x137c4b));});return _0x4642c1;}function getPDFDocDefinition(_0x128afa){var _0x5f59b2=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x8196('0x17')],moment(EXTRACTED_REPORT[_0x8196('0x18')])[_0x8196('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x8196('0x1a')])['format'](FORMAT));var _0x119fa7=[];for(var _0x208183=0x0;_0x208183<_0x128afa[_0x8196('0x12')];_0x208183++){var _0x51dc32=[];if(_0x208183===0x0){_0x51dc32[_0x8196('0x15')]({'text':_0x5f59b2,'style':'header'});}var _0x31ee86={'table':_0x128afa[_0x208183]};if(_0x208183>0x0){_0x31ee86['pageBreak']='before';_0x31ee86[_0x8196('0x1b')]=[0x0,0x46,0x0,0x0];}_0x51dc32[_0x8196('0x15')](_0x31ee86);_0x119fa7['push'](_0x51dc32);}return{'pageSize':'A4','pageOrientation':_0x8196('0x1c'),'content':_0x119fa7,'footer':function(_0x23ea47,_0x5b3f70){return{'text':_0x23ea47[_0x8196('0x10')]()+_0x8196('0x1d')+_0x5b3f70,'style':_0x8196('0x1e')};},'defaultStyle':{'font':_0x8196('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x8196('0x20'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3e8f38){var _0x5a226e=0x1388;var _0x3f88c1;if(!_0x3e8f38[0x0][_0x8196('0x21')]){return analyticExtractedReport(_0x8196('0x22'));}return db[_0x8196('0x23')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8196('0x24'),_0x8196('0x25')]})['then'](function(_0x36fcbe){if(_0x36fcbe){_0x3f88c1=_0x36fcbe;_0x5a226e=_0x3f88c1['splitSizePdf']||0x3e8;}})['then'](function(){var _0x51f083=[];var _0xc9e9a6=0x0;if(_0x3f88c1[_0x8196('0x24')]){if(_0x3e8f38&&_0x3e8f38['length']){var _0x39cf79=_[_0x8196('0x26')](_0x3e8f38[0x0][_0x8196('0x21')]/_0x5a226e);var _0x4600ea=Number['isInteger'](_0x3e8f38[0x0][_0x8196('0x21')]/_0x5a226e)?_0x3e8f38[0x0][_0x8196('0x21')]%_0x5a226e:0x0;_0x39cf79[_0x8196('0x27')](function(_0x3ad37f){if(_0x3ad37f>0x0){_0xc9e9a6+=_0x5a226e;}_0x51f083[_0x8196('0x15')](dbH['sequelize'][_0x8196('0x28')](util[_0x8196('0x19')](_0x8196('0x29'),QUERY,_0x5a226e,_0xc9e9a6),{'type':dbH[_0x8196('0x2a')][_0x8196('0x2b')][_0x8196('0x2c')]}));});if(_0x4600ea>0x0){_0xc9e9a6+=_0x5a226e;_0x51f083[_0x8196('0x15')](dbH[_0x8196('0x2a')][_0x8196('0x28')](util['format'](_0x8196('0x29'),QUERY,_0x4600ea,_0xc9e9a6),{'type':dbH[_0x8196('0x2a')]['QueryTypes'][_0x8196('0x2c')]}));}}}else{_0x51f083[_0x8196('0x15')](dbH[_0x8196('0x2a')]['query'](QUERY,{'type':dbH[_0x8196('0x2a')][_0x8196('0x2b')][_0x8196('0x2c')]}));}var _0x25ba3b=path[_0x8196('0x2d')](PATH);var _0x16c761=path[_0x8196('0x2e')](PATH,_0x8196('0x2f'));var _0x1fefde=_0x3f88c1[_0x8196('0x24')]&&_0x51f083['length']>0x1;var _0x451fbf=[];if(!fs['existsSync'](path['join'](_0x25ba3b,_0x16c761))&&_0x1fefde){fs[_0x8196('0x30')](path['join'](_0x25ba3b,_0x16c761));}return BPromise[_0x8196('0x31')](_0x51f083,function(_0x1a30d8){_0x451fbf['push'](_0x1a30d8);})[_0x8196('0x32')](function(){var _0x4bc84b=[];for(var _0x156eda=0x0;_0x156eda<_0x451fbf['length'];_0x156eda+=0x1){var _0x11fe1a=_0x451fbf[_0x156eda];var _0x26750d=createTables(_['flatten'](_0x11fe1a));var _0x580608;var _0x24d729=getPDFDocDefinition(_0x26750d);var _0x2bcf47=getPDFPrinter();var _0x595f9c=_0x2bcf47[_0x8196('0x33')](_0x24d729);if(_0x1fefde){_0x580608=path[_0x8196('0x34')](_0x25ba3b,_0x16c761,util[_0x8196('0x19')](_0x8196('0x35'),_0x16c761,_0x156eda,_0x8196('0x36')));}else{_0x580608=path[_0x8196('0x34')](_0x25ba3b,util['format']('%s.%s',_0x16c761,_0x8196('0x36')));}_0x4bc84b[_0x8196('0x15')](writePDFDocument(_0x595f9c,_0x580608));}return Promise[_0x8196('0x37')](_0x4bc84b);})[_0x8196('0x32')](function(){if(_0x1fefde){return new Promise(function(_0x4f036b){zipdir(path[_0x8196('0x34')](_0x25ba3b,_0x16c761),{'saveTo':path[_0x8196('0x34')](_0x25ba3b,util['format'](_0x8196('0x38'),_0x16c761,_0x8196('0x39')))},function(){rimraf(path['join'](_0x25ba3b,_0x16c761),function(){});_0x4f036b(_0x8196('0x3a'));});});}})['then'](function(){if(!_0x1fefde)return;rimraf(path[_0x8196('0x34')](_0x25ba3b,_0x16c761),function(){});})[_0x8196('0x32')](function(){logger[_0x8196('0x3b')](util[_0x8196('0x19')](_0x8196('0x3c'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x8196('0x3d'),_0x1fefde?util[_0x8196('0x19')](_0x8196('0x38'),_0x16c761,_0x1fefde?_0x8196('0x39'):_0x8196('0x36')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8196('0x3b')](util[_0x8196('0x19')](_0x8196('0x3e'),EXTRACTED_REPORT_ID,_0x8196('0x3f')));return db[_0x8196('0x40')][_0x8196('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8196('0x32')](function(_0x195c58){EXTRACTED_REPORT=_0x195c58;return dbH[_0x8196('0x2a')]['query'](util['format'](_0x8196('0x42'),QUERY),{'type':dbH[_0x8196('0x2a')][_0x8196('0x2b')][_0x8196('0x2c')]});})['then'](extractReport)[_0x8196('0x43')](function(_0x4bd273){logger[_0x8196('0x3b')](util['format'](_0x8196('0x44'),EXTRACTED_REPORT_ID,'PDF'),util[_0x8196('0x45')](_0x4bd273,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8196('0x46'));})[_0x8196('0x47')](function(){process[_0x8196('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1098a6=new PdfPrinter({'Arial':{'normal':__dirname+_0x8196('0x49'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8196('0x4a'),'bolditalics':__dirname+_0x8196('0x4b')}});return _0x1098a6;}function getPDFDocDefinitionFromHTML(_0x19081d,_0x3d8624){var _0x62f0cc=util['format'](_0x8196('0x4c'),_0x3d8624[_0x8196('0x4d')],_0x3d8624[_0x8196('0x4e')]);var _0xcfea29=moment()[_0x8196('0x19')](_0x8196('0x4f'))['toString']();var _0x30acec=htmlToPdfmake(_0x19081d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x30acec],'defaultStyle':{'font':_0x8196('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8196('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8196('0x50')}},'header':function(){return[{'text':_0x8196('0x51'),'style':_0x8196('0x52')}];},'footer':function(_0x15e6ef,_0xf6436a){return[{'text':util[_0x8196('0x19')](_0x8196('0x53'),_0x62f0cc,_0x15e6ef,_0xf6436a,_0xcfea29),'style':_0x8196('0x1e')}];}};}function writePDFDocument(_0x1fed77,_0x1955ad){return new Promise(function(_0x3fbcae,_0x310109){var _0x2658a1=_0x1fed77[_0x8196('0x54')](fs[_0x8196('0x55')](_0x1955ad));_0x2658a1['on'](_0x8196('0x56'),function(){_0x3fbcae(_0x8196('0x56'));});_0x2658a1['on'](_0x8196('0x57'),function(_0x30a148){_0x310109(_0x30a148);});_0x1fed77[_0x8196('0x58')]();});}exports[_0x8196('0x59')]=function(_0x14ffda,_0x188636){var _0x4c27f0=getPDFPrinter();var _0x3838c6=getPDFDocDefinitionFromHTML(_0x14ffda,_0x188636);var _0x33c642=_0x4c27f0['createPdfKitDocument'](_0x3838c6);return writePDFDocument(_0x33c642,_0x188636['path'])[_0x8196('0x43')](function(_0x3f00e5){throw _0x3f00e5;});};
\ No newline at end of file
+var _0xced0=['all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','PDF','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','toString','value','fill','auto','body','concat','chunk','keys','forEach','name','startDate','format','endDate','length','header','pageBreak','before','margin','push','landscape','\x20/\x20','footer','Arial','black','right','Setting','find','then','splitSizePdf','split','range','num','sequelize','query','QueryTypes','SELECT','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s.%s','pdf'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0xced0,0x1d0));var _0x0ced=function(_0x18c464,_0xbb2c5d){_0x18c464=_0x18c464-0x0;var _0x425e3c=_0xced0[_0x18c464];return _0x425e3c;};'use strict';var _=require(_0x0ced('0x0'));var fs=require('fs');var util=require(_0x0ced('0x1'));var path=require(_0x0ced('0x2'));var moment=require(_0x0ced('0x3'));var htmlToPdfmake=require(_0x0ced('0x4'));var PdfPrinter=require(_0x0ced('0x5'));var zipdir=require(_0x0ced('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0x0ced('0x7'))[_0x0ced('0x8')];var window=new JSDOM('')[_0x0ced('0x9')];var BPromise=require(_0x0ced('0xa'));var db=require(_0x0ced('0xb'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x0ced('0xc'))(_0x0ced('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x0ced('0xe')][0x2]);var QUERY=process[_0x0ced('0xe')][0x3];var PATH=process[_0x0ced('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x0ced('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x35c088,_0x34d6e3){var _0x29010f={'status':_0x35c088};var _0x399a89={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34d6e3){_0x29010f[_0x0ced('0x10')]=_0x34d6e3;}return db[_0x0ced('0x11')][_0x0ced('0x12')](_0x29010f,_0x399a89);}function getHeaders(_0x37e253){return _[_0x0ced('0x13')](_0x37e253,function(_0x11c65f){return{'text':_0x11c65f,'style':'tableHeader'};});}function getRows(_0x575b79,_0x43b704){return _[_0x0ced('0x13')](_0x43b704,function(_0x5bd4cc){return _(_0x5bd4cc)['pick'](_0x575b79)[_0x0ced('0x13')](function(_0x5765f8){return _0x5765f8?_[_0x0ced('0x14')](_0x5765f8):'';})[_0x0ced('0x15')]();});}function createTable(_0x44c4ff,_0x2bb5a4){var _0x2562a0={'widths':_[_0x0ced('0x16')](Array(_0x44c4ff['length']),0x91),'heights':function(_0x2015fe){return _0x2015fe===0x0?_0x0ced('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5e589d=getHeaders(_0x44c4ff);_0x2562a0[_0x0ced('0x18')]['push'](_0x5e589d);var _0x598092=getRows(_0x44c4ff,_0x2bb5a4);_0x2562a0[_0x0ced('0x18')]=_0x2562a0[_0x0ced('0x18')][_0x0ced('0x19')](_0x598092);return _0x2562a0;}function createTables(_0x18c8ee){var _0x5105b7=[];var _0x4f1a05=_[_0x0ced('0x1a')](Object[_0x0ced('0x1b')](_0x18c8ee[0x0]),0x5);_0x4f1a05[_0x0ced('0x1c')](function(_0x5bbbbc){_0x5105b7['push'](createTable(_0x5bbbbc,_0x18c8ee));});return _0x5105b7;}function getPDFDocDefinition(_0x38169f){var _0x2d9442=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x0ced('0x1d')],moment(EXTRACTED_REPORT[_0x0ced('0x1e')])[_0x0ced('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0x0ced('0x20')])[_0x0ced('0x1f')](FORMAT));var _0xc9bb4f=[];for(var _0x45f87a=0x0;_0x45f87a<_0x38169f[_0x0ced('0x21')];_0x45f87a++){var _0x28cb5f=[];if(_0x45f87a===0x0){_0x28cb5f['push']({'text':_0x2d9442,'style':_0x0ced('0x22')});}var _0x283ada={'table':_0x38169f[_0x45f87a]};if(_0x45f87a>0x0){_0x283ada[_0x0ced('0x23')]=_0x0ced('0x24');_0x283ada[_0x0ced('0x25')]=[0x0,0x46,0x0,0x0];}_0x28cb5f[_0x0ced('0x26')](_0x283ada);_0xc9bb4f[_0x0ced('0x26')](_0x28cb5f);}return{'pageSize':'A4','pageOrientation':_0x0ced('0x27'),'content':_0xc9bb4f,'footer':function(_0x2a42e8,_0x4b21e4){return{'text':_0x2a42e8[_0x0ced('0x14')]()+_0x0ced('0x28')+_0x4b21e4,'style':_0x0ced('0x29')};},'defaultStyle':{'font':_0x0ced('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0ced('0x2b')},'footer':{'alignment':_0x0ced('0x2c'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x48aec9){var _0x20859a=0x1388;var _0x18689a;if(!_0x48aec9[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x0ced('0x2d')][_0x0ced('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x0ced('0x2f')](function(_0x36bcab){if(_0x36bcab){_0x18689a=_0x36bcab;_0x20859a=_0x18689a[_0x0ced('0x30')]||0x3e8;}})[_0x0ced('0x2f')](function(){var _0x1912ff=[];var _0x367260=0x0;if(_0x18689a[_0x0ced('0x31')]){if(_0x48aec9&&_0x48aec9[_0x0ced('0x21')]){var _0x4cbc12=_[_0x0ced('0x32')](_0x48aec9[0x0][_0x0ced('0x33')]/_0x20859a);var _0x9adef=Number['isInteger'](_0x48aec9[0x0][_0x0ced('0x33')]/_0x20859a)?_0x48aec9[0x0][_0x0ced('0x33')]%_0x20859a:0x0;_0x4cbc12[_0x0ced('0x1c')](function(_0x141517){if(_0x141517>0x0){_0x367260+=_0x20859a;}_0x1912ff['push'](dbH[_0x0ced('0x34')][_0x0ced('0x35')](util[_0x0ced('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x20859a,_0x367260),{'type':dbH[_0x0ced('0x34')][_0x0ced('0x36')][_0x0ced('0x37')]}));});if(_0x9adef>0x0){_0x367260+=_0x20859a;_0x1912ff['push'](dbH['sequelize']['query'](util[_0x0ced('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x9adef,_0x367260),{'type':dbH['sequelize']['QueryTypes'][_0x0ced('0x37')]}));}}}else{_0x1912ff[_0x0ced('0x26')](dbH[_0x0ced('0x34')][_0x0ced('0x35')](QUERY,{'type':dbH[_0x0ced('0x34')][_0x0ced('0x36')][_0x0ced('0x37')]}));}var _0x1e7866=path['dirname'](PATH);var _0x248428=path['basename'](PATH,_0x0ced('0x38'));var _0x11ba57=_0x18689a[_0x0ced('0x31')]&&_0x1912ff[_0x0ced('0x21')]>0x1;var _0x5ecdcd=[];if(!fs[_0x0ced('0x39')](path[_0x0ced('0x3a')](_0x1e7866,_0x248428))&&_0x11ba57){fs['mkdirSync'](path[_0x0ced('0x3a')](_0x1e7866,_0x248428));}return BPromise[_0x0ced('0x3b')](_0x1912ff,function(_0x3ccf6d){_0x5ecdcd[_0x0ced('0x26')](_0x3ccf6d);})['then'](function(){var _0x2b8e10=[];for(var _0x3cff56=0x0;_0x3cff56<_0x5ecdcd['length'];_0x3cff56+=0x1){var _0x49977=_0x5ecdcd[_0x3cff56];var _0x3d3bb0=createTables(_[_0x0ced('0x3c')](_0x49977));var _0x13f9de;var _0x1f620a=getPDFDocDefinition(_0x3d3bb0);var _0x5f6fb1=getPDFPrinter();var _0x174822=_0x5f6fb1[_0x0ced('0x3d')](_0x1f620a);if(_0x11ba57){_0x13f9de=path[_0x0ced('0x3a')](_0x1e7866,_0x248428,util['format']('%s%d.%s',_0x248428,_0x3cff56,'pdf'));}else{_0x13f9de=path[_0x0ced('0x3a')](_0x1e7866,util['format'](_0x0ced('0x3e'),_0x248428,_0x0ced('0x3f')));}_0x2b8e10['push'](writePDFDocument(_0x174822,_0x13f9de));}return Promise[_0x0ced('0x40')](_0x2b8e10);})[_0x0ced('0x2f')](function(){if(_0x11ba57){return new Promise(function(_0x29bd8){zipdir(path[_0x0ced('0x3a')](_0x1e7866,_0x248428),{'saveTo':path[_0x0ced('0x3a')](_0x1e7866,util[_0x0ced('0x1f')](_0x0ced('0x3e'),_0x248428,_0x0ced('0x41')))},function(){rimraf(path['join'](_0x1e7866,_0x248428),function(){});_0x29bd8(_0x0ced('0x42'));});});}})['then'](function(){if(!_0x11ba57)return;rimraf(path[_0x0ced('0x3a')](_0x1e7866,_0x248428),function(){});})[_0x0ced('0x2f')](function(){logger[_0x0ced('0x43')](util[_0x0ced('0x1f')](_0x0ced('0x44'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x11ba57?util[_0x0ced('0x1f')](_0x0ced('0x3e'),_0x248428,_0x11ba57?_0x0ced('0x41'):_0x0ced('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x0ced('0x43')](util['format'](_0x0ced('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x0ced('0x11')][_0x0ced('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0ced('0x2f')](function(_0xa087ae){EXTRACTED_REPORT=_0xa087ae;return dbH[_0x0ced('0x34')][_0x0ced('0x35')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x0ced('0x37')]});})[_0x0ced('0x2f')](extractReport)[_0x0ced('0x47')](function(_0x51ef05){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0ced('0x48')),util[_0x0ced('0x49')](_0x51ef05,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0ced('0x4a'));})[_0x0ced('0x4b')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x22e7ca=new PdfPrinter({'Arial':{'normal':__dirname+_0x0ced('0x4c'),'bold':__dirname+_0x0ced('0x4d'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x0ced('0x4e')}});return _0x22e7ca;}function getPDFDocDefinitionFromHTML(_0x4842bc,_0x357c80){var _0xdf7d5c=util['format']('%s\x20#%d',_0x357c80[_0x0ced('0x4f')],_0x357c80[_0x0ced('0x50')]);var _0x745043=moment()[_0x0ced('0x1f')](_0x0ced('0x51'))['toString']();var _0x39ce6d=htmlToPdfmake(_0x4842bc,{'window':window,'tableAutoSize':!![]});return{'content':[_0x39ce6d],'defaultStyle':{'font':_0x0ced('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x0ced('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x30ff23,_0x258fac){return[{'text':util[_0x0ced('0x1f')](_0x0ced('0x53'),_0xdf7d5c,_0x30ff23,_0x258fac,_0x745043),'style':_0x0ced('0x29')}];}};}function writePDFDocument(_0x26adfb,_0x170e53){return new Promise(function(_0x6f3130,_0x3a46e7){var _0x31f06f=_0x26adfb[_0x0ced('0x54')](fs['createWriteStream'](_0x170e53));_0x31f06f['on'](_0x0ced('0x55'),function(){_0x6f3130('finish');});_0x31f06f['on']('error',function(_0x53060f){_0x3a46e7(_0x53060f);});_0x26adfb[_0x0ced('0x56')]();});}exports[_0x0ced('0x57')]=function(_0x362ee0,_0x2ae8c8){var _0x18eaea=getPDFPrinter();var _0x400d0a=getPDFDocDefinitionFromHTML(_0x362ee0,_0x2ae8c8);var _0x582570=_0x18eaea[_0x0ced('0x3d')](_0x400d0a);return writePDFDocument(_0x582570,_0x2ae8c8['path'])['catch'](function(_0x8318af){throw _0x8318af;});};
\ No newline at end of file
index 94d535e..df334de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa540=['dirname','.xlsx','split','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','isInteger','push'];(function(_0x3c787b,_0x15f957){var _0x3605fb=function(_0x3ae1c8){while(--_0x3ae1c8){_0x3c787b['push'](_0x3c787b['shift']());}};_0x3605fb(++_0x15f957);}(_0xa540,0x155));var _0x0a54=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0xa540[_0x5e7514];return _0x12f472;};'use strict';var util=require('util');var path=require(_0x0a54('0x0'));var _=require(_0x0a54('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x0a54('0x2'));var zipdir=require(_0x0a54('0x3'));var rimraf=require(_0x0a54('0x4'));var db=require(_0x0a54('0x5'))['db'];var dbH=require(_0x0a54('0x5'))[_0x0a54('0x6')];var logger=require(_0x0a54('0x7'))(_0x0a54('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x0a54('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3b0da3,_0x29e417){var _0xf4a0f7={'status':_0x3b0da3};var _0x1101d7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x29e417){_0xf4a0f7[_0x0a54('0xa')]=_0x29e417;}return db['AnalyticExtractedReport']['update'](_0xf4a0f7,_0x1101d7);}function main(){var _0x585975=0x1388;var _0x251b1c;logger[_0x0a54('0xb')](util[_0x0a54('0xc')](_0x0a54('0xd'),EXTRACTED_REPORT_ID,_0x0a54('0xe')));return db[_0x0a54('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0a54('0x10')]})[_0x0a54('0x11')](function(_0x120686){if(_0x120686){_0x251b1c=_0x120686;_0x585975=_0x251b1c[_0x0a54('0x10')]||0x1388;}})[_0x0a54('0x11')](function(){return dbH[_0x0a54('0x12')][_0x0a54('0x13')](util[_0x0a54('0xc')](_0x0a54('0x14'),QUERY),{'type':dbH[_0x0a54('0x12')][_0x0a54('0x15')][_0x0a54('0x16')]});})[_0x0a54('0x11')](function(_0x71207){if(!_0x71207[0x0][_0x0a54('0x17')]){return analyticExtractedReport('Empty');}var _0x1c7680=[];var _0x1ab76b=0x0;if(_0x251b1c['split']){if(_0x71207&&_0x71207[_0x0a54('0x18')]){var _0x524f87=_['range'](_0x71207[0x0]['num']/_0x585975);var _0x25a8bc=Number[_0x0a54('0x19')](_0x71207[0x0][_0x0a54('0x17')]/_0x585975)?_0x71207[0x0][_0x0a54('0x17')]%_0x585975:0x0;_0x524f87['forEach'](function(_0x5f29fa){if(_0x5f29fa>0x0){_0x1ab76b+=_0x585975;}_0x1c7680[_0x0a54('0x1a')](dbH[_0x0a54('0x12')][_0x0a54('0x13')](util[_0x0a54('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x585975,_0x1ab76b),{'type':dbH['sequelize'][_0x0a54('0x15')][_0x0a54('0x16')]}));});if(_0x25a8bc>0x0){_0x1ab76b+=_0x585975;_0x1c7680[_0x0a54('0x1a')](dbH[_0x0a54('0x12')][_0x0a54('0x13')](util[_0x0a54('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x25a8bc,_0x1ab76b),{'type':dbH[_0x0a54('0x12')][_0x0a54('0x15')][_0x0a54('0x16')]}));}}}else{_0x1c7680['push'](dbH[_0x0a54('0x12')][_0x0a54('0x13')](QUERY,{'type':dbH['sequelize'][_0x0a54('0x15')][_0x0a54('0x16')]}));}var _0x24a6bd=path[_0x0a54('0x1b')](PATH);var _0x3abac1=path['basename'](PATH,_0x0a54('0x1c'));var _0x290b4f=_0x251b1c[_0x0a54('0x1d')]&&_0x1c7680['length']>0x1;var _0x5cfdd8=[];if(!fs[_0x0a54('0x1e')](path[_0x0a54('0x1f')](_0x24a6bd,_0x3abac1))&&_0x290b4f){fs[_0x0a54('0x20')](path[_0x0a54('0x1f')](_0x24a6bd,_0x3abac1));}return BPromise[_0x0a54('0x21')](_0x1c7680,function(_0x46c325){_0x5cfdd8[_0x0a54('0x1a')](_0x46c325);})['then'](function(){for(var _0x412ce3=0x0;_0x412ce3<_0x5cfdd8[_0x0a54('0x18')];_0x412ce3+=0x1){var _0x1808a5;var _0x17c1e0=_0x5cfdd8[_0x412ce3];if(_0x290b4f){_0x1808a5=path[_0x0a54('0x1f')](_0x24a6bd,_0x3abac1,util[_0x0a54('0xc')]('%s%d.%s',_0x3abac1,_0x412ce3,_0x0a54('0x22')));}else{_0x1808a5=path['join'](_0x24a6bd,util['format'](_0x0a54('0x23'),_0x3abac1,_0x0a54('0x22')));}fs[_0x0a54('0x24')](_0x1808a5,json2xls(_0x17c1e0),'binary');}})['then'](function(){if(_0x290b4f){return new Promise(function(_0x1c8410){zipdir(path[_0x0a54('0x1f')](_0x24a6bd,_0x3abac1),{'saveTo':path[_0x0a54('0x1f')](_0x24a6bd,util['format'](_0x0a54('0x23'),_0x3abac1,_0x0a54('0x25')))},function(_0x2ca6a0,_0x10751e){rimraf(path[_0x0a54('0x1f')](_0x24a6bd,_0x3abac1),function(){});_0x1c8410(_0x0a54('0x26'));});});}})[_0x0a54('0x11')](function(){logger[_0x0a54('0xb')](util[_0x0a54('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x0a54('0x27'),_0x290b4f?util[_0x0a54('0xc')](_0x0a54('0x23'),_0x3abac1,_0x290b4f?_0x0a54('0x25'):_0x0a54('0x22')):null);});})[_0x0a54('0x28')](function(_0x171f83){logger[_0x0a54('0xb')](util['format'](_0x0a54('0x29'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x0a54('0x2a')](_0x171f83,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0a54('0x2b'));})[_0x0a54('0x2c')](function(){process[_0x0a54('0x2d')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x7e22=['inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','mkdirSync','join','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0x5568f3,_0x9bdfe2){var _0x25a4ec=function(_0x32ea0a){while(--_0x32ea0a){_0x5568f3['push'](_0x5568f3['shift']());}};_0x25a4ec(++_0x9bdfe2);}(_0x7e22,0x1d8));var _0x27e2=function(_0x3c03d2,_0x488a65){_0x3c03d2=_0x3c03d2-0x0;var _0x2f44df=_0x7e22[_0x3c03d2];return _0x2f44df;};'use strict';var util=require(_0x27e2('0x0'));var path=require('path');var _=require(_0x27e2('0x1'));var fs=require('fs');var json2xls=require(_0x27e2('0x2'));var BPromise=require(_0x27e2('0x3'));var zipdir=require(_0x27e2('0x4'));var rimraf=require(_0x27e2('0x5'));var db=require(_0x27e2('0x6'))['db'];var dbH=require('../../mysqldb')[_0x27e2('0x7')];var logger=require('../../config/logger')(_0x27e2('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x27e2('0x9')][0x2]);var QUERY=process[_0x27e2('0x9')][0x3];var PATH=process[_0x27e2('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x54c99e,_0x207ab6){var _0x419985={'status':_0x54c99e};var _0x44cf2e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x207ab6){_0x419985[_0x27e2('0xa')]=_0x207ab6;}return db[_0x27e2('0xb')][_0x27e2('0xc')](_0x419985,_0x44cf2e);}function main(){var _0x1892a9=0x1388;var _0x256eac;logger['info'](util[_0x27e2('0xd')](_0x27e2('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x27e2('0xf')][_0x27e2('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x27e2('0x11'),_0x27e2('0x12')]})['then'](function(_0x1d57b7){if(_0x1d57b7){_0x256eac=_0x1d57b7;_0x1892a9=_0x256eac['splitSizeXlsx']||0x1388;}})[_0x27e2('0x13')](function(){return dbH[_0x27e2('0x14')][_0x27e2('0x15')](util[_0x27e2('0xd')](_0x27e2('0x16'),QUERY),{'type':dbH['sequelize'][_0x27e2('0x17')]['SELECT']});})[_0x27e2('0x13')](function(_0x5c625){if(!_0x5c625[0x0][_0x27e2('0x18')]){return analyticExtractedReport(_0x27e2('0x19'));}var _0x3499e2=[];var _0x20ed2c=0x0;if(_0x256eac[_0x27e2('0x11')]){if(_0x5c625&&_0x5c625[_0x27e2('0x1a')]){var _0x4ee164=_['range'](_0x5c625[0x0][_0x27e2('0x18')]/_0x1892a9);var _0x1c5847=Number['isInteger'](_0x5c625[0x0][_0x27e2('0x18')]/_0x1892a9)?_0x5c625[0x0][_0x27e2('0x18')]%_0x1892a9:0x0;_0x4ee164[_0x27e2('0x1b')](function(_0x223ceb){if(_0x223ceb>0x0){_0x20ed2c+=_0x1892a9;}_0x3499e2[_0x27e2('0x1c')](dbH['sequelize'][_0x27e2('0x15')](util[_0x27e2('0xd')](_0x27e2('0x1d'),QUERY,_0x1892a9,_0x20ed2c),{'type':dbH['sequelize'][_0x27e2('0x17')][_0x27e2('0x1e')]}));});if(_0x1c5847>0x0){_0x20ed2c+=_0x1892a9;_0x3499e2['push'](dbH['sequelize'][_0x27e2('0x15')](util[_0x27e2('0xd')](_0x27e2('0x1d'),QUERY,_0x1c5847,_0x20ed2c),{'type':dbH[_0x27e2('0x14')][_0x27e2('0x17')][_0x27e2('0x1e')]}));}}}else{_0x3499e2[_0x27e2('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x27e2('0x14')][_0x27e2('0x17')][_0x27e2('0x1e')]}));}var _0x270cf3=path[_0x27e2('0x1f')](PATH);var _0x20cf21=path['basename'](PATH,_0x27e2('0x20'));var _0x30b0a9=_0x256eac['split']&&_0x3499e2[_0x27e2('0x1a')]>0x1;var _0x361ba5=[];if(!fs['existsSync'](path['join'](_0x270cf3,_0x20cf21))&&_0x30b0a9){fs[_0x27e2('0x21')](path[_0x27e2('0x22')](_0x270cf3,_0x20cf21));}return BPromise[_0x27e2('0x23')](_0x3499e2,function(_0x46ca56){_0x361ba5[_0x27e2('0x1c')](_0x46ca56);})[_0x27e2('0x13')](function(){for(var _0x175c05=0x0;_0x175c05<_0x361ba5[_0x27e2('0x1a')];_0x175c05+=0x1){var _0x5efbd5;var _0x5000f4=_0x361ba5[_0x175c05];if(_0x30b0a9){_0x5efbd5=path[_0x27e2('0x22')](_0x270cf3,_0x20cf21,util['format'](_0x27e2('0x24'),_0x20cf21,_0x175c05,'xlsx'));}else{_0x5efbd5=path[_0x27e2('0x22')](_0x270cf3,util[_0x27e2('0xd')](_0x27e2('0x25'),_0x20cf21,_0x27e2('0x26')));}fs[_0x27e2('0x27')](_0x5efbd5,json2xls(_0x5000f4),_0x27e2('0x28'));}})['then'](function(){if(_0x30b0a9){return new Promise(function(_0x1eb259){zipdir(path['join'](_0x270cf3,_0x20cf21),{'saveTo':path['join'](_0x270cf3,util[_0x27e2('0xd')](_0x27e2('0x25'),_0x20cf21,_0x27e2('0x29')))},function(_0x44623f,_0x5811ff){rimraf(path[_0x27e2('0x22')](_0x270cf3,_0x20cf21),function(){});_0x1eb259(_0x27e2('0x2a'));});});}})[_0x27e2('0x13')](function(){logger[_0x27e2('0x2b')](util[_0x27e2('0xd')](_0x27e2('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x30b0a9?util[_0x27e2('0xd')]('%s.%s',_0x20cf21,_0x30b0a9?_0x27e2('0x29'):'xlsx'):null);});})[_0x27e2('0x2d')](function(_0x805658){logger['info'](util['format'](_0x27e2('0x2e'),EXTRACTED_REPORT_ID,_0x27e2('0x2f')),util[_0x27e2('0x30')](_0x805658,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x27e2('0x31'));})[_0x27e2('0x32')](function(){process[_0x27e2('0x33')](EXIT_CODE);});}main();
\ No newline at end of file
index 4af5bab..9a8a415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8daa=['CDR(type)=%s','VoiceExtensionId','inbound','push','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','type','Set','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8daa,0x15c));var _0xa8da=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0x8daa[_0x45ce08];return _0x23dff2;};'use strict';var _=require(_0xa8da('0x0'));var util=require(_0xa8da('0x1'));function rewrite(_0x3a6ac5,_0x31696a){var _0x1a765b=this;return _0x3a6ac5[_0xa8da('0x2')][_0xa8da('0x3')][_0xa8da('0x4')]({'raw':!![]})[_0xa8da('0x5')](function(_0xdfc4ab){_0x1a765b[_0xa8da('0x6')]=_0xdfc4ab;return _0x3a6ac5[_0xa8da('0x2')][_0xa8da('0x7')][_0xa8da('0x4')]({'where':{'IntervalId':_0x31696a['IntervalId']},'raw':!![]});})[_0xa8da('0x5')](function(_0x4aa082){return _0x3a6ac5[_0xa8da('0x2')][_0xa8da('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xa8da('0x8')](_['map'](_0x4aa082,_0xa8da('0x9')))}},'order':[{'raw':_0xa8da('0xa')}],'raw':!![]});})['then'](function(_0x517d5e){var _0x345be8=_['filter'](_0x517d5e,{'priority':'1'});var _0x7343fb=_[_0xa8da('0xb')](_0x517d5e,{'isApp':0x1});var _0x2ae52d=_[_0xa8da('0xc')](_0x7343fb,'exten');var _0x595f12=[_0xa8da('0xd'),_0xa8da('0xe')];var _0x22c632=[];var _0x190074=[];for(var _0x1c8268 in _0x2ae52d){if(_0x2ae52d[_0xa8da('0xf')](_0x1c8268)){_0x1a765b[_0xa8da('0x10')]=0x2;_0x1a765b[_0xa8da('0x11')]=[];_0x1a765b[_0xa8da('0x12')]=_['find'](_0x345be8,{'exten':_0x2ae52d[_0x1c8268][0x0]['exten']});_0x1a765b[_0xa8da('0x11')]['push']({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':_0xa8da('0x14'),'appdata':util[_0xa8da('0x15')](_0xa8da('0x16'),_0x2ae52d[_0x1c8268][0x0]['type']),'context':_0x2ae52d[_0x1c8268][0x0]['context'],'exten':_0x2ae52d[_0x1c8268][0x0]['exten'],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});if(_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')]===_0xa8da('0x18')){_0x1a765b[_0xa8da('0x11')][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0]['type'],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x1a')+_0x2ae52d[_0x1c8268][0x0]['VoiceExtensionId'],'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0]['VoiceExtensionId']});}else if(_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')]===_0xa8da('0x1c')){if(_0x1a765b[_0xa8da('0x12')]){_0x1a765b[_0xa8da('0x11')][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x1d')+(_0x1a765b[_0xa8da('0x12')][_0xa8da('0x1e')]?_0xa8da('0x1f')+_0x1a765b[_0xa8da('0x12')]['cutdigits']+'}':_0xa8da('0x20')),'context':_0x2ae52d[_0x1c8268][0x0]['context'],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});}_0x1a765b[_0xa8da('0x11')][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0]['type'],'app':'Set','appdata':_0xa8da('0x1a')+_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')],'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0]['exten'],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});var _0x1617a5=_0x1a765b[_0xa8da('0x10')]++;_0x1a765b['extensions']['push']({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1617a5+0x2)+'):Goto('+(_0x1617a5+0x1)+')','context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1617a5,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});if(_0x1a765b[_0xa8da('0x12')]){_0x1a765b['extensions'][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0]['type'],'app':_0xa8da('0x14'),'appdata':_0x1a765b[_0xa8da('0x12')][_0xa8da('0x1e')]?_0xa8da('0x21')+_0x1a765b['extension'][_0xa8da('0x1e')]+'}':_0xa8da('0x22'),'context':_0x2ae52d[_0x1c8268][0x0]['context'],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});}_0x1a765b[_0xa8da('0x11')][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':_0xa8da('0x14'),'appdata':'outboundrouteid='+_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')],'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0]['exten'],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});if(_0x1a765b[_0xa8da('0x12')]&&_0x1a765b['extension'][_0xa8da('0xf')](_0xa8da('0x23'))&&_0x1a765b[_0xa8da('0x12')][_0xa8da('0x23')]!==_0xa8da('0x24')){_0x1a765b['extensions'][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':'Set','appdata':_0xa8da('0x25'),'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1a765b['priority']++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0]['VoiceExtensionId']});_0x1a765b['extensions'][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x26')+_0x1a765b[_0xa8da('0x12')][_0xa8da('0x23')]||_0xa8da('0x27'),'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});}}_0x1a765b[_0xa8da('0x11')][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0]['type'],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x28'),'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});_0x1a765b[_0xa8da('0x11')][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0]['type'],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x29'),'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'priority':_0x1a765b['priority']++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0]['VoiceExtensionId']});_0x1a765b[_0xa8da('0x11')][_0xa8da('0x19')]({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x2a'),'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'exten':_0x2ae52d[_0x1c8268][0x0]['exten'],'priority':_0x1a765b[_0xa8da('0x10')]++,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0]['VoiceExtensionId']});for(var _0x1c6ead=0x0,_0xa5c0cd=0x0;_0x1c6ead<_0x2ae52d[_0x1c8268][_0xa8da('0x2b')];_0x1c6ead+=0x1,_0xa5c0cd=0x0){var _0x5c15ec=_0x2ae52d[_0x1c8268][_0x1c6ead];if(_0x5c15ec[_0xa8da('0x13')]){_0x5c15ec[_0xa8da('0x13')]=_0x5c15ec['type'][_0xa8da('0x2c')]();}var _0x270d25=[];var _0x537cac=[];delete _0x5c15ec['id'];delete _0x5c15ec[_0xa8da('0x2d')];delete _0x5c15ec[_0xa8da('0x2e')];var _0x1bff36=_0x5c15ec[_0xa8da('0x2f')]!==_0xa8da('0x30')?[_0x5c15ec['interval']]:_0x5c15ec[_0xa8da('0x31')]?_['map'](_[_0xa8da('0xb')](_0x1a765b[_0xa8da('0x6')],{'IntervalId':_0x5c15ec[_0xa8da('0x31')]}),_0xa8da('0x2f')):[];if(_0x5c15ec[_0xa8da('0xf')](_0xa8da('0x32'))){if(_0x5c15ec[_0xa8da('0x32')]&&_0x5c15ec[_0xa8da('0x32')]!=='--'){_0x270d25[_0xa8da('0x19')]({'type':_0x5c15ec['type'],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x33')+_0x5c15ec['tag'],'context':_0x5c15ec[_0xa8da('0x1b')],'exten':_0x5c15ec[_0xa8da('0x9')],'priority':_0x1bff36[_0xa8da('0x2b')]+_0x1a765b[_0xa8da('0x10')]+_0xa5c0cd++,'VoiceExtensionId':_0x5c15ec[_0xa8da('0x17')]});}}if(_0x5c15ec[_0xa8da('0x13')]===_0xa8da('0x1c')&&_0x5c15ec[_0xa8da('0xf')](_0xa8da('0x34'))){if(_0x5c15ec[_0xa8da('0x34')]){_0x270d25['push']({'type':_0x5c15ec['type'],'app':'ExecIf','appdata':_0xa8da('0x35')+_0x5c15ec[_0xa8da('0x34')]+')','context':_0x5c15ec[_0xa8da('0x1b')],'exten':_0x5c15ec[_0xa8da('0x9')],'priority':_0x1bff36[_0xa8da('0x2b')]+_0x1a765b[_0xa8da('0x10')]+_0xa5c0cd++,'VoiceExtensionId':_0x5c15ec[_0xa8da('0x17')]});}else{_0x270d25[_0xa8da('0x19')]({'type':_0x5c15ec[_0xa8da('0x13')],'app':_0xa8da('0x36'),'appdata':_0xa8da('0x37'),'context':_0x5c15ec[_0xa8da('0x1b')],'exten':_0x5c15ec[_0xa8da('0x9')],'priority':_0x1bff36[_0xa8da('0x2b')]+_0x1a765b[_0xa8da('0x10')]+_0xa5c0cd++,'VoiceExtensionId':_0x5c15ec['VoiceExtensionId']});}}if(_0x5c15ec['hasOwnProperty'](_0xa8da('0x38'))){if(_0x595f12['indexOf'](_0x5c15ec[_0xa8da('0x39')][_0xa8da('0x2c')]())>=0x0&&_0x5c15ec['appType']!==_0xa8da('0x3a')){if(_0x5c15ec['answer']){_0x270d25['push']({'type':_0x5c15ec[_0xa8da('0x13')],'app':_0xa8da('0x36'),'appdata':_0xa8da('0x3b'),'context':_0x5c15ec[_0xa8da('0x1b')],'exten':_0x5c15ec[_0xa8da('0x9')],'priority':_0x1bff36[_0xa8da('0x2b')]+_0x1a765b[_0xa8da('0x10')]+_0xa5c0cd++,'VoiceExtensionId':_0x5c15ec[_0xa8da('0x17')]});_0x270d25[_0xa8da('0x19')]({'type':_0x5c15ec['type'],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x3c'),'context':_0x5c15ec[_0xa8da('0x1b')],'exten':_0x5c15ec[_0xa8da('0x9')],'priority':_0x1bff36[_0xa8da('0x2b')]+_0x1a765b['priority']+_0xa5c0cd++,'VoiceExtensionId':_0x5c15ec[_0xa8da('0x17')]});}else{_0x270d25[_0xa8da('0x19')]({'type':_0x5c15ec[_0xa8da('0x13')],'app':_0xa8da('0x36'),'appdata':_0xa8da('0x3d'),'context':_0x5c15ec[_0xa8da('0x1b')],'exten':_0x5c15ec['exten'],'priority':_0x1bff36[_0xa8da('0x2b')]+_0x1a765b[_0xa8da('0x10')]+_0xa5c0cd++,'VoiceExtensionId':_0x5c15ec[_0xa8da('0x17')]});_0x270d25['push']({'type':_0x5c15ec[_0xa8da('0x13')],'app':_0xa8da('0x14'),'appdata':_0xa8da('0x3e'),'context':_0x5c15ec[_0xa8da('0x1b')],'exten':_0x5c15ec['exten'],'priority':_0x1bff36[_0xa8da('0x2b')]+_0x1a765b[_0xa8da('0x10')]+_0xa5c0cd++,'VoiceExtensionId':_0x5c15ec[_0xa8da('0x17')]});}}}for(var _0x5e5355=0x0;_0x5e5355<_0x1bff36[_0xa8da('0x2b')];_0x5e5355+=0x1){var _0x494101=_0x1a765b[_0xa8da('0x10')]+_0x1bff36[_0xa8da('0x2b')];var _0x471c1e=_0x5e5355===_0x1bff36[_0xa8da('0x2b')]-0x1?_0x1a765b[_0xa8da('0x10')]+_0x270d25[_0xa8da('0x2b')]+_0x537cac[_0xa8da('0x2b')]+0x2:_0x1a765b[_0xa8da('0x10')]+_0x5e5355+0x1;_0x270d25[_0xa8da('0x3f')](_0x5e5355,0x0,{'type':_0x5c15ec[_0xa8da('0x13')],'app':'GotoIfTime','appdata':_0x1bff36[_0x5e5355]+'?'+_0x5c15ec[_0xa8da('0x1b')]+',${EXTEN},'+_0x494101+':'+_0x5c15ec[_0xa8da('0x1b')]+',${EXTEN},'+_0x471c1e,'exten':_0x5c15ec[_0xa8da('0x9')],'context':_0x5c15ec[_0xa8da('0x1b')],'priority':_0x1a765b['priority']+_0x5e5355,'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});}_0x5c15ec['priority']=_0x270d25[_0xa8da('0x2b')]?_[_0xa8da('0x40')](_0x270d25)[_0xa8da('0x10')]+0x1:_0x1a765b['priority'];_0x1a765b[_0xa8da('0x10')]=(_0x537cac[_0xa8da('0x2b')]?_[_0xa8da('0x40')](_0x537cac)[_0xa8da('0x10')]:_0x5c15ec[_0xa8da('0x10')])+0x1;_0x1a765b[_0xa8da('0x11')]=_['concat'](_0x1a765b['extensions'],_0x270d25,[_0x5c15ec],_0x537cac);}_0x1a765b[_0xa8da('0x11')]['push']({'type':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x13')],'app':_0xa8da('0x41'),'exten':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x9')],'context':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x1b')],'priority':_0x1a765b[_0xa8da('0x10')],'VoiceExtensionId':_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]});_0x22c632[_0xa8da('0x19')](_0x2ae52d[_0x1c8268][0x0][_0xa8da('0x17')]);_0x190074=_[_0xa8da('0x42')](_0x190074,_0x1a765b[_0xa8da('0x11')]);}}return _0x3a6ac5[_0xa8da('0x43')](function(_0x9e794c){return _0x3a6ac5[_0xa8da('0x2')][_0xa8da('0x7')][_0xa8da('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x22c632}},'transaction':_0x9e794c})[_0xa8da('0x5')](function(_0x4b727f){return _0x3a6ac5[_0xa8da('0x2')][_0xa8da('0x7')][_0xa8da('0x45')](_[_0xa8da('0x46')](_0x190074,'priority'),{'transaction':_0x9e794c});});});})[_0xa8da('0x47')](function(_0x29d293){console[_0xa8da('0x48')](_0x29d293);});}exports[_0xa8da('0x49')]=rewrite;
\ No newline at end of file
+var _0x4450=['wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','sortBy','catch','error','rewrite','lodash','util','Interval','then','models','VoiceExtension','findAll','IntervalId','uniq','map','exten','filter','groupBy','playback','hasOwnProperty','extension','extensions','push','type','Set','format','priority','VoiceExtensionId','context','outbound','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x88051,_0x293ff7){var _0x54e316=function(_0x39d1ea){while(--_0x39d1ea){_0x88051['push'](_0x88051['shift']());}};_0x54e316(++_0x293ff7);}(_0x4450,0x1b8));var _0x0445=function(_0x7c3b4f,_0x990c14){_0x7c3b4f=_0x7c3b4f-0x0;var _0x1e23ae=_0x4450[_0x7c3b4f];return _0x1e23ae;};'use strict';var _=require(_0x0445('0x0'));var util=require(_0x0445('0x1'));function rewrite(_0x1670bb,_0x4b8d36){var _0x56cda7=this;return _0x1670bb['models'][_0x0445('0x2')]['findAll']({'raw':!![]})[_0x0445('0x3')](function(_0x2d5a72){_0x56cda7['intervals']=_0x2d5a72;return _0x1670bb[_0x0445('0x4')][_0x0445('0x5')][_0x0445('0x6')]({'where':{'IntervalId':_0x4b8d36[_0x0445('0x7')]},'raw':!![]});})[_0x0445('0x3')](function(_0x9c423f){return _0x1670bb[_0x0445('0x4')][_0x0445('0x5')][_0x0445('0x6')]({'where':{'exten':{'$in':_[_0x0445('0x8')](_[_0x0445('0x9')](_0x9c423f,_0x0445('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x0445('0x3')](function(_0x187f74){var _0x5e3af2=_['filter'](_0x187f74,{'priority':'1'});var _0x2aae23=_[_0x0445('0xb')](_0x187f74,{'isApp':0x1});var _0x5e7305=_[_0x0445('0xc')](_0x2aae23,_0x0445('0xa'));var _0x4c7478=['queue',_0x0445('0xd')];var _0x3a6a9e=[];var _0x313b83=[];for(var _0x106c8c in _0x5e7305){if(_0x5e7305[_0x0445('0xe')](_0x106c8c)){_0x56cda7['priority']=0x2;_0x56cda7['extensions']=[];_0x56cda7[_0x0445('0xf')]=_['find'](_0x5e3af2,{'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')]});_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':_0x0445('0x13'),'appdata':util[_0x0445('0x14')]('CDR(type)=%s',_0x5e7305[_0x106c8c][0x0]['type']),'context':_0x5e7305[_0x106c8c][0x0]['context'],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7[_0x0445('0x15')]++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});if(_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')]==='inbound'){_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':'Set','appdata':'CDR(routeid)='+_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')],'context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0]['exten'],'priority':_0x56cda7[_0x0445('0x15')]++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});}else if(_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')]===_0x0445('0x18')){if(_0x56cda7[_0x0445('0xf')]){_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':_0x0445('0x13'),'appdata':'CDR(destination)='+(_0x56cda7[_0x0445('0xf')][_0x0445('0x19')]?_0x0445('0x1a')+_0x56cda7[_0x0445('0xf')][_0x0445('0x19')]+'}':_0x0445('0x1b')),'context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7['priority']++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});}_0x56cda7[_0x0445('0x10')]['push']({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':'Set','appdata':_0x0445('0x1c')+_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')],'context':_0x5e7305[_0x106c8c][0x0]['context'],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7[_0x0445('0x15')]++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});var _0x22d125=_0x56cda7[_0x0445('0x15')]++;_0x56cda7[_0x0445('0x10')]['push']({'type':_0x5e7305[_0x106c8c][0x0]['type'],'app':_0x0445('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x22d125+0x2)+_0x0445('0x1e')+(_0x22d125+0x1)+')','context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x22d125,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0]['VoiceExtensionId']});if(_0x56cda7[_0x0445('0xf')]){_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0]['type'],'app':_0x0445('0x13'),'appdata':_0x56cda7[_0x0445('0xf')][_0x0445('0x19')]?'CDR(prefix)=${EXTEN:0:'+_0x56cda7[_0x0445('0xf')][_0x0445('0x19')]+'}':'CDR(prefix)=noprefix','context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7[_0x0445('0x15')]++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});}_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':_0x0445('0x13'),'appdata':_0x0445('0x1f')+_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')],'context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7['priority']++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});if(_0x56cda7[_0x0445('0xf')]&&_0x56cda7[_0x0445('0xf')][_0x0445('0xe')](_0x0445('0x20'))&&_0x56cda7[_0x0445('0xf')][_0x0445('0x20')]!==_0x0445('0x21')){_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':'Set','appdata':_0x0445('0x22'),'context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0]['exten'],'priority':_0x56cda7[_0x0445('0x15')]++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':_0x0445('0x13'),'appdata':_0x0445('0x23')+_0x56cda7[_0x0445('0xf')][_0x0445('0x20')]||_0x0445('0x24'),'context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0]['exten'],'priority':_0x56cda7[_0x0445('0x15')]++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});}}_0x56cda7[_0x0445('0x10')]['push']({'type':_0x5e7305[_0x106c8c][0x0]['type'],'app':_0x0445('0x13'),'appdata':_0x0445('0x25'),'context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7['priority']++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':_0x0445('0x13'),'appdata':_0x0445('0x26'),'context':_0x5e7305[_0x106c8c][0x0]['context'],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7['priority']++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});_0x56cda7['extensions'][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0]['type'],'app':_0x0445('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'priority':_0x56cda7[_0x0445('0x15')]++,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0]['VoiceExtensionId']});for(var _0x5c1f12=0x0,_0x15e5a3=0x0;_0x5c1f12<_0x5e7305[_0x106c8c][_0x0445('0x27')];_0x5c1f12+=0x1,_0x15e5a3=0x0){var _0x2466ce=_0x5e7305[_0x106c8c][_0x5c1f12];if(_0x2466ce[_0x0445('0x12')]){_0x2466ce[_0x0445('0x12')]=_0x2466ce[_0x0445('0x12')][_0x0445('0x28')]();}var _0x1ec2e6=[];var _0x20407b=[];delete _0x2466ce['id'];delete _0x2466ce[_0x0445('0x29')];delete _0x2466ce[_0x0445('0x2a')];var _0x3ea680=_0x2466ce[_0x0445('0x2b')]!==_0x0445('0x2c')?[_0x2466ce[_0x0445('0x2b')]]:_0x2466ce[_0x0445('0x7')]?_[_0x0445('0x9')](_['filter'](_0x56cda7[_0x0445('0x2d')],{'IntervalId':_0x2466ce['IntervalId']}),_0x0445('0x2b')):[];if(_0x2466ce[_0x0445('0xe')](_0x0445('0x2e'))){if(_0x2466ce[_0x0445('0x2e')]&&_0x2466ce[_0x0445('0x2e')]!=='--'){_0x1ec2e6['push']({'type':_0x2466ce[_0x0445('0x12')],'app':_0x0445('0x13'),'appdata':_0x0445('0x2f')+_0x2466ce['tag'],'context':_0x2466ce['context'],'exten':_0x2466ce[_0x0445('0xa')],'priority':_0x3ea680[_0x0445('0x27')]+_0x56cda7[_0x0445('0x15')]+_0x15e5a3++,'VoiceExtensionId':_0x2466ce[_0x0445('0x16')]});}}if(_0x2466ce[_0x0445('0x12')]===_0x0445('0x18')&&_0x2466ce[_0x0445('0xe')](_0x0445('0x30'))){if(_0x2466ce[_0x0445('0x30')]){_0x1ec2e6[_0x0445('0x11')]({'type':_0x2466ce['type'],'app':_0x0445('0x1d'),'appdata':_0x0445('0x31')+_0x2466ce[_0x0445('0x30')]+')','context':_0x2466ce[_0x0445('0x17')],'exten':_0x2466ce[_0x0445('0xa')],'priority':_0x3ea680[_0x0445('0x27')]+_0x56cda7[_0x0445('0x15')]+_0x15e5a3++,'VoiceExtensionId':_0x2466ce[_0x0445('0x16')]});}else{_0x1ec2e6[_0x0445('0x11')]({'type':_0x2466ce[_0x0445('0x12')],'app':_0x0445('0x1d'),'appdata':_0x0445('0x32'),'context':_0x2466ce[_0x0445('0x17')],'exten':_0x2466ce['exten'],'priority':_0x3ea680[_0x0445('0x27')]+_0x56cda7['priority']+_0x15e5a3++,'VoiceExtensionId':_0x2466ce['VoiceExtensionId']});}}if(_0x2466ce['hasOwnProperty'](_0x0445('0x33'))){if(_0x4c7478[_0x0445('0x34')](_0x2466ce[_0x0445('0x35')]['toLowerCase']())>=0x0&&_0x2466ce[_0x0445('0x36')]!=='custom'){if(_0x2466ce['answer']){_0x1ec2e6[_0x0445('0x11')]({'type':_0x2466ce[_0x0445('0x12')],'app':_0x0445('0x1d'),'appdata':_0x0445('0x37'),'context':_0x2466ce[_0x0445('0x17')],'exten':_0x2466ce[_0x0445('0xa')],'priority':_0x3ea680[_0x0445('0x27')]+_0x56cda7[_0x0445('0x15')]+_0x15e5a3++,'VoiceExtensionId':_0x2466ce[_0x0445('0x16')]});_0x1ec2e6['push']({'type':_0x2466ce[_0x0445('0x12')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2466ce['context'],'exten':_0x2466ce['exten'],'priority':_0x3ea680[_0x0445('0x27')]+_0x56cda7[_0x0445('0x15')]+_0x15e5a3++,'VoiceExtensionId':_0x2466ce[_0x0445('0x16')]});}else{_0x1ec2e6[_0x0445('0x11')]({'type':_0x2466ce[_0x0445('0x12')],'app':_0x0445('0x1d'),'appdata':_0x0445('0x38'),'context':_0x2466ce[_0x0445('0x17')],'exten':_0x2466ce['exten'],'priority':_0x3ea680[_0x0445('0x27')]+_0x56cda7[_0x0445('0x15')]+_0x15e5a3++,'VoiceExtensionId':_0x2466ce['VoiceExtensionId']});_0x1ec2e6[_0x0445('0x11')]({'type':_0x2466ce[_0x0445('0x12')],'app':_0x0445('0x13'),'appdata':_0x0445('0x39'),'context':_0x2466ce[_0x0445('0x17')],'exten':_0x2466ce[_0x0445('0xa')],'priority':_0x3ea680['length']+_0x56cda7[_0x0445('0x15')]+_0x15e5a3++,'VoiceExtensionId':_0x2466ce[_0x0445('0x16')]});}}}for(var _0x3b3098=0x0;_0x3b3098<_0x3ea680[_0x0445('0x27')];_0x3b3098+=0x1){var _0x104d4e=_0x56cda7[_0x0445('0x15')]+_0x3ea680[_0x0445('0x27')];var _0x18df03=_0x3b3098===_0x3ea680['length']-0x1?_0x56cda7[_0x0445('0x15')]+_0x1ec2e6['length']+_0x20407b['length']+0x2:_0x56cda7[_0x0445('0x15')]+_0x3b3098+0x1;_0x1ec2e6[_0x0445('0x3a')](_0x3b3098,0x0,{'type':_0x2466ce[_0x0445('0x12')],'app':_0x0445('0x3b'),'appdata':_0x3ea680[_0x3b3098]+'?'+_0x2466ce[_0x0445('0x17')]+_0x0445('0x3c')+_0x104d4e+':'+_0x2466ce[_0x0445('0x17')]+_0x0445('0x3c')+_0x18df03,'exten':_0x2466ce['exten'],'context':_0x2466ce[_0x0445('0x17')],'priority':_0x56cda7[_0x0445('0x15')]+_0x3b3098,'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0]['VoiceExtensionId']});}_0x2466ce[_0x0445('0x15')]=_0x1ec2e6[_0x0445('0x27')]?_[_0x0445('0x3d')](_0x1ec2e6)[_0x0445('0x15')]+0x1:_0x56cda7[_0x0445('0x15')];_0x56cda7['priority']=(_0x20407b['length']?_[_0x0445('0x3d')](_0x20407b)['priority']:_0x2466ce[_0x0445('0x15')])+0x1;_0x56cda7[_0x0445('0x10')]=_[_0x0445('0x3e')](_0x56cda7[_0x0445('0x10')],_0x1ec2e6,[_0x2466ce],_0x20407b);}_0x56cda7[_0x0445('0x10')][_0x0445('0x11')]({'type':_0x5e7305[_0x106c8c][0x0][_0x0445('0x12')],'app':'Hangup','exten':_0x5e7305[_0x106c8c][0x0][_0x0445('0xa')],'context':_0x5e7305[_0x106c8c][0x0][_0x0445('0x17')],'priority':_0x56cda7['priority'],'VoiceExtensionId':_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]});_0x3a6a9e['push'](_0x5e7305[_0x106c8c][0x0][_0x0445('0x16')]);_0x313b83=_[_0x0445('0x3e')](_0x313b83,_0x56cda7[_0x0445('0x10')]);}}return _0x1670bb[_0x0445('0x3f')](function(_0x1dfa84){return _0x1670bb[_0x0445('0x4')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3a6a9e}},'transaction':_0x1dfa84})[_0x0445('0x3')](function(_0x16922b){return _0x1670bb[_0x0445('0x4')][_0x0445('0x5')]['bulkCreate'](_[_0x0445('0x40')](_0x313b83,_0x0445('0x15')),{'transaction':_0x1dfa84});});});})[_0x0445('0x41')](function(_0x5a22dd){console[_0x0445('0x42')](_0x5a22dd);});}exports[_0x0445('0x43')]=rewrite;
\ No newline at end of file
index b8b20c6..82113c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab1c=['updatedAt','select','field','scheduledAt','toString','NOW()','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','cm_hopper','cm_hopper_black','findAll','outbound','CmList','Lists','then','always','sequelize','query','VoiceQueueId','catch','all','VoiceQueue','get','Campaign','CampaignId','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parse\x20error','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','CmContact','create','keys','push','pick','Error\x20while\x20creating\x20contact:\x20','message','inspect','insert','into','fromQuery','ContactId','createdAt'];(function(_0x3cb585,_0x574ac8){var _0x2164d2=function(_0x56e4b8){while(--_0x56e4b8){_0x3cb585['push'](_0x3cb585['shift']());}};_0x2164d2(++_0x574ac8);}(_0xab1c,0x1e5));var _0xcab1=function(_0x224b4,_0x356ff6){_0x224b4=_0x224b4-0x0;var _0x542bda=_0xab1c[_0x224b4];return _0x542bda;};'use strict';var BPromise=require('bluebird');var util=require(_0xcab1('0x0'));var _=require(_0xcab1('0x1'));var fs=require('fs');var squel=require(_0xcab1('0x2'));var Papa=require(_0xcab1('0x3'));var Redis=require(_0xcab1('0x4'));var db=require(_0xcab1('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xcab1('0x6'))(_0xcab1('0x7'));config[_0xcab1('0x8')]=_[_0xcab1('0x9')](config[_0xcab1('0x8')],{'host':_0xcab1('0xa'),'port':0x18eb});var socket=require(_0xcab1('0xb'))(new Redis(config[_0xcab1('0x8')]));require(_0xcab1('0xc'))[_0xcab1('0xd')](socket);try{if(!process[_0xcab1('0xe')][0x2]||process['argv'][0x2]===_0xcab1('0xf')||process[_0xcab1('0xe')][0x2]===_0xcab1('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xcab1('0xe')][0x2];if(!process[_0xcab1('0xe')][0x3]||process[_0xcab1('0xe')][0x3]===_0xcab1('0xf')||process[_0xcab1('0xe')][0x3]==='null'||!process['argv'][0x4]||process[_0xcab1('0xe')][0x4]===_0xcab1('0xf')||process['argv'][0x4]===_0xcab1('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process[_0xcab1('0xe')][0x3][_0xcab1('0x11')](','),process[_0xcab1('0xe')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xcab1('0xe')][0x5]==='undefined'||process['argv'][0x5]===_0xcab1('0x10')){throw new Error(_0xcab1('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xcab1('0xe')][0x6]&&process[_0xcab1('0xe')][0x6]!==_0xcab1('0xf')&&process[_0xcab1('0xe')][0x6]!==_0xcab1('0x10')?process[_0xcab1('0xe')][0x6]:null;var DUPLICATES=process[_0xcab1('0xe')][0x7]&&process[_0xcab1('0xe')][0x7]!==_0xcab1('0xf')&&process[_0xcab1('0xe')][0x7]!=='null'?process[_0xcab1('0xe')][0x7]:null;if(!process[_0xcab1('0xe')][0x8]||process[_0xcab1('0xe')][0x8]===_0xcab1('0xf')||process['argv'][0x8]===_0xcab1('0x10')){throw new Error(_0xcab1('0x13'));}var SOCKET_TIMESTAMP=process[_0xcab1('0xe')][0x8];}catch(_0x257db0){logger[_0xcab1('0x14')](_0x257db0);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(_0x3b93da,_0x5e67d0,_0x4e9296,_0x3263e5){var _0x20c843={'message':_0x5e67d0};_0x20c843[_0x3b93da]=!![];if(_0x4e9296){_0x20c843['contact']=_0x4e9296;}if(_0x3263e5){_0x20c843['index']=_0x3263e5;}return _0x20c843;}function isEmail(_0x2f730f){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'](_0x2f730f);}function checkRow(_0x4dd0e4,_0x329611,_0x23528e){return new BPromise(function(_0x49b3d6,_0x3988f8){if(_[_0xcab1('0x15')](_0x4dd0e4)){return _0x3988f8(handleCheckRowError('error',_0xcab1('0x16'),null,_0x23528e));}if(_0x4dd0e4[_0xcab1('0x17')]&&_0x4dd0e4[_0xcab1('0x17')][_0xcab1('0x18')]){var _0x152759=_[_0xcab1('0x19')](_0x4dd0e4[_0xcab1('0x17')],'message')[_0xcab1('0x1a')](';');return _0x3988f8(handleCheckRowError(_0xcab1('0x14'),_0x152759,null,_0x23528e));}var _0x21cbe9={};for(var _0xb0a6de in FIELDS){if(FIELDS[_0xcab1('0x1b')](_0xb0a6de)&&FIELDS[_0xb0a6de]){_0x21cbe9[_0xb0a6de]=_0x4dd0e4['data'][0x0][FIELDS[_0xb0a6de]]||_0x4dd0e4[_0xcab1('0x1c')][0x0]['\ufeff'+FIELDS[_0xb0a6de]];}}if(!_0x21cbe9[_0xcab1('0x1d')]){return _0x3988f8(handleCheckRowError(_0xcab1('0x14'),_0xcab1('0x1e'),null,_0x23528e));}if(!_0x21cbe9[_0xcab1('0x1f')]){return _0x3988f8(handleCheckRowError(_0xcab1('0x14'),_0xcab1('0x20'),null,_0x23528e));}if(_0x21cbe9[_0xcab1('0x21')]){var _0x325700=moment(_0x21cbe9[_0xcab1('0x21')],'YYYY-MM-DD');if(!_0x325700[_0xcab1('0x22')]()){return _0x3988f8(handleCheckRowError(_0xcab1('0x14'),_0xcab1('0x23'),null,_0x23528e));}}if(_0x21cbe9[_0xcab1('0x24')]){if(!isEmail(_0x21cbe9[_0xcab1('0x24')])){return _0x3988f8(handleCheckRowError(_0xcab1('0x14'),_0xcab1('0x25'),null,_0x23528e));}}_0x21cbe9[_0xcab1('0x26')]=LISTID;_0x21cbe9[_0xcab1('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x329611){var _0x21de53={};for(var _0x1da3cd=0x0,_0x1eef6e=DUPLICATES['length'];_0x1da3cd<_0x1eef6e;_0x1da3cd+=0x1){_0x21de53[DUPLICATES[_0x1da3cd]]=_0x21cbe9[DUPLICATES[_0x1da3cd]];}var _0x365866=_[_0xcab1('0x28')](_0x329611,_0x21de53);if(_0x365866){return _0x3988f8(handleCheckRowError(_0xcab1('0x29'),'Duplicate\x20Contact',_0x365866,_0x23528e));}}return db[_0xcab1('0x2a')][_0xcab1('0x2b')](_0x21cbe9,{'raw':!![],'hooks':![],'fields':_[_0xcab1('0x2c')](_0x21cbe9)})['then'](function(_0x337a05){if(DUPLICATES&&DUPLICATES['length']&&_0x329611){_0x329611[_0xcab1('0x2d')](_[_0xcab1('0x2e')](_0x21cbe9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x337a05['id'];return _0x49b3d6();})['catch'](function(_0x5d3383){return _0x3988f8(handleCheckRowError(_0xcab1('0x14'),_0xcab1('0x2f')+(_0x5d3383[_0xcab1('0x30')]||JSON['stringify'](_0x5d3383)),null,_0x23528e));});});}function checkHopper(){function _0x17a143(){return function(_0x8c8082){logger[_0xcab1('0x14')]('cmContact','checkHopper',util[_0xcab1('0x31')](_0x8c8082,{'showHidden':![],'depth':null}));};}var _0x7176f4=function(_0x3914ae,_0x32cc7a){var _0x1d103c=squel[_0xcab1('0x32')]()[_0xcab1('0x33')]('cm_hopper')[_0xcab1('0x34')]([_0xcab1('0x1f'),'scheduledAt',_0xcab1('0x35'),'ListId',_0x32cc7a,_0xcab1('0x36'),_0xcab1('0x37')],squel[_0xcab1('0x38')]()[_0xcab1('0x39')](_0xcab1('0x1f'),'phone')['field']('NOW()',_0xcab1('0x3a'))[_0xcab1('0x39')]('id',_0xcab1('0x35'))[_0xcab1('0x39')](LISTID[_0xcab1('0x3b')](),_0xcab1('0x26'))['field'](_0x3914ae['id'][_0xcab1('0x3b')](),_0x32cc7a)[_0xcab1('0x39')](_0xcab1('0x3c'),_0xcab1('0x36'))[_0xcab1('0x39')](_0xcab1('0x3c'),'updatedAt')['from']('cm_contacts')[_0xcab1('0x3d')](_0xcab1('0x3e'))[_0xcab1('0x3d')]('ListId\x20=\x20?',LISTID[_0xcab1('0x3b')]())[_0xcab1('0x3d')](_0xcab1('0x3f'))[_0xcab1('0x3d')](_0xcab1('0x40'),squel[_0xcab1('0x38')]()[_0xcab1('0x39')](_0xcab1('0x1f'))[_0xcab1('0x41')]('cm_hopper')['where'](_0x32cc7a+_0xcab1('0x42'),_0x3914ae['id'][_0xcab1('0x3b')]())))[_0xcab1('0x3b')]();return _0x1d103c;};var _0x1fb305=function(_0x37ce99,_0x56c1bb){var _0x44f982=squel[_0xcab1('0x32')]()[_0xcab1('0x33')]('cm_hopper')[_0xcab1('0x34')](['phone',_0xcab1('0x3a'),'ContactId',_0xcab1('0x26'),_0x56c1bb,'createdAt',_0xcab1('0x37')],squel[_0xcab1('0x38')]()['field'](_0xcab1('0x1f'),_0xcab1('0x1f'))[_0xcab1('0x39')]('NOW()',_0xcab1('0x3a'))[_0xcab1('0x39')]('id',_0xcab1('0x35'))[_0xcab1('0x39')](LISTID[_0xcab1('0x3b')](),_0xcab1('0x26'))[_0xcab1('0x39')](_0x37ce99['id'][_0xcab1('0x3b')](),_0x56c1bb)[_0xcab1('0x39')](_0xcab1('0x3c'),_0xcab1('0x36'))[_0xcab1('0x39')](_0xcab1('0x3c'),_0xcab1('0x37'))[_0xcab1('0x41')](_0xcab1('0x43'))['where'](_0xcab1('0x3e'))[_0xcab1('0x3d')](_0xcab1('0x44'),LISTID[_0xcab1('0x3b')]())[_0xcab1('0x3d')](_0xcab1('0x45'),squel[_0xcab1('0x46')](hopperContacts))[_0xcab1('0x3d')](_0xcab1('0x3f'))['where'](_0xcab1('0x40'),squel['select']()['field']('calleridnum')['from'](_0xcab1('0x47'))[_0xcab1('0x3d')](_0x56c1bb+'\x20=\x20?',_0x37ce99['id'][_0xcab1('0x3b')]()))[_0xcab1('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcab1('0x38')]()[_0xcab1('0x39')](_0xcab1('0x1f'))[_0xcab1('0x41')](_0xcab1('0x48'))[_0xcab1('0x3d')](_0x56c1bb+_0xcab1('0x42'),_0x37ce99['id'][_0xcab1('0x3b')]())))[_0xcab1('0x3b')]();return _0x44f982;};function _0x5e7dc4(_0x1bf4e5,_0x3361e5){var _0x3fa5fe=squel[_0xcab1('0x32')]()[_0xcab1('0x33')](_0xcab1('0x48'))[_0xcab1('0x34')]([_0xcab1('0x1f'),'scheduledAt',_0xcab1('0x35'),_0xcab1('0x26'),_0x3361e5,_0xcab1('0x36'),_0xcab1('0x37')],squel[_0xcab1('0x38')]()[_0xcab1('0x39')](_0xcab1('0x1f'),'phone')['field'](_0xcab1('0x3c'),_0xcab1('0x3a'))[_0xcab1('0x39')]('id',_0xcab1('0x35'))[_0xcab1('0x39')](LISTID[_0xcab1('0x3b')](),_0xcab1('0x26'))['field'](_0x1bf4e5['id'][_0xcab1('0x3b')](),_0x3361e5)[_0xcab1('0x39')](_0xcab1('0x3c'),'createdAt')[_0xcab1('0x39')](_0xcab1('0x3c'),_0xcab1('0x37'))[_0xcab1('0x41')]('cm_contacts')['where'](_0xcab1('0x3e'))['where'](_0xcab1('0x44'),LISTID['toString']())[_0xcab1('0x3d')](_0xcab1('0x45'),squel['str'](hopperContacts))[_0xcab1('0x3d')](_0xcab1('0x3f')))[_0xcab1('0x3b')]();return _0x3fa5fe;}function _0x2a8a7c(_0x3a18a4,_0x2acbc4){var _0x520078=squel['insert']()[_0xcab1('0x33')](_0xcab1('0x49'))[_0xcab1('0x34')](['phone','ContactId',_0xcab1('0x26'),_0x2acbc4,_0xcab1('0x36'),_0xcab1('0x37')],squel[_0xcab1('0x38')]()[_0xcab1('0x39')](_0xcab1('0x1f'),_0xcab1('0x1f'))[_0xcab1('0x39')]('id',_0xcab1('0x35'))[_0xcab1('0x39')](LISTID[_0xcab1('0x3b')](),_0xcab1('0x26'))[_0xcab1('0x39')](_0x3a18a4['id'][_0xcab1('0x3b')](),_0x2acbc4)[_0xcab1('0x39')](_0xcab1('0x3c'),'createdAt')[_0xcab1('0x39')](_0xcab1('0x3c'),'updatedAt')[_0xcab1('0x41')]('cm_contacts')['where'](_0xcab1('0x3e'))[_0xcab1('0x3d')](_0xcab1('0x44'),LISTID[_0xcab1('0x3b')]())[_0xcab1('0x3d')](_0xcab1('0x45'),squel[_0xcab1('0x46')](hopperContacts))[_0xcab1('0x3d')](_0xcab1('0x3f')))[_0xcab1('0x3b')]();return _0x520078;}return db['VoiceQueue'][_0xcab1('0x4a')]({'where':{'type':_0xcab1('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xcab1('0x4c')],'as':_0xcab1('0x4d'),'where':{'id':LISTID}}]})[_0xcab1('0x4e')](function(_0x77c09d){var _0x506eca=[];if(_0x77c09d){var _0x1688e6;for(var _0x1ff315=0x0,_0x1c978c;_0x1ff315<_0x77c09d['length'];_0x1ff315+=0x1){_0x1c978c=_0x77c09d[_0x1ff315]['get']({'plain':!![]});switch(_0x1c978c['dialCheckDuplicateType']){case _0xcab1('0x4f'):_0x506eca[_0xcab1('0x2d')](db[_0xcab1('0x50')][_0xcab1('0x51')](_0x1fb305(_0x1c978c,_0xcab1('0x52')))[_0xcab1('0x4e')](function(){})['catch'](_0x17a143()));break;case'onlyIfOpen':_0x506eca[_0xcab1('0x2d')](db[_0xcab1('0x50')][_0xcab1('0x51')](_0x7176f4(_0x1c978c,_0xcab1('0x52')))[_0xcab1('0x4e')](function(){})[_0xcab1('0x53')](_0x17a143()));break;default:_0x506eca['push'](db['sequelize'][_0xcab1('0x51')](_0x5e7dc4(_0x1c978c,_0xcab1('0x52')))[_0xcab1('0x4e')](function(){})[_0xcab1('0x53')](_0x17a143()));}}}return _0x506eca;})[_0xcab1('0x54')]()[_0xcab1('0x4e')](function(){return db[_0xcab1('0x55')][_0xcab1('0x4a')]({'where':{'type':_0xcab1('0x4b')},'attributes':['id'],'include':[{'model':db[_0xcab1('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xcab1('0x4e')](function(_0x2ff434){var _0x2993de=[];if(_0x2ff434){var _0xf83d4c;for(var _0x5cae9f=0x0,_0x18d863;_0x5cae9f<_0x2ff434[_0xcab1('0x18')];_0x5cae9f+=0x1){_0x18d863=_0x2ff434[_0x5cae9f][_0xcab1('0x56')]({'plain':!![]});_0x2993de[_0xcab1('0x2d')](db[_0xcab1('0x50')][_0xcab1('0x51')](_0x2a8a7c(_0x18d863,_0xcab1('0x52')))['then'](function(){})[_0xcab1('0x53')](_0x17a143()));}}return _0x2993de;})[_0xcab1('0x54')]();})[_0xcab1('0x4e')](function(){return db[_0xcab1('0x57')][_0xcab1('0x4a')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xcab1('0x4c')],'as':_0xcab1('0x4d'),'where':{'id':LISTID}}]})[_0xcab1('0x4e')](function(_0x251c54){var _0x45e980=[];if(_0x251c54){for(var _0x39b6ea=0x0,_0x5451a4;_0x39b6ea<_0x251c54[_0xcab1('0x18')];_0x39b6ea+=0x1){_0x5451a4=_0x251c54[_0x39b6ea][_0xcab1('0x56')]({'plain':!![]});switch(_0x5451a4['dialCheckDuplicateType']){case'always':_0x45e980[_0xcab1('0x2d')](db[_0xcab1('0x50')]['query'](_0x1fb305(_0x5451a4,_0xcab1('0x58')))['then'](function(){})[_0xcab1('0x53')](_0x17a143()));break;case _0xcab1('0x59'):_0x45e980[_0xcab1('0x2d')](db[_0xcab1('0x50')][_0xcab1('0x51')](_0x7176f4(_0x5451a4,_0xcab1('0x58')))['then'](function(){})[_0xcab1('0x53')](_0x17a143()));break;default:_0x45e980['push'](db[_0xcab1('0x50')]['query'](_0x5e7dc4(_0x5451a4,_0xcab1('0x58')))[_0xcab1('0x4e')](function(){})['catch'](_0x17a143()));}}}return _0x45e980;})[_0xcab1('0x54')]();})[_0xcab1('0x4e')](function(){return db[_0xcab1('0x57')][_0xcab1('0x4a')]({'attributes':['id'],'include':[{'model':db[_0xcab1('0x4c')],'as':_0xcab1('0x5a'),'where':{'id':LISTID}}]})[_0xcab1('0x4e')](function(_0x4ab88c){var _0x1f4238=[];if(_0x4ab88c){for(var _0x26030d=0x0,_0x13cc37;_0x26030d<_0x4ab88c[_0xcab1('0x18')];_0x26030d+=0x1){_0x13cc37=_0x4ab88c[_0x26030d][_0xcab1('0x56')]({'plain':!![]});_0x1f4238[_0xcab1('0x2d')](db[_0xcab1('0x50')][_0xcab1('0x51')](_0x2a8a7c(_0x13cc37,'CampaignId'))[_0xcab1('0x4e')](function(){})[_0xcab1('0x53')](_0x17a143()));}}return _0x1f4238;})[_0xcab1('0x54')]();})[_0xcab1('0x53')](function(_0x176cdd){logger[_0xcab1('0x14')](_0xcab1('0x5b'),_0xcab1('0x5c'),_0x176cdd[_0xcab1('0x30')]);});}var processPromises=function(_0x2cab73){return BPromise[_0xcab1('0x54')](promises)['then'](function(_0x49c996){})[_0xcab1('0x53')](function(_0x303cf4){logger[_0xcab1('0x14')](_0xcab1('0x5d'),JSON[_0xcab1('0x5e')](_0x303cf4));})[_0xcab1('0x5f')](function(){socket[_0xcab1('0x60')](_0xcab1('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2cab73){return _0x2cab73['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0xcab1('0x4e')](function(){if(hopperContacts){return checkHopper();}})[_0xcab1('0x4e')](function(){socket['emit'](_0xcab1('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcab1('0x62')](FILEPATH);}catch(_0x2f2b97){logger[_0xcab1('0x14')](_0xcab1('0x63'),JSON[_0xcab1('0x5e')](_0x2f2b97));}finally{process['exit'](0x0);}});};process['on'](_0xcab1('0x64'),function(){logger[_0xcab1('0x65')](_0xcab1('0x66'));endCsv();});function main(){return BPromise[_0xcab1('0x67')]()[_0xcab1('0x4e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcab1('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcab1('0x4e')](function(_0x4c8038){var _0x5dcdf9=fs[_0xcab1('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xcab1('0x69')](_0x5dcdf9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x23e785,_0x5bb30a){total+=0x1;var _0x1db88f=total;promises[_0xcab1('0x2d')](checkRow(_0x23e785,_0x4c8038,_0x1db88f)['then'](function(){success+=0x1;})[_0xcab1('0x53')](function(_0xcd4c08){if(_0xcd4c08[_0xcab1('0x14')]){errors+=0x1;delete _0xcd4c08[_0xcab1('0x14')];}else if(_0xcd4c08[_0xcab1('0x29')]){duplicates+=0x1;delete _0xcd4c08['duplicate'];}rows[_0xcab1('0x2d')](_0xcd4c08);}));if(total%0xc8===0x0){_0x5bb30a[_0xcab1('0x6a')]();return processPromises(_0x5bb30a);}},'complete':function(){return processPromises()[_0xcab1('0x4e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x4856ac,_0x31ae12){logger['info'](_0xcab1('0x6b'),JSON[_0xcab1('0x5e')](_0x4856ac));endCsv();}});})[_0xcab1('0x53')](function(_0x5868ff){logger[_0xcab1('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xcab1('0x5e')](_0x5868ff));});}main();
\ No newline at end of file
+var _0x76f6=['NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','CmList','BlackLists','all','Lists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','message','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x76f6,0x17d));var _0x676f=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x76f6[_0x12f688];return _0x59c3de;};'use strict';var BPromise=require(_0x676f('0x0'));var util=require('util');var _=require(_0x676f('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x676f('0x2'));var db=require(_0x676f('0x3'))['db'];var config=require(_0x676f('0x4'));var logger=require(_0x676f('0x5'))(_0x676f('0x6'));config['redis']=_[_0x676f('0x7')](config[_0x676f('0x8')],{'host':_0x676f('0x9'),'port':0x18eb});var socket=require(_0x676f('0xa'))(new Redis(config['redis']));require(_0x676f('0xb'))['register'](socket);try{if(!process[_0x676f('0xc')][0x2]||process['argv'][0x2]===_0x676f('0xd')||process[_0x676f('0xc')][0x2]===_0x676f('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x676f('0xc')][0x3]||process[_0x676f('0xc')][0x3]===_0x676f('0xd')||process['argv'][0x3]===_0x676f('0xe')||!process['argv'][0x4]||process[_0x676f('0xc')][0x4]===_0x676f('0xd')||process[_0x676f('0xc')][0x4]===_0x676f('0xe')){throw new Error(_0x676f('0xf'));}var FIELDS=_[_0x676f('0x10')](process[_0x676f('0xc')][0x3][_0x676f('0x11')](','),process[_0x676f('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x676f('0xd')||process['argv'][0x5]===_0x676f('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x676f('0xc')][0x5];var COMPANYID=process[_0x676f('0xc')][0x6]&&process['argv'][0x6]!==_0x676f('0xd')&&process[_0x676f('0xc')][0x6]!=='null'?process[_0x676f('0xc')][0x6]:null;var DUPLICATES=process[_0x676f('0xc')][0x7]&&process['argv'][0x7]!==_0x676f('0xd')&&process[_0x676f('0xc')][0x7]!==_0x676f('0xe')?process[_0x676f('0xc')][0x7]:null;if(!process[_0x676f('0xc')][0x8]||process[_0x676f('0xc')][0x8]===_0x676f('0xd')||process[_0x676f('0xc')][0x8]==='null'){throw new Error(_0x676f('0x12'));}var SOCKET_TIMESTAMP=process[_0x676f('0xc')][0x8];}catch(_0x3bb326){logger[_0x676f('0x13')](_0x3bb326);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(_0x4209d1,_0x21ee3e,_0x391f5,_0x5f268d){var _0x591830={'message':_0x21ee3e};_0x591830[_0x4209d1]=!![];if(_0x391f5){_0x591830[_0x676f('0x14')]=_0x391f5;}if(_0x5f268d){_0x591830[_0x676f('0x15')]=_0x5f268d;}return _0x591830;}function isEmail(_0x3761d2){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))*$/[_0x676f('0x16')](_0x3761d2);}function checkRow(_0x3df810,_0x316370,_0x1c6004){return new BPromise(function(_0x8637c5,_0x75abf2){if(_[_0x676f('0x17')](_0x3df810)){return _0x75abf2(handleCheckRowError(_0x676f('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1c6004));}if(_0x3df810['errors']&&_0x3df810[_0x676f('0x18')][_0x676f('0x19')]){var _0x45fc7b=_[_0x676f('0x1a')](_0x3df810[_0x676f('0x18')],'message')[_0x676f('0x1b')](';');return _0x75abf2(handleCheckRowError(_0x676f('0x13'),_0x45fc7b,null,_0x1c6004));}var _0x4f313c={};for(var _0x274401 in FIELDS){if(FIELDS[_0x676f('0x1c')](_0x274401)&&FIELDS[_0x274401]){_0x4f313c[_0x274401]=_0x3df810[_0x676f('0x1d')][0x0][FIELDS[_0x274401]]||_0x3df810['data'][0x0]['\ufeff'+FIELDS[_0x274401]];}}if(!_0x4f313c[_0x676f('0x1e')]){return _0x75abf2(handleCheckRowError(_0x676f('0x13'),_0x676f('0x1f'),null,_0x1c6004));}if(!_0x4f313c[_0x676f('0x20')]){return _0x75abf2(handleCheckRowError(_0x676f('0x13'),_0x676f('0x21'),null,_0x1c6004));}if(_0x4f313c[_0x676f('0x22')]){var _0x1be4c1=moment(_0x4f313c[_0x676f('0x22')],_0x676f('0x23'));if(!_0x1be4c1['isValid']()){return _0x75abf2(handleCheckRowError(_0x676f('0x13'),_0x676f('0x24'),null,_0x1c6004));}}if(_0x4f313c[_0x676f('0x25')]){if(!isEmail(_0x4f313c[_0x676f('0x25')])){return _0x75abf2(handleCheckRowError(_0x676f('0x13'),_0x676f('0x26'),null,_0x1c6004));}}_0x4f313c[_0x676f('0x27')]=LISTID;_0x4f313c[_0x676f('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x676f('0x19')]&&_0x316370){var _0x6b0939={};for(var _0x26941b=0x0,_0x5793dc=DUPLICATES[_0x676f('0x19')];_0x26941b<_0x5793dc;_0x26941b+=0x1){_0x6b0939[DUPLICATES[_0x26941b]]=_0x4f313c[DUPLICATES[_0x26941b]];}var _0x45ab91=_[_0x676f('0x29')](_0x316370,_0x6b0939);if(_0x45ab91){return _0x75abf2(handleCheckRowError('duplicate',_0x676f('0x2a'),_0x45ab91,_0x1c6004));}}return db[_0x676f('0x2b')][_0x676f('0x2c')](_0x4f313c,{'raw':!![],'hooks':![],'fields':_[_0x676f('0x2d')](_0x4f313c)})[_0x676f('0x2e')](function(_0x1c4f62){if(DUPLICATES&&DUPLICATES['length']&&_0x316370){_0x316370[_0x676f('0x2f')](_[_0x676f('0x30')](_0x4f313c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1c4f62['id'];return _0x8637c5();})[_0x676f('0x31')](function(_0x1d29a7){return _0x75abf2(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x1d29a7[_0x676f('0x32')]||JSON['stringify'](_0x1d29a7)),null,_0x1c6004));});});}function checkHopper(){function _0x6f9a6c(){return function(_0x1761e8){logger[_0x676f('0x13')]('cmContact',_0x676f('0x33'),util[_0x676f('0x34')](_0x1761e8,{'showHidden':![],'depth':null}));};}var _0x3712d8=function(_0x412e91,_0x3524c2){var _0x218a51=squel[_0x676f('0x35')]()[_0x676f('0x36')](_0x676f('0x37'))[_0x676f('0x38')]([_0x676f('0x20'),_0x676f('0x39'),_0x676f('0x3a'),_0x676f('0x27'),_0x3524c2,_0x676f('0x3b'),_0x676f('0x3c')],squel[_0x676f('0x3d')]()['field'](_0x676f('0x20'),_0x676f('0x20'))[_0x676f('0x3e')](_0x676f('0x3f'),_0x676f('0x39'))[_0x676f('0x3e')]('id','ContactId')[_0x676f('0x3e')](LISTID[_0x676f('0x40')](),_0x676f('0x27'))[_0x676f('0x3e')](_0x412e91['id'][_0x676f('0x40')](),_0x3524c2)[_0x676f('0x3e')]('NOW()',_0x676f('0x3b'))['field'](_0x676f('0x3f'),_0x676f('0x3c'))[_0x676f('0x41')](_0x676f('0x42'))['where'](_0x676f('0x43'))[_0x676f('0x44')](_0x676f('0x45'),LISTID['toString']())[_0x676f('0x44')](_0x676f('0x46'))[_0x676f('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x676f('0x3d')]()['field'](_0x676f('0x20'))['from'](_0x676f('0x37'))[_0x676f('0x44')](_0x3524c2+'\x20=\x20?',_0x412e91['id'][_0x676f('0x40')]())))[_0x676f('0x40')]();return _0x218a51;};var _0x2f2785=function(_0x24091c,_0x5faf62){var _0x37dfd8=squel['insert']()[_0x676f('0x36')](_0x676f('0x37'))['fromQuery']([_0x676f('0x20'),'scheduledAt',_0x676f('0x3a'),_0x676f('0x27'),_0x5faf62,_0x676f('0x3b'),_0x676f('0x3c')],squel['select']()['field'](_0x676f('0x20'),_0x676f('0x20'))['field'](_0x676f('0x3f'),_0x676f('0x39'))[_0x676f('0x3e')]('id',_0x676f('0x3a'))['field'](LISTID[_0x676f('0x40')](),_0x676f('0x27'))['field'](_0x24091c['id']['toString'](),_0x5faf62)[_0x676f('0x3e')](_0x676f('0x3f'),_0x676f('0x3b'))[_0x676f('0x3e')](_0x676f('0x3f'),_0x676f('0x3c'))[_0x676f('0x41')](_0x676f('0x42'))[_0x676f('0x44')](_0x676f('0x43'))[_0x676f('0x44')]('ListId\x20=\x20?',LISTID[_0x676f('0x40')]())[_0x676f('0x44')](_0x676f('0x47'),squel[_0x676f('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x676f('0x3d')]()['field']('calleridnum')['from'](_0x676f('0x49'))[_0x676f('0x44')](_0x5faf62+_0x676f('0x4a'),_0x24091c['id'][_0x676f('0x40')]()))['where'](_0x676f('0x4b'),squel[_0x676f('0x3d')]()[_0x676f('0x3e')](_0x676f('0x20'))[_0x676f('0x41')](_0x676f('0x37'))[_0x676f('0x44')](_0x5faf62+_0x676f('0x4a'),_0x24091c['id'][_0x676f('0x40')]())))[_0x676f('0x40')]();return _0x37dfd8;};function _0x57c411(_0x29952b,_0x254631){var _0x349448=squel[_0x676f('0x35')]()[_0x676f('0x36')](_0x676f('0x37'))[_0x676f('0x38')]([_0x676f('0x20'),_0x676f('0x39'),_0x676f('0x3a'),_0x676f('0x27'),_0x254631,'createdAt',_0x676f('0x3c')],squel['select']()['field'](_0x676f('0x20'),_0x676f('0x20'))[_0x676f('0x3e')](_0x676f('0x3f'),'scheduledAt')[_0x676f('0x3e')]('id',_0x676f('0x3a'))[_0x676f('0x3e')](LISTID[_0x676f('0x40')](),'ListId')['field'](_0x29952b['id']['toString'](),_0x254631)[_0x676f('0x3e')](_0x676f('0x3f'),_0x676f('0x3b'))[_0x676f('0x3e')]('NOW()',_0x676f('0x3c'))['from'](_0x676f('0x42'))['where'](_0x676f('0x43'))[_0x676f('0x44')](_0x676f('0x45'),LISTID[_0x676f('0x40')]())[_0x676f('0x44')](_0x676f('0x47'),squel[_0x676f('0x48')](hopperContacts))[_0x676f('0x44')](_0x676f('0x46')))[_0x676f('0x40')]();return _0x349448;}function _0x2b6fd2(_0x53f6f9,_0x685fb2){var _0x5ec554=squel[_0x676f('0x35')]()[_0x676f('0x36')](_0x676f('0x4c'))[_0x676f('0x38')]([_0x676f('0x20'),_0x676f('0x3a'),_0x676f('0x27'),_0x685fb2,_0x676f('0x3b'),_0x676f('0x3c')],squel[_0x676f('0x3d')]()[_0x676f('0x3e')](_0x676f('0x20'),'phone')[_0x676f('0x3e')]('id',_0x676f('0x3a'))[_0x676f('0x3e')](LISTID[_0x676f('0x40')](),'ListId')[_0x676f('0x3e')](_0x53f6f9['id'][_0x676f('0x40')](),_0x685fb2)[_0x676f('0x3e')](_0x676f('0x3f'),_0x676f('0x3b'))[_0x676f('0x3e')](_0x676f('0x3f'),_0x676f('0x3c'))[_0x676f('0x41')](_0x676f('0x42'))[_0x676f('0x44')](_0x676f('0x43'))[_0x676f('0x44')](_0x676f('0x45'),LISTID['toString']())[_0x676f('0x44')](_0x676f('0x47'),squel[_0x676f('0x48')](hopperContacts))[_0x676f('0x44')](_0x676f('0x46')))[_0x676f('0x40')]();return _0x5ec554;}return db[_0x676f('0x4d')][_0x676f('0x4e')]({'where':{'type':_0x676f('0x4f')},'attributes':['id',_0x676f('0x50')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x676f('0x2e')](function(_0x24eae6){var _0x443df1=[];if(_0x24eae6){var _0x103956;for(var _0x393df8=0x0,_0x460ddd;_0x393df8<_0x24eae6['length'];_0x393df8+=0x1){_0x460ddd=_0x24eae6[_0x393df8][_0x676f('0x51')]({'plain':!![]});switch(_0x460ddd[_0x676f('0x50')]){case _0x676f('0x52'):_0x443df1['push'](db['sequelize'][_0x676f('0x53')](_0x2f2785(_0x460ddd,_0x676f('0x54')))['then'](function(){})[_0x676f('0x31')](_0x6f9a6c()));break;case _0x676f('0x55'):_0x443df1[_0x676f('0x2f')](db[_0x676f('0x56')][_0x676f('0x53')](_0x3712d8(_0x460ddd,_0x676f('0x54')))[_0x676f('0x2e')](function(){})[_0x676f('0x31')](_0x6f9a6c()));break;default:_0x443df1['push'](db['sequelize'][_0x676f('0x53')](_0x57c411(_0x460ddd,'VoiceQueueId'))[_0x676f('0x2e')](function(){})[_0x676f('0x31')](_0x6f9a6c()));}}}return _0x443df1;})['all']()[_0x676f('0x2e')](function(){return db[_0x676f('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x676f('0x57')],'as':_0x676f('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x5786c8){var _0x254c06=[];if(_0x5786c8){var _0x4f2726;for(var _0x2989d8=0x0,_0x3c7a1c;_0x2989d8<_0x5786c8[_0x676f('0x19')];_0x2989d8+=0x1){_0x3c7a1c=_0x5786c8[_0x2989d8][_0x676f('0x51')]({'plain':!![]});_0x254c06['push'](db[_0x676f('0x56')][_0x676f('0x53')](_0x2b6fd2(_0x3c7a1c,_0x676f('0x54')))[_0x676f('0x2e')](function(){})[_0x676f('0x31')](_0x6f9a6c()));}}return _0x254c06;})[_0x676f('0x59')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x676f('0x5a'),'where':{'id':LISTID}}]})[_0x676f('0x2e')](function(_0x4e3850){var _0x39c085=[];if(_0x4e3850){for(var _0x2abb00=0x0,_0x8290c3;_0x2abb00<_0x4e3850[_0x676f('0x19')];_0x2abb00+=0x1){_0x8290c3=_0x4e3850[_0x2abb00]['get']({'plain':!![]});switch(_0x8290c3['dialCheckDuplicateType']){case _0x676f('0x52'):_0x39c085[_0x676f('0x2f')](db['sequelize'][_0x676f('0x53')](_0x2f2785(_0x8290c3,_0x676f('0x5b')))[_0x676f('0x2e')](function(){})[_0x676f('0x31')](_0x6f9a6c()));break;case _0x676f('0x55'):_0x39c085[_0x676f('0x2f')](db['sequelize'][_0x676f('0x53')](_0x3712d8(_0x8290c3,'CampaignId'))[_0x676f('0x2e')](function(){})[_0x676f('0x31')](_0x6f9a6c()));break;default:_0x39c085['push'](db[_0x676f('0x56')]['query'](_0x57c411(_0x8290c3,'CampaignId'))[_0x676f('0x2e')](function(){})['catch'](_0x6f9a6c()));}}}return _0x39c085;})[_0x676f('0x59')]();})[_0x676f('0x2e')](function(){return db[_0x676f('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x676f('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x11377b){var _0x2e0e39=[];if(_0x11377b){for(var _0x2604fd=0x0,_0x43c678;_0x2604fd<_0x11377b[_0x676f('0x19')];_0x2604fd+=0x1){_0x43c678=_0x11377b[_0x2604fd][_0x676f('0x51')]({'plain':!![]});_0x2e0e39[_0x676f('0x2f')](db['sequelize'][_0x676f('0x53')](_0x2b6fd2(_0x43c678,_0x676f('0x5b')))[_0x676f('0x2e')](function(){})[_0x676f('0x31')](_0x6f9a6c()));}}return _0x2e0e39;})['all']();})[_0x676f('0x31')](function(_0x2a0860){logger[_0x676f('0x13')](_0x676f('0x5d'),_0x676f('0x5e'),_0x2a0860[_0x676f('0x32')]);});}var processPromises=function(_0xf8574){return BPromise[_0x676f('0x59')](promises)[_0x676f('0x2e')](function(_0x1c5cb5){})[_0x676f('0x31')](function(_0x320f45){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x676f('0x5f')](_0x320f45));})[_0x676f('0x60')](function(){socket[_0x676f('0x61')](_0x676f('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xf8574){return _0xf8574[_0x676f('0x63')]();}});};var endCsv=function(){return BPromise[_0x676f('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x676f('0x2e')](function(){socket[_0x676f('0x61')](_0x676f('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x676f('0x65')](FILEPATH);}catch(_0x135736){logger['error'](_0x676f('0x66'),JSON[_0x676f('0x5f')](_0x135736));}finally{process[_0x676f('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x676f('0x68')](_0x676f('0x69'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x676f('0x11')](',');return db['CmContact'][_0x676f('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x676f('0x2e')](function(_0x282bec){var _0x31fb89=fs[_0x676f('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x676f('0x6b')](_0x31fb89,{'header':!![],'skipEmptyLines':!![],'step':function(_0x8009b2,_0x340a62){total+=0x1;var _0x4b4610=total;promises['push'](checkRow(_0x8009b2,_0x282bec,_0x4b4610)[_0x676f('0x2e')](function(){success+=0x1;})[_0x676f('0x31')](function(_0x3495f2){if(_0x3495f2[_0x676f('0x13')]){errors+=0x1;delete _0x3495f2['error'];}else if(_0x3495f2[_0x676f('0x6c')]){duplicates+=0x1;delete _0x3495f2['duplicate'];}rows['push'](_0x3495f2);}));if(total%0xc8===0x0){_0x340a62[_0x676f('0x6d')]();return processPromises(_0x340a62);}},'complete':function(){return processPromises()['then'](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x925e4d,_0x516270){logger[_0x676f('0x68')]('CSV\x20parse\x20error',JSON[_0x676f('0x5f')](_0x925e4d));endCsv();}});})[_0x676f('0x31')](function(_0x3cb17e){logger[_0x676f('0x13')](_0x676f('0x6e'),JSON[_0x676f('0x5f')](_0x3cb17e));});}main();
\ No newline at end of file
index bbb57e0..0d13909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x376c=['toString','cm_contacts.id','cm_contacts.createdAt','insert','cm_hopper_black','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','error','exit','errors','push','code','sequelize','query','spread','catch','message','stringify','start','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','data','hasOwnProperty','replace','scheduledat','isValid','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','rows','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','campaigns','CampaignId','affectedRows','unlink','complete','arguments\x20<filename>\x20<parameters>\x20<agents>','root','argv','file\x20doesn\x27t\x20exists','binding','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','localhost','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22'];(function(_0x1f509f,_0x161601){var _0x394a14=function(_0x332a46){while(--_0x332a46){_0x1f509f['push'](_0x1f509f['shift']());}};_0x394a14(++_0x161601);}(_0x376c,0xce));var _0xc376=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x376c[_0x2070da];return _0x4f9fe1;};'use strict';var fs=require('fs');var path=require(_0xc376('0x0'));var _=require(_0xc376('0x1'));var Papa=require('papaparse');var util=require(_0xc376('0x2'));var BPromise=require(_0xc376('0x3'));var moment=require(_0xc376('0x4'));var squel=require(_0xc376('0x5'));var Redis=require(_0xc376('0x6'));var db=require(_0xc376('0x7'))['db'];var config=require(_0xc376('0x8'));var logger=require(_0xc376('0x9'))(_0xc376('0xa'));config['redis']=_[_0xc376('0xb')](config['redis'],{'host':_0xc376('0xc'),'port':0x18eb});var socket=require(_0xc376('0xd'))(new Redis(config[_0xc376('0xe')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xc376('0xf')](_0xc376('0x10'));function isEmail(_0x1c4784){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'](_0x1c4784);}function selectNotIn(_0x40ee89,_0x5f3baa,_0x33e05f,_0x1c794e,_0x349e58){return squel[_0xc376('0x11')]()[_0xc376('0x12')]('phone')[_0xc376('0x13')](_0x1c794e)[_0xc376('0x14')](_0x5f3baa,null,_0x5f3baa+_0xc376('0x15')+_0x1c794e+'.'+_0x33e05f)[_0xc376('0x16')](_0x1c794e+'.'+_0x33e05f+_0xc376('0x17')+_0x40ee89+'.'+_0x33e05f)[_0xc376('0x16')](_0x5f3baa+_0xc376('0x18')+_0x349e58['join']()+')');}function insertCmHopper(_0x24e41a,_0xedbe0e,_0x5f1bbc,_0x1fedae,_0x17c590){var _0x5b13f9=[_0xc376('0x19'),_0xc376('0x1a'),'cm_contacts.id',_0xc376('0x1b'),_0xedbe0e+'.'+_0x1fedae,'cm_contacts.createdAt',_0xc376('0x1c'),_0xc376('0x1d'),_0xc376('0x1e'),'\x22'+_0x17c590+'\x22'];return squel['insert']()[_0xc376('0x1f')](_0xc376('0x20'))[_0xc376('0x21')]([_0xc376('0x22'),'scheduledat',_0xc376('0x23'),_0xc376('0x24'),_0x1fedae,_0xc376('0x25'),_0xc376('0x26'),_0xc376('0x27'),_0xc376('0x28'),'recallme'],squel['select']()[_0xc376('0x29')](_0x5b13f9)[_0xc376('0x13')](_0xedbe0e)['join'](_0xc376('0x2a'),null,'cm_contacts.ListId\x20=\x20'+_0xedbe0e+_0xc376('0x2b'))[_0xc376('0x14')](_0x5f1bbc,null,_0x5f1bbc+_0xc376('0x15')+_0xedbe0e+'.'+_0x1fedae)['where'](_0xedbe0e+'.CmListId\x20=\x20?',_0x24e41a)[_0xc376('0x16')](_0xc376('0x2c'),NOW)[_0xc376('0x16')](_0xc376('0x2d'),selectNotIn(_0xedbe0e,_0x5f1bbc,_0x1fedae,'cm_hopper',[_0xc376('0x2e'),_0xc376('0x2f')]))[_0xc376('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xedbe0e,_0x5f1bbc,_0x1fedae,'cm_hopper',[_0xc376('0x2e')])))[_0xc376('0x30')]();}function insertCmHopperBlack(_0x1dc80e,_0x4727b7,_0x33b6bb,_0x4b9d81){var _0x38a789=[_0xc376('0x19'),_0xc376('0x31'),'cm_contacts.ListId',_0x4727b7+'.'+_0x4b9d81,_0xc376('0x32'),'cm_contacts.updatedAt'];return squel[_0xc376('0x33')]()[_0xc376('0x1f')](_0xc376('0x34'))[_0xc376('0x21')]([_0xc376('0x22'),_0xc376('0x23'),_0xc376('0x24'),_0x4b9d81,_0xc376('0x25'),_0xc376('0x26')],squel[_0xc376('0x11')]()[_0xc376('0x29')](_0x38a789)[_0xc376('0x13')](_0x4727b7)[_0xc376('0x14')]('cm_contacts',null,_0xc376('0x35')+_0x4727b7+'.CmListId')[_0xc376('0x14')](_0x33b6bb,null,_0x33b6bb+_0xc376('0x15')+_0x4727b7+'.'+_0x4b9d81)[_0xc376('0x16')](_0x4727b7+_0xc376('0x36'),_0x1dc80e)[_0xc376('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xc376('0x16')](_0xc376('0x2d'),squel[_0xc376('0x11')]()[_0xc376('0x12')](_0xc376('0x22'))[_0xc376('0x13')](_0xc376('0x34'))['where']('ListId\x20=\x20?',_0x1dc80e)[_0xc376('0x16')](_0x4b9d81+_0xc376('0x37'),_0x4727b7+'.'+_0x4b9d81)))[_0xc376('0x30')]();}function insertCmContact(_0x5a9133,_0x119d67,_0x3f5736,_0x1f8a82){var _0x1068c5=_['concat'](_[_0xc376('0x38')](_0x1f8a82),[_0xc376('0x24'),_0xc376('0x39'),'createdAt',_0xc376('0x26')]);return squel[_0xc376('0x33')]()[_0xc376('0x1f')](_0xc376('0x2a'))[_0xc376('0x21')](_0x1068c5,squel[_0xc376('0x11')]()['fields'](_0x1068c5)['from'](_0x119d67)[_0xc376('0x16')]('('+_0x3f5736[_0xc376('0x14')](',')+_0xc376('0x3a'),squel['select']()['fields'](_0x3f5736)['from'](_0xc376('0x2a'))['where']('ListId\x20=\x20?',_0x5a9133)['where']('deletedAt\x20IS\x20NULL'))['where']('id\x20IN\x20?',squel[_0xc376('0x11')]()[_0xc376('0x12')](_0xc376('0x3b'),_0xc376('0x3c'))['from'](_0x119d67)[_0xc376('0x3d')](_0x3f5736[_0xc376('0x14')](','))))[_0xc376('0x30')]();}function handleStop(){logger[_0xc376('0x3e')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x226fab){logger[_0xc376('0x3f')](_0x226fab['message']);process[_0xc376('0x40')](0x1);}function handleError(_0x4e772e,_0x5601f3){stats[_0xc376('0x41')][_0xc376('0x42')]({'name':_0x5601f3[_0xc376('0x43')],'message':_0x5601f3['message'],'row':_0x4e772e});}function handleQuery(_0x2f0272){logger[_0xc376('0x3e')](_0x2f0272);return db[_0xc376('0x44')][_0xc376('0x45')](_0x2f0272)[_0xc376('0x46')](function(_0xa4c0d9){results[_0xc376('0x42')](_0xa4c0d9);})[_0xc376('0x47')](function(_0x3c8c7c){logger[_0xc376('0x3f')](_0x3c8c7c[_0xc376('0x48')]);});}function main(_0x16ef05,_0x11f25a,_0x57feb3,_0x4db136){logger['info']('main',_0x16ef05,JSON[_0xc376('0x49')](_0x11f25a));process['send'](_0xc376('0x4a'));var _0x53aeb7=_0x11f25a['binding'];var _0xc50d8c=_0x11f25a[_0xc376('0x4b')];var _0x6900c6=path[_0xc376('0x14')](config['root'],_0xc376('0x4c'),_0xc50d8c+_0xc376('0x4d'));var _0x2b321c=_[_0xc376('0x38')](_0x53aeb7)['join']();logger[_0xc376('0x3e')](_0xc376('0x4e'),_0x2b321c);fs[_0xc376('0x4f')](_0x6900c6,_0x2b321c+'\x0a');Papa[_0xc376('0x50')](fs[_0xc376('0x51')](_0x16ef05),{'header':!![],'skipEmptyLines':!![],'step':function(_0xec19db,_0x1579c1){try{for(var _0x4be504=0x0,_0x37a102=[];_0x4be504<_0xec19db['data'][_0xc376('0x52')];_0x4be504++){stats['rows']+=0x1;if(_0xec19db[_0xc376('0x41')][_0x4be504]){handleError(_0xec19db[_0xc376('0x53')][_0x4be504],_0xec19db[_0xc376('0x41')][_0x4be504]);}else{var _0x99228e=[];for(var _0x34858a in _0x53aeb7){if(_0x53aeb7[_0xc376('0x54')](_0x34858a)){if(_0xec19db[_0xc376('0x53')][_0x4be504][_0x53aeb7[_0x34858a]]){var _0x22912d=_['trim'](_0xec19db['data'][_0x4be504][_0x53aeb7[_0x34858a]][_0xc376('0x55')](/"/g,'\x27'));switch(_0x34858a){case _0xc376('0x56'):var _0x579443=moment(_0x22912d,_0xc376('0x10'),!![]);if(_0x579443[_0xc376('0x57')]()){_0x37a102[_0xc376('0x42')]('\x22'+_0x22912d+'\x22');}else{_0x99228e[_0xc376('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xc376('0x27'):var _0x313cf5=parseInt(_0x22912d);_0x22912d=_[_0xc376('0x58')](_0x313cf5)||_0x313cf5<0x0||_0x313cf5>0x4?_0x4db136?0x3:0x2:_0x313cf5;_0x37a102[_0xc376('0x42')]('\x22'+_0x22912d+'\x22');break;case _0xc376('0x28'):var _0x27ae2e=parseInt(_0x22912d);if(_[_0xc376('0x59')](_0x27ae2e)&&_['includes'](_0x57feb3,_0x27ae2e)){_0x37a102[_0xc376('0x42')]('\x22'+_0x27ae2e+'\x22');}else{_0x99228e[_0xc376('0x42')](_0xc376('0x5a'));}break;case _0xc376('0x5b'):if(isEmail(_0x22912d)){_0x37a102['push']('\x22'+_0x22912d+'\x22');}else{_0x99228e[_0xc376('0x42')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x21b5ba=moment(_0x22912d,'YYYY-MM-DD',!![]);if(_0x21b5ba['isValid']()){_0x37a102[_0xc376('0x42')]('\x22'+_0x22912d+'\x22');}else{_0x99228e['push'](_0xc376('0x5c'));}break;default:_0x37a102[_0xc376('0x42')]('\x22'+_0x22912d+'\x22');}}else{switch(_0x34858a){case'firstName':case _0xc376('0x22'):_0x99228e['push'](_0x34858a+_0xc376('0x5d'));break;default:_0x37a102['push']('\x22\x22');}}}}if(_0x99228e['length']){handleError(_0xec19db['data'][_0x4be504],{'code':_0xc376('0x5e'),'message':_0x99228e['join']()});}else{fs[_0xc376('0x5f')](_0x6900c6,_0x37a102[_0xc376('0x14')]()+'\x0a');}_0x37a102=[];}if(!(stats[_0xc376('0x60')]%0xc8)){socket['emit'](_0xc376('0x61')+_0xc50d8c,stats);stats[_0xc376('0x41')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x1579c1['abort']();}}catch(_0x2b3ac6){handleError(_0xec19db[_0xc376('0x53')][_0x4be504],{'code':_0xc376('0x62'),'message':_0x2b3ac6[_0xc376('0x48')]});logger[_0xc376('0x3f')](_0xc376('0x63'),_0x2b3ac6[_0xc376('0x48')]);}},'complete':function(){try{var _0x5ce0ad=[];var _0x38f592=_0xc376('0x2a');if(_0x11f25a[_0xc376('0x64')]&&_0x11f25a[_0xc376('0x64')][_0xc376('0x52')]){_0x38f592=_0xc376('0x65')+_0xc50d8c;_0x5ce0ad[_0xc376('0x42')](_0xc376('0x66')+_0x38f592+'\x20LIKE\x20cm_contacts;');}var _0x38d666=util[_0xc376('0xf')](_0xc376('0x67'),_0x6900c6,_0x38f592,_0x2b321c,_0x11f25a['ListId'],_0x11f25a['CompanyId']||null,NOW,NOW);if(_[_0xc376('0x68')](_0x53aeb7['scheduledat'])){_0x38d666+=',\x20scheduledAt\x20=\x20NOW()';}_0x5ce0ad[_0xc376('0x42')](_0x38d666);if(_0x11f25a['duplicates']&&_0x11f25a[_0xc376('0x64')]['length']){_0x5ce0ad[_0xc376('0x42')](insertCmContact(_0x11f25a[_0xc376('0x24')],_0x38f592,_0x11f25a['duplicates'],_0x53aeb7));_0x5ce0ad[_0xc376('0x42')]('DROP\x20TABLE\x20'+_0x38f592+';');}_0x5ce0ad[_0xc376('0x42')](insertCmHopper(_0x11f25a['ListId'],'voice_queues_has_cm_lists',_0xc376('0x69'),_0xc376('0x6a'),_0x4db136));_0x5ce0ad[_0xc376('0x42')](insertCmHopperBlack(_0x11f25a['ListId'],_0xc376('0x6b'),_0xc376('0x69'),_0xc376('0x6a')));_0x5ce0ad['push'](insertCmHopper(_0x11f25a['ListId'],_0xc376('0x6c'),'campaigns','CampaignId',_0x4db136));_0x5ce0ad[_0xc376('0x42')](insertCmHopperBlack(_0x11f25a[_0xc376('0x24')],_0xc376('0x6d'),_0xc376('0x6e'),_0xc376('0x6f')));BPromise['each'](_0x5ce0ad,handleQuery)['then'](function(_0x3634f3){stats['finish']=!![];stats[_0xc376('0x70')]=_0x11f25a[_0xc376('0x64')]&&_0x11f25a[_0xc376('0x64')][_0xc376('0x52')]?results[0x2][_0xc376('0x70')]:results[0x0][_0xc376('0x70')];socket['emit'](_0xc376('0x61')+_0xc50d8c,stats);fs[_0xc376('0x71')](_0x16ef05);fs[_0xc376('0x71')](_0x6900c6);process[_0xc376('0x40')](0x0);})[_0xc376('0x47')](function(_0x2872d3){logger[_0xc376('0x3f')](_0x2872d3[_0xc376('0x48')]);process['exit'](0x1);});}catch(_0x4b516a){logger['error'](_0xc376('0x72'),_0x4b516a[_0xc376('0x48')]);process[_0xc376('0x40')](0x1);}},'error':function(_0x24b735,_0x14fff3,_0x7d4824,_0x4180af){throw new Error(_0x4180af);}});}function validate(){if(process['argv']&&process['argv'][_0xc376('0x52')]<0x4){throw new Error(_0xc376('0x73'));}var _0xf5a48e=path['join'](config[_0xc376('0x74')],_0xc376('0x4c'),process[_0xc376('0x75')][0x2]);if(!fs['existsSync'](_0xf5a48e)){throw new Error(_0xc376('0x76'));}var _0x16f86d={};try{_0x16f86d=JSON[_0xc376('0x50')](process['argv'][0x3]);if(!_0x16f86d[_0xc376('0x77')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x16f86d[_0xc376('0x77')][_0xc376('0x22')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x16f86d[_0xc376('0x77')][_0xc376('0x78')]){throw new Error('firstName\x20is\x20mandatory');}var _0x55fa52=0x0;if(_0x16f86d['binding'][_0xc376('0x28')]){_0x55fa52=0x1;}if(!_0x16f86d['ListId']){throw new Error(_0xc376('0x79'));}}catch(_0x2e2e84){throw new Error(_0xc376('0x7a'));}var _0x1d8fa0=[];try{_0x1d8fa0=_[_0xc376('0x7b')](JSON[_0xc376('0x50')](process[_0xc376('0x75')][0x4]),'id');}catch(_0x320f9d){logger['info'](_0xc376('0x7c'));}main(_0xf5a48e,_0x16f86d,_0x1d8fa0,_0x55fa52);}validate();process['on'](_0xc376('0x7d'),handleStop);process['on'](_0xc376('0x7e'),handleUncaughtException);
\ No newline at end of file
+var _0xaa4c=['papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_contacts.updatedAt','phone','cm_hopper_black','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','field','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','stringify','send','start','binding','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','\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','VoiceQueueId','voice_queues','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','emit','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash'];(function(_0x179bea,_0x24fe04){var _0x20be22=function(_0x1c54ab){while(--_0x1c54ab){_0x179bea['push'](_0x179bea['shift']());}};_0x20be22(++_0x24fe04);}(_0xaa4c,0x190));var _0xcaa4=function(_0x3c5874,_0x376b8d){_0x3c5874=_0x3c5874-0x0;var _0x276b26=_0xaa4c[_0x3c5874];return _0x276b26;};'use strict';var fs=require('fs');var path=require(_0xcaa4('0x0'));var _=require(_0xcaa4('0x1'));var Papa=require(_0xcaa4('0x2'));var util=require('util');var BPromise=require(_0xcaa4('0x3'));var moment=require('moment');var squel=require(_0xcaa4('0x4'));var Redis=require(_0xcaa4('0x5'));var db=require(_0xcaa4('0x6'))['db'];var config=require(_0xcaa4('0x7'));var logger=require(_0xcaa4('0x8'))(_0xcaa4('0x9'));config[_0xcaa4('0xa')]=_[_0xcaa4('0xb')](config[_0xcaa4('0xa')],{'host':_0xcaa4('0xc'),'port':0x18eb});var socket=require(_0xcaa4('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xcaa4('0xe')](_0xcaa4('0xf'));function isEmail(_0x3b4a27){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))*$/[_0xcaa4('0x10')](_0x3b4a27);}function selectNotIn(_0x1354f4,_0x115fa2,_0x2d7ed2,_0x2b6211,_0xddb01){return squel[_0xcaa4('0x11')]()['field']('phone')[_0xcaa4('0x12')](_0x2b6211)[_0xcaa4('0x13')](_0x115fa2,null,_0x115fa2+_0xcaa4('0x14')+_0x2b6211+'.'+_0x2d7ed2)[_0xcaa4('0x15')](_0x2b6211+'.'+_0x2d7ed2+_0xcaa4('0x16')+_0x1354f4+'.'+_0x2d7ed2)[_0xcaa4('0x15')](_0x115fa2+_0xcaa4('0x17')+_0xddb01[_0xcaa4('0x13')]()+')');}function insertCmHopper(_0x428084,_0x3395f5,_0x1d3dac,_0x3b70a6,_0x3cb372){var _0x47150f=[_0xcaa4('0x18'),_0xcaa4('0x19'),'cm_contacts.id',_0xcaa4('0x1a'),_0x3395f5+'.'+_0x3b70a6,_0xcaa4('0x1b'),'cm_contacts.updatedAt',_0xcaa4('0x1c'),_0xcaa4('0x1d'),'\x22'+_0x3cb372+'\x22'];return squel[_0xcaa4('0x1e')]()[_0xcaa4('0x1f')](_0xcaa4('0x20'))[_0xcaa4('0x21')](['phone',_0xcaa4('0x22'),_0xcaa4('0x23'),_0xcaa4('0x24'),_0x3b70a6,_0xcaa4('0x25'),_0xcaa4('0x26'),_0xcaa4('0x27'),_0xcaa4('0x28'),_0xcaa4('0x29')],squel[_0xcaa4('0x11')]()[_0xcaa4('0x2a')](_0x47150f)[_0xcaa4('0x12')](_0x3395f5)['join'](_0xcaa4('0x2b'),null,_0xcaa4('0x2c')+_0x3395f5+_0xcaa4('0x2d'))[_0xcaa4('0x13')](_0x1d3dac,null,_0x1d3dac+_0xcaa4('0x14')+_0x3395f5+'.'+_0x3b70a6)[_0xcaa4('0x15')](_0x3395f5+_0xcaa4('0x2e'),_0x428084)[_0xcaa4('0x15')](_0xcaa4('0x2f'),NOW)[_0xcaa4('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3395f5,_0x1d3dac,_0x3b70a6,_0xcaa4('0x20'),[_0xcaa4('0x30'),_0xcaa4('0x31')]))['where'](_0xcaa4('0x32'),selectNotIn(_0x3395f5,_0x1d3dac,_0x3b70a6,_0xcaa4('0x20'),[_0xcaa4('0x30')])))[_0xcaa4('0x33')]();}function insertCmHopperBlack(_0xda247,_0x30422e,_0x4e600d,_0x1b98c9){var _0x41906e=[_0xcaa4('0x18'),_0xcaa4('0x34'),'cm_contacts.ListId',_0x30422e+'.'+_0x1b98c9,'cm_contacts.createdAt',_0xcaa4('0x35')];return squel['insert']()['into']('cm_hopper_black')[_0xcaa4('0x21')]([_0xcaa4('0x36'),'ContactId',_0xcaa4('0x24'),_0x1b98c9,'createdAt',_0xcaa4('0x26')],squel[_0xcaa4('0x11')]()['fields'](_0x41906e)['from'](_0x30422e)[_0xcaa4('0x13')]('cm_contacts',null,_0xcaa4('0x2c')+_0x30422e+_0xcaa4('0x2d'))['join'](_0x4e600d,null,_0x4e600d+'.id\x20=\x20'+_0x30422e+'.'+_0x1b98c9)[_0xcaa4('0x15')](_0x30422e+'.CmListId\x20=\x20?',_0xda247)[_0xcaa4('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcaa4('0x15')](_0xcaa4('0x32'),squel[_0xcaa4('0x11')]()['field']('phone')[_0xcaa4('0x12')](_0xcaa4('0x37'))[_0xcaa4('0x15')](_0xcaa4('0x38'),_0xda247)['where'](_0x1b98c9+'\x20=\x20?',_0x30422e+'.'+_0x1b98c9)))[_0xcaa4('0x33')]();}function insertCmContact(_0x1000da,_0x336e06,_0x410fea,_0x388372){var _0x2420e3=_[_0xcaa4('0x39')](_[_0xcaa4('0x3a')](_0x388372),[_0xcaa4('0x24'),_0xcaa4('0x3b'),_0xcaa4('0x25'),_0xcaa4('0x26')]);return squel[_0xcaa4('0x1e')]()[_0xcaa4('0x1f')](_0xcaa4('0x2b'))['fromQuery'](_0x2420e3,squel[_0xcaa4('0x11')]()[_0xcaa4('0x2a')](_0x2420e3)[_0xcaa4('0x12')](_0x336e06)['where']('('+_0x410fea[_0xcaa4('0x13')](',')+_0xcaa4('0x3c'),squel[_0xcaa4('0x11')]()[_0xcaa4('0x2a')](_0x410fea)[_0xcaa4('0x12')](_0xcaa4('0x2b'))[_0xcaa4('0x15')](_0xcaa4('0x38'),_0x1000da)[_0xcaa4('0x15')](_0xcaa4('0x3d')))['where'](_0xcaa4('0x3e'),squel[_0xcaa4('0x11')]()[_0xcaa4('0x3f')](_0xcaa4('0x40'),_0xcaa4('0x41'))[_0xcaa4('0x12')](_0x336e06)[_0xcaa4('0x42')](_0x410fea[_0xcaa4('0x13')](','))))[_0xcaa4('0x33')]();}function handleStop(){logger[_0xcaa4('0x43')](_0xcaa4('0x44'));stopped=!![];}function handleUncaughtException(_0x101abb){logger[_0xcaa4('0x45')](_0x101abb[_0xcaa4('0x46')]);process[_0xcaa4('0x47')](0x1);}function handleError(_0x122dd5,_0xc0d7c6){stats[_0xcaa4('0x48')][_0xcaa4('0x49')]({'name':_0xc0d7c6[_0xcaa4('0x4a')],'message':_0xc0d7c6[_0xcaa4('0x46')],'row':_0x122dd5});}function handleQuery(_0x369dc4){logger['info'](_0x369dc4);return db[_0xcaa4('0x4b')][_0xcaa4('0x4c')](_0x369dc4)[_0xcaa4('0x4d')](function(_0x7cd67a){results[_0xcaa4('0x49')](_0x7cd67a);})[_0xcaa4('0x4e')](function(_0x14ead2){logger[_0xcaa4('0x45')](_0x14ead2[_0xcaa4('0x46')]);});}function main(_0x4de390,_0x4662f9,_0x384dce,_0x1c4e35){logger[_0xcaa4('0x43')]('main',_0x4de390,JSON[_0xcaa4('0x4f')](_0x4662f9));process[_0xcaa4('0x50')](_0xcaa4('0x51'));var _0x171552=_0x4662f9[_0xcaa4('0x52')];var _0xc2f381=_0x4662f9['socket_timestamp'];var _0x23ef7b=path[_0xcaa4('0x13')](config[_0xcaa4('0x53')],_0xcaa4('0x54'),_0xc2f381+_0xcaa4('0x55'));var _0x4875f6=_['keys'](_0x171552)[_0xcaa4('0x13')]();logger[_0xcaa4('0x43')](_0xcaa4('0x56'),_0x4875f6);fs[_0xcaa4('0x57')](_0x23ef7b,_0x4875f6+'\x0a');Papa[_0xcaa4('0x58')](fs[_0xcaa4('0x59')](_0x4de390),{'header':!![],'skipEmptyLines':!![],'step':function(_0x32fdd7,_0x24335f){try{for(var _0x4d2037=0x0,_0x59cba6=[];_0x4d2037<_0x32fdd7[_0xcaa4('0x5a')][_0xcaa4('0x5b')];_0x4d2037++){stats[_0xcaa4('0x5c')]+=0x1;if(_0x32fdd7['errors'][_0x4d2037]){handleError(_0x32fdd7[_0xcaa4('0x5a')][_0x4d2037],_0x32fdd7[_0xcaa4('0x48')][_0x4d2037]);}else{var _0x106ee1=[];for(var _0x4e63d5 in _0x171552){if(_0x171552[_0xcaa4('0x5d')](_0x4e63d5)){if(_0x32fdd7[_0xcaa4('0x5a')][_0x4d2037][_0x171552[_0x4e63d5]]){var _0x499ffc=_['trim'](_0x32fdd7['data'][_0x4d2037][_0x171552[_0x4e63d5]]['replace'](/"/g,'\x27'));switch(_0x4e63d5){case _0xcaa4('0x22'):var _0x34adf5=moment(_0x499ffc,_0xcaa4('0xf'),!![]);if(_0x34adf5[_0xcaa4('0x5e')]()){_0x59cba6[_0xcaa4('0x49')]('\x22'+_0x499ffc+'\x22');}else{_0x106ee1[_0xcaa4('0x49')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xcaa4('0x27'):var _0x27a047=parseInt(_0x499ffc);_0x499ffc=_[_0xcaa4('0x5f')](_0x27a047)||_0x27a047<0x0||_0x27a047>0x4?_0x1c4e35?0x3:0x2:_0x27a047;_0x59cba6[_0xcaa4('0x49')]('\x22'+_0x499ffc+'\x22');break;case _0xcaa4('0x28'):var _0x1d1215=parseInt(_0x499ffc);if(_[_0xcaa4('0x60')](_0x1d1215)&&_['includes'](_0x384dce,_0x1d1215)){_0x59cba6[_0xcaa4('0x49')]('\x22'+_0x1d1215+'\x22');}else{_0x106ee1[_0xcaa4('0x49')](_0xcaa4('0x61'));}break;case _0xcaa4('0x62'):if(isEmail(_0x499ffc)){_0x59cba6[_0xcaa4('0x49')]('\x22'+_0x499ffc+'\x22');}else{_0x106ee1[_0xcaa4('0x49')](_0xcaa4('0x63'));}break;case _0xcaa4('0x64'):var _0xe5e65c=moment(_0x499ffc,'YYYY-MM-DD',!![]);if(_0xe5e65c[_0xcaa4('0x5e')]()){_0x59cba6['push']('\x22'+_0x499ffc+'\x22');}else{_0x106ee1[_0xcaa4('0x49')](_0xcaa4('0x65'));}break;default:_0x59cba6[_0xcaa4('0x49')]('\x22'+_0x499ffc+'\x22');}}else{switch(_0x4e63d5){case _0xcaa4('0x66'):case'phone':_0x106ee1['push'](_0x4e63d5+'\x20not\x20specified');break;default:_0x59cba6[_0xcaa4('0x49')]('\x22\x22');}}}}if(_0x106ee1['length']){handleError(_0x32fdd7[_0xcaa4('0x5a')][_0x4d2037],{'code':'SystemRow','message':_0x106ee1[_0xcaa4('0x13')]()});}else{fs['appendFileSync'](_0x23ef7b,_0x59cba6[_0xcaa4('0x13')]()+'\x0a');}_0x59cba6=[];}if(!(stats[_0xcaa4('0x5c')]%0xc8)){socket['emit'](_0xcaa4('0x67')+_0xc2f381,stats);stats['errors']=[];}}if(stopped){logger[_0xcaa4('0x43')](_0xcaa4('0x68'));_0x24335f[_0xcaa4('0x69')]();}}catch(_0x6039f6){handleError(_0x32fdd7[_0xcaa4('0x5a')][_0x4d2037],{'code':_0xcaa4('0x6a'),'message':_0x6039f6['message']});logger[_0xcaa4('0x45')]('step',_0x6039f6[_0xcaa4('0x46')]);}},'complete':function(){try{var _0x113adc=[];var _0x592074='cm_contacts';if(_0x4662f9[_0xcaa4('0x6b')]&&_0x4662f9[_0xcaa4('0x6b')]['length']){_0x592074=_0xcaa4('0x6c')+_0xc2f381;_0x113adc[_0xcaa4('0x49')]('CREATE\x20TABLE\x20'+_0x592074+_0xcaa4('0x6d'));}var _0x169641=util[_0xcaa4('0xe')](_0xcaa4('0x6e'),_0x23ef7b,_0x592074,_0x4875f6,_0x4662f9[_0xcaa4('0x24')],_0x4662f9[_0xcaa4('0x3b')]||null,NOW,NOW);if(_[_0xcaa4('0x6f')](_0x171552[_0xcaa4('0x22')])){_0x169641+=_0xcaa4('0x70');}_0x113adc[_0xcaa4('0x49')](_0x169641);if(_0x4662f9[_0xcaa4('0x6b')]&&_0x4662f9['duplicates']['length']){_0x113adc['push'](insertCmContact(_0x4662f9['ListId'],_0x592074,_0x4662f9[_0xcaa4('0x6b')],_0x171552));_0x113adc['push'](_0xcaa4('0x71')+_0x592074+';');}_0x113adc['push'](insertCmHopper(_0x4662f9[_0xcaa4('0x24')],_0xcaa4('0x72'),'voice_queues',_0xcaa4('0x73'),_0x1c4e35));_0x113adc[_0xcaa4('0x49')](insertCmHopperBlack(_0x4662f9[_0xcaa4('0x24')],'voice_queues_has_cm_blacklists',_0xcaa4('0x74'),_0xcaa4('0x73')));_0x113adc[_0xcaa4('0x49')](insertCmHopper(_0x4662f9[_0xcaa4('0x24')],'campaigns_has_cm_lists',_0xcaa4('0x75'),_0xcaa4('0x76'),_0x1c4e35));_0x113adc[_0xcaa4('0x49')](insertCmHopperBlack(_0x4662f9[_0xcaa4('0x24')],_0xcaa4('0x77'),_0xcaa4('0x75'),_0xcaa4('0x76')));BPromise['each'](_0x113adc,handleQuery)[_0xcaa4('0x78')](function(_0x2ab5a8){stats[_0xcaa4('0x79')]=!![];stats[_0xcaa4('0x7a')]=_0x4662f9[_0xcaa4('0x6b')]&&_0x4662f9[_0xcaa4('0x6b')][_0xcaa4('0x5b')]?results[0x2][_0xcaa4('0x7a')]:results[0x0]['affectedRows'];socket[_0xcaa4('0x7b')](_0xcaa4('0x67')+_0xc2f381,stats);fs['unlink'](_0x4de390);fs[_0xcaa4('0x7c')](_0x23ef7b);process['exit'](0x0);})[_0xcaa4('0x4e')](function(_0x173298){logger['error'](_0x173298['message']);process[_0xcaa4('0x47')](0x1);});}catch(_0x1504a){logger[_0xcaa4('0x45')](_0xcaa4('0x7d'),_0x1504a['message']);process[_0xcaa4('0x47')](0x1);}},'error':function(_0x3268ca,_0x4587b7,_0x1345e5,_0x1a9995){throw new Error(_0x1a9995);}});}function validate(){if(process[_0xcaa4('0x7e')]&&process[_0xcaa4('0x7e')][_0xcaa4('0x5b')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x30a96b=path[_0xcaa4('0x13')](config[_0xcaa4('0x53')],'server/files/tmp',process[_0xcaa4('0x7e')][0x2]);if(!fs[_0xcaa4('0x7f')](_0x30a96b)){throw new Error(_0xcaa4('0x80'));}var _0x215fee={};try{_0x215fee=JSON[_0xcaa4('0x58')](process[_0xcaa4('0x7e')][0x3]);if(!_0x215fee[_0xcaa4('0x52')]){throw new Error(_0xcaa4('0x81'));}if(!_0x215fee[_0xcaa4('0x52')]['phone']){throw new Error(_0xcaa4('0x82'));}if(!_0x215fee[_0xcaa4('0x52')][_0xcaa4('0x66')]){throw new Error('firstName\x20is\x20mandatory');}var _0x1a129b=0x0;if(_0x215fee[_0xcaa4('0x52')][_0xcaa4('0x28')]){_0x1a129b=0x1;}if(!_0x215fee[_0xcaa4('0x24')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2bbf62){throw new Error(_0xcaa4('0x83'));}var _0x30346b=[];try{_0x30346b=_['map'](JSON[_0xcaa4('0x58')](process[_0xcaa4('0x7e')][0x4]),'id');}catch(_0x3e3b0b){logger[_0xcaa4('0x43')](_0xcaa4('0x84'));}main(_0x30a96b,_0x215fee,_0x30346b,_0x1a129b);}validate();process['on']('SIGINT',handleStop);process['on'](_0xcaa4('0x85'),handleUncaughtException);
\ No newline at end of file
index ccfd3da..3643738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f72=['voice','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','Agent\x20Ring','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Member\x20Name','membername','UniqueId','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]'];(function(_0x14b248,_0x4472a4){var _0x426cab=function(_0x41f221){while(--_0x41f221){_0x14b248['push'](_0x14b248['shift']());}};_0x426cab(++_0x4472a4);}(_0x9f72,0x1cc));var _0x29f7=function(_0x46ef1e,_0x57d69b){_0x46ef1e=_0x46ef1e-0x0;var _0x34d2cf=_0x9f72[_0x46ef1e];return _0x34d2cf;};'use strict';exports[_0x29f7('0x0')]=function(_0x3d0836,_0x284d7b){var _0x4ea383=[{'type':'string','content':_0x29f7('0x1'),'variableName':null}];switch(_0x3d0836['toLowerCase']()){case _0x29f7('0x2'):switch(_0x284d7b[_0x29f7('0x3')]()){case _0x29f7('0x4'):_0x4ea383[_0x29f7('0x5')]({'type':_0x29f7('0x6'),'content':'','variableName':_0x29f7('0x7')});_0x4ea383[_0x29f7('0x5')]({'type':'variable','content':'','variableName':_0x29f7('0x8')});break;case _0x29f7('0x9'):_0x4ea383[_0x29f7('0x5')]({'type':_0x29f7('0xa'),'content':_0x29f7('0xb'),'variableName':null});_0x4ea383[_0x29f7('0x5')]({'type':_0x29f7('0x6'),'content':'','variableName':_0x29f7('0xc')});break;}}return _0x4ea383;};exports[_0x29f7('0xd')]=function(_0x4dc14b,_0x4ce598){var _0x2c9c76=[];switch(_0x4dc14b[_0x29f7('0x3')]()){case'voice':switch(_0x4ce598[_0x29f7('0x3')]()){case _0x29f7('0x4'):_0x2c9c76=[{'type':'string','content':_0x29f7('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x10'),'keyType':_0x29f7('0x6'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x29f7('0x6'),'variableName':_0x29f7('0x11')},{'type':_0x29f7('0xf'),'content':'','key':'Call\x20To','keyType':_0x29f7('0x6'),'variableName':_0x29f7('0x12')},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x13'),'keyType':'variable','variableName':'queue'},{'type':'keyValue','content':'','key':'UniqueId','keyType':'variable','variableName':_0x29f7('0x14')},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x15'),'keyType':'variable','variableName':_0x29f7('0x16')},{'type':_0x29f7('0xa'),'content':_0x29f7('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x29f7('0xf'),'content':'','key':'Agent\x20Name','keyType':_0x29f7('0x6'),'variableName':_0x29f7('0x18')},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x19'),'keyType':_0x29f7('0x6'),'variableName':'destcalleridnum'},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x29f7('0x1a'),'keyType':_0x29f7('0x6'),'variableName':'agentcalledAt'},{'type':_0x29f7('0xf'),'content':'','key':'Agent\x20Connect','keyType':_0x29f7('0x6'),'variableName':'agentconnectAt'},{'type':_0x29f7('0xf'),'content':'','key':'Agent\x20Complete','keyType':_0x29f7('0x6'),'variableName':_0x29f7('0x1b')},{'type':'keyValue','content':'','key':_0x29f7('0x1c'),'keyType':'variable','variableName':_0x29f7('0x1d')},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x1e'),'keyType':_0x29f7('0x6'),'variableName':'talktime'}];break;case _0x29f7('0x9'):_0x2c9c76=[{'type':'string','content':_0x29f7('0xe'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0x29f7('0xc')},{'type':'keyValue','content':'','key':_0x29f7('0x1f'),'keyType':_0x29f7('0x6'),'keyContent':'','variableName':_0x29f7('0x20')},{'type':'keyValue','content':'','key':_0x29f7('0x21'),'keyType':'variable','keyContent':'','variableName':_0x29f7('0x14')},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x15'),'keyType':_0x29f7('0x6'),'keyContent':'','variableName':_0x29f7('0x22')},{'type':_0x29f7('0xa'),'content':_0x29f7('0x23')},{'type':'keyValue','content':'','key':_0x29f7('0x24'),'keyType':_0x29f7('0x6'),'keyContent':'','variableName':_0x29f7('0x25')},{'type':_0x29f7('0xf'),'content':'','key':'Complete\x20Time','keyType':_0x29f7('0x6'),'keyContent':'','variableName':_0x29f7('0x26')},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x27'),'keyType':_0x29f7('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x29f7('0xf'),'content':'','key':_0x29f7('0x28'),'keyType':_0x29f7('0x6'),'keyContent':'','variableName':_0x29f7('0x29')}];break;}}return _0x2c9c76;};
\ No newline at end of file
+var _0x1e8d=['duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','calleridnum','outbound','Outbound\x20Call','variable','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentcompleteAt','holdtime','Talk\x20Time','talktime','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration'];(function(_0x2766ea,_0x3c8c1c){var _0x3ab718=function(_0x42e898){while(--_0x42e898){_0x2766ea['push'](_0x2766ea['shift']());}};_0x3ab718(++_0x3c8c1c);}(_0x1e8d,0xd4));var _0xd1e8=function(_0xe12c75,_0x12be11){_0xe12c75=_0xe12c75-0x0;var _0x1cdad5=_0x1e8d[_0xe12c75];return _0x1cdad5;};'use strict';exports['getSubjects']=function(_0x3cd45c,_0x1c7cf6){var _0x5abf95=[{'type':_0xd1e8('0x0'),'content':_0xd1e8('0x1'),'variableName':null}];switch(_0x3cd45c[_0xd1e8('0x2')]()){case _0xd1e8('0x3'):switch(_0x1c7cf6[_0xd1e8('0x2')]()){case'inbound':_0x5abf95[_0xd1e8('0x4')]({'type':'variable','content':'','variableName':_0xd1e8('0x5')});_0x5abf95[_0xd1e8('0x4')]({'type':'variable','content':'','variableName':_0xd1e8('0x6')});break;case _0xd1e8('0x7'):_0x5abf95[_0xd1e8('0x4')]({'type':_0xd1e8('0x0'),'content':_0xd1e8('0x8'),'variableName':null});_0x5abf95[_0xd1e8('0x4')]({'type':_0xd1e8('0x9'),'content':'','variableName':_0xd1e8('0xa')});break;}}return _0x5abf95;};exports[_0xd1e8('0xb')]=function(_0x4002e1,_0x3e7023){var _0x43b2eb=[];switch(_0x4002e1[_0xd1e8('0x2')]()){case _0xd1e8('0x3'):switch(_0x3e7023[_0xd1e8('0x2')]()){case _0xd1e8('0xc'):_0x43b2eb=[{'type':_0xd1e8('0x0'),'content':_0xd1e8('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0xf'),'keyType':'variable','variableName':_0xd1e8('0x6')},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x10'),'keyType':'variable','variableName':_0xd1e8('0x11')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0xd1e8('0x9'),'variableName':_0xd1e8('0x12')},{'type':_0xd1e8('0xe'),'content':'','key':'Queue','keyType':_0xd1e8('0x9'),'variableName':_0xd1e8('0x5')},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x13'),'keyType':_0xd1e8('0x9'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xd1e8('0x14'),'keyType':_0xd1e8('0x9'),'variableName':'agentcalledAt'},{'type':_0xd1e8('0x0'),'content':_0xd1e8('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x16'),'keyType':_0xd1e8('0x9'),'variableName':_0xd1e8('0x17')},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x18'),'keyType':_0xd1e8('0x9'),'variableName':'destcalleridnum'},{'type':_0xd1e8('0x0'),'content':_0xd1e8('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x1a'),'keyType':_0xd1e8('0x9'),'variableName':_0xd1e8('0x1b')},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x1c'),'keyType':_0xd1e8('0x9'),'variableName':'agentconnectAt'},{'type':_0xd1e8('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0xd1e8('0x9'),'variableName':_0xd1e8('0x1d')},{'type':_0xd1e8('0xe'),'content':'','key':'Hold\x20Time','keyType':_0xd1e8('0x9'),'variableName':_0xd1e8('0x1e')},{'type':'keyValue','content':'','key':_0xd1e8('0x1f'),'keyType':_0xd1e8('0x9'),'variableName':_0xd1e8('0x20')}];break;case _0xd1e8('0x7'):_0x43b2eb=[{'type':'string','content':_0xd1e8('0xd'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xd1e8('0x9'),'keyContent':'','variableName':_0xd1e8('0xa')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xd1e8('0x9'),'keyContent':'','variableName':_0xd1e8('0x21')},{'type':'keyValue','content':'','key':_0xd1e8('0x13'),'keyType':_0xd1e8('0x9'),'keyContent':'','variableName':'uniqueid'},{'type':_0xd1e8('0xe'),'content':'','key':'Date','keyType':_0xd1e8('0x9'),'keyContent':'','variableName':_0xd1e8('0x22')},{'type':_0xd1e8('0x0'),'content':_0xd1e8('0x19')},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x23'),'keyType':_0xd1e8('0x9'),'keyContent':'','variableName':_0xd1e8('0x24')},{'type':'keyValue','content':'','key':_0xd1e8('0x25'),'keyType':_0xd1e8('0x9'),'keyContent':'','variableName':_0xd1e8('0x26')},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x27'),'keyType':'variable','keyContent':'','variableName':_0xd1e8('0x28')},{'type':_0xd1e8('0xe'),'content':'','key':_0xd1e8('0x29'),'keyType':_0xd1e8('0x9'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x43b2eb;};
\ No newline at end of file
index 742893d..1ada6de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8251=['clone','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','upperFirst','Interaction','findOne','update','then','info','error','tracked','user','query'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8251,0x145));var _0x1825=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8251[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1825('0x0'));var db=require(_0x1825('0x1'))['db'];var loggers={'openchannel':require(_0x1825('0x2'))('openchannel-interactions'),'mail':require(_0x1825('0x2'))(_0x1825('0x3')),'fax':require('../../config/logger')(_0x1825('0x4')),'sms':require('../../config/logger')(_0x1825('0x5')),'chat':require(_0x1825('0x2'))(_0x1825('0x6')),'whatsapp':require(_0x1825('0x2'))('whatsapp-interactions')};function getInteractionId(_0x10d52e,_0x1551a2,_0x436059){if(_0x10d52e&&_0x10d52e[_['upperFirst'](_0x436059)+_0x1825('0x7')]){return _0x10d52e[_['upperFirst'](_0x436059)+'InteractionId'];}else if(_0x10d52e&&_0x10d52e['id']){return _0x10d52e['id'];}else if(_0x1551a2&&_0x1551a2['id']){return _0x1551a2['id'];}else{return'unknown';}}function log(_0x2dce82,_0x42e484,_0x578c65,_0x13cb09,_0x2e1242,_0xbbd905){loggers[_0x2e1242[_0x1825('0x8')]()][_0x2dce82](_0x1825('0x9'),_0xbbd905[_0x1825('0xa')](),_0x42e484?_0x42e484['id']:null,_0x42e484?_0x42e484[_0x1825('0xb')]:null,_0x42e484?_0x42e484[_0x1825('0xc')]:null,getInteractionId(_0x578c65,_0x13cb09,_0x2e1242),_0x578c65?JSON['stringify'](_0x578c65):'null');}function updateUser(_0x3ac5c3,_0x15a6ff,_0x58cbaf,_0x375675,_0x184e01){db[_[_0x1825('0xd')](_0x375675)+_0x1825('0xe')][_0x1825('0xf')]({'where':{'id':getInteractionId(_0x15a6ff,_0x58cbaf,_0x375675)}})['then'](function(_0x2be93d){if(_0x2be93d){return _0x2be93d[_0x1825('0x10')]({'UserId':_0x3ac5c3?_0x3ac5c3['id']:null});}})[_0x1825('0x11')](function(_0xbd8928){if(_0xbd8928){log(_0x1825('0x12'),_0x3ac5c3,_0x15a6ff,_0x58cbaf,_0x375675,_0x184e01);}})['catch'](function(){log(_0x1825('0x13'),_0x3ac5c3,_0x15a6ff,_0x58cbaf,_0x375675,_0x184e01);});}exports[_0x1825('0x14')]=function(_0x2146e9,_0x42b461){return function(_0x5e879e,_0x4c09b2,_0x561b6b){var _0x1a3c0e=_0x5e879e[_0x1825('0x15')];var _0x2077e5={};var _0x588c43=_0x5e879e[_0x1825('0x16')];if(_0x2077e5){_0x2077e5=_[_0x1825('0x17')](_0x5e879e['body']);_0x2077e5=_['omit'](_0x2077e5,[_0x1825('0x18'),_0x1825('0x19'),_0x1825('0x1a'),_0x1825('0x1b'),_0x1825('0x1c')]);}updateUser(_0x1a3c0e,_0x2077e5,_0x588c43,_0x2146e9,_0x42b461);_0x561b6b(null);};};
\ No newline at end of file
+var _0xeebb=['html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','role','stringify','null','Interaction','findOne','update','then','info','error','tracked','body'];(function(_0x2ef275,_0x1bb3ad){var _0x419938=function(_0x342ac9){while(--_0x342ac9){_0x2ef275['push'](_0x2ef275['shift']());}};_0x419938(++_0x1bb3ad);}(_0xeebb,0xa6));var _0xbeeb=function(_0x54922a,_0x1bf26c){_0x54922a=_0x54922a-0x0;var _0x5632ea=_0xeebb[_0x54922a];return _0x5632ea;};'use strict';var _=require(_0xbeeb('0x0'));var db=require(_0xbeeb('0x1'))['db'];var loggers={'openchannel':require(_0xbeeb('0x2'))(_0xbeeb('0x3')),'mail':require(_0xbeeb('0x2'))(_0xbeeb('0x4')),'fax':require(_0xbeeb('0x2'))('fax-interactions'),'sms':require(_0xbeeb('0x2'))(_0xbeeb('0x5')),'chat':require('../../config/logger')(_0xbeeb('0x6')),'whatsapp':require(_0xbeeb('0x2'))(_0xbeeb('0x7'))};function getInteractionId(_0x1d7bec,_0x467567,_0x5d2a2b){if(_0x1d7bec&&_0x1d7bec[_[_0xbeeb('0x8')](_0x5d2a2b)+_0xbeeb('0x9')]){return _0x1d7bec[_[_0xbeeb('0x8')](_0x5d2a2b)+_0xbeeb('0x9')];}else if(_0x1d7bec&&_0x1d7bec['id']){return _0x1d7bec['id'];}else if(_0x467567&&_0x467567['id']){return _0x467567['id'];}else{return _0xbeeb('0xa');}}function log(_0x3305e0,_0x2ad5e9,_0x4b7e83,_0x1646e3,_0x5ef6a1,_0x503c4b){loggers[_0x5ef6a1[_0xbeeb('0xb')]()][_0x3305e0]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x503c4b['toUpperCase'](),_0x2ad5e9?_0x2ad5e9['id']:null,_0x2ad5e9?_0x2ad5e9['name']:null,_0x2ad5e9?_0x2ad5e9[_0xbeeb('0xc')]:null,getInteractionId(_0x4b7e83,_0x1646e3,_0x5ef6a1),_0x4b7e83?JSON[_0xbeeb('0xd')](_0x4b7e83):_0xbeeb('0xe'));}function updateUser(_0x1eba5a,_0x290a9d,_0x3e6e11,_0xbc61ae,_0x5a48de){db[_[_0xbeeb('0x8')](_0xbc61ae)+_0xbeeb('0xf')][_0xbeeb('0x10')]({'where':{'id':getInteractionId(_0x290a9d,_0x3e6e11,_0xbc61ae)}})['then'](function(_0x14d3c5){if(_0x14d3c5){return _0x14d3c5[_0xbeeb('0x11')]({'UserId':_0x1eba5a?_0x1eba5a['id']:null});}})[_0xbeeb('0x12')](function(_0xd2cac5){if(_0xd2cac5){log(_0xbeeb('0x13'),_0x1eba5a,_0x290a9d,_0x3e6e11,_0xbc61ae,_0x5a48de);}})['catch'](function(){log(_0xbeeb('0x14'),_0x1eba5a,_0x290a9d,_0x3e6e11,_0xbc61ae,_0x5a48de);});}exports[_0xbeeb('0x15')]=function(_0x4a80bd,_0x61f56a){return function(_0x5168f4,_0x28cf3a,_0x13c243){var _0x2a75a=_0x5168f4['user'];var _0x2e2415={};var _0x4102c4=_0x5168f4['query'];if(_0x2e2415){_0x2e2415=_['clone'](_0x5168f4[_0xbeeb('0x16')]);_0x2e2415=_['omit'](_0x2e2415,[_0xbeeb('0x16'),_0xbeeb('0x17'),_0xbeeb('0x18'),_0xbeeb('0x19'),_0xbeeb('0x1a')]);}updateUser(_0x2a75a,_0x2e2415,_0x4102c4,_0x4a80bd,_0x61f56a);_0x13c243(null);};};
\ No newline at end of file
index 15ea4ab..1b9d45a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f29=['%s:%s:%s','final','utf8','parse','hasOwnProperty','use','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher'];(function(_0x301427,_0x2949f1){var _0x8c7d9f=function(_0x5a11b6){while(--_0x5a11b6){_0x301427['push'](_0x301427['shift']());}};_0x8c7d9f(++_0x2949f1);}(_0x9f29,0x1c1));var _0x99f2=function(_0x5043cd,_0x1ab9d8){_0x5043cd=_0x5043cd-0x0;var _0x193b45=_0x9f29[_0x5043cd];return _0x193b45;};'use strict';var crypto=require(_0x99f2('0x0'));var util=require('util');var compose=require(_0x99f2('0x1'));var db=require(_0x99f2('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x484f9a,_0x41528b){if(_0x484f9a&&_0x41528b){if(_0x41528b[_0x99f2('0x3')]&&_0x41528b['license']){var _0xe8d56f=_0x41528b[_0x99f2('0x3')];var _0x562493=_0x41528b[_0x99f2('0x4')];var _0x2f4b9c=_0xe8d56f[_0x99f2('0x5')]('-')[0x4];var _0x1a9f7f=_0xe8d56f[_0x99f2('0x5')]('-')[0x0];var _0x56341c=crypto[_0x99f2('0x6')]('aes-256-ctr',util['format'](_0x99f2('0x7'),_0x2f4b9c,_0xe8d56f,_0x1a9f7f));var _0x266e17=_0x56341c['update'](_0x562493,'base64','utf8');_0x266e17+=_0x56341c[_0x99f2('0x8')](_0x99f2('0x9'));var _0x4ea3e7=JSON[_0x99f2('0xa')](_0x266e17);return _0x4ea3e7[_0x99f2('0xb')](_0x484f9a)?_0x4ea3e7[_0x484f9a]:null;}}return null;}function isLimit(_0x45cf98,_0x236ce9,_0xbe1b83,_0x32be8c){var _0x1e2dcd=_0x236ce9;return compose()[_0x99f2('0xc')](function(_0xaf4a5b,_0x17191d,_0xe06ce8){return db['License'][_0x99f2('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5d29b2){var _0x2dca4c=getValueFromLicense(_0x45cf98,_0x5d29b2);return _0x2dca4c?_0x2dca4c:_0x1e2dcd;})['then'](function(_0x26a7c8){_0x1e2dcd=_0x26a7c8;return _0xbe1b83[_0x99f2('0xe')](_0x32be8c);})[_0x99f2('0xf')](function(_0xc0a58c){if(_0xc0a58c>=_0x1e2dcd){return _0x17191d[_0x99f2('0x10')](0x193)[_0x99f2('0x11')]({'message':util['format'](_0x99f2('0x12'),_0x45cf98)});}_0xe06ce8();})[_0x99f2('0x13')](function(_0x2ab779){_0xe06ce8(_0x2ab779);});});}function isUserLimit(){return isLimit(_0x99f2('0x14'),0x1,db['User'],{'where':{'$or':[{'role':_0x99f2('0x15')},{'role':_0x99f2('0x16')}]}});}exports[_0x99f2('0x17')]=isUserLimit;
\ No newline at end of file
+var _0x8825=['utf8','final','parse','hasOwnProperty','License','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64'];(function(_0xe3d4a2,_0x5dbf95){var _0x131efb=function(_0x90cd0){while(--_0x90cd0){_0xe3d4a2['push'](_0xe3d4a2['shift']());}};_0x131efb(++_0x5dbf95);}(_0x8825,0x70));var _0x5882=function(_0x2cb9c9,_0xf4aff1){_0x2cb9c9=_0x2cb9c9-0x0;var _0xe229df=_0x8825[_0x2cb9c9];return _0xe229df;};'use strict';var crypto=require(_0x5882('0x0'));var util=require(_0x5882('0x1'));var compose=require(_0x5882('0x2'));var db=require(_0x5882('0x3'))['db'];var config=require(_0x5882('0x4'));function getValueFromLicense(_0x45c505,_0x10382f){if(_0x45c505&&_0x10382f){if(_0x10382f[_0x5882('0x5')]&&_0x10382f[_0x5882('0x6')]){var _0x57c11f=_0x10382f[_0x5882('0x5')];var _0x20d0c9=_0x10382f[_0x5882('0x6')];var _0x2d58ab=_0x57c11f[_0x5882('0x7')]('-')[0x4];var _0x58f86b=_0x57c11f['split']('-')[0x0];var _0x2c0665=crypto[_0x5882('0x8')](_0x5882('0x9'),util[_0x5882('0xa')]('%s:%s:%s',_0x2d58ab,_0x57c11f,_0x58f86b));var _0x2a69fc=_0x2c0665[_0x5882('0xb')](_0x20d0c9,_0x5882('0xc'),_0x5882('0xd'));_0x2a69fc+=_0x2c0665[_0x5882('0xe')]('utf8');var _0x7599c4=JSON[_0x5882('0xf')](_0x2a69fc);return _0x7599c4[_0x5882('0x10')](_0x45c505)?_0x7599c4[_0x45c505]:null;}}return null;}function isLimit(_0x1100c8,_0xba41ef,_0x197e37,_0x2854c0){var _0x11d368=_0xba41ef;return compose()['use'](function(_0x513ea2,_0x47ca05,_0x46013a){return db[_0x5882('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x5882('0x12')](function(_0x4698a8){var _0x1d26d6=getValueFromLicense(_0x1100c8,_0x4698a8);return _0x1d26d6?_0x1d26d6:_0x11d368;})['then'](function(_0xea86de){_0x11d368=_0xea86de;return _0x197e37[_0x5882('0x13')](_0x2854c0);})['then'](function(_0x49b8f3){if(_0x49b8f3>=_0x11d368){return _0x47ca05['status'](0x193)['json']({'message':util[_0x5882('0xa')](_0x5882('0x14'),_0x1100c8)});}_0x46013a();})['catch'](function(_0x28343e){_0x46013a(_0x28343e);});});}function isUserLimit(){return isLimit(_0x5882('0x15'),0x1,db[_0x5882('0x16')],{'where':{'$or':[{'role':_0x5882('0x17')},{'role':'user'}]}});}exports[_0x5882('0x18')]=isUserLimit;
\ No newline at end of file
index 588370a..3b96f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd20e=['$lt','<\x20?','$gt','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?'];(function(_0x1a5c3e,_0x1de2d0){var _0x13c93f=function(_0x240ca5){while(--_0x240ca5){_0x1a5c3e['push'](_0x1a5c3e['shift']());}};_0x13c93f(++_0x1de2d0);}(_0xd20e,0x1e0));var _0xed20=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xd20e[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var moment=require(_0xed20('0x0'));exports[_0xed20('0x1')]=function(_0x1394ff){var _0x370a4b={'conditions':[]};_0x370a4b[_0xed20('0x2')]=_[_0xed20('0x3')](_0x1394ff,_0xed20('0x4'))?'or':_0xed20('0x5');var _0x4b4b4e=_0x1394ff[_0xed20('0x6')](_0xed20('0x7'),'')[_0xed20('0x6')](_0xed20('0x4'),'')[_0xed20('0x8')]('||');for(var _0x1b30c9=0x0;_0x1b30c9<_0x4b4b4e['length'];_0x1b30c9++){var _0x19a080=_0x4b4b4e[_0x1b30c9][_0xed20('0x8')](':=');var _0x5634ec=_0x19a080[0x0];var _0x5be010=_0x19a080[_0xed20('0x9')](0x1);_0x5be010[_0xed20('0xa')](function(_0x486c26){var _0x3c276b=_0x486c26[_0xed20('0x8')]('[')['shift']();var _0x357eda=_0x486c26[_0xed20('0xb')](/\[(.*?)\]/g);_0x357eda[_0xed20('0xa')](function(_0x52ce84){var _0x4b1d3c=_0x52ce84[_0xed20('0x8')]('[')['filter'](function(_0x238428){return _0x238428[_0xed20('0xc')](']')>-0x1;})[_0xed20('0xd')](function(_0x49bd2c){return _0x49bd2c[_0xed20('0x8')](']')[0x0];})[0x0];_0x370a4b[_0xed20('0xe')][_0xed20('0xf')]({'field':_0x5634ec,'operator':_0x3c276b,'value':_0x4b1d3c});});});}return _0x370a4b;};exports[_0xed20('0x10')]=function(_0x3fa06f,_0x50a4bc,_0x3ef50a){var _0x2b4d38={};if(_0x50a4bc===_0xed20('0x11')){if(_0x3ef50a[_0xed20('0x12')]===_0xed20('0x13')){_0x3ef50a[_0xed20('0x12')]=_0xed20('0x14');_0x3ef50a[_0xed20('0x15')]+=','+_0x3ef50a[_0xed20('0x15')];}else if(_[_0xed20('0x16')](['$gt',_0xed20('0x17')],_0x3ef50a[_0xed20('0x12')])){_0x3ef50a[_0xed20('0x15')]=moment(_0x3ef50a[_0xed20('0x15')])['add'](0x1,_0xed20('0x18'))[_0xed20('0x19')](_0xed20('0x1a'));}}if(_0x3ef50a[_0xed20('0x1b')]){_0x50a4bc=_0x3ef50a[_0xed20('0x1b')];_0x2b4d38[_0xed20('0x1c')]=_0xed20('0x1d')+_0x3fa06f+'.'+_0x3ef50a[_0xed20('0x1e')]+_0xed20('0x1f')+_0x3ef50a[_0xed20('0x1b')]+')\x20'+parseOperator(_0x3ef50a[_0xed20('0x12')]);}else{_0x2b4d38['text']=_0x3fa06f+'.'+_0x3ef50a['field']+'\x20'+parseOperator(_0x3ef50a[_0xed20('0x12')]);}if(_['includes'](['$ne','$notIn'],_0x3ef50a[_0xed20('0x12')]))_0x2b4d38[_0xed20('0x1c')]='('+_0x2b4d38[_0xed20('0x1c')]+'\x20OR\x20'+_0x3fa06f+'.'+_0x3ef50a['field']+_0xed20('0x20');_0x2b4d38[_0xed20('0x15')]=parseValue(_0x50a4bc,_0x3ef50a[_0xed20('0x12')],_0x3ef50a[_0xed20('0x15')]);return _0x2b4d38;};function parseOperator(_0x53b2dd){var _0x49c995;switch(_0x53b2dd){case _0xed20('0x21'):_0x49c995=_0xed20('0x22');break;case'$notIn':_0x49c995='NOT\x20IN\x20?';break;case _0xed20('0x13'):_0x49c995=_0xed20('0x23');break;case'$ne':_0x49c995='<>\x20?';break;case _0xed20('0x24'):case _0xed20('0x25'):case _0xed20('0x26'):_0x49c995=_0xed20('0x27');break;case _0xed20('0x28'):_0x49c995=_0xed20('0x29');break;case _0xed20('0x2a'):_0x49c995='>\x20?';break;case _0xed20('0x17'):_0x49c995='<=\x20?';break;case'$gte':_0x49c995=_0xed20('0x2b');break;case _0xed20('0x14'):_0x49c995=_0xed20('0x2c');break;}return _0x49c995;}function parseValue(_0x8492fd,_0x1e27d0,_0x1d1277){var _0x4e1456={'start':undefined,'end':undefined};switch(_0x1e27d0){case'$in':case'$notIn':_0x4e1456[_0xed20('0x2d')]=_0x1d1277[_0xed20('0x8')](',');break;case _0xed20('0x24'):_0x4e1456[_0xed20('0x2d')]='%'+_0x1d1277+'%';break;case _0xed20('0x25'):_0x4e1456[_0xed20('0x2d')]=_0x1d1277+'%';break;case'$endsWith':_0x4e1456[_0xed20('0x2d')]='%'+_0x1d1277;break;case _0xed20('0x14'):var _0x31f540=_0x1d1277[_0xed20('0x8')](',');var _0x1d1277=_0x31f540['shift']();var _0x31422d=_0x31f540[_0xed20('0x2e')]();if(_0x8492fd===_0xed20('0x11')){_0x1d1277=moment(_0x1d1277)[_0xed20('0x2f')](0x0,!![])['format']();_0x31422d=moment(_0x31422d)[_0xed20('0x2f')](0x0,!![])[_0xed20('0x30')](0x17,_0xed20('0x31'))[_0xed20('0x30')](0x3b,_0xed20('0x32'))[_0xed20('0x30')](0x3b,_0xed20('0x33'))[_0xed20('0x19')]();}_0x4e1456={'start':_0x1d1277,'end':_0x31422d};break;default:_0x4e1456[_0xed20('0x2d')]=_0x1d1277;break;}return _0x4e1456;}
\ No newline at end of file
+var _0xfbfb=['value','includes','$gt','operator','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$lte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','hours','minutes','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xfbfb,0x12c));var _0xbfbf=function(_0x5256c3,_0x3a6b1e){_0x5256c3=_0x5256c3-0x0;var _0x45e180=_0xfbfb[_0x5256c3];return _0x45e180;};'use strict';var _=require('lodash');var moment=require(_0xbfbf('0x0'));exports['parseSearch']=function(_0x28cc76){var _0x502bcb={'conditions':[]};_0x502bcb[_0xbfbf('0x1')]=_[_0xbfbf('0x2')](_0x28cc76,_0xbfbf('0x3'))?'or':_0xbfbf('0x4');var _0x41f603=_0x28cc76[_0xbfbf('0x5')](_0xbfbf('0x6'),'')['replace']('[$or]','')[_0xbfbf('0x7')]('||');for(var _0x3f379f=0x0;_0x3f379f<_0x41f603[_0xbfbf('0x8')];_0x3f379f++){var _0x43a751=_0x41f603[_0x3f379f]['split'](':=');var _0x230217=_0x43a751[0x0];var _0x4b5c24=_0x43a751[_0xbfbf('0x9')](0x1);_0x4b5c24[_0xbfbf('0xa')](function(_0x511b69){var _0x466f8d=_0x511b69['split']('[')[_0xbfbf('0xb')]();var _0x3e359a=_0x511b69[_0xbfbf('0xc')](/\[(.*?)\]/g);_0x3e359a[_0xbfbf('0xa')](function(_0x50b152){var _0x351294=_0x50b152[_0xbfbf('0x7')]('[')[_0xbfbf('0xd')](function(_0x284c00){return _0x284c00[_0xbfbf('0xe')](']')>-0x1;})[_0xbfbf('0xf')](function(_0x37570d){return _0x37570d[_0xbfbf('0x7')](']')[0x0];})[0x0];_0x502bcb[_0xbfbf('0x10')][_0xbfbf('0x11')]({'field':_0x230217,'operator':_0x466f8d,'value':_0x351294});});});}return _0x502bcb;};exports['buildExpression']=function(_0x1243be,_0x1cb5e4,_0x32b680){var _0xcc1c9a={};if(_0x1cb5e4==='DATE'){if(_0x32b680['operator']==='$eq'){_0x32b680['operator']='$between';_0x32b680[_0xbfbf('0x12')]+=','+_0x32b680[_0xbfbf('0x12')];}else if(_[_0xbfbf('0x13')]([_0xbfbf('0x14'),'$lte'],_0x32b680[_0xbfbf('0x15')])){_0x32b680['value']=moment(_0x32b680['value'])['add'](0x1,_0xbfbf('0x16'))[_0xbfbf('0x17')](_0xbfbf('0x18'));}}if(_0x32b680['castTo']){_0x1cb5e4=_0x32b680[_0xbfbf('0x19')];_0xcc1c9a[_0xbfbf('0x1a')]=_0xbfbf('0x1b')+_0x1243be+'.'+_0x32b680['field']+_0xbfbf('0x1c')+_0x32b680[_0xbfbf('0x19')]+')\x20'+parseOperator(_0x32b680['operator']);}else{_0xcc1c9a[_0xbfbf('0x1a')]=_0x1243be+'.'+_0x32b680[_0xbfbf('0x1d')]+'\x20'+parseOperator(_0x32b680['operator']);}if(_[_0xbfbf('0x13')]([_0xbfbf('0x1e'),_0xbfbf('0x1f')],_0x32b680['operator']))_0xcc1c9a[_0xbfbf('0x1a')]='('+_0xcc1c9a['text']+_0xbfbf('0x20')+_0x1243be+'.'+_0x32b680['field']+_0xbfbf('0x21');_0xcc1c9a[_0xbfbf('0x12')]=parseValue(_0x1cb5e4,_0x32b680['operator'],_0x32b680[_0xbfbf('0x12')]);return _0xcc1c9a;};function parseOperator(_0x2ec123){var _0x41f112;switch(_0x2ec123){case _0xbfbf('0x22'):_0x41f112=_0xbfbf('0x23');break;case'$notIn':_0x41f112='NOT\x20IN\x20?';break;case'$eq':_0x41f112=_0xbfbf('0x24');break;case _0xbfbf('0x1e'):_0x41f112=_0xbfbf('0x25');break;case'$substring':case _0xbfbf('0x26'):case _0xbfbf('0x27'):_0x41f112=_0xbfbf('0x28');break;case _0xbfbf('0x29'):_0x41f112='<\x20?';break;case _0xbfbf('0x14'):_0x41f112=_0xbfbf('0x2a');break;case _0xbfbf('0x2b'):_0x41f112='<=\x20?';break;case'$gte':_0x41f112=_0xbfbf('0x2c');break;case _0xbfbf('0x2d'):_0x41f112=_0xbfbf('0x2e');break;}return _0x41f112;}function parseValue(_0x3b817f,_0x175cad,_0x3b7125){var _0x85829b={'start':undefined,'end':undefined};switch(_0x175cad){case _0xbfbf('0x22'):case _0xbfbf('0x1f'):_0x85829b[_0xbfbf('0x2f')]=_0x3b7125[_0xbfbf('0x7')](',');break;case'$substring':_0x85829b[_0xbfbf('0x2f')]='%'+_0x3b7125+'%';break;case _0xbfbf('0x26'):_0x85829b[_0xbfbf('0x2f')]=_0x3b7125+'%';break;case _0xbfbf('0x27'):_0x85829b['start']='%'+_0x3b7125;break;case'$between':var _0x439f80=_0x3b7125[_0xbfbf('0x7')](',');var _0x3b7125=_0x439f80[_0xbfbf('0xb')]();var _0x2b6a8c=_0x439f80[_0xbfbf('0x30')]();if(_0x3b817f==='DATE'){_0x3b7125=moment(_0x3b7125)[_0xbfbf('0x31')](0x0,!![])['format']();_0x2b6a8c=moment(_0x2b6a8c)[_0xbfbf('0x31')](0x0,!![])[_0xbfbf('0x32')](0x17,_0xbfbf('0x33'))[_0xbfbf('0x32')](0x3b,_0xbfbf('0x34'))[_0xbfbf('0x32')](0x3b,'seconds')['format']();}_0x85829b={'start':_0x3b7125,'end':_0x2b6a8c};break;default:_0x85829b[_0xbfbf('0x2f')]=_0x3b7125;break;}return _0x85829b;}
\ No newline at end of file
index ffc4ec0..3bdb551 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4178=['name','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','split','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','uniqueid','isArray','limit','offset','sort','map','priority','cast','col','substr','DESC','unsigned','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','includes','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','order','where','filters','pick','filter','object'];(function(_0x874a49,_0x5b07bc){var _0x343d2f=function(_0x351928){while(--_0x351928){_0x874a49['push'](_0x874a49['shift']());}};_0x343d2f(++_0x5b07bc);}(_0x4178,0x184));var _0x8417=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4178[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8417('0x0'));var sequelize=require(_0x8417('0x1'));var moment=require(_0x8417('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4d6c7b){var _0x3171ac=['ne'];try{var _0x2b38d7=JSON[_0x8417('0x3')](_0x4d6c7b);var _0xf176b2=Object[_0x8417('0x4')](_0x2b38d7)[0x0];return _0x3171ac['includes'](_0xf176b2);}catch(_0x1ee04d){return![];}}function getOperatorValue(_0x15f41a){var _0x65b870=JSON[_0x8417('0x3')](_0x15f41a);var _0x26e823=Object['keys'](_0x65b870)[0x0];var _0x34ee88=_0x65b870[_0x26e823];return{['$'+_0x26e823]:_0x34ee88};}exports['fields']=function(_0x598459){var _0x2f8dcf=null;if(_0x598459){_0x2f8dcf=_0x598459[_0x8417('0x5')](',');}return _0x2f8dcf;};exports['filters']=function(_0x2dce0a,_0x57a644){var _0x16739b={};if(!_[_0x8417('0x6')](_0x2dce0a)){_[_0x8417('0x7')](_0x2dce0a,function(_0x2d2d,_0x3b56e7){try{if(_0x57a644){var _0x436d17=_['find'](_0x57a644,{'name':_0x3b56e7})||{};if(hasSequelizeOperator(_0x2d2d)){_0x16739b[_0x3b56e7]=getOperatorValue(_0x2d2d);}else if(_0x436d17[_0x8417('0x8')]===_0x8417('0x9')&&_[_0x8417('0xa')](_0x2d2d)){var _0x4538a0=JSON[_0x8417('0x3')](_0x2d2d);var _0x2f8b05={'$gte':moment(moment(_0x4538a0[_0x8417('0xb')])[_0x8417('0xc')]('YYYY-MM-DD'))[_0x8417('0xd')]()[_0x8417('0xc')](),'$lte':moment(moment(_0x4538a0[_0x8417('0xe')])[_0x8417('0xc')](_0x8417('0xf')))[_0x8417('0xd')]()[_0x8417('0x10')](0x1,'s')[_0x8417('0xc')]()};_0x16739b[_0x3b56e7]=_0x2f8b05;}else if(_0x436d17['name']===_0x8417('0x11')){_0x16739b[_0x3b56e7]=_0x2d2d;}else{_0x16739b[_0x3b56e7]=_[_0x8417('0x12')](_0x2d2d)?_0x2d2d:JSON[_0x8417('0x3')](_0x2d2d);}}else{_0x16739b[_0x3b56e7]=_['isArray'](_0x2d2d)?_0x2d2d:JSON[_0x8417('0x3')](_0x2d2d);}}catch(_0xad13e8){_0x16739b[_0x3b56e7]=_0x2d2d['split'](',');}});}return _0x16739b;};exports[_0x8417('0x13')]=function(_0x126331){_0x126331=parseInt(_0x126331,0xa);if(!_0x126331||_0x126331<0x0){_0x126331=LIMIT_VALUE;}return _0x126331;};exports[_0x8417('0x14')]=function(_0x5261a1){_0x5261a1=parseInt(_0x5261a1,0xa);if(!_0x5261a1||_0x5261a1<0x0){_0x5261a1=0x0;}return _0x5261a1;};exports[_0x8417('0x15')]=function(_0x280e69){var _0x2f5bf4,_0x3b2101=null;if(_0x280e69){_0x2f5bf4=_0x280e69[_0x8417('0x5')](',');_0x3b2101=_[_0x8417('0x16')](_0x2f5bf4,function(_0x37ad0e){if(_0x37ad0e['indexOf']('-')===0x0){return[_0x37ad0e===_0x8417('0x17')?sequelize[_0x8417('0x18')](sequelize[_0x8417('0x19')](_0x8417('0x17')),'unsigned'):_0x37ad0e[_0x8417('0x1a')](0x1),_0x8417('0x1b')];}else{return[_0x37ad0e===_0x8417('0x17')?sequelize[_0x8417('0x18')](sequelize[_0x8417('0x19')](_0x8417('0x17')),_0x8417('0x1c')):_0x37ad0e,_0x8417('0x1d')];}});}return _0x3b2101;};exports['omit']=function(_0x564f56,_0x48f665){if(_[_0x8417('0x6')](_0x564f56)){return _0x564f56;}if(_[_0x8417('0x12')](_0x564f56)){for(var _0x2a3961=0x0;_0x2a3961<_0x564f56[_0x8417('0x1e')];_0x2a3961+=0x1){_0x564f56[_0x2a3961]=this[_0x8417('0x1f')](_0x564f56[_0x2a3961],_0x48f665);}return _0x564f56;}if(!_[_0x8417('0x20')](_0x564f56)){return _0x564f56;}if(_[_0x8417('0x21')](_0x48f665)){_0x48f665=[_0x48f665];}if(!_[_0x8417('0x12')](_0x48f665)){return _0x564f56;}for(var _0x9c9431=0x0;_0x9c9431<_0x48f665['length'];_0x9c9431+=0x1){_[_0x8417('0x22')](_0x564f56,_0x48f665[_0x9c9431]);}for(var _0x2e0977 in _0x564f56){if(_0x564f56[_0x8417('0x23')](_0x2e0977)){_0x564f56[_0x2e0977]=this['omit'](_0x564f56[_0x2e0977],_0x48f665);}}return _0x564f56;};exports[_0x8417('0x24')]=function(_0x53f667){return _0x53f667[_0x8417('0x25')](RegExp(_0x8417('0x26')))?!![]:![];};exports[_0x8417('0x27')]=function(_0xea7a34){return _0xea7a34[_0x8417('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x8417('0x28')]=function(_0x41536c){var _0x3663d0=[];_0x41536c['split'](/[ ,]+/)[_0x8417('0x29')](function(_0x22275c){_0x22275c=_0x22275c[_0x8417('0x2a')](/([^:]")"+/g,'$1');_0x22275c='+'+_0x22275c+'*';if(_0x22275c[_0x8417('0x2b')]('@'))_0x22275c='\x22'+_0x22275c+'\x22';_0x3663d0[_0x8417('0x2c')](_0x22275c);});return _0x3663d0[_0x8417('0x2d')]('\x20');};exports[_0x8417('0x2e')]=function(_0x11d3a7,_0x50fb07,_0x291a2c){var _0x2d4d32={},_0x59dddd={};if(_0x50fb07[_0x8417('0x2f')][_0x8417('0x30')]){_0x50fb07[_0x8417('0x2f')]['id']=_0x50fb07[_0x8417('0x2f')]['$id'];delete _0x50fb07[_0x8417('0x2f')]['$id'];}_0x2d4d32[_0x8417('0x31')]=_[_0x8417('0x16')](_0x11d3a7,'name');_0x2d4d32[_0x8417('0x2f')]=_[_0x8417('0x4')](_0x50fb07[_0x8417('0x2f')]);_0x2d4d32['filters']=_[_0x8417('0x32')](_0x2d4d32['model'],_0x2d4d32[_0x8417('0x2f')]);_0x59dddd[_0x8417('0x33')]=_[_0x8417('0x32')](_0x2d4d32['model'],this[_0x8417('0x34')](_0x50fb07[_0x8417('0x2f')][_0x8417('0x34')]));_0x59dddd[_0x8417('0x33')]=_0x59dddd['attributes'][_0x8417('0x1e')]?_0x59dddd[_0x8417('0x33')]:_0x2d4d32[_0x8417('0x31')];if(!_0x50fb07['query'][_0x8417('0x23')](_0x8417('0x35'))){_0x59dddd[_0x8417('0x13')]=this[_0x8417('0x13')](_0x50fb07[_0x8417('0x2f')]['limit']);_0x59dddd['offset']=this[_0x8417('0x14')](_0x50fb07[_0x8417('0x2f')][_0x8417('0x14')]);}_0x59dddd[_0x8417('0x36')]=this['sort'](_0x50fb07[_0x8417('0x2f')][_0x8417('0x15')]);_0x59dddd[_0x8417('0x37')]=this[_0x8417('0x38')](_[_0x8417('0x39')](_0x50fb07[_0x8417('0x2f')],_0x2d4d32[_0x8417('0x38')]),_0x11d3a7);if(_0x50fb07[_0x8417('0x2f')][_0x8417('0x3a')]){var _0x1b29db=_0x11d3a7;var _0x3cf7b3=_0x50fb07[_0x8417('0x2f')]['filter'];if(typeof _0x3cf7b3===_0x8417('0x3b')){_0x1b29db=_['filter'](_0x11d3a7,function(_0x5edfd3){return _['includes'](_0x3cf7b3['columns'],_0x5edfd3[_0x8417('0x3c')]);});_0x3cf7b3=_0x3cf7b3['value'];}_0x59dddd[_0x8417('0x37')]=_[_0x8417('0x3d')](_0x59dddd[_0x8417('0x37')],{'$or':_[_0x8417('0x16')](_0x1b29db,function(_0x3cc054){if(_0x3cc054['type']!==_0x8417('0x3e')){if(_0x291a2c){return sequelize[_0x8417('0x37')](sequelize['fn']('lower',sequelize['col'](_0x3cc054[_0x8417('0x3c')])),{'$like':sequelize['fn'](_0x8417('0x3f'),'%'+_0x50fb07[_0x8417('0x2f')][_0x8417('0x3a')]+'%')});}else{var _0x33b093={};_0x33b093[_0x3cc054[_0x8417('0x3c')]]={'$like':'%'+_0x50fb07[_0x8417('0x2f')]['filter']+'%'};return _0x33b093;}}})});}_0x59dddd=_[_0x8417('0x3d')]({},_0x59dddd,_0x50fb07['options']);return _0x59dddd;};
\ No newline at end of file
+var _0x5bea=['isArray','limit','offset','sort','map','priority','cast','col','unsigned','DESC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','getFullTextValue','forEach','join','getOptions','query','$id','model','attributes','nolimit','order','where','pick','filter','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid'];(function(_0x5e2bc3,_0x9b0200){var _0x5bfb6c=function(_0x192813){while(--_0x192813){_0x5e2bc3['push'](_0x5e2bc3['shift']());}};_0x5bfb6c(++_0x9b0200);}(_0x5bea,0x13d));var _0xa5be=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5bea[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xa5be('0x0'));var sequelize=require(_0xa5be('0x1'));var moment=require(_0xa5be('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x20bd04){var _0x480e10=['ne'];try{var _0x2432ab=JSON[_0xa5be('0x3')](_0x20bd04);var _0x8cdb4a=Object[_0xa5be('0x4')](_0x2432ab)[0x0];return _0x480e10[_0xa5be('0x5')](_0x8cdb4a);}catch(_0x1cd27e){return![];}}function getOperatorValue(_0x13a5dc){var _0x450de9=JSON[_0xa5be('0x3')](_0x13a5dc);var _0x231095=Object[_0xa5be('0x4')](_0x450de9)[0x0];var _0x5ddc29=_0x450de9[_0x231095];return{['$'+_0x231095]:_0x5ddc29};}exports[_0xa5be('0x6')]=function(_0x233fe1){var _0x507e8a=null;if(_0x233fe1){_0x507e8a=_0x233fe1[_0xa5be('0x7')](',');}return _0x507e8a;};exports[_0xa5be('0x8')]=function(_0x4dfe0d,_0x3cd0fc){var _0x58b053={};if(!_['isEmpty'](_0x4dfe0d)){_['forOwn'](_0x4dfe0d,function(_0x1b0179,_0x4b735b){try{if(_0x3cd0fc){var _0x54b234=_['find'](_0x3cd0fc,{'name':_0x4b735b})||{};if(hasSequelizeOperator(_0x1b0179)){_0x58b053[_0x4b735b]=getOperatorValue(_0x1b0179);}else if(_0x54b234[_0xa5be('0x9')]===_0xa5be('0xa')&&_[_0xa5be('0xb')](_0x1b0179)){var _0x412d24=JSON[_0xa5be('0x3')](_0x1b0179);var _0x1022e1={'$gte':moment(moment(_0x412d24[_0xa5be('0xc')])[_0xa5be('0xd')](_0xa5be('0xe')))[_0xa5be('0xf')]()[_0xa5be('0xd')](),'$lte':moment(moment(_0x412d24[_0xa5be('0x10')])[_0xa5be('0xd')](_0xa5be('0xe')))[_0xa5be('0xf')]()['subtract'](0x1,'s')[_0xa5be('0xd')]()};_0x58b053[_0x4b735b]=_0x1022e1;}else if(_0x54b234[_0xa5be('0x11')]===_0xa5be('0x12')){_0x58b053[_0x4b735b]=_0x1b0179;}else{_0x58b053[_0x4b735b]=_[_0xa5be('0x13')](_0x1b0179)?_0x1b0179:JSON[_0xa5be('0x3')](_0x1b0179);}}else{_0x58b053[_0x4b735b]=_[_0xa5be('0x13')](_0x1b0179)?_0x1b0179:JSON[_0xa5be('0x3')](_0x1b0179);}}catch(_0xe6b948){_0x58b053[_0x4b735b]=_0x1b0179[_0xa5be('0x7')](',');}});}return _0x58b053;};exports[_0xa5be('0x14')]=function(_0x5e2045){_0x5e2045=parseInt(_0x5e2045,0xa);if(!_0x5e2045||_0x5e2045<0x0){_0x5e2045=LIMIT_VALUE;}return _0x5e2045;};exports[_0xa5be('0x15')]=function(_0x174003){_0x174003=parseInt(_0x174003,0xa);if(!_0x174003||_0x174003<0x0){_0x174003=0x0;}return _0x174003;};exports[_0xa5be('0x16')]=function(_0xa4785d){var _0x5f20d8,_0x333ee9=null;if(_0xa4785d){_0x5f20d8=_0xa4785d[_0xa5be('0x7')](',');_0x333ee9=_[_0xa5be('0x17')](_0x5f20d8,function(_0x2cb058){if(_0x2cb058['indexOf']('-')===0x0){return[_0x2cb058===_0xa5be('0x18')?sequelize[_0xa5be('0x19')](sequelize[_0xa5be('0x1a')](_0xa5be('0x18')),_0xa5be('0x1b')):_0x2cb058['substr'](0x1),_0xa5be('0x1c')];}else{return[_0x2cb058==='priority'?sequelize[_0xa5be('0x19')](sequelize[_0xa5be('0x1a')](_0xa5be('0x18')),'unsigned'):_0x2cb058,'ASC'];}});}return _0x333ee9;};exports[_0xa5be('0x1d')]=function(_0x4e6b75,_0x489a91){if(_[_0xa5be('0x1e')](_0x4e6b75)){return _0x4e6b75;}if(_[_0xa5be('0x13')](_0x4e6b75)){for(var _0xc490e=0x0;_0xc490e<_0x4e6b75[_0xa5be('0x1f')];_0xc490e+=0x1){_0x4e6b75[_0xc490e]=this[_0xa5be('0x1d')](_0x4e6b75[_0xc490e],_0x489a91);}return _0x4e6b75;}if(!_[_0xa5be('0x20')](_0x4e6b75)){return _0x4e6b75;}if(_[_0xa5be('0x21')](_0x489a91)){_0x489a91=[_0x489a91];}if(!_[_0xa5be('0x13')](_0x489a91)){return _0x4e6b75;}for(var _0x1157ab=0x0;_0x1157ab<_0x489a91['length'];_0x1157ab+=0x1){_[_0xa5be('0x22')](_0x4e6b75,_0x489a91[_0x1157ab]);}for(var _0x5ccede in _0x4e6b75){if(_0x4e6b75[_0xa5be('0x23')](_0x5ccede)){_0x4e6b75[_0x5ccede]=this['omit'](_0x4e6b75[_0x5ccede],_0x489a91);}}return _0x4e6b75;};exports[_0xa5be('0x24')]=function(_0x1c2c79){return _0x1c2c79['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x114254){return _0x114254[_0xa5be('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xa5be('0x26')]=function(_0x349722){var _0x146d4b=[];_0x349722[_0xa5be('0x7')](/[ ,]+/)[_0xa5be('0x27')](function(_0x1e388f){_0x1e388f=_0x1e388f['replace'](/([^:]")"+/g,'$1');_0x1e388f='+'+_0x1e388f+'*';if(_0x1e388f[_0xa5be('0x5')]('@'))_0x1e388f='\x22'+_0x1e388f+'\x22';_0x146d4b['push'](_0x1e388f);});return _0x146d4b[_0xa5be('0x28')]('\x20');};exports[_0xa5be('0x29')]=function(_0x2d359f,_0x315a7c,_0x2ed42d){var _0x5abbc5={},_0x592e85={};if(_0x315a7c[_0xa5be('0x2a')][_0xa5be('0x2b')]){_0x315a7c[_0xa5be('0x2a')]['id']=_0x315a7c[_0xa5be('0x2a')][_0xa5be('0x2b')];delete _0x315a7c[_0xa5be('0x2a')][_0xa5be('0x2b')];}_0x5abbc5['model']=_[_0xa5be('0x17')](_0x2d359f,_0xa5be('0x11'));_0x5abbc5[_0xa5be('0x2a')]=_[_0xa5be('0x4')](_0x315a7c[_0xa5be('0x2a')]);_0x5abbc5[_0xa5be('0x8')]=_['intersection'](_0x5abbc5[_0xa5be('0x2c')],_0x5abbc5[_0xa5be('0x2a')]);_0x592e85[_0xa5be('0x2d')]=_['intersection'](_0x5abbc5[_0xa5be('0x2c')],this[_0xa5be('0x6')](_0x315a7c['query'][_0xa5be('0x6')]));_0x592e85[_0xa5be('0x2d')]=_0x592e85[_0xa5be('0x2d')][_0xa5be('0x1f')]?_0x592e85[_0xa5be('0x2d')]:_0x5abbc5[_0xa5be('0x2c')];if(!_0x315a7c[_0xa5be('0x2a')]['hasOwnProperty'](_0xa5be('0x2e'))){_0x592e85[_0xa5be('0x14')]=this[_0xa5be('0x14')](_0x315a7c[_0xa5be('0x2a')][_0xa5be('0x14')]);_0x592e85[_0xa5be('0x15')]=this['offset'](_0x315a7c[_0xa5be('0x2a')][_0xa5be('0x15')]);}_0x592e85[_0xa5be('0x2f')]=this[_0xa5be('0x16')](_0x315a7c[_0xa5be('0x2a')][_0xa5be('0x16')]);_0x592e85[_0xa5be('0x30')]=this[_0xa5be('0x8')](_[_0xa5be('0x31')](_0x315a7c[_0xa5be('0x2a')],_0x5abbc5[_0xa5be('0x8')]),_0x2d359f);if(_0x315a7c[_0xa5be('0x2a')]['filter']){var _0x59863b=_0x2d359f;var _0x1ddf1a=_0x315a7c['query'][_0xa5be('0x32')];if(typeof _0x1ddf1a==='object'){_0x59863b=_[_0xa5be('0x32')](_0x2d359f,function(_0x4b4652){return _[_0xa5be('0x5')](_0x1ddf1a['columns'],_0x4b4652[_0xa5be('0x11')]);});_0x1ddf1a=_0x1ddf1a[_0xa5be('0x33')];}_0x592e85['where']=_[_0xa5be('0x34')](_0x592e85['where'],{'$or':_[_0xa5be('0x17')](_0x59863b,function(_0x4fd30e){if(_0x4fd30e[_0xa5be('0x9')]!==_0xa5be('0x35')){if(_0x2ed42d){return sequelize[_0xa5be('0x30')](sequelize['fn'](_0xa5be('0x36'),sequelize[_0xa5be('0x1a')](_0x4fd30e[_0xa5be('0x11')])),{'$like':sequelize['fn'](_0xa5be('0x36'),'%'+_0x315a7c[_0xa5be('0x2a')][_0xa5be('0x32')]+'%')});}else{var _0x23456f={};_0x23456f[_0x4fd30e[_0xa5be('0x11')]]={'$like':'%'+_0x315a7c[_0xa5be('0x2a')][_0xa5be('0x32')]+'%'};return _0x23456f;}}})});}_0x592e85=_[_0xa5be('0x34')]({},_0x592e85,_0x315a7c[_0xa5be('0x37')]);return _0x592e85;};
\ No newline at end of file
index f5e66fe..eacd4e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dbe=['initialize','express','body-parser','method-override','cookie-parser','path','passport','cors','../mysqldb','default','get','env','production','set','appPath','join','root','public','client','toISOString','split','static','views','html','ejs','renderFile','view\x20engine','use','urlencoded','50mb','json'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x2dbe,0xf9));var _0xe2db=function(_0xe8cec7,_0x564bec){_0xe8cec7=_0xe8cec7-0x0;var _0x26b790=_0x2dbe[_0xe8cec7];return _0x26b790;};'use strict';var express=require(_0xe2db('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xe2db('0x1'));var methodOverride=require(_0xe2db('0x2'));var cookieParser=require(_0xe2db('0x3'));var errorHandler=require('errorhandler');var path=require(_0xe2db('0x4'));var passport=require(_0xe2db('0x5'));var cors=require(_0xe2db('0x6'));var moment=require('moment');var config=require('./environment');var db=require(_0xe2db('0x7'))['db'];exports[_0xe2db('0x8')]=function(_0xfb2696){var _0x26feee=_0xfb2696[_0xe2db('0x9')](_0xe2db('0xa'));if(_0x26feee===_0xe2db('0xb')){_0xfb2696[_0xe2db('0xc')](_0xe2db('0xd'),path[_0xe2db('0xe')](config[_0xe2db('0xf')],_0xe2db('0x10')));}if(_0x26feee==='development'||_0x26feee==='test'){_0xfb2696[_0xe2db('0xc')](_0xe2db('0xd'),path[_0xe2db('0xe')](config['root'],_0xe2db('0x11')));_0xfb2696['use'](errorHandler());}_0xfb2696[_0xe2db('0xc')]('json\x20replacer',function(_0x4aeab5,_0x854130){if(this[_0x4aeab5]instanceof Date){_0x854130=this[_0x4aeab5][_0xe2db('0x12')]()[_0xe2db('0x13')]('.')[0x0]+'Z';}return _0x854130;});_0xfb2696['use'](express[_0xe2db('0x14')](_0xfb2696[_0xe2db('0x9')](_0xe2db('0xd'))));_0xfb2696['set'](_0xe2db('0x15'),config[_0xe2db('0xf')]+'/server/views');_0xfb2696['engine'](_0xe2db('0x16'),require(_0xe2db('0x17'))[_0xe2db('0x18')]);_0xfb2696[_0xe2db('0xc')](_0xe2db('0x19'),'html');_0xfb2696[_0xe2db('0x1a')](bodyParser[_0xe2db('0x1b')]({'limit':_0xe2db('0x1c'),'extended':!![]}));_0xfb2696[_0xe2db('0x1a')](bodyParser[_0xe2db('0x1d')]({'limit':_0xe2db('0x1c')}));_0xfb2696[_0xe2db('0x1a')](cors());_0xfb2696[_0xe2db('0x1a')](methodOverride());_0xfb2696[_0xe2db('0x1a')](cookieParser());_0xfb2696[_0xe2db('0x1a')](passport[_0xe2db('0x1e')]());};
\ No newline at end of file
+var _0x7836=['body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','env','production','set','join','root','development','test','client','use','json\x20replacer','split','static','appPath','views','/server/views','html','ejs','view\x20engine','50mb','initialize','express','serve-favicon'];(function(_0x29bec6,_0x11d4e9){var _0x4429d3=function(_0x2f9686){while(--_0x2f9686){_0x29bec6['push'](_0x29bec6['shift']());}};_0x4429d3(++_0x11d4e9);}(_0x7836,0xde));var _0x6783=function(_0x3c083b,_0x549e68){_0x3c083b=_0x3c083b-0x0;var _0x1c4f50=_0x7836[_0x3c083b];return _0x1c4f50;};'use strict';var express=require(_0x6783('0x0'));var favicon=require(_0x6783('0x1'));var bodyParser=require(_0x6783('0x2'));var methodOverride=require(_0x6783('0x3'));var cookieParser=require(_0x6783('0x4'));var errorHandler=require(_0x6783('0x5'));var path=require(_0x6783('0x6'));var passport=require('passport');var cors=require(_0x6783('0x7'));var moment=require(_0x6783('0x8'));var config=require(_0x6783('0x9'));var db=require(_0x6783('0xa'))['db'];exports[_0x6783('0xb')]=function(_0x5aa856){var _0x2b2288=_0x5aa856['get'](_0x6783('0xc'));if(_0x2b2288===_0x6783('0xd')){_0x5aa856[_0x6783('0xe')]('appPath',path[_0x6783('0xf')](config[_0x6783('0x10')],'public'));}if(_0x2b2288===_0x6783('0x11')||_0x2b2288===_0x6783('0x12')){_0x5aa856[_0x6783('0xe')]('appPath',path[_0x6783('0xf')](config[_0x6783('0x10')],_0x6783('0x13')));_0x5aa856[_0x6783('0x14')](errorHandler());}_0x5aa856[_0x6783('0xe')](_0x6783('0x15'),function(_0x1ca5ff,_0xa575a4){if(this[_0x1ca5ff]instanceof Date){_0xa575a4=this[_0x1ca5ff]['toISOString']()[_0x6783('0x16')]('.')[0x0]+'Z';}return _0xa575a4;});_0x5aa856[_0x6783('0x14')](express[_0x6783('0x17')](_0x5aa856['get'](_0x6783('0x18'))));_0x5aa856[_0x6783('0xe')](_0x6783('0x19'),config[_0x6783('0x10')]+_0x6783('0x1a'));_0x5aa856['engine'](_0x6783('0x1b'),require(_0x6783('0x1c'))['renderFile']);_0x5aa856[_0x6783('0xe')](_0x6783('0x1d'),_0x6783('0x1b'));_0x5aa856[_0x6783('0x14')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x5aa856[_0x6783('0x14')](bodyParser['json']({'limit':_0x6783('0x1e')}));_0x5aa856[_0x6783('0x14')](cors());_0x5aa856[_0x6783('0x14')](methodOverride());_0x5aa856[_0x6783('0x14')](cookieParser());_0x5aa856[_0x6783('0x14')](passport[_0x6783('0x1f')]());};
\ No newline at end of file
index 9d47081..da26a8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf66a=['address','127.0.0.1','getFirstInterface','map','model','createHash','update','digest','hex','test','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','md5','substring','crypto','child_process','../environment','networkInterfaces','orderBy','length','family','IPv4','internal','concat','mac','00:00:00:00:00:00'];(function(_0x3d458c,_0x1ab0fb){var _0x590cc9=function(_0x42fd73){while(--_0x42fd73){_0x3d458c['push'](_0x3d458c['shift']());}};_0x590cc9(++_0x1ab0fb);}(_0xf66a,0x6c));var _0xaf66=function(_0xbd289c,_0xab4eac){_0xbd289c=_0xbd289c-0x0;var _0x3f7d02=_0xf66a[_0xbd289c];return _0x3f7d02;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xaf66('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xaf66('0x1'))['execSync'];var config=require(_0xaf66('0x2'));function getInterfaces(){var _0x40dd05=[];var _0x386835=os[_0xaf66('0x3')]();var _0x4b8726=_[_0xaf66('0x4')](_['keys'](_0x386835));for(var _0x254cf2=0x0;_0x254cf2<_0x4b8726[_0xaf66('0x5')];_0x254cf2++){var _0xaa7870=_0x386835[_0x4b8726[_0x254cf2]]['filter'](function(_0x259f09){return _0x259f09[_0xaf66('0x6')]===_0xaf66('0x7')&&_0x259f09[_0xaf66('0x8')]===![];});_0x40dd05=_0x40dd05[_0xaf66('0x9')](_0xaa7870);}return _0x40dd05;}function getFirstInterface(){var _0x50d36e=_['head'](getInterfaces());return{'macAddress':_0x50d36e&&_0x50d36e['mac']?_0x50d36e[_0xaf66('0xa')]:_0xaf66('0xb'),'ipAddress':_0x50d36e&&_0x50d36e[_0xaf66('0xc')]?_0x50d36e['address']:_0xaf66('0xd')};}exports[_0xaf66('0xe')]=getFirstInterface;function getCPUhash(){var _0x55d1d0=_[_0xaf66('0x4')](os['cpus']()[_0xaf66('0xf')](function(_0x3c462b){return _0x3c462b[_0xaf66('0x10')];}))['join'](':');return crypto[_0xaf66('0x11')]('md5')[_0xaf66('0x12')](_0x55d1d0)[_0xaf66('0x13')](_0xaf66('0x14'));}exports['getUuid']=function(){var _0x2c0e4b=os['platform']();var _0x31675b=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x31675b[_0xaf66('0x15')](config[_0xaf66('0x16')])){return config[_0xaf66('0x16')];}else if(_0x2c0e4b==='win32'){return exec(_0xaf66('0x17'),{'encoding':_0xaf66('0x18')})['replace']('\x0d\x0a','');}else{var _0x479ec5=getFirstInterface();var _0x17ae8f=getCPUhash();var _0x306676=_0x17ae8f+'|'+os[_0xaf66('0x19')]()+'|'+_0x479ec5[_0xaf66('0x1a')]+'|'+_0x479ec5[_0xaf66('0x1b')];var _0x47b21b=crypto['createHash'](_0xaf66('0x1c'))[_0xaf66('0x12')](_0x306676)['digest']('hex');return _0x47b21b[_0xaf66('0x1d')](0x0,0x8)+'-'+_0x47b21b['substring'](0x8,0xc)+'-'+_0x47b21b[_0xaf66('0x1d')](0xc,0x10)+'-'+_0x47b21b[_0xaf66('0x1d')](0x10,0x14)+'-'+_0x47b21b[_0xaf66('0x1d')](0x14);}};
\ No newline at end of file
+var _0xf478=['127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','substring','lodash','crypto','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','concat','mac','00:00:00:00:00:00','address'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xf478,0x1ef));var _0x8f47=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xf478[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x8f47('0x0'));var os=require('os');var crypto=require(_0x8f47('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x8f47('0x2'))['execSync'];var config=require(_0x8f47('0x3'));function getInterfaces(){var _0x11d0c2=[];var _0x10796a=os[_0x8f47('0x4')]();var _0x2bca24=_[_0x8f47('0x5')](_[_0x8f47('0x6')](_0x10796a));for(var _0x241b1c=0x0;_0x241b1c<_0x2bca24[_0x8f47('0x7')];_0x241b1c++){var _0x1a8c70=_0x10796a[_0x2bca24[_0x241b1c]][_0x8f47('0x8')](function(_0xd7aeaf){return _0xd7aeaf[_0x8f47('0x9')]===_0x8f47('0xa')&&_0xd7aeaf['internal']===![];});_0x11d0c2=_0x11d0c2[_0x8f47('0xb')](_0x1a8c70);}return _0x11d0c2;}function getFirstInterface(){var _0x3c7aca=_['head'](getInterfaces());return{'macAddress':_0x3c7aca&&_0x3c7aca[_0x8f47('0xc')]?_0x3c7aca['mac']:_0x8f47('0xd'),'ipAddress':_0x3c7aca&&_0x3c7aca[_0x8f47('0xe')]?_0x3c7aca[_0x8f47('0xe')]:_0x8f47('0xf')};}exports[_0x8f47('0x10')]=getFirstInterface;function getCPUhash(){var _0x6cbdd2=_[_0x8f47('0x5')](os[_0x8f47('0x11')]()['map'](function(_0x5ed8b2){return _0x5ed8b2[_0x8f47('0x12')];}))[_0x8f47('0x13')](':');return crypto[_0x8f47('0x14')](_0x8f47('0x15'))[_0x8f47('0x16')](_0x6cbdd2)[_0x8f47('0x17')](_0x8f47('0x18'));}exports[_0x8f47('0x19')]=function(){var _0x48ec08=os[_0x8f47('0x1a')]();var _0x3216de=/[0-9a-f-]{36}/;if(config[_0x8f47('0x1b')]&&_0x3216de['test'](config[_0x8f47('0x1b')])){return config[_0x8f47('0x1b')];}else if(_0x48ec08===_0x8f47('0x1c')){return exec(_0x8f47('0x1d'),{'encoding':'utf8'})[_0x8f47('0x1e')]('\x0d\x0a','');}else{var _0x15e909=getFirstInterface();var _0x1093ad=getCPUhash();var _0x21add5=_0x1093ad+'|'+os[_0x8f47('0x1f')]()+'|'+_0x15e909[_0x8f47('0x20')]+'|'+_0x15e909['ipAddress'];var _0x40a7a9=crypto[_0x8f47('0x14')](_0x8f47('0x15'))[_0x8f47('0x16')](_0x21add5)[_0x8f47('0x17')](_0x8f47('0x18'));return _0x40a7a9[_0x8f47('0x21')](0x0,0x8)+'-'+_0x40a7a9[_0x8f47('0x21')](0x8,0xc)+'-'+_0x40a7a9['substring'](0xc,0x10)+'-'+_0x40a7a9[_0x8f47('0x21')](0x10,0x14)+'-'+_0x40a7a9['substring'](0x14);}};
\ No newline at end of file
index 1899b05..6659de1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x385e=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','GET','then','catch','get','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update'];(function(_0x20c5f3,_0x1de81c){var _0x410711=function(_0x96a7c9){while(--_0x96a7c9){_0x20c5f3['push'](_0x20c5f3['shift']());}};_0x410711(++_0x1de81c);}(_0x385e,0xd4));var _0xe385=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0x385e[_0x55e1d1];return _0x1165db;};'use strict';var util=require('util');var moment=require(_0xe385('0x0'));var rp=require(_0xe385('0x1'));var BPromise=require(_0xe385('0x2'));var pkginfo=require(_0xe385('0x3'))(module,_0xe385('0x4'));var db=require(_0xe385('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xe385('0x6'));var logger=require(_0xe385('0x7'))(_0xe385('0x8'));var HOST=_0xe385('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x400071){return new BPromise(function(_0x3e2881,_0x3e6590){var _0x50c277=util[_0xe385('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x400071,module[_0xe385('0xb')][_0xe385('0x4')]);if(oldToken){_0x50c277=util[_0xe385('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x400071,module[_0xe385('0xb')][_0xe385('0x4')],oldToken);}var _0x3ebfc0={'uri':_0x50c277,'method':_0xe385('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3ebfc0)[_0xe385('0xd')](function(_0xfa15b5){_0x3e2881(_0xfa15b5);})[_0xe385('0xe')](function(_0x3297a6){_0x3e6590(_0x3297a6);});});}function manageLicense(_0x4a1696,_0x32c729){var _0x36264f=_0x32c729[_0xe385('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x36264f['data1']!==_0x4a1696&&!_0x36264f[_0xe385('0x10')]){oldToken=_0x36264f['data1'];}httpRequest(_0x4a1696)[_0xe385('0xd')](function(_0x274461){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x274461[_0xe385('0x11')]){isOldTokenSent=![];if(!_0x36264f[_0xe385('0x8')]&&_0x36264f[_0xe385('0x8')]!=_0x274461[_0xe385('0x8')]||_0x36264f[_0xe385('0x8')]&&_0x36264f[_0xe385('0x10')]){logger['info'](_0xe385('0x12'));}if(_0x36264f[_0xe385('0x8')]&&!_0x36264f[_0xe385('0x10')]&&_0x36264f['license']!=_0x274461[_0xe385('0x8')]){logger[_0xe385('0x13')](_0xe385('0x14'));}if(_0x36264f[_0xe385('0x8')]&&!_0x36264f['data2']&&_0x36264f['license']==_0x274461[_0xe385('0x8')]){return _0x32c729;}return _0x32c729[_0xe385('0x15')]({'data1':_0x4a1696,'data2':null,'license':_0x274461[_0xe385('0x8')]});}else{if(_0x274461['license']||_0x36264f[_0xe385('0x8')]){if(!_0x36264f['data2']){if(_0x36264f['data1']==_0x4a1696){GRAY_PERIOD_REASON='Disabled';logger[_0xe385('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xe385('0x16');logger[_0xe385('0x13')](_0xe385('0x17'),_0x36264f[_0xe385('0x18')],_0x4a1696);}logger['info'](_0xe385('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xe385('0xa')](_0xe385('0x1a')));return _0x32c729[_0xe385('0x15')]({'data2':encryptor[_0xe385('0x1b')](moment()[_0xe385('0xa')](_0xe385('0x1a')))});}else{if(moment()[_0xe385('0x1c')](encryptor[_0xe385('0x1d')](_0x36264f[_0xe385('0x10')]),'days')>DAYS){logger[_0xe385('0x13')](_0xe385('0x1e'),moment()[_0xe385('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x32c729['update']({'data1':_0x4a1696,'data2':null,'license':null});}}}else{if(_0x36264f[_0xe385('0x18')]!=_0x4a1696){logger[_0xe385('0x13')](_0xe385('0x17'),_0x36264f[_0xe385('0x18')],_0x4a1696);return _0x32c729[_0xe385('0x15')]({'data1':_0x4a1696,'data2':null,'license':null});}}}return _0x32c729;})[_0xe385('0xd')](function(_0x44b4ea){_0x32c729=_0x44b4ea;})['catch'](function(_0x2128c1){logger[_0xe385('0x1f')](_0x2128c1[_0xe385('0x20')]);})[_0xe385('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x32c729);},TIME);});}function defaultLicense(){var _0x56c613=hardware[_0xe385('0x22')]();if(_0x56c613){return db[_0xe385('0x23')][_0xe385('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x56c613}})['spread'](function(_0x82fddf,_0x4cff3e){logger[_0xe385('0x13')](_0xe385('0x25'),_0x56c613);manageLicense(_0x56c613,_0x82fddf);})['catch'](function(_0x195150){logger[_0xe385('0x1f')](_0x195150[_0xe385('0x20')]);});}}exports[_0xe385('0x26')]=defaultLicense;
\ No newline at end of file
+var _0x3d0c=['util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','exports','format','GET','then','catch','get','data1','active','license','data2','info','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','encryptString','diff','days','YYYY-MM-DD\x20HH:mm','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default'];(function(_0x2e5249,_0xa4eed1){var _0x3f59fc=function(_0x2c6330){while(--_0x2c6330){_0x2e5249['push'](_0x2e5249['shift']());}};_0x3f59fc(++_0xa4eed1);}(_0x3d0c,0x72));var _0xc3d0=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x3d0c[_0x11e30d];return _0x2d4e29;};'use strict';var util=require(_0xc3d0('0x0'));var moment=require(_0xc3d0('0x1'));var rp=require(_0xc3d0('0x2'));var BPromise=require(_0xc3d0('0x3'));var pkginfo=require('pkginfo')(module,_0xc3d0('0x4'));var db=require(_0xc3d0('0x5'))['db'];var encryptor=require(_0xc3d0('0x6'));var hardware=require(_0xc3d0('0x7'));var logger=require(_0xc3d0('0x8'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x48923c){return new BPromise(function(_0x30feb9,_0x585ec4){var _0x39fcfc=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x48923c,module[_0xc3d0('0x9')]['version']);if(oldToken){_0x39fcfc=util[_0xc3d0('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x48923c,module[_0xc3d0('0x9')][_0xc3d0('0x4')],oldToken);}var _0x1a2fbc={'uri':_0x39fcfc,'method':_0xc3d0('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x1a2fbc)[_0xc3d0('0xc')](function(_0x5b0977){_0x30feb9(_0x5b0977);})[_0xc3d0('0xd')](function(_0x557604){_0x585ec4(_0x557604);});});}function manageLicense(_0x183cf5,_0x4696f5){var _0x14823e=_0x4696f5[_0xc3d0('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x14823e[_0xc3d0('0xf')]!==_0x183cf5&&!_0x14823e['data2']){oldToken=_0x14823e[_0xc3d0('0xf')];}httpRequest(_0x183cf5)[_0xc3d0('0xc')](function(_0x31cdfb){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x31cdfb[_0xc3d0('0x10')]){isOldTokenSent=![];if(!_0x14823e[_0xc3d0('0x11')]&&_0x14823e['license']!=_0x31cdfb[_0xc3d0('0x11')]||_0x14823e['license']&&_0x14823e[_0xc3d0('0x12')]){logger[_0xc3d0('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x14823e[_0xc3d0('0x11')]&&!_0x14823e[_0xc3d0('0x12')]&&_0x14823e[_0xc3d0('0x11')]!=_0x31cdfb['license']){logger[_0xc3d0('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x14823e[_0xc3d0('0x11')]&&!_0x14823e[_0xc3d0('0x12')]&&_0x14823e['license']==_0x31cdfb[_0xc3d0('0x11')]){return _0x4696f5;}return _0x4696f5['update']({'data1':_0x183cf5,'data2':null,'license':_0x31cdfb['license']});}else{if(_0x31cdfb['license']||_0x14823e[_0xc3d0('0x11')]){if(!_0x14823e[_0xc3d0('0x12')]){if(_0x14823e['data1']==_0x183cf5){GRAY_PERIOD_REASON=_0xc3d0('0x14');logger[_0xc3d0('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xc3d0('0x15');logger[_0xc3d0('0x13')](_0xc3d0('0x16'),_0x14823e[_0xc3d0('0xf')],_0x183cf5);}logger[_0xc3d0('0x13')](_0xc3d0('0x17'),GRAY_PERIOD_REASON[_0xc3d0('0x18')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x4696f5[_0xc3d0('0x19')]({'data2':encryptor[_0xc3d0('0x1a')](moment()[_0xc3d0('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xc3d0('0x1b')](encryptor['decryptString'](_0x14823e[_0xc3d0('0x12')]),_0xc3d0('0x1c'))>DAYS){logger[_0xc3d0('0x13')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0xc3d0('0x1d')));isOldTokenSent=![];return _0x4696f5[_0xc3d0('0x19')]({'data1':_0x183cf5,'data2':null,'license':null});}}}else{if(_0x14823e[_0xc3d0('0xf')]!=_0x183cf5){logger[_0xc3d0('0x13')](_0xc3d0('0x16'),_0x14823e['data1'],_0x183cf5);return _0x4696f5[_0xc3d0('0x19')]({'data1':_0x183cf5,'data2':null,'license':null});}}}return _0x4696f5;})[_0xc3d0('0xc')](function(_0x3eb9b7){_0x4696f5=_0x3eb9b7;})[_0xc3d0('0xd')](function(_0x4d688c){logger[_0xc3d0('0x1e')](_0x4d688c['message']);})[_0xc3d0('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0xc3d0('0x20')](),_0x4696f5);},TIME);});}function defaultLicense(){var _0xd0ef78=hardware[_0xc3d0('0x20')]();if(_0xd0ef78){return db[_0xc3d0('0x21')][_0xc3d0('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0xd0ef78}})[_0xc3d0('0x23')](function(_0x1fe60a,_0x31e13b){logger[_0xc3d0('0x13')](_0xc3d0('0x24'),_0xd0ef78);manageLicense(_0xd0ef78,_0x1fe60a);})[_0xc3d0('0xd')](function(_0x324686){logger[_0xc3d0('0x1e')](_0x324686['message']);});}}exports[_0xc3d0('0x25')]=defaultLicense;
\ No newline at end of file
index c959bb2..463c4ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22a1=['data1','data2','split','%s:%s:%s','parse','demo','uuid','decryptString','gray','deadline','add','days','format','grayReason','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','util','lodash','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','defaults','then','catch','isEmpty'];(function(_0x1eee6e,_0x12f7a3){var _0x3caf1d=function(_0x263ed9){while(--_0x263ed9){_0x1eee6e['push'](_0x1eee6e['shift']());}};_0x3caf1d(++_0x12f7a3);}(_0x22a1,0xc7));var _0x122a=function(_0x4a6090,_0x2f59b1){_0x4a6090=_0x4a6090-0x0;var _0x4fd045=_0x22a1[_0x4a6090];return _0x4fd045;};'use strict';var util=require(_0x122a('0x0'));var _=require(_0x122a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x122a('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x122a('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x122a('0x4'),'machineUuid':hardware[_0x122a('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1f3315){return new BPromise(function(_0x5520b3,_0x4ff945){return db[_0x122a('0x6')]['find'](_[_0x122a('0x7')](_0x1f3315,{'raw':!![],'where':{'id':0x1}}))[_0x122a('0x8')](function(_0xd202d9){return checkLicense(_0xd202d9,null);})['then'](function(_0x1e0a3c){_0x5520b3(_0x1e0a3c);return;})[_0x122a('0x9')](function(_0x46ba44){_0x4ff945(_0x46ba44);});});}function checkLicense(_0x31935b,_0x114abd){if(!_0x31935b){demoLicense['uuid']=_0x31935b['data1'];return demoLicense;}try{var _0x2ba449=_0x114abd||_0x31935b['license'];if(_[_0x122a('0xa')](_0x2ba449)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xb8dc04=_0x31935b[_0x122a('0xb')];var _0x49d10d=_0x31935b[_0x122a('0xc')];var _0x23f6b0=_0xb8dc04[_0x122a('0xd')]('-')[0x4];var _0x1e848f=_0xb8dc04[_0x122a('0xd')]('-')[0x0];var _0x2fe179=encryptor['decryptString'](_0x2ba449,util['format'](_0x122a('0xe'),_0x23f6b0,_0xb8dc04,_0x1e848f));var _0x1222d4=JSON[_0x122a('0xf')](_0x2fe179);_0x1222d4[_0x122a('0x10')]=![];_0x1222d4[_0x122a('0x11')]=_0xb8dc04;_0x1222d4['machineUuid']=hardware[_0x122a('0x5')]();if(_0x49d10d){var _0x5d24e4=encryptor[_0x122a('0x12')](_0x49d10d);_0x1222d4[_0x122a('0x13')]=_0x5d24e4;_0x1222d4[_0x122a('0x14')]=moment(_0x5d24e4)[_0x122a('0x15')](0x7,_0x122a('0x16'))[_0x122a('0x17')]();_0x1222d4[_0x122a('0x18')]=_0x1222d4[_0x122a('0x11')]!=_0x1222d4['machineUuid']?'changed':'disabled';}return _0x1222d4;}catch(_0x99631f){breakingLicense[_0x122a('0x11')]=_0x31935b[_0x122a('0xb')];breakingLicense[_0x122a('0x19')]=_0x99631f['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x59fb49,_0x2fa734){getLicense()[_0x122a('0x8')](function(_0x5244cd){return db[_0x122a('0x1a')][_0x122a('0x1b')]({'attributes':[_0x122a('0x1c'),[db[_0x122a('0x1d')]['fn'](_0x122a('0x1e'),db['sequelize'][_0x122a('0x1f')](_0x122a('0x1c'))),_0x122a('0x20')]],'group':_0x122a('0x1c'),'where':{'role':{'$or':[_0x122a('0x21'),'user',_0x122a('0x22')]}},'raw':!![]})[_0x122a('0x8')](function(_0x2bb458){var _0x22350d={'user':_0x5244cd[_0x122a('0x23')]||0x0,'telephone':_0x5244cd[_0x122a('0x24')]||0x0};_0x2bb458[_0x122a('0x25')](function(_0xe6b6a2){var _0x1a9fb1=_0xe6b6a2[_0x122a('0x1c')]===_0x122a('0x21')?_0x122a('0x26'):_0xe6b6a2[_0x122a('0x1c')];_0x22350d[_0x1a9fb1]-=_0xe6b6a2[_0x122a('0x20')];if(_0x22350d[_0x1a9fb1]<0x0)_0x22350d[_0x1a9fb1]=0x0;});_0x59fb49(_0x22350d);return;});})[_0x122a('0x9')](function(_0x31c9b6){_0x2fa734(_0x31c9b6);});});}function checkUserLimits(_0x1095de){return new BPromise(function(_0x1746ae,_0x4204b5){getLimits()[_0x122a('0x8')](function(_0x17ec51){var _0x4a53dc=_[_0x122a('0x27')](_[_0x122a('0x28')](_0x1095de,'role'),['admin',_0x122a('0x26'),_0x122a('0x22')]);var _0xd93366=(_0x4a53dc['admin']||0x0)+(_0x4a53dc[_0x122a('0x26')]||0x0);var _0x36ecee=_0x4a53dc[_0x122a('0x22')]||0x0;if(_0xd93366>_0x17ec51[_0x122a('0x26')])return _0x4204b5('License\x20limit\x20reached\x20for\x20users');if(_0x36ecee>_0x17ec51[_0x122a('0x22')])return _0x4204b5(_0x122a('0x29'));return _0x1746ae();})[_0x122a('0x9')](function(_0x5ac3f8){_0x4204b5(_0x5ac3f8);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xc9ae=['../../mysqldb','Demo\x20license','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','find','defaults','then','uuid','data1','isEmpty','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','message','findAll','role','COUNT','sequelize','col','count','admin','user','telephone','users','telephones','forEach','catch','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','./hardware'];(function(_0x276051,_0x13449c){var _0x255723=function(_0x6cc86){while(--_0x6cc86){_0x276051['push'](_0x276051['shift']());}};_0x255723(++_0x13449c);}(_0xc9ae,0x176));var _0xec9a=function(_0x33ef13,_0x1c3be1){_0x33ef13=_0x33ef13-0x0;var _0x2c2560=_0xc9ae[_0x33ef13];return _0x2c2560;};'use strict';var util=require(_0xec9a('0x0'));var _=require('lodash');var moment=require(_0xec9a('0x1'));var BPromise=require(_0xec9a('0x2'));var hardware=require(_0xec9a('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0xec9a('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xec9a('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xec9a('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xec9a('0x7'),'machineUuid':hardware[_0xec9a('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4ea8e2){return new BPromise(function(_0x48f748,_0x174191){return db[_0xec9a('0x9')][_0xec9a('0xa')](_[_0xec9a('0xb')](_0x4ea8e2,{'raw':!![],'where':{'id':0x1}}))[_0xec9a('0xc')](function(_0x2b59a1){return checkLicense(_0x2b59a1,null);})[_0xec9a('0xc')](function(_0x43fb5e){_0x48f748(_0x43fb5e);return;})['catch'](function(_0x18418d){_0x174191(_0x18418d);});});}function checkLicense(_0x44d8b2,_0x496781){if(!_0x44d8b2){demoLicense[_0xec9a('0xd')]=_0x44d8b2[_0xec9a('0xe')];return demoLicense;}try{var _0x97b49e=_0x496781||_0x44d8b2['license'];if(_[_0xec9a('0xf')](_0x97b49e)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2df3cd=_0x44d8b2['data1'];var _0x2c0da8=_0x44d8b2['data2'];var _0x300ed6=_0x2df3cd[_0xec9a('0x10')]('-')[0x4];var _0x42d0f4=_0x2df3cd[_0xec9a('0x10')]('-')[0x0];var _0x4d0d22=encryptor[_0xec9a('0x11')](_0x97b49e,util[_0xec9a('0x12')](_0xec9a('0x13'),_0x300ed6,_0x2df3cd,_0x42d0f4));var _0x388123=JSON[_0xec9a('0x14')](_0x4d0d22);_0x388123[_0xec9a('0x15')]=![];_0x388123[_0xec9a('0xd')]=_0x2df3cd;_0x388123[_0xec9a('0x16')]=hardware[_0xec9a('0x8')]();if(_0x2c0da8){var _0x54c0a7=encryptor[_0xec9a('0x11')](_0x2c0da8);_0x388123[_0xec9a('0x17')]=_0x54c0a7;_0x388123[_0xec9a('0x18')]=moment(_0x54c0a7)['add'](0x7,'days')['format']();_0x388123['grayReason']=_0x388123[_0xec9a('0xd')]!=_0x388123[_0xec9a('0x16')]?'changed':'disabled';}return _0x388123;}catch(_0x49c55c){breakingLicense['uuid']=_0x44d8b2[_0xec9a('0xe')];breakingLicense[_0xec9a('0x19')]=_0x49c55c['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x413f77,_0x44f131){getLicense()[_0xec9a('0xc')](function(_0x29dfe3){return db['User'][_0xec9a('0x1a')]({'attributes':[_0xec9a('0x1b'),[db['sequelize']['fn'](_0xec9a('0x1c'),db[_0xec9a('0x1d')][_0xec9a('0x1e')](_0xec9a('0x1b'))),_0xec9a('0x1f')]],'group':'role','where':{'role':{'$or':[_0xec9a('0x20'),_0xec9a('0x21'),_0xec9a('0x22')]}},'raw':!![]})[_0xec9a('0xc')](function(_0x50070d){var _0x29d5a3={'user':_0x29dfe3[_0xec9a('0x23')]||0x0,'telephone':_0x29dfe3[_0xec9a('0x24')]||0x0};_0x50070d[_0xec9a('0x25')](function(_0x39fd9e){var _0x3ff9a7=_0x39fd9e['role']===_0xec9a('0x20')?_0xec9a('0x21'):_0x39fd9e[_0xec9a('0x1b')];_0x29d5a3[_0x3ff9a7]-=_0x39fd9e[_0xec9a('0x1f')];if(_0x29d5a3[_0x3ff9a7]<0x0)_0x29d5a3[_0x3ff9a7]=0x0;});_0x413f77(_0x29d5a3);return;});})[_0xec9a('0x26')](function(_0x46f58a){_0x44f131(_0x46f58a);});});}function checkUserLimits(_0x17116e){return new BPromise(function(_0x1df3ee,_0x20ef8b){getLimits()['then'](function(_0x12a674){var _0x48fa55=_[_0xec9a('0x27')](_[_0xec9a('0x28')](_0x17116e,_0xec9a('0x1b')),['admin',_0xec9a('0x21'),'telephone']);var _0x20e8ca=(_0x48fa55['admin']||0x0)+(_0x48fa55['user']||0x0);var _0x77c17b=_0x48fa55[_0xec9a('0x22')]||0x0;if(_0x20e8ca>_0x12a674['user'])return _0x20ef8b('License\x20limit\x20reached\x20for\x20users');if(_0x77c17b>_0x12a674[_0xec9a('0x22')])return _0x20ef8b(_0xec9a('0x29'));return _0x1df3ee();})[_0xec9a('0x26')](function(_0x44f13f){_0x20ef8b(_0x44f13f);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 25d92e4..4c948ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77e6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x2c4c0e,_0x2f4b6a){var _0x1221c3=function(_0xf95e35){while(--_0xf95e35){_0x2c4c0e['push'](_0x2c4c0e['shift']());}};_0x1221c3(++_0x2f4b6a);}(_0x77e6,0x1a6));var _0x677e=function(_0x21d5bc,_0x1fb420){_0x21d5bc=_0x21d5bc-0x0;var _0x35a938=_0x77e6[_0x21d5bc];return _0x35a938;};'use strict';module[_0x677e('0x0')]={'DOMAIN':_0x677e('0x1'),'SESSION_SECRET':_0x677e('0x2'),'GOOGLE_ID':_0x677e('0x3'),'GOOGLE_SECRET':_0x677e('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0x5f66=['app-id','secret','http://localhost:9000'];(function(_0x200fcb,_0x4cacfd){var _0x466b22=function(_0x66969f){while(--_0x66969f){_0x200fcb['push'](_0x200fcb['shift']());}};_0x466b22(++_0x4cacfd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';module['exports']={'DOMAIN':_0x65f6('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x65f6('0x1'),'GOOGLE_SECRET':_0x65f6('0x2'),'DEBUG':''};
\ No newline at end of file
index d8ef413..ca79045 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dc2=['Logger','transports','File','%s-%s','error','info','debugLevel','moment','path','INFO','join','/var','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports'];(function(_0x697afd,_0x2b09d8){var _0x167358=function(_0x41bdfe){while(--_0x41bdfe){_0x697afd['push'](_0x697afd['shift']());}};_0x167358(++_0x2b09d8);}(_0x8dc2,0xaf));var _0x28dc=function(_0x5f06c0,_0x2637c4){_0x5f06c0=_0x5f06c0-0x0;var _0x323312=_0x8dc2[_0x5f06c0];return _0x323312;};'use strict';var moment=require(_0x28dc('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x28dc('0x1'));var debugLevel=_0x28dc('0x2');function filename(_0x3b4acc,_0x5b4e5c){return path[_0x28dc('0x3')](_0x28dc('0x4'),'log','xcally',util[_0x28dc('0x5')](_0x28dc('0x6'),_0x3b4acc,_0x5b4e5c));}function formatter(_0x83a4dc,_0x259d8e){_0x259d8e[_0x28dc('0x7')]=_0x259d8e['message'][_0x28dc('0x8')](/@@{/g,_0x28dc('0x9'))['replace'](/}@@/g,'}}}')[_0x28dc('0x8')](/@{/g,'{{')[_0x28dc('0x8')](/}@/g,'}}');return util[_0x28dc('0x5')](_0x28dc('0xa'),moment()[_0x28dc('0x5')](_0x28dc('0xb')),_0x259d8e['level'][_0x28dc('0xc')](),_0x83a4dc,_0x259d8e[_0x28dc('0x7')]);}module[_0x28dc('0xd')]=function(_0x43ba8e){return new winston[(_0x28dc('0xe'))]({'transports':[new winston[(_0x28dc('0xf'))][(_0x28dc('0x10'))]({'name':util['format'](_0x28dc('0x11'),_0x43ba8e,_0x28dc('0x12')),'filename':filename(_0x43ba8e,_0x28dc('0x12')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x97c96e){return formatter(_0x43ba8e,_0x97c96e);}}),new winston[(_0x28dc('0xf'))]['File']({'name':util[_0x28dc('0x5')](_0x28dc('0x11'),_0x43ba8e,_0x28dc('0x13')),'filename':filename(_0x43ba8e,_0x28dc('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbc27a2){return formatter(_0x43ba8e,_0xbc27a2);}}),new winston[(_0x28dc('0xf'))]['Console']({'level':process['env'][_0x28dc('0x14')]||debugLevel,'json':![],'formatter':function(_0x365d4a){return formatter(_0x43ba8e,_0x365d4a);}})]});};
\ No newline at end of file
+var _0xfa58=['message','replace','{{{','}}}','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','File','%s-%s','error','info','transports','Console','env','moment','winston','util','path','INFO','join','log','xcally','%s-%s.log'];(function(_0x529a0f,_0x328763){var _0x187a88=function(_0x1ea706){while(--_0x1ea706){_0x529a0f['push'](_0x529a0f['shift']());}};_0x187a88(++_0x328763);}(_0xfa58,0x163));var _0x8fa5=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0xfa58[_0x1709e7];return _0x402819;};'use strict';var moment=require(_0x8fa5('0x0'));var winston=require(_0x8fa5('0x1'));var util=require(_0x8fa5('0x2'));var path=require(_0x8fa5('0x3'));var debugLevel=_0x8fa5('0x4');function filename(_0x52c240,_0x375a1b){return path[_0x8fa5('0x5')]('/var',_0x8fa5('0x6'),_0x8fa5('0x7'),util['format'](_0x8fa5('0x8'),_0x52c240,_0x375a1b));}function formatter(_0x44f4c8,_0x5c2d25){_0x5c2d25[_0x8fa5('0x9')]=_0x5c2d25[_0x8fa5('0x9')][_0x8fa5('0xa')](/@@{/g,_0x8fa5('0xb'))[_0x8fa5('0xa')](/}@@/g,_0x8fa5('0xc'))[_0x8fa5('0xa')](/@{/g,'{{')[_0x8fa5('0xa')](/}@/g,'}}');return util[_0x8fa5('0xd')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x8fa5('0xe')),_0x5c2d25[_0x8fa5('0xf')][_0x8fa5('0x10')](),_0x44f4c8,_0x5c2d25['message']);}module[_0x8fa5('0x11')]=function(_0x49e413){return new winston[(_0x8fa5('0x12'))]({'transports':[new winston['transports'][(_0x8fa5('0x13'))]({'name':util[_0x8fa5('0xd')](_0x8fa5('0x14'),_0x49e413,'error'),'filename':filename(_0x49e413,_0x8fa5('0x15')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb5a215){return formatter(_0x49e413,_0xb5a215);}}),new winston['transports'][(_0x8fa5('0x13'))]({'name':util['format'](_0x8fa5('0x14'),_0x49e413,_0x8fa5('0x16')),'filename':filename(_0x49e413,_0x8fa5('0x16')),'level':_0x8fa5('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xe2b8c8){return formatter(_0x49e413,_0xe2b8c8);}}),new winston[(_0x8fa5('0x17'))][(_0x8fa5('0x18'))]({'level':process[_0x8fa5('0x19')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x1e5521){return formatter(_0x49e413,_0x1e5521);}})]});};
\ No newline at end of file
index 064f2c7..c651d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8ae=['express','../../services/express/index.js','../../services/ami/index.js','agi','join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0xb8ae,0x1bf));var _0xeb8a=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xb8ae[_0x2b9b7f];return _0x4ed19a;};'use strict';var path=require(_0xeb8a('0x0'));var os=require('os');var config={'apps':[{'name':_0xeb8a('0x1'),'script':path['join'](__dirname,_0xeb8a('0x2'))},{'name':'ami','script':path['join'](__dirname,_0xeb8a('0x3'))},{'name':_0xeb8a('0x4'),'script':path[_0xeb8a('0x5')](__dirname,_0xeb8a('0x6'))},{'name':_0xeb8a('0x7'),'script':path['join'](__dirname,_0xeb8a('0x8'))},{'name':_0xeb8a('0x9'),'script':path[_0xeb8a('0x5')](__dirname,_0xeb8a('0xa'))},{'name':_0xeb8a('0xb'),'script':path[_0xeb8a('0x5')](__dirname,_0xeb8a('0xc'))}]};module[_0xeb8a('0xd')]=config;
\ No newline at end of file
+var _0xa80c=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','ami','join','agi','../../services/agi/index.js','email'];(function(_0x415ba9,_0x15b1d4){var _0x4a1f5c=function(_0xfb3f1){while(--_0xfb3f1){_0x415ba9['push'](_0x415ba9['shift']());}};_0x4a1f5c(++_0x15b1d4);}(_0xa80c,0xbc));var _0xca80=function(_0x35de6f,_0x42689b){_0x35de6f=_0x35de6f-0x0;var _0x478c89=_0xa80c[_0x35de6f];return _0x478c89;};'use strict';var path=require(_0xca80('0x0'));var os=require('os');var config={'apps':[{'name':_0xca80('0x1'),'script':path['join'](__dirname,_0xca80('0x2'))},{'name':_0xca80('0x3'),'script':path[_0xca80('0x4')](__dirname,'../../services/ami/index.js')},{'name':_0xca80('0x5'),'script':path[_0xca80('0x4')](__dirname,_0xca80('0x6'))},{'name':_0xca80('0x7'),'script':path[_0xca80('0x4')](__dirname,_0xca80('0x8'))},{'name':_0xca80('0x9'),'script':path[_0xca80('0x4')](__dirname,_0xca80('0xa'))},{'name':_0xca80('0xb'),'script':path[_0xca80('0x4')](__dirname,_0xca80('0xc'))}]};module[_0xca80('0xd')]=config;
\ No newline at end of file
index 5cfa72e..a1e5a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadd8=['saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xadd8,0x1a5));var _0x8add=function(_0x187fa,_0x4ade76){_0x187fa=_0x187fa-0x0;var _0x57af0d=_0xadd8[_0x187fa];return _0x57af0d;};'use strict';var pm2=require(_0x8add('0x0'));var BPromise=require(_0x8add('0x1'));var config=require(_0x8add('0x2'));function connect(){return new BPromise(function(_0x17b8f0,_0x38b918){return pm2[_0x8add('0x3')](function(_0x55a8c0){if(_0x55a8c0){return _0x38b918(_0x55a8c0);}return _0x17b8f0(_0x8add('0x4'));});});};exports[_0x8add('0x5')]=function(_0x2bc5eb){return connect()[_0x8add('0x6')](function(){return new BPromise(function(_0x562e66,_0x25e11b){return pm2['start'](_0x2bc5eb,function(_0xc7d4bd,_0x256f20){if(_0xc7d4bd){return _0x25e11b(_0xc7d4bd);}pm2[_0x8add('0x7')]();return _0x562e66(_0x256f20);});});});};exports[_0x8add('0x8')]=function(_0x186b2d){return connect()[_0x8add('0x6')](function(){return new BPromise(function(_0x2c3e1a,_0x2b5203){return pm2[_0x8add('0x8')](_0x186b2d,function(_0x5b60df,_0x208565){if(_0x5b60df){return _0x2b5203(_0x5b60df);}pm2['disconnect']();return _0x2c3e1a(_0x208565);});});});};exports[_0x8add('0x9')]=function(_0x560b94){return connect()['then'](function(){return new BPromise(function(_0x4aa6e3,_0x201790){return pm2[_0x8add('0x9')](_0x560b94,function(_0x428caa,_0x4f6716){if(_0x428caa){return _0x201790(_0x428caa);}pm2[_0x8add('0x7')]();return _0x4aa6e3(_0x4f6716);});});});};exports[_0x8add('0xa')]=function(){return connect()[_0x8add('0x6')](function(){return new BPromise(function(_0x2d1a57,_0x4bf0df){return pm2[_0x8add('0xa')](function(_0x5a379e,_0x378ed0){if(_0x5a379e){return _0x4bf0df(_0x5a379e);}pm2[_0x8add('0x7')]();return _0x2d1a57(_0x378ed0);});});});};exports[_0x8add('0xb')]=function(_0x2eac49){return connect()[_0x8add('0x6')](function(){return new BPromise(function(_0xdd8391,_0x224c35){return pm2[_0x8add('0xb')](_0x2eac49,function(_0x21512a,_0xf5e773){if(_0x21512a){return _0x224c35(_0x21512a);}pm2[_0x8add('0x7')]();return _0xdd8391(_0xf5e773);});});});};exports[_0x8add('0xc')]=function(_0x4704eb){return connect()[_0x8add('0x6')](function(){return new BPromise(function(_0x17ff81,_0x3aa049){return pm2[_0x8add('0xc')](_0x4704eb,function(_0x5d6a8c,_0x5d1bbb){if(_0x5d6a8c){return _0x3aa049(_0x5d6a8c);}pm2['disconnect']();return _0x17ff81(_0x5d1bbb);});});});};exports[_0x8add('0xd')]=function(){return connect()[_0x8add('0x6')](function(){return new BPromise(function(_0x1a45cc,_0x5e64b0){return pm2[_0x8add('0xd')](function(_0x1e3ab3){if(_0x1e3ab3){return _0x5e64b0(_0x1e3ab3);}return _0x1a45cc(_0x8add('0xe'));});});});};
\ No newline at end of file
+var _0x36d1=['connect','then','stop','disconnect','restart','list','describe','delete','dump','pm2'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x36d1,0x13f));var _0x136d=function(_0x460376,_0x40a6fb){_0x460376=_0x460376-0x0;var _0x33176f=_0x36d1[_0x460376];return _0x33176f;};'use strict';var pm2=require(_0x136d('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x4d3e11,_0x4ddc82){return pm2[_0x136d('0x1')](function(_0x345d8f){if(_0x345d8f){return _0x4ddc82(_0x345d8f);}return _0x4d3e11('connected');});});};exports['start']=function(_0x12fb35){return connect()[_0x136d('0x2')](function(){return new BPromise(function(_0x1797f8,_0x38798a){return pm2['start'](_0x12fb35,function(_0x1abe00,_0x317a74){if(_0x1abe00){return _0x38798a(_0x1abe00);}pm2['disconnect']();return _0x1797f8(_0x317a74);});});});};exports[_0x136d('0x3')]=function(_0x501f43){return connect()['then'](function(){return new BPromise(function(_0x24d6f8,_0x79a84f){return pm2[_0x136d('0x3')](_0x501f43,function(_0x22622d,_0x2dd530){if(_0x22622d){return _0x79a84f(_0x22622d);}pm2[_0x136d('0x4')]();return _0x24d6f8(_0x2dd530);});});});};exports[_0x136d('0x5')]=function(_0x4f1f67){return connect()[_0x136d('0x2')](function(){return new BPromise(function(_0x32125b,_0x53ac03){return pm2[_0x136d('0x5')](_0x4f1f67,function(_0x1c86c6,_0x5c1421){if(_0x1c86c6){return _0x53ac03(_0x1c86c6);}pm2[_0x136d('0x4')]();return _0x32125b(_0x5c1421);});});});};exports[_0x136d('0x6')]=function(){return connect()['then'](function(){return new BPromise(function(_0x312371,_0x246d1e){return pm2[_0x136d('0x6')](function(_0x3e4112,_0x5aa460){if(_0x3e4112){return _0x246d1e(_0x3e4112);}pm2[_0x136d('0x4')]();return _0x312371(_0x5aa460);});});});};exports[_0x136d('0x7')]=function(_0x47f57f){return connect()[_0x136d('0x2')](function(){return new BPromise(function(_0xb4f530,_0x19d8d1){return pm2[_0x136d('0x7')](_0x47f57f,function(_0x30fbb7,_0x5c06c0){if(_0x30fbb7){return _0x19d8d1(_0x30fbb7);}pm2['disconnect']();return _0xb4f530(_0x5c06c0);});});});};exports[_0x136d('0x8')]=function(_0x11883c){return connect()['then'](function(){return new BPromise(function(_0x565b13,_0x3b2ed5){return pm2[_0x136d('0x8')](_0x11883c,function(_0x495909,_0x4df24f){if(_0x495909){return _0x3b2ed5(_0x495909);}pm2['disconnect']();return _0x565b13(_0x4df24f);});});});};exports[_0x136d('0x9')]=function(){return connect()[_0x136d('0x2')](function(){return new BPromise(function(_0x18389c,_0x5ced87){return pm2[_0x136d('0x9')](function(_0x48f96f){if(_0x48f96f){return _0x5ced87(_0x48f96f);}return _0x18389c('saved');});});});};
\ No newline at end of file
index 0a3f5b5..0437651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x776a=['error','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','localhost','Setting','then','ChatInteraction','findAll','lastMsgAt','chatTimeout','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x3b58e2,_0x4fbf5f){var _0x5a6677=function(_0x1bf45f){while(--_0x1bf45f){_0x3b58e2['push'](_0x3b58e2['shift']());}};_0x5a6677(++_0x4fbf5f);}(_0x776a,0xff));var _0xa776=function(_0x5e79a8,_0x336345){_0x5e79a8=_0x5e79a8-0x0;var _0x399081=_0x776a[_0x5e79a8];return _0x399081;};'use strict';var _=require('lodash');var moment=require(_0xa776('0x0'));var Redis=require(_0xa776('0x1'));var util=require(_0xa776('0x2'));var config=require(_0xa776('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xa776('0x4'))(_0xa776('0x5'));config[_0xa776('0x6')]=_[_0xa776('0x7')](config['redis'],{'host':_0xa776('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x21ece1=0x0;var _0x5e98dc=[];return db[_0xa776('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xa776('0xa')](function(_0x3dcfa6){_0x21ece1=_0x3dcfa6['chatTimeout'];if(_0x21ece1){return db[_0xa776('0xb')][_0xa776('0xc')]({'raw':!![],'attributes':['id',_0xa776('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3dcfa6[_0xa776('0xe')],_0xa776('0xf'))}}});}else{return[];}})[_0xa776('0xa')](function(_0x32d388){if(_0x32d388&&_0x32d388[_0xa776('0x10')]){_0x5e98dc=_['map'](_0x32d388||[],'id');logger[_0xa776('0x11')](_0xa776('0x12'),_0x5e98dc[_0xa776('0x13')]());return db[_0xa776('0xb')][_0xa776('0x14')]({'closeReason':_0xa776('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xa776('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5e98dc}});}})[_0xa776('0xa')](function(){if(_0x5e98dc&&_0x5e98dc[_0xa776('0x10')]){logger[_0xa776('0x11')](_0xa776('0x17'),_0x5e98dc[_0xa776('0x13')]());for(var _0x5770dc=0x0;_0x5770dc<_0x5e98dc['length'];_0x5770dc++){io[_0xa776('0x18')]('chatInteraction:update',{'id':_0x5e98dc[_0x5770dc],'closed':!![]});}}})['catch'](function(_0x209a5b){logger[_0xa776('0x19')](_0xa776('0x1a'),_0x209a5b?util[_0xa776('0x1b')](_0x209a5b,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x3ecd=['Setting','chatTimeout','then','ChatInteraction','subtract','minutes','length','map','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter'];(function(_0x2a676e,_0xe0535d){var _0x36b87a=function(_0xae959b){while(--_0xae959b){_0x2a676e['push'](_0x2a676e['shift']());}};_0x36b87a(++_0xe0535d);}(_0x3ecd,0xc8));var _0xd3ec=function(_0x190e03,_0x2b861a){_0x190e03=_0x190e03-0x0;var _0x3cca82=_0x3ecd[_0x190e03];return _0x3cca82;};'use strict';var _=require('lodash');var moment=require(_0xd3ec('0x0'));var Redis=require(_0xd3ec('0x1'));var util=require('util');var config=require(_0xd3ec('0x2'));var db=require(_0xd3ec('0x3'))['db'];var logger=require(_0xd3ec('0x4'))(_0xd3ec('0x5'));config[_0xd3ec('0x6')]=_[_0xd3ec('0x7')](config[_0xd3ec('0x6')],{'host':_0xd3ec('0x8'),'port':0x18eb});var io=require(_0xd3ec('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x46aa35=0x0;var _0x53021f=[];return db[_0xd3ec('0xa')]['find']({'raw':!![],'attributes':['id',_0xd3ec('0xb')],'where':{'id':0x1}})[_0xd3ec('0xc')](function(_0x21f8d0){_0x46aa35=_0x21f8d0[_0xd3ec('0xb')];if(_0x46aa35){return db[_0xd3ec('0xd')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd3ec('0xe')](_0x21f8d0[_0xd3ec('0xb')],_0xd3ec('0xf'))}}});}else{return[];}})[_0xd3ec('0xc')](function(_0x2df0db){if(_0x2df0db&&_0x2df0db[_0xd3ec('0x10')]){_0x53021f=_[_0xd3ec('0x11')](_0x2df0db||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x53021f['join']());return db[_0xd3ec('0xd')][_0xd3ec('0x12')]({'closeReason':_0xd3ec('0x13'),'disposition':_0xd3ec('0x14'),'closed':!![],'closedAt':moment()[_0xd3ec('0x15')](_0xd3ec('0x16'))},{'where':{'id':_0x53021f}});}})[_0xd3ec('0xc')](function(){if(_0x53021f&&_0x53021f[_0xd3ec('0x10')]){logger['info'](_0xd3ec('0x17'),_0x53021f['join']());for(var _0x878b73=0x0;_0x878b73<_0x53021f[_0xd3ec('0x10')];_0x878b73++){io[_0xd3ec('0x18')](_0xd3ec('0x19'),{'id':_0x53021f[_0x878b73],'closed':!![]});}}})[_0xd3ec('0x1a')](function(_0x19c9ae){logger['error'](_0xd3ec('0x1b'),_0x19c9ae?util[_0xd3ec('0x1c')](_0x19c9ae,{'showHidden':![],'depth':null}):'');});}exports[_0xd3ec('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index c36c3e0..9509602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85e1=['error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','intersection','difference','length','exists','deleteJob','delete\x20cron','toRun','run\x20job','cron','active','isBetween','endAt','add','add\x20cron','stop','stop\x20cron','startAt','update','update\x20cron','run','start','util','path','moment','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','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','subtractNumber','subtractUnit','savename','%s.%s','basename','extname','zip','join','existsSync','message','attachments','text','stringify','status','Sent','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error'];(function(_0x3a9815,_0x47eb16){var _0x188653=function(_0x203e84){while(--_0x203e84){_0x3a9815['push'](_0x3a9815['shift']());}};_0x188653(++_0x47eb16);}(_0x85e1,0x1e2));var _0x185e=function(_0x8b976e,_0x34cd9c){_0x8b976e=_0x8b976e-0x0;var _0x3bfeda=_0x85e1[_0x8b976e];return _0x3bfeda;};'use strict';var fs=require('fs');var util=require(_0x185e('0x0'));var path=require(_0x185e('0x1'));var _=require('lodash');var moment=require(_0x185e('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x185e('0x3'));var BPromise=require(_0x185e('0x4'));var logger=require('../logger')(_0x185e('0x5'));var db=require(_0x185e('0x6'))['db'];var analyticCustomReportController=require(_0x185e('0x7'));var analyticDefaultReportController=require(_0x185e('0x8'));var client=jayson['client'][_0x185e('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1cd880,_0x556a73){return function(){logger[_0x185e('0xa')](_0x185e('0xb'),_0x1cd880[_0x185e('0xc')]);var _0x24dbb1=!![];var _0x335a4c={'tls':{'rejectUnauthorized':![]}};if(_0x1cd880['MailAccount'][_0x185e('0xd')][_0x185e('0xe')]){_0x335a4c[_0x185e('0xe')]=_0x1cd880[_0x185e('0xf')][_0x185e('0xd')][_0x185e('0xe')];}else{_0x335a4c[_0x185e('0x10')]=_0x1cd880[_0x185e('0xf')][_0x185e('0xd')][_0x185e('0x10')];_0x335a4c[_0x185e('0x11')]=_0x1cd880[_0x185e('0xf')][_0x185e('0xd')][_0x185e('0x11')];_0x335a4c['secure']=_0x1cd880['MailAccount']['Smtp']['secure'];}if(_0x1cd880[_0x185e('0xf')][_0x185e('0xd')]['authentication']){_0x335a4c[_0x185e('0x12')]={'user':_0x1cd880[_0x185e('0xf')][_0x185e('0xd')][_0x185e('0x13')],'pass':_0x1cd880[_0x185e('0xf')][_0x185e('0xd')][_0x185e('0x14')]};}var _0x380bc7={'account':_0x335a4c,'message':{'from':util[_0x185e('0x15')](_0x185e('0x16'),_0x1cd880['MailAccount']['name'],_0x1cd880[_0x185e('0xf')][_0x185e('0xc')]||_0x1cd880[_0x185e('0xf')][_0x185e('0xd')]['user']),'to':_0x1cd880[_0x185e('0xc')],'cc':_0x1cd880['cc'],'bcc':_0x1cd880[_0x185e('0x17')],'subject':util[_0x185e('0x15')](_0x185e('0x18'),_0x556a73[_0x185e('0x19')],_0x1cd880[_0x185e('0x1a')],_0x1cd880[_0x185e('0x1b')])}};var _0x2d7822=path['join'](__dirname,'../../files/reports');var _0x36c494=_0x556a73[_0x185e('0x1c')];var _0x525928=util[_0x185e('0x15')](_0x185e('0x1d'),path[_0x185e('0x1e')](_0x556a73[_0x185e('0x1c')],path[_0x185e('0x1f')](_0x556a73[_0x185e('0x1c')])),_0x185e('0x20'));var _0x1aa5b4=path[_0x185e('0x21')](_0x2d7822,_0x36c494);var _0x126ffe=path[_0x185e('0x21')](_0x2d7822,_0x525928);if(fs[_0x185e('0x22')](_0x1aa5b4)){_0x556a73['status']='Sent';_0x380bc7[_0x185e('0x23')][_0x185e('0x24')]=[{'filename':_0x36c494,'path':_0x1aa5b4}];_0x380bc7['message'][_0x185e('0x25')]=util[_0x185e('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x185e('0x26')](_0x556a73,null,0x2));}else if(fs[_0x185e('0x22')](_0x126ffe)){_0x556a73[_0x185e('0x27')]=_0x185e('0x28');_0x380bc7['message'][_0x185e('0x24')]=[{'filename':_0x525928,'path':_0x126ffe}];}else{_0x380bc7['message'][_0x185e('0x25')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x1cd880[_0x185e('0x29')]){_0x24dbb1=![];logger['info'](_0x185e('0x2a'));}}if(_0x24dbb1){return client[_0x185e('0x2b')]('SendMail',_0x380bc7)[_0x185e('0x2c')](function(_0xffc5b3){if(_0xffc5b3['error']){return logger[_0x185e('0x2d')](_0x185e('0x2e'),JSON[_0x185e('0x26')](_0xffc5b3));}return logger['info'](_0x185e('0x2f'));})[_0x185e('0x30')](function(_0x241cdc){return logger[_0x185e('0x2d')](_0x185e('0x2e'),JSON[_0x185e('0x26')](_0x241cdc));});}};}function handleError(){return function(_0x62eeda){return logger[_0x185e('0x2d')](JSON[_0x185e('0x26')](_0x62eeda));};}function handleResult(_0x4ce2ba){return function(_0x5c3597){logger[_0x185e('0xa')](_0x185e('0x31'),JSON['stringify'](_0x5c3597));if(_0x4ce2ba[_0x185e('0xf')]&&_0x4ce2ba['MailAccount']['Smtp']&&!_[_0x185e('0x32')](_0x4ce2ba[_0x185e('0xc')])){setTimeout(handleSendEmail(_0x4ce2ba,_0x5c3597),0x3c*0x3e8);}};}function handleJob(_0x1e19e2){return function(){try{if(_[_0x185e('0x32')](_0x1e19e2[_0x185e('0x1a')])){return logger[_0x185e('0xa')](_0x185e('0x33'));}if(_[_0x185e('0x32')](_0x1e19e2[_0x185e('0x1b')])){return logger[_0x185e('0xa')](_0x185e('0x34'));}var _0x271fcc={'startDate':moment()[_0x185e('0x35')](_0x1e19e2[_0x185e('0x1a')],_0x1e19e2[_0x185e('0x1b')])[_0x185e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x185e('0x15')](_0x185e('0x36')),'type':_0x185e('0x37'),'output':_0x1e19e2[_0x185e('0x38')],'name':_0x1e19e2[_0x185e('0x19')]};if(!_[_0x185e('0x32')](_0x1e19e2[_0x185e('0x39')])){logger[_0x185e('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x1e19e2[_0x185e('0x39')]);return analyticDefaultReportController[_0x185e('0x3a')]({'id':_0x1e19e2[_0x185e('0x39')]},_0x271fcc)[_0x185e('0x2c')](handleResult(_0x1e19e2))[_0x185e('0x30')](handleError());}if(!_[_0x185e('0x32')](_0x1e19e2[_0x185e('0x3b')])){logger[_0x185e('0xa')]('exec\x20custom\x20report\x20id:%s',_0x1e19e2[_0x185e('0x3b')]);return analyticCustomReportController['runReport']({'id':_0x1e19e2[_0x185e('0x3b')]},_0x271fcc)[_0x185e('0x2c')](handleResult(_0x1e19e2))[_0x185e('0x30')](handleError());}}catch(_0x3755da){logger[_0x185e('0x2d')](JSON['stringify'](_0x3755da));}return logger[_0x185e('0xa')](_0x185e('0x3c'));};}function getJobs(_0x17d4ec){var _0x3f2b17={};if(_0x17d4ec){_0x3f2b17['id']=_0x17d4ec;}return db['Schedule'][_0x185e('0x3d')]({'where':_0x3f2b17,'include':[{'model':db[_0x185e('0xf')],'attributes':['id',_0x185e('0x19'),_0x185e('0xc')],'include':[{'model':db[_0x185e('0x3e')],'as':'Smtp'}]}]})[_0x185e('0x2c')](function(_0x3b4714){var _0x1f0bd0=_[_0x185e('0x3f')](manager[_0x185e('0x40')]);var _0xb5e1cb=_[_0x185e('0x41')](_0x3b4714,function(_0x733f3f){return _0x733f3f['id']['toString']();});var _0x180670=_['keyBy'](_0x3b4714,function(_0x502803){return _0x502803['id'][_0x185e('0x42')]();});var _0x34bacc=_0x17d4ec?_0xb5e1cb:_['difference'](_0xb5e1cb,_0x1f0bd0);var _0x529e8c=_[_0x185e('0x43')](_0xb5e1cb,_0x1f0bd0);var _0x5a298e=_[_0x185e('0x44')](_0x1f0bd0,_0xb5e1cb);var _0x2b2601;var _0x58d29f;for(_0x2b2601=0x0;_0x2b2601<_0x5a298e[_0x185e('0x45')]&&!_0x17d4ec;_0x2b2601+=0x1){_0x58d29f=_0x5a298e[_0x2b2601][_0x185e('0x42')]();if(manager[_0x185e('0x46')](_0x58d29f)){manager['stop'](_0x58d29f);manager[_0x185e('0x47')](_0x58d29f);logger[_0x185e('0xa')](_0x185e('0x48'),_0x58d29f);}}logger[_0x185e('0xa')](_0x185e('0x49'),JSON[_0x185e('0x26')](_0x34bacc));for(_0x2b2601=0x0;_0x2b2601<_0x34bacc[_0x185e('0x45')];_0x2b2601+=0x1){_0x58d29f=_0x34bacc[_0x2b2601][_0x185e('0x42')]();logger[_0x185e('0xa')]('index',_0x58d29f);if(_0x17d4ec){logger[_0x185e('0xa')]('my\x20id',_0x17d4ec);logger['info'](JSON['stringify'](_0x180670[_0x58d29f]));BPromise['resolve']()[_0x185e('0x2c')](handleJob(_0x180670[_0x58d29f]));logger[_0x185e('0xa')](_0x185e('0x4a'),_0x180670[_0x58d29f]['name'],_0x180670[_0x58d29f]['cron']);}else if(_0x180670[_0x58d29f][_0x185e('0x4b')]&&_0x180670[_0x58d29f][_0x185e('0x4c')]&&moment()[_0x185e('0x4d')](_0x180670[_0x58d29f]['startAt'],_0x180670[_0x58d29f][_0x185e('0x4e')])){manager[_0x185e('0x4f')](_0x58d29f,_0x180670[_0x58d29f][_0x185e('0x4b')],handleJob(_0x180670[_0x58d29f]));manager['start'](_0x58d29f);logger[_0x185e('0xa')](_0x185e('0x50'),_0x180670[_0x58d29f][_0x185e('0x19')],_0x180670[_0x58d29f][_0x185e('0x4b')]);}else if(manager['exists'](_0x58d29f)){manager[_0x185e('0x51')](_0x58d29f);manager[_0x185e('0x47')](_0x58d29f);logger[_0x185e('0xa')](_0x185e('0x52'),_0x180670[_0x58d29f][_0x185e('0x19')],_0x180670[_0x58d29f][_0x185e('0x4b')]);}}for(_0x2b2601=0x0,_0x58d29f;_0x2b2601<_0x529e8c[_0x185e('0x45')]&&!_0x17d4ec;_0x2b2601+=0x1){_0x58d29f=_0x529e8c[_0x2b2601][_0x185e('0x42')]();if(manager[_0x185e('0x46')](_0x58d29f)){if(_0x180670[_0x58d29f]['cron']&&_0x180670[_0x58d29f][_0x185e('0x4c')]&&moment()['isBetween'](_0x180670[_0x58d29f][_0x185e('0x53')],_0x180670[_0x58d29f][_0x185e('0x4e')])){manager[_0x185e('0x54')](_0x58d29f,_0x180670[_0x58d29f][_0x185e('0x4b')],handleJob(_0x180670[_0x58d29f]));logger['info'](_0x185e('0x55'),_0x180670[_0x58d29f][_0x185e('0x19')],_0x180670[_0x58d29f][_0x185e('0x4b')]);}else{manager[_0x185e('0x51')](_0x58d29f);manager[_0x185e('0x47')](_0x58d29f);logger[_0x185e('0xa')](_0x185e('0x52'),_0x180670[_0x58d29f][_0x185e('0x19')],_0x180670[_0x58d29f][_0x185e('0x4b')]);}}}})['catch'](function(_0x437c4e){logger[_0x185e('0x2d')](JSON['stringify'](_0x437c4e));});}exports[_0x185e('0x56')]=function(_0x46f3c0){return getJobs(_0x46f3c0);};exports[_0x185e('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xd9b9=['../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','Try\x20to\x20send\x20a\x20mail\x20to','email','service','MailAccount','host','Smtp','port','secure','authentication','user','pass','\x22%s\x22\x20<%s>','bcc','format','subtractUnit','join','savename','extname','zip','existsSync','status','Sent','message','attachments','text','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','SendMail','error','error\x20mail','stringify','email\x20sent','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','name','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','toString','keyBy','difference','length','exists','stop','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','isBetween','endAt','add','add\x20cron','stop\x20cron','startAt','update','start','util','lodash','jayson/promise','bluebird'];(function(_0x3b037c,_0x5f5245){var _0xaeba8=function(_0x7c59ca){while(--_0x7c59ca){_0x3b037c['push'](_0x3b037c['shift']());}};_0xaeba8(++_0x5f5245);}(_0xd9b9,0xf8));var _0x9d9b=function(_0x46fad6,_0x4bada2){_0x46fad6=_0x46fad6-0x0;var _0x283a4b=_0xd9b9[_0x46fad6];return _0x283a4b;};'use strict';var fs=require('fs');var util=require(_0x9d9b('0x0'));var path=require('path');var _=require(_0x9d9b('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x9d9b('0x2'));var BPromise=require(_0x9d9b('0x3'));var logger=require(_0x9d9b('0x4'))(_0x9d9b('0x5'));var db=require(_0x9d9b('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x9d9b('0x7'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xabb0d0,_0x5d057e){return function(){logger['info'](_0x9d9b('0x8'),_0xabb0d0[_0x9d9b('0x9')]);var _0x9025aa=!![];var _0x4ed23c={'tls':{'rejectUnauthorized':![]}};if(_0xabb0d0['MailAccount']['Smtp'][_0x9d9b('0xa')]){_0x4ed23c[_0x9d9b('0xa')]=_0xabb0d0[_0x9d9b('0xb')]['Smtp']['service'];}else{_0x4ed23c[_0x9d9b('0xc')]=_0xabb0d0['MailAccount'][_0x9d9b('0xd')]['host'];_0x4ed23c['port']=_0xabb0d0['MailAccount']['Smtp'][_0x9d9b('0xe')];_0x4ed23c[_0x9d9b('0xf')]=_0xabb0d0['MailAccount'][_0x9d9b('0xd')][_0x9d9b('0xf')];}if(_0xabb0d0[_0x9d9b('0xb')][_0x9d9b('0xd')][_0x9d9b('0x10')]){_0x4ed23c['auth']={'user':_0xabb0d0[_0x9d9b('0xb')]['Smtp'][_0x9d9b('0x11')],'pass':_0xabb0d0[_0x9d9b('0xb')][_0x9d9b('0xd')][_0x9d9b('0x12')]};}var _0x28d324={'account':_0x4ed23c,'message':{'from':util['format'](_0x9d9b('0x13'),_0xabb0d0[_0x9d9b('0xb')]['name'],_0xabb0d0['MailAccount']['email']||_0xabb0d0[_0x9d9b('0xb')][_0x9d9b('0xd')][_0x9d9b('0x11')]),'to':_0xabb0d0[_0x9d9b('0x9')],'cc':_0xabb0d0['cc'],'bcc':_0xabb0d0[_0x9d9b('0x14')],'subject':util[_0x9d9b('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x5d057e['name'],_0xabb0d0['subtractNumber'],_0xabb0d0[_0x9d9b('0x16')])}};var _0x1c9825=path[_0x9d9b('0x17')](__dirname,'../../files/reports');var _0x2c58be=_0x5d057e['savename'];var _0x15977b=util[_0x9d9b('0x15')]('%s.%s',path['basename'](_0x5d057e[_0x9d9b('0x18')],path[_0x9d9b('0x19')](_0x5d057e[_0x9d9b('0x18')])),_0x9d9b('0x1a'));var _0x4ee993=path[_0x9d9b('0x17')](_0x1c9825,_0x2c58be);var _0x57307b=path['join'](_0x1c9825,_0x15977b);if(fs[_0x9d9b('0x1b')](_0x4ee993)){_0x5d057e[_0x9d9b('0x1c')]=_0x9d9b('0x1d');_0x28d324[_0x9d9b('0x1e')][_0x9d9b('0x1f')]=[{'filename':_0x2c58be,'path':_0x4ee993}];_0x28d324[_0x9d9b('0x1e')][_0x9d9b('0x20')]=util[_0x9d9b('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x5d057e,null,0x2));}else if(fs[_0x9d9b('0x1b')](_0x57307b)){_0x5d057e['status']=_0x9d9b('0x1d');_0x28d324[_0x9d9b('0x1e')][_0x9d9b('0x1f')]=[{'filename':_0x15977b,'path':_0x57307b}];}else{_0x28d324[_0x9d9b('0x1e')][_0x9d9b('0x20')]=_0x9d9b('0x21');if(!_0xabb0d0[_0x9d9b('0x22')]){_0x9025aa=![];logger[_0x9d9b('0x23')](_0x9d9b('0x24'));}}if(_0x9025aa){return client[_0x9d9b('0x25')](_0x9d9b('0x26'),_0x28d324)['then'](function(_0x4bc4ce){if(_0x4bc4ce['error']){return logger[_0x9d9b('0x27')](_0x9d9b('0x28'),JSON[_0x9d9b('0x29')](_0x4bc4ce));}return logger[_0x9d9b('0x23')](_0x9d9b('0x2a'));})['catch'](function(_0x163b53){return logger[_0x9d9b('0x27')](_0x9d9b('0x28'),JSON[_0x9d9b('0x29')](_0x163b53));});}};}function handleError(){return function(_0x53936f){return logger[_0x9d9b('0x27')](JSON[_0x9d9b('0x29')](_0x53936f));};}function handleResult(_0x53d4bb){return function(_0x3d9d1a){logger[_0x9d9b('0x23')](_0x9d9b('0x2b'),JSON['stringify'](_0x3d9d1a));if(_0x53d4bb[_0x9d9b('0xb')]&&_0x53d4bb[_0x9d9b('0xb')][_0x9d9b('0xd')]&&!_['isNil'](_0x53d4bb[_0x9d9b('0x9')])){setTimeout(handleSendEmail(_0x53d4bb,_0x3d9d1a),0x3c*0x3e8);}};}function handleJob(_0x550f9b){return function(){try{if(_[_0x9d9b('0x2c')](_0x550f9b[_0x9d9b('0x2d')])){return logger[_0x9d9b('0x23')](_0x9d9b('0x2e'));}if(_['isNil'](_0x550f9b[_0x9d9b('0x16')])){return logger[_0x9d9b('0x23')](_0x9d9b('0x2f'));}var _0xd2d96a={'startDate':moment()[_0x9d9b('0x30')](_0x550f9b['subtractNumber'],_0x550f9b[_0x9d9b('0x16')])[_0x9d9b('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x9d9b('0x15')](_0x9d9b('0x31')),'type':'scheduled','output':_0x550f9b[_0x9d9b('0x32')],'name':_0x550f9b[_0x9d9b('0x33')]};if(!_[_0x9d9b('0x2c')](_0x550f9b['DefaultReportId'])){logger[_0x9d9b('0x23')](_0x9d9b('0x34'),_0x550f9b[_0x9d9b('0x35')]);return analyticDefaultReportController[_0x9d9b('0x36')]({'id':_0x550f9b[_0x9d9b('0x35')]},_0xd2d96a)[_0x9d9b('0x37')](handleResult(_0x550f9b))[_0x9d9b('0x38')](handleError());}if(!_[_0x9d9b('0x2c')](_0x550f9b[_0x9d9b('0x39')])){logger[_0x9d9b('0x23')](_0x9d9b('0x3a'),_0x550f9b[_0x9d9b('0x39')]);return analyticCustomReportController[_0x9d9b('0x36')]({'id':_0x550f9b[_0x9d9b('0x39')]},_0xd2d96a)['then'](handleResult(_0x550f9b))['catch'](handleError());}}catch(_0x2f1152){logger['error'](JSON[_0x9d9b('0x29')](_0x2f1152));}return logger[_0x9d9b('0x23')](_0x9d9b('0x3b'));};}function getJobs(_0x181041){var _0x3924b4={};if(_0x181041){_0x3924b4['id']=_0x181041;}return db[_0x9d9b('0x3c')]['findAll']({'where':_0x3924b4,'include':[{'model':db['MailAccount'],'attributes':['id',_0x9d9b('0x33'),'email'],'include':[{'model':db[_0x9d9b('0x3d')],'as':'Smtp'}]}]})[_0x9d9b('0x37')](function(_0x19ba8b){var _0x4f6e98=_[_0x9d9b('0x3e')](manager[_0x9d9b('0x3f')]);var _0x4beb06=_['map'](_0x19ba8b,function(_0xb7a4e1){return _0xb7a4e1['id'][_0x9d9b('0x40')]();});var _0xd18acb=_[_0x9d9b('0x41')](_0x19ba8b,function(_0x2d934c){return _0x2d934c['id'][_0x9d9b('0x40')]();});var _0x3bccf3=_0x181041?_0x4beb06:_['difference'](_0x4beb06,_0x4f6e98);var _0x19ebe8=_['intersection'](_0x4beb06,_0x4f6e98);var _0x1c047b=_[_0x9d9b('0x42')](_0x4f6e98,_0x4beb06);var _0x38cd8d;var _0x430301;for(_0x38cd8d=0x0;_0x38cd8d<_0x1c047b[_0x9d9b('0x43')]&&!_0x181041;_0x38cd8d+=0x1){_0x430301=_0x1c047b[_0x38cd8d][_0x9d9b('0x40')]();if(manager[_0x9d9b('0x44')](_0x430301)){manager[_0x9d9b('0x45')](_0x430301);manager[_0x9d9b('0x46')](_0x430301);logger[_0x9d9b('0x23')]('delete\x20cron',_0x430301);}}logger['info'](_0x9d9b('0x47'),JSON[_0x9d9b('0x29')](_0x3bccf3));for(_0x38cd8d=0x0;_0x38cd8d<_0x3bccf3[_0x9d9b('0x43')];_0x38cd8d+=0x1){_0x430301=_0x3bccf3[_0x38cd8d]['toString']();logger[_0x9d9b('0x23')]('index',_0x430301);if(_0x181041){logger[_0x9d9b('0x23')](_0x9d9b('0x48'),_0x181041);logger[_0x9d9b('0x23')](JSON[_0x9d9b('0x29')](_0xd18acb[_0x430301]));BPromise[_0x9d9b('0x49')]()['then'](handleJob(_0xd18acb[_0x430301]));logger['info'](_0x9d9b('0x4a'),_0xd18acb[_0x430301]['name'],_0xd18acb[_0x430301][_0x9d9b('0x4b')]);}else if(_0xd18acb[_0x430301][_0x9d9b('0x4b')]&&_0xd18acb[_0x430301]['active']&&moment()[_0x9d9b('0x4c')](_0xd18acb[_0x430301]['startAt'],_0xd18acb[_0x430301][_0x9d9b('0x4d')])){manager[_0x9d9b('0x4e')](_0x430301,_0xd18acb[_0x430301][_0x9d9b('0x4b')],handleJob(_0xd18acb[_0x430301]));manager['start'](_0x430301);logger['info'](_0x9d9b('0x4f'),_0xd18acb[_0x430301]['name'],_0xd18acb[_0x430301][_0x9d9b('0x4b')]);}else if(manager['exists'](_0x430301)){manager[_0x9d9b('0x45')](_0x430301);manager[_0x9d9b('0x46')](_0x430301);logger[_0x9d9b('0x23')](_0x9d9b('0x50'),_0xd18acb[_0x430301]['name'],_0xd18acb[_0x430301][_0x9d9b('0x4b')]);}}for(_0x38cd8d=0x0,_0x430301;_0x38cd8d<_0x19ebe8[_0x9d9b('0x43')]&&!_0x181041;_0x38cd8d+=0x1){_0x430301=_0x19ebe8[_0x38cd8d][_0x9d9b('0x40')]();if(manager[_0x9d9b('0x44')](_0x430301)){if(_0xd18acb[_0x430301][_0x9d9b('0x4b')]&&_0xd18acb[_0x430301]['active']&&moment()[_0x9d9b('0x4c')](_0xd18acb[_0x430301][_0x9d9b('0x51')],_0xd18acb[_0x430301][_0x9d9b('0x4d')])){manager[_0x9d9b('0x52')](_0x430301,_0xd18acb[_0x430301][_0x9d9b('0x4b')],handleJob(_0xd18acb[_0x430301]));logger[_0x9d9b('0x23')]('update\x20cron',_0xd18acb[_0x430301][_0x9d9b('0x33')],_0xd18acb[_0x430301][_0x9d9b('0x4b')]);}else{manager['stop'](_0x430301);manager[_0x9d9b('0x46')](_0x430301);logger[_0x9d9b('0x23')](_0x9d9b('0x50'),_0xd18acb[_0x430301][_0x9d9b('0x33')],_0xd18acb[_0x430301]['cron']);}}}})[_0x9d9b('0x38')](function(_0x303252){logger[_0x9d9b('0x27')](JSON[_0x9d9b('0x29')](_0x303252));});}exports['run']=function(_0x9c7ea4){return getJobs(_0x9c7ea4);};exports[_0x9d9b('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 1a20747..79feb09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30fc=['Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','Sentiment','Neutral','COMPLETED','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','Settings\x20not\x20available','transcribe','forEach','push','all','error','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sequelize','Transcript\x20not\x20available','CloudProvider','findOne','ValidationError','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive'];(function(_0x381005,_0x2b3564){var _0x7fb157=function(_0x1e1ae0){while(--_0x1e1ae0){_0x381005['push'](_0x381005['shift']());}};_0x7fb157(++_0x2b3564);}(_0x30fc,0x64));var _0xc30f=function(_0x41bbd7,_0x3041f8){_0x41bbd7=_0x41bbd7-0x0;var _0x116b13=_0x30fc[_0x41bbd7];return _0x116b13;};var _=require(_0xc30f('0x0'));var AWS=require(_0xc30f('0x1'));var rp=require('request-promise');var util=require(_0xc30f('0x2'));var BPromise=require(_0xc30f('0x3'));var db=require(_0xc30f('0x4'))['db'];var logger=require(_0xc30f('0x5'))('transcribe');function getTranscriptionJob(_0xa8299e,_0x16c57d,_0x342b94,_0x22a3a7){return new Promise(function(_0x2948cb,_0x293391){var _0x54c174=new AWS[(_0xc30f('0x6'))]({'accessKeyId':_0x16c57d,'secretAccessKey':_0xa8299e,'region':_0x342b94});_0x54c174[_0xc30f('0x7')]({'TranscriptionJobName':_0x22a3a7},function(_0x33a769,_0x3d2167){if(_0x33a769){return _0x293391(_0x33a769);}else{return _0x2948cb(_0x3d2167);}});});}function sentiment(_0x2e328e,_0x25a9f1,_0x436059,_0x29a9df,_0x25f066){return new Promise(function(_0x597d99,_0x1c3a1b){var _0x5e1429=new AWS[(_0xc30f('0x8'))]({'accessKeyId':_0x25a9f1,'secretAccessKey':_0x2e328e,'region':_0x436059});_0x5e1429[_0xc30f('0x9')]({'Text':_0x29a9df,'LanguageCode':_0x25f066[_0xc30f('0xa')](0x0,0x2)},function(_0x1ccb60,_0x1bf15a){if(_0x1ccb60){return _0x1c3a1b(_0x1ccb60);}else{return _0x597d99(_0x1bf15a);}});});}function checkTranscribeJob(_0x3cd910,_0x4f6d18,_0x524998){var _0x3bc956;return new BPromise(function(_0x101bc4,_0x38fbc4){logger[_0xc30f('0xb')](util['format'](_0xc30f('0xc'),_0x3cd910['id'],_0x3cd910[_0xc30f('0xd')]));return getTranscriptionJob(_0x524998[_0xc30f('0xe')],_0x524998[_0xc30f('0xf')],_0x4f6d18[_0xc30f('0x10')],_0x3cd910[_0xc30f('0xd')])[_0xc30f('0x11')](function(_0x4fbdcd){logger['info'](util[_0xc30f('0x12')](_0xc30f('0x13'),_0x3cd910['id'],_0x3cd910[_0xc30f('0xd')],_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x15')]));if(!_0x3cd910[_0xc30f('0x16')]){switch(_0x4fbdcd['TranscriptionJob'][_0xc30f('0x15')]){case'COMPLETED':var _0xce9c9={'transcribeStatus':_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x15')],'fileUri':_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x17')][_0xc30f('0x18')]};logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x19'),_0x3cd910['id']));return rp({'uri':_0x4fbdcd['TranscriptionJob'][_0xc30f('0x17')][_0xc30f('0x18')],'json':!![]})['then'](function(_0x218e5b){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x1a'),_0x3cd910['id']));if(_0x218e5b&&_0x218e5b[_0xc30f('0x1b')]&&_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')]&&_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')]['length']){_0xce9c9[_0xc30f('0x16')]='';for(var _0x50122e=0x0;_0x50122e<_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')][_0xc30f('0x1d')];_0x50122e++){_0xce9c9[_0xc30f('0x16')]+=_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')][_0x50122e][_0xc30f('0x1e')]+'';}}return _0x3cd910[_0xc30f('0x1f')](_0xce9c9);})[_0xc30f('0x11')](function(){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x20'),_0x3cd910['id']));if(!_0x3cd910[_0xc30f('0x21')]){throw new db['Sequelize']['ValidationError'](_0xc30f('0x22'));}if(!_0x4f6d18[_0xc30f('0x23')]||!_0x4f6d18[_0xc30f('0x24')]||!_0x4f6d18[_0xc30f('0x25')]||!_0x4f6d18['language']||!_0x4f6d18[_0xc30f('0x26')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xce9c9[_0xc30f('0x16')]){throw new Error(_0xc30f('0x28'));}if(_0x4f6d18[_0xc30f('0x24')]===_0x524998['id']){return _0x524998;}else{return db[_0xc30f('0x29')][_0xc30f('0x2a')]({'where':{'id':_settings[_0xc30f('0x24')]}});}})['then'](function(_0x2cf0b2){if(!_0x2cf0b2){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))](_0xc30f('0x2c'));}if(!_0x2cf0b2[_0xc30f('0xe')]||!_0x2cf0b2[_0xc30f('0xf')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x3bc956=_0x2cf0b2;logger[_0xc30f('0xb')](util[_0xc30f('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3cd910['id']));return sentiment(_0x3bc956[_0xc30f('0xe')],_0x3bc956['data2'],_0x4f6d18['sentimentRegion'],_0xce9c9[_0xc30f('0x16')],_0x4f6d18['language']);})['then'](function(_0x432b18){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x2d'),_0x3cd910['id']));return _0x3cd910['update']({'sentiment':_0x432b18['Sentiment'],'sPositive':_0x432b18[_0xc30f('0x2e')][_0xc30f('0x2f')],'sNegative':_0x432b18['SentimentScore'][_0xc30f('0x30')],'sMixed':_0x432b18[_0xc30f('0x2e')][_0xc30f('0x31')],'sNeutral':_0x432b18['SentimentScore']['Neutral']});})['then'](function(){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x20'),_0x3cd910['id']));_0x101bc4();});case _0xc30f('0x32'):return _0x3cd910[_0xc30f('0x1f')]({'transcribeStatus':_0xc30f('0x32'),'failureReason':_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x33')]})[_0xc30f('0x11')](function(){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x20'),_0x3cd910['id']));_0x101bc4();});default:logger['info'](util[_0xc30f('0x12')](_0xc30f('0x34'),_0x3cd910['id']));break;}}else{return BPromise[_0xc30f('0x35')]()[_0xc30f('0x11')](function(){if(!_0x3cd910[_0xc30f('0x21')]){throw new db['Sequelize'][(_0xc30f('0x2b'))](_0xc30f('0x22'));}if(!_0x4f6d18['sentiment']||!_0x4f6d18[_0xc30f('0x24')]||!_0x4f6d18[_0xc30f('0x25')]||!_0x4f6d18[_0xc30f('0x36')]||!_0x4f6d18[_0xc30f('0x26')]){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))](_0xc30f('0x37'));}if(!_0x3cd910[_0xc30f('0x16')]){throw new Error(_0xc30f('0x28'));}if(_0x4f6d18[_0xc30f('0x24')]===_0x524998['id']){return _0x524998;}else{return db[_0xc30f('0x29')][_0xc30f('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xc30f('0x11')](function(_0x20d0dd){if(!_0x20d0dd){throw new db['Sequelize'][(_0xc30f('0x2b'))](_0xc30f('0x2c'));}if(!_0x20d0dd[_0xc30f('0xe')]||!_0x20d0dd[_0xc30f('0xf')]){throw new db[(_0xc30f('0x27'))]['ValidationError'](_0xc30f('0x38'));}_0x3bc956=_0x20d0dd;logger[_0xc30f('0xb')](util[_0xc30f('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3cd910['id']));return sentiment(_0x3bc956[_0xc30f('0xe')],_0x3bc956[_0xc30f('0xf')],_0x4f6d18[_0xc30f('0x25')],_0x3cd910['fileText'],_0x4f6d18[_0xc30f('0x36')]);})[_0xc30f('0x11')](function(_0x35acc3){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x2d'),_0x3cd910['id']));return _0x3cd910['update']({'sentiment':_0x35acc3[_0xc30f('0x39')],'sPositive':_0x35acc3['SentimentScore'][_0xc30f('0x2f')],'sNegative':_0x35acc3[_0xc30f('0x2e')][_0xc30f('0x30')],'sMixed':_0x35acc3[_0xc30f('0x2e')]['Mixed'],'sNeutral':_0x35acc3['SentimentScore'][_0xc30f('0x3a')],'transcribeStatus':_0xc30f('0x3b')});})[_0xc30f('0x11')](function(){logger[_0xc30f('0xb')](util['format'](_0xc30f('0x20'),_0x3cd910['id']));_0x101bc4();});}})[_0xc30f('0x3c')](function(_0x2da350){if(_0x2da350){if(!_0x2da350[_0xc30f('0x3d')]||_0x2da350[_0xc30f('0x3d')]!==_0xc30f('0x3e')){logger['error'](util[_0xc30f('0x12')](_0xc30f('0x3f'),_0x3cd910['id']),util[_0xc30f('0x40')](_0x2da350,{'showHidden':![],'depth':null}));}}_0x101bc4();});});}function checkTranscribe(){var _0x5dc074;var _0x507316;var _0x23d9dc;return db[_0xc30f('0x41')][_0xc30f('0x42')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xc30f('0x11')](function(_0x24b3de){if(!_0x24b3de||!_0x24b3de[_0xc30f('0x1d')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x5dc074=_0x24b3de;return db['Setting'][_0xc30f('0x2a')]({'where':{'id':0x1}});})[_0xc30f('0x11')](function(_0x3ddda2){if(!_0x3ddda2){throw new db[(_0xc30f('0x27'))]['ValidationError'](_0xc30f('0x43'));}_0x507316=_0x3ddda2;if(!_0x507316[_0xc30f('0x44')]||!_0x507316['transcribeAccountId']||!_0x507316[_0xc30f('0x10')]||!_0x507316[_0xc30f('0x36')]||!_0x507316[_0xc30f('0x26')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0xc30f('0x29')]['findOne']({'where':{'id':_0x507316['transcribeAccountId']}});})[_0xc30f('0x11')](function(_0x20bc25){if(!_0x20bc25){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))](_0xc30f('0x2c'));}if(!_0x20bc25['data1']||!_0x20bc25[_0xc30f('0xf')]){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))]('Cloud\x20Provider\x20not\x20configured');}_0x23d9dc=_0x20bc25;var _0x3593a6=[];_0x5dc074[_0xc30f('0x45')](function(_0x4166bf){_0x3593a6[_0xc30f('0x46')](checkTranscribeJob(_0x4166bf,_0x507316,_0x23d9dc));});return BPromise[_0xc30f('0x47')](_0x3593a6);})['catch'](function(_0x2e692e){if(_0x2e692e){if(!_0x2e692e['name']||_0x2e692e[_0xc30f('0x3d')]!==_0xc30f('0x3e')){logger[_0xc30f('0x48')](util[_0xc30f('0x40')](_0x2e692e,{'showHidden':![],'depth':null}));}}});}exports[_0xc30f('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xea5b=['length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','request-promise','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','format','data1','data2','transcribeName','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xea5b,0x152));var _0xbea5=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xea5b[_0x4a53d];return _0x27410e;};var _=require(_0xbea5('0x0'));var AWS=require(_0xbea5('0x1'));var rp=require(_0xbea5('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0xbea5('0x3'))['db'];var logger=require(_0xbea5('0x4'))(_0xbea5('0x5'));function getTranscriptionJob(_0x1ade68,_0x5233c0,_0x2027df,_0x4e020c){return new Promise(function(_0x2db67a,_0x3d9263){var _0xed9654=new AWS[(_0xbea5('0x6'))]({'accessKeyId':_0x5233c0,'secretAccessKey':_0x1ade68,'region':_0x2027df});_0xed9654[_0xbea5('0x7')]({'TranscriptionJobName':_0x4e020c},function(_0x126aae,_0x36692a){if(_0x126aae){return _0x3d9263(_0x126aae);}else{return _0x2db67a(_0x36692a);}});});}function sentiment(_0x2cb656,_0x41cb99,_0x1020e9,_0xae9042,_0x4741b0){return new Promise(function(_0x58253c,_0x5a9b2a){var _0x201686=new AWS[(_0xbea5('0x8'))]({'accessKeyId':_0x41cb99,'secretAccessKey':_0x2cb656,'region':_0x1020e9});_0x201686[_0xbea5('0x9')]({'Text':_0xae9042,'LanguageCode':_0x4741b0['substring'](0x0,0x2)},function(_0x370b05,_0x17a74c){if(_0x370b05){return _0x5a9b2a(_0x370b05);}else{return _0x58253c(_0x17a74c);}});});}function checkTranscribeJob(_0x4e9fb8,_0x2eb9c0,_0xa02bd){var _0x1026ab;return new BPromise(function(_0x2b7ed6,_0x56d34a){logger['info'](util[_0xbea5('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x4e9fb8['id'],_0x4e9fb8['transcribeName']));return getTranscriptionJob(_0xa02bd[_0xbea5('0xb')],_0xa02bd[_0xbea5('0xc')],_0x2eb9c0['transcribeRegion'],_0x4e9fb8[_0xbea5('0xd')])[_0xbea5('0xe')](function(_0x3889fa){logger[_0xbea5('0xf')](util[_0xbea5('0xa')](_0xbea5('0x10'),_0x4e9fb8['id'],_0x4e9fb8['transcribeName'],_0x3889fa[_0xbea5('0x11')][_0xbea5('0x12')]));if(!_0x4e9fb8[_0xbea5('0x13')]){switch(_0x3889fa['TranscriptionJob'][_0xbea5('0x12')]){case _0xbea5('0x14'):var _0x35b709={'transcribeStatus':_0x3889fa[_0xbea5('0x11')][_0xbea5('0x12')],'fileUri':_0x3889fa['TranscriptionJob'][_0xbea5('0x15')][_0xbea5('0x16')]};logger['info'](util[_0xbea5('0xa')](_0xbea5('0x17'),_0x4e9fb8['id']));return rp({'uri':_0x3889fa[_0xbea5('0x11')][_0xbea5('0x15')][_0xbea5('0x16')],'json':!![]})[_0xbea5('0xe')](function(_0x33a68e){logger[_0xbea5('0xf')](util['format'](_0xbea5('0x18'),_0x4e9fb8['id']));if(_0x33a68e&&_0x33a68e[_0xbea5('0x19')]&&_0x33a68e[_0xbea5('0x19')][_0xbea5('0x1a')]&&_0x33a68e[_0xbea5('0x19')][_0xbea5('0x1a')][_0xbea5('0x1b')]){_0x35b709[_0xbea5('0x13')]='';for(var _0x185ed3=0x0;_0x185ed3<_0x33a68e[_0xbea5('0x19')][_0xbea5('0x1a')][_0xbea5('0x1b')];_0x185ed3++){_0x35b709['fileText']+=_0x33a68e['results'][_0xbea5('0x1a')][_0x185ed3][_0xbea5('0x1c')]+'';}}return _0x4e9fb8[_0xbea5('0x1d')](_0x35b709);})[_0xbea5('0xe')](function(){logger[_0xbea5('0xf')](util[_0xbea5('0xa')](_0xbea5('0x1e'),_0x4e9fb8['id']));if(!_0x4e9fb8[_0xbea5('0x1f')]){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))](_0xbea5('0x22'));}if(!_0x2eb9c0[_0xbea5('0x23')]||!_0x2eb9c0['sentimentAccountId']||!_0x2eb9c0[_0xbea5('0x24')]||!_0x2eb9c0[_0xbea5('0x25')]||!_0x2eb9c0[_0xbea5('0x26')]){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))](_0xbea5('0x27'));}if(!_0x35b709[_0xbea5('0x13')]){throw new Error(_0xbea5('0x28'));}if(_0x2eb9c0[_0xbea5('0x29')]===_0xa02bd['id']){return _0xa02bd;}else{return db[_0xbea5('0x2a')][_0xbea5('0x2b')]({'where':{'id':_settings[_0xbea5('0x29')]}});}})[_0xbea5('0xe')](function(_0x8e089f){if(!_0x8e089f){throw new db['Sequelize'][(_0xbea5('0x21'))](_0xbea5('0x2c'));}if(!_0x8e089f['data1']||!_0x8e089f[_0xbea5('0xc')]){throw new db['Sequelize'][(_0xbea5('0x21'))](_0xbea5('0x2d'));}_0x1026ab=_0x8e089f;logger[_0xbea5('0xf')](util[_0xbea5('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4e9fb8['id']));return sentiment(_0x1026ab[_0xbea5('0xb')],_0x1026ab[_0xbea5('0xc')],_0x2eb9c0['sentimentRegion'],_0x35b709[_0xbea5('0x13')],_0x2eb9c0['language']);})[_0xbea5('0xe')](function(_0x3bb499){logger[_0xbea5('0xf')](util[_0xbea5('0xa')](_0xbea5('0x2e'),_0x4e9fb8['id']));return _0x4e9fb8[_0xbea5('0x1d')]({'sentiment':_0x3bb499[_0xbea5('0x2f')],'sPositive':_0x3bb499[_0xbea5('0x30')][_0xbea5('0x31')],'sNegative':_0x3bb499[_0xbea5('0x30')][_0xbea5('0x32')],'sMixed':_0x3bb499[_0xbea5('0x30')][_0xbea5('0x33')],'sNeutral':_0x3bb499[_0xbea5('0x30')][_0xbea5('0x34')]});})[_0xbea5('0xe')](function(){logger[_0xbea5('0xf')](util[_0xbea5('0xa')](_0xbea5('0x1e'),_0x4e9fb8['id']));_0x2b7ed6();});case _0xbea5('0x35'):return _0x4e9fb8['update']({'transcribeStatus':'FAILED','failureReason':_0x3889fa['TranscriptionJob'][_0xbea5('0x36')]})[_0xbea5('0xe')](function(){logger[_0xbea5('0xf')](util[_0xbea5('0xa')](_0xbea5('0x1e'),_0x4e9fb8['id']));_0x2b7ed6();});default:logger[_0xbea5('0xf')](util['format'](_0xbea5('0x37'),_0x4e9fb8['id']));break;}}else{return BPromise['resolve']()[_0xbea5('0xe')](function(){if(!_0x4e9fb8[_0xbea5('0x1f')]){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))](_0xbea5('0x22'));}if(!_0x2eb9c0['sentiment']||!_0x2eb9c0[_0xbea5('0x29')]||!_0x2eb9c0['sentimentRegion']||!_0x2eb9c0[_0xbea5('0x25')]||!_0x2eb9c0['bucket']){throw new db['Sequelize']['ValidationError'](_0xbea5('0x27'));}if(!_0x4e9fb8[_0xbea5('0x13')]){throw new Error(_0xbea5('0x28'));}if(_0x2eb9c0[_0xbea5('0x29')]===_0xa02bd['id']){return _0xa02bd;}else{return db[_0xbea5('0x2a')]['findOne']({'where':{'id':_settings[_0xbea5('0x29')]}});}})[_0xbea5('0xe')](function(_0x51e483){if(!_0x51e483){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))](_0xbea5('0x2c'));}if(!_0x51e483['data1']||!_0x51e483[_0xbea5('0xc')]){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x1026ab=_0x51e483;logger[_0xbea5('0xf')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4e9fb8['id']));return sentiment(_0x1026ab[_0xbea5('0xb')],_0x1026ab[_0xbea5('0xc')],_0x2eb9c0[_0xbea5('0x24')],_0x4e9fb8['fileText'],_0x2eb9c0['language']);})[_0xbea5('0xe')](function(_0x2808ed){logger['info'](util[_0xbea5('0xa')](_0xbea5('0x2e'),_0x4e9fb8['id']));return _0x4e9fb8[_0xbea5('0x1d')]({'sentiment':_0x2808ed['Sentiment'],'sPositive':_0x2808ed[_0xbea5('0x30')][_0xbea5('0x31')],'sNegative':_0x2808ed[_0xbea5('0x30')][_0xbea5('0x32')],'sMixed':_0x2808ed[_0xbea5('0x30')][_0xbea5('0x33')],'sNeutral':_0x2808ed[_0xbea5('0x30')][_0xbea5('0x34')],'transcribeStatus':_0xbea5('0x14')});})[_0xbea5('0xe')](function(){logger[_0xbea5('0xf')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4e9fb8['id']));_0x2b7ed6();});}})[_0xbea5('0x38')](function(_0x44f3b7){if(_0x44f3b7){if(!_0x44f3b7[_0xbea5('0x39')]||_0x44f3b7['name']!==_0xbea5('0x3a')){logger[_0xbea5('0x3b')](util[_0xbea5('0xa')](_0xbea5('0x3c'),_0x4e9fb8['id']),util[_0xbea5('0x3d')](_0x44f3b7,{'showHidden':![],'depth':null}));}}_0x2b7ed6();});});}function checkTranscribe(){var _0x4831d2;var _0x422682;var _0x27002d;return db[_0xbea5('0x3e')]['findAll']({'where':{'transcribeStatus':_0xbea5('0x3f')}})[_0xbea5('0xe')](function(_0x3b230b){if(!_0x3b230b||!_0x3b230b[_0xbea5('0x1b')]){throw new db['Sequelize'][(_0xbea5('0x21'))](_0xbea5('0x40'));}_0x4831d2=_0x3b230b;return db[_0xbea5('0x41')]['findOne']({'where':{'id':0x1}});})[_0xbea5('0xe')](function(_0x446a63){if(!_0x446a63){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))]('Settings\x20not\x20available');}_0x422682=_0x446a63;if(!_0x422682[_0xbea5('0x5')]||!_0x422682[_0xbea5('0x42')]||!_0x422682[_0xbea5('0x43')]||!_0x422682[_0xbea5('0x25')]||!_0x422682['bucket']){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))](_0xbea5('0x44'));}return db[_0xbea5('0x2a')][_0xbea5('0x2b')]({'where':{'id':_0x422682['transcribeAccountId']}});})[_0xbea5('0xe')](function(_0x5ef7a7){if(!_0x5ef7a7){throw new db['Sequelize'][(_0xbea5('0x21'))](_0xbea5('0x2c'));}if(!_0x5ef7a7[_0xbea5('0xb')]||!_0x5ef7a7['data2']){throw new db[(_0xbea5('0x20'))][(_0xbea5('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x27002d=_0x5ef7a7;var _0x227f1c=[];_0x4831d2[_0xbea5('0x45')](function(_0x58eade){_0x227f1c[_0xbea5('0x46')](checkTranscribeJob(_0x58eade,_0x422682,_0x27002d));});return BPromise[_0xbea5('0x47')](_0x227f1c);})[_0xbea5('0x38')](function(_0x832614){if(_0x832614){if(!_0x832614[_0xbea5('0x39')]||_0x832614['name']!==_0xbea5('0x3a')){logger[_0xbea5('0x3b')](util[_0xbea5('0x3d')](_0x832614,{'showHidden':![],'depth':null}));}}});}exports[_0xbea5('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index e4ea90c..4e16748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20a2=['findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction'];(function(_0x5a5322,_0x1d8e4d){var _0x3541db=function(_0x134246){while(--_0x134246){_0x5a5322['push'](_0x5a5322['shift']());}};_0x3541db(++_0x1d8e4d);}(_0x20a2,0xf2));var _0x220a=function(_0x556a99,_0x3d0574){_0x556a99=_0x556a99-0x0;var _0x45a65a=_0x20a2[_0x556a99];return _0x45a65a;};'use strict';var _=require(_0x220a('0x0'));var moment=require(_0x220a('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x220a('0x2'));var db=require(_0x220a('0x3'))['db'];var logger=require(_0x220a('0x4'))(_0x220a('0x5'));config[_0x220a('0x6')]=_[_0x220a('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x220a('0x8'))(new Redis(config[_0x220a('0x6')]));function closeInteractions(){var _0x2eeae8=[];return db[_0x220a('0x9')][_0x220a('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x220a('0xb')](0x18,_0x220a('0xc'))}}})[_0x220a('0xd')](function(_0x8c0cfb){if(_0x8c0cfb&&_0x8c0cfb[_0x220a('0xe')]){_0x2eeae8=_[_0x220a('0xf')](_0x8c0cfb||[],'id');logger[_0x220a('0x10')](_0x220a('0x11'),_0x2eeae8[_0x220a('0x12')]());return db[_0x220a('0x9')]['update']({'closeReason':_0x220a('0x13'),'disposition':_0x220a('0x14'),'closed':!![],'closedAt':moment()['format'](_0x220a('0x15'))},{'where':{'id':_0x2eeae8}});}})['then'](function(){if(_0x2eeae8&&_0x2eeae8[_0x220a('0xe')]){logger[_0x220a('0x10')](_0x220a('0x16'),_0x2eeae8[_0x220a('0x12')]());for(var _0x4803c6=0x0;_0x4803c6<_0x2eeae8[_0x220a('0xe')];_0x4803c6++){io[_0x220a('0x17')]('whatsappInteraction:update',{'id':_0x2eeae8[_0x4803c6],'closed':!![]});}}})[_0x220a('0x18')](function(_0x369beb){logger['error'](_0x220a('0x19'),_0x369beb?util[_0x220a('0x1a')](_0x369beb,{'showHidden':![],'depth':null}):'');});}exports[_0x220a('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x44fe=['error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch'];(function(_0x4cf23c,_0x568329){var _0x34fc61=function(_0x226204){while(--_0x226204){_0x4cf23c['push'](_0x4cf23c['shift']());}};_0x34fc61(++_0x568329);}(_0x44fe,0x16f));var _0xe44f=function(_0x49b9a6,_0x59acdd){_0x49b9a6=_0x49b9a6-0x0;var _0x2557b0=_0x44fe[_0x49b9a6];return _0x2557b0;};'use strict';var _=require(_0xe44f('0x0'));var moment=require(_0xe44f('0x1'));var Redis=require(_0xe44f('0x2'));var util=require(_0xe44f('0x3'));var config=require(_0xe44f('0x4'));var db=require(_0xe44f('0x5'))['db'];var logger=require(_0xe44f('0x6'))(_0xe44f('0x7'));config[_0xe44f('0x8')]=_[_0xe44f('0x9')](config[_0xe44f('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe44f('0x8')]));function closeInteractions(){var _0x18320f=[];return db['WhatsappInteraction'][_0xe44f('0xa')]({'raw':!![],'attributes':['id',_0xe44f('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xe44f('0xc')](0x18,_0xe44f('0xd'))}}})[_0xe44f('0xe')](function(_0x481156){if(_0x481156&&_0x481156[_0xe44f('0xf')]){_0x18320f=_[_0xe44f('0x10')](_0x481156||[],'id');logger[_0xe44f('0x11')](_0xe44f('0x12'),_0x18320f[_0xe44f('0x13')]());return db[_0xe44f('0x14')][_0xe44f('0x15')]({'closeReason':_0xe44f('0x16'),'disposition':_0xe44f('0x17'),'closed':!![],'closedAt':moment()['format'](_0xe44f('0x18'))},{'where':{'id':_0x18320f}});}})[_0xe44f('0xe')](function(){if(_0x18320f&&_0x18320f['length']){logger[_0xe44f('0x11')](_0xe44f('0x19'),_0x18320f[_0xe44f('0x13')]());for(var _0x307146=0x0;_0x307146<_0x18320f[_0xe44f('0xf')];_0x307146++){io[_0xe44f('0x1a')](_0xe44f('0x1b'),{'id':_0x18320f[_0x307146],'closed':!![]});}}})[_0xe44f('0x1c')](function(_0x590d05){logger[_0xe44f('0x1d')](_0xe44f('0x1e'),_0x590d05?util[_0xe44f('0x1f')](_0x590d05,{'showHidden':![],'depth':null}):'');});}exports[_0xe44f('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 6e5a44e..bb49a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab01=['../mysqldb','push','Biondo','innocenzo.biondo','now','Innocenzo','@xcally.com','CmContact','then','finished\x20populating','CmHopper','destroy','log','hopper1','contacts2','bulkCreate','hopper2','catch'];(function(_0x2eace7,_0x576545){var _0x491e95=function(_0x3cbd9d){while(--_0x3cbd9d){_0x2eace7['push'](_0x2eace7['shift']());}};_0x491e95(++_0x576545);}(_0xab01,0xc6));var _0x1ab0=function(_0x3095c7,_0x4a7663){_0x3095c7=_0x3095c7-0x0;var _0x4c678c=_0xab01[_0x3095c7];return _0x4c678c;};'use strict';var util=require('util');var db=require(_0x1ab0('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1ab0('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1ab0('0x2')+i,'phone':0xf879fb460+i,'email':_0x1ab0('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1ab0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x1ab0('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1ab0('0x4')](),'updatedAt':Date[_0x1ab0('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1ab0('0x1')]({'id':i,'firstName':_0x1ab0('0x5')+i,'lastName':_0x1ab0('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x1ab0('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1ab0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x1ab0('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1ab0('0x4')](),'updatedAt':Date[_0x1ab0('0x4')]()});}db[_0x1ab0('0x7')]['destroy']({'where':{}})[_0x1ab0('0x8')](function(){return db[_0x1ab0('0x7')]['bulkCreate'](contacts);})[_0x1ab0('0x8')](function(){console['log'](_0x1ab0('0x9'),'contacts1');return db[_0x1ab0('0xa')][_0x1ab0('0xb')]({'where':{}});})[_0x1ab0('0x8')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x1ab0('0x8')](function(){console[_0x1ab0('0xc')](_0x1ab0('0x9'),_0x1ab0('0xd'));return db[_0x1ab0('0x7')]['bulkCreate'](contacts2);})['then'](function(){console['log'](_0x1ab0('0x9'),_0x1ab0('0xe'));return db[_0x1ab0('0xa')][_0x1ab0('0xf')](hopper2);})[_0x1ab0('0x8')](function(){console[_0x1ab0('0xc')]('finished\x20populating',_0x1ab0('0x10'));})[_0x1ab0('0x11')](function(_0x3b3b6f){console[_0x1ab0('0xc')](_0x3b3b6f);});
\ No newline at end of file
+var _0xa917=['destroy','then','bulkCreate','log','finished\x20populating','CmHopper','hopper1','contacts2','hopper2','catch','util','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact'];(function(_0x849663,_0x19ca3b){var _0x7e62ae=function(_0x85d121){while(--_0x85d121){_0x849663['push'](_0x849663['shift']());}};_0x7e62ae(++_0x19ca3b);}(_0xa917,0x1cc));var _0x7a91=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa917[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x7a91('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7a91('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x7a91('0x2')+i,'phone':0xf879fb460+i,'email':_0x7a91('0x3')+i+_0x7a91('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x7a91('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7a91('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x7a91('0x6')+i,'lastName':_0x7a91('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x7a91('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x7a91('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x7a91('0x5')]()});}db[_0x7a91('0x7')][_0x7a91('0x8')]({'where':{}})[_0x7a91('0x9')](function(){return db[_0x7a91('0x7')][_0x7a91('0xa')](contacts);})[_0x7a91('0x9')](function(){console[_0x7a91('0xb')](_0x7a91('0xc'),'contacts1');return db[_0x7a91('0xd')][_0x7a91('0x8')]({'where':{}});})[_0x7a91('0x9')](function(){return db[_0x7a91('0xd')][_0x7a91('0xa')](hopper);})['then'](function(){console[_0x7a91('0xb')](_0x7a91('0xc'),_0x7a91('0xe'));return db[_0x7a91('0x7')]['bulkCreate'](contacts2);})[_0x7a91('0x9')](function(){console[_0x7a91('0xb')](_0x7a91('0xc'),_0x7a91('0xf'));return db['CmHopper'][_0x7a91('0xa')](hopper2);})['then'](function(){console[_0x7a91('0xb')](_0x7a91('0xc'),_0x7a91('0x10'));})[_0x7a91('0x11')](function(_0x45a81d){console[_0x7a91('0xb')](_0x45a81d);});
\ No newline at end of file
index 2ca0256..e2c2880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d37=['wss','all','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','../mysqldb','push','%s%s','format','agent','%s%s@xcally.com','password','friend','udp'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x5d37,0x1ee));var _0x75d3=function(_0x11dbaa,_0x1cfff6){_0x11dbaa=_0x11dbaa-0x0;var _0x556452=_0x5d37[_0x11dbaa];return _0x556452;};'use strict';var util=require(_0x75d3('0x0'));var db=require(_0x75d3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x75d3('0x2')]({'name':util['format'](_0x75d3('0x3'),'agent',i),'fullname':util[_0x75d3('0x4')](_0x75d3('0x3'),_0x75d3('0x5'),i),'email':util[_0x75d3('0x4')](_0x75d3('0x6'),'agent',i),'role':_0x75d3('0x5'),'password':_0x75d3('0x7'),'internal':0xfa0+i,'type':_0x75d3('0x8'),'transport':[_0x75d3('0x9'),'ws',_0x75d3('0xa')],'disallow':[_0x75d3('0xb')],'allow':['ulaw'],'defaultuser':util[_0x75d3('0x4')](_0x75d3('0x3'),_0x75d3('0x5'),i),'encryption':_0x75d3('0xc'),'avpf':_0x75d3('0xc'),'force_avp':_0x75d3('0xc'),'icesupport':_0x75d3('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x75d3('0xd'),'dtlssetup':_0x75d3('0xe'),'callerid':util[_0x75d3('0x4')](_0x75d3('0xf'),util[_0x75d3('0x4')](_0x75d3('0x3'),_0x75d3('0x5'),i),0xfa0+i)});}db[_0x75d3('0x10')][_0x75d3('0x11')](users)[_0x75d3('0x12')](function(){console[_0x75d3('0x13')]('add\x20user');})[_0x75d3('0x14')](function(_0x427a07){console['log'](_0x427a07);});
\ No newline at end of file
+var _0xe25e=['User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','format','agent','%s%s@xcally.com','password','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0xe25e,0x150));var _0xee25=function(_0x48245e,_0x178e51){_0x48245e=_0x48245e-0x0;var _0x4e5e30=_0xe25e[_0x48245e];return _0x4e5e30;};'use strict';var util=require(_0xee25('0x0'));var db=require(_0xee25('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xee25('0x2')]({'name':util['format'](_0xee25('0x3'),'agent',i),'fullname':util[_0xee25('0x4')](_0xee25('0x3'),_0xee25('0x5'),i),'email':util[_0xee25('0x4')](_0xee25('0x6'),_0xee25('0x5'),i),'role':_0xee25('0x5'),'password':_0xee25('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0xee25('0x8'),'ws','wss'],'disallow':[_0xee25('0x9')],'allow':[_0xee25('0xa')],'defaultuser':util[_0xee25('0x4')](_0xee25('0x3'),_0xee25('0x5'),i),'encryption':'yes','avpf':_0xee25('0xb'),'force_avp':_0xee25('0xb'),'icesupport':'yes','dtlsenable':_0xee25('0xb'),'dtlsverify':'no','dtlscertfile':_0xee25('0xc'),'dtlsprivatekey':_0xee25('0xd'),'dtlssetup':_0xee25('0xe'),'callerid':util[_0xee25('0x4')](_0xee25('0xf'),util[_0xee25('0x4')](_0xee25('0x3'),_0xee25('0x5'),i),0xfa0+i)});}db[_0xee25('0x10')][_0xee25('0x11')](users)[_0xee25('0x12')](function(){console[_0xee25('0x13')](_0xee25('0x14'));})[_0xee25('0x15')](function(_0x309c02){console['log'](_0x309c02);});
\ No newline at end of file
index 765cd11..1299e81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d4=['format','%s:queue:%s','length','user:%s','handshake','find','query','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','VoiceQueues','userProfileId','SmsQueues','SmsQueue','Trunks','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getWhatsappQueues','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','join','connection','setMaxListeners','address','request','remoteAddress','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','../mysqldb','name','Agents','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','Telephones','findAll','IvrCampaigns','resourceId','User','where','Campaign','ivr'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x77d4,0x108));var _0x477d=function(_0x26bf11,_0xc83336){_0x26bf11=_0x26bf11-0x0;var _0x2019b3=_0x77d4[_0x26bf11];return _0x2019b3;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var BPromise=require('bluebird');var db=require(_0x477d('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x477d('0x2')],'include':[{'as':_0x477d('0x3'),'model':db['User'],'attributes':['id','name',_0x477d('0x4')],'raw':!![],'where':{'role':_0x477d('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x477d('0x2')],'where':{'role':_0x477d('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x477d('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x477d('0x2')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x477d('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x5da70c,_0x70b0f1,_0x29f11b){return db[_0x477d('0x8')][_0x477d('0x9')]({'where':{'name':_0x5da70c,'userProfileId':_0x70b0f1},'raw':!![]})[_0x477d('0xa')](function(_0x58ff29){if(_0x58ff29){if(_0x58ff29[_0x477d('0xb')]){switch(_0x5da70c){case'VoiceQueues':case _0x477d('0xc'):case _0x477d('0xd'):case'SmsQueues':case _0x477d('0xe'):case _0x477d('0xf'):case'WhatsappQueues':return db[_0x29f11b]['findAll'](queryQueues);case _0x477d('0x10'):return db[_0x29f11b][_0x477d('0x11')](queryTelephones);case'Trunks':return db[_0x29f11b][_0x477d('0x11')](queryTrunks);case _0x477d('0x12'):return db[_0x29f11b]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x477d('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x58ff29['id']},'raw':!![]})[_0x477d('0xa')](function(_0x234b99){if(_0x234b99){var _0x25fc02={'where':{'id':_['map'](_0x234b99,_0x477d('0x13'))},'raw':!![]};switch(_0x29f11b){case _0x477d('0x14'):_0x25fc02[_0x477d('0x15')][_0x477d('0x4')]='telephone';break;case _0x477d('0x16'):_0x25fc02['where'][_0x477d('0x7')]=_0x477d('0x17');break;}return db[_0x29f11b][_0x477d('0x11')](_0x25fc02);}else{return[];}});}}else{return[];}})[_0x477d('0xa')](function(_0x37bcb3){return _0x37bcb3;});}function joinOrLeaveQueues(_0x2145ce,_0x5bea7e,_0x33db7a,_0x49c442){_0x2145ce[_0x5bea7e](util[_0x477d('0x18')](_0x477d('0x19'),_0x33db7a,_0x49c442[_0x477d('0x2')]));if(_0x49c442[_0x477d('0x3')]){for(var _0x27b3aa=0x0;_0x27b3aa<_0x49c442[_0x477d('0x3')][_0x477d('0x1a')];_0x27b3aa+=0x1){_0x2145ce[_0x5bea7e](util[_0x477d('0x18')](_0x477d('0x1b'),_0x49c442[_0x477d('0x3')][_0x27b3aa][_0x477d('0x2')]));}}}function joinOrLeave(_0x3525e8,_0x43c845,_0x1f3868){var _0x4e6a44;if(_0x3525e8[_0x477d('0x1c')]['query']['id']){db[_0x477d('0x14')][_0x477d('0x1d')]({'attributes':['id',_0x477d('0x2'),_0x477d('0x4'),'userProfileId'],'where':{'id':_0x3525e8[_0x477d('0x1c')][_0x477d('0x1e')]['id']},'include':[{'model':db[_0x477d('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x477d('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x477d('0x21')],'as':_0x477d('0x22'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x477d('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x477d('0x24')],'as':_0x477d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x477d('0x26')],'as':_0x477d('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2fc959){if(_0x2fc959){_0x4e6a44=_0x2fc959;_0x3525e8[_0x43c845](util[_0x477d('0x18')](_0x477d('0x1b'),_0x2fc959[_0x477d('0x2')]));var _0x32c5d7=[];switch(_0x2fc959[_0x477d('0x4')]){case _0x477d('0x28'):_0x3525e8[_0x43c845](_0x477d('0x29'));_0x3525e8[_0x43c845](_0x477d('0x2a'));if(queryQueues[_0x477d('0x2b')](_0x477d('0x2c'))){delete queryQueues[_0x477d('0x2c')];}_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x2e')][_0x477d('0x11')](queryQueues));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x2f')][_0x477d('0x11')](queryQueues));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x30')]['findAll'](queryQueues));_0x32c5d7[_0x477d('0x2d')](db['SmsQueue'][_0x477d('0x11')](queryQueues));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x31')]['findAll'](queryQueues));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x32')][_0x477d('0x11')](queryQueues));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x33')][_0x477d('0x11')](queryQueues));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x14')][_0x477d('0x11')](queryTelephones));_0x32c5d7[_0x477d('0x2d')](db['Trunk'][_0x477d('0x11')](queryTrunks));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x16')]['findAll'](queryCampaigns));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x14')][_0x477d('0x11')](queryAgents));break;case'user':_0x3525e8[_0x43c845]('voice:inbound');_0x3525e8[_0x43c845](_0x477d('0x2a'));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources(_0x477d('0x34'),_0x2fc959[_0x477d('0x35')],_0x477d('0x2e')));_0x32c5d7['push'](getAssociatedResources(_0x477d('0xc'),_0x2fc959['userProfileId'],_0x477d('0x2f')));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources(_0x477d('0xd'),_0x2fc959['userProfileId'],'FaxQueue'));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources(_0x477d('0x36'),_0x2fc959[_0x477d('0x35')],_0x477d('0x37')));_0x32c5d7['push'](getAssociatedResources(_0x477d('0xe'),_0x2fc959[_0x477d('0x35')],_0x477d('0x31')));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources(_0x477d('0xf'),_0x2fc959['userProfileId'],_0x477d('0x32')));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources('WhatsappQueues',_0x2fc959[_0x477d('0x35')],'WhatsappQueue'));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources(_0x477d('0x10'),_0x2fc959[_0x477d('0x35')],_0x477d('0x14')));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources(_0x477d('0x38'),_0x2fc959[_0x477d('0x35')],_0x477d('0x39')));_0x32c5d7[_0x477d('0x2d')](getAssociatedResources('IvrCampaigns',_0x2fc959[_0x477d('0x35')],_0x477d('0x16')));_0x32c5d7[_0x477d('0x2d')](db[_0x477d('0x14')]['findAll'](queryAgents));break;case'agent':_0x3525e8[_0x43c845](_0x477d('0x29'));_0x3525e8[_0x43c845](_0x477d('0x2a'));_0x32c5d7['push'](_0x2fc959[_0x477d('0x3a')]({'attributes':['id','name']}));_0x32c5d7['push'](_0x2fc959[_0x477d('0x3b')]({'attributes':['id',_0x477d('0x2')]}));_0x32c5d7[_0x477d('0x2d')](_0x2fc959[_0x477d('0x3c')]({'attributes':['id',_0x477d('0x2')]}));_0x32c5d7[_0x477d('0x2d')](_0x2fc959['getSmsQueues']({'attributes':['id',_0x477d('0x2')]}));_0x32c5d7[_0x477d('0x2d')](_0x2fc959[_0x477d('0x3d')]({'attributes':['id',_0x477d('0x2')]}));_0x32c5d7[_0x477d('0x2d')](_0x2fc959['getOpenchannelQueues']({'attributes':['id','name']}));_0x32c5d7[_0x477d('0x2d')](_0x2fc959[_0x477d('0x3e')]({'attributes':['id',_0x477d('0x2')]}));break;}return BPromise['all'](_0x32c5d7);}})[_0x477d('0xa')](function(_0xf4685b){if(_0xf4685b&&_0xf4685b[_0x477d('0x1a')]){for(var _0x1ad4d1=0x0;_0x1ad4d1<_0xf4685b[_0x477d('0x1a')];_0x1ad4d1+=0x1){for(var _0x44785b=0x0;_0x44785b<_0xf4685b[_0x1ad4d1][_0x477d('0x1a')];_0x44785b+=0x1){switch(_0x1ad4d1){case 0x0:joinOrLeaveQueues(_0x3525e8,_0x43c845,'voice',_0xf4685b[_0x1ad4d1][_0x44785b]);break;case 0x1:joinOrLeaveQueues(_0x3525e8,_0x43c845,_0x477d('0x3f'),_0xf4685b[_0x1ad4d1][_0x44785b]);break;case 0x2:joinOrLeaveQueues(_0x3525e8,_0x43c845,_0x477d('0x40'),_0xf4685b[_0x1ad4d1][_0x44785b]);break;case 0x3:joinOrLeaveQueues(_0x3525e8,_0x43c845,_0x477d('0x41'),_0xf4685b[_0x1ad4d1][_0x44785b]);break;case 0x4:joinOrLeaveQueues(_0x3525e8,_0x43c845,_0x477d('0x42'),_0xf4685b[_0x1ad4d1][_0x44785b]);break;case 0x5:joinOrLeaveQueues(_0x3525e8,_0x43c845,_0x477d('0x43'),_0xf4685b[_0x1ad4d1][_0x44785b]);break;case 0x6:joinOrLeaveQueues(_0x3525e8,_0x43c845,_0x477d('0x44'),_0xf4685b[_0x1ad4d1][_0x44785b]);break;case 0x7:if(_0x4e6a44[_0x477d('0x4')]!==_0x477d('0x5'))_0x3525e8[_0x43c845](util[_0x477d('0x18')](_0x477d('0x45'),_0xf4685b[_0x1ad4d1][_0x44785b][_0x477d('0x2')]));break;case 0x8:if(_0x4e6a44[_0x477d('0x4')]!==_0x477d('0x5'))_0x3525e8[_0x43c845](util[_0x477d('0x18')](_0x477d('0x46'),_0xf4685b[_0x1ad4d1][_0x44785b]['name']));break;case 0x9:if(_0x4e6a44[_0x477d('0x4')]!==_0x477d('0x5'))_0x3525e8[_0x43c845](util['format']('campaign:%s:%s',_0xf4685b[_0x1ad4d1][_0x44785b]['type'],_0xf4685b[_0x1ad4d1][_0x44785b][_0x477d('0x2')]));break;case 0xa:_0x3525e8[_0x43c845](util[_0x477d('0x18')](_0x477d('0x1b'),_0xf4685b[_0x1ad4d1][_0x44785b][_0x477d('0x2')]));break;}}}}})[_0x477d('0xa')](function(){if(_0x43c845===_0x477d('0x47')){var _0x4257ab=_[_0x477d('0x48')](_0x4e6a44['ChatInteractions'],'id');return _0x4e6a44[_0x477d('0x49')](_0x4257ab)[_0x477d('0xa')](function(){for(var _0x2a303c=0x0;_0x2a303c<_0x4257ab[_0x477d('0x1a')];_0x2a303c+=0x1){_0x1f3868[_0x477d('0x4a')](_0x477d('0x4b'),{'ChatInteractionId':Number(_0x4257ab[_0x2a303c]),'UserId':Number(_0x4e6a44['id'])});}});}})[_0x477d('0xa')](function(){if(_0x43c845===_0x477d('0x47')){var _0x5d9114=_[_0x477d('0x48')](_0x4e6a44[_0x477d('0x20')],'id');return _0x4e6a44[_0x477d('0x4c')](_0x5d9114)[_0x477d('0xa')](function(){for(var _0x45cf6d=0x0;_0x45cf6d<_0x5d9114['length'];_0x45cf6d+=0x1){_0x1f3868[_0x477d('0x4a')](_0x477d('0x4d'),{'MailInteractionId':Number(_0x5d9114[_0x45cf6d]),'UserId':Number(_0x4e6a44['id'])});}});}})[_0x477d('0xa')](function(){if(_0x43c845===_0x477d('0x47')){var _0x2e5ad5=_['map'](_0x4e6a44['FaxInteractions'],'id');return _0x4e6a44[_0x477d('0x4e')](_0x2e5ad5)[_0x477d('0xa')](function(){for(var _0x95f9e0=0x0;_0x95f9e0<_0x2e5ad5[_0x477d('0x1a')];_0x95f9e0+=0x1){_0x1f3868[_0x477d('0x4a')](_0x477d('0x4f'),{'FaxInteractionId':Number(_0x2e5ad5[_0x95f9e0]),'UserId':Number(_0x4e6a44['id'])});}});}})[_0x477d('0xa')](function(){if(_0x43c845===_0x477d('0x47')){var _0x5929d5=_['map'](_0x4e6a44['SmsInteractions'],'id');return _0x4e6a44['removeSmsInteractions'](_0x5929d5)['then'](function(){for(var _0x1e238f=0x0;_0x1e238f<_0x5929d5['length'];_0x1e238f+=0x1){_0x1f3868[_0x477d('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x5929d5[_0x1e238f]),'UserId':Number(_0x4e6a44['id'])});}});}})[_0x477d('0xa')](function(){if(_0x43c845===_0x477d('0x47')){var _0x5d0922=_[_0x477d('0x48')](_0x4e6a44[_0x477d('0x25')],'id');return _0x4e6a44[_0x477d('0x50')](_0x5d0922)[_0x477d('0xa')](function(){for(var _0x5e5e09=0x0;_0x5e5e09<_0x5d0922['length'];_0x5e5e09+=0x1){_0x1f3868[_0x477d('0x4a')](_0x477d('0x51'),{'OpenchannelInteractionId':Number(_0x5d0922[_0x5e5e09]),'UserId':Number(_0x4e6a44['id'])});}});}})['then'](function(){if(_0x43c845===_0x477d('0x47')){var _0xe8ea8b=_[_0x477d('0x48')](_0x4e6a44[_0x477d('0x27')],'id');return _0x4e6a44[_0x477d('0x52')](_0xe8ea8b)['then'](function(){for(var _0x4ccbc8=0x0;_0x4ccbc8<_0xe8ea8b[_0x477d('0x1a')];_0x4ccbc8+=0x1){_0x1f3868[_0x477d('0x4a')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xe8ea8b[_0x4ccbc8]),'UserId':Number(_0x4e6a44['id'])});}});}})[_0x477d('0x53')](function(_0x4fdd04){_0x3525e8['log'](_0x4fdd04);});}}function onDisconnect(_0x382587,_0x44c193){joinOrLeave(_0x382587,_0x477d('0x47'),_0x44c193);}function onConnect(_0x1566d6){joinOrLeave(_0x1566d6,_0x477d('0x54'));}exports['default']=function(_0x4c17f5){_0x4c17f5['on'](_0x477d('0x55'),function(_0x23c435){_0x23c435[_0x477d('0x56')](0x0);_0x23c435[_0x477d('0x57')]=_0x23c435[_0x477d('0x58')][_0x477d('0x55')][_0x477d('0x59')]+':'+_0x23c435[_0x477d('0x58')][_0x477d('0x55')]['remotePort'];_0x23c435['connectedAt']=new Date();_0x23c435[_0x477d('0x5a')]=function(_0x5049bd){console[_0x477d('0x5a')](_0x477d('0x5b')+_0x23c435[_0x477d('0x5c')]['name']+'['+_0x23c435[_0x477d('0x57')]+']',_0x5049bd);};_0x23c435['on'](_0x477d('0x5d'),function(){onDisconnect(_0x23c435,_0x4c17f5);_0x23c435['log'](_0x477d('0x5e'));});onConnect(_0x23c435);_0x23c435[_0x477d('0x5a')](_0x477d('0x5f'));});};
\ No newline at end of file
+var _0xbc36=['WhatsappQueues','Telephones','Trunks','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','IvrCampaigns','UserProfileResource','map','resourceId','where','Campaign','ivr','format','%s:queue:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','SmsQueue'];(function(_0x4b5aed,_0x3b6d4f){var _0x17a5ce=function(_0x6078c6){while(--_0x6078c6){_0x4b5aed['push'](_0x4b5aed['shift']());}};_0x17a5ce(++_0x3b6d4f);}(_0xbc36,0x169));var _0x6bc3=function(_0x4d1423,_0x3e24cd){_0x4d1423=_0x4d1423-0x0;var _0x4e4f8b=_0xbc36[_0x4d1423];return _0x4e4f8b;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var BPromise=require(_0x6bc3('0x1'));var db=require(_0x6bc3('0x2'))['db'];var config=require(_0x6bc3('0x3'));var queryQueues={'attributes':['id',_0x6bc3('0x4')],'include':[{'as':_0x6bc3('0x5'),'model':db[_0x6bc3('0x6')],'attributes':['id',_0x6bc3('0x4'),_0x6bc3('0x7')],'raw':!![],'where':{'role':_0x6bc3('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x6bc3('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x6bc3('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x6bc3('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6bc3('0x4'),_0x6bc3('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x272e8c,_0x86c2cc,_0x33e8e0){return db[_0x6bc3('0xb')]['findOne']({'where':{'name':_0x272e8c,'userProfileId':_0x86c2cc},'raw':!![]})[_0x6bc3('0xc')](function(_0x1008f7){if(_0x1008f7){if(_0x1008f7[_0x6bc3('0xd')]){switch(_0x272e8c){case _0x6bc3('0xe'):case _0x6bc3('0xf'):case _0x6bc3('0x10'):case _0x6bc3('0x11'):case _0x6bc3('0x12'):case _0x6bc3('0x13'):case'WhatsappQueues':return db[_0x33e8e0][_0x6bc3('0x14')](queryQueues);case'Telephones':return db[_0x33e8e0][_0x6bc3('0x14')](queryTelephones);case'Trunks':return db[_0x33e8e0][_0x6bc3('0x14')](queryTrunks);case _0x6bc3('0x15'):return db[_0x33e8e0]['findAll'](queryCampaigns);}}else{return db[_0x6bc3('0x16')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x1008f7['id']},'raw':!![]})[_0x6bc3('0xc')](function(_0x1f657b){if(_0x1f657b){var _0x3513d4={'where':{'id':_[_0x6bc3('0x17')](_0x1f657b,_0x6bc3('0x18'))},'raw':!![]};switch(_0x33e8e0){case _0x6bc3('0x6'):_0x3513d4[_0x6bc3('0x19')]['role']=_0x6bc3('0x9');break;case _0x6bc3('0x1a'):_0x3513d4['where'][_0x6bc3('0xa')]=_0x6bc3('0x1b');break;}return db[_0x33e8e0][_0x6bc3('0x14')](_0x3513d4);}else{return[];}});}}else{return[];}})[_0x6bc3('0xc')](function(_0x1f3587){return _0x1f3587;});}function joinOrLeaveQueues(_0x1a2a4a,_0x333d43,_0x3f6bf9,_0x2f4b3d){_0x1a2a4a[_0x333d43](util[_0x6bc3('0x1c')](_0x6bc3('0x1d'),_0x3f6bf9,_0x2f4b3d[_0x6bc3('0x4')]));if(_0x2f4b3d['Agents']){for(var _0x22652a=0x0;_0x22652a<_0x2f4b3d[_0x6bc3('0x5')]['length'];_0x22652a+=0x1){_0x1a2a4a[_0x333d43](util[_0x6bc3('0x1c')]('user:%s',_0x2f4b3d[_0x6bc3('0x5')][_0x22652a][_0x6bc3('0x4')]));}}}function joinOrLeave(_0x344d2b,_0x45995c,_0x3c748f){var _0x453ada;if(_0x344d2b[_0x6bc3('0x1e')][_0x6bc3('0x1f')]['id']){db[_0x6bc3('0x6')][_0x6bc3('0x20')]({'attributes':['id',_0x6bc3('0x4'),_0x6bc3('0x7'),_0x6bc3('0x21')],'where':{'id':_0x344d2b['handshake'][_0x6bc3('0x1f')]['id']},'include':[{'model':db[_0x6bc3('0x22')],'as':_0x6bc3('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x6bc3('0x24')],'as':_0x6bc3('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6bc3('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6bc3('0x27')],'as':_0x6bc3('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x6bc3('0x29')],'as':_0x6bc3('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x66fb54){if(_0x66fb54){_0x453ada=_0x66fb54;_0x344d2b[_0x45995c](util[_0x6bc3('0x1c')](_0x6bc3('0x2b'),_0x66fb54[_0x6bc3('0x4')]));var _0xa025ab=[];switch(_0x66fb54['role']){case _0x6bc3('0x2c'):_0x344d2b[_0x45995c](_0x6bc3('0x2d'));_0x344d2b[_0x45995c](_0x6bc3('0x2e'));if(queryQueues[_0x6bc3('0x2f')](_0x6bc3('0x30'))){delete queryQueues['include'];}_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x32')][_0x6bc3('0x14')](queryQueues));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x33')][_0x6bc3('0x14')](queryQueues));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x34')]['findAll'](queryQueues));_0xa025ab[_0x6bc3('0x31')](db['SmsQueue']['findAll'](queryQueues));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x35')]['findAll'](queryQueues));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x36')][_0x6bc3('0x14')](queryQueues));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x37')][_0x6bc3('0x14')](queryQueues));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x6')][_0x6bc3('0x14')](queryTelephones));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x38')][_0x6bc3('0x14')](queryTrunks));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x1a')]['findAll'](queryCampaigns));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x6')]['findAll'](queryAgents));break;case _0x6bc3('0x39'):_0x344d2b[_0x45995c]('voice:inbound');_0x344d2b[_0x45995c](_0x6bc3('0x2e'));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources(_0x6bc3('0xe'),_0x66fb54[_0x6bc3('0x21')],_0x6bc3('0x32')));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources(_0x6bc3('0xf'),_0x66fb54[_0x6bc3('0x21')],_0x6bc3('0x33')));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources(_0x6bc3('0x10'),_0x66fb54['userProfileId'],_0x6bc3('0x34')));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources('SmsQueues',_0x66fb54['userProfileId'],_0x6bc3('0x3a')));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources(_0x6bc3('0x12'),_0x66fb54['userProfileId'],_0x6bc3('0x35')));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources('OpenchannelQueues',_0x66fb54[_0x6bc3('0x21')],'OpenchannelQueue'));_0xa025ab['push'](getAssociatedResources(_0x6bc3('0x3b'),_0x66fb54[_0x6bc3('0x21')],_0x6bc3('0x37')));_0xa025ab['push'](getAssociatedResources(_0x6bc3('0x3c'),_0x66fb54['userProfileId'],_0x6bc3('0x6')));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources(_0x6bc3('0x3d'),_0x66fb54[_0x6bc3('0x21')],_0x6bc3('0x38')));_0xa025ab[_0x6bc3('0x31')](getAssociatedResources('IvrCampaigns',_0x66fb54[_0x6bc3('0x21')],'Campaign'));_0xa025ab[_0x6bc3('0x31')](db[_0x6bc3('0x6')]['findAll'](queryAgents));break;case _0x6bc3('0x8'):_0x344d2b[_0x45995c](_0x6bc3('0x2d'));_0x344d2b[_0x45995c]('voice:outbound');_0xa025ab[_0x6bc3('0x31')](_0x66fb54[_0x6bc3('0x3e')]({'attributes':['id',_0x6bc3('0x4')]}));_0xa025ab[_0x6bc3('0x31')](_0x66fb54[_0x6bc3('0x3f')]({'attributes':['id',_0x6bc3('0x4')]}));_0xa025ab['push'](_0x66fb54['getFaxQueues']({'attributes':['id','name']}));_0xa025ab[_0x6bc3('0x31')](_0x66fb54[_0x6bc3('0x40')]({'attributes':['id',_0x6bc3('0x4')]}));_0xa025ab[_0x6bc3('0x31')](_0x66fb54[_0x6bc3('0x41')]({'attributes':['id','name']}));_0xa025ab[_0x6bc3('0x31')](_0x66fb54[_0x6bc3('0x42')]({'attributes':['id',_0x6bc3('0x4')]}));_0xa025ab[_0x6bc3('0x31')](_0x66fb54['getWhatsappQueues']({'attributes':['id',_0x6bc3('0x4')]}));break;}return BPromise[_0x6bc3('0x43')](_0xa025ab);}})['then'](function(_0x69a5d2){if(_0x69a5d2&&_0x69a5d2[_0x6bc3('0x44')]){for(var _0x5592cc=0x0;_0x5592cc<_0x69a5d2[_0x6bc3('0x44')];_0x5592cc+=0x1){for(var _0x16d60d=0x0;_0x16d60d<_0x69a5d2[_0x5592cc]['length'];_0x16d60d+=0x1){switch(_0x5592cc){case 0x0:joinOrLeaveQueues(_0x344d2b,_0x45995c,_0x6bc3('0x45'),_0x69a5d2[_0x5592cc][_0x16d60d]);break;case 0x1:joinOrLeaveQueues(_0x344d2b,_0x45995c,_0x6bc3('0x46'),_0x69a5d2[_0x5592cc][_0x16d60d]);break;case 0x2:joinOrLeaveQueues(_0x344d2b,_0x45995c,_0x6bc3('0x47'),_0x69a5d2[_0x5592cc][_0x16d60d]);break;case 0x3:joinOrLeaveQueues(_0x344d2b,_0x45995c,_0x6bc3('0x48'),_0x69a5d2[_0x5592cc][_0x16d60d]);break;case 0x4:joinOrLeaveQueues(_0x344d2b,_0x45995c,'mail',_0x69a5d2[_0x5592cc][_0x16d60d]);break;case 0x5:joinOrLeaveQueues(_0x344d2b,_0x45995c,_0x6bc3('0x49'),_0x69a5d2[_0x5592cc][_0x16d60d]);break;case 0x6:joinOrLeaveQueues(_0x344d2b,_0x45995c,_0x6bc3('0x4a'),_0x69a5d2[_0x5592cc][_0x16d60d]);break;case 0x7:if(_0x453ada[_0x6bc3('0x7')]!==_0x6bc3('0x8'))_0x344d2b[_0x45995c](util[_0x6bc3('0x1c')]('telephone:%s',_0x69a5d2[_0x5592cc][_0x16d60d][_0x6bc3('0x4')]));break;case 0x8:if(_0x453ada[_0x6bc3('0x7')]!=='agent')_0x344d2b[_0x45995c](util[_0x6bc3('0x1c')](_0x6bc3('0x4b'),_0x69a5d2[_0x5592cc][_0x16d60d]['name']));break;case 0x9:if(_0x453ada['role']!==_0x6bc3('0x8'))_0x344d2b[_0x45995c](util['format'](_0x6bc3('0x4c'),_0x69a5d2[_0x5592cc][_0x16d60d]['type'],_0x69a5d2[_0x5592cc][_0x16d60d]['name']));break;case 0xa:_0x344d2b[_0x45995c](util[_0x6bc3('0x1c')](_0x6bc3('0x2b'),_0x69a5d2[_0x5592cc][_0x16d60d][_0x6bc3('0x4')]));break;}}}}})[_0x6bc3('0xc')](function(){if(_0x45995c===_0x6bc3('0x4d')){var _0x3e410c=_[_0x6bc3('0x17')](_0x453ada[_0x6bc3('0x23')],'id');return _0x453ada[_0x6bc3('0x4e')](_0x3e410c)[_0x6bc3('0xc')](function(){for(var _0x38931c=0x0;_0x38931c<_0x3e410c['length'];_0x38931c+=0x1){_0x3c748f[_0x6bc3('0x4f')](_0x6bc3('0x50'),{'ChatInteractionId':Number(_0x3e410c[_0x38931c]),'UserId':Number(_0x453ada['id'])});}});}})['then'](function(){if(_0x45995c===_0x6bc3('0x4d')){var _0x34214c=_[_0x6bc3('0x17')](_0x453ada['MailInteractions'],'id');return _0x453ada['removeMailInteractions'](_0x34214c)['then'](function(){for(var _0x4cbee9=0x0;_0x4cbee9<_0x34214c[_0x6bc3('0x44')];_0x4cbee9+=0x1){_0x3c748f['emit'](_0x6bc3('0x51'),{'MailInteractionId':Number(_0x34214c[_0x4cbee9]),'UserId':Number(_0x453ada['id'])});}});}})[_0x6bc3('0xc')](function(){if(_0x45995c==='leave'){var _0x3e93e1=_[_0x6bc3('0x17')](_0x453ada[_0x6bc3('0x52')],'id');return _0x453ada['removeFaxInteractions'](_0x3e93e1)[_0x6bc3('0xc')](function(){for(var _0x15339a=0x0;_0x15339a<_0x3e93e1[_0x6bc3('0x44')];_0x15339a+=0x1){_0x3c748f[_0x6bc3('0x4f')](_0x6bc3('0x53'),{'FaxInteractionId':Number(_0x3e93e1[_0x15339a]),'UserId':Number(_0x453ada['id'])});}});}})[_0x6bc3('0xc')](function(){if(_0x45995c===_0x6bc3('0x4d')){var _0xb5c302=_[_0x6bc3('0x17')](_0x453ada[_0x6bc3('0x54')],'id');return _0x453ada[_0x6bc3('0x55')](_0xb5c302)['then'](function(){for(var _0x3c3e8b=0x0;_0x3c3e8b<_0xb5c302[_0x6bc3('0x44')];_0x3c3e8b+=0x1){_0x3c748f['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xb5c302[_0x3c3e8b]),'UserId':Number(_0x453ada['id'])});}});}})['then'](function(){if(_0x45995c===_0x6bc3('0x4d')){var _0x4279a3=_[_0x6bc3('0x17')](_0x453ada['OpenchannelInteractions'],'id');return _0x453ada[_0x6bc3('0x56')](_0x4279a3)['then'](function(){for(var _0x11b7e8=0x0;_0x11b7e8<_0x4279a3[_0x6bc3('0x44')];_0x11b7e8+=0x1){_0x3c748f[_0x6bc3('0x4f')](_0x6bc3('0x57'),{'OpenchannelInteractionId':Number(_0x4279a3[_0x11b7e8]),'UserId':Number(_0x453ada['id'])});}});}})[_0x6bc3('0xc')](function(){if(_0x45995c===_0x6bc3('0x4d')){var _0x189e68=_[_0x6bc3('0x17')](_0x453ada[_0x6bc3('0x2a')],'id');return _0x453ada[_0x6bc3('0x58')](_0x189e68)[_0x6bc3('0xc')](function(){for(var _0x33d00a=0x0;_0x33d00a<_0x189e68[_0x6bc3('0x44')];_0x33d00a+=0x1){_0x3c748f[_0x6bc3('0x4f')](_0x6bc3('0x59'),{'WhatsappInteractionId':Number(_0x189e68[_0x33d00a]),'UserId':Number(_0x453ada['id'])});}});}})[_0x6bc3('0x5a')](function(_0x47ace7){_0x344d2b[_0x6bc3('0x5b')](_0x47ace7);});}}function onDisconnect(_0xa20be5,_0x5077ef){joinOrLeave(_0xa20be5,'leave',_0x5077ef);}function onConnect(_0x2d02d1){joinOrLeave(_0x2d02d1,_0x6bc3('0x5c'));}exports[_0x6bc3('0x5d')]=function(_0x368074){_0x368074['on'](_0x6bc3('0x5e'),function(_0x1201a5){_0x1201a5[_0x6bc3('0x5f')](0x0);_0x1201a5[_0x6bc3('0x60')]=_0x1201a5[_0x6bc3('0x61')][_0x6bc3('0x5e')][_0x6bc3('0x62')]+':'+_0x1201a5[_0x6bc3('0x61')]['connection']['remotePort'];_0x1201a5[_0x6bc3('0x63')]=new Date();_0x1201a5[_0x6bc3('0x5b')]=function(_0x45e4a6){console[_0x6bc3('0x5b')](_0x6bc3('0x64')+_0x1201a5[_0x6bc3('0x65')][_0x6bc3('0x4')]+'['+_0x1201a5['address']+']',_0x45e4a6);};_0x1201a5['on'](_0x6bc3('0x66'),function(){onDisconnect(_0x1201a5,_0x368074);_0x1201a5[_0x6bc3('0x5b')](_0x6bc3('0x67'));});onConnect(_0x1201a5);_0x1201a5[_0x6bc3('0x5b')](_0x6bc3('0x68'));});};
\ No newline at end of file
index 72918cb..9c6131c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c75=['interface','format','channel','agent','incomingmessage','AfterCreateMessage','outgoingmessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','closed','substatus','event','QueryTypes','internal','SIP/%s','AfterUpdate','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','get','motionChannel','direction','resolve','ContactId','contact','UserId','User','find','name','fullname','email'];(function(_0x416f8e,_0x382960){var _0x56313a=function(_0x56dec3){while(--_0x56dec3){_0x416f8e['push'](_0x416f8e['shift']());}};_0x56313a(++_0x382960);}(_0x1c75,0x66));var _0x51c7=function(_0x36f99f,_0x10dfa2){_0x36f99f=_0x36f99f-0x0;var _0x85cb3b=_0x1c75[_0x36f99f];return _0x85cb3b;};'use strict';var util=require(_0x51c7('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x51c7('0x1'));var logger=require(_0x51c7('0x2'))(_0x51c7('0x3'));var client=jayson[_0x51c7('0x4')][_0x51c7('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x51c7('0x6'),'event':_0x51c7('0x7'),'condition':_0x51c7('0x8'),'callback':afterCreate},{'channel':_0x51c7('0x9'),'model':_0x51c7('0x6'),'event':_0x51c7('0xa'),'condition':_0x51c7('0xb'),'callback':afterUpdate},{'channel':'Chat','model':_0x51c7('0xc'),'event':_0x51c7('0x7'),'condition':_0x51c7('0xd'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x51c7('0xe'),'event':_0x51c7('0x7'),'condition':_0x51c7('0x8'),'callback':afterCreate},{'channel':_0x51c7('0xf'),'model':_0x51c7('0xe'),'event':_0x51c7('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x51c7('0xf'),'model':_0x51c7('0x10'),'event':_0x51c7('0x7'),'condition':_0x51c7('0xd'),'callback':afterCreateMessage},{'channel':_0x51c7('0x11'),'model':_0x51c7('0x12'),'event':_0x51c7('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0x51c7('0x12'),'event':_0x51c7('0xa'),'condition':_0x51c7('0xb'),'callback':afterUpdate},{'channel':_0x51c7('0x11'),'model':_0x51c7('0x13'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x51c7('0x14'),'event':'afterCreate','condition':_0x51c7('0x8'),'callback':afterCreate},{'channel':_0x51c7('0x15'),'model':_0x51c7('0x14'),'event':_0x51c7('0xa'),'condition':_0x51c7('0xb'),'callback':afterUpdate},{'channel':_0x51c7('0x15'),'model':_0x51c7('0x16'),'event':_0x51c7('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x51c7('0x17'),'model':_0x51c7('0x18'),'event':_0x51c7('0x7'),'condition':_0x51c7('0x8'),'callback':afterCreate},{'channel':'Mail','model':_0x51c7('0x18'),'event':_0x51c7('0xa'),'condition':_0x51c7('0xb'),'callback':afterUpdate},{'channel':_0x51c7('0x17'),'model':'MailMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x51c7('0x19'),'model':_0x51c7('0x1a'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x51c7('0x19'),'model':_0x51c7('0x1a'),'event':'afterUpdate','condition':_0x51c7('0xb'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x51c7('0x1b'),'event':_0x51c7('0x7'),'condition':_0x51c7('0xd'),'callback':afterCreateMessage}];function request(_0x2e36b5){return client['request'](_0x51c7('0x1c'),_0x2e36b5)[_0x51c7('0x1d')](function(_0x4b0159){logger[_0x51c7('0x1e')](_0x51c7('0x1f'),'EventManager',_0x4b0159);if(_0x4b0159[_0x51c7('0x20')]){if(_0x4b0159[_0x51c7('0x20')][_0x51c7('0x21')]===0x1f4){logger['error'](_0x51c7('0x1f'),'EventManager',_0x4b0159[_0x51c7('0x20')]);}}})['catch'](function(_0x452c49){logger[_0x51c7('0x20')](_0x51c7('0x1f'),_0x51c7('0x1c'),_0x452c49);});}function afterCreateMessage(_0x3d37d5){return function(_0x58de6e){_0x58de6e=_0x58de6e[_0x51c7('0x22')]({'plain':!![]});_0x58de6e['channel']=_0x3d37d5;_0x58de6e[_0x51c7('0x23')]=_0x3d37d5;_0x58de6e['event']=_0x58de6e[_0x51c7('0x24')];Promise[_0x51c7('0x25')]()['then'](function(){if(typeof _0x58de6e[_0x51c7('0x26')]==='undefined')return null;var _0x3c2f6b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x58de6e['ContactId'];return db['sequelize']['query'](_0x3c2f6b,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]});})[_0x51c7('0x1d')](function(_0x556529){if(_0x556529){_0x58de6e[_0x51c7('0x27')]=_0x556529[0x0];}if(_0x58de6e[_0x51c7('0x28')]){return db[_0x51c7('0x29')][_0x51c7('0x2a')]({'where':{'id':_0x58de6e[_0x51c7('0x28')]},'attributes':['id',_0x51c7('0x2b'),_0x51c7('0x2c'),_0x51c7('0x2d'),'internal'],'raw':!![]})[_0x51c7('0x1d')](function(_0x3b8bb6){_0x58de6e[_0x51c7('0x2e')]=util[_0x51c7('0x2f')]('SIP/%s',_0x3b8bb6[_0x51c7('0x2b')]);_0x58de6e[_0x51c7('0x30')]=_0x3d37d5;_0x58de6e[_0x51c7('0x31')]=_0x3b8bb6;return request({'event':_0x51c7('0x32'),'message':_0x58de6e});})['catch'](function(_0x3eb609){logger['error'](_0x51c7('0x1f'),_0x51c7('0x33'),_0x3eb609);});}else{return request({'event':_0x51c7('0x34'),'message':_0x58de6e});}});};}function afterCreate(_0x2a9332,_0x49e925){return function(_0x567011){_0x567011=_0x567011[_0x51c7('0x22')]({'plain':!![]});_0x567011[_0x51c7('0x30')]=_0x2a9332;_0x567011[_0x51c7('0x23')]=_0x2a9332;_0x567011['event']=_0x51c7('0x35');var _0x59c338=_0x51c7('0x36')+_0x567011[_0x51c7('0x26')];return db[_0x51c7('0x37')][_0x51c7('0x38')](_0x59c338,{'type':db[_0x51c7('0x39')]['QueryTypes'][_0x51c7('0x3a')],'raw':!![]})[_0x51c7('0x1d')](function(_0x3703c6){return _0x3703c6;})['then'](function(_0x25cfa3){if(_0x25cfa3){_0x567011['contact']=_0x25cfa3[0x0];}return request({'event':_0x49e925,'message':_0x567011});});};}function afterUpdate(_0x780894){return function(_0xf28a41){var _0x1ad914=_0xf28a41['changed'](_0x51c7('0x3b'))&&_0xf28a41['closed'];var _0x4143bc=_0xf28a41['changed'](_0x51c7('0x3c'));if(_0x1ad914||_0x4143bc){var _0x2a3c3d=_0x1ad914?_0x51c7('0xb'):'substatus';var _0x9c1147=_0xf28a41[_0x51c7('0x22')]({'plain':!![]});_0x9c1147[_0x51c7('0x30')]=_0x780894;_0x9c1147[_0x51c7('0x23')]=_0x780894;_0x9c1147[_0x51c7('0x3d')]=_0x1ad914?'closed':'substatus';var _0x208bb2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9c1147['ContactId'];return db['sequelize']['query'](_0x208bb2,{'type':db['Sequelize'][_0x51c7('0x3e')][_0x51c7('0x3a')],'raw':!![]})[_0x51c7('0x1d')](function(_0x26d8d7){if(_0x26d8d7){_0x9c1147['contact']=_0x26d8d7[0x0];}if(_0x9c1147[_0x51c7('0x28')]){return db['User'][_0x51c7('0x2a')]({'where':{'id':_0x9c1147[_0x51c7('0x28')]},'attributes':['id',_0x51c7('0x2b'),_0x51c7('0x2c'),_0x51c7('0x2d'),_0x51c7('0x3f')],'raw':!![]})['then'](function(_0x53e0aa){_0x9c1147[_0x51c7('0x2e')]=util[_0x51c7('0x2f')](_0x51c7('0x40'),_0x53e0aa[_0x51c7('0x2b')]);_0x9c1147['agent']=_0x53e0aa;return request({'event':_0x2a3c3d,'message':_0x9c1147});})['catch'](function(_0x4e9000){logger[_0x51c7('0x20')](_0x51c7('0x1f'),_0x51c7('0x41'),_0x4e9000);});}else{return request({'event':_0x2a3c3d,'message':_0x9c1147});}});}};}exports[_0x51c7('0x42')]=function(){for(var _0x4fe584=0x0;_0x4fe584<triggers[_0x51c7('0x43')];_0x4fe584+=0x1){if(db[_0x51c7('0x44')](triggers[_0x4fe584][_0x51c7('0x45')])){db[triggers[_0x4fe584][_0x51c7('0x45')]][_0x51c7('0x46')](triggers[_0x4fe584][_0x51c7('0x3d')],triggers[_0x4fe584][_0x51c7('0x47')](triggers[_0x4fe584][_0x51c7('0x30')][_0x51c7('0x48')](),triggers[_0x4fe584][_0x51c7('0x49')]));}}};
\ No newline at end of file
+var _0x75e6=['motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','SELECT','then','contact','UserId','User','find','email','format','name','agent','outgoingmessage','changed','closed','substatus','sequelize','fullname','internal','interface','SIP/%s','AfterUpdate','default','length','hasOwnProperty','model','hook','callback','condition','../../mysqldb','jayson/promise','../logger','triggers','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','error','code','catch','Trigger,\x20%s','get','channel'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x75e6,0xfd));var _0x675e=function(_0xd22918,_0x1de1a1){_0xd22918=_0xd22918-0x0;var _0x30c9f9=_0x75e6[_0xd22918];return _0x30c9f9;};'use strict';var util=require('util');var db=require(_0x675e('0x0'))['db'];var jayson=require(_0x675e('0x1'));var logger=require(_0x675e('0x2'))(_0x675e('0x3'));var client=jayson['client'][_0x675e('0x4')]({'port':0x232a});var triggers=[{'channel':_0x675e('0x5'),'model':'ChatInteraction','event':_0x675e('0x6'),'condition':_0x675e('0x7'),'callback':afterCreate},{'channel':_0x675e('0x5'),'model':_0x675e('0x8'),'event':_0x675e('0x9'),'condition':_0x675e('0xa'),'callback':afterUpdate},{'channel':_0x675e('0x5'),'model':'ChatMessage','event':_0x675e('0x6'),'condition':_0x675e('0xb'),'callback':afterCreateMessage},{'channel':_0x675e('0xc'),'model':_0x675e('0xd'),'event':_0x675e('0x6'),'condition':_0x675e('0x7'),'callback':afterCreate},{'channel':_0x675e('0xc'),'model':_0x675e('0xd'),'event':_0x675e('0x9'),'condition':_0x675e('0xa'),'callback':afterUpdate},{'channel':_0x675e('0xc'),'model':_0x675e('0xe'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x675e('0xf'),'model':_0x675e('0x10'),'event':_0x675e('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x675e('0xf'),'model':_0x675e('0x10'),'event':'afterUpdate','condition':_0x675e('0xa'),'callback':afterUpdate},{'channel':_0x675e('0xf'),'model':_0x675e('0x11'),'event':_0x675e('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x675e('0x12'),'event':_0x675e('0x6'),'condition':_0x675e('0x7'),'callback':afterCreate},{'channel':_0x675e('0x13'),'model':_0x675e('0x12'),'event':_0x675e('0x9'),'condition':_0x675e('0xa'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x675e('0x6'),'condition':_0x675e('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x675e('0x14'),'event':'afterCreate','condition':_0x675e('0x7'),'callback':afterCreate},{'channel':_0x675e('0x15'),'model':_0x675e('0x14'),'event':_0x675e('0x9'),'condition':_0x675e('0xa'),'callback':afterUpdate},{'channel':_0x675e('0x15'),'model':_0x675e('0x16'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x675e('0x17'),'model':_0x675e('0x18'),'event':'afterCreate','condition':_0x675e('0x7'),'callback':afterCreate},{'channel':_0x675e('0x17'),'model':_0x675e('0x18'),'event':_0x675e('0x9'),'condition':_0x675e('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x675e('0x19'),'event':_0x675e('0x6'),'condition':_0x675e('0xb'),'callback':afterCreateMessage}];function request(_0x3d76ee){return client[_0x675e('0x1a')](_0x675e('0x1b'),_0x3d76ee)['then'](function(_0x247b45){logger[_0x675e('0x1c')]('Trigger,\x20%s',_0x675e('0x1b'),_0x247b45);if(_0x247b45['error']){if(_0x247b45[_0x675e('0x1d')][_0x675e('0x1e')]===0x1f4){logger['error']('Trigger,\x20%s',_0x675e('0x1b'),_0x247b45['error']);}}})[_0x675e('0x1f')](function(_0x1d2c5d){logger[_0x675e('0x1d')](_0x675e('0x20'),'EventManager',_0x1d2c5d);});}function afterCreateMessage(_0x341193){return function(_0xd14a2){_0xd14a2=_0xd14a2[_0x675e('0x21')]({'plain':!![]});_0xd14a2[_0x675e('0x22')]=_0x341193;_0xd14a2[_0x675e('0x23')]=_0x341193;_0xd14a2[_0x675e('0x24')]=_0xd14a2[_0x675e('0x25')];Promise[_0x675e('0x26')]()['then'](function(){if(typeof _0xd14a2[_0x675e('0x27')]===_0x675e('0x28'))return null;var _0x2d3b29=_0x675e('0x29')+_0xd14a2[_0x675e('0x27')];return db['sequelize'][_0x675e('0x2a')](_0x2d3b29,{'type':db[_0x675e('0x2b')][_0x675e('0x2c')][_0x675e('0x2d')],'raw':!![]});})[_0x675e('0x2e')](function(_0x5ae285){if(_0x5ae285){_0xd14a2[_0x675e('0x2f')]=_0x5ae285[0x0];}if(_0xd14a2[_0x675e('0x30')]){return db[_0x675e('0x31')][_0x675e('0x32')]({'where':{'id':_0xd14a2['UserId']},'attributes':['id','name','fullname',_0x675e('0x33'),'internal'],'raw':!![]})[_0x675e('0x2e')](function(_0xbe9948){_0xd14a2['interface']=util[_0x675e('0x34')]('SIP/%s',_0xbe9948[_0x675e('0x35')]);_0xd14a2[_0x675e('0x22')]=_0x341193;_0xd14a2[_0x675e('0x36')]=_0xbe9948;return request({'event':'incomingmessage','message':_0xd14a2});})[_0x675e('0x1f')](function(_0x44f7af){logger['error'](_0x675e('0x20'),'AfterCreateMessage',_0x44f7af);});}else{return request({'event':_0x675e('0x37'),'message':_0xd14a2});}});};}function afterCreate(_0x450618,_0xa62880){return function(_0x5c8840){_0x5c8840=_0x5c8840[_0x675e('0x21')]({'plain':!![]});_0x5c8840[_0x675e('0x22')]=_0x450618;_0x5c8840[_0x675e('0x23')]=_0x450618;_0x5c8840['event']='opened';var _0x52b6a7=_0x675e('0x29')+_0x5c8840[_0x675e('0x27')];return db['sequelize']['query'](_0x52b6a7,{'type':db[_0x675e('0x2b')][_0x675e('0x2c')][_0x675e('0x2d')],'raw':!![]})[_0x675e('0x2e')](function(_0x42ebc2){return _0x42ebc2;})[_0x675e('0x2e')](function(_0x3fd347){if(_0x3fd347){_0x5c8840['contact']=_0x3fd347[0x0];}return request({'event':_0xa62880,'message':_0x5c8840});});};}function afterUpdate(_0x38d86b){return function(_0x2cad0f){var _0x532161=_0x2cad0f[_0x675e('0x38')](_0x675e('0x39'))&&_0x2cad0f['closed'];var _0x4f4dbd=_0x2cad0f[_0x675e('0x38')](_0x675e('0x3a'));if(_0x532161||_0x4f4dbd){var _0x1bd457=_0x532161?_0x675e('0xa'):'substatus';var _0x2fb741=_0x2cad0f['get']({'plain':!![]});_0x2fb741['channel']=_0x38d86b;_0x2fb741[_0x675e('0x23')]=_0x38d86b;_0x2fb741[_0x675e('0x24')]=_0x532161?_0x675e('0x39'):_0x675e('0x3a');var _0x3341e2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2fb741[_0x675e('0x27')];return db[_0x675e('0x3b')][_0x675e('0x2a')](_0x3341e2,{'type':db[_0x675e('0x2b')][_0x675e('0x2c')]['SELECT'],'raw':!![]})[_0x675e('0x2e')](function(_0x3650c3){if(_0x3650c3){_0x2fb741[_0x675e('0x2f')]=_0x3650c3[0x0];}if(_0x2fb741['UserId']){return db['User'][_0x675e('0x32')]({'where':{'id':_0x2fb741[_0x675e('0x30')]},'attributes':['id',_0x675e('0x35'),_0x675e('0x3c'),_0x675e('0x33'),_0x675e('0x3d')],'raw':!![]})[_0x675e('0x2e')](function(_0x4092b8){_0x2fb741[_0x675e('0x3e')]=util[_0x675e('0x34')](_0x675e('0x3f'),_0x4092b8['name']);_0x2fb741[_0x675e('0x36')]=_0x4092b8;return request({'event':_0x1bd457,'message':_0x2fb741});})[_0x675e('0x1f')](function(_0x47e1cc){logger[_0x675e('0x1d')]('Trigger,\x20%s',_0x675e('0x40'),_0x47e1cc);});}else{return request({'event':_0x1bd457,'message':_0x2fb741});}});}};}exports[_0x675e('0x41')]=function(){for(var _0x4b521c=0x0;_0x4b521c<triggers[_0x675e('0x42')];_0x4b521c+=0x1){if(db[_0x675e('0x43')](triggers[_0x4b521c][_0x675e('0x44')])){db[triggers[_0x4b521c][_0x675e('0x44')]][_0x675e('0x45')](triggers[_0x4b521c][_0x675e('0x24')],triggers[_0x4b521c][_0x675e('0x46')](triggers[_0x4b521c][_0x675e('0x22')]['toLowerCase'](),triggers[_0x4b521c][_0x675e('0x47')]));}}};
\ No newline at end of file
index ddd0e99..1aae6d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d90=['blockedAt','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','isUndefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d90,0x135));var _0x07d9=function(_0x5aba7d,_0x1100bb){_0x5aba7d=_0x5aba7d-0x0;var _0x5b721c=_0x7d90[_0x5aba7d];return _0x5b721c;};'use strict';var _=require(_0x07d9('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x07d9('0x1'));var channels=[_0x07d9('0x2'),_0x07d9('0x3'),'chat',_0x07d9('0x4'),_0x07d9('0x5'),_0x07d9('0x6'),_0x07d9('0x7')];exports[_0x07d9('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x7af375){_0x7af375=_0x7af375[_0x07d9('0x9')]();return _[_0x07d9('0xa')](channels,_0x7af375);};exports[_0x07d9('0xb')]=function(_0x3f1fcf,_0x51ee31,_0x417053,_0x3166fd){var _0x22e02b={'loginAttempts':_0x51ee31,'blocked':_0x417053};if(!_[_0x07d9('0xc')](_0x3166fd)){_0x22e02b[_0x07d9('0xd')]=_0x3166fd;}return _0x3f1fcf['updateAttributes'](_0x22e02b);};exports[_0x07d9('0xe')]=function(_0x39de8b){return new BPromise(function(_0x526e9b,_0x2e80b3){var _0x37d5cd=0x0;if(_0x39de8b[_0x07d9('0xf')]!==_0x07d9('0x10')){_0x526e9b(_0x39de8b);}db[_0x07d9('0x11')][_0x07d9('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x39de8b['id']}}})[_0x07d9('0x13')](function(_0x4d8d3d){_0x37d5cd=_0x4d8d3d;return util[_0x07d9('0xe')]();})['then'](function(_0x20fc17){if(_0x20fc17&&_0x20fc17[_0x07d9('0x14')]&&_0x37d5cd>=_0x20fc17[_0x07d9('0x14')]){throw Error(_0x07d9('0x15'));}_0x526e9b(_0x39de8b);})[_0x07d9('0x16')](function(_0x565672){_0x2e80b3(_0x565672);});});};
\ No newline at end of file
+var _0x9d06=['agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','voice','mail','fax','sms','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role'];(function(_0x29161c,_0x2c28ec){var _0x3fb535=function(_0x381aef){while(--_0x381aef){_0x29161c['push'](_0x29161c['shift']());}};_0x3fb535(++_0x2c28ec);}(_0x9d06,0x1e9));var _0x69d0=function(_0x3f40d4,_0x1ff879){_0x3f40d4=_0x3f40d4-0x0;var _0x1c3c19=_0x9d06[_0x3f40d4];return _0x1c3c19;};'use strict';var _=require(_0x69d0('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x69d0('0x1'),_0x69d0('0x2'),'chat',_0x69d0('0x3'),_0x69d0('0x4'),'whatsapp',_0x69d0('0x5')];exports['getChannels']=function(){return channels;};exports[_0x69d0('0x6')]=function(_0x6c01c6){_0x6c01c6=_0x6c01c6[_0x69d0('0x7')]();return _[_0x69d0('0x8')](channels,_0x6c01c6);};exports[_0x69d0('0x9')]=function(_0x3b51d4,_0x199bdc,_0x4d8c90,_0xc5aa30){var _0x421326={'loginAttempts':_0x199bdc,'blocked':_0x4d8c90};if(!_[_0x69d0('0xa')](_0xc5aa30)){_0x421326[_0x69d0('0xb')]=_0xc5aa30;}return _0x3b51d4[_0x69d0('0xc')](_0x421326);};exports[_0x69d0('0xd')]=function(_0x4d192e){return new BPromise(function(_0x4322a3,_0x124362){var _0x24f308=0x0;if(_0x4d192e[_0x69d0('0xe')]!==_0x69d0('0xf')){_0x4322a3(_0x4d192e);}db[_0x69d0('0x10')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4d192e['id']}}})[_0x69d0('0x11')](function(_0x5bae98){_0x24f308=_0x5bae98;return util[_0x69d0('0xd')]();})[_0x69d0('0x11')](function(_0x1cadf2){if(_0x1cadf2&&_0x1cadf2[_0x69d0('0x12')]&&_0x24f308>=_0x1cadf2[_0x69d0('0x12')]){throw Error(_0x69d0('0x13'));}_0x4322a3(_0x4d192e);})[_0x69d0('0x14')](function(_0x397ea2){_0x124362(_0x397ea2);});});};
\ No newline at end of file
index 62ca083..4d33fd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5862=['404','status','render','exports'];(function(_0x481778,_0x3591a2){var _0x180616=function(_0x21c66b){while(--_0x21c66b){_0x481778['push'](_0x481778['shift']());}};_0x180616(++_0x3591a2);}(_0x5862,0x17f));var _0x2586=function(_0x22f4e1,_0x18c57c){_0x22f4e1=_0x22f4e1-0x0;var _0x49498f=_0x5862[_0x22f4e1];return _0x49498f;};'use strict';module[_0x2586('0x0')][0x194]=function pageNotFound(_0x23f1af,_0x557e90){var _0x3150f5=_0x2586('0x1');var _0x210014=0x194;var _0x2903f1={'status':_0x210014};_0x557e90[_0x2586('0x2')](_0x2903f1[_0x2586('0x2')]);_0x557e90[_0x2586('0x3')](_0x3150f5,{},function(_0x2cebe3,_0x35acde){if(_0x2cebe3){return _0x557e90[_0x2586('0x2')](_0x2903f1[_0x2586('0x2')])['json'](_0x2903f1);}_0x557e90['send'](_0x35acde);});};
\ No newline at end of file
+var _0x9f80=['send','exports','status','json'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x9f80,0x105));var _0x09f8=function(_0xcdcc4,_0x184c18){_0xcdcc4=_0xcdcc4-0x0;var _0x51be59=_0x9f80[_0xcdcc4];return _0x51be59;};'use strict';module[_0x09f8('0x0')][0x194]=function pageNotFound(_0x4c374e,_0x1e5e68){var _0x556435='404';var _0x5bdfae=0x194;var _0x165260={'status':_0x5bdfae};_0x1e5e68['status'](_0x165260[_0x09f8('0x1')]);_0x1e5e68['render'](_0x556435,{},function(_0x1c5419,_0x426892){if(_0x1c5419){return _0x1e5e68[_0x09f8('0x1')](_0x165260[_0x09f8('0x1')])[_0x09f8('0x2')](_0x165260);}_0x1e5e68[_0x09f8('0x3')](_0x426892);});};
\ No newline at end of file
index f00a70d..3c0c651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff3=['ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueue','MailQueues','ChatQueues','SmsQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','FaxAccount','FaxAccounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Messages','mailboxuser','mailbox','VoiceCallReport','CmContact','ContactId','MailAccountId','Imap','Dispositions','Answers','Interactions','List','Template','TemplateId','UserMailQueue','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','MailMessage','Attachments','Contact','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','Items','FaxAccountId','Exntensions','ListId','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccount','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','ChatMessage','user_has_chat_websites','Agent','ChatQueueId','ChatInteractionId','team_has_chat_queues','ChatGroup','ChatInternalMessage','Website','ChatInteractions','CompanyId','cm_contact_has_tags','Queue','CampaignId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','chat_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','Field','VariableId','DeskConfiguration','ZohoConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowConfiguration','FromId','ToId','SessionId','ProjectId','FaxQueues','team_has_openchannel_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromAccount','ToUserId','ToMailQueueId','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToAgent','OpenchannelTransferReport','FromOpenchannelAccountId','FromAgent','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSection','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','team_has_whatsapp_queues','exports','sequelize','jstz','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','username','password','database','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory'];(function(_0x5645ad,_0x580ea3){var _0x17d292=function(_0xe66902){while(--_0xe66902){_0x5645ad['push'](_0x5645ad['shift']());}};_0x17d292(++_0x580ea3);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2f10f8,_0x1c1940){_0x2f10f8=_0x2f10f8-0x0;var _0x5eb560=_0x5ff3[_0x2f10f8];return _0x5eb560;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x35ff('0x0'));var _=require('lodash');var jstz=require(_0x35ff('0x1'));var timezone=jstz['determine']();config[_0x35ff('0x0')]=_[_0x35ff('0x2')](config[_0x35ff('0x0')],{'database':_0x35ff('0x3'),'username':'xcall','password':_0x35ff('0x4'),'options':{'host':_0x35ff('0x5'),'port':0xcea,'dialect':_0x35ff('0x6'),'dialectOptions':{'charset':_0x35ff('0x7')},'logging':![],'timezone':timezone[_0x35ff('0x8')](),'define':{'charset':'utf8','collate':_0x35ff('0x9')}}});config['sequelizeHistory']=_[_0x35ff('0x2')](config[_0x35ff('0xa')],{'database':_0x35ff('0x3'),'username':'xcall','password':_0x35ff('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x35ff('0x6'),'dialectOptions':{'charset':_0x35ff('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x35ff('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config['sequelize'][_0x35ff('0xb')],config[_0x35ff('0x0')][_0x35ff('0xc')],config[_0x35ff('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x35ff('0xa')][_0x35ff('0xd')],config[_0x35ff('0xa')]['username'],config[_0x35ff('0xa')][_0x35ff('0xc')],config[_0x35ff('0xa')][_0x35ff('0xe')])};db[_0x35ff('0xf')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x11'));db[_0x35ff('0x12')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x13'));db[_0x35ff('0x14')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceContext/voiceContext.model');db[_0x35ff('0x15')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x16'));db['VoiceMusicOnHold']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x17'));db['VoiceQueue']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x18'));db[_0x35ff('0x19')]=db['sequelize'][_0x35ff('0x10')]('../api/voiceRecording/voiceRecording.model');db[_0x35ff('0x1a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x1b'));db[_0x35ff('0x1c')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceMail/voiceMail.model');db[_0x35ff('0x1d')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x1e'));db['VoiceCallReport']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x1f'));db[_0x35ff('0x20')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceDialReport/voiceDialReport.model');db[_0x35ff('0x21')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x35ff('0x22')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x23'));db[_0x35ff('0x24')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x25'));db[_0x35ff('0x26')]=db['sequelize'][_0x35ff('0x10')]('../api/trunk/trunk.model');db[_0x35ff('0x27')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x28'));db['UserVoiceQueueRt']=db[_0x35ff('0x0')]['import'](_0x35ff('0x29'));db[_0x35ff('0x2a')]=db['sequelize']['import'](_0x35ff('0x2b'));db[_0x35ff('0x2c')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x2d'));db['UserMailQueue']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x2e'));db[_0x35ff('0x2f')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x30'));db[_0x35ff('0x31')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x32'));db[_0x35ff('0x33')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x34'));db['UserWhatsappQueue']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x35'));db[_0x35ff('0x36')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x37'));db[_0x35ff('0x38')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x39'));db['MailAccount']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x3a'));db['MailQueue']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x3b'));db[_0x35ff('0x3c')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x3d'));db[_0x35ff('0x3e')]=db[_0x35ff('0x0')]['import']('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x3f'));db[_0x35ff('0x40')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x41'));db[_0x35ff('0x42')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x43'));db[_0x35ff('0x44')]=db['sequelize']['import'](_0x35ff('0x45'));db[_0x35ff('0x46')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x47'));db[_0x35ff('0x48')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x49'));db['FaxInteraction']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x4a'));db[_0x35ff('0x4b')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x4c'));db['FaxQueue']=db['sequelize'][_0x35ff('0x10')]('../api/faxQueue/faxQueue.model');db[_0x35ff('0x4d')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x4e'));db['SmsAccount']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x4f'));db[_0x35ff('0x50')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x51'));db[_0x35ff('0x52')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x53'));db[_0x35ff('0x54')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x55'));db[_0x35ff('0x56')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x35ff('0x0')]['import'](_0x35ff('0x57'));db[_0x35ff('0x58')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x59'));db[_0x35ff('0x5a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x5b'));db['OpenchannelMessage']=db['sequelize'][_0x35ff('0x10')]('../api/openchannelMessage/openchannelMessage.model');db[_0x35ff('0x5c')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x5d'));db[_0x35ff('0x5e')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x5f'));db[_0x35ff('0x60')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x61'));db[_0x35ff('0x62')]=db[_0x35ff('0x0')]['import']('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x63'));db['ChatMessage']=db[_0x35ff('0x0')]['import'](_0x35ff('0x64'));db['ChatOfflineMessage']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x65'));db[_0x35ff('0x66')]=db['sequelize']['import'](_0x35ff('0x67'));db['ChatGroup']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/chatGroup/chatGroup.model');db[_0x35ff('0x68')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x69'));db[_0x35ff('0x6a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x6b'));db['CmContact']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x6c'));db['CmHopper']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/cmHopper/cmHopper.model');db[_0x35ff('0x6d')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x6e'));db[_0x35ff('0x6f')]=db['sequelize']['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x35ff('0x70')]=db['sequelize'][_0x35ff('0x10')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x35ff('0x71')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x72'));db[_0x35ff('0x73')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x74'));db[_0x35ff('0x75')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x76'));db[_0x35ff('0x77')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x78'));db[_0x35ff('0x79')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/cannedAnswer/cannedAnswer.model');db[_0x35ff('0x7a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x7b'));db[_0x35ff('0x7c')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x7d'));db[_0x35ff('0x7e')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x7f'));db['Pause']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x80'));db['Cdr']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x81'));db[_0x35ff('0x82')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x83'));db[_0x35ff('0x84')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x85'));db[_0x35ff('0x86')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x87'));db[_0x35ff('0x88')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x89'));db['Template']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/template/template.model');db['Trigger']=db[_0x35ff('0x0')]['import'](_0x35ff('0x8a'));db[_0x35ff('0x8b')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x8c'));db[_0x35ff('0x8d')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x8e'));db['IntegrationReport']=db[_0x35ff('0x0')]['import'](_0x35ff('0x8f'));db['AnalyticCustomReport']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x90'));db[_0x35ff('0x91')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x92'));db[_0x35ff('0x93')]=db['sequelize']['import'](_0x35ff('0x94'));db[_0x35ff('0x95')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x96'));db[_0x35ff('0x97')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x98'));db[_0x35ff('0x99')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x9a'));db[_0x35ff('0x9b')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x35ff('0x9c')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x9d'));db[_0x35ff('0x9e')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intSalesforceField/intSalesforceField.model');db[_0x35ff('0x9f')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xa0'));db[_0x35ff('0xa1')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x35ff('0xa2')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xa3'));db[_0x35ff('0xa4')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x35ff('0x0')]['import'](_0x35ff('0xa5'));db[_0x35ff('0xa6')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xa7'));db[_0x35ff('0xa8')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xa9'));db['ZohoConfiguration']=db[_0x35ff('0x0')]['import'](_0x35ff('0xaa'));db[_0x35ff('0xab')]=db[_0x35ff('0x0')]['import']('../api/intZohoField/intZohoField.model');db[_0x35ff('0xac')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xad'));db[_0x35ff('0xae')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xaf'));db[_0x35ff('0xb0')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xb1'));db[_0x35ff('0xb2')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xb3'));db[_0x35ff('0xb4')]=db['sequelize'][_0x35ff('0x10')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x35ff('0xb5')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xb6'));db[_0x35ff('0xb7')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xb8'));db['VtigerConfiguration']=db[_0x35ff('0x0')]['import'](_0x35ff('0xb9'));db[_0x35ff('0xba')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xbb'));db[_0x35ff('0xbc')]=db['sequelize'][_0x35ff('0x10')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xbd'));db[_0x35ff('0xbe')]=db['sequelize']['import']('../api/intServicenowField/intServicenowField.model');db[_0x35ff('0xbf')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xc0'));db[_0x35ff('0xc1')]=db[_0x35ff('0x0')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x35ff('0xc2')]=db['sequelize']['import'](_0x35ff('0xc3'));db[_0x35ff('0xc4')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x35ff('0xc5')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xc6'));db[_0x35ff('0xc7')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xc8'));db[_0x35ff('0x8d')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x8e'));db[_0x35ff('0xc9')]=db['sequelize']['import'](_0x35ff('0xca'));db[_0x35ff('0xcb')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xcc'));db['ChatInternalMessage']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xcd'));db[_0x35ff('0xce')]=db['sequelize']['import'](_0x35ff('0xcf'));db[_0x35ff('0xd0')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xd1'));db[_0x35ff('0xd2')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xd3'));db[_0x35ff('0xd4')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xd5'));db[_0x35ff('0xd6')]=db[_0x35ff('0x0')]['import']('../api/squareReport/squareReport.model');db[_0x35ff('0xd7')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xd8'));db[_0x35ff('0xd9')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xda'));db[_0x35ff('0xdb')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/setting/setting.model');db[_0x35ff('0xdc')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xdd'));db[_0x35ff('0xde')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xdf'));db[_0x35ff('0xe0')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xe1'));db['SquareMessage']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xe2'));db[_0x35ff('0xe3')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xe4'));db[_0x35ff('0xe5')]=db[_0x35ff('0x0')]['import']('../api/license/license.model');db[_0x35ff('0xe6')]=db['sequelize'][_0x35ff('0x10')]('../api/campaign/campaign.model');db['Migration']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xe7'));db[_0x35ff('0xe8')]=db[_0x35ff('0x0')]['import']('../api/attachment/attachment.model');db[_0x35ff('0xe9')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xea'));db[_0x35ff('0xeb')]=db[_0x35ff('0x0')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x35ff('0x0')]['import'](_0x35ff('0xec'));db[_0x35ff('0xed')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xee'));db['OpenchannelTransferReport']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x35ff('0xef')]=db['sequelize']['import'](_0x35ff('0xf0'));db['CmList']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xf1'));db[_0x35ff('0xf2')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xf3'));db[_0x35ff('0xf4')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xf5'));db['UserProfileSection']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xf6'));db[_0x35ff('0xf7')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xf8'));db[_0x35ff('0xf9')]=db['sequelize'][_0x35ff('0x10')]('../api/userNotification/userNotification.model');db[_0x35ff('0xfa')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xfb'));db['WhatsappApplication']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/whatsappApplication/whatsappApplication.model');db[_0x35ff('0xfc')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xfd'));db[_0x35ff('0xfe')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xff'));db[_0x35ff('0x100')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x101'));db[_0x35ff('0x102')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x103'));db[_0x35ff('0x104')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/whatsappQueue/whatsappQueue.model');db[_0x35ff('0x105')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x106'));db[_0x35ff('0x107')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x35ff('0x108')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x109'));db['UserVoicePrefix']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x10a'));db[_0x35ff('0xf')][_0x35ff('0x10b')](db[_0x35ff('0x1c')],{'as':'VoiceMail','onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['VoiceRecording'],{'as':_0x35ff('0x10f'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['UserVoiceQueueRt'],{'as':_0x35ff('0x110'),'foreignKey':'UserId'});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['VoiceExtension'],{'as':_0x35ff('0x111'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db['User'][_0x35ff('0x10e')](db['CmHopperFinal'],{'as':_0x35ff('0x112'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')]['hasMany'](db[_0x35ff('0x70')],{'as':_0x35ff('0x113'),'foreignKey':_0x35ff('0x10d')});db['User'][_0x35ff('0x10e')](db[_0x35ff('0x71')],{'as':_0x35ff('0x71'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')]['hasMany'](db[_0x35ff('0x5a')],{'as':_0x35ff('0x114'),'foreignKey':'UserId'});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x35ff('0xf')]['hasMany'](db[_0x35ff('0x52')],{'as':'SmsInteractions','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')][_0x35ff('0x10e')](db[_0x35ff('0x115')],{'as':_0x35ff('0x116'),'foreignKey':_0x35ff('0x10d')});db['User']['hasMany'](db[_0x35ff('0x3e')],{'as':_0x35ff('0x117'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')]['hasMany'](db['WhatsappInteraction'],{'as':_0x35ff('0x118'),'foreignKey':_0x35ff('0x10d')});db['User'][_0x35ff('0x10e')](db['UserNotification'],{'as':_0x35ff('0x119'),'foreignKey':_0x35ff('0x11a')});db[_0x35ff('0xf')][_0x35ff('0x11b')](db['UserProfile'],{'as':_0x35ff('0xf4'),'foreignKey':_0x35ff('0x11c')});db['User'][_0x35ff('0x11d')](db['ChatGroup'],{'as':_0x35ff('0x11e'),'through':_0x35ff('0x11f')});db['User']['belongsToMany'](db['CmContact'],{'as':_0x35ff('0x120'),'through':_0x35ff('0x121')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x122')],{'as':_0x35ff('0x123'),'through':_0x35ff('0x124')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':'user_has_teams'});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x3e')],{'as':_0x35ff('0x117'),'through':_0x35ff('0x125')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x126')],{'as':'ChatInteractions','through':_0x35ff('0x127')});db['User'][_0x35ff('0x11d')](db[_0x35ff('0x115')],{'as':_0x35ff('0x116'),'through':'user_has_fax_interactions'});db['User']['belongsToMany'](db[_0x35ff('0x52')],{'as':_0x35ff('0x128'),'through':_0x35ff('0x129')});db[_0x35ff('0xf')]['belongsToMany'](db[_0x35ff('0x5a')],{'as':_0x35ff('0x114'),'through':_0x35ff('0x12a')});db['User']['belongsToMany'](db[_0x35ff('0xfc')],{'as':_0x35ff('0x118'),'through':_0x35ff('0x12b')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x12c')],{'as':_0x35ff('0x12d'),'through':_0x35ff('0x2a'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db['VoicePrefix'],{'as':_0x35ff('0x12e'),'through':_0x35ff('0x12f'),'required':![]});db[_0x35ff('0xf')]['belongsToMany'](db[_0x35ff('0x130')],{'as':_0x35ff('0x131'),'through':'UserMailQueue','required':![]});db['User'][_0x35ff('0x11d')](db['ChatQueue'],{'as':_0x35ff('0x132'),'through':_0x35ff('0x2c'),'required':![],'hooks':!![]});db[_0x35ff('0xf')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':_0x35ff('0x2f'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x56')],{'as':_0x35ff('0x133'),'through':_0x35ff('0x31'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x5c')],{'as':'OpenchannelQueues','through':_0x35ff('0x33'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x104')],{'as':_0x35ff('0x134'),'through':_0x35ff('0x135'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db['CmList'],{'through':_0x35ff('0x124')});db['User'][_0x35ff('0x11d')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x136'),'through':'user_has_chat_websites'});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x137')],{'as':_0x35ff('0x138'),'through':'user_has_fax_accounts'});db[_0x35ff('0xf')]['belongsToMany'](db[_0x35ff('0x139')],{'as':_0x35ff('0x13a'),'through':_0x35ff('0x13b')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db['OpenchannelAccount'],{'as':_0x35ff('0x13c'),'through':_0x35ff('0x13d')});db['User'][_0x35ff('0x11d')](db['SmsAccount'],{'as':_0x35ff('0x13e'),'through':_0x35ff('0x13f')});db['User'][_0x35ff('0x11d')](db[_0x35ff('0xfa')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0xde')],{'as':_0x35ff('0x140'),'through':_0x35ff('0x141')});db['VoiceChanSpy'][_0x35ff('0x10e')](db[_0x35ff('0x15')],{'as':_0x35ff('0x142'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x143')});db['VoiceContext'][_0x35ff('0x10e')](db[_0x35ff('0x15')],{'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x15')]['hasMany'](db[_0x35ff('0x15')],{'as':_0x35ff('0x144'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x145')][_0x35ff('0x11d')](db[_0x35ff('0x86')],{'as':_0x35ff('0x146'),'through':_0x35ff('0x147')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db[_0x35ff('0x148')],{'as':_0x35ff('0x149'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db[_0x35ff('0x14b')],{'as':_0x35ff('0x14c'),'foreignKey':'VoiceQueueId'});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db[_0x35ff('0x6f')],{'as':_0x35ff('0x112'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x35ff('0x10e')](db[_0x35ff('0x70')],{'as':_0x35ff('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db['ReportAgentPreview'],{'as':_0x35ff('0x71'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db['CmHopperBlack'],{'as':_0x35ff('0x14e'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db['JscriptySessionReport'],{'as':_0x35ff('0x14f'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x11b')](db['Trunk'],{'as':_0x35ff('0x26'),'foreignKey':_0x35ff('0x150')});db[_0x35ff('0x12c')][_0x35ff('0x11b')](db[_0x35ff('0x26')],{'as':'TrunkBackup','foreignKey':_0x35ff('0x151')});db[_0x35ff('0x12c')][_0x35ff('0x11b')](db['Interval'],{'as':_0x35ff('0x7e'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x12c')]['belongsTo'](db[_0x35ff('0x153')],{'as':_0x35ff('0x154'),'foreignKey':_0x35ff('0x155')});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0x122')],{'as':_0x35ff('0x123'),'through':_0x35ff('0x156')});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x2a')});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0x122')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x35ff('0x19')][_0x35ff('0x11b')](db['User'],{'as':_0x35ff('0xf'),'foreignKey':'UserId'});db[_0x35ff('0x1a')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x1c')]['hasMany'](db[_0x35ff('0x1d')],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x159'),'sourceKey':_0x35ff('0x15a')});db['VoiceMailMessage'][_0x35ff('0x11b')](db[_0x35ff('0x1c')],{'foreignKey':_0x35ff('0x159'),'targetKey':'mailbox'});db[_0x35ff('0x15b')][_0x35ff('0x10e')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x35ff('0x15b')][_0x35ff('0x10e')](db[_0x35ff('0x21')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x35ff('0x15b')]['belongsTo'](db[_0x35ff('0xf')],{'as':'User','foreignKey':'UserId'});db[_0x35ff('0x15b')]['belongsTo'](db[_0x35ff('0x15c')],{'as':'Contact','foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x36')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{'as':_0x35ff('0x139'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x38')]['belongsTo'](db['MailAccount'],{'as':_0x35ff('0x139'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x139')][_0x35ff('0x10b')](db['MailServerIn'],{'as':_0x35ff('0x15f'),'onDelete':'cascade'});db[_0x35ff('0x139')]['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x139')][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x15e'),'onDelete':'cascade'});db['MailAccount'][_0x35ff('0x10e')](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x139')][_0x35ff('0x10e')](db['MailMessage'],{'as':_0x35ff('0x158'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x139')][_0x35ff('0x10e')](db['MailInteraction'],{'as':_0x35ff('0x162')});db['MailAccount'][_0x35ff('0x10e')](db[_0x35ff('0x40')],{'as':_0x35ff('0x144')});db[_0x35ff('0x139')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0x139')]['belongsTo'](db[_0x35ff('0x164')],{'as':'Template','foreignKey':_0x35ff('0x165')});db[_0x35ff('0x139')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db[_0x35ff('0x139')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':'Agents','through':_0x35ff('0x13b')});db['MailQueue']['belongsToMany'](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x166')});db[_0x35ff('0x130')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x167'),'as':_0x35ff('0x168')});db[_0x35ff('0x3e')][_0x35ff('0x10e')](db['MailMessage'],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x169')});db[_0x35ff('0x3e')]['belongsTo'](db[_0x35ff('0x139')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x3e')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':'Contact','foreignKey':'ContactId'});db[_0x35ff('0x3e')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x3e')]['belongsToMany'](db[_0x35ff('0x88')],{'through':'mail_interaction_has_tags','as':_0x35ff('0x16c')});db[_0x35ff('0x3e')]['belongsToMany'](db[_0x35ff('0x88')],{'through':_0x35ff('0x16d'),'as':_0x35ff('0x16e')});db['MailInteraction'][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x16f'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x35ff('0x170')]['hasMany'](db[_0x35ff('0xe8')],{'as':_0x35ff('0x171'),'onDelete':'cascade'});db[_0x35ff('0x170')]['belongsTo'](db[_0x35ff('0xf')],{'as':_0x35ff('0xf')});db[_0x35ff('0x170')][_0x35ff('0x11b')](db['CmContact'],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x172')});db[_0x35ff('0x170')]['belongsTo'](db['MailInteraction'],{'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x169')});db[_0x35ff('0x170')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{'as':'Account','foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x170')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x5e'),'foreignKey':'ChatWebsiteId'});db[_0x35ff('0x170')][_0x35ff('0x11b')](db[_0x35ff('0x174')],{'as':_0x35ff('0x174'),'foreignKey':_0x35ff('0x175')});db[_0x35ff('0x40')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':'restrict'});db[_0x35ff('0x40')]['belongsTo'](db['MailQueue'],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x40')][_0x35ff('0x11b')](db['MailAccount'],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x40')]['belongsTo'](db[_0x35ff('0x7e')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x35ff('0x40')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x42')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{});db[_0x35ff('0x42')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0x42')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['MailQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x3e')],{});db['MailQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x170')],{});db['MailQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x42')][_0x35ff('0x11b')](db['MailQueue'],{});db['Dashboard'][_0x35ff('0x10e')](db[_0x35ff('0x46')],{'as':_0x35ff('0x178'),'onDelete':_0x35ff('0x10c')});db['FaxAccount']['hasMany'](db[_0x35ff('0x7a')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x35ff('0x10c')});db['FaxAccount'][_0x35ff('0x10e')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x35ff('0x179')});db[_0x35ff('0x137')][_0x35ff('0x10e')](db['FaxInteraction'],{'as':_0x35ff('0x162')});db[_0x35ff('0x137')][_0x35ff('0x10e')](db[_0x35ff('0x48')],{'as':_0x35ff('0x144')});db[_0x35ff('0x137')][_0x35ff('0x10e')](db[_0x35ff('0x15')],{'as':_0x35ff('0x17a'),'onDelete':_0x35ff('0x10c')});db['FaxAccount'][_0x35ff('0x10e')](db['FaxMessage'],{'as':_0x35ff('0x158')});db[_0x35ff('0x137')]['belongsTo'](db[_0x35ff('0x26')],{'as':'Trunk'});db[_0x35ff('0x137')]['belongsTo'](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x137')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db['FaxAccount'][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':'Agents','through':_0x35ff('0x17c')});db[_0x35ff('0x48')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x48')][_0x35ff('0x11b')](db[_0x35ff('0x17d')],{'onDelete':_0x35ff('0x176')});db['FaxApplication'][_0x35ff('0x11b')](db['FaxAccount'],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x48')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x115')]['hasMany'](db[_0x35ff('0x4b')],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x17e')});db[_0x35ff('0x115')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x179')});db[_0x35ff('0x115')][_0x35ff('0x11b')](db['CmContact'],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x115')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':'Owner','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x115')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x17f'),'as':_0x35ff('0x16c')});db[_0x35ff('0x115')]['belongsToMany'](db[_0x35ff('0x88')],{'through':_0x35ff('0x17f'),'as':_0x35ff('0x16e')});db['FaxInteraction'][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0x35ff('0x4b')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x10c'),'as':'User'});db[_0x35ff('0x4b')][_0x35ff('0x11b')](db['FaxInteraction'],{'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x17e')});db[_0x35ff('0x4b')]['belongsTo'](db['CmContact'],{'onDelete':_0x35ff('0x10c'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0x35ff('0xe8')],{'as':'Attachment','foreignKey':_0x35ff('0x180')});db[_0x35ff('0x4b')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x179')});db[_0x35ff('0x17d')]['belongsToMany'](db[_0x35ff('0xf')],{'as':'Agents','through':'UserFaxQueue'});db[_0x35ff('0x17d')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x181'),'as':'Teams'});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{});db['FaxQueueReport']['belongsTo'](db[_0x35ff('0x122')],{'as':'List','foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x4d')]['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db[_0x35ff('0x115')],{});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db['FaxMessage'],{});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db['FaxQueue'],{});db[_0x35ff('0x182')]['hasMany'](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':'SmsAccountId','onDelete':_0x35ff('0x10c')});db['SmsAccount']['hasMany'](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':'SmsAccountId'});db[_0x35ff('0x182')][_0x35ff('0x10e')](db[_0x35ff('0x54')],{'as':'Messages','foreignKey':_0x35ff('0x183')});db[_0x35ff('0x182')][_0x35ff('0x10e')](db[_0x35ff('0x52')],{'as':_0x35ff('0x162')});db[_0x35ff('0x182')][_0x35ff('0x10e')](db[_0x35ff('0x50')],{'as':_0x35ff('0x144')});db[_0x35ff('0x182')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x182')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db[_0x35ff('0x182')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x13f')});db[_0x35ff('0x50')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x50')]['belongsTo'](db[_0x35ff('0x56')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x50')]['belongsTo'](db[_0x35ff('0x182')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x50')]['belongsTo'](db[_0x35ff('0x7e')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x152')});db['SmsApplication'][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':'restrict','foreignKey':_0x35ff('0x177')});db['SmsInteraction'][_0x35ff('0x10e')](db[_0x35ff('0x54')],{'as':'Messages','onDelete':_0x35ff('0x10c'),'foreignKey':'SmsInteractionId'});db[_0x35ff('0x52')][_0x35ff('0x11b')](db[_0x35ff('0x182')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x183')});db[_0x35ff('0x52')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['SmsInteraction']['belongsTo'](db[_0x35ff('0xf')],{'as':'Owner','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x52')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x184'),'as':_0x35ff('0x16c')});db['SmsInteraction'][_0x35ff('0x11d')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x35ff('0x16e')});db[_0x35ff('0x52')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x129'),'foreignKey':'SmsInteractionId'});db[_0x35ff('0x54')][_0x35ff('0x11b')](db['User'],{'as':_0x35ff('0xf')});db['SmsMessage']['belongsTo'](db[_0x35ff('0x15c')],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x172')});db[_0x35ff('0x54')]['belongsTo'](db[_0x35ff('0x52')],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x185')});db[_0x35ff('0x54')]['belongsTo'](db[_0x35ff('0x182')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x183')});db[_0x35ff('0x56')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x31'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x186'),'as':_0x35ff('0x168')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x188'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x5a')],{'as':_0x35ff('0x162'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x189')],{'as':_0x35ff('0x158'),'foreignKey':'OpenchannelAccountId'});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x58')],{'as':_0x35ff('0x144'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x187')]['belongsTo'](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x187')][_0x35ff('0x11b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db[_0x35ff('0x187')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x13d')});db['OpenchannelApplication'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x58')][_0x35ff('0x11b')](db[_0x35ff('0x5c')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x18a')});db[_0x35ff('0x58')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x58')]['belongsTo'](db[_0x35ff('0x7e')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x58')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x5a')][_0x35ff('0x10e')](db[_0x35ff('0x189')],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x18b')});db['OpenchannelInteraction']['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x35ff('0x188')});db[_0x35ff('0x5a')][_0x35ff('0x11b')](db['CmContact'],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['OpenchannelInteraction'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x5a')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x18c'),'as':_0x35ff('0x16c')});db[_0x35ff('0x5a')][_0x35ff('0x11d')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x35ff('0x16e')});db['OpenchannelInteraction'][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x12a'),'foreignKey':_0x35ff('0x18b')});db['OpenchannelMessage'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x10c'),'as':'User'});db['OpenchannelMessage'][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'onDelete':'cascade','as':'Contact'});db[_0x35ff('0x189')][_0x35ff('0x11b')](db[_0x35ff('0x5a')],{'onDelete':_0x35ff('0x10c'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x35ff('0x11b')](db[_0x35ff('0xe8')],{'as':_0x35ff('0xe8'),'foreignKey':'AttachmentId'});db[_0x35ff('0x189')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x5c')][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x157'),'through':_0x35ff('0x33'),'foreignKey':_0x35ff('0x18a')});db[_0x35ff('0x5c')][_0x35ff('0x11d')](db['Team'],{'through':'team_has_openchannel_queues','as':_0x35ff('0x168')});db['ChatWebsite'][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x18d'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x5e')][_0x35ff('0x10e')](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x18d')});db['ChatWebsite'][_0x35ff('0x10e')](db[_0x35ff('0x68')],{'as':_0x35ff('0x18e')});db[_0x35ff('0x5e')]['hasMany'](db['ChatInteraction'],{'as':_0x35ff('0x162')});db['ChatWebsite'][_0x35ff('0x10e')](db[_0x35ff('0x62')],{'as':'Applications'});db[_0x35ff('0x5e')][_0x35ff('0x10e')](db[_0x35ff('0x18f')],{'as':_0x35ff('0x158')});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db[_0x35ff('0x7e')],{'as':_0x35ff('0x7e'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':_0x35ff('0x154'),'foreignKey':_0x35ff('0x155')});db[_0x35ff('0x5e')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x190')});db['OpenchannelQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x187')],{});db[_0x35ff('0x60')]['belongsTo'](db[_0x35ff('0x122')],{'as':'List','foreignKey':_0x35ff('0x17b')});db['OpenchannelQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x60')][_0x35ff('0x11b')](db['OpenchannelInteraction'],{});db[_0x35ff('0x60')][_0x35ff('0x11b')](db[_0x35ff('0x189')],{});db[_0x35ff('0x60')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x60')][_0x35ff('0x11b')](db[_0x35ff('0x5c')],{});db[_0x35ff('0x62')]['belongsTo'](db['User'],{'as':_0x35ff('0x191'),'foreignKey':'UserId','onDelete':'restrict'});db[_0x35ff('0x62')][_0x35ff('0x11b')](db[_0x35ff('0x66')],{'as':'Queue','foreignKey':_0x35ff('0x192'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x62')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':'Website','foreignKey':_0x35ff('0x18d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x62')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x126')][_0x35ff('0x10e')](db[_0x35ff('0x18f')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x35ff('0x193')});db['ChatInteraction'][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x126')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x126')]['belongsTo'](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x126')][_0x35ff('0x11d')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x35ff('0x16c')});db[_0x35ff('0x126')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':'chat_interaction_has_tags','as':_0x35ff('0x16e')});db['ChatInteraction'][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x127'),'foreignKey':'ChatInteractionId'});db[_0x35ff('0x18f')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':'cascade','as':'User'});db[_0x35ff('0x18f')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'onDelete':_0x35ff('0x10c'),'as':'Contact','foreignKey':'ContactId'});db['ChatMessage'][_0x35ff('0x11b')](db[_0x35ff('0x126')],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x193')});db[_0x35ff('0x18f')]['belongsTo'](db[_0x35ff('0xe8')],{'as':'Attachment','foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db[_0x35ff('0x5e')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x174')][_0x35ff('0x10e')](db[_0x35ff('0xe8')],{'as':'Attachments','foreignKey':_0x35ff('0x175'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db[_0x35ff('0x174')][_0x35ff('0x11b')](db['CmContact'],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x174')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x66')]['belongsToMany'](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x2c'),'hooks':!![]});db[_0x35ff('0x66')]['belongsToMany'](db[_0x35ff('0xe3')],{'through':_0x35ff('0x194'),'as':_0x35ff('0x168')});db[_0x35ff('0x195')][_0x35ff('0x10e')](db[_0x35ff('0x196')],{'as':_0x35ff('0x158'),'foreignKey':'ChatGroupId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x195')][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x149'),'through':_0x35ff('0x11f')});db[_0x35ff('0x68')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x197'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x6a')]['hasMany'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x120'),'foreignKey':'CompanyId'});db[_0x35ff('0x15c')]['hasMany'](db['CmHopper'],{'as':_0x35ff('0x14c'),'foreignKey':'ContactId'});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x6f')],{'as':_0x35ff('0x112'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x70')],{'as':_0x35ff('0x14d'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')]['hasMany'](db[_0x35ff('0x71')],{'as':'ReportAgentPreview','foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')]['hasMany'](db[_0x35ff('0xd2')],{'as':_0x35ff('0x14f'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x5a')],{'as':_0x35ff('0x114'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x126')],{'as':_0x35ff('0x198'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x52')],{'as':_0x35ff('0x128'),'foreignKey':_0x35ff('0x15d'),'onDelete':'restrict'});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x115')],{'as':_0x35ff('0x116'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x3e')],{'as':_0x35ff('0x117'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')]['belongsTo'](db[_0x35ff('0x6a')],{'as':'Company','foreignKey':_0x35ff('0x199')});db[_0x35ff('0x15c')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x15c')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x121')});db[_0x35ff('0x15c')]['belongsToMany'](db[_0x35ff('0x88')],{'as':_0x35ff('0x16c'),'through':'cm_contact_has_tags'});db[_0x35ff('0x15c')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x19a'),'as':'ThroughTags'});db[_0x35ff('0x14b')]['belongsTo'](db[_0x35ff('0x15c')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x14b')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':'ListId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x14b')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x191'),'foreignKey':'UserId'});db[_0x35ff('0x14b')][_0x35ff('0x11b')](db[_0x35ff('0x12c')],{'as':_0x35ff('0x19b'),'foreignKey':_0x35ff('0x14a'),'onDelete':_0x35ff('0x10c')});db['CmHopper'][_0x35ff('0x11b')](db['Campaign'],{'as':'Campaign','foreignKey':_0x35ff('0x19c'),'onDelete':_0x35ff('0x10c')});db['CmHopper'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':'OwnerId'});db[_0x35ff('0x6d')]['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x6d')]['belongsTo'](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x6d')][_0x35ff('0x11b')](db[_0x35ff('0x12c')],{'as':_0x35ff('0x19b'),'foreignKey':'VoiceQueueId','onDelete':_0x35ff('0x10c')});db['CmHopperBlack'][_0x35ff('0x11b')](db[_0x35ff('0xe6')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x35ff('0x10c')});db['Automation'][_0x35ff('0x10e')](db['Condition'],{'as':{'plural':_0x35ff('0x19d'),'singular':'OneAll'},'foreignKey':_0x35ff('0x19e'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db[_0x35ff('0x77')][_0x35ff('0x10e')](db[_0x35ff('0x7c')],{'as':{'plural':_0x35ff('0x19f'),'singular':_0x35ff('0x1a0')},'foreignKey':_0x35ff('0x1a1'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db['Automation'][_0x35ff('0x10e')](db[_0x35ff('0x75')],{'as':_0x35ff('0x1a2'),'foreignKey':_0x35ff('0x1a3'),'onDelete':'cascade','hooks':!![]});db[_0x35ff('0x7a')][_0x35ff('0x10e')](db['Disposition'],{'as':_0x35ff('0x160'),'foreignKey':'ParentId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db[_0x35ff('0x7e')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x35ff('0x10c'),'hooks':!![],'required':![]});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db['VoiceExtension'],{'as':_0x35ff('0x111'),'foreignKey':_0x35ff('0x152'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db[_0x35ff('0x40')],{'as':_0x35ff('0x1a4'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x7e')]['hasMany'](db['ChatApplication'],{'as':_0x35ff('0x1a5'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x7e')]['hasMany'](db[_0x35ff('0x48')],{'as':_0x35ff('0x1a6'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db[_0x35ff('0x50')],{'as':'SmsApplications','foreignKey':_0x35ff('0x152')});db[_0x35ff('0x84')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{});db[_0x35ff('0x84')][_0x35ff('0x11b')](db[_0x35ff('0x91')],{'foreignKey':_0x35ff('0x1a7')});db[_0x35ff('0x84')][_0x35ff('0x11b')](db[_0x35ff('0x1a8')],{'foreignKey':_0x35ff('0x1a9')});db[_0x35ff('0x86')][_0x35ff('0x11d')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x35ff('0x147'),'onDelete':_0x35ff('0x176')});db['Tag'][_0x35ff('0x11d')](db['CmContact'],{'through':_0x35ff('0x19a')});db[_0x35ff('0x88')][_0x35ff('0x11d')](db['ChatInteraction'],{'through':_0x35ff('0x1aa')});db[_0x35ff('0x88')][_0x35ff('0x11d')](db[_0x35ff('0x3e')],{'through':_0x35ff('0x16d')});db['Tag']['belongsToMany'](db[_0x35ff('0x52')],{'through':_0x35ff('0x184')});db['Tag']['belongsToMany'](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db['Tag'][_0x35ff('0x11d')](db[_0x35ff('0x5a')],{'through':_0x35ff('0x18c')});db['Tag'][_0x35ff('0x11d')](db[_0x35ff('0xfc')],{'through':_0x35ff('0x1ab')});db[_0x35ff('0x1ac')][_0x35ff('0x10e')](db[_0x35ff('0x7c')],{'as':{'plural':_0x35ff('0x1ad'),'singular':_0x35ff('0x1ae')},'foreignKey':_0x35ff('0x1af'),'onDelete':'cascade','hooks':!![]});db[_0x35ff('0x1ac')][_0x35ff('0x10e')](db[_0x35ff('0x7c')],{'as':{'plural':_0x35ff('0x1b0'),'singular':'AnyCondition'},'foreignKey':_0x35ff('0x1b1'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db[_0x35ff('0x1ac')][_0x35ff('0x10e')](db[_0x35ff('0x75')],{'as':_0x35ff('0x1a2'),'foreignKey':_0x35ff('0x1b2'),'onDelete':'cascade','hooks':!![]});db[_0x35ff('0x1a8')][_0x35ff('0x10e')](db[_0x35ff('0x97')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1a9'),'hooks':!![]});db[_0x35ff('0x91')][_0x35ff('0x10e')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x35ff('0x1a7')});db[_0x35ff('0x95')][_0x35ff('0x10e')](db[_0x35ff('0x97')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':'MetricId'});db[_0x35ff('0x97')][_0x35ff('0x11b')](db[_0x35ff('0x95')],{'foreignKey':_0x35ff('0x1b4')});db['SalesforceAccount'][_0x35ff('0x10e')](db[_0x35ff('0x9c')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x9c')]['hasMany'](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0x9c')][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':'DescriptionId'});db[_0x35ff('0x9c')][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':'Fields','onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0x9c')][_0x35ff('0x11b')](db['SalesforceAccount'],{'as':_0x35ff('0x16a'),'foreignKey':'AccountId'});db['SalesforceField'][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0x9e')][_0x35ff('0x10e')](db['SalesforceField'],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0x9e')][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1be'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0x9e')][_0x35ff('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0x9f')]['hasMany'](db[_0x35ff('0xa1')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xa1')]['hasMany'](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xa1')]['hasMany'](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':'FieldId'});db[_0x35ff('0xa1')]['belongsTo'](db[_0x35ff('0x9f')],{'as':'Account','foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xa2')][_0x35ff('0x10e')](db['SugarcrmField'],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db['SugarcrmField'][_0x35ff('0x10e')](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xa2')][_0x35ff('0x10e')](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xa2')][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xa4')]['hasMany'](db[_0x35ff('0x1c0')],{'as':'Configurations','onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c0')]['hasMany'](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':'SubjectId'});db[_0x35ff('0x1c0')]['hasMany'](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1b9'),'onDelete':'cascade','foreignKey':_0x35ff('0x1bd')});db['DeskConfiguration'][_0x35ff('0x10e')](db['DeskField'],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1ba')});db['DeskConfiguration'][_0x35ff('0x11b')](db[_0x35ff('0xa4')],{'as':'Account','foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c0')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':'int_desk_configuration_has_tags'});db[_0x35ff('0xa6')][_0x35ff('0x10e')](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db['DeskField']['hasMany'](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xa6')][_0x35ff('0x10e')](db['DeskField'],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xa6')][_0x35ff('0x11b')](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db['ZohoAccount'][_0x35ff('0x10e')](db[_0x35ff('0x1c1')],{'as':_0x35ff('0x1b5'),'onDelete':'cascade','foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c1')][_0x35ff('0x10e')](db['ZohoField'],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db['ZohoConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xab')],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0x1c1')]['hasMany'](db[_0x35ff('0xab')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x35ff('0x1c1')][_0x35ff('0x11b')](db[_0x35ff('0xa8')],{'as':'Account','foreignKey':'AccountId'});db[_0x35ff('0xab')][_0x35ff('0x10e')](db[_0x35ff('0xab')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xab')]['hasMany'](db[_0x35ff('0xab')],{'as':'Description','foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xab')][_0x35ff('0x10e')](db[_0x35ff('0xab')],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db['ZohoField'][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xac')][_0x35ff('0x10e')](db[_0x35ff('0xae')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db['ZendeskConfiguration']['hasMany'](db[_0x35ff('0xb0')],{'as':'Subjects','foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xae')][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':'Descriptions','foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xae')][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1b3'),'foreignKey':_0x35ff('0x1ba')});db['ZendeskConfiguration'][_0x35ff('0x11b')](db[_0x35ff('0xac')],{'as':_0x35ff('0x16a'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x1c2')});db[_0x35ff('0xb0')]['hasMany'](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db['ZendeskField'][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db['ZendeskField'][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1be'),'foreignKey':_0x35ff('0x1ba')});db['ZendeskField'][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':'VariableId'});db[_0x35ff('0xb2')][_0x35ff('0x10e')](db[_0x35ff('0xb4')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db['FreshdeskConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':'Subjects','onDelete':_0x35ff('0x10c'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration']['hasMany'](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1b9'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x35ff('0xb4')][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':'FieldId'});db[_0x35ff('0xb4')][_0x35ff('0x11b')](db['FreshdeskAccount'],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xb4')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x1c3')});db['FreshdeskField'][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xb5')][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xb5')][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xb5')][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xb7')][_0x35ff('0x10e')](db['VtigerConfiguration'],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c4')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x35ff('0x1c4')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':_0x35ff('0x1b9'),'foreignKey':'DescriptionId'});db[_0x35ff('0x1c4')]['hasMany'](db[_0x35ff('0xba')],{'as':_0x35ff('0x1b3'),'foreignKey':_0x35ff('0x1ba')});db['VtigerConfiguration'][_0x35ff('0x11b')](db[_0x35ff('0xb7')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xba')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xba')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':_0x35ff('0x1bc'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x35ff('0x10e')](db['VtigerField'],{'as':_0x35ff('0x1be'),'foreignKey':_0x35ff('0x1ba')});db['VtigerField'][_0x35ff('0x11b')](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xbc')][_0x35ff('0x10e')](db['ServicenowConfiguration'],{'as':_0x35ff('0x1b5'),'onDelete':'cascade','foreignKey':_0x35ff('0x1b6')});db['ServicenowConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xbe')],{'as':_0x35ff('0x1b7'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0x1c5')][_0x35ff('0x10e')](db[_0x35ff('0xbe')],{'as':'Descriptions','foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0x1c5')]['hasMany'](db[_0x35ff('0xbe')],{'as':_0x35ff('0x1b3'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0x1c5')][_0x35ff('0x11b')](db['ServicenowAccount'],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xbe')][_0x35ff('0x10e')](db['ServicenowField'],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xbe')][_0x35ff('0x10e')](db[_0x35ff('0xbe')],{'as':_0x35ff('0x1bc'),'foreignKey':'DescriptionId'});db[_0x35ff('0xbe')][_0x35ff('0x10e')](db['ServicenowField'],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xbe')]['belongsTo'](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':'VariableId'});db[_0x35ff('0xbf')][_0x35ff('0x10e')](db[_0x35ff('0xc1')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xc1')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc1')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xc1')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0xc1')]['belongsTo'](db[_0x35ff('0xbf')],{'as':'Account','foreignKey':_0x35ff('0x1b6')});db['Dynamics365Field'][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':'Subject','foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc2')][_0x35ff('0x10e')](db['Dynamics365Field'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x35ff('0xc2')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':'Field','foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0xc2')][_0x35ff('0x11b')](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xc4')][_0x35ff('0x10e')](db[_0x35ff('0xc5')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':'AccountId'});db[_0x35ff('0xc5')]['hasMany'](db[_0x35ff('0xc7')],{'as':'Subjects','foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc5')]['hasMany'](db[_0x35ff('0xc7')],{'as':_0x35ff('0x1b9'),'foreignKey':_0x35ff('0x1bd')});db['FreshsalesConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xc7')],{'as':'Fields','foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0xc5')]['belongsTo'](db['FreshsalesAccount'],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db['FreshsalesField'][_0x35ff('0x10e')](db[_0x35ff('0xc7')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc7')]['hasMany'](db[_0x35ff('0xc7')],{'as':_0x35ff('0x1bc'),'foreignKey':'DescriptionId'});db[_0x35ff('0xc7')][_0x35ff('0x10e')](db[_0x35ff('0xc7')],{'as':'Field','foreignKey':'FieldId'});db[_0x35ff('0xc7')][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db[_0x35ff('0x126')],{});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db['ChatMessage'],{});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0xcb')]['belongsTo'](db['ChatQueue'],{});db['ChatInternalMessage'][_0x35ff('0x11b')](db['User'],{'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1c6')});db['ChatInternalMessage'][_0x35ff('0x11b')](db['User'],{'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1c7')});db[_0x35ff('0xd2')]['hasMany'](db[_0x35ff('0xd0')],{'foreignKey':_0x35ff('0x1c8'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0xd2')][_0x35ff('0x10e')](db[_0x35ff('0xce')],{'foreignKey':_0x35ff('0x1c8'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db[_0x35ff('0x182')],{});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db['SmsQueueReport']['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db[_0x35ff('0x52')],{});db['SmsQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x54')],{});db['SmsQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db[_0x35ff('0x56')],{});db[_0x35ff('0xd9')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x35ff('0x1c9')});db[_0x35ff('0xd9')][_0x35ff('0x10e')](db[_0x35ff('0xd0')],{'foreignKey':_0x35ff('0x1c9')});db['JscriptyProject'][_0x35ff('0x10e')](db[_0x35ff('0xce')],{'foreignKey':_0x35ff('0x1c9')});db[_0x35ff('0xde')][_0x35ff('0x11d')](db['User'],{'as':'Users','through':'user_has_square_projects'});db[_0x35ff('0xe3')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0x35ff('0xe3')][_0x35ff('0x11d')](db['VoiceQueue'],{'through':_0x35ff('0x107'),'as':_0x35ff('0x12d')});db['Team'][_0x35ff('0x11d')](db[_0x35ff('0x130')],{'through':_0x35ff('0x167'),'as':_0x35ff('0x131')});db[_0x35ff('0xe3')][_0x35ff('0x11d')](db[_0x35ff('0x66')],{'through':_0x35ff('0x194'),'as':'ChatQueues'});db[_0x35ff('0xe3')][_0x35ff('0x11d')](db[_0x35ff('0x17d')],{'through':_0x35ff('0x181'),'as':_0x35ff('0x1ca')});db['Team'][_0x35ff('0x11d')](db['SmsQueue'],{'through':_0x35ff('0x186'),'as':_0x35ff('0x133')});db[_0x35ff('0xe3')]['belongsToMany'](db[_0x35ff('0x5c')],{'through':_0x35ff('0x1cb'),'as':'OpenchannelQueues'});db[_0x35ff('0xe3')]['belongsToMany'](db[_0x35ff('0x104')],{'through':'team_has_whatsapp_queues','as':_0x35ff('0x134')});db['Team'][_0x35ff('0x11d')](db[_0x35ff('0xf2')],{'through':_0x35ff('0x108'),'as':_0x35ff('0x12e')});db[_0x35ff('0xe6')][_0x35ff('0x10e')](db[_0x35ff('0x14b')],{'as':'Hoppers','foreignKey':_0x35ff('0x19c')});db[_0x35ff('0xe6')][_0x35ff('0x10e')](db['CmHopperFinal'],{'as':_0x35ff('0x112'),'foreignKey':'CampaignId'});db[_0x35ff('0xe6')]['hasMany'](db['CmHopperHistory'],{'as':_0x35ff('0x14d'),'foreignKey':_0x35ff('0x19c')});db[_0x35ff('0xe6')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x35ff('0x19c')});db[_0x35ff('0xe6')][_0x35ff('0x11b')](db[_0x35ff('0x26')],{'as':_0x35ff('0x26'),'foreignKey':'TrunkId'});db[_0x35ff('0xe6')][_0x35ff('0x11b')](db[_0x35ff('0x26')],{'as':'TrunkBackup','foreignKey':_0x35ff('0x151')});db['Campaign'][_0x35ff('0x11b')](db[_0x35ff('0x7e')],{'as':'Interval','foreignKey':'IntervalId'});db['Campaign']['belongsTo'](db[_0x35ff('0xde')],{'as':_0x35ff('0xde'),'foreignKey':_0x35ff('0x1cc')});db[_0x35ff('0xe6')][_0x35ff('0x11d')](db['CmList'],{'as':'Lists','through':_0x35ff('0x1cd')});db[_0x35ff('0xe6')]['belongsToMany'](db[_0x35ff('0x122')],{'as':_0x35ff('0x1ce'),'through':_0x35ff('0x1cf')});db[_0x35ff('0xe8')][_0x35ff('0x11b')](db['ChatOfflineMessage'],{'as':_0x35ff('0x174'),'foreignKey':'ChatOfflineMessageId'});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db[_0x35ff('0x170')],{});db[_0x35ff('0xeb')]['belongsTo'](db[_0x35ff('0x3e')],{});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x35ff('0x1d0')});db['MailTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db['MailTransferReport']['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':'ToAgent'});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db[_0x35ff('0x130')],{'foreignKey':_0x35ff('0x1d2'),'as':'ToQueue'});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{'foreignKey':_0x35ff('0x1d3'),'as':_0x35ff('0x1d4')});db['ChatTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x18f')],{});db['ChatTransferReport']['belongsTo'](db[_0x35ff('0x126')],{});db[_0x35ff('0x1d5')]['belongsTo'](db[_0x35ff('0x5e')],{'foreignKey':_0x35ff('0x1d6'),'as':_0x35ff('0x1d0')});db['ChatTransferReport']['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':'FromAgent'});db[_0x35ff('0x1d5')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':'ToAgent'});db[_0x35ff('0x1d5')][_0x35ff('0x11b')](db[_0x35ff('0x66')],{'foreignKey':_0x35ff('0x1d8'),'as':_0x35ff('0x1d9')});db[_0x35ff('0x1d5')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'foreignKey':_0x35ff('0x1da'),'as':_0x35ff('0x1d4')});db['FaxTransferReport'][_0x35ff('0x11b')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0x35ff('0x115')],{});db[_0x35ff('0xed')]['belongsTo'](db[_0x35ff('0x137')],{'foreignKey':_0x35ff('0x1db'),'as':_0x35ff('0x1d0')});db[_0x35ff('0xed')]['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':'FromAgent'});db['FaxTransferReport'][_0x35ff('0x11b')](db['User'],{'foreignKey':'ToUserId','as':_0x35ff('0x1dc')});db[_0x35ff('0xed')][_0x35ff('0x11b')](db[_0x35ff('0x17d')],{'foreignKey':'ToFaxQueueId','as':_0x35ff('0x1d9')});db[_0x35ff('0xed')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db['OpenchannelTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x189')],{});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x5a')],{});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'foreignKey':_0x35ff('0x1de'),'as':_0x35ff('0x1d0')});db[_0x35ff('0x1dd')]['belongsTo'](db['User'],{'foreignKey':_0x35ff('0x1d7'),'as':_0x35ff('0x1df')});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':_0x35ff('0x1dc')});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x5c')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'foreignKey':_0x35ff('0x1e0'),'as':_0x35ff('0x1d4')});db[_0x35ff('0xef')][_0x35ff('0x11b')](db['SmsMessage'],{});db['SmsTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x52')],{});db['SmsTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x182')],{'foreignKey':_0x35ff('0x1e1'),'as':_0x35ff('0x1d0')});db['SmsTransferReport']['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':_0x35ff('0x1df')});db[_0x35ff('0xef')]['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':_0x35ff('0x1dc')});db[_0x35ff('0xef')][_0x35ff('0x11b')](db['SmsQueue'],{'foreignKey':_0x35ff('0x1e2'),'as':_0x35ff('0x1d9')});db[_0x35ff('0xef')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x35ff('0x1e3'),'as':'ToAccount'});db[_0x35ff('0x122')][_0x35ff('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x35ff('0x17b'),'onDelete':'cascade'});db['CmList'][_0x35ff('0x10e')](db[_0x35ff('0x73')],{'as':_0x35ff('0x1e4'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')][_0x35ff('0x10e')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x120'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')][_0x35ff('0x10e')](db[_0x35ff('0x6f')],{'as':_0x35ff('0x112'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')][_0x35ff('0x10e')](db['CmHopperHistory'],{'as':_0x35ff('0x113'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')]['hasMany'](db[_0x35ff('0x71')],{'as':_0x35ff('0x71'),'foreignKey':'ListId'});db[_0x35ff('0x122')]['belongsToMany'](db[_0x35ff('0x12c')],{'as':'Queues','through':_0x35ff('0x156')});db[_0x35ff('0x122')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':'cm_user_has_lists'});db[_0x35ff('0xf2')]['hasMany'](db['VoiceExtension'],{'as':_0x35ff('0x111'),'onDelete':'cascade'});db[_0x35ff('0xf2')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':'UserVoicePrefix'});db[_0x35ff('0xf2')][_0x35ff('0x11d')](db['Team'],{'through':_0x35ff('0x108'),'as':_0x35ff('0x168')});db[_0x35ff('0xf4')]['hasMany'](db[_0x35ff('0xf')],{'as':'Users','foreignKey':_0x35ff('0x11c')});db[_0x35ff('0xf4')]['hasMany'](db[_0x35ff('0x1e5')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x1e5')][_0x35ff('0x10e')](db[_0x35ff('0xf7')],{'as':_0x35ff('0x1e6'),'foreignKey':'sectionId','onDelete':_0x35ff('0x10c')});db['WhatsappAccount'][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x1e7'),'onDelete':_0x35ff('0x10c')});db['WhatsappAccount']['hasMany'](db['CannedAnswer'],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0xfa')]['hasMany'](db[_0x35ff('0xfe')],{'as':_0x35ff('0x158'),'foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0xfa')][_0x35ff('0x10e')](db[_0x35ff('0xfc')],{'as':_0x35ff('0x162')});db['WhatsappAccount']['hasMany'](db[_0x35ff('0x1e8')],{'as':_0x35ff('0x144')});db[_0x35ff('0xfa')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0xfa')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':_0x35ff('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x35ff('0xfa')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':'user_has_whatsapp_accounts'});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0x104')],{'onDelete':'restrict'});db[_0x35ff('0x1e8')]['belongsTo'](db[_0x35ff('0xfa')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0x7e')],{'onDelete':_0x35ff('0x176'),'foreignKey':'IntervalId'});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db['WhatsappInteraction'][_0x35ff('0x10e')](db[_0x35ff('0xfe')],{'as':'Messages','onDelete':_0x35ff('0x10c'),'foreignKey':'WhatsappInteractionId'});db[_0x35ff('0xfc')]['belongsTo'](db[_0x35ff('0xfa')],{'as':'Account','foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0xfc')]['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['WhatsappInteraction'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':'UserId'});db[_0x35ff('0xfc')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x1ab'),'as':'Tags'});db[_0x35ff('0xfc')][_0x35ff('0x11d')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x35ff('0x16e')});db[_0x35ff('0xfc')][_0x35ff('0x11d')](db['User'],{'as':'Users','through':_0x35ff('0x12b'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x35ff('0x11b')](db['User'],{'as':_0x35ff('0xf')});db['WhatsappMessage'][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'onDelete':_0x35ff('0x10c'),'as':'Contact'});db[_0x35ff('0xfe')]['belongsTo'](db[_0x35ff('0xfc')],{'onDelete':'cascade','as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x1e9')});db['WhatsappMessage'][_0x35ff('0x11b')](db[_0x35ff('0xfa')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0x100')]['belongsTo'](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x100')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['WhatsappQueueReport']['belongsTo'](db[_0x35ff('0xfc')],{});db[_0x35ff('0x100')]['belongsTo'](db[_0x35ff('0x104')],{});db['WhatsappQueueReport'][_0x35ff('0x11b')](db['WhatsappMessage'],{});db[_0x35ff('0x100')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xfe')],{});db[_0x35ff('0x102')]['belongsTo'](db[_0x35ff('0xfc')],{});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xfa')],{'foreignKey':_0x35ff('0x1ea'),'as':_0x35ff('0x1d0')});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xfa')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x35ff('0x102')][_0x35ff('0x11b')](db['WhatsappQueue'],{'foreignKey':_0x35ff('0x1eb'),'as':_0x35ff('0x1d9')});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':'FromAgent'});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':_0x35ff('0x1dc')});db[_0x35ff('0x104')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x135'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x1ec'),'as':_0x35ff('0x168')});module[_0x35ff('0x1ed')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x5ff3=['ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueue','MailQueues','ChatQueues','SmsQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','FaxAccount','FaxAccounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Messages','mailboxuser','mailbox','VoiceCallReport','CmContact','ContactId','MailAccountId','Imap','Dispositions','Answers','Interactions','List','Template','TemplateId','UserMailQueue','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','MailMessage','Attachments','Contact','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','Items','FaxAccountId','Exntensions','ListId','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccount','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','ChatMessage','user_has_chat_websites','Agent','ChatQueueId','ChatInteractionId','team_has_chat_queues','ChatGroup','ChatInternalMessage','Website','ChatInteractions','CompanyId','cm_contact_has_tags','Queue','CampaignId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','chat_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','Field','VariableId','DeskConfiguration','ZohoConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowConfiguration','FromId','ToId','SessionId','ProjectId','FaxQueues','team_has_openchannel_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromAccount','ToUserId','ToMailQueueId','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToAgent','OpenchannelTransferReport','FromOpenchannelAccountId','FromAgent','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSection','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','team_has_whatsapp_queues','exports','sequelize','jstz','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','username','password','database','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory'];(function(_0x487a0b,_0x33c302){var _0x4cb1ba=function(_0x2a3615){while(--_0x2a3615){_0x487a0b['push'](_0x487a0b['shift']());}};_0x4cb1ba(++_0x33c302);}(_0x5ff3,0x17d));var _0x35ff=function(_0x4aff23,_0x5ca706){_0x4aff23=_0x4aff23-0x0;var _0x5d74f5=_0x5ff3[_0x4aff23];return _0x5d74f5;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x35ff('0x0'));var _=require('lodash');var jstz=require(_0x35ff('0x1'));var timezone=jstz['determine']();config[_0x35ff('0x0')]=_[_0x35ff('0x2')](config[_0x35ff('0x0')],{'database':_0x35ff('0x3'),'username':'xcall','password':_0x35ff('0x4'),'options':{'host':_0x35ff('0x5'),'port':0xcea,'dialect':_0x35ff('0x6'),'dialectOptions':{'charset':_0x35ff('0x7')},'logging':![],'timezone':timezone[_0x35ff('0x8')](),'define':{'charset':'utf8','collate':_0x35ff('0x9')}}});config['sequelizeHistory']=_[_0x35ff('0x2')](config[_0x35ff('0xa')],{'database':_0x35ff('0x3'),'username':'xcall','password':_0x35ff('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x35ff('0x6'),'dialectOptions':{'charset':_0x35ff('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x35ff('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config['sequelize'][_0x35ff('0xb')],config[_0x35ff('0x0')][_0x35ff('0xc')],config[_0x35ff('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x35ff('0xa')][_0x35ff('0xd')],config[_0x35ff('0xa')]['username'],config[_0x35ff('0xa')][_0x35ff('0xc')],config[_0x35ff('0xa')][_0x35ff('0xe')])};db[_0x35ff('0xf')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x11'));db[_0x35ff('0x12')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x13'));db[_0x35ff('0x14')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceContext/voiceContext.model');db[_0x35ff('0x15')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x16'));db['VoiceMusicOnHold']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x17'));db['VoiceQueue']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x18'));db[_0x35ff('0x19')]=db['sequelize'][_0x35ff('0x10')]('../api/voiceRecording/voiceRecording.model');db[_0x35ff('0x1a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x1b'));db[_0x35ff('0x1c')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceMail/voiceMail.model');db[_0x35ff('0x1d')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x1e'));db['VoiceCallReport']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x1f'));db[_0x35ff('0x20')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceDialReport/voiceDialReport.model');db[_0x35ff('0x21')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x35ff('0x22')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x23'));db[_0x35ff('0x24')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x25'));db[_0x35ff('0x26')]=db['sequelize'][_0x35ff('0x10')]('../api/trunk/trunk.model');db[_0x35ff('0x27')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x28'));db['UserVoiceQueueRt']=db[_0x35ff('0x0')]['import'](_0x35ff('0x29'));db[_0x35ff('0x2a')]=db['sequelize']['import'](_0x35ff('0x2b'));db[_0x35ff('0x2c')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x2d'));db['UserMailQueue']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x2e'));db[_0x35ff('0x2f')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x30'));db[_0x35ff('0x31')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x32'));db[_0x35ff('0x33')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x34'));db['UserWhatsappQueue']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x35'));db[_0x35ff('0x36')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x37'));db[_0x35ff('0x38')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x39'));db['MailAccount']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x3a'));db['MailQueue']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x3b'));db[_0x35ff('0x3c')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x3d'));db[_0x35ff('0x3e')]=db[_0x35ff('0x0')]['import']('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x3f'));db[_0x35ff('0x40')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x41'));db[_0x35ff('0x42')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x43'));db[_0x35ff('0x44')]=db['sequelize']['import'](_0x35ff('0x45'));db[_0x35ff('0x46')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x47'));db[_0x35ff('0x48')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x49'));db['FaxInteraction']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x4a'));db[_0x35ff('0x4b')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x4c'));db['FaxQueue']=db['sequelize'][_0x35ff('0x10')]('../api/faxQueue/faxQueue.model');db[_0x35ff('0x4d')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x4e'));db['SmsAccount']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x4f'));db[_0x35ff('0x50')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x51'));db[_0x35ff('0x52')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x53'));db[_0x35ff('0x54')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x55'));db[_0x35ff('0x56')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x35ff('0x0')]['import'](_0x35ff('0x57'));db[_0x35ff('0x58')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x59'));db[_0x35ff('0x5a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x5b'));db['OpenchannelMessage']=db['sequelize'][_0x35ff('0x10')]('../api/openchannelMessage/openchannelMessage.model');db[_0x35ff('0x5c')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x5d'));db[_0x35ff('0x5e')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x5f'));db[_0x35ff('0x60')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x61'));db[_0x35ff('0x62')]=db[_0x35ff('0x0')]['import']('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x63'));db['ChatMessage']=db[_0x35ff('0x0')]['import'](_0x35ff('0x64'));db['ChatOfflineMessage']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x65'));db[_0x35ff('0x66')]=db['sequelize']['import'](_0x35ff('0x67'));db['ChatGroup']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/chatGroup/chatGroup.model');db[_0x35ff('0x68')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x69'));db[_0x35ff('0x6a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x6b'));db['CmContact']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x6c'));db['CmHopper']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/cmHopper/cmHopper.model');db[_0x35ff('0x6d')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x6e'));db[_0x35ff('0x6f')]=db['sequelize']['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x35ff('0x70')]=db['sequelize'][_0x35ff('0x10')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x35ff('0x71')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x72'));db[_0x35ff('0x73')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x74'));db[_0x35ff('0x75')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x76'));db[_0x35ff('0x77')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x78'));db[_0x35ff('0x79')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/cannedAnswer/cannedAnswer.model');db[_0x35ff('0x7a')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x7b'));db[_0x35ff('0x7c')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x7d'));db[_0x35ff('0x7e')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x7f'));db['Pause']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x80'));db['Cdr']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x81'));db[_0x35ff('0x82')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x83'));db[_0x35ff('0x84')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x85'));db[_0x35ff('0x86')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x87'));db[_0x35ff('0x88')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x89'));db['Template']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/template/template.model');db['Trigger']=db[_0x35ff('0x0')]['import'](_0x35ff('0x8a'));db[_0x35ff('0x8b')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x8c'));db[_0x35ff('0x8d')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x8e'));db['IntegrationReport']=db[_0x35ff('0x0')]['import'](_0x35ff('0x8f'));db['AnalyticCustomReport']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x90'));db[_0x35ff('0x91')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x92'));db[_0x35ff('0x93')]=db['sequelize']['import'](_0x35ff('0x94'));db[_0x35ff('0x95')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x96'));db[_0x35ff('0x97')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x98'));db[_0x35ff('0x99')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0x9a'));db[_0x35ff('0x9b')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x35ff('0x9c')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x9d'));db[_0x35ff('0x9e')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intSalesforceField/intSalesforceField.model');db[_0x35ff('0x9f')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xa0'));db[_0x35ff('0xa1')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x35ff('0xa2')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xa3'));db[_0x35ff('0xa4')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x35ff('0x0')]['import'](_0x35ff('0xa5'));db[_0x35ff('0xa6')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xa7'));db[_0x35ff('0xa8')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xa9'));db['ZohoConfiguration']=db[_0x35ff('0x0')]['import'](_0x35ff('0xaa'));db[_0x35ff('0xab')]=db[_0x35ff('0x0')]['import']('../api/intZohoField/intZohoField.model');db[_0x35ff('0xac')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xad'));db[_0x35ff('0xae')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xaf'));db[_0x35ff('0xb0')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xb1'));db[_0x35ff('0xb2')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xb3'));db[_0x35ff('0xb4')]=db['sequelize'][_0x35ff('0x10')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x35ff('0xb5')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xb6'));db[_0x35ff('0xb7')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xb8'));db['VtigerConfiguration']=db[_0x35ff('0x0')]['import'](_0x35ff('0xb9'));db[_0x35ff('0xba')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xbb'));db[_0x35ff('0xbc')]=db['sequelize'][_0x35ff('0x10')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xbd'));db[_0x35ff('0xbe')]=db['sequelize']['import']('../api/intServicenowField/intServicenowField.model');db[_0x35ff('0xbf')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xc0'));db[_0x35ff('0xc1')]=db[_0x35ff('0x0')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x35ff('0xc2')]=db['sequelize']['import'](_0x35ff('0xc3'));db[_0x35ff('0xc4')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x35ff('0xc5')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xc6'));db[_0x35ff('0xc7')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xc8'));db[_0x35ff('0x8d')]=db[_0x35ff('0x0')]['import'](_0x35ff('0x8e'));db[_0x35ff('0xc9')]=db['sequelize']['import'](_0x35ff('0xca'));db[_0x35ff('0xcb')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xcc'));db['ChatInternalMessage']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xcd'));db[_0x35ff('0xce')]=db['sequelize']['import'](_0x35ff('0xcf'));db[_0x35ff('0xd0')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xd1'));db[_0x35ff('0xd2')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xd3'));db[_0x35ff('0xd4')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xd5'));db[_0x35ff('0xd6')]=db[_0x35ff('0x0')]['import']('../api/squareReport/squareReport.model');db[_0x35ff('0xd7')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xd8'));db[_0x35ff('0xd9')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xda'));db[_0x35ff('0xdb')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/setting/setting.model');db[_0x35ff('0xdc')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xdd'));db[_0x35ff('0xde')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xdf'));db[_0x35ff('0xe0')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xe1'));db['SquareMessage']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xe2'));db[_0x35ff('0xe3')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xe4'));db[_0x35ff('0xe5')]=db[_0x35ff('0x0')]['import']('../api/license/license.model');db[_0x35ff('0xe6')]=db['sequelize'][_0x35ff('0x10')]('../api/campaign/campaign.model');db['Migration']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xe7'));db[_0x35ff('0xe8')]=db[_0x35ff('0x0')]['import']('../api/attachment/attachment.model');db[_0x35ff('0xe9')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xea'));db[_0x35ff('0xeb')]=db[_0x35ff('0x0')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x35ff('0x0')]['import'](_0x35ff('0xec'));db[_0x35ff('0xed')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xee'));db['OpenchannelTransferReport']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x35ff('0xef')]=db['sequelize']['import'](_0x35ff('0xf0'));db['CmList']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xf1'));db[_0x35ff('0xf2')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xf3'));db[_0x35ff('0xf4')]=db[_0x35ff('0x0')]['import'](_0x35ff('0xf5'));db['UserProfileSection']=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xf6'));db[_0x35ff('0xf7')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xf8'));db[_0x35ff('0xf9')]=db['sequelize'][_0x35ff('0x10')]('../api/userNotification/userNotification.model');db[_0x35ff('0xfa')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xfb'));db['WhatsappApplication']=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/whatsappApplication/whatsappApplication.model');db[_0x35ff('0xfc')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0xfd'));db[_0x35ff('0xfe')]=db['sequelize'][_0x35ff('0x10')](_0x35ff('0xff'));db[_0x35ff('0x100')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x101'));db[_0x35ff('0x102')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x103'));db[_0x35ff('0x104')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/whatsappQueue/whatsappQueue.model');db[_0x35ff('0x105')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x106'));db[_0x35ff('0x107')]=db[_0x35ff('0x0')][_0x35ff('0x10')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x35ff('0x108')]=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x109'));db['UserVoicePrefix']=db[_0x35ff('0x0')][_0x35ff('0x10')](_0x35ff('0x10a'));db[_0x35ff('0xf')][_0x35ff('0x10b')](db[_0x35ff('0x1c')],{'as':'VoiceMail','onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['VoiceRecording'],{'as':_0x35ff('0x10f'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['UserVoiceQueueRt'],{'as':_0x35ff('0x110'),'foreignKey':'UserId'});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['VoiceExtension'],{'as':_0x35ff('0x111'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db['User'][_0x35ff('0x10e')](db['CmHopperFinal'],{'as':_0x35ff('0x112'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')]['hasMany'](db[_0x35ff('0x70')],{'as':_0x35ff('0x113'),'foreignKey':_0x35ff('0x10d')});db['User'][_0x35ff('0x10e')](db[_0x35ff('0x71')],{'as':_0x35ff('0x71'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')]['hasMany'](db[_0x35ff('0x5a')],{'as':_0x35ff('0x114'),'foreignKey':'UserId'});db[_0x35ff('0xf')][_0x35ff('0x10e')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x35ff('0xf')]['hasMany'](db[_0x35ff('0x52')],{'as':'SmsInteractions','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')][_0x35ff('0x10e')](db[_0x35ff('0x115')],{'as':_0x35ff('0x116'),'foreignKey':_0x35ff('0x10d')});db['User']['hasMany'](db[_0x35ff('0x3e')],{'as':_0x35ff('0x117'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0xf')]['hasMany'](db['WhatsappInteraction'],{'as':_0x35ff('0x118'),'foreignKey':_0x35ff('0x10d')});db['User'][_0x35ff('0x10e')](db['UserNotification'],{'as':_0x35ff('0x119'),'foreignKey':_0x35ff('0x11a')});db[_0x35ff('0xf')][_0x35ff('0x11b')](db['UserProfile'],{'as':_0x35ff('0xf4'),'foreignKey':_0x35ff('0x11c')});db['User'][_0x35ff('0x11d')](db['ChatGroup'],{'as':_0x35ff('0x11e'),'through':_0x35ff('0x11f')});db['User']['belongsToMany'](db['CmContact'],{'as':_0x35ff('0x120'),'through':_0x35ff('0x121')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x122')],{'as':_0x35ff('0x123'),'through':_0x35ff('0x124')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':'user_has_teams'});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x3e')],{'as':_0x35ff('0x117'),'through':_0x35ff('0x125')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x126')],{'as':'ChatInteractions','through':_0x35ff('0x127')});db['User'][_0x35ff('0x11d')](db[_0x35ff('0x115')],{'as':_0x35ff('0x116'),'through':'user_has_fax_interactions'});db['User']['belongsToMany'](db[_0x35ff('0x52')],{'as':_0x35ff('0x128'),'through':_0x35ff('0x129')});db[_0x35ff('0xf')]['belongsToMany'](db[_0x35ff('0x5a')],{'as':_0x35ff('0x114'),'through':_0x35ff('0x12a')});db['User']['belongsToMany'](db[_0x35ff('0xfc')],{'as':_0x35ff('0x118'),'through':_0x35ff('0x12b')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x12c')],{'as':_0x35ff('0x12d'),'through':_0x35ff('0x2a'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db['VoicePrefix'],{'as':_0x35ff('0x12e'),'through':_0x35ff('0x12f'),'required':![]});db[_0x35ff('0xf')]['belongsToMany'](db[_0x35ff('0x130')],{'as':_0x35ff('0x131'),'through':'UserMailQueue','required':![]});db['User'][_0x35ff('0x11d')](db['ChatQueue'],{'as':_0x35ff('0x132'),'through':_0x35ff('0x2c'),'required':![],'hooks':!![]});db[_0x35ff('0xf')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':_0x35ff('0x2f'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x56')],{'as':_0x35ff('0x133'),'through':_0x35ff('0x31'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x5c')],{'as':'OpenchannelQueues','through':_0x35ff('0x33'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x104')],{'as':_0x35ff('0x134'),'through':_0x35ff('0x135'),'required':![]});db[_0x35ff('0xf')][_0x35ff('0x11d')](db['CmList'],{'through':_0x35ff('0x124')});db['User'][_0x35ff('0x11d')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x136'),'through':'user_has_chat_websites'});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0x137')],{'as':_0x35ff('0x138'),'through':'user_has_fax_accounts'});db[_0x35ff('0xf')]['belongsToMany'](db[_0x35ff('0x139')],{'as':_0x35ff('0x13a'),'through':_0x35ff('0x13b')});db[_0x35ff('0xf')][_0x35ff('0x11d')](db['OpenchannelAccount'],{'as':_0x35ff('0x13c'),'through':_0x35ff('0x13d')});db['User'][_0x35ff('0x11d')](db['SmsAccount'],{'as':_0x35ff('0x13e'),'through':_0x35ff('0x13f')});db['User'][_0x35ff('0x11d')](db[_0x35ff('0xfa')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x35ff('0xf')][_0x35ff('0x11d')](db[_0x35ff('0xde')],{'as':_0x35ff('0x140'),'through':_0x35ff('0x141')});db['VoiceChanSpy'][_0x35ff('0x10e')](db[_0x35ff('0x15')],{'as':_0x35ff('0x142'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x143')});db['VoiceContext'][_0x35ff('0x10e')](db[_0x35ff('0x15')],{'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x15')]['hasMany'](db[_0x35ff('0x15')],{'as':_0x35ff('0x144'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x145')][_0x35ff('0x11d')](db[_0x35ff('0x86')],{'as':_0x35ff('0x146'),'through':_0x35ff('0x147')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db[_0x35ff('0x148')],{'as':_0x35ff('0x149'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db[_0x35ff('0x14b')],{'as':_0x35ff('0x14c'),'foreignKey':'VoiceQueueId'});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db[_0x35ff('0x6f')],{'as':_0x35ff('0x112'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x35ff('0x10e')](db[_0x35ff('0x70')],{'as':_0x35ff('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db['ReportAgentPreview'],{'as':_0x35ff('0x71'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db['CmHopperBlack'],{'as':_0x35ff('0x14e'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x10e')](db['JscriptySessionReport'],{'as':_0x35ff('0x14f'),'foreignKey':_0x35ff('0x14a')});db[_0x35ff('0x12c')][_0x35ff('0x11b')](db['Trunk'],{'as':_0x35ff('0x26'),'foreignKey':_0x35ff('0x150')});db[_0x35ff('0x12c')][_0x35ff('0x11b')](db[_0x35ff('0x26')],{'as':'TrunkBackup','foreignKey':_0x35ff('0x151')});db[_0x35ff('0x12c')][_0x35ff('0x11b')](db['Interval'],{'as':_0x35ff('0x7e'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x12c')]['belongsTo'](db[_0x35ff('0x153')],{'as':_0x35ff('0x154'),'foreignKey':_0x35ff('0x155')});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0x122')],{'as':_0x35ff('0x123'),'through':_0x35ff('0x156')});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x2a')});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x35ff('0x12c')][_0x35ff('0x11d')](db[_0x35ff('0x122')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x35ff('0x19')][_0x35ff('0x11b')](db['User'],{'as':_0x35ff('0xf'),'foreignKey':'UserId'});db[_0x35ff('0x1a')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x1c')]['hasMany'](db[_0x35ff('0x1d')],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x159'),'sourceKey':_0x35ff('0x15a')});db['VoiceMailMessage'][_0x35ff('0x11b')](db[_0x35ff('0x1c')],{'foreignKey':_0x35ff('0x159'),'targetKey':'mailbox'});db[_0x35ff('0x15b')][_0x35ff('0x10e')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x35ff('0x15b')][_0x35ff('0x10e')](db[_0x35ff('0x21')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x35ff('0x15b')]['belongsTo'](db[_0x35ff('0xf')],{'as':'User','foreignKey':'UserId'});db[_0x35ff('0x15b')]['belongsTo'](db[_0x35ff('0x15c')],{'as':'Contact','foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x36')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{'as':_0x35ff('0x139'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x38')]['belongsTo'](db['MailAccount'],{'as':_0x35ff('0x139'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x139')][_0x35ff('0x10b')](db['MailServerIn'],{'as':_0x35ff('0x15f'),'onDelete':'cascade'});db[_0x35ff('0x139')]['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x139')][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x15e'),'onDelete':'cascade'});db['MailAccount'][_0x35ff('0x10e')](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x139')][_0x35ff('0x10e')](db['MailMessage'],{'as':_0x35ff('0x158'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x139')][_0x35ff('0x10e')](db['MailInteraction'],{'as':_0x35ff('0x162')});db['MailAccount'][_0x35ff('0x10e')](db[_0x35ff('0x40')],{'as':_0x35ff('0x144')});db[_0x35ff('0x139')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0x139')]['belongsTo'](db[_0x35ff('0x164')],{'as':'Template','foreignKey':_0x35ff('0x165')});db[_0x35ff('0x139')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db[_0x35ff('0x139')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':'Agents','through':_0x35ff('0x13b')});db['MailQueue']['belongsToMany'](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x166')});db[_0x35ff('0x130')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x167'),'as':_0x35ff('0x168')});db[_0x35ff('0x3e')][_0x35ff('0x10e')](db['MailMessage'],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x169')});db[_0x35ff('0x3e')]['belongsTo'](db[_0x35ff('0x139')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x3e')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':'Contact','foreignKey':'ContactId'});db[_0x35ff('0x3e')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x3e')]['belongsToMany'](db[_0x35ff('0x88')],{'through':'mail_interaction_has_tags','as':_0x35ff('0x16c')});db[_0x35ff('0x3e')]['belongsToMany'](db[_0x35ff('0x88')],{'through':_0x35ff('0x16d'),'as':_0x35ff('0x16e')});db['MailInteraction'][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x16f'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x35ff('0x170')]['hasMany'](db[_0x35ff('0xe8')],{'as':_0x35ff('0x171'),'onDelete':'cascade'});db[_0x35ff('0x170')]['belongsTo'](db[_0x35ff('0xf')],{'as':_0x35ff('0xf')});db[_0x35ff('0x170')][_0x35ff('0x11b')](db['CmContact'],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x172')});db[_0x35ff('0x170')]['belongsTo'](db['MailInteraction'],{'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x169')});db[_0x35ff('0x170')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{'as':'Account','foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x170')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x5e'),'foreignKey':'ChatWebsiteId'});db[_0x35ff('0x170')][_0x35ff('0x11b')](db[_0x35ff('0x174')],{'as':_0x35ff('0x174'),'foreignKey':_0x35ff('0x175')});db[_0x35ff('0x40')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':'restrict'});db[_0x35ff('0x40')]['belongsTo'](db['MailQueue'],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x40')][_0x35ff('0x11b')](db['MailAccount'],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x40')]['belongsTo'](db[_0x35ff('0x7e')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x35ff('0x40')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x42')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{});db[_0x35ff('0x42')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0x42')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['MailQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x3e')],{});db['MailQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x170')],{});db['MailQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x42')][_0x35ff('0x11b')](db['MailQueue'],{});db['Dashboard'][_0x35ff('0x10e')](db[_0x35ff('0x46')],{'as':_0x35ff('0x178'),'onDelete':_0x35ff('0x10c')});db['FaxAccount']['hasMany'](db[_0x35ff('0x7a')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x35ff('0x10c')});db['FaxAccount'][_0x35ff('0x10e')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x35ff('0x179')});db[_0x35ff('0x137')][_0x35ff('0x10e')](db['FaxInteraction'],{'as':_0x35ff('0x162')});db[_0x35ff('0x137')][_0x35ff('0x10e')](db[_0x35ff('0x48')],{'as':_0x35ff('0x144')});db[_0x35ff('0x137')][_0x35ff('0x10e')](db[_0x35ff('0x15')],{'as':_0x35ff('0x17a'),'onDelete':_0x35ff('0x10c')});db['FaxAccount'][_0x35ff('0x10e')](db['FaxMessage'],{'as':_0x35ff('0x158')});db[_0x35ff('0x137')]['belongsTo'](db[_0x35ff('0x26')],{'as':'Trunk'});db[_0x35ff('0x137')]['belongsTo'](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x137')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db['FaxAccount'][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':'Agents','through':_0x35ff('0x17c')});db[_0x35ff('0x48')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x48')][_0x35ff('0x11b')](db[_0x35ff('0x17d')],{'onDelete':_0x35ff('0x176')});db['FaxApplication'][_0x35ff('0x11b')](db['FaxAccount'],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x48')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x115')]['hasMany'](db[_0x35ff('0x4b')],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x17e')});db[_0x35ff('0x115')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x179')});db[_0x35ff('0x115')][_0x35ff('0x11b')](db['CmContact'],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x115')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':'Owner','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x115')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x17f'),'as':_0x35ff('0x16c')});db[_0x35ff('0x115')]['belongsToMany'](db[_0x35ff('0x88')],{'through':_0x35ff('0x17f'),'as':_0x35ff('0x16e')});db['FaxInteraction'][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0x35ff('0x4b')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x10c'),'as':'User'});db[_0x35ff('0x4b')][_0x35ff('0x11b')](db['FaxInteraction'],{'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x17e')});db[_0x35ff('0x4b')]['belongsTo'](db['CmContact'],{'onDelete':_0x35ff('0x10c'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0x35ff('0xe8')],{'as':'Attachment','foreignKey':_0x35ff('0x180')});db[_0x35ff('0x4b')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x179')});db[_0x35ff('0x17d')]['belongsToMany'](db[_0x35ff('0xf')],{'as':'Agents','through':'UserFaxQueue'});db[_0x35ff('0x17d')][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x181'),'as':'Teams'});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{});db['FaxQueueReport']['belongsTo'](db[_0x35ff('0x122')],{'as':'List','foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x4d')]['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db[_0x35ff('0x115')],{});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db['FaxMessage'],{});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x4d')][_0x35ff('0x11b')](db['FaxQueue'],{});db[_0x35ff('0x182')]['hasMany'](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':'SmsAccountId','onDelete':_0x35ff('0x10c')});db['SmsAccount']['hasMany'](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':'SmsAccountId'});db[_0x35ff('0x182')][_0x35ff('0x10e')](db[_0x35ff('0x54')],{'as':'Messages','foreignKey':_0x35ff('0x183')});db[_0x35ff('0x182')][_0x35ff('0x10e')](db[_0x35ff('0x52')],{'as':_0x35ff('0x162')});db[_0x35ff('0x182')][_0x35ff('0x10e')](db[_0x35ff('0x50')],{'as':_0x35ff('0x144')});db[_0x35ff('0x182')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x182')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db[_0x35ff('0x182')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x13f')});db[_0x35ff('0x50')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x50')]['belongsTo'](db[_0x35ff('0x56')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x50')]['belongsTo'](db[_0x35ff('0x182')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x50')]['belongsTo'](db[_0x35ff('0x7e')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x152')});db['SmsApplication'][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':'restrict','foreignKey':_0x35ff('0x177')});db['SmsInteraction'][_0x35ff('0x10e')](db[_0x35ff('0x54')],{'as':'Messages','onDelete':_0x35ff('0x10c'),'foreignKey':'SmsInteractionId'});db[_0x35ff('0x52')][_0x35ff('0x11b')](db[_0x35ff('0x182')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x183')});db[_0x35ff('0x52')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['SmsInteraction']['belongsTo'](db[_0x35ff('0xf')],{'as':'Owner','foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x52')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x184'),'as':_0x35ff('0x16c')});db['SmsInteraction'][_0x35ff('0x11d')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x35ff('0x16e')});db[_0x35ff('0x52')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x129'),'foreignKey':'SmsInteractionId'});db[_0x35ff('0x54')][_0x35ff('0x11b')](db['User'],{'as':_0x35ff('0xf')});db['SmsMessage']['belongsTo'](db[_0x35ff('0x15c')],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x172')});db[_0x35ff('0x54')]['belongsTo'](db[_0x35ff('0x52')],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x185')});db[_0x35ff('0x54')]['belongsTo'](db[_0x35ff('0x182')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x183')});db[_0x35ff('0x56')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x31'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x186'),'as':_0x35ff('0x168')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x188'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x5a')],{'as':_0x35ff('0x162'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x189')],{'as':_0x35ff('0x158'),'foreignKey':'OpenchannelAccountId'});db[_0x35ff('0x187')][_0x35ff('0x10e')](db[_0x35ff('0x58')],{'as':_0x35ff('0x144'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x187')]['belongsTo'](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x187')][_0x35ff('0x11b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x35ff('0x155')});db[_0x35ff('0x187')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x13d')});db['OpenchannelApplication'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x58')][_0x35ff('0x11b')](db[_0x35ff('0x5c')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x18a')});db[_0x35ff('0x58')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x58')]['belongsTo'](db[_0x35ff('0x7e')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x58')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x5a')][_0x35ff('0x10e')](db[_0x35ff('0x189')],{'as':_0x35ff('0x158'),'onDelete':'cascade','foreignKey':_0x35ff('0x18b')});db['OpenchannelInteraction']['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x35ff('0x188')});db[_0x35ff('0x5a')][_0x35ff('0x11b')](db['CmContact'],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['OpenchannelInteraction'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x5a')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x18c'),'as':_0x35ff('0x16c')});db[_0x35ff('0x5a')][_0x35ff('0x11d')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x35ff('0x16e')});db['OpenchannelInteraction'][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x12a'),'foreignKey':_0x35ff('0x18b')});db['OpenchannelMessage'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x10c'),'as':'User'});db['OpenchannelMessage'][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'onDelete':'cascade','as':'Contact'});db[_0x35ff('0x189')][_0x35ff('0x11b')](db[_0x35ff('0x5a')],{'onDelete':_0x35ff('0x10c'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x35ff('0x11b')](db[_0x35ff('0xe8')],{'as':_0x35ff('0xe8'),'foreignKey':'AttachmentId'});db[_0x35ff('0x189')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x188')});db[_0x35ff('0x5c')][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x157'),'through':_0x35ff('0x33'),'foreignKey':_0x35ff('0x18a')});db[_0x35ff('0x5c')][_0x35ff('0x11d')](db['Team'],{'through':'team_has_openchannel_queues','as':_0x35ff('0x168')});db['ChatWebsite'][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x18d'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x5e')][_0x35ff('0x10e')](db[_0x35ff('0x79')],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x18d')});db['ChatWebsite'][_0x35ff('0x10e')](db[_0x35ff('0x68')],{'as':_0x35ff('0x18e')});db[_0x35ff('0x5e')]['hasMany'](db['ChatInteraction'],{'as':_0x35ff('0x162')});db['ChatWebsite'][_0x35ff('0x10e')](db[_0x35ff('0x62')],{'as':'Applications'});db[_0x35ff('0x5e')][_0x35ff('0x10e')](db[_0x35ff('0x18f')],{'as':_0x35ff('0x158')});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db[_0x35ff('0x7e')],{'as':_0x35ff('0x7e'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x35ff('0x15e')});db[_0x35ff('0x5e')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':_0x35ff('0x154'),'foreignKey':_0x35ff('0x155')});db[_0x35ff('0x5e')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x190')});db['OpenchannelQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x187')],{});db[_0x35ff('0x60')]['belongsTo'](db[_0x35ff('0x122')],{'as':'List','foreignKey':_0x35ff('0x17b')});db['OpenchannelQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x60')][_0x35ff('0x11b')](db['OpenchannelInteraction'],{});db[_0x35ff('0x60')][_0x35ff('0x11b')](db[_0x35ff('0x189')],{});db[_0x35ff('0x60')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x60')][_0x35ff('0x11b')](db[_0x35ff('0x5c')],{});db[_0x35ff('0x62')]['belongsTo'](db['User'],{'as':_0x35ff('0x191'),'foreignKey':'UserId','onDelete':'restrict'});db[_0x35ff('0x62')][_0x35ff('0x11b')](db[_0x35ff('0x66')],{'as':'Queue','foreignKey':_0x35ff('0x192'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x62')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':'Website','foreignKey':_0x35ff('0x18d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x62')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db[_0x35ff('0x126')][_0x35ff('0x10e')](db[_0x35ff('0x18f')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x35ff('0x193')});db['ChatInteraction'][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x126')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x126')]['belongsTo'](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':_0x35ff('0x10d')});db[_0x35ff('0x126')][_0x35ff('0x11d')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x35ff('0x16c')});db[_0x35ff('0x126')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':'chat_interaction_has_tags','as':_0x35ff('0x16e')});db['ChatInteraction'][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x127'),'foreignKey':'ChatInteractionId'});db[_0x35ff('0x18f')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':'cascade','as':'User'});db[_0x35ff('0x18f')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'onDelete':_0x35ff('0x10c'),'as':'Contact','foreignKey':'ContactId'});db['ChatMessage'][_0x35ff('0x11b')](db[_0x35ff('0x126')],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x193')});db[_0x35ff('0x18f')]['belongsTo'](db[_0x35ff('0xe8')],{'as':'Attachment','foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db[_0x35ff('0x5e')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x174')][_0x35ff('0x10e')](db[_0x35ff('0xe8')],{'as':'Attachments','foreignKey':_0x35ff('0x175'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db[_0x35ff('0x174')][_0x35ff('0x11b')](db['CmContact'],{'onDelete':_0x35ff('0x10c'),'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x174')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x66')]['belongsToMany'](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x2c'),'hooks':!![]});db[_0x35ff('0x66')]['belongsToMany'](db[_0x35ff('0xe3')],{'through':_0x35ff('0x194'),'as':_0x35ff('0x168')});db[_0x35ff('0x195')][_0x35ff('0x10e')](db[_0x35ff('0x196')],{'as':_0x35ff('0x158'),'foreignKey':'ChatGroupId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x195')][_0x35ff('0x11d')](db['User'],{'as':_0x35ff('0x149'),'through':_0x35ff('0x11f')});db[_0x35ff('0x68')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'as':_0x35ff('0x197'),'foreignKey':_0x35ff('0x18d')});db[_0x35ff('0x6a')]['hasMany'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x120'),'foreignKey':'CompanyId'});db[_0x35ff('0x15c')]['hasMany'](db['CmHopper'],{'as':_0x35ff('0x14c'),'foreignKey':'ContactId'});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x6f')],{'as':_0x35ff('0x112'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x70')],{'as':_0x35ff('0x14d'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')]['hasMany'](db[_0x35ff('0x71')],{'as':'ReportAgentPreview','foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')]['hasMany'](db[_0x35ff('0xd2')],{'as':_0x35ff('0x14f'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x5a')],{'as':_0x35ff('0x114'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x126')],{'as':_0x35ff('0x198'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x52')],{'as':_0x35ff('0x128'),'foreignKey':_0x35ff('0x15d'),'onDelete':'restrict'});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x115')],{'as':_0x35ff('0x116'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')][_0x35ff('0x10e')](db[_0x35ff('0x3e')],{'as':_0x35ff('0x117'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x15c')]['belongsTo'](db[_0x35ff('0x6a')],{'as':'Company','foreignKey':_0x35ff('0x199')});db[_0x35ff('0x15c')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x15c')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16f'),'through':_0x35ff('0x121')});db[_0x35ff('0x15c')]['belongsToMany'](db[_0x35ff('0x88')],{'as':_0x35ff('0x16c'),'through':'cm_contact_has_tags'});db[_0x35ff('0x15c')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x19a'),'as':'ThroughTags'});db[_0x35ff('0x14b')]['belongsTo'](db[_0x35ff('0x15c')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x14b')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':'ListId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x14b')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x191'),'foreignKey':'UserId'});db[_0x35ff('0x14b')][_0x35ff('0x11b')](db[_0x35ff('0x12c')],{'as':_0x35ff('0x19b'),'foreignKey':_0x35ff('0x14a'),'onDelete':_0x35ff('0x10c')});db['CmHopper'][_0x35ff('0x11b')](db['Campaign'],{'as':'Campaign','foreignKey':_0x35ff('0x19c'),'onDelete':_0x35ff('0x10c')});db['CmHopper'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':'OwnerId'});db[_0x35ff('0x6d')]['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x6d')]['belongsTo'](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0x6d')][_0x35ff('0x11b')](db[_0x35ff('0x12c')],{'as':_0x35ff('0x19b'),'foreignKey':'VoiceQueueId','onDelete':_0x35ff('0x10c')});db['CmHopperBlack'][_0x35ff('0x11b')](db[_0x35ff('0xe6')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x35ff('0x10c')});db['Automation'][_0x35ff('0x10e')](db['Condition'],{'as':{'plural':_0x35ff('0x19d'),'singular':'OneAll'},'foreignKey':_0x35ff('0x19e'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db[_0x35ff('0x77')][_0x35ff('0x10e')](db[_0x35ff('0x7c')],{'as':{'plural':_0x35ff('0x19f'),'singular':_0x35ff('0x1a0')},'foreignKey':_0x35ff('0x1a1'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db['Automation'][_0x35ff('0x10e')](db[_0x35ff('0x75')],{'as':_0x35ff('0x1a2'),'foreignKey':_0x35ff('0x1a3'),'onDelete':'cascade','hooks':!![]});db[_0x35ff('0x7a')][_0x35ff('0x10e')](db['Disposition'],{'as':_0x35ff('0x160'),'foreignKey':'ParentId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db[_0x35ff('0x7e')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x35ff('0x10c'),'hooks':!![],'required':![]});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db['VoiceExtension'],{'as':_0x35ff('0x111'),'foreignKey':_0x35ff('0x152'),'onDelete':_0x35ff('0x176')});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db[_0x35ff('0x40')],{'as':_0x35ff('0x1a4'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x7e')]['hasMany'](db['ChatApplication'],{'as':_0x35ff('0x1a5'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x7e')]['hasMany'](db[_0x35ff('0x48')],{'as':_0x35ff('0x1a6'),'foreignKey':_0x35ff('0x152')});db[_0x35ff('0x7e')][_0x35ff('0x10e')](db[_0x35ff('0x50')],{'as':'SmsApplications','foreignKey':_0x35ff('0x152')});db[_0x35ff('0x84')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{});db[_0x35ff('0x84')][_0x35ff('0x11b')](db[_0x35ff('0x91')],{'foreignKey':_0x35ff('0x1a7')});db[_0x35ff('0x84')][_0x35ff('0x11b')](db[_0x35ff('0x1a8')],{'foreignKey':_0x35ff('0x1a9')});db[_0x35ff('0x86')][_0x35ff('0x11d')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x35ff('0x147'),'onDelete':_0x35ff('0x176')});db['Tag'][_0x35ff('0x11d')](db['CmContact'],{'through':_0x35ff('0x19a')});db[_0x35ff('0x88')][_0x35ff('0x11d')](db['ChatInteraction'],{'through':_0x35ff('0x1aa')});db[_0x35ff('0x88')][_0x35ff('0x11d')](db[_0x35ff('0x3e')],{'through':_0x35ff('0x16d')});db['Tag']['belongsToMany'](db[_0x35ff('0x52')],{'through':_0x35ff('0x184')});db['Tag']['belongsToMany'](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db['Tag'][_0x35ff('0x11d')](db[_0x35ff('0x5a')],{'through':_0x35ff('0x18c')});db['Tag'][_0x35ff('0x11d')](db[_0x35ff('0xfc')],{'through':_0x35ff('0x1ab')});db[_0x35ff('0x1ac')][_0x35ff('0x10e')](db[_0x35ff('0x7c')],{'as':{'plural':_0x35ff('0x1ad'),'singular':_0x35ff('0x1ae')},'foreignKey':_0x35ff('0x1af'),'onDelete':'cascade','hooks':!![]});db[_0x35ff('0x1ac')][_0x35ff('0x10e')](db[_0x35ff('0x7c')],{'as':{'plural':_0x35ff('0x1b0'),'singular':'AnyCondition'},'foreignKey':_0x35ff('0x1b1'),'onDelete':_0x35ff('0x10c'),'hooks':!![]});db[_0x35ff('0x1ac')][_0x35ff('0x10e')](db[_0x35ff('0x75')],{'as':_0x35ff('0x1a2'),'foreignKey':_0x35ff('0x1b2'),'onDelete':'cascade','hooks':!![]});db[_0x35ff('0x1a8')][_0x35ff('0x10e')](db[_0x35ff('0x97')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1a9'),'hooks':!![]});db[_0x35ff('0x91')][_0x35ff('0x10e')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x35ff('0x1a7')});db[_0x35ff('0x95')][_0x35ff('0x10e')](db[_0x35ff('0x97')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':'MetricId'});db[_0x35ff('0x97')][_0x35ff('0x11b')](db[_0x35ff('0x95')],{'foreignKey':_0x35ff('0x1b4')});db['SalesforceAccount'][_0x35ff('0x10e')](db[_0x35ff('0x9c')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x9c')]['hasMany'](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0x9c')][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':'DescriptionId'});db[_0x35ff('0x9c')][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':'Fields','onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0x9c')][_0x35ff('0x11b')](db['SalesforceAccount'],{'as':_0x35ff('0x16a'),'foreignKey':'AccountId'});db['SalesforceField'][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0x9e')][_0x35ff('0x10e')](db['SalesforceField'],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0x9e')][_0x35ff('0x10e')](db[_0x35ff('0x9e')],{'as':_0x35ff('0x1be'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0x9e')][_0x35ff('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0x9f')]['hasMany'](db[_0x35ff('0xa1')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xa1')]['hasMany'](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xa1')]['hasMany'](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':'FieldId'});db[_0x35ff('0xa1')]['belongsTo'](db[_0x35ff('0x9f')],{'as':'Account','foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xa2')][_0x35ff('0x10e')](db['SugarcrmField'],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db['SugarcrmField'][_0x35ff('0x10e')](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xa2')][_0x35ff('0x10e')](db[_0x35ff('0xa2')],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xa2')][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xa4')]['hasMany'](db[_0x35ff('0x1c0')],{'as':'Configurations','onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c0')]['hasMany'](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':'SubjectId'});db[_0x35ff('0x1c0')]['hasMany'](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1b9'),'onDelete':'cascade','foreignKey':_0x35ff('0x1bd')});db['DeskConfiguration'][_0x35ff('0x10e')](db['DeskField'],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1ba')});db['DeskConfiguration'][_0x35ff('0x11b')](db[_0x35ff('0xa4')],{'as':'Account','foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c0')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':'int_desk_configuration_has_tags'});db[_0x35ff('0xa6')][_0x35ff('0x10e')](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db['DeskField']['hasMany'](db[_0x35ff('0xa6')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xa6')][_0x35ff('0x10e')](db['DeskField'],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xa6')][_0x35ff('0x11b')](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db['ZohoAccount'][_0x35ff('0x10e')](db[_0x35ff('0x1c1')],{'as':_0x35ff('0x1b5'),'onDelete':'cascade','foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c1')][_0x35ff('0x10e')](db['ZohoField'],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db['ZohoConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xab')],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0x1c1')]['hasMany'](db[_0x35ff('0xab')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x35ff('0x1c1')][_0x35ff('0x11b')](db[_0x35ff('0xa8')],{'as':'Account','foreignKey':'AccountId'});db[_0x35ff('0xab')][_0x35ff('0x10e')](db[_0x35ff('0xab')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xab')]['hasMany'](db[_0x35ff('0xab')],{'as':'Description','foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xab')][_0x35ff('0x10e')](db[_0x35ff('0xab')],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db['ZohoField'][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xac')][_0x35ff('0x10e')](db[_0x35ff('0xae')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db['ZendeskConfiguration']['hasMany'](db[_0x35ff('0xb0')],{'as':'Subjects','foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xae')][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':'Descriptions','foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xae')][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1b3'),'foreignKey':_0x35ff('0x1ba')});db['ZendeskConfiguration'][_0x35ff('0x11b')](db[_0x35ff('0xac')],{'as':_0x35ff('0x16a'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x1c2')});db[_0x35ff('0xb0')]['hasMany'](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db['ZendeskField'][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db['ZendeskField'][_0x35ff('0x10e')](db[_0x35ff('0xb0')],{'as':_0x35ff('0x1be'),'foreignKey':_0x35ff('0x1ba')});db['ZendeskField'][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':'VariableId'});db[_0x35ff('0xb2')][_0x35ff('0x10e')](db[_0x35ff('0xb4')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db['FreshdeskConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':'Subjects','onDelete':_0x35ff('0x10c'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration']['hasMany'](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1b9'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x35ff('0xb4')][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':'FieldId'});db[_0x35ff('0xb4')][_0x35ff('0x11b')](db['FreshdeskAccount'],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xb4')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x1c3')});db['FreshdeskField'][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xb5')][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1bc'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xb5')][_0x35ff('0x10e')](db[_0x35ff('0xb5')],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xb5')][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xb7')][_0x35ff('0x10e')](db['VtigerConfiguration'],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0x1c4')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x35ff('0x1c4')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':_0x35ff('0x1b9'),'foreignKey':'DescriptionId'});db[_0x35ff('0x1c4')]['hasMany'](db[_0x35ff('0xba')],{'as':_0x35ff('0x1b3'),'foreignKey':_0x35ff('0x1ba')});db['VtigerConfiguration'][_0x35ff('0x11b')](db[_0x35ff('0xb7')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xba')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xba')][_0x35ff('0x10e')](db[_0x35ff('0xba')],{'as':_0x35ff('0x1bc'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x35ff('0x10e')](db['VtigerField'],{'as':_0x35ff('0x1be'),'foreignKey':_0x35ff('0x1ba')});db['VtigerField'][_0x35ff('0x11b')](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xbc')][_0x35ff('0x10e')](db['ServicenowConfiguration'],{'as':_0x35ff('0x1b5'),'onDelete':'cascade','foreignKey':_0x35ff('0x1b6')});db['ServicenowConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xbe')],{'as':_0x35ff('0x1b7'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0x1c5')][_0x35ff('0x10e')](db[_0x35ff('0xbe')],{'as':'Descriptions','foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0x1c5')]['hasMany'](db[_0x35ff('0xbe')],{'as':_0x35ff('0x1b3'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0x1c5')][_0x35ff('0x11b')](db['ServicenowAccount'],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xbe')][_0x35ff('0x10e')](db['ServicenowField'],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xbe')][_0x35ff('0x10e')](db[_0x35ff('0xbe')],{'as':_0x35ff('0x1bc'),'foreignKey':'DescriptionId'});db[_0x35ff('0xbe')][_0x35ff('0x10e')](db['ServicenowField'],{'as':_0x35ff('0x1be'),'foreignKey':'FieldId'});db[_0x35ff('0xbe')]['belongsTo'](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':'VariableId'});db[_0x35ff('0xbf')][_0x35ff('0x10e')](db[_0x35ff('0xc1')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b6')});db[_0x35ff('0xc1')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':_0x35ff('0x1b7'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc1')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':_0x35ff('0x1b9'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1bd')});db[_0x35ff('0xc1')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':_0x35ff('0x1b3'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0xc1')]['belongsTo'](db[_0x35ff('0xbf')],{'as':'Account','foreignKey':_0x35ff('0x1b6')});db['Dynamics365Field'][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':'Subject','foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc2')][_0x35ff('0x10e')](db['Dynamics365Field'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x35ff('0xc2')][_0x35ff('0x10e')](db[_0x35ff('0xc2')],{'as':'Field','foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0xc2')][_0x35ff('0x11b')](db['Variable'],{'as':_0x35ff('0x8b'),'foreignKey':_0x35ff('0x1bf')});db[_0x35ff('0xc4')][_0x35ff('0x10e')](db[_0x35ff('0xc5')],{'as':_0x35ff('0x1b5'),'onDelete':_0x35ff('0x10c'),'foreignKey':'AccountId'});db[_0x35ff('0xc5')]['hasMany'](db[_0x35ff('0xc7')],{'as':'Subjects','foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc5')]['hasMany'](db[_0x35ff('0xc7')],{'as':_0x35ff('0x1b9'),'foreignKey':_0x35ff('0x1bd')});db['FreshsalesConfiguration'][_0x35ff('0x10e')](db[_0x35ff('0xc7')],{'as':'Fields','foreignKey':_0x35ff('0x1ba')});db[_0x35ff('0xc5')]['belongsTo'](db['FreshsalesAccount'],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1b6')});db['FreshsalesField'][_0x35ff('0x10e')](db[_0x35ff('0xc7')],{'as':_0x35ff('0x1bb'),'foreignKey':_0x35ff('0x1b8')});db[_0x35ff('0xc7')]['hasMany'](db[_0x35ff('0xc7')],{'as':_0x35ff('0x1bc'),'foreignKey':'DescriptionId'});db[_0x35ff('0xc7')][_0x35ff('0x10e')](db[_0x35ff('0xc7')],{'as':'Field','foreignKey':'FieldId'});db[_0x35ff('0xc7')][_0x35ff('0x11b')](db[_0x35ff('0x8b')],{'as':_0x35ff('0x8b'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db[_0x35ff('0x126')],{});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db['ChatMessage'],{});db[_0x35ff('0xcb')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0xcb')]['belongsTo'](db['ChatQueue'],{});db['ChatInternalMessage'][_0x35ff('0x11b')](db['User'],{'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1c6')});db['ChatInternalMessage'][_0x35ff('0x11b')](db['User'],{'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x1c7')});db[_0x35ff('0xd2')]['hasMany'](db[_0x35ff('0xd0')],{'foreignKey':_0x35ff('0x1c8'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0xd2')][_0x35ff('0x10e')](db[_0x35ff('0xce')],{'foreignKey':_0x35ff('0x1c8'),'onDelete':_0x35ff('0x10c')});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db[_0x35ff('0x182')],{});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db['CmList'],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db['SmsQueueReport']['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db[_0x35ff('0x52')],{});db['SmsQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x54')],{});db['SmsQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0xd4')][_0x35ff('0x11b')](db[_0x35ff('0x56')],{});db[_0x35ff('0xd9')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x35ff('0x1c9')});db[_0x35ff('0xd9')][_0x35ff('0x10e')](db[_0x35ff('0xd0')],{'foreignKey':_0x35ff('0x1c9')});db['JscriptyProject'][_0x35ff('0x10e')](db[_0x35ff('0xce')],{'foreignKey':_0x35ff('0x1c9')});db[_0x35ff('0xde')][_0x35ff('0x11d')](db['User'],{'as':'Users','through':'user_has_square_projects'});db[_0x35ff('0xe3')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0x35ff('0xe3')][_0x35ff('0x11d')](db['VoiceQueue'],{'through':_0x35ff('0x107'),'as':_0x35ff('0x12d')});db['Team'][_0x35ff('0x11d')](db[_0x35ff('0x130')],{'through':_0x35ff('0x167'),'as':_0x35ff('0x131')});db[_0x35ff('0xe3')][_0x35ff('0x11d')](db[_0x35ff('0x66')],{'through':_0x35ff('0x194'),'as':'ChatQueues'});db[_0x35ff('0xe3')][_0x35ff('0x11d')](db[_0x35ff('0x17d')],{'through':_0x35ff('0x181'),'as':_0x35ff('0x1ca')});db['Team'][_0x35ff('0x11d')](db['SmsQueue'],{'through':_0x35ff('0x186'),'as':_0x35ff('0x133')});db[_0x35ff('0xe3')]['belongsToMany'](db[_0x35ff('0x5c')],{'through':_0x35ff('0x1cb'),'as':'OpenchannelQueues'});db[_0x35ff('0xe3')]['belongsToMany'](db[_0x35ff('0x104')],{'through':'team_has_whatsapp_queues','as':_0x35ff('0x134')});db['Team'][_0x35ff('0x11d')](db[_0x35ff('0xf2')],{'through':_0x35ff('0x108'),'as':_0x35ff('0x12e')});db[_0x35ff('0xe6')][_0x35ff('0x10e')](db[_0x35ff('0x14b')],{'as':'Hoppers','foreignKey':_0x35ff('0x19c')});db[_0x35ff('0xe6')][_0x35ff('0x10e')](db['CmHopperFinal'],{'as':_0x35ff('0x112'),'foreignKey':'CampaignId'});db[_0x35ff('0xe6')]['hasMany'](db['CmHopperHistory'],{'as':_0x35ff('0x14d'),'foreignKey':_0x35ff('0x19c')});db[_0x35ff('0xe6')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x35ff('0x19c')});db[_0x35ff('0xe6')][_0x35ff('0x11b')](db[_0x35ff('0x26')],{'as':_0x35ff('0x26'),'foreignKey':'TrunkId'});db[_0x35ff('0xe6')][_0x35ff('0x11b')](db[_0x35ff('0x26')],{'as':'TrunkBackup','foreignKey':_0x35ff('0x151')});db['Campaign'][_0x35ff('0x11b')](db[_0x35ff('0x7e')],{'as':'Interval','foreignKey':'IntervalId'});db['Campaign']['belongsTo'](db[_0x35ff('0xde')],{'as':_0x35ff('0xde'),'foreignKey':_0x35ff('0x1cc')});db[_0x35ff('0xe6')][_0x35ff('0x11d')](db['CmList'],{'as':'Lists','through':_0x35ff('0x1cd')});db[_0x35ff('0xe6')]['belongsToMany'](db[_0x35ff('0x122')],{'as':_0x35ff('0x1ce'),'through':_0x35ff('0x1cf')});db[_0x35ff('0xe8')][_0x35ff('0x11b')](db['ChatOfflineMessage'],{'as':_0x35ff('0x174'),'foreignKey':'ChatOfflineMessageId'});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db[_0x35ff('0x170')],{});db[_0x35ff('0xeb')]['belongsTo'](db[_0x35ff('0x3e')],{});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x35ff('0x1d0')});db['MailTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db['MailTransferReport']['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':'ToAgent'});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db[_0x35ff('0x130')],{'foreignKey':_0x35ff('0x1d2'),'as':'ToQueue'});db[_0x35ff('0xeb')][_0x35ff('0x11b')](db[_0x35ff('0x139')],{'foreignKey':_0x35ff('0x1d3'),'as':_0x35ff('0x1d4')});db['ChatTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x18f')],{});db['ChatTransferReport']['belongsTo'](db[_0x35ff('0x126')],{});db[_0x35ff('0x1d5')]['belongsTo'](db[_0x35ff('0x5e')],{'foreignKey':_0x35ff('0x1d6'),'as':_0x35ff('0x1d0')});db['ChatTransferReport']['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':'FromAgent'});db[_0x35ff('0x1d5')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':'ToAgent'});db[_0x35ff('0x1d5')][_0x35ff('0x11b')](db[_0x35ff('0x66')],{'foreignKey':_0x35ff('0x1d8'),'as':_0x35ff('0x1d9')});db[_0x35ff('0x1d5')][_0x35ff('0x11b')](db[_0x35ff('0x5e')],{'foreignKey':_0x35ff('0x1da'),'as':_0x35ff('0x1d4')});db['FaxTransferReport'][_0x35ff('0x11b')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0x35ff('0x115')],{});db[_0x35ff('0xed')]['belongsTo'](db[_0x35ff('0x137')],{'foreignKey':_0x35ff('0x1db'),'as':_0x35ff('0x1d0')});db[_0x35ff('0xed')]['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':'FromAgent'});db['FaxTransferReport'][_0x35ff('0x11b')](db['User'],{'foreignKey':'ToUserId','as':_0x35ff('0x1dc')});db[_0x35ff('0xed')][_0x35ff('0x11b')](db[_0x35ff('0x17d')],{'foreignKey':'ToFaxQueueId','as':_0x35ff('0x1d9')});db[_0x35ff('0xed')][_0x35ff('0x11b')](db[_0x35ff('0x137')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db['OpenchannelTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x189')],{});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x5a')],{});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'foreignKey':_0x35ff('0x1de'),'as':_0x35ff('0x1d0')});db[_0x35ff('0x1dd')]['belongsTo'](db['User'],{'foreignKey':_0x35ff('0x1d7'),'as':_0x35ff('0x1df')});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':_0x35ff('0x1dc')});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x5c')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x35ff('0x1dd')][_0x35ff('0x11b')](db[_0x35ff('0x187')],{'foreignKey':_0x35ff('0x1e0'),'as':_0x35ff('0x1d4')});db[_0x35ff('0xef')][_0x35ff('0x11b')](db['SmsMessage'],{});db['SmsTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x52')],{});db['SmsTransferReport'][_0x35ff('0x11b')](db[_0x35ff('0x182')],{'foreignKey':_0x35ff('0x1e1'),'as':_0x35ff('0x1d0')});db['SmsTransferReport']['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':_0x35ff('0x1df')});db[_0x35ff('0xef')]['belongsTo'](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':_0x35ff('0x1dc')});db[_0x35ff('0xef')][_0x35ff('0x11b')](db['SmsQueue'],{'foreignKey':_0x35ff('0x1e2'),'as':_0x35ff('0x1d9')});db[_0x35ff('0xef')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x35ff('0x1e3'),'as':'ToAccount'});db[_0x35ff('0x122')][_0x35ff('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x35ff('0x17b'),'onDelete':'cascade'});db['CmList'][_0x35ff('0x10e')](db[_0x35ff('0x73')],{'as':_0x35ff('0x1e4'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')][_0x35ff('0x10e')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x120'),'onDelete':_0x35ff('0x10c'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')][_0x35ff('0x10e')](db[_0x35ff('0x6f')],{'as':_0x35ff('0x112'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')][_0x35ff('0x10e')](db['CmHopperHistory'],{'as':_0x35ff('0x113'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x122')]['hasMany'](db[_0x35ff('0x71')],{'as':_0x35ff('0x71'),'foreignKey':'ListId'});db[_0x35ff('0x122')]['belongsToMany'](db[_0x35ff('0x12c')],{'as':'Queues','through':_0x35ff('0x156')});db[_0x35ff('0x122')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':'cm_user_has_lists'});db[_0x35ff('0xf2')]['hasMany'](db['VoiceExtension'],{'as':_0x35ff('0x111'),'onDelete':'cascade'});db[_0x35ff('0xf2')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':'UserVoicePrefix'});db[_0x35ff('0xf2')][_0x35ff('0x11d')](db['Team'],{'through':_0x35ff('0x108'),'as':_0x35ff('0x168')});db[_0x35ff('0xf4')]['hasMany'](db[_0x35ff('0xf')],{'as':'Users','foreignKey':_0x35ff('0x11c')});db[_0x35ff('0xf4')]['hasMany'](db[_0x35ff('0x1e5')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x35ff('0x10c')});db[_0x35ff('0x1e5')][_0x35ff('0x10e')](db[_0x35ff('0xf7')],{'as':_0x35ff('0x1e6'),'foreignKey':'sectionId','onDelete':_0x35ff('0x10c')});db['WhatsappAccount'][_0x35ff('0x10e')](db[_0x35ff('0x7a')],{'as':_0x35ff('0x160'),'foreignKey':_0x35ff('0x1e7'),'onDelete':_0x35ff('0x10c')});db['WhatsappAccount']['hasMany'](db['CannedAnswer'],{'as':_0x35ff('0x161'),'foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0xfa')]['hasMany'](db[_0x35ff('0xfe')],{'as':_0x35ff('0x158'),'foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0xfa')][_0x35ff('0x10e')](db[_0x35ff('0xfc')],{'as':_0x35ff('0x162')});db['WhatsappAccount']['hasMany'](db[_0x35ff('0x1e8')],{'as':_0x35ff('0x144')});db[_0x35ff('0xfa')][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':'ListId'});db[_0x35ff('0xfa')][_0x35ff('0x11b')](db[_0x35ff('0x153')],{'as':_0x35ff('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x35ff('0xfa')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':'user_has_whatsapp_accounts'});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0x104')],{'onDelete':'restrict'});db[_0x35ff('0x1e8')]['belongsTo'](db[_0x35ff('0xfa')],{'onDelete':_0x35ff('0x176')});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0x7e')],{'onDelete':_0x35ff('0x176'),'foreignKey':'IntervalId'});db[_0x35ff('0x1e8')][_0x35ff('0x11b')](db[_0x35ff('0x88')],{'onDelete':_0x35ff('0x176'),'foreignKey':_0x35ff('0x177')});db['WhatsappInteraction'][_0x35ff('0x10e')](db[_0x35ff('0xfe')],{'as':'Messages','onDelete':_0x35ff('0x10c'),'foreignKey':'WhatsappInteractionId'});db[_0x35ff('0xfc')]['belongsTo'](db[_0x35ff('0xfa')],{'as':'Account','foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0xfc')]['belongsTo'](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['WhatsappInteraction'][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'as':_0x35ff('0x16b'),'foreignKey':'UserId'});db[_0x35ff('0xfc')][_0x35ff('0x11d')](db[_0x35ff('0x88')],{'through':_0x35ff('0x1ab'),'as':'Tags'});db[_0x35ff('0xfc')][_0x35ff('0x11d')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x35ff('0x16e')});db[_0x35ff('0xfc')][_0x35ff('0x11d')](db['User'],{'as':'Users','through':_0x35ff('0x12b'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x35ff('0x11b')](db['User'],{'as':_0x35ff('0xf')});db['WhatsappMessage'][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'onDelete':_0x35ff('0x10c'),'as':'Contact'});db[_0x35ff('0xfe')]['belongsTo'](db[_0x35ff('0xfc')],{'onDelete':'cascade','as':_0x35ff('0x173'),'foreignKey':_0x35ff('0x1e9')});db['WhatsappMessage'][_0x35ff('0x11b')](db[_0x35ff('0xfa')],{'as':_0x35ff('0x16a'),'foreignKey':_0x35ff('0x1e7')});db[_0x35ff('0x100')]['belongsTo'](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x35ff('0x11b')](db[_0x35ff('0x122')],{'as':_0x35ff('0x163'),'foreignKey':_0x35ff('0x17b')});db[_0x35ff('0x100')][_0x35ff('0x11b')](db[_0x35ff('0x15c')],{'as':_0x35ff('0x172'),'foreignKey':_0x35ff('0x15d')});db['WhatsappQueueReport']['belongsTo'](db[_0x35ff('0xfc')],{});db[_0x35ff('0x100')]['belongsTo'](db[_0x35ff('0x104')],{});db['WhatsappQueueReport'][_0x35ff('0x11b')](db['WhatsappMessage'],{});db[_0x35ff('0x100')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xfe')],{});db[_0x35ff('0x102')]['belongsTo'](db[_0x35ff('0xfc')],{});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xfa')],{'foreignKey':_0x35ff('0x1ea'),'as':_0x35ff('0x1d0')});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xfa')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x35ff('0x102')][_0x35ff('0x11b')](db['WhatsappQueue'],{'foreignKey':_0x35ff('0x1eb'),'as':_0x35ff('0x1d9')});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d7'),'as':'FromAgent'});db[_0x35ff('0x102')][_0x35ff('0x11b')](db[_0x35ff('0xf')],{'foreignKey':_0x35ff('0x1d1'),'as':_0x35ff('0x1dc')});db[_0x35ff('0x104')][_0x35ff('0x11d')](db[_0x35ff('0xf')],{'as':_0x35ff('0x157'),'through':_0x35ff('0x135'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0x35ff('0x11d')](db[_0x35ff('0xe3')],{'through':_0x35ff('0x1ec'),'as':_0x35ff('0x168')});module[_0x35ff('0x1ed')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 9c10dc5..43229a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f22=['/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/server/files/plugins','route','get','sendFile','resolve','appPath','username','password','newPassword','apiKey','firstName','lastName','phone','mobile','clientId','clientSecret','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','@@{','includes','lodash','path','express','express-winston','util','./config/logger','api','auth','./safe-template','safeTemplate','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','agent_id','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign'];(function(_0xbf19e4,_0x5ceb06){var _0x548b7d=function(_0x43b2c8){while(--_0x43b2c8){_0xbf19e4['push'](_0xbf19e4['shift']());}};_0x548b7d(++_0x5ceb06);}(_0x7f22,0x1c5));var _0x27f2=function(_0x128a41,_0x577306){_0x128a41=_0x128a41-0x0;var _0x59a583=_0x7f22[_0x128a41];return _0x59a583;};'use strict';var _=require(_0x27f2('0x0'));var path=require(_0x27f2('0x1'));var express=require(_0x27f2('0x2'));var ewinston=require(_0x27f2('0x3'));var util=require(_0x27f2('0x4'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x27f2('0x5'))(_0x27f2('0x6'));var authLogger=require('./config/logger')(_0x27f2('0x7'));var safeTemplate=require(_0x27f2('0x8'))[_0x27f2('0x9')];exports[_0x27f2('0xa')]=function(_0x2944dd){_0x2944dd['use'](ewinston[_0x27f2('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x346336,_0x52f0ec){var _0x1b566c=_0x27f2('0xc');if(!_[_0x27f2('0xd')](_0x346336['body'])){_0x1b566c+=_0x27f2('0xe');var _0x7beb4d=_0x346336[_0x27f2('0xf')];maskSensitiveData(_0x7beb4d);}return safeTemplate(util[_0x27f2('0x10')](_0x1b566c,_0x346336[_0x27f2('0x11')],_0x346336[_0x27f2('0x12')][_0x27f2('0x13')]?_0x346336[_0x27f2('0x12')][_0x27f2('0x13')]:_0x346336[_0x27f2('0x14')][_0x27f2('0x15')]||_0x346336['ip'],_0x346336[_0x27f2('0x16')],_0x52f0ec[_0x27f2('0x17')],_0x52f0ec[_0x27f2('0x18')],_0x346336[_0x27f2('0x19')]?_0x346336[_0x27f2('0x19')]['id']:null,_0x346336[_0x27f2('0x19')]?_0x346336[_0x27f2('0x19')][_0x27f2('0x1a')]:null,_0x346336[_0x27f2('0x19')]?_0x346336['user'][_0x27f2('0x1b')]:null,_0x7beb4d?util[_0x27f2('0x1c')](_0x7beb4d,![],null):''));}}));_0x2944dd[_0x27f2('0x1d')](ewinston[_0x27f2('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3ca549,_0x3f3ccd){var _0x53f761=_0x27f2('0x1e');if(_0x3ca549[_0x27f2('0xf')]&&_0x3ca549[_0x27f2('0xf')]['device']&&_0x3ca549[_0x27f2('0xf')]['agent_id']){_0x53f761=_0x27f2('0x1f');}return util[_0x27f2('0x10')](_0x53f761,_0x3ca549['method'],_0x3ca549[_0x27f2('0x12')][_0x27f2('0x13')]?_0x3ca549[_0x27f2('0x12')]['x-forwarded-for']:_0x3ca549[_0x27f2('0x14')][_0x27f2('0x15')]||_0x3ca549['ip'],_0x3ca549['url'],_0x3f3ccd[_0x27f2('0x17')],_0x3f3ccd[_0x27f2('0x18')],_0x3ca549[_0x27f2('0x19')]?_0x3ca549[_0x27f2('0x19')]['id']:null,_0x3ca549[_0x27f2('0x19')]?_0x3ca549[_0x27f2('0x19')][_0x27f2('0x1a')]:null,_0x3ca549[_0x27f2('0x19')]?_0x3ca549['user']['role']:null,_0x3ca549[_0x27f2('0xf')]&&_0x3ca549[_0x27f2('0xf')][_0x27f2('0x20')]?_0x3ca549[_0x27f2('0xf')]['device']:'other',_0x3ca549[_0x27f2('0xf')]&&_0x3ca549[_0x27f2('0xf')][_0x27f2('0x21')]?_0x3ca549[_0x27f2('0xf')][_0x27f2('0x21')]:'',_0x3ca549[_0x27f2('0xf')]&&_0x3ca549[_0x27f2('0xf')]['agent_name']?_0x3ca549[_0x27f2('0xf')]['agent_name']:'');},'ignoreRoute':function(_0x4a8541){var _0xf9c42b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xf9c42b[_0x27f2('0x22')](_0x4a8541[_0x27f2('0x16')]);}}));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x23'),require(_0x27f2('0x24')));_0x2944dd['use'](_0x27f2('0x25'),require(_0x27f2('0x26')));_0x2944dd['use']('/api/voice/contexts',require(_0x27f2('0x27')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x28'),require(_0x27f2('0x29')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x2a'),require(_0x27f2('0x2b')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x2c'),require(_0x27f2('0x2d')));_0x2944dd['use'](_0x27f2('0x2e'),require(_0x27f2('0x2f')));_0x2944dd[_0x27f2('0x1d')]('/api/screen/recordings',require(_0x27f2('0x30')));_0x2944dd['use'](_0x27f2('0x31'),require('./api/voiceMail'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x32'),require(_0x27f2('0x33')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x34'),require(_0x27f2('0x35')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x36'),require(_0x27f2('0x37')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x38'),require(_0x27f2('0x39')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x3a'),require(_0x27f2('0x3b')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x3c'),require('./api/memberReport'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x3d'),require('./api/trunk'));_0x2944dd['use'](_0x27f2('0x3e'),require(_0x27f2('0x3f')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x40'),require(_0x27f2('0x41')));_0x2944dd['use'](_0x27f2('0x42'),require('./api/mailAccount'));_0x2944dd['use']('/api/mail/queues',require(_0x27f2('0x43')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x44'),require(_0x27f2('0x45')));_0x2944dd[_0x27f2('0x1d')]('/api/mail/interactions',require(_0x27f2('0x46')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x47'),require(_0x27f2('0x48')));_0x2944dd[_0x27f2('0x1d')]('/api/mail/applications',require(_0x27f2('0x49')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x4a'),require(_0x27f2('0x4b')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x4c'),require('./api/dashboard'));_0x2944dd['use'](_0x27f2('0x4d'),require(_0x27f2('0x4e')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x4f'),require('./api/faxAccount'));_0x2944dd[_0x27f2('0x1d')]('/api/fax/applications',require(_0x27f2('0x50')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x51'),require(_0x27f2('0x52')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x53'),require(_0x27f2('0x54')));_0x2944dd[_0x27f2('0x1d')]('/api/fax/queues',require(_0x27f2('0x55')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x56'),require(_0x27f2('0x57')));_0x2944dd['use']('/api/sms/accounts',require(_0x27f2('0x58')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x59'),require(_0x27f2('0x5a')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x5b'),require(_0x27f2('0x5c')));_0x2944dd[_0x27f2('0x1d')]('/api/sms/messages',require(_0x27f2('0x5d')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x5e'),require(_0x27f2('0x5f')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x60'),require('./api/openchannelAccount'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x61'),require(_0x27f2('0x62')));_0x2944dd['use'](_0x27f2('0x63'),require('./api/openchannelInteraction'));_0x2944dd['use'](_0x27f2('0x64'),require(_0x27f2('0x65')));_0x2944dd['use'](_0x27f2('0x66'),require(_0x27f2('0x67')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x68'),require(_0x27f2('0x69')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x6a'),require(_0x27f2('0x6b')));_0x2944dd[_0x27f2('0x1d')]('/api/chat/applications',require(_0x27f2('0x6c')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x6d'),require(_0x27f2('0x6e')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x6f'),require(_0x27f2('0x70')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x71'),require(_0x27f2('0x72')));_0x2944dd[_0x27f2('0x1d')]('/api/chat/queues',require(_0x27f2('0x73')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x74'),require(_0x27f2('0x75')));_0x2944dd['use']('/api/chat/proactive_actions',require(_0x27f2('0x76')));_0x2944dd['use'](_0x27f2('0x77'),require(_0x27f2('0x78')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x79'),require(_0x27f2('0x7a')));_0x2944dd[_0x27f2('0x1d')]('/api/cm/hopper',require('./api/cmHopper'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x7b'),require(_0x27f2('0x7c')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x7d'),require(_0x27f2('0x7e')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x7f'),require(_0x27f2('0x80')));_0x2944dd['use'](_0x27f2('0x81'),require(_0x27f2('0x82')));_0x2944dd[_0x27f2('0x1d')]('/api/actions',require(_0x27f2('0x83')));_0x2944dd[_0x27f2('0x1d')]('/api/automations',require(_0x27f2('0x84')));_0x2944dd[_0x27f2('0x1d')]('/api/canned_answers',require(_0x27f2('0x85')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x86'),require(_0x27f2('0x87')));_0x2944dd['use']('/api/conditions',require(_0x27f2('0x88')));_0x2944dd[_0x27f2('0x1d')]('/api/intervals',require(_0x27f2('0x89')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x8a'),require('./api/pause'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x8b'),require(_0x27f2('0x8c')));_0x2944dd[_0x27f2('0x1d')]('/api/voiceQueuesLog',require(_0x27f2('0x8d')));_0x2944dd['use'](_0x27f2('0x8e'),require(_0x27f2('0x8f')));_0x2944dd['use'](_0x27f2('0x90'),require(_0x27f2('0x91')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x92'),require('./api/tag'));_0x2944dd['use']('/api/templates',require(_0x27f2('0x93')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x94'),require(_0x27f2('0x95')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x96'),require('./api/variable'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x97'),require('./api/integration'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x98'),require(_0x27f2('0x99')));_0x2944dd['use'](_0x27f2('0x9a'),require(_0x27f2('0x9b')));_0x2944dd[_0x27f2('0x1d')]('/api/analytics/default_reports',require(_0x27f2('0x9c')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x9d'),require(_0x27f2('0x9e')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x9f'),require('./api/analyticMetric'));_0x2944dd[_0x27f2('0x1d')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xa0'),require(_0x27f2('0xa1')));_0x2944dd[_0x27f2('0x1d')]('/api/integrations/salesforce/accounts',require(_0x27f2('0xa2')));_0x2944dd['use'](_0x27f2('0xa3'),require(_0x27f2('0xa4')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xa5'),require(_0x27f2('0xa6')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xa7'),require(_0x27f2('0xa8')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xa9'),require(_0x27f2('0xaa')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xab'),require(_0x27f2('0xac')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xad'),require(_0x27f2('0xae')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xaf'),require(_0x27f2('0xb0')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xb1'),require('./api/intDeskField'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xb2'),require('./api/intZohoAccount'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xb3'),require(_0x27f2('0xb4')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xb5'),require('./api/intZohoField'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xb6'),require(_0x27f2('0xb7')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xb8'),require(_0x27f2('0xb9')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xba'),require('./api/intZendeskField'));_0x2944dd[_0x27f2('0x1d')]('/api/integrations/freshdesk/accounts',require(_0x27f2('0xbb')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xbc'),require('./api/intFreshdeskConfiguration'));_0x2944dd['use'](_0x27f2('0xbd'),require(_0x27f2('0xbe')));_0x2944dd['use']('/api/integrations/vtiger/accounts',require(_0x27f2('0xbf')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xc0'),require(_0x27f2('0xc1')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xc2'),require(_0x27f2('0xc3')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xc4'),require(_0x27f2('0xc5')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xc6'),require(_0x27f2('0xc7')));_0x2944dd[_0x27f2('0x1d')]('/api/integrations/servicenow/fields',require(_0x27f2('0xc8')));_0x2944dd['use'](_0x27f2('0xc9'),require(_0x27f2('0xca')));_0x2944dd[_0x27f2('0x1d')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x2944dd[_0x27f2('0x1d')]('/api/integrations/dynamics365/fields',require(_0x27f2('0xcb')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xcc'),require('./api/intFreshsalesAccount'));_0x2944dd['use'](_0x27f2('0xcd'),require('./api/intFreshsalesConfiguration'));_0x2944dd['use'](_0x27f2('0xce'),require(_0x27f2('0xcf')));_0x2944dd['use'](_0x27f2('0xd0'),require('./api/network'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xd1'),require(_0x27f2('0xd2')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xd3'),require(_0x27f2('0xd4')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xd5'),require('./api/jscriptyAnswerReport'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xd6'),require(_0x27f2('0xd7')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xd8'),require(_0x27f2('0xd9')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xda'),require(_0x27f2('0xdb')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xdc'),require(_0x27f2('0xdd')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xde'),require(_0x27f2('0xdf')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xe0'),require(_0x27f2('0xe1')));_0x2944dd['use'](_0x27f2('0xe2'),require('./api/setting'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xe3'),require(_0x27f2('0xe4')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xe5'),require(_0x27f2('0xe6')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xe7'),require(_0x27f2('0xe8')));_0x2944dd['use'](_0x27f2('0xe9'),require(_0x27f2('0xea')));_0x2944dd['use']('/api/teams',require(_0x27f2('0xeb')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xec'),require(_0x27f2('0xed')));_0x2944dd['use']('/api/campaigns',require(_0x27f2('0xee')));_0x2944dd['use'](_0x27f2('0xef'),require(_0x27f2('0xf0')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xf1'),require(_0x27f2('0xf2')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xf3'),require(_0x27f2('0xf4')));_0x2944dd['use'](_0x27f2('0xf5'),require(_0x27f2('0xf6')));_0x2944dd['use'](_0x27f2('0xf7'),require(_0x27f2('0xf8')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xf9'),require(_0x27f2('0xfa')));_0x2944dd[_0x27f2('0x1d')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xfb'),require(_0x27f2('0xfc')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xfd'),require(_0x27f2('0xfe')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0xff'),require('./api/voicePrefix'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x100'),require(_0x27f2('0x101')));_0x2944dd[_0x27f2('0x1d')]('/api/userProfile/sections',require(_0x27f2('0x102')));_0x2944dd['use'](_0x27f2('0x103'),require(_0x27f2('0x104')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x105'),require(_0x27f2('0x106')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x107'),require(_0x27f2('0x108')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x109'),require(_0x27f2('0x10a')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x10b'),require(_0x27f2('0x10c')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x10d'),require(_0x27f2('0x10e')));_0x2944dd['use'](_0x27f2('0x10f'),require(_0x27f2('0x110')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x111'),require(_0x27f2('0x112')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x113'),require('./api/whatsappQueue'));_0x2944dd['use'](_0x27f2('0x114'),require(_0x27f2('0x115')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x116'),require('./api/realtime'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x117'),require('./api/authLocal'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x118'),require(_0x27f2('0x119')));_0x2944dd['use'](_0x27f2('0x11a'),require(_0x27f2('0x11b')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x11c'),require(_0x27f2('0x11d')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x11e'),require(_0x27f2('0x11f')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x120'),require(_0x27f2('0x121')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x122'),require('./api/pm2'));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x123'),require(_0x27f2('0x124')));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x125'),express[_0x27f2('0x126')](path[_0x27f2('0x127')](config[_0x27f2('0x128')],_0x27f2('0x125'))));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x129'),express[_0x27f2('0x126')](path[_0x27f2('0x127')](config[_0x27f2('0x128')],_0x27f2('0x129'))));_0x2944dd['use'](_0x27f2('0x12a'),express[_0x27f2('0x126')](path['join'](config[_0x27f2('0x128')],_0x27f2('0x12a'))));_0x2944dd[_0x27f2('0x1d')](_0x27f2('0x12b'),express[_0x27f2('0x126')](path['join'](config[_0x27f2('0x128')],_0x27f2('0x12c'),'3.0.0')));_0x2944dd[_0x27f2('0x1d')]('/plugins',express['static'](path[_0x27f2('0x127')](config['root'],_0x27f2('0x12d'))));_0x2944dd[_0x27f2('0x12e')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x27f2('0x12f')](errors[0x194]);_0x2944dd[_0x27f2('0x12e')]('/*')['get'](function(_0x51c273,_0x474863){_0x474863[_0x27f2('0x130')](path[_0x27f2('0x131')](_0x2944dd['get'](_0x27f2('0x132'))+'/index.html'));});};var sensitiveFields=[_0x27f2('0x133'),_0x27f2('0x134'),_0x27f2('0x135'),_0x27f2('0x136'),_0x27f2('0x137'),_0x27f2('0x138'),'street',_0x27f2('0x139'),_0x27f2('0x13a'),'fax','email',_0x27f2('0x13b'),_0x27f2('0x13c'),'securityToken',_0x27f2('0x13d'),_0x27f2('0x13e'),_0x27f2('0x13f'),_0x27f2('0x140'),_0x27f2('0x141'),_0x27f2('0x142'),_0x27f2('0x143'),'authToken',_0x27f2('0x144'),_0x27f2('0x145'),_0x27f2('0x146'),_0x27f2('0x147'),'calleridnum',_0x27f2('0x148'),'vidaooApiKey',_0x27f2('0x149'),_0x27f2('0x14a'),_0x27f2('0x14b'),_0x27f2('0x14c'),_0x27f2('0x14d'),_0x27f2('0x19'),'pass',_0x27f2('0x14e'),_0x27f2('0x14f'),_0x27f2('0x150'),_0x27f2('0x151'),_0x27f2('0x152'),_0x27f2('0x153')];function maskSensitiveData(_0x129be5){var _0x3d494f=/(?!^)[\s\S](?!$)/g;if(!_[_0x27f2('0x154')](_0x129be5))return;for(var _0x44a6d6 in _0x129be5){if(_[_0x27f2('0x155')](_0x129be5[_0x44a6d6])){for(var _0x3f10d5=0x0;_0x3f10d5<_0x129be5[_0x44a6d6][_0x27f2('0x156')];_0x3f10d5++){maskSensitiveData(_0x129be5[_0x44a6d6][_0x3f10d5]);}}else if(_[_0x27f2('0x154')](_0x129be5[_0x44a6d6])){maskSensitiveData(_0x129be5[_0x44a6d6]);}else if(_['isString'](_0x129be5[_0x44a6d6])){_0x129be5[_0x44a6d6]=_0x129be5[_0x44a6d6][_0x27f2('0x157')](/{{{/g,_0x27f2('0x158'))[_0x27f2('0x157')](/}}}/g,'}@@')[_0x27f2('0x157')](/{{/g,'@{')[_0x27f2('0x157')](/}}/g,'}@');if(_[_0x27f2('0x159')](sensitiveFields,_0x44a6d6)){_0x129be5[_0x44a6d6]=_0x129be5[_0x44a6d6][_0x27f2('0x157')](_0x3d494f,'*');}}}}
\ No newline at end of file
+var _0xed20=['./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','/www','/demo','root','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','appPath','username','password','newPassword','apiKey','firstName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerSecret','calleridname','calleridnum','exten','vidaooApiKey','accesskeyid','secretaccesskey','key','pass','accountSid','oldPassword','isPlainObject','isArray','isString','replace','@@{','}@@','includes','lodash','express-winston','util','./errors','api','./safe-template','safeTemplate','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','other','agent_id','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xed20,0x1b9));var _0x0ed2=function(_0x39ca44,_0x2d3b0f){_0x39ca44=_0x39ca44-0x0;var _0x5e6191=_0xed20[_0x39ca44];return _0x5e6191;};'use strict';var _=require(_0x0ed2('0x0'));var path=require('path');var express=require('express');var ewinston=require(_0x0ed2('0x1'));var util=require(_0x0ed2('0x2'));var errors=require(_0x0ed2('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0x0ed2('0x4'));var authLogger=require('./config/logger')('auth');var safeTemplate=require(_0x0ed2('0x5'))[_0x0ed2('0x6')];exports['default']=function(_0x35f80f){_0x35f80f[_0x0ed2('0x7')](ewinston[_0x0ed2('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2fbb7d,_0x15a400){var _0x10c61d=_0x0ed2('0x9');if(!_[_0x0ed2('0xa')](_0x2fbb7d[_0x0ed2('0xb')])){_0x10c61d+=_0x0ed2('0xc');var _0x52842b=_0x2fbb7d['body'];maskSensitiveData(_0x52842b);}return safeTemplate(util[_0x0ed2('0xd')](_0x10c61d,_0x2fbb7d[_0x0ed2('0xe')],_0x2fbb7d['headers']['x-forwarded-for']?_0x2fbb7d[_0x0ed2('0xf')][_0x0ed2('0x10')]:_0x2fbb7d[_0x0ed2('0x11')][_0x0ed2('0x12')]||_0x2fbb7d['ip'],_0x2fbb7d[_0x0ed2('0x13')],_0x15a400[_0x0ed2('0x14')],_0x15a400[_0x0ed2('0x15')],_0x2fbb7d[_0x0ed2('0x16')]?_0x2fbb7d[_0x0ed2('0x16')]['id']:null,_0x2fbb7d['user']?_0x2fbb7d[_0x0ed2('0x16')][_0x0ed2('0x17')]:null,_0x2fbb7d[_0x0ed2('0x16')]?_0x2fbb7d[_0x0ed2('0x16')][_0x0ed2('0x18')]:null,_0x52842b?util[_0x0ed2('0x19')](_0x52842b,![],null):''));}}));_0x35f80f[_0x0ed2('0x7')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xa63513,_0x28bfe8){var _0x1c5079=_0x0ed2('0x1a');if(_0xa63513[_0x0ed2('0xb')]&&_0xa63513[_0x0ed2('0xb')][_0x0ed2('0x1b')]&&_0xa63513[_0x0ed2('0xb')]['agent_id']){_0x1c5079='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x0ed2('0xd')](_0x1c5079,_0xa63513[_0x0ed2('0xe')],_0xa63513['headers'][_0x0ed2('0x10')]?_0xa63513['headers']['x-forwarded-for']:_0xa63513[_0x0ed2('0x11')]['remoteAddress']||_0xa63513['ip'],_0xa63513[_0x0ed2('0x13')],_0x28bfe8['statusCode'],_0x28bfe8[_0x0ed2('0x15')],_0xa63513['user']?_0xa63513[_0x0ed2('0x16')]['id']:null,_0xa63513[_0x0ed2('0x16')]?_0xa63513[_0x0ed2('0x16')][_0x0ed2('0x17')]:null,_0xa63513[_0x0ed2('0x16')]?_0xa63513[_0x0ed2('0x16')][_0x0ed2('0x18')]:null,_0xa63513[_0x0ed2('0xb')]&&_0xa63513['body'][_0x0ed2('0x1b')]?_0xa63513[_0x0ed2('0xb')][_0x0ed2('0x1b')]:_0x0ed2('0x1c'),_0xa63513[_0x0ed2('0xb')]&&_0xa63513[_0x0ed2('0xb')][_0x0ed2('0x1d')]?_0xa63513['body'][_0x0ed2('0x1d')]:'',_0xa63513[_0x0ed2('0xb')]&&_0xa63513['body'][_0x0ed2('0x1e')]?_0xa63513[_0x0ed2('0xb')]['agent_name']:'');},'ignoreRoute':function(_0xd55bd8){var _0x111296=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x111296[_0x0ed2('0x1f')](_0xd55bd8['url']);}}));_0x35f80f['use']('/api/users',require(_0x0ed2('0x20')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x21'),require('./api/voiceChanSpy'));_0x35f80f[_0x0ed2('0x7')]('/api/voice/contexts',require(_0x0ed2('0x22')));_0x35f80f[_0x0ed2('0x7')]('/api/voice/extensions',require(_0x0ed2('0x23')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x24'),require('./api/voiceMusicOnHold'));_0x35f80f[_0x0ed2('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x35f80f['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x25'),require(_0x0ed2('0x26')));_0x35f80f[_0x0ed2('0x7')]('/api/voice/mails',require('./api/voiceMail'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x27'),require(_0x0ed2('0x28')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x29'),require(_0x0ed2('0x2a')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x2b'),require(_0x0ed2('0x2c')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x2d'),require('./api/voiceAgentReport'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x2e'),require(_0x0ed2('0x2f')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x30'),require(_0x0ed2('0x31')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x32'),require(_0x0ed2('0x33')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x34'),require(_0x0ed2('0x35')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x36'),require(_0x0ed2('0x37')));_0x35f80f['use'](_0x0ed2('0x38'),require('./api/mailAccount'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x39'),require('./api/mailQueue'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x3a'),require(_0x0ed2('0x3b')));_0x35f80f['use'](_0x0ed2('0x3c'),require(_0x0ed2('0x3d')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x3e'),require(_0x0ed2('0x3f')));_0x35f80f[_0x0ed2('0x7')]('/api/mail/applications',require(_0x0ed2('0x40')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x41'),require(_0x0ed2('0x42')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x43'),require(_0x0ed2('0x44')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x45'),require(_0x0ed2('0x46')));_0x35f80f['use']('/api/fax/accounts',require('./api/faxAccount'));_0x35f80f['use']('/api/fax/applications',require(_0x0ed2('0x47')));_0x35f80f[_0x0ed2('0x7')]('/api/fax/interactions',require(_0x0ed2('0x48')));_0x35f80f[_0x0ed2('0x7')]('/api/fax/messages',require(_0x0ed2('0x49')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x4a'),require(_0x0ed2('0x4b')));_0x35f80f[_0x0ed2('0x7')]('/api/fax/reports/queue',require(_0x0ed2('0x4c')));_0x35f80f['use'](_0x0ed2('0x4d'),require(_0x0ed2('0x4e')));_0x35f80f[_0x0ed2('0x7')]('/api/sms/applications',require(_0x0ed2('0x4f')));_0x35f80f['use'](_0x0ed2('0x50'),require(_0x0ed2('0x51')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x52'),require(_0x0ed2('0x53')));_0x35f80f['use'](_0x0ed2('0x54'),require(_0x0ed2('0x55')));_0x35f80f['use'](_0x0ed2('0x56'),require(_0x0ed2('0x57')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x58'),require(_0x0ed2('0x59')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x5a'),require(_0x0ed2('0x5b')));_0x35f80f[_0x0ed2('0x7')]('/api/openchannel/messages',require(_0x0ed2('0x5c')));_0x35f80f[_0x0ed2('0x7')]('/api/openchannel/queues',require(_0x0ed2('0x5d')));_0x35f80f['use'](_0x0ed2('0x5e'),require('./api/chatWebsite'));_0x35f80f['use'](_0x0ed2('0x5f'),require(_0x0ed2('0x60')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x61'),require('./api/chatApplication'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x62'),require(_0x0ed2('0x63')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x64'),require(_0x0ed2('0x65')));_0x35f80f['use'](_0x0ed2('0x66'),require(_0x0ed2('0x67')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x68'),require(_0x0ed2('0x69')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x6a'),require(_0x0ed2('0x6b')));_0x35f80f['use'](_0x0ed2('0x6c'),require(_0x0ed2('0x6d')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x6e'),require('./api/cmCompany'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x6f'),require('./api/cmContact'));_0x35f80f[_0x0ed2('0x7')]('/api/cm/hopper',require(_0x0ed2('0x70')));_0x35f80f['use'](_0x0ed2('0x71'),require(_0x0ed2('0x72')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x73'),require('./api/cmHopperFinal'));_0x35f80f['use'](_0x0ed2('0x74'),require('./api/cmHopperHistory'));_0x35f80f['use'](_0x0ed2('0x75'),require(_0x0ed2('0x76')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x77'),require(_0x0ed2('0x78')));_0x35f80f['use'](_0x0ed2('0x79'),require(_0x0ed2('0x7a')));_0x35f80f['use']('/api/canned_answers',require(_0x0ed2('0x7b')));_0x35f80f['use'](_0x0ed2('0x7c'),require(_0x0ed2('0x7d')));_0x35f80f['use'](_0x0ed2('0x7e'),require('./api/condition'));_0x35f80f['use']('/api/intervals',require('./api/interval'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x7f'),require(_0x0ed2('0x80')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x81'),require(_0x0ed2('0x82')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x83'),require(_0x0ed2('0x84')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x85'),require('./api/schedule'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x86'),require(_0x0ed2('0x87')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x88'),require('./api/tag'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x89'),require(_0x0ed2('0x8a')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x8b'),require(_0x0ed2('0x8c')));_0x35f80f['use'](_0x0ed2('0x8d'),require(_0x0ed2('0x8e')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x8f'),require('./api/integration'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x90'),require(_0x0ed2('0x91')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x92'),require(_0x0ed2('0x93')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x94'),require('./api/analyticDefaultReport'));_0x35f80f['use']('/api/analytics/extracted_reports',require(_0x0ed2('0x95')));_0x35f80f[_0x0ed2('0x7')]('/api/analytics/metrics',require(_0x0ed2('0x96')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x97'),require(_0x0ed2('0x98')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x99'),require(_0x0ed2('0x9a')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x9b'),require(_0x0ed2('0x9c')));_0x35f80f[_0x0ed2('0x7')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x35f80f[_0x0ed2('0x7')]('/api/integrations/salesforce/fields',require(_0x0ed2('0x9d')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x9e'),require(_0x0ed2('0x9f')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xa0'),require(_0x0ed2('0xa1')));_0x35f80f[_0x0ed2('0x7')]('/api/integrations/sugarcrm/fields',require(_0x0ed2('0xa2')));_0x35f80f['use'](_0x0ed2('0xa3'),require(_0x0ed2('0xa4')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xa5'),require(_0x0ed2('0xa6')));_0x35f80f['use'](_0x0ed2('0xa7'),require(_0x0ed2('0xa8')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xa9'),require(_0x0ed2('0xaa')));_0x35f80f['use'](_0x0ed2('0xab'),require(_0x0ed2('0xac')));_0x35f80f[_0x0ed2('0x7')]('/api/integrations/zoho/fields',require(_0x0ed2('0xad')));_0x35f80f['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x35f80f['use'](_0x0ed2('0xae'),require(_0x0ed2('0xaf')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xb0'),require('./api/intZendeskField'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xb1'),require(_0x0ed2('0xb2')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xb3'),require(_0x0ed2('0xb4')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xb5'),require('./api/intFreshdeskField'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xb6'),require('./api/intVtigerAccount'));_0x35f80f['use']('/api/integrations/vtiger/configurations',require(_0x0ed2('0xb7')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xb8'),require(_0x0ed2('0xb9')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xba'),require(_0x0ed2('0xbb')));_0x35f80f['use'](_0x0ed2('0xbc'),require(_0x0ed2('0xbd')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xbe'),require('./api/intServicenowField'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xbf'),require(_0x0ed2('0xc0')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xc1'),require('./api/intDynamics365Configuration'));_0x35f80f[_0x0ed2('0x7')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xc2'),require(_0x0ed2('0xc3')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xc4'),require('./api/intFreshsalesConfiguration'));_0x35f80f['use'](_0x0ed2('0xc5'),require('./api/intFreshsalesField'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xc6'),require(_0x0ed2('0xc7')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xc8'),require(_0x0ed2('0xc9')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xca'),require(_0x0ed2('0xcb')));_0x35f80f[_0x0ed2('0x7')]('/api/jscripty/answers/reports',require(_0x0ed2('0xcc')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xcd'),require(_0x0ed2('0xce')));_0x35f80f[_0x0ed2('0x7')]('/api/jscripty/sessions/reports',require(_0x0ed2('0xcf')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xd0'),require(_0x0ed2('0xd1')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xd2'),require(_0x0ed2('0xd3')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xd4'),require(_0x0ed2('0xd5')));_0x35f80f['use']('/api/jscripty/projects',require('./api/jscriptyProject'));_0x35f80f['use'](_0x0ed2('0xd6'),require(_0x0ed2('0xd7')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xd8'),require(_0x0ed2('0xd9')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xda'),require(_0x0ed2('0xdb')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xdc'),require(_0x0ed2('0xdd')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xde'),require(_0x0ed2('0xdf')));_0x35f80f['use'](_0x0ed2('0xe0'),require(_0x0ed2('0xe1')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xe2'),require('./api/license'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xe3'),require(_0x0ed2('0xe4')));_0x35f80f[_0x0ed2('0x7')]('/api/migrations',require('./api/migration'));_0x35f80f['use'](_0x0ed2('0xe5'),require(_0x0ed2('0xe6')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xe7'),require(_0x0ed2('0xe8')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xe9'),require(_0x0ed2('0xea')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xeb'),require(_0x0ed2('0xec')));_0x35f80f[_0x0ed2('0x7')]('/api/fax/reports/transfer',require(_0x0ed2('0xed')));_0x35f80f[_0x0ed2('0x7')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xee'),require(_0x0ed2('0xef')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xf0'),require(_0x0ed2('0xf1')));_0x35f80f[_0x0ed2('0x7')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x35f80f['use'](_0x0ed2('0xf2'),require(_0x0ed2('0xf3')));_0x35f80f['use'](_0x0ed2('0xf4'),require('./api/userProfileSection'));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xf5'),require(_0x0ed2('0xf6')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xf7'),require(_0x0ed2('0xf8')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xf9'),require(_0x0ed2('0xfa')));_0x35f80f['use'](_0x0ed2('0xfb'),require(_0x0ed2('0xfc')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xfd'),require(_0x0ed2('0xfe')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0xff'),require(_0x0ed2('0x100')));_0x35f80f['use'](_0x0ed2('0x101'),require(_0x0ed2('0x102')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x103'),require(_0x0ed2('0x104')));_0x35f80f[_0x0ed2('0x7')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x35f80f['use'](_0x0ed2('0x105'),require(_0x0ed2('0x106')));_0x35f80f['use'](_0x0ed2('0x107'),require(_0x0ed2('0x108')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x109'),require(_0x0ed2('0x10a')));_0x35f80f[_0x0ed2('0x7')]('/api/auth/google',require(_0x0ed2('0x10b')));_0x35f80f['use'](_0x0ed2('0x10c'),require('./api/jira'));_0x35f80f[_0x0ed2('0x7')]('/api/rpc',require(_0x0ed2('0x10d')));_0x35f80f['use'](_0x0ed2('0x10e'),require(_0x0ed2('0x10f')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x110'),require(_0x0ed2('0x111')));_0x35f80f['use'](_0x0ed2('0x112'),require(_0x0ed2('0x113')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x114'),require(_0x0ed2('0x115')));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x116'),express[_0x0ed2('0x117')](path[_0x0ed2('0x118')](config['root'],_0x0ed2('0x116'))));_0x35f80f[_0x0ed2('0x7')]('/www',express[_0x0ed2('0x117')](path[_0x0ed2('0x118')](config['root'],_0x0ed2('0x119'))));_0x35f80f[_0x0ed2('0x7')](_0x0ed2('0x11a'),express[_0x0ed2('0x117')](path[_0x0ed2('0x118')](config[_0x0ed2('0x11b')],_0x0ed2('0x11a'))));_0x35f80f['use'](_0x0ed2('0x11c'),express['static'](path[_0x0ed2('0x118')](config[_0x0ed2('0x11b')],_0x0ed2('0x11d'),_0x0ed2('0x11e'))));_0x35f80f['use'](_0x0ed2('0x11f'),express[_0x0ed2('0x117')](path['join'](config[_0x0ed2('0x11b')],_0x0ed2('0x120'))));_0x35f80f['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x35f80f[_0x0ed2('0x121')]('/*')[_0x0ed2('0x122')](function(_0x18d2b2,_0x1dd7e0){_0x1dd7e0[_0x0ed2('0x123')](path['resolve'](_0x35f80f[_0x0ed2('0x122')](_0x0ed2('0x124'))+'/index.html'));});};var sensitiveFields=[_0x0ed2('0x125'),_0x0ed2('0x126'),_0x0ed2('0x127'),_0x0ed2('0x128'),_0x0ed2('0x129'),'lastName',_0x0ed2('0x12a'),_0x0ed2('0x12b'),_0x0ed2('0x12c'),_0x0ed2('0x12d'),_0x0ed2('0x12e'),_0x0ed2('0x12f'),_0x0ed2('0x130'),_0x0ed2('0x131'),_0x0ed2('0x132'),'accessKey',_0x0ed2('0x133'),_0x0ed2('0x134'),_0x0ed2('0x135'),_0x0ed2('0x136'),_0x0ed2('0x137'),'authToken','consumerKey',_0x0ed2('0x138'),'membername',_0x0ed2('0x139'),_0x0ed2('0x13a'),_0x0ed2('0x13b'),_0x0ed2('0x13c'),'clientEmail','privateKey',_0x0ed2('0x13d'),_0x0ed2('0x13e'),_0x0ed2('0x13f'),_0x0ed2('0x16'),_0x0ed2('0x140'),_0x0ed2('0x141'),'localstationid','dsn','secret','registry',_0x0ed2('0x142')];function maskSensitiveData(_0x14e5c9){var _0xf234b3=/(?!^)[\s\S](?!$)/g;if(!_[_0x0ed2('0x143')](_0x14e5c9))return;for(var _0x15863c in _0x14e5c9){if(_[_0x0ed2('0x144')](_0x14e5c9[_0x15863c])){for(var _0x3fb835=0x0;_0x3fb835<_0x14e5c9[_0x15863c]['length'];_0x3fb835++){maskSensitiveData(_0x14e5c9[_0x15863c][_0x3fb835]);}}else if(_[_0x0ed2('0x143')](_0x14e5c9[_0x15863c])){maskSensitiveData(_0x14e5c9[_0x15863c]);}else if(_[_0x0ed2('0x145')](_0x14e5c9[_0x15863c])){_0x14e5c9[_0x15863c]=_0x14e5c9[_0x15863c][_0x0ed2('0x146')](/{{{/g,_0x0ed2('0x147'))['replace'](/}}}/g,_0x0ed2('0x148'))['replace'](/{{/g,'@{')[_0x0ed2('0x146')](/}}/g,'}@');if(_[_0x0ed2('0x149')](sensitiveFields,_0x15863c)){_0x14e5c9[_0x15863c]=_0x14e5c9[_0x15863c]['replace'](_0xf234b3,'*');}}}}
\ No newline at end of file
index a7a45bc..4260726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc6f=['lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird'];(function(_0x58537f,_0x29bb26){var _0x26bf1a=function(_0x5f51a4){while(--_0x5f51a4){_0x58537f['push'](_0x58537f['shift']());}};_0x26bf1a(++_0x29bb26);}(_0xdc6f,0x8c));var _0xfdc6=function(_0x5be46a,_0x2fb035){_0x5be46a=_0x5be46a-0x0;var _0x1ce3b8=_0xdc6f[_0x5be46a];return _0x1ce3b8;};'use strict';var jayson=require(_0xfdc6('0x0'));var BPromise=require(_0xfdc6('0x1'));var _=require(_0xfdc6('0x2'));var config=require(_0xfdc6('0x3'));exports[_0xfdc6('0x4')]=function(){return new BPromise(function(_0x38dae3,_0x2a1228){var _0x1f0b94={};_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x6')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x7')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x8')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x9')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0xa')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x1f0b94=_['merge'](_0x1f0b94,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1f0b94=_['merge'](_0x1f0b94,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0xb')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0xc')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0xd')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0xe')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0xf')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x10')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x11')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x12')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x13')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/mailApplication/mailApplication.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x14')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/faxAccount/faxAccount.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x15')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x16')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x17')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x18')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x19')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x1a')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x1b')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x1c')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x1d')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x1e')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x1f')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x20')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x21')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x22')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x23')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/chatQueue/chatQueue.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/cmContact/cmContact.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x24')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x25')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x26')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x27')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x28')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x29')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/sound/sound.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/template/template.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x2a')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x2b')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x2c')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x2d')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x2e')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x2f')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x30')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x31')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x32')));_0x1f0b94=_['merge'](_0x1f0b94,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x33')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/squareReport/squareReport.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x34')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x35')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x36')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x37')));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x38')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x39')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x3a')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x3b')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x3c')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1f0b94=_['merge'](_0x1f0b94,require(_0xfdc6('0x3d')));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1f0b94=_[_0xfdc6('0x5')](_0x1f0b94,require(_0xfdc6('0x3e')));var _0x1a6fac=jayson[_0xfdc6('0x3f')](_0x1f0b94)[_0xfdc6('0x40')]();var _0x2aea98=config[_0xfdc6('0x41')][_0xfdc6('0x42')]||config[_0xfdc6('0x42')]+0x1;var _0xb58fdc=config[_0xfdc6('0x41')]['ip']||'localhost';_0x1a6fac['on'](_0xfdc6('0x43'),function(_0x29fc1f){return _0x2a1228(_0x29fc1f);});_0x1a6fac['listen'](_0x2aea98,_0xb58fdc,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0xb58fdc,_0x2aea98);require(_0xfdc6('0x44'))[_0xfdc6('0x45')]();return _0x38dae3(_0xfdc6('0x46')+_0xb58fdc+':'+_0x2aea98);});});};
\ No newline at end of file
+var _0xe7ec=['../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc'];(function(_0x5e74a3,_0x5eeff9){var _0x29ecb5=function(_0x22180c){while(--_0x22180c){_0x5e74a3['push'](_0x5e74a3['shift']());}};_0x29ecb5(++_0x5eeff9);}(_0xe7ec,0x14f));var _0xce7e=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0xe7ec[_0x254b22];return _0x1279db;};'use strict';var jayson=require(_0xce7e('0x0'));var BPromise=require(_0xce7e('0x1'));var _=require(_0xce7e('0x2'));var config=require(_0xce7e('0x3'));exports[_0xce7e('0x4')]=function(){return new BPromise(function(_0x4e536e,_0x2cc2df){var _0x2ac9c0={};_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x6')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x7')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x8')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x9')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0xa')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0xb')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0xc')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0xd')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0xe')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0xf')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x10')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x11')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x12')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x13')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x14')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x15')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x16')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x17')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x18')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x19')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/faxInteraction/faxInteraction.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x1a')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x1b')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x1c')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x1d')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/smsInteraction/smsInteraction.rpc'));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/smsMessage/smsMessage.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x1e')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x1f')));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/chatInteraction/chatInteraction.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x20')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x21')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x22')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x23')));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x24')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x25')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x26')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x27')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x28')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x29')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x2a')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x2b')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x2c')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x2d')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x2e')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x2f')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x30')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x31')));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x32')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x33')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x34')));_0x2ac9c0=_['merge'](_0x2ac9c0,require('../api/squareReport/squareReport.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x35')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/setting/setting.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x36')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x37')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/squareRecording/squareRecording.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x38')));_0x2ac9c0=_['merge'](_0x2ac9c0,require(_0xce7e('0x39')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x3a')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x3b')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x3c')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x3d')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x3e')));_0x2ac9c0=_[_0xce7e('0x5')](_0x2ac9c0,require(_0xce7e('0x3f')));var _0x5e7db0=jayson[_0xce7e('0x40')](_0x2ac9c0)['http']();var _0x1b7db4=config[_0xce7e('0x41')][_0xce7e('0x42')]||config[_0xce7e('0x42')]+0x1;var _0x47bf77=config[_0xce7e('0x41')]['ip']||_0xce7e('0x43');_0x5e7db0['on'](_0xce7e('0x44'),function(_0x3f7fba){return _0x2cc2df(_0x3f7fba);});_0x5e7db0[_0xce7e('0x4')](_0x1b7db4,_0x47bf77,function(){console[_0xce7e('0x45')](_0xce7e('0x46'),_0x47bf77,_0x1b7db4);require(_0xce7e('0x47'))[_0xce7e('0x48')]();return _0x4e536e(_0xce7e('0x49')+_0x47bf77+':'+_0x1b7db4);});});};
\ No newline at end of file
index 4433a43..5b5cfe7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4213=['{\x20{\x20','\x20}\x20}','string','isArray','isPlainObject','keys','reduce','exports','safeTemplate','lodash'];(function(_0x401242,_0x29e5d7){var _0xb6a5a1=function(_0x3fa547){while(--_0x3fa547){_0x401242['push'](_0x401242['shift']());}};_0xb6a5a1(++_0x29e5d7);}(_0x4213,0x77));var _0x3421=function(_0x3ab64f,_0x2caba8){_0x3ab64f=_0x3ab64f-0x0;var _0x412361=_0x4213[_0x3ab64f];return _0x412361;};var _=require(_0x3421('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x445ef6){return _0x445ef6==='{{'?_0x3421('0x1'):_0x3421('0x2');}function safeTemplate(_0x2613b6){var _0x153f3a=_0x2613b6;if(typeof _0x2613b6===_0x3421('0x3')){_0x153f3a=_0x2613b6['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3421('0x4')](_0x2613b6)){_0x153f3a=_0x2613b6['map'](function(_0x459c5e){return safeTemplate(_0x459c5e);});}else if(_[_0x3421('0x5')](_0x2613b6)){_0x153f3a=Object[_0x3421('0x6')](_0x2613b6)[_0x3421('0x7')](function(_0x5469d8,_0x50e464){_0x5469d8[_0x50e464]=safeTemplate(_0x2613b6[_0x50e464]);return _0x5469d8;},{});}return _0x153f3a;}module[_0x3421('0x8')][_0x3421('0x9')]=safeTemplate;
\ No newline at end of file
+var _0xe511=['\x20}\x20}','string','isArray','map','isPlainObject','reduce','safeTemplate','lodash'];(function(_0x30ce2b,_0x503d7a){var _0x16ea8e=function(_0x2422a0){while(--_0x2422a0){_0x30ce2b['push'](_0x30ce2b['shift']());}};_0x16ea8e(++_0x503d7a);}(_0xe511,0x16f));var _0x1e51=function(_0x2c421b,_0x234646){_0x2c421b=_0x2c421b-0x0;var _0x2a138c=_0xe511[_0x2c421b];return _0x2a138c;};var _=require(_0x1e51('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x3a7329){return _0x3a7329==='{{'?'{\x20{\x20':_0x1e51('0x1');}function safeTemplate(_0x5b9e45){var _0x253e96=_0x5b9e45;if(typeof _0x5b9e45===_0x1e51('0x2')){_0x253e96=_0x5b9e45['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1e51('0x3')](_0x5b9e45)){_0x253e96=_0x5b9e45[_0x1e51('0x4')](function(_0x204da7){return safeTemplate(_0x204da7);});}else if(_[_0x1e51('0x5')](_0x5b9e45)){_0x253e96=Object['keys'](_0x5b9e45)[_0x1e51('0x6')](function(_0x21ed6b,_0x5c4590){_0x21ed6b[_0x5c4590]=safeTemplate(_0x5b9e45[_0x5c4590]);return _0x21ed6b;},{});}return _0x253e96;}module['exports'][_0x1e51('0x7')]=safeTemplate;
\ No newline at end of file
index bc3da59..aaee47c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7827=['indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','function','prototype','sendRequest','sync','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','format','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','setPriority','getVariable','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','./error','utf8','setTimeout','setEncoding','headers','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','substring','replace','result='];(function(_0x4354e1,_0x403394){var _0x4266b6=function(_0x67472){while(--_0x67472){_0x4354e1['push'](_0x4354e1['shift']());}};_0x4266b6(++_0x403394);}(_0x7827,0x19d));var _0x7782=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7827[_0x3635ce];return _0x97ecd0;};'use strict';var util=require(_0x7782('0x0'));var _=require(_0x7782('0x1'));var EventEmitter=require(_0x7782('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x7782('0x3'));function AGIChannel(_0x4f783e){var _0xcbfbc=this,_0x321f67=new AGIReply(),_0x2c7008=![],_0x3fc156={};EventEmitter['call'](_0xcbfbc);_0x4f783e['setEncoding'](_0x7782('0x4'));_0x4f783e[_0x7782('0x5')](0x8*0x3c*0x3c*0x3e8);_0x321f67[_0x7782('0x6')](_0x7782('0x4'));_0x321f67['on'](_0x7782('0x7'),function(_0x547d24){for(var _0x26aeea in _0x547d24){_0xcbfbc[_0x26aeea]=_0x547d24[_0x26aeea];}_0xcbfbc['emit'](_0x7782('0x8'));});_0x321f67['on'](_0x7782('0x9'),function(_0x1d8856){if(_0x1d8856[_0x7782('0xa')]()==_0x7782('0xb')){_0xcbfbc['emit']('hangup');return;}if(_0x1d8856['substring'](0x0,0xb)==_0x7782('0xc')){_0x2c7008=!![];}if(_0x2c7008){_0x3fc156['rx']+=_0x1d8856+'\x0a';if(_0x1d8856[_0x7782('0xd')](_0x7782('0xe'))!=-0x1){_0x2c7008=![];}}else{_0x3fc156['rx']=_0x1d8856;}if(_0x2c7008){return;}if(typeof _0x3fc156['cb']=='function'){var _0xaeb20e=_0x3fc156['rx']['substring'](0x0,0x3),_0x518b66=null,_0x235ff5=null;_0xaeb20e=parseInt(_0xaeb20e);if(isNaN(_0xaeb20e)){_0x3fc156['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x7782('0xf')});return;}if(_0xaeb20e!=0xc8){_0x3fc156['cb'](null,{'code':_0xaeb20e,'result':-0x1,'extra':'KO'});return;}_0x518b66=_0x3fc156['rx'][_0x7782('0x10')](0x4)[_0x7782('0x11')](_0x7782('0x12'),'');if(_0x518b66[_0x7782('0x13')]('\x20')!=-0x1){_0x518b66=_0x518b66[_0x7782('0x14')](0x0,_0x518b66[_0x7782('0x13')]('\x20'));}if(_[_0x7782('0x15')](_0x518b66,'-1')){_0x518b66=parseInt(_0x518b66);}_0x235ff5=_0x3fc156['rx'][_0x7782('0x16')]('\x20');if(_0x235ff5[_0x7782('0x17')]==0x3){_0x235ff5=_0x235ff5[0x2][_0x7782('0x10')](0x1,_0x235ff5[0x2][_0x7782('0x17')]-0x1);}else if(_0x235ff5[_0x7782('0x17')]>0x3){var _0x35d1ec=/\((.+)\)/;var _0x3af36e=_0x3fc156['rx'][_0x7782('0x18')](_0x35d1ec);if(_0x3af36e){_0x235ff5=_0x3af36e[0x1];}else{_0x235ff5=null;}}else{_0x235ff5=null;}_0x3fc156['cb'](null,{'code':_0xaeb20e,'result':_0x518b66,'extra':_0x235ff5});}});_0x4f783e['on'](_0x7782('0x19'),function(_0xa43aa5){_0xcbfbc['emit'](_0x7782('0x19'),new AGIError(_0x7782('0x1a'),_0xa43aa5[_0x7782('0x1b')]));});_0x4f783e['on'](_0x7782('0x1c'),function(){_0xcbfbc['emit']('close',new AGIError(_0x7782('0x1d')));});_0x4f783e['on'](_0x7782('0x1e'),function(){_0xcbfbc['emit'](_0x7782('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4f783e[_0x7782('0x1f')]();});_0x4f783e[_0x7782('0x20')](_0x321f67);this[_0x7782('0x21')]=function(_0x1f1bb5,_0x5f26f6){var _0x1f1bb5=_0x1f1bb5||'',_0x5f26f6=typeof _0x5f26f6==_0x7782('0x22')?_0x5f26f6:new Function();_0x3fc156={'tx':_0x1f1bb5,'rx':'','cb':_0x5f26f6};_0x4f783e['write'](_0x1f1bb5+'\x0a');},this[_0x7782('0x1c')]=function(){_0x4f783e['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x7782('0x23')][_0x7782('0x24')]=function(_0x2a7a45){return this['command'][_0x7782('0x25')](this,_0x2a7a45);};AGIChannel[_0x7782('0x23')]['answer']=function(){return this[_0x7782('0x24')](_0x7782('0x26'));};AGIChannel['prototype']['getData']=function(_0x1dfb5c,_0x355572,_0x35f010){_0x1dfb5c=_0x1dfb5c===undefined?'beep':_0x1dfb5c;_0x355572=_0x355572===undefined?'5':_0x355572;_0x35f010=_0x35f010===undefined?'1':_0x35f010;return this[_0x7782('0x24')](util['format'](_0x7782('0x27'),_0x1dfb5c,_0x355572*0x3e8,_0x35f010));};AGIChannel['prototype'][_0x7782('0x28')]=function(_0x41a306){_0x41a306=_0x41a306||'NO\x20MESSAGE';return this[_0x7782('0x24')](util['format'](_0x7782('0x29'),_0x41a306));};AGIChannel['prototype'][_0x7782('0x2a')]=function(_0x6080c4,_0x5be461){if(_[_0x7782('0x2b')](_0x5be461)){return this[_0x7782('0x24')](util[_0x7782('0x2c')](_0x7782('0x2d'),_0x6080c4,_0x5be461[_0x7782('0x2e')](',')));}return this[_0x7782('0x24')](util['format'](_0x7782('0x2d'),_0x6080c4,_0x5be461));};AGIChannel[_0x7782('0x23')]['setContext']=function(_0x48f696){return this[_0x7782('0x24')](util[_0x7782('0x2c')](_0x7782('0x2f'),_0x48f696));};AGIChannel[_0x7782('0x23')][_0x7782('0x30')]=function(_0x22fd24){return this[_0x7782('0x24')](util[_0x7782('0x2c')]('SET\x20EXTENSION\x20%s',_0x22fd24));};AGIChannel[_0x7782('0x23')]['setPriority']=function(_0x468bd4){return this[_0x7782('0x24')](util[_0x7782('0x2c')](_0x7782('0x31'),_0x468bd4));};AGIChannel[_0x7782('0x23')]['hangup']=function(){return this['sendRequest'](_0x7782('0x32'));};AGIChannel[_0x7782('0x23')][_0x7782('0x33')]=function(_0x3a9a4f,_0x4cc0a4){var _0x279851=_['isBoolean'](_0x4cc0a4)||_[_0x7782('0x34')](_0x4cc0a4)?_0x4cc0a4[_0x7782('0x35')]():_0x4cc0a4;return this[_0x7782('0x24')](util[_0x7782('0x2c')](_0x7782('0x36'),_0x3a9a4f,_0x279851?_0x279851[_0x7782('0x35')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7782('0x23')]['sayNumber']=function(_0x42ab6c,_0x403060){return this[_0x7782('0x24')](util[_0x7782('0x2c')](_0x7782('0x37'),_0x42ab6c,_0x403060));};AGIChannel[_0x7782('0x23')][_0x7782('0x38')]=function(_0x58f9ff,_0x3395f1){return this[_0x7782('0x24')](util[_0x7782('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x58f9ff,_0x3395f1));};AGIChannel[_0x7782('0x23')][_0x7782('0x39')]=function(_0x3f44d6,_0x488c82){return this['sendRequest'](util[_0x7782('0x2c')](_0x7782('0x3a'),_0x3f44d6,_0x488c82));};AGIChannel[_0x7782('0x23')][_0x7782('0x3b')]=function(_0x22064a,_0x5f5cfb,_0x3eb07b){_0x5f5cfb=_0x5f5cfb||this['extension'];_0x3eb07b=_0x3eb07b||0x1;this[_0x7782('0x3c')](_0x22064a);this[_0x7782('0x30')](_0x5f5cfb);this[_0x7782('0x3d')](_0x3eb07b);return this[_0x7782('0x28')](util[_0x7782('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x22064a,_0x5f5cfb,_0x3eb07b));};AGIChannel[_0x7782('0x23')][_0x7782('0x3e')]=function(_0x26f4ed){return this[_0x7782('0x24')](util[_0x7782('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x26f4ed));};AGIChannel[_0x7782('0x23')]['recordFile']=function(_0x26544a,_0x19fee2,_0x408f75,_0x56a212,_0x53c332,_0x2f09ac){_0x19fee2=_0x19fee2||_0x7782('0x3f');_0x408f75=_0x408f75||'';_0x56a212=_0x56a212===undefined?-0x1:_0x56a212==='-1'?-0x1:_0x56a212*0x3e8;_0x53c332=_0x53c332===undefined?'':'s='+_0x53c332;_0x2f09ac=_0x2f09ac?_0x7782('0x40'):'';return this[_0x7782('0x24')](util[_0x7782('0x2c')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x26544a,_0x19fee2,_0x408f75,_0x56a212,_0x2f09ac,_0x53c332));};AGIChannel[_0x7782('0x23')]['streamFile']=function(_0x19b6d9,_0x2b90f3){_0x2b90f3=_0x2b90f3||'';return this[_0x7782('0x24')](util[_0x7782('0x2c')](_0x7782('0x41'),_0x19b6d9,_0x2b90f3));};AGIChannel['prototype'][_0x7782('0x42')]=function(_0x10e18d){return this[_0x7782('0x2a')](_0x7782('0x43'),_0x10e18d);};AGIChannel[_0x7782('0x23')][_0x7782('0x44')]=function(_0x3eff15){return this[_0x7782('0x2a')](_0x7782('0x45'),_0x3eff15);};AGIChannel[_0x7782('0x23')][_0x7782('0x19')]=function(_0x352b2e,_0x3bdda2){this['noop'](util['format'](_0x7782('0x46'),_0x352b2e['id'],_0x352b2e['label'],_0x3bdda2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7782('0x47')]=AGIChannel;
\ No newline at end of file
+var _0x1602=['EventEmitter','./reply','./error','utf8','setTimeout','setEncoding','headers','ready','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','substr','indexOf','startsWith','split','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','answer','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x1602,0x135));var _0x2160=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1602[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x2160('0x0'));var _=require(_0x2160('0x1'));var EventEmitter=require(_0x2160('0x2'))[_0x2160('0x3')];var AGIReply=require(_0x2160('0x4'));var AGIError=require(_0x2160('0x5'));function AGIChannel(_0x3e8967){var _0x1f0c80=this,_0x171147=new AGIReply(),_0x1020ef=![],_0x5f50e9={};EventEmitter['call'](_0x1f0c80);_0x3e8967['setEncoding'](_0x2160('0x6'));_0x3e8967[_0x2160('0x7')](0x8*0x3c*0x3c*0x3e8);_0x171147[_0x2160('0x8')]('utf8');_0x171147['on'](_0x2160('0x9'),function(_0x308c7d){for(var _0x3ba3c3 in _0x308c7d){_0x1f0c80[_0x3ba3c3]=_0x308c7d[_0x3ba3c3];}_0x1f0c80['emit'](_0x2160('0xa'));});_0x171147['on']('line',function(_0x31a22c){if(_0x31a22c['toLowerCase']()==_0x2160('0xb')){_0x1f0c80['emit']('hangup');return;}if(_0x31a22c[_0x2160('0xc')](0x0,0xb)==_0x2160('0xd')){_0x1020ef=!![];}if(_0x1020ef){_0x5f50e9['rx']+=_0x31a22c+'\x0a';if(_0x31a22c[_0x2160('0xe')](_0x2160('0xf'))!=-0x1){_0x1020ef=![];}}else{_0x5f50e9['rx']=_0x31a22c;}if(_0x1020ef){return;}if(typeof _0x5f50e9['cb']==_0x2160('0x10')){var _0x26ac20=_0x5f50e9['rx'][_0x2160('0xc')](0x0,0x3),_0x35de77=null,_0x23a5ec=null;_0x26ac20=parseInt(_0x26ac20);if(isNaN(_0x26ac20)){_0x5f50e9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2160('0x11')});return;}if(_0x26ac20!=0xc8){_0x5f50e9['cb'](null,{'code':_0x26ac20,'result':-0x1,'extra':'KO'});return;}_0x35de77=_0x5f50e9['rx'][_0x2160('0xc')](0x4)[_0x2160('0x12')]('result=','');if(_0x35de77['indexOf']('\x20')!=-0x1){_0x35de77=_0x35de77[_0x2160('0x13')](0x0,_0x35de77[_0x2160('0x14')]('\x20'));}if(_[_0x2160('0x15')](_0x35de77,'-1')){_0x35de77=parseInt(_0x35de77);}_0x23a5ec=_0x5f50e9['rx'][_0x2160('0x16')]('\x20');if(_0x23a5ec[_0x2160('0x17')]==0x3){_0x23a5ec=_0x23a5ec[0x2]['substring'](0x1,_0x23a5ec[0x2][_0x2160('0x17')]-0x1);}else if(_0x23a5ec[_0x2160('0x17')]>0x3){var _0x10b771=/\((.+)\)/;var _0x59d29f=_0x5f50e9['rx'][_0x2160('0x18')](_0x10b771);if(_0x59d29f){_0x23a5ec=_0x59d29f[0x1];}else{_0x23a5ec=null;}}else{_0x23a5ec=null;}_0x5f50e9['cb'](null,{'code':_0x26ac20,'result':_0x35de77,'extra':_0x23a5ec});}});_0x3e8967['on'](_0x2160('0x19'),function(_0x429529){_0x1f0c80[_0x2160('0x1a')](_0x2160('0x19'),new AGIError(_0x2160('0x1b'),_0x429529[_0x2160('0x1c')]));});_0x3e8967['on'](_0x2160('0x1d'),function(){_0x1f0c80[_0x2160('0x1a')](_0x2160('0x1d'),new AGIError(_0x2160('0x1e')));});_0x3e8967['on']('timeout',function(){_0x1f0c80[_0x2160('0x1a')](_0x2160('0x1f'),new AGIError(_0x2160('0x20')));_0x3e8967[_0x2160('0x21')]();});_0x3e8967[_0x2160('0x22')](_0x171147);this[_0x2160('0x23')]=function(_0x52b3e7,_0x5a67ac){var _0x52b3e7=_0x52b3e7||'',_0x5a67ac=typeof _0x5a67ac==_0x2160('0x10')?_0x5a67ac:new Function();_0x5f50e9={'tx':_0x52b3e7,'rx':'','cb':_0x5a67ac};_0x3e8967['write'](_0x52b3e7+'\x0a');},this[_0x2160('0x1d')]=function(){_0x3e8967[_0x2160('0x21')]();};}util[_0x2160('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x2160('0x25')][_0x2160('0x26')]=function(_0x2342bb){return this['command'][_0x2160('0x27')](this,_0x2342bb);};AGIChannel[_0x2160('0x25')][_0x2160('0x28')]=function(){return this[_0x2160('0x26')]('ANSWER');};AGIChannel['prototype'][_0x2160('0x29')]=function(_0x501eb9,_0x4e8bfb,_0x2891f1){_0x501eb9=_0x501eb9===undefined?_0x2160('0x2a'):_0x501eb9;_0x4e8bfb=_0x4e8bfb===undefined?'5':_0x4e8bfb;_0x2891f1=_0x2891f1===undefined?'1':_0x2891f1;return this['sendRequest'](util['format'](_0x2160('0x2b'),_0x501eb9,_0x4e8bfb*0x3e8,_0x2891f1));};AGIChannel['prototype'][_0x2160('0x2c')]=function(_0x396539){_0x396539=_0x396539||'NO\x20MESSAGE';return this[_0x2160('0x26')](util[_0x2160('0x2d')]('VERBOSE\x20\x22%s\x22',_0x396539));};AGIChannel[_0x2160('0x25')][_0x2160('0x2e')]=function(_0x541950,_0x3f17fa){if(_[_0x2160('0x2f')](_0x3f17fa)){return this[_0x2160('0x26')](util[_0x2160('0x2d')](_0x2160('0x30'),_0x541950,_0x3f17fa['join'](',')));}return this[_0x2160('0x26')](util['format'](_0x2160('0x30'),_0x541950,_0x3f17fa));};AGIChannel[_0x2160('0x25')][_0x2160('0x31')]=function(_0x351615){return this[_0x2160('0x26')](util[_0x2160('0x2d')](_0x2160('0x32'),_0x351615));};AGIChannel[_0x2160('0x25')]['setExtension']=function(_0x5280b0){return this['sendRequest'](util['format'](_0x2160('0x33'),_0x5280b0));};AGIChannel[_0x2160('0x25')][_0x2160('0x34')]=function(_0x4f4417){return this['sendRequest'](util[_0x2160('0x2d')]('SET\x20PRIORITY\x20%s',_0x4f4417));};AGIChannel['prototype'][_0x2160('0xb')]=function(){return this[_0x2160('0x26')](_0x2160('0x35'));};AGIChannel[_0x2160('0x25')][_0x2160('0x36')]=function(_0x29220a,_0xe9b1c){var _0x6dae55=_[_0x2160('0x37')](_0xe9b1c)||_[_0x2160('0x38')](_0xe9b1c)?_0xe9b1c[_0x2160('0x39')]():_0xe9b1c;return this['sendRequest'](util[_0x2160('0x2d')](_0x2160('0x3a'),_0x29220a,_0x6dae55?_0x6dae55[_0x2160('0x39')]()[_0x2160('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2160('0x25')]['sayNumber']=function(_0x55063d,_0x58bb13){return this['sendRequest'](util[_0x2160('0x2d')](_0x2160('0x3b'),_0x55063d,_0x58bb13));};AGIChannel[_0x2160('0x25')][_0x2160('0x3c')]=function(_0x356b7b,_0xb4245e){return this[_0x2160('0x26')](util[_0x2160('0x2d')](_0x2160('0x3d'),_0x356b7b,_0xb4245e));};AGIChannel[_0x2160('0x25')][_0x2160('0x3e')]=function(_0x3a18cd,_0x30d465){return this['sendRequest'](util[_0x2160('0x2d')](_0x2160('0x3f'),_0x3a18cd,_0x30d465));};AGIChannel[_0x2160('0x25')][_0x2160('0x40')]=function(_0x557684,_0x31c2fb,_0x91c173){_0x31c2fb=_0x31c2fb||this[_0x2160('0x41')];_0x91c173=_0x91c173||0x1;this[_0x2160('0x31')](_0x557684);this[_0x2160('0x42')](_0x31c2fb);this['setPriority'](_0x91c173);return this[_0x2160('0x2c')](util[_0x2160('0x2d')](_0x2160('0x43'),_0x557684,_0x31c2fb,_0x91c173));};AGIChannel[_0x2160('0x25')]['getVariable']=function(_0x53fb8c){return this['sendRequest'](util[_0x2160('0x2d')]('GET\x20VARIABLE\x20\x22%s\x22',_0x53fb8c));};AGIChannel[_0x2160('0x25')][_0x2160('0x44')]=function(_0x3e4ff1,_0x1e4e0f,_0x99c31b,_0x3a35cb,_0x30667c,_0x264b7d){_0x1e4e0f=_0x1e4e0f||_0x2160('0x45');_0x99c31b=_0x99c31b||'';_0x3a35cb=_0x3a35cb===undefined?-0x1:_0x3a35cb==='-1'?-0x1:_0x3a35cb*0x3e8;_0x30667c=_0x30667c===undefined?'':'s='+_0x30667c;_0x264b7d=_0x264b7d?_0x2160('0x46'):'';return this[_0x2160('0x26')](util[_0x2160('0x2d')](_0x2160('0x47'),_0x3e4ff1,_0x1e4e0f,_0x99c31b,_0x3a35cb,_0x264b7d,_0x30667c));};AGIChannel[_0x2160('0x25')][_0x2160('0x48')]=function(_0x577dfe,_0x20522a){_0x20522a=_0x20522a||'';return this['sendRequest'](util[_0x2160('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x577dfe,_0x20522a));};AGIChannel[_0x2160('0x25')][_0x2160('0x49')]=function(_0x1341f7){return this['exec']('AGI',_0x1341f7);};AGIChannel[_0x2160('0x25')][_0x2160('0x4a')]=function(_0x56d703){return this[_0x2160('0x2e')]('WAIT',_0x56d703);};AGIChannel[_0x2160('0x25')]['error']=function(_0x4220ce,_0x587fd6){this[_0x2160('0x2c')](util[_0x2160('0x2d')](_0x2160('0x4b'),_0x4220ce['id'],_0x4220ce[_0x2160('0x4c')],_0x587fd6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2160('0x4d')]=AGIChannel;
\ No newline at end of file
index 5932764..c3d460b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8694=['message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x276c5e,_0x3697e4){var _0x25f46e=function(_0x107801){while(--_0x107801){_0x276c5e['push'](_0x276c5e['shift']());}};_0x25f46e(++_0x3697e4);}(_0x8694,0xa5));var _0x4869=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x8694[_0x30b0d8];return _0x459c09;};'use strict';var util=require(_0x4869('0x0'));var error={'E_AGI_UNDEFINED':_0x4869('0x1'),'E_AGI_ARGUMENT_PORT':_0x4869('0x2'),'E_AGI_SERVER_ERROR':_0x4869('0x3'),'E_AGI_SERVER_CLOSE':_0x4869('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x4869('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x4869('0x6'),'E_AGI_SOCKET_CLOSE':_0x4869('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x4869('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4869('0x9'),'E_AGI_IVR_ENTRY':_0x4869('0xa')};function AGIError(_0x3600b3){var _0x3600b3=_0x3600b3||null,_0x41d50a=_0x41d50a||[],_0x115ffe=0x1,_0x4b5f86='';if(!error[_0x3600b3]){_0x3600b3=_0x4869('0xb');}_0x41d50a[_0x4869('0xc')](error[_0x3600b3]);while(arguments[_0x115ffe]){_0x41d50a[_0x4869('0xc')](arguments[_0x115ffe]);_0x115ffe++;}_0x4b5f86=util[_0x4869('0xd')][_0x4869('0xe')](util,_0x41d50a);this[_0x4869('0xf')]=_0x4b5f86;this[_0x4869('0x10')]=_0x3600b3;}module[_0x4869('0x11')]=AGIError;
\ No newline at end of file
+var _0x68ef=['push','format','apply','message','name','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x10a9c6,_0x3ad310){var _0x2a430d=function(_0x55d735){while(--_0x55d735){_0x10a9c6['push'](_0x10a9c6['shift']());}};_0x2a430d(++_0x3ad310);}(_0x68ef,0x171));var _0xf68e=function(_0x465d4a,_0x269018){_0x465d4a=_0x465d4a-0x0;var _0x3155c8=_0x68ef[_0x465d4a];return _0x3155c8;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xf68e('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xf68e('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xf68e('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xf68e('0x3'),'E_AGI_SOCKET_ERROR':_0xf68e('0x4'),'E_AGI_SOCKET_CLOSE':_0xf68e('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xf68e('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf68e('0x7'),'E_AGI_IVR_ENTRY':_0xf68e('0x8')};function AGIError(_0x36c3d7){var _0x36c3d7=_0x36c3d7||null,_0x3cb963=_0x3cb963||[],_0x2f1e8a=0x1,_0xe0e3c6='';if(!error[_0x36c3d7]){_0x36c3d7='E_AGI_UNDEFINED';}_0x3cb963[_0xf68e('0x9')](error[_0x36c3d7]);while(arguments[_0x2f1e8a]){_0x3cb963['push'](arguments[_0x2f1e8a]);_0x2f1e8a++;}_0xe0e3c6=util[_0xf68e('0xa')][_0xf68e('0xb')](util,_0x3cb963);this[_0xf68e('0xc')]=_0xe0e3c6;this[_0xf68e('0xd')]=_0x36c3d7;}module['exports']=AGIError;
\ No newline at end of file
index fe2d17e..180a4c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5249=['vertices','addEdge','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','edges','prototype','addVertex'];(function(_0x4494bd,_0x5d4c66){var _0x49ede9=function(_0x360670){while(--_0x360670){_0x4494bd['push'](_0x4494bd['shift']());}};_0x49ede9(++_0x5d4c66);}(_0x5249,0xb2));var _0x9524=function(_0xc15ff7,_0x35381a){_0xc15ff7=_0xc15ff7-0x0;var _0x5330de=_0x5249[_0xc15ff7];return _0x5330de;};'use strict';var _=require(_0x9524('0x0'));var logger=require(_0x9524('0x1'))('agi');var verticesWithRetry=[_0x9524('0x2'),_0x9524('0x3'),_0x9524('0x4')];var Graph=function(){this['vertices']={};this[_0x9524('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x9524('0x6')][_0x9524('0x7')]=function(_0x30641f){this[_0x9524('0x8')][_0x30641f['id']]=_0x30641f;this[_0x9524('0x5')][_0x30641f['id']]=[];};Graph[_0x9524('0x6')][_0x9524('0x9')]=function(_0x583f6c,_0x2a9c9f,_0x4269e8){this[_0x9524('0x5')][_0x583f6c][_0x9524('0xa')]({'target':_0x2a9c9f,'condition':_0x4269e8});this['numberOfEdges']+=0x1;};Graph['prototype'][_0x9524('0xb')]=function(){return _[_0x9524('0xb')](this[_0x9524('0x8')]);};Graph[_0x9524('0x6')]['relations']=function(){return this['numberOfEdges'];};Graph[_0x9524('0x6')][_0x9524('0xc')]=function(_0x490113){return this['vertices'][_0x490113];};Graph[_0x9524('0x6')][_0x9524('0xd')]=function(_0x5f5284,_0x2b2f65){if(!this[_0x9524('0x8')][_0x5f5284]){return logger[_0x9524('0xe')](_0x9524('0xf'));}var _0x523bec=_0x2b2f65(this['vertices'][_0x5f5284]);if(!_0x523bec){return logger[_0x9524('0xe')](_0x9524('0x10'));}if(this[_0x9524('0x5')][_0x5f5284][_0x9524('0x11')]===0x0){return logger['info'](_0x9524('0x12'));}for(var _0x1749d0=0x0,_0x37832e=[],_0x526895=![];_0x1749d0<this[_0x9524('0x5')][_0x5f5284][_0x9524('0x11')];_0x1749d0+=0x1){if(this['edges'][_0x5f5284][_0x1749d0][_0x9524('0x13')]){_0x37832e=this[_0x9524('0x5')][_0x5f5284][_0x1749d0][_0x9524('0x13')][_0x9524('0x14')](',');for(var _0x5a87b0=0x0;_0x5a87b0<_0x37832e[_0x9524('0x11')];_0x5a87b0+=0x1){if(this[_0x9524('0x8')][_0x5f5284][_0x9524('0x15')]==='vswitch'&&_0x37832e[_0x5a87b0]==='-'){_0x526895=this[_0x9524('0x5')][_0x5f5284][_0x1749d0][_0x9524('0x16')];logger[_0x9524('0xe')](_0x9524('0x17'),_0x37832e[_0x5a87b0],this[_0x9524('0x5')][_0x5f5284][_0x1749d0]['target']);}else if(this[_0x9524('0x8')][_0x5f5284][_0x9524('0x15')]===_0x9524('0x2')&&_0x37832e[_0x5a87b0]==='i'){_0x526895=this[_0x9524('0x5')][_0x5f5284][_0x1749d0][_0x9524('0x16')];logger[_0x9524('0xe')](_0x9524('0x18'),_0x37832e[_0x5a87b0],this['edges'][_0x5f5284][_0x1749d0]['target']);}if(_0x37832e[_0x5a87b0]===_0x523bec){return this[_0x9524('0xd')](this[_0x9524('0x5')][_0x5f5284][_0x1749d0][_0x9524('0x16')],_0x2b2f65);}}}else{return this[_0x9524('0xd')](this['edges'][_0x5f5284][_0x1749d0][_0x9524('0x16')],_0x2b2f65);}}if(_0x37832e[_0x9524('0x11')]){if(this[_0x9524('0x8')][_0x5f5284][_0x9524('0x15')]===_0x9524('0x19')){if(_0x526895){return this[_0x9524('0xd')](_0x526895,_0x2b2f65);}return logger['info'](_0x9524('0x1a'));}else if(_[_0x9524('0x1b')](verticesWithRetry,this[_0x9524('0x8')][_0x5f5284][_0x9524('0x15')])){if(_0x523bec==='-'){return logger[_0x9524('0xe')](_0x9524('0x1c'));}if(_0x526895&&_0x523bec!=='t'){return this['traverseBFS'](_0x526895,_0x2b2f65);}return this['traverseBFS'](_0x5f5284,_0x2b2f65);}return logger[_0x9524('0xe')](_0x9524('0x1d'));}};module[_0x9524('0x1e')]=Graph;
\ No newline at end of file
+var _0xa6a3=['default','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','menu','vertices','numberOfEdges','prototype','edges','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','length','info','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target'];(function(_0x399491,_0x35bae6){var _0x28911c=function(_0x203a3a){while(--_0x203a3a){_0x399491['push'](_0x399491['shift']());}};_0x28911c(++_0x35bae6);}(_0xa6a3,0xca));var _0x3a6a=function(_0x4f0a3a,_0x14f8d9){_0x4f0a3a=_0x4f0a3a-0x0;var _0x430cca=_0xa6a3[_0x4f0a3a];return _0x430cca;};'use strict';var _=require('lodash');var logger=require(_0x3a6a('0x0'))('agi');var verticesWithRetry=[_0x3a6a('0x1'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x3a6a('0x2')]={};this['edges']={};this[_0x3a6a('0x3')]=0x0;};Graph[_0x3a6a('0x4')]['addVertex']=function(_0x3c47ac){this['vertices'][_0x3c47ac['id']]=_0x3c47ac;this[_0x3a6a('0x5')][_0x3c47ac['id']]=[];};Graph[_0x3a6a('0x4')][_0x3a6a('0x6')]=function(_0x3b9854,_0x5e589b,_0x19553b){this[_0x3a6a('0x5')][_0x3b9854][_0x3a6a('0x7')]({'target':_0x5e589b,'condition':_0x19553b});this['numberOfEdges']+=0x1;};Graph[_0x3a6a('0x4')][_0x3a6a('0x8')]=function(){return _[_0x3a6a('0x8')](this['vertices']);};Graph['prototype'][_0x3a6a('0x9')]=function(){return this[_0x3a6a('0x3')];};Graph['prototype'][_0x3a6a('0xa')]=function(_0x4ba092){return this[_0x3a6a('0x2')][_0x4ba092];};Graph[_0x3a6a('0x4')][_0x3a6a('0xb')]=function(_0x33ce3e,_0x56dd6b){if(!this['vertices'][_0x33ce3e]){return logger['info'](_0x3a6a('0xc'));}var _0x45b2ce=_0x56dd6b(this[_0x3a6a('0x2')][_0x33ce3e]);if(!_0x45b2ce){return logger['info'](_0x3a6a('0xd'));}if(this[_0x3a6a('0x5')][_0x33ce3e][_0x3a6a('0xe')]===0x0){return logger[_0x3a6a('0xf')](_0x3a6a('0x10'));}for(var _0x1a4f7c=0x0,_0x4215d3=[],_0xce7fdb=![];_0x1a4f7c<this[_0x3a6a('0x5')][_0x33ce3e][_0x3a6a('0xe')];_0x1a4f7c+=0x1){if(this['edges'][_0x33ce3e][_0x1a4f7c][_0x3a6a('0x11')]){_0x4215d3=this[_0x3a6a('0x5')][_0x33ce3e][_0x1a4f7c]['condition'][_0x3a6a('0x12')](',');for(var _0x5d4e81=0x0;_0x5d4e81<_0x4215d3[_0x3a6a('0xe')];_0x5d4e81+=0x1){if(this[_0x3a6a('0x2')][_0x33ce3e][_0x3a6a('0x13')]===_0x3a6a('0x14')&&_0x4215d3[_0x5d4e81]==='-'){_0xce7fdb=this['edges'][_0x33ce3e][_0x1a4f7c][_0x3a6a('0x15')];logger[_0x3a6a('0xf')](_0x3a6a('0x16'),_0x4215d3[_0x5d4e81],this['edges'][_0x33ce3e][_0x1a4f7c][_0x3a6a('0x15')]);}else if(this['vertices'][_0x33ce3e]['agicommand']===_0x3a6a('0x1')&&_0x4215d3[_0x5d4e81]==='i'){_0xce7fdb=this[_0x3a6a('0x5')][_0x33ce3e][_0x1a4f7c]['target'];logger[_0x3a6a('0xf')]('invalid',_0x4215d3[_0x5d4e81],this['edges'][_0x33ce3e][_0x1a4f7c][_0x3a6a('0x15')]);}if(_0x4215d3[_0x5d4e81]===_0x45b2ce){return this[_0x3a6a('0xb')](this['edges'][_0x33ce3e][_0x1a4f7c][_0x3a6a('0x15')],_0x56dd6b);}}}else{return this[_0x3a6a('0xb')](this['edges'][_0x33ce3e][_0x1a4f7c][_0x3a6a('0x15')],_0x56dd6b);}}if(_0x4215d3[_0x3a6a('0xe')]){if(this[_0x3a6a('0x2')][_0x33ce3e][_0x3a6a('0x13')]===_0x3a6a('0x14')){if(_0xce7fdb){return this[_0x3a6a('0xb')](_0xce7fdb,_0x56dd6b);}return logger[_0x3a6a('0xf')](_0x3a6a('0x17'));}else if(_[_0x3a6a('0x18')](verticesWithRetry,this[_0x3a6a('0x2')][_0x33ce3e][_0x3a6a('0x13')])){if(_0x45b2ce==='-'){return logger[_0x3a6a('0xf')](_0x3a6a('0x19'));}if(_0xce7fdb&&_0x45b2ce!=='t'){return this[_0x3a6a('0xb')](_0xce7fdb,_0x56dd6b);}return this[_0x3a6a('0xb')](_0x33ce3e,_0x56dd6b);}return logger[_0x3a6a('0xf')](_0x3a6a('0x1a'));}};module[_0x3a6a('0x1b')]=Graph;
\ No newline at end of file
index 1834fcf..5970aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ae2=['context','extension','priority','response','code','result','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','vertex','isUndefined','toString','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','./server','connection','xml2json','syncho','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','agi','defaults','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[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','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','then','agi_','debug','variables','stringify','close','timeout','hangup','production','start','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS'];(function(_0x2da563,_0x52eb28){var _0x518093=function(_0x3cad82){while(--_0x3cad82){_0x2da563['push'](_0x2da563['shift']());}};_0x518093(++_0x52eb28);}(_0x0ae2,0x10c));var _0x20ae=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x0ae2[_0x37ded3];return _0x51e49e;};'use strict';var parser=require(_0x20ae('0x0'));var _=require('lodash');var syncho=require(_0x20ae('0x1'));var util=require(_0x20ae('0x2'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x20ae('0x3'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x20ae('0x4'));var mailRpc=require(_0x20ae('0x5'));var Graph=require(_0x20ae('0x6'));var Vertices=require(_0x20ae('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x20ae('0x8')]=_[_0x20ae('0x9')](config[_0x20ae('0x8')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x39dd61){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x39dd61);agiHandler(_0x39dd61);}catch(_0x372307){logger[_0x20ae('0xa')](_0x372307[_0x20ae('0xb')]);}});});}function listeningHandler(){console[_0x20ae('0xc')](_0x20ae('0xd'),config[_0x20ae('0x8')][_0x20ae('0xe')]);logger[_0x20ae('0xf')](util[_0x20ae('0x10')](_0x20ae('0x11'),config[_0x20ae('0x8')]['ip'],config[_0x20ae('0x8')][_0x20ae('0xe')]));}function errorHandler(_0x36e988){if(_0x36e988&&_0x36e988[_0x20ae('0x12')]&&_0x36e988[_0x20ae('0x13')]){logger[_0x20ae('0xa')](util[_0x20ae('0x10')]('[%s]\x20%s',_0x36e988['name'],_0x36e988['message']));}else{logger[_0x20ae('0xa')](util[_0x20ae('0x10')](_0x20ae('0x14'),_0x36e988[_0x20ae('0xb')]));}}function closeHandler(){logger[_0x20ae('0xf')](util[_0x20ae('0x10')](_0x20ae('0x15'),this[_0x20ae('0x16')],this[_0x20ae('0x17')],this[_0x20ae('0x18')],this[_0x20ae('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2b51dc){logger['error'](_0x2b51dc[_0x20ae('0xb')]);}}function timeoutHandler(){logger[_0x20ae('0xf')](util[_0x20ae('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x20ae('0x18')],this[_0x20ae('0x19')],this[_0x20ae('0x1a')]));}function hangupHandler(){logger[_0x20ae('0xf')](util[_0x20ae('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x20ae('0x18')],this[_0x20ae('0x19')],this[_0x20ae('0x1a')]));this[_0x20ae('0x1b')]=!![];}function getRoot(_0x299410){return parser['toJson'](_0x299410,{'object':!![]})[_0x20ae('0x1c')][_0x20ae('0x1d')];}function addVertex(_0x3b98d4,_0x10ede6,_0x3afa86){_0x10ede6[_0x20ae('0x1e')]=_0x3afa86;if(_0x10ede6[_0x20ae('0x1f')](_0x20ae('0x20'))){_0x10ede6['maxRetry']=parseInt(_0x10ede6[_0x20ae('0x20')],0xa);}_0x3b98d4[_0x20ae('0x21')](_[_0x20ae('0x22')](_0x10ede6,_0x20ae('0x23')));}function initGraph(_0x520164,_0x16b0e1){var _0x43a103=new Graph();for(var _0x27c55f in _0x520164){if(_0x520164[_0x20ae('0x1f')](_0x27c55f)){if(_[_0x20ae('0x24')](_0x520164[_0x27c55f])){for(var _0x861660=0x0;_0x861660<_0x520164[_0x27c55f][_0x20ae('0x25')];_0x861660+=0x1){addVertex(_0x43a103,_0x520164[_0x27c55f][_0x861660],_0x27c55f);}}else{addVertex(_0x43a103,_0x520164[_0x27c55f],_0x27c55f);}}}for(var _0x389fa9=0x0;_0x389fa9<_0x16b0e1['length'];_0x389fa9+=0x1){if(_0x16b0e1[_0x389fa9][_0x20ae('0x26')]&&_0x16b0e1[_0x389fa9][_0x20ae('0x27')]){_0x43a103[_0x20ae('0x28')](_0x16b0e1[_0x389fa9][_0x20ae('0x26')],_0x16b0e1[_0x389fa9]['target'],_0x16b0e1[_0x389fa9]['value']);}}return _0x43a103;}function getSquareProject(_0xc61f73,_0x17ff72){rpc[_0x20ae('0x29')](_0xc61f73)[_0x20ae('0x2a')](function(_0xd2a7ad){_0x17ff72(null,_0xd2a7ad);})['catch'](function(_0x42bbda){_0x17ff72(null,_0x42bbda);});}function createSquareReport(_0x85fbc6,_0x7fcff7){rpc['createSquareReport'](_0x85fbc6)[_0x20ae('0x2a')](function(_0x45a5da){if(_0x7fcff7){_0x7fcff7(null,_0x45a5da);}})['catch'](function(_0x287ecd){if(_0x7fcff7){_0x7fcff7(null,_0x287ecd);}});}function setChannelVariables(_0x58a09d){for(var _0x69c5d6 in _0x58a09d){if(_0x58a09d[_0x20ae('0x1f')](_0x69c5d6)){if(_0x69c5d6['indexOf'](_0x20ae('0x2b'))===0x0){_0x58a09d[_0x69c5d6['substring'](0x4)]=_0x58a09d[_0x69c5d6];delete _0x58a09d[_0x69c5d6];}}}}function getLogFromObject(_0x1fe461){return util['inspect'](_0x1fe461,{'showHidden':![],'depth':null});}function agiHandler(_0x3bcdc0){var _0x544667,_0x4fda42,_0x4bbc9e,_0x1cb6f1,_0x462b7c;logger[_0x20ae('0x2c')](_0x20ae('0x2d'),JSON[_0x20ae('0x2e')](_0x3bcdc0,null,0x2));logger[_0x20ae('0xf')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3bcdc0[_0x20ae('0x16')],_0x3bcdc0['calleridname'],_0x3bcdc0[_0x20ae('0x18')],_0x3bcdc0['dnid'],_0x3bcdc0[_0x20ae('0x1a')]));_0x3bcdc0['on'](_0x20ae('0xa'),errorHandler);_0x3bcdc0['on'](_0x20ae('0x2f'),closeHandler);_0x3bcdc0['on'](_0x20ae('0x30'),timeoutHandler);_0x3bcdc0['evtHangup']=![];_0x3bcdc0['on'](_0x20ae('0x31'),hangupHandler);var _0x327cb6=getSquareProject['sync'](null,_0x3bcdc0[_0x20ae('0x16')]);if(_0x327cb6){if(_0x327cb6[_0x20ae('0x32')]){_0x544667=getRoot(_0x327cb6[_0x20ae('0x32')]);if(_0x544667&&_0x544667[_0x20ae('0x33')]){logger[_0x20ae('0x2c')]('root',JSON[_0x20ae('0x2e')](_0x544667,null,0x2));_0x3bcdc0['joinAt']=moment()[_0x20ae('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fda42=initGraph(_[_0x20ae('0x22')](_0x544667,_0x20ae('0x23')),_0x544667[_0x20ae('0x23')]);_0x4bbc9e=new Vertices(_0x3bcdc0,rpc,mailRpc);logger['info'](util['format'](_0x20ae('0x34'),_0x3bcdc0[_0x20ae('0x16')],_0x3bcdc0[_0x20ae('0x17')],_0x3bcdc0[_0x20ae('0x18')],_0x3bcdc0['dnid'],_0x3bcdc0[_0x20ae('0x1a')]));_0x4fda42['traverseBFS'](_0x544667[_0x20ae('0x33')]['id'],function(_0x1a80fe){try{_0x1a80fe=_0x4bbc9e[_0x20ae('0x35')](_0x1a80fe);logger[_0x20ae('0x2c')]('vertex',JSON[_0x20ae('0x2e')](_0x1a80fe,null,0x2));if(_0x1a80fe[_0x20ae('0x1e')]===_0x20ae('0x36')){logger[_0x20ae('0xf')](_0x20ae('0x37'));_0x3bcdc0[_0x20ae('0x38')]=_0x1a80fe['context']||_0x3bcdc0[_0x20ae('0x38')];_0x3bcdc0[_0x20ae('0x39')]=_0x1a80fe[_0x20ae('0x39')];_0x3bcdc0[_0x20ae('0x3a')]=_0x1a80fe[_0x20ae('0x3a')]?_0x1a80fe[_0x20ae('0x3a')]-0x1:0x1;return null;}else if(_0x1a80fe&&_0x4bbc9e[_0x1a80fe[_0x20ae('0x1e')]]){_0x462b7c=_0x4bbc9e[_0x1a80fe[_0x20ae('0x1e')]](_0x1a80fe);logger['info'](_0x20ae('0x3b'),JSON[_0x20ae('0x2e')](_0x462b7c,null,0x2));if(_0x462b7c&&_0x462b7c[_0x20ae('0x3c')]===AGI_CODE_SUCCESS&&_0x462b7c[_0x20ae('0x3d')]!==AGI_RESULT_ERROR&&!_0x3bcdc0['evtHangup']){logger['debug']('response',getLogFromObject(_0x462b7c));return _['isUndefined'](_0x462b7c[_0x20ae('0x3d')])?null:_0x462b7c[_0x20ae('0x3d')]['toString']();}else{logger['error'](_0x20ae('0x3b'),getLogFromObject(_0x462b7c));return null;}}else{logger[_0x20ae('0xa')](_0x20ae('0x3e'));return null;}}catch(_0x4250cd){logger[_0x20ae('0xa')](_0x4250cd[_0x20ae('0xb')]);return null;}});if(_0x544667['finally']){logger[_0x20ae('0xf')](util[_0x20ae('0x10')](_0x20ae('0x3f'),_0x3bcdc0[_0x20ae('0x16')],_0x3bcdc0[_0x20ae('0x17')],_0x3bcdc0['callerid'],_0x3bcdc0[_0x20ae('0x19')],_0x3bcdc0[_0x20ae('0x1a')]));_0x4fda42[_0x20ae('0x40')](_0x544667[_0x20ae('0x41')]['id'],function(_0x40866d){try{_0x40866d=_0x4bbc9e[_0x20ae('0x35')](_0x40866d);logger['debug'](_0x20ae('0x42'),JSON[_0x20ae('0x2e')](_0x40866d,null,0x2));if(_0x40866d&&_0x4bbc9e[_0x40866d[_0x20ae('0x1e')]]){_0x462b7c=_0x4bbc9e[_0x40866d['agicommand']](_0x40866d);if(_0x462b7c){logger[_0x20ae('0x2c')]('response',getLogFromObject(_0x462b7c));return _[_0x20ae('0x43')](_0x462b7c[_0x20ae('0x3d')])?null:_0x462b7c[_0x20ae('0x3d')][_0x20ae('0x44')]();}else{logger[_0x20ae('0xa')](_0x20ae('0x3b'),getLogFromObject(_0x462b7c));return null;}}else{logger['error'](_0x20ae('0x3e'));return null;}}catch(_0x38db1f){logger[_0x20ae('0xa')](_0x38db1f[_0x20ae('0xb')]);return null;}});}logger[_0x20ae('0xf')](util[_0x20ae('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3bcdc0[_0x20ae('0x16')],_0x3bcdc0[_0x20ae('0x17')],_0x3bcdc0[_0x20ae('0x18')],_0x3bcdc0['dnid'],_0x3bcdc0[_0x20ae('0x1a')]));logger[_0x20ae('0xf')](util[_0x20ae('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3bcdc0[_0x20ae('0x38')],_0x3bcdc0[_0x20ae('0x39')],parseInt(_0x3bcdc0[_0x20ae('0x3a')],0xa)+0x1));_0x3bcdc0[_0x20ae('0x45')](_0x3bcdc0[_0x20ae('0x38')],_0x3bcdc0[_0x20ae('0x39')],parseInt(_0x3bcdc0[_0x20ae('0x3a')],0xa)+0x1);_0x3bcdc0[_0x20ae('0x2f')]();}}else{logger[_0x20ae('0xa')](util['format']('Project\x20%s\x20not\x20published',_0x3bcdc0[_0x20ae('0x16')]));_0x3bcdc0[_0x20ae('0x45')](_0x3bcdc0[_0x20ae('0x38')],_0x3bcdc0['extension'],parseInt(_0x3bcdc0[_0x20ae('0x3a')],0xa)+0x1);_0x3bcdc0['close']();}}else{logger['error'](util[_0x20ae('0x10')](_0x20ae('0x46'),_0x3bcdc0[_0x20ae('0x16')]));_0x3bcdc0[_0x20ae('0x45')](_0x3bcdc0['context'],_0x3bcdc0[_0x20ae('0x39')],parseInt(_0x3bcdc0[_0x20ae('0x3a')],0xa)+0x1);_0x3bcdc0[_0x20ae('0x2f')]();}}function main(){var _0x33e1f1;return utilLicense[_0x20ae('0x47')]()['then'](function(_0x182016){if(_0x182016){if(_0x182016[_0x20ae('0x48')]){if(_0x182016['callysquare']&&_0x182016[_0x20ae('0x49')]>0x0){logger[_0x20ae('0xf')](util[_0x20ae('0x10')](_0x20ae('0x4a'),_0x182016[_0x20ae('0x49')]));_0x33e1f1=_0x182016[_0x20ae('0x49')];}else{logger[_0x20ae('0xf')](_0x20ae('0x4b'));}}else{logger[_0x20ae('0xf')](_0x20ae('0x4c'));_0x33e1f1=-0x1;}}})[_0x20ae('0x4d')](function(_0x2d57d6){logger[_0x20ae('0xa')](_0x20ae('0x4e'),_0x2d57d6[_0x20ae('0xb')]);})[_0x20ae('0x41')](function(){var _0x3a464b=require(_0x20ae('0x4f'))(config[_0x20ae('0x8')]['port'],config['agi']['ip'],_0x33e1f1);_0x3a464b['on'](_0x20ae('0xa'),errorHandler);_0x3a464b['on']('listening',listeningHandler);_0x3a464b['on'](_0x20ae('0x50'),connectionHandler);_0x3a464b['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0xf4a9=['priority','response','code','result','evtHangup','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','clear','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','listening','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','arg_1','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','target','addEdge','source','value','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','inspect','variables','stringify','close','timeout','sync','production','start','debug','YYYY-MM-DD\x20HH:mm:ss','mxCell','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x5cb0e5,_0x2be524){var _0x280ac5=function(_0x207a58){while(--_0x207a58){_0x5cb0e5['push'](_0x5cb0e5['shift']());}};_0x280ac5(++_0x2be524);}(_0xf4a9,0x6e));var _0x9f4a=function(_0x26c643,_0x2c784a){_0x26c643=_0x26c643-0x0;var _0xb49398=_0xf4a9[_0x26c643];return _0xb49398;};'use strict';var parser=require('xml2json');var _=require(_0x9f4a('0x0'));var syncho=require(_0x9f4a('0x1'));var util=require(_0x9f4a('0x2'));var moment=require(_0x9f4a('0x3'));var config=require(_0x9f4a('0x4'));var logger=require(_0x9f4a('0x5'))(_0x9f4a('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x9f4a('0x7'));var Graph=require(_0x9f4a('0x8'));var Vertices=require(_0x9f4a('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9f4a('0x6')]=_[_0x9f4a('0xa')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x5fdb16){process[_0x9f4a('0xb')](function(){syncho(function(){try{setChannelVariables(_0x5fdb16);agiHandler(_0x5fdb16);}catch(_0x4b3930){logger[_0x9f4a('0xc')](_0x4b3930['stack']);}});});}function listeningHandler(){console[_0x9f4a('0xd')](_0x9f4a('0xe'),config[_0x9f4a('0x6')][_0x9f4a('0xf')]);logger[_0x9f4a('0x10')](util[_0x9f4a('0x11')](_0x9f4a('0x12'),config[_0x9f4a('0x6')]['ip'],config[_0x9f4a('0x6')]['port']));}function errorHandler(_0x51f8db){if(_0x51f8db&&_0x51f8db['name']&&_0x51f8db[_0x9f4a('0x13')]){logger['error'](util['format'](_0x9f4a('0x14'),_0x51f8db[_0x9f4a('0x15')],_0x51f8db[_0x9f4a('0x13')]));}else{logger[_0x9f4a('0xc')](util[_0x9f4a('0x11')](_0x9f4a('0x16'),_0x51f8db[_0x9f4a('0x17')]));}}function closeHandler(){logger[_0x9f4a('0x10')](util[_0x9f4a('0x11')](_0x9f4a('0x18'),this['arg_1'],this[_0x9f4a('0x19')],this[_0x9f4a('0x1a')],this[_0x9f4a('0x1b')],this[_0x9f4a('0x1c')]));try{createSquareReport(this);}catch(_0x214eff){logger[_0x9f4a('0xc')](_0x214eff[_0x9f4a('0x17')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x9f4a('0x1a')],this[_0x9f4a('0x1b')],this[_0x9f4a('0x1c')]));}function hangupHandler(){logger[_0x9f4a('0x10')](util[_0x9f4a('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x9f4a('0x1d')],this[_0x9f4a('0x19')],this[_0x9f4a('0x1a')],this[_0x9f4a('0x1b')],this[_0x9f4a('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x27bd1b){return parser['toJson'](_0x27bd1b,{'object':!![]})[_0x9f4a('0x1e')][_0x9f4a('0x1f')];}function addVertex(_0x2198e3,_0x16aaa1,_0x1ad0db){_0x16aaa1[_0x9f4a('0x20')]=_0x1ad0db;if(_0x16aaa1[_0x9f4a('0x21')](_0x9f4a('0x22'))){_0x16aaa1[_0x9f4a('0x23')]=parseInt(_0x16aaa1[_0x9f4a('0x22')],0xa);}_0x2198e3[_0x9f4a('0x24')](_[_0x9f4a('0x25')](_0x16aaa1,'mxCell'));}function initGraph(_0x2744b5,_0xc75d64){var _0x4d72dc=new Graph();for(var _0x2d34b9 in _0x2744b5){if(_0x2744b5['hasOwnProperty'](_0x2d34b9)){if(_[_0x9f4a('0x26')](_0x2744b5[_0x2d34b9])){for(var _0x5ae073=0x0;_0x5ae073<_0x2744b5[_0x2d34b9][_0x9f4a('0x27')];_0x5ae073+=0x1){addVertex(_0x4d72dc,_0x2744b5[_0x2d34b9][_0x5ae073],_0x2d34b9);}}else{addVertex(_0x4d72dc,_0x2744b5[_0x2d34b9],_0x2d34b9);}}}for(var _0x19fbdd=0x0;_0x19fbdd<_0xc75d64[_0x9f4a('0x27')];_0x19fbdd+=0x1){if(_0xc75d64[_0x19fbdd]['source']&&_0xc75d64[_0x19fbdd][_0x9f4a('0x28')]){_0x4d72dc[_0x9f4a('0x29')](_0xc75d64[_0x19fbdd][_0x9f4a('0x2a')],_0xc75d64[_0x19fbdd][_0x9f4a('0x28')],_0xc75d64[_0x19fbdd][_0x9f4a('0x2b')]);}}return _0x4d72dc;}function getSquareProject(_0x309022,_0x26cb0c){rpc[_0x9f4a('0x2c')](_0x309022)['then'](function(_0x5dddc8){_0x26cb0c(null,_0x5dddc8);})[_0x9f4a('0x2d')](function(_0x18aa19){_0x26cb0c(null,_0x18aa19);});}function createSquareReport(_0x5bf2d9,_0x55b6f2){rpc[_0x9f4a('0x2e')](_0x5bf2d9)[_0x9f4a('0x2f')](function(_0x5ba6f5){if(_0x55b6f2){_0x55b6f2(null,_0x5ba6f5);}})[_0x9f4a('0x2d')](function(_0x5efb99){if(_0x55b6f2){_0x55b6f2(null,_0x5efb99);}});}function setChannelVariables(_0x50b90f){for(var _0x3f2fde in _0x50b90f){if(_0x50b90f[_0x9f4a('0x21')](_0x3f2fde)){if(_0x3f2fde[_0x9f4a('0x30')](_0x9f4a('0x31'))===0x0){_0x50b90f[_0x3f2fde[_0x9f4a('0x32')](0x4)]=_0x50b90f[_0x3f2fde];delete _0x50b90f[_0x3f2fde];}}}}function getLogFromObject(_0xec2259){return util[_0x9f4a('0x33')](_0xec2259,{'showHidden':![],'depth':null});}function agiHandler(_0x181fa4){var _0x2e0386,_0x5227b2,_0x5ab25d,_0x444eee,_0x36e88d;logger['debug'](_0x9f4a('0x34'),JSON[_0x9f4a('0x35')](_0x181fa4,null,0x2));logger[_0x9f4a('0x10')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x181fa4[_0x9f4a('0x1d')],_0x181fa4[_0x9f4a('0x19')],_0x181fa4[_0x9f4a('0x1a')],_0x181fa4[_0x9f4a('0x1b')],_0x181fa4[_0x9f4a('0x1c')]));_0x181fa4['on'](_0x9f4a('0xc'),errorHandler);_0x181fa4['on'](_0x9f4a('0x36'),closeHandler);_0x181fa4['on'](_0x9f4a('0x37'),timeoutHandler);_0x181fa4['evtHangup']=![];_0x181fa4['on']('hangup',hangupHandler);var _0x65f87e=getSquareProject[_0x9f4a('0x38')](null,_0x181fa4['arg_1']);if(_0x65f87e){if(_0x65f87e[_0x9f4a('0x39')]){_0x2e0386=getRoot(_0x65f87e[_0x9f4a('0x39')]);if(_0x2e0386&&_0x2e0386[_0x9f4a('0x3a')]){logger[_0x9f4a('0x3b')](_0x9f4a('0x1f'),JSON[_0x9f4a('0x35')](_0x2e0386,null,0x2));_0x181fa4['joinAt']=moment()['format'](_0x9f4a('0x3c'));_0x5227b2=initGraph(_[_0x9f4a('0x25')](_0x2e0386,_0x9f4a('0x3d')),_0x2e0386[_0x9f4a('0x3d')]);_0x5ab25d=new Vertices(_0x181fa4,rpc,mailRpc);logger[_0x9f4a('0x10')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x181fa4[_0x9f4a('0x1d')],_0x181fa4[_0x9f4a('0x19')],_0x181fa4[_0x9f4a('0x1a')],_0x181fa4[_0x9f4a('0x1b')],_0x181fa4[_0x9f4a('0x1c')]));_0x5227b2['traverseBFS'](_0x2e0386[_0x9f4a('0x3a')]['id'],function(_0x26ed21){try{_0x26ed21=_0x5ab25d['clear'](_0x26ed21);logger['debug']('vertex',JSON[_0x9f4a('0x35')](_0x26ed21,null,0x2));if(_0x26ed21[_0x9f4a('0x20')]===_0x9f4a('0x3e')){logger[_0x9f4a('0x10')](_0x9f4a('0x3f'));_0x181fa4['context']=_0x26ed21[_0x9f4a('0x40')]||_0x181fa4['context'];_0x181fa4[_0x9f4a('0x41')]=_0x26ed21['extension'];_0x181fa4[_0x9f4a('0x42')]=_0x26ed21[_0x9f4a('0x42')]?_0x26ed21[_0x9f4a('0x42')]-0x1:0x1;return null;}else if(_0x26ed21&&_0x5ab25d[_0x26ed21[_0x9f4a('0x20')]]){_0x36e88d=_0x5ab25d[_0x26ed21['agicommand']](_0x26ed21);logger[_0x9f4a('0x10')](_0x9f4a('0x43'),JSON[_0x9f4a('0x35')](_0x36e88d,null,0x2));if(_0x36e88d&&_0x36e88d[_0x9f4a('0x44')]===AGI_CODE_SUCCESS&&_0x36e88d[_0x9f4a('0x45')]!==AGI_RESULT_ERROR&&!_0x181fa4[_0x9f4a('0x46')]){logger[_0x9f4a('0x3b')](_0x9f4a('0x43'),getLogFromObject(_0x36e88d));return _[_0x9f4a('0x47')](_0x36e88d[_0x9f4a('0x45')])?null:_0x36e88d[_0x9f4a('0x45')][_0x9f4a('0x48')]();}else{logger[_0x9f4a('0xc')](_0x9f4a('0x43'),getLogFromObject(_0x36e88d));return null;}}else{logger[_0x9f4a('0xc')](_0x9f4a('0x49'));return null;}}catch(_0x24ae9f){logger[_0x9f4a('0xc')](_0x24ae9f[_0x9f4a('0x17')]);return null;}});if(_0x2e0386['finally']){logger[_0x9f4a('0x10')](util[_0x9f4a('0x11')](_0x9f4a('0x4a'),_0x181fa4[_0x9f4a('0x1d')],_0x181fa4[_0x9f4a('0x19')],_0x181fa4[_0x9f4a('0x1a')],_0x181fa4[_0x9f4a('0x1b')],_0x181fa4[_0x9f4a('0x1c')]));_0x5227b2[_0x9f4a('0x4b')](_0x2e0386[_0x9f4a('0x4c')]['id'],function(_0x32305b){try{_0x32305b=_0x5ab25d[_0x9f4a('0x4d')](_0x32305b);logger[_0x9f4a('0x3b')](_0x9f4a('0x4e'),JSON[_0x9f4a('0x35')](_0x32305b,null,0x2));if(_0x32305b&&_0x5ab25d[_0x32305b[_0x9f4a('0x20')]]){_0x36e88d=_0x5ab25d[_0x32305b['agicommand']](_0x32305b);if(_0x36e88d){logger[_0x9f4a('0x3b')]('response',getLogFromObject(_0x36e88d));return _[_0x9f4a('0x47')](_0x36e88d['result'])?null:_0x36e88d['result']['toString']();}else{logger[_0x9f4a('0xc')](_0x9f4a('0x43'),getLogFromObject(_0x36e88d));return null;}}else{logger[_0x9f4a('0xc')](_0x9f4a('0x49'));return null;}}catch(_0x443a80){logger[_0x9f4a('0xc')](_0x443a80[_0x9f4a('0x17')]);return null;}});}logger['info'](util[_0x9f4a('0x11')](_0x9f4a('0x4f'),_0x181fa4[_0x9f4a('0x1d')],_0x181fa4[_0x9f4a('0x19')],_0x181fa4[_0x9f4a('0x1a')],_0x181fa4[_0x9f4a('0x1b')],_0x181fa4[_0x9f4a('0x1c')]));logger[_0x9f4a('0x10')](util[_0x9f4a('0x11')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x181fa4[_0x9f4a('0x40')],_0x181fa4[_0x9f4a('0x41')],parseInt(_0x181fa4['priority'],0xa)+0x1));_0x181fa4[_0x9f4a('0x50')](_0x181fa4[_0x9f4a('0x40')],_0x181fa4[_0x9f4a('0x41')],parseInt(_0x181fa4[_0x9f4a('0x42')],0xa)+0x1);_0x181fa4[_0x9f4a('0x36')]();}}else{logger[_0x9f4a('0xc')](util[_0x9f4a('0x11')]('Project\x20%s\x20not\x20published',_0x181fa4[_0x9f4a('0x1d')]));_0x181fa4[_0x9f4a('0x50')](_0x181fa4['context'],_0x181fa4['extension'],parseInt(_0x181fa4[_0x9f4a('0x42')],0xa)+0x1);_0x181fa4[_0x9f4a('0x36')]();}}else{logger['error'](util['format'](_0x9f4a('0x51'),_0x181fa4[_0x9f4a('0x1d')]));_0x181fa4[_0x9f4a('0x50')](_0x181fa4[_0x9f4a('0x40')],_0x181fa4['extension'],parseInt(_0x181fa4[_0x9f4a('0x42')],0xa)+0x1);_0x181fa4[_0x9f4a('0x36')]();}}function main(){var _0x128d00;return utilLicense[_0x9f4a('0x52')]()['then'](function(_0x297ff3){if(_0x297ff3){if(_0x297ff3[_0x9f4a('0x53')]){if(_0x297ff3[_0x9f4a('0x54')]&&_0x297ff3[_0x9f4a('0x54')]>0x0){logger[_0x9f4a('0x10')](util[_0x9f4a('0x11')](_0x9f4a('0x55'),_0x297ff3[_0x9f4a('0x54')]));_0x128d00=_0x297ff3[_0x9f4a('0x54')];}else{logger[_0x9f4a('0x10')](_0x9f4a('0x56'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x128d00=-0x1;}}})[_0x9f4a('0x2d')](function(_0x5f3344){logger[_0x9f4a('0xc')]('[LICENSE]',_0x5f3344[_0x9f4a('0x17')]);})[_0x9f4a('0x4c')](function(){var _0x6f4536=require('./server')(config['agi'][_0x9f4a('0xf')],config[_0x9f4a('0x6')]['ip'],_0x128d00);_0x6f4536['on']('error',errorHandler);_0x6f4536['on'](_0x9f4a('0x57'),listeningHandler);_0x6f4536['on']('connection',connectionHandler);_0x6f4536['on'](_0x9f4a('0x36'),closeHandler);});}main();
\ No newline at end of file
index 3563e34..6a310c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2efb=['then','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x25fed3,_0x10699d){var _0x30ab7b=function(_0x349b63){while(--_0x349b63){_0x25fed3['push'](_0x25fed3['shift']());}};_0x30ab7b(++_0x10699d);}(_0x2efb,0x1ef));var _0xb2ef=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x2efb[_0x59162a];return _0x35e50d;};'use strict';var BPromise=require(_0xb2ef('0x0'));var jayson=require(_0xb2ef('0x1'));var client=jayson[_0xb2ef('0x2')]['http']({'port':0x232b});function request(_0x28edaa,_0x1171a3){return new BPromise(function(_0x15d555,_0x55dc95){return client['request'](_0x28edaa,_0x1171a3)[_0xb2ef('0x3')](function(_0x1fe7d4){if(_0x1fe7d4['error']){return _0x55dc95(_0x1fe7d4['error']['message']);}else{return _0x15d555(_0x1fe7d4['result']);}})['catch'](function(_0x14d451){return _0x55dc95(_0x14d451);});});}exports[_0xb2ef('0x4')]=function(_0x1ff8f0,_0x191a81){return request(_0xb2ef('0x5'),{'account':_0x1ff8f0,'message':_0x191a81});};
\ No newline at end of file
+var _0x2cb8=['result','catch','SendMail','bluebird','jayson/promise','client','http','then','error','message'];(function(_0x95a7db,_0x2a065c){var _0x5a230b=function(_0x16a158){while(--_0x16a158){_0x95a7db['push'](_0x95a7db['shift']());}};_0x5a230b(++_0x2a065c);}(_0x2cb8,0x11b));var _0x82cb=function(_0xd0ea3e,_0x3d33f0){_0xd0ea3e=_0xd0ea3e-0x0;var _0x55faa9=_0x2cb8[_0xd0ea3e];return _0x55faa9;};'use strict';var BPromise=require(_0x82cb('0x0'));var jayson=require(_0x82cb('0x1'));var client=jayson[_0x82cb('0x2')][_0x82cb('0x3')]({'port':0x232b});function request(_0x4f04bd,_0xcf01d9){return new BPromise(function(_0x2f16db,_0x417ae2){return client['request'](_0x4f04bd,_0xcf01d9)[_0x82cb('0x4')](function(_0x5ac424){if(_0x5ac424[_0x82cb('0x5')]){return _0x417ae2(_0x5ac424[_0x82cb('0x5')][_0x82cb('0x6')]);}else{return _0x2f16db(_0x5ac424[_0x82cb('0x7')]);}})[_0x82cb('0x8')](function(_0x866794){return _0x417ae2(_0x866794);});});}exports['sendMailMessage']=function(_0x24169a,_0x4defe1){return request(_0x82cb('0x9'),{'account':_0x24169a,'message':_0x4defe1});};
\ No newline at end of file
index 5fa7cbe..d401c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d65=['inherits','prototype','_transform','toString','_inBody','indexOf','substring','length','split','slice','trim','emit','line','util','stream','Transform','call','_localBuffer'];(function(_0x1ca174,_0x5d93f6){var _0x472e0f=function(_0x4602e8){while(--_0x4602e8){_0x1ca174['push'](_0x1ca174['shift']());}};_0x472e0f(++_0x5d93f6);}(_0x1d65,0x199));var _0x51d6=function(_0x1de5dd,_0x4a4d0a){_0x1de5dd=_0x1de5dd-0x0;var _0x4ac9ea=_0x1d65[_0x1de5dd];return _0x4ac9ea;};'use strict';var util=require(_0x51d6('0x0'));var Transform=require(_0x51d6('0x1'))[_0x51d6('0x2')];function AGIReply(_0x28fda3){Transform[_0x51d6('0x3')](this,_0x28fda3);this[_0x51d6('0x4')]='';this['_inBody']=![];}util[_0x51d6('0x5')](AGIReply,Transform);AGIReply[_0x51d6('0x6')][_0x51d6('0x7')]=function(_0x3cc81f,_0x1c5ae9,_0x17d883){var _0x17f45f='\x0a',_0x521b1e=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x165471=-0x1,_0x697f02=-0x1,_0x4623b6='',_0x2209b6=0x0,_0x7cac2a='',_0x349cd6='';this[_0x51d6('0x4')]+=_0x3cc81f[_0x51d6('0x8')]();_0x7cac2a=this[_0x51d6('0x4')];if(!this[_0x51d6('0x9')]){_0x2209b6=0x0;while(_0x521b1e[_0x2209b6]){while((_0x697f02=_0x7cac2a[_0x51d6('0xa')](_0x521b1e[_0x2209b6]))!=-0x1){_0x4623b6=_0x521b1e[_0x2209b6];_0x349cd6=_0x7cac2a[_0x51d6('0xb')](0x0,_0x697f02);_0x7cac2a=_0x7cac2a[_0x51d6('0xb')](_0x697f02+_0x4623b6[_0x51d6('0xc')]);var _0x1fcbea=_0x349cd6[_0x51d6('0xd')](_0x17f45f),_0x224e78=0x0,_0x3a6fe3={},_0x16940f='',_0x31a533='',_0xc1c503=-0x1;while(_0x1fcbea[_0x224e78]){_0xc1c503=_0x1fcbea[_0x224e78][_0x51d6('0xa')](':');if(_0xc1c503!=-0x1){_0x16940f=_0x1fcbea[_0x224e78][_0x51d6('0xe')](0x0,_0xc1c503)[_0x51d6('0xf')]();_0x31a533=_0x1fcbea[_0x224e78][_0x51d6('0xe')](_0xc1c503+0x1)[_0x51d6('0xf')]();if(_0x16940f[_0x51d6('0xc')]>0x0){_0x3a6fe3[_0x16940f]=_0x31a533;}}else{}_0x224e78++;}this[_0x51d6('0x10')]('headers',_0x3a6fe3);this['_inBody']=!![];}_0x2209b6++;}this[_0x51d6('0x4')]=_0x7cac2a;}else{while((_0x165471=_0x7cac2a[_0x51d6('0xa')](_0x17f45f))!=-0x1){_0x349cd6=_0x7cac2a['substring'](0x0,_0x165471);this['emit'](_0x51d6('0x11'),_0x349cd6);_0x7cac2a=_0x7cac2a[_0x51d6('0xb')](_0x165471+_0x17f45f[_0x51d6('0xc')]);}this[_0x51d6('0x4')]=_0x7cac2a;}_0x17d883();};module['exports']=AGIReply;
\ No newline at end of file
+var _0xecf3=['inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','substring','split','indexOf','length','emit','headers','line','exports','Transform','call','_inBody'];(function(_0x5844d8,_0x22ac75){var _0x5b8d9a=function(_0x2a3037){while(--_0x2a3037){_0x5844d8['push'](_0x5844d8['shift']());}};_0x5b8d9a(++_0x22ac75);}(_0xecf3,0x66));var _0x3ecf=function(_0x385e0d,_0x373dcb){_0x385e0d=_0x385e0d-0x0;var _0x3c43c2=_0xecf3[_0x385e0d];return _0x3c43c2;};'use strict';var util=require('util');var Transform=require('stream')[_0x3ecf('0x0')];function AGIReply(_0x40fcb6){Transform[_0x3ecf('0x1')](this,_0x40fcb6);this['_localBuffer']='';this[_0x3ecf('0x2')]=![];}util[_0x3ecf('0x3')](AGIReply,Transform);AGIReply[_0x3ecf('0x4')]['_transform']=function(_0x378540,_0x245570,_0x4af095){var _0xe52550='\x0a',_0x4d13b8=['\x0a\x0a',_0x3ecf('0x5')],_0x99055c=-0x1,_0x17dd93=-0x1,_0x1ef6c3='',_0x3d1eb2=0x0,_0x3dbfef='',_0x3b1452='';this[_0x3ecf('0x6')]+=_0x378540['toString']();_0x3dbfef=this[_0x3ecf('0x6')];if(!this[_0x3ecf('0x2')]){_0x3d1eb2=0x0;while(_0x4d13b8[_0x3d1eb2]){while((_0x17dd93=_0x3dbfef['indexOf'](_0x4d13b8[_0x3d1eb2]))!=-0x1){_0x1ef6c3=_0x4d13b8[_0x3d1eb2];_0x3b1452=_0x3dbfef[_0x3ecf('0x7')](0x0,_0x17dd93);_0x3dbfef=_0x3dbfef[_0x3ecf('0x7')](_0x17dd93+_0x1ef6c3['length']);var _0x212404=_0x3b1452[_0x3ecf('0x8')](_0xe52550),_0x480c85=0x0,_0x1433f5={},_0x382f75='',_0x5d1f56='',_0x1bc3c7=-0x1;while(_0x212404[_0x480c85]){_0x1bc3c7=_0x212404[_0x480c85][_0x3ecf('0x9')](':');if(_0x1bc3c7!=-0x1){_0x382f75=_0x212404[_0x480c85]['slice'](0x0,_0x1bc3c7)['trim']();_0x5d1f56=_0x212404[_0x480c85]['slice'](_0x1bc3c7+0x1)['trim']();if(_0x382f75[_0x3ecf('0xa')]>0x0){_0x1433f5[_0x382f75]=_0x5d1f56;}}else{}_0x480c85++;}this[_0x3ecf('0xb')](_0x3ecf('0xc'),_0x1433f5);this[_0x3ecf('0x2')]=!![];}_0x3d1eb2++;}this['_localBuffer']=_0x3dbfef;}else{while((_0x99055c=_0x3dbfef['indexOf'](_0xe52550))!=-0x1){_0x3b1452=_0x3dbfef['substring'](0x0,_0x99055c);this[_0x3ecf('0xb')](_0x3ecf('0xd'),_0x3b1452);_0x3dbfef=_0x3dbfef[_0x3ecf('0x7')](_0x99055c+_0xe52550[_0x3ecf('0xa')]);}this[_0x3ecf('0x6')]=_0x3dbfef;}_0x4af095();};module[_0x3ecf('0xe')]=AGIReply;
\ No newline at end of file
index 2978a6b..304b936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e9c=['createCmContact','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','client','http','then','error','message','result','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','createSquareMessage','CreateSquareMessage'];(function(_0x52c856,_0x47fd69){var _0x41f172=function(_0x7bec89){while(--_0x7bec89){_0x52c856['push'](_0x52c856['shift']());}};_0x41f172(++_0x47fd69);}(_0x0e9c,0xb1));var _0xc0e9=function(_0x2c2838,_0x334032){_0x2c2838=_0x2c2838-0x0;var _0x24899a=_0x0e9c[_0x2c2838];return _0x24899a;};'use strict';var BPromise=require('bluebird');var moment=require(_0xc0e9('0x0'));var _=require(_0xc0e9('0x1'));var util=require(_0xc0e9('0x2'));var jayson=require(_0xc0e9('0x3'));var client=jayson[_0xc0e9('0x4')][_0xc0e9('0x5')]({'port':0x2329});function request(_0x155fbb,_0x131816){return new BPromise(function(_0xf5f5d8,_0xa080a0){return client['request'](_0x155fbb,_0x131816)[_0xc0e9('0x6')](function(_0x38e455){if(_0x38e455[_0xc0e9('0x7')]){return _0xa080a0(_0x38e455[_0xc0e9('0x7')][_0xc0e9('0x8')]);}else{return _0xf5f5d8(_0x38e455[_0xc0e9('0x9')]);}})['catch'](function(_0x3c2590){return _0xa080a0(_0x3c2590);});});}exports[_0xc0e9('0xa')]=function(_0x4d11aa){return request(_0xc0e9('0xb'),{'options':{'raw':![],'where':{'name':_0x4d11aa},'attributes':['production']}});};exports[_0xc0e9('0xc')]=function(_0x37e64a){return request(_0xc0e9('0xd'),{'options':{'raw':![],'where':{'id':_0x37e64a},'include':[{'model':_0xc0e9('0xe'),'as':_0xc0e9('0xf')}],'attributes':['id','name',_0xc0e9('0x10')]}});};exports['getSquareProjectById']=function(_0x1f6f40){return request(_0xc0e9('0xb'),{'options':{'where':{'id':_0x1f6f40},'attributes':[_0xc0e9('0x11')]}});};exports[_0xc0e9('0x12')]=function(_0x349e3e){return request(_0xc0e9('0x13'),{'options':{'where':{'id':_0x349e3e},'attributes':[_0xc0e9('0x11')]}});};exports[_0xc0e9('0x14')]=function(_0x5b2e97){return request(_0xc0e9('0x15'),{'options':{'where':{'id':_0x5b2e97},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x38ef56){return request(_0xc0e9('0x16'),{'options':{'where':{'id':_0x38ef56},'attributes':['dsn']}});};exports[_0xc0e9('0x17')]=function(_0x3eaf5b){return request(_0xc0e9('0x18'),{'options':{'where':{'id':_0x3eaf5b},'attributes':[_0xc0e9('0x11')]}});};exports[_0xc0e9('0x19')]=function(_0x5964b8){return request(_0xc0e9('0x1a'),{'options':{'where':{'id':_0x5964b8},'attributes':['name']}});};exports[_0xc0e9('0x1b')]=function(_0x32254d){return request(_0xc0e9('0x1c'),{'options':{'where':{'id':_0x32254d},'attributes':[_0xc0e9('0x1d')]}});};exports[_0xc0e9('0x1e')]=function(_0x31a3d2){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x31a3d2},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xc0e9('0x1f')]=function(_0xe59a98){return request('ShowSmsAccount',{'options':{'where':{'id':_0xe59a98},'attributes':['id',_0xc0e9('0x11')]}});};exports[_0xc0e9('0x20')]=function(_0x4a9b49){return request('CreateSmsMessage',{'body':_0x4a9b49});};exports[_0xc0e9('0x21')]=function(_0x215992){return request(_0xc0e9('0x22'),{'body':_0x215992});};exports[_0xc0e9('0x23')]=function(_0x3ed226){return request(_0xc0e9('0x24'),{'body':_[_0xc0e9('0x25')](_0x3ed226,{'project_name':_0x3ed226['arg_1'],'prev_project_name':_0x3ed226[_0xc0e9('0x26')]||'','is_subproject':_0x3ed226['arg_2']?!![]:![],'leaveAt':moment()[_0xc0e9('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xc0e9('0x28')]=function(_0x4d6c47){return request('CreateSquareRecording',{'body':_0x4d6c47});};exports[_0xc0e9('0x29')]=function(_0x44560f){return request(_0xc0e9('0x2a'),{'body':_0x44560f});};exports[_0xc0e9('0x2b')]=function(_0x3e3bd7){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3e3bd7[_0xc0e9('0x2c')],'ListId':_0x3e3bd7[_0xc0e9('0x2d')]}}})[_0xc0e9('0x6')](function(_0x2d596a){if(_0x2d596a){return _0x2d596a;}return request(_0xc0e9('0x2e'),{'body':_0x3e3bd7});});};exports[_0xc0e9('0x2f')]=function(_0x563f8d){return request(_0xc0e9('0x30'),{'options':{'where':{'id':_0x563f8d},'attributes':[_0xc0e9('0x11')]}});};exports[_0xc0e9('0x31')]=function(_0x3733c0,_0x22b886){return request('LoginUser',{'body':{'interface':_0x22b886},'options':{'where':_0x3733c0}});};exports[_0xc0e9('0x32')]=function(_0x3b4ad6,_0x17faf9,_0x4bd244){return request(_0xc0e9('0x33'),{'body':{'type':_0x17faf9,'uniqueid':_0x4bd244},'options':{'where':_0x3b4ad6}});};exports[_0xc0e9('0x34')]=function(_0x136603){return request('UnpauseUser',{'body':{},'options':{'where':_0x136603}});};exports[_0xc0e9('0x35')]=function(_0x4f392a){return request(_0xc0e9('0x36'),{'body':{},'options':{'where':_0x4f392a}});};
\ No newline at end of file
+var _0xb560=['CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','save_name','getIntervalById','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport'];(function(_0x3bba34,_0x16e608){var _0xab1353=function(_0x2ea7a5){while(--_0x2ea7a5){_0x3bba34['push'](_0x3bba34['shift']());}};_0xab1353(++_0x16e608);}(_0xb560,0xba));var _0x0b56=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb560[_0x3511d3];return _0x5d6321;};'use strict';var BPromise=require(_0x0b56('0x0'));var moment=require(_0x0b56('0x1'));var _=require(_0x0b56('0x2'));var util=require('util');var jayson=require(_0x0b56('0x3'));var client=jayson[_0x0b56('0x4')][_0x0b56('0x5')]({'port':0x2329});function request(_0x48f1f6,_0x2557b1){return new BPromise(function(_0x51d4e6,_0x840d99){return client[_0x0b56('0x6')](_0x48f1f6,_0x2557b1)[_0x0b56('0x7')](function(_0x55a975){if(_0x55a975[_0x0b56('0x8')]){return _0x840d99(_0x55a975[_0x0b56('0x8')][_0x0b56('0x9')]);}else{return _0x51d4e6(_0x55a975[_0x0b56('0xa')]);}})[_0x0b56('0xb')](function(_0x1ada14){return _0x840d99(_0x1ada14);});});}exports[_0x0b56('0xc')]=function(_0xd955c0){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xd955c0},'attributes':[_0x0b56('0xd')]}});};exports[_0x0b56('0xe')]=function(_0x21610d){return request(_0x0b56('0xf'),{'options':{'raw':![],'where':{'id':_0x21610d},'include':[{'model':_0x0b56('0x10'),'as':_0x0b56('0x11')}],'attributes':['id','name',_0x0b56('0x12')]}});};exports[_0x0b56('0x13')]=function(_0x3a807d){return request('ShowSquareProject',{'options':{'where':{'id':_0x3a807d},'attributes':[_0x0b56('0x14')]}});};exports[_0x0b56('0x15')]=function(_0x3fd5c){return request(_0x0b56('0x16'),{'options':{'where':{'id':_0x3fd5c},'attributes':[_0x0b56('0x14')]}});};exports[_0x0b56('0x17')]=function(_0x126fe3){return request(_0x0b56('0x18'),{'options':{'where':{'id':_0x126fe3},'attributes':[_0x0b56('0x14')]}});};exports[_0x0b56('0x19')]=function(_0x4dda52){return request(_0x0b56('0x1a'),{'options':{'where':{'id':_0x4dda52},'attributes':[_0x0b56('0x1b')]}});};exports['getUserById']=function(_0x48fb9e){return request(_0x0b56('0x1c'),{'options':{'where':{'id':_0x48fb9e},'attributes':[_0x0b56('0x14')]}});};exports[_0x0b56('0x1d')]=function(_0x5d46a0){return request(_0x0b56('0x1e'),{'options':{'where':{'id':_0x5d46a0},'attributes':[_0x0b56('0x14')]}});};exports['getSoundById']=function(_0x3e5ccd){return request('ShowSound',{'options':{'where':{'id':_0x3e5ccd},'attributes':[_0x0b56('0x1f')]}});};exports[_0x0b56('0x20')]=function(_0x1918b1){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1918b1},'include':[{'model':_0x0b56('0x21'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x517f16){return request(_0x0b56('0x22'),{'options':{'where':{'id':_0x517f16},'attributes':['id',_0x0b56('0x14')]}});};exports[_0x0b56('0x23')]=function(_0x52e4d0){return request(_0x0b56('0x24'),{'body':_0x52e4d0});};exports[_0x0b56('0x25')]=function(_0x3ebce3){return request(_0x0b56('0x26'),{'body':_0x3ebce3});};exports[_0x0b56('0x27')]=function(_0x5944c7){return request(_0x0b56('0x28'),{'body':_['merge'](_0x5944c7,{'project_name':_0x5944c7[_0x0b56('0x29')],'prev_project_name':_0x5944c7[_0x0b56('0x2a')]||'','is_subproject':_0x5944c7[_0x0b56('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0x0b56('0x2b'))})});};exports[_0x0b56('0x2c')]=function(_0xb8322c){return request(_0x0b56('0x2d'),{'body':_0xb8322c});};exports['createSquareMessage']=function(_0x550320){return request(_0x0b56('0x2e'),{'body':_0x550320});};exports[_0x0b56('0x2f')]=function(_0xbd2073){return request(_0x0b56('0x30'),{'options':{'raw':![],'where':{'phone':_0xbd2073[_0x0b56('0x31')],'ListId':_0xbd2073[_0x0b56('0x32')]}}})[_0x0b56('0x7')](function(_0x22a200){if(_0x22a200){return _0x22a200;}return request(_0x0b56('0x33'),{'body':_0xbd2073});});};exports[_0x0b56('0x34')]=function(_0x2adce7){return request(_0x0b56('0x35'),{'options':{'where':{'id':_0x2adce7},'attributes':[_0x0b56('0x14')]}});};exports['agentLogin']=function(_0x4bfa9d,_0xb29cd8){return request(_0x0b56('0x36'),{'body':{'interface':_0xb29cd8},'options':{'where':_0x4bfa9d}});};exports['agentPause']=function(_0x577989,_0x2e92d,_0x390834){return request('PauseUser',{'body':{'type':_0x2e92d,'uniqueid':_0x390834},'options':{'where':_0x577989}});};exports['agentUnpause']=function(_0x250796){return request('UnpauseUser',{'body':{},'options':{'where':_0x250796}});};exports['agentLogout']=function(_0x4f2393){return request(_0x0b56('0x37'),{'body':{},'options':{'where':_0x4f2393}});};
\ No newline at end of file
index 71683be..808862a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['./polly','./lex','exports'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x13f5,0xc3));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};var polly=require(_0x513f('0x0'));var lex=require(_0x513f('0x1'));module[_0x513f('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x29af=['./lex','exports','./polly'];(function(_0x539281,_0xeef1e){var _0x223040=function(_0x495014){while(--_0x495014){_0x539281['push'](_0x539281['shift']());}};_0x223040(++_0xeef1e);}(_0x29af,0x134));var _0xf29a=function(_0x38a28a,_0xd6bea8){_0x38a28a=_0x38a28a-0x0;var _0x5cad5e=_0x29af[_0x38a28a];return _0x5cad5e;};var polly=require(_0xf29a('0x0'));var lex=require(_0xf29a('0x1'));module[_0xf29a('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index a9ec881..1a8a92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var lex=require('./lib/api');module['exports']=function(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e){return lex(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e);};
\ No newline at end of file
+'use strict';var lex=require('./lib/api');module['exports']=function(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b){return lex(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b);};
\ No newline at end of file
index 24641cf..492dcbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x565816,_0x50a914){var _0x4b338d=function(_0x2f8fd4){while(--_0x2f8fd4){_0x565816['push'](_0x565816['shift']());}};_0x4b338d(++_0x50a914);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
+var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x41b810,_0x19ab01){var _0x13196a=function(_0x54b458){while(--_0x54b458){_0x41b810['push'](_0x41b810['shift']());}};_0x13196a(++_0x19ab01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
index 29686e5..f7e6186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab8a=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab8a,0x1c2));var _0xaab8=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xab8a[_0x36884e];return _0x1cc367;};'use strict';var polly=require(_0xaab8('0x0'));module[_0xaab8('0x1')]=function(_0x5be91e,_0x4d4bc3,_0x561ff7,_0x36e5c8,_0x24e5a9,_0x201a30,_0x54d83b){return polly(_0x5be91e,_0x4d4bc3,_0x561ff7,_0x36e5c8,_0x24e5a9,_0x201a30,_0x54d83b);};
\ No newline at end of file
+var _0xc22d=['exports','./lib/api'];(function(_0x5964f4,_0x10c39d){var _0x2f3365=function(_0x4ec463){while(--_0x4ec463){_0x5964f4['push'](_0x5964f4['shift']());}};_0x2f3365(++_0x10c39d);}(_0xc22d,0x67));var _0xdc22=function(_0x217622,_0x599053){_0x217622=_0x217622-0x0;var _0x2ceb63=_0xc22d[_0x217622];return _0x2ceb63;};'use strict';var polly=require(_0xdc22('0x0'));module[_0xdc22('0x1')]=function(_0x51c88d,_0xef500,_0x3a855d,_0x31311c,_0x23dd59,_0x25489b,_0x48ecfa){return polly(_0x51c88d,_0xef500,_0x3a855d,_0x31311c,_0x23dd59,_0x25489b,_0x48ecfa);};
\ No newline at end of file
index cd60cd3..e4231ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8773=['Polly','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x29fd4d,_0x395f17){var _0x5e9fa4=function(_0x46a6a4){while(--_0x46a6a4){_0x29fd4d['push'](_0x29fd4d['shift']());}};_0x5e9fa4(++_0x395f17);}(_0x8773,0x79));var _0x3877=function(_0x54d4c2,_0x198da9){_0x54d4c2=_0x54d4c2-0x0;var _0x591c89=_0x8773[_0x54d4c2];return _0x591c89;};'use strict';var fs=require('fs');var path=require(_0x3877('0x0'));var BPromise=require('bluebird');var rs=require(_0x3877('0x1'));var AWS=require(_0x3877('0x2'));function pollyResult(_0x215d32,_0x3c838d,_0x1cf876){return new BPromise(function(_0x50dc45,_0x2a2a57){_0x215d32[_0x3877('0x3')](_0x3c838d,function(_0x34eac7,_0x357d63){if(_0x34eac7){_0x2a2a57(_0x34eac7);}else if(_0x357d63){if(_0x357d63[_0x3877('0x4')]instanceof Buffer){fs[_0x3877('0x5')](_0x1cf876,_0x357d63[_0x3877('0x4')],function(_0x1b594a){if(_0x1b594a){_0x2a2a57(_0x1b594a);}else{_0x50dc45();}});}else{_0x2a2a57(new Error(_0x3877('0x6')));}}else{_0x2a2a57(new Error(_0x3877('0x7')));}});});}module[_0x3877('0x8')]=function(_0x35cd22,_0x42681e,_0xa71c51,_0x1fa597,_0x57975e,_0x3426c4,_0x18275f){var _0x7985de=new AWS[(_0x3877('0x9'))]({'accessKeyId':_0x35cd22,'secretAccessKey':_0x42681e,'region':_0xa71c51});var _0x5f5190={'Text':_0x57975e,'TextType':_0x3426c4||'text','OutputFormat':'mp3','VoiceId':_0x1fa597};return pollyResult(_0x7985de,_0x5f5190,_0x18275f);};
\ No newline at end of file
+var _0xeffc=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','bluebird','aws-sdk','synthesizeSpeech'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xeffc,0x1b5));var _0xceff=function(_0x3a9049,_0x207508){_0x3a9049=_0x3a9049-0x0;var _0x663ff6=_0xeffc[_0x3a9049];return _0x663ff6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xceff('0x0'));var rs=require('randomstring');var AWS=require(_0xceff('0x1'));function pollyResult(_0x3bf32a,_0x2aa37e,_0x27abf4){return new BPromise(function(_0x18b1f5,_0x4ccbdf){_0x3bf32a[_0xceff('0x2')](_0x2aa37e,function(_0x34b393,_0x19b622){if(_0x34b393){_0x4ccbdf(_0x34b393);}else if(_0x19b622){if(_0x19b622[_0xceff('0x3')]instanceof Buffer){fs[_0xceff('0x4')](_0x27abf4,_0x19b622[_0xceff('0x3')],function(_0x583f82){if(_0x583f82){_0x4ccbdf(_0x583f82);}else{_0x18b1f5();}});}else{_0x4ccbdf(new Error(_0xceff('0x5')));}}else{_0x4ccbdf(new Error(_0xceff('0x6')));}});});}module['exports']=function(_0x4812af,_0x317609,_0x2c1074,_0x57c5c2,_0x36c3ea,_0x4932fd,_0x221035){var _0x2fc460=new AWS['Polly']({'accessKeyId':_0x4812af,'secretAccessKey':_0x317609,'region':_0x2c1074});var _0x513e29={'Text':_0x36c3ea,'TextType':_0x4932fd||_0xceff('0x7'),'OutputFormat':'mp3','VoiceId':_0x57c5c2};return pollyResult(_0x2fc460,_0x513e29,_0x221035);};
\ No newline at end of file
index 2b2acf1..96d7090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x743d=['exports','./lib/api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x743d,0x12f));var _0xd743=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x743d[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0xd743('0x0'));module[_0xd743('0x1')]=function(_0x4011b2,_0x19163d,_0x5068fb,_0x110367){return asr(_0x4011b2,_0x19163d,_0x5068fb);};
\ No newline at end of file
+var _0xcf4a=['./lib/api'];(function(_0x324283,_0x55ebe3){var _0x45fa19=function(_0x329c82){while(--_0x329c82){_0x324283['push'](_0x324283['shift']());}};_0x45fa19(++_0x55ebe3);}(_0xcf4a,0xec));var _0xacf4=function(_0x1258d9,_0x2c5f15){_0x1258d9=_0x1258d9-0x0;var _0x2deeac=_0xcf4a[_0x1258d9];return _0x2deeac;};'use strict';var asr=require(_0xacf4('0x0'));module['exports']=function(_0x153ec3,_0x77f42c,_0x94133a,_0x31304b){return asr(_0x153ec3,_0x77f42c,_0x94133a);};
\ No newline at end of file
index a132aee..3dd6ed8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['string','length','key\x20should\x20be\x20a\x20string','undefined','base64','LINEAR16','8000','bluebird','exports'];(function(_0xacd1a9,_0x3372ac){var _0x9c1815=function(_0x4bc98c){while(--_0x4bc98c){_0xacd1a9['push'](_0xacd1a9['shift']());}};_0x9c1815(++_0x3372ac);}(_0x9f62,0x154));var _0x29f6=function(_0x40fbcc,_0x35f9bb){_0x40fbcc=_0x40fbcc-0x0;var _0x16ba93=_0x9f62[_0x40fbcc];return _0x16ba93;};'use strict';var url=require('url');var BPromise=require(_0x29f6('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x29f6('0x1')]=function(_0x254ab3,_0x548050,_0x5618b7){return new BPromise(function(_0x54d164,_0x258ddd){var _0x2f0420;if(typeof _0x254ab3!==_0x29f6('0x2')||_0x254ab3[_0x29f6('0x3')]===0x0){return _0x258ddd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x548050!==_0x29f6('0x2')||_0x548050[_0x29f6('0x3')]===0x0){return _0x258ddd(_0x29f6('0x4'));}if(typeof _0x5618b7!==_0x29f6('0x5')&&(typeof _0x5618b7!==_0x29f6('0x2')||_0x5618b7['length']===0x0)){return _0x258ddd('lang\x20should\x20be\x20a\x20string');}try{_0x2f0420=fs['readFileSync'](_0x254ab3)['toString'](_0x29f6('0x6'));}catch(_0x44db16){return _0x258ddd(_0x44db16);}return _0x54d164({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x548050,'body':{'config':{'encoding':_0x29f6('0x7'),'sampleRateHertz':_0x29f6('0x8'),'languageCode':_0x5618b7},'audio':{'content':_0x2f0420}},'json':!![]});});};
\ No newline at end of file
+var _0xf996=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string'];(function(_0x19d86d,_0x25b504){var _0x1d5503=function(_0x563c14){while(--_0x563c14){_0x19d86d['push'](_0x19d86d['shift']());}};_0x1d5503(++_0x25b504);}(_0xf996,0x74));var _0x6f99=function(_0x1266f9,_0x40f076){_0x1266f9=_0x1266f9-0x0;var _0x56ced3=_0xf996[_0x1266f9];return _0x56ced3;};'use strict';var url=require(_0x6f99('0x0'));var BPromise=require(_0x6f99('0x1'));var fs=require('fs');var host=_0x6f99('0x2');module['exports']=function(_0x12ac12,_0x56fd3f,_0x5ceb57){return new BPromise(function(_0x2eb1fc,_0xa0b3d7){var _0x274f12;if(typeof _0x12ac12!==_0x6f99('0x3')||_0x12ac12[_0x6f99('0x4')]===0x0){return _0xa0b3d7(_0x6f99('0x5'));}if(typeof _0x56fd3f!==_0x6f99('0x3')||_0x56fd3f[_0x6f99('0x4')]===0x0){return _0xa0b3d7(_0x6f99('0x6'));}if(typeof _0x5ceb57!==_0x6f99('0x7')&&(typeof _0x5ceb57!=='string'||_0x5ceb57[_0x6f99('0x4')]===0x0)){return _0xa0b3d7('lang\x20should\x20be\x20a\x20string');}try{_0x274f12=fs[_0x6f99('0x8')](_0x12ac12)[_0x6f99('0x9')](_0x6f99('0xa'));}catch(_0x161b64){return _0xa0b3d7(_0x161b64);}return _0x2eb1fc({'method':_0x6f99('0xb'),'uri':host+_0x6f99('0xc')+_0x56fd3f,'body':{'config':{'encoding':_0x6f99('0xd'),'sampleRateHertz':_0x6f99('0xe'),'languageCode':_0x5ceb57},'audio':{'content':_0x274f12}},'json':!![]});});};
\ No newline at end of file
index 808513e..189840a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e7b=['exports'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x5e7b,0x80));var _0xb5e7=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x5e7b[_0x25e7cb];return _0x375d92;};var asr=require('./asr');module[_0xb5e7('0x0')]={'asr':asr};
\ No newline at end of file
+var _0xfe24=['exports'];(function(_0x3b138c,_0x15c033){var _0x3083cc=function(_0x51a8c3){while(--_0x51a8c3){_0x3b138c['push'](_0x3b138c['shift']());}};_0x3083cc(++_0x15c033);}(_0xfe24,0xab));var _0x4fe2=function(_0x400d98,_0x1c2cc6){_0x400d98=_0x400d98-0x0;var _0x444d14=_0xfe24[_0x400d98];return _0x444d14;};var asr=require('./asr');module[_0x4fe2('0x0')]={'asr':asr};
\ No newline at end of file
index 99a54d7..52c7ca3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3f2=['tmp','generate','.wav','writeFileSync','base64','unlink','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','resolve','.mp3','from','audioContent','writeFile','chmodSync','googleTTS','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','result','source','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','AudioFromTts','audiofile','dirName','dialogflow','http','https','path','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','error','request\x20to\x20','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','pipe','data','end','transcode','error\x20convert','finish\x20to\x20convert','start'];(function(_0x4459b8,_0x3271b8){var _0x4a4b07=function(_0x3075f8){while(--_0x3075f8){_0x4459b8['push'](_0x4459b8['shift']());}};_0x4a4b07(++_0x3271b8);}(_0xa3f2,0x1ea));var _0x2a3f=function(_0x377511,_0x3f0f20){_0x377511=_0x377511-0x0;var _0x2b170c=_0xa3f2[_0x377511];return _0x2b170c;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x2a3f('0x0'));var fs=require('fs');var http=require(_0x2a3f('0x1'));var https=require(_0x2a3f('0x2'));var md5=require('md5');var path=require(_0x2a3f('0x3'));var querystring=require(_0x2a3f('0x4'));var rp=require(_0x2a3f('0x5'));var rs=require(_0x2a3f('0x6'));var sox=require('sox');var tts=require(_0x2a3f('0x7'));var urlParse=require(_0x2a3f('0x8'))[_0x2a3f('0x9')];var util=require(_0x2a3f('0xa'));var aws=require(_0x2a3f('0xb'));var google=require(_0x2a3f('0xc'));var sestek=require('./sestek');var tilde=require(_0x2a3f('0xd'));var logger=require('../../../config/logger')(_0x2a3f('0xe'));var ISPEECH_API=_0x2a3f('0xf');function downloadFile(_0x30096,_0x3c9385){return new BPromise(function(_0x513b40,_0xf21089){var _0x50c6ba=urlParse(_0x30096);var _0x243e83=_0x50c6ba[_0x2a3f('0x10')]===_0x2a3f('0x11')?https:http;var _0x14e7b9={'host':_0x50c6ba[_0x2a3f('0x12')],'path':_0x50c6ba[_0x2a3f('0x3')],'headers':{'user-agent':_0x2a3f('0x13')}};_0x243e83[_0x2a3f('0x14')](_0x14e7b9,function(_0x31918b){if(_0x31918b['statusCode']!==0xc8){logger[_0x2a3f('0x15')](_0x2a3f('0x16')+_0x30096+'\x20failed,\x20status\x20code\x20=\x20'+_0x31918b[_0x2a3f('0x17')]+'\x20('+_0x31918b[_0x2a3f('0x18')]+')');_0xf21089(new Error('request\x20to\x20'+_0x30096+_0x2a3f('0x19')+_0x31918b['statusCode']+'\x20('+_0x31918b[_0x2a3f('0x18')]+')'));return;}var _0x21012c=fs[_0x2a3f('0x1a')](_0x3c9385);_0x21012c['on'](_0x2a3f('0x1b'),function(){logger[_0x2a3f('0x1c')](_0x2a3f('0x1d'));_0x21012c[_0x2a3f('0x1e')](_0x513b40);});_0x21012c['on'](_0x2a3f('0x15'),function(_0x3572e1){fs['unlink'](_0x3c9385);logger[_0x2a3f('0x15')]('download\x20error',_0x3572e1);_0xf21089(_0x3572e1);});_0x31918b[_0x2a3f('0x1f')](_0x21012c);})['on']('error',function(_0x56aadb){logger['error'](_0x56aadb);_0xf21089(_0x56aadb);})['end']();});}function uploadFile(_0x5ccd08){return new BPromise(function(_0x43df77,_0x3aadf7){var _0x45c5eb=urlParse(_0x5ccd08);var _0x5db76b=_0x45c5eb[_0x2a3f('0x10')]==='https:'?https:http;var _0x2f9e4c={'host':_0x45c5eb[_0x2a3f('0x12')],'path':_0x45c5eb[_0x2a3f('0x3')],'headers':{'user-agent':_0x2a3f('0x13')}};_0x5db76b[_0x2a3f('0x14')](_0x2f9e4c,function(_0x31f5b5){if(_0x31f5b5[_0x2a3f('0x17')]!==0xc8){_0x3aadf7(new Error(_0x2a3f('0x16')+_0x5ccd08+'\x20failed,\x20status\x20code\x20=\x20'+_0x31f5b5[_0x2a3f('0x17')]+'\x20('+_0x31f5b5['statusMessage']+')'));return;}var _0x43d298='';_0x31f5b5['on'](_0x2a3f('0x20'),function(_0x3f4cc0){_0x43d298+=_0x3f4cc0;});_0x31f5b5['on'](_0x2a3f('0x21'),function(){_0x43df77(_0x43d298);});})['on'](_0x2a3f('0x15'),function(_0x322b0b){_0x3aadf7(_0x322b0b);})[_0x2a3f('0x21')]();});}function convertFile(_0x162ead,_0x42c883){return new BPromise(function(_0x5691d5,_0x221fa4){var _0x46ba45=sox[_0x2a3f('0x22')](_0x162ead,_0x42c883,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x46ba45['on'](_0x2a3f('0x15'),function(_0x2ec178){logger['error'](_0x2a3f('0x23'),_0x2ec178);_0x221fa4(_0x2ec178);});_0x46ba45['on'](_0x2a3f('0x21'),function(){logger['info'](_0x2a3f('0x24'));_0x5691d5();});_0x46ba45[_0x2a3f('0x25')]();});}function base64Decode(_0x55c00f,_0x142e13){var _0x2ec262=path['resolve'](__dirname,_0x2a3f('0x26'),rs[_0x2a3f('0x27')](0x4)+_0x2a3f('0x28'));fs[_0x2a3f('0x29')](_0x2ec262,_0x55c00f,_0x2a3f('0x2a'));return convertFile(_0x2ec262,_0x142e13)['then'](function(){try{fs[_0x2a3f('0x2b')](_0x2ec262);fs['chmodSync'](_0x142e13,_0x2a3f('0x2c'));}catch(_0x4104ac){logger[_0x2a3f('0x15')](_0x4104ac);}return _0x142e13[_0x2a3f('0x2d')]('.')[0x0];});}function base64Encode(_0x264379){var _0x2d7f9b=fs[_0x2a3f('0x2e')](_0x264379);return new Buffer(_0x2d7f9b)[_0x2a3f('0x2f')](_0x2a3f('0x2a'));}exports[_0x2a3f('0x30')]=function(_0xe66353,_0x4e68ba,_0x4eed65,_0x543657,_0x46c7fe,_0x416864){var _0x31a04b,_0x5127dd;var _0x5101ef=_0x2a3f('0x31');var _0xbba495=_0x2a3f('0x32')+_0xe66353;var _0x13db33={};if(_0x4e68ba===_0x2a3f('0x33')){_0x13db33[_0x2a3f('0x34')]={'ssml':_0x4eed65};}else{_0x13db33['input']={'text':_0x4eed65};};_0x13db33[_0x2a3f('0x35')]={'languageCode':_0x543657,'ssmlGender':_0x46c7fe};_0x13db33[_0x2a3f('0x36')]={'audioEncoding':_0x2a3f('0x37'),'sampleRateHertz':0x1f40};var _0x5a71cb={'url':_0x5101ef+_0x2a3f('0x38')+_0xbba495,'method':_0x2a3f('0x39'),'json':!![],'body':_0x13db33};return rp(_0x5a71cb)[_0x2a3f('0x3a')](function(_0x5059fe){return new BPromise(function(_0x565218,_0xf74bbe){_0x31a04b=path[_0x2a3f('0x3b')](__dirname,_0x2a3f('0x26'),rs[_0x2a3f('0x27')](0x4)+_0x2a3f('0x3c'));var _0x5bb945=Buffer[_0x2a3f('0x3d')](_0x5059fe[_0x2a3f('0x3e')],_0x2a3f('0x2a'));return fs[_0x2a3f('0x3f')](_0x31a04b,_0x5bb945,function(_0x226835){_0xf74bbe(_0x226835);},function(_0xfc86cf){fs[_0x2a3f('0x40')](_0x31a04b,_0x2a3f('0x2c'));_0x565218(_0xfc86cf);});});})[_0x2a3f('0x3a')](function(_0x1760d2){_0x5127dd=path[_0x2a3f('0x3b')](__dirname,_0x2a3f('0x26'),rs['generate'](0x4)+'.wav');return convertFile(_0x31a04b,_0x5127dd);})[_0x2a3f('0x3a')](function(){try{fs[_0x2a3f('0x2b')](_0x31a04b);fs[_0x2a3f('0x40')](_0x5127dd,_0x2a3f('0x2c'));}catch(_0x5caf42){logger['error'](_0x5caf42);}logger['info']('googleCloudTTS\x20path',_0x5127dd[_0x2a3f('0x2d')]('.')[0x0]);return _0x5127dd[_0x2a3f('0x2d')]('.')[0x0];});};exports[_0x2a3f('0x41')]=function(_0x528278,_0x1c3e54){var _0x446037='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x50872b,_0x2dccee;var _0x30a250;var _0x3125f7={'encoding':_0x2a3f('0x42'),'method':_0x2a3f('0x39'),'timeout':0x2710,'url':_0x446037,'headers':{'Content-Type':_0x2a3f('0x43')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x2a3f('0x44'),JSON[_0x2a3f('0x45')]([_0x528278,_0x1c3e54||'en',![],'null']),null,_0x2a3f('0x46')]]]))};return rp(_0x3125f7)[_0x2a3f('0x3a')](function(_0x41d8f7){try{_0x30a250=eval(_0x41d8f7[_0x2a3f('0x47')](0x5))[0x0][0x2];}catch(_0x27f311){throw new Error(_0x2a3f('0x48')+_0x41d8f7[_0x2a3f('0x20')]);}if(!_0x30a250){if(_0x528278[_0x2a3f('0x49')]>0xc8){throw new Error(_0x2a3f('0x4a'));}else{throw new Error('lang\x20\x22'+_0x1c3e54+_0x2a3f('0x4b'));}}try{_0x30a250=eval(_0x30a250)[0x0];}catch(_0xb232a0){throw new Error(_0x2a3f('0x48')+res[_0x2a3f('0x20')]);}const _0xfa69d9=_0x30a250;_0x50872b=path[_0x2a3f('0x3b')](__dirname,_0x2a3f('0x26'),rs['generate'](0x4)+_0x2a3f('0x3c'));fs[_0x2a3f('0x29')](_0x50872b,_0x30a250,{'encoding':_0x2a3f('0x2a')});_0x2dccee=path[_0x2a3f('0x3b')](__dirname,'tmp',rs['generate'](0x4)+_0x2a3f('0x28'));return convertFile(_0x50872b,_0x2dccee);})[_0x2a3f('0x3a')](function(){try{fs['unlink'](_0x50872b);fs['chmodSync'](_0x2dccee,_0x2a3f('0x2c'));}catch(_0x5305bd){logger[_0x2a3f('0x15')](_0x5305bd);}logger['info']('goggleTTS\x20path',_0x2dccee[_0x2a3f('0x2d')]('.')[0x0]);return _0x2dccee['split']('.')[0x0];});};exports['googleASR']=function(_0x10a8cf,_0x3bbe52,_0x3a15bc){return google[_0x2a3f('0x4c')](_0x10a8cf,_0x3bbe52,_0x3a15bc)[_0x2a3f('0x3a')](function(_0x145226){logger[_0x2a3f('0x1c')](_0x145226['uri']);return rp(_0x145226);})['then'](function(_0x50e62f){var _0x5b1ce7='';var _0x4a91b3=0x0;try{fs['unlink'](_0x10a8cf);}catch(_0x40af85){logger['error'](_0x40af85);}if(_0x50e62f&&_0x50e62f[_0x2a3f('0x4d')]){_0x5b1ce7=_0x50e62f['results'][_0x2a3f('0x4e')](function(_0x243203){return _0x243203&&_0x243203['alternatives'][0x0]&&_0x243203['alternatives'][0x0]['transcript']?_0x243203[_0x2a3f('0x4f')][0x0][_0x2a3f('0x50')]:'';})[_0x2a3f('0x51')]('\x0a');_0x4a91b3=_0x50e62f[_0x2a3f('0x4d')][_0x2a3f('0x4e')](function(_0x208f09){return _0x208f09&&_0x208f09[_0x2a3f('0x4f')][0x0]&&_0x208f09['alternatives'][0x0][_0x2a3f('0x52')]?_0x208f09['alternatives'][0x0][_0x2a3f('0x52')]:0x0;})[_0x2a3f('0x51')]('\x0a');}logger['info'](_0x2a3f('0x53'),_0x5b1ce7);logger[_0x2a3f('0x1c')](_0x2a3f('0x54'),_0x4a91b3);return{'transcript':_0x5b1ce7,'confidence':_0x4a91b3};})[_0x2a3f('0x55')](function(_0x2cc92d){logger['error']('[%s]\x20%s:%s',_0x2cc92d[_0x2a3f('0x17')],_0x2cc92d[_0x2a3f('0x56')],_0x2cc92d[_0x2a3f('0x57')]);});};exports[_0x2a3f('0x58')]=function(_0x347f8a,_0xc68569,_0x44e063,_0x2c6b64){var _0x1504fc=apiai(_0xc68569,{'language':_0x2c6b64||'en'});return _0x1504fc['textRequest'](_0x44e063,{'sessionId':md5(_0x347f8a)})[_0x2a3f('0x3a')](function(_0x11421d){logger[_0x2a3f('0x1c')](JSON[_0x2a3f('0x45')](_0x11421d));return{'source':_0x11421d[_0x2a3f('0x59')][_0x2a3f('0x5a')],'resolvedQuery':_0x11421d[_0x2a3f('0x59')][_0x2a3f('0x5b')],'action':_0x11421d[_0x2a3f('0x59')][_0x2a3f('0x5c')],'actionIncomplete':_0x11421d['result']['actionIncomplete'],'speech':_0x11421d[_0x2a3f('0x59')][_0x2a3f('0x5d')][_0x2a3f('0x5e')],'score':_0x11421d[_0x2a3f('0x59')][_0x2a3f('0x5f')],'statusCode':_0x11421d[_0x2a3f('0x60')][_0x2a3f('0x61')],'endConversation':_0x11421d['result'][_0x2a3f('0x62')][_0x2a3f('0x63')]||![],'isFallbackIntent':_0x11421d[_0x2a3f('0x59')][_0x2a3f('0x62')]['isFallbackIntent']};});};exports[_0x2a3f('0x64')]=function(_0x175941,_0x2007cb,_0x2e4ef1,_0x3f6a94,_0x2f5000,_0x3bb52f){var _0x1d3971=_0x3f6a94[_0x2a3f('0x65')](/\\n/g,'\x0a');var _0x339af6={'credentials':{'private_key':_0x1d3971,'client_email':_0x2e4ef1}};var _0x2d4db8=new dialogflow['SessionsClient'](_0x339af6);var _0xa0ec51=_0x2d4db8[_0x2a3f('0x66')](_0x2007cb,md5(_0x175941));var _0x358d5b={'session':_0xa0ec51,'queryInput':{'text':{'text':_0x2f5000,'languageCode':_0x3bb52f}}};return _0x2d4db8['detectIntent'](_0x358d5b)['then'](function(_0x179387){if(_0x179387&&_0x179387['length']){logger[_0x2a3f('0x1c')](_0x2a3f('0x67'),JSON['stringify'](_0x179387));var _0x4478ae=_0x179387[0x0];if(_0x4478ae){var _0x54bc94={'action':_0x4478ae['queryResult'][_0x2a3f('0x5c')],'allRequiredParamsPresent':_0x4478ae[_0x2a3f('0x68')]['allRequiredParamsPresent'],'endConversation':_0x4478ae['queryResult'][_0x2a3f('0x69')]&&_0x4478ae[_0x2a3f('0x68')][_0x2a3f('0x69')][_0x2a3f('0x6a')]?_0x4478ae[_0x2a3f('0x68')][_0x2a3f('0x69')][_0x2a3f('0x6a')][_0x2a3f('0x6b')][_0x2a3f('0x6c')]:![],'fulfillmentText':_0x4478ae[_0x2a3f('0x68')][_0x2a3f('0x6d')],'intentName':_0x4478ae[_0x2a3f('0x68')]['intent'][_0x2a3f('0x56')],'intentDisplayName':_0x4478ae[_0x2a3f('0x68')][_0x2a3f('0x6e')][_0x2a3f('0x6f')],'isFallbackIntent':_0x4478ae[_0x2a3f('0x68')][_0x2a3f('0x6e')][_0x2a3f('0x70')],'languageCode':_0x4478ae[_0x2a3f('0x68')]['languageCode'],'queryText':_0x4478ae['queryResult'][_0x2a3f('0x71')],'responseId':_0x4478ae[_0x2a3f('0x72')],'score':_0x4478ae[_0x2a3f('0x68')][_0x2a3f('0x73')],'speech':_0x4478ae['queryResult'][_0x2a3f('0x6d')],'providerResponse':JSON['stringify'](_0x179387)};return _0x54bc94;}}});};exports[_0x2a3f('0x74')]=function(_0x105352,_0xd540c0,_0x4068f8,_0xf344e8){return tilde[_0x2a3f('0x4c')](_0x105352,_0xd540c0,_0x4068f8,_0xf344e8)[_0x2a3f('0x3a')](function(_0x39c5e7){try{fs[_0x2a3f('0x2b')](_0x105352);}catch(_0x3c58eb){logger[_0x2a3f('0x15')](_0x3c58eb);}logger['info']('Tilde\x20ASR\x20transcription',_0x39c5e7[_0x2a3f('0x50')]);logger['info'](_0x2a3f('0x75'),_0x39c5e7[_0x2a3f('0x52')]);return _0x39c5e7;});};exports[_0x2a3f('0x76')]=function(_0x116bb7,_0x2e21d2,_0x2c0497,_0x400cf6,_0x2ca9ca,_0xb149d9){var _0x4ceb4e=path[_0x2a3f('0x3b')](__dirname,_0x2a3f('0x26'),rs[_0x2a3f('0x27')](0x4)+_0x2a3f('0x3c'));var _0x15695a;return aws[_0x2a3f('0x77')](_0x116bb7,_0x2e21d2,_0x2c0497,_0x400cf6,_0x2ca9ca,_0xb149d9,_0x4ceb4e)[_0x2a3f('0x3a')](function(){_0x15695a=path['resolve'](__dirname,_0x2a3f('0x26'),rs[_0x2a3f('0x27')](0x4)+_0x2a3f('0x28'));return convertFile(_0x4ceb4e,_0x15695a);})[_0x2a3f('0x3a')](function(){try{fs[_0x2a3f('0x2b')](_0x4ceb4e);fs['chmodSync'](_0x15695a,_0x2a3f('0x2c'));}catch(_0xa7d745){logger[_0x2a3f('0x15')](_0xa7d745);}return _0x15695a[_0x2a3f('0x2d')]('.')[0x0];});};exports['awsLex']=function(_0x4f30b0,_0x310de7,_0x24d332,_0x1e855c,_0x479386,_0x24d871){return aws[_0x2a3f('0x78')](_0x4f30b0,_0x310de7,_0x24d332,_0x1e855c,_0x479386,_0x24d871)[_0x2a3f('0x3a')](function(_0x471d24){logger[_0x2a3f('0x1c')](JSON[_0x2a3f('0x45')](_0x471d24));return _0x471d24;});};exports['ispeechTTS']=function(_0x784eb,_0x52cc8f,_0x156326,_0x54c4ba){var _0x44602b=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x784eb,encodeURIComponent(_0x52cc8f),_0x156326,_0x54c4ba);var _0x3c037f=path['resolve'](__dirname,_0x2a3f('0x26'),rs[_0x2a3f('0x27')](0x4)+_0x2a3f('0x3c'));var _0x207cc1;return downloadFile(_0x44602b,_0x3c037f)['then'](function(){_0x207cc1=path[_0x2a3f('0x3b')](__dirname,_0x2a3f('0x26'),rs[_0x2a3f('0x27')](0x4)+'.wav');return convertFile(_0x3c037f,_0x207cc1);})[_0x2a3f('0x3a')](function(){try{fs[_0x2a3f('0x2b')](_0x3c037f);fs['chmodSync'](_0x207cc1,_0x2a3f('0x2c'));}catch(_0x5e006e){logger['error'](_0x5e006e);}return _0x207cc1[_0x2a3f('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x496547,_0x47fb93,_0x56e1f0,_0xd65c20){var _0x3c1353=util[_0x2a3f('0x79')](_0x2a3f('0x7a'),ISPEECH_API,_0x47fb93,_0x56e1f0,base64Encode(_0x496547),_0xd65c20?util[_0x2a3f('0x79')](_0x2a3f('0x7b'),encodeURIComponent(_0xd65c20)):_0x2a3f('0x7c'));return uploadFile(_0x3c1353)[_0x2a3f('0x3a')](function(_0x12cfe9){return querystring['parse'](_0x12cfe9);});};exports[_0x2a3f('0x7d')]=function(_0x580f8e,_0x5508ee){return sestek[_0x2a3f('0x7e')](_0x580f8e,_0x5508ee)[_0x2a3f('0x3a')](function(_0x4e55e2){logger['info'](JSON[_0x2a3f('0x45')](_0x4e55e2));var _0x33d29d={'speech':_0x4e55e2['text'],'action':_0x4e55e2[_0x2a3f('0x7f')]?_0x4e55e2[_0x2a3f('0x7f')][_0x2a3f('0x80')]:undefined,'actiondata':_0x4e55e2[_0x2a3f('0x7f')]?_0x4e55e2['channelData']['CustomActionData']:undefined};if(_0x4e55e2[_0x2a3f('0x7f')]&&_0x4e55e2['channelData'][_0x2a3f('0x81')]){return base64Decode(_0x4e55e2['channelData']['AudioFromTts']['Data'],path[_0x2a3f('0x3b')](__dirname,_0x2a3f('0x26'),rs[_0x2a3f('0x27')](0x4)+_0x2a3f('0x28')))[_0x2a3f('0x3a')](function(_0x52f790){_0x33d29d[_0x2a3f('0x82')]=_0x52f790;return _0x33d29d;});}return _0x33d29d;});};exports[_0x2a3f('0x83')]=function(){return __dirname;};
\ No newline at end of file
+var _0x2911=['parse\x20response\x20failed:\x0a','data','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','length','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','fulfillmentText','intent','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','AudioFromTts','dirName','apiai-promise','bluebird','http','https','path','querystring','request-promise','randomstring','google-tts-api','url','./aws','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','text:synthesize','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x2911,0x1df));var _0x1291=function(_0x1b79da,_0x5eb49f){_0x1b79da=_0x1b79da-0x0;var _0x403e42=_0x2911[_0x1b79da];return _0x403e42;};'use strict';var apiai=require(_0x1291('0x0'));var BPromise=require(_0x1291('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x1291('0x2'));var https=require(_0x1291('0x3'));var md5=require('md5');var path=require(_0x1291('0x4'));var querystring=require(_0x1291('0x5'));var rp=require(_0x1291('0x6'));var rs=require(_0x1291('0x7'));var sox=require('sox');var tts=require(_0x1291('0x8'));var urlParse=require(_0x1291('0x9'))['parse'];var util=require('util');var aws=require(_0x1291('0xa'));var google=require('./google');var sestek=require(_0x1291('0xb'));var tilde=require(_0x1291('0xc'));var logger=require('../../../config/logger')(_0x1291('0xd'));var ISPEECH_API=_0x1291('0xe');function downloadFile(_0x4f94a4,_0x4e6273){return new BPromise(function(_0x5ca852,_0x11aaf2){var _0x417c5f=urlParse(_0x4f94a4);var _0x13c833=_0x417c5f['protocol']===_0x1291('0xf')?https:http;var _0x2916a0={'host':_0x417c5f[_0x1291('0x10')],'path':_0x417c5f[_0x1291('0x4')],'headers':{'user-agent':_0x1291('0x11')}};_0x13c833[_0x1291('0x12')](_0x2916a0,function(_0xab4116){if(_0xab4116[_0x1291('0x13')]!==0xc8){logger[_0x1291('0x14')](_0x1291('0x15')+_0x4f94a4+_0x1291('0x16')+_0xab4116[_0x1291('0x13')]+'\x20('+_0xab4116[_0x1291('0x17')]+')');_0x11aaf2(new Error(_0x1291('0x15')+_0x4f94a4+_0x1291('0x16')+_0xab4116[_0x1291('0x13')]+'\x20('+_0xab4116[_0x1291('0x17')]+')'));return;}var _0x5e7ed3=fs[_0x1291('0x18')](_0x4e6273);_0x5e7ed3['on'](_0x1291('0x19'),function(){logger[_0x1291('0x1a')](_0x1291('0x1b'));_0x5e7ed3[_0x1291('0x1c')](_0x5ca852);});_0x5e7ed3['on']('error',function(_0x3a6ecc){fs[_0x1291('0x1d')](_0x4e6273);logger[_0x1291('0x14')](_0x1291('0x1e'),_0x3a6ecc);_0x11aaf2(_0x3a6ecc);});_0xab4116[_0x1291('0x1f')](_0x5e7ed3);})['on']('error',function(_0x37b592){logger['error'](_0x37b592);_0x11aaf2(_0x37b592);})[_0x1291('0x20')]();});}function uploadFile(_0x17bf2a){return new BPromise(function(_0x51956e,_0x272b46){var _0x523315=urlParse(_0x17bf2a);var _0x224ce0=_0x523315[_0x1291('0x21')]===_0x1291('0xf')?https:http;var _0x574ca7={'host':_0x523315[_0x1291('0x10')],'path':_0x523315[_0x1291('0x4')],'headers':{'user-agent':_0x1291('0x11')}};_0x224ce0[_0x1291('0x12')](_0x574ca7,function(_0x430cf0){if(_0x430cf0[_0x1291('0x13')]!==0xc8){_0x272b46(new Error(_0x1291('0x15')+_0x17bf2a+_0x1291('0x16')+_0x430cf0[_0x1291('0x13')]+'\x20('+_0x430cf0[_0x1291('0x17')]+')'));return;}var _0x15fba5='';_0x430cf0['on']('data',function(_0x174352){_0x15fba5+=_0x174352;});_0x430cf0['on'](_0x1291('0x20'),function(){_0x51956e(_0x15fba5);});})['on'](_0x1291('0x14'),function(_0x25d393){_0x272b46(_0x25d393);})[_0x1291('0x20')]();});}function convertFile(_0x2ec318,_0x4721be){return new BPromise(function(_0x4e5472,_0x425811){var _0x51323d=sox['transcode'](_0x2ec318,_0x4721be,{'sampleRate':0x1f40,'format':_0x1291('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x51323d['on'](_0x1291('0x14'),function(_0x420f77){logger[_0x1291('0x14')](_0x1291('0x23'),_0x420f77);_0x425811(_0x420f77);});_0x51323d['on'](_0x1291('0x20'),function(){logger[_0x1291('0x1a')](_0x1291('0x24'));_0x4e5472();});_0x51323d[_0x1291('0x25')]();});}function base64Decode(_0x15c90a,_0xc7e002){var _0x5720c2=path[_0x1291('0x26')](__dirname,_0x1291('0x27'),rs[_0x1291('0x28')](0x4)+_0x1291('0x29'));fs[_0x1291('0x2a')](_0x5720c2,_0x15c90a,_0x1291('0x2b'));return convertFile(_0x5720c2,_0xc7e002)[_0x1291('0x2c')](function(){try{fs[_0x1291('0x1d')](_0x5720c2);fs[_0x1291('0x2d')](_0xc7e002,_0x1291('0x2e'));}catch(_0x41c95f){logger['error'](_0x41c95f);}return _0xc7e002['split']('.')[0x0];});}function base64Encode(_0x30465d){var _0x3b0b1a=fs[_0x1291('0x2f')](_0x30465d);return new Buffer(_0x3b0b1a)['toString'](_0x1291('0x2b'));}exports[_0x1291('0x30')]=function(_0x5bc548,_0xe9762c,_0x53f4cf,_0x423312,_0x4d1ad5,_0x11ec11){var _0x2385d9,_0x5ae100;var _0x5786cc=_0x1291('0x31');var _0x103233='?key='+_0x5bc548;var _0x41e8e0={};if(_0xe9762c==='ssml'){_0x41e8e0[_0x1291('0x32')]={'ssml':_0x53f4cf};}else{_0x41e8e0[_0x1291('0x32')]={'text':_0x53f4cf};};_0x41e8e0['voice']={'languageCode':_0x423312,'ssmlGender':_0x4d1ad5};_0x41e8e0['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x4396d0={'url':_0x5786cc+_0x1291('0x33')+_0x103233,'method':'POST','json':!![],'body':_0x41e8e0};return rp(_0x4396d0)[_0x1291('0x2c')](function(_0x4c9006){return new BPromise(function(_0x2f8aad,_0x3febea){_0x2385d9=path[_0x1291('0x26')](__dirname,_0x1291('0x27'),rs[_0x1291('0x28')](0x4)+_0x1291('0x34'));var _0x59834a=Buffer[_0x1291('0x35')](_0x4c9006[_0x1291('0x36')],_0x1291('0x2b'));return fs[_0x1291('0x37')](_0x2385d9,_0x59834a,function(_0x53aa4e){_0x3febea(_0x53aa4e);},function(_0x4028c8){fs[_0x1291('0x2d')](_0x2385d9,_0x1291('0x2e'));_0x2f8aad(_0x4028c8);});});})[_0x1291('0x2c')](function(_0x54d958){_0x5ae100=path[_0x1291('0x26')](__dirname,_0x1291('0x27'),rs[_0x1291('0x28')](0x4)+_0x1291('0x29'));return convertFile(_0x2385d9,_0x5ae100);})[_0x1291('0x2c')](function(){try{fs[_0x1291('0x1d')](_0x2385d9);fs['chmodSync'](_0x5ae100,'777');}catch(_0x21ae64){logger[_0x1291('0x14')](_0x21ae64);}logger['info'](_0x1291('0x38'),_0x5ae100[_0x1291('0x39')]('.')[0x0]);return _0x5ae100[_0x1291('0x39')]('.')[0x0];});};exports[_0x1291('0x3a')]=function(_0x501104,_0x287d18){var _0x197bf3=_0x1291('0x3b');var _0x4a648b,_0x36d08f;var _0x5146d1;var _0x47b90b={'encoding':_0x1291('0x3c'),'method':_0x1291('0x3d'),'timeout':0x2710,'url':_0x197bf3,'headers':{'Content-Type':_0x1291('0x3e')},'body':_0x1291('0x3f')+encodeURIComponent(JSON['stringify']([[[_0x1291('0x40'),JSON[_0x1291('0x41')]([_0x501104,_0x287d18||'en',![],_0x1291('0x42')]),null,_0x1291('0x43')]]]))};return rp(_0x47b90b)[_0x1291('0x2c')](function(_0x1c5ca8){try{_0x5146d1=eval(_0x1c5ca8[_0x1291('0x44')](0x5))[0x0][0x2];}catch(_0x10db05){throw new Error(_0x1291('0x45')+_0x1c5ca8[_0x1291('0x46')]);}if(!_0x5146d1){if(_0x501104['length']>0xc8){throw new Error(_0x1291('0x47'));}else{throw new Error(_0x1291('0x48')+_0x287d18+_0x1291('0x49'));}}try{_0x5146d1=eval(_0x5146d1)[0x0];}catch(_0x584e0c){throw new Error(_0x1291('0x45')+res['data']);}const _0x524728=_0x5146d1;_0x4a648b=path[_0x1291('0x26')](__dirname,_0x1291('0x27'),rs[_0x1291('0x28')](0x4)+_0x1291('0x34'));fs[_0x1291('0x2a')](_0x4a648b,_0x5146d1,{'encoding':_0x1291('0x2b')});_0x36d08f=path[_0x1291('0x26')](__dirname,_0x1291('0x27'),rs[_0x1291('0x28')](0x4)+_0x1291('0x29'));return convertFile(_0x4a648b,_0x36d08f);})[_0x1291('0x2c')](function(){try{fs[_0x1291('0x1d')](_0x4a648b);fs[_0x1291('0x2d')](_0x36d08f,_0x1291('0x2e'));}catch(_0x3da020){logger['error'](_0x3da020);}logger[_0x1291('0x1a')](_0x1291('0x4a'),_0x36d08f[_0x1291('0x39')]('.')[0x0]);return _0x36d08f[_0x1291('0x39')]('.')[0x0];});};exports['googleASR']=function(_0x1cda4b,_0x51287a,_0x3ca21d){return google[_0x1291('0x4b')](_0x1cda4b,_0x51287a,_0x3ca21d)[_0x1291('0x2c')](function(_0x571687){logger[_0x1291('0x1a')](_0x571687[_0x1291('0x4c')]);return rp(_0x571687);})[_0x1291('0x2c')](function(_0xb3e625){var _0x1bcc79='';var _0x1981b7=0x0;try{fs[_0x1291('0x1d')](_0x1cda4b);}catch(_0x1e66ee){logger['error'](_0x1e66ee);}if(_0xb3e625&&_0xb3e625[_0x1291('0x4d')]){_0x1bcc79=_0xb3e625['results'][_0x1291('0x4e')](function(_0x20494c){return _0x20494c&&_0x20494c[_0x1291('0x4f')][0x0]&&_0x20494c['alternatives'][0x0][_0x1291('0x50')]?_0x20494c[_0x1291('0x4f')][0x0][_0x1291('0x50')]:'';})[_0x1291('0x51')]('\x0a');_0x1981b7=_0xb3e625[_0x1291('0x4d')][_0x1291('0x4e')](function(_0x54bc53){return _0x54bc53&&_0x54bc53[_0x1291('0x4f')][0x0]&&_0x54bc53[_0x1291('0x4f')][0x0][_0x1291('0x52')]?_0x54bc53[_0x1291('0x4f')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x1291('0x1a')](_0x1291('0x53'),_0x1bcc79);logger[_0x1291('0x1a')](_0x1291('0x54'),_0x1981b7);return{'transcript':_0x1bcc79,'confidence':_0x1981b7};})[_0x1291('0x55')](function(_0x20984d){logger[_0x1291('0x14')](_0x1291('0x56'),_0x20984d[_0x1291('0x13')],_0x20984d[_0x1291('0x57')],_0x20984d[_0x1291('0x58')]);});};exports[_0x1291('0x59')]=function(_0xe04726,_0x44a04e,_0x46297f,_0x1003c0){var _0x14c11c=apiai(_0x44a04e,{'language':_0x1003c0||'en'});return _0x14c11c[_0x1291('0x5a')](_0x46297f,{'sessionId':md5(_0xe04726)})[_0x1291('0x2c')](function(_0x3a91bf){logger['info'](JSON[_0x1291('0x41')](_0x3a91bf));return{'source':_0x3a91bf[_0x1291('0x5b')][_0x1291('0x5c')],'resolvedQuery':_0x3a91bf[_0x1291('0x5b')][_0x1291('0x5d')],'action':_0x3a91bf[_0x1291('0x5b')][_0x1291('0x5e')],'actionIncomplete':_0x3a91bf['result'][_0x1291('0x5f')],'speech':_0x3a91bf[_0x1291('0x5b')][_0x1291('0x60')][_0x1291('0x61')],'score':_0x3a91bf[_0x1291('0x5b')][_0x1291('0x62')],'statusCode':_0x3a91bf[_0x1291('0x63')][_0x1291('0x64')],'endConversation':_0x3a91bf[_0x1291('0x5b')]['metadata'][_0x1291('0x65')]||![],'isFallbackIntent':_0x3a91bf['result'][_0x1291('0x66')]['isFallbackIntent']};});};exports[_0x1291('0x67')]=function(_0x54f4ee,_0x172d7a,_0x5e8690,_0x184cdb,_0x32968c,_0x17d91){var _0x56c87b=_0x184cdb[_0x1291('0x68')](/\\n/g,'\x0a');var _0x493506={'credentials':{'private_key':_0x56c87b,'client_email':_0x5e8690}};var _0x1b68c8=new dialogflow[(_0x1291('0x69'))](_0x493506);var _0x167e92=_0x1b68c8[_0x1291('0x6a')](_0x172d7a,md5(_0x54f4ee));var _0x26d3f5={'session':_0x167e92,'queryInput':{'text':{'text':_0x32968c,'languageCode':_0x17d91}}};return _0x1b68c8['detectIntent'](_0x26d3f5)[_0x1291('0x2c')](function(_0x27998d){if(_0x27998d&&_0x27998d[_0x1291('0x6b')]){logger['info'](_0x1291('0x6c'),JSON['stringify'](_0x27998d));var _0x39300c=_0x27998d[0x0];if(_0x39300c){var _0x4a95dc={'action':_0x39300c['queryResult'][_0x1291('0x5e')],'allRequiredParamsPresent':_0x39300c['queryResult'][_0x1291('0x6d')],'endConversation':_0x39300c[_0x1291('0x6e')][_0x1291('0x6f')]&&_0x39300c['queryResult'][_0x1291('0x6f')]['fields']?_0x39300c[_0x1291('0x6e')]['diagnosticInfo'][_0x1291('0x70')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x39300c[_0x1291('0x6e')][_0x1291('0x71')],'intentName':_0x39300c[_0x1291('0x6e')][_0x1291('0x72')]['name'],'intentDisplayName':_0x39300c[_0x1291('0x6e')][_0x1291('0x72')]['displayName'],'isFallbackIntent':_0x39300c[_0x1291('0x6e')]['intent'][_0x1291('0x73')],'languageCode':_0x39300c[_0x1291('0x6e')][_0x1291('0x74')],'queryText':_0x39300c[_0x1291('0x6e')][_0x1291('0x75')],'responseId':_0x39300c['responseId'],'score':_0x39300c[_0x1291('0x6e')][_0x1291('0x76')],'speech':_0x39300c[_0x1291('0x6e')][_0x1291('0x71')],'providerResponse':JSON[_0x1291('0x41')](_0x27998d)};return _0x4a95dc;}}});};exports[_0x1291('0x77')]=function(_0x1c9a76,_0x15d8f6,_0x28afca,_0x41217e){return tilde[_0x1291('0x4b')](_0x1c9a76,_0x15d8f6,_0x28afca,_0x41217e)['then'](function(_0x40a72f){try{fs['unlink'](_0x1c9a76);}catch(_0x1402fe){logger[_0x1291('0x14')](_0x1402fe);}logger[_0x1291('0x1a')](_0x1291('0x78'),_0x40a72f[_0x1291('0x50')]);logger[_0x1291('0x1a')](_0x1291('0x79'),_0x40a72f['confidence']);return _0x40a72f;});};exports['awsPolly']=function(_0x76a53a,_0x55870b,_0x346eeb,_0x4aac85,_0x1fca79,_0x79f3aa){var _0x4df5cc=path[_0x1291('0x26')](__dirname,'tmp',rs[_0x1291('0x28')](0x4)+'.mp3');var _0x25a984;return aws[_0x1291('0x7a')](_0x76a53a,_0x55870b,_0x346eeb,_0x4aac85,_0x1fca79,_0x79f3aa,_0x4df5cc)[_0x1291('0x2c')](function(){_0x25a984=path[_0x1291('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x1291('0x29'));return convertFile(_0x4df5cc,_0x25a984);})[_0x1291('0x2c')](function(){try{fs[_0x1291('0x1d')](_0x4df5cc);fs['chmodSync'](_0x25a984,_0x1291('0x2e'));}catch(_0x5d4e15){logger[_0x1291('0x14')](_0x5d4e15);}return _0x25a984[_0x1291('0x39')]('.')[0x0];});};exports[_0x1291('0x7b')]=function(_0x30783c,_0x403aa9,_0x234c10,_0x1051b5,_0x32d7ff,_0x3acf7d){return aws['lex'](_0x30783c,_0x403aa9,_0x234c10,_0x1051b5,_0x32d7ff,_0x3acf7d)[_0x1291('0x2c')](function(_0x4d6a96){logger[_0x1291('0x1a')](JSON['stringify'](_0x4d6a96));return _0x4d6a96;});};exports[_0x1291('0x7c')]=function(_0x2ef6f1,_0x318e1a,_0x5db42d,_0x2518f9){var _0x447a99=util[_0x1291('0x7d')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2ef6f1,encodeURIComponent(_0x318e1a),_0x5db42d,_0x2518f9);var _0x12db07=path['resolve'](__dirname,_0x1291('0x27'),rs[_0x1291('0x28')](0x4)+_0x1291('0x34'));var _0x27109f;return downloadFile(_0x447a99,_0x12db07)[_0x1291('0x2c')](function(){_0x27109f=path[_0x1291('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x1291('0x29'));return convertFile(_0x12db07,_0x27109f);})[_0x1291('0x2c')](function(){try{fs[_0x1291('0x1d')](_0x12db07);fs['chmodSync'](_0x27109f,_0x1291('0x2e'));}catch(_0x371f9c){logger['error'](_0x371f9c);}return _0x27109f[_0x1291('0x39')]('.')[0x0];});};exports[_0x1291('0x7e')]=function(_0x209ead,_0x3d37ec,_0x1963ba,_0x234f9f){var _0x41f0c3=util[_0x1291('0x7d')](_0x1291('0x7f'),ISPEECH_API,_0x3d37ec,_0x1963ba,base64Encode(_0x209ead),_0x234f9f?util['format'](_0x1291('0x80'),encodeURIComponent(_0x234f9f)):_0x1291('0x81'));return uploadFile(_0x41f0c3)[_0x1291('0x2c')](function(_0x361e60){return querystring[_0x1291('0x82')](_0x361e60);});};exports[_0x1291('0x83')]=function(_0x16c544,_0x46b511){return sestek[_0x1291('0x84')](_0x16c544,_0x46b511)[_0x1291('0x2c')](function(_0x206434){logger[_0x1291('0x1a')](JSON[_0x1291('0x41')](_0x206434));var _0x1ce5ed={'speech':_0x206434[_0x1291('0x85')],'action':_0x206434['channelData']?_0x206434[_0x1291('0x86')]['CustomAction']:undefined,'actiondata':_0x206434['channelData']?_0x206434['channelData']['CustomActionData']:undefined};if(_0x206434[_0x1291('0x86')]&&_0x206434['channelData'][_0x1291('0x87')]){return base64Decode(_0x206434[_0x1291('0x86')][_0x1291('0x87')]['Data'],path[_0x1291('0x26')](__dirname,'tmp',rs[_0x1291('0x28')](0x4)+'.wav'))['then'](function(_0xe80cd8){_0x1ce5ed['audiofile']=_0xe80cd8;return _0x1ce5ed;});}return _0x1ce5ed;});};exports[_0x1291('0x88')]=function(){return __dirname;};
\ No newline at end of file
index 8f34e03..e8409f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var nda=require('./nda');module['exports']={'nda':nda};
\ No newline at end of file
+var _0x173e=['./nda'];(function(_0x53cce2,_0x11447d){var _0xc56620=function(_0x3ff5ed){while(--_0x3ff5ed){_0x53cce2['push'](_0x53cce2['shift']());}};_0xc56620(++_0x11447d);}(_0x173e,0x81));var _0xe173=function(_0x4ce5cd,_0xff6c72){_0x4ce5cd=_0x4ce5cd-0x0;var _0xebb6db=_0x173e[_0x4ce5cd];return _0xebb6db;};var nda=require(_0xe173('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index ee5df20..fa2c11b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdb5=['CustomActionData','custom_action_data','info','request-promise','url','../../../../../config/logger','exports','resolve','/token','username','password','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','dnid','extension','text','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction'];(function(_0x130aba,_0x91f831){var _0x16214b=function(_0x4eb54c){while(--_0x4eb54c){_0x130aba['push'](_0x130aba['shift']());}};_0x16214b(++_0x91f831);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xfdb5[_0x486f4a];return _0x135d99;};'use strict';var rp=require(_0x5fdb('0x0'));var url=require(_0x5fdb('0x1'));var logger=require(_0x5fdb('0x2'))('agi');module[_0x5fdb('0x3')]=function(_0x3067fa,_0x7da3ba){var _0x49fd4d={'method':'POST','uri':url[_0x5fdb('0x4')](_0x7da3ba['ndauth_url'],_0x5fdb('0x5')),'form':{'grant_type':'password','username':_0x7da3ba[_0x5fdb('0x6')],'password':_0x7da3ba[_0x5fdb('0x7')]},'json':!![]};return rp(_0x49fd4d)['then'](function(_0x542bbc){var _0x5a556e={'method':_0x5fdb('0x8'),'uri':url[_0x5fdb('0x4')](_0x7da3ba[_0x5fdb('0x9')],_0x5fdb('0xa')),'body':{'type':_0x7da3ba[_0x5fdb('0xb')]||_0x5fdb('0xc'),'channelId':_0x5fdb('0xd'),'conversation':{'id':_0x3067fa['uniqueid']},'from':{'id':_0x3067fa[_0x5fdb('0xe')],'name':_0x3067fa['calleridname']},'recipient':{'id':_0x3067fa[_0x5fdb('0xf')],'name':_0x3067fa[_0x5fdb('0x10')]},'text':_0x7da3ba[_0x5fdb('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x542bbc[_0x5fdb('0x12')]},'json':!![]};if(_0x7da3ba['project']){_0x5a556e[_0x5fdb('0x13')][_0x5fdb('0x14')]['ProjectName']=_0x7da3ba[_0x5fdb('0x15')];}if(_0x7da3ba[_0x5fdb('0x16')]=='1'){_0x5a556e[_0x5fdb('0x13')]['channelData'][_0x5fdb('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5fdb('0x18')};}if(_0x7da3ba[_0x5fdb('0x19')]){_0x5a556e[_0x5fdb('0x13')][_0x5fdb('0x14')][_0x5fdb('0x1a')]=_0x7da3ba['custom_action'];if(_0x7da3ba['custom_action_data']){_0x5a556e[_0x5fdb('0x13')]['channelData'][_0x5fdb('0x1b')]=_0x7da3ba[_0x5fdb('0x1c')];}}logger[_0x5fdb('0x1d')](JSON['stringify'](_0x5a556e));return rp(_0x5a556e);});};
\ No newline at end of file
+var _0x570f=['POST','resolve','ndauth_url','/token','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','body','CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger'];(function(_0x21871a,_0x264b5e){var _0x548151=function(_0x2e77eb){while(--_0x2e77eb){_0x21871a['push'](_0x21871a['shift']());}};_0x548151(++_0x264b5e);}(_0x570f,0x152));var _0xf570=function(_0x50c200,_0x197885){_0x50c200=_0x50c200-0x0;var _0x7c5ba1=_0x570f[_0x50c200];return _0x7c5ba1;};'use strict';var rp=require(_0xf570('0x0'));var url=require(_0xf570('0x1'));var logger=require(_0xf570('0x2'))('agi');module['exports']=function(_0x1904b3,_0x3f4fef){var _0x1ed19d={'method':_0xf570('0x3'),'uri':url[_0xf570('0x4')](_0x3f4fef[_0xf570('0x5')],_0xf570('0x6')),'form':{'grant_type':'password','username':_0x3f4fef[_0xf570('0x7')],'password':_0x3f4fef['password']},'json':!![]};return rp(_0x1ed19d)[_0xf570('0x8')](function(_0x5910a8){var _0x2575c0={'method':'POST','uri':url[_0xf570('0x4')](_0x3f4fef['ndassistant_url'],_0xf570('0x9')),'body':{'type':_0x3f4fef[_0xf570('0xa')]||_0xf570('0xb'),'channelId':_0xf570('0xc'),'conversation':{'id':_0x1904b3[_0xf570('0xd')]},'from':{'id':_0x1904b3['callerid'],'name':_0x1904b3[_0xf570('0xe')]},'recipient':{'id':_0x1904b3[_0xf570('0xf')],'name':_0x1904b3[_0xf570('0x10')]},'text':_0x3f4fef['text'],'channelData':{}},'headers':{'Authorization':_0xf570('0x11')+_0x5910a8[_0xf570('0x12')]},'json':!![]};if(_0x3f4fef[_0xf570('0x13')]){_0x2575c0['body'][_0xf570('0x14')][_0xf570('0x15')]=_0x3f4fef[_0xf570('0x13')];}if(_0x3f4fef[_0xf570('0x16')]=='1'){_0x2575c0['body'][_0xf570('0x14')][_0xf570('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf570('0x18')};}if(_0x3f4fef[_0xf570('0x19')]){_0x2575c0[_0xf570('0x1a')][_0xf570('0x14')][_0xf570('0x1b')]=_0x3f4fef[_0xf570('0x19')];if(_0x3f4fef[_0xf570('0x1c')]){_0x2575c0[_0xf570('0x1a')][_0xf570('0x14')]['CustomActionData']=_0x3f4fef[_0xf570('0x1c')];}}logger[_0xf570('0x1d')](JSON[_0xf570('0x1e')](_0x2575c0));return rp(_0x2575c0);});};
\ No newline at end of file
index 866e8ab..f1e9b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60c8=['exports'];(function(_0x47b785,_0x6edf60){var _0x4acc70=function(_0x14e195){while(--_0x14e195){_0x47b785['push'](_0x47b785['shift']());}};_0x4acc70(++_0x6edf60);}(_0x60c8,0x6e));var _0x860c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x60c8[_0x14add3];return _0x4a174f;};'use strict';var asr=require('./lib/api');module[_0x860c('0x0')]=function(_0x5e159a,_0x47392c,_0x391e40,_0x629d4d){return asr(_0x5e159a,_0x47392c,_0x391e40,_0x629d4d);};
\ No newline at end of file
+var _0x4371=['exports'];(function(_0x4f0c8d,_0x24680e){var _0x496ca7=function(_0x26f192){while(--_0x26f192){_0x4f0c8d['push'](_0x4f0c8d['shift']());}};_0x496ca7(++_0x24680e);}(_0x4371,0x9a));var _0x1437=function(_0x5afff6,_0x3c2363){_0x5afff6=_0x5afff6-0x0;var _0x39adb1=_0x4371[_0x5afff6];return _0x39adb1;};'use strict';var asr=require('./lib/api');module[_0x1437('0x0')]=function(_0x280712,_0x1d1a85,_0x4f0627,_0x1189a9){return asr(_0x280712,_0x1d1a85,_0x4f0627,_0x1189a9);};
\ No newline at end of file
index 32ecbcf..4eaa4ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc4=['stringify','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','EOS','error'];(function(_0x583ba8,_0x40bb0d){var _0x515683=function(_0x4172e9){while(--_0x4172e9){_0x583ba8['push'](_0x583ba8['shift']());}};_0x515683(++_0x40bb0d);}(_0x9bc4,0x13c));var _0x49bc=function(_0x2243e5,_0x207eed){_0x2243e5=_0x2243e5-0x0;var _0x4612ed=_0x9bc4[_0x2243e5];return _0x4612ed;};'use strict';var BPromise=require(_0x49bc('0x0'));var _=require(_0x49bc('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x49bc('0x2'));var crypto=require(_0x49bc('0x3'));var logger=require('../../../../../../config/logger')(_0x49bc('0x4'));module[_0x49bc('0x5')]=function(_0xf87087,_0x10c608,_0x150ebe,_0x5cd879){return new BPromise(function(_0x483e0d,_0x2b2b4e){logger[_0x49bc('0x6')](_0x49bc('0x7'),_0x5cd879||_0x49bc('0x8'));var _0x4ee3bb=new WebSocket(_0x5cd879||_0x49bc('0x8'),{'perMessageDeflate':![]});var _0x227604='';var _0x5ebd27='0';var _0x5c712c='1';var _0x59ae9a='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x440072(_0x5997dc){var _0x160e78=crypto['createHash'](_0x49bc('0x9'));_0x160e78[_0x49bc('0xa')](_0x5997dc);return _0x160e78[_0x49bc('0xb')]('hex');}function _0x134a95(){try{logger[_0x49bc('0x6')](_0x49bc('0xc'));var _0x30a11c=moment()[_0x49bc('0xd')]();var _0x4d2c20=_0x440072(_0x30a11c+_0x10c608+_0x150ebe);_0x4ee3bb[_0x49bc('0xe')](JSON['stringify']({'appID':_0x10c608,'timestamp':_0x30a11c,'appKey':_0x4d2c20}));var _0x33957a=fs[_0x49bc('0xf')](_0xf87087);_0x33957a['on'](_0x49bc('0x10'),function(_0xb48641){_0x4ee3bb['send'](_0xb48641);});_0x33957a['on'](_0x49bc('0x11'),function(){_0x4ee3bb[_0x49bc('0xe')](_0x49bc('0x12'));});}catch(_0x46bd62){logger[_0x49bc('0x13')]('Tilde\x20ASR\x20send\x20error',JSON[_0x49bc('0x14')](_0x46bd62));_0x4ee3bb['terminate']();}}function _0x1856a5(_0x3cda97){try{if(_0x3cda97){var _0x5eadf9=JSON[_0x49bc('0x15')](_0x3cda97);switch(_0x5eadf9[_0x49bc('0x16')]){case 0x0:if(_0x5eadf9[_0x49bc('0x17')]){if(_0x5eadf9[_0x49bc('0x17')][_0x49bc('0x18')]){logger[_0x49bc('0x6')](_0x49bc('0x19'),JSON[_0x49bc('0x14')](_0x5eadf9[_0x49bc('0x17')]['hypotheses']));_0x227604=_0x5eadf9[_0x49bc('0x17')][_0x49bc('0x1a')][0x0][_0x49bc('0x1b')];_0x5ebd27=_0x5eadf9[_0x49bc('0x17')][_0x49bc('0x1a')][0x0][_0x49bc('0x1c')];_0x5c712c='0';_0x59ae9a='Success.';_0x4ee3bb['terminate']();}}break;case 0x1:logger['info'](_0x49bc('0x1d'));_0x5c712c='1';_0x59ae9a=_0x49bc('0x1d');break;case 0x2:logger[_0x49bc('0x6')](_0x49bc('0x1e'));_0x5c712c='2';_0x59ae9a='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x49bc('0x6')](_0x49bc('0x1f'));_0x5c712c='9';_0x59ae9a=_0x49bc('0x1f');break;case 0xa:logger['info']('Authentication\x20failed.');_0x5c712c='10';_0x59ae9a=_0x49bc('0x20');break;case 0xb:logger[_0x49bc('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x5c712c='11';_0x59ae9a=_0x49bc('0x21');}}}catch(_0x264a89){logger[_0x49bc('0x13')](_0x49bc('0x22'),JSON['stringify'](_0x264a89));_0x4ee3bb[_0x49bc('0x23')]();}}function _0x3e730e(){logger['info'](_0x49bc('0x24'));_0x483e0d({'transcript':_0x227604,'confidence':_0x5ebd27,'status':_0x5c712c,'status_message':_0x59ae9a});}function _0x396a81(_0x589624){logger[_0x49bc('0x13')](_0x49bc('0x25'));if(!_[_0x49bc('0x26')](_0x589624)){logger['error'](_[_0x49bc('0x27')](_0x589624)?JSON[_0x49bc('0x14')](_0x589624):_0x589624);}}_0x4ee3bb['on'](_0x49bc('0x28'),_0x134a95);_0x4ee3bb['on'](_0x49bc('0x29'),_0x1856a5);_0x4ee3bb['on'](_0x49bc('0x11'),_0x3e730e);_0x4ee3bb['on'](_0x49bc('0x13'),_0x396a81);});};
\ No newline at end of file
+var _0xd342=['final','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','bluebird','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','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result'];(function(_0x19fbd2,_0x38af8b){var _0x203143=function(_0x10c88d){while(--_0x10c88d){_0x19fbd2['push'](_0x19fbd2['shift']());}};_0x203143(++_0x38af8b);}(_0xd342,0x1bc));var _0x2d34=function(_0x59f5bd,_0x187407){_0x59f5bd=_0x59f5bd-0x0;var _0x4bd9f7=_0xd342[_0x59f5bd];return _0x4bd9f7;};'use strict';var BPromise=require(_0x2d34('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2d34('0x1'));var crypto=require(_0x2d34('0x2'));var logger=require(_0x2d34('0x3'))('agi');module[_0x2d34('0x4')]=function(_0x2ecfaf,_0x34d4de,_0x18495e,_0xea1b46){return new BPromise(function(_0x1e8f7e,_0x1b9170){logger[_0x2d34('0x5')]('Tilde\x20URI',_0xea1b46||_0x2d34('0x6'));var _0x2d9a2c=new WebSocket(_0xea1b46||_0x2d34('0x6'),{'perMessageDeflate':![]});var _0x1c8982='';var _0x149310='0';var _0x1c7f1a='1';var _0x486339=_0x2d34('0x7');function _0x3ad268(_0x46df3f){var _0xca6040=crypto['createHash']('sha1');_0xca6040[_0x2d34('0x8')](_0x46df3f);return _0xca6040[_0x2d34('0x9')](_0x2d34('0xa'));}function _0x18f05a(){try{logger['info'](_0x2d34('0xb'));var _0x37dbfd=moment()[_0x2d34('0xc')]();var _0x21f09f=_0x3ad268(_0x37dbfd+_0x34d4de+_0x18495e);_0x2d9a2c['send'](JSON[_0x2d34('0xd')]({'appID':_0x34d4de,'timestamp':_0x37dbfd,'appKey':_0x21f09f}));var _0x405107=fs[_0x2d34('0xe')](_0x2ecfaf);_0x405107['on'](_0x2d34('0xf'),function(_0x1fa51d){_0x2d9a2c[_0x2d34('0x10')](_0x1fa51d);});_0x405107['on'](_0x2d34('0x11'),function(){_0x2d9a2c[_0x2d34('0x10')](_0x2d34('0x12'));});}catch(_0x46d7e4){logger[_0x2d34('0x13')](_0x2d34('0x14'),JSON[_0x2d34('0xd')](_0x46d7e4));_0x2d9a2c['terminate']();}}function _0x1bea34(_0x1789bb){try{if(_0x1789bb){var _0x2b5410=JSON[_0x2d34('0x15')](_0x1789bb);switch(_0x2b5410[_0x2d34('0x16')]){case 0x0:if(_0x2b5410[_0x2d34('0x17')]){if(_0x2b5410[_0x2d34('0x17')][_0x2d34('0x18')]){logger[_0x2d34('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x2d34('0xd')](_0x2b5410[_0x2d34('0x17')][_0x2d34('0x19')]));_0x1c8982=_0x2b5410[_0x2d34('0x17')][_0x2d34('0x19')][0x0]['transcript'];_0x149310=_0x2b5410[_0x2d34('0x17')]['hypotheses'][0x0]['likelihood'];_0x1c7f1a='0';_0x486339=_0x2d34('0x1a');_0x2d9a2c['terminate']();}}break;case 0x1:logger[_0x2d34('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x1c7f1a='1';_0x486339=_0x2d34('0x7');break;case 0x2:logger['info'](_0x2d34('0x1b'));_0x1c7f1a='2';_0x486339=_0x2d34('0x1b');break;case 0x9:logger[_0x2d34('0x5')](_0x2d34('0x1c'));_0x1c7f1a='9';_0x486339=_0x2d34('0x1c');break;case 0xa:logger[_0x2d34('0x5')](_0x2d34('0x1d'));_0x1c7f1a='10';_0x486339=_0x2d34('0x1d');break;case 0xb:logger[_0x2d34('0x5')](_0x2d34('0x1e'));_0x1c7f1a='11';_0x486339=_0x2d34('0x1e');}}}catch(_0x5c81b6){logger['error'](_0x2d34('0x1f'),JSON[_0x2d34('0xd')](_0x5c81b6));_0x2d9a2c[_0x2d34('0x20')]();}}function _0x241a55(){logger['info'](_0x2d34('0x21'));_0x1e8f7e({'transcript':_0x1c8982,'confidence':_0x149310,'status':_0x1c7f1a,'status_message':_0x486339});}function _0x20a11b(_0x11ef3a){logger[_0x2d34('0x13')](_0x2d34('0x22'));if(!_['isNil'](_0x11ef3a)){logger[_0x2d34('0x13')](_[_0x2d34('0x23')](_0x11ef3a)?JSON[_0x2d34('0xd')](_0x11ef3a):_0x11ef3a);}}_0x2d9a2c['on']('open',_0x18f05a);_0x2d9a2c['on']('message',_0x1bea34);_0x2d9a2c['on'](_0x2d34('0x11'),_0x241a55);_0x2d9a2c['on'](_0x2d34('0x13'),_0x20a11b);});};
\ No newline at end of file
index d55894e..d78767d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a4f=['exports','./asr'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x1a4f,0xb1));var _0xf1a4=function(_0x5dff57,_0x5bbf9e){_0x5dff57=_0x5dff57-0x0;var _0x5bbdf9=_0x1a4f[_0x5dff57];return _0x5bbdf9;};var asr=require(_0xf1a4('0x0'));module[_0xf1a4('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xcbfc=['./asr','exports'];(function(_0x3c32fd,_0x53d7e4){var _0x1ae8e9=function(_0x140f93){while(--_0x140f93){_0x3c32fd['push'](_0x3c32fd['shift']());}};_0x1ae8e9(++_0x53d7e4);}(_0xcbfc,0xd2));var _0xccbf=function(_0x3edfdf,_0x4e2d87){_0x3edfdf=_0x3edfdf-0x0;var _0x2b2b5c=_0xcbfc[_0x3edfdf];return _0x2b2b5c;};var asr=require(_0xccbf('0x0'));module[_0xccbf('0x1')]={'asr':asr};
\ No newline at end of file
index 7983c5c..8766c73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff54=['createServer','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','events','./error','./channel','127.0.0.1','call','emit','error'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xff54,0xb5));var _0x4ff5=function(_0x535635,_0x433900){_0x535635=_0x535635-0x0;var _0x4f034b=_0xff54[_0x535635];return _0x4f034b;};'use strict';var util=require(_0x4ff5('0x0'));var net=require('net');var EventEmitter=require(_0x4ff5('0x1'))['EventEmitter'];var AGIError=require(_0x4ff5('0x2'));var AGIChannel=require(_0x4ff5('0x3'));var AGIServer=function(_0x2ffc4e,_0x1b4cdc,_0xe2e5){var _0x45ddde=this,_0x2ffc4e=_0x2ffc4e||0x11dd,_0x1b4cdc=_0x1b4cdc||_0x4ff5('0x4'),_0x201a84=null,_0x14b7a6=0x0;EventEmitter[_0x4ff5('0x5')](_0x45ddde);function _0x2aa3fe(){if(!_0x2ffc4e){_0x45ddde[_0x4ff5('0x6')](_0x4ff5('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x201a84=net[_0x4ff5('0x8')]();_0x201a84['listen'](_0x2ffc4e,_0x1b4cdc);_0x201a84['on'](_0x4ff5('0x9'),function(){_0x45ddde[_0x4ff5('0x6')](_0x4ff5('0x9'));});_0x201a84['on'](_0x4ff5('0xa'),function(_0xb87b9a){_0x201a84['getConnections'](function(_0x5135f0,_0x402a1b){if(_0x5135f0){_0x45ddde[_0x4ff5('0x6')](_0x4ff5('0x7'),new AGIError(_0x4ff5('0xb'),_0x5135f0));}else if(_0xe2e5&&_0xe2e5<0x0){_0x45ddde[_0x4ff5('0x6')]('error',new AGIError(_0x4ff5('0xc')));_0xb87b9a[_0x4ff5('0xd')]();}else if(_0xe2e5&&_0xe2e5>0x0&&_0xe2e5<_0x402a1b){_0x14b7a6+=0x1;_0x45ddde[_0x4ff5('0x6')](_0x4ff5('0x7'),new AGIError(_0x4ff5('0xe'),_0x14b7a6));_0xb87b9a['destroy']();}else{var _0x510858=new AGIChannel(_0xb87b9a);_0x510858['on'](_0x4ff5('0xf'),function(){_0x45ddde[_0x4ff5('0x6')](_0x4ff5('0xa'),_0x510858);});}});});_0x201a84['on'](_0x4ff5('0x7'),function(_0x3431b9){_0x45ddde[_0x4ff5('0x6')](_0x4ff5('0x7'),new AGIError(_0x4ff5('0xb'),_0x3431b9[_0x4ff5('0x10')]));});_0x201a84['on'](_0x4ff5('0x11'),function(){_0x45ddde[_0x4ff5('0x6')](_0x4ff5('0x11'),new AGIError(_0x4ff5('0x12')));});}process[_0x4ff5('0x13')](function(){_0x2aa3fe();});};util[_0x4ff5('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x5b10b1,_0x3fa4a3,_0xe7366d){return new AGIServer(_0x5b10b1,_0x3fa4a3,_0xe7366d);};
\ No newline at end of file
+var _0x3df2=['connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','./channel','call','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3df2,0x1ab));var _0x23df=function(_0x133b33,_0x36c70c){_0x133b33=_0x133b33-0x0;var _0x3a9d78=_0x3df2[_0x133b33];return _0x3a9d78;};'use strict';var util=require(_0x23df('0x0'));var net=require(_0x23df('0x1'));var EventEmitter=require(_0x23df('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x23df('0x3'));var AGIServer=function(_0x5dd000,_0x6a840e,_0x169764){var _0x55d558=this,_0x5dd000=_0x5dd000||0x11dd,_0x6a840e=_0x6a840e||'127.0.0.1',_0x177d6b=null,_0x3bdc87=0x0;EventEmitter[_0x23df('0x4')](_0x55d558);function _0x28f1bf(){if(!_0x5dd000){_0x55d558['emit']('error',new AGIError(_0x23df('0x5')));return![];}_0x177d6b=net[_0x23df('0x6')]();_0x177d6b[_0x23df('0x7')](_0x5dd000,_0x6a840e);_0x177d6b['on'](_0x23df('0x8'),function(){_0x55d558[_0x23df('0x9')](_0x23df('0x8'));});_0x177d6b['on'](_0x23df('0xa'),function(_0x436e41){_0x177d6b[_0x23df('0xb')](function(_0x548e84,_0x283339){if(_0x548e84){_0x55d558['emit'](_0x23df('0xc'),new AGIError(_0x23df('0xd'),_0x548e84));}else if(_0x169764&&_0x169764<0x0){_0x55d558[_0x23df('0x9')](_0x23df('0xc'),new AGIError(_0x23df('0xe')));_0x436e41[_0x23df('0xf')]();}else if(_0x169764&&_0x169764>0x0&&_0x169764<_0x283339){_0x3bdc87+=0x1;_0x55d558[_0x23df('0x9')]('error',new AGIError(_0x23df('0x10'),_0x3bdc87));_0x436e41[_0x23df('0xf')]();}else{var _0x43c3c1=new AGIChannel(_0x436e41);_0x43c3c1['on'](_0x23df('0x11'),function(){_0x55d558[_0x23df('0x9')](_0x23df('0xa'),_0x43c3c1);});}});});_0x177d6b['on']('error',function(_0x339c9e){_0x55d558['emit'](_0x23df('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x339c9e[_0x23df('0x12')]));});_0x177d6b['on'](_0x23df('0x13'),function(){_0x55d558['emit']('close',new AGIError(_0x23df('0x14')));});}process[_0x23df('0x15')](function(){_0x28f1bf();});};util[_0x23df('0x16')](AGIServer,EventEmitter);module['exports']=function(_0xd1129b,_0x31dfa6,_0x3fa326){return new AGIServer(_0xd1129b,_0x31dfa6,_0x3fa326);};
\ No newline at end of file
index e7d77bb..e453e11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bbd=['createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','%s.%s','saveRestApiResult','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','%s[%s][%s]','variable\x20%s\x20set','debug','sip_id','SIP/%s','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','googleDialogflowV2','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoif','no\x20condition\x20configured','condition','true','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','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\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','forEach','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','service','host','port','secure','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','127.0.0.1','AGI','system','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','unlink','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','exports','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage'];(function(_0x4e0028,_0x3442c4){var _0x1774ed=function(_0xa77c21){while(--_0xa77c21){_0x4e0028['push'](_0x4e0028['shift']());}};_0x1774ed(++_0x3442c4);}(_0x9bbd,0x198));var _0xd9bb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9bbd[_0x501510];return _0x1e6ee5;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0xd9bb('0x0'));var sh=require(_0xd9bb('0x1'));var odbc=require(_0xd9bb('0x2'))();var rs=require(_0xd9bb('0x3'));var moment=require(_0xd9bb('0x4'));var Mustache=require(_0xd9bb('0x5'));var rp=require(_0xd9bb('0x6'));var logger=require(_0xd9bb('0x7'))(_0xd9bb('0x8'));var config=require(_0xd9bb('0x9'));var scripts=require(_0xd9bb('0xa'));var FILES_PATH=_0xd9bb('0xb');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0xd9bb('0xc'),_0xd9bb('0xd'),_0xd9bb('0xe')];var AGIVertices=function(_0x2e4d9e,_0x7eb5dc,_0x5c23fc){this[_0xd9bb('0xf')]=_0x2e4d9e;this[_0xd9bb('0x10')]=_0x7eb5dc;this[_0xd9bb('0x11')]=_0x5c23fc;};AGIVertices[_0xd9bb('0x12')]['getVariable']=function(_0x52d2dc,_0xbd6b4e){this['rpc'][_0xd9bb('0x13')](_0x52d2dc)[_0xd9bb('0x14')](function(_0x4dc528){_0xbd6b4e(null,_0x4dc528?_0x4dc528[_0xd9bb('0x15')]:![]);})[_0xd9bb('0x16')](function(_0x4fb6c9){_0xbd6b4e(_0x4fb6c9);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x17')]=function(_0x2530ed,_0x1c1a78){this[_0xd9bb('0x10')][_0xd9bb('0x18')](_0x2530ed)[_0xd9bb('0x14')](function(_0x5275c5){_0x1c1a78(null,_0x5275c5?_0x5275c5['name']:![]);})[_0xd9bb('0x16')](function(_0x31703){_0x1c1a78(_0x31703);});};AGIVertices['prototype'][_0xd9bb('0x19')]=function(_0x1302db,_0x3e4114){this[_0xd9bb('0x10')][_0xd9bb('0x1a')](_0x1302db)[_0xd9bb('0x14')](function(_0x282811){_0x3e4114(null,_0x282811?_0x282811[_0xd9bb('0x15')]:![]);})['catch'](function(_0x40a21e){_0x3e4114(_0x40a21e);});};AGIVertices[_0xd9bb('0x12')]['getSquareOdbc']=function(_0x5cfa50,_0x4ae22c){this[_0xd9bb('0x10')][_0xd9bb('0x1b')](_0x5cfa50)['then'](function(_0x20da99){_0x4ae22c(null,_0x20da99?_0x20da99['dsn']:![]);})[_0xd9bb('0x16')](function(_0x2294e0){_0x4ae22c(_0x2294e0);});};AGIVertices['prototype'][_0xd9bb('0x1c')]=function(_0x57c5fc,_0x3ec651){this['rpc'][_0xd9bb('0x1d')](_0x57c5fc)[_0xd9bb('0x14')](function(_0x3b5fa4){_0x3ec651(null,_0x3b5fa4?_0x3b5fa4[_0xd9bb('0x15')]:![]);})['catch'](function(_0x56de4c){_0x3ec651(_0x56de4c);});};AGIVertices['prototype']['getTrunk']=function(_0x4483c1,_0x2b6e50){this[_0xd9bb('0x10')][_0xd9bb('0x1e')](_0x4483c1)[_0xd9bb('0x14')](function(_0x3a1cb4){_0x2b6e50(null,_0x3a1cb4?_0x3a1cb4[_0xd9bb('0x15')]:![]);})[_0xd9bb('0x16')](function(_0x4c05d5){_0x2b6e50(_0x4c05d5);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x1f')]=function(_0x22a7d3,_0x3df190){var _0x538bbf=this;this[_0xd9bb('0x10')][_0xd9bb('0x20')](_0x22a7d3)['then'](function(_0x440cc3){_0x3df190(null,_0x440cc3?_0x538bbf[_0xd9bb('0x21')](_0x440cc3[_0xd9bb('0x22')]):![]);})[_0xd9bb('0x16')](function(_0x3c65f3){_0x3df190(_0x3c65f3);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x23')]=function(_0x3b6c84,_0x4053c7){this[_0xd9bb('0x10')]['getMailAccountById'](_0x3b6c84)[_0xd9bb('0x14')](function(_0xff831f){_0x4053c7(null,_0xff831f?_0xff831f:![]);})[_0xd9bb('0x16')](function(_0x12db51){_0x4053c7(_0x12db51);});};AGIVertices[_0xd9bb('0x12')]['sendMailMessage']=function(_0x176f42,_0x448fda,_0x3b0546){this['mailRpc'][_0xd9bb('0x24')](_0x176f42,_0x448fda)[_0xd9bb('0x14')](function(){_0x3b0546(null);})[_0xd9bb('0x16')](function(_0x17e96a){_0x3b0546(_0x17e96a);});};AGIVertices['prototype'][_0xd9bb('0x25')]=function(_0x289f25,_0x1d74f6){this[_0xd9bb('0x10')]['getIntervalById'](_0x289f25)[_0xd9bb('0x14')](function(_0x3c0cb4){if(_0x3c0cb4){if(_0x3c0cb4[_0xd9bb('0x26')]){_0x1d74f6(null,[_0x3c0cb4[_0xd9bb('0x27')]]);}else{_0x1d74f6(null,_[_0xd9bb('0x28')](_0x3c0cb4[_0xd9bb('0x29')],_0xd9bb('0x27')));}}else{_0x1d74f6(null,![]);}})['catch'](function(_0x532639){_0x1d74f6(_0x532639);});};AGIVertices['prototype'][_0xd9bb('0x21')]=function(_0xe2f732){return util['format'](_0xd9bb('0x2a'),FILES_PATH,_0xe2f732);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x2b')]=function(_0x1cde55,_0x470006,_0x9d9e){odbc[_0xd9bb('0x2c')](_0x1cde55,function(_0x8d20fb){if(_0x8d20fb){logger[_0xd9bb('0x2d')](_0xd9bb('0x2e'),_0x8d20fb);_0x9d9e(_0x8d20fb);}else{logger[_0xd9bb('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0xd9bb('0x30')](_0x470006,function(_0x8816c1,_0x468eeb){if(_0x8816c1){logger['info'](_0xd9bb('0x31'),_0x470006);_0x9d9e(_0x8816c1);}else{logger[_0xd9bb('0x2f')](_0xd9bb('0x32'),_0x470006);odbc['close'](function(_0x38a954){if(_0x38a954){logger[_0xd9bb('0x2d')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x38a954);}_0x9d9e(null,_0x468eeb);});}});}});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x33')]=function(_0x3d26c9,_0x2975a4){this[_0xd9bb('0x10')][_0xd9bb('0x34')](_0x3d26c9)[_0xd9bb('0x14')](function(_0x4d1bdb){_0x2975a4(null,_0x4d1bdb?_0x4d1bdb:![]);})[_0xd9bb('0x16')](function(_0x1b0ac6){_0x2975a4(_0x1b0ac6);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x35')]=function(_0x12eb56,_0xc2b0c){this['rpc'][_0xd9bb('0x35')](_0x12eb56)[_0xd9bb('0x14')](function(_0x59adce){_0xc2b0c(null,_0x59adce);})[_0xd9bb('0x16')](function(_0x30aa16){_0xc2b0c(_0x30aa16);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x36')]=function(_0xed02d6,_0xb977c1,_0x48649c){this[_0xd9bb('0x10')][_0xd9bb('0x36')]({'uniqueid':this['channel'][_0xd9bb('0x37')],'node':_0xed02d6[_0xd9bb('0x38')],'application':_0xed02d6[_0xd9bb('0x39')],'data':_0xb977c1||null,'project_name':this['channel'][_0xd9bb('0x3a')],'callerid':this[_0xd9bb('0xf')][_0xd9bb('0x3b')]})[_0xd9bb('0x14')](function(_0x393f3b){if(_0x48649c){_0x48649c(null,_0x393f3b);}})[_0xd9bb('0x16')](function(_0x277e1e){if(_0x48649c){_0x48649c(_0x277e1e);}});};AGIVertices[_0xd9bb('0x12')]['createSquareRecording']=function(_0x175f2f,_0xb8ce12,_0xd507ba,_0xce7dcc){this[_0xd9bb('0x10')][_0xd9bb('0x3c')]({'uniqueid':this['channel'][_0xd9bb('0x37')],'callerid':this[_0xd9bb('0xf')]['callerid'],'calleridname':this['channel']['calleridname'],'context':this[_0xd9bb('0xf')][_0xd9bb('0x3d')],'extension':this[_0xd9bb('0xf')][_0xd9bb('0x3e')],'priority':this[_0xd9bb('0xf')][_0xd9bb('0x3f')],'accountcode':this[_0xd9bb('0xf')][_0xd9bb('0x40')],'dnid':this[_0xd9bb('0xf')][_0xd9bb('0x41')],'projectName':this[_0xd9bb('0xf')][_0xd9bb('0x3a')],'saveName':_0xb8ce12,'filename':_0x175f2f[_0xd9bb('0x42')]||_0xb8ce12,'savePath':_0xd507ba})[_0xd9bb('0x14')](function(_0x35dc80){_0xce7dcc(null,_0x35dc80);})[_0xd9bb('0x16')](function(_0x58d79c){_0xce7dcc(_0x58d79c);});};AGIVertices['prototype']['createSquareMessage']=function(_0x45e5e6,_0x501e4e,_0x98b275,_0x56169a,_0x2a22dd){this[_0xd9bb('0x10')][_0xd9bb('0x43')]({'uniqueid':this[_0xd9bb('0xf')]['uniqueid'],'body':_0x45e5e6,'direction':_0x501e4e,'providerName':_0x98b275,'providerResponse':_0x56169a})['then'](function(_0x1e6abc){if(_0x2a22dd){_0x2a22dd(null,_0x1e6abc);}})[_0xd9bb('0x16')](function(_0x206add){if(_0x2a22dd){_0x2a22dd(_0x206add);}});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x44')]=function(_0x453d9b,_0x2894a5){this[_0xd9bb('0x10')][_0xd9bb('0x44')]({'firstName':_[_0xd9bb('0x45')](_0x453d9b[_0xd9bb('0x15')])||_[_0xd9bb('0x46')](_0x453d9b[_0xd9bb('0x15')])?_0xd9bb('0x47')+Math[_0xd9bb('0x48')]():_0x453d9b['name'],'lastName':_[_0xd9bb('0x45')](_0x453d9b[_0xd9bb('0x49')])||_[_0xd9bb('0x46')](_0x453d9b[_0xd9bb('0x49')])?null:_0x453d9b[_0xd9bb('0x49')],'phone':_0x453d9b['phone'],'ListId':_0x453d9b[_0xd9bb('0x4a')],'scheduledat':_0x453d9b['scheduledAt'],'callbackUniqueid':this[_0xd9bb('0xf')][_0xd9bb('0x37')],'tags':_0xd9bb('0x4b'),'description':_0xd9bb('0x4c')+_0x453d9b[_0xd9bb('0x4d')][_0xd9bb('0x4e')](),'priority':_0x453d9b[_0xd9bb('0x4f')]})[_0xd9bb('0x14')](function(_0x4ffed4){_0x2894a5(null,_0x4ffed4);})[_0xd9bb('0x16')](function(_0x3fe65e){_0x2894a5(_0x3fe65e);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x50')]=function(_0x5cd088,_0x32b45a){this[_0xd9bb('0x10')]['getPauseById'](_0x5cd088)[_0xd9bb('0x14')](function(_0x11aa28){_0x32b45a(null,_0x11aa28?_0x11aa28[_0xd9bb('0x15')]:![]);})[_0xd9bb('0x16')](function(_0x9a43e4){_0x32b45a(_0x9a43e4);});};AGIVertices['prototype']['agentPause']=function(_0x361ff2,_0x2a2117,_0x13fd6b){var _0x578f54={'role':_0xd9bb('0x51')};_0x578f54[_0x361ff2]=this[_0xd9bb('0xf')][_0xd9bb('0x3b')];this[_0xd9bb('0x10')][_0xd9bb('0x52')](_0x578f54,_0x2a2117,this[_0xd9bb('0xf')][_0xd9bb('0x37')])[_0xd9bb('0x14')](function(_0xb1b83e){_0x13fd6b(null,_['isNil'](_0xb1b83e)?![]:!![]);})[_0xd9bb('0x16')](function(_0x1ee31e){logger['error'](_0x1ee31e);_0x13fd6b(null,![]);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x53')]=function(_0x55d69d,_0x2d40f6){var _0x3cfb1c={'role':_0xd9bb('0x51')};_0x3cfb1c[_0x55d69d]=this['channel']['callerid'];this[_0xd9bb('0x10')]['agentUnpause'](_0x3cfb1c)[_0xd9bb('0x14')](function(_0xe288ce){_0x2d40f6(null,_['isNil'](_0xe288ce)?![]:!![]);})[_0xd9bb('0x16')](function(_0x48517f){logger[_0xd9bb('0x2d')](_0x48517f);_0x2d40f6(null,![]);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x54')]=function(_0x4161ca,_0x268bb7){var _0x5db749={'role':_0xd9bb('0x51')};_0x5db749[_0x4161ca]=this[_0xd9bb('0xf')]['callerid'];this['rpc'][_0xd9bb('0x54')](_0x5db749)[_0xd9bb('0x14')](function(_0xb72fa5){_0x268bb7(null,_['isNil'](_0xb72fa5)?![]:!![]);})[_0xd9bb('0x16')](function(_0x3b5286){logger['error'](_0x3b5286);_0x268bb7(null,![]);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x55')]=function(_0x19ee27,_0x593e35){var _0x55c626={'role':_0xd9bb('0x51')};_0x55c626[_0x19ee27]=this[_0xd9bb('0xf')][_0xd9bb('0x3b')];var _0x2d7c98=_0x19ee27!=_0xd9bb('0x56')?util[_0xd9bb('0x57')]('%s/%s@from-sip/n',_0xd9bb('0x58'),this[_0xd9bb('0xf')]['callerid']):undefined;this[_0xd9bb('0x10')][_0xd9bb('0x55')](_0x55c626,_0x2d7c98)[_0xd9bb('0x14')](function(_0x26b959){_0x593e35(null,_[_0xd9bb('0x46')](_0x26b959)?![]:!![]);})[_0xd9bb('0x16')](function(_0x116a47){logger[_0xd9bb('0x2d')](_0x116a47);_0x593e35(null,![]);});};AGIVertices[_0xd9bb('0x12')]['shellCommand']=function(_0x58bb2a,_0x5c480f){sh[_0xd9bb('0x59')](_[_0xd9bb('0x5a')](_0x58bb2a),function(_0x378d81,_0xec6723){var _0x2d52b3=_0xec6723[_0xd9bb('0x5b')](/(\r\n|\n|\r)/gm,'');_0x5c480f(null,_0x2d52b3);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x1da467,_0x4f4d6e){scripts[_0xd9bb('0x5c')](_0x1da467[_0xd9bb('0x5d')],_0x1da467[_0xd9bb('0x5e')]||_0xd9bb('0x5f'),_0x1da467[_0xd9bb('0x5f')],_0x1da467[_0xd9bb('0x60')]||'en-US',_0x1da467[_0xd9bb('0x61')]||_0xd9bb('0x62'),_0x1da467['audioEncoding']||'MP3')[_0xd9bb('0x14')](function(_0xb1521d){_0x4f4d6e(null,_0xb1521d);})[_0xd9bb('0x16')](function(_0x138e6e){_0x4f4d6e(_0x138e6e);});};AGIVertices[_0xd9bb('0x12')]['googleTTS']=function(_0x263269,_0x190f8e){scripts['googleTTS'](_0x263269['text'],_0x263269[_0xd9bb('0x63')]||'en',0x1)[_0xd9bb('0x14')](function(_0x2e26eb){_0x190f8e(null,_0x2e26eb);})[_0xd9bb('0x16')](function(_0x22f809){_0x190f8e(_0x22f809);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x64')]=function(_0x1844c5,_0x379878){var _0x5b6482={'uri':_0x1844c5[_0xd9bb('0x65')],'method':_0x1844c5[_0xd9bb('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1844c5[_0xd9bb('0x67')])===_0xd9bb('0x68')&&parseInt(_0x1844c5[_0xd9bb('0x67')])>=0x1?parseInt(_0x1844c5[_0xd9bb('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xd9bb('0x69')]([_0xd9bb('0x6a'),_0xd9bb('0x6b')],_0x5b6482[_0xd9bb('0x66')][_0xd9bb('0x6c')]())){try{_0x5b6482[_0xd9bb('0x6d')]=_0x1844c5[_0xd9bb('0x6e')]?JSON[_0xd9bb('0x6f')](_0x1844c5[_0xd9bb('0x6e')]):{};}catch(_0x5e6f6a){logger[_0xd9bb('0x2d')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5e6f6a);}}try{_0x5b6482[_0xd9bb('0x70')]=_0x1844c5[_0xd9bb('0x71')]?JSON[_0xd9bb('0x6f')](_0x1844c5['rawHeaders']):{};}catch(_0x5826e8){logger[_0xd9bb('0x2d')](_0xd9bb('0x72'),_0x5826e8);}if(_0x1844c5[_0xd9bb('0x73')]){try{var _0x39ccc0=require(_0x1844c5['computedVariables'])[_0xd9bb('0x74')](this,_0x5b6482);_0x5b6482[_0xd9bb('0x75')]=Mustache[_0xd9bb('0x76')](_0x1844c5[_0xd9bb('0x65')],_0x39ccc0,{},['$$','$$']);if(_0x5b6482[_0xd9bb('0x70')]){_0x5b6482[_0xd9bb('0x70')]=JSON[_0xd9bb('0x6f')](Mustache['render'](JSON[_0xd9bb('0x77')](_0x5b6482[_0xd9bb('0x70')]),_0x39ccc0,{},['$$','$$']));}if(_0x5b6482[_0xd9bb('0x6d')]){_0x5b6482[_0xd9bb('0x6d')]=JSON[_0xd9bb('0x6f')](Mustache[_0xd9bb('0x76')](JSON[_0xd9bb('0x77')](_0x5b6482[_0xd9bb('0x6d')]),_0x39ccc0,{},['$$','$$']));}}catch(_0x2178d5){logger[_0xd9bb('0x2d')](_0xd9bb('0x78'),_0x2178d5);}}rp(_0x5b6482)[_0xd9bb('0x14')](function(_0x174cb9){var _0x5daae6={'statusCode':_0x174cb9['statusCode']||0xc8,'statusMessage':_0x174cb9[_0xd9bb('0x79')]||'OK','headers':_0x174cb9[_0xd9bb('0x70')]||{},'body':_0x174cb9[_0xd9bb('0x6d')]||{}};_0x379878(null,_0x5daae6);})['catch'](function(_0x12ae62){var _0x3c461d={'statusCode':_0x12ae62['statusCode']||0x1f4,'statusMessage':_0x12ae62[_0xd9bb('0x7a')]||_0xd9bb('0x7b'),'headers':_0x12ae62[_0xd9bb('0x7c')][_0xd9bb('0x70')]||{},'body':_0x12ae62[_0xd9bb('0x7c')]['body']||{}};_0x379878(null,_0x3c461d);});};AGIVertices[_0xd9bb('0x12')]['googleDialogflow']=function(_0x382b9d,_0x7c8984){scripts[_0xd9bb('0x7d')](this[_0xd9bb('0xf')][_0xd9bb('0x37')],_0x382b9d[_0xd9bb('0x7e')],_0x382b9d['text'],_0x382b9d[_0xd9bb('0x7f')]||'en')[_0xd9bb('0x14')](function(_0x20291e){_0x7c8984(null,_0x20291e);})[_0xd9bb('0x16')](function(_0x29029d){_0x7c8984(_0x29029d);});};AGIVertices[_0xd9bb('0x12')]['googleDialogflowV2']=function(_0x102e9d,_0x5c6e7a){scripts['googleDialogflowV2'](this['channel'][_0xd9bb('0x37')],_0x102e9d[_0xd9bb('0x80')],_0x102e9d['client_email'],_0x102e9d[_0xd9bb('0x81')],_0x102e9d[_0xd9bb('0x5f')],_0x102e9d['dialogflowV2_language']||'en')[_0xd9bb('0x14')](function(_0x2530f3){_0x5c6e7a(null,_0x2530f3);})[_0xd9bb('0x16')](function(_0x23667d){_0x5c6e7a(_0x23667d);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x82')]=function(_0x337458,_0x4a7040){scripts[_0xd9bb('0x82')](this[_0xd9bb('0xf')],_0x337458)[_0xd9bb('0x14')](function(_0x3a75ad){_0x4a7040(null,_0x3a75ad);})[_0xd9bb('0x16')](function(_0x15f8fc){_0x4a7040(_0x15f8fc);});};AGIVertices[_0xd9bb('0x12')]['ispeechTTS']=function(_0x2b4ad9,_0x234123){scripts[_0xd9bb('0x83')](_0x2b4ad9[_0xd9bb('0x7e')],_0x2b4ad9['text'],_0x2b4ad9['ispeech_tts_language']||_0xd9bb('0x84'),_0x2b4ad9[_0xd9bb('0x85')])[_0xd9bb('0x14')](function(_0xddb311){_0x234123(null,_0xddb311);})[_0xd9bb('0x16')](function(_0x573e53){_0x234123(_0x573e53);});};AGIVertices[_0xd9bb('0x12')]['ispeechASR']=function(_0x1bacff,_0x2deccc,_0x4fcc67){scripts[_0xd9bb('0x86')](_0x2deccc,_0x1bacff['key'],_0x1bacff['ispeech_asr_language']||_0xd9bb('0x84'),this[_0xd9bb('0x87')](_0x1bacff[_0xd9bb('0x88')])?_0x1bacff['model']:undefined)[_0xd9bb('0x14')](function(_0x172c65){_0x4fcc67(null,_0x172c65);})[_0xd9bb('0x16')](function(_0x1dff1b){_0x4fcc67(_0x1dff1b);});};AGIVertices['prototype'][_0xd9bb('0x89')]=function(_0x3659c9,_0x12b362){scripts['awsPolly'](_0x3659c9[_0xd9bb('0x8a')],_0x3659c9[_0xd9bb('0x8b')],_0x3659c9[_0xd9bb('0x8c')],_0x3659c9[_0xd9bb('0x8d')]||_0xd9bb('0x8e'),_0x3659c9[_0xd9bb('0x5f')],_0x3659c9['aws_text_type']||_0xd9bb('0x5f'))[_0xd9bb('0x14')](function(_0x437e62){_0x12b362(null,_0x437e62);})[_0xd9bb('0x16')](function(_0x5a9fe6){_0x12b362(_0x5a9fe6);});};AGIVertices['prototype']['awsLex']=function(_0x1375de,_0x4bff14){scripts[_0xd9bb('0x8f')](this[_0xd9bb('0xf')][_0xd9bb('0x37')],_0x1375de[_0xd9bb('0x8a')],_0x1375de[_0xd9bb('0x8b')],_0x1375de['aws_lex_region'],_0x1375de[_0xd9bb('0x5f')],_0x1375de[_0xd9bb('0x90')])['then'](function(_0x2b4d1c){_0x4bff14(null,_0x2b4d1c);})[_0xd9bb('0x16')](function(_0x2a3707){_0x4bff14(_0x2a3707);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x91')]=function(_0x5723ba,_0x50ab91,_0x71ec22){scripts[_0xd9bb('0x91')](_0x50ab91,_0x5723ba['key'],_0x5723ba[_0xd9bb('0x92')]||'en-US')[_0xd9bb('0x14')](function(_0x12721c){_0x71ec22(null,_0x12721c);})[_0xd9bb('0x16')](function(_0x3f6bc9){_0x71ec22(_0x3f6bc9);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x93')]=function(_0x184697,_0x29463d,_0x2019f6){scripts[_0xd9bb('0x93')](_0x29463d,_0x184697[_0xd9bb('0x94')],_0x184697[_0xd9bb('0x95')],_0x184697['uri'])[_0xd9bb('0x14')](function(_0x4c2f32){_0x2019f6(null,_0x4c2f32);})[_0xd9bb('0x16')](function(_0x1c5703){_0x2019f6(_0x1c5703);});};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x96')]=function(_0xdafa1b){var _0x3b3287=_['includes'](verticesWithRetry,_0xdafa1b[_0xd9bb('0x39')])?_0xdafa1b:_[_0xd9bb('0x97')](_0xdafa1b);for(var _0x591c49 in _0x3b3287){if(_0x3b3287[_0xd9bb('0x98')](_0x591c49)){if(_0x3b3287[_0x591c49]&&_[_0xd9bb('0x99')](_0x3b3287[_0x591c49])){if(_[_0xd9bb('0x69')](recursiveMapAttributes,_0x591c49)){_0x3b3287[_0x591c49]=this[_0xd9bb('0x9a')](_0x3b3287[_0x591c49]);}else{_0x3b3287[_0x591c49]=this[_0xd9bb('0x9b')](_0x3b3287[_0x591c49]);}}}}return _0x3b3287;};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x9c')]=function(_0x1fc1dc){for(var _0x53acf6 in _0x1fc1dc){if(_0x1fc1dc[_0xd9bb('0x98')](_0x53acf6)){if(_[_0xd9bb('0x9d')](_0x1fc1dc[_0x53acf6])){this['recursiveNodeIndex'](_0x1fc1dc[_0x53acf6]);}else if(_[_0xd9bb('0x9e')](_0x1fc1dc[_0x53acf6])){for(var _0x43552c=0x0;_0x43552c<_0x1fc1dc[_0x53acf6][_0xd9bb('0x9f')];_0x43552c++){this[_0xd9bb('0x9c')](_0x1fc1dc[_0x53acf6][_0x43552c]);}}else if(_[_0xd9bb('0x99')](_0x1fc1dc[_0x53acf6])){_0x1fc1dc[_0x53acf6]=this[_0xd9bb('0x9b')](_0x1fc1dc[_0x53acf6]);}}}};AGIVertices[_0xd9bb('0x12')]['saveRestApiResult']=function(_0x128c28,_0x2ad9fe){for(var _0x18b499 in _0x128c28){if(_0x128c28[_0xd9bb('0x98')](_0x18b499)){if(_['isPlainObject'](_0x128c28[_0x18b499])){if(!_[_0xd9bb('0x45')](_0x128c28[_0x18b499])){this['saveRestApiResult'](_0x128c28[_0x18b499],util['format'](_0xd9bb('0xa0'),_0x2ad9fe,_0x18b499));}}else if(_[_0xd9bb('0x9e')](_0x128c28[_0x18b499])){for(var _0x6d4b65=0x0;_0x6d4b65<_0x128c28[_0x18b499][_0xd9bb('0x9f')];_0x6d4b65++){this[_0xd9bb('0xa1')](_0x128c28[_0x18b499][_0x6d4b65],util[_0xd9bb('0x57')]('%s.%s',_0x2ad9fe,_0x18b499+'['+_0x6d4b65+']'));}}else{if(!_[_0xd9bb('0x46')](_0x128c28[_0x18b499])){this[_0xd9bb('0xf')][_0xd9bb('0xa2')](util[_0xd9bb('0x57')](_0xd9bb('0xa0'),_0x2ad9fe,_0x18b499),_0x128c28[_0x18b499]);}}}}};AGIVertices['prototype'][_0xd9bb('0x9a')]=function(_0xd9783f){try{var _0x3f708b=JSON['parse'](_0xd9783f);this[_0xd9bb('0x9c')](_0x3f708b);return JSON[_0xd9bb('0x77')](_0x3f708b);}catch(_0x16555b){return this[_0xd9bb('0x9b')](_0xd9783f);}};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x9b')]=function(_0x4d801d){var _0x14fb41=_0x4d801d['split']('{');for(var _0x57e2f7=0x1;_0x57e2f7<_0x14fb41['length'];_0x57e2f7+=0x1){var _0x38ce9b=_0x14fb41[_0x57e2f7][_0xd9bb('0xa3')]('}');if(_0x38ce9b[_0xd9bb('0x9f')]>0x1){_0x4d801d=_0x4d801d[_0xd9bb('0xa4')]('{'+_0x38ce9b[0x0]+'}',this[_0xd9bb('0xf')][_0xd9bb('0xa5')](_0x38ce9b[0x0])[_0xd9bb('0xa6')]||_0x38ce9b[0x0]);}}if(_0x14fb41['length']===0x1){return _0x4d801d[_0xd9bb('0x4e')]();}return this[_0xd9bb('0x9b')](_0x4d801d);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xa7')]=function(_0x5bb93a,_0x542a40){var _0x4fabfa=this[_0xd9bb('0xf')]['getVariable'](_0x5bb93a);if(_0x4fabfa['result']===-0x1){return _0x4fabfa;}logger['info'](util[_0xd9bb('0x57')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x542a40,_0x4fabfa['extra']));return this[_0xd9bb('0xf')][_0xd9bb('0xa2')](_0x542a40,_0x4fabfa['extra']);};AGIVertices[_0xd9bb('0x12')]['isConfigured']=function(_0x36e4d7){return _0x36e4d7&&_0x36e4d7!=='0'&&_0x36e4d7!=='-1'&&_0x36e4d7!=='';};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xa8')]=function(_0x127f35){this['createSquareDetailsReport']['sync'](this,_0x127f35,'-');_0x127f35[_0xd9bb('0xa9')]=_0x127f35[_0xd9bb('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xaa')]=function(_0x173769){logger['info'](util['format'](_0xd9bb('0xab'),_0x173769[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x173769[_0xd9bb('0x5f')])){return this['channel'][_0xd9bb('0xac')](_0xd9bb('0xad'));}var _0x38a587='\x22'+_0x173769[_0xd9bb('0x5f')]+'\x22';if(this[_0xd9bb('0x87')](_0x173769['options'])){_0x38a587+=','+_0x173769[_0xd9bb('0x7c')];}var _0x4188b1=this[_0xd9bb('0xf')][_0xd9bb('0x59')](_0xd9bb('0xae'),_0x38a587);if(_0x4188b1[_0xd9bb('0xaf')]===-0x1){return _0x4188b1;}return this[_0xd9bb('0xf')]['noop'](util[_0xd9bb('0x57')](_0xd9bb('0xb0'),_0x38a587));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xb1')]=function(_0x4ae17c){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0xb2'),_0x4ae17c[_0xd9bb('0x38')]));if(!this['isConfigured'](_0x4ae17c[_0xd9bb('0xb3')])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0xb4'));}var _0x552b9b=_0x4ae17c[_0xd9bb('0xb3')];if(this[_0xd9bb('0x87')](_0x4ae17c[_0xd9bb('0x7c')])){_0x552b9b+=','+_0x4ae17c[_0xd9bb('0x7c')];}var _0x4ecf2f=this['channel'][_0xd9bb('0x59')](_0xd9bb('0xb5'),_0x552b9b);if(_0x4ecf2f[_0xd9bb('0xaf')]===-0x1){return _0x4ecf2f;}var _0x428d18=this[_0xd9bb('0xa7')]('RECOG_CONFIDENCE()',_0xd9bb('0xb6'));if(_0x428d18['result']===-0x1){return _0x428d18;}var _0x2f9f2d=this[_0xd9bb('0xa7')](_0xd9bb('0xb7'),_0xd9bb('0xb8'));if(_0x2f9f2d[_0xd9bb('0xaf')]===-0x1){return _0x2f9f2d;}var _0x32e7b7=this['getAndSetVariable'](_0xd9bb('0xb9'),'MRCP_RECOG_INSTANCE');if(_0x32e7b7[_0xd9bb('0xaf')]===-0x1){return _0x32e7b7;}return this['channel']['noop'](util['format'](_0xd9bb('0xba'),_0x552b9b));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x8')]=function(_0x50829a){logger['info'](util['format'](_0xd9bb('0xbb'),_0x50829a[_0xd9bb('0x38')]));return this['channel'][_0xd9bb('0x8')]([_0x50829a[_0xd9bb('0xbc')],_0x50829a[_0xd9bb('0xbd')]]);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xbe')]=function(_0x586472){logger[_0xd9bb('0x2f')](util['format'](_0xd9bb('0xbf'),_0x586472[_0xd9bb('0x38')]));if(this['isConfigured'](_0x586472[_0xd9bb('0x67')])){logger['info'](util['format'](_0xd9bb('0xc0'),_0x586472[_0xd9bb('0x67')]));var _0x213ae3=this['channel'][_0xd9bb('0xc1')](_0x586472['timeout']);if(_0x213ae3[_0xd9bb('0xaf')]===-0x1){return _0x213ae3;}}return this[_0xd9bb('0xf')][_0xd9bb('0xbe')]();};AGIVertices[_0xd9bb('0x12')]['callback']=function(_0x2ff744){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0xc2'),_0x2ff744['label']));if(!this['isConfigured'](_0x2ff744[_0xd9bb('0x4a')])){return this['channel'][_0xd9bb('0x2d')](_0x2ff744,_0xd9bb('0xc3'));}_0x2ff744[_0xd9bb('0x4d')]=moment();if(this[_0xd9bb('0x87')](_0x2ff744[_0xd9bb('0xc4')])){_0x2ff744[_0xd9bb('0x4d')]=moment()[_0xd9bb('0xc5')](_0x2ff744[_0xd9bb('0xc4')],_0xd9bb('0xc6'));}if(!this['isConfigured'](_0x2ff744[_0xd9bb('0x4f')])){_0x2ff744[_0xd9bb('0x4f')]=0x2;}this['createCmContact'][_0xd9bb('0x74')](this,_0x2ff744);return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0xc7'),_0x2ff744[_0xd9bb('0xc8')],_0x2ff744['list_id'],_0x2ff744[_0xd9bb('0x4d')]));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xc9')]=function(_0x4665e0){logger[_0xd9bb('0x2f')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4665e0[_0xd9bb('0x38')]));var _0x51a42d=this[_0xd9bb('0xf')][_0xd9bb('0x59')](_0x4665e0[_0xd9bb('0xca')],_0x4665e0['options']);if(_0x51a42d[_0xd9bb('0xaf')]===-0x1){return _0x51a42d;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')]('Executed\x20command\x20%s\x20%s',_0x4665e0[_0xd9bb('0xca')],_0x4665e0[_0xd9bb('0x7c')]));};AGIVertices['prototype'][_0xd9bb('0xcb')]=function(_0x1c0a31){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0xcc'),_0x1c0a31[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x1c0a31['text'])){return this[_0xd9bb('0xf')]['noop']('no\x20text\x20configured');}var _0x58f39b='\x22'+_0x1c0a31[_0xd9bb('0x5f')]+'\x22';if(this[_0xd9bb('0x87')](_0x1c0a31[_0xd9bb('0x7c')])){_0x58f39b+=','+_0x1c0a31[_0xd9bb('0x7c')];}var _0x5d75c6=this[_0xd9bb('0xf')][_0xd9bb('0x59')](_0xd9bb('0xae'),_0x58f39b);if(_0x5d75c6[_0xd9bb('0xaf')]===-0x1){return _0x5d75c6;}return this[_0xd9bb('0xf')]['noop'](util[_0xd9bb('0x57')](_0xd9bb('0xb0'),_0x58f39b));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xcd')]=function(_0x1efc41){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0xce'),_0x1efc41[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x1efc41[_0xd9bb('0x5f')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xad'));}var _0x107507='\x22'+_0x1efc41[_0xd9bb('0x5f')]+'\x22';if(this[_0xd9bb('0x87')](_0x1efc41[_0xd9bb('0x7c')])){_0x107507+=','+_0x1efc41[_0xd9bb('0x7c')];}var _0x493807=this['channel'][_0xd9bb('0x59')]('MRCPSynth',_0x107507);if(_0x493807[_0xd9bb('0xaf')]===-0x1){return _0x493807;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0xb0'),_0x107507));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xcf')]=function(_0x159911){logger['info'](util[_0xd9bb('0x57')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x159911[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x159911[_0xd9bb('0xb3')])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0xb4'));}var _0x1966db=_0x159911['grammar'];if(this[_0xd9bb('0x87')](_0x159911['options'])){_0x1966db+=','+_0x159911['options'];}var _0x5c39ba=this[_0xd9bb('0xf')]['exec'](_0xd9bb('0xb5'),_0x1966db);if(_0x5c39ba[_0xd9bb('0xaf')]===-0x1){return _0x5c39ba;}var _0x3fe592=this['getAndSetVariable'](_0xd9bb('0xd0'),_0xd9bb('0xd1'));if(_0x3fe592[_0xd9bb('0xaf')]===-0x1){return _0x3fe592;}var _0x218915=this[_0xd9bb('0xa7')](_0xd9bb('0xb7'),_0xd9bb('0xd2'));if(_0x218915[_0xd9bb('0xaf')]===-0x1){return _0x218915;}var _0x340954=this[_0xd9bb('0xa7')](_0xd9bb('0xb9'),_0xd9bb('0xd3'));if(_0x340954[_0xd9bb('0xaf')]===-0x1){return _0x340954;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0xba'),_0x1966db));};AGIVertices['prototype'][_0xd9bb('0xd4')]=function(_0x3ef86d){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0xd5'),_0x3ef86d[_0xd9bb('0x38')]));if(!this['isConfigured'](_0x3ef86d[_0xd9bb('0xb3')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xb4'));}var _0x498639=_0x3ef86d[_0xd9bb('0xb3')];if(this[_0xd9bb('0x87')](_0x3ef86d[_0xd9bb('0x7c')])){_0x498639+=','+_0x3ef86d[_0xd9bb('0x7c')];}var _0x1a7f98=this[_0xd9bb('0xf')]['exec'](_0xd9bb('0xb5'),_0x498639);if(_0x1a7f98[_0xd9bb('0xaf')]===-0x1){return _0x1a7f98;}var _0x5967e3=this[_0xd9bb('0xa7')](_0xd9bb('0xd0'),_0xd9bb('0xd6'));if(_0x5967e3['result']===-0x1){return _0x5967e3;}var _0x1464de=this[_0xd9bb('0xa7')](_0xd9bb('0xb7'),_0xd9bb('0xd7'));if(_0x1464de[_0xd9bb('0xaf')]===-0x1){return _0x1464de;}var _0xa74871=this[_0xd9bb('0xa7')](_0xd9bb('0xb9'),_0xd9bb('0xd8'));if(_0xa74871[_0xd9bb('0xaf')]===-0x1){return _0xa74871;}return this[_0xd9bb('0xf')]['noop'](util[_0xd9bb('0x57')](_0xd9bb('0xba'),_0x498639));};AGIVertices[_0xd9bb('0x12')]['database']=function(_0x5c3ff7){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0xd9'),_0x5c3ff7['label']));if(!this[_0xd9bb('0x87')](_0x5c3ff7['odbc_id'])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x5c3ff7,_0xd9bb('0xda'));}var _0x4aae13=this[_0xd9bb('0xdb')][_0xd9bb('0x74')](this,_0x5c3ff7['odbc_id']);if(!_0x4aae13){return this[_0xd9bb('0xf')]['error'](_0x5c3ff7,'no\x20odbc\x20database\x20found');}if(!this[_0xd9bb('0x87')](_0x5c3ff7[_0xd9bb('0x30')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x5c3ff7,'no\x20query\x20configured');}var _0x4751cf=_0x5c3ff7[_0xd9bb('0x30')][_0xd9bb('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0xdc'),_0x4751cf));var _0x367b95=this[_0xd9bb('0x2b')][_0xd9bb('0x74')](this,_0x4aae13,_0x4751cf);this[_0xd9bb('0x36')][_0xd9bb('0x74')](this,_0x5c3ff7,_0x4751cf);if(!this[_0xd9bb('0x87')](_0x5c3ff7[_0xd9bb('0xdd')])){return this['channel'][_0xd9bb('0xac')](_0xd9bb('0xde'));}var _0x32b874=this['getVariable'][_0xd9bb('0x74')](this,_0x5c3ff7[_0xd9bb('0xdd')]);if(!_0x32b874){return this['channel'][_0xd9bb('0x2d')](_0x5c3ff7,'no\x20variable\x20found');}var _0x31ae46=this;_0x367b95['forEach'](function(_0x5207f5,_0x3ab61e){Object[_0xd9bb('0xdf')](_0x5207f5)['forEach'](function(_0x3f5efd){_0x31ae46[_0xd9bb('0xf')][_0xd9bb('0xa2')](util[_0xd9bb('0x57')](_0xd9bb('0xe0'),_0x32b874,_0x3ab61e,_0x3f5efd),_0x5207f5[_0x3f5efd]);});});this['channel']['setVariable'](util[_0xd9bb('0x57')]('%s_ROWS_COUNT',_0x32b874),_0x367b95[_0xd9bb('0x9f')]);return this['channel'][_0xd9bb('0xac')](util['format'](_0xd9bb('0xe1'),_0x32b874));};AGIVertices[_0xd9bb('0x12')]['dial']=function(_0x592cbc){logger[_0xd9bb('0xe2')](util[_0xd9bb('0x57')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x592cbc[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x592cbc[_0xd9bb('0xe3')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x592cbc,'no\x20user\x20selected');}var _0x2bd01f=this[_0xd9bb('0x1c')][_0xd9bb('0x74')](this,_0x592cbc[_0xd9bb('0xe3')]);if(!_0x2bd01f){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x592cbc,'no\x20user\x20found');}var _0x2c7bef=this[_0xd9bb('0xf')][_0xd9bb('0x59')]('DIAL',[util['format'](_0xd9bb('0xe4'),_0x2bd01f),_0x592cbc[_0xd9bb('0x67')],_0x592cbc['opts'],_0x592cbc['url']]);if(_0x2c7bef[_0xd9bb('0xaf')]===-0x1){return _0x2c7bef;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0xe5'),_0xd9bb('0xe6')));};AGIVertices['prototype'][_0xd9bb('0xe7')]=function(_0x14a28f){logger[_0xd9bb('0x2f')](util['format'](_0xd9bb('0xe8'),_0x14a28f[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x14a28f[_0xd9bb('0x7e')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')]('no\x20key\x20configured');}if(!this[_0xd9bb('0x87')](_0x14a28f[_0xd9bb('0x5f')])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0xad'));}this[_0xd9bb('0xf')]['bot']=!![];this[_0xd9bb('0x36')](_0x14a28f);this['createSquareMessage'](_0x14a28f[_0xd9bb('0x5f')],'in','','');this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0xe9'),_0x14a28f[_0xd9bb('0x5f')]));var _0x45f5f8=this[_0xd9bb('0x7d')]['sync'](this,_0x14a28f);if(_0x45f5f8){for(var _0x1fcc96 in _0x45f5f8){if(_0x45f5f8[_0xd9bb('0x98')](_0x1fcc96)){this[_0xd9bb('0xf')][_0xd9bb('0xa2')](util[_0xd9bb('0x57')]('DIALOGFLOW_%s',_0x1fcc96[_0xd9bb('0x6c')]()),_0x45f5f8[_0x1fcc96]);}}this[_0xd9bb('0x43')](_0x45f5f8[_0xd9bb('0xea')],_0xd9bb('0xeb'),_0xd9bb('0xe7'),'');return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')]('Dialogflow\x20Result\x20%s',_0x45f5f8[_0xd9bb('0xea')]));}return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x14a28f,_0xd9bb('0xec'));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xed')]=function(_0x506919){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x506919['label']));if(!this[_0xd9bb('0x87')](_0x506919[_0xd9bb('0x80')])){return this['channel'][_0xd9bb('0xac')](_0xd9bb('0xee'));}if(!this['isConfigured'](_0x506919[_0xd9bb('0xef')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xf0'));}if(!this[_0xd9bb('0x87')](_0x506919[_0xd9bb('0x81')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xf1'));}if(!this['isConfigured'](_0x506919[_0xd9bb('0xf2')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xf3'));}if(!this[_0xd9bb('0x87')](_0x506919[_0xd9bb('0x5f')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xad'));}this[_0xd9bb('0xf')]['bot']=!![];this[_0xd9bb('0x36')](_0x506919);this[_0xd9bb('0x43')](_0x506919[_0xd9bb('0x5f')],'in','','');this['channel'][_0xd9bb('0xac')](util[_0xd9bb('0x57')]('Trying\x20DialogflowV2:\x20%s',_0x506919['text']));var _0xf81938=this[_0xd9bb('0xf4')][_0xd9bb('0x74')](this,_0x506919);if(_0xf81938){for(var _0x3e0823 in _0xf81938){if(_0xf81938[_0xd9bb('0x98')](_0x3e0823)){if(_0x3e0823!==_0xd9bb('0xf5')){this[_0xd9bb('0xf')][_0xd9bb('0xa2')](util[_0xd9bb('0x57')](_0xd9bb('0xf6'),_0x3e0823[_0xd9bb('0x6c')]()),_0xf81938[_0x3e0823]);}}}this['createSquareMessage'](_0xf81938[_0xd9bb('0xea')],_0xd9bb('0xeb'),'dialogflowV2',_0xf81938[_0xd9bb('0xf5')]);return this['channel']['noop'](util[_0xd9bb('0x57')](_0xd9bb('0xf7'),_0xf81938[_0xd9bb('0xea')]));}return this[_0xd9bb('0xf')]['error'](_0x506919,_0xd9bb('0xf8'));};AGIVertices['prototype']['sesteknda']=function(_0x2cd7eb){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x2cd7eb[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x2cd7eb[_0xd9bb('0xf9')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xfa'));}if(!this[_0xd9bb('0x87')](_0x2cd7eb['username'])){return this['channel'][_0xd9bb('0xac')](_0xd9bb('0xfb'));}if(!this[_0xd9bb('0x87')](_0x2cd7eb[_0xd9bb('0xfc')])){return this['channel']['noop'](_0xd9bb('0xfd'));}if(!this[_0xd9bb('0x87')](_0x2cd7eb['ndassistant_url'])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0xad'));}this[_0xd9bb('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x2cd7eb);this['createSquareMessage'](_0x2cd7eb[_0xd9bb('0x5f')],'in','','');this[_0xd9bb('0xf')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x2cd7eb['text']));var _0x4ea0a8=this[_0xd9bb('0x82')][_0xd9bb('0x74')](this,_0x2cd7eb);if(_0x4ea0a8){for(var _0x4176ca in _0x4ea0a8){if(_0x4ea0a8[_0xd9bb('0x98')](_0x4176ca)){this[_0xd9bb('0xf')]['setVariable'](util['format']('SESTEK_NDA_%s',_0x4176ca[_0xd9bb('0x6c')]()),_0x4ea0a8[_0x4176ca]);}}this[_0xd9bb('0x43')](_0x4ea0a8[_0xd9bb('0xea')],_0xd9bb('0xeb'),_0xd9bb('0xfe'),'');if(_0x4ea0a8[_0xd9bb('0xff')]){this['channel'][_0xd9bb('0xac')](util['format'](_0xd9bb('0x100'),_0x4ea0a8[_0xd9bb('0xff')]));var _0x415ded=this[_0xd9bb('0xf')][_0xd9bb('0x101')](_0x4ea0a8[_0xd9bb('0xff')]);try{fs['unlink'](_0x4ea0a8[_0xd9bb('0xff')]+_0xd9bb('0x102'));}catch(_0x573b35){logger[_0xd9bb('0x2d')](_0x573b35);}return _0x415ded;}else{return this[_0xd9bb('0xf')]['noop'](util['format'](_0xd9bb('0x103'),_0x4ea0a8[_0xd9bb('0xea')]));}}return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x2cd7eb,_0xd9bb('0x104'));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x105')]=function(_0x11d157){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x106'),_0x11d157[_0xd9bb('0x38')]));return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x105'));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x107')]=function(_0x337e8a){logger['info'](util['format'](_0xd9bb('0x108'),_0x337e8a['label']));var _0x175117='';if(_0x337e8a['trunk_id']){if(!this['isConfigured'](_0x337e8a[_0xd9bb('0x109')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x337e8a,'no\x20trunk\x20selected');}else{var _0x1f75b7=parseInt(_0x337e8a[_0xd9bb('0x109')],0xa);if(isNaN(_0x1f75b7)){_0x175117=_0x337e8a[_0xd9bb('0x109')];}else{_0x175117=this[_0xd9bb('0x10a')]['sync'](this,_0x337e8a[_0xd9bb('0x109')]);if(!_0x175117){return this[_0xd9bb('0xf')]['error'](_0x337e8a,_0xd9bb('0x10b'));}}}}else if(_0x337e8a['trunk_name']){_0x175117=_0x337e8a[_0xd9bb('0x10c')];}else{return this['channel'][_0xd9bb('0x2d')](_0x337e8a,_0xd9bb('0x10d'));}var _0x14397c=this[_0xd9bb('0xf')][_0xd9bb('0x59')](_0xd9bb('0xe6'),[util[_0xd9bb('0x57')](_0xd9bb('0x10e'),_0x175117,_0x337e8a['phone']),_0x337e8a[_0xd9bb('0x67')],_0x337e8a['opts'],_0x337e8a[_0xd9bb('0x65')]]);if(_0x14397c['result']===-0x1){return _0x14397c;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0xe5'),_0xd9bb('0xe6')));};AGIVertices['prototype'][_0xd9bb('0x10f')]=function(_0x50bf94){logger['info'](util[_0xd9bb('0x57')](_0xd9bb('0x110'),_0x50bf94['label']));return this['channel'][_0xd9bb('0xac')]('finally');};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xd')]=function(_0x4c8e38){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4c8e38['label']));if(_0x4c8e38[_0xd9bb('0xa9')]===0x0){return this[_0xd9bb('0xa8')](_0x4c8e38);}_0x4c8e38[_0xd9bb('0xa9')]-=0x1;if(!this[_0xd9bb('0x87')](_0x4c8e38[_0xd9bb('0x111')])){return this[_0xd9bb('0xf')]['error'](_0x4c8e38,_0xd9bb('0x112'));}var _0x41607e=this['getSound'][_0xd9bb('0x74')](this,_0x4c8e38[_0xd9bb('0x111')]);if(!_0x41607e){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x4c8e38,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x4c8e38[_0xd9bb('0xdd')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0xd9bb('0xde'));}var _0x51014c=this[_0xd9bb('0xf')][_0xd9bb('0x113')](_0x41607e,_0x4c8e38['response'],_0x4c8e38[_0xd9bb('0x114')]);var _0x272c93=_0x51014c[_0xd9bb('0xaf')]?_0x51014c['result'][_0xd9bb('0x4e')]():'';logger[_0xd9bb('0x2f')](_0xd9bb('0x115'),JSON[_0xd9bb('0x77')](_0x51014c));if(_0x51014c['result']===-0x1){this[_0xd9bb('0x36')]['sync'](this,_0x4c8e38,_0x272c93);return _0x51014c;}else if(_0x51014c[_0xd9bb('0xa6')]===_0xd9bb('0x67')){_0x51014c[_0xd9bb('0xaf')]=_0x272c93[_0xd9bb('0x9f')]>=parseInt(_0x4c8e38['mindigit'])?'x':'i';}else{_0x51014c[_0xd9bb('0xaf')]=_0x272c93[_0xd9bb('0x9f')]>=parseInt(_0x4c8e38['mindigit'])&&_0x272c93[_0xd9bb('0x9f')]<=parseInt(_0x4c8e38['maxdigit'])?'x':'i';}var _0x2fa3be=this[_0xd9bb('0xa5')][_0xd9bb('0x74')](this,_0x4c8e38['variable_id']);if(!_0x2fa3be){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x4c8e38,_0xd9bb('0x116'));}this[_0xd9bb('0xf')][_0xd9bb('0xa2')](_0x2fa3be,_0x272c93);if(this[_0xd9bb('0x87')](_0x4c8e38[_0xd9bb('0x117')])){var _0x9264ef=parseInt(_0x4c8e38[_0xd9bb('0x117')],0xa);var _0x450c85=rs['generate']({'charset':'*','length':_0x9264ef});var _0x521a2c=_0x272c93[_0xd9bb('0x9f')];if(_0x521a2c>0x0){if(_0x521a2c>_0x9264ef){this['createSquareDetailsReport'][_0xd9bb('0x74')](this,_0x4c8e38,_0x4c8e38[_0xd9bb('0x118')]==='first'?_0x450c85+_0x272c93[_0xd9bb('0x119')](_0x9264ef):_0x272c93[_0xd9bb('0x119')](0x0,_0x521a2c-_0x9264ef)+_0x450c85);}else{this[_0xd9bb('0x36')]['sync'](this,_0x4c8e38,rs[_0xd9bb('0x11a')]({'charset':'*','length':_0x521a2c}));}}else{this[_0xd9bb('0x36')]['sync'](this,_0x4c8e38,'');}}else{this['createSquareDetailsReport'][_0xd9bb('0x74')](this,_0x4c8e38,_0x272c93);}return _0x51014c;};AGIVertices['prototype']['getsecretdigits']=function(_0x17d0b2){logger['info'](util[_0xd9bb('0x57')](_0xd9bb('0x11b'),_0x17d0b2[_0xd9bb('0x38')]));return this['getdigits'](_0x17d0b2);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x11c')]=function(_0x1fbc1a){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x11d'),_0x1fbc1a[_0xd9bb('0x38')]));this[_0xd9bb('0x36')][_0xd9bb('0x74')](this,_0x1fbc1a,_0x1fbc1a[_0xd9bb('0x11e')]);return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x11f'),_0x1fbc1a[_0xd9bb('0x11e')]));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x120')]=function(_0x25e913){logger['info'](util[_0xd9bb('0x57')](_0xd9bb('0x121'),_0x25e913[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x25e913[_0xd9bb('0x8a')])||!this[_0xd9bb('0x87')](_0x25e913[_0xd9bb('0x8b')])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0x122'));}if(!this[_0xd9bb('0x87')](_0x25e913['text'])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xad'));}this['channel']['noop'](util['format']('Trying\x20aws\x20Polly\x20%s',_0x25e913[_0xd9bb('0x5f')]));var _0x317b0f=this[_0xd9bb('0x89')][_0xd9bb('0x74')](this,_0x25e913);if(_0x317b0f){this[_0xd9bb('0xf')]['noop'](util[_0xd9bb('0x57')](_0xd9bb('0x123'),_0x317b0f));var _0x14fb24=this[_0xd9bb('0xf')]['streamFile'](_0x317b0f);try{fs['unlink'](_0x317b0f+_0xd9bb('0x102'));}catch(_0x3c16e6){logger[_0xd9bb('0x2d')](_0x3c16e6);}return _0x14fb24;}return this[_0xd9bb('0xf')]['error'](_0x25e913,_0xd9bb('0x124'));};AGIVertices['prototype']['awslex']=function(_0x5610e3){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5610e3[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x5610e3[_0xd9bb('0x8a')])||!this[_0xd9bb('0x87')](_0x5610e3[_0xd9bb('0x8b')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x122'));}if(!this[_0xd9bb('0x87')](_0x5610e3[_0xd9bb('0x90')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x125'));}if(!this['isConfigured'](_0x5610e3[_0xd9bb('0x5f')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')]('no\x20text\x20configured');}this[_0xd9bb('0xf')][_0xd9bb('0x126')]=!![];this[_0xd9bb('0x36')](_0x5610e3);this[_0xd9bb('0x43')](_0x5610e3[_0xd9bb('0x5f')],'in','','');this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0x127'),_0x5610e3['text']));var _0x18f6fa=this[_0xd9bb('0x8f')][_0xd9bb('0x74')](this,_0x5610e3);if(_0x18f6fa){for(var _0x346d13 in _0x18f6fa){if(_0x18f6fa[_0xd9bb('0x98')](_0x346d13)&&_[_0xd9bb('0x99')](_0x18f6fa[_0x346d13])){this[_0xd9bb('0xf')][_0xd9bb('0xa2')](util['format'](_0xd9bb('0x128'),_0x346d13[_0xd9bb('0x6c')]()),_0x18f6fa[_0x346d13]);}}if(_['isNil'](_0x18f6fa['message'])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x129'));}else{this['createSquareMessage'](_0x18f6fa[_0xd9bb('0x7a')],_0xd9bb('0xeb'),_0xd9bb('0x12a'),'');return this['channel'][_0xd9bb('0xac')](util['format'](_0xd9bb('0x12b'),_0x18f6fa['message']));}}return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x5610e3,_0xd9bb('0x12c'));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x12d')]=function(_0x1782ba){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x12e'),_0x1782ba['label'],_0x1782ba['timeout']));if(!this[_0xd9bb('0x87')](_0x1782ba[_0xd9bb('0x7e')])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0x12f'));}var _0x536683=_0xd9bb('0x130');var _0x30e2d6=util['format'](_0xd9bb('0x131'),FILES_PATH,rs['generate'](0x4));var _0xf2da1c=util[_0xd9bb('0x57')](_0xd9bb('0xa0'),_0x30e2d6,_0x536683);var _0x340e12=!![];if(_0x1782ba[_0xd9bb('0x132')]===_0xd9bb('0x133')){_0x340e12=![];}var _0x5deb3c=this[_0xd9bb('0xf')]['recordFile'](_0x30e2d6,_0x536683,_0x1782ba[_0xd9bb('0x134')],_0x1782ba['timeout'],undefined,_0x340e12);if(_0x5deb3c[_0xd9bb('0xaf')]!==-0x1){this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x135'),_0xf2da1c));var _0x4dce64=this['googleASR'][_0xd9bb('0x74')](this,_0x1782ba,_0xf2da1c);if(_0x4dce64){for(var _0x4d4dbf in _0x4dce64){if(_0x4dce64[_0xd9bb('0x98')](_0x4d4dbf)){this['channel'][_0xd9bb('0xa2')](util[_0xd9bb('0x57')](_0xd9bb('0x136'),_0x4d4dbf[_0xd9bb('0x6c')]()),_0x4dce64[_0x4d4dbf]);}}return this['channel'][_0xd9bb('0xac')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xd9bb('0x77')](_0x4dce64)));}}return _0x5deb3c;};AGIVertices[_0xd9bb('0x12')]['tildeasr']=function(_0x21b5a1){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x137'),_0x21b5a1['label']));if(!this[_0xd9bb('0x87')](_0x21b5a1[_0xd9bb('0x94')])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0x138'));}if(!this[_0xd9bb('0x87')](_0x21b5a1[_0xd9bb('0x95')])){return this['channel'][_0xd9bb('0xac')](_0xd9bb('0x139'));}var _0x506354=_0xd9bb('0x130');var _0x230e98=util[_0xd9bb('0x57')](_0xd9bb('0x131'),FILES_PATH,rs['generate'](0x4));var _0x35d4d0=util[_0xd9bb('0x57')](_0xd9bb('0xa0'),_0x230e98,_0x506354);var _0x2783b6=!![];if(_0x21b5a1[_0xd9bb('0x132')]===_0xd9bb('0x133')){_0x2783b6=![];}var _0x57855f=this[_0xd9bb('0xf')][_0xd9bb('0x13a')](_0x230e98,_0x506354,_0x21b5a1[_0xd9bb('0x134')],_0x21b5a1['timeout'],undefined,_0x2783b6);if(_0x57855f['result']!==-0x1){this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x13b'),_0x35d4d0));var _0x265cc1=this[_0xd9bb('0x93')][_0xd9bb('0x74')](this,_0x21b5a1,_0x35d4d0);if(_0x265cc1){for(var _0x460746 in _0x265cc1){if(_0x265cc1[_0xd9bb('0x98')](_0x460746)){this[_0xd9bb('0xf')]['setVariable'](util[_0xd9bb('0x57')]('TILDE_ASR_%s',_0x460746[_0xd9bb('0x6c')]()),_0x265cc1[_0x460746]);}}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x13c'),JSON[_0xd9bb('0x77')](_0x265cc1)));}}return _0x57855f;};AGIVertices[_0xd9bb('0x12')]['gotoc']=function(_0xb3f1f3){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0xb3f1f3[_0xd9bb('0x38')]));return this['channel']['continueAt'](_0xb3f1f3[_0xd9bb('0x3d')],_0xb3f1f3[_0xd9bb('0x3e')],_0xb3f1f3['priority']);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x13d')]=function(_0x2754d8){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2754d8[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x2754d8['condition'])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x2754d8,_0xd9bb('0x13e'));}try{var _0x1af23d=eval(_0x2754d8[_0xd9bb('0x13f')])?_0xd9bb('0x140'):_0xd9bb('0x141');this[_0xd9bb('0xf')]['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x2754d8[_0xd9bb('0x13f')],_0x1af23d));return{'code':0xc8,'result':_0x1af23d};}catch(_0x4f170d){return{'code':0xc8,'result':_0xd9bb('0x141')};}};AGIVertices['prototype'][_0xd9bb('0x142')]=function(_0x21e9f0){logger[_0xd9bb('0x2f')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x21e9f0[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x21e9f0[_0xd9bb('0x143')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x21e9f0,_0xd9bb('0x144'));}var _0x1b439c=this[_0xd9bb('0x25')][_0xd9bb('0x74')](this,_0x21e9f0[_0xd9bb('0x143')]);if(!_0x1b439c){return this['channel'][_0xd9bb('0x2d')](_0x21e9f0,_0xd9bb('0x145'));}for(var _0x341b61=0x0;_0x341b61<_0x1b439c[_0xd9bb('0x9f')];_0x341b61+=0x1){var _0x18857d=this[_0xd9bb('0xf')][_0xd9bb('0xa5')](util['format']('IFTIME(%s?true:false)',_0x1b439c[_0x341b61]));if(_0x18857d['result']===-0x1){return _0x18857d;}logger['info'](util[_0xd9bb('0x57')]('IFTIME\x20%s\x20%s',_0x1b439c[_0x341b61],_0x18857d[_0xd9bb('0xa6')]));if(_0x18857d[_0xd9bb('0xa6')]===_0xd9bb('0x140')){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('IFTIME\x20%s\x20%s',_0x1b439c[_0x341b61],_0xd9bb('0x140')));this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x146'),_0x1b439c[_0x341b61],'true'));return{'code':0xc8,'result':_0xd9bb('0x140')};}else{logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x146'),_0x1b439c[_0x341b61],_0xd9bb('0x141')));this['channel']['noop'](util['format'](_0xd9bb('0x146'),_0x1b439c[_0x341b61],_0xd9bb('0x141')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x147')]=function(_0x272f29){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x272f29[_0xd9bb('0x38')]));return this[_0xd9bb('0xf')][_0xd9bb('0x147')]();};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x148')]=function(_0x52f469){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x52f469[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x52f469[_0xd9bb('0x7e')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x12f'));}var _0x44f259=_0xd9bb('0x130');var _0x5ab9bc=util[_0xd9bb('0x57')]('%s/recordings/%s',FILES_PATH,rs[_0xd9bb('0x11a')](0x4));var _0x5f2a35=util[_0xd9bb('0x57')](_0xd9bb('0xa0'),_0x5ab9bc,_0x44f259);var _0x59301b=!![];if(_0x52f469[_0xd9bb('0x132')]==='NOBEEP'){_0x59301b=![];}var _0x38377f=this[_0xd9bb('0xf')]['recordFile'](_0x5ab9bc,_0x44f259,_0x52f469['intKey'],_0x52f469[_0xd9bb('0x67')],undefined,_0x59301b);if(_0x38377f['result']!==-0x1){this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0x149'),_0x5f2a35));var _0x479894=this['ispeechASR'][_0xd9bb('0x74')](this,_0x52f469,_0x5f2a35);if(_0x479894){for(var _0x263522 in _0x479894){if(_0x479894[_0xd9bb('0x98')](_0x263522)){this['channel']['setVariable'](util['format']('ISPEECH_ASR_%s',_0x263522[_0xd9bb('0x6c')]()),_0x479894[_0x263522]);}}return this[_0xd9bb('0xf')]['noop'](util[_0xd9bb('0x57')](_0xd9bb('0x14a'),JSON[_0xd9bb('0x77')](_0x479894)));}}return _0x38377f;};AGIVertices['prototype'][_0xd9bb('0x14b')]=function(_0x522aca){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x14c'),_0x522aca['label']));if(!this[_0xd9bb('0x87')](_0x522aca[_0xd9bb('0x7e')])){return this['channel'][_0xd9bb('0xac')](_0xd9bb('0x12f'));}if(!this['isConfigured'](_0x522aca[_0xd9bb('0x5f')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xad'));}this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x14d'),_0x522aca['text']));var _0x2998e0=this['ispeechTTS'][_0xd9bb('0x74')](this,_0x522aca);if(_0x2998e0){this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x149'),_0x2998e0));var _0x5e9159=this[_0xd9bb('0xf')]['streamFile'](_0x2998e0,_0x522aca[_0xd9bb('0x134')]);try{fs['unlink'](_0x2998e0+_0xd9bb('0x102'));}catch(_0xf039cd){logger[_0xd9bb('0x2d')](_0xf039cd);}return _0x5e9159;}return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x522aca,_0xd9bb('0x14e'));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x14f')]=function(_0x52a741){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x150'),_0x52a741[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x52a741[_0xd9bb('0x151')])){return this['channel'][_0xd9bb('0x2d')](_0x52a741,_0xd9bb('0x152'));}logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x153'),this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x52a741['findBy']));var _0x3c347f=this[_0xd9bb('0x55')][_0xd9bb('0x74')](this,_0x52a741[_0xd9bb('0x151')]);if(_0x3c347f){logger['info'](util[_0xd9bb('0x57')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x52a741[_0xd9bb('0x151')]));this['channel']['noop'](util[_0xd9bb('0x57')](_0xd9bb('0x154'),this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x52a741[_0xd9bb('0x151')]));return{'code':0xc8,'result':_0xd9bb('0x155')};}else{logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x156'),this['channel'][_0xd9bb('0x3b')],_0x52a741[_0xd9bb('0x151')]));this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0x156'),this['channel'][_0xd9bb('0x3b')],_0x52a741[_0xd9bb('0x151')]));return{'code':0xc8,'result':_0xd9bb('0x157')};}};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x158')]=function(_0x8911f3){logger['info'](util[_0xd9bb('0x57')](_0xd9bb('0x159'),_0x8911f3[_0xd9bb('0x38')]));if(!this['isConfigured'](_0x8911f3['findBy'])){return this[_0xd9bb('0xf')]['error'](_0x8911f3,'no\x20find\x20by\x20configured');}logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x8911f3[_0xd9bb('0x151')]));var _0x598970=this['agentLogout'][_0xd9bb('0x74')](this,_0x8911f3[_0xd9bb('0x151')]);if(_0x598970){logger['info'](util['format'](_0xd9bb('0x154'),this[_0xd9bb('0xf')]['callerid'],_0x8911f3['findBy']));this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x154'),this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x8911f3['findBy']));return{'code':0xc8,'result':_0xd9bb('0x155')};}else{logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x156'),this[_0xd9bb('0xf')]['callerid'],_0x8911f3[_0xd9bb('0x151')]));this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x8911f3['findBy']));return{'code':0xc8,'result':_0xd9bb('0x157')};}};AGIVertices[_0xd9bb('0x12')]['math']=function(_0x571d84){logger[_0xd9bb('0x2f')](util['format'](_0xd9bb('0x15a'),_0x571d84[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x571d84['operation'])){return this['channel'][_0xd9bb('0x2d')](_0x571d84,_0xd9bb('0x15b'));}this['channel'][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x15c'),_0x571d84['operation']));var _0x5c9b03=eval(_0x571d84[_0xd9bb('0x15d')]);if(!this['isConfigured'](_0x571d84['variable_id'])){return this['channel']['noop'](_0xd9bb('0xde'));}var _0x9320db=this[_0xd9bb('0xa5')][_0xd9bb('0x74')](this,_0x571d84[_0xd9bb('0xdd')]);if(!_0x9320db){return this[_0xd9bb('0xf')]['error'](_0x571d84,'no\x20variable\x20found');}if(_['isArray'](_0x5c9b03)){var _0x396028=this;_0x5c9b03[_0xd9bb('0x15e')](function(_0x4c5e56,_0x10763e){_0x396028['channel'][_0xd9bb('0xa2')](util[_0xd9bb('0x57')](_0xd9bb('0x15f'),_0x9320db,_0x10763e),_0x4c5e56);});return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x160'),_0x9320db));}else{return this[_0xd9bb('0xf')][_0xd9bb('0xa2')](_0x9320db,_0x5c9b03);}};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xc')]=function(_0x3d3e46){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x3d3e46[_0xd9bb('0x38')]));if(_0x3d3e46[_0xd9bb('0xa9')]===0x0){return this[_0xd9bb('0xa8')](_0x3d3e46);}_0x3d3e46[_0xd9bb('0xa9')]-=0x1;if(!this['isConfigured'](_0x3d3e46[_0xd9bb('0x111')])){return this['channel'][_0xd9bb('0x2d')](_0x3d3e46,_0xd9bb('0x112'));}var _0x1a8eaa=this[_0xd9bb('0x1f')][_0xd9bb('0x74')](this,_0x3d3e46[_0xd9bb('0x111')]);if(!_0x1a8eaa){return this['channel'][_0xd9bb('0x2d')](_0x3d3e46,_0xd9bb('0x161'));}var _0xde499d=this[_0xd9bb('0xf')][_0xd9bb('0x113')](_0x1a8eaa,_0x3d3e46[_0xd9bb('0x162')],_0x3d3e46[_0xd9bb('0x163')]);var _0x27677b=_0xde499d[_0xd9bb('0xaf')];if(_0xde499d[_0xd9bb('0xaf')]===-0x1){this[_0xd9bb('0x36')]['sync'](this,_0x3d3e46,'-1');return _0xde499d;}else if(_0xde499d[_0xd9bb('0xa6')]==='timeout'){_0xde499d[_0xd9bb('0xaf')]=_0xde499d[_0xd9bb('0xaf')]['length']>0x0?_0xde499d[_0xd9bb('0xaf')]:'t';}else if(_[_0xd9bb('0x45')](_0xde499d[_0xd9bb('0xaf')])){_0xde499d[_0xd9bb('0xaf')]='#';_0x27677b='#';}if(!this[_0xd9bb('0x87')](_0x3d3e46[_0xd9bb('0xdd')])){this[_0xd9bb('0xf')][_0xd9bb('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2db3db=this[_0xd9bb('0xa5')][_0xd9bb('0x74')](this,_0x3d3e46[_0xd9bb('0xdd')]);if(!_0x2db3db){return this[_0xd9bb('0xf')]['error'](_0x3d3e46,_0xd9bb('0x116'));}this[_0xd9bb('0xf')][_0xd9bb('0xa2')](_0x2db3db,_0x27677b);}this[_0xd9bb('0x36')]['sync'](this,_0x3d3e46,_0x27677b);return _0xde499d;};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0xac')]=function(_0x7ea461){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x164'),_0x7ea461[_0xd9bb('0x38')]));return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0x7ea461[_0xd9bb('0x165')]||_0x7ea461[_0xd9bb('0x38')]);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x166')]=function(_0x6b12d6){logger[_0xd9bb('0x2f')](util['format'](_0xd9bb('0x167'),_0x6b12d6[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x6b12d6[_0xd9bb('0x151')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x6b12d6,'no\x20find\x20by\x20configured');}logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x6b12d6[_0xd9bb('0x151')]));var _0x4c8ea7=this[_0xd9bb('0x50')][_0xd9bb('0x74')](this,_0x6b12d6['pause_id']);var _0x3e71fe=this[_0xd9bb('0x52')]['sync'](this,_0x6b12d6[_0xd9bb('0x151')],_0x4c8ea7);if(_0x3e71fe){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x154'),this['channel'][_0xd9bb('0x3b')],_0x6b12d6[_0xd9bb('0x151')]));this['channel']['noop'](util[_0xd9bb('0x57')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x6b12d6[_0xd9bb('0x151')]));return{'code':0xc8,'result':_0xd9bb('0x155')};}else{logger['info'](util[_0xd9bb('0x57')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x6b12d6[_0xd9bb('0x151')]));this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0x154'),this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x6b12d6[_0xd9bb('0x151')]));return{'code':0xc8,'result':_0xd9bb('0x157')};}};AGIVertices[_0xd9bb('0x12')]['playback']=function(_0x954761){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x168'),_0x954761['label']));if(!this[_0xd9bb('0x87')](_0x954761['file_id'])){return this['channel'][_0xd9bb('0x2d')](_0x954761,_0xd9bb('0x112'));}var _0x179c26=this[_0xd9bb('0x1f')][_0xd9bb('0x74')](this,_0x954761[_0xd9bb('0x111')]);if(!_0x179c26){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x954761,_0xd9bb('0x161'));}var _0x471efd=this[_0xd9bb('0xf')][_0xd9bb('0x59')](_0xd9bb('0x169'),[_0x179c26,_0x954761[_0xd9bb('0x16a')]]);if(_0x471efd[_0xd9bb('0xaf')]===-0x1){return _0x471efd;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0x16b'),'PLAYBACK',_0x179c26));};AGIVertices['prototype']['queue']=function(_0x3e5bc3){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x16c'),_0x3e5bc3['label']));if(!this[_0xd9bb('0x87')](_0x3e5bc3['queue_id'])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x3e5bc3,_0xd9bb('0x16d'));}var _0x11d4d7='';var _0x40caa9=parseInt(_0x3e5bc3[_0xd9bb('0x16e')],0xa);if(isNaN(_0x40caa9)){_0x11d4d7=_0x3e5bc3[_0xd9bb('0x16e')];}else{_0x11d4d7=this[_0xd9bb('0x17')][_0xd9bb('0x74')](this,_0x3e5bc3[_0xd9bb('0x16e')]);if(!_0x11d4d7){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x3e5bc3,_0xd9bb('0x16f'));}}var _0x30d4dd='';if(this[_0xd9bb('0x87')](_0x3e5bc3[_0xd9bb('0x111')])){var _0x5c4dc0=this[_0xd9bb('0x1f')]['sync'](this,_0x3e5bc3[_0xd9bb('0x111')]);if(_0x5c4dc0){_0x30d4dd=_0x5c4dc0;}}this['createSquareDetailsReport'][_0xd9bb('0x74')](this,_0x3e5bc3,_0x11d4d7);if(_0x3e5bc3[_0xd9bb('0x16a')][_0xd9bb('0x170')]('x')<0x0){_0x3e5bc3[_0xd9bb('0x16a')]+='x';}if(_0x3e5bc3[_0xd9bb('0x16a')]['indexOf']('X')<0x0){_0x3e5bc3[_0xd9bb('0x16a')]+='X';}this[_0xd9bb('0xf')][_0xd9bb('0xa2')](_0xd9bb('0x171'),_0x11d4d7?_0x11d4d7[_0xd9bb('0x172')]():'');var _0x51e3f6=this['channel'][_0xd9bb('0x59')](_0xd9bb('0x173'),[_0x11d4d7,_0x3e5bc3['opts'],_0x3e5bc3['url'],_0x30d4dd,_0x3e5bc3[_0xd9bb('0x67')],_0x3e5bc3[_0xd9bb('0x8')],_0x3e5bc3[_0xd9bb('0x174')],_0x3e5bc3[_0xd9bb('0x175')],'',_0x3e5bc3[_0xd9bb('0x176')]]);if(_0x51e3f6[_0xd9bb('0xaf')]===-0x1){return _0x51e3f6;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x16b'),_0xd9bb('0x173'),_0x11d4d7));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x177')]=function(_0x5be0e6){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x178'),_0x5be0e6['label']));var _0x178f21=_0x5be0e6['recordingFormat']||_0xd9bb('0x130');var _0x34adac=util[_0xd9bb('0x57')](_0xd9bb('0x179'),this[_0xd9bb('0xf')][_0xd9bb('0x37')],rs[_0xd9bb('0x11a')](0x5));var _0x430768=util[_0xd9bb('0x57')](_0xd9bb('0x17a'),FILES_PATH,_0x34adac,_0x178f21);var _0x1edcdc=util[_0xd9bb('0x57')](_0xd9bb('0x131'),FILES_PATH,_0x34adac);this['createSquareRecording'][_0xd9bb('0x74')](this,_0x5be0e6,_0x34adac,_0x430768);this[_0xd9bb('0xf')][_0xd9bb('0xa2')](_0xd9bb('0x17b'),_0x34adac);logger[_0xd9bb('0x2f')](_0xd9bb('0x17c'),_0x1edcdc,_0x178f21,_0x5be0e6[_0xd9bb('0x17d')],_0x5be0e6[_0xd9bb('0x67')]);return this['channel'][_0xd9bb('0x13a')](_0x1edcdc,_0x178f21,_0x5be0e6['escape_digits'],_0x5be0e6['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xd9bb('0x17e')]=function(_0x3a76fd){logger[_0xd9bb('0x2f')](util['format'](_0xd9bb('0x17f'),_0x3a76fd['label']));if(!this['isConfigured'](_0x3a76fd[_0xd9bb('0x65')])){return this['channel']['noop'](_0xd9bb('0x180'));}var _0x90e63e=this[_0xd9bb('0x64')][_0xd9bb('0x74')](this,_0x3a76fd);logger['info'](util['format'](_0xd9bb('0x181'),util[_0xd9bb('0x182')](_0x90e63e,{'showHidden':![],'depth':null})));if(!this[_0xd9bb('0x87')](_0x3a76fd['variable_id'])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x183'));}var _0x127013=this[_0xd9bb('0xa5')]['sync'](this,_0x3a76fd['variable_id']);if(!_0x127013){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x3a76fd,_0xd9bb('0x116'));}this[_0xd9bb('0xf')][_0xd9bb('0xa2')](util[_0xd9bb('0x57')](_0xd9bb('0x184'),_0x127013),_0x90e63e[_0xd9bb('0x185')]?_0x90e63e['statusCode']:_0xd9bb('0x186'));this[_0xd9bb('0xf')][_0xd9bb('0xa2')](util[_0xd9bb('0x57')](_0xd9bb('0x187'),_0x127013),_0x90e63e[_0xd9bb('0x79')]?_0x90e63e[_0xd9bb('0x79')]:'OK');if(_0x90e63e['body']){try{this[_0xd9bb('0xa1')](_0x90e63e[_0xd9bb('0x6d')],_0x127013);}catch(_0x228b26){logger[_0xd9bb('0x2d')](util[_0xd9bb('0x57')](_0xd9bb('0x188'),_0x127013));}}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0xe1'),_0x127013));};AGIVertices['prototype'][_0xd9bb('0x189')]=function(_0x548732){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x18a'),_0x548732[_0xd9bb('0x38')]));return this['channel']['sayDigits'](_0x548732[_0xd9bb('0x18b')]['replace'](/\s+/g,''),_0x548732['escape_digits']);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x18c')]=function(_0x26afac){logger['info'](util[_0xd9bb('0x57')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x26afac['label']));return this[_0xd9bb('0xf')][_0xd9bb('0x18d')](_0x26afac['number'][_0xd9bb('0x5b')](/\s+/g,''),_0x26afac[_0xd9bb('0x17d')]);};AGIVertices[_0xd9bb('0x12')]['sayphonetic']=function(_0x4849ac){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x18e'),_0x4849ac[_0xd9bb('0x38')]));return this[_0xd9bb('0xf')][_0xd9bb('0x18f')](_0x4849ac['text'],_0x4849ac[_0xd9bb('0x17d')]);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x190')]=function(_0x29e63f){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x191'),_0x29e63f['label']));if(!this['isConfigured'](_0x29e63f[_0xd9bb('0x192')])){return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0x193'));}var _0x13176a=this[_0xd9bb('0x23')][_0xd9bb('0x74')](this,_0x29e63f[_0xd9bb('0x192')]);if(!_0x13176a||!_0x13176a[_0xd9bb('0x194')]){return this['channel'][_0xd9bb('0x2d')](_0x29e63f,_0xd9bb('0x195'));}var _0x51ba92={'from':util['format'](_0xd9bb('0x196'),_0x13176a[_0xd9bb('0x15')],_0x13176a[_0xd9bb('0x197')]||_0x13176a[_0xd9bb('0x194')]['user']),'to':_0x29e63f['to']||'','cc':_0x29e63f['cc']||'','bcc':_0x29e63f['bcc']||'','subject':_0x29e63f[_0xd9bb('0x198')],'html':_0x29e63f[_0xd9bb('0x5f')],'text':_0x29e63f['text']};var _0x2cfaa1={'tls':{'rejectUnauthorized':![]}};if(_0x13176a[_0xd9bb('0x194')][_0xd9bb('0x199')]){_0x2cfaa1[_0xd9bb('0x199')]=_0x13176a[_0xd9bb('0x194')][_0xd9bb('0x199')];}else{_0x2cfaa1[_0xd9bb('0x19a')]=_0x13176a[_0xd9bb('0x194')]['host'];_0x2cfaa1[_0xd9bb('0x19b')]=_0x13176a[_0xd9bb('0x194')]['port'];_0x2cfaa1[_0xd9bb('0x19c')]=_0x13176a['Smtp']['secure'];}if(_0x13176a['Smtp']['authentication']){_0x2cfaa1[_0xd9bb('0x19d')]={'user':_0x13176a[_0xd9bb('0x194')][_0xd9bb('0x19e')],'pass':_0x13176a[_0xd9bb('0x194')][_0xd9bb('0x19f')]};}if(this['isConfigured'](_0x29e63f[_0xd9bb('0x1a0')])){}logger[_0xd9bb('0xe2')](_0xd9bb('0x1a1'),JSON[_0xd9bb('0x77')](_0x51ba92));this[_0xd9bb('0x36')][_0xd9bb('0x74')](this,_0x29e63f,_0x29e63f[_0xd9bb('0x192')]);this['channel'][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x1a2'),_0x13176a['name']));this[_0xd9bb('0x24')][_0xd9bb('0x74')](this,_0x2cfaa1,_0x51ba92);return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x1a3'));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x1a4')]=function(_0x37f99c){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x1a5'),_0x37f99c[_0xd9bb('0x38')]));return this[_0xd9bb('0xf')][_0xd9bb('0xac')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x1a6')]=function(_0x5c9c24){logger[_0xd9bb('0x2f')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5c9c24['label']));if(!this[_0xd9bb('0x87')](_0x5c9c24[_0xd9bb('0x1a7')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x1a8'));}var _0x32d2d0=this[_0xd9bb('0x33')][_0xd9bb('0x74')](this,_0x5c9c24['sms_account_id']);if(!_0x32d2d0){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x5c9c24,_0xd9bb('0x1a9'));}var _0x4ba419={'body':_0x5c9c24[_0xd9bb('0x1aa')],'phone':_0x5c9c24['to']||'','SmsAccountId':_0x32d2d0['id']};logger[_0xd9bb('0xe2')]('sendSMS\x20message',JSON[_0xd9bb('0x77')](_0x4ba419));this[_0xd9bb('0x36')][_0xd9bb('0x74')](this,_0x5c9c24,_0x5c9c24[_0xd9bb('0x1a7')]);this['channel'][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x1ab'),_0x32d2d0[_0xd9bb('0x15')]));this[_0xd9bb('0x35')][_0xd9bb('0x74')](this,_0x4ba419);return this[_0xd9bb('0xf')]['noop'](_0xd9bb('0x1ac'));};AGIVertices['prototype'][_0xd9bb('0x1ad')]=function(_0x48870d){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x1ae'),_0x48870d[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x48870d['variable_id'])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x48870d,_0xd9bb('0x1af'));}var _0x3b115d=this[_0xd9bb('0xa5')]['sync'](this,_0x48870d[_0xd9bb('0xdd')]);if(!_0x3b115d){return this['channel'][_0xd9bb('0x2d')](_0x48870d,_0xd9bb('0x116'));}return this[_0xd9bb('0xf')]['setVariable'](_0x3b115d,_0x48870d[_0xd9bb('0x1b0')]);};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x1b1')]=function(_0x5b125){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x1b2'),_0x5b125[_0xd9bb('0x38')]));this[_0xd9bb('0xf')][_0xd9bb('0xac')]('START\x20CALLY\x20SQUARE');if(_0x5b125[_0xd9bb('0xbe')]==='yes'){this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0x1b3'));return this[_0xd9bb('0xf')][_0xd9bb('0xbe')]();}return this[_0xd9bb('0xf')][_0xd9bb('0xac')]('Skipped\x20Answer');};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x1b4')]=function(_0x1f25ea){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')](_0xd9bb('0x1b5'),_0x1f25ea[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x1f25ea[_0xd9bb('0x1b6')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x1f25ea,_0xd9bb('0x1b7'));}var _0x1e3f06=this['getSquareProject'][_0xd9bb('0x74')](this,_0x1f25ea[_0xd9bb('0x1b6')]);if(!this[_0xd9bb('0x87')](_0x1e3f06)){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x1f25ea,util['format'](_0xd9bb('0x1b8'),_0x1f25ea['project_id']));}if(_0x1e3f06===this[_0xd9bb('0xf')][_0xd9bb('0x3a')]){return this['channel'][_0xd9bb('0x2d')](_0x1f25ea,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xd9bb('0x36')]['sync'](this,_0x1f25ea,_0x1e3f06);var _0x54b566=this[_0xd9bb('0xf')]['exec']('AGI',util[_0xd9bb('0x57')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0xd9bb('0x19a')]||_0xd9bb('0x1b9'),_0x1e3f06,this['channel'][_0xd9bb('0x3a')]));if(_0x54b566[_0xd9bb('0xaf')]===-0x1){return _0x54b566;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')]('Executed\x20command\x20%s\x20%s',_0xd9bb('0x1ba'),_0x1e3f06));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x1bb')]=function(_0x6b30f8){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x6b30f8[_0xd9bb('0x38')]));var _0x54d78b=this[_0xd9bb('0x1bc')][_0xd9bb('0x74')](this,_0x6b30f8[_0xd9bb('0xbc')]);this[_0xd9bb('0x36')][_0xd9bb('0x74')](this,_0x6b30f8,_0x6b30f8['command']);if(this[_0xd9bb('0x87')](_0x6b30f8[_0xd9bb('0xdd')])){var _0x39c868=this[_0xd9bb('0xa5')][_0xd9bb('0x74')](this,_0x6b30f8[_0xd9bb('0xdd')]);if(_0x39c868){this['channel'][_0xd9bb('0xa2')](_0x39c868,_0x54d78b);return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format'](_0xd9bb('0x1bd'),_0x6b30f8['command'],_0x39c868));}}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x6b30f8[_0xd9bb('0xbc')]));};AGIVertices['prototype'][_0xd9bb('0x1be')]=function(_0x59de9c){logger['info'](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x59de9c[_0xd9bb('0x38')]));_0x59de9c[_0xd9bb('0x5f')]=_0x59de9c[_0xd9bb('0x5f')][_0xd9bb('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x59de9c[_0xd9bb('0x5d')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')]('no\x20apiKey\x20configured');}if(!this[_0xd9bb('0x87')](_0x59de9c[_0xd9bb('0x5f')])){return this[_0xd9bb('0xf')][_0xd9bb('0xac')](_0xd9bb('0xad'));}this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x1bf'),_0x59de9c['text']));var _0x13d896=this[_0xd9bb('0x5c')][_0xd9bb('0x74')](this,_0x59de9c);if(_0x13d896){this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x1c0'),_0x13d896));var _0x238ff2=this['channel']['streamFile'](_0x13d896);try{fs['unlink'](_0x13d896+'.wav');}catch(_0x3f8920){logger[_0xd9bb('0x2d')](_0x3f8920);}return _0x238ff2;}return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x59de9c,_0xd9bb('0x1c1'));};AGIVertices[_0xd9bb('0x12')]['tts']=function(_0x26c29e){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x26c29e[_0xd9bb('0x38')]));_0x26c29e[_0xd9bb('0x5f')]=_0x26c29e['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x26c29e[_0xd9bb('0x5f')])){return this['channel'][_0xd9bb('0xac')](_0xd9bb('0xad'));}this['channel'][_0xd9bb('0xac')](util['format'](_0xd9bb('0x1c2'),_0x26c29e[_0xd9bb('0x5f')]));var _0x5e262d=this[_0xd9bb('0x1c3')][_0xd9bb('0x74')](this,_0x26c29e);if(_0x5e262d){this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x1c4'),_0x5e262d));var _0x76e14d=this[_0xd9bb('0xf')][_0xd9bb('0x101')](_0x5e262d);try{fs[_0xd9bb('0x1c5')](_0x5e262d+_0xd9bb('0x102'));}catch(_0x11b0d1){logger[_0xd9bb('0x2d')](_0x11b0d1);}return _0x76e14d;}return this[_0xd9bb('0xf')]['error'](_0x26c29e,_0xd9bb('0x1c6'));};AGIVertices[_0xd9bb('0x12')][_0xd9bb('0x1c7')]=function(_0x231572){logger[_0xd9bb('0x2f')](util['format'](_0xd9bb('0x1c8'),_0x231572[_0xd9bb('0x38')]));if(!this[_0xd9bb('0x87')](_0x231572[_0xd9bb('0x151')])){return this['channel'][_0xd9bb('0x2d')](_0x231572,_0xd9bb('0x152'));}logger[_0xd9bb('0x2f')](util['format'](_0xd9bb('0x153'),this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x231572[_0xd9bb('0x151')]));var _0x1618c2=this[_0xd9bb('0x53')][_0xd9bb('0x74')](this,_0x231572['findBy']);if(_0x1618c2){logger['info'](util[_0xd9bb('0x57')](_0xd9bb('0x154'),this[_0xd9bb('0xf')]['callerid'],_0x231572[_0xd9bb('0x151')]));this[_0xd9bb('0xf')]['noop'](util[_0xd9bb('0x57')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd9bb('0xf')][_0xd9bb('0x3b')],_0x231572[_0xd9bb('0x151')]));return{'code':0xc8,'result':_0xd9bb('0x155')};}else{logger['info'](util[_0xd9bb('0x57')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd9bb('0x3b')],_0x231572[_0xd9bb('0x151')]));this['channel'][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x156'),this['channel'][_0xd9bb('0x3b')],_0x231572[_0xd9bb('0x151')]));return{'code':0xc8,'result':_0xd9bb('0x157')};}};AGIVertices['prototype'][_0xd9bb('0x1c9')]=function(_0x5f178a){logger['info'](util[_0xd9bb('0x57')](_0xd9bb('0x1ca'),_0x5f178a[_0xd9bb('0x38')]));var _0x41e7a4=this['channel'][_0xd9bb('0x59')](_0xd9bb('0x1cb'),[_0x5f178a[_0xd9bb('0x1cc')],_0x5f178a[_0xd9bb('0x7c')]]);if(_0x41e7a4[_0xd9bb('0xaf')]===-0x1){return _0x41e7a4;}return this[_0xd9bb('0xf')][_0xd9bb('0xac')](util[_0xd9bb('0x57')](_0xd9bb('0x16b'),'VOICEMAIL',_0x5f178a[_0xd9bb('0x1cc')]));};AGIVertices[_0xd9bb('0x12')]['vswitch']=function(_0x1d9ddd){logger[_0xd9bb('0x2f')](util[_0xd9bb('0x57')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x1d9ddd['label']));if(!this['isConfigured'](_0x1d9ddd[_0xd9bb('0xdd')])){return this[_0xd9bb('0xf')][_0xd9bb('0x2d')](_0x1d9ddd,_0xd9bb('0x1af'));}var _0x5b29b6=this['getVariable'][_0xd9bb('0x74')](this,_0x1d9ddd['variable_id']);if(!_0x5b29b6){return this[_0xd9bb('0xf')]['error'](_0x1d9ddd,_0xd9bb('0x116'));}var _0x2895b9=this['channel'][_0xd9bb('0xa5')](_0x5b29b6);return{'code':0xc8,'result':_0x2895b9[_0xd9bb('0xa6')]?_0x2895b9[_0xd9bb('0xa6')]:'-'};};String['prototype']['replaceAll']=function(_0x420139,_0x3e6e99){return this[_0xd9bb('0xa3')](_0x420139)['join'](_0x3e6e99);};module[_0xd9bb('0x1cd')]=AGIVertices;
\ No newline at end of file
+var _0xbc8a=['Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','%s/recordings/%s','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','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','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','agi','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','replace','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','authentication','auth','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','Sms\x20message\x20added\x20to\x20outgoing\x20process','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','split','join','exports','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariableById','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','name','isNil','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentLogout','internal','LOCAL','shellCommand','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','exec','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','dialogflowV2','DialogflowV2\x20is\x20unreachable'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xbc8a,0xd3));var _0xabc8=function(_0x391507,_0x564142){_0x391507=_0x391507-0x0;var _0x47fdc4=_0xbc8a[_0x391507];return _0x47fdc4;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xabc8('0x0'));var _=require(_0xabc8('0x1'));var sh=require(_0xabc8('0x2'));var odbc=require(_0xabc8('0x3'))();var rs=require('randomstring');var moment=require(_0xabc8('0x4'));var Mustache=require(_0xabc8('0x5'));var rp=require(_0xabc8('0x6'));var logger=require('../../config/logger')('agi');var config=require(_0xabc8('0x7'));var scripts=require(_0xabc8('0x8'));var FILES_PATH=_0xabc8('0x9');var recursiveMapAttributes=['rawHeaders',_0xabc8('0xa')];var verticesWithRetry=[_0xabc8('0xb'),_0xabc8('0xc'),'getsecretdigits'];var AGIVertices=function(_0x3d3fed,_0x350823,_0x54b972){this[_0xabc8('0xd')]=_0x3d3fed;this[_0xabc8('0xe')]=_0x350823;this[_0xabc8('0xf')]=_0x54b972;};AGIVertices[_0xabc8('0x10')]['getVariable']=function(_0x3ecf47,_0x3d63c9){this[_0xabc8('0xe')][_0xabc8('0x11')](_0x3ecf47)['then'](function(_0x3bdaa9){_0x3d63c9(null,_0x3bdaa9?_0x3bdaa9['name']:![]);})[_0xabc8('0x12')](function(_0x206098){_0x3d63c9(_0x206098);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x13')]=function(_0x4ae773,_0x5377e9){this[_0xabc8('0xe')][_0xabc8('0x14')](_0x4ae773)[_0xabc8('0x15')](function(_0x1be401){_0x5377e9(null,_0x1be401?_0x1be401['name']:![]);})[_0xabc8('0x12')](function(_0x546b5c){_0x5377e9(_0x546b5c);});};AGIVertices['prototype'][_0xabc8('0x16')]=function(_0x41bbf4,_0x44edc3){this[_0xabc8('0xe')][_0xabc8('0x17')](_0x41bbf4)[_0xabc8('0x15')](function(_0x130993){_0x44edc3(null,_0x130993?_0x130993['name']:![]);})['catch'](function(_0x46802d){_0x44edc3(_0x46802d);});};AGIVertices['prototype'][_0xabc8('0x18')]=function(_0x8b7cea,_0x58dea0){this[_0xabc8('0xe')][_0xabc8('0x19')](_0x8b7cea)['then'](function(_0x1cd099){_0x58dea0(null,_0x1cd099?_0x1cd099[_0xabc8('0x1a')]:![]);})[_0xabc8('0x12')](function(_0x14a549){_0x58dea0(_0x14a549);});};AGIVertices['prototype'][_0xabc8('0x1b')]=function(_0x46f374,_0x3e46dd){this[_0xabc8('0xe')][_0xabc8('0x1c')](_0x46f374)['then'](function(_0x5f58de){_0x3e46dd(null,_0x5f58de?_0x5f58de['name']:![]);})[_0xabc8('0x12')](function(_0x2e3fbb){_0x3e46dd(_0x2e3fbb);});};AGIVertices[_0xabc8('0x10')]['getTrunk']=function(_0x476a08,_0x315b74){this['rpc'][_0xabc8('0x1d')](_0x476a08)[_0xabc8('0x15')](function(_0x33addb){_0x315b74(null,_0x33addb?_0x33addb['name']:![]);})['catch'](function(_0x2c10c0){_0x315b74(_0x2c10c0);});};AGIVertices[_0xabc8('0x10')]['getSound']=function(_0x4b63bd,_0x27ebc5){var _0xbab531=this;this['rpc']['getSoundById'](_0x4b63bd)[_0xabc8('0x15')](function(_0x18300e){_0x27ebc5(null,_0x18300e?_0xbab531['getSoundPath'](_0x18300e[_0xabc8('0x1e')]):![]);})[_0xabc8('0x12')](function(_0x2b0e2a){_0x27ebc5(_0x2b0e2a);});};AGIVertices[_0xabc8('0x10')]['getMailAccount']=function(_0x5b1fc5,_0x21b8aa){this[_0xabc8('0xe')][_0xabc8('0x1f')](_0x5b1fc5)[_0xabc8('0x15')](function(_0x27f4c7){_0x21b8aa(null,_0x27f4c7?_0x27f4c7:![]);})[_0xabc8('0x12')](function(_0x222d27){_0x21b8aa(_0x222d27);});};AGIVertices['prototype']['sendMailMessage']=function(_0x235681,_0x204459,_0x36eccd){this[_0xabc8('0xf')][_0xabc8('0x20')](_0x235681,_0x204459)['then'](function(){_0x36eccd(null);})[_0xabc8('0x12')](function(_0x1a744a){_0x36eccd(_0x1a744a);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x21')]=function(_0x4dab24,_0x1ee2cb){this[_0xabc8('0xe')][_0xabc8('0x22')](_0x4dab24)[_0xabc8('0x15')](function(_0x2699d6){if(_0x2699d6){if(_0x2699d6[_0xabc8('0x23')]){_0x1ee2cb(null,[_0x2699d6[_0xabc8('0x24')]]);}else{_0x1ee2cb(null,_[_0xabc8('0x25')](_0x2699d6[_0xabc8('0x26')],_0xabc8('0x24')));}}else{_0x1ee2cb(null,![]);}})[_0xabc8('0x12')](function(_0x591a6a){_0x1ee2cb(_0x591a6a);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x27')]=function(_0x2281f2){return util[_0xabc8('0x28')](_0xabc8('0x29'),FILES_PATH,_0x2281f2);};AGIVertices[_0xabc8('0x10')][_0xabc8('0x2a')]=function(_0x1efba3,_0x1aad5,_0x577940){odbc[_0xabc8('0x2b')](_0x1efba3,function(_0x511cf2){if(_0x511cf2){logger[_0xabc8('0x2c')](_0xabc8('0x2d'),_0x511cf2);_0x577940(_0x511cf2);}else{logger[_0xabc8('0x2e')](_0xabc8('0x2f'));odbc[_0xabc8('0x30')](_0x1aad5,function(_0x2b300b,_0x3066e4){if(_0x2b300b){logger['info']('Error\x20executing\x20query\x20%s',_0x1aad5);_0x577940(_0x2b300b);}else{logger[_0xabc8('0x2e')](_0xabc8('0x31'),_0x1aad5);odbc[_0xabc8('0x32')](function(_0x422964){if(_0x422964){logger[_0xabc8('0x2c')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x422964);}_0x577940(null,_0x3066e4);});}});}});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x33')]=function(_0x55f3f3,_0x221cff){this[_0xabc8('0xe')][_0xabc8('0x34')](_0x55f3f3)['then'](function(_0x8bb8bf){_0x221cff(null,_0x8bb8bf?_0x8bb8bf:![]);})[_0xabc8('0x12')](function(_0x251609){_0x221cff(_0x251609);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x35')]=function(_0x216823,_0x4d919c){this[_0xabc8('0xe')]['createSmsMessage'](_0x216823)[_0xabc8('0x15')](function(_0x1234c4){_0x4d919c(null,_0x1234c4);})[_0xabc8('0x12')](function(_0x1f8a93){_0x4d919c(_0x1f8a93);});};AGIVertices['prototype'][_0xabc8('0x36')]=function(_0x3870c0,_0x5bc137,_0x18bf65){this[_0xabc8('0xe')][_0xabc8('0x36')]({'uniqueid':this[_0xabc8('0xd')][_0xabc8('0x37')],'node':_0x3870c0[_0xabc8('0x38')],'application':_0x3870c0[_0xabc8('0x39')],'data':_0x5bc137||null,'project_name':this[_0xabc8('0xd')][_0xabc8('0x3a')],'callerid':this['channel'][_0xabc8('0x3b')]})[_0xabc8('0x15')](function(_0x138b81){if(_0x18bf65){_0x18bf65(null,_0x138b81);}})[_0xabc8('0x12')](function(_0x3b61de){if(_0x18bf65){_0x18bf65(_0x3b61de);}});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x3c')]=function(_0x2858fa,_0x4c159c,_0x4215f2,_0x404038){this[_0xabc8('0xe')][_0xabc8('0x3c')]({'uniqueid':this[_0xabc8('0xd')][_0xabc8('0x37')],'callerid':this[_0xabc8('0xd')][_0xabc8('0x3b')],'calleridname':this[_0xabc8('0xd')][_0xabc8('0x3d')],'context':this[_0xabc8('0xd')][_0xabc8('0x3e')],'extension':this[_0xabc8('0xd')][_0xabc8('0x3f')],'priority':this[_0xabc8('0xd')]['priority'],'accountcode':this[_0xabc8('0xd')][_0xabc8('0x40')],'dnid':this[_0xabc8('0xd')][_0xabc8('0x41')],'projectName':this['channel']['arg_1'],'saveName':_0x4c159c,'filename':_0x2858fa[_0xabc8('0x42')]||_0x4c159c,'savePath':_0x4215f2})['then'](function(_0x22ff85){_0x404038(null,_0x22ff85);})[_0xabc8('0x12')](function(_0x516082){_0x404038(_0x516082);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x43')]=function(_0xc1be8b,_0x40046a,_0x367018,_0x16a7d2,_0x292811){this[_0xabc8('0xe')][_0xabc8('0x43')]({'uniqueid':this[_0xabc8('0xd')][_0xabc8('0x37')],'body':_0xc1be8b,'direction':_0x40046a,'providerName':_0x367018,'providerResponse':_0x16a7d2})[_0xabc8('0x15')](function(_0x576049){if(_0x292811){_0x292811(null,_0x576049);}})[_0xabc8('0x12')](function(_0x4f067a){if(_0x292811){_0x292811(_0x4f067a);}});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x44')]=function(_0x22474f,_0x1bb880){this['rpc'][_0xabc8('0x44')]({'firstName':_[_0xabc8('0x45')](_0x22474f[_0xabc8('0x46')])||_[_0xabc8('0x47')](_0x22474f[_0xabc8('0x46')])?'callback_'+Math[_0xabc8('0x48')]():_0x22474f[_0xabc8('0x46')],'lastName':_['isEmpty'](_0x22474f[_0xabc8('0x49')])||_['isNil'](_0x22474f[_0xabc8('0x49')])?null:_0x22474f[_0xabc8('0x49')],'phone':_0x22474f[_0xabc8('0x4a')],'ListId':_0x22474f['list_id'],'scheduledat':_0x22474f[_0xabc8('0x4b')],'callbackUniqueid':this[_0xabc8('0xd')][_0xabc8('0x37')],'tags':_0xabc8('0x4c'),'description':_0xabc8('0x4d')+_0x22474f[_0xabc8('0x4b')][_0xabc8('0x4e')](),'priority':_0x22474f[_0xabc8('0x4f')]})[_0xabc8('0x15')](function(_0xbda8ba){_0x1bb880(null,_0xbda8ba);})[_0xabc8('0x12')](function(_0x212282){_0x1bb880(_0x212282);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x50')]=function(_0x4b4264,_0x59eb25){this[_0xabc8('0xe')][_0xabc8('0x51')](_0x4b4264)[_0xabc8('0x15')](function(_0x1b6ed7){_0x59eb25(null,_0x1b6ed7?_0x1b6ed7['name']:![]);})[_0xabc8('0x12')](function(_0x5e900e){_0x59eb25(_0x5e900e);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x52')]=function(_0x3a4448,_0x2c59fa,_0x381817){var _0x298af3={'role':_0xabc8('0x53')};_0x298af3[_0x3a4448]=this[_0xabc8('0xd')][_0xabc8('0x3b')];this[_0xabc8('0xe')][_0xabc8('0x52')](_0x298af3,_0x2c59fa,this[_0xabc8('0xd')]['uniqueid'])['then'](function(_0x5358b4){_0x381817(null,_['isNil'](_0x5358b4)?![]:!![]);})['catch'](function(_0x2ca6bc){logger[_0xabc8('0x2c')](_0x2ca6bc);_0x381817(null,![]);});};AGIVertices[_0xabc8('0x10')]['agentUnpause']=function(_0x50b012,_0x5caba6){var _0x45a4bd={'role':_0xabc8('0x53')};_0x45a4bd[_0x50b012]=this['channel'][_0xabc8('0x3b')];this['rpc']['agentUnpause'](_0x45a4bd)[_0xabc8('0x15')](function(_0x2b9f00){_0x5caba6(null,_[_0xabc8('0x47')](_0x2b9f00)?![]:!![]);})['catch'](function(_0x49c351){logger['error'](_0x49c351);_0x5caba6(null,![]);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x54')]=function(_0x495249,_0x31c9fe){var _0x34fbfe={'role':_0xabc8('0x53')};_0x34fbfe[_0x495249]=this[_0xabc8('0xd')]['callerid'];this[_0xabc8('0xe')][_0xabc8('0x54')](_0x34fbfe)[_0xabc8('0x15')](function(_0x38ca96){_0x31c9fe(null,_[_0xabc8('0x47')](_0x38ca96)?![]:!![]);})[_0xabc8('0x12')](function(_0x176ed9){logger['error'](_0x176ed9);_0x31c9fe(null,![]);});};AGIVertices[_0xabc8('0x10')]['agentLogin']=function(_0x147d1e,_0x7de75f){var _0x316868={'role':_0xabc8('0x53')};_0x316868[_0x147d1e]=this[_0xabc8('0xd')]['callerid'];var _0x8b0b43=_0x147d1e!=_0xabc8('0x55')?util[_0xabc8('0x28')]('%s/%s@from-sip/n',_0xabc8('0x56'),this[_0xabc8('0xd')][_0xabc8('0x3b')]):undefined;this[_0xabc8('0xe')]['agentLogin'](_0x316868,_0x8b0b43)[_0xabc8('0x15')](function(_0x9c136d){_0x7de75f(null,_[_0xabc8('0x47')](_0x9c136d)?![]:!![]);})['catch'](function(_0x12e4fd){logger['error'](_0x12e4fd);_0x7de75f(null,![]);});};AGIVertices['prototype'][_0xabc8('0x57')]=function(_0x55049d,_0x1162b5){sh['exec'](_[_0xabc8('0x58')](_0x55049d),function(_0x41ecce,_0x3307f2){var _0x1dcfda=_0x3307f2['replace'](/(\r\n|\n|\r)/gm,'');_0x1162b5(null,_0x1dcfda);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x59')]=function(_0x2f40e9,_0x4ba574){scripts[_0xabc8('0x59')](_0x2f40e9[_0xabc8('0x5a')],_0x2f40e9[_0xabc8('0x5b')]||_0xabc8('0x5c'),_0x2f40e9['text'],_0x2f40e9[_0xabc8('0x5d')]||_0xabc8('0x5e'),_0x2f40e9[_0xabc8('0x5f')]||_0xabc8('0x60'),_0x2f40e9[_0xabc8('0x61')]||_0xabc8('0x62'))[_0xabc8('0x15')](function(_0xe622e5){_0x4ba574(null,_0xe622e5);})[_0xabc8('0x12')](function(_0x8a07d5){_0x4ba574(_0x8a07d5);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x63')]=function(_0x52cdaf,_0x250013){scripts[_0xabc8('0x63')](_0x52cdaf[_0xabc8('0x5c')],_0x52cdaf[_0xabc8('0x64')]||'en',0x1)[_0xabc8('0x15')](function(_0x2d3780){_0x250013(null,_0x2d3780);})['catch'](function(_0x3f3728){_0x250013(_0x3f3728);});};AGIVertices[_0xabc8('0x10')]['restAPI']=function(_0x2013b9,_0x3183c5){var _0x2c5e26={'uri':_0x2013b9[_0xabc8('0x65')],'method':_0x2013b9[_0xabc8('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2013b9['timeout'])===_0xabc8('0x67')&&parseInt(_0x2013b9[_0xabc8('0x68')])>=0x1?parseInt(_0x2013b9['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xabc8('0x69')]([_0xabc8('0x6a'),_0xabc8('0x6b')],_0x2c5e26['method'][_0xabc8('0x6c')]())){try{_0x2c5e26[_0xabc8('0x6d')]=_0x2013b9[_0xabc8('0xa')]?JSON[_0xabc8('0x6e')](_0x2013b9[_0xabc8('0xa')]):{};}catch(_0x41a1a4){logger[_0xabc8('0x2c')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x41a1a4);}}try{_0x2c5e26[_0xabc8('0x6f')]=_0x2013b9[_0xabc8('0x70')]?JSON[_0xabc8('0x6e')](_0x2013b9[_0xabc8('0x70')]):{};}catch(_0x458d1c){logger['error'](_0xabc8('0x71'),_0x458d1c);}if(_0x2013b9[_0xabc8('0x72')]){try{var _0x5cd057=require(_0x2013b9[_0xabc8('0x72')])[_0xabc8('0x73')](this,_0x2c5e26);_0x2c5e26[_0xabc8('0x74')]=Mustache[_0xabc8('0x75')](_0x2013b9['url'],_0x5cd057,{},['$$','$$']);if(_0x2c5e26[_0xabc8('0x6f')]){_0x2c5e26['headers']=JSON[_0xabc8('0x6e')](Mustache[_0xabc8('0x75')](JSON['stringify'](_0x2c5e26[_0xabc8('0x6f')]),_0x5cd057,{},['$$','$$']));}if(_0x2c5e26[_0xabc8('0x6d')]){_0x2c5e26['body']=JSON[_0xabc8('0x6e')](Mustache['render'](JSON[_0xabc8('0x76')](_0x2c5e26['body']),_0x5cd057,{},['$$','$$']));}}catch(_0x332e5a){logger['error'](_0xabc8('0x77'),_0x332e5a);}}rp(_0x2c5e26)[_0xabc8('0x15')](function(_0x186a44){var _0x305bd6={'statusCode':_0x186a44[_0xabc8('0x78')]||0xc8,'statusMessage':_0x186a44[_0xabc8('0x79')]||'OK','headers':_0x186a44[_0xabc8('0x6f')]||{},'body':_0x186a44[_0xabc8('0x6d')]||{}};_0x3183c5(null,_0x305bd6);})['catch'](function(_0x3f97f5){var _0x58cc18={'statusCode':_0x3f97f5[_0xabc8('0x78')]||0x1f4,'statusMessage':_0x3f97f5['message']||_0xabc8('0x7a'),'headers':_0x3f97f5[_0xabc8('0x7b')][_0xabc8('0x6f')]||{},'body':_0x3f97f5[_0xabc8('0x7b')]['body']||{}};_0x3183c5(null,_0x58cc18);});};AGIVertices['prototype'][_0xabc8('0x7c')]=function(_0x10e81c,_0x38133c){scripts[_0xabc8('0x7c')](this[_0xabc8('0xd')][_0xabc8('0x37')],_0x10e81c[_0xabc8('0x7d')],_0x10e81c[_0xabc8('0x5c')],_0x10e81c[_0xabc8('0x7e')]||'en')[_0xabc8('0x15')](function(_0xa8071f){_0x38133c(null,_0xa8071f);})['catch'](function(_0x5770b6){_0x38133c(_0x5770b6);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x7f')]=function(_0x24101c,_0x38d995){scripts['googleDialogflowV2'](this[_0xabc8('0xd')][_0xabc8('0x37')],_0x24101c[_0xabc8('0x80')],_0x24101c[_0xabc8('0x81')],_0x24101c[_0xabc8('0x82')],_0x24101c['text'],_0x24101c['dialogflowV2_language']||'en')[_0xabc8('0x15')](function(_0x5f2798){_0x38d995(null,_0x5f2798);})[_0xabc8('0x12')](function(_0x21a17d){_0x38d995(_0x21a17d);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x83')]=function(_0x4e38e4,_0x59012e){scripts['sestekNDA'](this[_0xabc8('0xd')],_0x4e38e4)[_0xabc8('0x15')](function(_0x19e198){_0x59012e(null,_0x19e198);})[_0xabc8('0x12')](function(_0x361de8){_0x59012e(_0x361de8);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x84')]=function(_0x4e9f7c,_0x28f8bc){scripts[_0xabc8('0x84')](_0x4e9f7c['key'],_0x4e9f7c[_0xabc8('0x5c')],_0x4e9f7c['ispeech_tts_language']||_0xabc8('0x5e'),_0x4e9f7c[_0xabc8('0x85')])[_0xabc8('0x15')](function(_0x4ad78b){_0x28f8bc(null,_0x4ad78b);})[_0xabc8('0x12')](function(_0x93c7e4){_0x28f8bc(_0x93c7e4);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x86')]=function(_0x11cdc1,_0x40da92,_0x1f5ae4){scripts[_0xabc8('0x86')](_0x40da92,_0x11cdc1['key'],_0x11cdc1[_0xabc8('0x87')]||_0xabc8('0x5e'),this[_0xabc8('0x88')](_0x11cdc1[_0xabc8('0x89')])?_0x11cdc1['model']:undefined)[_0xabc8('0x15')](function(_0x422ef3){_0x1f5ae4(null,_0x422ef3);})[_0xabc8('0x12')](function(_0xac54d1){_0x1f5ae4(_0xac54d1);});};AGIVertices['prototype'][_0xabc8('0x8a')]=function(_0x4beeae,_0x41065e){scripts[_0xabc8('0x8a')](_0x4beeae[_0xabc8('0x8b')],_0x4beeae[_0xabc8('0x8c')],_0x4beeae[_0xabc8('0x8d')],_0x4beeae[_0xabc8('0x8e')]||_0xabc8('0x8f'),_0x4beeae['text'],_0x4beeae[_0xabc8('0x90')]||_0xabc8('0x5c'))[_0xabc8('0x15')](function(_0x2619dc){_0x41065e(null,_0x2619dc);})[_0xabc8('0x12')](function(_0xe806af){_0x41065e(_0xe806af);});};AGIVertices['prototype'][_0xabc8('0x91')]=function(_0x326269,_0x515ee3){scripts[_0xabc8('0x91')](this[_0xabc8('0xd')][_0xabc8('0x37')],_0x326269[_0xabc8('0x8b')],_0x326269[_0xabc8('0x8c')],_0x326269['aws_lex_region'],_0x326269[_0xabc8('0x5c')],_0x326269[_0xabc8('0x92')])[_0xabc8('0x15')](function(_0x1693a2){_0x515ee3(null,_0x1693a2);})[_0xabc8('0x12')](function(_0x15a320){_0x515ee3(_0x15a320);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x93')]=function(_0x218108,_0x3dce64,_0x59c5fd){scripts[_0xabc8('0x93')](_0x3dce64,_0x218108[_0xabc8('0x7d')],_0x218108[_0xabc8('0x94')]||_0xabc8('0x5e'))[_0xabc8('0x15')](function(_0x5704d9){_0x59c5fd(null,_0x5704d9);})[_0xabc8('0x12')](function(_0x2f7416){_0x59c5fd(_0x2f7416);});};AGIVertices[_0xabc8('0x10')]['tildeASR']=function(_0x316b2f,_0x164753,_0x4b7517){scripts[_0xabc8('0x95')](_0x164753,_0x316b2f['appid'],_0x316b2f['appsecret'],_0x316b2f[_0xabc8('0x74')])['then'](function(_0x49094e){_0x4b7517(null,_0x49094e);})['catch'](function(_0x590083){_0x4b7517(_0x590083);});};AGIVertices[_0xabc8('0x10')][_0xabc8('0x96')]=function(_0x402f8c){var _0x36bd11=_[_0xabc8('0x69')](verticesWithRetry,_0x402f8c[_0xabc8('0x39')])?_0x402f8c:_[_0xabc8('0x97')](_0x402f8c);for(var _0x34b675 in _0x36bd11){if(_0x36bd11[_0xabc8('0x98')](_0x34b675)){if(_0x36bd11[_0x34b675]&&_['isString'](_0x36bd11[_0x34b675])){if(_[_0xabc8('0x69')](recursiveMapAttributes,_0x34b675)){_0x36bd11[_0x34b675]=this[_0xabc8('0x99')](_0x36bd11[_0x34b675]);}else{_0x36bd11[_0x34b675]=this['replaceAllVariables'](_0x36bd11[_0x34b675]);}}}}return _0x36bd11;};AGIVertices['prototype'][_0xabc8('0x9a')]=function(_0x522f1f){for(var _0x174cde in _0x522f1f){if(_0x522f1f[_0xabc8('0x98')](_0x174cde)){if(_[_0xabc8('0x9b')](_0x522f1f[_0x174cde])){this[_0xabc8('0x9a')](_0x522f1f[_0x174cde]);}else if(_[_0xabc8('0x9c')](_0x522f1f[_0x174cde])){for(var _0x57347b=0x0;_0x57347b<_0x522f1f[_0x174cde][_0xabc8('0x9d')];_0x57347b++){this[_0xabc8('0x9a')](_0x522f1f[_0x174cde][_0x57347b]);}}else if(_[_0xabc8('0x9e')](_0x522f1f[_0x174cde])){_0x522f1f[_0x174cde]=this[_0xabc8('0x9f')](_0x522f1f[_0x174cde]);}}}};AGIVertices[_0xabc8('0x10')]['saveRestApiResult']=function(_0x18d7c6,_0x161d63){for(var _0x3e88b3 in _0x18d7c6){if(_0x18d7c6[_0xabc8('0x98')](_0x3e88b3)){if(_[_0xabc8('0x9b')](_0x18d7c6[_0x3e88b3])){if(!_['isEmpty'](_0x18d7c6[_0x3e88b3])){this[_0xabc8('0xa0')](_0x18d7c6[_0x3e88b3],util['format'](_0xabc8('0xa1'),_0x161d63,_0x3e88b3));}}else if(_[_0xabc8('0x9c')](_0x18d7c6[_0x3e88b3])){for(var _0x423875=0x0;_0x423875<_0x18d7c6[_0x3e88b3]['length'];_0x423875++){this[_0xabc8('0xa0')](_0x18d7c6[_0x3e88b3][_0x423875],util[_0xabc8('0x28')](_0xabc8('0xa1'),_0x161d63,_0x3e88b3+'['+_0x423875+']'));}}else{if(!_[_0xabc8('0x47')](_0x18d7c6[_0x3e88b3])){this[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0xa1'),_0x161d63,_0x3e88b3),_0x18d7c6[_0x3e88b3]);}}}}};AGIVertices[_0xabc8('0x10')][_0xabc8('0x99')]=function(_0x1e7008){try{var _0x2e90a3=JSON[_0xabc8('0x6e')](_0x1e7008);this[_0xabc8('0x9a')](_0x2e90a3);return JSON[_0xabc8('0x76')](_0x2e90a3);}catch(_0x391b17){return this[_0xabc8('0x9f')](_0x1e7008);}};AGIVertices['prototype'][_0xabc8('0x9f')]=function(_0x4b72f5){var _0x3172d7=_0x4b72f5['split']('{');for(var _0x52f1f1=0x1;_0x52f1f1<_0x3172d7[_0xabc8('0x9d')];_0x52f1f1+=0x1){var _0x1ecbef=_0x3172d7[_0x52f1f1]['split']('}');if(_0x1ecbef['length']>0x1){_0x4b72f5=_0x4b72f5[_0xabc8('0xa3')]('{'+_0x1ecbef[0x0]+'}',this[_0xabc8('0xd')][_0xabc8('0xa4')](_0x1ecbef[0x0])[_0xabc8('0xa5')]||_0x1ecbef[0x0]);}}if(_0x3172d7[_0xabc8('0x9d')]===0x1){return _0x4b72f5['toString']();}return this[_0xabc8('0x9f')](_0x4b72f5);};AGIVertices[_0xabc8('0x10')]['getAndSetVariable']=function(_0x8e9f68,_0x5b12d0){var _0x3fd5c0=this[_0xabc8('0xd')]['getVariable'](_0x8e9f68);if(_0x3fd5c0[_0xabc8('0xa6')]===-0x1){return _0x3fd5c0;}logger['info'](util[_0xabc8('0x28')](_0xabc8('0xa7'),_0x5b12d0,_0x3fd5c0['extra']));return this['channel']['setVariable'](_0x5b12d0,_0x3fd5c0[_0xabc8('0xa5')]);};AGIVertices[_0xabc8('0x10')][_0xabc8('0x88')]=function(_0x392559){return _0x392559&&_0x392559!=='0'&&_0x392559!=='-1'&&_0x392559!=='';};AGIVertices['prototype'][_0xabc8('0xa8')]=function(_0x44edcf){this[_0xabc8('0x36')]['sync'](this,_0x44edcf,'-');_0x44edcf[_0xabc8('0xa9')]=_0x44edcf[_0xabc8('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xabc8('0x10')][_0xabc8('0xaa')]=function(_0x5d6dfc){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0xab'),_0x5d6dfc[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x5d6dfc[_0xabc8('0x5c')])){return this[_0xabc8('0xd')]['noop'](_0xabc8('0xac'));}var _0x520d7b='\x22'+_0x5d6dfc['text']+'\x22';if(this[_0xabc8('0x88')](_0x5d6dfc[_0xabc8('0x7b')])){_0x520d7b+=','+_0x5d6dfc[_0xabc8('0x7b')];}var _0x209bb9=this['channel'][_0xabc8('0xad')]('MRCPSynth',_0x520d7b);if(_0x209bb9[_0xabc8('0xa6')]===-0x1){return _0x209bb9;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xaf'),_0x520d7b));};AGIVertices[_0xabc8('0x10')][_0xabc8('0xb0')]=function(_0x399e6a){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0xb1'),_0x399e6a['label']));if(!this[_0xabc8('0x88')](_0x399e6a[_0xabc8('0xb2')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xb3'));}var _0xe0e731=_0x399e6a[_0xabc8('0xb2')];if(this['isConfigured'](_0x399e6a[_0xabc8('0x7b')])){_0xe0e731+=','+_0x399e6a['options'];}var _0x4ef888=this[_0xabc8('0xd')][_0xabc8('0xad')](_0xabc8('0xb4'),_0xe0e731);if(_0x4ef888[_0xabc8('0xa6')]===-0x1){return _0x4ef888;}var _0x415860=this[_0xabc8('0xb5')](_0xabc8('0xb6'),_0xabc8('0xb7'));if(_0x415860[_0xabc8('0xa6')]===-0x1){return _0x415860;}var _0x5c0308=this['getAndSetVariable']('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x5c0308[_0xabc8('0xa6')]===-0x1){return _0x5c0308;}var _0x26a702=this[_0xabc8('0xb5')](_0xabc8('0xb8'),_0xabc8('0xb9'));if(_0x26a702[_0xabc8('0xa6')]===-0x1){return _0x26a702;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xba'),_0xe0e731));};AGIVertices['prototype']['agi']=function(_0x2302c1){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0xbb'),_0x2302c1['label']));return this[_0xabc8('0xd')]['agi']([_0x2302c1[_0xabc8('0xbc')],_0x2302c1[_0xabc8('0xbd')]]);};AGIVertices[_0xabc8('0x10')]['answer']=function(_0x544c8d){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0xbe'),_0x544c8d[_0xabc8('0x38')]));if(this[_0xabc8('0x88')](_0x544c8d[_0xabc8('0x68')])){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x544c8d[_0xabc8('0x68')]));var _0x32dc8f=this[_0xabc8('0xd')][_0xabc8('0xbf')](_0x544c8d[_0xabc8('0x68')]);if(_0x32dc8f[_0xabc8('0xa6')]===-0x1){return _0x32dc8f;}}return this[_0xabc8('0xd')][_0xabc8('0xc0')]();};AGIVertices['prototype'][_0xabc8('0x4c')]=function(_0x4e13a3){logger['info'](util[_0xabc8('0x28')](_0xabc8('0xc1'),_0x4e13a3[_0xabc8('0x38')]));if(!this['isConfigured'](_0x4e13a3[_0xabc8('0xc2')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x4e13a3,_0xabc8('0xc3'));}_0x4e13a3['scheduledAt']=moment();if(this[_0xabc8('0x88')](_0x4e13a3['delay'])){_0x4e13a3[_0xabc8('0x4b')]=moment()[_0xabc8('0xc4')](_0x4e13a3[_0xabc8('0xc5')],_0xabc8('0xc6'));}if(!this['isConfigured'](_0x4e13a3[_0xabc8('0x4f')])){_0x4e13a3[_0xabc8('0x4f')]=0x2;}this['createCmContact']['sync'](this,_0x4e13a3);return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xc7'),_0x4e13a3['phone'],_0x4e13a3[_0xabc8('0xc2')],_0x4e13a3[_0xabc8('0x4b')]));};AGIVertices[_0xabc8('0x10')][_0xabc8('0xc8')]=function(_0x3436ec){logger[_0xabc8('0x2e')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3436ec[_0xabc8('0x38')]));var _0x103863=this[_0xabc8('0xd')]['exec'](_0x3436ec[_0xabc8('0xc9')],_0x3436ec[_0xabc8('0x7b')]);if(_0x103863[_0xabc8('0xa6')]===-0x1){return _0x103863;}return this['channel'][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xca'),_0x3436ec['application'],_0x3436ec[_0xabc8('0x7b')]));};AGIVertices[_0xabc8('0x10')][_0xabc8('0xcb')]=function(_0x2521e5){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0xcc'),_0x2521e5['label']));if(!this[_0xabc8('0x88')](_0x2521e5[_0xabc8('0x5c')])){return this[_0xabc8('0xd')]['noop']('no\x20text\x20configured');}var _0x1dd1db='\x22'+_0x2521e5[_0xabc8('0x5c')]+'\x22';if(this[_0xabc8('0x88')](_0x2521e5[_0xabc8('0x7b')])){_0x1dd1db+=','+_0x2521e5[_0xabc8('0x7b')];}var _0x8c8e94=this[_0xabc8('0xd')][_0xabc8('0xad')]('MRCPSynth',_0x1dd1db);if(_0x8c8e94[_0xabc8('0xa6')]===-0x1){return _0x8c8e94;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xaf'),_0x1dd1db));};AGIVertices[_0xabc8('0x10')]['sestektts']=function(_0x4562ba){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0xcd'),_0x4562ba[_0xabc8('0x38')]));if(!this['isConfigured'](_0x4562ba['text'])){return this['channel'][_0xabc8('0xae')](_0xabc8('0xac'));}var _0x37a893='\x22'+_0x4562ba['text']+'\x22';if(this[_0xabc8('0x88')](_0x4562ba[_0xabc8('0x7b')])){_0x37a893+=','+_0x4562ba[_0xabc8('0x7b')];}var _0x513eb1=this[_0xabc8('0xd')][_0xabc8('0xad')](_0xabc8('0xce'),_0x37a893);if(_0x513eb1[_0xabc8('0xa6')]===-0x1){return _0x513eb1;}return this['channel'][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xaf'),_0x37a893));};AGIVertices[_0xabc8('0x10')][_0xabc8('0xcf')]=function(_0x33836f){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0xd0'),_0x33836f[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x33836f[_0xabc8('0xb2')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x3a6d63=_0x33836f[_0xabc8('0xb2')];if(this[_0xabc8('0x88')](_0x33836f[_0xabc8('0x7b')])){_0x3a6d63+=','+_0x33836f[_0xabc8('0x7b')];}var _0x810e2=this[_0xabc8('0xd')][_0xabc8('0xad')](_0xabc8('0xb4'),_0x3a6d63);if(_0x810e2['result']===-0x1){return _0x810e2;}var _0x1ac343=this[_0xabc8('0xb5')](_0xabc8('0xb6'),_0xabc8('0xd1'));if(_0x1ac343[_0xabc8('0xa6')]===-0x1){return _0x1ac343;}var _0x3b8625=this['getAndSetVariable'](_0xabc8('0xd2'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3b8625[_0xabc8('0xa6')]===-0x1){return _0x3b8625;}var _0x877b4f=this['getAndSetVariable'](_0xabc8('0xb8'),_0xabc8('0xd3'));if(_0x877b4f['result']===-0x1){return _0x877b4f;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util['format'](_0xabc8('0xba'),_0x3a6d63));};AGIVertices[_0xabc8('0x10')]['sestekasr']=function(_0x480bac){logger['info'](util[_0xabc8('0x28')](_0xabc8('0xd4'),_0x480bac[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x480bac['grammar'])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xb3'));}var _0x18e9c7=_0x480bac[_0xabc8('0xb2')];if(this[_0xabc8('0x88')](_0x480bac[_0xabc8('0x7b')])){_0x18e9c7+=','+_0x480bac['options'];}var _0xbd52da=this[_0xabc8('0xd')][_0xabc8('0xad')](_0xabc8('0xb4'),_0x18e9c7);if(_0xbd52da[_0xabc8('0xa6')]===-0x1){return _0xbd52da;}var _0x4d07e0=this['getAndSetVariable'](_0xabc8('0xb6'),'SESTEK_ASR_CONFIDENCE');if(_0x4d07e0[_0xabc8('0xa6')]===-0x1){return _0x4d07e0;}var _0x3ca66e=this[_0xabc8('0xb5')]('RECOG_INPUT()',_0xabc8('0xd5'));if(_0x3ca66e['result']===-0x1){return _0x3ca66e;}var _0x4d7488=this['getAndSetVariable'](_0xabc8('0xb8'),_0xabc8('0xd6'));if(_0x4d7488[_0xabc8('0xa6')]===-0x1){return _0x4d7488;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x18e9c7));};AGIVertices['prototype'][_0xabc8('0xd7')]=function(_0xbd2071){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0xd8'),_0xbd2071[_0xabc8('0x38')]));if(!this['isConfigured'](_0xbd2071[_0xabc8('0xd9')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0xbd2071,_0xabc8('0xda'));}var _0xb29a55=this[_0xabc8('0x18')][_0xabc8('0x73')](this,_0xbd2071[_0xabc8('0xd9')]);if(!_0xb29a55){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0xbd2071,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0xbd2071[_0xabc8('0x30')])){return this['channel'][_0xabc8('0x2c')](_0xbd2071,_0xabc8('0xdb'));}var _0x1b9d31=_0xbd2071[_0xabc8('0x30')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('query:\x20%s',_0x1b9d31));var _0x1fea6b=this['getQueryOdbc']['sync'](this,_0xb29a55,_0x1b9d31);this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0xbd2071,_0x1b9d31);if(!this['isConfigured'](_0xbd2071[_0xabc8('0xdc')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xdd'));}var _0x4530fc=this[_0xabc8('0xa4')][_0xabc8('0x73')](this,_0xbd2071[_0xabc8('0xdc')]);if(!_0x4530fc){return this[_0xabc8('0xd')]['error'](_0xbd2071,'no\x20variable\x20found');}var _0x380970=this;_0x1fea6b[_0xabc8('0xde')](function(_0x1bffc5,_0x167154){Object[_0xabc8('0xdf')](_0x1bffc5)['forEach'](function(_0x47e979){_0x380970[_0xabc8('0xd')]['setVariable'](util[_0xabc8('0x28')](_0xabc8('0xe0'),_0x4530fc,_0x167154,_0x47e979),_0x1bffc5[_0x47e979]);});});this[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0xe1'),_0x4530fc),_0x1fea6b['length']);return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xe2'),_0x4530fc));};AGIVertices[_0xabc8('0x10')][_0xabc8('0xe3')]=function(_0x52d93b){logger[_0xabc8('0xe4')](util[_0xabc8('0x28')](_0xabc8('0xe5'),_0x52d93b['label']));if(!this[_0xabc8('0x88')](_0x52d93b[_0xabc8('0xe6')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x52d93b,_0xabc8('0xe7'));}var _0x2b7f2c=this[_0xabc8('0x1b')][_0xabc8('0x73')](this,_0x52d93b[_0xabc8('0xe6')]);if(!_0x2b7f2c){return this[_0xabc8('0xd')]['error'](_0x52d93b,_0xabc8('0xe8'));}var _0x23d823=this[_0xabc8('0xd')][_0xabc8('0xad')](_0xabc8('0xe9'),[util[_0xabc8('0x28')](_0xabc8('0xea'),_0x2b7f2c),_0x52d93b[_0xabc8('0x68')],_0x52d93b[_0xabc8('0xeb')],_0x52d93b[_0xabc8('0x65')]]);if(_0x23d823[_0xabc8('0xa6')]===-0x1){return _0x23d823;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('Executed\x20command\x20%s',_0xabc8('0xe9')));};AGIVertices['prototype'][_0xabc8('0xec')]=function(_0x3f388c){logger['info'](util[_0xabc8('0x28')](_0xabc8('0xed'),_0x3f388c['label']));if(!this[_0xabc8('0x88')](_0x3f388c[_0xabc8('0x7d')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xee'));}if(!this[_0xabc8('0x88')](_0x3f388c[_0xabc8('0x5c')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xac'));}this[_0xabc8('0xd')][_0xabc8('0xef')]=!![];this[_0xabc8('0x36')](_0x3f388c);this['createSquareMessage'](_0x3f388c[_0xabc8('0x5c')],'in','','');this[_0xabc8('0xd')][_0xabc8('0xae')](util['format']('Trying\x20Dialogflow:\x20%s',_0x3f388c[_0xabc8('0x5c')]));var _0x2c05be=this['googleDialogflow'][_0xabc8('0x73')](this,_0x3f388c);if(_0x2c05be){for(var _0x5df73e in _0x2c05be){if(_0x2c05be[_0xabc8('0x98')](_0x5df73e)){this[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0xf0'),_0x5df73e[_0xabc8('0x6c')]()),_0x2c05be[_0x5df73e]);}}this[_0xabc8('0x43')](_0x2c05be[_0xabc8('0xf1')],'out','dialogflow','');return this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')]('Dialogflow\x20Result\x20%s',_0x2c05be[_0xabc8('0xf1')]));}return this[_0xabc8('0xd')]['error'](_0x3f388c,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xabc8('0x10')]['dialogflowV2']=function(_0xad0501){logger['info'](util[_0xabc8('0x28')](_0xabc8('0xf2'),_0xad0501[_0xabc8('0x38')]));if(!this['isConfigured'](_0xad0501[_0xabc8('0x80')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xf3'));}if(!this[_0xabc8('0x88')](_0xad0501['client_email'])){return this[_0xabc8('0xd')]['noop'](_0xabc8('0xf4'));}if(!this['isConfigured'](_0xad0501['private_key'])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xf5'));}if(!this[_0xabc8('0x88')](_0xad0501[_0xabc8('0xf6')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xf7'));}if(!this[_0xabc8('0x88')](_0xad0501[_0xabc8('0x5c')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xac'));}this[_0xabc8('0xd')]['bot']=!![];this[_0xabc8('0x36')](_0xad0501);this[_0xabc8('0x43')](_0xad0501[_0xabc8('0x5c')],'in','','');this['channel'][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xf8'),_0xad0501[_0xabc8('0x5c')]));var _0x5d14a3=this[_0xabc8('0x7f')][_0xabc8('0x73')](this,_0xad0501);if(_0x5d14a3){for(var _0x308aa1 in _0x5d14a3){if(_0x5d14a3[_0xabc8('0x98')](_0x308aa1)){if(_0x308aa1!==_0xabc8('0xf9')){this[_0xabc8('0xd')]['setVariable'](util[_0xabc8('0x28')](_0xabc8('0xf0'),_0x308aa1['toUpperCase']()),_0x5d14a3[_0x308aa1]);}}}this[_0xabc8('0x43')](_0x5d14a3[_0xabc8('0xf1')],_0xabc8('0xfa'),_0xabc8('0xfb'),_0x5d14a3[_0xabc8('0xf9')]);return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('DialogflowV2\x20Result\x20%s',_0x5d14a3['speech']));}return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0xad0501,_0xabc8('0xfc'));};AGIVertices[_0xabc8('0x10')]['sesteknda']=function(_0x25abbd){logger['info'](util[_0xabc8('0x28')](_0xabc8('0xfd'),_0x25abbd[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x25abbd['ndauth_url'])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xfe'));}if(!this[_0xabc8('0x88')](_0x25abbd[_0xabc8('0xff')])){return this['channel'][_0xabc8('0xae')](_0xabc8('0x100'));}if(!this['isConfigured'](_0x25abbd[_0xabc8('0x101')])){return this[_0xabc8('0xd')][_0xabc8('0xae')]('no\x20password\x20configured');}if(!this[_0xabc8('0x88')](_0x25abbd[_0xabc8('0x102')])){return this[_0xabc8('0xd')]['noop']('no\x20text\x20configured');}this[_0xabc8('0xd')]['bot']=!![];this[_0xabc8('0x36')](_0x25abbd);this[_0xabc8('0x43')](_0x25abbd['text'],'in','','');this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')](_0xabc8('0x103'),_0x25abbd[_0xabc8('0x5c')]));var _0x1439a5=this[_0xabc8('0x83')]['sync'](this,_0x25abbd);if(_0x1439a5){for(var _0x51cc17 in _0x1439a5){if(_0x1439a5['hasOwnProperty'](_0x51cc17)){this[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0x104'),_0x51cc17[_0xabc8('0x6c')]()),_0x1439a5[_0x51cc17]);}}this[_0xabc8('0x43')](_0x1439a5[_0xabc8('0xf1')],'out','sesteknda','');if(_0x1439a5[_0xabc8('0x105')]){this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x106'),_0x1439a5[_0xabc8('0x105')]));var _0x2481a2=this[_0xabc8('0xd')][_0xabc8('0x107')](_0x1439a5['audiofile']);try{fs['unlink'](_0x1439a5[_0xabc8('0x105')]+_0xabc8('0x108'));}catch(_0x4b7def){logger['error'](_0x4b7def);}return _0x2481a2;}else{return this[_0xabc8('0xd')][_0xabc8('0xae')](util['format'](_0xabc8('0x109'),_0x1439a5[_0xabc8('0xf1')]));}}return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x25abbd,_0xabc8('0x10a'));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x10b')]=function(_0x20d298){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')]('Enter\x20in\x20END\x20(%s)\x20block',_0x20d298[_0xabc8('0x38')]));return this[_0xabc8('0xd')][_0xabc8('0xae')]('end');};AGIVertices[_0xabc8('0x10')][_0xabc8('0x10c')]=function(_0x54e2fe){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x10d'),_0x54e2fe['label']));var _0x4b5753='';if(_0x54e2fe[_0xabc8('0x10e')]){if(!this[_0xabc8('0x88')](_0x54e2fe[_0xabc8('0x10e')])){return this[_0xabc8('0xd')]['error'](_0x54e2fe,'no\x20trunk\x20selected');}else{var _0x17b235=parseInt(_0x54e2fe[_0xabc8('0x10e')],0xa);if(isNaN(_0x17b235)){_0x4b5753=_0x54e2fe['trunk_id'];}else{_0x4b5753=this[_0xabc8('0x10f')]['sync'](this,_0x54e2fe['trunk_id']);if(!_0x4b5753){return this['channel'][_0xabc8('0x2c')](_0x54e2fe,'no\x20trunk\x20found');}}}}else if(_0x54e2fe[_0xabc8('0x110')]){_0x4b5753=_0x54e2fe['trunk_name'];}else{return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x54e2fe,_0xabc8('0x111'));}var _0x5f475d=this[_0xabc8('0xd')][_0xabc8('0xad')](_0xabc8('0xe9'),[util['format'](_0xabc8('0x112'),_0x4b5753,_0x54e2fe[_0xabc8('0x4a')]),_0x54e2fe[_0xabc8('0x68')],_0x54e2fe[_0xabc8('0xeb')],_0x54e2fe[_0xabc8('0x65')]]);if(_0x5f475d[_0xabc8('0xa6')]===-0x1){return _0x5f475d;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('Executed\x20command\x20%s',_0xabc8('0xe9')));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x113')]=function(_0x424f89){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x114'),_0x424f89[_0xabc8('0x38')]));return this['channel']['noop'](_0xabc8('0x113'));};AGIVertices['prototype']['getdigits']=function(_0x27e4aa){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x115'),_0x27e4aa['label']));if(_0x27e4aa['retry']===0x0){return this[_0xabc8('0xa8')](_0x27e4aa);}_0x27e4aa[_0xabc8('0xa9')]-=0x1;if(!this[_0xabc8('0x88')](_0x27e4aa[_0xabc8('0x116')])){return this['channel'][_0xabc8('0x2c')](_0x27e4aa,'no\x20file\x20audio\x20selected');}var _0x2f2a8e=this['getSound']['sync'](this,_0x27e4aa[_0xabc8('0x116')]);if(!_0x2f2a8e){return this[_0xabc8('0xd')]['error'](_0x27e4aa,_0xabc8('0x117'));}if(!this['isConfigured'](_0x27e4aa[_0xabc8('0xdc')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0xabc8('0xdd'));}var _0x1df624=this[_0xabc8('0xd')][_0xabc8('0x118')](_0x2f2a8e,_0x27e4aa['response'],_0x27e4aa[_0xabc8('0x119')]);var _0xcb0f44=_0x1df624[_0xabc8('0xa6')]?_0x1df624[_0xabc8('0xa6')][_0xabc8('0x4e')]():'';logger[_0xabc8('0x2e')](_0xabc8('0x11a'),JSON['stringify'](_0x1df624));if(_0x1df624[_0xabc8('0xa6')]===-0x1){this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x27e4aa,_0xcb0f44);return _0x1df624;}else if(_0x1df624['extra']==='timeout'){_0x1df624[_0xabc8('0xa6')]=_0xcb0f44[_0xabc8('0x9d')]>=parseInt(_0x27e4aa[_0xabc8('0x11b')])?'x':'i';}else{_0x1df624[_0xabc8('0xa6')]=_0xcb0f44['length']>=parseInt(_0x27e4aa['mindigit'])&&_0xcb0f44[_0xabc8('0x9d')]<=parseInt(_0x27e4aa[_0xabc8('0x119')])?'x':'i';}var _0x59af8f=this[_0xabc8('0xa4')][_0xabc8('0x73')](this,_0x27e4aa['variable_id']);if(!_0x59af8f){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x27e4aa,_0xabc8('0x11c'));}this[_0xabc8('0xd')][_0xabc8('0xa2')](_0x59af8f,_0xcb0f44);if(this['isConfigured'](_0x27e4aa[_0xabc8('0x11d')])){var _0x1b704c=parseInt(_0x27e4aa[_0xabc8('0x11d')],0xa);var _0x5407fb=rs[_0xabc8('0x11e')]({'charset':'*','length':_0x1b704c});var _0x1bc7d8=_0xcb0f44[_0xabc8('0x9d')];if(_0x1bc7d8>0x0){if(_0x1bc7d8>_0x1b704c){this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x27e4aa,_0x27e4aa[_0xabc8('0x11f')]===_0xabc8('0x120')?_0x5407fb+_0xcb0f44[_0xabc8('0x121')](_0x1b704c):_0xcb0f44[_0xabc8('0x121')](0x0,_0x1bc7d8-_0x1b704c)+_0x5407fb);}else{this[_0xabc8('0x36')]['sync'](this,_0x27e4aa,rs[_0xabc8('0x11e')]({'charset':'*','length':_0x1bc7d8}));}}else{this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x27e4aa,'');}}else{this[_0xabc8('0x36')]['sync'](this,_0x27e4aa,_0xcb0f44);}return _0x1df624;};AGIVertices[_0xabc8('0x10')][_0xabc8('0x122')]=function(_0x2d070a){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x123'),_0x2d070a[_0xabc8('0x38')]));return this[_0xabc8('0xc')](_0x2d070a);};AGIVertices[_0xabc8('0x10')][_0xabc8('0x124')]=function(_0x117d0c){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x125'),_0x117d0c[_0xabc8('0x38')]));this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x117d0c,_0x117d0c['goalname']);return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('GOAL\x20%s',_0x117d0c['goalname']));};AGIVertices[_0xabc8('0x10')]['awspolly']=function(_0x440678){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x126'),_0x440678[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x440678['aws_access_key_id'])||!this[_0xabc8('0x88')](_0x440678['aws_secret_access_key'])){return this['channel'][_0xabc8('0xae')](_0xabc8('0x127'));}if(!this[_0xabc8('0x88')](_0x440678[_0xabc8('0x5c')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xac'));}this['channel'][_0xabc8('0xae')](util['format'](_0xabc8('0x128'),_0x440678[_0xabc8('0x5c')]));var _0x58e8f4=this[_0xabc8('0x8a')][_0xabc8('0x73')](this,_0x440678);if(_0x58e8f4){this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x129'),_0x58e8f4));var _0x4b34b9=this[_0xabc8('0xd')][_0xabc8('0x107')](_0x58e8f4);try{fs[_0xabc8('0x12a')](_0x58e8f4+_0xabc8('0x108'));}catch(_0x7d85ed){logger[_0xabc8('0x2c')](_0x7d85ed);}return _0x4b34b9;}return this['channel'][_0xabc8('0x2c')](_0x440678,_0xabc8('0x12b'));};AGIVertices['prototype']['awslex']=function(_0x522b4d){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x12c'),_0x522b4d[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x522b4d[_0xabc8('0x8b')])||!this['isConfigured'](_0x522b4d[_0xabc8('0x8c')])){return this[_0xabc8('0xd')]['noop'](_0xabc8('0x127'));}if(!this['isConfigured'](_0x522b4d[_0xabc8('0x92')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0x12d'));}if(!this[_0xabc8('0x88')](_0x522b4d['text'])){return this['channel'][_0xabc8('0xae')]('no\x20text\x20configured');}this[_0xabc8('0xd')][_0xabc8('0xef')]=!![];this[_0xabc8('0x36')](_0x522b4d);this[_0xabc8('0x43')](_0x522b4d[_0xabc8('0x5c')],'in','','');this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x12e'),_0x522b4d[_0xabc8('0x5c')]));var _0x22f4e6=this['awsLex'][_0xabc8('0x73')](this,_0x522b4d);if(_0x22f4e6){for(var _0x1b09f8 in _0x22f4e6){if(_0x22f4e6[_0xabc8('0x98')](_0x1b09f8)&&_[_0xabc8('0x9e')](_0x22f4e6[_0x1b09f8])){this['channel']['setVariable'](util[_0xabc8('0x28')](_0xabc8('0x12f'),_0x1b09f8[_0xabc8('0x6c')]()),_0x22f4e6[_0x1b09f8]);}}if(_[_0xabc8('0x47')](_0x22f4e6[_0xabc8('0x130')])){return this[_0xabc8('0xd')][_0xabc8('0xae')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xabc8('0x43')](_0x22f4e6[_0xabc8('0x130')],'out','amazonlex','');return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0x22f4e6[_0xabc8('0x130')]));}}return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x522b4d,_0xabc8('0x131'));};AGIVertices[_0xabc8('0x10')]['googleasr']=function(_0xdb1b66){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x132'),_0xdb1b66['label'],_0xdb1b66['timeout']));if(!this['isConfigured'](_0xdb1b66[_0xabc8('0x7d')])){return this['channel'][_0xabc8('0xae')](_0xabc8('0xee'));}var _0x3e48a2=_0xabc8('0x133');var _0x391ecb=util[_0xabc8('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xabc8('0x11e')](0x4));var _0x587e73=util[_0xabc8('0x28')](_0xabc8('0xa1'),_0x391ecb,_0x3e48a2);var _0x4a8725=!![];if(_0xdb1b66[_0xabc8('0x134')]===_0xabc8('0x135')){_0x4a8725=![];}var _0x2b1c78=this[_0xabc8('0xd')]['recordFile'](_0x391ecb,_0x3e48a2,_0xdb1b66['intKey'],_0xdb1b66[_0xabc8('0x68')],undefined,_0x4a8725);if(_0x2b1c78[_0xabc8('0xa6')]!==-0x1){this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x136'),_0x587e73));var _0x1d509f=this[_0xabc8('0x93')][_0xabc8('0x73')](this,_0xdb1b66,_0x587e73);if(_0x1d509f){for(var _0x531f02 in _0x1d509f){if(_0x1d509f['hasOwnProperty'](_0x531f02)){this[_0xabc8('0xd')][_0xabc8('0xa2')](util['format'](_0xabc8('0x137'),_0x531f02[_0xabc8('0x6c')]()),_0x1d509f[_0x531f02]);}}return this[_0xabc8('0xd')][_0xabc8('0xae')](util['format'](_0xabc8('0x138'),JSON[_0xabc8('0x76')](_0x1d509f)));}}return _0x2b1c78;};AGIVertices[_0xabc8('0x10')][_0xabc8('0x139')]=function(_0x1a20e3){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x13a'),_0x1a20e3[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x1a20e3['appid'])){return this['channel'][_0xabc8('0xae')](_0xabc8('0x13b'));}if(!this['isConfigured'](_0x1a20e3[_0xabc8('0x13c')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0x13d'));}var _0x422e1a=_0xabc8('0x133');var _0x457b3c=util[_0xabc8('0x28')](_0xabc8('0x13e'),FILES_PATH,rs[_0xabc8('0x11e')](0x4));var _0xcf465=util[_0xabc8('0x28')]('%s.%s',_0x457b3c,_0x422e1a);var _0x6de301=!![];if(_0x1a20e3[_0xabc8('0x134')]===_0xabc8('0x135')){_0x6de301=![];}var _0x928879=this[_0xabc8('0xd')]['recordFile'](_0x457b3c,_0x422e1a,_0x1a20e3[_0xabc8('0x13f')],_0x1a20e3[_0xabc8('0x68')],undefined,_0x6de301);if(_0x928879[_0xabc8('0xa6')]!==-0x1){this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x140'),_0xcf465));var _0x2c52df=this[_0xabc8('0x95')][_0xabc8('0x73')](this,_0x1a20e3,_0xcf465);if(_0x2c52df){for(var _0x4a064b in _0x2c52df){if(_0x2c52df[_0xabc8('0x98')](_0x4a064b)){this[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0x141'),_0x4a064b['toUpperCase']()),_0x2c52df[_0x4a064b]);}}return this['channel'][_0xabc8('0xae')](util['format']('TildeASR\x20Result\x20%s',JSON[_0xabc8('0x76')](_0x2c52df)));}}return _0x928879;};AGIVertices[_0xabc8('0x10')][_0xabc8('0x142')]=function(_0x5a540f){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x143'),_0x5a540f[_0xabc8('0x38')]));return this[_0xabc8('0xd')][_0xabc8('0x144')](_0x5a540f[_0xabc8('0x3e')],_0x5a540f[_0xabc8('0x3f')],_0x5a540f[_0xabc8('0x145')]);};AGIVertices['prototype']['gotoif']=function(_0x49a4f8){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x146'),_0x49a4f8[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x49a4f8['condition'])){return this['channel'][_0xabc8('0x2c')](_0x49a4f8,_0xabc8('0x147'));}try{var _0x2e8972=eval(_0x49a4f8[_0xabc8('0x148')])?_0xabc8('0x149'):_0xabc8('0x14a');this[_0xabc8('0xd')][_0xabc8('0xae')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x49a4f8[_0xabc8('0x148')],_0x2e8972));return{'code':0xc8,'result':_0x2e8972};}catch(_0x1fa10a){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xabc8('0x10')][_0xabc8('0x14b')]=function(_0x213b5c){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x14c'),_0x213b5c[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x213b5c[_0xabc8('0x14d')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x213b5c,'no\x20interval\x20configured');}var _0x1dc5ca=this[_0xabc8('0x21')][_0xabc8('0x73')](this,_0x213b5c['interval_id']);if(!_0x1dc5ca){return this['channel'][_0xabc8('0x2c')](_0x213b5c,'no\x20intervals\x20found');}for(var _0x302096=0x0;_0x302096<_0x1dc5ca['length'];_0x302096+=0x1){var _0x277fb4=this[_0xabc8('0xd')][_0xabc8('0xa4')](util[_0xabc8('0x28')](_0xabc8('0x14e'),_0x1dc5ca[_0x302096]));if(_0x277fb4[_0xabc8('0xa6')]===-0x1){return _0x277fb4;}logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x14f'),_0x1dc5ca[_0x302096],_0x277fb4[_0xabc8('0xa5')]));if(_0x277fb4[_0xabc8('0xa5')]===_0xabc8('0x149')){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x14f'),_0x1dc5ca[_0x302096],_0xabc8('0x149')));this[_0xabc8('0xd')][_0xabc8('0xae')](util['format'](_0xabc8('0x14f'),_0x1dc5ca[_0x302096],'true'));return{'code':0xc8,'result':_0xabc8('0x149')};}else{logger['info'](util[_0xabc8('0x28')]('IFTIME\x20%s\x20%s',_0x1dc5ca[_0x302096],'false'));this['channel']['noop'](util[_0xabc8('0x28')](_0xabc8('0x14f'),_0x1dc5ca[_0x302096],_0xabc8('0x14a')));}}return{'code':0xc8,'result':_0xabc8('0x14a')};};AGIVertices[_0xabc8('0x10')][_0xabc8('0x150')]=function(_0x485ca9){logger['info'](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x485ca9['label']));return this[_0xabc8('0xd')][_0xabc8('0x150')]();};AGIVertices[_0xabc8('0x10')][_0xabc8('0x151')]=function(_0x6573f7){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x152'),_0x6573f7[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x6573f7[_0xabc8('0x7d')])){return this[_0xabc8('0xd')]['noop'](_0xabc8('0xee'));}var _0x3410b3=_0xabc8('0x133');var _0x2e50bb=util[_0xabc8('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xabc8('0x11e')](0x4));var _0x1642d4=util[_0xabc8('0x28')](_0xabc8('0xa1'),_0x2e50bb,_0x3410b3);var _0xcd6a39=!![];if(_0x6573f7[_0xabc8('0x134')]===_0xabc8('0x135')){_0xcd6a39=![];}var _0x27e692=this[_0xabc8('0xd')]['recordFile'](_0x2e50bb,_0x3410b3,_0x6573f7[_0xabc8('0x13f')],_0x6573f7[_0xabc8('0x68')],undefined,_0xcd6a39);if(_0x27e692[_0xabc8('0xa6')]!==-0x1){this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')](_0xabc8('0x153'),_0x1642d4));var _0x239d27=this['ispeechASR'][_0xabc8('0x73')](this,_0x6573f7,_0x1642d4);if(_0x239d27){for(var _0x214382 in _0x239d27){if(_0x239d27[_0xabc8('0x98')](_0x214382)){this[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0x154'),_0x214382[_0xabc8('0x6c')]()),_0x239d27[_0x214382]);}}return this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')](_0xabc8('0x155'),JSON[_0xabc8('0x76')](_0x239d27)));}}return _0x27e692;};AGIVertices['prototype'][_0xabc8('0x156')]=function(_0x2c179c){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x157'),_0x2c179c[_0xabc8('0x38')]));if(!this['isConfigured'](_0x2c179c['key'])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xee'));}if(!this[_0xabc8('0x88')](_0x2c179c[_0xabc8('0x5c')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xabc8('0xd')]['noop'](util['format'](_0xabc8('0x158'),_0x2c179c['text']));var _0x564dff=this[_0xabc8('0x84')][_0xabc8('0x73')](this,_0x2c179c);if(_0x564dff){this['channel'][_0xabc8('0xae')](util['format'](_0xabc8('0x153'),_0x564dff));var _0x58616b=this[_0xabc8('0xd')][_0xabc8('0x107')](_0x564dff,_0x2c179c[_0xabc8('0x13f')]);try{fs[_0xabc8('0x12a')](_0x564dff+_0xabc8('0x108'));}catch(_0x544f75){logger[_0xabc8('0x2c')](_0x544f75);}return _0x58616b;}return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x2c179c,_0xabc8('0x159'));};AGIVertices[_0xabc8('0x10')]['login']=function(_0x395ebf){logger['info'](util[_0xabc8('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x395ebf[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x395ebf['findBy'])){return this['channel'][_0xabc8('0x2c')](_0x395ebf,_0xabc8('0x15a'));}logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x15b'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x395ebf['findBy']));var _0x1ddd78=this[_0xabc8('0x15c')]['sync'](this,_0x395ebf[_0xabc8('0x15d')]);if(_0x1ddd78){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x15e'),this['channel'][_0xabc8('0x3b')],_0x395ebf[_0xabc8('0x15d')]));this[_0xabc8('0xd')][_0xabc8('0xae')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x395ebf['findBy']));return{'code':0xc8,'result':_0xabc8('0x15f')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xabc8('0xd')]['callerid'],_0x395ebf[_0xabc8('0x15d')]));this[_0xabc8('0xd')][_0xabc8('0xae')](util['format'](_0xabc8('0x160'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x395ebf[_0xabc8('0x15d')]));return{'code':0xc8,'result':_0xabc8('0x161')};}};AGIVertices['prototype'][_0xabc8('0x162')]=function(_0x181d1c){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x163'),_0x181d1c[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x181d1c['findBy'])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x181d1c,_0xabc8('0x15a'));}logger['info'](util[_0xabc8('0x28')](_0xabc8('0x15b'),this['channel'][_0xabc8('0x3b')],_0x181d1c['findBy']));var _0x590144=this[_0xabc8('0x54')]['sync'](this,_0x181d1c['findBy']);if(_0x590144){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x15e'),this['channel']['callerid'],_0x181d1c['findBy']));this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x15e'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x181d1c['findBy']));return{'code':0xc8,'result':_0xabc8('0x15f')};}else{logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x160'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x181d1c[_0xabc8('0x15d')]));this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x160'),this['channel'][_0xabc8('0x3b')],_0x181d1c[_0xabc8('0x15d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xabc8('0x10')]['math']=function(_0x3fff82){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x164'),_0x3fff82[_0xabc8('0x38')]));if(!this['isConfigured'](_0x3fff82[_0xabc8('0x165')])){return this['channel'][_0xabc8('0x2c')](_0x3fff82,'no\x20operation\x20configured');}this[_0xabc8('0xd')][_0xabc8('0xae')](util['format'](_0xabc8('0x166'),_0x3fff82[_0xabc8('0x165')]));var _0x55f22e=eval(_0x3fff82[_0xabc8('0x165')]);if(!this[_0xabc8('0x88')](_0x3fff82['variable_id'])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xdd'));}var _0x2b7f07=this[_0xabc8('0xa4')][_0xabc8('0x73')](this,_0x3fff82[_0xabc8('0xdc')]);if(!_0x2b7f07){return this['channel']['error'](_0x3fff82,_0xabc8('0x11c'));}if(_['isArray'](_0x55f22e)){var _0x95b114=this;_0x55f22e['forEach'](function(_0x18396b,_0x54506c){_0x95b114[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0x167'),_0x2b7f07,_0x54506c),_0x18396b);});return this['channel'][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x168'),_0x2b7f07));}else{return this[_0xabc8('0xd')][_0xabc8('0xa2')](_0x2b7f07,_0x55f22e);}};AGIVertices[_0xabc8('0x10')][_0xabc8('0xb')]=function(_0x5a8fe1){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x169'),_0x5a8fe1['label']));if(_0x5a8fe1[_0xabc8('0xa9')]===0x0){return this[_0xabc8('0xa8')](_0x5a8fe1);}_0x5a8fe1[_0xabc8('0xa9')]-=0x1;if(!this[_0xabc8('0x88')](_0x5a8fe1['file_id'])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x5a8fe1,_0xabc8('0x16a'));}var _0x58a07e=this[_0xabc8('0x16b')][_0xabc8('0x73')](this,_0x5a8fe1[_0xabc8('0x116')]);if(!_0x58a07e){return this['channel'][_0xabc8('0x2c')](_0x5a8fe1,_0xabc8('0x117'));}var _0xf9de21=this[_0xabc8('0xd')]['getData'](_0x58a07e,_0x5a8fe1[_0xabc8('0x16c')],_0x5a8fe1[_0xabc8('0x16d')]);var _0xc6483b=_0xf9de21['result'];if(_0xf9de21['result']===-0x1){this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x5a8fe1,'-1');return _0xf9de21;}else if(_0xf9de21[_0xabc8('0xa5')]===_0xabc8('0x68')){_0xf9de21[_0xabc8('0xa6')]=_0xf9de21[_0xabc8('0xa6')]['length']>0x0?_0xf9de21[_0xabc8('0xa6')]:'t';}else if(_[_0xabc8('0x45')](_0xf9de21['result'])){_0xf9de21['result']='#';_0xc6483b='#';}if(!this[_0xabc8('0x88')](_0x5a8fe1[_0xabc8('0xdc')])){this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xdd'));}else{var _0x25ab22=this[_0xabc8('0xa4')][_0xabc8('0x73')](this,_0x5a8fe1['variable_id']);if(!_0x25ab22){return this['channel'][_0xabc8('0x2c')](_0x5a8fe1,_0xabc8('0x11c'));}this[_0xabc8('0xd')][_0xabc8('0xa2')](_0x25ab22,_0xc6483b);}this[_0xabc8('0x36')]['sync'](this,_0x5a8fe1,_0xc6483b);return _0xf9de21;};AGIVertices[_0xabc8('0x10')][_0xabc8('0xae')]=function(_0x5eb3fb){logger['info'](util['format'](_0xabc8('0x16e'),_0x5eb3fb[_0xabc8('0x38')]));return this[_0xabc8('0xd')][_0xabc8('0xae')](_0x5eb3fb[_0xabc8('0x16f')]||_0x5eb3fb[_0xabc8('0x38')]);};AGIVertices[_0xabc8('0x10')][_0xabc8('0x170')]=function(_0x436696){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x171'),_0x436696['label']));if(!this[_0xabc8('0x88')](_0x436696[_0xabc8('0x15d')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x436696,_0xabc8('0x15a'));}logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x15b'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x436696[_0xabc8('0x15d')]));var _0x5e4a53=this[_0xabc8('0x50')][_0xabc8('0x73')](this,_0x436696[_0xabc8('0x172')]);var _0x32fd3f=this[_0xabc8('0x52')][_0xabc8('0x73')](this,_0x436696[_0xabc8('0x15d')],_0x5e4a53);if(_0x32fd3f){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x15e'),this['channel'][_0xabc8('0x3b')],_0x436696[_0xabc8('0x15d')]));this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')](_0xabc8('0x15e'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x436696[_0xabc8('0x15d')]));return{'code':0xc8,'result':_0xabc8('0x15f')};}else{logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x160'),this['channel'][_0xabc8('0x3b')],_0x436696[_0xabc8('0x15d')]));this['channel'][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x15e'),this[_0xabc8('0xd')]['callerid'],_0x436696[_0xabc8('0x15d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xabc8('0x10')][_0xabc8('0x173')]=function(_0x53a968){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x53a968['label']));if(!this['isConfigured'](_0x53a968[_0xabc8('0x116')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x53a968,'no\x20file\x20audio\x20selected');}var _0x2cdae2=this[_0xabc8('0x16b')][_0xabc8('0x73')](this,_0x53a968[_0xabc8('0x116')]);if(!_0x2cdae2){return this['channel'][_0xabc8('0x2c')](_0x53a968,'no\x20file\x20audio\x20found');}var _0x5d6a23=this['channel']['exec']('PLAYBACK',[_0x2cdae2,_0x53a968[_0xabc8('0xeb')]]);if(_0x5d6a23[_0xabc8('0xa6')]===-0x1){return _0x5d6a23;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0xca'),_0xabc8('0x174'),_0x2cdae2));};AGIVertices['prototype'][_0xabc8('0x175')]=function(_0x41f6fe){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x176'),_0x41f6fe[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x41f6fe[_0xabc8('0x177')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x41f6fe,_0xabc8('0x178'));}var _0x335527='';var _0x36fd2f=parseInt(_0x41f6fe[_0xabc8('0x177')],0xa);if(isNaN(_0x36fd2f)){_0x335527=_0x41f6fe[_0xabc8('0x177')];}else{_0x335527=this[_0xabc8('0x13')][_0xabc8('0x73')](this,_0x41f6fe[_0xabc8('0x177')]);if(!_0x335527){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x41f6fe,_0xabc8('0x179'));}}var _0xe3eb0a='';if(this[_0xabc8('0x88')](_0x41f6fe[_0xabc8('0x116')])){var _0x2866d6=this['getSound']['sync'](this,_0x41f6fe[_0xabc8('0x116')]);if(_0x2866d6){_0xe3eb0a=_0x2866d6;}}this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x41f6fe,_0x335527);if(_0x41f6fe[_0xabc8('0xeb')][_0xabc8('0x17a')]('x')<0x0){_0x41f6fe['opts']+='x';}if(_0x41f6fe[_0xabc8('0xeb')][_0xabc8('0x17a')]('X')<0x0){_0x41f6fe[_0xabc8('0xeb')]+='X';}this['channel'][_0xabc8('0xa2')]('XMCS-QUEUE',_0x335527?_0x335527[_0xabc8('0x17b')]():'');var _0x4020d7=this['channel'][_0xabc8('0xad')](_0xabc8('0x17c'),[_0x335527,_0x41f6fe[_0xabc8('0xeb')],_0x41f6fe[_0xabc8('0x65')],_0xe3eb0a,_0x41f6fe[_0xabc8('0x68')],_0x41f6fe[_0xabc8('0x17d')],_0x41f6fe[_0xabc8('0x17e')],_0x41f6fe[_0xabc8('0x17f')],'',_0x41f6fe[_0xabc8('0x180')]]);if(_0x4020d7['result']===-0x1){return _0x4020d7;}return this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')](_0xabc8('0xca'),'QUEUE',_0x335527));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x181')]=function(_0x486a1e){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x182'),_0x486a1e[_0xabc8('0x38')]));var _0x1db28b=_0x486a1e[_0xabc8('0x183')]||'wav';var _0x5b334a=util[_0xabc8('0x28')](_0xabc8('0x184'),this['channel']['uniqueid'],rs[_0xabc8('0x11e')](0x5));var _0x5dfbe9=util['format'](_0xabc8('0x185'),FILES_PATH,_0x5b334a,_0x1db28b);var _0x569fb6=util['format'](_0xabc8('0x13e'),FILES_PATH,_0x5b334a);this['createSquareRecording']['sync'](this,_0x486a1e,_0x5b334a,_0x5dfbe9);this['channel']['setVariable'](_0xabc8('0x186'),_0x5b334a);logger[_0xabc8('0x2e')](_0xabc8('0x187'),_0x569fb6,_0x1db28b,_0x486a1e[_0xabc8('0x188')],_0x486a1e['timeout']);return this[_0xabc8('0xd')]['recordFile'](_0x569fb6,_0x1db28b,_0x486a1e[_0xabc8('0x188')],_0x486a1e[_0xabc8('0x68')],undefined,!![]);};AGIVertices[_0xabc8('0x10')][_0xabc8('0x189')]=function(_0x1f1ed2){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1f1ed2['label']));if(!this[_0xabc8('0x88')](_0x1f1ed2['url'])){return this[_0xabc8('0xd')]['noop'](_0xabc8('0x18a'));}var _0x370961=this['restAPI']['sync'](this,_0x1f1ed2);logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x18b'),util['inspect'](_0x370961,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1f1ed2[_0xabc8('0xdc')])){return this[_0xabc8('0xd')][_0xabc8('0xae')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x73bdd3=this[_0xabc8('0xa4')][_0xabc8('0x73')](this,_0x1f1ed2[_0xabc8('0xdc')]);if(!_0x73bdd3){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x1f1ed2,_0xabc8('0x11c'));}this['channel'][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0x18c'),_0x73bdd3),_0x370961['statusCode']?_0x370961[_0xabc8('0x78')]:_0xabc8('0x18d'));this[_0xabc8('0xd')][_0xabc8('0xa2')](util[_0xabc8('0x28')](_0xabc8('0x18e'),_0x73bdd3),_0x370961[_0xabc8('0x79')]?_0x370961[_0xabc8('0x79')]:'OK');if(_0x370961[_0xabc8('0x6d')]){try{this[_0xabc8('0xa0')](_0x370961['body'],_0x73bdd3);}catch(_0x16c6b3){logger[_0xabc8('0x2c')](util[_0xabc8('0x28')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x73bdd3));}}return this['channel'][_0xabc8('0xae')](util['format'](_0xabc8('0xe2'),_0x73bdd3));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x18f')]=function(_0x25874f){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x190'),_0x25874f[_0xabc8('0x38')]));return this['channel']['sayDigits'](_0x25874f[_0xabc8('0x191')]['replace'](/\s+/g,''),_0x25874f[_0xabc8('0x188')]);};AGIVertices[_0xabc8('0x10')]['saynumber']=function(_0xefbf08){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x192'),_0xefbf08[_0xabc8('0x38')]));return this['channel'][_0xabc8('0x193')](_0xefbf08[_0xabc8('0x67')][_0xabc8('0x194')](/\s+/g,''),_0xefbf08[_0xabc8('0x188')]);};AGIVertices[_0xabc8('0x10')][_0xabc8('0x195')]=function(_0x421217){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x196'),_0x421217['label']));return this[_0xabc8('0xd')][_0xabc8('0x197')](_0x421217[_0xabc8('0x5c')],_0x421217[_0xabc8('0x188')]);};AGIVertices['prototype'][_0xabc8('0x198')]=function(_0x444c6b){logger['info'](util[_0xabc8('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x444c6b[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x444c6b[_0xabc8('0x199')])){return this[_0xabc8('0xd')][_0xabc8('0xae')]('no\x20mail\x20account\x20configured');}var _0x154f4c=this[_0xabc8('0x19a')][_0xabc8('0x73')](this,_0x444c6b[_0xabc8('0x199')]);if(!_0x154f4c||!_0x154f4c[_0xabc8('0x19b')]){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x444c6b,'no\x20mail\x20account\x20found');}var _0x57952f={'from':util[_0xabc8('0x28')](_0xabc8('0x19c'),_0x154f4c[_0xabc8('0x46')],_0x154f4c[_0xabc8('0x19d')]||_0x154f4c[_0xabc8('0x19b')][_0xabc8('0x19e')]),'to':_0x444c6b['to']||'','cc':_0x444c6b['cc']||'','bcc':_0x444c6b[_0xabc8('0x19f')]||'','subject':_0x444c6b[_0xabc8('0x1a0')],'html':_0x444c6b[_0xabc8('0x5c')],'text':_0x444c6b[_0xabc8('0x5c')]};var _0x2248c1={'tls':{'rejectUnauthorized':![]}};if(_0x154f4c[_0xabc8('0x19b')][_0xabc8('0x1a1')]){_0x2248c1[_0xabc8('0x1a1')]=_0x154f4c['Smtp'][_0xabc8('0x1a1')];}else{_0x2248c1[_0xabc8('0x1a2')]=_0x154f4c[_0xabc8('0x19b')][_0xabc8('0x1a2')];_0x2248c1[_0xabc8('0x1a3')]=_0x154f4c[_0xabc8('0x19b')]['port'];_0x2248c1['secure']=_0x154f4c[_0xabc8('0x19b')]['secure'];}if(_0x154f4c[_0xabc8('0x19b')][_0xabc8('0x1a4')]){_0x2248c1[_0xabc8('0x1a5')]={'user':_0x154f4c['Smtp'][_0xabc8('0x19e')],'pass':_0x154f4c['Smtp']['pass']};}if(this[_0xabc8('0x88')](_0x444c6b['template_id'])){}logger[_0xabc8('0xe4')](_0xabc8('0x1a6'),JSON['stringify'](_0x57952f));this['createSquareDetailsReport'][_0xabc8('0x73')](this,_0x444c6b,_0x444c6b[_0xabc8('0x199')]);this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x1a7'),_0x154f4c['name']));this[_0xabc8('0x20')][_0xabc8('0x73')](this,_0x2248c1,_0x57952f);return this[_0xabc8('0xd')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['sendFax']=function(_0x50a9e0){logger[_0xabc8('0x2e')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x50a9e0[_0xabc8('0x38')]));return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0x1a8'));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x1a9')]=function(_0x4ad324){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4ad324['label']));if(!this[_0xabc8('0x88')](_0x4ad324[_0xabc8('0x1aa')])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0x1ab'));}var _0xd1bdee=this[_0xabc8('0x33')]['sync'](this,_0x4ad324[_0xabc8('0x1aa')]);if(!_0xd1bdee){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x4ad324,'no\x20sms\x20account\x20found');}var _0x5c0391={'body':_0x4ad324['sms_text'],'phone':_0x4ad324['to']||'','SmsAccountId':_0xd1bdee['id']};logger[_0xabc8('0xe4')]('sendSMS\x20message',JSON[_0xabc8('0x76')](_0x5c0391));this['createSquareDetailsReport']['sync'](this,_0x4ad324,_0x4ad324[_0xabc8('0x1aa')]);this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xd1bdee['name']));this[_0xabc8('0x35')][_0xabc8('0x73')](this,_0x5c0391);return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0x1ac'));};AGIVertices['prototype']['set']=function(_0x18eaf9){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x18eaf9[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x18eaf9[_0xabc8('0xdc')])){return this['channel']['error'](_0x18eaf9,'no\x20variable\x20selected');}var _0x221b8a=this[_0xabc8('0xa4')][_0xabc8('0x73')](this,_0x18eaf9['variable_id']);if(!_0x221b8a){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x18eaf9,_0xabc8('0x11c'));}return this[_0xabc8('0xd')][_0xabc8('0xa2')](_0x221b8a,_0x18eaf9[_0xabc8('0x1ad')]);};AGIVertices[_0xabc8('0x10')]['start']=function(_0xbd9d56){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x1ae'),_0xbd9d56[_0xabc8('0x38')]));this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0x1af'));if(_0xbd9d56[_0xabc8('0xc0')]==='yes'){this[_0xabc8('0xd')][_0xabc8('0xae')]('Answer');return this[_0xabc8('0xd')][_0xabc8('0xc0')]();}return this['channel']['noop'](_0xabc8('0x1b0'));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x1b1')]=function(_0x325f64){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x1b2'),_0x325f64[_0xabc8('0x38')]));if(!this['isConfigured'](_0x325f64[_0xabc8('0x1b3')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x325f64,_0xabc8('0x1b4'));}var _0x5876b4=this[_0xabc8('0x16')][_0xabc8('0x73')](this,_0x325f64[_0xabc8('0x1b3')]);if(!this['isConfigured'](_0x5876b4)){return this['channel'][_0xabc8('0x2c')](_0x325f64,util[_0xabc8('0x28')](_0xabc8('0x1b5'),_0x325f64[_0xabc8('0x1b3')]));}if(_0x5876b4===this[_0xabc8('0xd')][_0xabc8('0x3a')]){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x325f64,_0xabc8('0x1b6'));}this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x325f64,_0x5876b4);var _0x27e191=this[_0xabc8('0xd')]['exec']('AGI',util[_0xabc8('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xabc8('0x17d')][_0xabc8('0x1a2')]||'127.0.0.1',_0x5876b4,this[_0xabc8('0xd')][_0xabc8('0x3a')]));if(_0x27e191[_0xabc8('0xa6')]===-0x1){return _0x27e191;}return this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')]('Executed\x20command\x20%s\x20%s','AGI',_0x5876b4));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x1b7')]=function(_0x5e3fcf){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x1b8'),_0x5e3fcf[_0xabc8('0x38')]));var _0x5a24ac=this[_0xabc8('0x57')]['sync'](this,_0x5e3fcf['command']);this[_0xabc8('0x36')][_0xabc8('0x73')](this,_0x5e3fcf,_0x5e3fcf[_0xabc8('0xbc')]);if(this['isConfigured'](_0x5e3fcf[_0xabc8('0xdc')])){var _0x44b155=this['getVariable'][_0xabc8('0x73')](this,_0x5e3fcf[_0xabc8('0xdc')]);if(_0x44b155){this[_0xabc8('0xd')][_0xabc8('0xa2')](_0x44b155,_0x5a24ac);return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x1b9'),_0x5e3fcf[_0xabc8('0xbc')],_0x44b155));}}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x1ba'),_0x5e3fcf[_0xabc8('0xbc')]));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x1bb')]=function(_0x4dce8b){logger['info'](util[_0xabc8('0x28')](_0xabc8('0x1bc'),_0x4dce8b[_0xabc8('0x38')]));_0x4dce8b[_0xabc8('0x5c')]=_0x4dce8b['text'][_0xabc8('0x194')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4dce8b[_0xabc8('0x5a')])){return this[_0xabc8('0xd')][_0xabc8('0xae')]('no\x20apiKey\x20configured');}if(!this[_0xabc8('0x88')](_0x4dce8b[_0xabc8('0x5c')])){return this[_0xabc8('0xd')]['noop'](_0xabc8('0xac'));}this['channel'][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x1bd'),_0x4dce8b[_0xabc8('0x5c')]));var _0x46c566=this[_0xabc8('0x59')][_0xabc8('0x73')](this,_0x4dce8b);if(_0x46c566){this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x46c566));var _0x4005b1=this[_0xabc8('0xd')][_0xabc8('0x107')](_0x46c566);try{fs[_0xabc8('0x12a')](_0x46c566+_0xabc8('0x108'));}catch(_0x66a657){logger[_0xabc8('0x2c')](_0x66a657);}return _0x4005b1;}return this[_0xabc8('0xd')]['error'](_0x4dce8b,_0xabc8('0x1be'));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x1bf')]=function(_0x590733){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x1c0'),_0x590733[_0xabc8('0x38')]));_0x590733[_0xabc8('0x5c')]=_0x590733[_0xabc8('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xabc8('0x88')](_0x590733['text'])){return this[_0xabc8('0xd')][_0xabc8('0xae')](_0xabc8('0xac'));}this[_0xabc8('0xd')][_0xabc8('0xae')](util['format'](_0xabc8('0x1c1'),_0x590733[_0xabc8('0x5c')]));var _0x3f3f1b=this[_0xabc8('0x63')][_0xabc8('0x73')](this,_0x590733);if(_0x3f3f1b){this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')](_0xabc8('0x1c2'),_0x3f3f1b));var _0x5fc62c=this[_0xabc8('0xd')][_0xabc8('0x107')](_0x3f3f1b);try{fs[_0xabc8('0x12a')](_0x3f3f1b+_0xabc8('0x108'));}catch(_0x469174){logger['error'](_0x469174);}return _0x5fc62c;}return this['channel']['error'](_0x590733,_0xabc8('0x1c3'));};AGIVertices[_0xabc8('0x10')][_0xabc8('0x1c4')]=function(_0x5af33f){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x1c5'),_0x5af33f[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x5af33f[_0xabc8('0x15d')])){return this[_0xabc8('0xd')][_0xabc8('0x2c')](_0x5af33f,_0xabc8('0x15a'));}logger[_0xabc8('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x5af33f['findBy']));var _0x4e4182=this[_0xabc8('0x1c6')][_0xabc8('0x73')](this,_0x5af33f['findBy']);if(_0x4e4182){logger[_0xabc8('0x2e')](util[_0xabc8('0x28')](_0xabc8('0x15e'),this['channel']['callerid'],_0x5af33f[_0xabc8('0x15d')]));this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')](_0xabc8('0x15e'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x5af33f[_0xabc8('0x15d')]));return{'code':0xc8,'result':_0xabc8('0x15f')};}else{logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x160'),this[_0xabc8('0xd')]['callerid'],_0x5af33f['findBy']));this[_0xabc8('0xd')]['noop'](util[_0xabc8('0x28')](_0xabc8('0x160'),this[_0xabc8('0xd')][_0xabc8('0x3b')],_0x5af33f[_0xabc8('0x15d')]));return{'code':0xc8,'result':_0xabc8('0x161')};}};AGIVertices['prototype'][_0xabc8('0x1c7')]=function(_0x4a3395){logger['info'](util['format'](_0xabc8('0x1c8'),_0x4a3395[_0xabc8('0x38')]));var _0x5b7ea0=this[_0xabc8('0xd')][_0xabc8('0xad')](_0xabc8('0x1c9'),[_0x4a3395[_0xabc8('0x1ca')],_0x4a3395['options']]);if(_0x5b7ea0['result']===-0x1){return _0x5b7ea0;}return this[_0xabc8('0xd')][_0xabc8('0xae')](util[_0xabc8('0x28')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x4a3395[_0xabc8('0x1ca')]));};AGIVertices[_0xabc8('0x10')]['vswitch']=function(_0x22f0f0){logger[_0xabc8('0x2e')](util['format'](_0xabc8('0x1cb'),_0x22f0f0[_0xabc8('0x38')]));if(!this[_0xabc8('0x88')](_0x22f0f0['variable_id'])){return this['channel']['error'](_0x22f0f0,_0xabc8('0x1cc'));}var _0x60de62=this['getVariable'][_0xabc8('0x73')](this,_0x22f0f0['variable_id']);if(!_0x60de62){return this['channel'][_0xabc8('0x2c')](_0x22f0f0,_0xabc8('0x11c'));}var _0x2b228f=this['channel'][_0xabc8('0xa4')](_0x60de62);return{'code':0xc8,'result':_0x2b228f[_0xabc8('0xa5')]?_0x2b228f[_0xabc8('0xa5')]:'-'};};String[_0xabc8('0x10')]['replaceAll']=function(_0x1c3c26,_0x3369ff){return this[_0xabc8('0x1cd')](_0x1c3c26)[_0xabc8('0x1ce')](_0x3369ff);};module[_0xabc8('0x1cf')]=AGIVertices;
\ No newline at end of file
index d71fab2..bdc7350 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fb0=['hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','timer','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest'];(function(_0x318807,_0x51678f){var _0x33ea7e=function(_0x41b62d){while(--_0x41b62d){_0x318807['push'](_0x318807['shift']());}};_0x33ea7e(++_0x51678f);}(_0x0fb0,0xac));var _0x00fb=function(_0x3d0bd4,_0x5264b1){_0x3d0bd4=_0x3d0bd4-0x0;var _0x1461fa=_0x0fb0[_0x3d0bd4];return _0x1461fa;};'use strict';var util=require(_0x00fb('0x0'));var _=require(_0x00fb('0x1'));var moment=require(_0x00fb('0x2'));var ami=require(_0x00fb('0x3'));var logger=require('../../../config/logger')(_0x00fb('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x58f65d){this[_0x00fb('0x5')]=_0x58f65d[_0x00fb('0x5')];this['agents']=_0x58f65d[_0x00fb('0x6')];this[_0x00fb('0x7')]=_0x58f65d['timers'];this['channels']={};ami['on'](_0x00fb('0x8'),this['syncAgentConnect'][_0x00fb('0x9')](this));ami['on'](_0x00fb('0xa'),this[_0x00fb('0xb')][_0x00fb('0x9')](this));ami['on'](_0x00fb('0xc'),this[_0x00fb('0xd')][_0x00fb('0x9')](this));ami['on'](_0x00fb('0xe'),this[_0x00fb('0xf')][_0x00fb('0x9')](this));ami['on'](_0x00fb('0x10'),this[_0x00fb('0x11')][_0x00fb('0x9')](this));ami['on'](_0x00fb('0x12'),this[_0x00fb('0x13')][_0x00fb('0x9')](this));ami['on'](_0x00fb('0x14'),this[_0x00fb('0x15')]['bind'](this));}function getDiff(_0x6b7703){var _0x1aa527=moment()['milliseconds'](0x0);var _0xcdeee9=moment(_0x6b7703)['milliseconds'](0x0);return _0x1aa527[_0x00fb('0x16')](_0xcdeee9,_0x00fb('0x17'));}Acw[_0x00fb('0x18')]['startAcw']=function(_0x246297){try{var _0x4f5f8a=this;var _0x127467=this[_0x00fb('0x19')][_0x246297][_0x00fb('0x1a')];var _0x22aec9=this[_0x00fb('0x19')][_0x246297][_0x00fb('0x1b')];var _0x127e7a=this[_0x00fb('0x5')][_0x22aec9];var _0x353398=![];var _0x1f3982=_0x00fb('0x1c');if(_0x127e7a['mandatoryDisposition']){if(_0x127e7a[_0x00fb('0x1d')][_0x00fb('0x1e')]){_0x353398=!![];_0x1f3982=_0x127e7a[_0x00fb('0x1d')][_0x00fb('0x1e')];}}ami[_0x00fb('0x1f')]({'action':_0x00fb('0x20'),'interface':_0x127467,'paused':!![],'reason':_0x1f3982})['then'](function(_0x290db4){if(_0x4f5f8a[_0x00fb('0x6')][_0x127467]){return RpcUser[_0x00fb('0x21')](_0x4f5f8a[_0x00fb('0x6')][_0x127467]['id'])[_0x00fb('0x22')](function(_0x7d1538){if(_0x7d1538&&!_0x7d1538[_0x00fb('0x23')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x246297,_0x127467,_0x22aec9);var _0x53cd20=_0x4f5f8a['channels'][_0x246297]['attended']&&_0x4f5f8a[_0x00fb('0x19')][_0x246297][_0x00fb('0x24')]?_0x4f5f8a['channels'][_0x246297][_0x00fb('0x24')]:_0x246297;return RpcUser[_0x00fb('0x25')](_0x4f5f8a[_0x00fb('0x6')][_0x127467],_0x1f3982,_0x53cd20)[_0x00fb('0x22')](function(_0xe73ecd){if(!_0x353398){_0x4f5f8a[_0x00fb('0x7')][_0x127467]={};logger[_0x00fb('0x26')](_0x00fb('0x27'),_0x246297,_0x4f5f8a['voiceQueues'][_0x22aec9][_0x00fb('0x28')],_0x127467,_0x22aec9);_0x4f5f8a[_0x00fb('0x7')][_0x127467]['timer']=setTimeout(_0x4f5f8a[_0x00fb('0x29')][_0x00fb('0x9')](_0x4f5f8a,_0x127467),_0x4f5f8a[_0x00fb('0x5')][_0x22aec9][_0x00fb('0x28')]*0x3e8);_0x4f5f8a['timers'][_0x127467]['lastPauseAt']=moment()[_0x00fb('0x2a')](_0x00fb('0x2b'));_0x4f5f8a['timers'][_0x127467][_0x00fb('0x2c')]=_0x246297;_0x4f5f8a['timers'][_0x127467][_0x00fb('0x1b')]=_0x22aec9;_0x4f5f8a['timers'][_0x127467][_0x00fb('0x2d')]=function(){var _0x4a3e90=getDiff(_0x4f5f8a[_0x00fb('0x7')][_0x127467][_0x00fb('0x2e')]);clearTimeout(_0x4f5f8a['timers'][_0x127467][_0x00fb('0x2f')]);_0x4f5f8a[_0x00fb('0x7')][_0x127467]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x4a3e90},_0x4f5f8a[_0x00fb('0x7')][_0x127467]['uniqueid'],_0x127467)['then'](function(_0x57227b){logger[_0x00fb('0x26')](_0x00fb('0x30'),_0x246297,_0x4a3e90,_0x57227b);})[_0x00fb('0x31')](function(_0x125e41){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x246297,_0x125e41);});delete _0x4f5f8a[_0x00fb('0x7')][_0x127467];};}});}else{logger[_0x00fb('0x26')](_0x00fb('0x32'),_0x246297,_0x127467,_0x22aec9);}});}})[_0x00fb('0x31')](function(_0x5d4605){logger[_0x00fb('0x33')](_0x00fb('0x27'),_0x246297,_0x4f5f8a['voiceQueues'][_0x22aec9]['acwTimeout'],_0x127467,_0x22aec9);})[_0x00fb('0x34')](function(){delete _0x4f5f8a[_0x00fb('0x19')][_0x246297];});}catch(_0x263d00){logger[_0x00fb('0x33')](_0x00fb('0x35'),_0x263d00['message']);}};Acw['prototype'][_0x00fb('0x29')]=function(_0x523d01){try{var _0x11c297=this;if(_0x11c297['timers'][_0x523d01]){_0x11c297[_0x00fb('0x7')][_0x523d01][_0x00fb('0x2f')]=![];var _0x5d39eb=_0x11c297[_0x00fb('0x7')][_0x523d01][_0x00fb('0x2c')];var _0x71361=_0x11c297[_0x00fb('0x7')][_0x523d01][_0x00fb('0x1b')];var _0x237bfa=_0x11c297[_0x00fb('0x5')][_0x71361][_0x00fb('0x28')];logger[_0x00fb('0x26')](_0x00fb('0x36'),_0x5d39eb,_0x523d01);RpcUser[_0x00fb('0x37')](this[_0x00fb('0x6')][_0x523d01]);RpcVoiceAgentReport[_0x00fb('0x38')]({'acwtime':_0x237bfa,'agentacw':!![]},_0x5d39eb,_0x523d01)[_0x00fb('0x22')](function(_0x14ca7c){logger[_0x00fb('0x26')](_0x00fb('0x30'),_0x5d39eb,_0x237bfa,_0x14ca7c);})[_0x00fb('0x31')](function(_0x5c80c2){logger[_0x00fb('0x33')](_0x00fb('0x39'),_0x5d39eb,_0x5c80c2);});}else{logger[_0x00fb('0x33')](_0x00fb('0x3a'),_0x523d01);if(_0x11c297[_0x00fb('0x7')]){logger[_0x00fb('0x26')](_0x00fb('0x3b'),JSON[_0x00fb('0x3c')](_0x11c297['timers']));}}}catch(_0x51fd41){logger[_0x00fb('0x33')](_0x00fb('0x3d'),_0x51fd41[_0x00fb('0x3e')]);}};Acw[_0x00fb('0x18')][_0x00fb('0x3f')]=function(_0x48e961){try{if(this[_0x00fb('0x5')][_0x48e961['queue']]&&(this[_0x00fb('0x5')][_0x48e961[_0x00fb('0x1b')]][_0x00fb('0x4')]||this[_0x00fb('0x5')][_0x48e961['queue']][_0x00fb('0x40')])){if(this[_0x00fb('0x6')][_0x48e961[_0x00fb('0x1a')]]){this[_0x00fb('0x19')][_0x48e961['uniqueid']]={'queue':_0x48e961[_0x00fb('0x1b')],'interface':_0x48e961[_0x00fb('0x1a')],'destlinkedid':_0x48e961[_0x00fb('0x24')]};}}}catch(_0x465496){logger[_0x00fb('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x465496[_0x00fb('0x3e')]);}};Acw[_0x00fb('0x18')]['syncAgentConnectPreview']=function(_0x5405e1){try{if(this[_0x00fb('0x5')][_0x5405e1[_0x00fb('0x1b')]]&&(this[_0x00fb('0x5')][_0x5405e1['queue']][_0x00fb('0x4')]||this[_0x00fb('0x5')][_0x5405e1[_0x00fb('0x1b')]]['mandatoryDisposition'])){if(this[_0x00fb('0x6')][_0x5405e1[_0x00fb('0x1a')]]){this[_0x00fb('0x19')][_0x5405e1['uniqueid']]={'queue':_0x5405e1[_0x00fb('0x1b')],'interface':_0x5405e1['interface']};}}}catch(_0x4c6309){logger['error'](_0x00fb('0x41'),_0x4c6309[_0x00fb('0x3e')]);}};Acw[_0x00fb('0x18')]['syncHangupRequest']=function(_0x59b13b){try{if(this[_0x00fb('0x19')][_0x59b13b[_0x00fb('0x2c')]]&&_[_0x00fb('0x42')](this[_0x00fb('0x19')][_0x59b13b[_0x00fb('0x2c')]][_0x00fb('0x43')])){logger[_0x00fb('0x26')](_0x00fb('0x44'),_0x59b13b[_0x00fb('0x2c')]);this[_0x00fb('0x45')](_0x59b13b['uniqueid']);}else if(this[_0x00fb('0x19')][_0x59b13b['linkedid']]&&_[_0x00fb('0x42')](this[_0x00fb('0x19')][_0x59b13b[_0x00fb('0x46')]][_0x00fb('0x43')])){logger['info'](_0x00fb('0x47'),_0x59b13b[_0x00fb('0x46')]);this[_0x00fb('0x45')](_0x59b13b[_0x00fb('0x46')]);}}catch(_0x5b9fa5){logger[_0x00fb('0x33')](_0x00fb('0x48'),_0x5b9fa5[_0x00fb('0x3e')]);}};Acw[_0x00fb('0x18')][_0x00fb('0xd')]=function(_0x444fbb){try{if(this['channels'][_0x444fbb[_0x00fb('0x2c')]]&&this[_0x00fb('0x19')][_0x444fbb[_0x00fb('0x2c')]][_0x00fb('0x43')]){logger[_0x00fb('0x26')](_0x00fb('0x49'),_0x444fbb[_0x00fb('0x2c')]);this['startAcw'](_0x444fbb[_0x00fb('0x2c')]);}else if(this[_0x00fb('0x19')][_0x444fbb[_0x00fb('0x46')]]&&this['channels'][_0x444fbb[_0x00fb('0x46')]][_0x00fb('0x43')]){logger['info'](_0x00fb('0x4a'),_0x444fbb[_0x00fb('0x46')]);this[_0x00fb('0x45')](_0x444fbb['linkedid']);}}catch(_0x34ddc1){logger[_0x00fb('0x33')](_0x00fb('0x4b'),_0x34ddc1['message']);}};Acw[_0x00fb('0x18')][_0x00fb('0x11')]=function(_0x12caf1){try{if(!_[_0x00fb('0x4c')](this['channels'][_0x12caf1[_0x00fb('0x4d')]])){this['startAcw'](_0x12caf1[_0x00fb('0x4d')]);if(this[_0x00fb('0x19')][_0x12caf1[_0x00fb('0x4e')]]){this[_0x00fb('0x19')][_0x12caf1[_0x00fb('0x4e')]]['attended']=!![];this['channels'][_0x12caf1['transfertargetuniqueid']]=this[_0x00fb('0x19')][_0x12caf1[_0x00fb('0x4e')]];delete this[_0x00fb('0x19')][_0x12caf1[_0x00fb('0x4e')]];}}else if(!_[_0x00fb('0x4c')](this[_0x00fb('0x19')][_0x12caf1['transfertargetuniqueid']])){this['startAcw'](_0x12caf1[_0x00fb('0x4f')]);if(this['channels'][_0x12caf1[_0x00fb('0x50')]]){this[_0x00fb('0x19')][_0x12caf1[_0x00fb('0x50')]][_0x00fb('0x43')]=!![];this[_0x00fb('0x19')][_0x12caf1[_0x00fb('0x4d')]]=this['channels'][_0x12caf1['origtransfereruniqueid']];delete this[_0x00fb('0x19')][_0x12caf1['origtransfereruniqueid']];}}}catch(_0x39f97b){logger[_0x00fb('0x33')](_0x00fb('0x51'),_0x39f97b[_0x00fb('0x3e')]);}};Acw[_0x00fb('0x18')]['syncBlindTransfer']=function(_0x267adb){try{if(this[_0x00fb('0x19')][_0x267adb[_0x00fb('0x52')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x00fb('0x3c')](_0x267adb[_0x00fb('0x52')]));this['startAcw'](_0x267adb[_0x00fb('0x52')]);}else if(this['channels'][_0x267adb['transfererlinkedid']]){logger[_0x00fb('0x26')](_0x00fb('0x53'),JSON[_0x00fb('0x3c')](_0x267adb[_0x00fb('0x54')]));this['startAcw'](_0x267adb[_0x00fb('0x54')]);}}catch(_0x1a0168){logger[_0x00fb('0x33')](_0x00fb('0x55'),_0x1a0168[_0x00fb('0x3e')]);}};Acw[_0x00fb('0x18')]['syncAgentRingNoAnswer']=function(_0x43051d){try{if(this['voiceQueues'][_0x43051d[_0x00fb('0x1b')]]&&this[_0x00fb('0x5')][_0x43051d[_0x00fb('0x1b')]][_0x00fb('0x56')]===_0x00fb('0x57')){if(this[_0x00fb('0x6')][_0x43051d[_0x00fb('0x1a')]]){logger[_0x00fb('0x26')](_0x00fb('0x58'),_0x43051d[_0x00fb('0x2c')],_0x43051d['interface'],_0x43051d[_0x00fb('0x1b')]);return RpcUser[_0x00fb('0x25')](this['agents'][_0x43051d[_0x00fb('0x1a')]],_0x00fb('0x59'),_0x43051d[_0x00fb('0x2c')]);}}}catch(_0x35b354){logger[_0x00fb('0x33')](_0x00fb('0x5a'),_0x35b354['message']);}};module[_0x00fb('0x5b')]=Acw;
\ No newline at end of file
+var _0x7f8d=['format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','syncHangup','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','channels','queue','ACW','mandatoryDisposition','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt'];(function(_0x530a71,_0xeca2c2){var _0x16d1f8=function(_0x5bd520){while(--_0x5bd520){_0x530a71['push'](_0x530a71['shift']());}};_0x16d1f8(++_0xeca2c2);}(_0x7f8d,0x12b));var _0xd7f8=function(_0x2f9fdd,_0x174b03){_0x2f9fdd=_0x2f9fdd-0x0;var _0x41d98b=_0x7f8d[_0x2f9fdd];return _0x41d98b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xd7f8('0x0'));var ami=require(_0xd7f8('0x1'));var logger=require('../../../config/logger')(_0xd7f8('0x2'));var RpcUser=require(_0xd7f8('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x404d55){this[_0xd7f8('0x4')]=_0x404d55[_0xd7f8('0x4')];this[_0xd7f8('0x5')]=_0x404d55['agents'];this[_0xd7f8('0x6')]=_0x404d55[_0xd7f8('0x6')];this['channels']={};ami['on'](_0xd7f8('0x7'),this[_0xd7f8('0x8')]['bind'](this));ami['on']('hanguprequest',this[_0xd7f8('0x9')][_0xd7f8('0xa')](this));ami['on'](_0xd7f8('0xb'),this[_0xd7f8('0xc')][_0xd7f8('0xa')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0xd7f8('0xa')](this));ami['on']('attendedtransfer',this[_0xd7f8('0xd')][_0xd7f8('0xa')](this));ami['on'](_0xd7f8('0xe'),this[_0xd7f8('0xf')][_0xd7f8('0xa')](this));ami['on'](_0xd7f8('0x10'),this[_0xd7f8('0x11')][_0xd7f8('0xa')](this));}function getDiff(_0x39808a){var _0xaa2047=moment()[_0xd7f8('0x12')](0x0);var _0x5b8d40=moment(_0x39808a)[_0xd7f8('0x12')](0x0);return _0xaa2047[_0xd7f8('0x13')](_0x5b8d40,_0xd7f8('0x14'));}Acw['prototype']['startAcw']=function(_0x239fa8){try{var _0x1864a7=this;var _0x4ab204=this['channels'][_0x239fa8][_0xd7f8('0x15')];var _0x43333a=this[_0xd7f8('0x16')][_0x239fa8][_0xd7f8('0x17')];var _0x492afc=this[_0xd7f8('0x4')][_0x43333a];var _0x21ccc0=![];var _0x4c45f9=_0xd7f8('0x18');if(_0x492afc[_0xd7f8('0x19')]){if(_0x492afc['mandatoryDispositionPause'][_0xd7f8('0x1a')]){_0x21ccc0=!![];_0x4c45f9=_0x492afc['mandatoryDispositionPause'][_0xd7f8('0x1a')];}}ami[_0xd7f8('0x1b')]({'action':_0xd7f8('0x1c'),'interface':_0x4ab204,'paused':!![],'reason':_0x4c45f9})[_0xd7f8('0x1d')](function(_0x3d7484){if(_0x1864a7[_0xd7f8('0x5')][_0x4ab204]){return RpcUser['getAgent'](_0x1864a7[_0xd7f8('0x5')][_0x4ab204]['id'])[_0xd7f8('0x1d')](function(_0x5d00e4){if(_0x5d00e4&&!_0x5d00e4[_0xd7f8('0x1e')]){logger[_0xd7f8('0x1f')](_0xd7f8('0x20'),_0x239fa8,_0x4ab204,_0x43333a);var _0x176dbb=_0x1864a7[_0xd7f8('0x16')][_0x239fa8][_0xd7f8('0x21')]&&_0x1864a7[_0xd7f8('0x16')][_0x239fa8][_0xd7f8('0x22')]?_0x1864a7[_0xd7f8('0x16')][_0x239fa8]['destlinkedid']:_0x239fa8;return RpcUser[_0xd7f8('0x23')](_0x1864a7[_0xd7f8('0x5')][_0x4ab204],_0x4c45f9,_0x176dbb)[_0xd7f8('0x1d')](function(_0x49b41c){if(!_0x21ccc0){_0x1864a7[_0xd7f8('0x6')][_0x4ab204]={};logger[_0xd7f8('0x1f')](_0xd7f8('0x24'),_0x239fa8,_0x1864a7[_0xd7f8('0x4')][_0x43333a][_0xd7f8('0x25')],_0x4ab204,_0x43333a);_0x1864a7['timers'][_0x4ab204][_0xd7f8('0x26')]=setTimeout(_0x1864a7[_0xd7f8('0x27')]['bind'](_0x1864a7,_0x4ab204),_0x1864a7[_0xd7f8('0x4')][_0x43333a][_0xd7f8('0x25')]*0x3e8);_0x1864a7[_0xd7f8('0x6')][_0x4ab204][_0xd7f8('0x28')]=moment()[_0xd7f8('0x29')](_0xd7f8('0x2a'));_0x1864a7[_0xd7f8('0x6')][_0x4ab204][_0xd7f8('0x2b')]=_0x239fa8;_0x1864a7[_0xd7f8('0x6')][_0x4ab204][_0xd7f8('0x17')]=_0x43333a;_0x1864a7[_0xd7f8('0x6')][_0x4ab204][_0xd7f8('0x2c')]=function(){var _0x3c6b34=getDiff(_0x1864a7['timers'][_0x4ab204][_0xd7f8('0x28')]);clearTimeout(_0x1864a7[_0xd7f8('0x6')][_0x4ab204][_0xd7f8('0x26')]);_0x1864a7[_0xd7f8('0x6')][_0x4ab204]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x3c6b34},_0x1864a7[_0xd7f8('0x6')][_0x4ab204][_0xd7f8('0x2b')],_0x4ab204)[_0xd7f8('0x1d')](function(_0x599ec1){logger[_0xd7f8('0x1f')](_0xd7f8('0x2d'),_0x239fa8,_0x3c6b34,_0x599ec1);})[_0xd7f8('0x2e')](function(_0x29ed7d){logger[_0xd7f8('0x2f')](_0xd7f8('0x30'),_0x239fa8,_0x29ed7d);});delete _0x1864a7['timers'][_0x4ab204];};}});}else{logger['info'](_0xd7f8('0x31'),_0x239fa8,_0x4ab204,_0x43333a);}});}})[_0xd7f8('0x2e')](function(_0xb1bfa6){logger['error'](_0xd7f8('0x24'),_0x239fa8,_0x1864a7['voiceQueues'][_0x43333a]['acwTimeout'],_0x4ab204,_0x43333a);})[_0xd7f8('0x32')](function(){delete _0x1864a7[_0xd7f8('0x16')][_0x239fa8];});}catch(_0x4966bd){logger['error'](_0xd7f8('0x33'),_0x4966bd[_0xd7f8('0x34')]);}};Acw[_0xd7f8('0x35')][_0xd7f8('0x27')]=function(_0x56912f){try{var _0x1c6c1b=this;if(_0x1c6c1b[_0xd7f8('0x6')][_0x56912f]){_0x1c6c1b[_0xd7f8('0x6')][_0x56912f][_0xd7f8('0x26')]=![];var _0x371dc5=_0x1c6c1b[_0xd7f8('0x6')][_0x56912f][_0xd7f8('0x2b')];var _0x2ffc92=_0x1c6c1b['timers'][_0x56912f][_0xd7f8('0x17')];var _0x306d28=_0x1c6c1b[_0xd7f8('0x4')][_0x2ffc92][_0xd7f8('0x25')];logger['info'](_0xd7f8('0x36'),_0x371dc5,_0x56912f);RpcUser[_0xd7f8('0x37')](this[_0xd7f8('0x5')][_0x56912f]);RpcVoiceAgentReport[_0xd7f8('0x38')]({'acwtime':_0x306d28,'agentacw':!![]},_0x371dc5,_0x56912f)['then'](function(_0x2e8c8a){logger[_0xd7f8('0x1f')](_0xd7f8('0x2d'),_0x371dc5,_0x306d28,_0x2e8c8a);})['catch'](function(_0x5e25c6){logger[_0xd7f8('0x2f')](_0xd7f8('0x30'),_0x371dc5,_0x5e25c6);});}else{logger[_0xd7f8('0x2f')](_0xd7f8('0x39'),_0x56912f);if(_0x1c6c1b[_0xd7f8('0x6')]){logger['info']('[ACW][TIMERS]',JSON[_0xd7f8('0x3a')](_0x1c6c1b[_0xd7f8('0x6')]));}}}catch(_0x32d319){logger[_0xd7f8('0x2f')](_0xd7f8('0x3b'),_0x32d319[_0xd7f8('0x34')]);}};Acw['prototype'][_0xd7f8('0x8')]=function(_0x1c7187){try{if(this[_0xd7f8('0x4')][_0x1c7187[_0xd7f8('0x17')]]&&(this[_0xd7f8('0x4')][_0x1c7187['queue']][_0xd7f8('0x2')]||this['voiceQueues'][_0x1c7187[_0xd7f8('0x17')]][_0xd7f8('0x19')])){if(this['agents'][_0x1c7187[_0xd7f8('0x15')]]){this[_0xd7f8('0x16')][_0x1c7187['uniqueid']]={'queue':_0x1c7187[_0xd7f8('0x17')],'interface':_0x1c7187['interface'],'destlinkedid':_0x1c7187[_0xd7f8('0x22')]};}}}catch(_0xbee29a){logger[_0xd7f8('0x2f')]('[ACW][syncAgentConnect]\x20%s',_0xbee29a[_0xd7f8('0x34')]);}};Acw[_0xd7f8('0x35')][_0xd7f8('0x11')]=function(_0x55ef7b){try{if(this['voiceQueues'][_0x55ef7b[_0xd7f8('0x17')]]&&(this[_0xd7f8('0x4')][_0x55ef7b['queue']][_0xd7f8('0x2')]||this[_0xd7f8('0x4')][_0x55ef7b[_0xd7f8('0x17')]][_0xd7f8('0x19')])){if(this[_0xd7f8('0x5')][_0x55ef7b[_0xd7f8('0x15')]]){this[_0xd7f8('0x16')][_0x55ef7b[_0xd7f8('0x2b')]]={'queue':_0x55ef7b[_0xd7f8('0x17')],'interface':_0x55ef7b[_0xd7f8('0x15')]};}}}catch(_0x41f047){logger['error'](_0xd7f8('0x3c'),_0x41f047[_0xd7f8('0x34')]);}};Acw['prototype'][_0xd7f8('0x9')]=function(_0x24f71f){try{if(this['channels'][_0x24f71f[_0xd7f8('0x2b')]]&&_[_0xd7f8('0x3d')](this[_0xd7f8('0x16')][_0x24f71f[_0xd7f8('0x2b')]]['attended'])){logger[_0xd7f8('0x1f')](_0xd7f8('0x3e'),_0x24f71f[_0xd7f8('0x2b')]);this[_0xd7f8('0x3f')](_0x24f71f[_0xd7f8('0x2b')]);}else if(this[_0xd7f8('0x16')][_0x24f71f['linkedid']]&&_[_0xd7f8('0x3d')](this[_0xd7f8('0x16')][_0x24f71f[_0xd7f8('0x40')]]['attended'])){logger[_0xd7f8('0x1f')](_0xd7f8('0x41'),_0x24f71f[_0xd7f8('0x40')]);this['startAcw'](_0x24f71f[_0xd7f8('0x40')]);}}catch(_0x316bb7){logger[_0xd7f8('0x2f')](_0xd7f8('0x42'),_0x316bb7[_0xd7f8('0x34')]);}};Acw[_0xd7f8('0x35')][_0xd7f8('0xc')]=function(_0x33edca){try{if(this['channels'][_0x33edca[_0xd7f8('0x2b')]]&&this[_0xd7f8('0x16')][_0x33edca[_0xd7f8('0x2b')]][_0xd7f8('0x21')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x33edca['uniqueid']);this['startAcw'](_0x33edca[_0xd7f8('0x2b')]);}else if(this['channels'][_0x33edca['linkedid']]&&this[_0xd7f8('0x16')][_0x33edca[_0xd7f8('0x40')]][_0xd7f8('0x21')]){logger[_0xd7f8('0x1f')](_0xd7f8('0x43'),_0x33edca[_0xd7f8('0x40')]);this['startAcw'](_0x33edca[_0xd7f8('0x40')]);}}catch(_0x48cafe){logger[_0xd7f8('0x2f')]('[ACW][syncHangup]\x20%s',_0x48cafe[_0xd7f8('0x34')]);}};Acw[_0xd7f8('0x35')]['syncAttendedTransfer']=function(_0x1eff7e){try{if(!_[_0xd7f8('0x44')](this[_0xd7f8('0x16')][_0x1eff7e[_0xd7f8('0x45')]])){this[_0xd7f8('0x3f')](_0x1eff7e[_0xd7f8('0x45')]);if(this[_0xd7f8('0x16')][_0x1eff7e[_0xd7f8('0x46')]]){this[_0xd7f8('0x16')][_0x1eff7e['secondtransfereruniqueid']][_0xd7f8('0x21')]=!![];this['channels'][_0x1eff7e['transfertargetuniqueid']]=this['channels'][_0x1eff7e[_0xd7f8('0x46')]];delete this[_0xd7f8('0x16')][_0x1eff7e[_0xd7f8('0x46')]];}}else if(!_[_0xd7f8('0x44')](this[_0xd7f8('0x16')][_0x1eff7e['transfertargetuniqueid']])){this[_0xd7f8('0x3f')](_0x1eff7e[_0xd7f8('0x47')]);if(this[_0xd7f8('0x16')][_0x1eff7e[_0xd7f8('0x48')]]){this[_0xd7f8('0x16')][_0x1eff7e[_0xd7f8('0x48')]]['attended']=!![];this['channels'][_0x1eff7e[_0xd7f8('0x45')]]=this['channels'][_0x1eff7e[_0xd7f8('0x48')]];delete this[_0xd7f8('0x16')][_0x1eff7e['origtransfereruniqueid']];}}}catch(_0x4a09f0){logger[_0xd7f8('0x2f')](_0xd7f8('0x49'),_0x4a09f0['message']);}};Acw['prototype'][_0xd7f8('0xf')]=function(_0x21edfd){try{if(this[_0xd7f8('0x16')][_0x21edfd[_0xd7f8('0x4a')]]){logger['info'](_0xd7f8('0x4b'),JSON['stringify'](_0x21edfd[_0xd7f8('0x4a')]));this[_0xd7f8('0x3f')](_0x21edfd[_0xd7f8('0x4a')]);}else if(this[_0xd7f8('0x16')][_0x21edfd['transfererlinkedid']]){logger[_0xd7f8('0x1f')](_0xd7f8('0x4c'),JSON[_0xd7f8('0x3a')](_0x21edfd[_0xd7f8('0x4d')]));this[_0xd7f8('0x3f')](_0x21edfd[_0xd7f8('0x4d')]);}}catch(_0x4eeff6){logger[_0xd7f8('0x2f')](_0xd7f8('0x4e'),_0x4eeff6[_0xd7f8('0x34')]);}};Acw[_0xd7f8('0x35')][_0xd7f8('0x4f')]=function(_0x57fc9b){try{if(this[_0xd7f8('0x4')][_0x57fc9b[_0xd7f8('0x17')]]&&this['voiceQueues'][_0x57fc9b['queue']][_0xd7f8('0x50')]===_0xd7f8('0x51')){if(this[_0xd7f8('0x5')][_0x57fc9b[_0xd7f8('0x15')]]){logger[_0xd7f8('0x1f')](_0xd7f8('0x52'),_0x57fc9b[_0xd7f8('0x2b')],_0x57fc9b[_0xd7f8('0x15')],_0x57fc9b[_0xd7f8('0x17')]);return RpcUser[_0xd7f8('0x23')](this['agents'][_0x57fc9b[_0xd7f8('0x15')]],_0xd7f8('0x53'),_0x57fc9b[_0xd7f8('0x2b')]);}}}catch(_0x34acf9){logger[_0xd7f8('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x34acf9[_0xd7f8('0x34')]);}};module[_0xd7f8('0x54')]=Acw;
\ No newline at end of file
index db4fa14..db6fb11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x3e20d2,_0x3a5999){var _0x59ba90=function(_0x57ee31){while(--_0x57ee31){_0x3e20d2['push'](_0x3e20d2['shift']());}};_0x59ba90(++_0x3a5999);}(_0x757a,0xde));var _0xa757=function(_0x569f15,_0x3e5bc5){_0x569f15=_0x569f15-0x0;var _0x1f1136=_0x757a[_0x569f15];return _0x1f1136;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami;
\ No newline at end of file
+var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x1b66ca,_0x1fd8b4){var _0x5d4cca=function(_0xc27add){while(--_0xc27add){_0x1b66ca['push'](_0x1b66ca['shift']());}};_0x5d4cca(++_0x1fd8b4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami;
\ No newline at end of file
index d7f0712..7ba9aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x380df2,_0x281a15){var _0x47f4df=function(_0x132241){while(--_0x132241){_0x380df2['push'](_0x380df2['shift']());}};_0x47f4df(++_0x281a15);}(_0xaa88,0x137));var _0x8aa8=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xaa88[_0x5d8018];return _0x151ac4;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client;
\ No newline at end of file
+var _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x566106,_0x2b2ab7){var _0x27d883=function(_0x1e19c4){while(--_0x1e19c4){_0x566106['push'](_0x566106['shift']());}};_0x27d883(++_0x2b2ab7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client;
\ No newline at end of file
index c4ccca7..ac91074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66eb=['moment','isNil','string','voiceQueue','uniqueid','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','name','dialCutDigit','substring','util','lodash'];(function(_0x2fdde1,_0x55d6ea){var _0x49ab94=function(_0x3bf3c0){while(--_0x3bf3c0){_0x2fdde1['push'](_0x2fdde1['shift']());}};_0x49ab94(++_0x55d6ea);}(_0x66eb,0x12b));var _0xb66e=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0x66eb[_0x39872b];return _0x55fa18;};'use strict';var util=require(_0xb66e('0x0'));var _=require(_0xb66e('0x1'));var moment=require(_0xb66e('0x2'));function checkNameSurname(_0x16a86e,_0x31cca7,_0x3a11b7){var _0x4d2c29='';if(!_[_0xb66e('0x3')](_0x31cca7)&&_0xb66e('0x4')===typeof _0x31cca7){_0x4d2c29+=_0x31cca7;}if(!_[_0xb66e('0x3')](_0x3a11b7)&&_0xb66e('0x4')===typeof _0x3a11b7){_0x4d2c29+='\x20'+_0x3a11b7;}if(_0x4d2c29!==''){return _0x4d2c29;}return _0x16a86e;}function Action(_0x2d5c17,_0x5b8582,_0x574668){this[_0xb66e('0x5')]=_0x2d5c17;this[_0xb66e('0x6')]=_0x574668||undefined;this['name']=checkNameSurname(_0x5b8582[_0xb66e('0x7')][_0xb66e('0x8')],_0x5b8582[_0xb66e('0x7')]['firstName'],_0x5b8582[_0xb66e('0x7')][_0xb66e('0x9')]);this[_0xb66e('0xa')]=_0x5b8582[_0xb66e('0x7')][_0xb66e('0x8')];this[_0xb66e('0xb')]=_0x2d5c17['name'];this[_0xb66e('0xc')]=_0x5b8582[_0xb66e('0xc')]||![];this[_0xb66e('0xd')]=_0x2d5c17[_0xb66e('0xd')];this[_0xb66e('0xe')]=_0x2d5c17[_0xb66e('0xe')]||0x3;this[_0xb66e('0xf')]=_0x5b8582[_0xb66e('0xf')];this['countbusyretry']=_0x5b8582[_0xb66e('0x10')];this[_0xb66e('0x11')]=_0x5b8582[_0xb66e('0x11')];this[_0xb66e('0x12')]=_0x5b8582[_0xb66e('0x12')];this['countnosuchnumberretry']=_0x5b8582['countnosuchnumberretry'];this['countdropretry']=_0x5b8582[_0xb66e('0x13')];this['countabandonedretry']=_0x5b8582['countabandonedretry'];this['countmachineretry']=_0x5b8582[_0xb66e('0x14')];this[_0xb66e('0x15')]=_0x5b8582[_0xb66e('0x15')];this['ContactId']=_0x5b8582[_0xb66e('0x16')];this[_0xb66e('0x17')]=_0x5b8582[_0xb66e('0x17')];this[_0xb66e('0x18')]=_0x5b8582['UserId'];this[_0xb66e('0x19')]=_0x5b8582[_0xb66e('0x19')];this[_0xb66e('0x1a')]=_0x5b8582['CampaignId'];this[_0xb66e('0x1b')]=_0x5b8582['id'];this[_0xb66e('0x1c')]=_0x5b8582['Contact'][_0xb66e('0x1d')]||'';this[_0xb66e('0x1e')]=moment()['format'](_0xb66e('0x1f'));this['callback']=_0x5b8582['callback'];this['callbackuniqueid']=_0x5b8582[_0xb66e('0x20')];this[_0xb66e('0x21')]=_0x5b8582[_0xb66e('0x21')];this[_0xb66e('0x22')]=_0x5b8582[_0xb66e('0x22')];this['originatecalleridnum']='';this[_0xb66e('0x23')]='';}Action[_0xb66e('0x24')][_0xb66e('0x25')]=function(){return util[_0xb66e('0x26')](_0xb66e('0x27'),this[_0xb66e('0x28')],this[_0xb66e('0x5')][_0xb66e('0x29')]>0x0?this['number'][_0xb66e('0x2a')](this['voiceQueue'][_0xb66e('0x29')]):this[_0xb66e('0xa')]);};Action[_0xb66e('0x24')]['getQueue']=function(){return this['queue'];};module['exports']=Action;
\ No newline at end of file
+var _0x0430=['voiceQueue','uniqueid','name','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','substring','util','string'];(function(_0x533738,_0x190a00){var _0x4c5efc=function(_0x14820a){while(--_0x14820a){_0x533738['push'](_0x533738['shift']());}};_0x4c5efc(++_0x190a00);}(_0x0430,0x70));var _0x0043=function(_0x35c2cc,_0x278a6f){_0x35c2cc=_0x35c2cc-0x0;var _0x2ed902=_0x0430[_0x35c2cc];return _0x2ed902;};'use strict';var util=require(_0x0043('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x3cfc05,_0x1bfb06,_0x38970e){var _0x58325d='';if(!_['isNil'](_0x1bfb06)&&_0x0043('0x1')===typeof _0x1bfb06){_0x58325d+=_0x1bfb06;}if(!_['isNil'](_0x38970e)&&_0x0043('0x1')===typeof _0x38970e){_0x58325d+='\x20'+_0x38970e;}if(_0x58325d!==''){return _0x58325d;}return _0x3cfc05;}function Action(_0xb8fc2f,_0x55a39a,_0x17ba0b){this[_0x0043('0x2')]=_0xb8fc2f;this[_0x0043('0x3')]=_0x17ba0b||undefined;this[_0x0043('0x4')]=checkNameSurname(_0x55a39a[_0x0043('0x5')]['phone'],_0x55a39a['Contact'][_0x0043('0x6')],_0x55a39a[_0x0043('0x5')][_0x0043('0x7')]);this[_0x0043('0x8')]=_0x55a39a[_0x0043('0x5')]['phone'];this[_0x0043('0x9')]=_0xb8fc2f[_0x0043('0x4')];this[_0x0043('0xa')]=_0x55a39a[_0x0043('0xa')]||![];this['type']=_0xb8fc2f[_0x0043('0xb')];this[_0x0043('0xc')]=_0xb8fc2f['dialQueueTimeout']||0x3;this['scheduledat']=_0x55a39a[_0x0043('0xd')];this[_0x0043('0xe')]=_0x55a39a['countbusyretry'];this['countcongestionretry']=_0x55a39a['countcongestionretry'];this[_0x0043('0xf')]=_0x55a39a[_0x0043('0xf')];this['countnosuchnumberretry']=_0x55a39a[_0x0043('0x10')];this[_0x0043('0x11')]=_0x55a39a[_0x0043('0x11')];this[_0x0043('0x12')]=_0x55a39a[_0x0043('0x12')];this[_0x0043('0x13')]=_0x55a39a['countmachineretry'];this[_0x0043('0x14')]=_0x55a39a[_0x0043('0x14')];this[_0x0043('0x15')]=_0x55a39a[_0x0043('0x15')];this['ListId']=_0x55a39a['ListId'];this['UserId']=_0x55a39a[_0x0043('0x16')];this[_0x0043('0x17')]=_0x55a39a['VoiceQueueId'];this['CampaignId']=_0x55a39a[_0x0043('0x18')];this[_0x0043('0x19')]=_0x55a39a['id'];this[_0x0043('0x1a')]=_0x55a39a[_0x0043('0x5')][_0x0043('0x6')]||'';this['starttime']=moment()[_0x0043('0x1b')](_0x0043('0x1c'));this['callback']=_0x55a39a[_0x0043('0x1d')];this[_0x0043('0x1e')]=_0x55a39a[_0x0043('0x1e')];this[_0x0043('0x1f')]=_0x55a39a[_0x0043('0x1f')];this[_0x0043('0x20')]=_0x55a39a['recallme'];this[_0x0043('0x21')]='';this[_0x0043('0x22')]='';}Action[_0x0043('0x23')]['getCaller']=function(){return util['format'](_0x0043('0x24'),this[_0x0043('0x4')],this[_0x0043('0x2')]['dialCutDigit']>0x0?this[_0x0043('0x8')][_0x0043('0x25')](this['voiceQueue']['dialCutDigit']):this[_0x0043('0x8')]);};Action[_0x0043('0x23')]['getQueue']=function(){return this[_0x0043('0x9')];};module['exports']=Action;
\ No newline at end of file
index 3816f9e..689e661 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50bf=['holdtime','answertime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x175924,_0x364d6a){var _0x857a66=function(_0x57879b){while(--_0x57879b){_0x175924['push'](_0x175924['shift']());}};_0x857a66(++_0x364d6a);}(_0x50bf,0x106));var _0xf50b=function(_0x3953a8,_0x37668a){_0x3953a8=_0x3953a8-0x0;var _0x7a6236=_0x50bf[_0x3953a8];return _0x7a6236;};'use strict';var util=require('util');var _=require(_0xf50b('0x0'));var moment=require('moment');function getSeconds(_0x288799,_0x2aabbf){var _0x5d6cf3=moment(_0x288799)[_0xf50b('0x1')](0x0);var _0x316af8=moment(_0x2aabbf)['milliseconds'](0x0);return _0x5d6cf3[_0xf50b('0x2')](_0x316af8,'seconds');}function AgentComplete(_0x80306,_0x5e2290){this[_0xf50b('0x3')]=0x4;this[_0xf50b('0x4')]=_0xf50b('0x5');this['scheduledat']=_0x80306[_0xf50b('0x6')];this[_0xf50b('0x7')]=_0x80306['type'];this['campaigntype']=_0x80306['type']==='outbound'?_0xf50b('0x8'):_0x80306[_0xf50b('0x7')];this['countbusyretry']=_0x80306[_0xf50b('0x9')];this['countcongestionretry']=_0x80306[_0xf50b('0xa')];this[_0xf50b('0xb')]=_0x80306['countnoanswerretry'];this[_0xf50b('0xc')]=_0x80306[_0xf50b('0x9')]+_0x80306['countcongestionretry']+_0x80306[_0xf50b('0xb')]+_0x80306[_0xf50b('0xd')]+_0x80306[_0xf50b('0xe')]+_0x80306[_0xf50b('0xf')]+_0x80306['countmachineretry']+_0x80306[_0xf50b('0x10')];this[_0xf50b('0xd')]=_0x80306[_0xf50b('0xd')];this[_0xf50b('0xe')]=_0x80306['countdropretry'];this['countabandonedretry']=_0x80306[_0xf50b('0xf')];this['countmachineretry']=_0x80306[_0xf50b('0x11')];this[_0xf50b('0x10')]=_0x80306[_0xf50b('0x10')];this[_0xf50b('0x12')]=_0x5e2290['uniqueid'];this['calleridname']=_0x80306[_0xf50b('0x13')];this['calleridnum']=_0x80306['number'];this[_0xf50b('0x14')]=_0x80306[_0xf50b('0x14')];this[_0xf50b('0x15')]=_0x80306[_0xf50b('0x15')];this['answertime']=_0x80306['answertime'];this[_0xf50b('0x16')]=moment()['format'](_0xf50b('0x17'));this[_0xf50b('0x18')]=getSeconds(_0x80306[_0xf50b('0x15')],_0x80306[_0xf50b('0x14')]);this[_0xf50b('0x19')]=getSeconds(_0x80306[_0xf50b('0x1a')],_0x80306[_0xf50b('0x15')]);this[_0xf50b('0x1b')]=getSeconds(this[_0xf50b('0x16')],_0x80306['answertime']);this[_0xf50b('0x8')]=_0x5e2290[_0xf50b('0x8')];this[_0xf50b('0x1c')]=_0x5e2290[_0xf50b('0x1c')];this[_0xf50b('0x1d')]=_0x5e2290[_0xf50b('0x1d')];this['callback']=_0x80306[_0xf50b('0x1e')];this[_0xf50b('0x1f')]=_0x80306['callbackuniqueid'];this['callbackat']=_0x80306[_0xf50b('0x20')];this[_0xf50b('0x21')]=_0x80306[_0xf50b('0x21')];this['ContactId']=_0x80306[_0xf50b('0x22')];this[_0xf50b('0x23')]=_0x80306['ListId'];this[_0xf50b('0x24')]=_0x80306[_0xf50b('0x24')];this[_0xf50b('0x25')]=_0x80306[_0xf50b('0x25')];this[_0xf50b('0x26')]=_0x80306[_0xf50b('0x26')];this[_0xf50b('0x27')]=_0x80306[_0xf50b('0x27')]||'';this['originatecalleridname']=_0x80306['originatecalleridname']||'';}module[_0xf50b('0x28')]=AgentComplete;
\ No newline at end of file
+var _0x8654=['starttime','responsetime','answertime','endtime','format','ringtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','number'];(function(_0xe7782a,_0x4e541d){var _0x276a3a=function(_0x35d2f8){while(--_0x35d2f8){_0xe7782a['push'](_0xe7782a['shift']());}};_0x276a3a(++_0x4e541d);}(_0x8654,0xfa));var _0x4865=function(_0x5e6c70,_0x4a139b){_0x5e6c70=_0x5e6c70-0x0;var _0x5b8821=_0x8654[_0x5e6c70];return _0x5b8821;};'use strict';var util=require('util');var _=require(_0x4865('0x0'));var moment=require(_0x4865('0x1'));function getSeconds(_0x477eca,_0x10ca5d){var _0x2745e3=moment(_0x477eca)[_0x4865('0x2')](0x0);var _0x3f63e7=moment(_0x10ca5d)[_0x4865('0x2')](0x0);return _0x2745e3[_0x4865('0x3')](_0x3f63e7,_0x4865('0x4'));}function AgentComplete(_0x58dc25,_0x34d3b3){this[_0x4865('0x5')]=0x4;this[_0x4865('0x6')]=_0x4865('0x7');this['scheduledat']=_0x58dc25[_0x4865('0x8')];this[_0x4865('0x9')]=_0x58dc25[_0x4865('0x9')];this[_0x4865('0xa')]=_0x58dc25[_0x4865('0x9')]===_0x4865('0xb')?_0x4865('0xc'):_0x58dc25[_0x4865('0x9')];this['countbusyretry']=_0x58dc25[_0x4865('0xd')];this[_0x4865('0xe')]=_0x58dc25[_0x4865('0xe')];this[_0x4865('0xf')]=_0x58dc25[_0x4865('0xf')];this[_0x4865('0x10')]=_0x58dc25[_0x4865('0xd')]+_0x58dc25[_0x4865('0xe')]+_0x58dc25['countnoanswerretry']+_0x58dc25[_0x4865('0x11')]+_0x58dc25[_0x4865('0x12')]+_0x58dc25[_0x4865('0x13')]+_0x58dc25['countmachineretry']+_0x58dc25[_0x4865('0x14')];this[_0x4865('0x11')]=_0x58dc25[_0x4865('0x11')];this['countdropretry']=_0x58dc25['countdropretry'];this['countabandonedretry']=_0x58dc25['countabandonedretry'];this[_0x4865('0x15')]=_0x58dc25['countmachineretry'];this[_0x4865('0x14')]=_0x58dc25[_0x4865('0x14')];this[_0x4865('0x16')]=_0x34d3b3[_0x4865('0x16')];this[_0x4865('0x17')]=_0x58dc25['name'];this[_0x4865('0x18')]=_0x58dc25[_0x4865('0x19')];this['starttime']=_0x58dc25[_0x4865('0x1a')];this[_0x4865('0x1b')]=_0x58dc25[_0x4865('0x1b')];this[_0x4865('0x1c')]=_0x58dc25[_0x4865('0x1c')];this[_0x4865('0x1d')]=moment()[_0x4865('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4865('0x1f')]=getSeconds(_0x58dc25[_0x4865('0x1b')],_0x58dc25[_0x4865('0x1a')]);this['holdtime']=getSeconds(_0x58dc25[_0x4865('0x1c')],_0x58dc25[_0x4865('0x1b')]);this[_0x4865('0x20')]=getSeconds(this['endtime'],_0x58dc25[_0x4865('0x1c')]);this[_0x4865('0xc')]=_0x34d3b3[_0x4865('0xc')];this['membername']=_0x34d3b3['membername'];this[_0x4865('0x21')]=_0x34d3b3['reason'];this[_0x4865('0x22')]=_0x58dc25[_0x4865('0x22')];this[_0x4865('0x23')]=_0x58dc25[_0x4865('0x23')];this[_0x4865('0x24')]=_0x58dc25[_0x4865('0x24')];this[_0x4865('0x25')]=_0x58dc25[_0x4865('0x25')];this[_0x4865('0x26')]=_0x58dc25[_0x4865('0x26')];this['ListId']=_0x58dc25[_0x4865('0x27')];this[_0x4865('0x28')]=_0x58dc25['UserId'];this[_0x4865('0x29')]=_0x58dc25[_0x4865('0x29')];this['CampaignId']=_0x58dc25[_0x4865('0x2a')];this[_0x4865('0x2b')]=_0x58dc25[_0x4865('0x2b')]||'';this[_0x4865('0x2c')]=_0x58dc25[_0x4865('0x2c')]||'';}module[_0x4865('0x2d')]=AgentComplete;
\ No newline at end of file
index 2ed3d76..10c7262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac31=['holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime'];(function(_0xe4d35a,_0x4bd94d){var _0x249363=function(_0x3da3fe){while(--_0x3da3fe){_0xe4d35a['push'](_0xe4d35a['shift']());}};_0x249363(++_0x4bd94d);}(_0xac31,0xca));var _0x1ac3=function(_0x3b10dc,_0x5c181f){_0x3b10dc=_0x3b10dc-0x0;var _0x306b50=_0xac31[_0x3b10dc];return _0x306b50;};'use strict';var util=require(_0x1ac3('0x0'));var _=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));function getSeconds(_0x3086c0,_0xd6934){var _0x11dd6d=moment(_0x3086c0)[_0x1ac3('0x3')](0x0);var _0x59b42c=moment(_0xd6934)[_0x1ac3('0x3')](0x0);return _0x11dd6d[_0x1ac3('0x4')](_0x59b42c,'seconds');}function Final(_0x5ef1b6){this[_0x1ac3('0x5')]=_0x5ef1b6[_0x1ac3('0x5')];this[_0x1ac3('0x6')]=_0x5ef1b6[_0x1ac3('0x6')];this[_0x1ac3('0x7')]=_0x5ef1b6['type'];this[_0x1ac3('0x8')]=_0x5ef1b6['type']===_0x1ac3('0x9')?_0x1ac3('0xa'):_0x5ef1b6[_0x1ac3('0x7')];this['countbusyretry']=_0x5ef1b6[_0x1ac3('0xb')];this[_0x1ac3('0xc')]=_0x5ef1b6[_0x1ac3('0xc')];this[_0x1ac3('0xd')]=_0x5ef1b6[_0x1ac3('0xd')];this[_0x1ac3('0xe')]=_0x5ef1b6['countbusyretry']+_0x5ef1b6[_0x1ac3('0xc')]+_0x5ef1b6[_0x1ac3('0xd')]+_0x5ef1b6[_0x1ac3('0xf')]+_0x5ef1b6[_0x1ac3('0x10')]+_0x5ef1b6['countabandonedretry']+_0x5ef1b6[_0x1ac3('0x11')]+_0x5ef1b6[_0x1ac3('0x12')];this[_0x1ac3('0xf')]=_0x5ef1b6[_0x1ac3('0xf')];this['countdropretry']=_0x5ef1b6[_0x1ac3('0x10')];this[_0x1ac3('0x13')]=_0x5ef1b6['countabandonedretry'];this[_0x1ac3('0x11')]=_0x5ef1b6[_0x1ac3('0x11')];this[_0x1ac3('0x12')]=_0x5ef1b6['countagentrejectretry'];this[_0x1ac3('0xa')]=_0x5ef1b6[_0x1ac3('0xa')];this[_0x1ac3('0x14')]=_0x5ef1b6['calleridname'];this[_0x1ac3('0x15')]=_0x5ef1b6['calleridnum'];this[_0x1ac3('0x16')]=_0x5ef1b6[_0x1ac3('0x16')];this[_0x1ac3('0x17')]=_0x5ef1b6[_0x1ac3('0x17')];this[_0x1ac3('0x18')]=_0x5ef1b6['responsetime'];this[_0x1ac3('0x19')]=_0x5ef1b6[_0x1ac3('0x19')]||0x0;this[_0x1ac3('0x1a')]=_0x5ef1b6[_0x1ac3('0x1a')]||0x0;this['talktime']=_0x5ef1b6['talktime']||0x0;this[_0x1ac3('0x1b')]=_0x5ef1b6[_0x1ac3('0x1b')];this[_0x1ac3('0x1c')]=_0x5ef1b6[_0x1ac3('0x1c')];this[_0x1ac3('0x1d')]=_0x5ef1b6[_0x1ac3('0x1d')];this[_0x1ac3('0x1e')]=_0x5ef1b6[_0x1ac3('0x1e')];this[_0x1ac3('0x1f')]=_0x5ef1b6['ContactId'];this[_0x1ac3('0x20')]=_0x5ef1b6[_0x1ac3('0x20')];this['UserId']=_0x5ef1b6[_0x1ac3('0x21')];this[_0x1ac3('0x22')]=_0x5ef1b6['VoiceQueueId'];this[_0x1ac3('0x23')]=_0x5ef1b6[_0x1ac3('0x23')];this[_0x1ac3('0x24')]=_0x5ef1b6[_0x1ac3('0x24')]||'';this[_0x1ac3('0x25')]=_0x5ef1b6['originatecalleridname']||'';}module['exports']=Final;
\ No newline at end of file
+var _0x0309=['responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0309,0x165));var _0x9030=function(_0x23dd5b,_0x43744d){_0x23dd5b=_0x23dd5b-0x0;var _0x2a50e3=_0x0309[_0x23dd5b];return _0x2a50e3;};'use strict';var util=require(_0x9030('0x0'));var _=require('lodash');var moment=require(_0x9030('0x1'));function getSeconds(_0x4875db,_0x5b1a40){var _0x352a94=moment(_0x4875db)[_0x9030('0x2')](0x0);var _0x4236be=moment(_0x5b1a40)[_0x9030('0x2')](0x0);return _0x352a94[_0x9030('0x3')](_0x4236be,_0x9030('0x4'));}function Final(_0x482786){this['uniqueid']=_0x482786[_0x9030('0x5')];this[_0x9030('0x6')]=_0x482786['scheduledat'];this[_0x9030('0x7')]=_0x482786['type'];this[_0x9030('0x8')]=_0x482786[_0x9030('0x7')]===_0x9030('0x9')?'queue':_0x482786[_0x9030('0x7')];this[_0x9030('0xa')]=_0x482786[_0x9030('0xa')];this['countcongestionretry']=_0x482786[_0x9030('0xb')];this[_0x9030('0xc')]=_0x482786[_0x9030('0xc')];this[_0x9030('0xd')]=_0x482786[_0x9030('0xa')]+_0x482786[_0x9030('0xb')]+_0x482786[_0x9030('0xc')]+_0x482786['countnosuchnumberretry']+_0x482786[_0x9030('0xe')]+_0x482786[_0x9030('0xf')]+_0x482786[_0x9030('0x10')]+_0x482786[_0x9030('0x11')];this['countnosuchnumberretry']=_0x482786[_0x9030('0x12')];this[_0x9030('0xe')]=_0x482786[_0x9030('0xe')];this[_0x9030('0xf')]=_0x482786[_0x9030('0xf')];this[_0x9030('0x10')]=_0x482786[_0x9030('0x10')];this[_0x9030('0x11')]=_0x482786[_0x9030('0x11')];this['queue']=_0x482786[_0x9030('0x13')];this[_0x9030('0x14')]=_0x482786[_0x9030('0x14')];this[_0x9030('0x15')]=_0x482786[_0x9030('0x15')];this[_0x9030('0x16')]=_0x482786[_0x9030('0x16')];this[_0x9030('0x17')]=_0x482786[_0x9030('0x17')];this[_0x9030('0x18')]=_0x482786[_0x9030('0x17')];this[_0x9030('0x19')]=_0x482786[_0x9030('0x19')]||0x0;this[_0x9030('0x1a')]=_0x482786[_0x9030('0x1a')]||0x0;this[_0x9030('0x1b')]=_0x482786[_0x9030('0x1b')]||0x0;this['callback']=_0x482786['callback'];this[_0x9030('0x1c')]=_0x482786[_0x9030('0x1c')];this['callbackat']=_0x482786[_0x9030('0x1d')];this[_0x9030('0x1e')]=_0x482786[_0x9030('0x1e')];this[_0x9030('0x1f')]=_0x482786['ContactId'];this[_0x9030('0x20')]=_0x482786['ListId'];this['UserId']=_0x482786[_0x9030('0x21')];this[_0x9030('0x22')]=_0x482786[_0x9030('0x22')];this['CampaignId']=_0x482786[_0x9030('0x23')];this[_0x9030('0x24')]=_0x482786[_0x9030('0x24')]||'';this[_0x9030('0x25')]=_0x482786[_0x9030('0x25')]||'';}module['exports']=Final;
\ No newline at end of file
index 7cce4e9..c777dac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e1=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x5b1df5,_0x25e738){var _0x158df4=function(_0x63a762){while(--_0x63a762){_0x5b1df5['push'](_0x5b1df5['shift']());}};_0x158df4(++_0x25e738);}(_0xb7e1,0xc7));var _0x1b7e=function(_0x40b798,_0x3a83a7){_0x40b798=_0x40b798-0x0;var _0x323106=_0xb7e1[_0x40b798];return _0x323106;};'use strict';var util=require(_0x1b7e('0x0'));var _=require(_0x1b7e('0x1'));var moment=require(_0x1b7e('0x2'));function getSeconds(_0x44dea5,_0x5e86bc){var _0x1d9945=moment(_0x44dea5)[_0x1b7e('0x3')](0x0);var _0x1a8ee9=moment(_0x5e86bc)['milliseconds'](0x0);return _0x1d9945[_0x1b7e('0x4')](_0x1a8ee9,_0x1b7e('0x5'));}function Hangup(_0xd1233d,_0x565170){this[_0x1b7e('0x6')]=0x4;this[_0x1b7e('0x7')]=_0x1b7e('0x8');this[_0x1b7e('0x9')]=_0xd1233d[_0x1b7e('0x9')];this[_0x1b7e('0xa')]=_0xd1233d[_0x1b7e('0xa')];this[_0x1b7e('0xb')]=_0xd1233d[_0x1b7e('0xa')]==='outbound'?_0x1b7e('0xc'):_0xd1233d[_0x1b7e('0xa')];this['countbusyretry']=_0xd1233d[_0x1b7e('0xd')];this[_0x1b7e('0xe')]=_0xd1233d['countcongestionretry'];this[_0x1b7e('0xf')]=_0xd1233d['countnoanswerretry'];this['countglobal']=_0xd1233d[_0x1b7e('0xd')]+_0xd1233d['countcongestionretry']+_0xd1233d[_0x1b7e('0xf')]+_0xd1233d[_0x1b7e('0x10')]+_0xd1233d[_0x1b7e('0x11')]+_0xd1233d['countabandonedretry']+_0xd1233d['countmachineretry']+_0xd1233d['countagentrejectretry'];this[_0x1b7e('0x10')]=_0xd1233d['countnosuchnumberretry'];this['countdropretry']=_0xd1233d['countdropretry'];this[_0x1b7e('0x12')]=_0xd1233d[_0x1b7e('0x12')];this[_0x1b7e('0x13')]=_0xd1233d[_0x1b7e('0x13')];this['countagentrejectretry']=_0xd1233d[_0x1b7e('0x14')];this[_0x1b7e('0x15')]=_0x565170['uniqueid'];this[_0x1b7e('0x16')]=_0xd1233d[_0x1b7e('0x17')];this[_0x1b7e('0x18')]=_0xd1233d[_0x1b7e('0x19')];this[_0x1b7e('0x1a')]=_0xd1233d['starttime'];this[_0x1b7e('0x1b')]=_0xd1233d[_0x1b7e('0x1b')];this['endtime']=moment()[_0x1b7e('0x1c')](_0x1b7e('0x1d'));this['ringtime']=getSeconds(_0xd1233d[_0x1b7e('0x1b')],_0xd1233d[_0x1b7e('0x1a')]);this[_0x1b7e('0x1e')]=0x0;this[_0x1b7e('0x1f')]=getSeconds(this[_0x1b7e('0x20')],_0xd1233d[_0x1b7e('0x1b')]);this[_0x1b7e('0xc')]=_0xd1233d[_0x1b7e('0xc')];this[_0x1b7e('0x21')]=_0x1b7e('0x22');this['reason']=_0x565170[_0x1b7e('0x23')];this['callback']=_0xd1233d[_0x1b7e('0x24')];this[_0x1b7e('0x25')]=_0xd1233d['callbackuniqueid'];this['callbackat']=_0xd1233d[_0x1b7e('0x26')];this[_0x1b7e('0x27')]=_0xd1233d['recallme'];this[_0x1b7e('0x28')]=_0xd1233d['ContactId'];this[_0x1b7e('0x29')]=_0xd1233d['ListId'];this[_0x1b7e('0x2a')]=_0xd1233d[_0x1b7e('0x2a')];this['VoiceQueueId']=_0xd1233d['VoiceQueueId'];this[_0x1b7e('0x2b')]=_0xd1233d[_0x1b7e('0x2b')];}module[_0x1b7e('0x2c')]=Hangup;
\ No newline at end of file
+var _0x8490=['membername','IVR','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue'];(function(_0x38be8a,_0x1b80f5){var _0x4b75a8=function(_0x5b0292){while(--_0x5b0292){_0x38be8a['push'](_0x38be8a['shift']());}};_0x4b75a8(++_0x1b80f5);}(_0x8490,0x1f0));var _0x0849=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x8490[_0x344a3f];return _0x264712;};'use strict';var util=require(_0x0849('0x0'));var _=require('lodash');var moment=require(_0x0849('0x1'));function getSeconds(_0x925bb4,_0x3714c5){var _0x1395ca=moment(_0x925bb4)[_0x0849('0x2')](0x0);var _0x40104a=moment(_0x3714c5)[_0x0849('0x2')](0x0);return _0x1395ca[_0x0849('0x3')](_0x40104a,'seconds');}function Hangup(_0x224948,_0x162f41){this[_0x0849('0x4')]=0x4;this[_0x0849('0x5')]=_0x0849('0x6');this[_0x0849('0x7')]=_0x224948[_0x0849('0x7')];this[_0x0849('0x8')]=_0x224948[_0x0849('0x8')];this[_0x0849('0x9')]=_0x224948['type']===_0x0849('0xa')?'queue':_0x224948['type'];this[_0x0849('0xb')]=_0x224948[_0x0849('0xb')];this['countcongestionretry']=_0x224948[_0x0849('0xc')];this[_0x0849('0xd')]=_0x224948[_0x0849('0xd')];this[_0x0849('0xe')]=_0x224948[_0x0849('0xb')]+_0x224948['countcongestionretry']+_0x224948[_0x0849('0xd')]+_0x224948[_0x0849('0xf')]+_0x224948[_0x0849('0x10')]+_0x224948[_0x0849('0x11')]+_0x224948[_0x0849('0x12')]+_0x224948[_0x0849('0x13')];this['countnosuchnumberretry']=_0x224948[_0x0849('0xf')];this[_0x0849('0x10')]=_0x224948[_0x0849('0x10')];this[_0x0849('0x11')]=_0x224948[_0x0849('0x11')];this[_0x0849('0x12')]=_0x224948['countmachineretry'];this['countagentrejectretry']=_0x224948[_0x0849('0x13')];this['uniqueid']=_0x162f41[_0x0849('0x14')];this[_0x0849('0x15')]=_0x224948[_0x0849('0x16')];this['calleridnum']=_0x224948[_0x0849('0x17')];this[_0x0849('0x18')]=_0x224948[_0x0849('0x18')];this[_0x0849('0x19')]=_0x224948[_0x0849('0x19')];this[_0x0849('0x1a')]=moment()[_0x0849('0x1b')](_0x0849('0x1c'));this[_0x0849('0x1d')]=getSeconds(_0x224948[_0x0849('0x19')],_0x224948['starttime']);this['holdtime']=0x0;this[_0x0849('0x1e')]=getSeconds(this['endtime'],_0x224948[_0x0849('0x19')]);this[_0x0849('0x1f')]=_0x224948[_0x0849('0x1f')];this[_0x0849('0x20')]=_0x0849('0x21');this['reason']=_0x162f41[_0x0849('0x22')];this[_0x0849('0x23')]=_0x224948[_0x0849('0x23')];this['callbackuniqueid']=_0x224948[_0x0849('0x24')];this['callbackat']=_0x224948['callbackat'];this[_0x0849('0x25')]=_0x224948[_0x0849('0x25')];this[_0x0849('0x26')]=_0x224948['ContactId'];this[_0x0849('0x27')]=_0x224948[_0x0849('0x27')];this[_0x0849('0x28')]=_0x224948[_0x0849('0x28')];this[_0x0849('0x29')]=_0x224948[_0x0849('0x29')];this[_0x0849('0x2a')]=_0x224948['CampaignId'];}module[_0x0849('0x2b')]=Hangup;
\ No newline at end of file
index 0bcc71b..994ae8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35af=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x399242,_0xac788c){var _0x569607=function(_0xc4e314){while(--_0xc4e314){_0x399242['push'](_0x399242['shift']());}};_0x569607(++_0xac788c);}(_0x35af,0xf9));var _0xf35a=function(_0x5be190,_0x26a2f2){_0x5be190=_0x5be190-0x0;var _0x5e5f63=_0x35af[_0x5be190];return _0x5e5f63;};'use strict';var util=require(_0xf35a('0x0'));var _=require(_0xf35a('0x1'));var moment=require('moment');function getSeconds(_0x10116a,_0x27b173){var _0x140a90=moment(_0x10116a)[_0xf35a('0x2')](0x0);var _0x39b572=moment(_0x27b173)[_0xf35a('0x2')](0x0);return _0x140a90['diff'](_0x39b572,_0xf35a('0x3'));}function History(_0x27c321){this['uniqueid']=_0x27c321['uniqueid'];this[_0xf35a('0x4')]=_0x27c321[_0xf35a('0x4')]||undefined;this[_0xf35a('0x5')]=_0x27c321['type'];this['campaigntype']=_0x27c321[_0xf35a('0x5')]===_0xf35a('0x6')?_0xf35a('0x7'):_0x27c321[_0xf35a('0x5')];this[_0xf35a('0x8')]=_0x27c321[_0xf35a('0x8')];this['countcongestionretry']=_0x27c321[_0xf35a('0x9')];this[_0xf35a('0xa')]=_0x27c321['countnoanswerretry'];this['countglobal']=_0x27c321[_0xf35a('0x8')]+_0x27c321[_0xf35a('0x9')]+_0x27c321[_0xf35a('0xa')]+_0x27c321[_0xf35a('0xb')]+_0x27c321[_0xf35a('0xc')]+_0x27c321[_0xf35a('0xd')]+_0x27c321[_0xf35a('0xe')]+_0x27c321[_0xf35a('0xf')];this[_0xf35a('0xb')]=_0x27c321['countnosuchnumberretry'];this[_0xf35a('0xc')]=_0x27c321[_0xf35a('0xc')];this[_0xf35a('0xd')]=_0x27c321[_0xf35a('0xd')];this[_0xf35a('0xe')]=_0x27c321[_0xf35a('0xe')];this[_0xf35a('0xf')]=_0x27c321[_0xf35a('0xf')];this[_0xf35a('0x7')]=_0x27c321[_0xf35a('0x7')];this[_0xf35a('0x10')]=_0x27c321[_0xf35a('0x11')];this[_0xf35a('0x12')]=_0x27c321[_0xf35a('0x13')];this[_0xf35a('0x14')]=_0x27c321[_0xf35a('0x14')];this[_0xf35a('0x15')]=_0x27c321[_0xf35a('0x15')];this[_0xf35a('0x16')]=_0x27c321[_0xf35a('0x15')];this[_0xf35a('0x17')]=getSeconds(_0x27c321[_0xf35a('0x15')],_0x27c321[_0xf35a('0x14')]);this[_0xf35a('0x18')]=0x0;this[_0xf35a('0x19')]=0x0;this[_0xf35a('0x1a')]=_0x27c321[_0xf35a('0x1a')];this[_0xf35a('0x1b')]=_0x27c321[_0xf35a('0x1b')];this['callbackat']=_0x27c321['callbackat'];this[_0xf35a('0x1c')]=_0x27c321[_0xf35a('0x1c')];this[_0xf35a('0x1d')]=_0x27c321['ContactId'];this[_0xf35a('0x1e')]=_0x27c321['ListId'];this[_0xf35a('0x1f')]=_0x27c321[_0xf35a('0x1f')];this['VoiceQueueId']=_0x27c321[_0xf35a('0x20')];this[_0xf35a('0x21')]=_0x27c321[_0xf35a('0x21')];this[_0xf35a('0x22')]=_0x27c321[_0xf35a('0x22')]||'';this[_0xf35a('0x23')]=_0x27c321['originatecalleridname']||'';}module[_0xf35a('0x24')]=History;
\ No newline at end of file
+var _0xefe3=['endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xefe3,0xd1));var _0x3efe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xefe3[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3efe('0x0'));var _=require(_0x3efe('0x1'));var moment=require(_0x3efe('0x2'));function getSeconds(_0x3068fb,_0x23a181){var _0x32ef1b=moment(_0x3068fb)['milliseconds'](0x0);var _0x2aece5=moment(_0x23a181)[_0x3efe('0x3')](0x0);return _0x32ef1b['diff'](_0x2aece5,_0x3efe('0x4'));}function History(_0x904619){this['uniqueid']=_0x904619[_0x3efe('0x5')];this['scheduledat']=_0x904619[_0x3efe('0x6')]||undefined;this[_0x3efe('0x7')]=_0x904619['type'];this['campaigntype']=_0x904619[_0x3efe('0x7')]===_0x3efe('0x8')?'queue':_0x904619[_0x3efe('0x7')];this[_0x3efe('0x9')]=_0x904619[_0x3efe('0x9')];this[_0x3efe('0xa')]=_0x904619[_0x3efe('0xa')];this[_0x3efe('0xb')]=_0x904619[_0x3efe('0xb')];this[_0x3efe('0xc')]=_0x904619[_0x3efe('0x9')]+_0x904619[_0x3efe('0xa')]+_0x904619['countnoanswerretry']+_0x904619['countnosuchnumberretry']+_0x904619[_0x3efe('0xd')]+_0x904619[_0x3efe('0xe')]+_0x904619[_0x3efe('0xf')]+_0x904619['countagentrejectretry'];this[_0x3efe('0x10')]=_0x904619[_0x3efe('0x10')];this[_0x3efe('0xd')]=_0x904619[_0x3efe('0xd')];this[_0x3efe('0xe')]=_0x904619[_0x3efe('0xe')];this[_0x3efe('0xf')]=_0x904619[_0x3efe('0xf')];this[_0x3efe('0x11')]=_0x904619[_0x3efe('0x11')];this[_0x3efe('0x12')]=_0x904619['queue'];this[_0x3efe('0x13')]=_0x904619[_0x3efe('0x14')];this[_0x3efe('0x15')]=_0x904619[_0x3efe('0x16')];this[_0x3efe('0x17')]=_0x904619[_0x3efe('0x17')];this[_0x3efe('0x18')]=_0x904619[_0x3efe('0x18')];this[_0x3efe('0x19')]=_0x904619['responsetime'];this['ringtime']=getSeconds(_0x904619[_0x3efe('0x18')],_0x904619['starttime']);this[_0x3efe('0x1a')]=0x0;this[_0x3efe('0x1b')]=0x0;this[_0x3efe('0x1c')]=_0x904619['callback'];this[_0x3efe('0x1d')]=_0x904619[_0x3efe('0x1d')];this[_0x3efe('0x1e')]=_0x904619[_0x3efe('0x1e')];this[_0x3efe('0x1f')]=_0x904619[_0x3efe('0x1f')];this[_0x3efe('0x20')]=_0x904619[_0x3efe('0x20')];this[_0x3efe('0x21')]=_0x904619[_0x3efe('0x21')];this['UserId']=_0x904619['UserId'];this[_0x3efe('0x22')]=_0x904619[_0x3efe('0x22')];this[_0x3efe('0x23')]=_0x904619[_0x3efe('0x23')];this[_0x3efe('0x24')]=_0x904619[_0x3efe('0x24')]||'';this[_0x3efe('0x25')]=_0x904619[_0x3efe('0x25')]||'';}module[_0x3efe('0x26')]=History;
\ No newline at end of file
index 98fc810..25ef344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe205=['XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','[originateError]:\x20%s','OriginateError','[originate][error]','Error','getQueue','response','callProgressDetecting','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','reason','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','stringify','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','waiting','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','state','statedesc','endtime','starttime','prototype','clearZombieChannels','[actions]','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','[countReScheduled]\x20','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','isNil','variable','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD]','dialAMDActive','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','countbusyretry','countnosuchnumberretry','countdropretry','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','rrmemory','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','run','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','content','indexOf','Action','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE'];(function(_0x20252d,_0x56e2cc){var _0x886d8b=function(_0x560726){while(--_0x560726){_0x20252d['push'](_0x20252d['shift']());}};_0x886d8b(++_0x56e2cc);}(_0xe205,0xa7));var _0x5e20=function(_0x5b7528,_0x59847a){_0x5b7528=_0x5b7528-0x0;var _0x404df=_0xe205[_0x5b7528];return _0x404df;};'use strict';var util=require(_0x5e20('0x0'));var _=require(_0x5e20('0x1'));var BPromise=require(_0x5e20('0x2'));var uuid=require(_0x5e20('0x3'));var moment=require(_0x5e20('0x4'));var rr=require('rr');var md5=require(_0x5e20('0x5'));var Redis=require(_0x5e20('0x6'));var ut=require(_0x5e20('0x7'));var config=require(_0x5e20('0x8'));var logger=require('../../../config/logger')(_0x5e20('0x9'));var loggerBooked=require(_0x5e20('0xa'))(_0x5e20('0xb'));var loggerPredictive=require(_0x5e20('0xa'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x5e20('0xc'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x5e20('0xd'));config[_0x5e20('0xe')]=_['defaults'](config[_0x5e20('0xe')],{'host':_0x5e20('0xf'),'port':0x18eb});var io=require(_0x5e20('0x10'))(new Redis(config[_0x5e20('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x5e20('0x11'));var cmHopperBlack=require(_0x5e20('0x12'));var voiceQueueRt=require(_0x5e20('0x13'));var Action=require(_0x5e20('0x14'));var History=require(_0x5e20('0x15'));var Final=require(_0x5e20('0x16'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x5e20('0x17'));var Hangup=require(_0x5e20('0x18'));var ipAgi=process[_0x5e20('0x19')]['XCALLY_IP_AGI']||_0x5e20('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':_0x5e20('0x1b')};var Sequence=function(){};Sequence['prototype'][_0x5e20('0x1c')]=function(_0x330cdf){this[_0x5e20('0x1d')]=this[_0x5e20('0x1d')]?this[_0x5e20('0x1d')]['finally'](_0x330cdf):_0x330cdf();};function Dialer(_0xeaeb77,_0x9a59ce){this[_0x5e20('0x1e')]=new Sequence();this[_0x5e20('0x1f')]=_0x9a59ce;this[_0x5e20('0x20')]=_0xeaeb77[_0x5e20('0x20')];this[_0x5e20('0x21')]=_0xeaeb77[_0x5e20('0x21')];this['agents']=_0xeaeb77[_0x5e20('0x22')];this[_0x5e20('0x23')]=_0xeaeb77['trunks'];this[_0x5e20('0x24')]=config[_0x5e20('0x24')]||0x2;this[_0x5e20('0x25')]={};this[_0x5e20('0x26')]={};this['contactsId']={};this[_0x5e20('0x27')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0x5e20('0x28')]={};this['queueBookedRR']={};ami['on'](_0x5e20('0x29'),this[_0x5e20('0x2a')][_0x5e20('0x2b')](this));ami['on'](_0x5e20('0x2c'),this[_0x5e20('0x2d')][_0x5e20('0x2b')](this));ami['on']('originateresponse',this[_0x5e20('0x2e')]['bind'](this));ami['on']('agentcomplete',this[_0x5e20('0x2f')][_0x5e20('0x2b')](this));ami['on'](_0x5e20('0x30'),this[_0x5e20('0x31')][_0x5e20('0x2b')](this));ami['on'](_0x5e20('0x32'),this[_0x5e20('0x33')]['bind'](this));ami['on'](_0x5e20('0x34'),this[_0x5e20('0x35')][_0x5e20('0x2b')](this));ami['on'](_0x5e20('0x36'),this['syncVarSet'][_0x5e20('0x2b')](this));ami['on'](_0x5e20('0x37'),this[_0x5e20('0x38')][_0x5e20('0x2b')](this));ami['on'](_0x5e20('0x39'),this[_0x5e20('0x3a')]['bind'](this));this[_0x5e20('0x3b')]();this[_0x5e20('0x3c')]();}function isNotNull(_0x543c29){return _0x543c29!==null&&!_[_0x5e20('0x3d')](_0x543c29);}function checkIsLoggedIn(_0x21d1d8,_0x335f1e){return function(){if(_0x335f1e<=0x0){_0x21d1d8[_0x5e20('0x3e')]=_0x5e20('0x3f');throw _0x21d1d8[_0x5e20('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x207a6b){return _0x207a6b;}function checkIsActive(_0x477268,_0x330341){return function(){if(!isActive(_0x330341)){_0x477268[_0x5e20('0x3e')]=_0x5e20('0x41');throw _0x477268[_0x5e20('0x40')]+_0x5e20('0x42');}};}function checkInterval(_0x1ed59d){return function(){if(!isNotNull(_0x1ed59d[_0x5e20('0x43')])){_0x1ed59d[_0x5e20('0x3e')]=_0x5e20('0x44');throw _0x1ed59d['name']+_0x5e20('0x45');}if(!isNotNull(_0x1ed59d[_0x5e20('0x43')][_0x5e20('0x46')])){_0x1ed59d['message']=_0x5e20('0x44');throw _0x1ed59d[_0x5e20('0x40')]+_0x5e20('0x45');}if(!isNotNull(_[_0x5e20('0x47')](_0x1ed59d[_0x5e20('0x43')][_0x5e20('0x46')]))){_0x1ed59d[_0x5e20('0x3e')]=_0x5e20('0x44');throw _0x1ed59d[_0x5e20('0x40')]+_0x5e20('0x45');}};}function msgResponse(_0x36e825,_0x431068,_0x142fc7){return{'action':_0x36e825,'response':_0x431068,'message':_0x142fc7,'stack':_0x142fc7};}function myreject(_0x255b67){return function(_0x53a6f0){return _0x255b67(msgResponse(_0x5e20('0x48'),'Error',JSON['stringify'](_0x53a6f0)));};}function getSeconds(_0x25eeb1,_0x23341a){var _0x4e3307=moment(_0x25eeb1)[_0x5e20('0x49')](0x0);var _0x1430b7=moment(_0x23341a)['milliseconds'](0x0);return _0x4e3307[_0x5e20('0x4a')](_0x1430b7,_0x5e20('0x4b'));}function emit(_0x20dc98,_0x139255,_0x15ce1d){io['to'](_0x20dc98)[_0x5e20('0x4c')](_0x139255,_0x15ce1d);}function emitVoiceQueueSummary(_0x94925e){if(_0x94925e[_0x5e20('0x4d')]===_0x5e20('0x4e')){var _0x20be56={'id':_0x94925e['id'],'name':_0x94925e[_0x5e20('0x40')],'strategy':_0x94925e[_0x5e20('0x4f')],'answered':_0x94925e[_0x5e20('0x50')],'available':_0x94925e[_0x5e20('0x51')],'loggedIn':_0x94925e[_0x5e20('0x52')],'pTalking':_0x94925e[_0x5e20('0x53')],'sumBillable':_0x94925e[_0x5e20('0x54')],'sumDuration':_0x94925e[_0x5e20('0x55')],'sumHoldTime':_0x94925e['sumHoldTime']||0x0,'talking':_0x94925e[_0x5e20('0x56')],'total':_0x94925e[_0x5e20('0x57')],'type':_0x94925e[_0x5e20('0x4d')],'unmanaged':_0x94925e[_0x5e20('0x58')],'abandoned':_0x94925e[_0x5e20('0x59')],'waiting':_0x94925e['waiting'],'loggedInDb':_0x94925e[_0x5e20('0x5a')],'dialActive':_0x94925e[_0x5e20('0x5b')],'dialMethod':_0x94925e[_0x5e20('0x5c')],'dialOriginateCallerIdName':_0x94925e[_0x5e20('0x5d')],'dialOriginateCallerIdNumber':_0x94925e[_0x5e20('0x5e')],'dialOriginateTimeout':_0x94925e[_0x5e20('0x5f')],'dialPrefix':_0x94925e['dialPrefix'],'outboundAnswerAgiCallsDay':_0x94925e[_0x5e20('0x60')],'outboundAnswerCallsDay':_0x94925e[_0x5e20('0x61')],'outboundBlacklistCallsDay':_0x94925e[_0x5e20('0x62')],'outboundBusyCallsDay':_0x94925e['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x94925e[_0x5e20('0x63')],'outboundDropCallsDayACS':_0x94925e[_0x5e20('0x64')],'outboundDropCallsDayCallersExit':_0x94925e[_0x5e20('0x65')],'outboundDropCallsDayTimeout':_0x94925e[_0x5e20('0x66')],'outboundNoAnswerCallsDay':_0x94925e[_0x5e20('0x67')],'outboundNoSuchCallsDay':_0x94925e[_0x5e20('0x68')],'outboundOriginateFailureCallsDay':_0x94925e[_0x5e20('0x69')],'outboundReCallsDay':_0x94925e[_0x5e20('0x6a')],'outboundRejectCallsDay':_0x94925e['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x94925e[_0x5e20('0x6b')],'predictiveIntervalAnsweredCalls':_0x94925e[_0x5e20('0x6c')],'predictiveIntervalAvgHoldtime':_0x94925e[_0x5e20('0x6d')],'predictiveIntervalAvgTalktime':_0x94925e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x94925e[_0x5e20('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x94925e['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x94925e[_0x5e20('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x94925e[_0x5e20('0x70')],'predictiveIntervalHitRate':_0x94925e[_0x5e20('0x71')],'predictiveIntervalMultiplicativeFactor':_0x94925e[_0x5e20('0x72')],'predictiveIntervalPauses':_0x94925e[_0x5e20('0x73')],'predictiveIntervalAvailable':_0x94925e['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x94925e[_0x5e20('0x74')],'message':_0x94925e['message'],'originated':_0x94925e['originated'],'erlangCalls':_0x94925e[_0x5e20('0x75')],'erlangCallToSecond':_0x94925e[_0x5e20('0x76')],'erlangAbandonmentRate':_0x94925e[_0x5e20('0x77')],'erlangBusyFactor':_0x94925e[_0x5e20('0x78')],'startPredictive':_0x94925e[_0x5e20('0x79')],'startProgressive':_0x94925e[_0x5e20('0x7a')]};if(_0x94925e[_0x5e20('0x7b')]){_0x20be56['Trunk']={'id':_0x94925e['Trunk']['id'],'name':_0x94925e[_0x5e20('0x7b')][_0x5e20('0x40')],'active':_0x94925e['Trunk'][_0x5e20('0x7c')],'callerid':_0x94925e[_0x5e20('0x7b')][_0x5e20('0x7d')]};}if(_0x94925e[_0x5e20('0x43')]){_0x20be56[_0x5e20('0x43')]={'id':_0x94925e['Interval']['id'],'name':_0x94925e[_0x5e20('0x43')][_0x5e20('0x40')]};}var _0x25491e=md5(JSON[_0x5e20('0x7e')](_0x20be56));if(_0x94925e[_0x5e20('0x5')]!==_0x25491e){_0x94925e[_0x5e20('0x5')]=_0x25491e;emit(util[_0x5e20('0x7f')](_0x5e20('0x80'),_0x20be56['name']),'voice_queue:save',_0x20be56);}}}function emitCampaignSummary(_0x4ea7d9){if(_0x4ea7d9[_0x5e20('0x4d')]===_0x5e20('0x81')){emit(util['format'](_0x5e20('0x82'),_0x4ea7d9['name']),_0x5e20('0x83'),_0x4ea7d9);}}function checkGetDataPredictive(_0x4afb72){if(isNotNull(_0x4afb72)&&!_[_0x5e20('0x47')](_0x4afb72)){loggerPredictive['info'](_0x5e20('0x84'));loggerPredictive[_0x5e20('0x85')](_0x5e20('0x86'),_0x4afb72[_0x5e20('0x74')]);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x87'),_0x4afb72[_0x5e20('0x6c')]);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x88'),_0x4afb72[_0x5e20('0x89')]);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x8a'),_0x4afb72[_0x5e20('0x6e')]);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x8b'),_0x4afb72[_0x5e20('0x6d')]);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x8c'),_0x4afb72['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x5e20('0x8d'));if(_0x4afb72['predictiveIntervalTotalCalls']>0x0){if(!_[_0x5e20('0x3d')](_0x4afb72[_0x5e20('0x8e')])&&_0x4afb72[_0x5e20('0x8e')]>0x0){return!![];}loggerPredictive['info'](_0x5e20('0x8f'));if(!_[_0x5e20('0x3d')](_0x4afb72[_0x5e20('0x6d')])&&_0x4afb72['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x5e20('0x85')](_0x5e20('0x90'));}}else{loggerPredictive[_0x5e20('0x85')](_0x5e20('0x91'));}return![];}function mergeDataErlangB(_0xbacc1f){return function(_0x172ab8){loggerPredictive['info'](_0x5e20('0x92'));loggerPredictive['info'](_0x5e20('0x93'),_0x172ab8['erlangCalls']);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x94'),_0x172ab8[_0x5e20('0x76')]);loggerPredictive['info'](_0x5e20('0x95'),_0x172ab8[_0x5e20('0x77')]);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x96'),_0x172ab8[_0x5e20('0x78')]);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x95'),_0x172ab8['erlangAbandonmentRate']);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x8d'));_[_0x5e20('0x97')](_0xbacc1f,_0x172ab8);};}function getDiff(_0x2f9089){var _0x4a98a8=moment()[_0x5e20('0x49')](0x0);var _0x10e17a=moment(_0x2f9089)[_0x5e20('0x49')](0x0);return _0x4a98a8[_0x5e20('0x4a')](_0x10e17a,'seconds');}function ifInterval(_0x3e6be0,_0x2dd7de){if(_[_0x5e20('0x3d')](_0x2dd7de)){return![];}return getDiff(_0x2dd7de)<_0x3e6be0*0x3c;}function freeVariablesPredictive(_0x53ddd4){if(isNotNull(_0x53ddd4)){if(!_['isUndefined'](_0x53ddd4['startProgressive'])){_0x53ddd4[_0x5e20('0x7a')]=undefined;loggerPredictive[_0x5e20('0x85')](_0x53ddd4['name'],_0x5e20('0x98'));}if(!_[_0x5e20('0x3d')](_0x53ddd4[_0x5e20('0x79')])){_0x53ddd4['startPredictive']=undefined;loggerPredictive[_0x5e20('0x85')](_0x53ddd4[_0x5e20('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x5e20('0x3d')](_0x53ddd4[_0x5e20('0x99')])){clearInterval(_0x53ddd4['handlePredictive']);_0x53ddd4[_0x5e20('0x99')]=undefined;loggerPredictive[_0x5e20('0x85')](_0x53ddd4[_0x5e20('0x40')],_0x5e20('0x9a'));}}}function erlangb(_0x57fab6,_0x2956f3){if(_0x2956f3===0x0){return 0x0;}var _0x59bff7=0x1;for(var _0x4c82d0=0x1;_0x4c82d0<=_0x2956f3;_0x4c82d0+=0x1){_0x59bff7=0x1+_0x59bff7*_0x4c82d0/_0x57fab6;}return 0x1/_0x59bff7;}function isVoiceQueueOutbound(_0x1dc6dc){return _0x1dc6dc===_0x5e20('0x4e');}function isNotPreview(_0x359bc0){return _0x359bc0!==_0x5e20('0x1f');}function isCampaignIvr(_0x54cd1){return _0x54cd1===_0x5e20('0x81');}function getCallerId(_0x53c46e,_0x4bccbe,_0x15aceb){if(!_[_0x5e20('0x3d')](_0x15aceb)&&typeof _0x15aceb===_0x5e20('0x9b')&&!_['isEmpty'](_0x15aceb)){if(!_[_0x5e20('0x3d')](_0x4bccbe)&&typeof _0x4bccbe===_0x5e20('0x9b')&&!_['isEmpty'](_0x4bccbe)){return util[_0x5e20('0x7f')]('\x22%s\x22\x20<%s>',_0x4bccbe,_0x15aceb);}return util['format'](_0x5e20('0x9c'),_0x15aceb,_0x15aceb);}if(!_['isUndefined'](_0x53c46e)&&typeof _0x53c46e===_0x5e20('0x9b')&&!_[_0x5e20('0x47')](_0x53c46e)){return _0x53c46e;}return _0x5e20('0x9d');}function loggerCatchQueueSummary(_0x4e059a,_0x20690f){return function(_0x382ceb){freeVariablesPredictive(_0x20690f);emitVoiceQueueSummary(_0x20690f);emitCampaignSummary(_0x20690f);loggerSyncQueueSummary[_0x5e20('0x9e')](_0x4e059a,util[_0x5e20('0x9f')](_0x382ceb,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3e6dd9,_0x4e60f0){return function(_0x9d676){loggerPredictive[_0x5e20('0x9e')](_0x4e60f0['name'],_0x3e6dd9);loggerPredictive[_0x5e20('0x9e')](_0x9d676[_0x5e20('0xa0')]);freeVariablesPredictive(_0x4e60f0);};}function loggerCatch(_0x13e685){return function(_0x5e016e){logger[_0x5e20('0x9e')](_0x13e685,util[_0x5e20('0x9f')](_0x5e016e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x36b82e){return _0x36b82e&&!_[_0x5e20('0x3d')](_0x36b82e)&&_0x36b82e[_0x5e20('0xa1')]>0x0;}function decremetOriginate(_0x56279f){if(!_[_0x5e20('0x3d')](_0x56279f)&&_0x56279f!==null){if(typeof _0x56279f[_0x5e20('0xa2')]!==_0x5e20('0xa3')){if(_0x56279f[_0x5e20('0xa2')]>0x0){_0x56279f[_0x5e20('0xa2')]-=0x1;}else{logger['error'](_0x5e20('0xa4'));}}}else{logger[_0x5e20('0x9e')](_0x5e20('0xa5'));}}function checkContactLowerLimitOriginate(_0x12cbba,_0x1e7cf8,_0x250679){if(_0x1e7cf8>_0x250679){for(var _0x2e67c2=0x0;_0x2e67c2<_0x1e7cf8-_0x250679;_0x2e67c2+=0x1){decremetOriginate(_0x12cbba);}}}function loggerGetContactDialer(_0x2dee41,_0x55306e,_0xa01e1b){return function(_0x485ef4){checkContactLowerLimitOriginate(_0x55306e,_0xa01e1b,0x0);logger['error'](_0x2dee41,util[_0x5e20('0x9f')](_0x485ef4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5197bd){return function(_0x4fac78){if(isNotNull(_0x4fac78)&&isNotNull(_0x4fac78[0x0])){if(_0x4fac78[0x0][_0x5e20('0xa6')]>0x0){_0x5197bd[_0x5e20('0x3e')]='RESCHEDULED_CONTACTS';logger[_0x5e20('0x85')]('[getContactDialer2][ReScheduled]'+_0x5197bd[_0x5e20('0x40')],_0x4fac78[0x0]['contactsRescheduled'],_0x5e20('0xa7'));}else{_0x5197bd[_0x5e20('0x3e')]=_0x5e20('0xa8');logger[_0x5e20('0x85')](_0x5e20('0xa9')+_0x5197bd['name']);}}};}function notSendMessagesQueue(_0x3df02d){if(_0x3df02d['sendMessageOneNotActive']){freeVariablesPredictive(_0x3df02d);if(_0x3df02d[_0x5e20('0xa2')]===0x0&&_0x3df02d['talking']===0x0&&_0x3df02d[_0x5e20('0xaa')]===0x0&&(_0x3df02d[_0x5e20('0x53')]||0x0)===0x0){_0x3df02d[_0x5e20('0xab')]=![];_0x3df02d[_0x5e20('0x51')]=0x0;_0x3df02d['message']=_0x5e20('0x41');loggerSyncQueueSummary[_0x5e20('0x9e')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3df02d['name'],_0x5e20('0xac'));}else{_0x3df02d[_0x5e20('0x3e')]=_0x5e20('0xad');loggerSyncQueueSummary[_0x5e20('0x9e')](_0x5e20('0xae'),_0x3df02d['name'],_0x5e20('0xaf'));}emitVoiceQueueSummary(_0x3df02d);}}function notSendMessagesCampaign(_0x59bd5d){if(_0x59bd5d['sendMessageOneNotActive']){if(_0x59bd5d[_0x5e20('0xa2')]===0x0){_0x59bd5d['sendMessageOneNotActive']=![];_0x59bd5d['message']=_0x5e20('0x41');loggerSyncQueueSummary[_0x5e20('0x9e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x59bd5d[_0x5e20('0x40')],_0x5e20('0xac'));}else{_0x59bd5d[_0x5e20('0x3e')]=_0x5e20('0xad');loggerSyncQueueSummary[_0x5e20('0x9e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x59bd5d[_0x5e20('0x40')],_0x5e20('0xaf'));}emitCampaignSummary(_0x59bd5d);}}function createObjHistory(_0x10792b,_0x3099d9,_0x565bbd,_0x4a4385,_0x5a0024){_0x10792b[_0x5e20('0x3e')]=_0x565bbd;var _0x1cbbe0=new Action(_0x10792b,_0x3099d9);var _0x45e6ff=new History(_0x1cbbe0);_0x45e6ff[_0x5e20('0xb0')]=_0x4a4385;_0x45e6ff[_0x5e20('0xb1')]=_0x5a0024;_0x45e6ff[_0x5e20('0xb2')]=_0x1cbbe0[_0x5e20('0xb3')];return _0x45e6ff;}Dialer[_0x5e20('0xb4')][_0x5e20('0x3c')]=function(){var _0x2bbc40=this;setInterval(function(){_0x2bbc40[_0x5e20('0xb5')](_0x2bbc40[_0x5e20('0x27')],'[uniqueid]');_0x2bbc40[_0x5e20('0xb5')](_0x2bbc40[_0x5e20('0x26')],_0x5e20('0xb6'));},0x32c8);};Dialer['prototype'][_0x5e20('0xb5')]=function(_0x5a95c0,_0x40f9d3){var _0x20715b=this;for(var _0x51f8d6 in _0x5a95c0){if(typeof _0x5a95c0[_0x51f8d6]!==_0x5e20('0xa3')){this[_0x5e20('0x1e')][_0x5e20('0x1c')](function(){if(!_['isNil'](_0x5a95c0[_0x51f8d6])){return ami['Action']({'action':_0x5e20('0xb7'),'channel':_0x5a95c0[_0x51f8d6][_0x5e20('0xb8')]})[_0x5e20('0xb9')](function(_0x49a2b5){if(_0x49a2b5[_0x5e20('0x3e')]===_0x5e20('0xba')){setTimeout(function(){if(_0x5a95c0[_0x51f8d6]&&_0x5a95c0[_0x51f8d6][_0x5e20('0x4d')]!=='ivr'){_0x20715b[_0x5e20('0xbb')](_0x20715b['voiceQueues'][_0x5a95c0[_0x51f8d6][_0x5e20('0xbc')]]);logger['error'](_0x5e20('0xbd'),_0x40f9d3,_0x51f8d6,_0x5a95c0[_0x51f8d6][_0x5e20('0xbc')]);delete _0x5a95c0[_0x51f8d6];}if(_0x5a95c0[_0x51f8d6]&&_0x5a95c0[_0x51f8d6][_0x5e20('0x4d')]===_0x5e20('0x81')){_0x20715b['updateOriginated'](_0x20715b[_0x5e20('0x21')][_0x5a95c0[_0x51f8d6][_0x5e20('0xbc')]]);logger[_0x5e20('0x9e')]('[Dialer][checkChannel][ivr]',_0x40f9d3,_0x51f8d6,_0x5a95c0[_0x51f8d6][_0x5e20('0xbc')]);delete _0x5a95c0[_0x51f8d6];}},0x2328);}});}});}}};Dialer[_0x5e20('0xb4')][_0x5e20('0xbe')]=function(_0x2c184d){return BPromise[_0x5e20('0xbf')]()[_0x5e20('0xc0')](cmHopper[_0x5e20('0xbe')](_0x2c184d))['catch'](loggerCatch(_0x5e20('0xc1')));};Dialer[_0x5e20('0xb4')]['checkIsBlackList']=function(_0x278aef){return BPromise[_0x5e20('0xbf')]()[_0x5e20('0xc0')](cmHopperBlack['checkIsBlackList'](_0x278aef))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xc2')));};Dialer[_0x5e20('0xb4')][_0x5e20('0xc3')]=function(_0x4bc464){return BPromise['resolve']()[_0x5e20('0xc0')](cmHopperBlack[_0x5e20('0xc3')](_0x4bc464))['catch'](loggerCatch(_0x5e20('0xc4')));};Dialer['prototype']['averageHandleTime']=function(_0x4f8394){return BPromise['resolve']()[_0x5e20('0xc0')](cmHopperHistory[_0x5e20('0xc5')](_0x4f8394))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xc6')));};Dialer[_0x5e20('0xb4')][_0x5e20('0xc7')]=function(_0x3f4896){return BPromise[_0x5e20('0xbf')]()['then'](cmHopper[_0x5e20('0xc7')](_0x3f4896))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xc8')));};Dialer[_0x5e20('0xb4')][_0x5e20('0xc9')]=function(_0x2aeb10,_0x38cd3f,_0xfa4ca4){return BPromise['resolve']()['then'](cmHopper[_0x5e20('0xc9')](_0x2aeb10,_0x38cd3f,_0xfa4ca4))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xca')));};Dialer['prototype'][_0x5e20('0xcb')]=function(_0x346fdf,_0x53f023,_0x1512d7,_0x37c1f7,_0x259f68){return BPromise['resolve']()[_0x5e20('0xc0')](cmHopper['getContactDialer'](_0x346fdf,_0x53f023,_0x1512d7,_0x37c1f7))[_0x5e20('0xb9')](function(_0x42c93a){_0x259f68['temp']-=_0x1512d7;_0x259f68['temp']=_0x259f68[_0x5e20('0xcc')]>0x0?_0x259f68[_0x5e20('0xcc')]:0x0;loggerCatch(_0x5e20('0xcd'))(_0x42c93a);});};Dialer['prototype'][_0x5e20('0xce')]=function(_0x120c5d,_0x158d4b,_0x165d03,_0x1492fc){return BPromise['resolve']()['then'](cmHopper[_0x5e20('0xce')](_0x120c5d,_0x158d4b,_0x165d03))[_0x5e20('0xb9')](function(_0x37f5b5){_0x1492fc[_0x5e20('0xcc')]-=_0x158d4b;_0x1492fc[_0x5e20('0xcc')]=_0x1492fc['temp']>0x0?_0x1492fc[_0x5e20('0xcc')]:0x0;loggerCatch(_0x5e20('0xcf'))(_0x37f5b5);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x95f33c){return BPromise['resolve']()['then'](voiceQueueRt[_0x5e20('0xd0')](_0x95f33c))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xd1')));};Dialer[_0x5e20('0xb4')][_0x5e20('0xd2')]=function(_0x2c74fa){return BPromise['resolve']()['then'](cmHopper['moveContactManagedDialer'](_0x2c74fa))['catch'](loggerCatch(_0x5e20('0xd3')));};Dialer[_0x5e20('0xb4')]['createHistory']=function(_0x45fd40){return BPromise[_0x5e20('0xbf')]()['then'](cmHopperHistory[_0x5e20('0xd4')](_0x45fd40))['catch'](loggerCatch(_0x5e20('0xd5')));};Dialer[_0x5e20('0xb4')]['updateOriginated']=function(_0x5b7524){if(!_['isUndefined'](_0x5b7524)&&_0x5b7524!==null){if(typeof _0x5b7524[_0x5e20('0xa2')]!==_0x5e20('0xa3')){if(_0x5b7524['originated']>0x0){_0x5b7524[_0x5e20('0xa2')]-=0x1;}else{logger[_0x5e20('0x9e')](_0x5e20('0xd6'));}}}else{logger[_0x5e20('0x9e')](_0x5e20('0xd7'));}};Dialer[_0x5e20('0xb4')][_0x5e20('0xd8')]=function(_0x27e52b,_0x4255aa){var _0x5647d8=this;return function(_0x25576c){_0x5647d8[_0x5e20('0xbb')](_0x4255aa);logger[_0x5e20('0x9e')](_0x27e52b,util[_0x5e20('0x9f')](_0x25576c,{'showHidden':![],'depth':null}));};};Dialer[_0x5e20('0xb4')][_0x5e20('0xd9')]=function(_0x1e416f,_0x177bd3,_0x4b7457){var _0x5ae3a3={'state':0x19,'statedesc':_0x5e20('0xda')};this[_0x5e20('0xbb')](_0x177bd3);this[_0x5e20('0xdb')](_[_0x5e20('0x97')](_0x5ae3a3,_['pick'](_0x4b7457,[_0x5e20('0xdc'),_0x5e20('0xdd'),_0x5e20('0xde'),_0x5e20('0xdf'),_0x5e20('0xe0')])),_0x5e20('0xe1'),_0x5e20('0xe2'));logger['error'](_0x1e416f);};Dialer[_0x5e20('0xb4')][_0x5e20('0xe3')]=function(_0x3c0e75){return _0x3c0e75===_0x5e20('0xe4');};Dialer['prototype'][_0x5e20('0xe5')]=function(_0x433a9f){return!_[_0x5e20('0x3d')](_0x433a9f)&&_0x433a9f&&!_['isUndefined'](_0x433a9f[_0x5e20('0x40')])&&!_[_0x5e20('0x3d')](_0x433a9f[_0x5e20('0x7c')])&&_0x433a9f[_0x5e20('0x7c')]&&(this[_0x5e20('0x23')][util['format'](_0x5e20('0xe6'),_0x433a9f['name'])]['status']===_0x5e20('0xe7')||this['trunks'][util['format'](_0x5e20('0xe6'),_0x433a9f[_0x5e20('0x40')])][_0x5e20('0xb7')]===_0x5e20('0xe8'));};Dialer[_0x5e20('0xb4')]['saveInDb']=function(_0x2ae909,_0x226816,_0x4e0c79){this['createHistory'](_0x2ae909)[_0x5e20('0xb9')](loggerCatch(_0x226816));this['moveContactManagedDialer'](_0x2ae909)[_0x5e20('0xb9')](loggerCatch(_0x4e0c79));};Dialer[_0x5e20('0xb4')][_0x5e20('0xe9')]=function(_0x1edc2e){var _0x3a09a6=this[_0x5e20('0x27')][_0x1edc2e[_0x5e20('0xea')]];var _0xe0a456;if(!_[_0x5e20('0xeb')](_0x1edc2e)&&!_[_0x5e20('0xeb')](_0x1edc2e[_0x5e20('0xec')])&&!_['isNil'](_0x1edc2e[_0x5e20('0xec')]['amdstatus'])&&_0x1edc2e['exten']===_0x5e20('0xed')&&_0x3a09a6){if(_0x3a09a6[_0x5e20('0x4d')]!==_0x5e20('0x81')&&this[_0x5e20('0x20')][_0x3a09a6[_0x5e20('0xbc')]]['dialAMDActive']&&_0x1edc2e[_0x5e20('0xee')]===_0x5e20('0xef')){delete this['uniqueId'][_0x1edc2e[_0x5e20('0xea')]];this[_0x5e20('0xbb')](this[_0x5e20('0x20')][_0x3a09a6[_0x5e20('0xbc')]]);this[_0x5e20('0x20')][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0x61')]+=0x1;this[_0x5e20('0x20')][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0x60')]+=0x1;_0xe0a456=new Hangup(_0x3a09a6,_0x1edc2e);_0xe0a456[_0x5e20('0xb0')]=0x12;_0xe0a456[_0x5e20('0xb1')]=_0x5e20('0xf0');_0xe0a456[_0x5e20('0xf1')]=_0x5e20('0xf2');ami['emit'](_0x5e20('0xf3'),ut[_0x5e20('0xf4')](_0xe0a456,'amd'));this[_0x5e20('0xdb')](_0xe0a456,'[syncHangupInAMD][createHistory]',_0x5e20('0xf5'));}if(_0x3a09a6[_0x5e20('0x4d')]!==_0x5e20('0x81')&&this['voiceQueues'][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0xf6')]&&_0x1edc2e['value']==='MACHINE'){var _0x2070c0=this;return new BPromise(function(_0x2a62d3,_0x4cafdf){delete _0x2070c0['uniqueId'][_0x1edc2e[_0x5e20('0xea')]];_0x2070c0[_0x5e20('0xbb')](_0x2070c0[_0x5e20('0x20')][_0x3a09a6[_0x5e20('0xbc')]]);_0x2070c0[_0x5e20('0x20')][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0x61')]+=0x1;_0x2070c0[_0x5e20('0x20')][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0x60')]+=0x1;var _0x223032=_0x2070c0[_0x5e20('0x20')][_0x3a09a6['queue']];var _0x27413f=new Hangup(_0x3a09a6,_0x1edc2e);_0x27413f['state']=0x13;_0x27413f[_0x5e20('0xb1')]='Machine';_0x27413f['membername']=_0x5e20('0xf2');_0x27413f[_0x5e20('0xf7')]+=0x1;_0x27413f[_0x5e20('0xf8')]+=0x1;_0x27413f[_0x5e20('0xf9')]=!![];ami[_0x5e20('0x4c')](_0x5e20('0xf3'),ut[_0x5e20('0xf4')](_0x27413f,_0x5e20('0xf9')));_0x2070c0[_0x5e20('0xd4')](_0x27413f)['catch'](loggerCatch(_0x5e20('0xfa')));if(_0x27413f['countbusyretry']+_0x27413f[_0x5e20('0xfb')]+_0x27413f['countnoanswerretry']+_0x27413f['countnosuchnumberretry']+_0x27413f['countdropretry']+_0x27413f[_0x5e20('0xfc')]+_0x27413f[_0x5e20('0xf7')]+_0x27413f[_0x5e20('0xfd')]>=_0x223032[_0x5e20('0xfe')]){_0x2070c0[_0x5e20('0xff')](_0x27413f,_0x2a62d3,_0x4cafdf,_0x5e20('0x100'));}else{if(_0x27413f['countmachineretry']>=_0x223032[_0x5e20('0x101')]){_0x2070c0[_0x5e20('0x102')](_0x27413f,_0x2a62d3,_0x4cafdf,_0x5e20('0x103'));}else{_0x2070c0[_0x5e20('0xc7')]({'active':![],'countmachineretry':_0x27413f[_0x5e20('0xf7')],'scheduledat':moment()[_0x5e20('0x104')](_0x223032['dialMachineRetryFrequency'],_0x5e20('0x105'))[_0x5e20('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x27413f[_0x5e20('0xdc')],'ListId':_0x27413f[_0x5e20('0xdd')],'VoiceQueueId':_0x27413f['VoiceQueueId']||undefined,'CampaignId':_0x27413f['CampaignId']||undefined})['catch'](loggerCatch(_0x5e20('0x106')));_0x2a62d3({'reschedule':0x1});}}});}if(_0x3a09a6[_0x5e20('0x4d')]===_0x5e20('0x81')&&this[_0x5e20('0x21')][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0xf6')]&&_0x1edc2e['value']===_0x5e20('0xef')){delete this['uniqueId'][_0x1edc2e[_0x5e20('0xea')]];this[_0x5e20('0xbb')](this[_0x5e20('0x21')][_0x3a09a6['queue']]);_0xe0a456=new Hangup(_0x3a09a6,_0x1edc2e);_0xe0a456[_0x5e20('0xb0')]=0x12;_0xe0a456[_0x5e20('0xb1')]='HangupInAMD';_0xe0a456[_0x5e20('0xf1')]=_0x5e20('0xf2');ami[_0x5e20('0x4c')](_0x5e20('0xf3'),ut[_0x5e20('0xf4')](_0xe0a456,'amd'));this[_0x5e20('0xdb')](_0xe0a456,_0x5e20('0x107'),_0x5e20('0x108'));}if(_0x3a09a6[_0x5e20('0x4d')]===_0x5e20('0x81')&&this[_0x5e20('0x21')][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0xf6')]&&_0x1edc2e[_0x5e20('0xee')]===_0x5e20('0x109')){var _0x2070c0=this;return new BPromise(function(_0x274080,_0x3c9719){delete _0x2070c0[_0x5e20('0x27')][_0x1edc2e['uniqueid']];_0x2070c0[_0x5e20('0xbb')](_0x2070c0['campaigns'][_0x3a09a6[_0x5e20('0xbc')]]);_0x2070c0[_0x5e20('0x21')][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0x61')]+=0x1;_0x2070c0['campaigns'][_0x3a09a6[_0x5e20('0xbc')]][_0x5e20('0x60')]+=0x1;var _0x56e50c=_0x2070c0[_0x5e20('0x21')][_0x3a09a6['queue']];var _0x4a2627=new Hangup(_0x3a09a6,_0x1edc2e);_0x4a2627[_0x5e20('0xb0')]=0x13;_0x4a2627['statedesc']=_0x5e20('0x10a');_0x4a2627['membername']=_0x5e20('0xf2');_0x4a2627[_0x5e20('0xf7')]+=0x1;_0x4a2627[_0x5e20('0xf8')]+=0x1;_0x4a2627[_0x5e20('0xf9')]=!![];ami[_0x5e20('0x4c')]('custom:amd',ut[_0x5e20('0xf4')](_0x4a2627,'amd'));_0x2070c0[_0x5e20('0xd4')](_0x4a2627)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xfa')));if(_0x4a2627[_0x5e20('0x10b')]+_0x4a2627[_0x5e20('0xfb')]+_0x4a2627['countnoanswerretry']+_0x4a2627[_0x5e20('0x10c')]+_0x4a2627[_0x5e20('0x10d')]+_0x4a2627[_0x5e20('0xfc')]+_0x4a2627['countmachineretry']+_0x4a2627[_0x5e20('0xfd')]>=_0x56e50c['dialGlobalMaxRetry']){_0x2070c0[_0x5e20('0xff')](_0x4a2627,_0x274080,_0x3c9719,'reason19\x20machine....');}else{if(_0x4a2627[_0x5e20('0xf7')]>=_0x56e50c[_0x5e20('0x101')]){_0x2070c0[_0x5e20('0x102')](_0x4a2627,_0x274080,_0x3c9719,_0x5e20('0x103'));}else{_0x2070c0[_0x5e20('0xc7')]({'active':![],'countmachineretry':_0x4a2627[_0x5e20('0xf7')],'scheduledat':moment()[_0x5e20('0x104')](_0x56e50c[_0x5e20('0x10e')],'minutes')[_0x5e20('0x7f')](_0x5e20('0x10f')),'ContactId':_0x4a2627[_0x5e20('0xdc')],'ListId':_0x4a2627['ListId'],'VoiceQueueId':_0x4a2627[_0x5e20('0xdf')]||undefined,'CampaignId':_0x4a2627['CampaignId']||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x106')));_0x274080({'reschedule':0x1});}}});}}};Dialer[_0x5e20('0xb4')][_0x5e20('0x33')]=function(_0x32cf06){var _0x2d7718=this['uniqueId'][_0x32cf06['uniqueid']];var _0x5a0d34=this;var _0x251522;if(_0x2d7718&&_0x2d7718[_0x5e20('0x4d')]===_0x5e20('0x81')){delete this[_0x5e20('0x27')][_0x32cf06[_0x5e20('0xea')]];this['updateOriginated'](this['campaigns'][_0x2d7718[_0x5e20('0xbc')]]);this['campaigns'][_0x2d7718[_0x5e20('0xbc')]][_0x5e20('0x110')]+=0x1;_0x251522=new Hangup(_0x2d7718,_0x32cf06);this[_0x5e20('0xd4')](_0x251522)['catch'](loggerCatch(_0x5e20('0x111')));this[_0x5e20('0xd2')](_0x251522)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x112')));}if(_0x2d7718&&_0x2d7718[_0x5e20('0x4d')]!==_0x5e20('0x81')&&isNotNull(this[_0x5e20('0x20')][_0x2d7718['queue']][_0x5e20('0x113')])){delete this[_0x5e20('0x27')][_0x32cf06['uniqueid']];this[_0x5e20('0xbb')](this['voiceQueues'][_0x2d7718[_0x5e20('0xbc')]]);this[_0x5e20('0x20')][_0x2d7718[_0x5e20('0xbc')]][_0x5e20('0x61')]+=0x1;this[_0x5e20('0x20')][_0x2d7718[_0x5e20('0xbc')]][_0x5e20('0x60')]+=0x1;_0x251522=new Hangup(_0x2d7718,_0x32cf06);_0x251522['state']=0x10;_0x251522[_0x5e20('0xb1')]='AnswerAGI';_0x251522[_0x5e20('0xf1')]=_0x5e20('0x114');this[_0x5e20('0xd4')](_0x251522)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x111')));this['moveContactManagedDialer'](_0x251522)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x112')));}if(_0x2d7718&&_0x2d7718[_0x5e20('0x4d')]!==_0x5e20('0x81')&&!isNotNull(this[_0x5e20('0x20')][_0x2d7718[_0x5e20('0xbc')]][_0x5e20('0x113')])){delete this[_0x5e20('0x27')][_0x32cf06[_0x5e20('0xea')]];this['updateOriginated'](this[_0x5e20('0x20')][_0x2d7718[_0x5e20('0xbc')]]);this[_0x5e20('0x20')][_0x2d7718['queue']]['outboundUnknownCallsDay']+=0x1;_0x251522=new Hangup(_0x2d7718,_0x32cf06);_0x251522[_0x5e20('0xb0')]=0xc;_0x251522['statedesc']=_0x32cf06['cause-txt'];_0x251522[_0x5e20('0xf1')]='Unknow';this['createHistory'](_0x251522)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x5e20('0xd2')](_0x251522)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x112')));}};Dialer[_0x5e20('0xb4')][_0x5e20('0x2f')]=function(_0x94d3bb){var _0x232d18=this[_0x5e20('0x27')][_0x94d3bb[_0x5e20('0xea')]];var _0x876dd7=this;if(this[_0x5e20('0x20')][_0x94d3bb['queue']]){if(_0x232d18&&_0x232d18['type']!==_0x5e20('0x81')){delete this['uniqueId'][_0x94d3bb[_0x5e20('0xea')]];this[_0x5e20('0x20')][_0x94d3bb[_0x5e20('0xbc')]][_0x5e20('0x61')]+=0x1;var _0x222867=new AgentComplete(_0x232d18,_0x94d3bb);if(_0x94d3bb['reason']===_0x5e20('0x115')){_0x222867[_0x5e20('0x116')]=this[_0x5e20('0x20')][_0x94d3bb[_0x5e20('0xbc')]][_0x5e20('0x117')]&&this['voiceQueues'][_0x94d3bb[_0x5e20('0xbc')]][_0x5e20('0x118')]?moment()[_0x5e20('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x222867)['catch'](loggerCatch(_0x5e20('0x119')));this['moveContactManagedDialer'](_0x222867)['catch'](loggerCatch(_0x5e20('0x11a')));}}};Dialer[_0x5e20('0xb4')][_0x5e20('0x2a')]=function(_0x2f0c5e){if(this[_0x5e20('0x20')][_0x2f0c5e[_0x5e20('0xbc')]]){if(this[_0x5e20('0x27')][_0x2f0c5e[_0x5e20('0xea')]]&&this[_0x5e20('0x27')][_0x2f0c5e[_0x5e20('0xea')]][_0x5e20('0x4d')]!==_0x5e20('0x81')){this[_0x5e20('0xbb')](this[_0x5e20('0x20')][_0x2f0c5e[_0x5e20('0xbc')]]);this[_0x5e20('0x27')][_0x2f0c5e['uniqueid']][_0x5e20('0x11b')]=moment()[_0x5e20('0x7f')](_0x5e20('0x10f'));}}};Dialer[_0x5e20('0xb4')][_0x5e20('0x11c')]=function(_0x383546){this[_0x5e20('0xd4')](_0x383546)['catch'](loggerCatch(_0x5e20('0x119')));this['moveContactManagedDialer'](_0x383546)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x11d')));};Dialer[_0x5e20('0xb4')][_0x5e20('0x2d')]=function(_0x12515f){var _0x25d7d2=this['uniqueId'][_0x12515f['uniqueid']];var _0x20e909=this;if(this['voiceQueues'][_0x12515f['queue']]){if(_0x25d7d2&&_0x25d7d2['type']!==_0x5e20('0x81')){delete this[_0x5e20('0x27')][_0x12515f[_0x5e20('0xea')]];this[_0x5e20('0xbb')](this['voiceQueues'][_0x12515f['queue']]);_0x25d7d2[_0x5e20('0x11e')]=moment()[_0x5e20('0x7f')](_0x5e20('0x10f'));var _0x1595a8=new QueueCallerAbandon(_0x25d7d2,_0x12515f);if(getSeconds(_0x25d7d2[_0x5e20('0x11e')],_0x25d7d2[_0x5e20('0x11f')])>=_0x25d7d2[_0x5e20('0x120')]){this['voiceQueues'][_0x12515f['queue']][_0x5e20('0x89')]+=0x1;this[_0x5e20('0x20')][_0x12515f['queue']][_0x5e20('0x66')]+=0x1;this[_0x5e20('0x20')][_0x12515f[_0x5e20('0xbc')]][_0x5e20('0x70')]+=0x1;_0x1595a8[_0x5e20('0xb0')]=0xa;_0x1595a8['statedesc']=_0x5e20('0x121');_0x1595a8[_0x5e20('0x122')]=_0x5e20('0x123');_0x1595a8[_0x5e20('0x116')]=this[_0x5e20('0x20')][_0x12515f[_0x5e20('0xbc')]][_0x5e20('0x117')]?moment()[_0x5e20('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1595a8[_0x5e20('0x10d')]+=0x1;_0x1595a8[_0x5e20('0xf8')]+=0x1;if(_0x1595a8[_0x5e20('0x10d')]>=this[_0x5e20('0x20')][_0x12515f[_0x5e20('0xbc')]][_0x5e20('0x124')]){this[_0x5e20('0x11c')](_0x1595a8);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1595a8['countdropretry'],'scheduledat':moment()[_0x5e20('0x104')](this[_0x5e20('0x20')][_0x12515f[_0x5e20('0xbc')]][_0x5e20('0x125')],_0x5e20('0x105'))['format'](_0x5e20('0x10f')),'ContactId':_0x25d7d2[_0x5e20('0xdc')],'ListId':_0x25d7d2[_0x5e20('0xdd')],'VoiceQueueId':_0x25d7d2[_0x5e20('0xdf')]||undefined,'CampaignId':_0x25d7d2[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x126')));var _0x1e959c=new History(_0x1595a8);_0x1e959c[_0x5e20('0xb0')]=0xa;_0x1e959c[_0x5e20('0xb1')]=_0x5e20('0x121');_0x1e959c[_0x5e20('0xb3')]=moment()[_0x5e20('0x7f')](_0x5e20('0x10f'));_0x1e959c[_0x5e20('0xb2')]=_0x1e959c[_0x5e20('0xb3')];_0x1e959c['calleridname']=_0x1595a8[_0x5e20('0x127')];_0x1e959c['calleridnum']=_0x1595a8['calleridnum'];this[_0x5e20('0xd4')](_0x1e959c)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x128')));}}else{this['voiceQueues'][_0x12515f[_0x5e20('0xbc')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x5e20('0x20')][_0x12515f[_0x5e20('0xbc')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1595a8[_0x5e20('0xb0')]=0xb;_0x1595a8[_0x5e20('0xb1')]=_0x5e20('0x129');_0x1595a8[_0x5e20('0x122')]=_0x5e20('0x12a');_0x1595a8[_0x5e20('0xfc')]+=0x1;_0x1595a8[_0x5e20('0xf8')]+=0x1;if(_0x1595a8[_0x5e20('0xfc')]>=this[_0x5e20('0x20')][_0x12515f['queue']][_0x5e20('0x12b')]){this[_0x5e20('0x11c')](_0x1595a8);}else{this[_0x5e20('0xc7')]({'active':![],'countabandonedretry':_0x1595a8['countabandonedretry'],'scheduledat':moment()[_0x5e20('0x104')](this[_0x5e20('0x20')][_0x12515f[_0x5e20('0xbc')]][_0x5e20('0x12c')],_0x5e20('0x105'))[_0x5e20('0x7f')](_0x5e20('0x10f')),'ContactId':_0x25d7d2[_0x5e20('0xdc')],'ListId':_0x25d7d2[_0x5e20('0xdd')],'VoiceQueueId':_0x25d7d2[_0x5e20('0xdf')]||undefined,'CampaignId':_0x25d7d2[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x12d')));var _0x1e959c=new History(_0x1595a8);_0x1e959c['state']=0xb;_0x1e959c['statedesc']=_0x5e20('0x129');_0x1e959c['starttime']=moment()[_0x5e20('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e959c[_0x5e20('0xb2')]=_0x1e959c[_0x5e20('0xb3')];_0x1e959c[_0x5e20('0x127')]=_0x1595a8[_0x5e20('0x127')];_0x1e959c[_0x5e20('0x12e')]=_0x1595a8[_0x5e20('0x12e')];this[_0x5e20('0xd4')](_0x1e959c)['catch'](loggerCatch(_0x5e20('0x12f')));}}}}};Dialer[_0x5e20('0xb4')][_0x5e20('0x35')]=function(_0x58645f){if(this[_0x5e20('0x26')][_0x58645f[_0x5e20('0xea')]]){this['actions'][_0x58645f[_0x5e20('0xea')]][_0x5e20('0xb8')]=_0x58645f[_0x5e20('0xb8')];}if(this[_0x5e20('0x27')][_0x58645f[_0x5e20('0xea')]]){this['uniqueId'][_0x58645f[_0x5e20('0xea')]][_0x5e20('0xb8')]=_0x58645f[_0x5e20('0xb8')];}};Dialer[_0x5e20('0xb4')][_0x5e20('0x38')]=function(_0x13a340){if(strategy[this['voiceQueues'][this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]][_0x5e20('0xbc')]][_0x5e20('0x4f')]]===_0x5e20('0x1b')){if(this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]]&&_['isNil'](this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]][_0x5e20('0x131')])&&_0x13a340[_0x5e20('0xb7')]==='1'&&_0x13a340[_0x5e20('0x132')]==='0'){if(this[_0x5e20('0x22')][_0x13a340[_0x5e20('0x133')]]){if(!this[_0x5e20('0x22')][_0x13a340[_0x5e20('0x133')]][_0x5e20('0x131')]){this[_0x5e20('0x22')][_0x13a340['stateinterface']][_0x5e20('0x131')]=!![];this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]][_0x5e20('0x131')]=!![];this['actions'][_0x13a340[_0x5e20('0x130')]][_0x5e20('0x133')]=_0x13a340['stateinterface'];}}}}else if((strategy[this[_0x5e20('0x20')][this['actions'][_0x13a340[_0x5e20('0x130')]][_0x5e20('0xbc')]][_0x5e20('0x4f')]]||_0x5e20('0x134'))===_0x5e20('0x134')){if(this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]]){if(this[_0x5e20('0x22')][_0x13a340[_0x5e20('0x133')]]){this['actions'][_0x13a340[_0x5e20('0x130')]][_0x5e20('0x133')]=_0x13a340[_0x5e20('0x133')];if(_[_0x5e20('0xeb')](this[_0x5e20('0x28')][this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]][_0x5e20('0xbc')]])){this[_0x5e20('0x28')][this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]][_0x5e20('0xbc')]]=[];}this['queueBooked'][this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]]['queue']][_0x5e20('0x135')](_[_0x5e20('0x97')](_['pick'](this[_0x5e20('0x26')][_0x13a340[_0x5e20('0x130')]],[_0x5e20('0x136'),'stateinterface']),{'status':_0x13a340[_0x5e20('0xb7')],'paused':_0x13a340[_0x5e20('0x132')]}));}}}};function unlockQueueStatus(_0x525284,_0x548b80){setTimeout(function(){if(_[_0x5e20('0x3d')](_0x525284[_0x5e20('0x137')])){loggerBooked[_0x5e20('0x9e')](_0x5e20('0x138'),_0x548b80);}_0x525284[_0x5e20('0x137')]=!![];loggerBooked['info'](_0x5e20('0x139'),_0x548b80,JSON['stringify'](_[_0x5e20('0x13a')](_0x525284,[_0x5e20('0x40'),_0x5e20('0x137')])));},0x1f3);}Dialer[_0x5e20('0xb4')][_0x5e20('0x3a')]=function(_0x2f3937){var _0x23bac5=this;var _0xd01db2=_0x23bac5[_0x5e20('0x20')][_0x23bac5[_0x5e20('0x26')][_0x2f3937['actionid']]['queue']];if(strategy[this['voiceQueues'][this['actions'][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]][_0x5e20('0x4f')]]===_0x5e20('0x1b')){if(this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]]&&this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0x133')]){this[_0x5e20('0x1f')][_0x5e20('0x13b')](this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0x136')],this['actions'][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0x133')])['catch'](function(_0x5146f1){logger[_0x5e20('0x9e')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x5e20('0x9f')](_0x5146f1,{'showHidden':![],'depth':null}));})[_0x5e20('0x13c')](function(){_0x23bac5[_0x5e20('0xbb')](_0x23bac5[_0x5e20('0x20')][_0x23bac5['actions'][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]);_0x23bac5['agents'][_0x23bac5['actions'][_0x2f3937['actionid']][_0x5e20('0x133')]]['locked']=![];delete _0x23bac5[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]];unlockQueueStatus(_0xd01db2);});}else{this[_0x5e20('0xbb')](this[_0x5e20('0x20')][this['actions'][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]);this[_0x5e20('0xc7')]({'active':![],'ContactId':this['actions'][_0x2f3937['actionid']][_0x5e20('0xdc')],'ListId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]]['ListId'],'VoiceQueueId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x5e20('0x26')][_0x2f3937['actionid']][_0x5e20('0xe0')]||undefined})['catch'](loggerCatch(_0x5e20('0x13d')));delete this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]];unlockQueueStatus(_0xd01db2);}}else if((strategy[this[_0x5e20('0x20')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]['strategy']]||_0x5e20('0x134'))==='rrmemory'){var _0x560a41;if(this['actions'][_0x2f3937[_0x5e20('0x130')]]&&!_[_0x5e20('0x47')](this[_0x5e20('0x28')][this[_0x5e20('0x26')][_0x2f3937['actionid']][_0x5e20('0xbc')]])){if(this[_0x5e20('0x13e')][_0x23bac5[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]){this['queueBookedRR'][_0x23bac5[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]=this[_0x5e20('0x13e')][this['actions'][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]?this[_0x5e20('0x13e')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]:this[_0x5e20('0x28')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]?this[_0x5e20('0x28')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]]['queue']]['_rr']||0x0:0x0;}this[_0x5e20('0x28')][this[_0x5e20('0x26')][_0x2f3937['actionid']][_0x5e20('0xbc')]]['_rr']=this[_0x5e20('0x13e')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]];for(var _0x542cb0=0x0;_0x542cb0<this[_0x5e20('0x28')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]['length'];_0x542cb0+=0x1){_0x560a41=rr(this['queueBooked'][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]);this[_0x5e20('0x13e')][_0x23bac5[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]=this[_0x5e20('0x28')][this['actions'][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]][_0x5e20('0x13f')];if(_0x560a41[_0x5e20('0xb7')]==='1'&&_0x560a41[_0x5e20('0x132')]==='0'){break;}}if(!_[_0x5e20('0xeb')](_0x560a41)){this[_0x5e20('0x22')][_0x560a41[_0x5e20('0x133')]][_0x5e20('0x140')]=_[_0x5e20('0x3d')](this[_0x5e20('0x22')][_0x560a41[_0x5e20('0x133')]][_0x5e20('0x140')])?!![]:this[_0x5e20('0x22')][_0x560a41['stateinterface']][_0x5e20('0x140')];}loggerBooked[_0x5e20('0x85')](_0x5e20('0x141'),_0x2f3937['actionid'],'Agent:\x20',JSON[_0x5e20('0x7e')](_[_0x5e20('0x13a')](this[_0x5e20('0x22')][_0x560a41[_0x5e20('0x133')]],[_0x5e20('0x40'),_0x5e20('0x140')])),'contactAgent-idHopper:\x20',JSON[_0x5e20('0x7e')](_0x560a41[_0x5e20('0x136')]));if(!_[_0x5e20('0xeb')](_0x560a41)&&_0x560a41[_0x5e20('0xb7')]==='1'&&_0x560a41['paused']==='0'&&this[_0x5e20('0x22')][_0x560a41[_0x5e20('0x133')]][_0x5e20('0x140')]){this[_0x5e20('0x22')][_0x560a41[_0x5e20('0x133')]]['unlockRR']=![];this[_0x5e20('0x28')][_0x23bac5[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]=[];this[_0x5e20('0x1f')][_0x5e20('0x13b')](_0x560a41[_0x5e20('0x136')],_0x560a41[_0x5e20('0x133')])[_0x5e20('0xb9')](function(_0x5d3913){logger[_0x5e20('0x9e')](_0x5e20('0x142'),util[_0x5e20('0x9f')](_0x5d3913,{'showHidden':![],'depth':null}));})['finally'](function(){_0x23bac5[_0x5e20('0xbb')](_0x23bac5[_0x5e20('0x20')][_0x23bac5[_0x5e20('0x26')][_0x2f3937['actionid']][_0x5e20('0xbc')]]);setTimeout(function(){_0x23bac5[_0x5e20('0x22')][_0x560a41[_0x5e20('0x133')]][_0x5e20('0x140')]=!![];loggerBooked[_0x5e20('0x85')](_0x5e20('0x143'),_0x2f3937[_0x5e20('0x130')],'Agent:\x20',JSON[_0x5e20('0x7e')](_[_0x5e20('0x13a')](_0x23bac5[_0x5e20('0x22')][_0x560a41['stateinterface']],['name',_0x5e20('0x140')])),_0x5e20('0x144'),JSON[_0x5e20('0x7e')](_0x560a41[_0x5e20('0x136')]));},0xc7);delete _0x23bac5['actions'][_0x2f3937[_0x5e20('0x130')]];unlockQueueStatus(_0xd01db2,_0x2f3937['actionid']);});}else{loggerBooked[_0x5e20('0x85')](_0x5e20('0x145'));this['updateOriginated'](this[_0x5e20('0x20')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xbc')]]);this[_0x5e20('0xc7')]({'active':![],'ContactId':this[_0x5e20('0x26')][_0x2f3937['actionid']][_0x5e20('0xdc')],'ListId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xdd')],'VoiceQueueId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xdf')]||undefined,'CampaignId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x13d')));delete this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]];unlockQueueStatus(_0xd01db2);}}else{loggerBooked[_0x5e20('0x85')](_0x5e20('0x146'));this[_0x5e20('0xbb')](this[_0x5e20('0x20')][this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]]['queue']]);this[_0x5e20('0xc7')]({'active':![],'ContactId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]]['ContactId'],'ListId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xdd')],'VoiceQueueId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xdf')]||undefined,'CampaignId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x147')));delete this['actions'][_0x2f3937[_0x5e20('0x130')]];unlockQueueStatus(_0xd01db2);}}else{loggerBooked['info'](_0x5e20('0x148'));this[_0x5e20('0xbb')](this['voiceQueues'][this[_0x5e20('0x26')][_0x2f3937['actionid']][_0x5e20('0xbc')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xdc')],'ListId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xdd')],'VoiceQueueId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xdf')]||undefined,'CampaignId':this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]][_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x149')));delete this[_0x5e20('0x26')][_0x2f3937[_0x5e20('0x130')]];unlockQueueStatus(_0xd01db2);}};Dialer[_0x5e20('0xb4')][_0x5e20('0x3b')]=function(){var _0x495f8c=this;setInterval(function(){_0x495f8c[_0x5e20('0x14a')]();},0x3e8);};Dialer[_0x5e20('0xb4')][_0x5e20('0x14b')]=function(_0x389cb4){var _0xb0cd12=this;return function(){if(!_0xb0cd12[_0x5e20('0xe5')](_0x389cb4[_0x5e20('0x7b')])){if(!_0xb0cd12[_0x5e20('0xe5')](_0x389cb4['TrunkBackup'])){_0x389cb4[_0x5e20('0x3e')]=_0x5e20('0x14c');throw _0x389cb4[_0x5e20('0x40')]+_0x5e20('0x14d');}}};};Dialer['prototype'][_0x5e20('0x14e')]=function(_0x13523b,_0x45eca5,_0x164048,_0x53ce73){var _0x5a3cbd=this;return function(){var _0x492e9d=!![];return _0x5a3cbd['ifTime'](_0x13523b,_0x45eca5,_0x164048,_0x53ce73,_0x492e9d);};};Dialer[_0x5e20('0xb4')][_0x5e20('0x14f')]=function(_0x2b5686,_0x261107,_0xed321f,_0x33c9de){var _0x4860a2=this;return function(){var _0x32f12f=![];return _0x4860a2[_0x5e20('0x150')](_0x2b5686[_0x5e20('0x46')],_0x261107,_0xed321f,_0x33c9de,_0x32f12f);};};Dialer[_0x5e20('0xb4')]['ifTime']=function(_0x5dec8c,_0x1afa06,_0x26c25a,_0x2f3fd6,_0x58904e){var _0x93a0eb=[];return new BPromise(function(_0x5ce3be,_0x543c04){if(!isNotNull(_0x5dec8c)){_0x2f3fd6[_0x5e20('0x3e')]=_0x5e20('0x44');return _0x543c04(msgResponse(_0x5e20('0x150'),_0x5e20('0x151'),_0x26c25a+_0x5e20('0x152')));}if(_[_0x5e20('0x47')](_0x5dec8c)){_0x2f3fd6[_0x5e20('0x3e')]='INTERVAL_IS_EMPTY';return _0x543c04(msgResponse(_0x5e20('0x150'),_0x5e20('0x151'),_0x26c25a+_0x5e20('0x153')));}if(_0x1afa06&&_[_0x5e20('0x3d')](config[_0x5e20('0x154')][_0x1afa06])){_0x2f3fd6[_0x5e20('0x3e')]='TIMEZONE_UNKNOW';return _0x543c04(msgResponse(_0x5e20('0x150'),_0x5e20('0x151'),_0x26c25a+_0x5e20('0x155')+_0x1afa06));}if(_['isArray'](_0x5dec8c)){for(var _0x28f211=0x0;_0x28f211<_0x5dec8c['length'];_0x28f211+=0x1){_0x93a0eb[_0x5e20('0x135')](ami['Action']({'action':_0x5e20('0x156'),'command':util['format'](_0x5e20('0x157'),_0x5dec8c[_0x28f211][_0x5e20('0x158')],!_[_0x5e20('0x3d')](config['timezones'][_0x1afa06])?_0x1afa06:'')})[_0x5e20('0xc0')](function(_0x383691){return _0x383691[_0x5e20('0x159')][_0x5e20('0x15a')]('true')>=0x0;})['catch'](myreject(_0x543c04)));}}else{_0x93a0eb[_0x5e20('0x135')](ami[_0x5e20('0x15b')]({'action':'command','command':util[_0x5e20('0x7f')](_0x5e20('0x157'),_0x5dec8c,!_[_0x5e20('0x3d')](config['timezones'][_0x1afa06])?_0x1afa06:'')})[_0x5e20('0xc0')](function(_0x29f14a){return _0x29f14a['content']['indexOf'](_0x5e20('0x15c'))>=0x0;})[_0x5e20('0xb9')](myreject(_0x543c04)));}BPromise[_0x5e20('0x15d')](_0x93a0eb)[_0x5e20('0xc0')](function(_0x1fe83e){var _0x3074b6=_[_0x5e20('0x15e')](_0x1fe83e);if(_0x3074b6){return _0x5ce3be(_0x3074b6);}else{_0x2f3fd6[_0x5e20('0x3e')]=_0x58904e?'GLOBAL_INTERVAL_IS_OVERTIME':_0x5e20('0x15f');return _0x543c04(msgResponse(_0x5e20('0x160'),_0x5e20('0x151'),_0x5e20('0x161')+_0x58904e+'\x20'+_0x26c25a+_0x5e20('0x162')+util[_0x5e20('0x9f')](_0x5dec8c,{'showHidden':![],'depth':null})+_0x5e20('0x163')+_0x1afa06));}})[_0x5e20('0xb9')](function(_0x4e85bb){return _0x543c04(msgResponse(_0x5e20('0x150'),_0x5e20('0x151'),JSON['stringify'](_0x4e85bb)));});});};Dialer[_0x5e20('0xb4')][_0x5e20('0x164')]=function(_0x420250){var _0x505936=this;return function(){switch(_0x420250[_0x5e20('0x5c')]){case _0x5e20('0x165'):freeVariablesPredictive(_0x420250);_0x505936[_0x5e20('0x166')](_0x420250,0x1);break;case _0x5e20('0x167'):freeVariablesPredictive(_0x420250);_0x505936['handlePower'](_0x420250,_0x420250[_0x5e20('0x168')]);break;case _0x5e20('0x169'):_0x505936['predictive'](_0x420250);break;case _0x5e20('0xb'):freeVariablesPredictive(_0x420250);_0x505936[_0x5e20('0x166')](_0x420250,0x1);break;default:freeVariablesPredictive(_0x420250);logger[_0x5e20('0x9e')](_0x5e20('0x16a'),_0x420250['name'],_0x5e20('0x16b'));}};};Dialer['prototype'][_0x5e20('0x16c')]=function(_0x4d51ea){var _0x511f8e=this;return function(){_0x511f8e[_0x5e20('0x16d')](_0x4d51ea);};};Dialer[_0x5e20('0xb4')][_0x5e20('0x31')]=function(_0x2d1212){var _0x517646=this;if(isNotPreview(_0x2d1212['dialMethod'])){if(isVoiceQueueOutbound(_0x2d1212[_0x5e20('0x4d')])&&isActive(_0x2d1212[_0x5e20('0x5b')])){_0x2d1212[_0x5e20('0xab')]=!![];BPromise[_0x5e20('0xbf')]()[_0x5e20('0xc0')](checkIsLoggedIn(_0x2d1212,_0x2d1212[_0x5e20('0x52')]))[_0x5e20('0xc0')](checkIsActive(_0x2d1212,_0x2d1212['dialActive']))[_0x5e20('0xc0')](checkInterval(_0x2d1212))[_0x5e20('0xc0')](_0x517646[_0x5e20('0x14b')](_0x2d1212))[_0x5e20('0xc0')](_0x517646['checkIfTime'](_0x2d1212['dialGlobalInterval'],_0x2d1212['dialTimezone'],_0x2d1212[_0x5e20('0x40')],_0x2d1212))[_0x5e20('0xc0')](_0x517646[_0x5e20('0x14f')](_0x2d1212[_0x5e20('0x43')],_0x2d1212[_0x5e20('0x16e')],_0x2d1212[_0x5e20('0x40')],_0x2d1212))['then'](_0x517646[_0x5e20('0x164')](_0x2d1212))['catch'](loggerCatchQueueSummary(_0x5e20('0x16f'),_0x2d1212));}else{notSendMessagesQueue(_0x2d1212);}}else{freeVariablesPredictive(_0x2d1212);}};Dialer['prototype']['syncCampaigns']=function(){var _0x17f20a=this;var _0x6db7b2;for(var _0xc3c677 in this[_0x5e20('0x21')]){if(typeof this['campaigns'][_0xc3c677]!==_0x5e20('0xa3')){_0x6db7b2=this['campaigns'][_0xc3c677];if(isCampaignIvr(_0x6db7b2[_0x5e20('0x4d')])&&isActive(_0x6db7b2[_0x5e20('0x7c')])){_0x6db7b2['sendMessageOneNotActive']=!![];BPromise[_0x5e20('0xbf')]()[_0x5e20('0xc0')](checkIsActive(_0x6db7b2,_0x6db7b2[_0x5e20('0x7c')]))[_0x5e20('0xc0')](checkInterval(_0x6db7b2))[_0x5e20('0xc0')](_0x17f20a[_0x5e20('0x14b')](_0x6db7b2))[_0x5e20('0xc0')](_0x17f20a['checkIfTime'](_0x6db7b2[_0x5e20('0x170')],_0x6db7b2[_0x5e20('0x16e')],_0x6db7b2[_0x5e20('0x40')],_0x6db7b2))[_0x5e20('0xc0')](_0x17f20a[_0x5e20('0x14f')](_0x6db7b2[_0x5e20('0x43')],_0x6db7b2[_0x5e20('0x16e')],_0x6db7b2['name'],_0x6db7b2))[_0x5e20('0xc0')](_0x17f20a[_0x5e20('0x16c')](_0x6db7b2))[_0x5e20('0xb9')](loggerCatchQueueSummary(_0x5e20('0x171'),_0x6db7b2));}else{notSendMessagesCampaign(_0x6db7b2);}}}};function getCallerIdRandom(_0x4a45e6,_0x13e5fa){var _0xb03271;var _0x4ad7a7;var _0x5dc312;if(_0x13e5fa<=0x0){_0x13e5fa=0x1;}_0xb03271=new RegExp('\x5cw{0,'+_0x13e5fa+'}$');_0x4ad7a7=Math[_0x5e20('0x172')](0xa,_0x13e5fa-0x1);_0x5dc312=Math[_0x5e20('0x172')](0xa,_0x13e5fa)-0x1;return util[_0x5e20('0x7f')]('%s',_['replace'](_0x4a45e6,_0xb03271,_[_0x5e20('0x173')](_0x4ad7a7,_0x5dc312)));}function extractCalleridName(_0x4aaf6e){var _0x2f6880=_0x4aaf6e[_0x5e20('0x174')](/"(.*?)"/);return _0x2f6880?_0x2f6880[0x1]:_0x4aaf6e;}function extractCalleridNumber(_0x125084){var _0x15ee0e=_0x125084[_0x5e20('0x174')](/<(.*?)>/);return _0x15ee0e?_0x15ee0e[0x1]:_0x125084;}Dialer[_0x5e20('0xb4')][_0x5e20('0x175')]=function(_0xea0133,_0x418236){var _0x542942=this;var _0x4c6067=uuid['v4']();this[_0x5e20('0x26')][_0x4c6067]=new Action(_0xea0133,_0x418236,_0x4c6067);return new BPromise(function(_0x3fffb6,_0x1d7922){if(_[_0x5e20('0x3d')](_0xea0133)&&typeof _0xea0133!==_0x5e20('0x176')){return _0x1d7922(msgResponse(_0x5e20('0x177'),_0x5e20('0x151'),_0x5e20('0x178')));}if(_[_0x5e20('0x3d')](_0x418236[_0x5e20('0x179')][_0x5e20('0x17a')])||_0x418236[_0x5e20('0x179')]['phone']===null){return _0x1d7922(msgResponse(_0x5e20('0x177'),_0x5e20('0x151'),_0x5e20('0x17b')));}var _0xc35113={'XMD-CALLERID':_0x542942[_0x5e20('0x26')][_0x4c6067][_0x5e20('0x17c')](),'XMD-AGI':_0xea0133[_0x5e20('0x113')]?util[_0x5e20('0x7f')]('\x22agi://%s/square,%s\x22',ipAgi,_0xea0133[_0x5e20('0x113')]):_0x5e20('0x17d'),'XMD-AGIAFTER':_0xea0133[_0x5e20('0x117')]?util[_0x5e20('0x7f')]('\x22agi://%s/square,%s\x22',ipAgi,_0xea0133[_0x5e20('0x117')]):_0x5e20('0x17d'),'XMD-QUEUE':_0xea0133['type']===_0x5e20('0x4e')?util[_0x5e20('0x7f')](_0x5e20('0x17e'),_0xea0133[_0x5e20('0x40')],_0xea0133[_0x5e20('0x17f')]||'',_0xea0133[_0x5e20('0x118')]?'c':'',_0xea0133['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x418236[_0x5e20('0xdc')],'XMD-CDRTYPE':_0x5e20('0x9'),'CALLERID(all)':_0x542942[_0x5e20('0x26')][_0x4c6067]['getCaller'](),'XMD-AMD':_0xea0133[_0x5e20('0xf6')]?_0x5e20('0x180'):_0x5e20('0x17d'),'XMD-DESTINATION':_0x5e20('0xed')};if(_0xea0133[_0x5e20('0xf6')]){_0xc35113[_0x5e20('0x181')]=_0xea0133[_0x5e20('0x182')]||0x9c4;_0xc35113[_0x5e20('0x183')]=_0xea0133[_0x5e20('0x184')]||0x5dc;_0xc35113[_0x5e20('0x185')]=_0xea0133[_0x5e20('0x186')]||0x320;_0xc35113[_0x5e20('0x187')]=_0xea0133[_0x5e20('0x188')]||0x1388;_0xc35113[_0x5e20('0x189')]=_0xea0133['dialAMDMinWordLength']||0x64;_0xc35113[_0x5e20('0x18a')]=_0xea0133['dialAMDBetweenWordsSilence']||0x32;_0xc35113[_0x5e20('0x18b')]=_0xea0133[_0x5e20('0x18c')]||0x3;_0xc35113['XMD-AMDSILENCETHRESHOLD']=_0xea0133[_0x5e20('0x18d')]||0x100;_0xc35113['XMD-AMDMAXIMUMWORDLENGTH']=_0xea0133['dialAMDMaximumWordLength']||0x1388;}if(_0xea0133[_0x5e20('0x4d')]===_0x5e20('0x4e')){_0xc35113[_0x5e20('0x18e')]=_0x418236[_0x5e20('0xdf')];}else{_0xc35113[_0x5e20('0x18f')]=_0x418236['CampaignId'];}for(var _0xb4659c in _0x418236[_0x5e20('0x179')]){if(typeof _0x418236['Contact'][_0xb4659c]!==_0x5e20('0xa3')){if(isNotNull(_0x418236[_0x5e20('0x179')][_0xb4659c])&&_0xb4659c!=='id'&&_0xb4659c!==_0x5e20('0x190')&&_0xb4659c!==_0x5e20('0x191')&&_0xb4659c!==_0x5e20('0x192')){_0xc35113[util['format']('%s%s','XMD-',_['toUpper'](_0xb4659c))]=_0x418236[_0x5e20('0x179')][_0xb4659c];}}}var _0x42d0e1=_0x542942[_0x5e20('0xe5')](_0xea0133[_0x5e20('0x7b')])?getCallerId(_0xea0133[_0x5e20('0x7b')][_0x5e20('0x7d')],_0xea0133['dialOriginateCallerIdName'],_0xea0133[_0x5e20('0x193')]>0x0?getCallerIdRandom(_0xea0133[_0x5e20('0x5e')],_0xea0133['dialRandomLastDigitCallerIdNumber']):_0xea0133['dialOriginateCallerIdNumber']):getCallerId(_[_0x5e20('0xeb')](_0xea0133[_0x5e20('0x194')])?_0xea0133['Trunk'][_0x5e20('0x7d')]:_0xea0133[_0x5e20('0x194')][_0x5e20('0x7d')],_0xea0133[_0x5e20('0x5d')],_0xea0133[_0x5e20('0x193')]>0x0?getCallerIdRandom(_0xea0133[_0x5e20('0x5e')],_0xea0133['dialRandomLastDigitCallerIdNumber']):_0xea0133[_0x5e20('0x5e')]);if(_0x42d0e1){_0xc35113[_0x5e20('0x195')]=_0x542942[_0x5e20('0x26')][_0x4c6067][_0x5e20('0x196')]=extractCalleridName(_0x42d0e1);_0xc35113[_0x5e20('0x197')]=_0x542942[_0x5e20('0x26')][_0x4c6067][_0x5e20('0x198')]=extractCalleridNumber(_0x42d0e1);}return ami[_0x5e20('0x15b')]({'actionid':_0x4c6067,'action':_0x5e20('0x177'),'channel':_0x542942[_0x5e20('0xe5')](_0xea0133[_0x5e20('0x7b')])?util[_0x5e20('0x7f')](_0x5e20('0x199'),_0xea0133[_0x5e20('0x7b')][_0x5e20('0x40')],isNotNull(_0xea0133[_0x5e20('0x19a')])?_0xea0133[_0x5e20('0x19a')][_0x5e20('0x19b')]()||'':'',_0xea0133['dialCutDigit']>0x0?_0x418236['Contact']['phone'][_0x5e20('0x19c')](_0xea0133[_0x5e20('0x19d')]):_0x418236[_0x5e20('0x179')]['phone']):util[_0x5e20('0x7f')](_0x5e20('0x199'),_['isNil'](_0xea0133[_0x5e20('0x194')])?_0xea0133[_0x5e20('0x7b')][_0x5e20('0x40')]:_0xea0133[_0x5e20('0x194')][_0x5e20('0x40')],isNotNull(_0xea0133['dialPrefix'])?_0xea0133[_0x5e20('0x19a')][_0x5e20('0x19b')]()||'':'',_0xea0133['dialCutDigit']>0x0?_0x418236['Contact'][_0x5e20('0x17a')][_0x5e20('0x19c')](_0xea0133[_0x5e20('0x19d')]):_0x418236['Contact'][_0x5e20('0x17a')]),'callerid':_0x42d0e1,'Exten':_0x5e20('0xed'),'Context':'from-sip','Priority':'1','variable':_0xc35113,'timeout':(_0xea0133[_0x5e20('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4c6067})['then'](function(_0x417fb5){return _0x3fffb6(_0x417fb5);})[_0x5e20('0xb9')](function(_0x1173bc){_0xea0133[_0x5e20('0x69')]+=0x1;var _0x2ca9f9=new History(_0x542942['actions'][_0x4c6067]);logger['error'](util[_0x5e20('0x7f')](_0x5e20('0x19e'),JSON[_0x5e20('0x7e')](_0x1173bc)));_0x2ca9f9[_0x5e20('0xb0')]=0xe;_0x2ca9f9[_0x5e20('0xb1')]=_0x5e20('0x19f');_0x2ca9f9['starttime']=moment()[_0x5e20('0x7f')](_0x5e20('0x10f'));_0x2ca9f9[_0x5e20('0xb2')]=_0x2ca9f9['starttime'];_0x542942[_0x5e20('0xd4')](_0x2ca9f9)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1a0')));_0x542942[_0x5e20('0xd2')](_0x2ca9f9)[_0x5e20('0xb9')](loggerCatch('[originate][error]'))[_0x5e20('0x13c')](function(){delete _0x542942[_0x5e20('0x26')][_0x4c6067];return _0x1d7922(msgResponse('originate',_0x5e20('0x1a1'),'originate\x20action\x20Error'));});});});};Dialer[_0x5e20('0xb4')][_0x5e20('0x2e')]=function(_0x4f667f){var _0x1b40e5=this[_0x5e20('0x26')][_0x4f667f[_0x5e20('0x130')]];if(_0x1b40e5){delete this[_0x5e20('0x26')][_0x4f667f[_0x5e20('0x130')]];_0x1b40e5[_0x5e20('0x11f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4663e7=_0x1b40e5[_0x5e20('0x4d')]===_0x5e20('0x81')?this['campaigns'][_0x1b40e5[_0x5e20('0xbc')]]:this[_0x5e20('0x20')][_0x1b40e5[_0x5e20('0x1a2')]()];if(!this[_0x5e20('0xe3')](_0x4f667f[_0x5e20('0x1a3')])){this[_0x5e20('0xbb')](_0x4663e7);return this[_0x5e20('0x1a4')](_0x1b40e5,_0x4663e7,_0x4f667f)[_0x5e20('0xb9')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x4f667f[_0x5e20('0xea')]]=_0x1b40e5;}};Dialer[_0x5e20('0xb4')][_0x5e20('0x1a5')]=function(_0xf48172,_0x453cc9,_0x41f0fe){var _0x3707ec=new History(_0x453cc9);if(_0x3707ec[_0x5e20('0x10b')]+_0x3707ec[_0x5e20('0xfb')]+_0x3707ec['countnoanswerretry']+_0x3707ec[_0x5e20('0x10c')]+_0x3707ec[_0x5e20('0x10d')]+_0x3707ec[_0x5e20('0xfc')]+_0x3707ec[_0x5e20('0xf7')]+_0x3707ec[_0x5e20('0xfd')]>=_0x41f0fe[_0x5e20('0xfe')]-0x1){return!![];}switch(_0xf48172){case 0x3:if(_0x3707ec[_0x5e20('0x1a6')]>=_0x41f0fe[_0x5e20('0x1a7')]-0x1){return!![];}this[_0x5e20('0xc7')]({'active':![],'countnoanswerretry':_0x3707ec[_0x5e20('0x1a6')]+=0x1,'scheduledat':moment()[_0x5e20('0x104')](_0x41f0fe[_0x5e20('0x1a8')],_0x5e20('0x105'))[_0x5e20('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec['VoiceQueueId']||undefined,'CampaignId':_0x3707ec[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1a9')));break;case 0x5:if(_0x3707ec[_0x5e20('0x10b')]>=_0x41f0fe[_0x5e20('0x1aa')]-0x1){return!![];}this[_0x5e20('0xc7')]({'active':![],'countbusyretry':_0x3707ec[_0x5e20('0x10b')]+=0x1,'scheduledat':moment()[_0x5e20('0x104')](_0x41f0fe[_0x5e20('0x1ab')],_0x5e20('0x105'))[_0x5e20('0x7f')](_0x5e20('0x10f')),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec[_0x5e20('0xdf')]||undefined,'CampaignId':_0x3707ec[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1ac')));break;case 0x8:if(_0x3707ec[_0x5e20('0xfb')]>=_0x41f0fe[_0x5e20('0x1ad')]-0x1){return!![];}this[_0x5e20('0xc7')]({'active':![],'countcongestionretry':_0x3707ec[_0x5e20('0xfb')]+=0x1,'scheduledat':moment()[_0x5e20('0x104')](_0x41f0fe['dialCongestionRetryFrequency'],_0x5e20('0x105'))[_0x5e20('0x7f')](_0x5e20('0x10f')),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec[_0x5e20('0xdf')]||undefined,'CampaignId':_0x3707ec[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1ae')));break;case 0x0:if(_0x3707ec[_0x5e20('0x10c')]>=_0x41f0fe[_0x5e20('0x1af')]-0x1){return!![];}else{this[_0x5e20('0xc7')]({'active':![],'countnosuchnumberretry':_0x3707ec[_0x5e20('0x10c')]+=0x1,'scheduledat':moment()[_0x5e20('0x104')](_0x41f0fe[_0x5e20('0x1b0')],_0x5e20('0x105'))[_0x5e20('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec['VoiceQueueId']||undefined,'CampaignId':_0x3707ec[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1b1')));}break;case 0xa:if(_0x3707ec[_0x5e20('0x10d')]>=_0x41f0fe[_0x5e20('0x124')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x3707ec[_0x5e20('0x10d')]+=0x1,'scheduledat':moment()['add'](_0x41f0fe[_0x5e20('0x125')],_0x5e20('0x105'))[_0x5e20('0x7f')](_0x5e20('0x10f')),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec[_0x5e20('0xdf')]||undefined,'CampaignId':_0x3707ec[_0x5e20('0xe0')]||undefined})['catch'](loggerCatch(_0x5e20('0x126')));break;case 0xb:if(_0x3707ec[_0x5e20('0xfc')]>=_0x41f0fe['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x5e20('0xc7')]({'active':![],'countabandonedretry':_0x3707ec[_0x5e20('0xfc')]+=0x1,'scheduledat':moment()[_0x5e20('0x104')](_0x41f0fe[_0x5e20('0x12c')],_0x5e20('0x105'))[_0x5e20('0x7f')](_0x5e20('0x10f')),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec[_0x5e20('0xdf')]||undefined,'CampaignId':_0x3707ec[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x12d')));break;case 0x13:if(_0x3707ec[_0x5e20('0xf7')]>=_0x41f0fe['dialMachineMaxRetry']-0x1){return!![];}this[_0x5e20('0xc7')]({'active':![],'countmachineretry':_0x3707ec[_0x5e20('0xf7')]+=0x1,'scheduledat':moment()[_0x5e20('0x104')](_0x41f0fe[_0x5e20('0x10e')],_0x5e20('0x105'))['format'](_0x5e20('0x10f')),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec[_0x5e20('0xdf')]||undefined,'CampaignId':_0x3707ec[_0x5e20('0xe0')]||undefined})['catch'](loggerCatch(_0x5e20('0x106')));break;case 0x14:if(_0x3707ec[_0x5e20('0xfd')]>=_0x41f0fe[_0x5e20('0x1b2')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x3707ec[_0x5e20('0xfd')]+=0x1,'scheduledat':moment()[_0x5e20('0x104')](_0x41f0fe[_0x5e20('0x1b3')],_0x5e20('0x105'))['format'](_0x5e20('0x10f')),'ContactId':_0x3707ec[_0x5e20('0xdc')],'ListId':_0x3707ec[_0x5e20('0xdd')],'VoiceQueueId':_0x3707ec[_0x5e20('0xdf')]||undefined,'CampaignId':_0x3707ec['CampaignId']||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1b4')));break;default:return!![];}};Dialer[_0x5e20('0xb4')][_0x5e20('0x1a4')]=function(_0x1ee2c4,_0x4cf465,_0x55bd03){var _0x4f2086=this;var _0x16ddf2=new History(_0x1ee2c4);return new BPromise(function(_0x5cb728,_0x7921d8){if(_[_0x5e20('0x3d')](_0x4cf465)&&typeof _0x4cf465!==_0x5e20('0x176')){return _0x7921d8(msgResponse(_0x5e20('0x1b5'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x55bd03)&&typeof _0x55bd03!=='object'){return _0x7921d8(msgResponse(_0x5e20('0x1b5'),_0x5e20('0x151'),_0x5e20('0x1b6')));}switch(_0x55bd03['reason']){case'0':_0x4cf465[_0x5e20('0x68')]+=0x1;_0x16ddf2['state']=0x0;_0x16ddf2[_0x5e20('0xb1')]=_0x5e20('0x1b7');_0x16ddf2[_0x5e20('0x10c')]+=0x1;_0x16ddf2['countglobal']+=0x1;ami[_0x5e20('0x4c')](_0x5e20('0x1b8'),ut[_0x5e20('0xf4')](_0x1ee2c4,_0x5e20('0x1b9')));_0x4f2086['createHistory'](_0x16ddf2)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4f2086[_0x5e20('0x1a5')](0x0,_0x1ee2c4,_0x4cf465)){if(_0x16ddf2['countnosuchnumberretry']>=_0x4cf465['dialNoSuchNumberMaxRetry']){_0x4f2086['createStateFinal'](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1ba'));}else{_0x4f2086[_0x5e20('0xff')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1ba'));}}break;case'3':_0x4cf465[_0x5e20('0x67')]+=0x1;_0x16ddf2[_0x5e20('0xb0')]=0x3;_0x16ddf2[_0x5e20('0xb1')]=_0x5e20('0x1bb');_0x16ddf2[_0x5e20('0x1a6')]+=0x1;_0x16ddf2['countglobal']+=0x1;ami[_0x5e20('0x4c')](_0x5e20('0x1bc'),ut[_0x5e20('0xf4')](_0x1ee2c4,'noanswer'));_0x4f2086[_0x5e20('0xd4')](_0x16ddf2)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1bd')));if(_0x4f2086[_0x5e20('0x1a5')](0x3,_0x1ee2c4,_0x4cf465)){if(_0x16ddf2['countnoanswerretry']>=_0x4cf465[_0x5e20('0x1a7')]){_0x4f2086['createStateFinal'](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1be'));}else{_0x4f2086[_0x5e20('0xff')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1be'));}}break;case'5':_0x4cf465['outboundBusyCallsDay']+=0x1;_0x16ddf2[_0x5e20('0xb0')]=0x5;_0x16ddf2[_0x5e20('0xb1')]=_0x5e20('0x1bf');_0x16ddf2[_0x5e20('0x10b')]+=0x1;_0x16ddf2[_0x5e20('0xf8')]+=0x1;ami[_0x5e20('0x4c')](_0x5e20('0x1c0'),ut['buildObj'](_0x1ee2c4,_0x5e20('0x1c1')));_0x4f2086[_0x5e20('0xd4')](_0x16ddf2)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1c2')));if(_0x4f2086['checkRetriveMax'](0x5,_0x1ee2c4,_0x4cf465)){if(_0x16ddf2[_0x5e20('0x10b')]>=_0x4cf465[_0x5e20('0x1aa')]){_0x4f2086[_0x5e20('0x102')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1c3'));}else{_0x4f2086['stateGlobal'](_0x16ddf2,_0x5cb728,_0x7921d8,'reason\x205\x20busy');}}break;case'8':_0x4cf465['outboundCongestionCallsDay']+=0x1;_0x16ddf2[_0x5e20('0xb0')]=0x8;_0x16ddf2[_0x5e20('0xb1')]='Congestion';_0x16ddf2[_0x5e20('0xfb')]+=0x1;_0x16ddf2[_0x5e20('0xf8')]+=0x1;ami[_0x5e20('0x4c')](_0x5e20('0x1c4'),ut[_0x5e20('0xf4')](_0x1ee2c4,_0x5e20('0x1c5')));_0x4f2086[_0x5e20('0xd4')](_0x16ddf2)[_0x5e20('0xb9')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x4f2086[_0x5e20('0x1a5')](0x8,_0x1ee2c4,_0x4cf465)){if(_0x16ddf2[_0x5e20('0xfb')]>=_0x4cf465[_0x5e20('0x1ad')]){_0x4f2086[_0x5e20('0x102')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1c6'));}else{_0x4f2086[_0x5e20('0xff')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1c6'));}}break;case'11':_0x4cf465[_0x5e20('0x1c7')]+=0x1;_0x16ddf2[_0x5e20('0xb0')]=0xb;_0x16ddf2['statedesc']='Abandoned';_0x16ddf2[_0x5e20('0xfc')]+=0x1;_0x16ddf2[_0x5e20('0xf8')]+=0x1;_0x4f2086[_0x5e20('0xd4')](_0x16ddf2)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x12f')));if(_0x4f2086[_0x5e20('0x1a5')](0xb,_0x1ee2c4,_0x4cf465)){if(_0x16ddf2[_0x5e20('0xfc')]>=_0x4cf465['dialAbandonedMaxRetry']){_0x4f2086[_0x5e20('0x102')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1c8'));}else{_0x4f2086[_0x5e20('0xff')](_0x16ddf2,_0x5cb728,_0x7921d8,'reason\x2011\x20abandoned');}}break;case'20':_0x4cf465['outboundRejectCallsDay']+=0x1;_0x16ddf2['state']=0x14;_0x16ddf2['statedesc']=_0x5e20('0x1c9');_0x16ddf2[_0x5e20('0xfd')]+=0x1;_0x16ddf2['countglobal']+=0x1;ami[_0x5e20('0x4c')]('custom:agentreject',ut[_0x5e20('0xf4')](_0x1ee2c4,_0x5e20('0x1ca')));_0x4f2086[_0x5e20('0xd4')](_0x16ddf2)[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1cb')));if(_0x4f2086['checkRetriveMax'](0x14,_0x1ee2c4,_0x4cf465)){if(_0x16ddf2[_0x5e20('0xfd')]>=_0x4cf465[_0x5e20('0x1b2')]){_0x4f2086['createStateFinal'](_0x16ddf2,_0x5cb728,_0x7921d8,'reason\x2020\x20agentreject');}else{_0x4f2086[_0x5e20('0xff')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x5e20('0x1cc'));}}break;default:_0x4cf465[_0x5e20('0x6b')]+=0x1;_0x16ddf2['state']=0xc;_0x16ddf2[_0x5e20('0xb1')]=_0x55bd03[_0x5e20('0x1cd')];_0x4f2086[_0x5e20('0xd4')](_0x16ddf2)['catch'](loggerCatch(_0x5e20('0x1ce')));if(_0x4f2086[_0x5e20('0x1a5')](_0x55bd03['reason'],_0x1ee2c4,_0x4cf465)){if(_0x16ddf2['countbusyretry']+_0x16ddf2[_0x5e20('0xfb')]+_0x16ddf2[_0x5e20('0x1a6')]+_0x16ddf2[_0x5e20('0x10c')]+_0x16ddf2[_0x5e20('0x10d')]+_0x16ddf2[_0x5e20('0xfc')]+_0x16ddf2['countmachineretry']+_0x16ddf2['countagentrejectretry']>=_0x4cf465['dialGlobalMaxRetry']){_0x4f2086[_0x5e20('0xff')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x55bd03[_0x5e20('0x1cd')]);}else{_0x4f2086[_0x5e20('0x102')](_0x16ddf2,_0x5cb728,_0x7921d8,_0x55bd03[_0x5e20('0x1cd')]);}}}});};Dialer[_0x5e20('0xb4')][_0x5e20('0xff')]=function(_0x5bbba9,_0x582d40,_0x4a743b,_0x1e65e1){var _0x238aca=new Final(_0x5bbba9);_0x238aca[_0x5e20('0xb0')]=0xf;_0x238aca[_0x5e20('0xb1')]=_0x5e20('0x1cf');this[_0x5e20('0x102')](_0x238aca,_0x582d40,_0x4a743b,_0x1e65e1);};Dialer['prototype']['createStateFinal']=function(_0x5506cd,_0x379754,_0x232c18,_0x2f1abd){this[_0x5e20('0xd2')](_0x5506cd)[_0x5e20('0xc0')](function(){return _0x379754(msgResponse(_0x5e20('0x1b5'),_0x5e20('0xe4'),_0x2f1abd));})[_0x5e20('0xb9')](function(){return _0x232c18(msgResponse(_0x5e20('0x1d0'),_0x5e20('0x151'),_0x5e20('0x1d1')));});};Dialer[_0x5e20('0xb4')][_0x5e20('0x169')]=function(_0x1e259d){var _0x7cc73f=_0x1e259d[_0x5e20('0x1d2')]/0x64;var _0x55eaf7=_0x1e259d[_0x5e20('0x66')]/(_0x1e259d[_0x5e20('0x66')]+_0x1e259d[_0x5e20('0x61')]);var _0x16d652=Math[_0x5e20('0x1d3')](_0x1e259d[_0x5e20('0x1d4')]*(_0x1e259d[_0x5e20('0x1d5')]/0x64));var _0x54e2e5=Math[_0x5e20('0x1d3')](_0x1e259d[_0x5e20('0x1d4')]*(_0x1e259d['predictiveIntervalMinThreshold']/0x64));var _0x5d41a4=_0x1e259d[_0x5e20('0x51')]+_0x1e259d[_0x5e20('0x56')];var _0x3bc718=Math['floor'](_0x1e259d['erlangCalls']*_0x1e259d[_0x5e20('0x77')]*_0x1e259d[_0x5e20('0x71')]*_0x1e259d[_0x5e20('0x72')]);if(_[_0x5e20('0x3d')](_0x1e259d[_0x5e20('0x7a')])){if(!_[_0x5e20('0x3d')](_0x1e259d['startPredictive'])){_0x1e259d[_0x5e20('0x79')]=undefined;loggerPredictive[_0x5e20('0x9e')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x1e259d['handlePredictive'])){loggerPredictive[_0x5e20('0x9e')](_0x5e20('0x1d6'),_0x5e20('0x1d7'));clearInterval(_0x1e259d[_0x5e20('0x99')]);_0x1e259d[_0x5e20('0x99')]=undefined;}_0x1e259d['startProgressive']=moment()[_0x5e20('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x1e259d[_0x5e20('0x40')],_0x5e20('0x1d8'),_0x1e259d[_0x5e20('0x7a')]);this[_0x5e20('0x166')](_0x1e259d,0x1);}else if(ifInterval(_0x1e259d['dialPredictiveInterval'],_0x1e259d[_0x5e20('0x7a')])){this['handlePower'](_0x1e259d,0x1);loggerPredictiveCalls[_0x5e20('0x85')](_0x5e20('0x1d9'),_0x1e259d[_0x5e20('0x7a')],_0x1e259d[_0x5e20('0x40')]);_0x1e259d[_0x5e20('0x75')]=0x0;_0x1e259d[_0x5e20('0x70')]=0x0;}else if(_0x7cc73f<_0x55eaf7&&_0x1e259d[_0x5e20('0x1da')]==='dropRate'){freeVariablesPredictive(_0x1e259d);loggerPredictive[_0x5e20('0x85')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x5e20('0x1db'),_0x55eaf7,'startProgressive',_0x1e259d[_0x5e20('0x40')]);}else if(_0x3bc718<_0x1e259d[_0x5e20('0x70')]&&_0x1e259d[_0x5e20('0x1da')]===_0x5e20('0x1dc')){freeVariablesPredictive(_0x1e259d);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x1dd'),_0x5e20('0x1de'),_0x3bc718,_0x5e20('0x1df'),_0x1e259d['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x1e259d[_0x5e20('0x40')]);}else if(!ifInterval(_0x1e259d[_0x5e20('0x1e0')],_0x1e259d[_0x5e20('0x7a')])&&_['isUndefined'](_0x1e259d['startPredictive'])&&!_[_0x5e20('0x3d')](_0x1e259d[_0x5e20('0x7a')])){_0x1e259d[_0x5e20('0x79')]=moment()[_0x5e20('0x7f')](_0x5e20('0x10f'));loggerPredictive[_0x5e20('0x85')](_0x1e259d[_0x5e20('0x40')],_0x5e20('0x1e1'),_0x1e259d[_0x5e20('0x79')]);this[_0x5e20('0x1e2')](_0x1e259d[_0x5e20('0x1e0')])[_0x5e20('0xc0')](this[_0x5e20('0x1e3')](_0x1e259d))['then'](mergeDataErlangB(_0x1e259d))[_0x5e20('0xc0')](this[_0x5e20('0x1e4')](_0x1e259d))['catch'](loggerCatchPredictive(_0x5e20('0x1e5'),_0x1e259d));}else if(!ifInterval(_0x1e259d['dialPredictiveInterval'],_0x1e259d['startPredictive'])){_0x1e259d[_0x5e20('0x70')]=0x0;_0x1e259d[_0x5e20('0x79')]=moment()[_0x5e20('0x7f')](_0x5e20('0x10f'));loggerPredictive['info'](_0x1e259d['name'],_0x5e20('0x1e6'),_0x1e259d['startPredictive']);clearInterval(_0x1e259d[_0x5e20('0x99')]);_0x1e259d[_0x5e20('0x99')]=undefined;this['averageHandleTime'](_0x1e259d['dialPredictiveInterval'])[_0x5e20('0xc0')](this[_0x5e20('0x1e3')](_0x1e259d))[_0x5e20('0xc0')](mergeDataErlangB(_0x1e259d))['then'](this['startMethodPredictive'](_0x1e259d))['catch'](loggerCatchPredictive(_0x5e20('0x1e7'),_0x1e259d));}else if(_0x1e259d[_0x5e20('0x1d4')]&&_0x5d41a4<_0x1e259d[_0x5e20('0x1d4')]-_0x54e2e5){freeVariablesPredictive(_0x1e259d);loggerPredictive[_0x5e20('0x85')](_0x1e259d[_0x5e20('0x40')],_0x5e20('0x1e8'),_0x5d41a4,')\x20are\x20less\x20than\x20threshold\x20(',_0x1e259d['predictiveIntervalAvailable'],'-',_0x54e2e5,'=',_0x1e259d[_0x5e20('0x1d4')]-_0x54e2e5,')');}else if(_0x1e259d[_0x5e20('0x1d4')]&&_0x5d41a4>_0x1e259d[_0x5e20('0x1d4')]+_0x16d652){freeVariablesPredictive(_0x1e259d);loggerPredictive['info'](_0x1e259d[_0x5e20('0x40')],_0x5e20('0x1e8'),_0x5d41a4,_0x5e20('0x1e9'),_0x1e259d['predictiveIntervalAvailable'],'+',_0x16d652,'=',_0x1e259d[_0x5e20('0x1d4')]+_0x16d652,')');}};Dialer['prototype'][_0x5e20('0x1e3')]=function(_0x145486){var _0x5b0128=this;return function(_0x25f605){return new BPromise(function(_0x4a8454,_0x50e8d4){_[_0x5e20('0x97')](_0x145486,_0x25f605[0x0]);if(checkGetDataPredictive(_0x25f605[0x0])){var _0x13bc89=_0x145486[_0x5e20('0x1d4')]=_0x145486[_0x5e20('0x56')]+_0x145486[_0x5e20('0x51')];var _0x1c81b3=_0x145486[_0x5e20('0x1e0')]*0x3c;var _0x436cdc=_0x25f605[0x0]['predictiveIntervalAvgTalktime']+_0x25f605[0x0]['predictiveIntervalAvgHoldtime'];var _0x30ca1b=(_0x25f605[0x0][_0x5e20('0x6c')]+_0x25f605[0x0][_0x5e20('0x89')]+_0x25f605[0x0][_0x5e20('0x6e')])/_0x25f605[0x0][_0x5e20('0x74')];_0x145486[_0x5e20('0x71')]=_0x30ca1b>0x0?_0x30ca1b:0x1;switch(_0x145486[_0x5e20('0x1da')]){case'dropRate':var _0xaa3ce4=_0x145486[_0x5e20('0x1d2')]/0x64;return _0x5b0128[_0x5e20('0x1ea')](_0x13bc89,_0x1c81b3,_0x436cdc,_0x30ca1b,_0xaa3ce4)['then'](function(_0xc094f0){return _0x4a8454(_0xc094f0);});case _0x5e20('0x1eb'):var _0x8f8774=_0x145486['dialPredictiveOptimizationPercentage']/0x64;return _0x5b0128[_0x5e20('0x1ec')](_0x13bc89,_0x1c81b3,_0x436cdc,_0x30ca1b,_0x8f8774)['then'](function(_0x379c32){return _0x4a8454(_0x379c32);});default:return _0x50e8d4(msgResponse('[getDataPredictive]','Failure',_0x5e20('0x1ed')));}}else{return _0x50e8d4(msgResponse('[getDataPredictive]',_0x5e20('0x151'),'check\x20failure'));}});};};Dialer['prototype'][_0x5e20('0x1ee')]=function(_0x2032dd){var _0x5a495a=this;return function(_0x51b531){return new BPromise(function(_0x63cde9,_0x1ff64c){_[_0x5e20('0x97')](_0x2032dd,_0x51b531[0x0]);if(checkGetDataPredictive(_0x51b531[0x0])){loggerPredictive[_0x5e20('0x85')](JSON[_0x5e20('0x7e')](_0x51b531[0x0]));if(_0x2032dd[_0x5e20('0x1da')]===_0x5e20('0x1dc')){return _0x5a495a[_0x5e20('0xd0')](_0x2032dd['id'])[_0x5e20('0xc0')](function(_0x508346){var _0x3be2f0=_0x2032dd[_0x5e20('0x52')]-_0x508346[0x0][_0x5e20('0x1ef')];var _0x18fd16=_0x2032dd[_0x5e20('0x1e0')]*0x3c;var _0x36adef=_0x51b531[0x0][_0x5e20('0x8e')]+_0x51b531[0x0][_0x5e20('0x6d')];var _0x102809=(_0x51b531[0x0][_0x5e20('0x6c')]+_0x51b531[0x0][_0x5e20('0x89')]+_0x51b531[0x0][_0x5e20('0x6e')])/_0x51b531[0x0][_0x5e20('0x74')];var _0x4f2308=_0x2032dd['dialPredictiveOptimizationPercentage']/0x64;_0x2032dd['predictiveIntervalPauses']=_0x508346[0x0][_0x5e20('0x1ef')]||0x0;_0x2032dd[_0x5e20('0x71')]=_0x102809>0x0?_0x102809:0x1;return _0x5a495a[_0x5e20('0x1ea')](_0x3be2f0,_0x18fd16,_0x36adef,_0x102809,_0x4f2308);})[_0x5e20('0xc0')](function(_0x3d916a){return _0x63cde9(_0x3d916a);})[_0x5e20('0xb9')](function(_0x313b6d){return _0x1ff64c(msgResponse(_0x5e20('0x1f0'),_0x5e20('0x151'),JSON[_0x5e20('0x7e')](_0x313b6d)));});}if(_0x2032dd[_0x5e20('0x1da')]===_0x5e20('0x1eb')){return _0x5a495a[_0x5e20('0xd0')](_0x2032dd['id'])[_0x5e20('0xc0')](function(_0x7ab84f){var _0x47c89b=_0x2032dd['loggedIn']-_0x7ab84f[0x0][_0x5e20('0x1ef')];var _0x3bea11=_0x2032dd['dialPredictiveInterval']*0x3c;var _0x4cf8e0=_0x51b531[0x0][_0x5e20('0x8e')]+_0x51b531[0x0][_0x5e20('0x6d')];var _0xab1a4f=(_0x51b531[0x0][_0x5e20('0x6c')]+_0x51b531[0x0][_0x5e20('0x89')]+_0x51b531[0x0][_0x5e20('0x6e')])/_0x51b531[0x0]['predictiveIntervalTotalCalls'];var _0x5965b1=_0x2032dd['dialPredictiveOptimizationPercentage']/0x64;_0x2032dd[_0x5e20('0x73')]=_0x7ab84f[0x0][_0x5e20('0x1ef')]||0x0;_0x2032dd['predictiveIntervalHitRate']=_0xab1a4f>0x0?_0xab1a4f:0x1;return _0x5a495a[_0x5e20('0x1ec')](_0x47c89b,_0x3bea11,_0x4cf8e0,_0xab1a4f,_0x5965b1);})[_0x5e20('0xc0')](function(_0x339fe0){return _0x63cde9(_0x339fe0);})[_0x5e20('0xb9')](function(_0x214557){return _0x1ff64c(msgResponse('[CatchErlangB]',_0x5e20('0x151'),JSON['stringify'](_0x214557)));});}}else{return _0x1ff64c(msgResponse('[getDataPredictive]','Failure',_0x5e20('0x1f1')));}});};};Dialer[_0x5e20('0xb4')]['startMethodPredictive']=function(_0x239125){var _0x158956=this;return function(){var _0x3f9c4a=0x0;var _0x2ae851=Math[_0x5e20('0x1f2')](_0x239125['erlangCallToSecond']*0x3e8);if(_0x2ae851>0x0){_0x2ae851=_0x2ae851<0x64?0x64:_0x2ae851;loggerPredictive['info'](_0x239125['name'],_0x5e20('0x1f3'),_0x2ae851,_0x5e20('0x49'));_0x239125[_0x5e20('0x99')]=setInterval(function(){_0x158956[_0x5e20('0x99')](_0x239125);loggerPredictiveCalls['info'](_0x5e20('0x1f4'),_0x3f9c4a+=0x1);},_0x2ae851);}else{loggerPredictive['info'](_0x239125[_0x5e20('0x40')],_0x5e20('0x1f5'));}};};Dialer[_0x5e20('0xb4')][_0x5e20('0x1f6')]=function(_0x34e629,_0x10f44f){var _0x55b5df=this;return function(_0x280bec){if(_[_0x5e20('0x47')](_0x280bec)){if(_['isNil'](_0x10f44f[_0x5e20('0xde')])||!_0x10f44f[_0x5e20('0x1f7')]){if(_0x34e629[_0x5e20('0x5c')]===_0x5e20('0xb')){_0x34e629[_0x5e20('0x137')]=_[_0x5e20('0x3d')](_0x34e629['queueStatusComplete'])?!![]:_0x34e629[_0x5e20('0x137')];var _0x42b9ed=uuid['v4']();_0x55b5df['actions'][_0x42b9ed]=new Action(_0x34e629,_0x10f44f,_0x42b9ed);loggerBooked[_0x5e20('0x85')](_0x5e20('0x1f8'),_0x42b9ed,_0x5e20('0x1f9'),JSON[_0x5e20('0x7e')](_0x34e629[_0x5e20('0x137')]),_0x5e20('0x1fa'),_0x34e629[_0x5e20('0x40')]);if(_0x34e629[_0x5e20('0x137')]){_0x34e629['queueStatusComplete']=![];_0x55b5df[_0x5e20('0x28')][_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xbc')]]=[];ami[_0x5e20('0x15b')]({'actionid':_0x42b9ed,'action':'queuestatus','queue':_0x34e629['name']})[_0x5e20('0xb9')](function(){_0x55b5df[_0x5e20('0xbb')](_0x34e629);_0x55b5df[_0x5e20('0xc7')]({'active':![],'ContactId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed]['ContactId'],'ListId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xdd')],'VoiceQueueId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xdf')]||undefined,'CampaignId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x1fb')));delete _0x55b5df['actions'][_0x42b9ed];});}else{loggerBooked[_0x5e20('0x85')](_0x5e20('0x1fc'),JSON['stringify'](_0x34e629[_0x5e20('0x137')]),'Queue:\x20',_0x34e629[_0x5e20('0x40')]);_0x55b5df[_0x5e20('0xbb')](_0x34e629);_0x55b5df[_0x5e20('0xc7')]({'active':![],'ContactId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xdc')],'ListId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xdd')],'VoiceQueueId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xdf')]||undefined,'CampaignId':_0x55b5df[_0x5e20('0x26')][_0x42b9ed][_0x5e20('0xe0')]||undefined})['catch'](loggerCatch(_0x5e20('0x1fb')));delete _0x55b5df[_0x5e20('0x26')][_0x42b9ed];}}else{return _0x55b5df[_0x5e20('0x175')](_0x34e629,_0x10f44f);}}else{if(getDiff(_0x10f44f[_0x5e20('0x1fd')])<_0x34e629[_0x5e20('0x1fe')]*0x3c){if(_0x10f44f[_0x5e20('0x1ff')]&&!_0x10f44f[_0x5e20('0x1ff')][_0x5e20('0x200')]){_0x55b5df[_0x5e20('0x1f')][_0x5e20('0x13b')](_0x10f44f['id'])['finally'](function(){_0x55b5df['updateOriginated'](_0x34e629);});}else{_0x55b5df[_0x5e20('0xc9')]({'active':![]},_0x10f44f['id'],0x1)[_0x5e20('0x13c')](function(){_0x55b5df[_0x5e20('0xbb')](_0x34e629);});}}else{_0x34e629[_0x5e20('0x6a')]+=0x1;_0x55b5df[_0x5e20('0xbb')](_0x34e629);if(_0x34e629[_0x5e20('0x201')]){_0x55b5df[_0x5e20('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x10f44f[_0x5e20('0xdc')],'ListId':_0x10f44f['ListId'],'VoiceQueueId':_0x10f44f[_0x5e20('0xdf')]||undefined,'CampaignId':_0x10f44f[_0x5e20('0xe0')]||undefined})[_0x5e20('0xb9')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x55b5df['createHistory'](createObjHistory(_0x34e629,_0x10f44f,_0x5e20('0x202'),0x17,_0x5e20('0x203')))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0x204')));}else{_0x55b5df[_0x5e20('0xdb')](createObjHistory(_0x34e629,_0x10f44f,'RECALLFAILEDTIMEOUT',0x16,_0x5e20('0x205')),'[Originate][HistoryRecallClose][historyCatch]',_0x5e20('0x206'));}}}}else{_0x34e629[_0x5e20('0x62')]+=0x1;_0x55b5df[_0x5e20('0xdb')](createObjHistory(_0x34e629,_0x10f44f,_0x5e20('0x207'),0xd,_0x5e20('0x208')),_0x5e20('0x209'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x5e20('0xb4')][_0x5e20('0x16d')]=function(_0x551ae9){var _0x3a9389=this;var _0x33176b=_0x551ae9['limitCalls']-_0x551ae9[_0x5e20('0xa2')]-_0x551ae9[_0x5e20('0xcc')];emitCampaignSummary(_0x551ae9);if(_0x33176b>0x0){if(_0x33176b>this[_0x5e20('0x24')]){_0x33176b=this[_0x5e20('0x24')];}_0x551ae9[_0x5e20('0xcc')]+=_0x33176b;this[_0x5e20('0xce')](_0x551ae9['id'],_0x33176b,_0x551ae9['dialOrderByScheduledAt'],_0x551ae9)['then'](function(_0x2ceabc){_0x551ae9[_0x5e20('0xcc')]-=_0x33176b;_0x551ae9[_0x5e20('0xcc')]=_0x551ae9[_0x5e20('0xcc')]>0x0?_0x551ae9[_0x5e20('0xcc')]:0x0;if(!checkContactEmpty(_0x2ceabc)){_0x551ae9[_0x5e20('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5e20('0x85')](_0x5e20('0x20a')+_0x551ae9['name']);}else{_0x551ae9[_0x5e20('0xa2')]+=_0x2ceabc[_0x5e20('0xa1')];_0x551ae9[_0x5e20('0x3e')]=_0x5e20('0x20b');for(var _0x369bba=0x0;_0x369bba<_0x2ceabc[_0x5e20('0xa1')];_0x369bba+=0x1){_0x551ae9[_0x5e20('0x20c')]+=0x1;if(_['isNil'](_0x2ceabc[_0x369bba])||_[_0x5e20('0xeb')](_0x2ceabc[_0x369bba][_0x5e20('0x179')])||_[_0x5e20('0xeb')](_0x2ceabc[_0x369bba][_0x5e20('0x179')][_0x5e20('0x17a')])){_0x3a9389[_0x5e20('0xd9')](_0x5e20('0x20d'),_0x551ae9,_0x2ceabc[_0x369bba]);}else{_0x3a9389[_0x5e20('0xc3')](_[_0x5e20('0x13a')](_0x2ceabc[_0x369bba],[_0x5e20('0xe0'),'Contact.phone']))[_0x5e20('0xc0')](_0x3a9389[_0x5e20('0x1f6')](_0x551ae9,_0x2ceabc[_0x369bba]))[_0x5e20('0xb9')](_0x3a9389[_0x5e20('0xd8')](_0x5e20('0x20e'),_0x551ae9));}}}})[_0x5e20('0xb9')](loggerGetContactDialer(_0x5e20('0x20f'),_0x551ae9,_0x33176b));}};Dialer[_0x5e20('0xb4')][_0x5e20('0x166')]=function(_0x8ececd,_0x119414){var _0x508a67=this;var _0x444e17=[];var _0x371486=_0x119414>=0x1?_0x119414:0x1;if(_0x8ececd[_0x5e20('0x5c')]===_0x5e20('0xb')){_0x371486=0x1;}var _0x1b6bc5=Math['floor'](_0x8ececd[_0x5e20('0x51')]*_0x371486)-_0x8ececd['originated']-_0x8ececd[_0x5e20('0xcc')];emitVoiceQueueSummary(_0x8ececd);if(_0x8ececd[_0x5e20('0x210')]>0x0){var _0x1acb5b=_0x8ececd[_0x5e20('0x210')]-_0x8ececd[_0x5e20('0xa2')]-_0x8ececd[_0x5e20('0x56')]-_0x8ececd[_0x5e20('0xcc')]-_0x8ececd['pTalking'];if(_0x1b6bc5>_0x1acb5b){_0x1b6bc5=_0x1acb5b;}}if(_0x1b6bc5>0x0){if(_0x8ececd[_0x5e20('0x5c')]==='booked'){_0x1b6bc5=0x1;}if(_0x1b6bc5>this[_0x5e20('0x24')]){_0x1b6bc5=this['maxNumberOriginate'];}_0x8ececd[_0x5e20('0xcc')]+=_0x1b6bc5;for(var _0x1dbf93 in this['agents']){if(typeof this[_0x5e20('0x22')][_0x1dbf93]!==_0x5e20('0xa3')){if(this[_0x5e20('0x22')][_0x1dbf93][_0x5e20('0xb0')]===_0x5e20('0x211')&&this['agents'][_0x1dbf93][_0x5e20('0xb7')]==='reachable'){_0x444e17[_0x5e20('0x135')](this[_0x5e20('0x22')][_0x1dbf93]['id']);}}}this[_0x5e20('0xcb')](_0x8ececd['id'],_0x444e17,_0x1b6bc5,_0x8ececd[_0x5e20('0x212')],_0x8ececd)[_0x5e20('0xc0')](function(_0x25d5a0){_0x8ececd[_0x5e20('0xcc')]-=_0x1b6bc5;_0x8ececd[_0x5e20('0xcc')]=_0x8ececd['temp']>0x0?_0x8ececd[_0x5e20('0xcc')]:0x0;if(!checkContactEmpty(_0x25d5a0)){_0x508a67['countReScheduled'](_0x8ececd)[_0x5e20('0xc0')](sendMessageReschedule(_0x8ececd))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xc1')));}else{_0x8ececd['originated']+=_0x25d5a0[_0x5e20('0xa1')];_0x8ececd['message']=_0x8ececd[_0x5e20('0x5c')]===_0x5e20('0xb')?_0x5e20('0x180'):_0x5e20('0x20b');for(var _0x320eb0=0x0;_0x320eb0<_0x25d5a0['length'];_0x320eb0+=0x1){if(_[_0x5e20('0xeb')](_0x25d5a0[_0x320eb0])||_[_0x5e20('0xeb')](_0x25d5a0[_0x320eb0][_0x5e20('0x179')])||_[_0x5e20('0xeb')](_0x25d5a0[_0x320eb0][_0x5e20('0x179')][_0x5e20('0x17a')])){_0x508a67['emptyContact'](_0x5e20('0x20d'),_0x8ececd,_0x25d5a0[_0x320eb0]);}else{_0x508a67[_0x5e20('0x213')](_[_0x5e20('0x13a')](_0x25d5a0[_0x320eb0],['VoiceQueueId','Contact.phone']))['then'](_0x508a67[_0x5e20('0x1f6')](_0x8ececd,_0x25d5a0[_0x320eb0]))['catch'](_0x508a67['loggerHandler'](_0x5e20('0x20d'),_0x8ececd));}}}})[_0x5e20('0xb9')](loggerGetContactDialer(_0x5e20('0x214'),_0x8ececd,_0x1b6bc5));}};Dialer[_0x5e20('0xb4')][_0x5e20('0x99')]=function(_0x408540){if(_0x408540[_0x5e20('0x210')]>0x0){var _0x1afd72=_0x408540[_0x5e20('0x210')]-_0x408540['originated']-_0x408540[_0x5e20('0x56')];if(_0x1afd72>0x0){this[_0x5e20('0x215')](_0x408540);}else{loggerPredictiveCalls[_0x5e20('0x85')](_0x5e20('0x216'));}}else{this['tryOriginatePredictive'](_0x408540);}};Dialer[_0x5e20('0xb4')][_0x5e20('0x215')]=function(_0x1d0242){var _0x148799=this;var _0x593b54=[];_0x1d0242['originated']+=0x1;for(var _0x48b3cb in this[_0x5e20('0x22')]){if(typeof this[_0x5e20('0x22')][_0x48b3cb]!=='undefined'){if(this[_0x5e20('0x22')][_0x48b3cb][_0x5e20('0xb0')]==='not_inuse'&&this[_0x5e20('0x22')][_0x48b3cb][_0x5e20('0xb7')]===_0x5e20('0xe7')){_0x593b54[_0x5e20('0x135')](this[_0x5e20('0x22')][_0x48b3cb]['id']);}}}this[_0x5e20('0xcb')](_0x1d0242['id'],_0x593b54,0x1,_0x1d0242['dialOrderByScheduledAt'],_0x1d0242)[_0x5e20('0xc0')](function(_0x1b1682){if(!checkContactEmpty(_0x1b1682)){checkContactLowerLimitOriginate(_0x1d0242,0x1,0x0);_0x148799['countReScheduled'](_0x1d0242)[_0x5e20('0xc0')](sendMessageReschedule(_0x1d0242))[_0x5e20('0xb9')](loggerCatch(_0x5e20('0xc1')));}else{_0x1d0242[_0x5e20('0x3e')]=_0x5e20('0x20b');if(_[_0x5e20('0xeb')](_0x1b1682[0x0])||_['isNil'](_0x1b1682[0x0]['Contact'])||_[_0x5e20('0xeb')](_0x1b1682[0x0][_0x5e20('0x179')][_0x5e20('0x17a')])){_0x148799['emptyContact'](_0x5e20('0x20d'),_0x1d0242,_0x1b1682[0x0]);}else{_0x148799[_0x5e20('0x213')](_[_0x5e20('0x13a')](_0x1b1682[0x0],[_0x5e20('0xdf'),'Contact.phone']))[_0x5e20('0xc0')](_0x148799[_0x5e20('0x1f6')](_0x1d0242,_0x1b1682[0x0]))[_0x5e20('0xb9')](_0x148799['loggerHandler'](_0x5e20('0x217'),_0x1d0242));}}})[_0x5e20('0xb9')](loggerGetContactDialer(_0x5e20('0x218'),_0x1d0242,0x1));emitVoiceQueueSummary(_0x1d0242);};Dialer[_0x5e20('0xb4')][_0x5e20('0x1ea')]=function(_0x5193a5,_0x3beb52,_0x587ca5,_0x5129a2,_0x426956,_0x20a52b){loggerPredictive[_0x5e20('0x85')](_0x5e20('0x219'));loggerPredictive[_0x5e20('0x85')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5193a5);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x21a'),_0x3beb52);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x21b'),_0x587ca5);loggerPredictive['info'](_0x5e20('0x21c'),_0x5129a2);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x21d'),_0x426956);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x8d'));return new BPromise(function(_0x51691a,_0x14edd6){if(_0x5193a5<=0x0||isNaN(_0x5193a5)){return _0x14edd6(msgResponse(_0x5e20('0x21e'),_0x5e20('0x1a1'),'m\x20=\x20'+_0x5193a5));}if(_0x587ca5<=0x0||isNaN(_0x587ca5)){return _0x14edd6(msgResponse(_0x5e20('0x21e'),_0x5e20('0x1a1'),_0x5e20('0x21f')+_0x587ca5));}if(_0x5129a2<=0x0||isNaN(_0x5129a2)){return _0x14edd6(msgResponse(_0x5e20('0x21e'),_0x5e20('0x1a1'),_0x5e20('0x220')+_0x5129a2));}if(_0x3beb52<=0x0||isNaN(_0x3beb52)){return _0x14edd6(msgResponse(_0x5e20('0x21e'),_0x5e20('0x1a1'),_0x5e20('0x221')+_0x3beb52));}if(_0x426956<=0x0||isNaN(_0x426956)){return _0x14edd6(msgResponse(_0x5e20('0x21e'),_0x5e20('0x1a1'),_0x5e20('0x222')+_0x426956));}_0x20a52b=_0x20a52b||0x0;var _0x32bf76=0x1/_0x587ca5;var _0x24587b=0x0;var _0x4f314e=0x0;var _0x376ea8=0x0;var _0x29e620=0x0;for(var _0x3cce08=0x0;_0x376ea8<_0x426956;_0x3cce08+=0x1){_0x4f314e=_0x3cce08/_0x3beb52;_0x24587b=(_0x5129a2*_0x4f314e+_0x20a52b)/_0x32bf76;_0x376ea8=erlangb(_0x24587b,_0x5193a5);_0x29e620=_0x24587b/_0x5193a5*(0x1-erlangb(_0x24587b,_0x5193a5));}return _0x51691a({'erlangCalls':_0x3cce08,'erlangCallToSecond':_0x3beb52/_0x3cce08,'erlangAbandonmentRate':_0x376ea8,'erlangBusyFactor':_0x29e620});});};Dialer[_0x5e20('0xb4')][_0x5e20('0x1ec')]=function(_0x58533a,_0x339ee4,_0x19b62b,_0x353fcc,_0x223cc4,_0x4d5637){loggerPredictive[_0x5e20('0x85')](_0x5e20('0x223'));loggerPredictive[_0x5e20('0x85')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58533a);loggerPredictive['info'](_0x5e20('0x21a'),_0x339ee4);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x19b62b);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x21c'),_0x353fcc);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x224'),_0x223cc4);loggerPredictive[_0x5e20('0x85')](_0x5e20('0x8d'));return new BPromise(function(_0x92293d,_0x2474fd){if(_0x58533a<=0x0||isNaN(_0x58533a)){return _0x2474fd(msgResponse(_0x5e20('0x225'),_0x5e20('0x1a1'),'m\x20=\x20'+_0x58533a));}if(_0x19b62b<=0x0||isNaN(_0x19b62b)){return _0x2474fd(msgResponse(_0x5e20('0x225'),_0x5e20('0x1a1'),_0x5e20('0x21f')+_0x19b62b));}if(_0x353fcc<=0x0||isNaN(_0x353fcc)){return _0x2474fd(msgResponse(_0x5e20('0x225'),_0x5e20('0x1a1'),_0x5e20('0x220')+_0x353fcc));}if(_0x339ee4<=0x0||isNaN(_0x339ee4)){return _0x2474fd(msgResponse(_0x5e20('0x225'),_0x5e20('0x1a1'),_0x5e20('0x221')+_0x339ee4));}if(_0x223cc4<=0x0||isNaN(_0x223cc4)){return _0x2474fd(msgResponse(_0x5e20('0x225'),_0x5e20('0x1a1'),_0x5e20('0x226')+_0x223cc4));}_0x4d5637=_0x4d5637||0x0;var _0x11dd15=0x1/_0x19b62b;var _0x5c2c5e=0x0;var _0x331148=0x0;var _0x11ff08=0x0;var _0x40a08a=0x0;for(var _0x5549ea=0x0;_0x40a08a<_0x223cc4;_0x5549ea+=0x1){_0x331148=_0x5549ea/_0x339ee4;_0x5c2c5e=(_0x353fcc*_0x331148+_0x4d5637)/_0x11dd15;_0x11ff08=erlangb(_0x5c2c5e,_0x58533a);_0x40a08a=_0x5c2c5e/_0x58533a*(0x1-erlangb(_0x5c2c5e,_0x58533a));}return _0x92293d({'erlangCalls':_0x5549ea,'erlangCallToSecond':_0x339ee4/_0x5549ea,'erlangAbandonmentRate':_0x11ff08,'erlangBusyFactor':_0x40a08a});});};module[_0x5e20('0x227')]=Dialer;
\ No newline at end of file
+var _0xc73e=['bind','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','emit','outbound','answered','loggedIn','pTalking','talking','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','md5','voice:queue:%s','voice_queue:save','ivr','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','format','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','undefined','Action','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','SIP/%s','status','reachable','unmonitored','uniqueid','isNil','exten','xcally-motion-dialer','dialAMDActive','HangupInAMD','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','countglobal','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','add','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','membername','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','droptime','dropreason','TIMEOUT','queueCallerAbandonCreateState','dialDropRetryFrequency','ListId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','locked','paused','stateinterface','rrmemory','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','progressive','power','handlePower','Queue','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','getCaller','ACTIVE','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','responsetime','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','Contact.phone','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0xc73e,0x1e9));var _0xec73=function(_0x5a938f,_0x3d5645){_0x5a938f=_0x5a938f-0x0;var _0x1a0b45=_0xc73e[_0x5a938f];return _0x1a0b45;};'use strict';var util=require(_0xec73('0x0'));var _=require(_0xec73('0x1'));var BPromise=require('bluebird');var uuid=require(_0xec73('0x2'));var moment=require(_0xec73('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require(_0xec73('0x4'));var logger=require(_0xec73('0x5'))('dialer');var loggerBooked=require(_0xec73('0x5'))(_0xec73('0x6'));var loggerPredictive=require(_0xec73('0x5'))(_0xec73('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0xec73('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xec73('0x9'));var ami=require(_0xec73('0xa'));config[_0xec73('0xb')]=_[_0xec73('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xec73('0xd'))(new Redis(config[_0xec73('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xec73('0xe'));var voiceQueueRt=require(_0xec73('0xf'));var Action=require(_0xec73('0x10'));var History=require(_0xec73('0x11'));var Final=require(_0xec73('0x12'));var AgentComplete=require(_0xec73('0x13'));var QueueCallerAbandon=require(_0xec73('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0xec73('0x15')]['XCALLY_IP_AGI']||_0xec73('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':_0xec73('0x17')};var Sequence=function(){};Sequence[_0xec73('0x18')][_0xec73('0x19')]=function(_0x3bff0d){this[_0xec73('0x1a')]=this[_0xec73('0x1a')]?this[_0xec73('0x1a')][_0xec73('0x1b')](_0x3bff0d):_0x3bff0d();};function Dialer(_0x5de659,_0x308eb4){this[_0xec73('0x1c')]=new Sequence();this[_0xec73('0x1d')]=_0x308eb4;this[_0xec73('0x1e')]=_0x5de659[_0xec73('0x1e')];this[_0xec73('0x1f')]=_0x5de659['campaigns'];this[_0xec73('0x20')]=_0x5de659[_0xec73('0x20')];this[_0xec73('0x21')]=_0x5de659['trunks'];this[_0xec73('0x22')]=config[_0xec73('0x22')]||0x2;this[_0xec73('0x23')]={};this[_0xec73('0x24')]={};this[_0xec73('0x25')]={};this[_0xec73('0x26')]={};this['optionPredictive']={};this['startPredictive']={};this[_0xec73('0x27')]={};this[_0xec73('0x28')]={};this[_0xec73('0x29')]={};this[_0xec73('0x2a')]={};ami['on'](_0xec73('0x2b'),this['syncAgentConnect'][_0xec73('0x2c')](this));ami['on']('queuecallerabandon',this[_0xec73('0x2d')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xec73('0x2c')](this));ami['on'](_0xec73('0x2e'),this[_0xec73('0x2f')][_0xec73('0x2c')](this));ami['on'](_0xec73('0x30'),this['syncQueueSummary']['bind'](this));ami['on'](_0xec73('0x31'),this[_0xec73('0x32')]['bind'](this));ami['on'](_0xec73('0x33'),this[_0xec73('0x34')][_0xec73('0x2c')](this));ami['on'](_0xec73('0x35'),this[_0xec73('0x36')][_0xec73('0x2c')](this));ami['on'](_0xec73('0x37'),this[_0xec73('0x38')]['bind'](this));ami['on']('queuestatuscomplete',this[_0xec73('0x39')][_0xec73('0x2c')](this));this[_0xec73('0x3a')]();this[_0xec73('0x3b')]();}function isNotNull(_0x539f89){return _0x539f89!==null&&!_[_0xec73('0x3c')](_0x539f89);}function checkIsLoggedIn(_0x269ca5,_0x24268b){return function(){if(_0x24268b<=0x0){_0x269ca5[_0xec73('0x3d')]=_0xec73('0x3e');throw _0x269ca5[_0xec73('0x3f')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3c4183){return _0x3c4183;}function checkIsActive(_0x224549,_0x2061af){return function(){if(!isActive(_0x2061af)){_0x224549[_0xec73('0x3d')]=_0xec73('0x40');throw _0x224549[_0xec73('0x3f')]+'\x20NOT\x20Active';}};}function checkInterval(_0x335f1c){return function(){if(!isNotNull(_0x335f1c[_0xec73('0x41')])){_0x335f1c[_0xec73('0x3d')]=_0xec73('0x42');throw _0x335f1c[_0xec73('0x3f')]+_0xec73('0x43');}if(!isNotNull(_0x335f1c[_0xec73('0x41')]['Intervals'])){_0x335f1c[_0xec73('0x3d')]='INTERVAL_IS_NULL';throw _0x335f1c[_0xec73('0x3f')]+_0xec73('0x43');}if(!isNotNull(_[_0xec73('0x44')](_0x335f1c[_0xec73('0x41')][_0xec73('0x45')]))){_0x335f1c[_0xec73('0x3d')]=_0xec73('0x42');throw _0x335f1c[_0xec73('0x3f')]+_0xec73('0x43');}};}function msgResponse(_0x5f5bd4,_0x527787,_0x4573ec){return{'action':_0x5f5bd4,'response':_0x527787,'message':_0x4573ec,'stack':_0x4573ec};}function myreject(_0x22104a){return function(_0x8a971){return _0x22104a(msgResponse(_0xec73('0x46'),_0xec73('0x47'),JSON[_0xec73('0x48')](_0x8a971)));};}function getSeconds(_0x2ba3db,_0x159c61){var _0x51430b=moment(_0x2ba3db)[_0xec73('0x49')](0x0);var _0x29935d=moment(_0x159c61)[_0xec73('0x49')](0x0);return _0x51430b['diff'](_0x29935d,'seconds');}function emit(_0x5c2ed4,_0x174f05,_0x49843f){io['to'](_0x5c2ed4)[_0xec73('0x4a')](_0x174f05,_0x49843f);}function emitVoiceQueueSummary(_0x5c7776){if(_0x5c7776['type']===_0xec73('0x4b')){var _0x59cceb={'id':_0x5c7776['id'],'name':_0x5c7776[_0xec73('0x3f')],'strategy':_0x5c7776['strategy'],'answered':_0x5c7776[_0xec73('0x4c')],'available':_0x5c7776['available'],'loggedIn':_0x5c7776[_0xec73('0x4d')],'pTalking':_0x5c7776[_0xec73('0x4e')],'sumBillable':_0x5c7776['sumBillable'],'sumDuration':_0x5c7776['sumDuration'],'sumHoldTime':_0x5c7776['sumHoldTime']||0x0,'talking':_0x5c7776[_0xec73('0x4f')],'total':_0x5c7776['total'],'type':_0x5c7776[_0xec73('0x50')],'unmanaged':_0x5c7776[_0xec73('0x51')],'abandoned':_0x5c7776[_0xec73('0x52')],'waiting':_0x5c7776['waiting'],'loggedInDb':_0x5c7776[_0xec73('0x53')],'dialActive':_0x5c7776[_0xec73('0x54')],'dialMethod':_0x5c7776[_0xec73('0x55')],'dialOriginateCallerIdName':_0x5c7776[_0xec73('0x56')],'dialOriginateCallerIdNumber':_0x5c7776[_0xec73('0x57')],'dialOriginateTimeout':_0x5c7776['dialOriginateTimeout'],'dialPrefix':_0x5c7776['dialPrefix'],'outboundAnswerAgiCallsDay':_0x5c7776[_0xec73('0x58')],'outboundAnswerCallsDay':_0x5c7776[_0xec73('0x59')],'outboundBlacklistCallsDay':_0x5c7776[_0xec73('0x5a')],'outboundBusyCallsDay':_0x5c7776[_0xec73('0x5b')],'outboundCongestionCallsDay':_0x5c7776[_0xec73('0x5c')],'outboundDropCallsDayACS':_0x5c7776[_0xec73('0x5d')],'outboundDropCallsDayCallersExit':_0x5c7776[_0xec73('0x5e')],'outboundDropCallsDayTimeout':_0x5c7776[_0xec73('0x5f')],'outboundNoAnswerCallsDay':_0x5c7776[_0xec73('0x60')],'outboundNoSuchCallsDay':_0x5c7776[_0xec73('0x61')],'outboundOriginateFailureCallsDay':_0x5c7776[_0xec73('0x62')],'outboundReCallsDay':_0x5c7776[_0xec73('0x63')],'outboundRejectCallsDay':_0x5c7776[_0xec73('0x64')],'outboundUnknownCallsDay':_0x5c7776[_0xec73('0x65')],'predictiveIntervalAnsweredCalls':_0x5c7776['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5c7776['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5c7776[_0xec73('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x5c7776[_0xec73('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x5c7776[_0xec73('0x68')],'predictiveIntervalErlangCalls':_0x5c7776[_0xec73('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x5c7776[_0xec73('0x6a')],'predictiveIntervalHitRate':_0x5c7776[_0xec73('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x5c7776[_0xec73('0x6c')],'predictiveIntervalPauses':_0x5c7776[_0xec73('0x6d')],'predictiveIntervalAvailable':_0x5c7776[_0xec73('0x6e')],'predictiveIntervalTotalCalls':_0x5c7776['predictiveIntervalTotalCalls'],'message':_0x5c7776['message'],'originated':_0x5c7776[_0xec73('0x6f')],'erlangCalls':_0x5c7776['erlangCalls'],'erlangCallToSecond':_0x5c7776[_0xec73('0x70')],'erlangAbandonmentRate':_0x5c7776['erlangAbandonmentRate'],'erlangBusyFactor':_0x5c7776[_0xec73('0x71')],'startPredictive':_0x5c7776[_0xec73('0x72')],'startProgressive':_0x5c7776[_0xec73('0x27')]};if(_0x5c7776[_0xec73('0x73')]){_0x59cceb[_0xec73('0x73')]={'id':_0x5c7776['Trunk']['id'],'name':_0x5c7776[_0xec73('0x73')][_0xec73('0x3f')],'active':_0x5c7776['Trunk'][_0xec73('0x74')],'callerid':_0x5c7776[_0xec73('0x73')][_0xec73('0x75')]};}if(_0x5c7776[_0xec73('0x41')]){_0x59cceb[_0xec73('0x41')]={'id':_0x5c7776['Interval']['id'],'name':_0x5c7776['Interval'][_0xec73('0x3f')]};}var _0x2a7bec=md5(JSON[_0xec73('0x48')](_0x59cceb));if(_0x5c7776['md5']!==_0x2a7bec){_0x5c7776[_0xec73('0x76')]=_0x2a7bec;emit(util['format'](_0xec73('0x77'),_0x59cceb[_0xec73('0x3f')]),_0xec73('0x78'),_0x59cceb);}}}function emitCampaignSummary(_0x302833){if(_0x302833[_0xec73('0x50')]===_0xec73('0x79')){emit(util['format']('campaign:ivr:%s',_0x302833[_0xec73('0x3f')]),'campaign:save',_0x302833);}}function checkGetDataPredictive(_0x3d7d1a){if(isNotNull(_0x3d7d1a)&&!_[_0xec73('0x44')](_0x3d7d1a)){loggerPredictive[_0xec73('0x7a')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xec73('0x7a')](_0xec73('0x7b'),_0x3d7d1a[_0xec73('0x7c')]);loggerPredictive[_0xec73('0x7a')](_0xec73('0x7d'),_0x3d7d1a[_0xec73('0x7e')]);loggerPredictive[_0xec73('0x7a')](_0xec73('0x7f'),_0x3d7d1a[_0xec73('0x68')]);loggerPredictive[_0xec73('0x7a')](_0xec73('0x80'),_0x3d7d1a[_0xec73('0x67')]);loggerPredictive[_0xec73('0x7a')](_0xec73('0x81'),_0x3d7d1a['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xec73('0x7a')](_0xec73('0x82'),_0x3d7d1a[_0xec73('0x66')]);loggerPredictive[_0xec73('0x7a')](_0xec73('0x83'));if(_0x3d7d1a[_0xec73('0x7c')]>0x0){if(!_['isUndefined'](_0x3d7d1a[_0xec73('0x66')])&&_0x3d7d1a[_0xec73('0x66')]>0x0){return!![];}loggerPredictive[_0xec73('0x7a')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xec73('0x3c')](_0x3d7d1a[_0xec73('0x84')])&&_0x3d7d1a[_0xec73('0x84')]>0x0){return!![];}loggerPredictive[_0xec73('0x7a')](_0xec73('0x85'));}else{loggerPredictive[_0xec73('0x7a')](_0xec73('0x86'));}}else{loggerPredictive[_0xec73('0x7a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xfd87ed){return function(_0x1ecf78){loggerPredictive[_0xec73('0x7a')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xec73('0x7a')](_0xec73('0x87'),_0x1ecf78[_0xec73('0x88')]);loggerPredictive[_0xec73('0x7a')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ecf78[_0xec73('0x70')]);loggerPredictive[_0xec73('0x7a')](_0xec73('0x89'),_0x1ecf78[_0xec73('0x8a')]);loggerPredictive['info'](_0xec73('0x8b'),_0x1ecf78[_0xec73('0x71')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ecf78[_0xec73('0x8a')]);loggerPredictive[_0xec73('0x7a')](_0xec73('0x83'));_['merge'](_0xfd87ed,_0x1ecf78);};}function getDiff(_0x196895){var _0x114773=moment()[_0xec73('0x49')](0x0);var _0x3c0a0f=moment(_0x196895)[_0xec73('0x49')](0x0);return _0x114773['diff'](_0x3c0a0f,_0xec73('0x8c'));}function ifInterval(_0x19f306,_0x5ab834){if(_[_0xec73('0x3c')](_0x5ab834)){return![];}return getDiff(_0x5ab834)<_0x19f306*0x3c;}function freeVariablesPredictive(_0x1b9a8a){if(isNotNull(_0x1b9a8a)){if(!_[_0xec73('0x3c')](_0x1b9a8a[_0xec73('0x27')])){_0x1b9a8a[_0xec73('0x27')]=undefined;loggerPredictive[_0xec73('0x7a')](_0x1b9a8a[_0xec73('0x3f')],_0xec73('0x8d'));}if(!_[_0xec73('0x3c')](_0x1b9a8a[_0xec73('0x72')])){_0x1b9a8a['startPredictive']=undefined;loggerPredictive[_0xec73('0x7a')](_0x1b9a8a['name'],_0xec73('0x8e'));}if(!_['isUndefined'](_0x1b9a8a[_0xec73('0x8f')])){clearInterval(_0x1b9a8a[_0xec73('0x8f')]);_0x1b9a8a[_0xec73('0x8f')]=undefined;loggerPredictive['info'](_0x1b9a8a['name'],_0xec73('0x90'));}}}function erlangb(_0x10fcd5,_0x2c6541){if(_0x2c6541===0x0){return 0x0;}var _0x4e989f=0x1;for(var _0x4ad969=0x1;_0x4ad969<=_0x2c6541;_0x4ad969+=0x1){_0x4e989f=0x1+_0x4e989f*_0x4ad969/_0x10fcd5;}return 0x1/_0x4e989f;}function isVoiceQueueOutbound(_0x2263df){return _0x2263df==='outbound';}function isNotPreview(_0x5a1c62){return _0x5a1c62!==_0xec73('0x1d');}function isCampaignIvr(_0x5d1702){return _0x5d1702===_0xec73('0x79');}function getCallerId(_0x3e5beb,_0x3744ba,_0x10c6f1){if(!_[_0xec73('0x3c')](_0x10c6f1)&&typeof _0x10c6f1===_0xec73('0x91')&&!_['isEmpty'](_0x10c6f1)){if(!_[_0xec73('0x3c')](_0x3744ba)&&typeof _0x3744ba===_0xec73('0x91')&&!_[_0xec73('0x44')](_0x3744ba)){return util[_0xec73('0x92')]('\x22%s\x22\x20<%s>',_0x3744ba,_0x10c6f1);}return util['format']('\x22%s\x22\x20<%s>',_0x10c6f1,_0x10c6f1);}if(!_[_0xec73('0x3c')](_0x3e5beb)&&typeof _0x3e5beb===_0xec73('0x91')&&!_[_0xec73('0x44')](_0x3e5beb)){return _0x3e5beb;}return _0xec73('0x93');}function loggerCatchQueueSummary(_0x3a7b00,_0xd48c41){return function(_0xa137ce){freeVariablesPredictive(_0xd48c41);emitVoiceQueueSummary(_0xd48c41);emitCampaignSummary(_0xd48c41);loggerSyncQueueSummary[_0xec73('0x94')](_0x3a7b00,util[_0xec73('0x95')](_0xa137ce,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x34fc64,_0x1f96c5){return function(_0x3c512b){loggerPredictive['error'](_0x1f96c5[_0xec73('0x3f')],_0x34fc64);loggerPredictive[_0xec73('0x94')](_0x3c512b[_0xec73('0x96')]);freeVariablesPredictive(_0x1f96c5);};}function loggerCatch(_0x314a8a){return function(_0x31a449){logger['error'](_0x314a8a,util[_0xec73('0x95')](_0x31a449,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x111695){return _0x111695&&!_[_0xec73('0x3c')](_0x111695)&&_0x111695[_0xec73('0x97')]>0x0;}function decremetOriginate(_0x1afcfc){if(!_[_0xec73('0x3c')](_0x1afcfc)&&_0x1afcfc!==null){if(typeof _0x1afcfc['originated']!=='undefined'){if(_0x1afcfc['originated']>0x0){_0x1afcfc[_0xec73('0x6f')]-=0x1;}else{logger[_0xec73('0x94')](_0xec73('0x98'));}}}else{logger[_0xec73('0x94')](_0xec73('0x99'));}}function checkContactLowerLimitOriginate(_0x1e22cb,_0x110c3f,_0x14cf64){if(_0x110c3f>_0x14cf64){for(var _0x53cb1c=0x0;_0x53cb1c<_0x110c3f-_0x14cf64;_0x53cb1c+=0x1){decremetOriginate(_0x1e22cb);}}}function loggerGetContactDialer(_0x499883,_0x38e0be,_0x5e336c){return function(_0x529e96){checkContactLowerLimitOriginate(_0x38e0be,_0x5e336c,0x0);logger[_0xec73('0x94')](_0x499883,util[_0xec73('0x95')](_0x529e96,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5a96b6){return function(_0x16e849){if(isNotNull(_0x16e849)&&isNotNull(_0x16e849[0x0])){if(_0x16e849[0x0][_0xec73('0x9a')]>0x0){_0x5a96b6['message']='RESCHEDULED_CONTACTS';logger['info'](_0xec73('0x9b')+_0x5a96b6[_0xec73('0x3f')],_0x16e849[0x0][_0xec73('0x9a')],'contacts');}else{_0x5a96b6[_0xec73('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xec73('0x7a')](_0xec73('0x9c')+_0x5a96b6[_0xec73('0x3f')]);}}};}function notSendMessagesQueue(_0x343ec1){if(_0x343ec1[_0xec73('0x9d')]){freeVariablesPredictive(_0x343ec1);if(_0x343ec1[_0xec73('0x6f')]===0x0&&_0x343ec1[_0xec73('0x4f')]===0x0&&_0x343ec1[_0xec73('0x9e')]===0x0&&(_0x343ec1[_0xec73('0x4e')]||0x0)===0x0){_0x343ec1[_0xec73('0x9d')]=![];_0x343ec1[_0xec73('0x9f')]=0x0;_0x343ec1[_0xec73('0x3d')]=_0xec73('0x40');loggerSyncQueueSummary[_0xec73('0x94')](_0xec73('0xa0'),_0x343ec1[_0xec73('0x3f')],'is\x20not\x20active');}else{_0x343ec1[_0xec73('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xec73('0x94')](_0xec73('0xa0'),_0x343ec1[_0xec73('0x3f')],_0xec73('0xa1'));}emitVoiceQueueSummary(_0x343ec1);}}function notSendMessagesCampaign(_0x26c3f3){if(_0x26c3f3[_0xec73('0x9d')]){if(_0x26c3f3['originated']===0x0){_0x26c3f3[_0xec73('0x9d')]=![];_0x26c3f3[_0xec73('0x3d')]=_0xec73('0x40');loggerSyncQueueSummary[_0xec73('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x26c3f3[_0xec73('0x3f')],_0xec73('0xa2'));}else{_0x26c3f3[_0xec73('0x3d')]=_0xec73('0xa3');loggerSyncQueueSummary[_0xec73('0x94')](_0xec73('0xa4'),_0x26c3f3['name'],_0xec73('0xa1'));}emitCampaignSummary(_0x26c3f3);}}function createObjHistory(_0x3bf6ce,_0x17fb96,_0x2301b8,_0xacc98b,_0x2db386){_0x3bf6ce[_0xec73('0x3d')]=_0x2301b8;var _0x17e743=new Action(_0x3bf6ce,_0x17fb96);var _0x4bd1e0=new History(_0x17e743);_0x4bd1e0[_0xec73('0xa5')]=_0xacc98b;_0x4bd1e0[_0xec73('0xa6')]=_0x2db386;_0x4bd1e0[_0xec73('0xa7')]=_0x17e743[_0xec73('0xa8')];return _0x4bd1e0;}Dialer[_0xec73('0x18')][_0xec73('0x3b')]=function(){var _0x4c4888=this;setInterval(function(){_0x4c4888[_0xec73('0xa9')](_0x4c4888[_0xec73('0x26')],_0xec73('0xaa'));_0x4c4888[_0xec73('0xa9')](_0x4c4888[_0xec73('0x24')],'[actions]');},0x32c8);};Dialer[_0xec73('0x18')][_0xec73('0xa9')]=function(_0x275303,_0x15a0eb){var _0x454125=this;for(var _0x30bec4 in _0x275303){if(typeof _0x275303[_0x30bec4]!==_0xec73('0xab')){this[_0xec73('0x1c')][_0xec73('0x19')](function(){if(!_['isNil'](_0x275303[_0x30bec4])){return ami[_0xec73('0xac')]({'action':'status','channel':_0x275303[_0x30bec4]['channel']})[_0xec73('0xad')](function(_0x1743c6){if(_0x1743c6[_0xec73('0x3d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x275303[_0x30bec4]&&_0x275303[_0x30bec4]['type']!==_0xec73('0x79')){_0x454125[_0xec73('0xae')](_0x454125['voiceQueues'][_0x275303[_0x30bec4][_0xec73('0xaf')]]);logger[_0xec73('0x94')](_0xec73('0xb0'),_0x15a0eb,_0x30bec4,_0x275303[_0x30bec4]['queue']);delete _0x275303[_0x30bec4];}if(_0x275303[_0x30bec4]&&_0x275303[_0x30bec4][_0xec73('0x50')]===_0xec73('0x79')){_0x454125[_0xec73('0xae')](_0x454125[_0xec73('0x1f')][_0x275303[_0x30bec4]['queue']]);logger[_0xec73('0x94')](_0xec73('0xb1'),_0x15a0eb,_0x30bec4,_0x275303[_0x30bec4]['queue']);delete _0x275303[_0x30bec4];}},0x2328);}});}});}}};Dialer[_0xec73('0x18')]['countReScheduled']=function(_0x21e37f){return BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](cmHopper[_0xec73('0xb4')](_0x21e37f))[_0xec73('0xad')](loggerCatch(_0xec73('0xb5')));};Dialer['prototype'][_0xec73('0xb6')]=function(_0x153c88){return BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](cmHopperBlack['checkIsBlackList'](_0x153c88))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xec73('0x18')]['checkIsBlackListIvr']=function(_0x31441f){return BPromise[_0xec73('0xb2')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x31441f))[_0xec73('0xad')](loggerCatch(_0xec73('0xb7')));};Dialer[_0xec73('0x18')][_0xec73('0xb8')]=function(_0x22f8e5){return BPromise['resolve']()[_0xec73('0xb3')](cmHopperHistory[_0xec73('0xb9')](_0x22f8e5))[_0xec73('0xad')](loggerCatch(_0xec73('0xba')));};Dialer[_0xec73('0x18')][_0xec73('0xbb')]=function(_0x28cb1b){return BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](cmHopper[_0xec73('0xbb')](_0x28cb1b))['catch'](loggerCatch(_0xec73('0xbc')));};Dialer['prototype'][_0xec73('0xbd')]=function(_0x323970,_0x5bee4a,_0x1edb17){return BPromise[_0xec73('0xb2')]()['then'](cmHopper['unlockContact'](_0x323970,_0x5bee4a,_0x1edb17))[_0xec73('0xad')](loggerCatch(_0xec73('0xbe')));};Dialer[_0xec73('0x18')][_0xec73('0xbf')]=function(_0x14fcfd,_0x201f1a,_0x48e434,_0x129d36,_0x21223f){return BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](cmHopper[_0xec73('0xbf')](_0x14fcfd,_0x201f1a,_0x48e434,_0x129d36))[_0xec73('0xad')](function(_0xd3d6b6){_0x21223f[_0xec73('0xc0')]-=_0x48e434;_0x21223f[_0xec73('0xc0')]=_0x21223f[_0xec73('0xc0')]>0x0?_0x21223f[_0xec73('0xc0')]:0x0;loggerCatch(_0xec73('0xc1'))(_0xd3d6b6);});};Dialer[_0xec73('0x18')][_0xec73('0xc2')]=function(_0x53a697,_0x21ce01,_0x492643,_0x29d2f9){return BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](cmHopper[_0xec73('0xc2')](_0x53a697,_0x21ce01,_0x492643))[_0xec73('0xad')](function(_0x5e4d78){_0x29d2f9[_0xec73('0xc0')]-=_0x21ce01;_0x29d2f9[_0xec73('0xc0')]=_0x29d2f9[_0xec73('0xc0')]>0x0?_0x29d2f9['temp']:0x0;loggerCatch(_0xec73('0xc3'))(_0x5e4d78);});};Dialer[_0xec73('0x18')]['getVoiceQueueRtPauses']=function(_0x3984be){return BPromise[_0xec73('0xb2')]()['then'](voiceQueueRt[_0xec73('0xc4')](_0x3984be))['catch'](loggerCatch(_0xec73('0xc5')));};Dialer[_0xec73('0x18')][_0xec73('0xc6')]=function(_0x194770){return BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](cmHopper[_0xec73('0xc6')](_0x194770))['catch'](loggerCatch(_0xec73('0xc7')));};Dialer['prototype'][_0xec73('0xc8')]=function(_0x5c6422){return BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](cmHopperHistory['createHistory'](_0x5c6422))[_0xec73('0xad')](loggerCatch('[createHistory]\x20'));};Dialer[_0xec73('0x18')]['updateOriginated']=function(_0x303612){if(!_[_0xec73('0x3c')](_0x303612)&&_0x303612!==null){if(typeof _0x303612[_0xec73('0x6f')]!==_0xec73('0xab')){if(_0x303612[_0xec73('0x6f')]>0x0){_0x303612[_0xec73('0x6f')]-=0x1;}else{logger[_0xec73('0x94')](_0xec73('0xc9'));}}}else{logger[_0xec73('0x94')](_0xec73('0xca'));}};Dialer[_0xec73('0x18')][_0xec73('0xcb')]=function(_0x2842ea,_0x54835c){var _0x3e5867=this;return function(_0x1af602){_0x3e5867[_0xec73('0xae')](_0x54835c);logger[_0xec73('0x94')](_0x2842ea,util[_0xec73('0x95')](_0x1af602,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xec73('0xcc')]=function(_0x3ceeb5,_0x16bdd6,_0x2e1814){var _0x1be257={'state':0x19,'statedesc':_0xec73('0xcd')};this[_0xec73('0xae')](_0x16bdd6);this[_0xec73('0xce')](_[_0xec73('0xcf')](_0x1be257,_[_0xec73('0xd0')](_0x2e1814,[_0xec73('0xd1'),'ListId',_0xec73('0xd2'),_0xec73('0xd3'),_0xec73('0xd4')])),_0xec73('0xd5'),_0xec73('0xd6'));logger[_0xec73('0x94')](_0x3ceeb5);};Dialer['prototype']['isSuccess']=function(_0x40f32b){return _0x40f32b===_0xec73('0xd7');};Dialer[_0xec73('0x18')]['isTrunkReachable']=function(_0x2b7458){return!_[_0xec73('0x3c')](_0x2b7458)&&_0x2b7458&&!_['isUndefined'](_0x2b7458[_0xec73('0x3f')])&&!_[_0xec73('0x3c')](_0x2b7458[_0xec73('0x74')])&&_0x2b7458['active']&&(this['trunks'][util[_0xec73('0x92')](_0xec73('0xd8'),_0x2b7458[_0xec73('0x3f')])][_0xec73('0xd9')]===_0xec73('0xda')||this['trunks'][util[_0xec73('0x92')](_0xec73('0xd8'),_0x2b7458[_0xec73('0x3f')])]['status']===_0xec73('0xdb'));};Dialer[_0xec73('0x18')][_0xec73('0xce')]=function(_0x397047,_0x1281f5,_0x14d3af){this[_0xec73('0xc8')](_0x397047)[_0xec73('0xad')](loggerCatch(_0x1281f5));this['moveContactManagedDialer'](_0x397047)[_0xec73('0xad')](loggerCatch(_0x14d3af));};Dialer[_0xec73('0x18')][_0xec73('0x36')]=function(_0x3e4111){var _0x3da722=this[_0xec73('0x26')][_0x3e4111[_0xec73('0xdc')]];var _0x3348c8;if(!_['isNil'](_0x3e4111)&&!_[_0xec73('0xdd')](_0x3e4111['variable'])&&!_['isNil'](_0x3e4111['variable']['amdstatus'])&&_0x3e4111[_0xec73('0xde')]===_0xec73('0xdf')&&_0x3da722){if(_0x3da722[_0xec73('0x50')]!==_0xec73('0x79')&&this[_0xec73('0x1e')][_0x3da722[_0xec73('0xaf')]][_0xec73('0xe0')]&&_0x3e4111['value']==='HANGUP'){delete this[_0xec73('0x26')][_0x3e4111[_0xec73('0xdc')]];this['updateOriginated'](this['voiceQueues'][_0x3da722[_0xec73('0xaf')]]);this[_0xec73('0x1e')][_0x3da722[_0xec73('0xaf')]][_0xec73('0x59')]+=0x1;this['voiceQueues'][_0x3da722[_0xec73('0xaf')]][_0xec73('0x58')]+=0x1;_0x3348c8=new Hangup(_0x3da722,_0x3e4111);_0x3348c8[_0xec73('0xa5')]=0x12;_0x3348c8[_0xec73('0xa6')]=_0xec73('0xe1');_0x3348c8['membername']=_0xec73('0xe2');ami['emit'](_0xec73('0xe3'),ut[_0xec73('0xe4')](_0x3348c8,'amd'));this[_0xec73('0xce')](_0x3348c8,_0xec73('0xe5'),_0xec73('0xe6'));}if(_0x3da722[_0xec73('0x50')]!==_0xec73('0x79')&&this['voiceQueues'][_0x3da722[_0xec73('0xaf')]][_0xec73('0xe0')]&&_0x3e4111[_0xec73('0xe7')]===_0xec73('0xe8')){var _0x83da0a=this;return new BPromise(function(_0x10c779,_0x488d8f){delete _0x83da0a[_0xec73('0x26')][_0x3e4111[_0xec73('0xdc')]];_0x83da0a['updateOriginated'](_0x83da0a[_0xec73('0x1e')][_0x3da722[_0xec73('0xaf')]]);_0x83da0a[_0xec73('0x1e')][_0x3da722[_0xec73('0xaf')]][_0xec73('0x59')]+=0x1;_0x83da0a[_0xec73('0x1e')][_0x3da722['queue']][_0xec73('0x58')]+=0x1;var _0x985722=_0x83da0a[_0xec73('0x1e')][_0x3da722[_0xec73('0xaf')]];var _0x58d72a=new Hangup(_0x3da722,_0x3e4111);_0x58d72a['state']=0x13;_0x58d72a['statedesc']=_0xec73('0xe9');_0x58d72a['membername']=_0xec73('0xe2');_0x58d72a[_0xec73('0xea')]+=0x1;_0x58d72a[_0xec73('0xeb')]+=0x1;_0x58d72a['amd']=!![];ami['emit'](_0xec73('0xe3'),ut[_0xec73('0xe4')](_0x58d72a,'amd'));_0x83da0a[_0xec73('0xc8')](_0x58d72a)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x58d72a[_0xec73('0xec')]+_0x58d72a[_0xec73('0xed')]+_0x58d72a['countnoanswerretry']+_0x58d72a[_0xec73('0xee')]+_0x58d72a[_0xec73('0xef')]+_0x58d72a[_0xec73('0xf0')]+_0x58d72a[_0xec73('0xea')]+_0x58d72a[_0xec73('0xf1')]>=_0x985722[_0xec73('0xf2')]){_0x83da0a[_0xec73('0xf3')](_0x58d72a,_0x10c779,_0x488d8f,_0xec73('0xf4'));}else{if(_0x58d72a[_0xec73('0xea')]>=_0x985722[_0xec73('0xf5')]){_0x83da0a[_0xec73('0xf6')](_0x58d72a,_0x10c779,_0x488d8f,_0xec73('0xf7'));}else{_0x83da0a[_0xec73('0xbb')]({'active':![],'countmachineretry':_0x58d72a[_0xec73('0xea')],'scheduledat':moment()['add'](_0x985722[_0xec73('0xf8')],_0xec73('0xf9'))[_0xec73('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x58d72a[_0xec73('0xd1')],'ListId':_0x58d72a['ListId'],'VoiceQueueId':_0x58d72a[_0xec73('0xd3')]||undefined,'CampaignId':_0x58d72a['CampaignId']||undefined})[_0xec73('0xad')](loggerCatch('[rescheduleContact][Machine]'));_0x10c779({'reschedule':0x1});}}});}if(_0x3da722[_0xec73('0x50')]===_0xec73('0x79')&&this[_0xec73('0x1f')][_0x3da722[_0xec73('0xaf')]][_0xec73('0xe0')]&&_0x3e4111[_0xec73('0xe7')]==='HANGUP'){delete this[_0xec73('0x26')][_0x3e4111[_0xec73('0xdc')]];this['updateOriginated'](this[_0xec73('0x1f')][_0x3da722[_0xec73('0xaf')]]);_0x3348c8=new Hangup(_0x3da722,_0x3e4111);_0x3348c8[_0xec73('0xa5')]=0x12;_0x3348c8['statedesc']=_0xec73('0xe1');_0x3348c8['membername']=_0xec73('0xe2');ami['emit'](_0xec73('0xe3'),ut[_0xec73('0xe4')](_0x3348c8,_0xec73('0xfa')));this[_0xec73('0xce')](_0x3348c8,_0xec73('0xfb'),_0xec73('0xfc'));}if(_0x3da722[_0xec73('0x50')]===_0xec73('0x79')&&this[_0xec73('0x1f')][_0x3da722[_0xec73('0xaf')]][_0xec73('0xe0')]&&_0x3e4111['value']===_0xec73('0xe8')){var _0x83da0a=this;return new BPromise(function(_0x38a4cd,_0x249696){delete _0x83da0a['uniqueId'][_0x3e4111[_0xec73('0xdc')]];_0x83da0a[_0xec73('0xae')](_0x83da0a['campaigns'][_0x3da722[_0xec73('0xaf')]]);_0x83da0a[_0xec73('0x1f')][_0x3da722['queue']][_0xec73('0x59')]+=0x1;_0x83da0a[_0xec73('0x1f')][_0x3da722[_0xec73('0xaf')]][_0xec73('0x58')]+=0x1;var _0x1b3103=_0x83da0a[_0xec73('0x1f')][_0x3da722[_0xec73('0xaf')]];var _0x436792=new Hangup(_0x3da722,_0x3e4111);_0x436792[_0xec73('0xa5')]=0x13;_0x436792[_0xec73('0xa6')]=_0xec73('0xe9');_0x436792['membername']='AMD';_0x436792['countmachineretry']+=0x1;_0x436792[_0xec73('0xeb')]+=0x1;_0x436792[_0xec73('0xfa')]=!![];ami[_0xec73('0x4a')](_0xec73('0xe3'),ut[_0xec73('0xe4')](_0x436792,'amd'));_0x83da0a[_0xec73('0xc8')](_0x436792)['catch'](loggerCatch(_0xec73('0xfd')));if(_0x436792[_0xec73('0xec')]+_0x436792[_0xec73('0xed')]+_0x436792['countnoanswerretry']+_0x436792[_0xec73('0xee')]+_0x436792[_0xec73('0xef')]+_0x436792['countabandonedretry']+_0x436792['countmachineretry']+_0x436792[_0xec73('0xf1')]>=_0x1b3103[_0xec73('0xf2')]){_0x83da0a[_0xec73('0xf3')](_0x436792,_0x38a4cd,_0x249696,'reason19\x20machine....');}else{if(_0x436792[_0xec73('0xea')]>=_0x1b3103['dialMachineMaxRetry']){_0x83da0a[_0xec73('0xf6')](_0x436792,_0x38a4cd,_0x249696,_0xec73('0xf7'));}else{_0x83da0a[_0xec73('0xbb')]({'active':![],'countmachineretry':_0x436792['countmachineretry'],'scheduledat':moment()[_0xec73('0xfe')](_0x1b3103['dialMachineRetryFrequency'],'minutes')['format'](_0xec73('0xff')),'ContactId':_0x436792['ContactId'],'ListId':_0x436792['ListId'],'VoiceQueueId':_0x436792[_0xec73('0xd3')]||undefined,'CampaignId':_0x436792[_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x100')));_0x38a4cd({'reschedule':0x1});}}});}}};Dialer[_0xec73('0x18')][_0xec73('0x32')]=function(_0x47f52b){var _0x2f9369=this[_0xec73('0x26')][_0x47f52b[_0xec73('0xdc')]];var _0x8b5826=this;var _0x35da5f;if(_0x2f9369&&_0x2f9369[_0xec73('0x50')]===_0xec73('0x79')){delete this[_0xec73('0x26')][_0x47f52b['uniqueid']];this[_0xec73('0xae')](this[_0xec73('0x1f')][_0x2f9369[_0xec73('0xaf')]]);this[_0xec73('0x1f')][_0x2f9369['queue']]['ivrAnswerCallsDay']+=0x1;_0x35da5f=new Hangup(_0x2f9369,_0x47f52b);this['createHistory'](_0x35da5f)['catch'](loggerCatch(_0xec73('0x101')));this[_0xec73('0xc6')](_0x35da5f)[_0xec73('0xad')](loggerCatch(_0xec73('0x102')));}if(_0x2f9369&&_0x2f9369['type']!==_0xec73('0x79')&&isNotNull(this[_0xec73('0x1e')][_0x2f9369[_0xec73('0xaf')]][_0xec73('0x103')])){delete this['uniqueId'][_0x47f52b['uniqueid']];this[_0xec73('0xae')](this[_0xec73('0x1e')][_0x2f9369[_0xec73('0xaf')]]);this[_0xec73('0x1e')][_0x2f9369[_0xec73('0xaf')]][_0xec73('0x59')]+=0x1;this[_0xec73('0x1e')][_0x2f9369[_0xec73('0xaf')]][_0xec73('0x58')]+=0x1;_0x35da5f=new Hangup(_0x2f9369,_0x47f52b);_0x35da5f[_0xec73('0xa5')]=0x10;_0x35da5f['statedesc']='AnswerAGI';_0x35da5f[_0xec73('0x104')]='AGI';this[_0xec73('0xc8')](_0x35da5f)[_0xec73('0xad')](loggerCatch(_0xec73('0x101')));this['moveContactManagedDialer'](_0x35da5f)['catch'](loggerCatch(_0xec73('0x102')));}if(_0x2f9369&&_0x2f9369[_0xec73('0x50')]!=='ivr'&&!isNotNull(this[_0xec73('0x1e')][_0x2f9369['queue']][_0xec73('0x103')])){delete this[_0xec73('0x26')][_0x47f52b[_0xec73('0xdc')]];this[_0xec73('0xae')](this[_0xec73('0x1e')][_0x2f9369[_0xec73('0xaf')]]);this['voiceQueues'][_0x2f9369['queue']][_0xec73('0x65')]+=0x1;_0x35da5f=new Hangup(_0x2f9369,_0x47f52b);_0x35da5f[_0xec73('0xa5')]=0xc;_0x35da5f[_0xec73('0xa6')]=_0x47f52b['cause-txt'];_0x35da5f[_0xec73('0x104')]='Unknow';this[_0xec73('0xc8')](_0x35da5f)[_0xec73('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xec73('0xc6')](_0x35da5f)[_0xec73('0xad')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xec73('0x18')][_0xec73('0x2f')]=function(_0x45071b){var _0xe9c0b=this[_0xec73('0x26')][_0x45071b[_0xec73('0xdc')]];var _0x52c38d=this;if(this[_0xec73('0x1e')][_0x45071b[_0xec73('0xaf')]]){if(_0xe9c0b&&_0xe9c0b[_0xec73('0x50')]!==_0xec73('0x79')){delete this[_0xec73('0x26')][_0x45071b[_0xec73('0xdc')]];this['voiceQueues'][_0x45071b[_0xec73('0xaf')]][_0xec73('0x59')]+=0x1;var _0x24542c=new AgentComplete(_0xe9c0b,_0x45071b);if(_0x45071b[_0xec73('0x105')]===_0xec73('0x106')){_0x24542c[_0xec73('0x107')]=this[_0xec73('0x1e')][_0x45071b[_0xec73('0xaf')]][_0xec73('0x108')]&&this['voiceQueues'][_0x45071b[_0xec73('0xaf')]][_0xec73('0x109')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x24542c)[_0xec73('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xec73('0xc6')](_0x24542c)[_0xec73('0xad')](loggerCatch(_0xec73('0x10a')));}}};Dialer[_0xec73('0x18')][_0xec73('0x10b')]=function(_0x56fc59){if(this[_0xec73('0x1e')][_0x56fc59['queue']]){if(this[_0xec73('0x26')][_0x56fc59[_0xec73('0xdc')]]&&this[_0xec73('0x26')][_0x56fc59[_0xec73('0xdc')]]['type']!==_0xec73('0x79')){this[_0xec73('0xae')](this['voiceQueues'][_0x56fc59[_0xec73('0xaf')]]);this[_0xec73('0x26')][_0x56fc59[_0xec73('0xdc')]][_0xec73('0x10c')]=moment()[_0xec73('0x92')](_0xec73('0xff'));}}};Dialer[_0xec73('0x18')]['queueCallerAbandonCreateState']=function(_0x4673da){this[_0xec73('0xc8')](_0x4673da)[_0xec73('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xec73('0xc6')](_0x4673da)[_0xec73('0xad')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xec73('0x18')][_0xec73('0x2d')]=function(_0x280795){var _0x3e370e=this[_0xec73('0x26')][_0x280795['uniqueid']];var _0x128fda=this;if(this['voiceQueues'][_0x280795['queue']]){if(_0x3e370e&&_0x3e370e['type']!=='ivr'){delete this[_0xec73('0x26')][_0x280795['uniqueid']];this[_0xec73('0xae')](this[_0xec73('0x1e')][_0x280795[_0xec73('0xaf')]]);_0x3e370e[_0xec73('0x10d')]=moment()[_0xec73('0x92')](_0xec73('0xff'));var _0x4a3d7a=new QueueCallerAbandon(_0x3e370e,_0x280795);if(getSeconds(_0x3e370e['droptime'],_0x3e370e['responsetime'])>=_0x3e370e['dialQueueTimeout']){this[_0xec73('0x1e')][_0x280795[_0xec73('0xaf')]][_0xec73('0x68')]+=0x1;this['voiceQueues'][_0x280795[_0xec73('0xaf')]][_0xec73('0x5f')]+=0x1;this['voiceQueues'][_0x280795[_0xec73('0xaf')]][_0xec73('0x6a')]+=0x1;_0x4a3d7a[_0xec73('0xa5')]=0xa;_0x4a3d7a[_0xec73('0xa6')]='Drop';_0x4a3d7a[_0xec73('0x10e')]=_0xec73('0x10f');_0x4a3d7a[_0xec73('0x107')]=this[_0xec73('0x1e')][_0x280795[_0xec73('0xaf')]]['dialQueueProject2']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4a3d7a[_0xec73('0xef')]+=0x1;_0x4a3d7a[_0xec73('0xeb')]+=0x1;if(_0x4a3d7a[_0xec73('0xef')]>=this[_0xec73('0x1e')][_0x280795['queue']]['dialDropMaxRetry']){this[_0xec73('0x110')](_0x4a3d7a);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4a3d7a[_0xec73('0xef')],'scheduledat':moment()[_0xec73('0xfe')](this[_0xec73('0x1e')][_0x280795[_0xec73('0xaf')]][_0xec73('0x111')],_0xec73('0xf9'))[_0xec73('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3e370e[_0xec73('0xd1')],'ListId':_0x3e370e[_0xec73('0x112')],'VoiceQueueId':_0x3e370e[_0xec73('0xd3')]||undefined,'CampaignId':_0x3e370e[_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x113')));var _0x56cc35=new History(_0x4a3d7a);_0x56cc35[_0xec73('0xa5')]=0xa;_0x56cc35[_0xec73('0xa6')]='Drop';_0x56cc35[_0xec73('0xa8')]=moment()[_0xec73('0x92')](_0xec73('0xff'));_0x56cc35['endtime']=_0x56cc35['starttime'];_0x56cc35[_0xec73('0x114')]=_0x4a3d7a['calleridname'];_0x56cc35[_0xec73('0x115')]=_0x4a3d7a[_0xec73('0x115')];this[_0xec73('0xc8')](_0x56cc35)['catch'](loggerCatch(_0xec73('0x116')));}}else{this[_0xec73('0x1e')][_0x280795[_0xec73('0xaf')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xec73('0x1e')][_0x280795[_0xec73('0xaf')]]['outboundDropCallsDayCallersExit']+=0x1;_0x4a3d7a[_0xec73('0xa5')]=0xb;_0x4a3d7a['statedesc']=_0xec73('0x117');_0x4a3d7a[_0xec73('0x10e')]=_0xec73('0x118');_0x4a3d7a['countabandonedretry']+=0x1;_0x4a3d7a[_0xec73('0xeb')]+=0x1;if(_0x4a3d7a[_0xec73('0xf0')]>=this[_0xec73('0x1e')][_0x280795['queue']][_0xec73('0x119')]){this[_0xec73('0x110')](_0x4a3d7a);}else{this[_0xec73('0xbb')]({'active':![],'countabandonedretry':_0x4a3d7a[_0xec73('0xf0')],'scheduledat':moment()[_0xec73('0xfe')](this[_0xec73('0x1e')][_0x280795[_0xec73('0xaf')]][_0xec73('0x11a')],_0xec73('0xf9'))[_0xec73('0x92')](_0xec73('0xff')),'ContactId':_0x3e370e['ContactId'],'ListId':_0x3e370e[_0xec73('0x112')],'VoiceQueueId':_0x3e370e['VoiceQueueId']||undefined,'CampaignId':_0x3e370e['CampaignId']||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x11b')));var _0x56cc35=new History(_0x4a3d7a);_0x56cc35[_0xec73('0xa5')]=0xb;_0x56cc35[_0xec73('0xa6')]=_0xec73('0x117');_0x56cc35[_0xec73('0xa8')]=moment()[_0xec73('0x92')](_0xec73('0xff'));_0x56cc35[_0xec73('0xa7')]=_0x56cc35[_0xec73('0xa8')];_0x56cc35['calleridname']=_0x4a3d7a[_0xec73('0x114')];_0x56cc35[_0xec73('0x115')]=_0x4a3d7a['calleridnum'];this[_0xec73('0xc8')](_0x56cc35)[_0xec73('0xad')](loggerCatch(_0xec73('0x11c')));}}}}};Dialer[_0xec73('0x18')][_0xec73('0x34')]=function(_0x12804c){if(this[_0xec73('0x24')][_0x12804c['uniqueid']]){this[_0xec73('0x24')][_0x12804c[_0xec73('0xdc')]][_0xec73('0x11d')]=_0x12804c[_0xec73('0x11d')];}if(this[_0xec73('0x26')][_0x12804c[_0xec73('0xdc')]]){this[_0xec73('0x26')][_0x12804c[_0xec73('0xdc')]][_0xec73('0x11d')]=_0x12804c[_0xec73('0x11d')];}};Dialer[_0xec73('0x18')][_0xec73('0x38')]=function(_0x182630){if(strategy[this[_0xec73('0x1e')][this[_0xec73('0x24')][_0x182630[_0xec73('0x11e')]][_0xec73('0xaf')]][_0xec73('0x11f')]]==='roundrobin'){if(this[_0xec73('0x24')][_0x182630[_0xec73('0x11e')]]&&_[_0xec73('0xdd')](this[_0xec73('0x24')][_0x182630['actionid']][_0xec73('0x120')])&&_0x182630[_0xec73('0xd9')]==='1'&&_0x182630[_0xec73('0x121')]==='0'){if(this['agents'][_0x182630[_0xec73('0x122')]]){if(!this[_0xec73('0x20')][_0x182630[_0xec73('0x122')]][_0xec73('0x120')]){this[_0xec73('0x20')][_0x182630[_0xec73('0x122')]][_0xec73('0x120')]=!![];this[_0xec73('0x24')][_0x182630['actionid']][_0xec73('0x120')]=!![];this['actions'][_0x182630['actionid']]['stateinterface']=_0x182630[_0xec73('0x122')];}}}}else if((strategy[this[_0xec73('0x1e')][this[_0xec73('0x24')][_0x182630[_0xec73('0x11e')]][_0xec73('0xaf')]]['strategy']]||_0xec73('0x123'))==='rrmemory'){if(this[_0xec73('0x24')][_0x182630['actionid']]){if(this[_0xec73('0x20')][_0x182630[_0xec73('0x122')]]){this[_0xec73('0x24')][_0x182630[_0xec73('0x11e')]][_0xec73('0x122')]=_0x182630[_0xec73('0x122')];if(_[_0xec73('0xdd')](this[_0xec73('0x29')][this['actions'][_0x182630[_0xec73('0x11e')]][_0xec73('0xaf')]])){this['queueBooked'][this['actions'][_0x182630['actionid']]['queue']]=[];}this['queueBooked'][this[_0xec73('0x24')][_0x182630[_0xec73('0x11e')]][_0xec73('0xaf')]][_0xec73('0x124')](_[_0xec73('0xcf')](_[_0xec73('0xd0')](this[_0xec73('0x24')][_0x182630['actionid']],[_0xec73('0x125'),_0xec73('0x122')]),{'status':_0x182630['status'],'paused':_0x182630[_0xec73('0x121')]}));}}}};function unlockQueueStatus(_0x15e6d8,_0x53aea4){setTimeout(function(){if(_[_0xec73('0x3c')](_0x15e6d8['queueStatusComplete'])){loggerBooked[_0xec73('0x94')](_0xec73('0x126'),_0x53aea4);}_0x15e6d8['queueStatusComplete']=!![];loggerBooked[_0xec73('0x7a')]('[booked][unlockQueueStatus]',_0x53aea4,JSON[_0xec73('0x48')](_[_0xec73('0xd0')](_0x15e6d8,[_0xec73('0x3f'),_0xec73('0x127')])));},0x1f3);}Dialer[_0xec73('0x18')][_0xec73('0x39')]=function(_0x482a25){var _0x513d54=this;var _0x1ba4fd=_0x513d54[_0xec73('0x1e')][_0x513d54[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xaf')]];if(strategy[this[_0xec73('0x1e')][this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]][_0xec73('0x11f')]]===_0xec73('0x17')){if(this['actions'][_0x482a25['actionid']]&&this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0x122')]){this[_0xec73('0x1d')][_0xec73('0x128')](this[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0x125')],this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0x122')])[_0xec73('0xad')](function(_0x14e973){logger['error'](_0xec73('0x129'),util[_0xec73('0x95')](_0x14e973,{'showHidden':![],'depth':null}));})[_0xec73('0x1b')](function(){_0x513d54['updateOriginated'](_0x513d54[_0xec73('0x1e')][_0x513d54[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xaf')]]);_0x513d54[_0xec73('0x20')][_0x513d54[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0x122')]][_0xec73('0x120')]=![];delete _0x513d54[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]];unlockQueueStatus(_0x1ba4fd);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]);this[_0xec73('0xbb')]({'active':![],'ContactId':this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xd1')],'ListId':this['actions'][_0x482a25[_0xec73('0x11e')]]['ListId'],'VoiceQueueId':this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xd3')]||undefined,'CampaignId':this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x12a')));delete this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]];unlockQueueStatus(_0x1ba4fd);}}else if((strategy[this[_0xec73('0x1e')][this[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xaf')]][_0xec73('0x11f')]]||_0xec73('0x123'))==='rrmemory'){var _0x2f68ef;if(this[_0xec73('0x24')][_0x482a25['actionid']]&&!_['isEmpty'](this[_0xec73('0x29')][this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]])){if(this[_0xec73('0x2a')][_0x513d54[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xaf')]]){this[_0xec73('0x2a')][_0x513d54[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]]['queue']]=this['queueBookedRR'][this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]?this[_0xec73('0x2a')][this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]:this[_0xec73('0x29')][this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]?this[_0xec73('0x29')][this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]]['queue']][_0xec73('0x12b')]||0x0:0x0;}this[_0xec73('0x29')][this['actions'][_0x482a25['actionid']][_0xec73('0xaf')]][_0xec73('0x12b')]=this[_0xec73('0x2a')][this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]]['queue']];for(var _0x5cc5af=0x0;_0x5cc5af<this[_0xec73('0x29')][this[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xaf')]][_0xec73('0x97')];_0x5cc5af+=0x1){_0x2f68ef=rr(this[_0xec73('0x29')][this[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xaf')]]);this[_0xec73('0x2a')][_0x513d54[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]]['queue']]=this[_0xec73('0x29')][this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]['_rr'];if(_0x2f68ef['status']==='1'&&_0x2f68ef[_0xec73('0x121')]==='0'){break;}}if(!_['isNil'](_0x2f68ef)){this['agents'][_0x2f68ef[_0xec73('0x122')]]['unlockRR']=_[_0xec73('0x3c')](this['agents'][_0x2f68ef[_0xec73('0x122')]][_0xec73('0x12c')])?!![]:this[_0xec73('0x20')][_0x2f68ef[_0xec73('0x122')]][_0xec73('0x12c')];}loggerBooked[_0xec73('0x7a')]('[booked][RR]',_0x482a25[_0xec73('0x11e')],_0xec73('0x12d'),JSON[_0xec73('0x48')](_[_0xec73('0xd0')](this[_0xec73('0x20')][_0x2f68ef[_0xec73('0x122')]],['name','unlockRR'])),_0xec73('0x12e'),JSON[_0xec73('0x48')](_0x2f68ef[_0xec73('0x125')]));if(!_['isNil'](_0x2f68ef)&&_0x2f68ef[_0xec73('0xd9')]==='1'&&_0x2f68ef[_0xec73('0x121')]==='0'&&this[_0xec73('0x20')][_0x2f68ef[_0xec73('0x122')]][_0xec73('0x12c')]){this[_0xec73('0x20')][_0x2f68ef[_0xec73('0x122')]]['unlockRR']=![];this[_0xec73('0x29')][_0x513d54[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]=[];this['preview'][_0xec73('0x128')](_0x2f68ef[_0xec73('0x125')],_0x2f68ef['stateinterface'])[_0xec73('0xad')](function(_0x4f3850){logger[_0xec73('0x94')](_0xec73('0x129'),util['inspect'](_0x4f3850,{'showHidden':![],'depth':null}));})['finally'](function(){_0x513d54[_0xec73('0xae')](_0x513d54[_0xec73('0x1e')][_0x513d54[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xaf')]]);setTimeout(function(){_0x513d54[_0xec73('0x20')][_0x2f68ef[_0xec73('0x122')]][_0xec73('0x12c')]=!![];loggerBooked[_0xec73('0x7a')](_0xec73('0x12f'),_0x482a25[_0xec73('0x11e')],'Agent:\x20',JSON['stringify'](_['pick'](_0x513d54[_0xec73('0x20')][_0x2f68ef[_0xec73('0x122')]],[_0xec73('0x3f'),'unlockRR'])),'contactAgent-idHopper:\x20',JSON[_0xec73('0x48')](_0x2f68ef[_0xec73('0x125')]));},0xc7);delete _0x513d54[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]];unlockQueueStatus(_0x1ba4fd,_0x482a25[_0xec73('0x11e')]);});}else{loggerBooked['info']('[booked][unlock]');this['updateOriginated'](this[_0xec73('0x1e')][this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xd1')],'ListId':this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0x112')],'VoiceQueueId':this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0xd3')]||undefined,'CampaignId':this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]];unlockQueueStatus(_0x1ba4fd);}}else{loggerBooked[_0xec73('0x7a')](_0xec73('0x130'));this[_0xec73('0xae')](this[_0xec73('0x1e')][this['actions'][_0x482a25[_0xec73('0x11e')]]['queue']]);this[_0xec73('0xbb')]({'active':![],'ContactId':this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]]['ContactId'],'ListId':this[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0x112')],'VoiceQueueId':this[_0xec73('0x24')][_0x482a25['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]][_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x131')));delete this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]];unlockQueueStatus(_0x1ba4fd);}}else{loggerBooked['info'](_0xec73('0x132'));this[_0xec73('0xae')](this[_0xec73('0x1e')][this['actions'][_0x482a25[_0xec73('0x11e')]][_0xec73('0xaf')]]);this[_0xec73('0xbb')]({'active':![],'ContactId':this[_0xec73('0x24')][_0x482a25['actionid']][_0xec73('0xd1')],'ListId':this['actions'][_0x482a25['actionid']][_0xec73('0x112')],'VoiceQueueId':this['actions'][_0x482a25[_0xec73('0x11e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xec73('0x24')][_0x482a25[_0xec73('0x11e')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xec73('0x133')));delete this['actions'][_0x482a25['actionid']];unlockQueueStatus(_0x1ba4fd);}};Dialer['prototype'][_0xec73('0x3a')]=function(){var _0x385c9e=this;setInterval(function(){_0x385c9e[_0xec73('0x134')]();},0x3e8);};Dialer[_0xec73('0x18')][_0xec73('0x135')]=function(_0x152340){var _0x349146=this;return function(){if(!_0x349146[_0xec73('0x136')](_0x152340['Trunk'])){if(!_0x349146[_0xec73('0x136')](_0x152340[_0xec73('0x137')])){_0x152340[_0xec73('0x3d')]=_0xec73('0x138');throw _0x152340[_0xec73('0x3f')]+_0xec73('0x139');}}};};Dialer['prototype'][_0xec73('0x13a')]=function(_0x426e9a,_0x5cd370,_0x37ca91,_0x1d14bd){var _0x4f886c=this;return function(){var _0x258492=!![];return _0x4f886c[_0xec73('0x13b')](_0x426e9a,_0x5cd370,_0x37ca91,_0x1d14bd,_0x258492);};};Dialer[_0xec73('0x18')][_0xec73('0x13c')]=function(_0x357464,_0x54be87,_0x1f98e4,_0x5afd55){var _0x58f4b9=this;return function(){var _0x2e1ffa=![];return _0x58f4b9[_0xec73('0x13b')](_0x357464[_0xec73('0x45')],_0x54be87,_0x1f98e4,_0x5afd55,_0x2e1ffa);};};Dialer[_0xec73('0x18')]['ifTime']=function(_0x485bee,_0x52b2d4,_0x1fa4d0,_0x10bd6a,_0x549c59){var _0x3b731a=[];return new BPromise(function(_0x9726e0,_0x58b174){if(!isNotNull(_0x485bee)){_0x10bd6a[_0xec73('0x3d')]=_0xec73('0x42');return _0x58b174(msgResponse(_0xec73('0x13b'),_0xec73('0x13d'),_0x1fa4d0+_0xec73('0x13e')));}if(_[_0xec73('0x44')](_0x485bee)){_0x10bd6a['message']=_0xec73('0x13f');return _0x58b174(msgResponse(_0xec73('0x13b'),_0xec73('0x13d'),_0x1fa4d0+_0xec73('0x140')));}if(_0x52b2d4&&_[_0xec73('0x3c')](config[_0xec73('0x141')][_0x52b2d4])){_0x10bd6a[_0xec73('0x3d')]=_0xec73('0x142');return _0x58b174(msgResponse(_0xec73('0x13b'),_0xec73('0x13d'),_0x1fa4d0+_0xec73('0x143')+_0x52b2d4));}if(_[_0xec73('0x144')](_0x485bee)){for(var _0xc2826b=0x0;_0xc2826b<_0x485bee[_0xec73('0x97')];_0xc2826b+=0x1){_0x3b731a[_0xec73('0x124')](ami[_0xec73('0xac')]({'action':_0xec73('0x145'),'command':util[_0xec73('0x92')](_0xec73('0x146'),_0x485bee[_0xc2826b][_0xec73('0x147')],!_[_0xec73('0x3c')](config[_0xec73('0x141')][_0x52b2d4])?_0x52b2d4:'')})[_0xec73('0xb3')](function(_0x4818a1){return _0x4818a1['content'][_0xec73('0x148')](_0xec73('0x149'))>=0x0;})['catch'](myreject(_0x58b174)));}}else{_0x3b731a['push'](ami[_0xec73('0xac')]({'action':_0xec73('0x145'),'command':util[_0xec73('0x92')]('iftime\x20%s,%s',_0x485bee,!_['isUndefined'](config[_0xec73('0x141')][_0x52b2d4])?_0x52b2d4:'')})['then'](function(_0x97ecb9){return _0x97ecb9['content'][_0xec73('0x148')](_0xec73('0x149'))>=0x0;})[_0xec73('0xad')](myreject(_0x58b174)));}BPromise[_0xec73('0x14a')](_0x3b731a)['then'](function(_0x34b8ed){var _0x41b8ee=_[_0xec73('0x14b')](_0x34b8ed);if(_0x41b8ee){return _0x9726e0(_0x41b8ee);}else{_0x10bd6a['message']=_0x549c59?_0xec73('0x14c'):_0xec73('0x14d');return _0x58b174(msgResponse(_0xec73('0x14e'),_0xec73('0x13d'),_0xec73('0x14f')+_0x549c59+'\x20'+_0x1fa4d0+'\x20Interval\x20is\x20overtime:\x20'+util[_0xec73('0x95')](_0x485bee,{'showHidden':![],'depth':null})+_0xec73('0x150')+_0x52b2d4));}})['catch'](function(_0x386233){return _0x58b174(msgResponse('ifTime','Failure',JSON['stringify'](_0x386233)));});});};Dialer['prototype']['checkDialMethod']=function(_0x14af12){var _0x4454e5=this;return function(){switch(_0x14af12['dialMethod']){case _0xec73('0x151'):freeVariablesPredictive(_0x14af12);_0x4454e5['handlePower'](_0x14af12,0x1);break;case _0xec73('0x152'):freeVariablesPredictive(_0x14af12);_0x4454e5[_0xec73('0x153')](_0x14af12,_0x14af12['dialPowerLevel']);break;case _0xec73('0x7'):_0x4454e5[_0xec73('0x7')](_0x14af12);break;case _0xec73('0x6'):freeVariablesPredictive(_0x14af12);_0x4454e5['handlePower'](_0x14af12,0x1);break;default:freeVariablesPredictive(_0x14af12);logger[_0xec73('0x94')](_0xec73('0x154'),_0x14af12[_0xec73('0x3f')],'method\x20not\x20recognized');}};};Dialer[_0xec73('0x18')][_0xec73('0x155')]=function(_0x5ad156){var _0x536bee=this;return function(){_0x536bee[_0xec73('0x156')](_0x5ad156);};};Dialer['prototype'][_0xec73('0x9')]=function(_0x374bbc){var _0xf3a64e=this;if(isNotPreview(_0x374bbc['dialMethod'])){if(isVoiceQueueOutbound(_0x374bbc[_0xec73('0x50')])&&isActive(_0x374bbc[_0xec73('0x54')])){_0x374bbc['sendMessageOneNotActive']=!![];BPromise[_0xec73('0xb2')]()['then'](checkIsLoggedIn(_0x374bbc,_0x374bbc[_0xec73('0x4d')]))['then'](checkIsActive(_0x374bbc,_0x374bbc[_0xec73('0x54')]))['then'](checkInterval(_0x374bbc))['then'](_0xf3a64e[_0xec73('0x135')](_0x374bbc))[_0xec73('0xb3')](_0xf3a64e[_0xec73('0x13a')](_0x374bbc[_0xec73('0x157')],_0x374bbc[_0xec73('0x158')],_0x374bbc[_0xec73('0x3f')],_0x374bbc))[_0xec73('0xb3')](_0xf3a64e['checkIfTimeIntervals'](_0x374bbc[_0xec73('0x41')],_0x374bbc[_0xec73('0x158')],_0x374bbc['name'],_0x374bbc))[_0xec73('0xb3')](_0xf3a64e['checkDialMethod'](_0x374bbc))['catch'](loggerCatchQueueSummary(_0xec73('0x159'),_0x374bbc));}else{notSendMessagesQueue(_0x374bbc);}}else{freeVariablesPredictive(_0x374bbc);}};Dialer[_0xec73('0x18')][_0xec73('0x134')]=function(){var _0x1712da=this;var _0x19e528;for(var _0x46c85d in this[_0xec73('0x1f')]){if(typeof this['campaigns'][_0x46c85d]!==_0xec73('0xab')){_0x19e528=this['campaigns'][_0x46c85d];if(isCampaignIvr(_0x19e528['type'])&&isActive(_0x19e528[_0xec73('0x74')])){_0x19e528[_0xec73('0x9d')]=!![];BPromise[_0xec73('0xb2')]()[_0xec73('0xb3')](checkIsActive(_0x19e528,_0x19e528[_0xec73('0x74')]))[_0xec73('0xb3')](checkInterval(_0x19e528))['then'](_0x1712da[_0xec73('0x135')](_0x19e528))[_0xec73('0xb3')](_0x1712da['checkIfTime'](_0x19e528['dialGlobalInterval'],_0x19e528['dialTimezone'],_0x19e528['name'],_0x19e528))[_0xec73('0xb3')](_0x1712da[_0xec73('0x13c')](_0x19e528[_0xec73('0x41')],_0x19e528[_0xec73('0x158')],_0x19e528[_0xec73('0x3f')],_0x19e528))[_0xec73('0xb3')](_0x1712da[_0xec73('0x155')](_0x19e528))['catch'](loggerCatchQueueSummary(_0xec73('0x15a'),_0x19e528));}else{notSendMessagesCampaign(_0x19e528);}}}};function getCallerIdRandom(_0x3df819,_0x2a3f10){var _0x2724f1;var _0x56dd65;var _0x38833c;if(_0x2a3f10<=0x0){_0x2a3f10=0x1;}_0x2724f1=new RegExp(_0xec73('0x15b')+_0x2a3f10+'}$');_0x56dd65=Math[_0xec73('0x15c')](0xa,_0x2a3f10-0x1);_0x38833c=Math['pow'](0xa,_0x2a3f10)-0x1;return util[_0xec73('0x92')]('%s',_[_0xec73('0x15d')](_0x3df819,_0x2724f1,_[_0xec73('0x15e')](_0x56dd65,_0x38833c)));}function extractCalleridName(_0x20da44){var _0x50e110=_0x20da44['match'](/"(.*?)"/);return _0x50e110?_0x50e110[0x1]:_0x20da44;}function extractCalleridNumber(_0x3b98db){var _0x47c9ea=_0x3b98db[_0xec73('0x15f')](/<(.*?)>/);return _0x47c9ea?_0x47c9ea[0x1]:_0x3b98db;}Dialer[_0xec73('0x18')][_0xec73('0x160')]=function(_0x352a3d,_0x474c6e){var _0x51b90e=this;var _0x2e1053=uuid['v4']();this[_0xec73('0x24')][_0x2e1053]=new Action(_0x352a3d,_0x474c6e,_0x2e1053);return new BPromise(function(_0x18257,_0x1bcfbc){if(_[_0xec73('0x3c')](_0x352a3d)&&typeof _0x352a3d!==_0xec73('0x161')){return _0x1bcfbc(msgResponse(_0xec73('0x162'),_0xec73('0x13d'),_0xec73('0x163')));}if(_['isUndefined'](_0x474c6e['Contact'][_0xec73('0x164')])||_0x474c6e[_0xec73('0x165')][_0xec73('0x164')]===null){return _0x1bcfbc(msgResponse(_0xec73('0x162'),_0xec73('0x13d'),'contact\x20is\x20undefine'));}var _0x1f593f={'XMD-CALLERID':_0x51b90e[_0xec73('0x24')][_0x2e1053]['getCaller'](),'XMD-AGI':_0x352a3d[_0xec73('0x103')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x352a3d[_0xec73('0x103')]):'NONE','XMD-AGIAFTER':_0x352a3d[_0xec73('0x108')]?util[_0xec73('0x92')](_0xec73('0x166'),ipAgi,_0x352a3d[_0xec73('0x108')]):'NONE','XMD-QUEUE':_0x352a3d['type']===_0xec73('0x4b')?util[_0xec73('0x92')](_0xec73('0x167'),_0x352a3d[_0xec73('0x3f')],_0x352a3d[_0xec73('0x168')]||'',_0x352a3d[_0xec73('0x109')]?'c':'',_0x352a3d[_0xec73('0x169')]||0x3):'NONE','XMD-CONTACTID':_0x474c6e[_0xec73('0xd1')],'XMD-CDRTYPE':_0xec73('0x16a'),'CALLERID(all)':_0x51b90e[_0xec73('0x24')][_0x2e1053][_0xec73('0x16b')](),'XMD-AMD':_0x352a3d[_0xec73('0xe0')]?_0xec73('0x16c'):_0xec73('0x16d'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x352a3d[_0xec73('0xe0')]){_0x1f593f[_0xec73('0x16e')]=_0x352a3d[_0xec73('0x16f')]||0x9c4;_0x1f593f[_0xec73('0x170')]=_0x352a3d['dialAMDGreeting']||0x5dc;_0x1f593f[_0xec73('0x171')]=_0x352a3d['dialAMDAfterGreetingSilence']||0x320;_0x1f593f['XMD-AMDTOTALANALYSISTIME']=_0x352a3d[_0xec73('0x172')]||0x1388;_0x1f593f[_0xec73('0x173')]=_0x352a3d['dialAMDMinWordLength']||0x64;_0x1f593f[_0xec73('0x174')]=_0x352a3d[_0xec73('0x175')]||0x32;_0x1f593f[_0xec73('0x176')]=_0x352a3d['dialAMDMaximumNumberOfWords']||0x3;_0x1f593f[_0xec73('0x177')]=_0x352a3d['dialAMDSilenceThreshold']||0x100;_0x1f593f[_0xec73('0x178')]=_0x352a3d[_0xec73('0x179')]||0x1388;}if(_0x352a3d[_0xec73('0x50')]===_0xec73('0x4b')){_0x1f593f[_0xec73('0x17a')]=_0x474c6e[_0xec73('0xd3')];}else{_0x1f593f[_0xec73('0x17b')]=_0x474c6e[_0xec73('0xd4')];}for(var _0x4692fb in _0x474c6e[_0xec73('0x165')]){if(typeof _0x474c6e[_0xec73('0x165')][_0x4692fb]!==_0xec73('0xab')){if(isNotNull(_0x474c6e[_0xec73('0x165')][_0x4692fb])&&_0x4692fb!=='id'&&_0x4692fb!==_0xec73('0x17c')&&_0x4692fb!==_0xec73('0x17d')&&_0x4692fb!=='updatedAt'){_0x1f593f[util['format'](_0xec73('0x17e'),_0xec73('0x17f'),_[_0xec73('0x180')](_0x4692fb))]=_0x474c6e['Contact'][_0x4692fb];}}}var _0x284020=_0x51b90e['isTrunkReachable'](_0x352a3d[_0xec73('0x73')])?getCallerId(_0x352a3d[_0xec73('0x73')][_0xec73('0x75')],_0x352a3d[_0xec73('0x56')],_0x352a3d['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x352a3d[_0xec73('0x57')],_0x352a3d['dialRandomLastDigitCallerIdNumber']):_0x352a3d[_0xec73('0x57')]):getCallerId(_['isNil'](_0x352a3d[_0xec73('0x137')])?_0x352a3d[_0xec73('0x73')][_0xec73('0x75')]:_0x352a3d['TrunkBackup'][_0xec73('0x75')],_0x352a3d['dialOriginateCallerIdName'],_0x352a3d['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x352a3d[_0xec73('0x57')],_0x352a3d[_0xec73('0x181')]):_0x352a3d[_0xec73('0x57')]);if(_0x284020){_0x1f593f[_0xec73('0x182')]=_0x51b90e[_0xec73('0x24')][_0x2e1053][_0xec73('0x183')]=extractCalleridName(_0x284020);_0x1f593f[_0xec73('0x184')]=_0x51b90e[_0xec73('0x24')][_0x2e1053][_0xec73('0x185')]=extractCalleridNumber(_0x284020);}return ami[_0xec73('0xac')]({'actionid':_0x2e1053,'action':'originate','channel':_0x51b90e['isTrunkReachable'](_0x352a3d[_0xec73('0x73')])?util[_0xec73('0x92')](_0xec73('0x186'),_0x352a3d['Trunk'][_0xec73('0x3f')],isNotNull(_0x352a3d[_0xec73('0x187')])?_0x352a3d[_0xec73('0x187')][_0xec73('0x188')]()||'':'',_0x352a3d[_0xec73('0x189')]>0x0?_0x474c6e[_0xec73('0x165')][_0xec73('0x164')]['substring'](_0x352a3d[_0xec73('0x189')]):_0x474c6e[_0xec73('0x165')][_0xec73('0x164')]):util[_0xec73('0x92')](_0xec73('0x186'),_['isNil'](_0x352a3d[_0xec73('0x137')])?_0x352a3d[_0xec73('0x73')][_0xec73('0x3f')]:_0x352a3d[_0xec73('0x137')]['name'],isNotNull(_0x352a3d[_0xec73('0x187')])?_0x352a3d['dialPrefix'][_0xec73('0x188')]()||'':'',_0x352a3d[_0xec73('0x189')]>0x0?_0x474c6e[_0xec73('0x165')][_0xec73('0x164')][_0xec73('0x18a')](_0x352a3d[_0xec73('0x189')]):_0x474c6e['Contact']['phone']),'callerid':_0x284020,'Exten':_0xec73('0xdf'),'Context':_0xec73('0x18b'),'Priority':'1','variable':_0x1f593f,'timeout':(_0x352a3d[_0xec73('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2e1053})[_0xec73('0xb3')](function(_0x51b78e){return _0x18257(_0x51b78e);})[_0xec73('0xad')](function(_0x3d15c9){_0x352a3d['outboundOriginateFailureCallsDay']+=0x1;var _0xfbad6b=new History(_0x51b90e[_0xec73('0x24')][_0x2e1053]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0xec73('0x48')](_0x3d15c9)));_0xfbad6b[_0xec73('0xa5')]=0xe;_0xfbad6b['statedesc']='OriginateError';_0xfbad6b['starttime']=moment()[_0xec73('0x92')](_0xec73('0xff'));_0xfbad6b['endtime']=_0xfbad6b['starttime'];_0x51b90e[_0xec73('0xc8')](_0xfbad6b)[_0xec73('0xad')](loggerCatch(_0xec73('0x18d')));_0x51b90e[_0xec73('0xc6')](_0xfbad6b)[_0xec73('0xad')](loggerCatch(_0xec73('0x18d')))[_0xec73('0x1b')](function(){delete _0x51b90e[_0xec73('0x24')][_0x2e1053];return _0x1bcfbc(msgResponse('originate',_0xec73('0x47'),_0xec73('0x18e')));});});});};Dialer[_0xec73('0x18')][_0xec73('0x18f')]=function(_0xa01d00){var _0x453880=this[_0xec73('0x24')][_0xa01d00[_0xec73('0x11e')]];if(_0x453880){delete this[_0xec73('0x24')][_0xa01d00[_0xec73('0x11e')]];_0x453880[_0xec73('0x190')]=moment()['format'](_0xec73('0xff'));var _0x3aca5b=_0x453880['type']===_0xec73('0x79')?this[_0xec73('0x1f')][_0x453880[_0xec73('0xaf')]]:this['voiceQueues'][_0x453880[_0xec73('0x191')]()];if(!this[_0xec73('0x192')](_0xa01d00[_0xec73('0x193')])){this['updateOriginated'](_0x3aca5b);return this[_0xec73('0x194')](_0x453880,_0x3aca5b,_0xa01d00)[_0xec73('0xad')](loggerCatch(_0xec73('0x195')));}this['uniqueId'][_0xa01d00[_0xec73('0xdc')]]=_0x453880;}};Dialer[_0xec73('0x18')][_0xec73('0x196')]=function(_0x31ddfe,_0x5d5377,_0x5f5c4e){var _0x211e5e=new History(_0x5d5377);if(_0x211e5e[_0xec73('0xec')]+_0x211e5e[_0xec73('0xed')]+_0x211e5e[_0xec73('0x197')]+_0x211e5e[_0xec73('0xee')]+_0x211e5e[_0xec73('0xef')]+_0x211e5e[_0xec73('0xf0')]+_0x211e5e[_0xec73('0xea')]+_0x211e5e[_0xec73('0xf1')]>=_0x5f5c4e['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x31ddfe){case 0x3:if(_0x211e5e['countnoanswerretry']>=_0x5f5c4e[_0xec73('0x198')]-0x1){return!![];}this[_0xec73('0xbb')]({'active':![],'countnoanswerretry':_0x211e5e[_0xec73('0x197')]+=0x1,'scheduledat':moment()[_0xec73('0xfe')](_0x5f5c4e[_0xec73('0x199')],_0xec73('0xf9'))[_0xec73('0x92')](_0xec73('0xff')),'ContactId':_0x211e5e['ContactId'],'ListId':_0x211e5e[_0xec73('0x112')],'VoiceQueueId':_0x211e5e[_0xec73('0xd3')]||undefined,'CampaignId':_0x211e5e[_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x19a')));break;case 0x5:if(_0x211e5e['countbusyretry']>=_0x5f5c4e[_0xec73('0x19b')]-0x1){return!![];}this[_0xec73('0xbb')]({'active':![],'countbusyretry':_0x211e5e[_0xec73('0xec')]+=0x1,'scheduledat':moment()['add'](_0x5f5c4e[_0xec73('0x19c')],_0xec73('0xf9'))[_0xec73('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x211e5e['ContactId'],'ListId':_0x211e5e['ListId'],'VoiceQueueId':_0x211e5e[_0xec73('0xd3')]||undefined,'CampaignId':_0x211e5e['CampaignId']||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x19d')));break;case 0x8:if(_0x211e5e[_0xec73('0xed')]>=_0x5f5c4e['dialCongestionMaxRetry']-0x1){return!![];}this[_0xec73('0xbb')]({'active':![],'countcongestionretry':_0x211e5e[_0xec73('0xed')]+=0x1,'scheduledat':moment()[_0xec73('0xfe')](_0x5f5c4e[_0xec73('0x19e')],_0xec73('0xf9'))[_0xec73('0x92')](_0xec73('0xff')),'ContactId':_0x211e5e[_0xec73('0xd1')],'ListId':_0x211e5e[_0xec73('0x112')],'VoiceQueueId':_0x211e5e[_0xec73('0xd3')]||undefined,'CampaignId':_0x211e5e['CampaignId']||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x19f')));break;case 0x0:if(_0x211e5e[_0xec73('0xee')]>=_0x5f5c4e[_0xec73('0x1a0')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x211e5e[_0xec73('0xee')]+=0x1,'scheduledat':moment()[_0xec73('0xfe')](_0x5f5c4e[_0xec73('0x1a1')],'minutes')[_0xec73('0x92')](_0xec73('0xff')),'ContactId':_0x211e5e[_0xec73('0xd1')],'ListId':_0x211e5e[_0xec73('0x112')],'VoiceQueueId':_0x211e5e[_0xec73('0xd3')]||undefined,'CampaignId':_0x211e5e[_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x1a2')));}break;case 0xa:if(_0x211e5e['countdropretry']>=_0x5f5c4e[_0xec73('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x211e5e['countdropretry']+=0x1,'scheduledat':moment()[_0xec73('0xfe')](_0x5f5c4e[_0xec73('0x111')],_0xec73('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x211e5e[_0xec73('0xd1')],'ListId':_0x211e5e[_0xec73('0x112')],'VoiceQueueId':_0x211e5e['VoiceQueueId']||undefined,'CampaignId':_0x211e5e[_0xec73('0xd4')]||undefined})['catch'](loggerCatch(_0xec73('0x113')));break;case 0xb:if(_0x211e5e[_0xec73('0xf0')]>=_0x5f5c4e[_0xec73('0x119')]-0x1){return!![];}this[_0xec73('0xbb')]({'active':![],'countabandonedretry':_0x211e5e[_0xec73('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x5f5c4e[_0xec73('0x11a')],_0xec73('0xf9'))[_0xec73('0x92')](_0xec73('0xff')),'ContactId':_0x211e5e[_0xec73('0xd1')],'ListId':_0x211e5e['ListId'],'VoiceQueueId':_0x211e5e[_0xec73('0xd3')]||undefined,'CampaignId':_0x211e5e[_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x211e5e['countmachineretry']>=_0x5f5c4e[_0xec73('0xf5')]-0x1){return!![];}this[_0xec73('0xbb')]({'active':![],'countmachineretry':_0x211e5e[_0xec73('0xea')]+=0x1,'scheduledat':moment()[_0xec73('0xfe')](_0x5f5c4e[_0xec73('0xf8')],_0xec73('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x211e5e['ContactId'],'ListId':_0x211e5e[_0xec73('0x112')],'VoiceQueueId':_0x211e5e[_0xec73('0xd3')]||undefined,'CampaignId':_0x211e5e[_0xec73('0xd4')]||undefined})['catch'](loggerCatch(_0xec73('0x100')));break;case 0x14:if(_0x211e5e[_0xec73('0xf1')]>=_0x5f5c4e['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x211e5e[_0xec73('0xf1')]+=0x1,'scheduledat':moment()[_0xec73('0xfe')](_0x5f5c4e[_0xec73('0x1a4')],_0xec73('0xf9'))[_0xec73('0x92')](_0xec73('0xff')),'ContactId':_0x211e5e['ContactId'],'ListId':_0x211e5e[_0xec73('0x112')],'VoiceQueueId':_0x211e5e[_0xec73('0xd3')]||undefined,'CampaignId':_0x211e5e[_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x1a5')));break;default:return!![];}};Dialer[_0xec73('0x18')][_0xec73('0x194')]=function(_0x2289bc,_0x4fe777,_0x5b0dc9){var _0x10b549=this;var _0x5c0ee8=new History(_0x2289bc);return new BPromise(function(_0x9161f8,_0x186d72){if(_['isUndefined'](_0x4fe777)&&typeof _0x4fe777!==_0xec73('0x161')){return _0x186d72(msgResponse(_0xec73('0x1a6'),_0xec73('0x13d'),'entity\x20is\x20undefine'));}if(_[_0xec73('0x3c')](_0x5b0dc9)&&typeof _0x5b0dc9!==_0xec73('0x161')){return _0x186d72(msgResponse('[callProgressDetecting]','Failure',_0xec73('0x1a7')));}switch(_0x5b0dc9[_0xec73('0x105')]){case'0':_0x4fe777[_0xec73('0x61')]+=0x1;_0x5c0ee8[_0xec73('0xa5')]=0x0;_0x5c0ee8[_0xec73('0xa6')]=_0xec73('0x1a8');_0x5c0ee8[_0xec73('0xee')]+=0x1;_0x5c0ee8[_0xec73('0xeb')]+=0x1;ami[_0xec73('0x4a')]('custom:agentnosuchnumber',ut['buildObj'](_0x2289bc,_0xec73('0x1a9')));_0x10b549[_0xec73('0xc8')](_0x5c0ee8)['catch'](loggerCatch(_0xec73('0xfd')));if(_0x10b549['checkRetriveMax'](0x0,_0x2289bc,_0x4fe777)){if(_0x5c0ee8[_0xec73('0xee')]>=_0x4fe777[_0xec73('0x1a0')]){_0x10b549[_0xec73('0xf6')](_0x5c0ee8,_0x9161f8,_0x186d72,'reason\x200\x20no\x20such\x20number....');}else{_0x10b549['stateGlobal'](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1aa'));}}break;case'3':_0x4fe777['outboundNoAnswerCallsDay']+=0x1;_0x5c0ee8['state']=0x3;_0x5c0ee8[_0xec73('0xa6')]=_0xec73('0x1ab');_0x5c0ee8[_0xec73('0x197')]+=0x1;_0x5c0ee8[_0xec73('0xeb')]+=0x1;ami[_0xec73('0x4a')](_0xec73('0x1ac'),ut['buildObj'](_0x2289bc,_0xec73('0x1ad')));_0x10b549[_0xec73('0xc8')](_0x5c0ee8)[_0xec73('0xad')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x10b549[_0xec73('0x196')](0x3,_0x2289bc,_0x4fe777)){if(_0x5c0ee8[_0xec73('0x197')]>=_0x4fe777[_0xec73('0x198')]){_0x10b549[_0xec73('0xf6')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1ae'));}else{_0x10b549[_0xec73('0xf3')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1ae'));}}break;case'5':_0x4fe777[_0xec73('0x5b')]+=0x1;_0x5c0ee8['state']=0x5;_0x5c0ee8[_0xec73('0xa6')]=_0xec73('0x1af');_0x5c0ee8[_0xec73('0xec')]+=0x1;_0x5c0ee8[_0xec73('0xeb')]+=0x1;ami[_0xec73('0x4a')](_0xec73('0x1b0'),ut['buildObj'](_0x2289bc,'busy'));_0x10b549[_0xec73('0xc8')](_0x5c0ee8)[_0xec73('0xad')](loggerCatch(_0xec73('0x1b1')));if(_0x10b549[_0xec73('0x196')](0x5,_0x2289bc,_0x4fe777)){if(_0x5c0ee8['countbusyretry']>=_0x4fe777[_0xec73('0x19b')]){_0x10b549[_0xec73('0xf6')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1b2'));}else{_0x10b549[_0xec73('0xf3')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1b2'));}}break;case'8':_0x4fe777[_0xec73('0x5c')]+=0x1;_0x5c0ee8[_0xec73('0xa5')]=0x8;_0x5c0ee8[_0xec73('0xa6')]='Congestion';_0x5c0ee8[_0xec73('0xed')]+=0x1;_0x5c0ee8[_0xec73('0xeb')]+=0x1;ami[_0xec73('0x4a')]('custom:agentcongestion',ut[_0xec73('0xe4')](_0x2289bc,_0xec73('0x1b3')));_0x10b549[_0xec73('0xc8')](_0x5c0ee8)[_0xec73('0xad')](loggerCatch(_0xec73('0x1b4')));if(_0x10b549[_0xec73('0x196')](0x8,_0x2289bc,_0x4fe777)){if(_0x5c0ee8[_0xec73('0xed')]>=_0x4fe777['dialCongestionMaxRetry']){_0x10b549[_0xec73('0xf6')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1b5'));}else{_0x10b549[_0xec73('0xf3')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1b5'));}}break;case'11':_0x4fe777[_0xec73('0x1b6')]+=0x1;_0x5c0ee8['state']=0xb;_0x5c0ee8[_0xec73('0xa6')]=_0xec73('0x117');_0x5c0ee8['countabandonedretry']+=0x1;_0x5c0ee8[_0xec73('0xeb')]+=0x1;_0x10b549['createHistory'](_0x5c0ee8)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x10b549[_0xec73('0x196')](0xb,_0x2289bc,_0x4fe777)){if(_0x5c0ee8['countabandonedretry']>=_0x4fe777['dialAbandonedMaxRetry']){_0x10b549[_0xec73('0xf6')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1b7'));}else{_0x10b549[_0xec73('0xf3')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1b7'));}}break;case'20':_0x4fe777['outboundRejectCallsDay']+=0x1;_0x5c0ee8[_0xec73('0xa5')]=0x14;_0x5c0ee8[_0xec73('0xa6')]=_0xec73('0x1b8');_0x5c0ee8[_0xec73('0xf1')]+=0x1;_0x5c0ee8[_0xec73('0xeb')]+=0x1;ami[_0xec73('0x4a')](_0xec73('0x1b9'),ut[_0xec73('0xe4')](_0x2289bc,_0xec73('0x1ba')));_0x10b549['createHistory'](_0x5c0ee8)[_0xec73('0xad')](loggerCatch(_0xec73('0x1bb')));if(_0x10b549[_0xec73('0x196')](0x14,_0x2289bc,_0x4fe777)){if(_0x5c0ee8['countagentrejectretry']>=_0x4fe777[_0xec73('0x1bc')]){_0x10b549[_0xec73('0xf6')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1bd'));}else{_0x10b549[_0xec73('0xf3')](_0x5c0ee8,_0x9161f8,_0x186d72,_0xec73('0x1bd'));}}break;default:_0x4fe777[_0xec73('0x65')]+=0x1;_0x5c0ee8[_0xec73('0xa5')]=0xc;_0x5c0ee8[_0xec73('0xa6')]=_0x5b0dc9['reason'];_0x10b549[_0xec73('0xc8')](_0x5c0ee8)[_0xec73('0xad')](loggerCatch(_0xec73('0x1be')));if(_0x10b549[_0xec73('0x196')](_0x5b0dc9['reason'],_0x2289bc,_0x4fe777)){if(_0x5c0ee8[_0xec73('0xec')]+_0x5c0ee8[_0xec73('0xed')]+_0x5c0ee8['countnoanswerretry']+_0x5c0ee8[_0xec73('0xee')]+_0x5c0ee8[_0xec73('0xef')]+_0x5c0ee8[_0xec73('0xf0')]+_0x5c0ee8[_0xec73('0xea')]+_0x5c0ee8[_0xec73('0xf1')]>=_0x4fe777['dialGlobalMaxRetry']){_0x10b549['stateGlobal'](_0x5c0ee8,_0x9161f8,_0x186d72,_0x5b0dc9[_0xec73('0x105')]);}else{_0x10b549['createStateFinal'](_0x5c0ee8,_0x9161f8,_0x186d72,_0x5b0dc9[_0xec73('0x105')]);}}}});};Dialer[_0xec73('0x18')]['stateGlobal']=function(_0x418b47,_0x102123,_0x58519f,_0x3385e7){var _0x27ec4a=new Final(_0x418b47);_0x27ec4a[_0xec73('0xa5')]=0xf;_0x27ec4a['statedesc']=_0xec73('0x1bf');this['createStateFinal'](_0x27ec4a,_0x102123,_0x58519f,_0x3385e7);};Dialer['prototype']['createStateFinal']=function(_0x4d0330,_0x45a500,_0x18e68f,_0x4dc99a){this[_0xec73('0xc6')](_0x4d0330)['then'](function(){return _0x45a500(msgResponse('[callProgressDetecting]',_0xec73('0xd7'),_0x4dc99a));})['catch'](function(){return _0x18e68f(msgResponse('[moveContactManagedDialer][0]','Failure',_0xec73('0x1c0')));});};Dialer['prototype'][_0xec73('0x7')]=function(_0xd55e58){var _0x38bb28=_0xd55e58[_0xec73('0x1c1')]/0x64;var _0x3efb22=_0xd55e58[_0xec73('0x5f')]/(_0xd55e58[_0xec73('0x5f')]+_0xd55e58[_0xec73('0x59')]);var _0x30a294=Math[_0xec73('0x1c2')](_0xd55e58[_0xec73('0x6e')]*(_0xd55e58[_0xec73('0x1c3')]/0x64));var _0x18cebe=Math[_0xec73('0x1c2')](_0xd55e58[_0xec73('0x6e')]*(_0xd55e58[_0xec73('0x1c4')]/0x64));var _0x5485b5=_0xd55e58['available']+_0xd55e58['talking'];var _0x3cdbd7=Math[_0xec73('0x1c5')](_0xd55e58[_0xec73('0x88')]*_0xd55e58[_0xec73('0x8a')]*_0xd55e58[_0xec73('0x6b')]*_0xd55e58[_0xec73('0x6c')]);if(_[_0xec73('0x3c')](_0xd55e58[_0xec73('0x27')])){if(!_[_0xec73('0x3c')](_0xd55e58[_0xec73('0x72')])){_0xd55e58[_0xec73('0x72')]=undefined;loggerPredictive[_0xec73('0x94')](_0xec73('0x1c6'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xec73('0x3c')](_0xd55e58[_0xec73('0x8f')])){loggerPredictive[_0xec73('0x94')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0xd55e58[_0xec73('0x8f')]);_0xd55e58[_0xec73('0x8f')]=undefined;}_0xd55e58[_0xec73('0x27')]=moment()['format'](_0xec73('0xff'));loggerPredictive[_0xec73('0x7a')](_0xd55e58[_0xec73('0x3f')],_0xec73('0x1c7'),_0xd55e58[_0xec73('0x27')]);this[_0xec73('0x153')](_0xd55e58,0x1);}else if(ifInterval(_0xd55e58[_0xec73('0x1c8')],_0xd55e58['startProgressive'])){this[_0xec73('0x153')](_0xd55e58,0x1);loggerPredictiveCalls[_0xec73('0x7a')](_0xec73('0x1c9'),_0xd55e58['startProgressive'],_0xd55e58[_0xec73('0x3f')]);_0xd55e58['erlangCalls']=0x0;_0xd55e58[_0xec73('0x6a')]=0x0;}else if(_0x38bb28<_0x3efb22&&_0xd55e58[_0xec73('0x1ca')]===_0xec73('0x1cb')){freeVariablesPredictive(_0xd55e58);loggerPredictive[_0xec73('0x7a')](_0xec73('0x1cc'),_0xec73('0x1cd'),_0x3efb22,_0xec73('0x27'),_0xd55e58[_0xec73('0x3f')]);}else if(_0x3cdbd7<_0xd55e58[_0xec73('0x6a')]&&_0xd55e58[_0xec73('0x1ca')]===_0xec73('0x1cb')){freeVariablesPredictive(_0xd55e58);loggerPredictive[_0xec73('0x7a')](_0xec73('0x1ce'),_0xec73('0x1cf'),_0x3cdbd7,_0xec73('0x1d0'),_0xd55e58[_0xec73('0x6a')],_0xec73('0x27'),_0xd55e58[_0xec73('0x3f')]);}else if(!ifInterval(_0xd55e58[_0xec73('0x1c8')],_0xd55e58[_0xec73('0x27')])&&_[_0xec73('0x3c')](_0xd55e58[_0xec73('0x72')])&&!_[_0xec73('0x3c')](_0xd55e58[_0xec73('0x27')])){_0xd55e58[_0xec73('0x72')]=moment()[_0xec73('0x92')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0xd55e58[_0xec73('0x3f')],_0xec73('0x1d1'),_0xd55e58['startPredictive']);this[_0xec73('0xb8')](_0xd55e58[_0xec73('0x1c8')])['then'](this[_0xec73('0x1d2')](_0xd55e58))[_0xec73('0xb3')](mergeDataErlangB(_0xd55e58))[_0xec73('0xb3')](this['startMethodPredictive'](_0xd55e58))[_0xec73('0xad')](loggerCatchPredictive(_0xec73('0x1d3'),_0xd55e58));}else if(!ifInterval(_0xd55e58[_0xec73('0x1c8')],_0xd55e58[_0xec73('0x72')])){_0xd55e58['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0xd55e58[_0xec73('0x72')]=moment()[_0xec73('0x92')](_0xec73('0xff'));loggerPredictive[_0xec73('0x7a')](_0xd55e58[_0xec73('0x3f')],_0xec73('0x1d4'),_0xd55e58['startPredictive']);clearInterval(_0xd55e58['handlePredictive']);_0xd55e58[_0xec73('0x8f')]=undefined;this[_0xec73('0xb8')](_0xd55e58[_0xec73('0x1c8')])[_0xec73('0xb3')](this[_0xec73('0x1d2')](_0xd55e58))['then'](mergeDataErlangB(_0xd55e58))[_0xec73('0xb3')](this[_0xec73('0x1d5')](_0xd55e58))['catch'](loggerCatchPredictive(_0xec73('0x1d6'),_0xd55e58));}else if(_0xd55e58[_0xec73('0x6e')]&&_0x5485b5<_0xd55e58[_0xec73('0x6e')]-_0x18cebe){freeVariablesPredictive(_0xd55e58);loggerPredictive['info'](_0xd55e58[_0xec73('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5485b5,_0xec73('0x1d7'),_0xd55e58[_0xec73('0x6e')],'-',_0x18cebe,'=',_0xd55e58['predictiveIntervalAvailable']-_0x18cebe,')');}else if(_0xd55e58[_0xec73('0x6e')]&&_0x5485b5>_0xd55e58[_0xec73('0x6e')]+_0x30a294){freeVariablesPredictive(_0xd55e58);loggerPredictive['info'](_0xd55e58[_0xec73('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5485b5,_0xec73('0x1d8'),_0xd55e58[_0xec73('0x6e')],'+',_0x30a294,'=',_0xd55e58[_0xec73('0x6e')]+_0x30a294,')');}};Dialer['prototype']['getDataPredictive']=function(_0x20bfe4){var _0x4d9589=this;return function(_0x1d4418){return new BPromise(function(_0x229e8c,_0x3a6c19){_[_0xec73('0xcf')](_0x20bfe4,_0x1d4418[0x0]);if(checkGetDataPredictive(_0x1d4418[0x0])){var _0x47457e=_0x20bfe4[_0xec73('0x6e')]=_0x20bfe4[_0xec73('0x4f')]+_0x20bfe4[_0xec73('0x9f')];var _0xdec35e=_0x20bfe4[_0xec73('0x1c8')]*0x3c;var _0x34554f=_0x1d4418[0x0][_0xec73('0x66')]+_0x1d4418[0x0][_0xec73('0x84')];var _0x50544f=(_0x1d4418[0x0][_0xec73('0x7e')]+_0x1d4418[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1d4418[0x0][_0xec73('0x67')])/_0x1d4418[0x0][_0xec73('0x7c')];_0x20bfe4[_0xec73('0x6b')]=_0x50544f>0x0?_0x50544f:0x1;switch(_0x20bfe4[_0xec73('0x1ca')]){case _0xec73('0x1cb'):var _0x4ef477=_0x20bfe4[_0xec73('0x1c1')]/0x64;return _0x4d9589[_0xec73('0x1d9')](_0x47457e,_0xdec35e,_0x34554f,_0x50544f,_0x4ef477)[_0xec73('0xb3')](function(_0x2f8739){return _0x229e8c(_0x2f8739);});case _0xec73('0x1da'):var _0x10003f=_0x20bfe4[_0xec73('0x1c1')]/0x64;return _0x4d9589[_0xec73('0x1db')](_0x47457e,_0xdec35e,_0x34554f,_0x50544f,_0x10003f)[_0xec73('0xb3')](function(_0x3a4f47){return _0x229e8c(_0x3a4f47);});default:return _0x3a6c19(msgResponse('[getDataPredictive]','Failure',_0xec73('0x1dc')));}}else{return _0x3a6c19(msgResponse(_0xec73('0x1dd'),_0xec73('0x13d'),_0xec73('0x1de')));}});};};Dialer['prototype'][_0xec73('0x1df')]=function(_0xe25f58){var _0x260863=this;return function(_0xc5fe42){return new BPromise(function(_0x1b1e14,_0x30006e){_['merge'](_0xe25f58,_0xc5fe42[0x0]);if(checkGetDataPredictive(_0xc5fe42[0x0])){loggerPredictive['info'](JSON[_0xec73('0x48')](_0xc5fe42[0x0]));if(_0xe25f58[_0xec73('0x1ca')]===_0xec73('0x1cb')){return _0x260863['getVoiceQueueRtPauses'](_0xe25f58['id'])[_0xec73('0xb3')](function(_0x4062d7){var _0x13b681=_0xe25f58[_0xec73('0x4d')]-_0x4062d7[0x0][_0xec73('0x1e0')];var _0x5d320b=_0xe25f58[_0xec73('0x1c8')]*0x3c;var _0x5e74d7=_0xc5fe42[0x0][_0xec73('0x66')]+_0xc5fe42[0x0][_0xec73('0x84')];var _0x555520=(_0xc5fe42[0x0][_0xec73('0x7e')]+_0xc5fe42[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xc5fe42[0x0][_0xec73('0x67')])/_0xc5fe42[0x0][_0xec73('0x7c')];var _0x564bf9=_0xe25f58[_0xec73('0x1c1')]/0x64;_0xe25f58[_0xec73('0x6d')]=_0x4062d7[0x0][_0xec73('0x1e0')]||0x0;_0xe25f58[_0xec73('0x6b')]=_0x555520>0x0?_0x555520:0x1;return _0x260863[_0xec73('0x1d9')](_0x13b681,_0x5d320b,_0x5e74d7,_0x555520,_0x564bf9);})['then'](function(_0x57ffd0){return _0x1b1e14(_0x57ffd0);})[_0xec73('0xad')](function(_0x29ce78){return _0x30006e(msgResponse(_0xec73('0x1e1'),_0xec73('0x13d'),JSON[_0xec73('0x48')](_0x29ce78)));});}if(_0xe25f58[_0xec73('0x1ca')]==='agentBusyFactor'){return _0x260863[_0xec73('0xc4')](_0xe25f58['id'])[_0xec73('0xb3')](function(_0x3a926a){var _0x4a52a5=_0xe25f58[_0xec73('0x4d')]-_0x3a926a[0x0][_0xec73('0x1e0')];var _0x2b6e26=_0xe25f58[_0xec73('0x1c8')]*0x3c;var _0x5d1290=_0xc5fe42[0x0][_0xec73('0x66')]+_0xc5fe42[0x0]['predictiveIntervalAvgHoldtime'];var _0x2c2e17=(_0xc5fe42[0x0][_0xec73('0x7e')]+_0xc5fe42[0x0][_0xec73('0x68')]+_0xc5fe42[0x0][_0xec73('0x67')])/_0xc5fe42[0x0][_0xec73('0x7c')];var _0x41e5d3=_0xe25f58[_0xec73('0x1c1')]/0x64;_0xe25f58['predictiveIntervalPauses']=_0x3a926a[0x0][_0xec73('0x1e0')]||0x0;_0xe25f58['predictiveIntervalHitRate']=_0x2c2e17>0x0?_0x2c2e17:0x1;return _0x260863[_0xec73('0x1db')](_0x4a52a5,_0x2b6e26,_0x5d1290,_0x2c2e17,_0x41e5d3);})[_0xec73('0xb3')](function(_0x57d2d5){return _0x1b1e14(_0x57d2d5);})[_0xec73('0xad')](function(_0x2cd4cc){return _0x30006e(msgResponse(_0xec73('0x1e1'),_0xec73('0x13d'),JSON['stringify'](_0x2cd4cc)));});}}else{return _0x30006e(msgResponse('[getDataPredictive]','Failure',_0xec73('0x1de')));}});};};Dialer[_0xec73('0x18')]['startMethodPredictive']=function(_0x506772){var _0x1ebfd1=this;return function(){var _0x3b2a24=0x0;var _0x12cdfa=Math[_0xec73('0x1c5')](_0x506772[_0xec73('0x70')]*0x3e8);if(_0x12cdfa>0x0){_0x12cdfa=_0x12cdfa<0x64?0x64:_0x12cdfa;loggerPredictive[_0xec73('0x7a')](_0x506772[_0xec73('0x3f')],_0xec73('0x1e2'),_0x12cdfa,_0xec73('0x49'));_0x506772[_0xec73('0x8f')]=setInterval(function(){_0x1ebfd1[_0xec73('0x8f')](_0x506772);loggerPredictiveCalls['info'](_0xec73('0x1e3'),_0x3b2a24+=0x1);},_0x12cdfa);}else{loggerPredictive[_0xec73('0x7a')](_0x506772[_0xec73('0x3f')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xec73('0x18')][_0xec73('0x1e4')]=function(_0x398335,_0x2ec6ca){var _0x4fb212=this;return function(_0x50c719){if(_['isEmpty'](_0x50c719)){if(_[_0xec73('0xdd')](_0x2ec6ca['UserId'])||!_0x2ec6ca[_0xec73('0x1e5')]){if(_0x398335[_0xec73('0x55')]===_0xec73('0x6')){_0x398335[_0xec73('0x127')]=_[_0xec73('0x3c')](_0x398335[_0xec73('0x127')])?!![]:_0x398335['queueStatusComplete'];var _0x5c84e2=uuid['v4']();_0x4fb212[_0xec73('0x24')][_0x5c84e2]=new Action(_0x398335,_0x2ec6ca,_0x5c84e2);loggerBooked[_0xec73('0x7a')](_0xec73('0x1e6'),_0x5c84e2,'queueStatusComplete:\x20',JSON[_0xec73('0x48')](_0x398335['queueStatusComplete']),_0xec73('0x1e7'),_0x398335[_0xec73('0x3f')]);if(_0x398335[_0xec73('0x127')]){_0x398335[_0xec73('0x127')]=![];_0x4fb212[_0xec73('0x29')][_0x4fb212[_0xec73('0x24')][_0x5c84e2][_0xec73('0xaf')]]=[];ami[_0xec73('0xac')]({'actionid':_0x5c84e2,'action':'queuestatus','queue':_0x398335['name']})[_0xec73('0xad')](function(){_0x4fb212[_0xec73('0xae')](_0x398335);_0x4fb212[_0xec73('0xbb')]({'active':![],'ContactId':_0x4fb212['actions'][_0x5c84e2][_0xec73('0xd1')],'ListId':_0x4fb212[_0xec73('0x24')][_0x5c84e2][_0xec73('0x112')],'VoiceQueueId':_0x4fb212[_0xec73('0x24')][_0x5c84e2]['VoiceQueueId']||undefined,'CampaignId':_0x4fb212[_0xec73('0x24')][_0x5c84e2][_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4fb212[_0xec73('0x24')][_0x5c84e2];});}else{loggerBooked[_0xec73('0x7a')](_0xec73('0x1e8'),JSON[_0xec73('0x48')](_0x398335[_0xec73('0x127')]),'Queue:\x20',_0x398335['name']);_0x4fb212['updateOriginated'](_0x398335);_0x4fb212[_0xec73('0xbb')]({'active':![],'ContactId':_0x4fb212[_0xec73('0x24')][_0x5c84e2]['ContactId'],'ListId':_0x4fb212[_0xec73('0x24')][_0x5c84e2][_0xec73('0x112')],'VoiceQueueId':_0x4fb212[_0xec73('0x24')][_0x5c84e2][_0xec73('0xd3')]||undefined,'CampaignId':_0x4fb212[_0xec73('0x24')][_0x5c84e2][_0xec73('0xd4')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4fb212['actions'][_0x5c84e2];}}else{return _0x4fb212[_0xec73('0x160')](_0x398335,_0x2ec6ca);}}else{if(getDiff(_0x2ec6ca[_0xec73('0x1e9')])<_0x398335['dialRecallMeTimeout']*0x3c){if(_0x2ec6ca[_0xec73('0x1ea')]&&!_0x2ec6ca[_0xec73('0x1ea')][_0xec73('0x1eb')]){_0x4fb212[_0xec73('0x1d')][_0xec73('0x128')](_0x2ec6ca['id'])[_0xec73('0x1b')](function(){_0x4fb212['updateOriginated'](_0x398335);});}else{_0x4fb212['unlockContact']({'active':![]},_0x2ec6ca['id'],0x1)[_0xec73('0x1b')](function(){_0x4fb212['updateOriginated'](_0x398335);});}}else{_0x398335[_0xec73('0x63')]+=0x1;_0x4fb212[_0xec73('0xae')](_0x398335);if(_0x398335[_0xec73('0x1ec')]){_0x4fb212['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ec6ca['ContactId'],'ListId':_0x2ec6ca['ListId'],'VoiceQueueId':_0x2ec6ca[_0xec73('0xd3')]||undefined,'CampaignId':_0x2ec6ca[_0xec73('0xd4')]||undefined})[_0xec73('0xad')](loggerCatch(_0xec73('0x1ed')));_0x4fb212[_0xec73('0xc8')](createObjHistory(_0x398335,_0x2ec6ca,_0xec73('0x1ee'),0x17,_0xec73('0x1ef')))[_0xec73('0xad')](loggerCatch(_0xec73('0x1f0')));}else{_0x4fb212['saveInDb'](createObjHistory(_0x398335,_0x2ec6ca,'RECALLFAILEDTIMEOUT',0x16,_0xec73('0x1f1')),_0xec73('0x1f2'),'[Originate][HistoryRecallClose]');}}}}else{_0x398335[_0xec73('0x5a')]+=0x1;_0x4fb212[_0xec73('0xce')](createObjHistory(_0x398335,_0x2ec6ca,_0xec73('0x1f3'),0xd,_0xec73('0x1f4')),_0xec73('0x1f5'),_0xec73('0x1f6'));throw'inBlackList';}};};Dialer['prototype'][_0xec73('0x156')]=function(_0x36308e){var _0x115300=this;var _0x571cd0=_0x36308e[_0xec73('0x1f7')]-_0x36308e[_0xec73('0x6f')]-_0x36308e[_0xec73('0xc0')];emitCampaignSummary(_0x36308e);if(_0x571cd0>0x0){if(_0x571cd0>this[_0xec73('0x22')]){_0x571cd0=this[_0xec73('0x22')];}_0x36308e[_0xec73('0xc0')]+=_0x571cd0;this[_0xec73('0xc2')](_0x36308e['id'],_0x571cd0,_0x36308e['dialOrderByScheduledAt'],_0x36308e)['then'](function(_0x4e700a){_0x36308e[_0xec73('0xc0')]-=_0x571cd0;_0x36308e[_0xec73('0xc0')]=_0x36308e[_0xec73('0xc0')]>0x0?_0x36308e[_0xec73('0xc0')]:0x0;if(!checkContactEmpty(_0x4e700a)){_0x36308e[_0xec73('0x3d')]=_0xec73('0x1f8');logger[_0xec73('0x7a')](_0xec73('0x1f9')+_0x36308e[_0xec73('0x3f')]);}else{_0x36308e[_0xec73('0x6f')]+=_0x4e700a[_0xec73('0x97')];_0x36308e[_0xec73('0x3d')]='RUNNING';for(var _0x5194ff=0x0;_0x5194ff<_0x4e700a['length'];_0x5194ff+=0x1){_0x36308e[_0xec73('0x1fa')]+=0x1;if(_[_0xec73('0xdd')](_0x4e700a[_0x5194ff])||_[_0xec73('0xdd')](_0x4e700a[_0x5194ff][_0xec73('0x165')])||_[_0xec73('0xdd')](_0x4e700a[_0x5194ff]['Contact'][_0xec73('0x164')])){_0x115300[_0xec73('0xcc')]('[actionOriginate]\x20',_0x36308e,_0x4e700a[_0x5194ff]);}else{_0x115300['checkIsBlackListIvr'](_[_0xec73('0xd0')](_0x4e700a[_0x5194ff],['CampaignId','Contact.phone']))[_0xec73('0xb3')](_0x115300['checkContactBlack'](_0x36308e,_0x4e700a[_0x5194ff]))['catch'](_0x115300['loggerHandler'](_0xec73('0x1fb'),_0x36308e));}}}})[_0xec73('0xad')](loggerGetContactDialer(_0xec73('0x1fc'),_0x36308e,_0x571cd0));}};Dialer[_0xec73('0x18')][_0xec73('0x153')]=function(_0x511a36,_0x524f15){var _0x234e5d=this;var _0x266a33=[];var _0x314824=_0x524f15>=0x1?_0x524f15:0x1;if(_0x511a36['dialMethod']===_0xec73('0x6')){_0x314824=0x1;}var _0x2f60c2=Math['floor'](_0x511a36[_0xec73('0x9f')]*_0x314824)-_0x511a36[_0xec73('0x6f')]-_0x511a36[_0xec73('0xc0')];emitVoiceQueueSummary(_0x511a36);if(_0x511a36[_0xec73('0x1fd')]>0x0){var _0x3a7612=_0x511a36[_0xec73('0x1fd')]-_0x511a36[_0xec73('0x6f')]-_0x511a36[_0xec73('0x4f')]-_0x511a36[_0xec73('0xc0')]-_0x511a36[_0xec73('0x4e')];if(_0x2f60c2>_0x3a7612){_0x2f60c2=_0x3a7612;}}if(_0x2f60c2>0x0){if(_0x511a36['dialMethod']===_0xec73('0x6')){_0x2f60c2=0x1;}if(_0x2f60c2>this['maxNumberOriginate']){_0x2f60c2=this[_0xec73('0x22')];}_0x511a36[_0xec73('0xc0')]+=_0x2f60c2;for(var _0x3e5bd2 in this[_0xec73('0x20')]){if(typeof this[_0xec73('0x20')][_0x3e5bd2]!=='undefined'){if(this['agents'][_0x3e5bd2]['state']==='not_inuse'&&this[_0xec73('0x20')][_0x3e5bd2]['status']===_0xec73('0xda')){_0x266a33['push'](this[_0xec73('0x20')][_0x3e5bd2]['id']);}}}this[_0xec73('0xbf')](_0x511a36['id'],_0x266a33,_0x2f60c2,_0x511a36[_0xec73('0x1fe')],_0x511a36)[_0xec73('0xb3')](function(_0x54e080){_0x511a36[_0xec73('0xc0')]-=_0x2f60c2;_0x511a36['temp']=_0x511a36['temp']>0x0?_0x511a36[_0xec73('0xc0')]:0x0;if(!checkContactEmpty(_0x54e080)){_0x234e5d[_0xec73('0xb4')](_0x511a36)[_0xec73('0xb3')](sendMessageReschedule(_0x511a36))[_0xec73('0xad')](loggerCatch(_0xec73('0xb5')));}else{_0x511a36['originated']+=_0x54e080[_0xec73('0x97')];_0x511a36['message']=_0x511a36[_0xec73('0x55')]===_0xec73('0x6')?_0xec73('0x16c'):_0xec73('0x1ff');for(var _0x7589e3=0x0;_0x7589e3<_0x54e080[_0xec73('0x97')];_0x7589e3+=0x1){if(_[_0xec73('0xdd')](_0x54e080[_0x7589e3])||_['isNil'](_0x54e080[_0x7589e3][_0xec73('0x165')])||_['isNil'](_0x54e080[_0x7589e3][_0xec73('0x165')][_0xec73('0x164')])){_0x234e5d[_0xec73('0xcc')](_0xec73('0x200'),_0x511a36,_0x54e080[_0x7589e3]);}else{_0x234e5d['checkIsBlackList'](_[_0xec73('0xd0')](_0x54e080[_0x7589e3],[_0xec73('0xd3'),_0xec73('0x201')]))[_0xec73('0xb3')](_0x234e5d[_0xec73('0x1e4')](_0x511a36,_0x54e080[_0x7589e3]))[_0xec73('0xad')](_0x234e5d[_0xec73('0xcb')](_0xec73('0x200'),_0x511a36));}}}})[_0xec73('0xad')](loggerGetContactDialer('[getContactDialer2]',_0x511a36,_0x2f60c2));}};Dialer['prototype'][_0xec73('0x8f')]=function(_0x246102){if(_0x246102[_0xec73('0x1fd')]>0x0){var _0xbaefc3=_0x246102['dialLimitQueue']-_0x246102['originated']-_0x246102['talking'];if(_0xbaefc3>0x0){this['tryOriginatePredictive'](_0x246102);}else{loggerPredictiveCalls[_0xec73('0x7a')](_0xec73('0x202'));}}else{this[_0xec73('0x203')](_0x246102);}};Dialer[_0xec73('0x18')]['tryOriginatePredictive']=function(_0xbd0d25){var _0x13f547=this;var _0x549db9=[];_0xbd0d25[_0xec73('0x6f')]+=0x1;for(var _0x5ca5d8 in this[_0xec73('0x20')]){if(typeof this[_0xec73('0x20')][_0x5ca5d8]!==_0xec73('0xab')){if(this[_0xec73('0x20')][_0x5ca5d8][_0xec73('0xa5')]===_0xec73('0x204')&&this[_0xec73('0x20')][_0x5ca5d8][_0xec73('0xd9')]===_0xec73('0xda')){_0x549db9['push'](this[_0xec73('0x20')][_0x5ca5d8]['id']);}}}this[_0xec73('0xbf')](_0xbd0d25['id'],_0x549db9,0x1,_0xbd0d25[_0xec73('0x1fe')],_0xbd0d25)[_0xec73('0xb3')](function(_0x2ceaab){if(!checkContactEmpty(_0x2ceaab)){checkContactLowerLimitOriginate(_0xbd0d25,0x1,0x0);_0x13f547[_0xec73('0xb4')](_0xbd0d25)[_0xec73('0xb3')](sendMessageReschedule(_0xbd0d25))[_0xec73('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0xbd0d25[_0xec73('0x3d')]=_0xec73('0x1ff');if(_[_0xec73('0xdd')](_0x2ceaab[0x0])||_['isNil'](_0x2ceaab[0x0][_0xec73('0x165')])||_[_0xec73('0xdd')](_0x2ceaab[0x0][_0xec73('0x165')]['phone'])){_0x13f547[_0xec73('0xcc')](_0xec73('0x200'),_0xbd0d25,_0x2ceaab[0x0]);}else{_0x13f547[_0xec73('0xb6')](_[_0xec73('0xd0')](_0x2ceaab[0x0],[_0xec73('0xd3'),_0xec73('0x201')]))['then'](_0x13f547['checkContactBlack'](_0xbd0d25,_0x2ceaab[0x0]))[_0xec73('0xad')](_0x13f547['loggerHandler'](_0xec73('0x205'),_0xbd0d25));}}})[_0xec73('0xad')](loggerGetContactDialer('[getContactDialerPredictive]',_0xbd0d25,0x1));emitVoiceQueueSummary(_0xbd0d25);};Dialer['prototype']['abandonmentRate']=function(_0x500d56,_0x38b750,_0x16e52e,_0x50af97,_0x37fea3,_0x8b1a75){loggerPredictive[_0xec73('0x7a')](_0xec73('0x206'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x500d56);loggerPredictive['info'](_0xec73('0x207'),_0x38b750);loggerPredictive[_0xec73('0x7a')](_0xec73('0x208'),_0x16e52e);loggerPredictive[_0xec73('0x7a')](_0xec73('0x209'),_0x50af97);loggerPredictive[_0xec73('0x7a')](_0xec73('0x20a'),_0x37fea3);loggerPredictive['info'](_0xec73('0x83'));return new BPromise(function(_0x5af285,_0x2373b6){if(_0x500d56<=0x0||isNaN(_0x500d56)){return _0x2373b6(msgResponse(_0xec73('0x20b'),_0xec73('0x47'),_0xec73('0x20c')+_0x500d56));}if(_0x16e52e<=0x0||isNaN(_0x16e52e)){return _0x2373b6(msgResponse(_0xec73('0x20b'),_0xec73('0x47'),_0xec73('0x20d')+_0x16e52e));}if(_0x50af97<=0x0||isNaN(_0x50af97)){return _0x2373b6(msgResponse(_0xec73('0x20b'),_0xec73('0x47'),_0xec73('0x20e')+_0x50af97));}if(_0x38b750<=0x0||isNaN(_0x38b750)){return _0x2373b6(msgResponse(_0xec73('0x20b'),_0xec73('0x47'),_0xec73('0x20f')+_0x38b750));}if(_0x37fea3<=0x0||isNaN(_0x37fea3)){return _0x2373b6(msgResponse(_0xec73('0x20b'),'Error','Amax\x20=\x20'+_0x37fea3));}_0x8b1a75=_0x8b1a75||0x0;var _0xb937ba=0x1/_0x16e52e;var _0x1c7815=0x0;var _0x33067d=0x0;var _0x3102ee=0x0;var _0x36323a=0x0;for(var _0x260a7c=0x0;_0x3102ee<_0x37fea3;_0x260a7c+=0x1){_0x33067d=_0x260a7c/_0x38b750;_0x1c7815=(_0x50af97*_0x33067d+_0x8b1a75)/_0xb937ba;_0x3102ee=erlangb(_0x1c7815,_0x500d56);_0x36323a=_0x1c7815/_0x500d56*(0x1-erlangb(_0x1c7815,_0x500d56));}return _0x5af285({'erlangCalls':_0x260a7c,'erlangCallToSecond':_0x38b750/_0x260a7c,'erlangAbandonmentRate':_0x3102ee,'erlangBusyFactor':_0x36323a});});};Dialer[_0xec73('0x18')]['busyFactor']=function(_0x550aa4,_0xd2ca8c,_0x1a5891,_0x10d415,_0xb7aaef,_0x2d6b56){loggerPredictive[_0xec73('0x7a')](_0xec73('0x210'));loggerPredictive[_0xec73('0x7a')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x550aa4);loggerPredictive[_0xec73('0x7a')](_0xec73('0x207'),_0xd2ca8c);loggerPredictive[_0xec73('0x7a')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1a5891);loggerPredictive[_0xec73('0x7a')](_0xec73('0x209'),_0x10d415);loggerPredictive[_0xec73('0x7a')](_0xec73('0x211'),_0xb7aaef);loggerPredictive[_0xec73('0x7a')](_0xec73('0x83'));return new BPromise(function(_0x101c62,_0x426a1d){if(_0x550aa4<=0x0||isNaN(_0x550aa4)){return _0x426a1d(msgResponse(_0xec73('0x212'),'Error',_0xec73('0x20c')+_0x550aa4));}if(_0x1a5891<=0x0||isNaN(_0x1a5891)){return _0x426a1d(msgResponse(_0xec73('0x212'),'Error',_0xec73('0x20d')+_0x1a5891));}if(_0x10d415<=0x0||isNaN(_0x10d415)){return _0x426a1d(msgResponse('[busyFactor]','Error',_0xec73('0x20e')+_0x10d415));}if(_0xd2ca8c<=0x0||isNaN(_0xd2ca8c)){return _0x426a1d(msgResponse(_0xec73('0x212'),_0xec73('0x47'),_0xec73('0x20f')+_0xd2ca8c));}if(_0xb7aaef<=0x0||isNaN(_0xb7aaef)){return _0x426a1d(msgResponse(_0xec73('0x212'),'Error',_0xec73('0x213')+_0xb7aaef));}_0x2d6b56=_0x2d6b56||0x0;var _0x1c9190=0x1/_0x1a5891;var _0x12acb9=0x0;var _0x24ca24=0x0;var _0x149a5e=0x0;var _0x5e9de2=0x0;for(var _0x475c10=0x0;_0x5e9de2<_0xb7aaef;_0x475c10+=0x1){_0x24ca24=_0x475c10/_0xd2ca8c;_0x12acb9=(_0x10d415*_0x24ca24+_0x2d6b56)/_0x1c9190;_0x149a5e=erlangb(_0x12acb9,_0x550aa4);_0x5e9de2=_0x12acb9/_0x550aa4*(0x1-erlangb(_0x12acb9,_0x550aa4));}return _0x101c62({'erlangCalls':_0x475c10,'erlangCallToSecond':_0xd2ca8c/_0x475c10,'erlangAbandonmentRate':_0x149a5e,'erlangBusyFactor':_0x5e9de2});});};module[_0xec73('0x214')]=Dialer;
\ No newline at end of file
index b11445f..5207c56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4e6=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x2f28b4,_0x20fe04){var _0x265505=function(_0x36d867){while(--_0x36d867){_0x2f28b4['push'](_0x2f28b4['shift']());}};_0x265505(++_0x20fe04);}(_0xf4e6,0x9d));var _0x6f4e=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0xf4e6[_0x4b03c9];return _0x161ba2;};'use strict';var util=require(_0x6f4e('0x0'));var _=require(_0x6f4e('0x1'));var moment=require('moment');function getSeconds(_0x13dc5c,_0x126c52){var _0x5a4b30=moment(_0x13dc5c)[_0x6f4e('0x2')](0x0);var _0x5a6b66=moment(_0x126c52)['milliseconds'](0x0);return _0x5a4b30[_0x6f4e('0x3')](_0x5a6b66,'seconds');}function QueueCallerAbandon(_0x4e186b,_0x16a78b){this[_0x6f4e('0x4')]=_0x4e186b[_0x6f4e('0x4')];this[_0x6f4e('0x5')]=_0x4e186b[_0x6f4e('0x5')];this[_0x6f4e('0x6')]=_0x4e186b[_0x6f4e('0x5')]===_0x6f4e('0x7')?_0x6f4e('0x8'):_0x4e186b[_0x6f4e('0x5')];this[_0x6f4e('0x9')]=_0x4e186b[_0x6f4e('0x9')];this['countcongestionretry']=_0x4e186b['countcongestionretry'];this['countnoanswerretry']=_0x4e186b[_0x6f4e('0xa')];this[_0x6f4e('0xb')]=_0x4e186b[_0x6f4e('0x9')]+_0x4e186b['countcongestionretry']+_0x4e186b['countnoanswerretry']+_0x4e186b['countnosuchnumberretry']+_0x4e186b[_0x6f4e('0xc')]+_0x4e186b['countabandonedretry']+_0x4e186b[_0x6f4e('0xd')]+_0x4e186b['countagentrejectretry'];this[_0x6f4e('0xe')]=_0x4e186b[_0x6f4e('0xe')];this['countdropretry']=_0x4e186b[_0x6f4e('0xc')];this[_0x6f4e('0xf')]=_0x4e186b[_0x6f4e('0xf')];this[_0x6f4e('0xd')]=_0x4e186b[_0x6f4e('0xd')];this[_0x6f4e('0x10')]=_0x4e186b[_0x6f4e('0x10')];this['uniqueid']=_0x16a78b['uniqueid'];this[_0x6f4e('0x11')]=_0x4e186b['name'];this[_0x6f4e('0x12')]=_0x4e186b[_0x6f4e('0x13')];this[_0x6f4e('0x14')]=_0x4e186b[_0x6f4e('0x14')];this[_0x6f4e('0x15')]=_0x4e186b[_0x6f4e('0x15')];this['droptime']=_0x4e186b[_0x6f4e('0x16')];this[_0x6f4e('0x17')]=this[_0x6f4e('0x16')];this['ringtime']=getSeconds(_0x4e186b[_0x6f4e('0x15')],_0x4e186b['starttime']);this[_0x6f4e('0x18')]=getSeconds(this['droptime'],_0x4e186b[_0x6f4e('0x15')]);this[_0x6f4e('0x19')]=0x0;this[_0x6f4e('0x8')]=_0x16a78b[_0x6f4e('0x8')];this['membername']=_0x16a78b[_0x6f4e('0x1a')];this[_0x6f4e('0x1b')]=_0x16a78b[_0x6f4e('0x1b')];this[_0x6f4e('0x1c')]=_0x4e186b[_0x6f4e('0x1c')];this[_0x6f4e('0x1d')]=_0x4e186b[_0x6f4e('0x1d')];this['callbackat']=_0x4e186b[_0x6f4e('0x1e')];this[_0x6f4e('0x1f')]=_0x4e186b[_0x6f4e('0x1f')];this[_0x6f4e('0x20')]=_0x4e186b[_0x6f4e('0x20')];this[_0x6f4e('0x21')]=_0x4e186b[_0x6f4e('0x21')];this['UserId']=_0x4e186b[_0x6f4e('0x22')];this['VoiceQueueId']=_0x4e186b[_0x6f4e('0x23')];this[_0x6f4e('0x24')]=_0x4e186b[_0x6f4e('0x24')];this[_0x6f4e('0x25')]=_0x4e186b['originatecalleridnum']||'';this['originatecalleridname']=_0x4e186b['originatecalleridname']||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
+var _0x9273=['starttime','droptime','ringtime','responsetime','holdtime','queue','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number'];(function(_0x172111,_0x4f517a){var _0x41d612=function(_0x2c6d66){while(--_0x2c6d66){_0x172111['push'](_0x172111['shift']());}};_0x41d612(++_0x4f517a);}(_0x9273,0x163));var _0x3927=function(_0x4d3754,_0x403267){_0x4d3754=_0x4d3754-0x0;var _0xf50ec1=_0x9273[_0x4d3754];return _0xf50ec1;};'use strict';var util=require(_0x3927('0x0'));var _=require(_0x3927('0x1'));var moment=require(_0x3927('0x2'));function getSeconds(_0x503c22,_0x41b0b5){var _0x3784b2=moment(_0x503c22)['milliseconds'](0x0);var _0x4a680f=moment(_0x41b0b5)[_0x3927('0x3')](0x0);return _0x3784b2[_0x3927('0x4')](_0x4a680f,_0x3927('0x5'));}function QueueCallerAbandon(_0x2d71df,_0x4b4e67){this[_0x3927('0x6')]=_0x2d71df[_0x3927('0x6')];this['type']=_0x2d71df[_0x3927('0x7')];this[_0x3927('0x8')]=_0x2d71df[_0x3927('0x7')]===_0x3927('0x9')?'queue':_0x2d71df['type'];this['countbusyretry']=_0x2d71df[_0x3927('0xa')];this[_0x3927('0xb')]=_0x2d71df[_0x3927('0xb')];this['countnoanswerretry']=_0x2d71df[_0x3927('0xc')];this[_0x3927('0xd')]=_0x2d71df['countbusyretry']+_0x2d71df[_0x3927('0xb')]+_0x2d71df[_0x3927('0xc')]+_0x2d71df[_0x3927('0xe')]+_0x2d71df[_0x3927('0xf')]+_0x2d71df[_0x3927('0x10')]+_0x2d71df[_0x3927('0x11')]+_0x2d71df[_0x3927('0x12')];this[_0x3927('0xe')]=_0x2d71df[_0x3927('0xe')];this[_0x3927('0xf')]=_0x2d71df[_0x3927('0xf')];this[_0x3927('0x10')]=_0x2d71df[_0x3927('0x10')];this[_0x3927('0x11')]=_0x2d71df['countmachineretry'];this['countagentrejectretry']=_0x2d71df[_0x3927('0x12')];this[_0x3927('0x13')]=_0x4b4e67[_0x3927('0x13')];this[_0x3927('0x14')]=_0x2d71df['name'];this[_0x3927('0x15')]=_0x2d71df[_0x3927('0x16')];this[_0x3927('0x17')]=_0x2d71df[_0x3927('0x17')];this['responsetime']=_0x2d71df['responsetime'];this[_0x3927('0x18')]=_0x2d71df[_0x3927('0x18')];this['endtime']=this[_0x3927('0x18')];this[_0x3927('0x19')]=getSeconds(_0x2d71df[_0x3927('0x1a')],_0x2d71df[_0x3927('0x17')]);this[_0x3927('0x1b')]=getSeconds(this[_0x3927('0x18')],_0x2d71df[_0x3927('0x1a')]);this['talktime']=0x0;this[_0x3927('0x1c')]=_0x4b4e67[_0x3927('0x1c')];this[_0x3927('0x1d')]=_0x4b4e67['connectedlinename'];this['reason']=_0x4b4e67[_0x3927('0x1e')];this[_0x3927('0x1f')]=_0x2d71df[_0x3927('0x1f')];this['callbackuniqueid']=_0x2d71df[_0x3927('0x20')];this['callbackat']=_0x2d71df['callbackat'];this[_0x3927('0x21')]=_0x2d71df[_0x3927('0x21')];this['ContactId']=_0x2d71df[_0x3927('0x22')];this[_0x3927('0x23')]=_0x2d71df[_0x3927('0x23')];this[_0x3927('0x24')]=_0x2d71df[_0x3927('0x24')];this[_0x3927('0x25')]=_0x2d71df[_0x3927('0x25')];this[_0x3927('0x26')]=_0x2d71df[_0x3927('0x26')];this[_0x3927('0x27')]=_0x2d71df['originatecalleridnum']||'';this[_0x3927('0x28')]=_0x2d71df[_0x3927('0x28')]||'';}module[_0x3927('0x29')]=QueueCallerAbandon;
\ No newline at end of file
index 03960ab..cb503cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2983c9,_0x129ade){var _0x4b46c2=function(_0x3a7685){while(--_0x3a7685){_0x2983c9['push'](_0x2983c9['shift']());}};_0x4b46c2(++_0x129ade);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x43d8be,_0x5d5e50){var _0x4adaac=function(_0x2a89fc){while(--_0x2a89fc){_0x43d8be['push'](_0x43d8be['shift']());}};_0x4adaac(++_0x5d5e50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index 98fd71d..7312c8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373d=['dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','newstate','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','\x20receiveFax\x20','stringify','merge','pick','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','then','%s/%s.tif'];(function(_0x48b77d,_0x4f4cb2){var _0x2f60a1=function(_0x906f4b){while(--_0x906f4b){_0x48b77d['push'](_0x48b77d['shift']());}};_0x2f60a1(++_0x4f4cb2);}(_0x373d,0x1e2));var _0xd373=function(_0x8baa0b,_0x24b3fa){_0x8baa0b=_0x8baa0b-0x0;var _0x5ebdb9=_0x373d[_0x8baa0b];return _0x5ebdb9;};'use strict';var util=require(_0xd373('0x0'));var _=require('lodash');var BPromise=require(_0xd373('0x1'));var uuid=require(_0xd373('0x2'));var moment=require(_0xd373('0x3'));var path=require(_0xd373('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xd373('0x5'));var logger=require(_0xd373('0x6'))(_0xd373('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xd373('0x8'));var ut=require(_0xd373('0x9'));var Action=require(_0xd373('0xa'));var faxAccount=require(_0xd373('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xd373('0xc'));function Fax(_0x51c074){this['channels']={};this['faxAccounts']=_0x51c074[_0xd373('0xd')];this[_0xd373('0xe')]=_0x51c074['trunks'];this[_0xd373('0xf')]={};ami['on'](_0xd373('0x10'),this['syncNewchannel']['bind'](this));ami['on'](_0xd373('0x11'),this[_0xd373('0x12')][_0xd373('0x13')](this));ami['on'](_0xd373('0x14'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0xd373('0x15')][_0xd373('0x13')](this));ami['on']('faxstatus',this[_0xd373('0x16')][_0xd373('0x13')](this));ami['on'](_0xd373('0x17'),this[_0xd373('0x18')][_0xd373('0x13')](this));ami['on'](_0xd373('0x19'),this[_0xd373('0x1a')][_0xd373('0x13')](this));ami['on'](_0xd373('0x1b'),this[_0xd373('0x1c')][_0xd373('0x13')](this));}Fax[_0xd373('0x1d')][_0xd373('0x1e')]=function(_0x4e5768){if(_0x4e5768[_0xd373('0x1f')]==='from-voip-provider'){for(var _0x460259 in this[_0xd373('0xd')]){if(this['faxAccounts'][_0xd373('0x20')](_0x460259)){if(_0x4e5768['exten']===this['faxAccounts'][_0x460259][_0xd373('0x21')]){this[_0xd373('0x22')][_0x4e5768[_0xd373('0x23')]]={};this[_0xd373('0x22')][_0x4e5768[_0xd373('0x23')]][_0xd373('0x24')]=_0x4e5768['channel'];this[_0xd373('0x22')][_0x4e5768[_0xd373('0x23')]]['id']=this[_0xd373('0xd')][_0x460259]['id'];this[_0xd373('0x22')][_0x4e5768[_0xd373('0x23')]][_0xd373('0x25')]=this['faxAccounts'][_0x460259][_0xd373('0x25')];logger[_0xd373('0x26')](_0x4e5768[_0xd373('0x23')],_0xd373('0x27'));}}}}if(this[_0xd373('0xf')][_0x4e5768[_0xd373('0x23')]]){this[_0xd373('0x22')][_0x4e5768[_0xd373('0x23')]]={};this[_0xd373('0x22')][_0x4e5768[_0xd373('0x23')]][_0xd373('0x24')]=_0x4e5768[_0xd373('0x24')];logger[_0xd373('0x26')](_0x4e5768[_0xd373('0x23')],_0xd373('0x27'));}};Fax[_0xd373('0x1d')][_0xd373('0x12')]=function(_0x13a012){if(this[_0xd373('0x22')][_0x13a012[_0xd373('0x23')]]){for(var _0x45ee58 in _0x13a012[_0xd373('0x28')]){if(_0x13a012[_0xd373('0x28')][_0xd373('0x20')](_0x45ee58)){this[_0xd373('0x22')][_0x13a012[_0xd373('0x23')]][_0x45ee58]=_0x13a012[_0xd373('0x29')];}}}};Fax[_0xd373('0x1d')][_0xd373('0x2a')]=function(_0x7dad3e){if(this['channels'][_0x7dad3e[_0xd373('0x23')]]){this['channels'][_0x7dad3e['uniqueid']][_0xd373('0x2b')]=_0x7dad3e[_0xd373('0x2b')];this[_0xd373('0x22')][_0x7dad3e[_0xd373('0x23')]][_0xd373('0x2c')]=_0x7dad3e['channelstatedesc'];}};Fax[_0xd373('0x1d')][_0xd373('0x15')]=function(_0x4e17c9){if(this[_0xd373('0x22')][_0x4e17c9[_0xd373('0x23')]]){for(var _0x146e24 in _0x4e17c9[_0xd373('0x28')]){if(_0x4e17c9[_0xd373('0x28')][_0xd373('0x20')](_0x146e24)){this[_0xd373('0x22')][_0x4e17c9[_0xd373('0x23')]][_0x146e24]=_0x4e17c9[_0xd373('0x29')];}}}};Fax['prototype'][_0xd373('0x16')]=function(_0x235f06){if(this[_0xd373('0x22')][_0x235f06[_0xd373('0x23')]]){this[_0xd373('0x22')][_0x235f06[_0xd373('0x23')]][_0xd373('0x2d')]=_0x235f06[_0xd373('0x2d')];this[_0xd373('0x22')][_0x235f06[_0xd373('0x23')]][_0xd373('0x2e')]=_0x235f06[_0xd373('0x2e')];this[_0xd373('0x22')][_0x235f06[_0xd373('0x23')]][_0xd373('0x21')]=_0x235f06['localstationid'];this[_0xd373('0x22')][_0x235f06[_0xd373('0x23')]][_0xd373('0x2f')]=_0x235f06[_0xd373('0x2f')];logger['info'](_0x235f06[_0xd373('0x23')],_0xd373('0x30'));}};Fax[_0xd373('0x1d')][_0xd373('0x18')]=function(_0x38d8ec){var _0x104fa6=this;if(this['channels'][_0x38d8ec['uniqueid']]){var _0x10368d=this['channels'][_0x38d8ec[_0xd373('0x23')]]['id'];this[_0xd373('0x22')][_0x38d8ec[_0xd373('0x23')]]['remotestationid']=_0x38d8ec[_0xd373('0x31')];this[_0xd373('0x22')][_0x38d8ec[_0xd373('0x23')]][_0xd373('0x32')]=_0x38d8ec['pagestransferred'];this['channels'][_0x38d8ec['uniqueid']][_0xd373('0x21')]=_0x38d8ec['localstationid'];this[_0xd373('0x22')][_0x38d8ec[_0xd373('0x23')]]['resolution']=_0x38d8ec['resolution'];this['channels'][_0x38d8ec[_0xd373('0x23')]][_0xd373('0x33')]=_0x38d8ec[_0xd373('0x33')];this['channels'][_0x38d8ec['uniqueid']][_0xd373('0x2f')]=_0x38d8ec[_0xd373('0x2f')];this['channels'][_0x38d8ec[_0xd373('0x23')]][_0xd373('0x34')]=_0x38d8ec[_0xd373('0x34')];if(this[_0xd373('0x22')][_0x38d8ec[_0xd373('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x38d8ec['filename'],_0xd373('0x35'),function(_0x37c424){logger[_0xd373('0x26')](_0x38d8ec[_0xd373('0x23')],'\x20result\x20conversion\x20file\x20',_0x37c424[_0xd373('0x36')]);attachment['create']({'name':path[_0xd373('0x37')](_0x38d8ec[_0xd373('0x2f')])[_0xd373('0x25')],'basename':path[_0xd373('0x37')](_0x38d8ec[_0xd373('0x2f')])['name']+_0xd373('0x38'),'type':_0xd373('0x39')})['then'](function(_0xd16063){faxAccount[_0xd373('0x3a')](_0x10368d,{'from':_0x38d8ec[_0xd373('0x34')],'mapKey':_0xd373('0x7'),'body':path[_0xd373('0x37')](_0x38d8ec[_0xd373('0x2f')])[_0xd373('0x25')]+_0xd373('0x38'),'AttachmentId':_0xd16063['id']})[_0xd373('0x3b')](function(_0xfcedb3){logger['error'](_0x38d8ec['uniqueid'],_0xd373('0x3c'),JSON['stringify'](_0xfcedb3));});})[_0xd373('0x3b')](function(_0x55bcd4){logger['error'](_0x38d8ec['uniqueid'],_0xd373('0x3d'),JSON[_0xd373('0x3e')](_0x55bcd4));});});}logger[_0xd373('0x26')](_0x38d8ec[_0xd373('0x23')],_0xd373('0x3d'));}};Fax[_0xd373('0x1d')][_0xd373('0x1c')]=function(_0x4d1088){if(this[_0xd373('0xf')][_0x4d1088['uniqueid']]){_[_0xd373('0x3f')](this[_0xd373('0x22')][_0x4d1088['uniqueid']],_[_0xd373('0x40')](_0x4d1088,['response',_0xd373('0x41')]));}};function updateStatus(_0x262e96){if(_0x262e96[_0xd373('0x42')]){faxMessage[_0xd373('0x43')](_0x262e96[_0xd373('0x42')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x5c76d3){ut[_0xd373('0x44')](_0xd373('0x45'),_0x5c76d3);})['catch'](function(_0x359bca){ut[_0xd373('0x44')]('[Fax][Message][Error][NoUpdate1]',_0x359bca);});}else{ut[_0xd373('0x44')](_0xd373('0x46'));}}Fax[_0xd373('0x1d')][_0xd373('0x47')]=function(_0x3b5e70,_0xa2758,_0xc255ec){var _0x43410f=this;var _0x3d1a9c={};if(_0xa2758){_0x3d1a9c={'read':_0xa2758};}else{_0x3d1a9c={'failMessage':_0xc255ec};}if(this[_0xd373('0xf')][_0x3b5e70][_0xd373('0x42')]){faxMessage['update'](this['actions'][_0x3b5e70]['AttachmentId'],_0x3d1a9c)['then'](function(_0x5a7469){ut['logger'](_0xd373('0x48'),_0x5a7469);})[_0xd373('0x3b')](function(_0x5b2ae9){ut['logger']('[Fax][Message][NoUpdate1]',_0x5b2ae9);})[_0xd373('0x49')](function(){delete _0x43410f[_0xd373('0x22')][_0x3b5e70];delete _0x43410f['actions'][_0x3b5e70];});}else{ut['logger'](_0xd373('0x4a'));delete this[_0xd373('0x22')][_0x3b5e70];delete this[_0xd373('0xf')][_0x3b5e70];}};Fax[_0xd373('0x1d')][_0xd373('0x1a')]=function(_0x59da03){var _0xf53307=this;if(this[_0xd373('0x22')][_0x59da03[_0xd373('0x23')]]){if(this[_0xd373('0xf')][_0x59da03[_0xd373('0x23')]]){this[_0xd373('0x22')][_0x59da03[_0xd373('0x23')]]['id']=this[_0xd373('0xf')][_0x59da03[_0xd373('0x23')]]['id'];this[_0xd373('0x22')][_0x59da03[_0xd373('0x23')]][_0xd373('0x25')]=this[_0xd373('0xf')][_0x59da03[_0xd373('0x23')]][_0xd373('0x25')];}logger['info'](_0x59da03[_0xd373('0x23')],this[_0xd373('0xf')][_0x59da03[_0xd373('0x23')]]?'\x20hangup\x20sendFile\x20':_0xd373('0x4b'),JSON['stringify'](this[_0xd373('0x22')][_0x59da03['uniqueid']]));if(this[_0xd373('0xf')][_0x59da03[_0xd373('0x23')]]){if(this[_0xd373('0x22')][_0x59da03[_0xd373('0x23')]][_0xd373('0x4c')]>0x0&&this[_0xd373('0x22')][_0x59da03[_0xd373('0x23')]][_0xd373('0x4d')]===_0xd373('0x4e')){this[_0xd373('0x47')](_0x59da03[_0xd373('0x23')],!![]);}else{this[_0xd373('0x47')](_0x59da03[_0xd373('0x23')],![],this[_0xd373('0x22')][_0x59da03[_0xd373('0x23')]][_0xd373('0x4f')]?_0xd373('0x50')+this[_0xd373('0x22')][_0x59da03[_0xd373('0x23')]][_0xd373('0x4f')]:_0xd373('0x51'));}}}};Fax[_0xd373('0x1d')][_0xd373('0x52')]=function(_0x5133){var _0x2ada2f=this;return new BPromise(function(_0x3eb2ca,_0x547a8a){_0x2ada2f[_0xd373('0x53')](_0x5133,_0x2ada2f[_0xd373('0xd')][_0x5133[_0xd373('0x54')]])['then'](function(_0x38068a){ut[_0xd373('0x44')](_0xd373('0x55'),_0x38068a);_0x3eb2ca(ut[_0xd373('0x36')](_0xd373('0x56')));})[_0xd373('0x3b')](function(_0x284730){ut['logger'](_0xd373('0x57'),_0x284730);updateStatus(_0x5133);_0x547a8a(ut[_0xd373('0x36')](_0xd373('0x58')));});});};Fax[_0xd373('0x1d')][_0xd373('0x59')]=function(_0x208233){var _0x3fd90e=this;return new BPromise(function(_0x2cf09,_0x4fbf72){var _0x409c8c=_0x3fd90e['checkTrunk'](_0x3fd90e[_0xd373('0xd')][_0x208233[_0xd373('0x54')]][_0xd373('0x5a')],_0x208233);if(_0x409c8c[_0xd373('0x5b')]){_0x2cf09(ut[_0xd373('0x36')](_0xd373('0x5c')));}else{_0x4fbf72(ut[_0xd373('0x36')](_0x409c8c[_0xd373('0x36')]));}});};function originate(_0x5f1bfd,_0x237f15,_0x5c5855){return new BPromise(function(_0x40f5ad,_0x27fcbe){if(_0x5c5855){var _0x310a65=util[_0xd373('0x5d')](_0xd373('0x5e'),path[_0xd373('0x37')](_0x5f1bfd[_0xd373('0x4')])['name'],_0x5f1bfd[_0xd373('0x4')]);gs[_0xd373('0x5f')](_0x310a65)[_0xd373('0x60')](function(){_0x5f1bfd['path']=util[_0xd373('0x5d')](_0xd373('0x61'),path[_0xd373('0x37')](_0x5f1bfd[_0xd373('0x4')])[_0xd373('0x62')],path[_0xd373('0x37')](_0x5f1bfd[_0xd373('0x4')])[_0xd373('0x25')]);_0x237f15[_0xd373('0x63')]=_0x5f1bfd[_0xd373('0x4')];ut[_0xd373('0x44')](_0xd373('0x64'),'');ami['Action'](ut[_0xd373('0x65')](_0x5f1bfd,_0x237f15))[_0xd373('0x60')](function(_0x269e8f){_0x40f5ad(_0x269e8f);})['catch'](function(_0x377147){_0x27fcbe(_0x377147);});})[_0xd373('0x3b')](function(_0xdd1ceb){_0x27fcbe(_0xdd1ceb);});}else{ami['Action'](ut[_0xd373('0x65')](_0x5f1bfd,_0x237f15))['then'](function(_0xbdfc86){_0x40f5ad(_0xbdfc86);})[_0xd373('0x3b')](function(_0x38d1e4){_0x27fcbe(_0x38d1e4);});}});}Fax[_0xd373('0x1d')]['execOriginate']=function(_0x227332,_0x535dfd){var _0x2047ca=this;return new BPromise(function(_0x119440,_0x140ec4){var _0xb658db=uuid['v4']();var _0x183565=ut[_0xd373('0x66')](_0x227332,_0x535dfd);_0x2047ca['actions'][_0xb658db]=new Action(_0xb658db,_0x535dfd,_0x227332);var _0xb01a00=_0x2047ca['actions'][_0xb658db];if(path[_0xd373('0x37')](_0x227332['path'])['ext']===_0xd373('0x38')){originate(_0xb01a00,_0x183565,!![])[_0xd373('0x60')](function(_0x1cff58){_0x119440(_0x1cff58);})[_0xd373('0x3b')](function(_0x5a5651){_0x140ec4(_0x5a5651);});}else{originate(_0xb01a00,_0x183565,![])['then'](function(_0x23f9b1){_0x119440(_0x23f9b1);})[_0xd373('0x3b')](function(_0x39764d){_0x140ec4(_0x39764d);});}});};Fax[_0xd373('0x1d')][_0xd373('0x67')]=function(_0x1a30eb){return!_[_0xd373('0x68')](_0x1a30eb)&&!_[_0xd373('0x68')](_0x1a30eb[_0xd373('0x25')])&&!_[_0xd373('0x68')](_0x1a30eb['active'])&&_0x1a30eb[_0xd373('0x69')]&&!_[_0xd373('0x68')](this[_0xd373('0xe')][util[_0xd373('0x5d')](_0xd373('0x6a'),_0x1a30eb[_0xd373('0x25')])])&&!_[_0xd373('0x68')](this['trunks'][util[_0xd373('0x5d')]('SIP/%s',_0x1a30eb['name'])][_0xd373('0x2e')])&&(this[_0xd373('0xe')][util[_0xd373('0x5d')](_0xd373('0x6a'),_0x1a30eb[_0xd373('0x25')])][_0xd373('0x2e')]==='reachable'||this[_0xd373('0xe')][util[_0xd373('0x5d')](_0xd373('0x6a'),_0x1a30eb['name'])][_0xd373('0x2e')]===_0xd373('0x6b'));};Fax[_0xd373('0x1d')]['checkTrunk']=function(_0x169072,_0x33bebe){if(!this[_0xd373('0x67')](_0x169072)){ut['logger'](_0xd373('0x6c'),_[_0xd373('0x68')](_0x169072)?'':_0x169072[_0xd373('0x25')]+_0xd373('0x6d'));return{'isValid':![],'message':_0xd373('0x6e')};}if(_[_0xd373('0x68')](_0x33bebe[_0xd373('0x7')])){ut[_0xd373('0x44')](_0xd373('0x6f'),JSON[_0xd373('0x3e')](_0x33bebe));return{'isValid':![],'message':_0xd373('0x70')};}if(_[_0xd373('0x68')](_0x33bebe[_0xd373('0x4')])){ut['logger'](_0xd373('0x71'),JSON[_0xd373('0x3e')](_0x33bebe));return{'isValid':![],'message':_0xd373('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xd373('0x73')]=Fax;
\ No newline at end of file
+var _0xa478=['message','create','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','bind','syncVarSet','newstate','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','syncNewState','channelstate','channelstatedesc','hasOwnProperty','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa478,0x136));var _0x8a47=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xa478[_0xaa0309];return _0x5de7ce;};'use strict';var util=require(_0x8a47('0x0'));var _=require(_0x8a47('0x1'));var BPromise=require(_0x8a47('0x2'));var uuid=require(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var path=require(_0x8a47('0x5'));var tiff2pdf=require(_0x8a47('0x6'));var gs=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var ami=require(_0x8a47('0xa'));var rpcDb=require(_0x8a47('0xb'));var Channel=require('./channel');var ut=require(_0x8a47('0xc'));var Action=require(_0x8a47('0xd'));var faxAccount=require(_0x8a47('0xe'));var attachment=require(_0x8a47('0xf'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x384886){this['channels']={};this[_0x8a47('0x10')]=_0x384886[_0x8a47('0x10')];this[_0x8a47('0x11')]=_0x384886['trunks'];this[_0x8a47('0x12')]={};ami['on'](_0x8a47('0x13'),this['syncNewchannel'][_0x8a47('0x14')](this));ami['on']('varset',this[_0x8a47('0x15')][_0x8a47('0x14')](this));ami['on'](_0x8a47('0x16'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0x8a47('0x17')][_0x8a47('0x14')](this));ami['on']('faxstatus',this[_0x8a47('0x18')][_0x8a47('0x14')](this));ami['on'](_0x8a47('0x19'),this[_0x8a47('0x1a')][_0x8a47('0x14')](this));ami['on'](_0x8a47('0x1b'),this[_0x8a47('0x1c')][_0x8a47('0x14')](this));ami['on'](_0x8a47('0x1d'),this[_0x8a47('0x1e')][_0x8a47('0x14')](this));}Fax[_0x8a47('0x1f')][_0x8a47('0x20')]=function(_0x4ad72d){if(_0x4ad72d[_0x8a47('0x21')]===_0x8a47('0x22')){for(var _0x3f9093 in this['faxAccounts']){if(this[_0x8a47('0x10')]['hasOwnProperty'](_0x3f9093)){if(_0x4ad72d['exten']===this[_0x8a47('0x10')][_0x3f9093][_0x8a47('0x23')]){this[_0x8a47('0x24')][_0x4ad72d[_0x8a47('0x25')]]={};this[_0x8a47('0x24')][_0x4ad72d[_0x8a47('0x25')]][_0x8a47('0x26')]=_0x4ad72d[_0x8a47('0x26')];this[_0x8a47('0x24')][_0x4ad72d[_0x8a47('0x25')]]['id']=this['faxAccounts'][_0x3f9093]['id'];this[_0x8a47('0x24')][_0x4ad72d['uniqueid']][_0x8a47('0x27')]=this[_0x8a47('0x10')][_0x3f9093][_0x8a47('0x27')];logger[_0x8a47('0x28')](_0x4ad72d['uniqueid'],_0x8a47('0x29'));}}}}if(this['actions'][_0x4ad72d['uniqueid']]){this['channels'][_0x4ad72d['uniqueid']]={};this[_0x8a47('0x24')][_0x4ad72d[_0x8a47('0x25')]]['channel']=_0x4ad72d[_0x8a47('0x26')];logger[_0x8a47('0x28')](_0x4ad72d[_0x8a47('0x25')],_0x8a47('0x29'));}};Fax[_0x8a47('0x1f')][_0x8a47('0x15')]=function(_0x24a20b){if(this['channels'][_0x24a20b[_0x8a47('0x25')]]){for(var _0x4a10c3 in _0x24a20b[_0x8a47('0x2a')]){if(_0x24a20b[_0x8a47('0x2a')]['hasOwnProperty'](_0x4a10c3)){this[_0x8a47('0x24')][_0x24a20b['uniqueid']][_0x4a10c3]=_0x24a20b['value'];}}}};Fax[_0x8a47('0x1f')][_0x8a47('0x2b')]=function(_0x1ddbcf){if(this[_0x8a47('0x24')][_0x1ddbcf[_0x8a47('0x25')]]){this[_0x8a47('0x24')][_0x1ddbcf['uniqueid']][_0x8a47('0x2c')]=_0x1ddbcf['channelstate'];this['channels'][_0x1ddbcf[_0x8a47('0x25')]][_0x8a47('0x2d')]=_0x1ddbcf[_0x8a47('0x2d')];}};Fax[_0x8a47('0x1f')][_0x8a47('0x17')]=function(_0x365a25){if(this[_0x8a47('0x24')][_0x365a25[_0x8a47('0x25')]]){for(var _0x7242e7 in _0x365a25[_0x8a47('0x2a')]){if(_0x365a25['variable'][_0x8a47('0x2e')](_0x7242e7)){this[_0x8a47('0x24')][_0x365a25[_0x8a47('0x25')]][_0x7242e7]=_0x365a25['value'];}}}};Fax[_0x8a47('0x1f')][_0x8a47('0x18')]=function(_0x57ad7a){if(this[_0x8a47('0x24')][_0x57ad7a[_0x8a47('0x25')]]){this[_0x8a47('0x24')][_0x57ad7a[_0x8a47('0x25')]]['operation']=_0x57ad7a['operation'];this[_0x8a47('0x24')][_0x57ad7a[_0x8a47('0x25')]][_0x8a47('0x2f')]=_0x57ad7a[_0x8a47('0x2f')];this[_0x8a47('0x24')][_0x57ad7a[_0x8a47('0x25')]][_0x8a47('0x23')]=_0x57ad7a['localstationid'];this['channels'][_0x57ad7a[_0x8a47('0x25')]][_0x8a47('0x30')]=_0x57ad7a[_0x8a47('0x30')];logger[_0x8a47('0x28')](_0x57ad7a[_0x8a47('0x25')],_0x8a47('0x31'));}};Fax[_0x8a47('0x1f')][_0x8a47('0x1a')]=function(_0xe178f1){var _0x2570e0=this;if(this[_0x8a47('0x24')][_0xe178f1['uniqueid']]){var _0x258cc4=this['channels'][_0xe178f1['uniqueid']]['id'];this['channels'][_0xe178f1['uniqueid']]['remotestationid']=_0xe178f1[_0x8a47('0x32')];this[_0x8a47('0x24')][_0xe178f1[_0x8a47('0x25')]][_0x8a47('0x33')]=_0xe178f1[_0x8a47('0x33')];this[_0x8a47('0x24')][_0xe178f1[_0x8a47('0x25')]][_0x8a47('0x23')]=_0xe178f1['localstationid'];this['channels'][_0xe178f1[_0x8a47('0x25')]][_0x8a47('0x34')]=_0xe178f1[_0x8a47('0x34')];this[_0x8a47('0x24')][_0xe178f1['uniqueid']][_0x8a47('0x35')]=_0xe178f1[_0x8a47('0x35')];this[_0x8a47('0x24')][_0xe178f1[_0x8a47('0x25')]][_0x8a47('0x30')]=_0xe178f1['filename'];this[_0x8a47('0x24')][_0xe178f1[_0x8a47('0x25')]][_0x8a47('0x36')]=_0xe178f1['calleridnum'];if(this[_0x8a47('0x24')][_0xe178f1[_0x8a47('0x25')]][_0x8a47('0x33')]>0x0){tiff2pdf(_0xe178f1[_0x8a47('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x30236d){logger[_0x8a47('0x28')](_0xe178f1[_0x8a47('0x25')],_0x8a47('0x37'),_0x30236d[_0x8a47('0x38')]);attachment[_0x8a47('0x39')]({'name':path['parse'](_0xe178f1['filename'])[_0x8a47('0x27')],'basename':path[_0x8a47('0x3a')](_0xe178f1[_0x8a47('0x30')])['name']+_0x8a47('0x3b'),'type':_0x8a47('0x3c')})['then'](function(_0x5d954d){faxAccount[_0x8a47('0x3d')](_0x258cc4,{'from':_0xe178f1['calleridnum'],'mapKey':_0x8a47('0x9'),'body':path[_0x8a47('0x3a')](_0xe178f1[_0x8a47('0x30')])[_0x8a47('0x27')]+_0x8a47('0x3b'),'AttachmentId':_0x5d954d['id']})[_0x8a47('0x3e')](function(_0x4ca38a){logger['error'](_0xe178f1[_0x8a47('0x25')],_0x8a47('0x3f'),JSON[_0x8a47('0x40')](_0x4ca38a));});})[_0x8a47('0x3e')](function(_0x11a88a){logger['error'](_0xe178f1['uniqueid'],_0x8a47('0x41'),JSON['stringify'](_0x11a88a));});});}logger[_0x8a47('0x28')](_0xe178f1[_0x8a47('0x25')],'\x20receiveFax\x20');}};Fax[_0x8a47('0x1f')][_0x8a47('0x1e')]=function(_0x14e22c){if(this[_0x8a47('0x12')][_0x14e22c[_0x8a47('0x25')]]){_[_0x8a47('0x42')](this[_0x8a47('0x24')][_0x14e22c[_0x8a47('0x25')]],_['pick'](_0x14e22c,[_0x8a47('0x43'),_0x8a47('0x44')]));}};function updateStatus(_0x641c47){if(_0x641c47[_0x8a47('0x45')]){faxMessage['update'](_0x641c47[_0x8a47('0x45')],{'failMessage':_0x8a47('0x46')})[_0x8a47('0x47')](function(_0x3bd188){ut[_0x8a47('0x48')](_0x8a47('0x49'),_0x3bd188);})['catch'](function(_0x4865be){ut[_0x8a47('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x4865be);});}else{ut[_0x8a47('0x48')](_0x8a47('0x4a'));}}Fax['prototype'][_0x8a47('0x4b')]=function(_0x4bf9a8,_0x315111,_0x5c5577){var _0x358790=this;var _0x5b7f2f={};if(_0x315111){_0x5b7f2f={'read':_0x315111};}else{_0x5b7f2f={'failMessage':_0x5c5577};}if(this[_0x8a47('0x12')][_0x4bf9a8][_0x8a47('0x45')]){faxMessage[_0x8a47('0x4c')](this[_0x8a47('0x12')][_0x4bf9a8][_0x8a47('0x45')],_0x5b7f2f)[_0x8a47('0x47')](function(_0x3ef9b2){ut[_0x8a47('0x48')](_0x8a47('0x4d'),_0x3ef9b2);})[_0x8a47('0x3e')](function(_0x927a61){ut['logger'](_0x8a47('0x4e'),_0x927a61);})[_0x8a47('0x4f')](function(){delete _0x358790['channels'][_0x4bf9a8];delete _0x358790[_0x8a47('0x12')][_0x4bf9a8];});}else{ut[_0x8a47('0x48')](_0x8a47('0x50'));delete this[_0x8a47('0x24')][_0x4bf9a8];delete this[_0x8a47('0x12')][_0x4bf9a8];}};Fax[_0x8a47('0x1f')][_0x8a47('0x1c')]=function(_0x3ca104){var _0xc7f40d=this;if(this[_0x8a47('0x24')][_0x3ca104[_0x8a47('0x25')]]){if(this[_0x8a47('0x12')][_0x3ca104['uniqueid']]){this[_0x8a47('0x24')][_0x3ca104[_0x8a47('0x25')]]['id']=this[_0x8a47('0x12')][_0x3ca104[_0x8a47('0x25')]]['id'];this[_0x8a47('0x24')][_0x3ca104[_0x8a47('0x25')]][_0x8a47('0x27')]=this[_0x8a47('0x12')][_0x3ca104[_0x8a47('0x25')]][_0x8a47('0x27')];}logger[_0x8a47('0x28')](_0x3ca104[_0x8a47('0x25')],this[_0x8a47('0x12')][_0x3ca104[_0x8a47('0x25')]]?_0x8a47('0x51'):_0x8a47('0x52'),JSON['stringify'](this[_0x8a47('0x24')][_0x3ca104['uniqueid']]));if(this[_0x8a47('0x12')][_0x3ca104[_0x8a47('0x25')]]){if(this[_0x8a47('0x24')][_0x3ca104[_0x8a47('0x25')]][_0x8a47('0x53')]>0x0&&this[_0x8a47('0x24')][_0x3ca104['uniqueid']][_0x8a47('0x54')]===_0x8a47('0x55')){this[_0x8a47('0x4b')](_0x3ca104['uniqueid'],!![]);}else{this['updateStatus'](_0x3ca104[_0x8a47('0x25')],![],this[_0x8a47('0x24')][_0x3ca104['uniqueid']][_0x8a47('0x56')]?_0x8a47('0x57')+this[_0x8a47('0x24')][_0x3ca104[_0x8a47('0x25')]][_0x8a47('0x56')]:_0x8a47('0x58'));}}}};Fax[_0x8a47('0x1f')][_0x8a47('0x59')]=function(_0x99848c){var _0x1b834a=this;return new BPromise(function(_0x3b96ba,_0xe755c){_0x1b834a[_0x8a47('0x5a')](_0x99848c,_0x1b834a['faxAccounts'][_0x99848c[_0x8a47('0x5b')]])[_0x8a47('0x47')](function(_0x3f9706){ut[_0x8a47('0x48')](_0x8a47('0x5c'),_0x3f9706);_0x3b96ba(ut[_0x8a47('0x38')]('Fax\x20received'));})[_0x8a47('0x3e')](function(_0x584c2e){ut['logger'](_0x8a47('0x5d'),_0x584c2e);updateStatus(_0x99848c);_0xe755c(ut[_0x8a47('0x38')](_0x8a47('0x5e')));});});};Fax[_0x8a47('0x1f')][_0x8a47('0x5f')]=function(_0x35a31f){var _0x56df10=this;return new BPromise(function(_0x581262,_0x291f65){var _0x578027=_0x56df10[_0x8a47('0x60')](_0x56df10[_0x8a47('0x10')][_0x35a31f[_0x8a47('0x5b')]][_0x8a47('0x61')],_0x35a31f);if(_0x578027[_0x8a47('0x62')]){_0x581262(ut[_0x8a47('0x38')](_0x8a47('0x63')));}else{_0x291f65(ut[_0x8a47('0x38')](_0x578027['message']));}});};function originate(_0x5c1e7e,_0x435039,_0x131176){return new BPromise(function(_0x2761bf,_0x5d6ebc){if(_0x131176){var _0x54b508=util['format'](_0x8a47('0x64'),path['parse'](_0x5c1e7e[_0x8a47('0x5')])[_0x8a47('0x27')],_0x5c1e7e[_0x8a47('0x5')]);gs[_0x8a47('0x65')](_0x54b508)['then'](function(){_0x5c1e7e[_0x8a47('0x5')]=util['format'](_0x8a47('0x66'),path[_0x8a47('0x3a')](_0x5c1e7e[_0x8a47('0x5')])['dir'],path[_0x8a47('0x3a')](_0x5c1e7e[_0x8a47('0x5')])['name']);_0x435039[_0x8a47('0x67')]=_0x5c1e7e[_0x8a47('0x5')];ut[_0x8a47('0x48')](_0x8a47('0x68'),'');ami[_0x8a47('0x69')](ut[_0x8a47('0x6a')](_0x5c1e7e,_0x435039))[_0x8a47('0x47')](function(_0x10e1f4){_0x2761bf(_0x10e1f4);})['catch'](function(_0x41aafa){_0x5d6ebc(_0x41aafa);});})[_0x8a47('0x3e')](function(_0x57b234){_0x5d6ebc(_0x57b234);});}else{ami[_0x8a47('0x69')](ut[_0x8a47('0x6a')](_0x5c1e7e,_0x435039))['then'](function(_0x196b9d){_0x2761bf(_0x196b9d);})[_0x8a47('0x3e')](function(_0x35f2d0){_0x5d6ebc(_0x35f2d0);});}});}Fax[_0x8a47('0x1f')][_0x8a47('0x5a')]=function(_0x579f9d,_0x59508d){var _0x6f594c=this;return new BPromise(function(_0x310262,_0x41947a){var _0x42b338=uuid['v4']();var _0x14f2a5=ut[_0x8a47('0x6b')](_0x579f9d,_0x59508d);_0x6f594c[_0x8a47('0x12')][_0x42b338]=new Action(_0x42b338,_0x59508d,_0x579f9d);var _0x4845fa=_0x6f594c[_0x8a47('0x12')][_0x42b338];if(path[_0x8a47('0x3a')](_0x579f9d[_0x8a47('0x5')])['ext']===_0x8a47('0x3b')){originate(_0x4845fa,_0x14f2a5,!![])[_0x8a47('0x47')](function(_0xa2ea5c){_0x310262(_0xa2ea5c);})[_0x8a47('0x3e')](function(_0xc57191){_0x41947a(_0xc57191);});}else{originate(_0x4845fa,_0x14f2a5,![])[_0x8a47('0x47')](function(_0x388fd9){_0x310262(_0x388fd9);})[_0x8a47('0x3e')](function(_0x54400a){_0x41947a(_0x54400a);});}});};Fax['prototype'][_0x8a47('0x6c')]=function(_0x170456){return!_[_0x8a47('0x6d')](_0x170456)&&!_['isNil'](_0x170456[_0x8a47('0x27')])&&!_[_0x8a47('0x6d')](_0x170456[_0x8a47('0x6e')])&&_0x170456[_0x8a47('0x6e')]&&!_[_0x8a47('0x6d')](this[_0x8a47('0x11')][util[_0x8a47('0x6f')](_0x8a47('0x70'),_0x170456[_0x8a47('0x27')])])&&!_[_0x8a47('0x6d')](this[_0x8a47('0x11')][util[_0x8a47('0x6f')]('SIP/%s',_0x170456[_0x8a47('0x27')])][_0x8a47('0x2f')])&&(this[_0x8a47('0x11')][util[_0x8a47('0x6f')](_0x8a47('0x70'),_0x170456[_0x8a47('0x27')])][_0x8a47('0x2f')]===_0x8a47('0x71')||this[_0x8a47('0x11')][util[_0x8a47('0x6f')](_0x8a47('0x70'),_0x170456['name'])][_0x8a47('0x2f')]===_0x8a47('0x72'));};Fax[_0x8a47('0x1f')][_0x8a47('0x60')]=function(_0x21d3f5,_0x3aab48){if(!this[_0x8a47('0x6c')](_0x21d3f5)){ut[_0x8a47('0x48')](_0x8a47('0x73'),_['isNil'](_0x21d3f5)?'':_0x21d3f5[_0x8a47('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x8a47('0x74')};}if(_['isNil'](_0x3aab48[_0x8a47('0x9')])){ut[_0x8a47('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x8a47('0x40')](_0x3aab48));return{'isValid':![],'message':_0x8a47('0x75')};}if(_[_0x8a47('0x6d')](_0x3aab48[_0x8a47('0x5')])){ut['logger'](_0x8a47('0x76'),JSON[_0x8a47('0x40')](_0x3aab48));return{'isValid':![],'message':_0x8a47('0x77')};}return{'isValid':!![],'message':_0x8a47('0x78')};};module[_0x8a47('0x79')]=Fax;
\ No newline at end of file
index d6d2c4c..19cfa5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x721b=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','bluebird','preview'];(function(_0x55d352,_0x2790d4){var _0x1fac10=function(_0x7a53fe){while(--_0x7a53fe){_0x55d352['push'](_0x55d352['shift']());}};_0x1fac10(++_0x2790d4);}(_0x721b,0x170));var _0xb721=function(_0x2d41f3,_0x46992f){_0x2d41f3=_0x2d41f3-0x0;var _0x390705=_0x721b[_0x2d41f3];return _0x390705;};'use strict';var util=require('util');var BPromise=require(_0xb721('0x0'));var logger=require('../../../config/logger')(_0xb721('0x1'));var _=require(_0xb721('0x2'));var faxAccount=require(_0xb721('0x3'));function loggerCatch(_0x593a9e){return function(_0x46e1fb){logger[_0xb721('0x4')](_0x593a9e,util[_0xb721('0x5')](_0x46e1fb,{'showHidden':![],'depth':null}));};}exports[_0xb721('0x6')]=function(_0x56d430,_0x23f967){return BPromise[_0xb721('0x7')]()[_0xb721('0x8')](faxAccount[_0xb721('0x6')](_0x56d430,_0x23f967))['catch'](loggerCatch(_0xb721('0x9')));};
\ No newline at end of file
+var _0x5b5d=['notify','resolve','then','catch','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error'];(function(_0x2720f1,_0x234e57){var _0x2a0b1d=function(_0x3c1677){while(--_0x3c1677){_0x2720f1['push'](_0x2720f1['shift']());}};_0x2a0b1d(++_0x234e57);}(_0x5b5d,0x194));var _0xd5b5=function(_0x3ac1f6,_0x4b4b9d){_0x3ac1f6=_0x3ac1f6-0x0;var _0x34001d=_0x5b5d[_0x3ac1f6];return _0x34001d;};'use strict';var util=require(_0xd5b5('0x0'));var BPromise=require(_0xd5b5('0x1'));var logger=require(_0xd5b5('0x2'))('preview');var _=require(_0xd5b5('0x3'));var faxAccount=require(_0xd5b5('0x4'));function loggerCatch(_0x3a8e29){return function(_0x54a7ea){logger[_0xd5b5('0x5')](_0x3a8e29,util['inspect'](_0x54a7ea,{'showHidden':![],'depth':null}));};}exports[_0xd5b5('0x6')]=function(_0xbf873d,_0x23e057){return BPromise[_0xd5b5('0x7')]()[_0xd5b5('0x8')](faxAccount['notify'](_0xbf873d,_0x23e057))[_0xd5b5('0x9')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index 28890dd..145f411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd944=['fax','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger'];(function(_0x5f404c,_0x1f3657){var _0x418787=function(_0x5bffad){while(--_0x5bffad){_0x5f404c['push'](_0x5f404c['shift']());}};_0x418787(++_0x1f3657);}(_0xd944,0x11f));var _0x4d94=function(_0x40e141,_0x4385ee){_0x40e141=_0x40e141-0x0;var _0x3ce15c=_0xd944[_0x40e141];return _0x3ce15c;};'use strict';var util=require('util');var logger=require(_0x4d94('0x0'))(_0x4d94('0x1'));var BPromise=require('bluebird');var exec=require(_0x4d94('0x2'))['exec'];exports[_0x4d94('0x3')]=function(_0x4f4e30){return new BPromise(function(_0xe0848f,_0x1bffb9){exec(_0x4f4e30,function(_0xdd1a06,_0x49e0b6,_0x2e9f58){logger[_0x4d94('0x4')](_0x4d94('0x5'),_0x49e0b6);if(_0xdd1a06){logger[_0x4d94('0x4')](_0x4d94('0x5'),_0x4d94('0x6'),util[_0x4d94('0x7')](_0xdd1a06,{'showHidden':![],'depth':null}),_0x49e0b6,_0x2e9f58);_0x1bffb9(_0xdd1a06);}_0xe0848f(_0x49e0b6);});});};
\ No newline at end of file
+var _0x015e=['inspect','fax','bluebird','child_process','exec','execute','info'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x015e,0xef));var _0xe015=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x015e[_0x342baa];return _0x1208f3;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0xe015('0x0'));var BPromise=require(_0xe015('0x1'));var exec=require(_0xe015('0x2'))[_0xe015('0x3')];exports[_0xe015('0x4')]=function(_0xf77f96){return new BPromise(function(_0xcb6828,_0x19e466){exec(_0xf77f96,function(_0x2a00a4,_0x27e975,_0x301ae8){logger[_0xe015('0x5')]('Exec\x20gs',_0x27e975);if(_0x2a00a4){logger[_0xe015('0x5')]('Exec\x20gs','\x20Error\x20:',util[_0xe015('0x6')](_0x2a00a4,{'showHidden':![],'depth':null}),_0x27e975,_0x301ae8);_0x19e466(_0x2a00a4);}_0xcb6828(_0x27e975);});});};
\ No newline at end of file
index 60e5312..c54ff8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8775=['minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','channel','from-sip','headerinfo','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables'];(function(_0x4417eb,_0x146f78){var _0x4bdceb=function(_0x175803){while(--_0x175803){_0x4417eb['push'](_0x4417eb['shift']());}};_0x4bdceb(++_0x146f78);}(_0x8775,0x148));var _0x5877=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0x8775[_0x1c156e];return _0x58fc22;};'use strict';var util=require('util');var _=require(_0x5877('0x0'));var moment=require('moment');var logger=require(_0x5877('0x1'))(_0x5877('0x2'));exports[_0x5877('0x3')]=function(_0x10d6d2){return{'message':_0x10d6d2};};exports[_0x5877('0x4')]=function(_0x23bafa,_0x426acd){logger[_0x5877('0x5')](_0x23bafa,util[_0x5877('0x6')](_0x426acd,{'showHidden':![],'depth':null}));};exports[_0x5877('0x7')]=function(_0x561098,_0x5c1681){var _0x39fdbc={'XMF-ECM':_0x5c1681['ecm'],'XMF-HEADERINFO':_0x5c1681['headerinfo'],'XMF-MINRATE':_0x5c1681[_0x5877('0x8')],'XMF-MAXRATE':_0x5c1681[_0x5877('0x9')],'XMF-MODEM':util[_0x5877('0xa')](_0x5877('0xb'),_0x5c1681[_0x5877('0xc')]),'XMF-GATEWAY':_0x5c1681['gateway'],'XMF-FAXDETECT':_0x5c1681[_0x5877('0xd')],'XMF-T38TIMEOUT':_0x5c1681[_0x5877('0xe')],'XMF-LOCALSTATIONID':_0x5c1681[_0x5877('0xf')],'XMF-PATH':_0x561098['path']};return _0x39fdbc;};exports[_0x5877('0x10')]=function(_0x49bc2e,_0x58e145){return{'actionid':_0x49bc2e[_0x5877('0x11')],'action':'originate','channel':_0x49bc2e[_0x5877('0x12')],'Exten':'xcally-motion-fax','Context':_0x5877('0x13'),'Priority':'1','callerid':util[_0x5877('0xa')]('\x22%s\x22\x20<%s>',_0x49bc2e[_0x5877('0x14')]?_0x49bc2e[_0x5877('0x14')]:'',_0x49bc2e[_0x5877('0xf')]),'variable':_0x58e145,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x49bc2e['uniqueid']};};
\ No newline at end of file
+var _0x369d=['info','inspect','addVariables','ecm','headerinfo','format','gateway','faxdetect','t38timeout','localstationid','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','fax','message'];(function(_0x1c1d96,_0x5a651c){var _0x59c125=function(_0x42cb6d){while(--_0x42cb6d){_0x1c1d96['push'](_0x1c1d96['shift']());}};_0x59c125(++_0x5a651c);}(_0x369d,0x1de));var _0xd369=function(_0x387765,_0x58f144){_0x387765=_0x387765-0x0;var _0x3d433f=_0x369d[_0x387765];return _0x3d433f;};'use strict';var util=require(_0xd369('0x0'));var _=require(_0xd369('0x1'));var moment=require(_0xd369('0x2'));var logger=require('../../../../config/logger')(_0xd369('0x3'));exports[_0xd369('0x4')]=function(_0x153950){return{'message':_0x153950};};exports['logger']=function(_0xb2d05,_0x1aff0f){logger[_0xd369('0x5')](_0xb2d05,util[_0xd369('0x6')](_0x1aff0f,{'showHidden':![],'depth':null}));};exports[_0xd369('0x7')]=function(_0x106fce,_0x5f0174){var _0x506281={'XMF-ECM':_0x5f0174[_0xd369('0x8')],'XMF-HEADERINFO':_0x5f0174[_0xd369('0x9')],'XMF-MINRATE':_0x5f0174['minrate'],'XMF-MAXRATE':_0x5f0174['maxrate'],'XMF-MODEM':util[_0xd369('0xa')]('\x22%s\x22',_0x5f0174['modem']),'XMF-GATEWAY':_0x5f0174[_0xd369('0xb')],'XMF-FAXDETECT':_0x5f0174[_0xd369('0xc')],'XMF-T38TIMEOUT':_0x5f0174[_0xd369('0xd')],'XMF-LOCALSTATIONID':_0x5f0174[_0xd369('0xe')],'XMF-PATH':_0x106fce['path']};return _0x506281;};exports['variablesAction']=function(_0x2950ea,_0x31d819){return{'actionid':_0x2950ea[_0xd369('0xf')],'action':_0xd369('0x10'),'channel':_0x2950ea[_0xd369('0x11')],'Exten':_0xd369('0x12'),'Context':_0xd369('0x13'),'Priority':'1','callerid':util[_0xd369('0xa')](_0xd369('0x14'),_0x2950ea[_0xd369('0x9')]?_0x2950ea[_0xd369('0x9')]:'',_0x2950ea[_0xd369('0xe')]),'variable':_0x31d819,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2950ea['uniqueid']};};
\ No newline at end of file
index f868649..75e40aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5081=['bluebird','util','./server','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','catch','[index.js][initParams]','listen','sync','error','inspect'];(function(_0x310676,_0x59b568){var _0x4dbe54=function(_0x34a04e){while(--_0x34a04e){_0x310676['push'](_0x310676['shift']());}};_0x4dbe54(++_0x59b568);}(_0x5081,0xc9));var _0x1508=function(_0x1d17f8,_0x59f962){_0x1d17f8=_0x1d17f8-0x0;var _0x3c8175=_0x5081[_0x1d17f8];return _0x3c8175;};'use strict';var BPromise=require(_0x1508('0x0'));var util=require(_0x1508('0x1'));var moment=require('moment');var server=require(_0x1508('0x2'));var Realtime=require('./realtime');var Report=require(_0x1508('0x3'));var Acw=require(_0x1508('0x4'));var Trigger=require(_0x1508('0x5'));var Dialer=require('./dialer');var Preview=require(_0x1508('0x6'));var Fax=require(_0x1508('0x7'));var user=require(_0x1508('0x8'));var voiceQueue=require(_0x1508('0x9'));var voiceQueueReport=require(_0x1508('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x1508('0xb'));var template=require(_0x1508('0xc'));var cmHopperHistory=require(_0x1508('0xd'));var campaign=require(_0x1508('0xe'));var voiceExtension=require(_0x1508('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x1508('0x10'));var salesforce=require(_0x1508('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x1508('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x1508('0x13'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x1508('0x14'));var dynamics365=require(_0x1508('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 logger=require(_0x1508('0x16'))(_0x1508('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1508('0x18')](_0x1508('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1508('0x1a')]()[_0x1508('0x1b')](user[_0x1508('0x1c')]())['then'](realtime[_0x1508('0x1d')]())[_0x1508('0x1b')](user['getTelephones']())['then'](realtime[_0x1508('0x1e')]())[_0x1508('0x1b')](trunk[_0x1508('0x1f')]())[_0x1508('0x1b')](realtime['initTrunks']())[_0x1508('0x1b')](voiceQueue[_0x1508('0x20')]())[_0x1508('0x1b')](realtime[_0x1508('0x21')]())['then'](trigger[_0x1508('0x22')]())[_0x1508('0x1b')](realtime[_0x1508('0x23')]())['then'](template[_0x1508('0x24')]())['then'](realtime[_0x1508('0x25')]())[_0x1508('0x1b')](zendesk[_0x1508('0x26')]())[_0x1508('0x1b')](realtime[_0x1508('0x27')]())['then'](salesforce[_0x1508('0x28')]())[_0x1508('0x1b')](realtime[_0x1508('0x29')]())[_0x1508('0x1b')](sugarcrm[_0x1508('0x2a')]())[_0x1508('0x1b')](realtime[_0x1508('0x2b')]())[_0x1508('0x1b')](freshdesk[_0x1508('0x2c')]())[_0x1508('0x1b')](realtime['initFreshdeskAccounts']())['then'](desk[_0x1508('0x2d')]())[_0x1508('0x1b')](realtime['initDeskAccounts']())[_0x1508('0x1b')](zoho['getZohoAccounts']())[_0x1508('0x1b')](realtime['initZohoAccounts']())[_0x1508('0x1b')](vtiger['getVtigerAccounts']())[_0x1508('0x1b')](realtime[_0x1508('0x2e')]())['then'](freshsales[_0x1508('0x2f')]())[_0x1508('0x1b')](realtime[_0x1508('0x30')]())['then'](servicenow[_0x1508('0x31')]())[_0x1508('0x1b')](realtime[_0x1508('0x32')]())[_0x1508('0x1b')](dynamics365[_0x1508('0x33')]())[_0x1508('0x1b')](realtime[_0x1508('0x34')]())['then'](campaign[_0x1508('0x35')]())[_0x1508('0x1b')](realtime[_0x1508('0x36')]())[_0x1508('0x1b')](voiceExtension['getVoiceExtensions']())[_0x1508('0x1b')](realtime['initVoiceExtensions']())[_0x1508('0x1b')](faxAccount[_0x1508('0x37')]())[_0x1508('0x1b')](realtime['initFaxAccounts']())[_0x1508('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x1508('0x1a')]()[_0x1508('0x1b')](voiceQueueReport[_0x1508('0x38')]())[_0x1508('0x1b')](realtime[_0x1508('0x39')]())[_0x1508('0x1b')](cmHopperHistory[_0x1508('0x3a')]())['then'](realtime[_0x1508('0x3b')]())[_0x1508('0x1b')](cmHopperHistory['getCampaignHopperHistory']())[_0x1508('0x1b')](realtime[_0x1508('0x3c')]())[_0x1508('0x1b')](voiceCallReport['getVoiceCallReports']())[_0x1508('0x1b')](realtime['initVoiceCallReports']())[_0x1508('0x3d')](function(_0x12e3e8){logger['error'](_0x1508('0x3e'),util['inspect'](_0x12e3e8,{'showHidden':![],'depth':null}));});}function main(){return server[_0x1508('0x3f')](realtime,preview,fax)['then'](function(_0x30afc9){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x1508('0x40')]();setInterval(initRealtime,0x1388);})[_0x1508('0x3d')](function(_0x70d70a){logger[_0x1508('0x41')]('[index.js][main]',util[_0x1508('0x42')](_0x70d70a,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x7a67=['getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a67,0x9c));var _0x77a6=function(_0x40169d,_0x1e6ebc){_0x40169d=_0x40169d-0x0;var _0x45f8c2=_0x7a67[_0x40169d];return _0x45f8c2;};'use strict';var BPromise=require(_0x77a6('0x0'));var util=require('util');var moment=require(_0x77a6('0x1'));var server=require('./server');var Realtime=require(_0x77a6('0x2'));var Report=require(_0x77a6('0x3'));var Acw=require(_0x77a6('0x4'));var Trigger=require(_0x77a6('0x5'));var Dialer=require(_0x77a6('0x6'));var Preview=require(_0x77a6('0x7'));var Fax=require(_0x77a6('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0x77a6('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x77a6('0xa'));var trunk=require(_0x77a6('0xb'));var trigger=require(_0x77a6('0xc'));var template=require(_0x77a6('0xd'));var cmHopperHistory=require(_0x77a6('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x77a6('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x77a6('0x10'));var salesforce=require(_0x77a6('0x11'));var sugarcrm=require(_0x77a6('0x12'));var freshdesk=require(_0x77a6('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x77a6('0x14'));var vtiger=require(_0x77a6('0x15'));var freshsales=require(_0x77a6('0x16'));var servicenow=require(_0x77a6('0x17'));var dynamics365=require(_0x77a6('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x77a6('0x19'))(_0x77a6('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x77a6('0x1b')](_0x77a6('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x77a6('0x1b')](_0x77a6('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x77a6('0x1d')]()[_0x77a6('0x1e')](user['getAgents']())[_0x77a6('0x1e')](realtime[_0x77a6('0x1f')]())[_0x77a6('0x1e')](user[_0x77a6('0x20')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x21')]())[_0x77a6('0x1e')](trunk[_0x77a6('0x22')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x23')]())[_0x77a6('0x1e')](voiceQueue[_0x77a6('0x24')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x25')]())[_0x77a6('0x1e')](trigger[_0x77a6('0x26')]())[_0x77a6('0x1e')](realtime['initTriggers']())[_0x77a6('0x1e')](template[_0x77a6('0x27')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x28')]())[_0x77a6('0x1e')](zendesk[_0x77a6('0x29')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x2a')]())[_0x77a6('0x1e')](salesforce[_0x77a6('0x2b')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x2c')]())['then'](sugarcrm[_0x77a6('0x2d')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x2e')]())[_0x77a6('0x1e')](freshdesk[_0x77a6('0x2f')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x30')]())['then'](desk[_0x77a6('0x31')]())[_0x77a6('0x1e')](realtime['initDeskAccounts']())[_0x77a6('0x1e')](zoho[_0x77a6('0x32')]())[_0x77a6('0x1e')](realtime['initZohoAccounts']())[_0x77a6('0x1e')](vtiger[_0x77a6('0x33')]())[_0x77a6('0x1e')](realtime['initVtigerAccounts']())[_0x77a6('0x1e')](freshsales[_0x77a6('0x34')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x35')]())['then'](servicenow[_0x77a6('0x36')]())['then'](realtime[_0x77a6('0x37')]())['then'](dynamics365['getDynamics365Accounts']())[_0x77a6('0x1e')](realtime[_0x77a6('0x38')]())[_0x77a6('0x1e')](campaign['getCampaigns']())['then'](realtime[_0x77a6('0x39')]())[_0x77a6('0x1e')](voiceExtension[_0x77a6('0x3a')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x3b')]())[_0x77a6('0x1e')](faxAccount[_0x77a6('0x3c')]())[_0x77a6('0x1e')](realtime['initFaxAccounts']())[_0x77a6('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x77a6('0x1d')]()[_0x77a6('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0x77a6('0x1e')](realtime['initVoiceQueueReports']())[_0x77a6('0x1e')](cmHopperHistory[_0x77a6('0x3d')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x3e')]())[_0x77a6('0x1e')](cmHopperHistory[_0x77a6('0x3f')]())[_0x77a6('0x1e')](realtime[_0x77a6('0x40')]())[_0x77a6('0x1e')](voiceCallReport['getVoiceCallReports']())[_0x77a6('0x1e')](realtime[_0x77a6('0x41')]())[_0x77a6('0x42')](function(_0x35d921){logger[_0x77a6('0x43')](_0x77a6('0x44'),util[_0x77a6('0x45')](_0x35d921,{'showHidden':![],'depth':null}));});}function main(){return server[_0x77a6('0x46')](realtime,preview,fax)[_0x77a6('0x1e')](function(_0x37ffb7){return initRealtime();})[_0x77a6('0x1e')](function(){return initParams();})[_0x77a6('0x1e')](function(){report[_0x77a6('0x47')]();setInterval(initRealtime,0x1388);})[_0x77a6('0x42')](function(_0x264067){logger[_0x77a6('0x43')](_0x77a6('0x48'),util[_0x77a6('0x45')](_0x264067,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index 436ab57..f857501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x242d19,_0x1a2206){var _0x39dff7=function(_0x297ffa){while(--_0x297ffa){_0x242d19['push'](_0x242d19['shift']());}};_0x39dff7(++_0x1a2206);}(_0x34e8,0x12c));var _0x834e=function(_0x34c020,_0x2b186c){_0x34c020=_0x34c020-0x0;var _0x3e961d=_0x34e8[_0x34c020];return _0x3e961d;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent;
\ No newline at end of file
+var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent;
\ No newline at end of file
index 108f866..e239d8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2115=['ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2115,0x183));var _0x5211=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0x2115[_0x47cfa0];return _0x386b1d;};'use strict';function Campaign(_0x3920a5){this['id']=_0x3920a5['id']||0x0;this['name']=_0x3920a5[_0x5211('0x0')]||'';this[_0x5211('0x1')]=_0x3920a5['type']||_0x5211('0x2');this['originated']=0x0;this[_0x5211('0x3')]=0x0;this[_0x5211('0x4')]=0x0;this[_0x5211('0x5')]=0x0;this['message']='';this[_0x5211('0x6')]=!![];this[_0x5211('0x7')]=_0x3920a5[_0x5211('0x7')];this['limitCalls']=_0x3920a5[_0x5211('0x8')];this[_0x5211('0x9')]=_0x3920a5[_0x5211('0x9')]||null;this[_0x5211('0xa')]=_0x3920a5[_0x5211('0xa')]?_0x3920a5[_0x5211('0xa')]:null;this[_0x5211('0xb')]=_0x3920a5[_0x5211('0xb')];this[_0x5211('0xc')]=_0x3920a5[_0x5211('0xc')];this[_0x5211('0xd')]=_0x3920a5['dialOriginateTimeout']||0x1e;this[_0x5211('0xe')]=_0x3920a5['dialCongestionMaxRetry'];this[_0x5211('0xf')]=_0x3920a5[_0x5211('0xf')];this[_0x5211('0x10')]=_0x3920a5[_0x5211('0x10')];this[_0x5211('0x11')]=_0x3920a5[_0x5211('0x11')];this[_0x5211('0x12')]=_0x3920a5[_0x5211('0x12')];this[_0x5211('0x13')]=_0x3920a5[_0x5211('0x13')];this[_0x5211('0x14')]=_0x3920a5[_0x5211('0x14')];this[_0x5211('0x15')]=_0x3920a5[_0x5211('0x15')]||0x3;this[_0x5211('0x16')]=_0x3920a5[_0x5211('0x16')]||0x96;this[_0x5211('0x17')]=_0x3920a5['dialDropMaxRetry']||0x3;this[_0x5211('0x18')]=_0x3920a5[_0x5211('0x18')]||0x96;this[_0x5211('0x19')]=_0x3920a5[_0x5211('0x19')]||0x3;this[_0x5211('0x1a')]=_0x3920a5['dialAbandonedRetryFrequency']||0x96;this[_0x5211('0x1b')]=_0x3920a5[_0x5211('0x1b')]||0x3;this[_0x5211('0x1c')]=_0x3920a5[_0x5211('0x1c')]||0x96;this[_0x5211('0x1d')]=_0x3920a5[_0x5211('0x1d')]||0x3;this[_0x5211('0x1e')]=_0x3920a5[_0x5211('0x1e')]||0x96;this[_0x5211('0x1f')]=_0x3920a5[_0x5211('0x1f')]||'DESC';this[_0x5211('0x20')]=_0x3920a5['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x3920a5['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5211('0x21')]=_0x3920a5[_0x5211('0x21')]||undefined;this[_0x5211('0x22')]=_0x3920a5[_0x5211('0x22')]?_0x3920a5[_0x5211('0x22')]:undefined;this[_0x5211('0x23')]=_0x3920a5[_0x5211('0x23')]?_0x3920a5[_0x5211('0x23')]:undefined;this[_0x5211('0x24')]=_0x3920a5[_0x5211('0x24')]?_0x3920a5['Interval']:undefined;this[_0x5211('0x25')]=_0x3920a5['SquareProject']?_0x3920a5[_0x5211('0x25')]:undefined;this[_0x5211('0x26')]=_0x3920a5[_0x5211('0x25')]?_0x3920a5['SquareProject'][_0x5211('0x0')]:undefined;this[_0x5211('0x27')]=_0x3920a5[_0x5211('0x27')]||![];this[_0x5211('0x28')]=_0x3920a5[_0x5211('0x28')];this[_0x5211('0x29')]=_0x3920a5[_0x5211('0x29')];this[_0x5211('0x2a')]=_0x3920a5[_0x5211('0x2a')];this['dialAMDTotalAnalysisTime']=_0x3920a5[_0x5211('0x2b')];this[_0x5211('0x2c')]=_0x3920a5[_0x5211('0x2c')];this['dialAMDBetweenWordsSilence']=_0x3920a5[_0x5211('0x2d')];this[_0x5211('0x2e')]=_0x3920a5[_0x5211('0x2e')];this[_0x5211('0x2f')]=_0x3920a5[_0x5211('0x2f')];this[_0x5211('0x30')]=_0x3920a5['dialAMDMaximumWordLength'];}module['exports']=Campaign;
\ No newline at end of file
+var _0x4255=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','name','type','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x4255,0x1b8));var _0x5425=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x4255[_0x35da42];return _0x370035;};'use strict';function Campaign(_0x43f353){this['id']=_0x43f353['id']||0x0;this[_0x5425('0x0')]=_0x43f353[_0x5425('0x0')]||'';this[_0x5425('0x1')]=_0x43f353[_0x5425('0x1')]||'campaign';this['originated']=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x5425('0x2')]=0x0;this[_0x5425('0x3')]='';this[_0x5425('0x4')]=!![];this[_0x5425('0x5')]=_0x43f353[_0x5425('0x5')];this[_0x5425('0x6')]=_0x43f353['limitCalls'];this['dialTimezone']=_0x43f353[_0x5425('0x7')]||null;this[_0x5425('0x8')]=_0x43f353[_0x5425('0x8')]?_0x43f353['dialGlobalInterval']:null;this[_0x5425('0x9')]=_0x43f353[_0x5425('0x9')];this['dialOriginateCallerIdNumber']=_0x43f353[_0x5425('0xa')];this[_0x5425('0xb')]=_0x43f353[_0x5425('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x43f353[_0x5425('0xc')];this[_0x5425('0xd')]=_0x43f353[_0x5425('0xd')];this[_0x5425('0xe')]=_0x43f353[_0x5425('0xe')];this[_0x5425('0xf')]=_0x43f353[_0x5425('0xf')];this[_0x5425('0x10')]=_0x43f353[_0x5425('0x10')];this[_0x5425('0x11')]=_0x43f353[_0x5425('0x11')];this[_0x5425('0x12')]=_0x43f353[_0x5425('0x12')];this[_0x5425('0x13')]=_0x43f353['dialNoSuchNumberMaxRetry']||0x3;this[_0x5425('0x14')]=_0x43f353[_0x5425('0x14')]||0x96;this[_0x5425('0x15')]=_0x43f353[_0x5425('0x15')]||0x3;this['dialDropRetryFrequency']=_0x43f353[_0x5425('0x16')]||0x96;this[_0x5425('0x17')]=_0x43f353[_0x5425('0x17')]||0x3;this[_0x5425('0x18')]=_0x43f353[_0x5425('0x18')]||0x96;this[_0x5425('0x19')]=_0x43f353[_0x5425('0x19')]||0x3;this[_0x5425('0x1a')]=_0x43f353['dialMachineRetryFrequency']||0x96;this[_0x5425('0x1b')]=_0x43f353[_0x5425('0x1b')]||0x3;this[_0x5425('0x1c')]=_0x43f353['dialAgentRejectRetryFrequency']||0x96;this[_0x5425('0x1d')]=_0x43f353[_0x5425('0x1d')]||'DESC';this[_0x5425('0x1e')]=_0x43f353[_0x5425('0x1e')]||undefined;this[_0x5425('0x1f')]=_0x43f353[_0x5425('0x1f')]||undefined;this[_0x5425('0x20')]=_0x43f353['dialCutDigit']||undefined;this[_0x5425('0x21')]=_0x43f353[_0x5425('0x21')]?_0x43f353[_0x5425('0x21')]:undefined;this[_0x5425('0x22')]=_0x43f353[_0x5425('0x22')]?_0x43f353['Trunk']:undefined;this[_0x5425('0x23')]=_0x43f353[_0x5425('0x23')]?_0x43f353[_0x5425('0x23')]:undefined;this[_0x5425('0x24')]=_0x43f353[_0x5425('0x24')]?_0x43f353[_0x5425('0x24')]:undefined;this[_0x5425('0x25')]=_0x43f353[_0x5425('0x24')]?_0x43f353[_0x5425('0x24')][_0x5425('0x0')]:undefined;this['dialAMDActive']=_0x43f353[_0x5425('0x26')]||![];this[_0x5425('0x27')]=_0x43f353['dialAMDInitialSilence'];this[_0x5425('0x28')]=_0x43f353[_0x5425('0x28')];this['dialAMDAfterGreetingSilence']=_0x43f353[_0x5425('0x29')];this[_0x5425('0x2a')]=_0x43f353['dialAMDTotalAnalysisTime'];this[_0x5425('0x2b')]=_0x43f353[_0x5425('0x2b')];this[_0x5425('0x2c')]=_0x43f353['dialAMDBetweenWordsSilence'];this[_0x5425('0x2d')]=_0x43f353[_0x5425('0x2d')];this['dialAMDSilenceThreshold']=_0x43f353['dialAMDSilenceThreshold'];this[_0x5425('0x2e')]=_0x43f353[_0x5425('0x2e')];}module['exports']=Campaign;
\ No newline at end of file
index ee1b743..f31c4c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37c7=['accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','type','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x27472b,_0x1e5ca1){var _0x249243=function(_0x5b304f){while(--_0x5b304f){_0x27472b['push'](_0x27472b['shift']());}};_0x249243(++_0x1e5ca1);}(_0x37c7,0xda));var _0x737c=function(_0x43f8cc,_0x592b95){_0x43f8cc=_0x43f8cc-0x0;var _0x1c8808=_0x37c7[_0x43f8cc];return _0x1c8808;};'use strict';function Channel(){this[_0x737c('0x0')]=null;this['channel']='';this[_0x737c('0x1')]='';this[_0x737c('0x2')]=0x0;this[_0x737c('0x3')]='';this[_0x737c('0x4')]=undefined;this[_0x737c('0x5')]=undefined;this[_0x737c('0x6')]=0x0;this[_0x737c('0x7')]='';this[_0x737c('0x8')]=0x0;this[_0x737c('0x9')]=0x0;this[_0x737c('0xa')]=0x0;this[_0x737c('0xb')]=![];this[_0x737c('0xc')]=null;this[_0x737c('0xd')]=null;this[_0x737c('0xe')]=![];this[_0x737c('0xf')]=![];this[_0x737c('0x10')]='';this[_0x737c('0x11')]='';this['duration']=0x0;this[_0x737c('0x12')]=0x0;this['holdtime']=0x0;this[_0x737c('0x13')]=null;this['tag']=null;this[_0x737c('0x14')]=null;this['monitor']=![];this[_0x737c('0x15')]=null;this[_0x737c('0x16')]=null;this[_0x737c('0x17')]=[];this[_0x737c('0x18')]=undefined;this[_0x737c('0x19')]=undefined;this['transferType']=undefined;this[_0x737c('0x1a')]=0x0;}module[_0x737c('0x1b')]=Channel;
\ No newline at end of file
+var _0x731b=['monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0x731b,0xf7));var _0xb731=function(_0x695a40,_0x31a995){_0x695a40=_0x695a40-0x0;var _0xb1b4cc=_0x731b[_0x695a40];return _0xb1b4cc;};'use strict';function Channel(){this[_0xb731('0x0')]=null;this[_0xb731('0x1')]='';this['destinationchannel']='';this[_0xb731('0x2')]=0x0;this[_0xb731('0x3')]='';this[_0xb731('0x4')]=undefined;this[_0xb731('0x5')]=undefined;this[_0xb731('0x6')]=0x0;this[_0xb731('0x7')]='';this['uniqueid']=0x0;this[_0xb731('0x8')]=0x0;this[_0xb731('0x9')]=0x0;this[_0xb731('0xa')]=![];this[_0xb731('0xb')]=null;this[_0xb731('0xc')]=null;this[_0xb731('0xd')]=![];this[_0xb731('0xe')]=![];this['lastapplication']='';this[_0xb731('0xf')]='';this[_0xb731('0x10')]=0x0;this[_0xb731('0x11')]=0x0;this[_0xb731('0x12')]=0x0;this[_0xb731('0x13')]=null;this[_0xb731('0x14')]=null;this[_0xb731('0x15')]=null;this[_0xb731('0x16')]=![];this[_0xb731('0x17')]=null;this[_0xb731('0x18')]=null;this[_0xb731('0x19')]=[];this[_0xb731('0x1a')]=undefined;this[_0xb731('0x1b')]=undefined;this[_0xb731('0x1c')]=undefined;this[_0xb731('0x1d')]=0x0;}module['exports']=Channel;
\ No newline at end of file
index f3eb080..f0d9bfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2d1=['token','tokenSecret','type','serverUrl','Configurations','name','username','authType','password','consumerKey','consumerSecret'];(function(_0x54b17d,_0x3e52d0){var _0x192508=function(_0xda75e4){while(--_0xda75e4){_0x54b17d['push'](_0x54b17d['shift']());}};_0x192508(++_0x3e52d0);}(_0xf2d1,0x1f4));var _0x1f2d=function(_0x32a42c,_0x5bffda){_0x32a42c=_0x32a42c-0x0;var _0x272fc9=_0xf2d1[_0x32a42c];return _0x272fc9;};'use strict';function DeskAccount(_0x1b496f){this['id']=_0x1b496f['id']||0x0;this[_0x1f2d('0x0')]=_0x1b496f[_0x1f2d('0x0')]||'';this[_0x1f2d('0x1')]=_0x1b496f[_0x1f2d('0x1')]||'';this['remoteUri']=_0x1b496f['remoteUri']||'';this['authType']=_0x1b496f[_0x1f2d('0x2')]||'';this[_0x1f2d('0x3')]=_0x1b496f[_0x1f2d('0x3')]||'';this['consumerKey']=_0x1b496f[_0x1f2d('0x4')]||'';this[_0x1f2d('0x5')]=_0x1b496f['consumerSecret']||'';this['token']=_0x1b496f[_0x1f2d('0x6')]||'';this[_0x1f2d('0x7')]=_0x1b496f[_0x1f2d('0x7')]||'';this[_0x1f2d('0x8')]=_0x1b496f[_0x1f2d('0x8')]||'';this[_0x1f2d('0x9')]=_0x1b496f[_0x1f2d('0x9')]||'';this[_0x1f2d('0xa')]=_0x1b496f[_0x1f2d('0xa')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x2111=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2111,0xa2));var _0x1211=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x2111[_0x424357];return _0x29c68e;};'use strict';function DeskAccount(_0x408736){this['id']=_0x408736['id']||0x0;this[_0x1211('0x0')]=_0x408736['name']||'';this[_0x1211('0x1')]=_0x408736[_0x1211('0x1')]||'';this[_0x1211('0x2')]=_0x408736[_0x1211('0x2')]||'';this[_0x1211('0x3')]=_0x408736[_0x1211('0x3')]||'';this[_0x1211('0x4')]=_0x408736[_0x1211('0x4')]||'';this[_0x1211('0x5')]=_0x408736[_0x1211('0x5')]||'';this[_0x1211('0x6')]=_0x408736[_0x1211('0x6')]||'';this[_0x1211('0x7')]=_0x408736['token']||'';this['tokenSecret']=_0x408736[_0x1211('0x8')]||'';this[_0x1211('0x9')]=_0x408736[_0x1211('0x9')]||'';this[_0x1211('0xa')]=_0x408736[_0x1211('0xa')]||'';this[_0x1211('0xb')]=_0x408736['Configurations']||{};}module['exports']=DeskAccount;
\ No newline at end of file
index b9df7bb..7a11ac5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['name','password','remoteUri','tenantId','clientSecret','serverUrl','Configurations'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0xa74f,0x9a));var _0xfa74=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xa74f[_0x67f95e];return _0x538f5a;};'use strict';function Dynamics365Account(_0x4607a1){this['id']=_0x4607a1['id']||0x0;this['name']=_0x4607a1[_0xfa74('0x0')]||'';this['username']=_0x4607a1['username']||'';this[_0xfa74('0x1')]=_0x4607a1[_0xfa74('0x1')]||'';this[_0xfa74('0x2')]=_0x4607a1[_0xfa74('0x2')]||'';this['tenantId']=_0x4607a1[_0xfa74('0x3')]||'';this['clientId']=_0x4607a1['clientId']||'';this[_0xfa74('0x4')]=_0x4607a1[_0xfa74('0x4')]||{};this[_0xfa74('0x5')]=_0x4607a1[_0xfa74('0x5')]||'';this[_0xfa74('0x6')]=_0x4607a1[_0xfa74('0x6')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0x13f6=['clientId','clientSecret','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x1d39a3,_0x53036b){var _0x93f29b=function(_0x574d9d){while(--_0x574d9d){_0x1d39a3['push'](_0x1d39a3['shift']());}};_0x93f29b(++_0x53036b);}(_0x13f6,0x124));var _0x613f=function(_0x590afb,_0x33a68d){_0x590afb=_0x590afb-0x0;var _0x4b4c38=_0x13f6[_0x590afb];return _0x4b4c38;};'use strict';function Dynamics365Account(_0xf31e04){this['id']=_0xf31e04['id']||0x0;this[_0x613f('0x0')]=_0xf31e04['name']||'';this['username']=_0xf31e04[_0x613f('0x1')]||'';this[_0x613f('0x2')]=_0xf31e04[_0x613f('0x2')]||'';this['remoteUri']=_0xf31e04[_0x613f('0x3')]||'';this[_0x613f('0x4')]=_0xf31e04[_0x613f('0x4')]||'';this['clientId']=_0xf31e04[_0x613f('0x5')]||'';this[_0x613f('0x6')]=_0xf31e04['clientSecret']||{};this['serverUrl']=_0xf31e04['serverUrl']||'';this['Configurations']=_0xf31e04[_0x613f('0x7')]||{};}module[_0x613f('0x8')]=Dynamics365Account;
\ No newline at end of file
index 39fd0c0..7a2f574 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4908=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk'];(function(_0x15af84,_0x7a5b4d){var _0x5ac0a4=function(_0x97cb67){while(--_0x97cb67){_0x15af84['push'](_0x15af84['shift']());}};_0x5ac0a4(++_0x7a5b4d);}(_0x4908,0x193));var _0x8490=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x4908[_0x1f9f37];return _0x21c080;};'use strict';function FaxAccount(_0xc5caca){this['id']=_0xc5caca['id']||0x0;this['name']=_0xc5caca[_0x8490('0x0')]||'';this[_0x8490('0x1')]=_0xc5caca[_0x8490('0x1')];this[_0x8490('0x2')]=_0xc5caca[_0x8490('0x2')];this[_0x8490('0x3')]=_0xc5caca[_0x8490('0x3')];this[_0x8490('0x4')]=_0xc5caca[_0x8490('0x4')];this['minrate']=_0xc5caca['minrate']||0x960;this[_0x8490('0x5')]=_0xc5caca['maxrate']||0x3840;this[_0x8490('0x6')]=_0xc5caca[_0x8490('0x6')]||_0x8490('0x7');this['gateway']=_0xc5caca[_0x8490('0x8')]||'no';this['faxdetect']=_0xc5caca[_0x8490('0x9')]||'no';this[_0x8490('0xa')]=_0xc5caca[_0x8490('0xa')]||0x1388;this[_0x8490('0xb')]=_0xc5caca[_0x8490('0xb')]||'SIP';this[_0x8490('0xc')]=_0xc5caca[_0x8490('0xc')]?_0xc5caca['Trunk']:undefined;this[_0x8490('0xd')]=_0xc5caca[_0x8490('0xd')];this['key']=_0xc5caca[_0x8490('0xe')];}module[_0x8490('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x591d=['key','exports','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x480c01,_0x1e0dbe){var _0xe5b1e7=function(_0x37fa56){while(--_0x37fa56){_0x480c01['push'](_0x480c01['shift']());}};_0xe5b1e7(++_0x1e0dbe);}(_0x591d,0xe2));var _0xd591=function(_0x5deec1,_0x33e02b){_0x5deec1=_0x5deec1-0x0;var _0x19afaa=_0x591d[_0x5deec1];return _0x19afaa;};'use strict';function FaxAccount(_0x21381e){this['id']=_0x21381e['id']||0x0;this['name']=_0x21381e['name']||'';this[_0xd591('0x0')]=_0x21381e[_0xd591('0x0')];this['ecm']=_0x21381e[_0xd591('0x1')];this[_0xd591('0x2')]=_0x21381e[_0xd591('0x2')];this[_0xd591('0x3')]=_0x21381e[_0xd591('0x3')];this['minrate']=_0x21381e[_0xd591('0x4')]||0x960;this[_0xd591('0x5')]=_0x21381e['maxrate']||0x3840;this[_0xd591('0x6')]=_0x21381e[_0xd591('0x6')]||'v17,v27,v29';this[_0xd591('0x7')]=_0x21381e[_0xd591('0x7')]||'no';this[_0xd591('0x8')]=_0x21381e['faxdetect']||'no';this[_0xd591('0x9')]=_0x21381e[_0xd591('0x9')]||0x1388;this[_0xd591('0xa')]=_0x21381e[_0xd591('0xa')]||_0xd591('0xb');this[_0xd591('0xc')]=_0x21381e['Trunk']?_0x21381e[_0xd591('0xc')]:undefined;this[_0xd591('0xd')]=_0x21381e['ListId'];this[_0xd591('0xe')]=_0x21381e[_0xd591('0xe')];}module[_0xd591('0xf')]=FaxAccount;
\ No newline at end of file
index 5ecb8b3..edbaf58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabff=['name','username','token','remoteUri','serverUrl','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xabff,0x90));var _0xfabf=function(_0x8969c2,_0xc524b7){_0x8969c2=_0x8969c2-0x0;var _0x519f23=_0xabff[_0x8969c2];return _0x519f23;};'use strict';function FreshdeskAccount(_0x2f8906){this['id']=_0x2f8906['id']||0x0;this[_0xfabf('0x0')]=_0x2f8906[_0xfabf('0x0')]||'';this[_0xfabf('0x1')]=_0x2f8906[_0xfabf('0x1')]||'';this['apiKey']=_0x2f8906[_0xfabf('0x2')]||'';this[_0xfabf('0x3')]=_0x2f8906['remoteUri']||'';this['serverUrl']=_0x2f8906[_0xfabf('0x4')]||'';this['Configurations']=_0x2f8906['Configurations']||{};}module[_0xfabf('0x5')]=FreshdeskAccount;
\ No newline at end of file
+var _0xe30b=['serverUrl','name','username','token','remoteUri'];(function(_0x96776e,_0x2376bd){var _0x486d8a=function(_0x11ee8b){while(--_0x11ee8b){_0x96776e['push'](_0x96776e['shift']());}};_0x486d8a(++_0x2376bd);}(_0xe30b,0xd8));var _0xbe30=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0xe30b[_0xdefbc3];return _0x367798;};'use strict';function FreshdeskAccount(_0x2651da){this['id']=_0x2651da['id']||0x0;this['name']=_0x2651da[_0xbe30('0x0')]||'';this[_0xbe30('0x1')]=_0x2651da[_0xbe30('0x1')]||'';this['apiKey']=_0x2651da[_0xbe30('0x2')]||'';this[_0xbe30('0x3')]=_0x2651da['remoteUri']||'';this[_0xbe30('0x4')]=_0x2651da[_0xbe30('0x4')]||'';this['Configurations']=_0x2651da['Configurations']||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index b6ea388..ae22d0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2171=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x530ffb,_0x412ef5){var _0x1a580d=function(_0x5cc1d2){while(--_0x5cc1d2){_0x530ffb['push'](_0x530ffb['shift']());}};_0x1a580d(++_0x412ef5);}(_0x2171,0x143));var _0x1217=function(_0x52c617,_0x285a92){_0x52c617=_0x52c617-0x0;var _0xc6e1f2=_0x2171[_0x52c617];return _0xc6e1f2;};'use strict';function FreshsalesAccount(_0xcac228){this['id']=_0xcac228['id']||0x0;this[_0x1217('0x0')]=_0xcac228[_0x1217('0x0')]||'';this[_0x1217('0x1')]=_0xcac228['username']||'';this['apiKey']=_0xcac228[_0x1217('0x2')]||'';this['remoteUri']=_0xcac228[_0x1217('0x3')]||'';this[_0x1217('0x4')]=_0xcac228[_0x1217('0x4')]||'';this[_0x1217('0x5')]=_0xcac228['Configurations']||{};}module[_0x1217('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0x8a8b=['token','remoteUri','serverUrl','Configurations','username'];(function(_0x13ddf0,_0x2dd6f5){var _0x37183c=function(_0x30754e){while(--_0x30754e){_0x13ddf0['push'](_0x13ddf0['shift']());}};_0x37183c(++_0x2dd6f5);}(_0x8a8b,0xae));var _0xb8a8=function(_0x3f49ff,_0x462612){_0x3f49ff=_0x3f49ff-0x0;var _0x5121ef=_0x8a8b[_0x3f49ff];return _0x5121ef;};'use strict';function FreshsalesAccount(_0x11268b){this['id']=_0x11268b['id']||0x0;this['name']=_0x11268b['name']||'';this[_0xb8a8('0x0')]=_0x11268b[_0xb8a8('0x0')]||'';this['apiKey']=_0x11268b[_0xb8a8('0x1')]||'';this['remoteUri']=_0x11268b[_0xb8a8('0x2')]||'';this['serverUrl']=_0x11268b[_0xb8a8('0x3')]||'';this[_0xb8a8('0x4')]=_0x11268b[_0xb8a8('0x4')]||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
index 3560e4b..ffc5ff9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d9=['lastAssignedTo','motionChannel','voice','variables','exports','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority'];(function(_0x16f434,_0x34e1ff){var _0x497357=function(_0x2e5096){while(--_0x2e5096){_0x16f434['push'](_0x16f434['shift']());}};_0x497357(++_0x34e1ff);}(_0x50d9,0x87));var _0x950d=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x50d9[_0xd1d19a];return _0x52a79d;};'use strict';function QueueReport(){this['type']=_0x950d('0x0');this[_0x950d('0x1')]='';this['calleridnum']='';this[_0x950d('0x2')]='';this[_0x950d('0x3')]='';this[_0x950d('0x4')]=null;this[_0x950d('0x5')]=null;this[_0x950d('0x6')]=0x1;this[_0x950d('0x7')]=0x1;this[_0x950d('0x8')]=![];this[_0x950d('0x9')]=null;this[_0x950d('0xa')]=![];this[_0x950d('0xb')]=null;this[_0x950d('0xc')]=![];this[_0x950d('0xd')]=null;this[_0x950d('0xe')]=0x1;this[_0x950d('0xf')]='';this[_0x950d('0x10')]='';this['connectedlinename']='';this[_0x950d('0x11')]='';this[_0x950d('0x12')]='';this[_0x950d('0x13')]='';this[_0x950d('0x14')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x950d('0x15')]='';this[_0x950d('0x16')]=_0x950d('0x17');this['mohtime']=0x0;this[_0x950d('0x18')]={};}module[_0x950d('0x19')]=QueueReport;
\ No newline at end of file
+var _0x69ca=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','exports','type','inbound','uniqueid','queue','queuecallerjoinAt'];(function(_0x5930a5,_0x1f5378){var _0x5ca28d=function(_0xc890f7){while(--_0xc890f7){_0x5930a5['push'](_0x5930a5['shift']());}};_0x5ca28d(++_0x1f5378);}(_0x69ca,0xdb));var _0xa69c=function(_0x22cea4,_0x54f16a){_0x22cea4=_0x22cea4-0x0;var _0x59d75b=_0x69ca[_0x22cea4];return _0x59d75b;};'use strict';function QueueReport(){this[_0xa69c('0x0')]=_0xa69c('0x1');this[_0xa69c('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0xa69c('0x3')]='';this[_0xa69c('0x4')]=null;this[_0xa69c('0x5')]=null;this[_0xa69c('0x6')]=0x1;this[_0xa69c('0x7')]=0x1;this[_0xa69c('0x8')]=![];this[_0xa69c('0x9')]=null;this[_0xa69c('0xa')]=![];this[_0xa69c('0xb')]=null;this[_0xa69c('0xc')]=![];this[_0xa69c('0xd')]=null;this[_0xa69c('0xe')]=0x1;this[_0xa69c('0xf')]='';this[_0xa69c('0x10')]='';this[_0xa69c('0x11')]='';this[_0xa69c('0x12')]='';this[_0xa69c('0x13')]='';this[_0xa69c('0x14')]='';this[_0xa69c('0x15')]='';this['holdtime']=0x0;this[_0xa69c('0x16')]=![];this[_0xa69c('0x17')]='';this[_0xa69c('0x18')]=_0xa69c('0x19');this[_0xa69c('0x1a')]=0x0;this['variables']={};}module[_0xa69c('0x1b')]=QueueReport;
\ No newline at end of file
index 6fd6cf9..e754ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1735=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3b8edb,_0x50f25d){var _0x38971c=function(_0x5c0e54){while(--_0x5c0e54){_0x3b8edb['push'](_0x3b8edb['shift']());}};_0x38971c(++_0x50f25d);}(_0x1735,0xb1));var _0x5173=function(_0x1bffec,_0x3aeee7){_0x1bffec=_0x1bffec-0x0;var _0x38b322=_0x1735[_0x1bffec];return _0x38b322;};'use strict';function SalesforceAccount(_0x13c5ef){this['id']=_0x13c5ef['id']||0x0;this[_0x5173('0x0')]=_0x13c5ef[_0x5173('0x0')]||'';this[_0x5173('0x1')]=_0x13c5ef[_0x5173('0x1')]||'';this['remoteUri']=_0x13c5ef[_0x5173('0x2')]||'';this['password']=_0x13c5ef[_0x5173('0x3')]||'';this['clientId']=_0x13c5ef[_0x5173('0x4')]||'';this['clientSecret']=_0x13c5ef[_0x5173('0x5')]||'';this[_0x5173('0x6')]=_0x13c5ef[_0x5173('0x6')]||'';this[_0x5173('0x7')]=_0x13c5ef[_0x5173('0x7')]||_0x5173('0x8');this[_0x5173('0x9')]=_0x13c5ef[_0x5173('0x9')]||'';this[_0x5173('0xa')]=_0x13c5ef[_0x5173('0xa')]||{};}module[_0x5173('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0x1e43=['password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x56934e,_0x2c008b){var _0x2fed47=function(_0x109b01){while(--_0x109b01){_0x56934e['push'](_0x56934e['shift']());}};_0x2fed47(++_0x2c008b);}(_0x1e43,0x168));var _0x31e4=function(_0x3cadbd,_0x12bc43){_0x3cadbd=_0x3cadbd-0x0;var _0x296da9=_0x1e43[_0x3cadbd];return _0x296da9;};'use strict';function SalesforceAccount(_0x7c0dfb){this['id']=_0x7c0dfb['id']||0x0;this[_0x31e4('0x0')]=_0x7c0dfb[_0x31e4('0x0')]||'';this[_0x31e4('0x1')]=_0x7c0dfb[_0x31e4('0x1')]||'';this[_0x31e4('0x2')]=_0x7c0dfb[_0x31e4('0x2')]||'';this['password']=_0x7c0dfb[_0x31e4('0x3')]||'';this[_0x31e4('0x4')]=_0x7c0dfb['clientId']||'';this[_0x31e4('0x5')]=_0x7c0dfb['clientSecret']||'';this['securityToken']=_0x7c0dfb['securityToken']||'';this['type']=_0x7c0dfb[_0x31e4('0x6')]||_0x31e4('0x7');this[_0x31e4('0x8')]=_0x7c0dfb[_0x31e4('0x8')]||'';this['Configurations']=_0x7c0dfb[_0x31e4('0x9')]||{};}module[_0x31e4('0xa')]=SalesforceAccount;
\ No newline at end of file
index 2df54f8..f6050c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4ee=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x32e4db,_0x2cfce7){var _0x8f53e0=function(_0x34c0f2){while(--_0x34c0f2){_0x32e4db['push'](_0x32e4db['shift']());}};_0x8f53e0(++_0x2cfce7);}(_0xb4ee,0x1d5));var _0xeb4e=function(_0x18381f,_0x45e87c){_0x18381f=_0x18381f-0x0;var _0x1ccb6e=_0xb4ee[_0x18381f];return _0x1ccb6e;};'use strict';function ServicenowAccount(_0x3edba9){this['id']=_0x3edba9['id']||0x0;this[_0xeb4e('0x0')]=_0x3edba9[_0xeb4e('0x0')]||'';this[_0xeb4e('0x1')]=_0x3edba9['username']||'';this[_0xeb4e('0x2')]=_0x3edba9[_0xeb4e('0x2')]||'';this[_0xeb4e('0x3')]=_0x3edba9['remoteUri']||'';this[_0xeb4e('0x4')]=_0x3edba9[_0xeb4e('0x4')]||'';this['Configurations']=_0x3edba9[_0xeb4e('0x5')]||{};}module[_0xeb4e('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x85f2=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x85f2,0x1f4));var _0x285f=function(_0x493985,_0xabbee5){_0x493985=_0x493985-0x0;var _0x532b94=_0x85f2[_0x493985];return _0x532b94;};'use strict';function ServicenowAccount(_0x4255a5){this['id']=_0x4255a5['id']||0x0;this['name']=_0x4255a5[_0x285f('0x0')]||'';this['username']=_0x4255a5[_0x285f('0x1')]||'';this[_0x285f('0x2')]=_0x4255a5[_0x285f('0x2')]||'';this[_0x285f('0x3')]=_0x4255a5[_0x285f('0x3')]||'';this['serverUrl']=_0x4255a5[_0x285f('0x4')]||'';this[_0x285f('0x5')]=_0x4255a5[_0x285f('0x5')]||{};}module[_0x285f('0x6')]=ServicenowAccount;
\ No newline at end of file
index 4ce12f2..7b71968 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa65b=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x5b06fb,_0x1190f4){var _0x53a53a=function(_0x52adb4){while(--_0x52adb4){_0x5b06fb['push'](_0x5b06fb['shift']());}};_0x53a53a(++_0x1190f4);}(_0xa65b,0x100));var _0xba65=function(_0x8adbfe,_0x5b464e){_0x8adbfe=_0x8adbfe-0x0;var _0x5bb8ce=_0xa65b[_0x8adbfe];return _0x5bb8ce;};'use strict';function SugarcrmAccount(_0x4a6bda){this['id']=_0x4a6bda['id']||0x0;this[_0xba65('0x0')]=_0x4a6bda[_0xba65('0x0')]||'';this[_0xba65('0x1')]=_0x4a6bda['username']||'';this[_0xba65('0x2')]=_0x4a6bda[_0xba65('0x2')]||'';this[_0xba65('0x3')]=_0x4a6bda[_0xba65('0x3')]||'';this[_0xba65('0x4')]=_0x4a6bda[_0xba65('0x4')]||'';this[_0xba65('0x5')]=_0x4a6bda[_0xba65('0x5')]||{};}module[_0xba65('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xc4aa=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x180e28,_0x39a5e0){var _0x8cc98a=function(_0x1a7bcc){while(--_0x1a7bcc){_0x180e28['push'](_0x180e28['shift']());}};_0x8cc98a(++_0x39a5e0);}(_0xc4aa,0x1a1));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';function SugarcrmAccount(_0x54f735){this['id']=_0x54f735['id']||0x0;this[_0xac4a('0x0')]=_0x54f735[_0xac4a('0x0')]||'';this[_0xac4a('0x1')]=_0x54f735[_0xac4a('0x1')]||'';this[_0xac4a('0x2')]=_0x54f735[_0xac4a('0x2')]||'';this[_0xac4a('0x3')]=_0x54f735[_0xac4a('0x3')]||'';this[_0xac4a('0x4')]=_0x54f735[_0xac4a('0x4')]||'';this['Configurations']=_0x54f735[_0xac4a('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index c1a3436..54fa2ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ce=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x58c053,_0x51c43f){var _0xe1079=function(_0x172345){while(--_0x172345){_0x58c053['push'](_0x58c053['shift']());}};_0xe1079(++_0x51c43f);}(_0x49ce,0x116));var _0xe49c=function(_0x1bfec9,_0x2a863a){_0x1bfec9=_0x1bfec9-0x0;var _0x35cb18=_0x49ce[_0x1bfec9];return _0x35cb18;};'use strict';function Telephone(_0x4b6145){this['id']=_0x4b6145['id']||0x0;this[_0xe49c('0x0')]=_0x4b6145[_0xe49c('0x0')]||'';this[_0xe49c('0x1')]=_0x4b6145[_0xe49c('0x1')]||'';this['state']=_0xe49c('0x2');this[_0xe49c('0x3')]=0x0;this[_0xe49c('0x4')]=_0xe49c('0x2');this[_0xe49c('0x5')]='';}module[_0xe49c('0x6')]=Telephone;
\ No newline at end of file
+var _0x06ef=['stateTime','status','unknown','exports','name'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0x06ef,0x185));var _0xf06e=function(_0x2e6f20,_0x15fdae){_0x2e6f20=_0x2e6f20-0x0;var _0xdc9665=_0x06ef[_0x2e6f20];return _0xdc9665;};'use strict';function Telephone(_0x1faed1){this['id']=_0x1faed1['id']||0x0;this['name']=_0x1faed1[_0xf06e('0x0')]||'';this['accountcode']=_0x1faed1['accountcode']||'';this['state']='unknown';this[_0xf06e('0x1')]=0x0;this[_0xf06e('0x2')]=_0xf06e('0x3');this['address']='';}module[_0xf06e('0x4')]=Telephone;
\ No newline at end of file
index f995d6a..b0497d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x22403f,_0x571196){var _0x5abe88=function(_0x10320f){while(--_0x10320f){_0x22403f['push'](_0x22403f['shift']());}};_0x5abe88(++_0x571196);}(_0xb10b,0x12a));var _0xbb10=function(_0x3376bd,_0x4fdb2a){_0x3376bd=_0x3376bd-0x0;var _0x587b0b=_0xb10b[_0x3376bd];return _0x587b0b;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x239474,_0x251dcc){var _0x2b80b3=function(_0x11f914){while(--_0x11f914){_0x239474['push'](_0x239474['shift']());}};_0x2b80b3(++_0x251dcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index 3cc8ca2..c28573d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x8ab3eb,_0x20b6ea){var _0x443a2c=function(_0x396400){while(--_0x396400){_0x8ab3eb['push'](_0x8ab3eb['shift']());}};_0x443a2c(++_0x20b6ea);}(_0x757a,0xde));var _0xa757=function(_0x8f5644,_0x2fd7b1){_0x8f5644=_0x8f5644-0x0;var _0x5a2dae=_0x757a[_0x8f5644];return _0x5a2dae;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger;
\ No newline at end of file
+var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x0b0e[_0x44afa4];return _0xcad289;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger;
\ No newline at end of file
index 7d1dfc3..d4f9e2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8577=['domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','unknown','stateTime','registry','indexOf','split','domain'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x8577,0x1b9));var _0x7857=function(_0x16e73a,_0x146629){_0x16e73a=_0x16e73a-0x0;var _0x187aa1=_0x8577[_0x16e73a];return _0x187aa1;};'use strict';function Trunk(_0x13e038){this['id']=_0x13e038['id']||0x0;this['active']=_0x13e038[_0x7857('0x0')]||![];this['name']=_0x13e038['name']||'';this['state']=_0x7857('0x1');this[_0x7857('0x2')]=0x0;this['status']='unknown';this['registry']=_0x13e038['registry']&&_0x13e038[_0x7857('0x3')][_0x7857('0x4')](':')?_0x13e038[_0x7857('0x3')][_0x7857('0x5')](':')[0x0]:'';this['host']='';this['port']='';this[_0x7857('0x6')]='';this[_0x7857('0x7')]='';this[_0x7857('0x8')]='';this[_0x7857('0x9')]=_0x7857('0x1');this[_0x7857('0xa')]='';this[_0x7857('0xb')]='';this[_0x7857('0xc')]=_0x13e038[_0x7857('0xc')]||'';}module[_0x7857('0xd')]=Trunk;
\ No newline at end of file
+var _0x737d=['indexOf','host','port','domain','domainport','refresh','stateRegistry','address','defaultuser','active','name','state','unknown','stateTime','registry'];(function(_0x4ddba7,_0x67c191){var _0x4b1cba=function(_0xb53aab){while(--_0xb53aab){_0x4ddba7['push'](_0x4ddba7['shift']());}};_0x4b1cba(++_0x67c191);}(_0x737d,0x144));var _0xd737=function(_0x1003fb,_0x5cb2cd){_0x1003fb=_0x1003fb-0x0;var _0x23d3df=_0x737d[_0x1003fb];return _0x23d3df;};'use strict';function Trunk(_0x4cf56c){this['id']=_0x4cf56c['id']||0x0;this[_0xd737('0x0')]=_0x4cf56c[_0xd737('0x0')]||![];this['name']=_0x4cf56c[_0xd737('0x1')]||'';this[_0xd737('0x2')]=_0xd737('0x3');this[_0xd737('0x4')]=0x0;this['status']=_0xd737('0x3');this[_0xd737('0x5')]=_0x4cf56c['registry']&&_0x4cf56c[_0xd737('0x5')][_0xd737('0x6')](':')?_0x4cf56c[_0xd737('0x5')]['split'](':')[0x0]:'';this[_0xd737('0x7')]='';this[_0xd737('0x8')]='';this[_0xd737('0x9')]='';this[_0xd737('0xa')]='';this[_0xd737('0xb')]='';this[_0xd737('0xc')]=_0xd737('0x3');this['registrationtime']='';this[_0xd737('0xd')]='';this[_0xd737('0xe')]=_0x4cf56c['defaultuser']||'';}module['exports']=Trunk;
\ No newline at end of file
index 4f9f6e0..6f093f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6a5=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x121ffa,_0x2037b5){var _0x5f0bea=function(_0xd94804){while(--_0xd94804){_0x121ffa['push'](_0x121ffa['shift']());}};_0x5f0bea(++_0x2037b5);}(_0xd6a5,0x119));var _0x5d6a=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0xd6a5[_0x212579];return _0x55d50e;};'use strict';function voiceExtension(_0x29fef3){this['id']=_0x29fef3['id']||0x0;this[_0x5d6a('0x0')]=_0x29fef3[_0x5d6a('0x0')]||'';this[_0x5d6a('0x1')]=_0x29fef3[_0x5d6a('0x1')]||_0x5d6a('0x2');this['mandatoryDisposition']=_0x29fef3[_0x5d6a('0x3')]||![];}module[_0x5d6a('0x4')]=voiceExtension;
\ No newline at end of file
+var _0xf0bd=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x161078,_0xa85c39){var _0x129502=function(_0x3ae047){while(--_0x3ae047){_0x161078['push'](_0x161078['shift']());}};_0x129502(++_0xa85c39);}(_0xf0bd,0xa4));var _0xdf0b=function(_0x580795,_0x90f61){_0x580795=_0x580795-0x0;var _0x20eea5=_0xf0bd[_0x580795];return _0x20eea5;};'use strict';function voiceExtension(_0x50660e){this['id']=_0x50660e['id']||0x0;this[_0xdf0b('0x0')]=_0x50660e[_0xdf0b('0x0')]||'';this['recordingFormat']=_0x50660e[_0xdf0b('0x1')]||_0xdf0b('0x2');this[_0xdf0b('0x3')]=_0x50660e[_0xdf0b('0x3')]||![];}module[_0xdf0b('0x4')]=voiceExtension;
\ No newline at end of file
index 89d4c16..fd67860 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1844=['dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel'];(function(_0x2b7f55,_0x640fa3){var _0x3356dd=function(_0x33ecd9){while(--_0x33ecd9){_0x2b7f55['push'](_0x2b7f55['shift']());}};_0x3356dd(++_0x640fa3);}(_0x1844,0x142));var _0x4184=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x1844[_0x845505];return _0x2513b9;};'use strict';var statusDesc=[_0x4184('0x0'),_0x4184('0x1'),_0x4184('0x2'),_0x4184('0x3'),_0x4184('0x4'),_0x4184('0x5'),_0x4184('0x6'),_0x4184('0x7'),_0x4184('0x8')];var monitorFormat={'wav':_0x4184('0x9'),'wav49':_0x4184('0xa'),'gsm':_0x4184('0xb')};var strategy={'rrmemory':_0x4184('0xc'),'roundrobin':'roundrobin'};function VoiceQueue(_0x9c7aa){this['id']=_0x9c7aa['id']||0x0;this['name']=_0x9c7aa[_0x4184('0xd')]||'';this[_0x4184('0xe')]=_0x9c7aa['monitor_format']||'';this[_0x4184('0xf')]=_0x9c7aa['type']||_0x4184('0x10');this[_0x4184('0x11')]=0x0;this['talking']=0x0;this[_0x4184('0x12')]=0x0;this[_0x4184('0x13')]=0x0;this[_0x4184('0x14')]=0x0;this[_0x4184('0x15')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x4184('0x16')]=0x0;this[_0x4184('0x17')]=0x0;this[_0x4184('0x18')]=_0x9c7aa[_0x4184('0x18')]||![];this[_0x4184('0x19')]=_0x9c7aa[_0x4184('0x19')]||0xa;this[_0x4184('0x1a')]=_0x9c7aa[_0x4184('0x1a')]||'no';this[_0x4184('0x1b')]=!![];this['message']='';this[_0x4184('0x1c')]=0x0;this['temp']=0x0;this[_0x4184('0x1d')]=_0x9c7aa[_0x4184('0x1d')]||null;this[_0x4184('0x1e')]=_0x9c7aa[_0x4184('0x1e')]?_0x9c7aa['dialGlobalInterval']:null;this[_0x4184('0x1f')]=_0x9c7aa[_0x4184('0x1f')];this['dialMethod']=_0x9c7aa[_0x4184('0x20')]||_0x4184('0x21');this[_0x4184('0x22')]=_0x9c7aa['dialLimitChannel']||0x0;this[_0x4184('0x23')]=_0x9c7aa[_0x4184('0x23')]||0x0;this['dialPowerLevel']=_0x9c7aa[_0x4184('0x24')]||0x1;this[_0x4184('0x25')]=_0x9c7aa[_0x4184('0x25')]||'dropRate';this[_0x4184('0x26')]=_0x9c7aa['dialPredictiveOptimizationPercentage']||0.03;this[_0x4184('0x27')]=_0x9c7aa[_0x4184('0x27')]||0x258;this[_0x4184('0x28')]=_0x9c7aa[_0x4184('0x28')]||_0x4184('0x29');this['dialOriginateCallerIdNumber']=_0x9c7aa[_0x4184('0x2a')]||_0x4184('0x29');this[_0x4184('0x2b')]=_0x9c7aa['dialOriginateTimeout']||0x1e;this[_0x4184('0x2c')]=_0x9c7aa[_0x4184('0x2c')]||_0x4184('0x2d');this[_0x4184('0x2e')]=_0x9c7aa[_0x4184('0x2e')]||0x3;this[_0x4184('0x2f')]=_0x9c7aa[_0x4184('0x2f')]||undefined;this['dialCongestionMaxRetry']=_0x9c7aa[_0x4184('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x9c7aa[_0x4184('0x31')]||0x96;this['dialBusyMaxRetry']=_0x9c7aa[_0x4184('0x32')]||0x3;this['dialBusyRetryFrequency']=_0x9c7aa['dialBusyRetryFrequency']||0x96;this[_0x4184('0x33')]=_0x9c7aa[_0x4184('0x33')]||0x3;this[_0x4184('0x34')]=_0x9c7aa[_0x4184('0x34')]||0x96;this[_0x4184('0x35')]=_0x9c7aa[_0x4184('0x35')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x9c7aa[_0x4184('0x36')]||0x96;this[_0x4184('0x37')]=_0x9c7aa['dialDropMaxRetry']||0x3;this[_0x4184('0x38')]=_0x9c7aa[_0x4184('0x38')]||0x96;this[_0x4184('0x39')]=_0x9c7aa[_0x4184('0x39')]||0x3;this[_0x4184('0x3a')]=_0x9c7aa[_0x4184('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x9c7aa[_0x4184('0x3b')]||0x3;this['dialMachineRetryFrequency']=_0x9c7aa['dialMachineRetryFrequency']||0x96;this[_0x4184('0x3c')]=_0x9c7aa[_0x4184('0x3c')]||0x3;this[_0x4184('0x3d')]=_0x9c7aa[_0x4184('0x3d')]||0x96;this[_0x4184('0x3e')]=_0x9c7aa[_0x4184('0x3e')]||0x4;this['Trunk']=_0x9c7aa['Trunk']?_0x9c7aa['Trunk']:undefined;this[_0x4184('0x3f')]=_0x9c7aa['TrunkBackup']?_0x9c7aa[_0x4184('0x3f')]:undefined;this[_0x4184('0x40')]=_0x9c7aa[_0x4184('0x40')]||undefined;this[_0x4184('0x41')]=_0x9c7aa[_0x4184('0x41')]?_0x9c7aa[_0x4184('0x41')]:undefined;this[_0x4184('0x42')]=_0x9c7aa[_0x4184('0x42')]||_0x4184('0x43');this[_0x4184('0x44')]=_0x9c7aa['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x4184('0x45')]=_0x9c7aa[_0x4184('0x45')]||undefined;this[_0x4184('0x46')]=strategy[_0x9c7aa[_0x4184('0x46')]]||_0x4184('0xc');this[_0x4184('0x47')]=!![];this[_0x4184('0x48')]=_0x9c7aa[_0x4184('0x48')]||![];this[_0x4184('0x49')]=_0x9c7aa[_0x4184('0x49')];this[_0x4184('0x4a')]=_0x9c7aa['dialAMDGreeting'];this[_0x4184('0x4b')]=_0x9c7aa[_0x4184('0x4b')];this['dialAMDTotalAnalysisTime']=_0x9c7aa[_0x4184('0x4c')];this[_0x4184('0x4d')]=_0x9c7aa['dialAMDMinWordLength'];this[_0x4184('0x4e')]=_0x9c7aa['dialAMDBetweenWordsSilence'];this[_0x4184('0x4f')]=_0x9c7aa[_0x4184('0x4f')];this['dialAMDSilenceThreshold']=_0x9c7aa[_0x4184('0x50')];this[_0x4184('0x51')]=_0x9c7aa[_0x4184('0x51')];this[_0x4184('0x52')]=0x0;this[_0x4184('0x53')]=0x0;this['timeout']=_0x9c7aa[_0x4184('0x54')];this[_0x4184('0x55')]=0x0;this[_0x4184('0x56')]=0x0;this[_0x4184('0x57')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x4184('0x58')]=0x0;this[_0x4184('0x59')]=0x0;this[_0x4184('0x5a')]=0x0;this[_0x4184('0x5b')]=0x0;this[_0x4184('0x5c')]=0x0;this[_0x4184('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x4184('0x5e')]=0x0;this[_0x4184('0x5f')]=0x0;this[_0x4184('0x60')]=0x0;this[_0x4184('0x61')]=undefined;this['startPredictive']=undefined;this[_0x4184('0x62')]=undefined;this[_0x4184('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x4184('0x64')]=0x0;this[_0x4184('0x65')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x4184('0x66')]=0x0;this[_0x4184('0x67')]=0x0;this[_0x4184('0x68')]=0x0;this[_0x4184('0x69')]=0x0;this[_0x4184('0x6a')]=_0x9c7aa[_0x4184('0x6b')]||0x14;this[_0x4184('0x6c')]=_0x9c7aa[_0x4184('0x6b')]||0xa;this[_0x4184('0x6d')]=0x0;this[_0x4184('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x4184('0x6f')]=0x0;this[_0x4184('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x9c7aa[_0x4184('0x71')]||0x1e;this[_0x4184('0x72')]=_0x9c7aa[_0x4184('0x72')]||![];this['dialPreviewAutoRecallMe']=!!_0x9c7aa['dialPreviewAutoRecallMe']||![];this['dialQueueProject2']=_0x9c7aa[_0x4184('0x73')]||undefined;this[_0x4184('0x74')]=_0x9c7aa[_0x4184('0x74')]||![];this[_0x4184('0x75')]=_0x9c7aa[_0x4184('0x75')]||![];this[_0x4184('0xe')]=monitorFormat[_0x9c7aa[_0x4184('0xe')]]?monitorFormat[_0x9c7aa['monitor_format']]:undefined;this['mandatoryDisposition']=_0x9c7aa['mandatoryDisposition']||![];this[_0x4184('0x76')]=_0x9c7aa['mandatoryDispositionPause']?_0x9c7aa['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
+var _0x5682=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x48a2e3,_0x596a21){var _0x5eff52=function(_0x35636a){while(--_0x35636a){_0x48a2e3['push'](_0x48a2e3['shift']());}};_0x5eff52(++_0x596a21);}(_0x5682,0x196));var _0x2568=function(_0x1c12b6,_0x58a6c4){_0x1c12b6=_0x1c12b6-0x0;var _0x2bf336=_0x5682[_0x1c12b6];return _0x2bf336;};'use strict';var statusDesc=[_0x2568('0x0'),_0x2568('0x1'),'inuse','busy',_0x2568('0x2'),_0x2568('0x3'),_0x2568('0x4'),_0x2568('0x5'),_0x2568('0x6')];var monitorFormat={'wav':_0x2568('0x7'),'wav49':_0x2568('0x8'),'gsm':'gsm'};var strategy={'rrmemory':_0x2568('0x9'),'roundrobin':_0x2568('0xa')};function VoiceQueue(_0x3449da){this['id']=_0x3449da['id']||0x0;this[_0x2568('0xb')]=_0x3449da[_0x2568('0xb')]||'';this['monitor_format']=_0x3449da[_0x2568('0xc')]||'';this[_0x2568('0xd')]=_0x3449da[_0x2568('0xd')]||_0x2568('0xe');this[_0x2568('0xf')]=0x0;this['talking']=0x0;this[_0x2568('0x10')]=0x0;this[_0x2568('0x11')]=0x0;this[_0x2568('0x12')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x2568('0x13')]=0x0;this[_0x2568('0x14')]=0x0;this[_0x2568('0x15')]=0x0;this['available']=0x0;this[_0x2568('0x16')]=_0x3449da[_0x2568('0x16')]||![];this[_0x2568('0x17')]=_0x3449da[_0x2568('0x17')]||0xa;this[_0x2568('0x18')]=_0x3449da[_0x2568('0x18')]||'no';this[_0x2568('0x19')]=!![];this['message']='';this[_0x2568('0x1a')]=0x0;this[_0x2568('0x1b')]=0x0;this[_0x2568('0x1c')]=_0x3449da['dialTimezone']||null;this[_0x2568('0x1d')]=_0x3449da['dialGlobalInterval']?_0x3449da['dialGlobalInterval']:null;this['dialActive']=_0x3449da[_0x2568('0x1e')];this[_0x2568('0x1f')]=_0x3449da['dialMethod']||_0x2568('0x20');this[_0x2568('0x21')]=_0x3449da[_0x2568('0x21')]||0x0;this[_0x2568('0x22')]=_0x3449da[_0x2568('0x22')]||0x0;this[_0x2568('0x23')]=_0x3449da['dialPowerLevel']||0x1;this[_0x2568('0x24')]=_0x3449da['dialPredictiveOptimization']||_0x2568('0x25');this[_0x2568('0x26')]=_0x3449da[_0x2568('0x26')]||0.03;this['dialPredictiveInterval']=_0x3449da[_0x2568('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x3449da[_0x2568('0x28')]||'anonymous';this[_0x2568('0x29')]=_0x3449da[_0x2568('0x29')]||_0x2568('0x2a');this['dialOriginateTimeout']=_0x3449da[_0x2568('0x2b')]||0x1e;this[_0x2568('0x2c')]=_0x3449da['dialQueueOptions']||_0x2568('0x2d');this[_0x2568('0x2e')]=_0x3449da[_0x2568('0x2e')]||0x3;this[_0x2568('0x2f')]=_0x3449da[_0x2568('0x2f')]||undefined;this['dialCongestionMaxRetry']=_0x3449da[_0x2568('0x30')]||0x3;this[_0x2568('0x31')]=_0x3449da[_0x2568('0x31')]||0x96;this[_0x2568('0x32')]=_0x3449da[_0x2568('0x32')]||0x3;this[_0x2568('0x33')]=_0x3449da['dialBusyRetryFrequency']||0x96;this[_0x2568('0x34')]=_0x3449da['dialNoAnswerMaxRetry']||0x3;this[_0x2568('0x35')]=_0x3449da[_0x2568('0x35')]||0x96;this[_0x2568('0x36')]=_0x3449da[_0x2568('0x36')]||0x3;this[_0x2568('0x37')]=_0x3449da[_0x2568('0x37')]||0x96;this['dialDropMaxRetry']=_0x3449da['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3449da[_0x2568('0x38')]||0x96;this[_0x2568('0x39')]=_0x3449da[_0x2568('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x3449da[_0x2568('0x3a')]||0x96;this[_0x2568('0x3b')]=_0x3449da[_0x2568('0x3b')]||0x3;this[_0x2568('0x3c')]=_0x3449da['dialMachineRetryFrequency']||0x96;this[_0x2568('0x3d')]=_0x3449da[_0x2568('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3449da['dialAgentRejectRetryFrequency']||0x96;this[_0x2568('0x3e')]=_0x3449da[_0x2568('0x3e')]||0x4;this[_0x2568('0x3f')]=_0x3449da['Trunk']?_0x3449da[_0x2568('0x3f')]:undefined;this[_0x2568('0x40')]=_0x3449da['TrunkBackup']?_0x3449da['TrunkBackup']:undefined;this[_0x2568('0x41')]=_0x3449da[_0x2568('0x41')]||undefined;this[_0x2568('0x42')]=_0x3449da[_0x2568('0x42')]?_0x3449da[_0x2568('0x42')]:undefined;this[_0x2568('0x43')]=_0x3449da[_0x2568('0x43')]||_0x2568('0x44');this[_0x2568('0x45')]=_0x3449da['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2568('0x46')]=_0x3449da[_0x2568('0x46')]||undefined;this['strategy']=strategy[_0x3449da[_0x2568('0x47')]]||'rrmemory';this[_0x2568('0x48')]=!![];this[_0x2568('0x49')]=_0x3449da['dialAMDActive']||![];this[_0x2568('0x4a')]=_0x3449da[_0x2568('0x4a')];this[_0x2568('0x4b')]=_0x3449da[_0x2568('0x4b')];this[_0x2568('0x4c')]=_0x3449da['dialAMDAfterGreetingSilence'];this[_0x2568('0x4d')]=_0x3449da[_0x2568('0x4d')];this[_0x2568('0x4e')]=_0x3449da[_0x2568('0x4e')];this['dialAMDBetweenWordsSilence']=_0x3449da[_0x2568('0x4f')];this[_0x2568('0x50')]=_0x3449da[_0x2568('0x50')];this[_0x2568('0x51')]=_0x3449da[_0x2568('0x51')];this[_0x2568('0x52')]=_0x3449da[_0x2568('0x52')];this[_0x2568('0x53')]=0x0;this[_0x2568('0x54')]=0x0;this['timeout']=_0x3449da[_0x2568('0x55')];this[_0x2568('0x56')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x2568('0x57')]=0x0;this[_0x2568('0x58')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x2568('0x59')]=0x0;this[_0x2568('0x5a')]=0x0;this[_0x2568('0x5b')]=0x0;this[_0x2568('0x5c')]=0x0;this[_0x2568('0x5d')]=0x0;this[_0x2568('0x5e')]=0x0;this[_0x2568('0x5f')]=0x0;this[_0x2568('0x60')]=0x0;this['startProgressive']=undefined;this[_0x2568('0x61')]=undefined;this['handlePredictive']=undefined;this[_0x2568('0x62')]=1.05;this[_0x2568('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x2568('0x64')]=0x0;this[_0x2568('0x65')]=0x0;this[_0x2568('0x66')]=0x0;this[_0x2568('0x67')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x2568('0x68')]=0x0;this[_0x2568('0x69')]=_0x3449da[_0x2568('0x6a')]||0x14;this[_0x2568('0x6b')]=_0x3449da[_0x2568('0x6a')]||0xa;this[_0x2568('0x6c')]=0x0;this[_0x2568('0x6d')]=0x0;this[_0x2568('0x6e')]=0x1;this[_0x2568('0x6f')]=0x0;this[_0x2568('0x70')]=0x0;this[_0x2568('0x71')]=0x0;this[_0x2568('0x72')]=0x0;this['dialRecallMeTimeout']=_0x3449da['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x3449da['dialRecallInQueue']||![];this[_0x2568('0x73')]=!!_0x3449da['dialPreviewAutoRecallMe']||![];this[_0x2568('0x74')]=_0x3449da[_0x2568('0x74')]||undefined;this['dialAgiAfterHangupClient']=_0x3449da['dialAgiAfterHangupClient']||![];this[_0x2568('0x75')]=_0x3449da[_0x2568('0x75')]||![];this[_0x2568('0xc')]=monitorFormat[_0x3449da[_0x2568('0xc')]]?monitorFormat[_0x3449da[_0x2568('0xc')]]:undefined;this[_0x2568('0x76')]=_0x3449da[_0x2568('0x76')]||![];this[_0x2568('0x77')]=_0x3449da[_0x2568('0x77')]?_0x3449da[_0x2568('0x77')]:undefined;}module[_0x2568('0x78')]=VoiceQueue;
\ No newline at end of file
index bcf2e15..1477823 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeefe=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0xf47939,_0x124b6a){var _0x5f1ec1=function(_0x58f724){while(--_0x58f724){_0xf47939['push'](_0xf47939['shift']());}};_0x5f1ec1(++_0x124b6a);}(_0xeefe,0xab));var _0xeeef=function(_0x368ff7,_0x286ceb){_0x368ff7=_0x368ff7-0x0;var _0x4f4c7b=_0xeefe[_0x368ff7];return _0x4f4c7b;};'use strict';function VtigerAccount(_0x2b837b){this['id']=_0x2b837b['id']||0x0;this['name']=_0x2b837b[_0xeeef('0x0')]||'';this[_0xeeef('0x1')]=_0x2b837b[_0xeeef('0x1')]||'';this[_0xeeef('0x2')]=_0x2b837b['accessKey']||'';this[_0xeeef('0x3')]=_0x2b837b[_0xeeef('0x3')]||'';this[_0xeeef('0x4')]=_0x2b837b['serverUrl']||'';this[_0xeeef('0x5')]=_0x2b837b[_0xeeef('0x5')]||{};}module[_0xeeef('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x04bc=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4bbc65,_0x5737e9){var _0x288343=function(_0x1e2c4a){while(--_0x1e2c4a){_0x4bbc65['push'](_0x4bbc65['shift']());}};_0x288343(++_0x5737e9);}(_0x04bc,0x188));var _0xc04b=function(_0x2539b5,_0x337ba8){_0x2539b5=_0x2539b5-0x0;var _0x4a3e4f=_0x04bc[_0x2539b5];return _0x4a3e4f;};'use strict';function VtigerAccount(_0xe68d07){this['id']=_0xe68d07['id']||0x0;this[_0xc04b('0x0')]=_0xe68d07[_0xc04b('0x0')]||'';this[_0xc04b('0x1')]=_0xe68d07['username']||'';this[_0xc04b('0x2')]=_0xe68d07['accessKey']||'';this[_0xc04b('0x3')]=_0xe68d07[_0xc04b('0x3')]||'';this['serverUrl']=_0xe68d07[_0xc04b('0x4')]||'';this[_0xc04b('0x5')]=_0xe68d07['Configurations']||{};}module[_0xc04b('0x6')]=VtigerAccount;
\ No newline at end of file
index 184a184..a14c186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49c1=['name','username','password','token','remoteUri','authType','type','integrationTab','Configurations','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x49c1,0x1a4));var _0x149c=function(_0x5615c2,_0x3ee229){_0x5615c2=_0x5615c2-0x0;var _0x5ebd90=_0x49c1[_0x5615c2];return _0x5ebd90;};'use strict';function ZendeskAccount(_0x3c6b37){this['id']=_0x3c6b37['id']||0x0;this[_0x149c('0x0')]=_0x3c6b37['name']||'';this[_0x149c('0x1')]=_0x3c6b37[_0x149c('0x1')]||'';this['password']=_0x3c6b37[_0x149c('0x2')]||'';this[_0x149c('0x3')]=_0x3c6b37[_0x149c('0x3')]||'';this[_0x149c('0x4')]=_0x3c6b37['remoteUri']||'';this[_0x149c('0x5')]=_0x3c6b37[_0x149c('0x5')]||'';this['type']=_0x3c6b37[_0x149c('0x6')]||_0x149c('0x7');this['serverUrl']=_0x3c6b37['serverUrl']||'';this[_0x149c('0x8')]=_0x3c6b37[_0x149c('0x8')]||{};}module[_0x149c('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0x27e2=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x59f21e,_0x47ce82){var _0x334312=function(_0x157331){while(--_0x157331){_0x59f21e['push'](_0x59f21e['shift']());}};_0x334312(++_0x47ce82);}(_0x27e2,0x10f));var _0x227e=function(_0x8dd995,_0x272986){_0x8dd995=_0x8dd995-0x0;var _0x215ab5=_0x27e2[_0x8dd995];return _0x215ab5;};'use strict';function ZendeskAccount(_0x7ea929){this['id']=_0x7ea929['id']||0x0;this[_0x227e('0x0')]=_0x7ea929[_0x227e('0x0')]||'';this[_0x227e('0x1')]=_0x7ea929[_0x227e('0x1')]||'';this[_0x227e('0x2')]=_0x7ea929[_0x227e('0x2')]||'';this['token']=_0x7ea929[_0x227e('0x3')]||'';this[_0x227e('0x4')]=_0x7ea929[_0x227e('0x4')]||'';this[_0x227e('0x5')]=_0x7ea929[_0x227e('0x5')]||'';this['type']=_0x7ea929[_0x227e('0x6')]||'integrationTab';this[_0x227e('0x7')]=_0x7ea929[_0x227e('0x7')]||'';this[_0x227e('0x8')]=_0x7ea929[_0x227e('0x8')]||{};}module[_0x227e('0x9')]=ZendeskAccount;
\ No newline at end of file
index df30126..33b25f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cef=['serverUrl','code','refreshToken','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x1fa1a5,_0xab5966){var _0x2994e9=function(_0x3895cc){while(--_0x3895cc){_0x1fa1a5['push'](_0x1fa1a5['shift']());}};_0x2994e9(++_0xab5966);}(_0x6cef,0xa4));var _0xf6ce=function(_0x1eb808,_0x4b7952){_0x1eb808=_0x1eb808-0x0;var _0x1701f7=_0x6cef[_0x1eb808];return _0x1701f7;};'use strict';function ZohoAccount(_0x55d247){this['id']=_0x55d247['id']||0x0;this[_0xf6ce('0x0')]=_0x55d247[_0xf6ce('0x0')]||'';this[_0xf6ce('0x1')]=_0x55d247[_0xf6ce('0x1')]||'';this[_0xf6ce('0x2')]=_0x55d247[_0xf6ce('0x2')]||'';this['zone']=_0x55d247[_0xf6ce('0x3')]||'';this[_0xf6ce('0x4')]=_0x55d247[_0xf6ce('0x4')]||'';this[_0xf6ce('0x5')]=_0x55d247[_0xf6ce('0x5')]||'';this[_0xf6ce('0x6')]=_0x55d247[_0xf6ce('0x6')]||'';this[_0xf6ce('0x7')]=_0x55d247[_0xf6ce('0x7')]||'';this[_0xf6ce('0x8')]=_0x55d247[_0xf6ce('0x8')]||'';this['Configurations']=_0x55d247['Configurations']||{};}module[_0xf6ce('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0xa729=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','exports'];(function(_0x4c389c,_0x20e533){var _0x375bd2=function(_0xaa2e4c){while(--_0xaa2e4c){_0x4c389c['push'](_0x4c389c['shift']());}};_0x375bd2(++_0x20e533);}(_0xa729,0x172));var _0x9a72=function(_0xf219b,_0x1ad38e){_0xf219b=_0xf219b-0x0;var _0x4db27e=_0xa729[_0xf219b];return _0x4db27e;};'use strict';function ZohoAccount(_0x3b565b){this['id']=_0x3b565b['id']||0x0;this[_0x9a72('0x0')]=_0x3b565b['name']||'';this[_0x9a72('0x1')]=_0x3b565b[_0x9a72('0x1')]||'';this[_0x9a72('0x2')]=_0x3b565b[_0x9a72('0x2')]||'';this[_0x9a72('0x3')]=_0x3b565b[_0x9a72('0x3')]||'';this['clientId']=_0x3b565b[_0x9a72('0x4')]||'';this[_0x9a72('0x5')]=_0x3b565b['clientSecret']||'';this[_0x9a72('0x6')]=_0x3b565b[_0x9a72('0x6')]||'';this[_0x9a72('0x7')]=_0x3b565b['code']||'';this[_0x9a72('0x8')]=_0x3b565b[_0x9a72('0x8')]||'';this['Configurations']=_0x3b565b['Configurations']||{};}module[_0x9a72('0x9')]=ZohoAccount;
\ No newline at end of file
index 64482b9..b85e8a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89be=['originatecalleridnum','originatecalleridname','getCaller','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x327ebd,_0x1f1057){var _0x3eb4d5=function(_0x93def9){while(--_0x93def9){_0x327ebd['push'](_0x327ebd['shift']());}};_0x3eb4d5(++_0x1f1057);}(_0x89be,0xe6));var _0xe89b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89be[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe89b('0x0'));var _=require(_0xe89b('0x1'));var moment=require('moment');function checkNameSurname(_0x48cb1c,_0x45316b,_0x3551a1){var _0x2d6b49='';if(!_[_0xe89b('0x2')](_0x45316b)&&_0xe89b('0x3')===typeof _0x45316b){_0x2d6b49+=_0x45316b;}if(!_['isNil'](_0x3551a1)&&_0xe89b('0x3')===typeof _0x3551a1){_0x2d6b49+='\x20'+_0x3551a1;}if(_0x2d6b49!==''){return _0x2d6b49;}return _0x48cb1c;}function Action(_0xee8c7c,_0x147721,_0x548703,_0x3c4a06,_0x1370b2){this[_0xe89b('0x4')]=_0x548703||undefined;this[_0xe89b('0x5')]=_0xee8c7c['id'];this[_0xe89b('0x6')]=_0x147721[_0xe89b('0x7')];this['type']=_0x147721['type'];this[_0xe89b('0x8')]=_0xe89b('0x6');this[_0xe89b('0x9')]=![];this[_0xe89b('0xa')]=_['isNil'](_0xee8c7c[_0xe89b('0xb')])?undefined:_0xee8c7c[_0xe89b('0xb')][_0xe89b('0x7')];this[_0xe89b('0xc')]=this[_0xe89b('0xa')]?util[_0xe89b('0xd')](_0xe89b('0xe'),this[_0xe89b('0xa')]):_0x3c4a06||undefined;this[_0xe89b('0xf')]=checkNameSurname(_0xee8c7c[_0xe89b('0x10')][_0xe89b('0x11')],_0xee8c7c['Contact'][_0xe89b('0x12')],_0xee8c7c['Contact'][_0xe89b('0x13')]);this[_0xe89b('0x14')]=_0xee8c7c[_0xe89b('0x14')]||![];this[_0xe89b('0x15')]=_0xee8c7c[_0xe89b('0x10')]['phone'];this[_0xe89b('0x16')]=_0xee8c7c[_0xe89b('0x16')];this['countbusyretry']=_0xee8c7c[_0xe89b('0x17')]||0x0;this[_0xe89b('0x18')]=_0xee8c7c[_0xe89b('0x18')]||0x0;this[_0xe89b('0x19')]=_0xee8c7c[_0xe89b('0x19')]||0x0;this[_0xe89b('0x1a')]=(_0xee8c7c[_0xe89b('0x17')]||0x0)+(_0xee8c7c[_0xe89b('0x18')]||0x0)+(_0xee8c7c[_0xe89b('0x19')]||0x0)+(_0xee8c7c['countnosuchnumberretry']||0x0)+(_0xee8c7c[_0xe89b('0x1b')]||0x0)+(_0xee8c7c[_0xe89b('0x1c')]||0x0)+(_0xee8c7c[_0xe89b('0x1d')]||0x0)+(_0xee8c7c[_0xe89b('0x1e')]||0x0);this[_0xe89b('0x1f')]=_0xee8c7c[_0xe89b('0x1f')]||0x0;this[_0xe89b('0x1b')]=_0xee8c7c[_0xe89b('0x1b')]||0x0;this['countabandonedretry']=_0xee8c7c[_0xe89b('0x1c')]||0x0;this[_0xe89b('0x1d')]=_0xee8c7c[_0xe89b('0x1d')]||0x0;this[_0xe89b('0x1e')]=_0xee8c7c[_0xe89b('0x1e')]||0x0;this['callback']=_0xee8c7c[_0xe89b('0x20')];this[_0xe89b('0x21')]=_0xee8c7c[_0xe89b('0x21')];this[_0xe89b('0x22')]=_0xee8c7c[_0xe89b('0x22')];this['recallme']=_0xee8c7c[_0xe89b('0x23')];this[_0xe89b('0x24')]=_0xee8c7c[_0xe89b('0x24')];this[_0xe89b('0x25')]=_0xee8c7c[_0xe89b('0x25')];this[_0xe89b('0x26')]=_[_0xe89b('0x2')](_0xee8c7c[_0xe89b('0xb')])?_0xee8c7c[_0xe89b('0x26')]:_0xee8c7c[_0xe89b('0xb')]['id'];this[_0xe89b('0x27')]=_0xee8c7c[_0xe89b('0x27')];this[_0xe89b('0x28')]='';this[_0xe89b('0x29')]='';}Action['prototype'][_0xe89b('0x2a')]=function(){return util[_0xe89b('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0xe89b('0x2b')]);};module[_0xe89b('0x2c')]=Action;
\ No newline at end of file
+var _0xe6f5=['moment','isNil','string','uniqueid','queue','name','type','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','number','exports','util','lodash'];(function(_0x38e199,_0x53eb68){var _0x5e9c21=function(_0x1b994c){while(--_0x1b994c){_0x38e199['push'](_0x38e199['shift']());}};_0x5e9c21(++_0x53eb68);}(_0xe6f5,0x198));var _0x5e6f=function(_0x5a3374,_0x348962){_0x5a3374=_0x5a3374-0x0;var _0x465e75=_0xe6f5[_0x5a3374];return _0x465e75;};'use strict';var util=require(_0x5e6f('0x0'));var _=require(_0x5e6f('0x1'));var moment=require(_0x5e6f('0x2'));function checkNameSurname(_0x1516b8,_0x43ece1,_0x2d8f89){var _0x1d049c='';if(!_[_0x5e6f('0x3')](_0x43ece1)&&_0x5e6f('0x4')===typeof _0x43ece1){_0x1d049c+=_0x43ece1;}if(!_['isNil'](_0x2d8f89)&&_0x5e6f('0x4')===typeof _0x2d8f89){_0x1d049c+='\x20'+_0x2d8f89;}if(_0x1d049c!==''){return _0x1d049c;}return _0x1516b8;}function Action(_0x10ea5e,_0x3b5a2c,_0xd0d3f9,_0x5ab71a,_0xc0d265){this[_0x5e6f('0x5')]=_0xd0d3f9||undefined;this['idContact']=_0x10ea5e['id'];this[_0x5e6f('0x6')]=_0x3b5a2c[_0x5e6f('0x7')];this['type']=_0x3b5a2c[_0x5e6f('0x8')];this['campaigntype']='queue';this['dialAnswer']=![];this['membername']=_[_0x5e6f('0x3')](_0x10ea5e[_0x5e6f('0x9')])?undefined:_0x10ea5e[_0x5e6f('0x9')][_0x5e6f('0x7')];this['channelAgent']=this['membername']?util[_0x5e6f('0xa')](_0x5e6f('0xb'),this['membername']):_0x5ab71a||undefined;this[_0x5e6f('0xc')]=checkNameSurname(_0x10ea5e[_0x5e6f('0xd')][_0x5e6f('0xe')],_0x10ea5e[_0x5e6f('0xd')][_0x5e6f('0xf')],_0x10ea5e[_0x5e6f('0xd')][_0x5e6f('0x10')]);this[_0x5e6f('0x11')]=_0x10ea5e[_0x5e6f('0x11')]||![];this[_0x5e6f('0x12')]=_0x10ea5e[_0x5e6f('0xd')][_0x5e6f('0xe')];this[_0x5e6f('0x13')]=_0x10ea5e['scheduledat'];this['countbusyretry']=_0x10ea5e[_0x5e6f('0x14')]||0x0;this['countcongestionretry']=_0x10ea5e[_0x5e6f('0x15')]||0x0;this[_0x5e6f('0x16')]=_0x10ea5e['countnoanswerretry']||0x0;this[_0x5e6f('0x17')]=(_0x10ea5e[_0x5e6f('0x14')]||0x0)+(_0x10ea5e[_0x5e6f('0x15')]||0x0)+(_0x10ea5e['countnoanswerretry']||0x0)+(_0x10ea5e['countnosuchnumberretry']||0x0)+(_0x10ea5e[_0x5e6f('0x18')]||0x0)+(_0x10ea5e[_0x5e6f('0x19')]||0x0)+(_0x10ea5e[_0x5e6f('0x1a')]||0x0)+(_0x10ea5e[_0x5e6f('0x1b')]||0x0);this[_0x5e6f('0x1c')]=_0x10ea5e[_0x5e6f('0x1c')]||0x0;this['countdropretry']=_0x10ea5e[_0x5e6f('0x18')]||0x0;this[_0x5e6f('0x19')]=_0x10ea5e[_0x5e6f('0x19')]||0x0;this[_0x5e6f('0x1a')]=_0x10ea5e[_0x5e6f('0x1a')]||0x0;this[_0x5e6f('0x1b')]=_0x10ea5e[_0x5e6f('0x1b')]||0x0;this[_0x5e6f('0x1d')]=_0x10ea5e[_0x5e6f('0x1d')];this['callbackuniqueid']=_0x10ea5e[_0x5e6f('0x1e')];this[_0x5e6f('0x1f')]=_0x10ea5e[_0x5e6f('0x1f')];this[_0x5e6f('0x20')]=_0x10ea5e[_0x5e6f('0x20')];this[_0x5e6f('0x21')]=_0x10ea5e[_0x5e6f('0x21')];this['ListId']=_0x10ea5e['ListId'];this[_0x5e6f('0x22')]=_[_0x5e6f('0x3')](_0x10ea5e[_0x5e6f('0x9')])?_0x10ea5e[_0x5e6f('0x22')]:_0x10ea5e['Agent']['id'];this['VoiceQueueId']=_0x10ea5e[_0x5e6f('0x23')];this[_0x5e6f('0x24')]='';this['originatecalleridname']='';}Action[_0x5e6f('0x25')][_0x5e6f('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x5e6f('0x27')]);};module[_0x5e6f('0x28')]=Action;
\ No newline at end of file
index 5803978..65975a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','dialPreviewAutoRecallMe','clearZombieChannel','actions','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','countnosuchnumberretry','unlockAgent','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','\x20Queue','buildObj','connect','acw','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','Busy','busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','activeContact','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','Contact.phone','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[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','dialPrefix','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','toLowerVariables','starttime','Action','[originated][increment]','originated:\x20','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','lookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','callProgressDetectingAgent','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfer','syncBlindTransfer','transfererlinkedid','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','enqueue','tail','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup'];(function(_0xe4c3dd,_0x3e378c){var _0x4bdb37=function(_0x44858f){while(--_0x44858f){_0xe4c3dd['push'](_0xe4c3dd['shift']());}};_0x4bdb37(++_0x3e378c);}(_0x2bd8,0x130));var _0x82bd=function(_0x2e7f2a,_0xbda451){_0x2e7f2a=_0x2e7f2a-0x0;var _0x367634=_0x2bd8[_0x2e7f2a];return _0x367634;};'use strict';var util=require(_0x82bd('0x0'));var _=require('lodash');var BPromise=require(_0x82bd('0x1'));var uuid=require(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var md5=require(_0x82bd('0x4'));var Redis=require(_0x82bd('0x5'));var config=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('preview');var loggerAction=require(_0x82bd('0x7'))(_0x82bd('0x8'));var ami=require(_0x82bd('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0x82bd('0xa'));var ut=require(_0x82bd('0xb'));config[_0x82bd('0xc')]=_[_0x82bd('0xd')](config['redis'],{'host':_0x82bd('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x82bd('0xf')]=function(_0x5f0434){this['tail']=this[_0x82bd('0x10')]?this['tail']['finally'](_0x5f0434):_0x5f0434();};function Preview(_0x32821a){this[_0x82bd('0x11')]=new Sequence();this['campaignsPreview']=_0x32821a[_0x82bd('0x12')];this['trunks']=_0x32821a[_0x82bd('0x13')];this['actions']={};this[_0x82bd('0x14')]=_0x32821a[_0x82bd('0x14')];this[_0x82bd('0x15')]=0x0;ami['on'](_0x82bd('0x16'),this['syncOriginateResponse'][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x18'),this['syncHangup'][_0x82bd('0x17')](this));ami['on']('hanguprequest',this[_0x82bd('0x19')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x1a'),this[_0x82bd('0x1b')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x1c'),this[_0x82bd('0x1d')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x1e'),this[_0x82bd('0x1f')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x20'),this[_0x82bd('0x21')][_0x82bd('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x82bd('0x17')](this));this[_0x82bd('0x22')](this[_0x82bd('0x23')]);}function emit(_0xc9fcdf,_0x34899b,_0x28a706){io['to'](_0xc9fcdf)[_0x82bd('0x24')](_0x34899b,_0x28a706);}function emitCampaignPreview(_0x32954d){if(_0x32954d[_0x82bd('0x25')]===_0x82bd('0x26')){var _0x2caa29={'id':_0x32954d['id'],'name':_0x32954d[_0x82bd('0x27')],'strategy':_0x32954d[_0x82bd('0x28')],'answered':_0x32954d[_0x82bd('0x29')],'available':_0x32954d[_0x82bd('0x2a')],'loggedIn':_0x32954d[_0x82bd('0x2b')],'pTalking':_0x32954d[_0x82bd('0x2c')],'sumBillable':_0x32954d[_0x82bd('0x2d')],'sumDuration':_0x32954d[_0x82bd('0x2e')],'sumHoldTime':_0x32954d['sumHoldTime']||0x0,'talking':_0x32954d['talking'],'total':_0x32954d[_0x82bd('0x2f')],'type':_0x32954d[_0x82bd('0x25')],'unmanaged':_0x32954d[_0x82bd('0x30')],'abandoned':_0x32954d[_0x82bd('0x31')],'waiting':_0x32954d[_0x82bd('0x32')],'loggedInDb':_0x32954d[_0x82bd('0x33')],'dialActive':_0x32954d[_0x82bd('0x34')],'dialMethod':_0x32954d[_0x82bd('0x35')],'dialOriginateCallerIdName':_0x32954d[_0x82bd('0x36')],'dialOriginateCallerIdNumber':_0x32954d[_0x82bd('0x37')],'dialOriginateTimeout':_0x32954d['dialOriginateTimeout'],'dialPrefix':_0x32954d['dialPrefix'],'outboundAnswerAgiCallsDay':_0x32954d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x32954d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x32954d[_0x82bd('0x38')],'outboundBusyCallsDay':_0x32954d[_0x82bd('0x39')],'outboundCongestionCallsDay':_0x32954d[_0x82bd('0x3a')],'outboundDropCallsDayACS':_0x32954d[_0x82bd('0x3b')],'outboundDropCallsDayCallersExit':_0x32954d[_0x82bd('0x3c')],'outboundDropCallsDayTimeout':_0x32954d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x32954d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x32954d['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x32954d[_0x82bd('0x3d')],'outboundReCallsDay':_0x32954d[_0x82bd('0x3e')],'outboundRejectCallsDay':_0x32954d[_0x82bd('0x3f')],'outboundUnknownCallsDay':_0x32954d['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x32954d[_0x82bd('0x40')],'predictiveIntervalAnsweredCalls':_0x32954d['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x32954d[_0x82bd('0x41')],'predictiveIntervalAvgTalktime':_0x32954d[_0x82bd('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x32954d[_0x82bd('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x32954d[_0x82bd('0x44')],'predictiveIntervalErlangCalls':_0x32954d[_0x82bd('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x32954d[_0x82bd('0x46')],'predictiveIntervalHitRate':_0x32954d['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x32954d[_0x82bd('0x47')],'predictiveIntervalPauses':_0x32954d[_0x82bd('0x48')],'predictiveIntervalAvailable':_0x32954d[_0x82bd('0x49')],'predictiveIntervalTotalCalls':_0x32954d['predictiveIntervalTotalCalls'],'message':_0x32954d[_0x82bd('0x4a')],'originated':_0x32954d['originated'],'erlangCalls':_0x32954d['erlangCalls'],'erlangCallToSecond':_0x32954d[_0x82bd('0x4b')],'erlangAbandonmentRate':_0x32954d[_0x82bd('0x4c')],'erlangBusyFactor':_0x32954d[_0x82bd('0x4d')],'startPredictive':_0x32954d[_0x82bd('0x4e')],'startProgressive':_0x32954d[_0x82bd('0x4f')]};if(_0x32954d[_0x82bd('0x50')]){_0x2caa29[_0x82bd('0x50')]={'id':_0x32954d[_0x82bd('0x50')]['id'],'name':_0x32954d[_0x82bd('0x50')][_0x82bd('0x27')],'active':_0x32954d[_0x82bd('0x50')][_0x82bd('0x51')],'callerid':_0x32954d[_0x82bd('0x50')][_0x82bd('0x52')]};}if(_0x32954d[_0x82bd('0x53')]){_0x2caa29[_0x82bd('0x53')]={'id':_0x32954d[_0x82bd('0x53')]['id'],'name':_0x32954d['Interval']['name']};}var _0x59319d=md5(JSON[_0x82bd('0x54')](_0x2caa29));if(_0x32954d[_0x82bd('0x4')]!==_0x59319d){_0x32954d['md5']=_0x59319d;emit(util[_0x82bd('0x55')]('voice:queue:%s',_0x2caa29['name']),'voice_queue:save',_0x2caa29);}}}function emitVoiceQueueChannelRemove(_0x2b7675){logger[_0x82bd('0x56')](_0x82bd('0x57'),JSON[_0x82bd('0x54')](_0x2b7675));emit(util[_0x82bd('0x55')]('voice:queue:%s',_0x2b7675['name']),'voice_queue_channel:remove',_0x2b7675);io[_0x82bd('0x24')]('voice_queue_presence:remove',_0x2b7675);}function notSendMessagesQueue(_0x5d09f7){if(_0x5d09f7[_0x82bd('0x58')]){if(_0x5d09f7[_0x82bd('0x59')]===0x0&&_0x5d09f7[_0x82bd('0x2c')]===0x0){_0x5d09f7[_0x82bd('0x58')]=![];_0x5d09f7[_0x82bd('0x2a')]=0x0;_0x5d09f7[_0x82bd('0x5a')]=0x0;_0x5d09f7[_0x82bd('0x4a')]=_0x82bd('0x5b');ut[_0x82bd('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5d09f7['name']+_0x82bd('0x5d'));}else{_0x5d09f7[_0x82bd('0x4a')]='IS_DISACTIVED';ut['logger'](_0x82bd('0x5e'),_0x5d09f7[_0x82bd('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x5d09f7);}}Preview[_0x82bd('0x5f')][_0x82bd('0x22')]=function(){var _0x42aa82=this;setInterval(function(){_0x42aa82[_0x82bd('0x60')]();},0x7cf);};Preview[_0x82bd('0x5f')][_0x82bd('0x60')]=function(){var _0x2a18c3=this[_0x82bd('0x23')];this[_0x82bd('0x15')]+=0x1;for(var _0x239d48 in _0x2a18c3){if(_0x2a18c3[_0x82bd('0x61')](_0x239d48)&&(_0x2a18c3[_0x239d48][_0x82bd('0x35')]==='preview'||_0x2a18c3[_0x239d48][_0x82bd('0x35')]===_0x82bd('0x62'))&&_0x2a18c3[_0x239d48]['type']==='outbound'){if(this[_0x82bd('0x15')]>0x7){this[_0x82bd('0x15')]=0x0;this[_0x82bd('0x63')]();}}if(_0x2a18c3[_0x82bd('0x61')](_0x239d48)&&_0x2a18c3[_0x239d48][_0x82bd('0x35')]==='preview'&&_0x2a18c3[_0x239d48]['type']===_0x82bd('0x26')){if(_0x2a18c3[_0x239d48][_0x82bd('0x34')]){this['setMessage'](_0x2a18c3[_0x239d48]);if(_0x2a18c3[_0x239d48][_0x82bd('0x64')])this['recallMe'](_0x2a18c3[_0x239d48]);}else{notSendMessagesQueue(_0x2a18c3[_0x239d48]);}}}};Preview[_0x82bd('0x5f')][_0x82bd('0x65')]=function(_0x587aec){var _0x1d582a=this;this[_0x82bd('0x11')]['enqueue'](function(){if(!_['isNil'](_0x1d582a[_0x82bd('0x66')][_0x587aec])){loggerAction['info'](_0x82bd('0x67'),_0x587aec,_0x82bd('0x68'),_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')],'originated:\x20',JSON['stringify'](_0x1d582a[_0x82bd('0x23')][_0x1d582a[_0x82bd('0x66')][_0x587aec]['queue']][_0x82bd('0x59')]),_0x82bd('0x6a'),JSON[_0x82bd('0x54')](_0x1d582a['campaignsPreview'][_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]][_0x82bd('0x2c')]),JSON[_0x82bd('0x54')](_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x6b')]),JSON[_0x82bd('0x54')](_[_0x82bd('0x6c')](_0x1d582a[_0x82bd('0x66')][_0x587aec],[_0x82bd('0x6d'),_0x82bd('0x6e'),_0x82bd('0x6f'),_0x82bd('0x70')])));return ami['Action']({'action':_0x82bd('0x71'),'channel':_0x1d582a[_0x82bd('0x66')][_0x587aec]['channel']})[_0x82bd('0x72')](function(_0xcfb267){if(_0xcfb267[_0x82bd('0x4a')]===_0x82bd('0x73')){setTimeout(function(){if(_0x1d582a['actions'][_0x587aec]){ut['updateOriginated'](_0x1d582a[_0x82bd('0x23')][_0x1d582a['actions'][_0x587aec]['queue']],_0x82bd('0x74'));if(_0x1d582a['actions'][_0x587aec]['dialAnswer']===!![]){ut[_0x82bd('0x75')](_0x1d582a[_0x82bd('0x23')][_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]],_0x82bd('0x74'));ut[_0x82bd('0x76')](_0x82bd('0x77')+_0x587aec,_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]);}ut[_0x82bd('0x76')](_0x82bd('0x78')+_0x587aec,_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]);delete _0x1d582a[_0x82bd('0x66')][_0x587aec];}},0x2328);}});}});};Preview[_0x82bd('0x5f')]['clearZombieChannels']=function(){var _0x16599d=this;loggerAction[_0x82bd('0x56')](_0x82bd('0x79'),_[_0x82bd('0x7a')](this[_0x82bd('0x66')]));for(var _0x5466d9 in this['actions']){if(_0x16599d['actions']['hasOwnProperty'](_0x5466d9)){_0x16599d[_0x82bd('0x65')](_0x5466d9);}}};Preview[_0x82bd('0x5f')][_0x82bd('0x7b')]=function(_0x127f8f){var _0x568fc3=this;rpcDb['getContactRecallMe'](_0x127f8f['id'],ut[_0x82bd('0x7c')](this[_0x82bd('0x14')]))[_0x82bd('0x7d')](function(_0x4d7fb4){if(!_[_0x82bd('0x7e')](_0x4d7fb4)){for(var _0x2252ef=0x0;_0x2252ef<_0x4d7fb4[_0x82bd('0x7f')];_0x2252ef+=0x1){if(ut[_0x82bd('0x80')](_0x4d7fb4[_0x2252ef][_0x82bd('0x81')])<_0x127f8f[_0x82bd('0x82')]*0x3c){if(_0x4d7fb4[_0x2252ef][_0x82bd('0x83')]&&!_0x4d7fb4[_0x2252ef][_0x82bd('0x83')][_0x82bd('0x84')]){_0x568fc3[_0x82bd('0x85')](_0x4d7fb4[_0x2252ef]['id'])[_0x82bd('0x7d')](ut[_0x82bd('0x86')](_0x82bd('0x87')))[_0x82bd('0x72')](ut[_0x82bd('0x86')](_0x82bd('0x87')));}else{rpcDb[_0x82bd('0x88')](_0x4d7fb4[_0x2252ef]['id']);}}else{var _0x1fa71d=new Action(_0x4d7fb4[_0x2252ef],_0x127f8f);_0x1fa71d['starttime']=moment()[_0x82bd('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x127f8f['outboundReCallsDay']+=0x1;ut[_0x82bd('0x89')](_0x1fa71d,0x17,'RecallInQueue');if(_0x127f8f[_0x82bd('0x8a')]){rpcDb[_0x82bd('0x8b')](ut[_0x82bd('0x8c')](_0x4d7fb4[_0x2252ef]));rpcDb[_0x82bd('0x8d')](_0x1fa71d,_0x82bd('0x8e'));}else{ut[_0x82bd('0x89')](_0x1fa71d,0x16,_0x82bd('0x8f'));rpcDb[_0x82bd('0x8d')](_0x1fa71d,_0x82bd('0x90'));rpcDb[_0x82bd('0x91')](_0x1fa71d,_0x82bd('0x90'));}}}}})['catch'](ut['logger2'](_0x82bd('0x92')));};Preview[_0x82bd('0x5f')]['setMessage']=function(_0x47d136){_0x47d136[_0x82bd('0x58')]=!![];if(ut[_0x82bd('0x93')](_0x47d136[_0x82bd('0x2b')])){_0x47d136[_0x82bd('0x4a')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x82bd('0x94')](_0x47d136['dialActive'])){_0x47d136[_0x82bd('0x4a')]=_0x82bd('0x5b');}else if(!this['isTrunkReachable'](_0x47d136[_0x82bd('0x50')])){if(!this[_0x82bd('0x95')](_0x47d136[_0x82bd('0x96')])){_0x47d136[_0x82bd('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x47d136[_0x82bd('0x4a')]=_0x82bd('0x97');}}else{_0x47d136[_0x82bd('0x4a')]=_0x82bd('0x97');}emitCampaignPreview(_0x47d136);};Preview[_0x82bd('0x5f')][_0x82bd('0x98')]=function(_0x73c194,_0x19af06,_0x1384b0){var _0x544f10=this;var _0x214bb3=this['actions'][_0x19af06];var _0x5b74cb=this[_0x82bd('0x23')][_0x214bb3[_0x82bd('0x69')]];var _0x529cb2;if(_0x5b74cb){switch(_0x1384b0){case'1':_0x5b74cb[_0x82bd('0x99')]+=0x1;_0x214bb3['countnosuchnumberretry']+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut['logCustomer'](_0x214bb3,0x0,_0x82bd('0x9c'));ami[_0x82bd('0x24')]('custom:agentnosuchnumber',ut['buildObj'](_0x214bb3,'nosuchnumber'));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0x9d'));if(ut['totalGlobal'](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,'Global');rpcDb['createCustomerFinal'](_0x529cb2,_0x82bd('0xa0'));}else{if(_0x214bb3['countnosuchnumberretry']>=_0x5b74cb['dialNoSuchNumberMaxRetry']){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xa0'));}else{rpcDb[_0x82bd('0xa1')](ut[_0x82bd('0xa2')](_0x214bb3,_0x82bd('0xa3'),_0x5b74cb['dialNoSuchNumberRetryFrequency']),_0x214bb3[_0x82bd('0xa4')],_0x214bb3['activeContact']);}}delete this[_0x82bd('0x66')][_0x73c194['linkedid']];break;case _0x82bd('0xa5'):var _0x4e1d32=moment()['format'](_0x82bd('0xa6'));_0x214bb3[_0x82bd('0xa7')]=_0x4e1d32;_0x214bb3['answertime']=_0x4e1d32;_0x214bb3[_0x82bd('0x6b')]=!![];_0x5b74cb[_0x82bd('0x2c')]+=0x1;logger[_0x82bd('0x56')]('[syncHangup][talking][increment]',_0x214bb3['uniqueid'],_0x82bd('0xa8'),_0x5b74cb[_0x82bd('0x27')],'pTalking:\x20',_0x5b74cb[_0x82bd('0x2c')]);ami[_0x82bd('0x24')]('custom:agentconnect',ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xaa'),this[_0x82bd('0x23')][_0x214bb3[_0x82bd('0x69')]]));if(_0x5b74cb[_0x82bd('0xab')]){ami[_0x82bd('0x24')]('custom:agentConnectPreview',ut[_0x82bd('0xac')](_0x214bb3));}break;case'16':ami[_0x82bd('0x24')](_0x82bd('0xad'),ut['buildObj'](_0x214bb3,_0x82bd('0xae'),this['campaignsPreview'][_0x214bb3[_0x82bd('0x69')]]));emitVoiceQueueChannelRemove(ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xae')));_0x5b74cb[_0x82bd('0xaf')]+=0x1;_0x5b74cb[_0x82bd('0x2f')]+=0x1;_0x5b74cb['answered']+=0x1;ut[_0x82bd('0x75')](_0x5b74cb,_0x82bd('0xb0'));_0x214bb3['countglobal']=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x4,'Answer');rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xb1'));rpcDb[_0x82bd('0x91')](_0x214bb3,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x214bb3);_0x5b74cb[_0x82bd('0x2e')]+=_0x214bb3[_0x82bd('0xb2')];_0x5b74cb[_0x82bd('0x2d')]+=_0x214bb3['talktime'];logger[_0x82bd('0x56')](_0x82bd('0xb3'),_0x214bb3[_0x82bd('0xb4')],'\x20Queue',_0x5b74cb['name'],'pTalking:\x20',_0x5b74cb['pTalking']);delete this[_0x82bd('0x66')][_0x73c194[_0x82bd('0xb5')]];break;case'BUSY':_0x5b74cb[_0x82bd('0x39')]+=0x1;_0x214bb3['countbusyretry']+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut['totalGlobal'](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x5,_0x82bd('0xb6'));ami[_0x82bd('0x24')]('custom:agentbusy',ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xb7')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xb8'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb['dialGlobalMaxRetry']){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb[_0x82bd('0x91')](_0x529cb2,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x214bb3['countbusyretry']>=_0x5b74cb['dialBusyMaxRetry']){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xb8'));}else{rpcDb[_0x82bd('0xa1')](ut[_0x82bd('0xa2')](_0x214bb3,_0x82bd('0xba'),_0x5b74cb['dialBusyRetryFrequency']),_0x214bb3['unlockAgent'],_0x214bb3['activeContact']);}}break;case'NOANSWER':_0x5b74cb[_0x82bd('0xbb')]+=0x1;_0x214bb3[_0x82bd('0xbc')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x3,_0x82bd('0xbd'));ami[_0x82bd('0x24')]('custom:agentnoanswer',ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xbe')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xbf'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb[_0x82bd('0x91')](_0x529cb2,_0x82bd('0xc0'));}else{if(_0x214bb3[_0x82bd('0xbc')]>=_0x5b74cb[_0x82bd('0xc1')]){rpcDb[_0x82bd('0x91')](_0x214bb3,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x82bd('0xa1')](ut[_0x82bd('0xa2')](_0x214bb3,'countnoanswerretry',_0x5b74cb['dialNoAnswerRetryFrequency']),_0x214bb3[_0x82bd('0xa4')],_0x214bb3['activeContact']);}}break;case _0x82bd('0xc2'):_0x5b74cb[_0x82bd('0x3a')]+=0x1;_0x214bb3[_0x82bd('0xc3')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x8,_0x82bd('0xc4'));ami[_0x82bd('0x24')]('custom:agentcongestion',ut[_0x82bd('0xa9')](_0x214bb3,'congestion'));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xc5'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut['cloneAction'](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb[_0x82bd('0x91')](_0x529cb2,_0x82bd('0xc6'));}else{if(_0x214bb3[_0x82bd('0xc3')]>=_0x5b74cb['dialCongestionMaxRetry']){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xc5'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x214bb3,'countcongestionretry',_0x5b74cb[_0x82bd('0xc7')]),_0x214bb3[_0x82bd('0xa4')],_0x214bb3[_0x82bd('0xc8')]);}}break;case _0x82bd('0xc9'):_0x5b74cb[_0x82bd('0x3f')]+=0x1;_0x214bb3[_0x82bd('0xca')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x14,_0x82bd('0xcb'));ami[_0x82bd('0x24')](_0x82bd('0xcc'),ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xcd')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xce'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0x14,_0x82bd('0xcb'));rpcDb[_0x82bd('0x91')](_0x529cb2,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x214bb3['countagentrejectretry']>=_0x5b74cb[_0x82bd('0xcf')]){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xd0'));}else{rpcDb[_0x82bd('0xa1')](ut['scheduledAt'](_0x214bb3,'countagentrejectretry',_0x5b74cb[_0x82bd('0xd1')]),_0x214bb3['unlockAgent'],_0x214bb3[_0x82bd('0xc8')]);}}break;case _0x82bd('0xd2'):_0x5b74cb[_0x82bd('0x40')]+=0x1;_0x214bb3[_0x82bd('0xd3')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0xb,'Abandoned');rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xd4'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut['cloneAction'](_0x214bb3,0xf,'Global');rpcDb[_0x82bd('0x91')](_0x529cb2,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x214bb3[_0x82bd('0xd5')]>=_0x5b74cb[_0x82bd('0xd6')]){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xd4'));}else{rpcDb[_0x82bd('0xa1')](ut['scheduledAt'](_0x214bb3,_0x82bd('0xd3'),_0x5b74cb[_0x82bd('0xd7')]),_0x214bb3[_0x82bd('0xa4')],_0x214bb3['activeContact']);}}break;case'18':_0x5b74cb['outboundUnknownCallsDay']+=0x1;_0x214bb3[_0x82bd('0xd8')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x12,_0x73c194[_0x82bd('0xd9')]||_0x73c194['dialstatus']);ami[_0x82bd('0x24')](_0x82bd('0xda'),ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xdb')));rpcDb['createCustomerHistory'](_0x214bb3,_0x82bd('0xdc'));if(ut['totalGlobal'](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb['createCustomerFinal'](_0x529cb2,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x214bb3,_0x82bd('0xdc'));}delete this[_0x82bd('0x66')][_0x73c194[_0x82bd('0xb5')]];break;case'19':_0x5b74cb[_0x82bd('0xdd')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x13,_0x73c194['cause-txt']||_0x73c194[_0x82bd('0xde')]);ami[_0x82bd('0x24')](_0x82bd('0xda'),ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xdb')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xdf'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,'Global');rpcDb[_0x82bd('0x91')](_0x529cb2,_0x82bd('0xdf'));}else{rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xdf'));}delete this['actions'][_0x73c194[_0x82bd('0xb5')]];break;default:if(_0x214bb3['dialAnswer']){ut[_0x82bd('0x75')](_0x5b74cb,_0x82bd('0xe0'));ut['loggerError'](_0x82bd('0xe1')+_0x5b74cb[_0x82bd('0x27')],_0x73c194);}_0x5b74cb[_0x82bd('0xdd')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut['totalGlobal'](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0xc,_0x73c194[_0x82bd('0xd9')]||_0x73c194['dialstatus']);rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xe2'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut['cloneAction'](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb['createCustomerFinal'](_0x529cb2,_0x82bd('0xe3'));}else{rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xe3'));}delete this[_0x82bd('0x66')][_0x73c194['linkedid']];}if(!(_0x214bb3[_0x82bd('0x6b')]&&_0x1384b0==='16')){ut['updateOriginated'](_0x5b74cb,_0x82bd('0xe4'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x214bb3[_0x82bd('0xb4')],_0x82bd('0xa8'),_0x5b74cb['name'],'originated:\x20',_0x5b74cb['originated']);}if(_0x1384b0!==_0x82bd('0xa5')){delete this['actions'][_0x73c194['linkedid']];delete this[_0x82bd('0x66')][_0x73c194[_0x82bd('0xe5')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x522cd9,_0x474a90,_0x5420d7){if(_[_0x82bd('0xe6')](_0x474a90)&&_0x82bd('0xe7')!==typeof _0x474a90){return;}if(_[_0x82bd('0xe6')](_0x5420d7)&&_0x82bd('0xe7')!==typeof _0x5420d7){return;}switch(_0x5420d7['reason']){case'0':ut[_0x82bd('0xe8')](_0x522cd9,0x0,_0x82bd('0x9c'));rpcDb['createAgentHistory'](_0x522cd9,_0x82bd('0xe9'));break;case'3':ut[_0x82bd('0xe8')](_0x522cd9,0x3,_0x82bd('0xbd'));rpcDb[_0x82bd('0xea')](_0x522cd9,_0x82bd('0xeb'));break;case'5':ut['logAgent'](_0x522cd9,0x5,_0x82bd('0xb6'));rpcDb[_0x82bd('0xea')](_0x522cd9,_0x82bd('0xec'));break;case'8':ut[_0x82bd('0xe8')](_0x522cd9,0x8,'Congestion');rpcDb[_0x82bd('0xea')](_0x522cd9,_0x82bd('0xed'));break;case'22':ut[_0x82bd('0xe8')](_0x522cd9,0x16,_0x82bd('0xee'));rpcDb[_0x82bd('0xea')](_0x522cd9,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x82bd('0xe8')](_0x522cd9,0xc,_0x5420d7[_0x82bd('0xef')]);rpcDb[_0x82bd('0xea')](_0x522cd9,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x474a90,_0x82bd('0xf0'));logger[_0x82bd('0x56')]('[originated][decrement][callProgressDetectingAgent]',_0x522cd9[_0x82bd('0xb4')],_0x82bd('0xa8'),_0x474a90[_0x82bd('0x27')],'originated:\x20',_0x474a90['originated']);delete this['actions'][_0x522cd9[_0x82bd('0xb4')]];};Preview[_0x82bd('0x5f')]['checkInBlack']=function(_0x5b7ce7,_0x3d5989,_0x176619,_0x481be2,_0x4d4c4a){var _0xd4db5e=this;return new BPromise(function(_0x55e9f5,_0xb3dbc2){if(_[_0x82bd('0x7e')](_0x3d5989)||_[_0x82bd('0x7e')](_0x3d5989[_0x82bd('0xf1')])||_['isNil'](_0x3d5989[_0x82bd('0xf1')][_0x82bd('0xf2')])||_[_0x82bd('0x7e')](_0x3d5989['VoiceQueueId'])){_0xb3dbc2(ut[_0x82bd('0x4a')](_0x82bd('0xf3'),_0x481be2,_0x4d4c4a));return;}var _0x58cc4f=uuid['v4']();var _0x1efe45=_0xd4db5e[_0x82bd('0x23')][_0x3d5989['Queue'][_0x82bd('0x27')]];var _0xf5b6ff=_0x176619?_0xd4db5e[_0x82bd('0x14')][_0x176619]['id']:undefined;_0xd4db5e[_0x82bd('0x66')][_0x58cc4f]=new Action(_0x3d5989,_0x1efe45,_0x58cc4f,_0x176619,_0xf5b6ff);var _0x152529=_0xd4db5e[_0x82bd('0x66')][_0x58cc4f];_0x152529['unlockAgent']=_0x481be2;_0x152529[_0x82bd('0xc8')]=_0x4d4c4a;_0x152529['lookAgent']=_0x176619;if(_[_0x82bd('0xf4')](_0x5b7ce7)){_0xd4db5e[_0x82bd('0xf5')](_0x152529,_0x1efe45,_0x3d5989,_0x176619)[_0x82bd('0x7d')](function(_0x15f791){logger[_0x82bd('0x56')](_0x82bd('0xf6'),_0x82bd('0xf7')+_0x152529[_0x82bd('0x69')]+_0x82bd('0xf8')+_0x152529[_0x82bd('0xf9')],JSON[_0x82bd('0x54')](_0x15f791));ami[_0x82bd('0x24')](_0x82bd('0xfa'),ut[_0x82bd('0xa9')](_0x152529,_0x82bd('0xfb'),_0xd4db5e[_0x82bd('0x23')][_0x152529[_0x82bd('0x69')]]));_0x55e9f5(ut[_0x82bd('0x4a')]('Calling'));})[_0x82bd('0x72')](function(_0x5d8ecd){ut[_0x82bd('0x5c')](_0x82bd('0xfc'),_0x5d8ecd);_0xb3dbc2(ut[_0x82bd('0x4a')](_0x82bd('0xfd'),_0x481be2,_0x4d4c4a));});}else{_0x1efe45['outboundBlacklistCallsDay']+=0x1;ut[_0x82bd('0xfe')](_0x152529);rpcDb[_0x82bd('0xff')](_0x152529,_0x82bd('0x100'));delete _0xd4db5e[_0x82bd('0x66')][_0x58cc4f];_0xb3dbc2(ut[_0x82bd('0x4a')](_0x82bd('0x101'),_0x481be2,_0x4d4c4a));}});};Preview[_0x82bd('0x5f')][_0x82bd('0x95')]=function(_0x168321){return!_[_0x82bd('0x7e')](_0x168321)&&!_[_0x82bd('0x7e')](_0x168321[_0x82bd('0x27')])&&!_['isNil'](_0x168321[_0x82bd('0x51')])&&_0x168321['active']&&!_[_0x82bd('0x7e')](this[_0x82bd('0x13')][util['format'](_0x82bd('0x102'),_0x168321[_0x82bd('0x27')])])&&!_[_0x82bd('0x7e')](this[_0x82bd('0x13')][util[_0x82bd('0x55')](_0x82bd('0x102'),_0x168321['name'])]['status'])&&(this[_0x82bd('0x13')][util[_0x82bd('0x55')](_0x82bd('0x102'),_0x168321[_0x82bd('0x27')])][_0x82bd('0x71')]===_0x82bd('0x103')||this[_0x82bd('0x13')][util[_0x82bd('0x55')](_0x82bd('0x102'),_0x168321[_0x82bd('0x27')])][_0x82bd('0x71')]===_0x82bd('0x104'));};Preview['prototype'][_0x82bd('0x85')]=function(_0x57d59f,_0x34e5bc){var _0x120d2e=this;return new BPromise(function(_0x17d311,_0x2360ad){_0x120d2e['execRun'](_0x57d59f,_0x34e5bc)[_0x82bd('0x7d')](function(_0xc7c1e0){_0x17d311(_[_0x82bd('0x6c')](_0xc7c1e0,['message']));})[_0x82bd('0x72')](function(_0x185afc){if(_0x185afc[_0x82bd('0x105')]){rpcDb[_0x82bd('0x106')](_0x57d59f);}if(_0x185afc[_0x82bd('0x51')]){rpcDb[_0x82bd('0x88')](_0x57d59f);}_0x2360ad(_[_0x82bd('0x6c')](_0x185afc,[_0x82bd('0x4a')]));});});};Preview[_0x82bd('0x5f')][_0x82bd('0x107')]=function(_0x32c91b,_0x1041a4){var _0x363efd=this;return new BPromise(function(_0x27a6d1,_0x40d215){var _0x532402,_0x4c80f3;rpcDb[_0x82bd('0x108')](_0x32c91b)[_0x82bd('0x7d')](function(_0x53e7e3){if(!_[_0x82bd('0x7e')](_0x53e7e3[0x0])){_0x4c80f3=_0x53e7e3[0x0]['recallme']?![]:!![];_0x532402=_0x53e7e3[0x0]['recallme']?!![]:![];_0x532402=_0x1041a4?!![]:_0x532402;}var _0x3d8a55=_0x363efd['validateContact'](_0x53e7e3);if(_0x3d8a55['isValid']){rpcDb['checkIsBlackList'](_[_0x82bd('0x6c')](_0x53e7e3[0x0],[_0x82bd('0x6f'),_0x82bd('0x109')]))['then'](function(_0x4c68cc){_0x363efd[_0x82bd('0x10a')](_0x4c68cc,_0x53e7e3[0x0],_0x1041a4,_0x4c80f3,_0x532402)[_0x82bd('0x7d')](function(_0x4832bc){_0x27a6d1(_0x4832bc);})[_0x82bd('0x72')](function(_0x551565){_0x40d215(_0x551565);});})[_0x82bd('0x72')](function(_0x447d22){ut[_0x82bd('0x5c')]('[Preview][checkIsBlackList]',_0x447d22);_0x40d215(ut['message'](_0x82bd('0x10b'),_0x4c80f3,_0x532402));});}else{_0x40d215(ut[_0x82bd('0x4a')](_0x3d8a55[_0x82bd('0x4a')],_0x4c80f3,_0x532402));}})['catch'](function(_0x4b28f6){ut[_0x82bd('0x5c')](_0x82bd('0x10c'),_0x4b28f6);_0x40d215(ut['message'](_0x82bd('0x10b'),![],!![]));});});};Preview[_0x82bd('0x5f')][_0x82bd('0x10d')]=function(_0xc5ece9){if(_[_0x82bd('0x7e')](_0xc5ece9)||_[_0x82bd('0xf4')](_0xc5ece9)||!_[_0x82bd('0x7e')](_0xc5ece9[0x0][_0x82bd('0x83')])&&_[_0x82bd('0x7e')](_0xc5ece9[0x0][_0x82bd('0x83')][_0x82bd('0x27')])){ut[_0x82bd('0x5c')](_0x82bd('0x10e'),_0xc5ece9);return{'isValid':![],'message':_0x82bd('0x10f')};}var _0x5a6bea=this[_0x82bd('0x23')][_0xc5ece9[0x0][_0x82bd('0x68')][_0x82bd('0x27')]];_0x5a6bea[_0x82bd('0x4a')]=_0x82bd('0x97');if(_[_0x82bd('0x7e')](_0x5a6bea)){ut[_0x82bd('0x5c')]('[Preview][validateContact][Empty\x20Campaign]',_0x5a6bea);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x82bd('0x95')](_0x5a6bea[_0x82bd('0x50')])){ut[_0x82bd('0x5c')](_0x82bd('0x110'),_0x82bd('0x111')+_0x5a6bea[_0x82bd('0x27')]+_0x82bd('0x112'));if(!this[_0x82bd('0x95')](_0x5a6bea[_0x82bd('0x96')])){ut[_0x82bd('0x5c')](_0x82bd('0x110'),_0x5a6bea[_0x82bd('0x27')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x82bd('0x113')};}}if(!ut['isActive'](_0x5a6bea['dialActive'])){ut['logger'](_0x82bd('0x114'),_0x5a6bea['name']+_0x82bd('0x115'));return{'isValid':![],'message':_0x82bd('0x111')+_0x5a6bea['name']+_0x82bd('0x115')};}return{'isValid':!![],'message':_0x82bd('0x116')};};Preview[_0x82bd('0x5f')]['execCall']=function(_0x566239,_0x2b4787,_0x5cb7a5,_0x3ab38c){var _0x498b48=this;return new BPromise(function(_0xf6200a,_0x92c75e){var _0x2bfd3a=_0x566239[_0x82bd('0xb4')];var _0x442311=_0x498b48[_0x82bd('0x95')](_0x2b4787[_0x82bd('0x50')])?util['format'](_0x82bd('0x117'),_0x2b4787['Trunk'][_0x82bd('0x27')],_[_0x82bd('0x7e')](_0x2b4787['dialPrefix'])?'':_0x2b4787[_0x82bd('0x118')]['trim']()||'',_0x2b4787[_0x82bd('0x119')]>0x0?_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')][_0x82bd('0x11a')](_0x2b4787[_0x82bd('0x119')]):_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')]):util[_0x82bd('0x55')](_0x82bd('0x117'),_[_0x82bd('0x7e')](_0x2b4787[_0x82bd('0x96')])?_0x2b4787['Trunk'][_0x82bd('0x27')]:_0x2b4787[_0x82bd('0x96')][_0x82bd('0x27')],_[_0x82bd('0x7e')](_0x2b4787[_0x82bd('0x118')])?'':_0x2b4787[_0x82bd('0x118')]['trim']()||'',_0x2b4787[_0x82bd('0x119')]>0x0?_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')][_0x82bd('0x11a')](_0x2b4787[_0x82bd('0x119')]):_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')]);var _0xf046d4=_0x498b48[_0x82bd('0x95')](_0x2b4787[_0x82bd('0x50')])?ut[_0x82bd('0x11b')](_0x2b4787['Trunk'][_0x82bd('0x52')],_0x2b4787['dialOriginateCallerIdName'],_0x2b4787[_0x82bd('0x11c')]>0x0?ut[_0x82bd('0x11d')](_0x2b4787[_0x82bd('0x37')],_0x2b4787['dialRandomLastDigitCallerIdNumber']):_0x2b4787[_0x82bd('0x37')]):ut[_0x82bd('0x11b')](_[_0x82bd('0x7e')](_0x2b4787['TrunkBackup'])?_0x2b4787[_0x82bd('0x50')][_0x82bd('0x52')]:_0x2b4787[_0x82bd('0x96')][_0x82bd('0x52')],_0x2b4787[_0x82bd('0x36')],_0x2b4787[_0x82bd('0x11c')]>0x0?ut[_0x82bd('0x11d')](_0x2b4787[_0x82bd('0x37')],_0x2b4787[_0x82bd('0x11c')]):_0x2b4787[_0x82bd('0x37')]);if(_0xf046d4){_0x566239[_0x82bd('0x11e')]=ut[_0x82bd('0x11f')](_0xf046d4);_0x566239['originatecalleridnum']=ut[_0x82bd('0x120')](_0xf046d4);}var _0xd535fe=ut['addVariables'](_0x2b4787,_0x5cb7a5,_0x442311,_0xf046d4,_0x2bfd3a,_0x566239);_[_0x82bd('0x121')](_0x566239,ut[_0x82bd('0x122')](_0xd535fe));_0x566239[_0x82bd('0x123')]=moment()[_0x82bd('0x55')](_0x82bd('0xa6'));ami[_0x82bd('0x124')](ut['variablesAction'](_0x566239,_0x2b4787,_0xd535fe,_0x566239[_0x82bd('0xc8')],_0x3ab38c))[_0x82bd('0x7d')](function(_0x589d31){_0x2b4787[_0x82bd('0x59')]+=0x1;logger[_0x82bd('0x56')](_0x82bd('0x125'),_0x2bfd3a,_0x82bd('0xa8'),_0x2b4787['name'],_0x82bd('0x126'),_0x2b4787['originated']);_0xf6200a(_0x589d31);})[_0x82bd('0x72')](function(_0x492827){ut[_0x82bd('0xe8')](_0x566239,0xe,_0x82bd('0x127'));rpcDb[_0x82bd('0xea')](_0x566239,_0x82bd('0x128'));_0x92c75e(_0x492827);});});};Preview[_0x82bd('0x5f')][_0x82bd('0x1d')]=function(_0x107374){if(this['actions'][_0x107374[_0x82bd('0xb5')]]){this[_0x82bd('0x66')][_0x107374[_0x82bd('0xb5')]]['channel']=_0x107374[_0x82bd('0x129')];}};Preview[_0x82bd('0x5f')]['syncOriginateResponse']=function(_0x19b8c6){var _0x33fc4b=this;var _0x470919=this[_0x82bd('0x66')][_0x19b8c6[_0x82bd('0x12a')]];if(_0x470919){if(_0x470919['lookAgent']&&this['agents'][_0x470919['lookAgent']]){ut[_0x82bd('0x12b')](_0x470919,this['agents'][_0x470919[_0x82bd('0x12c')]][_0x82bd('0x27')],this[_0x82bd('0x14')][_0x470919['lookAgent']]['id']);}var _0x36b26c=_[_0x82bd('0x12d')](_0x470919);_0x36b26c[_0x82bd('0xa7')]=moment()[_0x82bd('0x55')](_0x82bd('0xa6'));var _0x4892fc=_0x33fc4b[_0x82bd('0x23')][_0x470919[_0x82bd('0x69')]];if(ut[_0x82bd('0x12e')](_0x19b8c6[_0x82bd('0x12f')])){if(_0x470919[_0x82bd('0xa4')]){rpcDb['unlockContact'](_0x470919[_0x82bd('0xf9')]);}if(_0x470919[_0x82bd('0xc8')]){rpcDb[_0x82bd('0x88')](_0x470919['idContact']);}ami[_0x82bd('0x24')](_0x82bd('0x130'),ut[_0x82bd('0xa9')](_0x470919,_0x82bd('0x131'),this[_0x82bd('0x23')][_0x470919[_0x82bd('0x69')]]));this['callProgressDetectingAgent'](_0x36b26c,_0x4892fc,_0x19b8c6);}else{_0x470919[_0x82bd('0x123')]=moment()[_0x82bd('0x55')](_0x82bd('0xa6'));ut[_0x82bd('0xe8')](_0x36b26c,0x4,_0x82bd('0x132'));rpcDb[_0x82bd('0xea')](_0x36b26c,_0x82bd('0x133'));}}};Preview[_0x82bd('0x5f')][_0x82bd('0x134')]=function(_0x23c7cd){var _0x4ae9f2=this;var _0x558860=this['actions'][_0x23c7cd[_0x82bd('0xb5')]];var _0x99351d;if(_0x558860){_0x99351d=this[_0x82bd('0x23')][_0x558860[_0x82bd('0x69')]];logger['info'](_0x82bd('0x135'),_0x23c7cd['linkedid'],_0x82bd('0xa8'),_0x99351d[_0x82bd('0x27')],_0x82bd('0x6a'),_0x99351d['pTalking']);}if(this[_0x82bd('0x66')][_0x23c7cd[_0x82bd('0xb5')]]&&_0x23c7cd['linkedid']!==_0x23c7cd[_0x82bd('0xb4')]){if(_0x23c7cd[_0x82bd('0x136')]==='16'&&this[_0x82bd('0x66')][_0x23c7cd[_0x82bd('0xb5')]][_0x82bd('0x6b')]){this['callProgressDetectingCustomer'](_0x23c7cd,_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')]);}else if(this['actions'][_0x23c7cd[_0x82bd('0xb5')]][_0x82bd('0x6b')]){logger[_0x82bd('0x56')](_0x82bd('0x137'),_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')],'\x20Queue',_0x99351d[_0x82bd('0x27')],_0x82bd('0x6a'),_0x99351d['pTalking']);this[_0x82bd('0x98')](_0x23c7cd,_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')]);}}else if(_0x558860&&_[_0x82bd('0x7e')](_0x558860[_0x82bd('0x138')])&&_0x99351d[_0x82bd('0x139')]&&_0x23c7cd['linkedid']===_0x23c7cd[_0x82bd('0xb4')]&&_[_0x82bd('0x7e')](_0x23c7cd[_0x82bd('0xef')])&&_0x23c7cd['cause']==='16'&&_0x23c7cd[_0x82bd('0x13a')]==='6'&&_[_0x82bd('0xe6')](_0x558860['transfer'])){if(_0x558860['unlockAgent']){rpcDb[_0x82bd('0x106')](_0x558860['idContact']);}if(_0x558860[_0x82bd('0xc8')]){rpcDb[_0x82bd('0x88')](_0x558860['idContact']);}_0x23c7cd[_0x82bd('0xef')]='22';this[_0x82bd('0x13b')](_0x558860,_0x99351d,_0x23c7cd);}else if(_0x558860&&_0x558860['transfer']){if(_0x23c7cd[_0x82bd('0x136')]==='16'&&this[_0x82bd('0x66')][_0x23c7cd[_0x82bd('0xb5')]]['dialAnswer']){logger[_0x82bd('0x56')](_0x82bd('0x13c'),_0x23c7cd['linkedid'],_0x23c7cd['cause'],_0x82bd('0xa8'),_0x99351d['name'],_0x82bd('0x6a'),_0x99351d[_0x82bd('0x2c')]);this[_0x82bd('0x98')](_0x23c7cd,_0x23c7cd['linkedid'],_0x23c7cd['cause']);}else if(this[_0x82bd('0x66')][_0x23c7cd['linkedid']]['dialAnswer']){logger[_0x82bd('0x56')]('[syncHangup][talking][cause]',_0x23c7cd['linkedid'],_0x23c7cd['cause'],_0x82bd('0xa8'),_0x99351d['name'],_0x82bd('0x6a'),_0x99351d[_0x82bd('0x2c')]);this[_0x82bd('0x98')](_0x23c7cd,_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')]);}}};Preview[_0x82bd('0x5f')][_0x82bd('0x1b')]=function(_0x3aad63){if(this[_0x82bd('0x66')][_0x3aad63['destlinkedid']]&&_0x3aad63[_0x82bd('0xe5')]!==_0x3aad63[_0x82bd('0x13d')]){this[_0x82bd('0x98')](_0x3aad63,_0x3aad63[_0x82bd('0xe5')],_0x3aad63['dialstatus']);}};Preview[_0x82bd('0x5f')][_0x82bd('0x19')]=function(_0x39654c){if(this['actions'][_0x39654c['linkedid']]&&_0x39654c[_0x82bd('0xb5')]!==_0x39654c['uniqueid']&&!this[_0x82bd('0x66')][_0x39654c[_0x82bd('0xb5')]]['dialAnswer']){if(_0x39654c[_0x82bd('0x136')]==='1'){this['callProgressDetectingCustomer'](_0x39654c,_0x39654c[_0x82bd('0xb5')],_0x39654c[_0x82bd('0x136')]);}}};Preview[_0x82bd('0x5f')][_0x82bd('0x13e')]=function(_0x4b10b6,_0x31b15c,_0xf4de24){if(this[_0x82bd('0x66')][_0x4b10b6]){if(_[_0x82bd('0x7e')](this[_0x82bd('0x66')][_0x4b10b6]['variables'])){this[_0x82bd('0x66')][_0x4b10b6][_0x82bd('0x13f')]={};}this[_0x82bd('0x66')][_0x4b10b6][_0x82bd('0x13f')][_0x31b15c]=_0xf4de24;}};Preview['prototype'][_0x82bd('0x1f')]=function(_0x449a42){try{if(!_['isNil'](_0x449a42)){if(ut[_0x82bd('0x140')](_[_0x82bd('0x141')](_0x449a42[_0x82bd('0x142')])[0x0])){this['addVariable'](_0x449a42[_0x82bd('0xb4')],_[_0x82bd('0x141')](_0x449a42[_0x82bd('0x142')])[0x0],_0x449a42['value']);}}}catch(_0x2a6c02){logger[_0x82bd('0x143')](_0x82bd('0x144'),util[_0x82bd('0x145')](_0x2a6c02,{'showHidden':![],'depth':null}));}};Preview[_0x82bd('0x5f')]['syncAttendedTransfer']=function(_0x5b11b2){if(_0x5b11b2){if(this['actions'][_0x5b11b2['transfertargetlinkedid']]){this['actions'][_0x5b11b2['transfertargetlinkedid']][_0x82bd('0x146')]=!![];}}};Preview['prototype'][_0x82bd('0x147')]=function(_0x5208bb){if(_0x5208bb){if(this[_0x82bd('0x66')][_0x5208bb[_0x82bd('0x148')]]){this[_0x82bd('0x66')][_0x5208bb[_0x82bd('0x148')]][_0x82bd('0x146')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x038b=['outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','prototype','hasOwnProperty','booked','clearZombieChannels','preview','recallMe','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','buildObj','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','acw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlockContact','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','phone','dialCutDigit','trim','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','idContact','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','callProgressDetectingCustomer','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','lodash','bluebird','uuid','md5','../../../config/environment','../../../config/logger','actionPreview','./action','./util/util','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x038b,0x114));var _0xb038=function(_0x45a314,_0x333aac){_0x45a314=_0x45a314-0x0;var _0x376c4d=_0x038b[_0x45a314];return _0x376c4d;};'use strict';var util=require('util');var _=require(_0xb038('0x0'));var BPromise=require(_0xb038('0x1'));var uuid=require(_0xb038('0x2'));var moment=require('moment');var md5=require(_0xb038('0x3'));var Redis=require('ioredis');var config=require(_0xb038('0x4'));var logger=require(_0xb038('0x5'))('preview');var loggerAction=require(_0xb038('0x5'))(_0xb038('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xb038('0x7'));var ut=require(_0xb038('0x8'));config[_0xb038('0x9')]=_['defaults'](config['redis'],{'host':_0xb038('0xa'),'port':0x18eb});var io=require(_0xb038('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xb038('0xc')]=function(_0x2d1ae5){this['tail']=this[_0xb038('0xd')]?this[_0xb038('0xd')][_0xb038('0xe')](_0x2d1ae5):_0x2d1ae5();};function Preview(_0x3368c1){this[_0xb038('0xf')]=new Sequence();this[_0xb038('0x10')]=_0x3368c1[_0xb038('0x11')];this[_0xb038('0x12')]=_0x3368c1[_0xb038('0x12')];this[_0xb038('0x13')]={};this[_0xb038('0x14')]=_0x3368c1[_0xb038('0x14')];this[_0xb038('0x15')]=0x0;ami['on'](_0xb038('0x16'),this[_0xb038('0x17')][_0xb038('0x18')](this));ami['on'](_0xb038('0x19'),this['syncHangup'][_0xb038('0x18')](this));ami['on'](_0xb038('0x1a'),this[_0xb038('0x1b')][_0xb038('0x18')](this));ami['on'](_0xb038('0x1c'),this[_0xb038('0x1d')]['bind'](this));ami['on'](_0xb038('0x1e'),this[_0xb038('0x1f')][_0xb038('0x18')](this));ami['on'](_0xb038('0x20'),this['syncVarSet']['bind'](this));ami['on'](_0xb038('0x21'),this[_0xb038('0x22')][_0xb038('0x18')](this));ami['on'](_0xb038('0x23'),this['syncBlindTransfer'][_0xb038('0x18')](this));this[_0xb038('0x24')](this[_0xb038('0x10')]);}function emit(_0x33a377,_0xc6cd61,_0x55be53){io['to'](_0x33a377)[_0xb038('0x25')](_0xc6cd61,_0x55be53);}function emitCampaignPreview(_0xe5ea8b){if(_0xe5ea8b[_0xb038('0x26')]===_0xb038('0x27')){var _0x5f123d={'id':_0xe5ea8b['id'],'name':_0xe5ea8b[_0xb038('0x28')],'strategy':_0xe5ea8b[_0xb038('0x29')],'answered':_0xe5ea8b['answered'],'available':_0xe5ea8b[_0xb038('0x2a')],'loggedIn':_0xe5ea8b[_0xb038('0x2b')],'pTalking':_0xe5ea8b['pTalking'],'sumBillable':_0xe5ea8b[_0xb038('0x2c')],'sumDuration':_0xe5ea8b['sumDuration'],'sumHoldTime':_0xe5ea8b[_0xb038('0x2d')]||0x0,'talking':_0xe5ea8b[_0xb038('0x2e')],'total':_0xe5ea8b[_0xb038('0x2f')],'type':_0xe5ea8b[_0xb038('0x26')],'unmanaged':_0xe5ea8b[_0xb038('0x30')],'abandoned':_0xe5ea8b[_0xb038('0x31')],'waiting':_0xe5ea8b[_0xb038('0x32')],'loggedInDb':_0xe5ea8b['loggedInDb'],'dialActive':_0xe5ea8b[_0xb038('0x33')],'dialMethod':_0xe5ea8b[_0xb038('0x34')],'dialOriginateCallerIdName':_0xe5ea8b[_0xb038('0x35')],'dialOriginateCallerIdNumber':_0xe5ea8b['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xe5ea8b[_0xb038('0x36')],'dialPrefix':_0xe5ea8b[_0xb038('0x37')],'outboundAnswerAgiCallsDay':_0xe5ea8b[_0xb038('0x38')],'outboundAnswerCallsDay':_0xe5ea8b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xe5ea8b[_0xb038('0x39')],'outboundBusyCallsDay':_0xe5ea8b[_0xb038('0x3a')],'outboundCongestionCallsDay':_0xe5ea8b[_0xb038('0x3b')],'outboundDropCallsDayACS':_0xe5ea8b[_0xb038('0x3c')],'outboundDropCallsDayCallersExit':_0xe5ea8b[_0xb038('0x3d')],'outboundDropCallsDayTimeout':_0xe5ea8b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xe5ea8b[_0xb038('0x3e')],'outboundNoSuchCallsDay':_0xe5ea8b[_0xb038('0x3f')],'outboundOriginateFailureCallsDay':_0xe5ea8b[_0xb038('0x40')],'outboundReCallsDay':_0xe5ea8b[_0xb038('0x41')],'outboundRejectCallsDay':_0xe5ea8b[_0xb038('0x42')],'outboundUnknownCallsDay':_0xe5ea8b[_0xb038('0x43')],'outboundAbandonedCallsDay':_0xe5ea8b[_0xb038('0x44')],'predictiveIntervalAnsweredCalls':_0xe5ea8b[_0xb038('0x45')],'predictiveIntervalAvgHoldtime':_0xe5ea8b[_0xb038('0x46')],'predictiveIntervalAvgTalktime':_0xe5ea8b[_0xb038('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0xe5ea8b[_0xb038('0x48')],'predictiveIntervalDroppedCallsTimeout':_0xe5ea8b[_0xb038('0x49')],'predictiveIntervalErlangCalls':_0xe5ea8b[_0xb038('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0xe5ea8b['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xe5ea8b[_0xb038('0x4b')],'predictiveIntervalMultiplicativeFactor':_0xe5ea8b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xe5ea8b[_0xb038('0x4c')],'predictiveIntervalAvailable':_0xe5ea8b[_0xb038('0x4d')],'predictiveIntervalTotalCalls':_0xe5ea8b[_0xb038('0x4e')],'message':_0xe5ea8b[_0xb038('0x4f')],'originated':_0xe5ea8b[_0xb038('0x50')],'erlangCalls':_0xe5ea8b[_0xb038('0x51')],'erlangCallToSecond':_0xe5ea8b[_0xb038('0x52')],'erlangAbandonmentRate':_0xe5ea8b[_0xb038('0x53')],'erlangBusyFactor':_0xe5ea8b[_0xb038('0x54')],'startPredictive':_0xe5ea8b[_0xb038('0x55')],'startProgressive':_0xe5ea8b['startProgressive']};if(_0xe5ea8b[_0xb038('0x56')]){_0x5f123d[_0xb038('0x56')]={'id':_0xe5ea8b[_0xb038('0x56')]['id'],'name':_0xe5ea8b['Trunk']['name'],'active':_0xe5ea8b['Trunk'][_0xb038('0x57')],'callerid':_0xe5ea8b[_0xb038('0x56')][_0xb038('0x58')]};}if(_0xe5ea8b[_0xb038('0x59')]){_0x5f123d[_0xb038('0x59')]={'id':_0xe5ea8b[_0xb038('0x59')]['id'],'name':_0xe5ea8b['Interval'][_0xb038('0x28')]};}var _0x378cae=md5(JSON[_0xb038('0x5a')](_0x5f123d));if(_0xe5ea8b[_0xb038('0x3')]!==_0x378cae){_0xe5ea8b['md5']=_0x378cae;emit(util[_0xb038('0x5b')](_0xb038('0x5c'),_0x5f123d['name']),'voice_queue:save',_0x5f123d);}}}function emitVoiceQueueChannelRemove(_0x26c769){logger[_0xb038('0x5d')](_0xb038('0x5e'),JSON[_0xb038('0x5a')](_0x26c769));emit(util[_0xb038('0x5b')]('voice:queue:%s',_0x26c769[_0xb038('0x28')]),_0xb038('0x5f'),_0x26c769);io[_0xb038('0x25')](_0xb038('0x60'),_0x26c769);}function notSendMessagesQueue(_0x5dd192){if(_0x5dd192[_0xb038('0x61')]){if(_0x5dd192[_0xb038('0x50')]===0x0&&_0x5dd192[_0xb038('0x62')]===0x0){_0x5dd192['sendMessageOneNotActive']=![];_0x5dd192[_0xb038('0x2a')]=0x0;_0x5dd192['paused']=0x0;_0x5dd192[_0xb038('0x4f')]=_0xb038('0x63');ut[_0xb038('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5dd192[_0xb038('0x28')]+_0xb038('0x65'));}else{_0x5dd192[_0xb038('0x4f')]='IS_DISACTIVED';ut[_0xb038('0x64')](_0xb038('0x66'),_0x5dd192[_0xb038('0x28')]+_0xb038('0x67'));}emitCampaignPreview(_0x5dd192);}}Preview['prototype'][_0xb038('0x24')]=function(){var _0x274212=this;setInterval(function(){_0x274212[_0xb038('0x68')]();},0x7cf);};Preview[_0xb038('0x69')]['syncCampaigns']=function(){var _0x19dc7b=this[_0xb038('0x10')];this['clockClearZombieChannels']+=0x1;for(var _0x207fb5 in _0x19dc7b){if(_0x19dc7b[_0xb038('0x6a')](_0x207fb5)&&(_0x19dc7b[_0x207fb5][_0xb038('0x34')]==='preview'||_0x19dc7b[_0x207fb5][_0xb038('0x34')]===_0xb038('0x6b'))&&_0x19dc7b[_0x207fb5]['type']==='outbound'){if(this[_0xb038('0x15')]>0x7){this[_0xb038('0x15')]=0x0;this[_0xb038('0x6c')]();}}if(_0x19dc7b[_0xb038('0x6a')](_0x207fb5)&&_0x19dc7b[_0x207fb5][_0xb038('0x34')]===_0xb038('0x6d')&&_0x19dc7b[_0x207fb5][_0xb038('0x26')]===_0xb038('0x27')){if(_0x19dc7b[_0x207fb5]['dialActive']){this['setMessage'](_0x19dc7b[_0x207fb5]);if(_0x19dc7b[_0x207fb5]['dialPreviewAutoRecallMe'])this[_0xb038('0x6e')](_0x19dc7b[_0x207fb5]);}else{notSendMessagesQueue(_0x19dc7b[_0x207fb5]);}}}};Preview[_0xb038('0x69')]['clearZombieChannel']=function(_0x46a724){var _0x20b6af=this;this[_0xb038('0xf')]['enqueue'](function(){if(!_[_0xb038('0x6f')](_0x20b6af['actions'][_0x46a724])){loggerAction['info'](_0xb038('0x70'),_0x46a724,_0xb038('0x71'),_0x20b6af[_0xb038('0x13')][_0x46a724][_0xb038('0x72')],_0xb038('0x73'),JSON[_0xb038('0x5a')](_0x20b6af[_0xb038('0x10')][_0x20b6af[_0xb038('0x13')][_0x46a724][_0xb038('0x72')]][_0xb038('0x50')]),'pTalking:\x20',JSON[_0xb038('0x5a')](_0x20b6af[_0xb038('0x10')][_0x20b6af['actions'][_0x46a724][_0xb038('0x72')]][_0xb038('0x62')]),JSON['stringify'](_0x20b6af[_0xb038('0x13')][_0x46a724][_0xb038('0x74')]),JSON[_0xb038('0x5a')](_[_0xb038('0x75')](_0x20b6af[_0xb038('0x13')][_0x46a724],[_0xb038('0x76'),_0xb038('0x77'),_0xb038('0x78'),_0xb038('0x79')])));return ami['Action']({'action':_0xb038('0x7a'),'channel':_0x20b6af[_0xb038('0x13')][_0x46a724][_0xb038('0x7b')]})[_0xb038('0x7c')](function(_0x1176da){if(_0x1176da[_0xb038('0x4f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x20b6af[_0xb038('0x13')][_0x46a724]){ut[_0xb038('0x7d')](_0x20b6af[_0xb038('0x10')][_0x20b6af[_0xb038('0x13')][_0x46a724][_0xb038('0x72')]],_0xb038('0x7e'));if(_0x20b6af[_0xb038('0x13')][_0x46a724]['dialAnswer']===!![]){ut[_0xb038('0x7f')](_0x20b6af['campaignsPreview'][_0x20b6af[_0xb038('0x13')][_0x46a724][_0xb038('0x72')]],_0xb038('0x7e'));ut[_0xb038('0x80')](_0xb038('0x81')+_0x46a724,_0x20b6af['actions'][_0x46a724]['queue']);}ut['loggerError'](_0xb038('0x82')+_0x46a724,_0x20b6af[_0xb038('0x13')][_0x46a724][_0xb038('0x72')]);delete _0x20b6af[_0xb038('0x13')][_0x46a724];}},0x2328);}});}});};Preview[_0xb038('0x69')][_0xb038('0x6c')]=function(){var _0x525687=this;loggerAction[_0xb038('0x5d')](_0xb038('0x83'),_['size'](this['actions']));for(var _0xf2907b in this['actions']){if(_0x525687[_0xb038('0x13')]['hasOwnProperty'](_0xf2907b)){_0x525687[_0xb038('0x84')](_0xf2907b);}}};Preview[_0xb038('0x69')][_0xb038('0x6e')]=function(_0x4300e9){var _0x4ee38b=this;rpcDb[_0xb038('0x85')](_0x4300e9['id'],ut[_0xb038('0x86')](this[_0xb038('0x14')]))[_0xb038('0x87')](function(_0x1c5e1d){if(!_[_0xb038('0x6f')](_0x1c5e1d)){for(var _0x14a553=0x0;_0x14a553<_0x1c5e1d[_0xb038('0x88')];_0x14a553+=0x1){if(ut[_0xb038('0x89')](_0x1c5e1d[_0x14a553][_0xb038('0x8a')])<_0x4300e9[_0xb038('0x8b')]*0x3c){if(_0x1c5e1d[_0x14a553][_0xb038('0x8c')]&&!_0x1c5e1d[_0x14a553]['Agent'][_0xb038('0x8d')]){_0x4ee38b[_0xb038('0x8e')](_0x1c5e1d[_0x14a553]['id'])[_0xb038('0x87')](ut[_0xb038('0x8f')](_0xb038('0x90')))['catch'](ut[_0xb038('0x8f')]('[RecallMe]'));}else{rpcDb[_0xb038('0x91')](_0x1c5e1d[_0x14a553]['id']);}}else{var _0x170a7e=new Action(_0x1c5e1d[_0x14a553],_0x4300e9);_0x170a7e['starttime']=moment()[_0xb038('0x5b')](_0xb038('0x92'));_0x4300e9[_0xb038('0x41')]+=0x1;ut[_0xb038('0x93')](_0x170a7e,0x17,_0xb038('0x94'));if(_0x4300e9[_0xb038('0x95')]){rpcDb[_0xb038('0x96')](ut[_0xb038('0x97')](_0x1c5e1d[_0x14a553]));rpcDb[_0xb038('0x98')](_0x170a7e,_0xb038('0x99'));}else{ut['logCustomer'](_0x170a7e,0x16,_0xb038('0x9a'));rpcDb['createCustomerHistory'](_0x170a7e,_0xb038('0x9b'));rpcDb[_0xb038('0x9c')](_0x170a7e,_0xb038('0x9b'));}}}}})[_0xb038('0x7c')](ut[_0xb038('0x8f')](_0xb038('0x9d')));};Preview[_0xb038('0x69')]['setMessage']=function(_0x572ad4){_0x572ad4[_0xb038('0x61')]=!![];if(ut[_0xb038('0x9e')](_0x572ad4[_0xb038('0x2b')])){_0x572ad4['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0xb038('0x9f')](_0x572ad4['dialActive'])){_0x572ad4[_0xb038('0x4f')]='NOT_ACTIVE';}else if(!this[_0xb038('0xa0')](_0x572ad4['Trunk'])){if(!this[_0xb038('0xa0')](_0x572ad4[_0xb038('0xa1')])){_0x572ad4[_0xb038('0x4f')]=_0xb038('0xa2');}else{_0x572ad4[_0xb038('0x4f')]=_0xb038('0xa3');}}else{_0x572ad4['message']='ACTIVE';}emitCampaignPreview(_0x572ad4);};Preview[_0xb038('0x69')]['callProgressDetectingCustomer']=function(_0x151f64,_0x42f5dc,_0x2f4650){var _0x538690=this;var _0x3071c8=this['actions'][_0x42f5dc];var _0xd53646=this[_0xb038('0x10')][_0x3071c8[_0xb038('0x72')]];var _0x4a417a;if(_0xd53646){switch(_0x2f4650){case'1':_0xd53646[_0xb038('0x3f')]+=0x1;_0x3071c8[_0xb038('0xa4')]+=0x1;_0x3071c8[_0xb038('0xa5')]=ut[_0xb038('0xa6')](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0x0,'NoSuchNumber');ami['emit']('custom:agentnosuchnumber',ut[_0xb038('0xa7')](_0x3071c8,'nosuchnumber'));rpcDb[_0xb038('0x98')](_0x3071c8,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xb038('0xa6')](_0x3071c8)>=_0xd53646[_0xb038('0xa8')]){_0x4a417a=ut[_0xb038('0xa9')](_0x3071c8,0xf,_0xb038('0xaa'));rpcDb[_0xb038('0x9c')](_0x4a417a,_0xb038('0xab'));}else{if(_0x3071c8[_0xb038('0xa4')]>=_0xd53646[_0xb038('0xac')]){rpcDb[_0xb038('0x9c')](_0x3071c8,_0xb038('0xab'));}else{rpcDb[_0xb038('0xad')](ut[_0xb038('0xae')](_0x3071c8,_0xb038('0xa4'),_0xd53646[_0xb038('0xaf')]),_0x3071c8[_0xb038('0xb0')],_0x3071c8[_0xb038('0xb1')]);}}delete this[_0xb038('0x13')][_0x151f64[_0xb038('0xb2')]];break;case _0xb038('0xb3'):var _0x5d0f38=moment()[_0xb038('0x5b')](_0xb038('0x92'));_0x3071c8[_0xb038('0xb4')]=_0x5d0f38;_0x3071c8[_0xb038('0xb5')]=_0x5d0f38;_0x3071c8[_0xb038('0x74')]=!![];_0xd53646['pTalking']+=0x1;logger[_0xb038('0x5d')](_0xb038('0xb6'),_0x3071c8[_0xb038('0xb7')],_0xb038('0xb8'),_0xd53646[_0xb038('0x28')],_0xb038('0xb9'),_0xd53646[_0xb038('0x62')]);ami[_0xb038('0x25')](_0xb038('0xba'),ut['buildObj'](_0x3071c8,'connect',this[_0xb038('0x10')][_0x3071c8['queue']]));if(_0xd53646[_0xb038('0xbb')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x3071c8));}break;case'16':ami[_0xb038('0x25')](_0xb038('0xbc'),ut['buildObj'](_0x3071c8,_0xb038('0xbd'),this[_0xb038('0x10')][_0x3071c8[_0xb038('0x72')]]));emitVoiceQueueChannelRemove(ut[_0xb038('0xa7')](_0x3071c8,_0xb038('0xbd')));_0xd53646[_0xb038('0xbe')]+=0x1;_0xd53646[_0xb038('0x2f')]+=0x1;_0xd53646[_0xb038('0xbf')]+=0x1;ut[_0xb038('0x7f')](_0xd53646,_0xb038('0xc0'));_0x3071c8['countglobal']=ut[_0xb038('0xa6')](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0x4,_0xb038('0xc1'));rpcDb[_0xb038('0x98')](_0x3071c8,_0xb038('0xc2'));rpcDb[_0xb038('0x9c')](_0x3071c8,_0xb038('0xc3'));rpcDb['crateCustomerReportQueue'](_0x3071c8);_0xd53646[_0xb038('0xc4')]+=_0x3071c8[_0xb038('0xc5')];_0xd53646[_0xb038('0x2c')]+=_0x3071c8['talktime'];logger['info'](_0xb038('0xc6'),_0x3071c8[_0xb038('0xb7')],_0xb038('0xb8'),_0xd53646['name'],_0xb038('0xb9'),_0xd53646[_0xb038('0x62')]);delete this['actions'][_0x151f64[_0xb038('0xb2')]];break;case _0xb038('0xc7'):_0xd53646[_0xb038('0x3a')]+=0x1;_0x3071c8[_0xb038('0xc8')]+=0x1;_0x3071c8[_0xb038('0xa5')]=ut[_0xb038('0xa6')](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0x5,_0xb038('0xc9'));ami[_0xb038('0x25')](_0xb038('0xca'),ut[_0xb038('0xa7')](_0x3071c8,_0xb038('0xcb')));rpcDb[_0xb038('0x98')](_0x3071c8,_0xb038('0xcc'));if(ut['totalGlobal'](_0x3071c8)>=_0xd53646[_0xb038('0xa8')]){_0x4a417a=ut[_0xb038('0xa9')](_0x3071c8,0xf,_0xb038('0xaa'));rpcDb[_0xb038('0x9c')](_0x4a417a,_0xb038('0xcd'));}else{if(_0x3071c8[_0xb038('0xc8')]>=_0xd53646[_0xb038('0xce')]){rpcDb[_0xb038('0x9c')](_0x3071c8,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xb038('0xad')](ut[_0xb038('0xae')](_0x3071c8,'countbusyretry',_0xd53646[_0xb038('0xcf')]),_0x3071c8['unlockAgent'],_0x3071c8['activeContact']);}}break;case _0xb038('0xd0'):_0xd53646['outboundNoAnswerCallsDay']+=0x1;_0x3071c8[_0xb038('0xd1')]+=0x1;_0x3071c8['countglobal']=ut[_0xb038('0xa6')](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0x3,_0xb038('0xd2'));ami[_0xb038('0x25')](_0xb038('0xd3'),ut[_0xb038('0xa7')](_0x3071c8,_0xb038('0xd4')));rpcDb[_0xb038('0x98')](_0x3071c8,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x3071c8)>=_0xd53646[_0xb038('0xa8')]){_0x4a417a=ut[_0xb038('0xa9')](_0x3071c8,0xf,_0xb038('0xaa'));rpcDb[_0xb038('0x9c')](_0x4a417a,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3071c8[_0xb038('0xd1')]>=_0xd53646[_0xb038('0xd5')]){rpcDb[_0xb038('0x9c')](_0x3071c8,_0xb038('0xd6'));}else{rpcDb[_0xb038('0xad')](ut[_0xb038('0xae')](_0x3071c8,_0xb038('0xd1'),_0xd53646[_0xb038('0xd7')]),_0x3071c8[_0xb038('0xb0')],_0x3071c8[_0xb038('0xb1')]);}}break;case'CONGESTION':_0xd53646['outboundCongestionCallsDay']+=0x1;_0x3071c8[_0xb038('0xd8')]+=0x1;_0x3071c8[_0xb038('0xa5')]=ut[_0xb038('0xa6')](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0x8,_0xb038('0xd9'));ami[_0xb038('0x25')](_0xb038('0xda'),ut['buildObj'](_0x3071c8,_0xb038('0xdb')));rpcDb[_0xb038('0x98')](_0x3071c8,_0xb038('0xdc'));if(ut[_0xb038('0xa6')](_0x3071c8)>=_0xd53646[_0xb038('0xa8')]){_0x4a417a=ut[_0xb038('0xa9')](_0x3071c8,0xf,'Global');rpcDb[_0xb038('0x9c')](_0x4a417a,_0xb038('0xdd'));}else{if(_0x3071c8[_0xb038('0xd8')]>=_0xd53646[_0xb038('0xde')]){rpcDb[_0xb038('0x9c')](_0x3071c8,_0xb038('0xdc'));}else{rpcDb[_0xb038('0xad')](ut[_0xb038('0xae')](_0x3071c8,_0xb038('0xd8'),_0xd53646[_0xb038('0xcf')]),_0x3071c8[_0xb038('0xb0')],_0x3071c8[_0xb038('0xb1')]);}}break;case _0xb038('0xdf'):_0xd53646[_0xb038('0x42')]+=0x1;_0x3071c8[_0xb038('0xe0')]+=0x1;_0x3071c8[_0xb038('0xa5')]=ut['totalGlobal'](_0x3071c8);ut['logCustomer'](_0x3071c8,0x14,_0xb038('0xe1'));ami[_0xb038('0x25')](_0xb038('0xe2'),ut['buildObj'](_0x3071c8,_0xb038('0xe3')));rpcDb[_0xb038('0x98')](_0x3071c8,_0xb038('0xe4'));if(ut[_0xb038('0xa6')](_0x3071c8)>=_0xd53646['dialGlobalMaxRetry']){_0x4a417a=ut['cloneAction'](_0x3071c8,0x14,_0xb038('0xe1'));rpcDb[_0xb038('0x9c')](_0x4a417a,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3071c8[_0xb038('0xe0')]>=_0xd53646[_0xb038('0xe5')]){rpcDb[_0xb038('0x9c')](_0x3071c8,_0xb038('0xe6'));}else{rpcDb['rescheduleContact'](ut[_0xb038('0xae')](_0x3071c8,_0xb038('0xe0'),_0xd53646[_0xb038('0xe7')]),_0x3071c8[_0xb038('0xb0')],_0x3071c8[_0xb038('0xb1')]);}}break;case _0xb038('0xe8'):_0xd53646[_0xb038('0x44')]+=0x1;_0x3071c8['countabandonedretry']+=0x1;_0x3071c8[_0xb038('0xa5')]=ut[_0xb038('0xa6')](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0xb,'Abandoned');rpcDb[_0xb038('0x98')](_0x3071c8,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xb038('0xa6')](_0x3071c8)>=_0xd53646['dialGlobalMaxRetry']){_0x4a417a=ut[_0xb038('0xa9')](_0x3071c8,0xf,_0xb038('0xaa'));rpcDb[_0xb038('0x9c')](_0x4a417a,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3071c8['countabandonedetry']>=_0xd53646['dialAbandonedMaxRety']){rpcDb[_0xb038('0x9c')](_0x3071c8,_0xb038('0xe9'));}else{rpcDb[_0xb038('0xad')](ut['scheduledAt'](_0x3071c8,_0xb038('0xea'),_0xd53646['dialAbandonedRetryFrequency']),_0x3071c8[_0xb038('0xb0')],_0x3071c8['activeContact']);}}break;case'18':_0xd53646['outboundUnknownCallsDay']+=0x1;_0x3071c8[_0xb038('0xeb')]+=0x1;_0x3071c8[_0xb038('0xa5')]=ut[_0xb038('0xa6')](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0x12,_0x151f64[_0xb038('0xec')]||_0x151f64[_0xb038('0xed')]);ami[_0xb038('0x25')]('custom:amd',ut[_0xb038('0xa7')](_0x3071c8,'amd'));rpcDb['createCustomerHistory'](_0x3071c8,_0xb038('0xee'));if(ut[_0xb038('0xa6')](_0x3071c8)>=_0xd53646[_0xb038('0xa8')]){_0x4a417a=ut[_0xb038('0xa9')](_0x3071c8,0xf,_0xb038('0xaa'));rpcDb[_0xb038('0x9c')](_0x4a417a,_0xb038('0xee'));}else{rpcDb['createCustomerFinal'](_0x3071c8,_0xb038('0xee'));}delete this[_0xb038('0x13')][_0x151f64[_0xb038('0xb2')]];break;case'19':_0xd53646[_0xb038('0x43')]+=0x1;_0x3071c8[_0xb038('0xa5')]=ut['totalGlobal'](_0x3071c8);ut[_0xb038('0x93')](_0x3071c8,0x13,_0x151f64[_0xb038('0xec')]||_0x151f64[_0xb038('0xed')]);ami[_0xb038('0x25')]('custom:amd',ut[_0xb038('0xa7')](_0x3071c8,_0xb038('0xef')));rpcDb['createCustomerHistory'](_0x3071c8,_0xb038('0xf0'));if(ut['totalGlobal'](_0x3071c8)>=_0xd53646[_0xb038('0xa8')]){_0x4a417a=ut['cloneAction'](_0x3071c8,0xf,'Global');rpcDb['createCustomerFinal'](_0x4a417a,_0xb038('0xf0'));}else{rpcDb['createCustomerFinal'](_0x3071c8,_0xb038('0xf0'));}delete this[_0xb038('0x13')][_0x151f64[_0xb038('0xb2')]];break;default:if(_0x3071c8[_0xb038('0x74')]){ut[_0xb038('0x7f')](_0xd53646,_0xb038('0xf1'));ut[_0xb038('0x80')](_0xb038('0xf2')+_0xd53646['name'],_0x151f64);}_0xd53646[_0xb038('0x43')]+=0x1;_0x3071c8[_0xb038('0xa5')]=ut['totalGlobal'](_0x3071c8);ut['logCustomer'](_0x3071c8,0xc,_0x151f64['cause-txt']||_0x151f64[_0xb038('0xed')]);rpcDb[_0xb038('0x98')](_0x3071c8,_0xb038('0xf3'));if(ut['totalGlobal'](_0x3071c8)>=_0xd53646[_0xb038('0xa8')]){_0x4a417a=ut[_0xb038('0xa9')](_0x3071c8,0xf,_0xb038('0xaa'));rpcDb[_0xb038('0x9c')](_0x4a417a,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xb038('0x9c')](_0x3071c8,_0xb038('0xf4'));}delete this[_0xb038('0x13')][_0x151f64['linkedid']];}if(!(_0x3071c8[_0xb038('0x74')]&&_0x2f4650==='16')){ut[_0xb038('0x7d')](_0xd53646,'[callProgressDetectingCustomer]');logger[_0xb038('0x5d')]('[originated][decrement][callProgressDetectingCustomer]',_0x3071c8['uniqueid'],_0xb038('0xb8'),_0xd53646[_0xb038('0x28')],'originated:\x20',_0xd53646['originated']);}if(_0x2f4650!==_0xb038('0xb3')){delete this[_0xb038('0x13')][_0x151f64[_0xb038('0xb2')]];delete this[_0xb038('0x13')][_0x151f64[_0xb038('0xf5')]];}}};Preview[_0xb038('0x69')][_0xb038('0xf6')]=function(_0x38bf8c,_0x42047e,_0xf6b7da){if(_[_0xb038('0xf7')](_0x42047e)&&_0xb038('0xf8')!==typeof _0x42047e){return;}if(_[_0xb038('0xf7')](_0xf6b7da)&&_0xb038('0xf8')!==typeof _0xf6b7da){return;}switch(_0xf6b7da[_0xb038('0xf9')]){case'0':ut[_0xb038('0xfa')](_0x38bf8c,0x0,_0xb038('0xfb'));rpcDb[_0xb038('0xfc')](_0x38bf8c,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xb038('0xfa')](_0x38bf8c,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x38bf8c,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb038('0xfa')](_0x38bf8c,0x5,_0xb038('0xc9'));rpcDb[_0xb038('0xfc')](_0x38bf8c,_0xb038('0xfd'));break;case'8':ut[_0xb038('0xfa')](_0x38bf8c,0x8,_0xb038('0xd9'));rpcDb[_0xb038('0xfc')](_0x38bf8c,_0xb038('0xfe'));break;case'22':ut[_0xb038('0xfa')](_0x38bf8c,0x16,'AnswerAGI');rpcDb[_0xb038('0xfc')](_0x38bf8c,_0xb038('0xff'));break;default:ut[_0xb038('0xfa')](_0x38bf8c,0xc,_0xf6b7da[_0xb038('0xf9')]);rpcDb['createAgentHistory'](_0x38bf8c,_0xb038('0xfe'));}ut['updateOriginated'](_0x42047e,_0xb038('0x100'));logger[_0xb038('0x5d')](_0xb038('0x101'),_0x38bf8c[_0xb038('0xb7')],'\x20Queue',_0x42047e[_0xb038('0x28')],_0xb038('0x73'),_0x42047e[_0xb038('0x50')]);delete this[_0xb038('0x13')][_0x38bf8c[_0xb038('0xb7')]];};Preview[_0xb038('0x69')][_0xb038('0x102')]=function(_0x5bb019,_0x573a77,_0x3927c9,_0x3df6f7,_0x4d93d7){var _0x51b24c=this;return new BPromise(function(_0x46c6ac,_0x5b6b6b){if(_[_0xb038('0x6f')](_0x573a77)||_[_0xb038('0x6f')](_0x573a77[_0xb038('0x103')])||_[_0xb038('0x6f')](_0x573a77['Contact']['phone'])||_[_0xb038('0x6f')](_0x573a77[_0xb038('0x78')])){_0x5b6b6b(ut[_0xb038('0x4f')]('Contact\x20is\x20undefined',_0x3df6f7,_0x4d93d7));return;}var _0x238166=uuid['v4']();var _0x1431c7=_0x51b24c['campaignsPreview'][_0x573a77[_0xb038('0x71')]['name']];var _0x3d50c1=_0x3927c9?_0x51b24c[_0xb038('0x14')][_0x3927c9]['id']:undefined;_0x51b24c[_0xb038('0x13')][_0x238166]=new Action(_0x573a77,_0x1431c7,_0x238166,_0x3927c9,_0x3d50c1);var _0x3ce582=_0x51b24c[_0xb038('0x13')][_0x238166];_0x3ce582[_0xb038('0xb0')]=_0x3df6f7;_0x3ce582[_0xb038('0xb1')]=_0x4d93d7;_0x3ce582[_0xb038('0x104')]=_0x3927c9;if(_[_0xb038('0x105')](_0x5bb019)){_0x51b24c[_0xb038('0x106')](_0x3ce582,_0x1431c7,_0x573a77,_0x3927c9)['then'](function(_0x10d65b){logger['info'](_0xb038('0x107'),_0xb038('0x108')+_0x3ce582[_0xb038('0x72')]+_0xb038('0x109')+_0x3ce582['idContact'],JSON['stringify'](_0x10d65b));ami[_0xb038('0x25')](_0xb038('0x10a'),ut[_0xb038('0xa7')](_0x3ce582,_0xb038('0x10b'),_0x51b24c[_0xb038('0x10')][_0x3ce582['queue']]));_0x46c6ac(ut[_0xb038('0x4f')](_0xb038('0x10c')));})[_0xb038('0x7c')](function(_0x19d2e6){ut['logger'](_0xb038('0x10d'),_0x19d2e6);_0x5b6b6b(ut['message'](_0xb038('0x10e'),_0x3df6f7,_0x4d93d7));});}else{_0x1431c7[_0xb038('0x39')]+=0x1;ut[_0xb038('0x10f')](_0x3ce582);rpcDb[_0xb038('0x110')](_0x3ce582,_0xb038('0x111'));delete _0x51b24c['actions'][_0x238166];_0x5b6b6b(ut['message'](_0xb038('0x112'),_0x3df6f7,_0x4d93d7));}});};Preview[_0xb038('0x69')]['isTrunkReachable']=function(_0x5c1285){return!_[_0xb038('0x6f')](_0x5c1285)&&!_['isNil'](_0x5c1285[_0xb038('0x28')])&&!_[_0xb038('0x6f')](_0x5c1285['active'])&&_0x5c1285[_0xb038('0x57')]&&!_[_0xb038('0x6f')](this['trunks'][util[_0xb038('0x5b')](_0xb038('0x113'),_0x5c1285[_0xb038('0x28')])])&&!_[_0xb038('0x6f')](this[_0xb038('0x12')][util[_0xb038('0x5b')](_0xb038('0x113'),_0x5c1285[_0xb038('0x28')])][_0xb038('0x7a')])&&(this[_0xb038('0x12')][util['format'](_0xb038('0x113'),_0x5c1285[_0xb038('0x28')])]['status']==='reachable'||this['trunks'][util['format'](_0xb038('0x113'),_0x5c1285[_0xb038('0x28')])][_0xb038('0x7a')]===_0xb038('0x114'));};Preview[_0xb038('0x69')][_0xb038('0x8e')]=function(_0x550acc,_0x215b97){var _0x5b64b6=this;return new BPromise(function(_0x50fabf,_0x405fae){_0x5b64b6[_0xb038('0x115')](_0x550acc,_0x215b97)[_0xb038('0x87')](function(_0x6f8354){_0x50fabf(_['pick'](_0x6f8354,[_0xb038('0x4f')]));})[_0xb038('0x7c')](function(_0x2abc37){if(_0x2abc37['unlock']){rpcDb[_0xb038('0x116')](_0x550acc);}if(_0x2abc37[_0xb038('0x57')]){rpcDb['disableContact'](_0x550acc);}_0x405fae(_['pick'](_0x2abc37,[_0xb038('0x4f')]));});});};Preview[_0xb038('0x69')][_0xb038('0x115')]=function(_0xf6c495,_0x212139){var _0x4ca7a9=this;return new BPromise(function(_0x1f4881,_0x11c3a2){var _0x3069e4,_0x2806c5;rpcDb['getContactPreview'](_0xf6c495)[_0xb038('0x87')](function(_0x57f9c7){if(!_[_0xb038('0x6f')](_0x57f9c7[0x0])){_0x2806c5=_0x57f9c7[0x0][_0xb038('0x117')]?![]:!![];_0x3069e4=_0x57f9c7[0x0]['recallme']?!![]:![];_0x3069e4=_0x212139?!![]:_0x3069e4;}var _0x5437a1=_0x4ca7a9['validateContact'](_0x57f9c7);if(_0x5437a1[_0xb038('0x118')]){rpcDb[_0xb038('0x119')](_[_0xb038('0x75')](_0x57f9c7[0x0],['VoiceQueueId',_0xb038('0x11a')]))[_0xb038('0x87')](function(_0x317881){_0x4ca7a9[_0xb038('0x102')](_0x317881,_0x57f9c7[0x0],_0x212139,_0x2806c5,_0x3069e4)[_0xb038('0x87')](function(_0x53dd9c){_0x1f4881(_0x53dd9c);})['catch'](function(_0x41d056){_0x11c3a2(_0x41d056);});})['catch'](function(_0x354baf){ut[_0xb038('0x64')](_0xb038('0x11b'),_0x354baf);_0x11c3a2(ut['message'](_0xb038('0x11c'),_0x2806c5,_0x3069e4));});}else{_0x11c3a2(ut[_0xb038('0x4f')](_0x5437a1['message'],_0x2806c5,_0x3069e4));}})[_0xb038('0x7c')](function(_0x43343f){ut[_0xb038('0x64')](_0xb038('0x11d'),_0x43343f);_0x11c3a2(ut[_0xb038('0x4f')](_0xb038('0x11c'),![],!![]));});});};Preview[_0xb038('0x69')][_0xb038('0x11e')]=function(_0x55f1a6){if(_['isNil'](_0x55f1a6)||_[_0xb038('0x105')](_0x55f1a6)||!_[_0xb038('0x6f')](_0x55f1a6[0x0][_0xb038('0x8c')])&&_[_0xb038('0x6f')](_0x55f1a6[0x0][_0xb038('0x8c')][_0xb038('0x28')])){ut[_0xb038('0x64')](_0xb038('0x11f'),_0x55f1a6);return{'isValid':![],'message':'Empty\x20Contact'};}var _0xccc5b8=this[_0xb038('0x10')][_0x55f1a6[0x0]['Queue'][_0xb038('0x28')]];_0xccc5b8[_0xb038('0x4f')]=_0xb038('0xa3');if(_[_0xb038('0x6f')](_0xccc5b8)){ut[_0xb038('0x64')](_0xb038('0x120'),_0xccc5b8);return{'isValid':![],'message':_0xb038('0x121')};}if(!this[_0xb038('0xa0')](_0xccc5b8[_0xb038('0x56')])){ut['logger'](_0xb038('0x122'),_0xb038('0x123')+_0xccc5b8[_0xb038('0x28')]+_0xb038('0x124'));if(!this[_0xb038('0xa0')](_0xccc5b8[_0xb038('0xa1')])){ut[_0xb038('0x64')](_0xb038('0x122'),_0xccc5b8[_0xb038('0x28')]+_0xb038('0x125'));return{'isValid':![],'message':_0xb038('0x126')};}}if(!ut['isActive'](_0xccc5b8['dialActive'])){ut[_0xb038('0x64')](_0xb038('0x127'),_0xccc5b8['name']+_0xb038('0x128'));return{'isValid':![],'message':_0xb038('0x123')+_0xccc5b8[_0xb038('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xb038('0x69')][_0xb038('0x106')]=function(_0x4cd719,_0x4cbb85,_0x3d1bb5,_0x38385e){var _0x146ee9=this;return new BPromise(function(_0x474bdf,_0x169f60){var _0x5c150c=_0x4cd719[_0xb038('0xb7')];var _0x365233=_0x146ee9[_0xb038('0xa0')](_0x4cbb85['Trunk'])?util[_0xb038('0x5b')](_0xb038('0x129'),_0x4cbb85['Trunk'][_0xb038('0x28')],_[_0xb038('0x6f')](_0x4cbb85[_0xb038('0x37')])?'':_0x4cbb85[_0xb038('0x37')]['trim']()||'',_0x4cbb85['dialCutDigit']>0x0?_0x3d1bb5['Contact'][_0xb038('0x12a')]['substring'](_0x4cbb85[_0xb038('0x12b')]):_0x3d1bb5[_0xb038('0x103')][_0xb038('0x12a')]):util[_0xb038('0x5b')](_0xb038('0x129'),_[_0xb038('0x6f')](_0x4cbb85[_0xb038('0xa1')])?_0x4cbb85[_0xb038('0x56')]['name']:_0x4cbb85[_0xb038('0xa1')][_0xb038('0x28')],_[_0xb038('0x6f')](_0x4cbb85['dialPrefix'])?'':_0x4cbb85['dialPrefix'][_0xb038('0x12c')]()||'',_0x4cbb85[_0xb038('0x12b')]>0x0?_0x3d1bb5[_0xb038('0x103')][_0xb038('0x12a')]['substring'](_0x4cbb85[_0xb038('0x12b')]):_0x3d1bb5[_0xb038('0x103')][_0xb038('0x12a')]);var _0x4fef3f=_0x146ee9['isTrunkReachable'](_0x4cbb85[_0xb038('0x56')])?ut[_0xb038('0x12d')](_0x4cbb85[_0xb038('0x56')][_0xb038('0x58')],_0x4cbb85[_0xb038('0x35')],_0x4cbb85['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb038('0x12e')](_0x4cbb85['dialOriginateCallerIdNumber'],_0x4cbb85[_0xb038('0x12f')]):_0x4cbb85['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0xb038('0x6f')](_0x4cbb85[_0xb038('0xa1')])?_0x4cbb85[_0xb038('0x56')]['callerid']:_0x4cbb85[_0xb038('0xa1')]['callerid'],_0x4cbb85['dialOriginateCallerIdName'],_0x4cbb85['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb038('0x12e')](_0x4cbb85['dialOriginateCallerIdNumber'],_0x4cbb85[_0xb038('0x12f')]):_0x4cbb85[_0xb038('0x130')]);if(_0x4fef3f){_0x4cd719[_0xb038('0x131')]=ut[_0xb038('0x132')](_0x4fef3f);_0x4cd719['originatecalleridnum']=ut[_0xb038('0x133')](_0x4fef3f);}var _0x556a76=ut[_0xb038('0x134')](_0x4cbb85,_0x3d1bb5,_0x365233,_0x4fef3f,_0x5c150c,_0x4cd719);_[_0xb038('0x135')](_0x4cd719,ut[_0xb038('0x136')](_0x556a76));_0x4cd719[_0xb038('0x137')]=moment()[_0xb038('0x5b')](_0xb038('0x92'));ami['Action'](ut[_0xb038('0x138')](_0x4cd719,_0x4cbb85,_0x556a76,_0x4cd719[_0xb038('0xb1')],_0x38385e))[_0xb038('0x87')](function(_0x3571bf){_0x4cbb85[_0xb038('0x50')]+=0x1;logger['info'](_0xb038('0x139'),_0x5c150c,_0xb038('0xb8'),_0x4cbb85[_0xb038('0x28')],_0xb038('0x73'),_0x4cbb85['originated']);_0x474bdf(_0x3571bf);})[_0xb038('0x7c')](function(_0x473931){ut[_0xb038('0xfa')](_0x4cd719,0xe,_0xb038('0x13a'));rpcDb[_0xb038('0xfc')](_0x4cd719,_0xb038('0x13b'));_0x169f60(_0x473931);});});};Preview[_0xb038('0x69')][_0xb038('0x1f')]=function(_0x59f077){if(this[_0xb038('0x13')][_0x59f077[_0xb038('0xb2')]]){this['actions'][_0x59f077['linkedid']][_0xb038('0x7b')]=_0x59f077[_0xb038('0x7b')];}};Preview[_0xb038('0x69')][_0xb038('0x17')]=function(_0x38743a){var _0x4f8263=this;var _0x2e6511=this[_0xb038('0x13')][_0x38743a[_0xb038('0x13c')]];if(_0x2e6511){if(_0x2e6511[_0xb038('0x104')]&&this[_0xb038('0x14')][_0x2e6511[_0xb038('0x104')]]){ut[_0xb038('0x13d')](_0x2e6511,this[_0xb038('0x14')][_0x2e6511[_0xb038('0x104')]][_0xb038('0x28')],this[_0xb038('0x14')][_0x2e6511[_0xb038('0x104')]]['id']);}var _0x5d3fe0=_[_0xb038('0x13e')](_0x2e6511);_0x5d3fe0['responsetime']=moment()[_0xb038('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3bcc05=_0x4f8263[_0xb038('0x10')][_0x2e6511['queue']];if(ut[_0xb038('0x13f')](_0x38743a['response'])){if(_0x2e6511[_0xb038('0xb0')]){rpcDb['unlockContact'](_0x2e6511[_0xb038('0x140')]);}if(_0x2e6511[_0xb038('0xb1')]){rpcDb['disableContact'](_0x2e6511[_0xb038('0x140')]);}ami[_0xb038('0x25')]('custom:agentringnoanswer',ut['buildObj'](_0x2e6511,'rejected',this[_0xb038('0x10')][_0x2e6511['queue']]));this['callProgressDetectingAgent'](_0x5d3fe0,_0x3bcc05,_0x38743a);}else{_0x2e6511[_0xb038('0x137')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x5d3fe0,0x4,_0xb038('0xc1'));rpcDb[_0xb038('0xfc')](_0x5d3fe0,_0xb038('0x141'));}}};Preview[_0xb038('0x69')][_0xb038('0x142')]=function(_0x112b57){var _0x13207a=this;var _0x2de2a5=this['actions'][_0x112b57[_0xb038('0xb2')]];var _0x476326;if(_0x2de2a5){_0x476326=this[_0xb038('0x10')][_0x2de2a5['queue']];logger[_0xb038('0x5d')](_0xb038('0x143'),_0x112b57[_0xb038('0xb2')],_0xb038('0xb8'),_0x476326['name'],'pTalking:\x20',_0x476326[_0xb038('0x62')]);}if(this[_0xb038('0x13')][_0x112b57['linkedid']]&&_0x112b57['linkedid']!==_0x112b57[_0xb038('0xb7')]){if(_0x112b57['cause']==='16'&&this[_0xb038('0x13')][_0x112b57[_0xb038('0xb2')]][_0xb038('0x74')]){this['callProgressDetectingCustomer'](_0x112b57,_0x112b57[_0xb038('0xb2')],_0x112b57[_0xb038('0x144')]);}else if(this['actions'][_0x112b57[_0xb038('0xb2')]][_0xb038('0x74')]){logger[_0xb038('0x5d')](_0xb038('0x145'),_0x112b57[_0xb038('0xb2')],_0x112b57[_0xb038('0x144')],_0xb038('0xb8'),_0x476326[_0xb038('0x28')],'pTalking:\x20',_0x476326[_0xb038('0x62')]);this[_0xb038('0x146')](_0x112b57,_0x112b57[_0xb038('0xb2')],_0x112b57[_0xb038('0x144')]);}}else if(_0x2de2a5&&_[_0xb038('0x6f')](_0x2de2a5[_0xb038('0x147')])&&_0x476326[_0xb038('0x148')]&&_0x112b57[_0xb038('0xb2')]===_0x112b57[_0xb038('0xb7')]&&_['isNil'](_0x112b57[_0xb038('0xf9')])&&_0x112b57[_0xb038('0x144')]==='16'&&_0x112b57[_0xb038('0x149')]==='6'&&_[_0xb038('0xf7')](_0x2de2a5[_0xb038('0x14a')])){if(_0x2de2a5[_0xb038('0xb0')]){rpcDb['unlockContact'](_0x2de2a5['idContact']);}if(_0x2de2a5[_0xb038('0xb1')]){rpcDb['disableContact'](_0x2de2a5[_0xb038('0x140')]);}_0x112b57[_0xb038('0xf9')]='22';this[_0xb038('0xf6')](_0x2de2a5,_0x476326,_0x112b57);}else if(_0x2de2a5&&_0x2de2a5[_0xb038('0x14a')]){if(_0x112b57['cause']==='16'&&this['actions'][_0x112b57['linkedid']][_0xb038('0x74')]){logger[_0xb038('0x5d')](_0xb038('0x14b'),_0x112b57[_0xb038('0xb2')],_0x112b57[_0xb038('0x144')],_0xb038('0xb8'),_0x476326['name'],_0xb038('0xb9'),_0x476326['pTalking']);this[_0xb038('0x146')](_0x112b57,_0x112b57['linkedid'],_0x112b57[_0xb038('0x144')]);}else if(this[_0xb038('0x13')][_0x112b57['linkedid']][_0xb038('0x74')]){logger[_0xb038('0x5d')](_0xb038('0x145'),_0x112b57[_0xb038('0xb2')],_0x112b57[_0xb038('0x144')],_0xb038('0xb8'),_0x476326[_0xb038('0x28')],_0xb038('0xb9'),_0x476326['pTalking']);this['callProgressDetectingCustomer'](_0x112b57,_0x112b57['linkedid'],_0x112b57['cause']);}}};Preview[_0xb038('0x69')]['syncDialEnd']=function(_0xac48eb){if(this['actions'][_0xac48eb[_0xb038('0xf5')]]&&_0xac48eb[_0xb038('0xf5')]!==_0xac48eb[_0xb038('0x14c')]){this[_0xb038('0x146')](_0xac48eb,_0xac48eb[_0xb038('0xf5')],_0xac48eb['dialstatus']);}};Preview['prototype'][_0xb038('0x1b')]=function(_0x309450){if(this[_0xb038('0x13')][_0x309450['linkedid']]&&_0x309450[_0xb038('0xb2')]!==_0x309450[_0xb038('0xb7')]&&!this['actions'][_0x309450[_0xb038('0xb2')]][_0xb038('0x74')]){if(_0x309450['cause']==='1'){this[_0xb038('0x146')](_0x309450,_0x309450[_0xb038('0xb2')],_0x309450[_0xb038('0x144')]);}}};Preview[_0xb038('0x69')][_0xb038('0x14d')]=function(_0x4eb901,_0x36006e,_0x2a87cb){if(this['actions'][_0x4eb901]){if(_[_0xb038('0x6f')](this['actions'][_0x4eb901]['variables'])){this[_0xb038('0x13')][_0x4eb901][_0xb038('0x14e')]={};}this[_0xb038('0x13')][_0x4eb901][_0xb038('0x14e')][_0x36006e]=_0x2a87cb;}};Preview[_0xb038('0x69')][_0xb038('0x14f')]=function(_0x22a651){try{if(!_[_0xb038('0x6f')](_0x22a651)){if(ut[_0xb038('0x150')](_[_0xb038('0x151')](_0x22a651[_0xb038('0x152')])[0x0])){this[_0xb038('0x14d')](_0x22a651[_0xb038('0xb7')],_[_0xb038('0x151')](_0x22a651[_0xb038('0x152')])[0x0],_0x22a651['value']);}}}catch(_0x4c75cb){logger['error'](_0xb038('0x153'),util[_0xb038('0x154')](_0x4c75cb,{'showHidden':![],'depth':null}));}};Preview[_0xb038('0x69')][_0xb038('0x22')]=function(_0x444219){if(_0x444219){if(this[_0xb038('0x13')][_0x444219[_0xb038('0x155')]]){this[_0xb038('0x13')][_0x444219[_0xb038('0x155')]][_0xb038('0x14a')]=!![];}}};Preview['prototype'][_0xb038('0x156')]=function(_0x44be70){if(_0x44be70){if(this[_0xb038('0x13')][_0x44be70[_0xb038('0x157')]]){this['actions'][_0x44be70[_0xb038('0x157')]][_0xb038('0x14a')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 01745bc..50e3cc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb772=['unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb772,0x10a));var _0x2b77=function(_0x156269,_0x278246){_0x156269=_0x156269-0x0;var _0x8213a6=_0xb772[_0x156269];return _0x8213a6;};'use strict';var util=require('util');var BPromise=require(_0x2b77('0x0'));var logger=require(_0x2b77('0x1'))(_0x2b77('0x2'));var _=require(_0x2b77('0x3'));var cmHopper=require(_0x2b77('0x4'));var cmHopperFinal=require(_0x2b77('0x5'));var cmHopperHistory=require(_0x2b77('0x6'));var cmHopperBlack=require(_0x2b77('0x7'));var voiceQueueRt=require(_0x2b77('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x2b77('0x9'));function loggerCatch(_0x25d0fe){return function(_0xdf976a){logger['error'](_0x25d0fe,util[_0x2b77('0xa')](_0xdf976a,{'showHidden':![],'depth':null}));};}function create(_0x53971e){return BPromise[_0x2b77('0xb')]()[_0x2b77('0xc')](cmHopperHistory[_0x2b77('0xd')](_0x53971e))[_0x2b77('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x1f3834){return BPromise['resolve']()[_0x2b77('0xc')](agentReportPreview['createHistory'](_0x1f3834))[_0x2b77('0xe')](loggerCatch(_0x2b77('0xf')));}function moveContact(_0x580388){return BPromise[_0x2b77('0xb')]()[_0x2b77('0xc')](cmHopper[_0x2b77('0x10')](_0x580388,!![]))[_0x2b77('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x2b77('0x11')]=function(_0x4d450a){return BPromise['resolve']()[_0x2b77('0xc')](cmHopperBlack['checkIsBlackList'](_0x4d450a))[_0x2b77('0xe')](loggerCatch(_0x2b77('0x12')));};exports['getContactPreview']=function(_0x250175){return BPromise[_0x2b77('0xb')]()['then'](cmHopper[_0x2b77('0x13')](_0x250175))[_0x2b77('0xe')](loggerCatch(_0x2b77('0x14')));};exports[_0x2b77('0xd')]=function(_0x109b36,_0x28f4f0){create(_0x109b36)[_0x2b77('0xe')](loggerCatch(_0x28f4f0));moveContact(_0x109b36)['catch'](loggerCatch(_0x28f4f0));};exports[_0x2b77('0x15')]=function(_0xfd64c8,_0x57c2f3){createAgent(_0xfd64c8)['catch'](loggerCatch(_0x57c2f3));};exports['createCustomerHistory']=function(_0x14e940,_0x53853b){create(_0x14e940)[_0x2b77('0xe')](loggerCatch(_0x53853b));};exports[_0x2b77('0x16')]=function(_0x5e3851,_0x5758bd){moveContact(_0x5e3851)[_0x2b77('0xe')](loggerCatch(_0x5758bd));};exports['rescheduleContact']=function(_0x5c0ab4,_0x337dac,_0x18f801){if(_0x337dac){_0x5c0ab4[_0x2b77('0x17')]=null;}if(_0x18f801){_0x5c0ab4[_0x2b77('0x18')]=![];}return BPromise['resolve']()[_0x2b77('0xc')](cmHopper[_0x2b77('0x19')](_0x5c0ab4))['catch'](loggerCatch(_0x2b77('0x1a')));};exports[_0x2b77('0x1b')]=function(_0x3a7344){return BPromise[_0x2b77('0xb')]()[_0x2b77('0xc')](cmHopper[_0x2b77('0x1b')](_0x3a7344))[_0x2b77('0xe')](loggerCatch(_0x2b77('0x1c')));};exports[_0x2b77('0x1d')]=function(_0x5715fd){return BPromise[_0x2b77('0xb')]()[_0x2b77('0xc')](cmHopper[_0x2b77('0x1d')]({'UserId':null},_0x5715fd,0x1))[_0x2b77('0xe')](loggerCatch(_0x2b77('0x1e')));};exports['disableContact']=function(_0xf2d0c7){return BPromise[_0x2b77('0xb')]()[_0x2b77('0xc')](cmHopper[_0x2b77('0x1d')]({'active':![]},_0xf2d0c7,0x1))['catch'](loggerCatch(_0x2b77('0x1f')));};exports[_0x2b77('0x20')]=function(_0x1150dd){var _0x3f64bb={};_0x3f64bb[_0x2b77('0x21')]=_0x1150dd[_0x2b77('0x21')];_0x3f64bb[_0x2b77('0x22')]=_0x1150dd['uniqueid'];_0x3f64bb[_0x2b77('0x23')]=_0x1150dd[_0x2b77('0x23')];_0x3f64bb[_0x2b77('0x24')]=_0x1150dd[_0x2b77('0x24')];_0x3f64bb[_0x2b77('0x25')]=_0x1150dd[_0x2b77('0x25')];_0x3f64bb[_0x2b77('0x26')]=_0x1150dd[_0x2b77('0x27')];_0x3f64bb[_0x2b77('0x28')]=_0x1150dd[_0x2b77('0x27')];_0x3f64bb[_0x2b77('0x29')]=0x1;_0x3f64bb[_0x2b77('0x2a')]=_0x1150dd[_0x2b77('0x2b')];_0x3f64bb[_0x2b77('0x2c')]=_0x1150dd['membername'];_0x3f64bb[_0x2b77('0x2d')]=_0x2b77('0x2e');_0x3f64bb[_0x2b77('0x2f')]=_0x2b77('0x30');_0x3f64bb[_0x2b77('0x31')]=0x0;_0x3f64bb[_0x2b77('0x32')]=0x1;_0x3f64bb[_0x2b77('0x33')]=_0x1150dd[_0x2b77('0x34')];_0x3f64bb[_0x2b77('0x35')]='COMPLETED';return BPromise['resolve']()[_0x2b77('0xc')](voiceQueueReport[_0x2b77('0x36')](_0x3f64bb))[_0x2b77('0xe')](loggerCatch(_0x2b77('0x37')));};exports[_0x2b77('0x38')]=function(_0x2ca0c7,_0x1077fa){return BPromise[_0x2b77('0xb')]()['then'](cmHopper['getContactRecallMe'](_0x2ca0c7,_0x1077fa))[_0x2b77('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x2b77('0x39')]=function(_0x709ed){return BPromise['resolve']()[_0x2b77('0xc')](cmHopper[_0x2b77('0x19')](_0x709ed,!![],!![]))[_0x2b77('0xe')](loggerCatch(_0x2b77('0x3a')));};
\ No newline at end of file
+var _0x9da2=['crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20'];(function(_0x2c21f0,_0x1928dc){var _0x19d325=function(_0x4d7e15){while(--_0x4d7e15){_0x2c21f0['push'](_0x2c21f0['shift']());}};_0x19d325(++_0x1928dc);}(_0x9da2,0x1a5));var _0x29da=function(_0x5ed591,_0x5c558b){_0x5ed591=_0x5ed591-0x0;var _0xf5f726=_0x9da2[_0x5ed591];return _0xf5f726;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x29da('0x0'))('preview');var _=require(_0x29da('0x1'));var cmHopper=require(_0x29da('0x2'));var cmHopperFinal=require(_0x29da('0x3'));var cmHopperHistory=require(_0x29da('0x4'));var cmHopperBlack=require(_0x29da('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x29da('0x6'));var voiceQueueReport=require(_0x29da('0x7'));function loggerCatch(_0x4638d3){return function(_0x389eab){logger[_0x29da('0x8')](_0x4638d3,util[_0x29da('0x9')](_0x389eab,{'showHidden':![],'depth':null}));};}function create(_0x48df8e){return BPromise[_0x29da('0xa')]()[_0x29da('0xb')](cmHopperHistory['createHistory'](_0x48df8e))[_0x29da('0xc')](loggerCatch(_0x29da('0xd')));}function createAgent(_0xd3f63e){return BPromise[_0x29da('0xa')]()['then'](agentReportPreview[_0x29da('0xe')](_0xd3f63e))[_0x29da('0xc')](loggerCatch(_0x29da('0xd')));}function moveContact(_0x8dc56d){return BPromise[_0x29da('0xa')]()['then'](cmHopper[_0x29da('0xf')](_0x8dc56d,!![]))[_0x29da('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x29da('0x10')]=function(_0x2358c1){return BPromise[_0x29da('0xa')]()[_0x29da('0xb')](cmHopperBlack[_0x29da('0x10')](_0x2358c1))[_0x29da('0xc')](loggerCatch(_0x29da('0x11')));};exports[_0x29da('0x12')]=function(_0xd7e915){return BPromise[_0x29da('0xa')]()[_0x29da('0xb')](cmHopper[_0x29da('0x12')](_0xd7e915))[_0x29da('0xc')](loggerCatch(_0x29da('0x13')));};exports[_0x29da('0xe')]=function(_0xe4d865,_0xa5e343){create(_0xe4d865)['catch'](loggerCatch(_0xa5e343));moveContact(_0xe4d865)[_0x29da('0xc')](loggerCatch(_0xa5e343));};exports[_0x29da('0x14')]=function(_0x379236,_0x58e7c4){createAgent(_0x379236)[_0x29da('0xc')](loggerCatch(_0x58e7c4));};exports[_0x29da('0x15')]=function(_0x2c9e46,_0x3beb46){create(_0x2c9e46)['catch'](loggerCatch(_0x3beb46));};exports[_0x29da('0x16')]=function(_0x567863,_0x5ecec5){moveContact(_0x567863)[_0x29da('0xc')](loggerCatch(_0x5ecec5));};exports['rescheduleContact']=function(_0x39c80a,_0x55ac49,_0x2a44b3){if(_0x55ac49){_0x39c80a['UserId']=null;}if(_0x2a44b3){_0x39c80a['active']=![];}return BPromise['resolve']()['then'](cmHopper[_0x29da('0x17')](_0x39c80a))[_0x29da('0xc')](loggerCatch(_0x29da('0x18')));};exports[_0x29da('0x19')]=function(_0x5bdfeb){return BPromise[_0x29da('0xa')]()['then'](cmHopper[_0x29da('0x19')](_0x5bdfeb))[_0x29da('0xc')](loggerCatch(_0x29da('0x1a')));};exports['unlockContact']=function(_0x35a58f){return BPromise[_0x29da('0xa')]()[_0x29da('0xb')](cmHopper[_0x29da('0x1b')]({'UserId':null},_0x35a58f,0x1))[_0x29da('0xc')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x2aad9e){return BPromise['resolve']()[_0x29da('0xb')](cmHopper[_0x29da('0x1b')]({'active':![]},_0x2aad9e,0x1))[_0x29da('0xc')](loggerCatch(_0x29da('0x1c')));};exports[_0x29da('0x1d')]=function(_0x157992){var _0x29e62a={};_0x29e62a[_0x29da('0x1e')]=_0x157992[_0x29da('0x1e')];_0x29e62a[_0x29da('0x1f')]=_0x157992[_0x29da('0x1f')];_0x29e62a['calleridnum']=_0x157992[_0x29da('0x20')];_0x29e62a[_0x29da('0x21')]=_0x157992[_0x29da('0x21')];_0x29e62a['queue']=_0x157992['queue'];_0x29e62a['queuecallerjoinAt']=_0x157992['answertime'];_0x29e62a[_0x29da('0x22')]=_0x157992['answertime'];_0x29e62a[_0x29da('0x23')]=0x1;_0x29e62a[_0x29da('0x24')]=_0x157992[_0x29da('0x25')];_0x29e62a[_0x29da('0x26')]=_0x157992[_0x29da('0x27')];_0x29e62a['context']=_0x29da('0x28');_0x29e62a[_0x29da('0x29')]=_0x29da('0x2a');_0x29e62a[_0x29da('0x2b')]=0x0;_0x29e62a['assigned']=0x1;_0x29e62a[_0x29da('0x2c')]=_0x157992[_0x29da('0x27')];_0x29e62a[_0x29da('0x2d')]=_0x29da('0x2e');return BPromise[_0x29da('0xa')]()['then'](voiceQueueReport['create'](_0x29e62a))[_0x29da('0xc')](loggerCatch(_0x29da('0x2f')));};exports[_0x29da('0x30')]=function(_0x4a0399,_0x434c9f){return BPromise[_0x29da('0xa')]()[_0x29da('0xb')](cmHopper[_0x29da('0x30')](_0x4a0399,_0x434c9f))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x4f1576){return BPromise[_0x29da('0xa')]()[_0x29da('0xb')](cmHopper[_0x29da('0x17')](_0x4f1576,!![],!![]))['catch'](loggerCatch(_0x29da('0x31')));};
\ No newline at end of file
index 4f5e4c4..69d7bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e60=['[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','queue','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','type','dialAnswer','scheduledat','countglobal','callbackuniqueid','callbackat','UserId','sipcallid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','monitor_format','Contact','createdAt','updatedAt','XMD-','toLowerVariables','hasOwnProperty','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','logLookAgent','membername','ringtime','answertime','Failure','variablesAction','RECALL','calleridname','uniqueid','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','scheduledAt','active','add','minutes','ListId','pTalking'];(function(_0x7a5f38,_0x18d8d9){var _0x2e85e7=function(_0x5d1837){while(--_0x5d1837){_0x7a5f38['push'](_0x7a5f38['shift']());}};_0x2e85e7(++_0x18d8d9);}(_0x7e60,0x1c9));var _0x07e6=function(_0x1aedf7,_0xa8ff7){_0x1aedf7=_0x1aedf7-0x0;var _0x727697=_0x7e60[_0x1aedf7];return _0x727697;};'use strict';var util=require(_0x07e6('0x0'));var _=require(_0x07e6('0x1'));var moment=require(_0x07e6('0x2'));var logger=require(_0x07e6('0x3'))('preview');var ipAgi=process[_0x07e6('0x4')][_0x07e6('0x5')]||_0x07e6('0x6');function getSeconds(_0x2a43dc,_0xcb441a){var _0x259680=moment(_0x2a43dc)[_0x07e6('0x7')](0x0);var _0x250438=moment(_0xcb441a)[_0x07e6('0x7')](0x0);return _0x259680[_0x07e6('0x8')](_0x250438,_0x07e6('0x9'));}exports['loggerCatch']=function(_0x60dc91){return function(_0x4f781b){logger[_0x07e6('0xa')](_0x60dc91,util[_0x07e6('0xb')](_0x4f781b,{'showHidden':![],'depth':null}));};};exports[_0x07e6('0xc')]=function(_0x244787,_0x27ad2c){logger['info'](_0x244787,util['inspect'](_0x27ad2c,{'showHidden':![],'depth':null}));};exports[_0x07e6('0xd')]=function(_0x2320c7,_0x13d593){logger['error'](_0x2320c7,util['inspect'](_0x13d593,{'showHidden':![],'depth':null}));};exports[_0x07e6('0xe')]=function(_0x3fc1fe){return function(_0x25632e){logger[_0x07e6('0xf')](_0x3fc1fe,util[_0x07e6('0xb')](_0x25632e,{'showHidden':![],'depth':null}));};};exports[_0x07e6('0x10')]=function(_0x1c4b7c,_0x2daeaa,_0xc91b9c){return{'message':_0x1c4b7c,'unlock':_0x2daeaa,'active':_0xc91b9c};};exports[_0x07e6('0x11')]=function(_0x49aada,_0x12389e,_0x1570ec){if(!_[_0x07e6('0x12')](_0x1570ec)&&'string'===typeof _0x1570ec&&!_[_0x07e6('0x13')](_0x1570ec)){if(!_[_0x07e6('0x12')](_0x12389e)&&_0x07e6('0x14')===typeof _0x12389e&&!_[_0x07e6('0x13')](_0x12389e)){return util[_0x07e6('0x15')](_0x07e6('0x16'),_0x12389e,_0x1570ec);}return util[_0x07e6('0x15')](_0x07e6('0x16'),_0x1570ec,_0x1570ec);}if(!_[_0x07e6('0x12')](_0x49aada)&&_0x07e6('0x14')===typeof _0x49aada&&!_[_0x07e6('0x13')](_0x49aada)){return _0x49aada;}return'\x22\x22\x20<>';};exports[_0x07e6('0x17')]=function(_0x34e92e){if(_[_0x07e6('0x18')](_0x34e92e)){return![];}return _0x34e92e;};exports[_0x07e6('0x19')]=function(_0x3a29e7,_0x315ab7,_0x298437,_0xd6ec50,_0x42e803,_0x423455){var _0x32672a={'XMD-QUEUE':_0x315ab7[_0x07e6('0x1a')]?_0x315ab7[_0x07e6('0x1a')][_0x07e6('0x1b')]:'','XMD-CALLERID':_0xd6ec50,'XMD-CALLERID-PREVIEW':_0x423455?util[_0x07e6('0x15')](_0x07e6('0x16'),_0x423455['calleridname'],_0x423455[_0x07e6('0x1c')]):_0xd6ec50,'XMD-DIALID':_0x42e803,'XMD-CONTACTID':_0x315ab7[_0x07e6('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xd6ec50,'XMD-VOICEQUEUEID':_0x315ab7[_0x07e6('0x1e')],'XMD-DIALCHANNEL':_0x298437,'XMD-DIALTIMEOUT':_0x3a29e7[_0x07e6('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x07e6('0x15')](_0x07e6('0x20'),_0x3a29e7['dialQueueProject2']?'g':'',_[_0x07e6('0x13')](_0x3a29e7['monitor_format'])?'':_0x07e6('0x21')),'XMD-DIALURL':_0x3a29e7[_0x07e6('0x22')]||'','XMD-AGI':_0x3a29e7[_0x07e6('0x23')]?util[_0x07e6('0x15')](_0x07e6('0x24'),ipAgi,_0x3a29e7[_0x07e6('0x23')]):_0x07e6('0x25'),'XMD-AGIAFTER':_0x3a29e7[_0x07e6('0x26')]?util[_0x07e6('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3a29e7[_0x07e6('0x26')]):_0x07e6('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x423455?_0x423455[_0x07e6('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x423455?_0x423455[_0x07e6('0x28')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x07e6('0x13')](_0x3a29e7[_0x07e6('0x29')])){_0x32672a[util[_0x07e6('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3a29e7[_0x07e6('0x29')];_0x32672a[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x42e803;}if(_0x315ab7&&_0x315ab7[_0x07e6('0x2a')]){for(var _0x270734 in _0x315ab7[_0x07e6('0x2a')]){if(_0x315ab7[_0x07e6('0x2a')]['hasOwnProperty'](_0x270734)){if(!_[_0x07e6('0x18')](_0x315ab7[_0x07e6('0x2a')][_0x270734])&&_0x270734!=='id'&&_0x270734!=='tags'&&_0x270734!==_0x07e6('0x2b')&&_0x270734!==_0x07e6('0x2c')){_0x32672a[util[_0x07e6('0x15')]('%s%s',_0x07e6('0x2d'),_['toUpper'](_0x270734))]=_0x315ab7[_0x07e6('0x2a')][_0x270734];}}}}return _0x32672a;};exports[_0x07e6('0x2e')]=function(_0x1cc480){var _0x2a5822={};for(var _0x298993 in _0x1cc480){if(_0x1cc480[_0x07e6('0x2f')](_0x298993)){_0x2a5822[util[_0x07e6('0x15')]('%s',_['toLower'](_0x298993))]=_0x1cc480[_0x298993];}}return{'variables':_0x2a5822};};exports[_0x07e6('0x30')]=function(_0x126734,_0x10b55a){if(!_[_0x07e6('0x18')](_0x126734)){if(_0x126734['hasOwnProperty']('originated')){if(_0x126734['originated']>0x0){_0x126734[_0x07e6('0x31')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x10b55a);}}}else{logger[_0x07e6('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x10b55a);}};exports[_0x07e6('0x32')]=function(_0x36d33a){var _0x34a1c6=moment()[_0x07e6('0x15')](_0x07e6('0x33'));_0x36d33a[_0x07e6('0x34')]=0xd;_0x36d33a[_0x07e6('0x35')]=_0x07e6('0x36');_0x36d33a[_0x07e6('0x37')]=_0x34a1c6;_0x36d33a['responsetime']=_0x34a1c6;_0x36d33a[_0x07e6('0x38')]=_0x34a1c6;};exports[_0x07e6('0x39')]=function(_0x5d0c60,_0x590db2,_0x1de5c6){var _0x252cb5=moment()[_0x07e6('0x15')](_0x07e6('0x33'));_0x5d0c60[_0x07e6('0x34')]=_0x590db2;_0x5d0c60[_0x07e6('0x35')]=_0x1de5c6;_0x5d0c60[_0x07e6('0x3a')]=_0x252cb5;_0x5d0c60['ringtime']=getSeconds(_0x5d0c60['responsetime'],_0x5d0c60[_0x07e6('0x37')]);};exports[_0x07e6('0x3b')]=function(_0x316c9e,_0x310536,_0x43cd29){_0x316c9e[_0x07e6('0x3c')]=_0x310536;_0x316c9e['UserId']=_0x43cd29;};exports['logCustomer']=function(_0x4c8c20,_0x8e3c39,_0x3a7166){var _0x1c6e49=moment()[_0x07e6('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c8c20[_0x07e6('0x34')]=_0x8e3c39;_0x4c8c20['statedesc']=_0x3a7166;_0x4c8c20[_0x07e6('0x3a')]=_0x4c8c20[_0x07e6('0x3a')]?_0x4c8c20[_0x07e6('0x3a')]:_0x1c6e49;_0x4c8c20['endtime']=_0x4c8c20[_0x07e6('0x38')]?_0x4c8c20[_0x07e6('0x38')]:_0x1c6e49;_0x4c8c20[_0x07e6('0x3d')]=getSeconds(_0x4c8c20[_0x07e6('0x3a')]||0x0,_0x4c8c20[_0x07e6('0x37')]||0x0);_0x4c8c20['talktime']=_0x4c8c20[_0x07e6('0x3e')]?getSeconds(_0x4c8c20[_0x07e6('0x38')],_0x4c8c20['answertime']):0x0;};exports['isFailure']=function(_0x43ae1b){return _0x43ae1b===_0x07e6('0x3f');};exports[_0x07e6('0x40')]=function(_0xd95a3d,_0x633df4,_0x5641ed,_0x508fe4,_0x18a425){var _0x5f316b=_0x508fe4?_0x07e6('0x41'):_0xd95a3d[_0x07e6('0x42')];_0x5f316b=_0x18a425?'BOOKED':_0x5f316b;return{'actionid':_0xd95a3d[_0x07e6('0x43')],'action':'originate','channel':_0xd95a3d[_0x07e6('0x44')],'callerid':util[_0x07e6('0x15')](_0x07e6('0x16'),_0x5f316b,_0xd95a3d[_0x07e6('0x1c')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x5641ed,'timeout':(_0x633df4[_0x07e6('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd95a3d[_0x07e6('0x43')]};};exports[_0x07e6('0x46')]=function(_0x1787e9){return _0x1787e9[_0x07e6('0x47')]+_0x1787e9[_0x07e6('0x48')]+_0x1787e9[_0x07e6('0x49')]+_0x1787e9[_0x07e6('0x4a')]+_0x1787e9[_0x07e6('0x4b')];};exports[_0x07e6('0x4c')]=function(_0x3111ac){var _0x196d47=_['clone'](_0x3111ac);_0x196d47[_0x07e6('0x34')]=0xf;_0x196d47['statedesc']='Global';return _0x196d47;};exports[_0x07e6('0x4d')]=function(_0x470dd2,_0x509a2e,_0x5e86a6){var _0x496819={};_0x496819[_0x509a2e]=_0x470dd2[_0x509a2e];_0x496819[_0x07e6('0x4e')]=![];_0x496819['scheduledat']=moment()[_0x07e6('0x4f')](_0x5e86a6,_0x07e6('0x50'))[_0x07e6('0x15')](_0x07e6('0x33'));_0x496819['ContactId']=_0x470dd2[_0x07e6('0x1d')];_0x496819['ListId']=_0x470dd2[_0x07e6('0x51')];_0x496819[_0x07e6('0x1e')]=_0x470dd2[_0x07e6('0x1e')]||undefined;return _0x496819;};exports['decrementTalkink']=function(_0x1ac705,_0x172d7c){if(!_[_0x07e6('0x18')](_0x1ac705)){if(_0x1ac705[_0x07e6('0x52')]>0x0){_0x1ac705[_0x07e6('0x52')]-=0x1;}else{logger[_0x07e6('0xa')](_0x172d7c,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x07e6('0xa')](_0x172d7c,_0x07e6('0x53'));}};exports['IsNotLoggedIn']=function(_0x1db17f){if(_0x1db17f<=0x0){return!![];}return![];};exports[_0x07e6('0x54')]=function(_0x4e5dde,_0x5af098,_0x11eed6){_0x4e5dde['lastevent']=_0x5af098;_0x4e5dde['name']=_0x4e5dde[_0x07e6('0x55')];_0x4e5dde['interface']=_0x4e5dde[_0x07e6('0x44')];_0x4e5dde[_0x07e6('0x56')]=_0x07e6('0x57');if(_0x11eed6){_0x4e5dde[_0x07e6('0x58')]=_0x11eed6[_0x07e6('0x58')];}return _0x4e5dde;};exports[_0x07e6('0x59')]=function(_0x3f297a){var _0x2b835e={};_0x2b835e[_0x07e6('0x55')]=_0x3f297a[_0x07e6('0x55')];_0x2b835e['interface']=_0x3f297a[_0x07e6('0x44')];_0x2b835e['uniqueid']=_0x3f297a[_0x07e6('0x43')];return _0x2b835e;};exports[_0x07e6('0x5a')]=function(_0x3416c6){var _0x14ad8b=[];for(var _0x24eb6f in _0x3416c6){if(_0x3416c6[_0x07e6('0x2f')](_0x24eb6f)){if(!_['isNil'](_0x3416c6[_0x24eb6f])&&_0x3416c6[_0x24eb6f]['state']===_0x07e6('0x5b')&&_0x3416c6[_0x24eb6f][_0x07e6('0x5c')]===_0x07e6('0x5d')){_0x14ad8b[_0x07e6('0x5e')](_0x3416c6[_0x24eb6f]['id']);}}}return _0x14ad8b;};exports['getDiff']=function(_0x1a61b5){var _0xbd5966=moment()['milliseconds'](0x0);var _0x321608=moment(_0x1a61b5)[_0x07e6('0x7')](0x0);return _0xbd5966[_0x07e6('0x8')](_0x321608,_0x07e6('0x9'));};exports[_0x07e6('0x5f')]=function(_0x312ce8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x312ce8[_0x07e6('0x1d')],'ListId':_0x312ce8['ListId'],'VoiceQueueId':_0x312ce8[_0x07e6('0x1e')]||undefined,'CampaignId':_0x312ce8[_0x07e6('0x60')]||undefined};};exports[_0x07e6('0x61')]=function(_0x4bf8da){if(_0x4bf8da===_0x07e6('0x43')||_0x4bf8da===_0x07e6('0x62')||_0x4bf8da==='queue'||_0x4bf8da===_0x07e6('0x63')||_0x4bf8da==='campaigntype'||_0x4bf8da===_0x07e6('0x64')||_0x4bf8da==='membername'||_0x4bf8da==='channelAgent'||_0x4bf8da==='calleridname'||_0x4bf8da===_0x07e6('0x4e')||_0x4bf8da===_0x07e6('0x1c')||_0x4bf8da===_0x07e6('0x65')||_0x4bf8da===_0x07e6('0x47')||_0x4bf8da==='countcongestionretry'||_0x4bf8da===_0x07e6('0x49')||_0x4bf8da===_0x07e6('0x66')||_0x4bf8da==='callback'||_0x4bf8da===_0x07e6('0x67')||_0x4bf8da===_0x07e6('0x68')||_0x4bf8da==='recallme'||_0x4bf8da==='ContactId'||_0x4bf8da===_0x07e6('0x51')||_0x4bf8da===_0x07e6('0x69')||_0x4bf8da===_0x07e6('0x1e')||_0x4bf8da===_0x07e6('0x6a')||_0x4bf8da==='xmd-voicequeueid'||_0x4bf8da===_0x07e6('0x6b')||_0x4bf8da==='xmd-phone'||_0x4bf8da===_0x07e6('0x6c')||_0x4bf8da===_0x07e6('0x6d')||_0x4bf8da===_0x07e6('0x6e')||_0x4bf8da===_0x07e6('0x6f')||_0x4bf8da===_0x07e6('0x70')||_0x4bf8da===_0x07e6('0x71')||_0x4bf8da===_0x07e6('0x72')||_0x4bf8da===_0x07e6('0x73')||_0x4bf8da===_0x07e6('0x74')||_0x4bf8da===_0x07e6('0x75')||_0x4bf8da==='xmd-agi'||_0x4bf8da==='rtpaudioqos'||_0x4bf8da===_0x07e6('0x76')||_0x4bf8da===_0x07e6('0x77')||_0x4bf8da===_0x07e6('0x78')||_0x4bf8da===_0x07e6('0x79')||_0x4bf8da===_0x07e6('0x7a')||_0x4bf8da===_0x07e6('0x7b')||_0x4bf8da===_0x07e6('0x7c')||_0x4bf8da===_0x07e6('0x7d')||_0x4bf8da==='rtpaudioqosbridged'||_0x4bf8da===_0x07e6('0x77')||_0x4bf8da==='rtpaudioqosjitterbridged'||_0x4bf8da===_0x07e6('0x79')||_0x4bf8da==='rtpaudioqoslossbridged'||_0x4bf8da===_0x07e6('0x7b')||_0x4bf8da===_0x07e6('0x7c')||_0x4bf8da===_0x07e6('0x7e')||_0x4bf8da==='bridgepvtcallid'||_0x4bf8da==='state'||_0x4bf8da===_0x07e6('0x35')){return![];}return!![];};exports[_0x07e6('0x7f')]=function(_0x45950c,_0x5f114e){var _0x4ca324,_0x376a95,_0x5621ab;if(_0x5f114e<=0x0){_0x5f114e=0x1;}_0x4ca324=new RegExp(_0x07e6('0x80')+_0x5f114e+'}$');_0x376a95=Math['pow'](0xa,_0x5f114e-0x1);_0x5621ab=Math[_0x07e6('0x81')](0xa,_0x5f114e)-0x1;return util['format']('%s',_[_0x07e6('0x82')](_0x45950c,_0x4ca324,_[_0x07e6('0x83')](_0x376a95,_0x5621ab)));};exports[_0x07e6('0x84')]=function(_0x2d113f){var _0x19a85e=_0x2d113f[_0x07e6('0x85')](/"(.*?)"/);return _0x19a85e?_0x19a85e[0x1]:_0x2d113f;};exports[_0x07e6('0x86')]=function(_0x151114){var _0x1effb2=_0x151114[_0x07e6('0x85')](/<(.*?)>/);return _0x1effb2?_0x1effb2[0x1]:_0x151114;};
\ No newline at end of file
+var _0x4c1e=['idContact','type','dialAnswer','scheduledat','countglobal','callback','callbackat','recallme','UserId','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','extractCalleridNumber','match','util','lodash','../../../../config/logger','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','loggerError','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','logLookAgent','membername','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','mandatoryDisposition','buildAcw','status','reachable','getDiff','createBody','CampaignId','filterKey'];(function(_0x55e8dc,_0x4e888b){var _0x2dc549=function(_0x5a5390){while(--_0x5a5390){_0x55e8dc['push'](_0x55e8dc['shift']());}};_0x2dc549(++_0x4e888b);}(_0x4c1e,0x1c1));var _0xe4c1=function(_0x11ad92,_0x583403){_0x11ad92=_0x11ad92-0x0;var _0x4e6c24=_0x4c1e[_0x11ad92];return _0x4e6c24;};'use strict';var util=require(_0xe4c1('0x0'));var _=require(_0xe4c1('0x1'));var moment=require('moment');var logger=require(_0xe4c1('0x2'))('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xe4c1('0x3');function getSeconds(_0x1f402b,_0x5e5a33){var _0xe79a5f=moment(_0x1f402b)[_0xe4c1('0x4')](0x0);var _0x35862a=moment(_0x5e5a33)[_0xe4c1('0x4')](0x0);return _0xe79a5f[_0xe4c1('0x5')](_0x35862a,_0xe4c1('0x6'));}exports[_0xe4c1('0x7')]=function(_0x3ebbf7){return function(_0x159273){logger[_0xe4c1('0x8')](_0x3ebbf7,util[_0xe4c1('0x9')](_0x159273,{'showHidden':![],'depth':null}));};};exports[_0xe4c1('0xa')]=function(_0x5917c7,_0x1de4c7){logger['info'](_0x5917c7,util[_0xe4c1('0x9')](_0x1de4c7,{'showHidden':![],'depth':null}));};exports[_0xe4c1('0xb')]=function(_0x423571,_0x81eb0f){logger['error'](_0x423571,util[_0xe4c1('0x9')](_0x81eb0f,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x199a19){return function(_0x41958d){logger[_0xe4c1('0xc')](_0x199a19,util['inspect'](_0x41958d,{'showHidden':![],'depth':null}));};};exports[_0xe4c1('0xd')]=function(_0x56f349,_0x20ebff,_0x53772b){return{'message':_0x56f349,'unlock':_0x20ebff,'active':_0x53772b};};exports[_0xe4c1('0xe')]=function(_0x47f88c,_0x52d080,_0xad4201){if(!_[_0xe4c1('0xf')](_0xad4201)&&_0xe4c1('0x10')===typeof _0xad4201&&!_[_0xe4c1('0x11')](_0xad4201)){if(!_[_0xe4c1('0xf')](_0x52d080)&&'string'===typeof _0x52d080&&!_[_0xe4c1('0x11')](_0x52d080)){return util[_0xe4c1('0x12')](_0xe4c1('0x13'),_0x52d080,_0xad4201);}return util['format'](_0xe4c1('0x13'),_0xad4201,_0xad4201);}if(!_[_0xe4c1('0xf')](_0x47f88c)&&_0xe4c1('0x10')===typeof _0x47f88c&&!_[_0xe4c1('0x11')](_0x47f88c)){return _0x47f88c;}return _0xe4c1('0x14');};exports[_0xe4c1('0x15')]=function(_0x44f66c){if(_[_0xe4c1('0x16')](_0x44f66c)){return![];}return _0x44f66c;};exports[_0xe4c1('0x17')]=function(_0x2b4ab3,_0x4b92a5,_0x2f59ab,_0x4e7d8e,_0x30c112,_0x610d0b){var _0x239ed3={'XMD-QUEUE':_0x4b92a5['Queue']?_0x4b92a5[_0xe4c1('0x18')]['name']:'','XMD-CALLERID':_0x4e7d8e,'XMD-CALLERID-PREVIEW':_0x610d0b?util[_0xe4c1('0x12')](_0xe4c1('0x13'),_0x610d0b[_0xe4c1('0x19')],_0x610d0b[_0xe4c1('0x1a')]):_0x4e7d8e,'XMD-DIALID':_0x30c112,'XMD-CONTACTID':_0x4b92a5[_0xe4c1('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4e7d8e,'XMD-VOICEQUEUEID':_0x4b92a5[_0xe4c1('0x1c')],'XMD-DIALCHANNEL':_0x2f59ab,'XMD-DIALTIMEOUT':_0x2b4ab3[_0xe4c1('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xe4c1('0x12')](_0xe4c1('0x1e'),_0x2b4ab3[_0xe4c1('0x1f')]?'g':'',_[_0xe4c1('0x11')](_0x2b4ab3[_0xe4c1('0x20')])?'':_0xe4c1('0x21')),'XMD-DIALURL':_0x2b4ab3['dialPreviewUrl']||'','XMD-AGI':_0x2b4ab3[_0xe4c1('0x22')]?util[_0xe4c1('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2b4ab3[_0xe4c1('0x22')]):_0xe4c1('0x23'),'XMD-AGIAFTER':_0x2b4ab3[_0xe4c1('0x1f')]?util[_0xe4c1('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2b4ab3[_0xe4c1('0x1f')]):_0xe4c1('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x610d0b?_0x610d0b['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x610d0b?_0x610d0b[_0xe4c1('0x24')]:'','XMD-DESTINATION':_0xe4c1('0x25'),'SIPADDHEADER':_0xe4c1('0x26')};if(!_['isEmpty'](_0x2b4ab3[_0xe4c1('0x20')])){_0x239ed3[util[_0xe4c1('0x12')]('%s',_0xe4c1('0x27'))]=_0x2b4ab3['monitor_format'];_0x239ed3[util[_0xe4c1('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x30c112;}if(_0x4b92a5&&_0x4b92a5[_0xe4c1('0x28')]){for(var _0x5240f2 in _0x4b92a5[_0xe4c1('0x28')]){if(_0x4b92a5[_0xe4c1('0x28')][_0xe4c1('0x29')](_0x5240f2)){if(!_['isNil'](_0x4b92a5['Contact'][_0x5240f2])&&_0x5240f2!=='id'&&_0x5240f2!=='tags'&&_0x5240f2!==_0xe4c1('0x2a')&&_0x5240f2!==_0xe4c1('0x2b')){_0x239ed3[util['format'](_0xe4c1('0x2c'),'XMD-',_[_0xe4c1('0x2d')](_0x5240f2))]=_0x4b92a5['Contact'][_0x5240f2];}}}}return _0x239ed3;};exports[_0xe4c1('0x2e')]=function(_0x3f3d9d){var _0x3f7248={};for(var _0x4ef233 in _0x3f3d9d){if(_0x3f3d9d[_0xe4c1('0x29')](_0x4ef233)){_0x3f7248[util[_0xe4c1('0x12')]('%s',_[_0xe4c1('0x2f')](_0x4ef233))]=_0x3f3d9d[_0x4ef233];}}return{'variables':_0x3f7248};};exports[_0xe4c1('0x30')]=function(_0x2d1668,_0x50dfba){if(!_['isNil'](_0x2d1668)){if(_0x2d1668['hasOwnProperty'](_0xe4c1('0x31'))){if(_0x2d1668[_0xe4c1('0x31')]>0x0){_0x2d1668[_0xe4c1('0x31')]-=0x1;}else{logger[_0xe4c1('0x8')](_0xe4c1('0x32'),_0x50dfba);}}}else{logger['error'](_0xe4c1('0x33'),_0x50dfba);}};exports[_0xe4c1('0x34')]=function(_0x123acc){var _0x4a03eb=moment()[_0xe4c1('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x123acc[_0xe4c1('0x35')]=0xd;_0x123acc[_0xe4c1('0x36')]='Blacklist';_0x123acc[_0xe4c1('0x37')]=_0x4a03eb;_0x123acc[_0xe4c1('0x38')]=_0x4a03eb;_0x123acc[_0xe4c1('0x39')]=_0x4a03eb;};exports[_0xe4c1('0x3a')]=function(_0x4a46f2,_0x734e37,_0xb0aaf0){var _0x362318=moment()[_0xe4c1('0x12')](_0xe4c1('0x3b'));_0x4a46f2['state']=_0x734e37;_0x4a46f2['statedesc']=_0xb0aaf0;_0x4a46f2[_0xe4c1('0x38')]=_0x362318;_0x4a46f2['ringtime']=getSeconds(_0x4a46f2[_0xe4c1('0x38')],_0x4a46f2[_0xe4c1('0x37')]);};exports[_0xe4c1('0x3c')]=function(_0x544c29,_0x54c4c2,_0x544ca7){_0x544c29[_0xe4c1('0x3d')]=_0x54c4c2;_0x544c29['UserId']=_0x544ca7;};exports[_0xe4c1('0x3e')]=function(_0x45a302,_0x1caf00,_0x459a0a){var _0x5de30b=moment()[_0xe4c1('0x12')](_0xe4c1('0x3b'));_0x45a302[_0xe4c1('0x35')]=_0x1caf00;_0x45a302['statedesc']=_0x459a0a;_0x45a302['responsetime']=_0x45a302[_0xe4c1('0x38')]?_0x45a302['responsetime']:_0x5de30b;_0x45a302[_0xe4c1('0x39')]=_0x45a302['endtime']?_0x45a302[_0xe4c1('0x39')]:_0x5de30b;_0x45a302[_0xe4c1('0x3f')]=getSeconds(_0x45a302['responsetime']||0x0,_0x45a302[_0xe4c1('0x37')]||0x0);_0x45a302[_0xe4c1('0x40')]=_0x45a302[_0xe4c1('0x41')]?getSeconds(_0x45a302['endtime'],_0x45a302[_0xe4c1('0x41')]):0x0;};exports[_0xe4c1('0x42')]=function(_0x13f134){return _0x13f134===_0xe4c1('0x43');};exports[_0xe4c1('0x44')]=function(_0x549a42,_0x3ea21c,_0x1a9c5c,_0x335f1c,_0x4279f3){var _0x2433ca=_0x335f1c?_0xe4c1('0x45'):_0x549a42[_0xe4c1('0x19')];_0x2433ca=_0x4279f3?'BOOKED':_0x2433ca;return{'actionid':_0x549a42[_0xe4c1('0x46')],'action':_0xe4c1('0x47'),'channel':_0x549a42[_0xe4c1('0x48')],'callerid':util[_0xe4c1('0x12')](_0xe4c1('0x13'),_0x2433ca,_0x549a42[_0xe4c1('0x1a')]),'Exten':'xcally-motion-preview','Context':_0xe4c1('0x49'),'Priority':'1','variable':_0x1a9c5c,'timeout':(_0x3ea21c[_0xe4c1('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x549a42['uniqueid']};};exports[_0xe4c1('0x4b')]=function(_0x455383){return _0x455383[_0xe4c1('0x4c')]+_0x455383[_0xe4c1('0x4d')]+_0x455383[_0xe4c1('0x4e')]+_0x455383[_0xe4c1('0x4f')]+_0x455383[_0xe4c1('0x50')];};exports[_0xe4c1('0x51')]=function(_0x5674fb){var _0x35b65d=_[_0xe4c1('0x52')](_0x5674fb);_0x35b65d[_0xe4c1('0x35')]=0xf;_0x35b65d['statedesc']=_0xe4c1('0x53');return _0x35b65d;};exports[_0xe4c1('0x54')]=function(_0x3db2da,_0x20a9f9,_0x1302c2){var _0x2b09ad={};_0x2b09ad[_0x20a9f9]=_0x3db2da[_0x20a9f9];_0x2b09ad[_0xe4c1('0x55')]=![];_0x2b09ad['scheduledat']=moment()['add'](_0x1302c2,'minutes')[_0xe4c1('0x12')](_0xe4c1('0x3b'));_0x2b09ad['ContactId']=_0x3db2da[_0xe4c1('0x1b')];_0x2b09ad['ListId']=_0x3db2da[_0xe4c1('0x56')];_0x2b09ad[_0xe4c1('0x1c')]=_0x3db2da[_0xe4c1('0x1c')]||undefined;return _0x2b09ad;};exports[_0xe4c1('0x57')]=function(_0x44cf8d,_0x48b495){if(!_[_0xe4c1('0x16')](_0x44cf8d)){if(_0x44cf8d[_0xe4c1('0x58')]>0x0){_0x44cf8d['pTalking']-=0x1;}else{logger[_0xe4c1('0x8')](_0x48b495,_0xe4c1('0x59'));}}else{logger[_0xe4c1('0x8')](_0x48b495,_0xe4c1('0x5a'));}};exports[_0xe4c1('0x5b')]=function(_0x592f03){if(_0x592f03<=0x0){return!![];}return![];};exports['buildObj']=function(_0xe8c597,_0x508d1c,_0x313165){_0xe8c597['lastevent']=_0x508d1c;_0xe8c597[_0xe4c1('0x5c')]=_0xe8c597[_0xe4c1('0x5d')];_0xe8c597[_0xe4c1('0x5e')]=_0xe8c597[_0xe4c1('0x48')];_0xe8c597['motionChannel']='voice';if(_0x313165){_0xe8c597[_0xe4c1('0x5f')]=_0x313165[_0xe4c1('0x5f')];}return _0xe8c597;};exports[_0xe4c1('0x60')]=function(_0x3a4ae3){var _0x76f5a0={};_0x76f5a0[_0xe4c1('0x5d')]=_0x3a4ae3[_0xe4c1('0x5d')];_0x76f5a0[_0xe4c1('0x5e')]=_0x3a4ae3[_0xe4c1('0x48')];_0x76f5a0['uniqueid']=_0x3a4ae3[_0xe4c1('0x46')];return _0x76f5a0;};exports['agentReadyId']=function(_0x2c7cb7){var _0x29b0e9=[];for(var _0x3aa9be in _0x2c7cb7){if(_0x2c7cb7['hasOwnProperty'](_0x3aa9be)){if(!_[_0xe4c1('0x16')](_0x2c7cb7[_0x3aa9be])&&_0x2c7cb7[_0x3aa9be][_0xe4c1('0x35')]==='not_inuse'&&_0x2c7cb7[_0x3aa9be][_0xe4c1('0x61')]===_0xe4c1('0x62')){_0x29b0e9['push'](_0x2c7cb7[_0x3aa9be]['id']);}}}return _0x29b0e9;};exports[_0xe4c1('0x63')]=function(_0x3b419f){var _0x532075=moment()[_0xe4c1('0x4')](0x0);var _0x10909c=moment(_0x3b419f)[_0xe4c1('0x4')](0x0);return _0x532075['diff'](_0x10909c,_0xe4c1('0x6'));};exports[_0xe4c1('0x64')]=function(_0x50d9b3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x50d9b3[_0xe4c1('0x1b')],'ListId':_0x50d9b3[_0xe4c1('0x56')],'VoiceQueueId':_0x50d9b3[_0xe4c1('0x1c')]||undefined,'CampaignId':_0x50d9b3[_0xe4c1('0x65')]||undefined};};exports[_0xe4c1('0x66')]=function(_0x4bd3aa){if(_0x4bd3aa===_0xe4c1('0x46')||_0x4bd3aa===_0xe4c1('0x67')||_0x4bd3aa===_0xe4c1('0x5d')||_0x4bd3aa===_0xe4c1('0x68')||_0x4bd3aa==='campaigntype'||_0x4bd3aa===_0xe4c1('0x69')||_0x4bd3aa===_0xe4c1('0x3d')||_0x4bd3aa===_0xe4c1('0x48')||_0x4bd3aa===_0xe4c1('0x19')||_0x4bd3aa===_0xe4c1('0x55')||_0x4bd3aa===_0xe4c1('0x1a')||_0x4bd3aa===_0xe4c1('0x6a')||_0x4bd3aa==='countbusyretry'||_0x4bd3aa===_0xe4c1('0x4d')||_0x4bd3aa===_0xe4c1('0x4e')||_0x4bd3aa===_0xe4c1('0x6b')||_0x4bd3aa===_0xe4c1('0x6c')||_0x4bd3aa==='callbackuniqueid'||_0x4bd3aa===_0xe4c1('0x6d')||_0x4bd3aa===_0xe4c1('0x6e')||_0x4bd3aa===_0xe4c1('0x1b')||_0x4bd3aa===_0xe4c1('0x56')||_0x4bd3aa===_0xe4c1('0x6f')||_0x4bd3aa===_0xe4c1('0x1c')||_0x4bd3aa==='sipcallid'||_0x4bd3aa==='xmd-voicequeueid'||_0x4bd3aa===_0xe4c1('0x70')||_0x4bd3aa==='xmd-phone'||_0x4bd3aa===_0xe4c1('0x71')||_0x4bd3aa===_0xe4c1('0x72')||_0x4bd3aa==='xmd-dialtimeout'||_0x4bd3aa===_0xe4c1('0x73')||_0x4bd3aa===_0xe4c1('0x74')||_0x4bd3aa===_0xe4c1('0x75')||_0x4bd3aa===_0xe4c1('0x76')||_0x4bd3aa===_0xe4c1('0x77')||_0x4bd3aa===_0xe4c1('0x78')||_0x4bd3aa===_0xe4c1('0x79')||_0x4bd3aa==='xmd-agi'||_0x4bd3aa===_0xe4c1('0x7a')||_0x4bd3aa===_0xe4c1('0x7b')||_0x4bd3aa===_0xe4c1('0x7c')||_0x4bd3aa===_0xe4c1('0x7d')||_0x4bd3aa===_0xe4c1('0x7e')||_0x4bd3aa==='rtpaudioqoslossbridged'||_0x4bd3aa===_0xe4c1('0x7f')||_0x4bd3aa===_0xe4c1('0x80')||_0x4bd3aa===_0xe4c1('0x7a')||_0x4bd3aa==='rtpaudioqosbridged'||_0x4bd3aa===_0xe4c1('0x7c')||_0x4bd3aa===_0xe4c1('0x7d')||_0x4bd3aa===_0xe4c1('0x7e')||_0x4bd3aa===_0xe4c1('0x81')||_0x4bd3aa===_0xe4c1('0x7f')||_0x4bd3aa===_0xe4c1('0x80')||_0x4bd3aa===_0xe4c1('0x82')||_0x4bd3aa===_0xe4c1('0x83')||_0x4bd3aa===_0xe4c1('0x35')||_0x4bd3aa==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x29702d,_0x1fabe7){var _0x37f89a,_0x447d74,_0x509306;if(_0x1fabe7<=0x0){_0x1fabe7=0x1;}_0x37f89a=new RegExp(_0xe4c1('0x84')+_0x1fabe7+'}$');_0x447d74=Math['pow'](0xa,_0x1fabe7-0x1);_0x509306=Math[_0xe4c1('0x85')](0xa,_0x1fabe7)-0x1;return util[_0xe4c1('0x12')]('%s',_[_0xe4c1('0x86')](_0x29702d,_0x37f89a,_['random'](_0x447d74,_0x509306)));};exports[_0xe4c1('0x87')]=function(_0x58cfb2){var _0x113704=_0x58cfb2['match'](/"(.*?)"/);return _0x113704?_0x113704[0x1]:_0x58cfb2;};exports[_0xe4c1('0x88')]=function(_0x587730){var _0x38b1dd=_0x587730[_0xe4c1('0x89')](/<(.*?)>/);return _0x38b1dd?_0x38b1dd[0x1]:_0x587730;};
\ No newline at end of file
index 65c3ae9..c9dc9ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ab3=['string','number','boolean','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x497077,_0x98d60e){var _0x2c0f12=function(_0x5a1b8b){while(--_0x5a1b8b){_0x497077['push'](_0x497077['shift']());}};_0x2c0f12(++_0x98d60e);}(_0x0ab3,0x111));var _0x30ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ab3[_0x3dd15e];return _0x231fd0;};'use strict';exports['queueadd']={'queue':{'type':_0x30ab('0x0'),'required':!![]},'interface':{'type':_0x30ab('0x0'),'required':!![]},'membername':{'type':_0x30ab('0x0'),'required':!![]},'penalty':{'type':_0x30ab('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x30ab('0x0'),'required':!![]},'interface':{'type':_0x30ab('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x30ab('0x0'),'required':!![]},'paused':{'type':_0x30ab('0x2')},'reason':{'type':_0x30ab('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x30ab('0x0'),'required':![]}};exports[_0x30ab('0x3')]={'uniqueid':{'type':_0x30ab('0x0'),'required':!![]}};exports[_0x30ab('0x4')]={'uniqueid':{'type':_0x30ab('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x30ab('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x30ab('0x5')]={'uniqueid':{'type':_0x30ab('0x0'),'required':!![]}};exports[_0x30ab('0x6')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x30ab('0x0'),'required':!![]},'context':{'type':_0x30ab('0x0')}};
\ No newline at end of file
+var _0x69a7=['reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x69a7,0x1db));var _0x769a=function(_0x32753a,_0x313eff){_0x32753a=_0x32753a-0x0;var _0x5cc638=_0x69a7[_0x32753a];return _0x5cc638;};'use strict';exports[_0x769a('0x0')]={'queue':{'type':_0x769a('0x1'),'required':!![]},'interface':{'type':_0x769a('0x1'),'required':!![]},'membername':{'type':_0x769a('0x1'),'required':!![]},'penalty':{'type':_0x769a('0x2'),'required':![]},'paused':{'type':_0x769a('0x3'),'required':![]}};exports[_0x769a('0x4')]={'queue':{'type':_0x769a('0x1'),'required':!![]},'interface':{'type':_0x769a('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x769a('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x769a('0x1'),'required':![]}};exports[_0x769a('0x5')]={'module':{'type':'string','required':![]}};exports[_0x769a('0x6')]={'uniqueid':{'type':_0x769a('0x1'),'required':!![]}};exports[_0x769a('0x7')]={'uniqueid':{'type':_0x769a('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x769a('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x769a('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x769a('0x9')]={'uniqueid':{'type':_0x769a('0x1'),'required':!![]},'exten':{'type':_0x769a('0x1'),'required':!![]},'context':{'type':_0x769a('0x1')}};
\ No newline at end of file
index 15f1eb9..2df3f24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a95=['seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','ANSWERED','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/freshdeskAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','voiceExtensions','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','sumHoldTime','sumDuration','sumBillable','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','outboundDropCallsDayTimeout','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt'];(function(_0x3996e2,_0x5a4ed5){var _0x586f0c=function(_0x45a867){while(--_0x45a867){_0x3996e2['push'](_0x3996e2['shift']());}};_0x586f0c(++_0x5a4ed5);}(_0x2a95,0xd1));var _0x52a9=function(_0x38bec2,_0x1d6468){_0x38bec2=_0x38bec2-0x0;var _0x8d23ae=_0x2a95[_0x38bec2];return _0x8d23ae;};'use strict';var BPromise=require(_0x52a9('0x0'));var util=require(_0x52a9('0x1'));var _=require(_0x52a9('0x2'));var moment=require(_0x52a9('0x3'));var Agent=require(_0x52a9('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x52a9('0x5'));var VoiceQueue=require(_0x52a9('0x6'));var Trigger=require('../model/trigger');var Template=require(_0x52a9('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x52a9('0x8'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x52a9('0x9'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x52a9('0xa'));var ServicenowAccount=require(_0x52a9('0xb'));var Dynamics365Account=require(_0x52a9('0xc'));var FreshsalesAccount=require(_0x52a9('0xd'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0x52a9('0xe')]={};this[_0x52a9('0xf')]={};this[_0x52a9('0x10')]={};this['triggers']={};this['campaigns']={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x52a9('0x11')]={};this['channels']={};this[_0x52a9('0x12')]={};this[_0x52a9('0x13')]={};this['timers']={};this[_0x52a9('0x14')]={};this[_0x52a9('0x15')]={};this[_0x52a9('0x16')]={};this[_0x52a9('0x17')]={};this[_0x52a9('0x18')]={};this[_0x52a9('0x19')]={};this['deskAccounts']={};this[_0x52a9('0x1a')]={};this[_0x52a9('0x1b')]={};this[_0x52a9('0x1c')]={};this[_0x52a9('0x1d')]={};this[_0x52a9('0x1e')]={};};function freeIsNotKey(_0x2c2d7d,_0x3fc8fe,_0x40628a){var _0x9b05fb=_[_0x52a9('0x1f')](_0x2c2d7d,function(_0x2ab4a0,_0x2742c6){return _0x2ab4a0[_0x40628a];});for(var _0x327268 in _0x3fc8fe){if(_0x3fc8fe[_0x52a9('0x20')](_0x327268)){if(!_0x9b05fb[_0x327268]){delete _0x3fc8fe[_0x327268];}}}}function freeIsNotKeySip(_0x2e63ed,_0x879bfd){var _0x18d7d7=_[_0x52a9('0x1f')](_0x2e63ed,function(_0x27cf3d,_0x59b047){return util[_0x52a9('0x21')](_0x52a9('0x22'),_0x27cf3d[_0x52a9('0x23')]);});for(var _0x58871e in _0x879bfd){if(_0x879bfd[_0x52a9('0x20')](_0x58871e)){if(!_0x18d7d7[_0x58871e]){delete _0x879bfd[_0x58871e];}}}}function freeIsNotKeyAgent(_0x4c47e1,_0x9c1baa){var _0x237d3e=_[_0x52a9('0x1f')](_0x4c47e1,function(_0x15f50b,_0x249da2){var _0x2152cf=_[_0x52a9('0x24')](_0x15f50b[_0x52a9('0x25')])?util[_0x52a9('0x21')](_0x52a9('0x22'),_0x15f50b[_0x52a9('0x23')]):_0x15f50b[_0x52a9('0x25')];return _0x2152cf;});for(var _0x5e1aef in _0x9c1baa){if(_0x9c1baa[_0x52a9('0x20')](_0x5e1aef)){if(!_0x237d3e[_0x5e1aef]){delete _0x9c1baa[_0x5e1aef];}}}}function clearVoiceCallReports(_0x54f904){_0x54f904[_0x52a9('0x26')]=0x0;_0x54f904['answered']=0x0;_0x54f904[_0x52a9('0x27')]=0x0;_0x54f904[_0x52a9('0x28')]=0x0;_0x54f904[_0x52a9('0x29')]=0x0;}function clearCampaigns(_0x908df3){if(!_['isEmpty'](_0x908df3)){for(var _0x5578c7 in _0x908df3){if(_0x908df3[_0x52a9('0x20')](_0x5578c7)){_0x908df3[_0x5578c7]['ivrTotalCallsDays']=0x0;_0x908df3[_0x5578c7][_0x52a9('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x2ff813){if(!_[_0x52a9('0x2b')](_0x2ff813)){for(var _0x3dc890 in _0x2ff813){if(_0x2ff813[_0x52a9('0x20')](_0x3dc890)){_0x2ff813[_0x3dc890][_0x52a9('0x26')]=0x0;_0x2ff813[_0x3dc890]['answered']=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x2c')]=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x2d')]=0x0;_0x2ff813[_0x3dc890]['sumHoldTime']=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x28')]=0x0;_0x2ff813[_0x3dc890]['sumBillable']=0x0;_0x2ff813[_0x3dc890]['outboundAnswerAgiCallsDay']=0x0;_0x2ff813[_0x3dc890]['outboundNoAnswerCallsDay']=0x0;_0x2ff813[_0x3dc890]['outboundBusyCallsDay']=0x0;_0x2ff813[_0x3dc890]['outboundCongestionCallsDay']=0x0;_0x2ff813[_0x3dc890]['outboundNoSuchCallsDay']=0x0;_0x2ff813[_0x3dc890]['outboundUnknownCallsDay']=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x2e')]=0x0;_0x2ff813[_0x3dc890]['outboundDropCallsDayCallersExit']=0x0;_0x2ff813[_0x3dc890]['outboundBlacklistCallsDay']=0x0;_0x2ff813[_0x3dc890]['outboundOriginateFailureCallsDay']=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x2f')]=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x30')]=0x0;_0x2ff813[_0x3dc890]['outboundAnswerAgiCallsDay']=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x31')]=0x0;_0x2ff813[_0x3dc890][_0x52a9('0x32')]=!![];}}}}Realtime[_0x52a9('0x33')]['mergeFromDatabase']=function(_0x181bf8,_0x1d76f8){for(var _0x219d0f in _0x1d76f8){if(_0x181bf8[_0x52a9('0x20')](_0x219d0f)){_0x181bf8[_0x219d0f]=_0x1d76f8[_0x219d0f];}}};Realtime[_0x52a9('0x33')][_0x52a9('0x34')]=function(){var _0x12099d=this;return function(_0x59e5e3){if(_0x59e5e3){freeIsNotKeyAgent(_0x59e5e3,_0x12099d[_0x52a9('0x35')]);for(var _0x31e515=0x0,_0x23f733={},_0x5061ab={};_0x31e515<_0x59e5e3[_0x52a9('0x36')];_0x31e515+=0x1){_0x23f733=_0x59e5e3[_0x31e515];var _0x35bc9f=_[_0x52a9('0x24')](_0x23f733[_0x52a9('0x25')])?util['format']('SIP/%s',_0x23f733['name']):_0x23f733['interface'];if(_[_0x52a9('0x37')](_0x12099d['agents'][_0x35bc9f])){_0x12099d['agents'][_0x35bc9f]=new Agent(_0x23f733);}else{_0x12099d[_0x52a9('0x38')](_0x12099d[_0x52a9('0x35')][_0x35bc9f],_0x23f733);}}}return _0x12099d[_0x52a9('0x35')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x39')]=function(){var _0xa9439f=this;return function(_0x4ec499){if(_0x4ec499){freeIsNotKeySip(_0x4ec499,_0xa9439f[_0x52a9('0xe')]);for(var _0x3cc590=0x0,_0x2f2a5e={},_0xfea1ca={};_0x3cc590<_0x4ec499['length'];_0x3cc590+=0x1){_0x2f2a5e=_0x4ec499[_0x3cc590];if(_[_0x52a9('0x37')](_0xa9439f['telephones'][util[_0x52a9('0x21')](_0x52a9('0x22'),_0x2f2a5e['name'])])){_0xa9439f[_0x52a9('0xe')][util[_0x52a9('0x21')](_0x52a9('0x22'),_0x2f2a5e['name'])]=new Telephone(_0x2f2a5e);}else{_0xa9439f[_0x52a9('0x38')](_0xa9439f['telephones'][util[_0x52a9('0x21')](_0x52a9('0x22'),_0x2f2a5e[_0x52a9('0x23')])],_0x2f2a5e);}}}return _0xa9439f[_0x52a9('0xe')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x3a')]=function(){var _0x5a322f=this;return function(_0x3b3a99){if(_0x3b3a99){freeIsNotKeySip(_0x3b3a99,_0x5a322f[_0x52a9('0xf')]);for(var _0x4801cd=0x0,_0x529681={},_0x58c02f={};_0x4801cd<_0x3b3a99['length'];_0x4801cd+=0x1){_0x529681=_0x3b3a99[_0x4801cd];if(_['isUndefined'](_0x5a322f[_0x52a9('0xf')][util[_0x52a9('0x21')](_0x52a9('0x22'),_0x529681[_0x52a9('0x23')])])){_0x5a322f['trunks'][util[_0x52a9('0x21')](_0x52a9('0x22'),_0x529681['name'])]=new Trunk(_0x529681);}else{_0x5a322f[_0x52a9('0x38')](_0x5a322f[_0x52a9('0xf')][util[_0x52a9('0x21')](_0x52a9('0x22'),_0x529681[_0x52a9('0x23')])],_0x529681);}}}return _0x5a322f[_0x52a9('0xf')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x3b')]=function(){var _0x287de9=this;return function(_0x18cbdd){if(_0x18cbdd){freeIsNotKey(_0x18cbdd,_0x287de9[_0x52a9('0x10')],_0x52a9('0x23'));for(var _0x324eaf=0x0,_0x15333={},_0x4c4ef0={};_0x324eaf<_0x18cbdd[_0x52a9('0x36')];_0x324eaf+=0x1){_0x15333=_0x18cbdd[_0x324eaf];if(_[_0x52a9('0x37')](_0x287de9[_0x52a9('0x10')][_0x15333[_0x52a9('0x23')]])){_0x287de9[_0x52a9('0x10')][_0x15333[_0x52a9('0x23')]]=new VoiceQueue(_0x15333);}else{_0x287de9[_0x52a9('0x38')](_0x287de9[_0x52a9('0x10')][_0x15333[_0x52a9('0x23')]],_0x15333);}}}return _0x287de9[_0x52a9('0x10')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x3c')]=function(){var _0x1cec86=this;return function(_0x47d1f2){if(_0x47d1f2){freeIsNotKey(_0x47d1f2,_0x1cec86[_0x52a9('0x3d')],'id');for(var _0x35050f=0x0,_0x33e63b={},_0x2c5681={};_0x35050f<_0x47d1f2[_0x52a9('0x36')];_0x35050f+=0x1){_0x33e63b=_0x47d1f2[_0x35050f];if(_[_0x52a9('0x37')](_0x1cec86[_0x52a9('0x3d')][_0x33e63b['id']])){_0x1cec86[_0x52a9('0x3d')][_0x33e63b['id']]=new Trigger(_0x33e63b);}else{_0x1cec86[_0x52a9('0x38')](_0x1cec86[_0x52a9('0x3d')][_0x33e63b['id']],_0x33e63b);}}}return _0x1cec86['triggers'];};};Realtime[_0x52a9('0x33')][_0x52a9('0x3e')]=function(){var _0x4ad18b=this;return function(_0x3ccf94){if(_0x3ccf94){freeIsNotKey(_0x3ccf94,_0x4ad18b[_0x52a9('0x3f')],'id');for(var _0x417dc8=0x0,_0x2bfc9c={},_0x4923ef={};_0x417dc8<_0x3ccf94[_0x52a9('0x36')];_0x417dc8+=0x1){_0x2bfc9c=_0x3ccf94[_0x417dc8];if(_[_0x52a9('0x37')](_0x4ad18b['templates'][_0x2bfc9c['id']])){_0x4ad18b['templates'][_0x2bfc9c['id']]=new Template(_0x2bfc9c);}else{_0x4ad18b[_0x52a9('0x38')](_0x4ad18b[_0x52a9('0x3f')][_0x2bfc9c['id']],_0x2bfc9c);}}}return _0x4ad18b[_0x52a9('0x3f')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x40')]=function(){var _0x386048=this;return function(_0x4f5adb){if(_0x4f5adb){freeIsNotKey(_0x4f5adb,_0x386048['zendeskAccounts'],'id');for(var _0x340834=0x0,_0x4c4e76={},_0x290765={};_0x340834<_0x4f5adb[_0x52a9('0x36')];_0x340834+=0x1){_0x4c4e76=_0x4f5adb[_0x340834];if(_[_0x52a9('0x37')](_0x386048[_0x52a9('0x15')][_0x4c4e76['id']])){_0x386048[_0x52a9('0x15')][_0x4c4e76['id']]=new ZendeskAccount(_0x4c4e76);}else{_0x386048[_0x52a9('0x38')](_0x386048['zendeskAccounts'][_0x4c4e76['id']],_0x4c4e76);}}}return _0x386048[_0x52a9('0x15')];};};Realtime[_0x52a9('0x33')]['initSalesforceAccounts']=function(){var _0xdbc9a2=this;return function(_0x3cfa5d){if(_0x3cfa5d){freeIsNotKey(_0x3cfa5d,_0xdbc9a2[_0x52a9('0x16')],'id');for(var _0x48998a=0x0,_0x240523={},_0x1e8e76={};_0x48998a<_0x3cfa5d[_0x52a9('0x36')];_0x48998a+=0x1){_0x240523=_0x3cfa5d[_0x48998a];if(_['isUndefined'](_0xdbc9a2['salesforceAccounts'][_0x240523['id']])){_0xdbc9a2[_0x52a9('0x16')][_0x240523['id']]=new SalesforceAccount(_0x240523);}else{_0xdbc9a2[_0x52a9('0x38')](_0xdbc9a2[_0x52a9('0x16')][_0x240523['id']],_0x240523);}}}return _0xdbc9a2['salesforceAccounts'];};};Realtime[_0x52a9('0x33')][_0x52a9('0x41')]=function(){var _0x38836b=this;return function(_0x506c39){if(_0x506c39){freeIsNotKey(_0x506c39,_0x38836b[_0x52a9('0x18')],'id');for(var _0xdbf03d=0x0,_0x2e14b8={},_0x565cf9={};_0xdbf03d<_0x506c39['length'];_0xdbf03d+=0x1){_0x2e14b8=_0x506c39[_0xdbf03d];if(_[_0x52a9('0x37')](_0x38836b[_0x52a9('0x18')][_0x2e14b8['id']])){_0x38836b[_0x52a9('0x18')][_0x2e14b8['id']]=new FreshdeskAccount(_0x2e14b8);}else{_0x38836b[_0x52a9('0x38')](_0x38836b[_0x52a9('0x18')][_0x2e14b8['id']],_0x2e14b8);}}}return _0x38836b[_0x52a9('0x18')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x42')]=function(){var _0xf4aa0c=this;return function(_0x2685f7){if(_0x2685f7){freeIsNotKey(_0x2685f7,_0xf4aa0c['zohoAccounts'],'id');for(var _0x54cc78=0x0,_0x6e8a6d={},_0x4cbd62={};_0x54cc78<_0x2685f7[_0x52a9('0x36')];_0x54cc78+=0x1){_0x6e8a6d=_0x2685f7[_0x54cc78];if(_['isUndefined'](_0xf4aa0c[_0x52a9('0x19')][_0x6e8a6d['id']])){_0xf4aa0c[_0x52a9('0x19')][_0x6e8a6d['id']]=new ZohoAccount(_0x6e8a6d);}else{_0xf4aa0c[_0x52a9('0x38')](_0xf4aa0c['zohoAccounts'][_0x6e8a6d['id']],_0x6e8a6d);}}}return _0xf4aa0c['zohoAccounts'];};};Realtime[_0x52a9('0x33')][_0x52a9('0x43')]=function(){var _0x3909ba=this;return function(_0x4b9c7b){if(_0x4b9c7b){freeIsNotKey(_0x4b9c7b,_0x3909ba[_0x52a9('0x44')],'id');for(var _0x12439c=0x0,_0x19e4bd={},_0x27757b={};_0x12439c<_0x4b9c7b[_0x52a9('0x36')];_0x12439c+=0x1){_0x19e4bd=_0x4b9c7b[_0x12439c];if(_[_0x52a9('0x37')](_0x3909ba['deskAccounts'][_0x19e4bd['id']])){_0x3909ba['deskAccounts'][_0x19e4bd['id']]=new DeskAccount(_0x19e4bd);}else{_0x3909ba[_0x52a9('0x38')](_0x3909ba[_0x52a9('0x44')][_0x19e4bd['id']],_0x19e4bd);}}}return _0x3909ba[_0x52a9('0x44')];};};Realtime[_0x52a9('0x33')]['initSugarcrmAccounts']=function(){var _0x116318=this;return function(_0x26be5e){if(_0x26be5e){freeIsNotKey(_0x26be5e,_0x116318[_0x52a9('0x17')],'id');for(var _0x191c94=0x0,_0xe5ae4a={},_0xa4f40b={};_0x191c94<_0x26be5e['length'];_0x191c94+=0x1){_0xe5ae4a=_0x26be5e[_0x191c94];if(_[_0x52a9('0x37')](_0x116318[_0x52a9('0x17')][_0xe5ae4a['id']])){_0x116318[_0x52a9('0x17')][_0xe5ae4a['id']]=new SugarcrmAccount(_0xe5ae4a);}else{_0x116318[_0x52a9('0x38')](_0x116318['sugarcrmAccounts'][_0xe5ae4a['id']],_0xe5ae4a);}}}return _0x116318[_0x52a9('0x17')];};};Realtime['prototype'][_0x52a9('0x45')]=function(){var _0xe3b2b0=this;return function(_0x22b23a){if(_0x22b23a){freeIsNotKey(_0x22b23a,_0xe3b2b0[_0x52a9('0x1a')],'id');for(var _0x54be40=0x0,_0xa8b904={},_0xfd3b08={};_0x54be40<_0x22b23a['length'];_0x54be40+=0x1){_0xa8b904=_0x22b23a[_0x54be40];if(_['isUndefined'](_0xe3b2b0['vtigerAccounts'][_0xa8b904['id']])){_0xe3b2b0['vtigerAccounts'][_0xa8b904['id']]=new VtigerAccount(_0xa8b904);}else{_0xe3b2b0[_0x52a9('0x38')](_0xe3b2b0[_0x52a9('0x1a')][_0xa8b904['id']],_0xa8b904);}}}return _0xe3b2b0[_0x52a9('0x1a')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x46')]=function(){var _0x227f08=this;return function(_0x5376df){if(_0x5376df){freeIsNotKey(_0x5376df,_0x227f08[_0x52a9('0x1b')],'id');for(var _0x15fc87=0x0,_0x469adc={},_0x41faa6={};_0x15fc87<_0x5376df[_0x52a9('0x36')];_0x15fc87+=0x1){_0x469adc=_0x5376df[_0x15fc87];if(_[_0x52a9('0x37')](_0x227f08[_0x52a9('0x1b')][_0x469adc['id']])){_0x227f08[_0x52a9('0x1b')][_0x469adc['id']]=new ServicenowAccount(_0x469adc);}else{_0x227f08[_0x52a9('0x38')](_0x227f08['servicenowAccounts'][_0x469adc['id']],_0x469adc);}}}return _0x227f08[_0x52a9('0x1b')];};};Realtime[_0x52a9('0x33')]['initDynamics365Accounts']=function(){var _0x215fd4=this;return function(_0x2b730b){if(_0x2b730b){freeIsNotKey(_0x2b730b,_0x215fd4[_0x52a9('0x1c')],'id');for(var _0x4a2bdd=0x0,_0x5047fc={},_0x3f6fa5={};_0x4a2bdd<_0x2b730b[_0x52a9('0x36')];_0x4a2bdd+=0x1){_0x5047fc=_0x2b730b[_0x4a2bdd];if(_[_0x52a9('0x37')](_0x215fd4['dynamics365Accounts'][_0x5047fc['id']])){_0x215fd4[_0x52a9('0x1c')][_0x5047fc['id']]=new Dynamics365Account(_0x5047fc);}else{_0x215fd4[_0x52a9('0x38')](_0x215fd4[_0x52a9('0x1c')][_0x5047fc['id']],_0x5047fc);}}}return _0x215fd4[_0x52a9('0x1c')];};};Realtime[_0x52a9('0x33')]['initFreshsalesAccounts']=function(){var _0x3872a6=this;return function(_0x5d1960){if(_0x5d1960){freeIsNotKey(_0x5d1960,_0x3872a6[_0x52a9('0x1d')],'id');for(var _0x59bce0=0x0,_0x55d44c={},_0x2907cf={};_0x59bce0<_0x5d1960[_0x52a9('0x36')];_0x59bce0+=0x1){_0x55d44c=_0x5d1960[_0x59bce0];if(_[_0x52a9('0x37')](_0x3872a6[_0x52a9('0x1d')][_0x55d44c['id']])){_0x3872a6[_0x52a9('0x1d')][_0x55d44c['id']]=new FreshsalesAccount(_0x55d44c);}else{_0x3872a6['mergeFromDatabase'](_0x3872a6[_0x52a9('0x1d')][_0x55d44c['id']],_0x55d44c);}}}return _0x3872a6[_0x52a9('0x1d')];};};Realtime[_0x52a9('0x33')]['initVoiceQueueHopperHistory']=function(){var _0x531e2e=this;return function(_0x46e9f9){for(var _0x4e0e97=0x0;_0x4e0e97<_0x46e9f9[_0x52a9('0x36')];_0x4e0e97+=0x1){_['merge'](_0x531e2e[_0x52a9('0x10')][_0x46e9f9[_0x4e0e97][_0x52a9('0x23')]],_0x46e9f9[_0x4e0e97]);}return _0x531e2e[_0x52a9('0x10')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x47')]=function(){var _0x22b805=this;return function(_0x19ad24){clearVoiceQueues(_0x22b805['voiceQueues']);if(_0x19ad24){_0x19ad24=_[_0x52a9('0x48')](_0x19ad24,_0x52a9('0x49'));for(var _0x3a2017 in _0x19ad24){if(_0x19ad24['hasOwnProperty'](_0x3a2017)){var _0x5e16fa={};for(var _0x401f71=0x0;_0x401f71<_0x19ad24[_0x3a2017][_0x52a9('0x36')];_0x401f71+=0x1){var _0x5583e8=_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x4a')];if(_0x22b805['voiceQueues'][_0x5583e8]){if(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x4b')]){_0x22b805[_0x52a9('0x10')][_0x5583e8][_0x52a9('0x2c')]+=0x1;}if(_0x19ad24[_0x3a2017][_0x401f71]['queuecallerabandon']){_0x22b805[_0x52a9('0x10')][_0x5583e8][_0x52a9('0x2d')]+=0x1;}_0x22b805['voiceQueues'][_0x5583e8][_0x52a9('0x27')]+=moment(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x4c')])[_0x52a9('0x4d')](moment(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x4e')]),_0x52a9('0x4f'))||0x0;if(_0x401f71===_0x19ad24[_0x3a2017][_0x52a9('0x36')]-0x1){_0x22b805[_0x52a9('0x10')][_0x5583e8]['sumDuration']+=moment(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x50')]||_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x51')]||_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x52')])[_0x52a9('0x4d')](moment(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x4e')]),_0x52a9('0x4f'))||0x0;_0x22b805[_0x52a9('0x10')][_0x5583e8][_0x52a9('0x26')]+=0x1;if(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x53')]){_0x22b805[_0x52a9('0x10')][_0x5583e8]['answered']+=0x1;_0x22b805['voiceQueues'][_0x5583e8][_0x52a9('0x29')]+=moment(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x50')])[_0x52a9('0x4d')](moment(_0x19ad24[_0x3a2017][_0x401f71][_0x52a9('0x4c')]),_0x52a9('0x4f'))||0x0;}}else{_0x22b805[_0x52a9('0x10')][_0x5583e8]['sumDuration']+=_0x22b805[_0x52a9('0x10')][_0x5583e8][_0x52a9('0x27')]||0x0;}}}}}}return _0x22b805[_0x52a9('0x10')];};};Realtime['prototype'][_0x52a9('0x54')]=function(){var _0x38bb0f=this;return function(_0x1123d7){clearVoiceCallReports(_0x38bb0f[_0x52a9('0x55')]);if(_0x1123d7){for(var _0x5eba1c=0x0;_0x5eba1c<_0x1123d7['length'];_0x5eba1c+=0x1){_0x38bb0f[_0x52a9('0x55')][_0x52a9('0x26')]+=0x1;_0x38bb0f[_0x52a9('0x55')][_0x52a9('0x28')]+=_0x1123d7[_0x5eba1c][_0x52a9('0x56')];if(_0x1123d7[_0x5eba1c]['disposition']===_0x52a9('0x57')){_0x38bb0f[_0x52a9('0x55')]['answered']+=0x1;_0x38bb0f[_0x52a9('0x55')][_0x52a9('0x27')]+=_0x1123d7[_0x5eba1c][_0x52a9('0x56')]-_0x1123d7[_0x5eba1c][_0x52a9('0x58')]||0x0;_0x38bb0f['outbound']['sumBillable']+=_0x1123d7[_0x5eba1c]['billableseconds'];}}}return _0x38bb0f[_0x52a9('0x55')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x59')]=function(){var _0x39a025=this;return function(_0x115bbb){if(_0x115bbb){freeIsNotKey(_0x115bbb,_0x39a025[_0x52a9('0x5a')],'name');for(var _0x3b967c=0x0,_0x2a1bd1={};_0x3b967c<_0x115bbb[_0x52a9('0x36')];_0x3b967c+=0x1){_0x2a1bd1=_0x115bbb[_0x3b967c];if(_[_0x52a9('0x37')](_0x39a025[_0x52a9('0x5a')][_0x2a1bd1[_0x52a9('0x23')]])){_0x39a025[_0x52a9('0x5a')][_0x2a1bd1['name']]=new Campaign(_0x2a1bd1);}else{_0x39a025[_0x52a9('0x38')](_0x39a025['campaigns'][_0x2a1bd1[_0x52a9('0x23')]],_0x2a1bd1);_0x39a025['campaigns'][_0x2a1bd1[_0x52a9('0x23')]]['dialQueueProject']=_0x2a1bd1['SquareProject']?_0x2a1bd1[_0x52a9('0x5b')][_0x52a9('0x23')]:undefined;}}}return _0x39a025[_0x52a9('0x5a')];};};Realtime['prototype'][_0x52a9('0x5c')]=function(){var _0x19566e=this;return function(_0x3c8aec){if(_0x3c8aec){freeIsNotKey(_0x3c8aec,_0x19566e['voiceExtensions'],'id');for(var _0x244a0d=0x0,_0x4e5994={};_0x244a0d<_0x3c8aec[_0x52a9('0x36')];_0x244a0d+=0x1){_0x4e5994=_0x3c8aec[_0x244a0d];if(_[_0x52a9('0x37')](_0x19566e['voiceExtensions'][_0x4e5994['id']])){_0x19566e[_0x52a9('0x11')][_0x4e5994['id']]=new VoiceExtension(_0x4e5994);}else{_0x19566e[_0x52a9('0x38')](_0x19566e[_0x52a9('0x11')][_0x4e5994['id']],_0x4e5994);}}}return _0x19566e[_0x52a9('0x11')];};};Realtime[_0x52a9('0x33')][_0x52a9('0x5d')]=function(){var _0x3e2095=this;return function(_0x31c6d4){clearCampaigns(_0x3e2095[_0x52a9('0x5a')]);for(var _0x4cdc88=0x0;_0x4cdc88<_0x31c6d4['length'];_0x4cdc88+=0x1){_[_0x52a9('0x5e')](_0x3e2095[_0x52a9('0x5a')][_0x31c6d4[_0x4cdc88][_0x52a9('0x23')]],_0x31c6d4[_0x4cdc88]);}return _0x3e2095[_0x52a9('0x5a')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x20ca0c=this;return function(_0x437d2e){if(_0x437d2e){freeIsNotKey(_0x437d2e,_0x20ca0c[_0x52a9('0x1e')],'id');for(var _0x3d84e9=0x0,_0x3afb1f={},_0x304cda={};_0x3d84e9<_0x437d2e[_0x52a9('0x36')];_0x3d84e9+=0x1){_0x3afb1f=_0x437d2e[_0x3d84e9];if(_[_0x52a9('0x37')](_0x20ca0c['faxAccounts'][_0x3afb1f['id']])){_0x20ca0c[_0x52a9('0x1e')][_0x3afb1f['id']]=new FaxAccount(_0x3afb1f);}else{_0x20ca0c[_0x52a9('0x38')](_0x20ca0c[_0x52a9('0x1e')][_0x3afb1f['id']],_0x3afb1f);}}}return _0x20ca0c['faxAccounts'];};};module[_0x52a9('0x5f')]=Realtime;
\ No newline at end of file
+var _0xb9ff=['outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','isUndefined','initTelephones','initVoiceQueues','length','voiceQueues','initTriggers','initTemplates','templates','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','merge','uniqueid','unmanaged','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','seconds','diff','queuecallercomplete','queuecallercompleteAt','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','triggers','campaigns','queueChannels','outboundChannels','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','isNil','interface','hasOwnProperty','total','answered','sumHoldTime','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumDuration','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit'];(function(_0x11edf9,_0xb78513){var _0x30fbcc=function(_0x199bd0){while(--_0x199bd0){_0x11edf9['push'](_0x11edf9['shift']());}};_0x30fbcc(++_0xb78513);}(_0xb9ff,0x159));var _0xfb9f=function(_0xe0c9bb,_0x477272){_0xe0c9bb=_0xe0c9bb-0x0;var _0x199a72=_0xb9ff[_0xe0c9bb];return _0x199a72;};'use strict';var BPromise=require(_0xfb9f('0x0'));var util=require(_0xfb9f('0x1'));var _=require(_0xfb9f('0x2'));var moment=require(_0xfb9f('0x3'));var Agent=require(_0xfb9f('0x4'));var Telephone=require(_0xfb9f('0x5'));var Trunk=require(_0xfb9f('0x6'));var VoiceQueue=require(_0xfb9f('0x7'));var Trigger=require(_0xfb9f('0x8'));var Template=require(_0xfb9f('0x9'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xfb9f('0xa'));var ZendeskAccount=require(_0xfb9f('0xb'));var SalesforceAccount=require(_0xfb9f('0xc'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xfb9f('0xd'));var ZohoAccount=require(_0xfb9f('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xfb9f('0xf'));var FreshsalesAccount=require(_0xfb9f('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xfb9f('0x11')]={};this[_0xfb9f('0x12')]={};this[_0xfb9f('0x13')]={};this['voiceQueues']={};this[_0xfb9f('0x14')]={};this[_0xfb9f('0x15')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0xfb9f('0x16')]={};this[_0xfb9f('0x17')]={};this['timers']={};this[_0xfb9f('0x18')]={};this['zendeskAccounts']={};this[_0xfb9f('0x19')]={};this[_0xfb9f('0x1a')]={};this[_0xfb9f('0x1b')]={};this[_0xfb9f('0x1c')]={};this[_0xfb9f('0x1d')]={};this[_0xfb9f('0x1e')]={};this[_0xfb9f('0x1f')]={};this['dynamics365Accounts']={};this[_0xfb9f('0x20')]={};this[_0xfb9f('0x21')]={};};function freeIsNotKey(_0x10c30f,_0x2acbcc,_0x4fb7e0){var _0x21424b=_[_0xfb9f('0x22')](_0x10c30f,function(_0x5b5564,_0x38b0fc){return _0x5b5564[_0x4fb7e0];});for(var _0x323172 in _0x2acbcc){if(_0x2acbcc['hasOwnProperty'](_0x323172)){if(!_0x21424b[_0x323172]){delete _0x2acbcc[_0x323172];}}}}function freeIsNotKeySip(_0x21e776,_0x92addb){var _0x13ff3b=_[_0xfb9f('0x22')](_0x21e776,function(_0x307b05,_0x11a828){return util[_0xfb9f('0x23')](_0xfb9f('0x24'),_0x307b05[_0xfb9f('0x25')]);});for(var _0x1bf371 in _0x92addb){if(_0x92addb['hasOwnProperty'](_0x1bf371)){if(!_0x13ff3b[_0x1bf371]){delete _0x92addb[_0x1bf371];}}}}function freeIsNotKeyAgent(_0x499814,_0x440095){var _0x3eaafe=_[_0xfb9f('0x22')](_0x499814,function(_0x7a94e9,_0x11d58c){var _0x229fce=_[_0xfb9f('0x26')](_0x7a94e9[_0xfb9f('0x27')])?util[_0xfb9f('0x23')](_0xfb9f('0x24'),_0x7a94e9[_0xfb9f('0x25')]):_0x7a94e9[_0xfb9f('0x27')];return _0x229fce;});for(var _0x9968db in _0x440095){if(_0x440095[_0xfb9f('0x28')](_0x9968db)){if(!_0x3eaafe[_0x9968db]){delete _0x440095[_0x9968db];}}}}function clearVoiceCallReports(_0x266816){_0x266816[_0xfb9f('0x29')]=0x0;_0x266816[_0xfb9f('0x2a')]=0x0;_0x266816[_0xfb9f('0x2b')]=0x0;_0x266816['sumDuration']=0x0;_0x266816['sumBillable']=0x0;}function clearCampaigns(_0x8a5057){if(!_[_0xfb9f('0x2c')](_0x8a5057)){for(var _0x323fe3 in _0x8a5057){if(_0x8a5057[_0xfb9f('0x28')](_0x323fe3)){_0x8a5057[_0x323fe3][_0xfb9f('0x2d')]=0x0;_0x8a5057[_0x323fe3][_0xfb9f('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x2db7a5){if(!_[_0xfb9f('0x2c')](_0x2db7a5)){for(var _0x3525ab in _0x2db7a5){if(_0x2db7a5[_0xfb9f('0x28')](_0x3525ab)){_0x2db7a5[_0x3525ab]['total']=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x2a')]=0x0;_0x2db7a5[_0x3525ab]['unmanaged']=0x0;_0x2db7a5[_0x3525ab]['abandoned']=0x0;_0x2db7a5[_0x3525ab]['sumHoldTime']=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x2f')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x30')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x31')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x32')]=0x0;_0x2db7a5[_0x3525ab]['outboundBusyCallsDay']=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x33')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x34')]=0x0;_0x2db7a5[_0x3525ab]['outboundUnknownCallsDay']=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x35')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x36')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x37')]=0x0;_0x2db7a5[_0x3525ab]['outboundOriginateFailureCallsDay']=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x38')]=0x0;_0x2db7a5[_0x3525ab]['outboundReCallsDay']=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x31')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x39')]=0x0;_0x2db7a5[_0x3525ab][_0xfb9f('0x3a')]=!![];}}}}Realtime[_0xfb9f('0x3b')][_0xfb9f('0x3c')]=function(_0x1b645a,_0x32d4c8){for(var _0x3c1958 in _0x32d4c8){if(_0x1b645a[_0xfb9f('0x28')](_0x3c1958)){_0x1b645a[_0x3c1958]=_0x32d4c8[_0x3c1958];}}};Realtime[_0xfb9f('0x3b')]['initAgents']=function(){var _0x363a69=this;return function(_0x27c214){if(_0x27c214){freeIsNotKeyAgent(_0x27c214,_0x363a69['agents']);for(var _0x41e77e=0x0,_0x5f2630={},_0x4dd3b0={};_0x41e77e<_0x27c214['length'];_0x41e77e+=0x1){_0x5f2630=_0x27c214[_0x41e77e];var _0x647c3a=_[_0xfb9f('0x26')](_0x5f2630[_0xfb9f('0x27')])?util['format'](_0xfb9f('0x24'),_0x5f2630[_0xfb9f('0x25')]):_0x5f2630[_0xfb9f('0x27')];if(_[_0xfb9f('0x3d')](_0x363a69[_0xfb9f('0x11')][_0x647c3a])){_0x363a69[_0xfb9f('0x11')][_0x647c3a]=new Agent(_0x5f2630);}else{_0x363a69[_0xfb9f('0x3c')](_0x363a69['agents'][_0x647c3a],_0x5f2630);}}}return _0x363a69[_0xfb9f('0x11')];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x3e')]=function(){var _0x5b5501=this;return function(_0x4db745){if(_0x4db745){freeIsNotKeySip(_0x4db745,_0x5b5501[_0xfb9f('0x12')]);for(var _0x398f06=0x0,_0x189f5f={},_0x401930={};_0x398f06<_0x4db745['length'];_0x398f06+=0x1){_0x189f5f=_0x4db745[_0x398f06];if(_[_0xfb9f('0x3d')](_0x5b5501[_0xfb9f('0x12')][util[_0xfb9f('0x23')](_0xfb9f('0x24'),_0x189f5f[_0xfb9f('0x25')])])){_0x5b5501[_0xfb9f('0x12')][util['format'](_0xfb9f('0x24'),_0x189f5f[_0xfb9f('0x25')])]=new Telephone(_0x189f5f);}else{_0x5b5501['mergeFromDatabase'](_0x5b5501[_0xfb9f('0x12')][util[_0xfb9f('0x23')](_0xfb9f('0x24'),_0x189f5f[_0xfb9f('0x25')])],_0x189f5f);}}}return _0x5b5501[_0xfb9f('0x12')];};};Realtime[_0xfb9f('0x3b')]['initTrunks']=function(){var _0x19048a=this;return function(_0x9f4d16){if(_0x9f4d16){freeIsNotKeySip(_0x9f4d16,_0x19048a[_0xfb9f('0x13')]);for(var _0x320d0b=0x0,_0x277d7e={},_0xd25ec2={};_0x320d0b<_0x9f4d16['length'];_0x320d0b+=0x1){_0x277d7e=_0x9f4d16[_0x320d0b];if(_[_0xfb9f('0x3d')](_0x19048a[_0xfb9f('0x13')][util[_0xfb9f('0x23')](_0xfb9f('0x24'),_0x277d7e['name'])])){_0x19048a['trunks'][util[_0xfb9f('0x23')]('SIP/%s',_0x277d7e[_0xfb9f('0x25')])]=new Trunk(_0x277d7e);}else{_0x19048a['mergeFromDatabase'](_0x19048a[_0xfb9f('0x13')][util[_0xfb9f('0x23')](_0xfb9f('0x24'),_0x277d7e['name'])],_0x277d7e);}}}return _0x19048a[_0xfb9f('0x13')];};};Realtime['prototype'][_0xfb9f('0x3f')]=function(){var _0x20156c=this;return function(_0xab197d){if(_0xab197d){freeIsNotKey(_0xab197d,_0x20156c['voiceQueues'],_0xfb9f('0x25'));for(var _0x4a1ccb=0x0,_0xad6139={},_0x3f3ade={};_0x4a1ccb<_0xab197d[_0xfb9f('0x40')];_0x4a1ccb+=0x1){_0xad6139=_0xab197d[_0x4a1ccb];if(_[_0xfb9f('0x3d')](_0x20156c[_0xfb9f('0x41')][_0xad6139[_0xfb9f('0x25')]])){_0x20156c[_0xfb9f('0x41')][_0xad6139[_0xfb9f('0x25')]]=new VoiceQueue(_0xad6139);}else{_0x20156c['mergeFromDatabase'](_0x20156c[_0xfb9f('0x41')][_0xad6139['name']],_0xad6139);}}}return _0x20156c[_0xfb9f('0x41')];};};Realtime['prototype'][_0xfb9f('0x42')]=function(){var _0x529b8e=this;return function(_0xfa7351){if(_0xfa7351){freeIsNotKey(_0xfa7351,_0x529b8e['triggers'],'id');for(var _0x16c85f=0x0,_0x5d2724={},_0x5c8c76={};_0x16c85f<_0xfa7351[_0xfb9f('0x40')];_0x16c85f+=0x1){_0x5d2724=_0xfa7351[_0x16c85f];if(_[_0xfb9f('0x3d')](_0x529b8e['triggers'][_0x5d2724['id']])){_0x529b8e[_0xfb9f('0x14')][_0x5d2724['id']]=new Trigger(_0x5d2724);}else{_0x529b8e['mergeFromDatabase'](_0x529b8e[_0xfb9f('0x14')][_0x5d2724['id']],_0x5d2724);}}}return _0x529b8e['triggers'];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x43')]=function(){var _0x41151e=this;return function(_0x126824){if(_0x126824){freeIsNotKey(_0x126824,_0x41151e['templates'],'id');for(var _0x3d8134=0x0,_0x281256={},_0x22f623={};_0x3d8134<_0x126824['length'];_0x3d8134+=0x1){_0x281256=_0x126824[_0x3d8134];if(_[_0xfb9f('0x3d')](_0x41151e['templates'][_0x281256['id']])){_0x41151e[_0xfb9f('0x44')][_0x281256['id']]=new Template(_0x281256);}else{_0x41151e[_0xfb9f('0x3c')](_0x41151e[_0xfb9f('0x44')][_0x281256['id']],_0x281256);}}}return _0x41151e[_0xfb9f('0x44')];};};Realtime[_0xfb9f('0x3b')]['initZendeskAccounts']=function(){var _0x584add=this;return function(_0x649762){if(_0x649762){freeIsNotKey(_0x649762,_0x584add[_0xfb9f('0x45')],'id');for(var _0x495693=0x0,_0x128421={},_0x597b1c={};_0x495693<_0x649762['length'];_0x495693+=0x1){_0x128421=_0x649762[_0x495693];if(_[_0xfb9f('0x3d')](_0x584add[_0xfb9f('0x45')][_0x128421['id']])){_0x584add[_0xfb9f('0x45')][_0x128421['id']]=new ZendeskAccount(_0x128421);}else{_0x584add[_0xfb9f('0x3c')](_0x584add[_0xfb9f('0x45')][_0x128421['id']],_0x128421);}}}return _0x584add[_0xfb9f('0x45')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x280f53=this;return function(_0x4e7cc8){if(_0x4e7cc8){freeIsNotKey(_0x4e7cc8,_0x280f53[_0xfb9f('0x19')],'id');for(var _0x36838a=0x0,_0x204a70={},_0x3f7379={};_0x36838a<_0x4e7cc8['length'];_0x36838a+=0x1){_0x204a70=_0x4e7cc8[_0x36838a];if(_['isUndefined'](_0x280f53['salesforceAccounts'][_0x204a70['id']])){_0x280f53[_0xfb9f('0x19')][_0x204a70['id']]=new SalesforceAccount(_0x204a70);}else{_0x280f53[_0xfb9f('0x3c')](_0x280f53['salesforceAccounts'][_0x204a70['id']],_0x204a70);}}}return _0x280f53[_0xfb9f('0x19')];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x46')]=function(){var _0x54caa2=this;return function(_0x1dcc88){if(_0x1dcc88){freeIsNotKey(_0x1dcc88,_0x54caa2[_0xfb9f('0x1b')],'id');for(var _0x2ed913=0x0,_0x173501={},_0x5e56b7={};_0x2ed913<_0x1dcc88[_0xfb9f('0x40')];_0x2ed913+=0x1){_0x173501=_0x1dcc88[_0x2ed913];if(_[_0xfb9f('0x3d')](_0x54caa2['freshdeskAccounts'][_0x173501['id']])){_0x54caa2[_0xfb9f('0x1b')][_0x173501['id']]=new FreshdeskAccount(_0x173501);}else{_0x54caa2[_0xfb9f('0x3c')](_0x54caa2[_0xfb9f('0x1b')][_0x173501['id']],_0x173501);}}}return _0x54caa2[_0xfb9f('0x1b')];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x47')]=function(){var _0x2b54e7=this;return function(_0x25cd3e){if(_0x25cd3e){freeIsNotKey(_0x25cd3e,_0x2b54e7[_0xfb9f('0x1c')],'id');for(var _0x2cf018=0x0,_0x40717b={},_0x2d9983={};_0x2cf018<_0x25cd3e[_0xfb9f('0x40')];_0x2cf018+=0x1){_0x40717b=_0x25cd3e[_0x2cf018];if(_[_0xfb9f('0x3d')](_0x2b54e7['zohoAccounts'][_0x40717b['id']])){_0x2b54e7[_0xfb9f('0x1c')][_0x40717b['id']]=new ZohoAccount(_0x40717b);}else{_0x2b54e7['mergeFromDatabase'](_0x2b54e7[_0xfb9f('0x1c')][_0x40717b['id']],_0x40717b);}}}return _0x2b54e7[_0xfb9f('0x1c')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x3815c9=this;return function(_0x36a8f5){if(_0x36a8f5){freeIsNotKey(_0x36a8f5,_0x3815c9[_0xfb9f('0x1d')],'id');for(var _0x4a6d96=0x0,_0x1bdc6d={},_0x5095ff={};_0x4a6d96<_0x36a8f5['length'];_0x4a6d96+=0x1){_0x1bdc6d=_0x36a8f5[_0x4a6d96];if(_[_0xfb9f('0x3d')](_0x3815c9[_0xfb9f('0x1d')][_0x1bdc6d['id']])){_0x3815c9[_0xfb9f('0x1d')][_0x1bdc6d['id']]=new DeskAccount(_0x1bdc6d);}else{_0x3815c9[_0xfb9f('0x3c')](_0x3815c9[_0xfb9f('0x1d')][_0x1bdc6d['id']],_0x1bdc6d);}}}return _0x3815c9[_0xfb9f('0x1d')];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x48')]=function(){var _0x57ce97=this;return function(_0x2c0d77){if(_0x2c0d77){freeIsNotKey(_0x2c0d77,_0x57ce97[_0xfb9f('0x1a')],'id');for(var _0x332bcd=0x0,_0x5b6153={},_0x3d3af7={};_0x332bcd<_0x2c0d77[_0xfb9f('0x40')];_0x332bcd+=0x1){_0x5b6153=_0x2c0d77[_0x332bcd];if(_[_0xfb9f('0x3d')](_0x57ce97['sugarcrmAccounts'][_0x5b6153['id']])){_0x57ce97['sugarcrmAccounts'][_0x5b6153['id']]=new SugarcrmAccount(_0x5b6153);}else{_0x57ce97[_0xfb9f('0x3c')](_0x57ce97['sugarcrmAccounts'][_0x5b6153['id']],_0x5b6153);}}}return _0x57ce97[_0xfb9f('0x1a')];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x49')]=function(){var _0x2556b9=this;return function(_0x28852a){if(_0x28852a){freeIsNotKey(_0x28852a,_0x2556b9[_0xfb9f('0x1e')],'id');for(var _0x55970a=0x0,_0x2a7a33={},_0x57dfad={};_0x55970a<_0x28852a['length'];_0x55970a+=0x1){_0x2a7a33=_0x28852a[_0x55970a];if(_['isUndefined'](_0x2556b9[_0xfb9f('0x1e')][_0x2a7a33['id']])){_0x2556b9[_0xfb9f('0x1e')][_0x2a7a33['id']]=new VtigerAccount(_0x2a7a33);}else{_0x2556b9[_0xfb9f('0x3c')](_0x2556b9[_0xfb9f('0x1e')][_0x2a7a33['id']],_0x2a7a33);}}}return _0x2556b9[_0xfb9f('0x1e')];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x4a')]=function(){var _0x914218=this;return function(_0x88dcaa){if(_0x88dcaa){freeIsNotKey(_0x88dcaa,_0x914218['servicenowAccounts'],'id');for(var _0x228922=0x0,_0x15eae1={},_0x497771={};_0x228922<_0x88dcaa[_0xfb9f('0x40')];_0x228922+=0x1){_0x15eae1=_0x88dcaa[_0x228922];if(_['isUndefined'](_0x914218[_0xfb9f('0x1f')][_0x15eae1['id']])){_0x914218[_0xfb9f('0x1f')][_0x15eae1['id']]=new ServicenowAccount(_0x15eae1);}else{_0x914218['mergeFromDatabase'](_0x914218['servicenowAccounts'][_0x15eae1['id']],_0x15eae1);}}}return _0x914218['servicenowAccounts'];};};Realtime[_0xfb9f('0x3b')]['initDynamics365Accounts']=function(){var _0x35a14b=this;return function(_0x5ce09e){if(_0x5ce09e){freeIsNotKey(_0x5ce09e,_0x35a14b[_0xfb9f('0x4b')],'id');for(var _0x28de69=0x0,_0x20c228={},_0x538593={};_0x28de69<_0x5ce09e[_0xfb9f('0x40')];_0x28de69+=0x1){_0x20c228=_0x5ce09e[_0x28de69];if(_['isUndefined'](_0x35a14b['dynamics365Accounts'][_0x20c228['id']])){_0x35a14b['dynamics365Accounts'][_0x20c228['id']]=new Dynamics365Account(_0x20c228);}else{_0x35a14b[_0xfb9f('0x3c')](_0x35a14b[_0xfb9f('0x4b')][_0x20c228['id']],_0x20c228);}}}return _0x35a14b[_0xfb9f('0x4b')];};};Realtime['prototype'][_0xfb9f('0x4c')]=function(){var _0x54d728=this;return function(_0x4dfd68){if(_0x4dfd68){freeIsNotKey(_0x4dfd68,_0x54d728[_0xfb9f('0x20')],'id');for(var _0x554845=0x0,_0x26ecff={},_0x39a76={};_0x554845<_0x4dfd68[_0xfb9f('0x40')];_0x554845+=0x1){_0x26ecff=_0x4dfd68[_0x554845];if(_['isUndefined'](_0x54d728['freshsalesAccounts'][_0x26ecff['id']])){_0x54d728[_0xfb9f('0x20')][_0x26ecff['id']]=new FreshsalesAccount(_0x26ecff);}else{_0x54d728[_0xfb9f('0x3c')](_0x54d728['freshsalesAccounts'][_0x26ecff['id']],_0x26ecff);}}}return _0x54d728['freshsalesAccounts'];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x269f1f=this;return function(_0x7f2660){for(var _0x50a7ae=0x0;_0x50a7ae<_0x7f2660[_0xfb9f('0x40')];_0x50a7ae+=0x1){_[_0xfb9f('0x4d')](_0x269f1f[_0xfb9f('0x41')][_0x7f2660[_0x50a7ae][_0xfb9f('0x25')]],_0x7f2660[_0x50a7ae]);}return _0x269f1f[_0xfb9f('0x41')];};};Realtime[_0xfb9f('0x3b')]['initVoiceQueueReports']=function(){var _0x5a4b7e=this;return function(_0x4d1168){clearVoiceQueues(_0x5a4b7e[_0xfb9f('0x41')]);if(_0x4d1168){_0x4d1168=_['groupBy'](_0x4d1168,_0xfb9f('0x4e'));for(var _0x5cf735 in _0x4d1168){if(_0x4d1168[_0xfb9f('0x28')](_0x5cf735)){var _0x2ea437={};for(var _0x155694=0x0;_0x155694<_0x4d1168[_0x5cf735][_0xfb9f('0x40')];_0x155694+=0x1){var _0x4794e9=_0x4d1168[_0x5cf735][_0x155694]['queue'];if(_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9]){if(_0x4d1168[_0x5cf735][_0x155694]['queuecallerexit']){_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9][_0xfb9f('0x4f')]+=0x1;}if(_0x4d1168[_0x5cf735][_0x155694][_0xfb9f('0x50')]){_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9][_0xfb9f('0x51')]+=0x1;}_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9][_0xfb9f('0x2b')]+=moment(_0x4d1168[_0x5cf735][_0x155694][_0xfb9f('0x52')])['diff'](moment(_0x4d1168[_0x5cf735][_0x155694][_0xfb9f('0x53')]),_0xfb9f('0x54'))||0x0;if(_0x155694===_0x4d1168[_0x5cf735][_0xfb9f('0x40')]-0x1){_0x5a4b7e['voiceQueues'][_0x4794e9][_0xfb9f('0x2f')]+=moment(_0x4d1168[_0x5cf735][_0x155694]['queuecallercompleteAt']||_0x4d1168[_0x5cf735][_0x155694]['queuecallerabandonAt']||_0x4d1168[_0x5cf735][_0x155694]['queuecallerexitAt'])[_0xfb9f('0x55')](moment(_0x4d1168[_0x5cf735][_0x155694][_0xfb9f('0x53')]),_0xfb9f('0x54'))||0x0;_0x5a4b7e['voiceQueues'][_0x4794e9]['total']+=0x1;if(_0x4d1168[_0x5cf735][_0x155694][_0xfb9f('0x56')]){_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9][_0xfb9f('0x2a')]+=0x1;_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9][_0xfb9f('0x30')]+=moment(_0x4d1168[_0x5cf735][_0x155694][_0xfb9f('0x57')])['diff'](moment(_0x4d1168[_0x5cf735][_0x155694][_0xfb9f('0x52')]),'seconds')||0x0;}}else{_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9][_0xfb9f('0x2f')]+=_0x5a4b7e[_0xfb9f('0x41')][_0x4794e9][_0xfb9f('0x2b')]||0x0;}}}}}}return _0x5a4b7e[_0xfb9f('0x41')];};};Realtime[_0xfb9f('0x3b')]['initVoiceCallReports']=function(){var _0x3cf69a=this;return function(_0x10d5f4){clearVoiceCallReports(_0x3cf69a[_0xfb9f('0x58')]);if(_0x10d5f4){for(var _0x161656=0x0;_0x161656<_0x10d5f4['length'];_0x161656+=0x1){_0x3cf69a[_0xfb9f('0x58')][_0xfb9f('0x29')]+=0x1;_0x3cf69a[_0xfb9f('0x58')][_0xfb9f('0x2f')]+=_0x10d5f4[_0x161656]['duration'];if(_0x10d5f4[_0x161656][_0xfb9f('0x59')]===_0xfb9f('0x5a')){_0x3cf69a[_0xfb9f('0x58')][_0xfb9f('0x2a')]+=0x1;_0x3cf69a['outbound'][_0xfb9f('0x2b')]+=_0x10d5f4[_0x161656][_0xfb9f('0x5b')]-_0x10d5f4[_0x161656]['billableseconds']||0x0;_0x3cf69a['outbound'][_0xfb9f('0x30')]+=_0x10d5f4[_0x161656][_0xfb9f('0x5c')];}}}return _0x3cf69a[_0xfb9f('0x58')];};};Realtime['prototype'][_0xfb9f('0x5d')]=function(){var _0x4358d7=this;return function(_0x1fabd2){if(_0x1fabd2){freeIsNotKey(_0x1fabd2,_0x4358d7[_0xfb9f('0x15')],'name');for(var _0x59345f=0x0,_0x2075f0={};_0x59345f<_0x1fabd2['length'];_0x59345f+=0x1){_0x2075f0=_0x1fabd2[_0x59345f];if(_['isUndefined'](_0x4358d7[_0xfb9f('0x15')][_0x2075f0[_0xfb9f('0x25')]])){_0x4358d7[_0xfb9f('0x15')][_0x2075f0[_0xfb9f('0x25')]]=new Campaign(_0x2075f0);}else{_0x4358d7[_0xfb9f('0x3c')](_0x4358d7['campaigns'][_0x2075f0[_0xfb9f('0x25')]],_0x2075f0);_0x4358d7[_0xfb9f('0x15')][_0x2075f0[_0xfb9f('0x25')]][_0xfb9f('0x5e')]=_0x2075f0[_0xfb9f('0x5f')]?_0x2075f0[_0xfb9f('0x5f')][_0xfb9f('0x25')]:undefined;}}}return _0x4358d7[_0xfb9f('0x15')];};};Realtime[_0xfb9f('0x3b')]['initVoiceExtensions']=function(){var _0x21a1e7=this;return function(_0x2566d2){if(_0x2566d2){freeIsNotKey(_0x2566d2,_0x21a1e7[_0xfb9f('0x60')],'id');for(var _0x4b0ab6=0x0,_0x139ba0={};_0x4b0ab6<_0x2566d2[_0xfb9f('0x40')];_0x4b0ab6+=0x1){_0x139ba0=_0x2566d2[_0x4b0ab6];if(_[_0xfb9f('0x3d')](_0x21a1e7[_0xfb9f('0x60')][_0x139ba0['id']])){_0x21a1e7[_0xfb9f('0x60')][_0x139ba0['id']]=new VoiceExtension(_0x139ba0);}else{_0x21a1e7[_0xfb9f('0x3c')](_0x21a1e7['voiceExtensions'][_0x139ba0['id']],_0x139ba0);}}}return _0x21a1e7[_0xfb9f('0x60')];};};Realtime['prototype'][_0xfb9f('0x61')]=function(){var _0x15948e=this;return function(_0x283240){clearCampaigns(_0x15948e[_0xfb9f('0x15')]);for(var _0x59c3e4=0x0;_0x59c3e4<_0x283240[_0xfb9f('0x40')];_0x59c3e4+=0x1){_['merge'](_0x15948e[_0xfb9f('0x15')][_0x283240[_0x59c3e4][_0xfb9f('0x25')]],_0x283240[_0x59c3e4]);}return _0x15948e[_0xfb9f('0x15')];};};Realtime[_0xfb9f('0x3b')][_0xfb9f('0x62')]=function(){var _0x162308=this;return function(_0x281800){if(_0x281800){freeIsNotKey(_0x281800,_0x162308['faxAccounts'],'id');for(var _0x3c416d=0x0,_0x15e6a5={},_0x46fcb0={};_0x3c416d<_0x281800[_0xfb9f('0x40')];_0x3c416d+=0x1){_0x15e6a5=_0x281800[_0x3c416d];if(_[_0xfb9f('0x3d')](_0x162308[_0xfb9f('0x21')][_0x15e6a5['id']])){_0x162308[_0xfb9f('0x21')][_0x15e6a5['id']]=new FaxAccount(_0x15e6a5);}else{_0x162308[_0xfb9f('0x3c')](_0x162308[_0xfb9f('0x21')][_0x15e6a5['id']],_0x15e6a5);}}}return _0x162308[_0xfb9f('0x21')];};};module[_0xfb9f('0x63')]=Realtime;
\ No newline at end of file
index ac622c9..c7313ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b8b=['forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','SIP/%s','length','lastAssignedTo','format','queuecallerexit','YYYY-MM-DD\x20HH:mm:ss','match','destination','type','dialer','lastapplication','queue','context','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','create','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','exten','xcally-motion-dialer','voiceAgentReport','isArray'];(function(_0x5491f4,_0x12580a){var _0x2fd517=function(_0x38ed53){while(--_0x38ed53){_0x5491f4['push'](_0x5491f4['shift']());}};_0x2fd517(++_0x12580a);}(_0x3b8b,0xb6));var _0xb3b8=function(_0x19efbc,_0x10b7d7){_0x19efbc=_0x19efbc-0x0;var _0x205c5e=_0x3b8b[_0x19efbc];return _0x205c5e;};'use strict';var _=require('lodash');var moment=require(_0xb3b8('0x0'));var util=require(_0xb3b8('0x1'));var config=require(_0xb3b8('0x2'));var ami=require(_0xb3b8('0x3'));var RpcVoiceAgentReport=require(_0xb3b8('0x4'));var RpcVoiceCallReport=require(_0xb3b8('0x5'));var RpcVoiceDialReport=require(_0xb3b8('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xb3b8('0x7'));var RpcVoiceRecording=require(_0xb3b8('0x8'));var RpcVoiceTransferReport=require(_0xb3b8('0x9'));var VoiceQueueReport=require(_0xb3b8('0xa'));var VoiceCallReport=require(_0xb3b8('0xb'));var VoiceAgentReport=require(_0xb3b8('0xc'));var VoiceDialReport=require(_0xb3b8('0xd'));var UserReport=require(_0xb3b8('0xe'));function Report(_0x3abedc){this[_0xb3b8('0xf')]=_0x3abedc;this[_0xb3b8('0x10')]=_0x3abedc['agents'];this[_0xb3b8('0x11')]=_0x3abedc[_0xb3b8('0x11')];}Report['prototype'][_0xb3b8('0x12')]=function(_0x5c1534){var _0x5c8101=new VoiceQueueReport(this[_0xb3b8('0xf')]);var _0x3264f7=new VoiceAgentReport(this[_0xb3b8('0xf')]);var _0x4bbeee=new VoiceDialReport(this['realtime']);var _0x4faa37=new VoiceCallReport(this[_0xb3b8('0xf')]);var _0x5e3881=new UserReport(this[_0xb3b8('0xf')]);if(config[_0xb3b8('0x13')]&&config[_0xb3b8('0x13')][_0xb3b8('0x14')]){ami['on'](_0xb3b8('0x15'),this[_0xb3b8('0x16')][_0xb3b8('0x17')](this));ami['on'](_0xb3b8('0x18'),this[_0xb3b8('0x19')][_0xb3b8('0x17')](this));ami['on'](_0xb3b8('0x1a'),this['voiceAgentReport'][_0xb3b8('0x17')](this));ami['on'](_0xb3b8('0x1b'),this[_0xb3b8('0x1c')][_0xb3b8('0x17')](this));ami['on'](_0xb3b8('0x1d'),this[_0xb3b8('0x1e')][_0xb3b8('0x17')](this));ami['on'](_0xb3b8('0x1f'),this[_0xb3b8('0x20')]['bind'](this));}};Report[_0xb3b8('0x21')][_0xb3b8('0x22')]=function(_0xe1212){var _0x3ef3bc;_0x3ef3bc=_[_0xb3b8('0x23')](this[_0xb3b8('0x10')],function(_0x5b0de7){return _0x5b0de7['accountcode']==_0xe1212||_0x5b0de7[_0xb3b8('0x24')]==_0xe1212;});if(_[_0xb3b8('0x25')](_0x3ef3bc)){var _0x30cf41=_['find'](this['telephones'],function(_0x1a9ae0){return _0x1a9ae0[_0xb3b8('0x26')]==_0xe1212||_0x1a9ae0[_0xb3b8('0x24')]==_0xe1212;});if(_0x30cf41){_0x3ef3bc=_[_0xb3b8('0x23')](this[_0xb3b8('0x10')],function(_0x2a1633){return _0x2a1633[_0xb3b8('0x27')]==util['format'](_0xb3b8('0x28'),_0x30cf41[_0xb3b8('0x24')]);});}}return _0x3ef3bc;};Report[_0xb3b8('0x21')]['voiceQueueReport']=function(_0x166e35){for(var _0x1b3bc3=0x0;_0x1b3bc3<_0x166e35[_0xb3b8('0x29')];_0x1b3bc3+=0x1){var _0x442180=this[_0xb3b8('0x22')](_0x166e35[_0x1b3bc3]['connectedlinenum']);if(_0x442180){_0x166e35[_0x1b3bc3][_0xb3b8('0x26')]=_0x442180[_0xb3b8('0x26')];_0x166e35[_0x1b3bc3]['assigned']=!![];_0x166e35[_0x1b3bc3][_0xb3b8('0x2a')]=_0x442180[_0xb3b8('0x24')];_0x166e35[_0x1b3bc3][_0xb3b8('0x27')]=_[_0xb3b8('0x25')](_0x442180[_0xb3b8('0x27')])?util['format'](_0xb3b8('0x28'),_0x442180['name']):_0x442180[_0xb3b8('0x27')];if(_0x166e35[_0x1b3bc3]['queuecallercomplete']){_0x166e35[_0x1b3bc3]['queuecallercompleteAt']=moment()[_0xb3b8('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x166e35[_0x1b3bc3][_0xb3b8('0x2c')]){_0x166e35[_0x1b3bc3]['queuecallerexitAt']=moment()['format'](_0xb3b8('0x2d'));}RpcMemberReport[_0xb3b8('0x16')](_0x166e35[_0x1b3bc3]);}RpcVoiceQueueReport['create'](_0x166e35[_0x1b3bc3]);}};function extractCalleridNumber(_0x5be13e){var _0x26aa45=_0x5be13e[_0xb3b8('0x2e')](/<(.*?)>/);return _0x26aa45?_0x26aa45[0x1]:_0x5be13e;}Report['prototype'][_0xb3b8('0x19')]=function(_0x3f13b0){_0x3f13b0['destination']=_0x3f13b0[_0xb3b8('0x2f')]||_0x3f13b0['exten'];if(_0x3f13b0[_0xb3b8('0x30')]==_0xb3b8('0x31')){_0x3f13b0[_0xb3b8('0x32')]=_0xb3b8('0x33');_0x3f13b0['lastdata']=_0x3f13b0['queue'];if(_0x3f13b0[_0xb3b8('0x34')]=='from-voip-provider'){_0x3f13b0[_0xb3b8('0x26')]='';_0x3f13b0[_0xb3b8('0x2f')]=extractCalleridNumber(_0x3f13b0['callerid']);}else if(_0x3f13b0[_0xb3b8('0x34')]==_0xb3b8('0x35')){if(_0x3f13b0['destination']=='xcally-motion-preview'){_0x3f13b0[_0xb3b8('0x2f')]=extractCalleridNumber(_0x3f13b0[_0xb3b8('0x36')]);_0x3f13b0[_0xb3b8('0x37')]=_0x3f13b0[_0xb3b8('0x38')];_0x3f13b0[_0xb3b8('0x39')]=[_0x3f13b0[_0xb3b8('0x3a')],_0x3f13b0['channel']=_0x3f13b0[_0xb3b8('0x39')]][0x0];_0x3f13b0[_0xb3b8('0x3b')]=_0x3f13b0[_0xb3b8('0x36')];}else{_0x3f13b0['destination']=_0x3f13b0[_0xb3b8('0x37')];_0x3f13b0['calleridnum']=_0x3f13b0[_0xb3b8('0x38')];if(_0x3f13b0[_0xb3b8('0x3c')]=='ANSWERED'){_0x3f13b0[_0xb3b8('0x26')]=_0x3f13b0[_0xb3b8('0x3d')];}else{_0x3f13b0[_0xb3b8('0x26')]='';}}}}else{_0x3f13b0[_0xb3b8('0x3b')]=util[_0xb3b8('0x2b')](_0xb3b8('0x3e'),_0x3f13b0[_0xb3b8('0x3f')],_0x3f13b0[_0xb3b8('0x37')]);}if(RpcVoiceTransferReport[_0xb3b8('0x40')][_0x3f13b0['linkedid']]){var _0x5b6812=RpcVoiceTransferReport[_0xb3b8('0x40')][_0x3f13b0[_0xb3b8('0x41')]];_0x5b6812['transfereelinkedid']=_0x3f13b0[_0xb3b8('0x42')];RpcVoiceTransferReport[_0xb3b8('0x1e')](_0x5b6812);delete RpcVoiceTransferReport['transfers'][_0x3f13b0[_0xb3b8('0x41')]];}RpcVoiceCallReport[_0xb3b8('0x43')](_0x3f13b0);if(_0x3f13b0[_0xb3b8('0x44')]){for(var _0x461380=0x0;_0x461380<_0x3f13b0[_0xb3b8('0x45')][_0xb3b8('0x29')];_0x461380+=0x1){_0x3f13b0[_0xb3b8('0x46')]=_0x3f13b0[_0xb3b8('0x45')][_0x461380][_0xb3b8('0x47')];_0x3f13b0[_0xb3b8('0x48')]=_0x3f13b0[_0xb3b8('0x45')][_0x461380]['createdAt'];if(_0x3f13b0['exten']==_0xb3b8('0x49')){_0x3f13b0[_0xb3b8('0x37')]=_0x3f13b0[_0xb3b8('0x3d')];_0x3f13b0[_0xb3b8('0x3f')]=_0x3f13b0['connectedlinename'];_0x3f13b0['connectedlinenum']=_0x3f13b0[_0xb3b8('0x26')];_0x3f13b0[_0xb3b8('0x4a')]=_0x3f13b0['membername'];_0x3f13b0[_0xb3b8('0x4b')]=_0x3f13b0[_0xb3b8('0x38')];}else if(_0x3f13b0[_0xb3b8('0x4b')]==_0xb3b8('0x4c')){_0x3f13b0[_0xb3b8('0x37')]=_0x3f13b0[_0xb3b8('0x2f')];_0x3f13b0[_0xb3b8('0x4b')]=_0x3f13b0[_0xb3b8('0x38')];}RpcVoiceRecording[_0xb3b8('0x43')](_0x3f13b0);}}};Report[_0xb3b8('0x21')][_0xb3b8('0x4d')]=function(_0x5a0418){if(_[_0xb3b8('0x4e')](_0x5a0418)){_0x5a0418[_0xb3b8('0x4f')](function(_0x433c1a){RpcVoiceAgentReport['create'](_0x433c1a);});}else{RpcVoiceAgentReport[_0xb3b8('0x43')](_0x5a0418);}};Report[_0xb3b8('0x21')]['voiceDialReport']=function(_0x2a0a61){RpcVoiceDialReport[_0xb3b8('0x43')](_0x2a0a61);var _0x4274f7;var _0x10910f;var _0x5e673a=_0x2a0a61[_0xb3b8('0x3a')];if(_['startsWith'](_0x5e673a,_0xb3b8('0x50'))){_0x10910f=_0x5e673a[_0xb3b8('0x51')](_0x5e673a[_0xb3b8('0x52')]('/')+0x1,_0x5e673a[_0xb3b8('0x52')]('@'));_0x4274f7=_[_0xb3b8('0x23')](this['agents'],function(_0x8ce72){return _0x8ce72[_0xb3b8('0x53')]==_0x10910f||_0x8ce72[_0xb3b8('0x54')]==_0x10910f||_0x8ce72[_0xb3b8('0x26')]==_0x10910f;});}else{_0x10910f=_0x5e673a[_0xb3b8('0x51')](_0x5e673a[_0xb3b8('0x52')]('/')+0x1,_0x5e673a[_0xb3b8('0x55')]('-'));_0x4274f7=this[_0xb3b8('0x22')](_0x10910f);}if(_0x4274f7){_0x2a0a61[_0xb3b8('0x27')]=_['isNil'](_0x4274f7[_0xb3b8('0x27')])?util[_0xb3b8('0x2b')](_0xb3b8('0x28'),_0x4274f7['name']):_0x4274f7['interface'];_0x2a0a61['membername']=_0x4274f7[_0xb3b8('0x24')];_0x2a0a61[_0xb3b8('0x26')]=_0x4274f7[_0xb3b8('0x26')];RpcMemberReport['voiceDialReport'](_0x2a0a61);}};Report['prototype']['blindTransfer']=function(_0x483d51){RpcVoiceTransferReport[_0xb3b8('0x40')][_0x483d51[_0xb3b8('0x56')]]=_0x483d51;};Report[_0xb3b8('0x21')]['attendedTransfer']=function(_0x1a6f90){RpcVoiceTransferReport['attendedTransfer'](_0x1a6f90);};module['exports']=Report;
\ No newline at end of file
+var _0xa896=['callerid','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','create','Local','substring','indexOf','mobile','voiceDialReport','exports','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','dialer','lastapplication','queue','lastdata','context'];(function(_0x1d2fd3,_0x2c7964){var _0x572987=function(_0x41c7f2){while(--_0x41c7f2){_0x1d2fd3['push'](_0x1d2fd3['shift']());}};_0x572987(++_0x2c7964);}(_0xa896,0x1b2));var _0x6a89=function(_0x52fcae,_0x5617d6){_0x52fcae=_0x52fcae-0x0;var _0x141998=_0xa896[_0x52fcae];return _0x141998;};'use strict';var _=require('lodash');var moment=require(_0x6a89('0x0'));var util=require(_0x6a89('0x1'));var config=require(_0x6a89('0x2'));var ami=require(_0x6a89('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x6a89('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x6a89('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x6a89('0x6'));var VoiceCallReport=require(_0x6a89('0x7'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x6a89('0x8'));var UserReport=require(_0x6a89('0x9'));function Report(_0xd6074b){this['realtime']=_0xd6074b;this[_0x6a89('0xa')]=_0xd6074b[_0x6a89('0xa')];this[_0x6a89('0xb')]=_0xd6074b[_0x6a89('0xb')];}Report[_0x6a89('0xc')][_0x6a89('0xd')]=function(_0x18aeb0){var _0x2e4719=new VoiceQueueReport(this[_0x6a89('0xe')]);var _0x40afd5=new VoiceAgentReport(this[_0x6a89('0xe')]);var _0x49c670=new VoiceDialReport(this[_0x6a89('0xe')]);var _0x115a47=new VoiceCallReport(this[_0x6a89('0xe')]);var _0xd2b960=new UserReport(this[_0x6a89('0xe')]);if(config[_0x6a89('0xf')]&&config[_0x6a89('0xf')][_0x6a89('0x10')]){ami['on'](_0x6a89('0x11'),this['voiceQueueReport'][_0x6a89('0x12')](this));ami['on'](_0x6a89('0x13'),this['voiceCallReport'][_0x6a89('0x12')](this));ami['on'](_0x6a89('0x14'),this[_0x6a89('0x15')][_0x6a89('0x12')](this));ami['on'](_0x6a89('0x16'),this['voiceDialReport'][_0x6a89('0x12')](this));ami['on'](_0x6a89('0x17'),this[_0x6a89('0x18')][_0x6a89('0x12')](this));ami['on']('attendedtransfer',this[_0x6a89('0x19')][_0x6a89('0x12')](this));}};Report[_0x6a89('0xc')][_0x6a89('0x1a')]=function(_0x130b72){var _0xd698b;_0xd698b=_['find'](this[_0x6a89('0xa')],function(_0x3be9c8){return _0x3be9c8[_0x6a89('0x1b')]==_0x130b72||_0x3be9c8[_0x6a89('0x1c')]==_0x130b72;});if(_[_0x6a89('0x1d')](_0xd698b)){var _0xfa0f9e=_[_0x6a89('0x1e')](this['telephones'],function(_0x255e92){return _0x255e92[_0x6a89('0x1b')]==_0x130b72||_0x255e92[_0x6a89('0x1c')]==_0x130b72;});if(_0xfa0f9e){_0xd698b=_[_0x6a89('0x1e')](this[_0x6a89('0xa')],function(_0x437976){return _0x437976[_0x6a89('0x1f')]==util[_0x6a89('0x20')]('SIP/%s',_0xfa0f9e[_0x6a89('0x1c')]);});}}return _0xd698b;};Report[_0x6a89('0xc')][_0x6a89('0x21')]=function(_0x57c15c){for(var _0x1f5b14=0x0;_0x1f5b14<_0x57c15c[_0x6a89('0x22')];_0x1f5b14+=0x1){var _0x1f1f6b=this[_0x6a89('0x1a')](_0x57c15c[_0x1f5b14][_0x6a89('0x23')]);if(_0x1f1f6b){_0x57c15c[_0x1f5b14][_0x6a89('0x1b')]=_0x1f1f6b[_0x6a89('0x1b')];_0x57c15c[_0x1f5b14][_0x6a89('0x24')]=!![];_0x57c15c[_0x1f5b14][_0x6a89('0x25')]=_0x1f1f6b['name'];_0x57c15c[_0x1f5b14][_0x6a89('0x1f')]=_[_0x6a89('0x1d')](_0x1f1f6b[_0x6a89('0x1f')])?util[_0x6a89('0x20')](_0x6a89('0x26'),_0x1f1f6b[_0x6a89('0x1c')]):_0x1f1f6b['interface'];if(_0x57c15c[_0x1f5b14][_0x6a89('0x27')]){_0x57c15c[_0x1f5b14][_0x6a89('0x28')]=moment()[_0x6a89('0x20')](_0x6a89('0x29'));}if(_0x57c15c[_0x1f5b14][_0x6a89('0x2a')]){_0x57c15c[_0x1f5b14][_0x6a89('0x2b')]=moment()[_0x6a89('0x20')](_0x6a89('0x29'));}RpcMemberReport['voiceQueueReport'](_0x57c15c[_0x1f5b14]);}RpcVoiceQueueReport['create'](_0x57c15c[_0x1f5b14]);}};function extractCalleridNumber(_0x2fa345){var _0x5c0f51=_0x2fa345[_0x6a89('0x2c')](/<(.*?)>/);return _0x5c0f51?_0x5c0f51[0x1]:_0x2fa345;}Report[_0x6a89('0xc')]['voiceCallReport']=function(_0x57d5dc){_0x57d5dc['destination']=_0x57d5dc[_0x6a89('0x2d')]||_0x57d5dc[_0x6a89('0x2e')];if(_0x57d5dc['type']==_0x6a89('0x2f')){_0x57d5dc[_0x6a89('0x30')]=_0x6a89('0x31');_0x57d5dc[_0x6a89('0x32')]=_0x57d5dc[_0x6a89('0x31')];if(_0x57d5dc[_0x6a89('0x33')]=='from-voip-provider'){_0x57d5dc[_0x6a89('0x1b')]='';_0x57d5dc[_0x6a89('0x2d')]=extractCalleridNumber(_0x57d5dc[_0x6a89('0x34')]);}else if(_0x57d5dc[_0x6a89('0x33')]=='from-sip'){if(_0x57d5dc[_0x6a89('0x2d')]==_0x6a89('0x35')){_0x57d5dc[_0x6a89('0x2d')]=extractCalleridNumber(_0x57d5dc['calleridpreview']);_0x57d5dc[_0x6a89('0x36')]=_0x57d5dc[_0x6a89('0x37')];_0x57d5dc[_0x6a89('0x38')]=[_0x57d5dc[_0x6a89('0x39')],_0x57d5dc[_0x6a89('0x39')]=_0x57d5dc[_0x6a89('0x38')]][0x0];_0x57d5dc[_0x6a89('0x34')]=_0x57d5dc[_0x6a89('0x3a')];}else{_0x57d5dc[_0x6a89('0x2d')]=_0x57d5dc[_0x6a89('0x36')];_0x57d5dc[_0x6a89('0x36')]=_0x57d5dc['originatecalleridnum'];if(_0x57d5dc['disposition']==_0x6a89('0x3b')){_0x57d5dc[_0x6a89('0x1b')]=_0x57d5dc[_0x6a89('0x23')];}else{_0x57d5dc['accountcode']='';}}}}else{_0x57d5dc['callerid']=util[_0x6a89('0x20')](_0x6a89('0x3c'),_0x57d5dc['calleridname'],_0x57d5dc[_0x6a89('0x36')]);}if(RpcVoiceTransferReport[_0x6a89('0x3d')][_0x57d5dc[_0x6a89('0x3e')]]){var _0x5bb87c=RpcVoiceTransferReport[_0x6a89('0x3d')][_0x57d5dc['linkedid']];_0x5bb87c[_0x6a89('0x3f')]=_0x57d5dc[_0x6a89('0x40')];RpcVoiceTransferReport[_0x6a89('0x18')](_0x5bb87c);delete RpcVoiceTransferReport[_0x6a89('0x3d')][_0x57d5dc[_0x6a89('0x3e')]];}RpcVoiceCallReport['create'](_0x57d5dc);if(_0x57d5dc[_0x6a89('0x41')]){for(var _0x10f174=0x0;_0x10f174<_0x57d5dc[_0x6a89('0x42')][_0x6a89('0x22')];_0x10f174+=0x1){_0x57d5dc[_0x6a89('0x43')]=_0x57d5dc[_0x6a89('0x42')][_0x10f174][_0x6a89('0x44')];_0x57d5dc[_0x6a89('0x45')]=_0x57d5dc[_0x6a89('0x42')][_0x10f174][_0x6a89('0x45')];if(_0x57d5dc['exten']==_0x6a89('0x35')){_0x57d5dc[_0x6a89('0x36')]=_0x57d5dc[_0x6a89('0x23')];_0x57d5dc['calleridname']=_0x57d5dc['connectedlinename'];_0x57d5dc[_0x6a89('0x23')]=_0x57d5dc[_0x6a89('0x1b')];_0x57d5dc[_0x6a89('0x46')]=_0x57d5dc[_0x6a89('0x47')];_0x57d5dc[_0x6a89('0x2e')]=_0x57d5dc[_0x6a89('0x37')];}else if(_0x57d5dc['exten']==_0x6a89('0x48')){_0x57d5dc[_0x6a89('0x36')]=_0x57d5dc[_0x6a89('0x2d')];_0x57d5dc[_0x6a89('0x2e')]=_0x57d5dc[_0x6a89('0x37')];}RpcVoiceRecording['create'](_0x57d5dc);}}};Report[_0x6a89('0xc')][_0x6a89('0x15')]=function(_0x392c1b){if(_['isArray'](_0x392c1b)){_0x392c1b[_0x6a89('0x49')](function(_0x1d100a){RpcVoiceAgentReport[_0x6a89('0x4a')](_0x1d100a);});}else{RpcVoiceAgentReport[_0x6a89('0x4a')](_0x392c1b);}};Report[_0x6a89('0xc')]['voiceDialReport']=function(_0x279395){RpcVoiceDialReport[_0x6a89('0x4a')](_0x279395);var _0x415ae9;var _0x25cb78;var _0xb11775=_0x279395[_0x6a89('0x39')];if(_['startsWith'](_0xb11775,_0x6a89('0x4b'))){_0x25cb78=_0xb11775[_0x6a89('0x4c')](_0xb11775[_0x6a89('0x4d')]('/')+0x1,_0xb11775['indexOf']('@'));_0x415ae9=_[_0x6a89('0x1e')](this['agents'],function(_0x3b072c){return _0x3b072c[_0x6a89('0x4e')]==_0x25cb78||_0x3b072c['phone']==_0x25cb78||_0x3b072c['accountcode']==_0x25cb78;});}else{_0x25cb78=_0xb11775['substring'](_0xb11775[_0x6a89('0x4d')]('/')+0x1,_0xb11775['lastIndexOf']('-'));_0x415ae9=this[_0x6a89('0x1a')](_0x25cb78);}if(_0x415ae9){_0x279395[_0x6a89('0x1f')]=_[_0x6a89('0x1d')](_0x415ae9[_0x6a89('0x1f')])?util[_0x6a89('0x20')]('SIP/%s',_0x415ae9['name']):_0x415ae9[_0x6a89('0x1f')];_0x279395[_0x6a89('0x47')]=_0x415ae9[_0x6a89('0x1c')];_0x279395[_0x6a89('0x1b')]=_0x415ae9[_0x6a89('0x1b')];RpcMemberReport[_0x6a89('0x4f')](_0x279395);}};Report[_0x6a89('0xc')][_0x6a89('0x18')]=function(_0x2629ef){RpcVoiceTransferReport['transfers'][_0x2629ef['transfererlinkedid']]=_0x2629ef;};Report[_0x6a89('0xc')][_0x6a89('0x19')]=function(_0x5cc201){RpcVoiceTransferReport['attendedTransfer'](_0x5cc201);};module[_0x6a89('0x50')]=Report;
\ No newline at end of file
index a1610fe..8099df7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc38e=['../../../config/environment','defaults','localhost','socket.io-emitter','redis','trunks','agents','telephones','registryentry','bind','registry','devicestatechange','peerstatus','syncRealtimeShow','resolve','then','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','syncRegistry','isNotNull','info','state','debug','[userReport][registry]','find','username','stateRegistry','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','format','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','Local','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','peer','address','[userReport][peerstatus]','registered','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','ioredis'];(function(_0x35500a,_0x1105aa){var _0x88baa0=function(_0x9af99){while(--_0x9af99){_0x35500a['push'](_0x35500a['shift']());}};_0x88baa0(++_0x1105aa);}(_0xc38e,0x115));var _0xec38=function(_0x5318e8,_0x101117){_0x5318e8=_0x5318e8-0x0;var _0x573b81=_0xc38e[_0x5318e8];return _0x573b81;};'use strict';var _=require('lodash');var moment=require(_0xec38('0x0'));var util=require(_0xec38('0x1'));var Redis=require(_0xec38('0x2'));var BPromise=require('bluebird');var config=require(_0xec38('0x3'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');config['redis']=_[_0xec38('0x4')](config['redis'],{'host':_0xec38('0x5'),'port':0x18eb});var io=require(_0xec38('0x6'))(new Redis(config[_0xec38('0x7')]));function UserReport(_0x3a198e){this['trunks']=_0x3a198e[_0xec38('0x8')];this[_0xec38('0x9')]=_0x3a198e[_0xec38('0x9')];this[_0xec38('0xa')]=_0x3a198e[_0xec38('0xa')];ami['on'](_0xec38('0xb'),this['syncRegistry'][_0xec38('0xc')](this));ami['on'](_0xec38('0xd'),this['syncRegistry'][_0xec38('0xc')](this));ami['on'](_0xec38('0xe'),this['syncDeviceState'][_0xec38('0xc')](this));ami['on'](_0xec38('0xf'),this['syncPeerStatus'][_0xec38('0xc')](this));return this[_0xec38('0x10')]();}function showSipRegistrations(){Promise[_0xec38('0x11')]()[_0xec38('0x12')](ami['actionSipShowRegistry']())[_0xec38('0x13')](function(_0x4f6ac6){logger[_0xec38('0x14')]('[userReport][sipshowregistry]',util[_0xec38('0x15')](_0x4f6ac6,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xec38('0x11')]()[_0xec38('0x12')](ami[_0xec38('0x16')]())[_0xec38('0x13')](function(_0x4987b7){logger[_0xec38('0x14')](_0xec38('0x17'),util['inspect'](_0x4987b7,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xec38('0x11')]()[_0xec38('0x12')](ami[_0xec38('0x18')]())[_0xec38('0x13')](function(_0x577db1){logger['error'](_0xec38('0x19'),util['inspect'](_0x577db1,{'showHidden':![],'depth':null}));});}UserReport[_0xec38('0x1a')][_0xec38('0x10')]=function(){setInterval(function(){BPromise[_0xec38('0x11')]()[_0xec38('0x12')](showSipRegistrations())[_0xec38('0x12')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xec38('0x1a')]['isNotNull']=function(_0x517754){return _0x517754!==null&&!_[_0xec38('0x1b')](_0x517754);};UserReport['prototype'][_0xec38('0x1c')]=function(_0x500f79,_0x590b72,_0x347fb4){io['to'](_0x500f79)[_0xec38('0x1c')](_0x590b72,_0x347fb4);};UserReport[_0xec38('0x1a')][_0xec38('0x1d')]=function(_0x216464){try{if(this[_0xec38('0x1e')](_0x216464)){logger[_0xec38('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x216464['username'],_0x216464[_0xec38('0x20')]);logger[_0xec38('0x21')](_0xec38('0x22'),util[_0xec38('0x15')](_0x216464,{'showHidden':![],'depth':null}));var _0x30326=_[_0xec38('0x23')](this[_0xec38('0x8')],{'defaultuser':_0x216464[_0xec38('0x24')]});if(_0x30326){_0x216464[_0xec38('0x25')]=_0x216464[_0xec38('0x20')];_['merge'](_0x30326,_[_0xec38('0x26')](_0x216464,['event',_0xec38('0x27'),_0xec38('0x24'),'state']));logger['debug'](_0xec38('0x28'),util[_0xec38('0x15')](_0x30326,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xec38('0x29'),_0x30326['name']),_0xec38('0x2a'),_0x30326);}}}catch(_0x3b45ae){logger[_0xec38('0x14')]('[userReport][registry]',util['inspect'](_0x3b45ae,{'showHidden':![],'depth':null}));}};UserReport[_0xec38('0x1a')]['syncDeviceState']=function(_0x1a9249){try{if(this[_0xec38('0x1e')](_0x1a9249)){logger[_0xec38('0x1f')](_0xec38('0x2b'),_0x1a9249[_0xec38('0x2c')],_0x1a9249[_0xec38('0x20')]);logger['debug'](_0xec38('0x2d'),util[_0xec38('0x15')](_0x1a9249,{'showHidden':![],'depth':null}));if(this[_0xec38('0x9')][_0x1a9249[_0xec38('0x2c')]]){if(!this[_0xec38('0x9')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x2e')]||_0x1a9249['state'][_0xec38('0x2f')]()==_0xec38('0x30')){this[_0xec38('0x9')][_0x1a9249[_0xec38('0x2c')]]['local']=![];if(this[_0xec38('0x9')][_0x1a9249['device']]['state']!==_0x1a9249[_0xec38('0x20')][_0xec38('0x2f')]()){this[_0xec38('0x9')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x31')]=_[_0xec38('0x32')](moment()[_0xec38('0x33')]('x'));}this[_0xec38('0x9')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x20')]=_0x1a9249[_0xec38('0x20')][_0xec38('0x2f')]();this[_0xec38('0x9')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x34')](_0x1a9249);}}else if(this[_0xec38('0xa')][_0x1a9249['device']]){if(this[_0xec38('0xa')][_0x1a9249['device']][_0xec38('0x20')]!==_0x1a9249[_0xec38('0x20')][_0xec38('0x2f')]()){this[_0xec38('0xa')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x31')]=_['toNumber'](moment()['format']('x'));}this['telephones'][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x20')]=_0x1a9249[_0xec38('0x20')][_0xec38('0x2f')]();logger[_0xec38('0x21')](_0xec38('0x35'),util[_0xec38('0x15')](this[_0xec38('0xa')][_0x1a9249['device']],{'showHidden':![],'depth':null}));this[_0xec38('0x1c')](util[_0xec38('0x33')](_0xec38('0x36'),this[_0xec38('0xa')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x37')]),_0xec38('0x38'),this[_0xec38('0xa')][_0x1a9249[_0xec38('0x2c')]]);}else if(this[_0xec38('0x8')][_0x1a9249[_0xec38('0x2c')]]){if(this[_0xec38('0x8')][_0x1a9249['device']]['state']!==_0x1a9249[_0xec38('0x20')][_0xec38('0x2f')]()){this[_0xec38('0x8')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x31')]=_['toNumber'](moment()['format']('x'));}this[_0xec38('0x8')][_0x1a9249[_0xec38('0x2c')]][_0xec38('0x20')]=_0x1a9249['state'][_0xec38('0x2f')]();logger[_0xec38('0x21')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xec38('0x15')](this['trunks'][_0x1a9249[_0xec38('0x2c')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xec38('0x29'),this[_0xec38('0x8')][_0x1a9249['device']][_0xec38('0x37')]),_0xec38('0x2a'),this[_0xec38('0x8')][_0x1a9249[_0xec38('0x2c')]]);}else if(_['startsWith'](_0x1a9249['device'],_0xec38('0x39'))){var _0x1253f6=_0x1a9249[_0xec38('0x2c')];var _0x195f65=_0x1253f6[_0xec38('0x3a')](_0x1253f6['indexOf']('/')+0x1,_0x1253f6[_0xec38('0x3b')]('@'));var _0xc963c3=_[_0xec38('0x23')](this[_0xec38('0x9')],function(_0x546048){return _0x546048[_0xec38('0x3c')]==_0x195f65||_0x546048[_0xec38('0x3d')]==_0x195f65||_0x546048[_0xec38('0x3e')]==_0x195f65;});if(_0xc963c3){if(_0xc963c3[_0xec38('0x20')]!==_0x1a9249['state']['toLowerCase']()){_0xc963c3[_0xec38('0x31')]=_['toNumber'](moment()[_0xec38('0x33')]('x'));}_0xc963c3['state']=_0x1a9249[_0xec38('0x20')][_0xec38('0x2f')]();_0xc963c3[_0xec38('0x2e')]=!![];_0xc963c3[_0xec38('0x34')](_0x1a9249);}}}}catch(_0x392636){logger[_0xec38('0x14')](_0xec38('0x2d'),util[_0xec38('0x15')](_0x392636,{'showHidden':![],'depth':null}));}};UserReport[_0xec38('0x1a')][_0xec38('0x3f')]=function(_0x42f9f0){try{if(this[_0xec38('0x1e')](_0x42f9f0)&&this[_0xec38('0x1e')](_0x42f9f0[_0xec38('0xf')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x42f9f0[_0xec38('0x40')],_0x42f9f0[_0xec38('0x41')],_0x42f9f0[_0xec38('0xf')]);logger['debug'](_0xec38('0x42'),util['inspect'](_0x42f9f0,{'showHidden':![],'depth':null}));if(this[_0xec38('0x9')][_0x42f9f0[_0xec38('0x40')]]){if(!this[_0xec38('0x9')][_0x42f9f0[_0xec38('0x40')]][_0xec38('0x2e')]||_0x42f9f0[_0xec38('0xf')][_0xec38('0x2f')]()==_0xec38('0x43')){this['agents'][_0x42f9f0[_0xec38('0x40')]][_0xec38('0x2e')]=![];this['agents'][_0x42f9f0['peer']]['status']=_0x42f9f0['peerstatus'][_0xec38('0x2f')]();this[_0xec38('0x9')][_0x42f9f0[_0xec38('0x40')]]['address']=_0x42f9f0[_0xec38('0x41')];this[_0xec38('0x9')][_0x42f9f0[_0xec38('0x40')]]['updateStatusRealtime'](_0x42f9f0);}}else if(this['telephones'][_0x42f9f0[_0xec38('0x40')]]){this[_0xec38('0xa')][_0x42f9f0[_0xec38('0x40')]]['status']=_0x42f9f0[_0xec38('0xf')][_0xec38('0x2f')]();this['telephones'][_0x42f9f0[_0xec38('0x40')]][_0xec38('0x41')]=_0x42f9f0[_0xec38('0x41')];logger[_0xec38('0x21')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xec38('0x15')](this[_0xec38('0xa')][_0x42f9f0[_0xec38('0x40')]],{'showHidden':![],'depth':null}));this[_0xec38('0x1c')](util[_0xec38('0x33')](_0xec38('0x36'),this[_0xec38('0xa')][_0x42f9f0[_0xec38('0x40')]][_0xec38('0x37')]),'telephone:save',this[_0xec38('0xa')][_0x42f9f0[_0xec38('0x40')]]);}else if(this[_0xec38('0x8')][_0x42f9f0[_0xec38('0x40')]]){this[_0xec38('0x8')][_0x42f9f0['peer']]['status']=_0x42f9f0[_0xec38('0xf')]['toLowerCase']();this[_0xec38('0x8')][_0x42f9f0[_0xec38('0x40')]][_0xec38('0x41')]=_0x42f9f0[_0xec38('0x41')];logger[_0xec38('0x21')](_0xec38('0x44'),util[_0xec38('0x15')](this[_0xec38('0x8')][_0x42f9f0['peer']],{'showHidden':![],'depth':null}));this[_0xec38('0x1c')](util[_0xec38('0x33')](_0xec38('0x29'),this['trunks'][_0x42f9f0[_0xec38('0x40')]]['name']),_0xec38('0x2a'),this[_0xec38('0x8')][_0x42f9f0[_0xec38('0x40')]]);}}}catch(_0x3ca545){logger[_0xec38('0x14')](_0xec38('0x42'),util[_0xec38('0x15')](_0x3ca545,{'showHidden':![],'depth':null}));}};module[_0xec38('0x45')]=UserReport;
\ No newline at end of file
+var _0x39d3=['registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','state','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','inuse','stateTime','toNumber','toLowerCase','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','format','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind'];(function(_0x1ceafa,_0x252713){var _0x2cb283=function(_0x3b68c9){while(--_0x3b68c9){_0x1ceafa['push'](_0x1ceafa['shift']());}};_0x2cb283(++_0x252713);}(_0x39d3,0x1cb));var _0x339d=function(_0x4321cc,_0x57451f){_0x4321cc=_0x4321cc-0x0;var _0x5303a2=_0x39d3[_0x4321cc];return _0x5303a2;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x339d('0x0'));var Redis=require(_0x339d('0x1'));var BPromise=require(_0x339d('0x2'));var config=require(_0x339d('0x3'));var logger=require(_0x339d('0x4'))('ami');var ami=require(_0x339d('0x5'));config['redis']=_[_0x339d('0x6')](config[_0x339d('0x7')],{'host':_0x339d('0x8'),'port':0x18eb});var io=require(_0x339d('0x9'))(new Redis(config[_0x339d('0x7')]));function UserReport(_0x3ee22f){this[_0x339d('0xa')]=_0x3ee22f['trunks'];this[_0x339d('0xb')]=_0x3ee22f['agents'];this[_0x339d('0xc')]=_0x3ee22f[_0x339d('0xc')];ami['on']('registryentry',this[_0x339d('0xd')][_0x339d('0xe')](this));ami['on'](_0x339d('0xf'),this[_0x339d('0xd')][_0x339d('0xe')](this));ami['on'](_0x339d('0x10'),this[_0x339d('0x11')][_0x339d('0xe')](this));ami['on'](_0x339d('0x12'),this[_0x339d('0x13')][_0x339d('0xe')](this));return this[_0x339d('0x14')]();}function showSipRegistrations(){Promise[_0x339d('0x15')]()['then'](ami[_0x339d('0x16')]())[_0x339d('0x17')](function(_0x165259){logger[_0x339d('0x18')](_0x339d('0x19'),util[_0x339d('0x1a')](_0x165259,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x339d('0x1b')](ami[_0x339d('0x1c')]())['catch'](function(_0x4e2d0b){logger[_0x339d('0x18')](_0x339d('0x1d'),util[_0x339d('0x1a')](_0x4e2d0b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x339d('0x15')]()['then'](ami[_0x339d('0x1e')]())['catch'](function(_0x4c2829){logger[_0x339d('0x18')](_0x339d('0x1f'),util[_0x339d('0x1a')](_0x4c2829,{'showHidden':![],'depth':null}));});}UserReport[_0x339d('0x20')][_0x339d('0x14')]=function(){setInterval(function(){BPromise[_0x339d('0x15')]()[_0x339d('0x1b')](showSipRegistrations())[_0x339d('0x1b')](listDeviceStates())[_0x339d('0x1b')](showPeersStatus());},0x32c8);};UserReport[_0x339d('0x20')][_0x339d('0x21')]=function(_0x58c011){return _0x58c011!==null&&!_[_0x339d('0x22')](_0x58c011);};UserReport[_0x339d('0x20')]['emit']=function(_0x1081d1,_0x4073b0,_0x7da6ef){io['to'](_0x1081d1)[_0x339d('0x23')](_0x4073b0,_0x7da6ef);};UserReport[_0x339d('0x20')]['syncRegistry']=function(_0x25dac6){try{if(this[_0x339d('0x21')](_0x25dac6)){logger[_0x339d('0x24')](_0x339d('0x25'),_0x25dac6[_0x339d('0x26')],_0x25dac6['state']);logger[_0x339d('0x27')](_0x339d('0x28'),util[_0x339d('0x1a')](_0x25dac6,{'showHidden':![],'depth':null}));var _0x520d07=_[_0x339d('0x29')](this[_0x339d('0xa')],{'defaultuser':_0x25dac6[_0x339d('0x26')]});if(_0x520d07){_0x25dac6[_0x339d('0x2a')]=_0x25dac6[_0x339d('0x2b')];_['merge'](_0x520d07,_[_0x339d('0x2c')](_0x25dac6,[_0x339d('0x2d'),_0x339d('0x2e'),_0x339d('0x26'),_0x339d('0x2b')]));logger[_0x339d('0x27')](_0x339d('0x2f'),util[_0x339d('0x1a')](_0x520d07,{'showHidden':![],'depth':null}));this[_0x339d('0x23')](util['format'](_0x339d('0x30'),_0x520d07[_0x339d('0x31')]),_0x339d('0x32'),_0x520d07);}}}catch(_0x25f298){logger[_0x339d('0x18')](_0x339d('0x28'),util[_0x339d('0x1a')](_0x25f298,{'showHidden':![],'depth':null}));}};UserReport[_0x339d('0x20')][_0x339d('0x11')]=function(_0x5500a7){try{if(this['isNotNull'](_0x5500a7)){logger[_0x339d('0x24')](_0x339d('0x33'),_0x5500a7['device'],_0x5500a7[_0x339d('0x2b')]);logger[_0x339d('0x27')](_0x339d('0x34'),util[_0x339d('0x1a')](_0x5500a7,{'showHidden':![],'depth':null}));if(this['agents'][_0x5500a7[_0x339d('0x35')]]){if(!this[_0x339d('0xb')][_0x5500a7[_0x339d('0x35')]][_0x339d('0x36')]||_0x5500a7['state']['toLowerCase']()==_0x339d('0x37')){this[_0x339d('0xb')][_0x5500a7['device']]['local']=![];if(this[_0x339d('0xb')][_0x5500a7[_0x339d('0x35')]][_0x339d('0x2b')]!==_0x5500a7[_0x339d('0x2b')]['toLowerCase']()){this[_0x339d('0xb')][_0x5500a7[_0x339d('0x35')]][_0x339d('0x38')]=_[_0x339d('0x39')](moment()['format']('x'));}this['agents'][_0x5500a7[_0x339d('0x35')]][_0x339d('0x2b')]=_0x5500a7[_0x339d('0x2b')][_0x339d('0x3a')]();this[_0x339d('0xb')][_0x5500a7['device']][_0x339d('0x3b')](_0x5500a7);}}else if(this[_0x339d('0xc')][_0x5500a7[_0x339d('0x35')]]){if(this[_0x339d('0xc')][_0x5500a7[_0x339d('0x35')]]['state']!==_0x5500a7[_0x339d('0x2b')][_0x339d('0x3a')]()){this[_0x339d('0xc')][_0x5500a7[_0x339d('0x35')]][_0x339d('0x38')]=_[_0x339d('0x39')](moment()['format']('x'));}this[_0x339d('0xc')][_0x5500a7[_0x339d('0x35')]]['state']=_0x5500a7['state'][_0x339d('0x3a')]();logger[_0x339d('0x27')](_0x339d('0x3c'),util[_0x339d('0x1a')](this['telephones'][_0x5500a7['device']],{'showHidden':![],'depth':null}));this[_0x339d('0x23')](util[_0x339d('0x3d')](_0x339d('0x3e'),this[_0x339d('0xc')][_0x5500a7[_0x339d('0x35')]][_0x339d('0x31')]),_0x339d('0x3f'),this[_0x339d('0xc')][_0x5500a7[_0x339d('0x35')]]);}else if(this['trunks'][_0x5500a7[_0x339d('0x35')]]){if(this['trunks'][_0x5500a7[_0x339d('0x35')]][_0x339d('0x2b')]!==_0x5500a7[_0x339d('0x2b')][_0x339d('0x3a')]()){this[_0x339d('0xa')][_0x5500a7[_0x339d('0x35')]]['stateTime']=_[_0x339d('0x39')](moment()[_0x339d('0x3d')]('x'));}this[_0x339d('0xa')][_0x5500a7[_0x339d('0x35')]][_0x339d('0x2b')]=_0x5500a7[_0x339d('0x2b')][_0x339d('0x3a')]();logger['debug'](_0x339d('0x40'),util[_0x339d('0x1a')](this['trunks'][_0x5500a7[_0x339d('0x35')]],{'showHidden':![],'depth':null}));this[_0x339d('0x23')](util[_0x339d('0x3d')](_0x339d('0x30'),this[_0x339d('0xa')][_0x5500a7[_0x339d('0x35')]][_0x339d('0x31')]),_0x339d('0x32'),this[_0x339d('0xa')][_0x5500a7[_0x339d('0x35')]]);}else if(_[_0x339d('0x41')](_0x5500a7[_0x339d('0x35')],_0x339d('0x42'))){var _0xf47b0e=_0x5500a7[_0x339d('0x35')];var _0x3d47c0=_0xf47b0e[_0x339d('0x43')](_0xf47b0e[_0x339d('0x44')]('/')+0x1,_0xf47b0e['indexOf']('@'));var _0x26d1cb=_['find'](this['agents'],function(_0x1e71cb){return _0x1e71cb[_0x339d('0x45')]==_0x3d47c0||_0x1e71cb[_0x339d('0x46')]==_0x3d47c0||_0x1e71cb[_0x339d('0x47')]==_0x3d47c0;});if(_0x26d1cb){if(_0x26d1cb[_0x339d('0x2b')]!==_0x5500a7[_0x339d('0x2b')]['toLowerCase']()){_0x26d1cb[_0x339d('0x38')]=_[_0x339d('0x39')](moment()['format']('x'));}_0x26d1cb[_0x339d('0x2b')]=_0x5500a7[_0x339d('0x2b')]['toLowerCase']();_0x26d1cb[_0x339d('0x36')]=!![];_0x26d1cb['updateStatusRealtime'](_0x5500a7);}}}}catch(_0x28184f){logger[_0x339d('0x18')](_0x339d('0x34'),util['inspect'](_0x28184f,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x3c7c2d){try{if(this[_0x339d('0x21')](_0x3c7c2d)&&this[_0x339d('0x21')](_0x3c7c2d[_0x339d('0x12')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x3c7c2d[_0x339d('0x48')],_0x3c7c2d[_0x339d('0x49')],_0x3c7c2d[_0x339d('0x12')]);logger[_0x339d('0x27')](_0x339d('0x4a'),util[_0x339d('0x1a')](_0x3c7c2d,{'showHidden':![],'depth':null}));if(this[_0x339d('0xb')][_0x3c7c2d[_0x339d('0x48')]]){if(!this[_0x339d('0xb')][_0x3c7c2d[_0x339d('0x48')]][_0x339d('0x36')]||_0x3c7c2d[_0x339d('0x12')][_0x339d('0x3a')]()==_0x339d('0x4b')){this['agents'][_0x3c7c2d[_0x339d('0x48')]][_0x339d('0x36')]=![];this[_0x339d('0xb')][_0x3c7c2d[_0x339d('0x48')]][_0x339d('0x4c')]=_0x3c7c2d['peerstatus']['toLowerCase']();this[_0x339d('0xb')][_0x3c7c2d['peer']][_0x339d('0x49')]=_0x3c7c2d[_0x339d('0x49')];this[_0x339d('0xb')][_0x3c7c2d['peer']][_0x339d('0x3b')](_0x3c7c2d);}}else if(this['telephones'][_0x3c7c2d['peer']]){this[_0x339d('0xc')][_0x3c7c2d['peer']]['status']=_0x3c7c2d[_0x339d('0x12')][_0x339d('0x3a')]();this['telephones'][_0x3c7c2d['peer']]['address']=_0x3c7c2d['address'];logger[_0x339d('0x27')](_0x339d('0x4d'),util[_0x339d('0x1a')](this['telephones'][_0x3c7c2d[_0x339d('0x48')]],{'showHidden':![],'depth':null}));this[_0x339d('0x23')](util[_0x339d('0x3d')](_0x339d('0x3e'),this['telephones'][_0x3c7c2d['peer']]['name']),'telephone:save',this[_0x339d('0xc')][_0x3c7c2d['peer']]);}else if(this[_0x339d('0xa')][_0x3c7c2d['peer']]){this['trunks'][_0x3c7c2d['peer']][_0x339d('0x4c')]=_0x3c7c2d[_0x339d('0x12')][_0x339d('0x3a')]();this[_0x339d('0xa')][_0x3c7c2d['peer']][_0x339d('0x49')]=_0x3c7c2d[_0x339d('0x49')];logger[_0x339d('0x27')](_0x339d('0x4e'),util[_0x339d('0x1a')](this['trunks'][_0x3c7c2d[_0x339d('0x48')]],{'showHidden':![],'depth':null}));this[_0x339d('0x23')](util[_0x339d('0x3d')](_0x339d('0x30'),this['trunks'][_0x3c7c2d[_0x339d('0x48')]]['name']),_0x339d('0x32'),this[_0x339d('0xa')][_0x3c7c2d[_0x339d('0x48')]]);}}}catch(_0x8c68ab){logger[_0x339d('0x18')](_0x339d('0x4a'),util[_0x339d('0x1a')](_0x8c68ab,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
index 8861771..b5ad798 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x13e62c,_0x227398){var _0x35a619=function(_0x35fa54){while(--_0x35fa54){_0x13e62c['push'](_0x13e62c['shift']());}};_0x35a619(++_0x227398);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport;
\ No newline at end of file
+var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x7c14da,_0x3c4b27){var _0x173389=function(_0x2db150){while(--_0x2db150){_0x7c14da['push'](_0x7c14da['shift']());}};_0x173389(++_0x3c4b27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport;
\ No newline at end of file
index 222d716..cb9d283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a1a=['transfererchannel','transfereruniqueid','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','path','../../../config/logger','ami','../ami','../rpc/setting','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','bind','newexten','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','channel','split','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newchannel]','syncNewExten','application','appdata','startsWith','CDR(routeAlias)','applicationdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','holdtime','diff','connectedlinename','calleridname','destinationchannel','UserId','membername','from-sip','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','error','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','seconds','billableseconds','answertime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','undefined','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','outbound','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x8a1a,0xda));var _0xa8a1=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x8a1a[_0x10dc60];return _0x47dec5;};'use strict';var _=require(_0xa8a1('0x0'));var moment=require(_0xa8a1('0x1'));var util=require('util');var path=require(_0xa8a1('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xa8a1('0x3'))(_0xa8a1('0x4'));var ami=require(_0xa8a1('0x5'));var Channel=require('../model/channel');var RpcSetting=require(_0xa8a1('0x6'));var applications=[_0xa8a1('0x7'),_0xa8a1('0x8'),_0xa8a1('0x9'),_0xa8a1('0xa'),_0xa8a1('0xb'),_0xa8a1('0xc')];var dispositions=[_0xa8a1('0xd'),_0xa8a1('0xe'),_0xa8a1('0xe'),_0xa8a1('0xd'),_0xa8a1('0xd'),_0xa8a1('0xd'),_0xa8a1('0xf'),'BUSY','FAILED',_0xa8a1('0xe'),_0xa8a1('0xe')];config['redis']=_[_0xa8a1('0x10')](config[_0xa8a1('0x11')],{'host':_0xa8a1('0x12'),'port':0x18eb});var io=require(_0xa8a1('0x13'))(new Redis(config[_0xa8a1('0x11')]));function VoiceCallReport(_0x5eeec0){this[_0xa8a1('0x14')]=_0x5eeec0['channels'];this[_0xa8a1('0x15')]=_0x5eeec0[_0xa8a1('0x15')];this[_0xa8a1('0x16')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0xa8a1('0x17')](this));ami['on'](_0xa8a1('0x18'),this['syncNewExten'][_0xa8a1('0x17')](this));ami['on']('newchannel',this[_0xa8a1('0x19')][_0xa8a1('0x17')](this));ami['on'](_0xa8a1('0x1a'),this[_0xa8a1('0x1b')][_0xa8a1('0x17')](this));ami['on'](_0xa8a1('0x1c'),this[_0xa8a1('0x1d')][_0xa8a1('0x17')](this));ami['on'](_0xa8a1('0x1e'),this[_0xa8a1('0x1f')][_0xa8a1('0x17')](this));ami['on'](_0xa8a1('0x20'),this[_0xa8a1('0x21')]['bind'](this));ami['on']('attendedtransfer',this[_0xa8a1('0x22')][_0xa8a1('0x17')](this));ami['on'](_0xa8a1('0x23'),this[_0xa8a1('0x24')]['bind'](this));ami['on']('musiconholdstart',this[_0xa8a1('0x25')][_0xa8a1('0x17')](this));ami['on'](_0xa8a1('0x26'),this['syncMusicOnHoldStop']['bind'](this));try{logger[_0xa8a1('0x27')](_0xa8a1('0x28'));ami[_0xa8a1('0x29')]();}catch(_0xe1e2b){logger['error'](_0xa8a1('0x2a'),util[_0xa8a1('0x2b')](_0xe1e2b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xa8a1('0x2c')][_0xa8a1('0x2d')]=function(_0x511545){return _0x511545!==null&&!_[_0xa8a1('0x2e')](_0x511545);};VoiceCallReport[_0xa8a1('0x2c')][_0xa8a1('0x2f')]=function(_0xdea5b8,_0x48756b,_0x2e8256){io['to'](_0xdea5b8)[_0xa8a1('0x2f')](_0x48756b,_0x2e8256);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x2bdbe4){try{if(this[_0xa8a1('0x2d')](_0x2bdbe4)){logger[_0xa8a1('0x27')](_0xa8a1('0x30'),_0x2bdbe4[_0xa8a1('0x31')],_0x2bdbe4['calleridname'],_0x2bdbe4[_0xa8a1('0x32')]);logger[_0xa8a1('0x33')](_0xa8a1('0x34'),_0x2bdbe4[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x2bdbe4,{'showHidden':![],'depth':null}));if(_0x2bdbe4['uniqueid']===_0x2bdbe4[_0xa8a1('0x35')]){if(!_[_0xa8a1('0x2e')](this[_0xa8a1('0x14')][_0x2bdbe4['uniqueid']])){_[_0xa8a1('0x36')](this[_0xa8a1('0x14')][_0x2bdbe4[_0xa8a1('0x31')]],_[_0xa8a1('0x37')](_0x2bdbe4,_[_0xa8a1('0x38')](this[_0xa8a1('0x14')][_0x2bdbe4[_0xa8a1('0x31')]])));}}if(_0x2bdbe4[_0xa8a1('0x39')]==='from-sip'){if(this[_0xa8a1('0x15')][_0x2bdbe4['channel']['split']('-')[0x0]]){if(_0x2bdbe4[_0xa8a1('0x3a')]==_0xa8a1('0x3b')){this[_0xa8a1('0x15')][_0x2bdbe4['channel']['split']('-')[0x0]][_0xa8a1('0x3c')]=_0x2bdbe4[_0xa8a1('0x3d')];this[_0xa8a1('0x2f')](util[_0xa8a1('0x3e')](_0xa8a1('0x3f'),this['agents'][_0x2bdbe4['channel']['split']('-')[0x0]]['name']),_0xa8a1('0x40'),{'destaccountcode':this[_0xa8a1('0x15')][_0x2bdbe4[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x43')],'destconnectedlinenum':_0x2bdbe4[_0xa8a1('0x3d')]});}}}}}catch(_0x5137b0){logger['error'](_0xa8a1('0x44'),_0x2bdbe4['uniqueid'],util[_0xa8a1('0x2b')](_0x5137b0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa8a1('0x19')]=function(_0x560da0){try{if(this[_0xa8a1('0x2d')](_0x560da0)){logger[_0xa8a1('0x33')](_0xa8a1('0x45'),_0x560da0[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x560da0,{'showHidden':![],'depth':null}));if(_0x560da0[_0xa8a1('0x31')]===_0x560da0[_0xa8a1('0x35')]&&_0x560da0[_0xa8a1('0x41')]!=_0xa8a1('0x46')){if(_[_0xa8a1('0x2e')](this['channels'][_0x560da0[_0xa8a1('0x31')]])){logger['info'](_0xa8a1('0x47'),_0x560da0[_0xa8a1('0x31')],_0x560da0['context'],_0x560da0[_0xa8a1('0x3a')]);this[_0xa8a1('0x14')][_0x560da0['uniqueid']]=new Channel();this[_0xa8a1('0x14')][_0x560da0[_0xa8a1('0x31')]]['starttime']=moment()[_0xa8a1('0x3e')](_0xa8a1('0x48'));this[_0xa8a1('0x14')][_0x560da0[_0xa8a1('0x31')]][_0xa8a1('0x49')]=dispositions[_[_0xa8a1('0x4a')](_0x560da0['channelstate'])];_[_0xa8a1('0x36')](this['channels'][_0x560da0[_0xa8a1('0x31')]],_[_0xa8a1('0x37')](_0x560da0,_['keys'](this[_0xa8a1('0x14')][_0x560da0[_0xa8a1('0x31')]])));if(_0x560da0[_0xa8a1('0x39')]==='from-sip'){if(this[_0xa8a1('0x15')][_0x560da0[_0xa8a1('0x41')]['split']('-')[0x0]]){if(_[_0xa8a1('0x2e')](this[_0xa8a1('0x15')][_0x560da0[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x3c')])){this[_0xa8a1('0x15')][_0x560da0[_0xa8a1('0x41')]['split']('-')[0x0]][_0xa8a1('0x3c')]=_0x560da0[_0xa8a1('0x3a')];logger['debug'](_0xa8a1('0x4b'),_0x560da0['uniqueid'],util['inspect']({'id':this[_0xa8a1('0x15')][_0x560da0['channel'][_0xa8a1('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0xa8a1('0x15')][_0x560da0[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x43')],'destconnectedlinenum':_0x560da0['exten']},{'showHidden':![],'depth':null}));this[_0xa8a1('0x2f')](util['format']('user:%s',this[_0xa8a1('0x15')][_0x560da0[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x4c')]),'user:agentconnect',{'id':this[_0xa8a1('0x15')][_0x560da0[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0xa8a1('0x15')][_0x560da0['channel'][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x43')],'destconnectedlinenum':_0x560da0[_0xa8a1('0x3a')]});}}}}}}}catch(_0x407d7a){logger['error'](_0xa8a1('0x4d'),_0x560da0[_0xa8a1('0x31')],util['inspect'](_0x407d7a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa8a1('0x2c')][_0xa8a1('0x4e')]=function(_0x3ab9fb){try{if(this[_0xa8a1('0x2d')](_0x3ab9fb)){logger[_0xa8a1('0x33')]('[%s][voiceCallReport][newexten]\x20event:',_0x3ab9fb['uniqueid'],util[_0xa8a1('0x2b')](_0x3ab9fb,{'showHidden':![],'depth':null}));if(_0x3ab9fb[_0xa8a1('0x31')]===_0x3ab9fb[_0xa8a1('0x35')]&&_0x3ab9fb[_0xa8a1('0x3a')]!='h'&&_0x3ab9fb[_0xa8a1('0x41')]!='OutgoingSpoolFailed'){_0x3ab9fb[_0xa8a1('0x4f')]=_0x3ab9fb['application']['toLowerCase']();_0x3ab9fb['applicationdata']=_0x3ab9fb['appdata']&&_0x3ab9fb[_0xa8a1('0x50')][_0xa8a1('0x51')](_0xa8a1('0x52'))?_0x3ab9fb[_0xa8a1('0x50')]:(_0x3ab9fb[_0xa8a1('0x50')]||_0x3ab9fb[_0xa8a1('0x53')])[_0xa8a1('0x54')]();logger[_0xa8a1('0x27')](_0xa8a1('0x55'),_0x3ab9fb[_0xa8a1('0x31')],_0x3ab9fb['application'],_0x3ab9fb[_0xa8a1('0x53')]);if(_[_0xa8a1('0x2e')](this[_0xa8a1('0x14')][_0x3ab9fb[_0xa8a1('0x31')]])){this[_0xa8a1('0x14')][_0x3ab9fb['uniqueid']]=new Channel();this[_0xa8a1('0x14')][_0x3ab9fb[_0xa8a1('0x31')]][_0xa8a1('0x56')]=_0x3ab9fb[_0xa8a1('0x57')]?moment()[_0xa8a1('0x58')](moment[_0xa8a1('0x57')](_0x3ab9fb['duration'])['seconds'](),'seconds')['format'](_0xa8a1('0x48')):moment()[_0xa8a1('0x3e')](_0xa8a1('0x48'));this[_0xa8a1('0x14')][_0x3ab9fb[_0xa8a1('0x31')]][_0xa8a1('0x49')]=_0xa8a1('0xd');}_['merge'](this[_0xa8a1('0x14')][_0x3ab9fb[_0xa8a1('0x31')]],_[_0xa8a1('0x37')](_0x3ab9fb,_[_0xa8a1('0x38')](this[_0xa8a1('0x14')][_0x3ab9fb[_0xa8a1('0x31')]])));if(_[_0xa8a1('0x59')](applications,_0x3ab9fb['application'])){this[_0xa8a1('0x14')][_0x3ab9fb[_0xa8a1('0x31')]][_0xa8a1('0x5a')]=_0x3ab9fb['application'];this[_0xa8a1('0x14')][_0x3ab9fb['uniqueid']][_0xa8a1('0x5b')]=_0x3ab9fb[_0xa8a1('0x53')];if(_0x3ab9fb[_0xa8a1('0x4f')]===_0xa8a1('0x7')&&_[_0xa8a1('0x51')](_0x3ab9fb[_0xa8a1('0x53')]['toLowerCase'](),_0xa8a1('0x5c'))){var _0x124273=_0x3ab9fb[_0xa8a1('0x53')][_0xa8a1('0x42')]('=');var _0x28610c=_0x124273[0x0]['toLowerCase']()[_0xa8a1('0x5d')](/cdr\((.*)\)/);if(_0x28610c){this[_0xa8a1('0x14')][_0x3ab9fb[_0xa8a1('0x31')]][_0x28610c[0x1]]=_0x124273[0x1];}}else if(_0x3ab9fb[_0xa8a1('0x4f')]==='queue'){this[_0xa8a1('0x14')][_0x3ab9fb['uniqueid']][_0xa8a1('0x8')]=_0x3ab9fb[_0xa8a1('0x53')][_0xa8a1('0x42')](',')[0x0];}}}}}catch(_0xb2a68b){logger['error'](_0xa8a1('0x5e'),_0x3ab9fb['uniqueid'],util[_0xa8a1('0x2b')](_0xb2a68b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa8a1('0x2c')][_0xa8a1('0x1b')]=function(_0x3ffd56){try{if(this[_0xa8a1('0x2d')](_0x3ffd56)){logger['info'](_0xa8a1('0x5f'),_0x3ffd56[_0xa8a1('0x31')],_0x3ffd56[_0xa8a1('0x35')],_0x3ffd56['calleridname'],_0x3ffd56[_0xa8a1('0x32')]);logger[_0xa8a1('0x33')](_0xa8a1('0x60'),_0x3ffd56[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x3ffd56,{'showHidden':![],'depth':null}));if(_0x3ffd56['uniqueid']!==_0x3ffd56['linkedid']){if(this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]]){if(_0x3ffd56[_0xa8a1('0x61')]==='6'){if(!this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x62')]){var _0x5b4ec5=moment();this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x62')]=!![];this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]]['answertime']=_0x5b4ec5[_0xa8a1('0x3e')](_0xa8a1('0x48'));if(this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x56')]){this['channels'][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x63')]=_0x5b4ec5[_0xa8a1('0x64')](this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]]['starttime'],'seconds');}}this[_0xa8a1('0x14')][_0x3ffd56['linkedid']][_0xa8a1('0x35')]=_0x3ffd56[_0xa8a1('0x31')];if(_0x3ffd56[_0xa8a1('0x32')]!=='xcally-motion-preview'){this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x3d')]=_0x3ffd56[_0xa8a1('0x32')];}this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x65')]=_0x3ffd56[_0xa8a1('0x66')];this['channels'][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x67')]=_0x3ffd56[_0xa8a1('0x41')];this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x49')]=dispositions[_['toNumber'](_0x3ffd56[_0xa8a1('0x61')])];if(this[_0xa8a1('0x15')][_0x3ffd56[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]){this[_0xa8a1('0x14')][_0x3ffd56['linkedid']][_0xa8a1('0x68')]=this[_0xa8a1('0x15')][_0x3ffd56[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]['id'];this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x69')]=this['agents'][_0x3ffd56[_0xa8a1('0x41')]['split']('-')[0x0]]['name'];}}}}else{if(this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x31')]]){if(_0x3ffd56[_0xa8a1('0x61')]==='6'){if(this['agents'][_0x3ffd56['channel'][_0xa8a1('0x42')]('-')[0x0]]){this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x31')]][_0xa8a1('0x68')]=this[_0xa8a1('0x15')][_0x3ffd56[_0xa8a1('0x41')]['split']('-')[0x0]]['id'];this[_0xa8a1('0x14')][_0x3ffd56['uniqueid']][_0xa8a1('0x69')]=this[_0xa8a1('0x15')][_0x3ffd56['channel']['split']('-')[0x0]][_0xa8a1('0x4c')];}}}}if(_0x3ffd56[_0xa8a1('0x61')]==='6'&&_0x3ffd56[_0xa8a1('0x39')]===_0xa8a1('0x6a')){if(this[_0xa8a1('0x15')][_0x3ffd56['channel'][_0xa8a1('0x42')]('-')[0x0]]){this[_0xa8a1('0x15')][_0x3ffd56['channel']['split']('-')[0x0]][_0xa8a1('0x3c')]=_0x3ffd56[_0xa8a1('0x3a')];var _0x3c2c8e,_0x3f108b;if(this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x31')]]){_0x3c2c8e=this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x31')]]['routealias'];_0x3f108b=this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x31')]][_0xa8a1('0x8')];}else if(this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]]){_0x3c2c8e=this[_0xa8a1('0x14')][_0x3ffd56[_0xa8a1('0x35')]][_0xa8a1('0x6b')];_0x3f108b=this[_0xa8a1('0x14')][_0x3ffd56['linkedid']][_0xa8a1('0x8')];}logger[_0xa8a1('0x33')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x3ffd56[_0xa8a1('0x31')],util[_0xa8a1('0x2b')]({'id':this['agents'][_0x3ffd56[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0xa8a1('0x15')][_0x3ffd56[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3ffd56[_0xa8a1('0x3a')],'routealias':_0x3c2c8e,'queue':_0x3f108b||undefined},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xa8a1('0x3f'),this[_0xa8a1('0x15')][_0x3ffd56[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x4c')]),_0xa8a1('0x40'),{'id':this['agents'][_0x3ffd56[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xa8a1('0x15')][_0x3ffd56[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x43')],'destconnectedlinenum':_0x3ffd56[_0xa8a1('0x3a')],'routealias':_0x3c2c8e,'queue':_0x3f108b||undefined});}}}}catch(_0x42584c){logger['error'](_0xa8a1('0x6c'),_0x3ffd56[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x42584c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa8a1('0x2c')][_0xa8a1('0x6d')]=function(_0x53b2f2,_0x91de47){try{if(this[_0xa8a1('0x14')][_0x53b2f2]){logger[_0xa8a1('0x27')](_0xa8a1('0x6e'),_0x53b2f2,_0x91de47);this[_0xa8a1('0x14')][_0x53b2f2][_0xa8a1('0x6f')]=!![];if(_['endsWith'](_0x91de47,_0xa8a1('0x70'))){_0x91de47=_0x91de47['replace'](_0xa8a1('0x70'),_0xa8a1('0x71'));}this[_0xa8a1('0x14')][_0x53b2f2][_0xa8a1('0x72')]=_0x91de47;var _0xb2bf81=_[_0xa8a1('0x73')](this[_0xa8a1('0x14')][_0x53b2f2]['monitors'],{'filename':_0x91de47});if(_['isNil'](_0xb2bf81)){this[_0xa8a1('0x14')][_0x53b2f2][_0xa8a1('0x74')][_0xa8a1('0x75')]({'filename':_0x91de47,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xa8a1('0x76')});}}}catch(_0x2e84e3){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0x53b2f2,util['inspect'](_0x2e84e3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa8a1('0x1d')]=function(_0x29b81a){try{if(this[_0xa8a1('0x2d')](_0x29b81a)){logger[_0xa8a1('0x33')](_0xa8a1('0x77'),_0x29b81a[_0xa8a1('0x31')],util['inspect'](_0x29b81a,{'showHidden':![],'depth':null}));if(this['channels'][_0x29b81a[_0xa8a1('0x31')]]&&_0x29b81a[_0xa8a1('0x41')]!=_0xa8a1('0x46')){if(this['isNotNull'](_0x29b81a[_0xa8a1('0x78')])){if(this[_0xa8a1('0x2d')](_0x29b81a[_0xa8a1('0x78')][_0xa8a1('0x79')])){logger[_0xa8a1('0x27')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x29b81a[_0xa8a1('0x31')],_0x29b81a[_0xa8a1('0x7a')]);this['syncMixMonitorFilename'](_0x29b81a['uniqueid'],_0x29b81a[_0xa8a1('0x7a')]);}else if(this['isNotNull'](_0x29b81a[_0xa8a1('0x78')][_0xa8a1('0x7b')])){logger[_0xa8a1('0x27')](_0xa8a1('0x7c'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a['value']);this[_0xa8a1('0x14')][_0x29b81a[_0xa8a1('0x31')]][_0xa8a1('0x32')]=_0x29b81a[_0xa8a1('0x7a')];}else if(this[_0xa8a1('0x2d')](_0x29b81a['variable']['xmd-callerid'])){logger[_0xa8a1('0x27')](_0xa8a1('0x7d'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a['value']);this[_0xa8a1('0x14')][_0x29b81a[_0xa8a1('0x31')]][_0xa8a1('0x7e')]=_0x29b81a[_0xa8a1('0x7a')];}else if(this[_0xa8a1('0x2d')](_0x29b81a['variable'][_0xa8a1('0x7f')])){logger[_0xa8a1('0x27')](_0xa8a1('0x80'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a[_0xa8a1('0x7a')]);this[_0xa8a1('0x14')][_0x29b81a[_0xa8a1('0x31')]][_0xa8a1('0x81')]=_0x29b81a['value'];}else if(this[_0xa8a1('0x2d')](_0x29b81a['variable'][_0xa8a1('0x82')])){logger[_0xa8a1('0x27')](_0xa8a1('0x83'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a[_0xa8a1('0x7a')][_0xa8a1('0x42')](',')[0x0]);this[_0xa8a1('0x14')][_0x29b81a['uniqueid']][_0xa8a1('0x8')]=_0x29b81a['value'][_0xa8a1('0x42')](',')[0x0];}else if(this[_0xa8a1('0x2d')](_0x29b81a['variable'][_0xa8a1('0x84')])){logger[_0xa8a1('0x27')](_0xa8a1('0x85'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a[_0xa8a1('0x7a')]);this['channels'][_0x29b81a[_0xa8a1('0x31')]][_0xa8a1('0x86')]=_0x29b81a['value'];}else if(this[_0xa8a1('0x2d')](_0x29b81a[_0xa8a1('0x78')][_0xa8a1('0x87')])){logger[_0xa8a1('0x27')](_0xa8a1('0x88'),_0x29b81a['uniqueid'],_0x29b81a[_0xa8a1('0x7a')]);this[_0xa8a1('0x14')][_0x29b81a[_0xa8a1('0x31')]][_0xa8a1('0x89')]=_0x29b81a[_0xa8a1('0x7a')];}else if(this[_0xa8a1('0x2d')](_0x29b81a[_0xa8a1('0x78')]['xmd-callerid-preview'])){logger[_0xa8a1('0x27')](_0xa8a1('0x8a'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a[_0xa8a1('0x7a')]);this[_0xa8a1('0x14')][_0x29b81a[_0xa8a1('0x31')]]['calleridpreview']=_0x29b81a[_0xa8a1('0x7a')];}else if(this['isNotNull'](_0x29b81a[_0xa8a1('0x78')]['xmcs-queue'])){logger[_0xa8a1('0x27')](_0xa8a1('0x8b'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a[_0xa8a1('0x7a')]);this['channels'][_0x29b81a[_0xa8a1('0x31')]]['queue']=_0x29b81a[_0xa8a1('0x7a')];}else if(this[_0xa8a1('0x2d')](_0x29b81a[_0xa8a1('0x78')][_0xa8a1('0x8c')])){logger[_0xa8a1('0x27')](_0xa8a1('0x8d'),_0x29b81a[_0xa8a1('0x31')],_0x29b81a['value']);this['channels'][_0x29b81a[_0xa8a1('0x31')]][_0xa8a1('0x8e')]=_0x29b81a[_0xa8a1('0x7a')];}}}else if(this[_0xa8a1('0x2d')](_0x29b81a[_0xa8a1('0x78')]['mixmonitor_filename'])){if(_0x29b81a['value']){var _0x3489c0=path[_0xa8a1('0x8f')](_0x29b81a[_0xa8a1('0x7a')])[_0xa8a1('0x4c')];logger[_0xa8a1('0x27')](_0xa8a1('0x90'),_0x3489c0,_0x29b81a['value']);this[_0xa8a1('0x6d')](_0x3489c0,_0x29b81a[_0xa8a1('0x7a')]);}}else if(this[_0xa8a1('0x14')][_0x29b81a['linkedid']]){if(this[_0xa8a1('0x2d')](_0x29b81a[_0xa8a1('0x78')])){if(this[_0xa8a1('0x2d')](_0x29b81a[_0xa8a1('0x78')]['sipcallid'])){logger['info'](_0xa8a1('0x8d'),_0x29b81a[_0xa8a1('0x35')],_0x29b81a['value']);this[_0xa8a1('0x14')][_0x29b81a[_0xa8a1('0x35')]][_0xa8a1('0x91')]=_0x29b81a[_0xa8a1('0x7a')];}}}}}catch(_0x5510bb){logger[_0xa8a1('0x92')](_0xa8a1('0x93'),_0x29b81a[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x5510bb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa8a1('0x2c')]['syncHangup']=function(_0x1de23e){try{if(this[_0xa8a1('0x2d')](_0x1de23e)){logger['debug'](_0xa8a1('0x94'),_0x1de23e['uniqueid'],util[_0xa8a1('0x2b')](_0x1de23e,{'showHidden':![],'depth':null}));if(this[_0xa8a1('0x14')][_0x1de23e['uniqueid']]){logger[_0xa8a1('0x27')](_0xa8a1('0x95'),_0x1de23e[_0xa8a1('0x31')],_0x1de23e[_0xa8a1('0x96')]);var _0x3e40be=moment();this['channels'][_0x1de23e[_0xa8a1('0x31')]]['endtime']=_0x3e40be['format'](_0xa8a1('0x48'));this[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]]['duration']=_0x3e40be['diff'](this[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]][_0xa8a1('0x56')],_0xa8a1('0x97'));if(this['channels'][_0x1de23e[_0xa8a1('0x31')]][_0xa8a1('0x62')]){this['channels'][_0x1de23e[_0xa8a1('0x31')]][_0xa8a1('0x98')]=_0x3e40be[_0xa8a1('0x64')](this[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]][_0xa8a1('0x99')],_0xa8a1('0x97'));this[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]]['holdtime']=this[_0xa8a1('0x14')][_0x1de23e['uniqueid']][_0xa8a1('0x57')]-this[_0xa8a1('0x14')][_0x1de23e['uniqueid']]['billableseconds'];}if(_0x1de23e[_0xa8a1('0x39')]===_0xa8a1('0x6a')){if(this[_0xa8a1('0x15')][_0x1de23e['channel'][_0xa8a1('0x42')]('-')[0x0]]){this[_0xa8a1('0x15')][_0x1de23e[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]=_[_0xa8a1('0x9a')](this[_0xa8a1('0x15')][_0x1de23e[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]],[_0xa8a1('0x3c')]);logger['debug'](_0xa8a1('0x9b'),_0x1de23e[_0xa8a1('0x31')],util[_0xa8a1('0x2b')]({'id':this[_0xa8a1('0x15')][_0x1de23e[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1de23e[_0xa8a1('0x41')]['split']('-')[0x0]][_0xa8a1('0x43')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xa8a1('0x3e')](_0xa8a1('0x3f'),this['agents'][_0x1de23e[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]][_0xa8a1('0x4c')]),_0xa8a1('0x9c'),{'id':this['agents'][_0x1de23e[_0xa8a1('0x41')][_0xa8a1('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0xa8a1('0x15')][_0x1de23e[_0xa8a1('0x41')]['split']('-')[0x0]]['accountcode']});for(var _0x35f1ca=0x0;_0x35f1ca<Object[_0xa8a1('0x38')](this[_0xa8a1('0x15')])[_0xa8a1('0x9d')];_0x35f1ca++){var _0x54acd3=Object[_0xa8a1('0x38')](this[_0xa8a1('0x15')])[_0x35f1ca];var _0x1656be=this[_0xa8a1('0x15')][_0x54acd3];if(_0x1656be[_0xa8a1('0x43')]===Number(_0x1de23e[_0xa8a1('0x3d')])){this[_0xa8a1('0x2f')](util[_0xa8a1('0x3e')](_0xa8a1('0x3f'),_0x1656be['name']),_0xa8a1('0x9c'),{'id':_0x1656be['id'],'destaccountcode':_0x1656be[_0xa8a1('0x43')],'transfer':this['channels'][_0x1de23e['uniqueid']][_0xa8a1('0x9e')]});break;}}}}var _0x1fbe8b=this;Promise[_0xa8a1('0x9f')]()[_0xa8a1('0xa0')](function(){var _0x7ee357=_0x1fbe8b[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]];if(typeof _0x7ee357['transferType']===_0xa8a1('0xa1'))return;if(_['isEmpty'](_0x7ee357[_0xa8a1('0x74')]))return;return RpcSetting['getSettings']()['then'](function(_0x107ca9){if(!_0x107ca9[_0xa8a1('0xa2')])return;return Promise[_0xa8a1('0x9f')]()[_0xa8a1('0xa0')](function(){return ami[_0xa8a1('0xa3')]({'action':_0xa8a1('0xa4'),'channel':_0x7ee357[_0xa8a1('0x41')]})['catch'](function(){});})[_0xa8a1('0xa0')](function(){return ami['Action']({'action':_0xa8a1('0xa4'),'channel':_0x7ee357['destinationchannel']})[_0xa8a1('0xa5')](function(){})[_0xa8a1('0xa6')](function(){var _0x32d555=_0x1fbe8b['agents'][_0x7ee357['destinationchannel'][_0xa8a1('0x42')]('-')[0x0]];if(!_0x32d555)return;io[_0xa8a1('0x2f')]('webbar:stopmonitors',{'agentId':_0x32d555['id'],'uniqueid':_0x7ee357['uniqueid']});});});});})[_0xa8a1('0xa0')](function(){if(_0x1de23e['event']===_0xa8a1('0xa7')){_0x1fbe8b[_0xa8a1('0x16')][_0x1de23e['uniqueid']]=_0x1fbe8b['channels'][_0x1de23e[_0xa8a1('0x31')]];}else{if(_0x1fbe8b[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]][_0xa8a1('0x81')]==='outbound'&&_0x1fbe8b[_0xa8a1('0x16')][_0x1de23e['uniqueid']]){_0x1fbe8b[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]]['uniqueid']=[_0x1fbe8b['channels'][_0x1de23e[_0xa8a1('0x31')]][_0xa8a1('0x35')],_0x1fbe8b[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]][_0xa8a1('0x35')]=_0x1fbe8b[_0xa8a1('0x14')][_0x1de23e['uniqueid']][_0xa8a1('0x31')]][0x0];delete _0x1fbe8b[_0xa8a1('0x16')][_0x1de23e['uniqueid']];}}logger[_0xa8a1('0x33')](_0xa8a1('0xa8'),_0x1de23e['uniqueid'],util[_0xa8a1('0x2b')](_0x1fbe8b[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]],{'showHidden':![],'depth':null}));ami[_0xa8a1('0x2f')](_0xa8a1('0xa9'),_0x1fbe8b[_0xa8a1('0x14')][_0x1de23e[_0xa8a1('0x31')]]);delete _0x1fbe8b['channels'][_0x1de23e[_0xa8a1('0x31')]];});}}}catch(_0x37696e){logger['error'](_0xa8a1('0xaa'),_0x1de23e[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x37696e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x19d1bb){try{if(this[_0xa8a1('0x2d')](_0x19d1bb)){logger[_0xa8a1('0x27')](_0xa8a1('0xab'),_0x19d1bb['uniqueid'],_0x19d1bb[_0xa8a1('0xac')],_0x19d1bb[_0xa8a1('0xad')]);logger[_0xa8a1('0x33')](_0xa8a1('0xae'),_0x19d1bb[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x19d1bb,{'showHidden':![],'depth':null}));var _0xbce44d;if(this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xaf')]]){this['channels'][_0x19d1bb[_0xa8a1('0xaf')]][_0xa8a1('0xb0')]=_0x19d1bb[_0xa8a1('0xac')];this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xaf')]][_0xa8a1('0xb1')]=_0x19d1bb['transfertargetcalleridnum'];if(this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb2')]]){_0xbce44d=this[_0xa8a1('0x14')][_0x19d1bb['secondtransfereruniqueid']];this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb2')]]=this['channels'][_0x19d1bb[_0xa8a1('0xaf')]];this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xaf')]]=_0xbce44d;}this['channels'][_0x19d1bb[_0xa8a1('0xb2')]]['transferType']=_0xa8a1('0xb3');}else if(this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb4')]]){this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb4')]][_0xa8a1('0xb0')]=_0x19d1bb[_0xa8a1('0xac')];this['channels'][_0x19d1bb[_0xa8a1('0xb4')]][_0xa8a1('0xb1')]=_0x19d1bb[_0xa8a1('0xad')];if(this['channels'][_0x19d1bb['origtransfereruniqueid']]){_0xbce44d=this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb5')]];this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb5')]]=this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb4')]];this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb4')]]=_0xbce44d;}this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb4')]][_0xa8a1('0x9e')]=_0xa8a1('0xb3');}if((this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb5')]]||this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb6')]])&&this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb2')]]){var _0x4f1b7f=_['some']([this[_0xa8a1('0x14')][_0x19d1bb['origtransfereruniqueid']],this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb6')]],this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb2')]]],function(_0x501af5){return _0x501af5&&_0x501af5[_0xa8a1('0x81')]===_0xa8a1('0xb7')&&_0x501af5[_0xa8a1('0xb8')];});if(_0x4f1b7f){if(this['channels'][_0x19d1bb['origtransfereruniqueid']])this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb5')]][_0xa8a1('0x9e')]='ATTENDED';if(this[_0xa8a1('0x14')][_0x19d1bb['origtransfererlinkedid']])this['channels'][_0x19d1bb['origtransfererlinkedid']][_0xa8a1('0x9e')]=_0xa8a1('0xb3');this[_0xa8a1('0x14')][_0x19d1bb[_0xa8a1('0xb2')]][_0xa8a1('0x9e')]=_0xa8a1('0xb3');}}}}catch(_0x105872){logger[_0xa8a1('0x92')](_0xa8a1('0xb9'),_0x19d1bb[_0xa8a1('0x31')],util['inspect'](_0x105872,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa8a1('0x2c')]['syncBlindTransfer']=function(_0x26c88a){try{if(this[_0xa8a1('0x2d')](_0x26c88a)){logger[_0xa8a1('0x27')](_0xa8a1('0xba'),_0x26c88a[_0xa8a1('0x31')],_0x26c88a['transfereecalleridnum'],_0x26c88a[_0xa8a1('0xbb')]);logger[_0xa8a1('0x33')](_0xa8a1('0xbc'),_0x26c88a[_0xa8a1('0x31')],util['inspect'](_0x26c88a,{'showHidden':![],'depth':null}));if(this[_0xa8a1('0x14')][_0x26c88a[_0xa8a1('0xaf')]]){this['channels'][_0x26c88a[_0xa8a1('0xaf')]][_0xa8a1('0xb0')]=_0x26c88a[_0xa8a1('0xbd')];this['channels'][_0x26c88a[_0xa8a1('0xaf')]][_0xa8a1('0xb1')]=_0x26c88a['extension'];this[_0xa8a1('0x14')][_0x26c88a['transfereeuniqueid']][_0xa8a1('0x9e')]='BLIND';this[_0xa8a1('0x1f')]({'event':_0xa8a1('0xa7'),'uniqueid':_0x26c88a[_0xa8a1('0xaf')],'context':_0x26c88a[_0xa8a1('0x39')],'channel':_0x26c88a[_0xa8a1('0xbe')]});}else{this[_0xa8a1('0x14')][_0x26c88a[_0xa8a1('0xbf')]][_0xa8a1('0x9e')]=_0xa8a1('0xc0');}}}catch(_0x1d638c){logger[_0xa8a1('0x92')](_0xa8a1('0xc1'),_0x26c88a[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x1d638c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa8a1('0x2c')]['syncMusicOnHoldStart']=function(_0x4fbbdf){try{if(this[_0xa8a1('0x2d')](_0x4fbbdf)){logger['debug'](_0xa8a1('0xc2'),_0x4fbbdf[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x4fbbdf,{'showHidden':![],'depth':null}));if(this[_0xa8a1('0x14')][_0x4fbbdf[_0xa8a1('0x31')]]){if(!_[_0xa8a1('0xc3')](this[_0xa8a1('0x14')][_0x4fbbdf[_0xa8a1('0x31')]][_0xa8a1('0x99')])){this['channels'][_0x4fbbdf[_0xa8a1('0x31')]][_0xa8a1('0xc4')]=moment()[_0xa8a1('0x3e')](_0xa8a1('0x48'));logger[_0xa8a1('0x27')](_0xa8a1('0xc5'),_0x4fbbdf[_0xa8a1('0x31')],this[_0xa8a1('0x14')][_0x4fbbdf[_0xa8a1('0x31')]][_0xa8a1('0xc4')]);}}}}catch(_0x14b168){logger['error'](_0xa8a1('0xc6'),_0x4fbbdf[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x14b168,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa8a1('0x2c')]['syncMusicOnHoldStop']=function(_0x331ec1){try{if(this[_0xa8a1('0x2d')](_0x331ec1)){logger['debug'](_0xa8a1('0xc7'),_0x331ec1[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x331ec1,{'showHidden':![],'depth':null}));if(this[_0xa8a1('0x14')][_0x331ec1[_0xa8a1('0x31')]]){if(!_['isNil'](this[_0xa8a1('0x14')][_0x331ec1[_0xa8a1('0x31')]]['mohstarttime'])){this[_0xa8a1('0x14')][_0x331ec1[_0xa8a1('0x31')]][_0xa8a1('0xc8')]+=moment()['milliseconds'](0x0)[_0xa8a1('0x64')](this[_0xa8a1('0x14')][_0x331ec1[_0xa8a1('0x31')]][_0xa8a1('0xc4')],_0xa8a1('0x97'));logger[_0xa8a1('0x27')](_0xa8a1('0xc9'),_0x331ec1[_0xa8a1('0x31')],this[_0xa8a1('0x14')][_0x331ec1[_0xa8a1('0x31')]][_0xa8a1('0xc8')]);delete this[_0xa8a1('0x14')][_0x331ec1[_0xa8a1('0x31')]][_0xa8a1('0xc4')];}}}}catch(_0x632612){logger[_0xa8a1('0x92')](_0xa8a1('0xca'),_0x331ec1[_0xa8a1('0x31')],util[_0xa8a1('0x2b')](_0x632612,{'showHidden':![],'depth':null}));}};module[_0xa8a1('0xcb')]=VoiceCallReport;
\ No newline at end of file
+var _0x93eb=['[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','moment','util','path','../../../config/logger','../model/channel','../rpc/setting','set','agi','playback','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','syncNewState','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','pick','keys','from-sip','channel','split','exten','xcally-motion-preview','connectedlinenum','format','user:%s','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','destconnectedlinenum','name','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','cdr(','match','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','isNil','monitors','push','rec','syncVarSet','[%s][voiceCallReport][varset]\x20event:','OutgoingSpoolFailed','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','destinationchannel','finally','webbar:stopmonitors','event','BlindTransfer','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfereruniqueid','syncMusicOnHoldStart','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds'];(function(_0x27775b,_0x2bdca2){var _0x11c064=function(_0x1c5051){while(--_0x1c5051){_0x27775b['push'](_0x27775b['shift']());}};_0x11c064(++_0x2bdca2);}(_0x93eb,0xc2));var _0xb93e=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x93eb[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var moment=require(_0xb93e('0x0'));var util=require(_0xb93e('0x1'));var path=require(_0xb93e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xb93e('0x3'))('ami');var ami=require('../ami');var Channel=require(_0xb93e('0x4'));var RpcSetting=require(_0xb93e('0x5'));var applications=[_0xb93e('0x6'),'queue',_0xb93e('0x7'),'dial',_0xb93e('0x8'),'voicemail'];var dispositions=['NO\x20ANSWER',_0xb93e('0x9'),_0xb93e('0x9'),_0xb93e('0xa'),_0xb93e('0xa'),_0xb93e('0xa'),_0xb93e('0xb'),_0xb93e('0xc'),_0xb93e('0x9'),_0xb93e('0x9'),'FAILED'];config[_0xb93e('0xd')]=_[_0xb93e('0xe')](config[_0xb93e('0xd')],{'host':_0xb93e('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb93e('0xd')]));function VoiceCallReport(_0x311508){this[_0xb93e('0x10')]=_0x311508[_0xb93e('0x10')];this[_0xb93e('0x11')]=_0x311508['agents'];this[_0xb93e('0x12')]={};ami['on'](_0xb93e('0x13'),this[_0xb93e('0x14')][_0xb93e('0x15')](this));ami['on'](_0xb93e('0x16'),this[_0xb93e('0x14')][_0xb93e('0x15')](this));ami['on']('newchannel',this['syncNewChannel'][_0xb93e('0x15')](this));ami['on']('newstate',this[_0xb93e('0x17')][_0xb93e('0x15')](this));ami['on'](_0xb93e('0x18'),this['syncVarSet'][_0xb93e('0x15')](this));ami['on'](_0xb93e('0x19'),this[_0xb93e('0x1a')][_0xb93e('0x15')](this));ami['on'](_0xb93e('0x1b'),this[_0xb93e('0x1c')][_0xb93e('0x15')](this));ami['on'](_0xb93e('0x1d'),this[_0xb93e('0x1e')]['bind'](this));ami['on'](_0xb93e('0x1f'),this[_0xb93e('0x20')][_0xb93e('0x15')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xb93e('0x21'),this[_0xb93e('0x22')][_0xb93e('0x15')](this));try{logger[_0xb93e('0x23')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xb93e('0x24')]();}catch(_0x4a1be5){logger[_0xb93e('0x25')](_0xb93e('0x26'),util[_0xb93e('0x27')](_0x4a1be5,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xb93e('0x28')]=function(_0x48f24f){return _0x48f24f!==null&&!_[_0xb93e('0x29')](_0x48f24f);};VoiceCallReport[_0xb93e('0x2a')]['emit']=function(_0x3d2333,_0x25049a,_0x1d5067){io['to'](_0x3d2333)[_0xb93e('0x2b')](_0x25049a,_0x1d5067);};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0x1c')]=function(_0x264370){try{if(this[_0xb93e('0x28')](_0x264370)){logger['info'](_0xb93e('0x2c'),_0x264370['uniqueid'],_0x264370[_0xb93e('0x2d')],_0x264370[_0xb93e('0x2e')]);logger[_0xb93e('0x2f')](_0xb93e('0x30'),_0x264370[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x264370,{'showHidden':![],'depth':null}));if(_0x264370[_0xb93e('0x31')]===_0x264370[_0xb93e('0x32')]){if(!_[_0xb93e('0x29')](this[_0xb93e('0x10')][_0x264370[_0xb93e('0x31')]])){_[_0xb93e('0x33')](this['channels'][_0x264370[_0xb93e('0x31')]],_[_0xb93e('0x34')](_0x264370,_[_0xb93e('0x35')](this[_0xb93e('0x10')][_0x264370['uniqueid']])));}}if(_0x264370['context']===_0xb93e('0x36')){if(this[_0xb93e('0x11')][_0x264370[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]){if(_0x264370[_0xb93e('0x39')]==_0xb93e('0x3a')){this[_0xb93e('0x11')][_0x264370['channel'][_0xb93e('0x38')]('-')[0x0]]['destconnectedlinenum']=_0x264370[_0xb93e('0x3b')];this[_0xb93e('0x2b')](util[_0xb93e('0x3c')](_0xb93e('0x3d'),this[_0xb93e('0x11')][_0x264370[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['name']),_0xb93e('0x3e'),{'destaccountcode':this[_0xb93e('0x11')][_0x264370[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x3f')],'destconnectedlinenum':_0x264370[_0xb93e('0x3b')]});}}}}}catch(_0x1517cd){logger['error'](_0xb93e('0x40'),_0x264370[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x1517cd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0x41')]=function(_0x3c0eb2){try{if(this[_0xb93e('0x28')](_0x3c0eb2)){logger['debug'](_0xb93e('0x42'),_0x3c0eb2[_0xb93e('0x31')],util['inspect'](_0x3c0eb2,{'showHidden':![],'depth':null}));if(_0x3c0eb2[_0xb93e('0x31')]===_0x3c0eb2[_0xb93e('0x32')]&&_0x3c0eb2[_0xb93e('0x37')]!='OutgoingSpoolFailed'){if(_[_0xb93e('0x29')](this['channels'][_0x3c0eb2['uniqueid']])){logger['info'](_0xb93e('0x43'),_0x3c0eb2[_0xb93e('0x31')],_0x3c0eb2[_0xb93e('0x44')],_0x3c0eb2['exten']);this['channels'][_0x3c0eb2[_0xb93e('0x31')]]=new Channel();this['channels'][_0x3c0eb2['uniqueid']][_0xb93e('0x45')]=moment()[_0xb93e('0x3c')](_0xb93e('0x46'));this[_0xb93e('0x10')][_0x3c0eb2[_0xb93e('0x31')]][_0xb93e('0x47')]=dispositions[_['toNumber'](_0x3c0eb2[_0xb93e('0x48')])];_[_0xb93e('0x33')](this['channels'][_0x3c0eb2[_0xb93e('0x31')]],_[_0xb93e('0x34')](_0x3c0eb2,_[_0xb93e('0x35')](this[_0xb93e('0x10')][_0x3c0eb2['uniqueid']])));if(_0x3c0eb2[_0xb93e('0x44')]==='from-sip'){if(this[_0xb93e('0x11')][_0x3c0eb2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]){if(_[_0xb93e('0x29')](this[_0xb93e('0x11')][_0x3c0eb2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x49')])){this[_0xb93e('0x11')][_0x3c0eb2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x49')]=_0x3c0eb2[_0xb93e('0x39')];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3c0eb2[_0xb93e('0x31')],util[_0xb93e('0x27')]({'id':this['agents'][_0x3c0eb2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xb93e('0x11')][_0x3c0eb2['channel'][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x3f')],'destconnectedlinenum':_0x3c0eb2['exten']},{'showHidden':![],'depth':null}));this['emit'](util[_0xb93e('0x3c')](_0xb93e('0x3d'),this[_0xb93e('0x11')][_0x3c0eb2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x4a')]),_0xb93e('0x3e'),{'id':this[_0xb93e('0x11')][_0x3c0eb2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3c0eb2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x3f')],'destconnectedlinenum':_0x3c0eb2[_0xb93e('0x39')]});}}}}}}}catch(_0xa8beb5){logger[_0xb93e('0x25')](_0xb93e('0x4b'),_0x3c0eb2[_0xb93e('0x31')],util[_0xb93e('0x27')](_0xa8beb5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x3880c0){try{if(this['isNotNull'](_0x3880c0)){logger[_0xb93e('0x2f')](_0xb93e('0x4c'),_0x3880c0[_0xb93e('0x31')],util['inspect'](_0x3880c0,{'showHidden':![],'depth':null}));if(_0x3880c0[_0xb93e('0x31')]===_0x3880c0[_0xb93e('0x32')]&&_0x3880c0[_0xb93e('0x39')]!='h'&&_0x3880c0['channel']!='OutgoingSpoolFailed'){_0x3880c0[_0xb93e('0x4d')]=_0x3880c0['application'][_0xb93e('0x4e')]();_0x3880c0['applicationdata']=_0x3880c0[_0xb93e('0x4f')]&&_0x3880c0[_0xb93e('0x4f')][_0xb93e('0x50')](_0xb93e('0x51'))?_0x3880c0[_0xb93e('0x4f')]:(_0x3880c0['appdata']||_0x3880c0[_0xb93e('0x52')])['toLowerCase']();logger[_0xb93e('0x23')](_0xb93e('0x53'),_0x3880c0[_0xb93e('0x31')],_0x3880c0['application'],_0x3880c0[_0xb93e('0x52')]);if(_[_0xb93e('0x29')](this[_0xb93e('0x10')][_0x3880c0[_0xb93e('0x31')]])){this['channels'][_0x3880c0[_0xb93e('0x31')]]=new Channel();this['channels'][_0x3880c0[_0xb93e('0x31')]][_0xb93e('0x45')]=_0x3880c0[_0xb93e('0x54')]?moment()[_0xb93e('0x55')](moment[_0xb93e('0x54')](_0x3880c0[_0xb93e('0x54')])[_0xb93e('0x56')](),_0xb93e('0x56'))[_0xb93e('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xb93e('0x46'));this['channels'][_0x3880c0[_0xb93e('0x31')]]['disposition']=_0xb93e('0xa');}_[_0xb93e('0x33')](this['channels'][_0x3880c0[_0xb93e('0x31')]],_[_0xb93e('0x34')](_0x3880c0,_[_0xb93e('0x35')](this[_0xb93e('0x10')][_0x3880c0[_0xb93e('0x31')]])));if(_[_0xb93e('0x57')](applications,_0x3880c0[_0xb93e('0x4d')])){this['channels'][_0x3880c0[_0xb93e('0x31')]][_0xb93e('0x58')]=_0x3880c0[_0xb93e('0x4d')];this[_0xb93e('0x10')][_0x3880c0[_0xb93e('0x31')]][_0xb93e('0x59')]=_0x3880c0[_0xb93e('0x52')];if(_0x3880c0[_0xb93e('0x4d')]===_0xb93e('0x6')&&_['startsWith'](_0x3880c0['applicationdata']['toLowerCase'](),_0xb93e('0x5a'))){var _0x869047=_0x3880c0[_0xb93e('0x52')][_0xb93e('0x38')]('=');var _0x1349a1=_0x869047[0x0][_0xb93e('0x4e')]()[_0xb93e('0x5b')](/cdr\((.*)\)/);if(_0x1349a1){this[_0xb93e('0x10')][_0x3880c0[_0xb93e('0x31')]][_0x1349a1[0x1]]=_0x869047[0x1];}}else if(_0x3880c0['application']===_0xb93e('0x5c')){this[_0xb93e('0x10')][_0x3880c0[_0xb93e('0x31')]][_0xb93e('0x5c')]=_0x3880c0[_0xb93e('0x52')][_0xb93e('0x38')](',')[0x0];}}}}}catch(_0x5a3397){logger['error'](_0xb93e('0x5d'),_0x3880c0[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x5a3397,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0x17')]=function(_0x32e6a2){try{if(this[_0xb93e('0x28')](_0x32e6a2)){logger['info'](_0xb93e('0x5e'),_0x32e6a2[_0xb93e('0x31')],_0x32e6a2[_0xb93e('0x32')],_0x32e6a2['calleridname'],_0x32e6a2['calleridnum']);logger[_0xb93e('0x2f')](_0xb93e('0x5f'),_0x32e6a2[_0xb93e('0x31')],util['inspect'](_0x32e6a2,{'showHidden':![],'depth':null}));if(_0x32e6a2[_0xb93e('0x31')]!==_0x32e6a2[_0xb93e('0x32')]){if(this['channels'][_0x32e6a2[_0xb93e('0x32')]]){if(_0x32e6a2[_0xb93e('0x48')]==='6'){if(!this['channels'][_0x32e6a2[_0xb93e('0x32')]][_0xb93e('0x60')]){var _0x49f234=moment();this[_0xb93e('0x10')][_0x32e6a2['linkedid']][_0xb93e('0x60')]=!![];this['channels'][_0x32e6a2[_0xb93e('0x32')]][_0xb93e('0x61')]=_0x49f234[_0xb93e('0x3c')](_0xb93e('0x46'));if(this[_0xb93e('0x10')][_0x32e6a2['linkedid']][_0xb93e('0x45')]){this['channels'][_0x32e6a2['linkedid']][_0xb93e('0x62')]=_0x49f234[_0xb93e('0x63')](this['channels'][_0x32e6a2[_0xb93e('0x32')]][_0xb93e('0x45')],_0xb93e('0x56'));}}this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x32')]]['linkedid']=_0x32e6a2[_0xb93e('0x31')];if(_0x32e6a2[_0xb93e('0x2e')]!==_0xb93e('0x3a')){this['channels'][_0x32e6a2[_0xb93e('0x32')]]['connectedlinenum']=_0x32e6a2[_0xb93e('0x2e')];}this[_0xb93e('0x10')][_0x32e6a2['linkedid']][_0xb93e('0x64')]=_0x32e6a2[_0xb93e('0x2d')];this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x32')]]['destinationchannel']=_0x32e6a2[_0xb93e('0x37')];this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x32')]][_0xb93e('0x47')]=dispositions[_['toNumber'](_0x32e6a2[_0xb93e('0x48')])];if(this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]){this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x32')]][_0xb93e('0x65')]=this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['id'];this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x32')]]['membername']=this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x4a')];}}}}else{if(this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x31')]]){if(_0x32e6a2[_0xb93e('0x48')]==='6'){if(this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]){this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x31')]][_0xb93e('0x65')]=this['agents'][_0x32e6a2['channel']['split']('-')[0x0]]['id'];this[_0xb93e('0x10')][_0x32e6a2['uniqueid']][_0xb93e('0x66')]=this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['name'];}}}}if(_0x32e6a2[_0xb93e('0x48')]==='6'&&_0x32e6a2[_0xb93e('0x44')]==='from-sip'){if(this[_0xb93e('0x11')][_0x32e6a2['channel']['split']('-')[0x0]]){this['agents'][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x49')]=_0x32e6a2[_0xb93e('0x39')];var _0x48d1a8,_0x54ea4e;if(this[_0xb93e('0x10')][_0x32e6a2['uniqueid']]){_0x48d1a8=this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x31')]]['routealias'];_0x54ea4e=this['channels'][_0x32e6a2[_0xb93e('0x31')]][_0xb93e('0x5c')];}else if(this['channels'][_0x32e6a2['linkedid']]){_0x48d1a8=this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x32')]][_0xb93e('0x67')];_0x54ea4e=this[_0xb93e('0x10')][_0x32e6a2[_0xb93e('0x32')]][_0xb93e('0x5c')];}logger[_0xb93e('0x2f')](_0xb93e('0x68'),_0x32e6a2['uniqueid'],util[_0xb93e('0x27')]({'id':this[_0xb93e('0x11')][_0x32e6a2['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x3f')],'destconnectedlinenum':_0x32e6a2[_0xb93e('0x39')],'routealias':_0x48d1a8,'queue':_0x54ea4e||undefined},{'showHidden':![],'depth':null}));this[_0xb93e('0x2b')](util['format'](_0xb93e('0x3d'),this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x4a')]),_0xb93e('0x3e'),{'id':this[_0xb93e('0x11')][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x32e6a2[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x3f')],'destconnectedlinenum':_0x32e6a2[_0xb93e('0x39')],'routealias':_0x48d1a8,'queue':_0x54ea4e||undefined});}}}}catch(_0x1f84b8){logger[_0xb93e('0x25')](_0xb93e('0x69'),_0x32e6a2[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x1f84b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0x6a')]=function(_0xbae99,_0x350371){try{if(this[_0xb93e('0x10')][_0xbae99]){logger[_0xb93e('0x23')](_0xb93e('0x6b'),_0xbae99,_0x350371);this[_0xb93e('0x10')][_0xbae99][_0xb93e('0x6c')]=!![];if(_[_0xb93e('0x6d')](_0x350371,_0xb93e('0x6e'))){_0x350371=_0x350371[_0xb93e('0x6f')](_0xb93e('0x6e'),'.WAV');}this[_0xb93e('0x10')][_0xbae99][_0xb93e('0x70')]=_0x350371;var _0x56f78e=_[_0xb93e('0x71')](this['channels'][_0xbae99]['monitors'],{'filename':_0x350371});if(_[_0xb93e('0x72')](_0x56f78e)){this[_0xb93e('0x10')][_0xbae99][_0xb93e('0x73')][_0xb93e('0x74')]({'filename':_0x350371,'createdAt':moment()[_0xb93e('0x3c')](_0xb93e('0x46')),'mixmonitorid':'','status':_0xb93e('0x75')});}}}catch(_0x54ca27){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0xbae99,util[_0xb93e('0x27')](_0x54ca27,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0x76')]=function(_0x52b35f){try{if(this[_0xb93e('0x28')](_0x52b35f)){logger[_0xb93e('0x2f')](_0xb93e('0x77'),_0x52b35f[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x52b35f,{'showHidden':![],'depth':null}));if(this['channels'][_0x52b35f['uniqueid']]&&_0x52b35f[_0xb93e('0x37')]!=_0xb93e('0x78')){if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')])){if(this[_0xb93e('0x28')](_0x52b35f['variable'][_0xb93e('0x7a')])){logger[_0xb93e('0x23')](_0xb93e('0x7b'),_0x52b35f[_0xb93e('0x31')],_0x52b35f[_0xb93e('0x7c')]);this['syncMixMonitorFilename'](_0x52b35f[_0xb93e('0x31')],_0x52b35f['value']);}else if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')][_0xb93e('0x7d')])){logger[_0xb93e('0x23')](_0xb93e('0x7e'),_0x52b35f['uniqueid'],_0x52b35f['value']);this[_0xb93e('0x10')][_0x52b35f['uniqueid']][_0xb93e('0x2e')]=_0x52b35f['value'];}else if(this[_0xb93e('0x28')](_0x52b35f['variable'][_0xb93e('0x7f')])){logger[_0xb93e('0x23')](_0xb93e('0x80'),_0x52b35f[_0xb93e('0x31')],_0x52b35f[_0xb93e('0x7c')]);this['channels'][_0x52b35f[_0xb93e('0x31')]]['callerid']=_0x52b35f[_0xb93e('0x7c')];}else if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')][_0xb93e('0x81')])){logger[_0xb93e('0x23')](_0xb93e('0x82'),_0x52b35f[_0xb93e('0x31')],_0x52b35f[_0xb93e('0x7c')]);this[_0xb93e('0x10')][_0x52b35f[_0xb93e('0x31')]][_0xb93e('0x83')]=_0x52b35f[_0xb93e('0x7c')];}else if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')]['xmd-queue'])){logger['info'](_0xb93e('0x84'),_0x52b35f['uniqueid'],_0x52b35f[_0xb93e('0x7c')][_0xb93e('0x38')](',')[0x0]);this['channels'][_0x52b35f[_0xb93e('0x31')]][_0xb93e('0x5c')]=_0x52b35f[_0xb93e('0x7c')][_0xb93e('0x38')](',')[0x0];}else if(this['isNotNull'](_0x52b35f[_0xb93e('0x79')]['xmd-originatecalleridnum'])){logger[_0xb93e('0x23')](_0xb93e('0x85'),_0x52b35f[_0xb93e('0x31')],_0x52b35f[_0xb93e('0x7c')]);this[_0xb93e('0x10')][_0x52b35f[_0xb93e('0x31')]][_0xb93e('0x86')]=_0x52b35f[_0xb93e('0x7c')];}else if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')]['xmd-destination'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x52b35f[_0xb93e('0x31')],_0x52b35f['value']);this[_0xb93e('0x10')][_0x52b35f[_0xb93e('0x31')]][_0xb93e('0x87')]=_0x52b35f[_0xb93e('0x7c')];}else if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')][_0xb93e('0x88')])){logger[_0xb93e('0x23')](_0xb93e('0x89'),_0x52b35f['uniqueid'],_0x52b35f['value']);this[_0xb93e('0x10')][_0x52b35f[_0xb93e('0x31')]]['calleridpreview']=_0x52b35f[_0xb93e('0x7c')];}else if(this[_0xb93e('0x28')](_0x52b35f['variable'][_0xb93e('0x8a')])){logger[_0xb93e('0x23')](_0xb93e('0x8b'),_0x52b35f[_0xb93e('0x31')],_0x52b35f[_0xb93e('0x7c')]);this[_0xb93e('0x10')][_0x52b35f[_0xb93e('0x31')]][_0xb93e('0x5c')]=_0x52b35f['value'];}else if(this[_0xb93e('0x28')](_0x52b35f['variable']['sipcallid'])){logger[_0xb93e('0x23')](_0xb93e('0x8c'),_0x52b35f['uniqueid'],_0x52b35f['value']);this[_0xb93e('0x10')][_0x52b35f[_0xb93e('0x31')]][_0xb93e('0x8d')]=_0x52b35f[_0xb93e('0x7c')];}}}else if(this['isNotNull'](_0x52b35f[_0xb93e('0x79')][_0xb93e('0x7a')])){if(_0x52b35f[_0xb93e('0x7c')]){var _0x434778=path[_0xb93e('0x8e')](_0x52b35f[_0xb93e('0x7c')])[_0xb93e('0x4a')];logger['info'](_0xb93e('0x7b'),_0x434778,_0x52b35f[_0xb93e('0x7c')]);this['syncMixMonitorFilename'](_0x434778,_0x52b35f[_0xb93e('0x7c')]);}}else if(this[_0xb93e('0x10')][_0x52b35f[_0xb93e('0x32')]]){if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')])){if(this[_0xb93e('0x28')](_0x52b35f[_0xb93e('0x79')]['sipcallid'])){logger['info'](_0xb93e('0x8c'),_0x52b35f[_0xb93e('0x32')],_0x52b35f[_0xb93e('0x7c')]);this[_0xb93e('0x10')][_0x52b35f['linkedid']]['sipcalllinkedid']=_0x52b35f[_0xb93e('0x7c')];}}}}}catch(_0x415b98){logger[_0xb93e('0x25')](_0xb93e('0x8f'),_0x52b35f[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x415b98,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x23dd89){try{if(this[_0xb93e('0x28')](_0x23dd89)){logger[_0xb93e('0x2f')]('[%s][voiceCallReport][hangup]\x20event:',_0x23dd89['uniqueid'],util[_0xb93e('0x27')](_0x23dd89,{'showHidden':![],'depth':null}));if(this[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]]){logger['info'](_0xb93e('0x90'),_0x23dd89[_0xb93e('0x31')],_0x23dd89[_0xb93e('0x91')]);var _0x2673be=moment();this[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x92')]=_0x2673be[_0xb93e('0x3c')](_0xb93e('0x46'));this[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x54')]=_0x2673be[_0xb93e('0x63')](this['channels'][_0x23dd89[_0xb93e('0x31')]]['starttime'],_0xb93e('0x56'));if(this[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x60')]){this[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]]['billableseconds']=_0x2673be[_0xb93e('0x63')](this[_0xb93e('0x10')][_0x23dd89['uniqueid']]['answertime'],'seconds');this[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x62')]=this[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x54')]-this['channels'][_0x23dd89['uniqueid']][_0xb93e('0x93')];}if(_0x23dd89[_0xb93e('0x44')]===_0xb93e('0x36')){if(this[_0xb93e('0x11')][_0x23dd89[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]){this['agents'][_0x23dd89[_0xb93e('0x37')]['split']('-')[0x0]]=_['omit'](this['agents'][_0x23dd89[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]],['destconnectedlinenum']);logger[_0xb93e('0x2f')](_0xb93e('0x94'),_0x23dd89[_0xb93e('0x31')],util['inspect']({'id':this[_0xb93e('0x11')][_0x23dd89[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x23dd89[_0xb93e('0x37')]['split']('-')[0x0]][_0xb93e('0x3f')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xb93e('0x3c')](_0xb93e('0x3d'),this[_0xb93e('0x11')][_0x23dd89['channel'][_0xb93e('0x38')]('-')[0x0]][_0xb93e('0x4a')]),_0xb93e('0x95'),{'id':this[_0xb93e('0x11')][_0x23dd89[_0xb93e('0x37')][_0xb93e('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xb93e('0x11')][_0x23dd89[_0xb93e('0x37')]['split']('-')[0x0]][_0xb93e('0x3f')]});for(var _0x3d181d=0x0;_0x3d181d<Object[_0xb93e('0x35')](this[_0xb93e('0x11')])[_0xb93e('0x96')];_0x3d181d++){var _0x2d830d=Object[_0xb93e('0x35')](this[_0xb93e('0x11')])[_0x3d181d];var _0x127341=this[_0xb93e('0x11')][_0x2d830d];if(_0x127341[_0xb93e('0x3f')]===Number(_0x23dd89[_0xb93e('0x3b')])){this[_0xb93e('0x2b')](util[_0xb93e('0x3c')](_0xb93e('0x3d'),_0x127341[_0xb93e('0x4a')]),_0xb93e('0x95'),{'id':_0x127341['id'],'destaccountcode':_0x127341[_0xb93e('0x3f')],'transfer':this['channels'][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x97')]});break;}}}}var _0x505378=this;Promise['resolve']()[_0xb93e('0x98')](function(){var _0x2c3d74=_0x505378[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]];if(typeof _0x2c3d74['transferType']==='undefined')return;if(_['isEmpty'](_0x2c3d74[_0xb93e('0x73')]))return;return RpcSetting['getSettings']()[_0xb93e('0x98')](function(_0x2149ac){if(!_0x2149ac[_0xb93e('0x99')])return;return Promise['resolve']()[_0xb93e('0x98')](function(){return ami[_0xb93e('0x9a')]({'action':_0xb93e('0x9b'),'channel':_0x2c3d74['channel']})[_0xb93e('0x9c')](function(){});})['then'](function(){return ami[_0xb93e('0x9a')]({'action':_0xb93e('0x9b'),'channel':_0x2c3d74[_0xb93e('0x9d')]})[_0xb93e('0x9c')](function(){})[_0xb93e('0x9e')](function(){var _0x51c9e1=_0x505378[_0xb93e('0x11')][_0x2c3d74[_0xb93e('0x9d')]['split']('-')[0x0]];if(!_0x51c9e1)return;io[_0xb93e('0x2b')](_0xb93e('0x9f'),{'agentId':_0x51c9e1['id'],'uniqueid':_0x2c3d74['uniqueid']});});});});})[_0xb93e('0x98')](function(){if(_0x23dd89[_0xb93e('0xa0')]===_0xb93e('0xa1')){_0x505378[_0xb93e('0x12')][_0x23dd89[_0xb93e('0x31')]]=_0x505378[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]];}else{if(_0x505378['channels'][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x83')]===_0xb93e('0xa2')&&_0x505378[_0xb93e('0x12')][_0x23dd89['uniqueid']]){_0x505378['channels'][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x31')]=[_0x505378[_0xb93e('0x10')][_0x23dd89['uniqueid']][_0xb93e('0x32')],_0x505378['channels'][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x32')]=_0x505378[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]][_0xb93e('0x31')]][0x0];delete _0x505378[_0xb93e('0x12')][_0x23dd89['uniqueid']];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x23dd89[_0xb93e('0x31')],util['inspect'](_0x505378[_0xb93e('0x10')][_0x23dd89['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb93e('0x2b')](_0xb93e('0xa3'),_0x505378['channels'][_0x23dd89[_0xb93e('0x31')]]);delete _0x505378[_0xb93e('0x10')][_0x23dd89[_0xb93e('0x31')]];});}}}catch(_0x4ea559){logger[_0xb93e('0x25')](_0xb93e('0xa4'),_0x23dd89[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x4ea559,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0xa5f869){try{if(this[_0xb93e('0x28')](_0xa5f869)){logger[_0xb93e('0x23')](_0xb93e('0xa5'),_0xa5f869[_0xb93e('0x31')],_0xa5f869['origtransferercalleridnum'],_0xa5f869[_0xb93e('0xa6')]);logger[_0xb93e('0x2f')](_0xb93e('0xa7'),_0xa5f869[_0xb93e('0x31')],util[_0xb93e('0x27')](_0xa5f869,{'showHidden':![],'depth':null}));var _0x4a95fb;if(this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xa8')]]){this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xa8')]][_0xb93e('0xa9')]=_0xa5f869[_0xb93e('0xaa')];this['channels'][_0xa5f869['transfereeuniqueid']][_0xb93e('0xab')]=_0xa5f869[_0xb93e('0xa6')];if(this[_0xb93e('0x10')][_0xa5f869['secondtransfereruniqueid']]){_0x4a95fb=this[_0xb93e('0x10')][_0xa5f869['secondtransfereruniqueid']];this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xac')]]=this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xa8')]];this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xa8')]]=_0x4a95fb;}this['channels'][_0xa5f869[_0xb93e('0xac')]][_0xb93e('0x97')]='ATTENDED';}else if(this[_0xb93e('0x10')][_0xa5f869['transfertargetuniqueid']]){this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xad')]][_0xb93e('0xa9')]=_0xa5f869['origtransferercalleridnum'];this['channels'][_0xa5f869[_0xb93e('0xad')]]['transferconnectedlinenum']=_0xa5f869[_0xb93e('0xa6')];if(this[_0xb93e('0x10')][_0xa5f869['origtransfereruniqueid']]){_0x4a95fb=this[_0xb93e('0x10')][_0xa5f869['origtransfereruniqueid']];this[_0xb93e('0x10')][_0xa5f869['origtransfereruniqueid']]=this['channels'][_0xa5f869[_0xb93e('0xad')]];this[_0xb93e('0x10')][_0xa5f869['transfertargetuniqueid']]=_0x4a95fb;}this[_0xb93e('0x10')][_0xa5f869['transfertargetuniqueid']][_0xb93e('0x97')]='ATTENDED';}if((this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xae')]]||this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xaf')]])&&this['channels'][_0xa5f869[_0xb93e('0xac')]]){var _0x2b72b3=_[_0xb93e('0xb0')]([this[_0xb93e('0x10')][_0xa5f869['origtransfereruniqueid']],this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xaf')]],this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xac')]]],function(_0x4ea833){return _0x4ea833&&_0x4ea833['type']===_0xb93e('0xa2')&&_0x4ea833['routeid'];});if(_0x2b72b3){if(this['channels'][_0xa5f869[_0xb93e('0xae')]])this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xae')]]['transferType']=_0xb93e('0xb1');if(this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xaf')]])this[_0xb93e('0x10')][_0xa5f869[_0xb93e('0xaf')]]['transferType']=_0xb93e('0xb1');this['channels'][_0xa5f869[_0xb93e('0xac')]][_0xb93e('0x97')]=_0xb93e('0xb1');}}}}catch(_0x1f0e9c){logger[_0xb93e('0x25')](_0xb93e('0xb2'),_0xa5f869[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x1f0e9c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0x20')]=function(_0x143e24){try{if(this['isNotNull'](_0x143e24)){logger[_0xb93e('0x23')](_0xb93e('0xb3'),_0x143e24[_0xb93e('0x31')],_0x143e24[_0xb93e('0xb4')],_0x143e24['extension']);logger[_0xb93e('0x2f')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x143e24['uniqueid'],util[_0xb93e('0x27')](_0x143e24,{'showHidden':![],'depth':null}));if(this[_0xb93e('0x10')][_0x143e24['transfereeuniqueid']]){this[_0xb93e('0x10')][_0x143e24['transfereeuniqueid']][_0xb93e('0xa9')]=_0x143e24[_0xb93e('0xb4')];this[_0xb93e('0x10')][_0x143e24[_0xb93e('0xa8')]][_0xb93e('0xab')]=_0x143e24[_0xb93e('0xb5')];this[_0xb93e('0x10')][_0x143e24['transfereeuniqueid']]['transferType']=_0xb93e('0xb6');this[_0xb93e('0x1a')]({'event':_0xb93e('0xa1'),'uniqueid':_0x143e24[_0xb93e('0xa8')],'context':_0x143e24[_0xb93e('0x44')],'channel':_0x143e24['transfererchannel']});}else{this[_0xb93e('0x10')][_0x143e24[_0xb93e('0xb7')]][_0xb93e('0x97')]=_0xb93e('0xb6');}}}catch(_0x178cfa){logger[_0xb93e('0x25')]('[%s][voiceCallReport][blindtransfer]',_0x143e24[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x178cfa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0xb8')]=function(_0x36a77a){try{if(this[_0xb93e('0x28')](_0x36a77a)){logger[_0xb93e('0x2f')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x36a77a[_0xb93e('0x31')],util['inspect'](_0x36a77a,{'showHidden':![],'depth':null}));if(this[_0xb93e('0x10')][_0x36a77a[_0xb93e('0x31')]]){if(!_['isNil'](this['channels'][_0x36a77a[_0xb93e('0x31')]]['answertime'])){this[_0xb93e('0x10')][_0x36a77a[_0xb93e('0x31')]]['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xb93e('0x23')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x36a77a['uniqueid'],this['channels'][_0x36a77a[_0xb93e('0x31')]][_0xb93e('0xb9')]);}}}}catch(_0x1e01d1){logger['error'](_0xb93e('0xba'),_0x36a77a['uniqueid'],util[_0xb93e('0x27')](_0x1e01d1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb93e('0x2a')][_0xb93e('0x22')]=function(_0x2164a4){try{if(this[_0xb93e('0x28')](_0x2164a4)){logger[_0xb93e('0x2f')](_0xb93e('0xbb'),_0x2164a4[_0xb93e('0x31')],util[_0xb93e('0x27')](_0x2164a4,{'showHidden':![],'depth':null}));if(this['channels'][_0x2164a4[_0xb93e('0x31')]]){if(!_[_0xb93e('0x72')](this[_0xb93e('0x10')][_0x2164a4['uniqueid']][_0xb93e('0xb9')])){this[_0xb93e('0x10')][_0x2164a4[_0xb93e('0x31')]][_0xb93e('0xbc')]+=moment()[_0xb93e('0xbd')](0x0)['diff'](this['channels'][_0x2164a4[_0xb93e('0x31')]][_0xb93e('0xb9')],'seconds');logger['info'](_0xb93e('0xbe'),_0x2164a4['uniqueid'],this[_0xb93e('0x10')][_0x2164a4['uniqueid']][_0xb93e('0xbc')]);delete this[_0xb93e('0x10')][_0x2164a4[_0xb93e('0x31')]]['mohstarttime'];}}}}catch(_0x4a92f8){logger[_0xb93e('0x25')](_0xb93e('0xbf'),_0x2164a4['uniqueid'],util[_0xb93e('0x27')](_0x4a92f8,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 1eb3871..6d8f088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3017=['localhost','outboundChannels','outbound','variables','syncDialBegin','dialend','bind','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','channels','format','called','channel','substring','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','applications','merge','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','addVariable','keys','variable','value','info','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','endtime','diff','starttime','seconds','complete','total','answered','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','match','[%s][voiceDialReport][newexten]','lodash','util','../../../config/environment','../../../config/logger','defaults','redis'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0x3017,0xe4));var _0x7301=function(_0x4a56af,_0x59b632){_0x4a56af=_0x4a56af-0x0;var _0x3eecc2=_0x3017[_0x4a56af];return _0x3eecc2;};'use strict';var _=require(_0x7301('0x0'));var moment=require('moment');var util=require(_0x7301('0x1'));var Redis=require('ioredis');var config=require(_0x7301('0x2'));var logger=require(_0x7301('0x3'))('ami');var ami=require('../ami');config['redis']=_[_0x7301('0x4')](config[_0x7301('0x5')],{'host':_0x7301('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7301('0x5')]));function VoiceDialReport(_0x4d057f){this['channels']=_0x4d057f[_0x7301('0x7')];this[_0x7301('0x8')]=_0x4d057f[_0x7301('0x8')];this['applications']={};this[_0x7301('0x9')]={};ami['on']('dialbegin',this[_0x7301('0xa')]['bind'](this));ami['on'](_0x7301('0xb'),this['syncDialEnd'][_0x7301('0xc')](this));ami['on']('varset',this[_0x7301('0xd')][_0x7301('0xc')](this));ami['on'](_0x7301('0xe'),this[_0x7301('0xf')][_0x7301('0xc')](this));ami['on'](_0x7301('0x10'),this[_0x7301('0x11')][_0x7301('0xc')](this));}VoiceDialReport[_0x7301('0x12')][_0x7301('0x13')]=function(_0x24d812){return _0x24d812!==null&&!_[_0x7301('0x14')](_0x24d812);};VoiceDialReport[_0x7301('0x12')]['emit']=function(_0x57c773,_0x2c2acb,_0xb9e43a){io['to'](_0x57c773)[_0x7301('0x15')](_0x2c2acb,_0xb9e43a);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x2afe91){try{if(this[_0x7301('0x13')](_0x2afe91)){logger[_0x7301('0x16')](_0x7301('0x17'),_0x2afe91[_0x7301('0x18')],util['inspect'](_0x2afe91,{'showHidden':![],'depth':null}));if(this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]]){_['merge'](this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]],{'starttime':moment()[_0x7301('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x7301('0x1b'),'interface':_0x2afe91[_0x7301('0x1c')][_0x7301('0x1d')](0x0,_0x2afe91[_0x7301('0x1c')][_0x7301('0x1e')]('-')),'membername':_0x2afe91[_0x7301('0x1c')][_0x7301('0x1d')](_0x2afe91[_0x7301('0x1c')]['lastIndexOf']('/')+0x1,_0x2afe91[_0x7301('0x1c')][_0x7301('0x1e')]('-'))},_[_0x7301('0x1f')](_0x2afe91,[_0x7301('0x20'),_0x7301('0x21')]));logger['info'](_0x7301('0x22'),_0x2afe91[_0x7301('0x18')],this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]]['membername'],this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]][_0x7301('0x23')]);logger[_0x7301('0x16')](_0x7301('0x24'),_0x2afe91['uniqueid'],util[_0x7301('0x25')](this[_0x7301('0x19')][_0x2afe91['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x7301('0x26')][_0x2afe91[_0x7301('0x18')]])_[_0x7301('0x27')](this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]],this[_0x7301('0x26')][_0x2afe91[_0x7301('0x18')]]);this[_0x7301('0x15')]('voice:outbound',_0x7301('0x28'),this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]]);logger[_0x7301('0x16')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x2afe91[_0x7301('0x18')],util[_0x7301('0x25')](this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7301('0x29'),this[_0x7301('0x19')][_0x2afe91[_0x7301('0x18')]]);}}}catch(_0x5566f3){logger[_0x7301('0x2a')](_0x7301('0x2b'),_0x2afe91['uniqueid'],util[_0x7301('0x25')](_0x5566f3,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x7301('0x2c')]=function(_0x36296e){try{if(this[_0x7301('0x13')](_0x36296e)){logger[_0x7301('0x16')](_0x7301('0x2d'),_0x36296e[_0x7301('0x18')],util['inspect'](_0x36296e,{'showHidden':![],'depth':null}));if(this[_0x7301('0x19')][_0x36296e[_0x7301('0x18')]]){this[_0x7301('0x19')][_0x36296e['uniqueid']]['dialstatus']=_0x36296e[_0x7301('0x2e')];if(_0x36296e[_0x7301('0x2e')]===_0x7301('0x2f')){this['channels'][_0x36296e[_0x7301('0x18')]][_0x7301('0x30')]=_0x36296e[_0x7301('0x30')];this[_0x7301('0x19')][_0x36296e[_0x7301('0x18')]][_0x7301('0x31')]=_0x36296e[_0x7301('0x31')];this[_0x7301('0x19')][_0x36296e[_0x7301('0x18')]][_0x7301('0x32')]=moment()[_0x7301('0x1a')](_0x7301('0x33'));this['channels'][_0x36296e[_0x7301('0x18')]]['lastevent']='connect';logger['info']('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x36296e[_0x7301('0x18')],_0x36296e['channel'][_0x7301('0x1d')](_0x36296e['channel'][_0x7301('0x1e')]('/')+0x1,_0x36296e[_0x7301('0x1c')]['lastIndexOf']('-')));logger['debug'](_0x7301('0x34'),_0x36296e[_0x7301('0x18')],util[_0x7301('0x25')](this['channels'][_0x36296e[_0x7301('0x18')]],{'showHidden':![],'depth':null}));ami[_0x7301('0x15')](_0x7301('0x35'),this[_0x7301('0x19')][_0x36296e[_0x7301('0x18')]]);}logger[_0x7301('0x16')](_0x7301('0x36'),_0x36296e[_0x7301('0x18')],util[_0x7301('0x25')](this['channels'][_0x36296e[_0x7301('0x18')]],{'showHidden':![],'depth':null}));this[_0x7301('0x15')](_0x7301('0x37'),_0x7301('0x28'),this[_0x7301('0x19')][_0x36296e[_0x7301('0x18')]]);}}}catch(_0xeb8c72){logger[_0x7301('0x2a')]('[%s][voiceDialReport][dialend]',_0x36296e['uniqueid'],util[_0x7301('0x25')](_0xeb8c72,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7301('0x12')]['syncVarSet']=function(_0x5e2c53){try{if(this[_0x7301('0x13')](_0x5e2c53)){logger[_0x7301('0x16')]('[%s][voiceDialReport][varset]\x20event:',_0x5e2c53['uniqueid'],util[_0x7301('0x25')](_0x5e2c53,{'showHidden':![],'depth':null}));this[_0x7301('0x38')](_0x5e2c53[_0x7301('0x18')],_[_0x7301('0x39')](_0x5e2c53[_0x7301('0x3a')])[0x0],_0x5e2c53[_0x7301('0x3b')]);if(this[_0x7301('0x13')](_0x5e2c53[_0x7301('0x3a')])&&this[_0x7301('0x13')](_0x5e2c53['variable']['outboundrouteid'])){if(_[_0x7301('0x14')](this[_0x7301('0x19')][_0x5e2c53[_0x7301('0x18')]])){this[_0x7301('0x19')][_0x5e2c53[_0x7301('0x18')]]={'routeId':_0x5e2c53['value'],'variables':this['variables'][_0x5e2c53[_0x7301('0x18')]],'motionChannel':'voice'};logger[_0x7301('0x3c')](_0x7301('0x3d'),_0x5e2c53[_0x7301('0x18')],_0x5e2c53[_0x7301('0x3a')]['outboundrouteid'],_['keys'](_0x5e2c53[_0x7301('0x3a')])[0x0],_0x5e2c53['value']);logger['debug'](_0x7301('0x3e'),_0x5e2c53[_0x7301('0x18')],util[_0x7301('0x25')](this[_0x7301('0x19')][_0x5e2c53[_0x7301('0x18')]],{'showHidden':![],'depth':null}));this[_0x7301('0x15')](_0x7301('0x37'),_0x7301('0x28'),this[_0x7301('0x19')][_0x5e2c53['uniqueid']]);}}}}catch(_0x30143c){logger[_0x7301('0x2a')]('[%s][voiceDialReport][varset]',_0x5e2c53[_0x7301('0x18')],util['inspect'](_0x30143c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7301('0x12')][_0x7301('0x38')]=function(_0x5d975f,_0x1f730a,_0x2a5ea6){var _0x21b3de=[_0x7301('0x3f'),_0x7301('0x40'),_0x7301('0x41'),_0x7301('0x42'),_0x7301('0x43'),'rtpaudioqoslossbridged',_0x7301('0x44'),'rtpaudioqosrttbridged',_0x7301('0x45'),_0x7301('0x46'),_0x7301('0x47'),_0x7301('0x48'),_0x7301('0x49'),_0x7301('0x4a'),'memberinterface',_0x7301('0x4b'),_0x7301('0x4c'),_0x7301('0x4d'),_0x7301('0x4e')];if(!_[_0x7301('0x4f')](_0x1f730a)&&!_[_0x7301('0x50')](_0x21b3de,_0x1f730a)){if(_[_0x7301('0x14')](this['variables'][_0x5d975f])){this[_0x7301('0x9')][_0x5d975f]={};}this[_0x7301('0x9')][_0x5d975f][_0x1f730a]=_0x2a5ea6;}};VoiceDialReport[_0x7301('0x12')][_0x7301('0x11')]=function(_0x40ee70){try{if(this[_0x7301('0x13')](_0x40ee70)){logger[_0x7301('0x16')](_0x7301('0x51'),_0x40ee70[_0x7301('0x18')],util['inspect'](_0x40ee70,{'showHidden':![],'depth':null}));if(this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]]){logger['info'](_0x7301('0x52'),_0x40ee70[_0x7301('0x18')],_0x40ee70[_0x7301('0x53')]);this[_0x7301('0x19')][_0x40ee70['uniqueid']]['endtime']=moment()[_0x7301('0x1a')](_0x7301('0x33'));this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x54')]=moment(this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x55')])[_0x7301('0x56')](this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x57')],_0x7301('0x58'));this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]]['lastevent']=_0x7301('0x59');this['outbound'][_0x7301('0x5a')]+=0x1;if(this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x32')]){this[_0x7301('0x8')][_0x7301('0x5b')]+=0x1;this['channels'][_0x40ee70[_0x7301('0x18')]]['holdtime']=moment(this['channels'][_0x40ee70[_0x7301('0x18')]][_0x7301('0x32')])[_0x7301('0x56')](this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x57')],_0x7301('0x58'));this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x5c')]=moment(this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x55')])[_0x7301('0x56')](this['channels'][_0x40ee70[_0x7301('0x18')]]['answertime'],_0x7301('0x58'));this[_0x7301('0x8')][_0x7301('0x5d')]+=this['channels'][_0x40ee70[_0x7301('0x18')]][_0x7301('0x5e')]||0x0;this[_0x7301('0x8')][_0x7301('0x5f')]+=this['channels'][_0x40ee70[_0x7301('0x18')]][_0x7301('0x5c')];}this[_0x7301('0x8')][_0x7301('0x60')]+=this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]][_0x7301('0x54')];logger['debug'](_0x7301('0x61'),_0x40ee70[_0x7301('0x18')],util['inspect'](this['channels'][_0x40ee70[_0x7301('0x18')]],{'showHidden':![],'depth':null}));ami[_0x7301('0x15')](_0x7301('0x62'),this[_0x7301('0x19')][_0x40ee70['uniqueid']]);logger[_0x7301('0x16')](_0x7301('0x63'),_0x40ee70[_0x7301('0x18')],util[_0x7301('0x25')](this[_0x7301('0x19')][_0x40ee70['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x7301('0x15')](_0x7301('0x64'),this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]]);logger['debug'](_0x7301('0x65'),_0x40ee70[_0x7301('0x18')],util[_0x7301('0x25')](this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]],{'showHidden':![],'depth':null}));this[_0x7301('0x15')](_0x7301('0x37'),_0x7301('0x66'),this[_0x7301('0x8')]);logger[_0x7301('0x3c')](_0x7301('0x67'),JSON[_0x7301('0x68')](this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]]));logger[_0x7301('0x16')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x40ee70[_0x7301('0x18')],util[_0x7301('0x25')](this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x7301('0x69'),this['channels'][_0x40ee70[_0x7301('0x18')]]);delete this[_0x7301('0x19')][_0x40ee70[_0x7301('0x18')]];}else if(this[_0x7301('0x19')][_0x40ee70[_0x7301('0x6a')]]){this[_0x7301('0x19')][_0x40ee70['linkedid']][_0x7301('0x18')]=this['channels'][_0x40ee70['linkedid']]['destuniqueid'];}if(this['variables'][_0x40ee70[_0x7301('0x18')]]){delete this[_0x7301('0x9')][_0x40ee70[_0x7301('0x18')]];}}}catch(_0x319c5c){logger[_0x7301('0x2a')](_0x7301('0x6b'),_0x40ee70[_0x7301('0x18')],util[_0x7301('0x25')](_0x319c5c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7301('0x12')][_0x7301('0xf')]=function(_0x2696ca){try{if(this[_0x7301('0x13')](_0x2696ca)){logger[_0x7301('0x16')](_0x7301('0x6c'),_0x2696ca[_0x7301('0x18')],util['inspect'](_0x2696ca,{'showHidden':![],'depth':null}));if(_0x2696ca['application'][_0x7301('0x6d')]()===_0x7301('0x6e')){_0x2696ca[_0x7301('0x6f')]=(_0x2696ca[_0x7301('0x70')]||_0x2696ca[_0x7301('0x6f')])[_0x7301('0x6d')]();if(_[_0x7301('0x71')](_0x2696ca[_0x7301('0x6f')],_0x7301('0x72'))){if(_['isUndefined'](this[_0x7301('0x26')][_0x2696ca[_0x7301('0x18')]]))this['applications'][_0x2696ca['uniqueid']]={};logger[_0x7301('0x3c')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x2696ca[_0x7301('0x18')],_0x2696ca['application'],_0x2696ca['applicationdata']);var _0x4d66be=_0x2696ca[_0x7301('0x6f')]['split']('=');var _0x2885e0=_0x4d66be[0x0][_0x7301('0x73')](/cdr\((.*)\)/);if(_0x2885e0)this[_0x7301('0x26')][_0x2696ca[_0x7301('0x18')]][_0x2885e0[0x1]]=_0x4d66be[0x1];}}}}catch(_0x47cbc3){logger[_0x7301('0x2a')](_0x7301('0x74'),_0x2696ca[_0x7301('0x18')],util['inspect'](_0x47cbc3,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0x3a9a=['dialend','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','privilege','info','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','applications','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','emit','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','outboundrouteid','isUndefined','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','holdtime','sumHoldTime','sumBillable','billableseconds','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','application','toLowerCase','set','applicationdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','lodash','util','ioredis','../../../config/logger','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','variables','syncDialBegin','bind'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x3a9a,0x142));var _0xa3a9=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x3a9a[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xa3a9('0x0'));var moment=require('moment');var util=require(_0xa3a9('0x1'));var Redis=require(_0xa3a9('0x2'));var config=require('../../../config/environment');var logger=require(_0xa3a9('0x3'))('ami');var ami=require(_0xa3a9('0x4'));config[_0xa3a9('0x5')]=_[_0xa3a9('0x6')](config[_0xa3a9('0x5')],{'host':_0xa3a9('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa3a9('0x5')]));function VoiceDialReport(_0x358898){this[_0xa3a9('0x8')]=_0x358898[_0xa3a9('0x9')];this[_0xa3a9('0xa')]=_0x358898[_0xa3a9('0xa')];this['applications']={};this[_0xa3a9('0xb')]={};ami['on']('dialbegin',this[_0xa3a9('0xc')][_0xa3a9('0xd')](this));ami['on'](_0xa3a9('0xe'),this[_0xa3a9('0xf')][_0xa3a9('0xd')](this));ami['on'](_0xa3a9('0x10'),this[_0xa3a9('0x11')][_0xa3a9('0xd')](this));ami['on'](_0xa3a9('0x12'),this[_0xa3a9('0x13')][_0xa3a9('0xd')](this));ami['on'](_0xa3a9('0x14'),this[_0xa3a9('0x15')][_0xa3a9('0xd')](this));}VoiceDialReport[_0xa3a9('0x16')][_0xa3a9('0x17')]=function(_0x3d821a){return _0x3d821a!==null&&!_['isUndefined'](_0x3d821a);};VoiceDialReport['prototype']['emit']=function(_0x3b8375,_0x1f29e1,_0x3b830d){io['to'](_0x3b8375)['emit'](_0x1f29e1,_0x3b830d);};VoiceDialReport[_0xa3a9('0x16')][_0xa3a9('0xc')]=function(_0x27c51f){try{if(this['isNotNull'](_0x27c51f)){logger[_0xa3a9('0x18')](_0xa3a9('0x19'),_0x27c51f[_0xa3a9('0x1a')],util['inspect'](_0x27c51f,{'showHidden':![],'depth':null}));if(this[_0xa3a9('0x8')][_0x27c51f[_0xa3a9('0x1a')]]){_[_0xa3a9('0x1b')](this[_0xa3a9('0x8')][_0x27c51f[_0xa3a9('0x1a')]],{'starttime':moment()[_0xa3a9('0x1c')](_0xa3a9('0x1d')),'lastevent':_0xa3a9('0x1e'),'interface':_0x27c51f['channel'][_0xa3a9('0x1f')](0x0,_0x27c51f[_0xa3a9('0x20')][_0xa3a9('0x21')]('-')),'membername':_0x27c51f[_0xa3a9('0x20')][_0xa3a9('0x1f')](_0x27c51f[_0xa3a9('0x20')]['lastIndexOf']('/')+0x1,_0x27c51f[_0xa3a9('0x20')]['lastIndexOf']('-'))},_[_0xa3a9('0x22')](_0x27c51f,[_0xa3a9('0x23'),_0xa3a9('0x24')]));logger[_0xa3a9('0x25')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x27c51f[_0xa3a9('0x1a')],this[_0xa3a9('0x8')][_0x27c51f['uniqueid']][_0xa3a9('0x26')],this[_0xa3a9('0x8')][_0x27c51f['uniqueid']][_0xa3a9('0x27')]);logger['debug'](_0xa3a9('0x28'),_0x27c51f[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](this[_0xa3a9('0x8')][_0x27c51f[_0xa3a9('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0xa3a9('0x2a')][_0x27c51f[_0xa3a9('0x1a')]])_[_0xa3a9('0x1b')](this[_0xa3a9('0x8')][_0x27c51f[_0xa3a9('0x1a')]],this[_0xa3a9('0x2a')][_0x27c51f[_0xa3a9('0x1a')]]);this['emit'](_0xa3a9('0x2b'),_0xa3a9('0x2c'),this['channels'][_0x27c51f['uniqueid']]);logger[_0xa3a9('0x18')](_0xa3a9('0x2d'),_0x27c51f[_0xa3a9('0x1a')],util['inspect'](this[_0xa3a9('0x8')][_0x27c51f[_0xa3a9('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xa3a9('0x2e')](_0xa3a9('0x2f'),this['channels'][_0x27c51f[_0xa3a9('0x1a')]]);}}}catch(_0x5a8fb3){logger[_0xa3a9('0x30')](_0xa3a9('0x31'),_0x27c51f[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](_0x5a8fb3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3a9('0x16')]['syncDialEnd']=function(_0x567aed){try{if(this[_0xa3a9('0x17')](_0x567aed)){logger[_0xa3a9('0x18')]('[%s][voiceDialReport][dialend]\x20event:',_0x567aed[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](_0x567aed,{'showHidden':![],'depth':null}));if(this['channels'][_0x567aed[_0xa3a9('0x1a')]]){this[_0xa3a9('0x8')][_0x567aed['uniqueid']][_0xa3a9('0x32')]=_0x567aed[_0xa3a9('0x32')];if(_0x567aed['dialstatus']===_0xa3a9('0x33')){this[_0xa3a9('0x8')][_0x567aed[_0xa3a9('0x1a')]][_0xa3a9('0x34')]=_0x567aed[_0xa3a9('0x34')];this[_0xa3a9('0x8')][_0x567aed[_0xa3a9('0x1a')]][_0xa3a9('0x35')]=_0x567aed[_0xa3a9('0x35')];this['channels'][_0x567aed[_0xa3a9('0x1a')]][_0xa3a9('0x36')]=moment()[_0xa3a9('0x1c')](_0xa3a9('0x1d'));this[_0xa3a9('0x8')][_0x567aed[_0xa3a9('0x1a')]][_0xa3a9('0x37')]=_0xa3a9('0x38');logger[_0xa3a9('0x25')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x567aed[_0xa3a9('0x1a')],_0x567aed[_0xa3a9('0x20')]['substring'](_0x567aed[_0xa3a9('0x20')][_0xa3a9('0x21')]('/')+0x1,_0x567aed[_0xa3a9('0x20')][_0xa3a9('0x21')]('-')));logger[_0xa3a9('0x18')](_0xa3a9('0x39'),_0x567aed[_0xa3a9('0x1a')],util['inspect'](this[_0xa3a9('0x8')][_0x567aed[_0xa3a9('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xa3a9('0x2e')](_0xa3a9('0x3a'),this[_0xa3a9('0x8')][_0x567aed['uniqueid']]);}logger[_0xa3a9('0x18')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x567aed['uniqueid'],util[_0xa3a9('0x29')](this['channels'][_0x567aed[_0xa3a9('0x1a')]],{'showHidden':![],'depth':null}));this[_0xa3a9('0x2e')]('voice:outbound',_0xa3a9('0x2c'),this['channels'][_0x567aed[_0xa3a9('0x1a')]]);}}}catch(_0x44379a){logger[_0xa3a9('0x30')]('[%s][voiceDialReport][dialend]',_0x567aed[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](_0x44379a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3a9('0x16')][_0xa3a9('0x11')]=function(_0xcf5cee){try{if(this['isNotNull'](_0xcf5cee)){logger['debug'](_0xa3a9('0x3b'),_0xcf5cee['uniqueid'],util[_0xa3a9('0x29')](_0xcf5cee,{'showHidden':![],'depth':null}));this[_0xa3a9('0x3c')](_0xcf5cee[_0xa3a9('0x1a')],_[_0xa3a9('0x3d')](_0xcf5cee['variable'])[0x0],_0xcf5cee['value']);if(this[_0xa3a9('0x17')](_0xcf5cee[_0xa3a9('0x3e')])&&this['isNotNull'](_0xcf5cee['variable'][_0xa3a9('0x3f')])){if(_[_0xa3a9('0x40')](this[_0xa3a9('0x8')][_0xcf5cee[_0xa3a9('0x1a')]])){this[_0xa3a9('0x8')][_0xcf5cee[_0xa3a9('0x1a')]]={'routeId':_0xcf5cee[_0xa3a9('0x41')],'variables':this['variables'][_0xcf5cee['uniqueid']],'motionChannel':_0xa3a9('0x42')};logger[_0xa3a9('0x25')](_0xa3a9('0x43'),_0xcf5cee[_0xa3a9('0x1a')],_0xcf5cee[_0xa3a9('0x3e')][_0xa3a9('0x3f')],_[_0xa3a9('0x3d')](_0xcf5cee[_0xa3a9('0x3e')])[0x0],_0xcf5cee[_0xa3a9('0x41')]);logger[_0xa3a9('0x18')](_0xa3a9('0x44'),_0xcf5cee[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](this[_0xa3a9('0x8')][_0xcf5cee[_0xa3a9('0x1a')]],{'showHidden':![],'depth':null}));this[_0xa3a9('0x2e')](_0xa3a9('0x2b'),_0xa3a9('0x2c'),this['channels'][_0xcf5cee[_0xa3a9('0x1a')]]);}}}}catch(_0x599b4d){logger[_0xa3a9('0x30')](_0xa3a9('0x45'),_0xcf5cee['uniqueid'],util['inspect'](_0x599b4d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3a9('0x16')]['addVariable']=function(_0x262e76,_0x3a412c,_0x733db1){var _0x27826f=['rtpaudioqos',_0xa3a9('0x46'),_0xa3a9('0x47'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0xa3a9('0x48'),_0xa3a9('0x49'),'sipcallid','sipuri',_0xa3a9('0x4a'),'bridgepvtcallid',_0xa3a9('0x4b'),_0xa3a9('0x4c'),_0xa3a9('0x4d'),_0xa3a9('0x4e'),_0xa3a9('0x26'),'memberpenalty',_0xa3a9('0x4f')];if(!_[_0xa3a9('0x50')](_0x3a412c)&&!_['includes'](_0x27826f,_0x3a412c)){if(_[_0xa3a9('0x40')](this[_0xa3a9('0xb')][_0x262e76])){this[_0xa3a9('0xb')][_0x262e76]={};}this[_0xa3a9('0xb')][_0x262e76][_0x3a412c]=_0x733db1;}};VoiceDialReport[_0xa3a9('0x16')][_0xa3a9('0x15')]=function(_0x166b00){try{if(this[_0xa3a9('0x17')](_0x166b00)){logger[_0xa3a9('0x18')](_0xa3a9('0x51'),_0x166b00[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](_0x166b00,{'showHidden':![],'depth':null}));if(this[_0xa3a9('0x8')][_0x166b00['uniqueid']]){logger[_0xa3a9('0x25')](_0xa3a9('0x52'),_0x166b00[_0xa3a9('0x1a')],_0x166b00[_0xa3a9('0x53')]);this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x54')]=moment()[_0xa3a9('0x1c')](_0xa3a9('0x1d'));this['channels'][_0x166b00['uniqueid']][_0xa3a9('0x55')]=moment(this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]]['endtime'])[_0xa3a9('0x56')](this['channels'][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x57')],_0xa3a9('0x58'));this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x37')]=_0xa3a9('0x59');this[_0xa3a9('0xa')][_0xa3a9('0x5a')]+=0x1;if(this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]]['answertime']){this[_0xa3a9('0xa')]['answered']+=0x1;this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x5b')]=moment(this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]]['answertime'])[_0xa3a9('0x56')](this[_0xa3a9('0x8')][_0x166b00['uniqueid']][_0xa3a9('0x57')],_0xa3a9('0x58'));this['channels'][_0x166b00[_0xa3a9('0x1a')]]['billableseconds']=moment(this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x54')])[_0xa3a9('0x56')](this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x36')],_0xa3a9('0x58'));this['outbound'][_0xa3a9('0x5c')]+=this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x5b')]||0x0;this[_0xa3a9('0xa')][_0xa3a9('0x5d')]+=this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]][_0xa3a9('0x5e')];}this[_0xa3a9('0xa')]['sumDuration']+=this[_0xa3a9('0x8')][_0x166b00['uniqueid']][_0xa3a9('0x55')];logger[_0xa3a9('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x166b00[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xa3a9('0x2e')](_0xa3a9('0x5f'),this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]]);logger[_0xa3a9('0x18')](_0xa3a9('0x60'),_0x166b00[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialend',this[_0xa3a9('0x8')][_0x166b00['uniqueid']]);logger[_0xa3a9('0x18')](_0xa3a9('0x61'),_0x166b00[_0xa3a9('0x1a')],util['inspect'](this[_0xa3a9('0x8')][_0x166b00['uniqueid']],{'showHidden':![],'depth':null}));this[_0xa3a9('0x2e')]('voice:outbound',_0xa3a9('0x62'),this[_0xa3a9('0xa')]);logger[_0xa3a9('0x25')](_0xa3a9('0x63'),JSON[_0xa3a9('0x64')](this['channels'][_0x166b00[_0xa3a9('0x1a')]]));logger[_0xa3a9('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x166b00['uniqueid'],util[_0xa3a9('0x29')](this['channels'][_0x166b00['uniqueid']],{'showHidden':![],'depth':null}));this[_0xa3a9('0x2e')](_0xa3a9('0x2b'),_0xa3a9('0x65'),this['channels'][_0x166b00['uniqueid']]);delete this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x1a')]];}else if(this['channels'][_0x166b00['linkedid']]){this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x66')]]['uniqueid']=this[_0xa3a9('0x8')][_0x166b00[_0xa3a9('0x66')]][_0xa3a9('0x67')];}if(this[_0xa3a9('0xb')][_0x166b00[_0xa3a9('0x1a')]]){delete this[_0xa3a9('0xb')][_0x166b00[_0xa3a9('0x1a')]];}}}catch(_0x2d22fc){logger['error'](_0xa3a9('0x68'),_0x166b00['uniqueid'],util[_0xa3a9('0x29')](_0x2d22fc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3a9('0x16')]['syncNewExten']=function(_0x99f857){try{if(this[_0xa3a9('0x17')](_0x99f857)){logger[_0xa3a9('0x18')]('[%s][voiceDialReport][newexten]\x20event:',_0x99f857[_0xa3a9('0x1a')],util[_0xa3a9('0x29')](_0x99f857,{'showHidden':![],'depth':null}));if(_0x99f857[_0xa3a9('0x69')][_0xa3a9('0x6a')]()===_0xa3a9('0x6b')){_0x99f857[_0xa3a9('0x6c')]=(_0x99f857['appdata']||_0x99f857[_0xa3a9('0x6c')])[_0xa3a9('0x6a')]();if(_[_0xa3a9('0x6d')](_0x99f857[_0xa3a9('0x6c')],'cdr(')){if(_[_0xa3a9('0x40')](this[_0xa3a9('0x2a')][_0x99f857[_0xa3a9('0x1a')]]))this[_0xa3a9('0x2a')][_0x99f857[_0xa3a9('0x1a')]]={};logger['info'](_0xa3a9('0x6e'),_0x99f857[_0xa3a9('0x1a')],_0x99f857[_0xa3a9('0x69')],_0x99f857[_0xa3a9('0x6c')]);var _0x45c781=_0x99f857[_0xa3a9('0x6c')][_0xa3a9('0x6f')]('=');var _0x345800=_0x45c781[0x0]['match'](/cdr\((.*)\)/);if(_0x345800)this[_0xa3a9('0x2a')][_0x99f857[_0xa3a9('0x1a')]][_0x345800[0x1]]=_0x45c781[0x1];}}}}catch(_0x356426){logger[_0xa3a9('0x30')]('[%s][voiceDialReport][newexten]',_0x99f857['uniqueid'],util['inspect'](_0x356426,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
index e9bdae3..40750a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f51=['syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','pTalking','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','status','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','YYYY-MM-DD\x20HH:mm:ss','position','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','membername','holdtime','queuecallerexit','transfer','reason','startsWith','channel','toLowerCase','linkedid','queuecallerexitAt','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','variables','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','milliseconds','diff','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertype','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDEDTRANSFER','origtransfereruniqueid','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','syncHangup','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','applicationdata','appdata','CDR(routeAlias)','cdr(','application','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer'];(function(_0x4997a7,_0x47e5a2){var _0xfb48cd=function(_0x1f5ea1){while(--_0x1f5ea1){_0x4997a7['push'](_0x4997a7['shift']());}};_0xfb48cd(++_0x47e5a2);}(_0x4f51,0x1ac));var _0x14f5=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x4f51[_0x58965a];return _0x254efc;};'use strict';var _=require(_0x14f5('0x0'));var moment=require(_0x14f5('0x1'));var util=require('util');var md5=require(_0x14f5('0x2'));var Redis=require('ioredis');var config=require(_0x14f5('0x3'));var logger=require(_0x14f5('0x4'))(_0x14f5('0x5'));var ami=require(_0x14f5('0x6'));var QueueReport=require(_0x14f5('0x7'));config['redis']=_[_0x14f5('0x8')](config[_0x14f5('0x9')],{'host':_0x14f5('0xa'),'port':0x18eb});var io=require(_0x14f5('0xb'))(new Redis(config[_0x14f5('0x9')]));var Sequence=function(){};Sequence[_0x14f5('0xc')]['enqueue']=function(_0x43a1f8){this['tail']=this[_0x14f5('0xd')]?this['tail'][_0x14f5('0xe')](_0x43a1f8):_0x43a1f8();};function VoiceQueueReport(_0x14df9d){this[_0x14f5('0xf')]=new Sequence();this[_0x14f5('0x10')]={};this[_0x14f5('0x11')]=_0x14df9d['agents'];this[_0x14f5('0x12')]=_0x14df9d[_0x14f5('0x13')];this[_0x14f5('0x14')]=_0x14df9d[_0x14f5('0x14')];this[_0x14f5('0x15')]=!![];this['campaigns']=_0x14df9d[_0x14f5('0x16')];this['variables']={};ami['on'](_0x14f5('0x17'),this[_0x14f5('0x18')]['bind'](this));ami['on'](_0x14f5('0x19'),this[_0x14f5('0x1a')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x1c'),this[_0x14f5('0x1d')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x1e'),this[_0x14f5('0x1f')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x20'),this[_0x14f5('0x21')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x22'),this[_0x14f5('0x23')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x24'),this[_0x14f5('0x25')]['bind'](this));ami['on'](_0x14f5('0x26'),this[_0x14f5('0x27')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x28'),this['syncHangup']['bind'](this));ami['on']('fullybooted',this['syncFullyBooted']['bind'](this));ami['on'](_0x14f5('0x29'),this[_0x14f5('0x2a')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x2b'),this[_0x14f5('0x2c')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x2d'),this[_0x14f5('0x2e')][_0x14f5('0x1b')](this));ami['on'](_0x14f5('0x2f'),this[_0x14f5('0x30')]['bind'](this));ami['on'](_0x14f5('0x31'),this['syncBlindTransfer'][_0x14f5('0x1b')](this));this[_0x14f5('0x32')]();this[_0x14f5('0x33')]();}function clearChannels(_0x58693d){if(!_['isEmpty'](_0x58693d)){for(var _0x572cef in _0x58693d){if(_0x58693d[_0x14f5('0x34')](_0x572cef)){delete _0x58693d[_0x572cef];}}}}function clearCampaigns(_0x27d274){if(!_[_0x14f5('0x35')](_0x27d274)){for(var _0x5ae47f in _0x27d274){if(_0x27d274[_0x14f5('0x34')](_0x5ae47f)){_0x27d274[_0x5ae47f][_0x14f5('0x36')]=0x0;}}}}function clearVoiceQueues(_0x1ee1c7){if(!_[_0x14f5('0x35')](_0x1ee1c7)){for(var _0x2bb7f0 in _0x1ee1c7){if(_0x1ee1c7['hasOwnProperty'](_0x2bb7f0)){_0x1ee1c7[_0x2bb7f0][_0x14f5('0x36')]=0x0;_0x1ee1c7[_0x2bb7f0]['talking']=0x0;_0x1ee1c7[_0x2bb7f0][_0x14f5('0x37')]=0x0;_0x1ee1c7[_0x2bb7f0]['waiting']=0x0;_0x1ee1c7[_0x2bb7f0]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x11ecb5){if(!_['isEmpty'](_0x11ecb5)){for(var _0x54a893 in _0x11ecb5){if(_0x11ecb5[_0x14f5('0x34')](_0x54a893)){_0x11ecb5[_0x54a893][_0x14f5('0x38')]=!![];}}}}VoiceQueueReport['prototype'][_0x14f5('0x39')]=function(){var _0x349c57=this;for(var _0x139959 in this['channels']){if(this[_0x14f5('0x12')]['hasOwnProperty'](_0x139959)&&!this[_0x14f5('0x12')][_0x139959][_0x14f5('0x3a')]){this[_0x14f5('0xf')][_0x14f5('0x3b')](function(){if(!_[_0x14f5('0x3c')](_0x349c57[_0x14f5('0x12')][_0x139959])){return ami[_0x14f5('0x3d')]({'action':_0x14f5('0x3e'),'channel':_0x349c57[_0x14f5('0x12')][_0x139959]['channel']})[_0x14f5('0x3f')](function(_0x3c19cf){if(_0x3c19cf[_0x14f5('0x40')]===_0x14f5('0x41')){setTimeout(function(){if(_0x349c57[_0x14f5('0x12')][_0x139959]){delete _0x349c57[_0x14f5('0x12')][_0x139959];logger['error'](_0x14f5('0x42'),_0x139959,util[_0x14f5('0x43')](_0x3c19cf,{'showHidden':![],'depth':null}));}if(_0x349c57[_0x14f5('0x10')][_0x139959]){delete _0x349c57[_0x14f5('0x10')][_0x139959];logger[_0x14f5('0x44')](_0x14f5('0x45'),_0x139959,util[_0x14f5('0x43')](_0x3c19cf,{'showHidden':![],'depth':null}));}if(_0x349c57['variables'][_0x139959]){delete _0x349c57['variables'][_0x139959];logger[_0x14f5('0x44')](_0x14f5('0x46'),_0x139959,util['inspect'](_0x3c19cf,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x14f5('0xc')]['syncFullyBooted']=function(){logger[_0x14f5('0x44')](_0x14f5('0x47'));clearChannels(this[_0x14f5('0x12')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this[_0x14f5('0x11')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x14f5('0x16')]);};VoiceQueueReport[_0x14f5('0xc')]['clearQueueReport']=function(_0x5edfe3){var _0x27ea72=this;if(!_['isEmpty'](_0x5edfe3)){for(var _0x3e1e38 in _0x5edfe3){if(_0x5edfe3[_0x14f5('0x34')](_0x3e1e38)){_0x27ea72[_0x14f5('0x48')](_0x5edfe3[_0x3e1e38],'clearqueuereport');delete _0x5edfe3[_0x3e1e38];}}}};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x49')]=function(_0x11f7c9,_0x6a4e19,_0x2a6051){io['to'](_0x11f7c9)[_0x14f5('0x49')](_0x6a4e19,_0x2a6051);};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x4a')]=function(_0x199d2f,_0x28d998){logger[_0x14f5('0x4b')](_0x14f5('0x4c')+_0x28d998+_0x14f5('0x4d'),_0x199d2f[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x199d2f,{'showHidden':![],'depth':null}));this['emit'](util[_0x14f5('0x4f')]('voice:queue:%s',_0x199d2f[_0x14f5('0x50')]),_0x14f5('0x51'),_0x199d2f);io[_0x14f5('0x49')](_0x14f5('0x52'),_0x199d2f);};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x48')]=function(_0x12fa02,_0x5efb16){logger[_0x14f5('0x4b')]('[%s][voiceQueueReport]['+_0x5efb16+_0x14f5('0x53'),_0x12fa02['uniqueid'],util[_0x14f5('0x43')](_0x12fa02,{'showHidden':![],'depth':null}));this['emit'](util[_0x14f5('0x4f')](_0x14f5('0x54'),_0x12fa02[_0x14f5('0x50')]),'voice_queue_channel:remove',_0x12fa02);io[_0x14f5('0x49')]('voice_queue_presence:remove',_0x12fa02);};VoiceQueueReport[_0x14f5('0xc')]['emitVoiceQueueSummary']=function(_0x35ac13,_0x675674){if(_0x35ac13[_0x14f5('0x55')]===_0x14f5('0x56')){var _0x462282={'id':_0x35ac13['id'],'name':_0x35ac13[_0x14f5('0x50')],'strategy':_0x35ac13[_0x14f5('0x57')],'answered':_0x35ac13[_0x14f5('0x58')],'available':_0x35ac13[_0x14f5('0x59')],'loggedIn':_0x35ac13[_0x14f5('0x5a')],'pTalking':_0x35ac13[_0x14f5('0x37')],'sumBillable':_0x35ac13[_0x14f5('0x5b')],'sumDuration':_0x35ac13[_0x14f5('0x5c')],'sumHoldTime':_0x35ac13[_0x14f5('0x5d')]||0x0,'talking':_0x35ac13[_0x14f5('0x5e')],'total':_0x35ac13[_0x14f5('0x5f')],'type':_0x35ac13[_0x14f5('0x55')],'unmanaged':_0x35ac13[_0x14f5('0x60')],'abandoned':_0x35ac13[_0x14f5('0x61')],'waiting':_0x35ac13[_0x14f5('0x62')]};if(_0x35ac13['Trunk']){_0x462282[_0x14f5('0x63')]={'id':_0x35ac13[_0x14f5('0x63')]['id'],'name':_0x35ac13[_0x14f5('0x63')][_0x14f5('0x50')],'active':_0x35ac13['Trunk'][_0x14f5('0x64')],'callerid':_0x35ac13[_0x14f5('0x63')][_0x14f5('0x65')]};}if(_0x35ac13[_0x14f5('0x66')]){_0x462282[_0x14f5('0x66')]={'id':_0x35ac13[_0x14f5('0x66')]['id'],'name':_0x35ac13[_0x14f5('0x66')][_0x14f5('0x50')]};}var _0x246d87=md5(JSON[_0x14f5('0x67')](_0x462282));if(_0x35ac13[_0x14f5('0x2')]!==_0x246d87){_0x35ac13[_0x14f5('0x2')]=_0x246d87;logger['debug']('[voiceQueueReport]['+_0x675674+_0x14f5('0x68'),util[_0x14f5('0x43')](_0x462282,{'showHidden':![],'depth':null}));this[_0x14f5('0x49')](util[_0x14f5('0x4f')]('voice:queue:%s',_0x462282[_0x14f5('0x50')]),_0x14f5('0x69'),_0x462282);}}};VoiceQueueReport[_0x14f5('0xc')]['isNotNull']=function(_0x4a420d){return _0x4a420d!==null&&!_[_0x14f5('0x6a')](_0x4a420d);};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x33')]=function(){var _0x19fef7=this;setInterval(function(){_0x19fef7[_0x14f5('0x39')]();ami[_0x14f5('0x3d')]({'action':_0x14f5('0x6b')})[_0x14f5('0x3f')](function(_0x3417b8){logger['error'](_0x14f5('0x6c'),util[_0x14f5('0x43')](_0x3417b8,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x14f5('0xc')]['loopQueueSummary']=function(){var _0x12485a=this;setInterval(function(){if(_0x12485a[_0x14f5('0x15')]){return ami[_0x14f5('0x3d')]({'action':_0x14f5('0x17')})[_0x14f5('0x6d')](function(_0x9f2fc3){_0x12485a['flagQueueSummary']=![];})['catch'](function(_0x40d471){logger[_0x14f5('0x44')](_0x14f5('0x6e'),util['inspect'](_0x40d471,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x18')]=function(_0x58cdf6){try{if(this[_0x14f5('0x6f')](_0x58cdf6)&&this['isNotNull'](_0x58cdf6[_0x14f5('0x70')])){logger['debug'](_0x14f5('0x71'),util[_0x14f5('0x43')](_0x58cdf6,{'showHidden':![],'depth':null}));if(this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]]){logger[_0x14f5('0x72')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x58cdf6[_0x14f5('0x70')]);var _0x5e901c=_['countBy'](this[_0x14f5('0x12')],_0x14f5('0x70'))[_0x58cdf6[_0x14f5('0x70')]]||0x0;var _0x43ab15=_0x5e901c-_0x58cdf6[_0x14f5('0x73')];if(this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]][_0x14f5('0x62')]!==_[_0x14f5('0x74')](_0x58cdf6[_0x14f5('0x73')])||this['voiceQueues'][_0x58cdf6['queue']][_0x14f5('0x5a')]!==_[_0x14f5('0x74')](_0x58cdf6['loggedin'])||this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]]['available']!==_['toNumber'](_0x58cdf6['available'])||this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]]['talking']!==_0x43ab15){this[_0x14f5('0x14')][_0x58cdf6['queue']]['waiting']=_[_0x14f5('0x74')](_0x58cdf6[_0x14f5('0x73')]);this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]][_0x14f5('0x5a')]=_[_0x14f5('0x74')](_0x58cdf6[_0x14f5('0x75')]);this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]]['available']=_[_0x14f5('0x74')](_0x58cdf6['available']);this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]][_0x14f5('0x5e')]=_0x43ab15>0x0?_0x43ab15:0x0;this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]]['talking']=this[_0x14f5('0x14')][_0x58cdf6['queue']]['talking']>_['toNumber'](_0x58cdf6['loggedin'])?_[_0x14f5('0x74')](_0x58cdf6[_0x14f5('0x75')]):this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]][_0x14f5('0x5e')];this[_0x14f5('0x76')](this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]],_0x14f5('0x17'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x14f5('0x43')](this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]],{'showHidden':![],'depth':null}));ami['emit'](_0x14f5('0x77'),this[_0x14f5('0x14')][_0x58cdf6[_0x14f5('0x70')]]);}}}catch(_0xd7f0f){logger[_0x14f5('0x44')](_0x14f5('0x6e'),util[_0x14f5('0x43')](_0xd7f0f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x2e20a7){logger[_0x14f5('0x4b')](_0x14f5('0x78'),util['inspect'](_0x2e20a7,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x1d')]=function(_0x128b18){try{if(this[_0x14f5('0x6f')](_0x128b18)){logger[_0x14f5('0x4b')](_0x14f5('0x79'),_0x128b18[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x128b18,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x14f5('0x10')][_0x128b18[_0x14f5('0x4e')]]))this[_0x14f5('0x10')][_0x128b18[_0x14f5('0x4e')]]=[];if(_[_0x14f5('0x6a')](this[_0x14f5('0x12')][_0x128b18[_0x14f5('0x4e')]]))this[_0x14f5('0x12')][_0x128b18[_0x14f5('0x4e')]]={};var _0x20aa30=new QueueReport();_0x20aa30[_0x14f5('0x50')]=_0x128b18['queue'];_0x20aa30[_0x14f5('0x55')]=this['voiceQueues'][_0x20aa30[_0x14f5('0x50')]]&&this[_0x14f5('0x14')][_0x20aa30['name']][_0x14f5('0x55')]?this[_0x14f5('0x14')][_0x20aa30[_0x14f5('0x50')]][_0x14f5('0x55')]||_0x14f5('0x56'):_0x14f5('0x56');_0x20aa30[_0x14f5('0x70')]=_0x128b18[_0x14f5('0x70')];_0x20aa30['queuecallerjoinAt']=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));_0x20aa30['position']=_0x128b18[_0x14f5('0x7b')];_0x20aa30['count']=_0x128b18['count'];_0x20aa30[_0x14f5('0x4e')]=_0x128b18['uniqueid'];_0x20aa30[_0x14f5('0x7c')]=this[_0x14f5('0x12')][_0x128b18[_0x14f5('0x4e')]]['routealias'];logger[_0x14f5('0x72')](_0x14f5('0x7d'),_0x20aa30[_0x14f5('0x50')],_0x20aa30[_0x14f5('0x55')]);_[_0x14f5('0x7e')](_0x20aa30,_['pick'](_0x128b18,_[_0x14f5('0x7f')](_0x20aa30)));this[_0x14f5('0x10')][_0x128b18[_0x14f5('0x4e')]][_0x14f5('0x80')](_0x20aa30);this[_0x14f5('0x12')][_0x128b18[_0x14f5('0x4e')]]=_0x20aa30;this[_0x14f5('0x4a')](_0x20aa30,_0x14f5('0x1c'));}}catch(_0x49fd96){logger['error'](_0x14f5('0x79'),_0x128b18['uniqueid'],util['inspect'](_0x49fd96,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x1f')]=function(_0x5d01ea){try{if(this['isNotNull'](_0x5d01ea)){logger[_0x14f5('0x4b')](_0x14f5('0x81'),_0x5d01ea[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x5d01ea,{'showHidden':![],'depth':null}));if(this[_0x14f5('0x10')][_0x5d01ea[_0x14f5('0x4e')]]){var _0x55a5d1=_[_0x14f5('0x82')](this[_0x14f5('0x10')][_0x5d01ea[_0x14f5('0x4e')]]);_0x55a5d1['queuecallercomplete']=![];_0x55a5d1[_0x14f5('0x83')]=null;_0x55a5d1['holdtime']=_0x5d01ea['holdtime'];_0x55a5d1['originalposition']=_0x5d01ea[_0x14f5('0x84')];_0x55a5d1[_0x14f5('0x1e')]=!![];_0x55a5d1[_0x14f5('0x85')]=moment()[_0x14f5('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x55a5d1[_0x14f5('0x86')]=_0x14f5('0x87');_0x55a5d1['lastAssignedTo']=null;logger[_0x14f5('0x72')](_0x14f5('0x88'),_0x55a5d1['name'],_0x55a5d1[_0x14f5('0x55')]);this[_0x14f5('0x12')][_0x5d01ea[_0x14f5('0x4e')]]=_0x55a5d1;this[_0x14f5('0x48')](_0x55a5d1,_0x14f5('0x1e'));}}}catch(_0xb9f6c8){logger[_0x14f5('0x44')](_0x14f5('0x81'),_0x5d01ea[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0xb9f6c8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x41513a){try{if(this[_0x14f5('0x6f')](_0x41513a)){logger[_0x14f5('0x4b')](_0x14f5('0x89'),_0x41513a['uniqueid'],util[_0x14f5('0x43')](_0x41513a,{'showHidden':![],'depth':null}));if(this[_0x14f5('0x10')][_0x41513a['uniqueid']]){var _0x33f727=_[_0x14f5('0x82')](this[_0x14f5('0x10')][_0x41513a['uniqueid']]);_0x33f727[_0x14f5('0x8a')]=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));_0x33f727[_0x14f5('0x8b')]=_0x41513a[_0x14f5('0x8b')];_0x33f727[_0x14f5('0x8c')]=_0x41513a[_0x14f5('0x8c')];logger['info'](_0x14f5('0x8d'),_0x33f727[_0x14f5('0x50')],_0x33f727[_0x14f5('0x55')],_0x41513a[_0x14f5('0x8b')],_0x41513a['connectedlinename']);this[_0x14f5('0x12')][_0x41513a['uniqueid']]=_0x33f727;this[_0x14f5('0x4a')](_0x33f727,_0x14f5('0x20'));}}}catch(_0x376310){logger['error'](_0x14f5('0x89'),_0x41513a[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x376310,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x25')]=function(_0x902707){try{if(this[_0x14f5('0x6f')](_0x902707)){logger[_0x14f5('0x4b')](_0x14f5('0x8e'),_0x902707[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x902707,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x902707['uniqueid']]){var _0x49c243=_['last'](this[_0x14f5('0x10')][_0x902707['uniqueid']]);_0x49c243[_0x14f5('0x8f')]=!![];_0x49c243[_0x14f5('0x86')]=_0x14f5('0x90');logger['info'](_0x14f5('0x91'),_0x49c243[_0x14f5('0x50')],_0x49c243[_0x14f5('0x55')]);}}}catch(_0x2d9e35){logger[_0x14f5('0x44')](_0x14f5('0x8e'),_0x902707[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x2d9e35,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x23')]=function(_0x4d503b){try{if(this[_0x14f5('0x6f')](_0x4d503b)){logger[_0x14f5('0x4b')]('[%s][voiceQueueReport][agentcomplete]',_0x4d503b[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x4d503b,{'showHidden':![],'depth':null}));if(this[_0x14f5('0x10')][_0x4d503b['uniqueid']]){var _0x84de46=_['last'](this[_0x14f5('0x10')][_0x4d503b[_0x14f5('0x4e')]]);_0x84de46[_0x14f5('0x1e')]=![];_0x84de46[_0x14f5('0x85')]=null;_0x84de46['assigned']=!![];_0x84de46['lastAssignedTo']=_0x4d503b[_0x14f5('0x92')];_0x84de46[_0x14f5('0x93')]=_0x4d503b[_0x14f5('0x93')];_0x84de46[_0x14f5('0x8f')]=!![];_0x84de46[_0x14f5('0x94')]=![];_0x84de46['queuecallerexitAt']=null;if(!_0x84de46[_0x14f5('0x95')]){if(_0x4d503b[_0x14f5('0x96')]==_0x14f5('0x95')){_0x84de46[_0x14f5('0x86')]='COMPLETED';logger[_0x14f5('0x72')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x84de46[_0x14f5('0x50')],_0x84de46[_0x14f5('0x55')]);}else{if(_[_0x14f5('0x97')](_0x4d503b[_0x14f5('0x98')][_0x14f5('0x99')](),'local/')){if(this[_0x14f5('0x10')][_0x4d503b[_0x14f5('0x9a')]]){var _0x563498=_['last'](this[_0x14f5('0x10')][_0x4d503b[_0x14f5('0x9a')]]);_0x563498[_0x14f5('0x8f')]=![];_0x563498[_0x14f5('0x94')]=!![];_0x563498[_0x14f5('0x9b')]=moment(_0x84de46[_0x14f5('0x9c')])[_0x14f5('0x9d')](_0x4d503b['holdtime'],_0x14f5('0x9e'))[_0x14f5('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x563498[_0x14f5('0x86')]=_0x14f5('0x9f');_0x563498['transfer']=!![];_0x563498['transfertype']='FORWARD';_0x563498[_0x14f5('0xa0')]=_0x4d503b[_0x14f5('0xa1')];_0x563498[_0x14f5('0xa2')]=_0x4d503b[_0x14f5('0x4e')];logger[_0x14f5('0x72')](_0x14f5('0xa3'),_0x563498[_0x14f5('0x50')],_0x563498[_0x14f5('0x55')]);var _0x12a3ba=this[_0x14f5('0x10')][_0x4d503b[_0x14f5('0x9a')]];this[_0x14f5('0x10')][_0x4d503b[_0x14f5('0x9a')]]=this[_0x14f5('0x10')][_0x4d503b['uniqueid']];this[_0x14f5('0x10')][_0x4d503b[_0x14f5('0x4e')]]=_0x12a3ba;}}else{_0x84de46[_0x14f5('0x86')]='COMPLETEDBY'+_0x4d503b[_0x14f5('0x96')]['toUpperCase']();logger[_0x14f5('0x72')](_0x14f5('0xa4'),_0x84de46[_0x14f5('0x50')],_0x84de46[_0x14f5('0x55')],_0x84de46[_0x14f5('0x86')]);}}}this['channels'][_0x4d503b[_0x14f5('0x4e')]]=_0x84de46;this[_0x14f5('0x48')](_0x84de46,_0x14f5('0x22'));}}}catch(_0x13b461){logger[_0x14f5('0x44')](_0x14f5('0xa5'),_0x4d503b[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x13b461,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x27')]=function(_0x367e6b){try{if(this['isNotNull'](_0x367e6b)){logger['debug']('[%s][voiceQueueReport][varset]',_0x367e6b[_0x14f5('0x4e')],util['inspect'](_0x367e6b,{'showHidden':![],'depth':null}));this[_0x14f5('0xa6')](_0x367e6b[_0x14f5('0x4e')],_[_0x14f5('0x7f')](_0x367e6b[_0x14f5('0xa7')])[0x0],_0x367e6b[_0x14f5('0xa8')]);if(this[_0x14f5('0x10')][_0x367e6b[_0x14f5('0x4e')]]){var _0x4f6437=_[_0x14f5('0x82')](this['queueReports'][_0x367e6b[_0x14f5('0x4e')]]);if(_0x4f6437){if(this[_0x14f5('0x6f')](_0x367e6b[_0x14f5('0xa7')])&&this[_0x14f5('0x6f')](_0x367e6b[_0x14f5('0xa7')][_0x14f5('0xa9')])){switch(_0x367e6b[_0x14f5('0xa8')]){case _0x14f5('0xaa'):_0x4f6437[_0x14f5('0x94')]=![];_0x4f6437[_0x14f5('0x9b')]=null;break;case _0x14f5('0xab'):_0x4f6437[_0x14f5('0xac')]=_0x14f5('0xad');_0x4f6437[_0x14f5('0x94')]=!![];_0x4f6437[_0x14f5('0x9b')]=moment()['format'](_0x14f5('0x7a'));_0x4f6437[_0x14f5('0x8a')]=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x367e6b['uniqueid'],util['inspect'](_0x4f6437,{'showHidden':![],'depth':null}));ami[_0x14f5('0x49')]('custom:timeout',_0x4f6437);break;default:_0x4f6437['queuecallerexit']=!![];_0x4f6437['queuecallerexitAt']=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));_0x4f6437['queuecallerleaveAt']=moment()['format'](_0x14f5('0x7a'));}_0x4f6437[_0x14f5('0x1e')]=![];_0x4f6437[_0x14f5('0x85')]=null;_0x4f6437[_0x14f5('0x86')]=_0x367e6b[_0x14f5('0xa8')];this['channels'][_0x367e6b[_0x14f5('0x4e')]]=_0x4f6437;this['emitVoiceQueueChannelRemove'](_0x4f6437,_0x14f5('0x26'));}else if(this[_0x14f5('0x6f')](_0x367e6b['variable'])&&this[_0x14f5('0x6f')](_0x367e6b['variable']['queueposition'])){if(!_0x4f6437['queuecallerabandon']){_0x4f6437[_0x14f5('0x94')]=!![];_0x4f6437[_0x14f5('0x9b')]=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));_0x4f6437['queuecallerexitreason']=_0x14f5('0xae');_0x4f6437['queuecallerleaveAt']=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));this[_0x14f5('0x12')][_0x367e6b[_0x14f5('0x4e')]]=_0x4f6437;}}logger['info'](_0x14f5('0xaf'),_0x367e6b[_0x14f5('0x4e')],_0x4f6437[_0x14f5('0x50')],_0x4f6437[_0x14f5('0x55')],_[_0x14f5('0x7f')](_0x367e6b[_0x14f5('0xa7')])[0x0],_0x367e6b[_0x14f5('0xa8')]);_0x4f6437['variables']=this[_0x14f5('0xb0')][_0x367e6b['uniqueid']];}}}}catch(_0x218e68){logger['error'](_0x14f5('0xb1'),_0x367e6b[_0x14f5('0x4e')],util['inspect'](_0x218e68,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x14f5('0xa6')]=function(_0x2151a8,_0x5b0d5e,_0x21d99e){var _0x177c50=[_0x14f5('0xb2'),_0x14f5('0xb3'),_0x14f5('0xb4'),_0x14f5('0xb5'),_0x14f5('0xb6'),'rtpaudioqoslossbridged',_0x14f5('0xb7'),_0x14f5('0xb8'),_0x14f5('0xb9'),'sipuri',_0x14f5('0xba'),_0x14f5('0xbb'),_0x14f5('0xbc'),_0x14f5('0xbd'),_0x14f5('0xbe'),_0x14f5('0xbf'),'membername',_0x14f5('0xc0'),_0x14f5('0xc1')];if(!_[_0x14f5('0x3c')](_0x5b0d5e)&&!_[_0x14f5('0xc2')](_0x177c50,_0x5b0d5e)){if(_[_0x14f5('0x6a')](this['variables'][_0x2151a8])){this[_0x14f5('0xb0')][_0x2151a8]={};}this[_0x14f5('0xb0')][_0x2151a8][_0x5b0d5e]=_0x21d99e;}};VoiceQueueReport[_0x14f5('0xc')]['syncHangup']=function(_0x4b616c){try{if(this['isNotNull'](_0x4b616c)){logger[_0x14f5('0x4b')](_0x14f5('0xc3'),_0x4b616c[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x4b616c,{'showHidden':![],'depth':null}));if(this[_0x14f5('0x10')][_0x4b616c[_0x14f5('0x4e')]]){for(var _0x189dae=0x0,_0x562cb4={};_0x189dae<this[_0x14f5('0x10')][_0x4b616c['uniqueid']][_0x14f5('0xc4')];_0x189dae+=0x1){_0x562cb4=this[_0x14f5('0x10')][_0x4b616c[_0x14f5('0x4e')]][_0x189dae];if(this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]]){if(_0x562cb4[_0x14f5('0x94')]&&_0x562cb4[_0x14f5('0x95')]!=!![]){this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]][_0x14f5('0x60')]+=0x1;}if(_0x562cb4[_0x14f5('0x1e')]){this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]][_0x14f5('0x61')]+=0x1;}this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]][_0x14f5('0x5d')]+=moment(_0x562cb4[_0x14f5('0x8a')])['diff'](_0x562cb4[_0x14f5('0x9c')],_0x14f5('0x9e'))||0x0;if(_0x189dae===this[_0x14f5('0x10')][_0x4b616c[_0x14f5('0x4e')]]['length']-0x1){this['voiceQueues'][_0x562cb4[_0x14f5('0x70')]]['sumDuration']+=moment()[_0x14f5('0xc5')](0x0)[_0x14f5('0xc6')](_0x562cb4[_0x14f5('0x9c')],'seconds');this[_0x14f5('0x14')][_0x562cb4['queue']]['total']+=0x1;if(_0x562cb4[_0x14f5('0x8f')]){this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]][_0x14f5('0x58')]+=0x1;this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]][_0x14f5('0x5b')]+=moment()[_0x14f5('0xc5')](0x0)['diff'](_0x562cb4[_0x14f5('0x8a')],_0x14f5('0x9e'));_0x562cb4[_0x14f5('0x83')]=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));_0x562cb4[_0x14f5('0x94')]=![];_0x562cb4[_0x14f5('0x9b')]=null;}if(_0x562cb4[_0x14f5('0x94')]&&_0x562cb4[_0x14f5('0x95')]!=!![]){_0x562cb4['lastevent']=_0x14f5('0x60');logger[_0x14f5('0x4b')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x4b616c[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x562cb4,{'showHidden':![],'depth':null}));ami['emit'](_0x14f5('0xc7'),_0x562cb4);}if(_0x562cb4[_0x14f5('0x1e')]){_0x562cb4[_0x14f5('0xac')]='abandoned';logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x4b616c[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x562cb4,{'showHidden':![],'depth':null}));ami[_0x14f5('0x49')]('custom:queuecallerabandon',_0x562cb4);}}else{this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]][_0x14f5('0x5c')]+=this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]][_0x14f5('0x5d')];}logger[_0x14f5('0x72')](_0x14f5('0xc8'),_0x4b616c[_0x14f5('0x4e')],_0x562cb4[_0x14f5('0x50')],_0x562cb4[_0x14f5('0x55')],_0x4b616c[_0x14f5('0xc9')]);this['channels'][_0x4b616c[_0x14f5('0x4e')]]=_0x562cb4;this[_0x14f5('0x48')](_0x562cb4,'hangup');this[_0x14f5('0x76')](this[_0x14f5('0x14')][_0x562cb4[_0x14f5('0x70')]],'hangup');}}logger[_0x14f5('0x4b')](_0x14f5('0xca'),_0x4b616c[_0x14f5('0x4e')],util['inspect'](this[_0x14f5('0x10')][_0x4b616c['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x14f5('0x49')](_0x14f5('0xcb'),this[_0x14f5('0x10')][_0x4b616c['uniqueid']]);delete this[_0x14f5('0x10')][_0x4b616c[_0x14f5('0x4e')]];delete this['channels'][_0x4b616c[_0x14f5('0x4e')]];}if(this[_0x14f5('0xb0')][_0x4b616c[_0x14f5('0x4e')]]){delete this['variables'][_0x4b616c[_0x14f5('0x4e')]];}}}catch(_0x791b6b){logger['error'](_0x14f5('0xc3'),_0x4b616c[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x791b6b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x40bba3){try{if(this['isNotNull'](_0x40bba3)){logger['debug'](_0x14f5('0xcc'),_0x40bba3[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x40bba3,{'showHidden':![],'depth':null}));var _0x47f31b;if(this[_0x14f5('0x10')][_0x40bba3['transfereeuniqueid']]){_0x47f31b=_[_0x14f5('0x82')](this[_0x14f5('0x10')][_0x40bba3[_0x14f5('0xcd')]]);_0x47f31b[_0x14f5('0xa0')]=_0x40bba3[_0x14f5('0xce')];_0x47f31b[_0x14f5('0xa2')]=_0x40bba3[_0x14f5('0xcf')];_0x47f31b['queuecallerexitreason']='ATTENDEDTRANSFER';_0x47f31b[_0x14f5('0x95')]=!![];_0x47f31b[_0x14f5('0xd0')]=_0x14f5('0xd1');if(this['queueReports'][_0x40bba3[_0x14f5('0xcf')]]){var _0x48b151=this[_0x14f5('0x10')][_0x40bba3[_0x14f5('0xcf')]];this['queueReports'][_0x40bba3[_0x14f5('0xcf')]]=this[_0x14f5('0x10')][_0x40bba3[_0x14f5('0xcd')]];this[_0x14f5('0x10')][_0x40bba3[_0x14f5('0xcd')]]=_0x48b151;var _0x507ecb=_[_0x14f5('0x82')](this[_0x14f5('0x10')][_0x40bba3[_0x14f5('0xcd')]]);_0x507ecb[_0x14f5('0x3a')]=!![];}logger[_0x14f5('0x72')](_0x14f5('0xd2'),_0x40bba3[_0x14f5('0x4e')],_0x47f31b[_0x14f5('0x50')],_0x47f31b[_0x14f5('0x55')],_0x47f31b['transferexten'],_0x47f31b[_0x14f5('0xa2')]);}else if(this['queueReports'][_0x40bba3[_0x14f5('0xd3')]]){_0x47f31b=_['last'](this[_0x14f5('0x10')][_0x40bba3['transfertargetuniqueid']]);_0x47f31b['transferexten']=_0x40bba3[_0x14f5('0xd4')];_0x47f31b['transferuniqueid']=_0x40bba3['origtransfereruniqueid'];_0x47f31b[_0x14f5('0x86')]=_0x14f5('0xd5');_0x47f31b[_0x14f5('0x95')]=!![];_0x47f31b[_0x14f5('0xd0')]=_0x14f5('0xd1');if(this[_0x14f5('0x10')][_0x40bba3[_0x14f5('0xd6')]]){var _0x48b151=this[_0x14f5('0x10')][_0x40bba3['origtransfereruniqueid']];this[_0x14f5('0x10')][_0x40bba3['origtransfereruniqueid']]=this[_0x14f5('0x10')][_0x40bba3['transfertargetuniqueid']];this[_0x14f5('0x10')][_0x40bba3[_0x14f5('0xd3')]]=_0x48b151;var _0x507ecb=_['last'](this[_0x14f5('0x10')][_0x40bba3['transfertargetuniqueid']]);_0x507ecb[_0x14f5('0x3a')]=!![];}logger['info'](_0x14f5('0xd2'),_0x40bba3[_0x14f5('0x4e')],_0x47f31b[_0x14f5('0x50')],_0x47f31b[_0x14f5('0x55')],_0x47f31b[_0x14f5('0xa0')],_0x47f31b['transferuniqueid']);}}}catch(_0x4606cf){logger[_0x14f5('0x44')](_0x14f5('0xcc'),_0x40bba3['uniqueid'],util['inspect'](_0x4606cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0xd7')]=function(_0x5ad27d){try{if(this[_0x14f5('0x6f')](_0x5ad27d)){logger[_0x14f5('0x4b')]('[%s][voiceQueueReport][blindtransfer]',_0x5ad27d[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x5ad27d,{'showHidden':![],'depth':null}));if(this[_0x14f5('0x10')][_0x5ad27d[_0x14f5('0xcd')]]){var _0x1fa989=_[_0x14f5('0x82')](this[_0x14f5('0x10')][_0x5ad27d[_0x14f5('0xcd')]]);_0x1fa989[_0x14f5('0x86')]=_0x14f5('0xd8');_0x1fa989[_0x14f5('0x95')]=!![];_0x1fa989[_0x14f5('0xd0')]=_0x14f5('0xd9');_0x1fa989[_0x14f5('0xa0')]=_0x5ad27d[_0x14f5('0xda')];_0x1fa989[_0x14f5('0xa2')]=_0x5ad27d[_0x14f5('0xcd')];logger[_0x14f5('0x72')](_0x14f5('0xdb'),_0x5ad27d[_0x14f5('0x4e')],_0x1fa989[_0x14f5('0x50')],_0x1fa989[_0x14f5('0x55')],_0x1fa989['transferexten'],_0x1fa989[_0x14f5('0xa2')]);this[_0x14f5('0xdc')]({'event':'BlindTransfer','uniqueid':_0x5ad27d[_0x14f5('0xcd')],'context':_0x5ad27d[_0x14f5('0xdd')],'channel':_0x5ad27d[_0x14f5('0xde')]});}}}catch(_0x2ca009){logger[_0x14f5('0x44')]('[%s][voiceQueueReport][blindtransfer]',_0x5ad27d['uniqueid'],util[_0x14f5('0x43')](_0x2ca009,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14f5('0xc')][_0x14f5('0x2c')]=function(_0xb05e2){try{if(this[_0x14f5('0x6f')](_0xb05e2)){logger['debug'](_0x14f5('0xdf'),_0xb05e2[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0xb05e2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xb05e2[_0x14f5('0x4e')]]){var _0x104c0a=_[_0x14f5('0x82')](this[_0x14f5('0x10')][_0xb05e2['uniqueid']]);if(!_[_0x14f5('0x3c')](_0x104c0a[_0x14f5('0x8a')])){_0x104c0a[_0x14f5('0xe0')]=moment()[_0x14f5('0x4f')](_0x14f5('0x7a'));logger[_0x14f5('0x72')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0xb05e2[_0x14f5('0x4e')],_0x104c0a[_0x14f5('0xe0')]);}}}}catch(_0x3c386a){logger[_0x14f5('0x44')](_0x14f5('0xdf'),_0xb05e2[_0x14f5('0x4e')],util['inspect'](_0x3c386a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x14f5('0x2e')]=function(_0x5d04f3){try{if(this[_0x14f5('0x6f')](_0x5d04f3)){logger[_0x14f5('0x4b')](_0x14f5('0xe1'),_0x5d04f3['uniqueid'],util['inspect'](_0x5d04f3,{'showHidden':![],'depth':null}));if(this[_0x14f5('0x10')][_0x5d04f3[_0x14f5('0x4e')]]){var _0x3a55e0=_[_0x14f5('0x82')](this[_0x14f5('0x10')][_0x5d04f3[_0x14f5('0x4e')]]);if(!_[_0x14f5('0x3c')](_0x3a55e0[_0x14f5('0xe0')])){_0x3a55e0[_0x14f5('0xe2')]+=moment()['milliseconds'](0x0)[_0x14f5('0xc6')](_0x3a55e0[_0x14f5('0xe0')],'seconds');logger[_0x14f5('0x72')](_0x14f5('0xe3'),_0x5d04f3[_0x14f5('0x4e')],_0x3a55e0[_0x14f5('0xe2')]);delete _0x3a55e0['mohstarttime'];}}}}catch(_0x46a2ac){logger['error']('[%s][voiceQueueReport][musiconholdstop]',_0x5d04f3[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x46a2ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncNewExten']=function(_0x308d8e){try{if(this[_0x14f5('0x6f')](_0x308d8e)){logger[_0x14f5('0x4b')](_0x14f5('0xe4'),_0x308d8e['uniqueid'],util[_0x14f5('0x43')](_0x308d8e,{'showHidden':![],'depth':null}));if(_0x308d8e['application'][_0x14f5('0x99')]()==='set'){_0x308d8e[_0x14f5('0xe5')]=_0x308d8e[_0x14f5('0xe6')]&&_0x308d8e['appdata'][_0x14f5('0x97')](_0x14f5('0xe7'))?_0x308d8e[_0x14f5('0xe6')]:(_0x308d8e[_0x14f5('0xe6')]||_0x308d8e['applicationdata'])[_0x14f5('0x99')]();if(_['startsWith'](_0x308d8e[_0x14f5('0xe5')][_0x14f5('0x99')](),_0x14f5('0xe8'))){logger[_0x14f5('0x72')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x308d8e[_0x14f5('0x4e')],_0x308d8e[_0x14f5('0xe9')],_0x308d8e[_0x14f5('0xe5')]);if(_['isUndefined'](this[_0x14f5('0x12')][_0x308d8e['uniqueid']]))this[_0x14f5('0x12')][_0x308d8e['uniqueid']]={};var _0x5238a9=_0x308d8e['applicationdata'][_0x14f5('0xea')]('=');var _0x20e61d=_0x5238a9[0x0]['toLowerCase']()[_0x14f5('0xeb')](/cdr\((.*)\)/);if(_0x20e61d)this[_0x14f5('0x12')][_0x308d8e[_0x14f5('0x4e')]][_0x20e61d[0x1]]=_0x5238a9[0x1];}}}}catch(_0x590bb4){logger['error'](_0x14f5('0xec'),_0x308d8e[_0x14f5('0x4e')],util[_0x14f5('0x43')](_0x590bb4,{'showHidden':![],'depth':null}));}};module[_0x14f5('0xed')]=VoiceQueueReport;
\ No newline at end of file
+var _0x8579=['isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','clearZombieChannels','isNil','Action','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','format','name','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','isUndefined','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','uniqueid','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queuecallerleaveAt','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfertype','[%s][voiceQueueReport][blindtransfer]','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','set','appdata','CDR(routeAlias)','applicationdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/logger','ami','../model/queueReport','redis','defaults','prototype','enqueue','tail','sequence','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow'];(function(_0x3b1169,_0x45cc2f){var _0x34c555=function(_0x5277a3){while(--_0x5277a3){_0x3b1169['push'](_0x3b1169['shift']());}};_0x34c555(++_0x45cc2f);}(_0x8579,0xc5));var _0x9857=function(_0x5aa065,_0x3952b1){_0x5aa065=_0x5aa065-0x0;var _0x180351=_0x8579[_0x5aa065];return _0x180351;};'use strict';var _=require(_0x9857('0x0'));var moment=require(_0x9857('0x1'));var util=require(_0x9857('0x2'));var md5=require(_0x9857('0x3'));var Redis=require(_0x9857('0x4'));var config=require('../../../config/environment');var logger=require(_0x9857('0x5'))(_0x9857('0x6'));var ami=require('../ami');var QueueReport=require(_0x9857('0x7'));config[_0x9857('0x8')]=_[_0x9857('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9857('0x8')]));var Sequence=function(){};Sequence[_0x9857('0xa')][_0x9857('0xb')]=function(_0x3ead3){this[_0x9857('0xc')]=this['tail']?this[_0x9857('0xc')]['finally'](_0x3ead3):_0x3ead3();};function VoiceQueueReport(_0x132291){this[_0x9857('0xd')]=new Sequence();this['queueReports']={};this['agents']=_0x132291['agents'];this[_0x9857('0xe')]=_0x132291[_0x9857('0xf')];this[_0x9857('0x10')]=_0x132291['voiceQueues'];this[_0x9857('0x11')]=!![];this['campaigns']=_0x132291[_0x9857('0x12')];this[_0x9857('0x13')]={};ami['on'](_0x9857('0x14'),this[_0x9857('0x15')][_0x9857('0x16')](this));ami['on'](_0x9857('0x17'),this['syncQueueSummaryComplete'][_0x9857('0x16')](this));ami['on'](_0x9857('0x18'),this['syncQueueCallerJoin'][_0x9857('0x16')](this));ami['on'](_0x9857('0x19'),this[_0x9857('0x1a')]['bind'](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x9857('0x16')](this));ami['on'](_0x9857('0x1b'),this['syncAgentComplete'][_0x9857('0x16')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x9857('0x16')](this));ami['on'](_0x9857('0x1c'),this['syncVarSet'][_0x9857('0x16')](this));ami['on']('hangup',this[_0x9857('0x1d')][_0x9857('0x16')](this));ami['on'](_0x9857('0x1e'),this[_0x9857('0x1f')][_0x9857('0x16')](this));ami['on'](_0x9857('0x20'),this[_0x9857('0x21')][_0x9857('0x16')](this));ami['on']('musiconholdstart',this[_0x9857('0x22')][_0x9857('0x16')](this));ami['on'](_0x9857('0x23'),this[_0x9857('0x24')]['bind'](this));ami['on'](_0x9857('0x25'),this[_0x9857('0x26')]['bind'](this));ami['on'](_0x9857('0x27'),this[_0x9857('0x28')][_0x9857('0x16')](this));this['loopQueueSummary']();this[_0x9857('0x29')]();}function clearChannels(_0x46ebbb){if(!_[_0x9857('0x2a')](_0x46ebbb)){for(var _0x48aa1f in _0x46ebbb){if(_0x46ebbb[_0x9857('0x2b')](_0x48aa1f)){delete _0x46ebbb[_0x48aa1f];}}}}function clearCampaigns(_0x97bba5){if(!_['isEmpty'](_0x97bba5)){for(var _0x13e1c4 in _0x97bba5){if(_0x97bba5[_0x9857('0x2b')](_0x13e1c4)){_0x97bba5[_0x13e1c4][_0x9857('0x2c')]=0x0;}}}}function clearVoiceQueues(_0xc1f73a){if(!_[_0x9857('0x2a')](_0xc1f73a)){for(var _0x4ca34a in _0xc1f73a){if(_0xc1f73a[_0x9857('0x2b')](_0x4ca34a)){_0xc1f73a[_0x4ca34a][_0x9857('0x2c')]=0x0;_0xc1f73a[_0x4ca34a][_0x9857('0x2d')]=0x0;_0xc1f73a[_0x4ca34a][_0x9857('0x2e')]=0x0;_0xc1f73a[_0x4ca34a][_0x9857('0x2f')]=0x0;_0xc1f73a[_0x4ca34a]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x92cfc9){if(!_[_0x9857('0x2a')](_0x92cfc9)){for(var _0x5df497 in _0x92cfc9){if(_0x92cfc9[_0x9857('0x2b')](_0x5df497)){_0x92cfc9[_0x5df497]['unlockRR']=!![];}}}}VoiceQueueReport['prototype'][_0x9857('0x30')]=function(){var _0x4ea198=this;for(var _0x239169 in this[_0x9857('0xe')]){if(this[_0x9857('0xe')][_0x9857('0x2b')](_0x239169)&&!this[_0x9857('0xe')][_0x239169]['switch']){this[_0x9857('0xd')][_0x9857('0xb')](function(){if(!_[_0x9857('0x31')](_0x4ea198[_0x9857('0xe')][_0x239169])){return ami[_0x9857('0x32')]({'action':'status','channel':_0x4ea198[_0x9857('0xe')][_0x239169][_0x9857('0x33')]})[_0x9857('0x34')](function(_0x376a56){if(_0x376a56[_0x9857('0x35')]===_0x9857('0x36')){setTimeout(function(){if(_0x4ea198[_0x9857('0xe')][_0x239169]){delete _0x4ea198['channels'][_0x239169];logger[_0x9857('0x37')](_0x9857('0x38'),_0x239169,util[_0x9857('0x39')](_0x376a56,{'showHidden':![],'depth':null}));}if(_0x4ea198[_0x9857('0x3a')][_0x239169]){delete _0x4ea198[_0x9857('0x3a')][_0x239169];logger[_0x9857('0x37')](_0x9857('0x3b'),_0x239169,util['inspect'](_0x376a56,{'showHidden':![],'depth':null}));}if(_0x4ea198[_0x9857('0x13')][_0x239169]){delete _0x4ea198[_0x9857('0x13')][_0x239169];logger[_0x9857('0x37')](_0x9857('0x3c'),_0x239169,util['inspect'](_0x376a56,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x9857('0x1f')]=function(){logger[_0x9857('0x37')](_0x9857('0x3d'));clearChannels(this[_0x9857('0xe')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x9857('0x10')]);clearCampaigns(this[_0x9857('0x12')]);};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x3e')]=function(_0x13f5b5){var _0x401f65=this;if(!_[_0x9857('0x2a')](_0x13f5b5)){for(var _0x57dc28 in _0x13f5b5){if(_0x13f5b5[_0x9857('0x2b')](_0x57dc28)){_0x401f65[_0x9857('0x3f')](_0x13f5b5[_0x57dc28],_0x9857('0x40'));delete _0x13f5b5[_0x57dc28];}}}};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x41')]=function(_0x39dff6,_0x276a33,_0x68e47a){io['to'](_0x39dff6)['emit'](_0x276a33,_0x68e47a);};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x42')]=function(_0x5b69f4,_0x24663f){logger[_0x9857('0x43')](_0x9857('0x44')+_0x24663f+']\x20sending\x20voice_queue_channel:save\x20event:',_0x5b69f4['uniqueid'],util[_0x9857('0x39')](_0x5b69f4,{'showHidden':![],'depth':null}));this[_0x9857('0x41')](util['format'](_0x9857('0x45'),_0x5b69f4['name']),_0x9857('0x46'),_0x5b69f4);io[_0x9857('0x41')](_0x9857('0x47'),_0x5b69f4);};VoiceQueueReport['prototype'][_0x9857('0x3f')]=function(_0x1bc059,_0x2c2ed9){logger[_0x9857('0x43')](_0x9857('0x44')+_0x2c2ed9+_0x9857('0x48'),_0x1bc059['uniqueid'],util[_0x9857('0x39')](_0x1bc059,{'showHidden':![],'depth':null}));this[_0x9857('0x41')](util[_0x9857('0x49')](_0x9857('0x45'),_0x1bc059[_0x9857('0x4a')]),'voice_queue_channel:remove',_0x1bc059);io[_0x9857('0x41')](_0x9857('0x4b'),_0x1bc059);};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x4c')]=function(_0x5c4365,_0x2ec008){if(_0x5c4365[_0x9857('0x4d')]===_0x9857('0x4e')){var _0x8e906b={'id':_0x5c4365['id'],'name':_0x5c4365[_0x9857('0x4a')],'strategy':_0x5c4365['strategy'],'answered':_0x5c4365[_0x9857('0x4f')],'available':_0x5c4365[_0x9857('0x50')],'loggedIn':_0x5c4365['loggedIn'],'pTalking':_0x5c4365['pTalking'],'sumBillable':_0x5c4365[_0x9857('0x51')],'sumDuration':_0x5c4365[_0x9857('0x52')],'sumHoldTime':_0x5c4365[_0x9857('0x53')]||0x0,'talking':_0x5c4365[_0x9857('0x2d')],'total':_0x5c4365[_0x9857('0x54')],'type':_0x5c4365['type'],'unmanaged':_0x5c4365[_0x9857('0x55')],'abandoned':_0x5c4365[_0x9857('0x56')],'waiting':_0x5c4365[_0x9857('0x2f')]};if(_0x5c4365[_0x9857('0x57')]){_0x8e906b[_0x9857('0x57')]={'id':_0x5c4365[_0x9857('0x57')]['id'],'name':_0x5c4365['Trunk'][_0x9857('0x4a')],'active':_0x5c4365[_0x9857('0x57')][_0x9857('0x58')],'callerid':_0x5c4365['Trunk'][_0x9857('0x59')]};}if(_0x5c4365['Interval']){_0x8e906b[_0x9857('0x5a')]={'id':_0x5c4365[_0x9857('0x5a')]['id'],'name':_0x5c4365[_0x9857('0x5a')][_0x9857('0x4a')]};}var _0x16ccd6=md5(JSON[_0x9857('0x5b')](_0x8e906b));if(_0x5c4365['md5']!==_0x16ccd6){_0x5c4365[_0x9857('0x3')]=_0x16ccd6;logger[_0x9857('0x43')](_0x9857('0x5c')+_0x2ec008+_0x9857('0x5d'),util[_0x9857('0x39')](_0x8e906b,{'showHidden':![],'depth':null}));this[_0x9857('0x41')](util[_0x9857('0x49')](_0x9857('0x45'),_0x8e906b[_0x9857('0x4a')]),'voice_queue:save',_0x8e906b);}}};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x5e')]=function(_0x2946d0){return _0x2946d0!==null&&!_[_0x9857('0x5f')](_0x2946d0);};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x29')]=function(){var _0x549a3b=this;setInterval(function(){_0x549a3b[_0x9857('0x30')]();ami[_0x9857('0x32')]({'action':'queues'})[_0x9857('0x34')](function(_0x1f1e37){logger['error'](_0x9857('0x60'),util[_0x9857('0x39')](_0x1f1e37,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x482c3f=this;setInterval(function(){if(_0x482c3f[_0x9857('0x11')]){return ami[_0x9857('0x32')]({'action':_0x9857('0x14')})[_0x9857('0x61')](function(_0x135a2c){_0x482c3f[_0x9857('0x11')]=![];})[_0x9857('0x34')](function(_0x16d6a2){logger['error'](_0x9857('0x62'),util[_0x9857('0x39')](_0x16d6a2,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x9857('0x15')]=function(_0x22396c){try{if(this[_0x9857('0x5e')](_0x22396c)&&this[_0x9857('0x5e')](_0x22396c[_0x9857('0x63')])){logger[_0x9857('0x43')](_0x9857('0x64'),util[_0x9857('0x39')](_0x22396c,{'showHidden':![],'depth':null}));if(this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]]){logger[_0x9857('0x65')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x22396c['queue']);var _0x49c2cf=_[_0x9857('0x66')](this[_0x9857('0xe')],_0x9857('0x63'))[_0x22396c[_0x9857('0x63')]]||0x0;var _0x249b7=_0x49c2cf-_0x22396c[_0x9857('0x67')];if(this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]]['waiting']!==_[_0x9857('0x68')](_0x22396c[_0x9857('0x67')])||this[_0x9857('0x10')][_0x22396c['queue']][_0x9857('0x69')]!==_['toNumber'](_0x22396c['loggedin'])||this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]][_0x9857('0x50')]!==_['toNumber'](_0x22396c[_0x9857('0x50')])||this['voiceQueues'][_0x22396c[_0x9857('0x63')]][_0x9857('0x2d')]!==_0x249b7){this['voiceQueues'][_0x22396c[_0x9857('0x63')]]['waiting']=_['toNumber'](_0x22396c[_0x9857('0x67')]);this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]][_0x9857('0x69')]=_['toNumber'](_0x22396c['loggedin']);this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]][_0x9857('0x50')]=_[_0x9857('0x68')](_0x22396c['available']);this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]][_0x9857('0x2d')]=_0x249b7>0x0?_0x249b7:0x0;this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]]['talking']=this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]][_0x9857('0x2d')]>_[_0x9857('0x68')](_0x22396c[_0x9857('0x6a')])?_[_0x9857('0x68')](_0x22396c['loggedin']):this['voiceQueues'][_0x22396c[_0x9857('0x63')]][_0x9857('0x2d')];this[_0x9857('0x4c')](this['voiceQueues'][_0x22396c[_0x9857('0x63')]],_0x9857('0x14'));}logger['debug'](_0x9857('0x6b'),util[_0x9857('0x39')](this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]],{'showHidden':![],'depth':null}));ami[_0x9857('0x41')](_0x9857('0x6c'),this[_0x9857('0x10')][_0x22396c[_0x9857('0x63')]]);}}}catch(_0x3d24ee){logger[_0x9857('0x37')](_0x9857('0x62'),util['inspect'](_0x3d24ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x6d')]=function(_0xa2181d){logger[_0x9857('0x43')](_0x9857('0x6e'),util[_0x9857('0x39')](_0xa2181d,{'showHidden':![],'depth':null}));this[_0x9857('0x11')]=!![];};VoiceQueueReport[_0x9857('0xa')]['syncQueueCallerJoin']=function(_0x5719f3){try{if(this[_0x9857('0x5e')](_0x5719f3)){logger[_0x9857('0x43')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5719f3[_0x9857('0x6f')],util[_0x9857('0x39')](_0x5719f3,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9857('0x3a')][_0x5719f3[_0x9857('0x6f')]]))this[_0x9857('0x3a')][_0x5719f3['uniqueid']]=[];if(_[_0x9857('0x5f')](this[_0x9857('0xe')][_0x5719f3[_0x9857('0x6f')]]))this[_0x9857('0xe')][_0x5719f3[_0x9857('0x6f')]]={};var _0x56f22d=new QueueReport();_0x56f22d[_0x9857('0x4a')]=_0x5719f3[_0x9857('0x63')];_0x56f22d[_0x9857('0x4d')]=this[_0x9857('0x10')][_0x56f22d[_0x9857('0x4a')]]&&this['voiceQueues'][_0x56f22d['name']]['type']?this[_0x9857('0x10')][_0x56f22d[_0x9857('0x4a')]]['type']||_0x9857('0x4e'):'inbound';_0x56f22d['queue']=_0x5719f3['queue'];_0x56f22d[_0x9857('0x70')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x56f22d['position']=_0x5719f3[_0x9857('0x71')];_0x56f22d[_0x9857('0x72')]=_0x5719f3['count'];_0x56f22d[_0x9857('0x6f')]=_0x5719f3[_0x9857('0x6f')];_0x56f22d[_0x9857('0x73')]=this['channels'][_0x5719f3['uniqueid']][_0x9857('0x73')];logger[_0x9857('0x65')](_0x9857('0x74'),_0x56f22d[_0x9857('0x4a')],_0x56f22d[_0x9857('0x4d')]);_[_0x9857('0x75')](_0x56f22d,_[_0x9857('0x76')](_0x5719f3,_[_0x9857('0x77')](_0x56f22d)));this['queueReports'][_0x5719f3[_0x9857('0x6f')]][_0x9857('0x78')](_0x56f22d);this[_0x9857('0xe')][_0x5719f3[_0x9857('0x6f')]]=_0x56f22d;this['emitVoiceQueueChannelSave'](_0x56f22d,_0x9857('0x18'));}}catch(_0x51228b){logger[_0x9857('0x37')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5719f3['uniqueid'],util[_0x9857('0x39')](_0x51228b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x1a')]=function(_0x1906bc){try{if(this[_0x9857('0x5e')](_0x1906bc)){logger[_0x9857('0x43')](_0x9857('0x79'),_0x1906bc[_0x9857('0x6f')],util['inspect'](_0x1906bc,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0x1906bc[_0x9857('0x6f')]]){var _0x3e5273=_[_0x9857('0x7a')](this[_0x9857('0x3a')][_0x1906bc[_0x9857('0x6f')]]);_0x3e5273[_0x9857('0x7b')]=![];_0x3e5273['queuecallercompleteAt']=null;_0x3e5273[_0x9857('0x7c')]=_0x1906bc[_0x9857('0x7c')];_0x3e5273['originalposition']=_0x1906bc['originalposition'];_0x3e5273[_0x9857('0x19')]=!![];_0x3e5273[_0x9857('0x7d')]=moment()[_0x9857('0x49')](_0x9857('0x7e'));_0x3e5273['queuecallerexitreason']=_0x9857('0x7f');_0x3e5273[_0x9857('0x80')]=null;logger[_0x9857('0x65')](_0x9857('0x81'),_0x3e5273[_0x9857('0x4a')],_0x3e5273[_0x9857('0x4d')]);this[_0x9857('0xe')][_0x1906bc[_0x9857('0x6f')]]=_0x3e5273;this[_0x9857('0x3f')](_0x3e5273,_0x9857('0x19'));}}}catch(_0x52efee){logger[_0x9857('0x37')](_0x9857('0x79'),_0x1906bc[_0x9857('0x6f')],util[_0x9857('0x39')](_0x52efee,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9857('0x82')]=function(_0x2328b9){try{if(this[_0x9857('0x5e')](_0x2328b9)){logger[_0x9857('0x43')](_0x9857('0x83'),_0x2328b9[_0x9857('0x6f')],util[_0x9857('0x39')](_0x2328b9,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0x2328b9[_0x9857('0x6f')]]){var _0x8502da=_[_0x9857('0x7a')](this[_0x9857('0x3a')][_0x2328b9[_0x9857('0x6f')]]);_0x8502da['queuecallerleaveAt']=moment()[_0x9857('0x49')](_0x9857('0x7e'));_0x8502da[_0x9857('0x84')]=_0x2328b9[_0x9857('0x84')];_0x8502da[_0x9857('0x85')]=_0x2328b9[_0x9857('0x85')];logger[_0x9857('0x65')](_0x9857('0x86'),_0x8502da['name'],_0x8502da[_0x9857('0x4d')],_0x2328b9[_0x9857('0x84')],_0x2328b9[_0x9857('0x85')]);this[_0x9857('0xe')][_0x2328b9[_0x9857('0x6f')]]=_0x8502da;this[_0x9857('0x42')](_0x8502da,_0x9857('0x87'));}}}catch(_0x24b591){logger[_0x9857('0x37')](_0x9857('0x83'),_0x2328b9[_0x9857('0x6f')],util[_0x9857('0x39')](_0x24b591,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9857('0x88')]=function(_0x315f26){try{if(this[_0x9857('0x5e')](_0x315f26)){logger[_0x9857('0x43')](_0x9857('0x89'),_0x315f26[_0x9857('0x6f')],util[_0x9857('0x39')](_0x315f26,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0x315f26[_0x9857('0x6f')]]){var _0x31f41a=_[_0x9857('0x7a')](this['queueReports'][_0x315f26[_0x9857('0x6f')]]);_0x31f41a['queuecallercomplete']=!![];_0x31f41a[_0x9857('0x8a')]=_0x9857('0x8b');logger[_0x9857('0x65')](_0x9857('0x8c'),_0x31f41a[_0x9857('0x4a')],_0x31f41a[_0x9857('0x4d')]);}}}catch(_0x3c75d9){logger[_0x9857('0x37')]('[%s][voiceQueueReport][agentconnect]',_0x315f26[_0x9857('0x6f')],util[_0x9857('0x39')](_0x3c75d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x8d')]=function(_0xdf59a4){try{if(this[_0x9857('0x5e')](_0xdf59a4)){logger['debug'](_0x9857('0x8e'),_0xdf59a4[_0x9857('0x6f')],util['inspect'](_0xdf59a4,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0xdf59a4[_0x9857('0x6f')]]){var _0x5a1be8=_[_0x9857('0x7a')](this['queueReports'][_0xdf59a4['uniqueid']]);_0x5a1be8[_0x9857('0x19')]=![];_0x5a1be8[_0x9857('0x7d')]=null;_0x5a1be8['assigned']=!![];_0x5a1be8['lastAssignedTo']=_0xdf59a4[_0x9857('0x8f')];_0x5a1be8[_0x9857('0x7c')]=_0xdf59a4[_0x9857('0x7c')];_0x5a1be8['queuecallercomplete']=!![];_0x5a1be8['queuecallerexit']=![];_0x5a1be8[_0x9857('0x90')]=null;if(!_0x5a1be8[_0x9857('0x91')]){if(_0xdf59a4[_0x9857('0x92')]=='transfer'){_0x5a1be8[_0x9857('0x8a')]=_0x9857('0x93');logger[_0x9857('0x65')](_0x9857('0x94'),_0x5a1be8[_0x9857('0x4a')],_0x5a1be8[_0x9857('0x4d')]);}else{if(_[_0x9857('0x95')](_0xdf59a4[_0x9857('0x33')][_0x9857('0x96')](),_0x9857('0x97'))){if(this[_0x9857('0x3a')][_0xdf59a4['linkedid']]){var _0x27f227=_['last'](this[_0x9857('0x3a')][_0xdf59a4[_0x9857('0x98')]]);_0x27f227[_0x9857('0x7b')]=![];_0x27f227[_0x9857('0x99')]=!![];_0x27f227['queuecallerexitAt']=moment(_0x5a1be8['queuecallerjoinAt'])[_0x9857('0x9a')](_0xdf59a4[_0x9857('0x7c')],_0x9857('0x9b'))[_0x9857('0x49')](_0x9857('0x7e'));_0x27f227[_0x9857('0x8a')]=_0x9857('0x9c');_0x27f227[_0x9857('0x91')]=!![];_0x27f227['transfertype']=_0x9857('0x9d');_0x27f227[_0x9857('0x9e')]=_0xdf59a4[_0x9857('0x9f')];_0x27f227[_0x9857('0xa0')]=_0xdf59a4[_0x9857('0x6f')];logger[_0x9857('0x65')](_0x9857('0xa1'),_0x27f227['name'],_0x27f227[_0x9857('0x4d')]);var _0xa0cc98=this[_0x9857('0x3a')][_0xdf59a4['linkedid']];this[_0x9857('0x3a')][_0xdf59a4[_0x9857('0x98')]]=this['queueReports'][_0xdf59a4[_0x9857('0x6f')]];this[_0x9857('0x3a')][_0xdf59a4[_0x9857('0x6f')]]=_0xa0cc98;}}else{_0x5a1be8[_0x9857('0x8a')]=_0x9857('0xa2')+_0xdf59a4[_0x9857('0x92')][_0x9857('0xa3')]();logger[_0x9857('0x65')](_0x9857('0xa4'),_0x5a1be8[_0x9857('0x4a')],_0x5a1be8[_0x9857('0x4d')],_0x5a1be8[_0x9857('0x8a')]);}}}this[_0x9857('0xe')][_0xdf59a4['uniqueid']]=_0x5a1be8;this[_0x9857('0x3f')](_0x5a1be8,_0x9857('0x1b'));}}}catch(_0x406993){logger[_0x9857('0x37')](_0x9857('0x8e'),_0xdf59a4[_0x9857('0x6f')],util[_0x9857('0x39')](_0x406993,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9857('0xa')]['syncVarSet']=function(_0x8dd999){try{if(this[_0x9857('0x5e')](_0x8dd999)){logger[_0x9857('0x43')](_0x9857('0xa5'),_0x8dd999['uniqueid'],util['inspect'](_0x8dd999,{'showHidden':![],'depth':null}));this[_0x9857('0xa6')](_0x8dd999['uniqueid'],_[_0x9857('0x77')](_0x8dd999[_0x9857('0xa7')])[0x0],_0x8dd999[_0x9857('0xa8')]);if(this[_0x9857('0x3a')][_0x8dd999[_0x9857('0x6f')]]){var _0x3ff0f7=_[_0x9857('0x7a')](this[_0x9857('0x3a')][_0x8dd999[_0x9857('0x6f')]]);if(_0x3ff0f7){if(this[_0x9857('0x5e')](_0x8dd999[_0x9857('0xa7')])&&this[_0x9857('0x5e')](_0x8dd999[_0x9857('0xa7')][_0x9857('0xa9')])){switch(_0x8dd999[_0x9857('0xa8')]){case'CONTINUE':_0x3ff0f7[_0x9857('0x99')]=![];_0x3ff0f7[_0x9857('0x90')]=null;break;case'TIMEOUT':_0x3ff0f7[_0x9857('0xaa')]=_0x9857('0xab');_0x3ff0f7[_0x9857('0x99')]=!![];_0x3ff0f7[_0x9857('0x90')]=moment()[_0x9857('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ff0f7['queuecallerleaveAt']=moment()[_0x9857('0x49')](_0x9857('0x7e'));logger[_0x9857('0x43')](_0x9857('0xac'),_0x8dd999[_0x9857('0x6f')],util[_0x9857('0x39')](_0x3ff0f7,{'showHidden':![],'depth':null}));ami[_0x9857('0x41')]('custom:timeout',_0x3ff0f7);break;default:_0x3ff0f7[_0x9857('0x99')]=!![];_0x3ff0f7[_0x9857('0x90')]=moment()[_0x9857('0x49')](_0x9857('0x7e'));_0x3ff0f7[_0x9857('0xad')]=moment()[_0x9857('0x49')](_0x9857('0x7e'));}_0x3ff0f7[_0x9857('0x19')]=![];_0x3ff0f7['queuecallerabandonAt']=null;_0x3ff0f7['queuecallerexitreason']=_0x8dd999[_0x9857('0xa8')];this[_0x9857('0xe')][_0x8dd999[_0x9857('0x6f')]]=_0x3ff0f7;this['emitVoiceQueueChannelRemove'](_0x3ff0f7,_0x9857('0x1c'));}else if(this[_0x9857('0x5e')](_0x8dd999['variable'])&&this[_0x9857('0x5e')](_0x8dd999['variable'][_0x9857('0xae')])){if(!_0x3ff0f7[_0x9857('0x19')]){_0x3ff0f7['queuecallerexit']=!![];_0x3ff0f7[_0x9857('0x90')]=moment()[_0x9857('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ff0f7['queuecallerexitreason']=_0x9857('0xaf');_0x3ff0f7[_0x9857('0xad')]=moment()[_0x9857('0x49')](_0x9857('0x7e'));this[_0x9857('0xe')][_0x8dd999[_0x9857('0x6f')]]=_0x3ff0f7;}}logger[_0x9857('0x65')](_0x9857('0xb0'),_0x8dd999['uniqueid'],_0x3ff0f7[_0x9857('0x4a')],_0x3ff0f7[_0x9857('0x4d')],_[_0x9857('0x77')](_0x8dd999[_0x9857('0xa7')])[0x0],_0x8dd999['value']);_0x3ff0f7[_0x9857('0x13')]=this[_0x9857('0x13')][_0x8dd999[_0x9857('0x6f')]];}}}}catch(_0x33b59e){logger['error'](_0x9857('0xa5'),_0x8dd999[_0x9857('0x6f')],util[_0x9857('0x39')](_0x33b59e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9857('0xa')]['addVariable']=function(_0x12ba88,_0x4cbf07,_0x3979e4){var _0x3b2366=[_0x9857('0xb1'),_0x9857('0xb2'),_0x9857('0xb3'),_0x9857('0xb4'),_0x9857('0xb5'),_0x9857('0xb6'),_0x9857('0xb7'),_0x9857('0xb8'),_0x9857('0xb9'),_0x9857('0xba'),_0x9857('0xbb'),_0x9857('0xbc'),'membercalls',_0x9857('0xbd'),_0x9857('0xbe'),_0x9857('0xbf'),_0x9857('0x8f'),_0x9857('0xc0'),_0x9857('0xc1')];if(!_[_0x9857('0x31')](_0x4cbf07)&&!_[_0x9857('0xc2')](_0x3b2366,_0x4cbf07)){if(_[_0x9857('0x5f')](this['variables'][_0x12ba88])){this[_0x9857('0x13')][_0x12ba88]={};}this['variables'][_0x12ba88][_0x4cbf07]=_0x3979e4;}};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x1d')]=function(_0x1d8fe6){try{if(this[_0x9857('0x5e')](_0x1d8fe6)){logger['debug'](_0x9857('0xc3'),_0x1d8fe6[_0x9857('0x6f')],util[_0x9857('0x39')](_0x1d8fe6,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0x1d8fe6[_0x9857('0x6f')]]){for(var _0x106c3b=0x0,_0x28d5b2={};_0x106c3b<this[_0x9857('0x3a')][_0x1d8fe6[_0x9857('0x6f')]][_0x9857('0xc4')];_0x106c3b+=0x1){_0x28d5b2=this[_0x9857('0x3a')][_0x1d8fe6[_0x9857('0x6f')]][_0x106c3b];if(this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]]){if(_0x28d5b2[_0x9857('0x99')]&&_0x28d5b2[_0x9857('0x91')]!=!![]){this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]][_0x9857('0x55')]+=0x1;}if(_0x28d5b2[_0x9857('0x19')]){this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]][_0x9857('0x56')]+=0x1;}this[_0x9857('0x10')][_0x28d5b2['queue']]['sumHoldTime']+=moment(_0x28d5b2[_0x9857('0xad')])['diff'](_0x28d5b2[_0x9857('0x70')],'seconds')||0x0;if(_0x106c3b===this[_0x9857('0x3a')][_0x1d8fe6[_0x9857('0x6f')]][_0x9857('0xc4')]-0x1){this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]][_0x9857('0x52')]+=moment()['milliseconds'](0x0)[_0x9857('0xc5')](_0x28d5b2[_0x9857('0x70')],_0x9857('0x9b'));this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]][_0x9857('0x54')]+=0x1;if(_0x28d5b2[_0x9857('0x7b')]){this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]][_0x9857('0x4f')]+=0x1;this['voiceQueues'][_0x28d5b2[_0x9857('0x63')]][_0x9857('0x51')]+=moment()[_0x9857('0xc6')](0x0)[_0x9857('0xc5')](_0x28d5b2[_0x9857('0xad')],_0x9857('0x9b'));_0x28d5b2['queuecallercompleteAt']=moment()['format'](_0x9857('0x7e'));_0x28d5b2[_0x9857('0x99')]=![];_0x28d5b2[_0x9857('0x90')]=null;}if(_0x28d5b2[_0x9857('0x99')]&&_0x28d5b2[_0x9857('0x91')]!=!![]){_0x28d5b2['lastevent']=_0x9857('0x55');logger[_0x9857('0x43')](_0x9857('0xc7'),_0x1d8fe6['uniqueid'],util[_0x9857('0x39')](_0x28d5b2,{'showHidden':![],'depth':null}));ami[_0x9857('0x41')](_0x9857('0xc8'),_0x28d5b2);}if(_0x28d5b2['queuecallerabandon']){_0x28d5b2[_0x9857('0xaa')]=_0x9857('0x56');logger[_0x9857('0x43')](_0x9857('0xc9'),_0x1d8fe6['uniqueid'],util['inspect'](_0x28d5b2,{'showHidden':![],'depth':null}));ami[_0x9857('0x41')](_0x9857('0xca'),_0x28d5b2);}}else{this[_0x9857('0x10')][_0x28d5b2['queue']][_0x9857('0x52')]+=this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]][_0x9857('0x53')];}logger['info'](_0x9857('0xcb'),_0x1d8fe6[_0x9857('0x6f')],_0x28d5b2[_0x9857('0x4a')],_0x28d5b2[_0x9857('0x4d')],_0x1d8fe6[_0x9857('0xcc')]);this['channels'][_0x1d8fe6['uniqueid']]=_0x28d5b2;this[_0x9857('0x3f')](_0x28d5b2,_0x9857('0xcd'));this[_0x9857('0x4c')](this[_0x9857('0x10')][_0x28d5b2[_0x9857('0x63')]],_0x9857('0xcd'));}}logger['debug'](_0x9857('0xce'),_0x1d8fe6[_0x9857('0x6f')],util[_0x9857('0x39')](this[_0x9857('0x3a')][_0x1d8fe6[_0x9857('0x6f')]],{'showHidden':![],'depth':null}));ami[_0x9857('0x41')]('custom:voiceQueueReport',this[_0x9857('0x3a')][_0x1d8fe6[_0x9857('0x6f')]]);delete this[_0x9857('0x3a')][_0x1d8fe6[_0x9857('0x6f')]];delete this['channels'][_0x1d8fe6['uniqueid']];}if(this[_0x9857('0x13')][_0x1d8fe6[_0x9857('0x6f')]]){delete this[_0x9857('0x13')][_0x1d8fe6[_0x9857('0x6f')]];}}}catch(_0xc8b181){logger[_0x9857('0x37')](_0x9857('0xc3'),_0x1d8fe6[_0x9857('0x6f')],util[_0x9857('0x39')](_0xc8b181,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x77f1cf){try{if(this[_0x9857('0x5e')](_0x77f1cf)){logger['debug'](_0x9857('0xcf'),_0x77f1cf[_0x9857('0x6f')],util[_0x9857('0x39')](_0x77f1cf,{'showHidden':![],'depth':null}));var _0x549667;if(this[_0x9857('0x3a')][_0x77f1cf['transfereeuniqueid']]){_0x549667=_[_0x9857('0x7a')](this['queueReports'][_0x77f1cf[_0x9857('0xd0')]]);_0x549667[_0x9857('0x9e')]=_0x77f1cf[_0x9857('0xd1')];_0x549667[_0x9857('0xa0')]=_0x77f1cf[_0x9857('0xd2')];_0x549667[_0x9857('0x8a')]='ATTENDEDTRANSFER';_0x549667[_0x9857('0x91')]=!![];_0x549667['transfertype']=_0x9857('0xd3');if(this[_0x9857('0x3a')][_0x77f1cf[_0x9857('0xd2')]]){var _0x6bdc97=this[_0x9857('0x3a')][_0x77f1cf[_0x9857('0xd2')]];this[_0x9857('0x3a')][_0x77f1cf[_0x9857('0xd2')]]=this[_0x9857('0x3a')][_0x77f1cf['transfereeuniqueid']];this['queueReports'][_0x77f1cf['transfereeuniqueid']]=_0x6bdc97;var _0x1bc31a=_[_0x9857('0x7a')](this['queueReports'][_0x77f1cf[_0x9857('0xd0')]]);_0x1bc31a[_0x9857('0xd4')]=!![];}logger[_0x9857('0x65')](_0x9857('0xd5'),_0x77f1cf[_0x9857('0x6f')],_0x549667['name'],_0x549667[_0x9857('0x4d')],_0x549667[_0x9857('0x9e')],_0x549667[_0x9857('0xa0')]);}else if(this['queueReports'][_0x77f1cf[_0x9857('0xd6')]]){_0x549667=_[_0x9857('0x7a')](this[_0x9857('0x3a')][_0x77f1cf['transfertargetuniqueid']]);_0x549667['transferexten']=_0x77f1cf[_0x9857('0xd7')];_0x549667['transferuniqueid']=_0x77f1cf[_0x9857('0xd8')];_0x549667[_0x9857('0x8a')]=_0x9857('0xd9');_0x549667[_0x9857('0x91')]=!![];_0x549667[_0x9857('0xda')]=_0x9857('0xd3');if(this[_0x9857('0x3a')][_0x77f1cf[_0x9857('0xd8')]]){var _0x6bdc97=this[_0x9857('0x3a')][_0x77f1cf['origtransfereruniqueid']];this[_0x9857('0x3a')][_0x77f1cf[_0x9857('0xd8')]]=this['queueReports'][_0x77f1cf[_0x9857('0xd6')]];this[_0x9857('0x3a')][_0x77f1cf['transfertargetuniqueid']]=_0x6bdc97;var _0x1bc31a=_[_0x9857('0x7a')](this[_0x9857('0x3a')][_0x77f1cf[_0x9857('0xd6')]]);_0x1bc31a[_0x9857('0xd4')]=!![];}logger[_0x9857('0x65')](_0x9857('0xd5'),_0x77f1cf['uniqueid'],_0x549667[_0x9857('0x4a')],_0x549667[_0x9857('0x4d')],_0x549667['transferexten'],_0x549667[_0x9857('0xa0')]);}}}catch(_0x309427){logger[_0x9857('0x37')](_0x9857('0xcf'),_0x77f1cf[_0x9857('0x6f')],util[_0x9857('0x39')](_0x309427,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9857('0xa')][_0x9857('0x28')]=function(_0x58a59e){try{if(this[_0x9857('0x5e')](_0x58a59e)){logger['debug'](_0x9857('0xdb'),_0x58a59e[_0x9857('0x6f')],util[_0x9857('0x39')](_0x58a59e,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0x58a59e['transfereeuniqueid']]){var _0x5220a2=_[_0x9857('0x7a')](this['queueReports'][_0x58a59e['transfereeuniqueid']]);_0x5220a2[_0x9857('0x8a')]='BLINDTRANSFER';_0x5220a2['transfer']=!![];_0x5220a2['transfertype']='BLIND';_0x5220a2[_0x9857('0x9e')]=_0x58a59e[_0x9857('0xdc')];_0x5220a2[_0x9857('0xa0')]=_0x58a59e['transfereeuniqueid'];logger[_0x9857('0x65')](_0x9857('0xdd'),_0x58a59e['uniqueid'],_0x5220a2['name'],_0x5220a2[_0x9857('0x4d')],_0x5220a2['transferexten'],_0x5220a2[_0x9857('0xa0')]);this[_0x9857('0x1d')]({'event':'BlindTransfer','uniqueid':_0x58a59e[_0x9857('0xd0')],'context':_0x58a59e['context'],'channel':_0x58a59e[_0x9857('0xde')]});}}}catch(_0x55b3eb){logger[_0x9857('0x37')]('[%s][voiceQueueReport][blindtransfer]',_0x58a59e[_0x9857('0x6f')],util[_0x9857('0x39')](_0x55b3eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9857('0x22')]=function(_0x56fa7b){try{if(this[_0x9857('0x5e')](_0x56fa7b)){logger[_0x9857('0x43')](_0x9857('0xdf'),_0x56fa7b[_0x9857('0x6f')],util[_0x9857('0x39')](_0x56fa7b,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0x56fa7b['uniqueid']]){var _0x4c9eab=_[_0x9857('0x7a')](this[_0x9857('0x3a')][_0x56fa7b[_0x9857('0x6f')]]);if(!_['isNil'](_0x4c9eab[_0x9857('0xad')])){_0x4c9eab[_0x9857('0xe0')]=moment()[_0x9857('0x49')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x9857('0x65')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x56fa7b['uniqueid'],_0x4c9eab[_0x9857('0xe0')]);}}}}catch(_0x47fa49){logger[_0x9857('0x37')](_0x9857('0xdf'),_0x56fa7b[_0x9857('0x6f')],util[_0x9857('0x39')](_0x47fa49,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9857('0x24')]=function(_0x123cc0){try{if(this[_0x9857('0x5e')](_0x123cc0)){logger[_0x9857('0x43')](_0x9857('0xe1'),_0x123cc0['uniqueid'],util[_0x9857('0x39')](_0x123cc0,{'showHidden':![],'depth':null}));if(this[_0x9857('0x3a')][_0x123cc0['uniqueid']]){var _0x5a87ec=_[_0x9857('0x7a')](this[_0x9857('0x3a')][_0x123cc0[_0x9857('0x6f')]]);if(!_[_0x9857('0x31')](_0x5a87ec[_0x9857('0xe0')])){_0x5a87ec['mohtime']+=moment()[_0x9857('0xc6')](0x0)['diff'](_0x5a87ec[_0x9857('0xe0')],_0x9857('0x9b'));logger[_0x9857('0x65')](_0x9857('0xe2'),_0x123cc0[_0x9857('0x6f')],_0x5a87ec[_0x9857('0xe3')]);delete _0x5a87ec['mohstarttime'];}}}}catch(_0x3cec11){logger[_0x9857('0x37')](_0x9857('0xe1'),_0x123cc0[_0x9857('0x6f')],util[_0x9857('0x39')](_0x3cec11,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9857('0x21')]=function(_0x494468){try{if(this[_0x9857('0x5e')](_0x494468)){logger[_0x9857('0x43')](_0x9857('0xe4'),_0x494468[_0x9857('0x6f')],util[_0x9857('0x39')](_0x494468,{'showHidden':![],'depth':null}));if(_0x494468['application']['toLowerCase']()===_0x9857('0xe5')){_0x494468['applicationdata']=_0x494468[_0x9857('0xe6')]&&_0x494468['appdata']['startsWith'](_0x9857('0xe7'))?_0x494468[_0x9857('0xe6')]:(_0x494468[_0x9857('0xe6')]||_0x494468[_0x9857('0xe8')])[_0x9857('0x96')]();if(_[_0x9857('0x95')](_0x494468[_0x9857('0xe8')][_0x9857('0x96')](),'cdr(')){logger['info'](_0x9857('0xe9'),_0x494468[_0x9857('0x6f')],_0x494468[_0x9857('0xea')],_0x494468[_0x9857('0xe8')]);if(_[_0x9857('0x5f')](this[_0x9857('0xe')][_0x494468[_0x9857('0x6f')]]))this[_0x9857('0xe')][_0x494468[_0x9857('0x6f')]]={};var _0x22b477=_0x494468[_0x9857('0xe8')][_0x9857('0xeb')]('=');var _0x108e0a=_0x22b477[0x0]['toLowerCase']()[_0x9857('0xec')](/cdr\((.*)\)/);if(_0x108e0a)this[_0x9857('0xe')][_0x494468[_0x9857('0x6f')]][_0x108e0a[0x1]]=_0x22b477[0x1];}}}}catch(_0x225340){logger['error'](_0x9857('0xed'),_0x494468['uniqueid'],util[_0x9857('0x39')](_0x225340,{'showHidden':![],'depth':null}));}};module[_0x9857('0xee')]=VoiceQueueReport;
\ No newline at end of file
index 2605f52..ea589bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3af=['campaign','queue','CreateReportAgentPreview','../client','createHistory'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xc3af,0x175));var _0xfc3a=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0xc3af[_0x401d67];return _0x25076b;};'use strict';var client=require(_0xfc3a('0x0'));exports[_0xfc3a('0x1')]=function(_0x12d526){return function(){_0x12d526[_0xfc3a('0x2')]=_0x12d526[_0xfc3a('0x3')];return client['Request'](_0xfc3a('0x4'),{'body':_0x12d526,'log':_0xfc3a('0x4')});};};
\ No newline at end of file
+var _0xd9f4=['Request','CreateReportAgentPreview','campaign','queue'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xd9f4,0xa2));var _0x4d9f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xd9f4[_0x1ac595];return _0x455fff;};'use strict';var client=require('../client');exports['createHistory']=function(_0x8eec03){return function(){_0x8eec03[_0x4d9f('0x0')]=_0x8eec03[_0x4d9f('0x1')];return client[_0x4d9f('0x2')](_0x4d9f('0x3'),{'body':_0x8eec03,'log':_0x4d9f('0x3')});};};
\ No newline at end of file
index 6e5ac40..467d122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5226=['../client','create','Request','CreateAttachment'];(function(_0x4745d5,_0x3fdb78){var _0x4f68ae=function(_0xed647d){while(--_0xed647d){_0x4745d5['push'](_0x4745d5['shift']());}};_0x4f68ae(++_0x3fdb78);}(_0x5226,0x16c));var _0x6522=function(_0x5ca965,_0x494dba){_0x5ca965=_0x5ca965-0x0;var _0x2361b6=_0x5226[_0x5ca965];return _0x2361b6;};'use strict';var client=require(_0x6522('0x0'));exports[_0x6522('0x1')]=function(_0x326dbe){return client[_0x6522('0x2')](_0x6522('0x3'),{'body':_0x326dbe,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x2c64=['Request','CreateAttachment','../client'];(function(_0x3d44fc,_0x1db943){var _0x3d6bd=function(_0x4ae9b4){while(--_0x4ae9b4){_0x3d44fc['push'](_0x3d44fc['shift']());}};_0x3d6bd(++_0x1db943);}(_0x2c64,0x1bb));var _0x42c6=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x2c64[_0x25e7cb];return _0x375d92;};'use strict';var client=require(_0x42c6('0x0'));exports['create']=function(_0x58f9e5){return client[_0x42c6('0x1')](_0x42c6('0x2'),{'body':_0x58f9e5,'log':'CreateAttachment'});};
\ No newline at end of file
index 83cdb00..a50ee67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x3c9864,_0x488a3c){var _0x416dcd=function(_0x3f03d6){while(--_0x3f03d6){_0x3c9864['push'](_0x3c9864['shift']());}};_0x416dcd(++_0x488a3c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ No newline at end of file
+var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x29aa6a,_0x337825){var _0x10d518=function(_0x3cd73a){while(--_0x3cd73a){_0x29aa6a['push'](_0x29aa6a['shift']());}};_0x10d518(++_0x337825);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ No newline at end of file
index 6701bbe..4adfa89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x093f=['Request','CreateCmContact','getContacts','GetCmContact','../client','createContact'];(function(_0x4a137f,_0x3c9f13){var _0x82706e=function(_0x422ad9){while(--_0x422ad9){_0x4a137f['push'](_0x4a137f['shift']());}};_0x82706e(++_0x3c9f13);}(_0x093f,0x17e));var _0xf093=function(_0x1a4096,_0xac02c0){_0x1a4096=_0x1a4096-0x0;var _0x1b590a=_0x093f[_0x1a4096];return _0x1b590a;};'use strict';var client=require(_0xf093('0x0'));exports[_0xf093('0x1')]=function(_0xac4d3b){return function(){return client[_0xf093('0x2')]('CreateCmContact',{'body':_0xac4d3b,'log':_0xf093('0x3')});};};exports[_0xf093('0x4')]=function(_0x2336f8){return function(){return client[_0xf093('0x2')](_0xf093('0x5'),{'options':_0x2336f8,'log':_0xf093('0x5')});};};
\ No newline at end of file
+var _0x8a72=['CreateCmContact','getContacts','Request','GetCmContact','../client','createContact'];(function(_0x364cf8,_0x146b9b){var _0x6a59ee=function(_0x3d81eb){while(--_0x3d81eb){_0x364cf8['push'](_0x364cf8['shift']());}};_0x6a59ee(++_0x146b9b);}(_0x8a72,0xa6));var _0x28a7=function(_0x337cdb,_0x423691){_0x337cdb=_0x337cdb-0x0;var _0xe6884c=_0x8a72[_0x337cdb];return _0xe6884c;};'use strict';var client=require(_0x28a7('0x0'));exports[_0x28a7('0x1')]=function(_0x3758e0){return function(){return client['Request'](_0x28a7('0x2'),{'body':_0x3758e0,'log':_0x28a7('0x2')});};};exports[_0x28a7('0x3')]=function(_0x57a003){return function(){return client[_0x28a7('0x4')](_0x28a7('0x5'),{'options':_0x57a003,'log':_0x28a7('0x5')});};};
\ No newline at end of file
index 619915f..63faca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6666=['VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','GetContactDialer','scheduledat','ASC','campaign','MoveContactManagedDialer','CountReScheduled','countReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','DESC','voicePause','db.CmHopper.UserId','../client','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','UpdateCmHopper','rescheduleContact','ContactId','ListId'];(function(_0x3955f0,_0x1b7306){var _0x36d5f4=function(_0x3bac38){while(--_0x3bac38){_0x3955f0['push'](_0x3955f0['shift']());}};_0x36d5f4(++_0x1b7306);}(_0x6666,0x1c7));var _0x6666=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x6666[_0x31eb67];return _0x2a8cb8;};'use strict';var client=require(_0x6666('0x0'));var moment=require('moment');var _=require('lodash');exports[_0x6666('0x1')]=function(_0x409d54,_0xe6b9a6){return function(){return client[_0x6666('0x2')](_0x6666('0x3'),{'options':{'where':{'VoiceQueueId':_0x409d54},'include':[{'model':_0x6666('0x4'),'as':_0x6666('0x5')}],'limit':_0xe6b9a6,'raw':![]},'log':_0x6666('0x6')});};};exports['updateContacts']=function(_0x417751,_0x5cb276,_0x2d4070){return function(){return client[_0x6666('0x2')]('UpdateCmHopper',{'body':_0x417751,'options':{'where':{'VoiceQueueId':_0x5cb276,'scheduledat':{'$lte':moment()[_0x6666('0x7')](_0x6666('0x8'))}},'limit':_0x2d4070},'log':_0x6666('0x9')});};};exports[_0x6666('0xa')]=function(_0x54a4fe){return function(){return client[_0x6666('0x2')]('UpdateCmHopper',{'body':_0x54a4fe,'options':{'where':{'ContactId':_0x54a4fe[_0x6666('0xb')],'ListId':_0x54a4fe[_0x6666('0xc')],'VoiceQueueId':_0x54a4fe[_0x6666('0xd')],'CampaignId':_0x54a4fe[_0x6666('0xe')]}},'log':_0x6666('0xa')});};};exports[_0x6666('0xf')]=function(_0x5654fd,_0x5a8326,_0xb4f46f){return function(){return client[_0x6666('0x2')](_0x6666('0x10'),{'options':{'where':{'VoiceQueueId':_0x5654fd,'ListId':_0x5a8326,'ContactId':_0xb4f46f}},'log':'DestroyCmHopper'});};};exports['getContactDialer']=function(_0x137758,_0x3bfa4e,_0x5df7bf,_0x581013){return function(){return client[_0x6666('0x2')](_0x6666('0x11'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x137758,'active':![],'scheduledat':{'$lte':moment()[_0x6666('0x7')]('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x3bfa4e}}]},'order':[['priority','DESC'],['scheduledat',_0x581013],['id','ASC']],'raw':!![],'limit':_0x5df7bf},'log':'GetContactDialer'});};};exports['getContactDialerIvr']=function(_0xcebbc6,_0x46a735,_0x3842d3){return function(){return client[_0x6666('0x2')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0xcebbc6,'active':![],'scheduledat':{'$lte':moment()[_0x6666('0x7')](_0x6666('0x8'))}},'include':[{'model':_0x6666('0x4'),'as':_0x6666('0x5')}],'order':[['priority','DESC'],[_0x6666('0x12'),_0x3842d3],['id',_0x6666('0x13')]],'raw':!![],'limit':_0x46a735},'log':'GetContactDialerIvr'});};};exports['moveContactManagedDialer']=function(_0x3c2b4b,_0x103059){return function(){_0x3c2b4b[_0x6666('0x14')]=_0x3c2b4b['queue'];return client[_0x6666('0x2')](_0x6666('0x15'),{'body':_0x3c2b4b,'options':{'where':{'ContactId':_0x3c2b4b[_0x6666('0xb')],'ListId':_0x3c2b4b[_0x6666('0xc')],'VoiceQueueId':_0x3c2b4b[_0x6666('0xd')],'CampaignId':_0x3c2b4b[_0x6666('0xe')],'active':_0x103059?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports['countReScheduled']=function(_0x249f9f){return function(){return client[_0x6666('0x2')](_0x6666('0x16'),{'options':{'where':{'VoiceQueueId':_0x249f9f['id']?_0x249f9f['id']||null:null}},'log':_0x6666('0x17')});};};exports[_0x6666('0x18')]=function(_0x136ce8){return function(){return client[_0x6666('0x2')](_0x6666('0x19'),{'options':{'where':{'id':_0x136ce8},'include':[{'model':'CmContact','as':_0x6666('0x5')},{'model':_0x6666('0x1a'),'as':_0x6666('0x1b'),'attributes':['id',_0x6666('0x1c')]},{'model':_0x6666('0x1d'),'as':_0x6666('0x1e'),'attributes':['id',_0x6666('0x1c')]}],'raw':!![]},'log':_0x6666('0x6')});};};exports[_0x6666('0x1f')]=function(_0x162b0d,_0x40f241,_0x2a51ef){return function(){return client[_0x6666('0x2')]('UpdateCmHopper',{'body':_0x162b0d,'options':{'where':{'id':_0x40f241},'limit':_0x2a51ef},'log':_0x6666('0x9')});};};exports[_0x6666('0x20')]=function(_0x405296,_0x2ac545){return function(){return client[_0x6666('0x2')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x405296,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x6666('0x8'))},'UserId':{'$in':_0x2ac545}},'order':[['priority',_0x6666('0x21')],[_0x6666('0x12'),_0x6666('0x21')],['id',_0x6666('0x13')]],'include':[{'model':_0x6666('0x4'),'as':_0x6666('0x5')},{'model':_0x6666('0x1a'),'as':_0x6666('0x1b'),'attributes':['id','name',_0x6666('0x22')]}],'group':_0x6666('0x23'),'raw':!![]},'log':_0x6666('0x11')});};};
\ No newline at end of file
+var _0xf690=['GetContactRecallMe','voicePause','moment','lodash','getContacts','Request','GetCmHopper','CmContact','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','format','priority','DESC','scheduledat','ASC','GetContactDialer','Contact','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','User','Agent','Queue','name','getCmHopper','unlockContact','getContactRecallMe'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xf690,0xa6));var _0x0f69=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xf690[_0x86b219];return _0x1f320c;};'use strict';var client=require('../client');var moment=require(_0x0f69('0x0'));var _=require(_0x0f69('0x1'));exports[_0x0f69('0x2')]=function(_0x3b3544,_0x504a9a){return function(){return client[_0x0f69('0x3')](_0x0f69('0x4'),{'options':{'where':{'VoiceQueueId':_0x3b3544},'include':[{'model':_0x0f69('0x5'),'as':'Contact'}],'limit':_0x504a9a,'raw':![]},'log':'getCmHopper'});};};exports[_0x0f69('0x6')]=function(_0x3bae37,_0xb05ec0,_0x49a3e2){return function(){return client[_0x0f69('0x3')](_0x0f69('0x7'),{'body':_0x3bae37,'options':{'where':{'VoiceQueueId':_0xb05ec0,'scheduledat':{'$lte':moment()['format'](_0x0f69('0x8'))}},'limit':_0x49a3e2},'log':_0x0f69('0x7')});};};exports[_0x0f69('0x9')]=function(_0x491744){return function(){return client[_0x0f69('0x3')]('UpdateCmHopper',{'body':_0x491744,'options':{'where':{'ContactId':_0x491744[_0x0f69('0xa')],'ListId':_0x491744[_0x0f69('0xb')],'VoiceQueueId':_0x491744[_0x0f69('0xc')],'CampaignId':_0x491744[_0x0f69('0xd')]}},'log':'rescheduleContact'});};};exports[_0x0f69('0xe')]=function(_0x3b8f24,_0x1d6202,_0x13cf43){return function(){return client['Request'](_0x0f69('0xf'),{'options':{'where':{'VoiceQueueId':_0x3b8f24,'ListId':_0x1d6202,'ContactId':_0x13cf43}},'log':_0x0f69('0xf')});};};exports[_0x0f69('0x10')]=function(_0x3451eb,_0x1a43e8,_0x3d7d68,_0x1d1a40){return function(){return client['Request']('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3451eb,'active':![],'scheduledat':{'$lte':moment()[_0x0f69('0x11')](_0x0f69('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x1a43e8}}]},'order':[[_0x0f69('0x12'),_0x0f69('0x13')],[_0x0f69('0x14'),_0x1d1a40],['id',_0x0f69('0x15')]],'raw':!![],'limit':_0x3d7d68},'log':_0x0f69('0x16')});};};exports['getContactDialerIvr']=function(_0x10aa70,_0x34dd85,_0x36c58b){return function(){return client[_0x0f69('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x10aa70,'active':![],'scheduledat':{'$lte':moment()[_0x0f69('0x11')](_0x0f69('0x8'))}},'include':[{'model':_0x0f69('0x5'),'as':_0x0f69('0x17')}],'order':[[_0x0f69('0x12'),'DESC'],[_0x0f69('0x14'),_0x36c58b],['id',_0x0f69('0x15')]],'raw':!![],'limit':_0x34dd85},'log':_0x0f69('0x18')});};};exports[_0x0f69('0x19')]=function(_0x398475,_0xc051d){return function(){_0x398475[_0x0f69('0x1a')]=_0x398475[_0x0f69('0x1b')];return client['Request'](_0x0f69('0x1c'),{'body':_0x398475,'options':{'where':{'ContactId':_0x398475[_0x0f69('0xa')],'ListId':_0x398475['ListId'],'VoiceQueueId':_0x398475['VoiceQueueId'],'CampaignId':_0x398475[_0x0f69('0xd')],'active':_0xc051d?undefined:!![]}},'log':_0x0f69('0x1c')});};};exports[_0x0f69('0x1d')]=function(_0x4ac8c2){return function(){return client[_0x0f69('0x3')](_0x0f69('0x1e'),{'options':{'where':{'VoiceQueueId':_0x4ac8c2['id']?_0x4ac8c2['id']||null:null}},'log':_0x0f69('0x1d')});};};exports[_0x0f69('0x1f')]=function(_0x2c3606){return function(){return client[_0x0f69('0x3')]('GetCmHopperPreview',{'options':{'where':{'id':_0x2c3606},'include':[{'model':'CmContact','as':_0x0f69('0x17')},{'model':_0x0f69('0x20'),'as':_0x0f69('0x21'),'attributes':['id','name']},{'model':'VoiceQueue','as':_0x0f69('0x22'),'attributes':['id',_0x0f69('0x23')]}],'raw':!![]},'log':_0x0f69('0x24')});};};exports[_0x0f69('0x25')]=function(_0x46b207,_0xbbaf6e,_0x40a8e2){return function(){return client[_0x0f69('0x3')](_0x0f69('0x7'),{'body':_0x46b207,'options':{'where':{'id':_0xbbaf6e},'limit':_0x40a8e2},'log':_0x0f69('0x7')});};};exports[_0x0f69('0x26')]=function(_0x1b4917,_0xe88673){return function(){return client['Request'](_0x0f69('0x27'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1b4917,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x0f69('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0xe88673}},'order':[[_0x0f69('0x12'),_0x0f69('0x13')],['scheduledat',_0x0f69('0x13')],['id',_0x0f69('0x15')]],'include':[{'model':_0x0f69('0x5'),'as':_0x0f69('0x17')},{'model':_0x0f69('0x20'),'as':_0x0f69('0x21'),'attributes':['id',_0x0f69('0x23'),_0x0f69('0x28')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x0f69('0x16')});};};
\ No newline at end of file
index fe8f8a5..2a8b6f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['../client','Request','GetCmHopperBlack','Contact','checkIsBlackListIvr','CampaignId','phone','GetCmHopperBlackIvr'];(function(_0x2f060e,_0x257e6f){var _0x44f85a=function(_0x106df4){while(--_0x106df4){_0x2f060e['push'](_0x2f060e['shift']());}};_0x44f85a(++_0x257e6f);}(_0x351d,0x90));var _0xd351=function(_0x1ac0bc,_0x205030){_0x1ac0bc=_0x1ac0bc-0x0;var _0x18d7ca=_0x351d[_0x1ac0bc];return _0x18d7ca;};'use strict';var client=require(_0xd351('0x0'));exports['checkIsBlackList']=function(_0x109108){return function(){return client[_0xd351('0x1')](_0xd351('0x2'),{'options':{'where':{'VoiceQueueId':_0x109108['VoiceQueueId'],'phone':_0x109108[_0xd351('0x3')]['phone']},'raw':![]},'log':_0xd351('0x2')});};};exports[_0xd351('0x4')]=function(_0x49610f){return function(){return client[_0xd351('0x1')](_0xd351('0x2'),{'options':{'where':{'CampaignId':_0x49610f[_0xd351('0x5')],'phone':_0x49610f['Contact'][_0xd351('0x6')]},'raw':![]},'log':_0xd351('0x7')});};};
\ No newline at end of file
+var _0x0abf=['GetCmHopperBlackIvr','../client','Request','Contact','GetCmHopperBlack','checkIsBlackListIvr','CampaignId'];(function(_0x26a929,_0x511f6f){var _0xdfbaba=function(_0x5564f8){while(--_0x5564f8){_0x26a929['push'](_0x26a929['shift']());}};_0xdfbaba(++_0x511f6f);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0xf0ab('0x0'));exports['checkIsBlackList']=function(_0x4698fb){return function(){return client[_0xf0ab('0x1')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x4698fb['VoiceQueueId'],'phone':_0x4698fb[_0xf0ab('0x2')]['phone']},'raw':![]},'log':_0xf0ab('0x3')});};};exports[_0xf0ab('0x4')]=function(_0x2efe43){return function(){return client[_0xf0ab('0x1')](_0xf0ab('0x3'),{'options':{'where':{'CampaignId':_0x2efe43[_0xf0ab('0x5')],'phone':_0x2efe43[_0xf0ab('0x2')]['phone']},'raw':![]},'log':_0xf0ab('0x6')});};};
\ No newline at end of file
index 43da987..33e6083 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8348=['CreateCmHopperFinal','../client','createContact','campaign','queue','Request'];(function(_0x1f7a00,_0x341591){var _0x4b151c=function(_0x51fceb){while(--_0x51fceb){_0x1f7a00['push'](_0x1f7a00['shift']());}};_0x4b151c(++_0x341591);}(_0x8348,0x151));var _0x8834=function(_0x3c213a,_0x2eb210){_0x3c213a=_0x3c213a-0x0;var _0x31a36b=_0x8348[_0x3c213a];return _0x31a36b;};'use strict';var client=require(_0x8834('0x0'));exports[_0x8834('0x1')]=function(_0x28c369){return function(){_0x28c369[_0x8834('0x2')]=_0x28c369[_0x8834('0x3')];return client[_0x8834('0x4')](_0x8834('0x5'),{'body':_0x28c369,'log':_0x8834('0x5')});};};
\ No newline at end of file
+var _0x76d4=['Request','CreateCmHopperFinal','../client','createContact','queue'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x76d4,0x70));var _0x476d=function(_0x14586d,_0x4c454f){_0x14586d=_0x14586d-0x0;var _0x215abd=_0x76d4[_0x14586d];return _0x215abd;};'use strict';var client=require(_0x476d('0x0'));exports[_0x476d('0x1')]=function(_0x1392c6){return function(){_0x1392c6['campaign']=_0x1392c6[_0x476d('0x2')];return client[_0x476d('0x3')](_0x476d('0x4'),{'body':_0x1392c6,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
index 0e15e52..e52125b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02fb=['YYYY-MM-DD\x20HH:mm:ss','getCampaignHopperHistory','GetCampaignHopperHistory','endOf','../client','moment','campaign','queue','avgHandleTime','Request','AvgHandleTime','format','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','day'];(function(_0x1ed5fb,_0x4d8787){var _0x26a0e0=function(_0x9c5c05){while(--_0x9c5c05){_0x1ed5fb['push'](_0x1ed5fb['shift']());}};_0x26a0e0(++_0x4d8787);}(_0x02fb,0x144));var _0xb02f=function(_0x3e6886,_0x522f84){_0x3e6886=_0x3e6886-0x0;var _0x221caa=_0x02fb[_0x3e6886];return _0x221caa;};'use strict';var client=require(_0xb02f('0x0'));var moment=require(_0xb02f('0x1'));exports['createHistory']=function(_0x2c749e){return function(){_0x2c749e[_0xb02f('0x2')]=_0x2c749e[_0xb02f('0x3')];return client['Request']('CreateCmHopperHistory',{'body':_0x2c749e,'log':'CreateCmHopperHistory'});};};exports[_0xb02f('0x4')]=function(_0x27b168){return function(){return client[_0xb02f('0x5')](_0xb02f('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x27b168,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xb02f('0x7')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0xb02f('0x8')});};};exports[_0xb02f('0x9')]=function(_0x2d8b12){return function(){return client[_0xb02f('0x5')](_0xb02f('0xa'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xb02f('0xb'))[_0xb02f('0x7')](_0xb02f('0xc')),moment()['endOf'](_0xb02f('0xb'))['format'](_0xb02f('0xc'))]},'campaigntype':'queue'},'raw':![]},'log':_0xb02f('0xa')});};};exports[_0xb02f('0xd')]=function(_0x2e2dc9){return function(){return client[_0xb02f('0x5')](_0xb02f('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xb02f('0xb'))[_0xb02f('0x7')](_0xb02f('0xc')),moment()[_0xb02f('0xf')]('day')[_0xb02f('0x7')](_0xb02f('0xc'))]},'campaigntype':'ivr'},'raw':![]},'log':_0xb02f('0xe')});};};
\ No newline at end of file
+var _0xefbe=['CreateCmHopperHistory','avgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','moment','createHistory','campaign','queue','Request'];(function(_0x196568,_0x3b4a40){var _0x4423c6=function(_0x1909a4){while(--_0x1909a4){_0x196568['push'](_0x196568['shift']());}};_0x4423c6(++_0x3b4a40);}(_0xefbe,0x1e9));var _0xeefb=function(_0x3123c3,_0x27aa85){_0x3123c3=_0x3123c3-0x0;var _0x44c713=_0xefbe[_0x3123c3];return _0x44c713;};'use strict';var client=require('../client');var moment=require(_0xeefb('0x0'));exports[_0xeefb('0x1')]=function(_0x47b91b){return function(){_0x47b91b[_0xeefb('0x2')]=_0x47b91b[_0xeefb('0x3')];return client[_0xeefb('0x4')](_0xeefb('0x5'),{'body':_0x47b91b,'log':'CreateCmHopperHistory'});};};exports[_0xeefb('0x6')]=function(_0x4905c6){return function(){return client['Request']('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0xeefb('0x7')](_0x4905c6,_0xeefb('0x8'))['format'](_0xeefb('0x9')),moment()[_0xeefb('0xa')](_0xeefb('0x9'))]}},'raw':![]},'log':_0xeefb('0xb')});};};exports[_0xeefb('0xc')]=function(_0x5e608d){return function(){return client[_0xeefb('0x4')](_0xeefb('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xeefb('0xe')](_0xeefb('0xf'))[_0xeefb('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xeefb('0x10')](_0xeefb('0xf'))[_0xeefb('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xeefb('0x3')},'raw':![]},'log':_0xeefb('0xd')});};};exports[_0xeefb('0x11')]=function(_0x5858b1){return function(){return client[_0xeefb('0x4')](_0xeefb('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xeefb('0xf'))[_0xeefb('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xeefb('0x10')](_0xeefb('0xf'))[_0xeefb('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'ivr'},'raw':![]},'log':_0xeefb('0x12')});};};
\ No newline at end of file
index 6572773..6e48d2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7177=['description','headerinfo','localstationid','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','callerid','active','notify','NotifyFaxAccount','../client','Request','name'];(function(_0x53dd8e,_0x4ae25d){var _0x4ba8a1=function(_0x4ff502){while(--_0x4ff502){_0x53dd8e['push'](_0x53dd8e['shift']());}};_0x4ba8a1(++_0x4ae25d);}(_0x7177,0x101));var _0x7717=function(_0xbeb3fb,_0x289ba7){_0xbeb3fb=_0xbeb3fb-0x0;var _0x4b45d5=_0x7177[_0xbeb3fb];return _0x4b45d5;};'use strict';var client=require(_0x7717('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x7717('0x1')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0x7717('0x2'),_0x7717('0x3'),'ecm',_0x7717('0x4'),_0x7717('0x5'),'minrate',_0x7717('0x6'),_0x7717('0x7'),_0x7717('0x8'),_0x7717('0x9'),_0x7717('0xa'),_0x7717('0xb'),_0x7717('0xc'),_0x7717('0xd'),_0x7717('0xe')],'include':[{'model':_0x7717('0xf'),'as':_0x7717('0xf'),'attributes':['id','name',_0x7717('0x10'),_0x7717('0x11')]}]},'log':'getFaxAccount'});};};exports[_0x7717('0x12')]=function(_0x4c4ebc,_0x41055f){return client[_0x7717('0x1')](_0x7717('0x13'),{'account':{'id':_0x4c4ebc},'body':_0x41055f,'log':_0x7717('0x13')});};
\ No newline at end of file
+var _0x337f=['description','ecm','localstationid','minrate','modem','faxdetect','tech','key','Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','name'];(function(_0x3c1d36,_0x2e8496){var _0x523c7f=function(_0x3086d9){while(--_0x3086d9){_0x3c1d36['push'](_0x3c1d36['shift']());}};_0x523c7f(++_0x2e8496);}(_0x337f,0x11c));var _0xf337=function(_0xec8068,_0x24d09f){_0xec8068=_0xec8068-0x0;var _0x2e3716=_0x337f[_0xec8068];return _0x2e3716;};'use strict';var client=require(_0xf337('0x0'));exports[_0xf337('0x1')]=function(){return function(){return client[_0xf337('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xf337('0x3'),_0xf337('0x4'),_0xf337('0x5'),'headerinfo',_0xf337('0x6'),_0xf337('0x7'),'maxrate',_0xf337('0x8'),'gateway',_0xf337('0x9'),'t38timeout',_0xf337('0xa'),'TrunkId','ListId',_0xf337('0xb')],'include':[{'model':_0xf337('0xc'),'as':_0xf337('0xc'),'attributes':['id',_0xf337('0x3'),_0xf337('0xd'),_0xf337('0xe')]}]},'log':_0xf337('0xf')});};};exports[_0xf337('0x10')]=function(_0x55ed61,_0x432c09){return client[_0xf337('0x2')](_0xf337('0x11'),{'account':{'id':_0x55ed61},'body':_0x432c09,'log':_0xf337('0x11')});};
\ No newline at end of file
index 0fa54fe..fd120d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28d3=['../client','update','Request','UpdateFaxMessage'];(function(_0x45de6f,_0x5389d1){var _0x2d8e8c=function(_0xddcc57){while(--_0xddcc57){_0x45de6f['push'](_0x45de6f['shift']());}};_0x2d8e8c(++_0x5389d1);}(_0x28d3,0x1b4));var _0x328d=function(_0x3a40a4,_0x17ce05){_0x3a40a4=_0x3a40a4-0x0;var _0x3c0eb8=_0x28d3[_0x3a40a4];return _0x3c0eb8;};'use strict';var client=require(_0x328d('0x0'));exports[_0x328d('0x1')]=function(_0x433c01,_0x240b23){return client[_0x328d('0x2')](_0x328d('0x3'),{'body':_0x240b23,'options':{'where':{'AttachmentId':_0x433c01}},'log':_0x328d('0x3')});};
\ No newline at end of file
+var _0xa84b=['Request','UpdateFaxMessage','update'];(function(_0x26b5fa,_0x1bea6f){var _0x4568c9=function(_0x29d0b2){while(--_0x29d0b2){_0x26b5fa['push'](_0x26b5fa['shift']());}};_0x4568c9(++_0x1bea6f);}(_0xa84b,0xb9));var _0xba84=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0xa84b[_0x3cca7a];return _0x34e717;};'use strict';var client=require('../client');exports[_0xba84('0x0')]=function(_0x4dfae0,_0x436b11){return client[_0xba84('0x1')](_0xba84('0x2'),{'body':_0x436b11,'options':{'where':{'AttachmentId':_0x4dfae0}},'log':_0xba84('0x2')});};
\ No newline at end of file
index 4898ade..3044eec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc86=['DeskField','Descriptions','keyType','Fields','idField','nameField','customField','Tag','Tags','../../client','getDeskAccounts','GetDeskAccount','name','username','remoteUri','type','serverUrl','DeskConfiguration','Configurations','content','variableName','Variable'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0xdc86,0x195));var _0x6dc8=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xdc86[_0x4ae6ef];return _0x3cbb4e;};'use strict';var client=require(_0x6dc8('0x0'));exports[_0x6dc8('0x1')]=function(){return function(_0x15cbd2){return client['Request'](_0x6dc8('0x2'),{'options':{'raw':![],'attributes':['id',_0x6dc8('0x3'),'description',_0x6dc8('0x4'),'password',_0x6dc8('0x5'),'authType',_0x6dc8('0x6'),_0x6dc8('0x7')],'include':[{'model':_0x6dc8('0x8'),'as':_0x6dc8('0x9'),'attributes':['id',_0x6dc8('0x3')],'include':[{'model':'DeskField','as':'Subjects','attributes':['id',_0x6dc8('0x6'),_0x6dc8('0xa'),_0x6dc8('0xb')],'include':[{'model':_0x6dc8('0xc'),'as':_0x6dc8('0xc'),'attributes':['id',_0x6dc8('0x3')]}]},{'model':_0x6dc8('0xd'),'as':_0x6dc8('0xe'),'attributes':['id','type',_0x6dc8('0xa'),'key',_0x6dc8('0xf'),'keyContent','variableName'],'include':[{'model':_0x6dc8('0xc'),'as':'Variable','attributes':['id',_0x6dc8('0x3')]}]},{'model':'DeskField','as':_0x6dc8('0x10'),'attributes':['id','type','content',_0x6dc8('0x11'),_0x6dc8('0x12'),_0x6dc8('0x13'),_0x6dc8('0xb')],'include':[{'model':_0x6dc8('0xc'),'as':_0x6dc8('0xc'),'attributes':['id',_0x6dc8('0x3')]}]},{'model':_0x6dc8('0x14'),'as':_0x6dc8('0x15'),'attributes':['id','name']}]}]},'log':_0x6dc8('0x2')});};};
\ No newline at end of file
+var _0x48cf=['GetDeskAccount','name','description','type','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName','Variable','key','keyType','keyContent','Fields','Tag','Tags','../../client','getDeskAccounts','Request'];(function(_0x263045,_0x518e1a){var _0x1ccfe5=function(_0x4a394c){while(--_0x4a394c){_0x263045['push'](_0x263045['shift']());}};_0x1ccfe5(++_0x518e1a);}(_0x48cf,0x115));var _0xf48c=function(_0x554740,_0x3a0ff4){_0x554740=_0x554740-0x0;var _0x15ec3a=_0x48cf[_0x554740];return _0x15ec3a;};'use strict';var client=require(_0xf48c('0x0'));exports[_0xf48c('0x1')]=function(){return function(_0x13d726){return client[_0xf48c('0x2')](_0xf48c('0x3'),{'options':{'raw':![],'attributes':['id',_0xf48c('0x4'),_0xf48c('0x5'),'username','password','remoteUri','authType',_0xf48c('0x6'),'serverUrl'],'include':[{'model':_0xf48c('0x7'),'as':_0xf48c('0x8'),'attributes':['id','name'],'include':[{'model':_0xf48c('0x9'),'as':_0xf48c('0xa'),'attributes':['id','type',_0xf48c('0xb'),_0xf48c('0xc')],'include':[{'model':_0xf48c('0xd'),'as':_0xf48c('0xd'),'attributes':['id',_0xf48c('0x4')]}]},{'model':_0xf48c('0x9'),'as':'Descriptions','attributes':['id',_0xf48c('0x6'),_0xf48c('0xb'),_0xf48c('0xe'),_0xf48c('0xf'),_0xf48c('0x10'),'variableName'],'include':[{'model':_0xf48c('0xd'),'as':_0xf48c('0xd'),'attributes':['id',_0xf48c('0x4')]}]},{'model':'DeskField','as':_0xf48c('0x11'),'attributes':['id',_0xf48c('0x6'),_0xf48c('0xb'),'idField','nameField','customField',_0xf48c('0xc')],'include':[{'model':_0xf48c('0xd'),'as':_0xf48c('0xd'),'attributes':['id',_0xf48c('0x4')]}]},{'model':_0xf48c('0x12'),'as':_0xf48c('0x13'),'attributes':['id','name']}]}]},'log':_0xf48c('0x3')});};};
\ No newline at end of file
index 9428f6b..889a23c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf57=['variableName','Variable','Descriptions','key','keyType','keyContent','Fields','getDynamics365Accounts','Request','GetDynamics365Account','name','password','remoteUri','clientSecret','serverUrl','description','Dynamics365Field','Subjects','type','content'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xbf57,0x1bf));var _0x7bf5=function(_0x2fe828,_0x44e714){_0x2fe828=_0x2fe828-0x0;var _0x4bfbac=_0xbf57[_0x2fe828];return _0x4bfbac;};'use strict';var client=require('../../client');exports[_0x7bf5('0x0')]=function(){return function(_0x5f58b5){return client[_0x7bf5('0x1')](_0x7bf5('0x2'),{'options':{'raw':![],'attributes':['id',_0x7bf5('0x3'),'username',_0x7bf5('0x4'),_0x7bf5('0x5'),'tenantId','clientId',_0x7bf5('0x6'),_0x7bf5('0x7'),_0x7bf5('0x8')],'include':[{'model':'Dynamics365Configuration','as':'Configurations','attributes':['id',_0x7bf5('0x3'),'ticketType'],'include':[{'model':_0x7bf5('0x9'),'as':_0x7bf5('0xa'),'attributes':['id',_0x7bf5('0xb'),_0x7bf5('0xc'),_0x7bf5('0xd')],'include':[{'model':_0x7bf5('0xe'),'as':_0x7bf5('0xe'),'attributes':['id','name']}]},{'model':_0x7bf5('0x9'),'as':_0x7bf5('0xf'),'attributes':['id','type','content',_0x7bf5('0x10'),_0x7bf5('0x11'),_0x7bf5('0x12'),_0x7bf5('0xd')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x7bf5('0x9'),'as':_0x7bf5('0x13'),'attributes':['id','type',_0x7bf5('0xc'),'idField','nameField','customField',_0x7bf5('0xd')],'include':[{'model':'Variable','as':_0x7bf5('0xe'),'attributes':['id','name']}]}]}]},'log':_0x7bf5('0x2')});};};
\ No newline at end of file
+var _0x280c=['../../client','getDynamics365Accounts','Request','GetDynamics365Account','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Dynamics365Configuration','name','Subjects','type','content','Variable','Dynamics365Field','Descriptions','keyType','variableName','Fields','idField','nameField'];(function(_0x165603,_0x552a2d){var _0x1ce6ab=function(_0x1b1e70){while(--_0x1b1e70){_0x165603['push'](_0x165603['shift']());}};_0x1ce6ab(++_0x552a2d);}(_0x280c,0xfd));var _0xc280=function(_0x506bfb,_0x3da740){_0x506bfb=_0x506bfb-0x0;var _0x297dc6=_0x280c[_0x506bfb];return _0x297dc6;};'use strict';var client=require(_0xc280('0x0'));exports[_0xc280('0x1')]=function(){return function(_0xad5d65){return client[_0xc280('0x2')](_0xc280('0x3'),{'options':{'raw':![],'attributes':['id','name','username',_0xc280('0x4'),_0xc280('0x5'),_0xc280('0x6'),_0xc280('0x7'),_0xc280('0x8'),_0xc280('0x9'),'description'],'include':[{'model':_0xc280('0xa'),'as':'Configurations','attributes':['id',_0xc280('0xb'),'ticketType'],'include':[{'model':'Dynamics365Field','as':_0xc280('0xc'),'attributes':['id',_0xc280('0xd'),_0xc280('0xe'),'variableName'],'include':[{'model':_0xc280('0xf'),'as':_0xc280('0xf'),'attributes':['id','name']}]},{'model':_0xc280('0x10'),'as':_0xc280('0x11'),'attributes':['id',_0xc280('0xd'),'content','key',_0xc280('0x12'),'keyContent',_0xc280('0x13')],'include':[{'model':'Variable','as':_0xc280('0xf'),'attributes':['id',_0xc280('0xb')]}]},{'model':_0xc280('0x10'),'as':_0xc280('0x14'),'attributes':['id',_0xc280('0xd'),_0xc280('0xe'),_0xc280('0x15'),_0xc280('0x16'),'customField',_0xc280('0x13')],'include':[{'model':_0xc280('0xf'),'as':_0xc280('0xf'),'attributes':['id',_0xc280('0xb')]}]}]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
index f214614..d089a72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2182=['idField','nameField','customField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','Request','name','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','content','variableName','Variable','Descriptions','type','keyType','keyContent'];(function(_0x1413e4,_0x2eac19){var _0x131e3a=function(_0x255c52){while(--_0x255c52){_0x1413e4['push'](_0x1413e4['shift']());}};_0x131e3a(++_0x2eac19);}(_0x2182,0xea));var _0x2218=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2182[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x2218('0x0'));exports[_0x2218('0x1')]=function(){return function(_0x4386c3){return client[_0x2218('0x2')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x2218('0x3'),'username',_0x2218('0x4'),_0x2218('0x5'),_0x2218('0x6')],'include':[{'model':_0x2218('0x7'),'as':_0x2218('0x8'),'attributes':['id',_0x2218('0x3')],'include':[{'model':_0x2218('0x9'),'attributes':['id',_0x2218('0x3')]},{'model':_0x2218('0xa'),'as':_0x2218('0xb'),'attributes':['id','type',_0x2218('0xc'),_0x2218('0xd')],'include':[{'model':_0x2218('0xe'),'as':_0x2218('0xe'),'attributes':['id','name']}]},{'model':_0x2218('0xa'),'as':_0x2218('0xf'),'attributes':['id',_0x2218('0x10'),_0x2218('0xc'),'key',_0x2218('0x11'),_0x2218('0x12'),_0x2218('0xd')],'include':[{'model':_0x2218('0xe'),'as':_0x2218('0xe'),'attributes':['id','name']}]},{'model':_0x2218('0xa'),'as':'Fields','attributes':['id',_0x2218('0x10'),_0x2218('0xc'),_0x2218('0x13'),_0x2218('0x14'),_0x2218('0x15'),_0x2218('0xd')],'include':[{'model':_0x2218('0xe'),'as':_0x2218('0xe'),'attributes':['id',_0x2218('0x3')]}]}]}]},'log':_0x2218('0x16')});};};
\ No newline at end of file
+var _0x42f4=['FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','Fields','idField','nameField','customField','../../client','Request','GetFreshdeskAccount','name','username'];(function(_0x9b8a40,_0x5730ba){var _0x16e8bc=function(_0x1fa47c){while(--_0x1fa47c){_0x9b8a40['push'](_0x9b8a40['shift']());}};_0x16e8bc(++_0x5730ba);}(_0x42f4,0x19d));var _0x442f=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x42f4[_0x30f030];return _0xf7614f;};'use strict';var client=require(_0x442f('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x332a57){return client[_0x442f('0x1')](_0x442f('0x2'),{'options':{'raw':![],'attributes':['id',_0x442f('0x3'),_0x442f('0x4'),'apiKey','remoteUri','serverUrl'],'include':[{'model':_0x442f('0x5'),'as':_0x442f('0x6'),'attributes':['id','name'],'include':[{'model':_0x442f('0x7'),'attributes':['id',_0x442f('0x3')]},{'model':_0x442f('0x8'),'as':_0x442f('0x9'),'attributes':['id',_0x442f('0xa'),_0x442f('0xb'),'variableName'],'include':[{'model':_0x442f('0xc'),'as':'Variable','attributes':['id','name']}]},{'model':'FreshdeskField','as':_0x442f('0xd'),'attributes':['id',_0x442f('0xa'),_0x442f('0xb'),_0x442f('0xe'),_0x442f('0xf'),_0x442f('0x10'),_0x442f('0x11')],'include':[{'model':_0x442f('0xc'),'as':_0x442f('0xc'),'attributes':['id',_0x442f('0x3')]}]},{'model':'FreshdeskField','as':_0x442f('0x12'),'attributes':['id',_0x442f('0xa'),_0x442f('0xb'),_0x442f('0x13'),_0x442f('0x14'),_0x442f('0x15'),_0x442f('0x11')],'include':[{'model':_0x442f('0xc'),'as':_0x442f('0xc'),'attributes':['id',_0x442f('0x3')]}]}]}]},'log':_0x442f('0x2')});};};
\ No newline at end of file
index 3bdd5bd..38000c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe7=['FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','variableName','Variable','content','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','name','username','apiKey','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fe7,0x1df));var _0x79fe=function(_0x1f84e8,_0x3e1cc8){_0x1f84e8=_0x1f84e8-0x0;var _0x13837a=_0x9fe7[_0x1f84e8];return _0x13837a;};'use strict';var client=require(_0x79fe('0x0'));exports[_0x79fe('0x1')]=function(){return function(_0x50cf90){return client[_0x79fe('0x2')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x79fe('0x3'),_0x79fe('0x4'),_0x79fe('0x5'),'remoteUri',_0x79fe('0x6')],'include':[{'model':_0x79fe('0x7'),'as':_0x79fe('0x8'),'attributes':['id','name'],'include':[{'model':_0x79fe('0x9'),'as':_0x79fe('0xa'),'attributes':['id',_0x79fe('0xb'),'content',_0x79fe('0xc')],'include':[{'model':_0x79fe('0xd'),'as':_0x79fe('0xd'),'attributes':['id',_0x79fe('0x3')]}]},{'model':_0x79fe('0x9'),'as':'Descriptions','attributes':['id',_0x79fe('0xb'),_0x79fe('0xe'),'key',_0x79fe('0xf'),_0x79fe('0x10'),_0x79fe('0xc')],'include':[{'model':_0x79fe('0xd'),'as':'Variable','attributes':['id',_0x79fe('0x3')]}]}]}]},'log':_0x79fe('0x11')});};};
\ No newline at end of file
+var _0xe0ae=['type','content','Variable','Descriptions','key','keyType','variableName','Request','name','apiKey','remoteUri','FreshsalesConfiguration','FreshsalesField','Subjects'];(function(_0x56bf7b,_0x55acb9){var _0x143d4c=function(_0x58d058){while(--_0x58d058){_0x56bf7b['push'](_0x56bf7b['shift']());}};_0x143d4c(++_0x55acb9);}(_0xe0ae,0xa1));var _0xee0a=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0xe0ae[_0x5c468f];return _0x2136b0;};'use strict';var client=require('../../client');exports['getFreshsalesAccounts']=function(){return function(_0x36ce9f){return client[_0xee0a('0x0')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0xee0a('0x1'),'username',_0xee0a('0x2'),_0xee0a('0x3'),'serverUrl'],'include':[{'model':_0xee0a('0x4'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0xee0a('0x5'),'as':_0xee0a('0x6'),'attributes':['id',_0xee0a('0x7'),_0xee0a('0x8'),'variableName'],'include':[{'model':_0xee0a('0x9'),'as':'Variable','attributes':['id','name']}]},{'model':_0xee0a('0x5'),'as':_0xee0a('0xa'),'attributes':['id',_0xee0a('0x7'),'content',_0xee0a('0xb'),_0xee0a('0xc'),'keyContent',_0xee0a('0xd')],'include':[{'model':'Variable','as':_0xee0a('0x9'),'attributes':['id',_0xee0a('0x1')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
index 942a916..14b16d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3445=['GetSalesforceAccount','name','username','clientId','clientSecret','securityToken','serverUrl','moduleSearch','leadId','additionalSearchAccount','additionalSearchContact','SalesforceField','Subjects','Variable','../../client','getSalesforceAccounts','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5344('0x0'));exports[_0x5344('0x1')]=function(){return function(_0x20f9cf){return client[_0x5344('0x2')](_0x5344('0x3'),{'options':{'raw':![],'attributes':['id',_0x5344('0x4'),_0x5344('0x5'),'password','remoteUri',_0x5344('0x6'),_0x5344('0x7'),_0x5344('0x8'),_0x5344('0x9'),'type'],'include':[{'model':'SalesforceConfiguration','as':'Configurations','attributes':['id','name',_0x5344('0xa'),'moduleCreate','ticketType',_0x5344('0xb'),_0x5344('0xc'),_0x5344('0xd'),'additionalSearchLead'],'include':[{'model':_0x5344('0xe'),'as':_0x5344('0xf'),'include':[{'model':_0x5344('0x10'),'as':_0x5344('0x10'),'attributes':['id',_0x5344('0x4')]}]},{'model':_0x5344('0xe'),'as':'Descriptions','include':[{'model':_0x5344('0x10'),'as':_0x5344('0x10'),'attributes':['id','name']}]},{'model':_0x5344('0xe'),'as':'Fields','include':[{'model':_0x5344('0x10'),'as':'Variable','attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x25a9=['securityToken','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','additionalSearchAccount','Subjects','Variable','SalesforceField','Descriptions','Fields','getSalesforceAccounts','Request','GetSalesforceAccount','name','password','remoteUri'];(function(_0x4279fe,_0x1b41c7){var _0xdc6438=function(_0x4299c5){while(--_0x4299c5){_0x4279fe['push'](_0x4279fe['shift']());}};_0xdc6438(++_0x1b41c7);}(_0x25a9,0xf1));var _0x925a=function(_0x51f632,_0x5a14d5){_0x51f632=_0x51f632-0x0;var _0x24cf36=_0x25a9[_0x51f632];return _0x24cf36;};'use strict';var client=require('../../client');exports[_0x925a('0x0')]=function(){return function(_0x2e2210){return client[_0x925a('0x1')](_0x925a('0x2'),{'options':{'raw':![],'attributes':['id',_0x925a('0x3'),'username',_0x925a('0x4'),_0x925a('0x5'),'clientId','clientSecret',_0x925a('0x6'),'serverUrl',_0x925a('0x7')],'include':[{'model':_0x925a('0x8'),'as':_0x925a('0x9'),'attributes':['id',_0x925a('0x3'),_0x925a('0xa'),_0x925a('0xb'),_0x925a('0xc'),'leadId',_0x925a('0xd'),'additionalSearchContact','additionalSearchLead'],'include':[{'model':'SalesforceField','as':_0x925a('0xe'),'include':[{'model':'Variable','as':_0x925a('0xf'),'attributes':['id',_0x925a('0x3')]}]},{'model':_0x925a('0x10'),'as':_0x925a('0x11'),'include':[{'model':_0x925a('0xf'),'as':_0x925a('0xf'),'attributes':['id','name']}]},{'model':_0x925a('0x10'),'as':_0x925a('0x12'),'include':[{'model':_0x925a('0xf'),'as':_0x925a('0xf'),'attributes':['id',_0x925a('0x3')]}]}]}]},'log':_0x925a('0x2')});};};
\ No newline at end of file
index 8a0c081..dd96786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['Descriptions','content','key','keyType','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','Request','GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','Configurations','ServicenowField','Subjects','type','variableName','Variable'];(function(_0x5e770c,_0xf8dde7){var _0x3b914c=function(_0xc0fab6){while(--_0xc0fab6){_0x5e770c['push'](_0x5e770c['shift']());}};_0x3b914c(++_0xf8dde7);}(_0x4975,0x86));var _0x5497=function(_0x5a8ebe,_0xa51c6){_0x5a8ebe=_0x5a8ebe-0x0;var _0x41c1a2=_0x4975[_0x5a8ebe];return _0x41c1a2;};'use strict';var client=require(_0x5497('0x0'));exports['getServicenowAccounts']=function(){return function(_0x474989){return client[_0x5497('0x1')](_0x5497('0x2'),{'options':{'raw':![],'attributes':['id',_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9')],'include':[{'model':'ServicenowConfiguration','as':_0x5497('0xa'),'attributes':['id','name'],'include':[{'model':_0x5497('0xb'),'as':_0x5497('0xc'),'attributes':['id',_0x5497('0xd'),'content',_0x5497('0xe')],'include':[{'model':'Variable','as':_0x5497('0xf'),'attributes':['id',_0x5497('0x3')]}]},{'model':_0x5497('0xb'),'as':_0x5497('0x10'),'attributes':['id',_0x5497('0xd'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0x5497('0xf'),'attributes':['id',_0x5497('0x3')]}]},{'model':_0x5497('0xb'),'as':_0x5497('0x14'),'attributes':['id',_0x5497('0xd'),_0x5497('0x11'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),_0x5497('0xe')],'include':[{'model':'Variable','as':_0x5497('0xf'),'attributes':['id','name']}]}]}]},'log':_0x5497('0x18')});};};
\ No newline at end of file
+var _0xba34=['keyContent','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','name','Subjects','type','content','variableName','Variable','ServicenowField','Descriptions','keyType'];(function(_0x5e50c8,_0x38b638){var _0x20fada=function(_0x388470){while(--_0x388470){_0x5e50c8['push'](_0x5e50c8['shift']());}};_0x20fada(++_0x38b638);}(_0xba34,0x119));var _0x4ba3=function(_0x91d06b,_0x1eab96){_0x91d06b=_0x91d06b-0x0;var _0x3c43e2=_0xba34[_0x91d06b];return _0x3c43e2;};'use strict';var client=require(_0x4ba3('0x0'));exports[_0x4ba3('0x1')]=function(){return function(_0xb04f7b){return client[_0x4ba3('0x2')](_0x4ba3('0x3'),{'options':{'raw':![],'attributes':['id','name','description','username',_0x4ba3('0x4'),_0x4ba3('0x5'),_0x4ba3('0x6'),_0x4ba3('0x7')],'include':[{'model':_0x4ba3('0x8'),'as':_0x4ba3('0x9'),'attributes':['id',_0x4ba3('0xa')],'include':[{'model':'ServicenowField','as':_0x4ba3('0xb'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),_0x4ba3('0xe')],'include':[{'model':_0x4ba3('0xf'),'as':_0x4ba3('0xf'),'attributes':['id',_0x4ba3('0xa')]}]},{'model':_0x4ba3('0x10'),'as':_0x4ba3('0x11'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),'key',_0x4ba3('0x12'),_0x4ba3('0x13'),'variableName'],'include':[{'model':_0x4ba3('0xf'),'as':'Variable','attributes':['id',_0x4ba3('0xa')]}]},{'model':'ServicenowField','as':_0x4ba3('0x14'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),_0x4ba3('0x15'),_0x4ba3('0x16'),_0x4ba3('0x17'),_0x4ba3('0xe')],'include':[{'model':_0x4ba3('0xf'),'as':_0x4ba3('0xf'),'attributes':['id',_0x4ba3('0xa')]}]}]}]},'log':_0x4ba3('0x18')});};};
\ No newline at end of file
index 1e34c16..3043ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['Configurations','SugarcrmField','Subjects','variableName','Variable','Descriptions','type','key','keyType','Fields','content','idField','customField','../../client','GetSugarcrmAccount','name','username','password','remoteUri','serverUrl','SugarcrmConfiguration'];(function(_0x316f,_0x2516ff){var _0x323ce7=function(_0x453a86){while(--_0x453a86){_0x316f['push'](_0x316f['shift']());}};_0x323ce7(++_0x2516ff);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x0b0e[_0x5d30b4];return _0x1acfb8;};'use strict';var client=require(_0xe0b0('0x0'));exports['getSugarcrmAccounts']=function(){return function(_0xc416e3){return client['Request'](_0xe0b0('0x1'),{'options':{'raw':![],'attributes':['id',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6')],'include':[{'model':_0xe0b0('0x7'),'as':_0xe0b0('0x8'),'attributes':['id',_0xe0b0('0x2')],'include':[{'model':_0xe0b0('0x9'),'as':_0xe0b0('0xa'),'attributes':['id','type','content',_0xe0b0('0xb')],'include':[{'model':_0xe0b0('0xc'),'as':_0xe0b0('0xc'),'attributes':['id',_0xe0b0('0x2')]}]},{'model':'SugarcrmField','as':_0xe0b0('0xd'),'attributes':['id',_0xe0b0('0xe'),'content',_0xe0b0('0xf'),_0xe0b0('0x10'),'keyContent',_0xe0b0('0xb')],'include':[{'model':_0xe0b0('0xc'),'as':_0xe0b0('0xc'),'attributes':['id','name']}]},{'model':_0xe0b0('0x9'),'as':_0xe0b0('0x11'),'attributes':['id',_0xe0b0('0xe'),_0xe0b0('0x12'),_0xe0b0('0x13'),'nameField',_0xe0b0('0x14'),_0xe0b0('0xb')],'include':[{'model':_0xe0b0('0xc'),'as':_0xe0b0('0xc'),'attributes':['id',_0xe0b0('0x2')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0x2ef3=['SugarcrmField','Descriptions','keyType','keyContent','Fields','idField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','password','remoteUri','SugarcrmConfiguration','Configurations','Subjects','type','content','variableName','Variable'];(function(_0x377ac0,_0x5c6208){var _0x230711=function(_0x46417e){while(--_0x46417e){_0x377ac0['push'](_0x377ac0['shift']());}};_0x230711(++_0x5c6208);}(_0x2ef3,0xba));var _0x32ef=function(_0x4b622a,_0x5745c9){_0x4b622a=_0x4b622a-0x0;var _0x41c968=_0x2ef3[_0x4b622a];return _0x41c968;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(_0x47513a){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),'username',_0x32ef('0x5'),_0x32ef('0x6'),'serverUrl'],'include':[{'model':_0x32ef('0x7'),'as':_0x32ef('0x8'),'attributes':['id','name'],'include':[{'model':'SugarcrmField','as':_0x32ef('0x9'),'attributes':['id',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]},{'model':_0x32ef('0xe'),'as':_0x32ef('0xf'),'attributes':['id',_0x32ef('0xa'),'content','key',_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':'Variable','attributes':['id',_0x32ef('0x4')]}]},{'model':'SugarcrmField','as':_0x32ef('0x12'),'attributes':['id','type',_0x32ef('0xb'),_0x32ef('0x13'),'nameField','customField',_0x32ef('0xc')],'include':[{'model':'Variable','as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]}]}]},'log':_0x32ef('0x3')});};};
\ No newline at end of file
index bd9c53d..f3e8a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d6=['VtigerField','type','content','variableName','Variable','Descriptions','key','keyContent','Fields','idField','nameField','customField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','username','remoteUri','serverUrl'];(function(_0x158ed7,_0x20d875){var _0x4cadb6=function(_0x3633f6){while(--_0x3633f6){_0x158ed7['push'](_0x158ed7['shift']());}};_0x4cadb6(++_0x20d875);}(_0x98d6,0x147));var _0x698d=function(_0x3c260a,_0x3807b5){_0x3c260a=_0x3c260a-0x0;var _0x1ce62d=_0x98d6[_0x3c260a];return _0x1ce62d;};'use strict';var client=require(_0x698d('0x0'));exports[_0x698d('0x1')]=function(){return function(_0x131b2f){return client[_0x698d('0x2')](_0x698d('0x3'),{'options':{'raw':![],'attributes':['id',_0x698d('0x4'),_0x698d('0x5'),_0x698d('0x6'),'accessKey',_0x698d('0x7'),_0x698d('0x8')],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id','name'],'include':[{'model':_0x698d('0x9'),'as':'Subjects','attributes':['id',_0x698d('0xa'),_0x698d('0xb'),_0x698d('0xc')],'include':[{'model':_0x698d('0xd'),'as':_0x698d('0xd'),'attributes':['id',_0x698d('0x4')]}]},{'model':_0x698d('0x9'),'as':_0x698d('0xe'),'attributes':['id',_0x698d('0xa'),_0x698d('0xb'),_0x698d('0xf'),'keyType',_0x698d('0x10'),_0x698d('0xc')],'include':[{'model':'Variable','as':_0x698d('0xd'),'attributes':['id','name']}]},{'model':_0x698d('0x9'),'as':_0x698d('0x11'),'attributes':['id',_0x698d('0xa'),'content',_0x698d('0x12'),_0x698d('0x13'),_0x698d('0x14'),_0x698d('0xc')],'include':[{'model':_0x698d('0xd'),'as':_0x698d('0xd'),'attributes':['id',_0x698d('0x4')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0xfcb8=['description','accessKey','remoteUri','Subjects','type','content','variableName','Variable','VtigerField','key','keyType','keyContent','Fields','nameField','customField','../../client','getVtigerAccounts','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcb8,0x1ad));var _0x8fcb=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0xfcb8[_0xbf8ec1];return _0xc84567;};'use strict';var client=require(_0x8fcb('0x0'));exports[_0x8fcb('0x1')]=function(){return function(_0x3d910a){return client['Request']('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x8fcb('0x2'),_0x8fcb('0x3'),'username',_0x8fcb('0x4'),_0x8fcb('0x5'),'serverUrl'],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id',_0x8fcb('0x2')],'include':[{'model':'VtigerField','as':_0x8fcb('0x6'),'attributes':['id',_0x8fcb('0x7'),_0x8fcb('0x8'),_0x8fcb('0x9')],'include':[{'model':_0x8fcb('0xa'),'as':_0x8fcb('0xa'),'attributes':['id',_0x8fcb('0x2')]}]},{'model':_0x8fcb('0xb'),'as':'Descriptions','attributes':['id',_0x8fcb('0x7'),'content',_0x8fcb('0xc'),_0x8fcb('0xd'),_0x8fcb('0xe'),_0x8fcb('0x9')],'include':[{'model':_0x8fcb('0xa'),'as':_0x8fcb('0xa'),'attributes':['id',_0x8fcb('0x2')]}]},{'model':'VtigerField','as':_0x8fcb('0xf'),'attributes':['id',_0x8fcb('0x7'),_0x8fcb('0x8'),'idField',_0x8fcb('0x10'),_0x8fcb('0x11'),_0x8fcb('0x9')],'include':[{'model':_0x8fcb('0xa'),'as':_0x8fcb('0xa'),'attributes':['id',_0x8fcb('0x2')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
index dcf0f94..b4d6800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6e1=['password','remoteUri','serverUrl','type','Configurations','Tag','ZendeskField','Subjects','Variable','Descriptions','content','key','keyType','variableName','Fields','idField','customField','GetZendeskAccount','../../client','Request','name','username'];(function(_0x572637,_0x216d95){var _0xb6748=function(_0x3eeb8c){while(--_0x3eeb8c){_0x572637['push'](_0x572637['shift']());}};_0xb6748(++_0x216d95);}(_0xb6e1,0x11a));var _0x1b6e=function(_0x1bad88,_0x1f87b4){_0x1bad88=_0x1bad88-0x0;var _0x36f638=_0xb6e1[_0x1bad88];return _0x36f638;};'use strict';var client=require(_0x1b6e('0x0'));exports['getZendeskAccounts']=function(){return function(_0x3e138c){return client[_0x1b6e('0x1')]('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0x1b6e('0x2'),_0x1b6e('0x3'),_0x1b6e('0x4'),'token',_0x1b6e('0x5'),'authType',_0x1b6e('0x6'),_0x1b6e('0x7')],'include':[{'model':'ZendeskConfiguration','as':_0x1b6e('0x8'),'attributes':['id','name'],'include':[{'model':_0x1b6e('0x9'),'attributes':['id',_0x1b6e('0x2')]},{'model':_0x1b6e('0xa'),'as':_0x1b6e('0xb'),'attributes':['id',_0x1b6e('0x7'),'content','variableName'],'include':[{'model':_0x1b6e('0xc'),'as':_0x1b6e('0xc'),'attributes':['id',_0x1b6e('0x2')]}]},{'model':_0x1b6e('0xa'),'as':_0x1b6e('0xd'),'attributes':['id',_0x1b6e('0x7'),_0x1b6e('0xe'),_0x1b6e('0xf'),_0x1b6e('0x10'),'keyContent',_0x1b6e('0x11')],'include':[{'model':_0x1b6e('0xc'),'as':_0x1b6e('0xc'),'attributes':['id',_0x1b6e('0x2')]}]},{'model':'ZendeskField','as':_0x1b6e('0x12'),'attributes':['id','type',_0x1b6e('0xe'),_0x1b6e('0x13'),'nameField',_0x1b6e('0x14'),_0x1b6e('0x11')],'include':[{'model':_0x1b6e('0xc'),'as':_0x1b6e('0xc'),'attributes':['id',_0x1b6e('0x2')]}]}]}]},'log':_0x1b6e('0x15')});};};
\ No newline at end of file
+var _0x473a=['nameField','../../client','getZendeskAccounts','name','username','token','remoteUri','authType','type','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','content','Variable','Descriptions','variableName','Fields','idField'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x473a,0xdd));var _0xa473=function(_0x588f00,_0x5bca90){_0x588f00=_0x588f00-0x0;var _0x5c0861=_0x473a[_0x588f00];return _0x5c0861;};'use strict';var client=require(_0xa473('0x0'));exports[_0xa473('0x1')]=function(){return function(_0x14fb98){return client['Request']('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0xa473('0x2'),_0xa473('0x3'),'password',_0xa473('0x4'),_0xa473('0x5'),_0xa473('0x6'),'serverUrl',_0xa473('0x7')],'include':[{'model':_0xa473('0x8'),'as':_0xa473('0x9'),'attributes':['id',_0xa473('0x2')],'include':[{'model':_0xa473('0xa'),'attributes':['id',_0xa473('0x2')]},{'model':_0xa473('0xb'),'as':_0xa473('0xc'),'attributes':['id',_0xa473('0x7'),_0xa473('0xd'),'variableName'],'include':[{'model':_0xa473('0xe'),'as':_0xa473('0xe'),'attributes':['id',_0xa473('0x2')]}]},{'model':'ZendeskField','as':_0xa473('0xf'),'attributes':['id',_0xa473('0x7'),'content','key','keyType','keyContent',_0xa473('0x10')],'include':[{'model':_0xa473('0xe'),'as':_0xa473('0xe'),'attributes':['id','name']}]},{'model':_0xa473('0xb'),'as':_0xa473('0x11'),'attributes':['id',_0xa473('0x7'),_0xa473('0xd'),_0xa473('0x12'),_0xa473('0x13'),'customField','variableName'],'include':[{'model':_0xa473('0xe'),'as':_0xa473('0xe'),'attributes':['id',_0xa473('0x2')]}]}]}]},'log':'GetZendeskAccount'});};};
\ No newline at end of file
index 5a9d0ad..c3d87e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3266=['code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','description','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','Fields','idField','nameField','customField','../../client','Request','GetZohoAccount','name','host','serverUrl'];(function(_0x3de2bd,_0x1c0fc3){var _0x7f0146=function(_0x501b5c){while(--_0x501b5c){_0x3de2bd['push'](_0x3de2bd['shift']());}};_0x7f0146(++_0x1c0fc3);}(_0x3266,0x102));var _0x6326=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x3266[_0x54defc];return _0x1955d3;};'use strict';var client=require(_0x6326('0x0'));exports['getZohoAccounts']=function(){return function(_0x52d63e){return client[_0x6326('0x1')](_0x6326('0x2'),{'options':{'raw':![],'attributes':['id',_0x6326('0x3'),'description',_0x6326('0x4'),'zone','clientId','clientSecret',_0x6326('0x5'),_0x6326('0x6'),_0x6326('0x7')],'include':[{'model':_0x6326('0x8'),'as':_0x6326('0x9'),'attributes':['id',_0x6326('0x3'),_0x6326('0xa'),_0x6326('0xb'),_0x6326('0xc')],'include':[{'model':_0x6326('0xd'),'as':_0x6326('0xe'),'attributes':['id',_0x6326('0xf'),_0x6326('0x10'),_0x6326('0x11')],'include':[{'model':'Variable','as':_0x6326('0x12'),'attributes':['id',_0x6326('0x3')]}]},{'model':_0x6326('0xd'),'as':_0x6326('0x13'),'attributes':['id',_0x6326('0xf'),_0x6326('0x10'),'key','keyType','keyContent','variableName'],'include':[{'model':_0x6326('0x12'),'as':_0x6326('0x12'),'attributes':['id',_0x6326('0x3')]}]},{'model':_0x6326('0xd'),'as':_0x6326('0x14'),'attributes':['id',_0x6326('0xf'),_0x6326('0x10'),_0x6326('0x15'),_0x6326('0x16'),_0x6326('0x17'),'variableName'],'include':[{'model':_0x6326('0x12'),'as':_0x6326('0x12'),'attributes':['id',_0x6326('0x3')]}]}]}]},'log':_0x6326('0x2')});};};
\ No newline at end of file
+var _0xb291=['refreshToken','ZohoConfiguration','Configurations','name','moduleSearch','description','Subjects','type','content','variableName','Variable','ZohoField','Descriptions','key','keyType','keyContent','Fields','idField','Request','GetZohoAccount','clientId','clientSecret','code'];(function(_0x1720fa,_0xa61b09){var _0x3ed31a=function(_0x4a5f51){while(--_0x4a5f51){_0x1720fa['push'](_0x1720fa['shift']());}};_0x3ed31a(++_0xa61b09);}(_0xb291,0x13d));var _0x1b29=function(_0x1f759e,_0x1d9cab){_0x1f759e=_0x1f759e-0x0;var _0x48e878=_0xb291[_0x1f759e];return _0x48e878;};'use strict';var client=require('../../client');exports['getZohoAccounts']=function(){return function(_0x4185e3){return client[_0x1b29('0x0')](_0x1b29('0x1'),{'options':{'raw':![],'attributes':['id','name','description','host','zone',_0x1b29('0x2'),_0x1b29('0x3'),'serverUrl',_0x1b29('0x4'),_0x1b29('0x5')],'include':[{'model':_0x1b29('0x6'),'as':_0x1b29('0x7'),'attributes':['id',_0x1b29('0x8'),'moduleCreate',_0x1b29('0x9'),_0x1b29('0xa')],'include':[{'model':'ZohoField','as':_0x1b29('0xb'),'attributes':['id',_0x1b29('0xc'),_0x1b29('0xd'),_0x1b29('0xe')],'include':[{'model':_0x1b29('0xf'),'as':_0x1b29('0xf'),'attributes':['id',_0x1b29('0x8')]}]},{'model':_0x1b29('0x10'),'as':_0x1b29('0x11'),'attributes':['id','type',_0x1b29('0xd'),_0x1b29('0x12'),_0x1b29('0x13'),_0x1b29('0x14'),_0x1b29('0xe')],'include':[{'model':_0x1b29('0xf'),'as':_0x1b29('0xf'),'attributes':['id',_0x1b29('0x8')]}]},{'model':'ZohoField','as':_0x1b29('0x15'),'attributes':['id','type',_0x1b29('0xd'),_0x1b29('0x16'),'nameField','customField','variableName'],'include':[{'model':_0x1b29('0xf'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x1b29('0x1')});};};
\ No newline at end of file
index e0ea527..087615a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2de9=['exten','queue','agent','accountcode','toNumber','endtime','starttime','dialstring','uniqueid','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING','diff','seconds','calleridnum'];(function(_0x2c3bcc,_0x4bd4c4){var _0x4ae6c4=function(_0x441ee0){while(--_0x441ee0){_0x2c3bcc['push'](_0x2c3bcc['shift']());}};_0x4ae6c4(++_0x4bd4c4);}(_0x2de9,0x1d4));var _0x92de=function(_0x33ace5,_0x2ebb77){_0x33ace5=_0x33ace5-0x0;var _0x391626=_0x2de9[_0x33ace5];return _0x391626;};'use strict';var moment=require(_0x92de('0x0'));var _=require(_0x92de('0x1'));var util=require(_0x92de('0x2'));var client=require(_0x92de('0x3'));exports[_0x92de('0x4')]=function(_0x48aade){var _0x13e10c=_0x48aade[_0x92de('0x5')]||_0x48aade[_0x92de('0x6')];return client[_0x92de('0x7')](_0x92de('0x8'),{'body':{'channel':_0x92de('0x9'),'membername':_0x48aade[_0x92de('0xa')],'interface':_['isNil'](_0x48aade[_0x92de('0xb')])?util[_0x92de('0xc')](_0x92de('0xd'),_0x48aade[_0x92de('0xa')]):_0x48aade['interface'],'type':_0x92de('0xe'),'enterAt':_0x48aade['queuecallerleaveAt'],'exitAt':_0x13e10c,'duration':moment(_0x13e10c)[_0x92de('0xf')](_0x48aade['queuecallerleaveAt'],_0x92de('0x10')),'data1':'inbound','data2':_0x48aade[_0x92de('0x11')],'data3':_0x48aade[_0x92de('0x12')],'data4':null,'data5':_0x48aade[_0x92de('0x13')],'role':_0x92de('0x14'),'internal':_0x48aade[_0x92de('0x15')]?_[_0x92de('0x16')](_0x48aade[_0x92de('0x15')]):undefined,'uniqueid':_0x48aade['uniqueid']},'log':_0x92de('0x8')});};exports['voiceDialReport']=function(_0x267123){return client['Request'](_0x92de('0x8'),{'body':{'channel':'voice','membername':_0x267123['membername'],'interface':_0x267123[_0x92de('0xb')],'type':_0x92de('0xe'),'enterAt':_0x267123['starttime'],'exitAt':_0x267123['endtime'],'duration':moment(_0x267123[_0x92de('0x17')])['diff'](_0x267123[_0x92de('0x18')],_0x92de('0x10'))>=0x0?moment(_0x267123[_0x92de('0x17')])[_0x92de('0xf')](_0x267123[_0x92de('0x18')],_0x92de('0x10')):null,'data1':'outbound','data2':_0x267123[_0x92de('0x15')],'data3':_0x267123['exten'],'data4':_0x267123[_0x92de('0x19')]||null,'role':_0x92de('0x14'),'internal':_0x267123['accountcode']?_[_0x92de('0x16')](_0x267123[_0x92de('0x15')]):undefined,'uniqueid':_0x267123[_0x92de('0x1a')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x2393=['voiceQueueReport','queuecallerexitAt','Request','lastAssignedTo','isNil','interface','format','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','voice','membername','starttime','endtime','outbound','dialstring','moment','util','../client'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x2393,0x10b));var _0x3239=function(_0x28c89b,_0x2510b3){_0x28c89b=_0x28c89b-0x0;var _0x176500=_0x2393[_0x28c89b];return _0x176500;};'use strict';var moment=require(_0x3239('0x0'));var _=require('lodash');var util=require(_0x3239('0x1'));var client=require(_0x3239('0x2'));exports[_0x3239('0x3')]=function(_0x2e98e5){var _0x3ea7e0=_0x2e98e5['queuecallercompleteAt']||_0x2e98e5[_0x3239('0x4')];return client[_0x3239('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x2e98e5[_0x3239('0x6')],'interface':_[_0x3239('0x7')](_0x2e98e5[_0x3239('0x8')])?util[_0x3239('0x9')]('SIP/%s',_0x2e98e5['lastAssignedTo']):_0x2e98e5[_0x3239('0x8')],'type':_0x3239('0xa'),'enterAt':_0x2e98e5[_0x3239('0xb')],'exitAt':_0x3ea7e0,'duration':moment(_0x3ea7e0)[_0x3239('0xc')](_0x2e98e5[_0x3239('0xb')],_0x3239('0xd')),'data1':_0x3239('0xe'),'data2':_0x2e98e5[_0x3239('0xf')],'data3':_0x2e98e5[_0x3239('0x10')],'data4':null,'data5':_0x2e98e5[_0x3239('0x11')],'role':_0x3239('0x12'),'internal':_0x2e98e5[_0x3239('0x13')]?_[_0x3239('0x14')](_0x2e98e5[_0x3239('0x13')]):undefined,'uniqueid':_0x2e98e5[_0x3239('0x15')]},'log':_0x3239('0x16')});};exports[_0x3239('0x17')]=function(_0x1bad96){return client[_0x3239('0x5')](_0x3239('0x16'),{'body':{'channel':_0x3239('0x18'),'membername':_0x1bad96[_0x3239('0x19')],'interface':_0x1bad96[_0x3239('0x8')],'type':'TALKING','enterAt':_0x1bad96[_0x3239('0x1a')],'exitAt':_0x1bad96[_0x3239('0x1b')],'duration':moment(_0x1bad96['endtime'])[_0x3239('0xc')](_0x1bad96[_0x3239('0x1a')],_0x3239('0xd'))>=0x0?moment(_0x1bad96['endtime'])['diff'](_0x1bad96[_0x3239('0x1a')],_0x3239('0xd')):null,'data1':_0x3239('0x1c'),'data2':_0x1bad96[_0x3239('0x13')],'data3':_0x1bad96[_0x3239('0x10')],'data4':_0x1bad96[_0x3239('0x1d')]||null,'role':'agent','internal':_0x1bad96['accountcode']?_[_0x3239('0x14')](_0x1bad96[_0x3239('0x13')]):undefined,'uniqueid':_0x1bad96[_0x3239('0x15')]},'log':'CreateMemberReport'});};
\ No newline at end of file
index 5eba43d..183599a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1455=['GetSettings','../client','getSettings','Request','stopRecordingOnTransfer'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0x1455,0x97));var _0x5145=function(_0x14b141,_0x1376df){_0x14b141=_0x14b141-0x0;var _0x1001d0=_0x1455[_0x14b141];return _0x1001d0;};'use strict';var client=require(_0x5145('0x0'));exports[_0x5145('0x1')]=function(){return client[_0x5145('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5145('0x3')]},'log':_0x5145('0x4')});};
\ No newline at end of file
+var _0x97e7=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0x3e6d20,_0x57ab39){var _0x560dea=function(_0xe379e8){while(--_0xe379e8){_0x3e6d20['push'](_0x3e6d20['shift']());}};_0x560dea(++_0x57ab39);}(_0x97e7,0x1a1));var _0x797e=function(_0x4ac765,_0x2b75a5){_0x4ac765=_0x4ac765-0x0;var _0x2ee115=_0x97e7[_0x4ac765];return _0x2ee115;};'use strict';var client=require(_0x797e('0x0'));exports[_0x797e('0x1')]=function(){return client[_0x797e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x797e('0x3')]},'log':_0x797e('0x4')});};
\ No newline at end of file
index 35813f4..d9eda0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df7=['../client','GetTemplate','name'];(function(_0x1919c5,_0x1b40c5){var _0x1da435=function(_0x4ccb07){while(--_0x4ccb07){_0x1919c5['push'](_0x1919c5['shift']());}};_0x1da435(++_0x1b40c5);}(_0x6df7,0x72));var _0x76df=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6df7[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0x76df('0x0'));exports['getTemplates']=function(_0x558984){return function(_0x176199){return client['Request'](_0x76df('0x1'),{'options':{'raw':!![],'attributes':['id',_0x76df('0x2'),'html']},'log':_0x76df('0x1')});};};
\ No newline at end of file
+var _0x92ac=['name','html','../client','getTemplates','GetTemplate'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x92ac,0x151));var _0xc92a=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x92ac[_0x236d24];return _0x1574cf;};'use strict';var client=require(_0xc92a('0x0'));exports[_0xc92a('0x1')]=function(_0x1299e8){return function(_0x4cc497){return client['Request'](_0xc92a('0x2'),{'options':{'raw':!![],'attributes':['id',_0xc92a('0x3'),_0xc92a('0x4')]},'log':_0xc92a('0x2')});};};
\ No newline at end of file
index abef973..785fef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf513=['data1','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','Condition','field','value','AnyConditions','operator','Actions'];(function(_0x3b52dd,_0x58aa78){var _0x58269f=function(_0x96fa85){while(--_0x96fa85){_0x3b52dd['push'](_0x3b52dd['shift']());}};_0x58269f(++_0x58aa78);}(_0xf513,0x126));var _0x3f51=function(_0x5b15db,_0x1c8570){_0x5b15db=_0x5b15db-0x0;var _0x3d89da=_0xf513[_0x5b15db];return _0x3d89da;};'use strict';var client=require(_0x3f51('0x0'));exports[_0x3f51('0x1')]=function(_0x4412e4){return function(_0x803b0){return client[_0x3f51('0x2')](_0x3f51('0x3'),{'options':{'raw':![],'attributes':['id',_0x3f51('0x4'),_0x3f51('0x5'),'status'],'include':[{'model':_0x3f51('0x6'),'as':'AllConditions','attributes':['id',_0x3f51('0x7'),'operator',_0x3f51('0x8')]},{'model':'Condition','as':_0x3f51('0x9'),'attributes':['id','field',_0x3f51('0xa'),_0x3f51('0x8')]},{'model':'Action','as':_0x3f51('0xb'),'attributes':['id','action',_0x3f51('0xc'),'data2',_0x3f51('0xd'),_0x3f51('0xe'),_0x3f51('0xf'),_0x3f51('0x10'),_0x3f51('0x11')]}]},'log':_0x3f51('0x3')});};};
\ No newline at end of file
+var _0x0380=['operator','Action','action','data4','data5','data6','GetTrigger','../client','Request','channel','Condition','AllConditions','field','value','AnyConditions'];(function(_0x4d23f3,_0x59b5f7){var _0x261d33=function(_0x29bd94){while(--_0x29bd94){_0x4d23f3['push'](_0x4d23f3['shift']());}};_0x261d33(++_0x59b5f7);}(_0x0380,0x17e));var _0x0038=function(_0x3ec002,_0x41d1ff){_0x3ec002=_0x3ec002-0x0;var _0x8fac74=_0x0380[_0x3ec002];return _0x8fac74;};'use strict';var client=require(_0x0038('0x0'));exports['getTriggers']=function(_0x52ec6a){return function(_0x4b103c){return client[_0x0038('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x0038('0x2'),'status'],'include':[{'model':_0x0038('0x3'),'as':_0x0038('0x4'),'attributes':['id',_0x0038('0x5'),'operator',_0x0038('0x6')]},{'model':_0x0038('0x3'),'as':_0x0038('0x7'),'attributes':['id',_0x0038('0x5'),_0x0038('0x8'),_0x0038('0x6')]},{'model':_0x0038('0x9'),'as':'Actions','attributes':['id',_0x0038('0xa'),'data1','data2','data3',_0x0038('0xb'),_0x0038('0xc'),_0x0038('0xd'),'data7']}]},'log':_0x0038('0xe')});};};
\ No newline at end of file
index 7cef279..0fa5651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fdd=['Request','GetTrunk','defaultuser','getTrunks'];(function(_0x49faff,_0x247916){var _0x127f8b=function(_0x274428){while(--_0x274428){_0x49faff['push'](_0x49faff['shift']());}};_0x127f8b(++_0x247916);}(_0x8fdd,0x1ab));var _0xd8fd=function(_0x118733,_0x2bd820){_0x118733=_0x118733-0x0;var _0x4777af=_0x8fdd[_0x118733];return _0x4777af;};'use strict';var client=require('../client');exports[_0xd8fd('0x0')]=function(_0x3682c2){return function(_0x573acd){return client[_0xd8fd('0x1')](_0xd8fd('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0xd8fd('0x3')]},'log':_0xd8fd('0x2')});};};
\ No newline at end of file
+var _0x379e=['registry','defaultuser','../client','Request','GetTrunk','name'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x379e,0x104));var _0xe379=function(_0x5f4fb2,_0x29b0af){_0x5f4fb2=_0x5f4fb2-0x0;var _0x5822f3=_0x379e[_0x5f4fb2];return _0x5822f3;};'use strict';var client=require(_0xe379('0x0'));exports['getTrunks']=function(_0x565eb4){return function(_0x4bbe70){return client[_0xe379('0x1')](_0xe379('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe379('0x3'),_0xe379('0x4'),_0xe379('0x5')]},'log':_0xe379('0x2')});};};
\ No newline at end of file
index 9b180d4..c4a34e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
index ddb662b..5501980 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1520=['UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update','Request'];(function(_0x1d1854,_0x4a83b1){var _0x5b2acb=function(_0x29ae13){while(--_0x29ae13){_0x1d1854['push'](_0x1d1854['shift']());}};_0x5b2acb(++_0x4a83b1);}(_0x1520,0x17b));var _0x0152=function(_0x51b5b5,_0x2b0198){_0x51b5b5=_0x51b5b5-0x0;var _0x246894=_0x1520[_0x51b5b5];return _0x246894;};'use strict';var client=require(_0x0152('0x0'));exports[_0x0152('0x1')]=function(_0x2841e2){return client['Request'](_0x0152('0x2'),{'body':_0x2841e2,'log':_0x0152('0x2')});};exports[_0x0152('0x3')]=function(_0x1d61df,_0x50cdf3,_0x128443){return client[_0x0152('0x4')](_0x0152('0x5'),{'body':_0x1d61df,'options':{'where':{'uniqueid':_0x50cdf3,'interface':_0x128443,'agentcomplete':!![]}},'log':_0x0152('0x5')});};
\ No newline at end of file
+var _0x1575=['UpdateVoiceAgentReport','../client','update','Request'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x1575,0x19d));var _0x5157=function(_0x320296,_0x245139){_0x320296=_0x320296-0x0;var _0x31d05a=_0x1575[_0x320296];return _0x31d05a;};'use strict';var client=require(_0x5157('0x0'));exports['create']=function(_0x4c630a){return client['Request']('CreateVoiceAgentReport',{'body':_0x4c630a,'log':'CreateVoiceAgentReport'});};exports[_0x5157('0x1')]=function(_0x1cae9b,_0xa8fe75,_0x31960e){return client[_0x5157('0x2')](_0x5157('0x3'),{'body':_0x1cae9b,'options':{'where':{'uniqueid':_0xa8fe75,'interface':_0x31960e,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index 682bc9d..9570dd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac59=['billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration'];(function(_0x36dc6f,_0x88bf26){var _0x18b3a5=function(_0x5e4866){while(--_0x5e4866){_0x36dc6f['push'](_0x36dc6f['shift']());}};_0x18b3a5(++_0x88bf26);}(_0xac59,0x12d));var _0x9ac5=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xac59[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0x9ac5('0x0'));var util=require('util');var _=require(_0x9ac5('0x1'));var client=require(_0x9ac5('0x2'));exports[_0x9ac5('0x3')]=function(_0x1dd0f1){return client[_0x9ac5('0x4')](_0x9ac5('0x5'),{'body':_[_0x9ac5('0x6')](_0x1dd0f1,{'source':_0x1dd0f1[_0x9ac5('0x7')],'destinationcontext':_0x1dd0f1[_0x9ac5('0x8')],'callerid':_0x1dd0f1[_0x9ac5('0x9')],'amaflags':_0x9ac5('0xa')}),'log':_0x9ac5('0x5')});};exports[_0x9ac5('0xb')]=function(){return function(){return client[_0x9ac5('0x4')](_0x9ac5('0xc'),{'options':{'where':{'type':[_0x9ac5('0xd')],'createdAt':{'$between':[moment()['startOf'](_0x9ac5('0xe'))[_0x9ac5('0xf')](_0x9ac5('0x10')),moment()[_0x9ac5('0x11')]('day')['format'](_0x9ac5('0x10'))]}},'attributes':[_0x9ac5('0x12'),_0x9ac5('0x13'),_0x9ac5('0x14'),_0x9ac5('0x15')]},'log':_0x9ac5('0x16')});};};
\ No newline at end of file
+var _0x3a28=['disposition','duration','moment','util','lodash','../client','create','Request','merge','calleridnum','context','callerid','CreateVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3a28,0xc0));var _0x83a2=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x3a28[_0x273c39];return _0x46d6b5;};'use strict';var moment=require(_0x83a2('0x0'));var util=require(_0x83a2('0x1'));var _=require(_0x83a2('0x2'));var client=require(_0x83a2('0x3'));exports[_0x83a2('0x4')]=function(_0x39eaed){return client[_0x83a2('0x5')]('CreateVoiceCallReport',{'body':_[_0x83a2('0x6')](_0x39eaed,{'source':_0x39eaed[_0x83a2('0x7')],'destinationcontext':_0x39eaed[_0x83a2('0x8')],'callerid':_0x39eaed[_0x83a2('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x83a2('0xa')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x83a2('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x83a2('0xb')],'createdAt':{'$between':[moment()[_0x83a2('0xc')](_0x83a2('0xd'))['format'](_0x83a2('0xe')),moment()[_0x83a2('0xf')](_0x83a2('0xd'))['format'](_0x83a2('0xe'))]}},'attributes':[_0x83a2('0x10'),_0x83a2('0x11'),_0x83a2('0x12'),'billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index de97377..2af8517 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9401=['../client','CreateVoiceDialReport'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x9401,0xd2));var _0x1940=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x9401[_0x1928c9];return _0x51b5fb;};'use strict';var client=require(_0x1940('0x0'));exports['create']=function(_0x50b65c){return client['Request'](_0x1940('0x1'),{'body':_0x50b65c,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
+var _0x7307=['CreateVoiceDialReport','../client','Request'];(function(_0x4e7b46,_0x1e5718){var _0x309599=function(_0x549658){while(--_0x549658){_0x4e7b46['push'](_0x4e7b46['shift']());}};_0x309599(++_0x1e5718);}(_0x7307,0x1a2));var _0x7730=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x7307[_0x3ea913];return _0x2b4f28;};'use strict';var client=require(_0x7730('0x0'));exports['create']=function(_0x532c1b){return client[_0x7730('0x1')](_0x7730('0x2'),{'body':_0x532c1b,'log':_0x7730('0x2')});};
\ No newline at end of file
index 038dba2..a60752e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9780=['exten','recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x9780,0x1d4));var _0x0978=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x9780[_0x30abff];return _0x4c571e;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x0978('0x0')](_0x0978('0x1'),{'options':{'raw':!![],'attributes':['id',_0x0978('0x2'),_0x0978('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x0978('0x4')});};};
\ No newline at end of file
+var _0xe205=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xe205,0xa7));var _0x5e20=function(_0x7a0372,_0x5c18b2){_0x7a0372=_0x7a0372-0x0;var _0x5847d5=_0xe205[_0x7a0372];return _0x5847d5;};'use strict';var client=require(_0x5e20('0x0'));exports[_0x5e20('0x1')]=function(){return function(){return client[_0x5e20('0x2')](_0x5e20('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5e20('0x4'),_0x5e20('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x5e20('0x1')});};};
\ No newline at end of file
index 2c21fb3..1337f8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bfc=['dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','acw','autopause','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry'];(function(_0xea1570,_0x2f7856){var _0x579e74=function(_0x236bcc){while(--_0x236bcc){_0xea1570['push'](_0xea1570['shift']());}};_0x579e74(++_0x2f7856);}(_0x6bfc,0x159));var _0xc6bf=function(_0x1309f0,_0x25bbd9){_0x1309f0=_0x1309f0-0x0;var _0x16ebbc=_0x6bfc[_0x1309f0];return _0x16ebbc;};'use strict';var client=require('../client');exports[_0xc6bf('0x0')]=function(){return function(){return client[_0xc6bf('0x1')](_0xc6bf('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc6bf('0x3'),'acwTimeout',_0xc6bf('0x4'),'monitor_format',_0xc6bf('0x5'),_0xc6bf('0x6'),_0xc6bf('0x7'),'dialLimitChannel',_0xc6bf('0x8'),_0xc6bf('0x9'),_0xc6bf('0xa'),_0xc6bf('0xb'),_0xc6bf('0xc'),_0xc6bf('0xd'),_0xc6bf('0xe'),_0xc6bf('0xf'),'dialQueueOptions',_0xc6bf('0x10'),_0xc6bf('0x11'),_0xc6bf('0x12'),_0xc6bf('0x13'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xc6bf('0x14'),_0xc6bf('0x15'),'dialGlobalMaxRetry','dialTimezone',_0xc6bf('0x16'),_0xc6bf('0x17'),'dialCheckDuplicateType',_0xc6bf('0x18'),_0xc6bf('0x19'),_0xc6bf('0x1a'),_0xc6bf('0x1b'),_0xc6bf('0x1c'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0xc6bf('0x1d'),_0xc6bf('0x1e'),_0xc6bf('0x1f'),_0xc6bf('0x20'),_0xc6bf('0x21'),_0xc6bf('0x22'),_0xc6bf('0x23'),'dialAgiAfterHangupAgent',_0xc6bf('0x24'),'dialQueueProject2','monitor_format',_0xc6bf('0x25'),_0xc6bf('0x26'),'dialCutDigit',_0xc6bf('0x27'),_0xc6bf('0x28'),'dialDropMaxRetry',_0xc6bf('0x29'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry',_0xc6bf('0x2a'),_0xc6bf('0x2b'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0xc6bf('0x2c'),_0xc6bf('0x2d'),'dialPreviewAutoRecallMe'],'include':[{'model':_0xc6bf('0x2e'),'as':_0xc6bf('0x2e'),'attributes':['id',_0xc6bf('0x2f'),_0xc6bf('0x30'),'active']},{'model':_0xc6bf('0x31'),'as':_0xc6bf('0x32'),'attributes':['id',_0xc6bf('0x2f')]},{'model':_0xc6bf('0x2e'),'as':_0xc6bf('0x33'),'attributes':['id',_0xc6bf('0x2f'),_0xc6bf('0x30'),_0xc6bf('0x34')]},{'model':'Interval','as':_0xc6bf('0x35'),'attributes':['id',_0xc6bf('0x2f')],'include':[{'model':_0xc6bf('0x35'),'as':'Intervals','attributes':['id',_0xc6bf('0x2f'),_0xc6bf('0x36')]}]}]},'log':_0xc6bf('0x0')});};};
\ No newline at end of file
+var _0x91c6=['dialMachineMaxRetry','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','Pause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x37d0bc,_0x109b96){var _0x170e60=function(_0xae2ad){while(--_0xae2ad){_0x37d0bc['push'](_0x37d0bc['shift']());}};_0x170e60(++_0x109b96);}(_0x91c6,0xf9));var _0x691c=function(_0x2516cd,_0x83cf78){_0x2516cd=_0x2516cd-0x0;var _0x2e5fee=_0x91c6[_0x2516cd];return _0x2e5fee;};'use strict';var client=require(_0x691c('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x691c('0x1'),{'options':{'raw':![],'attributes':['id',_0x691c('0x2'),_0x691c('0x3'),_0x691c('0x4'),_0x691c('0x5'),'monitor_format',_0x691c('0x6'),_0x691c('0x7'),_0x691c('0x8'),_0x691c('0x9'),_0x691c('0xa'),_0x691c('0xb'),'dialPredictiveOptimization',_0x691c('0xc'),_0x691c('0xd'),_0x691c('0xe'),_0x691c('0xf'),'dialOriginateTimeout',_0x691c('0x10'),_0x691c('0x11'),_0x691c('0x12'),'dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry',_0x691c('0x13'),_0x691c('0x14'),_0x691c('0x15'),_0x691c('0x16'),'dialTimezone','dialGlobalInterval',_0x691c('0x17'),_0x691c('0x18'),_0x691c('0x19'),_0x691c('0x1a'),_0x691c('0x1b'),_0x691c('0x1c'),_0x691c('0x1d'),_0x691c('0x1e'),'dialAMDBetweenWordsSilence',_0x691c('0x1f'),_0x691c('0x20'),_0x691c('0x21'),_0x691c('0x22'),_0x691c('0x23'),_0x691c('0x24'),_0x691c('0x25'),_0x691c('0x26'),'dialAgiAfterHangupClient',_0x691c('0x27'),_0x691c('0x28'),_0x691c('0x29'),_0x691c('0x2a'),_0x691c('0x2b'),'dialNoSuchNumberMaxRetry',_0x691c('0x2c'),_0x691c('0x2d'),'dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x691c('0x2e'),'dialMachineRetryFrequency',_0x691c('0x2f'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x691c('0x30'),_0x691c('0x31'),_0x691c('0x32')],'include':[{'model':_0x691c('0x33'),'as':_0x691c('0x33'),'attributes':['id','name',_0x691c('0x34'),'active']},{'model':_0x691c('0x35'),'as':'mandatoryDispositionPause','attributes':['id',_0x691c('0x2')]},{'model':_0x691c('0x33'),'as':_0x691c('0x36'),'attributes':['id',_0x691c('0x2'),_0x691c('0x34'),'active']},{'model':_0x691c('0x37'),'as':'Interval','attributes':['id',_0x691c('0x2')],'include':[{'model':_0x691c('0x37'),'as':_0x691c('0x38'),'attributes':['id',_0x691c('0x2'),_0x691c('0x39')]}]}]},'log':_0x691c('0x3a')});};};
\ No newline at end of file
index eb33b49..e3be1d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2ff4da,_0x1f461d){var _0x2e45f3=function(_0x30af70){while(--_0x30af70){_0x2ff4da['push'](_0x2ff4da['shift']());}};_0x2e45f3(++_0x1f461d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x136f15,_0x594005){var _0x4dafb6=function(_0x3be25e){while(--_0x3be25e){_0x136f15['push'](_0x136f15['shift']());}};_0x4dafb6(++_0x594005);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
index 40f9649..a01911e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4251=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x1693d7,_0x387cef){var _0x4369ba=function(_0xb6e476){while(--_0xb6e476){_0x1693d7['push'](_0x1693d7['shift']());}};_0x4369ba(++_0x387cef);}(_0x4251,0x159));var _0x1425=function(_0x1d0232,_0xbc1520){_0x1d0232=_0x1d0232-0x0;var _0x2fea44=_0x4251[_0x1d0232];return _0x2fea44;};'use strict';var client=require(_0x1425('0x0'));exports[_0x1425('0x1')]=function(_0x6004de){return function(){return client['Request'](_0x1425('0x2'),{'options':{'where':{'VoiceQueueId':_0x6004de,'paused':!![]},'raw':!![]},'log':_0x1425('0x1')});};};
\ No newline at end of file
+var _0xae27=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x7a4e03,_0x11a50e){var _0x65f067=function(_0x325284){while(--_0x325284){_0x7a4e03['push'](_0x7a4e03['shift']());}};_0x65f067(++_0x11a50e);}(_0xae27,0x80));var _0x7ae2=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0xae27[_0x35bd6c];return _0x2f421d;};'use strict';var client=require(_0x7ae2('0x0'));exports['getVoiceQueueRtPauses']=function(_0x3447f9){return function(){return client['Request'](_0x7ae2('0x1'),{'options':{'where':{'VoiceQueueId':_0x3447f9,'paused':!![]},'raw':!![]},'log':_0x7ae2('0x2')});};};
\ No newline at end of file
index b51155f..e5c71e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x424707,_0x42fca4){var _0x7144b9=function(_0x18c7c3){while(--_0x18c7c3){_0x424707['push'](_0x424707['shift']());}};_0x7144b9(++_0x42fca4);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x299f4f,_0x1b7da3){var _0x236e4e=function(_0x1c91c1){while(--_0x1c91c1){_0x299f4f['push'](_0x299f4f['shift']());}};_0x236e4e(++_0x1b7da3);}(_0x7a54,0x106));var _0x47a5=function(_0x1aa600,_0x5dfecf){_0x1aa600=_0x1aa600-0x0;var _0xe23c3a=_0x7a54[_0x1aa600];return _0xe23c3a;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index 5d1dfbd..c7226d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d7e=['origtransfereraccountcode','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','Request','origtransferercalleridname','secondtransfererconnectedlinename'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x3d7e,0x16a));var _0xe3d7=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x3d7e[_0x49c057];return _0xd8f0e6;};'use strict';var client=require(_0xe3d7('0x0'));exports[_0xe3d7('0x1')]={};exports[_0xe3d7('0x2')]=function(_0x3eff8c){return client['Request'](_0xe3d7('0x3'),{'body':{'result':_0x3eff8c['result'],'transfererchannel':_0x3eff8c[_0xe3d7('0x4')],'transferercalleridnum':_0x3eff8c[_0xe3d7('0x5')],'transferercalleridname':_0x3eff8c[_0xe3d7('0x6')],'transfererconnectedlinenum':_0x3eff8c[_0xe3d7('0x7')],'transfererconnectedlinename':_0x3eff8c[_0xe3d7('0x8')],'transfereraccountcode':_0x3eff8c['transfereraccountcode'],'transferercontext':_0x3eff8c['transferercontext'],'transfererexten':_0x3eff8c[_0xe3d7('0x9')],'transfererlinkedid':_0x3eff8c[_0xe3d7('0xa')],'transfereechannel':_0x3eff8c['transfereechannel'],'transfereecalleridnum':_0x3eff8c[_0xe3d7('0xb')],'transfereecalleridname':_0x3eff8c['transfereecalleridname'],'transfereeconnectedlinenum':_0x3eff8c[_0xe3d7('0xc')],'transfereeconnectedlinename':_0x3eff8c['transfereeconnectedlinename'],'transfereeaccountcode':_0x3eff8c[_0xe3d7('0xd')],'transfereecontext':_0x3eff8c[_0xe3d7('0xe')],'transfereeexten':_0x3eff8c[_0xe3d7('0xf')],'transfereelinkedid':_0x3eff8c[_0xe3d7('0x10')],'isexternal':_0x3eff8c['isexternal'],'context':_0x3eff8c[_0xe3d7('0x11')],'extension':_0x3eff8c[_0xe3d7('0x12')],'type':_0xe3d7('0x13')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x4891b0){return client[_0xe3d7('0x14')](_0xe3d7('0x3'),{'body':{'result':_0x4891b0['result'],'transfererchannel':_0x4891b0['origtransfererchannel'],'transferercalleridnum':_0x4891b0['origtransferercalleridnum'],'transferercalleridname':_0x4891b0[_0xe3d7('0x15')],'transfererconnectedlinenum':_0x4891b0['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4891b0[_0xe3d7('0x16')],'transfereraccountcode':_0x4891b0[_0xe3d7('0x17')],'transferercontext':_0x4891b0['secondtransferercontext'],'transfererexten':_0x4891b0['secondtransfererexten'],'transfererlinkedid':_0x4891b0['origtransfererlinkedid'],'transfereechannel':_0x4891b0[_0xe3d7('0x18')],'transfereecalleridnum':_0x4891b0[_0xe3d7('0x19')],'transfereecalleridname':_0x4891b0[_0xe3d7('0x1a')],'transfereeconnectedlinenum':_0x4891b0[_0xe3d7('0x1b')],'transfereeconnectedlinename':_0x4891b0[_0xe3d7('0x1c')],'transfereeaccountcode':_0x4891b0[_0xe3d7('0x1d')],'transfereecontext':_0x4891b0[_0xe3d7('0x1e')],'transfereeexten':_0x4891b0[_0xe3d7('0x1f')],'transfereelinkedid':_0x4891b0['transfertargetlinkedid'],'isexternal':_0x4891b0['isexternal'],'context':_0x4891b0[_0xe3d7('0x20')],'extension':_0x4891b0[_0xe3d7('0x21')],'type':_0xe3d7('0x22')},'log':_0xe3d7('0x3')});};
\ No newline at end of file
+var _0xd590=['transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereecontext','transfereelinkedid','isexternal','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x34f096,_0x21660d){var _0x2d29e8=function(_0x26087c){while(--_0x26087c){_0x34f096['push'](_0x34f096['shift']());}};_0x2d29e8(++_0x21660d);}(_0xd590,0x19b));var _0x0d59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd590[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x0d59('0x0')]={};exports[_0x0d59('0x1')]=function(_0x1469dd){return client['Request'](_0x0d59('0x2'),{'body':{'result':_0x1469dd[_0x0d59('0x3')],'transfererchannel':_0x1469dd[_0x0d59('0x4')],'transferercalleridnum':_0x1469dd[_0x0d59('0x5')],'transferercalleridname':_0x1469dd[_0x0d59('0x6')],'transfererconnectedlinenum':_0x1469dd[_0x0d59('0x7')],'transfererconnectedlinename':_0x1469dd[_0x0d59('0x8')],'transfereraccountcode':_0x1469dd[_0x0d59('0x9')],'transferercontext':_0x1469dd[_0x0d59('0xa')],'transfererexten':_0x1469dd[_0x0d59('0xb')],'transfererlinkedid':_0x1469dd[_0x0d59('0xc')],'transfereechannel':_0x1469dd['transfereechannel'],'transfereecalleridnum':_0x1469dd[_0x0d59('0xd')],'transfereecalleridname':_0x1469dd[_0x0d59('0xe')],'transfereeconnectedlinenum':_0x1469dd['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1469dd['transfereeconnectedlinename'],'transfereeaccountcode':_0x1469dd['transfereeaccountcode'],'transfereecontext':_0x1469dd[_0x0d59('0xf')],'transfereeexten':_0x1469dd['transfereeexten'],'transfereelinkedid':_0x1469dd[_0x0d59('0x10')],'isexternal':_0x1469dd[_0x0d59('0x11')],'context':_0x1469dd['context'],'extension':_0x1469dd[_0x0d59('0x12')],'type':_0x0d59('0x13')},'log':'CreateVoiceTransferReport'});};exports[_0x0d59('0x14')]=function(_0x274d9a){return client[_0x0d59('0x15')](_0x0d59('0x2'),{'body':{'result':_0x274d9a['result'],'transfererchannel':_0x274d9a[_0x0d59('0x16')],'transferercalleridnum':_0x274d9a['origtransferercalleridnum'],'transferercalleridname':_0x274d9a[_0x0d59('0x17')],'transfererconnectedlinenum':_0x274d9a[_0x0d59('0x18')],'transfererconnectedlinename':_0x274d9a[_0x0d59('0x19')],'transfereraccountcode':_0x274d9a[_0x0d59('0x1a')],'transferercontext':_0x274d9a[_0x0d59('0x1b')],'transfererexten':_0x274d9a['secondtransfererexten'],'transfererlinkedid':_0x274d9a[_0x0d59('0x1c')],'transfereechannel':_0x274d9a[_0x0d59('0x1d')],'transfereecalleridnum':_0x274d9a[_0x0d59('0x1e')],'transfereecalleridname':_0x274d9a['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x274d9a['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x274d9a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x274d9a[_0x0d59('0x1f')],'transfereecontext':_0x274d9a[_0x0d59('0x20')],'transfereeexten':_0x274d9a['transfertargetexten'],'transfereelinkedid':_0x274d9a[_0x0d59('0x21')],'isexternal':_0x274d9a['isexternal'],'context':_0x274d9a[_0x0d59('0x22')],'extension':_0x274d9a['origtransfererexten'],'type':'attended'},'log':_0x0d59('0x2')});};
\ No newline at end of file
index dc29b96..fd04e54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9505=['omit','undefined','values','channels','voicechannel','map','find','filename','uniqueid','wav','Action','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','channel','destinationchannel','StopMixMonitor','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','campaigns','run','event','emit','custom:','faxAccounts','send','checkAfterSend','server','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','message','catch','command','Command','then','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length'];(function(_0x3df93e,_0x5af13a){var _0x2d4f2a=function(_0x14c85c){while(--_0x14c85c){_0x3df93e['push'](_0x3df93e['shift']());}};_0x2d4f2a(++_0x5af13a);}(_0x9505,0x1e5));var _0x5950=function(_0xacdfb6,_0x316df6){_0xacdfb6=_0xacdfb6-0x0;var _0x5b15a3=_0x9505[_0xacdfb6];return _0x5b15a3;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var jayson=require('jayson/promise');var schema=require(_0x5950('0x2'));var BPromise=require(_0x5950('0x3'));var moment=require(_0x5950('0x4'));var config=require(_0x5950('0x5'));var properties=require(_0x5950('0x6'));var ami=require('../ami');exports['listen']=function(_0x2494fc,_0x43f5b6,_0x3ac153){return new BPromise(function(_0x3a5973,_0x4aa518){var _0x4b9478={'QueuePause':function(_0x425d17){return new Promise(function(_0x362f04,_0x3986aa){var _0x16f0e9=util[_0x5950('0x7')](_0x5950('0x8'),_0x5950('0x9'),_0x425d17[_0x5950('0xa')]);if(_0x2494fc[_0x5950('0xb')]&&_0x2494fc['timers'][_0x16f0e9]&&_0x2494fc[_0x5950('0xb')][_0x16f0e9][_0x5950('0xc')]){_0x2494fc['timers'][_0x16f0e9]['updateAcw']();}if(_0x2494fc[_0x5950('0xd')][_0x16f0e9]){_0x2494fc[_0x5950('0xd')][_0x16f0e9][_0x5950('0xe')]({'statePause':_0x425d17[_0x5950('0xf')]?!![]:![]});}_0x362f04({'code':0xc8,'message':_0x5950('0x10')});});},'Reload':function(_0x2bf7ae){var _0x17c263=this;return new Promise(function(_0x38d757,_0x409092){if(ami[_0x5950('0x11')]()==![]){return _0x409092(_0x17c263[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}_0x2bf7ae=_[_0x5950('0x17')](_0x2bf7ae,_[_0x5950('0x18')](properties[_0x5950('0x19')]));_0x2bf7ae[_0x5950('0x1a')]=_0x5950('0x1b');return ami['Action'](_0x2bf7ae)['then'](function(_0x30e759){_0x38d757({'code':0xc8,'message':_0x30e759[_0x5950('0x1c')]});})[_0x5950('0x1d')](function(_0x5a9530){_0x409092(_0x17c263[_0x5950('0x12')](0x1f5,_0x5a9530['message']));});});},'Command':function(_0x49bb78){var _0x119f1f=this;return new Promise(function(_0x2ada72,_0x1ad343){if(ami['isConnected']()==![]){return _0x1ad343(_0x119f1f[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config['asterisk']['username'],'ami\x20disconnected']['join']('\x20')));}_0x49bb78=_[_0x5950('0x17')](_0x49bb78,_0x5950('0x1e'));_0x49bb78[_0x5950('0x1a')]=_0x5950('0x1f');return ami['Action'](_0x49bb78)[_0x5950('0x20')](function(_0x3c58f4){_0x2ada72({'code':0xc8,'message':_0x3c58f4[_0x5950('0x21')]});})[_0x5950('0x1d')](function(_0x4757fd){_0x1ad343(_0x119f1f[_0x5950('0x12')](0x1f5,_0x4757fd[_0x5950('0x1c')]));});});},'VoiceQueues':function(_0x4b64a2){return new Promise(function(_0x4d9317,_0x1b2265){var _0x32c197=[];for(var _0x545354 in _0x2494fc[_0x5950('0x22')]){if(_0x2494fc[_0x5950('0x22')]['hasOwnProperty'](_0x545354)){var _0x4a7b22=_0x2494fc['voiceQueues'][_0x545354];var _0x20679e={'id':_0x4a7b22['id'],'name':_0x4a7b22[_0x5950('0xa')],'strategy':_0x4a7b22[_0x5950('0x23')],'answered':_0x4a7b22[_0x5950('0x24')],'available':_0x4a7b22[_0x5950('0x25')],'loggedIn':_0x4a7b22[_0x5950('0x26')],'pTalking':_0x4a7b22[_0x5950('0x27')],'sumBillable':_0x4a7b22[_0x5950('0x28')],'sumDuration':_0x4a7b22[_0x5950('0x29')],'sumHoldTime':_0x4a7b22[_0x5950('0x2a')]||0x0,'talking':_0x4a7b22[_0x5950('0x2b')],'total':_0x4a7b22[_0x5950('0x2c')],'type':_0x4a7b22[_0x5950('0x2d')],'unmanaged':_0x4a7b22[_0x5950('0x2e')],'abandoned':_0x4a7b22[_0x5950('0x2f')],'waiting':_0x4a7b22[_0x5950('0x30')],'loggedInDb':_0x4a7b22[_0x5950('0x31')]};if(_0x4a7b22[_0x5950('0x2d')]===_0x5950('0x32')){_0x20679e[_0x5950('0x33')]=_0x4a7b22[_0x5950('0x33')];_0x20679e[_0x5950('0x34')]=_0x4a7b22[_0x5950('0x34')];_0x20679e[_0x5950('0x35')]=_0x4a7b22[_0x5950('0x35')];_0x20679e[_0x5950('0x36')]=_0x4a7b22[_0x5950('0x36')];_0x20679e[_0x5950('0x37')]=_0x4a7b22['dialOriginateTimeout'];_0x20679e[_0x5950('0x38')]=_0x4a7b22[_0x5950('0x38')];_0x20679e[_0x5950('0x39')]=_0x4a7b22[_0x5950('0x39')];_0x20679e[_0x5950('0x3a')]=_0x4a7b22['outboundAnswerAgiCallsDay'];_0x20679e['outboundAnswerCallsDay']=_0x4a7b22[_0x5950('0x3b')];_0x20679e[_0x5950('0x3c')]=_0x4a7b22['outboundBlacklistCallsDay'];_0x20679e[_0x5950('0x3d')]=_0x4a7b22['outboundBusyCallsDay'];_0x20679e[_0x5950('0x3e')]=_0x4a7b22[_0x5950('0x3e')];_0x20679e[_0x5950('0x3f')]=_0x4a7b22['outboundDropCallsDayACS'];_0x20679e[_0x5950('0x40')]=_0x4a7b22['outboundDropCallsDayCallersExit'];_0x20679e[_0x5950('0x41')]=_0x4a7b22[_0x5950('0x41')];_0x20679e[_0x5950('0x42')]=_0x4a7b22[_0x5950('0x42')];_0x20679e['outboundNoSuchCallsDay']=_0x4a7b22[_0x5950('0x43')];_0x20679e[_0x5950('0x44')]=_0x4a7b22[_0x5950('0x44')];_0x20679e['outboundReCallsDay']=_0x4a7b22[_0x5950('0x45')];_0x20679e[_0x5950('0x46')]=_0x4a7b22['outboundRejectCallsDay'];_0x20679e['outboundUnknownCallsDay']=_0x4a7b22['outboundUnknownCallsDay'];_0x20679e[_0x5950('0x47')]=_0x4a7b22[_0x5950('0x47')];_0x20679e[_0x5950('0x48')]=_0x4a7b22[_0x5950('0x48')];_0x20679e[_0x5950('0x49')]=_0x4a7b22['predictiveIntervalAvgTalktime'];_0x20679e['predictiveIntervalDroppedCallsCallersExit']=_0x4a7b22['predictiveIntervalDroppedCallsCallersExit'];_0x20679e['predictiveIntervalDroppedCallsTimeout']=_0x4a7b22[_0x5950('0x4a')];_0x20679e[_0x5950('0x4b')]=_0x4a7b22[_0x5950('0x4b')];_0x20679e[_0x5950('0x4c')]=_0x4a7b22['predictiveIntervalErlangCallsDroppedCalls'];_0x20679e[_0x5950('0x4d')]=_0x4a7b22[_0x5950('0x4d')];_0x20679e['predictiveIntervalMultiplicativeFactor']=_0x4a7b22[_0x5950('0x4e')];_0x20679e[_0x5950('0x4f')]=_0x4a7b22[_0x5950('0x4f')];_0x20679e[_0x5950('0x50')]=_0x4a7b22[_0x5950('0x50')];_0x20679e[_0x5950('0x51')]=_0x4a7b22[_0x5950('0x51')];_0x20679e['message']=_0x4a7b22[_0x5950('0x1c')];_0x20679e['originated']=_0x4a7b22[_0x5950('0x52')];_0x20679e[_0x5950('0x53')]=_0x4a7b22['erlangCalls'];_0x20679e[_0x5950('0x54')]=_0x4a7b22[_0x5950('0x54')];_0x20679e[_0x5950('0x55')]=_0x4a7b22[_0x5950('0x55')];_0x20679e['erlangBusyFactor']=_0x4a7b22[_0x5950('0x56')];_0x20679e[_0x5950('0x57')]=_0x4a7b22[_0x5950('0x57')];_0x20679e[_0x5950('0x58')]=_0x4a7b22['startProgressive'];}if(_0x4a7b22[_0x5950('0x59')]){_0x20679e[_0x5950('0x59')]={'id':_0x4a7b22[_0x5950('0x59')]['id'],'name':_0x4a7b22['Trunk'][_0x5950('0xa')],'active':_0x4a7b22['Trunk'][_0x5950('0x5a')],'callerid':_0x4a7b22[_0x5950('0x59')][_0x5950('0x5b')]};}if(_0x4a7b22[_0x5950('0x5c')]){_0x20679e[_0x5950('0x5c')]={'id':_0x4a7b22[_0x5950('0x5c')]['id'],'name':_0x4a7b22[_0x5950('0x5c')]['name']};}_0x32c197[_0x5950('0x5d')](_0x20679e);}}_0x4d9317({'count':_0x32c197[_0x5950('0x5e')],'rows':_0x32c197});});},'UpdateVoiceQueue':function(_0x3a96d1){return new Promise(function(_0x1bdcec,_0x32375){var _0x52ba16=_['find'](_0x2494fc[_0x5950('0x22')],{'id':parseInt(_0x3a96d1['id'])});var _0x44189e=_[_0x5950('0x5f')](_0x3a96d1,['id']);if(_0x52ba16){for(var _0x4e560f in _0x44189e){if(typeof _0x44189e[_0x4e560f]!==_0x5950('0x60')&&typeof _0x52ba16[_0x4e560f]!==_0x5950('0x60')){_0x52ba16[_0x4e560f]=_0x44189e[_0x4e560f];}}_0x1bdcec(_0x52ba16);}else{_0x32375();}});},'VoiceChannels':function(_0x228b26){return new Promise(function(_0x4eae97,_0x554158){var _0x49f202=_[_0x5950('0x61')](_0x2494fc[_0x5950('0x62')]);_0x4eae97({'count':_0x49f202[_0x5950('0x5e')],'rows':_0x49f202});});},'VoiceChannelMixMonitor':function(_0x396cad){var _0x2f3371=this;return new Promise(function(_0x287470,_0x441ad5){if(ami[_0x5950('0x11')]()==![]){return _0x441ad5(_0x2f3371[_0x5950('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}var _0x1cbe8d=schema(properties[_0x5950('0x63')])[_0x5950('0x2')](_0x396cad);if(_0x1cbe8d[_0x5950('0x5e')]>0x0){return _0x441ad5(_0x2f3371[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x1cbe8d,'message')[_0x5950('0x16')](',\x20')));}var _0x168829=_[_0x5950('0x65')](_0x2494fc[_0x5950('0x62')],{'uniqueid':_0x396cad['uniqueid']});if(_0x168829&&_0x168829['channel']){var _0x3b36a9=util[_0x5950('0x7')]('%s.%s',_0x396cad[_0x5950('0x66')]||_0x396cad[_0x5950('0x67')],_0x396cad[_0x5950('0x7')]||_0x5950('0x68'));return ami[_0x5950('0x69')]({'action':_0x5950('0x6a'),'channel':_0x168829['channel'],'file':_0x3b36a9,'options':_0x5950('0x6b')})[_0x5950('0x20')](function(_0x4c6906){var _0x791ee9=_[_0x5950('0x65')](_0x168829[_0x5950('0x6c')],{'filename':'/var/spool/asterisk/monitor/'+_0x3b36a9[_0x5950('0x6d')]()});if(_[_0x5950('0x6e')](_0x791ee9)){_0x168829[_0x5950('0x6c')][_0x5950('0x5d')]({'filename':_0x5950('0x6f')+_0x3b36a9[_0x5950('0x6d')](),'createdAt':moment()[_0x5950('0x7')](_0x5950('0x70')),'mixmonitorid':_0x4c6906[_0x5950('0x71')],'status':'rec'});}else{_0x791ee9[_0x5950('0x71')]=_0x4c6906[_0x5950('0x71')];_0x791ee9[_0x5950('0x72')]=_0x5950('0x73');}_0x287470({'code':0xc8,'message':[_0x396cad[_0x5950('0x67')],_0x5950('0x74'),_0x4c6906[_0x5950('0x71')]]['join']('\x20'),'mixmonitorid':_0x4c6906[_0x5950('0x71')]});})['catch'](function(_0x3e417a){_0x441ad5(_0x2f3371['error'](0x1f5,[_0x396cad[_0x5950('0x67')],_0x3e417a[_0x5950('0x1c')]['toLowerCase']()][_0x5950('0x16')]('\x20')));});}else{return _0x441ad5(_0x2f3371['error'](0x1f5,_0x5950('0x75')));}});},'VoiceChannelStopMixMonitor':function(_0x4ebd64){var _0x50a3a8=this;return new Promise(function(_0x5c743b,_0x34fc6e){if(ami[_0x5950('0x11')]()==![]){return _0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}var _0x5bb971=schema(properties['voicechannel'])[_0x5950('0x2')](_0x4ebd64);if(_0x5bb971['length']>0x0){return _0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x5bb971,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x76b97=_['find'](_0x2494fc[_0x5950('0x62')],{'uniqueid':_0x4ebd64[_0x5950('0x67')]});if(_0x76b97){return BPromise[_0x5950('0x76')]()['then'](function(){if(_0x76b97['channel']){return ami[_0x5950('0x69')]({'action':'StopMixMonitor','channel':_0x76b97[_0x5950('0x77')],'mixmonitorid':_0x4ebd64[_0x5950('0x71')]})['catch'](function(_0x459df6){});}})[_0x5950('0x20')](function(){if(_0x76b97[_0x5950('0x78')]){return ami[_0x5950('0x69')]({'action':_0x5950('0x79'),'channel':_0x76b97[_0x5950('0x78')],'mixmonitorid':_0x4ebd64['mixmonitorid']})[_0x5950('0x1d')](function(_0xd9dd45){});}})[_0x5950('0x20')](function(_0x4cddfb){var _0x5129f7=_[_0x5950('0x65')](_0x76b97[_0x5950('0x6c')],{'mixmonitorid':_0x4ebd64[_0x5950('0x71')]});if(_0x5129f7){_0x5129f7[_0x5950('0x72')]=_0x5950('0x7a');}})[_0x5950('0x20')](function(){var _0x5dc25e=util[_0x5950('0x7')](_0x5950('0x7b'),_0x4ebd64[_0x5950('0x66')]||_0x4ebd64[_0x5950('0x67')],_0x4ebd64['format']||_0x5950('0x68'));var _0x4aa2ab=_['find'](_0x76b97[_0x5950('0x6c')],{'filename':'/var/spool/asterisk/monitor/'+_0x5dc25e[_0x5950('0x6d')]()});if(_0x4aa2ab){_0x4aa2ab['status']=_0x5950('0x7a');}})[_0x5950('0x20')](function(){_0x5c743b({'code':0xc8,'message':[_0x4ebd64['uniqueid'],_0x5950('0x7c')][_0x5950('0x16')]('\x20')});})[_0x5950('0x1d')](function(_0x5738b5){_0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f5,[_0x4ebd64[_0x5950('0x67')],_0x5738b5[_0x5950('0x1c')][_0x5950('0x6d')]()][_0x5950('0x16')]('\x20')));});}else{return _0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f5,_0x5950('0x75')));}});},'VoiceQueuesChannels':function(_0x192dbc){return new Promise(function(_0x58ba24,_0x4217e9){var _0x21529d=_[_0x5950('0x61')](_0x2494fc[_0x5950('0x7d')]);_0x58ba24({'count':_0x21529d['length'],'rows':_0x21529d});});},'VoiceQueuesChannel':function(_0x29bd2e){var _0x3d2c59=this;return new Promise(function(_0xf3f0b0,_0x1539a7){var _0x5a7f13=schema(properties['voicequeuechannel'])[_0x5950('0x2')](_0x29bd2e);if(_0x5a7f13['length']>0x0){return _0x1539a7(_0x3d2c59[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x5a7f13,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x3a19e1=_['find'](_0x2494fc[_0x5950('0x7d')],{'uniqueid':_0x29bd2e[_0x5950('0x67')]});if(_0x3a19e1){_0xf3f0b0(_0x3a19e1);}else{return _0x1539a7(_0x3d2c59['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x183096){var _0xbc06ac=this;return new Promise(function(_0x3bdfb3,_0x46a2f8){if(ami[_0x5950('0x11')]()==![]){return _0x46a2f8(_0xbc06ac['error'](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}var _0x58556f=schema(properties[_0x5950('0x7e')])[_0x5950('0x2')](_0x183096);if(_0x58556f['length']>0x0){return _0x46a2f8(_0xbc06ac['error'](0x1f4,_[_0x5950('0x64')](_0x58556f,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x3ad101=_[_0x5950('0x65')](_0x2494fc['queueChannels'],{'uniqueid':_0x183096['uniqueid']});if(_0x3ad101&&_0x3ad101[_0x5950('0x77')]){return ami[_0x5950('0x69')]({'action':'Hangup','channel':_0x3ad101[_0x5950('0x77')]})[_0x5950('0x20')](function(_0x1c067d){_0x3bdfb3({'code':0xc8,'message':[_0x183096[_0x5950('0x67')],_0x1c067d[_0x5950('0x1c')]['toLowerCase']()][_0x5950('0x16')]('\x20')});})['catch'](function(_0x58c58d){_0x46a2f8(_0xbc06ac[_0x5950('0x12')](0x1f5,[_0x183096[_0x5950('0x67')],_0x58c58d[_0x5950('0x1c')]['toLowerCase']()][_0x5950('0x16')]('\x20')));});}else{return _0x46a2f8(_0xbc06ac[_0x5950('0x12')](0x1f5,_0x5950('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x595575){var _0x4fdaa7=this;return new Promise(function(_0x39df9a,_0x3406cf){if(ami[_0x5950('0x11')]()==![]){return _0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],'ami\x20disconnected'][_0x5950('0x16')]('\x20')));}var _0x5e14ca=schema(properties[_0x5950('0x7f')])[_0x5950('0x2')](_0x595575);if(_0x5e14ca[_0x5950('0x5e')]>0x0){return _0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x5e14ca,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x56282a=_['find'](_0x2494fc[_0x5950('0x7d')],{'uniqueid':_0x595575[_0x5950('0x67')]});if(_0x56282a&&_0x56282a[_0x5950('0x77')]){return ami['Action']({'action':_0x5950('0x80'),'channel':_0x56282a[_0x5950('0x77')],'exten':_0x595575['exten'],'context':_0x595575['context']||_0x56282a[_0x5950('0x81')],'priority':0x1})[_0x5950('0x20')](function(_0x4349d8){_0x39df9a({'code':0xc8,'message':[_0x595575[_0x5950('0x67')],_0x4349d8[_0x5950('0x1c')]['toLowerCase']()]['join']('\x20')});})[_0x5950('0x1d')](function(_0x5373f8){_0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f5,[_0x595575['uniqueid'],_0x5373f8['message'][_0x5950('0x6d')]()]['join']('\x20')));});}else{return _0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x178d62){return new Promise(function(_0x57d6f1,_0x450805){var _0x3e55be=_[_0x5950('0x61')](_0x2494fc[_0x5950('0xd')]);_0x57d6f1({'count':_0x3e55be['length'],'rows':_0x3e55be});});},'Telephones':function(_0x2b4f2a){return new Promise(function(_0x214a33,_0x5ea984){var _0x1f4618=_['values'](_0x2494fc[_0x5950('0x82')]);_0x214a33({'count':_0x1f4618[_0x5950('0x5e')],'rows':_0x1f4618});});},'Trunks':function(_0x564ba2){return new Promise(function(_0x42b91b,_0x5e1806){var _0x5e89c8=_['values'](_0x2494fc[_0x5950('0x83')]);_0x42b91b({'count':_0x5e89c8[_0x5950('0x5e')],'rows':_0x5e89c8});});},'OutboundChannels':function(_0x185710){return new Promise(function(_0x9e555d,_0x274c9b){var _0x468274=_['values'](_0x2494fc['outboundChannels']);_0x9e555d({'count':_0x468274[_0x5950('0x5e')],'rows':_0x468274});});},'Outbound':function(_0x510ee3){return new Promise(function(_0x42702d,_0x5f1076){_0x42702d(_0x2494fc[_0x5950('0x32')]);});},'Campaigns':function(_0x38aa1e){return new Promise(function(_0x1c8c14,_0x5a07b9){var _0x409f30=_[_0x5950('0x61')](_0x2494fc[_0x5950('0x84')]);_0x1c8c14({'count':_0x409f30['length'],'rows':_0x409f30});});},'VoiceQueuesPreview':function(_0xedcf92){var _0x5021ef=this;return new Promise(function(_0x2bc976,_0x466fe3){_0x43f5b6[_0x5950('0x85')](_0xedcf92['id'])[_0x5950('0x20')](function(_0x5cfa95){_0x2bc976({'code':0xc8,'message':_0x5cfa95['message']});})[_0x5950('0x1d')](function(_0x27f433){_0x466fe3(_0x5021ef[_0x5950('0x12')](0x1f4,_0x27f433[_0x5950('0x1c')]));});});},'EventManager':function(_0x1ac4b0){var _0x2fa930=this;return new Promise(function(_0x4fe998,_0x5e80a7){if(!_0x1ac4b0[_0x5950('0x86')]){return _0x5e80a7(_0x2fa930[_0x5950('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x5950('0x87')](_0x5950('0x88')+_0x1ac4b0[_0x5950('0x86')],_0x1ac4b0[_0x5950('0x1c')]);_0x4fe998({'code':0xc8,'message':_0x1ac4b0});});},'FaxAccounts':function(_0xc5de0d){return new Promise(function(_0x1015a0,_0x2ac5c4){var _0x15ff36=_['values'](_0x2494fc[_0x5950('0x89')]);_0x1015a0({'count':_0x15ff36[_0x5950('0x5e')],'rows':_0x15ff36});});},'SendFax':function(_0x5ec0a8){var _0x5e9af3=this;return new Promise(function(_0x24f8c4,_0x4cf0ff){_0x3ac153[_0x5950('0x8a')](_0x5ec0a8)[_0x5950('0x20')](function(_0xf628f8){_0x24f8c4({'code':0xc8,'message':_0xf628f8[_0x5950('0x1c')]});})['catch'](function(_0x1e1552){_0x4cf0ff(_0x5e9af3[_0x5950('0x12')](0x1f4,_0x1e1552['message']));});});},'CheckAfterSend':function(_0x2c78be){var _0x2f5583=this;return new Promise(function(_0x47d316,_0x55a5e4){_0x3ac153[_0x5950('0x8b')](_0x2c78be)[_0x5950('0x20')](function(_0x2ad6d1){_0x47d316({'code':0xc8,'message':_0x2ad6d1[_0x5950('0x1c')]});})['catch'](function(_0x6af976){_0x55a5e4(_0x2f5583['error'](0x1f4,_0x6af976[_0x5950('0x1c')]));});});}};var _0x4e5874=jayson[_0x5950('0x8c')](_0x4b9478)['http']();_0x4e5874['on'](_0x5950('0x12'),function(_0x396a74){return _0x4aa518(_0x396a74);});_0x4e5874[_0x5950('0x8d')](0x232a,_0x5950('0x8e'),function(){console[_0x5950('0x8f')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3a5973(_0x5950('0x90')+0x232a);});});};
\ No newline at end of file
+var _0xd8fb=['Redirect','exten','context','telephones','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','server','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','../properties','../ami','%s/%s','SIP','name','timers','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Action','then','message','catch','command','Command','content','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','length','find','omit','undefined','values','channels','map','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','status','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup'];(function(_0x378e9c,_0x2ec930){var _0x48ea69=function(_0x48e267){while(--_0x48e267){_0x378e9c['push'](_0x378e9c['shift']());}};_0x48ea69(++_0x2ec930);}(_0xd8fb,0x99));var _0xbd8f=function(_0x222a7b,_0x448f80){_0x222a7b=_0x222a7b-0x0;var _0x1a4c49=_0xd8fb[_0x222a7b];return _0x1a4c49;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var jayson=require(_0xbd8f('0x2'));var schema=require(_0xbd8f('0x3'));var BPromise=require('bluebird');var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xbd8f('0x4'));var ami=require(_0xbd8f('0x5'));exports['listen']=function(_0x400dfb,_0x2343bf,_0x5543b2){return new BPromise(function(_0x33d541,_0x4e97cf){var _0xf503c4={'QueuePause':function(_0x578499){return new Promise(function(_0x197827,_0x403edc){var _0x493298=util['format'](_0xbd8f('0x6'),_0xbd8f('0x7'),_0x578499[_0xbd8f('0x8')]);if(_0x400dfb['timers']&&_0x400dfb[_0xbd8f('0x9')][_0x493298]&&_0x400dfb[_0xbd8f('0x9')][_0x493298]['timer']){_0x400dfb['timers'][_0x493298][_0xbd8f('0xa')]();}if(_0x400dfb[_0xbd8f('0xb')][_0x493298]){_0x400dfb[_0xbd8f('0xb')][_0x493298]['updateStatusRealtime']({'statePause':_0x578499[_0xbd8f('0xc')]?!![]:![]});}_0x197827({'code':0xc8,'message':_0xbd8f('0xd')});});},'Reload':function(_0x39be16){var _0x43ca5d=this;return new Promise(function(_0x8bc054,_0x383ea5){if(ami[_0xbd8f('0xe')]()==![]){return _0x383ea5(_0x43ca5d[_0xbd8f('0xf')](0x1f4,[config[_0xbd8f('0x10')]['ip'],config['asterisk'][_0xbd8f('0x11')],_0xbd8f('0x12')][_0xbd8f('0x13')]('\x20')));}_0x39be16=_[_0xbd8f('0x14')](_0x39be16,_['keys'](properties[_0xbd8f('0x15')]));_0x39be16[_0xbd8f('0x16')]='Reload';return ami[_0xbd8f('0x17')](_0x39be16)[_0xbd8f('0x18')](function(_0x504adb){_0x8bc054({'code':0xc8,'message':_0x504adb[_0xbd8f('0x19')]});})[_0xbd8f('0x1a')](function(_0x47d317){_0x383ea5(_0x43ca5d['error'](0x1f5,_0x47d317[_0xbd8f('0x19')]));});});},'Command':function(_0x5d2fdb){var _0x5705c5=this;return new Promise(function(_0x159c7b,_0x4b5fac){if(ami[_0xbd8f('0xe')]()==![]){return _0x4b5fac(_0x5705c5[_0xbd8f('0xf')](0x1f4,[config[_0xbd8f('0x10')]['ip'],config[_0xbd8f('0x10')][_0xbd8f('0x11')],_0xbd8f('0x12')][_0xbd8f('0x13')]('\x20')));}_0x5d2fdb=_[_0xbd8f('0x14')](_0x5d2fdb,_0xbd8f('0x1b'));_0x5d2fdb[_0xbd8f('0x16')]=_0xbd8f('0x1c');return ami[_0xbd8f('0x17')](_0x5d2fdb)[_0xbd8f('0x18')](function(_0x15c4a9){_0x159c7b({'code':0xc8,'message':_0x15c4a9[_0xbd8f('0x1d')]});})[_0xbd8f('0x1a')](function(_0x395b1b){_0x4b5fac(_0x5705c5['error'](0x1f5,_0x395b1b[_0xbd8f('0x19')]));});});},'VoiceQueues':function(_0x9fa3b1){return new Promise(function(_0x1f9fcc,_0x2f3df7){var _0xa88414=[];for(var _0x2257fd in _0x400dfb[_0xbd8f('0x1e')]){if(_0x400dfb[_0xbd8f('0x1e')]['hasOwnProperty'](_0x2257fd)){var _0x40cb43=_0x400dfb[_0xbd8f('0x1e')][_0x2257fd];var _0x5a3a8c={'id':_0x40cb43['id'],'name':_0x40cb43[_0xbd8f('0x8')],'strategy':_0x40cb43['strategy'],'answered':_0x40cb43[_0xbd8f('0x1f')],'available':_0x40cb43[_0xbd8f('0x20')],'loggedIn':_0x40cb43[_0xbd8f('0x21')],'pTalking':_0x40cb43[_0xbd8f('0x22')],'sumBillable':_0x40cb43[_0xbd8f('0x23')],'sumDuration':_0x40cb43[_0xbd8f('0x24')],'sumHoldTime':_0x40cb43['sumHoldTime']||0x0,'talking':_0x40cb43[_0xbd8f('0x25')],'total':_0x40cb43[_0xbd8f('0x26')],'type':_0x40cb43[_0xbd8f('0x27')],'unmanaged':_0x40cb43[_0xbd8f('0x28')],'abandoned':_0x40cb43[_0xbd8f('0x29')],'waiting':_0x40cb43[_0xbd8f('0x2a')],'loggedInDb':_0x40cb43[_0xbd8f('0x2b')]};if(_0x40cb43['type']===_0xbd8f('0x2c')){_0x5a3a8c[_0xbd8f('0x2d')]=_0x40cb43[_0xbd8f('0x2d')];_0x5a3a8c[_0xbd8f('0x2e')]=_0x40cb43['dialMethod'];_0x5a3a8c['dialOriginateCallerIdName']=_0x40cb43[_0xbd8f('0x2f')];_0x5a3a8c[_0xbd8f('0x30')]=_0x40cb43[_0xbd8f('0x30')];_0x5a3a8c[_0xbd8f('0x31')]=_0x40cb43['dialOriginateTimeout'];_0x5a3a8c[_0xbd8f('0x32')]=_0x40cb43[_0xbd8f('0x32')];_0x5a3a8c[_0xbd8f('0x33')]=_0x40cb43[_0xbd8f('0x33')];_0x5a3a8c[_0xbd8f('0x34')]=_0x40cb43['outboundAnswerAgiCallsDay'];_0x5a3a8c[_0xbd8f('0x35')]=_0x40cb43[_0xbd8f('0x35')];_0x5a3a8c[_0xbd8f('0x36')]=_0x40cb43[_0xbd8f('0x36')];_0x5a3a8c[_0xbd8f('0x37')]=_0x40cb43['outboundBusyCallsDay'];_0x5a3a8c[_0xbd8f('0x38')]=_0x40cb43['outboundCongestionCallsDay'];_0x5a3a8c[_0xbd8f('0x39')]=_0x40cb43[_0xbd8f('0x39')];_0x5a3a8c[_0xbd8f('0x3a')]=_0x40cb43[_0xbd8f('0x3a')];_0x5a3a8c[_0xbd8f('0x3b')]=_0x40cb43[_0xbd8f('0x3b')];_0x5a3a8c['outboundNoAnswerCallsDay']=_0x40cb43['outboundNoAnswerCallsDay'];_0x5a3a8c['outboundNoSuchCallsDay']=_0x40cb43[_0xbd8f('0x3c')];_0x5a3a8c[_0xbd8f('0x3d')]=_0x40cb43[_0xbd8f('0x3d')];_0x5a3a8c[_0xbd8f('0x3e')]=_0x40cb43[_0xbd8f('0x3e')];_0x5a3a8c[_0xbd8f('0x3f')]=_0x40cb43[_0xbd8f('0x3f')];_0x5a3a8c[_0xbd8f('0x40')]=_0x40cb43[_0xbd8f('0x40')];_0x5a3a8c[_0xbd8f('0x41')]=_0x40cb43[_0xbd8f('0x41')];_0x5a3a8c[_0xbd8f('0x42')]=_0x40cb43[_0xbd8f('0x42')];_0x5a3a8c[_0xbd8f('0x43')]=_0x40cb43[_0xbd8f('0x43')];_0x5a3a8c['predictiveIntervalDroppedCallsCallersExit']=_0x40cb43[_0xbd8f('0x44')];_0x5a3a8c[_0xbd8f('0x45')]=_0x40cb43['predictiveIntervalDroppedCallsTimeout'];_0x5a3a8c[_0xbd8f('0x46')]=_0x40cb43[_0xbd8f('0x46')];_0x5a3a8c[_0xbd8f('0x47')]=_0x40cb43['predictiveIntervalErlangCallsDroppedCalls'];_0x5a3a8c[_0xbd8f('0x48')]=_0x40cb43['predictiveIntervalHitRate'];_0x5a3a8c[_0xbd8f('0x49')]=_0x40cb43[_0xbd8f('0x49')];_0x5a3a8c[_0xbd8f('0x4a')]=_0x40cb43['predictiveIntervalPauses'];_0x5a3a8c[_0xbd8f('0x4b')]=_0x40cb43[_0xbd8f('0x4b')];_0x5a3a8c[_0xbd8f('0x4c')]=_0x40cb43['predictiveIntervalTotalCalls'];_0x5a3a8c[_0xbd8f('0x19')]=_0x40cb43[_0xbd8f('0x19')];_0x5a3a8c[_0xbd8f('0x4d')]=_0x40cb43[_0xbd8f('0x4d')];_0x5a3a8c[_0xbd8f('0x4e')]=_0x40cb43[_0xbd8f('0x4e')];_0x5a3a8c[_0xbd8f('0x4f')]=_0x40cb43[_0xbd8f('0x4f')];_0x5a3a8c[_0xbd8f('0x50')]=_0x40cb43['erlangAbandonmentRate'];_0x5a3a8c['erlangBusyFactor']=_0x40cb43[_0xbd8f('0x51')];_0x5a3a8c[_0xbd8f('0x52')]=_0x40cb43[_0xbd8f('0x52')];_0x5a3a8c[_0xbd8f('0x53')]=_0x40cb43['startProgressive'];}if(_0x40cb43[_0xbd8f('0x54')]){_0x5a3a8c[_0xbd8f('0x54')]={'id':_0x40cb43[_0xbd8f('0x54')]['id'],'name':_0x40cb43[_0xbd8f('0x54')][_0xbd8f('0x8')],'active':_0x40cb43['Trunk']['active'],'callerid':_0x40cb43[_0xbd8f('0x54')]['callerid']};}if(_0x40cb43[_0xbd8f('0x55')]){_0x5a3a8c[_0xbd8f('0x55')]={'id':_0x40cb43[_0xbd8f('0x55')]['id'],'name':_0x40cb43[_0xbd8f('0x55')][_0xbd8f('0x8')]};}_0xa88414[_0xbd8f('0x56')](_0x5a3a8c);}}_0x1f9fcc({'count':_0xa88414[_0xbd8f('0x57')],'rows':_0xa88414});});},'UpdateVoiceQueue':function(_0xe3c0f8){return new Promise(function(_0x55ee57,_0x36c43f){var _0x2fbbbe=_[_0xbd8f('0x58')](_0x400dfb[_0xbd8f('0x1e')],{'id':parseInt(_0xe3c0f8['id'])});var _0x229bc0=_[_0xbd8f('0x59')](_0xe3c0f8,['id']);if(_0x2fbbbe){for(var _0x272f70 in _0x229bc0){if(typeof _0x229bc0[_0x272f70]!==_0xbd8f('0x5a')&&typeof _0x2fbbbe[_0x272f70]!=='undefined'){_0x2fbbbe[_0x272f70]=_0x229bc0[_0x272f70];}}_0x55ee57(_0x2fbbbe);}else{_0x36c43f();}});},'VoiceChannels':function(_0x3d7a3d){return new Promise(function(_0x18cb6d,_0x297e98){var _0x1f12dd=_[_0xbd8f('0x5b')](_0x400dfb[_0xbd8f('0x5c')]);_0x18cb6d({'count':_0x1f12dd[_0xbd8f('0x57')],'rows':_0x1f12dd});});},'VoiceChannelMixMonitor':function(_0x439bbd){var _0x1f1569=this;return new Promise(function(_0x46e33c,_0x406741){if(ami[_0xbd8f('0xe')]()==![]){return _0x406741(_0x1f1569[_0xbd8f('0xf')](0x1f4,[config[_0xbd8f('0x10')]['ip'],config[_0xbd8f('0x10')][_0xbd8f('0x11')],_0xbd8f('0x12')][_0xbd8f('0x13')]('\x20')));}var _0x2668a4=schema(properties['voicechannel'])[_0xbd8f('0x3')](_0x439bbd);if(_0x2668a4[_0xbd8f('0x57')]>0x0){return _0x406741(_0x1f1569[_0xbd8f('0xf')](0x1f4,_[_0xbd8f('0x5d')](_0x2668a4,'message')[_0xbd8f('0x13')](',\x20')));}var _0x5a33c5=_[_0xbd8f('0x58')](_0x400dfb[_0xbd8f('0x5c')],{'uniqueid':_0x439bbd[_0xbd8f('0x5e')]});if(_0x5a33c5&&_0x5a33c5[_0xbd8f('0x5f')]){var _0x5434e8=util[_0xbd8f('0x60')](_0xbd8f('0x61'),_0x439bbd[_0xbd8f('0x62')]||_0x439bbd[_0xbd8f('0x5e')],_0x439bbd[_0xbd8f('0x60')]||_0xbd8f('0x63'));return ami['Action']({'action':_0xbd8f('0x64'),'channel':_0x5a33c5['channel'],'file':_0x5434e8,'options':_0xbd8f('0x65')})[_0xbd8f('0x18')](function(_0x405764){var _0x454815=_[_0xbd8f('0x58')](_0x5a33c5[_0xbd8f('0x66')],{'filename':_0xbd8f('0x67')+_0x5434e8[_0xbd8f('0x68')]()});if(_[_0xbd8f('0x69')](_0x454815)){_0x5a33c5['monitors'][_0xbd8f('0x56')]({'filename':'/var/spool/asterisk/monitor/'+_0x5434e8[_0xbd8f('0x68')](),'createdAt':moment()[_0xbd8f('0x60')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x405764[_0xbd8f('0x6a')],'status':'rec'});}else{_0x454815['mixmonitorid']=_0x405764['mixmonitorid'];_0x454815['status']=_0xbd8f('0x6b');}_0x46e33c({'code':0xc8,'message':[_0x439bbd[_0xbd8f('0x5e')],_0xbd8f('0x6c'),_0x405764[_0xbd8f('0x6a')]][_0xbd8f('0x13')]('\x20'),'mixmonitorid':_0x405764['mixmonitorid']});})['catch'](function(_0x2e78ee){_0x406741(_0x1f1569[_0xbd8f('0xf')](0x1f5,[_0x439bbd[_0xbd8f('0x5e')],_0x2e78ee[_0xbd8f('0x19')][_0xbd8f('0x68')]()]['join']('\x20')));});}else{return _0x406741(_0x1f1569[_0xbd8f('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x9cf2d5){var _0x40c834=this;return new Promise(function(_0x25d783,_0x4c63c7){if(ami[_0xbd8f('0xe')]()==![]){return _0x4c63c7(_0x40c834[_0xbd8f('0xf')](0x1f4,[config[_0xbd8f('0x10')]['ip'],config[_0xbd8f('0x10')]['username'],'ami\x20disconnected'][_0xbd8f('0x13')]('\x20')));}var _0x5242d1=schema(properties[_0xbd8f('0x6d')])[_0xbd8f('0x3')](_0x9cf2d5);if(_0x5242d1[_0xbd8f('0x57')]>0x0){return _0x4c63c7(_0x40c834[_0xbd8f('0xf')](0x1f4,_['map'](_0x5242d1,'message')[_0xbd8f('0x13')](',\x20')));}var _0x2e4363=_[_0xbd8f('0x58')](_0x400dfb[_0xbd8f('0x5c')],{'uniqueid':_0x9cf2d5[_0xbd8f('0x5e')]});if(_0x2e4363){return BPromise[_0xbd8f('0x6e')]()[_0xbd8f('0x18')](function(){if(_0x2e4363[_0xbd8f('0x5f')]){return ami[_0xbd8f('0x17')]({'action':_0xbd8f('0x6f'),'channel':_0x2e4363[_0xbd8f('0x5f')],'mixmonitorid':_0x9cf2d5['mixmonitorid']})[_0xbd8f('0x1a')](function(_0x3194af){});}})[_0xbd8f('0x18')](function(){if(_0x2e4363[_0xbd8f('0x70')]){return ami[_0xbd8f('0x17')]({'action':_0xbd8f('0x6f'),'channel':_0x2e4363['destinationchannel'],'mixmonitorid':_0x9cf2d5[_0xbd8f('0x6a')]})[_0xbd8f('0x1a')](function(_0x538fd7){});}})['then'](function(_0x44a891){var _0x6db322=_[_0xbd8f('0x58')](_0x2e4363['monitors'],{'mixmonitorid':_0x9cf2d5['mixmonitorid']});if(_0x6db322){_0x6db322[_0xbd8f('0x71')]='stop';}})['then'](function(){var _0x5b5bd8=util['format']('%s.%s',_0x9cf2d5[_0xbd8f('0x62')]||_0x9cf2d5['uniqueid'],_0x9cf2d5[_0xbd8f('0x60')]||_0xbd8f('0x63'));var _0x53f297=_[_0xbd8f('0x58')](_0x2e4363[_0xbd8f('0x66')],{'filename':_0xbd8f('0x67')+_0x5b5bd8[_0xbd8f('0x68')]()});if(_0x53f297){_0x53f297[_0xbd8f('0x71')]='stop';}})['then'](function(){_0x25d783({'code':0xc8,'message':[_0x9cf2d5[_0xbd8f('0x5e')],_0xbd8f('0x72')][_0xbd8f('0x13')]('\x20')});})[_0xbd8f('0x1a')](function(_0x1ef686){_0x4c63c7(_0x40c834[_0xbd8f('0xf')](0x1f5,[_0x9cf2d5['uniqueid'],_0x1ef686['message'][_0xbd8f('0x68')]()][_0xbd8f('0x13')]('\x20')));});}else{return _0x4c63c7(_0x40c834['error'](0x1f5,_0xbd8f('0x73')));}});},'VoiceQueuesChannels':function(_0x372386){return new Promise(function(_0x4c225d,_0xf87f80){var _0xa5958d=_[_0xbd8f('0x5b')](_0x400dfb['queueChannels']);_0x4c225d({'count':_0xa5958d['length'],'rows':_0xa5958d});});},'VoiceQueuesChannel':function(_0x2407e7){var _0x222cae=this;return new Promise(function(_0x13e321,_0x3df810){var _0x41be86=schema(properties['voicequeuechannel'])[_0xbd8f('0x3')](_0x2407e7);if(_0x41be86[_0xbd8f('0x57')]>0x0){return _0x3df810(_0x222cae[_0xbd8f('0xf')](0x1f4,_[_0xbd8f('0x5d')](_0x41be86,_0xbd8f('0x19'))[_0xbd8f('0x13')](',\x20')));}var _0x2a7eaa=_[_0xbd8f('0x58')](_0x400dfb[_0xbd8f('0x74')],{'uniqueid':_0x2407e7[_0xbd8f('0x5e')]});if(_0x2a7eaa){_0x13e321(_0x2a7eaa);}else{return _0x3df810(_0x222cae[_0xbd8f('0xf')](0x1f5,_0xbd8f('0x73')));}});},'VoiceQueuesChannelHangup':function(_0x34eec5){var _0x40fc53=this;return new Promise(function(_0x3fdecd,_0x4557a9){if(ami[_0xbd8f('0xe')]()==![]){return _0x4557a9(_0x40fc53[_0xbd8f('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xbd8f('0x10')][_0xbd8f('0x11')],_0xbd8f('0x12')][_0xbd8f('0x13')]('\x20')));}var _0x14d86f=schema(properties[_0xbd8f('0x75')])['validate'](_0x34eec5);if(_0x14d86f['length']>0x0){return _0x4557a9(_0x40fc53[_0xbd8f('0xf')](0x1f4,_[_0xbd8f('0x5d')](_0x14d86f,'message')[_0xbd8f('0x13')](',\x20')));}var _0x4c2a24=_[_0xbd8f('0x58')](_0x400dfb[_0xbd8f('0x74')],{'uniqueid':_0x34eec5[_0xbd8f('0x5e')]});if(_0x4c2a24&&_0x4c2a24[_0xbd8f('0x5f')]){return ami['Action']({'action':_0xbd8f('0x76'),'channel':_0x4c2a24[_0xbd8f('0x5f')]})[_0xbd8f('0x18')](function(_0x56f497){_0x3fdecd({'code':0xc8,'message':[_0x34eec5[_0xbd8f('0x5e')],_0x56f497[_0xbd8f('0x19')][_0xbd8f('0x68')]()][_0xbd8f('0x13')]('\x20')});})['catch'](function(_0x24e3fc){_0x4557a9(_0x40fc53[_0xbd8f('0xf')](0x1f5,[_0x34eec5[_0xbd8f('0x5e')],_0x24e3fc[_0xbd8f('0x19')][_0xbd8f('0x68')]()][_0xbd8f('0x13')]('\x20')));});}else{return _0x4557a9(_0x40fc53[_0xbd8f('0xf')](0x1f5,_0xbd8f('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x52a616){var _0xf8efe6=this;return new Promise(function(_0x5a5f8a,_0x3da31b){if(ami['isConnected']()==![]){return _0x3da31b(_0xf8efe6[_0xbd8f('0xf')](0x1f4,[config[_0xbd8f('0x10')]['ip'],config['asterisk'][_0xbd8f('0x11')],_0xbd8f('0x12')][_0xbd8f('0x13')]('\x20')));}var _0x2ab853=schema(properties['voicequeuechannelredirect'])[_0xbd8f('0x3')](_0x52a616);if(_0x2ab853[_0xbd8f('0x57')]>0x0){return _0x3da31b(_0xf8efe6[_0xbd8f('0xf')](0x1f4,_[_0xbd8f('0x5d')](_0x2ab853,'message')['join'](',\x20')));}var _0x2fb942=_[_0xbd8f('0x58')](_0x400dfb[_0xbd8f('0x74')],{'uniqueid':_0x52a616[_0xbd8f('0x5e')]});if(_0x2fb942&&_0x2fb942[_0xbd8f('0x5f')]){return ami['Action']({'action':_0xbd8f('0x77'),'channel':_0x2fb942[_0xbd8f('0x5f')],'exten':_0x52a616[_0xbd8f('0x78')],'context':_0x52a616[_0xbd8f('0x79')]||_0x2fb942[_0xbd8f('0x79')],'priority':0x1})['then'](function(_0x4d0ff4){_0x5a5f8a({'code':0xc8,'message':[_0x52a616['uniqueid'],_0x4d0ff4[_0xbd8f('0x19')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x63c20c){_0x3da31b(_0xf8efe6[_0xbd8f('0xf')](0x1f5,[_0x52a616[_0xbd8f('0x5e')],_0x63c20c[_0xbd8f('0x19')][_0xbd8f('0x68')]()][_0xbd8f('0x13')]('\x20')));});}else{return _0x3da31b(_0xf8efe6[_0xbd8f('0xf')](0x1f5,_0xbd8f('0x73')));}});},'Agents':function(_0x4c413e){return new Promise(function(_0x78652f,_0x1855d9){var _0x3caa98=_['values'](_0x400dfb[_0xbd8f('0xb')]);_0x78652f({'count':_0x3caa98[_0xbd8f('0x57')],'rows':_0x3caa98});});},'Telephones':function(_0x10bcec){return new Promise(function(_0x40ee44,_0x182e54){var _0x44ee0d=_[_0xbd8f('0x5b')](_0x400dfb[_0xbd8f('0x7a')]);_0x40ee44({'count':_0x44ee0d[_0xbd8f('0x57')],'rows':_0x44ee0d});});},'Trunks':function(_0x9e2f8a){return new Promise(function(_0x581846,_0xc8332c){var _0x429bb6=_[_0xbd8f('0x5b')](_0x400dfb['trunks']);_0x581846({'count':_0x429bb6[_0xbd8f('0x57')],'rows':_0x429bb6});});},'OutboundChannels':function(_0x4acee1){return new Promise(function(_0x224ea4,_0x115c2a){var _0x2a67df=_[_0xbd8f('0x5b')](_0x400dfb[_0xbd8f('0x7b')]);_0x224ea4({'count':_0x2a67df['length'],'rows':_0x2a67df});});},'Outbound':function(_0xe58b64){return new Promise(function(_0x198d4b,_0x60c94c){_0x198d4b(_0x400dfb[_0xbd8f('0x2c')]);});},'Campaigns':function(_0x4588d3){return new Promise(function(_0x43e7e0,_0x56a744){var _0x672cfb=_[_0xbd8f('0x5b')](_0x400dfb['campaigns']);_0x43e7e0({'count':_0x672cfb['length'],'rows':_0x672cfb});});},'VoiceQueuesPreview':function(_0x22f91f){var _0x5b0716=this;return new Promise(function(_0x4a9361,_0x4bb608){_0x2343bf[_0xbd8f('0x7c')](_0x22f91f['id'])[_0xbd8f('0x18')](function(_0x261c69){_0x4a9361({'code':0xc8,'message':_0x261c69[_0xbd8f('0x19')]});})['catch'](function(_0x1617d2){_0x4bb608(_0x5b0716[_0xbd8f('0xf')](0x1f4,_0x1617d2['message']));});});},'EventManager':function(_0x4f593c){var _0x13bc2c=this;return new Promise(function(_0x49d446,_0x2a7351){if(!_0x4f593c['event']){return _0x2a7351(_0x13bc2c['error'](0x1f4,_0xbd8f('0x7d')));}ami[_0xbd8f('0x7e')](_0xbd8f('0x7f')+_0x4f593c[_0xbd8f('0x80')],_0x4f593c[_0xbd8f('0x19')]);_0x49d446({'code':0xc8,'message':_0x4f593c});});},'FaxAccounts':function(_0x54fc4d){return new Promise(function(_0x195424,_0x3ca2bb){var _0x3a6ec4=_['values'](_0x400dfb[_0xbd8f('0x81')]);_0x195424({'count':_0x3a6ec4[_0xbd8f('0x57')],'rows':_0x3a6ec4});});},'SendFax':function(_0x38d1a6){var _0x31b92c=this;return new Promise(function(_0x11fb11,_0xc7a57c){_0x5543b2[_0xbd8f('0x82')](_0x38d1a6)[_0xbd8f('0x18')](function(_0x2d79c3){_0x11fb11({'code':0xc8,'message':_0x2d79c3[_0xbd8f('0x19')]});})['catch'](function(_0x58dbee){_0xc7a57c(_0x31b92c['error'](0x1f4,_0x58dbee['message']));});});},'CheckAfterSend':function(_0x3cceb6){var _0x3ff503=this;return new Promise(function(_0x513978,_0x5b8151){_0x5543b2['checkAfterSend'](_0x3cceb6)['then'](function(_0x25afe1){_0x513978({'code':0xc8,'message':_0x25afe1[_0xbd8f('0x19')]});})[_0xbd8f('0x1a')](function(_0x5da5fa){_0x5b8151(_0x3ff503[_0xbd8f('0xf')](0x1f4,_0x5da5fa[_0xbd8f('0x19')]));});});}};var _0x24e8f4=jayson[_0xbd8f('0x83')](_0xf503c4)['http']();_0x24e8f4['on'](_0xbd8f('0xf'),function(_0x14ddb5){return _0x4e97cf(_0x14ddb5);});_0x24e8f4[_0xbd8f('0x84')](0x232a,'127.0.0.1',function(){console[_0xbd8f('0x85')](_0xbd8f('0x86'),0x232a);return _0x33d541(_0xbd8f('0x87')+0x232a);});});};
\ No newline at end of file
index 268e7c5..84ae951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e85=['data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','<unknown>','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x0e85,0x7c));var _0x50e8=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x0e85[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x50e8('0x0'));var BPromise=require(_0x50e8('0x1'));var Redis=require('ioredis');var util=require(_0x50e8('0x2'));var config=require(_0x50e8('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x50e8('0x4')]=_['defaults'](config[_0x50e8('0x4')],{'host':_0x50e8('0x5'),'port':0x18eb});var io=require(_0x50e8('0x6'))(new Redis(config[_0x50e8('0x4')]));function emit(_0x5e8b01,_0x3ce904,_0x108edc,_0x42665e,_0x988da0){logger[_0x50e8('0x7')](_0x50e8('0x8'),_0x5e8b01,_0x3ce904['id'],_0x108edc,_0x42665e,JSON['stringify'](_0x988da0));io['to'](_0x108edc)[_0x50e8('0x9')](_0x42665e,_0x988da0);}exports[_0x50e8('0xa')]=function(_0x19d1bc,_0x2d4750,_0x154b9e,_0x194a89){var _0x45dc6f,_0x3d25ea;var _0x55ba0a={};var _0x56707f=Number(_0x154b9e[_0x50e8('0xb')]);var _0x24d381=_0x154b9e['data2']?Boolean(Number(_0x154b9e['data2'])):![];var _0x3cb45c;var _0x2abda1=![];if(!_[_0x50e8('0xc')](_0x154b9e[_0x50e8('0xd')])){if(_0x154b9e['data5']=='1')_0x2abda1=!![];}if(!_0x2abda1){if(_0x194a89[_0x50e8('0xe')]){_0x55ba0a['id']=_0x194a89[_0x50e8('0xe')];}}if(!_0x55ba0a['id']){_0x55ba0a[_0x50e8('0xf')]=_0x56707f;_0x3cb45c=_0x154b9e['data3']&&_0x154b9e['data3']!=='0'?_0x154b9e[_0x50e8('0x10')][_0x50e8('0x11')](','):[_0x50e8('0x12')];_0x55ba0a[_0x50e8('0x13')]=_[_0x50e8('0x14')](_0x3cb45c,function(_0x1f0338){var _0x5642bf={};_0x5642bf[_0x1f0338]=_0x194a89['routeId']?_0x194a89[_0x50e8('0x15')]:_0x194a89[_0x50e8('0x16')];return _0x5642bf;});}var _0x40d060=['id',_0x50e8('0x17'),_0x50e8('0x18'),_0x50e8('0x12'),_0x50e8('0x19'),'fax',_0x50e8('0xf'),'createdAt',_0x50e8('0x1a'),_0x50e8('0x1b')];var _0xd263d=_[_0x50e8('0x1c')](_0x40d060,_0x3cb45c);BPromise[_0x50e8('0x1d')]()['then'](cmContactRpc[_0x50e8('0x1e')]({'attributes':_0xd263d,'where':_0x55ba0a}))[_0x50e8('0x1f')](function(_0x58110d){_0x3d25ea=_0x58110d;if(!_[_0x50e8('0x20')](_0x3d25ea)){if(_0x3d25ea[_0x50e8('0x21')]===0x1){_0x45dc6f=_0x3d25ea[0x0];logger['info'](_0x50e8('0x22'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id'],_0x45dc6f['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x194a89['uniqueid'],_0x2d4750['id'],_[_0x50e8('0x14')](_0x3d25ea,'id')[_0x50e8('0x24')](','));}return;}else{logger[_0x50e8('0x7')](_0x50e8('0x25'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);var _0x13b6e9={'ListId':_0x56707f};var _0x53d848=_0x154b9e[_0x50e8('0x26')]&&_0x154b9e[_0x50e8('0x26')]!=='0'?_0x154b9e['data4']:_0x50e8('0x12');if(_0x24d381){logger[_0x50e8('0x7')](_0x50e8('0x27'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);_0x13b6e9[_0x53d848]=_['isNil'](_0x194a89[_0x50e8('0x28')])?_0x194a89['calleridnum']:_0x194a89[_0x50e8('0x15')];if(_[_0x50e8('0xc')](_0x194a89[_0x50e8('0x28')])){_0x13b6e9['firstName']=_0x194a89[_0x50e8('0x29')]&&_0x194a89[_0x50e8('0x29')]!==_0x50e8('0x2a')?_0x194a89[_0x50e8('0x29')]:_0x50e8('0x2b');}else{_0x13b6e9[_0x50e8('0x17')]=_0x194a89[_0x50e8('0x2c')]&&_0x194a89['destcalleridname']!==_0x50e8('0x2a')?_0x194a89[_0x50e8('0x2c')]:'Unknown';}return BPromise['resolve']()[_0x50e8('0x1f')](cmContactRpc[_0x50e8('0x2d')](_0x13b6e9))[_0x50e8('0x1f')](function(_0x47ace2){_0x45dc6f=_0x47ace2;_0x3d25ea['push'](_0x47ace2);if(_0x45dc6f){logger[_0x50e8('0x7')](_0x50e8('0x2e'),_0x194a89['uniqueid'],_0x2d4750['id'],_0x45dc6f['id']);}return;});}else{logger[_0x50e8('0x7')](_0x50e8('0x2f'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);_0x13b6e9[_0x53d848]=_[_0x50e8('0xc')](_0x194a89['routeId'])?_0x194a89[_0x50e8('0x16')]:_0x194a89['destcalleridnum'];if(_[_0x50e8('0xc')](_0x194a89[_0x50e8('0x28')])){_0x13b6e9[_0x50e8('0x17')]=_0x194a89['calleridname']&&_0x194a89[_0x50e8('0x29')]!==_0x50e8('0x2a')?_0x194a89['calleridname']:_0x50e8('0x2b');}else{_0x13b6e9[_0x50e8('0x17')]=_0x194a89[_0x50e8('0x2c')]&&_0x194a89[_0x50e8('0x2c')]!=='<unknown>'?_0x194a89[_0x50e8('0x2c')]:_0x50e8('0x2b');}_0x45dc6f=_0x13b6e9;_0x3d25ea[_0x50e8('0x30')](_0x13b6e9);return;}}})[_0x50e8('0x1f')](function(){if(_0x19d1bc){emit(_0x194a89['uniqueid'],_0x2d4750,util[_0x50e8('0x31')](_0x50e8('0x32'),_0x19d1bc[_0x50e8('0x33')]),util['format']('trigger:%s',_0x154b9e['action'][_0x50e8('0x34')]()),{'evt':_[_0x50e8('0x35')](_0x194a89,{'autoCreate':_0x24d381}),'contact':_0x45dc6f===undefined?{}:_0x45dc6f,'contacts':_0x3d25ea[_0x50e8('0x21')]===0x0?undefined:_0x3d25ea});}});};
\ No newline at end of file
+var _0x4bc3=['[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','Unknown','destcalleridname','<unknown>','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','merge','length','lodash','bluebird','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','fax','ListId','scheduledAt','updatedAt','union','resolve','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x4bc3[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x34bc('0x0'));var BPromise=require(_0x34bc('0x1'));var Redis=require('ioredis');var util=require(_0x34bc('0x2'));var config=require(_0x34bc('0x3'));var logger=require('../../../../config/logger')(_0x34bc('0x4'));var cmContactRpc=require(_0x34bc('0x5'));config[_0x34bc('0x6')]=_[_0x34bc('0x7')](config[_0x34bc('0x6')],{'host':_0x34bc('0x8'),'port':0x18eb});var io=require(_0x34bc('0x9'))(new Redis(config['redis']));function emit(_0x21451b,_0x50320d,_0x502087,_0x18a01c,_0x474108){logger[_0x34bc('0xa')](_0x34bc('0xb'),_0x21451b,_0x50320d['id'],_0x502087,_0x18a01c,JSON[_0x34bc('0xc')](_0x474108));io['to'](_0x502087)[_0x34bc('0xd')](_0x18a01c,_0x474108);}exports['exec']=function(_0x5a478d,_0x2b8112,_0x33025c,_0x2a35f3){var _0x5a608a,_0x41960e;var _0x5ab229={};var _0x1ecedf=Number(_0x33025c[_0x34bc('0xe')]);var _0x164fb2=_0x33025c['data2']?Boolean(Number(_0x33025c[_0x34bc('0xf')])):![];var _0x553a7d;var _0x12cf72=![];if(!_[_0x34bc('0x10')](_0x33025c[_0x34bc('0x11')])){if(_0x33025c['data5']=='1')_0x12cf72=!![];}if(!_0x12cf72){if(_0x2a35f3['xmd-contactid']){_0x5ab229['id']=_0x2a35f3[_0x34bc('0x12')];}}if(!_0x5ab229['id']){_0x5ab229['ListId']=_0x1ecedf;_0x553a7d=_0x33025c[_0x34bc('0x13')]&&_0x33025c[_0x34bc('0x13')]!=='0'?_0x33025c[_0x34bc('0x13')][_0x34bc('0x14')](','):[_0x34bc('0x15')];_0x5ab229[_0x34bc('0x16')]=_['map'](_0x553a7d,function(_0x4fa0ab){var _0x5a5895={};_0x5a5895[_0x4fa0ab]=_0x2a35f3[_0x34bc('0x17')]?_0x2a35f3[_0x34bc('0x18')]:_0x2a35f3[_0x34bc('0x19')];return _0x5a5895;});}var _0x239e6c=['id','firstName',_0x34bc('0x1a'),_0x34bc('0x15'),'mobile',_0x34bc('0x1b'),_0x34bc('0x1c'),'createdAt',_0x34bc('0x1d'),_0x34bc('0x1e')];var _0x2d18ea=_[_0x34bc('0x1f')](_0x239e6c,_0x553a7d);BPromise[_0x34bc('0x20')]()[_0x34bc('0x21')](cmContactRpc['getContacts']({'attributes':_0x2d18ea,'where':_0x5ab229}))[_0x34bc('0x21')](function(_0x3c9939){_0x41960e=_0x3c9939;if(!_[_0x34bc('0x22')](_0x41960e)){if(_0x41960e['length']===0x1){_0x5a608a=_0x41960e[0x0];logger['info'](_0x34bc('0x23'),_0x2a35f3[_0x34bc('0x24')],_0x2b8112['id'],_0x5a608a['id']);}else{logger[_0x34bc('0xa')](_0x34bc('0x25'),_0x2a35f3[_0x34bc('0x24')],_0x2b8112['id'],_[_0x34bc('0x26')](_0x41960e,'id')[_0x34bc('0x27')](','));}return;}else{logger[_0x34bc('0xa')](_0x34bc('0x28'),_0x2a35f3[_0x34bc('0x24')],_0x2b8112['id']);var _0x2de017={'ListId':_0x1ecedf};var _0x1edcb0=_0x33025c['data4']&&_0x33025c[_0x34bc('0x29')]!=='0'?_0x33025c['data4']:'phone';if(_0x164fb2){logger[_0x34bc('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x2a35f3[_0x34bc('0x24')],_0x2b8112['id']);_0x2de017[_0x1edcb0]=_[_0x34bc('0x10')](_0x2a35f3[_0x34bc('0x17')])?_0x2a35f3['calleridnum']:_0x2a35f3[_0x34bc('0x18')];if(_[_0x34bc('0x10')](_0x2a35f3[_0x34bc('0x17')])){_0x2de017[_0x34bc('0x2a')]=_0x2a35f3[_0x34bc('0x2b')]&&_0x2a35f3[_0x34bc('0x2b')]!=='<unknown>'?_0x2a35f3[_0x34bc('0x2b')]:_0x34bc('0x2c');}else{_0x2de017[_0x34bc('0x2a')]=_0x2a35f3[_0x34bc('0x2d')]&&_0x2a35f3[_0x34bc('0x2d')]!==_0x34bc('0x2e')?_0x2a35f3['destcalleridname']:_0x34bc('0x2c');}return BPromise['resolve']()['then'](cmContactRpc[_0x34bc('0x2f')](_0x2de017))['then'](function(_0x1e8445){_0x5a608a=_0x1e8445;_0x41960e[_0x34bc('0x30')](_0x1e8445);if(_0x5a608a){logger[_0x34bc('0xa')](_0x34bc('0x31'),_0x2a35f3[_0x34bc('0x24')],_0x2b8112['id'],_0x5a608a['id']);}return;});}else{logger[_0x34bc('0xa')](_0x34bc('0x32'),_0x2a35f3['uniqueid'],_0x2b8112['id']);_0x2de017[_0x1edcb0]=_[_0x34bc('0x10')](_0x2a35f3[_0x34bc('0x17')])?_0x2a35f3[_0x34bc('0x19')]:_0x2a35f3[_0x34bc('0x18')];if(_[_0x34bc('0x10')](_0x2a35f3['routeId'])){_0x2de017[_0x34bc('0x2a')]=_0x2a35f3[_0x34bc('0x2b')]&&_0x2a35f3[_0x34bc('0x2b')]!==_0x34bc('0x2e')?_0x2a35f3[_0x34bc('0x2b')]:'Unknown';}else{_0x2de017['firstName']=_0x2a35f3[_0x34bc('0x2d')]&&_0x2a35f3[_0x34bc('0x2d')]!==_0x34bc('0x2e')?_0x2a35f3[_0x34bc('0x2d')]:'Unknown';}_0x5a608a=_0x2de017;_0x41960e[_0x34bc('0x30')](_0x2de017);return;}}})[_0x34bc('0x21')](function(){if(_0x5a478d){emit(_0x2a35f3[_0x34bc('0x24')],_0x2b8112,util['format'](_0x34bc('0x33'),_0x5a478d[_0x34bc('0x34')]),util[_0x34bc('0x35')](_0x34bc('0x36'),_0x33025c['action'][_0x34bc('0x37')]()),{'evt':_[_0x34bc('0x38')](_0x2a35f3,{'autoCreate':_0x164fb2}),'contact':_0x5a608a===undefined?{}:_0x5a608a,'contacts':_0x41960e[_0x34bc('0x39')]===0x0?undefined:_0x41960e});}});};
\ No newline at end of file
index 5419867..c055924 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc78=['name','trigger:%s:%s','action','trigger:%s','contactmanager','exec','integration','queue','routeId','urlforward','parse','query','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','some','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','agent','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','redis','defaults','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','checkTrigger','merge','length','Actions','toLowerCase','motionbar','browser','data1','popup','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','location','data4','windowWidth','data5','800','windowHeight','600','data6','winApplication','winArguments','data3','format','user:%s','interface'];(function(_0x38a204,_0x178758){var _0x51ffae=function(_0x356982){while(--_0x356982){_0x38a204['push'](_0x38a204['shift']());}};_0x51ffae(++_0x178758);}(_0xbc78,0x191));var _0x8bc7=function(_0x2abf4d,_0x545fae){_0x2abf4d=_0x2abf4d-0x0;var _0xabe013=_0xbc78[_0x2abf4d];return _0xabe013;};'use strict';var util=require(_0x8bc7('0x0'));var _=require(_0x8bc7('0x1'));var url=require(_0x8bc7('0x2'));var Mustache=require(_0x8bc7('0x3'));var Redis=require(_0x8bc7('0x4'));var urlforward=require(_0x8bc7('0x5'));var integration=require(_0x8bc7('0x6'));var cmContact=require(_0x8bc7('0x7'));var script=require('./script');var config=require(_0x8bc7('0x8'));var logger=require('../../../config/logger')('trigger');var ami=require('../ami');config[_0x8bc7('0x9')]=_[_0x8bc7('0xa')](config[_0x8bc7('0x9')],{'host':_0x8bc7('0xb'),'port':0x18eb});var io=require(_0x8bc7('0xc'))(new Redis(config[_0x8bc7('0x9')]));var operators={'equals':function(_0x42c9bc,_0x5590f8){return _0x42c9bc==_0x5590f8;},'not_equals':function(_0x15cb30,_0x3ce8c6){return _0x15cb30!=_0x3ce8c6;}};var barAndWebActions=['popup',_0x8bc7('0x2'),_0x8bc7('0xd')];function Trigger(_0x2ceb4c){this[_0x8bc7('0xe')]=_0x2ceb4c[_0x8bc7('0xe')];this[_0x8bc7('0xf')]=_0x2ceb4c[_0x8bc7('0xf')];this[_0x8bc7('0x10')]=_0x2ceb4c[_0x8bc7('0x10')];this[_0x8bc7('0x11')]=_0x2ceb4c[_0x8bc7('0x11')];this[_0x8bc7('0x12')]=_0x2ceb4c[_0x8bc7('0x12')];this[_0x8bc7('0x13')]=_0x2ceb4c['zendeskAccounts'];this[_0x8bc7('0x14')]=_0x2ceb4c['freshdeskAccounts'];this[_0x8bc7('0x15')]=_0x2ceb4c['salesforceAccounts'];this[_0x8bc7('0x16')]=_0x2ceb4c[_0x8bc7('0x16')];this[_0x8bc7('0x17')]=_0x2ceb4c[_0x8bc7('0x17')];this[_0x8bc7('0x18')]=_0x2ceb4c[_0x8bc7('0x18')];this[_0x8bc7('0x19')]=_0x2ceb4c['vtigerAccounts'];this['servicenowAccounts']=_0x2ceb4c[_0x8bc7('0x1a')];this[_0x8bc7('0x1b')]=_0x2ceb4c[_0x8bc7('0x1b')];this['freshsalesAccounts']=_0x2ceb4c[_0x8bc7('0x1c')];this['accounts']={'zendesk':this[_0x8bc7('0x13')],'salesforce':this[_0x8bc7('0x15')],'freshdesk':this[_0x8bc7('0x14')],'sugarcrm':this[_0x8bc7('0x16')],'zoho':this['zohoAccounts'],'desk':this[_0x8bc7('0x18')],'vtiger':this[_0x8bc7('0x19')],'dynamics365':this[_0x8bc7('0x1b')],'freshsales':this[_0x8bc7('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0x8bc7('0x1d'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x20'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x21'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x22'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x23'),this[_0x8bc7('0x1e')]['bind'](this));ami['on'](_0x8bc7('0x24'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x25'),this[_0x8bc7('0x1e')]['bind'](this));ami['on']('custom:agentcongestion',this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x26'),this[_0x8bc7('0x1e')]['bind'](this));ami['on'](_0x8bc7('0x27'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x28'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x29'),this['syncCustomEvent']['bind'](this));ami['on'](_0x8bc7('0x2a'),this[_0x8bc7('0x2b')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x2c'),this[_0x8bc7('0x2b')]['bind'](this));ami['on'](_0x8bc7('0x2d'),this[_0x8bc7('0x2b')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x2e'),this['syncCustomEvent']['bind'](this));ami['on'](_0x8bc7('0x2f'),this['syncCustomEvent'][_0x8bc7('0x1f')](this));ami['on']('custom:substatus',this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x30'),this['syncCustomEvent'][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x31'),this[_0x8bc7('0x1e')]['bind'](this));ami['on'](_0x8bc7('0x32'),this['syncCustomEvent'][_0x8bc7('0x1f')](this));ami['on'](_0x8bc7('0x33'),this[_0x8bc7('0x1e')][_0x8bc7('0x1f')](this));}Trigger[_0x8bc7('0x34')][_0x8bc7('0x35')]=function(_0x59516a,_0x325bd9,_0x1a919e){logger[_0x8bc7('0x36')](_0x59516a,_0x325bd9,JSON['stringify'](_0x1a919e));io['to'](_0x59516a)[_0x8bc7('0x35')](_0x325bd9,_0x1a919e);};Trigger[_0x8bc7('0x34')][_0x8bc7('0x1e')]=function(_0x3f79a4){var _0x277069=_['clone'](_0x3f79a4);if(typeof _0x277069[_0x8bc7('0x37')]===_0x8bc7('0x38')){_0x277069[_0x8bc7('0x37')]=_0x8bc7('0x39');}this[_0x8bc7('0x3a')](_0x277069);};Trigger[_0x8bc7('0x34')][_0x8bc7('0x2b')]=function(_0x3c7c9a){if(this[_0x8bc7('0xf')][_0x3c7c9a['interface']]){this[_0x8bc7('0x1e')](_0x3c7c9a);}};Trigger[_0x8bc7('0x34')][_0x8bc7('0x3a')]=function(_0x4c8ac5){var _0x147e50;for(var _0xb93ef9 in this[_0x8bc7('0xe')]){if(this[_0x8bc7('0xe')][_0x8bc7('0x3b')](_0xb93ef9)){if(this[_0x8bc7('0xe')][_0xb93ef9]['status']){_0x147e50=this[_0x8bc7('0x3c')](this[_0x8bc7('0xe')][_0xb93ef9],_0x4c8ac5);if(_0x147e50){_[_0x8bc7('0x3d')](_0x4c8ac5,_0x4c8ac5['variables']);for(var _0x48923a=0x0,_0x27a6cb,_0x1dd089,_0x99bacd;_0x48923a<this['triggers'][_0xb93ef9]['Actions'][_0x8bc7('0x3e')];_0x48923a+=0x1){_0x27a6cb=this[_0x8bc7('0xe')][_0xb93ef9][_0x8bc7('0x3f')][_0x48923a];if(this[_0x8bc7('0xf')][_0x4c8ac5['interface']]){switch(_0x27a6cb['action'][_0x8bc7('0x40')]()){case'contactmanager':break;case _0x8bc7('0x41'):case _0x8bc7('0x42'):var _0x176aa0={};switch(barAndWebActions[_0x27a6cb[_0x8bc7('0x43')]]){case _0x8bc7('0x44'):_0x176aa0[_0x8bc7('0x45')]=_0x27a6cb[_0x8bc7('0x46')];_0x176aa0[_0x8bc7('0x47')]=this['templates'][_0x27a6cb[_0x8bc7('0x46')]]?Mustache[_0x8bc7('0x48')](this[_0x8bc7('0x11')][_0x27a6cb[_0x8bc7('0x46')]][_0x8bc7('0x47')],_0x4c8ac5):_0x8bc7('0x49');break;case _0x8bc7('0x2'):_0x176aa0[_0x8bc7('0x4a')]=this[_0x8bc7('0x4b')](_0x27a6cb[_0x8bc7('0x46')],_0x4c8ac5,_[_0x8bc7('0x4c')](_0x27a6cb['data3'])?!![]:parseInt(_0x27a6cb['data3'],0xa));if(_[_0x8bc7('0x4c')](_0x27a6cb['data4'])){_0x176aa0[_0x8bc7('0x4d')]='0';}else{_0x176aa0['uriLocation']=_0x27a6cb[_0x8bc7('0x4e')];_0x176aa0[_0x8bc7('0x4f')]=_[_0x8bc7('0x4c')](_0x27a6cb[_0x8bc7('0x50')])?_0x8bc7('0x51'):_0x27a6cb['data5'];_0x176aa0[_0x8bc7('0x52')]=_[_0x8bc7('0x4c')](_0x27a6cb['data6'])?_0x8bc7('0x53'):_0x27a6cb[_0x8bc7('0x54')];}break;case'winapp':_0x176aa0[_0x8bc7('0x55')]=_0x27a6cb[_0x8bc7('0x46')]?Mustache[_0x8bc7('0x48')](_0x27a6cb['data2'],_0x4c8ac5):'';_0x176aa0[_0x8bc7('0x56')]=_0x27a6cb[_0x8bc7('0x57')]?Mustache[_0x8bc7('0x48')](_0x27a6cb[_0x8bc7('0x57')],_0x4c8ac5):'';break;}this[_0x8bc7('0x35')](util[_0x8bc7('0x58')](_0x8bc7('0x59'),this[_0x8bc7('0xf')][_0x4c8ac5[_0x8bc7('0x5a')]][_0x8bc7('0x5b')]),util['format'](_0x8bc7('0x5c'),_0x27a6cb[_0x8bc7('0x5d')][_0x8bc7('0x40')](),barAndWebActions[_0x27a6cb[_0x8bc7('0x43')]]),_[_0x8bc7('0x3d')](_0x176aa0,_0x4c8ac5));break;case'jscripty':this[_0x8bc7('0x35')](util[_0x8bc7('0x58')]('user:%s',this['agents'][_0x4c8ac5['interface']][_0x8bc7('0x5b')]),util[_0x8bc7('0x58')](_0x8bc7('0x5e'),_0x27a6cb[_0x8bc7('0x5d')]['toLowerCase']()),_[_0x8bc7('0x3d')]({'ProjectId':parseInt(_0x27a6cb['data1'],0xa)},_0x4c8ac5));break;default:this['emit'](util[_0x8bc7('0x58')](_0x8bc7('0x59'),this[_0x8bc7('0xf')][_0x4c8ac5[_0x8bc7('0x5a')]]['name']),util[_0x8bc7('0x58')](_0x8bc7('0x5e'),_0x27a6cb[_0x8bc7('0x5d')]['toLowerCase']()),_['merge']({},_0x27a6cb,_0x4c8ac5));}}switch(_0x27a6cb[_0x8bc7('0x5d')]['toLowerCase']()){case _0x8bc7('0x5f'):cmContact[_0x8bc7('0x60')](this[_0x8bc7('0xf')][_0x4c8ac5[_0x8bc7('0x5a')]],this[_0x8bc7('0xe')][_0xb93ef9],_0x27a6cb,_0x4c8ac5);break;case _0x8bc7('0x61'):integration[_0x8bc7('0x60')](_0x27a6cb,_0x4c8ac5,this['accounts'],this['agents'][_0x4c8ac5[_0x8bc7('0x5a')]],this[_0x8bc7('0x10')][_0x4c8ac5[_0x8bc7('0x62')]],this[_0x8bc7('0x12')][_0x4c8ac5[_0x8bc7('0x63')]]);break;case _0x8bc7('0x64'):urlforward[_0x8bc7('0x60')](_0x27a6cb,_0x4c8ac5);break;case'script':script[_0x8bc7('0x60')](_0x27a6cb,_0x4c8ac5);break;}}}}}}};Trigger[_0x8bc7('0x34')][_0x8bc7('0x4b')]=function(_0x282613,_0x24391d,_0x48e5f6){var _0x51b5e7=url[_0x8bc7('0x65')](Mustache['render'](_0x282613,_0x24391d),!![]);if(_0x48e5f6){_[_0x8bc7('0x3d')](_0x51b5e7[_0x8bc7('0x66')],_0x24391d);}delete _0x51b5e7[_0x8bc7('0x67')];var _0x2412d7=url[_0x8bc7('0x58')](_0x51b5e7);_0x2412d7=_0x2412d7[_0x8bc7('0x68')](/\/\?/g,'?');return _0x2412d7;};Trigger['prototype'][_0x8bc7('0x3c')]=function(_0x45f9cf,_0x36d443){var _0x23ddf6=!![];var _0x840511=!![];var _0x3708e9=![];if(_0x45f9cf[_0x8bc7('0x69')]===_0x36d443[_0x8bc7('0x37')]){_0x3708e9=!![];}if(_0x45f9cf['AllConditions'][_0x8bc7('0x3e')]){_0x23ddf6=_[_0x8bc7('0x6a')](_0x45f9cf[_0x8bc7('0x6b')],this[_0x8bc7('0x6c')](_0x36d443,_0x45f9cf['channel']));}if(_0x45f9cf[_0x8bc7('0x6d')]['length']){_0x840511=_[_0x8bc7('0x6e')](_0x45f9cf[_0x8bc7('0x6d')],this[_0x8bc7('0x6c')](_0x36d443,_0x45f9cf[_0x8bc7('0x69')]));}return _0x3708e9&&_0x23ddf6&&_0x840511;};Trigger[_0x8bc7('0x34')][_0x8bc7('0x6c')]=function(_0x173189,_0x3431d4){return function(_0x452887){switch(_0x452887[_0x8bc7('0x6f')]){case _0x8bc7('0x70'):if(_0x173189[_0x8bc7('0x69')]===_0x3431d4){if(_0x3431d4==='chat'){return _0x173189[_0x8bc7('0x71')]?operators[_0x452887[_0x8bc7('0x72')]](Number(_0x452887[_0x8bc7('0x73')]),_0x173189[_0x8bc7('0x71')]):![];}else{return _0x173189[_[_0x8bc7('0x74')](_0x3431d4)+'AccountId']?operators[_0x452887[_0x8bc7('0x72')]](Number(_0x452887['value']),_0x173189[_[_0x8bc7('0x74')](_0x3431d4)+_0x8bc7('0x75')]):![];}}break;case'interaction':case _0x8bc7('0x76'):if(_0x173189[_0x8bc7('0x69')]===_0x3431d4){return _0x173189[_0x8bc7('0x77')]?operators[_0x452887[_0x8bc7('0x72')]](_0x452887[_0x8bc7('0x73')],_0x173189[_0x8bc7('0x77')]):![];}break;case _0x8bc7('0x62'):return _0x173189[_0x8bc7('0x62')]?operators[_0x452887[_0x8bc7('0x72')]](_0x452887[_0x8bc7('0x73')],_0x173189[_0x8bc7('0x62')]):![];case _0x8bc7('0x78'):return _0x173189['membername']?operators[_0x452887[_0x8bc7('0x72')]](_0x452887[_0x8bc7('0x73')],_0x173189['membername']):![];case _0x8bc7('0x79'):return _0x173189['lastevent']?operators[_0x452887[_0x8bc7('0x72')]](_0x452887['value'],_0x173189[_0x8bc7('0x79')]):![];case _0x8bc7('0x63'):return _0x173189['routeId']?operators[_0x452887['operator']](_0x452887['value'],_0x173189[_0x8bc7('0x63')]):![];}return![];};};module[_0x8bc7('0x7a')]=Trigger;
\ No newline at end of file
+var _0x36f9=['message','event','membername','lastevent','routeId','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','info','prototype','clone','motionChannel','undefined','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location','data5','windowHeight','data6','600','winArguments','format','user:%s','trigger:%s:%s','action','jscripty','name','trigger:%s','exec','integration','queue','urlforward','script','parse','query','search','replace','channel','AllConditions','AnyConditions','some','checkConditions','field','chat','ChatWebsiteId','value','AccountId','operator','upperFirst'];(function(_0x4a5b9d,_0x41c59e){var _0x3683e5=function(_0x5516de){while(--_0x5516de){_0x4a5b9d['push'](_0x4a5b9d['shift']());}};_0x3683e5(++_0x41c59e);}(_0x36f9,0x7f));var _0x936f=function(_0x50cb4b,_0x140d9a){_0x50cb4b=_0x50cb4b-0x0;var _0x53b81a=_0x36f9[_0x50cb4b];return _0x53b81a;};'use strict';var util=require('util');var _=require(_0x936f('0x0'));var url=require(_0x936f('0x1'));var Mustache=require(_0x936f('0x2'));var Redis=require(_0x936f('0x3'));var urlforward=require(_0x936f('0x4'));var integration=require(_0x936f('0x5'));var cmContact=require(_0x936f('0x6'));var script=require(_0x936f('0x7'));var config=require(_0x936f('0x8'));var logger=require(_0x936f('0x9'))(_0x936f('0xa'));var ami=require(_0x936f('0xb'));config[_0x936f('0xc')]=_[_0x936f('0xd')](config[_0x936f('0xc')],{'host':_0x936f('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x936f('0xc')]));var operators={'equals':function(_0xf8c9c8,_0x2eeb45){return _0xf8c9c8==_0x2eeb45;},'not_equals':function(_0x46d2dd,_0x6727f0){return _0x46d2dd!=_0x6727f0;}};var barAndWebActions=[_0x936f('0xf'),_0x936f('0x1'),_0x936f('0x10')];function Trigger(_0x4df59b){this[_0x936f('0x11')]=_0x4df59b['triggers'];this[_0x936f('0x12')]=_0x4df59b[_0x936f('0x12')];this[_0x936f('0x13')]=_0x4df59b[_0x936f('0x13')];this[_0x936f('0x14')]=_0x4df59b[_0x936f('0x14')];this['voiceExtensions']=_0x4df59b[_0x936f('0x15')];this[_0x936f('0x16')]=_0x4df59b[_0x936f('0x16')];this[_0x936f('0x17')]=_0x4df59b[_0x936f('0x17')];this[_0x936f('0x18')]=_0x4df59b[_0x936f('0x18')];this[_0x936f('0x19')]=_0x4df59b[_0x936f('0x19')];this[_0x936f('0x1a')]=_0x4df59b[_0x936f('0x1a')];this['deskAccounts']=_0x4df59b[_0x936f('0x1b')];this[_0x936f('0x1c')]=_0x4df59b[_0x936f('0x1c')];this['servicenowAccounts']=_0x4df59b[_0x936f('0x1d')];this[_0x936f('0x1e')]=_0x4df59b[_0x936f('0x1e')];this[_0x936f('0x1f')]=_0x4df59b[_0x936f('0x1f')];this[_0x936f('0x20')]={'zendesk':this[_0x936f('0x16')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x936f('0x17')],'sugarcrm':this[_0x936f('0x19')],'zoho':this['zohoAccounts'],'desk':this[_0x936f('0x1b')],'vtiger':this[_0x936f('0x1c')],'dynamics365':this[_0x936f('0x1e')],'freshsales':this[_0x936f('0x1f')],'servicenow':this['servicenowAccounts']};ami['on'](_0x936f('0x21'),this['syncCustomEvent'][_0x936f('0x22')](this));ami['on'](_0x936f('0x23'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on']('custom:agentringnoanswer',this[_0x936f('0x24')]['bind'](this));ami['on'](_0x936f('0x25'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on']('custom:agentnosuchnumber',this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on'](_0x936f('0x26'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on'](_0x936f('0x27'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on'](_0x936f('0x28'),this['syncCustomEvent'][_0x936f('0x22')](this));ami['on'](_0x936f('0x29'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on'](_0x936f('0x2a'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on']('custom:queuecallerabandon',this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on'](_0x936f('0x2b'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on']('custom:dialbegin',this[_0x936f('0x2c')][_0x936f('0x22')](this));ami['on'](_0x936f('0x2d'),this[_0x936f('0x2c')][_0x936f('0x22')](this));ami['on'](_0x936f('0x2e'),this[_0x936f('0x2c')][_0x936f('0x22')](this));ami['on'](_0x936f('0x2f'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on'](_0x936f('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x936f('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x936f('0x32'),this['syncCustomEvent'][_0x936f('0x22')](this));ami['on'](_0x936f('0x33'),this[_0x936f('0x24')][_0x936f('0x22')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0x936f('0x22')](this));ami['on'](_0x936f('0x34'),this[_0x936f('0x24')][_0x936f('0x22')](this));}Trigger['prototype'][_0x936f('0x35')]=function(_0x39aa01,_0x162ba5,_0x327375){logger[_0x936f('0x36')](_0x39aa01,_0x162ba5,JSON['stringify'](_0x327375));io['to'](_0x39aa01)['emit'](_0x162ba5,_0x327375);};Trigger[_0x936f('0x37')][_0x936f('0x24')]=function(_0x473adb){var _0x40ebc4=_[_0x936f('0x38')](_0x473adb);if(typeof _0x40ebc4[_0x936f('0x39')]===_0x936f('0x3a')){_0x40ebc4[_0x936f('0x39')]='voice';}this[_0x936f('0x3b')](_0x40ebc4);};Trigger['prototype'][_0x936f('0x2c')]=function(_0xa47813){if(this[_0x936f('0x12')][_0xa47813[_0x936f('0x3c')]]){this[_0x936f('0x24')](_0xa47813);}};Trigger[_0x936f('0x37')][_0x936f('0x3b')]=function(_0x5b15db){var _0x2f1275;for(var _0x30e66d in this[_0x936f('0x11')]){if(this['triggers'][_0x936f('0x3d')](_0x30e66d)){if(this[_0x936f('0x11')][_0x30e66d][_0x936f('0x3e')]){_0x2f1275=this[_0x936f('0x3f')](this['triggers'][_0x30e66d],_0x5b15db);if(_0x2f1275){_[_0x936f('0x40')](_0x5b15db,_0x5b15db[_0x936f('0x41')]);for(var _0x1f8312=0x0,_0x4f1237,_0x4008ef,_0x2831b8;_0x1f8312<this[_0x936f('0x11')][_0x30e66d][_0x936f('0x42')][_0x936f('0x43')];_0x1f8312+=0x1){_0x4f1237=this['triggers'][_0x30e66d][_0x936f('0x42')][_0x1f8312];if(this[_0x936f('0x12')][_0x5b15db['interface']]){switch(_0x4f1237['action'][_0x936f('0x44')]()){case _0x936f('0x45'):break;case'motionbar':case _0x936f('0x46'):var _0x18ed84={};switch(barAndWebActions[_0x4f1237[_0x936f('0x47')]]){case'popup':_0x18ed84[_0x936f('0x48')]=_0x4f1237[_0x936f('0x49')];_0x18ed84[_0x936f('0x4a')]=this[_0x936f('0x14')][_0x4f1237['data2']]?Mustache[_0x936f('0x4b')](this[_0x936f('0x14')][_0x4f1237[_0x936f('0x49')]][_0x936f('0x4a')],_0x5b15db):'template\x20not\x20found';break;case'url':_0x18ed84[_0x936f('0x4c')]=this[_0x936f('0x4d')](_0x4f1237[_0x936f('0x49')],_0x5b15db,_[_0x936f('0x4e')](_0x4f1237[_0x936f('0x4f')])?!![]:parseInt(_0x4f1237[_0x936f('0x4f')],0xa));if(_[_0x936f('0x4e')](_0x4f1237[_0x936f('0x50')])){_0x18ed84[_0x936f('0x51')]='0';}else{_0x18ed84['uriLocation']=_0x4f1237['data4'];_0x18ed84['windowWidth']=_[_0x936f('0x4e')](_0x4f1237[_0x936f('0x52')])?'800':_0x4f1237['data5'];_0x18ed84[_0x936f('0x53')]=_[_0x936f('0x4e')](_0x4f1237[_0x936f('0x54')])?_0x936f('0x55'):_0x4f1237['data6'];}break;case _0x936f('0x10'):_0x18ed84['winApplication']=_0x4f1237[_0x936f('0x49')]?Mustache[_0x936f('0x4b')](_0x4f1237[_0x936f('0x49')],_0x5b15db):'';_0x18ed84[_0x936f('0x56')]=_0x4f1237[_0x936f('0x4f')]?Mustache[_0x936f('0x4b')](_0x4f1237[_0x936f('0x4f')],_0x5b15db):'';break;}this[_0x936f('0x35')](util[_0x936f('0x57')](_0x936f('0x58'),this[_0x936f('0x12')][_0x5b15db[_0x936f('0x3c')]]['name']),util[_0x936f('0x57')](_0x936f('0x59'),_0x4f1237[_0x936f('0x5a')][_0x936f('0x44')](),barAndWebActions[_0x4f1237['data1']]),_[_0x936f('0x40')](_0x18ed84,_0x5b15db));break;case _0x936f('0x5b'):this['emit'](util[_0x936f('0x57')](_0x936f('0x58'),this[_0x936f('0x12')][_0x5b15db[_0x936f('0x3c')]][_0x936f('0x5c')]),util[_0x936f('0x57')](_0x936f('0x5d'),_0x4f1237['action'][_0x936f('0x44')]()),_['merge']({'ProjectId':parseInt(_0x4f1237[_0x936f('0x47')],0xa)},_0x5b15db));break;default:this[_0x936f('0x35')](util[_0x936f('0x57')](_0x936f('0x58'),this['agents'][_0x5b15db['interface']][_0x936f('0x5c')]),util[_0x936f('0x57')]('trigger:%s',_0x4f1237[_0x936f('0x5a')][_0x936f('0x44')]()),_[_0x936f('0x40')]({},_0x4f1237,_0x5b15db));}}switch(_0x4f1237[_0x936f('0x5a')][_0x936f('0x44')]()){case _0x936f('0x45'):cmContact[_0x936f('0x5e')](this[_0x936f('0x12')][_0x5b15db[_0x936f('0x3c')]],this[_0x936f('0x11')][_0x30e66d],_0x4f1237,_0x5b15db);break;case _0x936f('0x5f'):integration[_0x936f('0x5e')](_0x4f1237,_0x5b15db,this['accounts'],this[_0x936f('0x12')][_0x5b15db[_0x936f('0x3c')]],this[_0x936f('0x13')][_0x5b15db[_0x936f('0x60')]],this[_0x936f('0x15')][_0x5b15db['routeId']]);break;case _0x936f('0x61'):urlforward[_0x936f('0x5e')](_0x4f1237,_0x5b15db);break;case _0x936f('0x62'):script['exec'](_0x4f1237,_0x5b15db);break;}}}}}}};Trigger[_0x936f('0x37')][_0x936f('0x4d')]=function(_0x23efca,_0x1d7136,_0x17a619){var _0x2504b6=url[_0x936f('0x63')](Mustache[_0x936f('0x4b')](_0x23efca,_0x1d7136),!![]);if(_0x17a619){_['merge'](_0x2504b6[_0x936f('0x64')],_0x1d7136);}delete _0x2504b6[_0x936f('0x65')];var _0x55a6e4=url[_0x936f('0x57')](_0x2504b6);_0x55a6e4=_0x55a6e4[_0x936f('0x66')](/\/\?/g,'?');return _0x55a6e4;};Trigger[_0x936f('0x37')][_0x936f('0x3f')]=function(_0x59a643,_0x121214){var _0x27ea1a=!![];var _0x2a7be9=!![];var _0x2861f0=![];if(_0x59a643[_0x936f('0x67')]===_0x121214[_0x936f('0x39')]){_0x2861f0=!![];}if(_0x59a643[_0x936f('0x68')]['length']){_0x27ea1a=_['every'](_0x59a643['AllConditions'],this['checkConditions'](_0x121214,_0x59a643['channel']));}if(_0x59a643[_0x936f('0x69')]['length']){_0x2a7be9=_[_0x936f('0x6a')](_0x59a643[_0x936f('0x69')],this[_0x936f('0x6b')](_0x121214,_0x59a643['channel']));}return _0x2861f0&&_0x27ea1a&&_0x2a7be9;};Trigger[_0x936f('0x37')]['checkConditions']=function(_0x578430,_0x5755b9){return function(_0xedce49){switch(_0xedce49[_0x936f('0x6c')]){case'account':if(_0x578430[_0x936f('0x67')]===_0x5755b9){if(_0x5755b9===_0x936f('0x6d')){return _0x578430[_0x936f('0x6e')]?operators[_0xedce49['operator']](Number(_0xedce49[_0x936f('0x6f')]),_0x578430[_0x936f('0x6e')]):![];}else{return _0x578430[_['upperFirst'](_0x5755b9)+_0x936f('0x70')]?operators[_0xedce49[_0x936f('0x71')]](Number(_0xedce49['value']),_0x578430[_[_0x936f('0x72')](_0x5755b9)+_0x936f('0x70')]):![];}}break;case'interaction':case _0x936f('0x73'):if(_0x578430[_0x936f('0x67')]===_0x5755b9){return _0x578430[_0x936f('0x74')]?operators[_0xedce49[_0x936f('0x71')]](_0xedce49['value'],_0x578430[_0x936f('0x74')]):![];}break;case _0x936f('0x60'):return _0x578430[_0x936f('0x60')]?operators[_0xedce49[_0x936f('0x71')]](_0xedce49['value'],_0x578430['queue']):![];case'agent':return _0x578430[_0x936f('0x75')]?operators[_0xedce49[_0x936f('0x71')]](_0xedce49[_0x936f('0x6f')],_0x578430[_0x936f('0x75')]):![];case _0x936f('0x76'):return _0x578430[_0x936f('0x76')]?operators[_0xedce49[_0x936f('0x71')]](_0xedce49[_0x936f('0x6f')],_0x578430[_0x936f('0x76')]):![];case'routeId':return _0x578430[_0x936f('0x77')]?operators[_0xedce49[_0x936f('0x71')]](_0xedce49[_0x936f('0x6f')],_0x578430['routeId']):![];}return![];};};module[_0x936f('0x78')]=Trigger;
\ No newline at end of file
index d93fa66..ccd09db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x34656c,_0x3a9349){var _0x432628=function(_0x1a927b){while(--_0x1a927b){_0x34656c['push'](_0x34656c['shift']());}};_0x432628(++_0x3a9349);}(_0x3e74,0x175));var _0x43e7=function(_0x19397f,_0xf1a0ef){_0x19397f=_0x19397f-0x0;var _0x350c7f=_0x3e74[_0x19397f];return _0x350c7f;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});};
\ No newline at end of file
+var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x5fc3,0xa8));var _0x35fc=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x5fc3[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});};
\ No newline at end of file
index bb86bd5..25b6f19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','customField','content','ticketType','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','clientSecret','then','catch',']\x20Wrong\x20credentials!','message'];(function(_0x238e7a,_0x4bd5a5){var _0xa2b605=function(_0xa3983f){while(--_0xa3983f){_0x238e7a['push'](_0x238e7a['shift']());}};_0xa2b605(++_0x4bd5a5);}(_0xb43b,0x10b));var _0xbb43=function(_0x22aba6,_0x4cd127){_0x22aba6=_0x22aba6-0x0;var _0x389030=_0xb43b[_0x22aba6];return _0x389030;};'use strict';var _=require('lodash');var BPromise=require(_0xbb43('0x0'));var rp=require('request-promise');var util=require(_0xbb43('0x1'));var intUtil=require('./util');var md5=require(_0xbb43('0x2'));var Redis=require(_0xbb43('0x3'));var logger=require(_0xbb43('0x4'))('dynamics365');var config=require(_0xbb43('0x5'));config[_0xbb43('0x6')]=_[_0xbb43('0x7')](config[_0xbb43('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xbb43('0x8'))(new Redis(config[_0xbb43('0x6')]));function getAuthToken(_0x303900,_0x534d9b,_0x46b893){var _0xaf291a={'method':_0xbb43('0x9'),'uri':_0x534d9b,'form':{'client_id':_0x303900[_0xbb43('0xa')],'resource':_0x303900[_0xbb43('0xb')],'username':_0x303900[_0xbb43('0xc')],'password':_0x303900['password'],'grant_type':'password','client_secret':_0x303900[_0xbb43('0xd')]},'json':!![]};return rp(_0xaf291a)[_0xbb43('0xe')](function(_0x234405){return _0x234405['access_token'];})[_0xbb43('0xf')](function(_0x2a06a3){logger['error']('['+[_0x46b893['toUpperCase']()]+_0xbb43('0x10'));return _0x2a06a3[_0xbb43('0x11')];});}function getUser(_0x40abbf,_0x30930e,_0x296beb,_0x6cabe3,_0x3897d6,_0x3a77f3){return new BPromise(function(_0x22dd27,_0xffe374){return getAuthToken(_0x30930e,_0x6cabe3,_0x3a77f3)[_0xbb43('0xe')](function(_0x3d1732){var _0x15854b={'method':_0xbb43('0x12'),'uri':_0x3897d6+_0xbb43('0x13'),'headers':{'Authorization':'Bearer\x20'+_0x3d1732,'OData-Version':_0xbb43('0x14')},'json':!![]};return rp(_0x15854b);})[_0xbb43('0xe')](function(_0x2d22c8){var _0x37925a=_0x2d22c8[_0xbb43('0x15')];var _0x56bff0=![];var _0x3f37b7=null;if(!_[_0xbb43('0x16')](_0x296beb)){if(intUtil[_0xbb43('0x17')](_0x296beb[_0xbb43('0x18')])){_0x40abbf[_0xbb43('0x19')]=_0x296beb['email'];for(_0x3f37b7=0x0;_0x3f37b7<_0x37925a[_0xbb43('0x1a')];_0x3f37b7++){if(_0x37925a[_0x3f37b7][_0xbb43('0x1b')]===_0x296beb[_0xbb43('0x18')]&&!_0x37925a[_0x3f37b7][_0xbb43('0x1c')]){_0x56bff0=!![];logger[_0xbb43('0x1d')]('['+[_0x3a77f3[_0xbb43('0x1e')]()]+_0xbb43('0x1f')+_0x37925a[_0x3f37b7][_0xbb43('0x20')]+'!');_0x40abbf[_0xbb43('0x21')]=_0x37925a[_0x3f37b7][_0xbb43('0x20')];}}}}if(!_0x56bff0){logger[_0xbb43('0x1d')]('['+[_0x3a77f3['toUpperCase']()]+_0xbb43('0x22'));_0x40abbf['userEmail']=_0x30930e[_0xbb43('0xc')];for(_0x3f37b7=0x0;_0x3f37b7<_0x37925a['length'];_0x3f37b7++){if(_0x37925a[_0x3f37b7]['internalemailaddress']===_0x30930e[_0xbb43('0xc')]){_0x40abbf[_0xbb43('0x21')]=_0x37925a[_0x3f37b7][_0xbb43('0x20')];}}}_0x22dd27(_0x40abbf);})[_0xbb43('0xf')](function(_0x1bcc9e){_0xffe374(_0x1bcc9e[_0xbb43('0x11')]);});});}function createEndUser(_0x4a9f81,_0x27b6dc,_0x1cbb6b,_0x4173a6,_0x3f114d,_0x308be4){return new BPromise(function(_0x51e8c5,_0x5dade8){return getAuthToken(_0x27b6dc,_0x1cbb6b,_0x308be4)[_0xbb43('0xe')](function(_0x48b64){var _0x5509a3=_0x308be4[_0xbb43('0x23')]()===_0xbb43('0x24')?_0x3f114d['destcalleridnum']:_0x3f114d[_0xbb43('0x25')];var _0x554771={'method':_0xbb43('0x9'),'uri':_0x4173a6+_0xbb43('0x26'),'body':{'telephone1':_0x5509a3,'fullname':_0x5509a3,'firstname':_0x5509a3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xbb43('0x27')+_0x4a9f81[_0xbb43('0x21')]+')'},'headers':{'Authorization':_0xbb43('0x28')+_0x48b64,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x554771);})[_0xbb43('0xe')](function(_0x45966d){var _0x1a3aa5=_0x45966d[_0xbb43('0x29')][_0xbb43('0x2a')];var _0x23cca0=_0x1a3aa5[_0xbb43('0x2b')](_0x1a3aa5['lastIndexOf']('(')+0x1,_0x1a3aa5[_0xbb43('0x2c')](')'));_0x4a9f81[_0xbb43('0x2d')]=_0x23cca0;_0x51e8c5(_0x4a9f81);})[_0xbb43('0xf')](function(_0x3503e5){_0x5dade8(_0x3503e5[_0xbb43('0x11')]);});});}function getEndUser(_0x284f8c,_0x204ac4,_0x406638,_0x1d17a6,_0x24261e,_0x2627a8){return new BPromise(function(_0x2ab842,_0x76948f){var _0x3dc537=_0x2627a8[_0xbb43('0x23')]()===_0xbb43('0x24')?_0x24261e[_0xbb43('0x2e')]:_0x24261e[_0xbb43('0x25')];return getAuthToken(_0x204ac4,_0x406638,_0x2627a8)[_0xbb43('0xe')](function(_0x58cd8e){var _0xf94da6={'method':_0xbb43('0x12'),'uri':_0x1d17a6+_0xbb43('0x2f')+_0x3dc537[_0xbb43('0x30')]('+',_0xbb43('0x31'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x58cd8e,'If-None-Match':null,'OData-Version':_0xbb43('0x14')},'json':!![]};return rp(_0xf94da6);})[_0xbb43('0xe')](function(_0x2c065e){var _0x1b0307=null;if(_0x2c065e){var _0x5b2f6c=_0x2c065e['value'];var _0x402985=![];for(_0x1b0307=0x0;_0x1b0307<_0x5b2f6c[_0xbb43('0x1a')];_0x1b0307++){if(_0x5b2f6c[_0x1b0307][_0xbb43('0x32')]===_0x3dc537){_0x402985=!![];_0x284f8c['enduserId']=_0x5b2f6c[_0x1b0307][_0xbb43('0x33')];}}if(_0x402985){_0x2ab842(_0x284f8c);}else{return createEndUser(_0x284f8c,_0x204ac4,_0x406638,_0x1d17a6,_0x24261e,_0x2627a8)[_0xbb43('0xe')](function(_0x4c3c75){logger['info']('['+[_0x2627a8[_0xbb43('0x1e')]()]+_0xbb43('0x34'),_0x4c3c75[_0xbb43('0x2d')]);_0x2ab842(_0x4c3c75);});}}else{return createEndUser(_0x284f8c,_0x204ac4,_0x406638,_0x1d17a6,_0x24261e,_0x2627a8)[_0xbb43('0xe')](function(_0x438a7f){logger['info']('['+[_0x2627a8[_0xbb43('0x1e')]()]+_0xbb43('0x35'),_0x438a7f['enduserId']);_0x2ab842(_0x438a7f);});}});});}function getCustomFields(_0x1b31d8,_0x16a4cb,_0x415184){var _0x43eb8a={};if(_0x1b31d8['length']>0x0){_[_0xbb43('0x36')](_0x1b31d8,function(_0x8497f8){if(_[_0xbb43('0x37')]([_0xbb43('0x38'),'picklist'],_0x8497f8[_0xbb43('0x39')])&&_0x8497f8['nameField']&&!_0x8497f8[_0xbb43('0x3a')]){var _0x4acad6=_0x8497f8['idField']['toLowerCase']();var _0x3abdf6=_0x4acad6[_0xbb43('0x2b')](0x0,_0x4acad6['indexOf']('_'));var _0x3830db=_0x4acad6[_0xbb43('0x2b')](_0x4acad6['indexOf']('_')+0x1);if(_0x3abdf6===_0x415184){_0x43eb8a[_0x3830db]=_0x8497f8[_0xbb43('0x3b')];}}});}return _0x43eb8a;}function getTicket(_0x228bbe,_0x55fa09,_0x2a4efd,_0x4bb6c5,_0x165bfe,_0x2a394d,_0x5165f2){return new BPromise(function(_0x414f6b,_0xcaddac){var _0x5b606b;return getAuthToken(_0x55fa09,_0x2a4efd,_0x5165f2)[_0xbb43('0xe')](function(_0x8e17fc){if(_0x2a394d[_0xbb43('0x3c')]==='incident'){_0x5b606b={'method':'POST','uri':_0x4bb6c5+'incidents','body':Object[_0xbb43('0x3d')]({},{'title':intUtil[_0xbb43('0x3e')](_0x2a394d[_0xbb43('0x3f')],_0x165bfe,'\x20'),'description':intUtil['getString'](_0x2a394d[_0xbb43('0x40')],_0x165bfe,'\x0a'),'customerid_contact@odata.bind':_0xbb43('0x41')+_0x228bbe[_0xbb43('0x2d')]+')','ownerid@odata.bind':_0xbb43('0x27')+_0x228bbe['userId']+')','caseorigincode':'1'},getCustomFields(_0x2a394d[_0xbb43('0x42')],_0x165bfe,_0x2a394d[_0xbb43('0x3c')])),'headers':{'Authorization':_0xbb43('0x28')+_0x8e17fc,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2a394d[_0xbb43('0x3c')]===_0xbb43('0x43')){_0x5b606b={'method':_0xbb43('0x9'),'uri':_0x4bb6c5+'phonecalls','body':Object[_0xbb43('0x3d')]({},{'subject':intUtil[_0xbb43('0x3e')](_0x2a394d[_0xbb43('0x3f')],_0x165bfe,'\x20'),'phonenumber':String(_0x165bfe[_0xbb43('0x25')]),'description':intUtil[_0xbb43('0x3e')](_0x2a394d[_0xbb43('0x40')],_0x165bfe,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbb43('0x41')+_0x228bbe['enduserId']+')','ownerid@odata.bind':_0xbb43('0x27')+_0x228bbe[_0xbb43('0x21')]+')','directioncode':_0x228bbe[_0xbb43('0x44')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xbb43('0x27')+_0x228bbe[_0xbb43('0x21')]+')','participationtypemask':_0x228bbe[_0xbb43('0x44')]===_0xbb43('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0xbb43('0x41')+_0x228bbe['enduserId']+')','participationtypemask':_0x228bbe[_0xbb43('0x44')]===_0xbb43('0x45')?0x1:0x2}]},getCustomFields(_0x2a394d[_0xbb43('0x42')],_0x165bfe,_0x2a394d['ticketType'])),'headers':{'Authorization':_0xbb43('0x28')+_0x8e17fc,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5b606b);})[_0xbb43('0xe')](function(_0x561e0a){var _0x2b956b=_0x561e0a[_0xbb43('0x29')]['odata-entityid'];var _0x51c6bb=_0x2b956b[_0xbb43('0x2b')](_0x2b956b['lastIndexOf']('(')+0x1,_0x2b956b['lastIndexOf'](')'));_0x228bbe[_0xbb43('0x46')]=_0x51c6bb;_0x414f6b(_0x228bbe);})[_0xbb43('0xf')](function(_0x84f800){_0xcaddac(_0x84f800[_0xbb43('0x11')]);});});}function emit(_0x6c739e,_0x33df49,_0x4fda4e,_0x3ab82a){var _0x2dcf90={'uri':util[_0xbb43('0x47')](_0xbb43('0x48'),_0x6c739e,_0x4fda4e,_0x3ab82a)};io['to'](util['format']('user:%s',_0x33df49))[_0xbb43('0x49')](_0xbb43('0x4a'),_0x2dcf90);}exports['cs']=function(_0x23e7f6,_0x24a6a9,_0x1eb364,_0x320e15,_0xcdbe61,_0x31d820,_0x535839,_0x400873){var _0x1c0598={};_0x31d820[_0xbb43('0xb')]=intUtil[_0xbb43('0x4b')](_0x31d820['remoteUri']);_0x31d820['serverUrl']=intUtil['stripTrailingSlash'](_0x31d820['serverUrl']);_0x1c0598[_0xbb43('0x44')]=_0x400873===_0xbb43('0x45')||_0x400873==='unmanaged'?'queue':_0xbb43('0x24');var _0x29bf9d=util[_0xbb43('0x47')](_0xbb43('0x4c'),_0x31d820[_0xbb43('0xb')]);var _0x218b4d=util[_0xbb43('0x47')](_0xbb43('0x4d'),_0x31d820['tenantId']);var _0x23ced7=util[_0xbb43('0x47')](_0xbb43('0x4e'),_0x31d820[_0xbb43('0x4f')],_0x24a6a9[_0xbb43('0x50')],md5(_0x24a6a9[_0xbb43('0x50')]));if(_0xcdbe61&&_0xcdbe61['monitor_format']){logger[_0xbb43('0x1d')](_0xbb43('0x51'),_0xbb43('0x52'));_0x24a6a9[_0xbb43('0x53')]=_0x23ced7;}else if(_0x535839&&_0x535839['recordingFormat']&&_0x535839['recordingFormat']!=='none'){logger[_0xbb43('0x1d')](_0xbb43('0x54'),_0xbb43('0x52'));_0x24a6a9['recordingURL']=_0x23ced7;}else{_0x24a6a9['recordingURL']='';}return getUser(_0x1c0598,_0x31d820,_0x320e15,_0x218b4d,_0x29bf9d,_0x400873)[_0xbb43('0xe')](function(_0x584164){logger[_0xbb43('0x1d')]('['+_0x400873[_0xbb43('0x1e')]()+_0xbb43('0x55'),_0x584164['userId']);logger[_0xbb43('0x1d')]('['+_0x400873['toUpperCase']()+_0xbb43('0x56'),_0x584164[_0xbb43('0x19')]);return getEndUser(_0x584164,_0x31d820,_0x218b4d,_0x29bf9d,_0x24a6a9,_0x400873);})['then'](function(_0x2a499a){logger[_0xbb43('0x1d')]('['+_0x400873['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x2a499a[_0xbb43('0x2d')]);logger[_0xbb43('0x1d')]('['+_0x400873[_0xbb43('0x1e')]()+_0xbb43('0x57'),_0x24a6a9[_0xbb43('0x25')]);return getTicket(_0x2a499a,_0x31d820,_0x218b4d,_0x29bf9d,_0x24a6a9,_0x1eb364,_0x400873);})[_0xbb43('0xe')](function(_0x1a7bc7){logger[_0xbb43('0x1d')](util[_0xbb43('0x47')]('['+_0x400873[_0xbb43('0x1e')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x1eb364[_0xbb43('0x3c')],_0x1a7bc7[_0xbb43('0x46')]));logger[_0xbb43('0x1d')](util[_0xbb43('0x47')]('['+_0x400873[_0xbb43('0x1e')]()+_0xbb43('0x58'),_0x400873));if(_0x400873!==_0xbb43('0x59')){logger['info']('['+_0x400873[_0xbb43('0x1e')]()+']',_0xbb43('0x5a'));emit(_0x31d820['remoteUri'],_0x320e15[_0xbb43('0x5b')],_0x1eb364[_0xbb43('0x3c')],_0x1a7bc7[_0xbb43('0x46')]);}})[_0xbb43('0xf')](function(_0x3f2800){logger[_0xbb43('0x5c')]('['+_0x400873[_0xbb43('0x1e')]()+_0xbb43('0x5d'),util[_0xbb43('0x5e')](_0x3f2800,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x6631=['/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','incident','incidents','assign','getString','Subjects','Fields','ticketType','phonecall','phonecalls','Descriptions','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','password','clientSecret','then','access_token','toUpperCase',']\x20Wrong\x20credentials!','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','message','toLowerCase','destcalleridnum','contacts'];(function(_0xc60213,_0x5b7afd){var _0x4fb8e3=function(_0x48dea2){while(--_0x48dea2){_0xc60213['push'](_0xc60213['shift']());}};_0x4fb8e3(++_0x5b7afd);}(_0x6631,0xab));var _0x1663=function(_0x1ec7b0,_0x2eb52a){_0x1ec7b0=_0x1ec7b0-0x0;var _0x5aff54=_0x6631[_0x1ec7b0];return _0x5aff54;};'use strict';var _=require(_0x1663('0x0'));var BPromise=require(_0x1663('0x1'));var rp=require(_0x1663('0x2'));var util=require(_0x1663('0x3'));var intUtil=require('./util');var md5=require(_0x1663('0x4'));var Redis=require(_0x1663('0x5'));var logger=require(_0x1663('0x6'))(_0x1663('0x7'));var config=require('../../../../config/environment');config[_0x1663('0x8')]=_[_0x1663('0x9')](config['redis'],{'host':_0x1663('0xa'),'port':0x18eb});var io=require(_0x1663('0xb'))(new Redis(config[_0x1663('0x8')]));function getAuthToken(_0x6ffba0,_0x7b9a97,_0x10f9eb){var _0x4a23ed={'method':_0x1663('0xc'),'uri':_0x7b9a97,'form':{'client_id':_0x6ffba0[_0x1663('0xd')],'resource':_0x6ffba0['remoteUri'],'username':_0x6ffba0['username'],'password':_0x6ffba0[_0x1663('0xe')],'grant_type':_0x1663('0xe'),'client_secret':_0x6ffba0[_0x1663('0xf')]},'json':!![]};return rp(_0x4a23ed)[_0x1663('0x10')](function(_0x629663){return _0x629663[_0x1663('0x11')];})['catch'](function(_0xb75e06){logger['error']('['+[_0x10f9eb[_0x1663('0x12')]()]+_0x1663('0x13'));return _0xb75e06['message'];});}function getUser(_0x5eaf28,_0x2bb1a3,_0x2ad9ff,_0x1edf8b,_0x17fe1c,_0x23d198){return new BPromise(function(_0x45acdb,_0x59ad05){return getAuthToken(_0x2bb1a3,_0x1edf8b,_0x23d198)[_0x1663('0x10')](function(_0x209e8a){var _0x452797={'method':_0x1663('0x14'),'uri':_0x17fe1c+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x1663('0x15')+_0x209e8a,'OData-Version':_0x1663('0x16')},'json':!![]};return rp(_0x452797);})['then'](function(_0x291539){var _0x49ae1d=_0x291539[_0x1663('0x17')];var _0x133805=![];var _0x2c015b=null;if(!_[_0x1663('0x18')](_0x2ad9ff)){if(intUtil[_0x1663('0x19')](_0x2ad9ff[_0x1663('0x1a')])){_0x5eaf28[_0x1663('0x1b')]=_0x2ad9ff[_0x1663('0x1a')];for(_0x2c015b=0x0;_0x2c015b<_0x49ae1d[_0x1663('0x1c')];_0x2c015b++){if(_0x49ae1d[_0x2c015b][_0x1663('0x1d')]===_0x2ad9ff[_0x1663('0x1a')]&&!_0x49ae1d[_0x2c015b][_0x1663('0x1e')]){_0x133805=!![];logger[_0x1663('0x1f')]('['+[_0x23d198[_0x1663('0x12')]()]+']\x20Agent\x20found\x20'+_0x49ae1d[_0x2c015b][_0x1663('0x20')]+'!');_0x5eaf28[_0x1663('0x21')]=_0x49ae1d[_0x2c015b][_0x1663('0x20')];}}}}if(!_0x133805){logger[_0x1663('0x1f')]('['+[_0x23d198[_0x1663('0x12')]()]+_0x1663('0x22'));_0x5eaf28[_0x1663('0x1b')]=_0x2bb1a3[_0x1663('0x23')];for(_0x2c015b=0x0;_0x2c015b<_0x49ae1d[_0x1663('0x1c')];_0x2c015b++){if(_0x49ae1d[_0x2c015b][_0x1663('0x1d')]===_0x2bb1a3[_0x1663('0x23')]){_0x5eaf28[_0x1663('0x21')]=_0x49ae1d[_0x2c015b][_0x1663('0x20')];}}}_0x45acdb(_0x5eaf28);})[_0x1663('0x24')](function(_0x53ae51){_0x59ad05(_0x53ae51[_0x1663('0x25')]);});});}function createEndUser(_0x43e20d,_0x24f74c,_0x3c4e71,_0x4876b6,_0x20bab4,_0x3164a5){return new BPromise(function(_0x1a4ed4,_0x58e89a){return getAuthToken(_0x24f74c,_0x3c4e71,_0x3164a5)[_0x1663('0x10')](function(_0x4858b4){var _0xf44490=_0x3164a5[_0x1663('0x26')]()==='outbound'?_0x20bab4[_0x1663('0x27')]:_0x20bab4['calleridnum'];var _0x590bc6={'method':_0x1663('0xc'),'uri':_0x4876b6+_0x1663('0x28'),'body':{'telephone1':_0xf44490,'fullname':_0xf44490,'firstname':_0xf44490,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1663('0x29')+_0x43e20d[_0x1663('0x21')]+')'},'headers':{'Authorization':_0x1663('0x15')+_0x4858b4,'OData-Version':_0x1663('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x590bc6);})[_0x1663('0x10')](function(_0xecb099){var _0x41f74b=_0xecb099[_0x1663('0x2a')][_0x1663('0x2b')];var _0x51a70d=_0x41f74b[_0x1663('0x2c')](_0x41f74b[_0x1663('0x2d')]('(')+0x1,_0x41f74b['lastIndexOf'](')'));_0x43e20d[_0x1663('0x2e')]=_0x51a70d;_0x1a4ed4(_0x43e20d);})[_0x1663('0x24')](function(_0x285b91){_0x58e89a(_0x285b91[_0x1663('0x25')]);});});}function getEndUser(_0x19f0cc,_0x4b0114,_0x5afe6c,_0x3e18bb,_0x8416fc,_0x9207a3){return new BPromise(function(_0x53a0e4,_0x555666){var _0x479cf1=_0x9207a3[_0x1663('0x26')]()==='outbound'?_0x8416fc[_0x1663('0x27')]:_0x8416fc[_0x1663('0x2f')];return getAuthToken(_0x4b0114,_0x5afe6c,_0x9207a3)[_0x1663('0x10')](function(_0x2d44d2){var _0x1f5a15={'method':_0x1663('0x14'),'uri':_0x3e18bb+_0x1663('0x30')+_0x479cf1[_0x1663('0x31')]('+',_0x1663('0x32'))+'\x27','headers':{'Authorization':_0x1663('0x15')+_0x2d44d2,'If-None-Match':null,'OData-Version':_0x1663('0x16')},'json':!![]};return rp(_0x1f5a15);})[_0x1663('0x10')](function(_0x1df4ba){var _0x41c4a3=null;if(_0x1df4ba){var _0x45c022=_0x1df4ba['value'];var _0x511ad4=![];for(_0x41c4a3=0x0;_0x41c4a3<_0x45c022['length'];_0x41c4a3++){if(_0x45c022[_0x41c4a3][_0x1663('0x33')]===_0x479cf1){_0x511ad4=!![];_0x19f0cc['enduserId']=_0x45c022[_0x41c4a3][_0x1663('0x34')];}}if(_0x511ad4){_0x53a0e4(_0x19f0cc);}else{return createEndUser(_0x19f0cc,_0x4b0114,_0x5afe6c,_0x3e18bb,_0x8416fc,_0x9207a3)[_0x1663('0x10')](function(_0xc3a8ee){logger[_0x1663('0x1f')]('['+[_0x9207a3[_0x1663('0x12')]()]+_0x1663('0x35'),_0xc3a8ee[_0x1663('0x2e')]);_0x53a0e4(_0xc3a8ee);});}}else{return createEndUser(_0x19f0cc,_0x4b0114,_0x5afe6c,_0x3e18bb,_0x8416fc,_0x9207a3)['then'](function(_0x215db0){logger[_0x1663('0x1f')]('['+[_0x9207a3[_0x1663('0x12')]()]+_0x1663('0x36'),_0x215db0[_0x1663('0x2e')]);_0x53a0e4(_0x215db0);});}});});}function getCustomFields(_0x2ea9e1,_0x28290e,_0x2fbc53){var _0x303ddb={};if(_0x2ea9e1[_0x1663('0x1c')]>0x0){_[_0x1663('0x37')](_0x2ea9e1,function(_0x581ef2){if(_[_0x1663('0x38')]([_0x1663('0x39'),_0x1663('0x3a')],_0x581ef2[_0x1663('0x3b')])&&_0x581ef2[_0x1663('0x3c')]&&!_0x581ef2[_0x1663('0x3d')]){var _0x62b07a=_0x581ef2[_0x1663('0x3e')][_0x1663('0x26')]();var _0x2b47e4=_0x62b07a[_0x1663('0x2c')](0x0,_0x62b07a[_0x1663('0x3f')]('_'));var _0x2572fa=_0x62b07a[_0x1663('0x2c')](_0x62b07a[_0x1663('0x3f')]('_')+0x1);if(_0x2b47e4===_0x2fbc53){_0x303ddb[_0x2572fa]=_0x581ef2[_0x1663('0x40')];}}});}return _0x303ddb;}function getTicket(_0xfd8e3d,_0x1b02e3,_0x1bae0d,_0x29597a,_0xce6c4d,_0x4e90f0,_0x17a271){return new BPromise(function(_0x2e6195,_0xe4d143){var _0xe34064;return getAuthToken(_0x1b02e3,_0x1bae0d,_0x17a271)['then'](function(_0x10253a){if(_0x4e90f0['ticketType']===_0x1663('0x41')){_0xe34064={'method':_0x1663('0xc'),'uri':_0x29597a+_0x1663('0x42'),'body':Object[_0x1663('0x43')]({},{'title':intUtil[_0x1663('0x44')](_0x4e90f0[_0x1663('0x45')],_0xce6c4d,'\x20'),'description':intUtil['getString'](_0x4e90f0['Descriptions'],_0xce6c4d,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0xfd8e3d[_0x1663('0x2e')]+')','ownerid@odata.bind':_0x1663('0x29')+_0xfd8e3d[_0x1663('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x4e90f0[_0x1663('0x46')],_0xce6c4d,_0x4e90f0[_0x1663('0x47')])),'headers':{'Authorization':'Bearer\x20'+_0x10253a,'OData-Version':_0x1663('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4e90f0['ticketType']===_0x1663('0x48')){_0xe34064={'method':_0x1663('0xc'),'uri':_0x29597a+_0x1663('0x49'),'body':Object[_0x1663('0x43')]({},{'subject':intUtil[_0x1663('0x44')](_0x4e90f0[_0x1663('0x45')],_0xce6c4d,'\x20'),'phonenumber':String(_0xce6c4d[_0x1663('0x2f')]),'description':intUtil['getString'](_0x4e90f0[_0x1663('0x4a')],_0xce6c4d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1663('0x4b')+_0xfd8e3d[_0x1663('0x2e')]+')','ownerid@odata.bind':'/systemusers('+_0xfd8e3d['userId']+')','directioncode':_0xfd8e3d[_0x1663('0x4c')]===_0x1663('0x4d')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x1663('0x29')+_0xfd8e3d[_0x1663('0x21')]+')','participationtypemask':_0xfd8e3d['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x1663('0x4b')+_0xfd8e3d['enduserId']+')','participationtypemask':_0xfd8e3d[_0x1663('0x4c')]===_0x1663('0x4d')?0x1:0x2}]},getCustomFields(_0x4e90f0['Fields'],_0xce6c4d,_0x4e90f0[_0x1663('0x47')])),'headers':{'Authorization':_0x1663('0x15')+_0x10253a,'OData-Version':_0x1663('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xe34064);})[_0x1663('0x10')](function(_0x317316){var _0xc5933b=_0x317316[_0x1663('0x2a')]['odata-entityid'];var _0x354b5b=_0xc5933b[_0x1663('0x2c')](_0xc5933b[_0x1663('0x2d')]('(')+0x1,_0xc5933b[_0x1663('0x2d')](')'));_0xfd8e3d[_0x1663('0x4e')]=_0x354b5b;_0x2e6195(_0xfd8e3d);})[_0x1663('0x24')](function(_0x1a9d28){_0xe4d143(_0x1a9d28[_0x1663('0x25')]);});});}function emit(_0x21af32,_0x4cd51d,_0x47e298,_0x34bee3){var _0x1953f9={'uri':util[_0x1663('0x4f')](_0x1663('0x50'),_0x21af32,_0x47e298,_0x34bee3)};io['to'](util['format'](_0x1663('0x51'),_0x4cd51d))[_0x1663('0x52')](_0x1663('0x53'),_0x1953f9);}exports['cs']=function(_0x4927ad,_0x5c6bbb,_0x304dd3,_0x3ace46,_0x3fa340,_0xdf8b49,_0x558994,_0x16db54){var _0x54fe22={};_0xdf8b49[_0x1663('0x54')]=intUtil[_0x1663('0x55')](_0xdf8b49[_0x1663('0x54')]);_0xdf8b49['serverUrl']=intUtil['stripTrailingSlash'](_0xdf8b49[_0x1663('0x56')]);_0x54fe22[_0x1663('0x4c')]=_0x16db54===_0x1663('0x4d')||_0x16db54==='unmanaged'?_0x1663('0x4d'):'outbound';var _0x41ed15=util[_0x1663('0x4f')](_0x1663('0x57'),_0xdf8b49[_0x1663('0x54')]);var _0x931a18=util[_0x1663('0x4f')](_0x1663('0x58'),_0xdf8b49[_0x1663('0x59')]);var _0x5df294=util[_0x1663('0x4f')](_0x1663('0x5a'),_0xdf8b49[_0x1663('0x56')],_0x5c6bbb[_0x1663('0x5b')],md5(_0x5c6bbb[_0x1663('0x5b')]));if(_0x3fa340&&_0x3fa340['monitor_format']){logger[_0x1663('0x1f')]('[QUEUE]',_0x1663('0x5c'));_0x5c6bbb[_0x1663('0x5d')]=_0x5df294;}else if(_0x558994&&_0x558994[_0x1663('0x5e')]&&_0x558994[_0x1663('0x5e')]!==_0x1663('0x5f')){logger[_0x1663('0x1f')](_0x1663('0x60'),_0x1663('0x5c'));_0x5c6bbb['recordingURL']=_0x5df294;}else{_0x5c6bbb['recordingURL']='';}return getUser(_0x54fe22,_0xdf8b49,_0x3ace46,_0x931a18,_0x41ed15,_0x16db54)['then'](function(_0x377f16){logger[_0x1663('0x1f')]('['+_0x16db54[_0x1663('0x12')]()+']\x20The\x20User\x20ID\x20is:',_0x377f16[_0x1663('0x21')]);logger['info']('['+_0x16db54[_0x1663('0x12')]()+_0x1663('0x61'),_0x377f16[_0x1663('0x1b')]);return getEndUser(_0x377f16,_0xdf8b49,_0x931a18,_0x41ed15,_0x5c6bbb,_0x16db54);})[_0x1663('0x10')](function(_0x5b8bcc){logger[_0x1663('0x1f')]('['+_0x16db54[_0x1663('0x12')]()+_0x1663('0x62'),_0x5b8bcc['enduserId']);logger[_0x1663('0x1f')]('['+_0x16db54['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x5c6bbb['calleridnum']);return getTicket(_0x5b8bcc,_0xdf8b49,_0x931a18,_0x41ed15,_0x5c6bbb,_0x304dd3,_0x16db54);})['then'](function(_0x54c5f7){logger[_0x1663('0x1f')](util[_0x1663('0x4f')]('['+_0x16db54['toUpperCase']()+_0x1663('0x63'),_0x304dd3[_0x1663('0x47')],_0x54c5f7[_0x1663('0x4e')]));logger['info'](util[_0x1663('0x4f')]('['+_0x16db54[_0x1663('0x12')]()+_0x1663('0x64'),_0x16db54));if(_0x16db54!==_0x1663('0x65')){logger['info']('['+_0x16db54[_0x1663('0x12')]()+']',_0x1663('0x66'));emit(_0xdf8b49[_0x1663('0x54')],_0x3ace46['name'],_0x304dd3[_0x1663('0x47')],_0x54c5f7[_0x1663('0x4e')]);}})[_0x1663('0x24')](function(_0x103c15){logger[_0x1663('0x67')]('['+_0x16db54[_0x1663('0x12')]()+_0x1663('0x68'),util[_0x1663('0x69')](_0x103c15,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index d5667f1..d7edca3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7138=['Ticket\x20created!','validateEmail','format','then','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','POST','Basic\x20%s','base64','debug','stringify','GET','map','forEach','string','picklist','type','nameField','customField','content','includes','idField','push','toString','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','calleridnum','Subjects','getString','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri'];(function(_0x8a6cde,_0x311129){var _0x3ae58f=function(_0x3e1268){while(--_0x3e1268){_0x8a6cde['push'](_0x8a6cde['shift']());}};_0x3ae58f(++_0x311129);}(_0x7138,0x1f3));var _0x8713=function(_0x40cdfa,_0x1cf634){_0x40cdfa=_0x40cdfa-0x0;var _0x2c5e4d=_0x7138[_0x40cdfa];return _0x2c5e4d;};'use strict';var _=require('lodash');var rp=require(_0x8713('0x0'));var md5=require(_0x8713('0x1'));var util=require(_0x8713('0x2'));var Redis=require(_0x8713('0x3'));var intUtil=require(_0x8713('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8713('0x5'))('freshdesk');config['redis']=_[_0x8713('0x6')](config[_0x8713('0x7')],{'host':_0x8713('0x8'),'port':0x18eb});var io=require(_0x8713('0x9'))(new Redis(config[_0x8713('0x7')]));var headers={'Content-Type':_0x8713('0xa'),'Accept':_0x8713('0xa')};function emit(_0x1dfe0b,_0x13802c,_0x798e1a){io['to'](_0x1dfe0b)[_0x8713('0xb')](_0x13802c,_0x798e1a);}function getTicket(_0x5541b7,_0x549a17,_0x4705ee,_0x36e764,_0x2e7885){logger[_0x8713('0xc')](_0x8713('0xd'));var _0x1de9c2=_[_0x8713('0xe')]({'responder_id':_0x549a17['id'],'requester_id':_0x4705ee['id'],'name':util['format']('Caller\x20-\x20%s',_0x2e7885[_0x8713('0xf')]),'phone':_0x2e7885[_0x8713('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x36e764[_0x8713('0x11')],_0x2e7885,'\x20'),'description':intUtil[_0x8713('0x12')](_0x36e764[_0x8713('0x13')],_0x2e7885,_0x8713('0x14')),'tags':getTags(_0x36e764[_0x8713('0x15')],_0x8713('0x16'))},getCustomFields(_0x36e764[_0x8713('0x17')],_0x2e7885));_0x1de9c2[_0x8713('0x18')]=_[_0x8713('0x19')](_[_0x8713('0x1a')](_0x1de9c2[_0x8713('0x18')],'id'),'value');return request({'uri':util['format'](_0x8713('0x1b'),_0x5541b7[_0x8713('0x1c')]),'method':'POST','body':_0x1de9c2})['then'](function(_0x4cb055){logger[_0x8713('0xc')](_0x8713('0x1d'));return _0x4cb055;});}function getUser(_0x212cdf,_0x56fd87){if(intUtil[_0x8713('0x1e')](_0x56fd87)){return request({'uri':util[_0x8713('0x1f')]('%s/api/v2/agents',_0x212cdf[_0x8713('0x1c')]),'qs':{'email':_0x56fd87}})[_0x8713('0x20')](function(_0x484591){if(_0x484591['length']){logger['info']('Agent\x20found!');return _[_0x8713('0x21')](_0x484591,function(_0x27c851){return _0x27c851['contact']['email']===_0x56fd87;});}else{logger[_0x8713('0xc')](_0x8713('0x22'));return request({'uri':util[_0x8713('0x1f')](_0x8713('0x23'),_0x212cdf[_0x8713('0x1c')])})[_0x8713('0x20')](function(_0x1e2b2f){logger[_0x8713('0xc')](_0x8713('0x24'));return _0x1e2b2f;});}});}else{logger[_0x8713('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8713('0x1f')](_0x8713('0x23'),_0x212cdf[_0x8713('0x1c')])})['then'](function(_0x28123a){logger['info']('Admin\x20account\x20selected.');return _0x28123a;});}}function getEndUser(_0x5e0c02,_0x1de9b5,_0x5e006f){logger['info'](_0x8713('0x25'),_0x5e006f);return request({'uri':util[_0x8713('0x1f')](_0x8713('0x26'),_0x5e0c02[_0x8713('0x1c')]),'qs':{'phone':_0x5e006f}})[_0x8713('0x20')](function(_0x1be5f0){if(_0x1be5f0[_0x8713('0x27')]){logger[_0x8713('0xc')](_0x8713('0x28'));return _['find'](_0x1be5f0,{'phone':_0x5e006f});}else{logger[_0x8713('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x8713('0x1f')](_0x8713('0x26'),_0x5e0c02[_0x8713('0x1c')]),'method':_0x8713('0x29'),'body':{'name':_0x1de9b5,'phone':_0x5e006f}})[_0x8713('0x20')](function(_0x1fe791){logger[_0x8713('0xc')]('Enduser\x20created.');return _0x1fe791;});}});}function getAuth(_0xe99b76){return util[_0x8713('0x1f')](_0x8713('0x2a'),new Buffer(_0xe99b76['apiKey']+':X')['toString'](_0x8713('0x2b')));}function request(_0x12a055){logger[_0x8713('0x2c')]('[HTTP]',JSON[_0x8713('0x2d')](_0x12a055));return rp(_['defaults'](_0x12a055,{'method':_0x8713('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x153fba,_0x21a3fc){var _0x45c6b5=[];if(_0x153fba&&_0x153fba[_0x8713('0x27')]>0x0){_0x45c6b5=_[_0x8713('0x2f')](_0x153fba,_0x21a3fc);}return _0x45c6b5;}function getCustomFields(_0x37aea5,_0x27bb0d){var _0x18f90f=[];var _0x31cd8c={'custom_fields':[]};if(_0x37aea5[_0x8713('0x27')]>0x0){_[_0x8713('0x30')](_0x37aea5,function(_0x24e388){if(_['includes']([_0x8713('0x31'),_0x8713('0x32')],_0x24e388[_0x8713('0x33')])&&_0x24e388[_0x8713('0x34')]&&!_0x24e388[_0x8713('0x35')]){_0x31cd8c[_0x24e388[_0x8713('0x34')]['toLowerCase']()]=_0x24e388[_0x8713('0x36')]['toString']();}else if(_[_0x8713('0x37')](['string','picklist'],_0x24e388[_0x8713('0x33')])&&_0x24e388[_0x8713('0x38')]&&_0x24e388[_0x8713('0x35')]){_0x31cd8c[_0x8713('0x18')][_0x8713('0x39')]({'id':_0x24e388[_0x8713('0x38')],'value':_0x24e388[_0x8713('0x36')][_0x8713('0x3a')]()});}else if(_0x24e388['type']==='variable'&&_0x24e388['variableName']&&_0x24e388[_0x8713('0x38')]&&_0x24e388[_0x8713('0x35')]){_0x27bb0d[_0x24e388[_0x8713('0x3b')]]&&_0x31cd8c[_0x8713('0x18')][_0x8713('0x39')]({'id':_0x24e388[_0x8713('0x38')],'value':_0x27bb0d[_0x24e388[_0x8713('0x3b')]][_0x8713('0x3a')]()});}else if(_0x24e388[_0x8713('0x33')]===_0x8713('0x3c')&&_0x24e388['Variable']&&_0x24e388[_0x8713('0x3d')]['name']&&_0x24e388[_0x8713('0x38')]&&_0x24e388['customField']){_0x27bb0d[_0x24e388[_0x8713('0x3d')][_0x8713('0x16')]['toLowerCase']()]&&_0x31cd8c[_0x8713('0x18')][_0x8713('0x39')]({'id':_0x24e388[_0x8713('0x38')],'value':_0x27bb0d[_0x24e388[_0x8713('0x3d')]['name']['toLowerCase']()]['toString']()});}});}return _0x31cd8c;}exports[_0x8713('0x3e')]=function(_0x14dde2,_0x21c8fc,_0xdaf7b8,_0x43b79a,_0x3b9bde,_0x21a4ab){var _0x45c4cd,_0x1a68a5;_0x21a4ab[_0x8713('0x1c')]=intUtil[_0x8713('0x3f')](_0x21a4ab[_0x8713('0x1c')]);_0x21a4ab[_0x8713('0x40')]=intUtil[_0x8713('0x3f')](_0x21a4ab[_0x8713('0x40')]);if(_0x3b9bde&&_0x3b9bde[_0x8713('0x41')]){logger[_0x8713('0xc')](_0x8713('0x42'),_0x8713('0x43'));_0x21c8fc[_0x8713('0x44')]=util[_0x8713('0x1f')](_0x8713('0x45'),_0x21a4ab[_0x8713('0x40')],_0x21c8fc[_0x8713('0x46')],md5(_0x21c8fc[_0x8713('0x46')]));}else{_0x21c8fc[_0x8713('0x44')]='';}headers[_0x8713('0x47')]=getAuth(_0x21a4ab);return getUser(_0x21a4ab,_0x43b79a[_0x8713('0x48')])[_0x8713('0x20')](function(_0x11665e){_0x45c4cd=_0x11665e;logger[_0x8713('0xc')](_0x8713('0x49'),_0x45c4cd['id']);return getEndUser(_0x21a4ab,_0x21c8fc[_0x8713('0xf')],_0x21c8fc[_0x8713('0x10')]);})['then'](function(_0x46b905){_0x1a68a5=_0x46b905;logger['info'](_0x8713('0x4a'),_0x1a68a5['id']);return getTicket(_0x21a4ab,_0x45c4cd,_0x1a68a5,_0xdaf7b8,_0x21c8fc);})[_0x8713('0x20')](function(_0x2a4210){if(_0x2a4210&&_0x2a4210['id']){logger['info'](_0x8713('0x1d'));logger[_0x8713('0xc')](_0x8713('0x4b'),_0x2a4210['id']);logger[_0x8713('0xc')](_0x8713('0x42'),_0x8713('0x4c'));emit(util[_0x8713('0x1f')](_0x8713('0x4d'),_0x43b79a[_0x8713('0x16')]),'trigger:browser:url',{'uri':util[_0x8713('0x1f')](_0x8713('0x4e'),_0x21a4ab[_0x8713('0x1c')],_0x2a4210['id'])});}})[_0x8713('0x4f')](function(_0x173f42){logger[_0x8713('0x50')](_0x8713('0x42'),JSON['stringify'](_0x173f42));});};exports[_0x8713('0x51')]=function(_0x57e5cf,_0x2e3648,_0x12a62b,_0xac28a8,_0x38286b,_0x34e8dc,_0x5d6aa){var _0x30ba1d,_0x5e8822;_0x34e8dc[_0x8713('0x1c')]=intUtil['stripTrailingSlash'](_0x34e8dc[_0x8713('0x1c')]);_0x34e8dc[_0x8713('0x40')]=intUtil[_0x8713('0x3f')](_0x34e8dc[_0x8713('0x40')]);if(_0x5d6aa&&_0x5d6aa[_0x8713('0x52')]&&_0x5d6aa[_0x8713('0x52')]!=='none'){logger[_0x8713('0xc')](_0x8713('0x53'),_0x8713('0x43'));_0x2e3648[_0x8713('0x44')]=util[_0x8713('0x1f')](_0x8713('0x45'),_0x34e8dc[_0x8713('0x40')],_0x2e3648['uniqueid'],md5(_0x2e3648[_0x8713('0x46')]));}headers[_0x8713('0x47')]=getAuth(_0x34e8dc);return getUser(_0x34e8dc,_0xac28a8['email'])[_0x8713('0x20')](function(_0x2cea0d){_0x30ba1d=_0x2cea0d;logger[_0x8713('0xc')](_0x8713('0x49'),_0x30ba1d['id']);return getEndUser(_0x34e8dc,_0x2e3648['destcalleridname'],_0x2e3648['destcalleridnum']);})['then'](function(_0x55e34c){_0x5e8822=_0x55e34c;logger[_0x8713('0xc')](_0x8713('0x4a'),_0x5e8822['id']);return getTicket(_0x34e8dc,_0x30ba1d,_0x5e8822,_0x12a62b,_0x2e3648);})[_0x8713('0x20')](function(_0x573693){if(_0x573693&&_0x573693['id']){logger[_0x8713('0xc')]('Ticket\x20created!');logger['info'](_0x8713('0x4b'),_0x573693['id']);logger[_0x8713('0xc')](_0x8713('0x53'),_0x8713('0x4c'));emit(util[_0x8713('0x1f')](_0x8713('0x4d'),_0xac28a8[_0x8713('0x16')]),_0x8713('0x54'),{'uri':util[_0x8713('0x1f')]('%s/helpdesk/tickets/%d',_0x34e8dc[_0x8713('0x1c')],_0x573693['id'])});}})[_0x8713('0x4f')](function(_0xde7bcf){logger[_0x8713('0x50')](_0x8713('0x53'),JSON[_0x8713('0x2d')](_0xde7bcf));});};exports[_0x8713('0x55')]=function(_0x571a67,_0x24df63,_0x5d1346,_0x459864,_0x34fb4d,_0x4a1d16){var _0x3d7a9e,_0x4e76ba;_0x4a1d16[_0x8713('0x1c')]=intUtil['stripTrailingSlash'](_0x4a1d16[_0x8713('0x1c')]);_0x4a1d16[_0x8713('0x40')]=intUtil[_0x8713('0x3f')](_0x4a1d16[_0x8713('0x40')]);if(_0x34fb4d&&_0x34fb4d['monitor_format']){logger[_0x8713('0xc')]('['+_0x24df63['lastevent'][_0x8713('0x56')]()+']',_0x8713('0x43'));_0x24df63[_0x8713('0x44')]=util[_0x8713('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a1d16[_0x8713('0x40')],_0x24df63[_0x8713('0x46')],md5(_0x24df63[_0x8713('0x46')]));}else{_0x24df63['recordingURL']='';}headers[_0x8713('0x47')]=getAuth(_0x4a1d16);return getUser(_0x4a1d16,'')[_0x8713('0x20')](function(_0x193a64){_0x3d7a9e=_0x193a64;logger[_0x8713('0xc')](_0x8713('0x49'),_0x3d7a9e['id']);return getEndUser(_0x4a1d16,_0x24df63[_0x8713('0xf')],_0x24df63['calleridnum']);})[_0x8713('0x20')](function(_0x34ee6d){_0x4e76ba=_0x34ee6d;logger['info'](_0x8713('0x4a'),_0x4e76ba['id']);return getTicket(_0x4a1d16,_0x3d7a9e,_0x4e76ba,_0x5d1346,_0x24df63);})[_0x8713('0x20')](function(_0x4d246e){if(_0x4d246e){logger[_0x8713('0xc')](_0x8713('0x1d'));logger[_0x8713('0xc')](_0x8713('0x4b'),_0x4d246e['id']);}})[_0x8713('0x4f')](function(_0xb07d81){logger[_0x8713('0x50')]('['+_0x24df63[_0x8713('0x57')][_0x8713('0x56')]()+']',JSON[_0x8713('0x2d')](_0xb07d81));});};
\ No newline at end of file
+var _0x09a4=['stringify','GET','map','forEach','includes','string','picklist','nameField','customField','type','idField','push','content','variable','variableName','customVariable','toLowerCase','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:browser:url','error','unmanaged','lastevent','Recording\x20is\x20enabled!','toUpperCase','lodash','md5','util','ioredis','./util','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','Descriptions','<br>','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]'];(function(_0x117ea1,_0x5b6c83){var _0x4d9ac0=function(_0x3e3c1d){while(--_0x3e3c1d){_0x117ea1['push'](_0x117ea1['shift']());}};_0x4d9ac0(++_0x5b6c83);}(_0x09a4,0x1b3));var _0x409a=function(_0x20ce66,_0x28ba32){_0x20ce66=_0x20ce66-0x0;var _0x289dee=_0x09a4[_0x20ce66];return _0x289dee;};'use strict';var _=require(_0x409a('0x0'));var rp=require('request-promise');var md5=require(_0x409a('0x1'));var util=require(_0x409a('0x2'));var Redis=require(_0x409a('0x3'));var intUtil=require(_0x409a('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x409a('0x5'));config[_0x409a('0x6')]=_[_0x409a('0x7')](config['redis'],{'host':_0x409a('0x8'),'port':0x18eb});var io=require(_0x409a('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x409a('0xa'),'Accept':_0x409a('0xa')};function emit(_0x3634bf,_0x417448,_0x56f834){io['to'](_0x3634bf)[_0x409a('0xb')](_0x417448,_0x56f834);}function getTicket(_0x22f4b5,_0x1701bb,_0x585885,_0x1c6c72,_0xee697b){logger[_0x409a('0xc')](_0x409a('0xd'));var _0x445114=_[_0x409a('0xe')]({'responder_id':_0x1701bb['id'],'requester_id':_0x585885['id'],'name':util[_0x409a('0xf')]('Caller\x20-\x20%s',_0xee697b['calleridname']),'phone':_0xee697b[_0x409a('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x409a('0x11')](_0x1c6c72[_0x409a('0x12')],_0xee697b,'\x20'),'description':intUtil['getString'](_0x1c6c72[_0x409a('0x13')],_0xee697b,_0x409a('0x14')),'tags':getTags(_0x1c6c72[_0x409a('0x15')],_0x409a('0x16'))},getCustomFields(_0x1c6c72[_0x409a('0x17')],_0xee697b));_0x445114[_0x409a('0x18')]=_['mapValues'](_[_0x409a('0x19')](_0x445114[_0x409a('0x18')],'id'),_0x409a('0x1a'));return request({'uri':util[_0x409a('0xf')](_0x409a('0x1b'),_0x22f4b5[_0x409a('0x1c')]),'method':_0x409a('0x1d'),'body':_0x445114})[_0x409a('0x1e')](function(_0x39231d){logger[_0x409a('0xc')](_0x409a('0x1f'));return _0x39231d;});}function getUser(_0x35398d,_0x1c9eca){if(intUtil[_0x409a('0x20')](_0x1c9eca)){return request({'uri':util['format'](_0x409a('0x21'),_0x35398d['remoteUri']),'qs':{'email':_0x1c9eca}})[_0x409a('0x1e')](function(_0x42e4d5){if(_0x42e4d5[_0x409a('0x22')]){logger[_0x409a('0xc')](_0x409a('0x23'));return _[_0x409a('0x24')](_0x42e4d5,function(_0x5b4daf){return _0x5b4daf[_0x409a('0x25')]['email']===_0x1c9eca;});}else{logger[_0x409a('0xc')](_0x409a('0x26'));return request({'uri':util[_0x409a('0xf')](_0x409a('0x27'),_0x35398d[_0x409a('0x1c')])})[_0x409a('0x1e')](function(_0x3ef24b){logger[_0x409a('0xc')](_0x409a('0x28'));return _0x3ef24b;});}});}else{logger[_0x409a('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x409a('0xf')](_0x409a('0x27'),_0x35398d[_0x409a('0x1c')])})[_0x409a('0x1e')](function(_0xc2db9){logger[_0x409a('0xc')](_0x409a('0x28'));return _0xc2db9;});}}function getEndUser(_0x5bcc60,_0x1ed6da,_0x3c79d7){logger['info'](_0x409a('0x29'),_0x3c79d7);return request({'uri':util[_0x409a('0xf')](_0x409a('0x2a'),_0x5bcc60[_0x409a('0x1c')]),'qs':{'phone':_0x3c79d7}})[_0x409a('0x1e')](function(_0x47dc17){if(_0x47dc17[_0x409a('0x22')]){logger[_0x409a('0xc')](_0x409a('0x2b'));return _['find'](_0x47dc17,{'phone':_0x3c79d7});}else{logger[_0x409a('0xc')](_0x409a('0x2c'));return request({'uri':util[_0x409a('0xf')](_0x409a('0x2a'),_0x5bcc60[_0x409a('0x1c')]),'method':_0x409a('0x1d'),'body':{'name':_0x1ed6da,'phone':_0x3c79d7}})[_0x409a('0x1e')](function(_0x1d0c41){logger['info'](_0x409a('0x2d'));return _0x1d0c41;});}});}function getAuth(_0x2c736a){return util[_0x409a('0xf')](_0x409a('0x2e'),new Buffer(_0x2c736a['apiKey']+':X')[_0x409a('0x2f')](_0x409a('0x30')));}function request(_0x22abd6){logger['debug'](_0x409a('0x31'),JSON[_0x409a('0x32')](_0x22abd6));return rp(_[_0x409a('0x7')](_0x22abd6,{'method':_0x409a('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x14c24c,_0x4eabb3){var _0x39091d=[];if(_0x14c24c&&_0x14c24c[_0x409a('0x22')]>0x0){_0x39091d=_[_0x409a('0x34')](_0x14c24c,_0x4eabb3);}return _0x39091d;}function getCustomFields(_0x273274,_0x25f5ec){var _0x20753f=[];var _0x33e760={'custom_fields':[]};if(_0x273274['length']>0x0){_[_0x409a('0x35')](_0x273274,function(_0xa0508a){if(_[_0x409a('0x36')]([_0x409a('0x37'),_0x409a('0x38')],_0xa0508a['type'])&&_0xa0508a[_0x409a('0x39')]&&!_0xa0508a[_0x409a('0x3a')]){_0x33e760[_0xa0508a[_0x409a('0x39')]['toLowerCase']()]=_0xa0508a['content'][_0x409a('0x2f')]();}else if(_['includes']([_0x409a('0x37'),'picklist'],_0xa0508a[_0x409a('0x3b')])&&_0xa0508a[_0x409a('0x3c')]&&_0xa0508a['customField']){_0x33e760[_0x409a('0x18')][_0x409a('0x3d')]({'id':_0xa0508a[_0x409a('0x3c')],'value':_0xa0508a[_0x409a('0x3e')][_0x409a('0x2f')]()});}else if(_0xa0508a['type']===_0x409a('0x3f')&&_0xa0508a['variableName']&&_0xa0508a['idField']&&_0xa0508a[_0x409a('0x3a')]){_0x25f5ec[_0xa0508a[_0x409a('0x40')]]&&_0x33e760[_0x409a('0x18')][_0x409a('0x3d')]({'id':_0xa0508a[_0x409a('0x3c')],'value':_0x25f5ec[_0xa0508a[_0x409a('0x40')]][_0x409a('0x2f')]()});}else if(_0xa0508a[_0x409a('0x3b')]===_0x409a('0x41')&&_0xa0508a['Variable']&&_0xa0508a['Variable']['name']&&_0xa0508a[_0x409a('0x3c')]&&_0xa0508a[_0x409a('0x3a')]){_0x25f5ec[_0xa0508a['Variable'][_0x409a('0x16')][_0x409a('0x42')]()]&&_0x33e760[_0x409a('0x18')]['push']({'id':_0xa0508a['idField'],'value':_0x25f5ec[_0xa0508a[_0x409a('0x43')][_0x409a('0x16')][_0x409a('0x42')]()][_0x409a('0x2f')]()});}});}return _0x33e760;}exports[_0x409a('0x44')]=function(_0x3d6112,_0x8485fd,_0x17d459,_0x2238f3,_0x186de8,_0x204c48){var _0x439ec6,_0x4112b4;_0x204c48[_0x409a('0x1c')]=intUtil[_0x409a('0x45')](_0x204c48[_0x409a('0x1c')]);_0x204c48[_0x409a('0x46')]=intUtil[_0x409a('0x45')](_0x204c48[_0x409a('0x46')]);if(_0x186de8&&_0x186de8[_0x409a('0x47')]){logger[_0x409a('0xc')](_0x409a('0x48'),'Recording\x20is\x20enabled!');_0x8485fd[_0x409a('0x49')]=util[_0x409a('0xf')](_0x409a('0x4a'),_0x204c48[_0x409a('0x46')],_0x8485fd[_0x409a('0x4b')],md5(_0x8485fd[_0x409a('0x4b')]));}else{_0x8485fd['recordingURL']='';}headers[_0x409a('0x4c')]=getAuth(_0x204c48);return getUser(_0x204c48,_0x2238f3[_0x409a('0x4d')])[_0x409a('0x1e')](function(_0x507f3c){_0x439ec6=_0x507f3c;logger[_0x409a('0xc')]('The\x20User\x20ID\x20is:',_0x439ec6['id']);return getEndUser(_0x204c48,_0x8485fd[_0x409a('0x4e')],_0x8485fd[_0x409a('0x10')]);})[_0x409a('0x1e')](function(_0x194119){_0x4112b4=_0x194119;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4112b4['id']);return getTicket(_0x204c48,_0x439ec6,_0x4112b4,_0x17d459,_0x8485fd);})[_0x409a('0x1e')](function(_0x1a52eb){if(_0x1a52eb&&_0x1a52eb['id']){logger['info'](_0x409a('0x1f'));logger[_0x409a('0xc')](_0x409a('0x4f'),_0x1a52eb['id']);logger['info']('[QUEUE]',_0x409a('0x50'));emit(util[_0x409a('0xf')](_0x409a('0x51'),_0x2238f3[_0x409a('0x16')]),'trigger:browser:url',{'uri':util[_0x409a('0xf')](_0x409a('0x52'),_0x204c48['remoteUri'],_0x1a52eb['id'])});}})[_0x409a('0x53')](function(_0x3c0e45){logger['error']('[QUEUE]',JSON[_0x409a('0x32')](_0x3c0e45));});};exports[_0x409a('0x54')]=function(_0x40671a,_0x546779,_0x2b4454,_0x4423b8,_0x16b29a,_0x18f9b4,_0xebc0){var _0x357a55,_0x3b6f37;_0x18f9b4['remoteUri']=intUtil['stripTrailingSlash'](_0x18f9b4[_0x409a('0x1c')]);_0x18f9b4['serverUrl']=intUtil[_0x409a('0x45')](_0x18f9b4[_0x409a('0x46')]);if(_0xebc0&&_0xebc0[_0x409a('0x55')]&&_0xebc0[_0x409a('0x55')]!==_0x409a('0x56')){logger[_0x409a('0xc')](_0x409a('0x57'),'Recording\x20is\x20enabled!');_0x546779[_0x409a('0x49')]=util[_0x409a('0xf')](_0x409a('0x4a'),_0x18f9b4[_0x409a('0x46')],_0x546779[_0x409a('0x4b')],md5(_0x546779[_0x409a('0x4b')]));}headers[_0x409a('0x4c')]=getAuth(_0x18f9b4);return getUser(_0x18f9b4,_0x4423b8[_0x409a('0x4d')])[_0x409a('0x1e')](function(_0xf392a6){_0x357a55=_0xf392a6;logger['info'](_0x409a('0x58'),_0x357a55['id']);return getEndUser(_0x18f9b4,_0x546779['destcalleridname'],_0x546779[_0x409a('0x59')]);})[_0x409a('0x1e')](function(_0x2ae656){_0x3b6f37=_0x2ae656;logger[_0x409a('0xc')](_0x409a('0x5a'),_0x3b6f37['id']);return getTicket(_0x18f9b4,_0x357a55,_0x3b6f37,_0x2b4454,_0x546779);})[_0x409a('0x1e')](function(_0x16e82a){if(_0x16e82a&&_0x16e82a['id']){logger[_0x409a('0xc')]('Ticket\x20created!');logger['info'](_0x409a('0x4f'),_0x16e82a['id']);logger['info'](_0x409a('0x57'),_0x409a('0x50'));emit(util[_0x409a('0xf')](_0x409a('0x51'),_0x4423b8['name']),_0x409a('0x5b'),{'uri':util['format'](_0x409a('0x52'),_0x18f9b4['remoteUri'],_0x16e82a['id'])});}})['catch'](function(_0x3ff27e){logger[_0x409a('0x5c')](_0x409a('0x57'),JSON['stringify'](_0x3ff27e));});};exports[_0x409a('0x5d')]=function(_0x900e68,_0x2b5987,_0x706a70,_0x3754e5,_0x22d238,_0x26b701){var _0x240774,_0x1b7e3a;_0x26b701[_0x409a('0x1c')]=intUtil[_0x409a('0x45')](_0x26b701[_0x409a('0x1c')]);_0x26b701[_0x409a('0x46')]=intUtil['stripTrailingSlash'](_0x26b701[_0x409a('0x46')]);if(_0x22d238&&_0x22d238[_0x409a('0x47')]){logger[_0x409a('0xc')]('['+_0x2b5987[_0x409a('0x5e')]['toUpperCase']()+']',_0x409a('0x5f'));_0x2b5987[_0x409a('0x49')]=util[_0x409a('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26b701[_0x409a('0x46')],_0x2b5987[_0x409a('0x4b')],md5(_0x2b5987[_0x409a('0x4b')]));}else{_0x2b5987[_0x409a('0x49')]='';}headers[_0x409a('0x4c')]=getAuth(_0x26b701);return getUser(_0x26b701,'')[_0x409a('0x1e')](function(_0x163d5b){_0x240774=_0x163d5b;logger[_0x409a('0xc')]('The\x20User\x20ID\x20is:',_0x240774['id']);return getEndUser(_0x26b701,_0x2b5987[_0x409a('0x4e')],_0x2b5987[_0x409a('0x10')]);})[_0x409a('0x1e')](function(_0x53b24e){_0x1b7e3a=_0x53b24e;logger[_0x409a('0xc')](_0x409a('0x5a'),_0x1b7e3a['id']);return getTicket(_0x26b701,_0x240774,_0x1b7e3a,_0x706a70,_0x2b5987);})[_0x409a('0x1e')](function(_0x577d1a){if(_0x577d1a){logger[_0x409a('0xc')](_0x409a('0x1f'));logger[_0x409a('0xc')](_0x409a('0x4f'),_0x577d1a['id']);}})[_0x409a('0x53')](function(_0x521466){logger['error']('['+_0x2b5987[_0x409a('0x5e')][_0x409a('0x60')]()+']',JSON[_0x409a('0x32')](_0x521466));});};
\ No newline at end of file
index 4e34d3a..85c24e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf919=['POST','/api/tasks','getString','Descriptions','adminId','Contact','ticketId','task','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','unmanaged','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','message','Getting\x20user\x20list','agentEmail','userId','userEmail','adminEmail','toUpperCase','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','error','Creating\x20new\x20task'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xf919,0xb4));var _0x9f91=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0xf919[_0x1f239e];return _0x826971;};'use strict';var _=require(_0x9f91('0x0'));var rp=require(_0x9f91('0x1'));var md5=require(_0x9f91('0x2'));var util=require(_0x9f91('0x3'));var moment=require(_0x9f91('0x4'));var Promise=require(_0x9f91('0x5'));var Redis=require(_0x9f91('0x6'));var intUtil=require('./util');var config=require(_0x9f91('0x7'));var logger=require('../../../../config/logger')(_0x9f91('0x8'));config[_0x9f91('0x9')]=_['defaults'](config[_0x9f91('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x9f91('0xa'))(new Redis(config[_0x9f91('0x9')]));function getAdminId(_0x2c500c,_0x5bf16f,_0x4d4a25,_0x2e73f8){return new Promise(function(_0x394a28,_0x5632e4){var _0x28f646=![];var _0x4557ca={'method':_0x9f91('0xb'),'uri':_0x2e73f8+_0x9f91('0xc'),'json':!![]};_0x4557ca[_0x9f91('0xd')]=_0x4d4a25;logger[_0x9f91('0xe')](_0x9f91('0xf'));return rp(_0x4557ca)[_0x9f91('0x10')](function(_0x185031){if(_0x185031){var _0x3fa773=_0x185031[_0x9f91('0x11')];var _0x5e0515=null;for(_0x5e0515=0x0;_0x5e0515<_0x3fa773[_0x9f91('0x12')];_0x5e0515++){if(_0x3fa773[_0x5e0515]['email']===_0x2c500c['adminEmail']){_0x2c500c['adminId']=_0x3fa773[_0x5e0515]['id'];_0x28f646=!![];}}if(_0x28f646){logger[_0x9f91('0xe')](_0x9f91('0x13'),_0x2c500c['adminId']);_0x394a28(_0x2c500c);}else{_0x5632e4({'statusCode':0x194,'message':_0x9f91('0x14')});}}else{_0x5632e4({'statusCode':0x194,'message':_0x9f91('0x14')});}})[_0x9f91('0x15')](function(_0x5636ac){logger['error']('['+[_0x5bf16f['toUpperCase']()]+']',_0x5636ac[_0x9f91('0x16')]);_0x5632e4(_0x5636ac);});});}function getUser(_0x1d5097,_0x4410f3,_0x4c515a){return function(_0x1e883d){return new Promise(function(_0x183eb3,_0x4337a3){var _0x3de18f={'method':'GET','uri':_0x4c515a+_0x9f91('0xc'),'json':!![]};_0x3de18f['headers']=_0x4410f3;logger[_0x9f91('0xe')](_0x9f91('0x17'));return rp(_0x3de18f)[_0x9f91('0x10')](function(_0x482600){if(_0x482600){var _0x1b4ba1=_0x482600[_0x9f91('0x11')];var _0xdf826=![];var _0x250bd0=null;if(_0x1e883d[_0x9f91('0x18')]!==null){logger[_0x9f91('0xe')]('Getting\x20user\x20with\x20email',_0x1e883d[_0x9f91('0x18')]);_0x1e883d['userEmail']=_0x1e883d[_0x9f91('0x18')];for(_0x250bd0=0x0;_0x250bd0<_0x1b4ba1[_0x9f91('0x12')];_0x250bd0++){if(_0x1b4ba1[_0x250bd0]['email']===_0x1e883d[_0x9f91('0x18')]){_0xdf826=!![];_0x1e883d[_0x9f91('0x19')]=_0x1b4ba1[_0x250bd0]['id'];logger['info']('User\x20found:',_0x1e883d[_0x9f91('0x19')]);}}}if(!_0xdf826){logger['info']('Admin\x20selected');_0x1e883d[_0x9f91('0x1a')]=_0x1e883d[_0x9f91('0x1b')];_0x1e883d[_0x9f91('0x19')]=_0x1e883d['adminId'];_0xdf826=!![];}if(_0xdf826){_0x183eb3(_0x1e883d);}else{_0x4337a3({'statusCode':0x194,'message':_0x9f91('0x14')});}}else{_0x4337a3({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4a1f7d){logger['error']('['+[_0x1d5097[_0x9f91('0x1c')]()]+']',_0x4a1f7d[_0x9f91('0x16')]);_0x4337a3(_0x4a1f7d);});});};}function searchContact(_0x25fd4a,_0x443dd7,_0x1b35d8,_0x240751){return new Promise(function(_0x48af06,_0x62b43c){var _0x66c335={'method':_0x9f91('0xb'),'headers':_0x443dd7,'uri':_0x25fd4a+'/api/lookup?q='+_0x240751+_0x9f91('0x1d')+_0x1b35d8+'&entities=contact','json':!![]};rp(_0x66c335)[_0x9f91('0x10')](function(_0x4998ff){var _0x4be87b=_[_0x9f91('0x1e')](_0x4998ff[_0x9f91('0x1f')][_0x9f91('0x1f')],[_0x1b35d8,_0x240751]);_0x48af06(_0x4be87b);})['catch'](function(_0x5ca6a7){_0x62b43c(_0x5ca6a7);});});}function getEndUser(_0x27e3f2,_0x2cea9c,_0x2618c1){return function(_0x300bce){return new Promise(function(_0x3e81aa,_0xf7b32){logger[_0x9f91('0xe')](util[_0x9f91('0x20')](_0x9f91('0x21'),_0x300bce[_0x9f91('0x22')]));searchContact(_0x2618c1,_0x2cea9c,_0x9f91('0x23'),_0x300bce[_0x9f91('0x22')])[_0x9f91('0x10')](function(_0x537c7e){if(_0x537c7e){_0x300bce[_0x9f91('0x24')]=_0x537c7e['id'];logger['info'](_0x9f91('0x25'),_0x300bce['endUserId']);return _0x3e81aa(_0x300bce);}searchContact(_0x2618c1,_0x2cea9c,_0x9f91('0x26'),_0x300bce[_0x9f91('0x22')])[_0x9f91('0x10')](function(_0x51f4a9){if(_0x51f4a9){_0x300bce[_0x9f91('0x24')]=_0x51f4a9['id'];logger[_0x9f91('0xe')](_0x9f91('0x27'),_0x300bce[_0x9f91('0x24')]);return _0x3e81aa(_0x300bce);}createEndUser(_0x300bce,_0x27e3f2,_0x2cea9c,_0x2618c1)['then'](function(_0x187812){logger[_0x9f91('0xe')]('Contact\x20created:',_0x187812['endUserId']);return _0x3e81aa(_0x187812);});});})['catch'](function(_0x42e9d9){_0xf7b32(_0x42e9d9);});});};}function createEndUser(_0x174108,_0x4cc55d,_0x476c54,_0x1de21e){return new Promise(function(_0x52acd1,_0x348674){var _0x491f46=moment();var _0x4e6524={'method':'POST','uri':_0x1de21e+_0x9f91('0x28'),'body':{'contact':{'last_name':_0x174108[_0x9f91('0x22')],'work_number':_0x174108[_0x9f91('0x22')],'mobile_number':_0x174108[_0x9f91('0x22')],'owner_id':_0x174108[_0x9f91('0x19')],'created_at':_0x491f46[_0x9f91('0x20')](_0x9f91('0x29'))}},'json':!![]};_0x4e6524['headers']=_0x476c54;logger[_0x9f91('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x4e6524)[_0x9f91('0x10')](function(_0x3c665a){_0x174108[_0x9f91('0x24')]=_0x3c665a[_0x9f91('0x2a')]['id'];_0x52acd1(_0x174108);})[_0x9f91('0x15')](function(_0x5a443c){logger[_0x9f91('0x2b')]('['+[_0x4cc55d[_0x9f91('0x1c')]()]+']',_0x5a443c['message']);_0x348674(_0x5a443c[_0x9f91('0x16')]);});});}function getTicket(_0x76dc94,_0x5842c1,_0x5e9eb4,_0x1e81d4,_0x1bb7a1){return function(_0x1e922a){logger[_0x9f91('0xe')](_0x9f91('0x2c'));return new Promise(function(_0x279acf,_0x4f7a52){var _0x4df2a7=moment();var _0x48be44={'method':_0x9f91('0x2d'),'uri':_0x5e9eb4+_0x9f91('0x2e'),'body':{'title':intUtil['getString'](_0x1e81d4['Subjects'],_0x1bb7a1,'\x20'),'description':intUtil[_0x9f91('0x2f')](_0x1e81d4[_0x9f91('0x30')],_0x1bb7a1,'\x0a'),'owner_id':_0x1e922a['userId'],'creater_id':_0x1e922a[_0x9f91('0x31')],'targetable_id':_0x1e922a[_0x9f91('0x24')],'targetable_type':_0x9f91('0x32'),'created_at':_0x4df2a7[_0x9f91('0x20')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4df2a7['add'](0x1e,'m')[_0x9f91('0x20')](_0x9f91('0x29'))},'json':!![]};_0x48be44[_0x9f91('0xd')]=_0x5842c1;return rp(_0x48be44)['then'](function(_0x30f177){_0x1e922a[_0x9f91('0x33')]=_0x30f177[_0x9f91('0x34')]['id'];logger[_0x9f91('0xe')](_0x9f91('0x35'),_0x1e922a[_0x9f91('0x33')]);_0x279acf(_0x1e922a);})['catch'](function(_0x3446b3){logger['error']('['+[_0x76dc94['toUpperCase']()]+']',_0x3446b3[_0x9f91('0x16')]);_0x4f7a52(_0x3446b3[_0x9f91('0x16')]);});});};}function emit(_0x2a3728,_0x292c61,_0xe88432){var _0x3f89b9={'uri':_0x2a3728+'/contacts/'+_0xe88432};io['to'](util[_0x9f91('0x20')](_0x9f91('0x36'),_0x292c61))['emit'](_0x9f91('0x37'),_0x3f89b9);}exports['cs']=function(_0x440314,_0x3bddf2,_0x5d7197,_0x266503,_0x363057,_0x19c946,_0x1fbc4c,_0x130d2a){var _0xfe11fd={};var _0x5a15cf={'Authorization':_0x9f91('0x38')+_0x19c946['apiKey']};_0x19c946[_0x9f91('0x39')]=intUtil['stripTrailingSlash'](_0x19c946[_0x9f91('0x39')]);_0x19c946['serverUrl']=intUtil[_0x9f91('0x3a')](_0x19c946[_0x9f91('0x3b')]);var _0x4f2616=_0x19c946[_0x9f91('0x39')];_0xfe11fd[_0x9f91('0x1b')]=_0x19c946['username'];_0xfe11fd[_0x9f91('0x22')]=_0x130d2a[_0x9f91('0x3c')]()===_0x9f91('0x3d')?_0x3bddf2['destcalleridnum']:_0x3bddf2['calleridnum'];_0xfe11fd['callDirection']=_0x130d2a==='queue'||_0x130d2a===_0x9f91('0x3e')?'queue':'outbound';if(_0x266503){_0xfe11fd['agentEmail']=_0x266503[_0x9f91('0x3f')];}var _0x45d8e8=util[_0x9f91('0x20')](_0x9f91('0x40'),_0x19c946[_0x9f91('0x3b')],_0x3bddf2['uniqueid'],md5(_0x3bddf2['uniqueid']));if(_0x363057&&_0x363057['monitor_format']){logger['info']('[QUEUE]',_0x9f91('0x41'));_0x3bddf2[_0x9f91('0x42')]=_0x45d8e8;}else if(_0x1fbc4c&&_0x1fbc4c[_0x9f91('0x43')]&&_0x1fbc4c[_0x9f91('0x43')]!==_0x9f91('0x44')){logger['info'](_0x9f91('0x45'),_0x9f91('0x41'));_0x3bddf2[_0x9f91('0x42')]=_0x45d8e8;}else{_0x3bddf2['recordingURL']='';}return getAdminId(_0xfe11fd,_0x130d2a,_0x5a15cf,_0x4f2616)[_0x9f91('0x10')](getUser(_0x130d2a,_0x5a15cf,_0x4f2616))[_0x9f91('0x10')](getEndUser(_0x130d2a,_0x5a15cf,_0x4f2616))['then'](getTicket(_0x130d2a,_0x5a15cf,_0x4f2616,_0x5d7197,_0x3bddf2))['then'](function(_0x25bf8d){logger[_0x9f91('0xe')](util[_0x9f91('0x20')](_0x9f91('0x46'),_0x25bf8d[_0x9f91('0x33')]));if(_0x130d2a!=='unmanaged'){logger[_0x9f91('0xe')]('['+[_0x130d2a[_0x9f91('0x1c')]()]+']',_0x9f91('0x47'));emit(_0x4f2616,_0x266503[_0x9f91('0x48')],_0x25bf8d[_0x9f91('0x24')]);}})[_0x9f91('0x15')](function(_0x2194b9){logger[_0x9f91('0x2b')]('['+[_0x130d2a[_0x9f91('0x1c')]()]+_0x9f91('0x49'),util[_0x9f91('0x4a')](_0x2194b9,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xe506=['headers','info','Getting\x20admin\x20information','users','length','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','Admin\x20selected','adminEmail','toUpperCase','/api/lookup?q=','&f=','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Contact','format','add','YYYY-MM-DDTHH:mm:ss','ticketId','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','util','moment','bluebird','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners'];(function(_0x505b9d,_0x14bcf4){var _0x491990=function(_0x4c544){while(--_0x4c544){_0x505b9d['push'](_0x505b9d['shift']());}};_0x491990(++_0x14bcf4);}(_0xe506,0x1e0));var _0x6e50=function(_0x491eac,_0x1c27d1){_0x491eac=_0x491eac-0x0;var _0xebf9eb=_0xe506[_0x491eac];return _0xebf9eb;};'use strict';var _=require(_0x6e50('0x0'));var rp=require(_0x6e50('0x1'));var md5=require('md5');var util=require(_0x6e50('0x2'));var moment=require(_0x6e50('0x3'));var Promise=require(_0x6e50('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x6e50('0x5'));var logger=require(_0x6e50('0x6'))(_0x6e50('0x7'));config[_0x6e50('0x8')]=_['defaults'](config[_0x6e50('0x8')],{'host':_0x6e50('0x9'),'port':0x18eb});var io=require(_0x6e50('0xa'))(new Redis(config['redis']));function getAdminId(_0x36e417,_0x47ac84,_0x57f926,_0x5b9fb0){return new Promise(function(_0x4d468d,_0x28c09b){var _0x40ea62=![];var _0x3e1b72={'method':'GET','uri':_0x5b9fb0+_0x6e50('0xb'),'json':!![]};_0x3e1b72[_0x6e50('0xc')]=_0x57f926;logger[_0x6e50('0xd')](_0x6e50('0xe'));return rp(_0x3e1b72)['then'](function(_0x2f602b){if(_0x2f602b){var _0xf490d0=_0x2f602b[_0x6e50('0xf')];var _0x19c731=null;for(_0x19c731=0x0;_0x19c731<_0xf490d0[_0x6e50('0x10')];_0x19c731++){if(_0xf490d0[_0x19c731][_0x6e50('0x11')]===_0x36e417['adminEmail']){_0x36e417['adminId']=_0xf490d0[_0x19c731]['id'];_0x40ea62=!![];}}if(_0x40ea62){logger[_0x6e50('0xd')](_0x6e50('0x12'),_0x36e417[_0x6e50('0x13')]);_0x4d468d(_0x36e417);}else{_0x28c09b({'statusCode':0x194,'message':_0x6e50('0x14')});}}else{_0x28c09b({'statusCode':0x194,'message':_0x6e50('0x14')});}})[_0x6e50('0x15')](function(_0x1e8035){logger[_0x6e50('0x16')]('['+[_0x47ac84['toUpperCase']()]+']',_0x1e8035[_0x6e50('0x17')]);_0x28c09b(_0x1e8035);});});}function getUser(_0x2d9078,_0x1631b3,_0x2fd0f0){return function(_0x45a0bd){return new Promise(function(_0x2fa6f4,_0x4446c3){var _0x3705c3={'method':_0x6e50('0x18'),'uri':_0x2fd0f0+_0x6e50('0xb'),'json':!![]};_0x3705c3[_0x6e50('0xc')]=_0x1631b3;logger[_0x6e50('0xd')](_0x6e50('0x19'));return rp(_0x3705c3)[_0x6e50('0x1a')](function(_0x15faf2){if(_0x15faf2){var _0x2651a8=_0x15faf2['users'];var _0xfe53cb=![];var _0x42b25b=null;if(_0x45a0bd[_0x6e50('0x1b')]!==null){logger[_0x6e50('0xd')](_0x6e50('0x1c'),_0x45a0bd['agentEmail']);_0x45a0bd['userEmail']=_0x45a0bd[_0x6e50('0x1b')];for(_0x42b25b=0x0;_0x42b25b<_0x2651a8['length'];_0x42b25b++){if(_0x2651a8[_0x42b25b][_0x6e50('0x11')]===_0x45a0bd[_0x6e50('0x1b')]){_0xfe53cb=!![];_0x45a0bd['userId']=_0x2651a8[_0x42b25b]['id'];logger[_0x6e50('0xd')](_0x6e50('0x1d'),_0x45a0bd[_0x6e50('0x1e')]);}}}if(!_0xfe53cb){logger[_0x6e50('0xd')](_0x6e50('0x1f'));_0x45a0bd['userEmail']=_0x45a0bd[_0x6e50('0x20')];_0x45a0bd[_0x6e50('0x1e')]=_0x45a0bd[_0x6e50('0x13')];_0xfe53cb=!![];}if(_0xfe53cb){_0x2fa6f4(_0x45a0bd);}else{_0x4446c3({'statusCode':0x194,'message':_0x6e50('0x14')});}}else{_0x4446c3({'statusCode':0x194,'message':_0x6e50('0x14')});}})[_0x6e50('0x15')](function(_0x1f480d){logger[_0x6e50('0x16')]('['+[_0x2d9078[_0x6e50('0x21')]()]+']',_0x1f480d[_0x6e50('0x17')]);_0x4446c3(_0x1f480d);});});};}function searchContact(_0x85bbe2,_0x572af5,_0x15088f,_0x28aeb8){return new Promise(function(_0x5bf21b,_0x2b95cc){var _0x21fca9={'method':_0x6e50('0x18'),'headers':_0x572af5,'uri':_0x85bbe2+_0x6e50('0x22')+_0x28aeb8+_0x6e50('0x23')+_0x15088f+'&entities=contact','json':!![]};rp(_0x21fca9)['then'](function(_0x290bc1){var _0x2ff14f=_['find'](_0x290bc1['contacts'][_0x6e50('0x24')],[_0x15088f,_0x28aeb8]);_0x5bf21b(_0x2ff14f);})['catch'](function(_0x25d5c9){_0x2b95cc(_0x25d5c9);});});}function getEndUser(_0xc0710c,_0x364a33,_0x51fd90){return function(_0x431a51){return new Promise(function(_0x16fe94,_0x114da0){logger[_0x6e50('0xd')](util['format'](_0x6e50('0x25'),_0x431a51[_0x6e50('0x26')]));searchContact(_0x51fd90,_0x364a33,_0x6e50('0x27'),_0x431a51[_0x6e50('0x26')])[_0x6e50('0x1a')](function(_0x10b01d){if(_0x10b01d){_0x431a51[_0x6e50('0x28')]=_0x10b01d['id'];logger[_0x6e50('0xd')](_0x6e50('0x29'),_0x431a51[_0x6e50('0x28')]);return _0x16fe94(_0x431a51);}searchContact(_0x51fd90,_0x364a33,_0x6e50('0x2a'),_0x431a51['contactNumber'])[_0x6e50('0x1a')](function(_0x1285c1){if(_0x1285c1){_0x431a51[_0x6e50('0x28')]=_0x1285c1['id'];logger[_0x6e50('0xd')]('Contact\x20found\x20work_number:',_0x431a51[_0x6e50('0x28')]);return _0x16fe94(_0x431a51);}createEndUser(_0x431a51,_0xc0710c,_0x364a33,_0x51fd90)[_0x6e50('0x1a')](function(_0x242ad9){logger[_0x6e50('0xd')](_0x6e50('0x2b'),_0x242ad9['endUserId']);return _0x16fe94(_0x242ad9);});});})[_0x6e50('0x15')](function(_0x1ab714){_0x114da0(_0x1ab714);});});};}function createEndUser(_0x579e57,_0x44a66f,_0xff48d,_0x532524){return new Promise(function(_0x1ae88c,_0x4871b9){var _0x5c63d8=moment();var _0x5cc8ba={'method':_0x6e50('0x2c'),'uri':_0x532524+_0x6e50('0x2d'),'body':{'contact':{'last_name':_0x579e57[_0x6e50('0x26')],'work_number':_0x579e57[_0x6e50('0x26')],'mobile_number':_0x579e57[_0x6e50('0x26')],'owner_id':_0x579e57[_0x6e50('0x1e')],'created_at':_0x5c63d8['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x5cc8ba[_0x6e50('0xc')]=_0xff48d;logger[_0x6e50('0xd')](_0x6e50('0x2e'));return rp(_0x5cc8ba)[_0x6e50('0x1a')](function(_0x5bb9eb){_0x579e57[_0x6e50('0x28')]=_0x5bb9eb[_0x6e50('0x2f')]['id'];_0x1ae88c(_0x579e57);})[_0x6e50('0x15')](function(_0x46bad8){logger[_0x6e50('0x16')]('['+[_0x44a66f[_0x6e50('0x21')]()]+']',_0x46bad8[_0x6e50('0x17')]);_0x4871b9(_0x46bad8[_0x6e50('0x17')]);});});}function getTicket(_0xe48e92,_0x5ded2d,_0xde35de,_0x1f1170,_0x1658a7){return function(_0x44ca43){logger['info'](_0x6e50('0x30'));return new Promise(function(_0x14ab84,_0xceffca){var _0x52031e=moment();var _0x887958={'method':'POST','uri':_0xde35de+_0x6e50('0x31'),'body':{'title':intUtil['getString'](_0x1f1170['Subjects'],_0x1658a7,'\x20'),'description':intUtil['getString'](_0x1f1170['Descriptions'],_0x1658a7,'\x0a'),'owner_id':_0x44ca43[_0x6e50('0x1e')],'creater_id':_0x44ca43[_0x6e50('0x13')],'targetable_id':_0x44ca43['endUserId'],'targetable_type':_0x6e50('0x32'),'created_at':_0x52031e[_0x6e50('0x33')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x52031e[_0x6e50('0x34')](0x1e,'m')[_0x6e50('0x33')](_0x6e50('0x35'))},'json':!![]};_0x887958[_0x6e50('0xc')]=_0x5ded2d;return rp(_0x887958)[_0x6e50('0x1a')](function(_0x2c9cbb){_0x44ca43[_0x6e50('0x36')]=_0x2c9cbb['task']['id'];logger[_0x6e50('0xd')]('Task\x20created:',_0x44ca43[_0x6e50('0x36')]);_0x14ab84(_0x44ca43);})['catch'](function(_0x43680e){logger[_0x6e50('0x16')]('['+[_0xe48e92[_0x6e50('0x21')]()]+']',_0x43680e[_0x6e50('0x17')]);_0xceffca(_0x43680e['message']);});});};}function emit(_0x2b601f,_0x3a4940,_0x5a03e4){var _0x5597ec={'uri':_0x2b601f+_0x6e50('0x37')+_0x5a03e4};io['to'](util['format'](_0x6e50('0x38'),_0x3a4940))[_0x6e50('0x39')]('trigger:browser:url',_0x5597ec);}exports['cs']=function(_0x37bd4c,_0x1fb7da,_0x1fc513,_0x49be82,_0x4161f7,_0x451a80,_0x250660,_0x3e7cd5){var _0x4fb719={};var _0x164f90={'Authorization':_0x6e50('0x3a')+_0x451a80[_0x6e50('0x3b')]};_0x451a80[_0x6e50('0x3c')]=intUtil[_0x6e50('0x3d')](_0x451a80[_0x6e50('0x3c')]);_0x451a80[_0x6e50('0x3e')]=intUtil['stripTrailingSlash'](_0x451a80[_0x6e50('0x3e')]);var _0x112d58=_0x451a80['remoteUri'];_0x4fb719[_0x6e50('0x20')]=_0x451a80['username'];_0x4fb719[_0x6e50('0x26')]=_0x3e7cd5[_0x6e50('0x3f')]()===_0x6e50('0x40')?_0x1fb7da[_0x6e50('0x41')]:_0x1fb7da[_0x6e50('0x42')];_0x4fb719[_0x6e50('0x43')]=_0x3e7cd5===_0x6e50('0x44')||_0x3e7cd5===_0x6e50('0x45')?_0x6e50('0x44'):_0x6e50('0x40');if(_0x49be82){_0x4fb719['agentEmail']=_0x49be82[_0x6e50('0x11')];}var _0x4548be=util[_0x6e50('0x33')](_0x6e50('0x46'),_0x451a80[_0x6e50('0x3e')],_0x1fb7da[_0x6e50('0x47')],md5(_0x1fb7da[_0x6e50('0x47')]));if(_0x4161f7&&_0x4161f7[_0x6e50('0x48')]){logger[_0x6e50('0xd')]('[QUEUE]',_0x6e50('0x49'));_0x1fb7da['recordingURL']=_0x4548be;}else if(_0x250660&&_0x250660[_0x6e50('0x4a')]&&_0x250660['recordingFormat']!==_0x6e50('0x4b')){logger[_0x6e50('0xd')](_0x6e50('0x4c'),_0x6e50('0x49'));_0x1fb7da[_0x6e50('0x4d')]=_0x4548be;}else{_0x1fb7da[_0x6e50('0x4d')]='';}return getAdminId(_0x4fb719,_0x3e7cd5,_0x164f90,_0x112d58)['then'](getUser(_0x3e7cd5,_0x164f90,_0x112d58))[_0x6e50('0x1a')](getEndUser(_0x3e7cd5,_0x164f90,_0x112d58))[_0x6e50('0x1a')](getTicket(_0x3e7cd5,_0x164f90,_0x112d58,_0x1fc513,_0x1fb7da))[_0x6e50('0x1a')](function(_0x24b6ab){logger[_0x6e50('0xd')](util['format'](_0x6e50('0x4e'),_0x24b6ab['ticketId']));if(_0x3e7cd5!==_0x6e50('0x45')){logger[_0x6e50('0xd')]('['+[_0x3e7cd5[_0x6e50('0x21')]()]+']',_0x6e50('0x4f'));emit(_0x112d58,_0x49be82[_0x6e50('0x50')],_0x24b6ab[_0x6e50('0x28')]);}})[_0x6e50('0x15')](function(_0x15fd8e){logger[_0x6e50('0x16')]('['+[_0x3e7cd5[_0x6e50('0x21')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x6e50('0x51')](_0x15fd8e,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 43aeac7..41110bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x451d=['[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','toLowerCase','data1','data2','find','data3','queue','routeId','outbound','log','salesforce','dynamics365','unknown\x20integration','../../../../config/logger'];(function(_0xf46ffd,_0x32590e){var _0x46f1da=function(_0x5f58e6){while(--_0x5f58e6){_0xf46ffd['push'](_0xf46ffd['shift']());}};_0x46f1da(++_0x32590e);}(_0x451d,0x108));var _0xd451=function(_0x422bb3,_0x49d880){_0x422bb3=_0x422bb3-0x0;var _0x97760e=_0x451d[_0x422bb3];return _0x97760e;};'use strict';var _=require('lodash');var util=require(_0xd451('0x0'));var zendesk=require(_0xd451('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0xd451('0x2'));var freshdesk=require(_0xd451('0x3'));var zoho=require(_0xd451('0x4'));var desk=require(_0xd451('0x5'));var vtiger=require(_0xd451('0x6'));var servicenow=require(_0xd451('0x7'));var dynamics365=require(_0xd451('0x8'));var freshsales=require(_0xd451('0x9'));var integrations=[_0xd451('0xa'),'salesforce',_0xd451('0xb'),_0xd451('0xc'),_0xd451('0xd'),_0xd451('0xe'),_0xd451('0xf'),'dynamics365',_0xd451('0x10'),_0xd451('0x11')];exports[_0xd451('0x12')]=function(_0x2fecee,_0x47e033,_0x4fd1ba,_0x2a4bed,_0x44edb4,_0x5871a2){if(_0x4fd1ba){if(_['includes'](integrations,_0x2fecee['data1'][_0xd451('0x13')]())){try{var _0x44d629=null;var _0x334c16='';var _0x2475f7=_0x4fd1ba[_0x2fecee[_0xd451('0x14')][_0xd451('0x13')]()];if(_0x2475f7){var _0x59c031=_0x2475f7[_0x2fecee[_0xd451('0x15')]];if(_0x59c031){var _0x55cc8e=_[_0xd451('0x16')](_0x59c031['Configurations'],{'id':parseInt(_0x2fecee[_0xd451('0x17')],0xa)});if(_0x55cc8e){if(_0x2a4bed){if(_0x44edb4&&_0x47e033[_0xd451('0x18')]){_0x334c16=_0xd451('0x18');}else if(_0x47e033[_0xd451('0x19')]){_0x334c16=_0xd451('0x1a');}else{console[_0xd451('0x1b')]('EVENT\x20UNKNOWN',_0x47e033);}}else{_0x334c16='unmanaged';}switch(_0x2fecee['data1'][_0xd451('0x13')]()){case'zendesk':zendesk[_0x334c16](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2);break;case _0xd451('0x1c'):salesforce[_0x334c16](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2);break;case _0xd451('0xb'):sugarcrm[_0x334c16](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2);break;case _0xd451('0xc'):freshdesk[_0x334c16](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2);break;case'zoho':zoho[_0x334c16](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2);break;case _0xd451('0xe'):desk[_0x334c16](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2);break;case _0xd451('0xf'):vtiger[_0x334c16](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2);break;case _0xd451('0x10'):freshsales['cs'](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2,_0x334c16);break;case _0xd451('0x11'):servicenow['cs'](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2,_0x334c16);break;case _0xd451('0x1d'):dynamics365['cs'](_0x2fecee,_0x47e033,_0x55cc8e,_0x2a4bed,_0x44edb4,_0x59c031,_0x5871a2,_0x334c16);break;default:console[_0xd451('0x1b')](_0xd451('0x1e'));}}else{_0x44d629=require(_0xd451('0x1f'))(_0x2fecee[_0xd451('0x14')][_0xd451('0x13')]());_0x44d629['error'](_0xd451('0x20'),util[_0xd451('0x21')](_0xd451('0x22'),_0x2fecee[_0xd451('0x14')][_0xd451('0x13')](),_0x2fecee['data3']));}}else{_0x44d629=require(_0xd451('0x1f'))(_0x2fecee[_0xd451('0x14')][_0xd451('0x13')]());_0x44d629[_0xd451('0x23')](_0xd451('0x20'),util[_0xd451('0x21')](_0xd451('0x24'),_0x2fecee['data1']['toLowerCase'](),_0x2fecee[_0xd451('0x15')]));}}else{}}catch(_0x573ed6){console[_0xd451('0x23')](_0x573ed6);}}}};
\ No newline at end of file
+var _0x7dea=['unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./desk','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','desk','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','vtiger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dea,0x16f));var _0xa7de=function(_0x4ab3c7,_0x39ef14){_0x4ab3c7=_0x4ab3c7-0x0;var _0x14b81c=_0x7dea[_0x4ab3c7];return _0x14b81c;};'use strict';var _=require(_0xa7de('0x0'));var util=require(_0xa7de('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xa7de('0x2'));var sugarcrm=require(_0xa7de('0x3'));var freshdesk=require(_0xa7de('0x4'));var zoho=require('./zoho');var desk=require(_0xa7de('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xa7de('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0xa7de('0x7'));var integrations=[_0xa7de('0x8'),_0xa7de('0x9'),_0xa7de('0xa'),'freshdesk','zoho',_0xa7de('0xb'),'vtiger',_0xa7de('0xc'),_0xa7de('0xd'),'servicenow'];exports[_0xa7de('0xe')]=function(_0x5d8fe4,_0x2a1077,_0x1db881,_0x3e8b90,_0x4302f9,_0x5417f7){if(_0x1db881){if(_[_0xa7de('0xf')](integrations,_0x5d8fe4[_0xa7de('0x10')][_0xa7de('0x11')]())){try{var _0x430e29=null;var _0x3531f4='';var _0x5282a2=_0x1db881[_0x5d8fe4[_0xa7de('0x10')][_0xa7de('0x11')]()];if(_0x5282a2){var _0x291f91=_0x5282a2[_0x5d8fe4[_0xa7de('0x12')]];if(_0x291f91){var _0x58dfd5=_['find'](_0x291f91[_0xa7de('0x13')],{'id':parseInt(_0x5d8fe4[_0xa7de('0x14')],0xa)});if(_0x58dfd5){if(_0x3e8b90){if(_0x4302f9&&_0x2a1077[_0xa7de('0x15')]){_0x3531f4=_0xa7de('0x15');}else if(_0x2a1077[_0xa7de('0x16')]){_0x3531f4=_0xa7de('0x17');}else{console[_0xa7de('0x18')](_0xa7de('0x19'),_0x2a1077);}}else{_0x3531f4=_0xa7de('0x1a');}switch(_0x5d8fe4['data1'][_0xa7de('0x11')]()){case'zendesk':zendesk[_0x3531f4](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7);break;case _0xa7de('0x9'):salesforce[_0x3531f4](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7);break;case _0xa7de('0xa'):sugarcrm[_0x3531f4](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7);break;case _0xa7de('0x1b'):freshdesk[_0x3531f4](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7);break;case'zoho':zoho[_0x3531f4](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7);break;case _0xa7de('0xb'):desk[_0x3531f4](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7);break;case _0xa7de('0x1c'):vtiger[_0x3531f4](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7);break;case _0xa7de('0xd'):freshsales['cs'](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7,_0x3531f4);break;case'servicenow':servicenow['cs'](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7,_0x3531f4);break;case _0xa7de('0xc'):dynamics365['cs'](_0x5d8fe4,_0x2a1077,_0x58dfd5,_0x3e8b90,_0x4302f9,_0x291f91,_0x5417f7,_0x3531f4);break;default:console['log'](_0xa7de('0x1d'));}}else{_0x430e29=require(_0xa7de('0x1e'))(_0x5d8fe4[_0xa7de('0x10')][_0xa7de('0x11')]());_0x430e29[_0xa7de('0x1f')](_0xa7de('0x20'),util['format'](_0xa7de('0x21'),_0x5d8fe4[_0xa7de('0x10')][_0xa7de('0x11')](),_0x5d8fe4['data3']));}}else{_0x430e29=require(_0xa7de('0x1e'))(_0x5d8fe4[_0xa7de('0x10')]['toLowerCase']());_0x430e29['error'](_0xa7de('0x20'),util[_0xa7de('0x22')](_0xa7de('0x23'),_0x5d8fe4[_0xa7de('0x10')][_0xa7de('0x11')](),_0x5d8fe4[_0xa7de('0x12')]));}}else{}}catch(_0xcf3bae){console[_0xa7de('0x1f')](_0xcf3bae);}}}};
\ No newline at end of file
index 0ccf616..f0ea44f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6418=['%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','recordingURL','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','contact','lead','WhoId','endUserType','account','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','sobject','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','merge','Account','Contact','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','<unknown>','Caller\x20-\x20%s','format','Company','Name','upperFirst','forEach','includes','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','username','Connection\x20established.','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url'];(function(_0x226494,_0xc4b645){var _0x27b950=function(_0x3e6acf){while(--_0x3e6acf){_0x226494['push'](_0x226494['shift']());}};_0x27b950(++_0xc4b645);}(_0x6418,0x182));var _0x8641=function(_0x186bc8,_0x57c39e){_0x186bc8=_0x186bc8-0x0;var _0x330bfc=_0x6418[_0x186bc8];return _0x330bfc;};'use strict';var _=require(_0x8641('0x0'));var rp=require(_0x8641('0x1'));var moment=require('moment');var BPromise=require(_0x8641('0x2'));var md5=require(_0x8641('0x3'));var jsforce=require('jsforce');var util=require(_0x8641('0x4'));var Redis=require(_0x8641('0x5'));var intUtil=require(_0x8641('0x6'));var config=require(_0x8641('0x7'));var logger=require(_0x8641('0x8'))('salesforce');config['redis']=_[_0x8641('0x9')](config['redis'],{'host':_0x8641('0xa'),'port':0x18eb});var io=require(_0x8641('0xb'))(new Redis(config[_0x8641('0xc')]));function emit(_0x136bcd,_0x2fd539,_0x4e0b0a){io['to'](_0x136bcd)[_0x8641('0xd')](_0x2fd539,_0x4e0b0a);}function getTicket(_0x1a2b03,_0x228392,_0x59d51a,_0x2a8e2e,_0x168dc3,_0x3adc16,_0x839e08,_0x27de4b){var _0x26c3f6=Object[_0x8641('0xe')]({},{'OwnerId':_0x228392['id'],'Subject':intUtil[_0x8641('0xf')](_0x2a8e2e[_0x8641('0x10')],_0x168dc3,'\x20'),'Description':intUtil[_0x8641('0xf')](_0x2a8e2e[_0x8641('0x11')],_0x168dc3,'\x0a')},getCustomFields(_0x3adc16,_0x168dc3));if(_0x59d51a){if(_0x2a8e2e[_0x8641('0x12')]==='Task'){_0x26c3f6[_0x8641('0x13')]=moment[_0x8641('0x14')]();_0x26c3f6['IsReminderSet']=![];_0x26c3f6['IsRecurrence']=![];if(_0x59d51a['endUserType']===_0x8641('0x15')||_0x59d51a['endUserType']===_0x8641('0x16')){_0x26c3f6[_0x8641('0x17')]=_0x59d51a['id'];}else if(_0x59d51a[_0x8641('0x18')]===_0x8641('0x19')){_0x26c3f6['WhatId']=_0x59d51a['id'];}}else if(_0x2a8e2e[_0x8641('0x12')]===_0x8641('0x1a')){if(_0x59d51a[_0x8641('0x18')]===_0x8641('0x15')){_0x26c3f6['ContactId']=_0x59d51a['id'];}else if(_0x59d51a[_0x8641('0x18')]==='account'){_0x26c3f6[_0x8641('0x1b')]=_0x59d51a['id'];}else if(_0x59d51a[_0x8641('0x18')]===_0x8641('0x16')&&_0x2a8e2e['leadId']){_0x26c3f6[_0x2a8e2e[_0x8641('0x1c')]]=_0x59d51a['id'];}else{logger[_0x8641('0x1d')](_0x8641('0x1e'));}}}return _0x839e08['sobject'](_0x2a8e2e[_0x8641('0x12')])[_0x8641('0x1f')](_0x26c3f6);}function getUser(_0x468152,_0x37b3c6,_0xc1d9a){if(!_[_0x8641('0x20')](_0x37b3c6)&&intUtil['validateEmail'](_0x37b3c6)){var _0x1a682b={'Email':_0x37b3c6};var _0x57b278={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xc1d9a[_0x8641('0x21')]('User')[_0x8641('0x22')](_0x1a682b,_0x57b278)[_0x8641('0x23')]()[_0x8641('0x24')](function(_0x4a85dd){if(_0x4a85dd[_0x8641('0x25')]){var _0x68ceff=_[_0x8641('0x22')](_0x4a85dd,function(_0x2e12e6){return _0x2e12e6[_0x8641('0x26')]===_0x37b3c6;});if(_0x68ceff){logger[_0x8641('0x1d')](_0x8641('0x27'),_0x37b3c6);return BPromise[_0x8641('0x28')]({'id':_0x68ceff['Id'],'name':_0x68ceff['Name']});}}else{logger[_0x8641('0x1d')](_0x8641('0x29'),_0x37b3c6);return _0xc1d9a['identity']()[_0x8641('0x24')](function(_0x278732){return BPromise[_0x8641('0x28')]({'id':_0x278732[_0x8641('0x2a')],'name':_0x278732[_0x8641('0x2b')]});});}});}else{logger[_0x8641('0x1d')](_0x8641('0x29'),_0x37b3c6);return _0xc1d9a[_0x8641('0x2c')]()[_0x8641('0x24')](function(_0x1441da){return BPromise['resolve']({'id':_0x1441da[_0x8641('0x2a')],'name':_0x1441da[_0x8641('0x2b')]});});}}function getEndUser(_0x30caea,_0x6db3c0,_0x485b41,_0x1d780f,_0xbabab4){var _0x3036c1={'$or':{'Phone':_0x1d780f}};var _0x1c08f0={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x8641('0x24')](function(){logger[_0x8641('0x1d')](_0x8641('0x2d'),_0x1d780f,_0x6db3c0['moduleSearch']);switch(_0x6db3c0[_0x8641('0x2e')]){case _0x8641('0x2f'):var _0x27c52b=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x31')]){var _0x430f2f={};_0x430f2f[_0x6db3c0['additionalSearchContact']]=_0x1d780f;_['merge'](_0x27c52b[_0x8641('0x32')],_0x430f2f);}return _0xbabab4[_0x8641('0x21')]('Contact')[_0x8641('0x22')](_0x27c52b,_0x1c08f0)[_0x8641('0x23')]()[_0x8641('0x24')](function(_0x5c9ee6){if(_0x5c9ee6&&_0x5c9ee6['length']){return _0x5c9ee6;}else{var _0x5dbe27=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x33')]){var _0x45c03d={};_0x45c03d[_0x6db3c0['additionalSearchLead']]=_0x1d780f;_['merge'](_0x5dbe27[_0x8641('0x32')],_0x45c03d);}return _0xbabab4[_0x8641('0x21')](_0x8641('0x34'))[_0x8641('0x22')](_0x5dbe27,_0x1c08f0);}});case _0x8641('0x35'):var _0x29aa3c=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x36')]){var _0x430f2f={};_0x430f2f[_0x6db3c0['additionalSearchAccount']]=_0x1d780f;_[_0x8641('0x37')](_0x29aa3c[_0x8641('0x32')],_0x430f2f);}return _0xbabab4['sobject'](_0x8641('0x38'))[_0x8641('0x22')](_0x29aa3c,_0x1c08f0)['execute']()[_0x8641('0x24')](function(_0x4b28b9){if(_0x4b28b9&&_0x4b28b9['length']){return _0x4b28b9;}else{var _0xe237c2=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x31')]){var _0x52f847={};_0x52f847[_0x6db3c0[_0x8641('0x31')]]=_0x1d780f;_[_0x8641('0x37')](_0xe237c2['$or'],_0x52f847);}return _0xbabab4[_0x8641('0x21')](_0x8641('0x39'))[_0x8641('0x22')](_0xe237c2,_0x1c08f0)['then'](function(_0x52551a){if(_0x52551a&&_0x52551a[_0x8641('0x25')]){return _0x52551a;}else{var _0x51857e=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x33')]){var _0x7211ec={};_0x7211ec[_0x6db3c0['additionalSearchLead']]=_0x1d780f;_[_0x8641('0x37')](_0x51857e[_0x8641('0x32')],_0x7211ec);}return _0xbabab4[_0x8641('0x21')](_0x8641('0x34'))[_0x8641('0x22')](_0x51857e,_0x1c08f0);}});}});case _0x8641('0x15'):var _0x27c52b=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x31')]){var _0x430f2f={};_0x430f2f[_0x6db3c0[_0x8641('0x31')]]=_0x1d780f;_[_0x8641('0x37')](_0x27c52b[_0x8641('0x32')],_0x430f2f);}return _0xbabab4['sobject']('Contact')[_0x8641('0x22')](_0x27c52b,_0x1c08f0)[_0x8641('0x23')]();case _0x8641('0x16'):var _0x58b3fc=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x33')]){var _0x430f2f={};_0x430f2f[_0x6db3c0['additionalSearchLead']]=_0x1d780f;_[_0x8641('0x37')](_0x58b3fc['$or'],_0x430f2f);}return _0xbabab4[_0x8641('0x21')](_0x8641('0x34'))[_0x8641('0x22')](_0x58b3fc,_0x1c08f0);case'account':var _0x29aa3c=_[_0x8641('0x30')](_0x3036c1);if(_0x6db3c0[_0x8641('0x36')]){var _0x430f2f={};_0x430f2f[_0x6db3c0['additionalSearchAccount']]=_0x1d780f;_[_0x8641('0x37')](_0x29aa3c['$or'],_0x430f2f);}return _0xbabab4[_0x8641('0x21')]('Account')[_0x8641('0x22')](_0x29aa3c,_0x1c08f0);default:return null;}})[_0x8641('0x24')](function(_0x6beda8){if(_0x6beda8&&_0x6beda8[_0x8641('0x25')]){var _0x491281=_[_0x8641('0x3a')](_0x6beda8);if(_0x491281){return BPromise[_0x8641('0x28')]({'id':_0x491281['Id'],'name':_0x491281['Name'],'phone':_0x491281[_0x8641('0x3b')],'endUserType':_0x491281[_0x8641('0x3c')][_0x8641('0x3d')]['toLowerCase']()});}}})[_0x8641('0x24')](function(_0xd6d38a){if(_0xd6d38a){logger[_0x8641('0x1d')](_0x8641('0x3e'),_0xd6d38a[_0x8641('0x18')],_0x1d780f);return BPromise['resolve'](_0xd6d38a);}else{logger[_0x8641('0x1d')](_0x8641('0x3f'),_0x1d780f);var _0x1ff7cf={'Phone':_0x1d780f};if(_0x6db3c0['moduleCreate']){if(_0x6db3c0[_0x8641('0x40')]===_0x8641('0x15')){logger[_0x8641('0x1d')](_0x8641('0x41'),_0x1d780f,_0x6db3c0['moduleCreate']);_0x1ff7cf['LastName']=_0x485b41!==_0x8641('0x42')?_0x485b41:util['format'](_0x8641('0x43'),_0x1d780f);}else if(_0x6db3c0['moduleCreate']===_0x8641('0x16')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1d780f,_0x6db3c0[_0x8641('0x40')]);_0x1ff7cf['LastName']=_0x485b41!==_0x8641('0x42')?_0x485b41:util[_0x8641('0x44')]('Caller\x20-\x20%s',_0x1d780f);_0x1ff7cf[_0x8641('0x45')]='No\x20Company';}else if(_0x6db3c0[_0x8641('0x40')]==='account'){logger[_0x8641('0x1d')](_0x8641('0x41'),_0x1d780f,_0x6db3c0['moduleCreate']);_0x1ff7cf[_0x8641('0x46')]=_0x485b41!==_0x8641('0x42')?_0x485b41:util[_0x8641('0x44')](_0x8641('0x43'),_0x1d780f);}else{return null;}}return _0xbabab4[_0x8641('0x21')](_[_0x8641('0x47')](_0x6db3c0[_0x8641('0x40')]))[_0x8641('0x1f')](_0x1ff7cf)['then'](function(_0x29e1f0){return BPromise[_0x8641('0x28')]({'id':_0x29e1f0['id'],'endUserType':_0x6db3c0[_0x8641('0x40')]});});}});}function getCustomFields(_0x15702d,_0x3771cb){var _0x31d752={};if(_0x15702d[_0x8641('0x25')]>0x0){_[_0x8641('0x48')](_0x15702d,function(_0x2ffe82){if(_[_0x8641('0x49')]([_0x8641('0x4a'),'picklist'],_0x2ffe82[_0x8641('0x3d')])&&_0x2ffe82[_0x8641('0x4b')]){_0x31d752[_0x2ffe82[_0x8641('0x4b')]]=_0x2ffe82[_0x8641('0x4c')][_0x8641('0x4d')]();}else if(_0x2ffe82[_0x8641('0x3d')]===_0x8641('0x4e')&&_0x2ffe82['variableName']&&_0x2ffe82['idField']){_0x3771cb[_0x2ffe82[_0x8641('0x4f')]]&&(_0x31d752[_0x2ffe82[_0x8641('0x4b')]]=_0x3771cb[_0x2ffe82['variableName']]['toString']());}else if(_0x2ffe82[_0x8641('0x3d')]==='customVariable'&&_0x2ffe82[_0x8641('0x50')]&&_0x2ffe82[_0x8641('0x50')][_0x8641('0x51')]&&_0x2ffe82[_0x8641('0x4b')]){_0x3771cb[_0x2ffe82[_0x8641('0x50')][_0x8641('0x51')][_0x8641('0x52')]()]&&(_0x31d752[_0x2ffe82[_0x8641('0x4b')]]=_0x3771cb[_0x2ffe82[_0x8641('0x50')][_0x8641('0x51')]['toLowerCase']()]['toString']());}});}return _0x31d752;}function getConnection(_0x5a0bfc){var _0x5e09e2=_0x5a0bfc[_0x8641('0x53')][_0x8641('0x54')](_0x5a0bfc['securityToken']);var _0x4acd5e=new jsforce[(_0x8641('0x55'))]({'oauth2':{'loginUrl':_0x5a0bfc[_0x8641('0x56')]||_0x8641('0x57'),'clientId':_0x5a0bfc[_0x8641('0x58')],'clientSecret':_0x5a0bfc['clientSecret']}});return _0x4acd5e['login'](_0x5a0bfc[_0x8641('0x59')],_0x5e09e2)[_0x8641('0x24')](function(){logger[_0x8641('0x1d')](_0x8641('0x5a'));return _0x4acd5e;});}exports['queue']=function(_0x5e4c8b,_0x44eaf5,_0x59d2d9,_0x30bfee,_0xb7270b,_0x5741c2){var _0x107d65,_0x4fc45c,_0x3b5712,_0x104934;_0x5741c2['serverUrl']=intUtil[_0x8641('0x5b')](_0x5741c2[_0x8641('0x5c')]);_0x5741c2[_0x8641('0x56')]=intUtil[_0x8641('0x5b')](_0x5741c2[_0x8641('0x56')]);if(_0xb7270b&&_0xb7270b[_0x8641('0x5d')]){logger['info']('[QUEUE]',_0x8641('0x5e'));_0x44eaf5['recordingURL']=util[_0x8641('0x44')](_0x8641('0x5f'),_0x5741c2[_0x8641('0x5c')],_0x44eaf5[_0x8641('0x60')],md5(_0x44eaf5[_0x8641('0x60')]));}else{_0x44eaf5['recordingURL']='';}return getConnection(_0x5741c2)[_0x8641('0x24')](function(_0x417682){_0x104934=_0x417682;return getUser(_0x5741c2,_0x30bfee[_0x8641('0x61')],_0x104934);})[_0x8641('0x24')](function(_0x356053){_0x107d65=_0x356053;return getEndUser(_0x5741c2,_0x59d2d9,_0x44eaf5['calleridname'],_0x44eaf5[_0x8641('0x62')],_0x104934);})[_0x8641('0x24')](function(_0x15c46d){_0x4fc45c=_0x15c46d;return getTicket(_0x5741c2,_0x107d65,_0x4fc45c,_0x59d2d9,_0x44eaf5,_0x59d2d9[_0x8641('0x63')],_0x104934,_0x8641('0x64'));})[_0x8641('0x24')](function(_0x3f226e){_0x3b5712=_0x3f226e;logger[_0x8641('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3b5712['id']);logger[_0x8641('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3b5712['id'],_0x30bfee[_0x8641('0x51')],_0x5741c2[_0x8641('0x3d')]);switch(_0x5741c2[_0x8641('0x3d')]){case _0x8641('0x65'):emit(util[_0x8641('0x44')](_0x8641('0x66'),_0x30bfee['name']),_0x8641('0x67'),{'recordId':_0x3b5712['id']});break;case _0x8641('0x68'):emit(util[_0x8641('0x44')](_0x8641('0x66'),_0x30bfee['name']),_0x8641('0x69'),{'uri':util[_0x8641('0x44')](_0x8641('0x6a'),_0x104934[_0x8641('0x6b')],_0x3b5712['id'])});break;default:logger[_0x8641('0x6c')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x8641('0x6d')](function(_0x3d313a){logger[_0x8641('0x6c')](_0x8641('0x6e'),_0x3d313a);});};exports[_0x8641('0x6f')]=function(_0x57900c,_0x3004f0,_0x429f13,_0x13f5db,_0x5e915e,_0x52d5ce,_0x3efe1d){var _0x3370ce,_0x303de9,_0x4b4e17,_0x19eee0;_0x52d5ce[_0x8641('0x5c')]=intUtil[_0x8641('0x5b')](_0x52d5ce[_0x8641('0x5c')]);_0x52d5ce[_0x8641('0x56')]=intUtil[_0x8641('0x5b')](_0x52d5ce[_0x8641('0x56')]);if(_0x3efe1d&&_0x3efe1d[_0x8641('0x70')]&&_0x3efe1d[_0x8641('0x70')]!==_0x8641('0x71')){logger[_0x8641('0x1d')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3004f0[_0x8641('0x72')]=util[_0x8641('0x44')](_0x8641('0x5f'),_0x52d5ce[_0x8641('0x5c')],_0x3004f0[_0x8641('0x60')],md5(_0x3004f0[_0x8641('0x60')]));}return getConnection(_0x52d5ce)['then'](function(_0x190b33){_0x19eee0=_0x190b33;return getUser(_0x52d5ce,_0x13f5db[_0x8641('0x61')],_0x19eee0);})[_0x8641('0x24')](function(_0x12f62b){_0x3370ce=_0x12f62b;return getEndUser(_0x52d5ce,_0x429f13,_0x3004f0[_0x8641('0x73')],_0x3004f0['destcalleridnum'],_0x19eee0);})[_0x8641('0x24')](function(_0x5e10b0){_0x303de9=_0x5e10b0;return getTicket(_0x52d5ce,_0x3370ce,_0x303de9,_0x429f13,_0x3004f0,_0x429f13['Fields'],_0x19eee0,_0x8641('0x6f'));})['then'](function(_0x46f2f7){_0x4b4e17=_0x46f2f7;logger[_0x8641('0x1d')](_0x8641('0x74'),_0x4b4e17['id']);logger[_0x8641('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4b4e17['id'],_0x13f5db[_0x8641('0x51')],_0x52d5ce[_0x8641('0x3d')]);switch(_0x52d5ce[_0x8641('0x3d')]){case _0x8641('0x65'):emit(util['format'](_0x8641('0x66'),_0x13f5db[_0x8641('0x51')]),'trigger:salesforce:display',{'recordId':_0x4b4e17['id']});break;case _0x8641('0x68'):emit(util['format'](_0x8641('0x66'),_0x13f5db['name']),_0x8641('0x69'),{'uri':util[_0x8641('0x44')](_0x8641('0x6a'),_0x19eee0['instanceUrl'],_0x4b4e17['id'])});break;default:logger['error'](_0x8641('0x75'),_0x8641('0x76'));}})[_0x8641('0x6d')](function(_0x10cec6){logger[_0x8641('0x6c')](_0x8641('0x75'),_0x10cec6);});};exports[_0x8641('0x77')]=function(_0x56232c,_0x47da8a,_0x75b19c,_0x33538b,_0x3f031b,_0x3983f3){var _0x10798c,_0x165b5a,_0x14c49a,_0x27d5da;_0x3983f3[_0x8641('0x5c')]=intUtil[_0x8641('0x5b')](_0x3983f3[_0x8641('0x5c')]);_0x3983f3[_0x8641('0x56')]=intUtil[_0x8641('0x5b')](_0x3983f3[_0x8641('0x56')]);if(_0x3f031b&&_0x3f031b['monitor_format']){logger['info']('['+_0x47da8a[_0x8641('0x78')]['toUpperCase']()+']',_0x8641('0x5e'));_0x47da8a[_0x8641('0x72')]=util[_0x8641('0x44')](_0x8641('0x5f'),_0x3983f3[_0x8641('0x5c')],_0x47da8a['uniqueid'],md5(_0x47da8a[_0x8641('0x60')]));}else{_0x47da8a['recordingURL']='';}return getConnection(_0x3983f3)[_0x8641('0x24')](function(_0x4f4641){_0x27d5da=_0x4f4641;if(!_[_0x8641('0x20')](_0x33538b)){return getUser(_0x3983f3,_0x33538b['name'],_0x27d5da);}else{return getUser(_0x3983f3,null,_0x27d5da);}})['then'](function(_0xe654cd){_0x10798c=_0xe654cd;return getEndUser(_0x3983f3,_0x75b19c,_0x47da8a['calleridname'],_0x47da8a[_0x8641('0x62')],_0x27d5da);})[_0x8641('0x24')](function(_0x9d3c73){_0x165b5a=_0x9d3c73;return getTicket(_0x3983f3,_0x10798c,_0x165b5a,_0x75b19c,_0x47da8a,_0x75b19c['Fields'],_0x27d5da);})['then'](function(_0x5da728){_0x14c49a=_0x5da728;logger['info']('['+_0x47da8a['lastevent'][_0x8641('0x79')]()+']\x20Ticket\x20%s\x20created.',_0x14c49a['id']);logger['info']('['+_0x47da8a[_0x8641('0x78')][_0x8641('0x79')]()+_0x8641('0x7a'),_0x3983f3['type']);})[_0x8641('0x6d')](function(_0x4b27d6){logger[_0x8641('0x6c')]('['+_0x47da8a[_0x8641('0x78')][_0x8641('0x79')]()+']',_0x4b27d6);});};
\ No newline at end of file
+var _0x53f4=[']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','jsforce','util','ioredis','../../../../config/logger','salesforce','redis','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','endUserType','contact','lead','WhatId','Case','ContactId','account','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','User','find','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','sobject','Contact','execute','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','<unknown>','upperFirst','create','includes','string','idField','content','variableName','toString','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','monitor_format','toUpperCase','lastevent'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x53f4,0x7a));var _0x453f=function(_0x54ee7e,_0x173008){_0x54ee7e=_0x54ee7e-0x0;var _0x425b83=_0x53f4[_0x54ee7e];return _0x425b83;};'use strict';var _=require(_0x453f('0x0'));var rp=require(_0x453f('0x1'));var moment=require('moment');var BPromise=require(_0x453f('0x2'));var md5=require('md5');var jsforce=require(_0x453f('0x3'));var util=require(_0x453f('0x4'));var Redis=require(_0x453f('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x453f('0x6'))(_0x453f('0x7'));config['redis']=_['defaults'](config[_0x453f('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x453f('0x8')]));function emit(_0x4f6ee0,_0x5daf9c,_0x523dc4){io['to'](_0x4f6ee0)['emit'](_0x5daf9c,_0x523dc4);}function getTicket(_0x3d7cd8,_0x2c2bd7,_0x44a35a,_0x3feae6,_0xf20737,_0x190ba8,_0x187faf,_0x356bbf){var _0x499dd7=Object[_0x453f('0x9')]({},{'OwnerId':_0x2c2bd7['id'],'Subject':intUtil[_0x453f('0xa')](_0x3feae6[_0x453f('0xb')],_0xf20737,'\x20'),'Description':intUtil[_0x453f('0xa')](_0x3feae6[_0x453f('0xc')],_0xf20737,'\x0a')},getCustomFields(_0x190ba8,_0xf20737));if(_0x44a35a){if(_0x3feae6[_0x453f('0xd')]===_0x453f('0xe')){_0x499dd7[_0x453f('0xf')]=moment[_0x453f('0x10')]();_0x499dd7['IsReminderSet']=![];_0x499dd7['IsRecurrence']=![];if(_0x44a35a[_0x453f('0x11')]===_0x453f('0x12')||_0x44a35a[_0x453f('0x11')]===_0x453f('0x13')){_0x499dd7['WhoId']=_0x44a35a['id'];}else if(_0x44a35a[_0x453f('0x11')]==='account'){_0x499dd7[_0x453f('0x14')]=_0x44a35a['id'];}}else if(_0x3feae6[_0x453f('0xd')]===_0x453f('0x15')){if(_0x44a35a[_0x453f('0x11')]===_0x453f('0x12')){_0x499dd7[_0x453f('0x16')]=_0x44a35a['id'];}else if(_0x44a35a[_0x453f('0x11')]===_0x453f('0x17')){_0x499dd7['AccountId']=_0x44a35a['id'];}else if(_0x44a35a['endUserType']===_0x453f('0x13')&&_0x3feae6[_0x453f('0x18')]){_0x499dd7[_0x3feae6[_0x453f('0x18')]]=_0x44a35a['id'];}else{logger[_0x453f('0x19')](_0x453f('0x1a'));}}}return _0x187faf['sobject'](_0x3feae6[_0x453f('0xd')])['create'](_0x499dd7);}function getUser(_0x4d7d19,_0x4db8c5,_0x5c54a2){if(!_[_0x453f('0x1b')](_0x4db8c5)&&intUtil[_0x453f('0x1c')](_0x4db8c5)){var _0x512f18={'Email':_0x4db8c5};var _0x3bd557={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5c54a2['sobject'](_0x453f('0x1d'))[_0x453f('0x1e')](_0x512f18,_0x3bd557)['execute']()[_0x453f('0x1f')](function(_0x4c7e13){if(_0x4c7e13['length']){var _0x405618=_[_0x453f('0x1e')](_0x4c7e13,function(_0x75f5){return _0x75f5[_0x453f('0x20')]===_0x4db8c5;});if(_0x405618){logger['info'](_0x453f('0x21'),_0x4db8c5);return BPromise[_0x453f('0x22')]({'id':_0x405618['Id'],'name':_0x405618[_0x453f('0x23')]});}}else{logger[_0x453f('0x19')](_0x453f('0x24'),_0x4db8c5);return _0x5c54a2[_0x453f('0x25')]()['then'](function(_0x1677e5){return BPromise[_0x453f('0x22')]({'id':_0x1677e5['user_id'],'name':_0x1677e5[_0x453f('0x26')]});});}});}else{logger[_0x453f('0x19')](_0x453f('0x24'),_0x4db8c5);return _0x5c54a2[_0x453f('0x25')]()[_0x453f('0x1f')](function(_0x3ad994){return BPromise[_0x453f('0x22')]({'id':_0x3ad994[_0x453f('0x27')],'name':_0x3ad994[_0x453f('0x26')]});});}}function getEndUser(_0x58972b,_0x526382,_0x3f9704,_0x52cd13,_0x352a3e){var _0x5e01a7={'$or':{'Phone':_0x52cd13}};var _0x3a4ecc={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0x453f('0x19')](_0x453f('0x28'),_0x52cd13,_0x526382[_0x453f('0x29')]);switch(_0x526382['moduleSearch']){case _0x453f('0x2a'):var _0x18ce25=_[_0x453f('0x2b')](_0x5e01a7);if(_0x526382[_0x453f('0x2c')]){var _0x35dd3b={};_0x35dd3b[_0x526382[_0x453f('0x2c')]]=_0x52cd13;_[_0x453f('0x2d')](_0x18ce25[_0x453f('0x2e')],_0x35dd3b);}return _0x352a3e[_0x453f('0x2f')](_0x453f('0x30'))[_0x453f('0x1e')](_0x18ce25,_0x3a4ecc)[_0x453f('0x31')]()[_0x453f('0x1f')](function(_0x190edd){if(_0x190edd&&_0x190edd[_0x453f('0x32')]){return _0x190edd;}else{var _0x1130f1=_[_0x453f('0x2b')](_0x5e01a7);if(_0x526382[_0x453f('0x33')]){var _0x30b2c4={};_0x30b2c4[_0x526382[_0x453f('0x33')]]=_0x52cd13;_[_0x453f('0x2d')](_0x1130f1[_0x453f('0x2e')],_0x30b2c4);}return _0x352a3e['sobject'](_0x453f('0x34'))['find'](_0x1130f1,_0x3a4ecc);}});case _0x453f('0x35'):var _0x4efe02=_['cloneDeep'](_0x5e01a7);if(_0x526382[_0x453f('0x36')]){var _0x35dd3b={};_0x35dd3b[_0x526382[_0x453f('0x36')]]=_0x52cd13;_[_0x453f('0x2d')](_0x4efe02[_0x453f('0x2e')],_0x35dd3b);}return _0x352a3e[_0x453f('0x2f')](_0x453f('0x37'))[_0x453f('0x1e')](_0x4efe02,_0x3a4ecc)[_0x453f('0x31')]()[_0x453f('0x1f')](function(_0x173963){if(_0x173963&&_0x173963[_0x453f('0x32')]){return _0x173963;}else{var _0x3878b9=_[_0x453f('0x2b')](_0x5e01a7);if(_0x526382[_0x453f('0x2c')]){var _0x5577f2={};_0x5577f2[_0x526382[_0x453f('0x2c')]]=_0x52cd13;_[_0x453f('0x2d')](_0x3878b9[_0x453f('0x2e')],_0x5577f2);}return _0x352a3e['sobject'](_0x453f('0x30'))['find'](_0x3878b9,_0x3a4ecc)[_0x453f('0x1f')](function(_0x503108){if(_0x503108&&_0x503108['length']){return _0x503108;}else{var _0x1a563e=_[_0x453f('0x2b')](_0x5e01a7);if(_0x526382['additionalSearchLead']){var _0x1e928f={};_0x1e928f[_0x526382[_0x453f('0x33')]]=_0x52cd13;_['merge'](_0x1a563e['$or'],_0x1e928f);}return _0x352a3e[_0x453f('0x2f')]('Lead')[_0x453f('0x1e')](_0x1a563e,_0x3a4ecc);}});}});case _0x453f('0x12'):var _0x18ce25=_[_0x453f('0x2b')](_0x5e01a7);if(_0x526382[_0x453f('0x2c')]){var _0x35dd3b={};_0x35dd3b[_0x526382[_0x453f('0x2c')]]=_0x52cd13;_['merge'](_0x18ce25[_0x453f('0x2e')],_0x35dd3b);}return _0x352a3e[_0x453f('0x2f')](_0x453f('0x30'))[_0x453f('0x1e')](_0x18ce25,_0x3a4ecc)['execute']();case _0x453f('0x13'):var _0x43418d=_[_0x453f('0x2b')](_0x5e01a7);if(_0x526382['additionalSearchLead']){var _0x35dd3b={};_0x35dd3b[_0x526382[_0x453f('0x33')]]=_0x52cd13;_[_0x453f('0x2d')](_0x43418d[_0x453f('0x2e')],_0x35dd3b);}return _0x352a3e[_0x453f('0x2f')](_0x453f('0x34'))['find'](_0x43418d,_0x3a4ecc);case _0x453f('0x17'):var _0x4efe02=_['cloneDeep'](_0x5e01a7);if(_0x526382['additionalSearchAccount']){var _0x35dd3b={};_0x35dd3b[_0x526382[_0x453f('0x36')]]=_0x52cd13;_[_0x453f('0x2d')](_0x4efe02[_0x453f('0x2e')],_0x35dd3b);}return _0x352a3e[_0x453f('0x2f')]('Account')[_0x453f('0x1e')](_0x4efe02,_0x3a4ecc);default:return null;}})[_0x453f('0x1f')](function(_0x5d24cf){if(_0x5d24cf&&_0x5d24cf[_0x453f('0x32')]){var _0x254704=_[_0x453f('0x38')](_0x5d24cf);if(_0x254704){return BPromise[_0x453f('0x22')]({'id':_0x254704['Id'],'name':_0x254704[_0x453f('0x23')],'phone':_0x254704[_0x453f('0x39')],'endUserType':_0x254704['attributes'][_0x453f('0x3a')][_0x453f('0x3b')]()});}}})[_0x453f('0x1f')](function(_0x234fd1){if(_0x234fd1){logger[_0x453f('0x19')](_0x453f('0x3c'),_0x234fd1['endUserType'],_0x52cd13);return BPromise[_0x453f('0x22')](_0x234fd1);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x52cd13);var _0x12ceba={'Phone':_0x52cd13};if(_0x526382[_0x453f('0x3d')]){if(_0x526382[_0x453f('0x3d')]===_0x453f('0x12')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x52cd13,_0x526382[_0x453f('0x3d')]);_0x12ceba['LastName']=_0x3f9704!=='<unknown>'?_0x3f9704:util[_0x453f('0x3e')](_0x453f('0x3f'),_0x52cd13);}else if(_0x526382[_0x453f('0x3d')]==='lead'){logger['info'](_0x453f('0x40'),_0x52cd13,_0x526382[_0x453f('0x3d')]);_0x12ceba['LastName']=_0x3f9704!=='<unknown>'?_0x3f9704:util[_0x453f('0x3e')]('Caller\x20-\x20%s',_0x52cd13);_0x12ceba[_0x453f('0x41')]=_0x453f('0x42');}else if(_0x526382[_0x453f('0x3d')]===_0x453f('0x17')){logger[_0x453f('0x19')](_0x453f('0x40'),_0x52cd13,_0x526382['moduleCreate']);_0x12ceba[_0x453f('0x23')]=_0x3f9704!==_0x453f('0x43')?_0x3f9704:util['format'](_0x453f('0x3f'),_0x52cd13);}else{return null;}}return _0x352a3e[_0x453f('0x2f')](_[_0x453f('0x44')](_0x526382[_0x453f('0x3d')]))[_0x453f('0x45')](_0x12ceba)['then'](function(_0x2940f2){return BPromise[_0x453f('0x22')]({'id':_0x2940f2['id'],'endUserType':_0x526382[_0x453f('0x3d')]});});}});}function getCustomFields(_0x564d35,_0x5bed40){var _0x39c15b={};if(_0x564d35[_0x453f('0x32')]>0x0){_['forEach'](_0x564d35,function(_0x3b4d2a){if(_[_0x453f('0x46')]([_0x453f('0x47'),'picklist'],_0x3b4d2a[_0x453f('0x3a')])&&_0x3b4d2a[_0x453f('0x48')]){_0x39c15b[_0x3b4d2a['idField']]=_0x3b4d2a[_0x453f('0x49')]['toString']();}else if(_0x3b4d2a[_0x453f('0x3a')]==='variable'&&_0x3b4d2a[_0x453f('0x4a')]&&_0x3b4d2a[_0x453f('0x48')]){_0x5bed40[_0x3b4d2a[_0x453f('0x4a')]]&&(_0x39c15b[_0x3b4d2a[_0x453f('0x48')]]=_0x5bed40[_0x3b4d2a['variableName']][_0x453f('0x4b')]());}else if(_0x3b4d2a[_0x453f('0x3a')]==='customVariable'&&_0x3b4d2a['Variable']&&_0x3b4d2a[_0x453f('0x4c')][_0x453f('0x4d')]&&_0x3b4d2a[_0x453f('0x48')]){_0x5bed40[_0x3b4d2a['Variable'][_0x453f('0x4d')][_0x453f('0x3b')]()]&&(_0x39c15b[_0x3b4d2a['idField']]=_0x5bed40[_0x3b4d2a[_0x453f('0x4c')][_0x453f('0x4d')][_0x453f('0x3b')]()][_0x453f('0x4b')]());}});}return _0x39c15b;}function getConnection(_0x2c648a){var _0x3bb890=_0x2c648a[_0x453f('0x4e')][_0x453f('0x4f')](_0x2c648a['securityToken']);var _0x3928f4=new jsforce[(_0x453f('0x50'))]({'oauth2':{'loginUrl':_0x2c648a[_0x453f('0x51')]||_0x453f('0x52'),'clientId':_0x2c648a['clientId'],'clientSecret':_0x2c648a[_0x453f('0x53')]}});return _0x3928f4[_0x453f('0x54')](_0x2c648a['username'],_0x3bb890)[_0x453f('0x1f')](function(){logger[_0x453f('0x19')](_0x453f('0x55'));return _0x3928f4;});}exports[_0x453f('0x56')]=function(_0x426897,_0xdbd0ab,_0xb1fa8b,_0x12e49c,_0x395cac,_0x33c473){var _0x541a38,_0x233306,_0x463e43,_0x32040d;_0x33c473[_0x453f('0x57')]=intUtil[_0x453f('0x58')](_0x33c473['serverUrl']);_0x33c473[_0x453f('0x51')]=intUtil[_0x453f('0x58')](_0x33c473['remoteUri']);if(_0x395cac&&_0x395cac['monitor_format']){logger[_0x453f('0x19')](_0x453f('0x59'),_0x453f('0x5a'));_0xdbd0ab['recordingURL']=util[_0x453f('0x3e')](_0x453f('0x5b'),_0x33c473['serverUrl'],_0xdbd0ab[_0x453f('0x5c')],md5(_0xdbd0ab[_0x453f('0x5c')]));}else{_0xdbd0ab[_0x453f('0x5d')]='';}return getConnection(_0x33c473)[_0x453f('0x1f')](function(_0x1258bf){_0x32040d=_0x1258bf;return getUser(_0x33c473,_0x12e49c[_0x453f('0x5e')],_0x32040d);})[_0x453f('0x1f')](function(_0x545036){_0x541a38=_0x545036;return getEndUser(_0x33c473,_0xb1fa8b,_0xdbd0ab[_0x453f('0x5f')],_0xdbd0ab[_0x453f('0x60')],_0x32040d);})[_0x453f('0x1f')](function(_0x392c72){_0x233306=_0x392c72;return getTicket(_0x33c473,_0x541a38,_0x233306,_0xb1fa8b,_0xdbd0ab,_0xb1fa8b[_0x453f('0x61')],_0x32040d,_0x453f('0x56'));})[_0x453f('0x1f')](function(_0x2ccb30){_0x463e43=_0x2ccb30;logger[_0x453f('0x19')](_0x453f('0x62'),_0x463e43['id']);logger[_0x453f('0x19')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x463e43['id'],_0x12e49c[_0x453f('0x4d')],_0x33c473[_0x453f('0x3a')]);switch(_0x33c473[_0x453f('0x3a')]){case'integrationTab':emit(util[_0x453f('0x3e')]('user:%s',_0x12e49c[_0x453f('0x4d')]),_0x453f('0x63'),{'recordId':_0x463e43['id']});break;case _0x453f('0x64'):emit(util['format'](_0x453f('0x65'),_0x12e49c[_0x453f('0x4d')]),_0x453f('0x66'),{'uri':util[_0x453f('0x3e')](_0x453f('0x67'),_0x32040d[_0x453f('0x68')],_0x463e43['id'])});break;default:logger[_0x453f('0x69')](_0x453f('0x6a'));}})['catch'](function(_0x223b02){logger[_0x453f('0x69')]('[QUEUE]',_0x223b02);});};exports[_0x453f('0x6b')]=function(_0x5b0a58,_0x447551,_0xf1b1f2,_0x52dded,_0x73437b,_0x1bcc0f,_0x57c27d){var _0x3f0cb6,_0x381139,_0x1a617e,_0x3662f7;_0x1bcc0f[_0x453f('0x57')]=intUtil[_0x453f('0x58')](_0x1bcc0f[_0x453f('0x57')]);_0x1bcc0f['remoteUri']=intUtil['stripTrailingSlash'](_0x1bcc0f['remoteUri']);if(_0x57c27d&&_0x57c27d[_0x453f('0x6c')]&&_0x57c27d[_0x453f('0x6c')]!==_0x453f('0x6d')){logger['info']('[OUTBOUND]',_0x453f('0x5a'));_0x447551[_0x453f('0x5d')]=util['format'](_0x453f('0x5b'),_0x1bcc0f[_0x453f('0x57')],_0x447551['uniqueid'],md5(_0x447551[_0x453f('0x5c')]));}return getConnection(_0x1bcc0f)['then'](function(_0x252845){_0x3662f7=_0x252845;return getUser(_0x1bcc0f,_0x52dded[_0x453f('0x5e')],_0x3662f7);})[_0x453f('0x1f')](function(_0x3d43d4){_0x3f0cb6=_0x3d43d4;return getEndUser(_0x1bcc0f,_0xf1b1f2,_0x447551['destcalleridname'],_0x447551['destcalleridnum'],_0x3662f7);})[_0x453f('0x1f')](function(_0x29ec88){_0x381139=_0x29ec88;return getTicket(_0x1bcc0f,_0x3f0cb6,_0x381139,_0xf1b1f2,_0x447551,_0xf1b1f2[_0x453f('0x61')],_0x3662f7,'outbound');})['then'](function(_0x309fa7){_0x1a617e=_0x309fa7;logger[_0x453f('0x19')](_0x453f('0x6e'),_0x1a617e['id']);logger['info'](_0x453f('0x6f'),_0x1a617e['id'],_0x52dded['name'],_0x1bcc0f['type']);switch(_0x1bcc0f[_0x453f('0x3a')]){case _0x453f('0x70'):emit(util['format'](_0x453f('0x65'),_0x52dded[_0x453f('0x4d')]),_0x453f('0x63'),{'recordId':_0x1a617e['id']});break;case'newTab':emit(util['format'](_0x453f('0x65'),_0x52dded[_0x453f('0x4d')]),_0x453f('0x66'),{'uri':util[_0x453f('0x3e')](_0x453f('0x67'),_0x3662f7[_0x453f('0x68')],_0x1a617e['id'])});break;default:logger[_0x453f('0x69')](_0x453f('0x71'),_0x453f('0x72'));}})[_0x453f('0x73')](function(_0x2aced6){logger['error'](_0x453f('0x71'),_0x2aced6);});};exports[_0x453f('0x74')]=function(_0x1d2d39,_0x36b573,_0x35b9c2,_0x387810,_0x1775e8,_0x1f313c){var _0x10832d,_0x208793,_0x4019bb,_0x63987a;_0x1f313c['serverUrl']=intUtil[_0x453f('0x58')](_0x1f313c[_0x453f('0x57')]);_0x1f313c[_0x453f('0x51')]=intUtil[_0x453f('0x58')](_0x1f313c[_0x453f('0x51')]);if(_0x1775e8&&_0x1775e8[_0x453f('0x75')]){logger[_0x453f('0x19')]('['+_0x36b573['lastevent'][_0x453f('0x76')]()+']','Recording\x20is\x20enabled!');_0x36b573[_0x453f('0x5d')]=util['format'](_0x453f('0x5b'),_0x1f313c[_0x453f('0x57')],_0x36b573[_0x453f('0x5c')],md5(_0x36b573[_0x453f('0x5c')]));}else{_0x36b573[_0x453f('0x5d')]='';}return getConnection(_0x1f313c)[_0x453f('0x1f')](function(_0x53d95b){_0x63987a=_0x53d95b;if(!_[_0x453f('0x1b')](_0x387810)){return getUser(_0x1f313c,_0x387810[_0x453f('0x4d')],_0x63987a);}else{return getUser(_0x1f313c,null,_0x63987a);}})[_0x453f('0x1f')](function(_0x25d9ee){_0x10832d=_0x25d9ee;return getEndUser(_0x1f313c,_0x35b9c2,_0x36b573['calleridname'],_0x36b573['calleridnum'],_0x63987a);})[_0x453f('0x1f')](function(_0x375f32){_0x208793=_0x375f32;return getTicket(_0x1f313c,_0x10832d,_0x208793,_0x35b9c2,_0x36b573,_0x35b9c2[_0x453f('0x61')],_0x63987a);})[_0x453f('0x1f')](function(_0x173989){_0x4019bb=_0x173989;logger[_0x453f('0x19')]('['+_0x36b573[_0x453f('0x77')][_0x453f('0x76')]()+']\x20Ticket\x20%s\x20created.',_0x4019bb['id']);logger[_0x453f('0x19')]('['+_0x36b573[_0x453f('0x77')][_0x453f('0x76')]()+_0x453f('0x78'),_0x1f313c[_0x453f('0x3a')]);})['catch'](function(_0x45a55d){logger['error']('['+_0x36b573[_0x453f('0x77')][_0x453f('0x76')]()+']',_0x45a55d);});};
\ No newline at end of file
index 60f6752..798bd36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d75=['sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','sys_id','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','includes','idField','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','Subjects','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','userEmail','isNil','adminEmail','destcalleridnum','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail'];(function(_0x18d533,_0xaabad8){var _0x5897b4=function(_0x514261){while(--_0x514261){_0x18d533['push'](_0x18d533['shift']());}};_0x5897b4(++_0xaabad8);}(_0x4d75,0x12e));var _0x54d7=function(_0x18c69d,_0x136423){_0x18c69d=_0x18c69d-0x0;var _0x3d9270=_0x4d75[_0x18c69d];return _0x3d9270;};'use strict';var _=require(_0x54d7('0x0'));var Promise=require(_0x54d7('0x1'));var rp=require(_0x54d7('0x2'));var util=require('util');var md5=require(_0x54d7('0x3'));var Redis=require(_0x54d7('0x4'));var intUtil=require(_0x54d7('0x5'));var config=require(_0x54d7('0x6'));var logger=require('../../../../config/logger')(_0x54d7('0x7'));config['redis']=_[_0x54d7('0x8')](config[_0x54d7('0x9')],{'host':_0x54d7('0xa'),'port':0x18eb});var io=require(_0x54d7('0xb'))(new Redis(config[_0x54d7('0x9')]));function getAdminUser(_0x4fec5e,_0x259c2b,_0x14418a,_0x18f127,_0x30dff1,_0x400bf7){return new Promise(function(_0x57b0dc,_0x441f87){var _0x2ac435={'method':_0x54d7('0xc'),'uri':_0x18f127+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x30dff1+'&'+_0x400bf7,'auth':_0x259c2b,'json':!![]};return rp(_0x2ac435)[_0x54d7('0xd')](function(_0x4804a9){if(_0x4804a9[_0x54d7('0xe')][_0x54d7('0xf')]>0x0){_0x14418a[_0x54d7('0x10')]=_0x4804a9[_0x54d7('0xe')][0x0]['sys_id'];}logger[_0x54d7('0x11')]('['+[_0x4fec5e[_0x54d7('0x12')]()]+_0x54d7('0x13'),_0x14418a);_0x57b0dc(_0x14418a);})[_0x54d7('0x14')](function(_0x585a33){logger[_0x54d7('0x15')]('['+[_0x4fec5e['toUpperCase']()]+']',_0x585a33[_0x54d7('0x16')]);_0x441f87(_0x585a33[_0x54d7('0x16')]);});});}function getUser(_0x39e641,_0x5ef894,_0xee4be5,_0x3ec298,_0xf0a988){return function(_0x2e2ea5){logger[_0x54d7('0x11')]('['+[_0x39e641[_0x54d7('0x12')]()]+_0x54d7('0x17'),_0x2e2ea5);return new Promise(function(_0x2cbf67,_0x55f96c){if(intUtil[_0x54d7('0x18')](_0x2e2ea5['userEmail'])){var _0x18097b={'method':_0x54d7('0xc'),'uri':_0xee4be5+_0x54d7('0x19')+_0x2e2ea5['userEmail']+'&'+_0x3ec298+'&'+_0xf0a988,'auth':_0x5ef894,'json':!![]};logger[_0x54d7('0x11')]('['+[_0x39e641[_0x54d7('0x12')]()]+_0x54d7('0x1a'),_0x18097b);return rp(_0x18097b)[_0x54d7('0xd')](function(_0x593447){logger['info']('['+[_0x39e641[_0x54d7('0x12')]()]+_0x54d7('0x1b'),_0x593447);if(_0x593447['result']['length']>0x0&&String(_0x593447['result'][0x0]['active'])===_0x54d7('0x1c')){_0x2e2ea5[_0x54d7('0x1d')]=_0x593447[_0x54d7('0xe')][0x0][_0x54d7('0x1e')];}else{_0x2e2ea5[_0x54d7('0x1d')]=_0x2e2ea5[_0x54d7('0x10')];_0x2e2ea5['userEmail']=_0x2e2ea5['adminEmail'];}logger[_0x54d7('0x11')]('['+[_0x39e641[_0x54d7('0x12')]()]+_0x54d7('0x1f'),_0x2e2ea5);_0x2cbf67(_0x2e2ea5);})[_0x54d7('0x14')](function(_0x31b458){logger['error']('['+[_0x39e641['toUpperCase']()]+']',_0x31b458[_0x54d7('0x16')]);_0x55f96c(_0x31b458[_0x54d7('0x16')]);});}else{logger[_0x54d7('0x11')]('['+[_0x39e641[_0x54d7('0x12')]()]+_0x54d7('0x20'));_0x2e2ea5[_0x54d7('0x1d')]=_0x2e2ea5[_0x54d7('0x10')];_0x2e2ea5['userEmail']=_0x2e2ea5['adminEmail'];_0x2cbf67(_0x2e2ea5);}});};}function createEndUser(_0x5d48d9,_0x4cb39f,_0x46950a,_0x1a0400,_0x1b72fb){logger[_0x54d7('0x11')]('['+[_0x5d48d9[_0x54d7('0x12')]()]+_0x54d7('0x21'),_0x46950a);return new Promise(function(_0x18411c,_0x3f1c56){var _0x333a63={'method':_0x54d7('0x22'),'uri':_0x1a0400+_0x54d7('0x23')+_0x1b72fb,'body':{'user_name':_0x46950a[_0x54d7('0x24')],'roles':_0x54d7('0x25'),'first_name':_0x46950a[_0x54d7('0x24')],'active':_0x54d7('0x1c'),'date_format':'System','phone':_0x46950a['endUserNumber']},'auth':_0x4cb39f,'json':!![]};return rp(_0x333a63)[_0x54d7('0xd')](function(_0x294f75){logger[_0x54d7('0x11')]('['+[_0x5d48d9['toUpperCase']()]+'],\x20EndUser\x20schema',_0x294f75[_0x54d7('0xe')]);_0x46950a['endUserId']=_0x294f75['result'][_0x54d7('0x1e')];_0x18411c(_0x46950a);})[_0x54d7('0x14')](function(_0x1807e0){logger[_0x54d7('0x15')]('['+[_0x5d48d9[_0x54d7('0x12')]()]+']',_0x1807e0[_0x54d7('0x16')]);_0x3f1c56(_0x1807e0[_0x54d7('0x16')]);});});}function getEndUser(_0x5ce0ea,_0x17d6ee,_0x27ea1c,_0x2d7587,_0x525e6d){return function(_0x2923c2){logger[_0x54d7('0x11')]('['+[_0x5ce0ea[_0x54d7('0x12')]()]+_0x54d7('0x26'),_0x2923c2);return new Promise(function(_0x334eae,_0x135e15){var _0x15394a={'method':_0x54d7('0xc'),'uri':_0x27ea1c+'sys_user?sysparm_query=phone%3D'+_0x2923c2['endUserNumber']+'&'+_0x2d7587+'&'+_0x525e6d,'auth':_0x17d6ee,'json':!![]};return rp(_0x15394a)[_0x54d7('0xd')](function(_0x315b3d){if(_0x315b3d[_0x54d7('0xe')][_0x54d7('0xf')]>0x0){_0x2923c2['endUserId']=_0x315b3d[_0x54d7('0xe')][0x0][_0x54d7('0x1e')];logger[_0x54d7('0x11')]('['+[_0x5ce0ea['toUpperCase']()]+_0x54d7('0x27'),_0x2923c2);_0x334eae(_0x2923c2);}else{return createEndUser(_0x5ce0ea,_0x17d6ee,_0x2923c2,_0x27ea1c,_0x2d7587)[_0x54d7('0xd')](function(_0x5b0a88){logger[_0x54d7('0x11')]('['+[_0x5ce0ea['toUpperCase']()]+_0x54d7('0x28'),_0x5b0a88);_0x334eae(_0x5b0a88);});}})[_0x54d7('0x14')](function(_0x4bb275){logger[_0x54d7('0x15')]('['+[_0x5ce0ea['toUpperCase']()]+']',_0x4bb275[_0x54d7('0x16')]);_0x135e15(_0x4bb275['message']);});});};}function getCustomFields(_0x5a5988,_0x5efe91){var _0x3b6b48={};if(_0x5a5988['length']>0x0){_[_0x54d7('0x29')](_0x5a5988,function(_0x2cd696){if(_['includes']([_0x54d7('0x2a'),_0x54d7('0x2b')],_0x2cd696[_0x54d7('0x2c')])&&_0x2cd696[_0x54d7('0x2d')]&&!_0x2cd696[_0x54d7('0x2e')]){_0x3b6b48[_0x2cd696[_0x54d7('0x2d')][_0x54d7('0x2f')]()]=_0x2cd696['content']['toString']();}else if(_[_0x54d7('0x30')]([_0x54d7('0x2a'),'picklist'],_0x2cd696[_0x54d7('0x2c')])&&_0x2cd696[_0x54d7('0x31')]&&_0x2cd696[_0x54d7('0x2e')]){_0x3b6b48[_0x2cd696['idField'][_0x54d7('0x2f')]()]=_0x2cd696[_0x54d7('0x32')][_0x54d7('0x33')]();}else if(_0x2cd696[_0x54d7('0x2c')]===_0x54d7('0x34')&&_0x2cd696[_0x54d7('0x35')]&&_0x2cd696[_0x54d7('0x31')]&&_0x2cd696[_0x54d7('0x2e')]){_0x3b6b48[_0x2cd696[_0x54d7('0x31')]['toLowerCase']()]=_0x5efe91[_0x2cd696[_0x54d7('0x35')]]['toString']();}else if(_0x2cd696[_0x54d7('0x2c')]===_0x54d7('0x36')&&_0x2cd696[_0x54d7('0x37')]&&_0x2cd696[_0x54d7('0x37')][_0x54d7('0x38')]&&_0x2cd696[_0x54d7('0x31')]&&_0x2cd696[_0x54d7('0x2e')]){_0x3b6b48[_0x2cd696[_0x54d7('0x31')]['toLowerCase']()]=_0x5efe91[_0x2cd696[_0x54d7('0x37')]['name'][_0x54d7('0x2f')]()]['toString']();}});}return _0x3b6b48;}function getTicket(_0x463d5b,_0x362048,_0x599f7e,_0x3dc9e7,_0x19352e,_0x16ee93){return function(_0x46885d){logger[_0x54d7('0x11')]('['+[_0x463d5b[_0x54d7('0x12')]()]+_0x54d7('0x39'),_0x46885d);return new Promise(function(_0x29e8be,_0x5bb449){var _0x5ec026=_0x463d5b[_0x54d7('0x2f')]()===_0x54d7('0x3a')?_0x46885d[_0x54d7('0x1d')]:_0x46885d[_0x54d7('0x3b')];var _0x23b0ca={'method':_0x54d7('0x22'),'uri':_0x599f7e+_0x54d7('0x3c')+'?'+_0x16ee93,'body':Object[_0x54d7('0x3d')]({},{'active':_0x54d7('0x1c'),'caller_id':_0x5ec026,'assigned_to':_0x46885d[_0x54d7('0x1d')],'short_description':intUtil['getString'](_0x3dc9e7[_0x54d7('0x3e')],_0x19352e,'\x20'),'description':intUtil[_0x54d7('0x3f')](_0x3dc9e7['Descriptions'],_0x19352e,'\x0a')},getCustomFields(_0x3dc9e7[_0x54d7('0x40')],_0x19352e)),'auth':_0x362048,'json':!![]};return rp(_0x23b0ca)[_0x54d7('0xd')](function(_0x36602f){logger[_0x54d7('0x11')]('['+[_0x463d5b[_0x54d7('0x12')]()]+_0x54d7('0x41'),_0x36602f[_0x54d7('0xe')]);_0x46885d['ticketId']=_0x36602f[_0x54d7('0xe')]['sys_id'];_0x46885d['ticketNumber']=_0x36602f[_0x54d7('0xe')][_0x54d7('0x42')];logger['info']('['+[_0x463d5b[_0x54d7('0x12')]()]+_0x54d7('0x43'),_0x46885d);_0x29e8be(_0x46885d);})[_0x54d7('0x14')](function(_0x390939){logger['error']('['+[_0x463d5b[_0x54d7('0x12')]()]+']',_0x390939[_0x54d7('0x16')]);_0x5bb449(_0x390939[_0x54d7('0x16')]);});});};}function createRemoteTag(_0x3cc5e1,_0x2cf6d4,_0x3829e1,_0x23a40b){return new Promise(function(_0x29e6b6,_0x4a7c33){var _0x10e73d={'method':_0x54d7('0x22'),'uri':_0x3829e1+_0x54d7('0x44')+'?'+_0x23a40b,'body':{'short_description':_0x3cc5e1,'global':!![],'active':!![],'name':_0x3cc5e1},'auth':_0x2cf6d4,'json':!![]};return rp(_0x10e73d)['then'](function(_0x51f72e){var _0x155381=_0x51f72e[_0x54d7('0xe')][_0x54d7('0x1e')];_0x29e6b6(_0x155381);});});}function getRemoteTag(_0x27d6a2,_0x5ea6b4,_0x3f6d86,_0x15fa1b,_0xe485a4){return new Promise(function(_0x366fc2,_0x605984){var _0x489d7e={'method':_0x54d7('0xc'),'uri':_0x3f6d86+'label'+'?sysparm_query=name%3D'+_0x27d6a2+'&'+_0x15fa1b,'auth':_0x5ea6b4,'json':!![]};return rp(_0x489d7e)[_0x54d7('0xd')](function(_0x5ccc36){if(_0x5ccc36[_0x54d7('0xe')][_0x54d7('0xf')]>0x0){var _0xd105be=_0x5ccc36[_0x54d7('0xe')][0x0][_0x54d7('0x1e')];_0x366fc2(_0xd105be);}else{return createRemoteTag(_0x27d6a2,_0x5ea6b4,_0x3f6d86,_0x15fa1b)[_0x54d7('0xd')](function(_0x2cd32b){_0x366fc2(_0x2cd32b);});}});});}function assignTagToIncident(_0x51cd8d,_0x277736,_0x53d19e,_0x27d963,_0x270425){return new Promise(function(_0x5b4bcb,_0x60c461){var _0x5de84f={'method':_0x54d7('0x22'),'uri':_0x53d19e+'label_entry'+'?'+_0x270425,'body':{'label':_0x51cd8d,'table':'incident','id_type':_0x54d7('0x45'),'table_key':_0x27d963[_0x54d7('0x46')],'title':_0x54d7('0x47')+_0x27d963[_0x54d7('0x48')],'id_display':_0x27d963['ticketNumber']},'auth':_0x277736,'json':!![]};return rp(_0x5de84f)['then'](function(_0x500341){_0x5b4bcb();})['catch'](function(){_0x5b4bcb();});});}function manageTags(_0x48e3a7,_0x38c0ae,_0xe39b92,_0x158d89,_0x28c8cc,_0x1d6f6d,_0x2f08bd){return new Promise(function(_0xb5c738,_0xe206f3){var _0x2bb1cf=[];_0x38c0ae['forEach'](function(_0x3e8a32){_0x2bb1cf[_0x54d7('0x49')](getRemoteTag(_0x3e8a32,_0xe39b92,_0x158d89,_0x1d6f6d,_0x2f08bd));});return Promise[_0x54d7('0x4a')](_0x2bb1cf)[_0x54d7('0xd')](function(_0x116f5b){if(_0x116f5b[_0x54d7('0xf')]){logger[_0x54d7('0x11')]('['+[_0x48e3a7['toUpperCase']()]+_0x54d7('0x4b'),_0x116f5b);var _0x95c2b8=[];_0x116f5b[_0x54d7('0x29')](function(_0x1f295e){_0x95c2b8[_0x54d7('0x49')](assignTagToIncident(_0x1f295e,_0xe39b92,_0x158d89,_0x28c8cc,_0x1d6f6d));});return Promise['all'](_0x95c2b8)[_0x54d7('0xd')](function(){_0xb5c738();})['catch'](function(){_0xb5c738();});}else{_0xb5c738();}});});}function getTags(_0x410cce,_0x3c734f,_0x46f434,_0x426d8e,_0x51f3b4,_0xa8f123){return function(_0x1d7546){return new Promise(function(_0x52dafd,_0x3b4252){var _0x3c1ba2=[];var _0x41480f=_0x426d8e[_0x54d7('0x4c')];if(_0x41480f&&_0x41480f['length']>0x0){_0x3c1ba2=_[_0x54d7('0x4d')](_0x41480f,_0x54d7('0x38'));}if(_0x3c1ba2[_0x54d7('0xf')]>0x0){return manageTags(_0x410cce,_0x3c1ba2,_0x3c734f,_0x46f434,_0x1d7546,_0x51f3b4,_0xa8f123)[_0x54d7('0xd')](function(){_0x52dafd(_0x1d7546);});}else{_0x52dafd(_0x1d7546);}});};}function emit(_0x2ab434,_0x149aa7,_0x415971){var _0x35f8f4=_0x54d7('0x4e')+_0x54d7('0x4f')+_0x54d7('0x50')+_0x54d7('0x51');var _0x54d022={'uri':_0x2ab434+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x415971+_0x35f8f4};io['to'](util[_0x54d7('0x52')](_0x54d7('0x53'),_0x149aa7))[_0x54d7('0x54')](_0x54d7('0x55'),_0x54d022);}exports['cs']=function(_0x4c846a,_0x9e24f,_0x71e9d8,_0x45487a,_0x5ea7ae,_0x60834a,_0x4863b6,_0x17e18c){var _0x5d3789={};var _0x2acd4a={'user':_0x60834a['username'],'pass':_0x60834a['password']};var _0x1d3b25=_0x54d7('0x56');var _0x499f9e=_0x54d7('0x57');_0x60834a[_0x54d7('0x58')]=intUtil[_0x54d7('0x59')](_0x60834a[_0x54d7('0x58')]);_0x60834a[_0x54d7('0x5a')]=intUtil['stripTrailingSlash'](_0x60834a[_0x54d7('0x5a')]);var _0x4f5c43=util[_0x54d7('0x52')](_0x54d7('0x5b'),_0x60834a[_0x54d7('0x58')]);_0x5d3789[_0x54d7('0x5c')]=!_[_0x54d7('0x5d')](_0x45487a)?_0x45487a['email']:null;_0x5d3789[_0x54d7('0x5e')]=_0x60834a['email'];_0x5d3789[_0x54d7('0x24')]=_0x17e18c['toLowerCase']()===_0x54d7('0x3a')?_0x9e24f[_0x54d7('0x5f')]:_0x9e24f['calleridnum'];_0x5d3789['callDirection']=_0x17e18c==='queue'||_0x17e18c===_0x54d7('0x60')?_0x54d7('0x61'):_0x54d7('0x3a');var _0x673243=util[_0x54d7('0x52')](_0x54d7('0x62'),_0x60834a['serverUrl'],_0x9e24f[_0x54d7('0x63')],md5(_0x9e24f[_0x54d7('0x63')]));if(_0x5ea7ae&&_0x5ea7ae[_0x54d7('0x64')]){logger[_0x54d7('0x11')](_0x54d7('0x65'),'Recording\x20is\x20enabled!');_0x9e24f[_0x54d7('0x66')]=_0x673243;}else if(_0x4863b6&&_0x4863b6[_0x54d7('0x67')]&&_0x4863b6[_0x54d7('0x67')]!==_0x54d7('0x68')){logger['info']('[OUTBOUND]',_0x54d7('0x69'));_0x9e24f[_0x54d7('0x66')]=_0x673243;}else{_0x9e24f[_0x54d7('0x66')]='';}return getAdminUser(_0x17e18c,_0x2acd4a,_0x5d3789,_0x4f5c43,_0x499f9e,_0x1d3b25)['then'](getUser(_0x17e18c,_0x2acd4a,_0x4f5c43,_0x499f9e,_0x1d3b25))[_0x54d7('0xd')](getEndUser(_0x17e18c,_0x2acd4a,_0x4f5c43,_0x499f9e,_0x1d3b25))[_0x54d7('0xd')](getTicket(_0x17e18c,_0x2acd4a,_0x4f5c43,_0x71e9d8,_0x9e24f,_0x499f9e))[_0x54d7('0xd')](function(_0x2c4f32){logger['info'](util['format'](_0x54d7('0x6a'),_0x2c4f32[_0x54d7('0x46')]));logger['info'](util['format'](_0x54d7('0x6b'),_0x17e18c));if(_0x17e18c!==_0x54d7('0x60')){logger[_0x54d7('0x11')]('['+[_0x17e18c['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x60834a[_0x54d7('0x58')],_0x45487a[_0x54d7('0x38')],_0x2c4f32[_0x54d7('0x46')]);}})[_0x54d7('0x14')](function(_0x2be820){logger[_0x54d7('0x15')]('['+[_0x17e18c['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x54d7('0x6c')](_0x2be820,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x63ea=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','catch','error','message','validateEmail','sys_user?sysparm_query=email%3D','info','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','userEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','POST','endUserNumber','user','true','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toString','idField','content','variable','variableName','toLowerCase','Variable','name',']\x20getTicket\x20input\x20crm','incident','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','user:%s','username','password','sysparm_limit=1','stripTrailingSlash','serverUrl','remoteUri','isNil','email','outbound'];(function(_0x42c340,_0x14d8e1){var _0x5db232=function(_0x3e08b9){while(--_0x3e08b9){_0x42c340['push'](_0x42c340['shift']());}};_0x5db232(++_0x14d8e1);}(_0x63ea,0x152));var _0xa63e=function(_0xa79b48,_0x5d389b){_0xa79b48=_0xa79b48-0x0;var _0x5ce814=_0x63ea[_0xa79b48];return _0x5ce814;};'use strict';var _=require(_0xa63e('0x0'));var Promise=require(_0xa63e('0x1'));var rp=require(_0xa63e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0xa63e('0x3'));var intUtil=require('./util');var config=require(_0xa63e('0x4'));var logger=require(_0xa63e('0x5'))('servicenow');config[_0xa63e('0x6')]=_[_0xa63e('0x7')](config[_0xa63e('0x6')],{'host':_0xa63e('0x8'),'port':0x18eb});var io=require(_0xa63e('0x9'))(new Redis(config['redis']));function getAdminUser(_0x26460d,_0x27253e,_0x34a408,_0x55a00c,_0x42883d,_0x1252c4){return new Promise(function(_0x4cc88b,_0x5c1d9b){var _0x3b659e={'method':_0xa63e('0xa'),'uri':_0x55a00c+_0xa63e('0xb')+'&'+_0x42883d+'&'+_0x1252c4,'auth':_0x27253e,'json':!![]};return rp(_0x3b659e)[_0xa63e('0xc')](function(_0x23a591){if(_0x23a591[_0xa63e('0xd')][_0xa63e('0xe')]>0x0){_0x34a408[_0xa63e('0xf')]=_0x23a591[_0xa63e('0xd')][0x0][_0xa63e('0x10')];}logger['info']('['+[_0x26460d[_0xa63e('0x11')]()]+'],\x20getAdminUser\x20crm',_0x34a408);_0x4cc88b(_0x34a408);})[_0xa63e('0x12')](function(_0x19a0eb){logger[_0xa63e('0x13')]('['+[_0x26460d['toUpperCase']()]+']',_0x19a0eb[_0xa63e('0x14')]);_0x5c1d9b(_0x19a0eb[_0xa63e('0x14')]);});});}function getUser(_0x3b96d7,_0x56bed6,_0x279b77,_0x31c7fb,_0x255901){return function(_0x10408c){logger['info']('['+[_0x3b96d7[_0xa63e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x10408c);return new Promise(function(_0x4fd67b,_0xe2150c){if(intUtil[_0xa63e('0x15')](_0x10408c['userEmail'])){var _0x5d7b77={'method':'GET','uri':_0x279b77+_0xa63e('0x16')+_0x10408c['userEmail']+'&'+_0x31c7fb+'&'+_0x255901,'auth':_0x56bed6,'json':!![]};logger[_0xa63e('0x17')]('['+[_0x3b96d7[_0xa63e('0x11')]()]+_0xa63e('0x18'),_0x5d7b77);return rp(_0x5d7b77)[_0xa63e('0xc')](function(_0x26f014){logger[_0xa63e('0x17')]('['+[_0x3b96d7[_0xa63e('0x11')]()]+_0xa63e('0x19'),_0x26f014);if(_0x26f014[_0xa63e('0xd')][_0xa63e('0xe')]>0x0&&String(_0x26f014[_0xa63e('0xd')][0x0][_0xa63e('0x1a')])==='true'){_0x10408c[_0xa63e('0x1b')]=_0x26f014[_0xa63e('0xd')][0x0][_0xa63e('0x10')];}else{_0x10408c[_0xa63e('0x1b')]=_0x10408c[_0xa63e('0xf')];_0x10408c[_0xa63e('0x1c')]=_0x10408c['adminEmail'];}logger['info']('['+[_0x3b96d7[_0xa63e('0x11')]()]+_0xa63e('0x1d'),_0x10408c);_0x4fd67b(_0x10408c);})['catch'](function(_0x3019c0){logger[_0xa63e('0x13')]('['+[_0x3b96d7[_0xa63e('0x11')]()]+']',_0x3019c0[_0xa63e('0x14')]);_0xe2150c(_0x3019c0[_0xa63e('0x14')]);});}else{logger[_0xa63e('0x17')]('['+[_0x3b96d7[_0xa63e('0x11')]()]+_0xa63e('0x1e'));_0x10408c[_0xa63e('0x1b')]=_0x10408c['adminId'];_0x10408c[_0xa63e('0x1c')]=_0x10408c[_0xa63e('0x1f')];_0x4fd67b(_0x10408c);}});};}function createEndUser(_0x4f08ba,_0x1f2fef,_0x4172a9,_0x451d17,_0x79858b){logger[_0xa63e('0x17')]('['+[_0x4f08ba['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x4172a9);return new Promise(function(_0x128349,_0x222e04){var _0x146ab1={'method':_0xa63e('0x20'),'uri':_0x451d17+'sys_user?'+_0x79858b,'body':{'user_name':_0x4172a9[_0xa63e('0x21')],'roles':_0xa63e('0x22'),'first_name':_0x4172a9['endUserNumber'],'active':_0xa63e('0x23'),'date_format':_0xa63e('0x24'),'phone':_0x4172a9['endUserNumber']},'auth':_0x1f2fef,'json':!![]};return rp(_0x146ab1)[_0xa63e('0xc')](function(_0x49acf4){logger['info']('['+[_0x4f08ba['toUpperCase']()]+_0xa63e('0x25'),_0x49acf4[_0xa63e('0xd')]);_0x4172a9['endUserId']=_0x49acf4[_0xa63e('0xd')][_0xa63e('0x10')];_0x128349(_0x4172a9);})['catch'](function(_0x47f71f){logger[_0xa63e('0x13')]('['+[_0x4f08ba['toUpperCase']()]+']',_0x47f71f[_0xa63e('0x14')]);_0x222e04(_0x47f71f[_0xa63e('0x14')]);});});}function getEndUser(_0x532651,_0x392a81,_0x279c30,_0x21f703,_0x1a1013){return function(_0x69cd60){logger[_0xa63e('0x17')]('['+[_0x532651[_0xa63e('0x11')]()]+_0xa63e('0x26'),_0x69cd60);return new Promise(function(_0xc7c626,_0x60a810){var _0x2e8dc3={'method':_0xa63e('0xa'),'uri':_0x279c30+_0xa63e('0x27')+_0x69cd60[_0xa63e('0x21')]+'&'+_0x21f703+'&'+_0x1a1013,'auth':_0x392a81,'json':!![]};return rp(_0x2e8dc3)[_0xa63e('0xc')](function(_0x2f9d4b){if(_0x2f9d4b[_0xa63e('0xd')][_0xa63e('0xe')]>0x0){_0x69cd60[_0xa63e('0x28')]=_0x2f9d4b[_0xa63e('0xd')][0x0]['sys_id'];logger['info']('['+[_0x532651[_0xa63e('0x11')]()]+_0xa63e('0x29'),_0x69cd60);_0xc7c626(_0x69cd60);}else{return createEndUser(_0x532651,_0x392a81,_0x69cd60,_0x279c30,_0x21f703)['then'](function(_0x539004){logger[_0xa63e('0x17')]('['+[_0x532651['toUpperCase']()]+_0xa63e('0x2a'),_0x539004);_0xc7c626(_0x539004);});}})['catch'](function(_0xbeaf5c){logger[_0xa63e('0x13')]('['+[_0x532651['toUpperCase']()]+']',_0xbeaf5c[_0xa63e('0x14')]);_0x60a810(_0xbeaf5c[_0xa63e('0x14')]);});});};}function getCustomFields(_0x22a403,_0x4c884a){var _0x5e484c={};if(_0x22a403[_0xa63e('0xe')]>0x0){_[_0xa63e('0x2b')](_0x22a403,function(_0x53fcb8){if(_[_0xa63e('0x2c')]([_0xa63e('0x2d'),_0xa63e('0x2e')],_0x53fcb8[_0xa63e('0x2f')])&&_0x53fcb8[_0xa63e('0x30')]&&!_0x53fcb8[_0xa63e('0x31')]){_0x5e484c[_0x53fcb8[_0xa63e('0x30')]['toLowerCase']()]=_0x53fcb8['content'][_0xa63e('0x32')]();}else if(_[_0xa63e('0x2c')]([_0xa63e('0x2d'),_0xa63e('0x2e')],_0x53fcb8['type'])&&_0x53fcb8[_0xa63e('0x33')]&&_0x53fcb8[_0xa63e('0x31')]){_0x5e484c[_0x53fcb8[_0xa63e('0x33')]['toLowerCase']()]=_0x53fcb8[_0xa63e('0x34')][_0xa63e('0x32')]();}else if(_0x53fcb8[_0xa63e('0x2f')]===_0xa63e('0x35')&&_0x53fcb8[_0xa63e('0x36')]&&_0x53fcb8[_0xa63e('0x33')]&&_0x53fcb8[_0xa63e('0x31')]){_0x5e484c[_0x53fcb8[_0xa63e('0x33')][_0xa63e('0x37')]()]=_0x4c884a[_0x53fcb8['variableName']][_0xa63e('0x32')]();}else if(_0x53fcb8[_0xa63e('0x2f')]==='customVariable'&&_0x53fcb8[_0xa63e('0x38')]&&_0x53fcb8[_0xa63e('0x38')]['name']&&_0x53fcb8[_0xa63e('0x33')]&&_0x53fcb8[_0xa63e('0x31')]){_0x5e484c[_0x53fcb8[_0xa63e('0x33')]['toLowerCase']()]=_0x4c884a[_0x53fcb8['Variable'][_0xa63e('0x39')][_0xa63e('0x37')]()][_0xa63e('0x32')]();}});}return _0x5e484c;}function getTicket(_0x4c6dd4,_0x1aa487,_0x490762,_0x2c329e,_0x502be4,_0x2f4542){return function(_0x158309){logger[_0xa63e('0x17')]('['+[_0x4c6dd4['toUpperCase']()]+_0xa63e('0x3a'),_0x158309);return new Promise(function(_0x544df8,_0x15368d){var _0x5a4fc2=_0x4c6dd4[_0xa63e('0x37')]()==='outbound'?_0x158309[_0xa63e('0x1b')]:_0x158309[_0xa63e('0x28')];var _0x16fee0={'method':_0xa63e('0x20'),'uri':_0x490762+_0xa63e('0x3b')+'?'+_0x2f4542,'body':Object['assign']({},{'active':'true','caller_id':_0x5a4fc2,'assigned_to':_0x158309[_0xa63e('0x1b')],'short_description':intUtil[_0xa63e('0x3c')](_0x2c329e[_0xa63e('0x3d')],_0x502be4,'\x20'),'description':intUtil['getString'](_0x2c329e['Descriptions'],_0x502be4,'\x0a')},getCustomFields(_0x2c329e[_0xa63e('0x3e')],_0x502be4)),'auth':_0x1aa487,'json':!![]};return rp(_0x16fee0)[_0xa63e('0xc')](function(_0x52b138){logger[_0xa63e('0x17')]('['+[_0x4c6dd4[_0xa63e('0x11')]()]+_0xa63e('0x3f'),_0x52b138[_0xa63e('0xd')]);_0x158309['ticketId']=_0x52b138[_0xa63e('0xd')][_0xa63e('0x10')];_0x158309[_0xa63e('0x40')]=_0x52b138[_0xa63e('0xd')][_0xa63e('0x41')];logger[_0xa63e('0x17')]('['+[_0x4c6dd4['toUpperCase']()]+_0xa63e('0x42'),_0x158309);_0x544df8(_0x158309);})[_0xa63e('0x12')](function(_0x4cb512){logger[_0xa63e('0x13')]('['+[_0x4c6dd4[_0xa63e('0x11')]()]+']',_0x4cb512[_0xa63e('0x14')]);_0x15368d(_0x4cb512['message']);});});};}function createRemoteTag(_0x2a3c94,_0x5ef06b,_0x3c2f24,_0x1ea78d){return new Promise(function(_0x557e1c,_0x4e01cb){var _0x2610c7={'method':_0xa63e('0x20'),'uri':_0x3c2f24+'label'+'?'+_0x1ea78d,'body':{'short_description':_0x2a3c94,'global':!![],'active':!![],'name':_0x2a3c94},'auth':_0x5ef06b,'json':!![]};return rp(_0x2610c7)[_0xa63e('0xc')](function(_0x303ea6){var _0xa012db=_0x303ea6[_0xa63e('0xd')]['sys_id'];_0x557e1c(_0xa012db);});});}function getRemoteTag(_0x502885,_0x41c647,_0x10678a,_0x5f25a9,_0x2b2ae5){return new Promise(function(_0x2afdd0,_0x2ce28b){var _0x441642={'method':_0xa63e('0xa'),'uri':_0x10678a+_0xa63e('0x43')+_0xa63e('0x44')+_0x502885+'&'+_0x5f25a9,'auth':_0x41c647,'json':!![]};return rp(_0x441642)[_0xa63e('0xc')](function(_0x2db188){if(_0x2db188[_0xa63e('0xd')][_0xa63e('0xe')]>0x0){var _0x11eef4=_0x2db188[_0xa63e('0xd')][0x0]['sys_id'];_0x2afdd0(_0x11eef4);}else{return createRemoteTag(_0x502885,_0x41c647,_0x10678a,_0x5f25a9)[_0xa63e('0xc')](function(_0x4c5ad2){_0x2afdd0(_0x4c5ad2);});}});});}function assignTagToIncident(_0x3da661,_0x56a8f0,_0x5af8eb,_0x432ef1,_0x21b576){return new Promise(function(_0x53ac4e,_0x146e65){var _0x550c1a={'method':_0xa63e('0x20'),'uri':_0x5af8eb+_0xa63e('0x45')+'?'+_0x21b576,'body':{'label':_0x3da661,'table':'incident','id_type':_0xa63e('0x46'),'table_key':_0x432ef1[_0xa63e('0x47')],'title':_0xa63e('0x48')+_0x432ef1[_0xa63e('0x40')],'id_display':_0x432ef1[_0xa63e('0x40')]},'auth':_0x56a8f0,'json':!![]};return rp(_0x550c1a)[_0xa63e('0xc')](function(_0x199c80){_0x53ac4e();})[_0xa63e('0x12')](function(){_0x53ac4e();});});}function manageTags(_0x7cbb8b,_0x50a21c,_0x2416ec,_0x4b521c,_0x300686,_0x6f5f7f,_0x1dbd93){return new Promise(function(_0x29206e,_0x2001c6){var _0x13046d=[];_0x50a21c['forEach'](function(_0x3d1dbf){_0x13046d[_0xa63e('0x49')](getRemoteTag(_0x3d1dbf,_0x2416ec,_0x4b521c,_0x6f5f7f,_0x1dbd93));});return Promise[_0xa63e('0x4a')](_0x13046d)[_0xa63e('0xc')](function(_0x22985d){if(_0x22985d[_0xa63e('0xe')]){logger['info']('['+[_0x7cbb8b[_0xa63e('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x22985d);var _0x397afe=[];_0x22985d[_0xa63e('0x2b')](function(_0x1ec7bb){_0x397afe['push'](assignTagToIncident(_0x1ec7bb,_0x2416ec,_0x4b521c,_0x300686,_0x6f5f7f));});return Promise['all'](_0x397afe)[_0xa63e('0xc')](function(){_0x29206e();})['catch'](function(){_0x29206e();});}else{_0x29206e();}});});}function getTags(_0x53ca33,_0x2f1b46,_0x4771f7,_0x46a96a,_0x2a5f52,_0x816414){return function(_0x172505){return new Promise(function(_0x2b647e,_0x4392bf){var _0x5e4f25=[];var _0x45bdac=_0x46a96a[_0xa63e('0x4b')];if(_0x45bdac&&_0x45bdac[_0xa63e('0xe')]>0x0){_0x5e4f25=_['map'](_0x45bdac,_0xa63e('0x39'));}if(_0x5e4f25[_0xa63e('0xe')]>0x0){return manageTags(_0x53ca33,_0x5e4f25,_0x2f1b46,_0x4771f7,_0x172505,_0x2a5f52,_0x816414)[_0xa63e('0xc')](function(){_0x2b647e(_0x172505);});}else{_0x2b647e(_0x172505);}});};}function emit(_0x16869f,_0x4f3471,_0x38dd20){var _0xe36553=_0xa63e('0x4c')+_0xa63e('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xa63e('0x4e');var _0x128d77={'uri':_0x16869f+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x38dd20+_0xe36553};io['to'](util[_0xa63e('0x4f')](_0xa63e('0x50'),_0x4f3471))['emit']('trigger:browser:url',_0x128d77);}exports['cs']=function(_0x266423,_0x5eabda,_0x5b064b,_0x2e16ed,_0xa22529,_0x485687,_0x1edb1c,_0x2fe5d4){var _0x4aa4d3={};var _0x1d9a8f={'user':_0x485687[_0xa63e('0x51')],'pass':_0x485687[_0xa63e('0x52')]};var _0x127ef8=_0xa63e('0x53');var _0x49fec4='sysparm_display_value=true';_0x485687['remoteUri']=intUtil[_0xa63e('0x54')](_0x485687['remoteUri']);_0x485687['serverUrl']=intUtil[_0xa63e('0x54')](_0x485687[_0xa63e('0x55')]);var _0x4b4ce9=util['format']('%s/api/now/table/',_0x485687[_0xa63e('0x56')]);_0x4aa4d3['userEmail']=!_[_0xa63e('0x57')](_0x2e16ed)?_0x2e16ed[_0xa63e('0x58')]:null;_0x4aa4d3['adminEmail']=_0x485687['email'];_0x4aa4d3[_0xa63e('0x21')]=_0x2fe5d4[_0xa63e('0x37')]()===_0xa63e('0x59')?_0x5eabda[_0xa63e('0x5a')]:_0x5eabda[_0xa63e('0x5b')];_0x4aa4d3[_0xa63e('0x5c')]=_0x2fe5d4===_0xa63e('0x5d')||_0x2fe5d4===_0xa63e('0x5e')?_0xa63e('0x5d'):'outbound';var _0x493878=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x485687['serverUrl'],_0x5eabda['uniqueid'],md5(_0x5eabda[_0xa63e('0x5f')]));if(_0xa22529&&_0xa22529[_0xa63e('0x60')]){logger[_0xa63e('0x17')](_0xa63e('0x61'),_0xa63e('0x62'));_0x5eabda[_0xa63e('0x63')]=_0x493878;}else if(_0x1edb1c&&_0x1edb1c[_0xa63e('0x64')]&&_0x1edb1c[_0xa63e('0x64')]!==_0xa63e('0x65')){logger[_0xa63e('0x17')](_0xa63e('0x66'),_0xa63e('0x62'));_0x5eabda[_0xa63e('0x63')]=_0x493878;}else{_0x5eabda[_0xa63e('0x63')]='';}return getAdminUser(_0x2fe5d4,_0x1d9a8f,_0x4aa4d3,_0x4b4ce9,_0x49fec4,_0x127ef8)[_0xa63e('0xc')](getUser(_0x2fe5d4,_0x1d9a8f,_0x4b4ce9,_0x49fec4,_0x127ef8))[_0xa63e('0xc')](getEndUser(_0x2fe5d4,_0x1d9a8f,_0x4b4ce9,_0x49fec4,_0x127ef8))['then'](getTicket(_0x2fe5d4,_0x1d9a8f,_0x4b4ce9,_0x5b064b,_0x5eabda,_0x49fec4))['then'](function(_0x5dfe89){logger[_0xa63e('0x17')](util['format'](_0xa63e('0x67'),_0x5dfe89[_0xa63e('0x47')]));logger[_0xa63e('0x17')](util['format']('call\x20direction:\x20%s',_0x2fe5d4));if(_0x2fe5d4!==_0xa63e('0x5e')){logger[_0xa63e('0x17')]('['+[_0x2fe5d4[_0xa63e('0x11')]()]+']',_0xa63e('0x68'));emit(_0x485687[_0xa63e('0x56')],_0x2e16ed[_0xa63e('0x39')],_0x5dfe89[_0xa63e('0x47')]);}})[_0xa63e('0x12')](function(_0xb880f5){logger[_0xa63e('0x13')]('['+[_0x2fe5d4[_0xa63e('0x11')]()]+_0xa63e('0x69'),util[_0xa63e('0x6a')](_0xb880f5,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 975e591..1b82646 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x960e=['string','nameField','customField','toLowerCase','content','idField','custom_fields','variable','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','catch','error','monitor_format','lastevent','toUpperCase','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','name','created_by','Descriptions','date_start','toISOString','slice','duration_hours','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','push','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','entry_list','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','then','Enduser\x20created.','debug','[HTTP]','merge','map','type'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x960e,0x1a0));var _0xe960=function(_0x4884f5,_0x15c35e){_0x4884f5=_0x4884f5-0x0;var _0x2125a0=_0x960e[_0x4884f5];return _0x2125a0;};'use strict';var _=require('lodash');var rp=require(_0xe960('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xe960('0x1'));var Redis=require(_0xe960('0x2'));var intUtil=require(_0xe960('0x3'));var config=require(_0xe960('0x4'));var logger=require(_0xe960('0x5'))(_0xe960('0x6'));config[_0xe960('0x7')]=_[_0xe960('0x8')](config[_0xe960('0x7')],{'host':_0xe960('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe960('0x7')]));var def={'method':_0xe960('0xa'),'json':!![]};function emit(_0x47e5ea,_0x27e486,_0xe964ab){io['to'](_0x47e5ea)['emit'](_0x27e486,_0xe964ab);}function getTicket(_0x165478,_0x39cb9b,_0x200ea3,_0x3b8601,_0x106f70,_0x3e4a00,_0x235f38,_0xa36088){logger[_0xe960('0xb')](_0xe960('0xc'));var _0xa3e0ca=new Date();var _0x206421=[{'name':_0xe960('0xd'),'value':intUtil['getString'](_0x3b8601['Subjects'],_0x106f70,'\x20')},{'name':'assigned_user_id','value':_0x39cb9b['id']},{'name':_0xe960('0xe'),'value':_0x39cb9b['id']},{'name':'description','value':intUtil['getString'](_0x3b8601[_0xe960('0xf')],_0x106f70,'\x0a')},{'name':_0xe960('0x10'),'value':_0xa3e0ca[_0xe960('0x11')]()[_0xe960('0x12')](0x0,0x13)['replace']('T','\x20')},{'name':_0xe960('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xe960('0x14'),'value':_0x200ea3['id']},{'name':_0xe960('0x15'),'value':_0xe960('0x16')},{'name':_0xe960('0x17'),'value':_0x200ea3[_0xe960('0xd')]},{'name':'direction','value':_0xa36088}];if(_0x3e4a00[_0xe960('0x18')]){_[_0xe960('0x19')](_0x3e4a00,function(_0x392376){if(_0x106f70[_0x392376[_0xe960('0x1a')]]){_0x206421[_0xe960('0x1b')]({'name':_0x392376['idField'],'value':_0x106f70[_0x392376[_0xe960('0x1a')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xe960('0x1c'),'rest_data':JSON[_0xe960('0x1d')]({'session':_0x235f38['id'],'module_name':_0xe960('0x1e'),'name_value_list':_0x206421})}});}function getAuth(_0x36f16c){return util[_0xe960('0x1f')]('Basic\x20%s',new Buffer(_0x36f16c[_0xe960('0x20')]+':X')[_0xe960('0x21')](_0xe960('0x22')));}function getServerInfo(_0x573166){return request({'form':{'method':_0xe960('0x23'),'input_type':_0xe960('0x1c'),'response_type':_0xe960('0x1c'),'rest_data':JSON[_0xe960('0x1d')]({'session':_0x573166['id']})}});}function getUser(_0x316886,_0x222c96,_0x293ce3){if(!_[_0xe960('0x24')](_0x222c96)){logger[_0xe960('0xb')](_0xe960('0x25'),_0x222c96);return request({'form':{'method':_0xe960('0x26'),'input_type':_0xe960('0x1c'),'response_type':'JSON','rest_data':JSON[_0xe960('0x1d')]({'session':_0x293ce3['id'],'module_name':_0xe960('0x27'),'query':util[_0xe960('0x1f')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x222c96),'order_by':'','offset':'0','select_fields':['id',_0xe960('0xd'),_0xe960('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x284363){if(_0x284363['entry_list'][_0xe960('0x18')]){var _0x325cdb=_['find'](_0x284363[_0xe960('0x29')],function(_0x382ae7){return _0x382ae7[_0xe960('0x2a')][_0xe960('0x28')]['value']===_0x222c96;});if(_0x325cdb){logger[_0xe960('0xb')](_0xe960('0x2b'));return BPromise[_0xe960('0x2c')]({'id':_0x325cdb[_0xe960('0x2a')]['id'][_0xe960('0x2d')],'name':_0x325cdb['name_value_list'][_0xe960('0xd')]['value']});}}logger[_0xe960('0xb')](_0xe960('0x2e'));return BPromise[_0xe960('0x2c')]({'id':_0x293ce3[_0xe960('0x2a')][_0xe960('0x2f')][_0xe960('0x2d')],'name':_0x293ce3[_0xe960('0x2a')][_0xe960('0x28')][_0xe960('0x2d')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe960('0x2c')]({'id':_0x293ce3[_0xe960('0x2a')]['user_id'][_0xe960('0x2d')],'name':_0x293ce3[_0xe960('0x2a')][_0xe960('0x28')][_0xe960('0x2d')]});}}function getEndUser(_0x245f8d,_0x33e868,_0xe3ac62,_0x4237c3){logger[_0xe960('0xb')](_0xe960('0x30'),_0xe3ac62);return request({'form':{'method':_0xe960('0x26'),'input_type':_0xe960('0x1c'),'response_type':_0xe960('0x1c'),'rest_data':JSON['stringify']({'session':_0x4237c3['id'],'module_name':_0xe960('0x16'),'query':util[_0xe960('0x1f')](_0xe960('0x31'),_0xe3ac62),'order_by':'','offset':'0','select_fields':['id',_0xe960('0xd'),_0xe960('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2d3b8b){if(_0x2d3b8b[_0xe960('0x29')][_0xe960('0x18')]){var _0x1d83ec=_[_0xe960('0x33')](_0x2d3b8b[_0xe960('0x29')],function(_0x465380){return _0x465380[_0xe960('0x2a')][_0xe960('0x32')][_0xe960('0x2d')]===_0xe3ac62;});if(_0x1d83ec){logger[_0xe960('0xb')](_0xe960('0x34'));return BPromise[_0xe960('0x2c')]({'id':_0x1d83ec[_0xe960('0x2a')]['id'][_0xe960('0x2d')],'name':_0x1d83ec['name_value_list'][_0xe960('0xd')]['value'],'phone':_0x1d83ec[_0xe960('0x2a')][_0xe960('0x32')][_0xe960('0x2d')]});}}else{logger[_0xe960('0xb')](_0xe960('0x35'));return request({'form':{'method':_0xe960('0x36'),'input_type':_0xe960('0x1c'),'response_type':_0xe960('0x1c'),'rest_data':JSON[_0xe960('0x1d')]({'session':_0x4237c3['id'],'module_name':_0xe960('0x16'),'name_value_list':[{'name':_0xe960('0x37'),'value':_0x33e868!==_0xe960('0x38')?_0x33e868:util[_0xe960('0x1f')]('Caller\x20-\x20%s',_0xe3ac62)},{'name':'phone_home','value':_0xe3ac62}]})}})[_0xe960('0x39')](function(_0x21ae68){logger['info'](_0xe960('0x3a'));return BPromise[_0xe960('0x2c')]({'id':_0x21ae68['id'],'name':_0x21ae68[_0xe960('0x29')]['first_name']['value'],'phone':_0x21ae68['entry_list'][_0xe960('0x32')][_0xe960('0x2d')]});});}});}function request(_0x1e7b62){logger[_0xe960('0x3b')](_0xe960('0x3c'),JSON[_0xe960('0x1d')](_0x1e7b62));return rp(_[_0xe960('0x3d')](def,_0x1e7b62));}function getTags(_0x10c68a,_0x43eff6){var _0x3e0494=[];if(_0x10c68a&&_0x10c68a['length']>0x0){_0x3e0494=_[_0xe960('0x3e')](_0x10c68a,_0x43eff6);}return _0x3e0494;}function getCustomFields(_0x23d470,_0x3ce7fd){var _0x573004=[];var _0x3ecced={'custom_fields':[]};if(_0x23d470['length']>0x0){_['forEach'](_0x23d470,function(_0x1b2404){if(_0x1b2404[_0xe960('0x3f')]===_0xe960('0x40')&&_0x1b2404[_0xe960('0x41')]&&!_0x1b2404[_0xe960('0x42')]){_0x3ecced[_0x1b2404['nameField'][_0xe960('0x43')]()]=_0x1b2404[_0xe960('0x44')][_0xe960('0x21')]();}else if(_0x1b2404[_0xe960('0x3f')]===_0xe960('0x40')&&_0x1b2404[_0xe960('0x45')]&&_0x1b2404[_0xe960('0x42')]){_0x3ecced[_0xe960('0x46')][_0xe960('0x1b')]({'id':_0x1b2404[_0xe960('0x45')],'value':_0x1b2404[_0xe960('0x44')][_0xe960('0x21')]()});}else if(_0x1b2404[_0xe960('0x3f')]===_0xe960('0x47')&&_0x1b2404[_0xe960('0x1a')]&&_0x1b2404['idField']&&_0x1b2404[_0xe960('0x42')]){_0x3ce7fd[_0x1b2404[_0xe960('0x1a')]]&&_0x3ecced['custom_fields'][_0xe960('0x1b')]({'id':_0x1b2404['idField'],'value':_0x3ce7fd[_0x1b2404[_0xe960('0x1a')]][_0xe960('0x21')]()});}else if(_0x1b2404['type']===_0xe960('0x48')&&_0x1b2404[_0xe960('0x49')]&&_0x1b2404[_0xe960('0x49')][_0xe960('0xd')]&&_0x1b2404[_0xe960('0x45')]&&_0x1b2404['customField']){_0x3ce7fd[_0x1b2404['Variable'][_0xe960('0xd')][_0xe960('0x43')]()]&&_0x3ecced['custom_fields'][_0xe960('0x1b')]({'id':_0x1b2404['idField'],'value':_0x3ce7fd[_0x1b2404['Variable'][_0xe960('0xd')][_0xe960('0x43')]()][_0xe960('0x21')]()});}});}return _0x3ecced;}function getConnection(_0x560468){return request({'method':_0xe960('0xa'),'form':{'method':_0xe960('0x4a'),'input_type':_0xe960('0x1c'),'response_type':'JSON','rest_data':JSON[_0xe960('0x1d')]({'user_auth':{'user_name':_0x560468[_0xe960('0x4b')],'password':_0x560468['password'],'encryption':'PLAIN'},'application':_0xe960('0x4c')})}})[_0xe960('0x39')](function(_0x5398b3){var _0x19ca64=_0x5398b3;if(_0x19ca64['id']){def[_0xe960('0x4d')]=_0x19ca64['id'];return BPromise[_0xe960('0x2c')](_0x19ca64);}else{throw new Error(util[_0xe960('0x1f')](_0xe960('0x4e'),_0x560468['id']));}});}function setRelationship(_0x2f53d8,_0x541123,_0x15497d,_0x1acab1){return request({'form':{'method':_0xe960('0x4f'),'input_type':_0xe960('0x1c'),'response_type':_0xe960('0x1c'),'rest_data':JSON[_0xe960('0x1d')]({'session':_0x2f53d8['id'],'module_name':'Calls','module_id':_0x15497d['id'],'link_field_name':_0x1acab1,'related_ids':[_0x541123['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe960('0x50')]=function(_0x5d827d,_0x44df7a,_0x51950d,_0x126df9,_0x417433,_0x371c05){var _0x14b66c,_0x181fc9,_0x3095a0,_0x367bf0;_0x371c05[_0xe960('0x51')]=intUtil[_0xe960('0x52')](_0x371c05[_0xe960('0x51')]);_0x371c05[_0xe960('0x53')]=intUtil[_0xe960('0x52')](_0x371c05[_0xe960('0x53')]);def[_0xe960('0x54')]=util[_0xe960('0x1f')](_0xe960('0x55'),_0x371c05[_0xe960('0x51')]);if(_0x417433&&_0x417433['monitor_format']){logger[_0xe960('0xb')](_0xe960('0x56'),_0xe960('0x57'));_0x44df7a[_0xe960('0x58')]=util[_0xe960('0x1f')](_0xe960('0x59'),_0x371c05[_0xe960('0x53')],_0x44df7a[_0xe960('0x5a')],md5(_0x44df7a[_0xe960('0x5a')]));}else{_0x44df7a[_0xe960('0x58')]='';}return getConnection(_0x371c05)[_0xe960('0x39')](function(_0x1a5bb6){_0x367bf0=_0x1a5bb6;return getUser(_0x371c05,_0x126df9[_0xe960('0xd')],_0x367bf0);})['then'](function(_0x54202b){_0x14b66c=_0x54202b;logger[_0xe960('0xb')](_0xe960('0x5b'),_0x14b66c['id']);return getEndUser(_0x371c05,_0x44df7a[_0xe960('0x5c')],_0x44df7a[_0xe960('0x5d')],_0x367bf0);})[_0xe960('0x39')](function(_0x417ad6){_0x181fc9=_0x417ad6;logger[_0xe960('0xb')](_0xe960('0x5e'),_0x181fc9['id']);return getTicket(_0x371c05,_0x14b66c,_0x181fc9,_0x51950d,_0x44df7a,_0x51950d[_0xe960('0x5f')],_0x367bf0,_0xe960('0x60'));})['then'](function(_0x33949f){_0x3095a0=_0x33949f;logger[_0xe960('0xb')]('Ticket\x20created!');logger[_0xe960('0xb')](_0xe960('0x61'),_0x3095a0['id']);return setRelationship(_0x367bf0,_0x14b66c,_0x3095a0,_0xe960('0x62'));})[_0xe960('0x39')](function(){return setRelationship(_0x367bf0,_0x181fc9,_0x3095a0,_0xe960('0x63'));})[_0xe960('0x39')](function(){return getServerInfo(_0x367bf0);})[_0xe960('0x39')](function(_0x2bb1ca){var _0x5f31b6=parseInt(_0x2bb1ca['version']['charAt'](0x0));var _0x435799=util[_0xe960('0x1f')](_0xe960('0x64'),_0x371c05[_0xe960('0x51')],_0x3095a0['id']);if(_0x5f31b6>0x6){_0x435799=util[_0xe960('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x371c05[_0xe960('0x51')],_0x3095a0['id']);}logger[_0xe960('0xb')]('[QUEUE]',_0xe960('0x65'));emit(util[_0xe960('0x1f')]('user:%s',_0x126df9[_0xe960('0xd')]),_0xe960('0x66'),{'uri':_0x435799});})['catch'](function(_0x403a7d){logger['error'](_0xe960('0x56'),JSON['stringify'](_0x403a7d));});};exports[_0xe960('0x67')]=function(_0x478db4,_0x1693d7,_0x7ff403,_0x30d26a,_0x3746bc,_0x10c92f,_0x1b7604){var _0x5e3826,_0x259880,_0x1f5fd7,_0x3b6f2f;_0x10c92f[_0xe960('0x51')]=intUtil[_0xe960('0x52')](_0x10c92f[_0xe960('0x51')]);_0x10c92f[_0xe960('0x53')]=intUtil[_0xe960('0x52')](_0x10c92f[_0xe960('0x53')]);def[_0xe960('0x54')]=util[_0xe960('0x1f')](_0xe960('0x55'),_0x10c92f[_0xe960('0x51')]);if(_0x1b7604&&_0x1b7604[_0xe960('0x68')]&&_0x1b7604[_0xe960('0x68')]!==_0xe960('0x69')){logger[_0xe960('0xb')](_0xe960('0x6a'),_0xe960('0x57'));_0x1693d7[_0xe960('0x58')]=util[_0xe960('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x10c92f['serverUrl'],_0x1693d7['uniqueid'],md5(_0x1693d7[_0xe960('0x5a')]));}return getConnection(_0x10c92f)[_0xe960('0x39')](function(_0x412fc4){_0x3b6f2f=_0x412fc4;return getUser(_0x10c92f,_0x30d26a[_0xe960('0xd')],_0x3b6f2f);})[_0xe960('0x39')](function(_0x499e26){_0x5e3826=_0x499e26;logger['info'](_0xe960('0x5b'),_0x5e3826['id']);return getEndUser(_0x10c92f,_0x1693d7[_0xe960('0x6b')],_0x1693d7[_0xe960('0x6c')],_0x3b6f2f);})[_0xe960('0x39')](function(_0x36af87){_0x259880=_0x36af87;logger['info'](_0xe960('0x5e'),_0x259880['id']);return getTicket(_0x10c92f,_0x5e3826,_0x259880,_0x7ff403,_0x1693d7,_0x7ff403[_0xe960('0x5f')],_0x3b6f2f,_0xe960('0x6d'));})[_0xe960('0x39')](function(_0x31d5d6){_0x1f5fd7=_0x31d5d6;logger[_0xe960('0xb')](_0xe960('0x6e'));logger[_0xe960('0xb')](_0xe960('0x61'),_0x1f5fd7['id']);return setRelationship(_0x3b6f2f,_0x5e3826,_0x1f5fd7,_0xe960('0x62'));})[_0xe960('0x39')](function(){return setRelationship(_0x3b6f2f,_0x259880,_0x1f5fd7,_0xe960('0x63'));})['then'](function(){return getServerInfo(_0x3b6f2f);})['then'](function(_0xa13cb4){var _0x5c692f=parseInt(_0xa13cb4[_0xe960('0x6f')][_0xe960('0x70')](0x0));var _0xf8cbab=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x10c92f['remoteUri'],_0x1f5fd7['id']);if(_0x5c692f>0x6){_0xf8cbab=util[_0xe960('0x1f')](_0xe960('0x71'),_0x10c92f[_0xe960('0x51')],_0x1f5fd7['id']);}logger[_0xe960('0xb')](_0xe960('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe960('0x1f')](_0xe960('0x72'),_0x30d26a['name']),'trigger:browser:url',{'uri':_0xf8cbab});})[_0xe960('0x73')](function(_0x16b122){logger[_0xe960('0x74')](_0xe960('0x6a'),JSON[_0xe960('0x1d')](_0x16b122));});};exports['unmanaged']=function(_0x92c0d,_0x3bc3fc,_0xa1da3a,_0x565f31,_0x3880c6,_0x56723d){var _0x4689fc,_0x16e0de,_0x4cd3b7,_0x2b5d8a;_0x56723d['remoteUri']=intUtil[_0xe960('0x52')](_0x56723d[_0xe960('0x51')]);_0x56723d[_0xe960('0x53')]=intUtil[_0xe960('0x52')](_0x56723d[_0xe960('0x53')]);def['uri']=util[_0xe960('0x1f')]('%s/service/v4_1/rest.php',_0x56723d[_0xe960('0x51')]);if(_0x3880c6&&_0x3880c6[_0xe960('0x75')]){logger[_0xe960('0xb')]('['+_0x3bc3fc[_0xe960('0x76')]['toUpperCase']()+']',_0xe960('0x57'));_0x3bc3fc[_0xe960('0x58')]=util[_0xe960('0x1f')](_0xe960('0x59'),_0x56723d[_0xe960('0x53')],_0x3bc3fc['uniqueid'],md5(_0x3bc3fc['uniqueid']));}else{_0x3bc3fc['recordingURL']='';}return getConnection(_0x56723d)[_0xe960('0x39')](function(_0x2a5f1c){_0x2b5d8a=_0x2a5f1c;if(!_[_0xe960('0x24')](_0x565f31)){return getUser(_0x56723d,_0x565f31[_0xe960('0xd')],_0x2b5d8a);}else{return getUser(_0x56723d,null,_0x2b5d8a);}})['then'](function(_0x49c51c){_0x4689fc=_0x49c51c;logger[_0xe960('0xb')](_0xe960('0x5b'),_0x4689fc['id']);return getEndUser(_0x56723d,_0x3bc3fc[_0xe960('0x5c')],_0x3bc3fc['calleridnum'],_0x2b5d8a);})['then'](function(_0x40bced){_0x16e0de=_0x40bced;logger['info'](_0xe960('0x5e'),_0x16e0de['id']);return getTicket(_0x56723d,_0x4689fc,_0x16e0de,_0xa1da3a,_0x3bc3fc,_0xa1da3a[_0xe960('0x5f')],_0x2b5d8a,_0xe960('0x60'));})[_0xe960('0x39')](function(_0x16301c){_0x4cd3b7=_0x16301c;logger['info']('Ticket\x20created!');logger['info'](_0xe960('0x61'),_0x4cd3b7['id']);return setRelationship(_0x2b5d8a,_0x4689fc,_0x4cd3b7,'users');})[_0xe960('0x39')](function(){return setRelationship(_0x2b5d8a,_0x16e0de,_0x4cd3b7,_0xe960('0x63'));})[_0xe960('0x39')](function(){return getServerInfo(_0x2b5d8a);})['catch'](function(_0x36079a){logger[_0xe960('0x74')]('['+_0x3bc3fc['lastevent'][_0xe960('0x77')]()+']',JSON[_0xe960('0x1d')](_0x36079a));});};
\ No newline at end of file
+var _0x6760=['error','outbound','uri','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','Fields','users','contacts','charAt','catch','unmanaged','%s/service/v4_1/rest.php','lastevent','toUpperCase','lodash','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','POST','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_name','direction','forEach','variableName','push','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','length','entry_list','name_value_list','Agent\x20found!','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','info','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Contacts','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','toLowerCase','content','customField','variable','idField','custom_fields','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','%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'];(function(_0x573267,_0x1285ac){var _0xb2ab67=function(_0x9afcd9){while(--_0x9afcd9){_0x573267['push'](_0x573267['shift']());}};_0xb2ab67(++_0x1285ac);}(_0x6760,0x10a));var _0x0676=function(_0x3a63cb,_0x56e89a){_0x3a63cb=_0x3a63cb-0x0;var _0x15a480=_0x6760[_0x3a63cb];return _0x15a480;};'use strict';var _=require(_0x0676('0x0'));var rp=require('request-promise');var BPromise=require(_0x0676('0x1'));var md5=require(_0x0676('0x2'));var util=require('util');var Redis=require(_0x0676('0x3'));var intUtil=require(_0x0676('0x4'));var config=require(_0x0676('0x5'));var logger=require(_0x0676('0x6'))(_0x0676('0x7'));config[_0x0676('0x8')]=_['defaults'](config['redis'],{'host':_0x0676('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0676('0x8')]));var def={'method':_0x0676('0xa'),'json':!![]};function emit(_0x4b2de7,_0x2b7955,_0x14156b){io['to'](_0x4b2de7)['emit'](_0x2b7955,_0x14156b);}function getTicket(_0x49a9c1,_0xd3dcf0,_0x490b7a,_0x4e5dda,_0x3d976e,_0x377f63,_0x5041fa,_0x442257){logger['info'](_0x0676('0xb'));var _0x4bcc54=new Date();var _0x3a68d3=[{'name':_0x0676('0xc'),'value':intUtil[_0x0676('0xd')](_0x4e5dda['Subjects'],_0x3d976e,'\x20')},{'name':_0x0676('0xe'),'value':_0xd3dcf0['id']},{'name':_0x0676('0xf'),'value':_0xd3dcf0['id']},{'name':_0x0676('0x10'),'value':intUtil[_0x0676('0xd')](_0x4e5dda['Descriptions'],_0x3d976e,'\x0a')},{'name':_0x0676('0x11'),'value':_0x4bcc54[_0x0676('0x12')]()[_0x0676('0x13')](0x0,0x13)[_0x0676('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x0676('0x15'),'value':'15'},{'name':_0x0676('0x16'),'value':_0x490b7a['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x0676('0x17'),'value':_0x490b7a[_0x0676('0xc')]},{'name':_0x0676('0x18'),'value':_0x442257}];if(_0x377f63['length']){_[_0x0676('0x19')](_0x377f63,function(_0x3c2472){if(_0x3d976e[_0x3c2472[_0x0676('0x1a')]]){_0x3a68d3[_0x0676('0x1b')]({'name':_0x3c2472['idField'],'value':_0x3d976e[_0x3c2472[_0x0676('0x1a')]]});}});}return request({'form':{'method':_0x0676('0x1c'),'input_type':_0x0676('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5041fa['id'],'module_name':_0x0676('0x1e'),'name_value_list':_0x3a68d3})}});}function getAuth(_0x489202){return util['format'](_0x0676('0x1f'),new Buffer(_0x489202[_0x0676('0x20')]+':X')[_0x0676('0x21')](_0x0676('0x22')));}function getServerInfo(_0x5d482a){return request({'form':{'method':_0x0676('0x23'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x0676('0x24')]({'session':_0x5d482a['id']})}});}function getUser(_0x1e69b9,_0x337c02,_0x56c605){if(!_[_0x0676('0x25')](_0x337c02)){logger['info'](_0x0676('0x26'),_0x337c02);return request({'form':{'method':_0x0676('0x27'),'input_type':_0x0676('0x1d'),'response_type':_0x0676('0x1d'),'rest_data':JSON['stringify']({'session':_0x56c605['id'],'module_name':_0x0676('0x28'),'query':util[_0x0676('0x29')](_0x0676('0x2a'),_0x337c02),'order_by':'','offset':'0','select_fields':['id',_0x0676('0xc'),_0x0676('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0676('0x2c')](function(_0x303980){if(_0x303980['entry_list'][_0x0676('0x2d')]){var _0x11b917=_['find'](_0x303980[_0x0676('0x2e')],function(_0x55f933){return _0x55f933[_0x0676('0x2f')]['user_name']['value']===_0x337c02;});if(_0x11b917){logger['info'](_0x0676('0x30'));return BPromise[_0x0676('0x31')]({'id':_0x11b917[_0x0676('0x2f')]['id'][_0x0676('0x32')],'name':_0x11b917['name_value_list'][_0x0676('0xc')][_0x0676('0x32')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x0676('0x31')]({'id':_0x56c605['name_value_list'][_0x0676('0x33')]['value'],'name':_0x56c605[_0x0676('0x2f')][_0x0676('0x2b')][_0x0676('0x32')]});});}else{logger['info'](_0x0676('0x34'));return BPromise[_0x0676('0x31')]({'id':_0x56c605[_0x0676('0x2f')][_0x0676('0x33')]['value'],'name':_0x56c605['name_value_list'][_0x0676('0x2b')]['value']});}}function getEndUser(_0xcb1dee,_0x4123e3,_0xa81a66,_0x513b19){logger[_0x0676('0x35')](_0x0676('0x36'),_0xa81a66);return request({'form':{'method':_0x0676('0x27'),'input_type':'JSON','response_type':_0x0676('0x1d'),'rest_data':JSON[_0x0676('0x24')]({'session':_0x513b19['id'],'module_name':'Contacts','query':util['format'](_0x0676('0x37'),_0xa81a66),'order_by':'','offset':'0','select_fields':['id','name',_0x0676('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0676('0x2c')](function(_0x1f45a1){if(_0x1f45a1['entry_list'][_0x0676('0x2d')]){var _0x555ff5=_[_0x0676('0x39')](_0x1f45a1[_0x0676('0x2e')],function(_0x13f3ef){return _0x13f3ef[_0x0676('0x2f')][_0x0676('0x38')][_0x0676('0x32')]===_0xa81a66;});if(_0x555ff5){logger['info'](_0x0676('0x3a'));return BPromise[_0x0676('0x31')]({'id':_0x555ff5['name_value_list']['id'][_0x0676('0x32')],'name':_0x555ff5[_0x0676('0x2f')]['name']['value'],'phone':_0x555ff5[_0x0676('0x2f')][_0x0676('0x38')][_0x0676('0x32')]});}}else{logger[_0x0676('0x35')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x0676('0x1c'),'input_type':_0x0676('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x513b19['id'],'module_name':_0x0676('0x3b'),'name_value_list':[{'name':_0x0676('0x3c'),'value':_0x4123e3!==_0x0676('0x3d')?_0x4123e3:util[_0x0676('0x29')](_0x0676('0x3e'),_0xa81a66)},{'name':_0x0676('0x38'),'value':_0xa81a66}]})}})[_0x0676('0x2c')](function(_0x2d8891){logger[_0x0676('0x35')](_0x0676('0x3f'));return BPromise['resolve']({'id':_0x2d8891['id'],'name':_0x2d8891['entry_list']['first_name'][_0x0676('0x32')],'phone':_0x2d8891[_0x0676('0x2e')][_0x0676('0x38')][_0x0676('0x32')]});});}});}function request(_0x1ed1b6){logger[_0x0676('0x40')](_0x0676('0x41'),JSON[_0x0676('0x24')](_0x1ed1b6));return rp(_[_0x0676('0x42')](def,_0x1ed1b6));}function getTags(_0xdb4516,_0x31175){var _0x54467f=[];if(_0xdb4516&&_0xdb4516[_0x0676('0x2d')]>0x0){_0x54467f=_[_0x0676('0x43')](_0xdb4516,_0x31175);}return _0x54467f;}function getCustomFields(_0x3df73e,_0x51369c){var _0x505312=[];var _0x2474f6={'custom_fields':[]};if(_0x3df73e[_0x0676('0x2d')]>0x0){_[_0x0676('0x19')](_0x3df73e,function(_0x5b6c7f){if(_0x5b6c7f[_0x0676('0x44')]===_0x0676('0x45')&&_0x5b6c7f['nameField']&&!_0x5b6c7f['customField']){_0x2474f6[_0x5b6c7f['nameField'][_0x0676('0x46')]()]=_0x5b6c7f[_0x0676('0x47')]['toString']();}else if(_0x5b6c7f['type']===_0x0676('0x45')&&_0x5b6c7f['idField']&&_0x5b6c7f[_0x0676('0x48')]){_0x2474f6['custom_fields'][_0x0676('0x1b')]({'id':_0x5b6c7f['idField'],'value':_0x5b6c7f['content']['toString']()});}else if(_0x5b6c7f[_0x0676('0x44')]===_0x0676('0x49')&&_0x5b6c7f[_0x0676('0x1a')]&&_0x5b6c7f[_0x0676('0x4a')]&&_0x5b6c7f['customField']){_0x51369c[_0x5b6c7f[_0x0676('0x1a')]]&&_0x2474f6[_0x0676('0x4b')]['push']({'id':_0x5b6c7f[_0x0676('0x4a')],'value':_0x51369c[_0x5b6c7f[_0x0676('0x1a')]][_0x0676('0x21')]()});}else if(_0x5b6c7f[_0x0676('0x44')]===_0x0676('0x4c')&&_0x5b6c7f[_0x0676('0x4d')]&&_0x5b6c7f[_0x0676('0x4d')]['name']&&_0x5b6c7f[_0x0676('0x4a')]&&_0x5b6c7f[_0x0676('0x48')]){_0x51369c[_0x5b6c7f['Variable'][_0x0676('0xc')][_0x0676('0x46')]()]&&_0x2474f6['custom_fields']['push']({'id':_0x5b6c7f[_0x0676('0x4a')],'value':_0x51369c[_0x5b6c7f['Variable'][_0x0676('0xc')][_0x0676('0x46')]()][_0x0676('0x21')]()});}});}return _0x2474f6;}function getConnection(_0x53f55f){return request({'method':_0x0676('0xa'),'form':{'method':_0x0676('0x4e'),'input_type':_0x0676('0x1d'),'response_type':_0x0676('0x1d'),'rest_data':JSON[_0x0676('0x24')]({'user_auth':{'user_name':_0x53f55f[_0x0676('0x4f')],'password':_0x53f55f[_0x0676('0x50')],'encryption':'PLAIN'},'application':_0x0676('0x51')})}})['then'](function(_0xea997b){var _0x88fc55=_0xea997b;if(_0x88fc55['id']){def[_0x0676('0x52')]=_0x88fc55['id'];return BPromise[_0x0676('0x31')](_0x88fc55);}else{throw new Error(util['format'](_0x0676('0x53'),_0x53f55f['id']));}});}function setRelationship(_0x16fee6,_0x2a7464,_0x2c50d9,_0x41ee18){return request({'form':{'method':'set_relationship','input_type':_0x0676('0x1d'),'response_type':_0x0676('0x1d'),'rest_data':JSON[_0x0676('0x24')]({'session':_0x16fee6['id'],'module_name':_0x0676('0x1e'),'module_id':_0x2c50d9['id'],'link_field_name':_0x41ee18,'related_ids':[_0x2a7464['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0676('0x54')]=function(_0x488cad,_0x40d07e,_0x50bc19,_0x3c5159,_0x1fdec9,_0x57b7ee){var _0x45ad93,_0x5b6153,_0x47ef5b,_0x398ef6;_0x57b7ee[_0x0676('0x55')]=intUtil[_0x0676('0x56')](_0x57b7ee[_0x0676('0x55')]);_0x57b7ee['serverUrl']=intUtil[_0x0676('0x56')](_0x57b7ee[_0x0676('0x57')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x57b7ee[_0x0676('0x55')]);if(_0x1fdec9&&_0x1fdec9[_0x0676('0x58')]){logger[_0x0676('0x35')](_0x0676('0x59'),_0x0676('0x5a'));_0x40d07e[_0x0676('0x5b')]=util[_0x0676('0x29')](_0x0676('0x5c'),_0x57b7ee[_0x0676('0x57')],_0x40d07e['uniqueid'],md5(_0x40d07e['uniqueid']));}else{_0x40d07e[_0x0676('0x5b')]='';}return getConnection(_0x57b7ee)[_0x0676('0x2c')](function(_0x1bdc8f){_0x398ef6=_0x1bdc8f;return getUser(_0x57b7ee,_0x3c5159[_0x0676('0xc')],_0x398ef6);})[_0x0676('0x2c')](function(_0x37fec3){_0x45ad93=_0x37fec3;logger[_0x0676('0x35')](_0x0676('0x5d'),_0x45ad93['id']);return getEndUser(_0x57b7ee,_0x40d07e[_0x0676('0x5e')],_0x40d07e[_0x0676('0x5f')],_0x398ef6);})['then'](function(_0x16c4ee){_0x5b6153=_0x16c4ee;logger[_0x0676('0x35')](_0x0676('0x60'),_0x5b6153['id']);return getTicket(_0x57b7ee,_0x45ad93,_0x5b6153,_0x50bc19,_0x40d07e,_0x50bc19['Fields'],_0x398ef6,_0x0676('0x61'));})[_0x0676('0x2c')](function(_0x46750b){_0x47ef5b=_0x46750b;logger[_0x0676('0x35')](_0x0676('0x62'));logger[_0x0676('0x35')](_0x0676('0x63'),_0x47ef5b['id']);return setRelationship(_0x398ef6,_0x45ad93,_0x47ef5b,'users');})[_0x0676('0x2c')](function(){return setRelationship(_0x398ef6,_0x5b6153,_0x47ef5b,'contacts');})[_0x0676('0x2c')](function(){return getServerInfo(_0x398ef6);})[_0x0676('0x2c')](function(_0x145d7b){var _0x5eb6b4=parseInt(_0x145d7b[_0x0676('0x64')]['charAt'](0x0));var _0x38bcdb=util['format'](_0x0676('0x65'),_0x57b7ee[_0x0676('0x55')],_0x47ef5b['id']);if(_0x5eb6b4>0x6){_0x38bcdb=util[_0x0676('0x29')](_0x0676('0x66'),_0x57b7ee[_0x0676('0x55')],_0x47ef5b['id']);}logger[_0x0676('0x35')]('[QUEUE]',_0x0676('0x67'));emit(util[_0x0676('0x29')](_0x0676('0x68'),_0x3c5159[_0x0676('0xc')]),_0x0676('0x69'),{'uri':_0x38bcdb});})['catch'](function(_0x14a889){logger[_0x0676('0x6a')](_0x0676('0x59'),JSON['stringify'](_0x14a889));});};exports[_0x0676('0x6b')]=function(_0x4177ba,_0x165938,_0x2df501,_0x252870,_0x5578ae,_0x2911d3,_0x4b699b){var _0x47d7c6,_0x332830,_0x1bd4a0,_0x2692ff;_0x2911d3[_0x0676('0x55')]=intUtil[_0x0676('0x56')](_0x2911d3['remoteUri']);_0x2911d3[_0x0676('0x57')]=intUtil[_0x0676('0x56')](_0x2911d3[_0x0676('0x57')]);def[_0x0676('0x6c')]=util[_0x0676('0x29')]('%s/service/v4_1/rest.php',_0x2911d3[_0x0676('0x55')]);if(_0x4b699b&&_0x4b699b['recordingFormat']&&_0x4b699b[_0x0676('0x6d')]!==_0x0676('0x6e')){logger[_0x0676('0x35')](_0x0676('0x6f'),'Recording\x20is\x20enabled!');_0x165938[_0x0676('0x5b')]=util[_0x0676('0x29')](_0x0676('0x5c'),_0x2911d3[_0x0676('0x57')],_0x165938[_0x0676('0x70')],md5(_0x165938[_0x0676('0x70')]));}return getConnection(_0x2911d3)[_0x0676('0x2c')](function(_0xce0248){_0x2692ff=_0xce0248;return getUser(_0x2911d3,_0x252870[_0x0676('0xc')],_0x2692ff);})[_0x0676('0x2c')](function(_0x1d4f0b){_0x47d7c6=_0x1d4f0b;logger[_0x0676('0x35')](_0x0676('0x5d'),_0x47d7c6['id']);return getEndUser(_0x2911d3,_0x165938[_0x0676('0x71')],_0x165938[_0x0676('0x72')],_0x2692ff);})['then'](function(_0x4f7978){_0x332830=_0x4f7978;logger[_0x0676('0x35')](_0x0676('0x60'),_0x332830['id']);return getTicket(_0x2911d3,_0x47d7c6,_0x332830,_0x2df501,_0x165938,_0x2df501[_0x0676('0x73')],_0x2692ff,'Outbound');})[_0x0676('0x2c')](function(_0x4c1896){_0x1bd4a0=_0x4c1896;logger[_0x0676('0x35')]('Ticket\x20created!');logger[_0x0676('0x35')](_0x0676('0x63'),_0x1bd4a0['id']);return setRelationship(_0x2692ff,_0x47d7c6,_0x1bd4a0,_0x0676('0x74'));})[_0x0676('0x2c')](function(){return setRelationship(_0x2692ff,_0x332830,_0x1bd4a0,_0x0676('0x75'));})[_0x0676('0x2c')](function(){return getServerInfo(_0x2692ff);})[_0x0676('0x2c')](function(_0x7cfc22){var _0x5e2940=parseInt(_0x7cfc22[_0x0676('0x64')][_0x0676('0x76')](0x0));var _0x20598a=util['format'](_0x0676('0x65'),_0x2911d3[_0x0676('0x55')],_0x1bd4a0['id']);if(_0x5e2940>0x6){_0x20598a=util[_0x0676('0x29')](_0x0676('0x66'),_0x2911d3[_0x0676('0x55')],_0x1bd4a0['id']);}logger['info'](_0x0676('0x6f'),_0x0676('0x67'));emit(util[_0x0676('0x29')]('user:%s',_0x252870[_0x0676('0xc')]),_0x0676('0x69'),{'uri':_0x20598a});})[_0x0676('0x77')](function(_0x59b6c1){logger['error']('[OUTBOUND]',JSON[_0x0676('0x24')](_0x59b6c1));});};exports[_0x0676('0x78')]=function(_0x50c2f2,_0x18a241,_0x480ca6,_0x269f2d,_0x165486,_0x3bdbf5){var _0x5b55bd,_0x21ac4d,_0x324262,_0x5bd1b9;_0x3bdbf5[_0x0676('0x55')]=intUtil[_0x0676('0x56')](_0x3bdbf5[_0x0676('0x55')]);_0x3bdbf5[_0x0676('0x57')]=intUtil[_0x0676('0x56')](_0x3bdbf5[_0x0676('0x57')]);def[_0x0676('0x6c')]=util[_0x0676('0x29')](_0x0676('0x79'),_0x3bdbf5[_0x0676('0x55')]);if(_0x165486&&_0x165486['monitor_format']){logger[_0x0676('0x35')]('['+_0x18a241[_0x0676('0x7a')][_0x0676('0x7b')]()+']','Recording\x20is\x20enabled!');_0x18a241[_0x0676('0x5b')]=util[_0x0676('0x29')](_0x0676('0x5c'),_0x3bdbf5[_0x0676('0x57')],_0x18a241['uniqueid'],md5(_0x18a241['uniqueid']));}else{_0x18a241['recordingURL']='';}return getConnection(_0x3bdbf5)['then'](function(_0x510ba1){_0x5bd1b9=_0x510ba1;if(!_[_0x0676('0x25')](_0x269f2d)){return getUser(_0x3bdbf5,_0x269f2d[_0x0676('0xc')],_0x5bd1b9);}else{return getUser(_0x3bdbf5,null,_0x5bd1b9);}})[_0x0676('0x2c')](function(_0x4e3167){_0x5b55bd=_0x4e3167;logger[_0x0676('0x35')](_0x0676('0x5d'),_0x5b55bd['id']);return getEndUser(_0x3bdbf5,_0x18a241[_0x0676('0x5e')],_0x18a241['calleridnum'],_0x5bd1b9);})[_0x0676('0x2c')](function(_0x430e6a){_0x21ac4d=_0x430e6a;logger[_0x0676('0x35')](_0x0676('0x60'),_0x21ac4d['id']);return getTicket(_0x3bdbf5,_0x5b55bd,_0x21ac4d,_0x480ca6,_0x18a241,_0x480ca6['Fields'],_0x5bd1b9,'Inbound');})['then'](function(_0x118901){_0x324262=_0x118901;logger[_0x0676('0x35')]('Ticket\x20created!');logger[_0x0676('0x35')]('The\x20Ticket\x20ID\x20is:',_0x324262['id']);return setRelationship(_0x5bd1b9,_0x5b55bd,_0x324262,_0x0676('0x74'));})[_0x0676('0x2c')](function(){return setRelationship(_0x5bd1b9,_0x21ac4d,_0x324262,_0x0676('0x75'));})[_0x0676('0x2c')](function(){return getServerInfo(_0x5bd1b9);})[_0x0676('0x77')](function(_0x20767e){logger['error']('['+_0x18a241[_0x0676('0x7a')]['toUpperCase']()+']',JSON[_0x0676('0x24')](_0x20767e));});};
\ No newline at end of file
index ec8cb08..a1f5cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab3c=['lodash','getString','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil'];(function(_0x195e8e,_0x3fb842){var _0x54701a=function(_0x38de38){while(--_0x38de38){_0x195e8e['push'](_0x195e8e['shift']());}};_0x54701a(++_0x3fb842);}(_0xab3c,0xf3));var _0xcab3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab3c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcab3('0x0'));var util=require('util');exports[_0xcab3('0x1')]=function(_0x16e710,_0x12aee8,_0x164b85){var _0x36288d=[];if(_0x16e710[_0xcab3('0x2')]>0x0){var _0x151924=_[_0xcab3('0x3')](_0x16e710,['id']);for(var _0x29ad00=0x0;_0x29ad00<_0x151924[_0xcab3('0x2')];_0x29ad00++){var _0x4552ac=_0x151924[_0x29ad00];if(_0x4552ac['type']===_0xcab3('0x4')){_0x36288d[_0xcab3('0x5')](_0x4552ac[_0xcab3('0x6')]);}else if(_0x4552ac[_0xcab3('0x7')]===_0xcab3('0x8')&&_0x4552ac[_0xcab3('0x9')]){_0x12aee8[_0x4552ac[_0xcab3('0x9')]]&&_0x36288d[_0xcab3('0x5')](_0x12aee8[_0x4552ac[_0xcab3('0x9')]][_0xcab3('0xa')]());}else if(_0x4552ac[_0xcab3('0x7')]===_0xcab3('0xb')&&_0x4552ac[_0xcab3('0xc')]&&_0x4552ac[_0xcab3('0xc')][_0xcab3('0xd')]){_0x12aee8[_0x4552ac['Variable'][_0xcab3('0xd')][_0xcab3('0xe')]()]&&_0x36288d[_0xcab3('0x5')](_0x12aee8[_0x4552ac[_0xcab3('0xc')][_0xcab3('0xd')][_0xcab3('0xe')]()][_0xcab3('0xa')]());}else if(_0x4552ac[_0xcab3('0x7')]===_0xcab3('0xf')){if(_0x4552ac[_0xcab3('0x10')]==='string'&&_0x4552ac[_0xcab3('0x11')]){_0x36288d['push'](util[_0xcab3('0x12')](_0xcab3('0x13'),_0x4552ac[_0xcab3('0x11')],_0x4552ac[_0xcab3('0x14')]));}else if(_0x4552ac['keyType']===_0xcab3('0x8')&&_0x4552ac[_0xcab3('0x9')]&&_0x4552ac[_0xcab3('0x11')]){_0x12aee8[_0x4552ac[_0xcab3('0x9')]]&&_0x36288d[_0xcab3('0x5')](util[_0xcab3('0x12')](_0xcab3('0x13'),_0x4552ac[_0xcab3('0x11')],_0x12aee8[_0x4552ac['variableName']]));}else if(_0x4552ac[_0xcab3('0x10')]==='customVariable'&&_0x4552ac[_0xcab3('0xc')]&&_0x4552ac[_0xcab3('0xc')][_0xcab3('0xd')]&&_0x4552ac[_0xcab3('0x11')]){_0x12aee8[_0x4552ac['Variable'][_0xcab3('0xd')][_0xcab3('0xe')]()]&&_0x36288d[_0xcab3('0x5')](util[_0xcab3('0x12')](_0xcab3('0x13'),_0x4552ac[_0xcab3('0x11')],_0x12aee8[_0x4552ac['Variable'][_0xcab3('0xd')][_0xcab3('0xe')]()]));}}}}return _0x36288d[_0xcab3('0x15')](_0x164b85);};exports[_0xcab3('0x16')]=function(_0x285aea){var _0x63d719=_0x285aea[_0xcab3('0x17')](-0x1);if(_0x63d719==='/'){_0x285aea=_0x285aea[_0xcab3('0x18')](0x0,_0x285aea[_0xcab3('0x19')](_0x63d719));}return _0x285aea;};exports['validateEmail']=function(_0x58c502){if(!_[_0xcab3('0x1a')](_0x58c502)&&_0x58c502!==''){var _0x423178=/^(([^<>()\[\]\\.,;:\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 _0x423178['test'](String(_0x58c502)[_0xcab3('0xe')]());}else{return![];}};
\ No newline at end of file
+var _0xc00a=['substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent','join','slice'];(function(_0x4b2831,_0x44690e){var _0x56a8e6=function(_0x3e60d1){while(--_0x3e60d1){_0x4b2831['push'](_0x4b2831['shift']());}};_0x56a8e6(++_0x44690e);}(_0xc00a,0x113));var _0xac00=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0xc00a[_0x593752];return _0x4612be;};'use strict';var _=require(_0xac00('0x0'));var util=require(_0xac00('0x1'));exports[_0xac00('0x2')]=function(_0x27bdb2,_0x36dcfd,_0x46be7f){var _0x3ca10c=[];if(_0x27bdb2['length']>0x0){var _0x1ad5c4=_['sortBy'](_0x27bdb2,['id']);for(var _0x26e17b=0x0;_0x26e17b<_0x1ad5c4[_0xac00('0x3')];_0x26e17b++){var _0x33ce06=_0x1ad5c4[_0x26e17b];if(_0x33ce06[_0xac00('0x4')]===_0xac00('0x5')){_0x3ca10c[_0xac00('0x6')](_0x33ce06[_0xac00('0x7')]);}else if(_0x33ce06[_0xac00('0x4')]===_0xac00('0x8')&&_0x33ce06[_0xac00('0x9')]){_0x36dcfd[_0x33ce06[_0xac00('0x9')]]&&_0x3ca10c['push'](_0x36dcfd[_0x33ce06[_0xac00('0x9')]][_0xac00('0xa')]());}else if(_0x33ce06['type']==='customVariable'&&_0x33ce06[_0xac00('0xb')]&&_0x33ce06[_0xac00('0xb')][_0xac00('0xc')]){_0x36dcfd[_0x33ce06['Variable'][_0xac00('0xc')][_0xac00('0xd')]()]&&_0x3ca10c[_0xac00('0x6')](_0x36dcfd[_0x33ce06[_0xac00('0xb')][_0xac00('0xc')][_0xac00('0xd')]()]['toString']());}else if(_0x33ce06[_0xac00('0x4')]===_0xac00('0xe')){if(_0x33ce06[_0xac00('0xf')]===_0xac00('0x5')&&_0x33ce06['key']){_0x3ca10c[_0xac00('0x6')](util[_0xac00('0x10')](_0xac00('0x11'),_0x33ce06[_0xac00('0x12')],_0x33ce06[_0xac00('0x13')]));}else if(_0x33ce06[_0xac00('0xf')]===_0xac00('0x8')&&_0x33ce06[_0xac00('0x9')]&&_0x33ce06['key']){_0x36dcfd[_0x33ce06['variableName']]&&_0x3ca10c[_0xac00('0x6')](util[_0xac00('0x10')](_0xac00('0x11'),_0x33ce06[_0xac00('0x12')],_0x36dcfd[_0x33ce06[_0xac00('0x9')]]));}else if(_0x33ce06[_0xac00('0xf')]==='customVariable'&&_0x33ce06['Variable']&&_0x33ce06[_0xac00('0xb')][_0xac00('0xc')]&&_0x33ce06['key']){_0x36dcfd[_0x33ce06[_0xac00('0xb')][_0xac00('0xc')]['toLowerCase']()]&&_0x3ca10c[_0xac00('0x6')](util[_0xac00('0x10')](_0xac00('0x11'),_0x33ce06[_0xac00('0x12')],_0x36dcfd[_0x33ce06['Variable'][_0xac00('0xc')][_0xac00('0xd')]()]));}}}}return _0x3ca10c[_0xac00('0x14')](_0x46be7f);};exports['stripTrailingSlash']=function(_0x590fb0){var _0x4864a4=_0x590fb0[_0xac00('0x15')](-0x1);if(_0x4864a4==='/'){_0x590fb0=_0x590fb0[_0xac00('0x16')](0x0,_0x590fb0[_0xac00('0x17')](_0x4864a4));}return _0x590fb0;};exports[_0xac00('0x18')]=function(_0x4d0f14){if(!_[_0xac00('0x19')](_0x4d0f14)&&_0x4d0f14!==''){var _0xaf6af8=/^(([^<>()\[\]\\.,;:\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 _0xaf6af8[_0xac00('0x1a')](String(_0x4d0f14)[_0xac00('0xd')]());}else{return![];}};
\ No newline at end of file
index e56c0e1..3cc2b3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x32f9a7,_0x55f877){var _0x1f0e27=function(_0x57c3ec){while(--_0x57c3ec){_0x32f9a7['push'](_0x32f9a7['shift']());}};_0x1f0e27(++_0x55f877);}(_0xe706,0xa3));var _0x6e70=function(_0x1bd0c4,_0x2405e0){_0x1bd0c4=_0x1bd0c4-0x0;var _0x13a3af=_0xe706[_0x1bd0c4];return _0x13a3af;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
+var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x20efd7,_0x59dee7){var _0x54ca1a=function(_0x2ab69f){while(--_0x2ab69f){_0x20efd7['push'](_0x20efd7['shift']());}};_0x54ca1a(++_0x59dee7);}(_0xe706,0xa3));var _0x6e70=function(_0x4d4c19,_0x3147ff){_0x4d4c19=_0x4d4c19-0x0;var _0xf9e510=_0xe706[_0x4d4c19];return _0xf9e510;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
index f641a18..b5ea8df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa00=['debug','[HTTP]','stringify','defaults','GET','forEach','string','picklist','type','nameField','customField','content','includes','idField','custom_fields','variable','variableName','Variable','name','toLowerCase','push','queue','stripTrailingSlash','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','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','error','inspect','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','remoteUri','merge','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','format','type:user\x20role:agent\x20email:%s','count','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64'];(function(_0x26e22b,_0x4692a1){var _0x2568c8=function(_0x39d587){while(--_0x39d587){_0x26e22b['push'](_0x26e22b['shift']());}};_0x2568c8(++_0x4692a1);}(_0xfa00,0xa8));var _0x0fa0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfa00[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0fa0('0x0'));var rp=require(_0x0fa0('0x1'));var md5=require(_0x0fa0('0x2'));var util=require('util');var Redis=require(_0x0fa0('0x3'));var intUtil=require('./util');var config=require(_0x0fa0('0x4'));var logger=require('../../../../config/logger')(_0x0fa0('0x5'));config[_0x0fa0('0x6')]=_['defaults'](config[_0x0fa0('0x6')],{'host':_0x0fa0('0x7'),'port':0x18eb});var io=require(_0x0fa0('0x8'))(new Redis(config['redis']));function emit(_0x3d39d9,_0x4fb605,_0xe4d848){io['to'](_0x3d39d9)['emit'](_0x4fb605,_0xe4d848);}var headers={'Content-Type':_0x0fa0('0x9'),'Accept':'application/json'};function getTicket(_0x5d5eed,_0x4b0b6f,_0x4f7688,_0x56e73e,_0xea32dc){logger[_0x0fa0('0xa')](_0x0fa0('0xb'));return request({'uri':util['format']('%s/tickets.json',_0x5d5eed[_0x0fa0('0xc')]),'method':'POST','body':{'ticket':_[_0x0fa0('0xd')]({'requester_id':_0x4f7688['id'],'submitter_id':_0x4b0b6f?_0x4b0b6f['id']:undefined,'assignee_id':_0x4b0b6f?_0x4b0b6f['id']:undefined,'tags':getTags(_0x56e73e['Tags'],'name'),'subject':intUtil['getString'](_0x56e73e[_0x0fa0('0xe')],_0xea32dc,'\x20'),'description':intUtil[_0x0fa0('0xf')](_0x56e73e[_0x0fa0('0x10')],_0xea32dc,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0fa0('0xf')](_0x56e73e[_0x0fa0('0x10')],_0xea32dc,'\x0a')}},getCustomFields(_0x56e73e[_0x0fa0('0x11')],_0xea32dc))}})[_0x0fa0('0x12')](function(_0x514aeb){logger[_0x0fa0('0xa')](_0x0fa0('0x13'));return _0x514aeb[_0x0fa0('0x14')];});}function getUser(_0x1d2202,_0x508be6){if(intUtil[_0x0fa0('0x15')](_0x508be6)){logger[_0x0fa0('0xa')]('Getting\x20agent\x20with\x20email',_0x508be6);return request({'uri':util[_0x0fa0('0x16')]('%s/search.json',_0x1d2202[_0x0fa0('0xc')]),'qs':{'query':util[_0x0fa0('0x16')](_0x0fa0('0x17'),_0x508be6)}})[_0x0fa0('0x12')](function(_0x2b503c){if(_0x2b503c[_0x0fa0('0x18')]){logger[_0x0fa0('0xa')]('Agent\x20found!');return _[_0x0fa0('0x19')](_0x2b503c['results'],{'email':_0x508be6,'role':'agent'});}else{logger['info'](_0x0fa0('0x1a'));return request({'uri':util[_0x0fa0('0x16')]('%s/users/me.json',_0x1d2202[_0x0fa0('0xc')])})[_0x0fa0('0x12')](function(_0x197c75){logger['info'](_0x0fa0('0x1b'));return _0x197c75[_0x0fa0('0x1c')];});}});}else{logger[_0x0fa0('0xa')](_0x0fa0('0x1a'));return request({'uri':util[_0x0fa0('0x16')](_0x0fa0('0x1d'),_0x1d2202[_0x0fa0('0xc')])})['then'](function(_0x174919){logger[_0x0fa0('0xa')]('Admin\x20account\x20selected.');return _0x174919['user'];});}}function getEndUser(_0x2dda9f,_0x457876,_0x327b2f){logger['info'](_0x0fa0('0x1e'),_0x327b2f);return request({'uri':util[_0x0fa0('0x16')]('%s/search.json',_0x2dda9f['remoteUri']),'qs':{'query':util[_0x0fa0('0x16')](_0x0fa0('0x1f'),_0x327b2f)}})['then'](function(_0x330942){var _0x37b02a;if(_0x330942[_0x0fa0('0x20')][_0x0fa0('0x21')]){_0x330942[_0x0fa0('0x20')]=_['filter'](_0x330942['results'],{'suspended':![],'role':_0x0fa0('0x22')});if(_0x330942['results'][_0x0fa0('0x21')]){_0x37b02a=_[_0x0fa0('0x23')](_0x330942['results']);}}if(_0x37b02a){logger[_0x0fa0('0xa')](_0x0fa0('0x24'));return _0x37b02a;}else{logger['info'](_0x0fa0('0x25'));return request({'uri':util[_0x0fa0('0x16')]('%s/users.json',_0x2dda9f[_0x0fa0('0xc')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x0fa0('0x16')](_0x0fa0('0x26'),_0x457876||_0x327b2f),'phone':_0x327b2f}}})['then'](function(_0x539026){logger['info'](_0x0fa0('0x27'));return _0x539026[_0x0fa0('0x1c')];});}});}function getAuth(_0x1a1d5e){var _0x3f31c2;if(_0x1a1d5e[_0x0fa0('0x28')]===_0x0fa0('0x29')){_0x3f31c2=util[_0x0fa0('0x16')]('%s:%s',_0x1a1d5e[_0x0fa0('0x2a')],_0x1a1d5e[_0x0fa0('0x29')]);}else if(_0x1a1d5e[_0x0fa0('0x28')]===_0x0fa0('0x2b')){_0x3f31c2=util[_0x0fa0('0x16')](_0x0fa0('0x2c'),_0x1a1d5e[_0x0fa0('0x2a')],_0x1a1d5e[_0x0fa0('0x2b')]);}return util[_0x0fa0('0x16')](_0x0fa0('0x2d'),new Buffer(_0x3f31c2)[_0x0fa0('0x2e')](_0x0fa0('0x2f')));}function request(_0x5422e3){logger[_0x0fa0('0x30')](_0x0fa0('0x31'),JSON[_0x0fa0('0x32')](_0x5422e3));return rp(_[_0x0fa0('0x33')](_0x5422e3,{'method':_0x0fa0('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x35639d,_0x21275f){var _0x526bcc=[];if(_0x35639d&&_0x35639d[_0x0fa0('0x21')]>0x0){_0x526bcc=_['map'](_0x35639d,_0x21275f);}return _0x526bcc;}function getCustomFields(_0x4ecfdc,_0x384f1a){var _0x4bd627=[];var _0x42db29={'custom_fields':[]};if(_0x4ecfdc[_0x0fa0('0x21')]>0x0){_[_0x0fa0('0x35')](_0x4ecfdc,function(_0x524695){if(_['includes']([_0x0fa0('0x36'),_0x0fa0('0x37')],_0x524695[_0x0fa0('0x38')])&&_0x524695[_0x0fa0('0x39')]&&!_0x524695[_0x0fa0('0x3a')]){_0x42db29[_0x524695[_0x0fa0('0x39')]['toLowerCase']()]=_0x524695[_0x0fa0('0x3b')][_0x0fa0('0x2e')]();}else if(_[_0x0fa0('0x3c')](['string','picklist'],_0x524695[_0x0fa0('0x38')])&&_0x524695[_0x0fa0('0x3d')]&&_0x524695['customField']){_0x42db29[_0x0fa0('0x3e')]['push']({'id':_0x524695[_0x0fa0('0x3d')],'value':_0x524695[_0x0fa0('0x3b')][_0x0fa0('0x2e')]()});}else if(_0x524695[_0x0fa0('0x38')]===_0x0fa0('0x3f')&&_0x524695[_0x0fa0('0x40')]&&_0x524695[_0x0fa0('0x3d')]&&_0x524695[_0x0fa0('0x3a')]){_0x384f1a[_0x524695[_0x0fa0('0x40')]]&&_0x42db29[_0x0fa0('0x3e')]['push']({'id':_0x524695[_0x0fa0('0x3d')],'value':_0x384f1a[_0x524695[_0x0fa0('0x40')]]['toString']()});}else if(_0x524695['type']==='customVariable'&&_0x524695[_0x0fa0('0x41')]&&_0x524695[_0x0fa0('0x41')][_0x0fa0('0x42')]&&_0x524695[_0x0fa0('0x3d')]&&_0x524695['customField']){_0x384f1a[_0x524695['Variable'][_0x0fa0('0x42')][_0x0fa0('0x43')]()]&&_0x42db29[_0x0fa0('0x3e')][_0x0fa0('0x44')]({'id':_0x524695['idField'],'value':_0x384f1a[_0x524695[_0x0fa0('0x41')]['name'][_0x0fa0('0x43')]()][_0x0fa0('0x2e')]()});}});}return _0x42db29;}exports[_0x0fa0('0x45')]=function(_0x2e0469,_0x107036,_0x3a4520,_0x27cdea,_0x3fb8e5,_0x5ab2fb){var _0x3288da,_0x3cc24f;_0x5ab2fb[_0x0fa0('0xc')]=intUtil[_0x0fa0('0x46')](_0x5ab2fb[_0x0fa0('0xc')]);_0x5ab2fb['serverUrl']=intUtil[_0x0fa0('0x46')](_0x5ab2fb['serverUrl']);if(_0x3fb8e5&&_0x3fb8e5[_0x0fa0('0x47')]){logger[_0x0fa0('0xa')](_0x0fa0('0x48'),_0x0fa0('0x49'));_0x107036[_0x0fa0('0x4a')]=util[_0x0fa0('0x16')](_0x0fa0('0x4b'),_0x5ab2fb['serverUrl'],_0x107036[_0x0fa0('0x4c')],md5(_0x107036[_0x0fa0('0x4c')]));}else{_0x107036[_0x0fa0('0x4a')]='';}headers[_0x0fa0('0x4d')]=getAuth(_0x5ab2fb);return getUser(_0x5ab2fb,_0x27cdea[_0x0fa0('0x4e')])[_0x0fa0('0x12')](function(_0x35c472){_0x3288da=_0x35c472;logger[_0x0fa0('0xa')](_0x0fa0('0x4f'),_0x3288da['id']);return getEndUser(_0x5ab2fb,_0x107036[_0x0fa0('0x50')],_0x107036[_0x0fa0('0x51')]);})[_0x0fa0('0x12')](function(_0x28a119){_0x3cc24f=_0x28a119;logger[_0x0fa0('0xa')]('The\x20Enduser\x20ID\x20is:',_0x3cc24f['id']);return getTicket(_0x5ab2fb,_0x3288da,_0x3cc24f,_0x3a4520,_0x107036);})[_0x0fa0('0x12')](function(_0x736295){if(_0x736295){logger[_0x0fa0('0xa')]('The\x20Ticket\x20ID\x20is:',_0x736295['id']);switch(_0x5ab2fb[_0x0fa0('0x38')]){case _0x0fa0('0x52'):logger[_0x0fa0('0xa')](_0x0fa0('0x48'),_0x0fa0('0x53'));return request({'uri':util[_0x0fa0('0x16')](_0x0fa0('0x54'),_0x5ab2fb[_0x0fa0('0xc')],_0x3288da['id'],_0x736295['id']),'method':_0x0fa0('0x55')});case _0x0fa0('0x56'):logger['info'](_0x0fa0('0x48'),_0x0fa0('0x57'));emit(util[_0x0fa0('0x16')](_0x0fa0('0x58'),_0x27cdea[_0x0fa0('0x42')]),'trigger:browser:url',{'uri':util[_0x0fa0('0x16')](_0x0fa0('0x59'),_0x5ab2fb[_0x0fa0('0xc')][_0x0fa0('0x5a')](_0x0fa0('0x5b'),''),_0x736295['id'])});break;default:logger['error']('[QUEUE]',_0x0fa0('0x5c'));}}})['catch'](function(_0x3397d9){logger[_0x0fa0('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0fa0('0x5e')](_0x3397d9,{'showHidden':!![],'depth':null}));});};exports[_0x0fa0('0x5f')]=function(_0x17a0db,_0x4fbe2e,_0x1c2ac2,_0x5479fb,_0x2adf7d,_0x26cc51,_0x597cf1){var _0x5f1a55,_0xbaf54d;_0x26cc51[_0x0fa0('0xc')]=intUtil[_0x0fa0('0x46')](_0x26cc51[_0x0fa0('0xc')]);_0x26cc51[_0x0fa0('0x60')]=intUtil['stripTrailingSlash'](_0x26cc51[_0x0fa0('0x60')]);if(_0x597cf1&&_0x597cf1[_0x0fa0('0x61')]&&_0x597cf1[_0x0fa0('0x61')]!==_0x0fa0('0x62')){logger['info'](_0x0fa0('0x63'),_0x0fa0('0x49'));_0x4fbe2e[_0x0fa0('0x4a')]=util[_0x0fa0('0x16')](_0x0fa0('0x4b'),_0x26cc51[_0x0fa0('0x60')],_0x4fbe2e['uniqueid'],md5(_0x4fbe2e[_0x0fa0('0x4c')]));}headers['Authorization']=getAuth(_0x26cc51);return getUser(_0x26cc51,_0x5479fb[_0x0fa0('0x4e')])['then'](function(_0x3deb52){_0x5f1a55=_0x3deb52;logger[_0x0fa0('0xa')](_0x0fa0('0x4f'),_0x5f1a55['id']);return getEndUser(_0x26cc51,_0x4fbe2e['destcalleridname'],_0x4fbe2e[_0x0fa0('0x64')]);})[_0x0fa0('0x12')](function(_0x5313b8){_0xbaf54d=_0x5313b8;logger[_0x0fa0('0xa')](_0x0fa0('0x65'),_0xbaf54d['id']);return getTicket(_0x26cc51,_0x5f1a55,_0xbaf54d,_0x1c2ac2,_0x4fbe2e);})[_0x0fa0('0x12')](function(_0x4b9585){if(_0x4b9585){logger[_0x0fa0('0xa')](_0x0fa0('0x66'),_0x4b9585['id']);switch(_0x26cc51[_0x0fa0('0x38')]){case _0x0fa0('0x52'):logger['info'](_0x0fa0('0x63'),_0x0fa0('0x53'));return request({'uri':util['format'](_0x0fa0('0x54'),_0x26cc51[_0x0fa0('0xc')],_0x5f1a55['id'],_0x4b9585['id']),'method':_0x0fa0('0x55')});case'newTab':logger[_0x0fa0('0xa')]('[OUTBOUND]',_0x0fa0('0x57'));emit(util[_0x0fa0('0x16')](_0x0fa0('0x58'),_0x5479fb[_0x0fa0('0x42')]),_0x0fa0('0x67'),{'uri':util[_0x0fa0('0x16')](_0x0fa0('0x59'),_0x26cc51[_0x0fa0('0xc')][_0x0fa0('0x5a')](_0x0fa0('0x5b'),''),_0x4b9585['id'])});break;default:logger['error'](_0x0fa0('0x63'),_0x0fa0('0x5c'));}}})[_0x0fa0('0x68')](function(_0x4c3bb3){logger[_0x0fa0('0x5d')](_0x0fa0('0x69'),util[_0x0fa0('0x5e')](_0x4c3bb3,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x54cfed,_0xff6de0,_0x553681,_0x53931a,_0x5dbc3d,_0x55dff3){var _0x378d08,_0x5a882d;_0x55dff3[_0x0fa0('0xc')]=intUtil[_0x0fa0('0x46')](_0x55dff3['remoteUri']);_0x55dff3[_0x0fa0('0x60')]=intUtil['stripTrailingSlash'](_0x55dff3['serverUrl']);if(_0x5dbc3d&&_0x5dbc3d[_0x0fa0('0x47')]){logger[_0x0fa0('0xa')]('['+_0xff6de0[_0x0fa0('0x6a')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0xff6de0[_0x0fa0('0x4a')]=util[_0x0fa0('0x16')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55dff3[_0x0fa0('0x60')],_0xff6de0[_0x0fa0('0x4c')],md5(_0xff6de0[_0x0fa0('0x4c')]));}else{_0xff6de0['recordingURL']='';}headers['Authorization']=getAuth(_0x55dff3);return getUser(_0x55dff3)['then'](function(_0x2b5e0e){_0x378d08=_0x2b5e0e;logger[_0x0fa0('0xa')](_0x0fa0('0x4f'),_0x378d08['id']);return getEndUser(_0x55dff3,_0xff6de0['calleridname'],_0xff6de0[_0x0fa0('0x51')]);})[_0x0fa0('0x12')](function(_0x72ab2a){_0x5a882d=_0x72ab2a;logger[_0x0fa0('0xa')](_0x0fa0('0x65'),_0x5a882d['id']);return getTicket(_0x55dff3,_0x378d08,_0x5a882d,_0x553681,_0xff6de0);})[_0x0fa0('0x12')](function(_0x161b8d){if(_0x161b8d){logger[_0x0fa0('0xa')](_0x0fa0('0x66'),_0x161b8d['id']);}})[_0x0fa0('0x68')](function(_0x28e77e){logger[_0x0fa0('0x5d')]('['+_0xff6de0['lastevent']['toUpperCase']()+']'+_0x0fa0('0x6b'),util['inspect'](_0x28e77e,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x03b8=['idField','custom_fields','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','base64','debug','stringify','defaults','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x03b8,0x179));var _0x803b=function(_0x23b7e4,_0x1c9417){_0x23b7e4=_0x23b7e4-0x0;var _0x40d91b=_0x03b8[_0x23b7e4];return _0x40d91b;};'use strict';var _=require(_0x803b('0x0'));var rp=require(_0x803b('0x1'));var md5=require('md5');var util=require(_0x803b('0x2'));var Redis=require(_0x803b('0x3'));var intUtil=require(_0x803b('0x4'));var config=require('../../../../config/environment');var logger=require(_0x803b('0x5'))('zendesk');config[_0x803b('0x6')]=_['defaults'](config[_0x803b('0x6')],{'host':_0x803b('0x7'),'port':0x18eb});var io=require(_0x803b('0x8'))(new Redis(config[_0x803b('0x6')]));function emit(_0x36f296,_0x2dc459,_0x49cc09){io['to'](_0x36f296)[_0x803b('0x9')](_0x2dc459,_0x49cc09);}var headers={'Content-Type':_0x803b('0xa'),'Accept':_0x803b('0xa')};function getTicket(_0x5da26d,_0x56bfb0,_0x2de6aa,_0x3c2b40,_0xbc07b){logger['info'](_0x803b('0xb'));return request({'uri':util[_0x803b('0xc')](_0x803b('0xd'),_0x5da26d[_0x803b('0xe')]),'method':_0x803b('0xf'),'body':{'ticket':_[_0x803b('0x10')]({'requester_id':_0x2de6aa['id'],'submitter_id':_0x56bfb0?_0x56bfb0['id']:undefined,'assignee_id':_0x56bfb0?_0x56bfb0['id']:undefined,'tags':getTags(_0x3c2b40['Tags'],_0x803b('0x11')),'subject':intUtil[_0x803b('0x12')](_0x3c2b40[_0x803b('0x13')],_0xbc07b,'\x20'),'description':intUtil['getString'](_0x3c2b40[_0x803b('0x14')],_0xbc07b,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x3c2b40[_0x803b('0x14')],_0xbc07b,'\x0a')}},getCustomFields(_0x3c2b40[_0x803b('0x15')],_0xbc07b))}})[_0x803b('0x16')](function(_0x4f205c){logger[_0x803b('0x17')](_0x803b('0x18'));return _0x4f205c[_0x803b('0x19')];});}function getUser(_0x51c4d6,_0x2c2c78){if(intUtil['validateEmail'](_0x2c2c78)){logger[_0x803b('0x17')](_0x803b('0x1a'),_0x2c2c78);return request({'uri':util[_0x803b('0xc')](_0x803b('0x1b'),_0x51c4d6[_0x803b('0xe')]),'qs':{'query':util[_0x803b('0xc')]('type:user\x20role:agent\x20email:%s',_0x2c2c78)}})['then'](function(_0xb7c2a4){if(_0xb7c2a4['count']){logger['info']('Agent\x20found!');return _['find'](_0xb7c2a4[_0x803b('0x1c')],{'email':_0x2c2c78,'role':_0x803b('0x1d')});}else{logger[_0x803b('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x803b('0xc')](_0x803b('0x1e'),_0x51c4d6[_0x803b('0xe')])})[_0x803b('0x16')](function(_0x22a020){logger[_0x803b('0x17')](_0x803b('0x1f'));return _0x22a020[_0x803b('0x20')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x803b('0xc')](_0x803b('0x1e'),_0x51c4d6[_0x803b('0xe')])})[_0x803b('0x16')](function(_0x3e8b44){logger['info'](_0x803b('0x1f'));return _0x3e8b44['user'];});}}function getEndUser(_0x4f3634,_0x182659,_0x22df17){logger['info'](_0x803b('0x21'),_0x22df17);return request({'uri':util[_0x803b('0xc')](_0x803b('0x1b'),_0x4f3634[_0x803b('0xe')]),'qs':{'query':util[_0x803b('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x22df17)}})[_0x803b('0x16')](function(_0x37447c){var _0x467d50;if(_0x37447c[_0x803b('0x1c')][_0x803b('0x22')]){_0x37447c[_0x803b('0x1c')]=_[_0x803b('0x23')](_0x37447c[_0x803b('0x1c')],{'suspended':![],'role':'end-user'});if(_0x37447c[_0x803b('0x1c')][_0x803b('0x22')]){_0x467d50=_['first'](_0x37447c['results']);}}if(_0x467d50){logger[_0x803b('0x17')]('Enduser\x20found!');return _0x467d50;}else{logger['info'](_0x803b('0x24'));return request({'uri':util[_0x803b('0xc')](_0x803b('0x25'),_0x4f3634['remoteUri']),'method':_0x803b('0xf'),'body':{'user':{'role':_0x803b('0x26'),'name':util[_0x803b('0xc')](_0x803b('0x27'),_0x182659||_0x22df17),'phone':_0x22df17}}})[_0x803b('0x16')](function(_0x191f78){logger[_0x803b('0x17')](_0x803b('0x28'));return _0x191f78[_0x803b('0x20')];});}});}function getAuth(_0x3103e1){var _0x3d4419;if(_0x3103e1[_0x803b('0x29')]===_0x803b('0x2a')){_0x3d4419=util[_0x803b('0xc')](_0x803b('0x2b'),_0x3103e1[_0x803b('0x2c')],_0x3103e1['password']);}else if(_0x3103e1[_0x803b('0x29')]==='token'){_0x3d4419=util[_0x803b('0xc')](_0x803b('0x2d'),_0x3103e1[_0x803b('0x2c')],_0x3103e1[_0x803b('0x2e')]);}return util[_0x803b('0xc')](_0x803b('0x2f'),new Buffer(_0x3d4419)[_0x803b('0x30')](_0x803b('0x31')));}function request(_0x3ac96c){logger[_0x803b('0x32')]('[HTTP]',JSON[_0x803b('0x33')](_0x3ac96c));return rp(_[_0x803b('0x34')](_0x3ac96c,{'method':_0x803b('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x2dcb05,_0x528b52){var _0xe918eb=[];if(_0x2dcb05&&_0x2dcb05[_0x803b('0x22')]>0x0){_0xe918eb=_['map'](_0x2dcb05,_0x528b52);}return _0xe918eb;}function getCustomFields(_0x2aa61a,_0x50ce8a){var _0x3722e1=[];var _0x1497d6={'custom_fields':[]};if(_0x2aa61a[_0x803b('0x22')]>0x0){_[_0x803b('0x36')](_0x2aa61a,function(_0x480339){if(_[_0x803b('0x37')]([_0x803b('0x38'),_0x803b('0x39')],_0x480339[_0x803b('0x3a')])&&_0x480339[_0x803b('0x3b')]&&!_0x480339[_0x803b('0x3c')]){_0x1497d6[_0x480339[_0x803b('0x3b')][_0x803b('0x3d')]()]=_0x480339[_0x803b('0x3e')][_0x803b('0x30')]();}else if(_[_0x803b('0x37')]([_0x803b('0x38'),'picklist'],_0x480339['type'])&&_0x480339[_0x803b('0x3f')]&&_0x480339[_0x803b('0x3c')]){_0x1497d6[_0x803b('0x40')][_0x803b('0x41')]({'id':_0x480339[_0x803b('0x3f')],'value':_0x480339[_0x803b('0x3e')][_0x803b('0x30')]()});}else if(_0x480339[_0x803b('0x3a')]==='variable'&&_0x480339[_0x803b('0x42')]&&_0x480339[_0x803b('0x3f')]&&_0x480339[_0x803b('0x3c')]){_0x50ce8a[_0x480339[_0x803b('0x42')]]&&_0x1497d6['custom_fields'][_0x803b('0x41')]({'id':_0x480339['idField'],'value':_0x50ce8a[_0x480339[_0x803b('0x42')]][_0x803b('0x30')]()});}else if(_0x480339['type']===_0x803b('0x43')&&_0x480339[_0x803b('0x44')]&&_0x480339[_0x803b('0x44')][_0x803b('0x11')]&&_0x480339[_0x803b('0x3f')]&&_0x480339['customField']){_0x50ce8a[_0x480339[_0x803b('0x44')]['name']['toLowerCase']()]&&_0x1497d6['custom_fields'][_0x803b('0x41')]({'id':_0x480339[_0x803b('0x3f')],'value':_0x50ce8a[_0x480339['Variable'][_0x803b('0x11')]['toLowerCase']()][_0x803b('0x30')]()});}});}return _0x1497d6;}exports[_0x803b('0x45')]=function(_0x4a56a7,_0x1927ac,_0x4dac62,_0x513c23,_0x10be8d,_0x306ee4){var _0x5d1f06,_0x5728db;_0x306ee4[_0x803b('0xe')]=intUtil[_0x803b('0x46')](_0x306ee4['remoteUri']);_0x306ee4[_0x803b('0x47')]=intUtil['stripTrailingSlash'](_0x306ee4[_0x803b('0x47')]);if(_0x10be8d&&_0x10be8d[_0x803b('0x48')]){logger[_0x803b('0x17')](_0x803b('0x49'),_0x803b('0x4a'));_0x1927ac[_0x803b('0x4b')]=util[_0x803b('0xc')](_0x803b('0x4c'),_0x306ee4[_0x803b('0x47')],_0x1927ac[_0x803b('0x4d')],md5(_0x1927ac[_0x803b('0x4d')]));}else{_0x1927ac[_0x803b('0x4b')]='';}headers[_0x803b('0x4e')]=getAuth(_0x306ee4);return getUser(_0x306ee4,_0x513c23[_0x803b('0x4f')])[_0x803b('0x16')](function(_0x9bc081){_0x5d1f06=_0x9bc081;logger[_0x803b('0x17')](_0x803b('0x50'),_0x5d1f06['id']);return getEndUser(_0x306ee4,_0x1927ac[_0x803b('0x51')],_0x1927ac[_0x803b('0x52')]);})[_0x803b('0x16')](function(_0x506b98){_0x5728db=_0x506b98;logger[_0x803b('0x17')](_0x803b('0x53'),_0x5728db['id']);return getTicket(_0x306ee4,_0x5d1f06,_0x5728db,_0x4dac62,_0x1927ac);})[_0x803b('0x16')](function(_0x539434){if(_0x539434){logger[_0x803b('0x17')](_0x803b('0x54'),_0x539434['id']);switch(_0x306ee4[_0x803b('0x3a')]){case _0x803b('0x55'):logger[_0x803b('0x17')]('[QUEUE]',_0x803b('0x56'));return request({'uri':util[_0x803b('0xc')](_0x803b('0x57'),_0x306ee4[_0x803b('0xe')],_0x5d1f06['id'],_0x539434['id']),'method':_0x803b('0xf')});case _0x803b('0x58'):logger[_0x803b('0x17')](_0x803b('0x49'),_0x803b('0x59'));emit(util[_0x803b('0xc')](_0x803b('0x5a'),_0x513c23[_0x803b('0x11')]),_0x803b('0x5b'),{'uri':util[_0x803b('0xc')]('%s/agent/tickets/%s',_0x306ee4['remoteUri'][_0x803b('0x5c')](_0x803b('0x5d'),''),_0x539434['id'])});break;default:logger['error'](_0x803b('0x49'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x185a65){logger['error'](_0x803b('0x5e'),util[_0x803b('0x5f')](_0x185a65,{'showHidden':!![],'depth':null}));});};exports[_0x803b('0x60')]=function(_0x3c79bd,_0x42dcd,_0x572a40,_0x6b783b,_0x413468,_0x109eba,_0x34f718){var _0x40c221,_0x398437;_0x109eba[_0x803b('0xe')]=intUtil[_0x803b('0x46')](_0x109eba[_0x803b('0xe')]);_0x109eba[_0x803b('0x47')]=intUtil[_0x803b('0x46')](_0x109eba[_0x803b('0x47')]);if(_0x34f718&&_0x34f718[_0x803b('0x61')]&&_0x34f718[_0x803b('0x61')]!==_0x803b('0x62')){logger['info'](_0x803b('0x63'),_0x803b('0x4a'));_0x42dcd[_0x803b('0x4b')]=util['format'](_0x803b('0x4c'),_0x109eba['serverUrl'],_0x42dcd[_0x803b('0x4d')],md5(_0x42dcd[_0x803b('0x4d')]));}headers[_0x803b('0x4e')]=getAuth(_0x109eba);return getUser(_0x109eba,_0x6b783b[_0x803b('0x4f')])[_0x803b('0x16')](function(_0x1625ed){_0x40c221=_0x1625ed;logger[_0x803b('0x17')]('The\x20User\x20ID\x20is:',_0x40c221['id']);return getEndUser(_0x109eba,_0x42dcd[_0x803b('0x64')],_0x42dcd[_0x803b('0x65')]);})[_0x803b('0x16')](function(_0x5e9bf3){_0x398437=_0x5e9bf3;logger['info'](_0x803b('0x53'),_0x398437['id']);return getTicket(_0x109eba,_0x40c221,_0x398437,_0x572a40,_0x42dcd);})['then'](function(_0x154dc9){if(_0x154dc9){logger['info'](_0x803b('0x54'),_0x154dc9['id']);switch(_0x109eba[_0x803b('0x3a')]){case _0x803b('0x55'):logger['info']('[OUTBOUND]',_0x803b('0x56'));return request({'uri':util[_0x803b('0xc')](_0x803b('0x57'),_0x109eba['remoteUri'],_0x40c221['id'],_0x154dc9['id']),'method':_0x803b('0xf')});case _0x803b('0x58'):logger[_0x803b('0x17')](_0x803b('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x803b('0xc')](_0x803b('0x5a'),_0x6b783b['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x109eba[_0x803b('0xe')][_0x803b('0x5c')](_0x803b('0x5d'),''),_0x154dc9['id'])});break;default:logger[_0x803b('0x66')](_0x803b('0x63'),_0x803b('0x67'));}}})[_0x803b('0x68')](function(_0x4b378d){logger['error'](_0x803b('0x69'),util[_0x803b('0x5f')](_0x4b378d,{'showHidden':!![],'depth':null}));});};exports[_0x803b('0x6a')]=function(_0x360ffc,_0x2a8f39,_0x275303,_0x3360ff,_0x4aed45,_0x3072f1){var _0x34ba27,_0x1d61d7;_0x3072f1[_0x803b('0xe')]=intUtil[_0x803b('0x46')](_0x3072f1[_0x803b('0xe')]);_0x3072f1['serverUrl']=intUtil['stripTrailingSlash'](_0x3072f1[_0x803b('0x47')]);if(_0x4aed45&&_0x4aed45['monitor_format']){logger['info']('['+_0x2a8f39[_0x803b('0x6b')][_0x803b('0x6c')]()+']','Recording\x20is\x20enabled!');_0x2a8f39['recordingURL']=util[_0x803b('0xc')](_0x803b('0x4c'),_0x3072f1[_0x803b('0x47')],_0x2a8f39[_0x803b('0x4d')],md5(_0x2a8f39[_0x803b('0x4d')]));}else{_0x2a8f39[_0x803b('0x4b')]='';}headers[_0x803b('0x4e')]=getAuth(_0x3072f1);return getUser(_0x3072f1)[_0x803b('0x16')](function(_0xf72806){_0x34ba27=_0xf72806;logger[_0x803b('0x17')](_0x803b('0x50'),_0x34ba27['id']);return getEndUser(_0x3072f1,_0x2a8f39[_0x803b('0x51')],_0x2a8f39['calleridnum']);})[_0x803b('0x16')](function(_0x13348e){_0x1d61d7=_0x13348e;logger[_0x803b('0x17')](_0x803b('0x53'),_0x1d61d7['id']);return getTicket(_0x3072f1,_0x34ba27,_0x1d61d7,_0x275303,_0x2a8f39);})['then'](function(_0x3ed9b8){if(_0x3ed9b8){logger[_0x803b('0x17')]('The\x20Ticket\x20ID\x20is:',_0x3ed9b8['id']);}})[_0x803b('0x68')](function(_0x5e2018){logger[_0x803b('0x66')]('['+_0x2a8f39[_0x803b('0x6b')][_0x803b('0x6c')]()+']'+_0x803b('0x6d'),util['inspect'](_0x5e2018,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 2f888f2..fa43f04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e6f=['rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','details','err','queue','host','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','serverUrl','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','recordingURL','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','[QUEUE]','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','lastevent','toUpperCase','lodash','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','stringify','forEach','includes','picklist','idField','toString','variable','variableName','type','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','then','access_token','expires_in','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','/crm/v2/','startCase','role','last_name','code','SUCCESS','moduleCreate','log','CREATE\x20ERROR','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','mm:ss','called','Call_Result','connect','Answered'];(function(_0x2cb633,_0x5caee0){var _0x4b1a20=function(_0x4ea50f){while(--_0x4ea50f){_0x2cb633['push'](_0x2cb633['shift']());}};_0x4b1a20(++_0x5caee0);}(_0x4e6f,0x14d));var _0xf4e6=function(_0xf77866,_0x566964){_0xf77866=_0xf77866-0x0;var _0x5a4b23=_0x4e6f[_0xf77866];return _0x5a4b23;};'use strict';var _=require(_0xf4e6('0x0'));var rp=require('request-promise');var md5=require(_0xf4e6('0x1'));var util=require(_0xf4e6('0x2'));var intUtil=require(_0xf4e6('0x3'));var moment=require(_0xf4e6('0x4'));var Redis=require(_0xf4e6('0x5'));var BPromise=require('bluebird');var config=require(_0xf4e6('0x6'));var logger=require(_0xf4e6('0x7'))(_0xf4e6('0x8'));config[_0xf4e6('0x9')]=_['defaults'](config[_0xf4e6('0x9')],{'host':_0xf4e6('0xa'),'port':0x18eb});var io=require(_0xf4e6('0xb'))(new Redis(config['redis']));function emit(_0x35559c,_0x44ac3c,_0x391e9f){io['to'](_0x35559c)[_0xf4e6('0xc')](_0x44ac3c,_0x391e9f);}function request(_0x4568d8){logger['debug']('[HTTP]',JSON[_0xf4e6('0xd')](_0x4568d8));return rp(_0x4568d8);}function getCustomFields(_0x3de2bc,_0x227f62){var _0x11d21f={};if(_0x3de2bc['length']>0x0){_[_0xf4e6('0xe')](_0x3de2bc,function(_0x1c48d5){if(_[_0xf4e6('0xf')](['string',_0xf4e6('0x10')],_0x1c48d5['type'])&&_0x1c48d5['idField']){_0x11d21f[_0x1c48d5[_0xf4e6('0x11')]]=_0x1c48d5['content'][_0xf4e6('0x12')]();}else if(_0x1c48d5['type']===_0xf4e6('0x13')&&_0x1c48d5['variableName']&&_0x1c48d5['idField']&&_0x227f62[_0x1c48d5[_0xf4e6('0x14')]]){_0x11d21f[_0x1c48d5[_0xf4e6('0x11')]]=_0x227f62[_0x1c48d5['variableName']][_0xf4e6('0x12')]();}else if(_0x1c48d5[_0xf4e6('0x15')]===_0xf4e6('0x16')&&_0x1c48d5['Variable']&&_0x1c48d5[_0xf4e6('0x17')][_0xf4e6('0x18')]&&_0x1c48d5['idField']&&_0x227f62[_0x1c48d5['Variable'][_0xf4e6('0x18')][_0xf4e6('0x19')]()]){_0x11d21f[_0x1c48d5[_0xf4e6('0x11')]]=_0x227f62[_0x1c48d5[_0xf4e6('0x17')][_0xf4e6('0x18')][_0xf4e6('0x19')]()][_0xf4e6('0x12')]();}});}return _0x11d21f;}function getName(_0x42d88f){if(_0x42d88f[_0xf4e6('0x1a')]('\x20')>0x0){var _0x118423=_0x42d88f[_0xf4e6('0x1b')](/ (.+)/);if(_0x118423[0x1]){return _0x118423;}}return[_0x42d88f,_0x42d88f];}var accountsTokens={};function getAccessToken(_0x5d63ce){return new Promise(function(_0x2cc588,_0x29e8f9){if(!_['isNil'](accountsTokens[_0x5d63ce['id']])&&!_[_0xf4e6('0x1c')](accountsTokens[_0x5d63ce['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x5d63ce['id']]['expires_in'])){_0x2cc588(accountsTokens[_0x5d63ce['id']]['access_token']);}}var _0x21f64c;switch(_0x5d63ce['zone']){case'US':_0x21f64c='https://accounts.zoho.com';break;case'AU':_0x21f64c=_0xf4e6('0x1d');break;case'EU':_0x21f64c=_0xf4e6('0x1e');break;case'IN':_0x21f64c='https://accounts.zoho.in';break;case'CN':_0x21f64c=_0xf4e6('0x1f');break;default:_0x21f64c=_0xf4e6('0x1e');break;}var _0x5962ff={'method':_0xf4e6('0x20'),'uri':_0x21f64c+'/oauth/v2/token','qs':{'refresh_token':_0x5d63ce[_0xf4e6('0x21')],'client_id':_0x5d63ce[_0xf4e6('0x22')],'client_secret':_0x5d63ce[_0xf4e6('0x23')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5962ff)[_0xf4e6('0x24')](function(_0xd3e197){accountsTokens[_0x5d63ce['id']]={'access_token':_0xd3e197[_0xf4e6('0x25')],'expires_in':moment()['add'](_0xd3e197[_0xf4e6('0x26')],_0xf4e6('0x27'))};_0x2cc588(_0xd3e197[_0xf4e6('0x25')]);})['catch'](function(_0x1acc7f){logger[_0xf4e6('0x28')](_0xf4e6('0x29'),_0x1acc7f[_0xf4e6('0x2a')]);_0x29e8f9(_0x1acc7f);});});}function getUser(_0x3eafab,_0x3b5e98,_0x2aeae0,_0x4a5549){logger[_0xf4e6('0x2b')](_0xf4e6('0x2c'));return request({'method':_0xf4e6('0x2d'),'uri':util[_0xf4e6('0x2e')](_0xf4e6('0x2f'),_0x3b5e98),'qs':{'type':_0xf4e6('0x30')},'headers':{'Authorization':_0xf4e6('0x31')+_0x3eafab},'json':!![]})[_0xf4e6('0x24')](function(_0x5e256c){if(_0x5e256c[_0xf4e6('0x32')]){var _0xfc38d2=-0x1;if(_['isArrayLikeObject'](_0x5e256c[_0xf4e6('0x32')])){if(!_[_0xf4e6('0x1c')](_0x4a5549)){_0xfc38d2=_[_0xf4e6('0x33')](_0x5e256c[_0xf4e6('0x32')],function(_0x1489f2){return _0x1489f2[_0xf4e6('0x34')]===_0x4a5549;});}if(_0xfc38d2>=0x0){logger[_0xf4e6('0x2b')](_0xf4e6('0x35'));}else{logger[_0xf4e6('0x2b')](_0xf4e6('0x36'));_0xfc38d2=_[_0xf4e6('0x33')](_0x5e256c['users'],function(_0x35fcd8){return _0x35fcd8[_0xf4e6('0x37')][_0xf4e6('0x18')]===_0xf4e6('0x38');});}return _0x5e256c[_0xf4e6('0x32')][_0xfc38d2];}else{if(_0x5e256c[_0xf4e6('0x39')][_0xf4e6('0x37')][_0xf4e6('0x18')]===_0xf4e6('0x38')){logger['info'](_0xf4e6('0x36'));user=_0x5e256c[_0xf4e6('0x39')];return user;}else{logger[_0xf4e6('0x28')](_0xf4e6('0x3a'),JSON[_0xf4e6('0xd')](_0x5e256c));throw new Error(_0xf4e6('0x3b')+JSON[_0xf4e6('0xd')](_0x5e256c));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xf4e6('0xd')](_0x5e256c));throw new Error(_0xf4e6('0x3b')+JSON[_0xf4e6('0xd')](_0x5e256c));}})[_0xf4e6('0x3c')](function(_0x1f0b74){console[_0xf4e6('0x28')](_0x1f0b74);});}function getZohoUser(_0x42e419,_0xfb54b8){return new BPromise(function(_0x61104e,_0x15f5d5){request(_0x42e419)[_0xf4e6('0x24')](function(_0x2d9fd6){var _0x9e7089=null;if(_0x2d9fd6){_0x9e7089=_0x2d9fd6[_0xf4e6('0x3d')][0x0];_0x9e7089[_0xf4e6('0x3e')]=_0xfb54b8;}_0x61104e(_0x9e7089);})[_0xf4e6('0x3c')](function(_0x3eb100){_0x15f5d5(_0x3eb100);});});}function createEndUser(_0x2651f7,_0x1d328c,_0x589b02,_0x393f27,_0x897e73,_0x3fd522){var _0x589b02=getName(_0x589b02);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1d328c+_0xf4e6('0x3f')+_[_0xf4e6('0x40')](_0x3fd522['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x589b02[0x1],'First_Name':_0x589b02[0x0],'Phone':_0x393f27,'Owner':{'name':!_[_0xf4e6('0x1c')](_0x897e73[_0xf4e6('0x41')][_0xf4e6('0x18')])?_0x897e73[_0xf4e6('0x41')][_0xf4e6('0x18')]:!_['isNil'](_0x897e73['first_name'])?_0x897e73['first_name']+'\x20'+_0x897e73[_0xf4e6('0x42')]:_0x897e73[_0xf4e6('0x42')],'id':_0x897e73['id']}}]},'headers':{'Authorization':_0xf4e6('0x31')+_0x2651f7},'json':!![]})[_0xf4e6('0x24')](function(_0x1ed007){if(_0x1ed007&&_0x1ed007[_0xf4e6('0x3d')][0x0][_0xf4e6('0x43')]===_0xf4e6('0x44')){var _0x495de2=_0x1ed007[_0xf4e6('0x3d')][0x0]['details'];_0x495de2[_0xf4e6('0x3e')]=_['startCase'](_0x3fd522[_0xf4e6('0x45')])+'s';return _0x495de2;}logger['error'](_0xf4e6('0x3a'),JSON[_0xf4e6('0xd')](data));throw new Error('Error:\x20'+JSON[_0xf4e6('0xd')](data));})['catch'](function(_0x1eca08){console[_0xf4e6('0x46')](_0xf4e6('0x47'),_0x1eca08);});}function getEndUser(_0x5cc6c5,_0x2cb17a,_0x2239d9,_0x367cee,_0x370de5,_0xdafdf0,_0x5a801d){var _0xcf4d2c={'method':_0xf4e6('0x2d'),'uri':'','headers':{'Authorization':_0xf4e6('0x31')+_0x5cc6c5},'json':!![]};switch(_0x5a801d['moduleSearch']){case'contact_lead':_0xcf4d2c[_0xf4e6('0x48')]=_0xf4e6('0x49')+_0x2cb17a+_0xf4e6('0x4a')+_0x370de5+'))';return getZohoUser(_0xcf4d2c,'Contacts')[_0xf4e6('0x24')](function(_0x440571){if(_0x440571)return _0x440571;_0xcf4d2c[_0xf4e6('0x48')]=_0xf4e6('0x49')+_0x2cb17a+_0xf4e6('0x4b')+_0x370de5+'))';return getZohoUser(_0xcf4d2c,_0xf4e6('0x4c'))[_0xf4e6('0x24')](function(_0x3fd590){if(_0x3fd590)return _0x3fd590;if(_0x5a801d[_0xf4e6('0x45')]!=_0xf4e6('0x4d')){return createEndUser(_0x5cc6c5,_0x2cb17a,_0x367cee,_0x370de5,_0xdafdf0,_0x5a801d);}else{return{};}});});break;case _0xf4e6('0x4e'):_0xcf4d2c['uri']=_0xf4e6('0x49')+_0x2cb17a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x370de5+'))';return getZohoUser(_0xcf4d2c,_0xf4e6('0x4f'))[_0xf4e6('0x24')](function(_0x2f9788){if(_0x2f9788)return _0x2f9788;if(_0x5a801d[_0xf4e6('0x45')]!='nothing'){return createEndUser(_0x5cc6c5,_0x2cb17a,_0x367cee,_0x370de5,_0xdafdf0,_0x5a801d);}else{return{};}});break;case _0xf4e6('0x50'):_0xcf4d2c[_0xf4e6('0x48')]=_0xf4e6('0x49')+_0x2cb17a+_0xf4e6('0x4b')+_0x370de5+'))';return getZohoUser(_0xcf4d2c,'Leads')[_0xf4e6('0x24')](function(_0x4f4210){if(_0x4f4210)return _0x4f4210;if(_0x5a801d['moduleCreate']!=_0xf4e6('0x4d')){return createEndUser(_0x5cc6c5,_0x2cb17a,_0x367cee,_0x370de5,_0xdafdf0,_0x5a801d);}else{return{};}});break;}}function getCall(_0x2adcb0,_0x44699a,_0x2e7beb,_0x1fa8f0,_0x89aaa5,_0x320068,_0x49b619,_0x104bf8){logger['info']('Creating\x20new\x20call...');var _0xe2c39b={};_0xe2c39b[_0xf4e6('0x51')]={'name':!_[_0xf4e6('0x1c')](_0x1fa8f0[_0xf4e6('0x41')]['name'])&&!_[_0xf4e6('0x1c')](_0x1fa8f0[_0xf4e6('0x37')]['name'])&&_0x1fa8f0['profile'][_0xf4e6('0x18')]===_0xf4e6('0x52')?_0x1fa8f0[_0xf4e6('0x41')]['name']:!_[_0xf4e6('0x1c')](_0x1fa8f0['first_name'])?_0x1fa8f0['first_name']+'\x20'+_0x1fa8f0[_0xf4e6('0x42')]:_0x1fa8f0[_0xf4e6('0x42')],'id':_0x1fa8f0['id']};_0xe2c39b[_0xf4e6('0x53')]=intUtil['getString'](_0x320068[_0xf4e6('0x54')],_0x49b619,'\x20');_0xe2c39b[_0xf4e6('0x55')]=intUtil[_0xf4e6('0x56')](_0x320068[_0xf4e6('0x57')],_0x49b619,'\x0a');if(_0x89aaa5[_0xf4e6('0x3e')]===_0xf4e6('0x4f')){_0xe2c39b[_0xf4e6('0x58')]={'name':!_['isNil'](_0x89aaa5[_0xf4e6('0x59')])?_0x89aaa5[_0xf4e6('0x59')]:!_['isNil'](_0x89aaa5[_0xf4e6('0x5a')])?_0x89aaa5['First_Name']+'\x20'+_0x89aaa5['Last_Name']:_0x89aaa5[_0xf4e6('0x5b')],'id':_0x89aaa5['id']};}if(_0x89aaa5[_0xf4e6('0x3e')]===_0xf4e6('0x4c')){_0xe2c39b[_0xf4e6('0x5c')]={'name':!_['isNil'](_0x89aaa5[_0xf4e6('0x59')])?_0x89aaa5[_0xf4e6('0x59')]:!_['isNil'](_0x89aaa5[_0xf4e6('0x5a')])?_0x89aaa5['First_Name']+'\x20'+_0x89aaa5[_0xf4e6('0x5b')]:_0x89aaa5[_0xf4e6('0x5b')],'id':_0x89aaa5['id']};_0xe2c39b[_0xf4e6('0x5d')]=_[_0xf4e6('0x40')](_0x89aaa5[_0xf4e6('0x3e')]);}if(_0x49b619[_0xf4e6('0x5e')]){_0xe2c39b[_0xf4e6('0x5f')]=moment[_0xf4e6('0x60')](parseInt(_0x49b619[_0xf4e6('0x5e')])*0x3e8)['format']('mm:ss');}else if(_0x49b619[_0xf4e6('0x61')]&&_0x49b619[_0xf4e6('0x62')]){_0xe2c39b[_0xf4e6('0x5f')]=moment[_0xf4e6('0x60')](moment(_0x49b619[_0xf4e6('0x62')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x49b619['starttime'],_0xf4e6('0x63'))))[_0xf4e6('0x2e')](_0xf4e6('0x64'));}switch(_0x49b619['lastevent']){case _0xf4e6('0x65'):_0xe2c39b[_0xf4e6('0x66')]='Called';break;case'complete':case _0xf4e6('0x67'):_0xe2c39b[_0xf4e6('0x66')]=_0xf4e6('0x68');break;case _0xf4e6('0x69'):_0xe2c39b[_0xf4e6('0x66')]=_0xf4e6('0x6a');break;case _0xf4e6('0x6b'):_0xe2c39b['Call_Result']=_0xf4e6('0x6c');break;case _0xf4e6('0x6d'):_0xe2c39b[_0xf4e6('0x66')]=_0xf4e6('0x6e');default:}_0xe2c39b[_0xf4e6('0x6f')]=(_0x104bf8===_0xf4e6('0x70')?moment(_0x49b619[_0xf4e6('0x71')])[_0xf4e6('0x2e')](_0xf4e6('0x63')):moment(_0x49b619[_0xf4e6('0x72')])['format'](_0xf4e6('0x63')))||moment()[_0xf4e6('0x2e')]('YYYY-MM-DDTHH:mm:ss');_0xe2c39b[_0xf4e6('0x73')]=_0x104bf8||_0xf4e6('0x74');_0xe2c39b=_[_0xf4e6('0x75')](_0xe2c39b,getCustomFields(_0x320068[_0xf4e6('0x76')],_0x49b619));return request({'method':_0xf4e6('0x20'),'uri':_0xf4e6('0x49')+_0x44699a+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2adcb0},'body':{'data':[_0xe2c39b]},'json':!![]})[_0xf4e6('0x24')](function(_0x13f134){if(_0x13f134&&_0x13f134[_0xf4e6('0x3d')][0x0][_0xf4e6('0x43')]===_0xf4e6('0x44')){logger[_0xf4e6('0x2b')](_0xf4e6('0x77'));return{'id':_0x13f134['data'][0x0][_0xf4e6('0x78')]['id']};}})[_0xf4e6('0x3c')](function(_0xa820aa){logger[_0xf4e6('0x2b')](_0xf4e6('0x79'),_0xa820aa[_0xf4e6('0x2a')]);console[_0xf4e6('0x46')](_0xf4e6('0x79'),_0xa820aa);});}exports[_0xf4e6('0x7a')]=function(_0x103346,_0x4f137d,_0x55dea6,_0x45fc68,_0x32d499,_0x1b1867){var _0x292b73,_0x4dabf2,_0x4f3913;_0x1b1867[_0xf4e6('0x7b')]=intUtil['stripTrailingSlash'](_0x1b1867[_0xf4e6('0x7b')]);_0x1b1867['serverUrl']=intUtil[_0xf4e6('0x7c')](_0x1b1867['serverUrl']);if(_0x32d499&&_0x32d499[_0xf4e6('0x7d')]){logger[_0xf4e6('0x2b')]('[QUEUE]',_0xf4e6('0x7e'));_0x4f137d['recordingURL']=_0x1b1867[_0xf4e6('0x7f')]+_0xf4e6('0x80')+_0x4f137d['uniqueid']+_0xf4e6('0x81')+md5(_0x4f137d[_0xf4e6('0x82')]);}else{_0x4f137d[_0xf4e6('0x83')]='';}var _0x590cf5=_0x1b1867['host']==='zoho.eu'?'eu':_0xf4e6('0x84');return getAccessToken(_0x1b1867)[_0xf4e6('0x24')](function(_0x514c8e){_0x4f3913=_0x514c8e;return getUser(_0x4f3913,_0x590cf5,_0x1b1867,_0x45fc68[_0xf4e6('0x34')]);})[_0xf4e6('0x24')](function(_0x1085eb){_0x292b73=_0x1085eb;logger[_0xf4e6('0x2b')](_0xf4e6('0x85'),_0x292b73['id']);return getEndUser(_0x4f3913,_0x590cf5,_0x1b1867,_0x4f137d[_0xf4e6('0x86')],_0x4f137d['calleridnum'],_0x292b73,_0x55dea6);})[_0xf4e6('0x24')](function(_0x292ac7){_0x4dabf2=_0x292ac7;return getCall(_0x4f3913,_0x590cf5,_0x1b1867,_0x292b73,_0x4dabf2,_0x55dea6,_0x4f137d,_0xf4e6('0x74'));})[_0xf4e6('0x24')](function(_0xcbb070){if(_0xcbb070){logger['info'](_0xf4e6('0x87'),_0xcbb070['id']);logger[_0xf4e6('0x2b')](_0xf4e6('0x88'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf4e6('0x2e')]('user:%s',_0x45fc68[_0xf4e6('0x18')]),'trigger:browser:url',{'uri':_0xf4e6('0x89')+_0x1b1867[_0xf4e6('0x7b')]+_0xf4e6('0x8a')+_0xcbb070['id']});}})[_0xf4e6('0x3c')](function(_0x315d42){logger[_0xf4e6('0x28')]('[QUEUE]',JSON[_0xf4e6('0xd')](_0x315d42));});};exports[_0xf4e6('0x70')]=function(_0xfab4e3,_0x3bac1e,_0xa60bae,_0x4307bc,_0x11f7ea,_0x736ae3,_0x2754fd){var _0x4f41ef,_0x116808,_0x67b565;_0x736ae3[_0xf4e6('0x7b')]=intUtil['stripTrailingSlash'](_0x736ae3[_0xf4e6('0x7b')]);_0x736ae3[_0xf4e6('0x7f')]=intUtil[_0xf4e6('0x7c')](_0x736ae3[_0xf4e6('0x7f')]);if(_0x2754fd&&_0x2754fd[_0xf4e6('0x8b')]&&_0x2754fd[_0xf4e6('0x8b')]!=='none'){logger[_0xf4e6('0x2b')](_0xf4e6('0x8c'),'Recording\x20is\x20enabled!');_0x3bac1e[_0xf4e6('0x83')]=_0x736ae3['serverUrl']+'/api/voice/recordings/'+_0x3bac1e['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3bac1e[_0xf4e6('0x82')]);}var _0x53d365=_0x736ae3['host']==='zoho.eu'?'eu':_0xf4e6('0x84');return getAccessToken(_0x736ae3)['then'](function(_0x5be668){_0x67b565=_0x5be668;return getUser(_0x67b565,_0x53d365,_0x736ae3,_0x4307bc[_0xf4e6('0x34')]);})['then'](function(_0x3fd0d9){_0x4f41ef=_0x3fd0d9;logger[_0xf4e6('0x2b')](_0xf4e6('0x85'),_0x4f41ef['id']);return getEndUser(_0x67b565,_0x53d365,_0x736ae3,_0x3bac1e['destcalleridname'],_0x3bac1e['destcalleridnum'],_0x4f41ef,_0xa60bae);})[_0xf4e6('0x24')](function(_0x1a1905){_0x116808=_0x1a1905;return getCall(_0x67b565,_0x53d365,_0x736ae3,_0x4f41ef,_0x116808,_0xa60bae,_0x3bac1e,'Outbound');})[_0xf4e6('0x24')](function(_0x21270c){if(_0x21270c){logger['info'](_0xf4e6('0x87'),_0x21270c['id']);logger[_0xf4e6('0x2b')](_0xf4e6('0x8c'),_0xf4e6('0x8d'));emit(util['format'](_0xf4e6('0x8e'),_0x4307bc['name']),'trigger:browser:url',{'uri':_0xf4e6('0x89')+_0x736ae3[_0xf4e6('0x7b')]+_0xf4e6('0x8a')+_0x21270c['id']});}})[_0xf4e6('0x3c')](function(_0x4d67db){logger[_0xf4e6('0x28')]('[OUTBOUND]',JSON['stringify'](_0x4d67db));});};exports[_0xf4e6('0x8f')]=function(_0x5c7df5,_0x544a46,_0x281625,_0x38992b,_0x49fbb3,_0x24c273){var _0x29c8e3,_0x3506c7,_0x524604;_0x24c273[_0xf4e6('0x7b')]=intUtil[_0xf4e6('0x7c')](_0x24c273[_0xf4e6('0x7b')]);_0x24c273[_0xf4e6('0x7f')]=intUtil[_0xf4e6('0x7c')](_0x24c273['serverUrl']);if(_0x49fbb3&&_0x49fbb3['monitor_format']){logger[_0xf4e6('0x2b')]('['+_0x544a46[_0xf4e6('0x90')]['toUpperCase']()+']',_0xf4e6('0x7e'));_0x544a46['recordingURL']=_0x24c273[_0xf4e6('0x7f')]+_0xf4e6('0x80')+_0x544a46['uniqueid']+_0xf4e6('0x81')+md5(_0x544a46[_0xf4e6('0x82')]);}else{_0x544a46[_0xf4e6('0x83')]='';}var _0x1d5834=_0x24c273[_0xf4e6('0x7b')]==='zoho.eu'?'eu':_0xf4e6('0x84');return getAccessToken(_0x24c273)[_0xf4e6('0x24')](function(_0x17005f){_0x524604=_0x17005f;return getUser(_0x524604,_0x1d5834,_0x24c273);})[_0xf4e6('0x24')](function(_0x25df04){_0x29c8e3=_0x25df04;logger[_0xf4e6('0x2b')](_0xf4e6('0x85'),_0x29c8e3['id']);return getEndUser(_0x524604,_0x1d5834,_0x24c273,_0x544a46[_0xf4e6('0x86')],_0x544a46['calleridnum'],_0x29c8e3,_0x281625);})['then'](function(_0x50242a){_0x3506c7=_0x50242a;return getCall(_0x524604,_0x1d5834,_0x24c273,_0x29c8e3,_0x3506c7,_0x281625,_0x544a46,_0xf4e6('0x74'));})[_0xf4e6('0x24')](function(_0x3bed97){if(_0x3bed97){logger[_0xf4e6('0x2b')]('The\x20Call\x20ID\x20is:',_0x3bed97['id']);}})[_0xf4e6('0x3c')](function(_0x1aa26e){logger[_0xf4e6('0x28')]('['+_0x544a46[_0xf4e6('0x90')][_0xf4e6('0x91')]()+']',JSON['stringify'](_0x1aa26e));});};
\ No newline at end of file
+var _0x77f4=['Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','Agent\x20found!','findIndex','profile','user','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','then','SUCCESS','enduserType','moduleCreate','Error:\x20','log','GET','moduleSearch','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','administrator','Subject','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','diff','starttime','lastevent','called','Called','complete','Call_Result','Answered','rejected','Rejected','abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','YYYY-MM-DDTHH:mm:ss','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','redis','localhost','debug','[HTTP]','length','forEach','string','picklist','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','catch','error'];(function(_0x55d504,_0x539ccd){var _0x38841c=function(_0x3e1419){while(--_0x3e1419){_0x55d504['push'](_0x55d504['shift']());}};_0x38841c(++_0x539ccd);}(_0x77f4,0x1a1));var _0x477f=function(_0x409dd6,_0x5589a4){_0x409dd6=_0x409dd6-0x0;var _0xf9188=_0x77f4[_0x409dd6];return _0xf9188;};'use strict';var _=require(_0x477f('0x0'));var rp=require(_0x477f('0x1'));var md5=require(_0x477f('0x2'));var util=require(_0x477f('0x3'));var intUtil=require(_0x477f('0x4'));var moment=require(_0x477f('0x5'));var Redis=require(_0x477f('0x6'));var BPromise=require(_0x477f('0x7'));var config=require('../../../../config/environment');var logger=require(_0x477f('0x8'))('zoho');config[_0x477f('0x9')]=_['defaults'](config['redis'],{'host':_0x477f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x477f('0x9')]));function emit(_0x462569,_0x1c3100,_0x410bd9){io['to'](_0x462569)['emit'](_0x1c3100,_0x410bd9);}function request(_0x4f60ca){logger[_0x477f('0xb')](_0x477f('0xc'),JSON['stringify'](_0x4f60ca));return rp(_0x4f60ca);}function getCustomFields(_0x3959cc,_0x26ff68){var _0xeba30f={};if(_0x3959cc[_0x477f('0xd')]>0x0){_[_0x477f('0xe')](_0x3959cc,function(_0x25c1a6){if(_['includes']([_0x477f('0xf'),_0x477f('0x10')],_0x25c1a6['type'])&&_0x25c1a6[_0x477f('0x11')]){_0xeba30f[_0x25c1a6['idField']]=_0x25c1a6['content'][_0x477f('0x12')]();}else if(_0x25c1a6[_0x477f('0x13')]===_0x477f('0x14')&&_0x25c1a6[_0x477f('0x15')]&&_0x25c1a6[_0x477f('0x11')]&&_0x26ff68[_0x25c1a6[_0x477f('0x15')]]){_0xeba30f[_0x25c1a6['idField']]=_0x26ff68[_0x25c1a6[_0x477f('0x15')]][_0x477f('0x12')]();}else if(_0x25c1a6['type']===_0x477f('0x16')&&_0x25c1a6[_0x477f('0x17')]&&_0x25c1a6[_0x477f('0x17')]['name']&&_0x25c1a6[_0x477f('0x11')]&&_0x26ff68[_0x25c1a6[_0x477f('0x17')][_0x477f('0x18')][_0x477f('0x19')]()]){_0xeba30f[_0x25c1a6['idField']]=_0x26ff68[_0x25c1a6[_0x477f('0x17')][_0x477f('0x18')][_0x477f('0x19')]()][_0x477f('0x12')]();}});}return _0xeba30f;}function getName(_0x381e63){if(_0x381e63[_0x477f('0x1a')]('\x20')>0x0){var _0x11803e=_0x381e63[_0x477f('0x1b')](/ (.+)/);if(_0x11803e[0x1]){return _0x11803e;}}return[_0x381e63,_0x381e63];}var accountsTokens={};function getAccessToken(_0x2c125e){return new Promise(function(_0x1b5d2d,_0x5d1018){if(!_[_0x477f('0x1c')](accountsTokens[_0x2c125e['id']])&&!_['isNil'](accountsTokens[_0x2c125e['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x2c125e['id']][_0x477f('0x1d')])){_0x1b5d2d(accountsTokens[_0x2c125e['id']][_0x477f('0x1e')]);}}var _0x554d71;switch(_0x2c125e['zone']){case'US':_0x554d71=_0x477f('0x1f');break;case'AU':_0x554d71='https://accounts.zoho.com.au';break;case'EU':_0x554d71=_0x477f('0x20');break;case'IN':_0x554d71=_0x477f('0x21');break;case'CN':_0x554d71=_0x477f('0x22');break;default:_0x554d71='https://accounts.zoho.eu';break;}var _0x3300c0={'method':_0x477f('0x23'),'uri':_0x554d71+_0x477f('0x24'),'qs':{'refresh_token':_0x2c125e[_0x477f('0x25')],'client_id':_0x2c125e[_0x477f('0x26')],'client_secret':_0x2c125e['clientSecret'],'grant_type':_0x477f('0x27')},'json':!![]};return rp(_0x3300c0)['then'](function(_0x59d5f7){accountsTokens[_0x2c125e['id']]={'access_token':_0x59d5f7[_0x477f('0x1e')],'expires_in':moment()['add'](_0x59d5f7['expires_in'],'seconds')};_0x1b5d2d(_0x59d5f7[_0x477f('0x1e')]);})[_0x477f('0x28')](function(_0x101716){logger[_0x477f('0x29')](_0x477f('0x2a'),_0x101716[_0x477f('0x2b')]);_0x5d1018(_0x101716);});});}function getUser(_0x3b9db0,_0x33192c,_0xe460b7,_0x11e4c5){logger[_0x477f('0x2c')](_0x477f('0x2d'));return request({'method':'GET','uri':util[_0x477f('0x2e')](_0x477f('0x2f'),_0x33192c),'qs':{'type':_0x477f('0x30')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3b9db0},'json':!![]})['then'](function(_0x49e115){if(_0x49e115[_0x477f('0x31')]){var _0x23d17c=-0x1;if(_[_0x477f('0x32')](_0x49e115['users'])){if(!_[_0x477f('0x1c')](_0x11e4c5)){_0x23d17c=_['findIndex'](_0x49e115[_0x477f('0x31')],function(_0x4a74af){return _0x4a74af[_0x477f('0x33')]===_0x11e4c5;});}if(_0x23d17c>=0x0){logger[_0x477f('0x2c')](_0x477f('0x34'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x23d17c=_[_0x477f('0x35')](_0x49e115[_0x477f('0x31')],function(_0x1fdbb0){return _0x1fdbb0[_0x477f('0x36')][_0x477f('0x18')]==='Administrator';});}return _0x49e115[_0x477f('0x31')][_0x23d17c];}else{if(_0x49e115[_0x477f('0x37')][_0x477f('0x36')][_0x477f('0x18')]===_0x477f('0x38')){logger[_0x477f('0x2c')](_0x477f('0x39'));user=_0x49e115[_0x477f('0x37')];return user;}else{logger[_0x477f('0x29')](_0x477f('0x3a'),JSON['stringify'](_0x49e115));throw new Error(_0x477f('0x3b')+JSON[_0x477f('0x3c')](_0x49e115));}}}else{logger[_0x477f('0x29')](_0x477f('0x3a'),JSON[_0x477f('0x3c')](_0x49e115));throw new Error(_0x477f('0x3b')+JSON[_0x477f('0x3c')](_0x49e115));}})[_0x477f('0x28')](function(_0x5c886e){console[_0x477f('0x29')](_0x5c886e);});}function getZohoUser(_0x4a2b7f,_0x462a30){return new BPromise(function(_0x11b0ba,_0x340736){request(_0x4a2b7f)['then'](function(_0x13ec77){var _0x51e97b=null;if(_0x13ec77){_0x51e97b=_0x13ec77[_0x477f('0x3d')][0x0];_0x51e97b['enduserType']=_0x462a30;}_0x11b0ba(_0x51e97b);})[_0x477f('0x28')](function(_0x2d839e){_0x340736(_0x2d839e);});});}function createEndUser(_0xef823d,_0x123058,_0x440ecd,_0xd1eb1e,_0x32b3b1,_0x261f93){var _0x440ecd=getName(_0x440ecd);return request({'method':_0x477f('0x23'),'uri':'https://www.zohoapis.'+_0x123058+_0x477f('0x3e')+_[_0x477f('0x3f')](_0x261f93['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x440ecd[0x1],'First_Name':_0x440ecd[0x0],'Phone':_0xd1eb1e,'Owner':{'name':!_[_0x477f('0x1c')](_0x32b3b1[_0x477f('0x40')][_0x477f('0x18')])?_0x32b3b1[_0x477f('0x40')]['name']:!_['isNil'](_0x32b3b1[_0x477f('0x41')])?_0x32b3b1[_0x477f('0x41')]+'\x20'+_0x32b3b1[_0x477f('0x42')]:_0x32b3b1['last_name'],'id':_0x32b3b1['id']}}]},'headers':{'Authorization':_0x477f('0x43')+_0xef823d},'json':!![]})[_0x477f('0x44')](function(_0x55a4a4){if(_0x55a4a4&&_0x55a4a4[_0x477f('0x3d')][0x0]['code']===_0x477f('0x45')){var _0x13be6c=_0x55a4a4[_0x477f('0x3d')][0x0]['details'];_0x13be6c[_0x477f('0x46')]=_[_0x477f('0x3f')](_0x261f93[_0x477f('0x47')])+'s';return _0x13be6c;}logger['error'](_0x477f('0x3a'),JSON[_0x477f('0x3c')](data));throw new Error(_0x477f('0x48')+JSON[_0x477f('0x3c')](data));})['catch'](function(_0x50f9e5){console[_0x477f('0x49')]('CREATE\x20ERROR',_0x50f9e5);});}function getEndUser(_0x14f3d1,_0x278c56,_0x161cd5,_0x450b6f,_0x513b04,_0x362fb9,_0x55d1ed){var _0x1b6988={'method':_0x477f('0x4a'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x14f3d1},'json':!![]};switch(_0x55d1ed[_0x477f('0x4b')]){case'contact_lead':_0x1b6988[_0x477f('0x4c')]=_0x477f('0x4d')+_0x278c56+_0x477f('0x4e')+_0x513b04+'))';return getZohoUser(_0x1b6988,_0x477f('0x4f'))[_0x477f('0x44')](function(_0x3a24cc){if(_0x3a24cc)return _0x3a24cc;_0x1b6988[_0x477f('0x4c')]=_0x477f('0x4d')+_0x278c56+_0x477f('0x50')+_0x513b04+'))';return getZohoUser(_0x1b6988,_0x477f('0x51'))['then'](function(_0x5c30c1){if(_0x5c30c1)return _0x5c30c1;if(_0x55d1ed[_0x477f('0x47')]!=_0x477f('0x52')){return createEndUser(_0x14f3d1,_0x278c56,_0x450b6f,_0x513b04,_0x362fb9,_0x55d1ed);}else{return{};}});});break;case _0x477f('0x53'):_0x1b6988[_0x477f('0x4c')]=_0x477f('0x4d')+_0x278c56+_0x477f('0x4e')+_0x513b04+'))';return getZohoUser(_0x1b6988,'Contacts')[_0x477f('0x44')](function(_0x37249a){if(_0x37249a)return _0x37249a;if(_0x55d1ed[_0x477f('0x47')]!=_0x477f('0x52')){return createEndUser(_0x14f3d1,_0x278c56,_0x450b6f,_0x513b04,_0x362fb9,_0x55d1ed);}else{return{};}});break;case _0x477f('0x54'):_0x1b6988['uri']=_0x477f('0x4d')+_0x278c56+_0x477f('0x50')+_0x513b04+'))';return getZohoUser(_0x1b6988,_0x477f('0x51'))[_0x477f('0x44')](function(_0x43489b){if(_0x43489b)return _0x43489b;if(_0x55d1ed[_0x477f('0x47')]!=_0x477f('0x52')){return createEndUser(_0x14f3d1,_0x278c56,_0x450b6f,_0x513b04,_0x362fb9,_0x55d1ed);}else{return{};}});break;}}function getCall(_0x191100,_0x376e53,_0x375266,_0x4d68f4,_0x30dc40,_0x4bb5cd,_0x4968e3,_0x196fa3){logger['info']('Creating\x20new\x20call...');var _0x21ef73={};_0x21ef73['Owner']={'name':!_[_0x477f('0x1c')](_0x4d68f4[_0x477f('0x40')]['name'])&&!_[_0x477f('0x1c')](_0x4d68f4['profile']['name'])&&_0x4d68f4[_0x477f('0x36')][_0x477f('0x18')]===_0x477f('0x55')?_0x4d68f4[_0x477f('0x40')]['name']:!_[_0x477f('0x1c')](_0x4d68f4[_0x477f('0x41')])?_0x4d68f4[_0x477f('0x41')]+'\x20'+_0x4d68f4[_0x477f('0x42')]:_0x4d68f4[_0x477f('0x42')],'id':_0x4d68f4['id']};_0x21ef73[_0x477f('0x56')]=intUtil['getString'](_0x4bb5cd['Subjects'],_0x4968e3,'\x20');_0x21ef73[_0x477f('0x57')]=intUtil[_0x477f('0x58')](_0x4bb5cd[_0x477f('0x59')],_0x4968e3,'\x0a');if(_0x30dc40[_0x477f('0x46')]===_0x477f('0x4f')){_0x21ef73[_0x477f('0x5a')]={'name':!_[_0x477f('0x1c')](_0x30dc40[_0x477f('0x5b')])?_0x30dc40[_0x477f('0x5b')]:!_[_0x477f('0x1c')](_0x30dc40[_0x477f('0x5c')])?_0x30dc40['First_Name']+'\x20'+_0x30dc40[_0x477f('0x5d')]:_0x30dc40['Last_Name'],'id':_0x30dc40['id']};}if(_0x30dc40[_0x477f('0x46')]===_0x477f('0x51')){_0x21ef73[_0x477f('0x5e')]={'name':!_[_0x477f('0x1c')](_0x30dc40[_0x477f('0x5b')])?_0x30dc40['Full_Name']:!_[_0x477f('0x1c')](_0x30dc40[_0x477f('0x5c')])?_0x30dc40[_0x477f('0x5c')]+'\x20'+_0x30dc40[_0x477f('0x5d')]:_0x30dc40[_0x477f('0x5d')],'id':_0x30dc40['id']};_0x21ef73[_0x477f('0x5f')]=_[_0x477f('0x3f')](_0x30dc40[_0x477f('0x46')]);}if(_0x4968e3[_0x477f('0x60')]){_0x21ef73[_0x477f('0x61')]=moment[_0x477f('0x62')](parseInt(_0x4968e3[_0x477f('0x60')])*0x3e8)[_0x477f('0x2e')](_0x477f('0x63'));}else if(_0x4968e3['answertime']&&_0x4968e3[_0x477f('0x64')]){_0x21ef73['Call_Duration']=moment[_0x477f('0x62')](moment(_0x4968e3[_0x477f('0x64')],'YYYY-MM-DDTHH:mm:ss')[_0x477f('0x65')](moment(_0x4968e3[_0x477f('0x66')],'YYYY-MM-DDTHH:mm:ss')))[_0x477f('0x2e')]('mm:ss');}switch(_0x4968e3[_0x477f('0x67')]){case _0x477f('0x68'):_0x21ef73['Call_Result']=_0x477f('0x69');break;case _0x477f('0x6a'):case'connect':_0x21ef73[_0x477f('0x6b')]=_0x477f('0x6c');break;case _0x477f('0x6d'):_0x21ef73[_0x477f('0x6b')]=_0x477f('0x6e');break;case _0x477f('0x6f'):_0x21ef73[_0x477f('0x6b')]='Abandoned';break;case _0x477f('0x70'):_0x21ef73[_0x477f('0x6b')]='Timeout';default:}_0x21ef73[_0x477f('0x71')]=(_0x196fa3===_0x477f('0x72')?moment(_0x4968e3[_0x477f('0x66')])[_0x477f('0x2e')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x4968e3[_0x477f('0x73')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x477f('0x2e')](_0x477f('0x74'));_0x21ef73[_0x477f('0x75')]=_0x196fa3||_0x477f('0x76');_0x21ef73=_[_0x477f('0x77')](_0x21ef73,getCustomFields(_0x4bb5cd[_0x477f('0x78')],_0x4968e3));return request({'method':'POST','uri':_0x477f('0x4d')+_0x376e53+_0x477f('0x79'),'headers':{'Authorization':_0x477f('0x43')+_0x191100},'body':{'data':[_0x21ef73]},'json':!![]})[_0x477f('0x44')](function(_0x2aeaa6){if(_0x2aeaa6&&_0x2aeaa6[_0x477f('0x3d')][0x0]['code']===_0x477f('0x45')){logger[_0x477f('0x2c')](_0x477f('0x7a'));return{'id':_0x2aeaa6[_0x477f('0x3d')][0x0][_0x477f('0x7b')]['id']};}})[_0x477f('0x28')](function(_0x2b40d6){logger[_0x477f('0x2c')](_0x477f('0x7c'),_0x2b40d6[_0x477f('0x2b')]);console['log'](_0x477f('0x7c'),_0x2b40d6);});}exports[_0x477f('0x7d')]=function(_0x437f8c,_0x411f47,_0x1c6982,_0x303c27,_0x494d1a,_0x43b89e){var _0x30ca2a,_0x144f38,_0x1f53dc;_0x43b89e[_0x477f('0x7e')]=intUtil[_0x477f('0x7f')](_0x43b89e[_0x477f('0x7e')]);_0x43b89e[_0x477f('0x80')]=intUtil[_0x477f('0x7f')](_0x43b89e[_0x477f('0x80')]);if(_0x494d1a&&_0x494d1a[_0x477f('0x81')]){logger[_0x477f('0x2c')](_0x477f('0x82'),_0x477f('0x83'));_0x411f47['recordingURL']=_0x43b89e[_0x477f('0x80')]+'/api/voice/recordings/'+_0x411f47['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x411f47[_0x477f('0x84')]);}else{_0x411f47[_0x477f('0x85')]='';}var _0x171fea=_0x43b89e['host']==='zoho.eu'?'eu':_0x477f('0x86');return getAccessToken(_0x43b89e)['then'](function(_0xfac973){_0x1f53dc=_0xfac973;return getUser(_0x1f53dc,_0x171fea,_0x43b89e,_0x303c27['email']);})[_0x477f('0x44')](function(_0x3693c6){_0x30ca2a=_0x3693c6;logger[_0x477f('0x2c')](_0x477f('0x87'),_0x30ca2a['id']);return getEndUser(_0x1f53dc,_0x171fea,_0x43b89e,_0x411f47[_0x477f('0x88')],_0x411f47[_0x477f('0x89')],_0x30ca2a,_0x1c6982);})[_0x477f('0x44')](function(_0x1267e1){_0x144f38=_0x1267e1;return getCall(_0x1f53dc,_0x171fea,_0x43b89e,_0x30ca2a,_0x144f38,_0x1c6982,_0x411f47,_0x477f('0x76'));})[_0x477f('0x44')](function(_0x1bc054){if(_0x1bc054){logger[_0x477f('0x2c')](_0x477f('0x8a'),_0x1bc054['id']);logger[_0x477f('0x2c')](_0x477f('0x82'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x477f('0x2e')]('user:%s',_0x303c27['name']),_0x477f('0x8b'),{'uri':_0x477f('0x8c')+_0x43b89e[_0x477f('0x7e')]+_0x477f('0x8d')+_0x1bc054['id']});}})['catch'](function(_0x4cd461){logger[_0x477f('0x29')](_0x477f('0x82'),JSON['stringify'](_0x4cd461));});};exports[_0x477f('0x72')]=function(_0x2b2dd3,_0x248112,_0x4f07a5,_0x43d220,_0x3e1824,_0x126f84,_0x50d083){var _0x568ef5,_0x4377be,_0x3d8cb8;_0x126f84[_0x477f('0x7e')]=intUtil[_0x477f('0x7f')](_0x126f84[_0x477f('0x7e')]);_0x126f84[_0x477f('0x80')]=intUtil[_0x477f('0x7f')](_0x126f84[_0x477f('0x80')]);if(_0x50d083&&_0x50d083[_0x477f('0x8e')]&&_0x50d083['recordingFormat']!=='none'){logger['info'](_0x477f('0x8f'),'Recording\x20is\x20enabled!');_0x248112[_0x477f('0x85')]=_0x126f84['serverUrl']+_0x477f('0x90')+_0x248112[_0x477f('0x84')]+_0x477f('0x91')+md5(_0x248112[_0x477f('0x84')]);}var _0x58af95=_0x126f84[_0x477f('0x7e')]===_0x477f('0x92')?'eu':'com';return getAccessToken(_0x126f84)[_0x477f('0x44')](function(_0x40b943){_0x3d8cb8=_0x40b943;return getUser(_0x3d8cb8,_0x58af95,_0x126f84,_0x43d220['email']);})[_0x477f('0x44')](function(_0x3f8a2d){_0x568ef5=_0x3f8a2d;logger[_0x477f('0x2c')]('The\x20User\x20ID\x20is:',_0x568ef5['id']);return getEndUser(_0x3d8cb8,_0x58af95,_0x126f84,_0x248112[_0x477f('0x93')],_0x248112[_0x477f('0x94')],_0x568ef5,_0x4f07a5);})[_0x477f('0x44')](function(_0x339bc6){_0x4377be=_0x339bc6;return getCall(_0x3d8cb8,_0x58af95,_0x126f84,_0x568ef5,_0x4377be,_0x4f07a5,_0x248112,_0x477f('0x95'));})[_0x477f('0x44')](function(_0x1cc98b){if(_0x1cc98b){logger[_0x477f('0x2c')](_0x477f('0x8a'),_0x1cc98b['id']);logger['info'](_0x477f('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x477f('0x2e')](_0x477f('0x96'),_0x43d220[_0x477f('0x18')]),_0x477f('0x8b'),{'uri':_0x477f('0x8c')+_0x126f84['host']+_0x477f('0x8d')+_0x1cc98b['id']});}})['catch'](function(_0x4056b3){logger[_0x477f('0x29')](_0x477f('0x8f'),JSON[_0x477f('0x3c')](_0x4056b3));});};exports[_0x477f('0x97')]=function(_0x1b754d,_0x293712,_0x21b3a0,_0x4319b9,_0x5a2cc7,_0x3f0a31){var _0x4baf96,_0x477246,_0x537fa2;_0x3f0a31[_0x477f('0x7e')]=intUtil['stripTrailingSlash'](_0x3f0a31['host']);_0x3f0a31['serverUrl']=intUtil[_0x477f('0x7f')](_0x3f0a31[_0x477f('0x80')]);if(_0x5a2cc7&&_0x5a2cc7['monitor_format']){logger['info']('['+_0x293712[_0x477f('0x67')][_0x477f('0x98')]()+']','Recording\x20is\x20enabled!');_0x293712[_0x477f('0x85')]=_0x3f0a31['serverUrl']+_0x477f('0x90')+_0x293712['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x293712['uniqueid']);}else{_0x293712[_0x477f('0x85')]='';}var _0x48622f=_0x3f0a31[_0x477f('0x7e')]===_0x477f('0x92')?'eu':_0x477f('0x86');return getAccessToken(_0x3f0a31)[_0x477f('0x44')](function(_0x3a6f4c){_0x537fa2=_0x3a6f4c;return getUser(_0x537fa2,_0x48622f,_0x3f0a31);})[_0x477f('0x44')](function(_0x4db972){_0x4baf96=_0x4db972;logger[_0x477f('0x2c')](_0x477f('0x87'),_0x4baf96['id']);return getEndUser(_0x537fa2,_0x48622f,_0x3f0a31,_0x293712['calleridname'],_0x293712[_0x477f('0x89')],_0x4baf96,_0x21b3a0);})['then'](function(_0x2078ec){_0x477246=_0x2078ec;return getCall(_0x537fa2,_0x48622f,_0x3f0a31,_0x4baf96,_0x477246,_0x21b3a0,_0x293712,_0x477f('0x76'));})['then'](function(_0x1e584c){if(_0x1e584c){logger[_0x477f('0x2c')](_0x477f('0x8a'),_0x1e584c['id']);}})[_0x477f('0x28')](function(_0x1cdf0f){logger[_0x477f('0x29')]('['+_0x293712['lastevent'][_0x477f('0x98')]()+']',JSON['stringify'](_0x1cdf0f));});};
\ No newline at end of file
index e16f22a..76465f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c20=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','exec','data2','data3','render','error','format'];(function(_0x5cd675,_0x352cca){var _0x2379b0=function(_0x2e510b){while(--_0x2e510b){_0x5cd675['push'](_0x5cd675['shift']());}};_0x2379b0(++_0x352cca);}(_0x1c20,0x162));var _0x01c2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1c20[_0x618414];return _0x21c19a;};'use strict';var util=require(_0x01c2('0x0'));var sh=require(_0x01c2('0x1'));var Mustache=require(_0x01c2('0x2'));var logger=require(_0x01c2('0x3'))('trigger');exports[_0x01c2('0x4')]=function(_0xab3bc8,_0x637e9){var _0x105201=_0xab3bc8[_0x01c2('0x5')]?_0xab3bc8[_0x01c2('0x5')]:'Script';var _0x7a558=_0xab3bc8[_0x01c2('0x6')]?Mustache[_0x01c2('0x7')](_0xab3bc8[_0x01c2('0x6')],_0x637e9):_0x637e9;sh[_0x01c2('0x4')](_0x7a558,function(_0x58ee8f,_0x6e5f73,_0x522d36){if(_0x58ee8f!==0x0){logger[_0x01c2('0x8')](util[_0x01c2('0x9')](_0x01c2('0xa'),_0x105201,_0x7a558,_0x58ee8f,_0x522d36));}else{logger[_0x01c2('0xb')](util['format'](_0x01c2('0xc'),_0x105201,_0x7a558,_0x6e5f73));}});};
\ No newline at end of file
+var _0x31ab=['trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x31ab,0xa1));var _0xb31a=function(_0x58e1a0,_0x51b3fe){_0x58e1a0=_0x58e1a0-0x0;var _0x153607=_0x31ab[_0x58e1a0];return _0x153607;};'use strict';var util=require(_0xb31a('0x0'));var sh=require(_0xb31a('0x1'));var Mustache=require(_0xb31a('0x2'));var logger=require(_0xb31a('0x3'))(_0xb31a('0x4'));exports[_0xb31a('0x5')]=function(_0x1ec680,_0x39c9c2){var _0xa6c086=_0x1ec680[_0xb31a('0x6')]?_0x1ec680[_0xb31a('0x6')]:_0xb31a('0x7');var _0x424a3d=_0x1ec680[_0xb31a('0x8')]?Mustache[_0xb31a('0x9')](_0x1ec680[_0xb31a('0x8')],_0x39c9c2):_0x39c9c2;sh['exec'](_0x424a3d,function(_0x3183cd,_0x144eca,_0x3a83e1){if(_0x3183cd!==0x0){logger[_0xb31a('0xa')](util[_0xb31a('0xb')](_0xb31a('0xc'),_0xa6c086,_0x424a3d,_0x3183cd,_0x3a83e1));}else{logger[_0xb31a('0xd')](util[_0xb31a('0xb')](_0xb31a('0xe'),_0xa6c086,_0x424a3d,_0x144eca));}});};
\ No newline at end of file
index 5fb31e6..63edf4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa874=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','stringify','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','data2','data5','data6','parse','render','error','POST','PUT','body','stack'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa874,0x14e));var _0x4a87=function(_0x155a12,_0x46dd6b){_0x155a12=_0x155a12-0x0;var _0x3b64d3=_0xa874[_0x155a12];return _0x3b64d3;};'use strict';var rp=require('request-promise');var util=require(_0x4a87('0x0'));var _=require(_0x4a87('0x1'));var Mustache=require(_0x4a87('0x2'));var logger=require(_0x4a87('0x3'))('trigger');exports[_0x4a87('0x4')]=function(_0x3192c5,_0x2bba3f){var _0x274a93,_0x27decc;var _0x3c624b={'method':_0x3192c5[_0x4a87('0x5')][_0x4a87('0x6')](),'uri':Mustache['render'](_0x3192c5[_0x4a87('0x7')],_0x2bba3f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3192c5[_0x4a87('0x8')])==='number'&&parseInt(_0x3192c5[_0x4a87('0x8')])>=0x1&&parseInt(_0x3192c5[_0x4a87('0x8')])<=0xa?parseInt(_0x3192c5[_0x4a87('0x8')])*0x3e8:0x5*0x3e8};try{_0x3c624b['headers']=_0x3192c5[_0x4a87('0x9')]?JSON[_0x4a87('0xa')](Mustache[_0x4a87('0xb')](_0x3192c5[_0x4a87('0x9')],_0x2bba3f)):{};}catch(_0x9970f3){logger[_0x4a87('0xc')](_0x9970f3['stack']);}switch(_0x3192c5[_0x4a87('0x5')][_0x4a87('0x6')]()){case'GET':case'DELETE':_0x274a93=null;_0x3c624b['qs']=_0x2bba3f;break;case _0x4a87('0xd'):case _0x4a87('0xe'):if(_0x3192c5['data7']){try{_0x274a93=JSON[_0x4a87('0xa')](Mustache[_0x4a87('0xb')](_0x3192c5['data7'],_0x2bba3f));_0x3c624b[_0x4a87('0xf')]=_0x274a93;}catch(_0x157a2e){logger[_0x4a87('0xc')](_0x157a2e[_0x4a87('0x10')]);logger[_0x4a87('0xc')](_0x4a87('0x11'));}}else{_0x274a93=_0x2bba3f;_0x3c624b[_0x4a87('0xf')]=_0x274a93;}break;}logger[_0x4a87('0x12')](util[_0x4a87('0x13')](_0x4a87('0x14'),_0x3192c5[_0x4a87('0x5')],_0x3192c5['data2'],JSON['stringify'](_0x3c624b)));rp(_0x3c624b)[_0x4a87('0x15')](function(_0x535ac2){_0x274a93=!_['isNil'](_0x274a93)?_0x4a87('0x16')+_0x274a93:'';_0x27decc=typeof _0x535ac2[_0x4a87('0xf')]==='object'?JSON[_0x4a87('0x17')](_0x535ac2['body']):_0x535ac2[_0x4a87('0xf')];logger['info'](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3192c5[_0x4a87('0x5')],_0x3192c5[_0x4a87('0x7')],_0x535ac2[_0x4a87('0x18')],_0x27decc));})['catch'](function(_0x628a25){logger[_0x4a87('0xc')](util[_0x4a87('0x13')](_0x4a87('0x19'),_0x3192c5['data1'],_0x3192c5[_0x4a87('0x7')],_0x628a25[_0x4a87('0x18')],_0x628a25['name'],_0x628a25[_0x4a87('0x1a')]));});};
\ No newline at end of file
+var _0xe357=['data5','number','data6','parse','error','data1','GET','DELETE','POST','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','util','mustache','../../../../config/logger','exec','toUpperCase','render'];(function(_0x1923ca,_0xc2cfda){var _0x4490e4=function(_0x84602f){while(--_0x84602f){_0x1923ca['push'](_0x1923ca['shift']());}};_0x4490e4(++_0xc2cfda);}(_0xe357,0xa4));var _0x7e35=function(_0x1dc2bf,_0x1546c1){_0x1dc2bf=_0x1dc2bf-0x0;var _0x3925bf=_0xe357[_0x1dc2bf];return _0x3925bf;};'use strict';var rp=require('request-promise');var util=require(_0x7e35('0x0'));var _=require('lodash');var Mustache=require(_0x7e35('0x1'));var logger=require(_0x7e35('0x2'))('trigger');exports[_0x7e35('0x3')]=function(_0x4f2970,_0x29e428){var _0x51aee9,_0x9d1aed;var _0x2efa82={'method':_0x4f2970['data1'][_0x7e35('0x4')](),'uri':Mustache[_0x7e35('0x5')](_0x4f2970['data2'],_0x29e428),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4f2970[_0x7e35('0x6')])===_0x7e35('0x7')&&parseInt(_0x4f2970[_0x7e35('0x6')])>=0x1&&parseInt(_0x4f2970[_0x7e35('0x6')])<=0xa?parseInt(_0x4f2970[_0x7e35('0x6')])*0x3e8:0x5*0x3e8};try{_0x2efa82['headers']=_0x4f2970[_0x7e35('0x8')]?JSON[_0x7e35('0x9')](Mustache[_0x7e35('0x5')](_0x4f2970[_0x7e35('0x8')],_0x29e428)):{};}catch(_0x22d7a2){logger[_0x7e35('0xa')](_0x22d7a2['stack']);}switch(_0x4f2970[_0x7e35('0xb')]['toUpperCase']()){case _0x7e35('0xc'):case _0x7e35('0xd'):_0x51aee9=null;_0x2efa82['qs']=_0x29e428;break;case _0x7e35('0xe'):case _0x7e35('0xf'):if(_0x4f2970[_0x7e35('0x10')]){try{_0x51aee9=JSON[_0x7e35('0x9')](Mustache[_0x7e35('0x5')](_0x4f2970[_0x7e35('0x10')],_0x29e428));_0x2efa82[_0x7e35('0x11')]=_0x51aee9;}catch(_0x5b9c33){logger[_0x7e35('0xa')](_0x5b9c33[_0x7e35('0x12')]);logger[_0x7e35('0xa')](_0x7e35('0x13'));}}else{_0x51aee9=_0x29e428;_0x2efa82['body']=_0x51aee9;}break;}logger[_0x7e35('0x14')](util[_0x7e35('0x15')](_0x7e35('0x16'),_0x4f2970[_0x7e35('0xb')],_0x4f2970[_0x7e35('0x17')],JSON[_0x7e35('0x18')](_0x2efa82)));rp(_0x2efa82)[_0x7e35('0x19')](function(_0x2371a2){_0x51aee9=!_[_0x7e35('0x1a')](_0x51aee9)?_0x7e35('0x1b')+_0x51aee9:'';_0x9d1aed=typeof _0x2371a2[_0x7e35('0x11')]==='object'?JSON[_0x7e35('0x18')](_0x2371a2[_0x7e35('0x11')]):_0x2371a2[_0x7e35('0x11')];logger[_0x7e35('0x14')](util['format'](_0x7e35('0x1c'),_0x4f2970[_0x7e35('0xb')],_0x4f2970[_0x7e35('0x17')],_0x2371a2['statusCode'],_0x9d1aed));})[_0x7e35('0x1d')](function(_0x356dff){logger[_0x7e35('0xa')](util['format'](_0x7e35('0x1e'),_0x4f2970['data1'],_0x4f2970[_0x7e35('0x17')],_0x356dff[_0x7e35('0x1f')],_0x356dff[_0x7e35('0x20')],_0x356dff[_0x7e35('0x21')]));});};
\ No newline at end of file
index f3ce55c..52dc692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d3b=['exports','jayson/promise','routing','client','request','debug','rpc','error','message','result','catch'];(function(_0x34f7e2,_0x399b03){var _0x1f5e12=function(_0x129095){while(--_0x129095){_0x34f7e2['push'](_0x34f7e2['shift']());}};_0x1f5e12(++_0x399b03);}(_0x8d3b,0x140));var _0xb8d3=function(_0x3d38eb,_0x3a0c58){_0x3d38eb=_0x3d38eb-0x0;var _0xf3f3bc=_0x8d3b[_0x3d38eb];return _0xf3f3bc;};'use strict';var jayson=require(_0xb8d3('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xb8d3('0x1'));var client=jayson[_0xb8d3('0x2')]['http']({'port':0x2329});client['Request']=function(_0x217d88,_0x71eb65){return new BPromise(function(_0x4c814a,_0x14c8fb){return client[_0xb8d3('0x3')](_0x217d88,_0x71eb65)['then'](function(_0xa08ef8){logger[_0xb8d3('0x4')](_0xb8d3('0x5'),_0xb8d3('0x1'),_0x217d88,_0x71eb65,_0xa08ef8);if(_0xa08ef8[_0xb8d3('0x6')]){logger[_0xb8d3('0x6')](_0xb8d3('0x5'),_0xb8d3('0x1'),_0x217d88,_0xa08ef8[_0xb8d3('0x6')]['message'],_0x71eb65);return _0x14c8fb(_0xa08ef8[_0xb8d3('0x6')][_0xb8d3('0x7')]);}else{return _0x4c814a(_0xa08ef8[_0xb8d3('0x8')]);}})[_0xb8d3('0x9')](function(_0x59b88b){logger[_0xb8d3('0x6')](_0xb8d3('0x5'),_0xb8d3('0x1'),_0x217d88,_0x59b88b,_0x71eb65);return _0x14c8fb(_0x59b88b);});});};module[_0xb8d3('0xa')]=client;
\ No newline at end of file
+var _0xdbd9=['result','catch','exports','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message'];(function(_0x466cdd,_0x473c1f){var _0x3781fc=function(_0x4a2466){while(--_0x4a2466){_0x466cdd['push'](_0x466cdd['shift']());}};_0x3781fc(++_0x473c1f);}(_0xdbd9,0x9d));var _0x9dbd=function(_0x1a994c,_0x4e5878){_0x1a994c=_0x1a994c-0x0;var _0x3bff53=_0xdbd9[_0x1a994c];return _0x3bff53;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x9dbd('0x0'))(_0x9dbd('0x1'));var client=jayson[_0x9dbd('0x2')][_0x9dbd('0x3')]({'port':0x2329});client[_0x9dbd('0x4')]=function(_0x1a9a64,_0x1aa926){return new BPromise(function(_0xd60a05,_0xb64230){return client[_0x9dbd('0x5')](_0x1a9a64,_0x1aa926)[_0x9dbd('0x6')](function(_0x1ed6f8){logger[_0x9dbd('0x7')](_0x9dbd('0x8'),_0x9dbd('0x1'),_0x1a9a64,_0x1aa926,_0x1ed6f8);if(_0x1ed6f8[_0x9dbd('0x9')]){logger[_0x9dbd('0x9')](_0x9dbd('0x8'),'routing',_0x1a9a64,_0x1ed6f8[_0x9dbd('0x9')][_0x9dbd('0xa')],_0x1aa926);return _0xb64230(_0x1ed6f8['error']['message']);}else{return _0xd60a05(_0x1ed6f8[_0x9dbd('0xb')]);}})[_0x9dbd('0xc')](function(_0x2ac62e){logger[_0x9dbd('0x9')]('rpc',_0x9dbd('0x1'),_0x1a9a64,_0x2ac62e,_0x1aa926);return _0xb64230(_0x2ac62e);});});};module[_0x9dbd('0xd')]=client;
\ No newline at end of file
index 4939f01..c756792 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6606=['loginMailFrequency','catch','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','refresh','mailAccounts','listen'];(function(_0x3cb371,_0x15d281){var _0x241de7=function(_0x3bb8bd){while(--_0x3bb8bd){_0x3cb371['push'](_0x3cb371['shift']());}};_0x241de7(++_0x15d281);}(_0x6606,0x6a));var _0x6660=function(_0x281163,_0x11102f){_0x281163=_0x281163-0x0;var _0x33f619=_0x6606[_0x281163];return _0x33f619;};'use strict';var BPromise=require(_0x6660('0x0'));var server=require(_0x6660('0x1'));var Realtime=require(_0x6660('0x2'));var EmailChannel=require(_0x6660('0x3'));var mailAccount=require(_0x6660('0x4'));var setting=require(_0x6660('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x6660('0x6')]()['then'](mailAccount['getMailAccounts']())[_0x6660('0x7')](realtime['initMailAccounts']())[_0x6660('0x7')](function(){email[_0x6660('0x8')](realtime[_0x6660('0x9')]);return realtime;});}function main(){return server[_0x6660('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0x6660('0x7')](function(){return setting['getSettings']();})['then'](function(_0x139352){return setInterval(initRealtime,_0x139352[_0x6660('0xb')]*0x3e8);})[_0x6660('0xc')](function(_0x44224f){console['log'](_0x44224f);});}main();
\ No newline at end of file
+var _0x2d20=['listen','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x4a0aad,_0x38ddde){var _0x306f23=function(_0x371ebb){while(--_0x371ebb){_0x4a0aad['push'](_0x4a0aad['shift']());}};_0x306f23(++_0x38ddde);}(_0x2d20,0x1d1));var _0x02d2=function(_0x3be603,_0x5f139c){_0x3be603=_0x3be603-0x0;var _0x221620=_0x2d20[_0x3be603];return _0x221620;};'use strict';var BPromise=require(_0x02d2('0x0'));var server=require(_0x02d2('0x1'));var Realtime=require(_0x02d2('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x02d2('0x3'));var setting=require(_0x02d2('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x02d2('0x5')]()[_0x02d2('0x6')](mailAccount[_0x02d2('0x7')]())[_0x02d2('0x6')](realtime[_0x02d2('0x8')]())[_0x02d2('0x6')](function(){email[_0x02d2('0x9')](realtime[_0x02d2('0xa')]);return realtime;});}function main(){return server[_0x02d2('0xb')](realtime,email)[_0x02d2('0x6')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0x02d2('0x6')](function(_0x5ed211){return setInterval(initRealtime,_0x5ed211['loginMailFrequency']*0x3e8);})[_0x02d2('0xc')](function(_0x3ff720){console[_0x02d2('0xd')](_0x3ff720);});}main();
\ No newline at end of file
index 12eb25b..51731f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7056=['from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','status','Imap','total','isNil','hasOwnProperty','email','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName'];(function(_0x2f3a73,_0x105db8){var _0x243a63=function(_0x4c5494){while(--_0x4c5494){_0x2f3a73['push'](_0x2f3a73['shift']());}};_0x243a63(++_0x105db8);}(_0x7056,0x78));var _0x6705=function(_0x12fc10,_0xbd9551){_0x12fc10=_0x12fc10-0x0;var _0x2e0ba8=_0x7056[_0x12fc10];return _0x2e0ba8;};'use strict';var _=require(_0x6705('0x0'));var moment=require(_0x6705('0x1'));var BPromise=require(_0x6705('0x2'));var md5=require(_0x6705('0x3'));var Redis=require('ioredis');var config=require(_0x6705('0x4'));var logger=require(_0x6705('0x5'))('email');config[_0x6705('0x6')]=_[_0x6705('0x7')](config[_0x6705('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6705('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x6705('0x9'));var EmailSmtp=require(_0x6705('0xa'));var mailAccount=require(_0x6705('0xb'));var md5Accounts={};function EmailChannel(_0x32ed01){logger[_0x6705('0xc')](_0x6705('0xd'));this[_0x6705('0xe')]=_0x32ed01['mailAccounts'];this[_0x6705('0xf')]={};this[_0x6705('0x10')]=new EmailSmtp();}EmailChannel[_0x6705('0x11')][_0x6705('0x12')]=function(_0x29e2d9){var _0x1cd731=this[_0x6705('0xe')][_0x29e2d9];var _0x27ce4e={'id':_0x1cd731['id'],'name':_0x1cd731['name'],'key':_0x1cd731[_0x6705('0x13')],'active':_0x1cd731[_0x6705('0x14')],'Imap':{'status':_0x1cd731['Imap'][_0x6705('0x15')],'messageStatus':_0x1cd731[_0x6705('0x16')]['messageStatus'],'total':_0x1cd731[_0x6705('0x16')][_0x6705('0x17')]}};if(_[_0x6705('0x18')](md5Accounts[_0x29e2d9])){md5Accounts[_0x29e2d9]={};}var _0x4c1552=md5(JSON['stringify'](_0x27ce4e));if(md5Accounts[_0x29e2d9]['md5']!==_0x4c1552){md5Accounts[_0x29e2d9][_0x6705('0x3')]=_0x4c1552;io['emit']('mailAccount:update',_0x27ce4e);}};EmailChannel[_0x6705('0x11')]['refresh']=function(_0x4342fb){for(var _0x11730d in _0x4342fb){if(_0x4342fb[_0x6705('0x19')](_0x11730d)){if(_0x4342fb[_0x11730d][_0x6705('0x16')]&&_0x4342fb[_0x11730d]['active']){var _0x3a8ef8=_0x4342fb[_0x11730d]['Imap'];if(!this['imapAccounts']['hasOwnProperty'](_0x3a8ef8['id'])){this['imapAccounts'][_0x3a8ef8['id']]=new EmailImap(_0x3a8ef8,_0x4342fb[_0x11730d][_0x6705('0x1a')]);this[_0x6705('0xf')][_0x3a8ef8['id']]['on']('box',this['handleImapBox'][_0x6705('0x1b')](this,_0x11730d));this['imapAccounts'][_0x3a8ef8['id']]['on'](_0x6705('0x1a'),this[_0x6705('0x1c')][_0x6705('0x1b')](this,_0x11730d));this[_0x6705('0xf')][_0x3a8ef8['id']]['on'](_0x6705('0x1d'),this[_0x6705('0x1e')][_0x6705('0x1b')](this,_0x11730d));this[_0x6705('0xf')][_0x3a8ef8['id']]['on'](_0x6705('0x1f'),this[_0x6705('0x20')][_0x6705('0x1b')](this,_0x11730d));}}else{if(_['isNil'](this[_0x6705('0xe')][_0x11730d][_0x6705('0x16')])){this[_0x6705('0xe')][_0x11730d][_0x6705('0x16')]={};}this[_0x6705('0xe')][_0x11730d][_0x6705('0x16')][_0x6705('0x15')]=_0x6705('0x21');this['mailAccounts'][_0x11730d]['Imap'][_0x6705('0x22')]='';this[_0x6705('0x12')](_0x11730d);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x2319b3,_0x169ae2){if(this[_0x6705('0xe')][_0x2319b3]){this[_0x6705('0xe')][_0x2319b3][_0x6705('0x16')][_0x6705('0x15')]=_0x6705('0x23');this[_0x6705('0xe')][_0x2319b3][_0x6705('0x16')][_0x6705('0x22')]=_0x169ae2['name'];if(_0x169ae2[_0x6705('0x24')]){this[_0x6705('0xe')][_0x2319b3][_0x6705('0x16')][_0x6705('0x17')]=_0x169ae2[_0x6705('0x24')][_0x6705('0x17')];}return this[_0x6705('0x12')](_0x2319b3);}};EmailChannel[_0x6705('0x11')][_0x6705('0x1c')]=function(_0x3e1947,_0x42b53b){logger[_0x6705('0xc')](_0x6705('0x25'),_0x42b53b[_0x6705('0x26')],_0x42b53b['lastName'],_0x42b53b[_0x6705('0x27')],_0x3e1947);if(this[_0x6705('0xe')][_0x3e1947]){return mailAccount[_0x6705('0x28')](_0x3e1947,_0x42b53b)[_0x6705('0x29')](function(_0x1b7db2){if(_0x1b7db2){logger[_0x6705('0xc')](_0x6705('0x2a'));}})[_0x6705('0x2b')](function(_0x244f56){logger['error'](_0x6705('0x2c'),JSON[_0x6705('0x2d')](_0x244f56));});}};EmailChannel[_0x6705('0x11')][_0x6705('0x1e')]=function(_0x336544){if(this[_0x6705('0xe')][_0x336544]&&this[_0x6705('0xe')][_0x336544]['Imap']){if(this[_0x6705('0xf')][this[_0x6705('0xe')][_0x336544][_0x6705('0x16')]['id']]){delete this[_0x6705('0xf')][this[_0x6705('0xe')][_0x336544]['Imap']['id']];}this[_0x6705('0xe')][_0x336544]['Imap'][_0x6705('0x2e')]=moment();this['emit'](_0x336544);}};EmailChannel[_0x6705('0x11')][_0x6705('0x20')]=function(_0x3252e2,_0x33436b){if(this[_0x6705('0xe')][_0x3252e2]){this[_0x6705('0xe')][_0x3252e2][_0x6705('0x16')][_0x6705('0x15')]=_0x6705('0x1f');this['mailAccounts'][_0x3252e2][_0x6705('0x16')][_0x6705('0x22')]=_0x33436b;return this['emit'](_0x3252e2);}};EmailChannel[_0x6705('0x11')][_0x6705('0x2f')]=function(_0x2aaf8f,_0x573ab3){return this[_0x6705('0x10')][_0x6705('0x30')](_0x2aaf8f,_0x573ab3);};EmailChannel[_0x6705('0x11')]['verifySmtp']=function(_0x266676){var _0x37154c=this;if(this[_0x6705('0xe')][_0x266676['id']]){if(_[_0x6705('0x18')](this[_0x6705('0xe')][_0x266676['id']][_0x6705('0x31')])){this['mailAccounts'][_0x266676['id']]['Smtp']={};}this[_0x6705('0xe')][_0x266676['id']][_0x6705('0x31')][_0x6705('0x2e')]=moment();return new BPromise(function(_0x3b3426,_0x9843a6){return _0x37154c[_0x6705('0x10')][_0x6705('0x32')](_0x266676)[_0x6705('0x29')](function(_0x1908c7){_0x37154c[_0x6705('0xe')][_0x266676['id']][_0x6705('0x31')]['status']=_0x6705('0x33');_0x37154c[_0x6705('0xe')][_0x266676['id']]['Smtp'][_0x6705('0x22')]='';_0x37154c[_0x6705('0x12')](_0x266676['id']);_0x3b3426(_0x1908c7);})['catch'](function(_0x10c290){_0x37154c[_0x6705('0xe')][_0x266676['id']][_0x6705('0x31')][_0x6705('0x15')]=_0x6705('0x1f');_0x37154c[_0x6705('0xe')][_0x266676['id']][_0x6705('0x31')][_0x6705('0x22')]=_0x10c290;_0x37154c[_0x6705('0x12')](_0x266676['id']);_0x9843a6(_0x10c290);});});}return this[_0x6705('0x10')][_0x6705('0x32')](_0x266676);};module[_0x6705('0x34')]=EmailChannel;
\ No newline at end of file
+var _0x9bcc=['../rpc/mailAccount','start\x20email\x20channel','imapAccounts','smtp','prototype','emit','mailAccounts','name','active','Imap','total','isNil','md5','mailAccount:update','hasOwnProperty','box','bind','handleImapEnd','error','handleImapError','status','disabled','messageStatus','connected','messages','handleImapEmail','info','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','../../../config/environment','email','defaults','redis','localhost','./imap','./smtp'];(function(_0x1ccab1,_0x5717cd){var _0x29425b=function(_0x3896c8){while(--_0x3896c8){_0x1ccab1['push'](_0x1ccab1['shift']());}};_0x29425b(++_0x5717cd);}(_0x9bcc,0x129));var _0xc9bc=function(_0xa36f6d,_0x22b778){_0xa36f6d=_0xa36f6d-0x0;var _0x156cd4=_0x9bcc[_0xa36f6d];return _0x156cd4;};'use strict';var _=require(_0xc9bc('0x0'));var moment=require(_0xc9bc('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0xc9bc('0x2'));var logger=require('../../../config/logger')(_0xc9bc('0x3'));config['redis']=_[_0xc9bc('0x4')](config[_0xc9bc('0x5')],{'host':_0xc9bc('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc9bc('0x5')]));var EmailImap=require(_0xc9bc('0x7'));var EmailSmtp=require(_0xc9bc('0x8'));var mailAccount=require(_0xc9bc('0x9'));var md5Accounts={};function EmailChannel(_0x56bff9){logger['info'](_0xc9bc('0xa'));this['mailAccounts']=_0x56bff9['mailAccounts'];this[_0xc9bc('0xb')]={};this[_0xc9bc('0xc')]=new EmailSmtp();}EmailChannel[_0xc9bc('0xd')][_0xc9bc('0xe')]=function(_0x4ad68c){var _0x4e31e0=this[_0xc9bc('0xf')][_0x4ad68c];var _0x15f8fa={'id':_0x4e31e0['id'],'name':_0x4e31e0[_0xc9bc('0x10')],'key':_0x4e31e0['key'],'active':_0x4e31e0[_0xc9bc('0x11')],'Imap':{'status':_0x4e31e0[_0xc9bc('0x12')]['status'],'messageStatus':_0x4e31e0[_0xc9bc('0x12')]['messageStatus'],'total':_0x4e31e0[_0xc9bc('0x12')][_0xc9bc('0x13')]}};if(_[_0xc9bc('0x14')](md5Accounts[_0x4ad68c])){md5Accounts[_0x4ad68c]={};}var _0x5aaff2=md5(JSON['stringify'](_0x15f8fa));if(md5Accounts[_0x4ad68c][_0xc9bc('0x15')]!==_0x5aaff2){md5Accounts[_0x4ad68c][_0xc9bc('0x15')]=_0x5aaff2;io[_0xc9bc('0xe')](_0xc9bc('0x16'),_0x15f8fa);}};EmailChannel[_0xc9bc('0xd')]['refresh']=function(_0xd8aa7c){for(var _0x1bc05a in _0xd8aa7c){if(_0xd8aa7c[_0xc9bc('0x17')](_0x1bc05a)){if(_0xd8aa7c[_0x1bc05a]['Imap']&&_0xd8aa7c[_0x1bc05a][_0xc9bc('0x11')]){var _0x3d0a74=_0xd8aa7c[_0x1bc05a]['Imap'];if(!this[_0xc9bc('0xb')][_0xc9bc('0x17')](_0x3d0a74['id'])){this[_0xc9bc('0xb')][_0x3d0a74['id']]=new EmailImap(_0x3d0a74,_0xd8aa7c[_0x1bc05a][_0xc9bc('0x3')]);this['imapAccounts'][_0x3d0a74['id']]['on'](_0xc9bc('0x18'),this['handleImapBox']['bind'](this,_0x1bc05a));this['imapAccounts'][_0x3d0a74['id']]['on'](_0xc9bc('0x3'),this['handleImapEmail'][_0xc9bc('0x19')](this,_0x1bc05a));this[_0xc9bc('0xb')][_0x3d0a74['id']]['on']('end',this[_0xc9bc('0x1a')][_0xc9bc('0x19')](this,_0x1bc05a));this[_0xc9bc('0xb')][_0x3d0a74['id']]['on'](_0xc9bc('0x1b'),this[_0xc9bc('0x1c')][_0xc9bc('0x19')](this,_0x1bc05a));}}else{if(_[_0xc9bc('0x14')](this[_0xc9bc('0xf')][_0x1bc05a]['Imap'])){this[_0xc9bc('0xf')][_0x1bc05a]['Imap']={};}this[_0xc9bc('0xf')][_0x1bc05a][_0xc9bc('0x12')][_0xc9bc('0x1d')]=_0xc9bc('0x1e');this['mailAccounts'][_0x1bc05a][_0xc9bc('0x12')][_0xc9bc('0x1f')]='';this[_0xc9bc('0xe')](_0x1bc05a);}}}};EmailChannel[_0xc9bc('0xd')]['handleImapBox']=function(_0x4c4b88,_0x1b67dd){if(this[_0xc9bc('0xf')][_0x4c4b88]){this[_0xc9bc('0xf')][_0x4c4b88][_0xc9bc('0x12')][_0xc9bc('0x1d')]=_0xc9bc('0x20');this[_0xc9bc('0xf')][_0x4c4b88]['Imap']['messageStatus']=_0x1b67dd['name'];if(_0x1b67dd[_0xc9bc('0x21')]){this[_0xc9bc('0xf')][_0x4c4b88][_0xc9bc('0x12')][_0xc9bc('0x13')]=_0x1b67dd['messages'][_0xc9bc('0x13')];}return this[_0xc9bc('0xe')](_0x4c4b88);}};EmailChannel['prototype'][_0xc9bc('0x22')]=function(_0x23a826,_0x199f40){logger[_0xc9bc('0x23')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x199f40[_0xc9bc('0x24')],_0x199f40['lastName'],_0x199f40[_0xc9bc('0x25')],_0x23a826);if(this[_0xc9bc('0xf')][_0x23a826]){return mailAccount[_0xc9bc('0x26')](_0x23a826,_0x199f40)[_0xc9bc('0x27')](function(_0x512900){if(_0x512900){logger[_0xc9bc('0x23')](_0xc9bc('0x28'));}})[_0xc9bc('0x29')](function(_0xac0c96){logger[_0xc9bc('0x1b')](_0xc9bc('0x2a'),JSON[_0xc9bc('0x2b')](_0xac0c96));});}};EmailChannel[_0xc9bc('0xd')][_0xc9bc('0x1a')]=function(_0x298495){if(this[_0xc9bc('0xf')][_0x298495]&&this[_0xc9bc('0xf')][_0x298495][_0xc9bc('0x12')]){if(this[_0xc9bc('0xb')][this[_0xc9bc('0xf')][_0x298495]['Imap']['id']]){delete this['imapAccounts'][this[_0xc9bc('0xf')][_0x298495]['Imap']['id']];}this[_0xc9bc('0xf')][_0x298495][_0xc9bc('0x12')][_0xc9bc('0x2c')]=moment();this[_0xc9bc('0xe')](_0x298495);}};EmailChannel[_0xc9bc('0xd')][_0xc9bc('0x1c')]=function(_0x5d28d8,_0x3621e1){if(this[_0xc9bc('0xf')][_0x5d28d8]){this['mailAccounts'][_0x5d28d8][_0xc9bc('0x12')][_0xc9bc('0x1d')]=_0xc9bc('0x1b');this[_0xc9bc('0xf')][_0x5d28d8][_0xc9bc('0x12')][_0xc9bc('0x1f')]=_0x3621e1;return this[_0xc9bc('0xe')](_0x5d28d8);}};EmailChannel[_0xc9bc('0xd')][_0xc9bc('0x2d')]=function(_0x536268,_0x125a26){return this[_0xc9bc('0xc')]['send'](_0x536268,_0x125a26);};EmailChannel[_0xc9bc('0xd')][_0xc9bc('0x2e')]=function(_0x3efd67){var _0x3c2917=this;if(this['mailAccounts'][_0x3efd67['id']]){if(_['isNil'](this[_0xc9bc('0xf')][_0x3efd67['id']][_0xc9bc('0x2f')])){this['mailAccounts'][_0x3efd67['id']][_0xc9bc('0x2f')]={};}this[_0xc9bc('0xf')][_0x3efd67['id']]['Smtp'][_0xc9bc('0x2c')]=moment();return new BPromise(function(_0xbcdd15,_0x42dd6f){return _0x3c2917['smtp'][_0xc9bc('0x30')](_0x3efd67)[_0xc9bc('0x27')](function(_0x25fa0e){_0x3c2917['mailAccounts'][_0x3efd67['id']][_0xc9bc('0x2f')]['status']=_0xc9bc('0x31');_0x3c2917[_0xc9bc('0xf')][_0x3efd67['id']][_0xc9bc('0x2f')]['messageStatus']='';_0x3c2917['emit'](_0x3efd67['id']);_0xbcdd15(_0x25fa0e);})[_0xc9bc('0x29')](function(_0x321094){_0x3c2917['mailAccounts'][_0x3efd67['id']]['Smtp'][_0xc9bc('0x1d')]='error';_0x3c2917[_0xc9bc('0xf')][_0x3efd67['id']][_0xc9bc('0x2f')][_0xc9bc('0x1f')]=_0x321094;_0x3c2917['emit'](_0x3efd67['id']);_0x42dd6f(_0x321094);});});}return this[_0xc9bc('0xc')][_0xc9bc('0x30')](_0x3efd67);};module[_0xc9bc('0x32')]=EmailChannel;
\ No newline at end of file
index 665151a..b6a0afa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe373=['isNil','service','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','mailbox','handleOpenBox','prototype','emit','box','handleCloseBox','handleError','end','search','UNSEEN','handleReadUnseen','fetch','message','error','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','account','getAccount','once','handleReady','bind','handleEnd','connect','inherits','connTimeout','authTimeout'];(function(_0x46c8fb,_0x253501){var _0x48f9eb=function(_0x5d5b03){while(--_0x5d5b03){_0x46c8fb['push'](_0x46c8fb['shift']());}};_0x48f9eb(++_0x253501);}(_0xe373,0x11c));var _0x3e37=function(_0x3815f1,_0xbf8c34){_0x3815f1=_0x3815f1-0x0;var _0x1043d8=_0xe373[_0x3815f1];return _0x1043d8;};'use strict';var fs=require('fs');var path=require(_0x3e37('0x0'));var util=require(_0x3e37('0x1'));var Imap=require(_0x3e37('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x3e37('0x3'))['simpleParser'];var Iconv=require(_0x3e37('0x4'))[_0x3e37('0x5')];var EventEmitter=require(_0x3e37('0x6'))[_0x3e37('0x7')];var utils=require(_0x3e37('0x8'));var logger=require(_0x3e37('0x9'))(_0x3e37('0xa'));function EmailImap(_0x42d6e3,_0x2e8fc8){this['mailbox']='INBOX';this[_0x3e37('0xb')]=this[_0x3e37('0xc')](_0x42d6e3,_0x2e8fc8);this['imap']=new Imap(this[_0x3e37('0xb')]);this[_0x3e37('0x2')][_0x3e37('0xd')]('ready',this[_0x3e37('0xe')][_0x3e37('0xf')](this));this['imap'][_0x3e37('0xd')]('end',this[_0x3e37('0x10')][_0x3e37('0xf')](this));this[_0x3e37('0x2')]['on']('error',this['handleError']['bind'](this));this[_0x3e37('0x2')][_0x3e37('0x11')]();}util[_0x3e37('0x12')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x2bb03e,_0x1d6fce){var _0x35c72a={'connTimeout':_0x2bb03e['connTimeout']?_0x2bb03e[_0x3e37('0x13')]*0x3e8:0x2710,'authTimeout':_0x2bb03e[_0x3e37('0x14')]?_0x2bb03e[_0x3e37('0x14')]*0x3e8:0x1388};if(_[_0x3e37('0x15')](_0x2bb03e[_0x3e37('0x16')])){if(_0x2bb03e['authentication']){_0x35c72a['user']=_0x2bb03e[_0x3e37('0x17')];_0x35c72a[_0x3e37('0x18')]=_0x2bb03e[_0x3e37('0x18')];}_0x35c72a[_0x3e37('0x19')]=_0x2bb03e[_0x3e37('0x19')];_0x35c72a[_0x3e37('0x1a')]=_0x2bb03e[_0x3e37('0x1a')]||0x3e1;if(_0x2bb03e[_0x3e37('0x1b')]){_0x35c72a[_0x3e37('0x1b')]=!![];}else{_0x35c72a['tls']=![];_0x35c72a[_0x3e37('0x1c')]=_0x3e37('0x1d');}}else{_0x35c72a['user']=_0x2bb03e['user'];_0x35c72a[_0x3e37('0x18')]=_0x2bb03e[_0x3e37('0x18')];_0x35c72a[_0x3e37('0x19')]=utils[_0x3e37('0x1e')](_0x2bb03e[_0x3e37('0x16')]);_0x35c72a['port']=0x3e1;_0x35c72a[_0x3e37('0x1b')]=!![];}_0x35c72a[_0x3e37('0xa')]=_0x1d6fce||_0x2bb03e[_0x3e37('0x17')]||_0x3e37('0x1f');return _0x35c72a;};EmailImap['prototype'][_0x3e37('0xe')]=function(){this[_0x3e37('0x2')][_0x3e37('0x20')](this[_0x3e37('0x21')],![],this[_0x3e37('0x22')]['bind'](this));};EmailImap[_0x3e37('0x23')][_0x3e37('0x22')]=function(_0x28b185,_0x1d9689){if(_0x28b185){this['handleError'](_0x28b185,!![]);}else{this[_0x3e37('0x24')](_0x3e37('0x25'),_0x1d9689);this['readUnseen']();}};EmailImap[_0x3e37('0x23')][_0x3e37('0x26')]=function(_0x277b7a){if(_0x277b7a){this[_0x3e37('0x27')](_0x277b7a,!![]);}else{this[_0x3e37('0x2')][_0x3e37('0x28')]();}};EmailImap[_0x3e37('0x23')]['readUnseen']=function(){this['imap'][_0x3e37('0x29')]([_0x3e37('0x2a')],this[_0x3e37('0x2b')][_0x3e37('0xf')](this));};EmailImap[_0x3e37('0x23')][_0x3e37('0x2b')]=function(_0x12b7b5,_0x5afe92){if(_0x12b7b5){this[_0x3e37('0x27')](_0x12b7b5,!![]);}else{if(_0x5afe92['length']){try{var _0xd6643b=this[_0x3e37('0x2')][_0x3e37('0x2c')](_0x5afe92,{'bodies':'','markSeen':!![]});_0xd6643b['on'](_0x3e37('0x2d'),this['handleFetchMessage'][_0x3e37('0xf')](this));_0xd6643b['once'](_0x3e37('0x2e'),this['handleFetchError'][_0x3e37('0xf')](this));_0xd6643b[_0x3e37('0xd')](_0x3e37('0x28'),this[_0x3e37('0x2f')][_0x3e37('0xf')](this));}catch(_0x2bd899){logger['error'](_0x2bd899);}}else{this[_0x3e37('0x2')][_0x3e37('0x30')](!![],this['handleCloseBox'][_0x3e37('0xf')](this));}}};EmailImap[_0x3e37('0x23')][_0x3e37('0x31')]=function(_0x3f5c62,_0x35ff12){_0x3f5c62['on']('body',this[_0x3e37('0x32')][_0x3e37('0xf')](this));_0x3f5c62[_0x3e37('0xd')](_0x3e37('0x33'),this[_0x3e37('0x34')][_0x3e37('0xf')](this));_0x3f5c62[_0x3e37('0xd')](_0x3e37('0x28'),this['handleMessageEnd'][_0x3e37('0xf')](this));};EmailImap[_0x3e37('0x23')][_0x3e37('0x32')]=function(_0x1eb021,_0x2b8615){simpleParser(_0x1eb021,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x3e37('0x23')][_0x3e37('0x34')]=function(_0x265ec2){};EmailImap[_0x3e37('0x23')][_0x3e37('0x35')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0xf57a77,_0x56a0ff){if(_0xf57a77){logger[_0x3e37('0x2e')](_0xf57a77);}else{var _0x411167=this;utils[_0x3e37('0x36')](this[_0x3e37('0xb')],_0x56a0ff,function(_0x25e07f){_0x411167[_0x3e37('0x24')]('email',_0x25e07f);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x3e37('0x2')]['closeBox'](!![],this[_0x3e37('0x26')][_0x3e37('0xf')](this));};EmailImap['prototype'][_0x3e37('0x37')]=function(_0x783cc9){this[_0x3e37('0x27')](_0x783cc9);this[_0x3e37('0x2')][_0x3e37('0x30')](!![],this[_0x3e37('0x26')][_0x3e37('0xf')](this));};EmailImap['prototype'][_0x3e37('0x10')]=function(){this[_0x3e37('0x24')](_0x3e37('0x28'));};EmailImap['prototype'][_0x3e37('0x27')]=function(_0x1920fb,_0x462fe3){logger['error'](_0x3e37('0x27'),this[_0x3e37('0xb')][_0x3e37('0xa')],JSON[_0x3e37('0x38')](_0x1920fb));var _0x1dfb7f='';if(_0x1920fb){if(_0x1920fb[_0x3e37('0x39')]){_0x1dfb7f=_0x1920fb[_0x3e37('0x39')];}else{for(var _0x3e12d9 in _0x1920fb){if(_0x1920fb[_0x3e37('0x3a')](_0x3e12d9)){_0x1dfb7f+=_[_0x3e37('0x3b')](_0x3e12d9)+':\x20'+_0x1920fb[_0x3e12d9]+'\x0a';}}}}if(_0x462fe3){this[_0x3e37('0x2')][_0x3e37('0x28')]();}else{this['emit'](_0x3e37('0x2e'),_0x1dfb7f);this[_0x3e37('0x24')](_0x3e37('0x28'));}};module[_0x3e37('0x3c')]=EmailImap;
\ No newline at end of file
+var _0x3b36=['openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','parser','closeBox','textCode','hasOwnProperty','util','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','handleReady','bind','handleError','connect','prototype','connTimeout','authTimeout','service','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com'];(function(_0x58ecb4,_0x2c03c4){var _0x4b2adc=function(_0x1f4ac0){while(--_0x1f4ac0){_0x58ecb4['push'](_0x58ecb4['shift']());}};_0x4b2adc(++_0x2c03c4);}(_0x3b36,0x181));var _0x63b3=function(_0x16cd8a,_0x3ff1b9){_0x16cd8a=_0x16cd8a-0x0;var _0x33e753=_0x3b36[_0x16cd8a];return _0x33e753;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x63b3('0x0'));var Imap=require('imap');var _=require(_0x63b3('0x1'));var rs=require(_0x63b3('0x2'));var simpleParser=require(_0x63b3('0x3'))[_0x63b3('0x4')];var Iconv=require(_0x63b3('0x5'))[_0x63b3('0x6')];var EventEmitter=require(_0x63b3('0x7'))[_0x63b3('0x8')];var utils=require(_0x63b3('0x9'));var logger=require(_0x63b3('0xa'))(_0x63b3('0xb'));function EmailImap(_0x25d851,_0x298f48){this[_0x63b3('0xc')]=_0x63b3('0xd');this[_0x63b3('0xe')]=this[_0x63b3('0xf')](_0x25d851,_0x298f48);this[_0x63b3('0x10')]=new Imap(this[_0x63b3('0xe')]);this['imap'][_0x63b3('0x11')]('ready',this[_0x63b3('0x12')][_0x63b3('0x13')](this));this[_0x63b3('0x10')][_0x63b3('0x11')]('end',this['handleEnd'][_0x63b3('0x13')](this));this[_0x63b3('0x10')]['on']('error',this[_0x63b3('0x14')][_0x63b3('0x13')](this));this[_0x63b3('0x10')][_0x63b3('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x63b3('0x16')]['getAccount']=function(_0x348bcc,_0x16aecc){var _0x7c997={'connTimeout':_0x348bcc[_0x63b3('0x17')]?_0x348bcc[_0x63b3('0x17')]*0x3e8:0x2710,'authTimeout':_0x348bcc[_0x63b3('0x18')]?_0x348bcc['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x348bcc[_0x63b3('0x19')])){if(_0x348bcc['authentication']){_0x7c997[_0x63b3('0x1a')]=_0x348bcc[_0x63b3('0x1a')];_0x7c997['password']=_0x348bcc[_0x63b3('0x1b')];}_0x7c997[_0x63b3('0x1c')]=_0x348bcc[_0x63b3('0x1c')];_0x7c997[_0x63b3('0x1d')]=_0x348bcc[_0x63b3('0x1d')]||0x3e1;if(_0x348bcc[_0x63b3('0x1e')]){_0x7c997[_0x63b3('0x1e')]=!![];}else{_0x7c997['tls']=![];_0x7c997[_0x63b3('0x1f')]=_0x63b3('0x20');}}else{_0x7c997['user']=_0x348bcc[_0x63b3('0x1a')];_0x7c997[_0x63b3('0x1b')]=_0x348bcc[_0x63b3('0x1b')];_0x7c997[_0x63b3('0x1c')]=utils[_0x63b3('0x21')](_0x348bcc[_0x63b3('0x19')]);_0x7c997[_0x63b3('0x1d')]=0x3e1;_0x7c997[_0x63b3('0x1e')]=!![];}_0x7c997['email']=_0x16aecc||_0x348bcc[_0x63b3('0x1a')]||_0x63b3('0x22');return _0x7c997;};EmailImap[_0x63b3('0x16')][_0x63b3('0x12')]=function(){this[_0x63b3('0x10')][_0x63b3('0x23')](this['mailbox'],![],this[_0x63b3('0x24')][_0x63b3('0x13')](this));};EmailImap[_0x63b3('0x16')]['handleOpenBox']=function(_0x26a53e,_0x5acf42){if(_0x26a53e){this[_0x63b3('0x14')](_0x26a53e,!![]);}else{this[_0x63b3('0x25')](_0x63b3('0x26'),_0x5acf42);this[_0x63b3('0x27')]();}};EmailImap[_0x63b3('0x16')][_0x63b3('0x28')]=function(_0xf58259){if(_0xf58259){this[_0x63b3('0x14')](_0xf58259,!![]);}else{this['imap'][_0x63b3('0x29')]();}};EmailImap[_0x63b3('0x16')][_0x63b3('0x27')]=function(){this[_0x63b3('0x10')][_0x63b3('0x2a')]([_0x63b3('0x2b')],this[_0x63b3('0x2c')][_0x63b3('0x13')](this));};EmailImap[_0x63b3('0x16')][_0x63b3('0x2c')]=function(_0x547a99,_0x4f55de){if(_0x547a99){this['handleError'](_0x547a99,!![]);}else{if(_0x4f55de[_0x63b3('0x2d')]){try{var _0xb4bc6=this[_0x63b3('0x10')][_0x63b3('0x2e')](_0x4f55de,{'bodies':'','markSeen':!![]});_0xb4bc6['on'](_0x63b3('0x2f'),this[_0x63b3('0x30')][_0x63b3('0x13')](this));_0xb4bc6[_0x63b3('0x11')](_0x63b3('0x31'),this[_0x63b3('0x32')][_0x63b3('0x13')](this));_0xb4bc6[_0x63b3('0x11')](_0x63b3('0x29'),this[_0x63b3('0x33')][_0x63b3('0x13')](this));}catch(_0x4538e4){logger[_0x63b3('0x31')](_0x4538e4);}}else{this[_0x63b3('0x10')]['closeBox'](!![],this[_0x63b3('0x28')][_0x63b3('0x13')](this));}}};EmailImap[_0x63b3('0x16')][_0x63b3('0x30')]=function(_0x35d54d,_0x3f5383){_0x35d54d['on'](_0x63b3('0x34'),this[_0x63b3('0x35')][_0x63b3('0x13')](this));_0x35d54d['once']('attributes',this[_0x63b3('0x36')]['bind'](this));_0x35d54d[_0x63b3('0x11')](_0x63b3('0x29'),this[_0x63b3('0x37')][_0x63b3('0x13')](this));};EmailImap[_0x63b3('0x16')][_0x63b3('0x35')]=function(_0xffcd1e,_0x1e3c8a){simpleParser(_0xffcd1e,{'Iconv':Iconv},this['handleSimpleParser'][_0x63b3('0x13')](this));};EmailImap[_0x63b3('0x16')][_0x63b3('0x36')]=function(_0x1b3ea1){};EmailImap['prototype'][_0x63b3('0x37')]=function(){};EmailImap[_0x63b3('0x16')]['handleSimpleParser']=function(_0x3c9cc3,_0x449bd8){if(_0x3c9cc3){logger[_0x63b3('0x31')](_0x3c9cc3);}else{var _0x3035c5=this;utils[_0x63b3('0x38')](this[_0x63b3('0xe')],_0x449bd8,function(_0x342044){_0x3035c5[_0x63b3('0x25')]('email',_0x342044);});}};EmailImap[_0x63b3('0x16')][_0x63b3('0x33')]=function(){this[_0x63b3('0x10')][_0x63b3('0x39')](!![],this[_0x63b3('0x28')][_0x63b3('0x13')](this));};EmailImap[_0x63b3('0x16')]['handleFetchError']=function(_0x38efab){this[_0x63b3('0x14')](_0x38efab);this['imap']['closeBox'](!![],this[_0x63b3('0x28')][_0x63b3('0x13')](this));};EmailImap[_0x63b3('0x16')]['handleEnd']=function(){this['emit']('end');};EmailImap[_0x63b3('0x16')][_0x63b3('0x14')]=function(_0x132cba,_0x50f596){logger[_0x63b3('0x31')](_0x63b3('0x14'),this['account']['email'],JSON['stringify'](_0x132cba));var _0x106e7d='';if(_0x132cba){if(_0x132cba['textCode']){_0x106e7d=_0x132cba[_0x63b3('0x3a')];}else{for(var _0x3c032f in _0x132cba){if(_0x132cba[_0x63b3('0x3b')](_0x3c032f)){_0x106e7d+=_['upperFirst'](_0x3c032f)+':\x20'+_0x132cba[_0x3c032f]+'\x0a';}}}}if(_0x50f596){this['imap'][_0x63b3('0x29')]();}else{this[_0x63b3('0x25')](_0x63b3('0x31'),_0x106e7d);this[_0x63b3('0x25')](_0x63b3('0x29'));}};module['exports']=EmailImap;
\ No newline at end of file
index 67323ac..2d49f64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f90=['prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64'];(function(_0x1abb18,_0x3960ec){var _0x2a4e44=function(_0x15895d){while(--_0x15895d){_0x1abb18['push'](_0x1abb18['shift']());}};_0x2a4e44(++_0x3960ec);}(_0x7f90,0xf4));var _0x07f9=function(_0x1eebd1,_0x5960dd){_0x1eebd1=_0x1eebd1-0x0;var _0x3f49e9=_0x7f90[_0x1eebd1];return _0x3f49e9;};'use strict';var nodemailer=require(_0x07f9('0x0'));var BPromise=require(_0x07f9('0x1'));var inlineBase64=require(_0x07f9('0x2'));function EmailSmtp(){}EmailSmtp[_0x07f9('0x3')][_0x07f9('0x4')]=function(_0x5a7b2b,_0x3e6c79){return new BPromise(function(_0xbb55be,_0x2b6566){var _0x128452=nodemailer[_0x07f9('0x5')](_0x5a7b2b);_0x128452[_0x07f9('0x6')](_0x07f9('0x7'),inlineBase64());_0x128452[_0x07f9('0x8')](_0x3e6c79,function(_0x2329cc,_0x200036){if(_0x2329cc){_0x2b6566(_0x2329cc[_0x07f9('0x9')]());}else{_0xbb55be(_0x200036);}});});};EmailSmtp[_0x07f9('0x3')][_0x07f9('0xa')]=function(_0xe812a){return new BPromise(function(_0x24c8cf,_0x33ce87){var _0x4fac6b=nodemailer[_0x07f9('0x5')](_0xe812a);_0x4fac6b[_0x07f9('0xa')](function(_0x5a84c0,_0x2fdfa5){if(_0x5a84c0){_0x33ce87(_0x5a84c0['toString']());}else{if(_0x2fdfa5){_0x24c8cf(_0x2fdfa5);}else{_0x33ce87(_0x07f9('0xb'));}}});});};module[_0x07f9('0xc')]=EmailSmtp;
\ No newline at end of file
+var _0xc9e2=['nodemailer','nodemailer-plugin-inline-base64','send','use','toString','prototype','verify','createTransport'];(function(_0x1e6743,_0x4aa840){var _0x59dabb=function(_0x512c2d){while(--_0x512c2d){_0x1e6743['push'](_0x1e6743['shift']());}};_0x59dabb(++_0x4aa840);}(_0xc9e2,0x1c0));var _0x2c9e=function(_0x3e519e,_0x2fda4e){_0x3e519e=_0x3e519e-0x0;var _0x41350f=_0xc9e2[_0x3e519e];return _0x41350f;};'use strict';var nodemailer=require(_0x2c9e('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x2c9e('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x2c9e('0x2')]=function(_0x2d9023,_0x351a80){return new BPromise(function(_0x270acb,_0x5008e9){var _0x4735ab=nodemailer['createTransport'](_0x2d9023);_0x4735ab[_0x2c9e('0x3')]('compile',inlineBase64());_0x4735ab['sendMail'](_0x351a80,function(_0xd243b2,_0x3323db){if(_0xd243b2){_0x5008e9(_0xd243b2[_0x2c9e('0x4')]());}else{_0x270acb(_0x3323db);}});});};EmailSmtp[_0x2c9e('0x5')][_0x2c9e('0x6')]=function(_0x490ce1){return new BPromise(function(_0x45e6c7,_0x1e5cbb){var _0x2940f5=nodemailer[_0x2c9e('0x7')](_0x490ce1);_0x2940f5[_0x2c9e('0x6')](function(_0x51d977,_0x12ea70){if(_0x51d977){_0x1e5cbb(_0x51d977[_0x2c9e('0x4')]());}else{if(_0x12ea70){_0x45e6c7(_0x12ea70);}else{_0x1e5cbb('Not\x20verifired');}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index 9e7a6ea..b01d63d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdced=['body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','includes','originTo','email','bcc','attach','attachment','format','now','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','length','join','Anonymous','split','pop','isEmpty','html','test','replace','<img','attachments','forEach','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>'];(function(_0x122936,_0x4c53f1){var _0x178004=function(_0x1ed29f){while(--_0x1ed29f){_0x122936['push'](_0x122936['shift']());}};_0x178004(++_0x4c53f1);}(_0xdced,0xcb));var _0xddce=function(_0x42df6a,_0x373ee1){_0x42df6a=_0x42df6a-0x0;var _0xc9c7f4=_0xdced[_0x42df6a];return _0xc9c7f4;};'use strict';var _=require('lodash');var moment=require(_0xddce('0x0'));var random=require(_0xddce('0x1'));var fs=require('fs');var path=require(_0xddce('0x2'));var util=require(_0xddce('0x3'));var tnef=require(_0xddce('0x4'));var logger=require(_0xddce('0x5'))('email');var config=require(_0xddce('0x6'));function getAddress(_0x509b66){var _0x3bfdd2=_[_0xddce('0x7')](_0x509b66['value']);return _0x3bfdd2&&_0x3bfdd2[_0xddce('0x8')]?_0x3bfdd2['address']:_0xddce('0x9')+random[_0xddce('0xa')](0x6)+_0xddce('0xb');}function getFirstName(_0x105bf9){var _0x4b150b=_[_0xddce('0x7')](_0x105bf9[_0xddce('0xc')]);if(_0x4b150b&&_0x4b150b[_0xddce('0xd')]){if(_0x4b150b['name']==_0x4b150b['address']){return _0x4b150b[_0xddce('0xd')][_0xddce('0xe')](0x0,_0x4b150b['name'][_0xddce('0xf')]('@'));}var _0x362144=_0x4b150b[_0xddce('0xd')]['split'](/\s+/);return _0x362144[_0xddce('0x10')]>0x1?_0x362144['slice'](0x0,-0x1)[_0xddce('0x11')]('\x20'):_0x4b150b[_0xddce('0xd')];}return _0xddce('0x12');}function getLastName(_0x10a409){var _0x1e5ca2=_[_0xddce('0x7')](_0x10a409[_0xddce('0xc')]);if(_0x1e5ca2&&_0x1e5ca2['name']){var _0x5311be=_0x1e5ca2[_0xddce('0xd')][_0xddce('0x13')](/\s+/);return _0x5311be['length']>0x1?_0x5311be[_0xddce('0x14')]():'';}return'';}function getMails(_0x4d2e2a,_0x245345){var _0x53203f='';for(var _0x30205e=0x0;_0x30205e<_0x245345[_0xddce('0xc')]['length'];_0x30205e+=0x1){if(_0x245345[_0xddce('0xc')][_0x30205e][_0xddce('0x8')]!==_0x4d2e2a){if(!_[_0xddce('0x15')](_0x53203f)){_0x53203f+=',';}_0x53203f+=_0x245345[_0xddce('0xc')][_0x30205e]['name']||_0x245345[_0xddce('0xc')][_0x30205e][_0xddce('0x8')]||'';_0x53203f+='\x20<';_0x53203f+=_0x245345[_0xddce('0xc')][_0x30205e]['address']?_0x245345[_0xddce('0xc')][_0x30205e]['address']:_0xddce('0x9')+random['generate'](0x6)+_0xddce('0xb');_0x53203f+='>';}}return _0x53203f;}function parseEmail(_0x2399e7,_0x16467c,_0x489ca9){if(_0x16467c[_0xddce('0x16')]){var _0x7fc3a1=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x7fc3a1[_0xddce('0x17')](_0x16467c[_0xddce('0x16')])){_0x16467c[_0xddce('0x16')]=_0x16467c[_0xddce('0x16')][_0xddce('0x18')](_0x7fc3a1,'');}if(_0x16467c[_0xddce('0x16')]['includes'](_0xddce('0x19'))){var _0x41c42d=[];_0x16467c[_0xddce('0x1a')][_0xddce('0x1b')](_0x50bbf2=>{_0x41c42d[_0xddce('0x1c')](_0x50bbf2[_0xddce('0x1d')]);});var _0x5036fa=/<img.*? _SRC(.*?)[^>]+>/g;var _0x23265a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xcb140=_0x16467c[_0xddce('0x16')][_0xddce('0x18')](_0x23265a,_0xddce('0x1e'));var _0x3a7d40=_0xcb140[_0xddce('0x18')](_0x5036fa,'_IMG');for(let _0x47e217=0x0;_0x47e217<_0x41c42d['length'];_0x47e217++){var _0x3c1a41=_0x3a7d40[_0xddce('0x18')](_0xddce('0x1f'),_0xddce('0x20')+_0x41c42d[_0x47e217]+_0xddce('0x21'));_0x3a7d40=_0x3c1a41;}_0x16467c[_0xddce('0x16')]=_0x3a7d40;}_0x489ca9[_0xddce('0x22')]=_0x16467c['html'];}else{_0x489ca9[_0xddce('0x22')]=_0x16467c[_0xddce('0x23')];}if(_0x489ca9[_0xddce('0x22')]){_0x489ca9['body']=_0x489ca9['body'][_0xddce('0x18')](/<a\s+/gi,_0xddce('0x24'));}if(_0x16467c['to']){_0x489ca9[_0xddce('0x25')]['originTo']=getMails(null,_0x16467c['to']);var _0x2c37f3=getMails(_0x2399e7['email'],_0x16467c['to']);if(!_[_0xddce('0x15')](_0x2c37f3)){_0x489ca9[_0xddce('0x25')]['cc']+=_0x2c37f3;}}if(_0x16467c['cc']){_0x489ca9[_0xddce('0x25')][_0xddce('0x26')]=getMails(null,_0x16467c['cc']);var _0x46d2d2=getMails(_0x2399e7['email'],_0x16467c['cc']);if(!_[_0xddce('0x15')](_0x46d2d2)){if(!_['isEmpty'](_0x489ca9['message']['cc'])){_0x489ca9[_0xddce('0x25')]['cc']+=',';}_0x489ca9[_0xddce('0x25')]['cc']+=_0x46d2d2;}}if(!_[_0xddce('0x27')](_0x489ca9[_0xddce('0x25')][_0xddce('0x28')],_0x2399e7[_0xddce('0x29')])&&!_['includes'](_0x489ca9[_0xddce('0x25')][_0xddce('0x26')],_0x2399e7['email'])){_0x489ca9[_0xddce('0x25')][_0xddce('0x2a')]=_0x2399e7[_0xddce('0x29')];}if(_0x16467c['attachments']&&_0x16467c[_0xddce('0x1a')][_0xddce('0x10')]){_0x489ca9[_0xddce('0x25')][_0xddce('0x2b')]=_0x16467c['attachments'][_0xddce('0x10')];for(var _0x54cf3e=0x0,_0x337d21,_0x366f9f,_0x32b96b;_0x54cf3e<_0x16467c['attachments'][_0xddce('0x10')];_0x54cf3e+=0x1){if(_0x16467c['attachments'][_0x54cf3e]['type']===_0xddce('0x2c')){_0x32b96b=_0x16467c['attachments'][_0x54cf3e]['filename']||'attachment-'+_0x54cf3e;_0x337d21=util[_0xddce('0x2d')]('%s-%s',Date[_0xddce('0x2e')](),_0x32b96b);_0x366f9f=path['join'](config['root'],_0xddce('0x2f'),_0x337d21);fs[_0xddce('0x30')](_0x366f9f,_0x16467c['attachments'][_0x54cf3e][_0xddce('0x31')]);_0x489ca9[_0xddce('0x25')][_0xddce('0x1a')][_0xddce('0x1c')]({'name':_0x32b96b,'basename':_0x337d21,'type':_0x16467c[_0xddce('0x1a')][_0x54cf3e][_0xddce('0x32')],'filepath':_0x366f9f});}}}if(_0x16467c[_0xddce('0x33')]&&_0x16467c[_0xddce('0x33')]['length']>0x0){var _0x1a115e=[_0xddce('0x34'),_0xddce('0x35'),_0xddce('0x36')];for(var _0x28da74=0x0;_0x28da74<_0x16467c[_0xddce('0x33')]['length'];_0x28da74++){var _0x29f125=_[_0xddce('0xf')](_0x1a115e,_0x16467c[_0xddce('0x33')][_0x28da74][_0xddce('0x37')]);if(_0x29f125>=0x0){_0x489ca9[_0xddce('0x38')]=!![];}}}return _0x489ca9;}exports[_0xddce('0x39')]=function(_0x3278bc,_0x995b26,_0x1e59a8){var _0x1edfa4={'from':getAddress(_0x995b26[_0xddce('0x3a')]),'firstName':getFirstName(_0x995b26[_0xddce('0x3a')]),'lastName':getLastName(_0x995b26['from']),'mapKey':_0xddce('0x29'),'message':{'from':getMails(_0x3278bc[_0xddce('0x29')],_0x995b26[_0xddce('0x3a')]),'to':_0x3278bc['email'],'cc':'','subject':_0x995b26['subject']||'','messageId':_0x995b26[_0xddce('0x3b')],'inReplyTo':_0x995b26[_0xddce('0x3c')],'sentAt':moment(_0x995b26[_0xddce('0x3d')])[_0xddce('0x2d')](_0xddce('0x3e')),'attach':![],'attachments':[]}};if(!_0x995b26[_0xddce('0x16')]&&!_0x995b26[_0xddce('0x23')]){var _0x3ebbb1=_['filter'](_0x995b26['attachments'],{'contentType':_0xddce('0x3f')});if(_0x3ebbb1[_0xddce('0x10')]){logger['info'](util[_0xddce('0x2d')](_0xddce('0x40'),_0x995b26[_0xddce('0x3b')]));tnef[_0xddce('0x41')](_[_0xddce('0x42')](_0x3ebbb1)[_0xddce('0x31')],function(_0x5c2ec5,_0x2d8686){if(_0x2d8686){_0x995b26['html']=_0x2d8686[_0xddce('0x43')]||_0xddce('0x44');if(_0x2d8686[_0xddce('0x45')]){for(var _0x3f4719=0x0;_0x3f4719<_0x2d8686[_0xddce('0x45')]['length'];_0x3f4719++){var _0x591af2=_0x2d8686[_0xddce('0x45')][_0x3f4719];_0x1edfa4[_0xddce('0x25')][_0xddce('0x1a')][_0xddce('0x1c')]({'filename':_0x591af2[_0xddce('0x46')],'content':Buffer[_0xddce('0x3a')](_0x591af2[_0xddce('0x47')])});}}}_0x1e59a8(parseEmail(_0x3278bc,_0x995b26,_0x1edfa4));});}else{_0x995b26['html']='<p>Empty\x20message</p>';_0x1e59a8(parseEmail(_0x3278bc,_0x995b26,_0x1edfa4));}}else{_0x1e59a8(parseEmail(_0x3278bc,_0x995b26,_0x1edfa4));}};exports['getHost']=function(_0x2bc515){switch(_0x2bc515){case'gmail':return _0xddce('0x48');case _0xddce('0x49'):return _0xddce('0x4a');case _0xddce('0x4b'):return _0xddce('0x4c');case _0xddce('0x4d'):return _0xddce('0x4e');}return'127.0.0.1';};
\ No newline at end of file
+var _0xa9fc=['date','format','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','Attachments','Title','Data','<p>Empty\x20message</p>','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','../../../config/logger','../../../config/environment','address','anonymous','generate','@xcally.com','head','value','name','substring','length','slice','join','Anonymous','split','isEmpty','html','test','replace','includes','<img','attachments','forEach','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','email','originCc','bcc','attach','type','attachment','attachment-','root','server/files/attachments/','content','push','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','messageId'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0xa9fc,0x19f));var _0xca9f=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xa9fc[_0x1ae4a9];return _0x54d0b0;};'use strict';var _=require(_0xca9f('0x0'));var moment=require(_0xca9f('0x1'));var random=require(_0xca9f('0x2'));var fs=require('fs');var path=require(_0xca9f('0x3'));var util=require(_0xca9f('0x4'));var tnef=require('node-tnef');var logger=require(_0xca9f('0x5'))('email');var config=require(_0xca9f('0x6'));function getAddress(_0x32709b){var _0x5d2ddf=_['head'](_0x32709b['value']);return _0x5d2ddf&&_0x5d2ddf[_0xca9f('0x7')]?_0x5d2ddf['address']:_0xca9f('0x8')+random[_0xca9f('0x9')](0x6)+_0xca9f('0xa');}function getFirstName(_0xf7ebb1){var _0x244d4d=_[_0xca9f('0xb')](_0xf7ebb1[_0xca9f('0xc')]);if(_0x244d4d&&_0x244d4d[_0xca9f('0xd')]){if(_0x244d4d['name']==_0x244d4d[_0xca9f('0x7')]){return _0x244d4d[_0xca9f('0xd')][_0xca9f('0xe')](0x0,_0x244d4d[_0xca9f('0xd')]['indexOf']('@'));}var _0x41bca1=_0x244d4d[_0xca9f('0xd')]['split'](/\s+/);return _0x41bca1[_0xca9f('0xf')]>0x1?_0x41bca1[_0xca9f('0x10')](0x0,-0x1)[_0xca9f('0x11')]('\x20'):_0x244d4d[_0xca9f('0xd')];}return _0xca9f('0x12');}function getLastName(_0x13c082){var _0x109ec0=_[_0xca9f('0xb')](_0x13c082[_0xca9f('0xc')]);if(_0x109ec0&&_0x109ec0[_0xca9f('0xd')]){var _0x593ed9=_0x109ec0['name'][_0xca9f('0x13')](/\s+/);return _0x593ed9['length']>0x1?_0x593ed9['pop']():'';}return'';}function getMails(_0xda6255,_0x2c4568){var _0x55f50e='';for(var _0x4afedf=0x0;_0x4afedf<_0x2c4568['value'][_0xca9f('0xf')];_0x4afedf+=0x1){if(_0x2c4568['value'][_0x4afedf][_0xca9f('0x7')]!==_0xda6255){if(!_[_0xca9f('0x14')](_0x55f50e)){_0x55f50e+=',';}_0x55f50e+=_0x2c4568[_0xca9f('0xc')][_0x4afedf][_0xca9f('0xd')]||_0x2c4568[_0xca9f('0xc')][_0x4afedf]['address']||'';_0x55f50e+='\x20<';_0x55f50e+=_0x2c4568[_0xca9f('0xc')][_0x4afedf]['address']?_0x2c4568[_0xca9f('0xc')][_0x4afedf][_0xca9f('0x7')]:_0xca9f('0x8')+random[_0xca9f('0x9')](0x6)+_0xca9f('0xa');_0x55f50e+='>';}}return _0x55f50e;}function parseEmail(_0x542f37,_0x7246c7,_0x469ca0){if(_0x7246c7[_0xca9f('0x15')]){var _0x1927b7=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x1927b7[_0xca9f('0x16')](_0x7246c7['html'])){_0x7246c7['html']=_0x7246c7[_0xca9f('0x15')][_0xca9f('0x17')](_0x1927b7,'');}if(_0x7246c7[_0xca9f('0x15')][_0xca9f('0x18')](_0xca9f('0x19'))){var _0x558ecd=[];_0x7246c7[_0xca9f('0x1a')][_0xca9f('0x1b')](_0x46a0e8=>{_0x558ecd['push'](_0x46a0e8[_0xca9f('0x1c')]);});var _0x235044=/<img.*? _SRC(.*?)[^>]+>/g;var _0x428825=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x133222=_0x7246c7[_0xca9f('0x15')]['replace'](_0x428825,_0xca9f('0x1d'));var _0x33efe0=_0x133222[_0xca9f('0x17')](_0x235044,_0xca9f('0x1e'));for(let _0x399d1a=0x0;_0x399d1a<_0x558ecd['length'];_0x399d1a++){var _0x5a390e=_0x33efe0[_0xca9f('0x17')]('_IMG',_0xca9f('0x1f')+_0x558ecd[_0x399d1a]+_0xca9f('0x20'));_0x33efe0=_0x5a390e;}_0x7246c7[_0xca9f('0x15')]=_0x33efe0;}_0x469ca0[_0xca9f('0x21')]=_0x7246c7['html'];}else{_0x469ca0['body']=_0x7246c7[_0xca9f('0x22')];}if(_0x469ca0['body']){_0x469ca0[_0xca9f('0x21')]=_0x469ca0['body'][_0xca9f('0x17')](/<a\s+/gi,_0xca9f('0x23'));}if(_0x7246c7['to']){_0x469ca0[_0xca9f('0x24')][_0xca9f('0x25')]=getMails(null,_0x7246c7['to']);var _0x282dc4=getMails(_0x542f37[_0xca9f('0x26')],_0x7246c7['to']);if(!_['isEmpty'](_0x282dc4)){_0x469ca0['message']['cc']+=_0x282dc4;}}if(_0x7246c7['cc']){_0x469ca0[_0xca9f('0x24')]['originCc']=getMails(null,_0x7246c7['cc']);var _0x2b0176=getMails(_0x542f37[_0xca9f('0x26')],_0x7246c7['cc']);if(!_[_0xca9f('0x14')](_0x2b0176)){if(!_['isEmpty'](_0x469ca0['message']['cc'])){_0x469ca0[_0xca9f('0x24')]['cc']+=',';}_0x469ca0[_0xca9f('0x24')]['cc']+=_0x2b0176;}}if(!_[_0xca9f('0x18')](_0x469ca0['message'][_0xca9f('0x25')],_0x542f37[_0xca9f('0x26')])&&!_['includes'](_0x469ca0['message'][_0xca9f('0x27')],_0x542f37[_0xca9f('0x26')])){_0x469ca0[_0xca9f('0x24')][_0xca9f('0x28')]=_0x542f37[_0xca9f('0x26')];}if(_0x7246c7[_0xca9f('0x1a')]&&_0x7246c7[_0xca9f('0x1a')][_0xca9f('0xf')]){_0x469ca0[_0xca9f('0x24')][_0xca9f('0x29')]=_0x7246c7[_0xca9f('0x1a')][_0xca9f('0xf')];for(var _0x27ead3=0x0,_0x53df7e,_0x35a5f6,_0x49f65e;_0x27ead3<_0x7246c7[_0xca9f('0x1a')][_0xca9f('0xf')];_0x27ead3+=0x1){if(_0x7246c7['attachments'][_0x27ead3][_0xca9f('0x2a')]===_0xca9f('0x2b')){_0x49f65e=_0x7246c7[_0xca9f('0x1a')][_0x27ead3][_0xca9f('0x1c')]||_0xca9f('0x2c')+_0x27ead3;_0x53df7e=util['format']('%s-%s',Date['now'](),_0x49f65e);_0x35a5f6=path[_0xca9f('0x11')](config[_0xca9f('0x2d')],_0xca9f('0x2e'),_0x53df7e);fs['writeFileSync'](_0x35a5f6,_0x7246c7[_0xca9f('0x1a')][_0x27ead3][_0xca9f('0x2f')]);_0x469ca0['message'][_0xca9f('0x1a')][_0xca9f('0x30')]({'name':_0x49f65e,'basename':_0x53df7e,'type':_0x7246c7['attachments'][_0x27ead3][_0xca9f('0x31')],'filepath':_0x35a5f6});}}}if(_0x7246c7[_0xca9f('0x32')]&&_0x7246c7[_0xca9f('0x32')][_0xca9f('0xf')]>0x0){var _0x379539=['Auto-Submitted:\x20auto-replied',_0xca9f('0x33'),_0xca9f('0x34')];for(var _0x5cfebe=0x0;_0x5cfebe<_0x7246c7[_0xca9f('0x32')][_0xca9f('0xf')];_0x5cfebe++){var _0x14608b=_[_0xca9f('0x35')](_0x379539,_0x7246c7[_0xca9f('0x32')][_0x5cfebe][_0xca9f('0x36')]);if(_0x14608b>=0x0){_0x469ca0[_0xca9f('0x37')]=!![];}}}return _0x469ca0;}exports[_0xca9f('0x38')]=function(_0x432734,_0x409fb0,_0x2bc911){var _0x378641={'from':getAddress(_0x409fb0['from']),'firstName':getFirstName(_0x409fb0[_0xca9f('0x39')]),'lastName':getLastName(_0x409fb0[_0xca9f('0x39')]),'mapKey':_0xca9f('0x26'),'message':{'from':getMails(_0x432734[_0xca9f('0x26')],_0x409fb0[_0xca9f('0x39')]),'to':_0x432734['email'],'cc':'','subject':_0x409fb0['subject']||'','messageId':_0x409fb0[_0xca9f('0x3a')],'inReplyTo':_0x409fb0['inReplyTo'],'sentAt':moment(_0x409fb0[_0xca9f('0x3b')])[_0xca9f('0x3c')](_0xca9f('0x3d')),'attach':![],'attachments':[]}};if(!_0x409fb0[_0xca9f('0x15')]&&!_0x409fb0[_0xca9f('0x22')]){var _0x3e8d1a=_['filter'](_0x409fb0[_0xca9f('0x1a')],{'contentType':_0xca9f('0x3e')});if(_0x3e8d1a['length']){logger[_0xca9f('0x3f')](util[_0xca9f('0x3c')](_0xca9f('0x40'),_0x409fb0[_0xca9f('0x3a')]));tnef['parseBuffer'](_[_0xca9f('0x41')](_0x3e8d1a)['content'],function(_0x405728,_0xd89e45){if(_0xd89e45){_0x409fb0[_0xca9f('0x15')]=_0xd89e45[_0xca9f('0x42')]||'<p>Empty\x20message</p>';if(_0xd89e45['Attachments']){for(var _0x5e1c8d=0x0;_0x5e1c8d<_0xd89e45[_0xca9f('0x43')][_0xca9f('0xf')];_0x5e1c8d++){var _0x154320=_0xd89e45[_0xca9f('0x43')][_0x5e1c8d];_0x378641[_0xca9f('0x24')][_0xca9f('0x1a')][_0xca9f('0x30')]({'filename':_0x154320[_0xca9f('0x44')],'content':Buffer[_0xca9f('0x39')](_0x154320[_0xca9f('0x45')])});}}}_0x2bc911(parseEmail(_0x432734,_0x409fb0,_0x378641));});}else{_0x409fb0['html']=_0xca9f('0x46');_0x2bc911(parseEmail(_0x432734,_0x409fb0,_0x378641));}}else{_0x2bc911(parseEmail(_0x432734,_0x409fb0,_0x378641));}};exports['getHost']=function(_0x38e62f){switch(_0x38e62f){case _0xca9f('0x47'):return'imap.gmail.com';case _0xca9f('0x48'):return _0xca9f('0x49');case _0xca9f('0x4a'):return _0xca9f('0x4b');case _0xca9f('0x4c'):return _0xca9f('0x4d');}return _0xca9f('0x4e');};
\ No newline at end of file
index f400dbc..74b4aa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c6=['active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x18d5cf,_0x47d4ef){var _0x21eb05=function(_0x367bce){while(--_0x367bce){_0x18d5cf['push'](_0x18d5cf['shift']());}};_0x21eb05(++_0x47d4ef);}(_0xb8c6,0xac));var _0x6b8c=function(_0xc5d1b,_0x5a744d){_0xc5d1b=_0xc5d1b-0x0;var _0xed9f67=_0xb8c6[_0xc5d1b];return _0xed9f67;};'use strict';var _=require(_0x6b8c('0x0'));function MailAccount(_0x2cabb6){this['id']=_0x2cabb6['id']||0x0;this['name']=_0x2cabb6[_0x6b8c('0x1')]||_0x6b8c('0x2');this[_0x6b8c('0x3')]=_0x2cabb6[_0x6b8c('0x3')]||'SERV';this[_0x6b8c('0x4')]=_0x2cabb6[_0x6b8c('0x4')]||![];this[_0x6b8c('0x5')]=_0x2cabb6[_0x6b8c('0x5')]||[];this[_0x6b8c('0x6')]=_0x2cabb6[_0x6b8c('0x6')]||[];}module[_0x6b8c('0x7')]=MailAccount;
\ No newline at end of file
+var _0xf915=['exports','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0xf915,0x79));var _0x5f91=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf915[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');function MailAccount(_0x31e569){this['id']=_0x31e569['id']||0x0;this[_0x5f91('0x0')]=_0x31e569['name']||_0x5f91('0x1');this[_0x5f91('0x2')]=_0x31e569[_0x5f91('0x2')]||_0x5f91('0x3');this[_0x5f91('0x4')]=_0x31e569[_0x5f91('0x4')]||![];this[_0x5f91('0x5')]=_0x31e569[_0x5f91('0x5')]||[];this[_0x5f91('0x6')]=_0x31e569[_0x5f91('0x6')]||[];}module[_0x5f91('0x7')]=MailAccount;
\ No newline at end of file
index 5dec9ad..d7bf4da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95f6=['mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x95f6,0x193));var _0x695f=function(_0x59c765,_0x1b14cb){_0x59c765=_0x59c765-0x0;var _0x731b6d=_0x95f6[_0x59c765];return _0x731b6d;};'use strict';var _=require(_0x695f('0x0'));var MailAccount=require(_0x695f('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3f458f,_0x11bf5f,_0x56db2c){var _0x585ecb=_[_0x695f('0x2')](_0x3f458f,function(_0x3ccbaf,_0x15c860){return _0x3ccbaf[_0x56db2c];});for(var _0x2c1ff3 in _0x11bf5f){if(_0x11bf5f[_0x695f('0x3')](_0x2c1ff3)){if(!_0x585ecb[_0x2c1ff3]){delete _0x11bf5f[_0x2c1ff3];}}}}Realtime[_0x695f('0x4')][_0x695f('0x5')]=function(_0x5994e8,_0x41efb3){for(var _0x342ee1 in _0x41efb3){if(_0x5994e8[_0x695f('0x3')](_0x342ee1)){_0x5994e8[_0x342ee1]=_0x41efb3[_0x342ee1];}}};Realtime['prototype'][_0x695f('0x6')]=function(){var _0x592320=this;return function(_0x3b31e5){if(_0x3b31e5){freeIsNotKey(_0x3b31e5,_0x592320[_0x695f('0x7')],'id');for(var _0x195eaa=0x0,_0x163e7c={},_0x53aefa={};_0x195eaa<_0x3b31e5[_0x695f('0x8')];_0x195eaa+=0x1){_0x163e7c=_0x3b31e5[_0x195eaa];if(_[_0x695f('0x9')](_0x592320[_0x695f('0x7')][_0x163e7c['id']])){_0x592320[_0x695f('0x7')][_0x163e7c['id']]=new MailAccount(_0x163e7c);}else{_[_0x695f('0xa')](_0x592320[_0x695f('0x7')][_0x163e7c['id']],_0x163e7c);}}}return _0x592320[_0x695f('0x7')];};};module[_0x695f('0xb')]=Realtime;
\ No newline at end of file
+var _0x2969=['mailAccounts','hasOwnProperty','prototype','initMailAccounts','length','merge','exports','lodash','../model/mailAccount'];(function(_0x3c38dd,_0x481de5){var _0x3b91bc=function(_0x377a12){while(--_0x377a12){_0x3c38dd['push'](_0x3c38dd['shift']());}};_0x3b91bc(++_0x481de5);}(_0x2969,0x1a5));var _0x9296=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2969[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9296('0x0'));var MailAccount=require(_0x9296('0x1'));var Realtime=function(){this[_0x9296('0x2')]={};};function freeIsNotKey(_0x31a742,_0x5929a3,_0xd8a761){var _0x523096=_['mapKeys'](_0x31a742,function(_0x30c151,_0x4e114f){return _0x30c151[_0xd8a761];});for(var _0x4bfbbc in _0x5929a3){if(_0x5929a3[_0x9296('0x3')](_0x4bfbbc)){if(!_0x523096[_0x4bfbbc]){delete _0x5929a3[_0x4bfbbc];}}}}Realtime[_0x9296('0x4')]['mergeFromDatabase']=function(_0x54d8a3,_0x251df0){for(var _0x175718 in _0x251df0){if(_0x54d8a3['hasOwnProperty'](_0x175718)){_0x54d8a3[_0x175718]=_0x251df0[_0x175718];}}};Realtime[_0x9296('0x4')][_0x9296('0x5')]=function(){var _0x1ee5c4=this;return function(_0x2e8618){if(_0x2e8618){freeIsNotKey(_0x2e8618,_0x1ee5c4[_0x9296('0x2')],'id');for(var _0x4d8cd7=0x0,_0x13142f={},_0x48a5d0={};_0x4d8cd7<_0x2e8618[_0x9296('0x6')];_0x4d8cd7+=0x1){_0x13142f=_0x2e8618[_0x4d8cd7];if(_['isUndefined'](_0x1ee5c4[_0x9296('0x2')][_0x13142f['id']])){_0x1ee5c4['mailAccounts'][_0x13142f['id']]=new MailAccount(_0x13142f);}else{_[_0x9296('0x7')](_0x1ee5c4[_0x9296('0x2')][_0x13142f['id']],_0x13142f);}}}return _0x1ee5c4['mailAccounts'];};};module[_0x9296('0x8')]=Realtime;
\ No newline at end of file
index f52c2fb..a6de908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a01=['notify','Request','NotifyMailAccount','GetMailAccount','email','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','getMailAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0a01,0x10b));var _0x10a0=function(_0x1b98b4,_0xb1826a){_0x1b98b4=_0x1b98b4-0x0;var _0x448bb3=_0x0a01[_0x1b98b4];return _0x448bb3;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request'](_0x10a0('0x0'),{'options':{'attributes':['id','name','service',_0x10a0('0x1'),'active',_0x10a0('0x2'),_0x10a0('0x3'),_0x10a0('0x4')],'raw':![],'include':[{'model':_0x10a0('0x5'),'as':_0x10a0('0x6')},{'model':_0x10a0('0x7'),'as':'Smtp'}]},'log':_0x10a0('0x8')});};};exports[_0x10a0('0x9')]=function(_0x18c475,_0xee5289){return client[_0x10a0('0xa')](_0x10a0('0xb'),{'account':{'id':_0x18c475},'body':_0xee5289,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0xd301=['key','ListId','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','name','service','email','active'];(function(_0x1042b9,_0x4a42fe){var _0x4a8ec6=function(_0x2a6ed1){while(--_0x2a6ed1){_0x1042b9['push'](_0x1042b9['shift']());}};_0x4a8ec6(++_0x4a42fe);}(_0xd301,0x145));var _0x1d30=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0xd301[_0xa5d9f9];return _0x40e9f6;};'use strict';var client=require(_0x1d30('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x1d30('0x1'),_0x1d30('0x2'),_0x1d30('0x3'),_0x1d30('0x4'),_0x1d30('0x5'),_0x1d30('0x6'),_0x1d30('0x7')],'raw':![],'include':[{'model':_0x1d30('0x8'),'as':_0x1d30('0x9')},{'model':'MailServerOut','as':_0x1d30('0xa')}]},'log':_0x1d30('0xb')});};};exports[_0x1d30('0xc')]=function(_0x54320e,_0x40cb9d){return client[_0x1d30('0xd')](_0x1d30('0xe'),{'account':{'id':_0x54320e},'body':_0x40cb9d,'log':_0x1d30('0xe')});};
\ No newline at end of file
index 55fd706..a6bf757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73b8=['ShowSetting','GetSettings'];(function(_0x12db54,_0x1c8e29){var _0x1965fe=function(_0x5f1631){while(--_0x5f1631){_0x12db54['push'](_0x12db54['shift']());}};_0x1965fe(++_0x1c8e29);}(_0x73b8,0x150));var _0x873b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x73b8[_0xf50820];return _0x2a9b10;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request'](_0x873b('0x0'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x873b('0x1')});};
\ No newline at end of file
+var _0xb953=['loginMailFrequency','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x5eb87d,_0x17c270){var _0x79c592=function(_0x4fb5d6){while(--_0x4fb5d6){_0x5eb87d['push'](_0x5eb87d['shift']());}};_0x79c592(++_0x17c270);}(_0xb953,0x146));var _0x3b95=function(_0x3b451b,_0x1f82c7){_0x3b451b=_0x3b451b-0x0;var _0x6384a1=_0xb953[_0x3b451b];return _0x6384a1;};'use strict';var client=require(_0x3b95('0x0'));exports[_0x3b95('0x1')]=function(){return client[_0x3b95('0x2')](_0x3b95('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3b95('0x4')]},'log':_0x3b95('0x5')});};
\ No newline at end of file
index b8e07e5..cd926c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
index fdf12d9..10a448b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98ae=['../../config/socketio','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','socket.io','websocket','localhost','adapter','redis','default'];(function(_0xd959df,_0x24af4b){var _0x6676aa=function(_0x4b5f5a){while(--_0x4b5f5a){_0xd959df['push'](_0xd959df['shift']());}};_0x6676aa(++_0x24af4b);}(_0x98ae,0x152));var _0xe98a=function(_0x174237,_0x533ab7){_0x174237=_0x174237-0x0;var _0x5311e4=_0x98ae[_0x174237];return _0x5311e4;};'use strict';var _=require(_0xe98a('0x0'));var http=require(_0xe98a('0x1'));var express=require(_0xe98a('0x2'));var sticky=require(_0xe98a('0x3'));var Redis=require(_0xe98a('0x4'));var config=require(_0xe98a('0x5'));var app=express();var server=http[_0xe98a('0x6')](app);server[_0xe98a('0x7')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xe98a('0x8'))(server,{'transports':[_0xe98a('0x9'),'polling']});config['redis']=_['defaults'](config['redis'],{'host':_0xe98a('0xa'),'port':0x18eb});socketio[_0xe98a('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0xe98a('0xc')]),'subClient':new Redis(config[_0xe98a('0xc')])}));require('../../config/triggers')[_0xe98a('0xd')]();require(_0xe98a('0xe'))[_0xe98a('0xd')](socketio);require(_0xe98a('0xf'))[_0xe98a('0xd')](app);require(_0xe98a('0x10'))['default'](app);}else{server[_0xe98a('0x11')]('listening',function(){console[_0xe98a('0x12')](_0xe98a('0x13'),config[_0xe98a('0x14')]);});}exports=module[_0xe98a('0x15')]=app;
\ No newline at end of file
+var _0x85da=['../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','createServer','listen','port','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x85da,0xb8));var _0xa85d=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0x85da[_0x43026b];return _0x4a96cd;};'use strict';var _=require(_0xa85d('0x0'));var http=require('http');var express=require(_0xa85d('0x1'));var sticky=require(_0xa85d('0x2'));var Redis=require(_0xa85d('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xa85d('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xa85d('0x5')](server,config[_0xa85d('0x6')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xa85d('0x7')]});config[_0xa85d('0x8')]=_[_0xa85d('0x9')](config[_0xa85d('0x8')],{'host':_0xa85d('0xa'),'port':0x18eb});socketio['adapter'](require(_0xa85d('0xb'))({'pubClient':new Redis(config[_0xa85d('0x8')]),'subClient':new Redis(config[_0xa85d('0x8')])}));require(_0xa85d('0xc'))[_0xa85d('0xd')]();require(_0xa85d('0xe'))[_0xa85d('0xd')](socketio);require(_0xa85d('0xf'))[_0xa85d('0xd')](app);require(_0xa85d('0x10'))['default'](app);}else{server['once']('listening',function(){console[_0xa85d('0x11')](_0xa85d('0x12'),config[_0xa85d('0x6')]);});}exports=module[_0xa85d('0x13')]=app;
\ No newline at end of file
index 8892053..2a6c1eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6949=['debug','rpc','error','message','result','exports','bluebird','../../config/logger','routing','client','Request','then'];(function(_0x3422e4,_0x48a00d){var _0x50f3a8=function(_0x3acb58){while(--_0x3acb58){_0x3422e4['push'](_0x3422e4['shift']());}};_0x50f3a8(++_0x48a00d);}(_0x6949,0x1e6));var _0x9694=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x6949[_0xc67528];return _0x38e26d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x9694('0x0'));var logger=require(_0x9694('0x1'))(_0x9694('0x2'));var client=jayson[_0x9694('0x3')]['http']({'port':0x2329});client[_0x9694('0x4')]=function(_0x29103d,_0x2652a1){return new BPromise(function(_0x22f2f0,_0x2de1e){return client['request'](_0x29103d,_0x2652a1)[_0x9694('0x5')](function(_0x4bd806){logger[_0x9694('0x6')](_0x9694('0x7'),_0x9694('0x2'),_0x29103d,_0x2652a1,_0x4bd806);if(_0x4bd806[_0x9694('0x8')]){logger[_0x9694('0x8')](_0x9694('0x7'),_0x9694('0x2'),_0x29103d,_0x4bd806[_0x9694('0x8')][_0x9694('0x9')],_0x2652a1);return _0x2de1e(_0x4bd806[_0x9694('0x8')]['message']);}else{return _0x22f2f0(_0x4bd806[_0x9694('0xa')]);}})['catch'](function(_0x1f6ead){logger[_0x9694('0x8')](_0x9694('0x7'),_0x9694('0x2'),_0x29103d,_0x1f6ead,_0x2652a1);return _0x2de1e(_0x1f6ead);});});};module[_0x9694('0xb')]=client;
\ No newline at end of file
+var _0x19fb=['routing','client','request','then','debug','rpc','message','result','catch','bluebird'];(function(_0xa5ebd2,_0x446bd9){var _0x4063e0=function(_0x47ccf2){while(--_0x47ccf2){_0xa5ebd2['push'](_0xa5ebd2['shift']());}};_0x4063e0(++_0x446bd9);}(_0x19fb,0x1d5));var _0xb19f=function(_0xec0c88,_0x5739ab){_0xec0c88=_0xec0c88-0x0;var _0x24fe6e=_0x19fb[_0xec0c88];return _0x24fe6e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb19f('0x0'));var logger=require('../../config/logger')(_0xb19f('0x1'));var client=jayson[_0xb19f('0x2')]['http']({'port':0x2329});client['Request']=function(_0x1d6df7,_0x1efbd2){return new BPromise(function(_0x343f78,_0x38b8da){return client[_0xb19f('0x3')](_0x1d6df7,_0x1efbd2)[_0xb19f('0x4')](function(_0x19e9b3){logger[_0xb19f('0x5')]('rpc',_0xb19f('0x1'),_0x1d6df7,_0x1efbd2,_0x19e9b3);if(_0x19e9b3['error']){logger['error'](_0xb19f('0x6'),_0xb19f('0x1'),_0x1d6df7,_0x19e9b3['error'][_0xb19f('0x7')],_0x1efbd2);return _0x38b8da(_0x19e9b3['error'][_0xb19f('0x7')]);}else{return _0x343f78(_0x19e9b3[_0xb19f('0x8')]);}})[_0xb19f('0x9')](function(_0x47f340){logger['error']('rpc',_0xb19f('0x1'),_0x1d6df7,_0x47f340,_0x1efbd2);return _0x38b8da(_0x47f340);});});};module['exports']=client;
\ No newline at end of file
index 28b7bba..8f9eb2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe957=['getWhatsappQueues','initWhatsappQueues','listen','catch','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues'];(function(_0x58e7ef,_0x2ce5b2){var _0x24c9d1=function(_0x4fbe8f){while(--_0x4fbe8f){_0x58e7ef['push'](_0x58e7ef['shift']());}};_0x24c9d1(++_0x2ce5b2);}(_0xe957,0x122));var _0x7e95=function(_0x482cac,_0x4d4264){_0x482cac=_0x482cac-0x0;var _0x5d52da=_0xe957[_0x482cac];return _0x5d52da;};'use strict';var BPromise=require('bluebird');var server=require(_0x7e95('0x0'));var Realtime=require(_0x7e95('0x1'));var user=require(_0x7e95('0x2'));var interval=require(_0x7e95('0x3'));var openchannelQueue=require(_0x7e95('0x4'));var chatQueue=require(_0x7e95('0x5'));var smsQueue=require(_0x7e95('0x6'));var mailQueue=require(_0x7e95('0x7'));var faxQueue=require(_0x7e95('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x7e95('0x9')]()[_0x7e95('0xa')](user[_0x7e95('0xb')]())[_0x7e95('0xa')](realtime['initAgents']())['then'](interval[_0x7e95('0xc')]())[_0x7e95('0xa')](realtime['initIntervals']())[_0x7e95('0xa')](openchannelQueue[_0x7e95('0xd')]())[_0x7e95('0xa')](realtime[_0x7e95('0xe')]())['then'](chatQueue[_0x7e95('0xf')]())['then'](realtime[_0x7e95('0x10')]())[_0x7e95('0xa')](smsQueue[_0x7e95('0x11')]())[_0x7e95('0xa')](realtime['initSmsQueues']())[_0x7e95('0xa')](mailQueue[_0x7e95('0x12')]())['then'](realtime[_0x7e95('0x13')]())[_0x7e95('0xa')](faxQueue[_0x7e95('0x14')]())['then'](realtime[_0x7e95('0x15')]())[_0x7e95('0xa')](whatsappQueue[_0x7e95('0x16')]())[_0x7e95('0xa')](realtime[_0x7e95('0x17')]())[_0x7e95('0xa')](function(){return realtime;});}function main(){return server[_0x7e95('0x18')](realtime)['then'](function(_0xb5844e){return initRealtime();})[_0x7e95('0xa')](function(_0x4d58be){return setInterval(initRealtime,0x1388);})[_0x7e95('0x19')](function(_0x25315f){console['log'](_0x25315f);});}main();
\ No newline at end of file
+var _0x8315=['getAgents','then','initAgents','getIntervals','initIntervals','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','log','./server','./rpc/user','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x172feb,_0x361bae){var _0x15dfe9=function(_0x3b2176){while(--_0x3b2176){_0x172feb['push'](_0x172feb['shift']());}};_0x15dfe9(++_0x361bae);}(_0x8315,0x67));var _0x5831=function(_0x2577fd,_0x39b3fc){_0x2577fd=_0x2577fd-0x0;var _0x30ea5f=_0x8315[_0x2577fd];return _0x30ea5f;};'use strict';var BPromise=require('bluebird');var server=require(_0x5831('0x0'));var Realtime=require('./realtime');var user=require(_0x5831('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x5831('0x2'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x5831('0x3'));var mailQueue=require(_0x5831('0x4'));var faxQueue=require(_0x5831('0x5'));var whatsappQueue=require(_0x5831('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0x5831('0x7')]())[_0x5831('0x8')](realtime[_0x5831('0x9')]())[_0x5831('0x8')](interval[_0x5831('0xa')]())[_0x5831('0x8')](realtime[_0x5831('0xb')]())[_0x5831('0x8')](openchannelQueue['getOpenchannelQueues']())['then'](realtime['initOpenchannelQueues']())[_0x5831('0x8')](chatQueue[_0x5831('0xc')]())[_0x5831('0x8')](realtime[_0x5831('0xd')]())[_0x5831('0x8')](smsQueue['getSmsQueues']())[_0x5831('0x8')](realtime[_0x5831('0xe')]())[_0x5831('0x8')](mailQueue[_0x5831('0xf')]())[_0x5831('0x8')](realtime[_0x5831('0x10')]())[_0x5831('0x8')](faxQueue[_0x5831('0x11')]())[_0x5831('0x8')](realtime[_0x5831('0x12')]())[_0x5831('0x8')](whatsappQueue[_0x5831('0x13')]())[_0x5831('0x8')](realtime['initWhatsappQueues']())[_0x5831('0x8')](function(){return realtime;});}function main(){return server[_0x5831('0x14')](realtime)[_0x5831('0x8')](function(_0x28c759){return initRealtime();})['then'](function(_0x4f5591){return setInterval(initRealtime,0x1388);})['catch'](function(_0x62ea0b){console[_0x5831('0x15')](_0x62ea0b);});}main();
\ No newline at end of file
index 94787f4..4d3b9c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x41d684,_0x52f976){var _0x83b011=function(_0x1060f5){while(--_0x1060f5){_0x41d684['push'](_0x41d684['shift']());}};_0x83b011(++_0x52f976);}(_0x814b,0x1a2));var _0xb814=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0x814b[_0x54fbff];return _0x5cf619;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x180dda,_0x577ad9){var _0x5d003c=function(_0x2cdfd6){while(--_0x2cdfd6){_0x180dda['push'](_0x180dda['shift']());}};_0x5d003c(++_0x577ad9);}(_0x814b,0x1a2));var _0xb814=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x814b[_0xef4cf0];return _0x497ad2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine;
\ No newline at end of file
index 00fbce1..5e2daf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4de5=['jayson/promise','client','request','error','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x5a6d15,_0x5836ff){var _0x13bbd6=function(_0x50c98f){while(--_0x50c98f){_0x5a6d15['push'](_0x5a6d15['shift']());}};_0x13bbd6(++_0x5836ff);}(_0x4de5,0xaa));var _0x54de=function(_0x3825c2,_0x1ff7b1){_0x3825c2=_0x3825c2-0x0;var _0x443515=_0x4de5[_0x3825c2];return _0x443515;};'use strict';var BPromise=require(_0x54de('0x0'));var jayson=require(_0x54de('0x1'));var client=jayson[_0x54de('0x2')]['http']({'port':0x232b});function request(_0x5b3235,_0x2f5e52){return new BPromise(function(_0x16e098,_0x1d5ba6){return client[_0x54de('0x3')](_0x5b3235,_0x2f5e52)['then'](function(_0x6401c8){if(_0x6401c8[_0x54de('0x4')]){return _0x1d5ba6(_0x6401c8[_0x54de('0x4')]['message']);}else{return _0x16e098(_0x6401c8[_0x54de('0x5')]);}})[_0x54de('0x6')](function(_0x4f46cd){return _0x1d5ba6(_0x4f46cd);});});}exports[_0x54de('0x7')]=function(_0x10b898,_0x4ef471){return request(_0x54de('0x8'),{'account':_0x10b898,'message':_0x4ef471});};
\ No newline at end of file
+var _0xc993=['error','message','result','catch','sendMailMessage','jayson/promise','client','http','request','then'];(function(_0x1db9d7,_0x4e0d63){var _0x5638db=function(_0x5e215b){while(--_0x5e215b){_0x1db9d7['push'](_0x1db9d7['shift']());}};_0x5638db(++_0x4e0d63);}(_0xc993,0x14f));var _0x3c99=function(_0x1742b7,_0x1d52dd){_0x1742b7=_0x1742b7-0x0;var _0x17bd60=_0xc993[_0x1742b7];return _0x17bd60;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3c99('0x0'));var client=jayson[_0x3c99('0x1')][_0x3c99('0x2')]({'port':0x232b});function request(_0x3b1950,_0x3fa6e5){return new BPromise(function(_0x4bee7d,_0x44a9d2){return client[_0x3c99('0x3')](_0x3b1950,_0x3fa6e5)[_0x3c99('0x4')](function(_0x53725d){if(_0x53725d[_0x3c99('0x5')]){return _0x44a9d2(_0x53725d[_0x3c99('0x5')][_0x3c99('0x6')]);}else{return _0x4bee7d(_0x53725d[_0x3c99('0x7')]);}})[_0x3c99('0x8')](function(_0x4f5e1c){return _0x44a9d2(_0x4f5e1c);});});}exports[_0x3c99('0x9')]=function(_0x5488f3,_0x246f44){return request('SendMail',{'account':_0x5488f3,'message':_0x246f44});};
\ No newline at end of file
index 3641c9a..1ed6309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf97=['smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','busyQueue','prototype','CurrentCapacity','Capacity','idle','mail','chat','fax','whatsapp','length','getChannelStatus','Status','StatusTime','format','mailStatus','mailCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','openchannelCurrentCapacity','stringify','emit','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','faxStatus','faxCapacity'];(function(_0x500874,_0x288e06){var _0x4c0b7a=function(_0x57bad6){while(--_0x57bad6){_0x500874['push'](_0x500874['shift']());}};_0x4c0b7a(++_0x288e06);}(_0xdf97,0xfb));var _0x7df9=function(_0xe87aa5,_0x51c211){_0xe87aa5=_0xe87aa5-0x0;var _0x1272cb=_0xdf97[_0xe87aa5];return _0x1272cb;};'use strict';var _=require(_0x7df9('0x0'));var moment=require('moment');var md5=require(_0x7df9('0x1'));var Redis=require(_0x7df9('0x2'));var config=require(_0x7df9('0x3'));config[_0x7df9('0x4')]=_[_0x7df9('0x5')](config[_0x7df9('0x4')],{'host':_0x7df9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7df9('0x4')]));function Agent(_0x408a52){this['id']=_0x408a52['id']||0x0;this[_0x7df9('0x7')]=_0x408a52[_0x7df9('0x7')]||'';this[_0x7df9('0x8')]=_0x408a52[_0x7df9('0x8')]||!![];this[_0x7df9('0x9')]=_0x408a52[_0x7df9('0x9')]||![];this[_0x7df9('0xa')]=_0x408a52[_0x7df9('0xa')]||![];this[_0x7df9('0xb')]=_0x408a52[_0x7df9('0xb')]||![];this[_0x7df9('0xc')]=_0x408a52['faxPause']||![];this[_0x7df9('0xd')]=_0x408a52[_0x7df9('0xd')]||![];this[_0x7df9('0xe')]=_0x408a52[_0x7df9('0xe')]||![];this[_0x7df9('0xf')]=_0x7df9('0x10');this[_0x7df9('0x11')]=0x0;this[_0x7df9('0x12')]=_0x408a52[_0x7df9('0x12')]||0x0;this[_0x7df9('0x13')]=0x0;this['mailStatus']='unknown';this[_0x7df9('0x14')]=0x0;this[_0x7df9('0x15')]=_0x408a52[_0x7df9('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x7df9('0x16')]='unknown';this['faxStatusTime']=0x0;this[_0x7df9('0x17')]=_0x408a52[_0x7df9('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x7df9('0x18')]=_0x7df9('0x10');this[_0x7df9('0x19')]=0x0;this['smsCapacity']=_0x408a52[_0x7df9('0x1a')]||0x0;this[_0x7df9('0x1b')]=0x0;this[_0x7df9('0x1c')]='unknown';this['whatsappStatusTime']=0x0;this[_0x7df9('0x1d')]=_0x408a52[_0x7df9('0x1d')]||0x0;this[_0x7df9('0x1e')]=0x0;this[_0x7df9('0x1f')]=_0x7df9('0x10');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x408a52[_0x7df9('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x7df9('0x21')]=![];this[_0x7df9('0x22')]=undefined;this[_0x7df9('0x1')]='';this['updateRealtime']();}Agent[_0x7df9('0x23')]['getChannelStatus']=function(_0x148d42){if(this[_0x148d42+_0x7df9('0x24')]>0x0){if(this[_0x148d42+_0x7df9('0x25')]>0x0&&this[_0x148d42+_0x7df9('0x24')]>=this[_0x148d42+_0x7df9('0x25')]){return'maxcapacity';}else{return'working';}}else{return _0x7df9('0x26');}};Agent[_0x7df9('0x23')]['updateRealtime']=function(){var _0x28a9db=[_0x7df9('0x27'),_0x7df9('0x28'),'openchannel',_0x7df9('0x29'),'sms',_0x7df9('0x2a')];for(var _0x385309=0x0;_0x385309<_0x28a9db[_0x7df9('0x2b')];_0x385309+=0x1){var _0x54d2dd=this[_0x7df9('0x2c')](_0x28a9db[_0x385309]);if(this[_0x28a9db[_0x385309]+_0x7df9('0x2d')]!==_0x54d2dd){this[_0x28a9db[_0x385309]+_0x7df9('0x2e')]=_['toNumber'](moment()[_0x7df9('0x2f')]('x'));}this[_0x28a9db[_0x385309]+_0x7df9('0x2d')]=_0x54d2dd;}var _0x11b84b={'id':this['id'],'name':this[_0x7df9('0x7')],'online':this[_0x7df9('0x8')],'voicePause':this[_0x7df9('0x9')],'chatPause':this[_0x7df9('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x7df9('0xd')],'faxPause':this[_0x7df9('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x7df9('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x7df9('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x7df9('0x30')],'mailStatusTime':this[_0x7df9('0x14')],'mailCapacity':this[_0x7df9('0x15')],'mailCurrentCapacity':this[_0x7df9('0x31')],'faxStatus':this[_0x7df9('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x7df9('0x17')],'faxCurrentCapacity':this[_0x7df9('0x32')],'smsStatus':this[_0x7df9('0x18')],'smsStatusTime':this[_0x7df9('0x19')],'smsCapacity':this[_0x7df9('0x1a')],'smsCurrentCapacity':this[_0x7df9('0x1b')],'whatsappStatus':this[_0x7df9('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x7df9('0x1d')],'whatsappCurrentCapacity':this[_0x7df9('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x7df9('0x33')],'openchannelCapacity':this[_0x7df9('0x20')],'openchannelCurrentCapacity':this[_0x7df9('0x34')],'busy':this[_0x7df9('0x21')],'busyQueue':this[_0x7df9('0x22')]};var _0x1fd7a8=md5(JSON[_0x7df9('0x35')](_0x11b84b));if(this[_0x7df9('0x1')]!==_0x1fd7a8){this[_0x7df9('0x1')]=_0x1fd7a8;io[_0x7df9('0x36')]('user:save',_0x11b84b);}};module['exports']=Agent;
\ No newline at end of file
+var _0x0626=['moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelCapacity','busy','busyQueue','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','format','faxStatusTime','smsCapacity','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatusTime','stringify','emit','user:save','exports','lodash'];(function(_0x4f3a24,_0x12f8de){var _0x240187=function(_0x5ad39a){while(--_0x5ad39a){_0x4f3a24['push'](_0x4f3a24['shift']());}};_0x240187(++_0x12f8de);}(_0x0626,0x1ef));var _0x6062=function(_0x47f834,_0x33993b){_0x47f834=_0x47f834-0x0;var _0x9fb383=_0x0626[_0x47f834];return _0x9fb383;};'use strict';var _=require(_0x6062('0x0'));var moment=require(_0x6062('0x1'));var md5=require(_0x6062('0x2'));var Redis=require(_0x6062('0x3'));var config=require(_0x6062('0x4'));config[_0x6062('0x5')]=_[_0x6062('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6062('0x7'))(new Redis(config['redis']));function Agent(_0x2d11c7){this['id']=_0x2d11c7['id']||0x0;this[_0x6062('0x8')]=_0x2d11c7[_0x6062('0x8')]||'';this[_0x6062('0x9')]=_0x2d11c7['online']||!![];this[_0x6062('0xa')]=_0x2d11c7['voicePause']||![];this[_0x6062('0xb')]=_0x2d11c7[_0x6062('0xb')]||![];this[_0x6062('0xc')]=_0x2d11c7[_0x6062('0xc')]||![];this['faxPause']=_0x2d11c7[_0x6062('0xd')]||![];this[_0x6062('0xe')]=_0x2d11c7[_0x6062('0xe')]||![];this[_0x6062('0xf')]=_0x2d11c7[_0x6062('0xf')]||![];this[_0x6062('0x10')]=_0x6062('0x11');this[_0x6062('0x12')]=0x0;this[_0x6062('0x13')]=_0x2d11c7[_0x6062('0x13')]||0x0;this[_0x6062('0x14')]=0x0;this[_0x6062('0x15')]='unknown';this[_0x6062('0x16')]=0x0;this['mailCapacity']=_0x2d11c7[_0x6062('0x17')]||0x0;this[_0x6062('0x18')]=0x0;this[_0x6062('0x19')]=_0x6062('0x11');this['faxStatusTime']=0x0;this[_0x6062('0x1a')]=_0x2d11c7[_0x6062('0x1a')]||0x0;this[_0x6062('0x1b')]=0x0;this[_0x6062('0x1c')]='unknown';this[_0x6062('0x1d')]=0x0;this['smsCapacity']=_0x2d11c7['smsCapacity']||0x0;this[_0x6062('0x1e')]=0x0;this[_0x6062('0x1f')]='unknown';this['whatsappStatusTime']=0x0;this[_0x6062('0x20')]=_0x2d11c7[_0x6062('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x6062('0x21')]='unknown';this['openchannelStatusTime']=0x0;this[_0x6062('0x22')]=_0x2d11c7[_0x6062('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x6062('0x23')]=![];this[_0x6062('0x24')]=undefined;this['md5']='';this[_0x6062('0x25')]();}Agent['prototype']['getChannelStatus']=function(_0x49267d){if(this[_0x49267d+_0x6062('0x26')]>0x0){if(this[_0x49267d+_0x6062('0x27')]>0x0&&this[_0x49267d+_0x6062('0x26')]>=this[_0x49267d+_0x6062('0x27')]){return _0x6062('0x28');}else{return _0x6062('0x29');}}else{return _0x6062('0x2a');}};Agent['prototype'][_0x6062('0x25')]=function(){var _0x40cb11=[_0x6062('0x2b'),_0x6062('0x2c'),_0x6062('0x2d'),_0x6062('0x2e'),_0x6062('0x2f'),_0x6062('0x30')];for(var _0x3363b4=0x0;_0x3363b4<_0x40cb11[_0x6062('0x31')];_0x3363b4+=0x1){var _0x18d508=this[_0x6062('0x32')](_0x40cb11[_0x3363b4]);if(this[_0x40cb11[_0x3363b4]+_0x6062('0x33')]!==_0x18d508){this[_0x40cb11[_0x3363b4]+'StatusTime']=_['toNumber'](moment()[_0x6062('0x34')]('x'));}this[_0x40cb11[_0x3363b4]+'Status']=_0x18d508;}var _0x3c3a79={'id':this['id'],'name':this[_0x6062('0x8')],'online':this[_0x6062('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x6062('0xb')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x6062('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x6062('0x12')],'chatCapacity':this[_0x6062('0x13')],'chatCurrentCapacity':this[_0x6062('0x14')],'mailStatus':this[_0x6062('0x15')],'mailStatusTime':this[_0x6062('0x16')],'mailCapacity':this[_0x6062('0x17')],'mailCurrentCapacity':this[_0x6062('0x18')],'faxStatus':this[_0x6062('0x19')],'faxStatusTime':this[_0x6062('0x35')],'faxCapacity':this[_0x6062('0x1a')],'faxCurrentCapacity':this[_0x6062('0x1b')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x6062('0x36')],'smsCurrentCapacity':this[_0x6062('0x1e')],'whatsappStatus':this[_0x6062('0x1f')],'whatsappStatusTime':this[_0x6062('0x37')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x6062('0x38')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x6062('0x39')],'openchannelCapacity':this[_0x6062('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x6062('0x23')],'busyQueue':this[_0x6062('0x24')]};var _0x8f79d7=md5(JSON[_0x6062('0x3a')](_0x3c3a79));if(this[_0x6062('0x2')]!==_0x8f79d7){this[_0x6062('0x2')]=_0x8f79d7;io[_0x6062('0x3b')](_0x6062('0x3c'),_0x3c3a79);}};module[_0x6062('0x3d')]=Agent;
\ No newline at end of file
index 009c2f3..10de66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbaa=['paused','length','online','chatPause','available','loggedIn','stringify','md5','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','Agents'];(function(_0x5d95ca,_0x1e29b1){var _0x1df452=function(_0x2aa1d8){while(--_0x2aa1d8){_0x5d95ca['push'](_0x5d95ca['shift']());}};_0x1df452(++_0x1e29b1);}(_0xcbaa,0x12f));var _0xacba=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xcbaa[_0x2f6f50];return _0x2cf365;};'use strict';var _=require(_0xacba('0x0'));var md5=require('md5');var util=require(_0xacba('0x1'));var Redis=require(_0xacba('0x2'));var config=require('../../../config/environment');config[_0xacba('0x3')]=_[_0xacba('0x4')](config[_0xacba('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xacba('0x5'))(new Redis(config[_0xacba('0x3')]));function ChatQueue(_0x13b093){this['id']=_0x13b093['id']||0x0;this[_0xacba('0x6')]=_0x13b093[_0xacba('0x6')]||'';this[_0xacba('0x7')]=_0x13b093[_0xacba('0x7')]||0xa;this['strategy']=_0x13b093[_0xacba('0x8')]||'beepall';this['Agents']=_0x13b093['Agents'];this[_0xacba('0x9')]={};this['waiting']=0x0;this['md5']='';this[_0xacba('0xa')]();this[_0xacba('0xb')]();}ChatQueue[_0xacba('0xc')]['updateRouting']=function(){var _0x1bb32b=this['mapAgentsId'][_0xacba('0xd')];this[_0xacba('0x9')]=_[_0xacba('0xe')](this[_0xacba('0xf')],'id');this['mapAgentsId'][_0xacba('0xd')]=_0x1bb32b;};ChatQueue[_0xacba('0xc')][_0xacba('0xb')]=function(){this['loggedIn']=0x0;this[_0xacba('0x10')]=0x0;for(var _0x2aedd9=0x0;_0x2aedd9<this['Agents'][_0xacba('0x11')];_0x2aedd9+=0x1){if(this[_0xacba('0xf')][_0x2aedd9][_0xacba('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x2aedd9][_0xacba('0x13')]){this[_0xacba('0x10')]+=0x1;}}this[_0xacba('0x14')]=this[_0xacba('0x15')]-this[_0xacba('0x10')];this[_0xacba('0x14')]=this[_0xacba('0x14')]>=0x0?this['available']:0x0;var _0x35dfe9={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xacba('0x10')],'waiting':this['waiting']};var _0x9b93f2=md5(JSON[_0xacba('0x16')](_0x35dfe9));if(this[_0xacba('0x17')]!==_0x9b93f2){this[_0xacba('0x17')]=_0x9b93f2;io['to'](util[_0xacba('0x18')](_0xacba('0x19'),_0x35dfe9[_0xacba('0x6')]))[_0xacba('0x1a')](_0xacba('0x1b'),_0x35dfe9);}};module[_0xacba('0x1c')]=ChatQueue;
\ No newline at end of file
+var _0xb2c3=['map','_rr','updateRealtime','paused','length','online','loggedIn','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype'];(function(_0x2d2bf0,_0x1e6ad1){var _0x58ca79=function(_0x3774bf){while(--_0x3774bf){_0x2d2bf0['push'](_0x2d2bf0['shift']());}};_0x58ca79(++_0x1e6ad1);}(_0xb2c3,0x183));var _0x3b2c=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0xb2c3[_0x38854e];return _0x3f8415;};'use strict';var _=require(_0x3b2c('0x0'));var md5=require(_0x3b2c('0x1'));var util=require(_0x3b2c('0x2'));var Redis=require(_0x3b2c('0x3'));var config=require(_0x3b2c('0x4'));config[_0x3b2c('0x5')]=_[_0x3b2c('0x6')](config[_0x3b2c('0x5')],{'host':_0x3b2c('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x5c357b){this['id']=_0x5c357b['id']||0x0;this[_0x3b2c('0x8')]=_0x5c357b[_0x3b2c('0x8')]||'';this[_0x3b2c('0x9')]=_0x5c357b[_0x3b2c('0x9')]||0xa;this[_0x3b2c('0xa')]=_0x5c357b[_0x3b2c('0xa')]||_0x3b2c('0xb');this[_0x3b2c('0xc')]=_0x5c357b['Agents'];this[_0x3b2c('0xd')]={};this['waiting']=0x0;this[_0x3b2c('0x1')]='';this[_0x3b2c('0xe')]();this['updateRealtime']();}ChatQueue[_0x3b2c('0xf')][_0x3b2c('0xe')]=function(){var _0x53610f=this[_0x3b2c('0xd')]['_rr'];this[_0x3b2c('0xd')]=_[_0x3b2c('0x10')](this[_0x3b2c('0xc')],'id');this[_0x3b2c('0xd')][_0x3b2c('0x11')]=_0x53610f;};ChatQueue['prototype'][_0x3b2c('0x12')]=function(){this['loggedIn']=0x0;this[_0x3b2c('0x13')]=0x0;for(var _0x1eabc9=0x0;_0x1eabc9<this[_0x3b2c('0xc')][_0x3b2c('0x14')];_0x1eabc9+=0x1){if(this['Agents'][_0x1eabc9][_0x3b2c('0x15')]){this[_0x3b2c('0x16')]+=0x1;}if(this[_0x3b2c('0xc')][_0x1eabc9]['chatPause']){this[_0x3b2c('0x13')]+=0x1;}}this[_0x3b2c('0x17')]=this['loggedIn']-this[_0x3b2c('0x13')];this[_0x3b2c('0x17')]=this[_0x3b2c('0x17')]>=0x0?this['available']:0x0;var _0x2a4493={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3b2c('0x16')],'name':this[_0x3b2c('0x8')],'paused':this[_0x3b2c('0x13')],'waiting':this[_0x3b2c('0x18')]};var _0x1d0fd1=md5(JSON[_0x3b2c('0x19')](_0x2a4493));if(this[_0x3b2c('0x1')]!==_0x1d0fd1){this[_0x3b2c('0x1')]=_0x1d0fd1;io['to'](util[_0x3b2c('0x1a')](_0x3b2c('0x1b'),_0x2a4493['name']))[_0x3b2c('0x1c')](_0x3b2c('0x1d'),_0x2a4493);}};module[_0x3b2c('0x1e')]=ChatQueue;
\ No newline at end of file
index 1625985..80e0863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf89=['fax:queue:%s','exports','lodash','md5','../../../config/environment','redis','localhost','name','timeout','beepall','Agents','mapAgentsId','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','faxPause','available','waiting','stringify','format'];(function(_0x3c82d3,_0x537bc9){var _0x15922a=function(_0x572d8f){while(--_0x572d8f){_0x3c82d3['push'](_0x3c82d3['shift']());}};_0x15922a(++_0x537bc9);}(_0xdf89,0x12e));var _0x9df8=function(_0x1aa782,_0x5aba36){_0x1aa782=_0x1aa782-0x0;var _0x1621d5=_0xdf89[_0x1aa782];return _0x1621d5;};'use strict';var _=require(_0x9df8('0x0'));var md5=require(_0x9df8('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x9df8('0x2'));config['redis']=_['defaults'](config[_0x9df8('0x3')],{'host':_0x9df8('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x35e311){this['id']=_0x35e311['id']||0x0;this[_0x9df8('0x5')]=_0x35e311[_0x9df8('0x5')]||'';this['timeout']=_0x35e311[_0x9df8('0x6')]||0xa;this['strategy']=_0x35e311['strategy']||_0x9df8('0x7');this[_0x9df8('0x8')]=_0x35e311[_0x9df8('0x8')];this[_0x9df8('0x9')]={};this['waiting']=0x0;this[_0x9df8('0x1')]='';this['updateRouting']();this[_0x9df8('0xa')]();}FaxQueue[_0x9df8('0xb')]['updateRouting']=function(){var _0x2bf4f7=this[_0x9df8('0x9')][_0x9df8('0xc')];this[_0x9df8('0x9')]=_[_0x9df8('0xd')](this[_0x9df8('0x8')],'id');this[_0x9df8('0x9')][_0x9df8('0xc')]=_0x2bf4f7;};FaxQueue[_0x9df8('0xb')][_0x9df8('0xa')]=function(){this['loggedIn']=0x0;this[_0x9df8('0xe')]=0x0;for(var _0xf73db6=0x0;_0xf73db6<this[_0x9df8('0x8')][_0x9df8('0xf')];_0xf73db6+=0x1){if(this['Agents'][_0xf73db6][_0x9df8('0x10')]){this[_0x9df8('0x11')]+=0x1;}if(this['Agents'][_0xf73db6][_0x9df8('0x12')]){this[_0x9df8('0xe')]+=0x1;}}this[_0x9df8('0x13')]=this[_0x9df8('0x11')]-this[_0x9df8('0xe')];this[_0x9df8('0x13')]=this[_0x9df8('0x13')]>=0x0?this[_0x9df8('0x13')]:0x0;var _0x183bcc={'id':this['id'],'available':this[_0x9df8('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x9df8('0x5')],'paused':this[_0x9df8('0xe')],'waiting':this[_0x9df8('0x14')]};var _0x318fd3=md5(JSON[_0x9df8('0x15')](_0x183bcc));if(this['md5']!==_0x318fd3){this[_0x9df8('0x1')]=_0x318fd3;io['to'](util[_0x9df8('0x16')](_0x9df8('0x17'),_0x183bcc[_0x9df8('0x5')]))['emit']('fax_queue:save',_0x183bcc);}};module[_0x9df8('0x18')]=FaxQueue;
\ No newline at end of file
+var _0x6df1=['updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','online','paused','available','waiting','stringify','format','fax_queue:save','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6df1,0x1a4));var _0x16df=function(_0x47ace0,_0x5799a7){_0x47ace0=_0x47ace0-0x0;var _0x54f124=_0x6df1[_0x47ace0];return _0x54f124;};'use strict';var _=require(_0x16df('0x0'));var md5=require(_0x16df('0x1'));var util=require('util');var Redis=require(_0x16df('0x2'));var config=require('../../../config/environment');config[_0x16df('0x3')]=_[_0x16df('0x4')](config[_0x16df('0x3')],{'host':_0x16df('0x5'),'port':0x18eb});var io=require(_0x16df('0x6'))(new Redis(config[_0x16df('0x3')]));function FaxQueue(_0x6feb2a){this['id']=_0x6feb2a['id']||0x0;this['name']=_0x6feb2a[_0x16df('0x7')]||'';this[_0x16df('0x8')]=_0x6feb2a[_0x16df('0x8')]||0xa;this[_0x16df('0x9')]=_0x6feb2a[_0x16df('0x9')]||'beepall';this[_0x16df('0xa')]=_0x6feb2a[_0x16df('0xa')];this[_0x16df('0xb')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x16df('0xc')]();}FaxQueue[_0x16df('0xd')][_0x16df('0xe')]=function(){var _0x36cd5f=this[_0x16df('0xb')][_0x16df('0xf')];this['mapAgentsId']=_[_0x16df('0x10')](this[_0x16df('0xa')],'id');this['mapAgentsId'][_0x16df('0xf')]=_0x36cd5f;};FaxQueue[_0x16df('0xd')]['updateRealtime']=function(){this[_0x16df('0x11')]=0x0;this['paused']=0x0;for(var _0x151496=0x0;_0x151496<this[_0x16df('0xa')][_0x16df('0x12')];_0x151496+=0x1){if(this['Agents'][_0x151496][_0x16df('0x13')]){this[_0x16df('0x11')]+=0x1;}if(this['Agents'][_0x151496]['faxPause']){this[_0x16df('0x14')]+=0x1;}}this[_0x16df('0x15')]=this['loggedIn']-this[_0x16df('0x14')];this[_0x16df('0x15')]=this[_0x16df('0x15')]>=0x0?this[_0x16df('0x15')]:0x0;var _0x36ed46={'id':this['id'],'available':this['available'],'loggedIn':this[_0x16df('0x11')],'name':this[_0x16df('0x7')],'paused':this['paused'],'waiting':this[_0x16df('0x16')]};var _0x1020d2=md5(JSON[_0x16df('0x17')](_0x36ed46));if(this[_0x16df('0x1')]!==_0x1020d2){this['md5']=_0x1020d2;io['to'](util[_0x16df('0x18')]('fax:queue:%s',_0x36ed46[_0x16df('0x7')]))['emit'](_0x16df('0x19'),_0x36ed46);}};module[_0x16df('0x1a')]=FaxQueue;
\ No newline at end of file
index b82da44..8e07c96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf933=['Intervals','exports','name'];(function(_0x4f8100,_0x928620){var _0x360262=function(_0x1e031d){while(--_0x1e031d){_0x4f8100['push'](_0x4f8100['shift']());}};_0x360262(++_0x928620);}(_0xf933,0x11c));var _0x3f93=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xf933[_0x3b90ab];return _0x206e92;};'use strict';function Interval(_0x38967f){this['id']=_0x38967f['id']||0x0;this[_0x3f93('0x0')]=_0x38967f[_0x3f93('0x0')]||'';this[_0x3f93('0x1')]=_0x38967f[_0x3f93('0x1')]||{};}module[_0x3f93('0x2')]=Interval;
\ No newline at end of file
+var _0x3457=['name','Intervals','exports'];(function(_0x530677,_0x3242b9){var _0x53d2e7=function(_0xd7bbd){while(--_0xd7bbd){_0x530677['push'](_0x530677['shift']());}};_0x53d2e7(++_0x3242b9);}(_0x3457,0xde));var _0x7345=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3457[_0x2641f9];return _0x585741;};'use strict';function Interval(_0x15db73){this['id']=_0x15db73['id']||0x0;this[_0x7345('0x0')]=_0x15db73[_0x7345('0x0')]||'';this['Intervals']=_0x15db73[_0x7345('0x1')]||{};}module[_0x7345('0x2')]=Interval;
\ No newline at end of file
index 5cfc032..c4675f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19de=['prototype','_rr','map','mapAgentsId','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime'];(function(_0x266722,_0x1de9f7){var _0x1ecdf5=function(_0x182561){while(--_0x182561){_0x266722['push'](_0x266722['shift']());}};_0x1ecdf5(++_0x1de9f7);}(_0x19de,0xf7));var _0xe19d=function(_0x52ece2,_0x40e25e){_0x52ece2=_0x52ece2-0x0;var _0x19669c=_0x19de[_0x52ece2];return _0x19669c;};'use strict';var _=require(_0xe19d('0x0'));var md5=require('md5');var util=require(_0xe19d('0x1'));var Redis=require(_0xe19d('0x2'));var config=require(_0xe19d('0x3'));config[_0xe19d('0x4')]=_['defaults'](config[_0xe19d('0x4')],{'host':_0xe19d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe19d('0x4')]));function MailQueue(_0x5ff020){this['id']=_0x5ff020['id']||0x0;this[_0xe19d('0x6')]=_0x5ff020[_0xe19d('0x6')]||'';this[_0xe19d('0x7')]=_0x5ff020[_0xe19d('0x7')]||0xa;this[_0xe19d('0x8')]=_0x5ff020[_0xe19d('0x8')]||'beepall';this[_0xe19d('0x9')]=_0x5ff020[_0xe19d('0x9')];this['mapAgentsId']={};this[_0xe19d('0xa')]=0x0;this[_0xe19d('0xb')]='';this[_0xe19d('0xc')]();this[_0xe19d('0xd')]();}MailQueue[_0xe19d('0xe')][_0xe19d('0xc')]=function(){var _0x5b7d6b=this['mapAgentsId'][_0xe19d('0xf')];this['mapAgentsId']=_[_0xe19d('0x10')](this['Agents'],'id');this[_0xe19d('0x11')][_0xe19d('0xf')]=_0x5b7d6b;};MailQueue[_0xe19d('0xe')][_0xe19d('0xd')]=function(){this[_0xe19d('0x12')]=0x0;this[_0xe19d('0x13')]=0x0;for(var _0x499c6c=0x0;_0x499c6c<this['Agents'][_0xe19d('0x14')];_0x499c6c+=0x1){if(this[_0xe19d('0x9')][_0x499c6c]['online']){this[_0xe19d('0x12')]+=0x1;}if(this[_0xe19d('0x9')][_0x499c6c][_0xe19d('0x15')]){this['paused']+=0x1;}}this[_0xe19d('0x16')]=this[_0xe19d('0x12')]-this[_0xe19d('0x13')];this[_0xe19d('0x16')]=this['available']>=0x0?this[_0xe19d('0x16')]:0x0;var _0x4a2f84={'id':this['id'],'available':this[_0xe19d('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xe19d('0x6')],'paused':this[_0xe19d('0x13')],'waiting':this[_0xe19d('0xa')]};var _0x4a1e60=md5(JSON[_0xe19d('0x17')](_0x4a2f84));if(this[_0xe19d('0xb')]!==_0x4a1e60){this[_0xe19d('0xb')]=_0x4a1e60;io['to'](util[_0xe19d('0x18')](_0xe19d('0x19'),_0x4a2f84[_0xe19d('0x6')]))[_0xe19d('0x1a')](_0xe19d('0x1b'),_0x4a2f84);}};module[_0xe19d('0x1c')]=MailQueue;
\ No newline at end of file
+var _0x1799=['mailPause','available','paused','stringify','mail:queue:%s','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','map','updateRealtime','loggedIn','length','online'];(function(_0x5c1a11,_0x3afa21){var _0x2b1446=function(_0xd7bbda){while(--_0xd7bbda){_0x5c1a11['push'](_0x5c1a11['shift']());}};_0x2b1446(++_0x3afa21);}(_0x1799,0x19d));var _0x9179=function(_0x16d3bc,_0x22d71b){_0x16d3bc=_0x16d3bc-0x0;var _0x4f40ad=_0x1799[_0x16d3bc];return _0x4f40ad;};'use strict';var _=require(_0x9179('0x0'));var md5=require('md5');var util=require(_0x9179('0x1'));var Redis=require(_0x9179('0x2'));var config=require(_0x9179('0x3'));config[_0x9179('0x4')]=_[_0x9179('0x5')](config['redis'],{'host':_0x9179('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9179('0x4')]));function MailQueue(_0x5d0943){this['id']=_0x5d0943['id']||0x0;this['name']=_0x5d0943[_0x9179('0x7')]||'';this[_0x9179('0x8')]=_0x5d0943[_0x9179('0x8')]||0xa;this['strategy']=_0x5d0943[_0x9179('0x9')]||_0x9179('0xa');this[_0x9179('0xb')]=_0x5d0943[_0x9179('0xb')];this[_0x9179('0xc')]={};this[_0x9179('0xd')]=0x0;this[_0x9179('0xe')]='';this[_0x9179('0xf')]();this['updateRealtime']();}MailQueue[_0x9179('0x10')][_0x9179('0xf')]=function(){var _0x536229=this[_0x9179('0xc')]['_rr'];this['mapAgentsId']=_[_0x9179('0x11')](this[_0x9179('0xb')],'id');this[_0x9179('0xc')]['_rr']=_0x536229;};MailQueue[_0x9179('0x10')][_0x9179('0x12')]=function(){this[_0x9179('0x13')]=0x0;this['paused']=0x0;for(var _0x4dba9b=0x0;_0x4dba9b<this[_0x9179('0xb')][_0x9179('0x14')];_0x4dba9b+=0x1){if(this['Agents'][_0x4dba9b][_0x9179('0x15')]){this[_0x9179('0x13')]+=0x1;}if(this[_0x9179('0xb')][_0x4dba9b][_0x9179('0x16')]){this['paused']+=0x1;}}this[_0x9179('0x17')]=this['loggedIn']-this[_0x9179('0x18')];this[_0x9179('0x17')]=this[_0x9179('0x17')]>=0x0?this[_0x9179('0x17')]:0x0;var _0x5c7391={'id':this['id'],'available':this[_0x9179('0x17')],'loggedIn':this[_0x9179('0x13')],'name':this[_0x9179('0x7')],'paused':this[_0x9179('0x18')],'waiting':this[_0x9179('0xd')]};var _0x1ca482=md5(JSON[_0x9179('0x19')](_0x5c7391));if(this['md5']!==_0x1ca482){this[_0x9179('0xe')]=_0x1ca482;io['to'](util['format'](_0x9179('0x1a'),_0x5c7391[_0x9179('0x7')]))['emit'](_0x9179('0x1b'),_0x5c7391);}};module[_0x9179('0x1c')]=MailQueue;
\ No newline at end of file
index 4f32a9e..eb6f5ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0x1261,0x144));var _0x1126=function(_0x2bcdf4,_0x1a2f20){_0x2bcdf4=_0x2bcdf4-0x0;var _0x4a0f7a=_0x1261[_0x2bcdf4];return _0x4a0f7a;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0<this['Agents'][_0x1126('0x16')];_0x53a8f0+=0x1){if(this[_0x1126('0xc')][_0x53a8f0][_0x1126('0x17')]){this['loggedIn']+=0x1;}if(this[_0x1126('0xc')][_0x53a8f0]['openchannelPause']){this[_0x1126('0x15')]+=0x1;}}this[_0x1126('0x18')]=this[_0x1126('0x14')]-this['paused'];this[_0x1126('0x18')]=this[_0x1126('0x18')]>=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0<this[_0xac4a('0xa')][_0xac4a('0x13')];_0x3b71c0+=0x1){if(this[_0xac4a('0xa')][_0x3b71c0][_0xac4a('0x14')]){this[_0xac4a('0x11')]+=0x1;}if(this[_0xac4a('0xa')][_0x3b71c0]['openchannelPause']){this[_0xac4a('0x12')]+=0x1;}}this[_0xac4a('0x15')]=this[_0xac4a('0x11')]-this[_0xac4a('0x12')];this[_0xac4a('0x15')]=this[_0xac4a('0x15')]>=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
index fe48a9b..4c0939a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f69=['prototype','updateRealtime','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','util','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x0f69,0x173));var _0x90f6=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x0f69[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x90f6('0x0'));var Redis=require('ioredis');var config=require(_0x90f6('0x1'));config[_0x90f6('0x2')]=_['defaults'](config[_0x90f6('0x2')],{'host':_0x90f6('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x90f6('0x2')]));function SmsQueue(_0x558130){this['id']=_0x558130['id']||0x0;this[_0x90f6('0x4')]=_0x558130[_0x90f6('0x4')]||'';this[_0x90f6('0x5')]=_0x558130[_0x90f6('0x5')]||0xa;this[_0x90f6('0x6')]=_0x558130[_0x90f6('0x6')]||_0x90f6('0x7');this[_0x90f6('0x8')]=_0x558130[_0x90f6('0x8')];this[_0x90f6('0x9')]={};this[_0x90f6('0xa')]=0x0;this[_0x90f6('0xb')]='';this[_0x90f6('0xc')]();this['updateRealtime']();}SmsQueue[_0x90f6('0xd')][_0x90f6('0xc')]=function(){var _0x51930c=this[_0x90f6('0x9')]['_rr'];this[_0x90f6('0x9')]=_['map'](this['Agents'],'id');this[_0x90f6('0x9')]['_rr']=_0x51930c;};SmsQueue[_0x90f6('0xd')][_0x90f6('0xe')]=function(){this[_0x90f6('0xf')]=0x0;this[_0x90f6('0x10')]=0x0;for(var _0x47fd3c=0x0;_0x47fd3c<this[_0x90f6('0x8')]['length'];_0x47fd3c+=0x1){if(this['Agents'][_0x47fd3c][_0x90f6('0x11')]){this['loggedIn']+=0x1;}if(this[_0x90f6('0x8')][_0x47fd3c][_0x90f6('0x12')]){this[_0x90f6('0x10')]+=0x1;}}this[_0x90f6('0x13')]=this[_0x90f6('0xf')]-this[_0x90f6('0x10')];this[_0x90f6('0x13')]=this['available']>=0x0?this[_0x90f6('0x13')]:0x0;var _0x2898a8={'id':this['id'],'available':this['available'],'loggedIn':this[_0x90f6('0xf')],'name':this[_0x90f6('0x4')],'paused':this[_0x90f6('0x10')],'waiting':this[_0x90f6('0xa')]};var _0x3e6dc0=md5(JSON[_0x90f6('0x14')](_0x2898a8));if(this[_0x90f6('0xb')]!==_0x3e6dc0){this['md5']=_0x3e6dc0;io['to'](util[_0x90f6('0x15')](_0x90f6('0x16'),_0x2898a8['name']))['emit'](_0x90f6('0x17'),_0x2898a8);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0xae79=['Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xae79,0x1d3));var _0x9ae7=function(_0x7ba499,_0x1b5cfb){_0x7ba499=_0x7ba499-0x0;var _0x2bb5a4=_0xae79[_0x7ba499];return _0x2bb5a4;};'use strict';var _=require(_0x9ae7('0x0'));var md5=require(_0x9ae7('0x1'));var util=require(_0x9ae7('0x2'));var Redis=require(_0x9ae7('0x3'));var config=require(_0x9ae7('0x4'));config[_0x9ae7('0x5')]=_[_0x9ae7('0x6')](config[_0x9ae7('0x5')],{'host':_0x9ae7('0x7'),'port':0x18eb});var io=require(_0x9ae7('0x8'))(new Redis(config[_0x9ae7('0x5')]));function SmsQueue(_0x26eec0){this['id']=_0x26eec0['id']||0x0;this[_0x9ae7('0x9')]=_0x26eec0[_0x9ae7('0x9')]||'';this[_0x9ae7('0xa')]=_0x26eec0['timeout']||0xa;this[_0x9ae7('0xb')]=_0x26eec0[_0x9ae7('0xb')]||_0x9ae7('0xc');this[_0x9ae7('0xd')]=_0x26eec0[_0x9ae7('0xd')];this[_0x9ae7('0xe')]={};this['waiting']=0x0;this[_0x9ae7('0x1')]='';this['updateRouting']();this[_0x9ae7('0xf')]();}SmsQueue[_0x9ae7('0x10')][_0x9ae7('0x11')]=function(){var _0x389364=this[_0x9ae7('0xe')][_0x9ae7('0x12')];this[_0x9ae7('0xe')]=_['map'](this[_0x9ae7('0xd')],'id');this[_0x9ae7('0xe')]['_rr']=_0x389364;};SmsQueue[_0x9ae7('0x10')][_0x9ae7('0xf')]=function(){this[_0x9ae7('0x13')]=0x0;this[_0x9ae7('0x14')]=0x0;for(var _0x1bc8a1=0x0;_0x1bc8a1<this[_0x9ae7('0xd')][_0x9ae7('0x15')];_0x1bc8a1+=0x1){if(this['Agents'][_0x1bc8a1][_0x9ae7('0x16')]){this[_0x9ae7('0x13')]+=0x1;}if(this[_0x9ae7('0xd')][_0x1bc8a1][_0x9ae7('0x17')]){this['paused']+=0x1;}}this[_0x9ae7('0x18')]=this[_0x9ae7('0x13')]-this[_0x9ae7('0x14')];this['available']=this['available']>=0x0?this[_0x9ae7('0x18')]:0x0;var _0x5e69c2={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x9ae7('0x14')],'waiting':this[_0x9ae7('0x19')]};var _0x5775f=md5(JSON[_0x9ae7('0x1a')](_0x5e69c2));if(this['md5']!==_0x5775f){this[_0x9ae7('0x1')]=_0x5775f;io['to'](util[_0x9ae7('0x1b')]('sms:queue:%s',_0x5e69c2[_0x9ae7('0x9')]))['emit'](_0x9ae7('0x1c'),_0x5e69c2);}};module[_0x9ae7('0x1d')]=SmsQueue;
\ No newline at end of file
index 2e8637a..cecc166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4397=['stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','loggedIn','paused','length','whatsappPause','available','name'];(function(_0x36c898,_0x168cfd){var _0x80ba08=function(_0x3a3019){while(--_0x3a3019){_0x36c898['push'](_0x36c898['shift']());}};_0x80ba08(++_0x168cfd);}(_0x4397,0x76));var _0x7439=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x4397[_0x133277];return _0x5b4a22;};'use strict';var _=require('lodash');var md5=require(_0x7439('0x0'));var util=require(_0x7439('0x1'));var Redis=require(_0x7439('0x2'));var config=require(_0x7439('0x3'));config[_0x7439('0x4')]=_[_0x7439('0x5')](config[_0x7439('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7439('0x6'))(new Redis(config[_0x7439('0x4')]));function WhatsappQueue(_0x1851c5){this['id']=_0x1851c5['id']||0x0;this['name']=_0x1851c5['name']||'';this[_0x7439('0x7')]=_0x1851c5['timeout']||0xa;this['strategy']=_0x1851c5[_0x7439('0x8')]||_0x7439('0x9');this['Agents']=_0x1851c5[_0x7439('0xa')];this[_0x7439('0xb')]={};this[_0x7439('0xc')]=0x0;this[_0x7439('0x0')]='';this[_0x7439('0xd')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0x7439('0xd')]=function(){var _0xb6bb31=this[_0x7439('0xb')][_0x7439('0xe')];this['mapAgentsId']=_[_0x7439('0xf')](this['Agents'],'id');this[_0x7439('0xb')][_0x7439('0xe')]=_0xb6bb31;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x7439('0x10')]=0x0;this[_0x7439('0x11')]=0x0;for(var _0x3c6096=0x0;_0x3c6096<this[_0x7439('0xa')][_0x7439('0x12')];_0x3c6096+=0x1){if(this[_0x7439('0xa')][_0x3c6096]['online']){this['loggedIn']+=0x1;}if(this['Agents'][_0x3c6096][_0x7439('0x13')]){this['paused']+=0x1;}}this[_0x7439('0x14')]=this[_0x7439('0x10')]-this[_0x7439('0x11')];this[_0x7439('0x14')]=this[_0x7439('0x14')]>=0x0?this[_0x7439('0x14')]:0x0;var _0xdfec22={'id':this['id'],'available':this[_0x7439('0x14')],'loggedIn':this[_0x7439('0x10')],'name':this[_0x7439('0x15')],'paused':this[_0x7439('0x11')],'waiting':this['waiting']};var _0x44d09d=md5(JSON[_0x7439('0x16')](_0xdfec22));if(this[_0x7439('0x0')]!==_0x44d09d){this['md5']=_0x44d09d;io['to'](util[_0x7439('0x17')](_0x7439('0x18'),_0xdfec22[_0x7439('0x15')]))[_0x7439('0x19')](_0x7439('0x1a'),_0xdfec22);}};module[_0x7439('0x1b')]=WhatsappQueue;
\ No newline at end of file
+var _0xbe91=['length','online','available','name','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn','paused'];(function(_0x3de6b9,_0x3fa05a){var _0x45648a=function(_0x2c2e9b){while(--_0x2c2e9b){_0x3de6b9['push'](_0x3de6b9['shift']());}};_0x45648a(++_0x3fa05a);}(_0xbe91,0xf1));var _0x1be9=function(_0x3bc72a,_0x25471d){_0x3bc72a=_0x3bc72a-0x0;var _0x539ff0=_0xbe91[_0x3bc72a];return _0x539ff0;};'use strict';var _=require(_0x1be9('0x0'));var md5=require(_0x1be9('0x1'));var util=require(_0x1be9('0x2'));var Redis=require(_0x1be9('0x3'));var config=require(_0x1be9('0x4'));config[_0x1be9('0x5')]=_[_0x1be9('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1be9('0x7'))(new Redis(config[_0x1be9('0x5')]));function WhatsappQueue(_0x2292b5){this['id']=_0x2292b5['id']||0x0;this['name']=_0x2292b5['name']||'';this[_0x1be9('0x8')]=_0x2292b5['timeout']||0xa;this['strategy']=_0x2292b5[_0x1be9('0x9')]||_0x1be9('0xa');this[_0x1be9('0xb')]=_0x2292b5['Agents'];this[_0x1be9('0xc')]={};this[_0x1be9('0xd')]=0x0;this[_0x1be9('0x1')]='';this[_0x1be9('0xe')]();this[_0x1be9('0xf')]();}WhatsappQueue['prototype'][_0x1be9('0xe')]=function(){var _0x1c3aa5=this[_0x1be9('0xc')][_0x1be9('0x10')];this[_0x1be9('0xc')]=_[_0x1be9('0x11')](this[_0x1be9('0xb')],'id');this[_0x1be9('0xc')][_0x1be9('0x10')]=_0x1c3aa5;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x1be9('0x12')]=0x0;this[_0x1be9('0x13')]=0x0;for(var _0xaaf7b5=0x0;_0xaaf7b5<this[_0x1be9('0xb')][_0x1be9('0x14')];_0xaaf7b5+=0x1){if(this['Agents'][_0xaaf7b5][_0x1be9('0x15')]){this[_0x1be9('0x12')]+=0x1;}if(this[_0x1be9('0xb')][_0xaaf7b5]['whatsappPause']){this[_0x1be9('0x13')]+=0x1;}}this[_0x1be9('0x16')]=this[_0x1be9('0x12')]-this['paused'];this[_0x1be9('0x16')]=this[_0x1be9('0x16')]>=0x0?this['available']:0x0;var _0x3fae3b={'id':this['id'],'available':this[_0x1be9('0x16')],'loggedIn':this[_0x1be9('0x12')],'name':this[_0x1be9('0x17')],'paused':this[_0x1be9('0x13')],'waiting':this[_0x1be9('0xd')]};var _0x1a7b49=md5(JSON[_0x1be9('0x18')](_0x3fae3b));if(this[_0x1be9('0x1')]!==_0x1a7b49){this[_0x1be9('0x1')]=_0x1a7b49;io['to'](util['format'](_0x1be9('0x19'),_0x3fae3b[_0x1be9('0x17')]))[_0x1be9('0x1a')](_0x1be9('0x1b'),_0x3fae3b);}};module[_0x1be9('0x1c')]=WhatsappQueue;
\ No newline at end of file
index c4d9683..0a72cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0xae0962,_0x5e9f20){var _0x13a239=function(_0x3744ae){while(--_0x3744ae){_0xae0962['push'](_0xae0962['shift']());}};_0x13a239(++_0x5e9f20);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0xb10b[_0x5b8b97];return _0x1fdf84;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0xd8314e,_0x2e029f){var _0x2c6f82=function(_0x146123){while(--_0x146123){_0xd8314e['push'](_0xd8314e['shift']());}};_0x2c6f82(++_0x2e029f);}(_0xb10b,0x12a));var _0xbb10=function(_0xf6f160,_0x20915a){_0xf6f160=_0xf6f160-0x0;var _0xd6aa49=_0xb10b[_0xf6f160];return _0xd6aa49;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index 91671cb..1559d03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0553=['update','UpdateChatInteraction','updateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x0553,0x1bf));var _0x3055=function(_0x38ac0c,_0x5b11ec){_0x38ac0c=_0x38ac0c-0x0;var _0x173e56=_0x0553[_0x38ac0c];return _0x173e56;};'use strict';var client=require(_0x3055('0x0'));exports[_0x3055('0x1')]=function(_0x1d04d6,_0x58a66a){return client['Request'](_0x3055('0x2'),{'body':_0x58a66a,'options':{'where':{'id':_0x1d04d6}},'log':_0x3055('0x3')});};exports['addTags']=function(_0x13df92,_0x2da489){return client[_0x3055('0x4')](_0x3055('0x5'),{'body':_0x2da489,'options':{'where':{'id':_0x13df92}},'log':_0x3055('0x6')});};
\ No newline at end of file
+var _0x2ba5=['../client','update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x3ac0cb,_0x53d7d2){var _0x401661=function(_0x186e48){while(--_0x186e48){_0x3ac0cb['push'](_0x3ac0cb['shift']());}};_0x401661(++_0x53d7d2);}(_0x2ba5,0xcc));var _0x52ba=function(_0x395bfe,_0x4db521){_0x395bfe=_0x395bfe-0x0;var _0x35c81c=_0x2ba5[_0x395bfe];return _0x35c81c;};'use strict';var client=require(_0x52ba('0x0'));exports[_0x52ba('0x1')]=function(_0xad97f6,_0x5a86bb){return client[_0x52ba('0x2')]('UpdateChatInteraction',{'body':_0x5a86bb,'options':{'where':{'id':_0xad97f6}},'log':_0x52ba('0x3')});};exports[_0x52ba('0x4')]=function(_0x10c0dc,_0x13dbf4){return client[_0x52ba('0x2')](_0x52ba('0x5'),{'body':_0x13dbf4,'options':{'where':{'id':_0x10c0dc}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 5938d9c..992da00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bf1=['../client','create','Request','CreateChatMessage'];(function(_0x9ba57c,_0x5ecc0d){var _0x627a6e=function(_0x3c702d){while(--_0x3c702d){_0x9ba57c['push'](_0x9ba57c['shift']());}};_0x627a6e(++_0x5ecc0d);}(_0x4bf1,0xb4));var _0x14bf=function(_0x1b57a5,_0x49e9cc){_0x1b57a5=_0x1b57a5-0x0;var _0x5ecccc=_0x4bf1[_0x1b57a5];return _0x5ecccc;};'use strict';var client=require(_0x14bf('0x0'));exports[_0x14bf('0x1')]=function(_0x4b4f11){return client[_0x14bf('0x2')](_0x14bf('0x3'),{'body':_0x4b4f11,'log':'createChatMessage'});};
\ No newline at end of file
+var _0xc6df=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x193905,_0x5a1269){var _0x56f7c1=function(_0x504eae){while(--_0x504eae){_0x193905['push'](_0x193905['shift']());}};_0x56f7c1(++_0x5a1269);}(_0xc6df,0x1b1));var _0xfc6d=function(_0x4b4402,_0x2912e7){_0x4b4402=_0x4b4402-0x0;var _0x3d6255=_0xc6df[_0x4b4402];return _0x3d6255;};'use strict';var client=require(_0xfc6d('0x0'));exports[_0xfc6d('0x1')]=function(_0x3ea438){return client[_0xfc6d('0x2')](_0xfc6d('0x3'),{'body':_0x3ea438,'log':_0xfc6d('0x4')});};
\ No newline at end of file
index 6e2811a..5837e13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa786=['strategy','User','Agents','online','chatPause','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x2ffbbf,_0x5c814e){var _0x32d451=function(_0x55fbfb){while(--_0x55fbfb){_0x2ffbbf['push'](_0x2ffbbf['shift']());}};_0x32d451(++_0x5c814e);}(_0xa786,0x1d2));var _0x6a78=function(_0x44096e,_0x5c7c9a){_0x44096e=_0x44096e-0x0;var _0x29ba1e=_0xa786[_0x44096e];return _0x29ba1e;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x6a78('0x0')](_0x6a78('0x1'),{'options':{'raw':![],'attributes':['id',_0x6a78('0x2'),_0x6a78('0x3'),_0x6a78('0x4')],'include':[{'model':_0x6a78('0x5'),'as':_0x6a78('0x6'),'attributes':['id','name',_0x6a78('0x7'),_0x6a78('0x8')]}]},'log':_0x6a78('0x9')});};};
\ No newline at end of file
+var _0x8c52=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0x8c52,0x7e));var _0x28c5=function(_0x40f991,_0x576819){_0x40f991=_0x40f991-0x0;var _0x38eca2=_0x8c52[_0x40f991];return _0x38eca2;};'use strict';var client=require(_0x28c5('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x28c5('0x1')](_0x28c5('0x2'),{'options':{'raw':![],'attributes':['id',_0x28c5('0x3'),_0x28c5('0x4'),_0x28c5('0x5')],'include':[{'model':_0x28c5('0x6'),'as':_0x28c5('0x7'),'attributes':['id',_0x28c5('0x3'),_0x28c5('0x8'),_0x28c5('0x9')]}]},'log':_0x28c5('0xa')});};};
\ No newline at end of file
index 252fb8e..fd29a57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6fb=['update','UpdateChatQueueReport','DESC','Request','CreateChatQueueReport'];(function(_0x294847,_0x2d269c){var _0x209350=function(_0x56b649){while(--_0x56b649){_0x294847['push'](_0x294847['shift']());}};_0x209350(++_0x2d269c);}(_0xf6fb,0x111));var _0xbf6f=function(_0x3ba00b,_0x56e0a5){_0x3ba00b=_0x3ba00b-0x0;var _0x531faa=_0xf6fb[_0x3ba00b];return _0x531faa;};'use strict';var client=require('../client');exports['create']=function(_0x46441c){return client[_0xbf6f('0x0')]('CreateChatQueueReport',{'body':_0x46441c,'log':_0xbf6f('0x1')});};exports[_0xbf6f('0x2')]=function(_0x5709b7,_0xa3eb6){return client['Request'](_0xbf6f('0x3'),{'body':_0xa3eb6,'options':{'where':{'uniqueid':_0x5709b7},'order':[['id',_0xbf6f('0x4')]],'limit':0x1},'log':_0xbf6f('0x3')});};
\ No newline at end of file
+var _0x6282=['Request','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6282,0x76));var _0x2628=function(_0x3c3fa0,_0x4224be){_0x3c3fa0=_0x3c3fa0-0x0;var _0x4eaa8d=_0x6282[_0x3c3fa0];return _0x4eaa8d;};'use strict';var client=require(_0x2628('0x0'));exports[_0x2628('0x1')]=function(_0x8b4640){return client[_0x2628('0x2')]('CreateChatQueueReport',{'body':_0x8b4640,'log':'CreateChatQueueReport'});};exports[_0x2628('0x3')]=function(_0xc5c0c7,_0x5eb31b){return client[_0x2628('0x2')](_0x2628('0x4'),{'body':_0x5eb31b,'options':{'where':{'uniqueid':_0xc5c0c7},'order':[['id',_0x2628('0x5')]],'limit':0x1},'log':_0x2628('0x4')});};
\ No newline at end of file
index 47a85e7..aa20511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x7a54,0x106));var _0x47a5=function(_0x519933,_0x3d348e){_0x519933=_0x519933-0x0;var _0x297360=_0x7a54[_0x519933];return _0x297360;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x27e32f,_0x27abb6){var _0x5e3120=function(_0x126872){while(--_0x126872){_0x27e32f['push'](_0x27e32f['shift']());}};_0x5e3120(++_0x27abb6);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index e8d2a44..ce8f8b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a2e=['Request','CreateFaxMessage','createFaxMessage'];(function(_0x374ea2,_0x2d15af){var _0x89d182=function(_0x4f7442){while(--_0x4f7442){_0x374ea2['push'](_0x374ea2['shift']());}};_0x89d182(++_0x2d15af);}(_0x8a2e,0x10b));var _0xe8a2=function(_0x1f3208,_0x5dbed4){_0x1f3208=_0x1f3208-0x0;var _0x101880=_0x8a2e[_0x1f3208];return _0x101880;};'use strict';var client=require('../client');exports['create']=function(_0x4f4006){return client[_0xe8a2('0x0')](_0xe8a2('0x1'),{'body':_0x4f4006,'log':_0xe8a2('0x2')});};
\ No newline at end of file
+var _0x6416=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0xa4c5eb,_0x31e7a2){var _0x3276c4=function(_0x34da00){while(--_0x34da00){_0xa4c5eb['push'](_0xa4c5eb['shift']());}};_0x3276c4(++_0x31e7a2);}(_0x6416,0x160));var _0x6641=function(_0x12ee23,_0xacb61a){_0x12ee23=_0x12ee23-0x0;var _0x101a49=_0x6416[_0x12ee23];return _0x101a49;};'use strict';var client=require(_0x6641('0x0'));exports[_0x6641('0x1')]=function(_0x596ea2){return client[_0x6641('0x2')](_0x6641('0x3'),{'body':_0x596ea2,'log':_0x6641('0x4')});};
\ No newline at end of file
index 90ecebb..c09bac8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0550=['online','../client','getFaxQueues','Request','GetFaxQueue','User','Agents','name'];(function(_0x558825,_0x36a922){var _0x189261=function(_0x289afa){while(--_0x289afa){_0x558825['push'](_0x558825['shift']());}};_0x189261(++_0x36a922);}(_0x0550,0x169));var _0x0055=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x0550[_0x35f7f5];return _0x5567a4;};'use strict';var client=require(_0x0055('0x0'));exports[_0x0055('0x1')]=function(){return function(){return client[_0x0055('0x2')](_0x0055('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x0055('0x4'),'as':_0x0055('0x5'),'attributes':['id',_0x0055('0x6'),_0x0055('0x7'),'faxPause']}]},'log':_0x0055('0x1')});};};
\ No newline at end of file
+var _0x733f=['Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x733f,0x1d1));var _0xf733=function(_0x2147ae,_0x37d08e){_0x2147ae=_0x2147ae-0x0;var _0x577f4a=_0x733f[_0x2147ae];return _0x577f4a;};'use strict';var client=require(_0xf733('0x0'));exports[_0xf733('0x1')]=function(){return function(){return client[_0xf733('0x2')](_0xf733('0x3'),{'options':{'raw':![],'attributes':['id',_0xf733('0x4'),_0xf733('0x5'),_0xf733('0x6')],'include':[{'model':_0xf733('0x7'),'as':_0xf733('0x8'),'attributes':['id',_0xf733('0x4'),_0xf733('0x9'),_0xf733('0xa')]}]},'log':_0xf733('0x1')});};};
\ No newline at end of file
index 33ab82e..81e0ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe321=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0xe321,0x100));var _0x1e32=function(_0x4c2b96,_0x17ab0d){_0x4c2b96=_0x4c2b96-0x0;var _0x2a62bf=_0xe321[_0x4c2b96];return _0x2a62bf;};'use strict';var client=require(_0x1e32('0x0'));exports[_0x1e32('0x1')]=function(_0x3c6171){return client[_0x1e32('0x2')]('CreateFaxQueueReport',{'body':_0x3c6171,'log':_0x1e32('0x3')});};exports[_0x1e32('0x4')]=function(_0x43173e,_0x5b9f27){return client[_0x1e32('0x2')](_0x1e32('0x5'),{'body':_0x5b9f27,'options':{'where':{'uniqueid':_0x43173e},'order':[['id',_0x1e32('0x6')]],'limit':0x1},'log':_0x1e32('0x5')});};
\ No newline at end of file
+var _0x9f2b=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x320dc2,_0x129a13){var _0x5abef5=function(_0x2cf4a5){while(--_0x2cf4a5){_0x320dc2['push'](_0x320dc2['shift']());}};_0x5abef5(++_0x129a13);}(_0x9f2b,0xb7));var _0xb9f2=function(_0x35a4b1,_0x41b20d){_0x35a4b1=_0x35a4b1-0x0;var _0x58f0fd=_0x9f2b[_0x35a4b1];return _0x58f0fd;};'use strict';var client=require(_0xb9f2('0x0'));exports[_0xb9f2('0x1')]=function(_0x419a24){return client[_0xb9f2('0x2')](_0xb9f2('0x3'),{'body':_0x419a24,'log':_0xb9f2('0x3')});};exports['update']=function(_0x2d0de0,_0xbf8387){return client[_0xb9f2('0x2')](_0xb9f2('0x4'),{'body':_0xbf8387,'options':{'where':{'uniqueid':_0x2d0de0},'order':[['id',_0xb9f2('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 6e5bc11..a42f96a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c7=['GetInterval','name','Intervals','../client','getIntervals','Request'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0x44c7,0xab));var _0x744c=function(_0x3c9525,_0x4b97a1){_0x3c9525=_0x3c9525-0x0;var _0x432207=_0x44c7[_0x3c9525];return _0x432207;};'use strict';var client=require(_0x744c('0x0'));exports[_0x744c('0x1')]=function(){return function(){return client[_0x744c('0x2')](_0x744c('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x744c('0x4')],'include':[{'model':'Interval','as':_0x744c('0x5'),'attributes':['id',_0x744c('0x4'),'interval']}]},'log':_0x744c('0x1')});};};
\ No newline at end of file
+var _0x620c=['Interval','Intervals','name','interval','../client','getIntervals','Request','GetInterval'];(function(_0x59943d,_0x2e751b){var _0x46ace9=function(_0xfbd5f2){while(--_0xfbd5f2){_0x59943d['push'](_0x59943d['shift']());}};_0x46ace9(++_0x2e751b);}(_0x620c,0x1bc));var _0xc620=function(_0x2487c4,_0xf68000){_0x2487c4=_0x2487c4-0x0;var _0x466585=_0x620c[_0x2487c4];return _0x466585;};'use strict';var client=require(_0xc620('0x0'));exports[_0xc620('0x1')]=function(){return function(){return client[_0xc620('0x2')](_0xc620('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xc620('0x4'),'as':_0xc620('0x5'),'attributes':['id',_0xc620('0x6'),_0xc620('0x7')]}]},'log':_0xc620('0x1')});};};
\ No newline at end of file
index d1e99f4..abcc633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7334=['Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','addTags'];(function(_0x262595,_0x465dda){var _0x5c4cc5=function(_0x1dfdd1){while(--_0x1dfdd1){_0x262595['push'](_0x262595['shift']());}};_0x5c4cc5(++_0x465dda);}(_0x7334,0x184));var _0x4733=function(_0x3adfb7,_0x358de1){_0x3adfb7=_0x3adfb7-0x0;var _0xc2d52e=_0x7334[_0x3adfb7];return _0xc2d52e;};'use strict';var client=require(_0x4733('0x0'));exports[_0x4733('0x1')]=function(_0x280b6b,_0x5016ad){return client['Request'](_0x4733('0x2'),{'body':_0x5016ad,'options':{'where':{'id':_0x280b6b}},'log':'updateMailInteraction'});};exports[_0x4733('0x3')]=function(_0x218143,_0x3645a2){return client[_0x4733('0x4')](_0x4733('0x5'),{'body':_0x3645a2,'options':{'where':{'id':_0x218143}},'log':_0x4733('0x6')});};
\ No newline at end of file
+var _0x4325=['update','Request','UpdateMailInteraction','addTagsToChatInteraction','../client'];(function(_0x2a564b,_0x273210){var _0x1b762d=function(_0x89a595){while(--_0x89a595){_0x2a564b['push'](_0x2a564b['shift']());}};_0x1b762d(++_0x273210);}(_0x4325,0x1da));var _0x5432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4325[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5432('0x0'));exports[_0x5432('0x1')]=function(_0x5aa4b8,_0x3f491f){return client[_0x5432('0x2')](_0x5432('0x3'),{'body':_0x3f491f,'options':{'where':{'id':_0x5aa4b8}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x20f704,_0x36ce53){return client[_0x5432('0x2')]('AddTagsToMailInteraction',{'body':_0x36ce53,'options':{'where':{'id':_0x20f704}},'log':_0x5432('0x4')});};
\ No newline at end of file
index f91e179..f8e28aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e2a=['Request','createMailMessage','../client','create'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0x2e2a,0x14a));var _0xa2e2=function(_0x554e9e,_0xcb21e5){_0x554e9e=_0x554e9e-0x0;var _0x1ba47c=_0x2e2a[_0x554e9e];return _0x1ba47c;};'use strict';var client=require(_0xa2e2('0x0'));exports[_0xa2e2('0x1')]=function(_0x2b7dbc){return client[_0xa2e2('0x2')]('CreateMailMessage',{'body':_0x2b7dbc,'log':_0xa2e2('0x3')});};
\ No newline at end of file
+var _0x37b7=['CreateMailMessage','../client','create','Request'];(function(_0x4a73dd,_0x58e46c){var _0x279e6b=function(_0x25254b){while(--_0x25254b){_0x4a73dd['push'](_0x4a73dd['shift']());}};_0x279e6b(++_0x58e46c);}(_0x37b7,0x135));var _0x737b=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x37b7[_0x585d81];return _0x1aca0d;};'use strict';var client=require(_0x737b('0x0'));exports[_0x737b('0x1')]=function(_0x527b0a){return client[_0x737b('0x2')](_0x737b('0x3'),{'body':_0x527b0a,'log':'createMailMessage'});};
\ No newline at end of file
index d4ba39f..4a6066b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['GetMailQueue','name','timeout','strategy','User','Agents','mailPause','../client'];(function(_0x23177f,_0xea6dc5){var _0x1b451=function(_0x3e64b7){while(--_0x3e64b7){_0x23177f['push'](_0x23177f['shift']());}};_0x1b451(++_0xea6dc5);}(_0x187d,0x1b7));var _0xd187=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x187d[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xd187('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0xd187('0x1'),{'options':{'raw':![],'attributes':['id',_0xd187('0x2'),_0xd187('0x3'),_0xd187('0x4')],'include':[{'model':_0xd187('0x5'),'as':_0xd187('0x6'),'attributes':['id',_0xd187('0x2'),'online',_0xd187('0x7')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0x1939=['name','strategy','User','Agents','mailPause','getMailQueues','../client','Request','GetMailQueue'];(function(_0x343a83,_0x218650){var _0x19aa04=function(_0xddd7e6){while(--_0xddd7e6){_0x343a83['push'](_0x343a83['shift']());}};_0x19aa04(++_0x218650);}(_0x1939,0x1d1));var _0x9193=function(_0x5480e7,_0x2a6133){_0x5480e7=_0x5480e7-0x0;var _0x30eabf=_0x1939[_0x5480e7];return _0x30eabf;};'use strict';var client=require(_0x9193('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x9193('0x1')](_0x9193('0x2'),{'options':{'raw':![],'attributes':['id',_0x9193('0x3'),'timeout',_0x9193('0x4')],'include':[{'model':_0x9193('0x5'),'as':_0x9193('0x6'),'attributes':['id',_0x9193('0x3'),'online',_0x9193('0x7')]}]},'log':_0x9193('0x8')});};};
\ No newline at end of file
index 1152233..ae400aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b4=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x4bfb0c,_0xe429e0){var _0x58d01d=function(_0x24b506){while(--_0x24b506){_0x4bfb0c['push'](_0x4bfb0c['shift']());}};_0x58d01d(++_0xe429e0);}(_0x72b4,0x15d));var _0x472b=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0x72b4[_0xd29c88];return _0x375635;};'use strict';var client=require(_0x472b('0x0'));exports[_0x472b('0x1')]=function(_0xf18dc7){return client[_0x472b('0x2')](_0x472b('0x3'),{'body':_0xf18dc7,'log':_0x472b('0x3')});};exports[_0x472b('0x4')]=function(_0xe67002,_0x3d123f){return client[_0x472b('0x2')](_0x472b('0x5'),{'body':_0x3d123f,'options':{'where':{'uniqueid':_0xe67002},'order':[['id',_0x472b('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0x7c9b=['../client','create','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7c9b,0xcb));var _0xb7c9=function(_0x173272,_0x42fac6){_0x173272=_0x173272-0x0;var _0x5805b9=_0x7c9b[_0x173272];return _0x5805b9;};'use strict';var client=require(_0xb7c9('0x0'));exports[_0xb7c9('0x1')]=function(_0x31191b){return client['Request']('CreateMailQueueReport',{'body':_0x31191b,'log':_0xb7c9('0x2')});};exports[_0xb7c9('0x3')]=function(_0xdc4dcf,_0x1eabf2){return client[_0xb7c9('0x4')](_0xb7c9('0x5'),{'body':_0x1eabf2,'options':{'where':{'uniqueid':_0xdc4dcf},'order':[['id',_0xb7c9('0x6')]],'limit':0x1},'log':_0xb7c9('0x5')});};
\ No newline at end of file
index dfb5b92..1b75c58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e1b=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x8913bd,_0x276deb){var _0x32bca1=function(_0x4fc7b3){while(--_0x4fc7b3){_0x8913bd['push'](_0x8913bd['shift']());}};_0x32bca1(++_0x276deb);}(_0x9e1b,0x8e));var _0xb9e1=function(_0x4e9f0a,_0x4e0c62){_0x4e9f0a=_0x4e9f0a-0x0;var _0x2b8ec9=_0x9e1b[_0x4e9f0a];return _0x2b8ec9;};'use strict';var client=require(_0xb9e1('0x0'));exports[_0xb9e1('0x1')]=function(_0x2b9b52,_0x2f97a4){return client[_0xb9e1('0x2')](_0xb9e1('0x3'),{'body':_0x2f97a4,'options':{'where':{'id':_0x2b9b52}},'log':_0xb9e1('0x4')});};exports[_0xb9e1('0x5')]=function(_0x109ca3,_0x3d262a){return client['Request'](_0xb9e1('0x6'),{'body':_0x3d262a,'options':{'where':{'id':_0x109ca3}},'log':_0xb9e1('0x7')});};
\ No newline at end of file
+var _0x2304=['Request','AddTagsToOpenchannelInteraction','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x27398c,_0x4ea33f){var _0x155fc5=function(_0x1e1c53){while(--_0x1e1c53){_0x27398c['push'](_0x27398c['shift']());}};_0x155fc5(++_0x4ea33f);}(_0x2304,0x1e8));var _0x4230=function(_0x2c05be,_0x5511ae){_0x2c05be=_0x2c05be-0x0;var _0x1fe5d7=_0x2304[_0x2c05be];return _0x1fe5d7;};'use strict';var client=require(_0x4230('0x0'));exports['update']=function(_0x347f51,_0x15a61a){return client['Request'](_0x4230('0x1'),{'body':_0x15a61a,'options':{'where':{'id':_0x347f51}},'log':_0x4230('0x2')});};exports[_0x4230('0x3')]=function(_0xcc720f,_0x173202){return client[_0x4230('0x4')](_0x4230('0x5'),{'body':_0x173202,'options':{'where':{'id':_0xcc720f}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 8163b0d..a88b5e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x028e=['create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x5e66b7,_0x13f93b){var _0x16a8f8=function(_0x528107){while(--_0x528107){_0x5e66b7['push'](_0x5e66b7['shift']());}};_0x16a8f8(++_0x13f93b);}(_0x028e,0xf3));var _0xe028=function(_0x3e3641,_0x4b7038){_0x3e3641=_0x3e3641-0x0;var _0x4691fe=_0x028e[_0x3e3641];return _0x4691fe;};'use strict';var client=require('../client');exports[_0xe028('0x0')]=function(_0x383733){return client['Request'](_0xe028('0x1'),{'body':_0x383733,'log':_0xe028('0x2')});};
\ No newline at end of file
+var _0x7c92=['Request','createOpenchannelMessage','../client','create'];(function(_0x463f29,_0x315360){var _0x516d9b=function(_0x8c52c9){while(--_0x8c52c9){_0x463f29['push'](_0x463f29['shift']());}};_0x516d9b(++_0x315360);}(_0x7c92,0x1be));var _0x27c9=function(_0x104c6a,_0x53a2d4){_0x104c6a=_0x104c6a-0x0;var _0x300b18=_0x7c92[_0x104c6a];return _0x300b18;};'use strict';var client=require(_0x27c9('0x0'));exports[_0x27c9('0x1')]=function(_0x3a5736){return client[_0x27c9('0x2')]('CreateOpenchannelMessage',{'body':_0x3a5736,'log':_0x27c9('0x3')});};
\ No newline at end of file
index 70db0d2..4555845 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26b4=['openchannelPause','getOpenchannelQueues','name','timeout'];(function(_0x559364,_0x223995){var _0x3b4555=function(_0x1700a2){while(--_0x1700a2){_0x559364['push'](_0x559364['shift']());}};_0x3b4555(++_0x223995);}(_0x26b4,0x17e));var _0x426b=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x26b4[_0x2db12b];return _0x20990b;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x426b('0x0'),_0x426b('0x1'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x426b('0x0'),'online',_0x426b('0x2')]}]},'log':_0x426b('0x3')});};};
\ No newline at end of file
+var _0x9fdc=['User','Agents','openchannelPause','getOpenchannelQueues','GetOpenchannelQueue','name','timeout'];(function(_0x48bf52,_0x8c4a24){var _0x78d6a6=function(_0x44b151){while(--_0x44b151){_0x48bf52['push'](_0x48bf52['shift']());}};_0x78d6a6(++_0x8c4a24);}(_0x9fdc,0xce));var _0xc9fd=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x9fdc[_0x342baa];return _0x1208f3;};'use strict';var client=require('../client');exports[_0xc9fd('0x0')]=function(){return function(){return client['Request'](_0xc9fd('0x1'),{'options':{'raw':![],'attributes':['id',_0xc9fd('0x2'),_0xc9fd('0x3'),'strategy'],'include':[{'model':_0xc9fd('0x4'),'as':_0xc9fd('0x5'),'attributes':['id',_0xc9fd('0x2'),'online',_0xc9fd('0x6')]}]},'log':_0xc9fd('0x0')});};};
\ No newline at end of file
index 921f368..ac5b952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ec8=['UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x224240,_0x300cb1){var _0x4f9f4b=function(_0x1dfae2){while(--_0x1dfae2){_0x224240['push'](_0x224240['shift']());}};_0x4f9f4b(++_0x300cb1);}(_0x7ec8,0xce));var _0x87ec=function(_0x40baf1,_0x39a1e3){_0x40baf1=_0x40baf1-0x0;var _0x293477=_0x7ec8[_0x40baf1];return _0x293477;};'use strict';var client=require('../client');exports[_0x87ec('0x0')]=function(_0x2a64e3){return client[_0x87ec('0x1')]('CreateOpenchannelQueueReport',{'body':_0x2a64e3,'log':_0x87ec('0x2')});};exports[_0x87ec('0x3')]=function(_0x58b3c1,_0x170433){return client[_0x87ec('0x1')](_0x87ec('0x4'),{'body':_0x170433,'options':{'where':{'uniqueid':_0x58b3c1},'order':[['id',_0x87ec('0x5')]],'limit':0x1},'log':_0x87ec('0x4')});};
\ No newline at end of file
+var _0xc1bd=['create','Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport'];(function(_0x2527c0,_0x5a553b){var _0x5717c3=function(_0x188dd6){while(--_0x188dd6){_0x2527c0['push'](_0x2527c0['shift']());}};_0x5717c3(++_0x5a553b);}(_0xc1bd,0xd2));var _0xdc1b=function(_0xc7b656,_0x3983fc){_0xc7b656=_0xc7b656-0x0;var _0x45479e=_0xc1bd[_0xc7b656];return _0x45479e;};'use strict';var client=require('../client');exports[_0xdc1b('0x0')]=function(_0x114a2e){return client[_0xdc1b('0x1')](_0xdc1b('0x2'),{'body':_0x114a2e,'log':_0xdc1b('0x2')});};exports[_0xdc1b('0x3')]=function(_0x5ad3b0,_0x359884){return client[_0xdc1b('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x359884,'options':{'where':{'uniqueid':_0x5ad3b0},'order':[['id',_0xdc1b('0x4')]],'limit':0x1},'log':_0xdc1b('0x5')});};
\ No newline at end of file
index 78c0f64..756d163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x3fdd09,_0x2853f7){var _0x2be280=function(_0x419408){while(--_0x419408){_0x3fdd09['push'](_0x3fdd09['shift']());}};_0x2be280(++_0x2853f7);}(_0xb43b,0xbf));var _0xbb43=function(_0x31a551,_0x5c4dd0){_0x31a551=_0x31a551-0x0;var _0x593316=_0xb43b[_0x31a551];return _0x593316;};'use strict';var client=require(_0xbb43('0x0'));exports['update']=function(_0x1b9ba2,_0x21ce6c){return client[_0xbb43('0x1')](_0xbb43('0x2'),{'body':_0x21ce6c,'options':{'where':{'id':_0x1b9ba2}},'log':_0xbb43('0x3')});};exports[_0xbb43('0x4')]=function(_0x2e9c09,_0x25f690){return client[_0xbb43('0x1')](_0xbb43('0x5'),{'body':_0x25f690,'options':{'where':{'id':_0x2e9c09}},'log':_0xbb43('0x6')});};
\ No newline at end of file
+var _0x851e=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x851e,0x1e8));var _0xe851=function(_0x17caca,_0x2bc731){_0x17caca=_0x17caca-0x0;var _0x1d9b18=_0x851e[_0x17caca];return _0x1d9b18;};'use strict';var client=require(_0xe851('0x0'));exports[_0xe851('0x1')]=function(_0x2bc74b,_0x536c19){return client['Request'](_0xe851('0x2'),{'body':_0x536c19,'options':{'where':{'id':_0x2bc74b}},'log':_0xe851('0x3')});};exports[_0xe851('0x4')]=function(_0x326b34,_0xe50306){return client['Request'](_0xe851('0x5'),{'body':_0xe50306,'options':{'where':{'id':_0x326b34}},'log':_0xe851('0x6')});};
\ No newline at end of file
index db24ef8..98eeb69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x616b=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x21d735,_0x2f92ce){var _0x4c5d61=function(_0x573e14){while(--_0x573e14){_0x21d735['push'](_0x21d735['shift']());}};_0x4c5d61(++_0x2f92ce);}(_0x616b,0xbc));var _0xb616=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0x616b[_0x1306f3];return _0xc1c7bf;};'use strict';var client=require(_0xb616('0x0'));exports[_0xb616('0x1')]=function(_0x2444a2){return client[_0xb616('0x2')](_0xb616('0x3'),{'body':_0x2444a2,'log':_0xb616('0x4')});};
\ No newline at end of file
+var _0xd946=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x3cc65d,_0x27cd8a){var _0x51f0b2=function(_0x5e510b){while(--_0x5e510b){_0x3cc65d['push'](_0x3cc65d['shift']());}};_0x51f0b2(++_0x27cd8a);}(_0xd946,0x177));var _0x6d94=function(_0x184b44,_0x21e982){_0x184b44=_0x184b44-0x0;var _0x4fae50=_0xd946[_0x184b44];return _0x4fae50;};'use strict';var client=require(_0x6d94('0x0'));exports[_0x6d94('0x1')]=function(_0x408966){return client[_0x6d94('0x2')](_0x6d94('0x3'),{'body':_0x408966,'log':_0x6d94('0x4')});};
\ No newline at end of file
index e5719db..5848d7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x45f366,_0x44ab5e){var _0x477817=function(_0x15831f){while(--_0x15831f){_0x45f366['push'](_0x45f366['shift']());}};_0x477817(++_0x44ab5e);}(_0xe706,0xa3));var _0x6e70=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0xe706[_0x5be7aa];return _0x215408;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};};
\ No newline at end of file
+var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x2eb08a,_0x5a83ba){var _0x249c1d=function(_0x2e2a6b){while(--_0x2e2a6b){_0x2eb08a['push'](_0x2eb08a['shift']());}};_0x249c1d(++_0x5a83ba);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};};
\ No newline at end of file
index 5efdcb6..cf7f249 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4864f0,_0x5da8c5){var _0x55445a=function(_0x4ad48a){while(--_0x4ad48a){_0x4864f0['push'](_0x4864f0['shift']());}};_0x55445a(++_0x5da8c5);}(_0x008c,0x188));var _0xc008=function(_0x2da45d,_0x35397b){_0x2da45d=_0x2da45d-0x0;var _0x1012a0=_0x008c[_0x2da45d];return _0x1012a0;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});};
\ No newline at end of file
+var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xedd9,0xfc));var _0x9edd=function(_0x4804fa,_0x45dc69){_0x4804fa=_0x4804fa-0x0;var _0x9f178a=_0xedd9[_0x4804fa];return _0x9f178a;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});};
\ No newline at end of file
index 377a752..9451815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x37157d,_0x2d803f){var _0x34850d=function(_0x4ff885){while(--_0x4ff885){_0x37157d['push'](_0x37157d['shift']());}};_0x34850d(++_0x2d803f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
+var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x4b5976,_0x10811a){var _0x478b8a=function(_0x4528b4){while(--_0x4528b4){_0x4b5976['push'](_0x4b5976['shift']());}};_0x478b8a(++_0x10811a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
index ca3bcbd..883da89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ec2=['../client','update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x2db5fb,_0x428716){var _0x506298=function(_0x5e79a2){while(--_0x5e79a2){_0x2db5fb['push'](_0x2db5fb['shift']());}};_0x506298(++_0x428716);}(_0x6ec2,0x78));var _0x26ec=function(_0x59548c,_0x38b8f3){_0x59548c=_0x59548c-0x0;var _0x28dbad=_0x6ec2[_0x59548c];return _0x28dbad;};'use strict';var client=require(_0x26ec('0x0'));exports[_0x26ec('0x1')]=function(_0x3d8b7c,_0x314d57){return client[_0x26ec('0x2')](_0x26ec('0x3'),{'body':_0x314d57,'options':{'where':{'id':_0x3d8b7c}},'log':'updateWhatsappInteraction'});};exports[_0x26ec('0x4')]=function(_0x18650a,_0x2b4225){return client[_0x26ec('0x2')](_0x26ec('0x5'),{'body':_0x2b4225,'options':{'where':{'id':_0x18650a}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0xb242=['AddTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x2e891a,_0xb5a3b5){var _0x39f989=function(_0x1eaec3){while(--_0x1eaec3){_0x2e891a['push'](_0x2e891a['shift']());}};_0x39f989(++_0xb5a3b5);}(_0xb242,0x1f3));var _0x2b24=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xb242[_0x18b344];return _0x5ef6bb;};'use strict';var client=require('../client');exports[_0x2b24('0x0')]=function(_0x151da4,_0x1b9fbb){return client[_0x2b24('0x1')](_0x2b24('0x2'),{'body':_0x1b9fbb,'options':{'where':{'id':_0x151da4}},'log':_0x2b24('0x3')});};exports[_0x2b24('0x4')]=function(_0x481806,_0x494b43){return client[_0x2b24('0x1')](_0x2b24('0x5'),{'body':_0x494b43,'options':{'where':{'id':_0x481806}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
index 3649c7a..414412a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aff=['create','Request','CreateWhatsappMessage','../client'];(function(_0x1b5e26,_0x453ef6){var _0x246191=function(_0x54a89e){while(--_0x54a89e){_0x1b5e26['push'](_0x1b5e26['shift']());}};_0x246191(++_0x453ef6);}(_0x0aff,0x1d7));var _0xf0af=function(_0x415260,_0x135fcb){_0x415260=_0x415260-0x0;var _0x490f21=_0x0aff[_0x415260];return _0x490f21;};'use strict';var client=require(_0xf0af('0x0'));exports[_0xf0af('0x1')]=function(_0x2df73b){return client[_0xf0af('0x2')](_0xf0af('0x3'),{'body':_0x2df73b,'log':'createWhatsappMessage'});};
\ No newline at end of file
+var _0xaca8=['create','Request','createWhatsappMessage','../client'];(function(_0x425400,_0x354361){var _0x3166dc=function(_0x5c9777){while(--_0x5c9777){_0x425400['push'](_0x425400['shift']());}};_0x3166dc(++_0x354361);}(_0xaca8,0x16b));var _0x8aca=function(_0x1b16b4,_0x69d555){_0x1b16b4=_0x1b16b4-0x0;var _0x1c1702=_0xaca8[_0x1b16b4];return _0x1c1702;};'use strict';var client=require(_0x8aca('0x0'));exports[_0x8aca('0x1')]=function(_0x3e75c4){return client[_0x8aca('0x2')]('CreateWhatsappMessage',{'body':_0x3e75c4,'log':_0x8aca('0x3')});};
\ No newline at end of file
index cf99b88..0c7aea1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc522=['User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0xc522,0x15a));var _0x2c52=function(_0x1a7b7e,_0x50a41a){_0x1a7b7e=_0x1a7b7e-0x0;var _0x5a1bca=_0xc522[_0x1a7b7e];return _0x5a1bca;};'use strict';var client=require(_0x2c52('0x0'));exports[_0x2c52('0x1')]=function(){return function(){return client[_0x2c52('0x2')](_0x2c52('0x3'),{'options':{'raw':![],'attributes':['id',_0x2c52('0x4'),'timeout','strategy'],'include':[{'model':_0x2c52('0x5'),'as':_0x2c52('0x6'),'attributes':['id',_0x2c52('0x4'),_0x2c52('0x7'),_0x2c52('0x8')]}]},'log':_0x2c52('0x1')});};};
\ No newline at end of file
+var _0x7069=['strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','timeout'];(function(_0x1a0406,_0x104227){var _0x14d776=function(_0x2e46b8){while(--_0x2e46b8){_0x1a0406['push'](_0x1a0406['shift']());}};_0x14d776(++_0x104227);}(_0x7069,0x12e));var _0x9706=function(_0x4529a7,_0x33f6eb){_0x4529a7=_0x4529a7-0x0;var _0x434db1=_0x7069[_0x4529a7];return _0x434db1;};'use strict';var client=require(_0x9706('0x0'));exports[_0x9706('0x1')]=function(){return function(){return client[_0x9706('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x9706('0x3'),_0x9706('0x4')],'include':[{'model':_0x9706('0x5'),'as':_0x9706('0x6'),'attributes':['id','name',_0x9706('0x7'),_0x9706('0x8')]}]},'log':_0x9706('0x1')});};};
\ No newline at end of file
index 03b2fcb..54b9e6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f67=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create'];(function(_0x1ef9f7,_0xad329d){var _0x41e088=function(_0x210d17){while(--_0x210d17){_0x1ef9f7['push'](_0x1ef9f7['shift']());}};_0x41e088(++_0xad329d);}(_0x2f67,0xe8));var _0x72f6=function(_0x3b33c6,_0x5eec9c){_0x3b33c6=_0x3b33c6-0x0;var _0x58aafb=_0x2f67[_0x3b33c6];return _0x58aafb;};'use strict';var client=require(_0x72f6('0x0'));exports[_0x72f6('0x1')]=function(_0x541c83){return client[_0x72f6('0x2')]('CreateWhatsappQueueReport',{'body':_0x541c83,'log':_0x72f6('0x3')});};exports[_0x72f6('0x4')]=function(_0x4baca4,_0x2318cf){return client['Request'](_0x72f6('0x5'),{'body':_0x2318cf,'options':{'where':{'uniqueid':_0x4baca4},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
+var _0x40f1=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0xee9f10,_0x30b867){var _0x7178c0=function(_0x30b714){while(--_0x30b714){_0xee9f10['push'](_0xee9f10['shift']());}};_0x7178c0(++_0x30b867);}(_0x40f1,0x8d));var _0x140f=function(_0x3d6f40,_0x26ffa1){_0x3d6f40=_0x3d6f40-0x0;var _0x3f53ed=_0x40f1[_0x3d6f40];return _0x3f53ed;};'use strict';var client=require(_0x140f('0x0'));exports[_0x140f('0x1')]=function(_0x1acd9e){return client[_0x140f('0x2')](_0x140f('0x3'),{'body':_0x1acd9e,'log':_0x140f('0x3')});};exports[_0x140f('0x4')]=function(_0x44f79b,_0x3e3a26){return client[_0x140f('0x2')](_0x140f('0x5'),{'body':_0x3e3a26,'options':{'where':{'uniqueid':_0x44f79b},'order':[['id',_0x140f('0x6')]],'limit':0x1},'log':_0x140f('0x5')});};
\ No newline at end of file
index a8abf02..50eaafb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76f2=['number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','length','error','[%s][AGENT]\x20%s','join','stop','find','atimeout','channel','format','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','../../../../config/logger','routing','string'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x76f2,0x16f));var _0x276f=function(_0x4a47f4,_0x530f79){_0x4a47f4=_0x4a47f4-0x0;var _0x28f77e=_0x76f2[_0x4a47f4];return _0x28f77e;};'use strict';var schema=require('validate');var _=require(_0x276f('0x0'));var util=require('util');var seqqueue=require(_0x276f('0x1'));var logger=require(_0x276f('0x2'))(_0x276f('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x276f('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x276f('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x31b415,_0x5299b0,_0x5231ec){return logger[_0x276f('0x6')](util['format'](_0x276f('0x7'),_0x31b415,_0x5299b0[_0x276f('0x8')],_0x5231ec));}function handleFindAgent(_0x104d93){return function(_0x49501d){return _0x49501d[_0x276f('0x8')][_0x276f('0x9')]()===_0x104d93[_0x276f('0x9')]();};}exports['consequence']=function(_0xe1b797,_0x4827e7,_0x4455af,_0x82dd5f){return function(_0x1ee957){try{var _0x1a9baf={'name':_0x4827e7[0x0],'timeout':_0x4827e7[0x1]};var _0x2833b7=queue[_0x276f('0xa')](_0x1a9baf,{'typecast':!![]});if(_0x2833b7[_0x276f('0xb')]){logger[_0x276f('0xc')](_0x276f('0xd'),_0xe1b797,_['map'](_0x2833b7,'message')[_0x276f('0xe')](',\x20'));_0x1ee957[_0x276f('0xf')]();}else{var _0x58106b=_[_0x276f('0x10')](_0x4455af['agents'],handleFindAgent(_0x1a9baf['name']));if(_0x58106b){var _0x2c89b8=(_0x1a9baf['timeout']||0xa)*0x3e8;var _0x4ccaee,_0x211877;var _0x143cb=seqqueue['createQueue'](_0x2c89b8);_0x143cb['id']=_0xe1b797;_0x143cb[_0x276f('0x11')]=_0x2c89b8;_0x143cb[_0x276f('0x12')]=_0x82dd5f[_0x276f('0x12')];writeLog(_0xe1b797,_0x58106b,util[_0x276f('0x13')](_0x276f('0x14'),_0x2c89b8));_0x4455af[_0x276f('0x15')][_0xe1b797]['on']('end',function(){logger[_0x276f('0x6')](_0x276f('0x16'),_0xe1b797);clearTimeout(_0x211877);_0x211877=undefined;_0x143cb['close']();if(_0x4455af['rules'][_0xe1b797]){delete _0x4455af['rules'][_0xe1b797];}_0x1ee957[_0x276f('0xf')]();});_0x4455af['rules'][_0xe1b797]['on']('complete',function(){if(_0x4455af[_0x276f('0x15')][_0xe1b797]){delete _0x4455af[_0x276f('0x15')][_0xe1b797];}});_0x211877=setTimeout(function(){logger[_0x276f('0x6')](_0x276f('0x17'),_0xe1b797);clearTimeout(_0x211877);_0x143cb[_0x276f('0x18')]();_0x1ee957[_0x276f('0x19')]();},_0x2c89b8);strategy[_0x276f('0x1a')](_0x143cb,_0x58106b,_0x4455af,_0x82dd5f);}else{logger[_0x276f('0xc')](_0x276f('0x1b'),_0xe1b797,_0x1a9baf[_0x276f('0x8')]);_0x1ee957[_0x276f('0xf')]();}}}catch(_0x209601){console[_0x276f('0x1c')](_0x209601);logger[_0x276f('0xc')](_0x276f('0x1d'),_0xe1b797,_0x209601[_0x276f('0x1e')]);_0x1ee957[_0x276f('0xf')]();}};};
\ No newline at end of file
+var _0x5b2a=['atimeout','channel','START:%s','rules','info','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','name','createQueue'];(function(_0x54d368,_0x84cbbb){var _0x1a2696=function(_0x344ad8){while(--_0x344ad8){_0x54d368['push'](_0x54d368['shift']());}};_0x1a2696(++_0x84cbbb);}(_0x5b2a,0x104));var _0xa5b2=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0x5b2a[_0x59eacf];return _0x5d74f2;};'use strict';var schema=require(_0xa5b2('0x0'));var _=require(_0xa5b2('0x1'));var util=require(_0xa5b2('0x2'));var seqqueue=require(_0xa5b2('0x3'));var logger=require('../../../../config/logger')(_0xa5b2('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x59dd18,_0x5b541c,_0x6f0de5){return logger['info'](util[_0xa5b2('0x5')](_0xa5b2('0x6'),_0x59dd18,_0x5b541c['name'],_0x6f0de5));}function handleFindAgent(_0x5e541b){return function(_0xadeeac){return _0xadeeac['name']['toLowerCase']()===_0x5e541b[_0xa5b2('0x7')]();};}exports[_0xa5b2('0x8')]=function(_0x3e44c6,_0x58b10c,_0x1e4641,_0x40cf15){return function(_0x488a68){try{var _0x4e7af1={'name':_0x58b10c[0x0],'timeout':_0x58b10c[0x1]};var _0x3f0f6a=queue[_0xa5b2('0x0')](_0x4e7af1,{'typecast':!![]});if(_0x3f0f6a[_0xa5b2('0x9')]){logger[_0xa5b2('0xa')](_0xa5b2('0xb'),_0x3e44c6,_['map'](_0x3f0f6a,_0xa5b2('0xc'))[_0xa5b2('0xd')](',\x20'));_0x488a68[_0xa5b2('0xe')]();}else{var _0x3561f3=_[_0xa5b2('0xf')](_0x1e4641[_0xa5b2('0x10')],handleFindAgent(_0x4e7af1[_0xa5b2('0x11')]));if(_0x3561f3){var _0x17479d=(_0x4e7af1['timeout']||0xa)*0x3e8;var _0x47fc9c,_0x22fd88;var _0x47e1b5=seqqueue[_0xa5b2('0x12')](_0x17479d);_0x47e1b5['id']=_0x3e44c6;_0x47e1b5[_0xa5b2('0x13')]=_0x17479d;_0x47e1b5[_0xa5b2('0x14')]=_0x40cf15['channel'];writeLog(_0x3e44c6,_0x3561f3,util[_0xa5b2('0x5')](_0xa5b2('0x15'),_0x17479d));_0x1e4641[_0xa5b2('0x16')][_0x3e44c6]['on']('end',function(){logger[_0xa5b2('0x17')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3e44c6);clearTimeout(_0x22fd88);_0x22fd88=undefined;_0x47e1b5[_0xa5b2('0x18')]();if(_0x1e4641[_0xa5b2('0x16')][_0x3e44c6]){delete _0x1e4641[_0xa5b2('0x16')][_0x3e44c6];}_0x488a68[_0xa5b2('0xe')]();});_0x1e4641[_0xa5b2('0x16')][_0x3e44c6]['on']('complete',function(){if(_0x1e4641[_0xa5b2('0x16')][_0x3e44c6]){delete _0x1e4641[_0xa5b2('0x16')][_0x3e44c6];}});_0x22fd88=setTimeout(function(){logger['info'](_0xa5b2('0x19'),_0x3e44c6);clearTimeout(_0x22fd88);_0x47e1b5[_0xa5b2('0x18')]();_0x488a68[_0xa5b2('0x1a')]();},_0x17479d);strategy[_0xa5b2('0x1b')](_0x47e1b5,_0x3561f3,_0x1e4641,_0x40cf15);}else{logger[_0xa5b2('0xa')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3e44c6,_0x4e7af1[_0xa5b2('0x11')]);_0x488a68[_0xa5b2('0xe')]();}}}catch(_0x131eca){console[_0xa5b2('0x1c')](_0x131eca);logger[_0xa5b2('0xa')](_0xa5b2('0x1d'),_0x3e44c6,_0x131eca[_0xa5b2('0x1e')]);_0x488a68[_0xa5b2('0xe')]();}};};
\ No newline at end of file
index 5a68da6..a126a74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b43=['catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','postText','message','next','amazonlex','dialogState','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','isEmpty','body','getMustacheRender','Message','create','then'];(function(_0x2938db,_0x53188d){var _0xd7c1bd=function(_0x1eebc3){while(--_0x1eebc3){_0x2938db['push'](_0x2938db['shift']());}};_0xd7c1bd(++_0x53188d);}(_0x0b43,0x95));var _0x30b4=function(_0xebbb42,_0x4907b2){_0xebbb42=_0xebbb42-0x0;var _0x4f659e=_0x0b43[_0xebbb42];return _0x4f659e;};'use strict';var _=require('lodash');var moment=require(_0x30b4('0x0'));var AWS=require('aws-sdk');var utils=require(_0x30b4('0x1'));var logger=require(_0x30b4('0x2'))(_0x30b4('0x3'));var rpc={'chatMessage':require(_0x30b4('0x4')),'openchannelMessage':require(_0x30b4('0x5')),'mailMessage':require(_0x30b4('0x6')),'smsMessage':require(_0x30b4('0x7')),'faxMessage':require(_0x30b4('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4ae0ad,_0x24f4ab){return function(_0x344939){try{if(!_['isNil'](this[_0x30b4('0x9')][_0x30b4('0xa')])){logger[_0x30b4('0xb')](_0x30b4('0xc'),_0x4ae0ad,_0x30b4('0xd'));return _0x344939['next']();}var _0x118bd1={'ContactId':this['contact']['id'],'sentAt':moment()[_0x30b4('0xe')](_0x30b4('0xf')),'direction':_0x30b4('0x10')};if(this[_0x30b4('0x11')]===_0x30b4('0x12')||this[_0x30b4('0x11')]===_0x30b4('0x13')){_0x118bd1[_0x30b4('0x14')]=this[_0x30b4('0x9')]['phone'];}var _0x5032d1=this['channel'];if(_0x5032d1===_0x30b4('0x15')){_0x118bd1[_0x30b4('0x16')]=this[_0x30b4('0x17')]['id'];}else{_0x118bd1[_[_0x30b4('0x18')](_0x5032d1)+'AccountId']=this[_0x30b4('0x17')]['id'];}_0x118bd1[_[_0x30b4('0x18')](_0x5032d1)+'InteractionId']=this[_0x30b4('0x9')]['id'];if(this[_0x30b4('0x9')]['created']){var _0x5e14f1=_0x24f4ab[0x4];if(!_[_0x30b4('0x19')](_0x5e14f1)){_0x118bd1[_0x30b4('0x1a')]=utils[_0x30b4('0x1b')](_0x5e14f1,this);return rpc[_0x5032d1+_0x30b4('0x1c')][_0x30b4('0x1d')](_0x118bd1)[_0x30b4('0x1e')](function(_0x194fa8){logger[_0x30b4('0xb')](_0x30b4('0xc'),_0x4ae0ad,_0x118bd1[_0x30b4('0x1a')]);})[_0x30b4('0x1f')](function(_0x375eb8){logger[_0x30b4('0x20')]('[%s][AMAZONLEX]\x20%s',_0x4ae0ad,JSON[_0x30b4('0x21')](_0x375eb8));})['finally'](function(){logger['info'](_0x30b4('0x22'),_0x4ae0ad);_0x344939[_0x30b4('0x23')]();});}else{logger['info'](_0x30b4('0x24'),_0x4ae0ad);_0x344939['stop']();}}else{var _0x5881cf=this;var _0x4a3f2f=new AWS[(_0x30b4('0x25'))]({'accessKeyId':_0x24f4ab[0x0],'secretAccessKey':_0x24f4ab[0x1],'region':_0x24f4ab[0x2]});var _0xcfba9f={'botAlias':_0x30b4('0x26'),'botName':_0x24f4ab[0x3],'inputText':this['message'][_0x30b4('0x1a')],'userId':this['channel']+':'+this[_0x30b4('0x9')]['id'][_0x30b4('0x27')]()};_0x4a3f2f[_0x30b4('0x28')](_0xcfba9f,function(_0x2349b9,_0x14ab87){if(_0x2349b9){logger[_0x30b4('0x20')](_0x30b4('0xc'),_0x4ae0ad,_0x2349b9[_0x30b4('0x29')]);_0x344939[_0x30b4('0x2a')]();}else if(_0x14ab87&&_0x14ab87[_0x30b4('0x29')]){_0x5881cf['body'][_0x30b4('0x2b')]=_0x14ab87;_0x118bd1[_0x30b4('0x1a')]=_0x14ab87[_0x30b4('0x29')];_0x118bd1['providerName']=_0x30b4('0x2b');_0x118bd1['providerResponse']=JSON[_0x30b4('0x21')](_0x14ab87);return rpc[_0x5032d1+'Message'][_0x30b4('0x1d')](_0x118bd1)[_0x30b4('0x1e')](function(_0x44b2eb){logger[_0x30b4('0xb')]('[%s][AMAZONLEX]\x20%s',_0x4ae0ad,_0x118bd1[_0x30b4('0x1a')]);if(_0x14ab87[_0x30b4('0x2c')]=='Failed'){_0x344939[_0x30b4('0x2a')]();}else{_0x344939[_0x30b4('0x23')]();}})[_0x30b4('0x1f')](function(_0x148f47){logger[_0x30b4('0x20')](_0x30b4('0xc'),_0x4ae0ad,JSON[_0x30b4('0x21')](_0x148f47));_0x344939[_0x30b4('0x2a')]();});}else{_0x344939['next']();}});}}catch(_0x7a097b){logger[_0x30b4('0x20')](_0x30b4('0xc'),_0x4ae0ad,JSON[_0x30b4('0x21')](_0x7a097b));_0x344939[_0x30b4('0x23')]();}};};
\ No newline at end of file
+var _0x9f74=['create','dialogState','Failed','lodash','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','getMustacheRender','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','amazonlex','providerName'];(function(_0x397ddb,_0x574faf){var _0x4af353=function(_0x541740){while(--_0x541740){_0x397ddb['push'](_0x397ddb['shift']());}};_0x4af353(++_0x574faf);}(_0x9f74,0x14c));var _0x49f7=function(_0x553352,_0x499540){_0x553352=_0x553352-0x0;var _0x133c0c=_0x9f74[_0x553352];return _0x133c0c;};'use strict';var _=require(_0x49f7('0x0'));var moment=require('moment');var AWS=require(_0x49f7('0x1'));var utils=require(_0x49f7('0x2'));var logger=require(_0x49f7('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x49f7('0x4')),'mailMessage':require(_0x49f7('0x5')),'smsMessage':require(_0x49f7('0x6')),'faxMessage':require(_0x49f7('0x7')),'whatsappMessage':require(_0x49f7('0x8'))};exports['consequence']=function(_0x3263f1,_0x48677a){return function(_0x1f67c3){try{if(!_[_0x49f7('0x9')](this['interaction'][_0x49f7('0xa')])){logger[_0x49f7('0xb')](_0x49f7('0xc'),_0x3263f1,_0x49f7('0xd'));return _0x1f67c3[_0x49f7('0xe')]();}var _0x2c9c2={'ContactId':this['contact']['id'],'sentAt':moment()[_0x49f7('0xf')](_0x49f7('0x10')),'direction':_0x49f7('0x11')};if(this[_0x49f7('0x12')]==='sms'||this[_0x49f7('0x12')]===_0x49f7('0x13')){_0x2c9c2[_0x49f7('0x14')]=this['interaction'][_0x49f7('0x14')];}var _0x35e85b=this[_0x49f7('0x12')];if(_0x35e85b===_0x49f7('0x15')){_0x2c9c2[_0x49f7('0x16')]=this[_0x49f7('0x17')]['id'];}else{_0x2c9c2[_[_0x49f7('0x18')](_0x35e85b)+_0x49f7('0x19')]=this[_0x49f7('0x17')]['id'];}_0x2c9c2[_['upperFirst'](_0x35e85b)+_0x49f7('0x1a')]=this[_0x49f7('0x1b')]['id'];if(this[_0x49f7('0x1b')][_0x49f7('0x1c')]){var _0x575d1a=_0x48677a[0x4];if(!_[_0x49f7('0x1d')](_0x575d1a)){_0x2c9c2[_0x49f7('0x1e')]=utils[_0x49f7('0x1f')](_0x575d1a,this);return rpc[_0x35e85b+'Message']['create'](_0x2c9c2)[_0x49f7('0x20')](function(_0xaabf19){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3263f1,_0x2c9c2[_0x49f7('0x1e')]);})[_0x49f7('0x21')](function(_0x21c508){logger[_0x49f7('0x22')](_0x49f7('0xc'),_0x3263f1,JSON[_0x49f7('0x23')](_0x21c508));})[_0x49f7('0x24')](function(){logger[_0x49f7('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3263f1);_0x1f67c3['stop']();});}else{logger[_0x49f7('0xb')](_0x49f7('0x25'),_0x3263f1);_0x1f67c3[_0x49f7('0x26')]();}}else{var _0x3a4bd9=this;var _0x2bf609=new AWS[(_0x49f7('0x27'))]({'accessKeyId':_0x48677a[0x0],'secretAccessKey':_0x48677a[0x1],'region':_0x48677a[0x2]});var _0x4fbd0b={'botAlias':_0x49f7('0x28'),'botName':_0x48677a[0x3],'inputText':this[_0x49f7('0x29')]['body'],'userId':this[_0x49f7('0x12')]+':'+this['interaction']['id']['toString']()};_0x2bf609['postText'](_0x4fbd0b,function(_0x3abe39,_0x1a8e4c){if(_0x3abe39){logger[_0x49f7('0x22')](_0x49f7('0xc'),_0x3263f1,_0x3abe39['message']);_0x1f67c3[_0x49f7('0xe')]();}else if(_0x1a8e4c&&_0x1a8e4c[_0x49f7('0x29')]){_0x3a4bd9[_0x49f7('0x1e')][_0x49f7('0x2a')]=_0x1a8e4c;_0x2c9c2['body']=_0x1a8e4c[_0x49f7('0x29')];_0x2c9c2[_0x49f7('0x2b')]=_0x49f7('0x2a');_0x2c9c2['providerResponse']=JSON['stringify'](_0x1a8e4c);return rpc[_0x35e85b+'Message'][_0x49f7('0x2c')](_0x2c9c2)['then'](function(_0xcfcfef){logger['info'](_0x49f7('0xc'),_0x3263f1,_0x2c9c2[_0x49f7('0x1e')]);if(_0x1a8e4c[_0x49f7('0x2d')]==_0x49f7('0x2e')){_0x1f67c3[_0x49f7('0xe')]();}else{_0x1f67c3['stop']();}})[_0x49f7('0x21')](function(_0x169973){logger[_0x49f7('0x22')]('[%s][AMAZONLEX]\x20%s',_0x3263f1,JSON['stringify'](_0x169973));_0x1f67c3[_0x49f7('0xe')]();});}else{_0x1f67c3[_0x49f7('0xe')]();}});}}catch(_0x357116){logger[_0x49f7('0x22')](_0x49f7('0xc'),_0x3263f1,JSON[_0x49f7('0x23')](_0x357116));_0x1f67c3[_0x49f7('0x26')]();}};};
\ No newline at end of file
index 4a1b942..4dcdb3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf721=['isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','Message','mail','service','Smtp','host','port','secure','authentication','auth','user','pass','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','channel','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf721,0x1b8));var _0x1f72=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xf721[_0x1d6a82];return _0x5834ac;};'use strict';var _=require(_0x1f72('0x0'));var moment=require(_0x1f72('0x1'));var utils=require(_0x1f72('0x2'));var logger=require(_0x1f72('0x3'))('routing');var rpc={'chatMessage':require(_0x1f72('0x4')),'openchannelMessage':require(_0x1f72('0x5')),'mailMessage':require(_0x1f72('0x6')),'smsMessage':require(_0x1f72('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1f72('0x8')),'chatInteraction':require(_0x1f72('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x1f72('0xa')),'smsInteraction':require(_0x1f72('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1f72('0xc'))};var mailRpc=require('../../mailRpc');exports[_0x1f72('0xd')]=function(_0x4d73d8,_0x5b8144,_0x209808,_0x15ec2f){return function(_0x321b03){try{var _0x46cb2e=this[_0x1f72('0xe')];if(_0x46cb2e==='mail'&&_0x15ec2f[_0x1f72('0xf')][_0x1f72('0x10')]){logger[_0x1f72('0x11')](_0x1f72('0x12'),_0x4d73d8,_0x1f72('0x13'));return _0x321b03[_0x1f72('0x14')]();}if(_0x5b8144[0x0]==='1'&&(_[_0x1f72('0x15')](this[_0x1f72('0x16')][_0x1f72('0x17')])||!this[_0x1f72('0x16')][_0x1f72('0x17')])){logger[_0x1f72('0x11')]('[%s][AUTOREPLY]\x20%s',_0x4d73d8,_0x1f72('0x18'));return _0x321b03['next']();}if(_0x5b8144[0x0]==='2'&&this[_0x1f72('0x16')][_0x1f72('0x19')]){logger[_0x1f72('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4d73d8,_0x1f72('0x1a'));return _0x321b03[_0x1f72('0x14')]();}var _0x511e77={'ContactId':this[_0x1f72('0x1b')]['id'],'sentAt':moment()[_0x1f72('0x1c')](_0x1f72('0x1d')),'direction':'out'};if(this[_0x1f72('0xe')]==='mail'){_0x511e77[_0x1f72('0xf')]=utils[_0x1f72('0x1e')](_0x5b8144[0x2],this);}else{_0x511e77[_0x1f72('0xf')]=utils[_0x1f72('0x1e')](_0x5b8144[0x1],this);}if(this[_0x1f72('0x1f')]){_0x511e77['to']=this[_0x1f72('0x1f')][_0x1f72('0x20')]||'';if(this[_0x1f72('0xe')]==='mail'&&_0x5b8144[0x1]==='1'){_0x511e77['cc']=this[_0x1f72('0x1f')]['cc']||'';}_0x511e77[_0x1f72('0x20')]=this[_0x1f72('0x1f')]['to']||'';_0x511e77[_0x1f72('0x21')]=this[_0x1f72('0x1f')]['phone']||'';_0x511e77['read']=!![];if(this[_0x1f72('0x1f')][_0x1f72('0x22')]){_0x511e77[_0x1f72('0x22')]='';_0x511e77[_0x1f72('0x22')]+=_['startsWith'](this[_0x1f72('0x1f')][_0x1f72('0x22')],_0x1f72('0x23'))?'':_0x1f72('0x24');_0x511e77[_0x1f72('0x22')]+=this[_0x1f72('0x1f')][_0x1f72('0x22')];}}if(this[_0x1f72('0xe')]===_0x1f72('0x25')){_0x511e77[_0x1f72('0x26')]=this[_0x1f72('0x27')]['id'];}else{_0x511e77[_['upperFirst'](this[_0x1f72('0xe')])+'AccountId']=this[_0x1f72('0x27')]['id'];}_0x511e77[_[_0x1f72('0x28')](this['channel'])+'InteractionId']=this[_0x1f72('0x16')]['id'];var _0x552a63=this['interaction'];if(rpc[this[_0x1f72('0xe')]+_0x1f72('0x29')]){if(this[_0x1f72('0xe')]===_0x1f72('0x2a')){var _0xb899e3={'tls':{'rejectUnauthorized':![]}};if(this[_0x1f72('0x27')]['Smtp'][_0x1f72('0x2b')]){_0xb899e3[_0x1f72('0x2b')]=this[_0x1f72('0x27')][_0x1f72('0x2c')][_0x1f72('0x2b')];}else{_0xb899e3[_0x1f72('0x2d')]=this[_0x1f72('0x27')][_0x1f72('0x2c')][_0x1f72('0x2d')];_0xb899e3['port']=this[_0x1f72('0x27')]['Smtp'][_0x1f72('0x2e')];_0xb899e3[_0x1f72('0x2f')]=this[_0x1f72('0x27')][_0x1f72('0x2c')][_0x1f72('0x2f')];}if(this[_0x1f72('0x27')][_0x1f72('0x2c')][_0x1f72('0x30')]){_0xb899e3[_0x1f72('0x31')]={'user':this[_0x1f72('0x27')]['Smtp'][_0x1f72('0x32')],'pass':this[_0x1f72('0x27')][_0x1f72('0x2c')][_0x1f72('0x33')]};}_0x511e77['inReplyTo']=this[_0x1f72('0x1f')]['messageId'];_0x511e77[_0x1f72('0x34')]=_0x1f72('0x35')+_[_0x1f72('0x36')](_0x511e77[_0x1f72('0xf')],_0x1f72('0x37'),'<div')+'</div>';_0x511e77[_0x1f72('0x38')]={'Auto-Submitted':_0x1f72('0x39'),'X-Auto-Response-Suppress':_0x1f72('0x3a'),'Precedence':_0x1f72('0x3b')};return mailRpc[_0x1f72('0x3c')](_0xb899e3,_0x511e77)['then'](function(_0x4241b5){logger[_0x1f72('0x11')](_0x1f72('0x3d'),_0x4d73d8);_0x511e77['messageId']=_0x4241b5['message'][_0x1f72('0x3e')];return rpc[_0x46cb2e+_0x1f72('0x29')][_0x1f72('0x3f')](_0x511e77);})['then'](function(_0x34b9dd){logger[_0x1f72('0x11')](_0x1f72('0x12'),_0x4d73d8,JSON[_0x1f72('0x40')](_0x34b9dd));})['catch'](function(_0x4a903a){logger[_0x1f72('0x41')](_0x1f72('0x42'),_0x4d73d8,JSON[_0x1f72('0x40')](_0x4a903a));})[_0x1f72('0x43')](function(){Promise[_0x1f72('0x44')]()[_0x1f72('0x45')](function(){if(_0x5b8144[0x0]!=='2'||_0x552a63[_0x1f72('0x19')])return;return rpc[_0x46cb2e+_0x1f72('0x46')]['update'](_0x552a63['id'],{'autoreplyExecuted':!![]})[_0x1f72('0x45')](function(_0x4e6710){logger[_0x1f72('0x11')](_0x1f72('0x47'),_0x4d73d8,JSON[_0x1f72('0x40')](_0x4e6710));})['catch'](function(_0x839403){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4d73d8,JSON['stringify'](_0x839403));});})[_0x1f72('0x45')](function(){_0x321b03[_0x1f72('0x14')]();});});}else{return rpc[this['channel']+_0x1f72('0x29')][_0x1f72('0x3f')](_0x511e77)[_0x1f72('0x45')](function(_0x1f26b8){logger[_0x1f72('0x11')](_0x1f72('0x12'),_0x4d73d8,_0x511e77[_0x1f72('0xf')]);})[_0x1f72('0x48')](function(_0x54e05e){logger[_0x1f72('0x41')]('[%s][AUTOREPLY]\x20%s',_0x4d73d8,JSON['stringify'](_0x54e05e));})['finally'](function(){Promise[_0x1f72('0x44')]()['then'](function(){if(_0x5b8144[0x0]!=='2'||_0x552a63[_0x1f72('0x19')])return;return rpc[_0x46cb2e+_0x1f72('0x46')][_0x1f72('0x49')](_0x552a63['id'],{'autoreplyExecuted':!![]})[_0x1f72('0x45')](function(_0x485ca8){logger[_0x1f72('0x11')](_0x1f72('0x47'),_0x4d73d8,JSON['stringify'](_0x485ca8));})['catch'](function(_0x39126e){logger['error'](_0x1f72('0x4a'),_0x4d73d8,JSON[_0x1f72('0x40')](_0x39126e));});})[_0x1f72('0x45')](function(){_0x321b03[_0x1f72('0x14')]();});});}}}catch(_0x16bade){logger[_0x1f72('0x41')](_0x1f72('0x12'),_0x4d73d8,JSON['stringify'](_0x16bade));_0x321b03[_0x1f72('0x4b')]();}};};
\ No newline at end of file
+var _0xb916=['info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','pass','inReplyTo','html','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','auto_reply','sendMailMessage','messageId','create','then','stringify','catch','error','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply'];(function(_0x5b6fe5,_0x5ddf47){var _0x5928d4=function(_0x3e0846){while(--_0x3e0846){_0x5b6fe5['push'](_0x5b6fe5['shift']());}};_0x5928d4(++_0x5ddf47);}(_0xb916,0x10f));var _0x6b91=function(_0x557886,_0x525a5e){_0x557886=_0x557886-0x0;var _0x3026ba=_0xb916[_0x557886];return _0x3026ba;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require('./utils');var logger=require(_0x6b91('0x0'))(_0x6b91('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6b91('0x2')),'mailMessage':require(_0x6b91('0x3')),'smsMessage':require(_0x6b91('0x4')),'faxMessage':require(_0x6b91('0x5')),'whatsappMessage':require(_0x6b91('0x6')),'chatInteraction':require(_0x6b91('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x6b91('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x6b91('0x9')),'whatsappInteraction':require(_0x6b91('0xa'))};var mailRpc=require(_0x6b91('0xb'));exports[_0x6b91('0xc')]=function(_0x145642,_0x270135,_0x39e9c3,_0x154dfb){return function(_0x4e633f){try{var _0x3ef1e9=this[_0x6b91('0xd')];if(_0x3ef1e9===_0x6b91('0xe')&&_0x154dfb[_0x6b91('0xf')][_0x6b91('0x10')]){logger[_0x6b91('0x11')](_0x6b91('0x12'),_0x145642,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x4e633f[_0x6b91('0x13')]();}if(_0x270135[0x0]==='1'&&(_[_0x6b91('0x14')](this[_0x6b91('0x15')]['created'])||!this[_0x6b91('0x15')]['created'])){logger['info'](_0x6b91('0x12'),_0x145642,_0x6b91('0x16'));return _0x4e633f['next']();}if(_0x270135[0x0]==='2'&&this['interaction'][_0x6b91('0x17')]){logger['info'](_0x6b91('0x18'),_0x145642,_0x6b91('0x19'));return _0x4e633f[_0x6b91('0x13')]();}var _0x2bfcc1={'ContactId':this[_0x6b91('0x1a')]['id'],'sentAt':moment()[_0x6b91('0x1b')](_0x6b91('0x1c')),'direction':_0x6b91('0x1d')};if(this[_0x6b91('0xd')]===_0x6b91('0xe')){_0x2bfcc1[_0x6b91('0xf')]=utils[_0x6b91('0x1e')](_0x270135[0x2],this);}else{_0x2bfcc1[_0x6b91('0xf')]=utils[_0x6b91('0x1e')](_0x270135[0x1],this);}if(this[_0x6b91('0x1f')]){_0x2bfcc1['to']=this['message'][_0x6b91('0x20')]||'';if(this[_0x6b91('0xd')]===_0x6b91('0xe')&&_0x270135[0x1]==='1'){_0x2bfcc1['cc']=this['message']['cc']||'';}_0x2bfcc1[_0x6b91('0x20')]=this[_0x6b91('0x1f')]['to']||'';_0x2bfcc1[_0x6b91('0x21')]=this[_0x6b91('0x1f')]['phone']||'';_0x2bfcc1[_0x6b91('0x22')]=!![];if(this[_0x6b91('0x1f')][_0x6b91('0x23')]){_0x2bfcc1[_0x6b91('0x23')]='';_0x2bfcc1[_0x6b91('0x23')]+=_['startsWith'](this[_0x6b91('0x1f')][_0x6b91('0x23')],_0x6b91('0x24'))?'':_0x6b91('0x25');_0x2bfcc1['subject']+=this[_0x6b91('0x1f')]['subject'];}}if(this[_0x6b91('0xd')]===_0x6b91('0x26')){_0x2bfcc1[_0x6b91('0x27')]=this[_0x6b91('0x28')]['id'];}else{_0x2bfcc1[_[_0x6b91('0x29')](this[_0x6b91('0xd')])+_0x6b91('0x2a')]=this[_0x6b91('0x28')]['id'];}_0x2bfcc1[_[_0x6b91('0x29')](this[_0x6b91('0xd')])+_0x6b91('0x2b')]=this[_0x6b91('0x15')]['id'];var _0x3978e5=this[_0x6b91('0x15')];if(rpc[this[_0x6b91('0xd')]+_0x6b91('0x2c')]){if(this[_0x6b91('0xd')]===_0x6b91('0xe')){var _0x1515ba={'tls':{'rejectUnauthorized':![]}};if(this[_0x6b91('0x28')][_0x6b91('0x2d')][_0x6b91('0x2e')]){_0x1515ba[_0x6b91('0x2e')]=this[_0x6b91('0x28')][_0x6b91('0x2d')][_0x6b91('0x2e')];}else{_0x1515ba[_0x6b91('0x2f')]=this[_0x6b91('0x28')]['Smtp']['host'];_0x1515ba[_0x6b91('0x30')]=this['account'][_0x6b91('0x2d')][_0x6b91('0x30')];_0x1515ba[_0x6b91('0x31')]=this[_0x6b91('0x28')]['Smtp'][_0x6b91('0x31')];}if(this[_0x6b91('0x28')]['Smtp']['authentication']){_0x1515ba['auth']={'user':this['account'][_0x6b91('0x2d')]['user'],'pass':this['account']['Smtp'][_0x6b91('0x32')]};}_0x2bfcc1[_0x6b91('0x33')]=this[_0x6b91('0x1f')]['messageId'];_0x2bfcc1[_0x6b91('0x34')]=_0x6b91('0x35')+_['replace'](_0x2bfcc1[_0x6b91('0xf')],_0x6b91('0x36'),_0x6b91('0x37'))+_0x6b91('0x38');_0x2bfcc1[_0x6b91('0x39')]={'Auto-Submitted':_0x6b91('0x3a'),'X-Auto-Response-Suppress':'All','Precedence':_0x6b91('0x3b')};return mailRpc[_0x6b91('0x3c')](_0x1515ba,_0x2bfcc1)['then'](function(_0x561659){logger[_0x6b91('0x11')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x145642);_0x2bfcc1[_0x6b91('0x3d')]=_0x561659[_0x6b91('0x1f')][_0x6b91('0x3d')];return rpc[_0x3ef1e9+_0x6b91('0x2c')][_0x6b91('0x3e')](_0x2bfcc1);})[_0x6b91('0x3f')](function(_0x2a63c9){logger[_0x6b91('0x11')](_0x6b91('0x12'),_0x145642,JSON[_0x6b91('0x40')](_0x2a63c9));})[_0x6b91('0x41')](function(_0x3cd492){logger[_0x6b91('0x42')]('[RPC][%s][AUTOREPLY]\x20%s',_0x145642,JSON[_0x6b91('0x40')](_0x3cd492));})[_0x6b91('0x43')](function(){Promise[_0x6b91('0x44')]()[_0x6b91('0x3f')](function(){if(_0x270135[0x0]!=='2'||_0x3978e5['autoreplyExecuted'])return;return rpc[_0x3ef1e9+_0x6b91('0x45')]['update'](_0x3978e5['id'],{'autoreplyExecuted':!![]})[_0x6b91('0x3f')](function(_0x1e3f3c){logger[_0x6b91('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x145642,JSON[_0x6b91('0x40')](_0x1e3f3c));})[_0x6b91('0x41')](function(_0x1c87b5){logger[_0x6b91('0x42')](_0x6b91('0x46'),_0x145642,JSON[_0x6b91('0x40')](_0x1c87b5));});})[_0x6b91('0x3f')](function(){_0x4e633f[_0x6b91('0x13')]();});});}else{return rpc[this[_0x6b91('0xd')]+'Message'][_0x6b91('0x3e')](_0x2bfcc1)[_0x6b91('0x3f')](function(_0xb3afb6){logger[_0x6b91('0x11')](_0x6b91('0x12'),_0x145642,_0x2bfcc1['body']);})[_0x6b91('0x41')](function(_0x409d70){logger['error']('[%s][AUTOREPLY]\x20%s',_0x145642,JSON[_0x6b91('0x40')](_0x409d70));})[_0x6b91('0x43')](function(){Promise[_0x6b91('0x44')]()['then'](function(){if(_0x270135[0x0]!=='2'||_0x3978e5[_0x6b91('0x17')])return;return rpc[_0x3ef1e9+_0x6b91('0x45')]['update'](_0x3978e5['id'],{'autoreplyExecuted':!![]})[_0x6b91('0x3f')](function(_0xd442c3){logger['info'](_0x6b91('0x18'),_0x145642,JSON[_0x6b91('0x40')](_0xd442c3));})[_0x6b91('0x41')](function(_0x2b809a){logger[_0x6b91('0x42')](_0x6b91('0x46'),_0x145642,JSON['stringify'](_0x2b809a));});})[_0x6b91('0x3f')](function(){_0x4e633f[_0x6b91('0x13')]();});});}}}catch(_0x5b4d2e){logger[_0x6b91('0x42')](_0x6b91('0x12'),_0x145642,JSON[_0x6b91('0x40')](_0x5b4d2e));_0x4e633f[_0x6b91('0x47')]();}};};
\ No newline at end of file
index 091f556..8886b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe124=['Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system'];(function(_0x449041,_0x5d1a18){var _0x26dc8b=function(_0x5b8273){while(--_0x5b8273){_0x449041['push'](_0x449041['shift']());}};_0x26dc8b(++_0x5d1a18);}(_0xe124,0x81));var _0x4e12=function(_0x37e78a,_0x359621){_0x37e78a=_0x37e78a-0x0;var _0x505159=_0xe124[_0x37e78a];return _0x505159;};'use strict';var moment=require('moment');var logger=require(_0x4e12('0x0'))(_0x4e12('0x1'));var rpc={'chatInteraction':require(_0x4e12('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4e12('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x4e12('0x4')),'whatsappInteraction':require(_0x4e12('0x5'))};exports[_0x4e12('0x6')]=function(_0x31535c,_0x309a9a,_0x3705c5,_0x2b0ea7){return function(_0x27f2c0){try{logger[_0x4e12('0x7')](_0x4e12('0x8'),_0x31535c,_0x309a9a[0x0]);var _0x73b2d6={'closed':0x1,'closedAt':moment()[_0x4e12('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x4e12('0xa'),'disposition':_0x309a9a[0x0]};if(rpc[_0x2b0ea7['channel']+_0x4e12('0xb')]){rpc[_0x2b0ea7['channel']+'Interaction'][_0x4e12('0xc')](_0x2b0ea7[_0x4e12('0xd')]['id'],_0x73b2d6)[_0x4e12('0xe')](function(_0x2eeb3e){logger[_0x4e12('0x7')](_0x4e12('0xf'),_0x31535c,_0x2b0ea7[_0x4e12('0xd')]['id']);})['catch'](function(_0x5cdf04){logger[_0x4e12('0x10')](_0x4e12('0x11'),_0x31535c,JSON[_0x4e12('0x12')](_0x5cdf04));})['finally'](function(){_0x27f2c0[_0x4e12('0x13')]();});}}catch(_0x111c33){logger['error']('[%s][CLOSE]\x20%s',_0x31535c,JSON['stringify'](_0x111c33));_0x27f2c0[_0x4e12('0x13')]();}};};
\ No newline at end of file
+var _0xffef=['then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction'];(function(_0xbd4e,_0x39766d){var _0x503e7f=function(_0x110a7a){while(--_0x110a7a){_0xbd4e['push'](_0xbd4e['shift']());}};_0x503e7f(++_0x39766d);}(_0xffef,0x147));var _0xfffe=function(_0x6ab6fa,_0x2c6e2b){_0x6ab6fa=_0x6ab6fa-0x0;var _0xeb1ca9=_0xffef[_0x6ab6fa];return _0xeb1ca9;};'use strict';var moment=require(_0xfffe('0x0'));var logger=require(_0xfffe('0x1'))(_0xfffe('0x2'));var rpc={'chatInteraction':require(_0xfffe('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfffe('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xfffe('0x5'))};exports['consequence']=function(_0x137349,_0x2b45a0,_0x32dc8f,_0x126b73){return function(_0x1213b6){try{logger[_0xfffe('0x6')](_0xfffe('0x7'),_0x137349,_0x2b45a0[0x0]);var _0x572d82={'closed':0x1,'closedAt':moment()['format'](_0xfffe('0x8')),'closeReason':'system','disposition':_0x2b45a0[0x0]};if(rpc[_0x126b73[_0xfffe('0x9')]+_0xfffe('0xa')]){rpc[_0x126b73[_0xfffe('0x9')]+_0xfffe('0xa')][_0xfffe('0xb')](_0x126b73[_0xfffe('0xc')]['id'],_0x572d82)[_0xfffe('0xd')](function(_0x3cc655){logger[_0xfffe('0x6')](_0xfffe('0xe'),_0x137349,_0x126b73[_0xfffe('0xc')]['id']);})[_0xfffe('0xf')](function(_0x199cbc){logger['error']('[%s][CLOSE]\x20%s',_0x137349,JSON[_0xfffe('0x10')](_0x199cbc));})[_0xfffe('0x11')](function(){_0x1213b6[_0xfffe('0x12')]();});}}catch(_0x425370){logger[_0xfffe('0x13')]('[%s][CLOSE]\x20%s',_0x137349,JSON[_0xfffe('0x10')](_0x425370));_0x1213b6[_0xfffe('0x12')]();}};};
\ No newline at end of file
index f888cc1..802153f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf96b=['upperFirst','InteractionId','interaction','created','isEmpty','getMustacheRender','Message','then','body','catch','error','stringify','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','providerName','create','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId'];(function(_0x1c7edc,_0x3f8bdc){var _0x408d50=function(_0x316d58){while(--_0x316d58){_0x1c7edc['push'](_0x1c7edc['shift']());}};_0x408d50(++_0x3f8bdc);}(_0xf96b,0x109));var _0xbf96=function(_0x3937fd,_0x31b45e){_0x3937fd=_0x3937fd-0x0;var _0x29d86e=_0xf96b[_0x3937fd];return _0x29d86e;};'use strict';var _=require(_0xbf96('0x0'));var moment=require(_0xbf96('0x1'));var apiai=require(_0xbf96('0x2'));var md5=require(_0xbf96('0x3'));var utils=require(_0xbf96('0x4'));var logger=require(_0xbf96('0x5'))(_0xbf96('0x6'));var rpc={'chatMessage':require(_0xbf96('0x7')),'openchannelMessage':require(_0xbf96('0x8')),'mailMessage':require(_0xbf96('0x9')),'smsMessage':require(_0xbf96('0xa')),'faxMessage':require(_0xbf96('0xb')),'whatsappMessage':require(_0xbf96('0xc'))};exports['consequence']=function(_0x3e8271,_0x9270ca){return function(_0x260da0){try{if(!_[_0xbf96('0xd')](this['interaction'][_0xbf96('0xe')])){logger[_0xbf96('0xf')](_0xbf96('0x10'),_0x3e8271,_0xbf96('0x11'));return _0x260da0[_0xbf96('0x12')]();}var _0x1eec6a={'ContactId':this[_0xbf96('0x13')]['id'],'sentAt':moment()[_0xbf96('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xbf96('0x15')};if(this[_0xbf96('0x16')]==='sms'||this[_0xbf96('0x16')]===_0xbf96('0x17')){_0x1eec6a[_0xbf96('0x18')]=this['interaction'][_0xbf96('0x18')];}var _0x147dae=this[_0xbf96('0x16')];if(_0x147dae===_0xbf96('0x19')){_0x1eec6a[_0xbf96('0x1a')]=this[_0xbf96('0x1b')]['id'];}else{_0x1eec6a[_['upperFirst'](_0x147dae)+_0xbf96('0x1c')]=this[_0xbf96('0x1b')]['id'];}_0x1eec6a[_[_0xbf96('0x1d')](_0x147dae)+_0xbf96('0x1e')]=this[_0xbf96('0x1f')]['id'];if(this[_0xbf96('0x1f')][_0xbf96('0x20')]){var _0x5c5a5e=_0x9270ca[0x2];if(!_[_0xbf96('0x21')](_0x5c5a5e)){_0x1eec6a['body']=utils[_0xbf96('0x22')](_0x5c5a5e,this);return rpc[_0x147dae+_0xbf96('0x23')]['create'](_0x1eec6a)[_0xbf96('0x24')](function(_0x64b2f9){logger['info'](_0xbf96('0x10'),_0x3e8271,_0x1eec6a[_0xbf96('0x25')]);})[_0xbf96('0x26')](function(_0x1d4fc1){logger[_0xbf96('0x27')](_0xbf96('0x10'),_0x3e8271,JSON[_0xbf96('0x28')](_0x1d4fc1));})['finally'](function(){logger[_0xbf96('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3e8271);_0x260da0[_0xbf96('0x29')]();});}else{logger[_0xbf96('0xf')](_0xbf96('0x2a'),_0x3e8271);_0x260da0['stop']();}}else{var _0x21cf3c=this;var _0x55025c=apiai(_0x9270ca[0x0],{'language':_0x9270ca[0x1]||'en'});return _0x55025c[_0xbf96('0x2b')](this[_0xbf96('0x2c')][_0xbf96('0x25')],{'sessionId':md5(this['interaction']['id'])})[_0xbf96('0x24')](function(_0xf132af){_0x21cf3c['body']['dialogflow']=_0xf132af;_0x1eec6a[_0xbf96('0x25')]=_0xf132af[_0xbf96('0x2d')][_0xbf96('0x2e')]['speech'];_0x1eec6a[_0xbf96('0x2f')]='dialogflow';_0x1eec6a['providerResponse']=JSON[_0xbf96('0x28')](_0xf132af);return rpc[_0x147dae+_0xbf96('0x23')][_0xbf96('0x30')](_0x1eec6a)[_0xbf96('0x24')](function(_0x545ac6){logger[_0xbf96('0xf')](_0xbf96('0x10'),_0x3e8271,_0x1eec6a[_0xbf96('0x25')]);if(_0xf132af[_0xbf96('0x2d')]['metadata']['endConversation']){_0x260da0[_0xbf96('0x12')]();}else{_0x260da0[_0xbf96('0x29')]();}})[_0xbf96('0x26')](function(_0xb248da){logger[_0xbf96('0x27')](_0xbf96('0x10'),_0x3e8271,JSON[_0xbf96('0x28')](_0xb248da));_0x260da0[_0xbf96('0x12')]();});})['catch'](function(_0x2725cf){logger[_0xbf96('0x27')](_0xbf96('0x10'),_0x3e8271,_0x2725cf['message']);_0x260da0['next']();});}}catch(_0x315968){logger['error'](_0xbf96('0x10'),_0x3e8271,JSON[_0xbf96('0x28')](_0x315968));_0x260da0[_0xbf96('0x29')]();}};};
\ No newline at end of file
+var _0xdbf5=['../../rpc/whatsappMessage','consequence','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','phone','account','upperFirst','InteractionId','created','getMustacheRender','Message','create','then','error','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','body','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','catch','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xff37fc,_0x22b5b5){_0xff37fc=_0xff37fc-0x0;var _0x32f1b4=_0xdbf5[_0xff37fc];return _0x32f1b4;};'use strict';var _=require('lodash');var moment=require(_0x5dbf('0x0'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0x5dbf('0x1'));var logger=require(_0x5dbf('0x2'))(_0x5dbf('0x3'));var rpc={'chatMessage':require(_0x5dbf('0x4')),'openchannelMessage':require(_0x5dbf('0x5')),'mailMessage':require(_0x5dbf('0x6')),'smsMessage':require(_0x5dbf('0x7')),'faxMessage':require(_0x5dbf('0x8')),'whatsappMessage':require(_0x5dbf('0x9'))};exports[_0x5dbf('0xa')]=function(_0x209b7d,_0x88128e){return function(_0x93e657){try{if(!_['isNil'](this[_0x5dbf('0xb')]['UserId'])){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x209b7d,_0x5dbf('0xe'));return _0x93e657[_0x5dbf('0xf')]();}var _0x4efed3={'ContactId':this[_0x5dbf('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x5dbf('0x11')};if(this['channel']==='sms'||this[_0x5dbf('0x12')]==='whatsapp'){_0x4efed3[_0x5dbf('0x13')]=this[_0x5dbf('0xb')][_0x5dbf('0x13')];}var _0x7cb848=this[_0x5dbf('0x12')];if(_0x7cb848==='chat'){_0x4efed3['ChatWebsiteId']=this[_0x5dbf('0x14')]['id'];}else{_0x4efed3[_[_0x5dbf('0x15')](_0x7cb848)+'AccountId']=this[_0x5dbf('0x14')]['id'];}_0x4efed3[_[_0x5dbf('0x15')](_0x7cb848)+_0x5dbf('0x16')]=this[_0x5dbf('0xb')]['id'];if(this[_0x5dbf('0xb')][_0x5dbf('0x17')]){var _0x2d32cc=_0x88128e[0x2];if(!_['isEmpty'](_0x2d32cc)){_0x4efed3['body']=utils[_0x5dbf('0x18')](_0x2d32cc,this);return rpc[_0x7cb848+_0x5dbf('0x19')][_0x5dbf('0x1a')](_0x4efed3)[_0x5dbf('0x1b')](function(_0x20c2b0){logger['info'](_0x5dbf('0xd'),_0x209b7d,_0x4efed3['body']);})['catch'](function(_0x577ca2){logger[_0x5dbf('0x1c')](_0x5dbf('0xd'),_0x209b7d,JSON[_0x5dbf('0x1d')](_0x577ca2));})[_0x5dbf('0x1e')](function(){logger[_0x5dbf('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x209b7d);_0x93e657[_0x5dbf('0x1f')]();});}else{logger['info'](_0x5dbf('0x20'),_0x209b7d);_0x93e657[_0x5dbf('0x1f')]();}}else{var _0x14d133=this;var _0x43a612=apiai(_0x88128e[0x0],{'language':_0x88128e[0x1]||'en'});return _0x43a612[_0x5dbf('0x21')](this[_0x5dbf('0x22')]['body'],{'sessionId':md5(this[_0x5dbf('0xb')]['id'])})[_0x5dbf('0x1b')](function(_0x2d3e1b){_0x14d133[_0x5dbf('0x23')][_0x5dbf('0x24')]=_0x2d3e1b;_0x4efed3[_0x5dbf('0x23')]=_0x2d3e1b[_0x5dbf('0x25')][_0x5dbf('0x26')][_0x5dbf('0x27')];_0x4efed3[_0x5dbf('0x28')]=_0x5dbf('0x24');_0x4efed3[_0x5dbf('0x29')]=JSON[_0x5dbf('0x1d')](_0x2d3e1b);return rpc[_0x7cb848+_0x5dbf('0x19')][_0x5dbf('0x1a')](_0x4efed3)[_0x5dbf('0x1b')](function(_0x466985){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x209b7d,_0x4efed3[_0x5dbf('0x23')]);if(_0x2d3e1b[_0x5dbf('0x25')][_0x5dbf('0x2a')][_0x5dbf('0x2b')]){_0x93e657['next']();}else{_0x93e657[_0x5dbf('0x1f')]();}})[_0x5dbf('0x2c')](function(_0xc4748){logger[_0x5dbf('0x1c')](_0x5dbf('0xd'),_0x209b7d,JSON[_0x5dbf('0x1d')](_0xc4748));_0x93e657[_0x5dbf('0xf')]();});})[_0x5dbf('0x2c')](function(_0x406ce6){logger[_0x5dbf('0x1c')](_0x5dbf('0xd'),_0x209b7d,_0x406ce6['message']);_0x93e657['next']();});}}catch(_0xf429ae){logger[_0x5dbf('0x1c')](_0x5dbf('0xd'),_0x209b7d,JSON[_0x5dbf('0x1d')](_0xf429ae));_0x93e657[_0x5dbf('0x1f')]();}};};
\ No newline at end of file
index 2e3985e..299d097 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3487=['bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','body','catch','error','[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','diagnosticInfo','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','fields','end_conversation','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','push','lodash','dialogflow','md5'];(function(_0x618644,_0x24242b){var _0x401623=function(_0x58dcce){while(--_0x58dcce){_0x618644['push'](_0x618644['shift']());}};_0x401623(++_0x24242b);}(_0x3487,0xd8));var _0x7348=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x3487[_0x4164f2];return _0x2575c7;};'use strict';var _=require(_0x7348('0x0'));var dialogflow=require(_0x7348('0x1'));var md5=require(_0x7348('0x2'));var moment=require('moment');var Promise=require(_0x7348('0x3'));var logger=require(_0x7348('0x4'))('routing');var utils=require(_0x7348('0x5'));var rpc={'chatMessage':require(_0x7348('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7348('0x7')),'smsMessage':require(_0x7348('0x8')),'faxMessage':require(_0x7348('0x9')),'whatsappMessage':require(_0x7348('0xa'))};function createMessage(_0x591fbe,_0x323568,_0x488767,_0x4ddafb){return new Promise(function(_0x40e2d1,_0x21a0b6){var _0x5e6dd8=_[_0x7348('0xb')](_0x488767);_0x5e6dd8['body']=_0x4ddafb;return rpc[_0x323568+_0x7348('0xc')][_0x7348('0xd')](_0x5e6dd8)[_0x7348('0xe')](function(){logger[_0x7348('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x591fbe,_0x5e6dd8[_0x7348('0x10')]);_0x40e2d1();})[_0x7348('0x11')](function(_0x332de1){logger[_0x7348('0x12')](_0x7348('0x13'),_0x591fbe,JSON['stringify'](_0x332de1));_0x21a0b6(_0x332de1);});});}exports[_0x7348('0x14')]=function(_0x3099c3,_0x5f1268){return function(_0x383af6){try{if(!_[_0x7348('0x15')](this['interaction'][_0x7348('0x16')])){logger[_0x7348('0xf')](_0x7348('0x13'),_0x3099c3,_0x7348('0x17'));return _0x383af6[_0x7348('0x18')]();}var _0x571451={'ContactId':this[_0x7348('0x19')]['id'],'sentAt':moment()[_0x7348('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x7348('0x1b')};if(this[_0x7348('0x1c')]===_0x7348('0x1d')||this['channel']===_0x7348('0x1e')){_0x571451[_0x7348('0x1f')]=this[_0x7348('0x20')][_0x7348('0x1f')];}var _0xd45a03=this[_0x7348('0x1c')];if(_0xd45a03===_0x7348('0x21')){_0x571451[_0x7348('0x22')]=this[_0x7348('0x23')]['id'];}else{_0x571451[_['upperFirst'](_0xd45a03)+_0x7348('0x24')]=this['account']['id'];}_0x571451[_[_0x7348('0x25')](_0xd45a03)+_0x7348('0x26')]=this['interaction']['id'];if(this[_0x7348('0x20')][_0x7348('0x27')]){var _0x404b6c=_0x5f1268[0x4];if(!_[_0x7348('0x28')](_0x404b6c)){_0x571451['body']=utils[_0x7348('0x29')](_0x404b6c,this);return rpc[_0xd45a03+_0x7348('0xc')]['create'](_0x571451)[_0x7348('0xe')](function(_0x460195){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x3099c3,_0x571451[_0x7348('0x10')]);})[_0x7348('0x11')](function(_0x12e6cf){logger[_0x7348('0x12')](_0x7348('0x13'),_0x3099c3,JSON[_0x7348('0x2a')](_0x12e6cf));})[_0x7348('0x2b')](function(){logger['info'](_0x7348('0x2c'),_0x3099c3);_0x383af6[_0x7348('0x2d')]();});}else{logger[_0x7348('0xf')](_0x7348('0x2e'),_0x3099c3);_0x383af6[_0x7348('0x2d')]();}}else{var _0x47867f=this;var _0x4e90ab=_0x5f1268[0x2][_0x7348('0x2f')](/\\n/g,'\x0a');var _0x133fa7={'credentials':{'private_key':_0x4e90ab,'client_email':_0x5f1268[0x1]}};var _0x553b51=new dialogflow[(_0x7348('0x30'))](_0x133fa7);var _0x36b65b=_0x553b51[_0x7348('0x31')](_0x5f1268[0x0],md5(_0x47867f[_0x7348('0x20')]['id']));var _0x33f614={'session':_0x36b65b,'queryInput':{'text':{'text':_0x47867f[_0x7348('0x32')][_0x7348('0x10')],'languageCode':_0x5f1268[0x3]||'en'}}};return _0x553b51['detectIntent'](_0x33f614)[_0x7348('0xe')](function(_0x896ee7){if(_0x896ee7&&_0x896ee7[_0x7348('0x33')]){_0x47867f[_0x7348('0x10')][_0x7348('0x34')]=_0x896ee7;var _0x3db360=_0x896ee7[0x0];var _0x46ce64=_0x3db360[_0x7348('0x35')]['diagnosticInfo']&&_0x3db360[_0x7348('0x35')][_0x7348('0x36')]['fields']?_0x3db360['queryResult'][_0x7348('0x36')]['fields']['end_conversation'][_0x7348('0x37')]:![];_0x47867f[_0x7348('0x10')][_0x7348('0x38')]=_0x3db360[_0x7348('0x35')]['action'];_0x47867f[_0x7348('0x10')][_0x7348('0x39')]=_0x3db360[_0x7348('0x35')]['allRequiredParamsPresent'];_0x47867f[_0x7348('0x10')][_0x7348('0x3a')]=_0x3db360[_0x7348('0x35')][_0x7348('0x36')]&&_0x3db360[_0x7348('0x35')][_0x7348('0x36')][_0x7348('0x3b')]?_0x3db360[_0x7348('0x35')][_0x7348('0x36')]['fields'][_0x7348('0x3c')][_0x7348('0x37')]:![];_0x47867f[_0x7348('0x10')]['DIALOGFLOWV2_INTENTNAME']=_0x3db360[_0x7348('0x35')][_0x7348('0x3d')][_0x7348('0x3e')];_0x47867f[_0x7348('0x10')][_0x7348('0x3f')]=_0x3db360[_0x7348('0x35')][_0x7348('0x3d')][_0x7348('0x40')];_0x47867f[_0x7348('0x10')][_0x7348('0x41')]=_0x3db360[_0x7348('0x35')][_0x7348('0x3d')]['isFallback'];_0x47867f[_0x7348('0x10')][_0x7348('0x42')]=_0x3db360[_0x7348('0x35')][_0x7348('0x43')];_0x47867f[_0x7348('0x10')]['DIALOGFLOWV2_QUERYTEXT']=_0x3db360[_0x7348('0x35')]['queryText'];_0x47867f[_0x7348('0x10')][_0x7348('0x44')]=_0x3db360[_0x7348('0x35')][_0x7348('0x45')];_0x571451['providerName']=_0x7348('0x34');_0x571451[_0x7348('0x46')]=JSON[_0x7348('0x2a')](_0x896ee7);var _0x168f3b=[];for(var _0x9f446a=0x0;_0x9f446a<_0x896ee7[_0x7348('0x33')];_0x9f446a++){var _0x212b36=_0x896ee7[_0x9f446a];if(_0x212b36&&_0x212b36[_0x7348('0x35')]&&_0x212b36[_0x7348('0x35')][_0x7348('0x47')]){_0x168f3b[_0x7348('0x48')](createMessage(_0x3099c3,_0xd45a03,_0x571451,_0x212b36[_0x7348('0x35')]['fulfillmentText']));}}return Promise['all'](_0x168f3b)[_0x7348('0xe')](function(){if(_0x46ce64){_0x383af6[_0x7348('0x18')]();}else{_0x383af6[_0x7348('0x2d')]();}})['catch'](function(_0x166ace){logger[_0x7348('0x12')](_0x7348('0x13'),_0x3099c3,JSON[_0x7348('0x2a')](_0x166ace));_0x383af6[_0x7348('0x18')]();});}})[_0x7348('0x11')](function(_0x15bfcb){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x3099c3,_0x15bfcb['message']);_0x383af6[_0x7348('0x18')]();});}}catch(_0x11d209){logger[_0x7348('0x12')](_0x7348('0x13'),_0x3099c3,JSON[_0x7348('0x2a')](_0x11d209));_0x383af6[_0x7348('0x2d')]();}};};
\ No newline at end of file
+var _0x4226=['clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','stringify','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','fields','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','all','error','dialogflow','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0x4226,0x1dc));var _0x6422=function(_0xbdfa2a,_0x33c6a4){_0xbdfa2a=_0xbdfa2a-0x0;var _0x304b8d=_0x4226[_0xbdfa2a];return _0x304b8d;};'use strict';var _=require('lodash');var dialogflow=require(_0x6422('0x0'));var md5=require('md5');var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x6422('0x1'))(_0x6422('0x2'));var utils=require('./utils');var rpc={'chatMessage':require(_0x6422('0x3')),'openchannelMessage':require(_0x6422('0x4')),'mailMessage':require(_0x6422('0x5')),'smsMessage':require(_0x6422('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x5a2450,_0x1eb320,_0x5b6c6d,_0x304998){return new Promise(function(_0xd422a2,_0x5aa3db){var _0x2143c6=_[_0x6422('0x7')](_0x5b6c6d);_0x2143c6['body']=_0x304998;return rpc[_0x1eb320+_0x6422('0x8')][_0x6422('0x9')](_0x2143c6)[_0x6422('0xa')](function(){logger[_0x6422('0xb')](_0x6422('0xc'),_0x5a2450,_0x2143c6[_0x6422('0xd')]);_0xd422a2();})[_0x6422('0xe')](function(_0x12a92d){logger['error'](_0x6422('0xc'),_0x5a2450,JSON[_0x6422('0xf')](_0x12a92d));_0x5aa3db(_0x12a92d);});});}exports['consequence']=function(_0x5c244d,_0x399362){return function(_0x2e4b66){try{if(!_['isNil'](this[_0x6422('0x10')]['UserId'])){logger[_0x6422('0xb')](_0x6422('0xc'),_0x5c244d,_0x6422('0x11'));return _0x2e4b66[_0x6422('0x12')]();}var _0x5e7103={'ContactId':this[_0x6422('0x13')]['id'],'sentAt':moment()[_0x6422('0x14')](_0x6422('0x15')),'direction':_0x6422('0x16')};if(this['channel']===_0x6422('0x17')||this['channel']===_0x6422('0x18')){_0x5e7103['phone']=this[_0x6422('0x10')][_0x6422('0x19')];}var _0x23e164=this[_0x6422('0x1a')];if(_0x23e164===_0x6422('0x1b')){_0x5e7103[_0x6422('0x1c')]=this['account']['id'];}else{_0x5e7103[_['upperFirst'](_0x23e164)+_0x6422('0x1d')]=this[_0x6422('0x1e')]['id'];}_0x5e7103[_[_0x6422('0x1f')](_0x23e164)+_0x6422('0x20')]=this[_0x6422('0x10')]['id'];if(this[_0x6422('0x10')][_0x6422('0x21')]){var _0x1339a8=_0x399362[0x4];if(!_['isEmpty'](_0x1339a8)){_0x5e7103['body']=utils[_0x6422('0x22')](_0x1339a8,this);return rpc[_0x23e164+'Message'][_0x6422('0x9')](_0x5e7103)[_0x6422('0xa')](function(_0xb0e33a){logger['info'](_0x6422('0xc'),_0x5c244d,_0x5e7103[_0x6422('0xd')]);})[_0x6422('0xe')](function(_0x423d89){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5c244d,JSON[_0x6422('0xf')](_0x423d89));})[_0x6422('0x23')](function(){logger[_0x6422('0xb')](_0x6422('0x24'),_0x5c244d);_0x2e4b66[_0x6422('0x25')]();});}else{logger['info'](_0x6422('0x26'),_0x5c244d);_0x2e4b66[_0x6422('0x25')]();}}else{var _0x316d97=this;var _0x5efa1e=_0x399362[0x2][_0x6422('0x27')](/\\n/g,'\x0a');var _0x26c68e={'credentials':{'private_key':_0x5efa1e,'client_email':_0x399362[0x1]}};var _0x464246=new dialogflow['SessionsClient'](_0x26c68e);var _0x21c503=_0x464246['sessionPath'](_0x399362[0x0],md5(_0x316d97['interaction']['id']));var _0x4961a0={'session':_0x21c503,'queryInput':{'text':{'text':_0x316d97[_0x6422('0x28')][_0x6422('0xd')],'languageCode':_0x399362[0x3]||'en'}}};return _0x464246[_0x6422('0x29')](_0x4961a0)[_0x6422('0xa')](function(_0x5443fa){if(_0x5443fa&&_0x5443fa[_0x6422('0x2a')]){_0x316d97[_0x6422('0xd')][_0x6422('0x2b')]=_0x5443fa;var _0x16af15=_0x5443fa[0x0];var _0x55ecae=_0x16af15[_0x6422('0x2c')][_0x6422('0x2d')]&&_0x16af15[_0x6422('0x2c')][_0x6422('0x2d')]['fields']?_0x16af15[_0x6422('0x2c')][_0x6422('0x2d')]['fields']['end_conversation'][_0x6422('0x2e')]:![];_0x316d97['body'][_0x6422('0x2f')]=_0x16af15[_0x6422('0x2c')]['action'];_0x316d97['body'][_0x6422('0x30')]=_0x16af15[_0x6422('0x2c')]['allRequiredParamsPresent'];_0x316d97[_0x6422('0xd')][_0x6422('0x31')]=_0x16af15[_0x6422('0x2c')][_0x6422('0x2d')]&&_0x16af15[_0x6422('0x2c')][_0x6422('0x2d')]['fields']?_0x16af15[_0x6422('0x2c')]['diagnosticInfo'][_0x6422('0x32')][_0x6422('0x33')][_0x6422('0x2e')]:![];_0x316d97['body'][_0x6422('0x34')]=_0x16af15[_0x6422('0x2c')][_0x6422('0x35')][_0x6422('0x36')];_0x316d97[_0x6422('0xd')][_0x6422('0x37')]=_0x16af15[_0x6422('0x2c')][_0x6422('0x35')][_0x6422('0x38')];_0x316d97[_0x6422('0xd')][_0x6422('0x39')]=_0x16af15[_0x6422('0x2c')][_0x6422('0x35')][_0x6422('0x3a')];_0x316d97[_0x6422('0xd')][_0x6422('0x3b')]=_0x16af15['queryResult'][_0x6422('0x3c')];_0x316d97['body']['DIALOGFLOWV2_QUERYTEXT']=_0x16af15[_0x6422('0x2c')][_0x6422('0x3d')];_0x316d97[_0x6422('0xd')][_0x6422('0x3e')]=_0x16af15['queryResult'][_0x6422('0x3f')];_0x5e7103[_0x6422('0x40')]=_0x6422('0x2b');_0x5e7103['providerResponse']=JSON['stringify'](_0x5443fa);var _0x54122f=[];for(var _0x5218d2=0x0;_0x5218d2<_0x5443fa[_0x6422('0x2a')];_0x5218d2++){var _0x5b3bce=_0x5443fa[_0x5218d2];if(_0x5b3bce&&_0x5b3bce[_0x6422('0x2c')]&&_0x5b3bce['queryResult'][_0x6422('0x41')]){_0x54122f[_0x6422('0x42')](createMessage(_0x5c244d,_0x23e164,_0x5e7103,_0x5b3bce[_0x6422('0x2c')][_0x6422('0x41')]));}}return Promise[_0x6422('0x43')](_0x54122f)[_0x6422('0xa')](function(){if(_0x55ecae){_0x2e4b66['next']();}else{_0x2e4b66[_0x6422('0x25')]();}})[_0x6422('0xe')](function(_0x3f90f6){logger[_0x6422('0x44')](_0x6422('0xc'),_0x5c244d,JSON[_0x6422('0xf')](_0x3f90f6));_0x2e4b66['next']();});}})[_0x6422('0xe')](function(_0x5702a4){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5c244d,_0x5702a4['message']);_0x2e4b66[_0x6422('0x12')]();});}}catch(_0x31cfb2){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5c244d,JSON[_0x6422('0xf')](_0x31cfb2));_0x2e4b66[_0x6422('0x25')]();}};};
\ No newline at end of file
index 50cfd75..e4c80e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07ca=['stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x07ca,0x1a0));var _0xa07c=function(_0x188945,_0x2aafa5){_0x188945=_0x188945-0x0;var _0x4959c2=_0x07ca[_0x188945];return _0x4959c2;};'use strict';var schema=require(_0xa07c('0x0'));var _=require(_0xa07c('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xa07c('0x2'));var logger=require(_0xa07c('0x3'))(_0xa07c('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xa07c('0x5')},'priorityTrue':{'type':_0xa07c('0x6'),'message':_0xa07c('0x7')},'priorityFalse':{'type':_0xa07c('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xa07c('0x8')]=function(_0x41e1b5,_0x29c44c){return function(_0x1da611){try{var _0x591a9f={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x29c44c[0x0],this),{'wordwrap':![]})[_0xa07c('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x29c44c[0x1],'priorityFalse':_0x29c44c[0x2]};var _0x38eeab=gotoif['validate'](_0x591a9f,{'typecast':!![]});if(_0x38eeab[_0xa07c('0xa')]){logger[_0xa07c('0xb')](_0xa07c('0xc'),_0x41e1b5,_[_0xa07c('0xd')](_0x38eeab,_0xa07c('0xe'))[_0xa07c('0xf')](',\x20'));_0x1da611[_0xa07c('0x10')]();}else{try{var _0x492d9c=eval('('+_0x591a9f[_0xa07c('0x11')]+')');var _0x302092=_0x492d9c?_0x591a9f['priorityTrue']:_0x591a9f[_0xa07c('0x12')];logger[_0xa07c('0x13')](_0xa07c('0x14'),_0x41e1b5,_0x591a9f[_0xa07c('0x11')],_0x492d9c,_0x302092||'next');if(_0x302092){var _0x35c92f=_[_0xa07c('0x15')](_0x1da611[_0xa07c('0x16')](),{'p':_0x302092});if(_0x35c92f>=0x0){logger[_0xa07c('0x13')](_0xa07c('0x17'),_0x41e1b5,_0x302092||_0xa07c('0x18'),_0x35c92f);_0x1da611['next'](_0x35c92f);}else{logger[_0xa07c('0x13')](_0xa07c('0x19'),_0x41e1b5,_0x302092||_0xa07c('0x18'));_0x1da611[_0xa07c('0x10')]();}}else{_0x1da611['next']();}}catch(_0x51e066){logger[_0xa07c('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x41e1b5,_0x51e066[_0xa07c('0xe')]);_0x1da611[_0xa07c('0x10')]();}}}catch(_0x549710){logger['error'](_0xa07c('0xc'),_0x41e1b5,JSON[_0xa07c('0x1a')](_0x549710));_0x1da611[_0xa07c('0x10')]();}};};
\ No newline at end of file
+var _0x309d=['html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','message','join','stop','condition','priorityFalse','info','findIndex','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify'];(function(_0x211ac3,_0x1c8d21){var _0x2a4603=function(_0x4127ec){while(--_0x4127ec){_0x211ac3['push'](_0x211ac3['shift']());}};_0x2a4603(++_0x1c8d21);}(_0x309d,0x10e));var _0xd309=function(_0x1c04fa,_0x4354d1){_0x1c04fa=_0x1c04fa-0x0;var _0x40ebfe=_0x309d[_0x1c04fa];return _0x40ebfe;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0xd309('0x0'));var utils=require(_0xd309('0x1'));var logger=require(_0xd309('0x2'))(_0xd309('0x3'));var gotoif=schema({'condition':{'type':_0xd309('0x4'),'required':!![],'message':_0xd309('0x5')},'priorityTrue':{'type':_0xd309('0x6'),'message':_0xd309('0x7')},'priorityFalse':{'type':_0xd309('0x6'),'message':_0xd309('0x8')}});exports[_0xd309('0x9')]=function(_0x477a2c,_0x214d3e){return function(_0x5634d4){try{var _0x1a9ed5={'condition':htmlToText[_0xd309('0xa')](utils['getMustacheRender'](_0x214d3e[0x0],this),{'wordwrap':![]})[_0xd309('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x214d3e[0x1],'priorityFalse':_0x214d3e[0x2]};var _0x1754fb=gotoif['validate'](_0x1a9ed5,{'typecast':!![]});if(_0x1754fb[_0xd309('0xc')]){logger[_0xd309('0xd')]('[%s][GOTOIF]\x20%s',_0x477a2c,_['map'](_0x1754fb,_0xd309('0xe'))[_0xd309('0xf')](',\x20'));_0x5634d4[_0xd309('0x10')]();}else{try{var _0x29d8f5=eval('('+_0x1a9ed5[_0xd309('0x11')]+')');var _0x35d947=_0x29d8f5?_0x1a9ed5['priorityTrue']:_0x1a9ed5[_0xd309('0x12')];logger[_0xd309('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x477a2c,_0x1a9ed5[_0xd309('0x11')],_0x29d8f5,_0x35d947||'next');if(_0x35d947){var _0x45789b=_[_0xd309('0x14')](_0x5634d4[_0xd309('0x15')](),{'p':_0x35d947});if(_0x45789b>=0x0){logger[_0xd309('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x477a2c,_0x35d947||_0xd309('0x16'),_0x45789b);_0x5634d4['next'](_0x45789b);}else{logger[_0xd309('0x13')](_0xd309('0x17'),_0x477a2c,_0x35d947||'next');_0x5634d4[_0xd309('0x10')]();}}else{_0x5634d4[_0xd309('0x16')]();}}catch(_0x2d45aa){logger[_0xd309('0xd')](_0xd309('0x18'),_0x477a2c,_0x2d45aa['message']);_0x5634d4['stop']();}}}catch(_0x29e25a){logger[_0xd309('0xd')](_0xd309('0x19'),_0x477a2c,JSON[_0xd309('0x1a')](_0x29e25a));_0x5634d4[_0xd309('0x10')]();}};};
\ No newline at end of file
index ca89084..f8d99dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3527=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','stop'];(function(_0x13639d,_0x3c996b){var _0x52ef14=function(_0x3faf51){while(--_0x3faf51){_0x13639d['push'](_0x13639d['shift']());}};_0x52ef14(++_0x3c996b);}(_0x3527,0x1ad));var _0x7352=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x3527[_0x4b6778];return _0x22dbb9;};'use strict';var schema=require(_0x7352('0x0'));var _=require(_0x7352('0x1'));var logger=require(_0x7352('0x2'))(_0x7352('0x3'));var gotop=schema({'priority':{'type':_0x7352('0x4'),'required':!![],'message':_0x7352('0x5')}});exports[_0x7352('0x6')]=function(_0x547dcf,_0xd12e80){return function(_0xb0a7a3){try{var _0x38247e={'priority':_0xd12e80[0x0]};var _0x15f2b1=gotop['validate'](_0x38247e,{'typecast':!![]});if(_0x15f2b1[_0x7352('0x7')]){logger[_0x7352('0x8')]('[%s][GOTOP]\x20%s',_0x547dcf,_[_0x7352('0x9')](_0x15f2b1,_0x7352('0xa'))['join'](',\x20'));_0xb0a7a3[_0x7352('0xb')]();}else{logger[_0x7352('0xc')](_0x7352('0xd'),_0x547dcf,_0x38247e[_0x7352('0xe')]);if(_0x38247e[_0x7352('0xe')]){var _0xb8e641=_[_0x7352('0xf')](_0xb0a7a3['rules'](),{'p':_0x38247e[_0x7352('0xe')]});if(_0xb8e641>=0x0){logger['info'](_0x7352('0x10'),_0x547dcf,_0x38247e['priority']||_0x7352('0x11'),_0xb8e641);_0xb0a7a3['next'](_0xb8e641);}else{logger[_0x7352('0xc')](_0x7352('0x12'),_0x547dcf,_0x38247e[_0x7352('0xe')]||_0x7352('0x11'));_0xb0a7a3['stop']();}}else{_0xb0a7a3['next']();}}}catch(_0x5f048a){logger[_0x7352('0x8')](_0x7352('0x13'),_0x547dcf,JSON[_0x7352('0x14')](_0x5f048a));_0xb0a7a3[_0x7352('0xb')]();}};};
\ No newline at end of file
+var _0x61a5=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','number','consequence','validate','error','map','message','join','stop','info'];(function(_0x4b5fd8,_0x16d74d){var _0xd32a24=function(_0x2b5ad3){while(--_0x2b5ad3){_0x4b5fd8['push'](_0x4b5fd8['shift']());}};_0xd32a24(++_0x16d74d);}(_0x61a5,0xdb));var _0x561a=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0x61a5[_0x510c60];return _0x49c4aa;};'use strict';var schema=require('validate');var _=require(_0x561a('0x0'));var logger=require(_0x561a('0x1'))(_0x561a('0x2'));var gotop=schema({'priority':{'type':_0x561a('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x561a('0x4')]=function(_0x147747,_0x496cb8){return function(_0x17f33e){try{var _0x5f08b8={'priority':_0x496cb8[0x0]};var _0x5c67cf=gotop[_0x561a('0x5')](_0x5f08b8,{'typecast':!![]});if(_0x5c67cf['length']){logger[_0x561a('0x6')]('[%s][GOTOP]\x20%s',_0x147747,_[_0x561a('0x7')](_0x5c67cf,_0x561a('0x8'))[_0x561a('0x9')](',\x20'));_0x17f33e[_0x561a('0xa')]();}else{logger[_0x561a('0xb')](_0x561a('0xc'),_0x147747,_0x5f08b8[_0x561a('0xd')]);if(_0x5f08b8[_0x561a('0xd')]){var _0x48e45f=_[_0x561a('0xe')](_0x17f33e[_0x561a('0xf')](),{'p':_0x5f08b8[_0x561a('0xd')]});if(_0x48e45f>=0x0){logger['info'](_0x561a('0x10'),_0x147747,_0x5f08b8[_0x561a('0xd')]||_0x561a('0x11'),_0x48e45f);_0x17f33e['next'](_0x48e45f);}else{logger['info'](_0x561a('0x12'),_0x147747,_0x5f08b8['priority']||_0x561a('0x11'));_0x17f33e[_0x561a('0xa')]();}}else{_0x17f33e[_0x561a('0x11')]();}}}catch(_0x5307e3){logger['error'](_0x561a('0x13'),_0x147747,JSON[_0x561a('0x14')](_0x5307e3));_0x17f33e[_0x561a('0xa')]();}};};
\ No newline at end of file
index aa35fc5..912a2ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98ce=['lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x98ce,0x113));var _0xe98c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x98ce[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe98c('0x0'));var utils=require('./utils');var logger=require(_0xe98c('0x1'))('routing');var rpc={'chatMessage':require(_0xe98c('0x2')),'openchannelMessage':require(_0xe98c('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe98c('0x4')),'faxMessage':require(_0xe98c('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xf7416a,_0x4a2f89){return function(_0x182999){try{var _0x5e09be={'body':utils[_0xe98c('0x6')](_0x4a2f89[0x0],this),'ContactId':this[_0xe98c('0x7')]['id']};if(this[_0xe98c('0x8')]===_0xe98c('0x9')){_0x5e09be[_0xe98c('0xa')]=this[_0xe98c('0xb')]['id'];}else{_0x5e09be[_[_0xe98c('0xc')](this[_0xe98c('0x8')])+_0xe98c('0xd')]=this[_0xe98c('0xb')]['id'];}_0x5e09be[_[_0xe98c('0xc')](this[_0xe98c('0x8')])+'InteractionId']=this[_0xe98c('0xe')]['id'];if(rpc[this[_0xe98c('0x8')]+'Message']){return rpc[this['channel']+_0xe98c('0xf')]['create'](_0x5e09be)[_0xe98c('0x10')](function(_0x1c7d2c){logger[_0xe98c('0x11')](_0xe98c('0x12'),_0xf7416a,_0x5e09be[_0xe98c('0x13')]);_0x182999[_0xe98c('0x14')]();})[_0xe98c('0x15')](function(_0x4808d0){logger[_0xe98c('0x16')]('[%s][MESSAGE]\x20%s',_0xf7416a,JSON[_0xe98c('0x17')](_0x4808d0));_0x182999[_0xe98c('0x18')]();});}}catch(_0xd59c08){logger[_0xe98c('0x16')]('[%s][MESSAGE]\x20%s',_0xf7416a,JSON['stringify'](_0xd59c08));_0x182999[_0xe98c('0x18')]();}};};
\ No newline at end of file
+var _0x6000=['account','upperFirst','channel','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','chat','ChatWebsiteId'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x6000,0x17c));var _0x0600=function(_0x4194b7,_0x1885c8){_0x4194b7=_0x4194b7-0x0;var _0x5b8c6a=_0x6000[_0x4194b7];return _0x5b8c6a;};'use strict';var _=require(_0x0600('0x0'));var utils=require(_0x0600('0x1'));var logger=require(_0x0600('0x2'))(_0x0600('0x3'));var rpc={'chatMessage':require(_0x0600('0x4')),'openchannelMessage':require(_0x0600('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0600('0x6')),'faxMessage':require(_0x0600('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x0600('0x8')]=function(_0x516258,_0x38f630){return function(_0xc18208){try{var _0x89927a={'body':utils['getMustacheRender'](_0x38f630[0x0],this),'ContactId':this[_0x0600('0x9')]['id']};if(this['channel']===_0x0600('0xa')){_0x89927a[_0x0600('0xb')]=this[_0x0600('0xc')]['id'];}else{_0x89927a[_[_0x0600('0xd')](this[_0x0600('0xe')])+_0x0600('0xf')]=this[_0x0600('0xc')]['id'];}_0x89927a[_[_0x0600('0xd')](this['channel'])+_0x0600('0x10')]=this[_0x0600('0x11')]['id'];if(rpc[this['channel']+_0x0600('0x12')]){return rpc[this[_0x0600('0xe')]+_0x0600('0x12')]['create'](_0x89927a)[_0x0600('0x13')](function(_0x5afccc){logger[_0x0600('0x14')](_0x0600('0x15'),_0x516258,_0x89927a[_0x0600('0x16')]);_0xc18208[_0x0600('0x17')]();})[_0x0600('0x18')](function(_0x577f17){logger[_0x0600('0x19')](_0x0600('0x15'),_0x516258,JSON['stringify'](_0x577f17));_0xc18208[_0x0600('0x1a')]();});}}catch(_0x407a1d){logger[_0x0600('0x19')](_0x0600('0x15'),_0x516258,JSON[_0x0600('0x1b')](_0x407a1d));_0xc18208[_0x0600('0x1a')]();}};};
\ No newline at end of file
index 54910d6..cf3dd7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c8=['next','error','stringify','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x101383,_0x5bd543){var _0x46cfe9=function(_0x7e308a){while(--_0x7e308a){_0x101383['push'](_0x101383['shift']());}};_0x46cfe9(++_0x5bd543);}(_0xb8c8,0x72));var _0x8b8c=function(_0x1f3c4d,_0x50f501){_0x1f3c4d=_0x1f3c4d-0x0;var _0x57dc9c=_0xb8c8[_0x1f3c4d];return _0x57dc9c;};'use strict';var utils=require('./utils');var logger=require(_0x8b8c('0x0'))(_0x8b8c('0x1'));exports[_0x8b8c('0x2')]=function(_0x356668,_0x10cf03){return function(_0x539ad6){try{logger[_0x8b8c('0x3')](_0x8b8c('0x4'),_0x356668,utils[_0x8b8c('0x5')](_0x10cf03[0x0],this));_0x539ad6[_0x8b8c('0x6')]();}catch(_0x7e3f78){logger[_0x8b8c('0x7')](_0x8b8c('0x4'),_0x356668,JSON[_0x8b8c('0x8')](_0x7e3f78));_0x539ad6[_0x8b8c('0x9')]();}};};
\ No newline at end of file
+var _0xd0d0=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils','../../../../config/logger'];(function(_0x3bcf4c,_0x59fd24){var _0x17bd72=function(_0x5b3d12){while(--_0x5b3d12){_0x3bcf4c['push'](_0x3bcf4c['shift']());}};_0x17bd72(++_0x59fd24);}(_0xd0d0,0x15d));var _0x0d0d=function(_0x498361,_0x3f0265){_0x498361=_0x498361-0x0;var _0x27cee6=_0xd0d0[_0x498361];return _0x27cee6;};'use strict';var utils=require(_0x0d0d('0x0'));var logger=require(_0x0d0d('0x1'))('routing');exports[_0x0d0d('0x2')]=function(_0x19631a,_0x3994ad){return function(_0x579ec3){try{logger[_0x0d0d('0x3')](_0x0d0d('0x4'),_0x19631a,utils[_0x0d0d('0x5')](_0x3994ad[0x0],this));_0x579ec3[_0x0d0d('0x6')]();}catch(_0xa6da52){logger[_0x0d0d('0x7')](_0x0d0d('0x4'),_0x19631a,JSON[_0x0d0d('0x8')](_0xa6da52));_0x579ec3['stop']();}};};
\ No newline at end of file
index 693bde4..57807b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x390a=['remove','pick','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','waiting','body','contact','list','channel','upperFirst','InteractionId','interaction','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','error','timeout','info','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue','from','joinAt','account','%sQueuesWaitingInteractions','format','%s_queue_waiting_interaction:%s'];(function(_0x1ce6cd,_0x495dd2){var _0x1a971b=function(_0x4cb0b5){while(--_0x4cb0b5){_0x1ce6cd['push'](_0x1ce6cd['shift']());}};_0x1a971b(++_0x495dd2);}(_0x390a,0xc9));var _0xa390=function(_0x2be006,_0x74e737){_0x2be006=_0x2be006-0x0;var _0x237b78=_0x390a[_0x2be006];return _0x237b78;};'use strict';var schema=require(_0xa390('0x0'));var _=require(_0xa390('0x1'));var util=require(_0xa390('0x2'));var seqqueue=require(_0xa390('0x3'));var moment=require('moment');var Redis=require(_0xa390('0x4'));var config=require(_0xa390('0x5'));var logger=require(_0xa390('0x6'))(_0xa390('0x7'));var strategy=require('./strategy');config[_0xa390('0x8')]=_[_0xa390('0x9')](config[_0xa390('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa390('0xa'))(new Redis(config[_0xa390('0x8')]));var attributes=['id','queue_id','account',_0xa390('0xb'),_0xa390('0xc'),_0xa390('0xd')];function emit(_0x226003,_0xc80e9d,_0x5106eb){io['to'](_0x226003)['emit'](_0xc80e9d,_0x5106eb);}function emitChannelQueueInteraction(_0x735319,_0x34f0fe,_0x1ecd8b,_0x484b38,_0x41f9f2,_0x172371,_0x49c3a0,_0x8580d5){var _0x2bee3b=_['clone'](_0x1ecd8b);_0x2bee3b['queue_id']=_0x8580d5;_0x2bee3b[_0xa390('0xb')]=_0x34f0fe;_0x2bee3b[_0xa390('0xe')]=_0x484b38;_0x2bee3b['id']=_0x41f9f2;if(_0x172371){_0x49c3a0[util['format'](_0xa390('0xf'),_0x735319)][_0x41f9f2]=_['pick'](_0x2bee3b,attributes);}else{delete _0x49c3a0[util['format']('%sQueuesWaitingInteractions',_0x735319)][_0x41f9f2];}emit(util[_0xa390('0x10')]('%s:queue:%s',_0x735319,_0x34f0fe),util[_0xa390('0x10')](_0xa390('0x11'),_0x735319,_0x172371?'save':_0xa390('0x12')),_[_0xa390('0x13')](_0x2bee3b,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xa390('0x14')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa390('0x15')),'faxQueueReport':require(_0xa390('0x16')),'whatsappQueueReport':require(_0xa390('0x17'))};var queue=schema({'name':{'type':_0xa390('0x18'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa390('0x19'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x59ef38,_0x4969c9,_0xc2c6f3,_0x555323){if(_0x59ef38&&_0x4969c9&&_0xc2c6f3){_0x4969c9[_0xa390('0x1a')]+=0x1;var _0xb10495={'uniqueid':_0x59ef38,'from':_0xc2c6f3['body']?_0xc2c6f3[_0xa390('0x1b')][_0xa390('0xc')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xc2c6f3[_0xa390('0x1c')]?_0xc2c6f3[_0xa390('0x1c')]['id']:null,'ListId':_0xc2c6f3[_0xa390('0x1d')]?_0xc2c6f3['list']['id']:null};_0xb10495[_['upperFirst'](_0xc2c6f3[_0xa390('0x1e')])+'QueueId']=_0x4969c9['id']||null;_0xb10495[_[_0xa390('0x1f')](_0xc2c6f3[_0xa390('0x1e')])+_0xa390('0x20')]=_0xc2c6f3['interaction']?_0xc2c6f3[_0xa390('0x21')]['id']:null;_0xb10495[_[_0xa390('0x1f')](_0xc2c6f3[_0xa390('0x1e')])+'MessageId']=_0xc2c6f3[_0xa390('0x22')]?_0xc2c6f3['message']['id']:null;_0xb10495[_[_0xa390('0x1f')](_0xc2c6f3['channel'])+(_0xc2c6f3[_0xa390('0x1e')]!==_0xa390('0x23')?_0xa390('0x24'):_0xa390('0x25'))]=_0xc2c6f3[_0xa390('0xe')]?_0xc2c6f3[_0xa390('0xe')]['id']:null;logger['info'](util['format'](_0xa390('0x26'),_0x59ef38,_0x4969c9['name']));emitChannelQueueInteraction(_0xc2c6f3[_0xa390('0x1e')],_0x4969c9[_0xa390('0x27')],_0xb10495,_0xc2c6f3[_0xa390('0xe')][_0xa390('0x27')],_0xc2c6f3[_0xa390('0x22')]['id'],!![],_0x555323,_0x4969c9['id']);if(rpc[_0xc2c6f3[_0xa390('0x1e')]+'QueueReport']){return rpc[_0xc2c6f3[_0xa390('0x1e')]+_0xa390('0x28')]['create'](_0xb10495)[_0xa390('0x29')](function(_0x421ac0){logger['error'](_0xa390('0x2a'));});}}}function stopRouting(_0x3b890a,_0x4c22bd,_0x1dc3cf,_0x2601c7){if(_0x3b890a&&_0x4c22bd){_0x4c22bd[_0xa390('0x1a')]-=0x1;var _0x9a9dfe={'leaveAt':moment()[_0xa390('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xa390('0x2b')),'reason':_0xa390('0x2c')};logger['info'](util[_0xa390('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x3b890a,_0x4c22bd[_0xa390('0x27')]));emitChannelQueueInteraction(_0x1dc3cf[_0xa390('0x1e')],_0x4c22bd[_0xa390('0x27')],_0x1dc3cf[_0xa390('0x1b')],_0x1dc3cf[_0xa390('0xe')][_0xa390('0x27')],_0x1dc3cf[_0xa390('0x22')]['id'],![],_0x2601c7,_0x4c22bd['id']);if(rpc[_0x1dc3cf[_0xa390('0x1e')]+_0xa390('0x28')]){return rpc[_0x1dc3cf[_0xa390('0x1e')]+_0xa390('0x28')]['update'](_0x3b890a,_0x9a9dfe)[_0xa390('0x29')](function(_0x5c52ac){logger[_0xa390('0x2d')]('update\x20queue\x20report');});}}}function endRouting(_0x1369bb,_0x3d8d6c,_0x429ed6,_0x347082){if(_0x1369bb&&_0x3d8d6c){_0x3d8d6c['waiting']-=0x1;var _0x3bc936={'leaveAt':moment()['format'](_0xa390('0x2b')),'exitAt':moment()['format'](_0xa390('0x2b')),'reason':_0xa390('0x2e')};logger[_0xa390('0x2f')](util[_0xa390('0x10')](_0xa390('0x30'),_0x1369bb,_0x3d8d6c[_0xa390('0x27')]));emitChannelQueueInteraction(_0x429ed6[_0xa390('0x1e')],_0x3d8d6c[_0xa390('0x27')],_0x429ed6['body'],_0x429ed6['account'][_0xa390('0x27')],_0x429ed6[_0xa390('0x22')]['id'],![],_0x347082);if(rpc[_0x429ed6[_0xa390('0x1e')]+_0xa390('0x28')]){return rpc[_0x429ed6[_0xa390('0x1e')]+_0xa390('0x28')]['update'](_0x1369bb,_0x3bc936)[_0xa390('0x29')](function(_0x462fe5){logger[_0xa390('0x2d')](_0xa390('0x31'));});}}}function handleFindQueue(_0x49ec26){return function(_0x176acd){return _0x176acd[_0xa390('0x27')]['toLowerCase']()===_0x49ec26['toLowerCase']();};}exports['consequence']=function(_0x9f74fd,_0x169233,_0x274230,_0x20dd79){return function(_0xff0d62){try{var _0x42bf4e={'name':_0x169233[0x0],'timeout':_0x169233[0x1]};var _0x2df325=queue[_0xa390('0x0')](_0x42bf4e,{'typecast':!![]});if(_0x2df325[_0xa390('0x32')]){logger['error'](_0xa390('0x33'),_0x9f74fd,_[_0xa390('0x34')](_0x2df325,_0xa390('0x22'))[_0xa390('0x35')](',\x20'));_0xff0d62[_0xa390('0x36')]();}else{var _0x3a0b2d=_[_0xa390('0x37')](_0x274230[_0x20dd79[_0xa390('0x1e')]+_0xa390('0x38')],handleFindQueue(_0x42bf4e[_0xa390('0x27')]));if(_0x3a0b2d){startRouting(_0x9f74fd,_0x3a0b2d,_0x20dd79,_0x274230);var _0x418b87=(_0x3a0b2d[_0xa390('0x2e')]||0xa)*0x3e8;var _0x2a50ad=(_0x42bf4e[_0xa390('0x2e')]||0x14)*0x3e8;var _0x193c7b,_0x468889;if(_0x418b87>_0x2a50ad){_0x2a50ad=_0x418b87;}var _0x2e77c7=seqqueue[_0xa390('0x39')](_0x418b87);_0x2e77c7['id']=_0x9f74fd;_0x2e77c7[_0xa390('0x3a')]=_0x418b87;_0x2e77c7[_0xa390('0x3b')]=_0x2a50ad;_0x2e77c7[_0xa390('0x1e')]=_0x20dd79['channel'];_0x274230[_0xa390('0x3c')][_0x9f74fd]['on'](_0xa390('0x3d'),function(){logger[_0xa390('0x2f')](_0xa390('0x3e'),_0x9f74fd);stopRouting(_0x9f74fd,_0x3a0b2d,_0x20dd79,_0x274230);clearTimeout(_0x193c7b);_0x193c7b=undefined;_0x2e77c7[_0xa390('0x3f')](!![]);if(_0x274230[_0xa390('0x3c')][_0x9f74fd]){delete _0x274230['rules'][_0x9f74fd];}_0xff0d62[_0xa390('0x36')]();});_0x274230[_0xa390('0x3c')][_0x9f74fd]['on'](_0xa390('0x40'),function(){if(_0x274230['rules'][_0x9f74fd]){delete _0x274230[_0xa390('0x3c')][_0x9f74fd];}});_0x193c7b=setTimeout(function(){logger[_0xa390('0x2f')](_0xa390('0x41'),_0x9f74fd);endRouting(_0x9f74fd,_0x3a0b2d,_0x20dd79,_0x274230);clearTimeout(_0x193c7b);_0x2e77c7['close'](!![]);_0xff0d62[_0xa390('0x42')]();},_0x2a50ad);switch(_0x3a0b2d[_0xa390('0x43')]){case _0xa390('0x44'):strategy[_0xa390('0x44')](_0x2e77c7,_0x3a0b2d,_0x274230,_0x20dd79);break;default:strategy[_0xa390('0x45')](_0x2e77c7,_0x3a0b2d,_0x274230,_0x20dd79);}}else{logger[_0xa390('0x2d')](_0xa390('0x46'),_0x9f74fd,_0x42bf4e[_0xa390('0x27')]);_0xff0d62[_0xa390('0x36')]();}}}catch(_0x8692db){console[_0xa390('0x47')](_0x8692db);logger[_0xa390('0x2d')](_0xa390('0x33'),_0x9f74fd,_0x8692db[_0xa390('0x48')]);_0xff0d62['stop']();}};};
\ No newline at end of file
+var _0x86f8=['[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','seq-queue','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','%sQueuesWaitingInteractions','format','%s:queue:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x86f8,0xed));var _0x886f=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0x86f8[_0x2a7b8e];return _0x29b5c8;};'use strict';var schema=require('validate');var _=require(_0x886f('0x0'));var util=require('util');var seqqueue=require(_0x886f('0x1'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x886f('0x2'));var logger=require(_0x886f('0x3'))(_0x886f('0x4'));var strategy=require('./strategy');config[_0x886f('0x5')]=_[_0x886f('0x6')](config[_0x886f('0x5')],{'host':_0x886f('0x7'),'port':0x18eb});var io=require(_0x886f('0x8'))(new Redis(config[_0x886f('0x5')]));var attributes=['id',_0x886f('0x9'),_0x886f('0xa'),'queue',_0x886f('0xb'),_0x886f('0xc')];function emit(_0x160b9f,_0x33d5a9,_0xb0e1d){io['to'](_0x160b9f)[_0x886f('0xd')](_0x33d5a9,_0xb0e1d);}function emitChannelQueueInteraction(_0x5e9e45,_0x2447c8,_0x2aa426,_0x53a4e6,_0x172c7b,_0x91e50e,_0x5c1f8c,_0x3a4521){var _0x3776b4=_[_0x886f('0xe')](_0x2aa426);_0x3776b4['queue_id']=_0x3a4521;_0x3776b4[_0x886f('0xf')]=_0x2447c8;_0x3776b4[_0x886f('0xa')]=_0x53a4e6;_0x3776b4['id']=_0x172c7b;if(_0x91e50e){_0x5c1f8c[util['format'](_0x886f('0x10'),_0x5e9e45)][_0x172c7b]=_['pick'](_0x3776b4,attributes);}else{delete _0x5c1f8c[util[_0x886f('0x11')](_0x886f('0x10'),_0x5e9e45)][_0x172c7b];}emit(util['format'](_0x886f('0x12'),_0x5e9e45,_0x2447c8),util[_0x886f('0x11')]('%s_queue_waiting_interaction:%s',_0x5e9e45,_0x91e50e?'save':_0x886f('0x13')),_[_0x886f('0x14')](_0x3776b4,attributes));}var rpc={'openchannelQueueReport':require(_0x886f('0x15')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x886f('0x16')),'smsQueueReport':require(_0x886f('0x17')),'faxQueueReport':require(_0x886f('0x18')),'whatsappQueueReport':require(_0x886f('0x19'))};var queue=schema({'name':{'type':_0x886f('0x1a'),'required':!![],'message':_0x886f('0x1b')},'timeout':{'type':_0x886f('0x1c'),'message':_0x886f('0x1d')}});function startRouting(_0x50003b,_0x2836d4,_0x528570,_0x82bfa2){if(_0x50003b&&_0x2836d4&&_0x528570){_0x2836d4[_0x886f('0x1e')]+=0x1;var _0x3fde75={'uniqueid':_0x50003b,'from':_0x528570[_0x886f('0x1f')]?_0x528570[_0x886f('0x1f')]['from']:'','joinAt':moment()['format'](_0x886f('0x20')),'ContactId':_0x528570[_0x886f('0x21')]?_0x528570[_0x886f('0x21')]['id']:null,'ListId':_0x528570[_0x886f('0x22')]?_0x528570[_0x886f('0x22')]['id']:null};_0x3fde75[_['upperFirst'](_0x528570[_0x886f('0x23')])+_0x886f('0x24')]=_0x2836d4['id']||null;_0x3fde75[_[_0x886f('0x25')](_0x528570[_0x886f('0x23')])+_0x886f('0x26')]=_0x528570['interaction']?_0x528570[_0x886f('0x27')]['id']:null;_0x3fde75[_[_0x886f('0x25')](_0x528570[_0x886f('0x23')])+_0x886f('0x28')]=_0x528570[_0x886f('0x29')]?_0x528570[_0x886f('0x29')]['id']:null;_0x3fde75[_['upperFirst'](_0x528570['channel'])+(_0x528570['channel']!==_0x886f('0x2a')?'AccountId':'WebsiteId')]=_0x528570[_0x886f('0xa')]?_0x528570[_0x886f('0xa')]['id']:null;logger['info'](util[_0x886f('0x11')](_0x886f('0x2b'),_0x50003b,_0x2836d4[_0x886f('0x2c')]));emitChannelQueueInteraction(_0x528570[_0x886f('0x23')],_0x2836d4[_0x886f('0x2c')],_0x3fde75,_0x528570['account'][_0x886f('0x2c')],_0x528570[_0x886f('0x29')]['id'],!![],_0x82bfa2,_0x2836d4['id']);if(rpc[_0x528570[_0x886f('0x23')]+'QueueReport']){return rpc[_0x528570[_0x886f('0x23')]+_0x886f('0x2d')]['create'](_0x3fde75)[_0x886f('0x2e')](function(_0x247f83){logger[_0x886f('0x2f')](_0x886f('0x30'));});}}}function stopRouting(_0xeeaf19,_0x56cacc,_0x44c0b6,_0x5850fe){if(_0xeeaf19&&_0x56cacc){_0x56cacc[_0x886f('0x1e')]-=0x1;var _0x2450c2={'leaveAt':moment()[_0x886f('0x11')](_0x886f('0x20')),'acceptAt':moment()['format'](_0x886f('0x20')),'reason':_0x886f('0x31')};logger[_0x886f('0x32')](util[_0x886f('0x11')](_0x886f('0x33'),_0xeeaf19,_0x56cacc[_0x886f('0x2c')]));emitChannelQueueInteraction(_0x44c0b6[_0x886f('0x23')],_0x56cacc['name'],_0x44c0b6['body'],_0x44c0b6['account'][_0x886f('0x2c')],_0x44c0b6['message']['id'],![],_0x5850fe,_0x56cacc['id']);if(rpc[_0x44c0b6[_0x886f('0x23')]+_0x886f('0x2d')]){return rpc[_0x44c0b6[_0x886f('0x23')]+'QueueReport']['update'](_0xeeaf19,_0x2450c2)[_0x886f('0x2e')](function(_0x3df1d0){logger[_0x886f('0x2f')]('update\x20queue\x20report');});}}}function endRouting(_0x154ad7,_0x5dfd09,_0x19ef5c,_0x15c047){if(_0x154ad7&&_0x5dfd09){_0x5dfd09[_0x886f('0x1e')]-=0x1;var _0x5aaf8c={'leaveAt':moment()[_0x886f('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x886f('0x11')](_0x886f('0x20')),'reason':_0x886f('0x34')};logger['info'](util[_0x886f('0x11')](_0x886f('0x35'),_0x154ad7,_0x5dfd09[_0x886f('0x2c')]));emitChannelQueueInteraction(_0x19ef5c[_0x886f('0x23')],_0x5dfd09[_0x886f('0x2c')],_0x19ef5c[_0x886f('0x1f')],_0x19ef5c['account']['name'],_0x19ef5c[_0x886f('0x29')]['id'],![],_0x15c047);if(rpc[_0x19ef5c[_0x886f('0x23')]+_0x886f('0x2d')]){return rpc[_0x19ef5c[_0x886f('0x23')]+_0x886f('0x2d')][_0x886f('0x36')](_0x154ad7,_0x5aaf8c)['catch'](function(_0x1bb453){logger[_0x886f('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x53917f){return function(_0x3b79cf){return _0x3b79cf[_0x886f('0x2c')]['toLowerCase']()===_0x53917f[_0x886f('0x37')]();};}exports[_0x886f('0x38')]=function(_0x6a0dd9,_0x3f1716,_0x47fce6,_0x5d3ac2){return function(_0x5a521c){try{var _0x427901={'name':_0x3f1716[0x0],'timeout':_0x3f1716[0x1]};var _0x147bc2=queue[_0x886f('0x39')](_0x427901,{'typecast':!![]});if(_0x147bc2[_0x886f('0x3a')]){logger[_0x886f('0x2f')](_0x886f('0x3b'),_0x6a0dd9,_[_0x886f('0x3c')](_0x147bc2,_0x886f('0x29'))[_0x886f('0x3d')](',\x20'));_0x5a521c[_0x886f('0x3e')]();}else{var _0x36fbaa=_['find'](_0x47fce6[_0x5d3ac2[_0x886f('0x23')]+_0x886f('0x3f')],handleFindQueue(_0x427901[_0x886f('0x2c')]));if(_0x36fbaa){startRouting(_0x6a0dd9,_0x36fbaa,_0x5d3ac2,_0x47fce6);var _0x361c87=(_0x36fbaa[_0x886f('0x34')]||0xa)*0x3e8;var _0x1c63a9=(_0x427901[_0x886f('0x34')]||0x14)*0x3e8;var _0x268868,_0x505283;if(_0x361c87>_0x1c63a9){_0x1c63a9=_0x361c87;}var _0x73a61=seqqueue[_0x886f('0x40')](_0x361c87);_0x73a61['id']=_0x6a0dd9;_0x73a61[_0x886f('0x41')]=_0x361c87;_0x73a61['qtimeout']=_0x1c63a9;_0x73a61['channel']=_0x5d3ac2[_0x886f('0x23')];_0x47fce6['rules'][_0x6a0dd9]['on'](_0x886f('0x42'),function(){logger['info'](_0x886f('0x43'),_0x6a0dd9);stopRouting(_0x6a0dd9,_0x36fbaa,_0x5d3ac2,_0x47fce6);clearTimeout(_0x268868);_0x268868=undefined;_0x73a61[_0x886f('0x44')](!![]);if(_0x47fce6[_0x886f('0x45')][_0x6a0dd9]){delete _0x47fce6[_0x886f('0x45')][_0x6a0dd9];}_0x5a521c[_0x886f('0x3e')]();});_0x47fce6[_0x886f('0x45')][_0x6a0dd9]['on'](_0x886f('0x46'),function(){if(_0x47fce6[_0x886f('0x45')][_0x6a0dd9]){delete _0x47fce6['rules'][_0x6a0dd9];}});_0x268868=setTimeout(function(){logger[_0x886f('0x32')](_0x886f('0x47'),_0x6a0dd9);endRouting(_0x6a0dd9,_0x36fbaa,_0x5d3ac2,_0x47fce6);clearTimeout(_0x268868);_0x73a61[_0x886f('0x44')](!![]);_0x5a521c[_0x886f('0x48')]();},_0x1c63a9);switch(_0x36fbaa[_0x886f('0x49')]){case _0x886f('0x4a'):strategy[_0x886f('0x4a')](_0x73a61,_0x36fbaa,_0x47fce6,_0x5d3ac2);break;default:strategy['beepall'](_0x73a61,_0x36fbaa,_0x47fce6,_0x5d3ac2);}}else{logger[_0x886f('0x2f')](_0x886f('0x4b'),_0x6a0dd9,_0x427901[_0x886f('0x2c')]);_0x5a521c[_0x886f('0x3e')]();}}}catch(_0x4d61e5){console['log'](_0x4d61e5);logger[_0x886f('0x2f')](_0x886f('0x3b'),_0x6a0dd9,_0x4d61e5[_0x886f('0x4c')]);_0x5a521c[_0x886f('0x3e')]();}};};
\ No newline at end of file
index c0558e9..32ff6d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f50=['isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','agents','busy','busyQueue','showNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available'];(function(_0x45dadc,_0x4b145d){var _0x293cf9=function(_0xda6912){while(--_0xda6912){_0x45dadc['push'](_0x45dadc['shift']());}};_0x293cf9(++_0x4b145d);}(_0x4f50,0x1f4));var _0x04f5=function(_0x6d79da,_0x274df3){_0x6d79da=_0x6d79da-0x0;var _0x17e3ae=_0x4f50[_0x6d79da];return _0x17e3ae;};'use strict';var _=require('lodash');var uuid=require(_0x04f5('0x0'));var util=require(_0x04f5('0x1'));var logger=require(_0x04f5('0x2'))(_0x04f5('0x3'));var Agent=function(_0x4cebcf,_0x3be5bc,_0x258f8b,_0x56fe24){this['notificationId']=uuid['v4']();this[_0x04f5('0x4')]=_0x4cebcf;this[_0x04f5('0x5')]=_0x3be5bc;this[_0x04f5('0x6')]=_0x258f8b;this[_0x04f5('0x3')]=_0x56fe24;this[_0x04f5('0x4')][_0x04f5('0x7')](this[_0x04f5('0x8')]['bind'](this),this[_0x04f5('0x9')][_0x04f5('0xa')](this));this[_0x04f5('0x4')]['on'](_0x04f5('0xb'),this[_0x04f5('0x9')]['bind'](this));this['squeue']['on'](_0x04f5('0xc'),this[_0x04f5('0xd')][_0x04f5('0xa')](this));};Agent[_0x04f5('0xe')][_0x04f5('0x7')]=function(){this[_0x04f5('0x4')][_0x04f5('0x7')](this[_0x04f5('0x8')]['bind'](this),this[_0x04f5('0x9')]['bind'](this));};Agent[_0x04f5('0xe')][_0x04f5('0xd')]=function(){this[_0x04f5('0x9')](!![]);};Agent[_0x04f5('0xe')]['handleRun']=function(_0x156024){logger[_0x04f5('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x04f5('0x4')]['id'],this[_0x04f5('0x5')]['id']);if(_['isNil'](this[_0x04f5('0x6')]['agents'][this[_0x04f5('0x5')]['id']])){logger['info'](_0x04f5('0x10'),this[_0x04f5('0x4')]['id'],this[_0x04f5('0x5')]['id']);setTimeout(this['push'][_0x04f5('0xa')](this),0x3e8);}else{if(this['routing'][_0x04f5('0x11')]||util[_0x04f5('0x12')](this[_0x04f5('0x4')]['id'],this['realtime']['agents'][this['agent']['id']],this[_0x04f5('0x4')][_0x04f5('0x13')],![])){this[_0x04f5('0x6')][_0x04f5('0x14')][this[_0x04f5('0x5')]['id']][_0x04f5('0x15')]=!![];this['realtime'][_0x04f5('0x14')][this['agent']['id']][_0x04f5('0x16')]=undefined;util[_0x04f5('0x17')](this[_0x04f5('0x18')],this[_0x04f5('0x4')]['id'],this[_0x04f5('0x6')][_0x04f5('0x14')][this[_0x04f5('0x5')]['id']],null,this[_0x04f5('0x3')]);util[_0x04f5('0x19')](this[_0x04f5('0x4')]['id'],this[_0x04f5('0x6')][_0x04f5('0x14')][this['agent']['id']],_0x04f5('0x1a')+(this['routing']['forcedOwnership']?':FORCED':''));}else{logger[_0x04f5('0xf')](_0x04f5('0x1b'),this['squeue']['id'],this[_0x04f5('0x5')]['id']);setTimeout(this[_0x04f5('0x7')][_0x04f5('0xa')](this),0x3e8);}}};Agent[_0x04f5('0xe')][_0x04f5('0x9')]=function(_0x5b4aaf){if(_[_0x04f5('0x1c')](this[_0x04f5('0x6')][_0x04f5('0x14')][this[_0x04f5('0x5')]['id']])){return logger[_0x04f5('0xf')](_0x04f5('0x10'),this['squeue']['id'],this[_0x04f5('0x5')]['id']);}else{logger[_0x04f5('0xf')](_0x04f5('0x1d'),this[_0x04f5('0x4')]['id'],this[_0x04f5('0x5')]['id']);util[_0x04f5('0x1e')](this[_0x04f5('0x18')],this['squeue']['id'],this[_0x04f5('0x6')][_0x04f5('0x14')][this[_0x04f5('0x5')]['id']],null,this[_0x04f5('0x3')]);this['realtime'][_0x04f5('0x14')][this[_0x04f5('0x5')]['id']][_0x04f5('0x15')]=![];this[_0x04f5('0x6')][_0x04f5('0x14')][this[_0x04f5('0x5')]['id']][_0x04f5('0x16')]=undefined;util[_0x04f5('0x19')](this[_0x04f5('0x4')]['id'],this[_0x04f5('0x6')][_0x04f5('0x14')][this[_0x04f5('0x5')]['id']],_0x5b4aaf?_0x04f5('0x1f'):'TIMEOUT');}if(!_0x5b4aaf){setTimeout(this[_0x04f5('0x7')][_0x04f5('0xa')](this),0x3e8);}};function agent(_0x19ea95,_0xd31898,_0x4f6949,_0x43db41){return new Agent(_0x19ea95,_0xd31898,_0x4f6949,_0x43db41);}module[_0x04f5('0x20')]=agent;
\ No newline at end of file
+var _0x1dfe=['RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','notificationId','squeue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x1dfe,0xb4));var _0xe1df=function(_0x5cbf8d,_0x34586c){_0x5cbf8d=_0x5cbf8d-0x0;var _0x1b131c=_0x1dfe[_0x5cbf8d];return _0x1b131c;};'use strict';var _=require(_0xe1df('0x0'));var uuid=require(_0xe1df('0x1'));var util=require(_0xe1df('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x32b3d7,_0x40aada,_0x34c12e,_0x887e64){this[_0xe1df('0x3')]=uuid['v4']();this[_0xe1df('0x4')]=_0x32b3d7;this['agent']=_0x40aada;this[_0xe1df('0x5')]=_0x34c12e;this[_0xe1df('0x6')]=_0x887e64;this[_0xe1df('0x4')][_0xe1df('0x7')](this[_0xe1df('0x8')][_0xe1df('0x9')](this),this[_0xe1df('0xa')][_0xe1df('0x9')](this));this[_0xe1df('0x4')]['on'](_0xe1df('0xb'),this[_0xe1df('0xa')][_0xe1df('0x9')](this));this[_0xe1df('0x4')]['on'](_0xe1df('0xc'),this[_0xe1df('0xd')]['bind'](this));};Agent[_0xe1df('0xe')][_0xe1df('0x7')]=function(){this[_0xe1df('0x4')][_0xe1df('0x7')](this[_0xe1df('0x8')][_0xe1df('0x9')](this),this[_0xe1df('0xa')]['bind'](this));};Agent[_0xe1df('0xe')]['handleDrained']=function(){this[_0xe1df('0xa')](!![]);};Agent[_0xe1df('0xe')][_0xe1df('0x8')]=function(_0x3d2f8d){logger[_0xe1df('0xf')](_0xe1df('0x10'),this['squeue']['id'],this[_0xe1df('0x11')]['id']);if(_['isNil'](this[_0xe1df('0x5')][_0xe1df('0x12')][this[_0xe1df('0x11')]['id']])){logger[_0xe1df('0xf')](_0xe1df('0x13'),this[_0xe1df('0x4')]['id'],this[_0xe1df('0x11')]['id']);setTimeout(this[_0xe1df('0x7')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0xe1df('0x14')](this['squeue']['id'],this['realtime'][_0xe1df('0x12')][this['agent']['id']],this['squeue'][_0xe1df('0x15')],![])){this[_0xe1df('0x5')][_0xe1df('0x12')][this['agent']['id']][_0xe1df('0x16')]=!![];this[_0xe1df('0x5')][_0xe1df('0x12')][this[_0xe1df('0x11')]['id']][_0xe1df('0x17')]=undefined;util['showNotification'](this[_0xe1df('0x3')],this[_0xe1df('0x4')]['id'],this[_0xe1df('0x5')][_0xe1df('0x12')][this['agent']['id']],null,this[_0xe1df('0x6')]);util['writeLog'](this[_0xe1df('0x4')]['id'],this['realtime']['agents'][this['agent']['id']],_0xe1df('0x18')+(this[_0xe1df('0x6')][_0xe1df('0x19')]?_0xe1df('0x1a'):''));}else{logger[_0xe1df('0xf')](_0xe1df('0x1b'),this[_0xe1df('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xe1df('0x7')][_0xe1df('0x9')](this),0x3e8);}}};Agent['prototype'][_0xe1df('0xa')]=function(_0x496534){if(_[_0xe1df('0x1c')](this['realtime']['agents'][this[_0xe1df('0x11')]['id']])){return logger[_0xe1df('0xf')](_0xe1df('0x13'),this[_0xe1df('0x4')]['id'],this['agent']['id']);}else{logger[_0xe1df('0xf')](_0xe1df('0x1d'),this[_0xe1df('0x4')]['id'],this[_0xe1df('0x11')]['id']);util[_0xe1df('0x1e')](this['notificationId'],this[_0xe1df('0x4')]['id'],this[_0xe1df('0x5')][_0xe1df('0x12')][this[_0xe1df('0x11')]['id']],null,this[_0xe1df('0x6')]);this['realtime']['agents'][this[_0xe1df('0x11')]['id']]['busy']=![];this[_0xe1df('0x5')][_0xe1df('0x12')][this[_0xe1df('0x11')]['id']][_0xe1df('0x17')]=undefined;util['writeLog'](this['squeue']['id'],this[_0xe1df('0x5')][_0xe1df('0x12')][this[_0xe1df('0x11')]['id']],_0x496534?_0xe1df('0x1f'):_0xe1df('0x20'));}if(!_0x496534){setTimeout(this['push'][_0xe1df('0x9')](this),0x3e8);}};function agent(_0x119a22,_0x3e4fd6,_0x24cbdd,_0x586412){return new Agent(_0x119a22,_0x3e4fd6,_0x24cbdd,_0x586412);}module[_0xe1df('0x21')]=agent;
\ No newline at end of file
index 27b1481..d0a3c65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7163=['../../../../../config/logger','routing','notificationId','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','queue','Agents','isNil','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','exports','lodash'];(function(_0x257652,_0x3005ad){var _0xbc5883=function(_0x1f7233){while(--_0x1f7233){_0x257652['push'](_0x257652['shift']());}};_0xbc5883(++_0x3005ad);}(_0x7163,0x1ef));var _0x3716=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0x7163[_0x52b7b9];return _0x5b5d30;};'use strict';var _=require(_0x3716('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x3716('0x1'))(_0x3716('0x2'));var Beepall=function(_0x138388,_0x58e0ce,_0x408e31,_0x3da057){this[_0x3716('0x3')]=uuid['v4']();this[_0x3716('0x4')]=_0x138388;this['queue']=_0x58e0ce;this['realtime']=_0x408e31;this[_0x3716('0x2')]=_0x3da057;this[_0x3716('0x4')][_0x3716('0x5')](this[_0x3716('0x6')][_0x3716('0x7')](this),this[_0x3716('0x8')][_0x3716('0x7')](this));this[_0x3716('0x4')]['on'](_0x3716('0x9'),this[_0x3716('0x8')][_0x3716('0x7')](this));this[_0x3716('0x4')]['on'](_0x3716('0xa'),this[_0x3716('0xb')][_0x3716('0x7')](this));};Beepall[_0x3716('0xc')][_0x3716('0x5')]=function(){this[_0x3716('0x4')][_0x3716('0x5')](this[_0x3716('0x6')][_0x3716('0x7')](this),this[_0x3716('0x8')][_0x3716('0x7')](this));};Beepall[_0x3716('0xc')][_0x3716('0xb')]=function(_0x2794bf){this[_0x3716('0x8')](!![]);};Beepall[_0x3716('0xc')]['handleRun']=function(_0x48d627){var _0x51feb6=!![];if(!_['isNil'](this[_0x3716('0xd')])&&!_['isNil'](this[_0x3716('0xd')][_0x3716('0xe')])&&this[_0x3716('0xd')]['Agents']['length']>0x0){for(var _0x5f3833=0x0,_0x5bf297;_0x5f3833<this[_0x3716('0xd')][_0x3716('0xe')]['length'];_0x5f3833+=0x1){_0x5bf297=this[_0x3716('0xd')][_0x3716('0xe')][_0x5f3833]['id'];if(_[_0x3716('0xf')](this[_0x3716('0x10')][_0x3716('0x11')][_0x5bf297])){logger[_0x3716('0x12')](_0x3716('0x13'),this['squeue']['id'],_0x5bf297);}else{if(util['isAgentAvailable'](this['squeue']['id'],this[_0x3716('0x10')]['agents'][_0x5bf297],this[_0x3716('0x4')][_0x3716('0x14')],!![])){_0x51feb6=![];util[_0x3716('0x15')](this[_0x3716('0x4')]['id'],this[_0x3716('0x10')][_0x3716('0x11')][_0x5bf297],_0x3716('0x16'));this[_0x3716('0x10')][_0x3716('0x11')][_0x5bf297]['busy']=!![];this[_0x3716('0x10')][_0x3716('0x11')][_0x5bf297][_0x3716('0x17')]=this['queue'][_0x3716('0x18')];util[_0x3716('0x19')](this['notificationId'],this[_0x3716('0x4')]['id'],this['realtime'][_0x3716('0x11')][_0x5bf297],this[_0x3716('0xd')],this[_0x3716('0x2')]);}}}if(_0x51feb6){logger['info'](_0x3716('0x1a'),this['squeue']['id']);setTimeout(this[_0x3716('0x5')][_0x3716('0x7')](this),0x3e8);}}else{logger['info'](_0x3716('0x1b'),this[_0x3716('0x4')]['id']);setTimeout(this[_0x3716('0x5')][_0x3716('0x7')](this),0x3e8);}};Beepall[_0x3716('0xc')]['handleTimeout']=function(_0x2fdfa1){if(!_[_0x3716('0xf')](this[_0x3716('0xd')])&&!_[_0x3716('0xf')](this['queue'][_0x3716('0xe')])){for(var _0x27553a=0x0,_0x440e7f;_0x27553a<this[_0x3716('0xd')][_0x3716('0xe')]['length'];_0x27553a+=0x1){_0x440e7f=this[_0x3716('0xd')][_0x3716('0xe')][_0x27553a]['id'];if(_[_0x3716('0xf')](this['realtime']['agents'][_0x440e7f])){logger[_0x3716('0x12')](_0x3716('0x13'),this[_0x3716('0x4')]['id'],_0x440e7f);}else{util[_0x3716('0x1c')](this['notificationId'],this[_0x3716('0x4')]['id'],this[_0x3716('0x10')][_0x3716('0x11')][_0x440e7f],this[_0x3716('0xd')],this[_0x3716('0x2')]);util[_0x3716('0x15')](this['squeue']['id'],this[_0x3716('0x10')][_0x3716('0x11')][_0x440e7f],_0x2fdfa1?_0x3716('0x1d'):'TIMEOUT');this['realtime'][_0x3716('0x11')][_0x440e7f]['busy']=![];this[_0x3716('0x10')][_0x3716('0x11')][_0x440e7f][_0x3716('0x17')]=undefined;}}}if(!_0x2fdfa1){setTimeout(this[_0x3716('0x5')][_0x3716('0x7')](this),0x3e8);}};function beepall(_0x427cbc,_0x1cc17e,_0x2fa793,_0x5a33e4){return new Beepall(_0x427cbc,_0x1cc17e,_0x2fa793,_0x5a33e4);}module[_0x3716('0x1e')]=beepall;
\ No newline at end of file
+var _0x770d=['Agents','length','realtime','info','isAgentAvailable','agents','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','isNil'];(function(_0x4c24d2,_0x33b0e3){var _0x26abf3=function(_0x2b5622){while(--_0x2b5622){_0x4c24d2['push'](_0x4c24d2['shift']());}};_0x26abf3(++_0x33b0e3);}(_0x770d,0x122));var _0xd770=function(_0x122dfb,_0x447d83){_0x122dfb=_0x122dfb-0x0;var _0x521da1=_0x770d[_0x122dfb];return _0x521da1;};'use strict';var _=require(_0xd770('0x0'));var uuid=require(_0xd770('0x1'));var util=require(_0xd770('0x2'));var logger=require(_0xd770('0x3'))(_0xd770('0x4'));var Beepall=function(_0x2b9932,_0x742a9a,_0x5d67cd,_0x2ce50a){this[_0xd770('0x5')]=uuid['v4']();this[_0xd770('0x6')]=_0x2b9932;this[_0xd770('0x7')]=_0x742a9a;this['realtime']=_0x5d67cd;this['routing']=_0x2ce50a;this[_0xd770('0x6')][_0xd770('0x8')](this[_0xd770('0x9')][_0xd770('0xa')](this),this[_0xd770('0xb')][_0xd770('0xa')](this));this[_0xd770('0x6')]['on']('timeout',this[_0xd770('0xb')][_0xd770('0xa')](this));this[_0xd770('0x6')]['on'](_0xd770('0xc'),this[_0xd770('0xd')]['bind'](this));};Beepall[_0xd770('0xe')][_0xd770('0x8')]=function(){this[_0xd770('0x6')][_0xd770('0x8')](this[_0xd770('0x9')][_0xd770('0xa')](this),this[_0xd770('0xb')][_0xd770('0xa')](this));};Beepall['prototype']['handleDrained']=function(_0x28120b){this[_0xd770('0xb')](!![]);};Beepall[_0xd770('0xe')][_0xd770('0x9')]=function(_0x51dacf){var _0x2f6832=!![];if(!_[_0xd770('0xf')](this[_0xd770('0x7')])&&!_[_0xd770('0xf')](this['queue'][_0xd770('0x10')])&&this['queue'][_0xd770('0x10')][_0xd770('0x11')]>0x0){for(var _0x38c57d=0x0,_0x3040c6;_0x38c57d<this[_0xd770('0x7')][_0xd770('0x10')][_0xd770('0x11')];_0x38c57d+=0x1){_0x3040c6=this[_0xd770('0x7')][_0xd770('0x10')][_0x38c57d]['id'];if(_['isNil'](this[_0xd770('0x12')]['agents'][_0x3040c6])){logger[_0xd770('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd770('0x6')]['id'],_0x3040c6);}else{if(util[_0xd770('0x14')](this[_0xd770('0x6')]['id'],this[_0xd770('0x12')][_0xd770('0x15')][_0x3040c6],this['squeue'][_0xd770('0x16')],!![])){_0x2f6832=![];util[_0xd770('0x17')](this['squeue']['id'],this[_0xd770('0x12')][_0xd770('0x15')][_0x3040c6],_0xd770('0x18'));this[_0xd770('0x12')]['agents'][_0x3040c6][_0xd770('0x19')]=!![];this[_0xd770('0x12')][_0xd770('0x15')][_0x3040c6][_0xd770('0x1a')]=this['queue'][_0xd770('0x1b')];util[_0xd770('0x1c')](this['notificationId'],this['squeue']['id'],this[_0xd770('0x12')][_0xd770('0x15')][_0x3040c6],this[_0xd770('0x7')],this[_0xd770('0x4')]);}}}if(_0x2f6832){logger[_0xd770('0x13')](_0xd770('0x1d'),this[_0xd770('0x6')]['id']);setTimeout(this['push'][_0xd770('0xa')](this),0x3e8);}}else{logger[_0xd770('0x13')]('[%s][QUEUE]\x20EMPTY',this['squeue']['id']);setTimeout(this[_0xd770('0x8')][_0xd770('0xa')](this),0x3e8);}};Beepall['prototype'][_0xd770('0xb')]=function(_0x542c54){if(!_[_0xd770('0xf')](this[_0xd770('0x7')])&&!_['isNil'](this[_0xd770('0x7')]['Agents'])){for(var _0x4c6c2d=0x0,_0x1c2c2f;_0x4c6c2d<this[_0xd770('0x7')]['Agents']['length'];_0x4c6c2d+=0x1){_0x1c2c2f=this[_0xd770('0x7')][_0xd770('0x10')][_0x4c6c2d]['id'];if(_['isNil'](this[_0xd770('0x12')][_0xd770('0x15')][_0x1c2c2f])){logger[_0xd770('0x13')](_0xd770('0x1e'),this['squeue']['id'],_0x1c2c2f);}else{util[_0xd770('0x1f')](this['notificationId'],this[_0xd770('0x6')]['id'],this[_0xd770('0x12')][_0xd770('0x15')][_0x1c2c2f],this[_0xd770('0x7')],this[_0xd770('0x4')]);util[_0xd770('0x17')](this[_0xd770('0x6')]['id'],this[_0xd770('0x12')]['agents'][_0x1c2c2f],_0x542c54?_0xd770('0x20'):'TIMEOUT');this[_0xd770('0x12')]['agents'][_0x1c2c2f][_0xd770('0x19')]=![];this[_0xd770('0x12')][_0xd770('0x15')][_0x1c2c2f][_0xd770('0x1a')]=undefined;}}}if(!_0x542c54){setTimeout(this[_0xd770('0x8')][_0xd770('0xa')](this),0x3e8);}};function beepall(_0x2de243,_0x15d7d0,_0x129edb,_0x7a1fb){return new Beepall(_0x2de243,_0x15d7d0,_0x129edb,_0x7a1fb);}module[_0xd770('0x21')]=beepall;
\ No newline at end of file
index afc0e58..5f009da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83d6=['./beepall','./agent','exports','./rrmemory'];(function(_0x8a6b10,_0x45a80b){var _0x2b8252=function(_0x13ff8e){while(--_0x13ff8e){_0x8a6b10['push'](_0x8a6b10['shift']());}};_0x2b8252(++_0x45a80b);}(_0x83d6,0x1e2));var _0x683d=function(_0x523e41,_0x1a38b2){_0x523e41=_0x523e41-0x0;var _0x5e20ad=_0x83d6[_0x523e41];return _0x5e20ad;};'use strict';module[_0x683d('0x0')]={'rrmemory':require(_0x683d('0x1')),'beepall':require(_0x683d('0x2')),'agent':require(_0x683d('0x3'))};
\ No newline at end of file
+var _0x3c7c=['exports'];(function(_0x54ba1e,_0x4482da){var _0x19761c=function(_0x7a5a1b){while(--_0x7a5a1b){_0x54ba1e['push'](_0x54ba1e['shift']());}};_0x19761c(++_0x4482da);}(_0x3c7c,0x9b));var _0xc3c7=function(_0x170aa2,_0x3b7b51){_0x170aa2=_0x170aa2-0x0;var _0x31a938=_0x3c7c[_0x170aa2];return _0x31a938;};'use strict';module[_0xc3c7('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require('./beepall'),'agent':require('./agent')};
\ No newline at end of file
index f515e7c..68154f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fa5=['bind','handleTimeout','module','timeout','prototype','handleDrained','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','done','mapAgentsId','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','name','showNotification','writeLog','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','intervals','push','handleRun'];(function(_0x41fe54,_0x1bc17e){var _0x3d7572=function(_0x4c64c1){while(--_0x4c64c1){_0x41fe54['push'](_0x41fe54['shift']());}};_0x3d7572(++_0x1bc17e);}(_0x4fa5,0x1bc));var _0x54fa=function(_0x423fff,_0xd18333){_0x423fff=_0x423fff-0x0;var _0x24ff1d=_0x4fa5[_0x423fff];return _0x24ff1d;};'use strict';var rr=require('rr');var _=require(_0x54fa('0x0'));var uuid=require(_0x54fa('0x1'));var util=require(_0x54fa('0x2'));var logger=require(_0x54fa('0x3'))(_0x54fa('0x4'));var RRMemory=function(_0x32f494,_0xca640a,_0x3f6c2b,_0x6b0cad){this[_0x54fa('0x5')]=uuid['v4']();this[_0x54fa('0x6')]=_0x32f494;this[_0x54fa('0x7')]=_0xca640a;this[_0x54fa('0x8')]=_0x3f6c2b;this['routing']=_0x6b0cad;this[_0x54fa('0x9')]={};this[_0x54fa('0x6')][_0x54fa('0xa')](this[_0x54fa('0xb')][_0x54fa('0xc')](this),this[_0x54fa('0xd')]['bind'](this),this[_0x54fa('0xe')]);this[_0x54fa('0x6')]['on'](_0x54fa('0xf'),this['handleTimeout']['bind'](this));this[_0x54fa('0x6')]['on']('drained',this['handleDrained'][_0x54fa('0xc')](this));};RRMemory[_0x54fa('0x10')][_0x54fa('0xa')]=function(){this[_0x54fa('0x6')]['push'](this['handleRun'][_0x54fa('0xc')](this),this[_0x54fa('0xd')]['bind'](this));};RRMemory[_0x54fa('0x10')][_0x54fa('0x11')]=function(_0x32ac5c){this[_0x54fa('0xd')](!![]);};RRMemory['prototype'][_0x54fa('0x12')]=function(_0x36c849){if(util[_0x54fa('0x13')](this[_0x54fa('0x6')]['id'],this[_0x54fa('0x8')][_0x54fa('0x14')][this[_0x54fa('0x15')]],this[_0x54fa('0x6')][_0x54fa('0x16')],!![])){logger[_0x54fa('0x17')]('[%s][QUEUE]\x20available\x20again\x20%s',this[_0x54fa('0x6')]['id'],this[_0x54fa('0x15')]);clearInterval(this[_0x54fa('0x9')][this[_0x54fa('0x15')]]);_0x36c849[_0x54fa('0x18')]();setTimeout(this[_0x54fa('0xa')][_0x54fa('0xc')](this),0x3e8);}};RRMemory[_0x54fa('0x10')][_0x54fa('0xb')]=function(_0x27c79a){this[_0x54fa('0x15')]=rr(this[_0x54fa('0x7')][_0x54fa('0x19')]);logger[_0x54fa('0x17')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x54fa('0x6')]['id'],this['agentId']);if(_[_0x54fa('0x1a')](this[_0x54fa('0x8')][_0x54fa('0x14')][this[_0x54fa('0x15')]])){logger[_0x54fa('0x17')](_0x54fa('0x1b'),this[_0x54fa('0x6')]['id'],this[_0x54fa('0x15')]);_0x27c79a[_0x54fa('0x18')]();setTimeout(this[_0x54fa('0xa')][_0x54fa('0xc')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x54fa('0x6')]['id'],this[_0x54fa('0x8')]['agents'][this[_0x54fa('0x15')]],this[_0x54fa('0x6')]['channel'],!![])){this[_0x54fa('0x8')][_0x54fa('0x14')][this['agentId']][_0x54fa('0x1c')]=!![];this[_0x54fa('0x8')][_0x54fa('0x14')][this[_0x54fa('0x15')]]['busyQueue']=this[_0x54fa('0x7')][_0x54fa('0x1d')];util[_0x54fa('0x1e')](this[_0x54fa('0x5')],this['squeue']['id'],this['realtime'][_0x54fa('0x14')][this[_0x54fa('0x15')]],this['queue'],this[_0x54fa('0x4')]);util[_0x54fa('0x1f')](this[_0x54fa('0x6')]['id'],this['realtime'][_0x54fa('0x14')][this['agentId']],'RINGING');this[_0x54fa('0x9')][this[_0x54fa('0x15')]]=setInterval(this[_0x54fa('0x12')]['bind'](this,_0x27c79a),0x3e8);}else{logger[_0x54fa('0x17')](_0x54fa('0x20'),this[_0x54fa('0x6')]['id'],this[_0x54fa('0x15')]);_0x27c79a['done']();setTimeout(this['push'][_0x54fa('0xc')](this),0x3e8);}}};RRMemory[_0x54fa('0x10')][_0x54fa('0xd')]=function(_0x217106){logger[_0x54fa('0x17')](_0x54fa('0x21'),this[_0x54fa('0x6')]['id'],this[_0x54fa('0x15')]);if(_[_0x54fa('0x1a')](this[_0x54fa('0x8')][_0x54fa('0x14')][this[_0x54fa('0x15')]])){logger[_0x54fa('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x54fa('0x6')]['id'],this[_0x54fa('0x15')]);}else{clearInterval(this['intervals'][this[_0x54fa('0x15')]]);util[_0x54fa('0x22')](this[_0x54fa('0x5')],this['squeue']['id'],this['realtime'][_0x54fa('0x14')][this[_0x54fa('0x15')]],this['queue'],this[_0x54fa('0x4')]);util[_0x54fa('0x1f')](this['squeue']['id'],this['realtime'][_0x54fa('0x14')][this[_0x54fa('0x15')]],_0x54fa('0x23'));this['realtime'][_0x54fa('0x14')][this[_0x54fa('0x15')]][_0x54fa('0x1c')]=![];this['realtime']['agents'][this[_0x54fa('0x15')]][_0x54fa('0x24')]=undefined;}if(!_0x217106){setTimeout(this[_0x54fa('0xa')][_0x54fa('0xc')](this),0x3e8);}};function rrmemory(_0x313594,_0x596814,_0x41f8c3,_0x4cac2c){return new RRMemory(_0x313594,_0x596814,_0x41f8c3,_0x4cac2c);}module[_0x54fa('0x25')]=rrmemory;
\ No newline at end of file
+var _0xe294=['squeue','queue','realtime','intervals','push','bind','module','handleDrained','prototype','handleTimeout','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','done','handleRun','mapAgentsId','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busyQueue','showNotification','RINGING','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','busy','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe294,0xd8));var _0x4e29=function(_0x5e42ef,_0x38fce1){_0x5e42ef=_0x5e42ef-0x0;var _0x45301a=_0xe294[_0x5e42ef];return _0x45301a;};'use strict';var rr=require('rr');var _=require(_0x4e29('0x0'));var uuid=require(_0x4e29('0x1'));var util=require(_0x4e29('0x2'));var logger=require(_0x4e29('0x3'))(_0x4e29('0x4'));var RRMemory=function(_0x5197e6,_0x15efae,_0x246ba4,_0x19fbcd){this[_0x4e29('0x5')]=uuid['v4']();this[_0x4e29('0x6')]=_0x5197e6;this[_0x4e29('0x7')]=_0x15efae;this[_0x4e29('0x8')]=_0x246ba4;this['routing']=_0x19fbcd;this[_0x4e29('0x9')]={};this[_0x4e29('0x6')][_0x4e29('0xa')](this['handleRun']['bind'](this),this['handleTimeout'][_0x4e29('0xb')](this),this[_0x4e29('0xc')]);this[_0x4e29('0x6')]['on']('timeout',this['handleTimeout'][_0x4e29('0xb')](this));this['squeue']['on']('drained',this[_0x4e29('0xd')][_0x4e29('0xb')](this));};RRMemory[_0x4e29('0xe')]['push']=function(){this['squeue'][_0x4e29('0xa')](this['handleRun'][_0x4e29('0xb')](this),this['handleTimeout'][_0x4e29('0xb')](this));};RRMemory['prototype']['handleDrained']=function(_0x538086){this[_0x4e29('0xf')](!![]);};RRMemory[_0x4e29('0xe')][_0x4e29('0x10')]=function(_0x3d0f94){if(util[_0x4e29('0x11')](this[_0x4e29('0x6')]['id'],this[_0x4e29('0x8')][_0x4e29('0x12')][this[_0x4e29('0x13')]],this[_0x4e29('0x6')][_0x4e29('0x14')],!![])){logger[_0x4e29('0x15')](_0x4e29('0x16'),this['squeue']['id'],this[_0x4e29('0x13')]);clearInterval(this['intervals'][this[_0x4e29('0x13')]]);_0x3d0f94[_0x4e29('0x17')]();setTimeout(this[_0x4e29('0xa')]['bind'](this),0x3e8);}};RRMemory['prototype'][_0x4e29('0x18')]=function(_0x34581a){this[_0x4e29('0x13')]=rr(this[_0x4e29('0x7')][_0x4e29('0x19')]);logger[_0x4e29('0x15')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x4e29('0x6')]['id'],this[_0x4e29('0x13')]);if(_[_0x4e29('0x1a')](this[_0x4e29('0x8')][_0x4e29('0x12')][this[_0x4e29('0x13')]])){logger['info'](_0x4e29('0x1b'),this['squeue']['id'],this['agentId']);_0x34581a[_0x4e29('0x17')]();setTimeout(this[_0x4e29('0xa')][_0x4e29('0xb')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x4e29('0x6')]['id'],this[_0x4e29('0x8')][_0x4e29('0x12')][this['agentId']],this[_0x4e29('0x6')][_0x4e29('0x14')],!![])){this[_0x4e29('0x8')][_0x4e29('0x12')][this[_0x4e29('0x13')]]['busy']=!![];this[_0x4e29('0x8')][_0x4e29('0x12')][this[_0x4e29('0x13')]][_0x4e29('0x1c')]=this[_0x4e29('0x7')]['name'];util[_0x4e29('0x1d')](this[_0x4e29('0x5')],this[_0x4e29('0x6')]['id'],this[_0x4e29('0x8')]['agents'][this['agentId']],this[_0x4e29('0x7')],this[_0x4e29('0x4')]);util['writeLog'](this[_0x4e29('0x6')]['id'],this[_0x4e29('0x8')][_0x4e29('0x12')][this[_0x4e29('0x13')]],_0x4e29('0x1e'));this[_0x4e29('0x9')][this['agentId']]=setInterval(this[_0x4e29('0x10')][_0x4e29('0xb')](this,_0x34581a),0x3e8);}else{logger[_0x4e29('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x4e29('0x6')]['id'],this[_0x4e29('0x13')]);_0x34581a[_0x4e29('0x17')]();setTimeout(this['push'][_0x4e29('0xb')](this),0x3e8);}}};RRMemory['prototype'][_0x4e29('0xf')]=function(_0x57fd0a){logger[_0x4e29('0x15')](_0x4e29('0x1f'),this[_0x4e29('0x6')]['id'],this[_0x4e29('0x13')]);if(_['isNil'](this[_0x4e29('0x8')][_0x4e29('0x12')][this[_0x4e29('0x13')]])){logger[_0x4e29('0x15')](_0x4e29('0x1b'),this[_0x4e29('0x6')]['id'],this[_0x4e29('0x13')]);}else{clearInterval(this[_0x4e29('0x9')][this['agentId']]);util[_0x4e29('0x20')](this[_0x4e29('0x5')],this[_0x4e29('0x6')]['id'],this[_0x4e29('0x8')][_0x4e29('0x12')][this['agentId']],this['queue'],this[_0x4e29('0x4')]);util[_0x4e29('0x21')](this[_0x4e29('0x6')]['id'],this[_0x4e29('0x8')][_0x4e29('0x12')][this['agentId']],_0x4e29('0x22'));this[_0x4e29('0x8')][_0x4e29('0x12')][this[_0x4e29('0x13')]][_0x4e29('0x23')]=![];this['realtime'][_0x4e29('0x12')][this[_0x4e29('0x13')]][_0x4e29('0x1c')]=undefined;}if(!_0x57fd0a){setTimeout(this[_0x4e29('0xa')][_0x4e29('0xb')](this),0x3e8);}};function rrmemory(_0x3fe2e1,_0x13dee5,_0x3f5e35,_0x3c3ff2){return new RRMemory(_0x3fe2e1,_0x13dee5,_0x3f5e35,_0x3c3ff2);}module[_0x4e29('0x24')]=rrmemory;
\ No newline at end of file
index e3dcd18..b6ba0b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7096=['notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','util','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','user:save','split','\x20interaction','name','account','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7096,0x10c));var _0x6709=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7096[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var utils=require('../utils');var Mustache=require(_0x6709('0x1'));var Redis=require('ioredis');var config=require(_0x6709('0x2'));var logger=require(_0x6709('0x3'))(_0x6709('0x4'));config[_0x6709('0x5')]=_[_0x6709('0x6')](config[_0x6709('0x5')],{'host':_0x6709('0x7'),'port':0x18eb});var io=require(_0x6709('0x8'))(new Redis(config[_0x6709('0x5')]));function emit(_0x3e2223,_0x11ad23,_0x985814){io['to'](_0x3e2223)[_0x6709('0x9')](_0x11ad23,_0x985814);}function sendNotification(_0x513ab6,_0x5af380,_0x2c07b1,_0x2d8c0b,_0xbcb47,_0x1aa476){io['to'](util[_0x6709('0xa')](_0x6709('0xb'),_0x2d8c0b['name']))['emit'](_0x6709('0xc'),_0x2d8c0b);var _0x262261=_0x1aa476||{};var _0x275dd3=_0x2c07b1[_0x6709('0xd')]('.');var _0x31ac88={'uniqueid':_0x5af380,'channel':_0x275dd3[0x0],'id':_0x275dd3[0x1],'title':_0x275dd3[0x0]+_0x6709('0xe'),'interactionId':_0x275dd3[0x2],'queue':_0xbcb47?_0xbcb47[_0x6709('0xf')]:null,'sound':_0x262261[_0x6709('0x10')]['notificationSound'],'shake':_0x262261[_0x6709('0x10')][_0x6709('0x11')]};try{if(!_0x262261[_0x6709('0x12')]){_0x262261[_0x6709('0x12')]={};}if(_0xbcb47){_0x262261['body'][_0x6709('0x13')]=_0xbcb47;}else if(_0x262261['body'][_0x6709('0x13')]){delete _0x262261['body'][_0x6709('0x13')];}_0x31ac88[_0x6709('0x14')]=utils[_0x6709('0x15')](_0x262261[_0x6709('0x10')]['notificationTemplate'],_0x262261);}catch(_0x52e342){_0x31ac88['msg']=_0x6709('0x16');logger[_0x6709('0x17')](util['format'](_0x6709('0x18'),_0x5af380,_0x52e342[_0x6709('0x19')]));}io['to'](util[_0x6709('0xa')]('user:%s',_0x2d8c0b[_0x6709('0xf')]))[_0x6709('0x9')](util[_0x6709('0xa')](_0x6709('0x1a'),_0x513ab6?'save':_0x6709('0x1b')),_0x31ac88);}function writeLog(_0x1edac3,_0x373047,_0x3cf882){return logger[_0x6709('0x1c')](util[_0x6709('0xa')](_0x6709('0x1d'),_0x1edac3,_0x373047[_0x6709('0xf')],_0x3cf882));}exports[_0x6709('0x1e')]=function(_0x1c5153,_0x2f3415,_0xa36371,_0x5cf48b){if(_0x2f3415[_0x6709('0x1f')]){writeLog(_0x1c5153,_0x2f3415,_0x6709('0x20'));return![];}if(!_0x2f3415[_0x6709('0x21')]){writeLog(_0x1c5153,_0x2f3415,'OFFLINE');return![];}if(_0x2f3415[_0xa36371+_0x6709('0x22')]){writeLog(_0x1c5153,_0x2f3415,_0x6709('0x23'));return![];}if(_0x5cf48b&&_0x2f3415[_0x6709('0x24')](_0xa36371+_0x6709('0x25'))&&_0x2f3415['hasOwnProperty'](_0xa36371+_0x6709('0x26'))){if(_0x2f3415[_0xa36371+_0x6709('0x25')]>0x0&&_0x2f3415[_0xa36371+'CurrentCapacity']>=_0x2f3415[_0xa36371+_0x6709('0x25')]){writeLog(_0x1c5153,_0x2f3415,_0xa36371[_0x6709('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x6709('0x28')]=function(_0x2499a2,_0x50ada6,_0x271098,_0x5b5201,_0x46a325){return sendNotification(!![],_0x2499a2,_0x50ada6,_0x271098,_0x5b5201,_0x46a325);};exports[_0x6709('0x29')]=function(_0x5b6906,_0x137137,_0x4e6989,_0xe066d8,_0x388aee){return sendNotification(![],_0x5b6906,_0x137137,_0x4e6989,_0xe066d8,_0x388aee);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x7a54=['notification:%s','remove','info','isAgentAvailable','busy','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','routing','redis','defaults','localhost','user:%s','user:save','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','getMustacheRender','format','[%s][QUEUE]\x20%s','message','emit'];(function(_0x4d8a64,_0x25a36e){var _0x15d006=function(_0x5575ac){while(--_0x5575ac){_0x4d8a64['push'](_0x4d8a64['shift']());}};_0x15d006(++_0x25a36e);}(_0x7a54,0x106));var _0x47a5=function(_0x41935c,_0x4cfddf){_0x41935c=_0x41935c-0x0;var _0x4fb63f=_0x7a54[_0x41935c];return _0x4fb63f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var utils=require(_0x47a5('0x2'));var Mustache=require('mustache');var Redis=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var logger=require('../../../../../config/logger')(_0x47a5('0x5'));config[_0x47a5('0x6')]=_[_0x47a5('0x7')](config[_0x47a5('0x6')],{'host':_0x47a5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x47a5('0x6')]));function emit(_0x59199c,_0x343372,_0x30e405){io['to'](_0x59199c)['emit'](_0x343372,_0x30e405);}function sendNotification(_0x194fb0,_0x5077f3,_0x5d90b3,_0x582352,_0x2a0e98,_0x2baee7){io['to'](util['format'](_0x47a5('0x9'),_0x582352['name']))['emit'](_0x47a5('0xa'),_0x582352);var _0x69e4d4=_0x2baee7||{};var _0x2f399b=_0x5d90b3[_0x47a5('0xb')]('.');var _0xd612dd={'uniqueid':_0x5077f3,'channel':_0x2f399b[0x0],'id':_0x2f399b[0x1],'title':_0x2f399b[0x0]+_0x47a5('0xc'),'interactionId':_0x2f399b[0x2],'queue':_0x2a0e98?_0x2a0e98[_0x47a5('0xd')]:null,'sound':_0x69e4d4['account'][_0x47a5('0xe')],'shake':_0x69e4d4[_0x47a5('0xf')][_0x47a5('0x10')]};try{if(!_0x69e4d4[_0x47a5('0x11')]){_0x69e4d4[_0x47a5('0x11')]={};}if(_0x2a0e98){_0x69e4d4[_0x47a5('0x11')][_0x47a5('0x12')]=_0x2a0e98;}else if(_0x69e4d4[_0x47a5('0x11')]['queue']){delete _0x69e4d4[_0x47a5('0x11')][_0x47a5('0x12')];}_0xd612dd[_0x47a5('0x13')]=utils[_0x47a5('0x14')](_0x69e4d4[_0x47a5('0xf')]['notificationTemplate'],_0x69e4d4);}catch(_0x549de3){_0xd612dd[_0x47a5('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5077f3,_0x549de3[_0x47a5('0x17')]));}io['to'](util[_0x47a5('0x15')](_0x47a5('0x9'),_0x582352[_0x47a5('0xd')]))[_0x47a5('0x18')](util[_0x47a5('0x15')](_0x47a5('0x19'),_0x194fb0?'save':_0x47a5('0x1a')),_0xd612dd);}function writeLog(_0xf160ba,_0x47cf3c,_0x2b0360){return logger[_0x47a5('0x1b')](util[_0x47a5('0x15')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0xf160ba,_0x47cf3c[_0x47a5('0xd')],_0x2b0360));}exports[_0x47a5('0x1c')]=function(_0x23db32,_0x7a9f9e,_0x5ef1b1,_0xe2dea9){if(_0x7a9f9e[_0x47a5('0x1d')]){writeLog(_0x23db32,_0x7a9f9e,'BUSY');return![];}if(!_0x7a9f9e[_0x47a5('0x1e')]){writeLog(_0x23db32,_0x7a9f9e,_0x47a5('0x1f'));return![];}if(_0x7a9f9e[_0x5ef1b1+_0x47a5('0x20')]){writeLog(_0x23db32,_0x7a9f9e,_0x47a5('0x21'));return![];}if(_0xe2dea9&&_0x7a9f9e[_0x47a5('0x22')](_0x5ef1b1+'Capacity')&&_0x7a9f9e['hasOwnProperty'](_0x5ef1b1+_0x47a5('0x23'))){if(_0x7a9f9e[_0x5ef1b1+'Capacity']>0x0&&_0x7a9f9e[_0x5ef1b1+_0x47a5('0x23')]>=_0x7a9f9e[_0x5ef1b1+'Capacity']){writeLog(_0x23db32,_0x7a9f9e,_0x5ef1b1[_0x47a5('0x24')]()+_0x47a5('0x25'));return![];}}return!![];};exports[_0x47a5('0x26')]=function(_0x1dac65,_0x21f296,_0x3ba0b7,_0x24b162,_0x136b14){return sendNotification(!![],_0x1dac65,_0x21f296,_0x3ba0b7,_0x24b162,_0x136b14);};exports[_0x47a5('0x27')]=function(_0x361bfa,_0x1127f8,_0x11a4fa,_0x3ad507,_0x528582){return sendNotification(![],_0x361bfa,_0x1127f8,_0x11a4fa,_0x3ad507,_0x528582);};exports[_0x47a5('0x28')]=writeLog;
\ No newline at end of file
index 26b2636..01a731b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c6=['lodash','./utils','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs'];(function(_0x3bc6f1,_0x4f1bca){var _0xb88c24=function(_0x1e0ec0){while(--_0x1e0ec0){_0x3bc6f1['push'](_0x3bc6f1['shift']());}};_0xb88c24(++_0x4f1bca);}(_0x13c6,0x94));var _0x613c=function(_0x583a7b,_0x29a3ef){_0x583a7b=_0x583a7b-0x0;var _0x114d34=_0x13c6[_0x583a7b];return _0x114d34;};'use strict';var schema=require(_0x613c('0x0'));var sh=require(_0x613c('0x1'));var _=require(_0x613c('0x2'));var utils=require(_0x613c('0x3'));var logger=require(_0x613c('0x4'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x613c('0x5')}});exports['consequence']=function(_0x1e9fb8,_0x3007c7){return function(_0x5888fb){try{var _0x1b1cc6={'command':_0x3007c7[0x0]};var _0x56e0cb=system[_0x613c('0x0')](_0x1b1cc6,{'typecast':!![]});if(_0x56e0cb[_0x613c('0x6')]){logger[_0x613c('0x7')](_0x613c('0x8'),_0x1e9fb8,_[_0x613c('0x9')](_0x56e0cb,_0x613c('0xa'))[_0x613c('0xb')](',\x20'));logger[_0x613c('0xc')](_0x613c('0xd'),_0x1e9fb8);_0x5888fb[_0x613c('0xe')]();}else{var _0x2a0ccd=this;var _0x243caf=utils[_0x613c('0xf')](_0x3007c7[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x1e9fb8,_0x243caf);sh['exec'](_[_0x613c('0x10')](_0x243caf),function(_0x110481,_0x59a86e){logger['info'](_0x613c('0x11'),_0x1e9fb8,_0x110481);if(_0x110481==0x0){var _0x4ccde1=_0x59a86e[_0x613c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x613c('0x13')](_0x3007c7[0x1])||_[_0x613c('0x14')](_0x3007c7[0x1])){logger[_0x613c('0xc')](_0x613c('0x15'),_0x1e9fb8);_0x2a0ccd[_0x613c('0x16')][_0x3007c7[0x1]]=_0x4ccde1;}else{logger[_0x613c('0xc')](_0x613c('0x17'),_0x1e9fb8,_0x3007c7[0x1],_0x4ccde1);_0x2a0ccd['body'][_0x3007c7[0x1]]=_0x4ccde1;}}_0x5888fb[_0x613c('0xe')]();});}}catch(_0x115b45){logger[_0x613c('0x7')](_0x613c('0x8'),_0x1e9fb8,_['isObject'](_0x115b45)?JSON[_0x613c('0x18')](_0x115b45):_0x115b45);logger[_0x613c('0xc')](_0x613c('0xd'),_0x1e9fb8);_0x5888fb[_0x613c('0xe')]();}};};
\ No newline at end of file
+var _0x0641=['routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','exec','trim','replace','isNil','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x139543,_0x276848){var _0x3d0ed8=function(_0x1e0e62){while(--_0x1e0e62){_0x139543['push'](_0x139543['shift']());}};_0x3d0ed8(++_0x276848);}(_0x0641,0x140));var _0x1064=function(_0x435117,_0x2b9bad){_0x435117=_0x435117-0x0;var _0x585a63=_0x0641[_0x435117];return _0x585a63;};'use strict';var schema=require(_0x1064('0x0'));var sh=require(_0x1064('0x1'));var _=require(_0x1064('0x2'));var utils=require(_0x1064('0x3'));var logger=require(_0x1064('0x4'))(_0x1064('0x5'));var system=schema({'command':{'type':_0x1064('0x6'),'required':!![],'message':_0x1064('0x7')}});exports['consequence']=function(_0x4841a4,_0x4d66a2){return function(_0x48158a){try{var _0x33c787={'command':_0x4d66a2[0x0]};var _0x367519=system[_0x1064('0x0')](_0x33c787,{'typecast':!![]});if(_0x367519[_0x1064('0x8')]){logger[_0x1064('0x9')](_0x1064('0xa'),_0x4841a4,_[_0x1064('0xb')](_0x367519,_0x1064('0xc'))[_0x1064('0xd')](',\x20'));logger[_0x1064('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4841a4);_0x48158a[_0x1064('0xf')]();}else{var _0x39fc0b=this;var _0x5c1839=utils[_0x1064('0x10')](_0x4d66a2[0x0],this);logger[_0x1064('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x4841a4,_0x5c1839);sh[_0x1064('0x11')](_[_0x1064('0x12')](_0x5c1839),function(_0x1d3569,_0x2f649f){logger[_0x1064('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x4841a4,_0x1d3569);if(_0x1d3569==0x0){var _0x42f31b=_0x2f649f[_0x1064('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x1064('0x14')](_0x4d66a2[0x1])||_['isEmpty'](_0x4d66a2[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x4841a4);_0x39fc0b['body'][_0x4d66a2[0x1]]=_0x42f31b;}else{logger[_0x1064('0xe')](_0x1064('0x15'),_0x4841a4,_0x4d66a2[0x1],_0x42f31b);_0x39fc0b['body'][_0x4d66a2[0x1]]=_0x42f31b;}}_0x48158a[_0x1064('0xf')]();});}}catch(_0x421cc5){logger[_0x1064('0x9')](_0x1064('0xa'),_0x4841a4,_[_0x1064('0x16')](_0x421cc5)?JSON[_0x1064('0x17')](_0x421cc5):_0x421cc5);logger[_0x1064('0xe')](_0x1064('0x18'),_0x4841a4);_0x48158a['next']();}};};
\ No newline at end of file
index bbf7c76..155cb9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bf6=['join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','interaction','catch','[%s][TAG]\x20%s','stringify','finally','isObject','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','map','message'];(function(_0x3a6640,_0x55a4b0){var _0x33a0da=function(_0x9177f3){while(--_0x9177f3){_0x3a6640['push'](_0x3a6640['shift']());}};_0x33a0da(++_0x55a4b0);}(_0x0bf6,0x7a));var _0x60bf=function(_0x25573f,_0x2e424e){_0x25573f=_0x25573f-0x0;var _0xe48c7f=_0x0bf6[_0x25573f];return _0xe48c7f;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x60bf('0x0')),'openchannelInteraction':require(_0x60bf('0x1')),'smsInteraction':require(_0x60bf('0x2')),'mailInteraction':require(_0x60bf('0x3')),'faxInteraction':require(_0x60bf('0x4')),'whatsappInteraction':require(_0x60bf('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0x60bf('0x6')}});exports[_0x60bf('0x7')]=function(_0x59f36e,_0x18059a,_0x474f0a,_0x5f26dc){return function(_0x3241a5){try{var _0x570457={'tag':_0x18059a[0x0]};var _0x5d5afa=tag[_0x60bf('0x8')](_0x570457,{'typecast':!![]});if(_0x5d5afa[_0x60bf('0x9')]){logger[_0x60bf('0xa')]('[%s][TAG]\x20%s',_0x59f36e,_[_0x60bf('0xb')](_0x5d5afa,_0x60bf('0xc'))[_0x60bf('0xd')](',\x20'));logger[_0x60bf('0xe')](_0x60bf('0xf'),_0x59f36e);_0x3241a5[_0x60bf('0x10')]();}else{var _0x14a357={'ids':[_0x18059a[0x0]]};if(rpc[_0x5f26dc[_0x60bf('0x11')]+'Interaction']){rpc[_0x5f26dc[_0x60bf('0x11')]+_0x60bf('0x12')][_0x60bf('0x13')](_0x5f26dc['interaction']['id'],_0x14a357)[_0x60bf('0x14')](function(_0x32c9ec){logger[_0x60bf('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x59f36e,_0x18059a[0x1],_0x5f26dc[_0x60bf('0x11')],_0x5f26dc[_0x60bf('0x15')]['id']);})[_0x60bf('0x16')](function(_0x4ffbb2){logger[_0x60bf('0xa')](_0x60bf('0x17'),_0x59f36e,JSON[_0x60bf('0x18')](_0x4ffbb2));logger[_0x60bf('0xe')](_0x60bf('0xf'),_0x59f36e);})[_0x60bf('0x19')](function(){_0x3241a5[_0x60bf('0x10')]();});}}}catch(_0x4128ed){logger[_0x60bf('0xa')](_0x60bf('0x17'),_0x59f36e,_[_0x60bf('0x1a')](_0x4128ed)?JSON[_0x60bf('0x18')](_0x4128ed):_0x4128ed);logger[_0x60bf('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x59f36e);_0x3241a5[_0x60bf('0x10')]();}};};
\ No newline at end of file
+var _0x18f4=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number'];(function(_0x3b2550,_0xd16ab5){var _0x32cc6b=function(_0x59357c){while(--_0x59357c){_0x3b2550['push'](_0x3b2550['shift']());}};_0x32cc6b(++_0xd16ab5);}(_0x18f4,0x135));var _0x418f=function(_0x3e123d,_0x49d448){_0x3e123d=_0x3e123d-0x0;var _0x5abffe=_0x18f4[_0x3e123d];return _0x5abffe;};'use strict';var schema=require(_0x418f('0x0'));var _=require(_0x418f('0x1'));var rpc={'chatInteraction':require(_0x418f('0x2')),'openchannelInteraction':require(_0x418f('0x3')),'smsInteraction':require(_0x418f('0x4')),'mailInteraction':require(_0x418f('0x5')),'faxInteraction':require(_0x418f('0x6')),'whatsappInteraction':require(_0x418f('0x7'))};var logger=require(_0x418f('0x8'))('routing');var tag=schema({'tag':{'type':_0x418f('0x9'),'required':!![],'message':_0x418f('0xa')}});exports[_0x418f('0xb')]=function(_0x4e57c0,_0x260560,_0x40abfd,_0x303f27){return function(_0x3a1f71){try{var _0x55dd60={'tag':_0x260560[0x0]};var _0x23e00d=tag['validate'](_0x55dd60,{'typecast':!![]});if(_0x23e00d['length']){logger[_0x418f('0xc')](_0x418f('0xd'),_0x4e57c0,_[_0x418f('0xe')](_0x23e00d,_0x418f('0xf'))['join'](',\x20'));logger['info'](_0x418f('0x10'),_0x4e57c0);_0x3a1f71[_0x418f('0x11')]();}else{var _0x4b5fd2={'ids':[_0x260560[0x0]]};if(rpc[_0x303f27['channel']+_0x418f('0x12')]){rpc[_0x303f27[_0x418f('0x13')]+_0x418f('0x12')][_0x418f('0x14')](_0x303f27[_0x418f('0x15')]['id'],_0x4b5fd2)[_0x418f('0x16')](function(_0x176640){logger[_0x418f('0x17')](_0x418f('0x18'),_0x4e57c0,_0x260560[0x1],_0x303f27['channel'],_0x303f27[_0x418f('0x15')]['id']);})[_0x418f('0x19')](function(_0x33a94c){logger['error'](_0x418f('0xd'),_0x4e57c0,JSON[_0x418f('0x1a')](_0x33a94c));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4e57c0);})[_0x418f('0x1b')](function(){_0x3a1f71[_0x418f('0x11')]();});}}}catch(_0x77ad92){logger[_0x418f('0xc')](_0x418f('0xd'),_0x4e57c0,_[_0x418f('0x1c')](_0x77ad92)?JSON[_0x418f('0x1a')](_0x77ad92):_0x77ad92);logger[_0x418f('0x17')](_0x418f('0x10'),_0x4e57c0);_0x3a1f71[_0x418f('0x11')]();}};};
\ No newline at end of file
index a1ccbe8..4ff9e54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x5c67e1,_0x4bddf1){var _0x2daab1=function(_0x4e3455){while(--_0x4e3455){_0x5c67e1['push'](_0x5c67e1['shift']());}};_0x2daab1(++_0x4bddf1);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x413891,_0x4df61a){var _0x4833e2=function(_0x1494e4){while(--_0x1494e4){_0x413891['push'](_0x413891['shift']());}};_0x4833e2(++_0x4df61a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
index d0bf2cf..b828ad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd057=['faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','interaction','isArray','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','format','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','hasOwnProperty','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd057,0x1ed));var _0x7d05=function(_0x3c7636,_0x13a2fd){_0x3c7636=_0x3c7636-0x0;var _0x159e71=_0xd057[_0x3c7636];return _0x159e71;};'use strict';var _=require(_0x7d05('0x0'));var util=require(_0x7d05('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x7d05('0x2'));var BPromise=require(_0x7d05('0x3'));var uuid=require(_0x7d05('0x4'));var config=require('../../../config/environment');var logger=require(_0x7d05('0x5'))(_0x7d05('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7d05('0x7')),'chatQueueReport':require(_0x7d05('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x7d05('0x9')),'whatsappQueueReport':require(_0x7d05('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4d8dff,_0x2d8494,_0x2bb3fb){return util['format'](_0x7d05('0xb'),_0x4d8dff,_0x2d8494||0x0,_0x2bb3fb||0x0);}function getIntervals(_0x5207b5,_0x28ad14){var _0x1ab422=[];if(!_['isNil'](_0x28ad14[_0x7d05('0xc')])&&!_[_0x7d05('0xd')](_0x5207b5[_0x28ad14[_0x7d05('0xc')]])&&!_[_0x7d05('0xd')](_0x5207b5[_0x28ad14[_0x7d05('0xc')]][_0x7d05('0xe')])){_0x1ab422=_[_0x7d05('0xf')](_0x5207b5[_0x28ad14[_0x7d05('0xc')]]['Intervals'],_0x7d05('0x10'));}else if(!_[_0x7d05('0xd')](_0x28ad14['interval'])){_0x1ab422=[_0x28ad14['interval']];}return _0x1ab422;}exports['listen']=function(_0x41fd4d){_0x41fd4d[_0x7d05('0x11')]={};return new BPromise(function(_0x74668c,_0x3a9f18){var _0x5d6260={'Start':function(_0x45929b){var _0x324a07=this;return new Promise(function(_0x436733,_0x102136){if(_0x45929b){try{var _0x2ae0b9=[];var _0x722650=getId(_0x45929b[_0x7d05('0x12')],_0x45929b[_0x7d05('0x13')]?_0x45929b[_0x7d05('0x13')]['id']:0x0,_0x45929b['interaction']?_0x45929b[_0x7d05('0x14')]['id']:0x0);if(_0x45929b['applications']&&_[_0x7d05('0x15')](_0x45929b[_0x7d05('0x16')])&&_0x45929b['applications'][_0x7d05('0x17')]){for(var _0x2b2081=0x0;_0x2b2081<_0x45929b[_0x7d05('0x16')][_0x7d05('0x17')];_0x2b2081+=0x1){var _0x427bb3=_0x45929b[_0x7d05('0x16')][_0x2b2081];if(fs[_0x7d05('0x18')](path[_0x7d05('0x19')](__dirname,_0x7d05('0x16'),_0x427bb3['app']+_0x7d05('0x1a')))){var _0x4f43fe=[];switch(_0x427bb3[_0x7d05('0x1b')][_0x7d05('0x1c')]()){case _0x7d05('0x1d'):var _0x39e862=_0x427bb3[_0x7d05('0x1e')][_0x7d05('0x1f')](',');if(_0x45929b[_0x7d05('0x12')]===_0x7d05('0x20')){_0x4f43fe[_0x7d05('0x21')](_0x39e862[0x0]);_0x4f43fe[_0x7d05('0x21')](_0x39e862[0x1]);_0x4f43fe['push'](_0x39e862[_0x7d05('0x22')](0x2,_0x39e862[_0x7d05('0x17')])[_0x7d05('0x19')](','));}else{_0x4f43fe['push'](_0x39e862[0x0]);_0x4f43fe[_0x7d05('0x21')](_0x39e862[_0x7d05('0x22')](0x1,_0x39e862[_0x7d05('0x17')])[_0x7d05('0x19')](','));}break;case _0x7d05('0x23'):var _0x35bd39=_0x427bb3['appdata'][_0x7d05('0x1f')](',');_0x4f43fe[_0x7d05('0x21')](_0x35bd39[0x0]);_0x4f43fe[_0x7d05('0x21')](_0x35bd39[0x1]);_0x4f43fe[_0x7d05('0x21')](_0x35bd39[_0x7d05('0x22')](0x2,_0x35bd39['length'])[_0x7d05('0x19')](','));break;case _0x7d05('0x24'):var _0x417253=_0x427bb3[_0x7d05('0x1e')]['split'](',');_0x4f43fe[_0x7d05('0x21')](_0x417253[0x0]);_0x4f43fe['push'](_0x417253[0x1]);_0x4f43fe[_0x7d05('0x21')](_0x417253[0x2]);_0x4f43fe[_0x7d05('0x21')](_0x417253[0x3]);_0x4f43fe[_0x7d05('0x21')](_0x417253['slice'](0x4,_0x417253[_0x7d05('0x17')])['join'](','));break;case'amazonlex':var _0x3000d3=_0x427bb3['appdata'][_0x7d05('0x1f')](',');_0x4f43fe[_0x7d05('0x21')](_0x3000d3[0x0]);_0x4f43fe[_0x7d05('0x21')](_0x3000d3[0x1]);_0x4f43fe[_0x7d05('0x21')](_0x3000d3[0x2]);_0x4f43fe[_0x7d05('0x21')](_0x3000d3[0x3]);_0x4f43fe[_0x7d05('0x21')](_0x3000d3['slice'](0x4,_0x3000d3['length'])[_0x7d05('0x19')](','));break;case _0x7d05('0x13'):_0x4f43fe[_0x7d05('0x21')](_0x427bb3[_0x7d05('0x1e')]);break;case _0x7d05('0x25'):_0x4f43fe[_0x7d05('0x21')](_0x427bb3['TagId']);_0x4f43fe[_0x7d05('0x21')](_0x427bb3[_0x7d05('0x1e')]);break;default:_0x4f43fe=_['isNil'](_0x427bb3[_0x7d05('0x1e')])?[]:_0x427bb3[_0x7d05('0x1e')][_0x7d05('0x1f')](',');}var _0x467290={'id':util[_0x7d05('0x26')](_0x7d05('0x27'),_0x722650,_0x427bb3['id'],_0x427bb3[_0x7d05('0x1b')]),'condition':require(_0x7d05('0x28'))[_0x7d05('0x29')](_0x722650,getIntervals(_0x41fd4d['intervals'],_0x427bb3),_0x41fd4d),'consequence':require(_0x7d05('0x2a')+_0x427bb3[_0x7d05('0x1b')])[_0x7d05('0x2b')](_0x722650,_0x4f43fe,_0x41fd4d,_0x45929b),'p':_0x427bb3[_0x7d05('0x2c')]||0x0};logger[_0x7d05('0x2d')](_0x7d05('0x2e'),_0x467290['id'],_0x7d05('0x2f'),getIntervals(_0x41fd4d[_0x7d05('0x30')],_0x427bb3)[_0x7d05('0x19')](_0x7d05('0x31')));_0x2ae0b9[_0x7d05('0x21')](_0x467290);}else{logger[_0x7d05('0x32')](_0x7d05('0x33'),path[_0x7d05('0x19')](__dirname,_0x7d05('0x16'),_0x427bb3[_0x7d05('0x1b')]+_0x7d05('0x1a')));}}_0x41fd4d[_0x7d05('0x11')][_0x722650]=new RuleEngine(_0x2ae0b9);_0x41fd4d[_0x7d05('0x11')][_0x722650][_0x7d05('0x34')](_0x45929b,function(_0x16c007){logger[_0x7d05('0x2d')](_0x7d05('0x35'),JSON[_0x7d05('0x36')](_0x16c007['matchPath']));if(_0x41fd4d[_0x7d05('0x11')][_0x722650]){_0x41fd4d[_0x7d05('0x11')][_0x722650][_0x7d05('0x37')](_0x7d05('0x38'));}});return _0x436733({'code':0xc8,'message':_0x45929b});}else{logger[_0x7d05('0x2d')]('No\x20applications\x20to\x20execute');return _0x436733({'code':0xc8,'message':_0x45929b});}}catch(_0x3b2841){logger[_0x7d05('0x32')](_0x3b2841[_0x7d05('0x39')]);return _0x102136(_0x324a07[_0x7d05('0x32')](0x1f4,_0x3b2841));}}return _0x102136(_0x7d05('0x3a'));});},'AcceptMessage':function(_0x56ace6){var _0x5e1d8f=this;return new Promise(function(_0x5326e6,_0x1223ce){if(_0x56ace6[_0x7d05('0x3b')]&&_0x56ace6[_0x7d05('0x3b')]['id']){if(_0x41fd4d[_0x7d05('0x3c')][_0x56ace6[_0x7d05('0x3b')]['id']]){_0x41fd4d['agents'][_0x56ace6['agent']['id']][_0x7d05('0x3d')]=![];_0x41fd4d['agents'][_0x56ace6[_0x7d05('0x3b')]['id']][_0x7d05('0x3e')]=undefined;}}if(_0x56ace6[_0x7d05('0x13')]&&_0x56ace6[_0x7d05('0x13')]['id']){try{var _0x5a99e6=getId(_0x56ace6[_0x7d05('0x12')],_0x56ace6['message']?_0x56ace6[_0x7d05('0x13')]['id']:0x0,_0x56ace6[_0x7d05('0x14')]?_0x56ace6[_0x7d05('0x14')]['id']:0x0);if(_0x41fd4d['rules'][_0x5a99e6]){_0x41fd4d['rules'][_0x5a99e6][_0x7d05('0x37')](_0x7d05('0x3f'));if(rpc[_0x56ace6[_0x7d05('0x12')]+'QueueReport']){rpc[_0x56ace6[_0x7d05('0x12')]+'QueueReport'][_0x7d05('0x40')](_0x5a99e6,{'UserId':_0x56ace6['message'][_0x7d05('0x41')]})['catch'](function(_0x2478dc){logger['error'](_0x7d05('0x42'));});}}return _0x5326e6({'code':0xc8,'message':_0x56ace6});}catch(_0x3b2af2){logger[_0x7d05('0x32')](_0x3b2af2[_0x7d05('0x39')]);return _0x1223ce(_0x5e1d8f[_0x7d05('0x32')](0x1f4,_0x3b2af2));}}logger[_0x7d05('0x32')](_0x7d05('0x43'));return _0x1223ce(_0x5e1d8f[_0x7d05('0x32')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x333177){var _0x151407=this;return new Promise(function(_0x211600,_0x5e1561){if(_0x333177[_0x7d05('0x3b')]&&_0x333177[_0x7d05('0x3b')]['id']){try{if(_0x41fd4d[_0x7d05('0x3c')][_0x333177[_0x7d05('0x3b')]['id']]){_0x41fd4d[_0x7d05('0x3c')][_0x333177['agent']['id']][_0x7d05('0x3d')]=![];_0x41fd4d[_0x7d05('0x3c')][_0x333177['agent']['id']][_0x7d05('0x3e')]=undefined;}return _0x211600({'code':0xc8,'message':_0x333177});}catch(_0x1f20c5){logger[_0x7d05('0x32')](_0x1f20c5[_0x7d05('0x39')]);return _0x5e1561(_0x151407['error'](0x1f4,_0x1f20c5));}}logger[_0x7d05('0x32')](_0x7d05('0x43'));return _0x5e1561(_0x151407[_0x7d05('0x32')](0x1f4,_0x7d05('0x43')));});},'AbandonInteraction':function(_0x143692){var _0x53d609=this;return new Promise(function(_0x38d42d,_0x222214){if(_0x143692[_0x7d05('0x12')]&&_0x143692['interaction']&&_0x143692[_0x7d05('0x14')]['id']){try{var _0x395c96=getId(_0x143692[_0x7d05('0x12')],_0x143692[_0x7d05('0x13')]?_0x143692[_0x7d05('0x13')]['id']:0x0,_0x143692[_0x7d05('0x14')]?_0x143692['interaction']['id']:0x0);if(_0x41fd4d[_0x7d05('0x11')][_0x395c96]){_0x41fd4d[_0x7d05('0x11')][_0x395c96][_0x7d05('0x37')](_0x7d05('0x3f'));}return _0x38d42d({'code':0xc8,'message':_0x143692});}catch(_0x3f92a2){logger[_0x7d05('0x32')](_0x3f92a2[_0x7d05('0x39')]);return _0x222214(_0x53d609[_0x7d05('0x32')](0x1f4,_0x3f92a2));}}logger[_0x7d05('0x32')](_0x7d05('0x43'));return _0x222214(_0x53d609[_0x7d05('0x32')](0x1f4,_0x7d05('0x43')));});},'AgentCapacity':function(_0x224fa3){var _0xa0d063=this;return new Promise(function(_0x5afe6e,_0x1fe5c5){if(_0x41fd4d['agents']['hasOwnProperty'](_0x224fa3['id'])){for(var _0x3d4533 in _0x224fa3[_0x7d05('0x44')]){if(_0x224fa3[_0x7d05('0x44')]['hasOwnProperty'](_0x3d4533)){if(_0x41fd4d[_0x7d05('0x3c')][_0x224fa3['id']]['hasOwnProperty'](_0x3d4533+_0x7d05('0x45'))){_0x41fd4d['agents'][_0x224fa3['id']][_0x3d4533+_0x7d05('0x45')]=parseInt(_0x224fa3[_0x7d05('0x44')][_0x3d4533],0xa);}}}_0x41fd4d[_0x7d05('0x3c')][_0x224fa3['id']][_0x7d05('0x46')]();return _0x5afe6e({'code':0xc8,'message':_0x41fd4d[_0x7d05('0x3c')][_0x224fa3['id']]});}else{return _0x1fe5c5(_0xa0d063['error'](0x1f4,_0x7d05('0x47')));}});},'Agents':function(_0xc2331d){return new Promise(function(_0x12faec,_0x3c13e0){var _0x2c30be=_[_0x7d05('0x48')](_0x41fd4d[_0x7d05('0x3c')]);_0x12faec({'count':_0x2c30be[_0x7d05('0x17')],'rows':_0x2c30be});});},'ChatQueues':function(_0x419784){return new Promise(function(_0x8cf2d5,_0x4626fd){var _0x551e2d=[];for(var _0x53a04e in _0x41fd4d['chatQueues']){if(_0x41fd4d['chatQueues']['hasOwnProperty'](_0x53a04e)){var _0x16aef1=_0x41fd4d[_0x7d05('0x49')][_0x53a04e];var _0x2f949b={'id':_0x16aef1['id'],'available':_0x16aef1[_0x7d05('0x4a')],'loggedIn':_0x16aef1[_0x7d05('0x4b')],'name':_0x16aef1[_0x7d05('0x4c')],'paused':_0x16aef1[_0x7d05('0x4d')],'waiting':_0x16aef1[_0x7d05('0x4e')]};_0x551e2d['push'](_0x2f949b);}}_0x8cf2d5({'count':_0x551e2d[_0x7d05('0x17')],'rows':_0x551e2d});});},'MailQueues':function(_0x1a4b05){return new Promise(function(_0x3704b5,_0x3d5ad1){var _0x39d826=[];for(var _0x468c80 in _0x41fd4d['mailQueues']){if(_0x41fd4d[_0x7d05('0x4f')]['hasOwnProperty'](_0x468c80)){var _0x3940a3=_0x41fd4d[_0x7d05('0x4f')][_0x468c80];var _0x5ecf3c={'id':_0x3940a3['id'],'available':_0x3940a3['available'],'loggedIn':_0x3940a3[_0x7d05('0x4b')],'name':_0x3940a3[_0x7d05('0x4c')],'paused':_0x3940a3[_0x7d05('0x4d')],'waiting':_0x3940a3[_0x7d05('0x4e')]};_0x39d826[_0x7d05('0x21')](_0x5ecf3c);}}_0x3704b5({'count':_0x39d826[_0x7d05('0x17')],'rows':_0x39d826});});},'OpenchannelQueues':function(_0xadbdeb){return new Promise(function(_0x2516b6,_0x112c26){var _0x4148c3=[];for(var _0x314cb1 in _0x41fd4d['openchannelQueues']){if(_0x41fd4d[_0x7d05('0x50')][_0x7d05('0x51')](_0x314cb1)){var _0x941d82=_0x41fd4d[_0x7d05('0x50')][_0x314cb1];var _0x407819={'id':_0x941d82['id'],'available':_0x941d82[_0x7d05('0x4a')],'loggedIn':_0x941d82['loggedIn'],'name':_0x941d82['name'],'paused':_0x941d82['paused'],'waiting':_0x941d82[_0x7d05('0x4e')]};_0x4148c3[_0x7d05('0x21')](_0x407819);}}_0x2516b6({'count':_0x4148c3['length'],'rows':_0x4148c3});});},'SmsQueues':function(_0x4fa16e){return new Promise(function(_0x210aea,_0x4289ad){var _0xd145cb=[];for(var _0xf1b1e0 in _0x41fd4d['smsQueues']){if(_0x41fd4d[_0x7d05('0x52')][_0x7d05('0x51')](_0xf1b1e0)){var _0x4186aa=_0x41fd4d['smsQueues'][_0xf1b1e0];var _0x315afa={'id':_0x4186aa['id'],'available':_0x4186aa[_0x7d05('0x4a')],'loggedIn':_0x4186aa[_0x7d05('0x4b')],'name':_0x4186aa[_0x7d05('0x4c')],'paused':_0x4186aa['paused'],'waiting':_0x4186aa[_0x7d05('0x4e')]};_0xd145cb[_0x7d05('0x21')](_0x315afa);}}_0x210aea({'count':_0xd145cb[_0x7d05('0x17')],'rows':_0xd145cb});});},'FaxQueues':function(_0x3b5ba8){return new Promise(function(_0x59f6f7,_0x3bf051){var _0x10132e=[];for(var _0x118ab2 in _0x41fd4d[_0x7d05('0x53')]){if(_0x41fd4d[_0x7d05('0x53')][_0x7d05('0x51')](_0x118ab2)){var _0x5b54e0=_0x41fd4d['faxQueues'][_0x118ab2];var _0x45f776={'id':_0x5b54e0['id'],'available':_0x5b54e0['available'],'loggedIn':_0x5b54e0[_0x7d05('0x4b')],'name':_0x5b54e0[_0x7d05('0x4c')],'paused':_0x5b54e0[_0x7d05('0x4d')],'waiting':_0x5b54e0[_0x7d05('0x4e')]};_0x10132e['push'](_0x45f776);}}_0x59f6f7({'count':_0x10132e[_0x7d05('0x17')],'rows':_0x10132e});});},'WhatsappQueues':function(_0x2b40ac){return new Promise(function(_0x19421d,_0x261ae4){var _0x1c9f51=[];for(var _0x3cd9b1 in _0x41fd4d['whatsappQueues']){if(_0x41fd4d['whatsappQueues'][_0x7d05('0x51')](_0x3cd9b1)){var _0x59472f=_0x41fd4d[_0x7d05('0x54')][_0x3cd9b1];var _0x2722d6={'id':_0x59472f['id'],'available':_0x59472f[_0x7d05('0x4a')],'loggedIn':_0x59472f['loggedIn'],'name':_0x59472f[_0x7d05('0x4c')],'paused':_0x59472f[_0x7d05('0x4d')],'waiting':_0x59472f[_0x7d05('0x4e')]};_0x1c9f51[_0x7d05('0x21')](_0x2722d6);}}_0x19421d({'count':_0x1c9f51[_0x7d05('0x17')],'rows':_0x1c9f51});});},'ChatQueuesWaitingInteractions':function(_0x4c74c6){return new Promise(function(_0x40bacc,_0x4bef17){var _0xf7d889=_[_0x7d05('0x48')](_0x41fd4d[_0x7d05('0x55')]);_0x40bacc({'count':_0xf7d889[_0x7d05('0x17')],'rows':_0xf7d889});});},'MailQueuesWaitingInteractions':function(_0x57ba74){return new Promise(function(_0xed3931,_0x4736d9){var _0x36e3d8=_[_0x7d05('0x48')](_0x41fd4d[_0x7d05('0x56')]);_0xed3931({'count':_0x36e3d8['length'],'rows':_0x36e3d8});});},'OpenchannelQueuesWaitingInteractions':function(_0x56c85c){return new Promise(function(_0x5d03a2,_0x458304){var _0x5f5776=_[_0x7d05('0x48')](_0x41fd4d[_0x7d05('0x57')]);_0x5d03a2({'count':_0x5f5776[_0x7d05('0x17')],'rows':_0x5f5776});});},'SmsQueuesWaitingInteractions':function(_0x6e4f43){return new Promise(function(_0x2ef94e,_0x97bfeb){var _0x438a33=_[_0x7d05('0x48')](_0x41fd4d[_0x7d05('0x58')]);_0x2ef94e({'count':_0x438a33['length'],'rows':_0x438a33});});},'FaxQueuesWaitingInteractions':function(_0x2104f9){return new Promise(function(_0x1799dc,_0x233d73){var _0x26a028=_[_0x7d05('0x48')](_0x41fd4d[_0x7d05('0x59')]);_0x1799dc({'count':_0x26a028[_0x7d05('0x17')],'rows':_0x26a028});});},'WhatsappQueuesWaitingInteractions':function(_0x56973a){return new Promise(function(_0x1d7118,_0x203bab){var _0x5ddb44=_[_0x7d05('0x48')](_0x41fd4d[_0x7d05('0x5a')]);_0x1d7118({'count':_0x5ddb44[_0x7d05('0x17')],'rows':_0x5ddb44});});}};var _0x5c0899=jayson[_0x7d05('0x5b')](_0x5d6260)[_0x7d05('0x5c')]();_0x5c0899['on'](_0x7d05('0x32'),function(_0x1ff209){logger[_0x7d05('0x32')](JSON[_0x7d05('0x36')](_0x1ff209));return _0x3a9f18(_0x1ff209);});_0x5c0899['listen'](0x232c,_0x7d05('0x5d'),function(){console[_0x7d05('0x5e')](_0x7d05('0x5f'),0x232c);return _0x74668c(_0x7d05('0x60')+0x232c);});});};
\ No newline at end of file
+var _0xeccb=['intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','.js','info','Applications\x20executed','stringify','rules','error','stack','routing\x20is\x20empty','agent','agents','busyQueue','emit','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','waiting','mailQueues','paused','name','smsQueues','loggedIn','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel','message','interaction','applications','length','app','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflowv2','amazonlex','tag','TagId','format','%s:%s:%s','condition','./applications/','consequence','priority','Push\x20new\x20rule'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeccb,0xdf));var _0xbecc=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xeccb[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xbecc('0x0'));var util=require(_0xbecc('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xbecc('0x2'));var BPromise=require(_0xbecc('0x3'));var uuid=require(_0xbecc('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0xbecc('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xbecc('0x6')),'smsQueueReport':require(_0xbecc('0x7')),'faxQueueReport':require(_0xbecc('0x8')),'whatsappQueueReport':require(_0xbecc('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x146f9b,_0x2f455d,_0x3e4cb8){return util['format'](_0xbecc('0xa'),_0x146f9b,_0x2f455d||0x0,_0x3e4cb8||0x0);}function getIntervals(_0x517312,_0x14cc95){var _0x5d5873=[];if(!_[_0xbecc('0xb')](_0x14cc95['IntervalId'])&&!_[_0xbecc('0xb')](_0x517312[_0x14cc95['IntervalId']])&&!_[_0xbecc('0xb')](_0x517312[_0x14cc95[_0xbecc('0xc')]][_0xbecc('0xd')])){_0x5d5873=_[_0xbecc('0xe')](_0x517312[_0x14cc95[_0xbecc('0xc')]][_0xbecc('0xd')],_0xbecc('0xf'));}else if(!_['isNil'](_0x14cc95[_0xbecc('0xf')])){_0x5d5873=[_0x14cc95[_0xbecc('0xf')]];}return _0x5d5873;}exports['listen']=function(_0x4764ff){_0x4764ff['rules']={};return new BPromise(function(_0x210a3f,_0x3a0e41){var _0x60cd17={'Start':function(_0x5e6169){var _0x275b2e=this;return new Promise(function(_0x3d95cf,_0x5e66f4){if(_0x5e6169){try{var _0x45176c=[];var _0x4432cf=getId(_0x5e6169[_0xbecc('0x10')],_0x5e6169['message']?_0x5e6169[_0xbecc('0x11')]['id']:0x0,_0x5e6169['interaction']?_0x5e6169[_0xbecc('0x12')]['id']:0x0);if(_0x5e6169[_0xbecc('0x13')]&&_['isArray'](_0x5e6169[_0xbecc('0x13')])&&_0x5e6169[_0xbecc('0x13')][_0xbecc('0x14')]){for(var _0x5897db=0x0;_0x5897db<_0x5e6169['applications'][_0xbecc('0x14')];_0x5897db+=0x1){var _0x52e43d=_0x5e6169[_0xbecc('0x13')][_0x5897db];if(fs['existsSync'](path['join'](__dirname,_0xbecc('0x13'),_0x52e43d[_0xbecc('0x15')]+'.js'))){var _0x2c291d=[];switch(_0x52e43d[_0xbecc('0x15')][_0xbecc('0x16')]()){case _0xbecc('0x17'):var _0x28c4c7=_0x52e43d[_0xbecc('0x18')][_0xbecc('0x19')](',');if(_0x5e6169[_0xbecc('0x10')]===_0xbecc('0x1a')){_0x2c291d[_0xbecc('0x1b')](_0x28c4c7[0x0]);_0x2c291d[_0xbecc('0x1b')](_0x28c4c7[0x1]);_0x2c291d[_0xbecc('0x1b')](_0x28c4c7[_0xbecc('0x1c')](0x2,_0x28c4c7[_0xbecc('0x14')])['join'](','));}else{_0x2c291d[_0xbecc('0x1b')](_0x28c4c7[0x0]);_0x2c291d['push'](_0x28c4c7[_0xbecc('0x1c')](0x1,_0x28c4c7[_0xbecc('0x14')])[_0xbecc('0x1d')](','));}break;case'dialogflow':var _0x162b69=_0x52e43d['appdata'][_0xbecc('0x19')](',');_0x2c291d['push'](_0x162b69[0x0]);_0x2c291d['push'](_0x162b69[0x1]);_0x2c291d[_0xbecc('0x1b')](_0x162b69[_0xbecc('0x1c')](0x2,_0x162b69[_0xbecc('0x14')])[_0xbecc('0x1d')](','));break;case _0xbecc('0x1e'):var _0xb6de21=_0x52e43d['appdata'][_0xbecc('0x19')](',');_0x2c291d[_0xbecc('0x1b')](_0xb6de21[0x0]);_0x2c291d['push'](_0xb6de21[0x1]);_0x2c291d[_0xbecc('0x1b')](_0xb6de21[0x2]);_0x2c291d[_0xbecc('0x1b')](_0xb6de21[0x3]);_0x2c291d[_0xbecc('0x1b')](_0xb6de21[_0xbecc('0x1c')](0x4,_0xb6de21['length'])['join'](','));break;case _0xbecc('0x1f'):var _0x38aa2f=_0x52e43d[_0xbecc('0x18')][_0xbecc('0x19')](',');_0x2c291d[_0xbecc('0x1b')](_0x38aa2f[0x0]);_0x2c291d['push'](_0x38aa2f[0x1]);_0x2c291d[_0xbecc('0x1b')](_0x38aa2f[0x2]);_0x2c291d[_0xbecc('0x1b')](_0x38aa2f[0x3]);_0x2c291d[_0xbecc('0x1b')](_0x38aa2f['slice'](0x4,_0x38aa2f[_0xbecc('0x14')])[_0xbecc('0x1d')](','));break;case _0xbecc('0x11'):_0x2c291d['push'](_0x52e43d[_0xbecc('0x18')]);break;case _0xbecc('0x20'):_0x2c291d[_0xbecc('0x1b')](_0x52e43d[_0xbecc('0x21')]);_0x2c291d[_0xbecc('0x1b')](_0x52e43d[_0xbecc('0x18')]);break;default:_0x2c291d=_[_0xbecc('0xb')](_0x52e43d[_0xbecc('0x18')])?[]:_0x52e43d[_0xbecc('0x18')]['split'](',');}var _0x4fe5d2={'id':util[_0xbecc('0x22')](_0xbecc('0x23'),_0x4432cf,_0x52e43d['id'],_0x52e43d['app']),'condition':require('./interval')[_0xbecc('0x24')](_0x4432cf,getIntervals(_0x4764ff['intervals'],_0x52e43d),_0x4764ff),'consequence':require(_0xbecc('0x25')+_0x52e43d[_0xbecc('0x15')])[_0xbecc('0x26')](_0x4432cf,_0x2c291d,_0x4764ff,_0x5e6169),'p':_0x52e43d[_0xbecc('0x27')]||0x0};logger['info'](_0xbecc('0x28'),_0x4fe5d2['id'],'on\x20interval',getIntervals(_0x4764ff[_0xbecc('0x29')],_0x52e43d)[_0xbecc('0x1d')](_0xbecc('0x2a')));_0x45176c['push'](_0x4fe5d2);}else{logger['error'](_0xbecc('0x2b'),path['join'](__dirname,_0xbecc('0x13'),_0x52e43d[_0xbecc('0x15')]+_0xbecc('0x2c')));}}_0x4764ff['rules'][_0x4432cf]=new RuleEngine(_0x45176c);_0x4764ff['rules'][_0x4432cf]['execute'](_0x5e6169,function(_0x16dbe7){logger[_0xbecc('0x2d')](_0xbecc('0x2e'),JSON[_0xbecc('0x2f')](_0x16dbe7['matchPath']));if(_0x4764ff[_0xbecc('0x30')][_0x4432cf]){_0x4764ff['rules'][_0x4432cf]['emit']('complete');}});return _0x3d95cf({'code':0xc8,'message':_0x5e6169});}else{logger[_0xbecc('0x2d')]('No\x20applications\x20to\x20execute');return _0x3d95cf({'code':0xc8,'message':_0x5e6169});}}catch(_0x50d49c){logger[_0xbecc('0x31')](_0x50d49c[_0xbecc('0x32')]);return _0x5e66f4(_0x275b2e[_0xbecc('0x31')](0x1f4,_0x50d49c));}}return _0x5e66f4(_0xbecc('0x33'));});},'AcceptMessage':function(_0x5592c6){var _0x1b93cf=this;return new Promise(function(_0x40f198,_0x1a4e38){if(_0x5592c6[_0xbecc('0x34')]&&_0x5592c6[_0xbecc('0x34')]['id']){if(_0x4764ff[_0xbecc('0x35')][_0x5592c6['agent']['id']]){_0x4764ff[_0xbecc('0x35')][_0x5592c6[_0xbecc('0x34')]['id']]['busy']=![];_0x4764ff[_0xbecc('0x35')][_0x5592c6[_0xbecc('0x34')]['id']][_0xbecc('0x36')]=undefined;}}if(_0x5592c6[_0xbecc('0x11')]&&_0x5592c6[_0xbecc('0x11')]['id']){try{var _0x39c4e6=getId(_0x5592c6[_0xbecc('0x10')],_0x5592c6[_0xbecc('0x11')]?_0x5592c6[_0xbecc('0x11')]['id']:0x0,_0x5592c6[_0xbecc('0x12')]?_0x5592c6[_0xbecc('0x12')]['id']:0x0);if(_0x4764ff[_0xbecc('0x30')][_0x39c4e6]){_0x4764ff['rules'][_0x39c4e6][_0xbecc('0x37')]('end');if(rpc[_0x5592c6[_0xbecc('0x10')]+_0xbecc('0x38')]){rpc[_0x5592c6[_0xbecc('0x10')]+_0xbecc('0x38')][_0xbecc('0x39')](_0x39c4e6,{'UserId':_0x5592c6[_0xbecc('0x11')]['UserId']})[_0xbecc('0x3a')](function(_0x38d17e){logger['error'](_0xbecc('0x3b'));});}}return _0x40f198({'code':0xc8,'message':_0x5592c6});}catch(_0x4eea02){logger[_0xbecc('0x31')](_0x4eea02[_0xbecc('0x32')]);return _0x1a4e38(_0x1b93cf[_0xbecc('0x31')](0x1f4,_0x4eea02));}}logger[_0xbecc('0x31')](_0xbecc('0x3c'));return _0x1a4e38(_0x1b93cf[_0xbecc('0x31')](0x1f4,_0xbecc('0x3c')));});},'RejectMessage':function(_0x209ada){var _0x575ce6=this;return new Promise(function(_0x389992,_0x1ca1e3){if(_0x209ada[_0xbecc('0x34')]&&_0x209ada[_0xbecc('0x34')]['id']){try{if(_0x4764ff[_0xbecc('0x35')][_0x209ada[_0xbecc('0x34')]['id']]){_0x4764ff[_0xbecc('0x35')][_0x209ada[_0xbecc('0x34')]['id']][_0xbecc('0x3d')]=![];_0x4764ff['agents'][_0x209ada[_0xbecc('0x34')]['id']][_0xbecc('0x36')]=undefined;}return _0x389992({'code':0xc8,'message':_0x209ada});}catch(_0x5ec086){logger[_0xbecc('0x31')](_0x5ec086['stack']);return _0x1ca1e3(_0x575ce6['error'](0x1f4,_0x5ec086));}}logger['error'](_0xbecc('0x3c'));return _0x1ca1e3(_0x575ce6[_0xbecc('0x31')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x30f90e){var _0x4fcacf=this;return new Promise(function(_0x6ed479,_0x7445b1){if(_0x30f90e[_0xbecc('0x10')]&&_0x30f90e[_0xbecc('0x12')]&&_0x30f90e[_0xbecc('0x12')]['id']){try{var _0x5e2309=getId(_0x30f90e['channel'],_0x30f90e['message']?_0x30f90e[_0xbecc('0x11')]['id']:0x0,_0x30f90e['interaction']?_0x30f90e[_0xbecc('0x12')]['id']:0x0);if(_0x4764ff[_0xbecc('0x30')][_0x5e2309]){_0x4764ff[_0xbecc('0x30')][_0x5e2309]['emit']('end');}return _0x6ed479({'code':0xc8,'message':_0x30f90e});}catch(_0x30e328){logger[_0xbecc('0x31')](_0x30e328[_0xbecc('0x32')]);return _0x7445b1(_0x4fcacf[_0xbecc('0x31')](0x1f4,_0x30e328));}}logger['error']('message\x20is\x20empty');return _0x7445b1(_0x4fcacf['error'](0x1f4,_0xbecc('0x3c')));});},'AgentCapacity':function(_0x4e01ee){var _0x4c362d=this;return new Promise(function(_0x281ed,_0xe82006){if(_0x4764ff['agents']['hasOwnProperty'](_0x4e01ee['id'])){for(var _0x1b057a in _0x4e01ee[_0xbecc('0x3e')]){if(_0x4e01ee[_0xbecc('0x3e')]['hasOwnProperty'](_0x1b057a)){if(_0x4764ff[_0xbecc('0x35')][_0x4e01ee['id']][_0xbecc('0x3f')](_0x1b057a+_0xbecc('0x40'))){_0x4764ff[_0xbecc('0x35')][_0x4e01ee['id']][_0x1b057a+_0xbecc('0x40')]=parseInt(_0x4e01ee['capacity'][_0x1b057a],0xa);}}}_0x4764ff[_0xbecc('0x35')][_0x4e01ee['id']]['updateRealtime']();return _0x281ed({'code':0xc8,'message':_0x4764ff['agents'][_0x4e01ee['id']]});}else{return _0xe82006(_0x4c362d[_0xbecc('0x31')](0x1f4,_0xbecc('0x41')));}});},'Agents':function(_0x4ba5fa){return new Promise(function(_0x2f785,_0x1df1f7){var _0x17ca84=_[_0xbecc('0x42')](_0x4764ff[_0xbecc('0x35')]);_0x2f785({'count':_0x17ca84[_0xbecc('0x14')],'rows':_0x17ca84});});},'ChatQueues':function(_0x4cd7b1){return new Promise(function(_0x33c33b,_0x50d9b7){var _0x497c7d=[];for(var _0x5902a6 in _0x4764ff[_0xbecc('0x43')]){if(_0x4764ff[_0xbecc('0x43')][_0xbecc('0x3f')](_0x5902a6)){var _0x4264a1=_0x4764ff['chatQueues'][_0x5902a6];var _0x199db7={'id':_0x4264a1['id'],'available':_0x4264a1[_0xbecc('0x44')],'loggedIn':_0x4264a1['loggedIn'],'name':_0x4264a1['name'],'paused':_0x4264a1['paused'],'waiting':_0x4264a1[_0xbecc('0x45')]};_0x497c7d[_0xbecc('0x1b')](_0x199db7);}}_0x33c33b({'count':_0x497c7d[_0xbecc('0x14')],'rows':_0x497c7d});});},'MailQueues':function(_0x504e58){return new Promise(function(_0x35ce8d,_0x3b1ade){var _0x3ff5e6=[];for(var _0x593b3e in _0x4764ff['mailQueues']){if(_0x4764ff[_0xbecc('0x46')][_0xbecc('0x3f')](_0x593b3e)){var _0x55cb04=_0x4764ff[_0xbecc('0x46')][_0x593b3e];var _0x366203={'id':_0x55cb04['id'],'available':_0x55cb04[_0xbecc('0x44')],'loggedIn':_0x55cb04['loggedIn'],'name':_0x55cb04['name'],'paused':_0x55cb04[_0xbecc('0x47')],'waiting':_0x55cb04['waiting']};_0x3ff5e6[_0xbecc('0x1b')](_0x366203);}}_0x35ce8d({'count':_0x3ff5e6['length'],'rows':_0x3ff5e6});});},'OpenchannelQueues':function(_0x1c79e8){return new Promise(function(_0x438b4b,_0x244bbd){var _0x5d5d8e=[];for(var _0xe9d09c in _0x4764ff['openchannelQueues']){if(_0x4764ff['openchannelQueues']['hasOwnProperty'](_0xe9d09c)){var _0x1dbd64=_0x4764ff['openchannelQueues'][_0xe9d09c];var _0x51b288={'id':_0x1dbd64['id'],'available':_0x1dbd64[_0xbecc('0x44')],'loggedIn':_0x1dbd64['loggedIn'],'name':_0x1dbd64[_0xbecc('0x48')],'paused':_0x1dbd64[_0xbecc('0x47')],'waiting':_0x1dbd64['waiting']};_0x5d5d8e[_0xbecc('0x1b')](_0x51b288);}}_0x438b4b({'count':_0x5d5d8e[_0xbecc('0x14')],'rows':_0x5d5d8e});});},'SmsQueues':function(_0x44bd05){return new Promise(function(_0x3d2f42,_0x2cb0d6){var _0x79a19e=[];for(var _0x2897c0 in _0x4764ff[_0xbecc('0x49')]){if(_0x4764ff[_0xbecc('0x49')][_0xbecc('0x3f')](_0x2897c0)){var _0x374e5d=_0x4764ff['smsQueues'][_0x2897c0];var _0x4a9f31={'id':_0x374e5d['id'],'available':_0x374e5d[_0xbecc('0x44')],'loggedIn':_0x374e5d[_0xbecc('0x4a')],'name':_0x374e5d[_0xbecc('0x48')],'paused':_0x374e5d[_0xbecc('0x47')],'waiting':_0x374e5d['waiting']};_0x79a19e['push'](_0x4a9f31);}}_0x3d2f42({'count':_0x79a19e[_0xbecc('0x14')],'rows':_0x79a19e});});},'FaxQueues':function(_0x4f97af){return new Promise(function(_0x5b315d,_0x35ce70){var _0x2f028f=[];for(var _0x46cd1b in _0x4764ff[_0xbecc('0x4b')]){if(_0x4764ff['faxQueues'][_0xbecc('0x3f')](_0x46cd1b)){var _0x4c9d4d=_0x4764ff[_0xbecc('0x4b')][_0x46cd1b];var _0x33f973={'id':_0x4c9d4d['id'],'available':_0x4c9d4d[_0xbecc('0x44')],'loggedIn':_0x4c9d4d[_0xbecc('0x4a')],'name':_0x4c9d4d['name'],'paused':_0x4c9d4d[_0xbecc('0x47')],'waiting':_0x4c9d4d[_0xbecc('0x45')]};_0x2f028f['push'](_0x33f973);}}_0x5b315d({'count':_0x2f028f[_0xbecc('0x14')],'rows':_0x2f028f});});},'WhatsappQueues':function(_0x1e2d72){return new Promise(function(_0x29a7d9,_0x59523e){var _0x454fe8=[];for(var _0x1270b0 in _0x4764ff[_0xbecc('0x4c')]){if(_0x4764ff[_0xbecc('0x4c')][_0xbecc('0x3f')](_0x1270b0)){var _0x308099=_0x4764ff[_0xbecc('0x4c')][_0x1270b0];var _0x281b83={'id':_0x308099['id'],'available':_0x308099[_0xbecc('0x44')],'loggedIn':_0x308099[_0xbecc('0x4a')],'name':_0x308099[_0xbecc('0x48')],'paused':_0x308099[_0xbecc('0x47')],'waiting':_0x308099[_0xbecc('0x45')]};_0x454fe8[_0xbecc('0x1b')](_0x281b83);}}_0x29a7d9({'count':_0x454fe8['length'],'rows':_0x454fe8});});},'ChatQueuesWaitingInteractions':function(_0x3c98d3){return new Promise(function(_0xf0cac1,_0x5e83de){var _0x365d46=_[_0xbecc('0x42')](_0x4764ff[_0xbecc('0x4d')]);_0xf0cac1({'count':_0x365d46[_0xbecc('0x14')],'rows':_0x365d46});});},'MailQueuesWaitingInteractions':function(_0x248d64){return new Promise(function(_0x1ce16e,_0x5a80ea){var _0x7471c6=_[_0xbecc('0x42')](_0x4764ff[_0xbecc('0x4e')]);_0x1ce16e({'count':_0x7471c6[_0xbecc('0x14')],'rows':_0x7471c6});});},'OpenchannelQueuesWaitingInteractions':function(_0x107d0){return new Promise(function(_0x34a4c4,_0x5ab69f){var _0x55fca6=_[_0xbecc('0x42')](_0x4764ff['openchannelQueuesWaitingInteractions']);_0x34a4c4({'count':_0x55fca6['length'],'rows':_0x55fca6});});},'SmsQueuesWaitingInteractions':function(_0x56219){return new Promise(function(_0x4602a9,_0x43686b){var _0x43afc4=_[_0xbecc('0x42')](_0x4764ff[_0xbecc('0x4f')]);_0x4602a9({'count':_0x43afc4[_0xbecc('0x14')],'rows':_0x43afc4});});},'FaxQueuesWaitingInteractions':function(_0x3c565d){return new Promise(function(_0x38444f,_0x56a4ec){var _0x49a3e8=_[_0xbecc('0x42')](_0x4764ff['faxQueuesWaitingInteractions']);_0x38444f({'count':_0x49a3e8[_0xbecc('0x14')],'rows':_0x49a3e8});});},'WhatsappQueuesWaitingInteractions':function(_0x14a5bb){return new Promise(function(_0x5e08da,_0xfd900f){var _0x3d6f3c=_[_0xbecc('0x42')](_0x4764ff[_0xbecc('0x50')]);_0x5e08da({'count':_0x3d6f3c[_0xbecc('0x14')],'rows':_0x3d6f3c});});}};var _0x2f8128=jayson[_0xbecc('0x51')](_0x60cd17)[_0xbecc('0x52')]();_0x2f8128['on'](_0xbecc('0x31'),function(_0x4562cb){logger[_0xbecc('0x31')](JSON[_0xbecc('0x2f')](_0x4562cb));return _0x3a0e41(_0x4562cb);});_0x2f8128[_0xbecc('0x53')](0x232c,_0xbecc('0x54'),function(){console[_0xbecc('0x55')](_0xbecc('0x56'),0x232c);return _0x210a3f(_0xbecc('0x57')+0x232c);});});};
\ No newline at end of file
index 6233279..ce682a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f11=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','format','iftime\x20%s','indexOf','true','catch','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','then','error','message','result'];(function(_0x51f2c8,_0x528781){var _0x250265=function(_0x278953){while(--_0x278953){_0x51f2c8['push'](_0x51f2c8['shift']());}};_0x250265(++_0x528781);}(_0x0f11,0x1c5));var _0x10f1=function(_0x312e87,_0x3fc455){_0x312e87=_0x312e87-0x0;var _0x4de723=_0x0f11[_0x312e87];return _0x4de723;};'use strict';var util=require(_0x10f1('0x0'));var BPromise=require(_0x10f1('0x1'));var jayson=require(_0x10f1('0x2'));var _=require(_0x10f1('0x3'));var logger=require(_0x10f1('0x4'))(_0x10f1('0x5'));var client=jayson[_0x10f1('0x6')][_0x10f1('0x7')]({'port':0x232a});function request(_0x316339,_0xd85ad2){return new BPromise(function(_0x1292a3,_0x260963){return client['request'](_0x316339,_0xd85ad2)[_0x10f1('0x8')](function(_0x54af49){if(_0x54af49[_0x10f1('0x9')]){return _0x260963(_0x54af49['error'][_0x10f1('0xa')]);}else{return _0x1292a3(_0x54af49[_0x10f1('0xb')]);}})['catch'](function(_0x52b309){return _0x260963(_0x52b309);});});}exports[_0x10f1('0xc')]=function(_0x300249,_0x41c141,_0x19e1a0){return function(_0x5b25eb){if(_0x19e1a0[_0x10f1('0xd')]&&!_0x19e1a0['rules'][_0x300249]){logger[_0x10f1('0xe')](_0x10f1('0xf'),_0x300249);return _0x5b25eb[_0x10f1('0x10')]();}var _0x332349=[];for(var _0x5ba7f9=0x0;_0x5ba7f9<_0x41c141[_0x10f1('0x11')];_0x5ba7f9+=0x1){_0x332349['push'](request('Command',{'command':util[_0x10f1('0x12')](_0x10f1('0x13'),_0x41c141[_0x5ba7f9])})[_0x10f1('0x8')](function(_0x56049b){return _0x56049b&&_0x56049b[_0x10f1('0xa')]&&_0x56049b[_0x10f1('0xa')][_0x10f1('0x14')](_0x10f1('0x15'))>=0x0?!![]:![];})[_0x10f1('0x16')](function(_0x2ff0bb){logger[_0x10f1('0x9')]('[%s][INTERVAL]\x20%s',_0x300249,_0x41c141[_0x5ba7f9]);}));}BPromise[_0x10f1('0x17')](_0x332349)[_0x10f1('0x8')](function(_0x22f8f6){var _0x589f94=_[_0x10f1('0x18')](_0x22f8f6);logger['info'](_0x10f1('0x19'),_0x300249,_0x41c141['join'](_0x10f1('0x1a')),_0x589f94);_0x5b25eb[_0x10f1('0x1b')](_0x589f94);})[_0x10f1('0x16')](function(_0x27bb19){console[_0x10f1('0x1c')](_0x27bb19);logger[_0x10f1('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x300249,_0x41c141[_0x10f1('0x1d')](_0x10f1('0x1a')),_0x27bb19[_0x10f1('0x1e')]);_0x5b25eb[_0x10f1('0x10')]();});};};
\ No newline at end of file
+var _0x5688=['stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','join','when','log','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x39a1a6,_0x27f2bc){var _0x261a88=function(_0x542778){while(--_0x542778){_0x39a1a6['push'](_0x39a1a6['shift']());}};_0x261a88(++_0x27f2bc);}(_0x5688,0xb5));var _0x8568=function(_0x203d64,_0x1ec79c){_0x203d64=_0x203d64-0x0;var _0x462ab3=_0x5688[_0x203d64];return _0x462ab3;};'use strict';var util=require(_0x8568('0x0'));var BPromise=require(_0x8568('0x1'));var jayson=require(_0x8568('0x2'));var _=require(_0x8568('0x3'));var logger=require(_0x8568('0x4'))(_0x8568('0x5'));var client=jayson[_0x8568('0x6')]['http']({'port':0x232a});function request(_0x37023d,_0x20b784){return new BPromise(function(_0x47f8a7,_0x4331fd){return client['request'](_0x37023d,_0x20b784)[_0x8568('0x7')](function(_0x378241){if(_0x378241[_0x8568('0x8')]){return _0x4331fd(_0x378241[_0x8568('0x8')][_0x8568('0x9')]);}else{return _0x47f8a7(_0x378241['result']);}})[_0x8568('0xa')](function(_0x8fc868){return _0x4331fd(_0x8fc868);});});}exports[_0x8568('0xb')]=function(_0x41b7a4,_0x400bf4,_0x2f3cdb){return function(_0x2d0e9f){if(_0x2f3cdb['rules']&&!_0x2f3cdb[_0x8568('0xc')][_0x41b7a4]){logger[_0x8568('0xd')](_0x8568('0xe'),_0x41b7a4);return _0x2d0e9f[_0x8568('0xf')]();}var _0x2ad31d=[];for(var _0x49ec07=0x0;_0x49ec07<_0x400bf4[_0x8568('0x10')];_0x49ec07+=0x1){_0x2ad31d[_0x8568('0x11')](request(_0x8568('0x12'),{'command':util[_0x8568('0x13')](_0x8568('0x14'),_0x400bf4[_0x49ec07])})[_0x8568('0x7')](function(_0x501d2e){return _0x501d2e&&_0x501d2e[_0x8568('0x9')]&&_0x501d2e['message'][_0x8568('0x15')](_0x8568('0x16'))>=0x0?!![]:![];})['catch'](function(_0xbf26be){logger[_0x8568('0x8')](_0x8568('0x17'),_0x41b7a4,_0x400bf4[_0x49ec07]);}));}BPromise[_0x8568('0x18')](_0x2ad31d)[_0x8568('0x7')](function(_0x4e0385){var _0x17b229=_['some'](_0x4e0385);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x41b7a4,_0x400bf4[_0x8568('0x19')]('\x20|\x20'),_0x17b229);_0x2d0e9f[_0x8568('0x1a')](_0x17b229);})[_0x8568('0xa')](function(_0x4f963a){console[_0x8568('0x1b')](_0x4f963a);logger[_0x8568('0x8')](_0x8568('0x1c'),_0x41b7a4,_0x400bf4[_0x8568('0x19')]('\x20|\x20'),_0x4f963a[_0x8568('0x1d')]);_0x2d0e9f['stop']();});};};
\ No newline at end of file
index dfe15e5..019ee4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aea=['[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','debug','agentringnoanswerAt','timeout','reason','holdtime','ringtime','[%s][agents][agentringnoanswer]','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format'];(function(_0x20c089,_0x2ad4a8){var _0x163cbe=function(_0xe0fbf0){while(--_0xe0fbf0){_0x20c089['push'](_0x20c089['shift']());}};_0x163cbe(++_0x2ad4a8);}(_0x9aea,0xdd));var _0xa9ae=function(_0x557e16,_0x50c97c){_0x557e16=_0x557e16-0x0;var _0x10e863=_0x9aea[_0x557e16];return _0x10e863;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var utils=require(_0xa9ae('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e1d51,_0x2b5e0c){utils[_0xa9ae('0x2')](util['format'](_0xa9ae('0x3'),_0x5e1d51[_0xa9ae('0x4')],_0x5e1d51[_0xa9ae('0x5')],_0x5e1d51[_0xa9ae('0x6')],_0x5e1d51[_0xa9ae('0x7')],_0x5e1d51['interface'],_0x5e1d51[_0xa9ae('0x8')],_0x5e1d51[_0xa9ae('0x9')],_0x5e1d51[_0xa9ae('0xa')]));if(_0x5e1d51['queue']){utils[_0xa9ae('0xb')](_0x5e1d51[_0xa9ae('0x6')])[_0xa9ae('0xc')](function(_0x44cf1b){if(_0x44cf1b){_0x5e1d51[_0xa9ae('0xd')]=_0x44cf1b[_0xa9ae('0xd')];_0x5e1d51[_0xa9ae('0xe')]=_0x5e1d51[_0xa9ae('0xf')]?_0x44cf1b[_0xa9ae('0x10')]:![];_0x5e1d51['acwtime']=_0x5e1d51[_0xa9ae('0xe')]?_0x44cf1b['acwTimeout']:0x0;}utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);});}else{utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);}if(_0x2b5e0c){delete transfers[_0x5e1d51[_0xa9ae('0x4')]];}else{delete agents[_0x5e1d51[_0xa9ae('0x13')]];}}exports[_0xa9ae('0x14')]=function(_0x2b511a){try{utils['debug'](util[_0xa9ae('0x15')](_0xa9ae('0x16'),_0x2b511a[_0xa9ae('0x4')]),_0x2b511a);agents[_0x2b511a[_0xa9ae('0x13')]]=_0x2b511a;agents[_0x2b511a['destuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x19');agents[_0x2b511a[_0xa9ae('0x13')]]['connectedlinenum']=null;agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0x1a')]=null;utils[_0xa9ae('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2b511a[_0xa9ae('0x4')],agents[_0x2b511a['destuniqueid']]['membername'],_0x2b511a[_0xa9ae('0x13')]));}catch(_0x3b8245){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentcalled]',_0x2b511a[_0xa9ae('0x4')]),_0x3b8245);}};exports[_0xa9ae('0x1c')]=function(_0x39f133){try{if(!_[_0xa9ae('0x1d')](agents[_0x39f133[_0xa9ae('0x13')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentringnoanswer]',_0x39f133[_0xa9ae('0x4')]),_0x39f133);utils['info'](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x39f133['uniqueid'],agents[_0x39f133[_0xa9ae('0x13')]]['membername'],_0x39f133[_0xa9ae('0x13')]));agents[_0x39f133['destuniqueid']][_0xa9ae('0x1c')]=!![];agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x20');agents[_0x39f133['destuniqueid']][_0xa9ae('0x21')]=_0xa9ae('0x20');agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x22')]=_0x39f133[_0xa9ae('0x23')]?parseInt(_0x39f133[_0xa9ae('0x23')])/0x3e8:0x0;agents[_0x39f133[_0xa9ae('0x13')]]['talktime']=0x0;unanswered['push'](_0x39f133[_0xa9ae('0x13')]);}}catch(_0x3c324e){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x24'),_0x39f133['uniqueid']),_0x3c324e);}};exports['queuecallerabandon']=function(_0x1892b5){try{_[_0xa9ae('0x25')](agents,function(_0x372ec7,_0x3a48b7){if(_0x372ec7[_0xa9ae('0x4')]==_0x1892b5[_0xa9ae('0x4')]&&!_['includes'](unanswered,_0x372ec7['destuniqueid'])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5[_0xa9ae('0x4')]),_0x1892b5);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x27'),_0x1892b5[_0xa9ae('0x4')],_0x372ec7['membername'],_0x372ec7[_0xa9ae('0x13')]));_0x372ec7['agentringnoanswer']=!![];_0x372ec7[_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();_0x372ec7[_0xa9ae('0xa')]='abandoned';_0x372ec7[_0xa9ae('0x21')]=_0xa9ae('0x28');_0x372ec7[_0xa9ae('0x22')]=_0x1892b5[_0xa9ae('0x22')];_0x372ec7[_0xa9ae('0x29')]=0x0;writeDB(_0x372ec7);}});}catch(_0x4cb3ae){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5['uniqueid']),_0x4cb3ae);}};exports['agentconnect']=function(_0x2155c8){try{if(agents[_0x2155c8[_0xa9ae('0x13')]]){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x2155c8);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x2a'),_0x2155c8[_0xa9ae('0x4')],agents[_0x2155c8['destuniqueid']][_0xa9ae('0x7')],_0x2155c8['destuniqueid']));agents[_0x2155c8[_0xa9ae('0x13')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();agents[_0x2155c8['destuniqueid']][_0xa9ae('0x9')]=_0x2155c8[_0xa9ae('0x9')];agents[_0x2155c8[_0xa9ae('0x13')]]['connectedlinename']=_0x2155c8[_0xa9ae('0x1a')];agents[_0x2155c8[_0xa9ae('0x13')]]['holdtime']=_0x2155c8[_0xa9ae('0x23')];agents[_0x2155c8['destuniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x2c');_['forIn'](agents,function(_0x37da9b,_0x15ce12){if(_0x37da9b[_0xa9ae('0x13')]!=_0x2155c8[_0xa9ae('0x13')]&&_0x37da9b[_0xa9ae('0x4')]==_0x2155c8[_0xa9ae('0x4')]){_0x37da9b['talktime']=0x0;_0x37da9b[_0xa9ae('0x22')]=_0x2155c8[_0xa9ae('0x23')];_0x37da9b['agentringnoanswer']=!![];_0x37da9b['agentringnoanswerAt']=utils[_0xa9ae('0x18')]();_0x37da9b[_0xa9ae('0xa')]=_0xa9ae('0x2d');_0x37da9b[_0xa9ae('0x21')]='answered_elsewhere';_0x37da9b[_0xa9ae('0x2e')]=_0x2155c8[_0xa9ae('0x13')];_0x37da9b[_0xa9ae('0x2f')]=_0x2155c8[_0xa9ae('0x7')];writeDB(_0x37da9b);}});}}catch(_0x23c91d){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x23c91d);}};exports[_0xa9ae('0xf')]=function(_0x566cb0){try{if(!_[_0xa9ae('0x1d')](agents[_0x566cb0['destuniqueid']])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x30'),_0x566cb0[_0xa9ae('0x4')]),_0x566cb0);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x31'),_0x566cb0['uniqueid'],agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x7')],_0x566cb0['destuniqueid']));agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xf')]=!![];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x566cb0[_0xa9ae('0x13')]]['talktime']=utils[_0xa9ae('0x33')](agents[_0x566cb0['destuniqueid']][_0xa9ae('0x32')],agents[_0x566cb0[_0xa9ae('0x13')]]['agentconnectAt']);agents[_0x566cb0['destuniqueid']][_0xa9ae('0x21')]=_0x566cb0[_0xa9ae('0x21')];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x34');writeDB(agents[_0x566cb0[_0xa9ae('0x13')]]);}}catch(_0x2961e4){utils[_0xa9ae('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x566cb0[_0xa9ae('0x4')]),_0x2961e4);}};exports[_0xa9ae('0x35')]=function(_0x4efe55){try{if(!_[_0xa9ae('0x1d')](agents[_0x4efe55[_0xa9ae('0x36')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x4efe55);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4efe55[_0xa9ae('0x4')],agents[_0x4efe55[_0xa9ae('0x36')]]['membername'],agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid']));agents[_0x4efe55['transfereruniqueid']]['transfer']=!![];agents[_0x4efe55[_0xa9ae('0x36')]][_0xa9ae('0x38')]='blind';agents[_0x4efe55['transfereruniqueid']]['transferexten']=_0x4efe55[_0xa9ae('0x39')];agents[_0x4efe55['transfereruniqueid']][_0xa9ae('0x3a')]=agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid'];}}catch(_0x1be415){utils['error'](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x1be415);}};exports[_0xa9ae('0x3b')]=function(_0x371760){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x371760);if(_0x371760[_0xa9ae('0x3d')]==_0x371760[_0xa9ae('0x3e')]){if(!_[_0xa9ae('0x1d')](agents[_0x371760['secondtransfereruniqueid']])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x3f'),_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x40')]]['membername']));agents[_0x371760['secondtransfereruniqueid']][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x40')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x40')]]['transferexten']=_0x371760[_0xa9ae('0x42')];agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x3a')]=_0x371760['origtransfereruniqueid'];}if(_0x371760[_0xa9ae('0x43')]&&agents[_0x371760['transfereeuniqueid']]){agents[_0x371760[_0xa9ae('0x43')]]['agententerreason']=0x1;transfers[_0x371760[_0xa9ae('0x43')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x43')]]);transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x40')]]['calleridnum'];transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x45')]=agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x45')];transfers[_0x371760['transfereeuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x22')]=0x0;transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x46')]=0x2;}}else if(_0x371760[_0xa9ae('0x40')]==_0x371760['secondtransfererlinkedid']){if(!_[_0xa9ae('0x1d')](agents[_0x371760[_0xa9ae('0x3d')]])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x3d')]]['membername']));agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x3d')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x47')]=_0x371760['secondtransfererexten'];agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x3a')]=_0x371760[_0xa9ae('0x40')];}if(_0x371760[_0xa9ae('0x48')]&&agents[_0x371760['transfertargetuniqueid']]){agents[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x46')]=0x1;transfers[_0x371760[_0xa9ae('0x48')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x48')]]);transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x8')];transfers[_0x371760[_0xa9ae('0x48')]]['calleridname']=agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x45')];transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x17')]=utils['now']();transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x371760[_0xa9ae('0x48')]]['agententerreason']=0x2;}}}catch(_0x14a720){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x14a720);}};exports[_0xa9ae('0x49')]=function(_0x1bf8e3){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3['uniqueid']),_0x1bf8e3);if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3['uniqueid']][_0xa9ae('0x21')]===_0xa9ae('0x20')){if(_0x1bf8e3[_0xa9ae('0x4b')]==='21'){agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]='rejected';agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x4c');}utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']]['lastevent']));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);var _0x2f4a73=unanswered[_0xa9ae('0x4d')](_0x1bf8e3[_0xa9ae('0x4')]);if(_0x2f4a73>-0x1){unanswered[_0xa9ae('0x4e')](_0x2f4a73,0x1);}}if(transfers[_0x1bf8e3['uniqueid']]){transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0x2b')]);transfers[_0x1bf8e3['uniqueid']]['reason']='agent';transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['membername'],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['reason'],transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]));writeDB(transfers[_0x1bf8e3[_0xa9ae('0x4')]],!![]);}if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]){agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](agents[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]);agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]=agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x41')]?_0xa9ae('0x41'):_0xa9ae('0x4f');agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x50'),_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);}}catch(_0x1f6465){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3[_0xa9ae('0x4')]),_0x1f6465);}};
\ No newline at end of file
+var _0x282b=['talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','connectedlinename','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','agentconnectAt','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','clone','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','util','./utils','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','type','agentacw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','lastevent','called','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','timeout','reason','holdtime','ringtime'];(function(_0x7507d6,_0x3d0519){var _0x200bd7=function(_0x5695df){while(--_0x5695df){_0x7507d6['push'](_0x7507d6['shift']());}};_0x200bd7(++_0x3d0519);}(_0x282b,0xec));var _0xb282=function(_0x3f08ce,_0x208763){_0x3f08ce=_0x3f08ce-0x0;var _0xda4a6d=_0x282b[_0x3f08ce];return _0xda4a6d;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var utils=require(_0xb282('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2251b5,_0x527989){utils['info'](util['format'](_0xb282('0x3'),_0x2251b5['uniqueid'],_0x2251b5[_0xb282('0x4')],_0x2251b5[_0xb282('0x5')],_0x2251b5[_0xb282('0x6')],_0x2251b5[_0xb282('0x7')],_0x2251b5[_0xb282('0x8')],_0x2251b5[_0xb282('0x9')],_0x2251b5['lastevent']));if(_0x2251b5['queue']){utils[_0xb282('0xa')](_0x2251b5[_0xb282('0x5')])['then'](function(_0x2928cf){if(_0x2928cf){_0x2251b5[_0xb282('0xb')]=_0x2928cf[_0xb282('0xb')];_0x2251b5[_0xb282('0xc')]=_0x2251b5['agentcomplete']?_0x2928cf['acw']:![];_0x2251b5[_0xb282('0xd')]=_0x2251b5[_0xb282('0xc')]?_0x2928cf[_0xb282('0xe')]:0x0;}utils[_0xb282('0xf')](_0xb282('0x10'),_0x2251b5);});}else{utils['request']('CreateVoiceAgentReport',_0x2251b5);}if(_0x527989){delete transfers[_0x2251b5[_0xb282('0x11')]];}else{delete agents[_0x2251b5[_0xb282('0x12')]];}}exports[_0xb282('0x13')]=function(_0x9e9072){try{utils[_0xb282('0x14')](util['format'](_0xb282('0x15'),_0x9e9072['uniqueid']),_0x9e9072);agents[_0x9e9072[_0xb282('0x12')]]=_0x9e9072;agents[_0x9e9072[_0xb282('0x12')]]['agentcalledAt']=utils['now']();agents[_0x9e9072['destuniqueid']][_0xb282('0x16')]=_0xb282('0x17');agents[_0x9e9072[_0xb282('0x12')]][_0xb282('0x9')]=null;agents[_0x9e9072[_0xb282('0x12')]]['connectedlinename']=null;utils[_0xb282('0x18')](util[_0xb282('0x19')](_0xb282('0x1a'),_0x9e9072[_0xb282('0x11')],agents[_0x9e9072[_0xb282('0x12')]]['membername'],_0x9e9072['destuniqueid']));}catch(_0xcea320){utils[_0xb282('0x1b')](util['format'](_0xb282('0x15'),_0x9e9072[_0xb282('0x11')]),_0xcea320);}};exports[_0xb282('0x1c')]=function(_0x438dbe){try{if(!_[_0xb282('0x1d')](agents[_0x438dbe['destuniqueid']])){utils[_0xb282('0x14')](util[_0xb282('0x19')](_0xb282('0x1e'),_0x438dbe['uniqueid']),_0x438dbe);utils[_0xb282('0x18')](util[_0xb282('0x19')](_0xb282('0x1f'),_0x438dbe[_0xb282('0x11')],agents[_0x438dbe[_0xb282('0x12')]]['membername'],_0x438dbe['destuniqueid']));agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x1c')]=!![];agents[_0x438dbe['destuniqueid']]['agentringnoanswerAt']=utils[_0xb282('0x20')]();agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x16')]=_0xb282('0x21');agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x22')]='timeout';agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x23')]=_0x438dbe['ringtime']?parseInt(_0x438dbe[_0xb282('0x24')])/0x3e8:0x0;agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x25')]=0x0;unanswered[_0xb282('0x26')](_0x438dbe['destuniqueid']);}}catch(_0x1520b1){utils[_0xb282('0x1b')](util[_0xb282('0x19')](_0xb282('0x1e'),_0x438dbe[_0xb282('0x11')]),_0x1520b1);}};exports[_0xb282('0x27')]=function(_0x22f657){try{_['forIn'](agents,function(_0x1b15b5,_0x1e2861){if(_0x1b15b5[_0xb282('0x11')]==_0x22f657[_0xb282('0x11')]&&!_[_0xb282('0x28')](unanswered,_0x1b15b5['destuniqueid'])){utils[_0xb282('0x14')](util['format'](_0xb282('0x29'),_0x22f657[_0xb282('0x11')]),_0x22f657);utils[_0xb282('0x18')](util['format'](_0xb282('0x2a'),_0x22f657['uniqueid'],_0x1b15b5[_0xb282('0x6')],_0x1b15b5[_0xb282('0x12')]));_0x1b15b5[_0xb282('0x1c')]=!![];_0x1b15b5[_0xb282('0x2b')]=utils[_0xb282('0x20')]();_0x1b15b5[_0xb282('0x16')]='abandoned';_0x1b15b5[_0xb282('0x22')]=_0xb282('0x2c');_0x1b15b5['holdtime']=_0x22f657['holdtime'];_0x1b15b5[_0xb282('0x25')]=0x0;writeDB(_0x1b15b5);}});}catch(_0x271643){utils[_0xb282('0x1b')](util['format']('[%s][agents][queuecallerabandon]',_0x22f657['uniqueid']),_0x271643);}};exports[_0xb282('0x2d')]=function(_0x2a7362){try{if(agents[_0x2a7362[_0xb282('0x12')]]){utils[_0xb282('0x14')](util[_0xb282('0x19')](_0xb282('0x2e'),_0x2a7362[_0xb282('0x11')]),_0x2a7362);utils['info'](util[_0xb282('0x19')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a7362[_0xb282('0x11')],agents[_0x2a7362[_0xb282('0x12')]][_0xb282('0x6')],_0x2a7362['destuniqueid']));agents[_0x2a7362[_0xb282('0x12')]]['agentconnectAt']=utils[_0xb282('0x20')]();agents[_0x2a7362[_0xb282('0x12')]][_0xb282('0x9')]=_0x2a7362[_0xb282('0x9')];agents[_0x2a7362['destuniqueid']]['connectedlinename']=_0x2a7362[_0xb282('0x2f')];agents[_0x2a7362[_0xb282('0x12')]][_0xb282('0x23')]=_0x2a7362[_0xb282('0x24')];agents[_0x2a7362['destuniqueid']][_0xb282('0x16')]='connect';_[_0xb282('0x30')](agents,function(_0x1a1b50,_0x482ff9){if(_0x1a1b50[_0xb282('0x12')]!=_0x2a7362[_0xb282('0x12')]&&_0x1a1b50[_0xb282('0x11')]==_0x2a7362[_0xb282('0x11')]){_0x1a1b50[_0xb282('0x25')]=0x0;_0x1a1b50[_0xb282('0x23')]=_0x2a7362[_0xb282('0x24')];_0x1a1b50[_0xb282('0x1c')]=!![];_0x1a1b50[_0xb282('0x2b')]=utils[_0xb282('0x20')]();_0x1a1b50[_0xb282('0x16')]=_0xb282('0x31');_0x1a1b50[_0xb282('0x22')]=_0xb282('0x31');_0x1a1b50[_0xb282('0x32')]=_0x2a7362[_0xb282('0x12')];_0x1a1b50[_0xb282('0x33')]=_0x2a7362[_0xb282('0x6')];writeDB(_0x1a1b50);}});}}catch(_0x573da7){utils[_0xb282('0x1b')](util['format'](_0xb282('0x2e'),_0x2a7362[_0xb282('0x11')]),_0x573da7);}};exports[_0xb282('0x34')]=function(_0x2f2ce8){try{if(!_[_0xb282('0x1d')](agents[_0x2f2ce8[_0xb282('0x12')]])){utils['debug'](util['format'](_0xb282('0x35'),_0x2f2ce8['uniqueid']),_0x2f2ce8);utils[_0xb282('0x18')](util[_0xb282('0x19')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2f2ce8[_0xb282('0x11')],agents[_0x2f2ce8[_0xb282('0x12')]][_0xb282('0x6')],_0x2f2ce8['destuniqueid']));agents[_0x2f2ce8['destuniqueid']][_0xb282('0x34')]=!![];agents[_0x2f2ce8['destuniqueid']][_0xb282('0x36')]=utils[_0xb282('0x20')]();agents[_0x2f2ce8[_0xb282('0x12')]][_0xb282('0x25')]=utils[_0xb282('0x37')](agents[_0x2f2ce8[_0xb282('0x12')]]['agentcompleteAt'],agents[_0x2f2ce8[_0xb282('0x12')]][_0xb282('0x38')]);agents[_0x2f2ce8[_0xb282('0x12')]]['reason']=_0x2f2ce8[_0xb282('0x22')];agents[_0x2f2ce8['destuniqueid']][_0xb282('0x16')]='complete';writeDB(agents[_0x2f2ce8[_0xb282('0x12')]]);}}catch(_0x4ac56f){utils['error'](util['format'](_0xb282('0x35'),_0x2f2ce8[_0xb282('0x11')]),_0x4ac56f);}};exports[_0xb282('0x39')]=function(_0x7a5aa4){try{if(!_['isNil'](agents[_0x7a5aa4['transfereruniqueid']])){utils['debug'](util[_0xb282('0x19')](_0xb282('0x3a'),_0x7a5aa4[_0xb282('0x11')]),_0x7a5aa4);utils[_0xb282('0x18')](util['format'](_0xb282('0x3b'),_0x7a5aa4[_0xb282('0x11')],agents[_0x7a5aa4['transfereruniqueid']][_0xb282('0x6')],agents[_0x7a5aa4[_0xb282('0x3c')]][_0xb282('0x11')]));agents[_0x7a5aa4[_0xb282('0x3c')]][_0xb282('0x3d')]=!![];agents[_0x7a5aa4['transfereruniqueid']][_0xb282('0x3e')]=_0xb282('0x3f');agents[_0x7a5aa4[_0xb282('0x3c')]][_0xb282('0x40')]=_0x7a5aa4[_0xb282('0x41')];agents[_0x7a5aa4[_0xb282('0x3c')]]['transferuniqueid']=agents[_0x7a5aa4[_0xb282('0x3c')]]['uniqueid'];}}catch(_0x4554f1){utils[_0xb282('0x1b')](util['format'](_0xb282('0x3a'),_0x7a5aa4[_0xb282('0x11')]),_0x4554f1);}};exports[_0xb282('0x42')]=function(_0x49fc44){try{utils['debug'](util[_0xb282('0x19')](_0xb282('0x43'),_0x49fc44[_0xb282('0x44')]),_0x49fc44);if(_0x49fc44['origtransfereruniqueid']==_0x49fc44[_0xb282('0x45')]){if(!_['isNil'](agents[_0x49fc44[_0xb282('0x46')]])){utils[_0xb282('0x18')](util['format'](_0xb282('0x47'),_0x49fc44['origtransfereruniqueid'],agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x6')]));agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x3d')]=!![];agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x3e')]='ATTENDED';agents[_0x49fc44[_0xb282('0x46')]]['transferexten']=_0x49fc44[_0xb282('0x48')];agents[_0x49fc44[_0xb282('0x46')]]['transferuniqueid']=_0x49fc44['origtransfereruniqueid'];}if(_0x49fc44[_0xb282('0x49')]&&agents[_0x49fc44[_0xb282('0x49')]]){agents[_0x49fc44[_0xb282('0x49')]]['agententerreason']=0x1;transfers[_0x49fc44['transfereeuniqueid']]=_[_0xb282('0x4a')](agents[_0x49fc44[_0xb282('0x49')]]);transfers[_0x49fc44[_0xb282('0x49')]]['calleridnum']=agents[_0x49fc44[_0xb282('0x46')]]['calleridnum'];transfers[_0x49fc44[_0xb282('0x49')]][_0xb282('0x4b')]=agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x4b')];transfers[_0x49fc44[_0xb282('0x49')]][_0xb282('0x4c')]=utils[_0xb282('0x20')]();transfers[_0x49fc44['transfereeuniqueid']][_0xb282('0x38')]=utils[_0xb282('0x20')]();transfers[_0x49fc44[_0xb282('0x49')]]['holdtime']=0x0;transfers[_0x49fc44['transfereeuniqueid']][_0xb282('0x4d')]=0x2;}}else if(_0x49fc44[_0xb282('0x46')]==_0x49fc44[_0xb282('0x4e')]){if(!_['isNil'](agents[_0x49fc44['origtransfereruniqueid']])){utils[_0xb282('0x18')](util[_0xb282('0x19')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x49fc44[_0xb282('0x44')],agents[_0x49fc44[_0xb282('0x44')]][_0xb282('0x6')]));agents[_0x49fc44['origtransfereruniqueid']][_0xb282('0x3d')]=!![];agents[_0x49fc44[_0xb282('0x44')]]['transfertype']=_0xb282('0x4f');agents[_0x49fc44[_0xb282('0x44')]][_0xb282('0x40')]=_0x49fc44[_0xb282('0x50')];agents[_0x49fc44['origtransfereruniqueid']]['transferuniqueid']=_0x49fc44[_0xb282('0x46')];}if(_0x49fc44[_0xb282('0x51')]&&agents[_0x49fc44['transfertargetuniqueid']]){agents[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4d')]=0x1;transfers[_0x49fc44[_0xb282('0x51')]]=_[_0xb282('0x4a')](agents[_0x49fc44[_0xb282('0x51')]]);transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x8')]=agents[_0x49fc44[_0xb282('0x44')]]['calleridnum'];transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4b')]=agents[_0x49fc44[_0xb282('0x44')]]['calleridname'];transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4c')]=utils['now']();transfers[_0x49fc44['transfertargetuniqueid']][_0xb282('0x38')]=utils[_0xb282('0x20')]();transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x23')]=0x0;transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4d')]=0x2;}}}catch(_0x3cb0c6){utils[_0xb282('0x1b')](util[_0xb282('0x19')](_0xb282('0x43'),_0x49fc44[_0xb282('0x44')]),_0x3cb0c6);}};exports[_0xb282('0x52')]=function(_0x88dfa6){try{utils[_0xb282('0x14')](util[_0xb282('0x19')](_0xb282('0x53'),_0x88dfa6['uniqueid']),_0x88dfa6);if(agents[_0x88dfa6[_0xb282('0x11')]]&&agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')]===_0xb282('0x21')){if(_0x88dfa6[_0xb282('0x54')]==='21'){agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')]=_0xb282('0x55');agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]=_0xb282('0x55');}utils['info'](util[_0xb282('0x19')](_0xb282('0x56'),_0x88dfa6[_0xb282('0x11')],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x6')],agents[_0x88dfa6['uniqueid']]['reason'],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]));writeDB(agents[_0x88dfa6[_0xb282('0x11')]]);var _0x449adc=unanswered[_0xb282('0x57')](_0x88dfa6[_0xb282('0x11')]);if(_0x449adc>-0x1){unanswered[_0xb282('0x58')](_0x449adc,0x1);}}if(transfers[_0x88dfa6['uniqueid']]){transfers[_0x88dfa6['uniqueid']][_0xb282('0x34')]=!![];transfers[_0x88dfa6[_0xb282('0x11')]]['agentcompleteAt']=utils['now']();transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x25')]=utils[_0xb282('0x37')](transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x36')],transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x38')]);transfers[_0x88dfa6['uniqueid']][_0xb282('0x22')]=_0xb282('0x59');transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]=_0xb282('0x5a');utils[_0xb282('0x18')](util[_0xb282('0x19')](_0xb282('0x56'),_0x88dfa6[_0xb282('0x11')],transfers[_0x88dfa6[_0xb282('0x11')]]['membername'],transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')],transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]));writeDB(transfers[_0x88dfa6[_0xb282('0x11')]],!![]);}if(agents[_0x88dfa6[_0xb282('0x11')]]&&agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x38')]){agents[_0x88dfa6['uniqueid']][_0xb282('0x34')]=!![];agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x36')]=utils[_0xb282('0x20')]();agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x25')]=utils['diffTime'](agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x36')],agents[_0x88dfa6[_0xb282('0x11')]]['agentconnectAt']);agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')]=agents[_0x88dfa6['uniqueid']][_0xb282('0x3d')]?_0xb282('0x3d'):_0xb282('0x59');agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]=_0xb282('0x5a');utils[_0xb282('0x18')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x88dfa6[_0xb282('0x11')],agents[_0x88dfa6['uniqueid']][_0xb282('0x6')],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]));writeDB(agents[_0x88dfa6['uniqueid']]);}}catch(_0xa1f33c){utils[_0xb282('0x1b')](util[_0xb282('0x19')]('[%s][agents][hangup]',_0x88dfa6[_0xb282('0x11')]),_0xa1f33c);}};
\ No newline at end of file
index d6a291c..3da7e2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c5=['transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','toNumber','hangup','isNil','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','answertime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid'];(function(_0x16d6fa,_0xff299f){var _0x4a875e=function(_0x2d6f88){while(--_0x2d6f88){_0x16d6fa['push'](_0x16d6fa['shift']());}};_0x4a875e(++_0xff299f);}(_0xb8c5,0xd0));var _0x5b8c=function(_0x333f9f,_0x4bf7f1){_0x333f9f=_0x333f9f-0x0;var _0x126182=_0xb8c5[_0x333f9f];return _0x126182;};'use strict';var _=require(_0x5b8c('0x0'));var util=require(_0x5b8c('0x1'));var utils=require(_0x5b8c('0x2'));var transfers=require(_0x5b8c('0x3'));var dispositions=[_0x5b8c('0x4'),_0x5b8c('0x5'),_0x5b8c('0x5'),_0x5b8c('0x4'),_0x5b8c('0x4'),_0x5b8c('0x4'),_0x5b8c('0x6'),_0x5b8c('0x7'),_0x5b8c('0x5'),_0x5b8c('0x5'),_0x5b8c('0x5')];var channels={};function writeDB(_0x5754fc){var _0x41af8b;if(transfers[_0x5b8c('0x8')][_0x5754fc['uniqueid']]){_0x41af8b=_0x5754fc[_0x5b8c('0x9')];_0x5754fc[_0x5b8c('0x9')]=transfers['blinds'][_0x5754fc[_0x5b8c('0x9')]][_0x5b8c('0xa')];}utils['info'](util[_0x5b8c('0xb')](_0x5b8c('0xc'),_0x5754fc['uniqueid'],_0x5754fc[_0x5b8c('0xd')],_0x5754fc[_0x5b8c('0xe')],_0x5754fc[_0x5b8c('0xf')],_0x5754fc['interface'],_0x5754fc[_0x5b8c('0x10')],_0x5754fc[_0x5b8c('0x11')],_0x5754fc['lastevent']));if(_0x5754fc[_0x5b8c('0x12')]){utils[_0x5b8c('0x13')](_0x5754fc[_0x5b8c('0x12')])[_0x5b8c('0x14')](function(_0x15fa59){if(_0x15fa59){_0x5754fc[_0x5b8c('0x15')]=_0x15fa59['id'];}utils[_0x5b8c('0x16')](_0x5b8c('0x17'),_0x5754fc);});}else{utils['request']('CreateVoiceCallReport',_0x5754fc);}if(channels[_0x5754fc['uniqueid']]){delete channels[_0x5754fc[_0x5b8c('0x9')]];}else if(_0x41af8b&&channels[_0x41af8b]){delete transfers[_0x5b8c('0x8')][_0x41af8b];delete channels[_0x41af8b];}}exports[_0x5b8c('0x18')]=function(_0x37287f){try{utils[_0x5b8c('0x19')](util[_0x5b8c('0xb')](_0x5b8c('0x1a'),_0x37287f[_0x5b8c('0x9')]),_0x37287f);if(_0x37287f[_0x5b8c('0x9')]==_0x37287f[_0x5b8c('0x1b')]&&_0x37287f['channel']!='OutgoingSpoolFailed'){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')](_0x5b8c('0x1d'),_0x37287f[_0x5b8c('0x9')],_0x37287f['context'],_0x37287f[_0x5b8c('0x1e')]));channels[_0x37287f[_0x5b8c('0x9')]]={'uniqueid':_0x37287f[_0x5b8c('0x9')],'accountcode':_0x37287f['accountcode'],'source':_0x37287f[_0x5b8c('0x10')],'destination':_0x37287f[_0x5b8c('0x1e')],'destinationcontext':_0x37287f[_0x5b8c('0x1f')],'channel':_0x37287f[_0x5b8c('0xd')],'starttime':utils[_0x5b8c('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x5b8c('0x21')};}}catch(_0x4be97d){utils[_0x5b8c('0x22')](util[_0x5b8c('0xb')]('[%s][calls][newchannel]',_0x37287f[_0x5b8c('0x9')]),_0x4be97d);}};exports[_0x5b8c('0x23')]=function(_0x1b6783){try{utils[_0x5b8c('0x19')](util[_0x5b8c('0xb')](_0x5b8c('0x24'),_0x1b6783[_0x5b8c('0x9')]),_0x1b6783);if(!_['isNil'](channels[_0x1b6783['uniqueid']])&&_0x1b6783[_0x5b8c('0x25')]==0x6){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1b6783[_0x5b8c('0x9')],_0x1b6783[_0x5b8c('0x1f')],_0x1b6783['channel']));if(_['isNil'](channels[_0x1b6783[_0x5b8c('0x9')]][_0x5b8c('0x26')])){channels[_0x1b6783[_0x5b8c('0x9')]][_0x5b8c('0x26')]=utils[_0x5b8c('0x20')]();}}else if(!_['isNil'](channels[_0x1b6783[_0x5b8c('0x1b')]])&&_0x1b6783[_0x5b8c('0x25')]==0x6&&_0x1b6783[_0x5b8c('0x1f')]!=_0x5b8c('0x27')){utils['info'](util[_0x5b8c('0xb')](_0x5b8c('0x28'),_0x1b6783[_0x5b8c('0x9')],_0x1b6783[_0x5b8c('0x1b')],_0x1b6783['context'],_0x1b6783[_0x5b8c('0xd')]));channels[_0x1b6783[_0x5b8c('0x1b')]][_0x5b8c('0x12')]=_0x1b6783[_0x5b8c('0x12')];channels[_0x1b6783[_0x5b8c('0x1b')]][_0x5b8c('0x29')]=_0x1b6783['channel'];if(_['isNil'](channels[_0x1b6783['linkedid']]['answertime'])){channels[_0x1b6783[_0x5b8c('0x1b')]]['answertime']=utils['now']();}channels[_0x1b6783[_0x5b8c('0x1b')]]['disposition']=dispositions[_[_0x5b8c('0x2a')](_0x1b6783[_0x5b8c('0x25')])]||'ANSWERED';}}catch(_0x5617cb){utils[_0x5b8c('0x22')](util[_0x5b8c('0xb')](_0x5b8c('0x24'),_0x1b6783['uniqueid']),_0x5617cb);}};exports[_0x5b8c('0x2b')]=function(_0x56f874){try{if(!_[_0x5b8c('0x2c')](channels[_0x56f874[_0x5b8c('0x9')]])){utils[_0x5b8c('0x19')](util['format'](_0x5b8c('0x2d'),_0x56f874[_0x5b8c('0x9')]),_0x56f874);if(_[_0x5b8c('0x2c')](channels[_0x56f874['uniqueid']][_0x5b8c('0x2e')])){channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x2e')]=_0x56f874['calleridname']+'\x20<'+_0x56f874['calleridnum']+'>';}utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')](_0x5b8c('0x2f'),_0x56f874[_0x5b8c('0x9')],channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x2e')],_0x56f874[_0x5b8c('0x30')]));channels[_0x56f874['uniqueid']][_0x5b8c('0x31')]=utils[_0x5b8c('0x20')]();channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x32')]=utils['diffTime'](channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x31')],channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x33')]);channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x34')]=channels[_0x56f874[_0x5b8c('0x9')]]['answertime']?utils[_0x5b8c('0x35')](channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x31')],channels[_0x56f874[_0x5b8c('0x9')]][_0x5b8c('0x36')]):0x0;writeDB(channels[_0x56f874['uniqueid']]);}}catch(_0x5d567f){utils[_0x5b8c('0x22')](util[_0x5b8c('0xb')](_0x5b8c('0x2d'),_0x56f874[_0x5b8c('0x9')]),_0x5d567f);}};exports[_0x5b8c('0x37')]=function(_0x64314d){try{if(!_[_0x5b8c('0x2c')](channels[_0x64314d[_0x5b8c('0x38')]])){utils[_0x5b8c('0x19')](util[_0x5b8c('0xb')](_0x5b8c('0x39'),_0x64314d[_0x5b8c('0x3a')]),_0x64314d);if(channels[_0x64314d[_0x5b8c('0x38')]][_0x5b8c('0xd')]==_0x64314d[_0x5b8c('0x3b')]){utils[_0x5b8c('0x1c')](util['format'](_0x5b8c('0x3c'),_0x64314d[_0x5b8c('0x3a')],_0x64314d[_0x5b8c('0x38')],_0x64314d['secondtransfererchannel']));channels[_0x64314d[_0x5b8c('0x38')]][_0x5b8c('0x29')]=_0x64314d['secondtransfererchannel'];channels[_0x64314d['localtwolinkedid']]['userfield']='_attended';}else if(channels[_0x64314d[_0x5b8c('0x38')]][_0x5b8c('0xd')]=_0x64314d[_0x5b8c('0x3d')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x64314d[_0x5b8c('0x3a')],_0x64314d[_0x5b8c('0x38')],_0x64314d[_0x5b8c('0x3e')]));channels[_0x64314d[_0x5b8c('0x38')]][_0x5b8c('0x29')]=_0x64314d[_0x5b8c('0x3e')];channels[_0x64314d[_0x5b8c('0x38')]][_0x5b8c('0x3f')]='_attended';}}}catch(_0x3d949e){utils[_0x5b8c('0x22')](util['format'](_0x5b8c('0x39'),_0x64314d['origtransfereruniqueid']),_0x3d949e);}};exports[_0x5b8c('0x40')]=function(_0x218885){try{if(!_['isNil'](channels[_0x218885[_0x5b8c('0x9')]])){utils['debug'](util[_0x5b8c('0xb')](_0x5b8c('0x41'),_0x218885['uniqueid']),_0x218885);channels[_0x218885[_0x5b8c('0x9')]][_0x5b8c('0x42')]=utils['now']();utils['info'](util['format'](_0x5b8c('0x43'),_0x218885[_0x5b8c('0x9')],channels[_0x218885[_0x5b8c('0x9')]][_0x5b8c('0x42')]));}}catch(_0x12220e){utils[_0x5b8c('0x22')](util[_0x5b8c('0xb')]('[%s][calls][musiconholdstart]',_0x218885['uniqueid']),_0x12220e);}};exports['musiconholdstop']=function(_0x37a742){try{if(!_[_0x5b8c('0x2c')](channels[_0x37a742[_0x5b8c('0x9')]])){utils[_0x5b8c('0x19')](util['format'](_0x5b8c('0x44'),_0x37a742[_0x5b8c('0x9')]),_0x37a742);if(!_['isNil'](channels[_0x37a742[_0x5b8c('0x9')]][_0x5b8c('0x42')])){channels[_0x37a742[_0x5b8c('0x9')]][_0x5b8c('0x45')]+=utils[_0x5b8c('0x35')](utils[_0x5b8c('0x20')](),channels[_0x37a742['uniqueid']][_0x5b8c('0x42')]);utils[_0x5b8c('0x1c')](util['format'](_0x5b8c('0x46'),_0x37a742[_0x5b8c('0x9')],channels[_0x37a742[_0x5b8c('0x9')]]['mohtime']));delete channels[_0x37a742[_0x5b8c('0x9')]][_0x5b8c('0x42')];}}}catch(_0x527e73){utils[_0x5b8c('0x22')](util[_0x5b8c('0xb')](_0x5b8c('0x44'),_0x37a742[_0x5b8c('0x9')]),_0x527e73);}};exports['varset']=function(_0x1196c1){try{if(!_[_0x5b8c('0x2c')](channels[_0x1196c1[_0x5b8c('0x9')]])){utils[_0x5b8c('0x19')](util['format'](_0x5b8c('0x47'),_0x1196c1[_0x5b8c('0x9')]),_0x1196c1);if(!_[_0x5b8c('0x2c')](_0x1196c1['variable']['xmd-originatecalleridnum'])){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1196c1[_0x5b8c('0x9')],_0x1196c1[_0x5b8c('0x48')]));channels[_0x1196c1['uniqueid']][_0x5b8c('0x49')]=_0x1196c1[_0x5b8c('0x48')];}if(!_[_0x5b8c('0x2c')](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x4b')])){utils['info'](util[_0x5b8c('0xb')](_0x5b8c('0x4c'),_0x1196c1[_0x5b8c('0x9')],_0x1196c1[_0x5b8c('0x48')]));channels[_0x1196c1[_0x5b8c('0x9')]][_0x5b8c('0x4d')]=_0x1196c1[_0x5b8c('0x48')];channels[_0x1196c1[_0x5b8c('0x9')]]['callerid']='\x22'+_0x1196c1[_0x5b8c('0x48')]+'\x22\x20<'+_0x1196c1[_0x5b8c('0x48')]+'>';}if(!_['isNil'](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x4e')])||!_[_0x5b8c('0x2c')](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x4f')])){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')](_0x5b8c('0x50'),_0x1196c1['uniqueid'],!_[_0x5b8c('0x2c')](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x4e')])?_0x5b8c('0x4e'):_0x5b8c('0x4f'),_0x1196c1['value']));channels[_0x1196c1['uniqueid']]['callerid']=_0x1196c1[_0x5b8c('0x48')];}if(!_['isNil'](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x51')])||!_['isNil'](_0x1196c1[_0x5b8c('0x4a')]['xmcs-queue'])){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')](_0x5b8c('0x50'),_0x1196c1[_0x5b8c('0x9')],!_[_0x5b8c('0x2c')](_0x1196c1['variable'][_0x5b8c('0x51')])?'xmd-queue':_0x5b8c('0x52'),_0x1196c1['value']));channels[_0x1196c1['uniqueid']]['lastapplication']='Queue';channels[_0x1196c1['uniqueid']][_0x5b8c('0x53')]=_0x1196c1['value'];channels[_0x1196c1[_0x5b8c('0x9')]][_0x5b8c('0xe')]=!![];}if(!_[_0x5b8c('0x2c')](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x54')])){utils[_0x5b8c('0x1c')](util['format'](_0x5b8c('0x55'),_0x1196c1[_0x5b8c('0x9')],_0x1196c1[_0x5b8c('0x48')]));channels[_0x1196c1[_0x5b8c('0x9')]][_0x5b8c('0x56')]=_0x1196c1['value'];}if(!_['isNil'](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x57')])){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')](_0x5b8c('0x58'),_0x1196c1[_0x5b8c('0x9')],_0x1196c1[_0x5b8c('0x48')]));channels[_0x1196c1['uniqueid']][_0x5b8c('0x59')]=_0x1196c1[_0x5b8c('0x48')];}if(!_[_0x5b8c('0x2c')](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x5a')])){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x1196c1[_0x5b8c('0x9')],_0x1196c1[_0x5b8c('0x48')]));channels[_0x1196c1['uniqueid']][_0x5b8c('0x5b')]=_0x1196c1[_0x5b8c('0x48')];}if(!_[_0x5b8c('0x2c')](_0x1196c1[_0x5b8c('0x4a')][_0x5b8c('0x5c')])){utils[_0x5b8c('0x1c')](util[_0x5b8c('0xb')](_0x5b8c('0x5d'),_0x1196c1['uniqueid'],_0x1196c1[_0x5b8c('0x48')]));channels[_0x1196c1['uniqueid']][_0x5b8c('0x5c')]=_0x1196c1['value'];}}}catch(_0x2a04bc){utils[_0x5b8c('0x22')](util[_0x5b8c('0xb')](_0x5b8c('0x47'),_0x1196c1[_0x5b8c('0x9')]),_0x2a04bc);}};exports[_0x5b8c('0x5e')]=function(_0x567746){try{if(!_[_0x5b8c('0x2c')](channels[_0x567746[_0x5b8c('0x9')]])){utils[_0x5b8c('0x19')](util[_0x5b8c('0xb')]('[%s][calls][newexten]',_0x567746[_0x5b8c('0x9')]),_0x567746);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x567746[_0x5b8c('0x9')],_0x567746[_0x5b8c('0x5f')],_0x567746[_0x5b8c('0x60')]));if(_0x567746['application'][_0x5b8c('0x61')]()==_0x5b8c('0x62')&&_[_0x5b8c('0x63')](_0x567746[_0x5b8c('0x60')][_0x5b8c('0x61')](),'cdr')){var _0x107b64=_0x567746['appdata'][_0x5b8c('0x64')]('=');var _0x500c2e=_0x107b64[0x0][_0x5b8c('0x65')](_0x107b64[0x0][_0x5b8c('0x66')]('(')+0x1,_0x107b64[0x0][_0x5b8c('0x66')](')'));var _0x31ce99=_0x107b64[0x1];channels[_0x567746[_0x5b8c('0x9')]][_0x500c2e]=_0x31ce99;}if(!_[_0x5b8c('0x67')](['hangup',_0x5b8c('0x68'),_0x5b8c('0x69'),'set',_0x5b8c('0x6a')],_0x567746[_0x5b8c('0x5f')][_0x5b8c('0x61')]())){channels[_0x567746[_0x5b8c('0x9')]][_0x5b8c('0x6b')]=_0x567746[_0x5b8c('0x5f')];channels[_0x567746['uniqueid']]['lastdata']=_0x567746['appdata'];}}}catch(_0x229ad1){utils[_0x5b8c('0x22')](util[_0x5b8c('0xb')](_0x5b8c('0x6c'),_0x567746[_0x5b8c('0x9')]),_0x229ad1);}};
\ No newline at end of file
+var _0x90ad=['[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','hangup','[%s][calls][hangup]','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','callerid','endtime','duration','starttime','diffTime','localtwolinkedid','debug','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','destination','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','includes','noop','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','uniqueid','blinds','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','format','[%s][calls][newchannel]','linkedid'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x90ad,0xb2));var _0xd90a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x90ad[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xd90a('0x0'));var util=require(_0xd90a('0x1'));var utils=require('./utils');var transfers=require(_0xd90a('0x2'));var dispositions=['NO\x20ANSWER','FAILED','FAILED',_0xd90a('0x3'),'NO\x20ANSWER',_0xd90a('0x3'),_0xd90a('0x4'),_0xd90a('0x5'),_0xd90a('0x6'),_0xd90a('0x6'),_0xd90a('0x6')];var channels={};function writeDB(_0x722d35){var _0x14a62c;if(transfers['blinds'][_0x722d35[_0xd90a('0x7')]]){_0x14a62c=_0x722d35[_0xd90a('0x7')];_0x722d35['uniqueid']=transfers[_0xd90a('0x8')][_0x722d35[_0xd90a('0x7')]]['transfereeuniqueid'];}utils[_0xd90a('0x9')](util['format'](_0xd90a('0xa'),_0x722d35[_0xd90a('0x7')],_0x722d35[_0xd90a('0xb')],_0x722d35[_0xd90a('0xc')],_0x722d35[_0xd90a('0xd')],_0x722d35[_0xd90a('0xe')],_0x722d35[_0xd90a('0xf')],_0x722d35['connectedlinenum'],_0x722d35[_0xd90a('0x10')]));if(_0x722d35[_0xd90a('0x11')]){utils[_0xd90a('0x12')](_0x722d35[_0xd90a('0x11')])[_0xd90a('0x13')](function(_0x3cebff){if(_0x3cebff){_0x722d35['UserId']=_0x3cebff['id'];}utils[_0xd90a('0x14')](_0xd90a('0x15'),_0x722d35);});}else{utils[_0xd90a('0x14')](_0xd90a('0x15'),_0x722d35);}if(channels[_0x722d35[_0xd90a('0x7')]]){delete channels[_0x722d35[_0xd90a('0x7')]];}else if(_0x14a62c&&channels[_0x14a62c]){delete transfers[_0xd90a('0x8')][_0x14a62c];delete channels[_0x14a62c];}}exports[_0xd90a('0x16')]=function(_0x59e809){try{utils['debug'](util[_0xd90a('0x17')](_0xd90a('0x18'),_0x59e809['uniqueid']),_0x59e809);if(_0x59e809[_0xd90a('0x7')]==_0x59e809[_0xd90a('0x19')]&&_0x59e809['channel']!='OutgoingSpoolFailed'){utils[_0xd90a('0x9')](util['format'](_0xd90a('0x1a'),_0x59e809[_0xd90a('0x7')],_0x59e809[_0xd90a('0x1b')],_0x59e809[_0xd90a('0x1c')]));channels[_0x59e809['uniqueid']]={'uniqueid':_0x59e809[_0xd90a('0x7')],'accountcode':_0x59e809[_0xd90a('0x11')],'source':_0x59e809[_0xd90a('0xf')],'destination':_0x59e809[_0xd90a('0x1c')],'destinationcontext':_0x59e809['context'],'channel':_0x59e809[_0xd90a('0xb')],'starttime':utils[_0xd90a('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd90a('0x3'),'amaflags':_0xd90a('0x1e')};}}catch(_0x5399d9){utils[_0xd90a('0x1f')](util[_0xd90a('0x17')](_0xd90a('0x18'),_0x59e809[_0xd90a('0x7')]),_0x5399d9);}};exports[_0xd90a('0x20')]=function(_0x356459){try{utils['debug'](util['format'](_0xd90a('0x21'),_0x356459[_0xd90a('0x7')]),_0x356459);if(!_[_0xd90a('0x22')](channels[_0x356459[_0xd90a('0x7')]])&&_0x356459['channelstate']==0x6){utils[_0xd90a('0x9')](util[_0xd90a('0x17')](_0xd90a('0x23'),_0x356459['uniqueid'],_0x356459['context'],_0x356459[_0xd90a('0xb')]));if(_['isNil'](channels[_0x356459[_0xd90a('0x7')]][_0xd90a('0x24')])){channels[_0x356459[_0xd90a('0x7')]][_0xd90a('0x24')]=utils['now']();}}else if(!_[_0xd90a('0x22')](channels[_0x356459['linkedid']])&&_0x356459[_0xd90a('0x25')]==0x6&&_0x356459[_0xd90a('0x1b')]!=_0xd90a('0x26')){utils[_0xd90a('0x9')](util[_0xd90a('0x17')](_0xd90a('0x27'),_0x356459[_0xd90a('0x7')],_0x356459[_0xd90a('0x19')],_0x356459[_0xd90a('0x1b')],_0x356459[_0xd90a('0xb')]));channels[_0x356459[_0xd90a('0x19')]][_0xd90a('0x11')]=_0x356459[_0xd90a('0x11')];channels[_0x356459['linkedid']][_0xd90a('0x28')]=_0x356459[_0xd90a('0xb')];if(_[_0xd90a('0x22')](channels[_0x356459[_0xd90a('0x19')]][_0xd90a('0x29')])){channels[_0x356459['linkedid']][_0xd90a('0x29')]=utils['now']();}channels[_0x356459[_0xd90a('0x19')]][_0xd90a('0x2a')]=dispositions[_['toNumber'](_0x356459[_0xd90a('0x25')])]||_0xd90a('0x4');}}catch(_0x234f19){utils[_0xd90a('0x1f')](util['format'](_0xd90a('0x21'),_0x356459[_0xd90a('0x7')]),_0x234f19);}};exports[_0xd90a('0x2b')]=function(_0x1592b1){try{if(!_['isNil'](channels[_0x1592b1['uniqueid']])){utils['debug'](util[_0xd90a('0x17')](_0xd90a('0x2c'),_0x1592b1[_0xd90a('0x7')]),_0x1592b1);if(_['isNil'](channels[_0x1592b1[_0xd90a('0x7')]]['callerid'])){channels[_0x1592b1[_0xd90a('0x7')]]['callerid']=_0x1592b1['calleridname']+'\x20<'+_0x1592b1[_0xd90a('0xf')]+'>';}utils[_0xd90a('0x9')](util['format'](_0xd90a('0x2d'),_0x1592b1[_0xd90a('0x7')],channels[_0x1592b1['uniqueid']][_0xd90a('0x2e')],_0x1592b1['cause-txt']));channels[_0x1592b1[_0xd90a('0x7')]][_0xd90a('0x2f')]=utils[_0xd90a('0x1d')]();channels[_0x1592b1['uniqueid']][_0xd90a('0x30')]=utils['diffTime'](channels[_0x1592b1[_0xd90a('0x7')]][_0xd90a('0x2f')],channels[_0x1592b1[_0xd90a('0x7')]][_0xd90a('0x31')]);channels[_0x1592b1['uniqueid']]['billableseconds']=channels[_0x1592b1[_0xd90a('0x7')]][_0xd90a('0x29')]?utils[_0xd90a('0x32')](channels[_0x1592b1[_0xd90a('0x7')]][_0xd90a('0x2f')],channels[_0x1592b1[_0xd90a('0x7')]][_0xd90a('0x29')]):0x0;writeDB(channels[_0x1592b1[_0xd90a('0x7')]]);}}catch(_0x5adee2){utils[_0xd90a('0x1f')](util['format'](_0xd90a('0x2c'),_0x1592b1['uniqueid']),_0x5adee2);}};exports['attendedtransfer']=function(_0x2ce1f5){try{if(!_[_0xd90a('0x22')](channels[_0x2ce1f5[_0xd90a('0x33')]])){utils[_0xd90a('0x34')](util['format'](_0xd90a('0x35'),_0x2ce1f5['origtransfereruniqueid']),_0x2ce1f5);if(channels[_0x2ce1f5[_0xd90a('0x33')]][_0xd90a('0xb')]==_0x2ce1f5[_0xd90a('0x36')]){utils[_0xd90a('0x9')](util[_0xd90a('0x17')](_0xd90a('0x37'),_0x2ce1f5[_0xd90a('0x38')],_0x2ce1f5[_0xd90a('0x33')],_0x2ce1f5['secondtransfererchannel']));channels[_0x2ce1f5[_0xd90a('0x33')]]['destinationchannel']=_0x2ce1f5['secondtransfererchannel'];channels[_0x2ce1f5['localtwolinkedid']][_0xd90a('0x39')]='_attended';}else if(channels[_0x2ce1f5[_0xd90a('0x33')]][_0xd90a('0xb')]=_0x2ce1f5[_0xd90a('0x3a')]){utils[_0xd90a('0x9')](util[_0xd90a('0x17')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2ce1f5[_0xd90a('0x38')],_0x2ce1f5[_0xd90a('0x33')],_0x2ce1f5['origtransfererchannel']));channels[_0x2ce1f5['localtwolinkedid']][_0xd90a('0x28')]=_0x2ce1f5[_0xd90a('0x3b')];channels[_0x2ce1f5[_0xd90a('0x33')]]['userfield']=_0xd90a('0x3c');}}}catch(_0x354716){utils['error'](util[_0xd90a('0x17')](_0xd90a('0x35'),_0x2ce1f5[_0xd90a('0x38')]),_0x354716);}};exports[_0xd90a('0x3d')]=function(_0x1a8a51){try{if(!_[_0xd90a('0x22')](channels[_0x1a8a51[_0xd90a('0x7')]])){utils[_0xd90a('0x34')](util['format'](_0xd90a('0x3e'),_0x1a8a51[_0xd90a('0x7')]),_0x1a8a51);channels[_0x1a8a51[_0xd90a('0x7')]]['musiconholdstartAt']=utils[_0xd90a('0x1d')]();utils[_0xd90a('0x9')](util['format'](_0xd90a('0x3f'),_0x1a8a51[_0xd90a('0x7')],channels[_0x1a8a51[_0xd90a('0x7')]][_0xd90a('0x40')]));}}catch(_0x15c045){utils[_0xd90a('0x1f')](util['format'](_0xd90a('0x3e'),_0x1a8a51[_0xd90a('0x7')]),_0x15c045);}};exports[_0xd90a('0x41')]=function(_0xde48bb){try{if(!_[_0xd90a('0x22')](channels[_0xde48bb[_0xd90a('0x7')]])){utils[_0xd90a('0x34')](util[_0xd90a('0x17')](_0xd90a('0x42'),_0xde48bb[_0xd90a('0x7')]),_0xde48bb);if(!_[_0xd90a('0x22')](channels[_0xde48bb[_0xd90a('0x7')]][_0xd90a('0x40')])){channels[_0xde48bb[_0xd90a('0x7')]][_0xd90a('0x43')]+=utils[_0xd90a('0x32')](utils['now'](),channels[_0xde48bb[_0xd90a('0x7')]][_0xd90a('0x40')]);utils[_0xd90a('0x9')](util['format'](_0xd90a('0x44'),_0xde48bb[_0xd90a('0x7')],channels[_0xde48bb[_0xd90a('0x7')]][_0xd90a('0x43')]));delete channels[_0xde48bb[_0xd90a('0x7')]]['musiconholdstartAt'];}}}catch(_0x3fd3cd){utils[_0xd90a('0x1f')](util['format'](_0xd90a('0x42'),_0xde48bb['uniqueid']),_0x3fd3cd);}};exports['varset']=function(_0x3b4e68){try{if(!_[_0xd90a('0x22')](channels[_0x3b4e68['uniqueid']])){utils[_0xd90a('0x34')](util[_0xd90a('0x17')](_0xd90a('0x45'),_0x3b4e68['uniqueid']),_0x3b4e68);if(!_[_0xd90a('0x22')](_0x3b4e68[_0xd90a('0x46')][_0xd90a('0x47')])){utils[_0xd90a('0x9')](util[_0xd90a('0x17')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3b4e68[_0xd90a('0x7')],_0x3b4e68[_0xd90a('0x48')]));channels[_0x3b4e68[_0xd90a('0x7')]]['source']=_0x3b4e68[_0xd90a('0x48')];}if(!_['isNil'](_0x3b4e68[_0xd90a('0x46')]['xmd-phone'])){utils[_0xd90a('0x9')](util[_0xd90a('0x17')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x3b4e68['uniqueid'],_0x3b4e68['value']));channels[_0x3b4e68['uniqueid']][_0xd90a('0x49')]=_0x3b4e68[_0xd90a('0x48')];channels[_0x3b4e68[_0xd90a('0x7')]][_0xd90a('0x2e')]='\x22'+_0x3b4e68['value']+_0xd90a('0x4a')+_0x3b4e68['value']+'>';}if(!_['isNil'](_0x3b4e68[_0xd90a('0x46')]['xmd-callerid-preview'])||!_[_0xd90a('0x22')](_0x3b4e68[_0xd90a('0x46')]['xmd-callerid'])){utils[_0xd90a('0x9')](util[_0xd90a('0x17')](_0xd90a('0x4b'),_0x3b4e68[_0xd90a('0x7')],!_[_0xd90a('0x22')](_0x3b4e68['variable'][_0xd90a('0x4c')])?_0xd90a('0x4c'):'xmd-callerid',_0x3b4e68[_0xd90a('0x48')]));channels[_0x3b4e68[_0xd90a('0x7')]][_0xd90a('0x2e')]=_0x3b4e68[_0xd90a('0x48')];}if(!_['isNil'](_0x3b4e68[_0xd90a('0x46')][_0xd90a('0x4d')])||!_[_0xd90a('0x22')](_0x3b4e68[_0xd90a('0x46')][_0xd90a('0x4e')])){utils[_0xd90a('0x9')](util[_0xd90a('0x17')](_0xd90a('0x4b'),_0x3b4e68['uniqueid'],!_[_0xd90a('0x22')](_0x3b4e68[_0xd90a('0x46')]['xmd-queue'])?_0xd90a('0x4d'):_0xd90a('0x4e'),_0x3b4e68['value']));channels[_0x3b4e68[_0xd90a('0x7')]][_0xd90a('0x4f')]=_0xd90a('0x50');channels[_0x3b4e68[_0xd90a('0x7')]][_0xd90a('0x51')]=_0x3b4e68['value'];channels[_0x3b4e68['uniqueid']][_0xd90a('0xc')]=!![];}if(!_['isNil'](_0x3b4e68['variable']['xmd-contactid'])){utils['info'](util['format'](_0xd90a('0x52'),_0x3b4e68[_0xd90a('0x7')],_0x3b4e68['value']));channels[_0x3b4e68[_0xd90a('0x7')]][_0xd90a('0x53')]=_0x3b4e68['value'];}if(!_[_0xd90a('0x22')](_0x3b4e68['variable']['xmd-cdrtype'])){utils['info'](util[_0xd90a('0x17')](_0xd90a('0x54'),_0x3b4e68[_0xd90a('0x7')],_0x3b4e68[_0xd90a('0x48')]));channels[_0x3b4e68[_0xd90a('0x7')]][_0xd90a('0x55')]=_0x3b4e68[_0xd90a('0x48')];}if(!_[_0xd90a('0x22')](_0x3b4e68[_0xd90a('0x46')][_0xd90a('0x56')])){utils[_0xd90a('0x9')](util['format'](_0xd90a('0x57'),_0x3b4e68[_0xd90a('0x7')],_0x3b4e68[_0xd90a('0x48')]));channels[_0x3b4e68[_0xd90a('0x7')]]['routeid']=_0x3b4e68[_0xd90a('0x48')];}if(!_[_0xd90a('0x22')](_0x3b4e68[_0xd90a('0x46')][_0xd90a('0x58')])){utils[_0xd90a('0x9')](util[_0xd90a('0x17')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3b4e68[_0xd90a('0x7')],_0x3b4e68[_0xd90a('0x48')]));channels[_0x3b4e68[_0xd90a('0x7')]][_0xd90a('0x58')]=_0x3b4e68[_0xd90a('0x48')];}}}catch(_0x27f1ed){utils[_0xd90a('0x1f')](util[_0xd90a('0x17')](_0xd90a('0x45'),_0x3b4e68[_0xd90a('0x7')]),_0x27f1ed);}};exports[_0xd90a('0x59')]=function(_0x24a65b){try{if(!_[_0xd90a('0x22')](channels[_0x24a65b[_0xd90a('0x7')]])){utils[_0xd90a('0x34')](util[_0xd90a('0x17')](_0xd90a('0x5a'),_0x24a65b[_0xd90a('0x7')]),_0x24a65b);utils['info'](util[_0xd90a('0x17')](_0xd90a('0x5b'),_0x24a65b[_0xd90a('0x7')],_0x24a65b[_0xd90a('0x5c')],_0x24a65b[_0xd90a('0x5d')]));if(_0x24a65b['application'][_0xd90a('0x5e')]()==_0xd90a('0x5f')&&_[_0xd90a('0x60')](_0x24a65b[_0xd90a('0x5d')][_0xd90a('0x5e')](),'cdr')){var _0x1efe65=_0x24a65b[_0xd90a('0x5d')]['split']('=');var _0x4c48d9=_0x1efe65[0x0][_0xd90a('0x61')](_0x1efe65[0x0][_0xd90a('0x62')]('(')+0x1,_0x1efe65[0x0]['lastIndexOf'](')'));var _0x498d4e=_0x1efe65[0x1];channels[_0x24a65b[_0xd90a('0x7')]][_0x4c48d9]=_0x498d4e;}if(!_[_0xd90a('0x63')]([_0xd90a('0x2b'),_0xd90a('0x64'),'execif',_0xd90a('0x5f'),_0xd90a('0x65')],_0x24a65b[_0xd90a('0x5c')][_0xd90a('0x5e')]())){channels[_0x24a65b[_0xd90a('0x7')]][_0xd90a('0x4f')]=_0x24a65b[_0xd90a('0x5c')];channels[_0x24a65b[_0xd90a('0x7')]]['lastdata']=_0x24a65b['appdata'];}}}catch(_0x4b991d){utils['error'](util['format'](_0xd90a('0x5a'),_0x24a65b[_0xd90a('0x7')]),_0x4b991d);}};
\ No newline at end of file
index ae96538..704bffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x212f=['info','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect'];(function(_0x912a79,_0x57a23f){var _0x301398=function(_0x712722){while(--_0x712722){_0x912a79['push'](_0x912a79['shift']());}};_0x301398(++_0x57a23f);}(_0x212f,0x1f3));var _0xf212=function(_0x55c43f,_0x562d7e){_0x55c43f=_0x55c43f-0x0;var _0xf3a8dc=_0x212f[_0x55c43f];return _0xf3a8dc;};'use strict';var utils=require('./utils');exports[_0xf212('0x0')]=function(){utils[_0xf212('0x1')]('[core]\x20connected');};exports[_0xf212('0x2')]=function(){utils[_0xf212('0x1')]('[core]\x20shutdown');};exports[_0xf212('0x3')]=function(){utils['info'](_0xf212('0x4'));};exports[_0xf212('0x5')]=function(_0xcbd7b6){utils[_0xf212('0x5')](_0xf212('0x6'),_0xcbd7b6);};exports[_0xf212('0x7')]=function(){utils['info'](_0xf212('0x8'));};exports[_0xf212('0x9')]=function(_0x2d7717){};
\ No newline at end of file
+var _0xeaba=['./utils','connect','info','[core]\x20connected','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xeaba,0x134));var _0xaeab=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xeaba[_0x5f3f88];return _0xd08119;};'use strict';var utils=require(_0xaeab('0x0'));exports[_0xaeab('0x1')]=function(){utils[_0xaeab('0x2')](_0xaeab('0x3'));};exports['shutdown']=function(){utils[_0xaeab('0x2')]('[core]\x20shutdown');};exports[_0xaeab('0x4')]=function(){utils[_0xaeab('0x2')](_0xaeab('0x5'));};exports[_0xaeab('0x6')]=function(_0x317378){utils[_0xaeab('0x6')](_0xaeab('0x7'),_0x317378);};exports[_0xaeab('0x8')]=function(){utils['info'](_0xaeab('0x9'));};exports[_0xaeab('0xa')]=function(_0x3517a8){};
\ No newline at end of file
index 65a4550..3e1c17e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6265=['assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','duration','diffTime','endtime','billableseconds','lodash','util','./utils','info','format','uniqueid','calleridnum','dialstatus','request','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','appdata','cdr(routeid)','split','error','[%s][dials][newexten]','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','[%s][dials][dialbegin]'];(function(_0x53d9c8,_0x18ebe2){var _0x5e9883=function(_0x497982){while(--_0x497982){_0x53d9c8['push'](_0x53d9c8['shift']());}};_0x5e9883(++_0x18ebe2);}(_0x6265,0x1b1));var _0x5626=function(_0x1ed079,_0x3c222b){_0x1ed079=_0x1ed079-0x0;var _0xb85ee9=_0x6265[_0x1ed079];return _0xb85ee9;};'use strict';var _=require(_0x5626('0x0'));var util=require(_0x5626('0x1'));var utils=require(_0x5626('0x2'));var dials={};function writeDB(_0x8fd47d){utils[_0x5626('0x3')](util[_0x5626('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x8fd47d[_0x5626('0x5')],_0x8fd47d['channel'],_0x8fd47d['dialstring'],_0x8fd47d[_0x5626('0x6')],_0x8fd47d['connectedlinenum'],_0x8fd47d[_0x5626('0x7')]));utils[_0x5626('0x8')]('CreateVoiceDialReport',_0x8fd47d);delete dials[_0x8fd47d[_0x5626('0x5')]];}exports[_0x5626('0x9')]=function(_0x2e1c18){try{utils[_0x5626('0xa')](util[_0x5626('0x4')]('[%s][dials][newexten]',_0x2e1c18['uniqueid']),_0x2e1c18);utils[_0x5626('0x3')](util[_0x5626('0x4')](_0x5626('0xb'),_0x2e1c18[_0x5626('0x5')],_0x2e1c18[_0x5626('0xc')],_0x2e1c18['appdata']));if(_0x2e1c18[_0x5626('0xc')][_0x5626('0xd')]()=='set'&&_['startsWith'](_0x2e1c18[_0x5626('0xe')][_0x5626('0xd')](),_0x5626('0xf'))){var _0x2e6ff9=_0x2e1c18['appdata'][_0x5626('0x10')]('=');dials[_0x2e1c18[_0x5626('0x5')]]={'routeId':_0x2e6ff9[0x1]};}}catch(_0x3a11f4){utils[_0x5626('0x11')](util['format'](_0x5626('0x12'),_0x2e1c18[_0x5626('0x5')]),_0x3a11f4);}};exports[_0x5626('0x13')]=function(_0x3fa4f7){try{utils['debug'](util[_0x5626('0x4')]('[%s][dials][varset]',_0x3fa4f7[_0x5626('0x5')]),_0x3fa4f7);if(!_[_0x5626('0x14')](_0x3fa4f7[_0x5626('0x15')][_0x5626('0x16')])){utils[_0x5626('0x3')](util[_0x5626('0x4')](_0x5626('0x17'),_0x3fa4f7[_0x5626('0x5')],_0x3fa4f7[_0x5626('0x18')]));dials[_0x3fa4f7[_0x5626('0x5')]]={'routeId':_0x3fa4f7[_0x5626('0x18')]};}}catch(_0x52a883){utils['error'](util[_0x5626('0x4')](_0x5626('0x19'),_0x3fa4f7['uniqueid']),_0x52a883);}};exports['dialbegin']=function(_0x39bc0f){try{if(!_[_0x5626('0x14')](dials[_0x39bc0f['uniqueid']])){utils['debug'](util[_0x5626('0x4')](_0x5626('0x1a'),_0x39bc0f['uniqueid']),_0x39bc0f);dials[_0x39bc0f[_0x5626('0x5')]]=_[_0x5626('0x1b')](dials[_0x39bc0f[_0x5626('0x5')]],_0x39bc0f);dials[_0x39bc0f[_0x5626('0x5')]]['starttime']=utils[_0x5626('0x1c')]();dials[_0x39bc0f[_0x5626('0x5')]][_0x5626('0x1d')]=_0x5626('0x1e');utils[_0x5626('0x3')](util['format'](_0x5626('0x1f'),_0x39bc0f[_0x5626('0x5')],dials[_0x39bc0f[_0x5626('0x5')]][_0x5626('0x20')]));}}catch(_0x3d44cb){utils['error'](util[_0x5626('0x4')](_0x5626('0x1a'),_0x39bc0f[_0x5626('0x5')]),_0x3d44cb);}};exports[_0x5626('0x21')]=function(_0x1544c3){try{if(!_[_0x5626('0x14')](dials[_0x1544c3[_0x5626('0x5')]])){utils[_0x5626('0xa')](util[_0x5626('0x4')]('[%s][dials][dialend]',_0x1544c3['uniqueid']),_0x1544c3);dials[_0x1544c3['uniqueid']][_0x5626('0x7')]=_0x1544c3['dialstatus'];if(_0x1544c3[_0x5626('0x7')]=='ANSWER'){dials[_0x1544c3[_0x5626('0x5')]]=_[_0x5626('0x1b')](dials[_0x1544c3['uniqueid']],_0x1544c3);dials[_0x1544c3[_0x5626('0x5')]][_0x5626('0x22')]=utils[_0x5626('0x1c')]();dials[_0x1544c3['uniqueid']][_0x5626('0x1d')]=_0x5626('0x23');utils[_0x5626('0x3')](util[_0x5626('0x4')](_0x5626('0x24'),_0x1544c3['uniqueid'],_0x1544c3[_0x5626('0x7')],dials[_0x1544c3[_0x5626('0x5')]]['answertime']));}else{utils[_0x5626('0x3')](util[_0x5626('0x4')](_0x5626('0x25'),_0x1544c3[_0x5626('0x5')],_0x1544c3[_0x5626('0x7')]));}}}catch(_0x57b985){utils[_0x5626('0x11')](util[_0x5626('0x4')]('[%s][dials][dialend]',_0x1544c3[_0x5626('0x5')]),_0x57b985);}};exports[_0x5626('0x26')]=function(_0x59bd1d){try{if(!_['isNil'](dials[_0x59bd1d[_0x5626('0x5')]])){utils[_0x5626('0xa')](util[_0x5626('0x4')](_0x5626('0x27'),_0x59bd1d[_0x5626('0x5')]),_0x59bd1d);utils[_0x5626('0x3')](util[_0x5626('0x4')](_0x5626('0x28'),_0x59bd1d[_0x5626('0x5')],_0x59bd1d[_0x5626('0x6')],_0x59bd1d[_0x5626('0x29')],_0x59bd1d['cause-txt']));dials[_0x59bd1d['uniqueid']]=_[_0x5626('0x1b')](dials[_0x59bd1d[_0x5626('0x5')]],{'endtime':utils[_0x5626('0x1c')](),'lastevent':'complete'});dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x2a')]=utils[_0x5626('0x2b')](dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x2c')],dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x20')]);dials[_0x59bd1d[_0x5626('0x5')]]['holdtime']=utils[_0x5626('0x2b')](dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x22')]||dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x2c')],dials[_0x59bd1d[_0x5626('0x5')]]['starttime']);dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x2d')]=dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x22')]?utils['diffTime'](dials[_0x59bd1d['uniqueid']][_0x5626('0x2c')],dials[_0x59bd1d[_0x5626('0x5')]][_0x5626('0x22')]):0x0;writeDB(dials[_0x59bd1d[_0x5626('0x5')]]);}}catch(_0x46b851){utils[_0x5626('0x11')](util[_0x5626('0x4')]('[%s][dials][hangup]',_0x59bd1d[_0x5626('0x5')]),_0x46b851);}};
\ No newline at end of file
+var _0x806d=['diffTime','billableseconds','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','toLowerCase','set','startsWith','appdata','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime','now','connect','hangup','[%s][dials][hangup]','complete','endtime','holdtime'];(function(_0x28187d,_0x1b06a1){var _0x4b3033=function(_0x18e525){while(--_0x18e525){_0x28187d['push'](_0x28187d['shift']());}};_0x4b3033(++_0x1b06a1);}(_0x806d,0x16a));var _0xd806=function(_0x2f4721,_0x334621){_0x2f4721=_0x2f4721-0x0;var _0x4894c3=_0x806d[_0x2f4721];return _0x4894c3;};'use strict';var _=require('lodash');var util=require(_0xd806('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x2542b1){utils[_0xd806('0x1')](util[_0xd806('0x2')](_0xd806('0x3'),_0x2542b1[_0xd806('0x4')],_0x2542b1[_0xd806('0x5')],_0x2542b1['dialstring'],_0x2542b1[_0xd806('0x6')],_0x2542b1['connectedlinenum'],_0x2542b1[_0xd806('0x7')]));utils[_0xd806('0x8')](_0xd806('0x9'),_0x2542b1);delete dials[_0x2542b1['uniqueid']];}exports[_0xd806('0xa')]=function(_0x29a9a7){try{utils[_0xd806('0xb')](util[_0xd806('0x2')](_0xd806('0xc'),_0x29a9a7[_0xd806('0x4')]),_0x29a9a7);utils[_0xd806('0x1')](util[_0xd806('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x29a9a7[_0xd806('0x4')],_0x29a9a7[_0xd806('0xd')],_0x29a9a7['appdata']));if(_0x29a9a7['application'][_0xd806('0xe')]()==_0xd806('0xf')&&_[_0xd806('0x10')](_0x29a9a7[_0xd806('0x11')]['toLowerCase'](),'cdr(routeid)')){var _0x137dbc=_0x29a9a7['appdata']['split']('=');dials[_0x29a9a7[_0xd806('0x4')]]={'routeId':_0x137dbc[0x1]};}}catch(_0x211100){utils[_0xd806('0x12')](util[_0xd806('0x2')]('[%s][dials][newexten]',_0x29a9a7[_0xd806('0x4')]),_0x211100);}};exports[_0xd806('0x13')]=function(_0x2b60eb){try{utils[_0xd806('0xb')](util[_0xd806('0x2')](_0xd806('0x14'),_0x2b60eb[_0xd806('0x4')]),_0x2b60eb);if(!_[_0xd806('0x15')](_0x2b60eb[_0xd806('0x16')][_0xd806('0x17')])){utils[_0xd806('0x1')](util[_0xd806('0x2')](_0xd806('0x18'),_0x2b60eb[_0xd806('0x4')],_0x2b60eb[_0xd806('0x19')]));dials[_0x2b60eb[_0xd806('0x4')]]={'routeId':_0x2b60eb[_0xd806('0x19')]};}}catch(_0x5b5dfc){utils['error'](util['format'](_0xd806('0x14'),_0x2b60eb[_0xd806('0x4')]),_0x5b5dfc);}};exports[_0xd806('0x1a')]=function(_0x52fd71){try{if(!_['isNil'](dials[_0x52fd71['uniqueid']])){utils[_0xd806('0xb')](util['format'](_0xd806('0x1b'),_0x52fd71[_0xd806('0x4')]),_0x52fd71);dials[_0x52fd71[_0xd806('0x4')]]=_['assign'](dials[_0x52fd71[_0xd806('0x4')]],_0x52fd71);dials[_0x52fd71[_0xd806('0x4')]]['starttime']=utils['now']();dials[_0x52fd71['uniqueid']][_0xd806('0x1c')]=_0xd806('0x1d');utils[_0xd806('0x1')](util[_0xd806('0x2')](_0xd806('0x1e'),_0x52fd71['uniqueid'],dials[_0x52fd71[_0xd806('0x4')]][_0xd806('0x1f')]));}}catch(_0x1fbc7e){utils[_0xd806('0x12')](util[_0xd806('0x2')](_0xd806('0x1b'),_0x52fd71[_0xd806('0x4')]),_0x1fbc7e);}};exports[_0xd806('0x20')]=function(_0x544de8){try{if(!_[_0xd806('0x15')](dials[_0x544de8['uniqueid']])){utils[_0xd806('0xb')](util[_0xd806('0x2')](_0xd806('0x21'),_0x544de8['uniqueid']),_0x544de8);dials[_0x544de8['uniqueid']]['dialstatus']=_0x544de8[_0xd806('0x7')];if(_0x544de8[_0xd806('0x7')]==_0xd806('0x22')){dials[_0x544de8[_0xd806('0x4')]]=_['assign'](dials[_0x544de8[_0xd806('0x4')]],_0x544de8);dials[_0x544de8[_0xd806('0x4')]][_0xd806('0x23')]=utils[_0xd806('0x24')]();dials[_0x544de8['uniqueid']][_0xd806('0x1c')]=_0xd806('0x25');utils[_0xd806('0x1')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x544de8[_0xd806('0x4')],_0x544de8[_0xd806('0x7')],dials[_0x544de8[_0xd806('0x4')]]['answertime']));}else{utils['info'](util[_0xd806('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x544de8['uniqueid'],_0x544de8['dialstatus']));}}}catch(_0x20671c){utils[_0xd806('0x12')](util['format'](_0xd806('0x21'),_0x544de8[_0xd806('0x4')]),_0x20671c);}};exports[_0xd806('0x26')]=function(_0x1b68eb){try{if(!_[_0xd806('0x15')](dials[_0x1b68eb['uniqueid']])){utils[_0xd806('0xb')](util['format'](_0xd806('0x27'),_0x1b68eb[_0xd806('0x4')]),_0x1b68eb);utils[_0xd806('0x1')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1b68eb[_0xd806('0x4')],_0x1b68eb[_0xd806('0x6')],_0x1b68eb['calleridname'],_0x1b68eb['cause-txt']));dials[_0x1b68eb[_0xd806('0x4')]]=_['assign'](dials[_0x1b68eb['uniqueid']],{'endtime':utils[_0xd806('0x24')](),'lastevent':_0xd806('0x28')});dials[_0x1b68eb[_0xd806('0x4')]]['duration']=utils['diffTime'](dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x29')],dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x1f')]);dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x2a')]=utils[_0xd806('0x2b')](dials[_0x1b68eb[_0xd806('0x4')]]['answertime']||dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x29')],dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x1f')]);dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x2c')]=dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x23')]?utils[_0xd806('0x2b')](dials[_0x1b68eb['uniqueid']][_0xd806('0x29')],dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x23')]):0x0;writeDB(dials[_0x1b68eb[_0xd806('0x4')]]);}}catch(_0x41e92f){utils[_0xd806('0x12')](util[_0xd806('0x2')](_0xd806('0x27'),_0x1b68eb['uniqueid']),_0x41e92f);}};
\ No newline at end of file
index cdcff4d..2ef24ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd08=['./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbd08,0xf4));var _0x8bd0=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xbd08[_0x411017];return _0x2adeea;};var AsteriskManager=require(_0x8bd0('0x0'));var config=require(_0x8bd0('0x1'));var utils=require('./utils');var util=require(_0x8bd0('0x2'));var ami=new AsteriskManager(config[_0x8bd0('0x3')]['port'],config['asterisk']['ip'],config[_0x8bd0('0x3')]['username'],config[_0x8bd0('0x3')][_0x8bd0('0x4')],!![]);ami[_0x8bd0('0x5')]();if(config[_0x8bd0('0x6')]&&config[_0x8bd0('0x6')][_0x8bd0('0x7')]){utils[_0x8bd0('0x8')](_0x8bd0('0x9'));}else{var agents=require(_0x8bd0('0xa'));var calls=require('./calls.controller');var queues=require(_0x8bd0('0xb'));var recordings=require(_0x8bd0('0xc'));var members=require(_0x8bd0('0xd'));var dials=require(_0x8bd0('0xe'));var transfers=require(_0x8bd0('0xf'));var core=require('./core.controller');ami['on'](_0x8bd0('0x10'),core[_0x8bd0('0x10')]);ami['on'](_0x8bd0('0x11'),core[_0x8bd0('0x11')]);ami['on'](_0x8bd0('0x12'),core['fullybooted']);ami['on'](_0x8bd0('0x13'),core[_0x8bd0('0x13')]);ami['on']('close',core['close']);ami['on'](_0x8bd0('0x14'),core[_0x8bd0('0x14')]);ami['on'](_0x8bd0('0x15'),function(_0x2aff5a){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x18'),_0x2aff5a['device']),_0x2aff5a);members['devicestatechange'](_0x2aff5a);}catch(_0x1dd664){utils[_0x8bd0('0x13')](util['format'](_0x8bd0('0x18'),_0x2aff5a[_0x8bd0('0x19')]),_0x1dd664);}});ami['on'](_0x8bd0('0x1a'),function(_0x43a562){try{utils['debug'](util['format']('[%s][index][agentcalled]',_0x43a562[_0x8bd0('0x1b')]),_0x43a562);agents[_0x8bd0('0x1a')](_0x43a562);}catch(_0x46a27f){utils['error'](util[_0x8bd0('0x17')](_0x8bd0('0x1c'),_0x43a562[_0x8bd0('0x1b')]),_0x46a27f);}});ami['on'](_0x8bd0('0x1d'),function(_0x56069c){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x1e'),_0x56069c['uniqueid']),_0x56069c);agents['agentringnoanswer'](_0x56069c);}catch(_0x31eaa9){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x1e'),_0x56069c[_0x8bd0('0x1b')]),_0x31eaa9);}});ami['on'](_0x8bd0('0x1f'),function(_0x5f2c04){try{utils['debug'](util[_0x8bd0('0x17')](_0x8bd0('0x20'),_0x5f2c04['uniqueid']),_0x5f2c04);agents[_0x8bd0('0x1f')](_0x5f2c04);queues[_0x8bd0('0x1f')](_0x5f2c04);}catch(_0x389b6e){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x20'),_0x5f2c04[_0x8bd0('0x1b')]),_0x389b6e);}});ami['on']('agentcomplete',function(_0x123b0b){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')]('[%s][index][agentcomplete]',_0x123b0b[_0x8bd0('0x1b')]),_0x123b0b);agents['agentcomplete'](_0x123b0b);queues[_0x8bd0('0x21')](_0x123b0b);members[_0x8bd0('0x21')](_0x123b0b);}catch(_0x3ccb51){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')]('[%s][index][agentcomplete]',_0x123b0b[_0x8bd0('0x1b')]),_0x3ccb51);}});ami['on'](_0x8bd0('0x22'),function(_0x2a40f4){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x23'),_0x2a40f4[_0x8bd0('0x1b')]),_0x2a40f4);agents[_0x8bd0('0x22')](_0x2a40f4);queues['queuecallerabandon'](_0x2a40f4);}catch(_0x5de9e8){utils['error'](util[_0x8bd0('0x17')]('[%s][index][queuecallerabandon]',_0x2a40f4[_0x8bd0('0x1b')]),_0x5de9e8);}});ami['on'](_0x8bd0('0x24'),function(_0x3aecaa){try{utils['debug'](util[_0x8bd0('0x17')](_0x8bd0('0x25'),_0x3aecaa[_0x8bd0('0x1b')]),_0x3aecaa);queues['queuecallerjoin'](_0x3aecaa);recordings['queuecallerjoin'](_0x3aecaa);}catch(_0x39e4b7){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')]('[%s][index][queuecallerjoin]',_0x3aecaa[_0x8bd0('0x1b')]),_0x39e4b7);}});ami['on'](_0x8bd0('0x26'),function(_0x1c48b2){try{utils[_0x8bd0('0x16')](util['format'](_0x8bd0('0x27'),_0x1c48b2[_0x8bd0('0x1b')]),_0x1c48b2);queues[_0x8bd0('0x26')](_0x1c48b2);}catch(_0x2dd59d){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x27'),_0x1c48b2[_0x8bd0('0x1b')]),_0x2dd59d);}});ami['on'](_0x8bd0('0x28'),function(_0x4352f4){try{utils['debug'](util[_0x8bd0('0x17')](_0x8bd0('0x29'),_0x4352f4[_0x8bd0('0x1b')]),_0x4352f4);queues[_0x8bd0('0x28')](_0x4352f4);calls[_0x8bd0('0x28')](_0x4352f4);}catch(_0x39902c){utils[_0x8bd0('0x13')](util['format'](_0x8bd0('0x29'),_0x4352f4[_0x8bd0('0x1b')]),_0x39902c);}});ami['on']('musiconholdstop',function(_0x41cb1f){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x2a'),_0x41cb1f[_0x8bd0('0x1b')]),_0x41cb1f);queues['musiconholdstop'](_0x41cb1f);calls[_0x8bd0('0x2b')](_0x41cb1f);}catch(_0x47fd46){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x2a'),_0x41cb1f[_0x8bd0('0x1b')]),_0x47fd46);}});ami['on'](_0x8bd0('0x2c'),function(_0x21ff29){try{utils[_0x8bd0('0x16')](util['format']('[%s][index][newstate]',_0x21ff29[_0x8bd0('0x1b')]),_0x21ff29);calls[_0x8bd0('0x2c')](_0x21ff29);recordings[_0x8bd0('0x2c')](_0x21ff29);}catch(_0x28702f){utils[_0x8bd0('0x13')](util['format'](_0x8bd0('0x2d'),_0x21ff29[_0x8bd0('0x1b')]),_0x28702f);}});ami['on'](_0x8bd0('0x2e'),function(_0x213f86){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x2f'),_0x213f86[_0x8bd0('0x1b')]),_0x213f86);calls['hangup'](_0x213f86);recordings[_0x8bd0('0x2e')](_0x213f86);dials[_0x8bd0('0x2e')](_0x213f86);agents[_0x8bd0('0x2e')](_0x213f86);queues[_0x8bd0('0x2e')](_0x213f86);}catch(_0xb0f582){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')]('[%s][index][hangup]',_0x213f86[_0x8bd0('0x1b')]),_0xb0f582);}});ami['on']('cdr',function(_0x1f0160){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x30'),_0x1f0160[_0x8bd0('0x1b')]),_0x1f0160);members[_0x8bd0('0x31')](_0x1f0160);}catch(_0x5d117e){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x30'),_0x1f0160[_0x8bd0('0x1b')]),_0x5d117e);}});ami['on'](_0x8bd0('0x32'),function(_0x41d6c7){try{utils[_0x8bd0('0x16')](util['format'](_0x8bd0('0x33'),_0x41d6c7[_0x8bd0('0x1b')]),_0x41d6c7);queues[_0x8bd0('0x32')](_0x41d6c7);agents[_0x8bd0('0x32')](_0x41d6c7);transfers[_0x8bd0('0x32')](_0x41d6c7);}catch(_0x1edc39){utils['error'](util[_0x8bd0('0x17')](_0x8bd0('0x33'),_0x41d6c7['uniqueid']),_0x1edc39);}});ami['on'](_0x8bd0('0x34'),function(_0x27245f){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x35'),_0x27245f['origtransfereruniqueid']),_0x27245f);queues['attendedtransfer'](_0x27245f);transfers['attendedtransfer'](_0x27245f);agents['attendedtransfer'](_0x27245f);calls['attendedtransfer'](_0x27245f);}catch(_0x37381d){utils[_0x8bd0('0x13')](util['format'](_0x8bd0('0x35'),_0x27245f['origtransfereruniqueid']),_0x37381d);}});ami['on']('varset',function(_0x1f8488){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x36'),_0x1f8488[_0x8bd0('0x1b')]),_0x1f8488);queues[_0x8bd0('0x37')](_0x1f8488);recordings['varset'](_0x1f8488);calls[_0x8bd0('0x37')](_0x1f8488);dials[_0x8bd0('0x37')](_0x1f8488);}catch(_0x581f5c){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x36'),_0x1f8488['uniqueid']),_0x581f5c);}});ami['on'](_0x8bd0('0x38'),function(_0x456a0c){try{utils['debug'](util[_0x8bd0('0x17')](_0x8bd0('0x39'),_0x456a0c[_0x8bd0('0x1b')]),_0x456a0c);calls[_0x8bd0('0x38')](_0x456a0c);recordings[_0x8bd0('0x38')](_0x456a0c);dials[_0x8bd0('0x38')](_0x456a0c);}catch(_0x246971){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x39'),_0x456a0c[_0x8bd0('0x1b')]),_0x246971);}});ami['on'](_0x8bd0('0x3a'),function(_0x45582a){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')]('[%s][index][newchannel]',_0x45582a[_0x8bd0('0x1b')]),_0x45582a);calls[_0x8bd0('0x3a')](_0x45582a);recordings[_0x8bd0('0x3a')](_0x45582a);}catch(_0x26d2e7){utils['error'](util[_0x8bd0('0x17')]('[%s][index][newchannel]',_0x45582a[_0x8bd0('0x1b')]),_0x26d2e7);}});ami['on'](_0x8bd0('0x3b'),function(_0x441bad){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x3c'),_0x441bad['uniqueid']),_0x441bad);dials['dialbegin'](_0x441bad);}catch(_0x5e1df8){utils[_0x8bd0('0x13')](util[_0x8bd0('0x17')](_0x8bd0('0x3d'),_0x441bad[_0x8bd0('0x1b')]),_0x5e1df8);}});ami['on'](_0x8bd0('0x3e'),function(_0x238f60){try{utils[_0x8bd0('0x16')](util[_0x8bd0('0x17')](_0x8bd0('0x3f'),_0x238f60[_0x8bd0('0x1b')]),_0x238f60);dials[_0x8bd0('0x3e')](_0x238f60);}catch(_0x8bd9ff){utils[_0x8bd0('0x13')](util['format'](_0x8bd0('0x3f'),_0x238f60[_0x8bd0('0x1b')]),_0x8bd9ff);}});}
\ No newline at end of file
+var _0x443c=['newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','blindtransfer','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','password','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0x443c,0x147));var _0xc443=function(_0x6b1e6a,_0x15f84a){_0x6b1e6a=_0x6b1e6a-0x0;var _0x4e65bc=_0x443c[_0x6b1e6a];return _0x4e65bc;};var AsteriskManager=require(_0xc443('0x0'));var config=require(_0xc443('0x1'));var utils=require('./utils');var util=require(_0xc443('0x2'));var ami=new AsteriskManager(config[_0xc443('0x3')][_0xc443('0x4')],config[_0xc443('0x3')]['ip'],config[_0xc443('0x3')]['username'],config[_0xc443('0x3')][_0xc443('0x5')],!![]);ami['keepConnected']();if(config[_0xc443('0x6')]&&config['xdr'][_0xc443('0x7')]){utils['info'](_0xc443('0x8'));}else{var agents=require(_0xc443('0x9'));var calls=require(_0xc443('0xa'));var queues=require('./queues.controller');var recordings=require(_0xc443('0xb'));var members=require(_0xc443('0xc'));var dials=require(_0xc443('0xd'));var transfers=require(_0xc443('0xe'));var core=require(_0xc443('0xf'));ami['on'](_0xc443('0x10'),core[_0xc443('0x10')]);ami['on'](_0xc443('0x11'),core[_0xc443('0x11')]);ami['on'](_0xc443('0x12'),core[_0xc443('0x12')]);ami['on']('error',core[_0xc443('0x13')]);ami['on'](_0xc443('0x14'),core[_0xc443('0x14')]);ami['on']('managerevent',core[_0xc443('0x15')]);ami['on'](_0xc443('0x16'),function(_0x594c8f){try{utils[_0xc443('0x17')](util[_0xc443('0x18')]('[%s][index][devicestatechange]',_0x594c8f[_0xc443('0x19')]),_0x594c8f);members['devicestatechange'](_0x594c8f);}catch(_0x2719ab){utils[_0xc443('0x13')](util[_0xc443('0x18')](_0xc443('0x1a'),_0x594c8f[_0xc443('0x19')]),_0x2719ab);}});ami['on'](_0xc443('0x1b'),function(_0x8e3651){try{utils[_0xc443('0x17')](util[_0xc443('0x18')](_0xc443('0x1c'),_0x8e3651[_0xc443('0x1d')]),_0x8e3651);agents[_0xc443('0x1b')](_0x8e3651);}catch(_0x1f7094){utils[_0xc443('0x13')](util[_0xc443('0x18')](_0xc443('0x1c'),_0x8e3651[_0xc443('0x1d')]),_0x1f7094);}});ami['on'](_0xc443('0x1e'),function(_0x2f052a){try{utils['debug'](util['format'](_0xc443('0x1f'),_0x2f052a[_0xc443('0x1d')]),_0x2f052a);agents[_0xc443('0x1e')](_0x2f052a);}catch(_0x2794df){utils[_0xc443('0x13')](util['format']('[%s][index][agentringnoanswer]',_0x2f052a['uniqueid']),_0x2794df);}});ami['on'](_0xc443('0x20'),function(_0x2ad75b){try{utils[_0xc443('0x17')](util['format'](_0xc443('0x21'),_0x2ad75b[_0xc443('0x1d')]),_0x2ad75b);agents[_0xc443('0x20')](_0x2ad75b);queues[_0xc443('0x20')](_0x2ad75b);}catch(_0x18372d){utils['error'](util['format']('[%s][index][agentconnect]',_0x2ad75b[_0xc443('0x1d')]),_0x18372d);}});ami['on'](_0xc443('0x22'),function(_0x10e587){try{utils['debug'](util[_0xc443('0x18')](_0xc443('0x23'),_0x10e587[_0xc443('0x1d')]),_0x10e587);agents[_0xc443('0x22')](_0x10e587);queues[_0xc443('0x22')](_0x10e587);members['agentcomplete'](_0x10e587);}catch(_0x39fa7a){utils[_0xc443('0x13')](util['format'](_0xc443('0x23'),_0x10e587[_0xc443('0x1d')]),_0x39fa7a);}});ami['on']('queuecallerabandon',function(_0x5dd654){try{utils[_0xc443('0x17')](util[_0xc443('0x18')](_0xc443('0x24'),_0x5dd654[_0xc443('0x1d')]),_0x5dd654);agents['queuecallerabandon'](_0x5dd654);queues['queuecallerabandon'](_0x5dd654);}catch(_0x2268b1){utils[_0xc443('0x13')](util[_0xc443('0x18')](_0xc443('0x24'),_0x5dd654['uniqueid']),_0x2268b1);}});ami['on'](_0xc443('0x25'),function(_0x5ae047){try{utils[_0xc443('0x17')](util[_0xc443('0x18')](_0xc443('0x26'),_0x5ae047[_0xc443('0x1d')]),_0x5ae047);queues[_0xc443('0x25')](_0x5ae047);recordings[_0xc443('0x25')](_0x5ae047);}catch(_0x30bd4a){utils[_0xc443('0x13')](util[_0xc443('0x18')](_0xc443('0x26'),_0x5ae047[_0xc443('0x1d')]),_0x30bd4a);}});ami['on'](_0xc443('0x27'),function(_0x30150a){try{utils[_0xc443('0x17')](util[_0xc443('0x18')](_0xc443('0x28'),_0x30150a[_0xc443('0x1d')]),_0x30150a);queues['queuecallerleave'](_0x30150a);}catch(_0x45cf84){utils[_0xc443('0x13')](util[_0xc443('0x18')](_0xc443('0x28'),_0x30150a['uniqueid']),_0x45cf84);}});ami['on'](_0xc443('0x29'),function(_0x5974d3){try{utils[_0xc443('0x17')](util['format'](_0xc443('0x2a'),_0x5974d3[_0xc443('0x1d')]),_0x5974d3);queues[_0xc443('0x29')](_0x5974d3);calls[_0xc443('0x29')](_0x5974d3);}catch(_0x2cc57b){utils[_0xc443('0x13')](util['format'](_0xc443('0x2a'),_0x5974d3[_0xc443('0x1d')]),_0x2cc57b);}});ami['on'](_0xc443('0x2b'),function(_0x5d0a59){try{utils['debug'](util[_0xc443('0x18')]('[%s][index][musiconholdstop]',_0x5d0a59[_0xc443('0x1d')]),_0x5d0a59);queues['musiconholdstop'](_0x5d0a59);calls['musiconholdstop'](_0x5d0a59);}catch(_0x1aa0ef){utils['error'](util[_0xc443('0x18')](_0xc443('0x2c'),_0x5d0a59['uniqueid']),_0x1aa0ef);}});ami['on'](_0xc443('0x2d'),function(_0xf5d823){try{utils[_0xc443('0x17')](util[_0xc443('0x18')]('[%s][index][newstate]',_0xf5d823['uniqueid']),_0xf5d823);calls[_0xc443('0x2d')](_0xf5d823);recordings[_0xc443('0x2d')](_0xf5d823);}catch(_0x5efef6){utils[_0xc443('0x13')](util['format'](_0xc443('0x2e'),_0xf5d823[_0xc443('0x1d')]),_0x5efef6);}});ami['on']('hangup',function(_0xc52b91){try{utils[_0xc443('0x17')](util[_0xc443('0x18')]('[%s][index][hangup]',_0xc52b91[_0xc443('0x1d')]),_0xc52b91);calls['hangup'](_0xc52b91);recordings[_0xc443('0x2f')](_0xc52b91);dials[_0xc443('0x2f')](_0xc52b91);agents['hangup'](_0xc52b91);queues[_0xc443('0x2f')](_0xc52b91);}catch(_0x5091e4){utils[_0xc443('0x13')](util[_0xc443('0x18')]('[%s][index][hangup]',_0xc52b91['uniqueid']),_0x5091e4);}});ami['on']('cdr',function(_0x1ed5ad){try{utils['debug'](util[_0xc443('0x18')]('[%s][index][cdr]',_0x1ed5ad[_0xc443('0x1d')]),_0x1ed5ad);members[_0xc443('0x30')](_0x1ed5ad);}catch(_0x1851cb){utils[_0xc443('0x13')](util['format'](_0xc443('0x31'),_0x1ed5ad[_0xc443('0x1d')]),_0x1851cb);}});ami['on'](_0xc443('0x32'),function(_0x3ffe18){try{utils['debug'](util[_0xc443('0x18')]('[%s][index][blindtransfer]',_0x3ffe18[_0xc443('0x1d')]),_0x3ffe18);queues[_0xc443('0x32')](_0x3ffe18);agents[_0xc443('0x32')](_0x3ffe18);transfers[_0xc443('0x32')](_0x3ffe18);}catch(_0xb0fa80){utils[_0xc443('0x13')](util[_0xc443('0x18')]('[%s][index][blindtransfer]',_0x3ffe18[_0xc443('0x1d')]),_0xb0fa80);}});ami['on']('attendedtransfer',function(_0x3cd28a){try{utils['debug'](util[_0xc443('0x18')]('[%s][index][attendedtransfer]',_0x3cd28a[_0xc443('0x33')]),_0x3cd28a);queues[_0xc443('0x34')](_0x3cd28a);transfers[_0xc443('0x34')](_0x3cd28a);agents[_0xc443('0x34')](_0x3cd28a);calls[_0xc443('0x34')](_0x3cd28a);}catch(_0x48feda){utils[_0xc443('0x13')](util[_0xc443('0x18')]('[%s][index][attendedtransfer]',_0x3cd28a[_0xc443('0x33')]),_0x48feda);}});ami['on'](_0xc443('0x35'),function(_0x43bf3e){try{utils[_0xc443('0x17')](util[_0xc443('0x18')](_0xc443('0x36'),_0x43bf3e['uniqueid']),_0x43bf3e);queues['varset'](_0x43bf3e);recordings[_0xc443('0x35')](_0x43bf3e);calls['varset'](_0x43bf3e);dials['varset'](_0x43bf3e);}catch(_0x10e1bc){utils['error'](util['format'](_0xc443('0x36'),_0x43bf3e['uniqueid']),_0x10e1bc);}});ami['on'](_0xc443('0x37'),function(_0x38a88a){try{utils[_0xc443('0x17')](util[_0xc443('0x18')](_0xc443('0x38'),_0x38a88a[_0xc443('0x1d')]),_0x38a88a);calls['newexten'](_0x38a88a);recordings[_0xc443('0x37')](_0x38a88a);dials[_0xc443('0x37')](_0x38a88a);}catch(_0x55e971){utils[_0xc443('0x13')](util[_0xc443('0x18')]('[%s][index][newexten]',_0x38a88a['uniqueid']),_0x55e971);}});ami['on'](_0xc443('0x39'),function(_0x3f0264){try{utils[_0xc443('0x17')](util[_0xc443('0x18')](_0xc443('0x3a'),_0x3f0264[_0xc443('0x1d')]),_0x3f0264);calls['newchannel'](_0x3f0264);recordings['newchannel'](_0x3f0264);}catch(_0x583313){utils[_0xc443('0x13')](util[_0xc443('0x18')](_0xc443('0x3a'),_0x3f0264[_0xc443('0x1d')]),_0x583313);}});ami['on'](_0xc443('0x3b'),function(_0x5eb136){try{utils['debug'](util[_0xc443('0x18')]('[%s][index][dialbegin]',_0x5eb136['uniqueid']),_0x5eb136);dials[_0xc443('0x3b')](_0x5eb136);}catch(_0x563859){utils[_0xc443('0x13')](util[_0xc443('0x18')](_0xc443('0x3c'),_0x5eb136[_0xc443('0x1d')]),_0x563859);}});ami['on']('dialend',function(_0x40e29f){try{utils['debug'](util['format'](_0xc443('0x3d'),_0x40e29f[_0xc443('0x1d')]),_0x40e29f);dials['dialend'](_0x40e29f);}catch(_0x380ce0){utils['error'](util[_0xc443('0x18')]('[%s][index][dialend]',_0x40e29f[_0xc443('0x1d')]),_0x380ce0);}});}
\ No newline at end of file
index 6c1b044..06b613e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x447b=['membername','name','internal','request','CreateMemberReport','getUserByName','split','error','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','source','data3','destinationchannel','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','then'];(function(_0x7c3b37,_0x1ebab5){var _0x506c2d=function(_0x38ae31){while(--_0x38ae31){_0x7c3b37['push'](_0x7c3b37['shift']());}};_0x506c2d(++_0x1ebab5);}(_0x447b,0xe4));var _0xb447=function(_0x5b1e40,_0x40a657){_0x5b1e40=_0x5b1e40-0x0;var _0x41a652=_0x447b[_0x5b1e40];return _0x41a652;};'use strict';var _=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var utils=require('./utils');var members={};var exclude=[_0xb447('0x2'),_0xb447('0x3')];function writeDB(_0x2a45d2){utils[_0xb447('0x4')](util[_0xb447('0x5')](_0xb447('0x6'),_0x2a45d2[_0xb447('0x7')],_0x2a45d2[_0xb447('0x8')],_0x2a45d2[_0xb447('0x9')],_0x2a45d2[_0xb447('0xa')],_0x2a45d2['membername'],_0x2a45d2['type']));if(_0x2a45d2[_0xb447('0x8')]){utils['getUserByInterface'](_0x2a45d2[_0xb447('0x8')])[_0xb447('0xb')](function(_0x270edf){if(_0x270edf){_0x2a45d2[_0xb447('0xc')]=_0x270edf[_0xb447('0xd')];_0x2a45d2['internal']=_0x270edf[_0xb447('0xe')];utils[_0xb447('0xf')](_0xb447('0x10'),_0x2a45d2);}else{utils[_0xb447('0x11')](_0x2a45d2['interface'][_0xb447('0x12')]('/')[0x1])[_0xb447('0xb')](function(_0x3ef180){if(_0x3ef180){_0x2a45d2[_0xb447('0xc')]=_0x3ef180[_0xb447('0xd')];_0x2a45d2[_0xb447('0xe')]=_0x3ef180[_0xb447('0xe')];utils[_0xb447('0xf')](_0xb447('0x10'),_0x2a45d2);}});}})['catch'](function(_0x4a8d6f){utils[_0xb447('0x13')](util[_0xb447('0x5')]('[%s][members][writeDB]',_0x2a45d2[_0xb447('0x7')]),_0x4a8d6f);});}delete members[_0x2a45d2[_0xb447('0x8')]];}function startsWith(_0x43f53f,_0x557701){return _['some'](_0x43f53f,function(_0x86993a){return _['startsWith'](_0x557701,_0x86993a);});}exports[_0xb447('0x14')]=function(_0x5c98a9){try{utils[_0xb447('0x15')](util[_0xb447('0x5')](_0xb447('0x16'),members[_0x5c98a9[_0xb447('0x17')]]?members[_0x5c98a9[_0xb447('0x17')]][_0xb447('0x7')]:_0x5c98a9[_0xb447('0x17')]),_0x5c98a9);utils['info'](util['format'](_0xb447('0x18'),members[_0x5c98a9[_0xb447('0x17')]]?members[_0x5c98a9[_0xb447('0x17')]]['uniqueid']:_0x5c98a9[_0xb447('0x17')],_0x5c98a9[_0xb447('0x19')],_0x5c98a9[_0xb447('0x17')]));switch(_0x5c98a9[_0xb447('0x19')]){case _0xb447('0x1a'):case'BUSY':if(!startsWith(exclude,_0x5c98a9[_0xb447('0x17')])){members[_0x5c98a9[_0xb447('0x17')]]={'channel':_0xb447('0x1b'),'interface':_0x5c98a9[_0xb447('0x17')],'type':_0xb447('0x1c'),'enterAt':utils[_0xb447('0x1d')](),'role':'agent'};}break;case _0xb447('0x1e'):if(!_[_0xb447('0x1f')](members[_0x5c98a9[_0xb447('0x17')]])){members[_0x5c98a9[_0xb447('0x17')]][_0xb447('0x20')]=utils['now']();members[_0x5c98a9[_0xb447('0x17')]][_0xb447('0x21')]=utils[_0xb447('0x22')](members[_0x5c98a9[_0xb447('0x17')]][_0xb447('0x20')],members[_0x5c98a9[_0xb447('0x17')]][_0xb447('0x23')]);if(members[_0x5c98a9[_0xb447('0x17')]]['uniqueid']){writeDB(members[_0x5c98a9[_0xb447('0x17')]]);}}break;default:break;}}catch(_0x6eaf85){utils[_0xb447('0x13')](util[_0xb447('0x5')](_0xb447('0x16'),members[_0x5c98a9[_0xb447('0x17')]]?members[_0x5c98a9[_0xb447('0x17')]][_0xb447('0x7')]:_0x5c98a9[_0xb447('0x17')]),_0x6eaf85);}};exports['agentcomplete']=function(_0x533444){try{if(!_['isNil'](members[_0x533444[_0xb447('0x8')]])){utils['debug'](util['format']('[%s][members][agentcomplete]',_0x533444[_0xb447('0x7')]),_0x533444);utils[_0xb447('0x4')](util[_0xb447('0x5')](_0xb447('0x24'),_0x533444['uniqueid'],_0x533444[_0xb447('0x8')],_0x533444[_0xb447('0x25')]));members[_0x533444[_0xb447('0x8')]]=_[_0xb447('0x26')](members[_0x533444[_0xb447('0x8')]],{'data4':_0x533444[_0xb447('0x25')],'uniqueid':_0x533444[_0xb447('0x7')]});}}catch(_0x3c3025){utils[_0xb447('0x13')](util[_0xb447('0x5')](_0xb447('0x27'),_0x533444[_0xb447('0x7')]),_0x3c3025);}};exports[_0xb447('0x28')]=function(_0x34f96f){try{utils['debug'](util[_0xb447('0x5')](_0xb447('0x29'),_0x34f96f[_0xb447('0x7')]),_0x34f96f);if(_0x34f96f[_0xb447('0x9')]){var _0x1b7fee=_0x34f96f[_0xb447('0x9')]['split']('-')[0x0];if(!_[_0xb447('0x1f')](members[_0x1b7fee])){members[_0x1b7fee]=_[_0xb447('0x26')](members[_0x1b7fee],{'data1':members[_0x1b7fee][_0xb447('0x2a')]||_0x34f96f['type'],'data2':members[_0x1b7fee]['data2']||_0x34f96f[_0xb447('0x2b')],'data3':members[_0x1b7fee]['data3']||_0x34f96f['destination'],'uniqueid':members[_0x1b7fee][_0xb447('0x7')]||_0x34f96f[_0xb447('0x7')]});utils[_0xb447('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x34f96f['uniqueid'],members[_0x1b7fee][_0xb447('0x2a')],members[_0x1b7fee]['data2'],members[_0x1b7fee][_0xb447('0x2c')]));if(members[_0x1b7fee][_0xb447('0x20')]){writeDB(members[_0x1b7fee]);}}}if(_0x34f96f[_0xb447('0x2d')]){var _0x31e16b=_0x34f96f[_0xb447('0x2d')][_0xb447('0x12')]('-')[0x0];if(!_[_0xb447('0x1f')](members[_0x31e16b])){members[_0x31e16b]=_[_0xb447('0x26')](members[_0x31e16b],{'data1':members[_0x31e16b][_0xb447('0x2a')]||_0x34f96f['type'],'data2':members[_0x31e16b][_0xb447('0xa')]||_0x34f96f['source'],'data3':members[_0x31e16b][_0xb447('0x2c')]||_0x34f96f[_0xb447('0x2e')],'uniqueid':members[_0x31e16b][_0xb447('0x7')]||_0x34f96f['uniqueid']});utils[_0xb447('0x4')](util[_0xb447('0x5')](_0xb447('0x2f'),_0x34f96f[_0xb447('0x7')],members[_0x31e16b][_0xb447('0x2a')],members[_0x31e16b][_0xb447('0xa')],members[_0x31e16b]['data3']));if(members[_0x31e16b][_0xb447('0x20')]){writeDB(members[_0x31e16b]);}}}}catch(_0x3fee12){utils['error'](util[_0xb447('0x5')](_0xb447('0x29'),_0x34f96f['uniqueid']),_0x3fee12);}};
\ No newline at end of file
+var _0x48fb=['devicestatechange','[%s][members][devicestatechange]','device','state','BUSY','voice','TALKING','now','isNil','exitAt','duration','enterAt','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','assign','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','CreateMemberReport','split','request','catch','error','some','startsWith'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x48fb,0x114));var _0xb48f=function(_0x8dc98c,_0x4df1ce){_0x8dc98c=_0x8dc98c-0x0;var _0x5bba32=_0x48fb[_0x8dc98c];return _0x5bba32;};'use strict';var _=require(_0xb48f('0x0'));var util=require(_0xb48f('0x1'));var utils=require(_0xb48f('0x2'));var members={};var exclude=[_0xb48f('0x3'),_0xb48f('0x4')];function writeDB(_0x3ff790){utils[_0xb48f('0x5')](util[_0xb48f('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3ff790[_0xb48f('0x7')],_0x3ff790['interface'],_0x3ff790[_0xb48f('0x8')],_0x3ff790[_0xb48f('0x9')],_0x3ff790[_0xb48f('0xa')],_0x3ff790[_0xb48f('0xb')]));if(_0x3ff790[_0xb48f('0xc')]){utils[_0xb48f('0xd')](_0x3ff790[_0xb48f('0xc')])[_0xb48f('0xe')](function(_0x374390){if(_0x374390){_0x3ff790[_0xb48f('0xa')]=_0x374390[_0xb48f('0xf')];_0x3ff790[_0xb48f('0x10')]=_0x374390[_0xb48f('0x10')];utils['request'](_0xb48f('0x11'),_0x3ff790);}else{utils['getUserByName'](_0x3ff790[_0xb48f('0xc')][_0xb48f('0x12')]('/')[0x1])[_0xb48f('0xe')](function(_0x1f29f3){if(_0x1f29f3){_0x3ff790[_0xb48f('0xa')]=_0x1f29f3['name'];_0x3ff790[_0xb48f('0x10')]=_0x1f29f3[_0xb48f('0x10')];utils[_0xb48f('0x13')](_0xb48f('0x11'),_0x3ff790);}});}})[_0xb48f('0x14')](function(_0x2e8d24){utils[_0xb48f('0x15')](util[_0xb48f('0x6')]('[%s][members][writeDB]',_0x3ff790['uniqueid']),_0x2e8d24);});}delete members[_0x3ff790['interface']];}function startsWith(_0x442ffb,_0x18e75d){return _[_0xb48f('0x16')](_0x442ffb,function(_0x3bc0cc){return _[_0xb48f('0x17')](_0x18e75d,_0x3bc0cc);});}exports[_0xb48f('0x18')]=function(_0xee8805){try{utils['debug'](util[_0xb48f('0x6')](_0xb48f('0x19'),members[_0xee8805[_0xb48f('0x1a')]]?members[_0xee8805['device']][_0xb48f('0x7')]:_0xee8805[_0xb48f('0x1a')]),_0xee8805);utils['info'](util[_0xb48f('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0xee8805['device']]?members[_0xee8805['device']][_0xb48f('0x7')]:_0xee8805['device'],_0xee8805[_0xb48f('0x1b')],_0xee8805[_0xb48f('0x1a')]));switch(_0xee8805[_0xb48f('0x1b')]){case'INUSE':case _0xb48f('0x1c'):if(!startsWith(exclude,_0xee8805[_0xb48f('0x1a')])){members[_0xee8805[_0xb48f('0x1a')]]={'channel':_0xb48f('0x1d'),'interface':_0xee8805['device'],'type':_0xb48f('0x1e'),'enterAt':utils[_0xb48f('0x1f')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xb48f('0x20')](members[_0xee8805['device']])){members[_0xee8805[_0xb48f('0x1a')]][_0xb48f('0x21')]=utils[_0xb48f('0x1f')]();members[_0xee8805['device']][_0xb48f('0x22')]=utils['diffTime'](members[_0xee8805[_0xb48f('0x1a')]]['exitAt'],members[_0xee8805[_0xb48f('0x1a')]][_0xb48f('0x23')]);if(members[_0xee8805['device']]['uniqueid']){writeDB(members[_0xee8805[_0xb48f('0x1a')]]);}}break;default:break;}}catch(_0x42e3eb){utils['error'](util['format']('[%s][members][devicestatechange]',members[_0xee8805[_0xb48f('0x1a')]]?members[_0xee8805['device']][_0xb48f('0x7')]:_0xee8805[_0xb48f('0x1a')]),_0x42e3eb);}};exports[_0xb48f('0x24')]=function(_0x12989c){try{if(!_[_0xb48f('0x20')](members[_0x12989c[_0xb48f('0xc')]])){utils[_0xb48f('0x25')](util[_0xb48f('0x6')]('[%s][members][agentcomplete]',_0x12989c[_0xb48f('0x7')]),_0x12989c);utils['info'](util[_0xb48f('0x6')](_0xb48f('0x26'),_0x12989c[_0xb48f('0x7')],_0x12989c[_0xb48f('0xc')],_0x12989c[_0xb48f('0x27')]));members[_0x12989c[_0xb48f('0xc')]]=_['assign'](members[_0x12989c['interface']],{'data4':_0x12989c[_0xb48f('0x27')],'uniqueid':_0x12989c[_0xb48f('0x7')]});}}catch(_0x18954f){utils[_0xb48f('0x15')](util[_0xb48f('0x6')](_0xb48f('0x28'),_0x12989c[_0xb48f('0x7')]),_0x18954f);}};exports[_0xb48f('0x29')]=function(_0x37763d){try{utils['debug'](util[_0xb48f('0x6')]('[%s][members][cdr]',_0x37763d[_0xb48f('0x7')]),_0x37763d);if(_0x37763d[_0xb48f('0x8')]){var _0x1cc05a=_0x37763d['channel'][_0xb48f('0x12')]('-')[0x0];if(!_[_0xb48f('0x20')](members[_0x1cc05a])){members[_0x1cc05a]=_[_0xb48f('0x2a')](members[_0x1cc05a],{'data1':members[_0x1cc05a][_0xb48f('0x2b')]||_0x37763d[_0xb48f('0xb')],'data2':members[_0x1cc05a][_0xb48f('0x9')]||_0x37763d['source'],'data3':members[_0x1cc05a][_0xb48f('0x2c')]||_0x37763d[_0xb48f('0x2d')],'uniqueid':members[_0x1cc05a][_0xb48f('0x7')]||_0x37763d[_0xb48f('0x7')]});utils['info'](util['format'](_0xb48f('0x2e'),_0x37763d[_0xb48f('0x7')],members[_0x1cc05a]['data1'],members[_0x1cc05a][_0xb48f('0x9')],members[_0x1cc05a]['data3']));if(members[_0x1cc05a][_0xb48f('0x21')]){writeDB(members[_0x1cc05a]);}}}if(_0x37763d[_0xb48f('0x2f')]){var _0x36f4ef=_0x37763d['destinationchannel'][_0xb48f('0x12')]('-')[0x0];if(!_[_0xb48f('0x20')](members[_0x36f4ef])){members[_0x36f4ef]=_[_0xb48f('0x2a')](members[_0x36f4ef],{'data1':members[_0x36f4ef][_0xb48f('0x2b')]||_0x37763d['type'],'data2':members[_0x36f4ef][_0xb48f('0x9')]||_0x37763d[_0xb48f('0x30')],'data3':members[_0x36f4ef]['data3']||_0x37763d[_0xb48f('0x2d')],'uniqueid':members[_0x36f4ef][_0xb48f('0x7')]||_0x37763d[_0xb48f('0x7')]});utils[_0xb48f('0x5')](util['format'](_0xb48f('0x2e'),_0x37763d[_0xb48f('0x7')],members[_0x36f4ef]['data1'],members[_0x36f4ef]['data2'],members[_0x36f4ef][_0xb48f('0x2c')]));if(members[_0x36f4ef]['exitAt']){writeDB(members[_0x36f4ef]);}}}}catch(_0x18c725){utils[_0xb48f('0x15')](util[_0xb48f('0x6')](_0xb48f('0x31'),_0x37763d['uniqueid']),_0x18c725);}};
\ No newline at end of file
index 7d1576f..ae529fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd093=['ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleaveAt','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','BLIND','transferexten','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','ATTENDEDTRANSFER','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','now','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]'];(function(_0x590cd0,_0x11bfd4){var _0x208eb0=function(_0x19d96f){while(--_0x19d96f){_0x590cd0['push'](_0x590cd0['shift']());}};_0x208eb0(++_0x11bfd4);}(_0xd093,0x1dc));var _0x3d09=function(_0x185b6f,_0x5adccf){_0x185b6f=_0x185b6f-0x0;var _0x1f2814=_0xd093[_0x185b6f];return _0x1f2814;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x43e49c){utils[_0x3d09('0x0')](util['format'](_0x3d09('0x1'),_0x43e49c[_0x3d09('0x2')],_0x43e49c[_0x3d09('0x3')],_0x43e49c[_0x3d09('0x4')],_0x43e49c['lastAssignedTo'],_0x43e49c['calleridnum'],_0x43e49c[_0x3d09('0x5')],_0x43e49c['queuecallerexitreason']));if(_0x43e49c['queue']){utils[_0x3d09('0x6')](_0x43e49c['queue'])[_0x3d09('0x7')](function(_0x592595){if(_0x592595){_0x43e49c['type']=_0x592595[_0x3d09('0x8')];}utils[_0x3d09('0x9')](_0x3d09('0xa'),_0x43e49c);});}else{utils['request'](_0x3d09('0xa'),_0x43e49c);}if(_0x43e49c[_0x3d09('0xb')]){delete queues[_0x43e49c['transfereduniqueid']];}else{delete queues[_0x43e49c[_0x3d09('0x2')]];}}exports[_0x3d09('0xc')]=function(_0x438bb7){try{utils[_0x3d09('0xd')](util[_0x3d09('0xe')](_0x3d09('0xf'),_0x438bb7[_0x3d09('0x2')]),_0x438bb7);utils['info'](util[_0x3d09('0xe')](_0x3d09('0x10'),_0x438bb7['uniqueid'],_0x438bb7['queue'],_0x438bb7[_0x3d09('0x11')]));queues[_0x438bb7['uniqueid']]=_[_0x3d09('0x12')](_0x438bb7,{'originalposition':_0x438bb7[_0x3d09('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3adb23){utils['error'](util['format'](_0x3d09('0xf'),_0x438bb7[_0x3d09('0x2')]),_0x3adb23);}};exports[_0x3d09('0x13')]=function(_0x14d5ac){try{if(!_[_0x3d09('0x14')](queues[_0x14d5ac['uniqueid']])){utils[_0x3d09('0xd')](util[_0x3d09('0xe')](_0x3d09('0x15'),_0x14d5ac[_0x3d09('0x2')]),_0x14d5ac);if(queues[_0x14d5ac['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0x16')]&&!queues[_0x14d5ac[_0x3d09('0x2')]]['queuecallerexit']){queues[_0x14d5ac['uniqueid']][_0x3d09('0x17')]=!![];queues[_0x14d5ac[_0x3d09('0x2')]]['queuecallercompleteAt']=utils[_0x3d09('0x18')]();queues[_0x14d5ac['uniqueid']][_0x3d09('0x19')]='COMPLETEDBYAGENT';}utils[_0x3d09('0x0')](util[_0x3d09('0xe')](_0x3d09('0x1a'),_0x14d5ac[_0x3d09('0x2')],queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0x1b')],queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0x19')]));writeDB(queues[_0x14d5ac['uniqueid']]);}else if(queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0xb')]){utils[_0x3d09('0x0')](util[_0x3d09('0xe')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x14d5ac[_0x3d09('0x2')],queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0x1b')],queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0xb')]));queues[queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0xb')]]=queues[_0x14d5ac['uniqueid']];queues[queues[_0x14d5ac[_0x3d09('0x2')]][_0x3d09('0xb')]][_0x3d09('0x1c')]=0x2;delete queues[_0x14d5ac[_0x3d09('0x2')]];}}}catch(_0x187ed2){utils[_0x3d09('0x1d')](util[_0x3d09('0xe')](_0x3d09('0x15'),_0x14d5ac[_0x3d09('0x2')]),_0x187ed2);}};exports[_0x3d09('0x1e')]=function(_0x3b670f){try{utils[_0x3d09('0xd')](util[_0x3d09('0xe')](_0x3d09('0x1f'),_0x3b670f['uniqueid']),_0x3b670f);if(!_[_0x3d09('0x14')](_0x3b670f[_0x3d09('0x20')][_0x3d09('0x21')])&&_0x3b670f['value'][_0x3d09('0x22')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x3b670f[_0x3d09('0x2')]])){queues[_0x3b670f['uniqueid']][_0x3d09('0x16')]=![];queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x23')]=null;queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x24')]=!![];queues[_0x3b670f['uniqueid']][_0x3d09('0x25')]=utils[_0x3d09('0x18')]();queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x19')]=_0x3b670f[_0x3d09('0x26')][_0x3d09('0x22')]();utils['info'](util['format'](_0x3d09('0x27'),_0x3b670f[_0x3d09('0x2')],queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x1b')],_0x3b670f[_0x3d09('0x26')],queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x19')]));writeDB(queues[_0x3b670f['uniqueid']]);}}else if(!_[_0x3d09('0x14')](_0x3b670f[_0x3d09('0x20')][_0x3d09('0x28')])){if(!_[_0x3d09('0x14')](queues[_0x3b670f['uniqueid']])&&!queues[_0x3b670f[_0x3d09('0x2')]]['queuecallerabandon']){queues[_0x3b670f['uniqueid']][_0x3d09('0x16')]=![];queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x23')]=null;queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x24')]=!![];queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x25')]=utils[_0x3d09('0x18')]();queues[_0x3b670f['uniqueid']]['queuecallerexitreason']=_0x3d09('0x29');utils['info'](util[_0x3d09('0xe')](_0x3d09('0x2a'),_0x3b670f[_0x3d09('0x2')],queues[_0x3b670f['uniqueid']][_0x3d09('0x1b')],_0x3b670f[_0x3d09('0x26')],queues[_0x3b670f[_0x3d09('0x2')]][_0x3d09('0x19')]));}}}catch(_0x2f9576){utils['error'](util[_0x3d09('0xe')](_0x3d09('0x1f'),_0x3b670f[_0x3d09('0x2')]),_0x2f9576);}};exports['queuecallerabandon']=function(_0x5c0c37){try{if(!_['isNil'](queues[_0x5c0c37[_0x3d09('0x2')]])){utils['debug'](util[_0x3d09('0xe')](_0x3d09('0x2b'),_0x5c0c37[_0x3d09('0x2')]),_0x5c0c37);queues[_0x5c0c37[_0x3d09('0x2')]][_0x3d09('0x24')]=![];queues[_0x5c0c37[_0x3d09('0x2')]][_0x3d09('0x25')]=null;queues[_0x5c0c37[_0x3d09('0x2')]][_0x3d09('0x16')]=!![];queues[_0x5c0c37[_0x3d09('0x2')]]['queuecallerabandonAt']=utils[_0x3d09('0x18')]();queues[_0x5c0c37['uniqueid']][_0x3d09('0x19')]=_0x3d09('0x2c');utils[_0x3d09('0x0')](util[_0x3d09('0xe')](_0x3d09('0x2d'),_0x5c0c37[_0x3d09('0x2')],queues[_0x5c0c37[_0x3d09('0x2')]][_0x3d09('0x1b')],queues[_0x5c0c37[_0x3d09('0x2')]]['queuecallerexitreason']));}}catch(_0x24bfe4){utils[_0x3d09('0x1d')](util['format'](_0x3d09('0x2b'),_0x5c0c37['uniqueid']),_0x24bfe4);}};exports[_0x3d09('0x2e')]=function(_0x4cce35){try{if(!_[_0x3d09('0x14')](queues[_0x4cce35[_0x3d09('0x2')]])){utils[_0x3d09('0xd')](util[_0x3d09('0xe')](_0x3d09('0x2f'),_0x4cce35[_0x3d09('0x2')]),_0x4cce35);utils[_0x3d09('0x0')](util[_0x3d09('0xe')](_0x3d09('0x30'),_0x4cce35[_0x3d09('0x2')],queues[_0x4cce35[_0x3d09('0x2')]]['name'],_0x4cce35['connectedlinenum'],_0x4cce35[_0x3d09('0x31')]));queues[_0x4cce35[_0x3d09('0x2')]][_0x3d09('0x2e')]=!![];queues[_0x4cce35[_0x3d09('0x2')]][_0x3d09('0x32')]=utils[_0x3d09('0x18')]();queues[_0x4cce35[_0x3d09('0x2')]]['holdtime']=utils[_0x3d09('0x33')](queues[_0x4cce35['uniqueid']][_0x3d09('0x32')],queues[_0x4cce35[_0x3d09('0x2')]]['queuecallerjoinAt']);queues[_0x4cce35[_0x3d09('0x2')]]['position']=_0x4cce35[_0x3d09('0x11')];queues[_0x4cce35[_0x3d09('0x2')]][_0x3d09('0x34')]=_0x4cce35[_0x3d09('0x34')];queues[_0x4cce35[_0x3d09('0x2')]]['connectedlinenum']=_0x4cce35['connectedlinenum'];queues[_0x4cce35[_0x3d09('0x2')]]['connectedlinename']=_0x4cce35['connectedlinename'];}}catch(_0x2a64ba){utils[_0x3d09('0x1d')](util[_0x3d09('0xe')](_0x3d09('0x2f'),_0x4cce35['uniqueid']),_0x2a64ba);}};exports[_0x3d09('0x35')]=function(_0x57e6c7){try{if(!_[_0x3d09('0x14')](queues[_0x57e6c7['uniqueid']])){utils[_0x3d09('0xd')](util['format'](_0x3d09('0x36'),_0x57e6c7[_0x3d09('0x2')]),_0x57e6c7);utils[_0x3d09('0x0')](util[_0x3d09('0xe')](_0x3d09('0x37'),_0x57e6c7['uniqueid'],queues[_0x57e6c7['uniqueid']][_0x3d09('0x1b')],_0x57e6c7[_0x3d09('0x38')],_0x57e6c7['destaccountcode']));queues[_0x57e6c7[_0x3d09('0x2')]][_0x3d09('0x16')]=![];queues[_0x57e6c7['uniqueid']]['queuecallerabandon']=![];queues[_0x57e6c7[_0x3d09('0x2')]][_0x3d09('0x23')]=null;queues[_0x57e6c7[_0x3d09('0x2')]][_0x3d09('0x24')]=![];queues[_0x57e6c7['uniqueid']][_0x3d09('0x19')]=null;queues[_0x57e6c7['uniqueid']][_0x3d09('0x25')]=null;queues[_0x57e6c7[_0x3d09('0x2')]][_0x3d09('0x39')]=!![];queues[_0x57e6c7[_0x3d09('0x2')]][_0x3d09('0x5')]=_0x57e6c7[_0x3d09('0x3a')];queues[_0x57e6c7[_0x3d09('0x2')]][_0x3d09('0x3b')]=_0x57e6c7[_0x3d09('0x38')];}}catch(_0x240920){utils[_0x3d09('0x1d')](util['format'](_0x3d09('0x36'),_0x57e6c7[_0x3d09('0x2')]),_0x240920);}};exports[_0x3d09('0x3c')]=function(_0x291154){try{if(!_[_0x3d09('0x14')](queues[_0x291154[_0x3d09('0x2')]])){if(queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x32')]){utils[_0x3d09('0xd')](util[_0x3d09('0xe')](_0x3d09('0x3d'),_0x291154[_0x3d09('0x2')]),_0x291154);queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x16')]=![];queues[_0x291154['uniqueid']]['queuecallerabandon']=![];queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x23')]=null;queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x24')]=![];queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x25')]=null;queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x39')]=!![];queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x3b')]=_0x291154[_0x3d09('0x38')];queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x17')]=!![];queues[_0x291154['uniqueid']][_0x3d09('0x3e')]=utils[_0x3d09('0x18')]();if(_0x291154[_0x3d09('0x3f')]==_0x3d09('0x40')){if(!queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x40')]){queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x19')]=_0x3d09('0x41');}}else{queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x19')]=_0x3d09('0x42')+_0x291154['reason'][_0x3d09('0x22')]();}utils[_0x3d09('0x0')](util[_0x3d09('0xe')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x291154[_0x3d09('0x2')],queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x1b')],_0x291154[_0x3d09('0x38')],queues[_0x291154[_0x3d09('0x2')]][_0x3d09('0x19')]));writeDB(queues[_0x291154['uniqueid']]);}}}catch(_0x11043f){utils[_0x3d09('0x1d')](util[_0x3d09('0xe')](_0x3d09('0x3d'),_0x291154[_0x3d09('0x2')]),_0x11043f);}};exports[_0x3d09('0x43')]=function(_0x6a65a5){try{if(!_[_0x3d09('0x14')](queues[_0x6a65a5[_0x3d09('0x44')]])){utils[_0x3d09('0xd')](util[_0x3d09('0xe')]('[%s][queues][blindtransfer]',_0x6a65a5[_0x3d09('0x2')]),_0x6a65a5);queues[_0x6a65a5[_0x3d09('0x44')]][_0x3d09('0x40')]=!![];queues[_0x6a65a5['transfereeuniqueid']]['transfertype']=_0x3d09('0x45');queues[_0x6a65a5[_0x3d09('0x44')]][_0x3d09('0x46')]=_0x6a65a5['extension'];queues[_0x6a65a5[_0x3d09('0x44')]][_0x3d09('0x47')]=_0x6a65a5[_0x3d09('0x44')];queues[_0x6a65a5[_0x3d09('0x44')]][_0x3d09('0x19')]='BLINDTRANSFER';utils[_0x3d09('0x0')](util['format'](_0x3d09('0x48'),_0x6a65a5['uniqueid'],queues[_0x6a65a5[_0x3d09('0x44')]][_0x3d09('0x1b')],_0x6a65a5[_0x3d09('0x44')],_0x6a65a5[_0x3d09('0x49')]));}}catch(_0x355f26){utils[_0x3d09('0x1d')](util[_0x3d09('0xe')](_0x3d09('0x4a'),_0x6a65a5[_0x3d09('0x2')]),_0x355f26);}};exports[_0x3d09('0x4b')]=function(_0x1ca090){try{utils['debug'](util[_0x3d09('0xe')]('[%s][queues][attendedtransfer]',_0x1ca090[_0x3d09('0x4c')]),_0x1ca090);if(_0x1ca090[_0x3d09('0x4c')]==_0x1ca090[_0x3d09('0x4d')]){if(!_[_0x3d09('0x14')](queues[_0x1ca090['secondtransfererlinkedid']])){utils['info'](util[_0x3d09('0xe')](_0x3d09('0x4e'),_0x1ca090[_0x3d09('0x4c')],queues[_0x1ca090[_0x3d09('0x4f')]][_0x3d09('0x1b')],_0x1ca090[_0x3d09('0x50')]));queues[_0x1ca090[_0x3d09('0x4f')]][_0x3d09('0x40')]=!![];queues[_0x1ca090[_0x3d09('0x4f')]]['transfertype']=_0x3d09('0x51');queues[_0x1ca090[_0x3d09('0x4f')]][_0x3d09('0x46')]=_0x1ca090[_0x3d09('0x50')];queues[_0x1ca090['secondtransfererlinkedid']]['transferuniqueid']=_0x1ca090[_0x3d09('0x4c')];queues[_0x1ca090[_0x3d09('0x4f')]][_0x3d09('0x19')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x1ca090[_0x3d09('0x4d')]])){if(_0x1ca090[_0x3d09('0x52')]&&queues[_0x1ca090[_0x3d09('0x52')]]){queues[_0x1ca090[_0x3d09('0x52')]][_0x3d09('0x1c')]=0x1;queues[_0x1ca090[_0x3d09('0x44')]]=_[_0x3d09('0x53')](queues[_0x1ca090[_0x3d09('0x52')]]);queues[_0x1ca090[_0x3d09('0x44')]][_0x3d09('0xb')]=_0x1ca090[_0x3d09('0x54')];queues[_0x1ca090[_0x3d09('0x44')]]['queuecallerenterreason']=0x2;queues[_0x1ca090[_0x3d09('0x44')]]['calleridnum']=queues[_0x1ca090[_0x3d09('0x4f')]][_0x3d09('0x55')];queues[_0x1ca090[_0x3d09('0x44')]][_0x3d09('0x56')]=queues[_0x1ca090[_0x3d09('0x4f')]][_0x3d09('0x56')];queues[_0x1ca090[_0x3d09('0x44')]][_0x3d09('0x57')]=utils['now']();queues[_0x1ca090[_0x3d09('0x44')]][_0x3d09('0x32')]=utils['now']();queues[_0x1ca090[_0x3d09('0x44')]][_0x3d09('0x58')]=0x0;queues[_0x1ca090[_0x3d09('0x44')]]['mohtime']=0x0;utils[_0x3d09('0x0')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1ca090[_0x3d09('0x4c')],queues[_0x1ca090[_0x3d09('0x44')]][_0x3d09('0x1b')],queues[_0x1ca090[_0x3d09('0x44')]]['calleridnum'],queues[_0x1ca090[_0x3d09('0x44')]][_0x3d09('0x56')]));}else{utils[_0x3d09('0x0')](util['format'](_0x3d09('0x59'),_0x1ca090['origtransfereruniqueid'],queues[_0x1ca090[_0x3d09('0x4d')]][_0x3d09('0x1b')],_0x1ca090[_0x3d09('0x4f')]));queues[_0x1ca090[_0x3d09('0x4d')]][_0x3d09('0xb')]=_0x1ca090[_0x3d09('0x4f')];}}}else if(_0x1ca090[_0x3d09('0x5a')]==_0x1ca090[_0x3d09('0x4f')]){if(!_[_0x3d09('0x14')](queues[_0x1ca090[_0x3d09('0x4d')]])){utils[_0x3d09('0x0')](util[_0x3d09('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1ca090[_0x3d09('0x4c')],queues[_0x1ca090[_0x3d09('0x4d')]]['name'],_0x1ca090[_0x3d09('0x5a')],_0x1ca090[_0x3d09('0x5b')]));queues[_0x1ca090['origtransfererlinkedid']][_0x3d09('0x40')]=!![];queues[_0x1ca090['origtransfererlinkedid']][_0x3d09('0x5c')]=_0x3d09('0x51');queues[_0x1ca090[_0x3d09('0x4d')]]['transferexten']=_0x1ca090[_0x3d09('0x5b')];queues[_0x1ca090[_0x3d09('0x4d')]]['transferuniqueid']=_0x1ca090[_0x3d09('0x5a')];queues[_0x1ca090['origtransfererlinkedid']][_0x3d09('0x19')]=_0x3d09('0x5d');}if(!_['isNil'](queues[_0x1ca090[_0x3d09('0x4f')]])){if(_0x1ca090[_0x3d09('0x5e')]&&queues[_0x1ca090[_0x3d09('0x5e')]]){queues[_0x1ca090[_0x3d09('0x5e')]]['queuecallerenterreason']=0x1;queues[_0x1ca090[_0x3d09('0x54')]]=_[_0x3d09('0x53')](queues[_0x1ca090[_0x3d09('0x5e')]]);queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0xb')]=_0x1ca090[_0x3d09('0x54')];queues[_0x1ca090[_0x3d09('0x54')]]['queuecallerenterreason']=0x2;queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0x55')]=queues[_0x1ca090[_0x3d09('0x4d')]]['calleridnum'];queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0x56')]=queues[_0x1ca090[_0x3d09('0x4d')]][_0x3d09('0x56')];queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0x57')]=utils[_0x3d09('0x18')]();queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0x32')]=utils[_0x3d09('0x18')]();queues[_0x1ca090['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x1ca090['transfertargetuniqueid']][_0x3d09('0x5f')]=0x0;utils[_0x3d09('0x0')](util['format'](_0x3d09('0x60'),_0x1ca090[_0x3d09('0x4c')],queues[_0x1ca090[_0x3d09('0x54')]]['name'],queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0xb')],queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0x55')],queues[_0x1ca090[_0x3d09('0x54')]][_0x3d09('0x56')]));}else{utils['info'](util[_0x3d09('0xe')](_0x3d09('0x59'),_0x1ca090['origtransfereruniqueid'],queues[_0x1ca090[_0x3d09('0x4f')]]['name'],_0x1ca090[_0x3d09('0x4d')]));queues[_0x1ca090[_0x3d09('0x4f')]][_0x3d09('0xb')]=_0x1ca090['origtransfererlinkedid'];}}}}catch(_0x35596a){utils[_0x3d09('0x1d')](util[_0x3d09('0xe')]('[%s][queues][attendedtransfer]',_0x1ca090['origtransfereruniqueid']),_0x35596a);}};exports[_0x3d09('0x61')]=function(_0x1fb41b){try{if(!_['isNil'](queues[_0x1fb41b[_0x3d09('0x2')]])){utils[_0x3d09('0xd')](util[_0x3d09('0xe')](_0x3d09('0x62'),_0x1fb41b['uniqueid']),_0x1fb41b);queues[_0x1fb41b[_0x3d09('0x2')]]['musiconholdstartAt']=utils[_0x3d09('0x18')]();utils[_0x3d09('0x0')](util[_0x3d09('0xe')](_0x3d09('0x63'),_0x1fb41b[_0x3d09('0x2')],queues[_0x1fb41b[_0x3d09('0x2')]][_0x3d09('0x1b')],queues[_0x1fb41b[_0x3d09('0x2')]][_0x3d09('0x64')]));}}catch(_0x484c01){utils[_0x3d09('0x1d')](util[_0x3d09('0xe')]('[%s][queues][musiconholdstart]',_0x1fb41b['uniqueid']),_0x484c01);}};exports[_0x3d09('0x65')]=function(_0xbb3751){try{if(!_[_0x3d09('0x14')](queues[_0xbb3751[_0x3d09('0x2')]])){if(!_[_0x3d09('0x14')](queues[_0xbb3751['uniqueid']][_0x3d09('0x64')])){utils[_0x3d09('0xd')](util[_0x3d09('0xe')](_0x3d09('0x66'),_0xbb3751['uniqueid']),_0xbb3751);queues[_0xbb3751[_0x3d09('0x2')]]['mohtime']+=utils[_0x3d09('0x33')](utils[_0x3d09('0x18')](),queues[_0xbb3751[_0x3d09('0x2')]]['musiconholdstartAt']);utils['info'](util[_0x3d09('0xe')](_0x3d09('0x67'),_0xbb3751[_0x3d09('0x2')],queues[_0xbb3751[_0x3d09('0x2')]]['name'],queues[_0xbb3751[_0x3d09('0x2')]]['mohtime']));delete queues[_0xbb3751[_0x3d09('0x2')]][_0x3d09('0x64')];}}}catch(_0x8e9cce){utils[_0x3d09('0x1d')](util[_0x3d09('0xe')](_0x3d09('0x66'),_0xbb3751['uniqueid']),_0x8e9cce);}};
\ No newline at end of file
+var _0xac8b=['[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','debug','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','ABANDONED','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','queuecallerjoinAt','connectedlinename','error','agentconnect','[%s][queues][agentconnect]'];(function(_0x2ad96f,_0x57e1c0){var _0x2418a5=function(_0x339d41){while(--_0x339d41){_0x2ad96f['push'](_0x2ad96f['shift']());}};_0x2418a5(++_0x57e1c0);}(_0xac8b,0x1b9));var _0xbac8=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xac8b[_0xac151d];return _0x111dba;};'use strict';var _=require('lodash');var util=require(_0xbac8('0x0'));var utils=require(_0xbac8('0x1'));var queues={};function writeDB(_0x750f09){utils['info'](util[_0xbac8('0x2')](_0xbac8('0x3'),_0x750f09[_0xbac8('0x4')],_0x750f09[_0xbac8('0x5')],_0x750f09[_0xbac8('0x6')],_0x750f09[_0xbac8('0x7')],_0x750f09[_0xbac8('0x8')],_0x750f09[_0xbac8('0x9')],_0x750f09[_0xbac8('0xa')]));if(_0x750f09['queue']){utils['getVoiceQueueByName'](_0x750f09[_0xbac8('0x6')])[_0xbac8('0xb')](function(_0x2fcfae){if(_0x2fcfae){_0x750f09[_0xbac8('0xc')]=_0x2fcfae[_0xbac8('0xc')];}utils[_0xbac8('0xd')]('CreateVoiceQueueReport',_0x750f09);});}else{utils[_0xbac8('0xd')](_0xbac8('0xe'),_0x750f09);}if(_0x750f09[_0xbac8('0xf')]){delete queues[_0x750f09[_0xbac8('0xf')]];}else{delete queues[_0x750f09[_0xbac8('0x4')]];}}exports[_0xbac8('0x10')]=function(_0xc0b140){try{utils['debug'](util[_0xbac8('0x2')](_0xbac8('0x11'),_0xc0b140[_0xbac8('0x4')]),_0xc0b140);utils[_0xbac8('0x12')](util[_0xbac8('0x2')](_0xbac8('0x13'),_0xc0b140[_0xbac8('0x4')],_0xc0b140[_0xbac8('0x6')],_0xc0b140[_0xbac8('0x14')]));queues[_0xc0b140[_0xbac8('0x4')]]=_[_0xbac8('0x15')](_0xc0b140,{'originalposition':_0xc0b140[_0xbac8('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x47cc85){utils['error'](util[_0xbac8('0x2')](_0xbac8('0x11'),_0xc0b140[_0xbac8('0x4')]),_0x47cc85);}};exports[_0xbac8('0x16')]=function(_0x410cca){try{if(!_[_0xbac8('0x17')](queues[_0x410cca['uniqueid']])){utils['debug'](util[_0xbac8('0x2')](_0xbac8('0x18'),_0x410cca[_0xbac8('0x4')]),_0x410cca);if(queues[_0x410cca[_0xbac8('0x4')]][_0xbac8('0x19')]){if(!queues[_0x410cca['uniqueid']][_0xbac8('0x1a')]&&!queues[_0x410cca[_0xbac8('0x4')]][_0xbac8('0x1b')]){queues[_0x410cca[_0xbac8('0x4')]][_0xbac8('0x1c')]=!![];queues[_0x410cca[_0xbac8('0x4')]][_0xbac8('0x1d')]=utils['now']();queues[_0x410cca[_0xbac8('0x4')]][_0xbac8('0xa')]=_0xbac8('0x1e');}utils[_0xbac8('0x12')](util[_0xbac8('0x2')](_0xbac8('0x1f'),_0x410cca[_0xbac8('0x4')],queues[_0x410cca['uniqueid']][_0xbac8('0x20')],queues[_0x410cca[_0xbac8('0x4')]][_0xbac8('0xa')]));writeDB(queues[_0x410cca[_0xbac8('0x4')]]);}else if(queues[_0x410cca[_0xbac8('0x4')]]['transfereduniqueid']){utils[_0xbac8('0x12')](util[_0xbac8('0x2')](_0xbac8('0x21'),_0x410cca[_0xbac8('0x4')],queues[_0x410cca['uniqueid']]['name'],queues[_0x410cca['uniqueid']][_0xbac8('0xf')]));queues[queues[_0x410cca[_0xbac8('0x4')]]['transfereduniqueid']]=queues[_0x410cca[_0xbac8('0x4')]];queues[queues[_0x410cca['uniqueid']][_0xbac8('0xf')]][_0xbac8('0x22')]=0x2;delete queues[_0x410cca[_0xbac8('0x4')]];}}}catch(_0xaa35cf){utils['error'](util[_0xbac8('0x2')](_0xbac8('0x18'),_0x410cca[_0xbac8('0x4')]),_0xaa35cf);}};exports['varset']=function(_0x5d1f6d){try{utils[_0xbac8('0x23')](util[_0xbac8('0x2')](_0xbac8('0x24'),_0x5d1f6d['uniqueid']),_0x5d1f6d);if(!_['isNil'](_0x5d1f6d[_0xbac8('0x25')][_0xbac8('0x26')])&&_0x5d1f6d[_0xbac8('0x27')][_0xbac8('0x28')]()!==_0xbac8('0x29')){if(!_[_0xbac8('0x17')](queues[_0x5d1f6d[_0xbac8('0x4')]])){queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x1a')]=![];queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x2a')]=null;queues[_0x5d1f6d['uniqueid']][_0xbac8('0x1b')]=!![];queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x2b')]=utils[_0xbac8('0x2c')]();queues[_0x5d1f6d[_0xbac8('0x4')]]['queuecallerexitreason']=_0x5d1f6d[_0xbac8('0x27')][_0xbac8('0x28')]();utils['info'](util[_0xbac8('0x2')](_0xbac8('0x2d'),_0x5d1f6d['uniqueid'],queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x20')],_0x5d1f6d[_0xbac8('0x27')],queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0xa')]));writeDB(queues[_0x5d1f6d['uniqueid']]);}}else if(!_[_0xbac8('0x17')](_0x5d1f6d[_0xbac8('0x25')]['queueposition'])){if(!_[_0xbac8('0x17')](queues[_0x5d1f6d[_0xbac8('0x4')]])&&!queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x1a')]){queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x1a')]=![];queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x2a')]=null;queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x1b')]=!![];queues[_0x5d1f6d['uniqueid']][_0xbac8('0x2b')]=utils['now']();queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0xa')]=_0xbac8('0x2e');utils[_0xbac8('0x12')](util[_0xbac8('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5d1f6d[_0xbac8('0x4')],queues[_0x5d1f6d[_0xbac8('0x4')]][_0xbac8('0x20')],_0x5d1f6d[_0xbac8('0x27')],queues[_0x5d1f6d['uniqueid']]['queuecallerexitreason']));}}}catch(_0x22ed72){utils['error'](util[_0xbac8('0x2')](_0xbac8('0x24'),_0x5d1f6d['uniqueid']),_0x22ed72);}};exports['queuecallerabandon']=function(_0x4bf3ce){try{if(!_[_0xbac8('0x17')](queues[_0x4bf3ce['uniqueid']])){utils[_0xbac8('0x23')](util[_0xbac8('0x2')]('[%s][queues][queuecallerabandon]',_0x4bf3ce['uniqueid']),_0x4bf3ce);queues[_0x4bf3ce[_0xbac8('0x4')]][_0xbac8('0x1b')]=![];queues[_0x4bf3ce[_0xbac8('0x4')]]['queuecallerexitAt']=null;queues[_0x4bf3ce[_0xbac8('0x4')]]['queuecallerabandon']=!![];queues[_0x4bf3ce[_0xbac8('0x4')]][_0xbac8('0x2a')]=utils[_0xbac8('0x2c')]();queues[_0x4bf3ce[_0xbac8('0x4')]][_0xbac8('0xa')]=_0xbac8('0x2f');utils[_0xbac8('0x12')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x4bf3ce[_0xbac8('0x4')],queues[_0x4bf3ce['uniqueid']][_0xbac8('0x20')],queues[_0x4bf3ce[_0xbac8('0x4')]][_0xbac8('0xa')]));}}catch(_0x4480a4){utils['error'](util['format'](_0xbac8('0x30'),_0x4bf3ce['uniqueid']),_0x4480a4);}};exports[_0xbac8('0x31')]=function(_0x1bfbb5){try{if(!_['isNil'](queues[_0x1bfbb5['uniqueid']])){utils[_0xbac8('0x23')](util[_0xbac8('0x2')](_0xbac8('0x32'),_0x1bfbb5[_0xbac8('0x4')]),_0x1bfbb5);utils[_0xbac8('0x12')](util['format'](_0xbac8('0x33'),_0x1bfbb5['uniqueid'],queues[_0x1bfbb5[_0xbac8('0x4')]][_0xbac8('0x20')],_0x1bfbb5[_0xbac8('0x34')],_0x1bfbb5['connectedlinename']));queues[_0x1bfbb5['uniqueid']]['queuecallerleave']=!![];queues[_0x1bfbb5[_0xbac8('0x4')]]['queuecallerleaveAt']=utils['now']();queues[_0x1bfbb5[_0xbac8('0x4')]]['holdtime']=utils[_0xbac8('0x35')](queues[_0x1bfbb5[_0xbac8('0x4')]][_0xbac8('0x19')],queues[_0x1bfbb5[_0xbac8('0x4')]][_0xbac8('0x36')]);queues[_0x1bfbb5[_0xbac8('0x4')]][_0xbac8('0x14')]=_0x1bfbb5['position'];queues[_0x1bfbb5['uniqueid']]['count']=_0x1bfbb5['count'];queues[_0x1bfbb5['uniqueid']]['connectedlinenum']=_0x1bfbb5[_0xbac8('0x34')];queues[_0x1bfbb5['uniqueid']][_0xbac8('0x37')]=_0x1bfbb5[_0xbac8('0x37')];}}catch(_0x69feb2){utils[_0xbac8('0x38')](util[_0xbac8('0x2')](_0xbac8('0x32'),_0x1bfbb5['uniqueid']),_0x69feb2);}};exports[_0xbac8('0x39')]=function(_0x485d27){try{if(!_[_0xbac8('0x17')](queues[_0x485d27[_0xbac8('0x4')]])){utils['debug'](util['format'](_0xbac8('0x3a'),_0x485d27[_0xbac8('0x4')]),_0x485d27);utils[_0xbac8('0x12')](util[_0xbac8('0x2')](_0xbac8('0x3b'),_0x485d27[_0xbac8('0x4')],queues[_0x485d27[_0xbac8('0x4')]]['name'],_0x485d27[_0xbac8('0x3c')],_0x485d27[_0xbac8('0x3d')]));queues[_0x485d27[_0xbac8('0x4')]][_0xbac8('0x1a')]=![];queues[_0x485d27[_0xbac8('0x4')]][_0xbac8('0x1a')]=![];queues[_0x485d27[_0xbac8('0x4')]][_0xbac8('0x2a')]=null;queues[_0x485d27['uniqueid']][_0xbac8('0x1b')]=![];queues[_0x485d27[_0xbac8('0x4')]][_0xbac8('0xa')]=null;queues[_0x485d27[_0xbac8('0x4')]][_0xbac8('0x2b')]=null;queues[_0x485d27[_0xbac8('0x4')]][_0xbac8('0x3e')]=!![];queues[_0x485d27[_0xbac8('0x4')]][_0xbac8('0x9')]=_0x485d27[_0xbac8('0x3d')];queues[_0x485d27['uniqueid']][_0xbac8('0x7')]=_0x485d27[_0xbac8('0x3c')];}}catch(_0x38b158){utils[_0xbac8('0x38')](util[_0xbac8('0x2')]('[%s][queues][agentconnect]',_0x485d27['uniqueid']),_0x38b158);}};exports['agentcomplete']=function(_0x562d58){try{if(!_[_0xbac8('0x17')](queues[_0x562d58[_0xbac8('0x4')]])){if(queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0x19')]){utils[_0xbac8('0x23')](util['format']('[%s][queues][agentcomplete]',_0x562d58[_0xbac8('0x4')]),_0x562d58);queues[_0x562d58[_0xbac8('0x4')]]['queuecallerabandon']=![];queues[_0x562d58[_0xbac8('0x4')]]['queuecallerabandon']=![];queues[_0x562d58['uniqueid']][_0xbac8('0x2a')]=null;queues[_0x562d58['uniqueid']]['queuecallerexit']=![];queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0x2b')]=null;queues[_0x562d58['uniqueid']][_0xbac8('0x3e')]=!![];queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0x7')]=_0x562d58[_0xbac8('0x3c')];queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0x1c')]=!![];queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0x1d')]=utils[_0xbac8('0x2c')]();if(_0x562d58[_0xbac8('0x3f')]=='transfer'){if(!queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0x40')]){queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0xa')]='TRANSFER';}}else{queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0xa')]=_0xbac8('0x41')+_0x562d58[_0xbac8('0x3f')][_0xbac8('0x28')]();}utils[_0xbac8('0x12')](util[_0xbac8('0x2')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x562d58['uniqueid'],queues[_0x562d58[_0xbac8('0x4')]][_0xbac8('0x20')],_0x562d58['membername'],queues[_0x562d58['uniqueid']][_0xbac8('0xa')]));writeDB(queues[_0x562d58[_0xbac8('0x4')]]);}}}catch(_0x5c9a8c){utils[_0xbac8('0x38')](util['format'](_0xbac8('0x42'),_0x562d58[_0xbac8('0x4')]),_0x5c9a8c);}};exports[_0xbac8('0x43')]=function(_0x5993a9){try{if(!_[_0xbac8('0x17')](queues[_0x5993a9[_0xbac8('0x44')]])){utils[_0xbac8('0x23')](util[_0xbac8('0x2')](_0xbac8('0x45'),_0x5993a9[_0xbac8('0x4')]),_0x5993a9);queues[_0x5993a9[_0xbac8('0x44')]][_0xbac8('0x40')]=!![];queues[_0x5993a9[_0xbac8('0x44')]][_0xbac8('0x46')]=_0xbac8('0x47');queues[_0x5993a9[_0xbac8('0x44')]][_0xbac8('0x48')]=_0x5993a9[_0xbac8('0x49')];queues[_0x5993a9[_0xbac8('0x44')]]['transferuniqueid']=_0x5993a9[_0xbac8('0x44')];queues[_0x5993a9[_0xbac8('0x44')]][_0xbac8('0xa')]=_0xbac8('0x4a');utils[_0xbac8('0x12')](util[_0xbac8('0x2')](_0xbac8('0x4b'),_0x5993a9[_0xbac8('0x4')],queues[_0x5993a9[_0xbac8('0x44')]][_0xbac8('0x20')],_0x5993a9[_0xbac8('0x44')],_0x5993a9[_0xbac8('0x49')]));}}catch(_0x596aa7){utils[_0xbac8('0x38')](util[_0xbac8('0x2')](_0xbac8('0x45'),_0x5993a9[_0xbac8('0x4')]),_0x596aa7);}};exports['attendedtransfer']=function(_0x64ca5a){try{utils[_0xbac8('0x23')](util[_0xbac8('0x2')](_0xbac8('0x4c'),_0x64ca5a[_0xbac8('0x4d')]),_0x64ca5a);if(_0x64ca5a[_0xbac8('0x4d')]==_0x64ca5a[_0xbac8('0x4e')]){if(!_[_0xbac8('0x17')](queues[_0x64ca5a[_0xbac8('0x4f')]])){utils[_0xbac8('0x12')](util[_0xbac8('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x64ca5a[_0xbac8('0x4d')],queues[_0x64ca5a[_0xbac8('0x4f')]][_0xbac8('0x20')],_0x64ca5a[_0xbac8('0x50')]));queues[_0x64ca5a['secondtransfererlinkedid']][_0xbac8('0x40')]=!![];queues[_0x64ca5a['secondtransfererlinkedid']][_0xbac8('0x46')]=_0xbac8('0x51');queues[_0x64ca5a[_0xbac8('0x4f')]][_0xbac8('0x48')]=_0x64ca5a[_0xbac8('0x50')];queues[_0x64ca5a[_0xbac8('0x4f')]]['transferuniqueid']=_0x64ca5a['origtransfereruniqueid'];queues[_0x64ca5a[_0xbac8('0x4f')]][_0xbac8('0xa')]=_0xbac8('0x52');}if(!_[_0xbac8('0x17')](queues[_0x64ca5a[_0xbac8('0x4e')]])){if(_0x64ca5a[_0xbac8('0x53')]&&queues[_0x64ca5a[_0xbac8('0x53')]]){queues[_0x64ca5a[_0xbac8('0x53')]][_0xbac8('0x22')]=0x1;queues[_0x64ca5a[_0xbac8('0x44')]]=_[_0xbac8('0x54')](queues[_0x64ca5a[_0xbac8('0x53')]]);queues[_0x64ca5a[_0xbac8('0x44')]][_0xbac8('0xf')]=_0x64ca5a[_0xbac8('0x55')];queues[_0x64ca5a['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x64ca5a['transfereeuniqueid']]['calleridnum']=queues[_0x64ca5a['secondtransfererlinkedid']][_0xbac8('0x8')];queues[_0x64ca5a[_0xbac8('0x44')]][_0xbac8('0x56')]=queues[_0x64ca5a[_0xbac8('0x4f')]][_0xbac8('0x56')];queues[_0x64ca5a[_0xbac8('0x44')]][_0xbac8('0x36')]=utils[_0xbac8('0x2c')]();queues[_0x64ca5a['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0xbac8('0x2c')]();queues[_0x64ca5a[_0xbac8('0x44')]][_0xbac8('0x57')]=0x0;queues[_0x64ca5a[_0xbac8('0x44')]]['mohtime']=0x0;utils['info'](util[_0xbac8('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x64ca5a[_0xbac8('0x4d')],queues[_0x64ca5a[_0xbac8('0x44')]][_0xbac8('0x20')],queues[_0x64ca5a[_0xbac8('0x44')]]['calleridnum'],queues[_0x64ca5a[_0xbac8('0x44')]][_0xbac8('0x56')]));}else{utils['info'](util[_0xbac8('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x64ca5a[_0xbac8('0x4d')],queues[_0x64ca5a[_0xbac8('0x4e')]]['name'],_0x64ca5a[_0xbac8('0x4f')]));queues[_0x64ca5a['origtransfererlinkedid']][_0xbac8('0xf')]=_0x64ca5a['secondtransfererlinkedid'];}}}else if(_0x64ca5a[_0xbac8('0x58')]==_0x64ca5a[_0xbac8('0x4f')]){if(!_[_0xbac8('0x17')](queues[_0x64ca5a[_0xbac8('0x4e')]])){utils[_0xbac8('0x12')](util[_0xbac8('0x2')](_0xbac8('0x59'),_0x64ca5a[_0xbac8('0x4d')],queues[_0x64ca5a['origtransfererlinkedid']][_0xbac8('0x20')],_0x64ca5a['secondtransfereruniqueid'],_0x64ca5a['secondtransfererexten']));queues[_0x64ca5a['origtransfererlinkedid']][_0xbac8('0x40')]=!![];queues[_0x64ca5a[_0xbac8('0x4e')]][_0xbac8('0x46')]=_0xbac8('0x51');queues[_0x64ca5a[_0xbac8('0x4e')]]['transferexten']=_0x64ca5a[_0xbac8('0x5a')];queues[_0x64ca5a[_0xbac8('0x4e')]]['transferuniqueid']=_0x64ca5a[_0xbac8('0x58')];queues[_0x64ca5a[_0xbac8('0x4e')]][_0xbac8('0xa')]=_0xbac8('0x52');}if(!_[_0xbac8('0x17')](queues[_0x64ca5a[_0xbac8('0x4f')]])){if(_0x64ca5a[_0xbac8('0x5b')]&&queues[_0x64ca5a[_0xbac8('0x5b')]]){queues[_0x64ca5a[_0xbac8('0x5b')]][_0xbac8('0x22')]=0x1;queues[_0x64ca5a[_0xbac8('0x55')]]=_[_0xbac8('0x54')](queues[_0x64ca5a[_0xbac8('0x5b')]]);queues[_0x64ca5a['transfertargetuniqueid']]['transfereduniqueid']=_0x64ca5a[_0xbac8('0x55')];queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x22')]=0x2;queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x8')]=queues[_0x64ca5a[_0xbac8('0x4e')]][_0xbac8('0x8')];queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x56')]=queues[_0x64ca5a[_0xbac8('0x4e')]][_0xbac8('0x56')];queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x36')]=utils[_0xbac8('0x2c')]();queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x19')]=utils[_0xbac8('0x2c')]();queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x57')]=0x0;queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x5c')]=0x0;utils['info'](util[_0xbac8('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x64ca5a[_0xbac8('0x4d')],queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x20')],queues[_0x64ca5a['transfertargetuniqueid']][_0xbac8('0xf')],queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x8')],queues[_0x64ca5a[_0xbac8('0x55')]][_0xbac8('0x56')]));}else{utils['info'](util[_0xbac8('0x2')](_0xbac8('0x5d'),_0x64ca5a[_0xbac8('0x4d')],queues[_0x64ca5a[_0xbac8('0x4f')]][_0xbac8('0x20')],_0x64ca5a['origtransfererlinkedid']));queues[_0x64ca5a['secondtransfererlinkedid']]['transfereduniqueid']=_0x64ca5a[_0xbac8('0x4e')];}}}}catch(_0x3dbda6){utils[_0xbac8('0x38')](util['format'](_0xbac8('0x4c'),_0x64ca5a['origtransfereruniqueid']),_0x3dbda6);}};exports[_0xbac8('0x5e')]=function(_0x7d7a31){try{if(!_[_0xbac8('0x17')](queues[_0x7d7a31[_0xbac8('0x4')]])){utils['debug'](util['format'](_0xbac8('0x5f'),_0x7d7a31['uniqueid']),_0x7d7a31);queues[_0x7d7a31[_0xbac8('0x4')]][_0xbac8('0x60')]=utils[_0xbac8('0x2c')]();utils['info'](util[_0xbac8('0x2')](_0xbac8('0x61'),_0x7d7a31[_0xbac8('0x4')],queues[_0x7d7a31[_0xbac8('0x4')]][_0xbac8('0x20')],queues[_0x7d7a31['uniqueid']][_0xbac8('0x60')]));}}catch(_0x69460d){utils['error'](util[_0xbac8('0x2')](_0xbac8('0x5f'),_0x7d7a31[_0xbac8('0x4')]),_0x69460d);}};exports['musiconholdstop']=function(_0x258059){try{if(!_[_0xbac8('0x17')](queues[_0x258059[_0xbac8('0x4')]])){if(!_['isNil'](queues[_0x258059[_0xbac8('0x4')]][_0xbac8('0x60')])){utils[_0xbac8('0x23')](util['format'](_0xbac8('0x62'),_0x258059[_0xbac8('0x4')]),_0x258059);queues[_0x258059['uniqueid']]['mohtime']+=utils[_0xbac8('0x35')](utils[_0xbac8('0x2c')](),queues[_0x258059[_0xbac8('0x4')]][_0xbac8('0x60')]);utils[_0xbac8('0x12')](util['format'](_0xbac8('0x63'),_0x258059[_0xbac8('0x4')],queues[_0x258059[_0xbac8('0x4')]][_0xbac8('0x20')],queues[_0x258059[_0xbac8('0x4')]][_0xbac8('0x5c')]));delete queues[_0x258059['uniqueid']][_0xbac8('0x60')];}}}catch(_0x5acf30){utils['error'](util[_0xbac8('0x2')](_0xbac8('0x62'),_0x258059['uniqueid']),_0x5acf30);}};
\ No newline at end of file
index 80cee1f..e6c2152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7209=['name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','application','set','startsWith','appdata','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7209,0x164));var _0x9720=function(_0x10bda8,_0x1090dc){_0x10bda8=_0x10bda8-0x0;var _0x5c5448=_0x7209[_0x10bda8];return _0x5c5448;};'use strict';var _=require('lodash');var util=require(_0x9720('0x0'));var utils=require(_0x9720('0x1'));var recordings={};function writeDB(_0x52e2ed){utils[_0x9720('0x2')](util[_0x9720('0x3')](_0x9720('0x4'),_0x52e2ed[_0x9720('0x5')]));if(_0x52e2ed[_0x9720('0x6')]){utils[_0x9720('0x7')](_0x52e2ed[_0x9720('0x6')])[_0x9720('0x8')](function(_0x3694bc){if(_0x3694bc){_0x52e2ed[_0x9720('0x9')]=_0x3694bc[_0x9720('0xa')];_0x52e2ed[_0x9720('0xb')]=_0x3694bc['id'];}utils[_0x9720('0xc')](_0x9720('0xd'),_0x52e2ed);});}else{utils['request'](_0x9720('0xd'),_0x52e2ed);}}exports['newchannel']=function(_0x1837c9){try{utils[_0x9720('0xe')](util[_0x9720('0x3')](_0x9720('0xf'),_0x1837c9[_0x9720('0x5')]),_0x1837c9);if(_0x1837c9['uniqueid']==_0x1837c9[_0x9720('0x10')]){utils[_0x9720('0x2')](util[_0x9720('0x3')](_0x9720('0x11'),_0x1837c9[_0x9720('0x5')],_0x1837c9[_0x9720('0x12')],_0x1837c9[_0x9720('0x13')]));recordings[_0x1837c9[_0x9720('0x5')]]={'uniqueid':_0x1837c9[_0x9720('0x5')],'accountcode':_0x1837c9[_0x9720('0x6')],'exten':_0x1837c9[_0x9720('0x13')],'context':_0x1837c9[_0x9720('0x12')],'channel':_0x1837c9[_0x9720('0x14')],'monitors':[]};}}catch(_0x1069dd){utils['error'](util['format']('[%s][recordings][newchannel]',_0x1837c9[_0x9720('0x5')]),_0x1069dd);}};exports[_0x9720('0x15')]=function(_0x5d064a){try{utils[_0x9720('0xe')](util['format'](_0x9720('0x16'),_0x5d064a[_0x9720('0x5')]),_0x5d064a);if(!_[_0x9720('0x17')](recordings[_0x5d064a['uniqueid']])&&_0x5d064a['channelstate']==0x6){utils[_0x9720('0x2')](util[_0x9720('0x3')](_0x9720('0x18'),_0x5d064a[_0x9720('0x5')],_0x5d064a['context'],_0x5d064a[_0x9720('0x14')]));}else if(!_['isNil'](recordings[_0x5d064a['linkedid']])&&_0x5d064a[_0x9720('0x19')]==0x6&&_0x5d064a[_0x9720('0x12')]!=_0x9720('0x1a')){utils['info'](util['format'](_0x9720('0x1b'),_0x5d064a['uniqueid'],_0x5d064a[_0x9720('0x10')],_0x5d064a[_0x9720('0x12')],_0x5d064a[_0x9720('0x14')]));recordings[_0x5d064a[_0x9720('0x10')]][_0x9720('0x6')]=_0x5d064a[_0x9720('0x6')];}}catch(_0xa8f268){utils[_0x9720('0x1c')](util['format'](_0x9720('0x16'),_0x5d064a[_0x9720('0x5')]),_0xa8f268);}};exports[_0x9720('0x1d')]=function(_0x3cc75f){try{if(!_['isNil'](_0x3cc75f[_0x9720('0x1e')])&&!_[_0x9720('0x17')](_0x3cc75f[_0x9720('0x1e')][_0x9720('0x1f')])){utils[_0x9720('0xe')](util[_0x9720('0x3')](_0x9720('0x20'),_0x3cc75f['uniqueid']),_0x3cc75f);utils[_0x9720('0x2')](util['format'](_0x9720('0x21'),_0x3cc75f['uniqueid'],_0x3cc75f[_0x9720('0x1e')],_0x3cc75f[_0x9720('0x22')]));if(_['endsWith'](_0x3cc75f[_0x9720('0x22')],_0x9720('0x23'))){_0x3cc75f['value']=_0x3cc75f[_0x9720('0x22')]['replace'](_0x9720('0x23'),_0x9720('0x24'));}if(recordings[_0x3cc75f[_0x9720('0x10')]]){var _0x23b532=_[_0x9720('0x25')](recordings[_0x3cc75f[_0x9720('0x10')]][_0x9720('0x26')],{'value':_0x3cc75f[_0x9720('0x22')]});if(_[_0x9720('0x17')](_0x23b532)){recordings[_0x3cc75f['linkedid']][_0x9720('0x26')]['push']({'value':_0x3cc75f[_0x9720('0x22')]});}}}}catch(_0x8b0e71){utils[_0x9720('0x1c')](util['format'](_0x9720('0x20'),_0x3cc75f[_0x9720('0x5')]),_0x8b0e71);}};exports['hangup']=function(_0x53721a){try{if(!_[_0x9720('0x17')](recordings[_0x53721a[_0x9720('0x5')]])){utils['debug'](util[_0x9720('0x3')]('[%s][recordings][hangup]',_0x53721a['uniqueid']),_0x53721a);utils[_0x9720('0x2')](util[_0x9720('0x3')](_0x9720('0x27'),_0x53721a[_0x9720('0x5')],_0x53721a[_0x9720('0x28')],_0x53721a['calleridname'],_0x53721a[_0x9720('0x29')]));recordings[_0x53721a[_0x9720('0x5')]][_0x9720('0x28')]=_0x53721a['calleridnum'];recordings[_0x53721a[_0x9720('0x5')]][_0x9720('0x2a')]=_0x53721a[_0x9720('0x2a')];recordings[_0x53721a['uniqueid']][_0x9720('0x2b')]=_0x53721a[_0x9720('0x2b')];recordings[_0x53721a[_0x9720('0x5')]][_0x9720('0x2c')]=_0x53721a[_0x9720('0x2c')];if(recordings[_0x53721a['uniqueid']][_0x9720('0x2d')]=='outbound'&&recordings[_0x53721a[_0x9720('0x5')]]['accountcode']){recordings[_0x53721a[_0x9720('0x5')]]['connectedlinenum']=recordings[_0x53721a[_0x9720('0x5')]][_0x9720('0x6')];recordings[_0x53721a[_0x9720('0x5')]][_0x9720('0x2c')]='';}recordings[_0x53721a[_0x9720('0x5')]][_0x9720('0x26')][_0x9720('0x2e')](function(_0x3af2c5){var _0x1aa834=_[_0x9720('0x2f')](recordings[_0x53721a['uniqueid']]);_0x1aa834[_0x9720('0x22')]=_0x3af2c5[_0x9720('0x22')];writeDB(_0x1aa834);});delete recordings[_0x53721a[_0x9720('0x5')]];}}catch(_0x512eb5){utils[_0x9720('0x1c')](util[_0x9720('0x3')]('[%s][recordings][hangup]',_0x53721a[_0x9720('0x5')]),_0x512eb5);}};exports[_0x9720('0x30')]=function(_0xafd9b1){try{if(!_['isNil'](recordings[_0xafd9b1[_0x9720('0x5')]])){utils[_0x9720('0xe')](util[_0x9720('0x3')](_0x9720('0x31'),_0xafd9b1[_0x9720('0x5')]),_0xafd9b1);utils['info'](util[_0x9720('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0xafd9b1[_0x9720('0x5')],_0xafd9b1[_0x9720('0x32')],_0xafd9b1['appdata']));if(_0xafd9b1['application']['toLowerCase']()==_0x9720('0x33')&&_[_0x9720('0x34')](_0xafd9b1[_0x9720('0x35')]['toLowerCase'](),_0x9720('0x36'))){var _0x39d791=_0xafd9b1[_0x9720('0x35')][_0x9720('0x37')]('=');var _0x27b456=_0x39d791[0x0]['substring'](_0x39d791[0x0][_0x9720('0x38')]('(')+0x1,_0x39d791[0x0][_0x9720('0x38')](')'));var _0x7e76a=_0x39d791[0x1];recordings[_0xafd9b1['uniqueid']][_0x27b456]=_0x7e76a;}}}catch(_0x4a8908){utils[_0x9720('0x1c')](util['format'](_0x9720('0x31'),_0xafd9b1[_0x9720('0x5')]),_0x4a8908);}};exports[_0x9720('0x39')]=function(_0xfa6bc6){try{if(!_[_0x9720('0x17')](recordings[_0xfa6bc6[_0x9720('0x5')]])){utils['debug'](util[_0x9720('0x3')]('[%s][recordings][queuecallerjoin]',_0xfa6bc6['uniqueid']),_0xfa6bc6);utils['info'](util[_0x9720('0x3')](_0x9720('0x3a'),_0xfa6bc6[_0x9720('0x5')],_0xfa6bc6[_0x9720('0x3b')]));recordings[_0xfa6bc6[_0x9720('0x5')]]['queue']=_0xfa6bc6['queue'];}}catch(_0x8338cf){utils[_0x9720('0x1c')](util[_0x9720('0x3')](_0x9720('0x3c'),_0xfa6bc6['uniqueid']),_0x8338cf);}};
\ No newline at end of file
+var _0x05c2=['newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','[%s][recordings][queuecallerjoin]','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinename','type','forEach'];(function(_0x463a6e,_0x1b47b5){var _0x51d8c6=function(_0x21f507){while(--_0x21f507){_0x463a6e['push'](_0x463a6e['shift']());}};_0x51d8c6(++_0x1b47b5);}(_0x05c2,0x169));var _0x205c=function(_0x5d5ba7,_0x1fb751){_0x5d5ba7=_0x5d5ba7-0x0;var _0x3ab73c=_0x05c2[_0x5d5ba7];return _0x3ab73c;};'use strict';var _=require(_0x205c('0x0'));var util=require('util');var utils=require(_0x205c('0x1'));var recordings={};function writeDB(_0x1fb12f){utils[_0x205c('0x2')](util[_0x205c('0x3')](_0x205c('0x4'),_0x1fb12f[_0x205c('0x5')]));if(_0x1fb12f[_0x205c('0x6')]){utils[_0x205c('0x7')](_0x1fb12f[_0x205c('0x6')])['then'](function(_0xb2a67b){if(_0xb2a67b){_0x1fb12f['membername']=_0xb2a67b[_0x205c('0x8')];_0x1fb12f['UserId']=_0xb2a67b['id'];}utils[_0x205c('0x9')](_0x205c('0xa'),_0x1fb12f);});}else{utils['request'](_0x205c('0xa'),_0x1fb12f);}}exports[_0x205c('0xb')]=function(_0x2e2e2f){try{utils[_0x205c('0xc')](util[_0x205c('0x3')]('[%s][recordings][newchannel]',_0x2e2e2f[_0x205c('0x5')]),_0x2e2e2f);if(_0x2e2e2f[_0x205c('0x5')]==_0x2e2e2f['linkedid']){utils['info'](util[_0x205c('0x3')](_0x205c('0xd'),_0x2e2e2f[_0x205c('0x5')],_0x2e2e2f[_0x205c('0xe')],_0x2e2e2f[_0x205c('0xf')]));recordings[_0x2e2e2f['uniqueid']]={'uniqueid':_0x2e2e2f[_0x205c('0x5')],'accountcode':_0x2e2e2f['accountcode'],'exten':_0x2e2e2f['exten'],'context':_0x2e2e2f[_0x205c('0xe')],'channel':_0x2e2e2f[_0x205c('0x10')],'monitors':[]};}}catch(_0x1618bb){utils[_0x205c('0x11')](util[_0x205c('0x3')](_0x205c('0x12'),_0x2e2e2f[_0x205c('0x5')]),_0x1618bb);}};exports[_0x205c('0x13')]=function(_0x3c2d5c){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x3c2d5c[_0x205c('0x5')]),_0x3c2d5c);if(!_[_0x205c('0x14')](recordings[_0x3c2d5c[_0x205c('0x5')]])&&_0x3c2d5c[_0x205c('0x15')]==0x6){utils[_0x205c('0x2')](util[_0x205c('0x3')](_0x205c('0x16'),_0x3c2d5c[_0x205c('0x5')],_0x3c2d5c[_0x205c('0xe')],_0x3c2d5c[_0x205c('0x10')]));}else if(!_[_0x205c('0x14')](recordings[_0x3c2d5c[_0x205c('0x17')]])&&_0x3c2d5c[_0x205c('0x15')]==0x6&&_0x3c2d5c['context']!=_0x205c('0x18')){utils[_0x205c('0x2')](util[_0x205c('0x3')](_0x205c('0x19'),_0x3c2d5c['uniqueid'],_0x3c2d5c[_0x205c('0x17')],_0x3c2d5c[_0x205c('0xe')],_0x3c2d5c[_0x205c('0x10')]));recordings[_0x3c2d5c[_0x205c('0x17')]][_0x205c('0x6')]=_0x3c2d5c[_0x205c('0x6')];}}catch(_0x596a1d){utils['error'](util[_0x205c('0x3')](_0x205c('0x1a'),_0x3c2d5c[_0x205c('0x5')]),_0x596a1d);}};exports[_0x205c('0x1b')]=function(_0x35e03b){try{if(!_[_0x205c('0x14')](_0x35e03b['variable'])&&!_[_0x205c('0x14')](_0x35e03b['variable'][_0x205c('0x1c')])){utils[_0x205c('0xc')](util[_0x205c('0x3')](_0x205c('0x1d'),_0x35e03b[_0x205c('0x5')]),_0x35e03b);utils['info'](util[_0x205c('0x3')](_0x205c('0x1e'),_0x35e03b[_0x205c('0x5')],_0x35e03b['variable'],_0x35e03b[_0x205c('0x1f')]));if(_['endsWith'](_0x35e03b[_0x205c('0x1f')],_0x205c('0x20'))){_0x35e03b[_0x205c('0x1f')]=_0x35e03b['value'][_0x205c('0x21')](_0x205c('0x20'),_0x205c('0x22'));}if(recordings[_0x35e03b[_0x205c('0x17')]]){var _0x1f4bc6=_['find'](recordings[_0x35e03b[_0x205c('0x17')]]['monitors'],{'value':_0x35e03b[_0x205c('0x1f')]});if(_[_0x205c('0x14')](_0x1f4bc6)){recordings[_0x35e03b[_0x205c('0x17')]][_0x205c('0x23')]['push']({'value':_0x35e03b[_0x205c('0x1f')]});}}}}catch(_0x5dab40){utils['error'](util[_0x205c('0x3')](_0x205c('0x1d'),_0x35e03b[_0x205c('0x5')]),_0x5dab40);}};exports[_0x205c('0x24')]=function(_0xb4c573){try{if(!_[_0x205c('0x14')](recordings[_0xb4c573[_0x205c('0x5')]])){utils[_0x205c('0xc')](util[_0x205c('0x3')](_0x205c('0x25'),_0xb4c573[_0x205c('0x5')]),_0xb4c573);utils[_0x205c('0x2')](util[_0x205c('0x3')](_0x205c('0x26'),_0xb4c573[_0x205c('0x5')],_0xb4c573[_0x205c('0x27')],_0xb4c573[_0x205c('0x28')],_0xb4c573[_0x205c('0x29')]));recordings[_0xb4c573['uniqueid']][_0x205c('0x27')]=_0xb4c573[_0x205c('0x27')];recordings[_0xb4c573[_0x205c('0x5')]]['calleridname']=_0xb4c573[_0x205c('0x28')];recordings[_0xb4c573[_0x205c('0x5')]]['connectedlinenum']=_0xb4c573['connectedlinenum'];recordings[_0xb4c573[_0x205c('0x5')]][_0x205c('0x2a')]=_0xb4c573[_0x205c('0x2a')];if(recordings[_0xb4c573[_0x205c('0x5')]][_0x205c('0x2b')]=='outbound'&&recordings[_0xb4c573['uniqueid']]['accountcode']){recordings[_0xb4c573['uniqueid']]['connectedlinenum']=recordings[_0xb4c573[_0x205c('0x5')]][_0x205c('0x6')];recordings[_0xb4c573[_0x205c('0x5')]]['connectedlinename']='';}recordings[_0xb4c573[_0x205c('0x5')]][_0x205c('0x23')][_0x205c('0x2c')](function(_0xa44e48){var _0xcbbc9f=_['clone'](recordings[_0xb4c573[_0x205c('0x5')]]);_0xcbbc9f['value']=_0xa44e48[_0x205c('0x1f')];writeDB(_0xcbbc9f);});delete recordings[_0xb4c573[_0x205c('0x5')]];}}catch(_0x5c6eff){utils['error'](util[_0x205c('0x3')](_0x205c('0x25'),_0xb4c573[_0x205c('0x5')]),_0x5c6eff);}};exports[_0x205c('0x2d')]=function(_0x239518){try{if(!_[_0x205c('0x14')](recordings[_0x239518['uniqueid']])){utils[_0x205c('0xc')](util[_0x205c('0x3')](_0x205c('0x2e'),_0x239518[_0x205c('0x5')]),_0x239518);utils['info'](util[_0x205c('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x239518[_0x205c('0x5')],_0x239518[_0x205c('0x2f')],_0x239518[_0x205c('0x30')]));if(_0x239518[_0x205c('0x2f')][_0x205c('0x31')]()=='set'&&_[_0x205c('0x32')](_0x239518[_0x205c('0x30')][_0x205c('0x31')](),_0x205c('0x33'))){var _0x204895=_0x239518['appdata'][_0x205c('0x34')]('=');var _0x58fe96=_0x204895[0x0][_0x205c('0x35')](_0x204895[0x0]['lastIndexOf']('(')+0x1,_0x204895[0x0][_0x205c('0x36')](')'));var _0x2bfccf=_0x204895[0x1];recordings[_0x239518[_0x205c('0x5')]][_0x58fe96]=_0x2bfccf;}}}catch(_0x242f5a){utils['error'](util['format'](_0x205c('0x2e'),_0x239518[_0x205c('0x5')]),_0x242f5a);}};exports[_0x205c('0x37')]=function(_0x22e40e){try{if(!_[_0x205c('0x14')](recordings[_0x22e40e[_0x205c('0x5')]])){utils[_0x205c('0xc')](util[_0x205c('0x3')]('[%s][recordings][queuecallerjoin]',_0x22e40e[_0x205c('0x5')]),_0x22e40e);utils['info'](util[_0x205c('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x22e40e['uniqueid'],_0x22e40e['queue']));recordings[_0x22e40e['uniqueid']][_0x205c('0x38')]=_0x22e40e[_0x205c('0x38')];}}catch(_0x1a3b2d){utils[_0x205c('0x11')](util[_0x205c('0x3')](_0x205c('0x39'),_0x22e40e[_0x205c('0x5')]),_0x1a3b2d);}};
\ No newline at end of file
index 4369a87..47309d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ca8=['transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transfereecalleridnum','transfereecalleridname'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x2ca8,0x1db));var _0x82ca=function(_0x537bcd,_0x13bae1){_0x537bcd=_0x537bcd-0x0;var _0x6cc881=_0x2ca8[_0x537bcd];return _0x6cc881;};'use strict';var _=require(_0x82ca('0x0'));var util=require(_0x82ca('0x1'));var utils=require('./utils');function writeDB(_0x280c3b){utils[_0x82ca('0x2')](util[_0x82ca('0x3')](_0x82ca('0x4'),_0x280c3b[_0x82ca('0x5')]==='attended'?_0x280c3b[_0x82ca('0x6')]:_0x280c3b['uniqueid'],_0x280c3b[_0x82ca('0x5')]));utils[_0x82ca('0x7')]('CreateVoiceTransferReport',_0x280c3b);}exports[_0x82ca('0x8')]={};exports[_0x82ca('0x9')]=function(_0x2a34a9){try{utils[_0x82ca('0xa')](util[_0x82ca('0x3')](_0x82ca('0xb'),_0x2a34a9['uniqueid']),_0x2a34a9);utils[_0x82ca('0x2')](util[_0x82ca('0x3')](_0x82ca('0xc'),_0x2a34a9[_0x82ca('0xd')],_0x2a34a9[_0x82ca('0xe')],_0x2a34a9['transferercalleridname'],_0x2a34a9[_0x82ca('0xf')],_0x2a34a9[_0x82ca('0x10')]));_0x2a34a9[_0x82ca('0x5')]='blind';exports[_0x82ca('0x8')][_0x2a34a9[_0x82ca('0x11')]]=_0x2a34a9;writeDB(_0x2a34a9);}catch(_0x410e13){utils['error'](util[_0x82ca('0x3')](_0x82ca('0xb'),_0x2a34a9['uniqueid']),_0x410e13);}};exports[_0x82ca('0x12')]=function(_0x2e01ce){try{utils[_0x82ca('0xa')](util[_0x82ca('0x3')](_0x82ca('0x13'),_0x2e01ce[_0x82ca('0x6')]),_0x2e01ce);utils[_0x82ca('0x2')](util[_0x82ca('0x3')](_0x82ca('0x14'),_0x2e01ce[_0x82ca('0x6')],_0x2e01ce[_0x82ca('0x15')],_0x2e01ce[_0x82ca('0x16')],_0x2e01ce[_0x82ca('0x17')],_0x2e01ce[_0x82ca('0x18')]));_0x2e01ce=_['assign'](_0x2e01ce,{'transfererchannel':_0x2e01ce[_0x82ca('0x19')],'transferercalleridnum':_0x2e01ce[_0x82ca('0x15')],'transferercalleridname':_0x2e01ce[_0x82ca('0x16')],'transfererconnectedlinenum':_0x2e01ce[_0x82ca('0x1a')],'transfererconnectedlinename':_0x2e01ce[_0x82ca('0x1b')],'transfereraccountcode':_0x2e01ce[_0x82ca('0x1c')],'transferercontext':_0x2e01ce[_0x82ca('0x1d')],'transfererexten':_0x2e01ce[_0x82ca('0x1e')],'transfererlinkedid':_0x2e01ce[_0x82ca('0x1f')],'context':_0x2e01ce[_0x82ca('0x20')],'extension':_0x2e01ce[_0x82ca('0x21')],'type':_0x82ca('0x22')});if(_[_0x82ca('0x23')](_0x2e01ce[_0x82ca('0x24')])){_0x2e01ce=_['assign'](_0x2e01ce,{'transfereechannel':_0x2e01ce['transfertargetchannel'],'transfereecalleridnum':_0x2e01ce[_0x82ca('0x17')],'transfereecalleridname':_0x2e01ce[_0x82ca('0x18')],'transfereeconnectedlinenum':_0x2e01ce[_0x82ca('0x25')],'transfereeconnectedlinename':_0x2e01ce['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2e01ce[_0x82ca('0x26')],'transfereecontext':_0x2e01ce[_0x82ca('0x27')],'transfereeexten':_0x2e01ce['transfertargetexten'],'transfereelinkedid':_0x2e01ce[_0x82ca('0x28')]});}writeDB(_0x2e01ce);}catch(_0x45af2f){utils['error'](util[_0x82ca('0x3')](_0x82ca('0x13'),_0x2e01ce[_0x82ca('0x6')]),_0x45af2f);}};
\ No newline at end of file
+var _0xde0b=['request','blinds','debug','format','uniqueid','transferercalleridnum','transfereecalleridname','type','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','attended'];(function(_0x184d10,_0x195b1c){var _0x45ab9d=function(_0x595c06){while(--_0x595c06){_0x184d10['push'](_0x184d10['shift']());}};_0x45ab9d(++_0x195b1c);}(_0xde0b,0x151));var _0xbde0=function(_0x10d546,_0x13ff72){_0x10d546=_0x10d546-0x0;var _0x8b6ff3=_0xde0b[_0x10d546];return _0x8b6ff3;};'use strict';var _=require(_0xbde0('0x0'));var util=require(_0xbde0('0x1'));var utils=require(_0xbde0('0x2'));function writeDB(_0x129ebb){utils[_0xbde0('0x3')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x129ebb['type']===_0xbde0('0x4')?_0x129ebb['origtransfereruniqueid']:_0x129ebb['uniqueid'],_0x129ebb['type']));utils[_0xbde0('0x5')]('CreateVoiceTransferReport',_0x129ebb);}exports[_0xbde0('0x6')]={};exports['blindtransfer']=function(_0x470650){try{utils[_0xbde0('0x7')](util[_0xbde0('0x8')]('[%s][transfers][blindtransfer]',_0x470650[_0xbde0('0x9')]),_0x470650);utils[_0xbde0('0x3')](util[_0xbde0('0x8')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x470650[_0xbde0('0x9')],_0x470650[_0xbde0('0xa')],_0x470650['transferercalleridname'],_0x470650['transfereecalleridnum'],_0x470650[_0xbde0('0xb')]));_0x470650[_0xbde0('0xc')]=_0xbde0('0xd');exports[_0xbde0('0x6')][_0x470650['transfereruniqueid']]=_0x470650;writeDB(_0x470650);}catch(_0x651d0a){utils[_0xbde0('0xe')](util[_0xbde0('0x8')](_0xbde0('0xf'),_0x470650['uniqueid']),_0x651d0a);}};exports[_0xbde0('0x10')]=function(_0x56c374){try{utils[_0xbde0('0x7')](util[_0xbde0('0x8')](_0xbde0('0x11'),_0x56c374[_0xbde0('0x12')]),_0x56c374);utils['info'](util[_0xbde0('0x8')](_0xbde0('0x13'),_0x56c374['origtransfereruniqueid'],_0x56c374[_0xbde0('0x14')],_0x56c374[_0xbde0('0x15')],_0x56c374['transfertargetcalleridnum'],_0x56c374[_0xbde0('0x16')]));_0x56c374=_[_0xbde0('0x17')](_0x56c374,{'transfererchannel':_0x56c374[_0xbde0('0x18')],'transferercalleridnum':_0x56c374[_0xbde0('0x14')],'transferercalleridname':_0x56c374[_0xbde0('0x15')],'transfererconnectedlinenum':_0x56c374[_0xbde0('0x19')],'transfererconnectedlinename':_0x56c374[_0xbde0('0x1a')],'transfereraccountcode':_0x56c374[_0xbde0('0x1b')],'transferercontext':_0x56c374[_0xbde0('0x1c')],'transfererexten':_0x56c374['secondtransfererexten'],'transfererlinkedid':_0x56c374[_0xbde0('0x1d')],'context':_0x56c374[_0xbde0('0x1e')],'extension':_0x56c374['origtransfererexten'],'type':_0xbde0('0x4')});if(_[_0xbde0('0x1f')](_0x56c374[_0xbde0('0x20')])){_0x56c374=_['assign'](_0x56c374,{'transfereechannel':_0x56c374['transfertargetchannel'],'transfereecalleridnum':_0x56c374[_0xbde0('0x21')],'transfereecalleridname':_0x56c374[_0xbde0('0x16')],'transfereeconnectedlinenum':_0x56c374[_0xbde0('0x22')],'transfereeconnectedlinename':_0x56c374['transfertargetconnectedlinename'],'transfereeaccountcode':_0x56c374[_0xbde0('0x23')],'transfereecontext':_0x56c374[_0xbde0('0x24')],'transfereeexten':_0x56c374[_0xbde0('0x25')],'transfereelinkedid':_0x56c374['transfertargetlinkedid']});}writeDB(_0x56c374);}catch(_0x3ba0b3){utils[_0xbde0('0xe')](util['format'](_0xbde0('0x11'),_0x56c374[_0xbde0('0x12')]),_0x3ba0b3);}};
\ No newline at end of file
index 1bd4e1a..29026ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3682=['isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','subtractTime','subtract','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x3682,0xed));var _0x2368=function(_0xf8f6f1,_0x551483){_0xf8f6f1=_0xf8f6f1-0x0;var _0x51db61=_0x3682[_0xf8f6f1];return _0x51db61;};'use strict';var BPromise=require(_0x2368('0x0'));var jayson=require(_0x2368('0x1'));var moment=require(_0x2368('0x2'));var util=require(_0x2368('0x3'));var client=jayson['client'][_0x2368('0x4')]({'port':0x2329});var logger=require(_0x2368('0x5'))('xdr');exports[_0x2368('0x6')]=function(_0x1b951d,_0x32a4c4){logger[_0x2368('0x6')](_0x1b951d,_0x32a4c4?util['inspect'](_0x32a4c4,{'showHidden':![],'depth':null}):'');};exports[_0x2368('0x7')]=function(_0x1219a2,_0x1e9530){logger[_0x2368('0x7')](_0x1219a2,_0x1e9530?util[_0x2368('0x8')](_0x1e9530,{'showHidden':![],'depth':null}):'');};exports[_0x2368('0x9')]=function(_0x1a5a05,_0x487f4b){logger[_0x2368('0x9')](_0x1a5a05,_0x487f4b?util[_0x2368('0x8')](_0x487f4b,{'showHidden':![],'depth':null}):'');};exports[_0x2368('0xa')]=function(_0x5540b3,_0x26d384){return client['request'](_0x5540b3,{'body':_0x26d384})[_0x2368('0xb')](function(_0x3dcc4e){logger[_0x2368('0x7')](_0x2368('0xc'),_0x5540b3,_0x3dcc4e?util[_0x2368('0x8')](_0x3dcc4e,{'showHidden':![],'depth':null}):'');})[_0x2368('0xd')](function(_0x46ab43){logger[_0x2368('0x9')](_0x2368('0xc'),_0x5540b3,_0x46ab43?util[_0x2368('0x8')](_0x46ab43,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2e5c0d){return client[_0x2368('0xa')](_0x2368('0xe'),{'options':{'raw':!![],'attributes':['id',_0x2368('0xf'),_0x2368('0x10'),_0x2368('0x11')],'where':_0x2e5c0d,'limit':0x1}})[_0x2368('0xb')](function(_0x1e4204){logger[_0x2368('0x7')](_0x2368('0x12'),JSON['stringify'](_0x2e5c0d),_0x1e4204?util[_0x2368('0x8')](_0x1e4204,{'showHidden':![],'depth':null}):'');return _0x1e4204[_0x2368('0x13')][_0x2368('0x14')]?_0x1e4204[_0x2368('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x3d38b9){return new BPromise(function(_0x1cceb6,_0x178517){if(_0x3d38b9){return getUser({'internal':_0x3d38b9})[_0x2368('0xb')](function(_0x3d0e3d){logger[_0x2368('0x6')](_0x2368('0x15'),_0x3d38b9,_0x3d0e3d?_0x2368('0x16'):_0x2368('0x17'));return _0x1cceb6(_0x3d0e3d);})[_0x2368('0xd')](function(_0xc05027){logger[_0x2368('0x9')](_0x2368('0x18'),_0xc05027?util[_0x2368('0x8')](_0xc05027,{'showHidden':![],'depth':null}):'');return _0x1cceb6(null);});}return _0x1cceb6(null);});};exports[_0x2368('0x19')]=function(_0xc3a7d9){return new BPromise(function(_0xb7356b,_0x32d660){if(_0xc3a7d9){return getUser({'interface':_0xc3a7d9})[_0x2368('0xb')](function(_0x3c1626){logger[_0x2368('0x6')](_0x2368('0x1a'),_0xc3a7d9,_0x3c1626?_0x2368('0x16'):_0x2368('0x17'));return _0xb7356b(_0x3c1626);})[_0x2368('0xd')](function(_0xc65adc){logger[_0x2368('0x9')](_0x2368('0x1b'),_0xc65adc?util[_0x2368('0x8')](_0xc65adc,{'showHidden':![],'depth':null}):'');return _0xb7356b(null);});}return _0xb7356b(null);});};exports['getUserByName']=function(_0x10f743){return new BPromise(function(_0x2d5a71,_0x56d06c){if(_0x10f743){return getUser({'name':_0x10f743})[_0x2368('0xb')](function(_0x18069f){logger[_0x2368('0x6')](_0x2368('0x1c'),_0x10f743,_0x18069f?_0x2368('0x16'):_0x2368('0x17'));return _0x2d5a71(_0x18069f);})[_0x2368('0xd')](function(_0x532b00){logger[_0x2368('0x9')](_0x2368('0x1d'),_0x532b00?util[_0x2368('0x8')](_0x532b00,{'showHidden':![],'depth':null}):'');return _0x2d5a71(null);});}return _0x2d5a71(null);});};exports[_0x2368('0x1e')]=function(_0x402b15){return new BPromise(function(_0x3b8bb3,_0x2fd3ea){if(_0x402b15){return client[_0x2368('0xa')](_0x2368('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x2368('0x10'),_0x2368('0x20'),'acw','acwTimeout'],'where':{'name':_0x402b15},'limit':0x1}})['then'](function(_0x18bc6b){logger['debug'](_0x2368('0x21'),_0x402b15,_0x18bc6b?util[_0x2368('0x8')](_0x18bc6b,{'showHidden':![],'depth':null}):'');logger[_0x2368('0x6')](_0x2368('0x22'),_0x402b15,_0x18bc6b?'found':_0x2368('0x17'));return _0x3b8bb3(_0x18bc6b['result'][_0x2368('0x14')]?_0x18bc6b[_0x2368('0x13')][0x0]:null);})[_0x2368('0xd')](function(_0x30a48b){logger[_0x2368('0x9')]('[utils][getVoiceQueueByName]',_0x30a48b?util['inspect'](_0x30a48b,{'showHidden':![],'depth':null}):'');return _0x3b8bb3(null);});}return _0x3b8bb3(null);});};exports[_0x2368('0x23')]=function(_0x34ab53,_0x2a8b97){return moment(_0x34ab53)[_0x2368('0x24')](_0x2a8b97,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x2368('0x25')]=function(_0x1c63aa,_0x32a264){return moment(_0x1c63aa)[_0x2368('0x26')](_0x32a264,_0x2368('0x27'))[_0x2368('0x28')](_0x2368('0x29'));};exports['diffTime']=function(_0x2a2ab7,_0x4c6953){return moment(_0x2a2ab7)[_0x2368('0x2a')](moment(_0x4c6953),_0x2368('0x27'));};exports[_0x2368('0x2b')]=function(_0x4dbbe8,_0x27af8f){return parseInt(_0x4dbbe8,0xa)+parseInt(_0x27af8f,0xa);};exports[_0x2368('0x2c')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x2368('0x2d')]=function(_0x51712a,_0x466429){if(_0x466429){return moment(_0x51712a)[_0x2368('0x2d')](_0x466429);}return!![];};exports[_0x2368('0x2e')]=function(_0x49b54d,_0x293b15){if(_0x293b15){return moment(_0x49b54d)['isBefore'](_0x293b15);}else if(_0x49b54d){return!![];}return![];};
\ No newline at end of file
+var _0x6500=['[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','sumTime','isAfter','isBefore','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s'];(function(_0x3a5215,_0x37d84e){var _0x5aa8ea=function(_0x634eb8){while(--_0x634eb8){_0x3a5215['push'](_0x3a5215['shift']());}};_0x5aa8ea(++_0x37d84e);}(_0x6500,0x13b));var _0x0650=function(_0x581b37,_0x342eab){_0x581b37=_0x581b37-0x0;var _0x4f56e5=_0x6500[_0x581b37];return _0x4f56e5;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x0650('0x0'));var moment=require(_0x0650('0x1'));var util=require(_0x0650('0x2'));var client=jayson['client'][_0x0650('0x3')]({'port':0x2329});var logger=require(_0x0650('0x4'))(_0x0650('0x5'));exports[_0x0650('0x6')]=function(_0x11969d,_0x5bc95e){logger[_0x0650('0x6')](_0x11969d,_0x5bc95e?util[_0x0650('0x7')](_0x5bc95e,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0xc02b3,_0x7f455a){logger[_0x0650('0x8')](_0xc02b3,_0x7f455a?util[_0x0650('0x7')](_0x7f455a,{'showHidden':![],'depth':null}):'');};exports[_0x0650('0x9')]=function(_0x528179,_0x419a9d){logger['error'](_0x528179,_0x419a9d?util[_0x0650('0x7')](_0x419a9d,{'showHidden':![],'depth':null}):'');};exports[_0x0650('0xa')]=function(_0x4434c6,_0x584e44){return client[_0x0650('0xa')](_0x4434c6,{'body':_0x584e44})[_0x0650('0xb')](function(_0x7d41a4){logger[_0x0650('0x8')](_0x0650('0xc'),_0x4434c6,_0x7d41a4?util['inspect'](_0x7d41a4,{'showHidden':![],'depth':null}):'');})[_0x0650('0xd')](function(_0x49bc00){logger[_0x0650('0x9')](_0x0650('0xc'),_0x4434c6,_0x49bc00?util['inspect'](_0x49bc00,{'showHidden':![],'depth':null}):'');});};function getUser(_0x394e37){return client['request'](_0x0650('0xe'),{'options':{'raw':!![],'attributes':['id',_0x0650('0xf'),_0x0650('0x10'),_0x0650('0x11')],'where':_0x394e37,'limit':0x1}})[_0x0650('0xb')](function(_0x3168c1){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x0650('0x12')](_0x394e37),_0x3168c1?util['inspect'](_0x3168c1,{'showHidden':![],'depth':null}):'');return _0x3168c1['result'][_0x0650('0x13')]?_0x3168c1[_0x0650('0x14')][0x0]:null;});}exports[_0x0650('0x15')]=function(_0x1217b1){return new BPromise(function(_0x8b6e5e,_0x53db9f){if(_0x1217b1){return getUser({'internal':_0x1217b1})[_0x0650('0xb')](function(_0x2a93cc){logger[_0x0650('0x6')](_0x0650('0x16'),_0x1217b1,_0x2a93cc?_0x0650('0x17'):_0x0650('0x18'));return _0x8b6e5e(_0x2a93cc);})[_0x0650('0xd')](function(_0x5b3357){logger['error'](_0x0650('0x19'),_0x5b3357?util['inspect'](_0x5b3357,{'showHidden':![],'depth':null}):'');return _0x8b6e5e(null);});}return _0x8b6e5e(null);});};exports[_0x0650('0x1a')]=function(_0x7235a1){return new BPromise(function(_0x226b24,_0x4f68c8){if(_0x7235a1){return getUser({'interface':_0x7235a1})[_0x0650('0xb')](function(_0x47d43f){logger[_0x0650('0x6')](_0x0650('0x1b'),_0x7235a1,_0x47d43f?_0x0650('0x17'):_0x0650('0x18'));return _0x226b24(_0x47d43f);})[_0x0650('0xd')](function(_0x1128c0){logger['error'](_0x0650('0x1c'),_0x1128c0?util[_0x0650('0x7')](_0x1128c0,{'showHidden':![],'depth':null}):'');return _0x226b24(null);});}return _0x226b24(null);});};exports[_0x0650('0x1d')]=function(_0x145234){return new BPromise(function(_0x31aec2,_0x100771){if(_0x145234){return getUser({'name':_0x145234})[_0x0650('0xb')](function(_0x3c96ab){logger[_0x0650('0x6')](_0x0650('0x1e'),_0x145234,_0x3c96ab?_0x0650('0x17'):_0x0650('0x18'));return _0x31aec2(_0x3c96ab);})[_0x0650('0xd')](function(_0x289a30){logger[_0x0650('0x9')](_0x0650('0x1f'),_0x289a30?util['inspect'](_0x289a30,{'showHidden':![],'depth':null}):'');return _0x31aec2(null);});}return _0x31aec2(null);});};exports[_0x0650('0x20')]=function(_0x425575){return new BPromise(function(_0x174e14,_0x161010){if(_0x425575){return client[_0x0650('0xa')](_0x0650('0x21'),{'options':{'raw':!![],'attributes':['id',_0x0650('0x10'),_0x0650('0x22'),_0x0650('0x23'),'acwTimeout'],'where':{'name':_0x425575},'limit':0x1}})[_0x0650('0xb')](function(_0x4f2ba3){logger[_0x0650('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x425575,_0x4f2ba3?util['inspect'](_0x4f2ba3,{'showHidden':![],'depth':null}):'');logger[_0x0650('0x6')](_0x0650('0x24'),_0x425575,_0x4f2ba3?'found':_0x0650('0x18'));return _0x174e14(_0x4f2ba3[_0x0650('0x14')]['length']?_0x4f2ba3['result'][0x0]:null);})['catch'](function(_0x3c2e62){logger[_0x0650('0x9')](_0x0650('0x25'),_0x3c2e62?util[_0x0650('0x7')](_0x3c2e62,{'showHidden':![],'depth':null}):'');return _0x174e14(null);});}return _0x174e14(null);});};exports['addTime']=function(_0x3daecf,_0x2ce323){return moment(_0x3daecf)[_0x0650('0x26')](_0x2ce323,'seconds')[_0x0650('0x27')](_0x0650('0x28'));};exports[_0x0650('0x29')]=function(_0x31460f,_0x11ccca){return moment(_0x31460f)[_0x0650('0x2a')](_0x11ccca,_0x0650('0x2b'))[_0x0650('0x27')](_0x0650('0x28'));};exports[_0x0650('0x2c')]=function(_0x27b792,_0x5e0c82){return moment(_0x27b792)[_0x0650('0x2d')](moment(_0x5e0c82),_0x0650('0x2b'));};exports[_0x0650('0x2e')]=function(_0xa6f9f7,_0x20ac3f){return parseInt(_0xa6f9f7,0xa)+parseInt(_0x20ac3f,0xa);};exports['now']=function(){return moment()[_0x0650('0x27')](_0x0650('0x28'));};exports[_0x0650('0x2f')]=function(_0x13fc83,_0x1774f8){if(_0x1774f8){return moment(_0x13fc83)[_0x0650('0x2f')](_0x1774f8);}return!![];};exports[_0x0650('0x30')]=function(_0x2784ad,_0x16fbaa){if(_0x16fbaa){return moment(_0x2784ad)['isBefore'](_0x16fbaa);}else if(_0x2784ad){return!![];}return![];};
\ No newline at end of file